From: support Date: Mon, 21 Nov 2022 06:46:02 +0000 (+0000) Subject: Built motion from commit 54184aa2.|2.6.22 X-Git-Url: http://repos.xcallymotion.com/base//%22angular-material.themes.css/%22?a=commitdiff_plain;h=45a8d2d5c226a641350811b02cc5a8b45a63bdb0;p=motion2.git Built motion from commit 54184aa2.|2.6.22 --- diff --git a/apidoc/api_project.js b/apidoc/api_project.js index 68cca10..b2b7a27 100644 --- a/apidoc/api_project.js +++ b/apidoc/api_project.js @@ -17,7 +17,7 @@ define({ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2022-11-18T08:13:42.983Z", + "time": "2022-11-21T06:37:23.710Z", "url": "http://apidocjs.com", "version": "0.24.0" } diff --git a/apidoc/api_project.json b/apidoc/api_project.json index 291d413..2ec647e 100644 --- a/apidoc/api_project.json +++ b/apidoc/api_project.json @@ -17,7 +17,7 @@ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2022-11-18T08:13:42.983Z", + "time": "2022-11-21T06:37:23.710Z", "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 ee8bcdc..705037c 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 _0xa723=['Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','STRING','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','urlForward[headers],\x20browser[wsindowHeight]','TEXT','urlForward[body]','sequelize','exports','getDataValue','contactManager','integration','motionbar','urlForward','browser'];(function(_0x12dd61,_0x7ccade){var _0x1d8659=function(_0x580867){while(--_0x580867){_0x12dd61['push'](_0x12dd61['shift']());}};_0x1d8659(++_0x7ccade);}(_0xa723,0x76));var _0x3a72=function(_0x2cde0a,_0x1f9695){_0x2cde0a=_0x2cde0a-0x0;var _0x260610=_0xa723[_0x2cde0a];return _0x260610;};'use strict';var Sequelize=require(_0x3a72('0x0'));module[_0x3a72('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x286efe){return this[_0x3a72('0x2')]('action');}},'action':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'isIn':{'args':[[_0x3a72('0x3'),_0x3a72('0x4'),_0x3a72('0x5'),'jscripty',_0x3a72('0x6'),_0x3a72('0x7'),'bot','script']],'msg':_0x3a72('0x8')}},'comment':_0x3a72('0x8')},'data1':{'type':Sequelize['STRING'](0x1000),'comment':_0x3a72('0x9')},'data2':{'type':Sequelize[_0x3a72('0xa')](0x1000),'comment':_0x3a72('0xb')},'data3':{'type':Sequelize[_0x3a72('0xa')](0x1000),'comment':_0x3a72('0xc')},'data4':{'type':Sequelize[_0x3a72('0xa')](0x1000),'comments':_0x3a72('0xd')},'data5':{'type':Sequelize[_0x3a72('0xa')](0x1000),'comments':_0x3a72('0xe')},'data6':{'type':Sequelize[_0x3a72('0xa')],'comments':_0x3a72('0xf')},'data7':{'type':Sequelize[_0x3a72('0x10')],'comments':_0x3a72('0x11')}}; \ No newline at end of file +var _0xffaa=['contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','urlForward[headers],\x20browser[wsindowHeight]','urlForward[body]','sequelize','exports','getDataValue','action','STRING','contactManager','integration','motionbar','jscripty','urlForward','browser','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'];(function(_0x15c877,_0x5132e5){var _0x7f9aa0=function(_0x4a2931){while(--_0x4a2931){_0x15c877['push'](_0x15c877['shift']());}};_0x7f9aa0(++_0x5132e5);}(_0xffaa,0xb1));var _0xaffa=function(_0x4f4c01,_0x248f61){_0x4f4c01=_0x4f4c01-0x0;var _0x303686=_0xffaa[_0x4f4c01];return _0x303686;};'use strict';var Sequelize=require(_0xaffa('0x0'));module[_0xaffa('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x13150a){return this[_0xaffa('0x2')](_0xaffa('0x3'));}},'action':{'type':Sequelize[_0xaffa('0x4')],'allowNull':![],'validate':{'isIn':{'args':[[_0xaffa('0x5'),_0xaffa('0x6'),_0xaffa('0x7'),_0xaffa('0x8'),_0xaffa('0x9'),_0xaffa('0xa'),'bot',_0xaffa('0xb')]],'msg':_0xaffa('0xc')}},'comment':_0xaffa('0xc')},'data1':{'type':Sequelize['STRING'](0x1000),'comment':'jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]'},'data2':{'type':Sequelize['STRING'](0x1000),'comment':_0xaffa('0xd')},'data3':{'type':Sequelize[_0xaffa('0x4')](0x1000),'comment':_0xaffa('0xe')},'data4':{'type':Sequelize[_0xaffa('0x4')](0x1000),'comments':_0xaffa('0xf')},'data5':{'type':Sequelize[_0xaffa('0x4')](0x1000),'comments':_0xaffa('0x10')},'data6':{'type':Sequelize['STRING'],'comments':_0xaffa('0x11')},'data7':{'type':Sequelize['TEXT'],'comments':_0xaffa('0x12')}}; \ No newline at end of file diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js index 031343f..f802c47 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 _0xa387=['../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','name','send','body','Action','find','params','catch','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api'];(function(_0x2847e9,_0x21e5ab){var _0x52cb62=function(_0x10b897){while(--_0x10b897){_0x2847e9['push'](_0x2847e9['shift']());}};_0x52cb62(++_0x21e5ab);}(_0xa387,0xec));var _0x7a38=function(_0x14f431,_0x23f764){_0x14f431=_0x14f431-0x0;var _0x23f73b=_0xa387[_0x14f431];return _0x23f73b;};'use strict';var emlformat=require(_0x7a38('0x0'));var rimraf=require(_0x7a38('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7a38('0x2'));var rp=require('request-promise');var moment=require(_0x7a38('0x3'));var BPromise=require(_0x7a38('0x4'));var Mustache=require(_0x7a38('0x5'));var util=require('util');var path=require(_0x7a38('0x6'));var sox=require(_0x7a38('0x7'));var csv=require('to-csv');var ejs=require(_0x7a38('0x8'));var fs=require('fs');var fs_extra=require(_0x7a38('0x9'));var _=require(_0x7a38('0xa'));var squel=require(_0x7a38('0xb'));var crypto=require(_0x7a38('0xc'));var jsforce=require(_0x7a38('0xd'));var deskjs=require(_0x7a38('0xe'));var toCsv=require(_0x7a38('0xf'));var querystring=require(_0x7a38('0x10'));var Papa=require(_0x7a38('0x11'));var Redis=require(_0x7a38('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x7a38('0x13'));var as=require(_0x7a38('0x14'));var hardwareService=require(_0x7a38('0x15'));var logger=require(_0x7a38('0x16'))(_0x7a38('0x17'));var utils=require(_0x7a38('0x18'));var config=require(_0x7a38('0x19'));var licenseUtil=require(_0x7a38('0x1a'));var db=require(_0x7a38('0x1b'))['db'];function respondWithStatusCode(_0x186d1b,_0x2999aa){_0x2999aa=_0x2999aa||0xcc;return function(_0x36ccba){if(_0x36ccba){return _0x186d1b[_0x7a38('0x1c')](_0x2999aa);}return _0x186d1b['status'](_0x2999aa)[_0x7a38('0x1d')]();};}function respondWithResult(_0xc014bd,_0x46984a){_0x46984a=_0x46984a||0xc8;return function(_0x383db7){if(_0x383db7){return _0xc014bd[_0x7a38('0x1e')](_0x46984a)[_0x7a38('0x1f')](_0x383db7);}};}function respondWithFilteredResult(_0x577309,_0x2264a3){return function(_0x3089c3){if(_0x3089c3){var _0x4e973c=typeof _0x2264a3[_0x7a38('0x20')]===_0x7a38('0x21')&&typeof _0x2264a3[_0x7a38('0x22')]==='undefined';var _0x25fe38=_0x3089c3['count'];var _0x2c61a0=_0x4e973c?0x0:_0x2264a3[_0x7a38('0x20')];var _0x563fbd=_0x4e973c?_0x3089c3[_0x7a38('0x23')]:_0x2264a3['offset']+_0x2264a3[_0x7a38('0x22')];var _0x5dfd06;if(_0x563fbd>=_0x25fe38){_0x563fbd=_0x25fe38;_0x5dfd06=0xc8;}else{_0x5dfd06=0xce;}_0x577309[_0x7a38('0x1e')](_0x5dfd06);return _0x577309[_0x7a38('0x24')](_0x7a38('0x25'),_0x2c61a0+'-'+_0x563fbd+'/'+_0x25fe38)['json'](_0x3089c3);}return null;};}function patchUpdates(_0x1e279d){return function(_0x2e193b){try{jsonpatch[_0x7a38('0x26')](_0x2e193b,_0x1e279d,!![]);}catch(_0x2c8250){return BPromise[_0x7a38('0x27')](_0x2c8250);}return _0x2e193b[_0x7a38('0x28')]();};}function saveUpdates(_0xbd4885,_0x5bf05b){return function(_0x46a9a8){if(_0x46a9a8){return _0x46a9a8[_0x7a38('0x29')](_0xbd4885)[_0x7a38('0x2a')](function(_0x1b7496){return _0x1b7496;});}return null;};}function removeEntity(_0x31ddee,_0x16bae1){return function(_0x83d8a7){if(_0x83d8a7){return _0x83d8a7[_0x7a38('0x2b')]()['then'](function(){_0x31ddee['status'](0xcc)[_0x7a38('0x1d')]();});}};}function handleEntityNotFound(_0x154ebf,_0x52abab){return function(_0x353936){if(!_0x353936){_0x154ebf['sendStatus'](0x194);}return _0x353936;};}function handleError(_0x36e991,_0xbfa7f4){_0xbfa7f4=_0xbfa7f4||0x1f4;return function(_0x142404){logger[_0x7a38('0x2c')](_0x142404['stack']);if(_0x142404[_0x7a38('0x2d')]){delete _0x142404[_0x7a38('0x2d')];}_0x36e991[_0x7a38('0x1e')](_0xbfa7f4)[_0x7a38('0x2e')](_0x142404);};}exports[_0x7a38('0x29')]=function(_0x782f09,_0x554574){if(_0x782f09[_0x7a38('0x2f')]['id']){delete _0x782f09[_0x7a38('0x2f')]['id'];}return db[_0x7a38('0x30')][_0x7a38('0x31')]({'where':{'id':_0x782f09[_0x7a38('0x32')]['id']}})[_0x7a38('0x2a')](handleEntityNotFound(_0x554574,null))[_0x7a38('0x2a')](saveUpdates(_0x782f09['body'],null))['then'](respondWithResult(_0x554574,null))[_0x7a38('0x33')](handleError(_0x554574,null));};exports[_0x7a38('0x2b')]=function(_0x5930d4,_0x111932){return db[_0x7a38('0x30')][_0x7a38('0x31')]({'where':{'id':_0x5930d4[_0x7a38('0x32')]['id']}})['then'](handleEntityNotFound(_0x111932,null))[_0x7a38('0x2a')](removeEntity(_0x111932,null))[_0x7a38('0x33')](handleError(_0x111932,null));}; \ No newline at end of file +var _0x71ff=['Action','find','params','catch','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','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/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','save','update','then','destroy','error','stack','name','send','body'];(function(_0x3a166a,_0x2018be){var _0x1b0279=function(_0x5b98dd){while(--_0x5b98dd){_0x3a166a['push'](_0x3a166a['shift']());}};_0x1b0279(++_0x2018be);}(_0x71ff,0xc4));var _0xf71f=function(_0x16a4a6,_0x31617c){_0x16a4a6=_0x16a4a6-0x0;var _0x389df0=_0x71ff[_0x16a4a6];return _0x389df0;};'use strict';var emlformat=require(_0xf71f('0x0'));var rimraf=require(_0xf71f('0x1'));var zipdir=require(_0xf71f('0x2'));var jsonpatch=require(_0xf71f('0x3'));var rp=require(_0xf71f('0x4'));var moment=require('moment');var BPromise=require(_0xf71f('0x5'));var Mustache=require(_0xf71f('0x6'));var util=require('util');var path=require(_0xf71f('0x7'));var sox=require(_0xf71f('0x8'));var csv=require(_0xf71f('0x9'));var ejs=require(_0xf71f('0xa'));var fs=require('fs');var fs_extra=require(_0xf71f('0xb'));var _=require(_0xf71f('0xc'));var squel=require(_0xf71f('0xd'));var crypto=require(_0xf71f('0xe'));var jsforce=require(_0xf71f('0xf'));var deskjs=require(_0xf71f('0x10'));var toCsv=require(_0xf71f('0x9'));var querystring=require(_0xf71f('0x11'));var Papa=require('papaparse');var Redis=require(_0xf71f('0x12'));var authService=require(_0xf71f('0x13'));var qs=require(_0xf71f('0x14'));var as=require(_0xf71f('0x15'));var hardwareService=require(_0xf71f('0x16'));var logger=require('../../config/logger')(_0xf71f('0x17'));var utils=require('../../config/utils');var config=require(_0xf71f('0x18'));var licenseUtil=require(_0xf71f('0x19'));var db=require(_0xf71f('0x1a'))['db'];function respondWithStatusCode(_0x3234cc,_0x23e5a9){_0x23e5a9=_0x23e5a9||0xcc;return function(_0x170d4f){if(_0x170d4f){return _0x3234cc[_0xf71f('0x1b')](_0x23e5a9);}return _0x3234cc[_0xf71f('0x1c')](_0x23e5a9)[_0xf71f('0x1d')]();};}function respondWithResult(_0x2382ad,_0x542ad8){_0x542ad8=_0x542ad8||0xc8;return function(_0x2e2b4f){if(_0x2e2b4f){return _0x2382ad[_0xf71f('0x1c')](_0x542ad8)['json'](_0x2e2b4f);}};}function respondWithFilteredResult(_0x24334b,_0xc86856){return function(_0x2c3aa1){if(_0x2c3aa1){var _0x3327f5=typeof _0xc86856[_0xf71f('0x1e')]===_0xf71f('0x1f')&&typeof _0xc86856[_0xf71f('0x20')]==='undefined';var _0x33f3bf=_0x2c3aa1[_0xf71f('0x21')];var _0x58c60a=_0x3327f5?0x0:_0xc86856['offset'];var _0x43624c=_0x3327f5?_0x2c3aa1[_0xf71f('0x21')]:_0xc86856[_0xf71f('0x1e')]+_0xc86856[_0xf71f('0x20')];var _0x2fe828;if(_0x43624c>=_0x33f3bf){_0x43624c=_0x33f3bf;_0x2fe828=0xc8;}else{_0x2fe828=0xce;}_0x24334b[_0xf71f('0x1c')](_0x2fe828);return _0x24334b[_0xf71f('0x22')]('Content-Range',_0x58c60a+'-'+_0x43624c+'/'+_0x33f3bf)['json'](_0x2c3aa1);}return null;};}function patchUpdates(_0x3adad7){return function(_0x1d7084){try{jsonpatch['apply'](_0x1d7084,_0x3adad7,!![]);}catch(_0x71d14c){return BPromise['reject'](_0x71d14c);}return _0x1d7084[_0xf71f('0x23')]();};}function saveUpdates(_0x2872fb,_0x4e0993){return function(_0x53fda7){if(_0x53fda7){return _0x53fda7[_0xf71f('0x24')](_0x2872fb)[_0xf71f('0x25')](function(_0x3ab21d){return _0x3ab21d;});}return null;};}function removeEntity(_0x3a5bd2,_0x4404a1){return function(_0x344a13){if(_0x344a13){return _0x344a13[_0xf71f('0x26')]()[_0xf71f('0x25')](function(){_0x3a5bd2['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3e4702,_0x83c945){return function(_0x39c4ba){if(!_0x39c4ba){_0x3e4702[_0xf71f('0x1b')](0x194);}return _0x39c4ba;};}function handleError(_0x22f2c4,_0x5d0023){_0x5d0023=_0x5d0023||0x1f4;return function(_0x412702){logger[_0xf71f('0x27')](_0x412702[_0xf71f('0x28')]);if(_0x412702[_0xf71f('0x29')]){delete _0x412702[_0xf71f('0x29')];}_0x22f2c4['status'](_0x5d0023)[_0xf71f('0x2a')](_0x412702);};}exports[_0xf71f('0x24')]=function(_0x2dcc0f,_0x3f9b53){if(_0x2dcc0f[_0xf71f('0x2b')]['id']){delete _0x2dcc0f[_0xf71f('0x2b')]['id'];}return db[_0xf71f('0x2c')][_0xf71f('0x2d')]({'where':{'id':_0x2dcc0f[_0xf71f('0x2e')]['id']}})[_0xf71f('0x25')](handleEntityNotFound(_0x3f9b53,null))[_0xf71f('0x25')](saveUpdates(_0x2dcc0f[_0xf71f('0x2b')],null))[_0xf71f('0x25')](respondWithResult(_0x3f9b53,null))[_0xf71f('0x2f')](handleError(_0x3f9b53,null));};exports[_0xf71f('0x26')]=function(_0x4b39e0,_0x4f31e){return db[_0xf71f('0x2c')]['find']({'where':{'id':_0x4b39e0['params']['id']}})[_0xf71f('0x25')](handleEntityNotFound(_0x4f31e,null))[_0xf71f('0x25')](removeEntity(_0x4f31e,null))[_0xf71f('0x2f')](handleError(_0x4f31e,null));}; \ No newline at end of file diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js index 8dae763..3581c83 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 _0xd4bf=['bluebird','request-promise','path','../../config/environment','./action.attributes','exports','define','lodash','util','../../config/logger','moment'];(function(_0x460310,_0x57e4c2){var _0x5bd45a=function(_0xd3b7cf){while(--_0xd3b7cf){_0x460310['push'](_0x460310['shift']());}};_0x5bd45a(++_0x57e4c2);}(_0xd4bf,0x11a));var _0xfd4b=function(_0x1cc567,_0x5352fb){_0x1cc567=_0x1cc567-0x0;var _0x51136c=_0xd4bf[_0x1cc567];return _0x51136c;};'use strict';var _=require(_0xfd4b('0x0'));var util=require(_0xfd4b('0x1'));var logger=require(_0xfd4b('0x2'))('api');var moment=require(_0xfd4b('0x3'));var BPromise=require(_0xfd4b('0x4'));var rp=require(_0xfd4b('0x5'));var fs=require('fs');var path=require(_0xfd4b('0x6'));var rimraf=require('rimraf');var config=require(_0xfd4b('0x7'));var attributes=require(_0xfd4b('0x8'));module[_0xfd4b('0x9')]=function(_0x4e5453,_0x4bbe00){return _0x4e5453[_0xfd4b('0xa')]('Action',attributes,{'tableName':'tools_actions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x553e=['../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./action.attributes','exports','Action','tools_actions','lodash','util'];(function(_0x20ef64,_0x4a8fe9){var _0x3707d8=function(_0x5b9a88){while(--_0x5b9a88){_0x20ef64['push'](_0x20ef64['shift']());}};_0x3707d8(++_0x4a8fe9);}(_0x553e,0x10f));var _0xe553=function(_0x3167b8,_0x3ef702){_0x3167b8=_0x3167b8-0x0;var _0x46020c=_0x553e[_0x3167b8];return _0x46020c;};'use strict';var _=require(_0xe553('0x0'));var util=require(_0xe553('0x1'));var logger=require(_0xe553('0x2'))(_0xe553('0x3'));var moment=require(_0xe553('0x4'));var BPromise=require(_0xe553('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe553('0x6'));var rimraf=require(_0xe553('0x7'));var config=require(_0xe553('0x8'));var attributes=require(_0xe553('0x9'));module[_0xe553('0xa')]=function(_0x1c2149,_0x325813){return _0x1c2149['define'](_0xe553('0xb'),attributes,{'tableName':_0xe553('0xc'),'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 f8b9981..b87b7a0 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 _0x4975=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','moment','bluebird','randomstring'];(function(_0x6131cd,_0x4c26a1){var _0x47e916=function(_0x1f2bce){while(--_0x1f2bce){_0x6131cd['push'](_0x6131cd['shift']());}};_0x47e916(++_0x4c26a1);}(_0x4975,0x86));var _0x5497=function(_0xfa937f,_0x5d464c){_0xfa937f=_0xfa937f-0x0;var _0x5e0a18=_0x4975[_0xfa937f];return _0x5e0a18;};'use strict';var _=require(_0x5497('0x0'));var util=require('util');var moment=require(_0x5497('0x1'));var BPromise=require(_0x5497('0x2'));var rs=require(_0x5497('0x3'));var fs=require('fs');var Redis=require(_0x5497('0x4'));var db=require(_0x5497('0x5'))['db'];var utils=require(_0x5497('0x6'));var logger=require(_0x5497('0x7'))(_0x5497('0x8'));var config=require(_0x5497('0x9'));var jayson=require(_0x5497('0xa'));var client=jayson['client'][_0x5497('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4f563d,_0x1d0019,_0x674a2a){return new BPromise(function(_0x368e8b,_0x57f930){return client[_0x5497('0xc')](_0x4f563d,_0x674a2a)['then'](function(_0x1f63d8){logger[_0x5497('0xd')](_0x5497('0xe'),_0x1d0019,_0x5497('0xf'));logger[_0x5497('0x10')](_0x5497('0x11'),_0x1d0019,_0x5497('0xf'),JSON[_0x5497('0x12')](_0x1f63d8));if(_0x1f63d8['error']){if(_0x1f63d8['error']['code']===0x1f4){logger[_0x5497('0x13')](_0x5497('0xe'),_0x1d0019,_0x1f63d8[_0x5497('0x13')][_0x5497('0x14')]);return _0x57f930(_0x1f63d8[_0x5497('0x13')][_0x5497('0x14')]);}logger[_0x5497('0x13')](_0x5497('0xe'),_0x1d0019,_0x1f63d8[_0x5497('0x13')][_0x5497('0x14')]);return _0x368e8b(_0x1f63d8['error'][_0x5497('0x14')]);}else{logger['info'](_0x5497('0xe'),_0x1d0019,_0x5497('0xf'));_0x368e8b(_0x1f63d8[_0x5497('0x15')][_0x5497('0x14')]);}})[_0x5497('0x16')](function(_0x4073e6){logger[_0x5497('0x13')]('Action,\x20%s,\x20%s',_0x1d0019,_0x4073e6);_0x57f930(_0x4073e6);});});} \ No newline at end of file +var _0x1cb9=['error','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x49ca18,_0x5e6d05){var _0x145d54=function(_0x30b9be){while(--_0x30b9be){_0x49ca18['push'](_0x49ca18['shift']());}};_0x145d54(++_0x5e6d05);}(_0x1cb9,0x14e));var _0x91cb=function(_0x1adb4f,_0x5f28c3){_0x1adb4f=_0x1adb4f-0x0;var _0x4f2d17=_0x1cb9[_0x1adb4f];return _0x4f2d17;};'use strict';var _=require(_0x91cb('0x0'));var util=require('util');var moment=require(_0x91cb('0x1'));var BPromise=require(_0x91cb('0x2'));var rs=require(_0x91cb('0x3'));var fs=require('fs');var Redis=require(_0x91cb('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x91cb('0x5'));var logger=require(_0x91cb('0x6'))('rpc');var config=require(_0x91cb('0x7'));var jayson=require(_0x91cb('0x8'));var client=jayson[_0x91cb('0x9')][_0x91cb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3b9d98,_0x8f8a3b,_0x4c1f56){return new BPromise(function(_0x15c517,_0x5bda2f){return client[_0x91cb('0xb')](_0x3b9d98,_0x4c1f56)['then'](function(_0xa43e7a){logger[_0x91cb('0xc')](_0x91cb('0xd'),_0x8f8a3b,_0x91cb('0xe'));logger[_0x91cb('0xf')](_0x91cb('0x10'),_0x8f8a3b,_0x91cb('0xe'),JSON[_0x91cb('0x11')](_0xa43e7a));if(_0xa43e7a[_0x91cb('0x12')]){if(_0xa43e7a[_0x91cb('0x12')]['code']===0x1f4){logger[_0x91cb('0x12')](_0x91cb('0xd'),_0x8f8a3b,_0xa43e7a['error'][_0x91cb('0x13')]);return _0x5bda2f(_0xa43e7a[_0x91cb('0x12')][_0x91cb('0x13')]);}logger[_0x91cb('0x12')]('Action,\x20%s,\x20%s',_0x8f8a3b,_0xa43e7a['error'][_0x91cb('0x13')]);return _0x15c517(_0xa43e7a[_0x91cb('0x12')]['message']);}else{logger['info'](_0x91cb('0xd'),_0x8f8a3b,_0x91cb('0xe'));_0x15c517(_0xa43e7a[_0x91cb('0x14')]['message']);}})[_0x91cb('0x15')](function(_0x135890){logger['error'](_0x91cb('0xd'),_0x8f8a3b,_0x135890);_0x5bda2f(_0x135890);});});} \ No newline at end of file diff --git a/server/api/action/index.js b/server/api/action/index.js index dc735a2..83b578a 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 _0xa3f0=['path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./action.controller','put','/:id','isAuthenticated','destroy','util'];(function(_0x52e113,_0x3c86b4){var _0x3fa3b7=function(_0x283ac4){while(--_0x283ac4){_0x52e113['push'](_0x52e113['shift']());}};_0x3fa3b7(++_0x3c86b4);}(_0xa3f0,0x107));var _0x0a3f=function(_0x570016,_0x111cb9){_0x570016=_0x570016-0x0;var _0x3b4176=_0xa3f0[_0x570016];return _0x3b4176;};'use strict';var multer=require('multer');var util=require(_0x0a3f('0x0'));var path=require(_0x0a3f('0x1'));var timeout=require(_0x0a3f('0x2'));var express=require('express');var router=express[_0x0a3f('0x3')]();var fs_extra=require(_0x0a3f('0x4'));var auth=require(_0x0a3f('0x5'));var interaction=require(_0x0a3f('0x6'));var config=require('../../config/environment');var controller=require(_0x0a3f('0x7'));router[_0x0a3f('0x8')]('/:id',auth['isAuthenticated'](),controller['update']);router['delete'](_0x0a3f('0x9'),auth[_0x0a3f('0xa')](),controller[_0x0a3f('0xb')]);module['exports']=router; \ No newline at end of file +var _0xb818=['../../components/interaction/service','../../config/environment','./action.controller','isAuthenticated','update','delete','/:id','exports','multer','util','connect-timeout','express','Router','fs-extra'];(function(_0x4bf6ba,_0x48a8c2){var _0x355de2=function(_0x4aede3){while(--_0x4aede3){_0x4bf6ba['push'](_0x4bf6ba['shift']());}};_0x355de2(++_0x48a8c2);}(_0xb818,0x112));var _0x8b81=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0xb818[_0x138adb];return _0x1b27f2;};'use strict';var multer=require(_0x8b81('0x0'));var util=require(_0x8b81('0x1'));var path=require('path');var timeout=require(_0x8b81('0x2'));var express=require(_0x8b81('0x3'));var router=express[_0x8b81('0x4')]();var fs_extra=require(_0x8b81('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x8b81('0x6'));var config=require(_0x8b81('0x7'));var controller=require(_0x8b81('0x8'));router['put']('/:id',auth[_0x8b81('0x9')](),controller[_0x8b81('0xa')]);router[_0x8b81('0xb')](_0x8b81('0xc'),auth['isAuthenticated'](),controller['destroy']);module[_0x8b81('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 913befd..f947ee8 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 _0x5075=['exports','STRING','TEXT','sequelize'];(function(_0x202b05,_0x5a246c){var _0x22a0a7=function(_0x5157f2){while(--_0x5157f2){_0x202b05['push'](_0x202b05['shift']());}};_0x22a0a7(++_0x5a246c);}(_0x5075,0x73));var _0x5507=function(_0x4382bc,_0x231a2d){_0x4382bc=_0x4382bc-0x0;var _0x13c82a=_0x5075[_0x4382bc];return _0x13c82a;};'use strict';var Sequelize=require(_0x5507('0x0'));module[_0x5507('0x1')]={'name':{'type':Sequelize[_0x5507('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x5507('0x2')]},'parent':{'type':Sequelize[_0x5507('0x2')]},'table':{'type':Sequelize[_0x5507('0x2')]},'conditions':{'type':Sequelize[_0x5507('0x3')]},'joins':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0x7fbe=['STRING','TEXT'];(function(_0x32986,_0x4489c8){var _0x355ebb=function(_0x338840){while(--_0x338840){_0x32986['push'](_0x32986['shift']());}};_0x355ebb(++_0x4489c8);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x337800,_0x1e986e){_0x337800=_0x337800-0x0;var _0x2caa1d=_0x7fbe[_0x337800];return _0x2caa1d;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xe7fb('0x0')],'allowNull':![]},'description':{'type':Sequelize[_0xe7fb('0x0')]},'parent':{'type':Sequelize[_0xe7fb('0x0')]},'table':{'type':Sequelize[_0xe7fb('0x0')]},'conditions':{'type':Sequelize[_0xe7fb('0x1')]},'joins':{'type':Sequelize[_0xe7fb('0x1')]}}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js index 67c1ef1..12a18d8 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 _0x3c9a=['offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','get','UserProfileResource','destroy','sendStatus','stack','name','send','index','map','AnalyticCustomReport','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','findAll','rows','show','params','keys','fields','options','find','catch','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','userProfileId','autoAssociation','create','CustomReports','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','join','left_join','right_join','cross_join','SUM(%s)','COUNT(%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','operator','group','rules','value','getFields','Sequelize','ValidationErrorItem','keyBy','select','from','table','MetricId','metric','field','replace','format','groupBy','orderBy','DESC','alias','joins','parse','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','COUNT(DISTINCT\x20%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','DATE(%s)','IS\x20NULL','condition','Please\x20insert\x20at\x20least\x20one\x20field','function','web','fullPath','%s-%s.%s','randomstring','csv','AnalyticExtractedReport','.calldate\x20BETWEEN\x20?\x20AND\x20?','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','fork','../../components/export/','output','../../files/reports','savename','countTable','COUNT(*)','SELECT','run','runReport','IS\x20EMPTY','AnalyticMetric','eml-format','rimraf','zip-dir','request-promise','mustache','util','sox','to-csv','fs-extra','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','dbH','end','status','json'];(function(_0x4d952,_0x1e76d9){var _0x19f777=function(_0xaa44a){while(--_0xaa44a){_0x4d952['push'](_0x4d952['shift']());}};_0x19f777(++_0x1e76d9);}(_0x3c9a,0x131));var _0xa3c9=function(_0x58a0f2,_0xda36f5){_0x58a0f2=_0x58a0f2-0x0;var _0x590bb=_0x3c9a[_0x58a0f2];return _0x590bb;};'use strict';var emlformat=require(_0xa3c9('0x0'));var rimraf=require(_0xa3c9('0x1'));var zipdir=require(_0xa3c9('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa3c9('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xa3c9('0x4'));var util=require(_0xa3c9('0x5'));var path=require('path');var sox=require(_0xa3c9('0x6'));var csv=require(_0xa3c9('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa3c9('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xa3c9('0x9'));var jsforce=require(_0xa3c9('0xa'));var deskjs=require('desk.js');var toCsv=require(_0xa3c9('0x7'));var querystring=require('querystring');var Papa=require(_0xa3c9('0xb'));var Redis=require(_0xa3c9('0xc'));var authService=require(_0xa3c9('0xd'));var qs=require(_0xa3c9('0xe'));var as=require(_0xa3c9('0xf'));var hardwareService=require(_0xa3c9('0x10'));var logger=require(_0xa3c9('0x11'))(_0xa3c9('0x12'));var utils=require(_0xa3c9('0x13'));var config=require(_0xa3c9('0x14'));var licenseUtil=require(_0xa3c9('0x15'));var db=require(_0xa3c9('0x16'))['db'];var dbH=require(_0xa3c9('0x16'))[_0xa3c9('0x17')];function respondWithStatusCode(_0x372a0c,_0xde5b8d){_0xde5b8d=_0xde5b8d||0xcc;return function(_0x46c4f4){if(_0x46c4f4){return _0x372a0c['sendStatus'](_0xde5b8d);}return _0x372a0c['status'](_0xde5b8d)[_0xa3c9('0x18')]();};}function respondWithResult(_0xfaee7a,_0x2f9304){_0x2f9304=_0x2f9304||0xc8;return function(_0xf26d98){if(_0xf26d98){return _0xfaee7a[_0xa3c9('0x19')](_0x2f9304)[_0xa3c9('0x1a')](_0xf26d98);}};}function respondWithFilteredResult(_0x1e3406,_0x46cd3f){return function(_0x4a5d6e){if(_0x4a5d6e){var _0x4bf812=typeof _0x46cd3f[_0xa3c9('0x1b')]===_0xa3c9('0x1c')&&typeof _0x46cd3f[_0xa3c9('0x1d')]===_0xa3c9('0x1c');var _0x4424b1=_0x4a5d6e['count'];var _0x3e33ff=_0x4bf812?0x0:_0x46cd3f[_0xa3c9('0x1b')];var _0x34e45f=_0x4bf812?_0x4a5d6e[_0xa3c9('0x1e')]:_0x46cd3f[_0xa3c9('0x1b')]+_0x46cd3f[_0xa3c9('0x1d')];var _0x3a2c5b;if(_0x34e45f>=_0x4424b1){_0x34e45f=_0x4424b1;_0x3a2c5b=0xc8;}else{_0x3a2c5b=0xce;}_0x1e3406['status'](_0x3a2c5b);return _0x1e3406['set'](_0xa3c9('0x1f'),_0x3e33ff+'-'+_0x34e45f+'/'+_0x4424b1)[_0xa3c9('0x1a')](_0x4a5d6e);}return null;};}function patchUpdates(_0x3dee1f){return function(_0xf922da){try{jsonpatch[_0xa3c9('0x20')](_0xf922da,_0x3dee1f,!![]);}catch(_0x4f7ecd){return BPromise[_0xa3c9('0x21')](_0x4f7ecd);}return _0xf922da[_0xa3c9('0x22')]();};}function saveUpdates(_0x3d30b6,_0x1a5964){return function(_0x290165){if(_0x290165){return _0x290165[_0xa3c9('0x23')](_0x3d30b6)[_0xa3c9('0x24')](function(_0x3cee59){return _0x3cee59;});}return null;};}function removeEntity(_0x9b1f18,_0x39533f){return function(_0x341a17){if(_0x341a17){return _0x341a17['destroy']()[_0xa3c9('0x24')](function(){var _0x10ee1a=_0x341a17[_0xa3c9('0x25')]({'plain':!![]});var _0x2995d7='CustomReports';return db[_0xa3c9('0x26')][_0xa3c9('0x27')]({'where':{'type':_0x2995d7,'resourceId':_0x10ee1a['id']}})[_0xa3c9('0x24')](function(){return _0x341a17;});})['then'](function(){_0x9b1f18[_0xa3c9('0x19')](0xcc)[_0xa3c9('0x18')]();});}};}function handleEntityNotFound(_0x4f0e66,_0x113245){return function(_0x212f94){if(!_0x212f94){_0x4f0e66[_0xa3c9('0x28')](0x194);}return _0x212f94;};}function handleError(_0x30e4cd,_0x78838a){_0x78838a=_0x78838a||0x1f4;return function(_0x83d160){logger['error'](_0x83d160[_0xa3c9('0x29')]);if(_0x83d160[_0xa3c9('0x2a')]){delete _0x83d160[_0xa3c9('0x2a')];}_0x30e4cd[_0xa3c9('0x19')](_0x78838a)[_0xa3c9('0x2b')](_0x83d160);};}exports[_0xa3c9('0x2c')]=function(_0x5778dc,_0x17fa17){var _0x42edee={},_0x144073={},_0x4c506e={'count':0x0,'rows':[]};var _0xdfc3a0=_[_0xa3c9('0x2d')](db[_0xa3c9('0x2e')][_0xa3c9('0x2f')],function(_0x4a1463){return{'name':_0x4a1463[_0xa3c9('0x30')],'type':_0x4a1463[_0xa3c9('0x31')][_0xa3c9('0x32')]};});_0x144073[_0xa3c9('0x33')]=_[_0xa3c9('0x2d')](_0xdfc3a0,_0xa3c9('0x2a'));_0x144073['query']=_['keys'](_0x5778dc[_0xa3c9('0x34')]);_0x144073[_0xa3c9('0x35')]=_['intersection'](_0x144073['model'],_0x144073['query']);_0x42edee[_0xa3c9('0x36')]=_[_0xa3c9('0x37')](_0x144073[_0xa3c9('0x33')],qs['fields'](_0x5778dc[_0xa3c9('0x34')]['fields']));_0x42edee[_0xa3c9('0x36')]=_0x42edee['attributes'][_0xa3c9('0x38')]?_0x42edee[_0xa3c9('0x36')]:_0x144073[_0xa3c9('0x33')];if(!_0x5778dc[_0xa3c9('0x34')][_0xa3c9('0x39')](_0xa3c9('0x3a'))){_0x42edee[_0xa3c9('0x1d')]=qs['limit'](_0x5778dc[_0xa3c9('0x34')]['limit']);_0x42edee[_0xa3c9('0x1b')]=qs[_0xa3c9('0x1b')](_0x5778dc['query'][_0xa3c9('0x1b')]);}_0x42edee[_0xa3c9('0x3b')]=qs[_0xa3c9('0x3c')](_0x5778dc['query']['sort']);_0x42edee[_0xa3c9('0x3d')]=qs[_0xa3c9('0x35')](_[_0xa3c9('0x3e')](_0x5778dc[_0xa3c9('0x34')],_0x144073[_0xa3c9('0x35')]),_0xdfc3a0);if(_0x5778dc['query'][_0xa3c9('0x3f')]){_0x42edee[_0xa3c9('0x3d')]=_[_0xa3c9('0x40')](_0x42edee[_0xa3c9('0x3d')],{'$or':_['map'](_0xdfc3a0,function(_0x160617){if(_0x160617[_0xa3c9('0x31')]!=='VIRTUAL'){var _0x4ec606={};_0x4ec606[_0x160617[_0xa3c9('0x2a')]]={'$like':'%'+_0x5778dc[_0xa3c9('0x34')][_0xa3c9('0x3f')]+'%'};return _0x4ec606;}})});}_0x42edee=_[_0xa3c9('0x40')]({},_0x42edee,_0x5778dc['options']);var _0x4a76d6={'where':_0x42edee['where']};return db[_0xa3c9('0x2e')][_0xa3c9('0x1e')](_0x4a76d6)[_0xa3c9('0x24')](function(_0x2a330f){_0x4c506e[_0xa3c9('0x1e')]=_0x2a330f;if(_0x5778dc[_0xa3c9('0x34')]['includeAll']){_0x42edee['include']=[{'all':!![]}];}return db['AnalyticCustomReport'][_0xa3c9('0x41')](_0x42edee);})[_0xa3c9('0x24')](function(_0x2a8180){_0x4c506e[_0xa3c9('0x42')]=_0x2a8180;return _0x4c506e;})[_0xa3c9('0x24')](respondWithFilteredResult(_0x17fa17,_0x42edee))['catch'](handleError(_0x17fa17,null));};exports[_0xa3c9('0x43')]=function(_0x54bf2c,_0x198c91){var _0x958702={'raw':![],'where':{'id':_0x54bf2c[_0xa3c9('0x44')]['id']}},_0x265936={};_0x265936[_0xa3c9('0x33')]=_[_0xa3c9('0x45')](db[_0xa3c9('0x2e')][_0xa3c9('0x2f')]);_0x265936[_0xa3c9('0x34')]=_[_0xa3c9('0x45')](_0x54bf2c[_0xa3c9('0x34')]);_0x265936[_0xa3c9('0x35')]=_[_0xa3c9('0x37')](_0x265936[_0xa3c9('0x33')],_0x265936[_0xa3c9('0x34')]);_0x958702[_0xa3c9('0x36')]=_[_0xa3c9('0x37')](_0x265936['model'],qs[_0xa3c9('0x46')](_0x54bf2c[_0xa3c9('0x34')][_0xa3c9('0x46')]));_0x958702['attributes']=_0x958702[_0xa3c9('0x36')][_0xa3c9('0x38')]?_0x958702[_0xa3c9('0x36')]:_0x265936[_0xa3c9('0x33')];if(_0x54bf2c[_0xa3c9('0x34')]['includeAll']){_0x958702['include']=[{'all':!![]}];}_0x958702=_[_0xa3c9('0x40')]({},_0x958702,_0x54bf2c[_0xa3c9('0x47')]);return db[_0xa3c9('0x2e')][_0xa3c9('0x48')](_0x958702)['then'](handleEntityNotFound(_0x198c91,null))[_0xa3c9('0x24')](respondWithResult(_0x198c91,null))[_0xa3c9('0x49')](handleError(_0x198c91,null));};exports['create']=function(_0x17cc22,_0x4a8c6e){return db[_0xa3c9('0x2e')]['create'](_0x17cc22[_0xa3c9('0x4a')],{})[_0xa3c9('0x24')](function(_0x2977d0){var _0x355a19=_0x17cc22[_0xa3c9('0x4b')][_0xa3c9('0x25')]({'plain':!![]});if(!_0x355a19)throw new Error(_0xa3c9('0x4c'));if(_0x355a19[_0xa3c9('0x4d')]==='user'){var _0xb3c2a3=_0x2977d0[_0xa3c9('0x25')]({'plain':!![]});var _0x30c5ca=_0xa3c9('0x4e');return db[_0xa3c9('0x4f')][_0xa3c9('0x48')]({'where':{'name':_0x30c5ca,'userProfileId':_0x355a19[_0xa3c9('0x50')]},'raw':!![]})[_0xa3c9('0x24')](function(_0x178262){if(_0x178262&&_0x178262[_0xa3c9('0x51')]===0x0){return db[_0xa3c9('0x26')][_0xa3c9('0x52')]({'name':_0xb3c2a3[_0xa3c9('0x2a')],'resourceId':_0xb3c2a3['id'],'type':_0xa3c9('0x53'),'sectionId':_0x178262['id']},{})[_0xa3c9('0x24')](function(){return _0x2977d0;});}else{return _0x2977d0;}})['catch'](function(_0x3ee1b6){logger[_0xa3c9('0x54')](_0xa3c9('0x55'),_0x3ee1b6);throw _0x3ee1b6;});}return _0x2977d0;})[_0xa3c9('0x24')](respondWithResult(_0x4a8c6e,0xc9))[_0xa3c9('0x49')](handleError(_0x4a8c6e,null));};exports[_0xa3c9('0x23')]=function(_0x3fa0d3,_0xf044e2){if(_0x3fa0d3[_0xa3c9('0x4a')]['id']){delete _0x3fa0d3['body']['id'];}return db[_0xa3c9('0x2e')][_0xa3c9('0x48')]({'where':{'id':_0x3fa0d3[_0xa3c9('0x44')]['id']}})[_0xa3c9('0x24')](handleEntityNotFound(_0xf044e2,null))[_0xa3c9('0x24')](saveUpdates(_0x3fa0d3[_0xa3c9('0x4a')],null))[_0xa3c9('0x24')](respondWithResult(_0xf044e2,null))[_0xa3c9('0x49')](handleError(_0xf044e2,null));};exports[_0xa3c9('0x27')]=function(_0x36ac88,_0x590e7a){return db[_0xa3c9('0x2e')]['find']({'where':{'id':_0x36ac88[_0xa3c9('0x44')]['id']}})[_0xa3c9('0x24')](handleEntityNotFound(_0x590e7a,null))[_0xa3c9('0x24')](removeEntity(_0x590e7a,null))['catch'](handleError(_0x590e7a,null));};exports['preview']=function(_0x33539d,_0x207ca1){var _0x4248e5=0xa;var _0x4c351b=[_0xa3c9('0x56'),_0xa3c9('0x57'),_0xa3c9('0x58'),_0xa3c9('0x59')];var _0x51aef4={'SUM':_0xa3c9('0x5a'),'COUNT':_0xa3c9('0x5b'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xa3c9('0x5c'),'MIN':_0xa3c9('0x5d'),'AVG':_0xa3c9('0x5e'),'GROUP_CONCAT':_0xa3c9('0x5f'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xa3c9('0x60')};var _0x18c5a2={'SEC_TO_TIME':_0xa3c9('0x61'),'DATE':'DATE(%s)','HOUR':_0xa3c9('0x62'),'ROUND':_0xa3c9('0x63'),'UNIX_TIMESTAMP':_0xa3c9('0x64')};var _0x202592=function(_0x599cd5){return!_[_0xa3c9('0x65')](['IS\x20NULL',_0xa3c9('0x66'),'IS\x20EMPTY',_0xa3c9('0x67')],_0x599cd5);};var _0x4e4d9b=function(_0x2c70ab){if(!_0x2c70ab||!_0x2c70ab['rules']['length']){return'';}for(var _0x3cf069='(',_0x40d712=0x0;_0x40d712<_0x2c70ab['rules'][_0xa3c9('0x38')];_0x40d712+=0x1){_0x40d712>0x0&&(_0x3cf069+='\x20'+_0x2c70ab[_0xa3c9('0x68')]+'\x20');_0x3cf069+=_0x2c70ab['rules'][_0x40d712][_0xa3c9('0x69')]?_0x4e4d9b(_0x2c70ab[_0xa3c9('0x6a')][_0x40d712][_0xa3c9('0x69')]):_0x2c70ab[_0xa3c9('0x6a')][_0x40d712]['field']+'\x20'+_0x2c70ab[_0xa3c9('0x6a')][_0x40d712]['condition']+(_0x202592(_0x2c70ab[_0xa3c9('0x6a')][_0x40d712]['condition'])?'\x20'+_0x2c70ab[_0xa3c9('0x6a')][_0x40d712][_0xa3c9('0x6b')]:'');}return _0x3cf069+')';};var _0x4bb8a8={'where':{'id':_0x33539d[_0xa3c9('0x44')]['id']}},_0x2f6c20,_0x4b1fc1,_0x47f111,_0x252ebf,_0x3d00a7;_0x4bb8a8=_[_0xa3c9('0x40')]({},_0x4bb8a8,_0x33539d[_0xa3c9('0x47')]);return db[_0xa3c9('0x2e')][_0xa3c9('0x48')](_0x4bb8a8)['then'](function(_0x2b6922){if(_0x2b6922){_0x2f6c20=_0x2b6922;return _0x2b6922[_0xa3c9('0x6c')]();}return null;})[_0xa3c9('0x24')](function(_0x4c6aa5){if(_0x4c6aa5){if(!_0x4c6aa5['length']){throw new db[(_0xa3c9('0x6d'))][(_0xa3c9('0x6e'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x4b1fc1=_0x4c6aa5;return db['AnalyticMetric'][_0xa3c9('0x41')]({'raw':!![]});}return null;})['then'](function(_0x2e695a){if(_0x2e695a){_0x47f111=_[_0xa3c9('0x6f')](_0x2e695a,'id');var _0x29317d;var _0x2a0957=squel[_0xa3c9('0x70')]();_0x2a0957[_0xa3c9('0x71')](_0x2f6c20[_0xa3c9('0x72')]);for(var _0x5851d1=0x0;_0x5851d1<_0x4b1fc1['length'];_0x5851d1+=0x1){_0x29317d=_0x4b1fc1[_0x5851d1][_0xa3c9('0x73')]?_0x47f111[_0x4b1fc1[_0x5851d1]['MetricId']][_0xa3c9('0x74')]:_0x4b1fc1[_0x5851d1][_0xa3c9('0x75')];_0x29317d=_0x4b1fc1[_0x5851d1]['function']?_[_0xa3c9('0x76')](_0x51aef4[_0x4b1fc1[_0x5851d1]['function']],'%s',_0x29317d):_0x29317d;_0x29317d=_0x4b1fc1[_0x5851d1][_0xa3c9('0x77')]?_[_0xa3c9('0x76')](_0x18c5a2[_0x4b1fc1[_0x5851d1][_0xa3c9('0x77')]],'%s',_0x29317d):_0x29317d;if(_0x4b1fc1[_0x5851d1][_0xa3c9('0x78')]){_0x2a0957[_0xa3c9('0x69')](_0x29317d);}_0x4b1fc1[_0x5851d1]['orderBy']&&_0x2a0957[_0xa3c9('0x3b')](_0x29317d,_0x4b1fc1[_0x5851d1][_0xa3c9('0x79')]===_0xa3c9('0x7a')?![]:!![]);_0x2a0957['field'](_0x29317d,_0x4b1fc1[_0x5851d1][_0xa3c9('0x7b')]||_0x29317d);}if(_0x2f6c20['joins']){_0x2f6c20[_0xa3c9('0x7c')]=JSON[_0xa3c9('0x7d')](_0x2f6c20['joins']);for(var _0x4de712=0x0;_0x4de712<_0x2f6c20[_0xa3c9('0x7c')][_0xa3c9('0x38')];_0x4de712+=0x1){if(_0x2f6c20[_0xa3c9('0x7c')][_0x4de712][_0xa3c9('0x31')]&&_[_0xa3c9('0x65')](_0x4c351b,_0x2f6c20['joins'][_0x4de712][_0xa3c9('0x31')])&&_0x2f6c20[_0xa3c9('0x7c')][_0x4de712][_0xa3c9('0x7e')]&&_0x2f6c20[_0xa3c9('0x7c')][_0x4de712][_0xa3c9('0x7f')]&&_0x2f6c20[_0xa3c9('0x7c')][_0x4de712][_0xa3c9('0x80')]){_0x2a0957[_0x2f6c20['joins'][_0x4de712][_0xa3c9('0x31')]](_0x2f6c20['joins'][_0x4de712]['foreignTable'],null,util[_0xa3c9('0x77')](_0xa3c9('0x81'),_0x2f6c20[_0xa3c9('0x72')],_0x2f6c20['joins'][_0x4de712]['parentKey'],_0x2f6c20[_0xa3c9('0x7c')][_0x4de712][_0xa3c9('0x7f')],_0x2f6c20[_0xa3c9('0x7c')][_0x4de712][_0xa3c9('0x80')]));}}}if(_0x2f6c20[_0xa3c9('0x82')]){_0x2f6c20['conditions']=JSON['parse'](_0x2f6c20['conditions']);_0x2a0957['where'](_0x4e4d9b(_0x2f6c20[_0xa3c9('0x82')][_0xa3c9('0x69')]));}_0x3d00a7=_0x2a0957[_0xa3c9('0x83')]();_0x2a0957[_0xa3c9('0x1d')](_0x4248e5);_0x2a0957[_0xa3c9('0x1b')](0x0);logger[_0xa3c9('0x84')](_0xa3c9('0x85'),_0x2a0957[_0xa3c9('0x86')]());return dbH[_0xa3c9('0x87')][_0xa3c9('0x34')](_0x2a0957[_0xa3c9('0x86')](),{'type':dbH[_0xa3c9('0x87')][_0xa3c9('0x88')]['SELECT']});}})[_0xa3c9('0x24')](respondWithResult(_0x207ca1,null))[_0xa3c9('0x49')](handleError(_0x207ca1,null));};function runReport(_0x393cae,_0x7a4b83,_0x497a47){var _0x22da87=_0x7a4b83[_0xa3c9('0x2a')];var _0x5f0342=0xa;var _0x5687d1=[_0xa3c9('0x56'),'left_join','right_join',_0xa3c9('0x59')];var _0x35162f={'SUM':_0xa3c9('0x5a'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xa3c9('0x89'),'MAX':_0xa3c9('0x5c'),'MIN':_0xa3c9('0x5d'),'AVG':'AVG(%s)','GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xa3c9('0x8a'),'GROUP_CONCAT DESC':_0xa3c9('0x60')};var _0x37fd96={'SEC_TO_TIME':_0xa3c9('0x61'),'DATE':_0xa3c9('0x8b'),'HOUR':'HOUR(%s)','ROUND':_0xa3c9('0x63'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x2cc9fc=function(_0x27e4c5){return!_['includes']([_0xa3c9('0x8c'),_0xa3c9('0x66'),'IS\x20EMPTY',_0xa3c9('0x67')],_0x27e4c5);};var _0x29bcda=function(_0x58eaef){if(!_0x58eaef||!_0x58eaef['rules'][_0xa3c9('0x38')]){return'';}for(var _0x5efe5c='(',_0x25adc1=0x0;_0x25adc1<_0x58eaef[_0xa3c9('0x6a')][_0xa3c9('0x38')];_0x25adc1+=0x1){_0x25adc1>0x0&&(_0x5efe5c+='\x20'+_0x58eaef[_0xa3c9('0x68')]+'\x20');_0x5efe5c+=_0x58eaef[_0xa3c9('0x6a')][_0x25adc1][_0xa3c9('0x69')]?_0x29bcda(_0x58eaef[_0xa3c9('0x6a')][_0x25adc1]['group']):_0x58eaef['rules'][_0x25adc1][_0xa3c9('0x75')]+'\x20'+_0x58eaef[_0xa3c9('0x6a')][_0x25adc1][_0xa3c9('0x8d')]+(_0x2cc9fc(_0x58eaef[_0xa3c9('0x6a')][_0x25adc1][_0xa3c9('0x8d')])?'\x20'+_0x58eaef[_0xa3c9('0x6a')][_0x25adc1][_0xa3c9('0x6b')]:'');}return _0x5efe5c+')';};var _0x4515a5={'where':{'id':_0x393cae['id']}},_0x18d885,_0x4cff46,_0x5a215b,_0x51047f,_0x1ad3c4;_0x4515a5=_['merge']({},_0x4515a5,_0x497a47);return db[_0xa3c9('0x2e')][_0xa3c9('0x48')](_0x4515a5)[_0xa3c9('0x24')](function(_0x2a116c){if(_0x2a116c){_0x18d885=_0x2a116c;return _0x2a116c['getFields']();}return null;})[_0xa3c9('0x24')](function(_0x487963){if(_0x487963){if(!_0x487963[_0xa3c9('0x38')]){throw new db[(_0xa3c9('0x6d'))][(_0xa3c9('0x6e'))](_0xa3c9('0x8e'),0x193);}_0x4cff46=_0x487963;return db['AnalyticMetric'][_0xa3c9('0x41')]({'raw':!![]});}return null;})[_0xa3c9('0x24')](function(_0x35df2e){if(_0x35df2e){_0x5a215b=_[_0xa3c9('0x6f')](_0x35df2e,'id');var _0x8f27be;var _0x2558ae=squel[_0xa3c9('0x70')]();_0x2558ae[_0xa3c9('0x71')](_0x18d885[_0xa3c9('0x72')]);for(var _0xe9c7ca=0x0;_0xe9c7ca<_0x4cff46['length'];_0xe9c7ca+=0x1){_0x8f27be=_0x4cff46[_0xe9c7ca][_0xa3c9('0x73')]?_0x5a215b[_0x4cff46[_0xe9c7ca][_0xa3c9('0x73')]][_0xa3c9('0x74')]:_0x4cff46[_0xe9c7ca][_0xa3c9('0x75')];_0x8f27be=_0x4cff46[_0xe9c7ca]['function']?_[_0xa3c9('0x76')](_0x35162f[_0x4cff46[_0xe9c7ca][_0xa3c9('0x8f')]],'%s',_0x8f27be):_0x8f27be;_0x8f27be=_0x4cff46[_0xe9c7ca][_0xa3c9('0x77')]?_['replace'](_0x37fd96[_0x4cff46[_0xe9c7ca][_0xa3c9('0x77')]],'%s',_0x8f27be):_0x8f27be;if(_0x4cff46[_0xe9c7ca][_0xa3c9('0x78')]){_0x2558ae[_0xa3c9('0x69')](_0x8f27be);}_0x4cff46[_0xe9c7ca]['orderBy']&&_0x2558ae[_0xa3c9('0x3b')](_0x8f27be,_0x4cff46[_0xe9c7ca][_0xa3c9('0x79')]===_0xa3c9('0x7a')?![]:!![]);_0x2558ae['field'](_0x8f27be,_0x4cff46[_0xe9c7ca][_0xa3c9('0x7b')]||_0x8f27be);}if(_0x18d885['joins']){_0x18d885['joins']=JSON['parse'](_0x18d885['joins']);for(var _0x365341=0x0;_0x365341<_0x18d885[_0xa3c9('0x7c')][_0xa3c9('0x38')];_0x365341+=0x1){if(_0x18d885[_0xa3c9('0x7c')][_0x365341]['type']&&_['includes'](_0x5687d1,_0x18d885[_0xa3c9('0x7c')][_0x365341]['type'])&&_0x18d885['joins'][_0x365341][_0xa3c9('0x7e')]&&_0x18d885[_0xa3c9('0x7c')][_0x365341][_0xa3c9('0x7f')]&&_0x18d885[_0xa3c9('0x7c')][_0x365341][_0xa3c9('0x80')]){_0x2558ae[_0x18d885['joins'][_0x365341][_0xa3c9('0x31')]](_0x18d885[_0xa3c9('0x7c')][_0x365341][_0xa3c9('0x7f')],null,util['format'](_0xa3c9('0x81'),_0x18d885[_0xa3c9('0x72')],_0x18d885[_0xa3c9('0x7c')][_0x365341]['parentKey'],_0x18d885['joins'][_0x365341][_0xa3c9('0x7f')],_0x18d885['joins'][_0x365341][_0xa3c9('0x80')]));}}}if(_0x18d885['conditions']){_0x18d885[_0xa3c9('0x82')]=JSON[_0xa3c9('0x7d')](_0x18d885['conditions']);_0x2558ae['where'](_0x29bcda(_0x18d885[_0xa3c9('0x82')][_0xa3c9('0x69')]));}_0x1ad3c4=_0x2558ae[_0xa3c9('0x83')]();_0x2558ae[_0xa3c9('0x1d')](_0x5f0342);_0x2558ae[_0xa3c9('0x1b')](0x0);return;}})[_0xa3c9('0x24')](function(){if(_0x7a4b83['output']===_0xa3c9('0x90')){return null;}var _0x56aaa9=_['merge'](_0x7a4b83,{'name':_0x7a4b83[_0xa3c9('0x91')]||_0x7a4b83[_0xa3c9('0x2a')]||_0x18d885[_0xa3c9('0x2a')],'basename':_0x22da87,'savename':util[_0xa3c9('0x77')](_0xa3c9('0x92'),_0x7a4b83[_0xa3c9('0x2a')]||_0x18d885['name'],require(_0xa3c9('0x93'))['generate'](0x4),_0x7a4b83['output']||_0xa3c9('0x94')),'reportId':_0x18d885['id'],'reportType':'custom'});return db[_0xa3c9('0x95')][_0xa3c9('0x52')](_0x56aaa9,{'raw':!![]});})[_0xa3c9('0x24')](function(_0x3e4c75){if(_0x18d885['table']==='cdr'){_0x1ad3c4[_0xa3c9('0x3d')](_0x18d885[_0xa3c9('0x72')]+_0xa3c9('0x96'),_0x7a4b83['startDate'],_0x7a4b83[_0xa3c9('0x97')]);}else{_0x1ad3c4['where'](_0x18d885[_0xa3c9('0x72')]+_0xa3c9('0x98'),_0x7a4b83['startDate'],_0x7a4b83[_0xa3c9('0x97')]);}if(_0x3e4c75){logger[_0xa3c9('0x99')]('Run\x20Query:',_0x1ad3c4[_0xa3c9('0x86')]());require('child_process')[_0xa3c9('0x9a')](path[_0xa3c9('0x56')](__dirname,_0xa3c9('0x9b'),_0x3e4c75[_0xa3c9('0x9c')]),[_0x3e4c75['id'],_0x1ad3c4['toString'](),path['join'](__dirname,_0xa3c9('0x9d'),_0x3e4c75[_0xa3c9('0x9e')]),_0x22da87]);return _0x3e4c75;}else{var _0x55b947=squel[_0xa3c9('0x70')]();_0x55b947[_0xa3c9('0x71')]('('+_0x1ad3c4[_0xa3c9('0x86')]()+')',_0xa3c9('0x9f'));_0x55b947[_0xa3c9('0x75')](_0xa3c9('0xa0'),_0xa3c9('0x1e'));_0x1ad3c4[_0xa3c9('0x1d')](_0x7a4b83[_0xa3c9('0x1d')]||_0x5f0342);_0x1ad3c4[_0xa3c9('0x1b')](_0x7a4b83['offset']||0x0);return dbH[_0xa3c9('0x87')][_0xa3c9('0x34')](_0x55b947[_0xa3c9('0x86')](),{'type':dbH[_0xa3c9('0x87')][_0xa3c9('0x88')]['SELECT']})[_0xa3c9('0x24')](function(_0x139946){if(!_0x139946[_0xa3c9('0x38')]){_0x51047f=0x0;}else{_0x51047f=_0x139946[0x0][_0xa3c9('0x1e')]||0x0;}return dbH[_0xa3c9('0x87')][_0xa3c9('0x34')](_0x1ad3c4[_0xa3c9('0x86')](),{'type':dbH[_0xa3c9('0x87')]['QueryTypes'][_0xa3c9('0xa1')]});})[_0xa3c9('0x24')](function(_0x2a0341){return{'rows':_0x2a0341||[],'count':_0x51047f};});}});}exports[_0xa3c9('0xa2')]=function(_0x32f2b7,_0x151514){return runReport(_0x32f2b7[_0xa3c9('0x44')],_0x32f2b7[_0xa3c9('0x34')],_0x32f2b7['options'])[_0xa3c9('0x24')](respondWithResult(_0x151514,null))[_0xa3c9('0x49')](handleError(_0x151514,null));};exports[_0xa3c9('0xa3')]=runReport;exports['query']=function(_0x1d4ed8,_0xb5039d){var _0x2c2e50=0xa;var _0x2cedd8=[_0xa3c9('0x56'),_0xa3c9('0x57'),_0xa3c9('0x58'),_0xa3c9('0x59')];var _0x222223={'SUM':_0xa3c9('0x5a'),'COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xa3c9('0x5c'),'MIN':_0xa3c9('0x5d'),'AVG':_0xa3c9('0x5e'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xa3c9('0x8a'),'GROUP_CONCAT DESC':_0xa3c9('0x60')};var _0xa93dbf={'SEC_TO_TIME':_0xa3c9('0x61'),'DATE':_0xa3c9('0x8b'),'HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x36882a=function(_0xc5b9f){return!_[_0xa3c9('0x65')]([_0xa3c9('0x8c'),_0xa3c9('0x66'),_0xa3c9('0xa4'),_0xa3c9('0x67')],_0xc5b9f);};var _0x1d3b8c=function(_0x5b93a6){if(!_0x5b93a6||!_0x5b93a6[_0xa3c9('0x6a')][_0xa3c9('0x38')]){return'';}for(var _0x2ae5df='(',_0x520413=0x0;_0x520413<_0x5b93a6[_0xa3c9('0x6a')]['length'];_0x520413+=0x1){_0x520413>0x0&&(_0x2ae5df+='\x20'+_0x5b93a6['operator']+'\x20');_0x2ae5df+=_0x5b93a6['rules'][_0x520413][_0xa3c9('0x69')]?_0x1d3b8c(_0x5b93a6['rules'][_0x520413][_0xa3c9('0x69')]):_0x5b93a6[_0xa3c9('0x6a')][_0x520413][_0xa3c9('0x75')]+'\x20'+_0x5b93a6[_0xa3c9('0x6a')][_0x520413]['condition']+(_0x36882a(_0x5b93a6[_0xa3c9('0x6a')][_0x520413][_0xa3c9('0x8d')])?'\x20'+_0x5b93a6[_0xa3c9('0x6a')][_0x520413][_0xa3c9('0x6b')]:'');}return _0x2ae5df+')';};var _0x26fe03={'where':{'id':_0x1d4ed8[_0xa3c9('0x44')]['id']}},_0x3d3c4b,_0x21225c,_0xe09c9e,_0x3bd3b7,_0xd875cc;_0x26fe03=_[_0xa3c9('0x40')]({},_0x26fe03,_0x1d4ed8['options']);return db[_0xa3c9('0x2e')][_0xa3c9('0x48')](_0x26fe03)['then'](function(_0x22121a){if(_0x22121a){_0x3d3c4b=_0x22121a;return _0x22121a[_0xa3c9('0x6c')]();}return null;})[_0xa3c9('0x24')](function(_0x42c685){if(_0x42c685){if(!_0x42c685[_0xa3c9('0x38')]){throw new db[(_0xa3c9('0x6d'))][(_0xa3c9('0x6e'))](_0xa3c9('0x8e'),0x193);}_0x21225c=_0x42c685;return db[_0xa3c9('0xa5')][_0xa3c9('0x41')]({'raw':!![]});}return null;})[_0xa3c9('0x24')](function(_0x438aa3){if(_0x438aa3){_0xe09c9e=_['keyBy'](_0x438aa3,'id');var _0x30f4ad;var _0x52a6e7=squel[_0xa3c9('0x70')]();_0x52a6e7[_0xa3c9('0x71')](_0x3d3c4b[_0xa3c9('0x72')]);for(var _0x2e79b7=0x0;_0x2e79b7<_0x21225c['length'];_0x2e79b7+=0x1){_0x30f4ad=_0x21225c[_0x2e79b7][_0xa3c9('0x73')]?_0xe09c9e[_0x21225c[_0x2e79b7][_0xa3c9('0x73')]][_0xa3c9('0x74')]:_0x21225c[_0x2e79b7][_0xa3c9('0x75')];_0x30f4ad=_0x21225c[_0x2e79b7]['function']?_[_0xa3c9('0x76')](_0x222223[_0x21225c[_0x2e79b7][_0xa3c9('0x8f')]],'%s',_0x30f4ad):_0x30f4ad;_0x30f4ad=_0x21225c[_0x2e79b7][_0xa3c9('0x77')]?_[_0xa3c9('0x76')](_0xa93dbf[_0x21225c[_0x2e79b7][_0xa3c9('0x77')]],'%s',_0x30f4ad):_0x30f4ad;if(_0x21225c[_0x2e79b7]['groupBy']){_0x52a6e7[_0xa3c9('0x69')](_0x30f4ad);}_0x21225c[_0x2e79b7][_0xa3c9('0x79')]&&_0x52a6e7[_0xa3c9('0x3b')](_0x30f4ad,_0x21225c[_0x2e79b7][_0xa3c9('0x79')]===_0xa3c9('0x7a')?![]:!![]);_0x52a6e7['field'](_0x30f4ad,_0x21225c[_0x2e79b7][_0xa3c9('0x7b')]||_0x30f4ad);}if(_0x3d3c4b[_0xa3c9('0x7c')]){_0x3d3c4b[_0xa3c9('0x7c')]=JSON[_0xa3c9('0x7d')](_0x3d3c4b[_0xa3c9('0x7c')]);for(var _0x3e6eda=0x0;_0x3e6eda<_0x3d3c4b[_0xa3c9('0x7c')][_0xa3c9('0x38')];_0x3e6eda+=0x1){if(_0x3d3c4b[_0xa3c9('0x7c')][_0x3e6eda][_0xa3c9('0x31')]&&_['includes'](_0x2cedd8,_0x3d3c4b[_0xa3c9('0x7c')][_0x3e6eda][_0xa3c9('0x31')])&&_0x3d3c4b[_0xa3c9('0x7c')][_0x3e6eda][_0xa3c9('0x7e')]&&_0x3d3c4b[_0xa3c9('0x7c')][_0x3e6eda]['foreignTable']&&_0x3d3c4b['joins'][_0x3e6eda][_0xa3c9('0x80')]){_0x52a6e7[_0x3d3c4b[_0xa3c9('0x7c')][_0x3e6eda][_0xa3c9('0x31')]](_0x3d3c4b[_0xa3c9('0x7c')][_0x3e6eda][_0xa3c9('0x7f')],null,util['format'](_0xa3c9('0x81'),_0x3d3c4b[_0xa3c9('0x72')],_0x3d3c4b[_0xa3c9('0x7c')][_0x3e6eda][_0xa3c9('0x7e')],_0x3d3c4b[_0xa3c9('0x7c')][_0x3e6eda]['foreignTable'],_0x3d3c4b[_0xa3c9('0x7c')][_0x3e6eda][_0xa3c9('0x80')]));}}}if(_0x3d3c4b[_0xa3c9('0x82')]){_0x3d3c4b['conditions']=JSON['parse'](_0x3d3c4b['conditions']);_0x52a6e7[_0xa3c9('0x3d')](_0x1d3b8c(_0x3d3c4b[_0xa3c9('0x82')]['group']));}_0xd875cc=_0x52a6e7[_0xa3c9('0x83')]();_0x52a6e7[_0xa3c9('0x1d')](_0x2c2e50);_0x52a6e7[_0xa3c9('0x1b')](0x0);logger[_0xa3c9('0x84')](_0xa3c9('0x85'),_0x52a6e7['toString']());return dbH[_0xa3c9('0x87')][_0xa3c9('0x34')](_0x52a6e7[_0xa3c9('0x86')](),{'type':dbH[_0xa3c9('0x87')][_0xa3c9('0x88')][_0xa3c9('0xa1')]});}})['then'](function(){return{'sql':_0xd875cc[_0xa3c9('0x86')]()};})[_0xa3c9('0x24')](respondWithResult(_0xb5039d,null))[_0xa3c9('0x49')](handleError(_0xb5039d,null));}; \ No newline at end of file +var _0x9afd=['error','stack','name','map','fieldName','type','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','include','findAll','show','params','AnalyticCustomReport','rawAttributes','intersection','includeAll','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','catch','find','preview','join','left_join','right_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','group','rules','condition','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','select','from','MetricId','metric','function','format','groupBy','orderBy','field','joins','parse','includes','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','table','conditions','clone','debug','sequelize','toString','QueryTypes','SELECT','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','value','AnalyticMetric','keyBy','replace','alias','output','web','%s-%s.%s','generate','csv','custom','startDate','endDate','info','Run\x20Query:','child_process','fork','../../components/export/','savename','countTable','COUNT(*)','run','runReport','IS\x20EMPTY','operator','DESC','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','json','offset','undefined','limit','count','apply','save','update','destroy','then','CustomReports','UserProfileResource'];(function(_0x4ff09b,_0x53f67d){var _0x3f5c2e=function(_0x124592){while(--_0x124592){_0x4ff09b['push'](_0x4ff09b['shift']());}};_0x3f5c2e(++_0x53f67d);}(_0x9afd,0x11c));var _0xd9af=function(_0x2ff762,_0x342c0b){_0x2ff762=_0x2ff762-0x0;var _0x158b02=_0x9afd[_0x2ff762];return _0x158b02;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd9af('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd9af('0x1'));var rp=require(_0xd9af('0x2'));var moment=require(_0xd9af('0x3'));var BPromise=require(_0xd9af('0x4'));var Mustache=require(_0xd9af('0x5'));var util=require(_0xd9af('0x6'));var path=require(_0xd9af('0x7'));var sox=require(_0xd9af('0x8'));var csv=require(_0xd9af('0x9'));var ejs=require(_0xd9af('0xa'));var fs=require('fs');var fs_extra=require(_0xd9af('0xb'));var _=require(_0xd9af('0xc'));var squel=require(_0xd9af('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xd9af('0xe'));var toCsv=require(_0xd9af('0x9'));var querystring=require(_0xd9af('0xf'));var Papa=require(_0xd9af('0x10'));var Redis=require('ioredis');var authService=require(_0xd9af('0x11'));var qs=require(_0xd9af('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xd9af('0x13'));var utils=require(_0xd9af('0x14'));var config=require(_0xd9af('0x15'));var licenseUtil=require(_0xd9af('0x16'));var db=require(_0xd9af('0x17'))['db'];var dbH=require(_0xd9af('0x17'))[_0xd9af('0x18')];function respondWithStatusCode(_0x2900a5,_0x50161c){_0x50161c=_0x50161c||0xcc;return function(_0x50a63b){if(_0x50a63b){return _0x2900a5[_0xd9af('0x19')](_0x50161c);}return _0x2900a5[_0xd9af('0x1a')](_0x50161c)[_0xd9af('0x1b')]();};}function respondWithResult(_0x21cdef,_0x2c9e01){_0x2c9e01=_0x2c9e01||0xc8;return function(_0x242ff5){if(_0x242ff5){return _0x21cdef[_0xd9af('0x1a')](_0x2c9e01)[_0xd9af('0x1c')](_0x242ff5);}};}function respondWithFilteredResult(_0x2d8251,_0x56ee97){return function(_0x2a7a6a){if(_0x2a7a6a){var _0x567c77=typeof _0x56ee97[_0xd9af('0x1d')]===_0xd9af('0x1e')&&typeof _0x56ee97[_0xd9af('0x1f')]==='undefined';var _0x4014b4=_0x2a7a6a['count'];var _0xaea78c=_0x567c77?0x0:_0x56ee97['offset'];var _0x3df28d=_0x567c77?_0x2a7a6a[_0xd9af('0x20')]:_0x56ee97['offset']+_0x56ee97[_0xd9af('0x1f')];var _0xc8f014;if(_0x3df28d>=_0x4014b4){_0x3df28d=_0x4014b4;_0xc8f014=0xc8;}else{_0xc8f014=0xce;}_0x2d8251[_0xd9af('0x1a')](_0xc8f014);return _0x2d8251['set']('Content-Range',_0xaea78c+'-'+_0x3df28d+'/'+_0x4014b4)[_0xd9af('0x1c')](_0x2a7a6a);}return null;};}function patchUpdates(_0x552ba6){return function(_0x59b120){try{jsonpatch[_0xd9af('0x21')](_0x59b120,_0x552ba6,!![]);}catch(_0x3a134d){return BPromise['reject'](_0x3a134d);}return _0x59b120[_0xd9af('0x22')]();};}function saveUpdates(_0x2d5b83,_0x5219f5){return function(_0x75b32){if(_0x75b32){return _0x75b32[_0xd9af('0x23')](_0x2d5b83)['then'](function(_0x40bafe){return _0x40bafe;});}return null;};}function removeEntity(_0x191408,_0x235dd2){return function(_0x46181a){if(_0x46181a){return _0x46181a[_0xd9af('0x24')]()[_0xd9af('0x25')](function(){var _0x48b01e=_0x46181a['get']({'plain':!![]});var _0x25c141=_0xd9af('0x26');return db[_0xd9af('0x27')][_0xd9af('0x24')]({'where':{'type':_0x25c141,'resourceId':_0x48b01e['id']}})['then'](function(){return _0x46181a;});})[_0xd9af('0x25')](function(){_0x191408[_0xd9af('0x1a')](0xcc)[_0xd9af('0x1b')]();});}};}function handleEntityNotFound(_0x3c26ea,_0x53f917){return function(_0x3f526c){if(!_0x3f526c){_0x3c26ea[_0xd9af('0x19')](0x194);}return _0x3f526c;};}function handleError(_0x14620b,_0x3a791e){_0x3a791e=_0x3a791e||0x1f4;return function(_0x34019e){logger[_0xd9af('0x28')](_0x34019e[_0xd9af('0x29')]);if(_0x34019e['name']){delete _0x34019e[_0xd9af('0x2a')];}_0x14620b[_0xd9af('0x1a')](_0x3a791e)['send'](_0x34019e);};}exports['index']=function(_0xc745e2,_0x567ced){var _0x58bf4e={},_0x15c0fc={},_0x236797={'count':0x0,'rows':[]};var _0x171bee=_[_0xd9af('0x2b')](db['AnalyticCustomReport']['rawAttributes'],function(_0x5302cf){return{'name':_0x5302cf[_0xd9af('0x2c')],'type':_0x5302cf[_0xd9af('0x2d')][_0xd9af('0x2e')]};});_0x15c0fc[_0xd9af('0x2f')]=_[_0xd9af('0x2b')](_0x171bee,'name');_0x15c0fc[_0xd9af('0x30')]=_[_0xd9af('0x31')](_0xc745e2[_0xd9af('0x30')]);_0x15c0fc[_0xd9af('0x32')]=_['intersection'](_0x15c0fc[_0xd9af('0x2f')],_0x15c0fc[_0xd9af('0x30')]);_0x58bf4e[_0xd9af('0x33')]=_['intersection'](_0x15c0fc[_0xd9af('0x2f')],qs['fields'](_0xc745e2[_0xd9af('0x30')][_0xd9af('0x34')]));_0x58bf4e[_0xd9af('0x33')]=_0x58bf4e['attributes'][_0xd9af('0x35')]?_0x58bf4e[_0xd9af('0x33')]:_0x15c0fc[_0xd9af('0x2f')];if(!_0xc745e2['query'][_0xd9af('0x36')](_0xd9af('0x37'))){_0x58bf4e[_0xd9af('0x1f')]=qs[_0xd9af('0x1f')](_0xc745e2['query'][_0xd9af('0x1f')]);_0x58bf4e[_0xd9af('0x1d')]=qs[_0xd9af('0x1d')](_0xc745e2[_0xd9af('0x30')][_0xd9af('0x1d')]);}_0x58bf4e[_0xd9af('0x38')]=qs[_0xd9af('0x39')](_0xc745e2[_0xd9af('0x30')][_0xd9af('0x39')]);_0x58bf4e[_0xd9af('0x3a')]=qs[_0xd9af('0x32')](_[_0xd9af('0x3b')](_0xc745e2[_0xd9af('0x30')],_0x15c0fc[_0xd9af('0x32')]),_0x171bee);if(_0xc745e2[_0xd9af('0x30')]['filter']){_0x58bf4e[_0xd9af('0x3a')]=_[_0xd9af('0x3c')](_0x58bf4e[_0xd9af('0x3a')],{'$or':_[_0xd9af('0x2b')](_0x171bee,function(_0x2069b0){if(_0x2069b0[_0xd9af('0x2d')]!==_0xd9af('0x3d')){var _0x881d20={};_0x881d20[_0x2069b0['name']]={'$like':'%'+_0xc745e2[_0xd9af('0x30')][_0xd9af('0x3e')]+'%'};return _0x881d20;}})});}_0x58bf4e=_['merge']({},_0x58bf4e,_0xc745e2[_0xd9af('0x3f')]);var _0xc23864={'where':_0x58bf4e[_0xd9af('0x3a')]};return db['AnalyticCustomReport']['count'](_0xc23864)[_0xd9af('0x25')](function(_0x310e12){_0x236797[_0xd9af('0x20')]=_0x310e12;if(_0xc745e2['query']['includeAll']){_0x58bf4e[_0xd9af('0x40')]=[{'all':!![]}];}return db['AnalyticCustomReport'][_0xd9af('0x41')](_0x58bf4e);})['then'](function(_0x29901a){_0x236797['rows']=_0x29901a;return _0x236797;})[_0xd9af('0x25')](respondWithFilteredResult(_0x567ced,_0x58bf4e))['catch'](handleError(_0x567ced,null));};exports[_0xd9af('0x42')]=function(_0x1bada7,_0x285bcf){var _0x5ebdfd={'raw':![],'where':{'id':_0x1bada7[_0xd9af('0x43')]['id']}},_0x4fca44={};_0x4fca44[_0xd9af('0x2f')]=_[_0xd9af('0x31')](db[_0xd9af('0x44')][_0xd9af('0x45')]);_0x4fca44[_0xd9af('0x30')]=_[_0xd9af('0x31')](_0x1bada7[_0xd9af('0x30')]);_0x4fca44[_0xd9af('0x32')]=_['intersection'](_0x4fca44[_0xd9af('0x2f')],_0x4fca44[_0xd9af('0x30')]);_0x5ebdfd[_0xd9af('0x33')]=_[_0xd9af('0x46')](_0x4fca44[_0xd9af('0x2f')],qs[_0xd9af('0x34')](_0x1bada7['query'][_0xd9af('0x34')]));_0x5ebdfd[_0xd9af('0x33')]=_0x5ebdfd[_0xd9af('0x33')]['length']?_0x5ebdfd[_0xd9af('0x33')]:_0x4fca44['model'];if(_0x1bada7[_0xd9af('0x30')][_0xd9af('0x47')]){_0x5ebdfd[_0xd9af('0x40')]=[{'all':!![]}];}_0x5ebdfd=_[_0xd9af('0x3c')]({},_0x5ebdfd,_0x1bada7[_0xd9af('0x3f')]);return db[_0xd9af('0x44')]['find'](_0x5ebdfd)['then'](handleEntityNotFound(_0x285bcf,null))[_0xd9af('0x25')](respondWithResult(_0x285bcf,null))['catch'](handleError(_0x285bcf,null));};exports[_0xd9af('0x48')]=function(_0x209699,_0x595955){return db[_0xd9af('0x44')][_0xd9af('0x48')](_0x209699[_0xd9af('0x49')],{})[_0xd9af('0x25')](function(_0x2cfe66){var _0x4b778f=_0x209699['user'][_0xd9af('0x4a')]({'plain':!![]});if(!_0x4b778f)throw new Error(_0xd9af('0x4b'));if(_0x4b778f[_0xd9af('0x4c')]===_0xd9af('0x4d')){var _0x4f5692=_0x2cfe66[_0xd9af('0x4a')]({'plain':!![]});var _0x128f2f='Reports';return db[_0xd9af('0x4e')]['find']({'where':{'name':_0x128f2f,'userProfileId':_0x4b778f[_0xd9af('0x4f')]},'raw':!![]})[_0xd9af('0x25')](function(_0x570556){if(_0x570556&&_0x570556[_0xd9af('0x50')]===0x0){return db[_0xd9af('0x27')][_0xd9af('0x48')]({'name':_0x4f5692[_0xd9af('0x2a')],'resourceId':_0x4f5692['id'],'type':_0xd9af('0x26'),'sectionId':_0x570556['id']},{})[_0xd9af('0x25')](function(){return _0x2cfe66;});}else{return _0x2cfe66;}})[_0xd9af('0x51')](function(_0x4328e2){logger[_0xd9af('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4328e2);throw _0x4328e2;});}return _0x2cfe66;})['then'](respondWithResult(_0x595955,0xc9))[_0xd9af('0x51')](handleError(_0x595955,null));};exports[_0xd9af('0x23')]=function(_0x3ada12,_0x559291){if(_0x3ada12[_0xd9af('0x49')]['id']){delete _0x3ada12[_0xd9af('0x49')]['id'];}return db[_0xd9af('0x44')][_0xd9af('0x52')]({'where':{'id':_0x3ada12[_0xd9af('0x43')]['id']}})[_0xd9af('0x25')](handleEntityNotFound(_0x559291,null))[_0xd9af('0x25')](saveUpdates(_0x3ada12['body'],null))[_0xd9af('0x25')](respondWithResult(_0x559291,null))[_0xd9af('0x51')](handleError(_0x559291,null));};exports['destroy']=function(_0x35d688,_0x873dad){return db[_0xd9af('0x44')][_0xd9af('0x52')]({'where':{'id':_0x35d688[_0xd9af('0x43')]['id']}})['then'](handleEntityNotFound(_0x873dad,null))[_0xd9af('0x25')](removeEntity(_0x873dad,null))['catch'](handleError(_0x873dad,null));};exports[_0xd9af('0x53')]=function(_0x5f299f,_0x2c6e0d){var _0x5ae442=0xa;var _0x512a4b=[_0xd9af('0x54'),_0xd9af('0x55'),_0xd9af('0x56'),_0xd9af('0x57')];var _0x4f4715={'SUM':_0xd9af('0x58'),'COUNT':_0xd9af('0x59'),'COUNT DISTINCT':_0xd9af('0x5a'),'MAX':_0xd9af('0x5b'),'MIN':_0xd9af('0x5c'),'AVG':_0xd9af('0x5d'),'GROUP_CONCAT':_0xd9af('0x5e'),'GROUP_CONCAT ASC':_0xd9af('0x5f'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x786855={'SEC_TO_TIME':_0xd9af('0x60'),'DATE':_0xd9af('0x61'),'HOUR':_0xd9af('0x62'),'ROUND':_0xd9af('0x63'),'UNIX_TIMESTAMP':_0xd9af('0x64')};var _0x3d3fe4=function(_0x3a4d25){return!_['includes']([_0xd9af('0x65'),_0xd9af('0x66'),'IS\x20EMPTY',_0xd9af('0x67')],_0x3a4d25);};var _0x123ece=function(_0x3a3bb0){if(!_0x3a3bb0||!_0x3a3bb0['rules']['length']){return'';}for(var _0x95dcad='(',_0x3f8064=0x0;_0x3f8064<_0x3a3bb0['rules']['length'];_0x3f8064+=0x1){_0x3f8064>0x0&&(_0x95dcad+='\x20'+_0x3a3bb0['operator']+'\x20');_0x95dcad+=_0x3a3bb0['rules'][_0x3f8064][_0xd9af('0x68')]?_0x123ece(_0x3a3bb0['rules'][_0x3f8064]['group']):_0x3a3bb0[_0xd9af('0x69')][_0x3f8064]['field']+'\x20'+_0x3a3bb0['rules'][_0x3f8064]['condition']+(_0x3d3fe4(_0x3a3bb0[_0xd9af('0x69')][_0x3f8064][_0xd9af('0x6a')])?'\x20'+_0x3a3bb0[_0xd9af('0x69')][_0x3f8064]['value']:'');}return _0x95dcad+')';};var _0x30d5b2={'where':{'id':_0x5f299f['params']['id']}},_0x1c5ee0,_0x491b42,_0x38eeae,_0x399d4c,_0x52706b;_0x30d5b2=_[_0xd9af('0x3c')]({},_0x30d5b2,_0x5f299f[_0xd9af('0x3f')]);return db[_0xd9af('0x44')][_0xd9af('0x52')](_0x30d5b2)[_0xd9af('0x25')](function(_0x3430ae){if(_0x3430ae){_0x1c5ee0=_0x3430ae;return _0x3430ae[_0xd9af('0x6b')]();}return null;})[_0xd9af('0x25')](function(_0x56a00b){if(_0x56a00b){if(!_0x56a00b[_0xd9af('0x35')]){throw new db[(_0xd9af('0x6c'))][(_0xd9af('0x6d'))](_0xd9af('0x6e'),0x193);}_0x491b42=_0x56a00b;return db['AnalyticMetric'][_0xd9af('0x41')]({'raw':!![]});}return null;})[_0xd9af('0x25')](function(_0x291218){if(_0x291218){_0x38eeae=_['keyBy'](_0x291218,'id');var _0x6f2c40;var _0x330dba=squel[_0xd9af('0x6f')]();_0x330dba[_0xd9af('0x70')](_0x1c5ee0['table']);for(var _0x43a898=0x0;_0x43a898<_0x491b42[_0xd9af('0x35')];_0x43a898+=0x1){_0x6f2c40=_0x491b42[_0x43a898][_0xd9af('0x71')]?_0x38eeae[_0x491b42[_0x43a898]['MetricId']][_0xd9af('0x72')]:_0x491b42[_0x43a898]['field'];_0x6f2c40=_0x491b42[_0x43a898][_0xd9af('0x73')]?_['replace'](_0x4f4715[_0x491b42[_0x43a898]['function']],'%s',_0x6f2c40):_0x6f2c40;_0x6f2c40=_0x491b42[_0x43a898][_0xd9af('0x74')]?_['replace'](_0x786855[_0x491b42[_0x43a898][_0xd9af('0x74')]],'%s',_0x6f2c40):_0x6f2c40;if(_0x491b42[_0x43a898][_0xd9af('0x75')]){_0x330dba[_0xd9af('0x68')](_0x6f2c40);}_0x491b42[_0x43a898][_0xd9af('0x76')]&&_0x330dba[_0xd9af('0x38')](_0x6f2c40,_0x491b42[_0x43a898][_0xd9af('0x76')]==='DESC'?![]:!![]);_0x330dba[_0xd9af('0x77')](_0x6f2c40,_0x491b42[_0x43a898]['alias']||_0x6f2c40);}if(_0x1c5ee0[_0xd9af('0x78')]){_0x1c5ee0[_0xd9af('0x78')]=JSON[_0xd9af('0x79')](_0x1c5ee0[_0xd9af('0x78')]);for(var _0x3e584c=0x0;_0x3e584c<_0x1c5ee0[_0xd9af('0x78')][_0xd9af('0x35')];_0x3e584c+=0x1){if(_0x1c5ee0[_0xd9af('0x78')][_0x3e584c][_0xd9af('0x2d')]&&_[_0xd9af('0x7a')](_0x512a4b,_0x1c5ee0[_0xd9af('0x78')][_0x3e584c][_0xd9af('0x2d')])&&_0x1c5ee0[_0xd9af('0x78')][_0x3e584c][_0xd9af('0x7b')]&&_0x1c5ee0['joins'][_0x3e584c][_0xd9af('0x7c')]&&_0x1c5ee0['joins'][_0x3e584c][_0xd9af('0x7d')]){_0x330dba[_0x1c5ee0[_0xd9af('0x78')][_0x3e584c][_0xd9af('0x2d')]](_0x1c5ee0[_0xd9af('0x78')][_0x3e584c][_0xd9af('0x7c')],null,util['format'](_0xd9af('0x7e'),_0x1c5ee0[_0xd9af('0x7f')],_0x1c5ee0[_0xd9af('0x78')][_0x3e584c]['parentKey'],_0x1c5ee0[_0xd9af('0x78')][_0x3e584c][_0xd9af('0x7c')],_0x1c5ee0[_0xd9af('0x78')][_0x3e584c][_0xd9af('0x7d')]));}}}if(_0x1c5ee0['conditions']){_0x1c5ee0[_0xd9af('0x80')]=JSON[_0xd9af('0x79')](_0x1c5ee0['conditions']);_0x330dba['where'](_0x123ece(_0x1c5ee0['conditions']['group']));}_0x52706b=_0x330dba[_0xd9af('0x81')]();_0x330dba[_0xd9af('0x1f')](_0x5ae442);_0x330dba[_0xd9af('0x1d')](0x0);logger[_0xd9af('0x82')]('Limited\x20Query:',_0x330dba['toString']());return dbH[_0xd9af('0x83')][_0xd9af('0x30')](_0x330dba[_0xd9af('0x84')](),{'type':dbH['sequelize'][_0xd9af('0x85')][_0xd9af('0x86')]});}})[_0xd9af('0x25')](respondWithResult(_0x2c6e0d,null))[_0xd9af('0x51')](handleError(_0x2c6e0d,null));};function runReport(_0x45824e,_0x3e510e,_0x2ceaec){var _0x5c9b35=_0x3e510e[_0xd9af('0x2a')];var _0x540254=0xa;var _0x183d80=[_0xd9af('0x54'),_0xd9af('0x55'),_0xd9af('0x56'),_0xd9af('0x57')];var _0x34d2b7={'SUM':_0xd9af('0x58'),'COUNT':_0xd9af('0x59'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0xd9af('0x5e'),'GROUP_CONCAT ASC':_0xd9af('0x5f'),'GROUP_CONCAT DESC':_0xd9af('0x87')};var _0x101787={'SEC_TO_TIME':_0xd9af('0x60'),'DATE':_0xd9af('0x61'),'HOUR':_0xd9af('0x62'),'ROUND':_0xd9af('0x63'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x3b66e3=function(_0x334d33){return!_['includes']([_0xd9af('0x65'),_0xd9af('0x66'),'IS\x20EMPTY',_0xd9af('0x67')],_0x334d33);};var _0x23c2a7=function(_0xbc7d82){if(!_0xbc7d82||!_0xbc7d82['rules'][_0xd9af('0x35')]){return'';}for(var _0x363b17='(',_0x5fe18f=0x0;_0x5fe18f<_0xbc7d82[_0xd9af('0x69')][_0xd9af('0x35')];_0x5fe18f+=0x1){_0x5fe18f>0x0&&(_0x363b17+='\x20'+_0xbc7d82['operator']+'\x20');_0x363b17+=_0xbc7d82[_0xd9af('0x69')][_0x5fe18f][_0xd9af('0x68')]?_0x23c2a7(_0xbc7d82[_0xd9af('0x69')][_0x5fe18f][_0xd9af('0x68')]):_0xbc7d82[_0xd9af('0x69')][_0x5fe18f][_0xd9af('0x77')]+'\x20'+_0xbc7d82[_0xd9af('0x69')][_0x5fe18f][_0xd9af('0x6a')]+(_0x3b66e3(_0xbc7d82['rules'][_0x5fe18f][_0xd9af('0x6a')])?'\x20'+_0xbc7d82[_0xd9af('0x69')][_0x5fe18f][_0xd9af('0x88')]:'');}return _0x363b17+')';};var _0x1b389d={'where':{'id':_0x45824e['id']}},_0x295113,_0x4a1486,_0x5c39a6,_0x314ff6,_0x5a19f1;_0x1b389d=_['merge']({},_0x1b389d,_0x2ceaec);return db[_0xd9af('0x44')][_0xd9af('0x52')](_0x1b389d)[_0xd9af('0x25')](function(_0x5e398f){if(_0x5e398f){_0x295113=_0x5e398f;return _0x5e398f['getFields']();}return null;})[_0xd9af('0x25')](function(_0x41786d){if(_0x41786d){if(!_0x41786d[_0xd9af('0x35')]){throw new db[(_0xd9af('0x6c'))][(_0xd9af('0x6d'))](_0xd9af('0x6e'),0x193);}_0x4a1486=_0x41786d;return db[_0xd9af('0x89')][_0xd9af('0x41')]({'raw':!![]});}return null;})[_0xd9af('0x25')](function(_0x27c31e){if(_0x27c31e){_0x5c39a6=_[_0xd9af('0x8a')](_0x27c31e,'id');var _0x32d642;var _0x3e7f11=squel[_0xd9af('0x6f')]();_0x3e7f11[_0xd9af('0x70')](_0x295113['table']);for(var _0x992f7c=0x0;_0x992f7c<_0x4a1486[_0xd9af('0x35')];_0x992f7c+=0x1){_0x32d642=_0x4a1486[_0x992f7c][_0xd9af('0x71')]?_0x5c39a6[_0x4a1486[_0x992f7c]['MetricId']][_0xd9af('0x72')]:_0x4a1486[_0x992f7c][_0xd9af('0x77')];_0x32d642=_0x4a1486[_0x992f7c][_0xd9af('0x73')]?_[_0xd9af('0x8b')](_0x34d2b7[_0x4a1486[_0x992f7c][_0xd9af('0x73')]],'%s',_0x32d642):_0x32d642;_0x32d642=_0x4a1486[_0x992f7c][_0xd9af('0x74')]?_[_0xd9af('0x8b')](_0x101787[_0x4a1486[_0x992f7c][_0xd9af('0x74')]],'%s',_0x32d642):_0x32d642;if(_0x4a1486[_0x992f7c][_0xd9af('0x75')]){_0x3e7f11[_0xd9af('0x68')](_0x32d642);}_0x4a1486[_0x992f7c]['orderBy']&&_0x3e7f11[_0xd9af('0x38')](_0x32d642,_0x4a1486[_0x992f7c][_0xd9af('0x76')]==='DESC'?![]:!![]);_0x3e7f11['field'](_0x32d642,_0x4a1486[_0x992f7c][_0xd9af('0x8c')]||_0x32d642);}if(_0x295113[_0xd9af('0x78')]){_0x295113[_0xd9af('0x78')]=JSON[_0xd9af('0x79')](_0x295113['joins']);for(var _0x57c24f=0x0;_0x57c24f<_0x295113['joins'][_0xd9af('0x35')];_0x57c24f+=0x1){if(_0x295113[_0xd9af('0x78')][_0x57c24f][_0xd9af('0x2d')]&&_[_0xd9af('0x7a')](_0x183d80,_0x295113['joins'][_0x57c24f][_0xd9af('0x2d')])&&_0x295113[_0xd9af('0x78')][_0x57c24f][_0xd9af('0x7b')]&&_0x295113[_0xd9af('0x78')][_0x57c24f]['foreignTable']&&_0x295113[_0xd9af('0x78')][_0x57c24f][_0xd9af('0x7d')]){_0x3e7f11[_0x295113['joins'][_0x57c24f][_0xd9af('0x2d')]](_0x295113[_0xd9af('0x78')][_0x57c24f]['foreignTable'],null,util[_0xd9af('0x74')](_0xd9af('0x7e'),_0x295113[_0xd9af('0x7f')],_0x295113[_0xd9af('0x78')][_0x57c24f][_0xd9af('0x7b')],_0x295113['joins'][_0x57c24f][_0xd9af('0x7c')],_0x295113[_0xd9af('0x78')][_0x57c24f]['foreignKey']));}}}if(_0x295113[_0xd9af('0x80')]){_0x295113['conditions']=JSON[_0xd9af('0x79')](_0x295113[_0xd9af('0x80')]);_0x3e7f11[_0xd9af('0x3a')](_0x23c2a7(_0x295113[_0xd9af('0x80')]['group']));}_0x5a19f1=_0x3e7f11[_0xd9af('0x81')]();_0x3e7f11['limit'](_0x540254);_0x3e7f11[_0xd9af('0x1d')](0x0);return;}})[_0xd9af('0x25')](function(){if(_0x3e510e[_0xd9af('0x8d')]===_0xd9af('0x8e')){return null;}var _0x43ae9f=_[_0xd9af('0x3c')](_0x3e510e,{'name':_0x3e510e['fullPath']||_0x3e510e[_0xd9af('0x2a')]||_0x295113[_0xd9af('0x2a')],'basename':_0x5c9b35,'savename':util[_0xd9af('0x74')](_0xd9af('0x8f'),_0x3e510e['name']||_0x295113['name'],require('randomstring')[_0xd9af('0x90')](0x4),_0x3e510e[_0xd9af('0x8d')]||_0xd9af('0x91')),'reportId':_0x295113['id'],'reportType':_0xd9af('0x92')});return db['AnalyticExtractedReport'][_0xd9af('0x48')](_0x43ae9f,{'raw':!![]});})[_0xd9af('0x25')](function(_0x407623){if(_0x295113[_0xd9af('0x7f')]==='cdr'){_0x5a19f1[_0xd9af('0x3a')](_0x295113[_0xd9af('0x7f')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x3e510e[_0xd9af('0x93')],_0x3e510e[_0xd9af('0x94')]);}else{_0x5a19f1[_0xd9af('0x3a')](_0x295113['table']+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x3e510e['startDate'],_0x3e510e['endDate']);}if(_0x407623){logger[_0xd9af('0x95')](_0xd9af('0x96'),_0x5a19f1['toString']());require(_0xd9af('0x97'))[_0xd9af('0x98')](path['join'](__dirname,_0xd9af('0x99'),_0x407623[_0xd9af('0x8d')]),[_0x407623['id'],_0x5a19f1[_0xd9af('0x84')](),path[_0xd9af('0x54')](__dirname,'../../files/reports',_0x407623[_0xd9af('0x9a')]),_0x5c9b35]);return _0x407623;}else{var _0x30db04=squel[_0xd9af('0x6f')]();_0x30db04[_0xd9af('0x70')]('('+_0x5a19f1[_0xd9af('0x84')]()+')',_0xd9af('0x9b'));_0x30db04['field'](_0xd9af('0x9c'),_0xd9af('0x20'));_0x5a19f1['limit'](_0x3e510e['limit']||_0x540254);_0x5a19f1[_0xd9af('0x1d')](_0x3e510e['offset']||0x0);return dbH[_0xd9af('0x83')][_0xd9af('0x30')](_0x30db04[_0xd9af('0x84')](),{'type':dbH[_0xd9af('0x83')][_0xd9af('0x85')][_0xd9af('0x86')]})['then'](function(_0x3cc538){if(!_0x3cc538[_0xd9af('0x35')]){_0x314ff6=0x0;}else{_0x314ff6=_0x3cc538[0x0][_0xd9af('0x20')]||0x0;}return dbH[_0xd9af('0x83')][_0xd9af('0x30')](_0x5a19f1[_0xd9af('0x84')](),{'type':dbH['sequelize'][_0xd9af('0x85')]['SELECT']});})[_0xd9af('0x25')](function(_0x305d1b){return{'rows':_0x305d1b||[],'count':_0x314ff6};});}});}exports[_0xd9af('0x9d')]=function(_0x4a19f3,_0x5cd308){return runReport(_0x4a19f3[_0xd9af('0x43')],_0x4a19f3[_0xd9af('0x30')],_0x4a19f3[_0xd9af('0x3f')])[_0xd9af('0x25')](respondWithResult(_0x5cd308,null))[_0xd9af('0x51')](handleError(_0x5cd308,null));};exports[_0xd9af('0x9e')]=runReport;exports[_0xd9af('0x30')]=function(_0x5423d0,_0x282587){var _0xc22efa=0xa;var _0x5ee889=[_0xd9af('0x54'),_0xd9af('0x55'),_0xd9af('0x56'),'cross_join'];var _0x2f57c1={'SUM':_0xd9af('0x58'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xd9af('0x5a'),'MAX':_0xd9af('0x5b'),'MIN':_0xd9af('0x5c'),'AVG':_0xd9af('0x5d'),'GROUP_CONCAT':_0xd9af('0x5e'),'GROUP_CONCAT ASC':_0xd9af('0x5f'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x2b4b14={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xd9af('0x61'),'HOUR':_0xd9af('0x62'),'ROUND':_0xd9af('0x63'),'UNIX_TIMESTAMP':_0xd9af('0x64')};var _0x1f659d=function(_0x88140e){return!_['includes']([_0xd9af('0x65'),_0xd9af('0x66'),_0xd9af('0x9f'),_0xd9af('0x67')],_0x88140e);};var _0x159a89=function(_0x542e5f){if(!_0x542e5f||!_0x542e5f['rules'][_0xd9af('0x35')]){return'';}for(var _0x345bff='(',_0x4f6bc4=0x0;_0x4f6bc4<_0x542e5f[_0xd9af('0x69')][_0xd9af('0x35')];_0x4f6bc4+=0x1){_0x4f6bc4>0x0&&(_0x345bff+='\x20'+_0x542e5f[_0xd9af('0xa0')]+'\x20');_0x345bff+=_0x542e5f[_0xd9af('0x69')][_0x4f6bc4]['group']?_0x159a89(_0x542e5f[_0xd9af('0x69')][_0x4f6bc4][_0xd9af('0x68')]):_0x542e5f[_0xd9af('0x69')][_0x4f6bc4]['field']+'\x20'+_0x542e5f[_0xd9af('0x69')][_0x4f6bc4][_0xd9af('0x6a')]+(_0x1f659d(_0x542e5f[_0xd9af('0x69')][_0x4f6bc4][_0xd9af('0x6a')])?'\x20'+_0x542e5f[_0xd9af('0x69')][_0x4f6bc4]['value']:'');}return _0x345bff+')';};var _0x5d65c1={'where':{'id':_0x5423d0[_0xd9af('0x43')]['id']}},_0x2da636,_0x23796f,_0x5e6f75,_0x4166a3,_0x48c28d;_0x5d65c1=_['merge']({},_0x5d65c1,_0x5423d0[_0xd9af('0x3f')]);return db['AnalyticCustomReport'][_0xd9af('0x52')](_0x5d65c1)['then'](function(_0x2f6c45){if(_0x2f6c45){_0x2da636=_0x2f6c45;return _0x2f6c45[_0xd9af('0x6b')]();}return null;})[_0xd9af('0x25')](function(_0xd2cb51){if(_0xd2cb51){if(!_0xd2cb51[_0xd9af('0x35')]){throw new db[(_0xd9af('0x6c'))]['ValidationErrorItem'](_0xd9af('0x6e'),0x193);}_0x23796f=_0xd2cb51;return db[_0xd9af('0x89')][_0xd9af('0x41')]({'raw':!![]});}return null;})['then'](function(_0x541f31){if(_0x541f31){_0x5e6f75=_[_0xd9af('0x8a')](_0x541f31,'id');var _0x46890a;var _0x3a0d29=squel['select']();_0x3a0d29[_0xd9af('0x70')](_0x2da636[_0xd9af('0x7f')]);for(var _0x3e6d54=0x0;_0x3e6d54<_0x23796f[_0xd9af('0x35')];_0x3e6d54+=0x1){_0x46890a=_0x23796f[_0x3e6d54][_0xd9af('0x71')]?_0x5e6f75[_0x23796f[_0x3e6d54]['MetricId']][_0xd9af('0x72')]:_0x23796f[_0x3e6d54][_0xd9af('0x77')];_0x46890a=_0x23796f[_0x3e6d54][_0xd9af('0x73')]?_[_0xd9af('0x8b')](_0x2f57c1[_0x23796f[_0x3e6d54]['function']],'%s',_0x46890a):_0x46890a;_0x46890a=_0x23796f[_0x3e6d54][_0xd9af('0x74')]?_[_0xd9af('0x8b')](_0x2b4b14[_0x23796f[_0x3e6d54][_0xd9af('0x74')]],'%s',_0x46890a):_0x46890a;if(_0x23796f[_0x3e6d54]['groupBy']){_0x3a0d29[_0xd9af('0x68')](_0x46890a);}_0x23796f[_0x3e6d54][_0xd9af('0x76')]&&_0x3a0d29[_0xd9af('0x38')](_0x46890a,_0x23796f[_0x3e6d54][_0xd9af('0x76')]===_0xd9af('0xa1')?![]:!![]);_0x3a0d29[_0xd9af('0x77')](_0x46890a,_0x23796f[_0x3e6d54][_0xd9af('0x8c')]||_0x46890a);}if(_0x2da636[_0xd9af('0x78')]){_0x2da636[_0xd9af('0x78')]=JSON[_0xd9af('0x79')](_0x2da636[_0xd9af('0x78')]);for(var _0x944183=0x0;_0x944183<_0x2da636['joins'][_0xd9af('0x35')];_0x944183+=0x1){if(_0x2da636[_0xd9af('0x78')][_0x944183]['type']&&_[_0xd9af('0x7a')](_0x5ee889,_0x2da636['joins'][_0x944183]['type'])&&_0x2da636[_0xd9af('0x78')][_0x944183]['parentKey']&&_0x2da636['joins'][_0x944183][_0xd9af('0x7c')]&&_0x2da636['joins'][_0x944183][_0xd9af('0x7d')]){_0x3a0d29[_0x2da636['joins'][_0x944183][_0xd9af('0x2d')]](_0x2da636['joins'][_0x944183][_0xd9af('0x7c')],null,util[_0xd9af('0x74')](_0xd9af('0x7e'),_0x2da636[_0xd9af('0x7f')],_0x2da636[_0xd9af('0x78')][_0x944183][_0xd9af('0x7b')],_0x2da636[_0xd9af('0x78')][_0x944183]['foreignTable'],_0x2da636[_0xd9af('0x78')][_0x944183][_0xd9af('0x7d')]));}}}if(_0x2da636[_0xd9af('0x80')]){_0x2da636['conditions']=JSON[_0xd9af('0x79')](_0x2da636[_0xd9af('0x80')]);_0x3a0d29['where'](_0x159a89(_0x2da636[_0xd9af('0x80')][_0xd9af('0x68')]));}_0x48c28d=_0x3a0d29[_0xd9af('0x81')]();_0x3a0d29[_0xd9af('0x1f')](_0xc22efa);_0x3a0d29[_0xd9af('0x1d')](0x0);logger[_0xd9af('0x82')]('Limited\x20Query:',_0x3a0d29[_0xd9af('0x84')]());return dbH[_0xd9af('0x83')][_0xd9af('0x30')](_0x3a0d29[_0xd9af('0x84')](),{'type':dbH[_0xd9af('0x83')]['QueryTypes'][_0xd9af('0x86')]});}})[_0xd9af('0x25')](function(){return{'sql':_0x48c28d['toString']()};})[_0xd9af('0x25')](respondWithResult(_0x282587,null))[_0xd9af('0x51')](handleError(_0x282587,null));}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js index e71b4bb..cc28e75 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 _0x47c8=['moment','bluebird','request-promise','path','../../config/environment','./analyticCustomReport.attributes','exports','define','analytics_custom_reports','../../config/logger','api'];(function(_0x2714a8,_0x33371c){var _0x1bef43=function(_0x359cd4){while(--_0x359cd4){_0x2714a8['push'](_0x2714a8['shift']());}};_0x1bef43(++_0x33371c);}(_0x47c8,0x1cc));var _0x847c=function(_0x3a3c3e,_0x5a024f){_0x3a3c3e=_0x3a3c3e-0x0;var _0x3f9410=_0x47c8[_0x3a3c3e];return _0x3f9410;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x847c('0x0'))(_0x847c('0x1'));var moment=require(_0x847c('0x2'));var BPromise=require(_0x847c('0x3'));var rp=require(_0x847c('0x4'));var fs=require('fs');var path=require(_0x847c('0x5'));var rimraf=require('rimraf');var config=require(_0x847c('0x6'));var attributes=require(_0x847c('0x7'));module[_0x847c('0x8')]=function(_0xc77095,_0x1b08f8){return _0xc77095[_0x847c('0x9')]('AnalyticCustomReport',attributes,{'tableName':_0x847c('0xa'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe789=['./analyticCustomReport.attributes','exports','AnalyticCustomReport','lodash','util','../../config/logger','api','moment','request-promise'];(function(_0x22da61,_0x237ba9){var _0x40b728=function(_0x24db93){while(--_0x24db93){_0x22da61['push'](_0x22da61['shift']());}};_0x40b728(++_0x237ba9);}(_0xe789,0x147));var _0x9e78=function(_0x437767,_0x3e7b25){_0x437767=_0x437767-0x0;var _0x341ab1=_0xe789[_0x437767];return _0x341ab1;};'use strict';var _=require(_0x9e78('0x0'));var util=require(_0x9e78('0x1'));var logger=require(_0x9e78('0x2'))(_0x9e78('0x3'));var moment=require(_0x9e78('0x4'));var BPromise=require('bluebird');var rp=require(_0x9e78('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x9e78('0x6'));module[_0x9e78('0x7')]=function(_0x31e1c8,_0x275d80){return _0x31e1c8['define'](_0x9e78('0x8'),attributes,{'tableName':'analytics_custom_reports','paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.rpc.js b/server/api/analyticCustomReport/analyticCustomReport.rpc.js index a7adfa6..4a516ed 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 _0xbc32=['message','result','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','request','then','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x287f7a,_0x2ba119){var _0x569356=function(_0x20cb4a){while(--_0x20cb4a){_0x287f7a['push'](_0x287f7a['shift']());}};_0x569356(++_0x2ba119);}(_0xbc32,0x71));var _0x2bc3=function(_0x1d435c,_0x1cf751){_0x1d435c=_0x1d435c-0x0;var _0x1e0b37=_0xbc32[_0x1d435c];return _0x1e0b37;};'use strict';var _=require(_0x2bc3('0x0'));var util=require(_0x2bc3('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x2bc3('0x2'));var fs=require('fs');var Redis=require(_0x2bc3('0x3'));var db=require(_0x2bc3('0x4'))['db'];var utils=require(_0x2bc3('0x5'));var logger=require(_0x2bc3('0x6'))(_0x2bc3('0x7'));var config=require('../../config/environment');var jayson=require(_0x2bc3('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3957c1,_0x1f5dc4,_0x54ed16){return new BPromise(function(_0x3ccc81,_0x2cd421){return client[_0x2bc3('0x9')](_0x3957c1,_0x54ed16)[_0x2bc3('0xa')](function(_0x30322e){logger[_0x2bc3('0xb')](_0x2bc3('0xc'),_0x1f5dc4,_0x2bc3('0xd'));logger[_0x2bc3('0xe')](_0x2bc3('0xf'),_0x1f5dc4,_0x2bc3('0xd'),JSON[_0x2bc3('0x10')](_0x30322e));if(_0x30322e[_0x2bc3('0x11')]){if(_0x30322e[_0x2bc3('0x11')][_0x2bc3('0x12')]===0x1f4){logger[_0x2bc3('0x11')]('AnalyticCustomReport,\x20%s,\x20%s',_0x1f5dc4,_0x30322e[_0x2bc3('0x11')][_0x2bc3('0x13')]);return _0x2cd421(_0x30322e[_0x2bc3('0x11')]['message']);}logger[_0x2bc3('0x11')]('AnalyticCustomReport,\x20%s,\x20%s',_0x1f5dc4,_0x30322e[_0x2bc3('0x11')][_0x2bc3('0x13')]);return _0x3ccc81(_0x30322e['error'][_0x2bc3('0x13')]);}else{logger[_0x2bc3('0xb')]('AnalyticCustomReport,\x20%s,\x20%s',_0x1f5dc4,_0x2bc3('0xd'));_0x3ccc81(_0x30322e[_0x2bc3('0x14')][_0x2bc3('0x13')]);}})[_0x2bc3('0x15')](function(_0x9ec011){logger[_0x2bc3('0x11')](_0x2bc3('0xc'),_0x1f5dc4,_0x9ec011);_0x2cd421(_0x9ec011);});});} \ No newline at end of file +var _0xb7d5=['result','catch','lodash','util','moment','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','error','AnalyticCustomReport,\x20%s,\x20%s','message'];(function(_0x2302e6,_0x567866){var _0x1b1930=function(_0x5e2af7){while(--_0x5e2af7){_0x2302e6['push'](_0x2302e6['shift']());}};_0x1b1930(++_0x567866);}(_0xb7d5,0xa2));var _0x5b7d=function(_0x553b73,_0x53b56f){_0x553b73=_0x553b73-0x0;var _0x339226=_0xb7d5[_0x553b73];return _0x339226;};'use strict';var _=require(_0x5b7d('0x0'));var util=require(_0x5b7d('0x1'));var moment=require(_0x5b7d('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5b7d('0x3'))['db'];var utils=require(_0x5b7d('0x4'));var logger=require('../../config/logger')(_0x5b7d('0x5'));var config=require(_0x5b7d('0x6'));var jayson=require(_0x5b7d('0x7'));var client=jayson[_0x5b7d('0x8')][_0x5b7d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x239610,_0x7bc085,_0x35d682){return new BPromise(function(_0x2b6093,_0x587b23){return client['request'](_0x239610,_0x35d682)[_0x5b7d('0xa')](function(_0x2f00bd){logger[_0x5b7d('0xb')]('AnalyticCustomReport,\x20%s,\x20%s',_0x7bc085,_0x5b7d('0xc'));logger[_0x5b7d('0xd')](_0x5b7d('0xe'),_0x7bc085,_0x5b7d('0xc'),JSON['stringify'](_0x2f00bd));if(_0x2f00bd[_0x5b7d('0xf')]){if(_0x2f00bd[_0x5b7d('0xf')]['code']===0x1f4){logger[_0x5b7d('0xf')](_0x5b7d('0x10'),_0x7bc085,_0x2f00bd[_0x5b7d('0xf')][_0x5b7d('0x11')]);return _0x587b23(_0x2f00bd[_0x5b7d('0xf')][_0x5b7d('0x11')]);}logger[_0x5b7d('0xf')](_0x5b7d('0x10'),_0x7bc085,_0x2f00bd[_0x5b7d('0xf')][_0x5b7d('0x11')]);return _0x2b6093(_0x2f00bd[_0x5b7d('0xf')][_0x5b7d('0x11')]);}else{logger[_0x5b7d('0xb')](_0x5b7d('0x10'),_0x7bc085,'request\x20sent');_0x2b6093(_0x2f00bd[_0x5b7d('0x12')]['message']);}})[_0x5b7d('0x13')](function(_0x217731){logger['error'](_0x5b7d('0x10'),_0x7bc085,_0x217731);_0x587b23(_0x217731);});});} \ No newline at end of file diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js index a7df385..6fa702f 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 _0x93b8=['/:id/query','query','post','create','put','update','delete','/:id','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','get','isAuthenticated','index','show','/:id/preview','preview','/:id/run','run'];(function(_0x21ef1d,_0xbfa6e){var _0x2dcdf0=function(_0x5494c6){while(--_0x5494c6){_0x21ef1d['push'](_0x21ef1d['shift']());}};_0x2dcdf0(++_0xbfa6e);}(_0x93b8,0x14e));var _0x893b=function(_0xe7f99f,_0x49aeb4){_0xe7f99f=_0xe7f99f-0x0;var _0x5c9b54=_0x93b8[_0xe7f99f];return _0x5c9b54;};'use strict';var multer=require(_0x893b('0x0'));var util=require(_0x893b('0x1'));var path=require(_0x893b('0x2'));var timeout=require(_0x893b('0x3'));var express=require(_0x893b('0x4'));var router=express[_0x893b('0x5')]();var fs_extra=require(_0x893b('0x6'));var auth=require(_0x893b('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./analyticCustomReport.controller');router[_0x893b('0x8')]('/',auth[_0x893b('0x9')](),controller[_0x893b('0xa')]);router[_0x893b('0x8')]('/:id',auth[_0x893b('0x9')](),controller[_0x893b('0xb')]);router[_0x893b('0x8')](_0x893b('0xc'),auth[_0x893b('0x9')](),controller[_0x893b('0xd')]);router['get'](_0x893b('0xe'),auth['isAuthenticated'](),controller[_0x893b('0xf')]);router[_0x893b('0x8')](_0x893b('0x10'),auth[_0x893b('0x9')](),controller[_0x893b('0x11')]);router[_0x893b('0x12')]('/',auth['isAuthenticated'](),controller[_0x893b('0x13')]);router[_0x893b('0x14')]('/:id',auth[_0x893b('0x9')](),controller[_0x893b('0x15')]);router[_0x893b('0x16')](_0x893b('0x17'),auth[_0x893b('0x9')](),controller[_0x893b('0x18')]);module['exports']=router; \ No newline at end of file +var _0x70d3=['/:id','show','preview','/:id/run','/:id/query','query','create','put','update','delete','destroy','multer','util','path','fs-extra','../../components/interaction/service','./analyticCustomReport.controller','get','isAuthenticated','index'];(function(_0x363fa6,_0x10396a){var _0x23fce4=function(_0x18307f){while(--_0x18307f){_0x363fa6['push'](_0x363fa6['shift']());}};_0x23fce4(++_0x10396a);}(_0x70d3,0x15f));var _0x370d=function(_0x4dfbc1,_0x560ec2){_0x4dfbc1=_0x4dfbc1-0x0;var _0x27d7ad=_0x70d3[_0x4dfbc1];return _0x27d7ad;};'use strict';var multer=require(_0x370d('0x0'));var util=require(_0x370d('0x1'));var path=require(_0x370d('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x370d('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x370d('0x4'));var config=require('../../config/environment');var controller=require(_0x370d('0x5'));router[_0x370d('0x6')]('/',auth[_0x370d('0x7')](),controller[_0x370d('0x8')]);router[_0x370d('0x6')](_0x370d('0x9'),auth[_0x370d('0x7')](),controller[_0x370d('0xa')]);router[_0x370d('0x6')]('/:id/preview',auth['isAuthenticated'](),controller[_0x370d('0xb')]);router[_0x370d('0x6')](_0x370d('0xc'),auth['isAuthenticated'](),controller['run']);router['get'](_0x370d('0xd'),auth[_0x370d('0x7')](),controller[_0x370d('0xe')]);router['post']('/',auth[_0x370d('0x7')](),controller[_0x370d('0xf')]);router[_0x370d('0x10')](_0x370d('0x9'),auth['isAuthenticated'](),controller[_0x370d('0x11')]);router[_0x370d('0x12')](_0x370d('0x9'),auth[_0x370d('0x7')](),controller[_0x370d('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js index 683b0dd..294ae8e 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 _0x5d58=['TEXT','STRING'];(function(_0x27b95b,_0x53d9fc){var _0x42ab40=function(_0x39ef96){while(--_0x39ef96){_0x27b95b['push'](_0x27b95b['shift']());}};_0x42ab40(++_0x53d9fc);}(_0x5d58,0x187));var _0x85d5=function(_0x356762,_0x576159){_0x356762=_0x356762-0x0;var _0x239e07=_0x5d58[_0x356762];return _0x239e07;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize['STRING']},'table':{'type':Sequelize[_0x85d5('0x0')]},'conditions':{'type':Sequelize[_0x85d5('0x1')]},'joins':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0xf2ca=['STRING','TEXT','sequelize','exports'];(function(_0x5be795,_0x1cb1b8){var _0x4e8a3b=function(_0x5584ef){while(--_0x5584ef){_0x5be795['push'](_0x5be795['shift']());}};_0x4e8a3b(++_0x1cb1b8);}(_0xf2ca,0x16a));var _0xaf2c=function(_0x52a6e3,_0x4a73b4){_0x52a6e3=_0x52a6e3-0x0;var _0x8910d0=_0xf2ca[_0x52a6e3];return _0x8910d0;};'use strict';var Sequelize=require(_0xaf2c('0x0'));module[_0xaf2c('0x1')]={'name':{'type':Sequelize[_0xaf2c('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0xaf2c('0x2')]},'table':{'type':Sequelize[_0xaf2c('0x2')]},'conditions':{'type':Sequelize[_0xaf2c('0x3')]},'joins':{'type':Sequelize[_0xaf2c('0x3')]}}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js index 0742bd2..88e87d1 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 _0x5fc3=['QueryTypes','right_join','HOUR(%s)','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','dbH','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','get','DefaultReports','destroy','error','stack','name','index','map','AnalyticDefaultReport','rawAttributes','fieldName','type','key','keys','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','params','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','join','left_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','rules','operator','group','field','condition','value','Sequelize','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','table','MetricId','metric','function','replace','groupBy','orderBy','order','DESC','alias','joins','parse','parentKey','foreignTable','foreignKey','format','%s.%s\x20=\x20%s.%s','conditions','clone','debug','Limited\x20Query:','sequelize','toString','SELECT','GROUP_CONCAT(%s)','SEC_TO_TIME(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','IS\x20EMPTY','getFields','ValidationErrorItem','fullPath','%s-%s.%s','generate','output','csv','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','child_process','fork','../../components/export/','../../files/reports','countTable','COUNT(*)'];(function(_0x21f458,_0x283032){var _0x1f6c3b=function(_0x1d6412){while(--_0x1d6412){_0x21f458['push'](_0x21f458['shift']());}};_0x1f6c3b(++_0x283032);}(_0x5fc3,0xa8));var _0x35fc=function(_0x4b784d,_0x5efb2f){_0x4b784d=_0x4b784d-0x0;var _0x2cdeaf=_0x5fc3[_0x4b784d];return _0x2cdeaf;};'use strict';var emlformat=require(_0x35fc('0x0'));var rimraf=require(_0x35fc('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x35fc('0x2'));var rp=require(_0x35fc('0x3'));var moment=require(_0x35fc('0x4'));var BPromise=require(_0x35fc('0x5'));var Mustache=require(_0x35fc('0x6'));var util=require('util');var path=require(_0x35fc('0x7'));var sox=require(_0x35fc('0x8'));var csv=require(_0x35fc('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x35fc('0xa'));var squel=require('squel');var crypto=require(_0x35fc('0xb'));var jsforce=require(_0x35fc('0xc'));var deskjs=require(_0x35fc('0xd'));var toCsv=require(_0x35fc('0x9'));var querystring=require(_0x35fc('0xe'));var Papa=require(_0x35fc('0xf'));var Redis=require(_0x35fc('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x35fc('0x11'));var as=require(_0x35fc('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x35fc('0x13'))(_0x35fc('0x14'));var utils=require('../../config/utils');var config=require(_0x35fc('0x15'));var licenseUtil=require(_0x35fc('0x16'));var db=require('../../mysqldb')['db'];var dbH=require('../../mysqldb')[_0x35fc('0x17')];function respondWithStatusCode(_0x5d462a,_0x397738){_0x397738=_0x397738||0xcc;return function(_0x22055e){if(_0x22055e){return _0x5d462a[_0x35fc('0x18')](_0x397738);}return _0x5d462a[_0x35fc('0x19')](_0x397738)[_0x35fc('0x1a')]();};}function respondWithResult(_0x5cfe94,_0x59507a){_0x59507a=_0x59507a||0xc8;return function(_0x5eac0f){if(_0x5eac0f){return _0x5cfe94['status'](_0x59507a)[_0x35fc('0x1b')](_0x5eac0f);}};}function respondWithFilteredResult(_0x229d56,_0x53b898){return function(_0x154958){if(_0x154958){var _0x227a49=typeof _0x53b898[_0x35fc('0x1c')]==='undefined'&&typeof _0x53b898[_0x35fc('0x1d')]===_0x35fc('0x1e');var _0x553677=_0x154958[_0x35fc('0x1f')];var _0x363e47=_0x227a49?0x0:_0x53b898[_0x35fc('0x1c')];var _0x5f56c6=_0x227a49?_0x154958[_0x35fc('0x1f')]:_0x53b898[_0x35fc('0x1c')]+_0x53b898[_0x35fc('0x1d')];var _0x488234;if(_0x5f56c6>=_0x553677){_0x5f56c6=_0x553677;_0x488234=0xc8;}else{_0x488234=0xce;}_0x229d56[_0x35fc('0x19')](_0x488234);return _0x229d56[_0x35fc('0x20')](_0x35fc('0x21'),_0x363e47+'-'+_0x5f56c6+'/'+_0x553677)[_0x35fc('0x1b')](_0x154958);}return null;};}function patchUpdates(_0x20ffde){return function(_0x21f1a9){try{jsonpatch[_0x35fc('0x22')](_0x21f1a9,_0x20ffde,!![]);}catch(_0x3b05b0){return BPromise[_0x35fc('0x23')](_0x3b05b0);}return _0x21f1a9[_0x35fc('0x24')]();};}function saveUpdates(_0x5bd2b8,_0x323aee){return function(_0xd5399f){if(_0xd5399f){return _0xd5399f[_0x35fc('0x25')](_0x5bd2b8)[_0x35fc('0x26')](function(_0x3b4743){return _0x3b4743;});}return null;};}function removeEntity(_0x55e9e7,_0x33f5e8){return function(_0x4c587a){if(_0x4c587a){return _0x4c587a['destroy']()[_0x35fc('0x26')](function(){var _0x5a93df=_0x4c587a[_0x35fc('0x27')]({'plain':!![]});var _0x51cfec=_0x35fc('0x28');return db['UserProfileResource'][_0x35fc('0x29')]({'where':{'type':_0x51cfec,'resourceId':_0x5a93df['id']}})[_0x35fc('0x26')](function(){return _0x4c587a;});})['then'](function(){_0x55e9e7['status'](0xcc)[_0x35fc('0x1a')]();});}};}function handleEntityNotFound(_0x58edb6,_0x274208){return function(_0x1a5d92){if(!_0x1a5d92){_0x58edb6['sendStatus'](0x194);}return _0x1a5d92;};}function handleError(_0x26b7cb,_0x645eac){_0x645eac=_0x645eac||0x1f4;return function(_0x383837){logger[_0x35fc('0x2a')](_0x383837[_0x35fc('0x2b')]);if(_0x383837[_0x35fc('0x2c')]){delete _0x383837[_0x35fc('0x2c')];}_0x26b7cb[_0x35fc('0x19')](_0x645eac)['send'](_0x383837);};}exports[_0x35fc('0x2d')]=function(_0x220931,_0x22af18){var _0x52acc5={},_0xe79f52={},_0x16f067={'count':0x0,'rows':[]};var _0x3822a8=_[_0x35fc('0x2e')](db[_0x35fc('0x2f')][_0x35fc('0x30')],function(_0x222ddb){return{'name':_0x222ddb[_0x35fc('0x31')],'type':_0x222ddb[_0x35fc('0x32')][_0x35fc('0x33')]};});_0xe79f52['model']=_['map'](_0x3822a8,_0x35fc('0x2c'));_0xe79f52['query']=_[_0x35fc('0x34')](_0x220931[_0x35fc('0x35')]);_0xe79f52[_0x35fc('0x36')]=_[_0x35fc('0x37')](_0xe79f52[_0x35fc('0x38')],_0xe79f52[_0x35fc('0x35')]);_0x52acc5['attributes']=_[_0x35fc('0x37')](_0xe79f52[_0x35fc('0x38')],qs[_0x35fc('0x39')](_0x220931[_0x35fc('0x35')][_0x35fc('0x39')]));_0x52acc5[_0x35fc('0x3a')]=_0x52acc5['attributes'][_0x35fc('0x3b')]?_0x52acc5[_0x35fc('0x3a')]:_0xe79f52[_0x35fc('0x38')];if(!_0x220931['query'][_0x35fc('0x3c')]('nolimit')){_0x52acc5[_0x35fc('0x1d')]=qs[_0x35fc('0x1d')](_0x220931[_0x35fc('0x35')][_0x35fc('0x1d')]);_0x52acc5['offset']=qs['offset'](_0x220931['query'][_0x35fc('0x1c')]);}_0x52acc5['order']=qs[_0x35fc('0x3d')](_0x220931['query'][_0x35fc('0x3d')]);_0x52acc5[_0x35fc('0x3e')]=qs[_0x35fc('0x36')](_[_0x35fc('0x3f')](_0x220931[_0x35fc('0x35')],_0xe79f52[_0x35fc('0x36')]),_0x3822a8);if(_0x220931[_0x35fc('0x35')]['filter']){_0x52acc5[_0x35fc('0x3e')]=_[_0x35fc('0x40')](_0x52acc5['where'],{'$or':_[_0x35fc('0x2e')](_0x3822a8,function(_0x1ccc41){if(_0x1ccc41[_0x35fc('0x32')]!==_0x35fc('0x41')){var _0x813866={};_0x813866[_0x1ccc41[_0x35fc('0x2c')]]={'$like':'%'+_0x220931['query'][_0x35fc('0x42')]+'%'};return _0x813866;}})});}_0x52acc5=_[_0x35fc('0x40')]({},_0x52acc5,_0x220931[_0x35fc('0x43')]);var _0x52543b={'where':_0x52acc5[_0x35fc('0x3e')]};return db[_0x35fc('0x2f')]['count'](_0x52543b)[_0x35fc('0x26')](function(_0x280af1){_0x16f067[_0x35fc('0x1f')]=_0x280af1;if(_0x220931[_0x35fc('0x35')][_0x35fc('0x44')]){_0x52acc5[_0x35fc('0x45')]=[{'all':!![]}];}return db[_0x35fc('0x2f')][_0x35fc('0x46')](_0x52acc5);})['then'](function(_0x596e83){_0x16f067[_0x35fc('0x47')]=_0x596e83;return _0x16f067;})[_0x35fc('0x26')](respondWithFilteredResult(_0x22af18,_0x52acc5))['catch'](handleError(_0x22af18,null));};exports['show']=function(_0x4ff202,_0x79677d){var _0x10f98b={'raw':!![],'where':{'id':_0x4ff202[_0x35fc('0x48')]['id']}},_0x4e56ed={};_0x4e56ed[_0x35fc('0x38')]=_[_0x35fc('0x34')](db[_0x35fc('0x2f')]['rawAttributes']);_0x4e56ed['query']=_['keys'](_0x4ff202['query']);_0x4e56ed['filters']=_[_0x35fc('0x37')](_0x4e56ed[_0x35fc('0x38')],_0x4e56ed['query']);_0x10f98b[_0x35fc('0x3a')]=_['intersection'](_0x4e56ed[_0x35fc('0x38')],qs[_0x35fc('0x39')](_0x4ff202[_0x35fc('0x35')][_0x35fc('0x39')]));_0x10f98b[_0x35fc('0x3a')]=_0x10f98b['attributes'][_0x35fc('0x3b')]?_0x10f98b[_0x35fc('0x3a')]:_0x4e56ed['model'];if(_0x4ff202[_0x35fc('0x35')][_0x35fc('0x44')]){_0x10f98b[_0x35fc('0x45')]=[{'all':!![]}];}_0x10f98b=_[_0x35fc('0x40')]({},_0x10f98b,_0x4ff202['options']);return db[_0x35fc('0x2f')]['find'](_0x10f98b)['then'](handleEntityNotFound(_0x79677d,null))[_0x35fc('0x26')](respondWithResult(_0x79677d,null))[_0x35fc('0x49')](handleError(_0x79677d,null));};exports[_0x35fc('0x4a')]=function(_0xca8aef,_0xf2ca20){return db[_0x35fc('0x2f')][_0x35fc('0x4a')](_0xca8aef[_0x35fc('0x4b')],{})['then'](function(_0x3e2961){var _0x91d7c0=_0xca8aef[_0x35fc('0x4c')][_0x35fc('0x27')]({'plain':!![]});if(!_0x91d7c0)throw new Error(_0x35fc('0x4d'));if(_0x91d7c0[_0x35fc('0x4e')]===_0x35fc('0x4c')){var _0x347a4a=_0x3e2961[_0x35fc('0x27')]({'plain':!![]});var _0xe6eb6a=_0x35fc('0x4f');return db[_0x35fc('0x50')][_0x35fc('0x51')]({'where':{'name':_0xe6eb6a,'userProfileId':_0x91d7c0[_0x35fc('0x52')]},'raw':!![]})['then'](function(_0x553ed6){if(_0x553ed6&&_0x553ed6[_0x35fc('0x53')]===0x0){return db[_0x35fc('0x54')][_0x35fc('0x4a')]({'name':_0x347a4a[_0x35fc('0x2c')],'resourceId':_0x347a4a['id'],'type':_0x35fc('0x28'),'sectionId':_0x553ed6['id']},{})[_0x35fc('0x26')](function(){return _0x3e2961;});}else{return _0x3e2961;}})['catch'](function(_0x4f024c){logger[_0x35fc('0x2a')](_0x35fc('0x55'),_0x4f024c);throw _0x4f024c;});}return _0x3e2961;})[_0x35fc('0x26')](respondWithResult(_0xf2ca20,0xc9))[_0x35fc('0x49')](handleError(_0xf2ca20,null));};exports['update']=function(_0x467980,_0x13281f){if(_0x467980['body']['id']){delete _0x467980[_0x35fc('0x4b')]['id'];}return db[_0x35fc('0x2f')]['find']({'where':{'id':_0x467980[_0x35fc('0x48')]['id']}})[_0x35fc('0x26')](handleEntityNotFound(_0x13281f,null))[_0x35fc('0x26')](saveUpdates(_0x467980[_0x35fc('0x4b')],null))['then'](respondWithResult(_0x13281f,null))['catch'](handleError(_0x13281f,null));};exports['destroy']=function(_0x240338,_0x2ea8d6){return db['AnalyticDefaultReport'][_0x35fc('0x51')]({'where':{'id':_0x240338[_0x35fc('0x48')]['id']}})[_0x35fc('0x26')](handleEntityNotFound(_0x2ea8d6,null))[_0x35fc('0x26')](removeEntity(_0x2ea8d6,null))[_0x35fc('0x49')](handleError(_0x2ea8d6,null));};exports['preview']=function(_0x2d9d45,_0x757aa6){var _0x39d470=0xa;var _0x509e77=[_0x35fc('0x56'),_0x35fc('0x57'),'right_join',_0x35fc('0x58')];var _0x164c7b={'SUM':_0x35fc('0x59'),'COUNT':_0x35fc('0x5a'),'COUNT DISTINCT':_0x35fc('0x5b'),'MAX':_0x35fc('0x5c'),'MIN':_0x35fc('0x5d'),'AVG':_0x35fc('0x5e'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x35fc('0x5f'),'GROUP_CONCAT DESC':_0x35fc('0x60')};var _0x303927={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x35fc('0x61'),'HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x23b54f=function(_0xb1c68a){return!_[_0x35fc('0x62')]([_0x35fc('0x63'),_0x35fc('0x64'),'IS\x20EMPTY','IS\x20NOT\x20EMPTY'],_0xb1c68a);};var _0x5353ea=function(_0x4faef4){if(!_0x4faef4||!_0x4faef4['rules'][_0x35fc('0x3b')]){return'';}for(var _0x44250b='(',_0xd470e8=0x0;_0xd470e8<_0x4faef4[_0x35fc('0x65')]['length'];_0xd470e8+=0x1){_0xd470e8>0x0&&(_0x44250b+='\x20'+_0x4faef4[_0x35fc('0x66')]+'\x20');_0x44250b+=_0x4faef4[_0x35fc('0x65')][_0xd470e8][_0x35fc('0x67')]?_0x5353ea(_0x4faef4[_0x35fc('0x65')][_0xd470e8][_0x35fc('0x67')]):_0x4faef4[_0x35fc('0x65')][_0xd470e8][_0x35fc('0x68')]+'\x20'+_0x4faef4[_0x35fc('0x65')][_0xd470e8][_0x35fc('0x69')]+(_0x23b54f(_0x4faef4['rules'][_0xd470e8][_0x35fc('0x69')])?'\x20'+_0x4faef4['rules'][_0xd470e8][_0x35fc('0x6a')]:'');}return _0x44250b+')';};var _0x9029e3={'where':{'id':_0x2d9d45['params']['id']}},_0x2ac8e1,_0x2bc76c,_0x4bdde7,_0x465c14,_0x4af592;_0x9029e3=_['merge']({},_0x9029e3,_0x2d9d45[_0x35fc('0x43')]);return db['AnalyticDefaultReport'][_0x35fc('0x51')](_0x9029e3)['then'](function(_0x11717){if(_0x11717){_0x2ac8e1=_0x11717;return _0x11717['getFields']();}return null;})[_0x35fc('0x26')](function(_0x455b84){if(_0x455b84){if(!_0x455b84[_0x35fc('0x3b')]){throw new db[(_0x35fc('0x6b'))]['ValidationErrorItem'](_0x35fc('0x6c'),0x193);}_0x2bc76c=_0x455b84;return db[_0x35fc('0x6d')][_0x35fc('0x46')]({'raw':!![]});}return null;})['then'](function(_0x3aa7fa){if(_0x3aa7fa){_0x4bdde7=_[_0x35fc('0x6e')](_0x3aa7fa,'id');var _0x37764b;var _0x3c1b56=squel[_0x35fc('0x6f')]();_0x3c1b56[_0x35fc('0x70')](_0x2ac8e1[_0x35fc('0x71')]);for(var _0x4464d5=0x0;_0x4464d5<_0x2bc76c['length'];_0x4464d5+=0x1){_0x37764b=_0x2bc76c[_0x4464d5][_0x35fc('0x72')]?_0x4bdde7[_0x2bc76c[_0x4464d5][_0x35fc('0x72')]][_0x35fc('0x73')]:_0x2bc76c[_0x4464d5]['field'];_0x37764b=_0x2bc76c[_0x4464d5][_0x35fc('0x74')]?_[_0x35fc('0x75')](_0x164c7b[_0x2bc76c[_0x4464d5]['function']],'%s',_0x37764b):_0x37764b;_0x37764b=_0x2bc76c[_0x4464d5]['format']?_[_0x35fc('0x75')](_0x303927[_0x2bc76c[_0x4464d5]['format']],'%s',_0x37764b):_0x37764b;if(_0x2bc76c[_0x4464d5][_0x35fc('0x76')]){_0x3c1b56[_0x35fc('0x67')](_0x37764b);}_0x2bc76c[_0x4464d5][_0x35fc('0x77')]&&_0x3c1b56[_0x35fc('0x78')](_0x37764b,_0x2bc76c[_0x4464d5][_0x35fc('0x77')]===_0x35fc('0x79')?![]:!![]);_0x3c1b56[_0x35fc('0x68')](_0x37764b,_0x2bc76c[_0x4464d5][_0x35fc('0x7a')]||_0x37764b);}if(_0x2ac8e1[_0x35fc('0x7b')]){_0x2ac8e1[_0x35fc('0x7b')]=JSON[_0x35fc('0x7c')](_0x2ac8e1[_0x35fc('0x7b')]);for(var _0x29f2b9=0x0;_0x29f2b9<_0x2ac8e1[_0x35fc('0x7b')][_0x35fc('0x3b')];_0x29f2b9+=0x1){if(_0x2ac8e1[_0x35fc('0x7b')][_0x29f2b9][_0x35fc('0x32')]&&_[_0x35fc('0x62')](_0x509e77,_0x2ac8e1[_0x35fc('0x7b')][_0x29f2b9][_0x35fc('0x32')])&&_0x2ac8e1['joins'][_0x29f2b9][_0x35fc('0x7d')]&&_0x2ac8e1['joins'][_0x29f2b9][_0x35fc('0x7e')]&&_0x2ac8e1[_0x35fc('0x7b')][_0x29f2b9][_0x35fc('0x7f')]){_0x3c1b56[_0x2ac8e1[_0x35fc('0x7b')][_0x29f2b9][_0x35fc('0x32')]](_0x2ac8e1[_0x35fc('0x7b')][_0x29f2b9][_0x35fc('0x7e')],null,util[_0x35fc('0x80')](_0x35fc('0x81'),_0x2ac8e1[_0x35fc('0x71')],_0x2ac8e1[_0x35fc('0x7b')][_0x29f2b9]['parentKey'],_0x2ac8e1[_0x35fc('0x7b')][_0x29f2b9][_0x35fc('0x7e')],_0x2ac8e1[_0x35fc('0x7b')][_0x29f2b9][_0x35fc('0x7f')]));}}}if(_0x2ac8e1[_0x35fc('0x82')]){_0x2ac8e1[_0x35fc('0x82')]=JSON['parse'](_0x2ac8e1[_0x35fc('0x82')]);_0x3c1b56[_0x35fc('0x3e')](_0x5353ea(_0x2ac8e1[_0x35fc('0x82')][_0x35fc('0x67')]));}_0x4af592=_0x3c1b56[_0x35fc('0x83')]();_0x3c1b56[_0x35fc('0x1d')](_0x39d470);_0x3c1b56[_0x35fc('0x1c')](0x0);logger[_0x35fc('0x84')](_0x35fc('0x85'),_0x3c1b56['toString']());return dbH[_0x35fc('0x86')]['query'](_0x3c1b56[_0x35fc('0x87')](),{'type':dbH[_0x35fc('0x86')]['QueryTypes'][_0x35fc('0x88')]});}})[_0x35fc('0x26')](respondWithResult(_0x757aa6,null))[_0x35fc('0x49')](handleError(_0x757aa6,null));};function runReport(_0x4274d6,_0x4026cc,_0x1a765f){var _0x42f87e=_0x4026cc[_0x35fc('0x2c')];var _0x25ee61=0xa;var _0x5806bf=['join','left_join','right_join',_0x35fc('0x58')];var _0x23cf84={'SUM':_0x35fc('0x59'),'COUNT':_0x35fc('0x5a'),'COUNT DISTINCT':_0x35fc('0x5b'),'MAX':'MAX(%s)','MIN':_0x35fc('0x5d'),'AVG':_0x35fc('0x5e'),'GROUP_CONCAT':_0x35fc('0x89'),'GROUP_CONCAT ASC':_0x35fc('0x5f'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x15e936={'SEC_TO_TIME':_0x35fc('0x8a'),'DATE':_0x35fc('0x61'),'HOUR':'HOUR(%s)','ROUND':_0x35fc('0x8b'),'UNIX_TIMESTAMP':_0x35fc('0x8c')};var _0x319033=function(_0x9fe765){return!_[_0x35fc('0x62')]([_0x35fc('0x63'),_0x35fc('0x64'),_0x35fc('0x8d'),'IS\x20NOT\x20EMPTY'],_0x9fe765);};var _0x2faff7=function(_0xa2c5f8){if(!_0xa2c5f8||!_0xa2c5f8[_0x35fc('0x65')][_0x35fc('0x3b')]){return'';}for(var _0x221c5b='(',_0x1fcd36=0x0;_0x1fcd36<_0xa2c5f8['rules'][_0x35fc('0x3b')];_0x1fcd36+=0x1){_0x1fcd36>0x0&&(_0x221c5b+='\x20'+_0xa2c5f8['operator']+'\x20');_0x221c5b+=_0xa2c5f8['rules'][_0x1fcd36][_0x35fc('0x67')]?_0x2faff7(_0xa2c5f8['rules'][_0x1fcd36][_0x35fc('0x67')]):_0xa2c5f8[_0x35fc('0x65')][_0x1fcd36][_0x35fc('0x68')]+'\x20'+_0xa2c5f8['rules'][_0x1fcd36][_0x35fc('0x69')]+(_0x319033(_0xa2c5f8[_0x35fc('0x65')][_0x1fcd36][_0x35fc('0x69')])?'\x20'+_0xa2c5f8[_0x35fc('0x65')][_0x1fcd36][_0x35fc('0x6a')]:'');}return _0x221c5b+')';};var _0x5abdf9={'where':{'id':_0x4274d6['id']}},_0x5512f6,_0x487cb5,_0x23b261,_0x4c742c,_0x2fae26;_0x5abdf9=_[_0x35fc('0x40')]({},_0x5abdf9,_0x1a765f);return db[_0x35fc('0x2f')][_0x35fc('0x51')](_0x5abdf9)['then'](function(_0x28e80d){if(_0x28e80d){_0x5512f6=_0x28e80d;return _0x28e80d[_0x35fc('0x8e')]();}return null;})[_0x35fc('0x26')](function(_0x47c507){if(_0x47c507){if(!_0x47c507[_0x35fc('0x3b')]){throw new db[(_0x35fc('0x6b'))][(_0x35fc('0x8f'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x487cb5=_0x47c507;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})[_0x35fc('0x26')](function(_0x2edb1b){if(_0x2edb1b){_0x23b261=_[_0x35fc('0x6e')](_0x2edb1b,'id');var _0x3858a9;var _0x4859be=squel[_0x35fc('0x6f')]();_0x4859be[_0x35fc('0x70')](_0x5512f6['table']);for(var _0x5849a0=0x0;_0x5849a0<_0x487cb5[_0x35fc('0x3b')];_0x5849a0+=0x1){_0x3858a9=_0x487cb5[_0x5849a0][_0x35fc('0x72')]?_0x23b261[_0x487cb5[_0x5849a0][_0x35fc('0x72')]]['metric']:_0x487cb5[_0x5849a0]['field'];_0x3858a9=_0x487cb5[_0x5849a0][_0x35fc('0x74')]?_[_0x35fc('0x75')](_0x23cf84[_0x487cb5[_0x5849a0]['function']],'%s',_0x3858a9):_0x3858a9;_0x3858a9=_0x487cb5[_0x5849a0][_0x35fc('0x80')]?_[_0x35fc('0x75')](_0x15e936[_0x487cb5[_0x5849a0][_0x35fc('0x80')]],'%s',_0x3858a9):_0x3858a9;if(_0x487cb5[_0x5849a0]['groupBy']){_0x4859be[_0x35fc('0x67')](_0x3858a9);}_0x487cb5[_0x5849a0][_0x35fc('0x77')]&&_0x4859be[_0x35fc('0x78')](_0x3858a9,_0x487cb5[_0x5849a0][_0x35fc('0x77')]==='DESC'?![]:!![]);_0x4859be[_0x35fc('0x68')](_0x3858a9,_0x487cb5[_0x5849a0][_0x35fc('0x7a')]||_0x3858a9);}if(_0x5512f6[_0x35fc('0x7b')]){_0x5512f6['joins']=JSON[_0x35fc('0x7c')](_0x5512f6[_0x35fc('0x7b')]);for(var _0x425f72=0x0;_0x425f72<_0x5512f6['joins'][_0x35fc('0x3b')];_0x425f72+=0x1){if(_0x5512f6[_0x35fc('0x7b')][_0x425f72]['type']&&_[_0x35fc('0x62')](_0x5806bf,_0x5512f6[_0x35fc('0x7b')][_0x425f72][_0x35fc('0x32')])&&_0x5512f6[_0x35fc('0x7b')][_0x425f72][_0x35fc('0x7d')]&&_0x5512f6[_0x35fc('0x7b')][_0x425f72][_0x35fc('0x7e')]&&_0x5512f6[_0x35fc('0x7b')][_0x425f72][_0x35fc('0x7f')]){_0x4859be[_0x5512f6['joins'][_0x425f72][_0x35fc('0x32')]](_0x5512f6[_0x35fc('0x7b')][_0x425f72][_0x35fc('0x7e')],null,util[_0x35fc('0x80')]('%s.%s\x20=\x20%s.%s',_0x5512f6[_0x35fc('0x71')],_0x5512f6[_0x35fc('0x7b')][_0x425f72][_0x35fc('0x7d')],_0x5512f6[_0x35fc('0x7b')][_0x425f72][_0x35fc('0x7e')],_0x5512f6[_0x35fc('0x7b')][_0x425f72][_0x35fc('0x7f')]));}}}if(_0x5512f6[_0x35fc('0x82')]){_0x5512f6['conditions']=JSON['parse'](_0x5512f6[_0x35fc('0x82')]);_0x4859be[_0x35fc('0x3e')](_0x2faff7(_0x5512f6[_0x35fc('0x82')]['group']));}_0x2fae26=_0x4859be[_0x35fc('0x83')]();_0x4859be[_0x35fc('0x1d')](_0x25ee61);_0x4859be[_0x35fc('0x1c')](0x0);return;}})[_0x35fc('0x26')](function(){if(_0x4026cc['output']==='web'){return null;}var _0x379650=_['merge'](_0x4026cc,{'name':_0x4026cc[_0x35fc('0x90')]||_0x4026cc[_0x35fc('0x2c')]||_0x5512f6['name'],'basename':_0x42f87e,'savename':util['format'](_0x35fc('0x91'),_0x4026cc[_0x35fc('0x2c')]||_0x5512f6[_0x35fc('0x2c')],require('randomstring')[_0x35fc('0x92')](0x4),_0x4026cc[_0x35fc('0x93')]||_0x35fc('0x94')),'reportId':_0x5512f6['id'],'reportType':'default'});return db[_0x35fc('0x95')][_0x35fc('0x4a')](_0x379650,{'raw':!![]});})[_0x35fc('0x26')](function(_0x328e90){if(_0x5512f6['table']===_0x35fc('0x96')){_0x2fae26[_0x35fc('0x3e')](_0x5512f6[_0x35fc('0x71')]+_0x35fc('0x97'),_0x4026cc[_0x35fc('0x98')],_0x4026cc[_0x35fc('0x99')]);}else{_0x2fae26['where'](_0x5512f6[_0x35fc('0x71')]+_0x35fc('0x9a'),_0x4026cc['startDate'],_0x4026cc[_0x35fc('0x99')]);}if(_0x328e90){logger[_0x35fc('0x9b')]('Run\x20Query:',_0x2fae26[_0x35fc('0x87')]());require(_0x35fc('0x9c'))[_0x35fc('0x9d')](path[_0x35fc('0x56')](__dirname,_0x35fc('0x9e'),_0x328e90['output']),[_0x328e90['id'],_0x2fae26[_0x35fc('0x87')](),path[_0x35fc('0x56')](__dirname,_0x35fc('0x9f'),_0x328e90['savename']),_0x42f87e]);return _0x328e90;}else{var _0x1224cd=squel['select']();_0x1224cd['from']('('+_0x2fae26[_0x35fc('0x87')]()+')',_0x35fc('0xa0'));_0x1224cd[_0x35fc('0x68')](_0x35fc('0xa1'),_0x35fc('0x1f'));_0x2fae26['limit'](_0x4026cc[_0x35fc('0x1d')]||_0x25ee61);_0x2fae26[_0x35fc('0x1c')](_0x4026cc[_0x35fc('0x1c')]||0x0);return dbH['sequelize'][_0x35fc('0x35')](_0x1224cd[_0x35fc('0x87')](),{'type':dbH[_0x35fc('0x86')][_0x35fc('0xa2')][_0x35fc('0x88')]})['then'](function(_0x1a2d73){if(!_0x1a2d73[_0x35fc('0x3b')]){_0x4c742c=0x0;}else{_0x4c742c=_0x1a2d73[0x0]['count']||0x0;}return dbH['sequelize'][_0x35fc('0x35')](_0x2fae26[_0x35fc('0x87')](),{'type':dbH[_0x35fc('0x86')][_0x35fc('0xa2')][_0x35fc('0x88')]});})[_0x35fc('0x26')](function(_0x8c80ca){return{'rows':_0x8c80ca||[],'count':_0x4c742c};});}});}exports['run']=function(_0x5dc286,_0x146ce1){return runReport(_0x5dc286[_0x35fc('0x48')],_0x5dc286[_0x35fc('0x35')],_0x5dc286[_0x35fc('0x43')])[_0x35fc('0x26')](respondWithResult(_0x146ce1,null))['catch'](handleError(_0x146ce1,null));};exports['runReport']=runReport;exports[_0x35fc('0x35')]=function(_0x2451f2,_0x3fff79){var _0x1c6ce9=0xa;var _0x4b2079=['join',_0x35fc('0x57'),_0x35fc('0xa3'),_0x35fc('0x58')];var _0xd46d64={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':_0x35fc('0x5b'),'MAX':_0x35fc('0x5c'),'MIN':'MIN(%s)','AVG':_0x35fc('0x5e'),'GROUP_CONCAT':_0x35fc('0x89'),'GROUP_CONCAT ASC':_0x35fc('0x5f'),'GROUP_CONCAT DESC':_0x35fc('0x60')};var _0x274337={'SEC_TO_TIME':_0x35fc('0x8a'),'DATE':_0x35fc('0x61'),'HOUR':_0x35fc('0xa4'),'ROUND':_0x35fc('0x8b'),'UNIX_TIMESTAMP':_0x35fc('0x8c')};var _0x19ae76=function(_0x366a3b){return!_[_0x35fc('0x62')]([_0x35fc('0x63'),_0x35fc('0x64'),_0x35fc('0x8d'),'IS\x20NOT\x20EMPTY'],_0x366a3b);};var _0x345026=function(_0x553f7d){if(!_0x553f7d||!_0x553f7d[_0x35fc('0x65')]['length']){return'';}for(var _0x5aa072='(',_0x3c96ef=0x0;_0x3c96ef<_0x553f7d[_0x35fc('0x65')][_0x35fc('0x3b')];_0x3c96ef+=0x1){_0x3c96ef>0x0&&(_0x5aa072+='\x20'+_0x553f7d['operator']+'\x20');_0x5aa072+=_0x553f7d[_0x35fc('0x65')][_0x3c96ef][_0x35fc('0x67')]?_0x345026(_0x553f7d[_0x35fc('0x65')][_0x3c96ef][_0x35fc('0x67')]):_0x553f7d[_0x35fc('0x65')][_0x3c96ef][_0x35fc('0x68')]+'\x20'+_0x553f7d['rules'][_0x3c96ef]['condition']+(_0x19ae76(_0x553f7d[_0x35fc('0x65')][_0x3c96ef]['condition'])?'\x20'+_0x553f7d['rules'][_0x3c96ef][_0x35fc('0x6a')]:'');}return _0x5aa072+')';};var _0x48b826={'where':{'id':_0x2451f2[_0x35fc('0x48')]['id']}},_0x556f9a,_0x5ae83f,_0x450769,_0x5d461c,_0x355154;_0x48b826=_[_0x35fc('0x40')]({},_0x48b826,_0x2451f2[_0x35fc('0x43')]);return db[_0x35fc('0x2f')][_0x35fc('0x51')](_0x48b826)['then'](function(_0x522ff2){if(_0x522ff2){_0x556f9a=_0x522ff2;return _0x522ff2[_0x35fc('0x8e')]();}return null;})['then'](function(_0x233c94){if(_0x233c94){if(!_0x233c94[_0x35fc('0x3b')]){throw new db['Sequelize']['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x5ae83f=_0x233c94;return db[_0x35fc('0x6d')][_0x35fc('0x46')]({'raw':!![]});}return null;})[_0x35fc('0x26')](function(_0x135e18){if(_0x135e18){_0x450769=_[_0x35fc('0x6e')](_0x135e18,'id');var _0x28525f;var _0x9116b1=squel[_0x35fc('0x6f')]();_0x9116b1['from'](_0x556f9a['table']);for(var _0x5cefdb=0x0;_0x5cefdb<_0x5ae83f['length'];_0x5cefdb+=0x1){_0x28525f=_0x5ae83f[_0x5cefdb][_0x35fc('0x72')]?_0x450769[_0x5ae83f[_0x5cefdb]['MetricId']][_0x35fc('0x73')]:_0x5ae83f[_0x5cefdb]['field'];_0x28525f=_0x5ae83f[_0x5cefdb][_0x35fc('0x74')]?_[_0x35fc('0x75')](_0xd46d64[_0x5ae83f[_0x5cefdb]['function']],'%s',_0x28525f):_0x28525f;_0x28525f=_0x5ae83f[_0x5cefdb]['format']?_[_0x35fc('0x75')](_0x274337[_0x5ae83f[_0x5cefdb][_0x35fc('0x80')]],'%s',_0x28525f):_0x28525f;if(_0x5ae83f[_0x5cefdb][_0x35fc('0x76')]){_0x9116b1[_0x35fc('0x67')](_0x28525f);}_0x5ae83f[_0x5cefdb][_0x35fc('0x77')]&&_0x9116b1['order'](_0x28525f,_0x5ae83f[_0x5cefdb]['orderBy']===_0x35fc('0x79')?![]:!![]);_0x9116b1['field'](_0x28525f,_0x5ae83f[_0x5cefdb][_0x35fc('0x7a')]||_0x28525f);}if(_0x556f9a['joins']){_0x556f9a[_0x35fc('0x7b')]=JSON[_0x35fc('0x7c')](_0x556f9a[_0x35fc('0x7b')]);for(var _0x10e30e=0x0;_0x10e30e<_0x556f9a['joins'][_0x35fc('0x3b')];_0x10e30e+=0x1){if(_0x556f9a['joins'][_0x10e30e][_0x35fc('0x32')]&&_['includes'](_0x4b2079,_0x556f9a['joins'][_0x10e30e][_0x35fc('0x32')])&&_0x556f9a['joins'][_0x10e30e][_0x35fc('0x7d')]&&_0x556f9a[_0x35fc('0x7b')][_0x10e30e][_0x35fc('0x7e')]&&_0x556f9a[_0x35fc('0x7b')][_0x10e30e][_0x35fc('0x7f')]){_0x9116b1[_0x556f9a[_0x35fc('0x7b')][_0x10e30e][_0x35fc('0x32')]](_0x556f9a[_0x35fc('0x7b')][_0x10e30e][_0x35fc('0x7e')],null,util['format'](_0x35fc('0x81'),_0x556f9a[_0x35fc('0x71')],_0x556f9a[_0x35fc('0x7b')][_0x10e30e][_0x35fc('0x7d')],_0x556f9a[_0x35fc('0x7b')][_0x10e30e][_0x35fc('0x7e')],_0x556f9a[_0x35fc('0x7b')][_0x10e30e][_0x35fc('0x7f')]));}}}if(_0x556f9a['conditions']){_0x556f9a['conditions']=JSON['parse'](_0x556f9a['conditions']);_0x9116b1['where'](_0x345026(_0x556f9a[_0x35fc('0x82')][_0x35fc('0x67')]));}_0x355154=_0x9116b1[_0x35fc('0x83')]();_0x9116b1[_0x35fc('0x1d')](_0x1c6ce9);_0x9116b1[_0x35fc('0x1c')](0x0);logger['debug'](_0x35fc('0x85'),_0x9116b1[_0x35fc('0x87')]());return dbH[_0x35fc('0x86')][_0x35fc('0x35')](_0x9116b1[_0x35fc('0x87')](),{'type':dbH['sequelize'][_0x35fc('0xa2')][_0x35fc('0x88')]});}})[_0x35fc('0x26')](function(){return{'sql':_0x355154['toString']()};})[_0x35fc('0x26')](respondWithResult(_0x3fff79,null))[_0x35fc('0x49')](handleError(_0x3fff79,null));}; \ No newline at end of file +var _0x6d38=['Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','select','countTable','COUNT(*)','sequelize','run','SEC_TO_TIME(%s)','rimraf','zip-dir','fast-json-patch','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','dbH','sendStatus','status','json','offset','undefined','limit','count','Content-Range','save','update','then','get','destroy','error','stack','name','send','index','map','rawAttributes','type','key','model','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','AnalyticDefaultReport','findAll','rows','show','keys','fields','find','catch','create','body','user','role','Reports','autoAssociation','UserProfileResource','DefaultReports','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','preview','join','right_join','cross_join','SUM(%s)','COUNT(%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20EMPTY','rules','operator','group','field','condition','value','getFields','ValidationErrorItem','AnalyticMetric','keyBy','from','table','MetricId','metric','function','replace','format','groupBy','orderBy','alias','joins','parse','parentKey','foreignTable','foreignKey','conditions','clone','debug','toString','QueryTypes','SELECT','left_join','COUNT(DISTINCT\x20%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','Sequelize','Please\x20insert\x20at\x20least\x20one\x20field','DESC','%s.%s\x20=\x20%s.%s','output','web','fullPath','randomstring','generate','csv','default','AnalyticExtractedReport','cdr','startDate','endDate','info'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x6d38,0x1ef));var _0x86d3=function(_0x5f0089,_0x227e2c){_0x5f0089=_0x5f0089-0x0;var _0x193892=_0x6d38[_0x5f0089];return _0x193892;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x86d3('0x0'));var zipdir=require(_0x86d3('0x1'));var jsonpatch=require(_0x86d3('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x86d3('0x3'));var Mustache=require('mustache');var util=require(_0x86d3('0x4'));var path=require(_0x86d3('0x5'));var sox=require(_0x86d3('0x6'));var csv=require('to-csv');var ejs=require(_0x86d3('0x7'));var fs=require('fs');var fs_extra=require(_0x86d3('0x8'));var _=require(_0x86d3('0x9'));var squel=require(_0x86d3('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x86d3('0xb'));var toCsv=require(_0x86d3('0xc'));var querystring=require(_0x86d3('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x86d3('0xe'));var qs=require(_0x86d3('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x86d3('0x10'))(_0x86d3('0x11'));var utils=require('../../config/utils');var config=require(_0x86d3('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0x86d3('0x13'))['db'];var dbH=require(_0x86d3('0x13'))[_0x86d3('0x14')];function respondWithStatusCode(_0x26d64c,_0xe1b3d7){_0xe1b3d7=_0xe1b3d7||0xcc;return function(_0x1b8d0a){if(_0x1b8d0a){return _0x26d64c[_0x86d3('0x15')](_0xe1b3d7);}return _0x26d64c[_0x86d3('0x16')](_0xe1b3d7)['end']();};}function respondWithResult(_0x1c1ba8,_0x1f35cf){_0x1f35cf=_0x1f35cf||0xc8;return function(_0x356e7d){if(_0x356e7d){return _0x1c1ba8[_0x86d3('0x16')](_0x1f35cf)[_0x86d3('0x17')](_0x356e7d);}};}function respondWithFilteredResult(_0x34fb3b,_0x1ff008){return function(_0x44436d){if(_0x44436d){var _0x53b437=typeof _0x1ff008[_0x86d3('0x18')]===_0x86d3('0x19')&&typeof _0x1ff008[_0x86d3('0x1a')]===_0x86d3('0x19');var _0x46feec=_0x44436d[_0x86d3('0x1b')];var _0x33e459=_0x53b437?0x0:_0x1ff008[_0x86d3('0x18')];var _0x9b76f2=_0x53b437?_0x44436d['count']:_0x1ff008[_0x86d3('0x18')]+_0x1ff008['limit'];var _0x6ced9e;if(_0x9b76f2>=_0x46feec){_0x9b76f2=_0x46feec;_0x6ced9e=0xc8;}else{_0x6ced9e=0xce;}_0x34fb3b['status'](_0x6ced9e);return _0x34fb3b['set'](_0x86d3('0x1c'),_0x33e459+'-'+_0x9b76f2+'/'+_0x46feec)[_0x86d3('0x17')](_0x44436d);}return null;};}function patchUpdates(_0x988066){return function(_0x1720ae){try{jsonpatch['apply'](_0x1720ae,_0x988066,!![]);}catch(_0x2901de){return BPromise['reject'](_0x2901de);}return _0x1720ae[_0x86d3('0x1d')]();};}function saveUpdates(_0x3fdf67,_0x1ce849){return function(_0x5b990d){if(_0x5b990d){return _0x5b990d[_0x86d3('0x1e')](_0x3fdf67)[_0x86d3('0x1f')](function(_0x1fa4ac){return _0x1fa4ac;});}return null;};}function removeEntity(_0x4bf5b8,_0x58ba51){return function(_0x26262a){if(_0x26262a){return _0x26262a['destroy']()[_0x86d3('0x1f')](function(){var _0x1bea5e=_0x26262a[_0x86d3('0x20')]({'plain':!![]});var _0x3c5fe4='DefaultReports';return db['UserProfileResource'][_0x86d3('0x21')]({'where':{'type':_0x3c5fe4,'resourceId':_0x1bea5e['id']}})[_0x86d3('0x1f')](function(){return _0x26262a;});})['then'](function(){_0x4bf5b8[_0x86d3('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x42413c,_0x41e2f0){return function(_0x287b96){if(!_0x287b96){_0x42413c[_0x86d3('0x15')](0x194);}return _0x287b96;};}function handleError(_0x11a6fd,_0x14c9ff){_0x14c9ff=_0x14c9ff||0x1f4;return function(_0x1f203e){logger[_0x86d3('0x22')](_0x1f203e[_0x86d3('0x23')]);if(_0x1f203e[_0x86d3('0x24')]){delete _0x1f203e[_0x86d3('0x24')];}_0x11a6fd[_0x86d3('0x16')](_0x14c9ff)[_0x86d3('0x25')](_0x1f203e);};}exports[_0x86d3('0x26')]=function(_0x5b09f6,_0x120a0c){var _0x403be3={},_0x2bda35={},_0x31cefe={'count':0x0,'rows':[]};var _0x7709f0=_[_0x86d3('0x27')](db['AnalyticDefaultReport'][_0x86d3('0x28')],function(_0x5c71df){return{'name':_0x5c71df['fieldName'],'type':_0x5c71df[_0x86d3('0x29')][_0x86d3('0x2a')]};});_0x2bda35[_0x86d3('0x2b')]=_['map'](_0x7709f0,_0x86d3('0x24'));_0x2bda35[_0x86d3('0x2c')]=_['keys'](_0x5b09f6[_0x86d3('0x2c')]);_0x2bda35[_0x86d3('0x2d')]=_[_0x86d3('0x2e')](_0x2bda35[_0x86d3('0x2b')],_0x2bda35[_0x86d3('0x2c')]);_0x403be3[_0x86d3('0x2f')]=_[_0x86d3('0x2e')](_0x2bda35[_0x86d3('0x2b')],qs['fields'](_0x5b09f6['query']['fields']));_0x403be3[_0x86d3('0x2f')]=_0x403be3['attributes'][_0x86d3('0x30')]?_0x403be3['attributes']:_0x2bda35[_0x86d3('0x2b')];if(!_0x5b09f6[_0x86d3('0x2c')][_0x86d3('0x31')](_0x86d3('0x32'))){_0x403be3[_0x86d3('0x1a')]=qs[_0x86d3('0x1a')](_0x5b09f6[_0x86d3('0x2c')]['limit']);_0x403be3[_0x86d3('0x18')]=qs[_0x86d3('0x18')](_0x5b09f6['query'][_0x86d3('0x18')]);}_0x403be3[_0x86d3('0x33')]=qs[_0x86d3('0x34')](_0x5b09f6[_0x86d3('0x2c')]['sort']);_0x403be3[_0x86d3('0x35')]=qs[_0x86d3('0x2d')](_[_0x86d3('0x36')](_0x5b09f6['query'],_0x2bda35[_0x86d3('0x2d')]),_0x7709f0);if(_0x5b09f6[_0x86d3('0x2c')][_0x86d3('0x37')]){_0x403be3[_0x86d3('0x35')]=_[_0x86d3('0x38')](_0x403be3[_0x86d3('0x35')],{'$or':_[_0x86d3('0x27')](_0x7709f0,function(_0x436065){if(_0x436065['type']!==_0x86d3('0x39')){var _0x470978={};_0x470978[_0x436065[_0x86d3('0x24')]]={'$like':'%'+_0x5b09f6[_0x86d3('0x2c')]['filter']+'%'};return _0x470978;}})});}_0x403be3=_[_0x86d3('0x38')]({},_0x403be3,_0x5b09f6[_0x86d3('0x3a')]);var _0x6f72be={'where':_0x403be3[_0x86d3('0x35')]};return db['AnalyticDefaultReport']['count'](_0x6f72be)[_0x86d3('0x1f')](function(_0x4f422b){_0x31cefe['count']=_0x4f422b;if(_0x5b09f6[_0x86d3('0x2c')][_0x86d3('0x3b')]){_0x403be3[_0x86d3('0x3c')]=[{'all':!![]}];}return db[_0x86d3('0x3d')][_0x86d3('0x3e')](_0x403be3);})['then'](function(_0x2a5f6c){_0x31cefe[_0x86d3('0x3f')]=_0x2a5f6c;return _0x31cefe;})[_0x86d3('0x1f')](respondWithFilteredResult(_0x120a0c,_0x403be3))['catch'](handleError(_0x120a0c,null));};exports[_0x86d3('0x40')]=function(_0x810d10,_0x5dfae8){var _0x369f68={'raw':!![],'where':{'id':_0x810d10['params']['id']}},_0xcf6c9e={};_0xcf6c9e['model']=_['keys'](db[_0x86d3('0x3d')][_0x86d3('0x28')]);_0xcf6c9e[_0x86d3('0x2c')]=_[_0x86d3('0x41')](_0x810d10[_0x86d3('0x2c')]);_0xcf6c9e[_0x86d3('0x2d')]=_['intersection'](_0xcf6c9e[_0x86d3('0x2b')],_0xcf6c9e[_0x86d3('0x2c')]);_0x369f68['attributes']=_[_0x86d3('0x2e')](_0xcf6c9e[_0x86d3('0x2b')],qs[_0x86d3('0x42')](_0x810d10[_0x86d3('0x2c')][_0x86d3('0x42')]));_0x369f68[_0x86d3('0x2f')]=_0x369f68['attributes'][_0x86d3('0x30')]?_0x369f68[_0x86d3('0x2f')]:_0xcf6c9e['model'];if(_0x810d10[_0x86d3('0x2c')][_0x86d3('0x3b')]){_0x369f68[_0x86d3('0x3c')]=[{'all':!![]}];}_0x369f68=_[_0x86d3('0x38')]({},_0x369f68,_0x810d10[_0x86d3('0x3a')]);return db['AnalyticDefaultReport'][_0x86d3('0x43')](_0x369f68)[_0x86d3('0x1f')](handleEntityNotFound(_0x5dfae8,null))[_0x86d3('0x1f')](respondWithResult(_0x5dfae8,null))[_0x86d3('0x44')](handleError(_0x5dfae8,null));};exports[_0x86d3('0x45')]=function(_0x7af7b3,_0x1a4345){return db[_0x86d3('0x3d')][_0x86d3('0x45')](_0x7af7b3[_0x86d3('0x46')],{})[_0x86d3('0x1f')](function(_0x1236ea){var _0x4ea940=_0x7af7b3[_0x86d3('0x47')][_0x86d3('0x20')]({'plain':!![]});if(!_0x4ea940)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4ea940[_0x86d3('0x48')]===_0x86d3('0x47')){var _0x197047=_0x1236ea[_0x86d3('0x20')]({'plain':!![]});var _0x1dcff0=_0x86d3('0x49');return db['UserProfileSection']['find']({'where':{'name':_0x1dcff0,'userProfileId':_0x4ea940['userProfileId']},'raw':!![]})['then'](function(_0x159253){if(_0x159253&&_0x159253[_0x86d3('0x4a')]===0x0){return db[_0x86d3('0x4b')][_0x86d3('0x45')]({'name':_0x197047[_0x86d3('0x24')],'resourceId':_0x197047['id'],'type':_0x86d3('0x4c'),'sectionId':_0x159253['id']},{})[_0x86d3('0x1f')](function(){return _0x1236ea;});}else{return _0x1236ea;}})['catch'](function(_0x2afb07){logger[_0x86d3('0x22')](_0x86d3('0x4d'),_0x2afb07);throw _0x2afb07;});}return _0x1236ea;})[_0x86d3('0x1f')](respondWithResult(_0x1a4345,0xc9))[_0x86d3('0x44')](handleError(_0x1a4345,null));};exports[_0x86d3('0x1e')]=function(_0x34935f,_0x4c8828){if(_0x34935f[_0x86d3('0x46')]['id']){delete _0x34935f['body']['id'];}return db[_0x86d3('0x3d')][_0x86d3('0x43')]({'where':{'id':_0x34935f[_0x86d3('0x4e')]['id']}})[_0x86d3('0x1f')](handleEntityNotFound(_0x4c8828,null))[_0x86d3('0x1f')](saveUpdates(_0x34935f['body'],null))[_0x86d3('0x1f')](respondWithResult(_0x4c8828,null))[_0x86d3('0x44')](handleError(_0x4c8828,null));};exports[_0x86d3('0x21')]=function(_0x4e10d9,_0x4ad164){return db['AnalyticDefaultReport'][_0x86d3('0x43')]({'where':{'id':_0x4e10d9['params']['id']}})[_0x86d3('0x1f')](handleEntityNotFound(_0x4ad164,null))[_0x86d3('0x1f')](removeEntity(_0x4ad164,null))[_0x86d3('0x44')](handleError(_0x4ad164,null));};exports[_0x86d3('0x4f')]=function(_0x5963bb,_0x4cd835){var _0x551806=0xa;var _0x28655a=[_0x86d3('0x50'),'left_join',_0x86d3('0x51'),_0x86d3('0x52')];var _0xa085b2={'SUM':_0x86d3('0x53'),'COUNT':_0x86d3('0x54'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x86d3('0x55'),'MIN':_0x86d3('0x56'),'AVG':_0x86d3('0x57'),'GROUP_CONCAT':_0x86d3('0x58'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x86d3('0x59')};var _0x41fad7={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x86d3('0x5a'),'HOUR':_0x86d3('0x5b'),'ROUND':_0x86d3('0x5c'),'UNIX_TIMESTAMP':_0x86d3('0x5d')};var _0x4598d4=function(_0x4029a4){return!_[_0x86d3('0x5e')](['IS\x20NULL','IS\x20NOT\x20NULL',_0x86d3('0x5f'),'IS\x20NOT\x20EMPTY'],_0x4029a4);};var _0x528ca8=function(_0x58e4b6){if(!_0x58e4b6||!_0x58e4b6[_0x86d3('0x60')]['length']){return'';}for(var _0x254ac3='(',_0x5f2ed6=0x0;_0x5f2ed6<_0x58e4b6[_0x86d3('0x60')][_0x86d3('0x30')];_0x5f2ed6+=0x1){_0x5f2ed6>0x0&&(_0x254ac3+='\x20'+_0x58e4b6[_0x86d3('0x61')]+'\x20');_0x254ac3+=_0x58e4b6['rules'][_0x5f2ed6]['group']?_0x528ca8(_0x58e4b6[_0x86d3('0x60')][_0x5f2ed6][_0x86d3('0x62')]):_0x58e4b6[_0x86d3('0x60')][_0x5f2ed6][_0x86d3('0x63')]+'\x20'+_0x58e4b6[_0x86d3('0x60')][_0x5f2ed6][_0x86d3('0x64')]+(_0x4598d4(_0x58e4b6[_0x86d3('0x60')][_0x5f2ed6][_0x86d3('0x64')])?'\x20'+_0x58e4b6[_0x86d3('0x60')][_0x5f2ed6][_0x86d3('0x65')]:'');}return _0x254ac3+')';};var _0x1e3479={'where':{'id':_0x5963bb[_0x86d3('0x4e')]['id']}},_0x265beb,_0xfaf168,_0xf0dbbb,_0x3f978c,_0x5e1835;_0x1e3479=_[_0x86d3('0x38')]({},_0x1e3479,_0x5963bb['options']);return db[_0x86d3('0x3d')][_0x86d3('0x43')](_0x1e3479)[_0x86d3('0x1f')](function(_0x52dc99){if(_0x52dc99){_0x265beb=_0x52dc99;return _0x52dc99[_0x86d3('0x66')]();}return null;})[_0x86d3('0x1f')](function(_0x45e8d9){if(_0x45e8d9){if(!_0x45e8d9[_0x86d3('0x30')]){throw new db['Sequelize'][(_0x86d3('0x67'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0xfaf168=_0x45e8d9;return db[_0x86d3('0x68')][_0x86d3('0x3e')]({'raw':!![]});}return null;})[_0x86d3('0x1f')](function(_0x2d4bc1){if(_0x2d4bc1){_0xf0dbbb=_[_0x86d3('0x69')](_0x2d4bc1,'id');var _0x56fd96;var _0x3cc1d8=squel['select']();_0x3cc1d8[_0x86d3('0x6a')](_0x265beb[_0x86d3('0x6b')]);for(var _0x5866fe=0x0;_0x5866fe<_0xfaf168[_0x86d3('0x30')];_0x5866fe+=0x1){_0x56fd96=_0xfaf168[_0x5866fe][_0x86d3('0x6c')]?_0xf0dbbb[_0xfaf168[_0x5866fe][_0x86d3('0x6c')]][_0x86d3('0x6d')]:_0xfaf168[_0x5866fe][_0x86d3('0x63')];_0x56fd96=_0xfaf168[_0x5866fe][_0x86d3('0x6e')]?_[_0x86d3('0x6f')](_0xa085b2[_0xfaf168[_0x5866fe]['function']],'%s',_0x56fd96):_0x56fd96;_0x56fd96=_0xfaf168[_0x5866fe][_0x86d3('0x70')]?_[_0x86d3('0x6f')](_0x41fad7[_0xfaf168[_0x5866fe][_0x86d3('0x70')]],'%s',_0x56fd96):_0x56fd96;if(_0xfaf168[_0x5866fe][_0x86d3('0x71')]){_0x3cc1d8[_0x86d3('0x62')](_0x56fd96);}_0xfaf168[_0x5866fe]['orderBy']&&_0x3cc1d8[_0x86d3('0x33')](_0x56fd96,_0xfaf168[_0x5866fe][_0x86d3('0x72')]==='DESC'?![]:!![]);_0x3cc1d8[_0x86d3('0x63')](_0x56fd96,_0xfaf168[_0x5866fe][_0x86d3('0x73')]||_0x56fd96);}if(_0x265beb[_0x86d3('0x74')]){_0x265beb[_0x86d3('0x74')]=JSON[_0x86d3('0x75')](_0x265beb[_0x86d3('0x74')]);for(var _0x1bf5ba=0x0;_0x1bf5ba<_0x265beb[_0x86d3('0x74')][_0x86d3('0x30')];_0x1bf5ba+=0x1){if(_0x265beb[_0x86d3('0x74')][_0x1bf5ba][_0x86d3('0x29')]&&_[_0x86d3('0x5e')](_0x28655a,_0x265beb[_0x86d3('0x74')][_0x1bf5ba][_0x86d3('0x29')])&&_0x265beb['joins'][_0x1bf5ba][_0x86d3('0x76')]&&_0x265beb[_0x86d3('0x74')][_0x1bf5ba][_0x86d3('0x77')]&&_0x265beb[_0x86d3('0x74')][_0x1bf5ba]['foreignKey']){_0x3cc1d8[_0x265beb[_0x86d3('0x74')][_0x1bf5ba][_0x86d3('0x29')]](_0x265beb[_0x86d3('0x74')][_0x1bf5ba][_0x86d3('0x77')],null,util['format']('%s.%s\x20=\x20%s.%s',_0x265beb[_0x86d3('0x6b')],_0x265beb['joins'][_0x1bf5ba][_0x86d3('0x76')],_0x265beb['joins'][_0x1bf5ba]['foreignTable'],_0x265beb[_0x86d3('0x74')][_0x1bf5ba][_0x86d3('0x78')]));}}}if(_0x265beb[_0x86d3('0x79')]){_0x265beb[_0x86d3('0x79')]=JSON[_0x86d3('0x75')](_0x265beb['conditions']);_0x3cc1d8[_0x86d3('0x35')](_0x528ca8(_0x265beb[_0x86d3('0x79')]['group']));}_0x5e1835=_0x3cc1d8[_0x86d3('0x7a')]();_0x3cc1d8[_0x86d3('0x1a')](_0x551806);_0x3cc1d8['offset'](0x0);logger[_0x86d3('0x7b')]('Limited\x20Query:',_0x3cc1d8[_0x86d3('0x7c')]());return dbH['sequelize']['query'](_0x3cc1d8[_0x86d3('0x7c')](),{'type':dbH['sequelize'][_0x86d3('0x7d')][_0x86d3('0x7e')]});}})[_0x86d3('0x1f')](respondWithResult(_0x4cd835,null))[_0x86d3('0x44')](handleError(_0x4cd835,null));};function runReport(_0x3193d5,_0x3a1acc,_0x268c93){var _0x3b989c=_0x3a1acc['name'];var _0x245b39=0xa;var _0x158f56=[_0x86d3('0x50'),_0x86d3('0x7f'),_0x86d3('0x51'),'cross_join'];var _0x3d8b35={'SUM':_0x86d3('0x53'),'COUNT':_0x86d3('0x54'),'COUNT DISTINCT':_0x86d3('0x80'),'MAX':_0x86d3('0x55'),'MIN':_0x86d3('0x56'),'AVG':_0x86d3('0x57'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x86d3('0x81'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0xca2e0={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':_0x86d3('0x5b'),'ROUND':_0x86d3('0x5c'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x1b503a=function(_0x24410c){return!_[_0x86d3('0x5e')]([_0x86d3('0x82'),_0x86d3('0x83'),_0x86d3('0x5f'),_0x86d3('0x84')],_0x24410c);};var _0x5f4a38=function(_0x593b85){if(!_0x593b85||!_0x593b85[_0x86d3('0x60')][_0x86d3('0x30')]){return'';}for(var _0x3fac94='(',_0x28d98e=0x0;_0x28d98e<_0x593b85[_0x86d3('0x60')][_0x86d3('0x30')];_0x28d98e+=0x1){_0x28d98e>0x0&&(_0x3fac94+='\x20'+_0x593b85['operator']+'\x20');_0x3fac94+=_0x593b85[_0x86d3('0x60')][_0x28d98e][_0x86d3('0x62')]?_0x5f4a38(_0x593b85[_0x86d3('0x60')][_0x28d98e][_0x86d3('0x62')]):_0x593b85[_0x86d3('0x60')][_0x28d98e][_0x86d3('0x63')]+'\x20'+_0x593b85[_0x86d3('0x60')][_0x28d98e][_0x86d3('0x64')]+(_0x1b503a(_0x593b85[_0x86d3('0x60')][_0x28d98e]['condition'])?'\x20'+_0x593b85[_0x86d3('0x60')][_0x28d98e][_0x86d3('0x65')]:'');}return _0x3fac94+')';};var _0x4b871b={'where':{'id':_0x3193d5['id']}},_0x584a57,_0x36ee46,_0x1cbc3a,_0x682a6d,_0x5004cd;_0x4b871b=_[_0x86d3('0x38')]({},_0x4b871b,_0x268c93);return db[_0x86d3('0x3d')][_0x86d3('0x43')](_0x4b871b)[_0x86d3('0x1f')](function(_0x3d3e7f){if(_0x3d3e7f){_0x584a57=_0x3d3e7f;return _0x3d3e7f['getFields']();}return null;})[_0x86d3('0x1f')](function(_0x1aaf08){if(_0x1aaf08){if(!_0x1aaf08['length']){throw new db[(_0x86d3('0x85'))][(_0x86d3('0x67'))](_0x86d3('0x86'),0x193);}_0x36ee46=_0x1aaf08;return db[_0x86d3('0x68')]['findAll']({'raw':!![]});}return null;})[_0x86d3('0x1f')](function(_0x2896e1){if(_0x2896e1){_0x1cbc3a=_[_0x86d3('0x69')](_0x2896e1,'id');var _0x18295c;var _0x44af1c=squel['select']();_0x44af1c[_0x86d3('0x6a')](_0x584a57[_0x86d3('0x6b')]);for(var _0x3582a2=0x0;_0x3582a2<_0x36ee46[_0x86d3('0x30')];_0x3582a2+=0x1){_0x18295c=_0x36ee46[_0x3582a2][_0x86d3('0x6c')]?_0x1cbc3a[_0x36ee46[_0x3582a2][_0x86d3('0x6c')]][_0x86d3('0x6d')]:_0x36ee46[_0x3582a2][_0x86d3('0x63')];_0x18295c=_0x36ee46[_0x3582a2][_0x86d3('0x6e')]?_[_0x86d3('0x6f')](_0x3d8b35[_0x36ee46[_0x3582a2]['function']],'%s',_0x18295c):_0x18295c;_0x18295c=_0x36ee46[_0x3582a2]['format']?_[_0x86d3('0x6f')](_0xca2e0[_0x36ee46[_0x3582a2][_0x86d3('0x70')]],'%s',_0x18295c):_0x18295c;if(_0x36ee46[_0x3582a2]['groupBy']){_0x44af1c[_0x86d3('0x62')](_0x18295c);}_0x36ee46[_0x3582a2][_0x86d3('0x72')]&&_0x44af1c[_0x86d3('0x33')](_0x18295c,_0x36ee46[_0x3582a2][_0x86d3('0x72')]===_0x86d3('0x87')?![]:!![]);_0x44af1c[_0x86d3('0x63')](_0x18295c,_0x36ee46[_0x3582a2][_0x86d3('0x73')]||_0x18295c);}if(_0x584a57[_0x86d3('0x74')]){_0x584a57[_0x86d3('0x74')]=JSON['parse'](_0x584a57['joins']);for(var _0x48a6d7=0x0;_0x48a6d7<_0x584a57['joins'][_0x86d3('0x30')];_0x48a6d7+=0x1){if(_0x584a57[_0x86d3('0x74')][_0x48a6d7][_0x86d3('0x29')]&&_[_0x86d3('0x5e')](_0x158f56,_0x584a57[_0x86d3('0x74')][_0x48a6d7][_0x86d3('0x29')])&&_0x584a57[_0x86d3('0x74')][_0x48a6d7]['parentKey']&&_0x584a57[_0x86d3('0x74')][_0x48a6d7][_0x86d3('0x77')]&&_0x584a57[_0x86d3('0x74')][_0x48a6d7][_0x86d3('0x78')]){_0x44af1c[_0x584a57['joins'][_0x48a6d7][_0x86d3('0x29')]](_0x584a57['joins'][_0x48a6d7][_0x86d3('0x77')],null,util[_0x86d3('0x70')](_0x86d3('0x88'),_0x584a57[_0x86d3('0x6b')],_0x584a57[_0x86d3('0x74')][_0x48a6d7]['parentKey'],_0x584a57['joins'][_0x48a6d7][_0x86d3('0x77')],_0x584a57['joins'][_0x48a6d7][_0x86d3('0x78')]));}}}if(_0x584a57['conditions']){_0x584a57[_0x86d3('0x79')]=JSON['parse'](_0x584a57['conditions']);_0x44af1c[_0x86d3('0x35')](_0x5f4a38(_0x584a57[_0x86d3('0x79')][_0x86d3('0x62')]));}_0x5004cd=_0x44af1c[_0x86d3('0x7a')]();_0x44af1c[_0x86d3('0x1a')](_0x245b39);_0x44af1c[_0x86d3('0x18')](0x0);return;}})[_0x86d3('0x1f')](function(){if(_0x3a1acc[_0x86d3('0x89')]===_0x86d3('0x8a')){return null;}var _0x120a85=_[_0x86d3('0x38')](_0x3a1acc,{'name':_0x3a1acc[_0x86d3('0x8b')]||_0x3a1acc[_0x86d3('0x24')]||_0x584a57[_0x86d3('0x24')],'basename':_0x3b989c,'savename':util[_0x86d3('0x70')]('%s-%s.%s',_0x3a1acc['name']||_0x584a57['name'],require(_0x86d3('0x8c'))[_0x86d3('0x8d')](0x4),_0x3a1acc[_0x86d3('0x89')]||_0x86d3('0x8e')),'reportId':_0x584a57['id'],'reportType':_0x86d3('0x8f')});return db[_0x86d3('0x90')][_0x86d3('0x45')](_0x120a85,{'raw':!![]});})[_0x86d3('0x1f')](function(_0x10e23d){if(_0x584a57[_0x86d3('0x6b')]===_0x86d3('0x91')){_0x5004cd['where'](_0x584a57[_0x86d3('0x6b')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x3a1acc[_0x86d3('0x92')],_0x3a1acc[_0x86d3('0x93')]);}else{_0x5004cd[_0x86d3('0x35')](_0x584a57[_0x86d3('0x6b')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x3a1acc[_0x86d3('0x92')],_0x3a1acc[_0x86d3('0x93')]);}if(_0x10e23d){logger[_0x86d3('0x94')](_0x86d3('0x95'),_0x5004cd[_0x86d3('0x7c')]());require(_0x86d3('0x96'))[_0x86d3('0x97')](path[_0x86d3('0x50')](__dirname,_0x86d3('0x98'),_0x10e23d[_0x86d3('0x89')]),[_0x10e23d['id'],_0x5004cd[_0x86d3('0x7c')](),path[_0x86d3('0x50')](__dirname,_0x86d3('0x99'),_0x10e23d[_0x86d3('0x9a')]),_0x3b989c]);return _0x10e23d;}else{var _0x428b11=squel[_0x86d3('0x9b')]();_0x428b11[_0x86d3('0x6a')]('('+_0x5004cd['toString']()+')',_0x86d3('0x9c'));_0x428b11[_0x86d3('0x63')](_0x86d3('0x9d'),_0x86d3('0x1b'));_0x5004cd['limit'](_0x3a1acc[_0x86d3('0x1a')]||_0x245b39);_0x5004cd['offset'](_0x3a1acc['offset']||0x0);return dbH[_0x86d3('0x9e')][_0x86d3('0x2c')](_0x428b11[_0x86d3('0x7c')](),{'type':dbH[_0x86d3('0x9e')][_0x86d3('0x7d')][_0x86d3('0x7e')]})[_0x86d3('0x1f')](function(_0x4777f1){if(!_0x4777f1['length']){_0x682a6d=0x0;}else{_0x682a6d=_0x4777f1[0x0]['count']||0x0;}return dbH['sequelize'][_0x86d3('0x2c')](_0x5004cd[_0x86d3('0x7c')](),{'type':dbH[_0x86d3('0x9e')]['QueryTypes'][_0x86d3('0x7e')]});})['then'](function(_0x435b8e){return{'rows':_0x435b8e||[],'count':_0x682a6d};});}});}exports[_0x86d3('0x9f')]=function(_0x73b8e6,_0x2c98e1){return runReport(_0x73b8e6['params'],_0x73b8e6[_0x86d3('0x2c')],_0x73b8e6[_0x86d3('0x3a')])[_0x86d3('0x1f')](respondWithResult(_0x2c98e1,null))['catch'](handleError(_0x2c98e1,null));};exports['runReport']=runReport;exports['query']=function(_0x458997,_0x1e3559){var _0x49a101=0xa;var _0x38d724=['join',_0x86d3('0x7f'),_0x86d3('0x51'),_0x86d3('0x52')];var _0x56ff91={'SUM':_0x86d3('0x53'),'COUNT':_0x86d3('0x54'),'COUNT DISTINCT':_0x86d3('0x80'),'MAX':_0x86d3('0x55'),'MIN':_0x86d3('0x56'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x86d3('0x58'),'GROUP_CONCAT ASC':_0x86d3('0x81'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x1f347e={'SEC_TO_TIME':_0x86d3('0xa0'),'DATE':'DATE(%s)','HOUR':_0x86d3('0x5b'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x45b210=function(_0x144e43){return!_[_0x86d3('0x5e')]([_0x86d3('0x82'),_0x86d3('0x83'),_0x86d3('0x5f'),_0x86d3('0x84')],_0x144e43);};var _0xdc7c21=function(_0x2e0397){if(!_0x2e0397||!_0x2e0397[_0x86d3('0x60')][_0x86d3('0x30')]){return'';}for(var _0x2cc617='(',_0x25339c=0x0;_0x25339c<_0x2e0397['rules'][_0x86d3('0x30')];_0x25339c+=0x1){_0x25339c>0x0&&(_0x2cc617+='\x20'+_0x2e0397[_0x86d3('0x61')]+'\x20');_0x2cc617+=_0x2e0397[_0x86d3('0x60')][_0x25339c][_0x86d3('0x62')]?_0xdc7c21(_0x2e0397[_0x86d3('0x60')][_0x25339c][_0x86d3('0x62')]):_0x2e0397['rules'][_0x25339c][_0x86d3('0x63')]+'\x20'+_0x2e0397['rules'][_0x25339c][_0x86d3('0x64')]+(_0x45b210(_0x2e0397[_0x86d3('0x60')][_0x25339c]['condition'])?'\x20'+_0x2e0397['rules'][_0x25339c][_0x86d3('0x65')]:'');}return _0x2cc617+')';};var _0x2c0070={'where':{'id':_0x458997[_0x86d3('0x4e')]['id']}},_0x31d436,_0x56e713,_0x525559,_0x3b9e1e,_0x1d8d7c;_0x2c0070=_['merge']({},_0x2c0070,_0x458997[_0x86d3('0x3a')]);return db[_0x86d3('0x3d')][_0x86d3('0x43')](_0x2c0070)[_0x86d3('0x1f')](function(_0x1f80be){if(_0x1f80be){_0x31d436=_0x1f80be;return _0x1f80be[_0x86d3('0x66')]();}return null;})[_0x86d3('0x1f')](function(_0x3dddbe){if(_0x3dddbe){if(!_0x3dddbe[_0x86d3('0x30')]){throw new db[(_0x86d3('0x85'))][(_0x86d3('0x67'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x56e713=_0x3dddbe;return db[_0x86d3('0x68')]['findAll']({'raw':!![]});}return null;})['then'](function(_0x1d7e83){if(_0x1d7e83){_0x525559=_[_0x86d3('0x69')](_0x1d7e83,'id');var _0x5d9385;var _0x49a499=squel[_0x86d3('0x9b')]();_0x49a499[_0x86d3('0x6a')](_0x31d436[_0x86d3('0x6b')]);for(var _0x33e0a5=0x0;_0x33e0a5<_0x56e713['length'];_0x33e0a5+=0x1){_0x5d9385=_0x56e713[_0x33e0a5][_0x86d3('0x6c')]?_0x525559[_0x56e713[_0x33e0a5][_0x86d3('0x6c')]][_0x86d3('0x6d')]:_0x56e713[_0x33e0a5][_0x86d3('0x63')];_0x5d9385=_0x56e713[_0x33e0a5][_0x86d3('0x6e')]?_['replace'](_0x56ff91[_0x56e713[_0x33e0a5][_0x86d3('0x6e')]],'%s',_0x5d9385):_0x5d9385;_0x5d9385=_0x56e713[_0x33e0a5][_0x86d3('0x70')]?_[_0x86d3('0x6f')](_0x1f347e[_0x56e713[_0x33e0a5]['format']],'%s',_0x5d9385):_0x5d9385;if(_0x56e713[_0x33e0a5][_0x86d3('0x71')]){_0x49a499['group'](_0x5d9385);}_0x56e713[_0x33e0a5][_0x86d3('0x72')]&&_0x49a499[_0x86d3('0x33')](_0x5d9385,_0x56e713[_0x33e0a5]['orderBy']===_0x86d3('0x87')?![]:!![]);_0x49a499[_0x86d3('0x63')](_0x5d9385,_0x56e713[_0x33e0a5][_0x86d3('0x73')]||_0x5d9385);}if(_0x31d436[_0x86d3('0x74')]){_0x31d436[_0x86d3('0x74')]=JSON[_0x86d3('0x75')](_0x31d436['joins']);for(var _0x10af91=0x0;_0x10af91<_0x31d436['joins'][_0x86d3('0x30')];_0x10af91+=0x1){if(_0x31d436[_0x86d3('0x74')][_0x10af91][_0x86d3('0x29')]&&_[_0x86d3('0x5e')](_0x38d724,_0x31d436['joins'][_0x10af91][_0x86d3('0x29')])&&_0x31d436[_0x86d3('0x74')][_0x10af91][_0x86d3('0x76')]&&_0x31d436[_0x86d3('0x74')][_0x10af91][_0x86d3('0x77')]&&_0x31d436[_0x86d3('0x74')][_0x10af91]['foreignKey']){_0x49a499[_0x31d436[_0x86d3('0x74')][_0x10af91][_0x86d3('0x29')]](_0x31d436['joins'][_0x10af91]['foreignTable'],null,util[_0x86d3('0x70')]('%s.%s\x20=\x20%s.%s',_0x31d436['table'],_0x31d436[_0x86d3('0x74')][_0x10af91][_0x86d3('0x76')],_0x31d436[_0x86d3('0x74')][_0x10af91]['foreignTable'],_0x31d436[_0x86d3('0x74')][_0x10af91][_0x86d3('0x78')]));}}}if(_0x31d436[_0x86d3('0x79')]){_0x31d436[_0x86d3('0x79')]=JSON[_0x86d3('0x75')](_0x31d436['conditions']);_0x49a499[_0x86d3('0x35')](_0xdc7c21(_0x31d436[_0x86d3('0x79')]['group']));}_0x1d8d7c=_0x49a499['clone']();_0x49a499['limit'](_0x49a101);_0x49a499[_0x86d3('0x18')](0x0);logger['debug']('Limited\x20Query:',_0x49a499[_0x86d3('0x7c')]());return dbH[_0x86d3('0x9e')]['query'](_0x49a499['toString'](),{'type':dbH[_0x86d3('0x9e')][_0x86d3('0x7d')][_0x86d3('0x7e')]});}})['then'](function(){return{'sql':_0x1d8d7c[_0x86d3('0x7c')]()};})[_0x86d3('0x1f')](respondWithResult(_0x1e3559,null))[_0x86d3('0x44')](handleError(_0x1e3559,null));}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js index 6f614c7..0657542 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 _0x4578=['define','lodash','util','../../config/logger','api','moment','bluebird','request-promise','./analyticDefaultReport.attributes','exports'];(function(_0x35a41b,_0x1c2aa4){var _0x41c4af=function(_0x7e6b21){while(--_0x7e6b21){_0x35a41b['push'](_0x35a41b['shift']());}};_0x41c4af(++_0x1c2aa4);}(_0x4578,0x79));var _0x8457=function(_0x1c7d3a,_0x526b24){_0x1c7d3a=_0x1c7d3a-0x0;var _0x42a22d=_0x4578[_0x1c7d3a];return _0x42a22d;};'use strict';var _=require(_0x8457('0x0'));var util=require(_0x8457('0x1'));var logger=require(_0x8457('0x2'))(_0x8457('0x3'));var moment=require(_0x8457('0x4'));var BPromise=require(_0x8457('0x5'));var rp=require(_0x8457('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x8457('0x7'));module[_0x8457('0x8')]=function(_0x5e7f34,_0x28eabe){return _0x5e7f34[_0x8457('0x9')]('AnalyticDefaultReport',attributes,{'tableName':'analytics_default_reports','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5655=['analytics_default_reports','lodash','api','moment','bluebird','request-promise','rimraf','./analyticDefaultReport.attributes','exports','define','AnalyticDefaultReport'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0x5655,0xf3));var _0x5565=function(_0x3bb6f3,_0x33b960){_0x3bb6f3=_0x3bb6f3-0x0;var _0x24405b=_0x5655[_0x3bb6f3];return _0x24405b;};'use strict';var _=require(_0x5565('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x5565('0x1'));var moment=require(_0x5565('0x2'));var BPromise=require(_0x5565('0x3'));var rp=require(_0x5565('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5565('0x5'));var config=require('../../config/environment');var attributes=require(_0x5565('0x6'));module[_0x5565('0x7')]=function(_0x53627b,_0x126024){return _0x53627b[_0x5565('0x8')](_0x5565('0x9'),attributes,{'tableName':_0x5565('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js b/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js index 761ea53..d801d47 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 _0x74b4=['AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info'];(function(_0xbcb1c4,_0x21b32f){var _0x2a882d=function(_0x31cf50){while(--_0x31cf50){_0xbcb1c4['push'](_0xbcb1c4['shift']());}};_0x2a882d(++_0x21b32f);}(_0x74b4,0xba));var _0x474b=function(_0x10285a,_0x5170b2){_0x10285a=_0x10285a-0x0;var _0x430f5a=_0x74b4[_0x10285a];return _0x430f5a;};'use strict';var _=require('lodash');var util=require(_0x474b('0x0'));var moment=require(_0x474b('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x474b('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x474b('0x3'));var logger=require(_0x474b('0x4'))(_0x474b('0x5'));var config=require('../../config/environment');var jayson=require(_0x474b('0x6'));var client=jayson[_0x474b('0x7')][_0x474b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x10239a,_0x1d564e,_0x2a7eeb){return new BPromise(function(_0x12f9c4,_0x2c4575){return client[_0x474b('0x9')](_0x10239a,_0x2a7eeb)[_0x474b('0xa')](function(_0x5c56b1){logger[_0x474b('0xb')](_0x474b('0xc'),_0x1d564e,_0x474b('0xd'));logger[_0x474b('0xe')](_0x474b('0xf'),_0x1d564e,_0x474b('0xd'),JSON[_0x474b('0x10')](_0x5c56b1));if(_0x5c56b1[_0x474b('0x11')]){if(_0x5c56b1[_0x474b('0x11')][_0x474b('0x12')]===0x1f4){logger[_0x474b('0x11')](_0x474b('0xc'),_0x1d564e,_0x5c56b1['error'][_0x474b('0x13')]);return _0x2c4575(_0x5c56b1['error']['message']);}logger[_0x474b('0x11')](_0x474b('0xc'),_0x1d564e,_0x5c56b1[_0x474b('0x11')][_0x474b('0x13')]);return _0x12f9c4(_0x5c56b1[_0x474b('0x11')][_0x474b('0x13')]);}else{logger['info'](_0x474b('0xc'),_0x1d564e,_0x474b('0xd'));_0x12f9c4(_0x5c56b1[_0x474b('0x14')][_0x474b('0x13')]);}})[_0x474b('0x15')](function(_0xec213c){logger['error'](_0x474b('0xc'),_0x1d564e,_0xec213c);_0x2c4575(_0xec213c);});});} \ No newline at end of file +var _0x121e=['request\x20sent','stringify','error','AnalyticDefaultReport,\x20%s,\x20%s','message','result','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x48ff34,_0x412da3){var _0xd11d1d=function(_0xfe4646){while(--_0xfe4646){_0x48ff34['push'](_0x48ff34['shift']());}};_0xd11d1d(++_0x412da3);}(_0x121e,0x196));var _0xe121=function(_0x2e00bb,_0x1235bf){_0x2e00bb=_0x2e00bb-0x0;var _0x39bedb=_0x121e[_0x2e00bb];return _0x39bedb;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe121('0x0'));var BPromise=require(_0xe121('0x1'));var rs=require(_0xe121('0x2'));var fs=require('fs');var Redis=require(_0xe121('0x3'));var db=require(_0xe121('0x4'))['db'];var utils=require(_0xe121('0x5'));var logger=require(_0xe121('0x6'))(_0xe121('0x7'));var config=require(_0xe121('0x8'));var jayson=require(_0xe121('0x9'));var client=jayson[_0xe121('0xa')][_0xe121('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2d40ac,_0x2326f3,_0x48bf17){return new BPromise(function(_0x203b17,_0x5705d1){return client[_0xe121('0xc')](_0x2d40ac,_0x48bf17)[_0xe121('0xd')](function(_0x32056){logger['info']('AnalyticDefaultReport,\x20%s,\x20%s',_0x2326f3,_0xe121('0xe'));logger['debug']('AnalyticDefaultReport,\x20%s,\x20%s,\x20%s',_0x2326f3,_0xe121('0xe'),JSON[_0xe121('0xf')](_0x32056));if(_0x32056[_0xe121('0x10')]){if(_0x32056['error']['code']===0x1f4){logger[_0xe121('0x10')](_0xe121('0x11'),_0x2326f3,_0x32056[_0xe121('0x10')][_0xe121('0x12')]);return _0x5705d1(_0x32056[_0xe121('0x10')][_0xe121('0x12')]);}logger[_0xe121('0x10')](_0xe121('0x11'),_0x2326f3,_0x32056[_0xe121('0x10')][_0xe121('0x12')]);return _0x203b17(_0x32056[_0xe121('0x10')][_0xe121('0x12')]);}else{logger['info']('AnalyticDefaultReport,\x20%s,\x20%s',_0x2326f3,_0xe121('0xe'));_0x203b17(_0x32056[_0xe121('0x13')][_0xe121('0x12')]);}})['catch'](function(_0x1097c0){logger[_0xe121('0x10')](_0xe121('0x11'),_0x2326f3,_0x1097c0);_0x5705d1(_0x1097c0);});});} \ No newline at end of file diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js index 78a147f..938d4fa 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 _0xacc1=['put','/:id','delete','multer','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','get','show','/:id/preview','/:id/run','run','query','post','create'];(function(_0x20fec8,_0x43334d){var _0x2c8d42=function(_0x94c7d6){while(--_0x94c7d6){_0x20fec8['push'](_0x20fec8['shift']());}};_0x2c8d42(++_0x43334d);}(_0xacc1,0x1de));var _0x1acc=function(_0x1f38c5,_0x735642){_0x1f38c5=_0x1f38c5-0x0;var _0x1c58cb=_0xacc1[_0x1f38c5];return _0x1c58cb;};'use strict';var multer=require(_0x1acc('0x0'));var util=require('util');var path=require(_0x1acc('0x1'));var timeout=require(_0x1acc('0x2'));var express=require('express');var router=express[_0x1acc('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1acc('0x4'));var interaction=require(_0x1acc('0x5'));var config=require(_0x1acc('0x6'));var controller=require('./analyticDefaultReport.controller');router['get']('/',auth[_0x1acc('0x7')](),controller['index']);router[_0x1acc('0x8')]('/:id',auth[_0x1acc('0x7')](),controller[_0x1acc('0x9')]);router['get'](_0x1acc('0xa'),auth['isAuthenticated'](),controller['preview']);router[_0x1acc('0x8')](_0x1acc('0xb'),auth['isAuthenticated'](),controller[_0x1acc('0xc')]);router['get']('/:id/query',auth[_0x1acc('0x7')](),controller[_0x1acc('0xd')]);router[_0x1acc('0xe')]('/',auth['isAuthenticated'](),controller[_0x1acc('0xf')]);router[_0x1acc('0x10')](_0x1acc('0x11'),auth['isAuthenticated'](),controller['update']);router[_0x1acc('0x12')](_0x1acc('0x11'),auth[_0x1acc('0x7')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xe367=['fs-extra','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','isAuthenticated','index','get','/:id','show','/:id/preview','preview','/:id/run','run','/:id/query','query','post','create','update','delete','destroy','exports','multer','util','path','Router'];(function(_0x3dc14c,_0x45643e){var _0x5deccc=function(_0x4bc693){while(--_0x4bc693){_0x3dc14c['push'](_0x3dc14c['shift']());}};_0x5deccc(++_0x45643e);}(_0xe367,0x10f));var _0x7e36=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xe367[_0x57b54c];return _0x59cc19;};'use strict';var multer=require(_0x7e36('0x0'));var util=require(_0x7e36('0x1'));var path=require(_0x7e36('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x7e36('0x3')]();var fs_extra=require(_0x7e36('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x7e36('0x5'));var config=require(_0x7e36('0x6'));var controller=require(_0x7e36('0x7'));router['get']('/',auth[_0x7e36('0x8')](),controller[_0x7e36('0x9')]);router[_0x7e36('0xa')](_0x7e36('0xb'),auth[_0x7e36('0x8')](),controller[_0x7e36('0xc')]);router[_0x7e36('0xa')](_0x7e36('0xd'),auth[_0x7e36('0x8')](),controller[_0x7e36('0xe')]);router[_0x7e36('0xa')](_0x7e36('0xf'),auth[_0x7e36('0x8')](),controller[_0x7e36('0x10')]);router['get'](_0x7e36('0x11'),auth[_0x7e36('0x8')](),controller[_0x7e36('0x12')]);router[_0x7e36('0x13')]('/',auth['isAuthenticated'](),controller[_0x7e36('0x14')]);router['put'](_0x7e36('0xb'),auth[_0x7e36('0x8')](),controller[_0x7e36('0x15')]);router[_0x7e36('0x16')]('/:id',auth[_0x7e36('0x8')](),controller[_0x7e36('0x17')]);module[_0x7e36('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 a247b3d..2641557 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 _0x8af4=['DATE','Loading','manual','scheduled','INTEGER','UNSIGNED','sequelize','moment','STRING','ENUM','csv','pdf','xlsx'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x8af4,0x6e));var _0x48af=function(_0x527dc5,_0x1de7e7){_0x527dc5=_0x527dc5-0x0;var _0x216de9=_0x8af4[_0x527dc5];return _0x216de9;};'use strict';var Sequelize=require(_0x48af('0x0'));var moment=require(_0x48af('0x1'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'basename':{'type':Sequelize[_0x48af('0x2')],'allowNull':![]},'output':{'type':Sequelize[_0x48af('0x3')](_0x48af('0x4'),_0x48af('0x5'),_0x48af('0x6')),'allowNull':![],'defaultValue':_0x48af('0x4')},'savename':{'type':Sequelize['STRING'],'allowNull':![]},'startDate':{'type':Sequelize[_0x48af('0x7')]},'endDate':{'type':Sequelize['DATE']},'status':{'type':Sequelize[_0x48af('0x2')],'defaultValue':_0x48af('0x8')},'type':{'type':Sequelize[_0x48af('0x3')](_0x48af('0x9'),_0x48af('0xa')),'allowNull':![],'defaultValue':_0x48af('0x9')},'reportId':{'type':Sequelize[_0x48af('0xb')](0xb)[_0x48af('0xc')]},'reportType':{'type':Sequelize[_0x48af('0x2')]}}; \ No newline at end of file +var _0x1d75=['DATE','Loading','manual','scheduled','INTEGER','UNSIGNED','sequelize','moment','STRING','ENUM','csv','xlsx'];(function(_0x45a6df,_0x500e6f){var _0x4d41e4=function(_0x45e11c){while(--_0x45e11c){_0x45a6df['push'](_0x45a6df['shift']());}};_0x4d41e4(++_0x500e6f);}(_0x1d75,0x7e));var _0x51d7=function(_0x2d6e0e,_0xf37e2d){_0x2d6e0e=_0x2d6e0e-0x0;var _0x4977c6=_0x1d75[_0x2d6e0e];return _0x4977c6;};'use strict';var Sequelize=require(_0x51d7('0x0'));var moment=require(_0x51d7('0x1'));module['exports']={'name':{'type':Sequelize[_0x51d7('0x2')],'allowNull':![]},'basename':{'type':Sequelize[_0x51d7('0x2')],'allowNull':![]},'output':{'type':Sequelize[_0x51d7('0x3')](_0x51d7('0x4'),'pdf',_0x51d7('0x5')),'allowNull':![],'defaultValue':_0x51d7('0x4')},'savename':{'type':Sequelize[_0x51d7('0x2')],'allowNull':![]},'startDate':{'type':Sequelize[_0x51d7('0x6')]},'endDate':{'type':Sequelize['DATE']},'status':{'type':Sequelize[_0x51d7('0x2')],'defaultValue':_0x51d7('0x7')},'type':{'type':Sequelize['ENUM'](_0x51d7('0x8'),_0x51d7('0x9')),'allowNull':![],'defaultValue':_0x51d7('0x8')},'reportId':{'type':Sequelize[_0x51d7('0xa')](0xb)[_0x51d7('0xb')]},'reportType':{'type':Sequelize[_0x51d7('0x2')]}}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js index 789b7a8..c391d90 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 _0x359d=['jsforce','desk.js','papaparse','../../components/auth/service','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','apply','reject','save','update','then','destroy','get','UserProfileResource','error','stack','name','index','map','AnalyticExtractedReport','rawAttributes','fieldName','type','key','model','query','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','include','findAll','rows','catch','show','params','keys','intersection','includeAll','merge','options','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','savename','output','existsSync','join','root','server/files/reports','Sequelize','Report\x20not\x20found\x20or\x20empty','exists','download','%s.%s','toLowerCase','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto'];(function(_0x22d114,_0x2d249b){var _0x17c386=function(_0x398906){while(--_0x398906){_0x22d114['push'](_0x22d114['shift']());}};_0x17c386(++_0x2d249b);}(_0x359d,0xad));var _0xd359=function(_0x1a36a5,_0x746928){_0x1a36a5=_0x1a36a5-0x0;var _0x746243=_0x359d[_0x1a36a5];return _0x746243;};'use strict';var emlformat=require(_0xd359('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd359('0x1'));var jsonpatch=require(_0xd359('0x2'));var rp=require(_0xd359('0x3'));var moment=require(_0xd359('0x4'));var BPromise=require(_0xd359('0x5'));var Mustache=require(_0xd359('0x6'));var util=require(_0xd359('0x7'));var path=require(_0xd359('0x8'));var sox=require(_0xd359('0x9'));var csv=require(_0xd359('0xa'));var ejs=require(_0xd359('0xb'));var fs=require('fs');var fs_extra=require(_0xd359('0xc'));var _=require('lodash');var squel=require(_0xd359('0xd'));var crypto=require(_0xd359('0xe'));var jsforce=require(_0xd359('0xf'));var deskjs=require(_0xd359('0x10'));var toCsv=require(_0xd359('0xa'));var querystring=require('querystring');var Papa=require(_0xd359('0x11'));var Redis=require('ioredis');var authService=require(_0xd359('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd359('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0xd359('0x14'));var config=require(_0xd359('0x15'));var licenseUtil=require(_0xd359('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2e31df,_0x559229){_0x559229=_0x559229||0xcc;return function(_0x88649a){if(_0x88649a){return _0x2e31df[_0xd359('0x17')](_0x559229);}return _0x2e31df[_0xd359('0x18')](_0x559229)[_0xd359('0x19')]();};}function respondWithResult(_0x474735,_0x3e4106){_0x3e4106=_0x3e4106||0xc8;return function(_0x575b00){if(_0x575b00){return _0x474735[_0xd359('0x18')](_0x3e4106)[_0xd359('0x1a')](_0x575b00);}};}function respondWithFilteredResult(_0x58e930,_0x978916){return function(_0x221d5c){if(_0x221d5c){var _0x280df3=typeof _0x978916[_0xd359('0x1b')]===_0xd359('0x1c')&&typeof _0x978916['limit']===_0xd359('0x1c');var _0x3611f0=_0x221d5c[_0xd359('0x1d')];var _0x554fb2=_0x280df3?0x0:_0x978916[_0xd359('0x1b')];var _0x59f11e=_0x280df3?_0x221d5c[_0xd359('0x1d')]:_0x978916[_0xd359('0x1b')]+_0x978916[_0xd359('0x1e')];var _0x508ebe;if(_0x59f11e>=_0x3611f0){_0x59f11e=_0x3611f0;_0x508ebe=0xc8;}else{_0x508ebe=0xce;}_0x58e930[_0xd359('0x18')](_0x508ebe);return _0x58e930['set'](_0xd359('0x1f'),_0x554fb2+'-'+_0x59f11e+'/'+_0x3611f0)['json'](_0x221d5c);}return null;};}function patchUpdates(_0x22cf78){return function(_0x5288e2){try{jsonpatch[_0xd359('0x20')](_0x5288e2,_0x22cf78,!![]);}catch(_0x19a21e){return BPromise[_0xd359('0x21')](_0x19a21e);}return _0x5288e2[_0xd359('0x22')]();};}function saveUpdates(_0x399155,_0x2fac4f){return function(_0x19f7c9){if(_0x19f7c9){return _0x19f7c9[_0xd359('0x23')](_0x399155)[_0xd359('0x24')](function(_0x225a90){return _0x225a90;});}return null;};}function removeEntity(_0x56d6fb,_0x2b8fc8){return function(_0x132b14){if(_0x132b14){return _0x132b14[_0xd359('0x25')]()[_0xd359('0x24')](function(){var _0x18ade4=_0x132b14[_0xd359('0x26')]({'plain':!![]});var _0x1060ea='ExtractedReports';return db[_0xd359('0x27')][_0xd359('0x25')]({'where':{'type':_0x1060ea,'resourceId':_0x18ade4['id']}})[_0xd359('0x24')](function(){return _0x132b14;});})[_0xd359('0x24')](function(){_0x56d6fb['status'](0xcc)[_0xd359('0x19')]();});}};}function handleEntityNotFound(_0x1f825e,_0x2c765a){return function(_0x12b987){if(!_0x12b987){_0x1f825e[_0xd359('0x17')](0x194);}return _0x12b987;};}function handleError(_0x5db7de,_0xe0590a){_0xe0590a=_0xe0590a||0x1f4;return function(_0xadb6e6){logger[_0xd359('0x28')](_0xadb6e6[_0xd359('0x29')]);if(_0xadb6e6[_0xd359('0x2a')]){delete _0xadb6e6['name'];}_0x5db7de['status'](_0xe0590a)['send'](_0xadb6e6);};}exports[_0xd359('0x2b')]=function(_0x13113c,_0x39ec2){var _0x29b929={},_0x92a232={},_0x5f08b4={'count':0x0,'rows':[]};var _0x811fc1=_[_0xd359('0x2c')](db[_0xd359('0x2d')][_0xd359('0x2e')],function(_0xf5ce3e){return{'name':_0xf5ce3e[_0xd359('0x2f')],'type':_0xf5ce3e[_0xd359('0x30')][_0xd359('0x31')]};});_0x92a232[_0xd359('0x32')]=_[_0xd359('0x2c')](_0x811fc1,_0xd359('0x2a'));_0x92a232[_0xd359('0x33')]=_['keys'](_0x13113c[_0xd359('0x33')]);_0x92a232['filters']=_['intersection'](_0x92a232[_0xd359('0x32')],_0x92a232['query']);_0x29b929[_0xd359('0x34')]=_['intersection'](_0x92a232['model'],qs[_0xd359('0x35')](_0x13113c['query'][_0xd359('0x35')]));_0x29b929[_0xd359('0x34')]=_0x29b929[_0xd359('0x34')]['length']?_0x29b929[_0xd359('0x34')]:_0x92a232[_0xd359('0x32')];if(!_0x13113c[_0xd359('0x33')][_0xd359('0x36')](_0xd359('0x37'))){_0x29b929[_0xd359('0x1e')]=qs[_0xd359('0x1e')](_0x13113c[_0xd359('0x33')][_0xd359('0x1e')]);_0x29b929[_0xd359('0x1b')]=qs[_0xd359('0x1b')](_0x13113c[_0xd359('0x33')][_0xd359('0x1b')]);}_0x29b929[_0xd359('0x38')]=qs[_0xd359('0x39')](_0x13113c['query'][_0xd359('0x39')]);_0x29b929[_0xd359('0x3a')]=qs[_0xd359('0x3b')](_[_0xd359('0x3c')](_0x13113c[_0xd359('0x33')],_0x92a232['filters']),_0x811fc1);if(_0x13113c['query'][_0xd359('0x3d')]){_0x29b929[_0xd359('0x3a')]=_['merge'](_0x29b929['where'],{'$or':_['map'](_0x811fc1,function(_0x3e7045){if(_0x3e7045[_0xd359('0x30')]!==_0xd359('0x3e')){var _0x487baa={};_0x487baa[_0x3e7045[_0xd359('0x2a')]]={'$like':'%'+_0x13113c['query'][_0xd359('0x3d')]+'%'};return _0x487baa;}})});}_0x29b929=_['merge']({},_0x29b929,_0x13113c['options']);var _0x2c11d5={'where':_0x29b929['where']};return db[_0xd359('0x2d')]['count'](_0x2c11d5)[_0xd359('0x24')](function(_0xf41ffd){_0x5f08b4[_0xd359('0x1d')]=_0xf41ffd;if(_0x13113c[_0xd359('0x33')]['includeAll']){_0x29b929[_0xd359('0x3f')]=[{'all':!![]}];}return db[_0xd359('0x2d')][_0xd359('0x40')](_0x29b929);})[_0xd359('0x24')](function(_0x4cc363){_0x5f08b4[_0xd359('0x41')]=_0x4cc363;return _0x5f08b4;})[_0xd359('0x24')](respondWithFilteredResult(_0x39ec2,_0x29b929))[_0xd359('0x42')](handleError(_0x39ec2,null));};exports[_0xd359('0x43')]=function(_0x2d0e2d,_0x5d56c1){var _0xe4ebcd={'raw':!![],'where':{'id':_0x2d0e2d[_0xd359('0x44')]['id']}},_0x3b5332={};_0x3b5332[_0xd359('0x32')]=_[_0xd359('0x45')](db['AnalyticExtractedReport'][_0xd359('0x2e')]);_0x3b5332[_0xd359('0x33')]=_[_0xd359('0x45')](_0x2d0e2d[_0xd359('0x33')]);_0x3b5332[_0xd359('0x3b')]=_[_0xd359('0x46')](_0x3b5332[_0xd359('0x32')],_0x3b5332[_0xd359('0x33')]);_0xe4ebcd[_0xd359('0x34')]=_[_0xd359('0x46')](_0x3b5332[_0xd359('0x32')],qs[_0xd359('0x35')](_0x2d0e2d[_0xd359('0x33')][_0xd359('0x35')]));_0xe4ebcd[_0xd359('0x34')]=_0xe4ebcd[_0xd359('0x34')]['length']?_0xe4ebcd[_0xd359('0x34')]:_0x3b5332[_0xd359('0x32')];if(_0x2d0e2d[_0xd359('0x33')][_0xd359('0x47')]){_0xe4ebcd['include']=[{'all':!![]}];}_0xe4ebcd=_[_0xd359('0x48')]({},_0xe4ebcd,_0x2d0e2d[_0xd359('0x49')]);return db[_0xd359('0x2d')]['find'](_0xe4ebcd)['then'](handleEntityNotFound(_0x5d56c1,null))[_0xd359('0x24')](respondWithResult(_0x5d56c1,null))[_0xd359('0x42')](handleError(_0x5d56c1,null));};exports[_0xd359('0x4a')]=function(_0x279f19,_0xbbff5){return db[_0xd359('0x2d')]['create'](_0x279f19[_0xd359('0x4b')],{})[_0xd359('0x24')](function(_0x431863){var _0xccd962=_0x279f19['user'][_0xd359('0x26')]({'plain':!![]});if(!_0xccd962)throw new Error(_0xd359('0x4c'));if(_0xccd962[_0xd359('0x4d')]===_0xd359('0x4e')){var _0x22e279=_0x431863[_0xd359('0x26')]({'plain':!![]});var _0x4cd1fe='ExtractedReports';return db['UserProfileSection'][_0xd359('0x4f')]({'where':{'name':_0x4cd1fe,'userProfileId':_0xccd962['userProfileId']},'raw':!![]})[_0xd359('0x24')](function(_0x2be3b0){if(_0x2be3b0&&_0x2be3b0[_0xd359('0x50')]===0x0){return db['UserProfileResource'][_0xd359('0x4a')]({'name':_0x22e279['name'],'resourceId':_0x22e279['id'],'type':_0x2be3b0[_0xd359('0x2a')],'sectionId':_0x2be3b0['id']},{})[_0xd359('0x24')](function(){return _0x431863;});}else{return _0x431863;}})[_0xd359('0x42')](function(_0x373313){logger[_0xd359('0x28')](_0xd359('0x51'),_0x373313);throw _0x373313;});}return _0x431863;})[_0xd359('0x24')](respondWithResult(_0xbbff5,0xc9))['catch'](handleError(_0xbbff5,null));};exports[_0xd359('0x23')]=function(_0x2750bb,_0x70747e){if(_0x2750bb['body']['id']){delete _0x2750bb[_0xd359('0x4b')]['id'];}return db[_0xd359('0x2d')][_0xd359('0x4f')]({'where':{'id':_0x2750bb['params']['id']}})[_0xd359('0x24')](handleEntityNotFound(_0x70747e,null))[_0xd359('0x24')](saveUpdates(_0x2750bb[_0xd359('0x4b')],null))[_0xd359('0x24')](respondWithResult(_0x70747e,null))[_0xd359('0x42')](handleError(_0x70747e,null));};exports[_0xd359('0x25')]=function(_0x4231cf,_0xbe50f){return db[_0xd359('0x2d')]['find']({'where':{'id':_0x4231cf[_0xd359('0x44')]['id']}})['then'](handleEntityNotFound(_0xbe50f,null))[_0xd359('0x24')](removeEntity(_0xbe50f,null))[_0xd359('0x42')](handleError(_0xbe50f,null));};exports['download']=function(_0x4efbe7,_0x541da4,_0x40dd1c){return db[_0xd359('0x2d')][_0xd359('0x4f')]({'where':{'id':_0x4efbe7[_0xd359('0x44')]['id']},'attributes':[_0xd359('0x2a'),'basename',_0xd359('0x52'),_0xd359('0x53')],'raw':!![]})['then'](handleEntityNotFound(_0x541da4,null))['then'](function(_0x45c6b9){if(_0x45c6b9){if(!fs[_0xd359('0x54')](path[_0xd359('0x55')](config[_0xd359('0x56')],_0xd359('0x57'),_0x45c6b9[_0xd359('0x52')]))){throw new db[(_0xd359('0x58'))]['ValidationError'](_0xd359('0x59'));}if(_0x4efbe7[_0xd359('0x33')][_0xd359('0x5a')]){return _0x541da4[_0xd359('0x17')](0xc8);}return _0x541da4[_0xd359('0x5b')](path[_0xd359('0x55')](config[_0xd359('0x56')],_0xd359('0x57'),_0x45c6b9[_0xd359('0x52')]),util['format'](_0xd359('0x5c'),_0x45c6b9['basename']||_0x45c6b9[_0xd359('0x2a')],_0x45c6b9['output'][_0xd359('0x5d')]()));}})[_0xd359('0x42')](handleError(_0x541da4,null));}; \ No newline at end of file +var _0x575b=['then','destroy','get','ExtractedReports','UserProfileResource','end','error','stack','name','send','index','map','AnalyticExtractedReport','rawAttributes','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','params','download','basename','savename','existsSync','join','root','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','server/files/reports','format','toLowerCase','eml-format','rimraf','request-promise','moment','bluebird','mustache','path','sox','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','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','json','offset','count','limit','status','set','Content-Range','reject','save','update'];(function(_0xf51eca,_0x3a458f){var _0x2e7b45=function(_0x1c6d36){while(--_0x1c6d36){_0xf51eca['push'](_0xf51eca['shift']());}};_0x2e7b45(++_0x3a458f);}(_0x575b,0x103));var _0xb575=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x575b[_0x2c91e9];return _0x13f0ff;};'use strict';var emlformat=require(_0xb575('0x0'));var rimraf=require(_0xb575('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xb575('0x2'));var moment=require(_0xb575('0x3'));var BPromise=require(_0xb575('0x4'));var Mustache=require(_0xb575('0x5'));var util=require('util');var path=require(_0xb575('0x6'));var sox=require(_0xb575('0x7'));var csv=require('to-csv');var ejs=require(_0xb575('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb575('0x9'));var squel=require(_0xb575('0xa'));var crypto=require(_0xb575('0xb'));var jsforce=require(_0xb575('0xc'));var deskjs=require(_0xb575('0xd'));var toCsv=require(_0xb575('0xe'));var querystring=require(_0xb575('0xf'));var Papa=require(_0xb575('0x10'));var Redis=require(_0xb575('0x11'));var authService=require(_0xb575('0x12'));var qs=require(_0xb575('0x13'));var as=require(_0xb575('0x14'));var hardwareService=require(_0xb575('0x15'));var logger=require(_0xb575('0x16'))('api');var utils=require(_0xb575('0x17'));var config=require(_0xb575('0x18'));var licenseUtil=require(_0xb575('0x19'));var db=require(_0xb575('0x1a'))['db'];function respondWithStatusCode(_0xe93098,_0x5d6d93){_0x5d6d93=_0x5d6d93||0xcc;return function(_0x554706){if(_0x554706){return _0xe93098[_0xb575('0x1b')](_0x5d6d93);}return _0xe93098['status'](_0x5d6d93)['end']();};}function respondWithResult(_0x9db918,_0x4f206d){_0x4f206d=_0x4f206d||0xc8;return function(_0x4b7c7c){if(_0x4b7c7c){return _0x9db918['status'](_0x4f206d)[_0xb575('0x1c')](_0x4b7c7c);}};}function respondWithFilteredResult(_0x5bce67,_0x5816f9){return function(_0x5376af){if(_0x5376af){var _0x119d63=typeof _0x5816f9[_0xb575('0x1d')]==='undefined'&&typeof _0x5816f9['limit']==='undefined';var _0x685fa1=_0x5376af[_0xb575('0x1e')];var _0xae31a6=_0x119d63?0x0:_0x5816f9[_0xb575('0x1d')];var _0x7b5c23=_0x119d63?_0x5376af[_0xb575('0x1e')]:_0x5816f9[_0xb575('0x1d')]+_0x5816f9[_0xb575('0x1f')];var _0x357e2f;if(_0x7b5c23>=_0x685fa1){_0x7b5c23=_0x685fa1;_0x357e2f=0xc8;}else{_0x357e2f=0xce;}_0x5bce67[_0xb575('0x20')](_0x357e2f);return _0x5bce67[_0xb575('0x21')](_0xb575('0x22'),_0xae31a6+'-'+_0x7b5c23+'/'+_0x685fa1)['json'](_0x5376af);}return null;};}function patchUpdates(_0x19856a){return function(_0x223602){try{jsonpatch['apply'](_0x223602,_0x19856a,!![]);}catch(_0x331c3e){return BPromise[_0xb575('0x23')](_0x331c3e);}return _0x223602[_0xb575('0x24')]();};}function saveUpdates(_0x5548a1,_0x316f80){return function(_0x202cff){if(_0x202cff){return _0x202cff[_0xb575('0x25')](_0x5548a1)[_0xb575('0x26')](function(_0x508f4f){return _0x508f4f;});}return null;};}function removeEntity(_0xe24978,_0x2f9ef7){return function(_0x483a2e){if(_0x483a2e){return _0x483a2e[_0xb575('0x27')]()[_0xb575('0x26')](function(){var _0x3f78c8=_0x483a2e[_0xb575('0x28')]({'plain':!![]});var _0x2d09fd=_0xb575('0x29');return db[_0xb575('0x2a')]['destroy']({'where':{'type':_0x2d09fd,'resourceId':_0x3f78c8['id']}})['then'](function(){return _0x483a2e;});})[_0xb575('0x26')](function(){_0xe24978[_0xb575('0x20')](0xcc)[_0xb575('0x2b')]();});}};}function handleEntityNotFound(_0x3ac9d8,_0x87e503){return function(_0x34390f){if(!_0x34390f){_0x3ac9d8[_0xb575('0x1b')](0x194);}return _0x34390f;};}function handleError(_0x2b2016,_0x404876){_0x404876=_0x404876||0x1f4;return function(_0x412a89){logger[_0xb575('0x2c')](_0x412a89[_0xb575('0x2d')]);if(_0x412a89[_0xb575('0x2e')]){delete _0x412a89[_0xb575('0x2e')];}_0x2b2016[_0xb575('0x20')](_0x404876)[_0xb575('0x2f')](_0x412a89);};}exports[_0xb575('0x30')]=function(_0x25138b,_0x5b3567){var _0x53d668={},_0x307fcd={},_0x599344={'count':0x0,'rows':[]};var _0x4cb195=_[_0xb575('0x31')](db[_0xb575('0x32')][_0xb575('0x33')],function(_0x3b59a8){return{'name':_0x3b59a8['fieldName'],'type':_0x3b59a8[_0xb575('0x34')][_0xb575('0x35')]};});_0x307fcd[_0xb575('0x36')]=_['map'](_0x4cb195,_0xb575('0x2e'));_0x307fcd[_0xb575('0x37')]=_[_0xb575('0x38')](_0x25138b['query']);_0x307fcd['filters']=_[_0xb575('0x39')](_0x307fcd[_0xb575('0x36')],_0x307fcd[_0xb575('0x37')]);_0x53d668[_0xb575('0x3a')]=_[_0xb575('0x39')](_0x307fcd['model'],qs[_0xb575('0x3b')](_0x25138b[_0xb575('0x37')][_0xb575('0x3b')]));_0x53d668['attributes']=_0x53d668[_0xb575('0x3a')][_0xb575('0x3c')]?_0x53d668[_0xb575('0x3a')]:_0x307fcd[_0xb575('0x36')];if(!_0x25138b[_0xb575('0x37')][_0xb575('0x3d')](_0xb575('0x3e'))){_0x53d668['limit']=qs['limit'](_0x25138b[_0xb575('0x37')][_0xb575('0x1f')]);_0x53d668[_0xb575('0x1d')]=qs[_0xb575('0x1d')](_0x25138b[_0xb575('0x37')][_0xb575('0x1d')]);}_0x53d668[_0xb575('0x3f')]=qs[_0xb575('0x40')](_0x25138b['query'][_0xb575('0x40')]);_0x53d668[_0xb575('0x41')]=qs[_0xb575('0x42')](_[_0xb575('0x43')](_0x25138b[_0xb575('0x37')],_0x307fcd[_0xb575('0x42')]),_0x4cb195);if(_0x25138b['query']['filter']){_0x53d668['where']=_[_0xb575('0x44')](_0x53d668['where'],{'$or':_[_0xb575('0x31')](_0x4cb195,function(_0xb38218){if(_0xb38218[_0xb575('0x34')]!==_0xb575('0x45')){var _0x9cf62a={};_0x9cf62a[_0xb38218[_0xb575('0x2e')]]={'$like':'%'+_0x25138b['query'][_0xb575('0x46')]+'%'};return _0x9cf62a;}})});}_0x53d668=_[_0xb575('0x44')]({},_0x53d668,_0x25138b[_0xb575('0x47')]);var _0x484abe={'where':_0x53d668[_0xb575('0x41')]};return db[_0xb575('0x32')][_0xb575('0x1e')](_0x484abe)[_0xb575('0x26')](function(_0x5660cf){_0x599344[_0xb575('0x1e')]=_0x5660cf;if(_0x25138b[_0xb575('0x37')][_0xb575('0x48')]){_0x53d668[_0xb575('0x49')]=[{'all':!![]}];}return db['AnalyticExtractedReport'][_0xb575('0x4a')](_0x53d668);})[_0xb575('0x26')](function(_0x4cc453){_0x599344[_0xb575('0x4b')]=_0x4cc453;return _0x599344;})[_0xb575('0x26')](respondWithFilteredResult(_0x5b3567,_0x53d668))[_0xb575('0x4c')](handleError(_0x5b3567,null));};exports[_0xb575('0x4d')]=function(_0x22845c,_0x15790f){var _0x4b2dd6={'raw':!![],'where':{'id':_0x22845c['params']['id']}},_0x229136={};_0x229136[_0xb575('0x36')]=_['keys'](db[_0xb575('0x32')][_0xb575('0x33')]);_0x229136['query']=_['keys'](_0x22845c[_0xb575('0x37')]);_0x229136['filters']=_[_0xb575('0x39')](_0x229136[_0xb575('0x36')],_0x229136['query']);_0x4b2dd6[_0xb575('0x3a')]=_[_0xb575('0x39')](_0x229136[_0xb575('0x36')],qs[_0xb575('0x3b')](_0x22845c[_0xb575('0x37')][_0xb575('0x3b')]));_0x4b2dd6[_0xb575('0x3a')]=_0x4b2dd6[_0xb575('0x3a')][_0xb575('0x3c')]?_0x4b2dd6[_0xb575('0x3a')]:_0x229136['model'];if(_0x22845c[_0xb575('0x37')]['includeAll']){_0x4b2dd6['include']=[{'all':!![]}];}_0x4b2dd6=_[_0xb575('0x44')]({},_0x4b2dd6,_0x22845c[_0xb575('0x47')]);return db[_0xb575('0x32')][_0xb575('0x4e')](_0x4b2dd6)[_0xb575('0x26')](handleEntityNotFound(_0x15790f,null))[_0xb575('0x26')](respondWithResult(_0x15790f,null))[_0xb575('0x4c')](handleError(_0x15790f,null));};exports['create']=function(_0x4b6300,_0x1c4bfe){return db[_0xb575('0x32')][_0xb575('0x4f')](_0x4b6300[_0xb575('0x50')],{})['then'](function(_0x2fdbfe){var _0x1b6f00=_0x4b6300[_0xb575('0x51')][_0xb575('0x28')]({'plain':!![]});if(!_0x1b6f00)throw new Error(_0xb575('0x52'));if(_0x1b6f00['role']===_0xb575('0x51')){var _0x1c56cb=_0x2fdbfe[_0xb575('0x28')]({'plain':!![]});var _0x16d9b5='ExtractedReports';return db['UserProfileSection']['find']({'where':{'name':_0x16d9b5,'userProfileId':_0x1b6f00[_0xb575('0x53')]},'raw':!![]})['then'](function(_0x533746){if(_0x533746&&_0x533746[_0xb575('0x54')]===0x0){return db[_0xb575('0x2a')][_0xb575('0x4f')]({'name':_0x1c56cb[_0xb575('0x2e')],'resourceId':_0x1c56cb['id'],'type':_0x533746[_0xb575('0x2e')],'sectionId':_0x533746['id']},{})[_0xb575('0x26')](function(){return _0x2fdbfe;});}else{return _0x2fdbfe;}})[_0xb575('0x4c')](function(_0x135cc4){logger[_0xb575('0x2c')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x135cc4);throw _0x135cc4;});}return _0x2fdbfe;})[_0xb575('0x26')](respondWithResult(_0x1c4bfe,0xc9))[_0xb575('0x4c')](handleError(_0x1c4bfe,null));};exports[_0xb575('0x25')]=function(_0x6b879a,_0x59df4b){if(_0x6b879a[_0xb575('0x50')]['id']){delete _0x6b879a[_0xb575('0x50')]['id'];}return db[_0xb575('0x32')][_0xb575('0x4e')]({'where':{'id':_0x6b879a[_0xb575('0x55')]['id']}})[_0xb575('0x26')](handleEntityNotFound(_0x59df4b,null))[_0xb575('0x26')](saveUpdates(_0x6b879a[_0xb575('0x50')],null))[_0xb575('0x26')](respondWithResult(_0x59df4b,null))[_0xb575('0x4c')](handleError(_0x59df4b,null));};exports[_0xb575('0x27')]=function(_0x2db6b4,_0x54195f){return db[_0xb575('0x32')][_0xb575('0x4e')]({'where':{'id':_0x2db6b4['params']['id']}})[_0xb575('0x26')](handleEntityNotFound(_0x54195f,null))['then'](removeEntity(_0x54195f,null))[_0xb575('0x4c')](handleError(_0x54195f,null));};exports[_0xb575('0x56')]=function(_0x49ffb8,_0x3c94b5,_0x3b701f){return db['AnalyticExtractedReport']['find']({'where':{'id':_0x49ffb8['params']['id']},'attributes':[_0xb575('0x2e'),_0xb575('0x57'),_0xb575('0x58'),'output'],'raw':!![]})[_0xb575('0x26')](handleEntityNotFound(_0x3c94b5,null))['then'](function(_0x1b920f){if(_0x1b920f){if(!fs[_0xb575('0x59')](path[_0xb575('0x5a')](config[_0xb575('0x5b')],'server/files/reports',_0x1b920f[_0xb575('0x58')]))){throw new db[(_0xb575('0x5c'))][(_0xb575('0x5d'))](_0xb575('0x5e'));}if(_0x49ffb8[_0xb575('0x37')][_0xb575('0x5f')]){return _0x3c94b5[_0xb575('0x1b')](0xc8);}return _0x3c94b5[_0xb575('0x56')](path[_0xb575('0x5a')](config[_0xb575('0x5b')],_0xb575('0x60'),_0x1b920f[_0xb575('0x58')]),util[_0xb575('0x61')]('%s.%s',_0x1b920f[_0xb575('0x57')]||_0x1b920f[_0xb575('0x2e')],_0x1b920f['output'][_0xb575('0x62')]()));}})['catch'](handleError(_0x3c94b5,null));}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js index 705f88a..2045874 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 _0x8705=['path','rimraf','../../config/environment','./analyticExtractedReport.attributes','exports','define','analytics_extracted_reports','lodash','api','moment','request-promise'];(function(_0x33a2ad,_0x4d7348){var _0x258213=function(_0x570d17){while(--_0x570d17){_0x33a2ad['push'](_0x33a2ad['shift']());}};_0x258213(++_0x4d7348);}(_0x8705,0x130));var _0x5870=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x8705[_0x42cae2];return _0x5f256f;};'use strict';var _=require(_0x5870('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x5870('0x1'));var moment=require(_0x5870('0x2'));var BPromise=require('bluebird');var rp=require(_0x5870('0x3'));var fs=require('fs');var path=require(_0x5870('0x4'));var rimraf=require(_0x5870('0x5'));var config=require(_0x5870('0x6'));var attributes=require(_0x5870('0x7'));module[_0x5870('0x8')]=function(_0x2e2d49,_0x41172c){return _0x2e2d49[_0x5870('0x9')]('AnalyticExtractedReport',attributes,{'tableName':_0x5870('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x85bf=['exports','define','AnalyticExtractedReport','analytics_extracted_reports','lodash','util','../../config/logger','api','moment','rimraf','./analyticExtractedReport.attributes'];(function(_0x46b7ea,_0x50034b){var _0x3f741a=function(_0x42791c){while(--_0x42791c){_0x46b7ea['push'](_0x46b7ea['shift']());}};_0x3f741a(++_0x50034b);}(_0x85bf,0x101));var _0xf85b=function(_0x4b2b7d,_0xc090b6){_0x4b2b7d=_0x4b2b7d-0x0;var _0x41b383=_0x85bf[_0x4b2b7d];return _0x41b383;};'use strict';var _=require(_0xf85b('0x0'));var util=require(_0xf85b('0x1'));var logger=require(_0xf85b('0x2'))(_0xf85b('0x3'));var moment=require(_0xf85b('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xf85b('0x5'));var config=require('../../config/environment');var attributes=require(_0xf85b('0x6'));module[_0xf85b('0x7')]=function(_0x7d137a,_0x42b864){return _0x7d137a[_0xf85b('0x8')](_0xf85b('0x9'),attributes,{'tableName':_0xf85b('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 e6cf3ae..4deeb92 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 _0xa923=['../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','then','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','bluebird','randomstring'];(function(_0x20ef64,_0x4a8fe9){var _0x3707d8=function(_0x5b9a88){while(--_0x5b9a88){_0x20ef64['push'](_0x20ef64['shift']());}};_0x3707d8(++_0x4a8fe9);}(_0xa923,0xcb));var _0x3a92=function(_0x3c6249,_0x4634bf){_0x3c6249=_0x3c6249-0x0;var _0x5d1316=_0xa923[_0x3c6249];return _0x5d1316;};'use strict';var _=require(_0x3a92('0x0'));var util=require(_0x3a92('0x1'));var moment=require('moment');var BPromise=require(_0x3a92('0x2'));var rs=require(_0x3a92('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3a92('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x3a92('0x5'))(_0x3a92('0x6'));var config=require('../../config/environment');var jayson=require(_0x3a92('0x7'));var client=jayson[_0x3a92('0x8')][_0x3a92('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x439138,_0x497a0e,_0x2c8c85){return new BPromise(function(_0x5ce0cd,_0x1119c6){return client[_0x3a92('0xa')](_0x439138,_0x2c8c85)[_0x3a92('0xb')](function(_0x2378f3){logger['info'](_0x3a92('0xc'),_0x497a0e,_0x3a92('0xd'));logger[_0x3a92('0xe')](_0x3a92('0xf'),_0x497a0e,_0x3a92('0xd'),JSON[_0x3a92('0x10')](_0x2378f3));if(_0x2378f3[_0x3a92('0x11')]){if(_0x2378f3['error'][_0x3a92('0x12')]===0x1f4){logger['error'](_0x3a92('0xc'),_0x497a0e,_0x2378f3['error']['message']);return _0x1119c6(_0x2378f3[_0x3a92('0x11')][_0x3a92('0x13')]);}logger[_0x3a92('0x11')](_0x3a92('0xc'),_0x497a0e,_0x2378f3[_0x3a92('0x11')][_0x3a92('0x13')]);return _0x5ce0cd(_0x2378f3['error'][_0x3a92('0x13')]);}else{logger[_0x3a92('0x14')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x497a0e,_0x3a92('0xd'));_0x5ce0cd(_0x2378f3[_0x3a92('0x15')][_0x3a92('0x13')]);}})[_0x3a92('0x16')](function(_0x48a9d9){logger[_0x3a92('0x11')](_0x3a92('0xc'),_0x497a0e,_0x48a9d9);_0x1119c6(_0x48a9d9);});});} \ No newline at end of file +var _0x34f9=['util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','lodash'];(function(_0x4c168b,_0x5ac392){var _0x2d69c5=function(_0x7d0984){while(--_0x7d0984){_0x4c168b['push'](_0x4c168b['shift']());}};_0x2d69c5(++_0x5ac392);}(_0x34f9,0xfb));var _0x934f=function(_0x16e0b3,_0x592962){_0x16e0b3=_0x16e0b3-0x0;var _0x50d7bb=_0x34f9[_0x16e0b3];return _0x50d7bb;};'use strict';var _=require(_0x934f('0x0'));var util=require(_0x934f('0x1'));var moment=require(_0x934f('0x2'));var BPromise=require(_0x934f('0x3'));var rs=require(_0x934f('0x4'));var fs=require('fs');var Redis=require(_0x934f('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x934f('0x6'));var logger=require(_0x934f('0x7'))(_0x934f('0x8'));var config=require(_0x934f('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x934f('0xa')][_0x934f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3176e7,_0x5db9ff,_0x468168){return new BPromise(function(_0x2b83e4,_0x3e4f4a){return client[_0x934f('0xc')](_0x3176e7,_0x468168)[_0x934f('0xd')](function(_0x6512dc){logger[_0x934f('0xe')](_0x934f('0xf'),_0x5db9ff,_0x934f('0x10'));logger[_0x934f('0x11')]('AnalyticExtractedReport,\x20%s,\x20%s,\x20%s',_0x5db9ff,_0x934f('0x10'),JSON['stringify'](_0x6512dc));if(_0x6512dc[_0x934f('0x12')]){if(_0x6512dc[_0x934f('0x12')][_0x934f('0x13')]===0x1f4){logger[_0x934f('0x12')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x5db9ff,_0x6512dc[_0x934f('0x12')][_0x934f('0x14')]);return _0x3e4f4a(_0x6512dc['error']['message']);}logger['error']('AnalyticExtractedReport,\x20%s,\x20%s',_0x5db9ff,_0x6512dc['error'][_0x934f('0x14')]);return _0x2b83e4(_0x6512dc[_0x934f('0x12')]['message']);}else{logger[_0x934f('0xe')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x5db9ff,_0x934f('0x10'));_0x2b83e4(_0x6512dc['result'][_0x934f('0x14')]);}})['catch'](function(_0x4b6631){logger['error'](_0x934f('0xf'),_0x5db9ff,_0x4b6631);_0x3e4f4a(_0x4b6631);});});} \ No newline at end of file diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js index 1181461..2bf433c 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 _0x9d11=['index','/:id','isAuthenticated','show','/:id/download','post','create','put','update','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','get'];(function(_0x34bc30,_0x177cb0){var _0x5706de=function(_0x535a8c){while(--_0x535a8c){_0x34bc30['push'](_0x34bc30['shift']());}};_0x5706de(++_0x177cb0);}(_0x9d11,0xbf));var _0x19d1=function(_0x16eb11,_0x1a2251){_0x16eb11=_0x16eb11-0x0;var _0x3ae7ef=_0x9d11[_0x16eb11];return _0x3ae7ef;};'use strict';var multer=require(_0x19d1('0x0'));var util=require(_0x19d1('0x1'));var path=require(_0x19d1('0x2'));var timeout=require(_0x19d1('0x3'));var express=require(_0x19d1('0x4'));var router=express['Router']();var fs_extra=require(_0x19d1('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x19d1('0x6'));var config=require(_0x19d1('0x7'));var controller=require('./analyticExtractedReport.controller');router[_0x19d1('0x8')]('/',auth['isAuthenticated'](),controller[_0x19d1('0x9')]);router[_0x19d1('0x8')](_0x19d1('0xa'),auth[_0x19d1('0xb')](),controller[_0x19d1('0xc')]);router[_0x19d1('0x8')](_0x19d1('0xd'),auth[_0x19d1('0xb')](),controller['download']);router[_0x19d1('0xe')]('/',auth[_0x19d1('0xb')](),controller[_0x19d1('0xf')]);router[_0x19d1('0x10')]('/:id',auth[_0x19d1('0xb')](),controller[_0x19d1('0x11')]);router['delete'](_0x19d1('0xa'),auth['isAuthenticated'](),controller[_0x19d1('0x12')]);module[_0x19d1('0x13')]=router; \ No newline at end of file +var _0xe828=['post','create','put','/:id','destroy','exports','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','get','index','/:id/download','isAuthenticated'];(function(_0x5ad55f,_0xd03a51){var _0x810e1b=function(_0x2d75f1){while(--_0x2d75f1){_0x5ad55f['push'](_0x5ad55f['shift']());}};_0x810e1b(++_0xd03a51);}(_0xe828,0x78));var _0x8e82=function(_0x5d16e9,_0x167eb0){_0x5d16e9=_0x5d16e9-0x0;var _0x3e7786=_0xe828[_0x5d16e9];return _0x3e7786;};'use strict';var multer=require(_0x8e82('0x0'));var util=require(_0x8e82('0x1'));var path=require('path');var timeout=require(_0x8e82('0x2'));var express=require('express');var router=express[_0x8e82('0x3')]();var fs_extra=require(_0x8e82('0x4'));var auth=require(_0x8e82('0x5'));var interaction=require(_0x8e82('0x6'));var config=require(_0x8e82('0x7'));var controller=require(_0x8e82('0x8'));router[_0x8e82('0x9')]('/',auth['isAuthenticated'](),controller[_0x8e82('0xa')]);router[_0x8e82('0x9')]('/:id',auth['isAuthenticated'](),controller['show']);router['get'](_0x8e82('0xb'),auth[_0x8e82('0xc')](),controller['download']);router[_0x8e82('0xd')]('/',auth[_0x8e82('0xc')](),controller[_0x8e82('0xe')]);router[_0x8e82('0xf')](_0x8e82('0x10'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x8e82('0x10'),auth[_0x8e82('0xc')](),controller[_0x8e82('0x11')]);module[_0x8e82('0x12')]=router; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js index 5b24096..eabde5a 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 _0x976a=['sequelize','exports','STRING','BOOLEAN'];(function(_0xf50820,_0x56f041){var _0x2a9b10=function(_0x33f0f4){while(--_0x33f0f4){_0xf50820['push'](_0xf50820['shift']());}};_0x2a9b10(++_0x56f041);}(_0x976a,0xb4));var _0xa976=function(_0x56f1c4,_0x37fe7f){_0x56f1c4=_0x56f1c4-0x0;var _0xa30a8f=_0x976a[_0x56f1c4];return _0xa30a8f;};'use strict';var Sequelize=require(_0xa976('0x0'));module[_0xa976('0x1')]={'field':{'type':Sequelize['TEXT']},'alias':{'type':Sequelize[_0xa976('0x2')]},'function':{'type':Sequelize['STRING']},'format':{'type':Sequelize[_0xa976('0x2')]},'groupBy':{'type':Sequelize[_0xa976('0x3')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0xa976('0x2')]},'custom':{'type':Sequelize[_0xa976('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0xfa3f=['exports','TEXT','STRING','BOOLEAN','sequelize'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0xfa3f,0x95));var _0xffa3=function(_0x37c2fa,_0xddf1a2){_0x37c2fa=_0x37c2fa-0x0;var _0x3cf918=_0xfa3f[_0x37c2fa];return _0x3cf918;};'use strict';var Sequelize=require(_0xffa3('0x0'));module[_0xffa3('0x1')]={'field':{'type':Sequelize[_0xffa3('0x2')]},'alias':{'type':Sequelize[_0xffa3('0x3')]},'function':{'type':Sequelize['STRING']},'format':{'type':Sequelize[_0xffa3('0x3')]},'groupBy':{'type':Sequelize[_0xffa3('0x4')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0xffa3('0x3')]},'custom':{'type':Sequelize[_0xffa3('0x4')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.controller.js b/server/api/analyticFieldReport/analyticFieldReport.controller.js index 27c2500..69a27f1 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 _0xd61b=['ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','apply','reject','save','update','destroy','then','error','stack','name','send','index','map','AnalyticFieldReport','rawAttributes','type','model','keys','filters','intersection','fields','query','attributes','order','sort','pick','filter','where','VIRTUAL','options','include','findAll','rows','catch','show','params','length','merge','create','bulkCreate','body','find','ids','AnalyticCustomReport','sequelize','transaction','rimraf','zip-dir','request-promise','moment','bluebird','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse'];(function(_0x52285c,_0x200fef){var _0x3b5a1a=function(_0x2d7249){while(--_0x2d7249){_0x52285c['push'](_0x52285c['shift']());}};_0x3b5a1a(++_0x200fef);}(_0xd61b,0x177));var _0xbd61=function(_0x49b0bf,_0x2c50e9){_0x49b0bf=_0x49b0bf-0x0;var _0x4e6b5c=_0xd61b[_0x49b0bf];return _0x4e6b5c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xbd61('0x0'));var zipdir=require(_0xbd61('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xbd61('0x2'));var moment=require(_0xbd61('0x3'));var BPromise=require(_0xbd61('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0xbd61('0x5'));var sox=require(_0xbd61('0x6'));var csv=require(_0xbd61('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbd61('0x8'));var _=require(_0xbd61('0x9'));var squel=require('squel');var crypto=require(_0xbd61('0xa'));var jsforce=require(_0xbd61('0xb'));var deskjs=require(_0xbd61('0xc'));var toCsv=require(_0xbd61('0x7'));var querystring=require(_0xbd61('0xd'));var Papa=require(_0xbd61('0xe'));var Redis=require(_0xbd61('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xbd61('0x10'));var as=require(_0xbd61('0x11'));var hardwareService=require(_0xbd61('0x12'));var logger=require(_0xbd61('0x13'))(_0xbd61('0x14'));var utils=require(_0xbd61('0x15'));var config=require(_0xbd61('0x16'));var licenseUtil=require(_0xbd61('0x17'));var db=require(_0xbd61('0x18'))['db'];function respondWithStatusCode(_0x772861,_0x59d893){_0x59d893=_0x59d893||0xcc;return function(_0x3f4c42){if(_0x3f4c42){return _0x772861[_0xbd61('0x19')](_0x59d893);}return _0x772861[_0xbd61('0x1a')](_0x59d893)[_0xbd61('0x1b')]();};}function respondWithResult(_0x3622e9,_0x1b212f){_0x1b212f=_0x1b212f||0xc8;return function(_0x5c18c5){if(_0x5c18c5){return _0x3622e9[_0xbd61('0x1a')](_0x1b212f)[_0xbd61('0x1c')](_0x5c18c5);}};}function respondWithFilteredResult(_0x1150a8,_0x1b96fc){return function(_0x50b281){if(_0x50b281){var _0x507cce=typeof _0x1b96fc[_0xbd61('0x1d')]===_0xbd61('0x1e')&&typeof _0x1b96fc[_0xbd61('0x1f')]==='undefined';var _0x236903=_0x50b281[_0xbd61('0x20')];var _0x5083c6=_0x507cce?0x0:_0x1b96fc[_0xbd61('0x1d')];var _0x23d0e2=_0x507cce?_0x50b281[_0xbd61('0x20')]:_0x1b96fc[_0xbd61('0x1d')]+_0x1b96fc['limit'];var _0x1bffbd;if(_0x23d0e2>=_0x236903){_0x23d0e2=_0x236903;_0x1bffbd=0xc8;}else{_0x1bffbd=0xce;}_0x1150a8[_0xbd61('0x1a')](_0x1bffbd);return _0x1150a8['set']('Content-Range',_0x5083c6+'-'+_0x23d0e2+'/'+_0x236903)['json'](_0x50b281);}return null;};}function patchUpdates(_0x19d810){return function(_0x5c96d9){try{jsonpatch[_0xbd61('0x21')](_0x5c96d9,_0x19d810,!![]);}catch(_0x22674d){return BPromise[_0xbd61('0x22')](_0x22674d);}return _0x5c96d9[_0xbd61('0x23')]();};}function saveUpdates(_0x27f1ec,_0x22dfe1){return function(_0x5a6d42){if(_0x5a6d42){return _0x5a6d42[_0xbd61('0x24')](_0x27f1ec)['then'](function(_0x10c656){return _0x10c656;});}return null;};}function removeEntity(_0x1721e3,_0x3bb895){return function(_0x59405e){if(_0x59405e){return _0x59405e[_0xbd61('0x25')]()[_0xbd61('0x26')](function(){_0x1721e3['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1c4eaf,_0x394c57){return function(_0x3a2c30){if(!_0x3a2c30){_0x1c4eaf['sendStatus'](0x194);}return _0x3a2c30;};}function handleError(_0x4fce4e,_0x4ec58c){_0x4ec58c=_0x4ec58c||0x1f4;return function(_0x2b4b13){logger[_0xbd61('0x27')](_0x2b4b13[_0xbd61('0x28')]);if(_0x2b4b13['name']){delete _0x2b4b13[_0xbd61('0x29')];}_0x4fce4e['status'](_0x4ec58c)[_0xbd61('0x2a')](_0x2b4b13);};}exports[_0xbd61('0x2b')]=function(_0x341af2,_0x29db5e){var _0x3613d1={},_0x2741c4={},_0x5f0724={'count':0x0,'rows':[]};var _0x1bffa0=_[_0xbd61('0x2c')](db[_0xbd61('0x2d')][_0xbd61('0x2e')],function(_0x316e00){return{'name':_0x316e00['fieldName'],'type':_0x316e00[_0xbd61('0x2f')]['key']};});_0x2741c4[_0xbd61('0x30')]=_[_0xbd61('0x2c')](_0x1bffa0,_0xbd61('0x29'));_0x2741c4['query']=_[_0xbd61('0x31')](_0x341af2['query']);_0x2741c4[_0xbd61('0x32')]=_[_0xbd61('0x33')](_0x2741c4['model'],_0x2741c4['query']);_0x3613d1['attributes']=_['intersection'](_0x2741c4[_0xbd61('0x30')],qs[_0xbd61('0x34')](_0x341af2[_0xbd61('0x35')][_0xbd61('0x34')]));_0x3613d1[_0xbd61('0x36')]=_0x3613d1['attributes']['length']?_0x3613d1[_0xbd61('0x36')]:_0x2741c4[_0xbd61('0x30')];if(!_0x341af2['query']['hasOwnProperty']('nolimit')){_0x3613d1[_0xbd61('0x1f')]=qs[_0xbd61('0x1f')](_0x341af2[_0xbd61('0x35')]['limit']);_0x3613d1[_0xbd61('0x1d')]=qs[_0xbd61('0x1d')](_0x341af2[_0xbd61('0x35')][_0xbd61('0x1d')]);}_0x3613d1[_0xbd61('0x37')]=qs['sort'](_0x341af2['query'][_0xbd61('0x38')]);_0x3613d1['where']=qs[_0xbd61('0x32')](_[_0xbd61('0x39')](_0x341af2[_0xbd61('0x35')],_0x2741c4['filters']),_0x1bffa0);if(_0x341af2[_0xbd61('0x35')][_0xbd61('0x3a')]){_0x3613d1[_0xbd61('0x3b')]=_['merge'](_0x3613d1[_0xbd61('0x3b')],{'$or':_[_0xbd61('0x2c')](_0x1bffa0,function(_0x3b9065){if(_0x3b9065['type']!==_0xbd61('0x3c')){var _0x100cbf={};_0x100cbf[_0x3b9065['name']]={'$like':'%'+_0x341af2[_0xbd61('0x35')][_0xbd61('0x3a')]+'%'};return _0x100cbf;}})});}_0x3613d1=_['merge']({},_0x3613d1,_0x341af2[_0xbd61('0x3d')]);var _0x4b6efc={'where':_0x3613d1[_0xbd61('0x3b')]};return db[_0xbd61('0x2d')][_0xbd61('0x20')](_0x4b6efc)['then'](function(_0x3f29b5){_0x5f0724[_0xbd61('0x20')]=_0x3f29b5;if(_0x341af2[_0xbd61('0x35')]['includeAll']){_0x3613d1[_0xbd61('0x3e')]=[{'all':!![]}];}return db[_0xbd61('0x2d')][_0xbd61('0x3f')](_0x3613d1);})[_0xbd61('0x26')](function(_0x1fe0d8){_0x5f0724[_0xbd61('0x40')]=_0x1fe0d8;return _0x5f0724;})[_0xbd61('0x26')](respondWithFilteredResult(_0x29db5e,_0x3613d1))[_0xbd61('0x41')](handleError(_0x29db5e,null));};exports[_0xbd61('0x42')]=function(_0x326d54,_0x4b1ff4){var _0x2437ce={'raw':![],'where':{'id':_0x326d54[_0xbd61('0x43')]['id']}},_0x545149={};_0x545149[_0xbd61('0x30')]=_[_0xbd61('0x31')](db[_0xbd61('0x2d')][_0xbd61('0x2e')]);_0x545149[_0xbd61('0x35')]=_[_0xbd61('0x31')](_0x326d54['query']);_0x545149[_0xbd61('0x32')]=_[_0xbd61('0x33')](_0x545149[_0xbd61('0x30')],_0x545149['query']);_0x2437ce['attributes']=_[_0xbd61('0x33')](_0x545149['model'],qs[_0xbd61('0x34')](_0x326d54[_0xbd61('0x35')][_0xbd61('0x34')]));_0x2437ce[_0xbd61('0x36')]=_0x2437ce[_0xbd61('0x36')][_0xbd61('0x44')]?_0x2437ce['attributes']:_0x545149[_0xbd61('0x30')];if(_0x326d54[_0xbd61('0x35')]['includeAll']){_0x2437ce[_0xbd61('0x3e')]=[{'all':!![]}];}_0x2437ce=_[_0xbd61('0x45')]({},_0x2437ce,_0x326d54[_0xbd61('0x3d')]);return db[_0xbd61('0x2d')]['find'](_0x2437ce)[_0xbd61('0x26')](handleEntityNotFound(_0x4b1ff4,null))['then'](respondWithResult(_0x4b1ff4,null))[_0xbd61('0x41')](handleError(_0x4b1ff4,null));};exports[_0xbd61('0x46')]=function(_0x3d6fdb,_0x2c44b8){return db[_0xbd61('0x2d')]['create'](_0x3d6fdb['body'],{})[_0xbd61('0x26')](respondWithResult(_0x2c44b8,0xc9))['catch'](handleError(_0x2c44b8,null));};exports['bulkCreate']=function(_0x4ca0f6,_0x321119){return db['AnalyticFieldReport'][_0xbd61('0x47')](_0x4ca0f6[_0xbd61('0x48')],{'raw':![],'individualHooks':!![]})[_0xbd61('0x26')](respondWithResult(_0x321119,0xc9))[_0xbd61('0x41')](handleError(_0x321119,null));};exports[_0xbd61('0x24')]=function(_0x4fc5b6,_0x2f09a8){if(_0x4fc5b6[_0xbd61('0x48')]['id']){delete _0x4fc5b6[_0xbd61('0x48')]['id'];}return db['AnalyticFieldReport'][_0xbd61('0x49')]({'where':{'id':_0x4fc5b6[_0xbd61('0x43')]['id']}})[_0xbd61('0x26')](handleEntityNotFound(_0x2f09a8,null))[_0xbd61('0x26')](saveUpdates(_0x4fc5b6[_0xbd61('0x48')],null))[_0xbd61('0x26')](respondWithResult(_0x2f09a8,null))[_0xbd61('0x41')](handleError(_0x2f09a8,null));};exports[_0xbd61('0x25')]=function(_0x4263ce,_0x58a70c){return db['AnalyticFieldReport'][_0xbd61('0x49')]({'where':{'id':_0x4263ce[_0xbd61('0x43')]['id']}})['then'](handleEntityNotFound(_0x58a70c,null))[_0xbd61('0x26')](removeEntity(_0x58a70c,null))['catch'](handleError(_0x58a70c,null));};exports['bulkDestroy']=function(_0x49f8a5,_0x1bf2e8){return db['AnalyticFieldReport'][_0xbd61('0x25')]({'where':{'id':_0x49f8a5[_0xbd61('0x35')][_0xbd61('0x4a')]||[]},'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x1bf2e8,0xcc))['catch'](handleError(_0x1bf2e8,null));};exports['addFields']=function(_0x4e5983,_0xc8e006,_0x3c7e0b){return db[_0xbd61('0x4b')]['findOne']({'where':{'id':_0x4e5983[_0xbd61('0x43')]['id']}})[_0xbd61('0x26')](handleEntityNotFound(_0xc8e006,null))[_0xbd61('0x26')](function(_0x4ca7b2){if(_0x4ca7b2){return db[_0xbd61('0x4c')][_0xbd61('0x4d')](function(_0x1861b8){return db['AnalyticFieldReport'][_0xbd61('0x25')]({'where':{'CustomReportId':_0x4e5983[_0xbd61('0x43')]['id']},'transaction':_0x1861b8})[_0xbd61('0x26')](function(_0x5cb1e9){var _0x26029b=_[_0xbd61('0x2c')](_0x4e5983[_0xbd61('0x48')],function(_0x17881e){delete _0x17881e['id'];_0x17881e['CustomReportId']=_0x4e5983['params']['id'];return _0x17881e;});return db[_0xbd61('0x2d')]['bulkCreate'](_0x26029b,{'transaction':_0x1861b8});});})[_0xbd61('0x26')](function(){return db[_0xbd61('0x2d')][_0xbd61('0x3f')]({'where':{'CustomReportId':_0x4e5983[_0xbd61('0x43')]['id']}});});}})[_0xbd61('0x26')](respondWithResult(_0xc8e006,null))[_0xbd61('0x41')](handleError(_0xc8e006,null));}; \ No newline at end of file +var _0xef8b=['destroy','sendStatus','error','stack','name','status','index','map','fieldName','key','query','keys','filters','model','attributes','fields','hasOwnProperty','nolimit','offset','order','sort','where','pick','merge','type','VIRTUAL','filter','options','AnalyticFieldReport','includeAll','findAll','rows','catch','show','params','rawAttributes','intersection','length','include','find','create','body','bulkCreate','bulkDestroy','ids','addFields','AnalyticCustomReport','findOne','sequelize','CustomReportId','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','end','json','undefined','limit','count','set','Content-Range','apply','reject','save','update','then'];(function(_0x441862,_0x308548){var _0x52a0e2=function(_0x2c07c1){while(--_0x2c07c1){_0x441862['push'](_0x441862['shift']());}};_0x52a0e2(++_0x308548);}(_0xef8b,0x192));var _0xbef8=function(_0x4429e0,_0xee6f1f){_0x4429e0=_0x4429e0-0x0;var _0x51a5b3=_0xef8b[_0x4429e0];return _0x51a5b3;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xbef8('0x0'));var zipdir=require(_0xbef8('0x1'));var jsonpatch=require(_0xbef8('0x2'));var rp=require(_0xbef8('0x3'));var moment=require(_0xbef8('0x4'));var BPromise=require(_0xbef8('0x5'));var Mustache=require(_0xbef8('0x6'));var util=require(_0xbef8('0x7'));var path=require(_0xbef8('0x8'));var sox=require(_0xbef8('0x9'));var csv=require(_0xbef8('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbef8('0xb'));var _=require(_0xbef8('0xc'));var squel=require(_0xbef8('0xd'));var crypto=require('crypto');var jsforce=require(_0xbef8('0xe'));var deskjs=require(_0xbef8('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xbef8('0x10'));var authService=require(_0xbef8('0x11'));var qs=require(_0xbef8('0x12'));var as=require(_0xbef8('0x13'));var hardwareService=require(_0xbef8('0x14'));var logger=require(_0xbef8('0x15'))(_0xbef8('0x16'));var utils=require(_0xbef8('0x17'));var config=require(_0xbef8('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xbef8('0x19'))['db'];function respondWithStatusCode(_0x345393,_0x311cf5){_0x311cf5=_0x311cf5||0xcc;return function(_0x58b93f){if(_0x58b93f){return _0x345393['sendStatus'](_0x311cf5);}return _0x345393['status'](_0x311cf5)[_0xbef8('0x1a')]();};}function respondWithResult(_0x4924b6,_0x3074ca){_0x3074ca=_0x3074ca||0xc8;return function(_0x2ab1e0){if(_0x2ab1e0){return _0x4924b6['status'](_0x3074ca)[_0xbef8('0x1b')](_0x2ab1e0);}};}function respondWithFilteredResult(_0x542f03,_0x583ba8){return function(_0x2ec530){if(_0x2ec530){var _0x58ce7b=typeof _0x583ba8['offset']===_0xbef8('0x1c')&&typeof _0x583ba8[_0xbef8('0x1d')]===_0xbef8('0x1c');var _0x321ad0=_0x2ec530[_0xbef8('0x1e')];var _0x175891=_0x58ce7b?0x0:_0x583ba8['offset'];var _0x45b64b=_0x58ce7b?_0x2ec530[_0xbef8('0x1e')]:_0x583ba8['offset']+_0x583ba8[_0xbef8('0x1d')];var _0x46c92c;if(_0x45b64b>=_0x321ad0){_0x45b64b=_0x321ad0;_0x46c92c=0xc8;}else{_0x46c92c=0xce;}_0x542f03['status'](_0x46c92c);return _0x542f03[_0xbef8('0x1f')](_0xbef8('0x20'),_0x175891+'-'+_0x45b64b+'/'+_0x321ad0)[_0xbef8('0x1b')](_0x2ec530);}return null;};}function patchUpdates(_0x4e763a){return function(_0x5abdf1){try{jsonpatch[_0xbef8('0x21')](_0x5abdf1,_0x4e763a,!![]);}catch(_0x450de9){return BPromise[_0xbef8('0x22')](_0x450de9);}return _0x5abdf1[_0xbef8('0x23')]();};}function saveUpdates(_0x51540d,_0x54dfe4){return function(_0x34d494){if(_0x34d494){return _0x34d494[_0xbef8('0x24')](_0x51540d)[_0xbef8('0x25')](function(_0x2c426d){return _0x2c426d;});}return null;};}function removeEntity(_0x45755e,_0x5ce920){return function(_0x31cacf){if(_0x31cacf){return _0x31cacf[_0xbef8('0x26')]()[_0xbef8('0x25')](function(){_0x45755e['status'](0xcc)[_0xbef8('0x1a')]();});}};}function handleEntityNotFound(_0x573218,_0xe976a1){return function(_0x5d5f5a){if(!_0x5d5f5a){_0x573218[_0xbef8('0x27')](0x194);}return _0x5d5f5a;};}function handleError(_0x55aa51,_0x2af6df){_0x2af6df=_0x2af6df||0x1f4;return function(_0x566f16){logger[_0xbef8('0x28')](_0x566f16[_0xbef8('0x29')]);if(_0x566f16[_0xbef8('0x2a')]){delete _0x566f16[_0xbef8('0x2a')];}_0x55aa51[_0xbef8('0x2b')](_0x2af6df)['send'](_0x566f16);};}exports[_0xbef8('0x2c')]=function(_0x3b36f3,_0x2ba8ac){var _0x5a982e={},_0x14d651={},_0x1a501e={'count':0x0,'rows':[]};var _0x256e48=_[_0xbef8('0x2d')](db['AnalyticFieldReport']['rawAttributes'],function(_0x2ebe01){return{'name':_0x2ebe01[_0xbef8('0x2e')],'type':_0x2ebe01['type'][_0xbef8('0x2f')]};});_0x14d651['model']=_[_0xbef8('0x2d')](_0x256e48,'name');_0x14d651[_0xbef8('0x30')]=_[_0xbef8('0x31')](_0x3b36f3[_0xbef8('0x30')]);_0x14d651[_0xbef8('0x32')]=_['intersection'](_0x14d651[_0xbef8('0x33')],_0x14d651[_0xbef8('0x30')]);_0x5a982e[_0xbef8('0x34')]=_['intersection'](_0x14d651['model'],qs[_0xbef8('0x35')](_0x3b36f3[_0xbef8('0x30')][_0xbef8('0x35')]));_0x5a982e[_0xbef8('0x34')]=_0x5a982e['attributes']['length']?_0x5a982e[_0xbef8('0x34')]:_0x14d651[_0xbef8('0x33')];if(!_0x3b36f3[_0xbef8('0x30')][_0xbef8('0x36')](_0xbef8('0x37'))){_0x5a982e[_0xbef8('0x1d')]=qs['limit'](_0x3b36f3[_0xbef8('0x30')][_0xbef8('0x1d')]);_0x5a982e[_0xbef8('0x38')]=qs[_0xbef8('0x38')](_0x3b36f3[_0xbef8('0x30')][_0xbef8('0x38')]);}_0x5a982e[_0xbef8('0x39')]=qs[_0xbef8('0x3a')](_0x3b36f3[_0xbef8('0x30')][_0xbef8('0x3a')]);_0x5a982e[_0xbef8('0x3b')]=qs['filters'](_[_0xbef8('0x3c')](_0x3b36f3[_0xbef8('0x30')],_0x14d651['filters']),_0x256e48);if(_0x3b36f3['query']['filter']){_0x5a982e[_0xbef8('0x3b')]=_[_0xbef8('0x3d')](_0x5a982e['where'],{'$or':_[_0xbef8('0x2d')](_0x256e48,function(_0x4c5c16){if(_0x4c5c16[_0xbef8('0x3e')]!==_0xbef8('0x3f')){var _0x274793={};_0x274793[_0x4c5c16[_0xbef8('0x2a')]]={'$like':'%'+_0x3b36f3[_0xbef8('0x30')][_0xbef8('0x40')]+'%'};return _0x274793;}})});}_0x5a982e=_[_0xbef8('0x3d')]({},_0x5a982e,_0x3b36f3[_0xbef8('0x41')]);var _0x207f29={'where':_0x5a982e[_0xbef8('0x3b')]};return db[_0xbef8('0x42')][_0xbef8('0x1e')](_0x207f29)[_0xbef8('0x25')](function(_0x24ef3d){_0x1a501e[_0xbef8('0x1e')]=_0x24ef3d;if(_0x3b36f3[_0xbef8('0x30')][_0xbef8('0x43')]){_0x5a982e['include']=[{'all':!![]}];}return db[_0xbef8('0x42')][_0xbef8('0x44')](_0x5a982e);})['then'](function(_0x4c20ad){_0x1a501e[_0xbef8('0x45')]=_0x4c20ad;return _0x1a501e;})['then'](respondWithFilteredResult(_0x2ba8ac,_0x5a982e))[_0xbef8('0x46')](handleError(_0x2ba8ac,null));};exports[_0xbef8('0x47')]=function(_0x302e11,_0x3cb68f){var _0x480859={'raw':![],'where':{'id':_0x302e11[_0xbef8('0x48')]['id']}},_0x296161={};_0x296161[_0xbef8('0x33')]=_[_0xbef8('0x31')](db[_0xbef8('0x42')][_0xbef8('0x49')]);_0x296161[_0xbef8('0x30')]=_[_0xbef8('0x31')](_0x302e11['query']);_0x296161[_0xbef8('0x32')]=_[_0xbef8('0x4a')](_0x296161[_0xbef8('0x33')],_0x296161[_0xbef8('0x30')]);_0x480859['attributes']=_[_0xbef8('0x4a')](_0x296161[_0xbef8('0x33')],qs[_0xbef8('0x35')](_0x302e11[_0xbef8('0x30')]['fields']));_0x480859[_0xbef8('0x34')]=_0x480859[_0xbef8('0x34')][_0xbef8('0x4b')]?_0x480859[_0xbef8('0x34')]:_0x296161['model'];if(_0x302e11['query'][_0xbef8('0x43')]){_0x480859[_0xbef8('0x4c')]=[{'all':!![]}];}_0x480859=_[_0xbef8('0x3d')]({},_0x480859,_0x302e11['options']);return db[_0xbef8('0x42')][_0xbef8('0x4d')](_0x480859)['then'](handleEntityNotFound(_0x3cb68f,null))[_0xbef8('0x25')](respondWithResult(_0x3cb68f,null))[_0xbef8('0x46')](handleError(_0x3cb68f,null));};exports[_0xbef8('0x4e')]=function(_0x1eae3f,_0x13e576){return db[_0xbef8('0x42')]['create'](_0x1eae3f[_0xbef8('0x4f')],{})[_0xbef8('0x25')](respondWithResult(_0x13e576,0xc9))['catch'](handleError(_0x13e576,null));};exports[_0xbef8('0x50')]=function(_0x2ba522,_0x4fcc66){return db[_0xbef8('0x42')][_0xbef8('0x50')](_0x2ba522[_0xbef8('0x4f')],{'raw':![],'individualHooks':!![]})[_0xbef8('0x25')](respondWithResult(_0x4fcc66,0xc9))[_0xbef8('0x46')](handleError(_0x4fcc66,null));};exports[_0xbef8('0x24')]=function(_0x27babb,_0x65d553){if(_0x27babb['body']['id']){delete _0x27babb['body']['id'];}return db[_0xbef8('0x42')][_0xbef8('0x4d')]({'where':{'id':_0x27babb['params']['id']}})[_0xbef8('0x25')](handleEntityNotFound(_0x65d553,null))[_0xbef8('0x25')](saveUpdates(_0x27babb[_0xbef8('0x4f')],null))[_0xbef8('0x25')](respondWithResult(_0x65d553,null))[_0xbef8('0x46')](handleError(_0x65d553,null));};exports[_0xbef8('0x26')]=function(_0x28724e,_0x7cd16f){return db[_0xbef8('0x42')][_0xbef8('0x4d')]({'where':{'id':_0x28724e[_0xbef8('0x48')]['id']}})[_0xbef8('0x25')](handleEntityNotFound(_0x7cd16f,null))[_0xbef8('0x25')](removeEntity(_0x7cd16f,null))[_0xbef8('0x46')](handleError(_0x7cd16f,null));};exports[_0xbef8('0x51')]=function(_0xf9ba86,_0x3afd53){return db[_0xbef8('0x42')][_0xbef8('0x26')]({'where':{'id':_0xf9ba86[_0xbef8('0x30')][_0xbef8('0x52')]||[]},'raw':![],'individualHooks':!![]})[_0xbef8('0x25')](respondWithResult(_0x3afd53,0xcc))['catch'](handleError(_0x3afd53,null));};exports[_0xbef8('0x53')]=function(_0x20647c,_0x19807f,_0x20e4e7){return db[_0xbef8('0x54')][_0xbef8('0x55')]({'where':{'id':_0x20647c[_0xbef8('0x48')]['id']}})[_0xbef8('0x25')](handleEntityNotFound(_0x19807f,null))[_0xbef8('0x25')](function(_0x38ce49){if(_0x38ce49){return db[_0xbef8('0x56')]['transaction'](function(_0x45541c){return db['AnalyticFieldReport']['destroy']({'where':{'CustomReportId':_0x20647c[_0xbef8('0x48')]['id']},'transaction':_0x45541c})['then'](function(_0x1aa3b3){var _0x1c9df8=_['map'](_0x20647c[_0xbef8('0x4f')],function(_0x12ec30){delete _0x12ec30['id'];_0x12ec30[_0xbef8('0x57')]=_0x20647c[_0xbef8('0x48')]['id'];return _0x12ec30;});return db[_0xbef8('0x42')][_0xbef8('0x50')](_0x1c9df8,{'transaction':_0x45541c});});})['then'](function(){return db['AnalyticFieldReport'][_0xbef8('0x44')]({'where':{'CustomReportId':_0x20647c['params']['id']}});});}})[_0xbef8('0x25')](respondWithResult(_0x19807f,null))[_0xbef8('0x46')](handleError(_0x19807f,null));}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js index 32deb2b..b84f885 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 _0x6206=['bluebird','request-promise','path','rimraf','../../config/environment','./analyticFieldReport.attributes','exports','define','analytics_report_fields','api','moment'];(function(_0x34bf97,_0xc60f9d){var _0x292719=function(_0x31354e){while(--_0x31354e){_0x34bf97['push'](_0x34bf97['shift']());}};_0x292719(++_0xc60f9d);}(_0x6206,0x1e2));var _0x6620=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0x6206[_0x46e363];return _0x3fb059;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x6620('0x0'));var moment=require(_0x6620('0x1'));var BPromise=require(_0x6620('0x2'));var rp=require(_0x6620('0x3'));var fs=require('fs');var path=require(_0x6620('0x4'));var rimraf=require(_0x6620('0x5'));var config=require(_0x6620('0x6'));var attributes=require(_0x6620('0x7'));module[_0x6620('0x8')]=function(_0x5f1784,_0x5d72be){return _0x5f1784[_0x6620('0x9')]('AnalyticFieldReport',attributes,{'tableName':_0x6620('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x77b3=['lodash','../../config/logger','api','request-promise','path','../../config/environment','./analyticFieldReport.attributes','define','AnalyticFieldReport','analytics_report_fields'];(function(_0x2c8d27,_0x545edf){var _0x483507=function(_0x2b577f){while(--_0x2b577f){_0x2c8d27['push'](_0x2c8d27['shift']());}};_0x483507(++_0x545edf);}(_0x77b3,0x1ea));var _0x377b=function(_0x14759f,_0x5c9013){_0x14759f=_0x14759f-0x0;var _0x49dca4=_0x77b3[_0x14759f];return _0x49dca4;};'use strict';var _=require(_0x377b('0x0'));var util=require('util');var logger=require(_0x377b('0x1'))(_0x377b('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x377b('0x3'));var fs=require('fs');var path=require(_0x377b('0x4'));var rimraf=require('rimraf');var config=require(_0x377b('0x5'));var attributes=require(_0x377b('0x6'));module['exports']=function(_0x51c346,_0x532b8e){return _0x51c346[_0x377b('0x7')](_0x377b('0x8'),attributes,{'tableName':_0x377b('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.rpc.js b/server/api/analyticFieldReport/analyticFieldReport.rpc.js index c0e4b98..66dab13 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 _0xaac4=['rpc','../../config/environment','jayson/promise','client','request','then','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x15fbfb,_0xabd290){var _0x322ade=function(_0x15707c){while(--_0x15707c){_0x15fbfb['push'](_0x15fbfb['shift']());}};_0x322ade(++_0xabd290);}(_0xaac4,0x1c6));var _0x4aac=function(_0x4c3851,_0xbebbfd){_0x4c3851=_0x4c3851-0x0;var _0x43a1e2=_0xaac4[_0x4c3851];return _0x43a1e2;};'use strict';var _=require('lodash');var util=require(_0x4aac('0x0'));var moment=require(_0x4aac('0x1'));var BPromise=require('bluebird');var rs=require(_0x4aac('0x2'));var fs=require('fs');var Redis=require(_0x4aac('0x3'));var db=require(_0x4aac('0x4'))['db'];var utils=require(_0x4aac('0x5'));var logger=require('../../config/logger')(_0x4aac('0x6'));var config=require(_0x4aac('0x7'));var jayson=require(_0x4aac('0x8'));var client=jayson[_0x4aac('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x25de9a,_0x3a5528,_0x9d0230){return new BPromise(function(_0x59a6e8,_0xd2ac6f){return client[_0x4aac('0xa')](_0x25de9a,_0x9d0230)[_0x4aac('0xb')](function(_0x21bf56){logger[_0x4aac('0xc')](_0x4aac('0xd'),_0x3a5528,_0x4aac('0xe'));logger[_0x4aac('0xf')](_0x4aac('0x10'),_0x3a5528,_0x4aac('0xe'),JSON[_0x4aac('0x11')](_0x21bf56));if(_0x21bf56[_0x4aac('0x12')]){if(_0x21bf56['error'][_0x4aac('0x13')]===0x1f4){logger[_0x4aac('0x12')](_0x4aac('0xd'),_0x3a5528,_0x21bf56[_0x4aac('0x12')][_0x4aac('0x14')]);return _0xd2ac6f(_0x21bf56[_0x4aac('0x12')][_0x4aac('0x14')]);}logger[_0x4aac('0x12')]('AnalyticFieldReport,\x20%s,\x20%s',_0x3a5528,_0x21bf56[_0x4aac('0x12')][_0x4aac('0x14')]);return _0x59a6e8(_0x21bf56['error'][_0x4aac('0x14')]);}else{logger[_0x4aac('0xc')]('AnalyticFieldReport,\x20%s,\x20%s',_0x3a5528,_0x4aac('0xe'));_0x59a6e8(_0x21bf56[_0x4aac('0x15')][_0x4aac('0x14')]);}})[_0x4aac('0x16')](function(_0xb3932a){logger['error'](_0x4aac('0xd'),_0x3a5528,_0xb3932a);_0xd2ac6f(_0xb3932a);});});} \ No newline at end of file +var _0x8f50=['error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../config/logger','../../config/environment','jayson/promise','http','request','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','stringify'];(function(_0x362a66,_0x67217b){var _0x5c1dae=function(_0x2cdb75){while(--_0x2cdb75){_0x362a66['push'](_0x362a66['shift']());}};_0x5c1dae(++_0x67217b);}(_0x8f50,0x11d));var _0x08f5=function(_0x2c2db7,_0x57de6e){_0x2c2db7=_0x2c2db7-0x0;var _0x4f0e8f=_0x8f50[_0x2c2db7];return _0x4f0e8f;};'use strict';var _=require(_0x08f5('0x0'));var util=require(_0x08f5('0x1'));var moment=require(_0x08f5('0x2'));var BPromise=require('bluebird');var rs=require(_0x08f5('0x3'));var fs=require('fs');var Redis=require(_0x08f5('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x08f5('0x5'))('rpc');var config=require(_0x08f5('0x6'));var jayson=require(_0x08f5('0x7'));var client=jayson['client'][_0x08f5('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4e4e11,_0x45ec53,_0x32ed38){return new BPromise(function(_0x4534bb,_0x3b57ad){return client[_0x08f5('0x9')](_0x4e4e11,_0x32ed38)['then'](function(_0x583912){logger[_0x08f5('0xa')](_0x08f5('0xb'),_0x45ec53,_0x08f5('0xc'));logger[_0x08f5('0xd')]('AnalyticFieldReport,\x20%s,\x20%s,\x20%s',_0x45ec53,_0x08f5('0xc'),JSON[_0x08f5('0xe')](_0x583912));if(_0x583912[_0x08f5('0xf')]){if(_0x583912['error'][_0x08f5('0x10')]===0x1f4){logger[_0x08f5('0xf')]('AnalyticFieldReport,\x20%s,\x20%s',_0x45ec53,_0x583912[_0x08f5('0xf')][_0x08f5('0x11')]);return _0x3b57ad(_0x583912[_0x08f5('0xf')][_0x08f5('0x11')]);}logger[_0x08f5('0xf')](_0x08f5('0xb'),_0x45ec53,_0x583912[_0x08f5('0xf')][_0x08f5('0x11')]);return _0x4534bb(_0x583912[_0x08f5('0xf')]['message']);}else{logger[_0x08f5('0xa')]('AnalyticFieldReport,\x20%s,\x20%s',_0x45ec53,_0x08f5('0xc'));_0x4534bb(_0x583912[_0x08f5('0x12')][_0x08f5('0x11')]);}})[_0x08f5('0x13')](function(_0x1f8048){logger[_0x08f5('0xf')]('AnalyticFieldReport,\x20%s,\x20%s',_0x45ec53,_0x1f8048);_0x3b57ad(_0x1f8048);});});} \ No newline at end of file diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js index 8672800..351eb57 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(_0x14812f,_0x540706){var _0x2bfe2c=function(_0x1154bf){while(--_0x1154bf){_0x14812f['push'](_0x14812f['shift']());}};_0x2bfe2c(++_0x540706);}(_0xa9e0,0x123));var _0x0a9e=function(_0x138f59,_0x1b53fb){_0x138f59=_0x138f59-0x0;var _0x3d114d=_0xa9e0[_0x138f59];return _0x3d114d;};'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(_0x5276ed,_0x3d1ac8){var _0x34d41a=function(_0x5b9264){while(--_0x5b9264){_0x5276ed['push'](_0x5276ed['shift']());}};_0x34d41a(++_0x3d1ac8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x934425,_0x5af72f){_0x934425=_0x934425-0x0;var _0x31d596=_0xa9e0[_0x934425];return _0x31d596;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('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 8d07bd4..ced5199 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 _0x6cb4=['sequelize','exports','STRING','name','TEXT'];(function(_0x525af9,_0x4edd23){var _0x129fbf=function(_0x4f44fe){while(--_0x4f44fe){_0x525af9['push'](_0x525af9['shift']());}};_0x129fbf(++_0x4edd23);}(_0x6cb4,0xff));var _0x46cb=function(_0xcd07d,_0x1d526f){_0xcd07d=_0xcd07d-0x0;var _0x42a024=_0x6cb4[_0xcd07d];return _0x42a024;};'use strict';var Sequelize=require(_0x46cb('0x0'));module[_0x46cb('0x1')]={'name':{'type':Sequelize[_0x46cb('0x2')],'allowNull':![],'unique':_0x46cb('0x3')},'table':{'type':Sequelize[_0x46cb('0x2')]},'metric':{'type':Sequelize[_0x46cb('0x4')]},'description':{'type':Sequelize[_0x46cb('0x2')]}}; \ No newline at end of file +var _0xb58b=['TEXT','exports','STRING','name'];(function(_0x490dd6,_0x45133d){var _0x59b787=function(_0x22b409){while(--_0x22b409){_0x490dd6['push'](_0x490dd6['shift']());}};_0x59b787(++_0x45133d);}(_0xb58b,0x1f1));var _0xbb58=function(_0x487762,_0x44a258){_0x487762=_0x487762-0x0;var _0x4cb9a3=_0xb58b[_0x487762];return _0x4cb9a3;};'use strict';var Sequelize=require('sequelize');module[_0xbb58('0x0')]={'name':{'type':Sequelize[_0xbb58('0x1')],'allowNull':![],'unique':_0xbb58('0x2')},'table':{'type':Sequelize['STRING']},'metric':{'type':Sequelize[_0xbb58('0x3')]},'description':{'type':Sequelize[_0xbb58('0x1')]}}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js index 8732493..345c77a 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 _0x24ca=['find','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','eml-format','zip-dir','fast-json-patch','request-promise','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/utils','../../config/environment','../../mysqldb','status','end','json','limit','undefined','count','offset','set','apply','reject','save','update','then','destroy','get','Metrics','UserProfileResource','sendStatus','error','stack','name','send','map','AnalyticMetric','rawAttributes','fieldName','type','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','params'];(function(_0x176fca,_0x1aa382){var _0x17ac1a=function(_0x305120){while(--_0x305120){_0x176fca['push'](_0x176fca['shift']());}};_0x17ac1a(++_0x1aa382);}(_0x24ca,0x1bc));var _0xa24c=function(_0x5280f4,_0x3c36d0){_0x5280f4=_0x5280f4-0x0;var _0xba93e7=_0x24ca[_0x5280f4];return _0xba93e7;};'use strict';var emlformat=require(_0xa24c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa24c('0x1'));var jsonpatch=require(_0xa24c('0x2'));var rp=require(_0xa24c('0x3'));var moment=require('moment');var BPromise=require(_0xa24c('0x4'));var Mustache=require(_0xa24c('0x5'));var util=require(_0xa24c('0x6'));var path=require(_0xa24c('0x7'));var sox=require(_0xa24c('0x8'));var csv=require(_0xa24c('0x9'));var ejs=require(_0xa24c('0xa'));var fs=require('fs');var fs_extra=require(_0xa24c('0xb'));var _=require(_0xa24c('0xc'));var squel=require(_0xa24c('0xd'));var crypto=require(_0xa24c('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xa24c('0xf'));var toCsv=require(_0xa24c('0x9'));var querystring=require(_0xa24c('0x10'));var Papa=require('papaparse');var Redis=require(_0xa24c('0x11'));var authService=require(_0xa24c('0x12'));var qs=require(_0xa24c('0x13'));var as=require(_0xa24c('0x14'));var hardwareService=require(_0xa24c('0x15'));var logger=require(_0xa24c('0x16'))(_0xa24c('0x17'));var utils=require(_0xa24c('0x18'));var config=require(_0xa24c('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xa24c('0x1a'))['db'];function respondWithStatusCode(_0x11090c,_0xcee4fe){_0xcee4fe=_0xcee4fe||0xcc;return function(_0x2c2af8){if(_0x2c2af8){return _0x11090c['sendStatus'](_0xcee4fe);}return _0x11090c[_0xa24c('0x1b')](_0xcee4fe)[_0xa24c('0x1c')]();};}function respondWithResult(_0x26ff28,_0x2fcd8b){_0x2fcd8b=_0x2fcd8b||0xc8;return function(_0x1cb08e){if(_0x1cb08e){return _0x26ff28[_0xa24c('0x1b')](_0x2fcd8b)[_0xa24c('0x1d')](_0x1cb08e);}};}function respondWithFilteredResult(_0x5d4727,_0x47a063){return function(_0xb80781){if(_0xb80781){var _0x87aa90=typeof _0x47a063['offset']==='undefined'&&typeof _0x47a063[_0xa24c('0x1e')]===_0xa24c('0x1f');var _0x5c479e=_0xb80781[_0xa24c('0x20')];var _0x5de3e6=_0x87aa90?0x0:_0x47a063[_0xa24c('0x21')];var _0x2a610a=_0x87aa90?_0xb80781[_0xa24c('0x20')]:_0x47a063[_0xa24c('0x21')]+_0x47a063['limit'];var _0x16d363;if(_0x2a610a>=_0x5c479e){_0x2a610a=_0x5c479e;_0x16d363=0xc8;}else{_0x16d363=0xce;}_0x5d4727[_0xa24c('0x1b')](_0x16d363);return _0x5d4727[_0xa24c('0x22')]('Content-Range',_0x5de3e6+'-'+_0x2a610a+'/'+_0x5c479e)['json'](_0xb80781);}return null;};}function patchUpdates(_0x506424){return function(_0x4cd77e){try{jsonpatch[_0xa24c('0x23')](_0x4cd77e,_0x506424,!![]);}catch(_0x174b69){return BPromise[_0xa24c('0x24')](_0x174b69);}return _0x4cd77e[_0xa24c('0x25')]();};}function saveUpdates(_0x51a275,_0x30ec21){return function(_0x5f299e){if(_0x5f299e){return _0x5f299e[_0xa24c('0x26')](_0x51a275)[_0xa24c('0x27')](function(_0x4a1cda){return _0x4a1cda;});}return null;};}function removeEntity(_0x346ee8,_0x363d52){return function(_0x43a0c0){if(_0x43a0c0){return _0x43a0c0[_0xa24c('0x28')]()[_0xa24c('0x27')](function(){var _0x47e0eb=_0x43a0c0[_0xa24c('0x29')]({'plain':!![]});var _0x5cc9cb=_0xa24c('0x2a');return db[_0xa24c('0x2b')][_0xa24c('0x28')]({'where':{'type':_0x5cc9cb,'resourceId':_0x47e0eb['id']}})['then'](function(){return _0x43a0c0;});})[_0xa24c('0x27')](function(){_0x346ee8[_0xa24c('0x1b')](0xcc)[_0xa24c('0x1c')]();});}};}function handleEntityNotFound(_0x314121,_0x11e4e0){return function(_0x3ad0e6){if(!_0x3ad0e6){_0x314121[_0xa24c('0x2c')](0x194);}return _0x3ad0e6;};}function handleError(_0x5b23f4,_0xa0c48e){_0xa0c48e=_0xa0c48e||0x1f4;return function(_0x28675f){logger[_0xa24c('0x2d')](_0x28675f[_0xa24c('0x2e')]);if(_0x28675f['name']){delete _0x28675f[_0xa24c('0x2f')];}_0x5b23f4[_0xa24c('0x1b')](_0xa0c48e)[_0xa24c('0x30')](_0x28675f);};}exports['index']=function(_0x15eaaf,_0x3dcb1b){var _0x253d83={},_0x4ae35c={},_0x245fb2={'count':0x0,'rows':[]};var _0x5e0226=_[_0xa24c('0x31')](db[_0xa24c('0x32')][_0xa24c('0x33')],function(_0x5d025a){return{'name':_0x5d025a[_0xa24c('0x34')],'type':_0x5d025a[_0xa24c('0x35')][_0xa24c('0x36')]};});_0x4ae35c['model']=_[_0xa24c('0x31')](_0x5e0226,'name');_0x4ae35c[_0xa24c('0x37')]=_[_0xa24c('0x38')](_0x15eaaf['query']);_0x4ae35c['filters']=_[_0xa24c('0x39')](_0x4ae35c[_0xa24c('0x3a')],_0x4ae35c[_0xa24c('0x37')]);_0x253d83[_0xa24c('0x3b')]=_[_0xa24c('0x39')](_0x4ae35c[_0xa24c('0x3a')],qs[_0xa24c('0x3c')](_0x15eaaf['query'][_0xa24c('0x3c')]));_0x253d83[_0xa24c('0x3b')]=_0x253d83[_0xa24c('0x3b')][_0xa24c('0x3d')]?_0x253d83[_0xa24c('0x3b')]:_0x4ae35c[_0xa24c('0x3a')];if(!_0x15eaaf[_0xa24c('0x37')][_0xa24c('0x3e')](_0xa24c('0x3f'))){_0x253d83[_0xa24c('0x1e')]=qs['limit'](_0x15eaaf[_0xa24c('0x37')][_0xa24c('0x1e')]);_0x253d83[_0xa24c('0x21')]=qs[_0xa24c('0x21')](_0x15eaaf['query']['offset']);}_0x253d83[_0xa24c('0x40')]=qs['sort'](_0x15eaaf[_0xa24c('0x37')][_0xa24c('0x41')]);_0x253d83[_0xa24c('0x42')]=qs[_0xa24c('0x43')](_[_0xa24c('0x44')](_0x15eaaf['query'],_0x4ae35c['filters']),_0x5e0226);if(_0x15eaaf[_0xa24c('0x37')][_0xa24c('0x45')]){_0x253d83[_0xa24c('0x42')]=_[_0xa24c('0x46')](_0x253d83[_0xa24c('0x42')],{'$or':_[_0xa24c('0x31')](_0x5e0226,function(_0x5080d0){if(_0x5080d0['type']!==_0xa24c('0x47')){var _0x1ce83e={};_0x1ce83e[_0x5080d0[_0xa24c('0x2f')]]={'$like':'%'+_0x15eaaf[_0xa24c('0x37')][_0xa24c('0x45')]+'%'};return _0x1ce83e;}})});}_0x253d83=_['merge']({},_0x253d83,_0x15eaaf[_0xa24c('0x48')]);var _0x7895e={'where':_0x253d83['where']};return db['AnalyticMetric'][_0xa24c('0x20')](_0x7895e)[_0xa24c('0x27')](function(_0x231eea){_0x245fb2['count']=_0x231eea;if(_0x15eaaf['query'][_0xa24c('0x49')]){_0x253d83[_0xa24c('0x4a')]=[{'all':!![]}];}return db[_0xa24c('0x32')][_0xa24c('0x4b')](_0x253d83);})[_0xa24c('0x27')](function(_0x1b7faf){_0x245fb2[_0xa24c('0x4c')]=_0x1b7faf;return _0x245fb2;})[_0xa24c('0x27')](respondWithFilteredResult(_0x3dcb1b,_0x253d83))['catch'](handleError(_0x3dcb1b,null));};exports['show']=function(_0x430ba3,_0x44f7d4){var _0x455256={'raw':!![],'where':{'id':_0x430ba3[_0xa24c('0x4d')]['id']}},_0x5972d7={};_0x5972d7[_0xa24c('0x3a')]=_[_0xa24c('0x38')](db[_0xa24c('0x32')][_0xa24c('0x33')]);_0x5972d7[_0xa24c('0x37')]=_[_0xa24c('0x38')](_0x430ba3[_0xa24c('0x37')]);_0x5972d7[_0xa24c('0x43')]=_[_0xa24c('0x39')](_0x5972d7['model'],_0x5972d7[_0xa24c('0x37')]);_0x455256[_0xa24c('0x3b')]=_[_0xa24c('0x39')](_0x5972d7['model'],qs[_0xa24c('0x3c')](_0x430ba3[_0xa24c('0x37')][_0xa24c('0x3c')]));_0x455256[_0xa24c('0x3b')]=_0x455256[_0xa24c('0x3b')][_0xa24c('0x3d')]?_0x455256[_0xa24c('0x3b')]:_0x5972d7[_0xa24c('0x3a')];if(_0x430ba3[_0xa24c('0x37')][_0xa24c('0x49')]){_0x455256[_0xa24c('0x4a')]=[{'all':!![]}];}_0x455256=_['merge']({},_0x455256,_0x430ba3[_0xa24c('0x48')]);return db[_0xa24c('0x32')][_0xa24c('0x4e')](_0x455256)[_0xa24c('0x27')](handleEntityNotFound(_0x44f7d4,null))[_0xa24c('0x27')](respondWithResult(_0x44f7d4,null))[_0xa24c('0x4f')](handleError(_0x44f7d4,null));};exports[_0xa24c('0x50')]=function(_0x2250b9,_0x184179){return db['AnalyticMetric']['create'](_0x2250b9[_0xa24c('0x51')],{})['then'](function(_0xc078ef){var _0x1f436c=_0x2250b9['user'][_0xa24c('0x29')]({'plain':!![]});if(!_0x1f436c)throw new Error(_0xa24c('0x52'));if(_0x1f436c[_0xa24c('0x53')]==='user'){var _0x55978e=_0xc078ef[_0xa24c('0x29')]({'plain':!![]});var _0x5ba726=_0xa24c('0x2a');return db[_0xa24c('0x54')][_0xa24c('0x4e')]({'where':{'name':_0x5ba726,'userProfileId':_0x1f436c[_0xa24c('0x55')]},'raw':!![]})[_0xa24c('0x27')](function(_0x1fa739){if(_0x1fa739&&_0x1fa739[_0xa24c('0x56')]===0x0){return db[_0xa24c('0x2b')][_0xa24c('0x50')]({'name':_0x55978e[_0xa24c('0x2f')],'resourceId':_0x55978e['id'],'type':_0x1fa739['name'],'sectionId':_0x1fa739['id']},{})[_0xa24c('0x27')](function(){return _0xc078ef;});}else{return _0xc078ef;}})[_0xa24c('0x4f')](function(_0x233f8e){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x233f8e);throw _0x233f8e;});}return _0xc078ef;})['then'](respondWithResult(_0x184179,0xc9))[_0xa24c('0x4f')](handleError(_0x184179,null));};exports['update']=function(_0x4757ff,_0x21d0fc){if(_0x4757ff['body']['id']){delete _0x4757ff[_0xa24c('0x51')]['id'];}return db[_0xa24c('0x32')][_0xa24c('0x4e')]({'where':{'id':_0x4757ff[_0xa24c('0x4d')]['id']}})[_0xa24c('0x27')](handleEntityNotFound(_0x21d0fc,null))[_0xa24c('0x27')](saveUpdates(_0x4757ff[_0xa24c('0x51')],null))[_0xa24c('0x27')](respondWithResult(_0x21d0fc,null))['catch'](handleError(_0x21d0fc,null));};exports[_0xa24c('0x28')]=function(_0x47af80,_0x5abd45){return db['AnalyticMetric']['find']({'where':{'id':_0x47af80['params']['id']}})[_0xa24c('0x27')](handleEntityNotFound(_0x5abd45,null))['then'](removeEntity(_0x5abd45,null))[_0xa24c('0x4f')](handleError(_0x5abd45,null));}; \ No newline at end of file +var _0xabce=['includeAll','rows','show','params','intersection','length','include','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','limit','count','offset','Content-Range','apply','reject','save','update','then','get','Metrics','UserProfileResource','destroy','error','stack','name','send','index','map','AnalyticMetric','rawAttributes','fieldName','type','model','keys','query','filters','attributes','fields','hasOwnProperty','nolimit','order','filter','merge','VIRTUAL','options'];(function(_0x3b915f,_0x4ece17){var _0x51853c=function(_0x304608){while(--_0x304608){_0x3b915f['push'](_0x3b915f['shift']());}};_0x51853c(++_0x4ece17);}(_0xabce,0x103));var _0xeabc=function(_0x3ff085,_0x27c92e){_0x3ff085=_0x3ff085-0x0;var _0x2b68c3=_0xabce[_0x3ff085];return _0x2b68c3;};'use strict';var emlformat=require(_0xeabc('0x0'));var rimraf=require(_0xeabc('0x1'));var zipdir=require(_0xeabc('0x2'));var jsonpatch=require(_0xeabc('0x3'));var rp=require(_0xeabc('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xeabc('0x5'));var util=require(_0xeabc('0x6'));var path=require(_0xeabc('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xeabc('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xeabc('0x9'));var squel=require('squel');var crypto=require(_0xeabc('0xa'));var jsforce=require(_0xeabc('0xb'));var deskjs=require(_0xeabc('0xc'));var toCsv=require('to-csv');var querystring=require(_0xeabc('0xd'));var Papa=require(_0xeabc('0xe'));var Redis=require(_0xeabc('0xf'));var authService=require(_0xeabc('0x10'));var qs=require(_0xeabc('0x11'));var as=require(_0xeabc('0x12'));var hardwareService=require(_0xeabc('0x13'));var logger=require(_0xeabc('0x14'))(_0xeabc('0x15'));var utils=require(_0xeabc('0x16'));var config=require(_0xeabc('0x17'));var licenseUtil=require(_0xeabc('0x18'));var db=require(_0xeabc('0x19'))['db'];function respondWithStatusCode(_0x3fd0b5,_0x36a92e){_0x36a92e=_0x36a92e||0xcc;return function(_0xcfbf06){if(_0xcfbf06){return _0x3fd0b5['sendStatus'](_0x36a92e);}return _0x3fd0b5[_0xeabc('0x1a')](_0x36a92e)[_0xeabc('0x1b')]();};}function respondWithResult(_0x3251c6,_0x55f0de){_0x55f0de=_0x55f0de||0xc8;return function(_0x5f4ee8){if(_0x5f4ee8){return _0x3251c6[_0xeabc('0x1a')](_0x55f0de)[_0xeabc('0x1c')](_0x5f4ee8);}};}function respondWithFilteredResult(_0x326bac,_0x53d5cb){return function(_0xf913d7){if(_0xf913d7){var _0x638976=typeof _0x53d5cb['offset']==='undefined'&&typeof _0x53d5cb[_0xeabc('0x1d')]==='undefined';var _0x3d0e21=_0xf913d7[_0xeabc('0x1e')];var _0x58a3c0=_0x638976?0x0:_0x53d5cb[_0xeabc('0x1f')];var _0x31dd53=_0x638976?_0xf913d7[_0xeabc('0x1e')]:_0x53d5cb[_0xeabc('0x1f')]+_0x53d5cb[_0xeabc('0x1d')];var _0x5d92e5;if(_0x31dd53>=_0x3d0e21){_0x31dd53=_0x3d0e21;_0x5d92e5=0xc8;}else{_0x5d92e5=0xce;}_0x326bac[_0xeabc('0x1a')](_0x5d92e5);return _0x326bac['set'](_0xeabc('0x20'),_0x58a3c0+'-'+_0x31dd53+'/'+_0x3d0e21)[_0xeabc('0x1c')](_0xf913d7);}return null;};}function patchUpdates(_0x502947){return function(_0x28063a){try{jsonpatch[_0xeabc('0x21')](_0x28063a,_0x502947,!![]);}catch(_0x254590){return BPromise[_0xeabc('0x22')](_0x254590);}return _0x28063a[_0xeabc('0x23')]();};}function saveUpdates(_0x4e99a4,_0xecdbf){return function(_0x10c675){if(_0x10c675){return _0x10c675[_0xeabc('0x24')](_0x4e99a4)['then'](function(_0x457f27){return _0x457f27;});}return null;};}function removeEntity(_0x3854d2,_0x214953){return function(_0x319119){if(_0x319119){return _0x319119['destroy']()[_0xeabc('0x25')](function(){var _0x480440=_0x319119[_0xeabc('0x26')]({'plain':!![]});var _0x4d4e29=_0xeabc('0x27');return db[_0xeabc('0x28')][_0xeabc('0x29')]({'where':{'type':_0x4d4e29,'resourceId':_0x480440['id']}})[_0xeabc('0x25')](function(){return _0x319119;});})[_0xeabc('0x25')](function(){_0x3854d2[_0xeabc('0x1a')](0xcc)[_0xeabc('0x1b')]();});}};}function handleEntityNotFound(_0x4c2693,_0x5b2934){return function(_0x459c8a){if(!_0x459c8a){_0x4c2693['sendStatus'](0x194);}return _0x459c8a;};}function handleError(_0x3c1b5b,_0x2b342c){_0x2b342c=_0x2b342c||0x1f4;return function(_0x48fb52){logger[_0xeabc('0x2a')](_0x48fb52[_0xeabc('0x2b')]);if(_0x48fb52[_0xeabc('0x2c')]){delete _0x48fb52[_0xeabc('0x2c')];}_0x3c1b5b[_0xeabc('0x1a')](_0x2b342c)[_0xeabc('0x2d')](_0x48fb52);};}exports[_0xeabc('0x2e')]=function(_0x38dc0a,_0x2915c1){var _0x5ebb86={},_0x5b34dd={},_0x5bb1f1={'count':0x0,'rows':[]};var _0x2f03e8=_[_0xeabc('0x2f')](db[_0xeabc('0x30')][_0xeabc('0x31')],function(_0x73c8d4){return{'name':_0x73c8d4[_0xeabc('0x32')],'type':_0x73c8d4[_0xeabc('0x33')]['key']};});_0x5b34dd[_0xeabc('0x34')]=_[_0xeabc('0x2f')](_0x2f03e8,_0xeabc('0x2c'));_0x5b34dd['query']=_[_0xeabc('0x35')](_0x38dc0a[_0xeabc('0x36')]);_0x5b34dd[_0xeabc('0x37')]=_['intersection'](_0x5b34dd[_0xeabc('0x34')],_0x5b34dd[_0xeabc('0x36')]);_0x5ebb86[_0xeabc('0x38')]=_['intersection'](_0x5b34dd[_0xeabc('0x34')],qs[_0xeabc('0x39')](_0x38dc0a['query']['fields']));_0x5ebb86[_0xeabc('0x38')]=_0x5ebb86[_0xeabc('0x38')]['length']?_0x5ebb86[_0xeabc('0x38')]:_0x5b34dd[_0xeabc('0x34')];if(!_0x38dc0a[_0xeabc('0x36')][_0xeabc('0x3a')](_0xeabc('0x3b'))){_0x5ebb86['limit']=qs[_0xeabc('0x1d')](_0x38dc0a['query'][_0xeabc('0x1d')]);_0x5ebb86[_0xeabc('0x1f')]=qs[_0xeabc('0x1f')](_0x38dc0a['query']['offset']);}_0x5ebb86[_0xeabc('0x3c')]=qs['sort'](_0x38dc0a[_0xeabc('0x36')]['sort']);_0x5ebb86['where']=qs['filters'](_['pick'](_0x38dc0a[_0xeabc('0x36')],_0x5b34dd['filters']),_0x2f03e8);if(_0x38dc0a[_0xeabc('0x36')][_0xeabc('0x3d')]){_0x5ebb86['where']=_[_0xeabc('0x3e')](_0x5ebb86['where'],{'$or':_[_0xeabc('0x2f')](_0x2f03e8,function(_0x58aafe){if(_0x58aafe[_0xeabc('0x33')]!==_0xeabc('0x3f')){var _0xeeef02={};_0xeeef02[_0x58aafe['name']]={'$like':'%'+_0x38dc0a['query']['filter']+'%'};return _0xeeef02;}})});}_0x5ebb86=_[_0xeabc('0x3e')]({},_0x5ebb86,_0x38dc0a[_0xeabc('0x40')]);var _0xafa59b={'where':_0x5ebb86['where']};return db['AnalyticMetric'][_0xeabc('0x1e')](_0xafa59b)[_0xeabc('0x25')](function(_0x5e9cb3){_0x5bb1f1[_0xeabc('0x1e')]=_0x5e9cb3;if(_0x38dc0a['query'][_0xeabc('0x41')]){_0x5ebb86['include']=[{'all':!![]}];}return db['AnalyticMetric']['findAll'](_0x5ebb86);})[_0xeabc('0x25')](function(_0x37c926){_0x5bb1f1[_0xeabc('0x42')]=_0x37c926;return _0x5bb1f1;})[_0xeabc('0x25')](respondWithFilteredResult(_0x2915c1,_0x5ebb86))['catch'](handleError(_0x2915c1,null));};exports[_0xeabc('0x43')]=function(_0x555d26,_0x7d5add){var _0x1a4bbe={'raw':!![],'where':{'id':_0x555d26[_0xeabc('0x44')]['id']}},_0x3a7807={};_0x3a7807[_0xeabc('0x34')]=_['keys'](db['AnalyticMetric'][_0xeabc('0x31')]);_0x3a7807['query']=_[_0xeabc('0x35')](_0x555d26[_0xeabc('0x36')]);_0x3a7807['filters']=_[_0xeabc('0x45')](_0x3a7807[_0xeabc('0x34')],_0x3a7807[_0xeabc('0x36')]);_0x1a4bbe[_0xeabc('0x38')]=_[_0xeabc('0x45')](_0x3a7807[_0xeabc('0x34')],qs[_0xeabc('0x39')](_0x555d26['query'][_0xeabc('0x39')]));_0x1a4bbe[_0xeabc('0x38')]=_0x1a4bbe[_0xeabc('0x38')][_0xeabc('0x46')]?_0x1a4bbe[_0xeabc('0x38')]:_0x3a7807[_0xeabc('0x34')];if(_0x555d26[_0xeabc('0x36')][_0xeabc('0x41')]){_0x1a4bbe[_0xeabc('0x47')]=[{'all':!![]}];}_0x1a4bbe=_[_0xeabc('0x3e')]({},_0x1a4bbe,_0x555d26['options']);return db[_0xeabc('0x30')][_0xeabc('0x48')](_0x1a4bbe)[_0xeabc('0x25')](handleEntityNotFound(_0x7d5add,null))[_0xeabc('0x25')](respondWithResult(_0x7d5add,null))[_0xeabc('0x49')](handleError(_0x7d5add,null));};exports[_0xeabc('0x4a')]=function(_0x268d95,_0x48df43){return db[_0xeabc('0x30')][_0xeabc('0x4a')](_0x268d95[_0xeabc('0x4b')],{})[_0xeabc('0x25')](function(_0x47440e){var _0x58e2c1=_0x268d95[_0xeabc('0x4c')][_0xeabc('0x26')]({'plain':!![]});if(!_0x58e2c1)throw new Error(_0xeabc('0x4d'));if(_0x58e2c1[_0xeabc('0x4e')]==='user'){var _0x400b82=_0x47440e[_0xeabc('0x26')]({'plain':!![]});var _0x568847=_0xeabc('0x27');return db['UserProfileSection'][_0xeabc('0x48')]({'where':{'name':_0x568847,'userProfileId':_0x58e2c1['userProfileId']},'raw':!![]})[_0xeabc('0x25')](function(_0x2ec94c){if(_0x2ec94c&&_0x2ec94c[_0xeabc('0x4f')]===0x0){return db[_0xeabc('0x28')][_0xeabc('0x4a')]({'name':_0x400b82[_0xeabc('0x2c')],'resourceId':_0x400b82['id'],'type':_0x2ec94c[_0xeabc('0x2c')],'sectionId':_0x2ec94c['id']},{})[_0xeabc('0x25')](function(){return _0x47440e;});}else{return _0x47440e;}})[_0xeabc('0x49')](function(_0x6423f3){logger['error'](_0xeabc('0x50'),_0x6423f3);throw _0x6423f3;});}return _0x47440e;})[_0xeabc('0x25')](respondWithResult(_0x48df43,0xc9))[_0xeabc('0x49')](handleError(_0x48df43,null));};exports[_0xeabc('0x24')]=function(_0x555d6b,_0x1cef45){if(_0x555d6b[_0xeabc('0x4b')]['id']){delete _0x555d6b[_0xeabc('0x4b')]['id'];}return db[_0xeabc('0x30')]['find']({'where':{'id':_0x555d6b[_0xeabc('0x44')]['id']}})[_0xeabc('0x25')](handleEntityNotFound(_0x1cef45,null))[_0xeabc('0x25')](saveUpdates(_0x555d6b[_0xeabc('0x4b')],null))[_0xeabc('0x25')](respondWithResult(_0x1cef45,null))[_0xeabc('0x49')](handleError(_0x1cef45,null));};exports[_0xeabc('0x29')]=function(_0x3ff38c,_0x17acf8){return db['AnalyticMetric'][_0xeabc('0x48')]({'where':{'id':_0x3ff38c['params']['id']}})['then'](handleEntityNotFound(_0x17acf8,null))['then'](removeEntity(_0x17acf8,null))[_0xeabc('0x49')](handleError(_0x17acf8,null));}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js index 656acc0..7766d42 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 _0xac0a=['bluebird','request-promise','path','rimraf','../../config/environment','./analyticMetric.attributes','exports','define','AnalyticMetric','analytics_metrics','../../config/logger','api'];(function(_0x299e0f,_0x97fa9b){var _0x4a0ac1=function(_0x216fbd){while(--_0x216fbd){_0x299e0f['push'](_0x299e0f['shift']());}};_0x4a0ac1(++_0x97fa9b);}(_0xac0a,0x11e));var _0xaac0=function(_0x5c6b3f,_0xd0d700){_0x5c6b3f=_0x5c6b3f-0x0;var _0x56eabf=_0xac0a[_0x5c6b3f];return _0x56eabf;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xaac0('0x0'))(_0xaac0('0x1'));var moment=require('moment');var BPromise=require(_0xaac0('0x2'));var rp=require(_0xaac0('0x3'));var fs=require('fs');var path=require(_0xaac0('0x4'));var rimraf=require(_0xaac0('0x5'));var config=require(_0xaac0('0x6'));var attributes=require(_0xaac0('0x7'));module[_0xaac0('0x8')]=function(_0x1c92d1,_0x2cefc3){return _0x1c92d1[_0xaac0('0x9')](_0xaac0('0xa'),attributes,{'tableName':_0xaac0('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf722=['exports','AnalyticMetric','analytics_metrics','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./analyticMetric.attributes'];(function(_0x48f683,_0xec583){var _0x13acce=function(_0x26bf13){while(--_0x26bf13){_0x48f683['push'](_0x48f683['shift']());}};_0x13acce(++_0xec583);}(_0xf722,0x18f));var _0x2f72=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xf722[_0x1facfa];return _0x9ec701;};'use strict';var _=require(_0x2f72('0x0'));var util=require(_0x2f72('0x1'));var logger=require(_0x2f72('0x2'))(_0x2f72('0x3'));var moment=require('moment');var BPromise=require(_0x2f72('0x4'));var rp=require(_0x2f72('0x5'));var fs=require('fs');var path=require(_0x2f72('0x6'));var rimraf=require(_0x2f72('0x7'));var config=require('../../config/environment');var attributes=require(_0x2f72('0x8'));module[_0x2f72('0x9')]=function(_0x334168,_0x537e3d){return _0x334168['define'](_0x2f72('0xa'),attributes,{'tableName':_0x2f72('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.rpc.js b/server/api/analyticMetric/analyticMetric.rpc.js index 343857d..fe895f4 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 _0xa53f=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','util','moment','bluebird','ioredis'];(function(_0x2ab0fb,_0xf21f9e){var _0x578c50=function(_0x1223b3){while(--_0x1223b3){_0x2ab0fb['push'](_0x2ab0fb['shift']());}};_0x578c50(++_0xf21f9e);}(_0xa53f,0x160));var _0xfa53=function(_0x43df5b,_0x3fe760){_0x43df5b=_0x43df5b-0x0;var _0x206bfe=_0xa53f[_0x43df5b];return _0x206bfe;};'use strict';var _=require(_0xfa53('0x0'));var util=require(_0xfa53('0x1'));var moment=require(_0xfa53('0x2'));var BPromise=require(_0xfa53('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfa53('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xfa53('0x5'))(_0xfa53('0x6'));var config=require(_0xfa53('0x7'));var jayson=require(_0xfa53('0x8'));var client=jayson[_0xfa53('0x9')][_0xfa53('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5282f9,_0x5d20c8,_0xe75e2f){return new BPromise(function(_0x993cfc,_0x94aab3){return client['request'](_0x5282f9,_0xe75e2f)[_0xfa53('0xb')](function(_0x27e937){logger[_0xfa53('0xc')](_0xfa53('0xd'),_0x5d20c8,_0xfa53('0xe'));logger[_0xfa53('0xf')](_0xfa53('0x10'),_0x5d20c8,_0xfa53('0xe'),JSON[_0xfa53('0x11')](_0x27e937));if(_0x27e937[_0xfa53('0x12')]){if(_0x27e937[_0xfa53('0x12')]['code']===0x1f4){logger[_0xfa53('0x12')](_0xfa53('0xd'),_0x5d20c8,_0x27e937[_0xfa53('0x12')][_0xfa53('0x13')]);return _0x94aab3(_0x27e937[_0xfa53('0x12')][_0xfa53('0x13')]);}logger[_0xfa53('0x12')](_0xfa53('0xd'),_0x5d20c8,_0x27e937[_0xfa53('0x12')][_0xfa53('0x13')]);return _0x993cfc(_0x27e937['error'][_0xfa53('0x13')]);}else{logger['info'](_0xfa53('0xd'),_0x5d20c8,_0xfa53('0xe'));_0x993cfc(_0x27e937[_0xfa53('0x14')]['message']);}})['catch'](function(_0x3d3884){logger['error']('AnalyticMetric,\x20%s,\x20%s',_0x5d20c8,_0x3d3884);_0x94aab3(_0x3d3884);});});} \ No newline at end of file +var _0x896f=['info','request\x20sent','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then'];(function(_0x406a0a,_0x2f256a){var _0x2c8b77=function(_0x236adb){while(--_0x236adb){_0x406a0a['push'](_0x406a0a['shift']());}};_0x2c8b77(++_0x2f256a);}(_0x896f,0x13c));var _0xf896=function(_0x473ee7,_0x4dd754){_0x473ee7=_0x473ee7-0x0;var _0x30f0d4=_0x896f[_0x473ee7];return _0x30f0d4;};'use strict';var _=require(_0xf896('0x0'));var util=require(_0xf896('0x1'));var moment=require(_0xf896('0x2'));var BPromise=require(_0xf896('0x3'));var rs=require(_0xf896('0x4'));var fs=require('fs');var Redis=require(_0xf896('0x5'));var db=require(_0xf896('0x6'))['db'];var utils=require(_0xf896('0x7'));var logger=require(_0xf896('0x8'))(_0xf896('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xf896('0xa')][_0xf896('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xac28c3,_0x491898,_0x2148c4){return new BPromise(function(_0x177118,_0x1c89e7){return client[_0xf896('0xc')](_0xac28c3,_0x2148c4)[_0xf896('0xd')](function(_0x116d47){logger[_0xf896('0xe')]('AnalyticMetric,\x20%s,\x20%s',_0x491898,_0xf896('0xf'));logger['debug'](_0xf896('0x10'),_0x491898,'request\x20sent',JSON[_0xf896('0x11')](_0x116d47));if(_0x116d47['error']){if(_0x116d47[_0xf896('0x12')][_0xf896('0x13')]===0x1f4){logger[_0xf896('0x12')]('AnalyticMetric,\x20%s,\x20%s',_0x491898,_0x116d47[_0xf896('0x12')]['message']);return _0x1c89e7(_0x116d47[_0xf896('0x12')][_0xf896('0x14')]);}logger['error']('AnalyticMetric,\x20%s,\x20%s',_0x491898,_0x116d47[_0xf896('0x12')][_0xf896('0x14')]);return _0x177118(_0x116d47['error'][_0xf896('0x14')]);}else{logger[_0xf896('0xe')]('AnalyticMetric,\x20%s,\x20%s',_0x491898,_0xf896('0xf'));_0x177118(_0x116d47['result'][_0xf896('0x14')]);}})[_0xf896('0x15')](function(_0x34b55e){logger[_0xf896('0x12')]('AnalyticMetric,\x20%s,\x20%s',_0x491898,_0x34b55e);_0x1c89e7(_0x34b55e);});});} \ No newline at end of file diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js index 9defaff..d2ab898 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 _0x9ab0=['show','post','create','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','isAuthenticated','index','get','/:id'];(function(_0x5a585b,_0x3e0674){var _0x4cd398=function(_0x32fbb5){while(--_0x32fbb5){_0x5a585b['push'](_0x5a585b['shift']());}};_0x4cd398(++_0x3e0674);}(_0x9ab0,0x195));var _0x09ab=function(_0x26c81d,_0x15e028){_0x26c81d=_0x26c81d-0x0;var _0x449640=_0x9ab0[_0x26c81d];return _0x449640;};'use strict';var multer=require(_0x09ab('0x0'));var util=require(_0x09ab('0x1'));var path=require(_0x09ab('0x2'));var timeout=require(_0x09ab('0x3'));var express=require(_0x09ab('0x4'));var router=express[_0x09ab('0x5')]();var fs_extra=require(_0x09ab('0x6'));var auth=require(_0x09ab('0x7'));var interaction=require(_0x09ab('0x8'));var config=require('../../config/environment');var controller=require('./analyticMetric.controller');router['get']('/',auth[_0x09ab('0x9')](),controller[_0x09ab('0xa')]);router[_0x09ab('0xb')](_0x09ab('0xc'),auth[_0x09ab('0x9')](),controller[_0x09ab('0xd')]);router[_0x09ab('0xe')]('/',auth[_0x09ab('0x9')](),controller[_0x09ab('0xf')]);router['put'](_0x09ab('0xc'),auth['isAuthenticated'](),controller[_0x09ab('0x10')]);router[_0x09ab('0x11')](_0x09ab('0xc'),auth['isAuthenticated'](),controller['destroy']);module[_0x09ab('0x12')]=router; \ No newline at end of file +var _0x444e=['isAuthenticated','index','/:id','show','create','put','update','delete','multer','path','express','fs-extra','../../components/interaction/service','../../config/environment','./analyticMetric.controller','get'];(function(_0xcc03f6,_0x385ddc){var _0x56ee08=function(_0x3acc76){while(--_0x3acc76){_0xcc03f6['push'](_0xcc03f6['shift']());}};_0x56ee08(++_0x385ddc);}(_0x444e,0xe8));var _0xe444=function(_0x326a3b,_0x817beb){_0x326a3b=_0x326a3b-0x0;var _0x21b10a=_0x444e[_0x326a3b];return _0x21b10a;};'use strict';var multer=require(_0xe444('0x0'));var util=require('util');var path=require(_0xe444('0x1'));var timeout=require('connect-timeout');var express=require(_0xe444('0x2'));var router=express['Router']();var fs_extra=require(_0xe444('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xe444('0x4'));var config=require(_0xe444('0x5'));var controller=require(_0xe444('0x6'));router[_0xe444('0x7')]('/',auth[_0xe444('0x8')](),controller[_0xe444('0x9')]);router['get'](_0xe444('0xa'),auth['isAuthenticated'](),controller[_0xe444('0xb')]);router['post']('/',auth[_0xe444('0x8')](),controller[_0xe444('0xc')]);router[_0xe444('0xd')]('/:id',auth['isAuthenticated'](),controller[_0xe444('0xe')]);router[_0xe444('0xf')]('/:id',auth[_0xe444('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js index f6be2c4..1d1b51b 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 _0x2484=['exports','TEXT','sequelize'];(function(_0x3423a3,_0xf0b12b){var _0x2eb631=function(_0x4c628a){while(--_0x4c628a){_0x3423a3['push'](_0x3423a3['shift']());}};_0x2eb631(++_0xf0b12b);}(_0x2484,0x1af));var _0x4248=function(_0x352b44,_0x4a91a1){_0x352b44=_0x352b44-0x0;var _0x3e8baa=_0x2484[_0x352b44];return _0x3e8baa;};'use strict';var Sequelize=require(_0x4248('0x0'));module[_0x4248('0x1')]={'tree':{'type':Sequelize[_0x4248('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0xb738=['sequelize'];(function(_0x9a4269,_0xba9c5e){var _0x31aa9a=function(_0x2123cd){while(--_0x2123cd){_0x9a4269['push'](_0x9a4269['shift']());}};_0x31aa9a(++_0xba9c5e);}(_0xb738,0x119));var _0x8b73=function(_0x51f5f7,_0x4e1492){_0x51f5f7=_0x51f5f7-0x0;var _0x6afaa=_0xb738[_0x51f5f7];return _0x6afaa;};'use strict';var Sequelize=require(_0x8b73('0x0'));module['exports']={'tree':{'type':Sequelize['TEXT'],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.controller.js b/server/api/analyticTreeReport/analyticTreeReport.controller.js index de9d4a8..3a62851 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 _0x763b=['error','stack','name','send','index','map','AnalyticTreeReport','rawAttributes','fieldName','type','key','query','keys','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','filters','where','filter','merge','options','includeAll','catch','show','length','include','find','create','body','params','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then'];(function(_0xdba73c,_0x17988d){var _0x11a50d=function(_0x50dde1){while(--_0x50dde1){_0xdba73c['push'](_0xdba73c['shift']());}};_0x11a50d(++_0x17988d);}(_0x763b,0x6c));var _0xb763=function(_0x405ac8,_0x3b3dec){_0x405ac8=_0x405ac8-0x0;var _0xbfe2ae=_0x763b[_0x405ac8];return _0xbfe2ae;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb763('0x0'));var zipdir=require(_0xb763('0x1'));var jsonpatch=require(_0xb763('0x2'));var rp=require(_0xb763('0x3'));var moment=require(_0xb763('0x4'));var BPromise=require(_0xb763('0x5'));var Mustache=require(_0xb763('0x6'));var util=require(_0xb763('0x7'));var path=require(_0xb763('0x8'));var sox=require(_0xb763('0x9'));var csv=require(_0xb763('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb763('0xb'));var _=require(_0xb763('0xc'));var squel=require(_0xb763('0xd'));var crypto=require('crypto');var jsforce=require(_0xb763('0xe'));var deskjs=require(_0xb763('0xf'));var toCsv=require(_0xb763('0xa'));var querystring=require(_0xb763('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xb763('0x11'));var hardwareService=require(_0xb763('0x12'));var logger=require(_0xb763('0x13'))(_0xb763('0x14'));var utils=require(_0xb763('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xb763('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x20f605,_0x5adc6e){_0x5adc6e=_0x5adc6e||0xcc;return function(_0x137296){if(_0x137296){return _0x20f605[_0xb763('0x17')](_0x5adc6e);}return _0x20f605[_0xb763('0x18')](_0x5adc6e)[_0xb763('0x19')]();};}function respondWithResult(_0x2895c2,_0x5aaab4){_0x5aaab4=_0x5aaab4||0xc8;return function(_0x9d56b5){if(_0x9d56b5){return _0x2895c2[_0xb763('0x18')](_0x5aaab4)[_0xb763('0x1a')](_0x9d56b5);}};}function respondWithFilteredResult(_0x257069,_0x2d6d47){return function(_0x1ea1ad){if(_0x1ea1ad){var _0x318bbf=typeof _0x2d6d47[_0xb763('0x1b')]===_0xb763('0x1c')&&typeof _0x2d6d47[_0xb763('0x1d')]===_0xb763('0x1c');var _0x44ad61=_0x1ea1ad[_0xb763('0x1e')];var _0x253d6c=_0x318bbf?0x0:_0x2d6d47['offset'];var _0x18248b=_0x318bbf?_0x1ea1ad[_0xb763('0x1e')]:_0x2d6d47['offset']+_0x2d6d47[_0xb763('0x1d')];var _0x1fc91c;if(_0x18248b>=_0x44ad61){_0x18248b=_0x44ad61;_0x1fc91c=0xc8;}else{_0x1fc91c=0xce;}_0x257069[_0xb763('0x18')](_0x1fc91c);return _0x257069[_0xb763('0x1f')](_0xb763('0x20'),_0x253d6c+'-'+_0x18248b+'/'+_0x44ad61)[_0xb763('0x1a')](_0x1ea1ad);}return null;};}function patchUpdates(_0x4ac651){return function(_0x186488){try{jsonpatch[_0xb763('0x21')](_0x186488,_0x4ac651,!![]);}catch(_0x494735){return BPromise[_0xb763('0x22')](_0x494735);}return _0x186488[_0xb763('0x23')]();};}function saveUpdates(_0x141b1e,_0x55b02d){return function(_0x4b759e){if(_0x4b759e){return _0x4b759e[_0xb763('0x24')](_0x141b1e)[_0xb763('0x25')](function(_0x412d38){return _0x412d38;});}return null;};}function removeEntity(_0x1a3123,_0x5c40ce){return function(_0x5c2869){if(_0x5c2869){return _0x5c2869['destroy']()['then'](function(){_0x1a3123[_0xb763('0x18')](0xcc)[_0xb763('0x19')]();});}};}function handleEntityNotFound(_0x27d779,_0x528ed1){return function(_0x44299c){if(!_0x44299c){_0x27d779[_0xb763('0x17')](0x194);}return _0x44299c;};}function handleError(_0x3ffaba,_0x39e5dd){_0x39e5dd=_0x39e5dd||0x1f4;return function(_0x34e062){logger[_0xb763('0x26')](_0x34e062[_0xb763('0x27')]);if(_0x34e062['name']){delete _0x34e062[_0xb763('0x28')];}_0x3ffaba[_0xb763('0x18')](_0x39e5dd)[_0xb763('0x29')](_0x34e062);};}exports[_0xb763('0x2a')]=function(_0x3198b1,_0x2d4e82){var _0x1b2007={},_0x112e3b={},_0x867bbc={'count':0x0,'rows':[]};var _0x1ba599=_[_0xb763('0x2b')](db[_0xb763('0x2c')][_0xb763('0x2d')],function(_0x24fa00){return{'name':_0x24fa00[_0xb763('0x2e')],'type':_0x24fa00[_0xb763('0x2f')][_0xb763('0x30')]};});_0x112e3b['model']=_['map'](_0x1ba599,_0xb763('0x28'));_0x112e3b[_0xb763('0x31')]=_[_0xb763('0x32')](_0x3198b1[_0xb763('0x31')]);_0x112e3b['filters']=_[_0xb763('0x33')](_0x112e3b[_0xb763('0x34')],_0x112e3b[_0xb763('0x31')]);_0x1b2007[_0xb763('0x35')]=_[_0xb763('0x33')](_0x112e3b[_0xb763('0x34')],qs['fields'](_0x3198b1[_0xb763('0x31')][_0xb763('0x36')]));_0x1b2007[_0xb763('0x35')]=_0x1b2007[_0xb763('0x35')]['length']?_0x1b2007[_0xb763('0x35')]:_0x112e3b[_0xb763('0x34')];if(!_0x3198b1[_0xb763('0x31')][_0xb763('0x37')](_0xb763('0x38'))){_0x1b2007[_0xb763('0x1d')]=qs[_0xb763('0x1d')](_0x3198b1['query'][_0xb763('0x1d')]);_0x1b2007[_0xb763('0x1b')]=qs[_0xb763('0x1b')](_0x3198b1[_0xb763('0x31')][_0xb763('0x1b')]);}_0x1b2007[_0xb763('0x39')]=qs[_0xb763('0x3a')](_0x3198b1['query'][_0xb763('0x3a')]);_0x1b2007['where']=qs['filters'](_['pick'](_0x3198b1[_0xb763('0x31')],_0x112e3b[_0xb763('0x3b')]),_0x1ba599);if(_0x3198b1[_0xb763('0x31')]['filter']){_0x1b2007['where']=_['merge'](_0x1b2007[_0xb763('0x3c')],{'$or':_[_0xb763('0x2b')](_0x1ba599,function(_0x425a46){if(_0x425a46[_0xb763('0x2f')]!=='VIRTUAL'){var _0x1b11ae={};_0x1b11ae[_0x425a46[_0xb763('0x28')]]={'$like':'%'+_0x3198b1[_0xb763('0x31')][_0xb763('0x3d')]+'%'};return _0x1b11ae;}})});}_0x1b2007=_[_0xb763('0x3e')]({},_0x1b2007,_0x3198b1[_0xb763('0x3f')]);var _0x596f5={'where':_0x1b2007[_0xb763('0x3c')]};return db[_0xb763('0x2c')][_0xb763('0x1e')](_0x596f5)[_0xb763('0x25')](function(_0xe20ff9){_0x867bbc[_0xb763('0x1e')]=_0xe20ff9;if(_0x3198b1['query'][_0xb763('0x40')]){_0x1b2007['include']=[{'all':!![]}];}return db['AnalyticTreeReport']['findAll'](_0x1b2007);})[_0xb763('0x25')](function(_0x2694bd){_0x867bbc['rows']=_0x2694bd;return _0x867bbc;})[_0xb763('0x25')](respondWithFilteredResult(_0x2d4e82,_0x1b2007))[_0xb763('0x41')](handleError(_0x2d4e82,null));};exports[_0xb763('0x42')]=function(_0x1ba41f,_0x4ce7c0){var _0x2e7128={'raw':!![],'where':{'id':_0x1ba41f['params']['id']}},_0x3c8a7e={};_0x3c8a7e[_0xb763('0x34')]=_[_0xb763('0x32')](db[_0xb763('0x2c')][_0xb763('0x2d')]);_0x3c8a7e[_0xb763('0x31')]=_['keys'](_0x1ba41f[_0xb763('0x31')]);_0x3c8a7e[_0xb763('0x3b')]=_[_0xb763('0x33')](_0x3c8a7e[_0xb763('0x34')],_0x3c8a7e[_0xb763('0x31')]);_0x2e7128[_0xb763('0x35')]=_[_0xb763('0x33')](_0x3c8a7e[_0xb763('0x34')],qs[_0xb763('0x36')](_0x1ba41f[_0xb763('0x31')][_0xb763('0x36')]));_0x2e7128[_0xb763('0x35')]=_0x2e7128[_0xb763('0x35')][_0xb763('0x43')]?_0x2e7128[_0xb763('0x35')]:_0x3c8a7e[_0xb763('0x34')];if(_0x1ba41f[_0xb763('0x31')][_0xb763('0x40')]){_0x2e7128[_0xb763('0x44')]=[{'all':!![]}];}_0x2e7128=_[_0xb763('0x3e')]({},_0x2e7128,_0x1ba41f[_0xb763('0x3f')]);return db[_0xb763('0x2c')][_0xb763('0x45')](_0x2e7128)[_0xb763('0x25')](handleEntityNotFound(_0x4ce7c0,null))[_0xb763('0x25')](respondWithResult(_0x4ce7c0,null))[_0xb763('0x41')](handleError(_0x4ce7c0,null));};exports[_0xb763('0x46')]=function(_0x7a00e1,_0x3940bb){return db['AnalyticTreeReport'][_0xb763('0x46')](_0x7a00e1['body'],{})[_0xb763('0x25')](respondWithResult(_0x3940bb,0xc9))[_0xb763('0x41')](handleError(_0x3940bb,null));};exports[_0xb763('0x24')]=function(_0x110c88,_0x1d6a86){if(_0x110c88[_0xb763('0x47')]['id']){delete _0x110c88[_0xb763('0x47')]['id'];}return db[_0xb763('0x2c')]['find']({'where':{'id':_0x110c88[_0xb763('0x48')]['id']}})['then'](handleEntityNotFound(_0x1d6a86,null))[_0xb763('0x25')](saveUpdates(_0x110c88[_0xb763('0x47')],null))['then'](respondWithResult(_0x1d6a86,null))[_0xb763('0x41')](handleError(_0x1d6a86,null));};exports['destroy']=function(_0x5c47da,_0x453d41){return db[_0xb763('0x2c')][_0xb763('0x45')]({'where':{'id':_0x5c47da[_0xb763('0x48')]['id']}})[_0xb763('0x25')](handleEntityNotFound(_0x453d41,null))[_0xb763('0x25')](removeEntity(_0x453d41,null))[_0xb763('0x41')](handleError(_0x453d41,null));}; \ No newline at end of file +var _0xa156=['attributes','model','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','rows','params','length','includeAll','catch','create','body','find','destroy','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','end','error','stack','name','AnalyticTreeReport','rawAttributes','fieldName','type','key','map','query','keys','filters','intersection','fields'];(function(_0x5b34c6,_0x30f8fe){var _0x4c14b1=function(_0x5edfe9){while(--_0x5edfe9){_0x5b34c6['push'](_0x5b34c6['shift']());}};_0x4c14b1(++_0x30f8fe);}(_0xa156,0x142));var _0x6a15=function(_0x6bbf23,_0x2b7680){_0x6bbf23=_0x6bbf23-0x0;var _0x3b243b=_0xa156[_0x6bbf23];return _0x3b243b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6a15('0x0'));var zipdir=require(_0x6a15('0x1'));var jsonpatch=require(_0x6a15('0x2'));var rp=require(_0x6a15('0x3'));var moment=require(_0x6a15('0x4'));var BPromise=require(_0x6a15('0x5'));var Mustache=require('mustache');var util=require(_0x6a15('0x6'));var path=require(_0x6a15('0x7'));var sox=require('sox');var csv=require(_0x6a15('0x8'));var ejs=require(_0x6a15('0x9'));var fs=require('fs');var fs_extra=require(_0x6a15('0xa'));var _=require(_0x6a15('0xb'));var squel=require(_0x6a15('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x6a15('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x6a15('0xe'));var authService=require(_0x6a15('0xf'));var qs=require(_0x6a15('0x10'));var as=require(_0x6a15('0x11'));var hardwareService=require(_0x6a15('0x12'));var logger=require(_0x6a15('0x13'))(_0x6a15('0x14'));var utils=require(_0x6a15('0x15'));var config=require(_0x6a15('0x16'));var licenseUtil=require(_0x6a15('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2584ae,_0x213d6b){_0x213d6b=_0x213d6b||0xcc;return function(_0x10dfb5){if(_0x10dfb5){return _0x2584ae[_0x6a15('0x18')](_0x213d6b);}return _0x2584ae[_0x6a15('0x19')](_0x213d6b)['end']();};}function respondWithResult(_0x50a5de,_0x3b0326){_0x3b0326=_0x3b0326||0xc8;return function(_0x3bc823){if(_0x3bc823){return _0x50a5de[_0x6a15('0x19')](_0x3b0326)[_0x6a15('0x1a')](_0x3bc823);}};}function respondWithFilteredResult(_0x3481ee,_0x4be13c){return function(_0x250aa9){if(_0x250aa9){var _0x19efb7=typeof _0x4be13c[_0x6a15('0x1b')]===_0x6a15('0x1c')&&typeof _0x4be13c[_0x6a15('0x1d')]===_0x6a15('0x1c');var _0x495561=_0x250aa9[_0x6a15('0x1e')];var _0x1d9087=_0x19efb7?0x0:_0x4be13c[_0x6a15('0x1b')];var _0x204905=_0x19efb7?_0x250aa9['count']:_0x4be13c[_0x6a15('0x1b')]+_0x4be13c['limit'];var _0x522d97;if(_0x204905>=_0x495561){_0x204905=_0x495561;_0x522d97=0xc8;}else{_0x522d97=0xce;}_0x3481ee['status'](_0x522d97);return _0x3481ee[_0x6a15('0x1f')](_0x6a15('0x20'),_0x1d9087+'-'+_0x204905+'/'+_0x495561)['json'](_0x250aa9);}return null;};}function patchUpdates(_0x5244d0){return function(_0x3debaa){try{jsonpatch[_0x6a15('0x21')](_0x3debaa,_0x5244d0,!![]);}catch(_0x165d06){return BPromise[_0x6a15('0x22')](_0x165d06);}return _0x3debaa[_0x6a15('0x23')]();};}function saveUpdates(_0x51c4ad,_0x3839ff){return function(_0x4a714b){if(_0x4a714b){return _0x4a714b[_0x6a15('0x24')](_0x51c4ad)[_0x6a15('0x25')](function(_0x2207d3){return _0x2207d3;});}return null;};}function removeEntity(_0x3b0617,_0x23339d){return function(_0x364ce0){if(_0x364ce0){return _0x364ce0['destroy']()[_0x6a15('0x25')](function(){_0x3b0617['status'](0xcc)[_0x6a15('0x26')]();});}};}function handleEntityNotFound(_0x4d0016,_0x306530){return function(_0x596286){if(!_0x596286){_0x4d0016[_0x6a15('0x18')](0x194);}return _0x596286;};}function handleError(_0x1a877a,_0x54d609){_0x54d609=_0x54d609||0x1f4;return function(_0x349910){logger[_0x6a15('0x27')](_0x349910[_0x6a15('0x28')]);if(_0x349910[_0x6a15('0x29')]){delete _0x349910[_0x6a15('0x29')];}_0x1a877a['status'](_0x54d609)['send'](_0x349910);};}exports['index']=function(_0x270e42,_0xfadf8c){var _0xad57e1={},_0xa942c4={},_0x591b7c={'count':0x0,'rows':[]};var _0x47678d=_['map'](db[_0x6a15('0x2a')][_0x6a15('0x2b')],function(_0x3aa76f){return{'name':_0x3aa76f[_0x6a15('0x2c')],'type':_0x3aa76f[_0x6a15('0x2d')][_0x6a15('0x2e')]};});_0xa942c4['model']=_[_0x6a15('0x2f')](_0x47678d,'name');_0xa942c4[_0x6a15('0x30')]=_[_0x6a15('0x31')](_0x270e42['query']);_0xa942c4[_0x6a15('0x32')]=_['intersection'](_0xa942c4['model'],_0xa942c4['query']);_0xad57e1['attributes']=_[_0x6a15('0x33')](_0xa942c4['model'],qs[_0x6a15('0x34')](_0x270e42[_0x6a15('0x30')][_0x6a15('0x34')]));_0xad57e1[_0x6a15('0x35')]=_0xad57e1['attributes']['length']?_0xad57e1['attributes']:_0xa942c4[_0x6a15('0x36')];if(!_0x270e42[_0x6a15('0x30')][_0x6a15('0x37')](_0x6a15('0x38'))){_0xad57e1[_0x6a15('0x1d')]=qs[_0x6a15('0x1d')](_0x270e42[_0x6a15('0x30')][_0x6a15('0x1d')]);_0xad57e1[_0x6a15('0x1b')]=qs['offset'](_0x270e42[_0x6a15('0x30')]['offset']);}_0xad57e1[_0x6a15('0x39')]=qs[_0x6a15('0x3a')](_0x270e42[_0x6a15('0x30')]['sort']);_0xad57e1[_0x6a15('0x3b')]=qs['filters'](_[_0x6a15('0x3c')](_0x270e42[_0x6a15('0x30')],_0xa942c4[_0x6a15('0x32')]),_0x47678d);if(_0x270e42['query'][_0x6a15('0x3d')]){_0xad57e1[_0x6a15('0x3b')]=_[_0x6a15('0x3e')](_0xad57e1[_0x6a15('0x3b')],{'$or':_[_0x6a15('0x2f')](_0x47678d,function(_0xddfe29){if(_0xddfe29[_0x6a15('0x2d')]!==_0x6a15('0x3f')){var _0x2c145a={};_0x2c145a[_0xddfe29['name']]={'$like':'%'+_0x270e42[_0x6a15('0x30')][_0x6a15('0x3d')]+'%'};return _0x2c145a;}})});}_0xad57e1=_[_0x6a15('0x3e')]({},_0xad57e1,_0x270e42[_0x6a15('0x40')]);var _0x3fc9f5={'where':_0xad57e1[_0x6a15('0x3b')]};return db['AnalyticTreeReport']['count'](_0x3fc9f5)['then'](function(_0x4366be){_0x591b7c[_0x6a15('0x1e')]=_0x4366be;if(_0x270e42[_0x6a15('0x30')]['includeAll']){_0xad57e1[_0x6a15('0x41')]=[{'all':!![]}];}return db[_0x6a15('0x2a')]['findAll'](_0xad57e1);})[_0x6a15('0x25')](function(_0x1f341a){_0x591b7c[_0x6a15('0x42')]=_0x1f341a;return _0x591b7c;})['then'](respondWithFilteredResult(_0xfadf8c,_0xad57e1))['catch'](handleError(_0xfadf8c,null));};exports['show']=function(_0x4e1a61,_0x46c0f0){var _0x99f281={'raw':!![],'where':{'id':_0x4e1a61[_0x6a15('0x43')]['id']}},_0x2855a3={};_0x2855a3[_0x6a15('0x36')]=_[_0x6a15('0x31')](db[_0x6a15('0x2a')]['rawAttributes']);_0x2855a3['query']=_['keys'](_0x4e1a61[_0x6a15('0x30')]);_0x2855a3[_0x6a15('0x32')]=_[_0x6a15('0x33')](_0x2855a3[_0x6a15('0x36')],_0x2855a3[_0x6a15('0x30')]);_0x99f281[_0x6a15('0x35')]=_[_0x6a15('0x33')](_0x2855a3[_0x6a15('0x36')],qs[_0x6a15('0x34')](_0x4e1a61[_0x6a15('0x30')]['fields']));_0x99f281[_0x6a15('0x35')]=_0x99f281[_0x6a15('0x35')][_0x6a15('0x44')]?_0x99f281[_0x6a15('0x35')]:_0x2855a3['model'];if(_0x4e1a61[_0x6a15('0x30')][_0x6a15('0x45')]){_0x99f281[_0x6a15('0x41')]=[{'all':!![]}];}_0x99f281=_[_0x6a15('0x3e')]({},_0x99f281,_0x4e1a61[_0x6a15('0x40')]);return db[_0x6a15('0x2a')]['find'](_0x99f281)['then'](handleEntityNotFound(_0x46c0f0,null))[_0x6a15('0x25')](respondWithResult(_0x46c0f0,null))[_0x6a15('0x46')](handleError(_0x46c0f0,null));};exports[_0x6a15('0x47')]=function(_0x27b5b2,_0x156dcd){return db[_0x6a15('0x2a')][_0x6a15('0x47')](_0x27b5b2['body'],{})[_0x6a15('0x25')](respondWithResult(_0x156dcd,0xc9))[_0x6a15('0x46')](handleError(_0x156dcd,null));};exports[_0x6a15('0x24')]=function(_0xe45f47,_0x45cb98){if(_0xe45f47[_0x6a15('0x48')]['id']){delete _0xe45f47['body']['id'];}return db[_0x6a15('0x2a')][_0x6a15('0x49')]({'where':{'id':_0xe45f47[_0x6a15('0x43')]['id']}})[_0x6a15('0x25')](handleEntityNotFound(_0x45cb98,null))[_0x6a15('0x25')](saveUpdates(_0xe45f47[_0x6a15('0x48')],null))['then'](respondWithResult(_0x45cb98,null))['catch'](handleError(_0x45cb98,null));};exports[_0x6a15('0x4a')]=function(_0x664296,_0x150cee){return db[_0x6a15('0x2a')][_0x6a15('0x49')]({'where':{'id':_0x664296[_0x6a15('0x43')]['id']}})[_0x6a15('0x25')](handleEntityNotFound(_0x150cee,null))[_0x6a15('0x25')](removeEntity(_0x150cee,null))[_0x6a15('0x46')](handleError(_0x150cee,null));}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js index d2fc760..3960939 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 _0x7620=['moment','bluebird','path','rimraf','./analyticTreeReport.attributes','exports','define','AnalyticTreeReport','analytics_report_trees','lodash','util','../../config/logger'];(function(_0x1d6eaa,_0x2531fe){var _0x414a8a=function(_0x47d3b1){while(--_0x47d3b1){_0x1d6eaa['push'](_0x1d6eaa['shift']());}};_0x414a8a(++_0x2531fe);}(_0x7620,0x141));var _0x0762=function(_0x2f0166,_0x2c9892){_0x2f0166=_0x2f0166-0x0;var _0x1ba662=_0x7620[_0x2f0166];return _0x1ba662;};'use strict';var _=require(_0x0762('0x0'));var util=require(_0x0762('0x1'));var logger=require(_0x0762('0x2'))('api');var moment=require(_0x0762('0x3'));var BPromise=require(_0x0762('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0762('0x5'));var rimraf=require(_0x0762('0x6'));var config=require('../../config/environment');var attributes=require(_0x0762('0x7'));module[_0x0762('0x8')]=function(_0x45c3b0,_0x19210f){return _0x45c3b0[_0x0762('0x9')](_0x0762('0xa'),attributes,{'tableName':_0x0762('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x32c2=['AnalyticTreeReport','analytics_report_trees','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./analyticTreeReport.attributes','exports'];(function(_0x34ed48,_0x2cc995){var _0x37da5c=function(_0x5b6e16){while(--_0x5b6e16){_0x34ed48['push'](_0x34ed48['shift']());}};_0x37da5c(++_0x2cc995);}(_0x32c2,0x15e));var _0x232c=function(_0x3084ed,_0x15cf25){_0x3084ed=_0x3084ed-0x0;var _0x426f1f=_0x32c2[_0x3084ed];return _0x426f1f;};'use strict';var _=require('lodash');var util=require(_0x232c('0x0'));var logger=require(_0x232c('0x1'))(_0x232c('0x2'));var moment=require(_0x232c('0x3'));var BPromise=require(_0x232c('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x232c('0x5'));var rimraf=require(_0x232c('0x6'));var config=require(_0x232c('0x7'));var attributes=require(_0x232c('0x8'));module[_0x232c('0x9')]=function(_0x4c098e,_0x283f28){return _0x4c098e['define'](_0x232c('0xa'),attributes,{'tableName':_0x232c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.rpc.js b/server/api/analyticTreeReport/analyticTreeReport.rpc.js index 50a536c..4424137 100644 --- a/server/api/analyticTreeReport/analyticTreeReport.rpc.js +++ b/server/api/analyticTreeReport/analyticTreeReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2ef3=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','AnalyticTreeReport,\x20%s,\x20%s','AnalyticTreeReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment'];(function(_0x23b7e4,_0x1c9417){var _0x40d91b=function(_0x398d53){while(--_0x398d53){_0x23b7e4['push'](_0x23b7e4['shift']());}};_0x40d91b(++_0x1c9417);}(_0x2ef3,0xba));var _0x32ef=function(_0x2f4090,_0xc8a87a){_0x2f4090=_0x2f4090-0x0;var _0x21d41b=_0x2ef3[_0x2f4090];return _0x21d41b;};'use strict';var _=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var moment=require(_0x32ef('0x2'));var BPromise=require(_0x32ef('0x3'));var rs=require(_0x32ef('0x4'));var fs=require('fs');var Redis=require(_0x32ef('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x32ef('0x6'));var logger=require(_0x32ef('0x7'))('rpc');var config=require(_0x32ef('0x8'));var jayson=require(_0x32ef('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2c0089,_0x4bfcf8,_0x367c39){return new BPromise(function(_0x2fb8eb,_0x234863){return client[_0x32ef('0xa')](_0x2c0089,_0x367c39)[_0x32ef('0xb')](function(_0x2bbb50){logger[_0x32ef('0xc')](_0x32ef('0xd'),_0x4bfcf8,'request\x20sent');logger['debug'](_0x32ef('0xe'),_0x4bfcf8,_0x32ef('0xf'),JSON[_0x32ef('0x10')](_0x2bbb50));if(_0x2bbb50[_0x32ef('0x11')]){if(_0x2bbb50['error'][_0x32ef('0x12')]===0x1f4){logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x234863(_0x2bbb50[_0x32ef('0x11')]['message']);}logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x2fb8eb(_0x2bbb50[_0x32ef('0x11')][_0x32ef('0x13')]);}else{logger[_0x32ef('0xc')]('AnalyticTreeReport,\x20%s,\x20%s',_0x4bfcf8,'request\x20sent');_0x2fb8eb(_0x2bbb50['result'][_0x32ef('0x13')]);}})[_0x32ef('0x14')](function(_0xb5aed2){logger['error']('AnalyticTreeReport,\x20%s,\x20%s',_0x4bfcf8,_0xb5aed2);_0x234863(_0xb5aed2);});});} \ No newline at end of file +var _0xadb5=['error','code','message','result','catch','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x159641,_0x292389){var _0x41c53a=function(_0x21dd62){while(--_0x21dd62){_0x159641['push'](_0x159641['shift']());}};_0x41c53a(++_0x292389);}(_0xadb5,0xad));var _0x5adb=function(_0x3b84aa,_0x10c4bf){_0x3b84aa=_0x3b84aa-0x0;var _0xd7afda=_0xadb5[_0x3b84aa];return _0xd7afda;};'use strict';var _=require('lodash');var util=require(_0x5adb('0x0'));var moment=require('moment');var BPromise=require(_0x5adb('0x1'));var rs=require(_0x5adb('0x2'));var fs=require('fs');var Redis=require(_0x5adb('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5adb('0x4'));var logger=require(_0x5adb('0x5'))(_0x5adb('0x6'));var config=require('../../config/environment');var jayson=require(_0x5adb('0x7'));var client=jayson[_0x5adb('0x8')][_0x5adb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3213e8,_0xdf3776,_0x353885){return new BPromise(function(_0x47228a,_0x6d1b45){return client[_0x5adb('0xa')](_0x3213e8,_0x353885)[_0x5adb('0xb')](function(_0x34f59d){logger[_0x5adb('0xc')](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));logger['debug']('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0xdf3776,_0x5adb('0xe'),JSON[_0x5adb('0xf')](_0x34f59d));if(_0x34f59d[_0x5adb('0x10')]){if(_0x34f59d['error'][_0x5adb('0x11')]===0x1f4){logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d['error'][_0x5adb('0x12')]);return _0x6d1b45(_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);}logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);return _0x47228a(_0x34f59d['error'][_0x5adb('0x12')]);}else{logger['info'](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));_0x47228a(_0x34f59d[_0x5adb('0x13')][_0x5adb('0x12')]);}})[_0x5adb('0x14')](function(_0x39d24d){logger[_0x5adb('0x10')](_0x5adb('0xd'),_0xdf3776,_0x39d24d);_0x6d1b45(_0x39d24d);});});} \ No newline at end of file diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js index 509d0ac..6187aab 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 _0x1eb1=['fs-extra','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','get','isAuthenticated','/:id','show','post','create','put','update','delete','destroy','util','path','connect-timeout','Router'];(function(_0x3a7485,_0xa7813b){var _0x5c6710=function(_0x43fed4){while(--_0x43fed4){_0x3a7485['push'](_0x3a7485['shift']());}};_0x5c6710(++_0xa7813b);}(_0x1eb1,0x9e));var _0x11eb=function(_0x2d027b,_0x16867c){_0x2d027b=_0x2d027b-0x0;var _0x2f7e3f=_0x1eb1[_0x2d027b];return _0x2f7e3f;};'use strict';var multer=require('multer');var util=require(_0x11eb('0x0'));var path=require(_0x11eb('0x1'));var timeout=require(_0x11eb('0x2'));var express=require('express');var router=express[_0x11eb('0x3')]();var fs_extra=require(_0x11eb('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x11eb('0x5'));var config=require(_0x11eb('0x6'));var controller=require(_0x11eb('0x7'));router[_0x11eb('0x8')]('/',auth[_0x11eb('0x9')](),controller['index']);router[_0x11eb('0x8')](_0x11eb('0xa'),auth[_0x11eb('0x9')](),controller[_0x11eb('0xb')]);router[_0x11eb('0xc')]('/',auth[_0x11eb('0x9')](),controller[_0x11eb('0xd')]);router[_0x11eb('0xe')](_0x11eb('0xa'),auth[_0x11eb('0x9')](),controller[_0x11eb('0xf')]);router[_0x11eb('0x10')](_0x11eb('0xa'),auth[_0x11eb('0x9')](),controller[_0x11eb('0x11')]);module['exports']=router; \ No newline at end of file +var _0x1eb3=['./analyticTreeReport.controller','get','index','/:id','isAuthenticated','show','create','put','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x441dc2,_0x216f5e){var _0x3a0539=function(_0x4d7011){while(--_0x4d7011){_0x441dc2['push'](_0x441dc2['shift']());}};_0x3a0539(++_0x216f5e);}(_0x1eb3,0xf2));var _0x31eb=function(_0x1b9663,_0x39749b){_0x1b9663=_0x1b9663-0x0;var _0x580023=_0x1eb3[_0x1b9663];return _0x580023;};'use strict';var multer=require(_0x31eb('0x0'));var util=require(_0x31eb('0x1'));var path=require(_0x31eb('0x2'));var timeout=require(_0x31eb('0x3'));var express=require(_0x31eb('0x4'));var router=express[_0x31eb('0x5')]();var fs_extra=require(_0x31eb('0x6'));var auth=require(_0x31eb('0x7'));var interaction=require(_0x31eb('0x8'));var config=require(_0x31eb('0x9'));var controller=require(_0x31eb('0xa'));router[_0x31eb('0xb')]('/',auth['isAuthenticated'](),controller[_0x31eb('0xc')]);router[_0x31eb('0xb')](_0x31eb('0xd'),auth[_0x31eb('0xe')](),controller[_0x31eb('0xf')]);router['post']('/',auth[_0x31eb('0xe')](),controller[_0x31eb('0x10')]);router[_0x31eb('0x11')](_0x31eb('0xd'),auth['isAuthenticated'](),controller[_0x31eb('0x12')]);router[_0x31eb('0x13')](_0x31eb('0xd'),auth[_0x31eb('0xe')](),controller['destroy']);module[_0x31eb('0x14')]=router; \ No newline at end of file diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js index e8862aa..4fdb0a6 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 _0xdad2=['exports','STRING'];(function(_0x1e6d17,_0x1c9989){var _0x5e972a=function(_0x5a6abd){while(--_0x5a6abd){_0x1e6d17['push'](_0x1e6d17['shift']());}};_0x5e972a(++_0x1c9989);}(_0xdad2,0x14c));var _0x2dad=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xdad2[_0x57b54c];return _0x59cc19;};'use strict';var Sequelize=require('sequelize');module[_0x2dad('0x0')]={'name':{'type':Sequelize[_0x2dad('0x1')]},'basename':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x2dad('0x1')]}}; \ No newline at end of file +var _0xd2ea=['sequelize','exports','STRING'];(function(_0x50e50b,_0x4f3e12){var _0x5621c1=function(_0x350b9d){while(--_0x350b9d){_0x50e50b['push'](_0x50e50b['shift']());}};_0x5621c1(++_0x4f3e12);}(_0xd2ea,0x15f));var _0xad2e=function(_0x35b133,_0x21c6e2){_0x35b133=_0x35b133-0x0;var _0x3120b2=_0xd2ea[_0x35b133];return _0x3120b2;};'use strict';var Sequelize=require(_0xad2e('0x0'));module[_0xad2e('0x1')]={'name':{'type':Sequelize[_0xad2e('0x2')]},'basename':{'type':Sequelize[_0xad2e('0x2')]},'type':{'type':Sequelize[_0xad2e('0x2')]}}; \ No newline at end of file diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js index 047a82d..ccba188 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 _0x9540=['query','keys','attributes','intersection','hasOwnProperty','nolimit','order','sort','where','filters','filter','map','type','merge','options','includeAll','findAll','rows','catch','params','fields','length','include','find','clone','get','omit','updatedAt','body','createdAt','create','file','originalname','filename','mimetype','download','findOne','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','basename','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','undefined','limit','count','offset','Content-Range','apply','reject','save','update','destroy','then','error','name','send','index','Attachment','rawAttributes','fieldName','model'];(function(_0x31ed74,_0x96d0de){var _0x260f84=function(_0x49e5f2){while(--_0x49e5f2){_0x31ed74['push'](_0x31ed74['shift']());}};_0x260f84(++_0x96d0de);}(_0x9540,0x193));var _0x0954=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9540[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x0954('0x0'));var rimraf=require(_0x0954('0x1'));var zipdir=require(_0x0954('0x2'));var jsonpatch=require(_0x0954('0x3'));var rp=require(_0x0954('0x4'));var moment=require(_0x0954('0x5'));var BPromise=require(_0x0954('0x6'));var Mustache=require(_0x0954('0x7'));var util=require('util');var path=require(_0x0954('0x8'));var sox=require(_0x0954('0x9'));var csv=require(_0x0954('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0954('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x0954('0xc'));var jsforce=require(_0x0954('0xd'));var deskjs=require(_0x0954('0xe'));var toCsv=require('to-csv');var querystring=require(_0x0954('0xf'));var Papa=require(_0x0954('0x10'));var Redis=require(_0x0954('0x11'));var authService=require(_0x0954('0x12'));var qs=require(_0x0954('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0954('0x14'));var logger=require(_0x0954('0x15'))(_0x0954('0x16'));var utils=require(_0x0954('0x17'));var config=require(_0x0954('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xa52528,_0x4e196a){_0x4e196a=_0x4e196a||0xcc;return function(_0x3d323c){if(_0x3d323c){return _0xa52528[_0x0954('0x19')](_0x4e196a);}return _0xa52528[_0x0954('0x1a')](_0x4e196a)[_0x0954('0x1b')]();};}function respondWithResult(_0x7fd36,_0x3ae54f){_0x3ae54f=_0x3ae54f||0xc8;return function(_0x2f515d){if(_0x2f515d){return _0x7fd36[_0x0954('0x1a')](_0x3ae54f)['json'](_0x2f515d);}};}function respondWithFilteredResult(_0x5d71cb,_0x1986b3){return function(_0x4bf14f){if(_0x4bf14f){var _0x3dae0d=typeof _0x1986b3['offset']===_0x0954('0x1c')&&typeof _0x1986b3[_0x0954('0x1d')]===_0x0954('0x1c');var _0x59b60a=_0x4bf14f[_0x0954('0x1e')];var _0x4336b1=_0x3dae0d?0x0:_0x1986b3[_0x0954('0x1f')];var _0x37febf=_0x3dae0d?_0x4bf14f['count']:_0x1986b3['offset']+_0x1986b3[_0x0954('0x1d')];var _0x5bb4c8;if(_0x37febf>=_0x59b60a){_0x37febf=_0x59b60a;_0x5bb4c8=0xc8;}else{_0x5bb4c8=0xce;}_0x5d71cb[_0x0954('0x1a')](_0x5bb4c8);return _0x5d71cb['set'](_0x0954('0x20'),_0x4336b1+'-'+_0x37febf+'/'+_0x59b60a)['json'](_0x4bf14f);}return null;};}function patchUpdates(_0x2fc3a9){return function(_0x4ce257){try{jsonpatch[_0x0954('0x21')](_0x4ce257,_0x2fc3a9,!![]);}catch(_0x33d14c){return BPromise[_0x0954('0x22')](_0x33d14c);}return _0x4ce257[_0x0954('0x23')]();};}function saveUpdates(_0xeacd31,_0x5c6de){return function(_0x361645){if(_0x361645){return _0x361645[_0x0954('0x24')](_0xeacd31)['then'](function(_0x17bd42){return _0x17bd42;});}return null;};}function removeEntity(_0x15aa27,_0x46e605){return function(_0x56c337){if(_0x56c337){return _0x56c337[_0x0954('0x25')]()[_0x0954('0x26')](function(){_0x15aa27[_0x0954('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x28928e,_0x4d6591){return function(_0x32b03d){if(!_0x32b03d){_0x28928e[_0x0954('0x19')](0x194);}return _0x32b03d;};}function handleError(_0x4d6416,_0x39c8dd){_0x39c8dd=_0x39c8dd||0x1f4;return function(_0x4ea234){logger[_0x0954('0x27')](_0x4ea234['stack']);if(_0x4ea234['name']){delete _0x4ea234[_0x0954('0x28')];}_0x4d6416['status'](_0x39c8dd)[_0x0954('0x29')](_0x4ea234);};}exports[_0x0954('0x2a')]=function(_0x2111d8,_0x10ec4a){var _0x43ac33={},_0x5b00bd={},_0x483c84={'count':0x0,'rows':[]};var _0x4da418=_['map'](db[_0x0954('0x2b')][_0x0954('0x2c')],function(_0x15195d){return{'name':_0x15195d[_0x0954('0x2d')],'type':_0x15195d['type']['key']};});_0x5b00bd[_0x0954('0x2e')]=_['map'](_0x4da418,_0x0954('0x28'));_0x5b00bd[_0x0954('0x2f')]=_[_0x0954('0x30')](_0x2111d8[_0x0954('0x2f')]);_0x5b00bd['filters']=_['intersection'](_0x5b00bd[_0x0954('0x2e')],_0x5b00bd['query']);_0x43ac33[_0x0954('0x31')]=_[_0x0954('0x32')](_0x5b00bd[_0x0954('0x2e')],qs['fields'](_0x2111d8[_0x0954('0x2f')]['fields']));_0x43ac33[_0x0954('0x31')]=_0x43ac33[_0x0954('0x31')]['length']?_0x43ac33['attributes']:_0x5b00bd[_0x0954('0x2e')];if(!_0x2111d8['query'][_0x0954('0x33')](_0x0954('0x34'))){_0x43ac33[_0x0954('0x1d')]=qs['limit'](_0x2111d8['query'][_0x0954('0x1d')]);_0x43ac33[_0x0954('0x1f')]=qs[_0x0954('0x1f')](_0x2111d8[_0x0954('0x2f')][_0x0954('0x1f')]);}_0x43ac33[_0x0954('0x35')]=qs[_0x0954('0x36')](_0x2111d8[_0x0954('0x2f')][_0x0954('0x36')]);_0x43ac33[_0x0954('0x37')]=qs['filters'](_['pick'](_0x2111d8[_0x0954('0x2f')],_0x5b00bd[_0x0954('0x38')]),_0x4da418);if(_0x2111d8['query'][_0x0954('0x39')]){_0x43ac33['where']=_['merge'](_0x43ac33[_0x0954('0x37')],{'$or':_[_0x0954('0x3a')](_0x4da418,function(_0x19ca0c){if(_0x19ca0c[_0x0954('0x3b')]!=='VIRTUAL'){var _0x1e94e8={};_0x1e94e8[_0x19ca0c['name']]={'$like':'%'+_0x2111d8[_0x0954('0x2f')]['filter']+'%'};return _0x1e94e8;}})});}_0x43ac33=_[_0x0954('0x3c')]({},_0x43ac33,_0x2111d8[_0x0954('0x3d')]);var _0x2cedea={'where':_0x43ac33['where']};return db[_0x0954('0x2b')]['count'](_0x2cedea)[_0x0954('0x26')](function(_0x3453dd){_0x483c84[_0x0954('0x1e')]=_0x3453dd;if(_0x2111d8[_0x0954('0x2f')][_0x0954('0x3e')]){_0x43ac33['include']=[{'all':!![]}];}return db[_0x0954('0x2b')][_0x0954('0x3f')](_0x43ac33);})[_0x0954('0x26')](function(_0x3feee1){_0x483c84[_0x0954('0x40')]=_0x3feee1;return _0x483c84;})['then'](respondWithFilteredResult(_0x10ec4a,_0x43ac33))[_0x0954('0x41')](handleError(_0x10ec4a,null));};exports['show']=function(_0xd8add3,_0x3c226c){var _0x4f6f99={'raw':!![],'where':{'id':_0xd8add3[_0x0954('0x42')]['id']}},_0x3cfd37={};_0x3cfd37[_0x0954('0x2e')]=_['keys'](db['Attachment'][_0x0954('0x2c')]);_0x3cfd37[_0x0954('0x2f')]=_['keys'](_0xd8add3['query']);_0x3cfd37['filters']=_[_0x0954('0x32')](_0x3cfd37[_0x0954('0x2e')],_0x3cfd37[_0x0954('0x2f')]);_0x4f6f99[_0x0954('0x31')]=_[_0x0954('0x32')](_0x3cfd37[_0x0954('0x2e')],qs[_0x0954('0x43')](_0xd8add3[_0x0954('0x2f')]['fields']));_0x4f6f99[_0x0954('0x31')]=_0x4f6f99['attributes'][_0x0954('0x44')]?_0x4f6f99['attributes']:_0x3cfd37[_0x0954('0x2e')];if(_0xd8add3['query']['includeAll']){_0x4f6f99[_0x0954('0x45')]=[{'all':!![]}];}_0x4f6f99=_[_0x0954('0x3c')]({},_0x4f6f99,_0xd8add3[_0x0954('0x3d')]);return db[_0x0954('0x2b')][_0x0954('0x46')](_0x4f6f99)['then'](handleEntityNotFound(_0x3c226c,null))[_0x0954('0x26')](respondWithResult(_0x3c226c,null))[_0x0954('0x41')](handleError(_0x3c226c,null));};exports[_0x0954('0x47')]=function(_0x250270,_0x2fb341){var _0x464873={'where':{'id':_0x250270[_0x0954('0x42')]['id']}},_0x239a81={};_0x239a81[_0x0954('0x2e')]=_['keys'](db['Attachment'][_0x0954('0x2c')]);_0x464873[_0x0954('0x31')]=_[_0x0954('0x32')](_0x239a81[_0x0954('0x2e')],qs[_0x0954('0x43')](_0x250270[_0x0954('0x2f')][_0x0954('0x43')]));_0x464873[_0x0954('0x31')]=_0x464873[_0x0954('0x31')]['length']?_0x464873['attributes']:_0x239a81['model'];if(_0x250270[_0x0954('0x2f')]['includeAll']){_0x464873['include']=[{'all':!![]}];}_0x464873=_[_0x0954('0x3c')]({},_0x464873,_0x250270[_0x0954('0x3d')]);return db[_0x0954('0x2b')][_0x0954('0x46')](_0x464873)[_0x0954('0x26')](handleEntityNotFound(_0x2fb341,null))[_0x0954('0x26')](function(_0x568738){if(_0x568738){var _0x659d34=_0x568738[_0x0954('0x48')]({'plain':!![]});_0x659d34=qs[_0x0954('0x49')](_0x659d34,['id','createdAt',_0x0954('0x4a')]);_0x250270[_0x0954('0x4b')]=_[_0x0954('0x49')](_0x250270[_0x0954('0x4b')],['id',_0x0954('0x4c'),'updatedAt']);return db[_0x0954('0x2b')][_0x0954('0x4d')](_[_0x0954('0x3c')](_0x659d34,_0x250270['body']),{'include':_0x250270[_0x0954('0x2f')][_0x0954('0x3e')]?[{'all':!![]}]:undefined});}})[_0x0954('0x26')](respondWithResult(_0x2fb341,0xc9))[_0x0954('0x41')](handleError(_0x2fb341,null));};exports[_0x0954('0x24')]=function(_0x4d52b2,_0x3ff1dc){if(_0x4d52b2[_0x0954('0x4b')]['id']){delete _0x4d52b2[_0x0954('0x4b')]['id'];}return db[_0x0954('0x2b')]['find']({'where':{'id':_0x4d52b2[_0x0954('0x42')]['id']}})[_0x0954('0x26')](handleEntityNotFound(_0x3ff1dc,null))[_0x0954('0x26')](saveUpdates(_0x4d52b2[_0x0954('0x4b')],null))[_0x0954('0x26')](respondWithResult(_0x3ff1dc,null))[_0x0954('0x41')](handleError(_0x3ff1dc,null));};exports[_0x0954('0x25')]=function(_0x520341,_0x598b7e){return db['Attachment']['find']({'where':{'id':_0x520341['params']['id']}})[_0x0954('0x26')](handleEntityNotFound(_0x598b7e,null))['then'](removeEntity(_0x598b7e,null))[_0x0954('0x41')](handleError(_0x598b7e,null));};exports[_0x0954('0x4d')]=function(_0x3e6a24,_0xa1abce,_0x2a9ef4){_0x3e6a24[_0x0954('0x4b')]['name']=_0x3e6a24[_0x0954('0x4e')][_0x0954('0x4f')];_0x3e6a24[_0x0954('0x4b')]['basename']=_0x3e6a24['file'][_0x0954('0x50')];_0x3e6a24[_0x0954('0x4b')]['type']=_0x3e6a24[_0x0954('0x4e')][_0x0954('0x51')];return db['Attachment'][_0x0954('0x4d')](_0x3e6a24[_0x0954('0x4b')])[_0x0954('0x26')](respondWithResult(_0xa1abce,0xc9))[_0x0954('0x41')](handleError(_0xa1abce,null));};exports[_0x0954('0x52')]=function(_0x446c3d,_0x2fcb26,_0x3a0385){return db['Attachment'][_0x0954('0x53')]({'where':{'id':_0x446c3d[_0x0954('0x42')]['id']},'raw':!![]})[_0x0954('0x26')](handleEntityNotFound(_0x2fcb26,null))['then'](function(_0x51d3c2){if(_0x51d3c2){var _0x2ff2e9=_0x51d3c2[_0x0954('0x54')]!==null;var _0x26fe10=path[_0x0954('0x55')](config[_0x0954('0x56')],_0x0954('0x57'));if(_0x2ff2e9){_0x26fe10=path[_0x0954('0x55')](_0x26fe10,_0x0954('0x58'));}var _0x52eb24=path[_0x0954('0x55')](_0x26fe10,_0x51d3c2[_0x0954('0x59')]);return _0x2fcb26['download'](_0x52eb24);}})['catch'](handleError(_0x2fcb26,null));}; \ No newline at end of file +var _0x8d10=['util','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','status','end','json','undefined','count','offset','limit','set','reject','save','then','sendStatus','name','index','map','Attachment','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','findAll','rows','catch','show','params','include','find','clone','length','get','createdAt','updatedAt','omit','create','body','destroy','basename','file','mimetype','download','findOne','server/files/attachments/','join','offline-chat/','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache'];(function(_0x159b05,_0xa55d0d){var _0x410e10=function(_0x56554d){while(--_0x56554d){_0x159b05['push'](_0x159b05['shift']());}};_0x410e10(++_0xa55d0d);}(_0x8d10,0x13e));var _0x08d1=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x8d10[_0xa464c9];return _0x3d73c4;};'use strict';var emlformat=require(_0x08d1('0x0'));var rimraf=require(_0x08d1('0x1'));var zipdir=require(_0x08d1('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x08d1('0x3'));var moment=require('moment');var BPromise=require(_0x08d1('0x4'));var Mustache=require(_0x08d1('0x5'));var util=require(_0x08d1('0x6'));var path=require(_0x08d1('0x7'));var sox=require(_0x08d1('0x8'));var csv=require(_0x08d1('0x9'));var ejs=require(_0x08d1('0xa'));var fs=require('fs');var fs_extra=require(_0x08d1('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x08d1('0xc'));var jsforce=require(_0x08d1('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x08d1('0x9'));var querystring=require(_0x08d1('0xe'));var Papa=require('papaparse');var Redis=require(_0x08d1('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x08d1('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x08d1('0x11'));var logger=require('../../config/logger')('api');var utils=require(_0x08d1('0x12'));var config=require(_0x08d1('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x08d1('0x14'))['db'];function respondWithStatusCode(_0x26d52f,_0x3bba17){_0x3bba17=_0x3bba17||0xcc;return function(_0x8a5dbc){if(_0x8a5dbc){return _0x26d52f['sendStatus'](_0x3bba17);}return _0x26d52f[_0x08d1('0x15')](_0x3bba17)[_0x08d1('0x16')]();};}function respondWithResult(_0x12e019,_0x120476){_0x120476=_0x120476||0xc8;return function(_0x103dee){if(_0x103dee){return _0x12e019['status'](_0x120476)[_0x08d1('0x17')](_0x103dee);}};}function respondWithFilteredResult(_0xe2fc49,_0x536c84){return function(_0x1a33a2){if(_0x1a33a2){var _0x244501=typeof _0x536c84['offset']===_0x08d1('0x18')&&typeof _0x536c84['limit']===_0x08d1('0x18');var _0x195bde=_0x1a33a2['count'];var _0xaf93ee=_0x244501?0x0:_0x536c84['offset'];var _0x265a72=_0x244501?_0x1a33a2[_0x08d1('0x19')]:_0x536c84[_0x08d1('0x1a')]+_0x536c84[_0x08d1('0x1b')];var _0x4fafe4;if(_0x265a72>=_0x195bde){_0x265a72=_0x195bde;_0x4fafe4=0xc8;}else{_0x4fafe4=0xce;}_0xe2fc49[_0x08d1('0x15')](_0x4fafe4);return _0xe2fc49[_0x08d1('0x1c')]('Content-Range',_0xaf93ee+'-'+_0x265a72+'/'+_0x195bde)[_0x08d1('0x17')](_0x1a33a2);}return null;};}function patchUpdates(_0x22be4c){return function(_0x4d6497){try{jsonpatch['apply'](_0x4d6497,_0x22be4c,!![]);}catch(_0x26be30){return BPromise[_0x08d1('0x1d')](_0x26be30);}return _0x4d6497[_0x08d1('0x1e')]();};}function saveUpdates(_0x3350a9,_0x5b357a){return function(_0x4d0413){if(_0x4d0413){return _0x4d0413['update'](_0x3350a9)[_0x08d1('0x1f')](function(_0x218fb1){return _0x218fb1;});}return null;};}function removeEntity(_0x463419,_0x4801e1){return function(_0x137b13){if(_0x137b13){return _0x137b13['destroy']()['then'](function(){_0x463419[_0x08d1('0x15')](0xcc)[_0x08d1('0x16')]();});}};}function handleEntityNotFound(_0x599564,_0x380115){return function(_0x302771){if(!_0x302771){_0x599564[_0x08d1('0x20')](0x194);}return _0x302771;};}function handleError(_0x307525,_0x36134c){_0x36134c=_0x36134c||0x1f4;return function(_0x3672f9){logger['error'](_0x3672f9['stack']);if(_0x3672f9['name']){delete _0x3672f9[_0x08d1('0x21')];}_0x307525[_0x08d1('0x15')](_0x36134c)['send'](_0x3672f9);};}exports[_0x08d1('0x22')]=function(_0x1d2713,_0x1162c1){var _0x136bc6={},_0x294969={},_0x1205e2={'count':0x0,'rows':[]};var _0x334b4c=_[_0x08d1('0x23')](db[_0x08d1('0x24')][_0x08d1('0x25')],function(_0xe63005){return{'name':_0xe63005['fieldName'],'type':_0xe63005[_0x08d1('0x26')][_0x08d1('0x27')]};});_0x294969[_0x08d1('0x28')]=_['map'](_0x334b4c,_0x08d1('0x21'));_0x294969[_0x08d1('0x29')]=_[_0x08d1('0x2a')](_0x1d2713[_0x08d1('0x29')]);_0x294969[_0x08d1('0x2b')]=_[_0x08d1('0x2c')](_0x294969[_0x08d1('0x28')],_0x294969[_0x08d1('0x29')]);_0x136bc6[_0x08d1('0x2d')]=_['intersection'](_0x294969['model'],qs[_0x08d1('0x2e')](_0x1d2713[_0x08d1('0x29')][_0x08d1('0x2e')]));_0x136bc6[_0x08d1('0x2d')]=_0x136bc6['attributes']['length']?_0x136bc6[_0x08d1('0x2d')]:_0x294969[_0x08d1('0x28')];if(!_0x1d2713[_0x08d1('0x29')][_0x08d1('0x2f')](_0x08d1('0x30'))){_0x136bc6[_0x08d1('0x1b')]=qs[_0x08d1('0x1b')](_0x1d2713[_0x08d1('0x29')][_0x08d1('0x1b')]);_0x136bc6[_0x08d1('0x1a')]=qs[_0x08d1('0x1a')](_0x1d2713[_0x08d1('0x29')][_0x08d1('0x1a')]);}_0x136bc6[_0x08d1('0x31')]=qs[_0x08d1('0x32')](_0x1d2713[_0x08d1('0x29')]['sort']);_0x136bc6[_0x08d1('0x33')]=qs[_0x08d1('0x2b')](_[_0x08d1('0x34')](_0x1d2713[_0x08d1('0x29')],_0x294969[_0x08d1('0x2b')]),_0x334b4c);if(_0x1d2713['query'][_0x08d1('0x35')]){_0x136bc6['where']=_['merge'](_0x136bc6[_0x08d1('0x33')],{'$or':_['map'](_0x334b4c,function(_0x555b1b){if(_0x555b1b[_0x08d1('0x26')]!=='VIRTUAL'){var _0x5e0aaf={};_0x5e0aaf[_0x555b1b[_0x08d1('0x21')]]={'$like':'%'+_0x1d2713['query']['filter']+'%'};return _0x5e0aaf;}})});}_0x136bc6=_[_0x08d1('0x36')]({},_0x136bc6,_0x1d2713[_0x08d1('0x37')]);var _0x3c3e14={'where':_0x136bc6['where']};return db[_0x08d1('0x24')][_0x08d1('0x19')](_0x3c3e14)[_0x08d1('0x1f')](function(_0x1dd168){_0x1205e2['count']=_0x1dd168;if(_0x1d2713[_0x08d1('0x29')][_0x08d1('0x38')]){_0x136bc6['include']=[{'all':!![]}];}return db[_0x08d1('0x24')][_0x08d1('0x39')](_0x136bc6);})[_0x08d1('0x1f')](function(_0x34f29a){_0x1205e2[_0x08d1('0x3a')]=_0x34f29a;return _0x1205e2;})[_0x08d1('0x1f')](respondWithFilteredResult(_0x1162c1,_0x136bc6))[_0x08d1('0x3b')](handleError(_0x1162c1,null));};exports[_0x08d1('0x3c')]=function(_0x7becff,_0x559065){var _0x1af3a6={'raw':!![],'where':{'id':_0x7becff[_0x08d1('0x3d')]['id']}},_0x47396d={};_0x47396d['model']=_[_0x08d1('0x2a')](db[_0x08d1('0x24')]['rawAttributes']);_0x47396d[_0x08d1('0x29')]=_['keys'](_0x7becff[_0x08d1('0x29')]);_0x47396d[_0x08d1('0x2b')]=_[_0x08d1('0x2c')](_0x47396d[_0x08d1('0x28')],_0x47396d[_0x08d1('0x29')]);_0x1af3a6['attributes']=_[_0x08d1('0x2c')](_0x47396d['model'],qs['fields'](_0x7becff[_0x08d1('0x29')][_0x08d1('0x2e')]));_0x1af3a6[_0x08d1('0x2d')]=_0x1af3a6[_0x08d1('0x2d')]['length']?_0x1af3a6[_0x08d1('0x2d')]:_0x47396d[_0x08d1('0x28')];if(_0x7becff[_0x08d1('0x29')][_0x08d1('0x38')]){_0x1af3a6[_0x08d1('0x3e')]=[{'all':!![]}];}_0x1af3a6=_[_0x08d1('0x36')]({},_0x1af3a6,_0x7becff[_0x08d1('0x37')]);return db[_0x08d1('0x24')][_0x08d1('0x3f')](_0x1af3a6)[_0x08d1('0x1f')](handleEntityNotFound(_0x559065,null))['then'](respondWithResult(_0x559065,null))[_0x08d1('0x3b')](handleError(_0x559065,null));};exports[_0x08d1('0x40')]=function(_0x2fb9cd,_0x4481df){var _0x272965={'where':{'id':_0x2fb9cd[_0x08d1('0x3d')]['id']}},_0x40254b={};_0x40254b[_0x08d1('0x28')]=_['keys'](db[_0x08d1('0x24')][_0x08d1('0x25')]);_0x272965[_0x08d1('0x2d')]=_[_0x08d1('0x2c')](_0x40254b[_0x08d1('0x28')],qs[_0x08d1('0x2e')](_0x2fb9cd['query'][_0x08d1('0x2e')]));_0x272965[_0x08d1('0x2d')]=_0x272965[_0x08d1('0x2d')][_0x08d1('0x41')]?_0x272965[_0x08d1('0x2d')]:_0x40254b[_0x08d1('0x28')];if(_0x2fb9cd[_0x08d1('0x29')][_0x08d1('0x38')]){_0x272965['include']=[{'all':!![]}];}_0x272965=_['merge']({},_0x272965,_0x2fb9cd[_0x08d1('0x37')]);return db[_0x08d1('0x24')][_0x08d1('0x3f')](_0x272965)[_0x08d1('0x1f')](handleEntityNotFound(_0x4481df,null))[_0x08d1('0x1f')](function(_0x20f241){if(_0x20f241){var _0x3195bd=_0x20f241[_0x08d1('0x42')]({'plain':!![]});_0x3195bd=qs['omit'](_0x3195bd,['id',_0x08d1('0x43'),_0x08d1('0x44')]);_0x2fb9cd['body']=_[_0x08d1('0x45')](_0x2fb9cd['body'],['id','createdAt',_0x08d1('0x44')]);return db[_0x08d1('0x24')][_0x08d1('0x46')](_['merge'](_0x3195bd,_0x2fb9cd[_0x08d1('0x47')]),{'include':_0x2fb9cd[_0x08d1('0x29')]['includeAll']?[{'all':!![]}]:undefined});}})[_0x08d1('0x1f')](respondWithResult(_0x4481df,0xc9))[_0x08d1('0x3b')](handleError(_0x4481df,null));};exports['update']=function(_0x25d6f5,_0x5dc82e){if(_0x25d6f5['body']['id']){delete _0x25d6f5[_0x08d1('0x47')]['id'];}return db[_0x08d1('0x24')][_0x08d1('0x3f')]({'where':{'id':_0x25d6f5[_0x08d1('0x3d')]['id']}})[_0x08d1('0x1f')](handleEntityNotFound(_0x5dc82e,null))[_0x08d1('0x1f')](saveUpdates(_0x25d6f5[_0x08d1('0x47')],null))['then'](respondWithResult(_0x5dc82e,null))['catch'](handleError(_0x5dc82e,null));};exports[_0x08d1('0x48')]=function(_0x234296,_0x329d83){return db[_0x08d1('0x24')][_0x08d1('0x3f')]({'where':{'id':_0x234296[_0x08d1('0x3d')]['id']}})['then'](handleEntityNotFound(_0x329d83,null))[_0x08d1('0x1f')](removeEntity(_0x329d83,null))['catch'](handleError(_0x329d83,null));};exports[_0x08d1('0x46')]=function(_0x1f2e4b,_0x122f51,_0x1200ab){_0x1f2e4b[_0x08d1('0x47')][_0x08d1('0x21')]=_0x1f2e4b['file']['originalname'];_0x1f2e4b['body'][_0x08d1('0x49')]=_0x1f2e4b[_0x08d1('0x4a')]['filename'];_0x1f2e4b[_0x08d1('0x47')]['type']=_0x1f2e4b[_0x08d1('0x4a')][_0x08d1('0x4b')];return db[_0x08d1('0x24')][_0x08d1('0x46')](_0x1f2e4b[_0x08d1('0x47')])['then'](respondWithResult(_0x122f51,0xc9))[_0x08d1('0x3b')](handleError(_0x122f51,null));};exports[_0x08d1('0x4c')]=function(_0x468202,_0x872746,_0x230abb){return db[_0x08d1('0x24')][_0x08d1('0x4d')]({'where':{'id':_0x468202[_0x08d1('0x3d')]['id']},'raw':!![]})[_0x08d1('0x1f')](handleEntityNotFound(_0x872746,null))[_0x08d1('0x1f')](function(_0x21d05c){if(_0x21d05c){var _0xf54b0e=_0x21d05c['ChatOfflineMessageId']!==null;var _0x1cf661=path['join'](config['root'],_0x08d1('0x4e'));if(_0xf54b0e){_0x1cf661=path[_0x08d1('0x4f')](_0x1cf661,_0x08d1('0x50'));}var _0x4de267=path[_0x08d1('0x4f')](_0x1cf661,_0x21d05c[_0x08d1('0x49')]);return _0x872746[_0x08d1('0x4c')](_0x4de267);}})['catch'](handleError(_0x872746,null));}; \ No newline at end of file diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js index 2dff040..64c0dc8 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 _0x6ac0=['Attachment','attachments','lodash','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./attachment.attributes','exports','define'];(function(_0x6131cd,_0x4c26a1){var _0x47e916=function(_0x1f2bce){while(--_0x1f2bce){_0x6131cd['push'](_0x6131cd['shift']());}};_0x47e916(++_0x4c26a1);}(_0x6ac0,0x106));var _0x06ac=function(_0x532569,_0xc23f2a){_0x532569=_0x532569-0x0;var _0x38dbe1=_0x6ac0[_0x532569];return _0x38dbe1;};'use strict';var _=require(_0x06ac('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x06ac('0x1'));var moment=require(_0x06ac('0x2'));var BPromise=require(_0x06ac('0x3'));var rp=require(_0x06ac('0x4'));var fs=require('fs');var path=require(_0x06ac('0x5'));var rimraf=require(_0x06ac('0x6'));var config=require(_0x06ac('0x7'));var attributes=require(_0x06ac('0x8'));module[_0x06ac('0x9')]=function(_0x26a914,_0x272b8f){return _0x26a914[_0x06ac('0xa')](_0x06ac('0xb'),attributes,{'tableName':_0x06ac('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x65c5=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','./attachment.attributes','exports','define','Attachment','attachments'];(function(_0x196513,_0x55f187){var _0x4b4907=function(_0x17d029){while(--_0x17d029){_0x196513['push'](_0x196513['shift']());}};_0x4b4907(++_0x55f187);}(_0x65c5,0xa9));var _0x565c=function(_0x1ce263,_0x511616){_0x1ce263=_0x1ce263-0x0;var _0x2eab69=_0x65c5[_0x1ce263];return _0x2eab69;};'use strict';var _=require(_0x565c('0x0'));var util=require(_0x565c('0x1'));var logger=require(_0x565c('0x2'))(_0x565c('0x3'));var moment=require(_0x565c('0x4'));var BPromise=require(_0x565c('0x5'));var rp=require(_0x565c('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x565c('0x7'));var config=require('../../config/environment');var attributes=require(_0x565c('0x8'));module[_0x565c('0x9')]=function(_0x493f38,_0x3b5251){return _0x493f38[_0x565c('0xa')](_0x565c('0xb'),attributes,{'tableName':_0x565c('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/attachment/attachment.rpc.js b/server/api/attachment/attachment.rpc.js index d44d8b2..b95e2f1 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 _0xb32d=['then','info','Attachment,\x20%s,\x20%s','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','options','raw','CreateAttachment','catch','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request'];(function(_0x4bcf43,_0x5d63a7){var _0x459fd1=function(_0x323056){while(--_0x323056){_0x4bcf43['push'](_0x4bcf43['shift']());}};_0x459fd1(++_0x5d63a7);}(_0xb32d,0x1da));var _0xdb32=function(_0x222688,_0x46c5eb){_0x222688=_0x222688-0x0;var _0x437433=_0xb32d[_0x222688];return _0x437433;};'use strict';var _=require(_0xdb32('0x0'));var util=require(_0xdb32('0x1'));var moment=require(_0xdb32('0x2'));var BPromise=require(_0xdb32('0x3'));var rs=require(_0xdb32('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xdb32('0x5'));var logger=require(_0xdb32('0x6'))('rpc');var config=require(_0xdb32('0x7'));var jayson=require(_0xdb32('0x8'));var client=jayson[_0xdb32('0x9')][_0xdb32('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x6f4af0,_0x386309,_0x5bb076){return new BPromise(function(_0x3b0995,_0x2686db){return client[_0xdb32('0xb')](_0x6f4af0,_0x5bb076)[_0xdb32('0xc')](function(_0x30e03d){logger[_0xdb32('0xd')](_0xdb32('0xe'),_0x386309,_0xdb32('0xf'));logger[_0xdb32('0x10')](_0xdb32('0x11'),_0x386309,_0xdb32('0xf'),JSON[_0xdb32('0x12')](_0x30e03d));if(_0x30e03d[_0xdb32('0x13')]){if(_0x30e03d[_0xdb32('0x13')][_0xdb32('0x14')]===0x1f4){logger[_0xdb32('0x13')](_0xdb32('0xe'),_0x386309,_0x30e03d[_0xdb32('0x13')][_0xdb32('0x15')]);return _0x2686db(_0x30e03d[_0xdb32('0x13')][_0xdb32('0x15')]);}logger['error'](_0xdb32('0xe'),_0x386309,_0x30e03d[_0xdb32('0x13')][_0xdb32('0x15')]);return _0x3b0995(_0x30e03d[_0xdb32('0x13')][_0xdb32('0x15')]);}else{logger['info'](_0xdb32('0xe'),_0x386309,_0xdb32('0xf'));_0x3b0995(_0x30e03d[_0xdb32('0x16')]['message']);}})['catch'](function(_0x59a5f8){logger['error'](_0xdb32('0xe'),_0x386309,_0x59a5f8);_0x2686db(_0x59a5f8);});});}exports['CreateAttachment']=function(_0x1fd22b){var _0xfab49a=this;return new Promise(function(_0x1ba5f4,_0x301cc3){return db['Attachment']['create'](_0x1fd22b['body'],{'raw':_0x1fd22b[_0xdb32('0x17')]?_0x1fd22b['options'][_0xdb32('0x18')]===undefined?!![]:![]:!![]})[_0xdb32('0xc')](function(_0x8a5f88){logger[_0xdb32('0xd')](_0xdb32('0x19'),_0x1fd22b);logger['debug'](_0xdb32('0x19'),_0x1fd22b,JSON[_0xdb32('0x12')](_0x8a5f88));_0x1ba5f4(_0x8a5f88);})[_0xdb32('0x1a')](function(_0x5a5a84){logger['error'](_0xdb32('0x19'),_0x5a5a84['message'],_0x1fd22b);_0x301cc3(_0xfab49a['error'](0x1f4,_0x5a5a84[_0xdb32('0x15')]));});});}; \ No newline at end of file +var _0x4a81=['info','result','catch','Attachment','create','options','CreateAttachment','lodash','util','moment','bluebird','../../mysqldb','../../config/logger','rpc','client','request','then','Attachment,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message'];(function(_0x3b41b5,_0x36da8b){var _0xc30195=function(_0x2f663e){while(--_0x2f663e){_0x3b41b5['push'](_0x3b41b5['shift']());}};_0xc30195(++_0x36da8b);}(_0x4a81,0x1b7));var _0x14a8=function(_0x8c970,_0x53f322){_0x8c970=_0x8c970-0x0;var _0x832d51=_0x4a81[_0x8c970];return _0x832d51;};'use strict';var _=require(_0x14a8('0x0'));var util=require(_0x14a8('0x1'));var moment=require(_0x14a8('0x2'));var BPromise=require(_0x14a8('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x14a8('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x14a8('0x5'))(_0x14a8('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x14a8('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x134295,_0x4f2829,_0x26e442){return new BPromise(function(_0x4271b5,_0x3ea48f){return client[_0x14a8('0x8')](_0x134295,_0x26e442)[_0x14a8('0x9')](function(_0x5d42cb){logger['info'](_0x14a8('0xa'),_0x4f2829,_0x14a8('0xb'));logger[_0x14a8('0xc')]('Attachment,\x20%s,\x20%s,\x20%s',_0x4f2829,_0x14a8('0xb'),JSON[_0x14a8('0xd')](_0x5d42cb));if(_0x5d42cb[_0x14a8('0xe')]){if(_0x5d42cb[_0x14a8('0xe')][_0x14a8('0xf')]===0x1f4){logger[_0x14a8('0xe')](_0x14a8('0xa'),_0x4f2829,_0x5d42cb[_0x14a8('0xe')]['message']);return _0x3ea48f(_0x5d42cb['error'][_0x14a8('0x10')]);}logger[_0x14a8('0xe')]('Attachment,\x20%s,\x20%s',_0x4f2829,_0x5d42cb[_0x14a8('0xe')]['message']);return _0x4271b5(_0x5d42cb[_0x14a8('0xe')][_0x14a8('0x10')]);}else{logger[_0x14a8('0x11')](_0x14a8('0xa'),_0x4f2829,_0x14a8('0xb'));_0x4271b5(_0x5d42cb[_0x14a8('0x12')]['message']);}})[_0x14a8('0x13')](function(_0x30de2c){logger['error'](_0x14a8('0xa'),_0x4f2829,_0x30de2c);_0x3ea48f(_0x30de2c);});});}exports['CreateAttachment']=function(_0x98e1d5){var _0x1dac45=this;return new Promise(function(_0x456b7f,_0x1069c8){return db[_0x14a8('0x14')][_0x14a8('0x15')](_0x98e1d5['body'],{'raw':_0x98e1d5[_0x14a8('0x16')]?_0x98e1d5[_0x14a8('0x16')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x1956a2){logger['info'](_0x14a8('0x17'),_0x98e1d5);logger['debug'](_0x14a8('0x17'),_0x98e1d5,JSON['stringify'](_0x1956a2));_0x456b7f(_0x1956a2);})[_0x14a8('0x13')](function(_0x3afd58){logger[_0x14a8('0xe')](_0x14a8('0x17'),_0x3afd58['message'],_0x98e1d5);_0x1069c8(_0x1dac45[_0x14a8('0xe')](0x1f4,_0x3afd58['message']));});});}; \ No newline at end of file diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js index a0e356e..86179c0 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(_0x589636,_0x1bfbf2){var _0x40c432=function(_0x1a6ee0){while(--_0x1a6ee0){_0x589636['push'](_0x589636['shift']());}};_0x40c432(++_0x1bfbf2);}(_0xb10b,0x12a));var _0xbb10=function(_0xfad1a7,_0x2e3b8d){_0xfad1a7=_0xfad1a7-0x0;var _0x571012=_0xb10b[_0xfad1a7];return _0x571012;};'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 _0xadb5=['root','format','%s-%s','originalname','replace','file','put','update','delete','destroy','exports','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/download','download','post','/:id/clone'];(function(_0x5a139c,_0x3efe40){var _0x451a1f=function(_0x1e5b21){while(--_0x1e5b21){_0x5a139c['push'](_0x5a139c['shift']());}};_0x451a1f(++_0x3efe40);}(_0xadb5,0xad));var _0x5adb=function(_0x30ccf0,_0x204218){_0x30ccf0=_0x30ccf0-0x0;var _0x1a3d3f=_0xadb5[_0x30ccf0];return _0x1a3d3f;};'use strict';var multer=require('multer');var util=require(_0x5adb('0x0'));var path=require('path');var timeout=require(_0x5adb('0x1'));var express=require(_0x5adb('0x2'));var router=express[_0x5adb('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x5adb('0x4'));var interaction=require(_0x5adb('0x5'));var config=require(_0x5adb('0x6'));var controller=require('./attachment.controller');router[_0x5adb('0x7')]('/',auth[_0x5adb('0x8')](),controller[_0x5adb('0x9')]);router[_0x5adb('0x7')](_0x5adb('0xa'),auth[_0x5adb('0x8')](),controller[_0x5adb('0xb')]);router[_0x5adb('0x7')](_0x5adb('0xc'),auth[_0x5adb('0x8')](),controller[_0x5adb('0xd')]);router[_0x5adb('0xe')](_0x5adb('0xf'),auth[_0x5adb('0x8')](),controller['clone']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1a8f66,_0x1ea238,_0x82e67e){_0x82e67e(null,path['join'](config[_0x5adb('0x10')],'server/files/attachments/'));},'filename':function(_0x2a0b70,_0x5433bf,_0x8cfcc6){_0x8cfcc6(null,util[_0x5adb('0x11')](_0x5adb('0x12'),Date['now'](),_0x5433bf[_0x5adb('0x13')][_0x5adb('0x14')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x5adb('0xe')]('/',upload['single'](_0x5adb('0x15')),controller['create']);router[_0x5adb('0x16')](_0x5adb('0xa'),auth[_0x5adb('0x8')](),controller[_0x5adb('0x17')]);router[_0x5adb('0x18')](_0x5adb('0xa'),auth[_0x5adb('0x8')](),controller[_0x5adb('0x19')]);module[_0x5adb('0x1a')]=router; \ No newline at end of file diff --git a/server/api/authActiveDirectory/authActiveDirectory.controller.js b/server/api/authActiveDirectory/authActiveDirectory.controller.js index 02e238c..6123774 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 _0xa85a=['Something\x20went\x20wrong,\x20please\x20try\x20again.','json','passport-local','Strategy','moment','activedirectory2','bluebird','util','../../mysqldb','../../components/auth/service','../../config/environment','../../config/logger','api','activedirectory','undefined','baseDN','url','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:\x20Active\x20Directory\x20not\x20configured','Setting','adSsoEnabled','blockDuration','then','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','name','password','salt','role','blocked','blockedAt','online','user','domain','disabled','add','minutes','clearBlockUser','getLicense','catch','status','send','message','login','ad-login'];(function(_0x1df594,_0x413926){var _0x36eb6d=function(_0x24c6de){while(--_0x24c6de){_0x1df594['push'](_0x1df594['shift']());}};_0x36eb6d(++_0x413926);}(_0xa85a,0x92));var _0xaa85=function(_0x1e4360,_0x930b9b){_0x1e4360=_0x1e4360-0x0;var _0x31e6b4=_0xa85a[_0x1e4360];return _0x31e6b4;};'use strict';var passport=require('passport');var LocalStrategy=require(_0xaa85('0x0'))[_0xaa85('0x1')];var moment=require(_0xaa85('0x2'));var ActiveDirectory=require(_0xaa85('0x3'));var BPromise=require(_0xaa85('0x4'));var util=require(_0xaa85('0x5'));var db=require(_0xaa85('0x6'))['db'];var authService=require(_0xaa85('0x7'));var utils=require('../../config/utils');var config=require(_0xaa85('0x8'));var logger=require(_0xaa85('0x9'))(_0xaa85('0xa'));function isActiveDirectoryConfigured(_0x39bd0a){var _0x2ff88f=![];if(typeof _0x39bd0a[_0xaa85('0xb')]!==_0xaa85('0xc')){_0x2ff88f=_0x39bd0a['activedirectory'][_0xaa85('0xd')]&&_0x39bd0a[_0xaa85('0xb')][_0xaa85('0xe')]&&_0x39bd0a['activedirectory']['domain'];}return _0x2ff88f;}function adAuthenticate(_0x541bec,_0xd61a01,_0x57d02e){return new BPromise(function(_0x504b62,_0x133628){try{var _0x294f14=new ActiveDirectory(_0x541bec);_0x294f14[_0xaa85('0xf')](_0xd61a01,_0x57d02e,function(_0x4a8984,_0x57931d){if(_0x4a8984){logger[_0xaa85('0x10')](_0xaa85('0x11'),_0xd61a01,util[_0xaa85('0x12')](_0x4a8984,{'showHidden':![],'depth':null}));_0x133628(_0xaa85('0x13'));}else if(!_0x57931d){logger[_0xaa85('0x10')]('Error\x20authenticate\x20%s:\x20Wrong\x20credentials',_0xd61a01);_0x133628('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x504b62(_0x57931d);}});}catch(_0x488787){_0x133628(_0x488787);}});}function ActiveDirectoryAuthenticate(_0x421fab,_0x71ac91,_0x11c5f8,_0x52a0b7){var _0x35dccf,_0x59b92a;if(!isActiveDirectoryConfigured(config)){logger[_0xaa85('0x10')](_0xaa85('0x14'),_0x71ac91);return _0x52a0b7(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}return db[_0xaa85('0x15')]['findOne']({'where':{'id':0x1},'attributes':[_0xaa85('0x16'),_0xaa85('0x17')],'raw':!![]})[_0xaa85('0x18')](function(_0x4fed08){_0x35dccf=_0x4fed08;if(!_0x35dccf['adSsoEnabled']){logger[_0xaa85('0x10')](_0xaa85('0x19'),_0x71ac91);throw new Error(_0xaa85('0x13'));}return _0x421fab['findOne']({'attributes':['id',_0xaa85('0x1a'),_0xaa85('0x1b'),_0xaa85('0x1c'),_0xaa85('0x1d'),'disabled',_0xaa85('0x1e'),_0xaa85('0x1f'),_0xaa85('0x20')],'where':{'name':_0x71ac91,'role':{'$or':['admin',_0xaa85('0x21'),'agent']},'adSsoEnabled':!![]}});})['then'](function(_0x35b626){if(!_0x35b626||_0x35b626&&_0x35b626[_0xaa85('0x1a')]!==_0x71ac91){throw new Error(_0xaa85('0x13'));}_0x59b92a=_0x35b626;var _0x526637=_0x59b92a[_0xaa85('0x1a')]+'@'+config[_0xaa85('0xb')][_0xaa85('0x22')];return adAuthenticate(config[_0xaa85('0xb')],_0x526637,_0x11c5f8);})[_0xaa85('0x18')](function(_0x3be220){if(_0x59b92a[_0xaa85('0x23')]){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}if(_0x35dccf['blockDuration']>0x0){if(_0x59b92a[_0xaa85('0x1e')]){if(moment(_0x59b92a['blockedAt'])[_0xaa85('0x24')](_0x35dccf[_0xaa85('0x17')],_0xaa85('0x25'))>moment()){throw new Error(_0xaa85('0x13'));}return utils[_0xaa85('0x26')](_0x59b92a,0x0,![],null)[_0xaa85('0x18')](function(){return utils[_0xaa85('0x27')](_0x59b92a);})[_0xaa85('0x18')](function(){return _0x52a0b7(null,_0x59b92a);});}else{return utils[_0xaa85('0x27')](_0x59b92a)['then'](function(){return _0x52a0b7(null,_0x59b92a);});}}else{return utils[_0xaa85('0x27')](_0x59b92a)['then'](function(){return _0x52a0b7(null,_0x59b92a);});}})[_0xaa85('0x28')](function(_0x4e7e32){return _0x52a0b7(null,![],_0x4e7e32);});}function handleError(_0x38fc0c,_0x56e28b,_0x2e1a83){return _0x38fc0c[_0xaa85('0x29')](_0x56e28b||0x1f4)[_0xaa85('0x2a')]({'message':_0x2e1a83?_0x2e1a83[_0xaa85('0x2b')]||_0x2e1a83:''});}exports[_0xaa85('0x2c')]=function(_0x1dcf0d,_0x2b737a,_0x413641){passport['authenticate'](_0xaa85('0x2d'),function(_0x472d6a,_0x25636c,_0x532f01){var _0x424382=_0x472d6a||_0x532f01;if(_0x424382){return handleError(_0x2b737a,0x191,_0x424382);}if(!_0x25636c){return handleError(_0x2b737a,0x194,{'message':_0xaa85('0x2e')});}else{var _0x54264a={'payload':{'id':_0x25636c['id'],'role':_0x25636c[_0xaa85('0x1d')]},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x54264a)[_0xaa85('0x18')](function(_0x1acbec){_0x2b737a[_0xaa85('0x2f')]({'id':_0x25636c['id'],'token':_0x1acbec,'statusCall':'','isAlreadyLogged':_0x25636c[_0xaa85('0x20')]});});}})(_0x1dcf0d,_0x2b737a,_0x413641);};passport['use'](_0xaa85('0x2d'),new LocalStrategy({'usernameField':_0xaa85('0x1a'),'passwordField':_0xaa85('0x1b')},function(_0x21b522,_0x4d646f,_0x4e06f7){return ActiveDirectoryAuthenticate(db['User'],_0x21b522,_0x4d646f,_0x4e06f7);})); \ No newline at end of file +var _0x095b=['role','disabled','blocked','blockedAt','online','admin','agent','minutes','clearBlockUser','getLicense','catch','status','send','message','login','ad-login','json','use','passport','Strategy','moment','activedirectory2','bluebird','util','../../components/auth/service','../../config/utils','../../config/environment','../../config/logger','api','activedirectory','undefined','baseDN','url','domain','authenticate','error','inspect','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Error\x20authenticate\x20%s:\x20Wrong\x20credentials','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','adSsoEnabled','blockDuration','then','findOne','name','password'];(function(_0x10f0bb,_0x28d981){var _0x394d08=function(_0x90b69d){while(--_0x90b69d){_0x10f0bb['push'](_0x10f0bb['shift']());}};_0x394d08(++_0x28d981);}(_0x095b,0x6e));var _0xb095=function(_0x5d6782,_0x147ce3){_0x5d6782=_0x5d6782-0x0;var _0x437e00=_0x095b[_0x5d6782];return _0x437e00;};'use strict';var passport=require(_0xb095('0x0'));var LocalStrategy=require('passport-local')[_0xb095('0x1')];var moment=require(_0xb095('0x2'));var ActiveDirectory=require(_0xb095('0x3'));var BPromise=require(_0xb095('0x4'));var util=require(_0xb095('0x5'));var db=require('../../mysqldb')['db'];var authService=require(_0xb095('0x6'));var utils=require(_0xb095('0x7'));var config=require(_0xb095('0x8'));var logger=require(_0xb095('0x9'))(_0xb095('0xa'));function isActiveDirectoryConfigured(_0x3e4cc9){var _0x24deed=![];if(typeof _0x3e4cc9[_0xb095('0xb')]!==_0xb095('0xc')){_0x24deed=_0x3e4cc9['activedirectory'][_0xb095('0xd')]&&_0x3e4cc9[_0xb095('0xb')][_0xb095('0xe')]&&_0x3e4cc9[_0xb095('0xb')][_0xb095('0xf')];}return _0x24deed;}function adAuthenticate(_0x311c57,_0x5c3522,_0x47f74d){return new BPromise(function(_0x2e510a,_0x3c30b7){try{var _0x52f0c5=new ActiveDirectory(_0x311c57);_0x52f0c5[_0xb095('0x10')](_0x5c3522,_0x47f74d,function(_0x104c12,_0x5a0062){if(_0x104c12){logger[_0xb095('0x11')]('Error\x20authenticate\x20%s:\x20%s',_0x5c3522,util[_0xb095('0x12')](_0x104c12,{'showHidden':![],'depth':null}));_0x3c30b7(_0xb095('0x13'));}else if(!_0x5a0062){logger[_0xb095('0x11')](_0xb095('0x14'),_0x5c3522);_0x3c30b7(_0xb095('0x13'));}else{_0x2e510a(_0x5a0062);}});}catch(_0x394df0){_0x3c30b7(_0x394df0);}});}function ActiveDirectoryAuthenticate(_0x781a3f,_0x4afb4d,_0x2d6e3b,_0x3a77f1){var _0x44280b,_0x2e6a89;if(!isActiveDirectoryConfigured(config)){logger[_0xb095('0x11')](_0xb095('0x15'),_0x4afb4d);return _0x3a77f1(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}return db['Setting']['findOne']({'where':{'id':0x1},'attributes':[_0xb095('0x16'),_0xb095('0x17')],'raw':!![]})[_0xb095('0x18')](function(_0x54d06){_0x44280b=_0x54d06;if(!_0x44280b[_0xb095('0x16')]){logger[_0xb095('0x11')]('Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled',_0x4afb4d);throw new Error(_0xb095('0x13'));}return _0x781a3f[_0xb095('0x19')]({'attributes':['id',_0xb095('0x1a'),_0xb095('0x1b'),'salt',_0xb095('0x1c'),_0xb095('0x1d'),_0xb095('0x1e'),_0xb095('0x1f'),_0xb095('0x20')],'where':{'name':_0x4afb4d,'role':{'$or':[_0xb095('0x21'),'user',_0xb095('0x22')]},'adSsoEnabled':!![]}});})['then'](function(_0x51750f){if(!_0x51750f||_0x51750f&&_0x51750f['name']!==_0x4afb4d){throw new Error(_0xb095('0x13'));}_0x2e6a89=_0x51750f;var _0x49c2ee=_0x2e6a89[_0xb095('0x1a')]+'@'+config[_0xb095('0xb')][_0xb095('0xf')];return adAuthenticate(config[_0xb095('0xb')],_0x49c2ee,_0x2d6e3b);})['then'](function(_0x5bfe24){if(_0x2e6a89[_0xb095('0x1d')]){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}if(_0x44280b[_0xb095('0x17')]>0x0){if(_0x2e6a89[_0xb095('0x1e')]){if(moment(_0x2e6a89[_0xb095('0x1f')])['add'](_0x44280b[_0xb095('0x17')],_0xb095('0x23'))>moment()){throw new Error(_0xb095('0x13'));}return utils[_0xb095('0x24')](_0x2e6a89,0x0,![],null)[_0xb095('0x18')](function(){return utils[_0xb095('0x25')](_0x2e6a89);})[_0xb095('0x18')](function(){return _0x3a77f1(null,_0x2e6a89);});}else{return utils[_0xb095('0x25')](_0x2e6a89)['then'](function(){return _0x3a77f1(null,_0x2e6a89);});}}else{return utils['getLicense'](_0x2e6a89)[_0xb095('0x18')](function(){return _0x3a77f1(null,_0x2e6a89);});}})[_0xb095('0x26')](function(_0x53803f){return _0x3a77f1(null,![],_0x53803f);});}function handleError(_0x2f273f,_0x3d00d1,_0x468d94){return _0x2f273f[_0xb095('0x27')](_0x3d00d1||0x1f4)[_0xb095('0x28')]({'message':_0x468d94?_0x468d94[_0xb095('0x29')]||_0x468d94:''});}exports[_0xb095('0x2a')]=function(_0x4d5a6d,_0x14760d,_0x37aa68){passport[_0xb095('0x10')](_0xb095('0x2b'),function(_0x3ec688,_0x27f82a,_0x30c606){var _0x552324=_0x3ec688||_0x30c606;if(_0x552324){return handleError(_0x14760d,0x191,_0x552324);}if(!_0x27f82a){return handleError(_0x14760d,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x4cc45f={'payload':{'id':_0x27f82a['id'],'role':_0x27f82a['role']},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x4cc45f)[_0xb095('0x18')](function(_0x3df9db){_0x14760d[_0xb095('0x2c')]({'id':_0x27f82a['id'],'token':_0x3df9db,'statusCall':'','isAlreadyLogged':_0x27f82a[_0xb095('0x20')]});});}})(_0x4d5a6d,_0x14760d,_0x37aa68);};passport[_0xb095('0x2d')](_0xb095('0x2b'),new LocalStrategy({'usernameField':_0xb095('0x1a'),'passwordField':_0xb095('0x1b')},function(_0x38bd95,_0x447a28,_0x4fa93f){return ActiveDirectoryAuthenticate(db['User'],_0x38bd95,_0x447a28,_0x4fa93f);})); \ No newline at end of file diff --git a/server/api/authActiveDirectory/index.js b/server/api/authActiveDirectory/index.js index 6cd8ceb..d9940eb 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 _0x2432=['login','exports','express','Router','./authActiveDirectory.controller'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x2432,0x192));var _0x2243=function(_0x2ac85d,_0x450728){_0x2ac85d=_0x2ac85d-0x0;var _0x706845=_0x2432[_0x2ac85d];return _0x706845;};'use strict';var express=require(_0x2243('0x0'));var router=express[_0x2243('0x1')]();var controller=require(_0x2243('0x2'));router['post']('/',controller[_0x2243('0x3')]);module[_0x2243('0x4')]=router; \ No newline at end of file +var _0x8749=['login','exports','express','Router','post'];(function(_0x4ceba6,_0x26e735){var _0x1af796=function(_0x50969e){while(--_0x50969e){_0x4ceba6['push'](_0x4ceba6['shift']());}};_0x1af796(++_0x26e735);}(_0x8749,0x156));var _0x9874=function(_0x5ee9f5,_0xdbca0a){_0x5ee9f5=_0x5ee9f5-0x0;var _0x5469cc=_0x8749[_0x5ee9f5];return _0x5469cc;};'use strict';var express=require(_0x9874('0x0'));var router=express[_0x9874('0x1')]();var controller=require('./authActiveDirectory.controller');router[_0x9874('0x2')]('/',controller[_0x9874('0x3')]);module[_0x9874('0x4')]=router; \ No newline at end of file diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js index 7404413..2baca3e 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(_0x7844b9,_0x579e6a){var _0x4e9db6=function(_0x319afb){while(--_0x319afb){_0x7844b9['push'](_0x7844b9['shift']());}};_0x4e9db6(++_0x579e6a);}(_0x9957,0x93));var _0x7995=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x9957[_0x3b380d];return _0x54502b;};'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(_0xc67528,_0x24e2fb){var _0x38e26d=function(_0x1b0efe){while(--_0x1b0efe){_0xc67528['push'](_0xc67528['shift']());}};_0x38e26d(++_0x24e2fb);}(_0x7a54,0x106));var _0x47a5=function(_0x2dee04,_0x4962e7){_0x2dee04=_0x2dee04-0x0;var _0x6d9f19=_0x7a54[_0x2dee04];return _0x6d9f19;};'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 2263a62..d35fdd5 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 _0x2aef=['get','callback','setTokenCookie','./authGoogle.controller','../user/user.controller.js','../../components/auth/service','login'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x2aef,0x122));var _0xf2ae=function(_0x2e766c,_0x25860d){_0x2e766c=_0x2e766c-0x0;var _0x200f71=_0x2aef[_0x2e766c];return _0x200f71;};'use strict';var express=require('express');var passport=require('passport');var router=express['Router']();var controller=require(_0xf2ae('0x0'));var userController=require(_0xf2ae('0x1'));var authService=require(_0xf2ae('0x2'));router['get']('/',controller[_0xf2ae('0x3')]);router[_0xf2ae('0x4')]('/callback',controller[_0xf2ae('0x5')],authService['isMiddleware'],userController[_0xf2ae('0x3')],authService[_0xf2ae('0x6')]);module['exports']=router; \ No newline at end of file +var _0xc076=['callback','exports','express','passport','Router','../user/user.controller.js','../../components/auth/service','get','login','/callback'];(function(_0x9826d,_0x302ffb){var _0x46b230=function(_0x3a8bef){while(--_0x3a8bef){_0x9826d['push'](_0x9826d['shift']());}};_0x46b230(++_0x302ffb);}(_0xc076,0x84));var _0x6c07=function(_0x472553,_0x10bc21){_0x472553=_0x472553-0x0;var _0x401925=_0xc076[_0x472553];return _0x401925;};'use strict';var express=require(_0x6c07('0x0'));var passport=require(_0x6c07('0x1'));var router=express[_0x6c07('0x2')]();var controller=require('./authGoogle.controller');var userController=require(_0x6c07('0x3'));var authService=require(_0x6c07('0x4'));router[_0x6c07('0x5')]('/',controller[_0x6c07('0x6')]);router[_0x6c07('0x5')](_0x6c07('0x7'),controller[_0x6c07('0x8')],authService['isMiddleware'],userController[_0x6c07('0x6')],authService['setTokenCookie']);module[_0x6c07('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 a39ff01..c29aa0b 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 _0x94b2=['blockDuration','then','findOne','name','password','blockedAt','loginAttempts','admin','user','agent','authenticate','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blocked','clearBlockUser','add','minutes','getLicense','catch','MailAccount','find','Smtp','CloudProvider','getSmtpOptions','merge','format','\x22%s\x22\x20<%s>','email','request','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','stringify','status','send','local-login','role','signToken','json','forgot','Email\x20parameter\x20is\x20missing','body','trim','toLowerCase','Setting','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','now','save','xCally\x20Motion\x20Password\x20Reset','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','host','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','Reset\x20Email\x20sent!','reset','params','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','passwordHistoryLimit','validatePasswordPattern','validatePasswordHistory','previousPasswords','passport','passport-local','Strategy','randomstring','moment','../../mysqldb','../../components/auth/service','../../config/utils','client','allowedLoginAttempts'];(function(_0x3845bc,_0x55cf5e){var _0x56a1e1=function(_0x5c26fd){while(--_0x5c26fd){_0x3845bc['push'](_0x3845bc['shift']());}};_0x56a1e1(++_0x55cf5e);}(_0x94b2,0xe6));var _0x294b=function(_0x4a78eb,_0x1fe157){_0x4a78eb=_0x4a78eb-0x0;var _0x3947b1=_0x94b2[_0x4a78eb];return _0x3947b1;};'use strict';var util=require('util');var passport=require(_0x294b('0x0'));var LocalStrategy=require(_0x294b('0x1'))[_0x294b('0x2')];var jayson=require('jayson/promise');var _=require('lodash');var rs=require(_0x294b('0x3'));var moment=require(_0x294b('0x4'));var db=require(_0x294b('0x5'))['db'];var authService=require(_0x294b('0x6'));var utils=require(_0x294b('0x7'));var client=jayson[_0x294b('0x8')]['http']({'port':0x232b});function localAuthenticate(_0x37171a,_0x217615,_0xa6a01f,_0x331583){var _0x41fd20,_0x1c8761;return db['Setting']['findOne']({'where':{'id':0x1},'attributes':[_0x294b('0x9'),_0x294b('0xa')],'raw':!![]})[_0x294b('0xb')](function(_0x37f987){_0x41fd20=_0x37f987;return _0x37171a[_0x294b('0xc')]({'attributes':['id',_0x294b('0xd'),_0x294b('0xe'),'salt','role','disabled','blocked',_0x294b('0xf'),_0x294b('0x10')],'where':{'name':_0x217615,'role':{'$or':[_0x294b('0x11'),_0x294b('0x12'),_0x294b('0x13')]}}});})['then'](function(_0x1f0c90){if(!_0x1f0c90||_0x1f0c90&&_0x1f0c90[_0x294b('0xd')]!==_0x217615){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x1c8761=_0x1f0c90;return _0x1c8761;}})[_0x294b('0xb')](function(){_0x1c8761[_0x294b('0x14')](_0xa6a01f,function(_0x107efd,_0x4e063c){var _0x1d1cd3=_0x1c8761[_0x294b('0x10')]+0x1;if(_0x107efd){return _0x331583(_0x107efd);}else if(!_0x4e063c){if(_0x1c8761[_0x294b('0x15')]){return _0x331583(null,![],{'message':_0x294b('0x16')});}else if(_0x41fd20['allowedLoginAttempts']>0x0){if(_0x1c8761[_0x294b('0x17')]){if(_0x41fd20[_0x294b('0xa')]>0x0){if(moment(_0x1c8761[_0x294b('0xf')])['add'](_0x41fd20['blockDuration'],'minutes')>moment()){return _0x331583(null,![],{'message':_0x294b('0x16')});}else{return utils[_0x294b('0x18')](_0x1c8761,_0x1d1cd3,![],null)[_0x294b('0xb')](function(){return _0x331583(null,![],{'message':_0x294b('0x16')});});}}else{return _0x331583(null,![],{'message':_0x294b('0x16')});}}else{if(_0x1d1cd3>=_0x41fd20[_0x294b('0x9')]){return utils[_0x294b('0x18')](_0x1c8761,0x0,!![],moment())[_0x294b('0xb')](function(){return _0x331583(null,![],{'message':_0x294b('0x16')});});}else{return utils[_0x294b('0x18')](_0x1c8761,_0x1d1cd3,![],null)[_0x294b('0xb')](function(){return _0x331583(null,![],{'message':_0x294b('0x16')});});}}}else{return _0x331583(null,![],{'message':_0x294b('0x16')});}}else{if(_0x1c8761['disabled']){return _0x331583(null,![],{'message':_0x294b('0x16')});}else if(_0x41fd20[_0x294b('0x9')]>0x0){if(_0x1c8761[_0x294b('0x17')]){if(_0x41fd20[_0x294b('0xa')]>0x0){if(moment(_0x1c8761[_0x294b('0xf')])[_0x294b('0x19')](_0x41fd20[_0x294b('0xa')],_0x294b('0x1a'))>moment()){return _0x331583(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils['clearBlockUser'](_0x1c8761,0x0,![],null)['then'](function(){return utils['getLicense'](_0x1c8761);})[_0x294b('0xb')](function(){return _0x331583(null,_0x1c8761);});}}else{return _0x331583(null,![],{'message':_0x294b('0x16')});}}else{return utils[_0x294b('0x18')](_0x1c8761,0x0,![],null)['then'](function(){return utils[_0x294b('0x1b')](_0x1c8761);})[_0x294b('0xb')](function(){return _0x331583(null,_0x1c8761);})['catch'](function(_0x47c081){return _0x331583(null,![],_0x47c081);});}}else{if(_0x1c8761[_0x294b('0x17')]){return _0x331583(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0x294b('0x1b')](_0x1c8761)[_0x294b('0xb')](function(){return _0x331583(null,_0x1c8761);});}}}});})[_0x294b('0x1c')](function(_0x2a16d6){return _0x331583(null,![],_0x2a16d6);});}function sendServiceMail(_0x41cddf){return db[_0x294b('0x1d')][_0x294b('0x1e')]({'where':{'service':!![]},'attributes':['id',_0x294b('0xd'),'email'],'include':[{'model':db['MailServerOut'],'as':_0x294b('0x1f'),'include':[{'model':db[_0x294b('0x20')],'as':'CloudProvider'}]}]})['then'](function(_0x472145){if(!_0x472145){throw new Error('Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!');}var _0x24e3dc=_0x472145[_0x294b('0x21')]();var _0x191ba7={'account':_0x24e3dc,'message':_[_0x294b('0x22')]({'from':util[_0x294b('0x23')](_0x294b('0x24'),_0x472145[_0x294b('0xd')],_0x472145[_0x294b('0x25')]||_0x472145[_0x294b('0x1f')][_0x294b('0x12')])},_0x41cddf)};return client[_0x294b('0x26')]('SendMail',_0x191ba7);})[_0x294b('0xb')](function(_0x3a9f87){if(_0x3a9f87[_0x294b('0x27')]){throw new Error(util[_0x294b('0x23')](_0x294b('0x28'),_0x3a9f87[_0x294b('0x27')][_0x294b('0x29')]||JSON[_0x294b('0x2a')](_0x3a9f87[_0x294b('0x27')])));}return!![];});}function handleError(_0x82bd49,_0x2da3b1,_0x4ee06b){return _0x82bd49[_0x294b('0x2b')](_0x2da3b1||0x1f4)[_0x294b('0x2c')]({'message':_0x4ee06b?_0x4ee06b[_0x294b('0x29')]||_0x4ee06b:''});}exports['login']=function(_0x2da245,_0x267980,_0x1a32af){passport[_0x294b('0x14')](_0x294b('0x2d'),function(_0xad846c,_0xa03615,_0x41b2c9){var _0x3b85c3=_0xad846c||_0x41b2c9;if(_0x3b85c3){return handleError(_0x267980,0x191,_0x3b85c3);}if(!_0xa03615){return handleError(_0x267980,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x39aec8={'payload':{'id':_0xa03615['id'],'role':_0xa03615[_0x294b('0x2e')]},'options':{'expiresIn':0x15180}};return authService[_0x294b('0x2f')](_0x39aec8)[_0x294b('0xb')](function(_0x29ab5d){_0x267980[_0x294b('0x30')]({'id':_0xa03615['id'],'token':_0x29ab5d,'statusCall':'','isAlreadyLogged':_0xa03615['online']});});}})(_0x2da245,_0x267980,_0x1a32af);};exports[_0x294b('0x31')]=function(_0x2367be,_0x1eebb9){if(!_0x2367be['body'][_0x294b('0x25')]){return handleError(_0x1eebb9,0x1f4,{'message':_0x294b('0x32')});}var _0x225482=rs['generate']();_0x2367be[_0x294b('0x33')][_0x294b('0x25')]=_0x2367be[_0x294b('0x33')][_0x294b('0x25')][_0x294b('0x34')]()[_0x294b('0x35')]();var _0x4f02ed;return db[_0x294b('0x36')][_0x294b('0xc')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0x294b('0xa')],'raw':!![]})['then'](function(_0x277192){_0x4f02ed=_0x277192;return db[_0x294b('0x37')][_0x294b('0x1e')]({'where':{'email':_0x2367be[_0x294b('0x33')][_0x294b('0x25')]}});})['then'](function(_0x3889bc){if(!_0x3889bc){throw new Error(_0x294b('0x38'));}if(_0x3889bc[_0x294b('0x15')]){throw new Error(_0x294b('0x39'));}if(_0x3889bc[_0x294b('0x17')]){if(moment(_0x3889bc[_0x294b('0xf')])[_0x294b('0x19')](_0x4f02ed[_0x294b('0xa')],'minutes')>moment()){throw new Error(_0x294b('0x3a'));}else{_0x3889bc[_0x294b('0x17')]=![];_0x3889bc[_0x294b('0xf')]=null;}}_0x3889bc[_0x294b('0x3b')]=_0x225482;_0x3889bc[_0x294b('0x3c')]=Date[_0x294b('0x3d')]()+0x36ee80;return _0x3889bc[_0x294b('0x3e')]();})[_0x294b('0xb')](function(){return sendServiceMail({'to':_0x2367be[_0x294b('0x33')]['email'],'subject':_0x294b('0x3f'),'text':'You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a'+_0x294b('0x40')+_0x294b('0x41')+_0x2367be['headers'][_0x294b('0x42')]+_0x294b('0x43')+_0x225482+'\x0a\x0a'+_0x294b('0x44')});})[_0x294b('0xb')](function(){_0x1eebb9[_0x294b('0x2b')](0xc8)[_0x294b('0x2c')]({'message':_0x294b('0x45')});})[_0x294b('0x1c')](function(_0x560db6){return handleError(_0x1eebb9,0x1f4,_0x560db6);});};exports[_0x294b('0x46')]=function(_0x2b2fbb,_0x57d4b0){return db[_0x294b('0x37')][_0x294b('0x1e')]({'where':{'resetPasswordToken':_0x2b2fbb[_0x294b('0x47')][_0x294b('0x48')],'resetPasswordExpires':{'$gt':Date['now']()}}})[_0x294b('0xb')](function(_0x3d232d){if(!_0x3d232d){throw new Error(_0x294b('0x49'));}return db[_0x294b('0x36')][_0x294b('0xc')]({'attributes':['id',_0x294b('0x4a'),_0x294b('0x4b'),_0x294b('0x4c')]})[_0x294b('0xb')](function(_0x23c7d3){if(_0x23c7d3[_0x294b('0x4a')])authService[_0x294b('0x4d')](_0x2b2fbb[_0x294b('0x33')][_0x294b('0xe')]);if(!_0x23c7d3[_0x294b('0x4b')]||!_0x3d232d['previousPasswords'])return _0x3d232d;authService[_0x294b('0x4e')](_0x2b2fbb[_0x294b('0x33')][_0x294b('0xe')],_0x3d232d[_0x294b('0x4f')],_0x23c7d3[_0x294b('0x4c')]);return _0x3d232d;})[_0x294b('0xb')](function(){_0x3d232d[_0x294b('0xe')]=_0x2b2fbb[_0x294b('0x33')][_0x294b('0xe')];_0x3d232d[_0x294b('0x3b')]=null;_0x3d232d[_0x294b('0x3c')]=null;return _0x3d232d[_0x294b('0x3e')]();});})[_0x294b('0xb')](function(){_0x57d4b0[_0x294b('0x2b')](0xc8)[_0x294b('0x2c')]({'message':'Password\x20reset!'});})[_0x294b('0x1c')](function(_0xa16375){return handleError(_0x57d4b0,0x1f4,_0xa16375);});};passport['use']('local-login',new LocalStrategy({'usernameField':_0x294b('0xd'),'passwordField':_0x294b('0xe')},function(_0x4d1cbf,_0x229dd1,_0x2d55ef){return localAuthenticate(db[_0x294b('0x37')],_0x4d1cbf,_0x229dd1,_0x2d55ef);})); \ No newline at end of file +var _0x430b=['Something\x20went\x20wrong,\x20please\x20try\x20again.','role','signToken','json','online','body','Email\x20parameter\x20is\x20missing','generate','trim','toLowerCase','User','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','now','save','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','headers','host','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','Reset\x20Email\x20sent!','reset','params','token','enforcePasswordHistory','validatePasswordHistory','Password\x20reset!','util','Strategy','jayson/promise','lodash','randomstring','moment','../../mysqldb','../../components/auth/service','../../config/utils','client','http','Setting','findOne','allowedLoginAttempts','blockDuration','password','salt','blocked','loginAttempts','admin','then','name','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','blockedAt','add','minutes','clearBlockUser','disabled','getLicense','catch','MailAccount','find','email','MailServerOut','Smtp','CloudProvider','getSmtpOptions','format','\x22%s\x22\x20<%s>','request','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','status','send','login'];(function(_0x1b1ba2,_0x4c10d0){var _0xc20480=function(_0x5bdef){while(--_0x5bdef){_0x1b1ba2['push'](_0x1b1ba2['shift']());}};_0xc20480(++_0x4c10d0);}(_0x430b,0x1b0));var _0xb430=function(_0x26f1b2,_0x33d843){_0x26f1b2=_0x26f1b2-0x0;var _0x1624a4=_0x430b[_0x26f1b2];return _0x1624a4;};'use strict';var util=require(_0xb430('0x0'));var passport=require('passport');var LocalStrategy=require('passport-local')[_0xb430('0x1')];var jayson=require(_0xb430('0x2'));var _=require(_0xb430('0x3'));var rs=require(_0xb430('0x4'));var moment=require(_0xb430('0x5'));var db=require(_0xb430('0x6'))['db'];var authService=require(_0xb430('0x7'));var utils=require(_0xb430('0x8'));var client=jayson[_0xb430('0x9')][_0xb430('0xa')]({'port':0x232b});function localAuthenticate(_0x3c881a,_0x51b81d,_0xb5dd27,_0x17f0bf){var _0x3364d0,_0x338d3d;return db[_0xb430('0xb')][_0xb430('0xc')]({'where':{'id':0x1},'attributes':[_0xb430('0xd'),_0xb430('0xe')],'raw':!![]})['then'](function(_0x16dbab){_0x3364d0=_0x16dbab;return _0x3c881a[_0xb430('0xc')]({'attributes':['id','name',_0xb430('0xf'),_0xb430('0x10'),'role','disabled',_0xb430('0x11'),'blockedAt',_0xb430('0x12')],'where':{'name':_0x51b81d,'role':{'$or':[_0xb430('0x13'),'user','agent']}}});})[_0xb430('0x14')](function(_0x1ea485){if(!_0x1ea485||_0x1ea485&&_0x1ea485[_0xb430('0x15')]!==_0x51b81d){throw new Error(_0xb430('0x16'));}else{_0x338d3d=_0x1ea485;return _0x338d3d;}})[_0xb430('0x14')](function(){_0x338d3d[_0xb430('0x17')](_0xb5dd27,function(_0x1c175c,_0x70240d){var _0x5de10d=_0x338d3d['loginAttempts']+0x1;if(_0x1c175c){return _0x17f0bf(_0x1c175c);}else if(!_0x70240d){if(_0x338d3d['disabled']){return _0x17f0bf(null,![],{'message':_0xb430('0x16')});}else if(_0x3364d0[_0xb430('0xd')]>0x0){if(_0x338d3d['blocked']){if(_0x3364d0[_0xb430('0xe')]>0x0){if(moment(_0x338d3d[_0xb430('0x18')])[_0xb430('0x19')](_0x3364d0['blockDuration'],_0xb430('0x1a'))>moment()){return _0x17f0bf(null,![],{'message':_0xb430('0x16')});}else{return utils[_0xb430('0x1b')](_0x338d3d,_0x5de10d,![],null)['then'](function(){return _0x17f0bf(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}else{return _0x17f0bf(null,![],{'message':_0xb430('0x16')});}}else{if(_0x5de10d>=_0x3364d0['allowedLoginAttempts']){return utils[_0xb430('0x1b')](_0x338d3d,0x0,!![],moment())[_0xb430('0x14')](function(){return _0x17f0bf(null,![],{'message':_0xb430('0x16')});});}else{return utils[_0xb430('0x1b')](_0x338d3d,_0x5de10d,![],null)[_0xb430('0x14')](function(){return _0x17f0bf(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}}else{return _0x17f0bf(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x338d3d[_0xb430('0x1c')]){return _0x17f0bf(null,![],{'message':_0xb430('0x16')});}else if(_0x3364d0[_0xb430('0xd')]>0x0){if(_0x338d3d[_0xb430('0x11')]){if(_0x3364d0[_0xb430('0xe')]>0x0){if(moment(_0x338d3d[_0xb430('0x18')])[_0xb430('0x19')](_0x3364d0[_0xb430('0xe')],_0xb430('0x1a'))>moment()){return _0x17f0bf(null,![],{'message':_0xb430('0x16')});}else{return utils[_0xb430('0x1b')](_0x338d3d,0x0,![],null)[_0xb430('0x14')](function(){return utils['getLicense'](_0x338d3d);})[_0xb430('0x14')](function(){return _0x17f0bf(null,_0x338d3d);});}}else{return _0x17f0bf(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{return utils[_0xb430('0x1b')](_0x338d3d,0x0,![],null)[_0xb430('0x14')](function(){return utils[_0xb430('0x1d')](_0x338d3d);})[_0xb430('0x14')](function(){return _0x17f0bf(null,_0x338d3d);})[_0xb430('0x1e')](function(_0x3bc637){return _0x17f0bf(null,![],_0x3bc637);});}}else{if(_0x338d3d[_0xb430('0x11')]){return _0x17f0bf(null,![],{'message':_0xb430('0x16')});}else{return utils['getLicense'](_0x338d3d)[_0xb430('0x14')](function(){return _0x17f0bf(null,_0x338d3d);});}}}});})[_0xb430('0x1e')](function(_0x1a7fe1){return _0x17f0bf(null,![],_0x1a7fe1);});}function sendServiceMail(_0x177c79){return db[_0xb430('0x1f')][_0xb430('0x20')]({'where':{'service':!![]},'attributes':['id','name',_0xb430('0x21')],'include':[{'model':db[_0xb430('0x22')],'as':_0xb430('0x23'),'include':[{'model':db[_0xb430('0x24')],'as':_0xb430('0x24')}]}]})[_0xb430('0x14')](function(_0x51929b){if(!_0x51929b){throw new Error('Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!');}var _0x4d6701=_0x51929b[_0xb430('0x25')]();var _0x5052ba={'account':_0x4d6701,'message':_['merge']({'from':util[_0xb430('0x26')](_0xb430('0x27'),_0x51929b[_0xb430('0x15')],_0x51929b[_0xb430('0x21')]||_0x51929b[_0xb430('0x23')]['user'])},_0x177c79)};return client[_0xb430('0x28')](_0xb430('0x29'),_0x5052ba);})[_0xb430('0x14')](function(_0x16ad49){if(_0x16ad49[_0xb430('0x2a')]){throw new Error(util[_0xb430('0x26')](_0xb430('0x2b'),_0x16ad49[_0xb430('0x2a')][_0xb430('0x2c')]||JSON['stringify'](_0x16ad49['error'])));}return!![];});}function handleError(_0x58baa4,_0x4776ea,_0x8d4bb0){return _0x58baa4[_0xb430('0x2d')](_0x4776ea||0x1f4)[_0xb430('0x2e')]({'message':_0x8d4bb0?_0x8d4bb0[_0xb430('0x2c')]||_0x8d4bb0:''});}exports[_0xb430('0x2f')]=function(_0x312c48,_0x16a4ba,_0x5b672f){passport[_0xb430('0x17')]('local-login',function(_0x4b04c7,_0x456a4f,_0x3ea222){var _0x4d45b0=_0x4b04c7||_0x3ea222;if(_0x4d45b0){return handleError(_0x16a4ba,0x191,_0x4d45b0);}if(!_0x456a4f){return handleError(_0x16a4ba,0x194,{'message':_0xb430('0x30')});}else{var _0x397123={'payload':{'id':_0x456a4f['id'],'role':_0x456a4f[_0xb430('0x31')]},'options':{'expiresIn':0x15180}};return authService[_0xb430('0x32')](_0x397123)['then'](function(_0x1e9e42){_0x16a4ba[_0xb430('0x33')]({'id':_0x456a4f['id'],'token':_0x1e9e42,'statusCall':'','isAlreadyLogged':_0x456a4f[_0xb430('0x34')]});});}})(_0x312c48,_0x16a4ba,_0x5b672f);};exports['forgot']=function(_0x5ca2aa,_0x18e03e){if(!_0x5ca2aa[_0xb430('0x35')]['email']){return handleError(_0x18e03e,0x1f4,{'message':_0xb430('0x36')});}var _0xdb2e0f=rs[_0xb430('0x37')]();_0x5ca2aa[_0xb430('0x35')][_0xb430('0x21')]=_0x5ca2aa[_0xb430('0x35')][_0xb430('0x21')][_0xb430('0x38')]()[_0xb430('0x39')]();var _0x4a5cea;return db[_0xb430('0xb')][_0xb430('0xc')]({'where':{'id':0x1},'attributes':[_0xb430('0xd'),_0xb430('0xe')],'raw':!![]})[_0xb430('0x14')](function(_0x33f3ec){_0x4a5cea=_0x33f3ec;return db[_0xb430('0x3a')][_0xb430('0x20')]({'where':{'email':_0x5ca2aa[_0xb430('0x35')][_0xb430('0x21')]}});})['then'](function(_0x17c620){if(!_0x17c620){throw new Error('This\x20email\x20is\x20not\x20registered.');}if(_0x17c620[_0xb430('0x1c')]){throw new Error(_0xb430('0x3b'));}if(_0x17c620[_0xb430('0x11')]){if(moment(_0x17c620[_0xb430('0x18')])[_0xb430('0x19')](_0x4a5cea['blockDuration'],'minutes')>moment()){throw new Error(_0xb430('0x3c'));}else{_0x17c620[_0xb430('0x11')]=![];_0x17c620[_0xb430('0x18')]=null;}}_0x17c620[_0xb430('0x3d')]=_0xdb2e0f;_0x17c620[_0xb430('0x3e')]=Date[_0xb430('0x3f')]()+0x36ee80;return _0x17c620[_0xb430('0x40')]();})[_0xb430('0x14')](function(){return sendServiceMail({'to':_0x5ca2aa[_0xb430('0x35')][_0xb430('0x21')],'subject':_0xb430('0x41'),'text':_0xb430('0x42')+_0xb430('0x43')+_0xb430('0x44')+_0x5ca2aa[_0xb430('0x45')][_0xb430('0x46')]+_0xb430('0x47')+_0xdb2e0f+'\x0a\x0a'+_0xb430('0x48')});})[_0xb430('0x14')](function(){_0x18e03e[_0xb430('0x2d')](0xc8)[_0xb430('0x2e')]({'message':_0xb430('0x49')});})[_0xb430('0x1e')](function(_0x1b858a){return handleError(_0x18e03e,0x1f4,_0x1b858a);});};exports[_0xb430('0x4a')]=function(_0x131463,_0x20f62e){return db['User'][_0xb430('0x20')]({'where':{'resetPasswordToken':_0x131463[_0xb430('0x4b')][_0xb430('0x4c')],'resetPasswordExpires':{'$gt':Date[_0xb430('0x3f')]()}}})['then'](function(_0xe9cea){if(!_0xe9cea){throw new Error('Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.');}return db['Setting'][_0xb430('0xc')]({'attributes':['id','securePassword',_0xb430('0x4d'),'passwordHistoryLimit']})[_0xb430('0x14')](function(_0x52b508){if(_0x52b508['securePassword'])authService['validatePasswordPattern'](_0x131463['body'][_0xb430('0xf')]);if(!_0x52b508[_0xb430('0x4d')]||!_0xe9cea['previousPasswords'])return _0xe9cea;authService[_0xb430('0x4e')](_0x131463[_0xb430('0x35')]['password'],_0xe9cea['previousPasswords'],_0x52b508['passwordHistoryLimit']);return _0xe9cea;})[_0xb430('0x14')](function(){_0xe9cea['password']=_0x131463[_0xb430('0x35')][_0xb430('0xf')];_0xe9cea['resetPasswordToken']=null;_0xe9cea['resetPasswordExpires']=null;return _0xe9cea[_0xb430('0x40')]();});})[_0xb430('0x14')](function(){_0x20f62e[_0xb430('0x2d')](0xc8)[_0xb430('0x2e')]({'message':_0xb430('0x4f')});})['catch'](function(_0x5b8dc5){return handleError(_0x20f62e,0x1f4,_0x5b8dc5);});};passport['use']('local-login',new LocalStrategy({'usernameField':_0xb430('0x15'),'passwordField':_0xb430('0xf')},function(_0x1babc4,_0x1f7288,_0x210ed0){return localAuthenticate(db[_0xb430('0x3a')],_0x1babc4,_0x1f7288,_0x210ed0);})); \ No newline at end of file diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js index 72dd66f..54a8acb 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 _0x1e00=['exports','express','Router','./authLocal.controller','login','post','forgot','/reset/:token'];(function(_0x3c8c38,_0x277bc6){var _0x1edcab=function(_0x90dee3){while(--_0x90dee3){_0x3c8c38['push'](_0x3c8c38['shift']());}};_0x1edcab(++_0x277bc6);}(_0x1e00,0x171));var _0x01e0=function(_0x551197,_0x2740c3){_0x551197=_0x551197-0x0;var _0x3fd0c9=_0x1e00[_0x551197];return _0x3fd0c9;};'use strict';var express=require(_0x01e0('0x0'));var router=express[_0x01e0('0x1')]();var controller=require(_0x01e0('0x2'));router['post']('/',controller[_0x01e0('0x3')]);router[_0x01e0('0x4')]('/forgot',controller[_0x01e0('0x5')]);router[_0x01e0('0x4')](_0x01e0('0x6'),controller['reset']);module[_0x01e0('0x7')]=router; \ No newline at end of file +var _0xe339=['express','Router','./authLocal.controller','post','/forgot','forgot','/reset/:token','reset','exports'];(function(_0x4c10fe,_0x19e0b2){var _0x5d4ffe=function(_0x219ac8){while(--_0x219ac8){_0x4c10fe['push'](_0x4c10fe['shift']());}};_0x5d4ffe(++_0x19e0b2);}(_0xe339,0xea));var _0x9e33=function(_0x245efb,_0x2c636b){_0x245efb=_0x245efb-0x0;var _0x59ee7b=_0xe339[_0x245efb];return _0x59ee7b;};'use strict';var express=require(_0x9e33('0x0'));var router=express[_0x9e33('0x1')]();var controller=require(_0x9e33('0x2'));router[_0x9e33('0x3')]('/',controller['login']);router[_0x9e33('0x3')](_0x9e33('0x4'),controller[_0x9e33('0x5')]);router[_0x9e33('0x3')](_0x9e33('0x6'),controller[_0x9e33('0x7')]);module[_0x9e33('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 8e35fe1..1778c57 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 _0x8205=['STRING','BOOLEAN','sequelize','exports'];(function(_0x13aba4,_0x5047c5){var _0x5f4606=function(_0x228f6c){while(--_0x228f6c){_0x13aba4['push'](_0x13aba4['shift']());}};_0x5f4606(++_0x5047c5);}(_0x8205,0x10a));var _0x5820=function(_0x361f7,_0x23f5cb){_0x361f7=_0x361f7-0x0;var _0x1069be=_0x8205[_0x361f7];return _0x1069be;};'use strict';var Sequelize=require(_0x5820('0x0'));module[_0x5820('0x1')]={'name':{'type':Sequelize[_0x5820('0x2')],'allowNull':![]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x5820('0x2')]},'status':{'type':Sequelize[_0x5820('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0xa}}; \ No newline at end of file +var _0xb5e2=['BOOLEAN','INTEGER','sequelize','exports','STRING'];(function(_0x112998,_0x437587){var _0x2b8f18=function(_0x58daa7){while(--_0x58daa7){_0x112998['push'](_0x112998['shift']());}};_0x2b8f18(++_0x437587);}(_0xb5e2,0x1c4));var _0x2b5e=function(_0x443134,_0x2d1962){_0x443134=_0x443134-0x0;var _0x433f23=_0xb5e2[_0x443134];return _0x433f23;};'use strict';var Sequelize=require(_0x2b5e('0x0'));module[_0x2b5e('0x1')]={'name':{'type':Sequelize[_0x2b5e('0x2')],'allowNull':![]},'channel':{'type':Sequelize[_0x2b5e('0x2')]},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize[_0x2b5e('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize[_0x2b5e('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 7462dd4..ded9b91 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 _0xf96c=['filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','keys','then','create','body','find','addConditions','Condition','ids','omit','getConditions','findOne','pick','addActions','Action','getActions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','reject','save','update','destroy','error','name','send','index','Automation','rawAttributes','fieldName','type','key','model','map','query'];(function(_0x1b7043,_0x2e35ff){var _0x17dd57=function(_0x3ec64f){while(--_0x3ec64f){_0x1b7043['push'](_0x1b7043['shift']());}};_0x17dd57(++_0x2e35ff);}(_0xf96c,0x7c));var _0xcf96=function(_0x4bad4a,_0x552a72){_0x4bad4a=_0x4bad4a-0x0;var _0x49df0e=_0xf96c[_0x4bad4a];return _0x49df0e;};'use strict';var emlformat=require(_0xcf96('0x0'));var rimraf=require(_0xcf96('0x1'));var zipdir=require(_0xcf96('0x2'));var jsonpatch=require(_0xcf96('0x3'));var rp=require(_0xcf96('0x4'));var moment=require(_0xcf96('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xcf96('0x6'));var util=require('util');var path=require(_0xcf96('0x7'));var sox=require(_0xcf96('0x8'));var csv=require(_0xcf96('0x9'));var ejs=require(_0xcf96('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xcf96('0xb'));var squel=require(_0xcf96('0xc'));var crypto=require(_0xcf96('0xd'));var jsforce=require(_0xcf96('0xe'));var deskjs=require(_0xcf96('0xf'));var toCsv=require(_0xcf96('0x9'));var querystring=require(_0xcf96('0x10'));var Papa=require(_0xcf96('0x11'));var Redis=require(_0xcf96('0x12'));var authService=require(_0xcf96('0x13'));var qs=require(_0xcf96('0x14'));var as=require(_0xcf96('0x15'));var hardwareService=require(_0xcf96('0x16'));var logger=require(_0xcf96('0x17'))('api');var utils=require(_0xcf96('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xcf96('0x19'));var db=require(_0xcf96('0x1a'))['db'];function respondWithStatusCode(_0x4a5aa3,_0x1175f9){_0x1175f9=_0x1175f9||0xcc;return function(_0xa31f61){if(_0xa31f61){return _0x4a5aa3[_0xcf96('0x1b')](_0x1175f9);}return _0x4a5aa3[_0xcf96('0x1c')](_0x1175f9)[_0xcf96('0x1d')]();};}function respondWithResult(_0x171e3e,_0x36e363){_0x36e363=_0x36e363||0xc8;return function(_0x1cd668){if(_0x1cd668){return _0x171e3e[_0xcf96('0x1c')](_0x36e363)[_0xcf96('0x1e')](_0x1cd668);}};}function respondWithFilteredResult(_0x1c8b69,_0x2881fd){return function(_0x54d3c8){if(_0x54d3c8){var _0x38bf78=typeof _0x2881fd[_0xcf96('0x1f')]===_0xcf96('0x20')&&typeof _0x2881fd['limit']===_0xcf96('0x20');var _0xc96361=_0x54d3c8[_0xcf96('0x21')];var _0x3c8641=_0x38bf78?0x0:_0x2881fd[_0xcf96('0x1f')];var _0x60496e=_0x38bf78?_0x54d3c8['count']:_0x2881fd[_0xcf96('0x1f')]+_0x2881fd['limit'];var _0x22a6da;if(_0x60496e>=_0xc96361){_0x60496e=_0xc96361;_0x22a6da=0xc8;}else{_0x22a6da=0xce;}_0x1c8b69[_0xcf96('0x1c')](_0x22a6da);return _0x1c8b69[_0xcf96('0x22')](_0xcf96('0x23'),_0x3c8641+'-'+_0x60496e+'/'+_0xc96361)[_0xcf96('0x1e')](_0x54d3c8);}return null;};}function patchUpdates(_0x141ced){return function(_0x31c40b){try{jsonpatch['apply'](_0x31c40b,_0x141ced,!![]);}catch(_0xce7800){return BPromise[_0xcf96('0x24')](_0xce7800);}return _0x31c40b[_0xcf96('0x25')]();};}function saveUpdates(_0x350894,_0x375a6e){return function(_0xf3a71b){if(_0xf3a71b){return _0xf3a71b[_0xcf96('0x26')](_0x350894)['then'](function(_0x85e6b3){return _0x85e6b3;});}return null;};}function removeEntity(_0x4c03d9,_0x18f212){return function(_0x57c483){if(_0x57c483){return _0x57c483[_0xcf96('0x27')]()['then'](function(){_0x4c03d9[_0xcf96('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4a936e,_0x444318){return function(_0x27d971){if(!_0x27d971){_0x4a936e[_0xcf96('0x1b')](0x194);}return _0x27d971;};}function handleError(_0x1156d2,_0xfedb03){_0xfedb03=_0xfedb03||0x1f4;return function(_0x5eae9b){logger[_0xcf96('0x28')](_0x5eae9b['stack']);if(_0x5eae9b[_0xcf96('0x29')]){delete _0x5eae9b['name'];}_0x1156d2[_0xcf96('0x1c')](_0xfedb03)[_0xcf96('0x2a')](_0x5eae9b);};}exports[_0xcf96('0x2b')]=function(_0x431213,_0x21f662){var _0x392106={},_0x2f2927={},_0x47f27a={'count':0x0,'rows':[]};var _0x1f93c9=_['map'](db[_0xcf96('0x2c')][_0xcf96('0x2d')],function(_0x5d0a03){return{'name':_0x5d0a03[_0xcf96('0x2e')],'type':_0x5d0a03[_0xcf96('0x2f')][_0xcf96('0x30')]};});_0x2f2927[_0xcf96('0x31')]=_[_0xcf96('0x32')](_0x1f93c9,_0xcf96('0x29'));_0x2f2927[_0xcf96('0x33')]=_['keys'](_0x431213[_0xcf96('0x33')]);_0x2f2927[_0xcf96('0x34')]=_['intersection'](_0x2f2927['model'],_0x2f2927[_0xcf96('0x33')]);_0x392106[_0xcf96('0x35')]=_[_0xcf96('0x36')](_0x2f2927['model'],qs['fields'](_0x431213[_0xcf96('0x33')][_0xcf96('0x37')]));_0x392106[_0xcf96('0x35')]=_0x392106[_0xcf96('0x35')][_0xcf96('0x38')]?_0x392106[_0xcf96('0x35')]:_0x2f2927['model'];if(!_0x431213[_0xcf96('0x33')][_0xcf96('0x39')](_0xcf96('0x3a'))){_0x392106[_0xcf96('0x3b')]=qs[_0xcf96('0x3b')](_0x431213['query']['limit']);_0x392106[_0xcf96('0x1f')]=qs['offset'](_0x431213['query'][_0xcf96('0x1f')]);}_0x392106[_0xcf96('0x3c')]=qs['sort'](_0x431213[_0xcf96('0x33')][_0xcf96('0x3d')]);_0x392106[_0xcf96('0x3e')]=qs[_0xcf96('0x34')](_['pick'](_0x431213['query'],_0x2f2927[_0xcf96('0x34')]),_0x1f93c9);if(_0x431213[_0xcf96('0x33')][_0xcf96('0x3f')]){_0x392106['where']=_[_0xcf96('0x40')](_0x392106['where'],{'$or':_[_0xcf96('0x32')](_0x1f93c9,function(_0x2882da){if(_0x2882da[_0xcf96('0x2f')]!==_0xcf96('0x41')){var _0x1c5eb8={};_0x1c5eb8[_0x2882da[_0xcf96('0x29')]]={'$like':'%'+_0x431213[_0xcf96('0x33')]['filter']+'%'};return _0x1c5eb8;}})});}_0x392106=_[_0xcf96('0x40')]({},_0x392106,_0x431213[_0xcf96('0x42')]);var _0x5e025b={'where':_0x392106[_0xcf96('0x3e')]};return db[_0xcf96('0x2c')][_0xcf96('0x21')](_0x5e025b)['then'](function(_0x16c600){_0x47f27a[_0xcf96('0x21')]=_0x16c600;if(_0x431213[_0xcf96('0x33')][_0xcf96('0x43')]){_0x392106[_0xcf96('0x44')]=[{'all':!![]}];}return db[_0xcf96('0x2c')][_0xcf96('0x45')](_0x392106);})['then'](function(_0x31b3a4){_0x47f27a['rows']=_0x31b3a4;return _0x47f27a;})['then'](respondWithFilteredResult(_0x21f662,_0x392106))[_0xcf96('0x46')](handleError(_0x21f662,null));};exports[_0xcf96('0x47')]=function(_0x118996,_0x449517){var _0x4d1e05={'raw':![],'where':{'id':_0x118996[_0xcf96('0x48')]['id']}},_0x1dc9e9={};_0x1dc9e9[_0xcf96('0x31')]=_[_0xcf96('0x49')](db[_0xcf96('0x2c')]['rawAttributes']);_0x1dc9e9['query']=_[_0xcf96('0x49')](_0x118996[_0xcf96('0x33')]);_0x1dc9e9[_0xcf96('0x34')]=_[_0xcf96('0x36')](_0x1dc9e9[_0xcf96('0x31')],_0x1dc9e9[_0xcf96('0x33')]);_0x4d1e05[_0xcf96('0x35')]=_[_0xcf96('0x36')](_0x1dc9e9[_0xcf96('0x31')],qs[_0xcf96('0x37')](_0x118996['query']['fields']));_0x4d1e05[_0xcf96('0x35')]=_0x4d1e05[_0xcf96('0x35')]['length']?_0x4d1e05[_0xcf96('0x35')]:_0x1dc9e9['model'];if(_0x118996[_0xcf96('0x33')][_0xcf96('0x43')]){_0x4d1e05[_0xcf96('0x44')]=[{'all':!![]}];}_0x4d1e05=_[_0xcf96('0x40')]({},_0x4d1e05,_0x118996[_0xcf96('0x42')]);return db[_0xcf96('0x2c')]['find'](_0x4d1e05)[_0xcf96('0x4a')](handleEntityNotFound(_0x449517,null))[_0xcf96('0x4a')](respondWithResult(_0x449517,null))[_0xcf96('0x46')](handleError(_0x449517,null));};exports['create']=function(_0x764e07,_0x2b0c45){return db[_0xcf96('0x2c')][_0xcf96('0x4b')](_0x764e07[_0xcf96('0x4c')],{})[_0xcf96('0x4a')](respondWithResult(_0x2b0c45,0xc9))[_0xcf96('0x46')](handleError(_0x2b0c45,null));};exports['update']=function(_0x4f30e4,_0x5954c5){if(_0x4f30e4[_0xcf96('0x4c')]['id']){delete _0x4f30e4['body']['id'];}return db[_0xcf96('0x2c')][_0xcf96('0x4d')]({'where':{'id':_0x4f30e4[_0xcf96('0x48')]['id']}})[_0xcf96('0x4a')](handleEntityNotFound(_0x5954c5,null))[_0xcf96('0x4a')](saveUpdates(_0x4f30e4[_0xcf96('0x4c')],null))[_0xcf96('0x4a')](respondWithResult(_0x5954c5,null))['catch'](handleError(_0x5954c5,null));};exports[_0xcf96('0x27')]=function(_0x15d107,_0x5eb4db){return db[_0xcf96('0x2c')][_0xcf96('0x4d')]({'where':{'id':_0x15d107['params']['id']}})[_0xcf96('0x4a')](handleEntityNotFound(_0x5eb4db,null))['then'](removeEntity(_0x5eb4db,null))[_0xcf96('0x46')](handleError(_0x5eb4db,null));};exports[_0xcf96('0x4e')]=function(_0x143fe9,_0x4fd6c4,_0x319841){return db[_0xcf96('0x4f')][_0xcf96('0x4d')]({'where':{'id':_0x143fe9[_0xcf96('0x48')]['id']}})[_0xcf96('0x4a')](handleEntityNotFound(_0x4fd6c4,null))[_0xcf96('0x4a')](function(_0x109a06){if(_0x109a06){return _0x109a06['addConditions'](_0x143fe9['body'][_0xcf96('0x50')],_[_0xcf96('0x51')](_0x143fe9[_0xcf96('0x4c')],[_0xcf96('0x50'),'id'])||{});}})[_0xcf96('0x4a')](respondWithResult(_0x4fd6c4,null))['catch'](handleError(_0x4fd6c4,null));};exports[_0xcf96('0x52')]=function(_0x4dfff4,_0x10876d,_0x4791d4){var _0x3bea4b={};var _0x589db7={};var _0xbbedcd;var _0x2eec9a;return db[_0xcf96('0x2c')][_0xcf96('0x53')]({'where':{'id':_0x4dfff4['params']['id']}})[_0xcf96('0x4a')](handleEntityNotFound(_0x10876d,null))['then'](function(_0x3eba43){if(_0x3eba43){_0xbbedcd=_0x3eba43;_0x589db7[_0xcf96('0x31')]=_[_0xcf96('0x49')](db[_0xcf96('0x4f')][_0xcf96('0x2d')]);_0x589db7[_0xcf96('0x33')]=_[_0xcf96('0x49')](_0x4dfff4['query']);_0x589db7['filters']=_[_0xcf96('0x36')](_0x589db7[_0xcf96('0x31')],_0x589db7[_0xcf96('0x33')]);_0x3bea4b['attributes']=_[_0xcf96('0x36')](_0x589db7[_0xcf96('0x31')],qs['fields'](_0x4dfff4[_0xcf96('0x33')][_0xcf96('0x37')]));_0x3bea4b[_0xcf96('0x35')]=_0x3bea4b[_0xcf96('0x35')][_0xcf96('0x38')]?_0x3bea4b[_0xcf96('0x35')]:_0x589db7['model'];_0x3bea4b[_0xcf96('0x3c')]=qs['sort'](_0x4dfff4['query'][_0xcf96('0x3d')]);_0x3bea4b[_0xcf96('0x3e')]=qs['filters'](_[_0xcf96('0x54')](_0x4dfff4[_0xcf96('0x33')],_0x589db7[_0xcf96('0x34')]));if(_0x4dfff4[_0xcf96('0x33')]['filter']){_0x3bea4b['where']=_[_0xcf96('0x40')](_0x3bea4b['where'],{'$or':_['map'](_0x3bea4b[_0xcf96('0x35')],function(_0x3b7990){var _0x4455a9={};_0x4455a9[_0x3b7990]={'$like':'%'+_0x4dfff4[_0xcf96('0x33')][_0xcf96('0x3f')]+'%'};return _0x4455a9;})});}_0x3bea4b=_[_0xcf96('0x40')]({},_0x3bea4b,_0x4dfff4['options']);return _0xbbedcd['getConditions'](_0x3bea4b);}})['then'](function(_0x15237a){if(_0x15237a){_0x2eec9a=_0x15237a[_0xcf96('0x38')];if(!_0x4dfff4['query']['hasOwnProperty'](_0xcf96('0x3a'))){_0x3bea4b[_0xcf96('0x3b')]=qs['limit'](_0x4dfff4[_0xcf96('0x33')][_0xcf96('0x3b')]);_0x3bea4b[_0xcf96('0x1f')]=qs[_0xcf96('0x1f')](_0x4dfff4[_0xcf96('0x33')]['offset']);}return _0xbbedcd[_0xcf96('0x52')](_0x3bea4b);}})[_0xcf96('0x4a')](function(_0x14e8df){if(_0x14e8df){return _0x14e8df?{'count':_0x2eec9a,'rows':_0x14e8df}:null;}})['then'](respondWithResult(_0x10876d,null))[_0xcf96('0x46')](handleError(_0x10876d,null));};exports[_0xcf96('0x55')]=function(_0x5e2e5c,_0x26af11,_0x640a51){return db[_0xcf96('0x56')][_0xcf96('0x4d')]({'where':{'id':_0x5e2e5c['params']['id']}})[_0xcf96('0x4a')](handleEntityNotFound(_0x26af11,null))[_0xcf96('0x4a')](function(_0x28f97a){if(_0x28f97a){return _0x28f97a['addActions'](_0x5e2e5c[_0xcf96('0x4c')][_0xcf96('0x50')],_['omit'](_0x5e2e5c['body'],[_0xcf96('0x50'),'id'])||{});}})[_0xcf96('0x4a')](respondWithResult(_0x26af11,null))[_0xcf96('0x46')](handleError(_0x26af11,null));};exports['getActions']=function(_0x54402d,_0x1c8fd5,_0x2d01ef){var _0x279e88={};var _0x7464db={};var _0x110fe2;var _0x1d2424;return db[_0xcf96('0x2c')]['findOne']({'where':{'id':_0x54402d[_0xcf96('0x48')]['id']}})[_0xcf96('0x4a')](handleEntityNotFound(_0x1c8fd5,null))[_0xcf96('0x4a')](function(_0x3a7c30){if(_0x3a7c30){_0x110fe2=_0x3a7c30;_0x7464db[_0xcf96('0x31')]=_['keys'](db[_0xcf96('0x56')]['rawAttributes']);_0x7464db[_0xcf96('0x33')]=_[_0xcf96('0x49')](_0x54402d[_0xcf96('0x33')]);_0x7464db[_0xcf96('0x34')]=_[_0xcf96('0x36')](_0x7464db[_0xcf96('0x31')],_0x7464db[_0xcf96('0x33')]);_0x279e88['attributes']=_['intersection'](_0x7464db[_0xcf96('0x31')],qs[_0xcf96('0x37')](_0x54402d[_0xcf96('0x33')][_0xcf96('0x37')]));_0x279e88[_0xcf96('0x35')]=_0x279e88[_0xcf96('0x35')][_0xcf96('0x38')]?_0x279e88['attributes']:_0x7464db[_0xcf96('0x31')];_0x279e88[_0xcf96('0x3c')]=qs['sort'](_0x54402d[_0xcf96('0x33')][_0xcf96('0x3d')]);_0x279e88[_0xcf96('0x3e')]=qs[_0xcf96('0x34')](_[_0xcf96('0x54')](_0x54402d['query'],_0x7464db[_0xcf96('0x34')]));if(_0x54402d['query'][_0xcf96('0x3f')]){_0x279e88[_0xcf96('0x3e')]=_[_0xcf96('0x40')](_0x279e88['where'],{'$or':_[_0xcf96('0x32')](_0x279e88[_0xcf96('0x35')],function(_0x4dd119){var _0x197168={};_0x197168[_0x4dd119]={'$like':'%'+_0x54402d[_0xcf96('0x33')]['filter']+'%'};return _0x197168;})});}_0x279e88=_[_0xcf96('0x40')]({},_0x279e88,_0x54402d[_0xcf96('0x42')]);return _0x110fe2[_0xcf96('0x57')](_0x279e88);}})[_0xcf96('0x4a')](function(_0x59a78a){if(_0x59a78a){_0x1d2424=_0x59a78a[_0xcf96('0x38')];if(!_0x54402d[_0xcf96('0x33')][_0xcf96('0x39')](_0xcf96('0x3a'))){_0x279e88[_0xcf96('0x3b')]=qs[_0xcf96('0x3b')](_0x54402d[_0xcf96('0x33')][_0xcf96('0x3b')]);_0x279e88['offset']=qs[_0xcf96('0x1f')](_0x54402d[_0xcf96('0x33')][_0xcf96('0x1f')]);}return _0x110fe2[_0xcf96('0x57')](_0x279e88);}})[_0xcf96('0x4a')](function(_0x2cface){if(_0x2cface){return _0x2cface?{'count':_0x1d2424,'rows':_0x2cface}:null;}})[_0xcf96('0x4a')](respondWithResult(_0x1c8fd5,null))[_0xcf96('0x46')](handleError(_0x1c8fd5,null));}; \ No newline at end of file +var _0x9a98=['map','Automation','rawAttributes','type','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','count','then','includeAll','include','rows','catch','show','params','create','body','find','addConditions','Condition','ids','omit','getConditions','findOne','addActions','Action','getActions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','json','offset','undefined','limit','set','Content-Range','apply','reject','save','update','destroy','end','error','name','send'];(function(_0x392c90,_0x51e3d0){var _0xed5f7f=function(_0x4e0b8f){while(--_0x4e0b8f){_0x392c90['push'](_0x392c90['shift']());}};_0xed5f7f(++_0x51e3d0);}(_0x9a98,0x83));var _0x89a9=function(_0x5d6e21,_0x4bd186){_0x5d6e21=_0x5d6e21-0x0;var _0x383824=_0x9a98[_0x5d6e21];return _0x383824;};'use strict';var emlformat=require(_0x89a9('0x0'));var rimraf=require(_0x89a9('0x1'));var zipdir=require(_0x89a9('0x2'));var jsonpatch=require(_0x89a9('0x3'));var rp=require(_0x89a9('0x4'));var moment=require(_0x89a9('0x5'));var BPromise=require(_0x89a9('0x6'));var Mustache=require(_0x89a9('0x7'));var util=require(_0x89a9('0x8'));var path=require(_0x89a9('0x9'));var sox=require(_0x89a9('0xa'));var csv=require(_0x89a9('0xb'));var ejs=require(_0x89a9('0xc'));var fs=require('fs');var fs_extra=require(_0x89a9('0xd'));var _=require('lodash');var squel=require(_0x89a9('0xe'));var crypto=require(_0x89a9('0xf'));var jsforce=require(_0x89a9('0x10'));var deskjs=require('desk.js');var toCsv=require(_0x89a9('0xb'));var querystring=require(_0x89a9('0x11'));var Papa=require(_0x89a9('0x12'));var Redis=require(_0x89a9('0x13'));var authService=require(_0x89a9('0x14'));var qs=require(_0x89a9('0x15'));var as=require(_0x89a9('0x16'));var hardwareService=require(_0x89a9('0x17'));var logger=require(_0x89a9('0x18'))(_0x89a9('0x19'));var utils=require(_0x89a9('0x1a'));var config=require(_0x89a9('0x1b'));var licenseUtil=require('../../config/license/util');var db=require(_0x89a9('0x1c'))['db'];function respondWithStatusCode(_0x174812,_0x55b6aa){_0x55b6aa=_0x55b6aa||0xcc;return function(_0xe28b0c){if(_0xe28b0c){return _0x174812['sendStatus'](_0x55b6aa);}return _0x174812[_0x89a9('0x1d')](_0x55b6aa)['end']();};}function respondWithResult(_0x230564,_0x154bfc){_0x154bfc=_0x154bfc||0xc8;return function(_0x4039ad){if(_0x4039ad){return _0x230564[_0x89a9('0x1d')](_0x154bfc)[_0x89a9('0x1e')](_0x4039ad);}};}function respondWithFilteredResult(_0x2621c6,_0x4973de){return function(_0x4e3f7e){if(_0x4e3f7e){var _0x3f49cf=typeof _0x4973de[_0x89a9('0x1f')]===_0x89a9('0x20')&&typeof _0x4973de['limit']===_0x89a9('0x20');var _0x167990=_0x4e3f7e['count'];var _0x4cc708=_0x3f49cf?0x0:_0x4973de['offset'];var _0x32e84f=_0x3f49cf?_0x4e3f7e['count']:_0x4973de[_0x89a9('0x1f')]+_0x4973de[_0x89a9('0x21')];var _0x150feb;if(_0x32e84f>=_0x167990){_0x32e84f=_0x167990;_0x150feb=0xc8;}else{_0x150feb=0xce;}_0x2621c6[_0x89a9('0x1d')](_0x150feb);return _0x2621c6[_0x89a9('0x22')](_0x89a9('0x23'),_0x4cc708+'-'+_0x32e84f+'/'+_0x167990)[_0x89a9('0x1e')](_0x4e3f7e);}return null;};}function patchUpdates(_0x53c7fe){return function(_0x3da1b2){try{jsonpatch[_0x89a9('0x24')](_0x3da1b2,_0x53c7fe,!![]);}catch(_0x43b56c){return BPromise[_0x89a9('0x25')](_0x43b56c);}return _0x3da1b2[_0x89a9('0x26')]();};}function saveUpdates(_0x3c28aa,_0x55bee5){return function(_0x4be2d2){if(_0x4be2d2){return _0x4be2d2[_0x89a9('0x27')](_0x3c28aa)['then'](function(_0x10d2b1){return _0x10d2b1;});}return null;};}function removeEntity(_0x183eaa,_0x11e1c2){return function(_0x42bff7){if(_0x42bff7){return _0x42bff7[_0x89a9('0x28')]()['then'](function(){_0x183eaa[_0x89a9('0x1d')](0xcc)[_0x89a9('0x29')]();});}};}function handleEntityNotFound(_0x2480a8,_0x197043){return function(_0x4d62a3){if(!_0x4d62a3){_0x2480a8['sendStatus'](0x194);}return _0x4d62a3;};}function handleError(_0x1afbd4,_0x3096c5){_0x3096c5=_0x3096c5||0x1f4;return function(_0x70661){logger[_0x89a9('0x2a')](_0x70661['stack']);if(_0x70661[_0x89a9('0x2b')]){delete _0x70661[_0x89a9('0x2b')];}_0x1afbd4[_0x89a9('0x1d')](_0x3096c5)[_0x89a9('0x2c')](_0x70661);};}exports['index']=function(_0x4063cf,_0x9d0699){var _0x3b3832={},_0x24075a={},_0xf12eeb={'count':0x0,'rows':[]};var _0x51262e=_[_0x89a9('0x2d')](db[_0x89a9('0x2e')][_0x89a9('0x2f')],function(_0xb84367){return{'name':_0xb84367['fieldName'],'type':_0xb84367[_0x89a9('0x30')][_0x89a9('0x31')]};});_0x24075a['model']=_[_0x89a9('0x2d')](_0x51262e,_0x89a9('0x2b'));_0x24075a[_0x89a9('0x32')]=_[_0x89a9('0x33')](_0x4063cf[_0x89a9('0x32')]);_0x24075a[_0x89a9('0x34')]=_[_0x89a9('0x35')](_0x24075a[_0x89a9('0x36')],_0x24075a['query']);_0x3b3832['attributes']=_['intersection'](_0x24075a[_0x89a9('0x36')],qs[_0x89a9('0x37')](_0x4063cf[_0x89a9('0x32')][_0x89a9('0x37')]));_0x3b3832[_0x89a9('0x38')]=_0x3b3832[_0x89a9('0x38')][_0x89a9('0x39')]?_0x3b3832[_0x89a9('0x38')]:_0x24075a['model'];if(!_0x4063cf['query'][_0x89a9('0x3a')](_0x89a9('0x3b'))){_0x3b3832['limit']=qs[_0x89a9('0x21')](_0x4063cf[_0x89a9('0x32')][_0x89a9('0x21')]);_0x3b3832[_0x89a9('0x1f')]=qs['offset'](_0x4063cf['query'][_0x89a9('0x1f')]);}_0x3b3832[_0x89a9('0x3c')]=qs['sort'](_0x4063cf['query'][_0x89a9('0x3d')]);_0x3b3832[_0x89a9('0x3e')]=qs[_0x89a9('0x34')](_[_0x89a9('0x3f')](_0x4063cf[_0x89a9('0x32')],_0x24075a[_0x89a9('0x34')]),_0x51262e);if(_0x4063cf[_0x89a9('0x32')][_0x89a9('0x40')]){_0x3b3832[_0x89a9('0x3e')]=_[_0x89a9('0x41')](_0x3b3832[_0x89a9('0x3e')],{'$or':_['map'](_0x51262e,function(_0x50b79b){if(_0x50b79b[_0x89a9('0x30')]!==_0x89a9('0x42')){var _0x340784={};_0x340784[_0x50b79b[_0x89a9('0x2b')]]={'$like':'%'+_0x4063cf[_0x89a9('0x32')][_0x89a9('0x40')]+'%'};return _0x340784;}})});}_0x3b3832=_[_0x89a9('0x41')]({},_0x3b3832,_0x4063cf[_0x89a9('0x43')]);var _0x49406b={'where':_0x3b3832[_0x89a9('0x3e')]};return db[_0x89a9('0x2e')][_0x89a9('0x44')](_0x49406b)[_0x89a9('0x45')](function(_0x4e9c34){_0xf12eeb[_0x89a9('0x44')]=_0x4e9c34;if(_0x4063cf[_0x89a9('0x32')][_0x89a9('0x46')]){_0x3b3832[_0x89a9('0x47')]=[{'all':!![]}];}return db[_0x89a9('0x2e')]['findAll'](_0x3b3832);})[_0x89a9('0x45')](function(_0x4c8784){_0xf12eeb[_0x89a9('0x48')]=_0x4c8784;return _0xf12eeb;})[_0x89a9('0x45')](respondWithFilteredResult(_0x9d0699,_0x3b3832))[_0x89a9('0x49')](handleError(_0x9d0699,null));};exports[_0x89a9('0x4a')]=function(_0x4dc9bd,_0x1a4a2e){var _0xb2729={'raw':![],'where':{'id':_0x4dc9bd[_0x89a9('0x4b')]['id']}},_0x15ab96={};_0x15ab96[_0x89a9('0x36')]=_[_0x89a9('0x33')](db[_0x89a9('0x2e')][_0x89a9('0x2f')]);_0x15ab96[_0x89a9('0x32')]=_[_0x89a9('0x33')](_0x4dc9bd[_0x89a9('0x32')]);_0x15ab96[_0x89a9('0x34')]=_[_0x89a9('0x35')](_0x15ab96['model'],_0x15ab96[_0x89a9('0x32')]);_0xb2729['attributes']=_[_0x89a9('0x35')](_0x15ab96[_0x89a9('0x36')],qs[_0x89a9('0x37')](_0x4dc9bd[_0x89a9('0x32')][_0x89a9('0x37')]));_0xb2729[_0x89a9('0x38')]=_0xb2729[_0x89a9('0x38')][_0x89a9('0x39')]?_0xb2729[_0x89a9('0x38')]:_0x15ab96['model'];if(_0x4dc9bd[_0x89a9('0x32')]['includeAll']){_0xb2729[_0x89a9('0x47')]=[{'all':!![]}];}_0xb2729=_[_0x89a9('0x41')]({},_0xb2729,_0x4dc9bd[_0x89a9('0x43')]);return db[_0x89a9('0x2e')]['find'](_0xb2729)[_0x89a9('0x45')](handleEntityNotFound(_0x1a4a2e,null))[_0x89a9('0x45')](respondWithResult(_0x1a4a2e,null))[_0x89a9('0x49')](handleError(_0x1a4a2e,null));};exports[_0x89a9('0x4c')]=function(_0x1e1eb5,_0x30808f){return db['Automation'][_0x89a9('0x4c')](_0x1e1eb5[_0x89a9('0x4d')],{})[_0x89a9('0x45')](respondWithResult(_0x30808f,0xc9))['catch'](handleError(_0x30808f,null));};exports[_0x89a9('0x27')]=function(_0xb7dade,_0x1947cd){if(_0xb7dade[_0x89a9('0x4d')]['id']){delete _0xb7dade['body']['id'];}return db[_0x89a9('0x2e')][_0x89a9('0x4e')]({'where':{'id':_0xb7dade[_0x89a9('0x4b')]['id']}})[_0x89a9('0x45')](handleEntityNotFound(_0x1947cd,null))[_0x89a9('0x45')](saveUpdates(_0xb7dade[_0x89a9('0x4d')],null))[_0x89a9('0x45')](respondWithResult(_0x1947cd,null))[_0x89a9('0x49')](handleError(_0x1947cd,null));};exports[_0x89a9('0x28')]=function(_0x212be0,_0x7d02b3){return db[_0x89a9('0x2e')][_0x89a9('0x4e')]({'where':{'id':_0x212be0[_0x89a9('0x4b')]['id']}})[_0x89a9('0x45')](handleEntityNotFound(_0x7d02b3,null))[_0x89a9('0x45')](removeEntity(_0x7d02b3,null))[_0x89a9('0x49')](handleError(_0x7d02b3,null));};exports[_0x89a9('0x4f')]=function(_0xc4b656,_0x3cc5e1,_0x488cb0){return db[_0x89a9('0x50')][_0x89a9('0x4e')]({'where':{'id':_0xc4b656[_0x89a9('0x4b')]['id']}})[_0x89a9('0x45')](handleEntityNotFound(_0x3cc5e1,null))[_0x89a9('0x45')](function(_0x10fede){if(_0x10fede){return _0x10fede[_0x89a9('0x4f')](_0xc4b656[_0x89a9('0x4d')][_0x89a9('0x51')],_[_0x89a9('0x52')](_0xc4b656[_0x89a9('0x4d')],[_0x89a9('0x51'),'id'])||{});}})[_0x89a9('0x45')](respondWithResult(_0x3cc5e1,null))[_0x89a9('0x49')](handleError(_0x3cc5e1,null));};exports[_0x89a9('0x53')]=function(_0x4debca,_0x1e687d,_0x4cdd6e){var _0x481ca3={};var _0x107637={};var _0x2c7d41;var _0x1ed94f;return db[_0x89a9('0x2e')][_0x89a9('0x54')]({'where':{'id':_0x4debca[_0x89a9('0x4b')]['id']}})['then'](handleEntityNotFound(_0x1e687d,null))[_0x89a9('0x45')](function(_0x4a8338){if(_0x4a8338){_0x2c7d41=_0x4a8338;_0x107637[_0x89a9('0x36')]=_[_0x89a9('0x33')](db[_0x89a9('0x50')]['rawAttributes']);_0x107637['query']=_[_0x89a9('0x33')](_0x4debca[_0x89a9('0x32')]);_0x107637[_0x89a9('0x34')]=_[_0x89a9('0x35')](_0x107637[_0x89a9('0x36')],_0x107637[_0x89a9('0x32')]);_0x481ca3[_0x89a9('0x38')]=_[_0x89a9('0x35')](_0x107637['model'],qs[_0x89a9('0x37')](_0x4debca[_0x89a9('0x32')][_0x89a9('0x37')]));_0x481ca3[_0x89a9('0x38')]=_0x481ca3['attributes']['length']?_0x481ca3['attributes']:_0x107637[_0x89a9('0x36')];_0x481ca3[_0x89a9('0x3c')]=qs[_0x89a9('0x3d')](_0x4debca['query'][_0x89a9('0x3d')]);_0x481ca3[_0x89a9('0x3e')]=qs['filters'](_[_0x89a9('0x3f')](_0x4debca[_0x89a9('0x32')],_0x107637[_0x89a9('0x34')]));if(_0x4debca[_0x89a9('0x32')][_0x89a9('0x40')]){_0x481ca3[_0x89a9('0x3e')]=_['merge'](_0x481ca3['where'],{'$or':_[_0x89a9('0x2d')](_0x481ca3[_0x89a9('0x38')],function(_0x4ca18f){var _0x632ee3={};_0x632ee3[_0x4ca18f]={'$like':'%'+_0x4debca[_0x89a9('0x32')]['filter']+'%'};return _0x632ee3;})});}_0x481ca3=_[_0x89a9('0x41')]({},_0x481ca3,_0x4debca[_0x89a9('0x43')]);return _0x2c7d41[_0x89a9('0x53')](_0x481ca3);}})[_0x89a9('0x45')](function(_0x242439){if(_0x242439){_0x1ed94f=_0x242439[_0x89a9('0x39')];if(!_0x4debca[_0x89a9('0x32')][_0x89a9('0x3a')](_0x89a9('0x3b'))){_0x481ca3[_0x89a9('0x21')]=qs[_0x89a9('0x21')](_0x4debca[_0x89a9('0x32')][_0x89a9('0x21')]);_0x481ca3[_0x89a9('0x1f')]=qs[_0x89a9('0x1f')](_0x4debca['query'][_0x89a9('0x1f')]);}return _0x2c7d41[_0x89a9('0x53')](_0x481ca3);}})[_0x89a9('0x45')](function(_0x21d77f){if(_0x21d77f){return _0x21d77f?{'count':_0x1ed94f,'rows':_0x21d77f}:null;}})['then'](respondWithResult(_0x1e687d,null))['catch'](handleError(_0x1e687d,null));};exports[_0x89a9('0x55')]=function(_0x1ca060,_0x1490ff,_0x1bf4e3){return db[_0x89a9('0x56')][_0x89a9('0x4e')]({'where':{'id':_0x1ca060[_0x89a9('0x4b')]['id']}})[_0x89a9('0x45')](handleEntityNotFound(_0x1490ff,null))[_0x89a9('0x45')](function(_0x25db8a){if(_0x25db8a){return _0x25db8a['addActions'](_0x1ca060['body'][_0x89a9('0x51')],_[_0x89a9('0x52')](_0x1ca060[_0x89a9('0x4d')],[_0x89a9('0x51'),'id'])||{});}})[_0x89a9('0x45')](respondWithResult(_0x1490ff,null))['catch'](handleError(_0x1490ff,null));};exports[_0x89a9('0x57')]=function(_0x1b7572,_0x1c8e73,_0x51ce10){var _0x56a39e={};var _0x1a5434={};var _0x578d1f;var _0x37d8e4;return db[_0x89a9('0x2e')][_0x89a9('0x54')]({'where':{'id':_0x1b7572[_0x89a9('0x4b')]['id']}})[_0x89a9('0x45')](handleEntityNotFound(_0x1c8e73,null))['then'](function(_0x5a381d){if(_0x5a381d){_0x578d1f=_0x5a381d;_0x1a5434[_0x89a9('0x36')]=_[_0x89a9('0x33')](db[_0x89a9('0x56')][_0x89a9('0x2f')]);_0x1a5434[_0x89a9('0x32')]=_[_0x89a9('0x33')](_0x1b7572['query']);_0x1a5434['filters']=_['intersection'](_0x1a5434['model'],_0x1a5434[_0x89a9('0x32')]);_0x56a39e[_0x89a9('0x38')]=_['intersection'](_0x1a5434[_0x89a9('0x36')],qs['fields'](_0x1b7572[_0x89a9('0x32')][_0x89a9('0x37')]));_0x56a39e[_0x89a9('0x38')]=_0x56a39e[_0x89a9('0x38')][_0x89a9('0x39')]?_0x56a39e['attributes']:_0x1a5434[_0x89a9('0x36')];_0x56a39e[_0x89a9('0x3c')]=qs[_0x89a9('0x3d')](_0x1b7572[_0x89a9('0x32')]['sort']);_0x56a39e[_0x89a9('0x3e')]=qs[_0x89a9('0x34')](_[_0x89a9('0x3f')](_0x1b7572[_0x89a9('0x32')],_0x1a5434[_0x89a9('0x34')]));if(_0x1b7572[_0x89a9('0x32')][_0x89a9('0x40')]){_0x56a39e['where']=_[_0x89a9('0x41')](_0x56a39e[_0x89a9('0x3e')],{'$or':_['map'](_0x56a39e[_0x89a9('0x38')],function(_0x513e5e){var _0x59941c={};_0x59941c[_0x513e5e]={'$like':'%'+_0x1b7572[_0x89a9('0x32')][_0x89a9('0x40')]+'%'};return _0x59941c;})});}_0x56a39e=_[_0x89a9('0x41')]({},_0x56a39e,_0x1b7572[_0x89a9('0x43')]);return _0x578d1f[_0x89a9('0x57')](_0x56a39e);}})[_0x89a9('0x45')](function(_0xa49d29){if(_0xa49d29){_0x37d8e4=_0xa49d29['length'];if(!_0x1b7572[_0x89a9('0x32')]['hasOwnProperty'](_0x89a9('0x3b'))){_0x56a39e[_0x89a9('0x21')]=qs[_0x89a9('0x21')](_0x1b7572[_0x89a9('0x32')][_0x89a9('0x21')]);_0x56a39e[_0x89a9('0x1f')]=qs[_0x89a9('0x1f')](_0x1b7572[_0x89a9('0x32')][_0x89a9('0x1f')]);}return _0x578d1f['getActions'](_0x56a39e);}})['then'](function(_0x175a46){if(_0x175a46){return _0x175a46?{'count':_0x37d8e4,'rows':_0x175a46}:null;}})[_0x89a9('0x45')](respondWithResult(_0x1c8e73,null))[_0x89a9('0x49')](handleError(_0x1c8e73,null));}; \ No newline at end of file diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js index 65cc5ab..e4f625e 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 _0x4e53=['tools_automations','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./automation.attributes','exports','define','Automation'];(function(_0x29186f,_0x2a4fb7){var _0x209a1f=function(_0x3e06f8){while(--_0x3e06f8){_0x29186f['push'](_0x29186f['shift']());}};_0x209a1f(++_0x2a4fb7);}(_0x4e53,0xc1));var _0x34e5=function(_0x8dcdd0,_0x4d849e){_0x8dcdd0=_0x8dcdd0-0x0;var _0x2d7ff6=_0x4e53[_0x8dcdd0];return _0x2d7ff6;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x34e5('0x0'));var moment=require(_0x34e5('0x1'));var BPromise=require(_0x34e5('0x2'));var rp=require(_0x34e5('0x3'));var fs=require('fs');var path=require(_0x34e5('0x4'));var rimraf=require(_0x34e5('0x5'));var config=require(_0x34e5('0x6'));var attributes=require(_0x34e5('0x7'));module[_0x34e5('0x8')]=function(_0x568473,_0x40f4b6){return _0x568473[_0x34e5('0x9')](_0x34e5('0xa'),attributes,{'tableName':_0x34e5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb5de=['bluebird','rimraf','../../config/environment','./automation.attributes','exports','Automation','../../config/logger','moment'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xb5de,0x146));var _0xeb5d=function(_0x5f41e4,_0x54ef2f){_0x5f41e4=_0x5f41e4-0x0;var _0x138d94=_0xb5de[_0x5f41e4];return _0x138d94;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xeb5d('0x0'))('api');var moment=require(_0xeb5d('0x1'));var BPromise=require(_0xeb5d('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xeb5d('0x3'));var config=require(_0xeb5d('0x4'));var attributes=require(_0xeb5d('0x5'));module[_0xeb5d('0x6')]=function(_0x4cde2f,_0x9e6abe){return _0x4cde2f['define'](_0xeb5d('0x7'),attributes,{'tableName':'tools_automations','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 e952fb4..14c37ef 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 _0x288a=['jayson/promise','http','request','then','info','Automation,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','util','moment','bluebird','randomstring','../../config/utils','rpc','../../config/environment'];(function(_0x1989c7,_0x7ac85d){var _0x55179a=function(_0x5e82c0){while(--_0x5e82c0){_0x1989c7['push'](_0x1989c7['shift']());}};_0x55179a(++_0x7ac85d);}(_0x288a,0x188));var _0xa288=function(_0x2744a7,_0x8153b2){_0x2744a7=_0x2744a7-0x0;var _0x6eb11d=_0x288a[_0x2744a7];return _0x6eb11d;};'use strict';var _=require('lodash');var util=require(_0xa288('0x0'));var moment=require(_0xa288('0x1'));var BPromise=require(_0xa288('0x2'));var rs=require(_0xa288('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xa288('0x4'));var logger=require('../../config/logger')(_0xa288('0x5'));var config=require(_0xa288('0x6'));var jayson=require(_0xa288('0x7'));var client=jayson['client'][_0xa288('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xaee90c,_0x156720,_0x57f445){return new BPromise(function(_0x14e4a6,_0x1e8412){return client[_0xa288('0x9')](_0xaee90c,_0x57f445)[_0xa288('0xa')](function(_0x1a0c06){logger[_0xa288('0xb')](_0xa288('0xc'),_0x156720,_0xa288('0xd'));logger['debug']('Automation,\x20%s,\x20%s,\x20%s',_0x156720,'request\x20sent',JSON[_0xa288('0xe')](_0x1a0c06));if(_0x1a0c06[_0xa288('0xf')]){if(_0x1a0c06['error'][_0xa288('0x10')]===0x1f4){logger[_0xa288('0xf')](_0xa288('0xc'),_0x156720,_0x1a0c06[_0xa288('0xf')][_0xa288('0x11')]);return _0x1e8412(_0x1a0c06[_0xa288('0xf')][_0xa288('0x11')]);}logger[_0xa288('0xf')](_0xa288('0xc'),_0x156720,_0x1a0c06[_0xa288('0xf')][_0xa288('0x11')]);return _0x14e4a6(_0x1a0c06[_0xa288('0xf')][_0xa288('0x11')]);}else{logger[_0xa288('0xb')](_0xa288('0xc'),_0x156720,_0xa288('0xd'));_0x14e4a6(_0x1a0c06['result'][_0xa288('0x11')]);}})[_0xa288('0x12')](function(_0x299ede){logger[_0xa288('0xf')](_0xa288('0xc'),_0x156720,_0x299ede);_0x1e8412(_0x299ede);});});} \ No newline at end of file +var _0x5c3c=['Automation,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','Automation,\x20%s,\x20%s','request\x20sent'];(function(_0x29e558,_0x129a3b){var _0x4bb1b6=function(_0x39915c){while(--_0x39915c){_0x29e558['push'](_0x29e558['shift']());}};_0x4bb1b6(++_0x129a3b);}(_0x5c3c,0x132));var _0xc5c3=function(_0x1f9f37,_0x18776e){_0x1f9f37=_0x1f9f37-0x0;var _0x21c080=_0x5c3c[_0x1f9f37];return _0x21c080;};'use strict';var _=require(_0xc5c3('0x0'));var util=require(_0xc5c3('0x1'));var moment=require(_0xc5c3('0x2'));var BPromise=require(_0xc5c3('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc5c3('0x4'));var db=require(_0xc5c3('0x5'))['db'];var utils=require(_0xc5c3('0x6'));var logger=require(_0xc5c3('0x7'))(_0xc5c3('0x8'));var config=require(_0xc5c3('0x9'));var jayson=require(_0xc5c3('0xa'));var client=jayson[_0xc5c3('0xb')][_0xc5c3('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5a392b,_0x4b8404,_0x591f7d){return new BPromise(function(_0x723c31,_0x522be1){return client['request'](_0x5a392b,_0x591f7d)[_0xc5c3('0xd')](function(_0x46e2c1){logger['info'](_0xc5c3('0xe'),_0x4b8404,_0xc5c3('0xf'));logger['debug'](_0xc5c3('0x10'),_0x4b8404,_0xc5c3('0xf'),JSON[_0xc5c3('0x11')](_0x46e2c1));if(_0x46e2c1['error']){if(_0x46e2c1[_0xc5c3('0x12')][_0xc5c3('0x13')]===0x1f4){logger['error'](_0xc5c3('0xe'),_0x4b8404,_0x46e2c1[_0xc5c3('0x12')][_0xc5c3('0x14')]);return _0x522be1(_0x46e2c1['error'][_0xc5c3('0x14')]);}logger[_0xc5c3('0x12')](_0xc5c3('0xe'),_0x4b8404,_0x46e2c1[_0xc5c3('0x12')][_0xc5c3('0x14')]);return _0x723c31(_0x46e2c1['error']['message']);}else{logger[_0xc5c3('0x15')](_0xc5c3('0xe'),_0x4b8404,_0xc5c3('0xf'));_0x723c31(_0x46e2c1[_0xc5c3('0x16')]['message']);}})['catch'](function(_0x467ba9){logger['error'](_0xc5c3('0xe'),_0x4b8404,_0x467ba9);_0x522be1(_0x467ba9);});});} \ No newline at end of file diff --git a/server/api/automation/index.js b/server/api/automation/index.js index 84c5000..c721840 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 _0xdeb3=['addConditions','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','isAuthenticated','index','get','/:id','/:id/conditions','getConditions','/:id/actions','getActions','post'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xdeb3,0xeb));var _0x3deb=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xdeb3[_0x3ab51d];return _0x29a04e;};'use strict';var multer=require(_0x3deb('0x0'));var util=require(_0x3deb('0x1'));var path=require(_0x3deb('0x2'));var timeout=require(_0x3deb('0x3'));var express=require(_0x3deb('0x4'));var router=express[_0x3deb('0x5')]();var fs_extra=require(_0x3deb('0x6'));var auth=require(_0x3deb('0x7'));var interaction=require(_0x3deb('0x8'));var config=require('../../config/environment');var controller=require('./automation.controller');router['get']('/',auth[_0x3deb('0x9')](),controller[_0x3deb('0xa')]);router[_0x3deb('0xb')](_0x3deb('0xc'),auth[_0x3deb('0x9')](),controller['show']);router['get'](_0x3deb('0xd'),auth[_0x3deb('0x9')](),controller[_0x3deb('0xe')]);router[_0x3deb('0xb')](_0x3deb('0xf'),auth[_0x3deb('0x9')](),controller[_0x3deb('0x10')]);router[_0x3deb('0x11')]('/',auth['isAuthenticated'](),controller['create']);router['post'](_0x3deb('0xd'),auth['isAuthenticated'](),controller[_0x3deb('0x12')]);router[_0x3deb('0x11')](_0x3deb('0xf'),auth[_0x3deb('0x9')](),controller['addActions']);router[_0x3deb('0x13')](_0x3deb('0xc'),auth[_0x3deb('0x9')](),controller[_0x3deb('0x14')]);router[_0x3deb('0x15')](_0x3deb('0xc'),auth[_0x3deb('0x9')](),controller[_0x3deb('0x16')]);module['exports']=router; \ No newline at end of file +var _0x5826=['post','create','addConditions','addActions','put','delete','destroy','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./automation.controller','get','isAuthenticated','index','/:id','show','/:id/conditions','getConditions','/:id/actions','getActions'];(function(_0x4a53d,_0x58a95e){var _0x27410e=function(_0x38fc90){while(--_0x38fc90){_0x4a53d['push'](_0x4a53d['shift']());}};_0x27410e(++_0x58a95e);}(_0x5826,0x1ea));var _0x6582=function(_0x1f7c75,_0x4bf662){_0x1f7c75=_0x1f7c75-0x0;var _0x4b6c47=_0x5826[_0x1f7c75];return _0x4b6c47;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x6582('0x0'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x6582('0x1')]();var fs_extra=require(_0x6582('0x2'));var auth=require(_0x6582('0x3'));var interaction=require(_0x6582('0x4'));var config=require(_0x6582('0x5'));var controller=require(_0x6582('0x6'));router[_0x6582('0x7')]('/',auth[_0x6582('0x8')](),controller[_0x6582('0x9')]);router[_0x6582('0x7')](_0x6582('0xa'),auth[_0x6582('0x8')](),controller[_0x6582('0xb')]);router['get'](_0x6582('0xc'),auth[_0x6582('0x8')](),controller[_0x6582('0xd')]);router[_0x6582('0x7')](_0x6582('0xe'),auth[_0x6582('0x8')](),controller[_0x6582('0xf')]);router[_0x6582('0x10')]('/',auth[_0x6582('0x8')](),controller[_0x6582('0x11')]);router[_0x6582('0x10')](_0x6582('0xc'),auth[_0x6582('0x8')](),controller[_0x6582('0x12')]);router[_0x6582('0x10')]('/:id/actions',auth['isAuthenticated'](),controller[_0x6582('0x13')]);router[_0x6582('0x14')](_0x6582('0xa'),auth[_0x6582('0x8')](),controller['update']);router[_0x6582('0x15')](_0x6582('0xa'),auth['isAuthenticated'](),controller[_0x6582('0x16')]);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 2f10172..3245356 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 _0x27c0=['#AMD\x20Maximum\x20Word\x20Length','DESC','ASC','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)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','exports','STRING','name','ENUM','ivr','BOOLEAN','Active/Disactive\x20Campaign','UNSIGNED','Max\x20200\x20calls.','INTEGER','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'];(function(_0x5b7f48,_0x4d8a1d){var _0x2424b0=function(_0x21b28b){while(--_0x21b28b){_0x5b7f48['push'](_0x5b7f48['shift']());}};_0x2424b0(++_0x4d8a1d);}(_0x27c0,0xad));var _0x027c=function(_0x3d2a18,_0x2120f2){_0x3d2a18=_0x3d2a18-0x0;var _0x3b70f5=_0x27c0[_0x3d2a18];return _0x3b70f5;};'use strict';var Sequelize=require(_0x027c('0x0'));module[_0x027c('0x1')]={'name':{'type':Sequelize[_0x027c('0x2')],'unique':_0x027c('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x027c('0x4')](_0x027c('0x5')),'allowNull':![],'defaultValue':_0x027c('0x5')},'description':{'type':Sequelize[_0x027c('0x2')]},'active':{'type':Sequelize[_0x027c('0x6')],'defaultValue':0x0,'comment':_0x027c('0x7')},'limitCalls':{'type':Sequelize['INTEGER'](0x4)[_0x027c('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x027c('0x9')},'dialOriginateCallerIdName':{'type':Sequelize[_0x027c('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x027c('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0x027c('0xa')](0x3)[_0x027c('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x027c('0xb')},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x027c('0xc')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x027c('0xa')](0x5)[_0x027c('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x027c('0xd')},'dialBusyMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x027c('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x027c('0xe')},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x027c('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x027c('0xf')},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':_0x027c('0x10')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x027c('0xa')](0x5)[_0x027c('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x027c('0x11')},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x027c('0x8')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x027c('0x12')},'dialTimezone':{'type':Sequelize[_0x027c('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x027c('0x2')],'defaultValue':_0x027c('0x13')},'dialCheckDuplicateType':{'type':Sequelize['ENUM'](_0x027c('0x14'),'never','onlyIfOpen'),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x027c('0x15')},'dialAMDInitialSilence':{'type':Sequelize[_0x027c('0xa')](0x9)['UNSIGNED'],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x027c('0x16')},'dialAMDGreeting':{'type':Sequelize[_0x027c('0xa')](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x027c('0xa')](0x9)[_0x027c('0x8')],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x027c('0xa')](0x9)[_0x027c('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize[_0x027c('0xa')](0x9)[_0x027c('0x8')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x027c('0x17')},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)[_0x027c('0x8')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x027c('0x18')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x027c('0xa')](0x9)[_0x027c('0x8')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x027c('0x19')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x027c('0xa')](0x5)[_0x027c('0x8')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x027c('0x1a')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x027c('0xa')](0x9)[_0x027c('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x027c('0x1b')},'dialOrderByScheduledAt':{'type':Sequelize[_0x027c('0x4')](_0x027c('0x1c'),_0x027c('0x1d')),'defaultValue':'DESC'},'dialPrefix':{'type':Sequelize[_0x027c('0x2')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x027c('0xa')](0x3)[_0x027c('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x027c('0x1e')},'dialCutDigit':{'type':Sequelize[_0x027c('0xa')](0x3)[_0x027c('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x027c('0x1f')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x027c('0xa')](0x3)[_0x027c('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x027c('0xa')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x027c('0x20')},'dialDropMaxRetry':{'type':Sequelize[_0x027c('0xa')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x027c('0x21')},'dialDropRetryFrequency':{'type':Sequelize[_0x027c('0xa')](0x5)[_0x027c('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAbandonedMaxRetry':{'type':Sequelize[_0x027c('0xa')](0x3)[_0x027c('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x027c('0x22')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x027c('0xa')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x027c('0x23')},'dialMachineMaxRetry':{'type':Sequelize[_0x027c('0xa')](0x3)[_0x027c('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x027c('0x24')},'dialMachineRetryFrequency':{'type':Sequelize[_0x027c('0xa')](0x5)[_0x027c('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x027c('0x25')},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x027c('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x027c('0x26')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x027c('0xa')](0x5)[_0x027c('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x027c('0x27')}}; \ No newline at end of file +var _0x06a3=['sequelize','exports','name','ENUM','ivr','STRING','BOOLEAN','Active/Disactive\x20Campaign','INTEGER','UNSIGNED','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\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\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Maximum\x20Word\x20Length','DESC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'];(function(_0x12a110,_0x2f5f52){var _0x1110c5=function(_0x18680c){while(--_0x18680c){_0x12a110['push'](_0x12a110['shift']());}};_0x1110c5(++_0x2f5f52);}(_0x06a3,0xa0));var _0x306a=function(_0x1cbff5,_0x4d5c69){_0x1cbff5=_0x1cbff5-0x0;var _0x5fcda9=_0x06a3[_0x1cbff5];return _0x5fcda9;};'use strict';var Sequelize=require(_0x306a('0x0'));module[_0x306a('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x306a('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x306a('0x3')](_0x306a('0x4')),'allowNull':![],'defaultValue':_0x306a('0x4')},'description':{'type':Sequelize[_0x306a('0x5')]},'active':{'type':Sequelize[_0x306a('0x6')],'defaultValue':0x0,'comment':_0x306a('0x7')},'limitCalls':{'type':Sequelize[_0x306a('0x8')](0x4)[_0x306a('0x9')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':'Max\x20200\x20calls.'},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize[_0x306a('0x8')](0x3)[_0x306a('0x9')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x306a('0xa')},'dialCongestionMaxRetry':{'type':Sequelize[_0x306a('0x8')](0x3)[_0x306a('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x306a('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x306a('0xb')},'dialBusyMaxRetry':{'type':Sequelize[_0x306a('0x8')](0x3)[_0x306a('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x306a('0xc')},'dialBusyRetryFrequency':{'type':Sequelize[_0x306a('0x8')](0x5)[_0x306a('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x306a('0xd')},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x306a('0x9')],'defaultValue':0x3,'comment':_0x306a('0xe')},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x306a('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x306a('0xf')},'dialGlobalMaxRetry':{'type':Sequelize[_0x306a('0x8')](0x3)[_0x306a('0x9')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x306a('0x10')},'dialTimezone':{'type':Sequelize[_0x306a('0x5')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x306a('0x5')],'defaultValue':_0x306a('0x11')},'dialCheckDuplicateType':{'type':Sequelize[_0x306a('0x3')](_0x306a('0x12'),_0x306a('0x13'),_0x306a('0x14')),'defaultValue':_0x306a('0x12')},'dialAMDActive':{'type':Sequelize[_0x306a('0x6')],'defaultValue':0x0,'comment':_0x306a('0x15')},'dialAMDInitialSilence':{'type':Sequelize[_0x306a('0x8')](0x9)[_0x306a('0x9')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x306a('0x16')},'dialAMDGreeting':{'type':Sequelize[_0x306a('0x8')](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x306a('0x17')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x306a('0x8')](0x9)[_0x306a('0x9')],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x306a('0x8')](0x9)[_0x306a('0x9')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x306a('0x18')},'dialAMDMinWordLength':{'type':Sequelize[_0x306a('0x8')](0x9)[_0x306a('0x9')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x306a('0x19')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x306a('0x8')](0x9)[_0x306a('0x9')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x306a('0x1a')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x306a('0x8')](0x9)[_0x306a('0x9')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x306a('0x1b')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x306a('0x8')](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize[_0x306a('0x8')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x306a('0x1c')},'dialOrderByScheduledAt':{'type':Sequelize['ENUM'](_0x306a('0x1d'),'ASC'),'defaultValue':_0x306a('0x1d')},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x306a('0x8')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x306a('0x1e')},'dialCutDigit':{'type':Sequelize[_0x306a('0x8')](0x3)[_0x306a('0x9')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x306a('0x1f')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x306a('0x8')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x306a('0x20')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x306a('0x8')](0x5)[_0x306a('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x306a('0x21')},'dialDropMaxRetry':{'type':Sequelize[_0x306a('0x8')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x306a('0x22')},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x306a('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x306a('0x23')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x306a('0x8')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x306a('0x24')},'dialAbandonedRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x306a('0x25')},'dialMachineMaxRetry':{'type':Sequelize[_0x306a('0x8')](0x3)[_0x306a('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x306a('0x26')},'dialMachineRetryFrequency':{'type':Sequelize[_0x306a('0x8')](0x5)[_0x306a('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x306a('0x27')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x306a('0x8')](0x3)[_0x306a('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#AgentReject\x20Retry\x20(min:1,\x20max:999)'},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'}}; \ No newline at end of file diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js index 8d7d5bb..d4aed61 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 _0x7980=['bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','reject','save','then','destroy','get','IvrCampaigns','UserProfileResource','error','stack','send','index','map','Campaign','rawAttributes','fieldName','type','model','name','keys','query','intersection','attributes','fields','length','nolimit','order','sort','where','filters','pick','filter','merge','includeAll','findAll','rows','catch','show','params','include','options','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','userProfileId','clone','createdAt','updatedAt','UserProfileSection','update','CmHopper','hasOwnProperty','CampaignId','getHopperHistories','CmHopperHistory','getHopperFinals','findOne','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','CmList','addLists','ids','omit','spread','dialCheckDuplicateType','always','insert','into','cm_hopper','phone','ListId','select','field','NOW()','scheduledAt','ContactId','CmListId','toString','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','CampaignId\x20=\x20?','from','fromQuery','cm_contacts','phone\x20IS\x20NOT\x20NULL','COALESCE(phone,\x27\x27)','cmHopperId','OrderBy','ci.item','ci.OrderBY','cm_contact_has_items','join','h.createdAt\x20=\x20?','push','sequelize','all','removeLists','getBlackLists','addBlackLists','format','YYYY-MM-DD\x20HH:mm:ss','cm_hopper_black','removeBlackLists','eml-format','rimraf','fast-json-patch','request-promise','moment'];(function(_0x754ab4,_0x56daa7){var _0x34079a=function(_0x295ec1){while(--_0x295ec1){_0x754ab4['push'](_0x754ab4['shift']());}};_0x34079a(++_0x56daa7);}(_0x7980,0x123));var _0x0798=function(_0x527f56,_0x2ee44c){_0x527f56=_0x527f56-0x0;var _0x38bee5=_0x7980[_0x527f56];return _0x38bee5;};'use strict';var emlformat=require(_0x0798('0x0'));var rimraf=require(_0x0798('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0798('0x2'));var rp=require(_0x0798('0x3'));var moment=require(_0x0798('0x4'));var BPromise=require(_0x0798('0x5'));var Mustache=require(_0x0798('0x6'));var util=require(_0x0798('0x7'));var path=require(_0x0798('0x8'));var sox=require(_0x0798('0x9'));var csv=require('to-csv');var ejs=require(_0x0798('0xa'));var fs=require('fs');var fs_extra=require(_0x0798('0xb'));var _=require(_0x0798('0xc'));var squel=require(_0x0798('0xd'));var crypto=require(_0x0798('0xe'));var jsforce=require(_0x0798('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x0798('0x10'));var querystring=require(_0x0798('0x11'));var Papa=require(_0x0798('0x12'));var Redis=require(_0x0798('0x13'));var authService=require(_0x0798('0x14'));var qs=require(_0x0798('0x15'));var as=require(_0x0798('0x16'));var hardwareService=require(_0x0798('0x17'));var logger=require(_0x0798('0x18'))(_0x0798('0x19'));var utils=require(_0x0798('0x1a'));var config=require(_0x0798('0x1b'));var licenseUtil=require('../../config/license/util');var db=require(_0x0798('0x1c'))['db'];function respondWithStatusCode(_0x549e25,_0x24bbcf){_0x24bbcf=_0x24bbcf||0xcc;return function(_0x5c2bc7){if(_0x5c2bc7){return _0x549e25[_0x0798('0x1d')](_0x24bbcf);}return _0x549e25['status'](_0x24bbcf)[_0x0798('0x1e')]();};}function respondWithResult(_0x1c34f8,_0xe39220){_0xe39220=_0xe39220||0xc8;return function(_0x163de4){if(_0x163de4){return _0x1c34f8[_0x0798('0x1f')](_0xe39220)[_0x0798('0x20')](_0x163de4);}};}function respondWithFilteredResult(_0x12e352,_0x129328){return function(_0x69bc9b){if(_0x69bc9b){var _0xe435f7=typeof _0x129328[_0x0798('0x21')]===_0x0798('0x22')&&typeof _0x129328[_0x0798('0x23')]===_0x0798('0x22');var _0x3d98bd=_0x69bc9b[_0x0798('0x24')];var _0xe72507=_0xe435f7?0x0:_0x129328[_0x0798('0x21')];var _0x5cb23c=_0xe435f7?_0x69bc9b[_0x0798('0x24')]:_0x129328[_0x0798('0x21')]+_0x129328[_0x0798('0x23')];var _0xef8eb9;if(_0x5cb23c>=_0x3d98bd){_0x5cb23c=_0x3d98bd;_0xef8eb9=0xc8;}else{_0xef8eb9=0xce;}_0x12e352[_0x0798('0x1f')](_0xef8eb9);return _0x12e352[_0x0798('0x25')]('Content-Range',_0xe72507+'-'+_0x5cb23c+'/'+_0x3d98bd)[_0x0798('0x20')](_0x69bc9b);}return null;};}function patchUpdates(_0x58e55c){return function(_0x136a4c){try{jsonpatch['apply'](_0x136a4c,_0x58e55c,!![]);}catch(_0x48c8b8){return BPromise[_0x0798('0x26')](_0x48c8b8);}return _0x136a4c[_0x0798('0x27')]();};}function saveUpdates(_0x12e5e6,_0xbefc4e){return function(_0x13521b){if(_0x13521b){return _0x13521b['update'](_0x12e5e6)[_0x0798('0x28')](function(_0x50b517){return _0x50b517;});}return null;};}function removeEntity(_0x23f09b,_0x522893){return function(_0x28ebe7){if(_0x28ebe7){return _0x28ebe7[_0x0798('0x29')]()[_0x0798('0x28')](function(){var _0x4cd9c0=_0x28ebe7[_0x0798('0x2a')]({'plain':!![]});var _0x5ace1a=_0x0798('0x2b');return db[_0x0798('0x2c')][_0x0798('0x29')]({'where':{'type':_0x5ace1a,'resourceId':_0x4cd9c0['id']}})[_0x0798('0x28')](function(){return _0x28ebe7;});})['then'](function(){_0x23f09b[_0x0798('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1467db,_0x449244){return function(_0x4068b3){if(!_0x4068b3){_0x1467db['sendStatus'](0x194);}return _0x4068b3;};}function handleError(_0x16bdb7,_0x5dd247){_0x5dd247=_0x5dd247||0x1f4;return function(_0x12c9b0){logger[_0x0798('0x2d')](_0x12c9b0[_0x0798('0x2e')]);if(_0x12c9b0['name']){delete _0x12c9b0['name'];}_0x16bdb7[_0x0798('0x1f')](_0x5dd247)[_0x0798('0x2f')](_0x12c9b0);};}exports[_0x0798('0x30')]=function(_0x3b262e,_0x4f827c){var _0x449f2c={},_0x265fc1={},_0x40e078={'count':0x0,'rows':[]};var _0x2bdd8e=_[_0x0798('0x31')](db[_0x0798('0x32')][_0x0798('0x33')],function(_0x11ebd7){return{'name':_0x11ebd7[_0x0798('0x34')],'type':_0x11ebd7[_0x0798('0x35')]['key']};});_0x265fc1[_0x0798('0x36')]=_[_0x0798('0x31')](_0x2bdd8e,_0x0798('0x37'));_0x265fc1['query']=_[_0x0798('0x38')](_0x3b262e[_0x0798('0x39')]);_0x265fc1['filters']=_[_0x0798('0x3a')](_0x265fc1[_0x0798('0x36')],_0x265fc1[_0x0798('0x39')]);_0x449f2c[_0x0798('0x3b')]=_[_0x0798('0x3a')](_0x265fc1[_0x0798('0x36')],qs[_0x0798('0x3c')](_0x3b262e[_0x0798('0x39')][_0x0798('0x3c')]));_0x449f2c[_0x0798('0x3b')]=_0x449f2c['attributes'][_0x0798('0x3d')]?_0x449f2c['attributes']:_0x265fc1[_0x0798('0x36')];if(!_0x3b262e['query']['hasOwnProperty'](_0x0798('0x3e'))){_0x449f2c[_0x0798('0x23')]=qs[_0x0798('0x23')](_0x3b262e[_0x0798('0x39')][_0x0798('0x23')]);_0x449f2c[_0x0798('0x21')]=qs['offset'](_0x3b262e[_0x0798('0x39')]['offset']);}_0x449f2c[_0x0798('0x3f')]=qs[_0x0798('0x40')](_0x3b262e['query'][_0x0798('0x40')]);_0x449f2c[_0x0798('0x41')]=qs[_0x0798('0x42')](_[_0x0798('0x43')](_0x3b262e['query'],_0x265fc1['filters']),_0x2bdd8e);if(_0x3b262e['query'][_0x0798('0x44')]){_0x449f2c[_0x0798('0x41')]=_[_0x0798('0x45')](_0x449f2c[_0x0798('0x41')],{'$or':_[_0x0798('0x31')](_0x2bdd8e,function(_0x3ed811){if(_0x3ed811[_0x0798('0x35')]!=='VIRTUAL'){var _0x13fad0={};_0x13fad0[_0x3ed811[_0x0798('0x37')]]={'$like':'%'+_0x3b262e['query'][_0x0798('0x44')]+'%'};return _0x13fad0;}})});}_0x449f2c=_[_0x0798('0x45')]({},_0x449f2c,_0x3b262e['options']);var _0x360576={'where':_0x449f2c[_0x0798('0x41')]};return db[_0x0798('0x32')][_0x0798('0x24')](_0x360576)['then'](function(_0x1e5470){_0x40e078[_0x0798('0x24')]=_0x1e5470;if(_0x3b262e['query'][_0x0798('0x46')]){_0x449f2c['include']=[{'all':!![]}];}return db[_0x0798('0x32')][_0x0798('0x47')](_0x449f2c);})[_0x0798('0x28')](function(_0x3c329c){_0x40e078[_0x0798('0x48')]=_0x3c329c;return _0x40e078;})['then'](respondWithFilteredResult(_0x4f827c,_0x449f2c))[_0x0798('0x49')](handleError(_0x4f827c,null));};exports[_0x0798('0x4a')]=function(_0x3efc0e,_0x4187a7){var _0x3aa9ed={'raw':![],'where':{'id':_0x3efc0e[_0x0798('0x4b')]['id']}},_0xc20b3d={};_0xc20b3d['model']=_['keys'](db[_0x0798('0x32')][_0x0798('0x33')]);_0xc20b3d[_0x0798('0x39')]=_[_0x0798('0x38')](_0x3efc0e[_0x0798('0x39')]);_0xc20b3d[_0x0798('0x42')]=_[_0x0798('0x3a')](_0xc20b3d[_0x0798('0x36')],_0xc20b3d[_0x0798('0x39')]);_0x3aa9ed[_0x0798('0x3b')]=_[_0x0798('0x3a')](_0xc20b3d[_0x0798('0x36')],qs['fields'](_0x3efc0e[_0x0798('0x39')][_0x0798('0x3c')]));_0x3aa9ed[_0x0798('0x3b')]=_0x3aa9ed[_0x0798('0x3b')][_0x0798('0x3d')]?_0x3aa9ed[_0x0798('0x3b')]:_0xc20b3d['model'];if(_0x3efc0e[_0x0798('0x39')][_0x0798('0x46')]){_0x3aa9ed[_0x0798('0x4c')]=[{'all':!![]}];}_0x3aa9ed=_[_0x0798('0x45')]({},_0x3aa9ed,_0x3efc0e[_0x0798('0x4d')]);return db['Campaign'][_0x0798('0x4e')](_0x3aa9ed)[_0x0798('0x28')](handleEntityNotFound(_0x4187a7,null))[_0x0798('0x28')](respondWithResult(_0x4187a7,null))['catch'](handleError(_0x4187a7,null));};exports[_0x0798('0x4f')]=function(_0x2b0cd1,_0x56df74){return db[_0x0798('0x32')][_0x0798('0x4f')](_0x2b0cd1[_0x0798('0x50')],{})[_0x0798('0x28')](function(_0x582264){var _0x1c8b3b=_0x2b0cd1['user']['get']({'plain':!![]});if(!_0x1c8b3b)throw new Error(_0x0798('0x51'));if(_0x1c8b3b[_0x0798('0x52')]===_0x0798('0x53')){var _0x2be108=_0x582264['get']({'plain':!![]});var _0x2646b0=_0x0798('0x2b');return db['UserProfileSection']['find']({'where':{'name':_0x2646b0,'userProfileId':_0x1c8b3b[_0x0798('0x54')]},'raw':!![]})[_0x0798('0x28')](function(_0x57d8a3){if(_0x57d8a3&&_0x57d8a3['autoAssociation']===0x0){return db[_0x0798('0x2c')][_0x0798('0x4f')]({'name':_0x2be108['name'],'resourceId':_0x2be108['id'],'type':_0x57d8a3[_0x0798('0x37')],'sectionId':_0x57d8a3['id']},{})[_0x0798('0x28')](function(){return _0x582264;});}else{return _0x582264;}})[_0x0798('0x49')](function(_0x1c5643){logger[_0x0798('0x2d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1c5643);throw _0x1c5643;});}return _0x582264;})['then'](respondWithResult(_0x56df74,0xc9))[_0x0798('0x49')](handleError(_0x56df74,null));};exports[_0x0798('0x55')]=function(_0x38a47d,_0x579fb8){var _0x191d49={'where':{'id':_0x38a47d['params']['id']}},_0x41d912={};_0x41d912[_0x0798('0x36')]=_['keys'](db[_0x0798('0x32')][_0x0798('0x33')]);_0x191d49[_0x0798('0x3b')]=_[_0x0798('0x3a')](_0x41d912[_0x0798('0x36')],qs[_0x0798('0x3c')](_0x38a47d[_0x0798('0x39')][_0x0798('0x3c')]));_0x191d49[_0x0798('0x3b')]=_0x191d49['attributes'][_0x0798('0x3d')]?_0x191d49[_0x0798('0x3b')]:_0x41d912[_0x0798('0x36')];if(_0x38a47d[_0x0798('0x39')][_0x0798('0x46')]){_0x191d49[_0x0798('0x4c')]=[{'all':!![]}];}_0x191d49=_[_0x0798('0x45')]({},_0x191d49,_0x38a47d[_0x0798('0x4d')]);return db[_0x0798('0x32')][_0x0798('0x4e')](_0x191d49)[_0x0798('0x28')](handleEntityNotFound(_0x579fb8,null))['then'](function(_0x4e2eff){if(_0x4e2eff){var _0x2507e2=_0x4e2eff[_0x0798('0x2a')]({'plain':!![]});_0x2507e2=qs['omit'](_0x2507e2,['id',_0x0798('0x56'),_0x0798('0x57')]);_0x38a47d['body']=_['omit'](_0x38a47d['body'],['id','createdAt',_0x0798('0x57')]);return db[_0x0798('0x32')][_0x0798('0x4f')](_[_0x0798('0x45')](_0x2507e2,_0x38a47d[_0x0798('0x50')]),{'include':_0x38a47d[_0x0798('0x39')]['includeAll']?[{'all':!![]}]:undefined})['then'](function(_0x32a9e0){var _0xb7195e=_0x38a47d[_0x0798('0x53')][_0x0798('0x2a')]({'plain':!![]});if(!_0xb7195e)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xb7195e[_0x0798('0x52')]==='user'){var _0xa6c87b=_0x32a9e0[_0x0798('0x2a')]({'plain':!![]});var _0xfadb4=_0x0798('0x2b');return db[_0x0798('0x58')][_0x0798('0x4e')]({'where':{'name':_0xfadb4,'userProfileId':_0xb7195e[_0x0798('0x54')]},'raw':!![]})[_0x0798('0x28')](function(_0x5ae29a){if(_0x5ae29a&&_0x5ae29a['autoAssociation']===0x0){return db[_0x0798('0x2c')]['create']({'name':_0xa6c87b['name'],'resourceId':_0xa6c87b['id'],'type':_0x5ae29a[_0x0798('0x37')],'sectionId':_0x5ae29a['id']},{})[_0x0798('0x28')](function(){return _0x32a9e0;});}else{return _0x32a9e0;}})[_0x0798('0x49')](function(_0x3ce54c){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3ce54c);throw _0x3ce54c;});}return _0x32a9e0;});}})[_0x0798('0x28')](respondWithResult(_0x579fb8,0xc9))[_0x0798('0x49')](handleError(_0x579fb8,null));};exports[_0x0798('0x59')]=function(_0x1e3a65,_0x2fab6f){if(_0x1e3a65['body']['id']){delete _0x1e3a65['body']['id'];}return db['Campaign'][_0x0798('0x4e')]({'where':{'id':_0x1e3a65['params']['id']}})['then'](handleEntityNotFound(_0x2fab6f,null))[_0x0798('0x28')](saveUpdates(_0x1e3a65['body'],null))[_0x0798('0x28')](respondWithResult(_0x2fab6f,null))[_0x0798('0x49')](handleError(_0x2fab6f,null));};exports[_0x0798('0x29')]=function(_0x563dba,_0x3bcd8a){return db['Campaign'][_0x0798('0x4e')]({'where':{'id':_0x563dba[_0x0798('0x4b')]['id']}})[_0x0798('0x28')](handleEntityNotFound(_0x3bcd8a,null))['then'](removeEntity(_0x3bcd8a,null))[_0x0798('0x49')](handleError(_0x3bcd8a,null));};exports['getHoppers']=function(_0x434506,_0x3ac35d,_0x1218b4){var _0x2f75c2={'raw':!![],'where':{}};var _0x5b3431={};var _0x2b3501={'count':0x0,'rows':[]};return db[_0x0798('0x32')]['findOne']({'where':{'id':_0x434506['params']['id']}})[_0x0798('0x28')](handleEntityNotFound(_0x3ac35d,null))[_0x0798('0x28')](function(_0x21d9f6){if(_0x21d9f6){_0x5b3431[_0x0798('0x36')]=_[_0x0798('0x38')](db[_0x0798('0x5a')]['rawAttributes']);_0x5b3431[_0x0798('0x39')]=_[_0x0798('0x38')](_0x434506[_0x0798('0x39')]);_0x5b3431[_0x0798('0x42')]=_[_0x0798('0x3a')](_0x5b3431[_0x0798('0x36')],_0x5b3431[_0x0798('0x39')]);_0x2f75c2[_0x0798('0x3b')]=_[_0x0798('0x3a')](_0x5b3431[_0x0798('0x36')],qs['fields'](_0x434506[_0x0798('0x39')][_0x0798('0x3c')]));_0x2f75c2[_0x0798('0x3b')]=_0x2f75c2[_0x0798('0x3b')]['length']?_0x2f75c2[_0x0798('0x3b')]:_0x5b3431[_0x0798('0x36')];if(!_0x434506[_0x0798('0x39')][_0x0798('0x5b')](_0x0798('0x3e'))){_0x2f75c2[_0x0798('0x23')]=qs[_0x0798('0x23')](_0x434506[_0x0798('0x39')][_0x0798('0x23')]);_0x2f75c2[_0x0798('0x21')]=qs[_0x0798('0x21')](_0x434506[_0x0798('0x39')][_0x0798('0x21')]);}_0x2f75c2[_0x0798('0x3f')]=qs[_0x0798('0x40')](_0x434506['query'][_0x0798('0x40')]);_0x2f75c2['where']=qs[_0x0798('0x42')](_[_0x0798('0x43')](_0x434506[_0x0798('0x39')],_0x5b3431['filters']));_0x2f75c2[_0x0798('0x41')][_0x0798('0x5c')]=_0x21d9f6['id'];if(_0x434506[_0x0798('0x39')][_0x0798('0x44')]){_0x2f75c2[_0x0798('0x41')]=_[_0x0798('0x45')](_0x2f75c2[_0x0798('0x41')],{'$or':_[_0x0798('0x31')](_0x2f75c2[_0x0798('0x3b')],function(_0x45c5e0){var _0x3a45f7={};_0x3a45f7[_0x45c5e0]={'$like':'%'+_0x434506[_0x0798('0x39')][_0x0798('0x44')]+'%'};return _0x3a45f7;})});}_0x2f75c2=_[_0x0798('0x45')]({},_0x2f75c2,_0x434506[_0x0798('0x4d')]);return db[_0x0798('0x5a')][_0x0798('0x24')]({'where':_0x2f75c2[_0x0798('0x41')]})[_0x0798('0x28')](function(_0x462c92){_0x2b3501['count']=_0x462c92;if(_0x434506[_0x0798('0x39')][_0x0798('0x46')]){_0x2f75c2[_0x0798('0x4c')]=[{'all':!![]}];}return db[_0x0798('0x5a')][_0x0798('0x47')](_0x2f75c2);})['then'](function(_0x49763e){_0x2b3501[_0x0798('0x48')]=_0x49763e;return _0x2b3501;});}})[_0x0798('0x28')](respondWithFilteredResult(_0x3ac35d,_0x2f75c2))[_0x0798('0x49')](handleError(_0x3ac35d,null));};exports[_0x0798('0x5d')]=function(_0x4ae6f9,_0x3b7a13,_0xb538ef){var _0x275110={'raw':!![],'where':{}};var _0x3be448={};var _0x224c42={'count':0x0,'rows':[]};return db[_0x0798('0x32')]['findOne']({'where':{'id':_0x4ae6f9['params']['id']}})[_0x0798('0x28')](handleEntityNotFound(_0x3b7a13,null))['then'](function(_0x2d4882){if(_0x2d4882){_0x3be448[_0x0798('0x36')]=_['keys'](db[_0x0798('0x5e')]['rawAttributes']);_0x3be448[_0x0798('0x39')]=_['keys'](_0x4ae6f9[_0x0798('0x39')]);_0x3be448[_0x0798('0x42')]=_[_0x0798('0x3a')](_0x3be448['model'],_0x3be448['query']);_0x275110[_0x0798('0x3b')]=_['intersection'](_0x3be448[_0x0798('0x36')],qs['fields'](_0x4ae6f9[_0x0798('0x39')][_0x0798('0x3c')]));_0x275110['attributes']=_0x275110[_0x0798('0x3b')][_0x0798('0x3d')]?_0x275110[_0x0798('0x3b')]:_0x3be448[_0x0798('0x36')];if(!_0x4ae6f9[_0x0798('0x39')][_0x0798('0x5b')](_0x0798('0x3e'))){_0x275110[_0x0798('0x23')]=qs[_0x0798('0x23')](_0x4ae6f9[_0x0798('0x39')][_0x0798('0x23')]);_0x275110[_0x0798('0x21')]=qs[_0x0798('0x21')](_0x4ae6f9[_0x0798('0x39')][_0x0798('0x21')]);}_0x275110[_0x0798('0x3f')]=qs[_0x0798('0x40')](_0x4ae6f9[_0x0798('0x39')][_0x0798('0x40')]);_0x275110[_0x0798('0x41')]=qs['filters'](_[_0x0798('0x43')](_0x4ae6f9[_0x0798('0x39')],_0x3be448[_0x0798('0x42')]));_0x275110['where'][_0x0798('0x5c')]=_0x2d4882['id'];if(_0x4ae6f9[_0x0798('0x39')][_0x0798('0x44')]){_0x275110[_0x0798('0x41')]=_['merge'](_0x275110[_0x0798('0x41')],{'$or':_['map'](_0x275110[_0x0798('0x3b')],function(_0x5d58e6){var _0x43481e={};_0x43481e[_0x5d58e6]={'$like':'%'+_0x4ae6f9[_0x0798('0x39')][_0x0798('0x44')]+'%'};return _0x43481e;})});}_0x275110=_[_0x0798('0x45')]({},_0x275110,_0x4ae6f9[_0x0798('0x4d')]);return db[_0x0798('0x5e')][_0x0798('0x24')]({'where':_0x275110[_0x0798('0x41')]})[_0x0798('0x28')](function(_0x1408ed){_0x224c42['count']=_0x1408ed;if(_0x4ae6f9[_0x0798('0x39')][_0x0798('0x46')]){_0x275110[_0x0798('0x4c')]=[{'all':!![]}];}return db[_0x0798('0x5e')][_0x0798('0x47')](_0x275110);})[_0x0798('0x28')](function(_0x2bd771){_0x224c42[_0x0798('0x48')]=_0x2bd771;return _0x224c42;});}})['then'](respondWithFilteredResult(_0x3b7a13,_0x275110))[_0x0798('0x49')](handleError(_0x3b7a13,null));};exports[_0x0798('0x5f')]=function(_0x3b3a4c,_0xf2b9a7,_0x19bcf8){var _0x16766e={'raw':!![],'where':{}};var _0x186c0b={};var _0x16c8a6={'count':0x0,'rows':[]};return db[_0x0798('0x32')][_0x0798('0x60')]({'where':{'id':_0x3b3a4c[_0x0798('0x4b')]['id']}})[_0x0798('0x28')](handleEntityNotFound(_0xf2b9a7,null))['then'](function(_0x2df382){if(_0x2df382){_0x186c0b[_0x0798('0x36')]=_[_0x0798('0x38')](db[_0x0798('0x61')][_0x0798('0x33')]);_0x186c0b['query']=_['keys'](_0x3b3a4c[_0x0798('0x39')]);_0x186c0b[_0x0798('0x42')]=_[_0x0798('0x3a')](_0x186c0b['model'],_0x186c0b['query']);_0x16766e[_0x0798('0x3b')]=_['intersection'](_0x186c0b[_0x0798('0x36')],qs[_0x0798('0x3c')](_0x3b3a4c['query'][_0x0798('0x3c')]));_0x16766e[_0x0798('0x3b')]=_0x16766e[_0x0798('0x3b')][_0x0798('0x3d')]?_0x16766e[_0x0798('0x3b')]:_0x186c0b[_0x0798('0x36')];if(!_0x3b3a4c[_0x0798('0x39')][_0x0798('0x5b')](_0x0798('0x3e'))){_0x16766e['limit']=qs[_0x0798('0x23')](_0x3b3a4c[_0x0798('0x39')][_0x0798('0x23')]);_0x16766e[_0x0798('0x21')]=qs[_0x0798('0x21')](_0x3b3a4c['query'][_0x0798('0x21')]);}_0x16766e[_0x0798('0x3f')]=qs[_0x0798('0x40')](_0x3b3a4c[_0x0798('0x39')][_0x0798('0x40')]);_0x16766e[_0x0798('0x41')]=qs[_0x0798('0x42')](_[_0x0798('0x43')](_0x3b3a4c[_0x0798('0x39')],_0x186c0b['filters']));_0x16766e['where']['CampaignId']=_0x2df382['id'];if(_0x3b3a4c[_0x0798('0x39')]['filter']){_0x16766e['where']=_['merge'](_0x16766e[_0x0798('0x41')],{'$or':_[_0x0798('0x31')](_0x16766e[_0x0798('0x3b')],function(_0xd32315){var _0x36d51a={};_0x36d51a[_0xd32315]={'$like':'%'+_0x3b3a4c[_0x0798('0x39')][_0x0798('0x44')]+'%'};return _0x36d51a;})});}_0x16766e=_[_0x0798('0x45')]({},_0x16766e,_0x3b3a4c['options']);return db[_0x0798('0x61')][_0x0798('0x24')]({'where':_0x16766e[_0x0798('0x41')]})[_0x0798('0x28')](function(_0x2b1034){_0x16c8a6[_0x0798('0x24')]=_0x2b1034;if(_0x3b3a4c[_0x0798('0x39')]['includeAll']){_0x16766e['include']=[{'all':!![]}];}return db[_0x0798('0x61')]['findAll'](_0x16766e);})[_0x0798('0x28')](function(_0x15bd25){_0x16c8a6[_0x0798('0x48')]=_0x15bd25;return _0x16c8a6;});}})[_0x0798('0x28')](respondWithFilteredResult(_0xf2b9a7,_0x16766e))['catch'](handleError(_0xf2b9a7,null));};exports[_0x0798('0x62')]=function(_0x167027,_0xa5d6,_0x30c5eb){var _0x5adeef={'raw':!![],'where':{}};var _0x337339={};var _0x1d3a85={'count':0x0,'rows':[]};return db[_0x0798('0x32')][_0x0798('0x60')]({'where':{'id':_0x167027[_0x0798('0x4b')]['id']}})[_0x0798('0x28')](handleEntityNotFound(_0xa5d6,null))[_0x0798('0x28')](function(_0xda62a4){if(_0xda62a4){_0x337339[_0x0798('0x36')]=_['keys'](db[_0x0798('0x63')]['rawAttributes']);_0x337339[_0x0798('0x39')]=_[_0x0798('0x38')](_0x167027[_0x0798('0x39')]);_0x337339[_0x0798('0x42')]=_[_0x0798('0x3a')](_0x337339[_0x0798('0x36')],_0x337339[_0x0798('0x39')]);_0x5adeef[_0x0798('0x3b')]=_[_0x0798('0x3a')](_0x337339['model'],qs[_0x0798('0x3c')](_0x167027['query'][_0x0798('0x3c')]));_0x5adeef[_0x0798('0x3b')]=_0x5adeef[_0x0798('0x3b')][_0x0798('0x3d')]?_0x5adeef[_0x0798('0x3b')]:_0x337339[_0x0798('0x36')];if(!_0x167027[_0x0798('0x39')][_0x0798('0x5b')](_0x0798('0x3e'))){_0x5adeef[_0x0798('0x23')]=qs[_0x0798('0x23')](_0x167027[_0x0798('0x39')][_0x0798('0x23')]);_0x5adeef['offset']=qs[_0x0798('0x21')](_0x167027[_0x0798('0x39')][_0x0798('0x21')]);}_0x5adeef[_0x0798('0x3f')]=qs[_0x0798('0x40')](_0x167027[_0x0798('0x39')][_0x0798('0x40')]);_0x5adeef[_0x0798('0x41')]=qs[_0x0798('0x42')](_['pick'](_0x167027['query'],_0x337339[_0x0798('0x42')]));_0x5adeef[_0x0798('0x41')][_0x0798('0x5c')]=_0xda62a4['id'];if(_0x167027['query']['filter']){_0x5adeef[_0x0798('0x41')]=_[_0x0798('0x45')](_0x5adeef[_0x0798('0x41')],{'$or':_[_0x0798('0x31')](_0x5adeef['attributes'],function(_0x5a97d4){var _0x568b01={};_0x568b01[_0x5a97d4]={'$like':'%'+_0x167027[_0x0798('0x39')][_0x0798('0x44')]+'%'};return _0x568b01;})});}_0x5adeef=_['merge']({},_0x5adeef,_0x167027[_0x0798('0x4d')]);return db[_0x0798('0x63')][_0x0798('0x24')]({'where':_0x5adeef[_0x0798('0x41')]})[_0x0798('0x28')](function(_0x5ac828){_0x1d3a85[_0x0798('0x24')]=_0x5ac828;if(_0x167027[_0x0798('0x39')][_0x0798('0x46')]){_0x5adeef[_0x0798('0x4c')]=[{'all':!![]}];}return db['CmHopperBlack'][_0x0798('0x47')](_0x5adeef);})[_0x0798('0x28')](function(_0x3b89f2){_0x1d3a85[_0x0798('0x48')]=_0x3b89f2;return _0x1d3a85;});}})[_0x0798('0x28')](respondWithFilteredResult(_0xa5d6,_0x5adeef))[_0x0798('0x49')](handleError(_0xa5d6,null));};exports[_0x0798('0x64')]=function(_0x192414,_0x46105f,_0x324100){var _0x3260e1={};var _0x5f01d0={};var _0x2cedf5;var _0x2fe0fa;return db[_0x0798('0x32')][_0x0798('0x60')]({'where':{'id':_0x192414[_0x0798('0x4b')]['id']}})[_0x0798('0x28')](handleEntityNotFound(_0x46105f,null))[_0x0798('0x28')](function(_0x372382){if(_0x372382){_0x2cedf5=_0x372382;_0x5f01d0[_0x0798('0x36')]=_[_0x0798('0x38')](db[_0x0798('0x65')]['rawAttributes']);_0x5f01d0[_0x0798('0x39')]=_[_0x0798('0x38')](_0x192414['query']);_0x5f01d0['filters']=_[_0x0798('0x3a')](_0x5f01d0['model'],_0x5f01d0[_0x0798('0x39')]);_0x3260e1[_0x0798('0x3b')]=_['intersection'](_0x5f01d0[_0x0798('0x36')],qs[_0x0798('0x3c')](_0x192414[_0x0798('0x39')][_0x0798('0x3c')]));_0x3260e1[_0x0798('0x3b')]=_0x3260e1['attributes'][_0x0798('0x3d')]?_0x3260e1['attributes']:_0x5f01d0[_0x0798('0x36')];_0x3260e1[_0x0798('0x3f')]=qs[_0x0798('0x40')](_0x192414[_0x0798('0x39')][_0x0798('0x40')]);_0x3260e1['where']=qs['filters'](_[_0x0798('0x43')](_0x192414[_0x0798('0x39')],_0x5f01d0['filters']));if(_0x192414[_0x0798('0x39')][_0x0798('0x44')]){_0x3260e1[_0x0798('0x41')]=_['merge'](_0x3260e1[_0x0798('0x41')],{'$or':_['map'](_0x3260e1[_0x0798('0x3b')],function(_0x1397e9){var _0xa2b922={};_0xa2b922[_0x1397e9]={'$like':'%'+_0x192414[_0x0798('0x39')]['filter']+'%'};return _0xa2b922;})});}_0x3260e1=_[_0x0798('0x45')]({},_0x3260e1,_0x192414[_0x0798('0x4d')]);return _0x2cedf5['getLists'](_0x3260e1);}})[_0x0798('0x28')](function(_0x248d54){if(_0x248d54){_0x2fe0fa=_0x248d54[_0x0798('0x3d')];if(!_0x192414[_0x0798('0x39')][_0x0798('0x5b')]('nolimit')){_0x3260e1['limit']=qs[_0x0798('0x23')](_0x192414['query'][_0x0798('0x23')]);_0x3260e1[_0x0798('0x21')]=qs[_0x0798('0x21')](_0x192414[_0x0798('0x39')][_0x0798('0x21')]);}return _0x2cedf5[_0x0798('0x64')](_0x3260e1);}})[_0x0798('0x28')](function(_0x3382eb){if(_0x3382eb){return _0x3382eb?{'count':_0x2fe0fa,'rows':_0x3382eb}:null;}})[_0x0798('0x28')](respondWithResult(_0x46105f,null))[_0x0798('0x49')](handleError(_0x46105f,null));};exports['addLists']=function(_0x4e4dc2,_0x14ac3f,_0x5578fe){var _0x80259,_0x2caab8;var _0x57bd00=[];var _0x343afb=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');return db[_0x0798('0x32')][_0x0798('0x4e')]({'where':{'id':_0x4e4dc2[_0x0798('0x4b')]['id']}})[_0x0798('0x28')](handleEntityNotFound(_0x14ac3f,null))[_0x0798('0x28')](function(_0x448cd1){if(_0x448cd1){_0x2caab8=_0x448cd1;return _0x448cd1[_0x0798('0x66')](_0x4e4dc2[_0x0798('0x50')][_0x0798('0x67')],_[_0x0798('0x68')](_0x4e4dc2[_0x0798('0x50')],[_0x0798('0x67'),'id'])||{});}return null;})[_0x0798('0x69')](function(_0x47cd23){var _0x4d5b70;var _0x5f4f31;_0x80259=_0x47cd23||[];var _0x4e74e3=[];if(_0x47cd23){for(var _0x159038=0x0;_0x159038<_0x47cd23['length'];_0x159038+=0x1){var _0x3abf6a=_0x47cd23[_0x159038][_0x0798('0x2a')]({'plain':!![]});_0x2caab8[_0x0798('0x6a')]=_0x4e4dc2[_0x0798('0x50')][_0x0798('0x6a')]?_0x4e4dc2['body'][_0x0798('0x6a')]:_0x2caab8[_0x0798('0x6a')];switch(_0x2caab8[_0x0798('0x6a')]){case _0x0798('0x6b'):_0x4d5b70=squel[_0x0798('0x6c')]()[_0x0798('0x6d')](_0x0798('0x6e'))['fromQuery']([_0x0798('0x6f'),'scheduledAt','ContactId',_0x0798('0x70'),'CampaignId','createdAt',_0x0798('0x57')],squel[_0x0798('0x71')]()[_0x0798('0x72')](_0x0798('0x6f'),_0x0798('0x6f'))[_0x0798('0x72')](_0x0798('0x73'),_0x0798('0x74'))['field']('id',_0x0798('0x75'))[_0x0798('0x72')](_0x3abf6a[_0x0798('0x76')][_0x0798('0x77')](),_0x0798('0x70'))[_0x0798('0x72')](_0x4e4dc2[_0x0798('0x4b')]['id'][_0x0798('0x77')](),_0x0798('0x5c'))[_0x0798('0x72')]('\x27'+_0x343afb+'\x27',_0x0798('0x56'))[_0x0798('0x72')]('\x27'+_0x343afb+'\x27',_0x0798('0x57'))['from']('cm_contacts')['where'](_0x0798('0x78'))['where'](_0x0798('0x79'),_0x3abf6a[_0x0798('0x76')][_0x0798('0x77')]())[_0x0798('0x41')]('phone\x20IS\x20NOT\x20NULL')[_0x0798('0x41')](_0x0798('0x7a'),squel[_0x0798('0x71')]()[_0x0798('0x72')](_0x0798('0x7b'))['from'](_0x0798('0x7c'))[_0x0798('0x41')](_0x0798('0x7d'),_0x4e4dc2[_0x0798('0x4b')]['id'][_0x0798('0x77')]()))[_0x0798('0x41')]('phone\x20NOT\x20IN\x20(?)',squel[_0x0798('0x71')]()[_0x0798('0x72')]('COALESCE(phone,\x27\x27)')[_0x0798('0x7e')]('cm_hopper')[_0x0798('0x41')]('CampaignId\x20=\x20?',_0x4e4dc2[_0x0798('0x4b')]['id'][_0x0798('0x77')]())))[_0x0798('0x77')]();break;case'onlyIfOpen':_0x4d5b70=squel['insert']()[_0x0798('0x6d')]('cm_hopper')[_0x0798('0x7f')](['phone','scheduledAt',_0x0798('0x75'),_0x0798('0x70'),_0x0798('0x5c'),'createdAt',_0x0798('0x57')],squel[_0x0798('0x71')]()[_0x0798('0x72')](_0x0798('0x6f'),'phone')[_0x0798('0x72')](_0x0798('0x73'),_0x0798('0x74'))['field']('id','ContactId')[_0x0798('0x72')](_0x3abf6a[_0x0798('0x76')]['toString'](),_0x0798('0x70'))[_0x0798('0x72')](_0x4e4dc2[_0x0798('0x4b')]['id'][_0x0798('0x77')](),_0x0798('0x5c'))[_0x0798('0x72')]('\x27'+_0x343afb+'\x27',_0x0798('0x56'))[_0x0798('0x72')]('\x27'+_0x343afb+'\x27',_0x0798('0x57'))['from'](_0x0798('0x80'))[_0x0798('0x41')](_0x0798('0x78'))[_0x0798('0x41')](_0x0798('0x79'),_0x3abf6a[_0x0798('0x76')][_0x0798('0x77')]())['where'](_0x0798('0x81'))['where']('phone\x20NOT\x20IN\x20(?)',squel['select']()['field'](_0x0798('0x82'))['from'](_0x0798('0x6e'))[_0x0798('0x41')](_0x0798('0x7d'),_0x4e4dc2[_0x0798('0x4b')]['id'][_0x0798('0x77')]())))['toString']();break;default:_0x4d5b70=squel[_0x0798('0x6c')]()[_0x0798('0x6d')](_0x0798('0x6e'))[_0x0798('0x7f')](['phone',_0x0798('0x74'),_0x0798('0x75'),'ListId','CampaignId',_0x0798('0x56'),_0x0798('0x57')],squel[_0x0798('0x71')]()['field'](_0x0798('0x6f'),_0x0798('0x6f'))[_0x0798('0x72')]('NOW()',_0x0798('0x74'))['field']('id','ContactId')['field'](_0x3abf6a[_0x0798('0x76')][_0x0798('0x77')](),'ListId')[_0x0798('0x72')](_0x4e4dc2[_0x0798('0x4b')]['id'][_0x0798('0x77')](),_0x0798('0x5c'))[_0x0798('0x72')]('\x27'+_0x343afb+'\x27','createdAt')[_0x0798('0x72')]('\x27'+_0x343afb+'\x27',_0x0798('0x57'))[_0x0798('0x7e')](_0x0798('0x80'))['where'](_0x0798('0x78'))[_0x0798('0x41')](_0x0798('0x79'),_0x3abf6a['CmListId'][_0x0798('0x77')]())[_0x0798('0x41')](_0x0798('0x81')))[_0x0798('0x77')]();}_0x5f4f31=squel[_0x0798('0x6c')]()[_0x0798('0x6d')]('cm_hopper_additional_phones')[_0x0798('0x7f')]([_0x0798('0x83'),_0x0798('0x74'),_0x0798('0x6f'),_0x0798('0x84'),'createdAt',_0x0798('0x57')],squel[_0x0798('0x71')]()[_0x0798('0x72')]('h.id','id')[_0x0798('0x72')](_0x0798('0x73'),'scheduledAt')['field'](_0x0798('0x85'),_0x0798('0x6f'))[_0x0798('0x72')](_0x0798('0x86'),_0x0798('0x84'))[_0x0798('0x72')]('\x27'+_0x343afb+'\x27',_0x0798('0x56'))[_0x0798('0x72')]('\x27'+_0x343afb+'\x27',_0x0798('0x57'))[_0x0798('0x7e')](_0x0798('0x87'),'ci')[_0x0798('0x88')](_0x0798('0x6e'),'h','h.ContactId\x20=\x20ci.CmContactId')['where']('h.ListId\x20=\x20?',_0x3abf6a[_0x0798('0x76')]['toString']())[_0x0798('0x41')]('h.CampaignId=?',_0x4e4dc2['params']['id'][_0x0798('0x77')]())[_0x0798('0x41')](_0x0798('0x89'),_0x343afb))[_0x0798('0x77')]();_0x4e74e3[_0x0798('0x8a')](db['sequelize']['query'](_0x4d5b70));_0x57bd00[_0x0798('0x8a')](db[_0x0798('0x8b')][_0x0798('0x39')](_0x5f4f31));}return BPromise[_0x0798('0x8c')](_0x4e74e3);}})[_0x0798('0x28')](function(){return BPromise[_0x0798('0x8c')](_0x57bd00);})['then'](function(){return _0x80259;})[_0x0798('0x28')](respondWithResult(_0x14ac3f,null))[_0x0798('0x49')](handleError(_0x14ac3f,null));};exports[_0x0798('0x8d')]=function(_0x354dbc,_0x223668,_0x87a39d){return db[_0x0798('0x32')][_0x0798('0x4e')]({'where':{'id':_0x354dbc[_0x0798('0x4b')]['id']}})[_0x0798('0x28')](handleEntityNotFound(_0x223668,null))[_0x0798('0x28')](function(_0x261042){if(_0x261042){return _0x261042[_0x0798('0x8d')](_0x354dbc[_0x0798('0x39')][_0x0798('0x67')]);}})[_0x0798('0x28')](function(_0x54c013){if(_0x54c013){return db[_0x0798('0x5a')][_0x0798('0x29')]({'where':{'ListId':_0x354dbc[_0x0798('0x39')][_0x0798('0x67')],'CampaignId':_0x354dbc[_0x0798('0x4b')]['id']}})[_0x0798('0x28')](function(){return _0x54c013;});}})[_0x0798('0x28')](respondWithStatusCode(_0x223668,null))[_0x0798('0x49')](handleError(_0x223668,null));};exports[_0x0798('0x8e')]=function(_0x3b2275,_0x222f68,_0x3dc631){var _0x21e151={};var _0x4e8c72={};var _0x5c6367;var _0xc7cfb8;return db[_0x0798('0x32')][_0x0798('0x60')]({'where':{'id':_0x3b2275[_0x0798('0x4b')]['id']}})[_0x0798('0x28')](handleEntityNotFound(_0x222f68,null))[_0x0798('0x28')](function(_0x2ab09f){if(_0x2ab09f){_0x5c6367=_0x2ab09f;_0x4e8c72[_0x0798('0x36')]=_[_0x0798('0x38')](db[_0x0798('0x65')]['rawAttributes']);_0x4e8c72[_0x0798('0x39')]=_[_0x0798('0x38')](_0x3b2275[_0x0798('0x39')]);_0x4e8c72[_0x0798('0x42')]=_[_0x0798('0x3a')](_0x4e8c72['model'],_0x4e8c72[_0x0798('0x39')]);_0x21e151[_0x0798('0x3b')]=_[_0x0798('0x3a')](_0x4e8c72['model'],qs[_0x0798('0x3c')](_0x3b2275['query'][_0x0798('0x3c')]));_0x21e151['attributes']=_0x21e151[_0x0798('0x3b')][_0x0798('0x3d')]?_0x21e151['attributes']:_0x4e8c72[_0x0798('0x36')];_0x21e151[_0x0798('0x3f')]=qs['sort'](_0x3b2275[_0x0798('0x39')]['sort']);_0x21e151['where']=qs[_0x0798('0x42')](_['pick'](_0x3b2275[_0x0798('0x39')],_0x4e8c72[_0x0798('0x42')]));if(_0x3b2275[_0x0798('0x39')]['filter']){_0x21e151[_0x0798('0x41')]=_[_0x0798('0x45')](_0x21e151[_0x0798('0x41')],{'$or':_['map'](_0x21e151[_0x0798('0x3b')],function(_0x1b6f6c){var _0x336994={};_0x336994[_0x1b6f6c]={'$like':'%'+_0x3b2275['query'][_0x0798('0x44')]+'%'};return _0x336994;})});}_0x21e151=_[_0x0798('0x45')]({},_0x21e151,_0x3b2275['options']);return _0x5c6367[_0x0798('0x8e')](_0x21e151);}})[_0x0798('0x28')](function(_0x410544){if(_0x410544){_0xc7cfb8=_0x410544[_0x0798('0x3d')];if(!_0x3b2275[_0x0798('0x39')][_0x0798('0x5b')](_0x0798('0x3e'))){_0x21e151[_0x0798('0x23')]=qs[_0x0798('0x23')](_0x3b2275['query'][_0x0798('0x23')]);_0x21e151[_0x0798('0x21')]=qs[_0x0798('0x21')](_0x3b2275[_0x0798('0x39')][_0x0798('0x21')]);}return _0x5c6367[_0x0798('0x8e')](_0x21e151);}})[_0x0798('0x28')](function(_0x2614ac){if(_0x2614ac){return _0x2614ac?{'count':_0xc7cfb8,'rows':_0x2614ac}:null;}})[_0x0798('0x28')](respondWithResult(_0x222f68,null))['catch'](handleError(_0x222f68,null));};exports[_0x0798('0x8f')]=function(_0x5d2281,_0x16b797,_0x48dfcc){var _0x3eb4d7,_0x52661b;var _0x26a592=[];var _0x16528b=moment()[_0x0798('0x90')](_0x0798('0x91'));return db[_0x0798('0x32')]['find']({'where':{'id':_0x5d2281[_0x0798('0x4b')]['id']}})[_0x0798('0x28')](handleEntityNotFound(_0x16b797,null))[_0x0798('0x28')](function(_0x568548){if(_0x568548){_0x52661b=_0x568548;return _0x568548[_0x0798('0x8f')](_0x5d2281['body'][_0x0798('0x67')],_['omit'](_0x5d2281[_0x0798('0x50')],[_0x0798('0x67'),'id'])||{});}return null;})[_0x0798('0x69')](function(_0x5456d3){var _0x4e9ae8;var _0x9119b6;_0x3eb4d7=_0x5456d3||[];var _0x5c3b73=[];if(_0x5456d3){for(var _0x385fea=0x0;_0x385fea<_0x5456d3[_0x0798('0x3d')];_0x385fea+=0x1){var _0x4ed8b8=_0x5456d3[_0x385fea]['get']({'plain':!![]});_0x4e9ae8=squel['insert']()[_0x0798('0x6d')](_0x0798('0x92'))[_0x0798('0x7f')]([_0x0798('0x6f'),_0x0798('0x75'),_0x0798('0x70'),_0x0798('0x5c'),_0x0798('0x56'),_0x0798('0x57')],squel[_0x0798('0x71')]()[_0x0798('0x72')](_0x0798('0x6f'),_0x0798('0x6f'))[_0x0798('0x72')]('id',_0x0798('0x75'))[_0x0798('0x72')](_0x4ed8b8['CmListId'][_0x0798('0x77')](),'ListId')[_0x0798('0x72')](_0x5d2281['params']['id']['toString'](),_0x0798('0x5c'))[_0x0798('0x72')](_0x0798('0x73'),'createdAt')[_0x0798('0x72')](_0x0798('0x73'),_0x0798('0x57'))[_0x0798('0x7e')](_0x0798('0x80'))['where'](_0x0798('0x78'))[_0x0798('0x41')]('ListId\x20=\x20?',_0x4ed8b8[_0x0798('0x76')][_0x0798('0x77')]())[_0x0798('0x41')](_0x0798('0x81')))[_0x0798('0x77')]();_0x5c3b73[_0x0798('0x8a')](db['sequelize'][_0x0798('0x39')](_0x4e9ae8));}return BPromise['all'](_0x5c3b73);}})['then'](function(){return _0x3eb4d7;})[_0x0798('0x28')](respondWithResult(_0x16b797,null))['catch'](handleError(_0x16b797,null));};exports[_0x0798('0x93')]=function(_0x67ece1,_0x1a713c,_0x4cfdf3){return db['Campaign'][_0x0798('0x4e')]({'where':{'id':_0x67ece1[_0x0798('0x4b')]['id']}})['then'](handleEntityNotFound(_0x1a713c,null))[_0x0798('0x28')](function(_0x14421a){if(_0x14421a){return _0x14421a[_0x0798('0x93')](_0x67ece1[_0x0798('0x39')]['ids']);}})[_0x0798('0x28')](function(_0x175690){if(_0x175690){return db[_0x0798('0x63')][_0x0798('0x29')]({'where':{'ListId':_0x67ece1['query'][_0x0798('0x67')],'CampaignId':_0x67ece1[_0x0798('0x4b')]['id']}})[_0x0798('0x28')](function(){return _0x175690;});}})[_0x0798('0x28')](respondWithStatusCode(_0x1a713c,null))[_0x0798('0x49')](handleError(_0x1a713c,null));}; \ No newline at end of file +var _0x3d7f=['get','IvrCampaigns','error','stack','name','send','index','map','Campaign','rawAttributes','fieldName','type','key','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','include','findAll','catch','show','params','includeAll','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','options','omit','createdAt','updatedAt','autoAssociation','getHoppers','findOne','CmHopper','order','rows','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','CampaignId','CmList','getLists','addLists','format','ids','spread','dialCheckDuplicateType','insert','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','field','CmListId','toString','from','cm_contacts','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','select','cm_hopper_final','COALESCE(phone,\x27\x27)','CampaignId\x20=\x20?','onlyIfOpen','NOW()','ListId\x20=\x20?','cm_hopper_additional_phones','cmHopperId','OrderBy','h.id','ci.item','ci.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','getBlackLists','addBlackLists','YYYY-MM-DD\x20HH:mm:ss','cm_hopper_black','deletedAt\x20IS\x20NULL','removeBlackLists','eml-format','zip-dir','request-promise','moment','bluebird','mustache','sox','to-csv','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../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','then','destroy'];(function(_0x20f1be,_0x59cf4c){var _0x40ac38=function(_0x177d88){while(--_0x177d88){_0x20f1be['push'](_0x20f1be['shift']());}};_0x40ac38(++_0x59cf4c);}(_0x3d7f,0x1a1));var _0xf3d7=function(_0x278e3c,_0x1c9cfd){_0x278e3c=_0x278e3c-0x0;var _0x3e2d9b=_0x3d7f[_0x278e3c];return _0x3e2d9b;};'use strict';var emlformat=require(_0xf3d7('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf3d7('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf3d7('0x2'));var moment=require(_0xf3d7('0x3'));var BPromise=require(_0xf3d7('0x4'));var Mustache=require(_0xf3d7('0x5'));var util=require('util');var path=require('path');var sox=require(_0xf3d7('0x6'));var csv=require(_0xf3d7('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf3d7('0x8'));var squel=require(_0xf3d7('0x9'));var crypto=require(_0xf3d7('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xf3d7('0xb'));var toCsv=require(_0xf3d7('0x7'));var querystring=require(_0xf3d7('0xc'));var Papa=require(_0xf3d7('0xd'));var Redis=require(_0xf3d7('0xe'));var authService=require(_0xf3d7('0xf'));var qs=require(_0xf3d7('0x10'));var as=require(_0xf3d7('0x11'));var hardwareService=require(_0xf3d7('0x12'));var logger=require(_0xf3d7('0x13'))(_0xf3d7('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xf3d7('0x15'));var db=require(_0xf3d7('0x16'))['db'];function respondWithStatusCode(_0x5e7b43,_0x161613){_0x161613=_0x161613||0xcc;return function(_0xecd54c){if(_0xecd54c){return _0x5e7b43[_0xf3d7('0x17')](_0x161613);}return _0x5e7b43['status'](_0x161613)[_0xf3d7('0x18')]();};}function respondWithResult(_0x1c5bb4,_0x1a895a){_0x1a895a=_0x1a895a||0xc8;return function(_0x14b5d3){if(_0x14b5d3){return _0x1c5bb4[_0xf3d7('0x19')](_0x1a895a)[_0xf3d7('0x1a')](_0x14b5d3);}};}function respondWithFilteredResult(_0x5622c1,_0x415a3f){return function(_0x24e584){if(_0x24e584){var _0x305b5c=typeof _0x415a3f[_0xf3d7('0x1b')]===_0xf3d7('0x1c')&&typeof _0x415a3f[_0xf3d7('0x1d')]===_0xf3d7('0x1c');var _0x4e160f=_0x24e584[_0xf3d7('0x1e')];var _0xaf4f4c=_0x305b5c?0x0:_0x415a3f[_0xf3d7('0x1b')];var _0x189eed=_0x305b5c?_0x24e584[_0xf3d7('0x1e')]:_0x415a3f[_0xf3d7('0x1b')]+_0x415a3f['limit'];var _0x1869e3;if(_0x189eed>=_0x4e160f){_0x189eed=_0x4e160f;_0x1869e3=0xc8;}else{_0x1869e3=0xce;}_0x5622c1[_0xf3d7('0x19')](_0x1869e3);return _0x5622c1[_0xf3d7('0x1f')](_0xf3d7('0x20'),_0xaf4f4c+'-'+_0x189eed+'/'+_0x4e160f)[_0xf3d7('0x1a')](_0x24e584);}return null;};}function patchUpdates(_0x43df6a){return function(_0x4b4fda){try{jsonpatch[_0xf3d7('0x21')](_0x4b4fda,_0x43df6a,!![]);}catch(_0xbcf366){return BPromise[_0xf3d7('0x22')](_0xbcf366);}return _0x4b4fda[_0xf3d7('0x23')]();};}function saveUpdates(_0x564daa,_0x325ca5){return function(_0x1c2a31){if(_0x1c2a31){return _0x1c2a31[_0xf3d7('0x24')](_0x564daa)[_0xf3d7('0x25')](function(_0x2fda73){return _0x2fda73;});}return null;};}function removeEntity(_0x67ad16,_0x573d5e){return function(_0x3943f7){if(_0x3943f7){return _0x3943f7[_0xf3d7('0x26')]()[_0xf3d7('0x25')](function(){var _0xbe9345=_0x3943f7[_0xf3d7('0x27')]({'plain':!![]});var _0x361c12=_0xf3d7('0x28');return db['UserProfileResource'][_0xf3d7('0x26')]({'where':{'type':_0x361c12,'resourceId':_0xbe9345['id']}})[_0xf3d7('0x25')](function(){return _0x3943f7;});})[_0xf3d7('0x25')](function(){_0x67ad16['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x355234,_0x4cb47c){return function(_0x21d058){if(!_0x21d058){_0x355234['sendStatus'](0x194);}return _0x21d058;};}function handleError(_0x8f8013,_0x3aefc9){_0x3aefc9=_0x3aefc9||0x1f4;return function(_0x552e66){logger[_0xf3d7('0x29')](_0x552e66[_0xf3d7('0x2a')]);if(_0x552e66[_0xf3d7('0x2b')]){delete _0x552e66[_0xf3d7('0x2b')];}_0x8f8013[_0xf3d7('0x19')](_0x3aefc9)[_0xf3d7('0x2c')](_0x552e66);};}exports[_0xf3d7('0x2d')]=function(_0x380e33,_0x2b2ed2){var _0xc05c1={},_0xb0469c={},_0x407bea={'count':0x0,'rows':[]};var _0x3b0ad0=_[_0xf3d7('0x2e')](db[_0xf3d7('0x2f')][_0xf3d7('0x30')],function(_0x1a306b){return{'name':_0x1a306b[_0xf3d7('0x31')],'type':_0x1a306b[_0xf3d7('0x32')][_0xf3d7('0x33')]};});_0xb0469c['model']=_[_0xf3d7('0x2e')](_0x3b0ad0,_0xf3d7('0x2b'));_0xb0469c[_0xf3d7('0x34')]=_[_0xf3d7('0x35')](_0x380e33[_0xf3d7('0x34')]);_0xb0469c[_0xf3d7('0x36')]=_['intersection'](_0xb0469c[_0xf3d7('0x37')],_0xb0469c[_0xf3d7('0x34')]);_0xc05c1[_0xf3d7('0x38')]=_[_0xf3d7('0x39')](_0xb0469c['model'],qs[_0xf3d7('0x3a')](_0x380e33[_0xf3d7('0x34')][_0xf3d7('0x3a')]));_0xc05c1[_0xf3d7('0x38')]=_0xc05c1['attributes'][_0xf3d7('0x3b')]?_0xc05c1[_0xf3d7('0x38')]:_0xb0469c[_0xf3d7('0x37')];if(!_0x380e33[_0xf3d7('0x34')][_0xf3d7('0x3c')](_0xf3d7('0x3d'))){_0xc05c1[_0xf3d7('0x1d')]=qs['limit'](_0x380e33[_0xf3d7('0x34')][_0xf3d7('0x1d')]);_0xc05c1[_0xf3d7('0x1b')]=qs[_0xf3d7('0x1b')](_0x380e33[_0xf3d7('0x34')][_0xf3d7('0x1b')]);}_0xc05c1['order']=qs['sort'](_0x380e33[_0xf3d7('0x34')][_0xf3d7('0x3e')]);_0xc05c1[_0xf3d7('0x3f')]=qs[_0xf3d7('0x36')](_[_0xf3d7('0x40')](_0x380e33[_0xf3d7('0x34')],_0xb0469c[_0xf3d7('0x36')]),_0x3b0ad0);if(_0x380e33['query'][_0xf3d7('0x41')]){_0xc05c1[_0xf3d7('0x3f')]=_[_0xf3d7('0x42')](_0xc05c1[_0xf3d7('0x3f')],{'$or':_[_0xf3d7('0x2e')](_0x3b0ad0,function(_0x5378a7){if(_0x5378a7[_0xf3d7('0x32')]!==_0xf3d7('0x43')){var _0x43094c={};_0x43094c[_0x5378a7['name']]={'$like':'%'+_0x380e33[_0xf3d7('0x34')][_0xf3d7('0x41')]+'%'};return _0x43094c;}})});}_0xc05c1=_[_0xf3d7('0x42')]({},_0xc05c1,_0x380e33['options']);var _0x3274c9={'where':_0xc05c1[_0xf3d7('0x3f')]};return db[_0xf3d7('0x2f')][_0xf3d7('0x1e')](_0x3274c9)[_0xf3d7('0x25')](function(_0x2c4e41){_0x407bea[_0xf3d7('0x1e')]=_0x2c4e41;if(_0x380e33['query']['includeAll']){_0xc05c1[_0xf3d7('0x44')]=[{'all':!![]}];}return db[_0xf3d7('0x2f')][_0xf3d7('0x45')](_0xc05c1);})[_0xf3d7('0x25')](function(_0x5c3b3c){_0x407bea['rows']=_0x5c3b3c;return _0x407bea;})[_0xf3d7('0x25')](respondWithFilteredResult(_0x2b2ed2,_0xc05c1))[_0xf3d7('0x46')](handleError(_0x2b2ed2,null));};exports[_0xf3d7('0x47')]=function(_0xa9d6f3,_0x11db5f){var _0x13654f={'raw':![],'where':{'id':_0xa9d6f3[_0xf3d7('0x48')]['id']}},_0x1a9af7={};_0x1a9af7[_0xf3d7('0x37')]=_[_0xf3d7('0x35')](db[_0xf3d7('0x2f')][_0xf3d7('0x30')]);_0x1a9af7[_0xf3d7('0x34')]=_[_0xf3d7('0x35')](_0xa9d6f3['query']);_0x1a9af7[_0xf3d7('0x36')]=_[_0xf3d7('0x39')](_0x1a9af7[_0xf3d7('0x37')],_0x1a9af7[_0xf3d7('0x34')]);_0x13654f[_0xf3d7('0x38')]=_[_0xf3d7('0x39')](_0x1a9af7['model'],qs[_0xf3d7('0x3a')](_0xa9d6f3[_0xf3d7('0x34')]['fields']));_0x13654f[_0xf3d7('0x38')]=_0x13654f['attributes'][_0xf3d7('0x3b')]?_0x13654f[_0xf3d7('0x38')]:_0x1a9af7[_0xf3d7('0x37')];if(_0xa9d6f3[_0xf3d7('0x34')][_0xf3d7('0x49')]){_0x13654f['include']=[{'all':!![]}];}_0x13654f=_[_0xf3d7('0x42')]({},_0x13654f,_0xa9d6f3['options']);return db[_0xf3d7('0x2f')][_0xf3d7('0x4a')](_0x13654f)[_0xf3d7('0x25')](handleEntityNotFound(_0x11db5f,null))[_0xf3d7('0x25')](respondWithResult(_0x11db5f,null))['catch'](handleError(_0x11db5f,null));};exports[_0xf3d7('0x4b')]=function(_0x83d058,_0x40eae9){return db[_0xf3d7('0x2f')][_0xf3d7('0x4b')](_0x83d058[_0xf3d7('0x4c')],{})[_0xf3d7('0x25')](function(_0x180d72){var _0x329de6=_0x83d058['user'][_0xf3d7('0x27')]({'plain':!![]});if(!_0x329de6)throw new Error(_0xf3d7('0x4d'));if(_0x329de6[_0xf3d7('0x4e')]===_0xf3d7('0x4f')){var _0xfce1a=_0x180d72['get']({'plain':!![]});var _0x32c7e8='IvrCampaigns';return db[_0xf3d7('0x50')][_0xf3d7('0x4a')]({'where':{'name':_0x32c7e8,'userProfileId':_0x329de6[_0xf3d7('0x51')]},'raw':!![]})[_0xf3d7('0x25')](function(_0x937ac){if(_0x937ac&&_0x937ac['autoAssociation']===0x0){return db[_0xf3d7('0x52')][_0xf3d7('0x4b')]({'name':_0xfce1a[_0xf3d7('0x2b')],'resourceId':_0xfce1a['id'],'type':_0x937ac[_0xf3d7('0x2b')],'sectionId':_0x937ac['id']},{})[_0xf3d7('0x25')](function(){return _0x180d72;});}else{return _0x180d72;}})['catch'](function(_0xd564c1){logger[_0xf3d7('0x29')](_0xf3d7('0x53'),_0xd564c1);throw _0xd564c1;});}return _0x180d72;})[_0xf3d7('0x25')](respondWithResult(_0x40eae9,0xc9))[_0xf3d7('0x46')](handleError(_0x40eae9,null));};exports[_0xf3d7('0x54')]=function(_0x1c70dc,_0xca8122){var _0x400d09={'where':{'id':_0x1c70dc[_0xf3d7('0x48')]['id']}},_0x5d0a67={};_0x5d0a67[_0xf3d7('0x37')]=_[_0xf3d7('0x35')](db['Campaign'][_0xf3d7('0x30')]);_0x400d09[_0xf3d7('0x38')]=_[_0xf3d7('0x39')](_0x5d0a67[_0xf3d7('0x37')],qs[_0xf3d7('0x3a')](_0x1c70dc[_0xf3d7('0x34')][_0xf3d7('0x3a')]));_0x400d09['attributes']=_0x400d09[_0xf3d7('0x38')][_0xf3d7('0x3b')]?_0x400d09[_0xf3d7('0x38')]:_0x5d0a67[_0xf3d7('0x37')];if(_0x1c70dc[_0xf3d7('0x34')]['includeAll']){_0x400d09[_0xf3d7('0x44')]=[{'all':!![]}];}_0x400d09=_[_0xf3d7('0x42')]({},_0x400d09,_0x1c70dc[_0xf3d7('0x55')]);return db[_0xf3d7('0x2f')][_0xf3d7('0x4a')](_0x400d09)[_0xf3d7('0x25')](handleEntityNotFound(_0xca8122,null))[_0xf3d7('0x25')](function(_0x45f886){if(_0x45f886){var _0x3aaf75=_0x45f886[_0xf3d7('0x27')]({'plain':!![]});_0x3aaf75=qs[_0xf3d7('0x56')](_0x3aaf75,['id',_0xf3d7('0x57'),_0xf3d7('0x58')]);_0x1c70dc['body']=_[_0xf3d7('0x56')](_0x1c70dc[_0xf3d7('0x4c')],['id',_0xf3d7('0x57'),_0xf3d7('0x58')]);return db[_0xf3d7('0x2f')][_0xf3d7('0x4b')](_[_0xf3d7('0x42')](_0x3aaf75,_0x1c70dc[_0xf3d7('0x4c')]),{'include':_0x1c70dc[_0xf3d7('0x34')][_0xf3d7('0x49')]?[{'all':!![]}]:undefined})[_0xf3d7('0x25')](function(_0x4312f9){var _0x58af9b=_0x1c70dc[_0xf3d7('0x4f')][_0xf3d7('0x27')]({'plain':!![]});if(!_0x58af9b)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x58af9b[_0xf3d7('0x4e')]===_0xf3d7('0x4f')){var _0x3aaea1=_0x4312f9['get']({'plain':!![]});var _0x582b97=_0xf3d7('0x28');return db[_0xf3d7('0x50')]['find']({'where':{'name':_0x582b97,'userProfileId':_0x58af9b[_0xf3d7('0x51')]},'raw':!![]})[_0xf3d7('0x25')](function(_0x4843eb){if(_0x4843eb&&_0x4843eb[_0xf3d7('0x59')]===0x0){return db[_0xf3d7('0x52')]['create']({'name':_0x3aaea1[_0xf3d7('0x2b')],'resourceId':_0x3aaea1['id'],'type':_0x4843eb[_0xf3d7('0x2b')],'sectionId':_0x4843eb['id']},{})[_0xf3d7('0x25')](function(){return _0x4312f9;});}else{return _0x4312f9;}})[_0xf3d7('0x46')](function(_0x4a0e29){logger[_0xf3d7('0x29')](_0xf3d7('0x53'),_0x4a0e29);throw _0x4a0e29;});}return _0x4312f9;});}})[_0xf3d7('0x25')](respondWithResult(_0xca8122,0xc9))[_0xf3d7('0x46')](handleError(_0xca8122,null));};exports['update']=function(_0x4d87a8,_0x2bed8f){if(_0x4d87a8[_0xf3d7('0x4c')]['id']){delete _0x4d87a8[_0xf3d7('0x4c')]['id'];}return db[_0xf3d7('0x2f')][_0xf3d7('0x4a')]({'where':{'id':_0x4d87a8[_0xf3d7('0x48')]['id']}})[_0xf3d7('0x25')](handleEntityNotFound(_0x2bed8f,null))[_0xf3d7('0x25')](saveUpdates(_0x4d87a8[_0xf3d7('0x4c')],null))[_0xf3d7('0x25')](respondWithResult(_0x2bed8f,null))[_0xf3d7('0x46')](handleError(_0x2bed8f,null));};exports[_0xf3d7('0x26')]=function(_0x47c03e,_0x1e38e3){return db[_0xf3d7('0x2f')]['find']({'where':{'id':_0x47c03e[_0xf3d7('0x48')]['id']}})[_0xf3d7('0x25')](handleEntityNotFound(_0x1e38e3,null))[_0xf3d7('0x25')](removeEntity(_0x1e38e3,null))[_0xf3d7('0x46')](handleError(_0x1e38e3,null));};exports[_0xf3d7('0x5a')]=function(_0x4e462,_0x2a8b64,_0x98b280){var _0x412703={'raw':!![],'where':{}};var _0x232c7c={};var _0x39bdba={'count':0x0,'rows':[]};return db['Campaign'][_0xf3d7('0x5b')]({'where':{'id':_0x4e462['params']['id']}})['then'](handleEntityNotFound(_0x2a8b64,null))[_0xf3d7('0x25')](function(_0x49917b){if(_0x49917b){_0x232c7c[_0xf3d7('0x37')]=_[_0xf3d7('0x35')](db[_0xf3d7('0x5c')][_0xf3d7('0x30')]);_0x232c7c[_0xf3d7('0x34')]=_[_0xf3d7('0x35')](_0x4e462['query']);_0x232c7c[_0xf3d7('0x36')]=_['intersection'](_0x232c7c[_0xf3d7('0x37')],_0x232c7c[_0xf3d7('0x34')]);_0x412703[_0xf3d7('0x38')]=_['intersection'](_0x232c7c[_0xf3d7('0x37')],qs[_0xf3d7('0x3a')](_0x4e462[_0xf3d7('0x34')][_0xf3d7('0x3a')]));_0x412703[_0xf3d7('0x38')]=_0x412703[_0xf3d7('0x38')][_0xf3d7('0x3b')]?_0x412703[_0xf3d7('0x38')]:_0x232c7c[_0xf3d7('0x37')];if(!_0x4e462[_0xf3d7('0x34')][_0xf3d7('0x3c')](_0xf3d7('0x3d'))){_0x412703[_0xf3d7('0x1d')]=qs[_0xf3d7('0x1d')](_0x4e462[_0xf3d7('0x34')][_0xf3d7('0x1d')]);_0x412703[_0xf3d7('0x1b')]=qs[_0xf3d7('0x1b')](_0x4e462[_0xf3d7('0x34')][_0xf3d7('0x1b')]);}_0x412703[_0xf3d7('0x5d')]=qs['sort'](_0x4e462[_0xf3d7('0x34')][_0xf3d7('0x3e')]);_0x412703[_0xf3d7('0x3f')]=qs[_0xf3d7('0x36')](_[_0xf3d7('0x40')](_0x4e462[_0xf3d7('0x34')],_0x232c7c[_0xf3d7('0x36')]));_0x412703[_0xf3d7('0x3f')]['CampaignId']=_0x49917b['id'];if(_0x4e462[_0xf3d7('0x34')]['filter']){_0x412703[_0xf3d7('0x3f')]=_['merge'](_0x412703[_0xf3d7('0x3f')],{'$or':_[_0xf3d7('0x2e')](_0x412703[_0xf3d7('0x38')],function(_0x275f94){var _0x383ded={};_0x383ded[_0x275f94]={'$like':'%'+_0x4e462[_0xf3d7('0x34')][_0xf3d7('0x41')]+'%'};return _0x383ded;})});}_0x412703=_[_0xf3d7('0x42')]({},_0x412703,_0x4e462[_0xf3d7('0x55')]);return db[_0xf3d7('0x5c')][_0xf3d7('0x1e')]({'where':_0x412703['where']})[_0xf3d7('0x25')](function(_0x3798d8){_0x39bdba[_0xf3d7('0x1e')]=_0x3798d8;if(_0x4e462[_0xf3d7('0x34')][_0xf3d7('0x49')]){_0x412703[_0xf3d7('0x44')]=[{'all':!![]}];}return db['CmHopper'][_0xf3d7('0x45')](_0x412703);})['then'](function(_0x56181d){_0x39bdba[_0xf3d7('0x5e')]=_0x56181d;return _0x39bdba;});}})[_0xf3d7('0x25')](respondWithFilteredResult(_0x2a8b64,_0x412703))['catch'](handleError(_0x2a8b64,null));};exports['getHopperHistories']=function(_0x33271e,_0x354135,_0x3295da){var _0x578ac5={'raw':!![],'where':{}};var _0x3c95a8={};var _0x4824fc={'count':0x0,'rows':[]};return db[_0xf3d7('0x2f')][_0xf3d7('0x5b')]({'where':{'id':_0x33271e[_0xf3d7('0x48')]['id']}})[_0xf3d7('0x25')](handleEntityNotFound(_0x354135,null))[_0xf3d7('0x25')](function(_0x556663){if(_0x556663){_0x3c95a8[_0xf3d7('0x37')]=_[_0xf3d7('0x35')](db[_0xf3d7('0x5f')]['rawAttributes']);_0x3c95a8['query']=_['keys'](_0x33271e[_0xf3d7('0x34')]);_0x3c95a8['filters']=_[_0xf3d7('0x39')](_0x3c95a8['model'],_0x3c95a8[_0xf3d7('0x34')]);_0x578ac5[_0xf3d7('0x38')]=_[_0xf3d7('0x39')](_0x3c95a8[_0xf3d7('0x37')],qs[_0xf3d7('0x3a')](_0x33271e[_0xf3d7('0x34')]['fields']));_0x578ac5[_0xf3d7('0x38')]=_0x578ac5['attributes'][_0xf3d7('0x3b')]?_0x578ac5[_0xf3d7('0x38')]:_0x3c95a8[_0xf3d7('0x37')];if(!_0x33271e[_0xf3d7('0x34')][_0xf3d7('0x3c')]('nolimit')){_0x578ac5[_0xf3d7('0x1d')]=qs[_0xf3d7('0x1d')](_0x33271e[_0xf3d7('0x34')][_0xf3d7('0x1d')]);_0x578ac5['offset']=qs[_0xf3d7('0x1b')](_0x33271e[_0xf3d7('0x34')][_0xf3d7('0x1b')]);}_0x578ac5['order']=qs[_0xf3d7('0x3e')](_0x33271e['query'][_0xf3d7('0x3e')]);_0x578ac5[_0xf3d7('0x3f')]=qs['filters'](_[_0xf3d7('0x40')](_0x33271e[_0xf3d7('0x34')],_0x3c95a8[_0xf3d7('0x36')]));_0x578ac5[_0xf3d7('0x3f')]['CampaignId']=_0x556663['id'];if(_0x33271e['query']['filter']){_0x578ac5[_0xf3d7('0x3f')]=_[_0xf3d7('0x42')](_0x578ac5[_0xf3d7('0x3f')],{'$or':_[_0xf3d7('0x2e')](_0x578ac5[_0xf3d7('0x38')],function(_0x3338ff){var _0x2a809f={};_0x2a809f[_0x3338ff]={'$like':'%'+_0x33271e[_0xf3d7('0x34')]['filter']+'%'};return _0x2a809f;})});}_0x578ac5=_[_0xf3d7('0x42')]({},_0x578ac5,_0x33271e[_0xf3d7('0x55')]);return db[_0xf3d7('0x5f')]['count']({'where':_0x578ac5['where']})['then'](function(_0x4b222f){_0x4824fc['count']=_0x4b222f;if(_0x33271e[_0xf3d7('0x34')][_0xf3d7('0x49')]){_0x578ac5[_0xf3d7('0x44')]=[{'all':!![]}];}return db[_0xf3d7('0x5f')]['findAll'](_0x578ac5);})[_0xf3d7('0x25')](function(_0x1e753b){_0x4824fc[_0xf3d7('0x5e')]=_0x1e753b;return _0x4824fc;});}})[_0xf3d7('0x25')](respondWithFilteredResult(_0x354135,_0x578ac5))['catch'](handleError(_0x354135,null));};exports[_0xf3d7('0x60')]=function(_0x570a09,_0x503aee,_0x182ac6){var _0x45b8d9={'raw':!![],'where':{}};var _0x177cfb={};var _0xf4fbb2={'count':0x0,'rows':[]};return db['Campaign'][_0xf3d7('0x5b')]({'where':{'id':_0x570a09[_0xf3d7('0x48')]['id']}})[_0xf3d7('0x25')](handleEntityNotFound(_0x503aee,null))[_0xf3d7('0x25')](function(_0x21ae1e){if(_0x21ae1e){_0x177cfb[_0xf3d7('0x37')]=_['keys'](db[_0xf3d7('0x61')][_0xf3d7('0x30')]);_0x177cfb[_0xf3d7('0x34')]=_[_0xf3d7('0x35')](_0x570a09[_0xf3d7('0x34')]);_0x177cfb['filters']=_[_0xf3d7('0x39')](_0x177cfb[_0xf3d7('0x37')],_0x177cfb['query']);_0x45b8d9['attributes']=_[_0xf3d7('0x39')](_0x177cfb[_0xf3d7('0x37')],qs['fields'](_0x570a09['query'][_0xf3d7('0x3a')]));_0x45b8d9['attributes']=_0x45b8d9[_0xf3d7('0x38')][_0xf3d7('0x3b')]?_0x45b8d9[_0xf3d7('0x38')]:_0x177cfb['model'];if(!_0x570a09[_0xf3d7('0x34')][_0xf3d7('0x3c')](_0xf3d7('0x3d'))){_0x45b8d9[_0xf3d7('0x1d')]=qs['limit'](_0x570a09['query'][_0xf3d7('0x1d')]);_0x45b8d9[_0xf3d7('0x1b')]=qs[_0xf3d7('0x1b')](_0x570a09[_0xf3d7('0x34')][_0xf3d7('0x1b')]);}_0x45b8d9[_0xf3d7('0x5d')]=qs[_0xf3d7('0x3e')](_0x570a09[_0xf3d7('0x34')][_0xf3d7('0x3e')]);_0x45b8d9[_0xf3d7('0x3f')]=qs[_0xf3d7('0x36')](_[_0xf3d7('0x40')](_0x570a09['query'],_0x177cfb[_0xf3d7('0x36')]));_0x45b8d9[_0xf3d7('0x3f')]['CampaignId']=_0x21ae1e['id'];if(_0x570a09[_0xf3d7('0x34')][_0xf3d7('0x41')]){_0x45b8d9[_0xf3d7('0x3f')]=_[_0xf3d7('0x42')](_0x45b8d9[_0xf3d7('0x3f')],{'$or':_['map'](_0x45b8d9[_0xf3d7('0x38')],function(_0x389480){var _0x3500c8={};_0x3500c8[_0x389480]={'$like':'%'+_0x570a09[_0xf3d7('0x34')][_0xf3d7('0x41')]+'%'};return _0x3500c8;})});}_0x45b8d9=_['merge']({},_0x45b8d9,_0x570a09[_0xf3d7('0x55')]);return db['CmHopperFinal'][_0xf3d7('0x1e')]({'where':_0x45b8d9[_0xf3d7('0x3f')]})['then'](function(_0x52b149){_0xf4fbb2[_0xf3d7('0x1e')]=_0x52b149;if(_0x570a09[_0xf3d7('0x34')][_0xf3d7('0x49')]){_0x45b8d9[_0xf3d7('0x44')]=[{'all':!![]}];}return db[_0xf3d7('0x61')][_0xf3d7('0x45')](_0x45b8d9);})[_0xf3d7('0x25')](function(_0x46d9e6){_0xf4fbb2[_0xf3d7('0x5e')]=_0x46d9e6;return _0xf4fbb2;});}})[_0xf3d7('0x25')](respondWithFilteredResult(_0x503aee,_0x45b8d9))[_0xf3d7('0x46')](handleError(_0x503aee,null));};exports[_0xf3d7('0x62')]=function(_0x4779af,_0x1272ab,_0xe121cb){var _0x39967f={'raw':!![],'where':{}};var _0xc04f01={};var _0x46d459={'count':0x0,'rows':[]};return db[_0xf3d7('0x2f')]['findOne']({'where':{'id':_0x4779af[_0xf3d7('0x48')]['id']}})[_0xf3d7('0x25')](handleEntityNotFound(_0x1272ab,null))[_0xf3d7('0x25')](function(_0x43f206){if(_0x43f206){_0xc04f01[_0xf3d7('0x37')]=_[_0xf3d7('0x35')](db[_0xf3d7('0x63')]['rawAttributes']);_0xc04f01['query']=_[_0xf3d7('0x35')](_0x4779af[_0xf3d7('0x34')]);_0xc04f01[_0xf3d7('0x36')]=_['intersection'](_0xc04f01[_0xf3d7('0x37')],_0xc04f01[_0xf3d7('0x34')]);_0x39967f[_0xf3d7('0x38')]=_['intersection'](_0xc04f01['model'],qs[_0xf3d7('0x3a')](_0x4779af['query'][_0xf3d7('0x3a')]));_0x39967f[_0xf3d7('0x38')]=_0x39967f['attributes']['length']?_0x39967f[_0xf3d7('0x38')]:_0xc04f01[_0xf3d7('0x37')];if(!_0x4779af[_0xf3d7('0x34')][_0xf3d7('0x3c')]('nolimit')){_0x39967f[_0xf3d7('0x1d')]=qs['limit'](_0x4779af[_0xf3d7('0x34')][_0xf3d7('0x1d')]);_0x39967f[_0xf3d7('0x1b')]=qs[_0xf3d7('0x1b')](_0x4779af[_0xf3d7('0x34')][_0xf3d7('0x1b')]);}_0x39967f[_0xf3d7('0x5d')]=qs[_0xf3d7('0x3e')](_0x4779af[_0xf3d7('0x34')]['sort']);_0x39967f[_0xf3d7('0x3f')]=qs[_0xf3d7('0x36')](_[_0xf3d7('0x40')](_0x4779af[_0xf3d7('0x34')],_0xc04f01[_0xf3d7('0x36')]));_0x39967f[_0xf3d7('0x3f')][_0xf3d7('0x64')]=_0x43f206['id'];if(_0x4779af[_0xf3d7('0x34')]['filter']){_0x39967f['where']=_['merge'](_0x39967f[_0xf3d7('0x3f')],{'$or':_[_0xf3d7('0x2e')](_0x39967f[_0xf3d7('0x38')],function(_0x4c90db){var _0x264668={};_0x264668[_0x4c90db]={'$like':'%'+_0x4779af['query'][_0xf3d7('0x41')]+'%'};return _0x264668;})});}_0x39967f=_[_0xf3d7('0x42')]({},_0x39967f,_0x4779af[_0xf3d7('0x55')]);return db[_0xf3d7('0x63')]['count']({'where':_0x39967f['where']})[_0xf3d7('0x25')](function(_0x2e9916){_0x46d459[_0xf3d7('0x1e')]=_0x2e9916;if(_0x4779af[_0xf3d7('0x34')]['includeAll']){_0x39967f[_0xf3d7('0x44')]=[{'all':!![]}];}return db[_0xf3d7('0x63')][_0xf3d7('0x45')](_0x39967f);})[_0xf3d7('0x25')](function(_0x390818){_0x46d459[_0xf3d7('0x5e')]=_0x390818;return _0x46d459;});}})['then'](respondWithFilteredResult(_0x1272ab,_0x39967f))[_0xf3d7('0x46')](handleError(_0x1272ab,null));};exports['getLists']=function(_0x5708ed,_0x140e90,_0x3700a){var _0x1243bc={};var _0x1f88a5={};var _0x2e097c;var _0x4b3da5;return db[_0xf3d7('0x2f')][_0xf3d7('0x5b')]({'where':{'id':_0x5708ed[_0xf3d7('0x48')]['id']}})[_0xf3d7('0x25')](handleEntityNotFound(_0x140e90,null))[_0xf3d7('0x25')](function(_0xbc992b){if(_0xbc992b){_0x2e097c=_0xbc992b;_0x1f88a5[_0xf3d7('0x37')]=_['keys'](db[_0xf3d7('0x65')][_0xf3d7('0x30')]);_0x1f88a5['query']=_[_0xf3d7('0x35')](_0x5708ed[_0xf3d7('0x34')]);_0x1f88a5['filters']=_[_0xf3d7('0x39')](_0x1f88a5[_0xf3d7('0x37')],_0x1f88a5['query']);_0x1243bc[_0xf3d7('0x38')]=_[_0xf3d7('0x39')](_0x1f88a5[_0xf3d7('0x37')],qs['fields'](_0x5708ed[_0xf3d7('0x34')][_0xf3d7('0x3a')]));_0x1243bc[_0xf3d7('0x38')]=_0x1243bc[_0xf3d7('0x38')][_0xf3d7('0x3b')]?_0x1243bc['attributes']:_0x1f88a5[_0xf3d7('0x37')];_0x1243bc[_0xf3d7('0x5d')]=qs[_0xf3d7('0x3e')](_0x5708ed[_0xf3d7('0x34')]['sort']);_0x1243bc[_0xf3d7('0x3f')]=qs[_0xf3d7('0x36')](_[_0xf3d7('0x40')](_0x5708ed[_0xf3d7('0x34')],_0x1f88a5['filters']));if(_0x5708ed[_0xf3d7('0x34')][_0xf3d7('0x41')]){_0x1243bc[_0xf3d7('0x3f')]=_['merge'](_0x1243bc[_0xf3d7('0x3f')],{'$or':_[_0xf3d7('0x2e')](_0x1243bc[_0xf3d7('0x38')],function(_0x1a0286){var _0x3111a6={};_0x3111a6[_0x1a0286]={'$like':'%'+_0x5708ed[_0xf3d7('0x34')]['filter']+'%'};return _0x3111a6;})});}_0x1243bc=_[_0xf3d7('0x42')]({},_0x1243bc,_0x5708ed[_0xf3d7('0x55')]);return _0x2e097c[_0xf3d7('0x66')](_0x1243bc);}})['then'](function(_0x4ddb7a){if(_0x4ddb7a){_0x4b3da5=_0x4ddb7a[_0xf3d7('0x3b')];if(!_0x5708ed[_0xf3d7('0x34')][_0xf3d7('0x3c')](_0xf3d7('0x3d'))){_0x1243bc['limit']=qs[_0xf3d7('0x1d')](_0x5708ed[_0xf3d7('0x34')]['limit']);_0x1243bc['offset']=qs[_0xf3d7('0x1b')](_0x5708ed[_0xf3d7('0x34')][_0xf3d7('0x1b')]);}return _0x2e097c[_0xf3d7('0x66')](_0x1243bc);}})[_0xf3d7('0x25')](function(_0x226396){if(_0x226396){return _0x226396?{'count':_0x4b3da5,'rows':_0x226396}:null;}})[_0xf3d7('0x25')](respondWithResult(_0x140e90,null))[_0xf3d7('0x46')](handleError(_0x140e90,null));};exports[_0xf3d7('0x67')]=function(_0x1e2a26,_0x2395b6,_0x43702c){var _0x3f4907,_0x4bd83a;var _0x2f172f=[];var _0x5c2ea7=moment()[_0xf3d7('0x68')]('YYYY-MM-DD\x20HH:mm:ss');return db[_0xf3d7('0x2f')][_0xf3d7('0x4a')]({'where':{'id':_0x1e2a26[_0xf3d7('0x48')]['id']}})[_0xf3d7('0x25')](handleEntityNotFound(_0x2395b6,null))[_0xf3d7('0x25')](function(_0xc72ab8){if(_0xc72ab8){_0x4bd83a=_0xc72ab8;return _0xc72ab8['addLists'](_0x1e2a26[_0xf3d7('0x4c')][_0xf3d7('0x69')],_[_0xf3d7('0x56')](_0x1e2a26[_0xf3d7('0x4c')],['ids','id'])||{});}return null;})[_0xf3d7('0x6a')](function(_0x214ee9){var _0x30b50a;var _0x4719cf;_0x3f4907=_0x214ee9||[];var _0x30a5af=[];if(_0x214ee9){for(var _0x240fcb=0x0;_0x240fcb<_0x214ee9[_0xf3d7('0x3b')];_0x240fcb+=0x1){var _0x2fd275=_0x214ee9[_0x240fcb]['get']({'plain':!![]});_0x4bd83a['dialCheckDuplicateType']=_0x1e2a26[_0xf3d7('0x4c')]['dialCheckDuplicateType']?_0x1e2a26['body'][_0xf3d7('0x6b')]:_0x4bd83a[_0xf3d7('0x6b')];switch(_0x4bd83a[_0xf3d7('0x6b')]){case'always':_0x30b50a=squel[_0xf3d7('0x6c')]()[_0xf3d7('0x6d')](_0xf3d7('0x6e'))[_0xf3d7('0x6f')]([_0xf3d7('0x70'),_0xf3d7('0x71'),_0xf3d7('0x72'),_0xf3d7('0x73'),'CampaignId','createdAt',_0xf3d7('0x58')],squel['select']()[_0xf3d7('0x74')]('phone','phone')[_0xf3d7('0x74')]('NOW()',_0xf3d7('0x71'))[_0xf3d7('0x74')]('id','ContactId')[_0xf3d7('0x74')](_0x2fd275[_0xf3d7('0x75')]['toString'](),_0xf3d7('0x73'))[_0xf3d7('0x74')](_0x1e2a26[_0xf3d7('0x48')]['id'][_0xf3d7('0x76')](),_0xf3d7('0x64'))[_0xf3d7('0x74')]('\x27'+_0x5c2ea7+'\x27','createdAt')[_0xf3d7('0x74')]('\x27'+_0x5c2ea7+'\x27',_0xf3d7('0x58'))[_0xf3d7('0x77')](_0xf3d7('0x78'))[_0xf3d7('0x3f')]('deletedAt\x20IS\x20NULL')['where']('ListId\x20=\x20?',_0x2fd275['CmListId']['toString']())[_0xf3d7('0x3f')](_0xf3d7('0x79'))['where'](_0xf3d7('0x7a'),squel[_0xf3d7('0x7b')]()['field']('COALESCE(calleridnum,\x27\x27)')[_0xf3d7('0x77')](_0xf3d7('0x7c'))[_0xf3d7('0x3f')]('CampaignId\x20=\x20?',_0x1e2a26[_0xf3d7('0x48')]['id']['toString']()))[_0xf3d7('0x3f')](_0xf3d7('0x7a'),squel['select']()[_0xf3d7('0x74')](_0xf3d7('0x7d'))[_0xf3d7('0x77')](_0xf3d7('0x6e'))[_0xf3d7('0x3f')](_0xf3d7('0x7e'),_0x1e2a26['params']['id'][_0xf3d7('0x76')]())))[_0xf3d7('0x76')]();break;case _0xf3d7('0x7f'):_0x30b50a=squel[_0xf3d7('0x6c')]()[_0xf3d7('0x6d')](_0xf3d7('0x6e'))[_0xf3d7('0x6f')]([_0xf3d7('0x70'),'scheduledAt',_0xf3d7('0x72'),_0xf3d7('0x73'),_0xf3d7('0x64'),'createdAt',_0xf3d7('0x58')],squel[_0xf3d7('0x7b')]()[_0xf3d7('0x74')](_0xf3d7('0x70'),_0xf3d7('0x70'))['field'](_0xf3d7('0x80'),_0xf3d7('0x71'))[_0xf3d7('0x74')]('id','ContactId')[_0xf3d7('0x74')](_0x2fd275[_0xf3d7('0x75')][_0xf3d7('0x76')](),_0xf3d7('0x73'))['field'](_0x1e2a26[_0xf3d7('0x48')]['id']['toString'](),'CampaignId')['field']('\x27'+_0x5c2ea7+'\x27',_0xf3d7('0x57'))['field']('\x27'+_0x5c2ea7+'\x27',_0xf3d7('0x58'))[_0xf3d7('0x77')]('cm_contacts')[_0xf3d7('0x3f')]('deletedAt\x20IS\x20NULL')[_0xf3d7('0x3f')](_0xf3d7('0x81'),_0x2fd275['CmListId'][_0xf3d7('0x76')]())[_0xf3d7('0x3f')](_0xf3d7('0x79'))[_0xf3d7('0x3f')]('phone\x20NOT\x20IN\x20(?)',squel[_0xf3d7('0x7b')]()['field'](_0xf3d7('0x7d'))[_0xf3d7('0x77')]('cm_hopper')['where'](_0xf3d7('0x7e'),_0x1e2a26[_0xf3d7('0x48')]['id'][_0xf3d7('0x76')]())))[_0xf3d7('0x76')]();break;default:_0x30b50a=squel['insert']()[_0xf3d7('0x6d')](_0xf3d7('0x6e'))['fromQuery'](['phone',_0xf3d7('0x71'),_0xf3d7('0x72'),_0xf3d7('0x73'),'CampaignId',_0xf3d7('0x57'),_0xf3d7('0x58')],squel[_0xf3d7('0x7b')]()[_0xf3d7('0x74')](_0xf3d7('0x70'),_0xf3d7('0x70'))[_0xf3d7('0x74')](_0xf3d7('0x80'),_0xf3d7('0x71'))[_0xf3d7('0x74')]('id','ContactId')['field'](_0x2fd275[_0xf3d7('0x75')]['toString'](),_0xf3d7('0x73'))[_0xf3d7('0x74')](_0x1e2a26[_0xf3d7('0x48')]['id'][_0xf3d7('0x76')](),_0xf3d7('0x64'))[_0xf3d7('0x74')]('\x27'+_0x5c2ea7+'\x27',_0xf3d7('0x57'))['field']('\x27'+_0x5c2ea7+'\x27',_0xf3d7('0x58'))[_0xf3d7('0x77')](_0xf3d7('0x78'))[_0xf3d7('0x3f')]('deletedAt\x20IS\x20NULL')[_0xf3d7('0x3f')](_0xf3d7('0x81'),_0x2fd275[_0xf3d7('0x75')]['toString']())['where'](_0xf3d7('0x79')))[_0xf3d7('0x76')]();}_0x4719cf=squel[_0xf3d7('0x6c')]()['into'](_0xf3d7('0x82'))['fromQuery']([_0xf3d7('0x83'),_0xf3d7('0x71'),_0xf3d7('0x70'),_0xf3d7('0x84'),_0xf3d7('0x57'),_0xf3d7('0x58')],squel[_0xf3d7('0x7b')]()['field'](_0xf3d7('0x85'),'id')[_0xf3d7('0x74')](_0xf3d7('0x80'),_0xf3d7('0x71'))[_0xf3d7('0x74')](_0xf3d7('0x86'),_0xf3d7('0x70'))['field'](_0xf3d7('0x87'),_0xf3d7('0x84'))['field']('\x27'+_0x5c2ea7+'\x27',_0xf3d7('0x57'))['field']('\x27'+_0x5c2ea7+'\x27',_0xf3d7('0x58'))[_0xf3d7('0x77')](_0xf3d7('0x88'),'ci')[_0xf3d7('0x89')](_0xf3d7('0x6e'),'h',_0xf3d7('0x8a'))[_0xf3d7('0x3f')](_0xf3d7('0x8b'),_0x2fd275['CmListId'][_0xf3d7('0x76')]())['where'](_0xf3d7('0x8c'),_0x1e2a26[_0xf3d7('0x48')]['id'][_0xf3d7('0x76')]())['where'](_0xf3d7('0x8d'),_0x5c2ea7))['toString']();_0x30a5af[_0xf3d7('0x8e')](db[_0xf3d7('0x8f')][_0xf3d7('0x34')](_0x30b50a));_0x2f172f['push'](db['sequelize'][_0xf3d7('0x34')](_0x4719cf));}return BPromise[_0xf3d7('0x90')](_0x30a5af);}})[_0xf3d7('0x25')](function(){return BPromise[_0xf3d7('0x90')](_0x2f172f);})[_0xf3d7('0x25')](function(){return _0x3f4907;})[_0xf3d7('0x25')](respondWithResult(_0x2395b6,null))[_0xf3d7('0x46')](handleError(_0x2395b6,null));};exports[_0xf3d7('0x91')]=function(_0x4f6806,_0x43d7b7,_0x1282bf){return db[_0xf3d7('0x2f')]['find']({'where':{'id':_0x4f6806['params']['id']}})[_0xf3d7('0x25')](handleEntityNotFound(_0x43d7b7,null))[_0xf3d7('0x25')](function(_0x28e6f1){if(_0x28e6f1){return _0x28e6f1[_0xf3d7('0x91')](_0x4f6806[_0xf3d7('0x34')][_0xf3d7('0x69')]);}})[_0xf3d7('0x25')](function(_0x1b1229){if(_0x1b1229){return db['CmHopper'][_0xf3d7('0x26')]({'where':{'ListId':_0x4f6806[_0xf3d7('0x34')]['ids'],'CampaignId':_0x4f6806[_0xf3d7('0x48')]['id']}})[_0xf3d7('0x25')](function(){return _0x1b1229;});}})[_0xf3d7('0x25')](respondWithStatusCode(_0x43d7b7,null))[_0xf3d7('0x46')](handleError(_0x43d7b7,null));};exports[_0xf3d7('0x92')]=function(_0x5169c0,_0x458e92,_0x5e433c){var _0xa54558={};var _0x241e6f={};var _0x53cd29;var _0x1bc4a0;return db[_0xf3d7('0x2f')][_0xf3d7('0x5b')]({'where':{'id':_0x5169c0[_0xf3d7('0x48')]['id']}})[_0xf3d7('0x25')](handleEntityNotFound(_0x458e92,null))[_0xf3d7('0x25')](function(_0x21a5a1){if(_0x21a5a1){_0x53cd29=_0x21a5a1;_0x241e6f[_0xf3d7('0x37')]=_['keys'](db[_0xf3d7('0x65')]['rawAttributes']);_0x241e6f[_0xf3d7('0x34')]=_[_0xf3d7('0x35')](_0x5169c0['query']);_0x241e6f[_0xf3d7('0x36')]=_['intersection'](_0x241e6f[_0xf3d7('0x37')],_0x241e6f[_0xf3d7('0x34')]);_0xa54558[_0xf3d7('0x38')]=_[_0xf3d7('0x39')](_0x241e6f['model'],qs[_0xf3d7('0x3a')](_0x5169c0[_0xf3d7('0x34')][_0xf3d7('0x3a')]));_0xa54558[_0xf3d7('0x38')]=_0xa54558['attributes'][_0xf3d7('0x3b')]?_0xa54558[_0xf3d7('0x38')]:_0x241e6f[_0xf3d7('0x37')];_0xa54558[_0xf3d7('0x5d')]=qs[_0xf3d7('0x3e')](_0x5169c0['query'][_0xf3d7('0x3e')]);_0xa54558[_0xf3d7('0x3f')]=qs['filters'](_[_0xf3d7('0x40')](_0x5169c0[_0xf3d7('0x34')],_0x241e6f[_0xf3d7('0x36')]));if(_0x5169c0['query'][_0xf3d7('0x41')]){_0xa54558[_0xf3d7('0x3f')]=_[_0xf3d7('0x42')](_0xa54558[_0xf3d7('0x3f')],{'$or':_[_0xf3d7('0x2e')](_0xa54558[_0xf3d7('0x38')],function(_0x4674d5){var _0x1ea5de={};_0x1ea5de[_0x4674d5]={'$like':'%'+_0x5169c0[_0xf3d7('0x34')]['filter']+'%'};return _0x1ea5de;})});}_0xa54558=_['merge']({},_0xa54558,_0x5169c0['options']);return _0x53cd29['getBlackLists'](_0xa54558);}})[_0xf3d7('0x25')](function(_0x258a0d){if(_0x258a0d){_0x1bc4a0=_0x258a0d[_0xf3d7('0x3b')];if(!_0x5169c0[_0xf3d7('0x34')][_0xf3d7('0x3c')](_0xf3d7('0x3d'))){_0xa54558[_0xf3d7('0x1d')]=qs[_0xf3d7('0x1d')](_0x5169c0[_0xf3d7('0x34')][_0xf3d7('0x1d')]);_0xa54558[_0xf3d7('0x1b')]=qs['offset'](_0x5169c0[_0xf3d7('0x34')][_0xf3d7('0x1b')]);}return _0x53cd29[_0xf3d7('0x92')](_0xa54558);}})[_0xf3d7('0x25')](function(_0x3fd44b){if(_0x3fd44b){return _0x3fd44b?{'count':_0x1bc4a0,'rows':_0x3fd44b}:null;}})[_0xf3d7('0x25')](respondWithResult(_0x458e92,null))[_0xf3d7('0x46')](handleError(_0x458e92,null));};exports[_0xf3d7('0x93')]=function(_0x698f3d,_0x287ee2,_0x469673){var _0x317159,_0x3cb37f;var _0x4a4bd1=[];var _0x37291e=moment()[_0xf3d7('0x68')](_0xf3d7('0x94'));return db[_0xf3d7('0x2f')][_0xf3d7('0x4a')]({'where':{'id':_0x698f3d[_0xf3d7('0x48')]['id']}})['then'](handleEntityNotFound(_0x287ee2,null))[_0xf3d7('0x25')](function(_0x1fe53a){if(_0x1fe53a){_0x3cb37f=_0x1fe53a;return _0x1fe53a[_0xf3d7('0x93')](_0x698f3d[_0xf3d7('0x4c')]['ids'],_[_0xf3d7('0x56')](_0x698f3d[_0xf3d7('0x4c')],['ids','id'])||{});}return null;})[_0xf3d7('0x6a')](function(_0x1ef048){var _0x2f3caa;var _0x43813e;_0x317159=_0x1ef048||[];var _0x33f9f3=[];if(_0x1ef048){for(var _0x2932e9=0x0;_0x2932e9<_0x1ef048[_0xf3d7('0x3b')];_0x2932e9+=0x1){var _0x2f7e93=_0x1ef048[_0x2932e9][_0xf3d7('0x27')]({'plain':!![]});_0x2f3caa=squel[_0xf3d7('0x6c')]()[_0xf3d7('0x6d')](_0xf3d7('0x95'))['fromQuery'](['phone',_0xf3d7('0x72'),_0xf3d7('0x73'),_0xf3d7('0x64'),_0xf3d7('0x57'),_0xf3d7('0x58')],squel['select']()[_0xf3d7('0x74')](_0xf3d7('0x70'),'phone')[_0xf3d7('0x74')]('id',_0xf3d7('0x72'))[_0xf3d7('0x74')](_0x2f7e93['CmListId']['toString'](),_0xf3d7('0x73'))['field'](_0x698f3d[_0xf3d7('0x48')]['id'][_0xf3d7('0x76')](),_0xf3d7('0x64'))[_0xf3d7('0x74')](_0xf3d7('0x80'),_0xf3d7('0x57'))[_0xf3d7('0x74')](_0xf3d7('0x80'),'updatedAt')['from'](_0xf3d7('0x78'))[_0xf3d7('0x3f')](_0xf3d7('0x96'))[_0xf3d7('0x3f')](_0xf3d7('0x81'),_0x2f7e93['CmListId'][_0xf3d7('0x76')]())['where'](_0xf3d7('0x79')))[_0xf3d7('0x76')]();_0x33f9f3[_0xf3d7('0x8e')](db[_0xf3d7('0x8f')]['query'](_0x2f3caa));}return BPromise[_0xf3d7('0x90')](_0x33f9f3);}})[_0xf3d7('0x25')](function(){return _0x317159;})[_0xf3d7('0x25')](respondWithResult(_0x287ee2,null))['catch'](handleError(_0x287ee2,null));};exports[_0xf3d7('0x97')]=function(_0x2c43f8,_0xd6689e,_0x16bfdd){return db[_0xf3d7('0x2f')]['find']({'where':{'id':_0x2c43f8[_0xf3d7('0x48')]['id']}})[_0xf3d7('0x25')](handleEntityNotFound(_0xd6689e,null))[_0xf3d7('0x25')](function(_0x5a0bf1){if(_0x5a0bf1){return _0x5a0bf1[_0xf3d7('0x97')](_0x2c43f8[_0xf3d7('0x34')][_0xf3d7('0x69')]);}})[_0xf3d7('0x25')](function(_0x3e1015){if(_0x3e1015){return db[_0xf3d7('0x63')][_0xf3d7('0x26')]({'where':{'ListId':_0x2c43f8[_0xf3d7('0x34')][_0xf3d7('0x69')],'CampaignId':_0x2c43f8[_0xf3d7('0x48')]['id']}})['then'](function(){return _0x3e1015;});}})[_0xf3d7('0x25')](respondWithStatusCode(_0xd6689e,null))[_0xf3d7('0x46')](handleError(_0xd6689e,null));}; \ No newline at end of file diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js index c8888c7..678a04b 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(_0x239a99,_0x2eea66){var _0x5e65dc=function(_0x2f16ff){while(--_0x2f16ff){_0x239a99['push'](_0x239a99['shift']());}};_0x5e65dc(++_0x2eea66);}(_0x7a54,0x106));var _0x47a5=function(_0x16da8f,_0x19ed54){_0x16da8f=_0x16da8f-0x0;var _0x31c462=_0x7a54[_0x16da8f];return _0x31c462;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9957=['exports','define','Campaign','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./campaign.attributes'];(function(_0x11005e,_0x20c3d2){var _0x29338f=function(_0x3384e9){while(--_0x3384e9){_0x11005e['push'](_0x11005e['shift']());}};_0x29338f(++_0x20c3d2);}(_0x9957,0x93));var _0x7995=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x9957[_0x618414];return _0x21c19a;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'campaigns','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/campaign/campaign.rpc.js b/server/api/campaign/campaign.rpc.js index 3144074..491f15b 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 _0xe58a=['message','info','result','catch','GetCampaign','findAll','options','raw','where','include','map','attributes','model','stringify','lodash','util','moment','randomstring','../../config/utils','../../config/environment','client','http','request','then','Campaign,\x20%s,\x20%s','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','error'];(function(_0x2c4c14,_0x21e054){var _0x299825=function(_0xc53c77){while(--_0xc53c77){_0x2c4c14['push'](_0x2c4c14['shift']());}};_0x299825(++_0x21e054);}(_0xe58a,0x9f));var _0xae58=function(_0x4ab33d,_0x252def){_0x4ab33d=_0x4ab33d-0x0;var _0x3ef90a=_0xe58a[_0x4ab33d];return _0x3ef90a;};'use strict';var _=require(_0xae58('0x0'));var util=require(_0xae58('0x1'));var moment=require(_0xae58('0x2'));var BPromise=require('bluebird');var rs=require(_0xae58('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xae58('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xae58('0x5'));var jayson=require('jayson/promise');var client=jayson[_0xae58('0x6')][_0xae58('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x2bd284,_0x2003b6,_0x703a03){return new BPromise(function(_0x7cb067,_0x20b26a){return client[_0xae58('0x8')](_0x2bd284,_0x703a03)[_0xae58('0x9')](function(_0x21d6f1){logger['info'](_0xae58('0xa'),_0x2003b6,_0xae58('0xb'));logger[_0xae58('0xc')](_0xae58('0xd'),_0x2003b6,_0xae58('0xb'),JSON['stringify'](_0x21d6f1));if(_0x21d6f1[_0xae58('0xe')]){if(_0x21d6f1[_0xae58('0xe')]['code']===0x1f4){logger[_0xae58('0xe')]('Campaign,\x20%s,\x20%s',_0x2003b6,_0x21d6f1[_0xae58('0xe')][_0xae58('0xf')]);return _0x20b26a(_0x21d6f1[_0xae58('0xe')][_0xae58('0xf')]);}logger['error'](_0xae58('0xa'),_0x2003b6,_0x21d6f1['error']['message']);return _0x7cb067(_0x21d6f1[_0xae58('0xe')][_0xae58('0xf')]);}else{logger[_0xae58('0x10')](_0xae58('0xa'),_0x2003b6,'request\x20sent');_0x7cb067(_0x21d6f1[_0xae58('0x11')][_0xae58('0xf')]);}})[_0xae58('0x12')](function(_0x2b3d7b){logger['error']('Campaign,\x20%s,\x20%s',_0x2003b6,_0x2b3d7b);_0x20b26a(_0x2b3d7b);});});}exports[_0xae58('0x13')]=function(_0x3d9b06){var _0x45a26b=this;return new Promise(function(_0x252488,_0x2e051c){return db['Campaign'][_0xae58('0x14')]({'raw':_0x3d9b06[_0xae58('0x15')]?_0x3d9b06[_0xae58('0x15')][_0xae58('0x16')]===undefined?!![]:![]:!![],'where':_0x3d9b06[_0xae58('0x15')]?_0x3d9b06[_0xae58('0x15')][_0xae58('0x17')]||null:null,'attributes':_0x3d9b06[_0xae58('0x15')]?_0x3d9b06[_0xae58('0x15')]['attributes']||null:null,'limit':_0x3d9b06['options']?_0x3d9b06[_0xae58('0x15')]['limit']||null:null,'include':_0x3d9b06[_0xae58('0x15')]?_0x3d9b06['options'][_0xae58('0x18')]?_[_0xae58('0x19')](_0x3d9b06[_0xae58('0x15')][_0xae58('0x18')],function(_0x41d2f2){return{'model':db[_0x41d2f2['model']],'as':_0x41d2f2['as'],'attributes':_0x41d2f2[_0xae58('0x1a')],'include':_0x41d2f2[_0xae58('0x18')]?_[_0xae58('0x19')](_0x41d2f2[_0xae58('0x18')],function(_0x557b6e){return{'model':db[_0x557b6e[_0xae58('0x1b')]],'as':_0x557b6e['as'],'attributes':_0x557b6e['attributes'],'include':_0x557b6e['include']?_[_0xae58('0x19')](_0x557b6e['include'],function(_0x2c3876){return{'model':db[_0x2c3876['model']],'as':_0x2c3876['as'],'attributes':_0x2c3876[_0xae58('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xae58('0x9')](function(_0x4474e8){logger['info']('GetCampaign',_0x3d9b06);logger['debug']('GetCampaign',_0x3d9b06,JSON[_0xae58('0x1c')](_0x4474e8));_0x252488(_0x4474e8);})['catch'](function(_0x551755){logger[_0xae58('0xe')](_0xae58('0x13'),_0x551755[_0xae58('0xf')],_0x3d9b06);_0x2e051c(_0x45a26b[_0xae58('0xe')](0x1f4,_0x551755[_0xae58('0xf')]));});});}; \ No newline at end of file +var _0xde64=['randomstring','ioredis','../../config/utils','../../config/logger','jayson/promise','client','request','then','info','Campaign,\x20%s,\x20%s','request\x20sent','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','GetCampaign','Campaign','findAll','options','raw','where','limit','map','include','model','attributes','debug','lodash','util','moment','bluebird'];(function(_0x3d044f,_0xcbedba){var _0x23a76a=function(_0x4505d8){while(--_0x4505d8){_0x3d044f['push'](_0x3d044f['shift']());}};_0x23a76a(++_0xcbedba);}(_0xde64,0x17c));var _0x4de6=function(_0x2ddc82,_0x508091){_0x2ddc82=_0x2ddc82-0x0;var _0x18b223=_0xde64[_0x2ddc82];return _0x18b223;};'use strict';var _=require(_0x4de6('0x0'));var util=require(_0x4de6('0x1'));var moment=require(_0x4de6('0x2'));var BPromise=require(_0x4de6('0x3'));var rs=require(_0x4de6('0x4'));var fs=require('fs');var Redis=require(_0x4de6('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x4de6('0x6'));var logger=require(_0x4de6('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x4de6('0x8'));var client=jayson[_0x4de6('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x568496,_0x24edef,_0x35ae72){return new BPromise(function(_0x475fb9,_0x248e39){return client[_0x4de6('0xa')](_0x568496,_0x35ae72)[_0x4de6('0xb')](function(_0x48a974){logger[_0x4de6('0xc')](_0x4de6('0xd'),_0x24edef,_0x4de6('0xe'));logger['debug'](_0x4de6('0xf'),_0x24edef,_0x4de6('0xe'),JSON[_0x4de6('0x10')](_0x48a974));if(_0x48a974[_0x4de6('0x11')]){if(_0x48a974[_0x4de6('0x11')]['code']===0x1f4){logger[_0x4de6('0x11')](_0x4de6('0xd'),_0x24edef,_0x48a974[_0x4de6('0x11')]['message']);return _0x248e39(_0x48a974[_0x4de6('0x11')][_0x4de6('0x12')]);}logger[_0x4de6('0x11')](_0x4de6('0xd'),_0x24edef,_0x48a974['error'][_0x4de6('0x12')]);return _0x475fb9(_0x48a974[_0x4de6('0x11')][_0x4de6('0x12')]);}else{logger['info'](_0x4de6('0xd'),_0x24edef,'request\x20sent');_0x475fb9(_0x48a974['result'][_0x4de6('0x12')]);}})[_0x4de6('0x13')](function(_0x6dbcf3){logger[_0x4de6('0x11')](_0x4de6('0xd'),_0x24edef,_0x6dbcf3);_0x248e39(_0x6dbcf3);});});}exports[_0x4de6('0x14')]=function(_0x324202){var _0x5aacb4=this;return new Promise(function(_0x420f7c,_0xea1610){return db[_0x4de6('0x15')][_0x4de6('0x16')]({'raw':_0x324202[_0x4de6('0x17')]?_0x324202[_0x4de6('0x17')][_0x4de6('0x18')]===undefined?!![]:![]:!![],'where':_0x324202[_0x4de6('0x17')]?_0x324202[_0x4de6('0x17')][_0x4de6('0x19')]||null:null,'attributes':_0x324202['options']?_0x324202[_0x4de6('0x17')]['attributes']||null:null,'limit':_0x324202[_0x4de6('0x17')]?_0x324202[_0x4de6('0x17')][_0x4de6('0x1a')]||null:null,'include':_0x324202['options']?_0x324202[_0x4de6('0x17')]['include']?_[_0x4de6('0x1b')](_0x324202[_0x4de6('0x17')][_0x4de6('0x1c')],function(_0x5ddbab){return{'model':db[_0x5ddbab[_0x4de6('0x1d')]],'as':_0x5ddbab['as'],'attributes':_0x5ddbab[_0x4de6('0x1e')],'include':_0x5ddbab[_0x4de6('0x1c')]?_[_0x4de6('0x1b')](_0x5ddbab[_0x4de6('0x1c')],function(_0x25a76b){return{'model':db[_0x25a76b[_0x4de6('0x1d')]],'as':_0x25a76b['as'],'attributes':_0x25a76b['attributes'],'include':_0x25a76b[_0x4de6('0x1c')]?_[_0x4de6('0x1b')](_0x25a76b[_0x4de6('0x1c')],function(_0x327215){return{'model':db[_0x327215[_0x4de6('0x1d')]],'as':_0x327215['as'],'attributes':_0x327215[_0x4de6('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x4de6('0xb')](function(_0x7bc61e){logger[_0x4de6('0xc')]('GetCampaign',_0x324202);logger[_0x4de6('0x1f')](_0x4de6('0x14'),_0x324202,JSON[_0x4de6('0x10')](_0x7bc61e));_0x420f7c(_0x7bc61e);})[_0x4de6('0x13')](function(_0x24a0a7){logger['error'](_0x4de6('0x14'),_0x24a0a7['message'],_0x324202);_0xea1610(_0x5aacb4[_0x4de6('0x11')](0x1f4,_0x24a0a7[_0x4de6('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js index 8afe6f9..4e50a2d 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 _0x6b7b=['getHopperFinals','/:id/lists','getLists','/:id/blacklists','getBlackLists','post','create','/:id/clone','clone','addLists','addBlackLists','put','update','delete','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./campaign.controller','get','isAuthenticated','index','/:id','show','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals'];(function(_0x4a53d,_0x58a95e){var _0x27410e=function(_0x38fc90){while(--_0x38fc90){_0x4a53d['push'](_0x4a53d['shift']());}};_0x27410e(++_0x58a95e);}(_0x6b7b,0x93));var _0xb6b7=function(_0x36d04f,_0x180c6e){_0x36d04f=_0x36d04f-0x0;var _0x1e6b16=_0x6b7b[_0x36d04f];return _0x1e6b16;};'use strict';var multer=require('multer');var util=require(_0xb6b7('0x0'));var path=require(_0xb6b7('0x1'));var timeout=require(_0xb6b7('0x2'));var express=require(_0xb6b7('0x3'));var router=express[_0xb6b7('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xb6b7('0x5'));var interaction=require(_0xb6b7('0x6'));var config=require(_0xb6b7('0x7'));var controller=require(_0xb6b7('0x8'));router[_0xb6b7('0x9')]('/',auth[_0xb6b7('0xa')](),controller[_0xb6b7('0xb')]);router[_0xb6b7('0x9')](_0xb6b7('0xc'),auth[_0xb6b7('0xa')](),controller[_0xb6b7('0xd')]);router[_0xb6b7('0x9')]('/:id/hoppers',auth[_0xb6b7('0xa')](),controller[_0xb6b7('0xe')]);router['get'](_0xb6b7('0xf'),auth[_0xb6b7('0xa')](),controller[_0xb6b7('0x10')]);router[_0xb6b7('0x9')](_0xb6b7('0x11'),auth[_0xb6b7('0xa')](),controller[_0xb6b7('0x12')]);router[_0xb6b7('0x9')]('/:id/hopper_black',auth[_0xb6b7('0xa')](),controller['getHopperBlacks']);router[_0xb6b7('0x9')](_0xb6b7('0x13'),auth[_0xb6b7('0xa')](),controller[_0xb6b7('0x14')]);router[_0xb6b7('0x9')](_0xb6b7('0x15'),auth[_0xb6b7('0xa')](),controller[_0xb6b7('0x16')]);router[_0xb6b7('0x17')]('/',auth[_0xb6b7('0xa')](),controller[_0xb6b7('0x18')]);router[_0xb6b7('0x17')](_0xb6b7('0x19'),auth[_0xb6b7('0xa')](),controller[_0xb6b7('0x1a')]);router[_0xb6b7('0x17')](_0xb6b7('0x13'),auth[_0xb6b7('0xa')](),controller[_0xb6b7('0x1b')]);router[_0xb6b7('0x17')](_0xb6b7('0x15'),auth[_0xb6b7('0xa')](),controller[_0xb6b7('0x1c')]);router[_0xb6b7('0x1d')](_0xb6b7('0xc'),auth[_0xb6b7('0xa')](),controller[_0xb6b7('0x1e')]);router['delete'](_0xb6b7('0xc'),auth[_0xb6b7('0xa')](),controller['destroy']);router[_0xb6b7('0x1f')](_0xb6b7('0x13'),auth[_0xb6b7('0xa')](),controller['removeLists']);router[_0xb6b7('0x1f')](_0xb6b7('0x15'),auth[_0xb6b7('0xa')](),controller['removeBlackLists']);module[_0xb6b7('0x20')]=router; \ No newline at end of file +var _0x36cf=['removeLists','exports','multer','util','express','fs-extra','../../components/interaction/service','../../config/environment','isAuthenticated','get','/:id','show','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/lists','getLists','post','create','/:id/clone','clone','addLists','addBlackLists','put','update','delete','destroy'];(function(_0x5c1b48,_0x120d2c){var _0x3f1536=function(_0x490d30){while(--_0x490d30){_0x5c1b48['push'](_0x5c1b48['shift']());}};_0x3f1536(++_0x120d2c);}(_0x36cf,0xbc));var _0xf36c=function(_0x49ca18,_0x5e6d05){_0x49ca18=_0x49ca18-0x0;var _0x145d54=_0x36cf[_0x49ca18];return _0x145d54;};'use strict';var multer=require(_0xf36c('0x0'));var util=require(_0xf36c('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xf36c('0x2'));var router=express['Router']();var fs_extra=require(_0xf36c('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xf36c('0x4'));var config=require(_0xf36c('0x5'));var controller=require('./campaign.controller');router['get']('/',auth[_0xf36c('0x6')](),controller['index']);router[_0xf36c('0x7')](_0xf36c('0x8'),auth['isAuthenticated'](),controller[_0xf36c('0x9')]);router[_0xf36c('0x7')](_0xf36c('0xa'),auth['isAuthenticated'](),controller[_0xf36c('0xb')]);router[_0xf36c('0x7')](_0xf36c('0xc'),auth[_0xf36c('0x6')](),controller[_0xf36c('0xd')]);router[_0xf36c('0x7')]('/:id/hopper_finals',auth['isAuthenticated'](),controller[_0xf36c('0xe')]);router[_0xf36c('0x7')](_0xf36c('0xf'),auth[_0xf36c('0x6')](),controller[_0xf36c('0x10')]);router[_0xf36c('0x7')](_0xf36c('0x11'),auth[_0xf36c('0x6')](),controller[_0xf36c('0x12')]);router[_0xf36c('0x7')]('/:id/blacklists',auth['isAuthenticated'](),controller['getBlackLists']);router[_0xf36c('0x13')]('/',auth['isAuthenticated'](),controller[_0xf36c('0x14')]);router['post'](_0xf36c('0x15'),auth[_0xf36c('0x6')](),controller[_0xf36c('0x16')]);router[_0xf36c('0x13')](_0xf36c('0x11'),auth[_0xf36c('0x6')](),controller[_0xf36c('0x17')]);router[_0xf36c('0x13')]('/:id/blacklists',auth['isAuthenticated'](),controller[_0xf36c('0x18')]);router[_0xf36c('0x19')](_0xf36c('0x8'),auth[_0xf36c('0x6')](),controller[_0xf36c('0x1a')]);router[_0xf36c('0x1b')](_0xf36c('0x8'),auth[_0xf36c('0x6')](),controller[_0xf36c('0x1c')]);router[_0xf36c('0x1b')](_0xf36c('0x11'),auth['isAuthenticated'](),controller[_0xf36c('0x1d')]);router[_0xf36c('0x1b')]('/:id/blacklists',auth[_0xf36c('0x6')](),controller['removeBlackLists']);module[_0xf36c('0x1e')]=router; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js index 6affca6..fe13f13 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 _0xc366=['exports','TEXT','medium','STRING','VIRTUAL','sequelize'];(function(_0x52121d,_0x1d1704){var _0x448627=function(_0x495bf0){while(--_0x495bf0){_0x52121d['push'](_0x52121d['shift']());}};_0x448627(++_0x1d1704);}(_0xc366,0x1af));var _0x6c36=function(_0x1ef79b,_0x3d7a67){_0x1ef79b=_0x1ef79b-0x0;var _0x1eed2c=_0xc366[_0x1ef79b];return _0x1eed2c;};'use strict';var Sequelize=require(_0x6c36('0x0'));module[_0x6c36('0x1')]={'key':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize[_0x6c36('0x2')],'length':_0x6c36('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0x6c36('0x4')]},'name':{'type':Sequelize[_0x6c36('0x5')],'get':function(){return this['getDataValue']('key');}}}; \ No newline at end of file +var _0xe68f=['STRING','medium','getDataValue','key','sequelize','exports'];(function(_0x21c9eb,_0x43ce02){var _0x5dcbc7=function(_0x317893){while(--_0x317893){_0x21c9eb['push'](_0x21c9eb['shift']());}};_0x5dcbc7(++_0x43ce02);}(_0xe68f,0x19c));var _0xfe68=function(_0x2281a2,_0x21cd04){_0x2281a2=_0x2281a2-0x0;var _0x546987=_0xe68f[_0x2281a2];return _0x546987;};'use strict';var Sequelize=require(_0xfe68('0x0'));module[_0xfe68('0x1')]={'key':{'type':Sequelize[_0xfe68('0x2')],'allowNull':![]},'value':{'type':Sequelize['TEXT'],'length':_0xfe68('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0xfe68('0x2')]},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0xfe68('0x4')](_0xfe68('0x5'));}}}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js index bb2535e..bb06cbd 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 _0xa505=['path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','then','destroy','get','CannedAnswers','error','stack','name','index','CannedAnswer','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','nolimit','pick','where','merge','filter','options','include','findAll','rows','catch','show','params','includeAll','find','update','body','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util'];(function(_0x307101,_0x45fd0a){var _0x5d4775=function(_0x5864ff){while(--_0x5864ff){_0x307101['push'](_0x307101['shift']());}};_0x5d4775(++_0x45fd0a);}(_0xa505,0x15c));var _0x5a50=function(_0x226c52,_0x5fa1f1){_0x226c52=_0x226c52-0x0;var _0x1081bc=_0xa505[_0x226c52];return _0x1081bc;};'use strict';var emlformat=require(_0x5a50('0x0'));var rimraf=require(_0x5a50('0x1'));var zipdir=require(_0x5a50('0x2'));var jsonpatch=require(_0x5a50('0x3'));var rp=require(_0x5a50('0x4'));var moment=require(_0x5a50('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x5a50('0x6'));var util=require(_0x5a50('0x7'));var path=require(_0x5a50('0x8'));var sox=require(_0x5a50('0x9'));var csv=require('to-csv');var ejs=require(_0x5a50('0xa'));var fs=require('fs');var fs_extra=require(_0x5a50('0xb'));var _=require(_0x5a50('0xc'));var squel=require(_0x5a50('0xd'));var crypto=require(_0x5a50('0xe'));var jsforce=require(_0x5a50('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x5a50('0x10'));var querystring=require('querystring');var Papa=require(_0x5a50('0x11'));var Redis=require('ioredis');var authService=require(_0x5a50('0x12'));var qs=require(_0x5a50('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5a50('0x14'));var logger=require(_0x5a50('0x15'))(_0x5a50('0x16'));var utils=require(_0x5a50('0x17'));var config=require(_0x5a50('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x249a3c,_0x444279){_0x444279=_0x444279||0xcc;return function(_0x54d46b){if(_0x54d46b){return _0x249a3c[_0x5a50('0x19')](_0x444279);}return _0x249a3c[_0x5a50('0x1a')](_0x444279)[_0x5a50('0x1b')]();};}function respondWithResult(_0x126d1c,_0x3c1a55){_0x3c1a55=_0x3c1a55||0xc8;return function(_0x24a2b5){if(_0x24a2b5){return _0x126d1c[_0x5a50('0x1a')](_0x3c1a55)[_0x5a50('0x1c')](_0x24a2b5);}};}function respondWithFilteredResult(_0x150793,_0x380a7c){return function(_0x59be19){if(_0x59be19){var _0x239eb1=typeof _0x380a7c[_0x5a50('0x1d')]==='undefined'&&typeof _0x380a7c['limit']===_0x5a50('0x1e');var _0x20287d=_0x59be19[_0x5a50('0x1f')];var _0x5e3eea=_0x239eb1?0x0:_0x380a7c[_0x5a50('0x1d')];var _0x2e71cb=_0x239eb1?_0x59be19[_0x5a50('0x1f')]:_0x380a7c[_0x5a50('0x1d')]+_0x380a7c[_0x5a50('0x20')];var _0x8e4e77;if(_0x2e71cb>=_0x20287d){_0x2e71cb=_0x20287d;_0x8e4e77=0xc8;}else{_0x8e4e77=0xce;}_0x150793['status'](_0x8e4e77);return _0x150793[_0x5a50('0x21')](_0x5a50('0x22'),_0x5e3eea+'-'+_0x2e71cb+'/'+_0x20287d)[_0x5a50('0x1c')](_0x59be19);}return null;};}function patchUpdates(_0x5758f5){return function(_0x256dd5){try{jsonpatch[_0x5a50('0x23')](_0x256dd5,_0x5758f5,!![]);}catch(_0x280505){return BPromise[_0x5a50('0x24')](_0x280505);}return _0x256dd5[_0x5a50('0x25')]();};}function saveUpdates(_0x3ef509,_0x115c60){return function(_0x1fda01){if(_0x1fda01){return _0x1fda01['update'](_0x3ef509)[_0x5a50('0x26')](function(_0x29e352){return _0x29e352;});}return null;};}function removeEntity(_0x2b56a0,_0x10da80){return function(_0x46fbce){if(_0x46fbce){return _0x46fbce[_0x5a50('0x27')]()[_0x5a50('0x26')](function(){var _0x487a8f=_0x46fbce[_0x5a50('0x28')]({'plain':!![]});var _0xac6c80=_0x5a50('0x29');return db['UserProfileResource']['destroy']({'where':{'type':_0xac6c80,'resourceId':_0x487a8f['id']}})[_0x5a50('0x26')](function(){return _0x46fbce;});})['then'](function(){_0x2b56a0[_0x5a50('0x1a')](0xcc)[_0x5a50('0x1b')]();});}};}function handleEntityNotFound(_0x471852,_0x27e64e){return function(_0x13d1ee){if(!_0x13d1ee){_0x471852[_0x5a50('0x19')](0x194);}return _0x13d1ee;};}function handleError(_0x2b8a4f,_0x10c62d){_0x10c62d=_0x10c62d||0x1f4;return function(_0x37fe99){logger[_0x5a50('0x2a')](_0x37fe99[_0x5a50('0x2b')]);if(_0x37fe99[_0x5a50('0x2c')]){delete _0x37fe99[_0x5a50('0x2c')];}_0x2b8a4f[_0x5a50('0x1a')](_0x10c62d)['send'](_0x37fe99);};}exports[_0x5a50('0x2d')]=function(_0x36d01e,_0x273be6){var _0x4762ee={},_0x476708={},_0x318f40={'count':0x0,'rows':[]};var _0x32a1cb=_['map'](db[_0x5a50('0x2e')]['rawAttributes'],function(_0x203071){return{'name':_0x203071[_0x5a50('0x2f')],'type':_0x203071[_0x5a50('0x30')][_0x5a50('0x31')]};});_0x476708[_0x5a50('0x32')]=_[_0x5a50('0x33')](_0x32a1cb,_0x5a50('0x2c'));_0x476708[_0x5a50('0x34')]=_[_0x5a50('0x35')](_0x36d01e[_0x5a50('0x34')]);_0x476708[_0x5a50('0x36')]=_[_0x5a50('0x37')](_0x476708[_0x5a50('0x32')],_0x476708['query']);_0x4762ee[_0x5a50('0x38')]=_['intersection'](_0x476708[_0x5a50('0x32')],qs[_0x5a50('0x39')](_0x36d01e['query']['fields']));_0x4762ee[_0x5a50('0x38')]=_0x4762ee['attributes']['length']?_0x4762ee[_0x5a50('0x38')]:_0x476708[_0x5a50('0x32')];if(!_0x36d01e[_0x5a50('0x34')]['hasOwnProperty'](_0x5a50('0x3a'))){_0x4762ee['limit']=qs[_0x5a50('0x20')](_0x36d01e[_0x5a50('0x34')][_0x5a50('0x20')]);_0x4762ee[_0x5a50('0x1d')]=qs[_0x5a50('0x1d')](_0x36d01e[_0x5a50('0x34')][_0x5a50('0x1d')]);}_0x4762ee['order']=qs['sort'](_0x36d01e[_0x5a50('0x34')]['sort']);_0x4762ee['where']=qs['filters'](_[_0x5a50('0x3b')](_0x36d01e[_0x5a50('0x34')],_0x476708[_0x5a50('0x36')]),_0x32a1cb);if(_0x36d01e[_0x5a50('0x34')]['filter']){_0x4762ee[_0x5a50('0x3c')]=_[_0x5a50('0x3d')](_0x4762ee['where'],{'$or':[{'key':{'$like':'%'+_0x36d01e[_0x5a50('0x34')]['filter']+'%'}},{'value':{'$like':'%'+_0x36d01e[_0x5a50('0x34')][_0x5a50('0x3e')]+'%'}}]});}_0x4762ee=_[_0x5a50('0x3d')]({},_0x4762ee,_0x36d01e[_0x5a50('0x3f')]);var _0x1fb2d7={'where':_0x4762ee[_0x5a50('0x3c')]};return db[_0x5a50('0x2e')][_0x5a50('0x1f')](_0x1fb2d7)['then'](function(_0x2dceff){_0x318f40['count']=_0x2dceff;if(_0x36d01e[_0x5a50('0x34')]['includeAll']){_0x4762ee[_0x5a50('0x40')]=[{'all':!![]}];}return db[_0x5a50('0x2e')][_0x5a50('0x41')](_0x4762ee);})[_0x5a50('0x26')](function(_0x238cdf){_0x318f40[_0x5a50('0x42')]=_0x238cdf;return _0x318f40;})[_0x5a50('0x26')](respondWithFilteredResult(_0x273be6,_0x4762ee))[_0x5a50('0x43')](handleError(_0x273be6,null));};exports[_0x5a50('0x44')]=function(_0x1c2bd8,_0x42cc7c){var _0x56e952={'raw':!![],'where':{'id':_0x1c2bd8[_0x5a50('0x45')]['id']}},_0x32057a={};_0x32057a[_0x5a50('0x32')]=_[_0x5a50('0x35')](db[_0x5a50('0x2e')]['rawAttributes']);_0x32057a['query']=_['keys'](_0x1c2bd8[_0x5a50('0x34')]);_0x32057a[_0x5a50('0x36')]=_['intersection'](_0x32057a[_0x5a50('0x32')],_0x32057a[_0x5a50('0x34')]);_0x56e952[_0x5a50('0x38')]=_[_0x5a50('0x37')](_0x32057a['model'],qs[_0x5a50('0x39')](_0x1c2bd8[_0x5a50('0x34')][_0x5a50('0x39')]));_0x56e952[_0x5a50('0x38')]=_0x56e952[_0x5a50('0x38')]['length']?_0x56e952[_0x5a50('0x38')]:_0x32057a['model'];if(_0x1c2bd8[_0x5a50('0x34')][_0x5a50('0x46')]){_0x56e952[_0x5a50('0x40')]=[{'all':!![]}];}_0x56e952=_['merge']({},_0x56e952,_0x1c2bd8[_0x5a50('0x3f')]);return db['CannedAnswer'][_0x5a50('0x47')](_0x56e952)[_0x5a50('0x26')](handleEntityNotFound(_0x42cc7c,null))['then'](respondWithResult(_0x42cc7c,null))[_0x5a50('0x43')](handleError(_0x42cc7c,null));};exports[_0x5a50('0x48')]=function(_0x4c91ef,_0x545c2b){if(_0x4c91ef[_0x5a50('0x49')]['id']){delete _0x4c91ef['body']['id'];}return db[_0x5a50('0x2e')][_0x5a50('0x47')]({'where':{'id':_0x4c91ef[_0x5a50('0x45')]['id']}})[_0x5a50('0x26')](handleEntityNotFound(_0x545c2b,null))[_0x5a50('0x26')](saveUpdates(_0x4c91ef['body'],null))['then'](respondWithResult(_0x545c2b,null))['catch'](handleError(_0x545c2b,null));};exports[_0x5a50('0x27')]=function(_0x2ed5f7,_0x3316a0){return db['CannedAnswer'][_0x5a50('0x47')]({'where':{'id':_0x2ed5f7['params']['id']}})[_0x5a50('0x26')](handleEntityNotFound(_0x3316a0,null))[_0x5a50('0x26')](removeEntity(_0x3316a0,null))['catch'](handleError(_0x3316a0,null));};exports[_0x5a50('0x4a')]=function(_0x27ce64,_0xb61898){var _0x4d16be={'key':_0x27ce64[_0x5a50('0x49')][_0x5a50('0x31')]};if(_0x27ce64[_0x5a50('0x49')][_0x5a50('0x4b')]){_0x4d16be['MailAccountId']=_0x27ce64['body']['MailAccountId'];}else if(_0x27ce64[_0x5a50('0x49')][_0x5a50('0x4c')]){_0x4d16be[_0x5a50('0x4c')]=_0x27ce64[_0x5a50('0x49')]['SmsAccountId'];}else if(_0x27ce64[_0x5a50('0x49')][_0x5a50('0x4d')]){_0x4d16be[_0x5a50('0x4d')]=_0x27ce64[_0x5a50('0x49')][_0x5a50('0x4d')];}else if(_0x27ce64[_0x5a50('0x49')]['ChatWebsiteId']){_0x4d16be['ChatWebsiteId']=_0x27ce64['body'][_0x5a50('0x4e')];}return db['CannedAnswer'][_0x5a50('0x47')]({'where':_0x4d16be})['then'](function(_0x542984){if(_0x542984){throw new db[(_0x5a50('0x4f'))][(_0x5a50('0x50'))](_0x5a50('0x51'));}return db[_0x5a50('0x2e')]['create'](_0x27ce64['body']);})[_0x5a50('0x26')](function(_0x235b3a){var _0x3eb9c8=_0x27ce64[_0x5a50('0x52')][_0x5a50('0x28')]({'plain':!![]});if(!_0x3eb9c8)throw new Error(_0x5a50('0x53'));if(_0x3eb9c8[_0x5a50('0x54')]==='user'){var _0x23cb3a=_0x235b3a[_0x5a50('0x28')]({'plain':!![]});return db[_0x5a50('0x55')][_0x5a50('0x47')]({'where':{'name':_0x5a50('0x29'),'userProfileId':_0x3eb9c8[_0x5a50('0x56')]},'raw':!![]})[_0x5a50('0x26')](function(_0x323a98){if(_0x323a98&&_0x323a98[_0x5a50('0x57')]===0x0){return db[_0x5a50('0x58')][_0x5a50('0x4a')]({'name':_0x23cb3a[_0x5a50('0x2c')],'resourceId':_0x23cb3a['id'],'type':_0x323a98[_0x5a50('0x2c')],'sectionId':_0x323a98['id']},{})['then'](function(){return _0x235b3a;});}else{return _0x235b3a;}})['catch'](function(_0x4bcf2e){logger[_0x5a50('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4bcf2e);throw _0x4bcf2e;});}return _0x235b3a;})[_0x5a50('0x26')](respondWithResult(_0xb61898,0xc9))[_0x5a50('0x43')](handleError(_0xb61898,null));}; \ No newline at end of file +var _0xbc17=['CannedAnswers','UserProfileResource','error','stack','name','send','index','rawAttributes','fieldName','type','model','map','query','attributes','intersection','fields','length','hasOwnProperty','sort','filters','filter','where','merge','options','CannedAnswer','includeAll','include','findAll','rows','show','params','keys','find','catch','body','create','key','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','desk.js','querystring','ioredis','../../components/auth/service','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','undefined','count','offset','set','Content-Range','apply','reject','save','update','destroy','then','get'];(function(_0x90e9ec,_0xc287cd){var _0xa8f797=function(_0x50c504){while(--_0x50c504){_0x90e9ec['push'](_0x90e9ec['shift']());}};_0xa8f797(++_0xc287cd);}(_0xbc17,0xe0));var _0x7bc1=function(_0x35eaac,_0x470cdd){_0x35eaac=_0x35eaac-0x0;var _0x44ff21=_0xbc17[_0x35eaac];return _0x44ff21;};'use strict';var emlformat=require(_0x7bc1('0x0'));var rimraf=require(_0x7bc1('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x7bc1('0x2'));var moment=require(_0x7bc1('0x3'));var BPromise=require(_0x7bc1('0x4'));var Mustache=require('mustache');var util=require(_0x7bc1('0x5'));var path=require(_0x7bc1('0x6'));var sox=require(_0x7bc1('0x7'));var csv=require(_0x7bc1('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7bc1('0x9'));var _=require(_0x7bc1('0xa'));var squel=require(_0x7bc1('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x7bc1('0xc'));var toCsv=require(_0x7bc1('0x8'));var querystring=require(_0x7bc1('0xd'));var Papa=require('papaparse');var Redis=require(_0x7bc1('0xe'));var authService=require(_0x7bc1('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x7bc1('0x10'))('api');var utils=require(_0x7bc1('0x11'));var config=require('../../config/environment');var licenseUtil=require(_0x7bc1('0x12'));var db=require(_0x7bc1('0x13'))['db'];function respondWithStatusCode(_0xe41154,_0x159c4f){_0x159c4f=_0x159c4f||0xcc;return function(_0x5bde2e){if(_0x5bde2e){return _0xe41154[_0x7bc1('0x14')](_0x159c4f);}return _0xe41154[_0x7bc1('0x15')](_0x159c4f)[_0x7bc1('0x16')]();};}function respondWithResult(_0x237e53,_0x8af7b1){_0x8af7b1=_0x8af7b1||0xc8;return function(_0x451bf0){if(_0x451bf0){return _0x237e53[_0x7bc1('0x15')](_0x8af7b1)[_0x7bc1('0x17')](_0x451bf0);}};}function respondWithFilteredResult(_0x89ffaa,_0x2f606a){return function(_0x1f507b){if(_0x1f507b){var _0x216a1c=typeof _0x2f606a['offset']==='undefined'&&typeof _0x2f606a[_0x7bc1('0x18')]===_0x7bc1('0x19');var _0x3c768b=_0x1f507b[_0x7bc1('0x1a')];var _0x1470bf=_0x216a1c?0x0:_0x2f606a[_0x7bc1('0x1b')];var _0x1407f5=_0x216a1c?_0x1f507b['count']:_0x2f606a['offset']+_0x2f606a[_0x7bc1('0x18')];var _0x5e9ec6;if(_0x1407f5>=_0x3c768b){_0x1407f5=_0x3c768b;_0x5e9ec6=0xc8;}else{_0x5e9ec6=0xce;}_0x89ffaa[_0x7bc1('0x15')](_0x5e9ec6);return _0x89ffaa[_0x7bc1('0x1c')](_0x7bc1('0x1d'),_0x1470bf+'-'+_0x1407f5+'/'+_0x3c768b)[_0x7bc1('0x17')](_0x1f507b);}return null;};}function patchUpdates(_0x45d33e){return function(_0x4fc589){try{jsonpatch[_0x7bc1('0x1e')](_0x4fc589,_0x45d33e,!![]);}catch(_0x5cc69b){return BPromise[_0x7bc1('0x1f')](_0x5cc69b);}return _0x4fc589[_0x7bc1('0x20')]();};}function saveUpdates(_0xabda20,_0x308d53){return function(_0x3c0077){if(_0x3c0077){return _0x3c0077[_0x7bc1('0x21')](_0xabda20)['then'](function(_0x3d780f){return _0x3d780f;});}return null;};}function removeEntity(_0x179242,_0x2caff6){return function(_0x2825c5){if(_0x2825c5){return _0x2825c5[_0x7bc1('0x22')]()[_0x7bc1('0x23')](function(){var _0xc36205=_0x2825c5[_0x7bc1('0x24')]({'plain':!![]});var _0x2fbedc=_0x7bc1('0x25');return db[_0x7bc1('0x26')][_0x7bc1('0x22')]({'where':{'type':_0x2fbedc,'resourceId':_0xc36205['id']}})[_0x7bc1('0x23')](function(){return _0x2825c5;});})[_0x7bc1('0x23')](function(){_0x179242['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x59b696,_0x280e21){return function(_0x1f604b){if(!_0x1f604b){_0x59b696[_0x7bc1('0x14')](0x194);}return _0x1f604b;};}function handleError(_0x2056a2,_0x11f8fd){_0x11f8fd=_0x11f8fd||0x1f4;return function(_0x287c61){logger[_0x7bc1('0x27')](_0x287c61[_0x7bc1('0x28')]);if(_0x287c61[_0x7bc1('0x29')]){delete _0x287c61['name'];}_0x2056a2[_0x7bc1('0x15')](_0x11f8fd)[_0x7bc1('0x2a')](_0x287c61);};}exports[_0x7bc1('0x2b')]=function(_0x5316b2,_0x2d0a54){var _0x5d97f9={},_0x1b3b95={},_0x1033e6={'count':0x0,'rows':[]};var _0x72b2fb=_['map'](db['CannedAnswer'][_0x7bc1('0x2c')],function(_0x468284){return{'name':_0x468284[_0x7bc1('0x2d')],'type':_0x468284[_0x7bc1('0x2e')]['key']};});_0x1b3b95[_0x7bc1('0x2f')]=_[_0x7bc1('0x30')](_0x72b2fb,_0x7bc1('0x29'));_0x1b3b95[_0x7bc1('0x31')]=_['keys'](_0x5316b2['query']);_0x1b3b95['filters']=_['intersection'](_0x1b3b95[_0x7bc1('0x2f')],_0x1b3b95[_0x7bc1('0x31')]);_0x5d97f9[_0x7bc1('0x32')]=_[_0x7bc1('0x33')](_0x1b3b95['model'],qs[_0x7bc1('0x34')](_0x5316b2[_0x7bc1('0x31')]['fields']));_0x5d97f9[_0x7bc1('0x32')]=_0x5d97f9[_0x7bc1('0x32')][_0x7bc1('0x35')]?_0x5d97f9[_0x7bc1('0x32')]:_0x1b3b95[_0x7bc1('0x2f')];if(!_0x5316b2[_0x7bc1('0x31')][_0x7bc1('0x36')]('nolimit')){_0x5d97f9[_0x7bc1('0x18')]=qs[_0x7bc1('0x18')](_0x5316b2['query']['limit']);_0x5d97f9['offset']=qs[_0x7bc1('0x1b')](_0x5316b2['query']['offset']);}_0x5d97f9['order']=qs['sort'](_0x5316b2[_0x7bc1('0x31')][_0x7bc1('0x37')]);_0x5d97f9['where']=qs[_0x7bc1('0x38')](_['pick'](_0x5316b2[_0x7bc1('0x31')],_0x1b3b95['filters']),_0x72b2fb);if(_0x5316b2[_0x7bc1('0x31')][_0x7bc1('0x39')]){_0x5d97f9[_0x7bc1('0x3a')]=_[_0x7bc1('0x3b')](_0x5d97f9[_0x7bc1('0x3a')],{'$or':[{'key':{'$like':'%'+_0x5316b2[_0x7bc1('0x31')][_0x7bc1('0x39')]+'%'}},{'value':{'$like':'%'+_0x5316b2[_0x7bc1('0x31')][_0x7bc1('0x39')]+'%'}}]});}_0x5d97f9=_['merge']({},_0x5d97f9,_0x5316b2[_0x7bc1('0x3c')]);var _0x374baa={'where':_0x5d97f9[_0x7bc1('0x3a')]};return db[_0x7bc1('0x3d')][_0x7bc1('0x1a')](_0x374baa)[_0x7bc1('0x23')](function(_0x3005df){_0x1033e6[_0x7bc1('0x1a')]=_0x3005df;if(_0x5316b2[_0x7bc1('0x31')][_0x7bc1('0x3e')]){_0x5d97f9[_0x7bc1('0x3f')]=[{'all':!![]}];}return db[_0x7bc1('0x3d')][_0x7bc1('0x40')](_0x5d97f9);})[_0x7bc1('0x23')](function(_0x2a871b){_0x1033e6[_0x7bc1('0x41')]=_0x2a871b;return _0x1033e6;})[_0x7bc1('0x23')](respondWithFilteredResult(_0x2d0a54,_0x5d97f9))['catch'](handleError(_0x2d0a54,null));};exports[_0x7bc1('0x42')]=function(_0x417b5b,_0x3bb753){var _0x279cc={'raw':!![],'where':{'id':_0x417b5b[_0x7bc1('0x43')]['id']}},_0x21597a={};_0x21597a[_0x7bc1('0x2f')]=_[_0x7bc1('0x44')](db[_0x7bc1('0x3d')]['rawAttributes']);_0x21597a[_0x7bc1('0x31')]=_[_0x7bc1('0x44')](_0x417b5b[_0x7bc1('0x31')]);_0x21597a['filters']=_[_0x7bc1('0x33')](_0x21597a['model'],_0x21597a[_0x7bc1('0x31')]);_0x279cc['attributes']=_[_0x7bc1('0x33')](_0x21597a[_0x7bc1('0x2f')],qs[_0x7bc1('0x34')](_0x417b5b['query'][_0x7bc1('0x34')]));_0x279cc[_0x7bc1('0x32')]=_0x279cc['attributes'][_0x7bc1('0x35')]?_0x279cc[_0x7bc1('0x32')]:_0x21597a[_0x7bc1('0x2f')];if(_0x417b5b[_0x7bc1('0x31')][_0x7bc1('0x3e')]){_0x279cc[_0x7bc1('0x3f')]=[{'all':!![]}];}_0x279cc=_[_0x7bc1('0x3b')]({},_0x279cc,_0x417b5b['options']);return db[_0x7bc1('0x3d')][_0x7bc1('0x45')](_0x279cc)[_0x7bc1('0x23')](handleEntityNotFound(_0x3bb753,null))[_0x7bc1('0x23')](respondWithResult(_0x3bb753,null))[_0x7bc1('0x46')](handleError(_0x3bb753,null));};exports['update']=function(_0x4ebd39,_0x34e9ec){if(_0x4ebd39[_0x7bc1('0x47')]['id']){delete _0x4ebd39[_0x7bc1('0x47')]['id'];}return db[_0x7bc1('0x3d')]['find']({'where':{'id':_0x4ebd39[_0x7bc1('0x43')]['id']}})['then'](handleEntityNotFound(_0x34e9ec,null))[_0x7bc1('0x23')](saveUpdates(_0x4ebd39[_0x7bc1('0x47')],null))[_0x7bc1('0x23')](respondWithResult(_0x34e9ec,null))[_0x7bc1('0x46')](handleError(_0x34e9ec,null));};exports[_0x7bc1('0x22')]=function(_0x56f5b1,_0x454f3b){return db[_0x7bc1('0x3d')]['find']({'where':{'id':_0x56f5b1[_0x7bc1('0x43')]['id']}})['then'](handleEntityNotFound(_0x454f3b,null))['then'](removeEntity(_0x454f3b,null))[_0x7bc1('0x46')](handleError(_0x454f3b,null));};exports[_0x7bc1('0x48')]=function(_0x5cdf0f,_0x5e4ac4){var _0x26a84c={'key':_0x5cdf0f[_0x7bc1('0x47')][_0x7bc1('0x49')]};if(_0x5cdf0f[_0x7bc1('0x47')][_0x7bc1('0x4a')]){_0x26a84c[_0x7bc1('0x4a')]=_0x5cdf0f[_0x7bc1('0x47')][_0x7bc1('0x4a')];}else if(_0x5cdf0f[_0x7bc1('0x47')][_0x7bc1('0x4b')]){_0x26a84c[_0x7bc1('0x4b')]=_0x5cdf0f[_0x7bc1('0x47')][_0x7bc1('0x4b')];}else if(_0x5cdf0f[_0x7bc1('0x47')]['OpenchannelAccountId']){_0x26a84c[_0x7bc1('0x4c')]=_0x5cdf0f[_0x7bc1('0x47')][_0x7bc1('0x4c')];}else if(_0x5cdf0f['body'][_0x7bc1('0x4d')]){_0x26a84c[_0x7bc1('0x4d')]=_0x5cdf0f[_0x7bc1('0x47')][_0x7bc1('0x4d')];}return db[_0x7bc1('0x3d')][_0x7bc1('0x45')]({'where':_0x26a84c})[_0x7bc1('0x23')](function(_0xb92f8d){if(_0xb92f8d){throw new db[(_0x7bc1('0x4e'))][(_0x7bc1('0x4f'))](_0x7bc1('0x50'));}return db[_0x7bc1('0x3d')][_0x7bc1('0x48')](_0x5cdf0f[_0x7bc1('0x47')]);})[_0x7bc1('0x23')](function(_0xbeaae4){var _0x1796a1=_0x5cdf0f[_0x7bc1('0x51')][_0x7bc1('0x24')]({'plain':!![]});if(!_0x1796a1)throw new Error(_0x7bc1('0x52'));if(_0x1796a1[_0x7bc1('0x53')]===_0x7bc1('0x51')){var _0x328ba6=_0xbeaae4[_0x7bc1('0x24')]({'plain':!![]});return db[_0x7bc1('0x54')][_0x7bc1('0x45')]({'where':{'name':_0x7bc1('0x25'),'userProfileId':_0x1796a1['userProfileId']},'raw':!![]})[_0x7bc1('0x23')](function(_0x2ae27d){if(_0x2ae27d&&_0x2ae27d[_0x7bc1('0x55')]===0x0){return db[_0x7bc1('0x26')]['create']({'name':_0x328ba6[_0x7bc1('0x29')],'resourceId':_0x328ba6['id'],'type':_0x2ae27d[_0x7bc1('0x29')],'sectionId':_0x2ae27d['id']},{})[_0x7bc1('0x23')](function(){return _0xbeaae4;});}else{return _0xbeaae4;}})['catch'](function(_0x542948){logger[_0x7bc1('0x27')](_0x7bc1('0x56'),_0x542948);throw _0x542948;});}return _0xbeaae4;})[_0x7bc1('0x23')](respondWithResult(_0x5e4ac4,0xc9))[_0x7bc1('0x46')](handleError(_0x5e4ac4,null));}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js index ab6f25e..ebb71c9 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 _0x5e01=['CannedAnswer','tools_canned_answers','lodash','util','../../config/logger','api','moment','path','../../config/environment','./cannedAnswer.attributes','exports','define'];(function(_0x2ad1be,_0x413717){var _0xac1e87=function(_0xf70ade){while(--_0xf70ade){_0x2ad1be['push'](_0x2ad1be['shift']());}};_0xac1e87(++_0x413717);}(_0x5e01,0x12e));var _0x15e0=function(_0x272638,_0x42b993){_0x272638=_0x272638-0x0;var _0x19d027=_0x5e01[_0x272638];return _0x19d027;};'use strict';var _=require(_0x15e0('0x0'));var util=require(_0x15e0('0x1'));var logger=require(_0x15e0('0x2'))(_0x15e0('0x3'));var moment=require(_0x15e0('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x15e0('0x5'));var rimraf=require('rimraf');var config=require(_0x15e0('0x6'));var attributes=require(_0x15e0('0x7'));module[_0x15e0('0x8')]=function(_0x34cee2,_0xb1b3a2){return _0x34cee2[_0x15e0('0x9')](_0x15e0('0xa'),attributes,{'tableName':_0x15e0('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x34b7=['utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./cannedAnswer.attributes','exports','CannedAnswer','tools_canned_answers'];(function(_0x188841,_0x2cf5eb){var _0x420cf4=function(_0x35cf7b){while(--_0x35cf7b){_0x188841['push'](_0x188841['shift']());}};_0x420cf4(++_0x2cf5eb);}(_0x34b7,0x16e));var _0x734b=function(_0x34190e,_0x50ecc7){_0x34190e=_0x34190e-0x0;var _0x41a4e6=_0x34b7[_0x34190e];return _0x41a4e6;};'use strict';var _=require(_0x734b('0x0'));var util=require(_0x734b('0x1'));var logger=require(_0x734b('0x2'))('api');var moment=require(_0x734b('0x3'));var BPromise=require(_0x734b('0x4'));var rp=require(_0x734b('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x734b('0x6'));var config=require(_0x734b('0x7'));var attributes=require(_0x734b('0x8'));module[_0x734b('0x9')]=function(_0x6b1bfd,_0x57973d){return _0x6b1bfd['define'](_0x734b('0xa'),attributes,{'tableName':_0x734b('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x734b('0xc'),'collate':_0x734b('0xd')});}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js index 9963b8a..a53553e 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(_0x1bf4a3,_0x54837f){var _0xfca5a4=function(_0x30ab9e){while(--_0x30ab9e){_0x1bf4a3['push'](_0x1bf4a3['shift']());}};_0xfca5a4(++_0x54837f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x173d7e,_0x3242fd){_0x173d7e=_0x173d7e-0x0;var _0x2220d6=_0xa9e0[_0x173d7e];return _0x2220d6;};'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(_0x4f2d9e,_0x5a7653){var _0x3361c6=function(_0x3798c0){while(--_0x3798c0){_0x4f2d9e['push'](_0x4f2d9e['shift']());}};_0x3361c6(++_0x5a7653);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1ddedd,_0x485606){_0x1ddedd=_0x1ddedd-0x0;var _0xa3e1ac=_0xa9e0[_0x1ddedd];return _0xa3e1ac;};'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 3a8a49d..1eb409e 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 _0xdfa4=['exports','multer','util','path','fs-extra','../../components/auth/service','./cannedAnswer.controller','get','isAuthenticated','index','/:id','show','post','create','put','delete','destroy'];(function(_0x24c408,_0x17fe88){var _0x4d41f6=function(_0x133fba){while(--_0x133fba){_0x24c408['push'](_0x24c408['shift']());}};_0x4d41f6(++_0x17fe88);}(_0xdfa4,0xbc));var _0x4dfa=function(_0x2a69ec,_0x1cf42f){_0x2a69ec=_0x2a69ec-0x0;var _0x20ab9f=_0xdfa4[_0x2a69ec];return _0x20ab9f;};'use strict';var multer=require(_0x4dfa('0x0'));var util=require(_0x4dfa('0x1'));var path=require(_0x4dfa('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x4dfa('0x3'));var auth=require(_0x4dfa('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x4dfa('0x5'));router[_0x4dfa('0x6')]('/',auth[_0x4dfa('0x7')](),controller[_0x4dfa('0x8')]);router[_0x4dfa('0x6')](_0x4dfa('0x9'),auth[_0x4dfa('0x7')](),controller[_0x4dfa('0xa')]);router[_0x4dfa('0xb')]('/',auth[_0x4dfa('0x7')](),controller[_0x4dfa('0xc')]);router[_0x4dfa('0xd')](_0x4dfa('0x9'),auth[_0x4dfa('0x7')](),controller['update']);router[_0x4dfa('0xe')](_0x4dfa('0x9'),auth['isAuthenticated'](),controller[_0x4dfa('0xf')]);module[_0x4dfa('0x10')]=router; \ No newline at end of file +var _0x3a16=['../../components/auth/service','../../config/environment','./cannedAnswer.controller','isAuthenticated','index','get','show','post','create','put','/:id','update','delete','destroy','exports','multer','util','connect-timeout','Router','fs-extra'];(function(_0x329664,_0x130748){var _0x4e346e=function(_0x172b0d){while(--_0x172b0d){_0x329664['push'](_0x329664['shift']());}};_0x4e346e(++_0x130748);}(_0x3a16,0x113));var _0x63a1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3a16[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x63a1('0x0'));var util=require(_0x63a1('0x1'));var path=require('path');var timeout=require(_0x63a1('0x2'));var express=require('express');var router=express[_0x63a1('0x3')]();var fs_extra=require(_0x63a1('0x4'));var auth=require(_0x63a1('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x63a1('0x6'));var controller=require(_0x63a1('0x7'));router['get']('/',auth[_0x63a1('0x8')](),controller[_0x63a1('0x9')]);router[_0x63a1('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x63a1('0xb')]);router[_0x63a1('0xc')]('/',auth['isAuthenticated'](),controller[_0x63a1('0xd')]);router[_0x63a1('0xe')](_0x63a1('0xf'),auth[_0x63a1('0x8')](),controller[_0x63a1('0x10')]);router[_0x63a1('0x11')]('/:id',auth[_0x63a1('0x8')](),controller[_0x63a1('0x12')]);module[_0x63a1('0x13')]=router; \ No newline at end of file diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js index 065e912..6a99729 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 _0xa446=['1970-01-01\x2000:00:01','STRING','INTEGER','sequelize','exports'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xa446,0xc6));var _0x6a44=function(_0x44967e,_0x1c3069){_0x44967e=_0x44967e-0x0;var _0x1aa7d1=_0xa446[_0x44967e];return _0x1aa7d1;};'use strict';var Sequelize=require(_0x6a44('0x0'));module[_0x6a44('0x1')]={'calldate':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':_0x6a44('0x2')},'clid':{'type':Sequelize['STRING']},'src':{'type':Sequelize[_0x6a44('0x3')]},'dst':{'type':Sequelize['STRING']},'dcontext':{'type':Sequelize[_0x6a44('0x3')]},'channel':{'type':Sequelize['STRING']},'dstchannel':{'type':Sequelize[_0x6a44('0x3')]},'lastapp':{'type':Sequelize[_0x6a44('0x3')]},'lastdata':{'type':Sequelize[_0x6a44('0x3')]},'duration':{'type':Sequelize[_0x6a44('0x4')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x6a44('0x4')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x6a44('0x3')]},'amaflags':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x6a44('0x3')]},'userfield':{'type':Sequelize[_0x6a44('0x3')]},'uniqueid':{'type':Sequelize[_0x6a44('0x3')]},'linkedid':{'type':Sequelize[_0x6a44('0x3')]},'sequence':{'type':Sequelize[_0x6a44('0x3')]},'peeraccount':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x6a44('0x3')]},'tag':{'type':Sequelize[_0x6a44('0x3')]}}; \ No newline at end of file +var _0xc423=['1970-01-01\x2000:00:01','STRING','INTEGER','sequelize','exports','DATE'];(function(_0x2e3942,_0x175d6a){var _0x2bfb83=function(_0x47286c){while(--_0x47286c){_0x2e3942['push'](_0x2e3942['shift']());}};_0x2bfb83(++_0x175d6a);}(_0xc423,0x159));var _0x3c42=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0xc423[_0x59ee6f];return _0x4c0979;};'use strict';var Sequelize=require(_0x3c42('0x0'));module[_0x3c42('0x1')]={'calldate':{'type':Sequelize[_0x3c42('0x2')],'allowNull':![],'defaultValue':_0x3c42('0x3')},'clid':{'type':Sequelize[_0x3c42('0x4')]},'src':{'type':Sequelize['STRING']},'dst':{'type':Sequelize[_0x3c42('0x4')]},'dcontext':{'type':Sequelize[_0x3c42('0x4')]},'channel':{'type':Sequelize[_0x3c42('0x4')]},'dstchannel':{'type':Sequelize['STRING']},'lastapp':{'type':Sequelize[_0x3c42('0x4')]},'lastdata':{'type':Sequelize[_0x3c42('0x4')]},'duration':{'type':Sequelize[_0x3c42('0x5')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x3c42('0x5')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x3c42('0x4')]},'amaflags':{'type':Sequelize[_0x3c42('0x5')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x3c42('0x4')]},'userfield':{'type':Sequelize[_0x3c42('0x4')]},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize[_0x3c42('0x4')]},'sequence':{'type':Sequelize['STRING']},'peeraccount':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x3c42('0x4')]},'tag':{'type':Sequelize[_0x3c42('0x4')]}}; \ No newline at end of file diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js index 760cc4d..768bba2 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 _0xbfe8=['mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','status','end','json','offset','undefined','count','limit','set','reject','update','then','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','pick','filter','where','VIRTUAL','merge','options','includeAll','include','Cdr','findAll','rows','catch','show','params','find','create','body','destroy','describe','rimraf','fast-json-patch','request-promise'];(function(_0x497b1e,_0x586379){var _0x3f72e1=function(_0x4c227d){while(--_0x4c227d){_0x497b1e['push'](_0x497b1e['shift']());}};_0x3f72e1(++_0x586379);}(_0xbfe8,0x1b9));var _0x8bfe=function(_0x4c9cae,_0x5a7539){_0x4c9cae=_0x4c9cae-0x0;var _0x5e0a0a=_0xbfe8[_0x4c9cae];return _0x5e0a0a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8bfe('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8bfe('0x1'));var rp=require(_0x8bfe('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x8bfe('0x3'));var util=require(_0x8bfe('0x4'));var path=require('path');var sox=require(_0x8bfe('0x5'));var csv=require(_0x8bfe('0x6'));var ejs=require(_0x8bfe('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8bfe('0x8'));var squel=require(_0x8bfe('0x9'));var crypto=require(_0x8bfe('0xa'));var jsforce=require(_0x8bfe('0xb'));var deskjs=require(_0x8bfe('0xc'));var toCsv=require(_0x8bfe('0x6'));var querystring=require(_0x8bfe('0xd'));var Papa=require(_0x8bfe('0xe'));var Redis=require(_0x8bfe('0xf'));var authService=require(_0x8bfe('0x10'));var qs=require(_0x8bfe('0x11'));var as=require(_0x8bfe('0x12'));var hardwareService=require(_0x8bfe('0x13'));var logger=require(_0x8bfe('0x14'))(_0x8bfe('0x15'));var utils=require('../../config/utils');var config=require(_0x8bfe('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x8bfe('0x17'))['db'];function respondWithStatusCode(_0x2f479d,_0x22a131){_0x22a131=_0x22a131||0xcc;return function(_0x5ba48c){if(_0x5ba48c){return _0x2f479d['sendStatus'](_0x22a131);}return _0x2f479d[_0x8bfe('0x18')](_0x22a131)[_0x8bfe('0x19')]();};}function respondWithResult(_0x22737f,_0x36fd25){_0x36fd25=_0x36fd25||0xc8;return function(_0x46c8e3){if(_0x46c8e3){return _0x22737f['status'](_0x36fd25)[_0x8bfe('0x1a')](_0x46c8e3);}};}function respondWithFilteredResult(_0x5520d7,_0x55914b){return function(_0x778f01){if(_0x778f01){var _0xe57cb1=typeof _0x55914b[_0x8bfe('0x1b')]==='undefined'&&typeof _0x55914b['limit']===_0x8bfe('0x1c');var _0x5019ba=_0x778f01['count'];var _0x2e7c29=_0xe57cb1?0x0:_0x55914b[_0x8bfe('0x1b')];var _0x5d8bf1=_0xe57cb1?_0x778f01[_0x8bfe('0x1d')]:_0x55914b[_0x8bfe('0x1b')]+_0x55914b[_0x8bfe('0x1e')];var _0x3b0837;if(_0x5d8bf1>=_0x5019ba){_0x5d8bf1=_0x5019ba;_0x3b0837=0xc8;}else{_0x3b0837=0xce;}_0x5520d7['status'](_0x3b0837);return _0x5520d7[_0x8bfe('0x1f')]('Content-Range',_0x2e7c29+'-'+_0x5d8bf1+'/'+_0x5019ba)[_0x8bfe('0x1a')](_0x778f01);}return null;};}function patchUpdates(_0x3f8050){return function(_0x3c6e7b){try{jsonpatch['apply'](_0x3c6e7b,_0x3f8050,!![]);}catch(_0x55af8c){return BPromise[_0x8bfe('0x20')](_0x55af8c);}return _0x3c6e7b['save']();};}function saveUpdates(_0x55f5bc,_0xef5e81){return function(_0x5397fb){if(_0x5397fb){return _0x5397fb[_0x8bfe('0x21')](_0x55f5bc)['then'](function(_0x34043a){return _0x34043a;});}return null;};}function removeEntity(_0x19058e,_0x42a93f){return function(_0x260dd9){if(_0x260dd9){return _0x260dd9['destroy']()[_0x8bfe('0x22')](function(){_0x19058e[_0x8bfe('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2f73d0,_0x1789f7){return function(_0x46526f){if(!_0x46526f){_0x2f73d0[_0x8bfe('0x23')](0x194);}return _0x46526f;};}function handleError(_0x2dc8d5,_0x91271f){_0x91271f=_0x91271f||0x1f4;return function(_0x4fcb3a){logger[_0x8bfe('0x24')](_0x4fcb3a[_0x8bfe('0x25')]);if(_0x4fcb3a[_0x8bfe('0x26')]){delete _0x4fcb3a[_0x8bfe('0x26')];}_0x2dc8d5[_0x8bfe('0x18')](_0x91271f)[_0x8bfe('0x27')](_0x4fcb3a);};}exports[_0x8bfe('0x28')]=function(_0x2cbfb3,_0x15fccc){var _0x2b47c6={},_0x3c6a3c={},_0x597651={'count':0x0,'rows':[]};var _0xdf4c3f=_[_0x8bfe('0x29')](db['Cdr'][_0x8bfe('0x2a')],function(_0x2e86ee){return{'name':_0x2e86ee[_0x8bfe('0x2b')],'type':_0x2e86ee['type'][_0x8bfe('0x2c')]};});_0x3c6a3c[_0x8bfe('0x2d')]=_['map'](_0xdf4c3f,'name');_0x3c6a3c[_0x8bfe('0x2e')]=_[_0x8bfe('0x2f')](_0x2cbfb3[_0x8bfe('0x2e')]);_0x3c6a3c[_0x8bfe('0x30')]=_[_0x8bfe('0x31')](_0x3c6a3c[_0x8bfe('0x2d')],_0x3c6a3c[_0x8bfe('0x2e')]);_0x2b47c6[_0x8bfe('0x32')]=_[_0x8bfe('0x31')](_0x3c6a3c[_0x8bfe('0x2d')],qs['fields'](_0x2cbfb3['query'][_0x8bfe('0x33')]));_0x2b47c6[_0x8bfe('0x32')]=_0x2b47c6[_0x8bfe('0x32')][_0x8bfe('0x34')]?_0x2b47c6[_0x8bfe('0x32')]:_0x3c6a3c[_0x8bfe('0x2d')];if(!_0x2cbfb3[_0x8bfe('0x2e')]['hasOwnProperty'](_0x8bfe('0x35'))){_0x2b47c6[_0x8bfe('0x1e')]=qs['limit'](_0x2cbfb3[_0x8bfe('0x2e')][_0x8bfe('0x1e')]);_0x2b47c6[_0x8bfe('0x1b')]=qs[_0x8bfe('0x1b')](_0x2cbfb3[_0x8bfe('0x2e')]['offset']);}_0x2b47c6[_0x8bfe('0x36')]=qs['sort'](_0x2cbfb3['query']['sort']);_0x2b47c6['where']=qs[_0x8bfe('0x30')](_[_0x8bfe('0x37')](_0x2cbfb3[_0x8bfe('0x2e')],_0x3c6a3c[_0x8bfe('0x30')]),_0xdf4c3f);if(_0x2cbfb3[_0x8bfe('0x2e')][_0x8bfe('0x38')]){_0x2b47c6[_0x8bfe('0x39')]=_['merge'](_0x2b47c6[_0x8bfe('0x39')],{'$or':_['map'](_0xdf4c3f,function(_0x5c5801){if(_0x5c5801['type']!==_0x8bfe('0x3a')){var _0x65a1a3={};_0x65a1a3[_0x5c5801[_0x8bfe('0x26')]]={'$like':'%'+_0x2cbfb3[_0x8bfe('0x2e')][_0x8bfe('0x38')]+'%'};return _0x65a1a3;}})});}_0x2b47c6=_[_0x8bfe('0x3b')]({},_0x2b47c6,_0x2cbfb3[_0x8bfe('0x3c')]);var _0x20b085={'where':_0x2b47c6['where']};return db['Cdr'][_0x8bfe('0x1d')](_0x20b085)[_0x8bfe('0x22')](function(_0x36d23c){_0x597651[_0x8bfe('0x1d')]=_0x36d23c;if(_0x2cbfb3[_0x8bfe('0x2e')][_0x8bfe('0x3d')]){_0x2b47c6[_0x8bfe('0x3e')]=[{'all':!![]}];}return db[_0x8bfe('0x3f')][_0x8bfe('0x40')](_0x2b47c6);})['then'](function(_0x62a6e2){_0x597651[_0x8bfe('0x41')]=_0x62a6e2;return _0x597651;})[_0x8bfe('0x22')](respondWithFilteredResult(_0x15fccc,_0x2b47c6))[_0x8bfe('0x42')](handleError(_0x15fccc,null));};exports[_0x8bfe('0x43')]=function(_0x234edc,_0x403456){var _0x55814c={'raw':!![],'where':{'id':_0x234edc[_0x8bfe('0x44')]['id']}},_0x25d26f={};_0x25d26f['model']=_[_0x8bfe('0x2f')](db['Cdr']['rawAttributes']);_0x25d26f[_0x8bfe('0x2e')]=_[_0x8bfe('0x2f')](_0x234edc[_0x8bfe('0x2e')]);_0x25d26f['filters']=_[_0x8bfe('0x31')](_0x25d26f['model'],_0x25d26f[_0x8bfe('0x2e')]);_0x55814c[_0x8bfe('0x32')]=_['intersection'](_0x25d26f[_0x8bfe('0x2d')],qs[_0x8bfe('0x33')](_0x234edc[_0x8bfe('0x2e')][_0x8bfe('0x33')]));_0x55814c['attributes']=_0x55814c[_0x8bfe('0x32')][_0x8bfe('0x34')]?_0x55814c[_0x8bfe('0x32')]:_0x25d26f['model'];if(_0x234edc['query'][_0x8bfe('0x3d')]){_0x55814c[_0x8bfe('0x3e')]=[{'all':!![]}];}_0x55814c=_[_0x8bfe('0x3b')]({},_0x55814c,_0x234edc[_0x8bfe('0x3c')]);return db[_0x8bfe('0x3f')][_0x8bfe('0x45')](_0x55814c)[_0x8bfe('0x22')](handleEntityNotFound(_0x403456,null))[_0x8bfe('0x22')](respondWithResult(_0x403456,null))['catch'](handleError(_0x403456,null));};exports[_0x8bfe('0x46')]=function(_0x2af8fa,_0x4e6949){return db['Cdr'][_0x8bfe('0x46')](_0x2af8fa[_0x8bfe('0x47')],{})[_0x8bfe('0x22')](respondWithResult(_0x4e6949,0xc9))['catch'](handleError(_0x4e6949,null));};exports[_0x8bfe('0x21')]=function(_0x3c4086,_0x55ad6e){if(_0x3c4086[_0x8bfe('0x47')]['id']){delete _0x3c4086[_0x8bfe('0x47')]['id'];}return db[_0x8bfe('0x3f')][_0x8bfe('0x45')]({'where':{'id':_0x3c4086[_0x8bfe('0x44')]['id']}})[_0x8bfe('0x22')](handleEntityNotFound(_0x55ad6e,null))['then'](saveUpdates(_0x3c4086['body'],null))['then'](respondWithResult(_0x55ad6e,null))['catch'](handleError(_0x55ad6e,null));};exports[_0x8bfe('0x48')]=function(_0x2b84a3,_0x36e938){return db[_0x8bfe('0x3f')][_0x8bfe('0x45')]({'where':{'id':_0x2b84a3['params']['id']}})[_0x8bfe('0x22')](handleEntityNotFound(_0x36e938,null))[_0x8bfe('0x22')](removeEntity(_0x36e938,null))[_0x8bfe('0x42')](handleError(_0x36e938,null));};exports[_0x8bfe('0x49')]=function(_0x3c6cbc,_0x43a0c5){return db['Cdr'][_0x8bfe('0x49')]()[_0x8bfe('0x22')](respondWithResult(_0x43a0c5,null))['catch'](handleError(_0x43a0c5,null));}; \ No newline at end of file +var _0x2eb2=['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','Cdr','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','show','params','includeAll','create','body','find','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse'];(function(_0x3578e4,_0x35a5e4){var _0xbee4f2=function(_0x3b075f){while(--_0x3b075f){_0x3578e4['push'](_0x3578e4['shift']());}};_0xbee4f2(++_0x35a5e4);}(_0x2eb2,0x19f));var _0x22eb=function(_0x3635ce,_0x33a6f9){_0x3635ce=_0x3635ce-0x0;var _0x97ecd0=_0x2eb2[_0x3635ce];return _0x97ecd0;};'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));};exports[_0x22eb('0x41')]=function(_0x1ff04a,_0x78b250){var _0x1bafa3={'raw':!![],'where':{'id':_0x1ff04a[_0x22eb('0x42')]['id']}},_0x82ace8={};_0x82ace8[_0x22eb('0x30')]=_[_0x22eb('0x2d')](db[_0x22eb('0x27')][_0x22eb('0x28')]);_0x82ace8[_0x22eb('0x2c')]=_[_0x22eb('0x2d')](_0x1ff04a[_0x22eb('0x2c')]);_0x82ace8['filters']=_[_0x22eb('0x2f')](_0x82ace8[_0x22eb('0x30')],_0x82ace8['query']);_0x1bafa3[_0x22eb('0x31')]=_[_0x22eb('0x2f')](_0x82ace8['model'],qs['fields'](_0x1ff04a['query'][_0x22eb('0x32')]));_0x1bafa3[_0x22eb('0x31')]=_0x1bafa3['attributes']['length']?_0x1bafa3[_0x22eb('0x31')]:_0x82ace8[_0x22eb('0x30')];if(_0x1ff04a[_0x22eb('0x2c')][_0x22eb('0x43')]){_0x1bafa3[_0x22eb('0x3e')]=[{'all':!![]}];}_0x1bafa3=_[_0x22eb('0x3c')]({},_0x1bafa3,_0x1ff04a[_0x22eb('0x3d')]);return db[_0x22eb('0x27')]['find'](_0x1bafa3)['then'](handleEntityNotFound(_0x78b250,null))[_0x22eb('0x20')](respondWithResult(_0x78b250,null))['catch'](handleError(_0x78b250,null));};exports[_0x22eb('0x44')]=function(_0x4bd819,_0x8a2b2c){return db['Cdr']['create'](_0x4bd819['body'],{})['then'](respondWithResult(_0x8a2b2c,0xc9))[_0x22eb('0x40')](handleError(_0x8a2b2c,null));};exports['update']=function(_0x320211,_0x3b35c6){if(_0x320211['body']['id']){delete _0x320211[_0x22eb('0x45')]['id'];}return db['Cdr'][_0x22eb('0x46')]({'where':{'id':_0x320211[_0x22eb('0x42')]['id']}})[_0x22eb('0x20')](handleEntityNotFound(_0x3b35c6,null))[_0x22eb('0x20')](saveUpdates(_0x320211[_0x22eb('0x45')],null))[_0x22eb('0x20')](respondWithResult(_0x3b35c6,null))[_0x22eb('0x40')](handleError(_0x3b35c6,null));};exports[_0x22eb('0x21')]=function(_0x11942d,_0x527ef1){return db[_0x22eb('0x27')][_0x22eb('0x46')]({'where':{'id':_0x11942d['params']['id']}})[_0x22eb('0x20')](handleEntityNotFound(_0x527ef1,null))[_0x22eb('0x20')](removeEntity(_0x527ef1,null))[_0x22eb('0x40')](handleError(_0x527ef1,null));};exports[_0x22eb('0x47')]=function(_0x4fee5c,_0x6c0600){return db[_0x22eb('0x27')][_0x22eb('0x47')]()[_0x22eb('0x20')](respondWithResult(_0x6c0600,null))[_0x22eb('0x40')](handleError(_0x6c0600,null));}; \ No newline at end of file diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js index 6fd3836..5c81bb2 100644 --- a/server/api/cdr/cdr.model.js +++ b/server/api/cdr/cdr.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['Cdr','cdr','accountcode','disposition','dst','src','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./cdr.attributes','exports'];(function(_0xe61cf5,_0x3e8e50){var _0x55f504=function(_0x13afbf){while(--_0x13afbf){_0xe61cf5['push'](_0xe61cf5['shift']());}};_0x55f504(++_0x3e8e50);}(_0x7a54,0x106));var _0x47a5=function(_0x22c824,_0x3d158d){_0x22c824=_0x22c824-0x0;var _0x167e47=_0x7a54[_0x22c824];return _0x167e47;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[{'name':'accountcode','fields':[_0x47a5('0xc')]},{'name':'calldate','fields':['calldate']},{'name':'disposition','fields':[_0x47a5('0xd')]},{'name':_0x47a5('0xe'),'fields':['dst']},{'name':_0x47a5('0xf'),'fields':['src']},{'name':'uniqueid','fields':[_0x47a5('0x10')]}],'timestamps':![]});}; \ No newline at end of file +var _0x9957=['dst','src','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./cdr.attributes','exports','define','Cdr','accountcode','calldate','disposition'];(function(_0x506976,_0xd925ad){var _0x38d9fa=function(_0x5d49b4){while(--_0x5d49b4){_0x506976['push'](_0x506976['shift']());}};_0x38d9fa(++_0xd925ad);}(_0x9957,0x93));var _0x7995=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x9957[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'cdr','paranoid':![],'indexes':[{'name':_0x7995('0xc'),'fields':[_0x7995('0xc')]},{'name':'calldate','fields':[_0x7995('0xd')]},{'name':_0x7995('0xe'),'fields':[_0x7995('0xe')]},{'name':_0x7995('0xf'),'fields':[_0x7995('0xf')]},{'name':_0x7995('0x10'),'fields':[_0x7995('0x10')]},{'name':'uniqueid','fields':[_0x7995('0x11')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/cdr/cdr.rpc.js b/server/api/cdr/cdr.rpc.js index a43d1c1..5eb742a 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 _0x868b=['info','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/environment','jayson/promise','client','http','request','Cdr,\x20%s,\x20%s','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x868b,0x14d));var _0xb868=function(_0x57e28d,_0x3eda3d){_0x57e28d=_0x57e28d-0x0;var _0x4d6b64=_0x868b[_0x57e28d];return _0x4d6b64;};'use strict';var _=require(_0xb868('0x0'));var util=require(_0xb868('0x1'));var moment=require(_0xb868('0x2'));var BPromise=require(_0xb868('0x3'));var rs=require(_0xb868('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb868('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xb868('0x6'));var jayson=require(_0xb868('0x7'));var client=jayson[_0xb868('0x8')][_0xb868('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4c3eec,_0x495094,_0x1da3f4){return new BPromise(function(_0x309dd0,_0x2e3b63){return client[_0xb868('0xa')](_0x4c3eec,_0x1da3f4)['then'](function(_0x5b1bf4){logger['info'](_0xb868('0xb'),_0x495094,_0xb868('0xc'));logger[_0xb868('0xd')](_0xb868('0xe'),_0x495094,_0xb868('0xc'),JSON[_0xb868('0xf')](_0x5b1bf4));if(_0x5b1bf4['error']){if(_0x5b1bf4[_0xb868('0x10')][_0xb868('0x11')]===0x1f4){logger[_0xb868('0x10')](_0xb868('0xb'),_0x495094,_0x5b1bf4[_0xb868('0x10')][_0xb868('0x12')]);return _0x2e3b63(_0x5b1bf4[_0xb868('0x10')][_0xb868('0x12')]);}logger[_0xb868('0x10')](_0xb868('0xb'),_0x495094,_0x5b1bf4[_0xb868('0x10')]['message']);return _0x309dd0(_0x5b1bf4[_0xb868('0x10')][_0xb868('0x12')]);}else{logger[_0xb868('0x13')](_0xb868('0xb'),_0x495094,'request\x20sent');_0x309dd0(_0x5b1bf4[_0xb868('0x14')][_0xb868('0x12')]);}})[_0xb868('0x15')](function(_0x3954e1){logger[_0xb868('0x10')](_0xb868('0xb'),_0x495094,_0x3954e1);_0x2e3b63(_0x3954e1);});});} \ No newline at end of file +var _0x5883=['error','message','info','result','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','Cdr,\x20%s,\x20%s','request\x20sent','debug','stringify'];(function(_0x1dc1ba,_0x11a7de){var _0x53fb47=function(_0x251f4){while(--_0x251f4){_0x1dc1ba['push'](_0x1dc1ba['shift']());}};_0x53fb47(++_0x11a7de);}(_0x5883,0x115));var _0x3588=function(_0x5b3db1,_0x2cbd7c){_0x5b3db1=_0x5b3db1-0x0;var _0x3817a4=_0x5883[_0x5b3db1];return _0x3817a4;};'use strict';var _=require(_0x3588('0x0'));var util=require('util');var moment=require(_0x3588('0x1'));var BPromise=require(_0x3588('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3588('0x3'));var db=require(_0x3588('0x4'))['db'];var utils=require(_0x3588('0x5'));var logger=require(_0x3588('0x6'))(_0x3588('0x7'));var config=require(_0x3588('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x3588('0x9')][_0x3588('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2ea846,_0x4afa0e,_0x4378dc){return new BPromise(function(_0x17a70b,_0x7ef363){return client[_0x3588('0xb')](_0x2ea846,_0x4378dc)[_0x3588('0xc')](function(_0x3db838){logger['info'](_0x3588('0xd'),_0x4afa0e,_0x3588('0xe'));logger[_0x3588('0xf')]('Cdr,\x20%s,\x20%s,\x20%s',_0x4afa0e,_0x3588('0xe'),JSON[_0x3588('0x10')](_0x3db838));if(_0x3db838[_0x3588('0x11')]){if(_0x3db838[_0x3588('0x11')]['code']===0x1f4){logger['error'](_0x3588('0xd'),_0x4afa0e,_0x3db838[_0x3588('0x11')][_0x3588('0x12')]);return _0x7ef363(_0x3db838[_0x3588('0x11')]['message']);}logger[_0x3588('0x11')](_0x3588('0xd'),_0x4afa0e,_0x3db838[_0x3588('0x11')][_0x3588('0x12')]);return _0x17a70b(_0x3db838[_0x3588('0x11')][_0x3588('0x12')]);}else{logger[_0x3588('0x13')](_0x3588('0xd'),_0x4afa0e,_0x3588('0xe'));_0x17a70b(_0x3db838[_0x3588('0x14')][_0x3588('0x12')]);}})['catch'](function(_0x535b9e){logger['error'](_0x3588('0xd'),_0x4afa0e,_0x535b9e);_0x7ef363(_0x535b9e);});});} \ No newline at end of file diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js index b86458f..dbfd9f3 100644 --- a/server/api/cdr/index.js +++ b/server/api/cdr/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['../../components/interaction/service','../../config/environment','./cdr.controller','get','index','isAuthenticated','describe','/:id','show','post','update','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x15e0cc,_0x5c7691){var _0x5f0e6e=function(_0x19342d){while(--_0x19342d){_0x15e0cc['push'](_0x15e0cc['shift']());}};_0x5f0e6e(++_0x5c7691);}(_0xb10b,0x12a));var _0xbb10=function(_0xbcbd76,_0x25722b){_0xbcbd76=_0xbcbd76-0x0;var _0x503680=_0xb10b[_0xbcbd76];return _0x503680;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var fs_extra=require(_0xbb10('0x4'));var auth=require(_0xbb10('0x5'));var interaction=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var controller=require(_0xbb10('0x8'));router[_0xbb10('0x9')]('/',auth['isAuthenticated'](),controller[_0xbb10('0xa')]);router[_0xbb10('0x9')]('/describe',auth[_0xbb10('0xb')](),controller[_0xbb10('0xc')]);router[_0xbb10('0x9')](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0xf')]('/',auth[_0xbb10('0xb')](),controller['create']);router['put'](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x10')]);router['delete'](_0xbb10('0xd'),auth['isAuthenticated'](),controller[_0xbb10('0x11')]);module[_0xbb10('0x12')]=router; \ No newline at end of file +var _0xd8b0=['destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','create','put','update'];(function(_0x2f5fcb,_0x4df21e){var _0x2fc15e=function(_0x2f4fb6){while(--_0x2f4fb6){_0x2f5fcb['push'](_0x2f5fcb['shift']());}};_0x2fc15e(++_0x4df21e);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./cdr.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.attributes.js b/server/api/chatApplication/chatApplication.attributes.js index f083835..5f67357 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 _0x29e6=['exports','INTEGER','noop','TEXT','STRING','*,*,*,*'];(function(_0x5e3b04,_0xbb6795){var _0x1fc44d=function(_0x3472a1){while(--_0x3472a1){_0x5e3b04['push'](_0x5e3b04['shift']());}};_0x1fc44d(++_0xbb6795);}(_0x29e6,0x1a4));var _0x629e=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x29e6[_0x4b369d];return _0x571a98;};'use strict';var Sequelize=require('sequelize');module[_0x629e('0x0')]={'priority':{'type':Sequelize[_0x629e('0x1')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x629e('0x2')},'appdata':{'type':Sequelize[_0x629e('0x3')]()},'description':{'type':Sequelize[_0x629e('0x4')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x629e('0x5')}}; \ No newline at end of file +var _0x761c=['sequelize','TEXT','STRING','*,*,*,*'];(function(_0x263a74,_0xc31414){var _0x2aa86c=function(_0x382896){while(--_0x382896){_0x263a74['push'](_0x263a74['shift']());}};_0x2aa86c(++_0xc31414);}(_0x761c,0xb4));var _0xc761=function(_0x22a3b9,_0x267058){_0x22a3b9=_0x22a3b9-0x0;var _0x47b9e5=_0x761c[_0x22a3b9];return _0x47b9e5;};'use strict';var Sequelize=require(_0xc761('0x0'));module['exports']={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0xc761('0x1')]()},'description':{'type':Sequelize[_0xc761('0x2')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0xc761('0x3')}}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js index c09acae..b1f94e9 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 _0xaa88=['limit','count','set','apply','reject','then','stack','name','send','params','model','keys','ChatApplication','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(_0x5d7227,_0x12aebe){_0x5d7227=_0x5d7227-0x0;var _0x15ac55=_0xaa88[_0x5d7227];return _0x15ac55;};'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['ChatApplication'][_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['ChatApplication'][_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 _0x0102=['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','end','status','json','offset','undefined','limit','count','set','apply','reject','save','sendStatus','error','stack','name','send','show','params','model','keys','ChatApplication','filters','intersection','query','attributes','fields','includeAll','options','find','then','body','catch','destroy','rimraf','zip-dir','fast-json-patch','request-promise','sox','to-csv','ejs','fs-extra','squel'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0102,0x186));var _0x2010=function(_0x136587,_0xbd50a){_0x136587=_0x136587-0x0;var _0x3367fa=_0x0102[_0x136587];return _0x3367fa;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2010('0x0'));var zipdir=require(_0x2010('0x1'));var jsonpatch=require(_0x2010('0x2'));var rp=require(_0x2010('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x2010('0x4'));var csv=require(_0x2010('0x5'));var ejs=require(_0x2010('0x6'));var fs=require('fs');var fs_extra=require(_0x2010('0x7'));var _=require('lodash');var squel=require(_0x2010('0x8'));var crypto=require('crypto');var jsforce=require(_0x2010('0x9'));var deskjs=require(_0x2010('0xa'));var toCsv=require('to-csv');var querystring=require(_0x2010('0xb'));var Papa=require(_0x2010('0xc'));var Redis=require(_0x2010('0xd'));var authService=require(_0x2010('0xe'));var qs=require(_0x2010('0xf'));var as=require(_0x2010('0x10'));var hardwareService=require(_0x2010('0x11'));var logger=require(_0x2010('0x12'))(_0x2010('0x13'));var utils=require(_0x2010('0x14'));var config=require(_0x2010('0x15'));var licenseUtil=require(_0x2010('0x16'));var db=require(_0x2010('0x17'))['db'];function respondWithStatusCode(_0x3f307c,_0x3e8624){_0x3e8624=_0x3e8624||0xcc;return function(_0x388991){if(_0x388991){return _0x3f307c['sendStatus'](_0x3e8624);}return _0x3f307c['status'](_0x3e8624)[_0x2010('0x18')]();};}function respondWithResult(_0x385720,_0x2e8ec2){_0x2e8ec2=_0x2e8ec2||0xc8;return function(_0x10b587){if(_0x10b587){return _0x385720[_0x2010('0x19')](_0x2e8ec2)[_0x2010('0x1a')](_0x10b587);}};}function respondWithFilteredResult(_0x517ff4,_0x3195fa){return function(_0x136418){if(_0x136418){var _0x5ad412=typeof _0x3195fa[_0x2010('0x1b')]===_0x2010('0x1c')&&typeof _0x3195fa[_0x2010('0x1d')]===_0x2010('0x1c');var _0x2d0bf2=_0x136418[_0x2010('0x1e')];var _0x83cd35=_0x5ad412?0x0:_0x3195fa[_0x2010('0x1b')];var _0x309477=_0x5ad412?_0x136418['count']:_0x3195fa['offset']+_0x3195fa[_0x2010('0x1d')];var _0x38a15a;if(_0x309477>=_0x2d0bf2){_0x309477=_0x2d0bf2;_0x38a15a=0xc8;}else{_0x38a15a=0xce;}_0x517ff4[_0x2010('0x19')](_0x38a15a);return _0x517ff4[_0x2010('0x1f')]('Content-Range',_0x83cd35+'-'+_0x309477+'/'+_0x2d0bf2)['json'](_0x136418);}return null;};}function patchUpdates(_0x22c252){return function(_0x171e45){try{jsonpatch[_0x2010('0x20')](_0x171e45,_0x22c252,!![]);}catch(_0x26facc){return BPromise[_0x2010('0x21')](_0x26facc);}return _0x171e45[_0x2010('0x22')]();};}function saveUpdates(_0x4f621c,_0x3db13d){return function(_0x1cfa57){if(_0x1cfa57){return _0x1cfa57['update'](_0x4f621c)['then'](function(_0x50aecc){return _0x50aecc;});}return null;};}function removeEntity(_0x424453,_0x574719){return function(_0x277dcc){if(_0x277dcc){return _0x277dcc['destroy']()['then'](function(){_0x424453[_0x2010('0x19')](0xcc)[_0x2010('0x18')]();});}};}function handleEntityNotFound(_0x52b4fe,_0x99ebe0){return function(_0x4cff59){if(!_0x4cff59){_0x52b4fe[_0x2010('0x23')](0x194);}return _0x4cff59;};}function handleError(_0x27b425,_0x3929d9){_0x3929d9=_0x3929d9||0x1f4;return function(_0x3dcea4){logger[_0x2010('0x24')](_0x3dcea4[_0x2010('0x25')]);if(_0x3dcea4[_0x2010('0x26')]){delete _0x3dcea4[_0x2010('0x26')];}_0x27b425[_0x2010('0x19')](_0x3929d9)[_0x2010('0x27')](_0x3dcea4);};}exports[_0x2010('0x28')]=function(_0x2ebdbb,_0x499cbe){var _0x2a4691={'raw':!![],'where':{'id':_0x2ebdbb[_0x2010('0x29')]['id']}},_0x52fe5e={};_0x52fe5e[_0x2010('0x2a')]=_[_0x2010('0x2b')](db[_0x2010('0x2c')]['rawAttributes']);_0x52fe5e['query']=_[_0x2010('0x2b')](_0x2ebdbb['query']);_0x52fe5e[_0x2010('0x2d')]=_[_0x2010('0x2e')](_0x52fe5e['model'],_0x52fe5e[_0x2010('0x2f')]);_0x2a4691[_0x2010('0x30')]=_[_0x2010('0x2e')](_0x52fe5e[_0x2010('0x2a')],qs[_0x2010('0x31')](_0x2ebdbb['query'][_0x2010('0x31')]));_0x2a4691[_0x2010('0x30')]=_0x2a4691[_0x2010('0x30')]['length']?_0x2a4691['attributes']:_0x52fe5e[_0x2010('0x2a')];if(_0x2ebdbb[_0x2010('0x2f')][_0x2010('0x32')]){_0x2a4691['include']=[{'all':!![]}];}_0x2a4691=_['merge']({},_0x2a4691,_0x2ebdbb[_0x2010('0x33')]);return db[_0x2010('0x2c')][_0x2010('0x34')](_0x2a4691)[_0x2010('0x35')](handleEntityNotFound(_0x499cbe,null))[_0x2010('0x35')](respondWithResult(_0x499cbe,null))['catch'](handleError(_0x499cbe,null));};exports['update']=function(_0x554c5e,_0x238129){if(_0x554c5e[_0x2010('0x36')]['id']){delete _0x554c5e[_0x2010('0x36')]['id'];}return db['ChatApplication'][_0x2010('0x34')]({'where':{'id':_0x554c5e[_0x2010('0x29')]['id']}})[_0x2010('0x35')](handleEntityNotFound(_0x238129,null))[_0x2010('0x35')](saveUpdates(_0x554c5e['body'],null))[_0x2010('0x35')](respondWithResult(_0x238129,null))[_0x2010('0x37')](handleError(_0x238129,null));};exports[_0x2010('0x38')]=function(_0x56bba9,_0x232d86){return db['ChatApplication'][_0x2010('0x34')]({'where':{'id':_0x56bba9[_0x2010('0x29')]['id']}})[_0x2010('0x35')](handleEntityNotFound(_0x232d86,null))[_0x2010('0x35')](removeEntity(_0x232d86,null))[_0x2010('0x37')](handleError(_0x232d86,null));}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js index d165687..c4356a4 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 _0xb2b1=['path','rimraf','exports','define','ChatApplication','chat_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x4ff200,_0x18c0e7){var _0x58c916=function(_0x41451c){while(--_0x41451c){_0x4ff200['push'](_0x4ff200['shift']());}};_0x58c916(++_0x18c0e7);}(_0xb2b1,0x190));var _0x1b2b=function(_0x3a9b11,_0xb6c98){_0x3a9b11=_0x3a9b11-0x0;var _0x5e6324=_0xb2b1[_0x3a9b11];return _0x5e6324;};'use strict';var _=require(_0x1b2b('0x0'));var util=require(_0x1b2b('0x1'));var logger=require(_0x1b2b('0x2'))(_0x1b2b('0x3'));var moment=require(_0x1b2b('0x4'));var BPromise=require(_0x1b2b('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1b2b('0x6'));var rimraf=require(_0x1b2b('0x7'));var config=require('../../config/environment');var attributes=require('./chatApplication.attributes');module[_0x1b2b('0x8')]=function(_0x298b57,_0x4587ba){return _0x298b57[_0x1b2b('0x9')](_0x1b2b('0xa'),attributes,{'tableName':_0x1b2b('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x1b2b('0xc'),'collate':_0x1b2b('0xd')});}; \ No newline at end of file +var _0x1cb0=['moment','bluebird','request-promise','path','rimraf','../../config/environment','define','ChatApplication','chat_applications','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api'];(function(_0x7d250e,_0x1ccc72){var _0x1fe269=function(_0x5781cc){while(--_0x5781cc){_0x7d250e['push'](_0x7d250e['shift']());}};_0x1fe269(++_0x1ccc72);}(_0x1cb0,0x1d9));var _0x01cb=function(_0x591af8,_0x129771){_0x591af8=_0x591af8-0x0;var _0x25d1ce=_0x1cb0[_0x591af8];return _0x25d1ce;};'use strict';var _=require('lodash');var util=require(_0x01cb('0x0'));var logger=require(_0x01cb('0x1'))(_0x01cb('0x2'));var moment=require(_0x01cb('0x3'));var BPromise=require(_0x01cb('0x4'));var rp=require(_0x01cb('0x5'));var fs=require('fs');var path=require(_0x01cb('0x6'));var rimraf=require(_0x01cb('0x7'));var config=require(_0x01cb('0x8'));var attributes=require('./chatApplication.attributes');module['exports']=function(_0x296500,_0x26213f){return _0x296500[_0x01cb('0x9')](_0x01cb('0xa'),attributes,{'tableName':_0x01cb('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x01cb('0xc'),'collate':_0x01cb('0xd')});}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js index 360b176..6d58f40 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 _0x8214=['ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','info','ChatApplication,\x20%s,\x20%s','request\x20sent','ChatApplication,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','randomstring'];(function(_0x244f8a,_0x55ed63){var _0x1d805e=function(_0x36198d){while(--_0x36198d){_0x244f8a['push'](_0x244f8a['shift']());}};_0x1d805e(++_0x55ed63);}(_0x8214,0x188));var _0x4821=function(_0x146acc,_0x347b28){_0x146acc=_0x146acc-0x0;var _0x443ab5=_0x8214[_0x146acc];return _0x443ab5;};'use strict';var _=require(_0x4821('0x0'));var util=require(_0x4821('0x1'));var moment=require(_0x4821('0x2'));var BPromise=require('bluebird');var rs=require(_0x4821('0x3'));var fs=require('fs');var Redis=require(_0x4821('0x4'));var db=require(_0x4821('0x5'))['db'];var utils=require(_0x4821('0x6'));var logger=require(_0x4821('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x4821('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1fded0,_0x778124,_0x3c783a){return new BPromise(function(_0x411dd9,_0x3705cf){return client['request'](_0x1fded0,_0x3c783a)['then'](function(_0x2d6a86){logger[_0x4821('0x9')](_0x4821('0xa'),_0x778124,_0x4821('0xb'));logger['debug'](_0x4821('0xc'),_0x778124,'request\x20sent',JSON['stringify'](_0x2d6a86));if(_0x2d6a86['error']){if(_0x2d6a86[_0x4821('0xd')][_0x4821('0xe')]===0x1f4){logger['error'](_0x4821('0xa'),_0x778124,_0x2d6a86[_0x4821('0xd')][_0x4821('0xf')]);return _0x3705cf(_0x2d6a86[_0x4821('0xd')][_0x4821('0xf')]);}logger['error'](_0x4821('0xa'),_0x778124,_0x2d6a86['error'][_0x4821('0xf')]);return _0x411dd9(_0x2d6a86[_0x4821('0xd')]['message']);}else{logger[_0x4821('0x9')](_0x4821('0xa'),_0x778124,_0x4821('0xb'));_0x411dd9(_0x2d6a86[_0x4821('0x10')][_0x4821('0xf')]);}})[_0x4821('0x11')](function(_0x1e9aaf){logger[_0x4821('0xd')](_0x4821('0xa'),_0x778124,_0x1e9aaf);_0x3705cf(_0x1e9aaf);});});} \ No newline at end of file +var _0x62c2=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','info','ChatApplication,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','ChatApplication,\x20%s,\x20%s','message','result','lodash','util','moment','bluebird','randomstring'];(function(_0x40fede,_0x203a11){var _0x482694=function(_0x4b7fa0){while(--_0x4b7fa0){_0x40fede['push'](_0x40fede['shift']());}};_0x482694(++_0x203a11);}(_0x62c2,0x1f3));var _0x262c=function(_0x39589e,_0x471f86){_0x39589e=_0x39589e-0x0;var _0x3ff17f=_0x62c2[_0x39589e];return _0x3ff17f;};'use strict';var _=require(_0x262c('0x0'));var util=require(_0x262c('0x1'));var moment=require(_0x262c('0x2'));var BPromise=require(_0x262c('0x3'));var rs=require(_0x262c('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x262c('0x5'))['db'];var utils=require(_0x262c('0x6'));var logger=require(_0x262c('0x7'))(_0x262c('0x8'));var config=require(_0x262c('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x262c('0xa')][_0x262c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3297fa,_0x43241c,_0x3a0646){return new BPromise(function(_0x12606c,_0x162530){return client['request'](_0x3297fa,_0x3a0646)[_0x262c('0xc')](function(_0xe90902){logger[_0x262c('0xd')]('ChatApplication,\x20%s,\x20%s',_0x43241c,'request\x20sent');logger['debug'](_0x262c('0xe'),_0x43241c,_0x262c('0xf'),JSON['stringify'](_0xe90902));if(_0xe90902[_0x262c('0x10')]){if(_0xe90902[_0x262c('0x10')][_0x262c('0x11')]===0x1f4){logger['error']('ChatApplication,\x20%s,\x20%s',_0x43241c,_0xe90902['error']['message']);return _0x162530(_0xe90902['error']['message']);}logger[_0x262c('0x10')](_0x262c('0x12'),_0x43241c,_0xe90902['error'][_0x262c('0x13')]);return _0x12606c(_0xe90902['error'][_0x262c('0x13')]);}else{logger['info'](_0x262c('0x12'),_0x43241c,'request\x20sent');_0x12606c(_0xe90902[_0x262c('0x14')][_0x262c('0x13')]);}})['catch'](function(_0x571918){logger[_0x262c('0x10')](_0x262c('0x12'),_0x43241c,_0x571918);_0x162530(_0x571918);});});} \ No newline at end of file diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js index 486d7a9..3dc4824 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 _0x8c1d=['destroy','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatApplication.controller','get','/:id','isAuthenticated','show','put','update','delete'];(function(_0xac15c3,_0x2451ea){var _0x3ef3db=function(_0x361906){while(--_0x361906){_0xac15c3['push'](_0xac15c3['shift']());}};_0x3ef3db(++_0x2451ea);}(_0x8c1d,0x100));var _0xd8c1=function(_0x48289b,_0x213d0b){_0x48289b=_0x48289b-0x0;var _0x5812c2=_0x8c1d[_0x48289b];return _0x5812c2;};'use strict';var multer=require(_0xd8c1('0x0'));var util=require(_0xd8c1('0x1'));var path=require('path');var timeout=require(_0xd8c1('0x2'));var express=require(_0xd8c1('0x3'));var router=express[_0xd8c1('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xd8c1('0x5'));var interaction=require(_0xd8c1('0x6'));var config=require(_0xd8c1('0x7'));var controller=require(_0xd8c1('0x8'));router[_0xd8c1('0x9')](_0xd8c1('0xa'),auth[_0xd8c1('0xb')](),controller[_0xd8c1('0xc')]);router[_0xd8c1('0xd')](_0xd8c1('0xa'),auth[_0xd8c1('0xb')](),controller[_0xd8c1('0xe')]);router[_0xd8c1('0xf')](_0xd8c1('0xa'),auth[_0xd8c1('0xb')](),controller[_0xd8c1('0x10')]);module['exports']=router; \ No newline at end of file +var _0x98d2=['isAuthenticated','destroy','exports','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatApplication.controller','get','show','put','/:id','update','delete'];(function(_0x39c641,_0xd05eb4){var _0x53f283=function(_0x1f5b42){while(--_0x1f5b42){_0x39c641['push'](_0x39c641['shift']());}};_0x53f283(++_0xd05eb4);}(_0x98d2,0x18a));var _0x298d=function(_0x406e46,_0x5799cb){_0x406e46=_0x406e46-0x0;var _0x4a3742=_0x98d2[_0x406e46];return _0x4a3742;};'use strict';var multer=require('multer');var util=require(_0x298d('0x0'));var path=require(_0x298d('0x1'));var timeout=require(_0x298d('0x2'));var express=require(_0x298d('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x298d('0x4'));var interaction=require(_0x298d('0x5'));var config=require(_0x298d('0x6'));var controller=require(_0x298d('0x7'));router[_0x298d('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x298d('0x9')]);router[_0x298d('0xa')](_0x298d('0xb'),auth['isAuthenticated'](),controller[_0x298d('0xc')]);router[_0x298d('0xd')](_0x298d('0xb'),auth[_0x298d('0xe')](),controller[_0x298d('0xf')]);module[_0x298d('0x10')]=router; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js index f64bb80..3035b97 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 _0xab00=['BOOLEAN','sequelize','exports','STRING'];(function(_0x33e6be,_0x4207eb){var _0x4e2008=function(_0x8fe8ba){while(--_0x8fe8ba){_0x33e6be['push'](_0x33e6be['shift']());}};_0x4e2008(++_0x4207eb);}(_0xab00,0x1b9));var _0x0ab0=function(_0x511a63,_0x12e112){_0x511a63=_0x511a63-0x0;var _0x37d626=_0xab00[_0x511a63];return _0x37d626;};'use strict';var Sequelize=require(_0x0ab0('0x0'));module[_0x0ab0('0x1')]={'name':{'type':Sequelize[_0x0ab0('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'write':{'type':Sequelize[_0x0ab0('0x3')],'defaultValue':!![]}}; \ No newline at end of file +var _0x0d7e=['BOOLEAN','STRING'];(function(_0x45783c,_0x49c56d){var _0x1161da=function(_0x3c5d41){while(--_0x3c5d41){_0x45783c['push'](_0x45783c['shift']());}};_0x1161da(++_0x49c56d);}(_0x0d7e,0x167));var _0xe0d7=function(_0x1fff42,_0x5b2aa0){_0x1fff42=_0x1fff42-0x0;var _0x2e58b7=_0x0d7e[_0x1fff42];return _0x2e58b7;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xe0d7('0x0')],'allowNull':![]},'description':{'type':Sequelize[_0xe0d7('0x0')]},'write':{'type':Sequelize[_0xe0d7('0x1')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.controller.js b/server/api/chatGroup/chatGroup.controller.js index 8b0f99d..6b13c02 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 _0x83f5=['defaults','localhost','socket.io-emitter','./chatGroup.socket','register','sendStatus','status','end','json','undefined','offset','count','limit','Content-Range','apply','reject','update','destroy','then','error','stack','name','send','index','map','ChatGroup','type','model','intersection','query','fields','attributes','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','params','rawAttributes','keys','length','find','catch','create','body','describe','getUnread','ChatInternalMessage','user','addMembers','ids','omit','findOne','User','getMembers','removeMembers','addMessage','ChatGroupId','getMessages','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis'];(function(_0x22fc1d,_0x5b8ee1){var _0x29e032=function(_0x69e18a){while(--_0x69e18a){_0x22fc1d['push'](_0x22fc1d['shift']());}};_0x29e032(++_0x5b8ee1);}(_0x83f5,0x111));var _0x583f=function(_0x5cabad,_0x35c8cc){_0x5cabad=_0x5cabad-0x0;var _0x50287a=_0x83f5[_0x5cabad];return _0x50287a;};'use strict';var emlformat=require(_0x583f('0x0'));var rimraf=require(_0x583f('0x1'));var zipdir=require(_0x583f('0x2'));var jsonpatch=require(_0x583f('0x3'));var rp=require(_0x583f('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x583f('0x5'));var util=require(_0x583f('0x6'));var path=require(_0x583f('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x583f('0x8'));var fs=require('fs');var fs_extra=require(_0x583f('0x9'));var _=require(_0x583f('0xa'));var squel=require(_0x583f('0xb'));var crypto=require('crypto');var jsforce=require(_0x583f('0xc'));var deskjs=require(_0x583f('0xd'));var toCsv=require('to-csv');var querystring=require(_0x583f('0xe'));var Papa=require(_0x583f('0xf'));var Redis=require(_0x583f('0x10'));var authService=require(_0x583f('0x11'));var qs=require(_0x583f('0x12'));var as=require(_0x583f('0x13'));var hardwareService=require(_0x583f('0x14'));var logger=require(_0x583f('0x15'))(_0x583f('0x16'));var utils=require(_0x583f('0x17'));var config=require(_0x583f('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x583f('0x19'))['db'];config[_0x583f('0x1a')]=_[_0x583f('0x1b')](config[_0x583f('0x1a')],{'host':_0x583f('0x1c'),'port':0x18eb});var socket=require(_0x583f('0x1d'))(new Redis(config[_0x583f('0x1a')]));require(_0x583f('0x1e'))[_0x583f('0x1f')](socket);function respondWithStatusCode(_0x1c9942,_0x567e50){_0x567e50=_0x567e50||0xcc;return function(_0x415dfe){if(_0x415dfe){return _0x1c9942[_0x583f('0x20')](_0x567e50);}return _0x1c9942[_0x583f('0x21')](_0x567e50)[_0x583f('0x22')]();};}function respondWithResult(_0x382d48,_0x4bcfb7){_0x4bcfb7=_0x4bcfb7||0xc8;return function(_0x41cb87){if(_0x41cb87){return _0x382d48[_0x583f('0x21')](_0x4bcfb7)[_0x583f('0x23')](_0x41cb87);}};}function respondWithFilteredResult(_0x583380,_0x513e0a){return function(_0x2495f3){if(_0x2495f3){var _0x34cdba=typeof _0x513e0a['offset']==='undefined'&&typeof _0x513e0a['limit']===_0x583f('0x24');var _0x5e6f94=_0x2495f3['count'];var _0x559cd4=_0x34cdba?0x0:_0x513e0a[_0x583f('0x25')];var _0x4e1577=_0x34cdba?_0x2495f3[_0x583f('0x26')]:_0x513e0a[_0x583f('0x25')]+_0x513e0a[_0x583f('0x27')];var _0x1b2b2d;if(_0x4e1577>=_0x5e6f94){_0x4e1577=_0x5e6f94;_0x1b2b2d=0xc8;}else{_0x1b2b2d=0xce;}_0x583380[_0x583f('0x21')](_0x1b2b2d);return _0x583380['set'](_0x583f('0x28'),_0x559cd4+'-'+_0x4e1577+'/'+_0x5e6f94)[_0x583f('0x23')](_0x2495f3);}return null;};}function patchUpdates(_0x356e3e){return function(_0x3e4ebb){try{jsonpatch[_0x583f('0x29')](_0x3e4ebb,_0x356e3e,!![]);}catch(_0x59ecf4){return BPromise[_0x583f('0x2a')](_0x59ecf4);}return _0x3e4ebb['save']();};}function saveUpdates(_0x4d8024,_0xbf623d){return function(_0x51343a){if(_0x51343a){return _0x51343a[_0x583f('0x2b')](_0x4d8024)['then'](function(_0x3abfb0){return _0x3abfb0;});}return null;};}function removeEntity(_0x47f28d,_0x28d9ee){return function(_0x5d4ba3){if(_0x5d4ba3){return _0x5d4ba3[_0x583f('0x2c')]()[_0x583f('0x2d')](function(){_0x47f28d[_0x583f('0x21')](0xcc)[_0x583f('0x22')]();});}};}function handleEntityNotFound(_0x508dfd,_0x1726ac){return function(_0x36876d){if(!_0x36876d){_0x508dfd[_0x583f('0x20')](0x194);}return _0x36876d;};}function handleError(_0x1c89cc,_0x5a042b){_0x5a042b=_0x5a042b||0x1f4;return function(_0x3bab08){logger[_0x583f('0x2e')](_0x3bab08[_0x583f('0x2f')]);if(_0x3bab08[_0x583f('0x30')]){delete _0x3bab08['name'];}_0x1c89cc[_0x583f('0x21')](_0x5a042b)[_0x583f('0x31')](_0x3bab08);};}exports[_0x583f('0x32')]=function(_0x49b24f,_0x1eafec){var _0x569c62={},_0x5b08df={},_0x1230cf={'count':0x0,'rows':[]};var _0xe46b33=_[_0x583f('0x33')](db[_0x583f('0x34')]['rawAttributes'],function(_0x3c9919){return{'name':_0x3c9919['fieldName'],'type':_0x3c9919[_0x583f('0x35')]['key']};});_0x5b08df[_0x583f('0x36')]=_['map'](_0xe46b33,_0x583f('0x30'));_0x5b08df['query']=_['keys'](_0x49b24f['query']);_0x5b08df['filters']=_[_0x583f('0x37')](_0x5b08df['model'],_0x5b08df[_0x583f('0x38')]);_0x569c62['attributes']=_['intersection'](_0x5b08df[_0x583f('0x36')],qs[_0x583f('0x39')](_0x49b24f[_0x583f('0x38')][_0x583f('0x39')]));_0x569c62[_0x583f('0x3a')]=_0x569c62[_0x583f('0x3a')]['length']?_0x569c62[_0x583f('0x3a')]:_0x5b08df[_0x583f('0x36')];if(!_0x49b24f[_0x583f('0x38')][_0x583f('0x3b')](_0x583f('0x3c'))){_0x569c62[_0x583f('0x27')]=qs[_0x583f('0x27')](_0x49b24f['query'][_0x583f('0x27')]);_0x569c62['offset']=qs[_0x583f('0x25')](_0x49b24f[_0x583f('0x38')]['offset']);}_0x569c62[_0x583f('0x3d')]=qs[_0x583f('0x3e')](_0x49b24f[_0x583f('0x38')][_0x583f('0x3e')]);_0x569c62['where']=qs[_0x583f('0x3f')](_[_0x583f('0x40')](_0x49b24f[_0x583f('0x38')],_0x5b08df[_0x583f('0x3f')]),_0xe46b33);if(_0x49b24f[_0x583f('0x38')][_0x583f('0x41')]){_0x569c62[_0x583f('0x42')]=_[_0x583f('0x43')](_0x569c62[_0x583f('0x42')],{'$or':_[_0x583f('0x33')](_0xe46b33,function(_0x3f7d28){if(_0x3f7d28[_0x583f('0x35')]!==_0x583f('0x44')){var _0x3cdc6e={};_0x3cdc6e[_0x3f7d28['name']]={'$like':'%'+_0x49b24f[_0x583f('0x38')][_0x583f('0x41')]+'%'};return _0x3cdc6e;}})});}_0x569c62=_[_0x583f('0x43')]({},_0x569c62,_0x49b24f[_0x583f('0x45')]);var _0x52dc1a={'where':_0x569c62[_0x583f('0x42')]};return db[_0x583f('0x34')][_0x583f('0x26')](_0x52dc1a)[_0x583f('0x2d')](function(_0x3cf640){_0x1230cf[_0x583f('0x26')]=_0x3cf640;if(_0x49b24f[_0x583f('0x38')][_0x583f('0x46')]){_0x569c62[_0x583f('0x47')]=[{'all':!![]}];}return db[_0x583f('0x34')][_0x583f('0x48')](_0x569c62);})[_0x583f('0x2d')](function(_0x23cf75){_0x1230cf[_0x583f('0x49')]=_0x23cf75;return _0x1230cf;})['then'](respondWithFilteredResult(_0x1eafec,_0x569c62))['catch'](handleError(_0x1eafec,null));};exports['show']=function(_0x2a534c,_0x2e0aac){var _0x46b44e={'raw':!![],'where':{'id':_0x2a534c[_0x583f('0x4a')]['id']}},_0x59fec0={};_0x59fec0[_0x583f('0x36')]=_['keys'](db[_0x583f('0x34')][_0x583f('0x4b')]);_0x59fec0[_0x583f('0x38')]=_[_0x583f('0x4c')](_0x2a534c[_0x583f('0x38')]);_0x59fec0[_0x583f('0x3f')]=_['intersection'](_0x59fec0[_0x583f('0x36')],_0x59fec0[_0x583f('0x38')]);_0x46b44e[_0x583f('0x3a')]=_['intersection'](_0x59fec0[_0x583f('0x36')],qs[_0x583f('0x39')](_0x2a534c['query'][_0x583f('0x39')]));_0x46b44e['attributes']=_0x46b44e[_0x583f('0x3a')][_0x583f('0x4d')]?_0x46b44e[_0x583f('0x3a')]:_0x59fec0[_0x583f('0x36')];if(_0x2a534c['query'][_0x583f('0x46')]){_0x46b44e['include']=[{'all':!![]}];}_0x46b44e=_['merge']({},_0x46b44e,_0x2a534c[_0x583f('0x45')]);return db[_0x583f('0x34')][_0x583f('0x4e')](_0x46b44e)[_0x583f('0x2d')](handleEntityNotFound(_0x2e0aac,null))[_0x583f('0x2d')](respondWithResult(_0x2e0aac,null))[_0x583f('0x4f')](handleError(_0x2e0aac,null));};exports[_0x583f('0x50')]=function(_0x18063c,_0x9e3146){return db[_0x583f('0x34')]['create'](_0x18063c['body'],{})[_0x583f('0x2d')](respondWithResult(_0x9e3146,0xc9))['catch'](handleError(_0x9e3146,null));};exports[_0x583f('0x2b')]=function(_0x37ee6c,_0x300dd1){if(_0x37ee6c[_0x583f('0x51')]['id']){delete _0x37ee6c['body']['id'];}return db[_0x583f('0x34')][_0x583f('0x4e')]({'where':{'id':_0x37ee6c[_0x583f('0x4a')]['id']}})[_0x583f('0x2d')](handleEntityNotFound(_0x300dd1,null))[_0x583f('0x2d')](saveUpdates(_0x37ee6c[_0x583f('0x51')],null))['then'](respondWithResult(_0x300dd1,null))[_0x583f('0x4f')](handleError(_0x300dd1,null));};exports['destroy']=function(_0x4faa0d,_0x3e7cf0){return db[_0x583f('0x34')]['find']({'where':{'id':_0x4faa0d[_0x583f('0x4a')]['id']}})[_0x583f('0x2d')](handleEntityNotFound(_0x3e7cf0,null))['then'](removeEntity(_0x3e7cf0,null))[_0x583f('0x4f')](handleError(_0x3e7cf0,null));};exports[_0x583f('0x52')]=function(_0x2ace34,_0x14292b){return db[_0x583f('0x34')][_0x583f('0x52')]()[_0x583f('0x2d')](respondWithResult(_0x14292b,null))['catch'](handleError(_0x14292b,null));};exports[_0x583f('0x53')]=function(_0xcf7718,_0x38b80f,_0x2410df){return db[_0x583f('0x54')][_0x583f('0x26')]({'where':{'ChatGroupId':_0xcf7718['params']['id'],'ToId':_0xcf7718[_0x583f('0x55')]['id'],'read':![]}})['then'](function(_0x17ef14){return{'id':_['toInteger'](_0xcf7718[_0x583f('0x4a')]['id']),'count':_0x17ef14};})['then'](respondWithResult(_0x38b80f,null))[_0x583f('0x4f')](handleError(_0x38b80f,null));};exports[_0x583f('0x56')]=function(_0x531776,_0x67be5b,_0x15311c){return db[_0x583f('0x34')]['find']({'where':{'id':_0x531776['params']['id']}})[_0x583f('0x2d')](handleEntityNotFound(_0x67be5b,null))['then'](function(_0x1c6ea4){if(_0x1c6ea4){return _0x1c6ea4[_0x583f('0x56')](_0x531776[_0x583f('0x51')][_0x583f('0x57')],_[_0x583f('0x58')](_0x531776[_0x583f('0x51')],[_0x583f('0x57'),'id'])||{});}})[_0x583f('0x2d')](respondWithResult(_0x67be5b,null))[_0x583f('0x4f')](handleError(_0x67be5b,null));};exports['getMembers']=function(_0x1d7523,_0x345c8a,_0x2a52b2){var _0x52322a={};var _0x38d11e={};var _0x2e3caf;var _0x5f08b;return db[_0x583f('0x34')][_0x583f('0x59')]({'where':{'id':_0x1d7523[_0x583f('0x4a')]['id']}})[_0x583f('0x2d')](handleEntityNotFound(_0x345c8a,null))[_0x583f('0x2d')](function(_0x2823d5){if(_0x2823d5){_0x2e3caf=_0x2823d5;_0x38d11e[_0x583f('0x36')]=_[_0x583f('0x4c')](db[_0x583f('0x5a')][_0x583f('0x4b')]);_0x38d11e['query']=_[_0x583f('0x4c')](_0x1d7523[_0x583f('0x38')]);_0x38d11e[_0x583f('0x3f')]=_[_0x583f('0x37')](_0x38d11e[_0x583f('0x36')],_0x38d11e[_0x583f('0x38')]);_0x52322a['attributes']=_[_0x583f('0x37')](_0x38d11e[_0x583f('0x36')],qs[_0x583f('0x39')](_0x1d7523[_0x583f('0x38')][_0x583f('0x39')]));_0x52322a[_0x583f('0x3a')]=_0x52322a[_0x583f('0x3a')][_0x583f('0x4d')]?_0x52322a[_0x583f('0x3a')]:_0x38d11e[_0x583f('0x36')];_0x52322a[_0x583f('0x3d')]=qs[_0x583f('0x3e')](_0x1d7523['query'][_0x583f('0x3e')]);_0x52322a[_0x583f('0x42')]=qs['filters'](_[_0x583f('0x40')](_0x1d7523[_0x583f('0x38')],_0x38d11e[_0x583f('0x3f')]));if(_0x1d7523[_0x583f('0x38')][_0x583f('0x41')]){_0x52322a[_0x583f('0x42')]=_['merge'](_0x52322a[_0x583f('0x42')],{'$or':_['map'](_0x52322a[_0x583f('0x3a')],function(_0x51fe6d){var _0x1fb5b1={};_0x1fb5b1[_0x51fe6d]={'$like':'%'+_0x1d7523[_0x583f('0x38')][_0x583f('0x41')]+'%'};return _0x1fb5b1;})});}_0x52322a=_[_0x583f('0x43')]({},_0x52322a,_0x1d7523[_0x583f('0x45')]);return _0x2e3caf[_0x583f('0x5b')](_0x52322a);}})[_0x583f('0x2d')](function(_0x349f64){if(_0x349f64){_0x5f08b=_0x349f64[_0x583f('0x4d')];if(!_0x1d7523[_0x583f('0x38')][_0x583f('0x3b')](_0x583f('0x3c'))){_0x52322a[_0x583f('0x27')]=qs[_0x583f('0x27')](_0x1d7523[_0x583f('0x38')][_0x583f('0x27')]);_0x52322a[_0x583f('0x25')]=qs['offset'](_0x1d7523[_0x583f('0x38')][_0x583f('0x25')]);}return _0x2e3caf[_0x583f('0x5b')](_0x52322a);}})['then'](function(_0x52cf59){if(_0x52cf59){return _0x52cf59?{'count':_0x5f08b,'rows':_0x52cf59}:null;}})[_0x583f('0x2d')](respondWithResult(_0x345c8a,null))[_0x583f('0x4f')](handleError(_0x345c8a,null));};exports['removeMembers']=function(_0x3f6543,_0x4558dc,_0x1a86fd){return db[_0x583f('0x34')]['find']({'where':{'id':_0x3f6543[_0x583f('0x4a')]['id']}})['then'](handleEntityNotFound(_0x4558dc,null))[_0x583f('0x2d')](function(_0x3bfd85){if(_0x3bfd85){return _0x3bfd85[_0x583f('0x5c')](_0x3f6543[_0x583f('0x38')][_0x583f('0x57')]);}})['then'](respondWithStatusCode(_0x4558dc,null))[_0x583f('0x4f')](handleError(_0x4558dc,null));};exports[_0x583f('0x5d')]=function(_0x24c2fd,_0x5e27cd,_0x4bc610){if(_0x24c2fd[_0x583f('0x51')]['id']){delete _0x24c2fd[_0x583f('0x51')]['id'];}return db[_0x583f('0x34')]['find']({'where':{'id':_0x24c2fd['params']['id']}})[_0x583f('0x2d')](handleEntityNotFound(_0x5e27cd,null))[_0x583f('0x2d')](function(_0x392e68){if(_0x392e68){_0x24c2fd['body'][_0x583f('0x5e')]=_0x392e68['id'];return db[_0x583f('0x54')][_0x583f('0x50')](_0x24c2fd[_0x583f('0x51')]);}})['then'](respondWithResult(_0x5e27cd,null))['catch'](handleError(_0x5e27cd,null));};exports[_0x583f('0x5f')]=function(_0x3e2649,_0x13f2e0,_0x23d377){var _0x427e54={};var _0x2d2571={};var _0xaee15a;var _0x2ab4cd;return db[_0x583f('0x34')][_0x583f('0x59')]({'where':{'id':_0x3e2649[_0x583f('0x4a')]['id']}})[_0x583f('0x2d')](handleEntityNotFound(_0x13f2e0,null))[_0x583f('0x2d')](function(_0x223062){if(_0x223062){_0xaee15a=_0x223062;_0x2d2571['model']=_[_0x583f('0x4c')](db[_0x583f('0x54')][_0x583f('0x4b')]);_0x2d2571[_0x583f('0x38')]=_[_0x583f('0x4c')](_0x3e2649[_0x583f('0x38')]);_0x2d2571['filters']=_[_0x583f('0x37')](_0x2d2571[_0x583f('0x36')],_0x2d2571['query']);_0x427e54[_0x583f('0x3a')]=_['intersection'](_0x2d2571[_0x583f('0x36')],qs[_0x583f('0x39')](_0x3e2649['query'][_0x583f('0x39')]));_0x427e54[_0x583f('0x3a')]=_0x427e54[_0x583f('0x3a')]['length']?_0x427e54['attributes']:_0x2d2571[_0x583f('0x36')];_0x427e54[_0x583f('0x3d')]=qs[_0x583f('0x3e')](_0x3e2649[_0x583f('0x38')][_0x583f('0x3e')]);_0x427e54[_0x583f('0x42')]=qs[_0x583f('0x3f')](_[_0x583f('0x40')](_0x3e2649[_0x583f('0x38')],_0x2d2571[_0x583f('0x3f')]));if(_0x3e2649[_0x583f('0x38')][_0x583f('0x41')]){_0x427e54['where']=_['merge'](_0x427e54[_0x583f('0x42')],{'$or':_[_0x583f('0x33')](_0x427e54['attributes'],function(_0x19ae9c){var _0x37f323={};_0x37f323[_0x19ae9c]={'$like':'%'+_0x3e2649[_0x583f('0x38')][_0x583f('0x41')]+'%'};return _0x37f323;})});}if(_0x3e2649[_0x583f('0x38')][_0x583f('0x60')]){var _0x60d349=_0x3e2649[_0x583f('0x38')][_0x583f('0x60')][_0x583f('0x61')](',');var _0x4f90f1={};_0x4f90f1[_0x60d349[0x0]]={'$gte':moment(_0x60d349[0x1])[_0x583f('0x62')](_0x583f('0x63'))};_0x427e54['where']=_[_0x583f('0x43')](_0x427e54[_0x583f('0x42')],_0x4f90f1);}_0x427e54=_['merge']({},_0x427e54,_0x3e2649['options']);return _0xaee15a['getMessages'](_0x427e54);}})['then'](function(_0x17a3a6){if(_0x17a3a6){_0x2ab4cd=_0x17a3a6['length'];if(!_0x3e2649['query'][_0x583f('0x3b')]('nolimit')){_0x427e54[_0x583f('0x27')]=qs[_0x583f('0x27')](_0x3e2649[_0x583f('0x38')][_0x583f('0x27')]);_0x427e54[_0x583f('0x25')]=qs['offset'](_0x3e2649[_0x583f('0x38')]['offset']);}return _0xaee15a[_0x583f('0x5f')](_0x427e54);}})['then'](function(_0x1e8341){if(_0x1e8341){return _0x1e8341?{'count':_0x2ab4cd,'rows':_0x1e8341}:null;}})[_0x583f('0x2d')](respondWithResult(_0x13f2e0,null))['catch'](handleError(_0x13f2e0,null));}; \ No newline at end of file +var _0xc2a5=['getMessages','$gte','split','format','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','redis','defaults','socket.io-emitter','./chatGroup.socket','register','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','save','update','destroy','error','stack','name','send','index','map','ChatGroup','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','then','rows','catch','show','params','length','find','create','body','describe','getUnread','ChatInternalMessage','toInteger','addMembers','ids','getMembers','findOne','User','removeMembers','addMessage','ChatGroupId'];(function(_0x568496,_0x565afd){var _0x26c5c1=function(_0x4d251e){while(--_0x4d251e){_0x568496['push'](_0x568496['shift']());}};_0x26c5c1(++_0x565afd);}(_0xc2a5,0x1ee));var _0x5c2a=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xc2a5[_0xa464c9];return _0x3d73c4;};'use strict';var emlformat=require(_0x5c2a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5c2a('0x1'));var jsonpatch=require(_0x5c2a('0x2'));var rp=require(_0x5c2a('0x3'));var moment=require('moment');var BPromise=require(_0x5c2a('0x4'));var Mustache=require(_0x5c2a('0x5'));var util=require('util');var path=require('path');var sox=require(_0x5c2a('0x6'));var csv=require(_0x5c2a('0x7'));var ejs=require(_0x5c2a('0x8'));var fs=require('fs');var fs_extra=require(_0x5c2a('0x9'));var _=require(_0x5c2a('0xa'));var squel=require(_0x5c2a('0xb'));var crypto=require(_0x5c2a('0xc'));var jsforce=require(_0x5c2a('0xd'));var deskjs=require(_0x5c2a('0xe'));var toCsv=require(_0x5c2a('0x7'));var querystring=require(_0x5c2a('0xf'));var Papa=require(_0x5c2a('0x10'));var Redis=require(_0x5c2a('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x5c2a('0x12'));var as=require(_0x5c2a('0x13'));var hardwareService=require(_0x5c2a('0x14'));var logger=require(_0x5c2a('0x15'))(_0x5c2a('0x16'));var utils=require('../../config/utils');var config=require(_0x5c2a('0x17'));var licenseUtil=require(_0x5c2a('0x18'));var db=require('../../mysqldb')['db'];config[_0x5c2a('0x19')]=_[_0x5c2a('0x1a')](config[_0x5c2a('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0x5c2a('0x1b'))(new Redis(config[_0x5c2a('0x19')]));require(_0x5c2a('0x1c'))[_0x5c2a('0x1d')](socket);function respondWithStatusCode(_0x22c906,_0x4ca55f){_0x4ca55f=_0x4ca55f||0xcc;return function(_0x40dc55){if(_0x40dc55){return _0x22c906['sendStatus'](_0x4ca55f);}return _0x22c906[_0x5c2a('0x1e')](_0x4ca55f)[_0x5c2a('0x1f')]();};}function respondWithResult(_0x237752,_0x15b70b){_0x15b70b=_0x15b70b||0xc8;return function(_0x495b62){if(_0x495b62){return _0x237752['status'](_0x15b70b)[_0x5c2a('0x20')](_0x495b62);}};}function respondWithFilteredResult(_0x3be7b8,_0x28545e){return function(_0x5aae83){if(_0x5aae83){var _0x2285f3=typeof _0x28545e['offset']==='undefined'&&typeof _0x28545e['limit']===_0x5c2a('0x21');var _0x361d2d=_0x5aae83[_0x5c2a('0x22')];var _0x4e3887=_0x2285f3?0x0:_0x28545e['offset'];var _0x9aa904=_0x2285f3?_0x5aae83['count']:_0x28545e[_0x5c2a('0x23')]+_0x28545e[_0x5c2a('0x24')];var _0x2c9b64;if(_0x9aa904>=_0x361d2d){_0x9aa904=_0x361d2d;_0x2c9b64=0xc8;}else{_0x2c9b64=0xce;}_0x3be7b8[_0x5c2a('0x1e')](_0x2c9b64);return _0x3be7b8[_0x5c2a('0x25')](_0x5c2a('0x26'),_0x4e3887+'-'+_0x9aa904+'/'+_0x361d2d)[_0x5c2a('0x20')](_0x5aae83);}return null;};}function patchUpdates(_0x9f3813){return function(_0xdaccd9){try{jsonpatch[_0x5c2a('0x27')](_0xdaccd9,_0x9f3813,!![]);}catch(_0x2b8b26){return BPromise['reject'](_0x2b8b26);}return _0xdaccd9[_0x5c2a('0x28')]();};}function saveUpdates(_0x5e8f97,_0x1ef72d){return function(_0x2bdb5d){if(_0x2bdb5d){return _0x2bdb5d[_0x5c2a('0x29')](_0x5e8f97)['then'](function(_0x4bee84){return _0x4bee84;});}return null;};}function removeEntity(_0x2ce3d5,_0x525185){return function(_0x26c2f7){if(_0x26c2f7){return _0x26c2f7[_0x5c2a('0x2a')]()['then'](function(){_0x2ce3d5[_0x5c2a('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x37ab57,_0xf1fbd7){return function(_0x531570){if(!_0x531570){_0x37ab57['sendStatus'](0x194);}return _0x531570;};}function handleError(_0x23c1f6,_0x5e29ee){_0x5e29ee=_0x5e29ee||0x1f4;return function(_0x2ffaea){logger[_0x5c2a('0x2b')](_0x2ffaea[_0x5c2a('0x2c')]);if(_0x2ffaea[_0x5c2a('0x2d')]){delete _0x2ffaea[_0x5c2a('0x2d')];}_0x23c1f6[_0x5c2a('0x1e')](_0x5e29ee)[_0x5c2a('0x2e')](_0x2ffaea);};}exports[_0x5c2a('0x2f')]=function(_0x16eecd,_0x1d6bd6){var _0x104aa5={},_0x2fadbf={},_0x37eadc={'count':0x0,'rows':[]};var _0x2503ba=_[_0x5c2a('0x30')](db[_0x5c2a('0x31')][_0x5c2a('0x32')],function(_0x4fef68){return{'name':_0x4fef68[_0x5c2a('0x33')],'type':_0x4fef68[_0x5c2a('0x34')][_0x5c2a('0x35')]};});_0x2fadbf[_0x5c2a('0x36')]=_['map'](_0x2503ba,_0x5c2a('0x2d'));_0x2fadbf[_0x5c2a('0x37')]=_[_0x5c2a('0x38')](_0x16eecd[_0x5c2a('0x37')]);_0x2fadbf[_0x5c2a('0x39')]=_[_0x5c2a('0x3a')](_0x2fadbf[_0x5c2a('0x36')],_0x2fadbf['query']);_0x104aa5['attributes']=_[_0x5c2a('0x3a')](_0x2fadbf[_0x5c2a('0x36')],qs[_0x5c2a('0x3b')](_0x16eecd[_0x5c2a('0x37')][_0x5c2a('0x3b')]));_0x104aa5['attributes']=_0x104aa5[_0x5c2a('0x3c')]['length']?_0x104aa5[_0x5c2a('0x3c')]:_0x2fadbf[_0x5c2a('0x36')];if(!_0x16eecd[_0x5c2a('0x37')][_0x5c2a('0x3d')](_0x5c2a('0x3e'))){_0x104aa5[_0x5c2a('0x24')]=qs[_0x5c2a('0x24')](_0x16eecd[_0x5c2a('0x37')][_0x5c2a('0x24')]);_0x104aa5[_0x5c2a('0x23')]=qs['offset'](_0x16eecd[_0x5c2a('0x37')][_0x5c2a('0x23')]);}_0x104aa5[_0x5c2a('0x3f')]=qs[_0x5c2a('0x40')](_0x16eecd['query'][_0x5c2a('0x40')]);_0x104aa5[_0x5c2a('0x41')]=qs[_0x5c2a('0x39')](_[_0x5c2a('0x42')](_0x16eecd[_0x5c2a('0x37')],_0x2fadbf['filters']),_0x2503ba);if(_0x16eecd[_0x5c2a('0x37')]['filter']){_0x104aa5[_0x5c2a('0x41')]=_['merge'](_0x104aa5[_0x5c2a('0x41')],{'$or':_['map'](_0x2503ba,function(_0x542921){if(_0x542921[_0x5c2a('0x34')]!=='VIRTUAL'){var _0x2fc08c={};_0x2fc08c[_0x542921[_0x5c2a('0x2d')]]={'$like':'%'+_0x16eecd[_0x5c2a('0x37')][_0x5c2a('0x43')]+'%'};return _0x2fc08c;}})});}_0x104aa5=_[_0x5c2a('0x44')]({},_0x104aa5,_0x16eecd[_0x5c2a('0x45')]);var _0x541297={'where':_0x104aa5[_0x5c2a('0x41')]};return db['ChatGroup'][_0x5c2a('0x22')](_0x541297)['then'](function(_0x47c454){_0x37eadc[_0x5c2a('0x22')]=_0x47c454;if(_0x16eecd['query'][_0x5c2a('0x46')]){_0x104aa5[_0x5c2a('0x47')]=[{'all':!![]}];}return db['ChatGroup'][_0x5c2a('0x48')](_0x104aa5);})[_0x5c2a('0x49')](function(_0x55bebc){_0x37eadc[_0x5c2a('0x4a')]=_0x55bebc;return _0x37eadc;})[_0x5c2a('0x49')](respondWithFilteredResult(_0x1d6bd6,_0x104aa5))[_0x5c2a('0x4b')](handleError(_0x1d6bd6,null));};exports[_0x5c2a('0x4c')]=function(_0x22bcfb,_0x3d4006){var _0x394e98={'raw':!![],'where':{'id':_0x22bcfb[_0x5c2a('0x4d')]['id']}},_0x14591b={};_0x14591b[_0x5c2a('0x36')]=_['keys'](db[_0x5c2a('0x31')][_0x5c2a('0x32')]);_0x14591b['query']=_['keys'](_0x22bcfb['query']);_0x14591b[_0x5c2a('0x39')]=_[_0x5c2a('0x3a')](_0x14591b['model'],_0x14591b[_0x5c2a('0x37')]);_0x394e98['attributes']=_['intersection'](_0x14591b[_0x5c2a('0x36')],qs[_0x5c2a('0x3b')](_0x22bcfb[_0x5c2a('0x37')][_0x5c2a('0x3b')]));_0x394e98[_0x5c2a('0x3c')]=_0x394e98[_0x5c2a('0x3c')][_0x5c2a('0x4e')]?_0x394e98[_0x5c2a('0x3c')]:_0x14591b['model'];if(_0x22bcfb[_0x5c2a('0x37')][_0x5c2a('0x46')]){_0x394e98[_0x5c2a('0x47')]=[{'all':!![]}];}_0x394e98=_[_0x5c2a('0x44')]({},_0x394e98,_0x22bcfb[_0x5c2a('0x45')]);return db[_0x5c2a('0x31')][_0x5c2a('0x4f')](_0x394e98)['then'](handleEntityNotFound(_0x3d4006,null))[_0x5c2a('0x49')](respondWithResult(_0x3d4006,null))[_0x5c2a('0x4b')](handleError(_0x3d4006,null));};exports[_0x5c2a('0x50')]=function(_0x4010f7,_0x5987a8){return db[_0x5c2a('0x31')][_0x5c2a('0x50')](_0x4010f7['body'],{})[_0x5c2a('0x49')](respondWithResult(_0x5987a8,0xc9))[_0x5c2a('0x4b')](handleError(_0x5987a8,null));};exports['update']=function(_0x88adba,_0x5c8f62){if(_0x88adba[_0x5c2a('0x51')]['id']){delete _0x88adba[_0x5c2a('0x51')]['id'];}return db['ChatGroup'][_0x5c2a('0x4f')]({'where':{'id':_0x88adba['params']['id']}})[_0x5c2a('0x49')](handleEntityNotFound(_0x5c8f62,null))[_0x5c2a('0x49')](saveUpdates(_0x88adba['body'],null))[_0x5c2a('0x49')](respondWithResult(_0x5c8f62,null))[_0x5c2a('0x4b')](handleError(_0x5c8f62,null));};exports[_0x5c2a('0x2a')]=function(_0x14fca8,_0x59e57){return db[_0x5c2a('0x31')][_0x5c2a('0x4f')]({'where':{'id':_0x14fca8['params']['id']}})[_0x5c2a('0x49')](handleEntityNotFound(_0x59e57,null))[_0x5c2a('0x49')](removeEntity(_0x59e57,null))[_0x5c2a('0x4b')](handleError(_0x59e57,null));};exports[_0x5c2a('0x52')]=function(_0x1aff3b,_0x4cb752){return db['ChatGroup']['describe']()[_0x5c2a('0x49')](respondWithResult(_0x4cb752,null))[_0x5c2a('0x4b')](handleError(_0x4cb752,null));};exports[_0x5c2a('0x53')]=function(_0x4c7a88,_0x1dd013,_0x286f26){return db[_0x5c2a('0x54')][_0x5c2a('0x22')]({'where':{'ChatGroupId':_0x4c7a88['params']['id'],'ToId':_0x4c7a88['user']['id'],'read':![]}})[_0x5c2a('0x49')](function(_0x3a493d){return{'id':_[_0x5c2a('0x55')](_0x4c7a88['params']['id']),'count':_0x3a493d};})[_0x5c2a('0x49')](respondWithResult(_0x1dd013,null))['catch'](handleError(_0x1dd013,null));};exports[_0x5c2a('0x56')]=function(_0x1d1177,_0x142188,_0x514ded){return db[_0x5c2a('0x31')][_0x5c2a('0x4f')]({'where':{'id':_0x1d1177[_0x5c2a('0x4d')]['id']}})['then'](handleEntityNotFound(_0x142188,null))['then'](function(_0x5c8a3e){if(_0x5c8a3e){return _0x5c8a3e[_0x5c2a('0x56')](_0x1d1177[_0x5c2a('0x51')][_0x5c2a('0x57')],_['omit'](_0x1d1177[_0x5c2a('0x51')],['ids','id'])||{});}})[_0x5c2a('0x49')](respondWithResult(_0x142188,null))[_0x5c2a('0x4b')](handleError(_0x142188,null));};exports[_0x5c2a('0x58')]=function(_0x548772,_0x16b8f8,_0x1f9349){var _0xa114ff={};var _0x3814fa={};var _0x3c0ea4;var _0x42d6ee;return db[_0x5c2a('0x31')][_0x5c2a('0x59')]({'where':{'id':_0x548772['params']['id']}})['then'](handleEntityNotFound(_0x16b8f8,null))[_0x5c2a('0x49')](function(_0x4bae82){if(_0x4bae82){_0x3c0ea4=_0x4bae82;_0x3814fa[_0x5c2a('0x36')]=_[_0x5c2a('0x38')](db[_0x5c2a('0x5a')][_0x5c2a('0x32')]);_0x3814fa[_0x5c2a('0x37')]=_[_0x5c2a('0x38')](_0x548772[_0x5c2a('0x37')]);_0x3814fa[_0x5c2a('0x39')]=_[_0x5c2a('0x3a')](_0x3814fa['model'],_0x3814fa['query']);_0xa114ff[_0x5c2a('0x3c')]=_[_0x5c2a('0x3a')](_0x3814fa['model'],qs[_0x5c2a('0x3b')](_0x548772[_0x5c2a('0x37')][_0x5c2a('0x3b')]));_0xa114ff[_0x5c2a('0x3c')]=_0xa114ff[_0x5c2a('0x3c')][_0x5c2a('0x4e')]?_0xa114ff[_0x5c2a('0x3c')]:_0x3814fa[_0x5c2a('0x36')];_0xa114ff[_0x5c2a('0x3f')]=qs['sort'](_0x548772[_0x5c2a('0x37')]['sort']);_0xa114ff['where']=qs['filters'](_[_0x5c2a('0x42')](_0x548772['query'],_0x3814fa['filters']));if(_0x548772[_0x5c2a('0x37')][_0x5c2a('0x43')]){_0xa114ff['where']=_[_0x5c2a('0x44')](_0xa114ff[_0x5c2a('0x41')],{'$or':_[_0x5c2a('0x30')](_0xa114ff[_0x5c2a('0x3c')],function(_0x3723f6){var _0x54d351={};_0x54d351[_0x3723f6]={'$like':'%'+_0x548772[_0x5c2a('0x37')]['filter']+'%'};return _0x54d351;})});}_0xa114ff=_['merge']({},_0xa114ff,_0x548772[_0x5c2a('0x45')]);return _0x3c0ea4[_0x5c2a('0x58')](_0xa114ff);}})[_0x5c2a('0x49')](function(_0x3c4547){if(_0x3c4547){_0x42d6ee=_0x3c4547[_0x5c2a('0x4e')];if(!_0x548772[_0x5c2a('0x37')][_0x5c2a('0x3d')](_0x5c2a('0x3e'))){_0xa114ff[_0x5c2a('0x24')]=qs[_0x5c2a('0x24')](_0x548772['query']['limit']);_0xa114ff[_0x5c2a('0x23')]=qs[_0x5c2a('0x23')](_0x548772[_0x5c2a('0x37')]['offset']);}return _0x3c0ea4[_0x5c2a('0x58')](_0xa114ff);}})[_0x5c2a('0x49')](function(_0x4fe612){if(_0x4fe612){return _0x4fe612?{'count':_0x42d6ee,'rows':_0x4fe612}:null;}})[_0x5c2a('0x49')](respondWithResult(_0x16b8f8,null))[_0x5c2a('0x4b')](handleError(_0x16b8f8,null));};exports[_0x5c2a('0x5b')]=function(_0x2c8fae,_0xb20070,_0x248c22){return db[_0x5c2a('0x31')][_0x5c2a('0x4f')]({'where':{'id':_0x2c8fae[_0x5c2a('0x4d')]['id']}})[_0x5c2a('0x49')](handleEntityNotFound(_0xb20070,null))[_0x5c2a('0x49')](function(_0x29411a){if(_0x29411a){return _0x29411a['removeMembers'](_0x2c8fae['query'][_0x5c2a('0x57')]);}})[_0x5c2a('0x49')](respondWithStatusCode(_0xb20070,null))[_0x5c2a('0x4b')](handleError(_0xb20070,null));};exports[_0x5c2a('0x5c')]=function(_0x1315e4,_0x4ce356,_0x22d2c0){if(_0x1315e4['body']['id']){delete _0x1315e4[_0x5c2a('0x51')]['id'];}return db['ChatGroup'][_0x5c2a('0x4f')]({'where':{'id':_0x1315e4[_0x5c2a('0x4d')]['id']}})[_0x5c2a('0x49')](handleEntityNotFound(_0x4ce356,null))[_0x5c2a('0x49')](function(_0x252148){if(_0x252148){_0x1315e4['body'][_0x5c2a('0x5d')]=_0x252148['id'];return db[_0x5c2a('0x54')]['create'](_0x1315e4['body']);}})[_0x5c2a('0x49')](respondWithResult(_0x4ce356,null))['catch'](handleError(_0x4ce356,null));};exports[_0x5c2a('0x5e')]=function(_0x19a85b,_0x33775a,_0x4db720){var _0x3a4760={};var _0x5b3284={};var _0x130b6b;var _0x859f33;return db[_0x5c2a('0x31')][_0x5c2a('0x59')]({'where':{'id':_0x19a85b[_0x5c2a('0x4d')]['id']}})[_0x5c2a('0x49')](handleEntityNotFound(_0x33775a,null))[_0x5c2a('0x49')](function(_0x55cd9b){if(_0x55cd9b){_0x130b6b=_0x55cd9b;_0x5b3284[_0x5c2a('0x36')]=_[_0x5c2a('0x38')](db['ChatInternalMessage'][_0x5c2a('0x32')]);_0x5b3284['query']=_[_0x5c2a('0x38')](_0x19a85b[_0x5c2a('0x37')]);_0x5b3284[_0x5c2a('0x39')]=_['intersection'](_0x5b3284[_0x5c2a('0x36')],_0x5b3284['query']);_0x3a4760[_0x5c2a('0x3c')]=_['intersection'](_0x5b3284['model'],qs['fields'](_0x19a85b['query'][_0x5c2a('0x3b')]));_0x3a4760['attributes']=_0x3a4760['attributes'][_0x5c2a('0x4e')]?_0x3a4760[_0x5c2a('0x3c')]:_0x5b3284[_0x5c2a('0x36')];_0x3a4760[_0x5c2a('0x3f')]=qs[_0x5c2a('0x40')](_0x19a85b[_0x5c2a('0x37')][_0x5c2a('0x40')]);_0x3a4760[_0x5c2a('0x41')]=qs[_0x5c2a('0x39')](_[_0x5c2a('0x42')](_0x19a85b[_0x5c2a('0x37')],_0x5b3284['filters']));if(_0x19a85b[_0x5c2a('0x37')]['filter']){_0x3a4760[_0x5c2a('0x41')]=_['merge'](_0x3a4760[_0x5c2a('0x41')],{'$or':_['map'](_0x3a4760[_0x5c2a('0x3c')],function(_0x4a4d9a){var _0x1c8db4={};_0x1c8db4[_0x4a4d9a]={'$like':'%'+_0x19a85b[_0x5c2a('0x37')]['filter']+'%'};return _0x1c8db4;})});}if(_0x19a85b[_0x5c2a('0x37')]['$gte']){var _0x354e27=_0x19a85b[_0x5c2a('0x37')][_0x5c2a('0x5f')][_0x5c2a('0x60')](',');var _0x33fb29={};_0x33fb29[_0x354e27[0x0]]={'$gte':moment(_0x354e27[0x1])[_0x5c2a('0x61')]('YYYY-MM-DD\x20HH:mm:ss')};_0x3a4760[_0x5c2a('0x41')]=_[_0x5c2a('0x44')](_0x3a4760['where'],_0x33fb29);}_0x3a4760=_[_0x5c2a('0x44')]({},_0x3a4760,_0x19a85b[_0x5c2a('0x45')]);return _0x130b6b[_0x5c2a('0x5e')](_0x3a4760);}})[_0x5c2a('0x49')](function(_0x4be2dc){if(_0x4be2dc){_0x859f33=_0x4be2dc[_0x5c2a('0x4e')];if(!_0x19a85b[_0x5c2a('0x37')][_0x5c2a('0x3d')]('nolimit')){_0x3a4760[_0x5c2a('0x24')]=qs[_0x5c2a('0x24')](_0x19a85b[_0x5c2a('0x37')]['limit']);_0x3a4760[_0x5c2a('0x23')]=qs[_0x5c2a('0x23')](_0x19a85b[_0x5c2a('0x37')][_0x5c2a('0x23')]);}return _0x130b6b[_0x5c2a('0x5e')](_0x3a4760);}})['then'](function(_0x2c9181){if(_0x2c9181){return _0x2c9181?{'count':_0x859f33,'rows':_0x2c9181}:null;}})[_0x5c2a('0x49')](respondWithResult(_0x33775a,null))['catch'](handleError(_0x33775a,null));}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js index f54395e..09db6cb 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 _0xfc6d=['events','../../mysqldb','ChatGroup','setMaxListeners','remove','emit','hasOwnProperty','hook','exports'];(function(_0x24ddf6,_0x114e56){var _0x393d70=function(_0x12c818){while(--_0x12c818){_0x24ddf6['push'](_0x24ddf6['shift']());}};_0x393d70(++_0x114e56);}(_0xfc6d,0x1e6));var _0xdfc6=function(_0x30c377,_0x4ea055){_0x30c377=_0x30c377-0x0;var _0x2566e2=_0xfc6d[_0x30c377];return _0x2566e2;};'use strict';var EventEmitter=require(_0xdfc6('0x0'));var ChatGroup=require(_0xdfc6('0x1'))['db'][_0xdfc6('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0xdfc6('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xdfc6('0x4')};function emitEvent(_0x55dbda){return function(_0xd1c93a,_0x285c06,_0x5d6564){ChatGroupEvents[_0xdfc6('0x5')](_0x55dbda+':'+_0xd1c93a['id'],_0xd1c93a);ChatGroupEvents['emit'](_0x55dbda,_0xd1c93a);_0x5d6564(null);};}for(var e in events){if(events[_0xdfc6('0x6')](e)){var event=events[e];ChatGroup[_0xdfc6('0x7')](e,emitEvent(event));}}module[_0xdfc6('0x8')]=ChatGroupEvents; \ No newline at end of file +var _0x30d4=['save','remove','emit','hasOwnProperty','exports','events','../../mysqldb','ChatGroup'];(function(_0xd580e2,_0x109182){var _0x4d955f=function(_0x568fff){while(--_0x568fff){_0xd580e2['push'](_0xd580e2['shift']());}};_0x4d955f(++_0x109182);}(_0x30d4,0xed));var _0x430d=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0x30d4[_0x465028];return _0xb783d4;};'use strict';var EventEmitter=require(_0x430d('0x0'));var ChatGroup=require(_0x430d('0x1'))['db'][_0x430d('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x430d('0x3'),'afterUpdate':'update','afterDestroy':_0x430d('0x4')};function emitEvent(_0x18532f){return function(_0x503a82,_0x121ec1,_0x34d4f9){ChatGroupEvents[_0x430d('0x5')](_0x18532f+':'+_0x503a82['id'],_0x503a82);ChatGroupEvents[_0x430d('0x5')](_0x18532f,_0x503a82);_0x34d4f9(null);};}for(var e in events){if(events[_0x430d('0x6')](e)){var event=events[e];ChatGroup['hook'](e,emitEvent(event));}}module[_0x430d('0x7')]=ChatGroupEvents; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js index ac98f56..c019874 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 _0xb052=['lodash','util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','./chatGroup.attributes','exports','define','chat_groups'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xb052,0x84));var _0x2b05=function(_0x2eec1f,_0x1b9987){_0x2eec1f=_0x2eec1f-0x0;var _0x543075=_0xb052[_0x2eec1f];return _0x543075;};'use strict';var _=require(_0x2b05('0x0'));var util=require(_0x2b05('0x1'));var logger=require(_0x2b05('0x2'))(_0x2b05('0x3'));var moment=require(_0x2b05('0x4'));var BPromise=require(_0x2b05('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x2b05('0x6'));var config=require(_0x2b05('0x7'));var attributes=require(_0x2b05('0x8'));module[_0x2b05('0x9')]=function(_0x1023cc,_0x370055){return _0x1023cc[_0x2b05('0xa')]('ChatGroup',attributes,{'tableName':_0x2b05('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfa12=['moment','bluebird','../../config/environment','./chatGroup.attributes','exports','define','lodash','util','../../config/logger','api'];(function(_0x57029b,_0x4e7022){var _0xf249cb=function(_0x247d4b){while(--_0x247d4b){_0x57029b['push'](_0x57029b['shift']());}};_0xf249cb(++_0x4e7022);}(_0xfa12,0x1dc));var _0x2fa1=function(_0x5da320,_0x5a4dde){_0x5da320=_0x5da320-0x0;var _0x2e367c=_0xfa12[_0x5da320];return _0x2e367c;};'use strict';var _=require(_0x2fa1('0x0'));var util=require(_0x2fa1('0x1'));var logger=require(_0x2fa1('0x2'))(_0x2fa1('0x3'));var moment=require(_0x2fa1('0x4'));var BPromise=require(_0x2fa1('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x2fa1('0x6'));var attributes=require(_0x2fa1('0x7'));module[_0x2fa1('0x8')]=function(_0x1e130f,_0x4bf63a){return _0x1e130f[_0x2fa1('0x9')]('ChatGroup',attributes,{'tableName':'chat_groups','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.rpc.js b/server/api/chatGroup/chatGroup.rpc.js index 55e16e4..42ca845 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 _0xf7df=['request\x20sent','ChatGroup,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','defaults','redis','localhost','socket.io-emitter','./chatGroup.socket','request','then','info','ChatGroup,\x20%s,\x20%s'];(function(_0x5bd426,_0x4878e5){var _0x23a7eb=function(_0x594b42){while(--_0x594b42){_0x5bd426['push'](_0x5bd426['shift']());}};_0x23a7eb(++_0x4878e5);}(_0xf7df,0x10e));var _0xff7d=function(_0x2248a0,_0x240ac0){_0x2248a0=_0x2248a0-0x0;var _0x51a57a=_0xf7df[_0x2248a0];return _0x51a57a;};'use strict';var _=require(_0xff7d('0x0'));var util=require('util');var moment=require(_0xff7d('0x1'));var BPromise=require(_0xff7d('0x2'));var rs=require(_0xff7d('0x3'));var fs=require('fs');var Redis=require(_0xff7d('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xff7d('0x5'));var logger=require('../../config/logger')(_0xff7d('0x6'));var config=require(_0xff7d('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xff7d('0x8')]['http']({'port':0x232a});config['redis']=_[_0xff7d('0x9')](config[_0xff7d('0xa')],{'host':_0xff7d('0xb'),'port':0x18eb});var socket=require(_0xff7d('0xc'))(new Redis(config[_0xff7d('0xa')]));require(_0xff7d('0xd'))['register'](socket);function respondWithRpcPromise(_0x2193f7,_0x111c0f,_0x43df23){return new BPromise(function(_0x38208a,_0x209099){return client[_0xff7d('0xe')](_0x2193f7,_0x43df23)[_0xff7d('0xf')](function(_0x43faa8){logger[_0xff7d('0x10')](_0xff7d('0x11'),_0x111c0f,_0xff7d('0x12'));logger['debug'](_0xff7d('0x13'),_0x111c0f,_0xff7d('0x12'),JSON['stringify'](_0x43faa8));if(_0x43faa8[_0xff7d('0x14')]){if(_0x43faa8[_0xff7d('0x14')][_0xff7d('0x15')]===0x1f4){logger[_0xff7d('0x14')](_0xff7d('0x11'),_0x111c0f,_0x43faa8[_0xff7d('0x14')]['message']);return _0x209099(_0x43faa8[_0xff7d('0x14')][_0xff7d('0x16')]);}logger[_0xff7d('0x14')](_0xff7d('0x11'),_0x111c0f,_0x43faa8[_0xff7d('0x14')][_0xff7d('0x16')]);return _0x38208a(_0x43faa8[_0xff7d('0x14')][_0xff7d('0x16')]);}else{logger[_0xff7d('0x10')]('ChatGroup,\x20%s,\x20%s',_0x111c0f,_0xff7d('0x12'));_0x38208a(_0x43faa8[_0xff7d('0x17')][_0xff7d('0x16')]);}})['catch'](function(_0xc918e5){logger[_0xff7d('0x14')](_0xff7d('0x11'),_0x111c0f,_0xc918e5);_0x209099(_0xc918e5);});});} \ No newline at end of file +var _0x3de0=['moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','ChatGroup,\x20%s,\x20%s','debug','ChatGroup,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash'];(function(_0x3b9d5f,_0x2e9039){var _0x39924e=function(_0x5752ee){while(--_0x5752ee){_0x3b9d5f['push'](_0x3b9d5f['shift']());}};_0x39924e(++_0x2e9039);}(_0x3de0,0x143));var _0x03de=function(_0x421cbc,_0x7c2f9c){_0x421cbc=_0x421cbc-0x0;var _0x15fe7c=_0x3de0[_0x421cbc];return _0x15fe7c;};'use strict';var _=require(_0x03de('0x0'));var util=require('util');var moment=require(_0x03de('0x1'));var BPromise=require(_0x03de('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x03de('0x3'));var db=require(_0x03de('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x03de('0x5'))(_0x03de('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x03de('0x7')][_0x03de('0x8')]({'port':0x232a});config[_0x03de('0x9')]=_[_0x03de('0xa')](config[_0x03de('0x9')],{'host':_0x03de('0xb'),'port':0x18eb});var socket=require(_0x03de('0xc'))(new Redis(config[_0x03de('0x9')]));require('./chatGroup.socket')[_0x03de('0xd')](socket);function respondWithRpcPromise(_0x4d275c,_0x488946,_0x10e43f){return new BPromise(function(_0x1d6e87,_0x4f2251){return client[_0x03de('0xe')](_0x4d275c,_0x10e43f)[_0x03de('0xf')](function(_0x5c7f40){logger[_0x03de('0x10')](_0x03de('0x11'),_0x488946,'request\x20sent');logger[_0x03de('0x12')](_0x03de('0x13'),_0x488946,_0x03de('0x14'),JSON[_0x03de('0x15')](_0x5c7f40));if(_0x5c7f40[_0x03de('0x16')]){if(_0x5c7f40['error'][_0x03de('0x17')]===0x1f4){logger[_0x03de('0x16')](_0x03de('0x11'),_0x488946,_0x5c7f40[_0x03de('0x16')]['message']);return _0x4f2251(_0x5c7f40[_0x03de('0x16')][_0x03de('0x18')]);}logger[_0x03de('0x16')](_0x03de('0x11'),_0x488946,_0x5c7f40[_0x03de('0x16')][_0x03de('0x18')]);return _0x1d6e87(_0x5c7f40[_0x03de('0x16')][_0x03de('0x18')]);}else{logger[_0x03de('0x10')]('ChatGroup,\x20%s,\x20%s',_0x488946,'request\x20sent');_0x1d6e87(_0x5c7f40[_0x03de('0x19')][_0x03de('0x18')]);}})[_0x03de('0x1a')](function(_0x55ad7e){logger[_0x03de('0x16')](_0x03de('0x11'),_0x488946,_0x55ad7e);_0x4f2251(_0x55ad7e);});});} \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js index 46be9a1..607fbfe 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 _0xdd17=['remove','emit','length','chatGroup:','save'];(function(_0x460d9a,_0x1e5cbe){var _0x583fbc=function(_0x448b1f){while(--_0x448b1f){_0x460d9a['push'](_0x460d9a['shift']());}};_0x583fbc(++_0x1e5cbe);}(_0xdd17,0xcc));var _0x7dd1=function(_0x2b0373,_0x489311){_0x2b0373=_0x2b0373-0x0;var _0x2bf9d0=_0xdd17[_0x2b0373];return _0x2bf9d0;};'use strict';var ChatGroupEvents=require('./chatGroup.events');var events=[_0x7dd1('0x0'),_0x7dd1('0x1'),'update'];function createListener(_0x1de024,_0x15b343){return function(_0x39432c){_0x15b343[_0x7dd1('0x2')](_0x1de024,_0x39432c);};}function removeListener(_0x5968ae,_0x2da64b){return function(){ChatGroupEvents['removeListener'](_0x5968ae,_0x2da64b);};}exports['register']=function(_0x530df5){for(var _0x529682=0x0,_0x3ed87a=events[_0x7dd1('0x3')];_0x529682<_0x3ed87a;_0x529682++){var _0x516525=events[_0x529682];var _0x4cb245=createListener(_0x7dd1('0x4')+_0x516525,_0x530df5);ChatGroupEvents['on'](_0x516525,_0x4cb245);}}; \ No newline at end of file +var _0x3a73=['save','remove','removeListener','register','length','./chatGroup.events'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x3a73,0xd1));var _0x33a7=function(_0x401a44,_0x1ac939){_0x401a44=_0x401a44-0x0;var _0x3b7ce4=_0x3a73[_0x401a44];return _0x3b7ce4;};'use strict';var ChatGroupEvents=require(_0x33a7('0x0'));var events=[_0x33a7('0x1'),_0x33a7('0x2'),'update'];function createListener(_0x16d581,_0x333591){return function(_0x5c41bb){_0x333591['emit'](_0x16d581,_0x5c41bb);};}function removeListener(_0x58aab7,_0x15f747){return function(){ChatGroupEvents[_0x33a7('0x3')](_0x58aab7,_0x15f747);};}exports[_0x33a7('0x4')]=function(_0x3a2340){for(var _0x45c64e=0x0,_0x47a6ef=events[_0x33a7('0x5')];_0x45c64e<_0x47a6ef;_0x45c64e++){var _0x41b88c=events[_0x45c64e];var _0x51cd6=createListener('chatGroup:'+_0x41b88c,_0x3a2340);ChatGroupEvents['on'](_0x41b88c,_0x51cd6);}}; \ No newline at end of file diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js index 6c09845..f1109c9 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 _0x460f=['get','index','/describe','isAuthenticated','describe','/:id','getUnread','/:id/members','getMembers','getMessages','post','addMembers','/:id/messages','addMessage','put','delete','destroy','removeMembers','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatGroup.controller'];(function(_0x39f4bd,_0x2341cd){var _0x4c70f3=function(_0x25273e){while(--_0x25273e){_0x39f4bd['push'](_0x39f4bd['shift']());}};_0x4c70f3(++_0x2341cd);}(_0x460f,0xf3));var _0xf460=function(_0x46012d,_0x3c7e2c){_0x46012d=_0x46012d-0x0;var _0x161f96=_0x460f[_0x46012d];return _0x161f96;};'use strict';var multer=require(_0xf460('0x0'));var util=require(_0xf460('0x1'));var path=require('path');var timeout=require(_0xf460('0x2'));var express=require(_0xf460('0x3'));var router=express[_0xf460('0x4')]();var fs_extra=require(_0xf460('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xf460('0x6'));var config=require(_0xf460('0x7'));var controller=require(_0xf460('0x8'));router[_0xf460('0x9')]('/',auth['isAuthenticated'](),controller[_0xf460('0xa')]);router[_0xf460('0x9')](_0xf460('0xb'),auth[_0xf460('0xc')](),controller[_0xf460('0xd')]);router[_0xf460('0x9')](_0xf460('0xe'),auth[_0xf460('0xc')](),controller['show']);router[_0xf460('0x9')]('/:id/unread',auth['isAuthenticated'](),controller[_0xf460('0xf')]);router['get'](_0xf460('0x10'),auth[_0xf460('0xc')](),controller[_0xf460('0x11')]);router[_0xf460('0x9')]('/:id/messages',auth['isAuthenticated'](),controller[_0xf460('0x12')]);router[_0xf460('0x13')]('/',auth[_0xf460('0xc')](),controller['create']);router[_0xf460('0x13')](_0xf460('0x10'),auth[_0xf460('0xc')](),controller[_0xf460('0x14')]);router[_0xf460('0x13')](_0xf460('0x15'),auth['isAuthenticated'](),controller[_0xf460('0x16')]);router[_0xf460('0x17')]('/:id',auth[_0xf460('0xc')](),controller['update']);router[_0xf460('0x18')](_0xf460('0xe'),auth[_0xf460('0xc')](),controller[_0xf460('0x19')]);router[_0xf460('0x18')](_0xf460('0x10'),auth[_0xf460('0xc')](),controller[_0xf460('0x1a')]);module[_0xf460('0x1b')]=router; \ No newline at end of file +var _0x29b4=['get','isAuthenticated','index','/describe','describe','/:id','show','/:id/unread','getUnread','/:id/members','/:id/messages','getMessages','post','addMessage','put','update','delete','removeMembers','exports','path','connect-timeout','../../components/auth/service','../../components/interaction/service','./chatGroup.controller'];(function(_0x18ed66,_0x291fbc){var _0x475187=function(_0x4ecd1d){while(--_0x4ecd1d){_0x18ed66['push'](_0x18ed66['shift']());}};_0x475187(++_0x291fbc);}(_0x29b4,0x11b));var _0x429b=function(_0xc455a0,_0x39480d){_0xc455a0=_0xc455a0-0x0;var _0x5f4949=_0x29b4[_0xc455a0];return _0x5f4949;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x429b('0x0'));var timeout=require(_0x429b('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x429b('0x2'));var interaction=require(_0x429b('0x3'));var config=require('../../config/environment');var controller=require(_0x429b('0x4'));router[_0x429b('0x5')]('/',auth[_0x429b('0x6')](),controller[_0x429b('0x7')]);router[_0x429b('0x5')](_0x429b('0x8'),auth[_0x429b('0x6')](),controller[_0x429b('0x9')]);router[_0x429b('0x5')](_0x429b('0xa'),auth[_0x429b('0x6')](),controller[_0x429b('0xb')]);router[_0x429b('0x5')](_0x429b('0xc'),auth[_0x429b('0x6')](),controller[_0x429b('0xd')]);router[_0x429b('0x5')](_0x429b('0xe'),auth['isAuthenticated'](),controller['getMembers']);router[_0x429b('0x5')](_0x429b('0xf'),auth[_0x429b('0x6')](),controller[_0x429b('0x10')]);router[_0x429b('0x11')]('/',auth[_0x429b('0x6')](),controller['create']);router[_0x429b('0x11')](_0x429b('0xe'),auth[_0x429b('0x6')](),controller['addMembers']);router[_0x429b('0x11')](_0x429b('0xf'),auth[_0x429b('0x6')](),controller[_0x429b('0x12')]);router[_0x429b('0x13')](_0x429b('0xa'),auth[_0x429b('0x6')](),controller[_0x429b('0x14')]);router[_0x429b('0x15')]('/:id',auth[_0x429b('0x6')](),controller['destroy']);router[_0x429b('0x15')]('/:id/members',auth[_0x429b('0x6')](),controller[_0x429b('0x16')]);module[_0x429b('0x17')]=router; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js index 1e6e552..66b69e2 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 _0x3dd8=['exports','BOOLEAN','ENUM','star','TEXT','STRING','long','DATE','out','INTEGER','sequelize'];(function(_0x207e53,_0x47e556){var _0x480674=function(_0xebca1e){while(--_0xebca1e){_0x207e53['push'](_0x207e53['shift']());}};_0x480674(++_0x47e556);}(_0x3dd8,0x107));var _0x83dd=function(_0xb52a5b,_0x90ad2b){_0xb52a5b=_0xb52a5b-0x0;var _0x3e7cd7=_0x3dd8[_0xb52a5b];return _0x3e7cd7;};'use strict';var Sequelize=require(_0x83dd('0x0'));module[_0x83dd('0x1')]={'closed':{'type':Sequelize[_0x83dd('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize['INTEGER']},'ratingType':{'type':Sequelize[_0x83dd('0x3')](_0x83dd('0x4'),'thumb'),'defaultValue':_0x83dd('0x4')},'ratingMessage':{'type':Sequelize[_0x83dd('0x5')]},'pathTranscript':{'type':Sequelize[_0x83dd('0x5')]},'mailTranscript':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x83dd('0x6')]},'thirdDisposition':{'type':Sequelize[_0x83dd('0x6')]},'note':{'type':Sequelize[_0x83dd('0x6')]},'browserName':{'type':Sequelize['STRING']},'browserVersion':{'type':Sequelize[_0x83dd('0x6')]},'osName':{'type':Sequelize[_0x83dd('0x6')]},'osVersion':{'type':Sequelize[_0x83dd('0x6')]},'deviceModel':{'type':Sequelize[_0x83dd('0x6')]},'deviceVendor':{'type':Sequelize[_0x83dd('0x6')]},'deviceType':{'type':Sequelize['STRING']},'referer':{'type':Sequelize[_0x83dd('0x5')]},'customerIp':{'type':Sequelize[_0x83dd('0x6')]},'formData':{'type':Sequelize['TEXT'](_0x83dd('0x7'))},'read1stAt':{'type':Sequelize[_0x83dd('0x8')]},'lastMsgAt':{'type':Sequelize[_0x83dd('0x8')]},'lastMsgDirection':{'type':Sequelize[_0x83dd('0x3')]('in',_0x83dd('0x9')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x83dd('0x6')]},'customerPort':{'type':Sequelize['STRING']},'vidaooSessionId':{'type':Sequelize[_0x83dd('0x5')]},'autoreplyExecuted':{'type':Sequelize[_0x83dd('0x2')],'defaultValue':![]},'queueId':{'type':Sequelize[_0x83dd('0xa')]}}; \ No newline at end of file +var _0x162f=['long','out','sequelize','exports','BOOLEAN','INTEGER','ENUM','star','thumb','TEXT','STRING','DATE'];(function(_0x40bffc,_0x3a45d7){var _0x3007e9=function(_0x4c8fda){while(--_0x4c8fda){_0x40bffc['push'](_0x40bffc['shift']());}};_0x3007e9(++_0x3a45d7);}(_0x162f,0x6e));var _0xf162=function(_0x248874,_0x36d19f){_0x248874=_0x248874-0x0;var _0x2b7f6c=_0x162f[_0x248874];return _0x2b7f6c;};'use strict';var Sequelize=require(_0xf162('0x0'));module[_0xf162('0x1')]={'closed':{'type':Sequelize[_0xf162('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0xf162('0x3')]},'ratingType':{'type':Sequelize[_0xf162('0x4')](_0xf162('0x5'),_0xf162('0x6')),'defaultValue':_0xf162('0x5')},'ratingMessage':{'type':Sequelize['TEXT']},'pathTranscript':{'type':Sequelize[_0xf162('0x7')]},'mailTranscript':{'type':Sequelize[_0xf162('0x8')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0xf162('0x9')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0xf162('0x8')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xf162('0x8')]},'browserName':{'type':Sequelize[_0xf162('0x8')]},'browserVersion':{'type':Sequelize['STRING']},'osName':{'type':Sequelize[_0xf162('0x8')]},'osVersion':{'type':Sequelize[_0xf162('0x8')]},'deviceModel':{'type':Sequelize[_0xf162('0x8')]},'deviceVendor':{'type':Sequelize['STRING']},'deviceType':{'type':Sequelize[_0xf162('0x8')]},'referer':{'type':Sequelize[_0xf162('0x7')]},'customerIp':{'type':Sequelize[_0xf162('0x8')]},'formData':{'type':Sequelize[_0xf162('0x7')](_0xf162('0xa'))},'read1stAt':{'type':Sequelize[_0xf162('0x9')]},'lastMsgAt':{'type':Sequelize[_0xf162('0x9')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0xf162('0xb')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0xf162('0x8')]},'customerPort':{'type':Sequelize[_0xf162('0x8')]},'vidaooSessionId':{'type':Sequelize['TEXT']},'autoreplyExecuted':{'type':Sequelize[_0xf162('0x2')],'defaultValue':![]},'queueId':{'type':Sequelize[_0xf162('0x3')]}}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js index 00794ee..f215cc7 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 _0x0791=['agentAlias','System','customer','Visitor','agentIdentifier','website_alias','agent_alias','alias','agent_fullname','createdAt','MM/DD/YYYY\x20HH:mm:ss','secret','appendFileSync','MailAccount','MailServerOut','CloudProvider','getSmtpOptions','SendMail','sendMail','\x22%s\x22\x20<%s>','Smtp','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','mailTranscript','addMessage','ids','omit','filters','hasOwnProperty','nolimit','sort','where','pick','filter','$gte','YYYY-MM-DD\x20HH:mm:ss','rows','includeAgent','push','addTags','setTags','spread','color','chatInteractionTags:save','removeTags','unix','toString','files','tmp','attachments','transcript-%d-%s.zip','lastName','direction','read','Account','Owner','get','Chat','N.A.','closedAt','browserName','referer','customerIp','customerPort','tail','existsSync','firstName','value','renderFile','views','transcript-','.pdf','download','err','unlinkSync','zip-dir','request-promise','moment','bluebird','mustache','util','path','ejs','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','api','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','jayson/promise','client','http','request','then','request\x20sent','debug','stringify','code','error','ChatInteraction,\x20%s,\x20%s','message','info','result','catch','sendStatus','status','json','offset','undefined','count','limit','set','update','end','stack','name','send','body','contact','agent','interaction','index','map','ChatInteraction','rawAttributes','fieldName','type','key','getOptions','findAll','query','params','model','keys','attributes','intersection','fields','length','includeAll','include','merge','options','create','find','destroy','describe','findOne','ChatWebsite','ChatWebsiteId','vidaooEscalation','vidaooTopic','vidaooNote','vidaooApiKey','user','fullname','email','https://api-vidaoo.xcally.com/api/v1/meetings','vidaooMetadata','parse','Sequelize','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','Error\x20in\x20Vidaoo\x20configuration','out','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','CmContact','Contact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','Interaction\x20already\x20assigned','closed','disposition','AbandonInteraction','attachmentUpload','file','originalname','basename','mimetype','Attachment','Unauthorized','attachId','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','close','server/files/chat/upload/','format','transcript-%s.txt','now','Messages','User','UserId','%s%d'];(function(_0xba76ce,_0x3c76d5){var _0x5b8dd7=function(_0x4e786b){while(--_0x4e786b){_0xba76ce['push'](_0xba76ce['shift']());}};_0x5b8dd7(++_0x3c76d5);}(_0x0791,0x117));var _0x1079=function(_0x4dc7b9,_0x319d5a){_0x4dc7b9=_0x4dc7b9-0x0;var _0x3ab114=_0x0791[_0x4dc7b9];return _0x3ab114;};'use strict';var rimraf=require('rimraf');var zipdir=require(_0x1079('0x0'));var rp=require(_0x1079('0x1'));var moment=require(_0x1079('0x2'));var BPromise=require(_0x1079('0x3'));var Mustache=require(_0x1079('0x4'));var util=require(_0x1079('0x5'));var path=require(_0x1079('0x6'));var ejs=require(_0x1079('0x7'));var fs=require('fs');var _=require(_0x1079('0x8'));var Redis=require(_0x1079('0x9'));var interaction=require(_0x1079('0xa'));var qs=require(_0x1079('0xb'));var pdf=require(_0x1079('0xc'));var logger=require('../../config/logger')(_0x1079('0xd'));var config=require(_0x1079('0xe'));var db=require(_0x1079('0xf'))['db'];config[_0x1079('0x10')]=_['defaults'](config[_0x1079('0x10')],{'host':_0x1079('0x11'),'port':0x18eb});var socket=require(_0x1079('0x12'))(new Redis(config[_0x1079('0x10')]));require('./chatInteraction.socket')['register'](socket);var jayson=require(_0x1079('0x13'));var client=jayson[_0x1079('0x14')]['http']({'port':0x232b});var client9004=jayson[_0x1079('0x14')][_0x1079('0x15')]({'port':0x232c});function respondWithRpcPromise(_0x4f1dae,_0x1e03d9,_0x31e0fb,_0x54e01e){return new BPromise(function(_0x4802d4,_0xed4a1d){var _0x502bba=_0x54e01e||client;return _0x502bba[_0x1079('0x16')](_0x4f1dae,_0x31e0fb)[_0x1079('0x17')](function(_0x1b4ee9){logger['info']('ChatInteraction,\x20%s,\x20%s',_0x1e03d9,_0x1079('0x18'));logger[_0x1079('0x19')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x1e03d9,_0x1079('0x18'),JSON[_0x1079('0x1a')](_0x1b4ee9));if(_0x1b4ee9['error']){if(_0x1b4ee9['error'][_0x1079('0x1b')]===0x1f4){logger[_0x1079('0x1c')](_0x1079('0x1d'),_0x1e03d9,_0x1b4ee9[_0x1079('0x1c')][_0x1079('0x1e')]);return _0xed4a1d(_0x1b4ee9['error'][_0x1079('0x1e')]);}logger[_0x1079('0x1c')](_0x1079('0x1d'),_0x1e03d9,_0x1b4ee9[_0x1079('0x1c')][_0x1079('0x1e')]);return _0x4802d4(_0x1b4ee9[_0x1079('0x1c')]['message']);}else{logger[_0x1079('0x1f')](_0x1079('0x1d'),_0x1e03d9,_0x1079('0x18'));_0x4802d4(_0x1b4ee9[_0x1079('0x20')][_0x1079('0x1e')]);}})[_0x1079('0x21')](function(_0x1bc11d){logger[_0x1079('0x1c')](_0x1079('0x1d'),_0x1e03d9,_0x1bc11d);_0xed4a1d(_0x1bc11d);});});}function respondWithStatusCode(_0x4d828e,_0x1825e0){_0x1825e0=_0x1825e0||0xcc;return function(_0x5360f7){if(_0x5360f7){return _0x4d828e[_0x1079('0x22')](_0x1825e0);}return _0x4d828e[_0x1079('0x23')](_0x1825e0)['end']();};}function respondWithResult(_0x40f40d,_0x53c995){_0x53c995=_0x53c995||0xc8;return function(_0x45e6ba){if(_0x45e6ba){return _0x40f40d[_0x1079('0x23')](_0x53c995)[_0x1079('0x24')](_0x45e6ba);}};}function respondWithFilteredResult(_0xa98b5f,_0x1838c2){return function(_0x2f52fd){if(_0x2f52fd){var _0xc988e5=typeof _0x1838c2[_0x1079('0x25')]===_0x1079('0x26')&&typeof _0x1838c2['limit']===_0x1079('0x26');var _0x4cab13=_0x2f52fd[_0x1079('0x27')];var _0x4f09f2=_0xc988e5?0x0:_0x1838c2[_0x1079('0x25')];var _0x5f5130=_0xc988e5?_0x2f52fd[_0x1079('0x27')]:_0x1838c2[_0x1079('0x25')]+_0x1838c2[_0x1079('0x28')];var _0x55dc46;if(_0x5f5130>=_0x4cab13){_0x5f5130=_0x4cab13;_0x55dc46=0xc8;}else{_0x55dc46=0xce;}_0xa98b5f[_0x1079('0x23')](_0x55dc46);return _0xa98b5f[_0x1079('0x29')]('Content-Range',_0x4f09f2+'-'+_0x5f5130+'/'+_0x4cab13)['json'](_0x2f52fd);}return null;};}function saveUpdates(_0x4fecdb){return function(_0x444402){if(_0x444402){return _0x444402[_0x1079('0x2a')](_0x4fecdb)[_0x1079('0x17')](function(_0x4baff2){return _0x4baff2;});}return null;};}function removeEntity(_0x24d5f9){return function(_0x50bc9c){if(_0x50bc9c){return _0x50bc9c['destroy']()[_0x1079('0x17')](function(){_0x24d5f9[_0x1079('0x23')](0xcc)[_0x1079('0x2b')]();});}};}function handleEntityNotFound(_0x321456){return function(_0x3926cf){if(!_0x3926cf){_0x321456['sendStatus'](0x194);}return _0x3926cf;};}function handleError(_0x355ae3,_0x473ef2){_0x473ef2=_0x473ef2||0x1f4;return function(_0x2aaabd){logger[_0x1079('0x1c')](_0x2aaabd[_0x1079('0x2c')]);if(_0x2aaabd['name']){delete _0x2aaabd[_0x1079('0x2d')];}_0x355ae3[_0x1079('0x23')](_0x473ef2)[_0x1079('0x2e')](_0x2aaabd);};}function getMustacheRender(_0x428e8b,_0x1b706b){return Mustache['render'](_0x428e8b,_['merge'](_0x1b706b[_0x1079('0x2f')],{'contact':_0x1b706b[_0x1079('0x30')],'message':_0x1b706b['message'],'agent':_0x1b706b[_0x1079('0x31')],'interaction':_0x1b706b[_0x1079('0x32')],'account':_0x1b706b['account']}))||'';}exports[_0x1079('0x33')]=function(_0x28ccc5,_0x1a6de8){var _0x44b0e2={};var _0x1f5d40=_[_0x1079('0x34')](db[_0x1079('0x35')][_0x1079('0x36')],function(_0x4fcb5a){return{'name':_0x4fcb5a[_0x1079('0x37')],'type':_0x4fcb5a[_0x1079('0x38')][_0x1079('0x39')]};});_0x44b0e2=qs[_0x1079('0x3a')](_0x1f5d40,_0x28ccc5);return interaction[_0x1079('0x3b')]('chat',_0x28ccc5[_0x1079('0x3c')],_0x28ccc5['user'],_0x44b0e2,_0x1f5d40)[_0x1079('0x17')](respondWithFilteredResult(_0x1a6de8,_0x44b0e2))['catch'](handleError(_0x1a6de8,null));};exports['show']=function(_0x272121,_0x2b0c36){var _0x1d8fcd={'raw':![],'where':{'id':_0x272121[_0x1079('0x3d')]['id']}},_0xc9b68f={};_0xc9b68f[_0x1079('0x3e')]=_[_0x1079('0x3f')](db[_0x1079('0x35')][_0x1079('0x36')]);_0xc9b68f['query']=_[_0x1079('0x3f')](_0x272121[_0x1079('0x3c')]);_0xc9b68f['filters']=_['intersection'](_0xc9b68f['model'],_0xc9b68f['query']);_0x1d8fcd[_0x1079('0x40')]=_[_0x1079('0x41')](_0xc9b68f[_0x1079('0x3e')],qs[_0x1079('0x42')](_0x272121[_0x1079('0x3c')][_0x1079('0x42')]));_0x1d8fcd[_0x1079('0x40')]=_0x1d8fcd['attributes'][_0x1079('0x43')]?_0x1d8fcd[_0x1079('0x40')]:_0xc9b68f[_0x1079('0x3e')];if(_0x272121['query'][_0x1079('0x44')]){_0x1d8fcd[_0x1079('0x45')]=[{'all':!![]}];}_0x1d8fcd=_[_0x1079('0x46')]({},_0x1d8fcd,_0x272121[_0x1079('0x47')]);return db['ChatInteraction']['find'](_0x1d8fcd)[_0x1079('0x17')](handleEntityNotFound(_0x2b0c36,null))['then'](respondWithResult(_0x2b0c36,null))['catch'](handleError(_0x2b0c36,null));};exports[_0x1079('0x48')]=function(_0x729a4,_0x28dd3){return db[_0x1079('0x35')]['create'](_0x729a4['body'],{})[_0x1079('0x17')](respondWithResult(_0x28dd3,0xc9))[_0x1079('0x21')](handleError(_0x28dd3,null));};exports['update']=function(_0x3954a7,_0x3e2c2b){if(_0x3954a7['body']['id']){delete _0x3954a7[_0x1079('0x2f')]['id'];}return db['ChatInteraction'][_0x1079('0x49')]({'where':{'id':_0x3954a7[_0x1079('0x3d')]['id']}})['then'](handleEntityNotFound(_0x3e2c2b,null))[_0x1079('0x17')](saveUpdates(_0x3954a7['body'],null))[_0x1079('0x17')](respondWithResult(_0x3e2c2b,null))[_0x1079('0x21')](handleError(_0x3e2c2b,null));};exports[_0x1079('0x4a')]=function(_0xae9cba,_0x3666a6){return db[_0x1079('0x35')]['find']({'where':{'id':_0xae9cba[_0x1079('0x3d')]['id']}})[_0x1079('0x17')](handleEntityNotFound(_0x3666a6,null))[_0x1079('0x17')](removeEntity(_0x3666a6,null))[_0x1079('0x21')](handleError(_0x3666a6,null));};exports[_0x1079('0x4b')]=function(_0x540ead,_0x188571){return db['ChatInteraction'][_0x1079('0x4b')]()['then'](respondWithResult(_0x188571,null))[_0x1079('0x21')](handleError(_0x188571,null));};exports['createVidaooSession']=function(_0x2632fa,_0x1c21d8){var _0x296245=_0x2632fa[_0x1079('0x3d')]['id'];var _0x40c96f;var _0x58fb63;var _0x27fc37;return db[_0x1079('0x35')][_0x1079('0x4c')]({'where':{'id':_0x296245}})[_0x1079('0x17')](function(_0xf3476f){_0x40c96f=_0xf3476f;return db[_0x1079('0x4d')][_0x1079('0x4c')]({'where':{'id':_0xf3476f[_0x1079('0x4e')]},'attributes':['id','vidaooApiKey',_0x1079('0x4f'),_0x1079('0x50'),_0x1079('0x51'),'vidaooMetadata'],'raw':!![]});})[_0x1079('0x17')](function(_0x107080){if(_0x107080&&_0x107080[_0x1079('0x52')]&&_0x107080['vidaooEscalation']){_0x58fb63=_0x107080;var _0xa05ff6={'interaction':{'id':_0x296245},'agent':{'id':_0x2632fa[_0x1079('0x53')]['id'],'name':_0x2632fa[_0x1079('0x53')][_0x1079('0x2d')],'fullname':_0x2632fa[_0x1079('0x53')][_0x1079('0x54')],'email':_0x2632fa['user'][_0x1079('0x55')]},'contact':_0x2632fa[_0x1079('0x2f')]['contact'],'account':_0x2632fa[_0x1079('0x2f')]['account']};var _0x1f2a60={'rejectUnauthorized':![],'method':'POST','url':_0x1079('0x56'),'headers':{'X-APIKEY':_0x107080[_0x1079('0x52')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x2632fa[_0x1079('0x53')][_0x1079('0x55')]],'buttons':null,'topic':_0x58fb63['vidaooTopic'],'note':_['isNull'](_0x58fb63[_0x1079('0x51')])?null:getMustacheRender(_0x58fb63[_0x1079('0x51')],_0xa05ff6),'metadata':null},'redirect':'follow','json':!![]};try{if(!_['isNull'](_0x58fb63[_0x1079('0x57')])){var _0x5e568c=getMustacheRender(_0x58fb63['vidaooMetadata'],_0xa05ff6);var _0x520f1b=JSON[_0x1079('0x58')](_0x5e568c);_0x1f2a60['body']['metadata']=_0x520f1b;}}catch(_0x4ac642){throw new db[(_0x1079('0x59'))][(_0x1079('0x5a'))](_0x1079('0x5b'));}return rp(_0x1f2a60);}else{throw new db[(_0x1079('0x59'))][(_0x1079('0x5a'))](_0x1079('0x5c'));}})['then'](function(_0x1097c0){_0x27fc37=_0x1097c0;if(_0x27fc37['id']){var _0x5b5ec4={'body':_0x27fc37['join_url'],'ChatWebsiteId':_0x58fb63['id'],'ChatInteractionId':_0x40c96f['id'],'direction':_0x1079('0x5d'),'UserId':_0x2632fa['user']['id']};return db[_0x1079('0x5e')][_0x1079('0x48')](_0x5b5ec4,{});}else{throw new db[(_0x1079('0x59'))][(_0x1079('0x5a'))](_0x1079('0x5f'));}})[_0x1079('0x17')](function(){return _0x40c96f[_0x1079('0x60')]({'vidaooSessionId':_0x27fc37['id']});})[_0x1079('0x17')](respondWithResult(_0x1c21d8,null))[_0x1079('0x21')](handleError(_0x1c21d8,null));};exports[_0x1079('0x61')]=function(_0x234e2c,_0x488a55){if(_0x234e2c[_0x1079('0x2f')]['id']){delete _0x234e2c[_0x1079('0x2f')]['id'];}return db['ChatInteraction'][_0x1079('0x49')]({'where':{'id':_0x234e2c[_0x1079('0x3d')]['id']},'include':[{'model':db[_0x1079('0x62')],'as':_0x1079('0x63')}]})['then'](handleEntityNotFound(_0x488a55,null))['then'](saveUpdates(_0x234e2c[_0x1079('0x2f')],null))['then'](respondWithResult(_0x488a55,null))[_0x1079('0x21')](handleError(_0x488a55,null));};exports[_0x1079('0x64')]=function(_0x5224d2,_0x42fbb5){if(_0x5224d2['body']['id']){delete _0x5224d2['body']['id'];}return db[_0x1079('0x35')][_0x1079('0x49')]({'where':{'id':_0x5224d2[_0x1079('0x3d')]['id']}})[_0x1079('0x17')](function(_0x961898){if(!_0x961898){logger[_0x1079('0x1c')](_0x1079('0x65'),'abandon',0x194,_0x1079('0x66'));_0x42fbb5[_0x1079('0x22')](0x194);}else{if(_0x961898['UserId']){throw new db[(_0x1079('0x59'))]['ValidationError'](_0x1079('0x67'));}}return _0x961898;})['then'](function(_0x3efc3e){if(_0x3efc3e){return _0x3efc3e[_0x1079('0x2a')]({'closed':_0x5224d2[_0x1079('0x2f')][_0x1079('0x68')],'disposition':_0x5224d2[_0x1079('0x2f')][_0x1079('0x69')]})[_0x1079('0x17')](function(_0x592fad){return _0x592fad;});}})[_0x1079('0x17')](function(){return respondWithRpcPromise(_0x1079('0x6a'),_0x1079('0x64'),_0x5224d2[_0x1079('0x2f')],client9004);})[_0x1079('0x17')](respondWithResult(_0x42fbb5,null))[_0x1079('0x21')](handleError(_0x42fbb5,null));};exports[_0x1079('0x6b')]=function(_0x41dea8,_0x1718ef){_0x41dea8['body'][_0x1079('0x2d')]=_0x41dea8[_0x1079('0x6c')][_0x1079('0x6d')];_0x41dea8[_0x1079('0x2f')][_0x1079('0x6e')]=_0x41dea8['file']['filename'];_0x41dea8['body'][_0x1079('0x38')]=_0x41dea8[_0x1079('0x6c')][_0x1079('0x6f')];return db[_0x1079('0x70')][_0x1079('0x48')](_0x41dea8[_0x1079('0x2f')])[_0x1079('0x17')](respondWithResult(_0x1718ef,0xc9))[_0x1079('0x21')](handleError(_0x1718ef,null));};exports['attachmentDownload']=function(_0x52d5de,_0x5becd4){return db[_0x1079('0x35')][_0x1079('0x4c')]({'where':{'id':_0x52d5de[_0x1079('0x3d')]['id']},'raw':!![]})[_0x1079('0x17')](handleEntityNotFound(_0x5becd4,null))[_0x1079('0x17')](function(_0x5b3bf1){if(_0x5b3bf1){if(_0x5b3bf1[_0x1079('0x68')]){return _0x5becd4[_0x1079('0x23')](0x193)[_0x1079('0x24')]({'status':0x193,'message':_0x1079('0x71')});}return db[_0x1079('0x70')][_0x1079('0x4c')]({'where':{'id':_0x52d5de[_0x1079('0x3c')][_0x1079('0x72')]},'raw':!![]})[_0x1079('0x17')](handleEntityNotFound(_0x5becd4,null));}})[_0x1079('0x17')](function(_0x39e5de){if(_0x39e5de){var _0x1d2a5c=_0x39e5de[_0x1079('0x73')]!==null;var _0x23224d=path[_0x1079('0x74')](config[_0x1079('0x75')],_0x1079('0x76'));if(_0x1d2a5c){_0x23224d=path[_0x1079('0x74')](_0x23224d,_0x1079('0x77'));}var _0x3554ad=path['join'](_0x23224d,_0x39e5de['basename']);return _0x5becd4['download'](_0x3554ad);}})['catch'](handleError(_0x5becd4,null));};exports[_0x1079('0x78')]=function(_0x33a17c,_0x13c7f1){var _0x2f6748=null;var _0x151d72=null;var _0x5694fa=null;if(_0x33a17c[_0x1079('0x2f')]['id']){delete _0x33a17c['body']['id'];}if(_0x33a17c['body']['mailTranscript']){_0x5694fa=path[_0x1079('0x74')](config[_0x1079('0x75')],_0x1079('0x79'),util[_0x1079('0x7a')](_0x1079('0x7b'),Date[_0x1079('0x7c')]()));_0x33a17c[_0x1079('0x2f')]['pathTranscript']=_0x5694fa;}return db[_0x1079('0x35')]['find']({'where':{'id':_0x33a17c[_0x1079('0x3d')]['id']},'include':[{'model':db[_0x1079('0x5e')],'as':_0x1079('0x7d'),'include':[{'model':db[_0x1079('0x7e')],'as':_0x1079('0x7e')}]}]})[_0x1079('0x17')](handleEntityNotFound(_0x13c7f1,null))[_0x1079('0x17')](saveUpdates(_0x33a17c['body'],null))[_0x1079('0x17')](function(_0x5e7349){if(_0x5e7349){_0x2f6748=_0x5e7349;return db[_0x1079('0x4d')][_0x1079('0x49')]({'where':{'id':_0x2f6748[_0x1079('0x4e')]}});}})[_0x1079('0x17')](function(_0xcbac1b){if(_0xcbac1b){_0x151d72=_0xcbac1b;return db['CmContact']['find']({'where':{'id':_0x2f6748['ContactId']}});}})[_0x1079('0x17')](function(_0x41c880){if(_0x41c880){if(_0x5694fa){var _0x4c459f=null;for(var _0x43f19c=0x1;_0x43f19c<_0x2f6748['Messages'][_0x1079('0x43')];++_0x43f19c){_0x4c459f=_0x2f6748[_0x1079('0x7d')][_0x43f19c];var _0x3032c1=_0x4c459f[_0x1079('0x7f')]?util['format'](_0x1079('0x80'),_0x151d72[_0x1079('0x81')],_0x4c459f[_0x1079('0x7f')]):_0x1079('0x82');var _0x4739a6=_0x33a17c[_0x1079('0x2f')][_0x1079('0x83')]||util['format'](_0x1079('0x80'),_0x1079('0x84'),_0x4c459f['ContactId']);switch(_0x151d72[_0x1079('0x85')]){case _0x1079('0x86'):_0x3032c1=_0x4c459f['UserId']?util[_0x1079('0x7a')](_0x1079('0x80'),_0x151d72[_0x1079('0x81')],_0x4c459f[_0x1079('0x7f')]):_0x1079('0x82');break;case _0x1079('0x87'):_0x3032c1=_0x4c459f[_0x1079('0x7f')]?_0x4c459f['User'][_0x1079('0x88')]||_0x4c459f[_0x1079('0x7e')][_0x1079('0x54')]:_0x1079('0x82');break;case _0x1079('0x89'):_0x3032c1=_0x4c459f[_0x1079('0x7f')]?_0x4c459f['User']['fullname']:_0x1079('0x82');break;default:_0x3032c1=_0x4c459f[_0x1079('0x7f')]?util[_0x1079('0x7a')](_0x1079('0x80'),_0x151d72[_0x1079('0x81')],_0x4c459f[_0x1079('0x7f')]):'System';}var _0x9eb0f=util['format']('[%s]\x20%s:\x20%s\x0a',moment(_0x4c459f[_0x1079('0x8a')])['format'](_0x1079('0x8b')),_0x4c459f['direction']==='in'?_0x4739a6:_0x3032c1,_0x4c459f['body']);if(!_0x4c459f[_0x1079('0x8c')]){fs[_0x1079('0x8d')](_0x5694fa,_0x9eb0f);}}return db[_0x1079('0x8e')]['findOne']({'where':{'service':!![]},'include':[{'model':db[_0x1079('0x8f')],'as':'Smtp','raw':!![],'include':[{'model':db[_0x1079('0x90')],'as':_0x1079('0x90'),'raw':!![]}]}]});}}})[_0x1079('0x17')](function(_0x375584){if(!_0x375584||!_0x375584['Smtp']||!_0x33a17c['body'])return _0x2f6748;var _0x1c67bc=_0x375584[_0x1079('0x91')]();return respondWithRpcPromise(_0x1079('0x92'),_0x1079('0x93'),{'account':_0x1c67bc,'message':{'from':util[_0x1079('0x7a')](_0x1079('0x94'),_0x375584['name'],_0x375584[_0x1079('0x55')]||_0x375584[_0x1079('0x95')][_0x1079('0x53')]),'to':_0x33a17c['body']['mailTranscript'],'subject':_0x1079('0x96'),'text':util[_0x1079('0x7a')](_0x1079('0x97'),_0x33a17c[_0x1079('0x2f')][_0x1079('0x98')]),'attachments':[{'path':_0x5694fa}]}})[_0x1079('0x17')](function(){return _0x2f6748;})[_0x1079('0x21')](function(_0x3aaaf6){logger[_0x1079('0x1c')](_0x3aaaf6);});})[_0x1079('0x17')](respondWithStatusCode(_0x13c7f1,0xc8))[_0x1079('0x21')](handleError(_0x13c7f1,null));};exports[_0x1079('0x99')]=function(_0x4374a7,_0x42f9cf){return db['ChatMessage'][_0x1079('0x49')]({'where':{'id':_0x4374a7[_0x1079('0x3d')]['id']}})['then'](handleEntityNotFound(_0x42f9cf,null))[_0x1079('0x17')](function(_0x19dd55){if(_0x19dd55){return _0x19dd55[_0x1079('0x99')](_0x4374a7[_0x1079('0x2f')][_0x1079('0x9a')],_[_0x1079('0x9b')](_0x4374a7[_0x1079('0x2f')],['ids','id'])||{});}})['then'](respondWithResult(_0x42f9cf,null))[_0x1079('0x21')](handleError(_0x42f9cf,null));};exports['getMessages']=function(_0x1bd60e,_0x209bd9){var _0x2dcf79={'raw':![],'where':{}};var _0x19e69f={};var _0x1138f1={'count':0x0,'rows':[]};return db[_0x1079('0x35')]['findOne']({'where':{'id':_0x1bd60e[_0x1079('0x3d')]['id']}})[_0x1079('0x17')](handleEntityNotFound(_0x209bd9,null))['then'](function(_0x4db56c){if(_0x4db56c){_0x19e69f['model']=_['keys'](db['ChatMessage'][_0x1079('0x36')]);_0x19e69f[_0x1079('0x3c')]=_['keys'](_0x1bd60e[_0x1079('0x3c')]);_0x19e69f[_0x1079('0x9c')]=_['intersection'](_0x19e69f[_0x1079('0x3e')],_0x19e69f[_0x1079('0x3c')]);_0x2dcf79[_0x1079('0x40')]=_['intersection'](_0x19e69f['model'],qs['fields'](_0x1bd60e[_0x1079('0x3c')][_0x1079('0x42')]));_0x2dcf79[_0x1079('0x40')]=_0x2dcf79[_0x1079('0x40')]['length']?_0x2dcf79[_0x1079('0x40')]:_0x19e69f[_0x1079('0x3e')];if(!_0x1bd60e[_0x1079('0x3c')][_0x1079('0x9d')](_0x1079('0x9e'))){_0x2dcf79[_0x1079('0x28')]=qs[_0x1079('0x28')](_0x1bd60e[_0x1079('0x3c')][_0x1079('0x28')]);_0x2dcf79[_0x1079('0x25')]=qs[_0x1079('0x25')](_0x1bd60e[_0x1079('0x3c')]['offset']);}_0x2dcf79['order']=qs[_0x1079('0x9f')](_0x1bd60e['query'][_0x1079('0x9f')]);_0x2dcf79[_0x1079('0xa0')]=qs[_0x1079('0x9c')](_[_0x1079('0xa1')](_0x1bd60e[_0x1079('0x3c')],_0x19e69f[_0x1079('0x9c')]));_0x2dcf79['where']['ChatInteractionId']=_0x4db56c['id'];if(_0x1bd60e[_0x1079('0x3c')][_0x1079('0xa2')]){_0x2dcf79[_0x1079('0xa0')]=_[_0x1079('0x46')](_0x2dcf79['where'],{'$or':_['map'](_0x2dcf79[_0x1079('0x40')],function(_0x4f896a){var _0x138db3={};_0x138db3[_0x4f896a]={'$like':'%'+_0x1bd60e[_0x1079('0x3c')]['filter']+'%'};return _0x138db3;})});}if(_0x1bd60e[_0x1079('0x3c')][_0x1079('0xa3')]){var _0x71e1ca=_0x1bd60e['query']['$gte']['split'](',');var _0x17dd61={};_0x17dd61[_0x71e1ca[0x0]]={'$gte':moment(_0x71e1ca[0x1])[_0x1079('0x7a')](_0x1079('0xa4'))};_0x2dcf79[_0x1079('0xa0')]=_[_0x1079('0x46')](_0x2dcf79[_0x1079('0xa0')],_0x17dd61);}_0x2dcf79=_[_0x1079('0x46')]({},_0x2dcf79,_0x1bd60e[_0x1079('0x47')]);return db[_0x1079('0x5e')][_0x1079('0x27')]({'where':_0x2dcf79[_0x1079('0xa0')]})['then'](function(_0x737cae){_0x1138f1[_0x1079('0x27')]=_0x737cae;if(_0x1bd60e[_0x1079('0x3c')][_0x1079('0x44')]){_0x2dcf79['include']=[{'all':!![]}];}return db[_0x1079('0x5e')][_0x1079('0x3b')](_0x2dcf79);})[_0x1079('0x17')](function(_0x27f7df){_0x1138f1[_0x1079('0xa5')]=_0x27f7df;return _0x1138f1;});}})[_0x1079('0x17')](respondWithFilteredResult(_0x209bd9,_0x2dcf79))[_0x1079('0x21')](handleError(_0x209bd9,null));};exports['getMyMessages']=function(_0x384e6a,_0x16673b){var _0x62777f={'where':{}},_0x51fb97={},_0x526cb0={'count':0x0,'rows':[]};return db[_0x1079('0x35')][_0x1079('0x4c')]({'where':{'id':_0x384e6a[_0x1079('0x3d')]['id']}})['then'](handleEntityNotFound(_0x16673b,null))[_0x1079('0x17')](function(_0x504604){if(_0x504604){_0x51fb97[_0x1079('0x3e')]=_[_0x1079('0x3f')](db[_0x1079('0x5e')][_0x1079('0x36')]);_0x51fb97[_0x1079('0x3c')]=_['keys'](_0x384e6a[_0x1079('0x3c')]);_0x51fb97[_0x1079('0x9c')]=_[_0x1079('0x41')](_0x51fb97['model'],_0x51fb97[_0x1079('0x3c')]);_0x62777f[_0x1079('0x40')]=_['intersection'](_0x51fb97['model'],qs[_0x1079('0x42')](_0x384e6a[_0x1079('0x3c')][_0x1079('0x42')]));_0x62777f[_0x1079('0x40')]=_0x62777f[_0x1079('0x40')][_0x1079('0x43')]?_0x62777f[_0x1079('0x40')]:_0x51fb97[_0x1079('0x3e')];if(!_0x384e6a[_0x1079('0x3c')][_0x1079('0x9d')]('nolimit')){_0x62777f[_0x1079('0x28')]=qs[_0x1079('0x28')](_0x384e6a['query']['limit']);_0x62777f[_0x1079('0x25')]=qs[_0x1079('0x25')](_0x384e6a[_0x1079('0x3c')]['offset']);}_0x62777f['order']=qs['sort'](_0x384e6a[_0x1079('0x3c')][_0x1079('0x9f')]);_0x62777f['where']=qs[_0x1079('0x9c')](_[_0x1079('0xa1')](_0x384e6a[_0x1079('0x3c')],_0x51fb97[_0x1079('0x9c')]));_0x62777f[_0x1079('0xa0')]['ChatInteractionId']=_0x504604['id'];if(_0x384e6a[_0x1079('0x3c')][_0x1079('0xa2')]){_0x62777f[_0x1079('0xa0')]=_[_0x1079('0x46')](_0x62777f[_0x1079('0xa0')],{'$or':_[_0x1079('0x34')](_0x62777f[_0x1079('0x40')],function(_0x501c63){var _0x1bf651={};_0x1bf651[_0x501c63]={'$like':'%'+_0x384e6a[_0x1079('0x3c')][_0x1079('0xa2')]+'%'};return _0x1bf651;})});}_0x62777f[_0x1079('0xa0')]['secret']=![];if(_0x384e6a[_0x1079('0x3c')]['id']){_0x62777f[_0x1079('0xa0')]['id']={'$gt':_0x384e6a['query']['id']};}_0x62777f=_[_0x1079('0x46')]({},_0x62777f,_0x384e6a[_0x1079('0x47')]);return db[_0x1079('0x5e')]['count']({'where':_0x62777f[_0x1079('0xa0')]})['then'](function(_0x58f639){_0x526cb0[_0x1079('0x27')]=_0x58f639;_0x62777f[_0x1079('0x45')]=[];if(_0x384e6a[_0x1079('0x3c')][_0x1079('0xa6')]){_0x62777f[_0x1079('0x45')][_0x1079('0xa7')]({'model':db[_0x1079('0x7e')],'as':_0x1079('0x7e'),'attributes':['id',_0x1079('0x54'),'alias']});}if(_0x384e6a['query'][_0x1079('0x44')]){_0x62777f[_0x1079('0x45')]=[{'all':!![]}];}return db[_0x1079('0x5e')][_0x1079('0x3b')](_0x62777f);})['then'](function(_0x238539){_0x526cb0[_0x1079('0xa5')]=_0x238539;return _0x526cb0;});}})[_0x1079('0x17')](respondWithFilteredResult(_0x16673b,_0x62777f))['catch'](handleError(_0x16673b,null));};exports[_0x1079('0xa8')]=function(_0x2a0fa2,_0x5034ca){return db[_0x1079('0x35')][_0x1079('0x49')]({'where':{'id':_0x2a0fa2[_0x1079('0x3d')]['id']}})[_0x1079('0x17')](handleEntityNotFound(_0x5034ca,null))['then'](function(_0x29fced){if(_0x29fced){return _0x29fced[_0x1079('0xa9')](_0x2a0fa2[_0x1079('0x2f')][_0x1079('0x9a')],_[_0x1079('0x9b')](_0x2a0fa2[_0x1079('0x2f')],[_0x1079('0x9a'),'id'])||{})[_0x1079('0xaa')](function(){return db['Tag'][_0x1079('0x3b')]({'attributes':['id',_0x1079('0x2d'),_0x1079('0xab')],'where':{'id':_0x2a0fa2['body'][_0x1079('0x9a')]}});})[_0x1079('0x17')](function(_0x25ab7d){socket['emit'](_0x1079('0xac'),{'id':Number(_0x2a0fa2[_0x1079('0x3d')]['id']),'tags':_0x25ab7d||[]});return{'id':Number(_0x2a0fa2[_0x1079('0x3d')]['id']),'tags':_0x25ab7d||[]};});}})[_0x1079('0x17')](respondWithResult(_0x5034ca,null))[_0x1079('0x21')](handleError(_0x5034ca,null));};exports[_0x1079('0xad')]=function(_0x2968b7,_0x2d88dd){return db[_0x1079('0x35')]['find']({'where':{'id':_0x2968b7[_0x1079('0x3d')]['id']}})[_0x1079('0x17')](handleEntityNotFound(_0x2d88dd,null))[_0x1079('0x17')](function(_0x33df11){if(_0x33df11){return _0x33df11['removeTags'](_0x2968b7[_0x1079('0x3c')]['ids']);}})[_0x1079('0x17')](respondWithStatusCode(_0x2d88dd,null))['catch'](handleError(_0x2d88dd,null));};exports['download']=function(_0x16d9f0,_0x45711d){var _0x81a726=moment()[_0x1079('0xae')]()[_0x1079('0xaf')]();var _0x112dac=path[_0x1079('0x74')](config[_0x1079('0x75')],'server',_0x1079('0xb0'),_0x1079('0xb1'));var _0x4cf3e4=path[_0x1079('0x74')](config['root'],'server',_0x1079('0xb0'),_0x1079('0xb2'));var _0x1422c8=path[_0x1079('0x74')](_0x112dac,_0x81a726);var _0x28679a=util[_0x1079('0x7a')](_0x1079('0xb3'),_0x16d9f0[_0x1079('0x3d')]['id'],_0x81a726);var _0x45e5c0=path['join'](_0x112dac,_0x28679a);var _0x4d945e=[];_0x4d945e[_0x1079('0xa7')]({'model':db['User'],'as':_0x1079('0x7e'),'attributes':['id',_0x1079('0x54')],'raw':!![]});_0x4d945e['push']({'model':db[_0x1079('0x62')],'as':_0x1079('0x63'),'attributes':['id','firstName',_0x1079('0xb4')],'raw':!![]});if(_0x16d9f0[_0x1079('0x3c')][_0x1079('0xb2')]){_0x4d945e['push']({'model':db['Attachment'],'as':_0x1079('0x70'),'raw':!![]});}var _0x343655=[{'model':db['ChatMessage'],'as':_0x1079('0x7d'),'attributes':['id','body',_0x1079('0x8a'),_0x1079('0xb5'),'secret',_0x1079('0xb6')],'include':_0x4d945e}];_0x343655[_0x1079('0xa7')]({'model':db[_0x1079('0x4d')],'as':_0x1079('0xb7'),'attributes':['id',_0x1079('0x2d')]});_0x343655[_0x1079('0xa7')]({'model':db[_0x1079('0x7e')],'as':_0x1079('0xb8'),'attributes':['id',_0x1079('0x54')]});return db[_0x1079('0x35')][_0x1079('0x49')]({'where':{'id':_0x16d9f0[_0x1079('0x3d')]['id']},'include':_0x343655})['then'](handleEntityNotFound(_0x45711d,null))[_0x1079('0x17')](function(_0x323a4b){if(_0x323a4b){var _0x20b031=_0x323a4b[_0x1079('0xb9')]({'plain':!![]});fs['mkdirSync'](_0x1422c8);var _0x5e360f={'channel':_0x1079('0xba'),'account':_0x20b031[_0x1079('0xb7')]['name'],'agent':_0x20b031['Owner']?_0x20b031[_0x1079('0xb8')][_0x1079('0x54')]:_0x1079('0xbb'),'createdAt':moment(_0x20b031['createdAt'])[_0x1079('0x7a')](_0x1079('0xa4'))[_0x1079('0xaf')](),'closedAt':_0x20b031[_0x1079('0x68')]?moment(_0x20b031[_0x1079('0xbc')])['format'](_0x1079('0xa4'))[_0x1079('0xaf')]():'','disposition':_0x20b031[_0x1079('0x69')],'chatInfo':{'browser':_0x20b031[_0x1079('0xbd')],'os':_0x20b031['osName'],'referer':_0x20b031[_0x1079('0xbe')],'customerIp':_0x20b031[_0x1079('0xbf')],'customerPort':_0x20b031[_0x1079('0xc0')]?_0x20b031[_0x1079('0xc0')]:_0x1079('0xbb')},'messages':_(_0x20b031[_0x1079('0x7d')])[_0x1079('0xc1')]()[_0x1079('0xa2')]({'secret':![]})[_0x1079('0x34')](function(_0x6f16fb){if(_0x6f16fb[_0x1079('0x70')]){var _0x418f35=path['join'](_0x4cf3e4,_0x6f16fb[_0x1079('0x70')][_0x1079('0x6e')]);if(fs[_0x1079('0xc2')](_0x418f35)){fs['createReadStream'](_0x418f35)['pipe'](fs['createWriteStream'](path[_0x1079('0x74')](_0x1422c8,_0x6f16fb[_0x1079('0x70')][_0x1079('0x6e')])));}}return{'date':moment(_0x6f16fb[_0x1079('0x8a')])['format'](_0x1079('0xa4'))['toString'](),'sender':_0x6f16fb[_0x1079('0xb5')]===_0x1079('0x5d')?_0x6f16fb['User']?_0x6f16fb[_0x1079('0x7e')]['fullname']:'System':_0x6f16fb[_0x1079('0x63')][_0x1079('0xc3')]+(_0x6f16fb[_0x1079('0x63')][_0x1079('0xb4')]?'\x20'+_0x6f16fb[_0x1079('0x63')]['lastName']:''),'body':_0x6f16fb[_0x1079('0x70')]?_0x6f16fb[_0x1079('0x70')][_0x1079('0x6e')]:_0x6f16fb[_0x1079('0x2f')],'direction':_0x6f16fb['direction']===_0x1079('0x5d')?'A':'C','secret':_0x6f16fb[_0x1079('0x8c')],'read':_0x6f16fb[_0x1079('0xb6')],'attachment':_0x6f16fb['Attachment']};})[_0x1079('0xc4')]()};return ejs[_0x1079('0xc5')](path['join'](config[_0x1079('0x75')],'server',_0x1079('0xc6'),'downloadInteraction.ejs'),{'interaction':_0x5e360f})[_0x1079('0x17')](function(_0x44fb85){var _0x30b619=path[_0x1079('0x74')](_0x1422c8,_0x1079('0xc7')+_0x20b031['id']+'-'+_0x81a726+_0x1079('0xc8'));var _0x5a6a20={'path':_0x30b619,'channel':_0x1079('0xba'),'interactionId':_0x20b031['id']};return pdf['createPdfFromHTML'](_0x44fb85,_0x5a6a20);})[_0x1079('0x17')](function(){return new Promise(function(_0x40f9b9,_0x1172fe){zipdir(_0x1422c8,{'saveTo':_0x45e5c0},function(_0x49282f,_0x1a990f){if(_0x49282f)return _0x1172fe(_0x49282f);return _0x40f9b9(_0x1a990f);});})[_0x1079('0x17')](function(){return new BPromise(function(_0x3e2907,_0xcda302){rimraf(_0x1422c8,function(_0x535329){if(_0x535329)_0xcda302(_0x535329);return _0x3e2907();});});})[_0x1079('0x17')](function(){return _0x45711d[_0x1079('0xc9')](_0x45e5c0,_0x28679a,function(_0x48dd54){if(_0x48dd54){logger[_0x1079('0x1c')](_0x1079('0xca'),_0x48dd54);}else{fs[_0x1079('0xcb')](_0x45e5c0);}});});});}else{return _0x45711d[_0x1079('0x22')](0xc8);}})[_0x1079('0x21')](handleError(_0x45711d,null));}; \ No newline at end of file +var _0xf1e4=['ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','sendStatus','status','end','json','undefined','limit','count','offset','update','destroy','stack','name','send','render','merge','body','contact','agent','interaction','account','index','map','ChatInteraction','rawAttributes','fieldName','type','key','getOptions','findAll','show','params','model','query','keys','filters','intersection','attributes','fields','length','includeAll','include','options','find','create','describe','createVidaooSession','ChatWebsite','vidaooApiKey','vidaooEscalation','vidaooTopic','vidaooNote','vidaooMetadata','user','fullname','email','POST','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','follow','parse','metadata','Sequelize','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','Error\x20in\x20Vidaoo\x20configuration','join_url','ChatMessage','updateAttributes','customUpdate','CmContact','Contact','abandon','entity\x20not\x20found','UserId','Interaction\x20already\x20assigned','closed','AbandonInteraction','originalname','basename','file','filename','Attachment','findOne','Unauthorized','join','root','server/files/attachments/','offline-chat/','download','server/files/chat/upload/','format','transcript-%s.txt','Messages','ContactId','%s%d','agentAlias','System','customer','Visitor','website_alias','agent_alias','User','alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','createdAt','MM/DD/YYYY\x20HH:mm:ss','direction','appendFileSync','MailAccount','MailServerOut','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','hasOwnProperty','order','sort','where','pick','ChatInteractionId','filter','$gte','YYYY-MM-DD\x20HH:mm:ss','rows','nolimit','secret','includeAgent','push','addTags','setTags','spread','Tag','color','chatInteractionTags:save','removeTags','server','attachments','transcript-%d-%s.zip','firstName','lastName','read','Account','Owner','get','mkdirSync','N.A.','toString','browserName','osName','referer','customerIp','customerPort','tail','existsSync','createReadStream','pipe','createWriteStream','out','value','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','err','unlinkSync','rimraf','zip-dir','moment','bluebird','mustache','util','path','lodash','ioredis','../../components/interaction/service','../../config/logger','api','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','jayson/promise','client','then','ChatInteraction,\x20%s,\x20%s','request\x20sent'];(function(_0x36d8fa,_0x55625d){var _0x10fb8e=function(_0x3730f9){while(--_0x3730f9){_0x36d8fa['push'](_0x36d8fa['shift']());}};_0x10fb8e(++_0x55625d);}(_0xf1e4,0xb8));var _0x4f1e=function(_0x5a5618,_0x96b320){_0x5a5618=_0x5a5618-0x0;var _0x6d362c=_0xf1e4[_0x5a5618];return _0x6d362c;};'use strict';var rimraf=require(_0x4f1e('0x0'));var zipdir=require(_0x4f1e('0x1'));var rp=require('request-promise');var moment=require(_0x4f1e('0x2'));var BPromise=require(_0x4f1e('0x3'));var Mustache=require(_0x4f1e('0x4'));var util=require(_0x4f1e('0x5'));var path=require(_0x4f1e('0x6'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x4f1e('0x7'));var Redis=require(_0x4f1e('0x8'));var interaction=require(_0x4f1e('0x9'));var qs=require('../../components/parsers/qs');var pdf=require('../../components/export/pdf');var logger=require(_0x4f1e('0xa'))(_0x4f1e('0xb'));var config=require(_0x4f1e('0xc'));var db=require(_0x4f1e('0xd'))['db'];config[_0x4f1e('0xe')]=_['defaults'](config[_0x4f1e('0xe')],{'host':_0x4f1e('0xf'),'port':0x18eb});var socket=require(_0x4f1e('0x10'))(new Redis(config['redis']));require('./chatInteraction.socket')['register'](socket);var jayson=require(_0x4f1e('0x11'));var client=jayson[_0x4f1e('0x12')]['http']({'port':0x232b});var client9004=jayson['client']['http']({'port':0x232c});function respondWithRpcPromise(_0x182b8a,_0x35ab7b,_0xaba2ed,_0xfcb0c6){return new BPromise(function(_0x50d906,_0x1494fa){var _0x39a21b=_0xfcb0c6||client;return _0x39a21b['request'](_0x182b8a,_0xaba2ed)[_0x4f1e('0x13')](function(_0x317a5c){logger['info'](_0x4f1e('0x14'),_0x35ab7b,_0x4f1e('0x15'));logger['debug'](_0x4f1e('0x16'),_0x35ab7b,_0x4f1e('0x15'),JSON[_0x4f1e('0x17')](_0x317a5c));if(_0x317a5c[_0x4f1e('0x18')]){if(_0x317a5c[_0x4f1e('0x18')]['code']===0x1f4){logger[_0x4f1e('0x18')](_0x4f1e('0x14'),_0x35ab7b,_0x317a5c['error'][_0x4f1e('0x19')]);return _0x1494fa(_0x317a5c[_0x4f1e('0x18')]['message']);}logger[_0x4f1e('0x18')](_0x4f1e('0x14'),_0x35ab7b,_0x317a5c[_0x4f1e('0x18')][_0x4f1e('0x19')]);return _0x50d906(_0x317a5c[_0x4f1e('0x18')][_0x4f1e('0x19')]);}else{logger[_0x4f1e('0x1a')](_0x4f1e('0x14'),_0x35ab7b,'request\x20sent');_0x50d906(_0x317a5c[_0x4f1e('0x1b')]['message']);}})[_0x4f1e('0x1c')](function(_0x4f3e0d){logger['error'](_0x4f1e('0x14'),_0x35ab7b,_0x4f3e0d);_0x1494fa(_0x4f3e0d);});});}function respondWithStatusCode(_0xdc0eaa,_0x1590df){_0x1590df=_0x1590df||0xcc;return function(_0x326e7f){if(_0x326e7f){return _0xdc0eaa[_0x4f1e('0x1d')](_0x1590df);}return _0xdc0eaa[_0x4f1e('0x1e')](_0x1590df)[_0x4f1e('0x1f')]();};}function respondWithResult(_0x50110b,_0xb0757c){_0xb0757c=_0xb0757c||0xc8;return function(_0x3e0d90){if(_0x3e0d90){return _0x50110b[_0x4f1e('0x1e')](_0xb0757c)[_0x4f1e('0x20')](_0x3e0d90);}};}function respondWithFilteredResult(_0x44ca9a,_0x255121){return function(_0x5cf988){if(_0x5cf988){var _0x35f8da=typeof _0x255121['offset']===_0x4f1e('0x21')&&typeof _0x255121[_0x4f1e('0x22')]===_0x4f1e('0x21');var _0x5659b8=_0x5cf988[_0x4f1e('0x23')];var _0x2b352b=_0x35f8da?0x0:_0x255121[_0x4f1e('0x24')];var _0x356c2e=_0x35f8da?_0x5cf988[_0x4f1e('0x23')]:_0x255121[_0x4f1e('0x24')]+_0x255121[_0x4f1e('0x22')];var _0x510f78;if(_0x356c2e>=_0x5659b8){_0x356c2e=_0x5659b8;_0x510f78=0xc8;}else{_0x510f78=0xce;}_0x44ca9a[_0x4f1e('0x1e')](_0x510f78);return _0x44ca9a['set']('Content-Range',_0x2b352b+'-'+_0x356c2e+'/'+_0x5659b8)[_0x4f1e('0x20')](_0x5cf988);}return null;};}function saveUpdates(_0x137747){return function(_0x111afa){if(_0x111afa){return _0x111afa[_0x4f1e('0x25')](_0x137747)[_0x4f1e('0x13')](function(_0x26b0f9){return _0x26b0f9;});}return null;};}function removeEntity(_0x713d4c){return function(_0x471096){if(_0x471096){return _0x471096[_0x4f1e('0x26')]()[_0x4f1e('0x13')](function(){_0x713d4c[_0x4f1e('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x43c0fd){return function(_0x2cdf71){if(!_0x2cdf71){_0x43c0fd[_0x4f1e('0x1d')](0x194);}return _0x2cdf71;};}function handleError(_0x166103,_0x46ee2f){_0x46ee2f=_0x46ee2f||0x1f4;return function(_0x13b449){logger[_0x4f1e('0x18')](_0x13b449[_0x4f1e('0x27')]);if(_0x13b449[_0x4f1e('0x28')]){delete _0x13b449[_0x4f1e('0x28')];}_0x166103[_0x4f1e('0x1e')](_0x46ee2f)[_0x4f1e('0x29')](_0x13b449);};}function getMustacheRender(_0x5b0ead,_0x3edb30){return Mustache[_0x4f1e('0x2a')](_0x5b0ead,_[_0x4f1e('0x2b')](_0x3edb30[_0x4f1e('0x2c')],{'contact':_0x3edb30[_0x4f1e('0x2d')],'message':_0x3edb30['message'],'agent':_0x3edb30[_0x4f1e('0x2e')],'interaction':_0x3edb30[_0x4f1e('0x2f')],'account':_0x3edb30[_0x4f1e('0x30')]}))||'';}exports[_0x4f1e('0x31')]=function(_0x1c8d2e,_0x2df3c5){var _0x215bd2={};var _0xf3ba7c=_[_0x4f1e('0x32')](db[_0x4f1e('0x33')][_0x4f1e('0x34')],function(_0x58e925){return{'name':_0x58e925[_0x4f1e('0x35')],'type':_0x58e925[_0x4f1e('0x36')][_0x4f1e('0x37')]};});_0x215bd2=qs[_0x4f1e('0x38')](_0xf3ba7c,_0x1c8d2e);return interaction[_0x4f1e('0x39')]('chat',_0x1c8d2e['query'],_0x1c8d2e['user'],_0x215bd2,_0xf3ba7c)[_0x4f1e('0x13')](respondWithFilteredResult(_0x2df3c5,_0x215bd2))[_0x4f1e('0x1c')](handleError(_0x2df3c5,null));};exports[_0x4f1e('0x3a')]=function(_0x14cb22,_0x104287){var _0x5938f1={'raw':![],'where':{'id':_0x14cb22[_0x4f1e('0x3b')]['id']}},_0x5c6868={};_0x5c6868[_0x4f1e('0x3c')]=_['keys'](db[_0x4f1e('0x33')][_0x4f1e('0x34')]);_0x5c6868[_0x4f1e('0x3d')]=_[_0x4f1e('0x3e')](_0x14cb22[_0x4f1e('0x3d')]);_0x5c6868[_0x4f1e('0x3f')]=_[_0x4f1e('0x40')](_0x5c6868['model'],_0x5c6868[_0x4f1e('0x3d')]);_0x5938f1[_0x4f1e('0x41')]=_[_0x4f1e('0x40')](_0x5c6868[_0x4f1e('0x3c')],qs[_0x4f1e('0x42')](_0x14cb22['query'][_0x4f1e('0x42')]));_0x5938f1[_0x4f1e('0x41')]=_0x5938f1[_0x4f1e('0x41')][_0x4f1e('0x43')]?_0x5938f1[_0x4f1e('0x41')]:_0x5c6868[_0x4f1e('0x3c')];if(_0x14cb22[_0x4f1e('0x3d')][_0x4f1e('0x44')]){_0x5938f1[_0x4f1e('0x45')]=[{'all':!![]}];}_0x5938f1=_[_0x4f1e('0x2b')]({},_0x5938f1,_0x14cb22[_0x4f1e('0x46')]);return db[_0x4f1e('0x33')][_0x4f1e('0x47')](_0x5938f1)['then'](handleEntityNotFound(_0x104287,null))['then'](respondWithResult(_0x104287,null))[_0x4f1e('0x1c')](handleError(_0x104287,null));};exports[_0x4f1e('0x48')]=function(_0x4fb737,_0x3c52ac){return db['ChatInteraction'][_0x4f1e('0x48')](_0x4fb737['body'],{})['then'](respondWithResult(_0x3c52ac,0xc9))[_0x4f1e('0x1c')](handleError(_0x3c52ac,null));};exports[_0x4f1e('0x25')]=function(_0x2830d6,_0x28edcb){if(_0x2830d6[_0x4f1e('0x2c')]['id']){delete _0x2830d6[_0x4f1e('0x2c')]['id'];}return db[_0x4f1e('0x33')][_0x4f1e('0x47')]({'where':{'id':_0x2830d6[_0x4f1e('0x3b')]['id']}})[_0x4f1e('0x13')](handleEntityNotFound(_0x28edcb,null))['then'](saveUpdates(_0x2830d6[_0x4f1e('0x2c')],null))[_0x4f1e('0x13')](respondWithResult(_0x28edcb,null))[_0x4f1e('0x1c')](handleError(_0x28edcb,null));};exports[_0x4f1e('0x26')]=function(_0x303795,_0xda1cf){return db[_0x4f1e('0x33')][_0x4f1e('0x47')]({'where':{'id':_0x303795[_0x4f1e('0x3b')]['id']}})[_0x4f1e('0x13')](handleEntityNotFound(_0xda1cf,null))[_0x4f1e('0x13')](removeEntity(_0xda1cf,null))[_0x4f1e('0x1c')](handleError(_0xda1cf,null));};exports['describe']=function(_0x2ceb20,_0x20f5aa){return db['ChatInteraction'][_0x4f1e('0x49')]()['then'](respondWithResult(_0x20f5aa,null))[_0x4f1e('0x1c')](handleError(_0x20f5aa,null));};exports[_0x4f1e('0x4a')]=function(_0x37c75e,_0x54a0ef){var _0x5b1a92=_0x37c75e['params']['id'];var _0x731c6e;var _0x4514be;var _0x40d0a8;return db[_0x4f1e('0x33')]['findOne']({'where':{'id':_0x5b1a92}})[_0x4f1e('0x13')](function(_0x5509e0){_0x731c6e=_0x5509e0;return db[_0x4f1e('0x4b')]['findOne']({'where':{'id':_0x5509e0['ChatWebsiteId']},'attributes':['id',_0x4f1e('0x4c'),_0x4f1e('0x4d'),_0x4f1e('0x4e'),_0x4f1e('0x4f'),_0x4f1e('0x50')],'raw':!![]});})['then'](function(_0x561c84){if(_0x561c84&&_0x561c84[_0x4f1e('0x4c')]&&_0x561c84[_0x4f1e('0x4d')]){_0x4514be=_0x561c84;var _0x589f83={'interaction':{'id':_0x5b1a92},'agent':{'id':_0x37c75e[_0x4f1e('0x51')]['id'],'name':_0x37c75e['user']['name'],'fullname':_0x37c75e[_0x4f1e('0x51')][_0x4f1e('0x52')],'email':_0x37c75e[_0x4f1e('0x51')][_0x4f1e('0x53')]},'contact':_0x37c75e[_0x4f1e('0x2c')][_0x4f1e('0x2d')],'account':_0x37c75e[_0x4f1e('0x2c')]['account']};var _0x472501={'rejectUnauthorized':![],'method':_0x4f1e('0x54'),'url':_0x4f1e('0x55'),'headers':{'X-APIKEY':_0x561c84['vidaooApiKey']},'body':{'duration':null,'scheduledAt':null,'participants':[_0x37c75e['user'][_0x4f1e('0x53')]],'buttons':null,'topic':_0x4514be['vidaooTopic'],'note':_[_0x4f1e('0x56')](_0x4514be[_0x4f1e('0x4f')])?null:getMustacheRender(_0x4514be['vidaooNote'],_0x589f83),'metadata':null},'redirect':_0x4f1e('0x57'),'json':!![]};try{if(!_[_0x4f1e('0x56')](_0x4514be[_0x4f1e('0x50')])){var _0x5c4a5f=getMustacheRender(_0x4514be[_0x4f1e('0x50')],_0x589f83);var _0x5a8322=JSON[_0x4f1e('0x58')](_0x5c4a5f);_0x472501[_0x4f1e('0x2c')][_0x4f1e('0x59')]=_0x5a8322;}}catch(_0x33715a){throw new db[(_0x4f1e('0x5a'))][(_0x4f1e('0x5b'))](_0x4f1e('0x5c'));}return rp(_0x472501);}else{throw new db[(_0x4f1e('0x5a'))]['ValidationError'](_0x4f1e('0x5d'));}})['then'](function(_0x40fdc2){_0x40d0a8=_0x40fdc2;if(_0x40d0a8['id']){var _0x13627f={'body':_0x40d0a8[_0x4f1e('0x5e')],'ChatWebsiteId':_0x4514be['id'],'ChatInteractionId':_0x731c6e['id'],'direction':'out','UserId':_0x37c75e[_0x4f1e('0x51')]['id']};return db[_0x4f1e('0x5f')][_0x4f1e('0x48')](_0x13627f,{});}else{throw new db[(_0x4f1e('0x5a'))][(_0x4f1e('0x5b'))]('Unable\x20to\x20create\x20Vidaoo\x20session');}})[_0x4f1e('0x13')](function(){return _0x731c6e[_0x4f1e('0x60')]({'vidaooSessionId':_0x40d0a8['id']});})[_0x4f1e('0x13')](respondWithResult(_0x54a0ef,null))['catch'](handleError(_0x54a0ef,null));};exports[_0x4f1e('0x61')]=function(_0x9ea856,_0x2de747){if(_0x9ea856[_0x4f1e('0x2c')]['id']){delete _0x9ea856[_0x4f1e('0x2c')]['id'];}return db[_0x4f1e('0x33')][_0x4f1e('0x47')]({'where':{'id':_0x9ea856[_0x4f1e('0x3b')]['id']},'include':[{'model':db[_0x4f1e('0x62')],'as':_0x4f1e('0x63')}]})[_0x4f1e('0x13')](handleEntityNotFound(_0x2de747,null))[_0x4f1e('0x13')](saveUpdates(_0x9ea856[_0x4f1e('0x2c')],null))[_0x4f1e('0x13')](respondWithResult(_0x2de747,null))[_0x4f1e('0x1c')](handleError(_0x2de747,null));};exports[_0x4f1e('0x64')]=function(_0x4e3890,_0xde0eb3){if(_0x4e3890[_0x4f1e('0x2c')]['id']){delete _0x4e3890[_0x4f1e('0x2c')]['id'];}return db[_0x4f1e('0x33')][_0x4f1e('0x47')]({'where':{'id':_0x4e3890[_0x4f1e('0x3b')]['id']}})[_0x4f1e('0x13')](function(_0x2f4401){if(!_0x2f4401){logger[_0x4f1e('0x18')]('abandonInteraction,\x20%s,\x20%s,\x20%s',_0x4f1e('0x64'),0x194,_0x4f1e('0x65'));_0xde0eb3['sendStatus'](0x194);}else{if(_0x2f4401[_0x4f1e('0x66')]){throw new db['Sequelize'][(_0x4f1e('0x5b'))](_0x4f1e('0x67'));}}return _0x2f4401;})[_0x4f1e('0x13')](function(_0x1b1a87){if(_0x1b1a87){return _0x1b1a87['update']({'closed':_0x4e3890[_0x4f1e('0x2c')][_0x4f1e('0x68')],'disposition':_0x4e3890[_0x4f1e('0x2c')]['disposition']})[_0x4f1e('0x13')](function(_0x2ce4ce){return _0x2ce4ce;});}})[_0x4f1e('0x13')](function(){return respondWithRpcPromise(_0x4f1e('0x69'),_0x4f1e('0x64'),_0x4e3890[_0x4f1e('0x2c')],client9004);})['then'](respondWithResult(_0xde0eb3,null))[_0x4f1e('0x1c')](handleError(_0xde0eb3,null));};exports['attachmentUpload']=function(_0x29eba5,_0x1e12ca){_0x29eba5[_0x4f1e('0x2c')][_0x4f1e('0x28')]=_0x29eba5['file'][_0x4f1e('0x6a')];_0x29eba5[_0x4f1e('0x2c')][_0x4f1e('0x6b')]=_0x29eba5[_0x4f1e('0x6c')][_0x4f1e('0x6d')];_0x29eba5[_0x4f1e('0x2c')][_0x4f1e('0x36')]=_0x29eba5['file']['mimetype'];return db[_0x4f1e('0x6e')][_0x4f1e('0x48')](_0x29eba5[_0x4f1e('0x2c')])[_0x4f1e('0x13')](respondWithResult(_0x1e12ca,0xc9))[_0x4f1e('0x1c')](handleError(_0x1e12ca,null));};exports['attachmentDownload']=function(_0x3c2e23,_0x4bada0){return db[_0x4f1e('0x33')][_0x4f1e('0x6f')]({'where':{'id':_0x3c2e23['params']['id']},'raw':!![]})[_0x4f1e('0x13')](handleEntityNotFound(_0x4bada0,null))[_0x4f1e('0x13')](function(_0x3a7b59){if(_0x3a7b59){if(_0x3a7b59[_0x4f1e('0x68')]){return _0x4bada0[_0x4f1e('0x1e')](0x193)[_0x4f1e('0x20')]({'status':0x193,'message':_0x4f1e('0x70')});}return db[_0x4f1e('0x6e')][_0x4f1e('0x6f')]({'where':{'id':_0x3c2e23[_0x4f1e('0x3d')]['attachId']},'raw':!![]})[_0x4f1e('0x13')](handleEntityNotFound(_0x4bada0,null));}})['then'](function(_0x364227){if(_0x364227){var _0x22509f=_0x364227['ChatOfflineMessageId']!==null;var _0x1f7bf2=path[_0x4f1e('0x71')](config[_0x4f1e('0x72')],_0x4f1e('0x73'));if(_0x22509f){_0x1f7bf2=path[_0x4f1e('0x71')](_0x1f7bf2,_0x4f1e('0x74'));}var _0x400af8=path[_0x4f1e('0x71')](_0x1f7bf2,_0x364227[_0x4f1e('0x6b')]);return _0x4bada0[_0x4f1e('0x75')](_0x400af8);}})[_0x4f1e('0x1c')](handleError(_0x4bada0,null));};exports['close']=function(_0x425f4d,_0x3c664e){var _0x11389e=null;var _0x1bb37f=null;var _0x83459b=null;if(_0x425f4d['body']['id']){delete _0x425f4d['body']['id'];}if(_0x425f4d[_0x4f1e('0x2c')]['mailTranscript']){_0x83459b=path[_0x4f1e('0x71')](config['root'],_0x4f1e('0x76'),util[_0x4f1e('0x77')](_0x4f1e('0x78'),Date['now']()));_0x425f4d['body']['pathTranscript']=_0x83459b;}return db[_0x4f1e('0x33')][_0x4f1e('0x47')]({'where':{'id':_0x425f4d[_0x4f1e('0x3b')]['id']},'include':[{'model':db[_0x4f1e('0x5f')],'as':_0x4f1e('0x79'),'include':[{'model':db['User'],'as':'User'}]}]})[_0x4f1e('0x13')](handleEntityNotFound(_0x3c664e,null))[_0x4f1e('0x13')](saveUpdates(_0x425f4d[_0x4f1e('0x2c')],null))[_0x4f1e('0x13')](function(_0x4d0b32){if(_0x4d0b32){_0x11389e=_0x4d0b32;return db['ChatWebsite'][_0x4f1e('0x47')]({'where':{'id':_0x11389e['ChatWebsiteId']}});}})['then'](function(_0x11cf84){if(_0x11cf84){_0x1bb37f=_0x11cf84;return db[_0x4f1e('0x62')][_0x4f1e('0x47')]({'where':{'id':_0x11389e[_0x4f1e('0x7a')]}});}})[_0x4f1e('0x13')](function(_0x4fdeea){if(_0x4fdeea){if(_0x83459b){var _0x497660=null;for(var _0x2485c8=0x1;_0x2485c8<_0x11389e[_0x4f1e('0x79')][_0x4f1e('0x43')];++_0x2485c8){_0x497660=_0x11389e[_0x4f1e('0x79')][_0x2485c8];var _0x48f5f2=_0x497660[_0x4f1e('0x66')]?util[_0x4f1e('0x77')](_0x4f1e('0x7b'),_0x1bb37f[_0x4f1e('0x7c')],_0x497660[_0x4f1e('0x66')]):_0x4f1e('0x7d');var _0x2c5132=_0x425f4d[_0x4f1e('0x2c')][_0x4f1e('0x7e')]||util[_0x4f1e('0x77')]('%s%d',_0x4f1e('0x7f'),_0x497660[_0x4f1e('0x7a')]);switch(_0x1bb37f['agentIdentifier']){case _0x4f1e('0x80'):_0x48f5f2=_0x497660[_0x4f1e('0x66')]?util[_0x4f1e('0x77')](_0x4f1e('0x7b'),_0x1bb37f[_0x4f1e('0x7c')],_0x497660[_0x4f1e('0x66')]):_0x4f1e('0x7d');break;case _0x4f1e('0x81'):_0x48f5f2=_0x497660[_0x4f1e('0x66')]?_0x497660[_0x4f1e('0x82')][_0x4f1e('0x83')]||_0x497660[_0x4f1e('0x82')][_0x4f1e('0x52')]:'System';break;case _0x4f1e('0x84'):_0x48f5f2=_0x497660[_0x4f1e('0x66')]?_0x497660['User'][_0x4f1e('0x52')]:_0x4f1e('0x7d');break;default:_0x48f5f2=_0x497660['UserId']?util['format'](_0x4f1e('0x7b'),_0x1bb37f[_0x4f1e('0x7c')],_0x497660[_0x4f1e('0x66')]):_0x4f1e('0x7d');}var _0x5c3fc0=util['format'](_0x4f1e('0x85'),moment(_0x497660[_0x4f1e('0x86')])['format'](_0x4f1e('0x87')),_0x497660[_0x4f1e('0x88')]==='in'?_0x2c5132:_0x48f5f2,_0x497660[_0x4f1e('0x2c')]);if(!_0x497660['secret']){fs[_0x4f1e('0x89')](_0x83459b,_0x5c3fc0);}}return db[_0x4f1e('0x8a')][_0x4f1e('0x6f')]({'where':{'service':!![]},'include':[{'model':db[_0x4f1e('0x8b')],'as':_0x4f1e('0x8c'),'raw':!![],'include':[{'model':db[_0x4f1e('0x8d')],'as':_0x4f1e('0x8d'),'raw':!![]}]}]});}}})[_0x4f1e('0x13')](function(_0x137c4d){if(!_0x137c4d||!_0x137c4d[_0x4f1e('0x8c')]||!_0x425f4d[_0x4f1e('0x2c')])return _0x11389e;var _0xb18a0c=_0x137c4d[_0x4f1e('0x8e')]();return respondWithRpcPromise(_0x4f1e('0x8f'),_0x4f1e('0x90'),{'account':_0xb18a0c,'message':{'from':util[_0x4f1e('0x77')](_0x4f1e('0x91'),_0x137c4d[_0x4f1e('0x28')],_0x137c4d['email']||_0x137c4d[_0x4f1e('0x8c')]['user']),'to':_0x425f4d[_0x4f1e('0x2c')][_0x4f1e('0x92')],'subject':_0x4f1e('0x93'),'text':util['format'](_0x4f1e('0x94'),_0x425f4d['body'][_0x4f1e('0x92')]),'attachments':[{'path':_0x83459b}]}})[_0x4f1e('0x13')](function(){return _0x11389e;})['catch'](function(_0x541a4b){logger[_0x4f1e('0x18')](_0x541a4b);});})[_0x4f1e('0x13')](respondWithStatusCode(_0x3c664e,0xc8))[_0x4f1e('0x1c')](handleError(_0x3c664e,null));};exports[_0x4f1e('0x95')]=function(_0x3220e9,_0x12f51d){return db[_0x4f1e('0x5f')]['find']({'where':{'id':_0x3220e9[_0x4f1e('0x3b')]['id']}})['then'](handleEntityNotFound(_0x12f51d,null))[_0x4f1e('0x13')](function(_0x31781c){if(_0x31781c){return _0x31781c[_0x4f1e('0x95')](_0x3220e9[_0x4f1e('0x2c')][_0x4f1e('0x96')],_[_0x4f1e('0x97')](_0x3220e9[_0x4f1e('0x2c')],[_0x4f1e('0x96'),'id'])||{});}})[_0x4f1e('0x13')](respondWithResult(_0x12f51d,null))[_0x4f1e('0x1c')](handleError(_0x12f51d,null));};exports[_0x4f1e('0x98')]=function(_0x1e969e,_0x140f39){var _0x54d834={'raw':![],'where':{}};var _0x344978={};var _0x16a1f8={'count':0x0,'rows':[]};return db[_0x4f1e('0x33')][_0x4f1e('0x6f')]({'where':{'id':_0x1e969e[_0x4f1e('0x3b')]['id']}})[_0x4f1e('0x13')](handleEntityNotFound(_0x140f39,null))[_0x4f1e('0x13')](function(_0x568322){if(_0x568322){_0x344978[_0x4f1e('0x3c')]=_[_0x4f1e('0x3e')](db['ChatMessage'][_0x4f1e('0x34')]);_0x344978[_0x4f1e('0x3d')]=_[_0x4f1e('0x3e')](_0x1e969e[_0x4f1e('0x3d')]);_0x344978[_0x4f1e('0x3f')]=_['intersection'](_0x344978[_0x4f1e('0x3c')],_0x344978[_0x4f1e('0x3d')]);_0x54d834[_0x4f1e('0x41')]=_['intersection'](_0x344978[_0x4f1e('0x3c')],qs[_0x4f1e('0x42')](_0x1e969e[_0x4f1e('0x3d')][_0x4f1e('0x42')]));_0x54d834[_0x4f1e('0x41')]=_0x54d834[_0x4f1e('0x41')][_0x4f1e('0x43')]?_0x54d834['attributes']:_0x344978[_0x4f1e('0x3c')];if(!_0x1e969e['query'][_0x4f1e('0x99')]('nolimit')){_0x54d834['limit']=qs[_0x4f1e('0x22')](_0x1e969e[_0x4f1e('0x3d')]['limit']);_0x54d834[_0x4f1e('0x24')]=qs[_0x4f1e('0x24')](_0x1e969e['query'][_0x4f1e('0x24')]);}_0x54d834[_0x4f1e('0x9a')]=qs[_0x4f1e('0x9b')](_0x1e969e[_0x4f1e('0x3d')][_0x4f1e('0x9b')]);_0x54d834[_0x4f1e('0x9c')]=qs[_0x4f1e('0x3f')](_[_0x4f1e('0x9d')](_0x1e969e[_0x4f1e('0x3d')],_0x344978[_0x4f1e('0x3f')]));_0x54d834[_0x4f1e('0x9c')][_0x4f1e('0x9e')]=_0x568322['id'];if(_0x1e969e['query'][_0x4f1e('0x9f')]){_0x54d834[_0x4f1e('0x9c')]=_[_0x4f1e('0x2b')](_0x54d834['where'],{'$or':_[_0x4f1e('0x32')](_0x54d834[_0x4f1e('0x41')],function(_0xcf70f9){var _0x5d6b0e={};_0x5d6b0e[_0xcf70f9]={'$like':'%'+_0x1e969e['query'][_0x4f1e('0x9f')]+'%'};return _0x5d6b0e;})});}if(_0x1e969e[_0x4f1e('0x3d')][_0x4f1e('0xa0')]){var _0x47fe93=_0x1e969e[_0x4f1e('0x3d')][_0x4f1e('0xa0')]['split'](',');var _0x42c775={};_0x42c775[_0x47fe93[0x0]]={'$gte':moment(_0x47fe93[0x1])[_0x4f1e('0x77')](_0x4f1e('0xa1'))};_0x54d834[_0x4f1e('0x9c')]=_[_0x4f1e('0x2b')](_0x54d834[_0x4f1e('0x9c')],_0x42c775);}_0x54d834=_[_0x4f1e('0x2b')]({},_0x54d834,_0x1e969e[_0x4f1e('0x46')]);return db[_0x4f1e('0x5f')]['count']({'where':_0x54d834[_0x4f1e('0x9c')]})['then'](function(_0x1f8093){_0x16a1f8[_0x4f1e('0x23')]=_0x1f8093;if(_0x1e969e[_0x4f1e('0x3d')][_0x4f1e('0x44')]){_0x54d834[_0x4f1e('0x45')]=[{'all':!![]}];}return db[_0x4f1e('0x5f')][_0x4f1e('0x39')](_0x54d834);})[_0x4f1e('0x13')](function(_0x51cca0){_0x16a1f8[_0x4f1e('0xa2')]=_0x51cca0;return _0x16a1f8;});}})['then'](respondWithFilteredResult(_0x140f39,_0x54d834))[_0x4f1e('0x1c')](handleError(_0x140f39,null));};exports['getMyMessages']=function(_0x48d68e,_0x26b79f){var _0x11bae1={'where':{}},_0x1c536a={},_0x5ee0b5={'count':0x0,'rows':[]};return db[_0x4f1e('0x33')][_0x4f1e('0x6f')]({'where':{'id':_0x48d68e['params']['id']}})[_0x4f1e('0x13')](handleEntityNotFound(_0x26b79f,null))[_0x4f1e('0x13')](function(_0x56b219){if(_0x56b219){_0x1c536a['model']=_[_0x4f1e('0x3e')](db['ChatMessage'][_0x4f1e('0x34')]);_0x1c536a[_0x4f1e('0x3d')]=_[_0x4f1e('0x3e')](_0x48d68e[_0x4f1e('0x3d')]);_0x1c536a['filters']=_['intersection'](_0x1c536a[_0x4f1e('0x3c')],_0x1c536a[_0x4f1e('0x3d')]);_0x11bae1['attributes']=_[_0x4f1e('0x40')](_0x1c536a[_0x4f1e('0x3c')],qs[_0x4f1e('0x42')](_0x48d68e['query'][_0x4f1e('0x42')]));_0x11bae1[_0x4f1e('0x41')]=_0x11bae1[_0x4f1e('0x41')][_0x4f1e('0x43')]?_0x11bae1[_0x4f1e('0x41')]:_0x1c536a[_0x4f1e('0x3c')];if(!_0x48d68e['query'][_0x4f1e('0x99')](_0x4f1e('0xa3'))){_0x11bae1[_0x4f1e('0x22')]=qs[_0x4f1e('0x22')](_0x48d68e[_0x4f1e('0x3d')][_0x4f1e('0x22')]);_0x11bae1[_0x4f1e('0x24')]=qs['offset'](_0x48d68e[_0x4f1e('0x3d')][_0x4f1e('0x24')]);}_0x11bae1[_0x4f1e('0x9a')]=qs[_0x4f1e('0x9b')](_0x48d68e[_0x4f1e('0x3d')]['sort']);_0x11bae1[_0x4f1e('0x9c')]=qs[_0x4f1e('0x3f')](_[_0x4f1e('0x9d')](_0x48d68e['query'],_0x1c536a['filters']));_0x11bae1[_0x4f1e('0x9c')]['ChatInteractionId']=_0x56b219['id'];if(_0x48d68e['query'][_0x4f1e('0x9f')]){_0x11bae1[_0x4f1e('0x9c')]=_[_0x4f1e('0x2b')](_0x11bae1[_0x4f1e('0x9c')],{'$or':_[_0x4f1e('0x32')](_0x11bae1[_0x4f1e('0x41')],function(_0x24ee28){var _0x475287={};_0x475287[_0x24ee28]={'$like':'%'+_0x48d68e[_0x4f1e('0x3d')][_0x4f1e('0x9f')]+'%'};return _0x475287;})});}_0x11bae1[_0x4f1e('0x9c')][_0x4f1e('0xa4')]=![];if(_0x48d68e['query']['id']){_0x11bae1[_0x4f1e('0x9c')]['id']={'$gt':_0x48d68e[_0x4f1e('0x3d')]['id']};}_0x11bae1=_[_0x4f1e('0x2b')]({},_0x11bae1,_0x48d68e['options']);return db['ChatMessage'][_0x4f1e('0x23')]({'where':_0x11bae1['where']})[_0x4f1e('0x13')](function(_0x486cbb){_0x5ee0b5['count']=_0x486cbb;_0x11bae1['include']=[];if(_0x48d68e['query'][_0x4f1e('0xa5')]){_0x11bae1[_0x4f1e('0x45')][_0x4f1e('0xa6')]({'model':db['User'],'as':'User','attributes':['id',_0x4f1e('0x52'),'alias']});}if(_0x48d68e[_0x4f1e('0x3d')][_0x4f1e('0x44')]){_0x11bae1['include']=[{'all':!![]}];}return db[_0x4f1e('0x5f')]['findAll'](_0x11bae1);})[_0x4f1e('0x13')](function(_0xf836d8){_0x5ee0b5[_0x4f1e('0xa2')]=_0xf836d8;return _0x5ee0b5;});}})[_0x4f1e('0x13')](respondWithFilteredResult(_0x26b79f,_0x11bae1))[_0x4f1e('0x1c')](handleError(_0x26b79f,null));};exports[_0x4f1e('0xa7')]=function(_0x56078d,_0x1d1e1d){return db['ChatInteraction'][_0x4f1e('0x47')]({'where':{'id':_0x56078d['params']['id']}})['then'](handleEntityNotFound(_0x1d1e1d,null))[_0x4f1e('0x13')](function(_0x2f41c7){if(_0x2f41c7){return _0x2f41c7[_0x4f1e('0xa8')](_0x56078d[_0x4f1e('0x2c')][_0x4f1e('0x96')],_['omit'](_0x56078d['body'],['ids','id'])||{})[_0x4f1e('0xa9')](function(){return db[_0x4f1e('0xaa')][_0x4f1e('0x39')]({'attributes':['id',_0x4f1e('0x28'),_0x4f1e('0xab')],'where':{'id':_0x56078d[_0x4f1e('0x2c')][_0x4f1e('0x96')]}});})['then'](function(_0xe79a1a){socket['emit'](_0x4f1e('0xac'),{'id':Number(_0x56078d[_0x4f1e('0x3b')]['id']),'tags':_0xe79a1a||[]});return{'id':Number(_0x56078d[_0x4f1e('0x3b')]['id']),'tags':_0xe79a1a||[]};});}})[_0x4f1e('0x13')](respondWithResult(_0x1d1e1d,null))[_0x4f1e('0x1c')](handleError(_0x1d1e1d,null));};exports['removeTags']=function(_0x9d4913,_0x39e2be){return db[_0x4f1e('0x33')][_0x4f1e('0x47')]({'where':{'id':_0x9d4913[_0x4f1e('0x3b')]['id']}})[_0x4f1e('0x13')](handleEntityNotFound(_0x39e2be,null))['then'](function(_0x3a0b55){if(_0x3a0b55){return _0x3a0b55[_0x4f1e('0xad')](_0x9d4913[_0x4f1e('0x3d')][_0x4f1e('0x96')]);}})[_0x4f1e('0x13')](respondWithStatusCode(_0x39e2be,null))['catch'](handleError(_0x39e2be,null));};exports[_0x4f1e('0x75')]=function(_0x518fa2,_0x31c07a){var _0x47fe11=moment()['unix']()['toString']();var _0x3114c0=path[_0x4f1e('0x71')](config[_0x4f1e('0x72')],_0x4f1e('0xae'),'files','tmp');var _0x3777fe=path['join'](config['root'],'server','files',_0x4f1e('0xaf'));var _0x46aa2b=path[_0x4f1e('0x71')](_0x3114c0,_0x47fe11);var _0x1fa044=util[_0x4f1e('0x77')](_0x4f1e('0xb0'),_0x518fa2['params']['id'],_0x47fe11);var _0x104bbe=path[_0x4f1e('0x71')](_0x3114c0,_0x1fa044);var _0x570de8=[];_0x570de8[_0x4f1e('0xa6')]({'model':db[_0x4f1e('0x82')],'as':_0x4f1e('0x82'),'attributes':['id',_0x4f1e('0x52')],'raw':!![]});_0x570de8['push']({'model':db[_0x4f1e('0x62')],'as':_0x4f1e('0x63'),'attributes':['id',_0x4f1e('0xb1'),_0x4f1e('0xb2')],'raw':!![]});if(_0x518fa2['query'][_0x4f1e('0xaf')]){_0x570de8[_0x4f1e('0xa6')]({'model':db['Attachment'],'as':_0x4f1e('0x6e'),'raw':!![]});}var _0x518b86=[{'model':db[_0x4f1e('0x5f')],'as':_0x4f1e('0x79'),'attributes':['id',_0x4f1e('0x2c'),'createdAt',_0x4f1e('0x88'),_0x4f1e('0xa4'),_0x4f1e('0xb3')],'include':_0x570de8}];_0x518b86['push']({'model':db[_0x4f1e('0x4b')],'as':_0x4f1e('0xb4'),'attributes':['id',_0x4f1e('0x28')]});_0x518b86[_0x4f1e('0xa6')]({'model':db[_0x4f1e('0x82')],'as':_0x4f1e('0xb5'),'attributes':['id',_0x4f1e('0x52')]});return db[_0x4f1e('0x33')]['find']({'where':{'id':_0x518fa2['params']['id']},'include':_0x518b86})[_0x4f1e('0x13')](handleEntityNotFound(_0x31c07a,null))[_0x4f1e('0x13')](function(_0x4d5c59){if(_0x4d5c59){var _0x3e1d48=_0x4d5c59[_0x4f1e('0xb6')]({'plain':!![]});fs[_0x4f1e('0xb7')](_0x46aa2b);var _0x2d5d48={'channel':'Chat','account':_0x3e1d48[_0x4f1e('0xb4')][_0x4f1e('0x28')],'agent':_0x3e1d48[_0x4f1e('0xb5')]?_0x3e1d48[_0x4f1e('0xb5')][_0x4f1e('0x52')]:_0x4f1e('0xb8'),'createdAt':moment(_0x3e1d48['createdAt'])[_0x4f1e('0x77')]('YYYY-MM-DD\x20HH:mm:ss')[_0x4f1e('0xb9')](),'closedAt':_0x3e1d48['closed']?moment(_0x3e1d48['closedAt'])[_0x4f1e('0x77')](_0x4f1e('0xa1'))['toString']():'','disposition':_0x3e1d48['disposition'],'chatInfo':{'browser':_0x3e1d48[_0x4f1e('0xba')],'os':_0x3e1d48[_0x4f1e('0xbb')],'referer':_0x3e1d48[_0x4f1e('0xbc')],'customerIp':_0x3e1d48[_0x4f1e('0xbd')],'customerPort':_0x3e1d48[_0x4f1e('0xbe')]?_0x3e1d48[_0x4f1e('0xbe')]:_0x4f1e('0xb8')},'messages':_(_0x3e1d48[_0x4f1e('0x79')])[_0x4f1e('0xbf')]()[_0x4f1e('0x9f')]({'secret':![]})['map'](function(_0xaf62c7){if(_0xaf62c7['Attachment']){var _0x2c7e79=path[_0x4f1e('0x71')](_0x3777fe,_0xaf62c7['Attachment'][_0x4f1e('0x6b')]);if(fs[_0x4f1e('0xc0')](_0x2c7e79)){fs[_0x4f1e('0xc1')](_0x2c7e79)[_0x4f1e('0xc2')](fs[_0x4f1e('0xc3')](path[_0x4f1e('0x71')](_0x46aa2b,_0xaf62c7['Attachment'][_0x4f1e('0x6b')])));}}return{'date':moment(_0xaf62c7[_0x4f1e('0x86')])[_0x4f1e('0x77')](_0x4f1e('0xa1'))[_0x4f1e('0xb9')](),'sender':_0xaf62c7['direction']===_0x4f1e('0xc4')?_0xaf62c7[_0x4f1e('0x82')]?_0xaf62c7[_0x4f1e('0x82')][_0x4f1e('0x52')]:'System':_0xaf62c7[_0x4f1e('0x63')][_0x4f1e('0xb1')]+(_0xaf62c7[_0x4f1e('0x63')][_0x4f1e('0xb2')]?'\x20'+_0xaf62c7[_0x4f1e('0x63')][_0x4f1e('0xb2')]:''),'body':_0xaf62c7[_0x4f1e('0x6e')]?_0xaf62c7['Attachment'][_0x4f1e('0x6b')]:_0xaf62c7[_0x4f1e('0x2c')],'direction':_0xaf62c7[_0x4f1e('0x88')]===_0x4f1e('0xc4')?'A':'C','secret':_0xaf62c7[_0x4f1e('0xa4')],'read':_0xaf62c7[_0x4f1e('0xb3')],'attachment':_0xaf62c7[_0x4f1e('0x6e')]};})[_0x4f1e('0xc5')]()};return ejs[_0x4f1e('0xc6')](path[_0x4f1e('0x71')](config[_0x4f1e('0x72')],_0x4f1e('0xae'),_0x4f1e('0xc7'),_0x4f1e('0xc8')),{'interaction':_0x2d5d48})['then'](function(_0x2ea1db){var _0x15b75d=path[_0x4f1e('0x71')](_0x46aa2b,_0x4f1e('0xc9')+_0x3e1d48['id']+'-'+_0x47fe11+_0x4f1e('0xca'));var _0x3ba3c5={'path':_0x15b75d,'channel':'Chat','interactionId':_0x3e1d48['id']};return pdf[_0x4f1e('0xcb')](_0x2ea1db,_0x3ba3c5);})['then'](function(){return new Promise(function(_0x744d8f,_0x732345){zipdir(_0x46aa2b,{'saveTo':_0x104bbe},function(_0x3058c3,_0x2b3c89){if(_0x3058c3)return _0x732345(_0x3058c3);return _0x744d8f(_0x2b3c89);});})[_0x4f1e('0x13')](function(){return new BPromise(function(_0x3b31ce,_0xf2c153){rimraf(_0x46aa2b,function(_0x190e91){if(_0x190e91)_0xf2c153(_0x190e91);return _0x3b31ce();});});})[_0x4f1e('0x13')](function(){return _0x31c07a[_0x4f1e('0x75')](_0x104bbe,_0x1fa044,function(_0x39e560){if(_0x39e560){logger[_0x4f1e('0x18')](_0x4f1e('0xcc'),_0x39e560);}else{fs[_0x4f1e('0xcd')](_0x104bbe);}});});});}else{return _0x31c07a[_0x4f1e('0x1d')](0xc8);}})[_0x4f1e('0x1c')](handleError(_0x31c07a,null));}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js index f34addb..a91f8b9 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 _0xcafe=['Users','findAll','unreadMessages','length','emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatInteraction','ChatMessage','save','update','remove','then','setDataValue'];(function(_0x32df3c,_0x48f2d3){var _0x346e9f=function(_0x34ab02){while(--_0x34ab02){_0x32df3c['push'](_0x32df3c['shift']());}};_0x346e9f(++_0x48f2d3);}(_0xcafe,0x18f));var _0xecaf=function(_0x68c051,_0x411daf){_0x68c051=_0x68c051-0x0;var _0x55b8af=_0xcafe[_0x68c051];return _0x55b8af;};'use strict';var EventEmitter=require(_0xecaf('0x0'));var ChatInteraction=require(_0xecaf('0x1'))['db'][_0xecaf('0x2')];var ChatMessage=require('../../mysqldb')['db'][_0xecaf('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xecaf('0x4'),'afterUpdate':_0xecaf('0x5'),'afterDestroy':_0xecaf('0x6')};function emitEvent(_0x164ea3){return function(_0xdba821,_0x25acd5,_0x44f95c){_0xdba821['getUsers']({'attributes':['id'],'raw':!![]})[_0xecaf('0x7')](function(_0x33d890){_0xdba821[_0xecaf('0x8')](_0xecaf('0x9'),_0x33d890['map'](function(_0x19b1be){return{'id':_0x19b1be['id']};}));return ChatMessage[_0xecaf('0xa')]({'where':{'ChatInteractionId':_0xdba821['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x48ce97){_0xdba821['setDataValue'](_0xecaf('0xb'),_0x48ce97[_0xecaf('0xc')]);ChatInteractionEvents[_0xecaf('0xd')](_0x164ea3+':'+_0xdba821['id'],_0xdba821);ChatInteractionEvents['emit'](_0x164ea3,_0xdba821);_0x44f95c(null);})['catch'](_0x44f95c(null));};}for(var e in events){if(events[_0xecaf('0xe')](e)){var event=events[e];ChatInteraction[_0xecaf('0xf')](e,emitEvent(event));}}module[_0xecaf('0x10')]=ChatInteractionEvents; \ No newline at end of file +var _0xa16d=['then','Users','map','findAll','unreadMessages','catch','hook','exports','events','../../mysqldb','ChatMessage','setMaxListeners','save','getUsers'];(function(_0x40651b,_0x56245f){var _0x562f53=function(_0x1b208a){while(--_0x1b208a){_0x40651b['push'](_0x40651b['shift']());}};_0x562f53(++_0x56245f);}(_0xa16d,0x94));var _0xda16=function(_0xe1269d,_0x57b7c3){_0xe1269d=_0xe1269d-0x0;var _0x261ca1=_0xa16d[_0xe1269d];return _0x261ca1;};'use strict';var EventEmitter=require(_0xda16('0x0'));var ChatInteraction=require('../../mysqldb')['db']['ChatInteraction'];var ChatMessage=require(_0xda16('0x1'))['db'][_0xda16('0x2')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0xda16('0x3')](0x0);var events={'afterCreate':_0xda16('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x44f1cc){return function(_0x2cf20b,_0x29778c,_0x332c25){_0x2cf20b[_0xda16('0x5')]({'attributes':['id'],'raw':!![]})[_0xda16('0x6')](function(_0x2ac2dd){_0x2cf20b['setDataValue'](_0xda16('0x7'),_0x2ac2dd[_0xda16('0x8')](function(_0x4f4cc7){return{'id':_0x4f4cc7['id']};}));return ChatMessage[_0xda16('0x9')]({'where':{'ChatInteractionId':_0x2cf20b['id'],'direction':'in','read':![]},'raw':!![]});})[_0xda16('0x6')](function(_0x56d4de){_0x2cf20b['setDataValue'](_0xda16('0xa'),_0x56d4de['length']);ChatInteractionEvents['emit'](_0x44f1cc+':'+_0x2cf20b['id'],_0x2cf20b);ChatInteractionEvents['emit'](_0x44f1cc,_0x2cf20b);_0x332c25(null);})[_0xda16('0xb')](_0x332c25(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInteraction[_0xda16('0xc')](e,emitEvent(event));}}module[_0xda16('0xd')]=ChatInteractionEvents; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js index 9319154..8d930b1 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 _0x61fc=['YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./chatInteraction.attributes','exports','define','chat_interactions','closed','format'];(function(_0x2d03e2,_0x404a3d){var _0x3a122b=function(_0x1e48b0){while(--_0x1e48b0){_0x2d03e2['push'](_0x2d03e2['shift']());}};_0x3a122b(++_0x404a3d);}(_0x61fc,0x1ac));var _0xc61f=function(_0x1dee5c,_0x5864c9){_0x1dee5c=_0x1dee5c-0x0;var _0x52f0ca=_0x61fc[_0x1dee5c];return _0x52f0ca;};'use strict';var _=require(_0xc61f('0x0'));var util=require(_0xc61f('0x1'));var logger=require(_0xc61f('0x2'))(_0xc61f('0x3'));var moment=require('moment');var BPromise=require(_0xc61f('0x4'));var rp=require(_0xc61f('0x5'));var fs=require('fs');var path=require(_0xc61f('0x6'));var rimraf=require(_0xc61f('0x7'));var config=require('../../config/environment');var attributes=require(_0xc61f('0x8'));module[_0xc61f('0x9')]=function(_0x5581c7,_0xadd3f8){return _0x5581c7[_0xc61f('0xa')]('ChatInteraction',attributes,{'tableName':_0xc61f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0xe6da92,_0x3c16f4,_0x25e3a1){if(_0xe6da92['changed'](_0xc61f('0xc'))){_0xe6da92['closedAt']=moment()[_0xc61f('0xd')](_0xc61f('0xe'));}_0x25e3a1(null,_0xe6da92);}},'charset':_0xc61f('0xf'),'collate':_0xc61f('0x10')});}; \ No newline at end of file +var _0xf7aa=['api','moment','request-promise','path','../../config/environment','./chatInteraction.attributes','define','chat_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','lodash','util'];(function(_0x143675,_0x5ae2c0){var _0x1268f9=function(_0x2d6c4e){while(--_0x2d6c4e){_0x143675['push'](_0x143675['shift']());}};_0x1268f9(++_0x5ae2c0);}(_0xf7aa,0xa8));var _0xaf7a=function(_0x51fbe6,_0x446b15){_0x51fbe6=_0x51fbe6-0x0;var _0x111105=_0xf7aa[_0x51fbe6];return _0x111105;};'use strict';var _=require(_0xaf7a('0x0'));var util=require(_0xaf7a('0x1'));var logger=require('../../config/logger')(_0xaf7a('0x2'));var moment=require(_0xaf7a('0x3'));var BPromise=require('bluebird');var rp=require(_0xaf7a('0x4'));var fs=require('fs');var path=require(_0xaf7a('0x5'));var rimraf=require('rimraf');var config=require(_0xaf7a('0x6'));var attributes=require(_0xaf7a('0x7'));module['exports']=function(_0xa15d51,_0xb9704b){return _0xa15d51[_0xaf7a('0x8')]('ChatInteraction',attributes,{'tableName':_0xaf7a('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x552036,_0x21089f,_0x175658){if(_0x552036[_0xaf7a('0xa')](_0xaf7a('0xb'))){_0x552036[_0xaf7a('0xc')]=moment()[_0xaf7a('0xd')](_0xaf7a('0xe'));}_0x175658(null,_0x552036);}},'charset':_0xaf7a('0xf'),'collate':_0xaf7a('0x10')});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js index 07a91f6..f5a8e7a 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 _0x9135=['ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','error','message','UpdateChatInteraction','ChatInteraction','update','body','options','raw','where','attributes','limit','stringify','catch','AddTagsToChatInteraction','find','then','ids','spread','AddTags','lodash','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','info'];(function(_0x38532d,_0x4113d0){var _0x3f8fbd=function(_0x2ddc48){while(--_0x2ddc48){_0x38532d['push'](_0x38532d['shift']());}};_0x3f8fbd(++_0x4113d0);}(_0x9135,0x64));var _0x5913=function(_0x45268d,_0x5e81d9){_0x45268d=_0x45268d-0x0;var _0x29a3dd=_0x9135[_0x45268d];return _0x29a3dd;};'use strict';var _=require(_0x5913('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x5913('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5913('0x2'));var db=require(_0x5913('0x3'))['db'];var utils=require(_0x5913('0x4'));var logger=require('../../config/logger')(_0x5913('0x5'));var config=require(_0x5913('0x6'));var jayson=require(_0x5913('0x7'));var client=jayson[_0x5913('0x8')][_0x5913('0x9')]({'port':0x232a});config[_0x5913('0xa')]=_[_0x5913('0xb')](config[_0x5913('0xa')],{'host':_0x5913('0xc'),'port':0x18eb});var socket=require(_0x5913('0xd'))(new Redis(config[_0x5913('0xa')]));require('./chatInteraction.socket')[_0x5913('0xe')](socket);function respondWithRpcPromise(_0x258996,_0x596971,_0x28ab71){return new BPromise(function(_0x1c1710,_0x58d345){return client[_0x5913('0xf')](_0x258996,_0x28ab71)['then'](function(_0x8fd724){logger[_0x5913('0x10')](_0x5913('0x11'),_0x596971,_0x5913('0x12'));logger[_0x5913('0x13')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x596971,_0x5913('0x12'),JSON['stringify'](_0x8fd724));if(_0x8fd724[_0x5913('0x14')]){if(_0x8fd724[_0x5913('0x14')]['code']===0x1f4){logger[_0x5913('0x14')](_0x5913('0x11'),_0x596971,_0x8fd724[_0x5913('0x14')][_0x5913('0x15')]);return _0x58d345(_0x8fd724[_0x5913('0x14')][_0x5913('0x15')]);}logger['error'](_0x5913('0x11'),_0x596971,_0x8fd724['error'][_0x5913('0x15')]);return _0x1c1710(_0x8fd724[_0x5913('0x14')][_0x5913('0x15')]);}else{logger[_0x5913('0x10')](_0x5913('0x11'),_0x596971,'request\x20sent');_0x1c1710(_0x8fd724['result'][_0x5913('0x15')]);}})['catch'](function(_0x36daa0){logger[_0x5913('0x14')](_0x5913('0x11'),_0x596971,_0x36daa0);_0x58d345(_0x36daa0);});});}exports[_0x5913('0x16')]=function(_0x46a0be){var _0x45f93e=this;return new Promise(function(_0x241c07,_0x3e7aec){return db[_0x5913('0x17')][_0x5913('0x18')](_0x46a0be[_0x5913('0x19')],{'raw':_0x46a0be[_0x5913('0x1a')]?_0x46a0be[_0x5913('0x1a')][_0x5913('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x46a0be[_0x5913('0x1a')]?_0x46a0be[_0x5913('0x1a')][_0x5913('0x1c')]||null:null,'attributes':_0x46a0be[_0x5913('0x1a')]?_0x46a0be[_0x5913('0x1a')][_0x5913('0x1d')]||null:null,'limit':_0x46a0be[_0x5913('0x1a')]?_0x46a0be[_0x5913('0x1a')][_0x5913('0x1e')]||null:null})['then'](function(_0x5d5dde){logger[_0x5913('0x10')]('UpdateChatInteraction',_0x46a0be);logger[_0x5913('0x13')](_0x5913('0x16'),_0x46a0be,JSON[_0x5913('0x1f')](_0x5d5dde));_0x241c07(_0x5d5dde);})[_0x5913('0x20')](function(_0x5f1589){logger['error'](_0x5913('0x16'),_0x5f1589[_0x5913('0x15')],_0x46a0be);_0x3e7aec(_0x45f93e[_0x5913('0x14')](0x1f4,_0x5f1589[_0x5913('0x15')]));});});};exports[_0x5913('0x21')]=function(_0x11e856){return new Promise(function(_0x36d679,_0x112048){return db[_0x5913('0x17')][_0x5913('0x22')]({'where':_0x11e856[_0x5913('0x1a')]?_0x11e856['options']['where']||null:null})[_0x5913('0x23')](function(_0x486e32){if(_0x486e32){return _0x486e32['addTags'](_0x11e856[_0x5913('0x19')]['ids'],_['omit'](_0x11e856[_0x5913('0x19')],[_0x5913('0x24'),'id'])||{});}})[_0x5913('0x25')](function(_0x574c90){logger[_0x5913('0x10')](_0x5913('0x26'),_0x11e856);logger[_0x5913('0x13')](_0x5913('0x26'),_0x11e856,JSON['stringify'](_0x574c90));_0x36d679(_0x574c90);})[_0x5913('0x20')](function(_0x12009b){logger[_0x5913('0x14')](_0x5913('0x26'),_0x12009b[_0x5913('0x15')],_0x11e856);_0x112048(_this[_0x5913('0x14')](0x1f4,_0x12009b[_0x5913('0x15')]));});});}; \ No newline at end of file +var _0x32ab=['client','redis','socket.io-emitter','./chatInteraction.socket','register','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateChatInteraction','body','options','raw','where','attributes','debug','ChatInteraction','find','ids','omit','spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x18ab2a,_0x4debcd){var _0x16dcee=function(_0x10107a){while(--_0x10107a){_0x18ab2a['push'](_0x18ab2a['shift']());}};_0x16dcee(++_0x4debcd);}(_0x32ab,0xbe));var _0xb32a=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x32ab[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xb32a('0x0'));var util=require(_0xb32a('0x1'));var moment=require(_0xb32a('0x2'));var BPromise=require(_0xb32a('0x3'));var rs=require(_0xb32a('0x4'));var fs=require('fs');var Redis=require(_0xb32a('0x5'));var db=require(_0xb32a('0x6'))['db'];var utils=require(_0xb32a('0x7'));var logger=require(_0xb32a('0x8'))(_0xb32a('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xb32a('0xa')]['http']({'port':0x232a});config[_0xb32a('0xb')]=_['defaults'](config[_0xb32a('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0xb32a('0xc'))(new Redis(config['redis']));require(_0xb32a('0xd'))[_0xb32a('0xe')](socket);function respondWithRpcPromise(_0x4ea5b9,_0x3b15de,_0x3fd0ca){return new BPromise(function(_0x16f900,_0x259622){return client[_0xb32a('0xf')](_0x4ea5b9,_0x3fd0ca)[_0xb32a('0x10')](function(_0x5a5606){logger[_0xb32a('0x11')](_0xb32a('0x12'),_0x3b15de,_0xb32a('0x13'));logger['debug'](_0xb32a('0x14'),_0x3b15de,_0xb32a('0x13'),JSON[_0xb32a('0x15')](_0x5a5606));if(_0x5a5606[_0xb32a('0x16')]){if(_0x5a5606[_0xb32a('0x16')][_0xb32a('0x17')]===0x1f4){logger['error'](_0xb32a('0x12'),_0x3b15de,_0x5a5606[_0xb32a('0x16')][_0xb32a('0x18')]);return _0x259622(_0x5a5606[_0xb32a('0x16')][_0xb32a('0x18')]);}logger[_0xb32a('0x16')](_0xb32a('0x12'),_0x3b15de,_0x5a5606[_0xb32a('0x16')][_0xb32a('0x18')]);return _0x16f900(_0x5a5606[_0xb32a('0x16')][_0xb32a('0x18')]);}else{logger[_0xb32a('0x11')](_0xb32a('0x12'),_0x3b15de,'request\x20sent');_0x16f900(_0x5a5606[_0xb32a('0x19')]['message']);}})[_0xb32a('0x1a')](function(_0x5d626c){logger['error'](_0xb32a('0x12'),_0x3b15de,_0x5d626c);_0x259622(_0x5d626c);});});}exports[_0xb32a('0x1b')]=function(_0x33f316){var _0x5cf023=this;return new Promise(function(_0x5b0fed,_0x4958d7){return db['ChatInteraction']['update'](_0x33f316[_0xb32a('0x1c')],{'raw':_0x33f316[_0xb32a('0x1d')]?_0x33f316[_0xb32a('0x1d')][_0xb32a('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x33f316[_0xb32a('0x1d')]?_0x33f316[_0xb32a('0x1d')][_0xb32a('0x1f')]||null:null,'attributes':_0x33f316['options']?_0x33f316[_0xb32a('0x1d')][_0xb32a('0x20')]||null:null,'limit':_0x33f316[_0xb32a('0x1d')]?_0x33f316['options']['limit']||null:null})[_0xb32a('0x10')](function(_0x184b24){logger[_0xb32a('0x11')](_0xb32a('0x1b'),_0x33f316);logger[_0xb32a('0x21')](_0xb32a('0x1b'),_0x33f316,JSON[_0xb32a('0x15')](_0x184b24));_0x5b0fed(_0x184b24);})[_0xb32a('0x1a')](function(_0xd9623a){logger['error'](_0xb32a('0x1b'),_0xd9623a[_0xb32a('0x18')],_0x33f316);_0x4958d7(_0x5cf023[_0xb32a('0x16')](0x1f4,_0xd9623a['message']));});});};exports['AddTagsToChatInteraction']=function(_0x51a656){return new Promise(function(_0x3a8707,_0x311b9e){return db[_0xb32a('0x22')][_0xb32a('0x23')]({'where':_0x51a656[_0xb32a('0x1d')]?_0x51a656['options']['where']||null:null})['then'](function(_0x5d1d72){if(_0x5d1d72){return _0x5d1d72['addTags'](_0x51a656[_0xb32a('0x1c')][_0xb32a('0x24')],_[_0xb32a('0x25')](_0x51a656['body'],['ids','id'])||{});}})[_0xb32a('0x26')](function(_0x3d9b01){logger[_0xb32a('0x11')]('AddTags',_0x51a656);logger[_0xb32a('0x21')](_0xb32a('0x27'),_0x51a656,JSON[_0xb32a('0x15')](_0x3d9b01));_0x3a8707(_0x3d9b01);})[_0xb32a('0x1a')](function(_0x16de35){logger[_0xb32a('0x16')]('AddTags',_0x16de35[_0xb32a('0x18')],_0x51a656);_0x311b9e(_this[_0xb32a('0x16')](0x1f4,_0x16de35[_0xb32a('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js index 6826ba5..557b5dd 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 _0x7a08=['emit','removeListener','register','chatInteraction:','./chatInteraction.events','save'];(function(_0x5ed6ce,_0x519c4){var _0x31c6e2=function(_0x33ba84){while(--_0x33ba84){_0x5ed6ce['push'](_0x5ed6ce['shift']());}};_0x31c6e2(++_0x519c4);}(_0x7a08,0x11e));var _0x87a0=function(_0x2755fb,_0x5970f1){_0x2755fb=_0x2755fb-0x0;var _0x293f12=_0x7a08[_0x2755fb];return _0x293f12;};'use strict';var ChatInteractionEvents=require(_0x87a0('0x0'));var events=[_0x87a0('0x1'),'remove','update'];function createListener(_0x305211,_0x5e6791){return function(_0x1b3e4d){_0x5e6791[_0x87a0('0x2')](_0x305211,_0x1b3e4d);};}function removeListener(_0x28c28f,_0x122d33){return function(){ChatInteractionEvents[_0x87a0('0x3')](_0x28c28f,_0x122d33);};}exports[_0x87a0('0x4')]=function(_0x1b384a){for(var _0xf9199b=0x0,_0xde806e=events['length'];_0xf9199b<_0xde806e;_0xf9199b++){var _0x27736f=events[_0xf9199b];var _0x1bb04b=createListener(_0x87a0('0x5')+_0x27736f,_0x1b384a);ChatInteractionEvents['on'](_0x27736f,_0x1bb04b);}}; \ No newline at end of file +var _0xd3cf=['removeListener','chatInteraction:','save','update','emit'];(function(_0x22f361,_0x3698d2){var _0x41932d=function(_0x44211e){while(--_0x44211e){_0x22f361['push'](_0x22f361['shift']());}};_0x41932d(++_0x3698d2);}(_0xd3cf,0x1e7));var _0xfd3c=function(_0x1c9d03,_0x4d6307){_0x1c9d03=_0x1c9d03-0x0;var _0x9938c5=_0xd3cf[_0x1c9d03];return _0x9938c5;};'use strict';var ChatInteractionEvents=require('./chatInteraction.events');var events=[_0xfd3c('0x0'),'remove',_0xfd3c('0x1')];function createListener(_0x43aeec,_0x4aa82a){return function(_0x84385f){_0x4aa82a[_0xfd3c('0x2')](_0x43aeec,_0x84385f);};}function removeListener(_0x1724c,_0x23e5e7){return function(){ChatInteractionEvents[_0xfd3c('0x3')](_0x1724c,_0x23e5e7);};}exports['register']=function(_0x262b3f){for(var _0x526ea0=0x0,_0x582064=events['length'];_0x526ea0<_0x582064;_0x526ea0++){var _0x500f2f=events[_0x526ea0];var _0x41ce0c=createListener(_0xfd3c('0x4')+_0x500f2f,_0x262b3f);ChatInteractionEvents['on'](_0x500f2f,_0x41ce0c);}}; \ No newline at end of file diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js index 5150450..6d8bd6b 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 _0xbb34=['isChatInteractionAuthorized','/:id/messages','/:id/my_messages','getMyMessages','/:id/download','download','post','create','/:id/vidaoo','createVidaooSession','diskStorage','join','server/files/attachments/','format','now','originalname','replace','single','file','attachmentUpload','tracked','chatinteraction:addtags','addTags','put','/:id','chat','chatinteraction:update','/:id/custom_update','customUpdate','/:id/abandon','/:id/close','close','chatinteraction:destroy','delete','/:id/tags','removeTags','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./chatInteraction.controller','get','index','/describe','isAuthenticated','describe','/:id/attachment_download'];(function(_0x1ec6c8,_0x72ff6){var _0x16701c=function(_0x4fd69f){while(--_0x4fd69f){_0x1ec6c8['push'](_0x1ec6c8['shift']());}};_0x16701c(++_0x72ff6);}(_0xbb34,0x1dd));var _0x4bb3=function(_0x236e77,_0x388743){_0x236e77=_0x236e77-0x0;var _0x59e31f=_0xbb34[_0x236e77];return _0x59e31f;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x4bb3('0x0'));var timeout=require(_0x4bb3('0x1'));var express=require(_0x4bb3('0x2'));var router=express[_0x4bb3('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x4bb3('0x4'));var interaction=require(_0x4bb3('0x5'));var config=require('../../config/environment');var controller=require(_0x4bb3('0x6'));router[_0x4bb3('0x7')]('/',auth['isAuthenticated'](),controller[_0x4bb3('0x8')]);router[_0x4bb3('0x7')](_0x4bb3('0x9'),auth[_0x4bb3('0xa')](),controller[_0x4bb3('0xb')]);router[_0x4bb3('0x7')]('/:id',auth['isChatInteractionAuthorized'](),controller['show']);router[_0x4bb3('0x7')](_0x4bb3('0xc'),auth[_0x4bb3('0xd')](),controller['attachmentDownload']);router[_0x4bb3('0x7')](_0x4bb3('0xe'),auth[_0x4bb3('0xa')](),controller['getMessages']);router[_0x4bb3('0x7')](_0x4bb3('0xf'),auth[_0x4bb3('0xd')](),controller[_0x4bb3('0x10')]);router[_0x4bb3('0x7')](_0x4bb3('0x11'),auth[_0x4bb3('0xa')](),controller[_0x4bb3('0x12')]);router[_0x4bb3('0x13')]('/',auth['isAuthenticated'](),controller[_0x4bb3('0x14')]);router[_0x4bb3('0x13')](_0x4bb3('0x15'),auth['isAuthenticated'](),controller[_0x4bb3('0x16')]);var upload=multer({'storage':multer[_0x4bb3('0x17')]({'destination':function(_0x231344,_0x21e292,_0x227f5b){_0x227f5b(null,path[_0x4bb3('0x18')](config['root'],_0x4bb3('0x19')));},'filename':function(_0x553ff4,_0x305be8,_0x3cd9c5){_0x3cd9c5(null,util[_0x4bb3('0x1a')]('%s-%s',Date[_0x4bb3('0x1b')](),_0x305be8[_0x4bb3('0x1c')][_0x4bb3('0x1d')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x4bb3('0x13')]('/:id/attachment_upload',upload[_0x4bb3('0x1e')](_0x4bb3('0x1f')),controller[_0x4bb3('0x20')]);router[_0x4bb3('0x13')](_0x4bb3('0xe'),auth[_0x4bb3('0xd')](),controller['addMessage']);router[_0x4bb3('0x13')]('/:id/tags',auth[_0x4bb3('0xa')](),interaction[_0x4bb3('0x21')]('chat',_0x4bb3('0x22')),controller[_0x4bb3('0x23')]);router[_0x4bb3('0x24')](_0x4bb3('0x25'),auth[_0x4bb3('0xa')](),interaction[_0x4bb3('0x21')](_0x4bb3('0x26'),_0x4bb3('0x27')),controller['update']);router[_0x4bb3('0x24')](_0x4bb3('0x28'),controller[_0x4bb3('0x29')]);router[_0x4bb3('0x24')](_0x4bb3('0x2a'),auth[_0x4bb3('0xd')](),controller['abandon']);router[_0x4bb3('0x24')](_0x4bb3('0x2b'),controller[_0x4bb3('0x2c')]);router['delete'](_0x4bb3('0x25'),auth['isAuthenticated'](),interaction[_0x4bb3('0x21')](_0x4bb3('0x26'),_0x4bb3('0x2d')),controller['destroy']);router[_0x4bb3('0x2e')](_0x4bb3('0x2f'),auth[_0x4bb3('0xa')](),controller[_0x4bb3('0x30')]);module['exports']=router; \ No newline at end of file +var _0x5731=['/:id/messages','/:id/tags','tracked','chatinteraction:addtags','addTags','put','chat','chatinteraction:update','update','/:id/custom_update','customUpdate','/:id/abandon','abandon','/:id/close','close','delete','removeTags','multer','util','connect-timeout','Router','../../components/interaction/service','../../config/environment','./chatInteraction.controller','get','isAuthenticated','index','/:id','show','/:id/attachment_download','isChatInteractionAuthorized','attachmentDownload','getMessages','/:id/my_messages','getMyMessages','/:id/download','download','create','post','/:id/vidaoo','createVidaooSession','diskStorage','join','root','format','now','replace','/:id/attachment_upload','single','file'];(function(_0x8a969d,_0x339d9f){var _0x1d8dc7=function(_0x283ec0){while(--_0x283ec0){_0x8a969d['push'](_0x8a969d['shift']());}};_0x1d8dc7(++_0x339d9f);}(_0x5731,0x16f));var _0x1573=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x5731[_0x2641f9];return _0x585741;};'use strict';var multer=require(_0x1573('0x0'));var util=require(_0x1573('0x1'));var path=require('path');var timeout=require(_0x1573('0x2'));var express=require('express');var router=express[_0x1573('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x1573('0x4'));var config=require(_0x1573('0x5'));var controller=require(_0x1573('0x6'));router[_0x1573('0x7')]('/',auth[_0x1573('0x8')](),controller[_0x1573('0x9')]);router[_0x1573('0x7')]('/describe',auth[_0x1573('0x8')](),controller['describe']);router['get'](_0x1573('0xa'),auth['isChatInteractionAuthorized'](),controller[_0x1573('0xb')]);router[_0x1573('0x7')](_0x1573('0xc'),auth[_0x1573('0xd')](),controller[_0x1573('0xe')]);router[_0x1573('0x7')]('/:id/messages',auth[_0x1573('0x8')](),controller[_0x1573('0xf')]);router[_0x1573('0x7')](_0x1573('0x10'),auth[_0x1573('0xd')](),controller[_0x1573('0x11')]);router[_0x1573('0x7')](_0x1573('0x12'),auth[_0x1573('0x8')](),controller[_0x1573('0x13')]);router['post']('/',auth[_0x1573('0x8')](),controller[_0x1573('0x14')]);router[_0x1573('0x15')](_0x1573('0x16'),auth[_0x1573('0x8')](),controller[_0x1573('0x17')]);var upload=multer({'storage':multer[_0x1573('0x18')]({'destination':function(_0x2ca6fb,_0x446989,_0x2cf7b1){_0x2cf7b1(null,path[_0x1573('0x19')](config[_0x1573('0x1a')],'server/files/attachments/'));},'filename':function(_0x1d9478,_0x1c983e,_0x26efd7){_0x26efd7(null,util[_0x1573('0x1b')]('%s-%s',Date[_0x1573('0x1c')](),_0x1c983e['originalname'][_0x1573('0x1d')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x1573('0x15')](_0x1573('0x1e'),upload[_0x1573('0x1f')](_0x1573('0x20')),controller['attachmentUpload']);router[_0x1573('0x15')](_0x1573('0x21'),auth[_0x1573('0xd')](),controller['addMessage']);router[_0x1573('0x15')](_0x1573('0x22'),auth[_0x1573('0x8')](),interaction[_0x1573('0x23')]('chat',_0x1573('0x24')),controller[_0x1573('0x25')]);router[_0x1573('0x26')](_0x1573('0xa'),auth[_0x1573('0x8')](),interaction['tracked'](_0x1573('0x27'),_0x1573('0x28')),controller[_0x1573('0x29')]);router['put'](_0x1573('0x2a'),controller[_0x1573('0x2b')]);router[_0x1573('0x26')](_0x1573('0x2c'),auth[_0x1573('0xd')](),controller[_0x1573('0x2d')]);router['put'](_0x1573('0x2e'),controller[_0x1573('0x2f')]);router[_0x1573('0x30')](_0x1573('0xa'),auth[_0x1573('0x8')](),interaction[_0x1573('0x23')](_0x1573('0x27'),'chatinteraction:destroy'),controller['destroy']);router[_0x1573('0x30')](_0x1573('0x22'),auth['isAuthenticated'](),controller[_0x1573('0x31')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js index 33b4b9a..4b6d2b2 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 _0xf7cc=['BOOLEAN','INTEGER','sequelize','exports','TEXT','medium'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0xf7cc,0x18e));var _0xcf7c=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0xf7cc[_0xfae23b];return _0x200640;};'use strict';var Sequelize=require(_0xcf7c('0x0'));module[_0xcf7c('0x1')]={'body':{'type':Sequelize[_0xcf7c('0x2')](_0xcf7c('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xcf7c('0x4')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0xcf7c('0x5')]}}; \ No newline at end of file +var _0x75e5=['medium','BOOLEAN','INTEGER'];(function(_0x88cd7b,_0x4c884c){var _0x56fcc8=function(_0x513b3d){while(--_0x513b3d){_0x88cd7b['push'](_0x88cd7b['shift']());}};_0x56fcc8(++_0x4c884c);}(_0x75e5,0xbd));var _0x575e=function(_0x2109a8,_0x3a7797){_0x2109a8=_0x2109a8-0x0;var _0x522094=_0x75e5[_0x2109a8];return _0x522094;};'use strict';var Sequelize=require('sequelize');module['exports']={'body':{'type':Sequelize['TEXT'](_0x575e('0x0')),'allowNull':![]},'read':{'type':Sequelize[_0x575e('0x1')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x575e('0x2')]}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js index 78632da..50efdc4 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 _0x11f9=['push','messages','FromId','read','all','eml-format','rimraf','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','register','sendStatus','json','offset','limit','undefined','count','status','Content-Range','apply','save','update','then','destroy','stack','name','send','index','map','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','ChatInternalMessage','includeAll','include','findAll','rows','catch','params','rawAttributes','options','find','create','body','describe','get','lastMessageAt','lastMessage','format','YYYY-MM-DD\x20HH:mm:ss','getUsers','User','agent','admin','user','fullname','role','userpic','internal','lastLoginAt','VoiceQueue','VoiceQueues','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Agents','autoAssociation','isEmpty','filter','resourceId'];(function(_0x539bde,_0x14b7db){var _0x1718d4=function(_0x1d35e0){while(--_0x1d35e0){_0x539bde['push'](_0x539bde['shift']());}};_0x1718d4(++_0x14b7db);}(_0x11f9,0xdd));var _0x911f=function(_0x25b24a,_0x1c0163){_0x25b24a=_0x25b24a-0x0;var _0x224e68=_0x11f9[_0x25b24a];return _0x224e68;};'use strict';var emlformat=require(_0x911f('0x0'));var rimraf=require(_0x911f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x911f('0x2'));var rp=require(_0x911f('0x3'));var moment=require('moment');var BPromise=require(_0x911f('0x4'));var Mustache=require('mustache');var util=require(_0x911f('0x5'));var path=require(_0x911f('0x6'));var sox=require(_0x911f('0x7'));var csv=require(_0x911f('0x8'));var ejs=require(_0x911f('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x911f('0xa'));var squel=require(_0x911f('0xb'));var crypto=require(_0x911f('0xc'));var jsforce=require(_0x911f('0xd'));var deskjs=require(_0x911f('0xe'));var toCsv=require(_0x911f('0x8'));var querystring=require(_0x911f('0xf'));var Papa=require(_0x911f('0x10'));var Redis=require(_0x911f('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x911f('0x12'));var hardwareService=require(_0x911f('0x13'));var logger=require(_0x911f('0x14'))(_0x911f('0x15'));var utils=require(_0x911f('0x16'));var config=require(_0x911f('0x17'));var licenseUtil=require(_0x911f('0x18'));var db=require('../../mysqldb')['db'];config[_0x911f('0x19')]=_[_0x911f('0x1a')](config[_0x911f('0x19')],{'host':_0x911f('0x1b'),'port':0x18eb});var socket=require(_0x911f('0x1c'))(new Redis(config[_0x911f('0x19')]));require('./chatInternalMessage.socket')[_0x911f('0x1d')](socket);function respondWithStatusCode(_0x3551ed,_0x3438f9){_0x3438f9=_0x3438f9||0xcc;return function(_0x514190){if(_0x514190){return _0x3551ed[_0x911f('0x1e')](_0x3438f9);}return _0x3551ed['status'](_0x3438f9)['end']();};}function respondWithResult(_0x1b4edd,_0x50bca7){_0x50bca7=_0x50bca7||0xc8;return function(_0x3a39b1){if(_0x3a39b1){return _0x1b4edd['status'](_0x50bca7)[_0x911f('0x1f')](_0x3a39b1);}};}function respondWithFilteredResult(_0x14d536,_0x1b8619){return function(_0x55662c){if(_0x55662c){var _0x2f9553=typeof _0x1b8619[_0x911f('0x20')]==='undefined'&&typeof _0x1b8619[_0x911f('0x21')]===_0x911f('0x22');var _0x106f13=_0x55662c[_0x911f('0x23')];var _0x100495=_0x2f9553?0x0:_0x1b8619['offset'];var _0x3c88b7=_0x2f9553?_0x55662c['count']:_0x1b8619[_0x911f('0x20')]+_0x1b8619[_0x911f('0x21')];var _0x31d223;if(_0x3c88b7>=_0x106f13){_0x3c88b7=_0x106f13;_0x31d223=0xc8;}else{_0x31d223=0xce;}_0x14d536[_0x911f('0x24')](_0x31d223);return _0x14d536['set'](_0x911f('0x25'),_0x100495+'-'+_0x3c88b7+'/'+_0x106f13)['json'](_0x55662c);}return null;};}function patchUpdates(_0x2609af){return function(_0x1f481d){try{jsonpatch[_0x911f('0x26')](_0x1f481d,_0x2609af,!![]);}catch(_0x52f6a6){return BPromise['reject'](_0x52f6a6);}return _0x1f481d[_0x911f('0x27')]();};}function saveUpdates(_0x231ccd,_0x4b614f){return function(_0x3e9c63){if(_0x3e9c63){return _0x3e9c63[_0x911f('0x28')](_0x231ccd)[_0x911f('0x29')](function(_0x1082cc){return _0x1082cc;});}return null;};}function removeEntity(_0x406945,_0x1e601f){return function(_0x16fc9c){if(_0x16fc9c){return _0x16fc9c[_0x911f('0x2a')]()[_0x911f('0x29')](function(){_0x406945[_0x911f('0x24')](0xcc)['end']();});}};}function handleEntityNotFound(_0x34766a,_0x4917dc){return function(_0xd66569){if(!_0xd66569){_0x34766a[_0x911f('0x1e')](0x194);}return _0xd66569;};}function handleError(_0x1bba4c,_0x3c7110){_0x3c7110=_0x3c7110||0x1f4;return function(_0x1445f2){logger['error'](_0x1445f2[_0x911f('0x2b')]);if(_0x1445f2[_0x911f('0x2c')]){delete _0x1445f2[_0x911f('0x2c')];}_0x1bba4c[_0x911f('0x24')](_0x3c7110)[_0x911f('0x2d')](_0x1445f2);};}exports[_0x911f('0x2e')]=function(_0x5a283d,_0x53c792){var _0x2614aa={},_0x17a9fd={},_0x1e6cd4={'count':0x0,'rows':[]};var _0x12ab78=_[_0x911f('0x2f')](db['ChatInternalMessage']['rawAttributes'],function(_0x1b51ce){return{'name':_0x1b51ce[_0x911f('0x30')],'type':_0x1b51ce[_0x911f('0x31')][_0x911f('0x32')]};});_0x17a9fd[_0x911f('0x33')]=_['map'](_0x12ab78,_0x911f('0x2c'));_0x17a9fd[_0x911f('0x34')]=_[_0x911f('0x35')](_0x5a283d[_0x911f('0x34')]);_0x17a9fd[_0x911f('0x36')]=_[_0x911f('0x37')](_0x17a9fd[_0x911f('0x33')],_0x17a9fd[_0x911f('0x34')]);_0x2614aa[_0x911f('0x38')]=_[_0x911f('0x37')](_0x17a9fd[_0x911f('0x33')],qs[_0x911f('0x39')](_0x5a283d[_0x911f('0x34')][_0x911f('0x39')]));_0x2614aa[_0x911f('0x38')]=_0x2614aa[_0x911f('0x38')][_0x911f('0x3a')]?_0x2614aa[_0x911f('0x38')]:_0x17a9fd['model'];if(!_0x5a283d[_0x911f('0x34')][_0x911f('0x3b')]('nolimit')){_0x2614aa[_0x911f('0x21')]=qs[_0x911f('0x21')](_0x5a283d['query'][_0x911f('0x21')]);_0x2614aa[_0x911f('0x20')]=qs['offset'](_0x5a283d['query']['offset']);}_0x2614aa[_0x911f('0x3c')]=qs[_0x911f('0x3d')](_0x5a283d[_0x911f('0x34')][_0x911f('0x3d')]);_0x2614aa[_0x911f('0x3e')]=qs[_0x911f('0x36')](_[_0x911f('0x3f')](_0x5a283d[_0x911f('0x34')],_0x17a9fd[_0x911f('0x36')]),_0x12ab78);if(_0x5a283d['query']['filter']){_0x2614aa[_0x911f('0x3e')]=_[_0x911f('0x40')](_0x2614aa[_0x911f('0x3e')],{'$or':_[_0x911f('0x2f')](_0x12ab78,function(_0x176a7f){if(_0x176a7f[_0x911f('0x31')]!==_0x911f('0x41')){var _0x28f624={};_0x28f624[_0x176a7f['name']]={'$like':'%'+_0x5a283d['query']['filter']+'%'};return _0x28f624;}})});}_0x2614aa=_['merge']({},_0x2614aa,_0x5a283d['options']);var _0x53ebc3={'where':_0x2614aa['where']};return db[_0x911f('0x42')]['count'](_0x53ebc3)[_0x911f('0x29')](function(_0x939632){_0x1e6cd4['count']=_0x939632;if(_0x5a283d[_0x911f('0x34')][_0x911f('0x43')]){_0x2614aa[_0x911f('0x44')]=[{'all':!![]}];}return db[_0x911f('0x42')][_0x911f('0x45')](_0x2614aa);})['then'](function(_0x50ccf6){_0x1e6cd4[_0x911f('0x46')]=_0x50ccf6;return _0x1e6cd4;})[_0x911f('0x29')](respondWithFilteredResult(_0x53c792,_0x2614aa))[_0x911f('0x47')](handleError(_0x53c792,null));};exports['show']=function(_0x458d92,_0x39b383){var _0x227bf3={'raw':!![],'where':{'id':_0x458d92[_0x911f('0x48')]['id']}},_0x2f4462={};_0x2f4462['model']=_[_0x911f('0x35')](db['ChatInternalMessage'][_0x911f('0x49')]);_0x2f4462['query']=_[_0x911f('0x35')](_0x458d92[_0x911f('0x34')]);_0x2f4462[_0x911f('0x36')]=_[_0x911f('0x37')](_0x2f4462[_0x911f('0x33')],_0x2f4462[_0x911f('0x34')]);_0x227bf3[_0x911f('0x38')]=_[_0x911f('0x37')](_0x2f4462[_0x911f('0x33')],qs['fields'](_0x458d92['query']['fields']));_0x227bf3['attributes']=_0x227bf3[_0x911f('0x38')][_0x911f('0x3a')]?_0x227bf3[_0x911f('0x38')]:_0x2f4462[_0x911f('0x33')];if(_0x458d92['query'][_0x911f('0x43')]){_0x227bf3[_0x911f('0x44')]=[{'all':!![]}];}_0x227bf3=_['merge']({},_0x227bf3,_0x458d92[_0x911f('0x4a')]);return db[_0x911f('0x42')][_0x911f('0x4b')](_0x227bf3)[_0x911f('0x29')](handleEntityNotFound(_0x39b383,null))[_0x911f('0x29')](respondWithResult(_0x39b383,null))[_0x911f('0x47')](handleError(_0x39b383,null));};exports[_0x911f('0x4c')]=function(_0x391ede,_0x16cda2){return db[_0x911f('0x42')]['create'](_0x391ede[_0x911f('0x4d')],{})[_0x911f('0x29')](respondWithResult(_0x16cda2,0xc9))[_0x911f('0x47')](handleError(_0x16cda2,null));};exports[_0x911f('0x28')]=function(_0x119a6c,_0x4af6f3){if(_0x119a6c[_0x911f('0x4d')]['id']){delete _0x119a6c[_0x911f('0x4d')]['id'];}return db['ChatInternalMessage'][_0x911f('0x4b')]({'where':{'id':_0x119a6c[_0x911f('0x48')]['id']}})['then'](handleEntityNotFound(_0x4af6f3,null))[_0x911f('0x29')](saveUpdates(_0x119a6c[_0x911f('0x4d')],null))[_0x911f('0x29')](respondWithResult(_0x4af6f3,null))[_0x911f('0x47')](handleError(_0x4af6f3,null));};exports['destroy']=function(_0x37cb49,_0x1bbe3f){return db[_0x911f('0x42')][_0x911f('0x4b')]({'where':{'id':_0x37cb49[_0x911f('0x48')]['id']}})[_0x911f('0x29')](handleEntityNotFound(_0x1bbe3f,null))['then'](removeEntity(_0x1bbe3f,null))[_0x911f('0x47')](handleError(_0x1bbe3f,null));};exports[_0x911f('0x4e')]=function(_0xd76681,_0x328c58){return db['ChatInternalMessage']['describe']()['then'](respondWithResult(_0x328c58,null))['catch'](handleError(_0x328c58,null));};function wrapUser(_0x29f809){return function(_0x5364b2){var _0x5e3705=_0x29f809[_0x911f('0x4f')]({'plain':!![]});_0x5e3705['messages']=[];if(_0x5364b2){_0x5e3705[_0x911f('0x50')]=_0x5364b2['createdAt'];_0x5e3705[_0x911f('0x51')]=_0x5364b2;}else{_0x5e3705[_0x911f('0x50')]=moment(0x0)[_0x911f('0x52')](_0x911f('0x53'));_0x5e3705[_0x911f('0x51')]={};}return _0x5e3705;};}exports[_0x911f('0x54')]=function(_0x20918e,_0x180fb2,_0x5af1aa){var _0x1a81ed=[];return db[_0x911f('0x55')]['findAll']({'where':{'role':[_0x911f('0x56'),_0x911f('0x57'),_0x911f('0x58')]},'attributes':['id',_0x911f('0x59'),_0x911f('0x2c'),_0x911f('0x5a'),_0x911f('0x5b'),_0x911f('0x5c'),'online',_0x911f('0x5d'),'allowmessenger','showWebBar'],'order':qs['sort']('-online'),'include':[{'model':db[_0x911f('0x5e')],'as':_0x911f('0x5f'),'attributes':['id',_0x911f('0x2c'),_0x911f('0x31')],'through':{'attributes':[]}}]})[_0x911f('0x29')](function(_0x1a8f12){if(_0x1a8f12){var _0x1da545=_0x20918e[_0x911f('0x58')][_0x911f('0x4f')]({'plain':!![]});if(!_0x1da545)throw new Error(_0x911f('0x60'));if(_0x1da545[_0x911f('0x5a')]===_0x911f('0x58')){return db[_0x911f('0x61')][_0x911f('0x4b')]({'where':{'name':_0x911f('0x62'),'userProfileId':_0x1da545['userProfileId']},'raw':!![]})['then'](function(_0x5e3223){if(_0x5e3223){if(_0x5e3223[_0x911f('0x63')]===0x0){return db['UserProfileResource'][_0x911f('0x45')]({'where':{'sectionId':_0x5e3223['id']},'raw':!![]})[_0x911f('0x29')](function(_0x1a5823){var _0x2573f4=[];if(_[_0x911f('0x64')](_0x1a5823)){_0x2573f4=_[_0x911f('0x65')](_0x1a8f12,function(_0x520da6){if(_0x520da6['role']!==_0x911f('0x56')){return _0x520da6;}});return _0x2573f4;}else{for(var _0x15a928=0x0;_0x15a928<_0x1a8f12[_0x911f('0x3a')];_0x15a928++){var _0x33c536=_0x1a8f12[_0x15a928];if(_0x33c536[_0x911f('0x5a')]==='agent'){var _0x4e74dd=_[_0x911f('0x4b')](_0x1a5823,function(_0x567d7a){return _0x567d7a[_0x911f('0x66')]===_0x33c536['id'];});if(_0x4e74dd)_0x2573f4[_0x911f('0x67')](_0x33c536);}else{_0x2573f4[_0x911f('0x67')](_0x33c536);}}return _0x2573f4;}});}else{return _0x1a8f12;}}else{var _0x24a97c=_[_0x911f('0x65')](_0x1a8f12,function(_0x3d2495){if(_0x3d2495[_0x911f('0x5a')]!=='agent'){return _0x3d2495;}});return _0x24a97c;}});}else{return _0x1a8f12;}}})[_0x911f('0x29')](function(_0x5bd378){var _0x4ee057=[];if(_0x5bd378){_0x1a81ed=_0x5bd378;for(var _0x1c928b=0x0;_0x1c928b<_0x5bd378[_0x911f('0x3a')];_0x1c928b+=0x1){_0x1a81ed[_0x1c928b][_0x911f('0x68')]=[];_0x4ee057['push'](db[_0x911f('0x42')][_0x911f('0x4b')]({'where':{'FromId':[_0x20918e[_0x911f('0x58')]['id'],_0x5bd378[_0x1c928b]['id']],'ToId':[_0x20918e[_0x911f('0x58')]['id'],_0x5bd378[_0x1c928b]['id']],'ChatGroupId':null},'attributes':['id','createdAt',_0x911f('0x69'),'ToId',_0x911f('0x6a'),_0x911f('0x4d')],'order':qs[_0x911f('0x3d')]('-createdAt'),'limit':0x1,'offset':0x0,'raw':!![]})['then'](wrapUser(_0x5bd378[_0x1c928b])));}return BPromise[_0x911f('0x6b')](_0x4ee057);}return[];})[_0x911f('0x29')](function(_0x2d1a1f){return{'rows':_0x2d1a1f,'count':_0x2d1a1f[_0x911f('0x3a')]};})['then'](respondWithResult(_0x180fb2,null))[_0x911f('0x47')](handleError(_0x180fb2,null));}; \ No newline at end of file +var _0x8c8a=['register','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','then','destroy','error','stack','name','send','index','map','rawAttributes','type','key','model','keys','filters','intersection','attributes','fields','query','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','options','ChatInternalMessage','rows','catch','show','includeAll','include','merge','find','body','update','params','describe','get','messages','lastMessageAt','createdAt','format','lastMessage','getUsers','User','findAll','admin','user','fullname','userpic','internal','lastLoginAt','allowmessenger','showWebBar','VoiceQueues','role','UserProfileSection','Agents','userProfileId','isEmpty','push','agent','length','FromId','ToId','read','-createdAt','all','rimraf','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter'];(function(_0x5abc9d,_0x50bd48){var _0x3cdda1=function(_0x151d47){while(--_0x151d47){_0x5abc9d['push'](_0x5abc9d['shift']());}};_0x3cdda1(++_0x50bd48);}(_0x8c8a,0x12f));var _0xa8c8=function(_0x3c8832,_0x16e93e){_0x3c8832=_0x3c8832-0x0;var _0xacf303=_0x8c8a[_0x3c8832];return _0xacf303;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa8c8('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xa8c8('0x1'));var moment=require(_0xa8c8('0x2'));var BPromise=require(_0xa8c8('0x3'));var Mustache=require(_0xa8c8('0x4'));var util=require(_0xa8c8('0x5'));var path=require('path');var sox=require(_0xa8c8('0x6'));var csv=require(_0xa8c8('0x7'));var ejs=require(_0xa8c8('0x8'));var fs=require('fs');var fs_extra=require(_0xa8c8('0x9'));var _=require(_0xa8c8('0xa'));var squel=require('squel');var crypto=require(_0xa8c8('0xb'));var jsforce=require(_0xa8c8('0xc'));var deskjs=require(_0xa8c8('0xd'));var toCsv=require(_0xa8c8('0x7'));var querystring=require(_0xa8c8('0xe'));var Papa=require(_0xa8c8('0xf'));var Redis=require(_0xa8c8('0x10'));var authService=require(_0xa8c8('0x11'));var qs=require(_0xa8c8('0x12'));var as=require(_0xa8c8('0x13'));var hardwareService=require(_0xa8c8('0x14'));var logger=require(_0xa8c8('0x15'))(_0xa8c8('0x16'));var utils=require(_0xa8c8('0x17'));var config=require(_0xa8c8('0x18'));var licenseUtil=require(_0xa8c8('0x19'));var db=require(_0xa8c8('0x1a'))['db'];config[_0xa8c8('0x1b')]=_[_0xa8c8('0x1c')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xa8c8('0x1d'))(new Redis(config['redis']));require('./chatInternalMessage.socket')[_0xa8c8('0x1e')](socket);function respondWithStatusCode(_0x390077,_0x1ac237){_0x1ac237=_0x1ac237||0xcc;return function(_0x89b3fc){if(_0x89b3fc){return _0x390077['sendStatus'](_0x1ac237);}return _0x390077['status'](_0x1ac237)['end']();};}function respondWithResult(_0x4853d4,_0x1ab428){_0x1ab428=_0x1ab428||0xc8;return function(_0x407e32){if(_0x407e32){return _0x4853d4[_0xa8c8('0x1f')](_0x1ab428)['json'](_0x407e32);}};}function respondWithFilteredResult(_0x466656,_0x29b663){return function(_0x4d932c){if(_0x4d932c){var _0x3dc542=typeof _0x29b663[_0xa8c8('0x20')]===_0xa8c8('0x21')&&typeof _0x29b663[_0xa8c8('0x22')]===_0xa8c8('0x21');var _0x2e2db7=_0x4d932c[_0xa8c8('0x23')];var _0x58b193=_0x3dc542?0x0:_0x29b663[_0xa8c8('0x20')];var _0x569861=_0x3dc542?_0x4d932c[_0xa8c8('0x23')]:_0x29b663[_0xa8c8('0x20')]+_0x29b663[_0xa8c8('0x22')];var _0x5874ea;if(_0x569861>=_0x2e2db7){_0x569861=_0x2e2db7;_0x5874ea=0xc8;}else{_0x5874ea=0xce;}_0x466656[_0xa8c8('0x1f')](_0x5874ea);return _0x466656[_0xa8c8('0x24')](_0xa8c8('0x25'),_0x58b193+'-'+_0x569861+'/'+_0x2e2db7)[_0xa8c8('0x26')](_0x4d932c);}return null;};}function patchUpdates(_0x423e3f){return function(_0x21630a){try{jsonpatch[_0xa8c8('0x27')](_0x21630a,_0x423e3f,!![]);}catch(_0x2018c2){return BPromise[_0xa8c8('0x28')](_0x2018c2);}return _0x21630a[_0xa8c8('0x29')]();};}function saveUpdates(_0x36d6f6,_0x10e193){return function(_0x4fe83d){if(_0x4fe83d){return _0x4fe83d['update'](_0x36d6f6)[_0xa8c8('0x2a')](function(_0xb25358){return _0xb25358;});}return null;};}function removeEntity(_0x227414,_0x2a6442){return function(_0x1a3921){if(_0x1a3921){return _0x1a3921[_0xa8c8('0x2b')]()['then'](function(){_0x227414[_0xa8c8('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5ac94f,_0x2524f0){return function(_0x43fe7c){if(!_0x43fe7c){_0x5ac94f['sendStatus'](0x194);}return _0x43fe7c;};}function handleError(_0x23ebca,_0xae0868){_0xae0868=_0xae0868||0x1f4;return function(_0x1c7d82){logger[_0xa8c8('0x2c')](_0x1c7d82[_0xa8c8('0x2d')]);if(_0x1c7d82[_0xa8c8('0x2e')]){delete _0x1c7d82[_0xa8c8('0x2e')];}_0x23ebca[_0xa8c8('0x1f')](_0xae0868)[_0xa8c8('0x2f')](_0x1c7d82);};}exports[_0xa8c8('0x30')]=function(_0x43053e,_0x3db122){var _0x181689={},_0x4d4688={},_0x34a8b1={'count':0x0,'rows':[]};var _0x4ef91f=_[_0xa8c8('0x31')](db['ChatInternalMessage'][_0xa8c8('0x32')],function(_0x3dbeaf){return{'name':_0x3dbeaf['fieldName'],'type':_0x3dbeaf[_0xa8c8('0x33')][_0xa8c8('0x34')]};});_0x4d4688[_0xa8c8('0x35')]=_[_0xa8c8('0x31')](_0x4ef91f,_0xa8c8('0x2e'));_0x4d4688['query']=_[_0xa8c8('0x36')](_0x43053e['query']);_0x4d4688[_0xa8c8('0x37')]=_[_0xa8c8('0x38')](_0x4d4688['model'],_0x4d4688['query']);_0x181689[_0xa8c8('0x39')]=_[_0xa8c8('0x38')](_0x4d4688['model'],qs[_0xa8c8('0x3a')](_0x43053e[_0xa8c8('0x3b')][_0xa8c8('0x3a')]));_0x181689['attributes']=_0x181689['attributes']['length']?_0x181689[_0xa8c8('0x39')]:_0x4d4688[_0xa8c8('0x35')];if(!_0x43053e[_0xa8c8('0x3b')][_0xa8c8('0x3c')](_0xa8c8('0x3d'))){_0x181689[_0xa8c8('0x22')]=qs[_0xa8c8('0x22')](_0x43053e[_0xa8c8('0x3b')][_0xa8c8('0x22')]);_0x181689[_0xa8c8('0x20')]=qs[_0xa8c8('0x20')](_0x43053e['query']['offset']);}_0x181689['order']=qs[_0xa8c8('0x3e')](_0x43053e[_0xa8c8('0x3b')][_0xa8c8('0x3e')]);_0x181689[_0xa8c8('0x3f')]=qs[_0xa8c8('0x37')](_[_0xa8c8('0x40')](_0x43053e[_0xa8c8('0x3b')],_0x4d4688['filters']),_0x4ef91f);if(_0x43053e['query'][_0xa8c8('0x41')]){_0x181689[_0xa8c8('0x3f')]=_['merge'](_0x181689['where'],{'$or':_[_0xa8c8('0x31')](_0x4ef91f,function(_0x45eef4){if(_0x45eef4[_0xa8c8('0x33')]!==_0xa8c8('0x42')){var _0x489451={};_0x489451[_0x45eef4[_0xa8c8('0x2e')]]={'$like':'%'+_0x43053e[_0xa8c8('0x3b')][_0xa8c8('0x41')]+'%'};return _0x489451;}})});}_0x181689=_['merge']({},_0x181689,_0x43053e[_0xa8c8('0x43')]);var _0x51f3e1={'where':_0x181689['where']};return db[_0xa8c8('0x44')][_0xa8c8('0x23')](_0x51f3e1)[_0xa8c8('0x2a')](function(_0x3d87c0){_0x34a8b1['count']=_0x3d87c0;if(_0x43053e[_0xa8c8('0x3b')]['includeAll']){_0x181689['include']=[{'all':!![]}];}return db[_0xa8c8('0x44')]['findAll'](_0x181689);})[_0xa8c8('0x2a')](function(_0x56b22b){_0x34a8b1[_0xa8c8('0x45')]=_0x56b22b;return _0x34a8b1;})[_0xa8c8('0x2a')](respondWithFilteredResult(_0x3db122,_0x181689))[_0xa8c8('0x46')](handleError(_0x3db122,null));};exports[_0xa8c8('0x47')]=function(_0x286be5,_0x5914ed){var _0xf10b73={'raw':!![],'where':{'id':_0x286be5['params']['id']}},_0x56960e={};_0x56960e[_0xa8c8('0x35')]=_[_0xa8c8('0x36')](db[_0xa8c8('0x44')][_0xa8c8('0x32')]);_0x56960e[_0xa8c8('0x3b')]=_['keys'](_0x286be5[_0xa8c8('0x3b')]);_0x56960e[_0xa8c8('0x37')]=_[_0xa8c8('0x38')](_0x56960e[_0xa8c8('0x35')],_0x56960e['query']);_0xf10b73['attributes']=_[_0xa8c8('0x38')](_0x56960e[_0xa8c8('0x35')],qs[_0xa8c8('0x3a')](_0x286be5[_0xa8c8('0x3b')][_0xa8c8('0x3a')]));_0xf10b73[_0xa8c8('0x39')]=_0xf10b73[_0xa8c8('0x39')]['length']?_0xf10b73[_0xa8c8('0x39')]:_0x56960e[_0xa8c8('0x35')];if(_0x286be5[_0xa8c8('0x3b')][_0xa8c8('0x48')]){_0xf10b73[_0xa8c8('0x49')]=[{'all':!![]}];}_0xf10b73=_[_0xa8c8('0x4a')]({},_0xf10b73,_0x286be5[_0xa8c8('0x43')]);return db[_0xa8c8('0x44')][_0xa8c8('0x4b')](_0xf10b73)['then'](handleEntityNotFound(_0x5914ed,null))[_0xa8c8('0x2a')](respondWithResult(_0x5914ed,null))[_0xa8c8('0x46')](handleError(_0x5914ed,null));};exports['create']=function(_0x4b8192,_0x5cd389){return db[_0xa8c8('0x44')]['create'](_0x4b8192[_0xa8c8('0x4c')],{})[_0xa8c8('0x2a')](respondWithResult(_0x5cd389,0xc9))['catch'](handleError(_0x5cd389,null));};exports[_0xa8c8('0x4d')]=function(_0x6748a,_0x5800dc){if(_0x6748a[_0xa8c8('0x4c')]['id']){delete _0x6748a[_0xa8c8('0x4c')]['id'];}return db[_0xa8c8('0x44')][_0xa8c8('0x4b')]({'where':{'id':_0x6748a[_0xa8c8('0x4e')]['id']}})['then'](handleEntityNotFound(_0x5800dc,null))[_0xa8c8('0x2a')](saveUpdates(_0x6748a[_0xa8c8('0x4c')],null))['then'](respondWithResult(_0x5800dc,null))[_0xa8c8('0x46')](handleError(_0x5800dc,null));};exports[_0xa8c8('0x2b')]=function(_0x36dc8e,_0xa6d80c){return db['ChatInternalMessage'][_0xa8c8('0x4b')]({'where':{'id':_0x36dc8e[_0xa8c8('0x4e')]['id']}})['then'](handleEntityNotFound(_0xa6d80c,null))[_0xa8c8('0x2a')](removeEntity(_0xa6d80c,null))[_0xa8c8('0x46')](handleError(_0xa6d80c,null));};exports[_0xa8c8('0x4f')]=function(_0x3f27cf,_0x596ed0){return db['ChatInternalMessage'][_0xa8c8('0x4f')]()['then'](respondWithResult(_0x596ed0,null))[_0xa8c8('0x46')](handleError(_0x596ed0,null));};function wrapUser(_0x3f4c6c){return function(_0x1512ba){var _0x317557=_0x3f4c6c[_0xa8c8('0x50')]({'plain':!![]});_0x317557[_0xa8c8('0x51')]=[];if(_0x1512ba){_0x317557[_0xa8c8('0x52')]=_0x1512ba[_0xa8c8('0x53')];_0x317557['lastMessage']=_0x1512ba;}else{_0x317557[_0xa8c8('0x52')]=moment(0x0)[_0xa8c8('0x54')]('YYYY-MM-DD\x20HH:mm:ss');_0x317557[_0xa8c8('0x55')]={};}return _0x317557;};}exports[_0xa8c8('0x56')]=function(_0x427045,_0x56cea2,_0xa6a41e){var _0x2b789b=[];return db[_0xa8c8('0x57')][_0xa8c8('0x58')]({'where':{'role':['agent',_0xa8c8('0x59'),_0xa8c8('0x5a')]},'attributes':['id',_0xa8c8('0x5b'),_0xa8c8('0x2e'),'role',_0xa8c8('0x5c'),_0xa8c8('0x5d'),'online',_0xa8c8('0x5e'),_0xa8c8('0x5f'),_0xa8c8('0x60')],'order':qs[_0xa8c8('0x3e')]('-online'),'include':[{'model':db['VoiceQueue'],'as':_0xa8c8('0x61'),'attributes':['id','name',_0xa8c8('0x33')],'through':{'attributes':[]}}]})[_0xa8c8('0x2a')](function(_0x20b8eb){if(_0x20b8eb){var _0x5566ec=_0x427045[_0xa8c8('0x5a')][_0xa8c8('0x50')]({'plain':!![]});if(!_0x5566ec)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5566ec[_0xa8c8('0x62')]===_0xa8c8('0x5a')){return db[_0xa8c8('0x63')]['find']({'where':{'name':_0xa8c8('0x64'),'userProfileId':_0x5566ec[_0xa8c8('0x65')]},'raw':!![]})[_0xa8c8('0x2a')](function(_0x3040a8){if(_0x3040a8){if(_0x3040a8['autoAssociation']===0x0){return db['UserProfileResource'][_0xa8c8('0x58')]({'where':{'sectionId':_0x3040a8['id']},'raw':!![]})[_0xa8c8('0x2a')](function(_0x33dab0){var _0x53aa26=[];if(_[_0xa8c8('0x66')](_0x33dab0)){_0x53aa26=_[_0xa8c8('0x41')](_0x20b8eb,function(_0xe18c39){if(_0xe18c39[_0xa8c8('0x62')]!=='agent'){return _0xe18c39;}});return _0x53aa26;}else{for(var _0x58fc64=0x0;_0x58fc64<_0x20b8eb['length'];_0x58fc64++){var _0x2a6ad9=_0x20b8eb[_0x58fc64];if(_0x2a6ad9[_0xa8c8('0x62')]==='agent'){var _0x3f4177=_[_0xa8c8('0x4b')](_0x33dab0,function(_0x44b7d5){return _0x44b7d5['resourceId']===_0x2a6ad9['id'];});if(_0x3f4177)_0x53aa26[_0xa8c8('0x67')](_0x2a6ad9);}else{_0x53aa26[_0xa8c8('0x67')](_0x2a6ad9);}}return _0x53aa26;}});}else{return _0x20b8eb;}}else{var _0x226465=_[_0xa8c8('0x41')](_0x20b8eb,function(_0x2fca69){if(_0x2fca69[_0xa8c8('0x62')]!==_0xa8c8('0x68')){return _0x2fca69;}});return _0x226465;}});}else{return _0x20b8eb;}}})[_0xa8c8('0x2a')](function(_0x4d483c){var _0x3bc346=[];if(_0x4d483c){_0x2b789b=_0x4d483c;for(var _0x222b7a=0x0;_0x222b7a<_0x4d483c[_0xa8c8('0x69')];_0x222b7a+=0x1){_0x2b789b[_0x222b7a][_0xa8c8('0x51')]=[];_0x3bc346[_0xa8c8('0x67')](db['ChatInternalMessage'][_0xa8c8('0x4b')]({'where':{'FromId':[_0x427045['user']['id'],_0x4d483c[_0x222b7a]['id']],'ToId':[_0x427045['user']['id'],_0x4d483c[_0x222b7a]['id']],'ChatGroupId':null},'attributes':['id',_0xa8c8('0x53'),_0xa8c8('0x6a'),_0xa8c8('0x6b'),_0xa8c8('0x6c'),_0xa8c8('0x4c')],'order':qs[_0xa8c8('0x3e')](_0xa8c8('0x6d')),'limit':0x1,'offset':0x0,'raw':!![]})[_0xa8c8('0x2a')](wrapUser(_0x4d483c[_0x222b7a])));}return BPromise[_0xa8c8('0x6e')](_0x3bc346);}return[];})['then'](function(_0x579683){return{'rows':_0x579683,'count':_0x579683[_0xa8c8('0x69')]};})[_0xa8c8('0x2a')](respondWithResult(_0x56cea2,null))[_0xa8c8('0x46')](handleError(_0x56cea2,null));}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js index dff8df0..ec5b7e9 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 _0x0da5=['events','save','remove','emit','hasOwnProperty','exports'];(function(_0x4c4c30,_0x322148){var _0x1c3f6e=function(_0x2706e3){while(--_0x2706e3){_0x4c4c30['push'](_0x4c4c30['shift']());}};_0x1c3f6e(++_0x322148);}(_0x0da5,0xea));var _0x50da=function(_0x4cd74c,_0x26a36d){_0x4cd74c=_0x4cd74c-0x0;var _0x1ee665=_0x0da5[_0x4cd74c];return _0x1ee665;};'use strict';var EventEmitter=require(_0x50da('0x0'));var ChatInternalMessage=require('../../mysqldb')['db']['ChatInternalMessage'];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x50da('0x1'),'afterUpdate':'update','afterDestroy':_0x50da('0x2')};function emitEvent(_0x299a47){return function(_0x531750,_0x1c41f3,_0x4c64f8){ChatInternalMessageEvents[_0x50da('0x3')](_0x299a47+':'+_0x531750['id'],_0x531750);ChatInternalMessageEvents[_0x50da('0x3')](_0x299a47,_0x531750);_0x4c64f8(null);};}for(var e in events){if(events[_0x50da('0x4')](e)){var event=events[e];ChatInternalMessage['hook'](e,emitEvent(event));}}module[_0x50da('0x5')]=ChatInternalMessageEvents; \ No newline at end of file +var _0x5a9e=['update','emit','hasOwnProperty','hook','events','setMaxListeners','save'];(function(_0x1830b6,_0x25b50f){var _0x2fe25c=function(_0x15572d){while(--_0x15572d){_0x1830b6['push'](_0x1830b6['shift']());}};_0x2fe25c(++_0x25b50f);}(_0x5a9e,0x15b));var _0xe5a9=function(_0x469ac7,_0x38e416){_0x469ac7=_0x469ac7-0x0;var _0x22f3b0=_0x5a9e[_0x469ac7];return _0x22f3b0;};'use strict';var EventEmitter=require(_0xe5a9('0x0'));var ChatInternalMessage=require('../../mysqldb')['db']['ChatInternalMessage'];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0xe5a9('0x1')](0x0);var events={'afterCreate':_0xe5a9('0x2'),'afterUpdate':_0xe5a9('0x3'),'afterDestroy':'remove'};function emitEvent(_0x3e4a05){return function(_0x1e5157,_0x1d1fa5,_0x5c12ee){ChatInternalMessageEvents[_0xe5a9('0x4')](_0x3e4a05+':'+_0x1e5157['id'],_0x1e5157);ChatInternalMessageEvents[_0xe5a9('0x4')](_0x3e4a05,_0x1e5157);_0x5c12ee(null);};}for(var e in events){if(events[_0xe5a9('0x5')](e)){var event=events[e];ChatInternalMessage[_0xe5a9('0x6')](e,emitEvent(event));}}module['exports']=ChatInternalMessageEvents; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js index f09281c..f51aa40 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 _0x9603=['ChatInternalMessage','chat_internal_messages','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','define'];(function(_0x38a52d,_0x4e569d){var _0x34f1d0=function(_0x494138){while(--_0x494138){_0x38a52d['push'](_0x38a52d['shift']());}};_0x34f1d0(++_0x4e569d);}(_0x9603,0x178));var _0x3960=function(_0x6cbca7,_0x5b313c){_0x6cbca7=_0x6cbca7-0x0;var _0xfe6ed7=_0x9603[_0x6cbca7];return _0xfe6ed7;};'use strict';var _=require('lodash');var util=require(_0x3960('0x0'));var logger=require(_0x3960('0x1'))('api');var moment=require(_0x3960('0x2'));var BPromise=require(_0x3960('0x3'));var rp=require(_0x3960('0x4'));var fs=require('fs');var path=require(_0x3960('0x5'));var rimraf=require(_0x3960('0x6'));var config=require(_0x3960('0x7'));var attributes=require('./chatInternalMessage.attributes');module['exports']=function(_0x29d0f4,_0x2135e9){return _0x29d0f4[_0x3960('0x8')](_0x3960('0x9'),attributes,{'tableName':_0x3960('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x8067=['define','chat_internal_messages','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','path','rimraf','../../config/environment'];(function(_0xf79bae,_0x263b2a){var _0x5d2cb7=function(_0x27c86b){while(--_0x27c86b){_0xf79bae['push'](_0xf79bae['shift']());}};_0x5d2cb7(++_0x263b2a);}(_0x8067,0x17a));var _0x7806=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8067[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x7806('0x0'));var util=require(_0x7806('0x1'));var logger=require('../../config/logger')(_0x7806('0x2'));var moment=require(_0x7806('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x7806('0x4'));var rimraf=require(_0x7806('0x5'));var config=require(_0x7806('0x6'));var attributes=require('./chatInternalMessage.attributes');module['exports']=function(_0xaf8fbc,_0x50c5ce){return _0xaf8fbc[_0x7806('0x7')]('ChatInternalMessage',attributes,{'tableName':_0x7806('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x7806('0x9'),'collate':_0x7806('0xa')});}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js index 347479c..4442d7c 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 _0xd7f0=['localhost','socket.io-emitter','./chatInternalMessage.socket','register','request','then','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatInternalMessage,\x20%s,\x20%s','message','info','result','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','defaults','redis'];(function(_0x5b561d,_0x422b7c){var _0x431060=function(_0x401409){while(--_0x401409){_0x5b561d['push'](_0x5b561d['shift']());}};_0x431060(++_0x422b7c);}(_0xd7f0,0x145));var _0x0d7f=function(_0x52ba78,_0x11f19b){_0x52ba78=_0x52ba78-0x0;var _0x5cb227=_0xd7f0[_0x52ba78];return _0x5cb227;};'use strict';var _=require(_0x0d7f('0x0'));var util=require(_0x0d7f('0x1'));var moment=require(_0x0d7f('0x2'));var BPromise=require('bluebird');var rs=require(_0x0d7f('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0d7f('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x0d7f('0x5'))(_0x0d7f('0x6'));var config=require(_0x0d7f('0x7'));var jayson=require(_0x0d7f('0x8'));var client=jayson['client']['http']({'port':0x232a});config['redis']=_[_0x0d7f('0x9')](config[_0x0d7f('0xa')],{'host':_0x0d7f('0xb'),'port':0x18eb});var socket=require(_0x0d7f('0xc'))(new Redis(config['redis']));require(_0x0d7f('0xd'))[_0x0d7f('0xe')](socket);function respondWithRpcPromise(_0x1a15e2,_0x2cb337,_0x5874e9){return new BPromise(function(_0x2b80aa,_0x15cc6d){return client[_0x0d7f('0xf')](_0x1a15e2,_0x5874e9)[_0x0d7f('0x10')](function(_0x2d17cd){logger['info']('ChatInternalMessage,\x20%s,\x20%s',_0x2cb337,_0x0d7f('0x11'));logger[_0x0d7f('0x12')](_0x0d7f('0x13'),_0x2cb337,'request\x20sent',JSON[_0x0d7f('0x14')](_0x2d17cd));if(_0x2d17cd[_0x0d7f('0x15')]){if(_0x2d17cd['error'][_0x0d7f('0x16')]===0x1f4){logger[_0x0d7f('0x15')](_0x0d7f('0x17'),_0x2cb337,_0x2d17cd[_0x0d7f('0x15')]['message']);return _0x15cc6d(_0x2d17cd[_0x0d7f('0x15')]['message']);}logger[_0x0d7f('0x15')](_0x0d7f('0x17'),_0x2cb337,_0x2d17cd[_0x0d7f('0x15')][_0x0d7f('0x18')]);return _0x2b80aa(_0x2d17cd[_0x0d7f('0x15')]['message']);}else{logger[_0x0d7f('0x19')](_0x0d7f('0x17'),_0x2cb337,'request\x20sent');_0x2b80aa(_0x2d17cd[_0x0d7f('0x1a')][_0x0d7f('0x18')]);}})[_0x0d7f('0x1b')](function(_0x4e54a8){logger[_0x0d7f('0x15')]('ChatInternalMessage,\x20%s,\x20%s',_0x2cb337,_0x4e54a8);_0x15cc6d(_0x4e54a8);});});} \ No newline at end of file +var _0x535f=['info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','register'];(function(_0x225c6d,_0x3488e3){var _0x2c88c4=function(_0x12e0ee){while(--_0x12e0ee){_0x225c6d['push'](_0x225c6d['shift']());}};_0x2c88c4(++_0x3488e3);}(_0x535f,0x111));var _0xf535=function(_0x1e9e21,_0x3d119e){_0x1e9e21=_0x1e9e21-0x0;var _0x1b2f3c=_0x535f[_0x1e9e21];return _0x1b2f3c;};'use strict';var _=require('lodash');var util=require(_0xf535('0x0'));var moment=require(_0xf535('0x1'));var BPromise=require('bluebird');var rs=require(_0xf535('0x2'));var fs=require('fs');var Redis=require(_0xf535('0x3'));var db=require(_0xf535('0x4'))['db'];var utils=require(_0xf535('0x5'));var logger=require('../../config/logger')(_0xf535('0x6'));var config=require(_0xf535('0x7'));var jayson=require(_0xf535('0x8'));var client=jayson[_0xf535('0x9')][_0xf535('0xa')]({'port':0x232a});config[_0xf535('0xb')]=_['defaults'](config['redis'],{'host':_0xf535('0xc'),'port':0x18eb});var socket=require(_0xf535('0xd'))(new Redis(config[_0xf535('0xb')]));require('./chatInternalMessage.socket')[_0xf535('0xe')](socket);function respondWithRpcPromise(_0x61e50b,_0x49673c,_0x48491f){return new BPromise(function(_0x56f05d,_0x3d79cb){return client['request'](_0x61e50b,_0x48491f)['then'](function(_0xad1e94){logger[_0xf535('0xf')](_0xf535('0x10'),_0x49673c,_0xf535('0x11'));logger[_0xf535('0x12')]('ChatInternalMessage,\x20%s,\x20%s,\x20%s',_0x49673c,_0xf535('0x11'),JSON[_0xf535('0x13')](_0xad1e94));if(_0xad1e94[_0xf535('0x14')]){if(_0xad1e94[_0xf535('0x14')][_0xf535('0x15')]===0x1f4){logger[_0xf535('0x14')](_0xf535('0x10'),_0x49673c,_0xad1e94[_0xf535('0x14')][_0xf535('0x16')]);return _0x3d79cb(_0xad1e94[_0xf535('0x14')][_0xf535('0x16')]);}logger['error'](_0xf535('0x10'),_0x49673c,_0xad1e94[_0xf535('0x14')][_0xf535('0x16')]);return _0x56f05d(_0xad1e94[_0xf535('0x14')][_0xf535('0x16')]);}else{logger[_0xf535('0xf')](_0xf535('0x10'),_0x49673c,_0xf535('0x11'));_0x56f05d(_0xad1e94[_0xf535('0x17')][_0xf535('0x16')]);}})['catch'](function(_0x1f1793){logger[_0xf535('0x14')](_0xf535('0x10'),_0x49673c,_0x1f1793);_0x3d79cb(_0x1f1793);});});} \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js index dc3fb56..1eec05e 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 _0x418d=['update','emit','register','length','chatInternalMessage:','./chatInternalMessage.events','save'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x418d,0x16a));var _0xd418=function(_0x536c9d,_0x53b1a1){_0x536c9d=_0x536c9d-0x0;var _0x4d42bc=_0x418d[_0x536c9d];return _0x4d42bc;};'use strict';var ChatInternalMessageEvents=require(_0xd418('0x0'));var events=[_0xd418('0x1'),'remove',_0xd418('0x2')];function createListener(_0x54398a,_0xbf0edc){return function(_0x20b899){_0xbf0edc[_0xd418('0x3')](_0x54398a,_0x20b899);};}function removeListener(_0x2d978f,_0x315eb0){return function(){ChatInternalMessageEvents['removeListener'](_0x2d978f,_0x315eb0);};}exports[_0xd418('0x4')]=function(_0xb10532){for(var _0x2e2a26=0x0,_0x4c3081=events[_0xd418('0x5')];_0x2e2a26<_0x4c3081;_0x2e2a26++){var _0x3f7cc3=events[_0x2e2a26];var _0x4d5303=createListener(_0xd418('0x6')+_0x3f7cc3,_0xb10532);ChatInternalMessageEvents['on'](_0x3f7cc3,_0x4d5303);}}; \ No newline at end of file +var _0xd56f=['save','remove','removeListener','register','./chatInternalMessage.events'];(function(_0x571461,_0x6f7b6b){var _0x15abf5=function(_0x178272){while(--_0x178272){_0x571461['push'](_0x571461['shift']());}};_0x15abf5(++_0x6f7b6b);}(_0xd56f,0x1c1));var _0xfd56=function(_0x2b90e2,_0x3c0729){_0x2b90e2=_0x2b90e2-0x0;var _0x1431e6=_0xd56f[_0x2b90e2];return _0x1431e6;};'use strict';var ChatInternalMessageEvents=require(_0xfd56('0x0'));var events=[_0xfd56('0x1'),_0xfd56('0x2'),'update'];function createListener(_0x8f4b54,_0x58130f){return function(_0x298400){_0x58130f['emit'](_0x8f4b54,_0x298400);};}function removeListener(_0x316f41,_0x2fa21f){return function(){ChatInternalMessageEvents[_0xfd56('0x3')](_0x316f41,_0x2fa21f);};}exports[_0xfd56('0x4')]=function(_0x18c2e8){for(var _0x37d18f=0x0,_0x1703b7=events['length'];_0x37d18f<_0x1703b7;_0x37d18f++){var _0x2285a5=events[_0x37d18f];var _0x3a8d65=createListener('chatInternalMessage:'+_0x2285a5,_0x18c2e8);ChatInternalMessageEvents['on'](_0x2285a5,_0x3a8d65);}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js index bba98f3..eef842f 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 _0x09b4=['show','create','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','isAuthenticated','index','get','/describe','describe','getUsers','/:id'];(function(_0x339589,_0x4616cf){var _0xaa01b8=function(_0x506311){while(--_0x506311){_0x339589['push'](_0x339589['shift']());}};_0xaa01b8(++_0x4616cf);}(_0x09b4,0x1d3));var _0x409b=function(_0x3305de,_0x16582f){_0x3305de=_0x3305de-0x0;var _0x3b5a84=_0x09b4[_0x3305de];return _0x3b5a84;};'use strict';var multer=require('multer');var util=require(_0x409b('0x0'));var path=require(_0x409b('0x1'));var timeout=require(_0x409b('0x2'));var express=require(_0x409b('0x3'));var router=express[_0x409b('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x409b('0x5'));var interaction=require(_0x409b('0x6'));var config=require(_0x409b('0x7'));var controller=require(_0x409b('0x8'));router['get']('/',auth[_0x409b('0x9')](),controller[_0x409b('0xa')]);router[_0x409b('0xb')](_0x409b('0xc'),auth['isAuthenticated'](),controller[_0x409b('0xd')]);router['get']('/users',auth[_0x409b('0x9')](),controller[_0x409b('0xe')]);router[_0x409b('0xb')](_0x409b('0xf'),auth[_0x409b('0x9')](),controller[_0x409b('0x10')]);router['post']('/',auth[_0x409b('0x9')](),controller[_0x409b('0x11')]);router[_0x409b('0x12')](_0x409b('0xf'),controller[_0x409b('0x13')]);router[_0x409b('0x14')](_0x409b('0xf'),auth[_0x409b('0x9')](),controller[_0x409b('0x15')]);module[_0x409b('0x16')]=router; \ No newline at end of file +var _0xd6be=['/users','getUsers','show','create','put','/:id','update','delete','destroy','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/describe','describe'];(function(_0x377de7,_0x42d900){var _0x44e038=function(_0x27b351){while(--_0x27b351){_0x377de7['push'](_0x377de7['shift']());}};_0x44e038(++_0x42d900);}(_0xd6be,0xfc));var _0xed6b=function(_0x146576,_0x537da9){_0x146576=_0x146576-0x0;var _0x5e0d2e=_0xd6be[_0x146576];return _0x5e0d2e;};'use strict';var multer=require(_0xed6b('0x0'));var util=require(_0xed6b('0x1'));var path=require(_0xed6b('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xed6b('0x3')]();var fs_extra=require(_0xed6b('0x4'));var auth=require(_0xed6b('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xed6b('0x6'));var controller=require('./chatInternalMessage.controller');router[_0xed6b('0x7')]('/',auth[_0xed6b('0x8')](),controller[_0xed6b('0x9')]);router[_0xed6b('0x7')](_0xed6b('0xa'),auth[_0xed6b('0x8')](),controller[_0xed6b('0xb')]);router[_0xed6b('0x7')](_0xed6b('0xc'),auth['isAuthenticated'](),controller[_0xed6b('0xd')]);router[_0xed6b('0x7')]('/:id',auth[_0xed6b('0x8')](),controller[_0xed6b('0xe')]);router['post']('/',auth[_0xed6b('0x8')](),controller[_0xed6b('0xf')]);router[_0xed6b('0x10')](_0xed6b('0x11'),controller[_0xed6b('0x12')]);router[_0xed6b('0x13')]('/:id',auth[_0xed6b('0x8')](),controller[_0xed6b('0x14')]);module[_0xed6b('0x15')]=router; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js index 891e1ee..1c9ae69 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 _0x05b6=['ENUM','out','DATE','STRING','sequelize','TEXT','medium','BOOLEAN'];(function(_0x16b9ed,_0x56517a){var _0x66b1f8=function(_0x1c883){while(--_0x1c883){_0x16b9ed['push'](_0x16b9ed['shift']());}};_0x66b1f8(++_0x56517a);}(_0x05b6,0x74));var _0x605b=function(_0x25cec5,_0x115d0c){_0x25cec5=_0x25cec5-0x0;var _0x19fba4=_0x05b6[_0x25cec5];return _0x19fba4;};'use strict';var Sequelize=require(_0x605b('0x0'));module['exports']={'body':{'type':Sequelize[_0x605b('0x1')](_0x605b('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x605b('0x3')],'defaultValue':![]},'secret':{'type':Sequelize[_0x605b('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x605b('0x4')]('in',_0x605b('0x5')),'defaultValue':_0x605b('0x5'),'allowNull':![]},'readAt':{'type':Sequelize[_0x605b('0x6')]},'providerName':{'type':Sequelize[_0x605b('0x7')]},'providerResponse':{'type':Sequelize[_0x605b('0x1')]}}; \ No newline at end of file +var _0xc902=['BOOLEAN','out','DATE','STRING','sequelize','exports','TEXT','medium'];(function(_0x304e9b,_0x4ee957){var _0x2099c0=function(_0x46f53c){while(--_0x46f53c){_0x304e9b['push'](_0x304e9b['shift']());}};_0x2099c0(++_0x4ee957);}(_0xc902,0x15c));var _0x2c90=function(_0xe5101e,_0x1cd5f9){_0xe5101e=_0xe5101e-0x0;var _0x225586=_0xc902[_0xe5101e];return _0x225586;};'use strict';var Sequelize=require(_0x2c90('0x0'));module[_0x2c90('0x1')]={'body':{'type':Sequelize[_0x2c90('0x2')](_0x2c90('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x2c90('0x4')],'defaultValue':![]},'secret':{'type':Sequelize[_0x2c90('0x4')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x2c90('0x5')),'defaultValue':_0x2c90('0x5'),'allowNull':![]},'readAt':{'type':Sequelize[_0x2c90('0x6')]},'providerName':{'type':Sequelize[_0x2c90('0x7')]},'providerResponse':{'type':Sequelize[_0x2c90('0x2')]}}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js index c96dbab..2858fda 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 _0x9fd7=['register','jayson/promise','client','http','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','destroy','stack','name','send','index','map','ChatMessage','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','sort','pick','filter','where','merge','includeAll','include','rows','catch','show','options','find','create','update','body','params','describe','../../config/logger','chat','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','ChatInteraction','ChatInteractionId','isNil','read1stAt','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','stringify','null','AcceptMessage','acceptMessage','ContactId','QueryTypes','contact','fullname','email','internal','manual','channel','motionChannel','event','accept','EventManager','acceptmessage','parse','formData','chat-interactions','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','RejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','Sequelize','SELECT','interface','SIP/%s','reject','rejectmessage','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./chatMessage.socket'];(function(_0x542d80,_0x150561){var _0x1f4492=function(_0x542215){while(--_0x542215){_0x542d80['push'](_0x542d80['shift']());}};_0x1f4492(++_0x150561);}(_0x9fd7,0xea));var _0x79fd=function(_0x34bd0f,_0x484211){_0x34bd0f=_0x34bd0f-0x0;var _0xf25191=_0x9fd7[_0x34bd0f];return _0xf25191;};'use strict';var emlformat=require(_0x79fd('0x0'));var rimraf=require(_0x79fd('0x1'));var zipdir=require(_0x79fd('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x79fd('0x3'));var moment=require(_0x79fd('0x4'));var BPromise=require(_0x79fd('0x5'));var Mustache=require('mustache');var util=require(_0x79fd('0x6'));var path=require(_0x79fd('0x7'));var sox=require('sox');var csv=require(_0x79fd('0x8'));var ejs=require(_0x79fd('0x9'));var fs=require('fs');var fs_extra=require(_0x79fd('0xa'));var _=require(_0x79fd('0xb'));var squel=require(_0x79fd('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x79fd('0xd'));var toCsv=require(_0x79fd('0x8'));var querystring=require(_0x79fd('0xe'));var Papa=require(_0x79fd('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x79fd('0x10'));var logger=require('../../config/logger')('api');var utils=require(_0x79fd('0x11'));var config=require(_0x79fd('0x12'));var licenseUtil=require(_0x79fd('0x13'));var db=require(_0x79fd('0x14'))['db'];config['redis']=_[_0x79fd('0x15')](config[_0x79fd('0x16')],{'host':_0x79fd('0x17'),'port':0x18eb});var socket=require(_0x79fd('0x18'))(new Redis(config[_0x79fd('0x16')]));require(_0x79fd('0x19'))[_0x79fd('0x1a')](socket);var jayson=require(_0x79fd('0x1b'));var client=jayson[_0x79fd('0x1c')][_0x79fd('0x1d')]({'port':0x232c});var client9002=jayson[_0x79fd('0x1c')][_0x79fd('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x378289,_0x35f5f9,_0x47f0c1,_0x93b710){return new BPromise(function(_0x490011,_0xd55fcc){var _0x300724=_0x93b710||client;return _0x300724['request'](_0x378289,_0x47f0c1)[_0x79fd('0x1e')](function(_0x42843e){logger[_0x79fd('0x1f')](_0x79fd('0x20'),_0x35f5f9,_0x79fd('0x21'));logger[_0x79fd('0x22')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x35f5f9,_0x79fd('0x21'),JSON['stringify'](_0x42843e));if(_0x42843e[_0x79fd('0x23')]){if(_0x42843e['error'][_0x79fd('0x24')]===0x1f4){logger['error'](_0x79fd('0x20'),_0x35f5f9,_0x42843e['error'][_0x79fd('0x25')]);return _0xd55fcc(_0x42843e[_0x79fd('0x23')]['message']);}logger[_0x79fd('0x23')](_0x79fd('0x20'),_0x35f5f9,_0x42843e[_0x79fd('0x23')]['message']);return _0x490011(_0x42843e[_0x79fd('0x23')][_0x79fd('0x25')]);}else{logger['info'](_0x79fd('0x20'),_0x35f5f9,'request\x20sent');_0x490011(_0x42843e[_0x79fd('0x26')][_0x79fd('0x25')]);}})['catch'](function(_0x1cfc05){logger[_0x79fd('0x23')](_0x79fd('0x20'),_0x35f5f9,_0x1cfc05);_0xd55fcc(_0x1cfc05);});});}function respondWithStatusCode(_0x491720,_0x3543d1){_0x3543d1=_0x3543d1||0xcc;return function(_0x27df0b){if(_0x27df0b){return _0x491720[_0x79fd('0x27')](_0x3543d1);}return _0x491720[_0x79fd('0x28')](_0x3543d1)[_0x79fd('0x29')]();};}function respondWithResult(_0x1ea05e,_0x4c5735){_0x4c5735=_0x4c5735||0xc8;return function(_0x36146f){if(_0x36146f){return _0x1ea05e[_0x79fd('0x28')](_0x4c5735)[_0x79fd('0x2a')](_0x36146f);}};}function respondWithFilteredResult(_0xbf2e8d,_0x1b3e25){return function(_0x12ab73){if(_0x12ab73){var _0x14b752=typeof _0x1b3e25[_0x79fd('0x2b')]===_0x79fd('0x2c')&&typeof _0x1b3e25[_0x79fd('0x2d')]==='undefined';var _0x1702d9=_0x12ab73[_0x79fd('0x2e')];var _0x1a0093=_0x14b752?0x0:_0x1b3e25[_0x79fd('0x2b')];var _0x595783=_0x14b752?_0x12ab73[_0x79fd('0x2e')]:_0x1b3e25[_0x79fd('0x2b')]+_0x1b3e25[_0x79fd('0x2d')];var _0x567873;if(_0x595783>=_0x1702d9){_0x595783=_0x1702d9;_0x567873=0xc8;}else{_0x567873=0xce;}_0xbf2e8d[_0x79fd('0x28')](_0x567873);return _0xbf2e8d[_0x79fd('0x2f')](_0x79fd('0x30'),_0x1a0093+'-'+_0x595783+'/'+_0x1702d9)[_0x79fd('0x2a')](_0x12ab73);}return null;};}function patchUpdates(_0x297d97){return function(_0x15ab4e){try{jsonpatch[_0x79fd('0x31')](_0x15ab4e,_0x297d97,!![]);}catch(_0xde5ffb){return BPromise['reject'](_0xde5ffb);}return _0x15ab4e['save']();};}function saveUpdates(_0x324973,_0xdccb82){return function(_0x3e7ef4){if(_0x3e7ef4){return _0x3e7ef4['update'](_0x324973)[_0x79fd('0x1e')](function(_0x17d72e){return _0x17d72e;});}return null;};}function removeEntity(_0x146209,_0x36d0b4){return function(_0xfff488){if(_0xfff488){return _0xfff488[_0x79fd('0x32')]()[_0x79fd('0x1e')](function(){_0x146209[_0x79fd('0x28')](0xcc)[_0x79fd('0x29')]();});}};}function handleEntityNotFound(_0x3d6805,_0x5bcdbc){return function(_0x3b7fab){if(!_0x3b7fab){_0x3d6805[_0x79fd('0x27')](0x194);}return _0x3b7fab;};}function handleError(_0x5c50f4,_0x5d3b82){_0x5d3b82=_0x5d3b82||0x1f4;return function(_0x5ac06f){logger[_0x79fd('0x23')](_0x5ac06f[_0x79fd('0x33')]);if(_0x5ac06f[_0x79fd('0x34')]){delete _0x5ac06f['name'];}_0x5c50f4['status'](_0x5d3b82)[_0x79fd('0x35')](_0x5ac06f);};}exports[_0x79fd('0x36')]=function(_0x4adb2b,_0x10a868){var _0x43da69={},_0xe879fc={},_0x3a2b81={'count':0x0,'rows':[]};var _0x4c7cf7=_[_0x79fd('0x37')](db[_0x79fd('0x38')][_0x79fd('0x39')],function(_0x5cc2a3){return{'name':_0x5cc2a3[_0x79fd('0x3a')],'type':_0x5cc2a3[_0x79fd('0x3b')][_0x79fd('0x3c')]};});_0xe879fc[_0x79fd('0x3d')]=_[_0x79fd('0x37')](_0x4c7cf7,_0x79fd('0x34'));_0xe879fc[_0x79fd('0x3e')]=_[_0x79fd('0x3f')](_0x4adb2b['query']);_0xe879fc[_0x79fd('0x40')]=_[_0x79fd('0x41')](_0xe879fc[_0x79fd('0x3d')],_0xe879fc[_0x79fd('0x3e')]);_0x43da69['attributes']=_[_0x79fd('0x41')](_0xe879fc[_0x79fd('0x3d')],qs[_0x79fd('0x42')](_0x4adb2b[_0x79fd('0x3e')]['fields']));_0x43da69['attributes']=_0x43da69[_0x79fd('0x43')][_0x79fd('0x44')]?_0x43da69['attributes']:_0xe879fc['model'];if(!_0x4adb2b['query']['hasOwnProperty']('nolimit')){_0x43da69[_0x79fd('0x2d')]=qs[_0x79fd('0x2d')](_0x4adb2b[_0x79fd('0x3e')][_0x79fd('0x2d')]);_0x43da69[_0x79fd('0x2b')]=qs[_0x79fd('0x2b')](_0x4adb2b[_0x79fd('0x3e')]['offset']);}_0x43da69['order']=qs[_0x79fd('0x45')](_0x4adb2b[_0x79fd('0x3e')][_0x79fd('0x45')]);_0x43da69['where']=qs[_0x79fd('0x40')](_[_0x79fd('0x46')](_0x4adb2b[_0x79fd('0x3e')],_0xe879fc[_0x79fd('0x40')]),_0x4c7cf7);if(_0x4adb2b[_0x79fd('0x3e')][_0x79fd('0x47')]){_0x43da69[_0x79fd('0x48')]=_[_0x79fd('0x49')](_0x43da69[_0x79fd('0x48')],{'$or':_[_0x79fd('0x37')](_0x4c7cf7,function(_0x26ab11){if(_0x26ab11['type']!=='VIRTUAL'){var _0x3d65b0={};_0x3d65b0[_0x26ab11[_0x79fd('0x34')]]={'$like':'%'+_0x4adb2b['query'][_0x79fd('0x47')]+'%'};return _0x3d65b0;}})});}_0x43da69=_[_0x79fd('0x49')]({},_0x43da69,_0x4adb2b['options']);var _0x1acfc6={'where':_0x43da69[_0x79fd('0x48')]};return db['ChatMessage']['count'](_0x1acfc6)[_0x79fd('0x1e')](function(_0x3e27a4){_0x3a2b81[_0x79fd('0x2e')]=_0x3e27a4;if(_0x4adb2b[_0x79fd('0x3e')][_0x79fd('0x4a')]){_0x43da69[_0x79fd('0x4b')]=[{'all':!![]}];}return db[_0x79fd('0x38')]['findAll'](_0x43da69);})[_0x79fd('0x1e')](function(_0x194be2){_0x3a2b81[_0x79fd('0x4c')]=_0x194be2;return _0x3a2b81;})[_0x79fd('0x1e')](respondWithFilteredResult(_0x10a868,_0x43da69))[_0x79fd('0x4d')](handleError(_0x10a868,null));};exports[_0x79fd('0x4e')]=function(_0x540a24,_0x86290c){var _0x59880d={'raw':!![],'where':{'id':_0x540a24['params']['id']}},_0x5cc27b={};_0x5cc27b[_0x79fd('0x3d')]=_[_0x79fd('0x3f')](db[_0x79fd('0x38')][_0x79fd('0x39')]);_0x5cc27b['query']=_['keys'](_0x540a24[_0x79fd('0x3e')]);_0x5cc27b[_0x79fd('0x40')]=_[_0x79fd('0x41')](_0x5cc27b[_0x79fd('0x3d')],_0x5cc27b[_0x79fd('0x3e')]);_0x59880d[_0x79fd('0x43')]=_[_0x79fd('0x41')](_0x5cc27b['model'],qs['fields'](_0x540a24['query'][_0x79fd('0x42')]));_0x59880d[_0x79fd('0x43')]=_0x59880d['attributes'][_0x79fd('0x44')]?_0x59880d[_0x79fd('0x43')]:_0x5cc27b[_0x79fd('0x3d')];if(_0x540a24[_0x79fd('0x3e')][_0x79fd('0x4a')]){_0x59880d[_0x79fd('0x4b')]=[{'all':!![]}];}_0x59880d=_[_0x79fd('0x49')]({},_0x59880d,_0x540a24[_0x79fd('0x4f')]);return db['ChatMessage'][_0x79fd('0x50')](_0x59880d)[_0x79fd('0x1e')](handleEntityNotFound(_0x86290c,null))['then'](respondWithResult(_0x86290c,null))['catch'](handleError(_0x86290c,null));};exports[_0x79fd('0x51')]=function(_0x157d85,_0xd7bda){return db['ChatMessage']['create'](_0x157d85['body'],{})[_0x79fd('0x1e')](respondWithResult(_0xd7bda,0xc9))['catch'](handleError(_0xd7bda,null));};exports[_0x79fd('0x52')]=function(_0x2ee7a0,_0x1f8ec7){if(_0x2ee7a0[_0x79fd('0x53')]['id']){delete _0x2ee7a0[_0x79fd('0x53')]['id'];}return db['ChatMessage'][_0x79fd('0x50')]({'where':{'id':_0x2ee7a0['params']['id']}})[_0x79fd('0x1e')](handleEntityNotFound(_0x1f8ec7,null))[_0x79fd('0x1e')](saveUpdates(_0x2ee7a0[_0x79fd('0x53')],null))['then'](respondWithResult(_0x1f8ec7,null))[_0x79fd('0x4d')](handleError(_0x1f8ec7,null));};exports[_0x79fd('0x32')]=function(_0x433fc8,_0x516821){return db[_0x79fd('0x38')][_0x79fd('0x50')]({'where':{'id':_0x433fc8[_0x79fd('0x54')]['id']}})[_0x79fd('0x1e')](handleEntityNotFound(_0x516821,null))['then'](removeEntity(_0x516821,null))[_0x79fd('0x4d')](handleError(_0x516821,null));};exports[_0x79fd('0x55')]=function(_0x5290f4,_0x33b3bf){return db[_0x79fd('0x38')][_0x79fd('0x55')]()[_0x79fd('0x1e')](respondWithResult(_0x33b3bf,null))[_0x79fd('0x4d')](handleError(_0x33b3bf,null));};var interaction_log=require(_0x79fd('0x56'))('chat-interactions');exports['accept']=function(_0x1d0936,_0x53f574,_0x5896a6){var _0x3001ba={'agent':{},'channel':_0x79fd('0x57')};if(_0x1d0936[_0x79fd('0x53')]['id']){delete _0x1d0936[_0x79fd('0x53')]['id'];}_0x1d0936['body']['read']=!![];_0x1d0936[_0x79fd('0x53')]['readAt']=moment()[_0x79fd('0x58')](_0x79fd('0x59'));_0x1d0936[_0x79fd('0x53')][_0x79fd('0x5a')]=_0x1d0936['body'][_0x79fd('0x5a')]||_0x1d0936[_0x79fd('0x5b')]['id'];_0x3001ba[_0x79fd('0x5c')]['id']=_0x1d0936[_0x79fd('0x53')][_0x79fd('0x5a')];return db['ChatMessage']['find']({'where':{'id':_0x1d0936['params']['id'],'UserId':null}})[_0x79fd('0x1e')](handleEntityNotFound(_0x53f574,null))[_0x79fd('0x1e')](saveUpdates(_0x1d0936['body'],null))['then'](function(_0xcd80fc){if(_0xcd80fc){_0x3001ba[_0x79fd('0x25')]=_0xcd80fc[_0x79fd('0x5d')]({'plain':!![]});return db[_0x79fd('0x5e')][_0x79fd('0x50')]({'where':{'id':_0xcd80fc[_0x79fd('0x5f')]}});}return null;})[_0x79fd('0x1e')](handleEntityNotFound(_0x53f574,null))[_0x79fd('0x1e')](function(_0x2197b3){if(_0x2197b3){return _0x2197b3['update']({'UserId':_0x1d0936[_0x79fd('0x53')][_0x79fd('0x5a')],'read1stAt':_[_0x79fd('0x60')](_0x2197b3[_0x79fd('0x61')])?moment()[_0x79fd('0x58')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x79fd('0x1e')](function(_0x52b6b7){if(_0x52b6b7){_0x3001ba[_0x79fd('0x62')]=_0x52b6b7[_0x79fd('0x5d')]({'plain':!![]});interaction_log[_0x79fd('0x1f')](_0x79fd('0x63'),_0x1d0936[_0x79fd('0x5b')]['id'],_0x1d0936[_0x79fd('0x5b')][_0x79fd('0x34')],_0x1d0936[_0x79fd('0x5b')]['role'],_0x3001ba[_0x79fd('0x62')]['id'],_0x1d0936[_0x79fd('0x53')]?JSON[_0x79fd('0x64')](_0x1d0936['body']):_0x79fd('0x65'));return respondWithRpcPromise(_0x79fd('0x66'),_0x79fd('0x67'),_0x3001ba);}return null;})[_0x79fd('0x1e')](function(_0x15b0c4){var _0x1dbf5d='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x15b0c4[_0x79fd('0x25')][_0x79fd('0x68')];return db['sequelize'][_0x79fd('0x3e')](_0x1dbf5d,{'type':db['Sequelize'][_0x79fd('0x69')]['SELECT'],'raw':!![]})[_0x79fd('0x1e')](function(_0x25be3c){return _0x25be3c;});})[_0x79fd('0x1e')](function(_0x33e6c2){if(_0x33e6c2){_0x3001ba[_0x79fd('0x25')][_0x79fd('0x6a')]=_0x33e6c2[0x0];if(!_0x1d0936[_0x79fd('0x53')]['UserId'])return;return db['User'][_0x79fd('0x50')]({'where':{'id':_0x1d0936[_0x79fd('0x53')][_0x79fd('0x5a')],'role':_0x79fd('0x5c')},'attributes':['id','name',_0x79fd('0x6b'),_0x79fd('0x6c'),_0x79fd('0x6d')],'raw':!![]});}return null;})[_0x79fd('0x1e')](function(_0x573720){if(!_0x573720)return null;_0x3001ba[_0x79fd('0x25')][_0x79fd('0x5c')]=_0x573720;return _0x3001ba;})[_0x79fd('0x1e')](function(_0x4eb8d6){if(_0x4eb8d6){if(_0x1d0936['body'][_0x79fd('0x6e')]){_0x3001ba[_0x79fd('0x25')]['interface']=util[_0x79fd('0x58')]('SIP/%s',_0x1d0936[_0x79fd('0x5b')][_0x79fd('0x34')]);_0x3001ba[_0x79fd('0x25')][_0x79fd('0x6f')]=_0x3001ba[_0x79fd('0x6f')];_0x3001ba[_0x79fd('0x25')][_0x79fd('0x70')]=_0x3001ba[_0x79fd('0x6f')];_0x3001ba[_0x79fd('0x25')][_0x79fd('0x71')]=_0x79fd('0x72');return respondWithRpcPromise(_0x79fd('0x73'),_0x79fd('0x73'),{'event':_0x79fd('0x74'),'message':_[_0x79fd('0x49')](_0x3001ba[_0x79fd('0x25')],JSON[_0x79fd('0x75')](_0x3001ba[_0x79fd('0x62')][_0x79fd('0x76')]))},client9002)['then'](function(){return _0x3001ba;});}return _0x3001ba;}return null;})[_0x79fd('0x1e')](respondWithResult(_0x53f574,null))[_0x79fd('0x4d')](handleError(_0x53f574,null));};var interaction_log=require(_0x79fd('0x56'))(_0x79fd('0x77'));exports['reject']=function(_0x58e27d,_0x251e92,_0xa84c85){var _0xa5f843={'agent':{},'channel':_0x79fd('0x57')};if(_0x58e27d['body']['id']){delete _0x58e27d[_0x79fd('0x53')]['id'];}_0x58e27d[_0x79fd('0x53')][_0x79fd('0x5a')]=_0x58e27d[_0x79fd('0x53')][_0x79fd('0x5a')]||_0x58e27d[_0x79fd('0x5b')]['id'];_0xa5f843['agent']['id']=_0x58e27d['body'][_0x79fd('0x5a')];return db[_0x79fd('0x38')][_0x79fd('0x50')]({'where':{'id':_0x58e27d[_0x79fd('0x54')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x251e92,null))[_0x79fd('0x1e')](function(_0x29c416){if(_0x29c416){_0xa5f843['message']=_0x29c416[_0x79fd('0x5d')]({'plain':!![]});return db[_0x79fd('0x5e')][_0x79fd('0x50')]({'where':{'id':_0x29c416['ChatInteractionId']}});}return null;})[_0x79fd('0x1e')](handleEntityNotFound(_0x251e92,null))[_0x79fd('0x1e')](function(_0x1f83c3){if(_0x1f83c3){_0xa5f843[_0x79fd('0x62')]=_0x1f83c3[_0x79fd('0x5d')]({'plain':!![]});interaction_log[_0x79fd('0x1f')](_0x79fd('0x78'),_0x58e27d[_0x79fd('0x5b')]['id'],_0x58e27d[_0x79fd('0x5b')][_0x79fd('0x34')],_0x58e27d[_0x79fd('0x5b')][_0x79fd('0x79')],_0xa5f843['interaction']['id'],_0x58e27d[_0x79fd('0x53')]?JSON[_0x79fd('0x64')](_0x58e27d[_0x79fd('0x53')]):_0x79fd('0x65'));return respondWithRpcPromise(_0x79fd('0x7a'),'rejectMessage',_0xa5f843);}return null;})[_0x79fd('0x1e')](function(_0x3d0caf){var _0x3e0c4c=_0x79fd('0x7b')+_0x3d0caf['message']['ContactId'];return db['sequelize'][_0x79fd('0x3e')](_0x3e0c4c,{'type':db[_0x79fd('0x7c')][_0x79fd('0x69')][_0x79fd('0x7d')],'raw':!![]})[_0x79fd('0x1e')](function(_0x64d95b){return _0x64d95b;});})[_0x79fd('0x1e')](function(_0x1394fc){if(_0x1394fc){_0xa5f843[_0x79fd('0x25')][_0x79fd('0x6a')]=_0x1394fc[0x0];if(!_0x58e27d[_0x79fd('0x53')]['UserId'])return;return db['User'][_0x79fd('0x50')]({'where':{'id':_0x58e27d[_0x79fd('0x53')][_0x79fd('0x5a')],'role':_0x79fd('0x5c')},'attributes':['id',_0x79fd('0x34'),'fullname','email','internal'],'raw':!![]});}return null;})['then'](function(_0x45002b){if(!_0x45002b)return null;_0xa5f843['message'][_0x79fd('0x5c')]=_0x45002b;return _0xa5f843;})[_0x79fd('0x1e')](function(_0x126c55){if(_0x126c55){_0x126c55[_0x79fd('0x25')][_0x79fd('0x7e')]=util[_0x79fd('0x58')](_0x79fd('0x7f'),_0x58e27d[_0x79fd('0x5b')][_0x79fd('0x34')]);_0x126c55[_0x79fd('0x25')]['channel']=_0xa5f843[_0x79fd('0x6f')];_0x126c55[_0x79fd('0x25')][_0x79fd('0x70')]=_0xa5f843[_0x79fd('0x6f')];_0x126c55['message'][_0x79fd('0x71')]=_0x79fd('0x80');respondWithRpcPromise(_0x79fd('0x73'),'EventManager',{'event':_0x79fd('0x81'),'message':_[_0x79fd('0x49')](_0xa5f843[_0x79fd('0x25')],JSON['parse'](_0xa5f843[_0x79fd('0x62')][_0x79fd('0x76')]))},client9002);return _0xa5f843;}return null;})[_0x79fd('0x1e')](respondWithResult(_0x251e92,null))[_0x79fd('0x4d')](handleError(_0x251e92,null));}; \ No newline at end of file +var _0xe1a6=['apply','reject','save','update','then','destroy','end','sendStatus','name','send','index','map','rawAttributes','fieldName','type','key','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','where','filter','VIRTUAL','merge','options','ChatMessage','includeAll','findAll','rows','show','params','find','create','body','describe','../../config/logger','chat-interactions','accept','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','get','ChatInteraction','ChatInteractionId','isNil','read1stAt','interaction','role','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','QueryTypes','contact','User','fullname','email','internal','manual','interface','SIP/%s','user','channel','event','EventManager','acceptmessage','parse','formData','chat','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','rejectMessage','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','api','../../config/license/util','../../mysqldb','redis','localhost','./chatMessage.socket','jayson/promise','client','http','request','info','ChatMessage,\x20%s,\x20%s','debug','ChatMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','result','catch','status','json','offset','undefined','count','set','Content-Range'];(function(_0x542a4e,_0x23f7ef){var _0x11d75d=function(_0x12c1c7){while(--_0x12c1c7){_0x542a4e['push'](_0x542a4e['shift']());}};_0x11d75d(++_0x23f7ef);}(_0xe1a6,0x1d2));var _0x6e1a=function(_0x4476d0,_0x31a689){_0x4476d0=_0x4476d0-0x0;var _0x516800=_0xe1a6[_0x4476d0];return _0x516800;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6e1a('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6e1a('0x1'));var rp=require(_0x6e1a('0x2'));var moment=require(_0x6e1a('0x3'));var BPromise=require(_0x6e1a('0x4'));var Mustache=require(_0x6e1a('0x5'));var util=require('util');var path=require(_0x6e1a('0x6'));var sox=require(_0x6e1a('0x7'));var csv=require(_0x6e1a('0x8'));var ejs=require(_0x6e1a('0x9'));var fs=require('fs');var fs_extra=require(_0x6e1a('0xa'));var _=require(_0x6e1a('0xb'));var squel=require('squel');var crypto=require(_0x6e1a('0xc'));var jsforce=require(_0x6e1a('0xd'));var deskjs=require(_0x6e1a('0xe'));var toCsv=require(_0x6e1a('0x8'));var querystring=require('querystring');var Papa=require(_0x6e1a('0xf'));var Redis=require(_0x6e1a('0x10'));var authService=require(_0x6e1a('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x6e1a('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x6e1a('0x13'));var db=require(_0x6e1a('0x14'))['db'];config[_0x6e1a('0x15')]=_['defaults'](config[_0x6e1a('0x15')],{'host':_0x6e1a('0x16'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6e1a('0x15')]));require(_0x6e1a('0x17'))['register'](socket);var jayson=require(_0x6e1a('0x18'));var client=jayson[_0x6e1a('0x19')][_0x6e1a('0x1a')]({'port':0x232c});var client9002=jayson[_0x6e1a('0x19')][_0x6e1a('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0x2c3da9,_0x297fd8,_0x5c6fb0,_0x355e0b){return new BPromise(function(_0x407216,_0x4306e3){var _0xa16487=_0x355e0b||client;return _0xa16487[_0x6e1a('0x1b')](_0x2c3da9,_0x5c6fb0)['then'](function(_0x4d517f){logger[_0x6e1a('0x1c')](_0x6e1a('0x1d'),_0x297fd8,'request\x20sent');logger[_0x6e1a('0x1e')](_0x6e1a('0x1f'),_0x297fd8,_0x6e1a('0x20'),JSON[_0x6e1a('0x21')](_0x4d517f));if(_0x4d517f['error']){if(_0x4d517f['error'][_0x6e1a('0x22')]===0x1f4){logger['error'](_0x6e1a('0x1d'),_0x297fd8,_0x4d517f[_0x6e1a('0x23')][_0x6e1a('0x24')]);return _0x4306e3(_0x4d517f['error'][_0x6e1a('0x24')]);}logger['error'](_0x6e1a('0x1d'),_0x297fd8,_0x4d517f[_0x6e1a('0x23')][_0x6e1a('0x24')]);return _0x407216(_0x4d517f[_0x6e1a('0x23')][_0x6e1a('0x24')]);}else{logger[_0x6e1a('0x1c')](_0x6e1a('0x1d'),_0x297fd8,_0x6e1a('0x20'));_0x407216(_0x4d517f[_0x6e1a('0x25')][_0x6e1a('0x24')]);}})[_0x6e1a('0x26')](function(_0x42f06d){logger['error']('ChatMessage,\x20%s,\x20%s',_0x297fd8,_0x42f06d);_0x4306e3(_0x42f06d);});});}function respondWithStatusCode(_0x57f71e,_0x2052f5){_0x2052f5=_0x2052f5||0xcc;return function(_0x4594f4){if(_0x4594f4){return _0x57f71e['sendStatus'](_0x2052f5);}return _0x57f71e[_0x6e1a('0x27')](_0x2052f5)['end']();};}function respondWithResult(_0x33794f,_0x3a4a19){_0x3a4a19=_0x3a4a19||0xc8;return function(_0x2ace3c){if(_0x2ace3c){return _0x33794f['status'](_0x3a4a19)[_0x6e1a('0x28')](_0x2ace3c);}};}function respondWithFilteredResult(_0x65b35d,_0x41dc0a){return function(_0x62bbef){if(_0x62bbef){var _0x3f41da=typeof _0x41dc0a[_0x6e1a('0x29')]===_0x6e1a('0x2a')&&typeof _0x41dc0a['limit']===_0x6e1a('0x2a');var _0x2c90e5=_0x62bbef[_0x6e1a('0x2b')];var _0xa6ad0=_0x3f41da?0x0:_0x41dc0a[_0x6e1a('0x29')];var _0x22e7bc=_0x3f41da?_0x62bbef[_0x6e1a('0x2b')]:_0x41dc0a[_0x6e1a('0x29')]+_0x41dc0a['limit'];var _0x27d63f;if(_0x22e7bc>=_0x2c90e5){_0x22e7bc=_0x2c90e5;_0x27d63f=0xc8;}else{_0x27d63f=0xce;}_0x65b35d[_0x6e1a('0x27')](_0x27d63f);return _0x65b35d[_0x6e1a('0x2c')](_0x6e1a('0x2d'),_0xa6ad0+'-'+_0x22e7bc+'/'+_0x2c90e5)[_0x6e1a('0x28')](_0x62bbef);}return null;};}function patchUpdates(_0x21830c){return function(_0x4f209f){try{jsonpatch[_0x6e1a('0x2e')](_0x4f209f,_0x21830c,!![]);}catch(_0x3f08c6){return BPromise[_0x6e1a('0x2f')](_0x3f08c6);}return _0x4f209f[_0x6e1a('0x30')]();};}function saveUpdates(_0x35b389,_0x2b0ac7){return function(_0x558ae9){if(_0x558ae9){return _0x558ae9[_0x6e1a('0x31')](_0x35b389)[_0x6e1a('0x32')](function(_0x281b09){return _0x281b09;});}return null;};}function removeEntity(_0x1ff30f,_0x3096b1){return function(_0x5ac04a){if(_0x5ac04a){return _0x5ac04a[_0x6e1a('0x33')]()[_0x6e1a('0x32')](function(){_0x1ff30f[_0x6e1a('0x27')](0xcc)[_0x6e1a('0x34')]();});}};}function handleEntityNotFound(_0x25639a,_0x28fae0){return function(_0x14c818){if(!_0x14c818){_0x25639a[_0x6e1a('0x35')](0x194);}return _0x14c818;};}function handleError(_0x111cf2,_0x4dfa1f){_0x4dfa1f=_0x4dfa1f||0x1f4;return function(_0x3ead11){logger[_0x6e1a('0x23')](_0x3ead11['stack']);if(_0x3ead11[_0x6e1a('0x36')]){delete _0x3ead11[_0x6e1a('0x36')];}_0x111cf2[_0x6e1a('0x27')](_0x4dfa1f)[_0x6e1a('0x37')](_0x3ead11);};}exports[_0x6e1a('0x38')]=function(_0x281045,_0x471e74){var _0x202628={},_0x4da5cb={},_0xbf988={'count':0x0,'rows':[]};var _0x2557fa=_[_0x6e1a('0x39')](db['ChatMessage'][_0x6e1a('0x3a')],function(_0x5446fa){return{'name':_0x5446fa[_0x6e1a('0x3b')],'type':_0x5446fa[_0x6e1a('0x3c')][_0x6e1a('0x3d')]};});_0x4da5cb['model']=_[_0x6e1a('0x39')](_0x2557fa,_0x6e1a('0x36'));_0x4da5cb['query']=_[_0x6e1a('0x3e')](_0x281045[_0x6e1a('0x3f')]);_0x4da5cb[_0x6e1a('0x40')]=_[_0x6e1a('0x41')](_0x4da5cb[_0x6e1a('0x42')],_0x4da5cb[_0x6e1a('0x3f')]);_0x202628[_0x6e1a('0x43')]=_[_0x6e1a('0x41')](_0x4da5cb[_0x6e1a('0x42')],qs[_0x6e1a('0x44')](_0x281045['query'][_0x6e1a('0x44')]));_0x202628['attributes']=_0x202628['attributes'][_0x6e1a('0x45')]?_0x202628[_0x6e1a('0x43')]:_0x4da5cb[_0x6e1a('0x42')];if(!_0x281045[_0x6e1a('0x3f')][_0x6e1a('0x46')](_0x6e1a('0x47'))){_0x202628['limit']=qs['limit'](_0x281045[_0x6e1a('0x3f')][_0x6e1a('0x48')]);_0x202628[_0x6e1a('0x29')]=qs[_0x6e1a('0x29')](_0x281045['query'][_0x6e1a('0x29')]);}_0x202628['order']=qs[_0x6e1a('0x49')](_0x281045[_0x6e1a('0x3f')][_0x6e1a('0x49')]);_0x202628[_0x6e1a('0x4a')]=qs['filters'](_['pick'](_0x281045['query'],_0x4da5cb[_0x6e1a('0x40')]),_0x2557fa);if(_0x281045[_0x6e1a('0x3f')][_0x6e1a('0x4b')]){_0x202628['where']=_['merge'](_0x202628[_0x6e1a('0x4a')],{'$or':_[_0x6e1a('0x39')](_0x2557fa,function(_0x2788ab){if(_0x2788ab[_0x6e1a('0x3c')]!==_0x6e1a('0x4c')){var _0x454dde={};_0x454dde[_0x2788ab[_0x6e1a('0x36')]]={'$like':'%'+_0x281045['query'][_0x6e1a('0x4b')]+'%'};return _0x454dde;}})});}_0x202628=_[_0x6e1a('0x4d')]({},_0x202628,_0x281045[_0x6e1a('0x4e')]);var _0x2a602b={'where':_0x202628['where']};return db[_0x6e1a('0x4f')][_0x6e1a('0x2b')](_0x2a602b)['then'](function(_0x1448b2){_0xbf988[_0x6e1a('0x2b')]=_0x1448b2;if(_0x281045['query'][_0x6e1a('0x50')]){_0x202628['include']=[{'all':!![]}];}return db['ChatMessage'][_0x6e1a('0x51')](_0x202628);})['then'](function(_0x557326){_0xbf988[_0x6e1a('0x52')]=_0x557326;return _0xbf988;})['then'](respondWithFilteredResult(_0x471e74,_0x202628))['catch'](handleError(_0x471e74,null));};exports[_0x6e1a('0x53')]=function(_0xfd60dd,_0x39f7f8){var _0x4d393b={'raw':!![],'where':{'id':_0xfd60dd[_0x6e1a('0x54')]['id']}},_0x34cec3={};_0x34cec3[_0x6e1a('0x42')]=_[_0x6e1a('0x3e')](db['ChatMessage']['rawAttributes']);_0x34cec3[_0x6e1a('0x3f')]=_['keys'](_0xfd60dd[_0x6e1a('0x3f')]);_0x34cec3[_0x6e1a('0x40')]=_['intersection'](_0x34cec3[_0x6e1a('0x42')],_0x34cec3[_0x6e1a('0x3f')]);_0x4d393b[_0x6e1a('0x43')]=_[_0x6e1a('0x41')](_0x34cec3['model'],qs[_0x6e1a('0x44')](_0xfd60dd[_0x6e1a('0x3f')]['fields']));_0x4d393b[_0x6e1a('0x43')]=_0x4d393b[_0x6e1a('0x43')][_0x6e1a('0x45')]?_0x4d393b[_0x6e1a('0x43')]:_0x34cec3[_0x6e1a('0x42')];if(_0xfd60dd[_0x6e1a('0x3f')][_0x6e1a('0x50')]){_0x4d393b['include']=[{'all':!![]}];}_0x4d393b=_['merge']({},_0x4d393b,_0xfd60dd[_0x6e1a('0x4e')]);return db['ChatMessage'][_0x6e1a('0x55')](_0x4d393b)['then'](handleEntityNotFound(_0x39f7f8,null))[_0x6e1a('0x32')](respondWithResult(_0x39f7f8,null))[_0x6e1a('0x26')](handleError(_0x39f7f8,null));};exports[_0x6e1a('0x56')]=function(_0x4ac36d,_0x3e756b){return db[_0x6e1a('0x4f')][_0x6e1a('0x56')](_0x4ac36d[_0x6e1a('0x57')],{})[_0x6e1a('0x32')](respondWithResult(_0x3e756b,0xc9))[_0x6e1a('0x26')](handleError(_0x3e756b,null));};exports[_0x6e1a('0x31')]=function(_0x4a77c0,_0x6bc5c){if(_0x4a77c0[_0x6e1a('0x57')]['id']){delete _0x4a77c0[_0x6e1a('0x57')]['id'];}return db[_0x6e1a('0x4f')]['find']({'where':{'id':_0x4a77c0[_0x6e1a('0x54')]['id']}})[_0x6e1a('0x32')](handleEntityNotFound(_0x6bc5c,null))['then'](saveUpdates(_0x4a77c0[_0x6e1a('0x57')],null))[_0x6e1a('0x32')](respondWithResult(_0x6bc5c,null))[_0x6e1a('0x26')](handleError(_0x6bc5c,null));};exports['destroy']=function(_0x1ef0d1,_0x7b1bb0){return db['ChatMessage'][_0x6e1a('0x55')]({'where':{'id':_0x1ef0d1['params']['id']}})[_0x6e1a('0x32')](handleEntityNotFound(_0x7b1bb0,null))['then'](removeEntity(_0x7b1bb0,null))[_0x6e1a('0x26')](handleError(_0x7b1bb0,null));};exports[_0x6e1a('0x58')]=function(_0xd7ab19,_0x418d6d){return db[_0x6e1a('0x4f')]['describe']()['then'](respondWithResult(_0x418d6d,null))['catch'](handleError(_0x418d6d,null));};var interaction_log=require(_0x6e1a('0x59'))(_0x6e1a('0x5a'));exports[_0x6e1a('0x5b')]=function(_0x3b9803,_0x140f5c,_0x2a1df0){var _0x4ec28c={'agent':{},'channel':'chat'};if(_0x3b9803[_0x6e1a('0x57')]['id']){delete _0x3b9803['body']['id'];}_0x3b9803[_0x6e1a('0x57')]['read']=!![];_0x3b9803[_0x6e1a('0x57')][_0x6e1a('0x5c')]=moment()[_0x6e1a('0x5d')](_0x6e1a('0x5e'));_0x3b9803[_0x6e1a('0x57')][_0x6e1a('0x5f')]=_0x3b9803[_0x6e1a('0x57')][_0x6e1a('0x5f')]||_0x3b9803['user']['id'];_0x4ec28c[_0x6e1a('0x60')]['id']=_0x3b9803[_0x6e1a('0x57')][_0x6e1a('0x5f')];return db['ChatMessage'][_0x6e1a('0x55')]({'where':{'id':_0x3b9803[_0x6e1a('0x54')]['id'],'UserId':null}})[_0x6e1a('0x32')](handleEntityNotFound(_0x140f5c,null))['then'](saveUpdates(_0x3b9803[_0x6e1a('0x57')],null))[_0x6e1a('0x32')](function(_0x3361f4){if(_0x3361f4){_0x4ec28c[_0x6e1a('0x24')]=_0x3361f4[_0x6e1a('0x61')]({'plain':!![]});return db[_0x6e1a('0x62')][_0x6e1a('0x55')]({'where':{'id':_0x3361f4[_0x6e1a('0x63')]}});}return null;})[_0x6e1a('0x32')](handleEntityNotFound(_0x140f5c,null))[_0x6e1a('0x32')](function(_0x29694c){if(_0x29694c){return _0x29694c['update']({'UserId':_0x3b9803[_0x6e1a('0x57')]['UserId'],'read1stAt':_[_0x6e1a('0x64')](_0x29694c[_0x6e1a('0x65')])?moment()[_0x6e1a('0x5d')](_0x6e1a('0x5e')):undefined});}return null;})['then'](function(_0x12973b){if(_0x12973b){_0x4ec28c[_0x6e1a('0x66')]=_0x12973b[_0x6e1a('0x61')]({'plain':!![]});interaction_log[_0x6e1a('0x1c')]('[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x3b9803['user']['id'],_0x3b9803['user'][_0x6e1a('0x36')],_0x3b9803['user'][_0x6e1a('0x67')],_0x4ec28c[_0x6e1a('0x66')]['id'],_0x3b9803['body']?JSON['stringify'](_0x3b9803[_0x6e1a('0x57')]):'null');return respondWithRpcPromise(_0x6e1a('0x68'),'acceptMessage',_0x4ec28c);}return null;})[_0x6e1a('0x32')](function(_0x2a82a6){var _0x206925=_0x6e1a('0x69')+_0x2a82a6[_0x6e1a('0x24')]['ContactId'];return db[_0x6e1a('0x6a')]['query'](_0x206925,{'type':db[_0x6e1a('0x6b')][_0x6e1a('0x6c')]['SELECT'],'raw':!![]})['then'](function(_0xbe61f5){return _0xbe61f5;});})[_0x6e1a('0x32')](function(_0x30366e){if(_0x30366e){_0x4ec28c[_0x6e1a('0x24')][_0x6e1a('0x6d')]=_0x30366e[0x0];if(!_0x3b9803[_0x6e1a('0x57')][_0x6e1a('0x5f')])return;return db[_0x6e1a('0x6e')]['find']({'where':{'id':_0x3b9803['body'][_0x6e1a('0x5f')],'role':'agent'},'attributes':['id',_0x6e1a('0x36'),_0x6e1a('0x6f'),_0x6e1a('0x70'),_0x6e1a('0x71')],'raw':!![]});}return null;})[_0x6e1a('0x32')](function(_0x149d1c){if(!_0x149d1c)return null;_0x4ec28c[_0x6e1a('0x24')]['agent']=_0x149d1c;return _0x4ec28c;})[_0x6e1a('0x32')](function(_0x3d60fa){if(_0x3d60fa){if(_0x3b9803[_0x6e1a('0x57')][_0x6e1a('0x72')]){_0x4ec28c['message'][_0x6e1a('0x73')]=util[_0x6e1a('0x5d')](_0x6e1a('0x74'),_0x3b9803[_0x6e1a('0x75')][_0x6e1a('0x36')]);_0x4ec28c[_0x6e1a('0x24')][_0x6e1a('0x76')]=_0x4ec28c[_0x6e1a('0x76')];_0x4ec28c[_0x6e1a('0x24')]['motionChannel']=_0x4ec28c['channel'];_0x4ec28c[_0x6e1a('0x24')][_0x6e1a('0x77')]=_0x6e1a('0x5b');return respondWithRpcPromise(_0x6e1a('0x78'),_0x6e1a('0x78'),{'event':_0x6e1a('0x79'),'message':_['merge'](_0x4ec28c['message'],JSON[_0x6e1a('0x7a')](_0x4ec28c[_0x6e1a('0x66')][_0x6e1a('0x7b')]))},client9002)[_0x6e1a('0x32')](function(){return _0x4ec28c;});}return _0x4ec28c;}return null;})[_0x6e1a('0x32')](respondWithResult(_0x140f5c,null))[_0x6e1a('0x26')](handleError(_0x140f5c,null));};var interaction_log=require(_0x6e1a('0x59'))(_0x6e1a('0x5a'));exports[_0x6e1a('0x2f')]=function(_0x5937ae,_0x274f5e,_0x1bbb13){var _0x26880d={'agent':{},'channel':_0x6e1a('0x7c')};if(_0x5937ae['body']['id']){delete _0x5937ae[_0x6e1a('0x57')]['id'];}_0x5937ae[_0x6e1a('0x57')][_0x6e1a('0x5f')]=_0x5937ae[_0x6e1a('0x57')][_0x6e1a('0x5f')]||_0x5937ae[_0x6e1a('0x75')]['id'];_0x26880d[_0x6e1a('0x60')]['id']=_0x5937ae[_0x6e1a('0x57')][_0x6e1a('0x5f')];return db[_0x6e1a('0x4f')][_0x6e1a('0x55')]({'where':{'id':_0x5937ae[_0x6e1a('0x54')]['id'],'UserId':null}})[_0x6e1a('0x32')](handleEntityNotFound(_0x274f5e,null))[_0x6e1a('0x32')](function(_0x3d6358){if(_0x3d6358){_0x26880d['message']=_0x3d6358[_0x6e1a('0x61')]({'plain':!![]});return db[_0x6e1a('0x62')][_0x6e1a('0x55')]({'where':{'id':_0x3d6358[_0x6e1a('0x63')]}});}return null;})[_0x6e1a('0x32')](handleEntityNotFound(_0x274f5e,null))[_0x6e1a('0x32')](function(_0x2999ab){if(_0x2999ab){_0x26880d[_0x6e1a('0x66')]=_0x2999ab['get']({'plain':!![]});interaction_log[_0x6e1a('0x1c')](_0x6e1a('0x7d'),_0x5937ae[_0x6e1a('0x75')]['id'],_0x5937ae[_0x6e1a('0x75')]['name'],_0x5937ae[_0x6e1a('0x75')]['role'],_0x26880d[_0x6e1a('0x66')]['id'],_0x5937ae[_0x6e1a('0x57')]?JSON[_0x6e1a('0x21')](_0x5937ae[_0x6e1a('0x57')]):_0x6e1a('0x7e'));return respondWithRpcPromise('RejectMessage',_0x6e1a('0x7f'),_0x26880d);}return null;})[_0x6e1a('0x32')](function(_0x578988){var _0x4d1d12='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x578988[_0x6e1a('0x24')]['ContactId'];return db[_0x6e1a('0x6a')][_0x6e1a('0x3f')](_0x4d1d12,{'type':db[_0x6e1a('0x6b')][_0x6e1a('0x6c')]['SELECT'],'raw':!![]})[_0x6e1a('0x32')](function(_0x4478cd){return _0x4478cd;});})[_0x6e1a('0x32')](function(_0x3b9483){if(_0x3b9483){_0x26880d['message'][_0x6e1a('0x6d')]=_0x3b9483[0x0];if(!_0x5937ae[_0x6e1a('0x57')][_0x6e1a('0x5f')])return;return db['User'][_0x6e1a('0x55')]({'where':{'id':_0x5937ae[_0x6e1a('0x57')]['UserId'],'role':_0x6e1a('0x60')},'attributes':['id',_0x6e1a('0x36'),_0x6e1a('0x6f'),_0x6e1a('0x70'),_0x6e1a('0x71')],'raw':!![]});}return null;})[_0x6e1a('0x32')](function(_0x32b122){if(!_0x32b122)return null;_0x26880d[_0x6e1a('0x24')][_0x6e1a('0x60')]=_0x32b122;return _0x26880d;})['then'](function(_0x263f18){if(_0x263f18){_0x263f18[_0x6e1a('0x24')][_0x6e1a('0x73')]=util['format'](_0x6e1a('0x74'),_0x5937ae[_0x6e1a('0x75')][_0x6e1a('0x36')]);_0x263f18[_0x6e1a('0x24')][_0x6e1a('0x76')]=_0x26880d[_0x6e1a('0x76')];_0x263f18[_0x6e1a('0x24')]['motionChannel']=_0x26880d['channel'];_0x263f18[_0x6e1a('0x24')]['event']='reject';respondWithRpcPromise(_0x6e1a('0x78'),'EventManager',{'event':'rejectmessage','message':_[_0x6e1a('0x4d')](_0x26880d[_0x6e1a('0x24')],JSON[_0x6e1a('0x7a')](_0x26880d[_0x6e1a('0x66')]['formData']))},client9002);return _0x26880d;}return null;})[_0x6e1a('0x32')](respondWithResult(_0x274f5e,null))[_0x6e1a('0x26')](handleError(_0x274f5e,null));}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js index 7d39664..d4a2b6f 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 _0x88d4=['remove','emit','hook','exports','events','../../mysqldb','setMaxListeners','save','update'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0x88d4,0x112));var _0x488d=function(_0x45e3ed,_0x493abf){_0x45e3ed=_0x45e3ed-0x0;var _0x8e0cd9=_0x88d4[_0x45e3ed];return _0x8e0cd9;};'use strict';var EventEmitter=require(_0x488d('0x0'));var ChatMessage=require(_0x488d('0x1'))['db']['ChatMessage'];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x488d('0x2')](0x0);var events={'afterCreate':_0x488d('0x3'),'afterUpdate':_0x488d('0x4'),'afterDestroy':_0x488d('0x5')};function emitEvent(_0x3a09c4){return function(_0x5d4678,_0x22d62c,_0x56c4f0){ChatMessageEvents[_0x488d('0x6')](_0x3a09c4+':'+_0x5d4678['id'],_0x5d4678);ChatMessageEvents[_0x488d('0x6')](_0x3a09c4,_0x5d4678);_0x56c4f0(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatMessage[_0x488d('0x7')](e,emitEvent(event));}}module[_0x488d('0x8')]=ChatMessageEvents; \ No newline at end of file +var _0xae6e=['ChatMessage','setMaxListeners','update','remove','emit','hasOwnProperty','hook','../../mysqldb'];(function(_0x1d94d1,_0x347bb8){var _0x23c397=function(_0x489441){while(--_0x489441){_0x1d94d1['push'](_0x1d94d1['shift']());}};_0x23c397(++_0x347bb8);}(_0xae6e,0x97));var _0xeae6=function(_0x164903,_0x1c5ede){_0x164903=_0x164903-0x0;var _0x141ea3=_0xae6e[_0x164903];return _0x141ea3;};'use strict';var EventEmitter=require('events');var ChatMessage=require(_0xeae6('0x0'))['db'][_0xeae6('0x1')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0xeae6('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xeae6('0x3'),'afterDestroy':_0xeae6('0x4')};function emitEvent(_0x32216d){return function(_0x5771cf,_0x32978c,_0x2a9b34){ChatMessageEvents[_0xeae6('0x5')](_0x32216d+':'+_0x5771cf['id'],_0x5771cf);ChatMessageEvents[_0xeae6('0x5')](_0x32216d,_0x5771cf);_0x2a9b34(null);};}for(var e in events){if(events[_0xeae6('0x6')](e)){var event=events[e];ChatMessage[_0xeae6('0x7')](e,emitEvent(event));}}module['exports']=ChatMessageEvents; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js index 7c53bd4..d320a30 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 _0xa276=['../../config/environment','exports','ChatMessage','get','direction','toLowerCase','out','secret','isNil','ChatInteraction','then','update','catch','error','util','../../config/logger','moment','bluebird','path','rimraf'];(function(_0x17b6e3,_0x4522ed){var _0x3906f3=function(_0x430f87){while(--_0x430f87){_0x17b6e3['push'](_0x17b6e3['shift']());}};_0x3906f3(++_0x4522ed);}(_0xa276,0x9a));var _0x6a27=function(_0x30caee,_0x89f89f){_0x30caee=_0x30caee-0x0;var _0x5a3b21=_0xa276[_0x30caee];return _0x5a3b21;};'use strict';var _=require('lodash');var util=require(_0x6a27('0x0'));var logger=require(_0x6a27('0x1'))('api');var moment=require(_0x6a27('0x2'));var BPromise=require(_0x6a27('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6a27('0x4'));var rimraf=require(_0x6a27('0x5'));var config=require(_0x6a27('0x6'));var attributes=require('./chatMessage.attributes');module[_0x6a27('0x7')]=function(_0x321087,_0x41c595){return _0x321087['define'](_0x6a27('0x8'),attributes,{'tableName':'chat_messages','paranoid':![],'indexes':[{'name':'fti_chat_messages','fields':['body'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x35e206,_0x326066,_0x2860d2){var _0x48bda4=_0x321087['models'];var _0x1a1a32=_0x35e206[_0x6a27('0x9')]({'plain':!![]});if(_0x1a1a32[_0x6a27('0xa')][_0x6a27('0xb')]()==='in'||_0x1a1a32[_0x6a27('0xa')][_0x6a27('0xb')]()===_0x6a27('0xc')&&!_0x1a1a32[_0x6a27('0xd')]&&!_[_0x6a27('0xe')](_0x1a1a32['UserId'])){_0x48bda4[_0x6a27('0xf')]['findOne']({'where':{'id':_0x1a1a32['ChatInteractionId']}})[_0x6a27('0x10')](function(_0x1e987f){if(_0x1e987f){_0x1e987f[_0x6a27('0x11')]({'lastMsgAt':_0x1a1a32['createdAt'],'lastMsgDirection':_0x1a1a32[_0x6a27('0xa')][_0x6a27('0xb')]()});}})[_0x6a27('0x12')](function(_0x8f297b){console[_0x6a27('0x13')](_0x8f297b);});}_0x2860d2();}},'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x9384=['then','update','createdAt','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','ChatMessage','chat_messages','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil','UserId','ChatInteraction','findOne','ChatInteractionId'];(function(_0x1a547e,_0x5917d3){var _0x5ebdaf=function(_0x158b24){while(--_0x158b24){_0x1a547e['push'](_0x1a547e['shift']());}};_0x5ebdaf(++_0x5917d3);}(_0x9384,0xc0));var _0x4938=function(_0x183b97,_0x2d297c){_0x183b97=_0x183b97-0x0;var _0x629cf7=_0x9384[_0x183b97];return _0x629cf7;};'use strict';var _=require(_0x4938('0x0'));var util=require(_0x4938('0x1'));var logger=require(_0x4938('0x2'))(_0x4938('0x3'));var moment=require(_0x4938('0x4'));var BPromise=require(_0x4938('0x5'));var rp=require(_0x4938('0x6'));var fs=require('fs');var path=require(_0x4938('0x7'));var rimraf=require(_0x4938('0x8'));var config=require(_0x4938('0x9'));var attributes=require('./chatMessage.attributes');module[_0x4938('0xa')]=function(_0x55fccc,_0x23df53){return _0x55fccc['define'](_0x4938('0xb'),attributes,{'tableName':_0x4938('0xc'),'paranoid':![],'indexes':[{'name':'fti_chat_messages','fields':['body'],'type':_0x4938('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x3dccaa,_0x2000d6,_0x3574b1){var _0x4dd5fb=_0x55fccc[_0x4938('0xe')];var _0xfa8f35=_0x3dccaa[_0x4938('0xf')]({'plain':!![]});if(_0xfa8f35[_0x4938('0x10')]['toLowerCase']()==='in'||_0xfa8f35['direction'][_0x4938('0x11')]()===_0x4938('0x12')&&!_0xfa8f35[_0x4938('0x13')]&&!_[_0x4938('0x14')](_0xfa8f35[_0x4938('0x15')])){_0x4dd5fb[_0x4938('0x16')][_0x4938('0x17')]({'where':{'id':_0xfa8f35[_0x4938('0x18')]}})[_0x4938('0x19')](function(_0x5c8d2f){if(_0x5c8d2f){_0x5c8d2f[_0x4938('0x1a')]({'lastMsgAt':_0xfa8f35[_0x4938('0x1b')],'lastMsgDirection':_0xfa8f35[_0x4938('0x10')][_0x4938('0x11')]()});}})['catch'](function(_0x433930){console[_0x4938('0x1c')](_0x433930);});}_0x3574b1();}},'charset':_0x4938('0x1d'),'collate':_0x4938('0x1e')});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js index 8eee023..4950524 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 _0xbe4d=['client','http','redis','defaults','socket.io-emitter','./chatMessage.socket','register','then','info','ChatMessage,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','ChatMessage,\x20%s,\x20%s','message','result','catch','ChatMessage','create','body','options','raw','debug','CreateChatMessage','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise'];(function(_0x5628cf,_0x13e29c){var _0x321092=function(_0x3a20ae){while(--_0x3a20ae){_0x5628cf['push'](_0x5628cf['shift']());}};_0x321092(++_0x13e29c);}(_0xbe4d,0xff));var _0xdbe4=function(_0x160b64,_0x8fc303){_0x160b64=_0x160b64-0x0;var _0x42fd8d=_0xbe4d[_0x160b64];return _0x42fd8d;};'use strict';var _=require('lodash');var util=require(_0xdbe4('0x0'));var moment=require(_0xdbe4('0x1'));var BPromise=require(_0xdbe4('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xdbe4('0x3'));var db=require(_0xdbe4('0x4'))['db'];var utils=require(_0xdbe4('0x5'));var logger=require(_0xdbe4('0x6'))('rpc');var config=require(_0xdbe4('0x7'));var jayson=require(_0xdbe4('0x8'));var client=jayson[_0xdbe4('0x9')][_0xdbe4('0xa')]({'port':0x232a});config[_0xdbe4('0xb')]=_[_0xdbe4('0xc')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xdbe4('0xd'))(new Redis(config[_0xdbe4('0xb')]));require(_0xdbe4('0xe'))[_0xdbe4('0xf')](socket);function respondWithRpcPromise(_0x2cff47,_0x3f9029,_0x1078f5){return new BPromise(function(_0x2f0eb1,_0x48c1c6){return client['request'](_0x2cff47,_0x1078f5)[_0xdbe4('0x10')](function(_0x12220b){logger[_0xdbe4('0x11')]('ChatMessage,\x20%s,\x20%s',_0x3f9029,'request\x20sent');logger['debug'](_0xdbe4('0x12'),_0x3f9029,_0xdbe4('0x13'),JSON['stringify'](_0x12220b));if(_0x12220b[_0xdbe4('0x14')]){if(_0x12220b[_0xdbe4('0x14')][_0xdbe4('0x15')]===0x1f4){logger[_0xdbe4('0x14')](_0xdbe4('0x16'),_0x3f9029,_0x12220b[_0xdbe4('0x14')][_0xdbe4('0x17')]);return _0x48c1c6(_0x12220b['error'][_0xdbe4('0x17')]);}logger['error'](_0xdbe4('0x16'),_0x3f9029,_0x12220b[_0xdbe4('0x14')]['message']);return _0x2f0eb1(_0x12220b[_0xdbe4('0x14')][_0xdbe4('0x17')]);}else{logger[_0xdbe4('0x11')](_0xdbe4('0x16'),_0x3f9029,_0xdbe4('0x13'));_0x2f0eb1(_0x12220b[_0xdbe4('0x18')][_0xdbe4('0x17')]);}})[_0xdbe4('0x19')](function(_0xf02cd4){logger[_0xdbe4('0x14')](_0xdbe4('0x16'),_0x3f9029,_0xf02cd4);_0x48c1c6(_0xf02cd4);});});}exports['CreateChatMessage']=function(_0x3d4f76){var _0x4eba22=this;return new Promise(function(_0x44b360,_0x487cdd){return db[_0xdbe4('0x1a')][_0xdbe4('0x1b')](_0x3d4f76[_0xdbe4('0x1c')],{'raw':_0x3d4f76[_0xdbe4('0x1d')]?_0x3d4f76[_0xdbe4('0x1d')][_0xdbe4('0x1e')]===undefined?!![]:![]:!![]})['then'](function(_0x264bf6){logger[_0xdbe4('0x11')]('CreateChatMessage',_0x3d4f76);logger[_0xdbe4('0x1f')](_0xdbe4('0x20'),_0x3d4f76,JSON['stringify'](_0x264bf6));_0x44b360(_0x264bf6);})[_0xdbe4('0x19')](function(_0x48d6cd){logger[_0xdbe4('0x14')](_0xdbe4('0x20'),_0x48d6cd[_0xdbe4('0x17')],_0x3d4f76);_0x487cdd(_0x4eba22['error'](0x1f4,_0x48d6cd[_0xdbe4('0x17')]));});});}; \ No newline at end of file +var _0x516a=['raw','debug','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','register','then','info','ChatMessage,\x20%s,\x20%s','ChatMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','CreateChatMessage','ChatMessage','create','body','options'];(function(_0x166742,_0x55520c){var _0xb7814a=function(_0x18feaf){while(--_0x18feaf){_0x166742['push'](_0x166742['shift']());}};_0xb7814a(++_0x55520c);}(_0x516a,0xe2));var _0xa516=function(_0x2d400d,_0x2b5d80){_0x2d400d=_0x2d400d-0x0;var _0x489bcd=_0x516a[_0x2d400d];return _0x489bcd;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xa516('0x0'));var BPromise=require('bluebird');var rs=require(_0xa516('0x1'));var fs=require('fs');var Redis=require(_0xa516('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xa516('0x3'));var logger=require(_0xa516('0x4'))(_0xa516('0x5'));var config=require('../../config/environment');var jayson=require(_0xa516('0x6'));var client=jayson[_0xa516('0x7')][_0xa516('0x8')]({'port':0x232a});config[_0xa516('0x9')]=_[_0xa516('0xa')](config[_0xa516('0x9')],{'host':_0xa516('0xb'),'port':0x18eb});var socket=require(_0xa516('0xc'))(new Redis(config[_0xa516('0x9')]));require(_0xa516('0xd'))[_0xa516('0xe')](socket);function respondWithRpcPromise(_0x4534fb,_0x3a0d64,_0x5b9aae){return new BPromise(function(_0x1c991e,_0xb63cee){return client['request'](_0x4534fb,_0x5b9aae)[_0xa516('0xf')](function(_0x169f54){logger[_0xa516('0x10')](_0xa516('0x11'),_0x3a0d64,'request\x20sent');logger['debug'](_0xa516('0x12'),_0x3a0d64,_0xa516('0x13'),JSON[_0xa516('0x14')](_0x169f54));if(_0x169f54[_0xa516('0x15')]){if(_0x169f54['error'][_0xa516('0x16')]===0x1f4){logger[_0xa516('0x15')](_0xa516('0x11'),_0x3a0d64,_0x169f54['error'][_0xa516('0x17')]);return _0xb63cee(_0x169f54[_0xa516('0x15')][_0xa516('0x17')]);}logger[_0xa516('0x15')](_0xa516('0x11'),_0x3a0d64,_0x169f54[_0xa516('0x15')][_0xa516('0x17')]);return _0x1c991e(_0x169f54[_0xa516('0x15')]['message']);}else{logger[_0xa516('0x10')](_0xa516('0x11'),_0x3a0d64,_0xa516('0x13'));_0x1c991e(_0x169f54['result']['message']);}})[_0xa516('0x18')](function(_0x245678){logger[_0xa516('0x15')](_0xa516('0x11'),_0x3a0d64,_0x245678);_0xb63cee(_0x245678);});});}exports[_0xa516('0x19')]=function(_0x1710cd){var _0x30807a=this;return new Promise(function(_0x1dd770,_0x4444c2){return db[_0xa516('0x1a')][_0xa516('0x1b')](_0x1710cd[_0xa516('0x1c')],{'raw':_0x1710cd[_0xa516('0x1d')]?_0x1710cd[_0xa516('0x1d')][_0xa516('0x1e')]===undefined?!![]:![]:!![]})[_0xa516('0xf')](function(_0x2bfc34){logger[_0xa516('0x10')](_0xa516('0x19'),_0x1710cd);logger[_0xa516('0x1f')](_0xa516('0x19'),_0x1710cd,JSON['stringify'](_0x2bfc34));_0x1dd770(_0x2bfc34);})[_0xa516('0x18')](function(_0x418e63){logger[_0xa516('0x15')]('CreateChatMessage',_0x418e63[_0xa516('0x17')],_0x1710cd);_0x4444c2(_0x30807a[_0xa516('0x15')](0x1f4,_0x418e63[_0xa516('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js index 67e5923..b4e7489 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 _0xf69d=['removeListener','register','length','chatMessage:','./chatMessage.events','save','remove','update','emit'];(function(_0x3d5351,_0x27bc80){var _0x1db4db=function(_0x3f572b){while(--_0x3f572b){_0x3d5351['push'](_0x3d5351['shift']());}};_0x1db4db(++_0x27bc80);}(_0xf69d,0xd3));var _0xdf69=function(_0x58c60c,_0x35d83e){_0x58c60c=_0x58c60c-0x0;var _0x3da3f6=_0xf69d[_0x58c60c];return _0x3da3f6;};'use strict';var ChatMessageEvents=require(_0xdf69('0x0'));var events=[_0xdf69('0x1'),_0xdf69('0x2'),_0xdf69('0x3')];function createListener(_0xf89475,_0x4e4bdd){return function(_0x3013e5){_0x4e4bdd[_0xdf69('0x4')](_0xf89475,_0x3013e5);};}function removeListener(_0x5b5eec,_0x13ecb6){return function(){ChatMessageEvents[_0xdf69('0x5')](_0x5b5eec,_0x13ecb6);};}exports[_0xdf69('0x6')]=function(_0x2d456f){for(var _0x465b1b=0x0,_0x1d2501=events[_0xdf69('0x7')];_0x465b1b<_0x1d2501;_0x465b1b++){var _0x18a08e=events[_0x465b1b];var _0xc1b77e=createListener(_0xdf69('0x8')+_0x18a08e,_0x2d456f);ChatMessageEvents['on'](_0x18a08e,_0xc1b77e);}}; \ No newline at end of file +var _0x19da=['update','register','length','save'];(function(_0x5de483,_0x44b8b5){var _0x1154e3=function(_0x216c2d){while(--_0x216c2d){_0x5de483['push'](_0x5de483['shift']());}};_0x1154e3(++_0x44b8b5);}(_0x19da,0x9f));var _0xa19d=function(_0x50d84b,_0x1d7ea7){_0x50d84b=_0x50d84b-0x0;var _0x6d4270=_0x19da[_0x50d84b];return _0x6d4270;};'use strict';var ChatMessageEvents=require('./chatMessage.events');var events=[_0xa19d('0x0'),'remove',_0xa19d('0x1')];function createListener(_0x5ba569,_0x3a48f4){return function(_0x17f1c6){_0x3a48f4['emit'](_0x5ba569,_0x17f1c6);};}function removeListener(_0x179db7,_0x28ec9a){return function(){ChatMessageEvents['removeListener'](_0x179db7,_0x28ec9a);};}exports[_0xa19d('0x2')]=function(_0x330adb){for(var _0x1f6e10=0x0,_0x14dc68=events[_0xa19d('0x3')];_0x1f6e10<_0x14dc68;_0x1f6e10++){var _0x4b4627=events[_0x1f6e10];var _0x197c4e=createListener('chatMessage:'+_0x4b4627,_0x330adb);ChatMessageEvents['on'](_0x4b4627,_0x197c4e);}}; \ No newline at end of file diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js index 6882347..5ee6ec3 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 _0xf6c2=['destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','tracked','chat','create','put','/:id/accept','/:id/reject','delete'];(function(_0x2aba2a,_0x45115d){var _0x51fb60=function(_0x3dae16){while(--_0x3dae16){_0x2aba2a['push'](_0x2aba2a['shift']());}};_0x51fb60(++_0x45115d);}(_0xf6c2,0x1f0));var _0x2f6c=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0xf6c2[_0x21a9d9];return _0x46adce;};'use strict';var multer=require('multer');var util=require(_0x2f6c('0x0'));var path=require(_0x2f6c('0x1'));var timeout=require(_0x2f6c('0x2'));var express=require(_0x2f6c('0x3'));var router=express[_0x2f6c('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x2f6c('0x5'));var interaction=require(_0x2f6c('0x6'));var config=require(_0x2f6c('0x7'));var controller=require(_0x2f6c('0x8'));router[_0x2f6c('0x9')]('/',auth[_0x2f6c('0xa')](),controller[_0x2f6c('0xb')]);router[_0x2f6c('0x9')](_0x2f6c('0xc'),auth[_0x2f6c('0xa')](),controller[_0x2f6c('0xd')]);router[_0x2f6c('0x9')](_0x2f6c('0xe'),auth['isAuthenticated'](),controller[_0x2f6c('0xf')]);router[_0x2f6c('0x10')]('/',auth['isAuthenticated'](),interaction[_0x2f6c('0x11')](_0x2f6c('0x12'),'chatmessage:create'),controller[_0x2f6c('0x13')]);router[_0x2f6c('0x14')]('/:id',controller['update']);router[_0x2f6c('0x14')](_0x2f6c('0x15'),auth[_0x2f6c('0xa')](),controller['accept']);router[_0x2f6c('0x14')](_0x2f6c('0x16'),auth[_0x2f6c('0xa')](),controller['reject']);router[_0x2f6c('0x17')](_0x2f6c('0xe'),auth[_0x2f6c('0xa')](),controller[_0x2f6c('0x18')]);module[_0x2f6c('0x19')]=router; \ No newline at end of file +var _0x2c3e=['/describe','isAuthenticated','/:id','show','post','tracked','chat','create','put','update','/:id/accept','/:id/reject','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../config/environment','./chatMessage.controller','get','index'];(function(_0x115406,_0x8217d5){var _0x45c035=function(_0x352611){while(--_0x352611){_0x115406['push'](_0x115406['shift']());}};_0x45c035(++_0x8217d5);}(_0x2c3e,0x154));var _0xe2c3=function(_0x21ca24,_0x460062){_0x21ca24=_0x21ca24-0x0;var _0x149268=_0x2c3e[_0x21ca24];return _0x149268;};'use strict';var multer=require(_0xe2c3('0x0'));var util=require(_0xe2c3('0x1'));var path=require(_0xe2c3('0x2'));var timeout=require('connect-timeout');var express=require(_0xe2c3('0x3'));var router=express[_0xe2c3('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xe2c3('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xe2c3('0x6'));var controller=require(_0xe2c3('0x7'));router[_0xe2c3('0x8')]('/',auth['isAuthenticated'](),controller[_0xe2c3('0x9')]);router[_0xe2c3('0x8')](_0xe2c3('0xa'),auth[_0xe2c3('0xb')](),controller['describe']);router['get'](_0xe2c3('0xc'),auth[_0xe2c3('0xb')](),controller[_0xe2c3('0xd')]);router[_0xe2c3('0xe')]('/',auth['isAuthenticated'](),interaction[_0xe2c3('0xf')](_0xe2c3('0x10'),'chatmessage:create'),controller[_0xe2c3('0x11')]);router[_0xe2c3('0x12')](_0xe2c3('0xc'),controller[_0xe2c3('0x13')]);router[_0xe2c3('0x12')](_0xe2c3('0x14'),auth[_0xe2c3('0xb')](),controller['accept']);router['put'](_0xe2c3('0x15'),auth[_0xe2c3('0xb')](),controller['reject']);router[_0xe2c3('0x16')](_0xe2c3('0xc'),auth['isAuthenticated'](),controller[_0xe2c3('0x17')]);module[_0xe2c3('0x18')]=router; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js index 2c32aab..4fbb1c1 100644 --- a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js +++ b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0b0e=['medium','sequelize','TEXT'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x0b0e,0x187));var _0xe0b0=function(_0x104a84,_0x285970){_0x104a84=_0x104a84-0x0;var _0x4973ff=_0x0b0e[_0x104a84];return _0x4973ff;};'use strict';var Sequelize=require(_0xe0b0('0x0'));module['exports']={'body':{'type':Sequelize[_0xe0b0('0x1')]('medium'),'allowNull':![]},'plainBody':{'type':Sequelize[_0xe0b0('0x1')](_0xe0b0('0x2')),'allowNull':![]}}; \ No newline at end of file +var _0x0b0e=['medium','sequelize','TEXT'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0x0b0e,0x187));var _0xe0b0=function(_0x7e3bb8,_0x27c048){_0x7e3bb8=_0x7e3bb8-0x0;var _0x44c887=_0x0b0e[_0x7e3bb8];return _0x44c887;};'use strict';var Sequelize=require(_0xe0b0('0x0'));module['exports']={'body':{'type':Sequelize[_0xe0b0('0x1')]('medium'),'allowNull':![]},'plainBody':{'type':Sequelize[_0xe0b0('0x1')](_0xe0b0('0x2')),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js index 535b3d8..e1ac26a 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(_0x2ec461,_0x5f588a){var _0x28603d=function(_0x21114b){while(--_0x21114b){_0x2ec461['push'](_0x2ec461['shift']());}};_0x28603d(++_0x5f588a);}(_0x7a54,0x106));var _0x47a5=function(_0x51a914,_0x5c0036){_0x51a914=_0x51a914-0x0;var _0x4d9781=_0x7a54[_0x51a914];return _0x4d9781;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x29')]=function(_0x136b14,_0x16631f){var _0x361bfa={},_0x1127f8={},_0x11a4fa={'count':0x0,'rows':[]};var _0x3ad507=_['map'](db[_0x47a5('0x2a')]['rawAttributes'],function(_0x2ef875){return{'name':_0x2ef875[_0x47a5('0x2b')],'type':_0x2ef875[_0x47a5('0x2c')]['key']};});_0x1127f8[_0x47a5('0x2d')]=_[_0x47a5('0x2e')](_0x3ad507,_0x47a5('0x27'));_0x1127f8[_0x47a5('0x2f')]=_['keys'](_0x136b14['query']);_0x1127f8[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x1127f8['model'],_0x1127f8['query']);_0x361bfa[_0x47a5('0x32')]=_[_0x47a5('0x31')](_0x1127f8['model'],qs[_0x47a5('0x33')](_0x136b14['query'][_0x47a5('0x33')]));_0x361bfa[_0x47a5('0x32')]=_0x361bfa['attributes']['length']?_0x361bfa[_0x47a5('0x32')]:_0x1127f8['model'];if(!_0x136b14[_0x47a5('0x2f')][_0x47a5('0x34')](_0x47a5('0x35'))){_0x361bfa['limit']=qs[_0x47a5('0x1d')](_0x136b14['query']['limit']);_0x361bfa[_0x47a5('0x1a')]=qs['offset'](_0x136b14[_0x47a5('0x2f')]['offset']);}_0x361bfa[_0x47a5('0x36')]=qs[_0x47a5('0x37')](_0x136b14[_0x47a5('0x2f')][_0x47a5('0x37')]);_0x361bfa[_0x47a5('0x38')]=qs[_0x47a5('0x30')](_[_0x47a5('0x39')](_0x136b14[_0x47a5('0x2f')],_0x1127f8[_0x47a5('0x30')]),_0x3ad507);if(_0x136b14['query'][_0x47a5('0x3a')]){_0x361bfa[_0x47a5('0x38')]=_['merge'](_0x361bfa[_0x47a5('0x38')],{'$or':_[_0x47a5('0x2e')](_0x3ad507,function(_0x1d4348){if(_0x1d4348['type']!==_0x47a5('0x3b')){var _0x10f660={};_0x10f660[_0x1d4348['name']]={'$like':'%'+_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3a')]+'%'};return _0x10f660;}})});}_0x361bfa=_['merge']({},_0x361bfa,_0x136b14['options']);var _0x5ebd8c={'where':_0x361bfa[_0x47a5('0x38')]};return db['ChatOfflineMessage'][_0x47a5('0x1c')](_0x5ebd8c)[_0x47a5('0x23')](function(_0x301a85){_0x11a4fa[_0x47a5('0x1c')]=_0x301a85;if(_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x361bfa[_0x47a5('0x3d')]=[{'all':!![]}];}return db[_0x47a5('0x2a')][_0x47a5('0x3e')](_0x361bfa);})[_0x47a5('0x23')](function(_0x280500){_0x11a4fa[_0x47a5('0x3f')]=_0x280500;return _0x11a4fa;})[_0x47a5('0x23')](respondWithFilteredResult(_0x16631f,_0x361bfa))['catch'](handleError(_0x16631f,null));};exports[_0x47a5('0x40')]=function(_0x1c36fa,_0x331474){var _0x23bd8d={'raw':!![],'where':{'id':_0x1c36fa[_0x47a5('0x41')]['id']}},_0x586f4f={};_0x586f4f['model']=_['keys'](db['ChatOfflineMessage']['rawAttributes']);_0x586f4f[_0x47a5('0x2f')]=_['keys'](_0x1c36fa[_0x47a5('0x2f')]);_0x586f4f[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x586f4f['model'],_0x586f4f[_0x47a5('0x2f')]);_0x23bd8d[_0x47a5('0x32')]=_['intersection'](_0x586f4f['model'],qs[_0x47a5('0x33')](_0x1c36fa['query'][_0x47a5('0x33')]));_0x23bd8d[_0x47a5('0x32')]=_0x23bd8d[_0x47a5('0x32')][_0x47a5('0x42')]?_0x23bd8d[_0x47a5('0x32')]:_0x586f4f[_0x47a5('0x2d')];if(_0x1c36fa[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x23bd8d[_0x47a5('0x3d')]=[{'all':!![]}];}_0x23bd8d=_[_0x47a5('0x43')]({},_0x23bd8d,_0x1c36fa[_0x47a5('0x44')]);return db[_0x47a5('0x2a')][_0x47a5('0x45')](_0x23bd8d)[_0x47a5('0x23')](handleEntityNotFound(_0x331474,null))[_0x47a5('0x23')](respondWithResult(_0x331474,null))[_0x47a5('0x46')](handleError(_0x331474,null));};exports['create']=function(_0x2d38de,_0x23bb04){return db['ChatOfflineMessage']['create'](_0x2d38de[_0x47a5('0x47')],{})['then'](respondWithResult(_0x23bb04,0xc9))[_0x47a5('0x46')](handleError(_0x23bb04,null));};exports[_0x47a5('0x22')]=function(_0x54c35f,_0x4f62d3){if(_0x54c35f[_0x47a5('0x47')]['id']){delete _0x54c35f['body']['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x54c35f[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x4f62d3,null))[_0x47a5('0x23')](saveUpdates(_0x54c35f[_0x47a5('0x47')],null))[_0x47a5('0x23')](respondWithResult(_0x4f62d3,null))['catch'](handleError(_0x4f62d3,null));};exports['destroy']=function(_0x2dd1db,_0x411230){return db[_0x47a5('0x48')][_0x47a5('0x3e')]({'where':{'ChatOfflineMessageId':_0x2dd1db[_0x47a5('0x41')]['id']},'raw':!![]})[_0x47a5('0x23')](function(_0x249de5){_0x249de5['forEach'](function(_0x45cca5){var _0x1c9a62=path[_0x47a5('0x49')](config['root'],_0x47a5('0x4a'),'files',_0x47a5('0x4b'),_0x47a5('0x4c'),_0x45cca5[_0x47a5('0x4d')]);var _0xf03bd5=fs['existsSync'](_0x1c9a62);if(_0xf03bd5)fs_extra[_0x47a5('0x4e')](_0x1c9a62);});})[_0x47a5('0x23')](function(){return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']},'individualHooks':!![]});})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));};exports[_0x47a5('0x4f')]=function(_0x43721b,_0x187d7e){return db[_0x47a5('0x2a')][_0x47a5('0x4f')]()[_0x47a5('0x23')](respondWithResult(_0x187d7e,null))['catch'](handleError(_0x187d7e,null));}; \ No newline at end of file +var _0x7a54=['filter','VIRTUAL','includeAll','include','findAll','rows','show','params','length','merge','options','find','catch','body','Attachment','join','server','attachments','offline-chat','basename','remove','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','ChatOfflineMessage','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x12d033,_0x25fa2f){var _0x3b4e80=function(_0x46c1f4){while(--_0x46c1f4){_0x12d033['push'](_0x12d033['shift']());}};_0x3b4e80(++_0x25fa2f);}(_0x7a54,0x106));var _0x47a5=function(_0x20dbef,_0x34cee7){_0x20dbef=_0x20dbef-0x0;var _0x5a93af=_0x7a54[_0x20dbef];return _0x5a93af;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x29')]=function(_0x136b14,_0x16631f){var _0x361bfa={},_0x1127f8={},_0x11a4fa={'count':0x0,'rows':[]};var _0x3ad507=_['map'](db[_0x47a5('0x2a')]['rawAttributes'],function(_0x2ef875){return{'name':_0x2ef875[_0x47a5('0x2b')],'type':_0x2ef875[_0x47a5('0x2c')]['key']};});_0x1127f8[_0x47a5('0x2d')]=_[_0x47a5('0x2e')](_0x3ad507,_0x47a5('0x27'));_0x1127f8[_0x47a5('0x2f')]=_['keys'](_0x136b14['query']);_0x1127f8[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x1127f8['model'],_0x1127f8['query']);_0x361bfa[_0x47a5('0x32')]=_[_0x47a5('0x31')](_0x1127f8['model'],qs[_0x47a5('0x33')](_0x136b14['query'][_0x47a5('0x33')]));_0x361bfa[_0x47a5('0x32')]=_0x361bfa['attributes']['length']?_0x361bfa[_0x47a5('0x32')]:_0x1127f8['model'];if(!_0x136b14[_0x47a5('0x2f')][_0x47a5('0x34')](_0x47a5('0x35'))){_0x361bfa['limit']=qs[_0x47a5('0x1d')](_0x136b14['query']['limit']);_0x361bfa[_0x47a5('0x1a')]=qs['offset'](_0x136b14[_0x47a5('0x2f')]['offset']);}_0x361bfa[_0x47a5('0x36')]=qs[_0x47a5('0x37')](_0x136b14[_0x47a5('0x2f')][_0x47a5('0x37')]);_0x361bfa[_0x47a5('0x38')]=qs[_0x47a5('0x30')](_[_0x47a5('0x39')](_0x136b14[_0x47a5('0x2f')],_0x1127f8[_0x47a5('0x30')]),_0x3ad507);if(_0x136b14['query'][_0x47a5('0x3a')]){_0x361bfa[_0x47a5('0x38')]=_['merge'](_0x361bfa[_0x47a5('0x38')],{'$or':_[_0x47a5('0x2e')](_0x3ad507,function(_0x1d4348){if(_0x1d4348['type']!==_0x47a5('0x3b')){var _0x10f660={};_0x10f660[_0x1d4348['name']]={'$like':'%'+_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3a')]+'%'};return _0x10f660;}})});}_0x361bfa=_['merge']({},_0x361bfa,_0x136b14['options']);var _0x5ebd8c={'where':_0x361bfa[_0x47a5('0x38')]};return db['ChatOfflineMessage'][_0x47a5('0x1c')](_0x5ebd8c)[_0x47a5('0x23')](function(_0x301a85){_0x11a4fa[_0x47a5('0x1c')]=_0x301a85;if(_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x361bfa[_0x47a5('0x3d')]=[{'all':!![]}];}return db[_0x47a5('0x2a')][_0x47a5('0x3e')](_0x361bfa);})[_0x47a5('0x23')](function(_0x280500){_0x11a4fa[_0x47a5('0x3f')]=_0x280500;return _0x11a4fa;})[_0x47a5('0x23')](respondWithFilteredResult(_0x16631f,_0x361bfa))['catch'](handleError(_0x16631f,null));};exports[_0x47a5('0x40')]=function(_0x1c36fa,_0x331474){var _0x23bd8d={'raw':!![],'where':{'id':_0x1c36fa[_0x47a5('0x41')]['id']}},_0x586f4f={};_0x586f4f['model']=_['keys'](db['ChatOfflineMessage']['rawAttributes']);_0x586f4f[_0x47a5('0x2f')]=_['keys'](_0x1c36fa[_0x47a5('0x2f')]);_0x586f4f[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x586f4f['model'],_0x586f4f[_0x47a5('0x2f')]);_0x23bd8d[_0x47a5('0x32')]=_['intersection'](_0x586f4f['model'],qs[_0x47a5('0x33')](_0x1c36fa['query'][_0x47a5('0x33')]));_0x23bd8d[_0x47a5('0x32')]=_0x23bd8d[_0x47a5('0x32')][_0x47a5('0x42')]?_0x23bd8d[_0x47a5('0x32')]:_0x586f4f[_0x47a5('0x2d')];if(_0x1c36fa[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x23bd8d[_0x47a5('0x3d')]=[{'all':!![]}];}_0x23bd8d=_[_0x47a5('0x43')]({},_0x23bd8d,_0x1c36fa[_0x47a5('0x44')]);return db[_0x47a5('0x2a')][_0x47a5('0x45')](_0x23bd8d)[_0x47a5('0x23')](handleEntityNotFound(_0x331474,null))[_0x47a5('0x23')](respondWithResult(_0x331474,null))[_0x47a5('0x46')](handleError(_0x331474,null));};exports['create']=function(_0x2d38de,_0x23bb04){return db['ChatOfflineMessage']['create'](_0x2d38de[_0x47a5('0x47')],{})['then'](respondWithResult(_0x23bb04,0xc9))[_0x47a5('0x46')](handleError(_0x23bb04,null));};exports[_0x47a5('0x22')]=function(_0x54c35f,_0x4f62d3){if(_0x54c35f[_0x47a5('0x47')]['id']){delete _0x54c35f['body']['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x54c35f[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x4f62d3,null))[_0x47a5('0x23')](saveUpdates(_0x54c35f[_0x47a5('0x47')],null))[_0x47a5('0x23')](respondWithResult(_0x4f62d3,null))['catch'](handleError(_0x4f62d3,null));};exports['destroy']=function(_0x2dd1db,_0x411230){return db[_0x47a5('0x48')][_0x47a5('0x3e')]({'where':{'ChatOfflineMessageId':_0x2dd1db[_0x47a5('0x41')]['id']},'raw':!![]})[_0x47a5('0x23')](function(_0x249de5){_0x249de5['forEach'](function(_0x45cca5){var _0x1c9a62=path[_0x47a5('0x49')](config['root'],_0x47a5('0x4a'),'files',_0x47a5('0x4b'),_0x47a5('0x4c'),_0x45cca5[_0x47a5('0x4d')]);var _0xf03bd5=fs['existsSync'](_0x1c9a62);if(_0xf03bd5)fs_extra[_0x47a5('0x4e')](_0x1c9a62);});})[_0x47a5('0x23')](function(){return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']},'individualHooks':!![]});})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));};exports[_0x47a5('0x4f')]=function(_0x43721b,_0x187d7e){return db[_0x47a5('0x2a')][_0x47a5('0x4f')]()[_0x47a5('0x23')](respondWithResult(_0x187d7e,null))['catch'](handleError(_0x187d7e,null));}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.events.js b/server/api/chatOfflineMessage/chatOfflineMessage.events.js index c5375cd..214e2c6 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 _0x25e4=['setMaxListeners','update','remove','hasOwnProperty','hook','events','../../mysqldb','ChatOfflineMessage'];(function(_0x5084e6,_0x2f5d1d){var _0x37b5b9=function(_0x458763){while(--_0x458763){_0x5084e6['push'](_0x5084e6['shift']());}};_0x37b5b9(++_0x2f5d1d);}(_0x25e4,0x1cd));var _0x425e=function(_0x3e43ac,_0x20a016){_0x3e43ac=_0x3e43ac-0x0;var _0x40269f=_0x25e4[_0x3e43ac];return _0x40269f;};'use strict';var EventEmitter=require(_0x425e('0x0'));var ChatOfflineMessage=require(_0x425e('0x1'))['db'][_0x425e('0x2')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0x425e('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x425e('0x4'),'afterDestroy':_0x425e('0x5')};function emitEvent(_0xa39f3a){return function(_0xbe816f,_0x4962d9,_0x3288a4){ChatOfflineMessageEvents['emit'](_0xa39f3a+':'+_0xbe816f['id'],_0xbe816f);ChatOfflineMessageEvents['emit'](_0xa39f3a,_0xbe816f);_0x3288a4(null);};}for(var e in events){if(events[_0x425e('0x6')](e)){var event=events[e];ChatOfflineMessage[_0x425e('0x7')](e,emitEvent(event));}}module['exports']=ChatOfflineMessageEvents; \ No newline at end of file +var _0xd641=['hook','events','../../mysqldb','ChatOfflineMessage','setMaxListeners','update','remove','emit','hasOwnProperty'];(function(_0x101927,_0x5659ff){var _0xdcd9ec=function(_0x246095){while(--_0x246095){_0x101927['push'](_0x101927['shift']());}};_0xdcd9ec(++_0x5659ff);}(_0xd641,0xd9));var _0x1d64=function(_0x358184,_0x31945d){_0x358184=_0x358184-0x0;var _0x6293ba=_0xd641[_0x358184];return _0x6293ba;};'use strict';var EventEmitter=require(_0x1d64('0x0'));var ChatOfflineMessage=require(_0x1d64('0x1'))['db'][_0x1d64('0x2')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0x1d64('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x1d64('0x4'),'afterDestroy':_0x1d64('0x5')};function emitEvent(_0x5c7968){return function(_0x1e53a6,_0x2948f2,_0xe7a7d7){ChatOfflineMessageEvents[_0x1d64('0x6')](_0x5c7968+':'+_0x1e53a6['id'],_0x1e53a6);ChatOfflineMessageEvents[_0x1d64('0x6')](_0x5c7968,_0x1e53a6);_0xe7a7d7(null);};}for(var e in events){if(events[_0x1d64('0x7')](e)){var event=events[e];ChatOfflineMessage[_0x1d64('0x8')](e,emitEvent(event));}}module['exports']=ChatOfflineMessageEvents; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js index 2ba6a16..d007966 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 _0x0fac=['./chatOfflineMessage.attributes','exports','define','ChatOfflineMessage','chat_offline_messages','utf8mb4_unicode_ci'];(function(_0x2be3b1,_0x58685a){var _0x54dc5b=function(_0x56e6f2){while(--_0x56e6f2){_0x2be3b1['push'](_0x2be3b1['shift']());}};_0x54dc5b(++_0x58685a);}(_0x0fac,0x96));var _0xc0fa=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x0fac[_0x3947c9];return _0x2e7871;};'use strict';var attributes=require(_0xc0fa('0x0'));module[_0xc0fa('0x1')]=function(_0x354e47){return _0x354e47[_0xc0fa('0x2')](_0xc0fa('0x3'),attributes,{'tableName':_0xc0fa('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xc0fa('0x5')});}; \ No newline at end of file +var _0x7e28=['chat_offline_messages','utf8mb4','utf8mb4_unicode_ci','./chatOfflineMessage.attributes','ChatOfflineMessage'];(function(_0x38682a,_0x19ba95){var _0x9fe6bd=function(_0x5cc8fa){while(--_0x5cc8fa){_0x38682a['push'](_0x38682a['shift']());}};_0x9fe6bd(++_0x19ba95);}(_0x7e28,0xc6));var _0x87e2=function(_0x591ddb,_0x3bb77c){_0x591ddb=_0x591ddb-0x0;var _0x144091=_0x7e28[_0x591ddb];return _0x144091;};'use strict';var attributes=require(_0x87e2('0x0'));module['exports']=function(_0x47fca5){return _0x47fca5['define'](_0x87e2('0x1'),attributes,{'tableName':_0x87e2('0x2'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x87e2('0x3'),'collate':_0x87e2('0x4')});}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js index eac5e51..2cc0fd5 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 _0xcbcc=['info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','http','request','then'];(function(_0x3b5250,_0x7a0b2c){var _0xc844a1=function(_0x2fbc98){while(--_0x2fbc98){_0x3b5250['push'](_0x3b5250['shift']());}};_0xc844a1(++_0x7a0b2c);}(_0xcbcc,0x198));var _0xccbc=function(_0x5f309e,_0x66e31){_0x5f309e=_0x5f309e-0x0;var _0x487b5e=_0xcbcc[_0x5f309e];return _0x487b5e;};'use strict';var _=require(_0xccbc('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xccbc('0x1'));var rs=require(_0xccbc('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xccbc('0x3'))['db'];var utils=require(_0xccbc('0x4'));var logger=require(_0xccbc('0x5'))(_0xccbc('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xccbc('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x45e4aa,_0x422504,_0xb91427){return new BPromise(function(_0x4b27a5,_0x19cb6e){return client[_0xccbc('0x8')](_0x45e4aa,_0xb91427)[_0xccbc('0x9')](function(_0x48055b){logger[_0xccbc('0xa')](_0xccbc('0xb'),_0x422504,_0xccbc('0xc'));logger['debug'](_0xccbc('0xd'),_0x422504,_0xccbc('0xc'),JSON[_0xccbc('0xe')](_0x48055b));if(_0x48055b[_0xccbc('0xf')]){if(_0x48055b[_0xccbc('0xf')][_0xccbc('0x10')]===0x1f4){logger[_0xccbc('0xf')]('ChatOfflineMessage,\x20%s,\x20%s',_0x422504,_0x48055b['error'][_0xccbc('0x11')]);return _0x19cb6e(_0x48055b['error'][_0xccbc('0x11')]);}logger[_0xccbc('0xf')](_0xccbc('0xb'),_0x422504,_0x48055b['error'][_0xccbc('0x11')]);return _0x4b27a5(_0x48055b['error'][_0xccbc('0x11')]);}else{logger[_0xccbc('0xa')](_0xccbc('0xb'),_0x422504,_0xccbc('0xc'));_0x4b27a5(_0x48055b[_0xccbc('0x12')][_0xccbc('0x11')]);}})['catch'](function(_0x4e398d){logger[_0xccbc('0xf')](_0xccbc('0xb'),_0x422504,_0x4e398d);_0x19cb6e(_0x4e398d);});});} \ No newline at end of file +var _0xf078=['request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatOfflineMessage,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x30182f,_0x30ce41){var _0x5207db=function(_0x50a417){while(--_0x50a417){_0x30182f['push'](_0x30182f['shift']());}};_0x5207db(++_0x30ce41);}(_0xf078,0xda));var _0x8f07=function(_0x1fd17a,_0x3e7606){_0x1fd17a=_0x1fd17a-0x0;var _0x572bd5=_0xf078[_0x1fd17a];return _0x572bd5;};'use strict';var _=require(_0x8f07('0x0'));var util=require('util');var moment=require(_0x8f07('0x1'));var BPromise=require(_0x8f07('0x2'));var rs=require(_0x8f07('0x3'));var fs=require('fs');var Redis=require(_0x8f07('0x4'));var db=require(_0x8f07('0x5'))['db'];var utils=require(_0x8f07('0x6'));var logger=require(_0x8f07('0x7'))(_0x8f07('0x8'));var config=require(_0x8f07('0x9'));var jayson=require(_0x8f07('0xa'));var client=jayson[_0x8f07('0xb')][_0x8f07('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x322237,_0x484cc4,_0x2e367f){return new BPromise(function(_0x54d72f,_0x5835d3){return client[_0x8f07('0xd')](_0x322237,_0x2e367f)[_0x8f07('0xe')](function(_0x62c740){logger[_0x8f07('0xf')]('ChatOfflineMessage,\x20%s,\x20%s',_0x484cc4,_0x8f07('0x10'));logger[_0x8f07('0x11')](_0x8f07('0x12'),_0x484cc4,_0x8f07('0x10'),JSON[_0x8f07('0x13')](_0x62c740));if(_0x62c740[_0x8f07('0x14')]){if(_0x62c740[_0x8f07('0x14')][_0x8f07('0x15')]===0x1f4){logger[_0x8f07('0x14')](_0x8f07('0x16'),_0x484cc4,_0x62c740[_0x8f07('0x14')][_0x8f07('0x17')]);return _0x5835d3(_0x62c740['error']['message']);}logger['error'](_0x8f07('0x16'),_0x484cc4,_0x62c740[_0x8f07('0x14')][_0x8f07('0x17')]);return _0x54d72f(_0x62c740['error'][_0x8f07('0x17')]);}else{logger[_0x8f07('0xf')](_0x8f07('0x16'),_0x484cc4,'request\x20sent');_0x54d72f(_0x62c740[_0x8f07('0x18')][_0x8f07('0x17')]);}})[_0x8f07('0x19')](function(_0x145dc8){logger['error']('ChatOfflineMessage,\x20%s,\x20%s',_0x484cc4,_0x145dc8);_0x5835d3(_0x145dc8);});});} \ No newline at end of file diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js index f69371a..c5279db 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 _0x3b24=['post','create','update','delete','multer','util','express','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','get','isAuthenticated','/describe','describe','/:id','show'];(function(_0x569e3f,_0x1ffb08){var _0x45c82b=function(_0x50cc6c){while(--_0x50cc6c){_0x569e3f['push'](_0x569e3f['shift']());}};_0x45c82b(++_0x1ffb08);}(_0x3b24,0x1c4));var _0x43b2=function(_0x104756,_0x2af675){_0x104756=_0x104756-0x0;var _0x5bbc61=_0x3b24[_0x104756];return _0x5bbc61;};'use strict';var multer=require(_0x43b2('0x0'));var util=require(_0x43b2('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x43b2('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x43b2('0x3'));var config=require(_0x43b2('0x4'));var controller=require(_0x43b2('0x5'));router[_0x43b2('0x6')]('/',auth[_0x43b2('0x7')](),controller['index']);router[_0x43b2('0x6')](_0x43b2('0x8'),auth['isAuthenticated'](),controller[_0x43b2('0x9')]);router[_0x43b2('0x6')](_0x43b2('0xa'),auth[_0x43b2('0x7')](),controller[_0x43b2('0xb')]);router[_0x43b2('0xc')]('/',auth[_0x43b2('0x7')](),controller[_0x43b2('0xd')]);router['put'](_0x43b2('0xa'),auth[_0x43b2('0x7')](),controller[_0x43b2('0xe')]);router[_0x43b2('0xf')](_0x43b2('0xa'),auth[_0x43b2('0x7')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xe7b2=['fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','/describe','describe','/:id','show','create','update','delete','destroy','multer','util','path','express','Router'];(function(_0x1e24f8,_0x52070f){var _0x5c4446=function(_0x40bf51){while(--_0x40bf51){_0x1e24f8['push'](_0x1e24f8['shift']());}};_0x5c4446(++_0x52070f);}(_0xe7b2,0x109));var _0x2e7b=function(_0x36f77c,_0x3b491a){_0x36f77c=_0x36f77c-0x0;var _0x1f47c4=_0xe7b2[_0x36f77c];return _0x1f47c4;};'use strict';var multer=require(_0x2e7b('0x0'));var util=require(_0x2e7b('0x1'));var path=require(_0x2e7b('0x2'));var timeout=require('connect-timeout');var express=require(_0x2e7b('0x3'));var router=express[_0x2e7b('0x4')]();var fs_extra=require(_0x2e7b('0x5'));var auth=require(_0x2e7b('0x6'));var interaction=require(_0x2e7b('0x7'));var config=require('../../config/environment');var controller=require('./chatOfflineMessage.controller');router[_0x2e7b('0x8')]('/',auth[_0x2e7b('0x9')](),controller['index']);router[_0x2e7b('0x8')](_0x2e7b('0xa'),auth['isAuthenticated'](),controller[_0x2e7b('0xb')]);router['get'](_0x2e7b('0xc'),auth['isAuthenticated'](),controller[_0x2e7b('0xd')]);router['post']('/',auth[_0x2e7b('0x9')](),controller[_0x2e7b('0xe')]);router['put'](_0x2e7b('0xc'),auth[_0x2e7b('0x9')](),controller[_0x2e7b('0xf')]);router[_0x2e7b('0x10')](_0x2e7b('0xc'),auth[_0x2e7b('0x9')](),controller[_0x2e7b('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js index 9f0cc22..52be965 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 _0xee41=['timeout','INTEGER','sequelize','mouseOver'];(function(_0xfdbc0,_0x3d360d){var _0x2e8d80=function(_0x3c5753){while(--_0x3c5753){_0xfdbc0['push'](_0xfdbc0['shift']());}};_0x2e8d80(++_0x3d360d);}(_0xee41,0x1e6));var _0x1ee4=function(_0x4b64a4,_0x1bdc50){_0x4b64a4=_0x4b64a4-0x0;var _0xd19b0e=_0xee41[_0x4b64a4];return _0xd19b0e;};'use strict';var Sequelize=require(_0x1ee4('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x1ee4('0x1'),_0x1ee4('0x2')),'defaultValue':_0x1ee4('0x1')},'selector':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x1ee4('0x3')]}}; \ No newline at end of file +var _0x6b6b=['STRING','ENUM','mouseOver','timeout','INTEGER'];(function(_0xfec1e7,_0x96b3a3){var _0x2399d3=function(_0xb7dd83){while(--_0xb7dd83){_0xfec1e7['push'](_0xfec1e7['shift']());}};_0x2399d3(++_0x96b3a3);}(_0x6b6b,0x16d));var _0xb6b6=function(_0xe64ed3,_0x5d9325){_0xe64ed3=_0xe64ed3-0x0;var _0x81e2bc=_0x6b6b[_0xe64ed3];return _0x81e2bc;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xb6b6('0x0')],'allowNull':![]},'type':{'type':Sequelize[_0xb6b6('0x1')](_0xb6b6('0x2'),_0xb6b6('0x3')),'defaultValue':'mouseOver'},'selector':{'type':Sequelize[_0xb6b6('0x0')]},'timeout':{'type':Sequelize[_0xb6b6('0x4')]}}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js index 91522df..9e4961b 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 _0x85d8=['ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','json','offset','undefined','limit','count','Content-Range','reject','save','update','then','end','stack','name','send','show','params','keys','query','filters','intersection','model','attributes','fields','length','includeAll','include','merge','options','ChatProactiveAction','find','body','catch','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path'];(function(_0x52a4fc,_0x59a3bf){var _0xf7debf=function(_0x3e3a30){while(--_0x3e3a30){_0x52a4fc['push'](_0x52a4fc['shift']());}};_0xf7debf(++_0x59a3bf);}(_0x85d8,0x1b0));var _0x885d=function(_0x8735d9,_0x52581d){_0x8735d9=_0x8735d9-0x0;var _0x262a87=_0x85d8[_0x8735d9];return _0x262a87;};'use strict';var emlformat=require(_0x885d('0x0'));var rimraf=require(_0x885d('0x1'));var zipdir=require(_0x885d('0x2'));var jsonpatch=require(_0x885d('0x3'));var rp=require(_0x885d('0x4'));var moment=require('moment');var BPromise=require(_0x885d('0x5'));var Mustache=require(_0x885d('0x6'));var util=require(_0x885d('0x7'));var path=require(_0x885d('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x885d('0x9'));var fs=require('fs');var fs_extra=require(_0x885d('0xa'));var _=require(_0x885d('0xb'));var squel=require(_0x885d('0xc'));var crypto=require(_0x885d('0xd'));var jsforce=require(_0x885d('0xe'));var deskjs=require(_0x885d('0xf'));var toCsv=require(_0x885d('0x10'));var querystring=require(_0x885d('0x11'));var Papa=require(_0x885d('0x12'));var Redis=require(_0x885d('0x13'));var authService=require(_0x885d('0x14'));var qs=require(_0x885d('0x15'));var as=require(_0x885d('0x16'));var hardwareService=require(_0x885d('0x17'));var logger=require(_0x885d('0x18'))(_0x885d('0x19'));var utils=require(_0x885d('0x1a'));var config=require(_0x885d('0x1b'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x28b541,_0x127cd8){_0x127cd8=_0x127cd8||0xcc;return function(_0x495a56){if(_0x495a56){return _0x28b541[_0x885d('0x1c')](_0x127cd8);}return _0x28b541[_0x885d('0x1d')](_0x127cd8)['end']();};}function respondWithResult(_0x527a40,_0x466be5){_0x466be5=_0x466be5||0xc8;return function(_0x3a0ab7){if(_0x3a0ab7){return _0x527a40[_0x885d('0x1d')](_0x466be5)[_0x885d('0x1e')](_0x3a0ab7);}};}function respondWithFilteredResult(_0x2ecb5c,_0x1b837f){return function(_0x5d8bcd){if(_0x5d8bcd){var _0x594a29=typeof _0x1b837f[_0x885d('0x1f')]===_0x885d('0x20')&&typeof _0x1b837f[_0x885d('0x21')]===_0x885d('0x20');var _0x22c285=_0x5d8bcd[_0x885d('0x22')];var _0x1e2a42=_0x594a29?0x0:_0x1b837f[_0x885d('0x1f')];var _0x4b565a=_0x594a29?_0x5d8bcd[_0x885d('0x22')]:_0x1b837f[_0x885d('0x1f')]+_0x1b837f[_0x885d('0x21')];var _0x3cadff;if(_0x4b565a>=_0x22c285){_0x4b565a=_0x22c285;_0x3cadff=0xc8;}else{_0x3cadff=0xce;}_0x2ecb5c[_0x885d('0x1d')](_0x3cadff);return _0x2ecb5c['set'](_0x885d('0x23'),_0x1e2a42+'-'+_0x4b565a+'/'+_0x22c285)[_0x885d('0x1e')](_0x5d8bcd);}return null;};}function patchUpdates(_0x55738d){return function(_0x175e05){try{jsonpatch['apply'](_0x175e05,_0x55738d,!![]);}catch(_0x1bca4b){return BPromise[_0x885d('0x24')](_0x1bca4b);}return _0x175e05[_0x885d('0x25')]();};}function saveUpdates(_0x90589,_0x261c0f){return function(_0x2e76ef){if(_0x2e76ef){return _0x2e76ef[_0x885d('0x26')](_0x90589)[_0x885d('0x27')](function(_0x598b20){return _0x598b20;});}return null;};}function removeEntity(_0x38af62,_0x2b7e32){return function(_0x3032ac){if(_0x3032ac){return _0x3032ac['destroy']()[_0x885d('0x27')](function(){_0x38af62[_0x885d('0x1d')](0xcc)[_0x885d('0x28')]();});}};}function handleEntityNotFound(_0x7dc85b,_0x284faf){return function(_0x3f0955){if(!_0x3f0955){_0x7dc85b[_0x885d('0x1c')](0x194);}return _0x3f0955;};}function handleError(_0x32754e,_0x402440){_0x402440=_0x402440||0x1f4;return function(_0x54e121){logger['error'](_0x54e121[_0x885d('0x29')]);if(_0x54e121['name']){delete _0x54e121[_0x885d('0x2a')];}_0x32754e[_0x885d('0x1d')](_0x402440)[_0x885d('0x2b')](_0x54e121);};}exports[_0x885d('0x2c')]=function(_0x16f4c1,_0x4589ee){var _0x537886={'raw':!![],'where':{'id':_0x16f4c1[_0x885d('0x2d')]['id']}},_0x172d26={};_0x172d26['model']=_[_0x885d('0x2e')](db['ChatProactiveAction']['rawAttributes']);_0x172d26[_0x885d('0x2f')]=_['keys'](_0x16f4c1[_0x885d('0x2f')]);_0x172d26[_0x885d('0x30')]=_[_0x885d('0x31')](_0x172d26[_0x885d('0x32')],_0x172d26[_0x885d('0x2f')]);_0x537886[_0x885d('0x33')]=_['intersection'](_0x172d26[_0x885d('0x32')],qs[_0x885d('0x34')](_0x16f4c1[_0x885d('0x2f')][_0x885d('0x34')]));_0x537886[_0x885d('0x33')]=_0x537886['attributes'][_0x885d('0x35')]?_0x537886[_0x885d('0x33')]:_0x172d26['model'];if(_0x16f4c1[_0x885d('0x2f')][_0x885d('0x36')]){_0x537886[_0x885d('0x37')]=[{'all':!![]}];}_0x537886=_[_0x885d('0x38')]({},_0x537886,_0x16f4c1[_0x885d('0x39')]);return db[_0x885d('0x3a')][_0x885d('0x3b')](_0x537886)[_0x885d('0x27')](handleEntityNotFound(_0x4589ee,null))['then'](respondWithResult(_0x4589ee,null))['catch'](handleError(_0x4589ee,null));};exports['create']=function(_0x488a93,_0x3d6ce7){return db[_0x885d('0x3a')]['create'](_0x488a93[_0x885d('0x3c')],{})['then'](respondWithResult(_0x3d6ce7,0xc9))[_0x885d('0x3d')](handleError(_0x3d6ce7,null));};exports[_0x885d('0x26')]=function(_0x3bc1cc,_0xfc0dbe){if(_0x3bc1cc[_0x885d('0x3c')]['id']){delete _0x3bc1cc[_0x885d('0x3c')]['id'];}return db[_0x885d('0x3a')]['find']({'where':{'id':_0x3bc1cc['params']['id']}})[_0x885d('0x27')](handleEntityNotFound(_0xfc0dbe,null))['then'](saveUpdates(_0x3bc1cc[_0x885d('0x3c')],null))['then'](respondWithResult(_0xfc0dbe,null))['catch'](handleError(_0xfc0dbe,null));};exports[_0x885d('0x3e')]=function(_0x3974d2,_0x112e9a){return db[_0x885d('0x3a')][_0x885d('0x3b')]({'where':{'id':_0x3974d2[_0x885d('0x2d')]['id']}})[_0x885d('0x27')](handleEntityNotFound(_0x112e9a,null))[_0x885d('0x27')](removeEntity(_0x112e9a,null))[_0x885d('0x3d')](handleError(_0x112e9a,null));}; \ No newline at end of file +var _0x383d=['filters','intersection','attributes','fields','length','include','options','find','catch','create','body','destroy','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','undefined','count','offset','set','Content-Range','save','update','then','error','stack','name','send','show','params','model','keys','ChatProactiveAction','rawAttributes','query'];(function(_0x27793c,_0x417529){var _0x241d18=function(_0x11b8d0){while(--_0x11b8d0){_0x27793c['push'](_0x27793c['shift']());}};_0x241d18(++_0x417529);}(_0x383d,0x86));var _0xd383=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x383d[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xd383('0x0'));var jsonpatch=require(_0xd383('0x1'));var rp=require(_0xd383('0x2'));var moment=require('moment');var BPromise=require(_0xd383('0x3'));var Mustache=require(_0xd383('0x4'));var util=require(_0xd383('0x5'));var path=require(_0xd383('0x6'));var sox=require(_0xd383('0x7'));var csv=require(_0xd383('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd383('0x9'));var _=require(_0xd383('0xa'));var squel=require(_0xd383('0xb'));var crypto=require(_0xd383('0xc'));var jsforce=require(_0xd383('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xd383('0xe'));var Papa=require(_0xd383('0xf'));var Redis=require('ioredis');var authService=require(_0xd383('0x10'));var qs=require(_0xd383('0x11'));var as=require(_0xd383('0x12'));var hardwareService=require(_0xd383('0x13'));var logger=require(_0xd383('0x14'))(_0xd383('0x15'));var utils=require('../../config/utils');var config=require(_0xd383('0x16'));var licenseUtil=require(_0xd383('0x17'));var db=require(_0xd383('0x18'))['db'];function respondWithStatusCode(_0x456180,_0x52db5a){_0x52db5a=_0x52db5a||0xcc;return function(_0x42143c){if(_0x42143c){return _0x456180[_0xd383('0x19')](_0x52db5a);}return _0x456180[_0xd383('0x1a')](_0x52db5a)[_0xd383('0x1b')]();};}function respondWithResult(_0x4ce386,_0x39985a){_0x39985a=_0x39985a||0xc8;return function(_0x58081c){if(_0x58081c){return _0x4ce386[_0xd383('0x1a')](_0x39985a)[_0xd383('0x1c')](_0x58081c);}};}function respondWithFilteredResult(_0xf2dcb6,_0x373876){return function(_0x387f5f){if(_0x387f5f){var _0x18690a=typeof _0x373876['offset']==='undefined'&&typeof _0x373876[_0xd383('0x1d')]===_0xd383('0x1e');var _0x8639e8=_0x387f5f[_0xd383('0x1f')];var _0x2c068a=_0x18690a?0x0:_0x373876[_0xd383('0x20')];var _0x21d2ed=_0x18690a?_0x387f5f[_0xd383('0x1f')]:_0x373876['offset']+_0x373876[_0xd383('0x1d')];var _0x3714c8;if(_0x21d2ed>=_0x8639e8){_0x21d2ed=_0x8639e8;_0x3714c8=0xc8;}else{_0x3714c8=0xce;}_0xf2dcb6[_0xd383('0x1a')](_0x3714c8);return _0xf2dcb6[_0xd383('0x21')](_0xd383('0x22'),_0x2c068a+'-'+_0x21d2ed+'/'+_0x8639e8)[_0xd383('0x1c')](_0x387f5f);}return null;};}function patchUpdates(_0x49799e){return function(_0x4650db){try{jsonpatch['apply'](_0x4650db,_0x49799e,!![]);}catch(_0x1a8e78){return BPromise['reject'](_0x1a8e78);}return _0x4650db[_0xd383('0x23')]();};}function saveUpdates(_0x39569f,_0x5ebcd9){return function(_0x10c054){if(_0x10c054){return _0x10c054[_0xd383('0x24')](_0x39569f)[_0xd383('0x25')](function(_0x58e47e){return _0x58e47e;});}return null;};}function removeEntity(_0x48d34b,_0x10e296){return function(_0x5a0799){if(_0x5a0799){return _0x5a0799['destroy']()[_0xd383('0x25')](function(){_0x48d34b['status'](0xcc)[_0xd383('0x1b')]();});}};}function handleEntityNotFound(_0x5b407e,_0x4c52c7){return function(_0x54afc4){if(!_0x54afc4){_0x5b407e[_0xd383('0x19')](0x194);}return _0x54afc4;};}function handleError(_0x40d989,_0x6de576){_0x6de576=_0x6de576||0x1f4;return function(_0x554758){logger[_0xd383('0x26')](_0x554758[_0xd383('0x27')]);if(_0x554758[_0xd383('0x28')]){delete _0x554758[_0xd383('0x28')];}_0x40d989[_0xd383('0x1a')](_0x6de576)[_0xd383('0x29')](_0x554758);};}exports[_0xd383('0x2a')]=function(_0x208247,_0x1981db){var _0x4f2ec6={'raw':!![],'where':{'id':_0x208247[_0xd383('0x2b')]['id']}},_0x2f1fea={};_0x2f1fea[_0xd383('0x2c')]=_[_0xd383('0x2d')](db[_0xd383('0x2e')][_0xd383('0x2f')]);_0x2f1fea[_0xd383('0x30')]=_[_0xd383('0x2d')](_0x208247[_0xd383('0x30')]);_0x2f1fea[_0xd383('0x31')]=_[_0xd383('0x32')](_0x2f1fea[_0xd383('0x2c')],_0x2f1fea[_0xd383('0x30')]);_0x4f2ec6[_0xd383('0x33')]=_[_0xd383('0x32')](_0x2f1fea['model'],qs[_0xd383('0x34')](_0x208247[_0xd383('0x30')][_0xd383('0x34')]));_0x4f2ec6[_0xd383('0x33')]=_0x4f2ec6[_0xd383('0x33')][_0xd383('0x35')]?_0x4f2ec6[_0xd383('0x33')]:_0x2f1fea[_0xd383('0x2c')];if(_0x208247[_0xd383('0x30')]['includeAll']){_0x4f2ec6[_0xd383('0x36')]=[{'all':!![]}];}_0x4f2ec6=_['merge']({},_0x4f2ec6,_0x208247[_0xd383('0x37')]);return db['ChatProactiveAction'][_0xd383('0x38')](_0x4f2ec6)['then'](handleEntityNotFound(_0x1981db,null))[_0xd383('0x25')](respondWithResult(_0x1981db,null))[_0xd383('0x39')](handleError(_0x1981db,null));};exports['create']=function(_0x210ab5,_0x2f76d7){return db[_0xd383('0x2e')][_0xd383('0x3a')](_0x210ab5[_0xd383('0x3b')],{})[_0xd383('0x25')](respondWithResult(_0x2f76d7,0xc9))[_0xd383('0x39')](handleError(_0x2f76d7,null));};exports[_0xd383('0x24')]=function(_0x9af1be,_0x2a328d){if(_0x9af1be['body']['id']){delete _0x9af1be[_0xd383('0x3b')]['id'];}return db[_0xd383('0x2e')][_0xd383('0x38')]({'where':{'id':_0x9af1be[_0xd383('0x2b')]['id']}})[_0xd383('0x25')](handleEntityNotFound(_0x2a328d,null))[_0xd383('0x25')](saveUpdates(_0x9af1be[_0xd383('0x3b')],null))[_0xd383('0x25')](respondWithResult(_0x2a328d,null))[_0xd383('0x39')](handleError(_0x2a328d,null));};exports[_0xd383('0x3c')]=function(_0x4029e3,_0x47cfb8){return db[_0xd383('0x2e')][_0xd383('0x38')]({'where':{'id':_0x4029e3[_0xd383('0x2b')]['id']}})[_0xd383('0x25')](handleEntityNotFound(_0x47cfb8,null))[_0xd383('0x25')](removeEntity(_0x47cfb8,null))['catch'](handleError(_0x47cfb8,null));}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js index 7a2ca89..19c22c9 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 _0xf5e5=['chat_proactive_actions','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','./chatProactiveAction.attributes','exports','define','ChatProactiveAction'];(function(_0x45fefe,_0x58a8b9){var _0x74b850=function(_0x5f21ae){while(--_0x5f21ae){_0x45fefe['push'](_0x45fefe['shift']());}};_0x74b850(++_0x58a8b9);}(_0xf5e5,0x109));var _0x5f5e=function(_0xd5709b,_0x101823){_0xd5709b=_0xd5709b-0x0;var _0x3dc484=_0xf5e5[_0xd5709b];return _0x3dc484;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x5f5e('0x0'))(_0x5f5e('0x1'));var moment=require(_0x5f5e('0x2'));var BPromise=require(_0x5f5e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x5f5e('0x4'));var config=require(_0x5f5e('0x5'));var attributes=require(_0x5f5e('0x6'));module[_0x5f5e('0x7')]=function(_0x40cfa1,_0x2a4c1f){return _0x40cfa1[_0x5f5e('0x8')](_0x5f5e('0x9'),attributes,{'tableName':_0x5f5e('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x10c7=['lodash','util','api','request-promise','rimraf','../../config/environment','./chatProactiveAction.attributes','exports','define','ChatProactiveAction','chat_proactive_actions'];(function(_0x11a962,_0x3cc338){var _0x55d423=function(_0xf4b236){while(--_0xf4b236){_0x11a962['push'](_0x11a962['shift']());}};_0x55d423(++_0x3cc338);}(_0x10c7,0x1b8));var _0x710c=function(_0x115ae3,_0x78c8ca){_0x115ae3=_0x115ae3-0x0;var _0x561107=_0x10c7[_0x115ae3];return _0x561107;};'use strict';var _=require(_0x710c('0x0'));var util=require(_0x710c('0x1'));var logger=require('../../config/logger')(_0x710c('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x710c('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x710c('0x4'));var config=require(_0x710c('0x5'));var attributes=require(_0x710c('0x6'));module[_0x710c('0x7')]=function(_0x337e59,_0xe27aca){return _0x337e59[_0x710c('0x8')](_0x710c('0x9'),attributes,{'tableName':_0x710c('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.rpc.js b/server/api/chatProactiveAction/chatProactiveAction.rpc.js index acc6f7d..3bf80f5 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 _0xb084=['../../config/utils','../../config/logger','rpc','client','http','request','then','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb'];(function(_0x172747,_0x1732bd){var _0x509692=function(_0x448c56){while(--_0x448c56){_0x172747['push'](_0x172747['shift']());}};_0x509692(++_0x1732bd);}(_0xb084,0x8a));var _0x4b08=function(_0x137b46,_0x12de97){_0x137b46=_0x137b46-0x0;var _0x29ad14=_0xb084[_0x137b46];return _0x29ad14;};'use strict';var _=require(_0x4b08('0x0'));var util=require(_0x4b08('0x1'));var moment=require(_0x4b08('0x2'));var BPromise=require('bluebird');var rs=require(_0x4b08('0x3'));var fs=require('fs');var Redis=require(_0x4b08('0x4'));var db=require(_0x4b08('0x5'))['db'];var utils=require(_0x4b08('0x6'));var logger=require(_0x4b08('0x7'))(_0x4b08('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x4b08('0x9')][_0x4b08('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4c1f80,_0x587ac0,_0x2c553c){return new BPromise(function(_0x3f2ef4,_0x5f334a){return client[_0x4b08('0xb')](_0x4c1f80,_0x2c553c)[_0x4b08('0xc')](function(_0x24a5c){logger[_0x4b08('0xd')](_0x4b08('0xe'),_0x587ac0,_0x4b08('0xf'));logger[_0x4b08('0x10')](_0x4b08('0x11'),_0x587ac0,'request\x20sent',JSON[_0x4b08('0x12')](_0x24a5c));if(_0x24a5c[_0x4b08('0x13')]){if(_0x24a5c[_0x4b08('0x13')][_0x4b08('0x14')]===0x1f4){logger[_0x4b08('0x13')](_0x4b08('0xe'),_0x587ac0,_0x24a5c['error'][_0x4b08('0x15')]);return _0x5f334a(_0x24a5c['error'][_0x4b08('0x15')]);}logger[_0x4b08('0x13')]('ChatProactiveAction,\x20%s,\x20%s',_0x587ac0,_0x24a5c['error'][_0x4b08('0x15')]);return _0x3f2ef4(_0x24a5c[_0x4b08('0x13')]['message']);}else{logger[_0x4b08('0xd')]('ChatProactiveAction,\x20%s,\x20%s',_0x587ac0,_0x4b08('0xf'));_0x3f2ef4(_0x24a5c[_0x4b08('0x16')][_0x4b08('0x15')]);}})[_0x4b08('0x17')](function(_0x3fecf7){logger['error']('ChatProactiveAction,\x20%s,\x20%s',_0x587ac0,_0x3fecf7);_0x5f334a(_0x3fecf7);});});} \ No newline at end of file +var _0x7960=['moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','message','lodash','util'];(function(_0x46066f,_0x23105c){var _0x411977=function(_0x5743ff){while(--_0x5743ff){_0x46066f['push'](_0x46066f['shift']());}};_0x411977(++_0x23105c);}(_0x7960,0xcf));var _0x0796=function(_0x38a68d,_0x52b79c){_0x38a68d=_0x38a68d-0x0;var _0x511544=_0x7960[_0x38a68d];return _0x511544;};'use strict';var _=require(_0x0796('0x0'));var util=require(_0x0796('0x1'));var moment=require(_0x0796('0x2'));var BPromise=require(_0x0796('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0796('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x0796('0x5'));var logger=require(_0x0796('0x6'))(_0x0796('0x7'));var config=require(_0x0796('0x8'));var jayson=require(_0x0796('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x49e8b4,_0x37d20b,_0x3c19d9){return new BPromise(function(_0x38d3e8,_0x3615a2){return client[_0x0796('0xa')](_0x49e8b4,_0x3c19d9)['then'](function(_0x178106){logger[_0x0796('0xb')](_0x0796('0xc'),_0x37d20b,_0x0796('0xd'));logger[_0x0796('0xe')](_0x0796('0xf'),_0x37d20b,_0x0796('0xd'),JSON[_0x0796('0x10')](_0x178106));if(_0x178106[_0x0796('0x11')]){if(_0x178106['error']['code']===0x1f4){logger[_0x0796('0x11')](_0x0796('0xc'),_0x37d20b,_0x178106[_0x0796('0x11')][_0x0796('0x12')]);return _0x3615a2(_0x178106[_0x0796('0x11')][_0x0796('0x12')]);}logger['error'](_0x0796('0xc'),_0x37d20b,_0x178106[_0x0796('0x11')][_0x0796('0x12')]);return _0x38d3e8(_0x178106['error'][_0x0796('0x12')]);}else{logger[_0x0796('0xb')](_0x0796('0xc'),_0x37d20b,'request\x20sent');_0x38d3e8(_0x178106['result'][_0x0796('0x12')]);}})['catch'](function(_0x2b03fe){logger[_0x0796('0x11')](_0x0796('0xc'),_0x37d20b,_0x2b03fe);_0x3615a2(_0x2b03fe);});});} \ No newline at end of file diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js index 295d370..4e9ecba 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 _0x5075=['show','create','put','update','delete','/:id','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','isAuthenticated'];(function(_0x2f9c54,_0x273550){var _0xcb8cb1=function(_0x30a3ea){while(--_0x30a3ea){_0x2f9c54['push'](_0x2f9c54['shift']());}};_0xcb8cb1(++_0x273550);}(_0x5075,0x73));var _0x5507=function(_0x29c2f7,_0x1ffb8b){_0x29c2f7=_0x29c2f7-0x0;var _0x3582e6=_0x5075[_0x29c2f7];return _0x3582e6;};'use strict';var multer=require(_0x5507('0x0'));var util=require(_0x5507('0x1'));var path=require(_0x5507('0x2'));var timeout=require(_0x5507('0x3'));var express=require(_0x5507('0x4'));var router=express[_0x5507('0x5')]();var fs_extra=require(_0x5507('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x5507('0x7'));var config=require(_0x5507('0x8'));var controller=require(_0x5507('0x9'));router['get']('/:id',auth[_0x5507('0xa')](),controller[_0x5507('0xb')]);router['post']('/',auth[_0x5507('0xa')](),controller[_0x5507('0xc')]);router[_0x5507('0xd')]('/:id',auth['isAuthenticated'](),controller[_0x5507('0xe')]);router[_0x5507('0xf')](_0x5507('0x10'),auth[_0x5507('0xa')](),controller['destroy']);module[_0x5507('0x11')]=router; \ No newline at end of file +var _0x814b=['path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','get','/:id','show','post','create','put','isAuthenticated','update','delete','destroy','exports','multer','util'];(function(_0x2a4692,_0x5db910){var _0x370e6b=function(_0x5b4e23){while(--_0x5b4e23){_0x2a4692['push'](_0x2a4692['shift']());}};_0x370e6b(++_0x5db910);}(_0x814b,0x1a2));var _0xb814=function(_0x97cc12,_0x54d583){_0x97cc12=_0x97cc12-0x0;var _0x5a25d7=_0x814b[_0x97cc12];return _0x5a25d7;};'use strict';var multer=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var path=require(_0xb814('0x2'));var timeout=require(_0xb814('0x3'));var express=require(_0xb814('0x4'));var router=express[_0xb814('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xb814('0x6'));var interaction=require(_0xb814('0x7'));var config=require(_0xb814('0x8'));var controller=require(_0xb814('0x9'));router[_0xb814('0xa')](_0xb814('0xb'),auth['isAuthenticated'](),controller[_0xb814('0xc')]);router[_0xb814('0xd')]('/',auth['isAuthenticated'](),controller[_0xb814('0xe')]);router[_0xb814('0xf')](_0xb814('0xb'),auth[_0xb814('0x10')](),controller[_0xb814('0x11')]);router[_0xb814('0x12')](_0xb814('0xb'),auth[_0xb814('0x10')](),controller[_0xb814('0x13')]);module[_0xb814('0x14')]=router; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js index 43a970e..2a2d524 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 _0x97de=['exports','STRING','INTEGER','ENUM','rrmemory','beepall','sequelize'];(function(_0x1f9c3d,_0x7b76bc){var _0x5946e8=function(_0xe4fe32){while(--_0xe4fe32){_0x1f9c3d['push'](_0x1f9c3d['shift']());}};_0x5946e8(++_0x7b76bc);}(_0x97de,0xae));var _0xe97d=function(_0x51599e,_0x5e0342){_0x51599e=_0x51599e-0x0;var _0x5ef3fd=_0x97de[_0x51599e];return _0x5ef3fd;};'use strict';var Sequelize=require(_0xe97d('0x0'));module[_0xe97d('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xe97d('0x2')]},'timeout':{'type':Sequelize[_0xe97d('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xe97d('0x4')](_0xe97d('0x5'),_0xe97d('0x6'),'roundrobin')}}; \ No newline at end of file +var _0x2ac6=['INTEGER','ENUM','rrmemory','beepall','roundrobin','STRING'];(function(_0x297fd3,_0x115406){var _0x2af381=function(_0x1dd31b){while(--_0x1dd31b){_0x297fd3['push'](_0x297fd3['shift']());}};_0x2af381(++_0x115406);}(_0x2ac6,0x125));var _0x62ac=function(_0x34c8b3,_0x5bbb6f){_0x34c8b3=_0x34c8b3-0x0;var _0xf771a5=_0x2ac6[_0x34c8b3];return _0xf771a5;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x62ac('0x0')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x62ac('0x1')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x62ac('0x2')](_0x62ac('0x3'),_0x62ac('0x4'),_0x62ac('0x5'))}}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js index 3d991dd..91db822 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 _0x6a3f=['addTeams','ids','Agents','online','voicePause','flatMap','transaction','findOrCreate','forEach','emit','userChatQueue:save','removeTeams','User','select','field','from','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','push','sequelize','toString','QueryTypes','SELECT','every','all','union','compact','value','isEmpty','removeAgents','userChatQueue:remove','addAgents','omit','spread','isArray','getAgents','lodash','squel','../../components/parsers/qs','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','get','UserProfileResource','error','stack','name','send','index','map','ChatQueue','rawAttributes','fieldName','type','where','include','findAll','rows','catch','model','keys','query','filters','intersection','attributes','fields','length','merge','options','find','body','user','ChatQueues','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','findOne','UserChatQueue','hasOwnProperty','nolimit','order','sort','pick','ChatQueueId','filter','findAndCountAll','UserId','agent','updatedAt','format','%s/%s','SIP','chatPause','createdAt','getTeams','Team'];(function(_0x2d0f59,_0x475cb9){var _0x227db7=function(_0x256cde){while(--_0x256cde){_0x2d0f59['push'](_0x2d0f59['shift']());}};_0x227db7(++_0x475cb9);}(_0x6a3f,0x9e));var _0xf6a3=function(_0x174fc1,_0x384973){_0x174fc1=_0x174fc1-0x0;var _0x41b79a=_0x6a3f[_0x174fc1];return _0x41b79a;};'use strict';var BPromise=require('bluebird');var util=require('util');var _=require(_0xf6a3('0x0'));var squel=require(_0xf6a3('0x1'));var Redis=require('ioredis');var qs=require(_0xf6a3('0x2'));var logger=require('../../config/logger')(_0xf6a3('0x3'));var config=require(_0xf6a3('0x4'));var db=require(_0xf6a3('0x5'))['db'];config[_0xf6a3('0x6')]=_[_0xf6a3('0x7')](config[_0xf6a3('0x6')],{'host':_0xf6a3('0x8'),'port':0x18eb});var socket=require(_0xf6a3('0x9'))(new Redis(config['redis']));require('./chatQueue.socket')['register'](socket);function respondWithStatusCode(_0x25dfbb,_0x59be98){_0x59be98=_0x59be98||0xcc;return function(_0x2563b2){if(_0x2563b2){return _0x25dfbb[_0xf6a3('0xa')](_0x59be98);}return _0x25dfbb[_0xf6a3('0xb')](_0x59be98)[_0xf6a3('0xc')]();};}function respondWithResult(_0x4b07b8,_0x415cc4){_0x415cc4=_0x415cc4||0xc8;return function(_0x3af4f6){if(_0x3af4f6){return _0x4b07b8['status'](_0x415cc4)[_0xf6a3('0xd')](_0x3af4f6);}};}function respondWithFilteredResult(_0xcf2155,_0x1ff71c){return function(_0xf2bfe8){if(_0xf2bfe8){var _0x3ee952=typeof _0x1ff71c[_0xf6a3('0xe')]===_0xf6a3('0xf')&&typeof _0x1ff71c[_0xf6a3('0x10')]===_0xf6a3('0xf');var _0x33c240=_0xf2bfe8[_0xf6a3('0x11')];var _0x431da8=_0x3ee952?0x0:_0x1ff71c[_0xf6a3('0xe')];var _0x2da981=_0x3ee952?_0xf2bfe8[_0xf6a3('0x11')]:_0x1ff71c[_0xf6a3('0xe')]+_0x1ff71c[_0xf6a3('0x10')];var _0x4e3807;if(_0x2da981>=_0x33c240){_0x2da981=_0x33c240;_0x4e3807=0xc8;}else{_0x4e3807=0xce;}_0xcf2155['status'](_0x4e3807);return _0xcf2155[_0xf6a3('0x12')](_0xf6a3('0x13'),_0x431da8+'-'+_0x2da981+'/'+_0x33c240)[_0xf6a3('0xd')](_0xf2bfe8);}return null;};}function saveUpdates(_0x31ef35){return function(_0x355def){if(_0x355def){return _0x355def[_0xf6a3('0x14')](_0x31ef35)[_0xf6a3('0x15')](function(_0x1e4144){return _0x1e4144;});}return null;};}function removeEntity(_0x47f591){return function(_0x51a37a){if(_0x51a37a){return _0x51a37a[_0xf6a3('0x16')]()['then'](function(){var _0x30f0b0=_0x51a37a[_0xf6a3('0x17')]({'plain':!![]});var _0x168b8d='ChatQueues';return db[_0xf6a3('0x18')][_0xf6a3('0x16')]({'where':{'type':_0x168b8d,'resourceId':_0x30f0b0['id']}})[_0xf6a3('0x15')](function(){return _0x51a37a;});})[_0xf6a3('0x15')](function(){_0x47f591['status'](0xcc)[_0xf6a3('0xc')]();});}};}function handleEntityNotFound(_0x36bed2){return function(_0x46db25){if(!_0x46db25){_0x36bed2[_0xf6a3('0xa')](0x194);}return _0x46db25;};}function handleError(_0x4bddb8,_0x28e275){_0x28e275=_0x28e275||0x1f4;return function(_0x21d72a){logger[_0xf6a3('0x19')](_0x21d72a[_0xf6a3('0x1a')]);if(_0x21d72a[_0xf6a3('0x1b')]){delete _0x21d72a[_0xf6a3('0x1b')];}_0x4bddb8[_0xf6a3('0xb')](_0x28e275)[_0xf6a3('0x1c')](_0x21d72a);};}exports[_0xf6a3('0x1d')]=function(_0x4acda6,_0x4cd1d9){var _0x32fe87={};var _0x549e41={'count':0x0,'rows':[]};var _0x4a5488=_[_0xf6a3('0x1e')](db[_0xf6a3('0x1f')][_0xf6a3('0x20')],function(_0x54135f){return{'name':_0x54135f[_0xf6a3('0x21')],'type':_0x54135f[_0xf6a3('0x22')]['key']};});_0x32fe87=qs['getOptions'](_0x4a5488,_0x4acda6);var _0x4a877a={'where':_0x32fe87[_0xf6a3('0x23')]};return db[_0xf6a3('0x1f')][_0xf6a3('0x11')](_0x4a877a)['then'](function(_0x433193){_0x549e41['count']=_0x433193;_0x32fe87[_0xf6a3('0x24')]=qs['include'](_0x4acda6['query']);return db[_0xf6a3('0x1f')][_0xf6a3('0x25')](_0x32fe87);})[_0xf6a3('0x15')](function(_0xe4a4a2){_0x549e41[_0xf6a3('0x26')]=_0xe4a4a2;return _0x549e41;})[_0xf6a3('0x15')](respondWithFilteredResult(_0x4cd1d9,_0x32fe87))[_0xf6a3('0x27')](handleError(_0x4cd1d9,null));};exports['show']=function(_0x441e27,_0x478ded){var _0x2421e1={'raw':!![],'where':{'id':_0x441e27['params']['id']}},_0x1d1ebd={};_0x1d1ebd[_0xf6a3('0x28')]=_[_0xf6a3('0x29')](db[_0xf6a3('0x1f')][_0xf6a3('0x20')]);_0x1d1ebd[_0xf6a3('0x2a')]=_[_0xf6a3('0x29')](_0x441e27['query']);_0x1d1ebd[_0xf6a3('0x2b')]=_[_0xf6a3('0x2c')](_0x1d1ebd[_0xf6a3('0x28')],_0x1d1ebd['query']);_0x2421e1[_0xf6a3('0x2d')]=_[_0xf6a3('0x2c')](_0x1d1ebd['model'],qs[_0xf6a3('0x2e')](_0x441e27['query'][_0xf6a3('0x2e')]));_0x2421e1[_0xf6a3('0x2d')]=_0x2421e1[_0xf6a3('0x2d')][_0xf6a3('0x2f')]?_0x2421e1[_0xf6a3('0x2d')]:_0x1d1ebd['model'];if(_0x441e27[_0xf6a3('0x2a')]['includeAll']){_0x2421e1[_0xf6a3('0x24')]=[{'all':!![]}];}_0x2421e1=_[_0xf6a3('0x30')]({},_0x2421e1,_0x441e27[_0xf6a3('0x31')]);return db[_0xf6a3('0x1f')][_0xf6a3('0x32')](_0x2421e1)[_0xf6a3('0x15')](handleEntityNotFound(_0x478ded,null))[_0xf6a3('0x15')](respondWithResult(_0x478ded,null))['catch'](handleError(_0x478ded,null));};exports['create']=function(_0x47ab75,_0x55a09b){return db[_0xf6a3('0x1f')]['create'](_0x47ab75[_0xf6a3('0x33')],{})[_0xf6a3('0x15')](function(_0x269e46){var _0x3661dd=_0x47ab75[_0xf6a3('0x34')][_0xf6a3('0x17')]({'plain':!![]});if(!_0x3661dd)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3661dd['role']===_0xf6a3('0x34')){var _0x562cdc=_0x269e46[_0xf6a3('0x17')]({'plain':!![]});var _0x52f643=_0xf6a3('0x35');return db['UserProfileSection'][_0xf6a3('0x32')]({'where':{'name':_0x52f643,'userProfileId':_0x3661dd[_0xf6a3('0x36')]},'raw':!![]})[_0xf6a3('0x15')](function(_0x189533){if(_0x189533&&_0x189533[_0xf6a3('0x37')]===0x0){return db['UserProfileResource'][_0xf6a3('0x38')]({'name':_0x562cdc[_0xf6a3('0x1b')],'resourceId':_0x562cdc['id'],'type':_0x189533[_0xf6a3('0x1b')],'sectionId':_0x189533['id']},{})[_0xf6a3('0x15')](function(){return _0x269e46;});}else{return _0x269e46;}})['catch'](function(_0x330d32){logger[_0xf6a3('0x19')](_0xf6a3('0x39'),_0x330d32);throw _0x330d32;});}return _0x269e46;})['then'](respondWithResult(_0x55a09b,0xc9))[_0xf6a3('0x27')](handleError(_0x55a09b,null));};exports[_0xf6a3('0x14')]=function(_0x90b00b,_0x27e77f){if(_0x90b00b[_0xf6a3('0x33')]['id']){delete _0x90b00b[_0xf6a3('0x33')]['id'];}return db[_0xf6a3('0x1f')][_0xf6a3('0x32')]({'where':{'id':_0x90b00b[_0xf6a3('0x3a')]['id']}})[_0xf6a3('0x15')](handleEntityNotFound(_0x27e77f,null))[_0xf6a3('0x15')](saveUpdates(_0x90b00b['body'],null))[_0xf6a3('0x15')](respondWithResult(_0x27e77f,null))[_0xf6a3('0x27')](handleError(_0x27e77f,null));};exports['destroy']=function(_0x2cb13e,_0x59434b){return db['ChatQueue']['find']({'where':{'id':_0x2cb13e[_0xf6a3('0x3a')]['id']}})[_0xf6a3('0x15')](handleEntityNotFound(_0x59434b,null))[_0xf6a3('0x15')](removeEntity(_0x59434b,null))[_0xf6a3('0x27')](handleError(_0x59434b,null));};exports[_0xf6a3('0x3b')]=function(_0x153f81,_0x5785a7){return db['ChatQueue']['describe']()[_0xf6a3('0x15')](respondWithResult(_0x5785a7,null))[_0xf6a3('0x27')](handleError(_0x5785a7,null));};exports['getMembers']=function(_0x2363cd,_0x3787b0){var _0x489633={'raw':!![],'where':{}},_0x34bec8={},_0x79775d;return db['ChatQueue'][_0xf6a3('0x3c')]({'where':{'id':_0x2363cd[_0xf6a3('0x3a')]['id']}})['then'](handleEntityNotFound(_0x3787b0,null))[_0xf6a3('0x15')](function(_0x316f31){if(_0x316f31){_0x79775d=_0x316f31[_0xf6a3('0x17')]({'plain':!![]});_0x34bec8['model']=_[_0xf6a3('0x29')](db[_0xf6a3('0x3d')]['rawAttributes']);_0x34bec8[_0xf6a3('0x2a')]=_['keys'](_0x2363cd['query']);_0x34bec8['filters']=_[_0xf6a3('0x2c')](_0x34bec8[_0xf6a3('0x28')],_0x34bec8['query']);_0x489633['attributes']=_[_0xf6a3('0x2c')](_0x34bec8[_0xf6a3('0x28')],qs[_0xf6a3('0x2e')](_0x2363cd[_0xf6a3('0x2a')][_0xf6a3('0x2e')]));_0x489633[_0xf6a3('0x2d')]=_0x489633[_0xf6a3('0x2d')]['length']?_0x489633[_0xf6a3('0x2d')]:_0x34bec8['model'];if(!_0x2363cd[_0xf6a3('0x2a')][_0xf6a3('0x3e')](_0xf6a3('0x3f'))){_0x489633[_0xf6a3('0x10')]=qs[_0xf6a3('0x10')](_0x2363cd['query']['limit']);_0x489633[_0xf6a3('0xe')]=qs['offset'](_0x2363cd[_0xf6a3('0x2a')][_0xf6a3('0xe')]);}_0x489633[_0xf6a3('0x40')]=qs[_0xf6a3('0x41')](_0x2363cd[_0xf6a3('0x2a')][_0xf6a3('0x41')]);_0x489633[_0xf6a3('0x23')]=qs[_0xf6a3('0x2b')](_[_0xf6a3('0x42')](_0x2363cd[_0xf6a3('0x2a')],_0x34bec8[_0xf6a3('0x2b')]));_0x489633['where'][_0xf6a3('0x43')]=_0x316f31['id'];if(_0x2363cd[_0xf6a3('0x2a')][_0xf6a3('0x44')]){_0x489633[_0xf6a3('0x23')]=_[_0xf6a3('0x30')](_0x489633[_0xf6a3('0x23')],{'$or':_['map'](_0x489633[_0xf6a3('0x2d')],function(_0x5c5f7a){var _0x1e8e6f={};_0x1e8e6f[_0x5c5f7a]={'$like':'%'+_0x2363cd[_0xf6a3('0x2a')][_0xf6a3('0x44')]+'%'};return _0x1e8e6f;})});}_0x489633=_[_0xf6a3('0x30')]({},_0x489633,_0x2363cd[_0xf6a3('0x31')]);return db[_0xf6a3('0x3d')][_0xf6a3('0x25')](_0x489633);}})['then'](function(_0x57b5ad){if(_0x57b5ad){return db['User'][_0xf6a3('0x45')]({'where':{'id':_['map'](_0x57b5ad,_0xf6a3('0x46')),'role':_0xf6a3('0x47')},'attributes':['id',_0xf6a3('0x1b'),'chatPause',_0xf6a3('0x48'),'createdAt']});}})['then'](function(_0x113c48){if(_0x113c48){return{'count':_0x113c48[_0xf6a3('0x11')],'rows':_[_0xf6a3('0x1e')](_0x113c48[_0xf6a3('0x26')],function(_0x3ee535){return{'membername':_0x3ee535['name'],'UserId':_0x3ee535['id'],'queue_name':_0x79775d[_0xf6a3('0x1b')],'ChatQueueId':_0x79775d['id'],'interface':util[_0xf6a3('0x49')](_0xf6a3('0x4a'),_0xf6a3('0x4b'),_0x3ee535[_0xf6a3('0x1b')]),'penalty':0x0,'paused':_0x3ee535[_0xf6a3('0x4c')],'createdAt':_0x3ee535[_0xf6a3('0x4d')],'updatedAt':_0x3ee535[_0xf6a3('0x48')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xf6a3('0x15')](respondWithFilteredResult(_0x3787b0,_0x489633))[_0xf6a3('0x27')](handleError(_0x3787b0,null));};exports[_0xf6a3('0x4e')]=function(_0x12de20,_0x139c40){var _0x4c8c4a={};var _0x2fe1fc={};var _0x2601c1;var _0x52c0ad;return db['ChatQueue'][_0xf6a3('0x3c')]({'where':{'id':_0x12de20[_0xf6a3('0x3a')]['id']}})[_0xf6a3('0x15')](handleEntityNotFound(_0x139c40,null))[_0xf6a3('0x15')](function(_0x25ad2c){if(_0x25ad2c){_0x2601c1=_0x25ad2c;_0x2fe1fc[_0xf6a3('0x28')]=_[_0xf6a3('0x29')](db[_0xf6a3('0x4f')]['rawAttributes']);_0x2fe1fc[_0xf6a3('0x2a')]=_[_0xf6a3('0x29')](_0x12de20[_0xf6a3('0x2a')]);_0x2fe1fc[_0xf6a3('0x2b')]=_[_0xf6a3('0x2c')](_0x2fe1fc[_0xf6a3('0x28')],_0x2fe1fc[_0xf6a3('0x2a')]);_0x4c8c4a[_0xf6a3('0x2d')]=_[_0xf6a3('0x2c')](_0x2fe1fc[_0xf6a3('0x28')],qs[_0xf6a3('0x2e')](_0x12de20[_0xf6a3('0x2a')][_0xf6a3('0x2e')]));_0x4c8c4a['attributes']=_0x4c8c4a['attributes'][_0xf6a3('0x2f')]?_0x4c8c4a['attributes']:_0x2fe1fc[_0xf6a3('0x28')];_0x4c8c4a[_0xf6a3('0x40')]=qs[_0xf6a3('0x41')](_0x12de20[_0xf6a3('0x2a')][_0xf6a3('0x41')]);_0x4c8c4a['where']=qs[_0xf6a3('0x2b')](_[_0xf6a3('0x42')](_0x12de20[_0xf6a3('0x2a')],_0x2fe1fc[_0xf6a3('0x2b')]));if(_0x12de20[_0xf6a3('0x2a')][_0xf6a3('0x44')]){_0x4c8c4a[_0xf6a3('0x23')]=_['merge'](_0x4c8c4a[_0xf6a3('0x23')],{'$or':_[_0xf6a3('0x1e')](_0x4c8c4a['attributes'],function(_0x481d70){var _0x4ba2b1={};_0x4ba2b1[_0x481d70]={'$like':'%'+_0x12de20['query']['filter']+'%'};return _0x4ba2b1;})});}_0x4c8c4a=_[_0xf6a3('0x30')]({},_0x4c8c4a,_0x12de20['options']);return _0x2601c1['getTeams'](_0x4c8c4a);}})[_0xf6a3('0x15')](function(_0x421fcf){if(_0x421fcf){_0x52c0ad=_0x421fcf[_0xf6a3('0x2f')];if(!_0x12de20[_0xf6a3('0x2a')]['hasOwnProperty'](_0xf6a3('0x3f'))){_0x4c8c4a[_0xf6a3('0x10')]=qs[_0xf6a3('0x10')](_0x12de20[_0xf6a3('0x2a')][_0xf6a3('0x10')]);_0x4c8c4a[_0xf6a3('0xe')]=qs[_0xf6a3('0xe')](_0x12de20[_0xf6a3('0x2a')][_0xf6a3('0xe')]);}return _0x2601c1[_0xf6a3('0x4e')](_0x4c8c4a);}})['then'](function(_0x441096){if(_0x441096){return _0x441096?{'count':_0x52c0ad,'rows':_0x441096}:null;}})[_0xf6a3('0x15')](respondWithResult(_0x139c40,null))[_0xf6a3('0x27')](handleError(_0x139c40,null));};exports[_0xf6a3('0x50')]=function(_0x5f1de4,_0x6348cb){var _0x3e5800=_0x5f1de4[_0xf6a3('0x33')][_0xf6a3('0x51')];return db['Team']['findAll']({'where':{'id':_0x3e5800},'attributes':['id'],'include':[{'model':db['User'],'as':_0xf6a3('0x52'),'attributes':['id',_0xf6a3('0x1b'),_0xf6a3('0x53'),_0xf6a3('0x54'),'interface'],'raw':!![]}]})[_0xf6a3('0x15')](function(_0x222056){if(_0x222056){var _0x21958b=_[_0xf6a3('0x55')](_0x222056,function(_0x413d56){var _0x3e63c3=_0x413d56[_0xf6a3('0x17')]({'plain':!![]});return _0x3e63c3['Agents'];});return db['ChatQueue'][_0xf6a3('0x32')]({'where':{'id':_0x5f1de4['params']['id']}})['then'](function(_0x411a88){return db['sequelize'][_0xf6a3('0x56')](function(_0x5dc825){return _0x411a88[_0xf6a3('0x50')](_0x3e5800,{'transaction':_0x5dc825})['then'](function(){return BPromise['each'](_0x21958b,function(_0x4889ee){return db['UserChatQueue'][_0xf6a3('0x57')]({'where':{'UserId':_0x4889ee['id'],'ChatQueueId':_0x5f1de4['params']['id']},'transaction':_0x5dc825});});})['then'](function(){_0x21958b[_0xf6a3('0x58')](function(_0x11bcf7){socket[_0xf6a3('0x59')](_0xf6a3('0x5a'),{'UserId':_0x11bcf7['id'],'ChatQueueId':_0x411a88['id']});});});});});}})[_0xf6a3('0x15')](respondWithStatusCode(_0x6348cb,null))[_0xf6a3('0x27')](handleError(_0x6348cb,null));};exports[_0xf6a3('0x5b')]=function(_0x19c15f,_0x1135db){return db[_0xf6a3('0x4f')][_0xf6a3('0x25')]({'where':{'id':_0x19c15f[_0xf6a3('0x2a')][_0xf6a3('0x51')]},'attributes':['id'],'include':[{'model':db[_0xf6a3('0x5c')],'as':'Agents','attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x1135db,null))[_0xf6a3('0x15')](function(_0x1adb82){var _0x447c3c=_[_0xf6a3('0x1e')](_0x1adb82,'id');var _0x25b98=[];var _0x473276=[];var _0x1a5465=squel[_0xf6a3('0x5d')]();_0x1a5465[_0xf6a3('0x5e')]('tq.TeamId')[_0xf6a3('0x5f')]('team_has_chat_queues','tq')[_0xf6a3('0x60')](_0xf6a3('0x61'),'ut',_0xf6a3('0x62'))[_0xf6a3('0x23')](_0xf6a3('0x63'),_0x19c15f[_0xf6a3('0x3a')]['id']);for(var _0x19944b=0x0;_0x19944b<_0x1adb82['length'];_0x19944b+=0x1){let _0x3f4aa1=_0x1adb82[_0x19944b];for(var _0x5d0282=0x0;_0x5d0282<_0x3f4aa1['Agents']['length'];_0x5d0282+=0x1){let _0x473cf5=_0x3f4aa1[_0xf6a3('0x52')][_0x5d0282];var _0x23a340=_0x1a5465[_0xf6a3('0x64')]();_0x23a340[_0xf6a3('0x23')]('ut.UserId\x20=\x20?',_0x473cf5['id']);_0x473276[_0xf6a3('0x65')](db[_0xf6a3('0x66')][_0xf6a3('0x2a')](_0x23a340[_0xf6a3('0x67')](),{'type':db[_0xf6a3('0x66')][_0xf6a3('0x68')][_0xf6a3('0x69')]})[_0xf6a3('0x15')](function(_0x2b9cda){if(_0x2b9cda[_0xf6a3('0x2f')]===0x1){return _0x473cf5['id'];}else{var _0x1d8759=_[_0xf6a3('0x6a')](_[_0xf6a3('0x1e')](_0x2b9cda,'TeamId'),function(_0x2f8f02){return _['includes'](_0x447c3c,_0x2f8f02);});if(_0x1d8759){return _0x473cf5['id'];}}}));}}return BPromise[_0xf6a3('0x6b')](_0x473276)[_0xf6a3('0x15')](function(_0x902c14){_0x25b98=_(_0x25b98)[_0xf6a3('0x6c')](_0x902c14)[_0xf6a3('0x6d')]()[_0xf6a3('0x6e')]();return db[_0xf6a3('0x1f')][_0xf6a3('0x32')]({'where':{'id':_0x19c15f[_0xf6a3('0x3a')]['id']}})[_0xf6a3('0x15')](function(_0x37860c){return db[_0xf6a3('0x66')][_0xf6a3('0x56')](function(_0x6d1dce){return _0x37860c[_0xf6a3('0x5b')](_0x19c15f[_0xf6a3('0x2a')][_0xf6a3('0x51')],{'transaction':_0x6d1dce})[_0xf6a3('0x15')](function(){if(!_[_0xf6a3('0x6f')](_0x25b98)){return _0x37860c[_0xf6a3('0x70')](_0x25b98,{'transaction':_0x6d1dce});}})[_0xf6a3('0x15')](function(){_0x25b98[_0xf6a3('0x58')](function(_0x17b7b4){socket['emit'](_0xf6a3('0x71'),{'UserId':_0x17b7b4,'ChatQueueId':_0x37860c['id']});});});});});});})[_0xf6a3('0x15')](respondWithStatusCode(_0x1135db,null))['catch'](handleError(_0x1135db,null));};exports[_0xf6a3('0x72')]=function(_0x3a0e98,_0x54a0cf){return db[_0xf6a3('0x1f')][_0xf6a3('0x32')]({'where':{'id':_0x3a0e98[_0xf6a3('0x3a')]['id']}})[_0xf6a3('0x15')](handleEntityNotFound(_0x54a0cf,null))[_0xf6a3('0x15')](function(_0x253e18){if(_0x253e18){return _0x253e18['addAgents'](_0x3a0e98[_0xf6a3('0x33')][_0xf6a3('0x51')],_[_0xf6a3('0x73')](_0x3a0e98[_0xf6a3('0x33')],[_0xf6a3('0x51'),'id'])||{})[_0xf6a3('0x74')](function(_0x1ce6a8){for(var _0x307589=0x0;_0x307589<_0x3a0e98[_0xf6a3('0x33')][_0xf6a3('0x51')]['length'];_0x307589+=0x1){socket[_0xf6a3('0x59')](_0xf6a3('0x5a'),{'UserId':Number(_0x3a0e98[_0xf6a3('0x33')]['ids'][_0x307589]),'ChatQueueId':Number(_0x3a0e98[_0xf6a3('0x3a')]['id'])});}return _0x1ce6a8;});}})[_0xf6a3('0x15')](respondWithResult(_0x54a0cf,null))['catch'](handleError(_0x54a0cf,null));};exports[_0xf6a3('0x70')]=function(_0x505324,_0x3df50c){return db[_0xf6a3('0x1f')][_0xf6a3('0x32')]({'where':{'id':_0x505324[_0xf6a3('0x3a')]['id']}})['then'](handleEntityNotFound(_0x3df50c,null))[_0xf6a3('0x15')](function(_0x30845c){if(_0x30845c){return _0x30845c[_0xf6a3('0x70')](_0x505324[_0xf6a3('0x2a')][_0xf6a3('0x51')])['then'](function(){if(_[_0xf6a3('0x75')](_0x505324[_0xf6a3('0x2a')][_0xf6a3('0x51')])){for(var _0x560978=0x0;_0x560978<_0x505324['query'][_0xf6a3('0x51')][_0xf6a3('0x2f')];_0x560978+=0x1){socket[_0xf6a3('0x59')]('userChatQueue:remove',{'UserId':Number(_0x505324['query'][_0xf6a3('0x51')][_0x560978]),'ChatQueueId':Number(_0x505324[_0xf6a3('0x3a')]['id'])});}}else{socket[_0xf6a3('0x59')]('userChatQueue:remove',{'UserId':Number(_0x505324[_0xf6a3('0x2a')][_0xf6a3('0x51')]),'ChatQueueId':Number(_0x505324[_0xf6a3('0x3a')]['id'])});}});}})[_0xf6a3('0x15')](respondWithStatusCode(_0x3df50c,null))[_0xf6a3('0x27')](handleError(_0x3df50c,null));};exports[_0xf6a3('0x76')]=function(_0x5dd19e,_0x5826d4){var _0x3aedf5={};var _0x5071da={};var _0x4b59b9;var _0x1d9777;return db[_0xf6a3('0x1f')][_0xf6a3('0x3c')]({'where':{'id':_0x5dd19e[_0xf6a3('0x3a')]['id']}})['then'](handleEntityNotFound(_0x5826d4,null))[_0xf6a3('0x15')](function(_0x38d7e2){if(_0x38d7e2){_0x4b59b9=_0x38d7e2;_0x5071da[_0xf6a3('0x28')]=_[_0xf6a3('0x29')](db[_0xf6a3('0x5c')]['rawAttributes']);_0x5071da['query']=_['keys'](_0x5dd19e[_0xf6a3('0x2a')]);_0x5071da[_0xf6a3('0x2b')]=_[_0xf6a3('0x2c')](_0x5071da[_0xf6a3('0x28')],_0x5071da[_0xf6a3('0x2a')]);_0x3aedf5[_0xf6a3('0x2d')]=_['intersection'](_0x5071da[_0xf6a3('0x28')],qs[_0xf6a3('0x2e')](_0x5dd19e[_0xf6a3('0x2a')][_0xf6a3('0x2e')]));_0x3aedf5['attributes']=_0x3aedf5[_0xf6a3('0x2d')][_0xf6a3('0x2f')]?_0x3aedf5[_0xf6a3('0x2d')]:_0x5071da['model'];_0x3aedf5[_0xf6a3('0x40')]=qs[_0xf6a3('0x41')](_0x5dd19e[_0xf6a3('0x2a')][_0xf6a3('0x41')]);_0x3aedf5['where']=qs['filters'](_['pick'](_0x5dd19e[_0xf6a3('0x2a')],_0x5071da[_0xf6a3('0x2b')]));if(_0x5dd19e[_0xf6a3('0x2a')][_0xf6a3('0x44')]){_0x3aedf5['where']=_['merge'](_0x3aedf5[_0xf6a3('0x23')],{'$or':_[_0xf6a3('0x1e')](_0x3aedf5[_0xf6a3('0x2d')],function(_0x6efc67){var _0x29cf91={};_0x29cf91[_0x6efc67]={'$like':'%'+_0x5dd19e[_0xf6a3('0x2a')][_0xf6a3('0x44')]+'%'};return _0x29cf91;})});}_0x3aedf5=_[_0xf6a3('0x30')]({},_0x3aedf5,_0x5dd19e['options']);return _0x4b59b9[_0xf6a3('0x76')](_0x3aedf5);}})['then'](function(_0x45f62b){if(_0x45f62b){_0x1d9777=_0x45f62b[_0xf6a3('0x2f')];if(!_0x5dd19e[_0xf6a3('0x2a')][_0xf6a3('0x3e')]('nolimit')){_0x3aedf5[_0xf6a3('0x10')]=qs['limit'](_0x5dd19e[_0xf6a3('0x2a')][_0xf6a3('0x10')]);_0x3aedf5[_0xf6a3('0xe')]=qs[_0xf6a3('0xe')](_0x5dd19e[_0xf6a3('0x2a')]['offset']);}return _0x4b59b9['getAgents'](_0x3aedf5);}})[_0xf6a3('0x15')](function(_0xd70b29){if(_0xd70b29){return _0xd70b29?{'count':_0x1d9777,'rows':_0xd70b29}:null;}})[_0xf6a3('0x15')](respondWithResult(_0x5826d4,null))[_0xf6a3('0x27')](handleError(_0x5826d4,null));}; \ No newline at end of file +var _0x281f=['then','destroy','get','UserProfileResource','end','error','stack','name','index','map','rawAttributes','fieldName','type','key','getOptions','where','ChatQueue','include','query','show','params','model','keys','filters','attributes','intersection','fields','length','includeAll','merge','find','catch','create','body','user','role','ChatQueues','UserProfileSection','userProfileId','autoAssociation','update','describe','getMembers','UserChatQueue','nolimit','order','sort','pick','ChatQueueId','filter','findAll','User','findAndCountAll','UserId','chatPause','updatedAt','rows','%s/%s','SIP','createdAt','getTeams','findOne','Team','options','hasOwnProperty','addTeams','ids','Agents','voicePause','interface','flatMap','sequelize','transaction','findOrCreate','forEach','emit','userChatQueue:save','removeTeams','select','field','tq.TeamId','from','join','user_has_teams','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','every','TeamId','union','compact','removeAgents','userChatQueue:remove','addAgents','omit','spread','isArray','getAgents','bluebird','util','squel','ioredis','../../config/logger','api','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','register','sendStatus','status','undefined','limit','count','offset','set','Content-Range','json'];(function(_0x2c87a2,_0x4fb828){var _0x57a18a=function(_0x2e4462){while(--_0x2e4462){_0x2c87a2['push'](_0x2c87a2['shift']());}};_0x57a18a(++_0x4fb828);}(_0x281f,0x1d6));var _0xf281=function(_0x433a86,_0x175b5c){_0x433a86=_0x433a86-0x0;var _0x23000c=_0x281f[_0x433a86];return _0x23000c;};'use strict';var BPromise=require(_0xf281('0x0'));var util=require(_0xf281('0x1'));var _=require('lodash');var squel=require(_0xf281('0x2'));var Redis=require(_0xf281('0x3'));var qs=require('../../components/parsers/qs');var logger=require(_0xf281('0x4'))(_0xf281('0x5'));var config=require('../../config/environment');var db=require(_0xf281('0x6'))['db'];config[_0xf281('0x7')]=_[_0xf281('0x8')](config['redis'],{'host':_0xf281('0x9'),'port':0x18eb});var socket=require(_0xf281('0xa'))(new Redis(config[_0xf281('0x7')]));require(_0xf281('0xb'))[_0xf281('0xc')](socket);function respondWithStatusCode(_0x5286b2,_0x418a29){_0x418a29=_0x418a29||0xcc;return function(_0x17f6b9){if(_0x17f6b9){return _0x5286b2[_0xf281('0xd')](_0x418a29);}return _0x5286b2['status'](_0x418a29)['end']();};}function respondWithResult(_0x1d356b,_0x31dcbd){_0x31dcbd=_0x31dcbd||0xc8;return function(_0x4f6493){if(_0x4f6493){return _0x1d356b[_0xf281('0xe')](_0x31dcbd)['json'](_0x4f6493);}};}function respondWithFilteredResult(_0x56da49,_0xad3011){return function(_0x21a164){if(_0x21a164){var _0x598de7=typeof _0xad3011['offset']===_0xf281('0xf')&&typeof _0xad3011[_0xf281('0x10')]===_0xf281('0xf');var _0x284b9b=_0x21a164[_0xf281('0x11')];var _0x321b74=_0x598de7?0x0:_0xad3011[_0xf281('0x12')];var _0x27cec2=_0x598de7?_0x21a164[_0xf281('0x11')]:_0xad3011['offset']+_0xad3011[_0xf281('0x10')];var _0x417844;if(_0x27cec2>=_0x284b9b){_0x27cec2=_0x284b9b;_0x417844=0xc8;}else{_0x417844=0xce;}_0x56da49[_0xf281('0xe')](_0x417844);return _0x56da49[_0xf281('0x13')](_0xf281('0x14'),_0x321b74+'-'+_0x27cec2+'/'+_0x284b9b)[_0xf281('0x15')](_0x21a164);}return null;};}function saveUpdates(_0x3d4857){return function(_0x18abdc){if(_0x18abdc){return _0x18abdc['update'](_0x3d4857)[_0xf281('0x16')](function(_0x2b3ce8){return _0x2b3ce8;});}return null;};}function removeEntity(_0x43f90b){return function(_0x65f3e0){if(_0x65f3e0){return _0x65f3e0[_0xf281('0x17')]()['then'](function(){var _0x2329f9=_0x65f3e0[_0xf281('0x18')]({'plain':!![]});var _0x475908='ChatQueues';return db[_0xf281('0x19')][_0xf281('0x17')]({'where':{'type':_0x475908,'resourceId':_0x2329f9['id']}})[_0xf281('0x16')](function(){return _0x65f3e0;});})[_0xf281('0x16')](function(){_0x43f90b[_0xf281('0xe')](0xcc)[_0xf281('0x1a')]();});}};}function handleEntityNotFound(_0x27e0cb){return function(_0x1fd8bf){if(!_0x1fd8bf){_0x27e0cb[_0xf281('0xd')](0x194);}return _0x1fd8bf;};}function handleError(_0x275f20,_0x12cd45){_0x12cd45=_0x12cd45||0x1f4;return function(_0x12337f){logger[_0xf281('0x1b')](_0x12337f[_0xf281('0x1c')]);if(_0x12337f[_0xf281('0x1d')]){delete _0x12337f[_0xf281('0x1d')];}_0x275f20[_0xf281('0xe')](_0x12cd45)['send'](_0x12337f);};}exports[_0xf281('0x1e')]=function(_0x263490,_0xcddc92){var _0x5d558e={};var _0x3b2c7d={'count':0x0,'rows':[]};var _0x235d2b=_[_0xf281('0x1f')](db['ChatQueue'][_0xf281('0x20')],function(_0x492a7f){return{'name':_0x492a7f[_0xf281('0x21')],'type':_0x492a7f[_0xf281('0x22')][_0xf281('0x23')]};});_0x5d558e=qs[_0xf281('0x24')](_0x235d2b,_0x263490);var _0x3cf63d={'where':_0x5d558e[_0xf281('0x25')]};return db[_0xf281('0x26')][_0xf281('0x11')](_0x3cf63d)['then'](function(_0x586b16){_0x3b2c7d['count']=_0x586b16;_0x5d558e[_0xf281('0x27')]=qs[_0xf281('0x27')](_0x263490[_0xf281('0x28')]);return db[_0xf281('0x26')]['findAll'](_0x5d558e);})[_0xf281('0x16')](function(_0x1192de){_0x3b2c7d['rows']=_0x1192de;return _0x3b2c7d;})[_0xf281('0x16')](respondWithFilteredResult(_0xcddc92,_0x5d558e))['catch'](handleError(_0xcddc92,null));};exports[_0xf281('0x29')]=function(_0x11bbf9,_0x5e57e9){var _0x5ca3ca={'raw':!![],'where':{'id':_0x11bbf9[_0xf281('0x2a')]['id']}},_0xa346a4={};_0xa346a4[_0xf281('0x2b')]=_[_0xf281('0x2c')](db[_0xf281('0x26')][_0xf281('0x20')]);_0xa346a4[_0xf281('0x28')]=_['keys'](_0x11bbf9[_0xf281('0x28')]);_0xa346a4[_0xf281('0x2d')]=_['intersection'](_0xa346a4[_0xf281('0x2b')],_0xa346a4[_0xf281('0x28')]);_0x5ca3ca[_0xf281('0x2e')]=_[_0xf281('0x2f')](_0xa346a4['model'],qs[_0xf281('0x30')](_0x11bbf9[_0xf281('0x28')][_0xf281('0x30')]));_0x5ca3ca[_0xf281('0x2e')]=_0x5ca3ca['attributes'][_0xf281('0x31')]?_0x5ca3ca['attributes']:_0xa346a4[_0xf281('0x2b')];if(_0x11bbf9[_0xf281('0x28')][_0xf281('0x32')]){_0x5ca3ca[_0xf281('0x27')]=[{'all':!![]}];}_0x5ca3ca=_[_0xf281('0x33')]({},_0x5ca3ca,_0x11bbf9['options']);return db[_0xf281('0x26')][_0xf281('0x34')](_0x5ca3ca)[_0xf281('0x16')](handleEntityNotFound(_0x5e57e9,null))['then'](respondWithResult(_0x5e57e9,null))[_0xf281('0x35')](handleError(_0x5e57e9,null));};exports[_0xf281('0x36')]=function(_0x1e0c15,_0x5c1e8b){return db[_0xf281('0x26')]['create'](_0x1e0c15[_0xf281('0x37')],{})[_0xf281('0x16')](function(_0x3814c1){var _0x54880b=_0x1e0c15[_0xf281('0x38')][_0xf281('0x18')]({'plain':!![]});if(!_0x54880b)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x54880b[_0xf281('0x39')]==='user'){var _0x41f5de=_0x3814c1[_0xf281('0x18')]({'plain':!![]});var _0x496a11=_0xf281('0x3a');return db[_0xf281('0x3b')][_0xf281('0x34')]({'where':{'name':_0x496a11,'userProfileId':_0x54880b[_0xf281('0x3c')]},'raw':!![]})[_0xf281('0x16')](function(_0x4dada5){if(_0x4dada5&&_0x4dada5[_0xf281('0x3d')]===0x0){return db[_0xf281('0x19')][_0xf281('0x36')]({'name':_0x41f5de[_0xf281('0x1d')],'resourceId':_0x41f5de['id'],'type':_0x4dada5['name'],'sectionId':_0x4dada5['id']},{})[_0xf281('0x16')](function(){return _0x3814c1;});}else{return _0x3814c1;}})[_0xf281('0x35')](function(_0x5141eb){logger[_0xf281('0x1b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5141eb);throw _0x5141eb;});}return _0x3814c1;})[_0xf281('0x16')](respondWithResult(_0x5c1e8b,0xc9))[_0xf281('0x35')](handleError(_0x5c1e8b,null));};exports[_0xf281('0x3e')]=function(_0x596779,_0x11b7f9){if(_0x596779[_0xf281('0x37')]['id']){delete _0x596779[_0xf281('0x37')]['id'];}return db[_0xf281('0x26')][_0xf281('0x34')]({'where':{'id':_0x596779['params']['id']}})['then'](handleEntityNotFound(_0x11b7f9,null))[_0xf281('0x16')](saveUpdates(_0x596779[_0xf281('0x37')],null))[_0xf281('0x16')](respondWithResult(_0x11b7f9,null))[_0xf281('0x35')](handleError(_0x11b7f9,null));};exports[_0xf281('0x17')]=function(_0x46f00b,_0x50908a){return db[_0xf281('0x26')]['find']({'where':{'id':_0x46f00b['params']['id']}})[_0xf281('0x16')](handleEntityNotFound(_0x50908a,null))[_0xf281('0x16')](removeEntity(_0x50908a,null))[_0xf281('0x35')](handleError(_0x50908a,null));};exports[_0xf281('0x3f')]=function(_0x131ad5,_0x1e4421){return db['ChatQueue']['describe']()[_0xf281('0x16')](respondWithResult(_0x1e4421,null))['catch'](handleError(_0x1e4421,null));};exports[_0xf281('0x40')]=function(_0x1903f7,_0x43969a){var _0xf46958={'raw':!![],'where':{}},_0x295a1c={},_0x32ac31;return db[_0xf281('0x26')]['findOne']({'where':{'id':_0x1903f7[_0xf281('0x2a')]['id']}})[_0xf281('0x16')](handleEntityNotFound(_0x43969a,null))[_0xf281('0x16')](function(_0x349b64){if(_0x349b64){_0x32ac31=_0x349b64[_0xf281('0x18')]({'plain':!![]});_0x295a1c[_0xf281('0x2b')]=_[_0xf281('0x2c')](db[_0xf281('0x41')][_0xf281('0x20')]);_0x295a1c[_0xf281('0x28')]=_['keys'](_0x1903f7[_0xf281('0x28')]);_0x295a1c[_0xf281('0x2d')]=_[_0xf281('0x2f')](_0x295a1c[_0xf281('0x2b')],_0x295a1c['query']);_0xf46958[_0xf281('0x2e')]=_[_0xf281('0x2f')](_0x295a1c['model'],qs[_0xf281('0x30')](_0x1903f7[_0xf281('0x28')][_0xf281('0x30')]));_0xf46958[_0xf281('0x2e')]=_0xf46958[_0xf281('0x2e')][_0xf281('0x31')]?_0xf46958['attributes']:_0x295a1c[_0xf281('0x2b')];if(!_0x1903f7[_0xf281('0x28')]['hasOwnProperty'](_0xf281('0x42'))){_0xf46958['limit']=qs['limit'](_0x1903f7[_0xf281('0x28')][_0xf281('0x10')]);_0xf46958[_0xf281('0x12')]=qs['offset'](_0x1903f7[_0xf281('0x28')][_0xf281('0x12')]);}_0xf46958[_0xf281('0x43')]=qs[_0xf281('0x44')](_0x1903f7[_0xf281('0x28')][_0xf281('0x44')]);_0xf46958[_0xf281('0x25')]=qs[_0xf281('0x2d')](_[_0xf281('0x45')](_0x1903f7[_0xf281('0x28')],_0x295a1c[_0xf281('0x2d')]));_0xf46958[_0xf281('0x25')][_0xf281('0x46')]=_0x349b64['id'];if(_0x1903f7[_0xf281('0x28')]['filter']){_0xf46958[_0xf281('0x25')]=_['merge'](_0xf46958[_0xf281('0x25')],{'$or':_[_0xf281('0x1f')](_0xf46958[_0xf281('0x2e')],function(_0x11ee10){var _0x1dff4e={};_0x1dff4e[_0x11ee10]={'$like':'%'+_0x1903f7[_0xf281('0x28')][_0xf281('0x47')]+'%'};return _0x1dff4e;})});}_0xf46958=_[_0xf281('0x33')]({},_0xf46958,_0x1903f7['options']);return db[_0xf281('0x41')][_0xf281('0x48')](_0xf46958);}})[_0xf281('0x16')](function(_0x3a4573){if(_0x3a4573){return db[_0xf281('0x49')][_0xf281('0x4a')]({'where':{'id':_['map'](_0x3a4573,_0xf281('0x4b')),'role':'agent'},'attributes':['id',_0xf281('0x1d'),_0xf281('0x4c'),_0xf281('0x4d'),'createdAt']});}})[_0xf281('0x16')](function(_0x3d3a02){if(_0x3d3a02){return{'count':_0x3d3a02['count'],'rows':_[_0xf281('0x1f')](_0x3d3a02[_0xf281('0x4e')],function(_0x29ab5d){return{'membername':_0x29ab5d['name'],'UserId':_0x29ab5d['id'],'queue_name':_0x32ac31['name'],'ChatQueueId':_0x32ac31['id'],'interface':util['format'](_0xf281('0x4f'),_0xf281('0x50'),_0x29ab5d[_0xf281('0x1d')]),'penalty':0x0,'paused':_0x29ab5d[_0xf281('0x4c')],'createdAt':_0x29ab5d[_0xf281('0x51')],'updatedAt':_0x29ab5d[_0xf281('0x4d')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xf281('0x16')](respondWithFilteredResult(_0x43969a,_0xf46958))[_0xf281('0x35')](handleError(_0x43969a,null));};exports[_0xf281('0x52')]=function(_0x44f7b7,_0xe8588){var _0x231a8a={};var _0x49e3d7={};var _0x226194;var _0x49a3ba;return db[_0xf281('0x26')][_0xf281('0x53')]({'where':{'id':_0x44f7b7[_0xf281('0x2a')]['id']}})['then'](handleEntityNotFound(_0xe8588,null))['then'](function(_0x2108d6){if(_0x2108d6){_0x226194=_0x2108d6;_0x49e3d7[_0xf281('0x2b')]=_[_0xf281('0x2c')](db[_0xf281('0x54')]['rawAttributes']);_0x49e3d7[_0xf281('0x28')]=_[_0xf281('0x2c')](_0x44f7b7[_0xf281('0x28')]);_0x49e3d7[_0xf281('0x2d')]=_[_0xf281('0x2f')](_0x49e3d7[_0xf281('0x2b')],_0x49e3d7[_0xf281('0x28')]);_0x231a8a[_0xf281('0x2e')]=_[_0xf281('0x2f')](_0x49e3d7[_0xf281('0x2b')],qs[_0xf281('0x30')](_0x44f7b7[_0xf281('0x28')][_0xf281('0x30')]));_0x231a8a[_0xf281('0x2e')]=_0x231a8a['attributes'][_0xf281('0x31')]?_0x231a8a[_0xf281('0x2e')]:_0x49e3d7['model'];_0x231a8a[_0xf281('0x43')]=qs[_0xf281('0x44')](_0x44f7b7[_0xf281('0x28')][_0xf281('0x44')]);_0x231a8a['where']=qs[_0xf281('0x2d')](_['pick'](_0x44f7b7[_0xf281('0x28')],_0x49e3d7[_0xf281('0x2d')]));if(_0x44f7b7[_0xf281('0x28')]['filter']){_0x231a8a[_0xf281('0x25')]=_['merge'](_0x231a8a[_0xf281('0x25')],{'$or':_['map'](_0x231a8a[_0xf281('0x2e')],function(_0x1ba5c3){var _0x295205={};_0x295205[_0x1ba5c3]={'$like':'%'+_0x44f7b7[_0xf281('0x28')][_0xf281('0x47')]+'%'};return _0x295205;})});}_0x231a8a=_[_0xf281('0x33')]({},_0x231a8a,_0x44f7b7[_0xf281('0x55')]);return _0x226194['getTeams'](_0x231a8a);}})[_0xf281('0x16')](function(_0x2f3704){if(_0x2f3704){_0x49a3ba=_0x2f3704[_0xf281('0x31')];if(!_0x44f7b7['query'][_0xf281('0x56')](_0xf281('0x42'))){_0x231a8a[_0xf281('0x10')]=qs[_0xf281('0x10')](_0x44f7b7[_0xf281('0x28')][_0xf281('0x10')]);_0x231a8a[_0xf281('0x12')]=qs['offset'](_0x44f7b7[_0xf281('0x28')][_0xf281('0x12')]);}return _0x226194[_0xf281('0x52')](_0x231a8a);}})[_0xf281('0x16')](function(_0x3eced8){if(_0x3eced8){return _0x3eced8?{'count':_0x49a3ba,'rows':_0x3eced8}:null;}})['then'](respondWithResult(_0xe8588,null))[_0xf281('0x35')](handleError(_0xe8588,null));};exports[_0xf281('0x57')]=function(_0x3a5144,_0x4b9490){var _0x4225a3=_0x3a5144[_0xf281('0x37')][_0xf281('0x58')];return db[_0xf281('0x54')]['findAll']({'where':{'id':_0x4225a3},'attributes':['id'],'include':[{'model':db['User'],'as':_0xf281('0x59'),'attributes':['id',_0xf281('0x1d'),'online',_0xf281('0x5a'),_0xf281('0x5b')],'raw':!![]}]})[_0xf281('0x16')](function(_0x7784b7){if(_0x7784b7){var _0x2e0dd3=_[_0xf281('0x5c')](_0x7784b7,function(_0x10d682){var _0x48bd51=_0x10d682[_0xf281('0x18')]({'plain':!![]});return _0x48bd51[_0xf281('0x59')];});return db[_0xf281('0x26')][_0xf281('0x34')]({'where':{'id':_0x3a5144['params']['id']}})[_0xf281('0x16')](function(_0x483e9d){return db[_0xf281('0x5d')][_0xf281('0x5e')](function(_0x7455f2){return _0x483e9d['addTeams'](_0x4225a3,{'transaction':_0x7455f2})[_0xf281('0x16')](function(){return BPromise['each'](_0x2e0dd3,function(_0x6ec24f){return db['UserChatQueue'][_0xf281('0x5f')]({'where':{'UserId':_0x6ec24f['id'],'ChatQueueId':_0x3a5144[_0xf281('0x2a')]['id']},'transaction':_0x7455f2});});})[_0xf281('0x16')](function(){_0x2e0dd3[_0xf281('0x60')](function(_0x342fbb){socket[_0xf281('0x61')](_0xf281('0x62'),{'UserId':_0x342fbb['id'],'ChatQueueId':_0x483e9d['id']});});});});});}})[_0xf281('0x16')](respondWithStatusCode(_0x4b9490,null))['catch'](handleError(_0x4b9490,null));};exports[_0xf281('0x63')]=function(_0x32612e,_0x112794){return db['Team']['findAll']({'where':{'id':_0x32612e[_0xf281('0x28')][_0xf281('0x58')]},'attributes':['id'],'include':[{'model':db[_0xf281('0x49')],'as':_0xf281('0x59'),'attributes':['id'],'raw':!![]}]})[_0xf281('0x16')](handleEntityNotFound(_0x112794,null))[_0xf281('0x16')](function(_0x240d6c){var _0x531a84=_[_0xf281('0x1f')](_0x240d6c,'id');var _0x504d59=[];var _0x41bc84=[];var _0x40da57=squel[_0xf281('0x64')]();_0x40da57[_0xf281('0x65')](_0xf281('0x66'))[_0xf281('0x67')]('team_has_chat_queues','tq')[_0xf281('0x68')](_0xf281('0x69'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0xf281('0x25')](_0xf281('0x6a'),_0x32612e[_0xf281('0x2a')]['id']);for(var _0x36cfd7=0x0;_0x36cfd7<_0x240d6c['length'];_0x36cfd7+=0x1){let _0x6c17cd=_0x240d6c[_0x36cfd7];for(var _0x587b44=0x0;_0x587b44<_0x6c17cd[_0xf281('0x59')]['length'];_0x587b44+=0x1){let _0x519dda=_0x6c17cd[_0xf281('0x59')][_0x587b44];var _0x2fb1f1=_0x40da57[_0xf281('0x6b')]();_0x2fb1f1[_0xf281('0x25')](_0xf281('0x6c'),_0x519dda['id']);_0x41bc84['push'](db['sequelize'][_0xf281('0x28')](_0x2fb1f1[_0xf281('0x6d')](),{'type':db[_0xf281('0x5d')][_0xf281('0x6e')][_0xf281('0x6f')]})[_0xf281('0x16')](function(_0xa1c5d9){if(_0xa1c5d9[_0xf281('0x31')]===0x1){return _0x519dda['id'];}else{var _0x36de28=_[_0xf281('0x70')](_[_0xf281('0x1f')](_0xa1c5d9,_0xf281('0x71')),function(_0x61b992){return _['includes'](_0x531a84,_0x61b992);});if(_0x36de28){return _0x519dda['id'];}}}));}}return BPromise['all'](_0x41bc84)['then'](function(_0x229417){_0x504d59=_(_0x504d59)[_0xf281('0x72')](_0x229417)[_0xf281('0x73')]()['value']();return db['ChatQueue'][_0xf281('0x34')]({'where':{'id':_0x32612e['params']['id']}})[_0xf281('0x16')](function(_0x5f5df3){return db[_0xf281('0x5d')][_0xf281('0x5e')](function(_0x544f99){return _0x5f5df3[_0xf281('0x63')](_0x32612e[_0xf281('0x28')][_0xf281('0x58')],{'transaction':_0x544f99})[_0xf281('0x16')](function(){if(!_['isEmpty'](_0x504d59)){return _0x5f5df3[_0xf281('0x74')](_0x504d59,{'transaction':_0x544f99});}})[_0xf281('0x16')](function(){_0x504d59[_0xf281('0x60')](function(_0x8a27ea){socket[_0xf281('0x61')](_0xf281('0x75'),{'UserId':_0x8a27ea,'ChatQueueId':_0x5f5df3['id']});});});});});});})[_0xf281('0x16')](respondWithStatusCode(_0x112794,null))[_0xf281('0x35')](handleError(_0x112794,null));};exports[_0xf281('0x76')]=function(_0x48e04b,_0x43216f){return db[_0xf281('0x26')][_0xf281('0x34')]({'where':{'id':_0x48e04b[_0xf281('0x2a')]['id']}})['then'](handleEntityNotFound(_0x43216f,null))[_0xf281('0x16')](function(_0x135af9){if(_0x135af9){return _0x135af9[_0xf281('0x76')](_0x48e04b[_0xf281('0x37')][_0xf281('0x58')],_[_0xf281('0x77')](_0x48e04b[_0xf281('0x37')],[_0xf281('0x58'),'id'])||{})[_0xf281('0x78')](function(_0x5ddef6){for(var _0x11da01=0x0;_0x11da01<_0x48e04b['body']['ids'][_0xf281('0x31')];_0x11da01+=0x1){socket[_0xf281('0x61')](_0xf281('0x62'),{'UserId':Number(_0x48e04b['body'][_0xf281('0x58')][_0x11da01]),'ChatQueueId':Number(_0x48e04b[_0xf281('0x2a')]['id'])});}return _0x5ddef6;});}})[_0xf281('0x16')](respondWithResult(_0x43216f,null))[_0xf281('0x35')](handleError(_0x43216f,null));};exports[_0xf281('0x74')]=function(_0x29ba37,_0x4c72f5){return db[_0xf281('0x26')][_0xf281('0x34')]({'where':{'id':_0x29ba37[_0xf281('0x2a')]['id']}})[_0xf281('0x16')](handleEntityNotFound(_0x4c72f5,null))[_0xf281('0x16')](function(_0x2e057c){if(_0x2e057c){return _0x2e057c[_0xf281('0x74')](_0x29ba37['query'][_0xf281('0x58')])[_0xf281('0x16')](function(){if(_[_0xf281('0x79')](_0x29ba37[_0xf281('0x28')][_0xf281('0x58')])){for(var _0x4ee4ee=0x0;_0x4ee4ee<_0x29ba37[_0xf281('0x28')][_0xf281('0x58')][_0xf281('0x31')];_0x4ee4ee+=0x1){socket['emit']('userChatQueue:remove',{'UserId':Number(_0x29ba37[_0xf281('0x28')][_0xf281('0x58')][_0x4ee4ee]),'ChatQueueId':Number(_0x29ba37[_0xf281('0x2a')]['id'])});}}else{socket['emit']('userChatQueue:remove',{'UserId':Number(_0x29ba37[_0xf281('0x28')][_0xf281('0x58')]),'ChatQueueId':Number(_0x29ba37['params']['id'])});}});}})['then'](respondWithStatusCode(_0x4c72f5,null))[_0xf281('0x35')](handleError(_0x4c72f5,null));};exports[_0xf281('0x7a')]=function(_0x27386b,_0x3021a1){var _0x3787c6={};var _0x273fef={};var _0x24edd3;var _0x39f954;return db[_0xf281('0x26')]['findOne']({'where':{'id':_0x27386b[_0xf281('0x2a')]['id']}})[_0xf281('0x16')](handleEntityNotFound(_0x3021a1,null))[_0xf281('0x16')](function(_0x55dee5){if(_0x55dee5){_0x24edd3=_0x55dee5;_0x273fef[_0xf281('0x2b')]=_[_0xf281('0x2c')](db[_0xf281('0x49')][_0xf281('0x20')]);_0x273fef[_0xf281('0x28')]=_[_0xf281('0x2c')](_0x27386b[_0xf281('0x28')]);_0x273fef[_0xf281('0x2d')]=_[_0xf281('0x2f')](_0x273fef[_0xf281('0x2b')],_0x273fef[_0xf281('0x28')]);_0x3787c6[_0xf281('0x2e')]=_['intersection'](_0x273fef[_0xf281('0x2b')],qs['fields'](_0x27386b[_0xf281('0x28')][_0xf281('0x30')]));_0x3787c6['attributes']=_0x3787c6[_0xf281('0x2e')]['length']?_0x3787c6[_0xf281('0x2e')]:_0x273fef[_0xf281('0x2b')];_0x3787c6['order']=qs['sort'](_0x27386b['query'][_0xf281('0x44')]);_0x3787c6[_0xf281('0x25')]=qs['filters'](_[_0xf281('0x45')](_0x27386b[_0xf281('0x28')],_0x273fef['filters']));if(_0x27386b[_0xf281('0x28')][_0xf281('0x47')]){_0x3787c6[_0xf281('0x25')]=_[_0xf281('0x33')](_0x3787c6[_0xf281('0x25')],{'$or':_[_0xf281('0x1f')](_0x3787c6[_0xf281('0x2e')],function(_0x3a62a9){var _0x3de9d9={};_0x3de9d9[_0x3a62a9]={'$like':'%'+_0x27386b[_0xf281('0x28')][_0xf281('0x47')]+'%'};return _0x3de9d9;})});}_0x3787c6=_[_0xf281('0x33')]({},_0x3787c6,_0x27386b['options']);return _0x24edd3['getAgents'](_0x3787c6);}})[_0xf281('0x16')](function(_0x166e37){if(_0x166e37){_0x39f954=_0x166e37[_0xf281('0x31')];if(!_0x27386b[_0xf281('0x28')]['hasOwnProperty'](_0xf281('0x42'))){_0x3787c6[_0xf281('0x10')]=qs[_0xf281('0x10')](_0x27386b[_0xf281('0x28')]['limit']);_0x3787c6[_0xf281('0x12')]=qs['offset'](_0x27386b[_0xf281('0x28')][_0xf281('0x12')]);}return _0x24edd3['getAgents'](_0x3787c6);}})[_0xf281('0x16')](function(_0x3b12ce){if(_0x3b12ce){return _0x3b12ce?{'count':_0x39f954,'rows':_0x3b12ce}:null;}})['then'](respondWithResult(_0x3021a1,null))[_0xf281('0x35')](handleError(_0x3021a1,null));}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js index db2925e..234c103 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 _0xcd26=['ChatQueue','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x5ddaac,_0x2697a8){var _0x2a9c58=function(_0x851032){while(--_0x851032){_0x5ddaac['push'](_0x5ddaac['shift']());}};_0x2a9c58(++_0x2697a8);}(_0xcd26,0x106));var _0x6cd2=function(_0xa1e3e3,_0x29fe0e){_0xa1e3e3=_0xa1e3e3-0x0;var _0xc980e9=_0xcd26[_0xa1e3e3];return _0xc980e9;};'use strict';var EventEmitter=require(_0x6cd2('0x0'));var ChatQueue=require(_0x6cd2('0x1'))['db'][_0x6cd2('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x6cd2('0x3')](0x0);var events={'afterCreate':_0x6cd2('0x4'),'afterUpdate':_0x6cd2('0x5'),'afterDestroy':_0x6cd2('0x6')};function emitEvent(_0x9a01c4){return function(_0x4f85ed,_0xd638e2,_0x1c2908){ChatQueueEvents[_0x6cd2('0x7')](_0x9a01c4+':'+_0x4f85ed['id'],_0x4f85ed);ChatQueueEvents['emit'](_0x9a01c4,_0x4f85ed);_0x1c2908(null);};}for(var e in events){if(events[_0x6cd2('0x8')](e)){var event=events[e];ChatQueue[_0x6cd2('0x9')](e,emitEvent(event));}}module[_0x6cd2('0xa')]=ChatQueueEvents; \ No newline at end of file +var _0xd877=['hasOwnProperty','hook','exports','ChatQueue','save','emit'];(function(_0x2f9bac,_0x15aac9){var _0x5da607=function(_0x48256d){while(--_0x48256d){_0x2f9bac['push'](_0x2f9bac['shift']());}};_0x5da607(++_0x15aac9);}(_0xd877,0xcf));var _0x7d87=function(_0x2763f2,_0x416af8){_0x2763f2=_0x2763f2-0x0;var _0x3ef471=_0xd877[_0x2763f2];return _0x3ef471;};'use strict';var EventEmitter=require('events');var ChatQueue=require('../../mysqldb')['db'][_0x7d87('0x0')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x7d87('0x1'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x40932d){return function(_0x42b755,_0x3b8cd7,_0x14a797){ChatQueueEvents[_0x7d87('0x2')](_0x40932d+':'+_0x42b755['id'],_0x42b755);ChatQueueEvents['emit'](_0x40932d,_0x42b755);_0x14a797(null);};}for(var e in events){if(events[_0x7d87('0x3')](e)){var event=events[e];ChatQueue[_0x7d87('0x4')](e,emitEvent(event));}}module[_0x7d87('0x5')]=ChatQueueEvents; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js index 418f6b0..7551a6b 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 _0x8d87=['request-promise','rimraf','../../config/environment','./chatQueue.attributes','exports','define','chat_queues','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x4a71f5,_0x401424){var _0x27162f=function(_0x2e9c0d){while(--_0x2e9c0d){_0x4a71f5['push'](_0x4a71f5['shift']());}};_0x27162f(++_0x401424);}(_0x8d87,0x166));var _0x78d8=function(_0x524bf9,_0x47462b){_0x524bf9=_0x524bf9-0x0;var _0x550148=_0x8d87[_0x524bf9];return _0x550148;};'use strict';var _=require(_0x78d8('0x0'));var util=require(_0x78d8('0x1'));var logger=require(_0x78d8('0x2'))(_0x78d8('0x3'));var moment=require(_0x78d8('0x4'));var BPromise=require(_0x78d8('0x5'));var rp=require(_0x78d8('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x78d8('0x7'));var config=require(_0x78d8('0x8'));var attributes=require(_0x78d8('0x9'));module[_0x78d8('0xa')]=function(_0x5d222f,_0x153dbe){return _0x5d222f[_0x78d8('0xb')]('ChatQueue',attributes,{'tableName':_0x78d8('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2451=['chat_queues','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./chatQueue.attributes','exports','ChatQueue'];(function(_0x177749,_0x450871){var _0x33daa2=function(_0x44ba96){while(--_0x44ba96){_0x177749['push'](_0x177749['shift']());}};_0x33daa2(++_0x450871);}(_0x2451,0x146));var _0x1245=function(_0x10dc60,_0x2fcce1){_0x10dc60=_0x10dc60-0x0;var _0x47dec5=_0x2451[_0x10dc60];return _0x47dec5;};'use strict';var _=require(_0x1245('0x0'));var util=require(_0x1245('0x1'));var logger=require(_0x1245('0x2'))(_0x1245('0x3'));var moment=require(_0x1245('0x4'));var BPromise=require('bluebird');var rp=require(_0x1245('0x5'));var fs=require('fs');var path=require(_0x1245('0x6'));var rimraf=require(_0x1245('0x7'));var config=require(_0x1245('0x8'));var attributes=require(_0x1245('0x9'));module[_0x1245('0xa')]=function(_0x3941ae,_0x36f8cd){return _0x3941ae['define'](_0x1245('0xb'),attributes,{'tableName':_0x1245('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.rpc.js b/server/api/chatQueue/chatQueue.rpc.js index 78ade55..00bc955 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 _0xaaee=['find','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','register','request','then','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ChatQueue,\x20%s,\x20%s','info','catch','ChatQueue','findAll','raw','where','options','attributes','limit','include','model','map','GetChatQueue','ShowChatQueue'];(function(_0x37b29d,_0x5801b4){var _0x195f79=function(_0x512113){while(--_0x512113){_0x37b29d['push'](_0x37b29d['shift']());}};_0x195f79(++_0x5801b4);}(_0xaaee,0xa9));var _0xeaae=function(_0x18198a,_0x585f26){_0x18198a=_0x18198a-0x0;var _0x25987d=_0xaaee[_0x18198a];return _0x25987d;};'use strict';var _=require(_0xeaae('0x0'));var util=require('util');var moment=require(_0xeaae('0x1'));var BPromise=require(_0xeaae('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xeaae('0x3'));var db=require(_0xeaae('0x4'))['db'];var utils=require(_0xeaae('0x5'));var logger=require(_0xeaae('0x6'))('rpc');var config=require(_0xeaae('0x7'));var jayson=require(_0xeaae('0x8'));var client=jayson[_0xeaae('0x9')][_0xeaae('0xa')]({'port':0x232a});config[_0xeaae('0xb')]=_[_0xeaae('0xc')](config['redis'],{'host':_0xeaae('0xd'),'port':0x18eb});var socket=require(_0xeaae('0xe'))(new Redis(config[_0xeaae('0xb')]));require(_0xeaae('0xf'))[_0xeaae('0x10')](socket);function respondWithRpcPromise(_0x4ecb5c,_0x41babf,_0x2cfa0d){return new BPromise(function(_0x592993,_0x494ecb){return client[_0xeaae('0x11')](_0x4ecb5c,_0x2cfa0d)[_0xeaae('0x12')](function(_0x1c8ec7){logger['info']('ChatQueue,\x20%s,\x20%s',_0x41babf,_0xeaae('0x13'));logger[_0xeaae('0x14')](_0xeaae('0x15'),_0x41babf,'request\x20sent',JSON[_0xeaae('0x16')](_0x1c8ec7));if(_0x1c8ec7[_0xeaae('0x17')]){if(_0x1c8ec7[_0xeaae('0x17')][_0xeaae('0x18')]===0x1f4){logger['error']('ChatQueue,\x20%s,\x20%s',_0x41babf,_0x1c8ec7[_0xeaae('0x17')][_0xeaae('0x19')]);return _0x494ecb(_0x1c8ec7[_0xeaae('0x17')][_0xeaae('0x19')]);}logger['error'](_0xeaae('0x1a'),_0x41babf,_0x1c8ec7['error'][_0xeaae('0x19')]);return _0x592993(_0x1c8ec7[_0xeaae('0x17')][_0xeaae('0x19')]);}else{logger[_0xeaae('0x1b')]('ChatQueue,\x20%s,\x20%s',_0x41babf,'request\x20sent');_0x592993(_0x1c8ec7['result']['message']);}})[_0xeaae('0x1c')](function(_0x1590d2){logger['error'](_0xeaae('0x1a'),_0x41babf,_0x1590d2);_0x494ecb(_0x1590d2);});});}exports['GetChatQueue']=function(_0x1ac7a2){var _0x2ddb28=this;return new Promise(function(_0x3491a6,_0x52de90){return db[_0xeaae('0x1d')][_0xeaae('0x1e')]({'raw':_0x1ac7a2['options']?_0x1ac7a2['options'][_0xeaae('0x1f')]===undefined?!![]:![]:!![],'where':_0x1ac7a2['options']?_0x1ac7a2['options'][_0xeaae('0x20')]||null:null,'attributes':_0x1ac7a2[_0xeaae('0x21')]?_0x1ac7a2[_0xeaae('0x21')][_0xeaae('0x22')]||null:null,'limit':_0x1ac7a2[_0xeaae('0x21')]?_0x1ac7a2[_0xeaae('0x21')][_0xeaae('0x23')]||null:null,'include':_0x1ac7a2[_0xeaae('0x21')]?_0x1ac7a2[_0xeaae('0x21')][_0xeaae('0x24')]?_['map'](_0x1ac7a2[_0xeaae('0x21')][_0xeaae('0x24')],function(_0x10a0f2){return{'model':db[_0x10a0f2[_0xeaae('0x25')]],'as':_0x10a0f2['as'],'attributes':_0x10a0f2[_0xeaae('0x22')],'include':_0x10a0f2[_0xeaae('0x24')]?_[_0xeaae('0x26')](_0x10a0f2[_0xeaae('0x24')],function(_0x58ac1d){return{'model':db[_0x58ac1d['model']],'as':_0x58ac1d['as'],'attributes':_0x58ac1d[_0xeaae('0x22')],'include':_0x58ac1d[_0xeaae('0x24')]?_[_0xeaae('0x26')](_0x58ac1d['include'],function(_0x294938){return{'model':db[_0x294938[_0xeaae('0x25')]],'as':_0x294938['as'],'attributes':_0x294938[_0xeaae('0x22')]};}):[]};}):[]};}):[]:[]})[_0xeaae('0x12')](function(_0x24d86a){logger[_0xeaae('0x1b')](_0xeaae('0x27'),_0x1ac7a2);logger[_0xeaae('0x14')](_0xeaae('0x27'),_0x1ac7a2,JSON[_0xeaae('0x16')](_0x24d86a));_0x3491a6(_0x24d86a);})['catch'](function(_0x43a759){logger[_0xeaae('0x17')]('GetChatQueue',_0x43a759['message'],_0x1ac7a2);_0x52de90(_0x2ddb28[_0xeaae('0x17')](0x1f4,_0x43a759['message']));});});};exports[_0xeaae('0x28')]=function(_0x1827b9){var _0x20e28e=this;return new Promise(function(_0x5bedfa,_0x4e6d26){return db['ChatQueue'][_0xeaae('0x29')]({'raw':_0x1827b9['options']?_0x1827b9[_0xeaae('0x21')][_0xeaae('0x1f')]===undefined?!![]:![]:!![],'where':_0x1827b9[_0xeaae('0x21')]?_0x1827b9['options'][_0xeaae('0x20')]||null:null,'attributes':_0x1827b9[_0xeaae('0x21')]?_0x1827b9[_0xeaae('0x21')][_0xeaae('0x22')]||null:null,'include':_0x1827b9[_0xeaae('0x21')]?_0x1827b9['options'][_0xeaae('0x24')]?_[_0xeaae('0x26')](_0x1827b9[_0xeaae('0x21')][_0xeaae('0x24')],function(_0x210e3f){return{'model':db[_0x210e3f[_0xeaae('0x25')]],'as':_0x210e3f['as'],'attributes':_0x210e3f[_0xeaae('0x22')],'include':_0x210e3f[_0xeaae('0x24')]?_[_0xeaae('0x26')](_0x210e3f[_0xeaae('0x24')],function(_0x217158){return{'model':db[_0x217158['model']],'as':_0x217158['as'],'attributes':_0x217158['attributes'],'include':_0x217158['include']?_['map'](_0x217158['include'],function(_0xf0631f){return{'model':db[_0xf0631f['model']],'as':_0xf0631f['as'],'attributes':_0xf0631f[_0xeaae('0x22')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1d526a){logger['info']('ShowChatQueue',_0x1827b9);logger[_0xeaae('0x14')](_0xeaae('0x28'),_0x1827b9,JSON['stringify'](_0x1d526a));_0x5bedfa(_0x1d526a);})[_0xeaae('0x1c')](function(_0x4284f){logger['error'](_0xeaae('0x28'),_0x4284f[_0xeaae('0x19')],_0x1827b9);_0x4e6d26(_0x20e28e[_0xeaae('0x17')](0x1f4,_0x4284f[_0xeaae('0x19')]));});});}; \ No newline at end of file +var _0x81fa=['request\x20sent','stringify','error','message','info','result','ChatQueue','findAll','options','where','attributes','limit','include','map','model','then','GetChatQueue','catch','find','raw','ShowChatQueue','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','request','ChatQueue,\x20%s,\x20%s','debug'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x81fa,0xdd));var _0xa81f=function(_0x18fec8,_0x31d0cd){_0x18fec8=_0x18fec8-0x0;var _0x5e400c=_0x81fa[_0x18fec8];return _0x5e400c;};'use strict';var _=require(_0xa81f('0x0'));var util=require(_0xa81f('0x1'));var moment=require('moment');var BPromise=require(_0xa81f('0x2'));var rs=require(_0xa81f('0x3'));var fs=require('fs');var Redis=require(_0xa81f('0x4'));var db=require(_0xa81f('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xa81f('0x6'))(_0xa81f('0x7'));var config=require(_0xa81f('0x8'));var jayson=require(_0xa81f('0x9'));var client=jayson[_0xa81f('0xa')][_0xa81f('0xb')]({'port':0x232a});config[_0xa81f('0xc')]=_[_0xa81f('0xd')](config[_0xa81f('0xc')],{'host':_0xa81f('0xe'),'port':0x18eb});var socket=require(_0xa81f('0xf'))(new Redis(config[_0xa81f('0xc')]));require('./chatQueue.socket')['register'](socket);function respondWithRpcPromise(_0x28b82f,_0x182ae7,_0x57db85){return new BPromise(function(_0x47e978,_0x5b8b3c){return client[_0xa81f('0x10')](_0x28b82f,_0x57db85)['then'](function(_0x12fd0e){logger['info'](_0xa81f('0x11'),_0x182ae7,'request\x20sent');logger[_0xa81f('0x12')]('ChatQueue,\x20%s,\x20%s,\x20%s',_0x182ae7,_0xa81f('0x13'),JSON[_0xa81f('0x14')](_0x12fd0e));if(_0x12fd0e[_0xa81f('0x15')]){if(_0x12fd0e[_0xa81f('0x15')]['code']===0x1f4){logger[_0xa81f('0x15')](_0xa81f('0x11'),_0x182ae7,_0x12fd0e[_0xa81f('0x15')][_0xa81f('0x16')]);return _0x5b8b3c(_0x12fd0e[_0xa81f('0x15')][_0xa81f('0x16')]);}logger[_0xa81f('0x15')]('ChatQueue,\x20%s,\x20%s',_0x182ae7,_0x12fd0e[_0xa81f('0x15')]['message']);return _0x47e978(_0x12fd0e[_0xa81f('0x15')][_0xa81f('0x16')]);}else{logger[_0xa81f('0x17')](_0xa81f('0x11'),_0x182ae7,'request\x20sent');_0x47e978(_0x12fd0e[_0xa81f('0x18')][_0xa81f('0x16')]);}})['catch'](function(_0x588d80){logger['error'](_0xa81f('0x11'),_0x182ae7,_0x588d80);_0x5b8b3c(_0x588d80);});});}exports['GetChatQueue']=function(_0x2e887c){var _0x45380f=this;return new Promise(function(_0x61797e,_0x1ac5b1){return db[_0xa81f('0x19')][_0xa81f('0x1a')]({'raw':_0x2e887c[_0xa81f('0x1b')]?_0x2e887c['options']['raw']===undefined?!![]:![]:!![],'where':_0x2e887c['options']?_0x2e887c[_0xa81f('0x1b')][_0xa81f('0x1c')]||null:null,'attributes':_0x2e887c['options']?_0x2e887c[_0xa81f('0x1b')][_0xa81f('0x1d')]||null:null,'limit':_0x2e887c['options']?_0x2e887c['options'][_0xa81f('0x1e')]||null:null,'include':_0x2e887c[_0xa81f('0x1b')]?_0x2e887c[_0xa81f('0x1b')][_0xa81f('0x1f')]?_[_0xa81f('0x20')](_0x2e887c['options'][_0xa81f('0x1f')],function(_0x292f28){return{'model':db[_0x292f28[_0xa81f('0x21')]],'as':_0x292f28['as'],'attributes':_0x292f28[_0xa81f('0x1d')],'include':_0x292f28[_0xa81f('0x1f')]?_[_0xa81f('0x20')](_0x292f28[_0xa81f('0x1f')],function(_0xda556b){return{'model':db[_0xda556b[_0xa81f('0x21')]],'as':_0xda556b['as'],'attributes':_0xda556b['attributes'],'include':_0xda556b['include']?_[_0xa81f('0x20')](_0xda556b[_0xa81f('0x1f')],function(_0x49bb33){return{'model':db[_0x49bb33['model']],'as':_0x49bb33['as'],'attributes':_0x49bb33[_0xa81f('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xa81f('0x22')](function(_0x26dc51){logger['info']('GetChatQueue',_0x2e887c);logger['debug'](_0xa81f('0x23'),_0x2e887c,JSON['stringify'](_0x26dc51));_0x61797e(_0x26dc51);})[_0xa81f('0x24')](function(_0xee4866){logger[_0xa81f('0x15')](_0xa81f('0x23'),_0xee4866[_0xa81f('0x16')],_0x2e887c);_0x1ac5b1(_0x45380f[_0xa81f('0x15')](0x1f4,_0xee4866['message']));});});};exports['ShowChatQueue']=function(_0x10267e){var _0x1f1ba2=this;return new Promise(function(_0x4ba205,_0x3a026a){return db['ChatQueue'][_0xa81f('0x25')]({'raw':_0x10267e[_0xa81f('0x1b')]?_0x10267e[_0xa81f('0x1b')][_0xa81f('0x26')]===undefined?!![]:![]:!![],'where':_0x10267e[_0xa81f('0x1b')]?_0x10267e[_0xa81f('0x1b')][_0xa81f('0x1c')]||null:null,'attributes':_0x10267e[_0xa81f('0x1b')]?_0x10267e[_0xa81f('0x1b')][_0xa81f('0x1d')]||null:null,'include':_0x10267e['options']?_0x10267e[_0xa81f('0x1b')][_0xa81f('0x1f')]?_[_0xa81f('0x20')](_0x10267e[_0xa81f('0x1b')][_0xa81f('0x1f')],function(_0x4fdb8b){return{'model':db[_0x4fdb8b[_0xa81f('0x21')]],'as':_0x4fdb8b['as'],'attributes':_0x4fdb8b[_0xa81f('0x1d')],'include':_0x4fdb8b[_0xa81f('0x1f')]?_[_0xa81f('0x20')](_0x4fdb8b['include'],function(_0x7b1a36){return{'model':db[_0x7b1a36[_0xa81f('0x21')]],'as':_0x7b1a36['as'],'attributes':_0x7b1a36[_0xa81f('0x1d')],'include':_0x7b1a36[_0xa81f('0x1f')]?_['map'](_0x7b1a36[_0xa81f('0x1f')],function(_0x282e4d){return{'model':db[_0x282e4d[_0xa81f('0x21')]],'as':_0x282e4d['as'],'attributes':_0x282e4d[_0xa81f('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x17cea9){logger['info'](_0xa81f('0x27'),_0x10267e);logger['debug'](_0xa81f('0x27'),_0x10267e,JSON[_0xa81f('0x14')](_0x17cea9));_0x4ba205(_0x17cea9);})[_0xa81f('0x24')](function(_0x500575){logger[_0xa81f('0x15')]('ShowChatQueue',_0x500575[_0xa81f('0x16')],_0x10267e);_0x3a026a(_0x1f1ba2[_0xa81f('0x15')](0x1f4,_0x500575['message']));});});}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js index 4fca79f..9f6cbb7 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 _0xa41a=['emit','removeListener','./chatQueue.events','save','update'];(function(_0x13ce0c,_0x3f2a0d){var _0x4388fb=function(_0x27db4b){while(--_0x27db4b){_0x13ce0c['push'](_0x13ce0c['shift']());}};_0x4388fb(++_0x3f2a0d);}(_0xa41a,0x6b));var _0xaa41=function(_0xbde694,_0x48ff10){_0xbde694=_0xbde694-0x0;var _0x3708e3=_0xa41a[_0xbde694];return _0x3708e3;};'use strict';var ChatQueueEvents=require(_0xaa41('0x0'));var events=[_0xaa41('0x1'),'remove',_0xaa41('0x2')];function createListener(_0x2a96ba,_0x43654a){return function(_0xc5ce74){_0x43654a[_0xaa41('0x3')](_0x2a96ba,_0xc5ce74);};}function removeListener(_0x3168be,_0x42896b){return function(){ChatQueueEvents[_0xaa41('0x4')](_0x3168be,_0x42896b);};}exports['register']=function(_0x2122a0){for(var _0x1ec9d4=0x0,_0x54bc5a=events['length'];_0x1ec9d4<_0x54bc5a;_0x1ec9d4++){var _0x179545=events[_0x1ec9d4];var _0x202cce=createListener('chatQueue:'+_0x179545,_0x2122a0);ChatQueueEvents['on'](_0x179545,_0x202cce);}}; \ No newline at end of file +var _0xb821=['remove','removeListener','register','length','chatQueue:','save'];(function(_0x5998cc,_0x577645){var _0x112a84=function(_0x469997){while(--_0x469997){_0x5998cc['push'](_0x5998cc['shift']());}};_0x112a84(++_0x577645);}(_0xb821,0xa7));var _0x1b82=function(_0x263f07,_0x5c733d){_0x263f07=_0x263f07-0x0;var _0x373640=_0xb821[_0x263f07];return _0x373640;};'use strict';var ChatQueueEvents=require('./chatQueue.events');var events=[_0x1b82('0x0'),_0x1b82('0x1'),'update'];function createListener(_0x4a4f81,_0xbab478){return function(_0x578a10){_0xbab478['emit'](_0x4a4f81,_0x578a10);};}function removeListener(_0x3b1d14,_0x1403ab){return function(){ChatQueueEvents[_0x1b82('0x2')](_0x3b1d14,_0x1403ab);};}exports[_0x1b82('0x3')]=function(_0x597ca7){for(var _0x3e27c4=0x0,_0x192434=events[_0x1b82('0x4')];_0x3e27c4<_0x192434;_0x3e27c4++){var _0x3632dd=events[_0x3e27c4];var _0x18f45f=createListener(_0x1b82('0x5')+_0x3632dd,_0x597ca7);ChatQueueEvents['on'](_0x3632dd,_0x18f45f);}}; \ No newline at end of file diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js index dcf9ab7..b8c3509 100644 --- a/server/api/chatQueue/index.js +++ b/server/api/chatQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5fc3=['update','delete','destroy','removeTeams','removeAgents','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatQueue.controller','get','isAuthenticated','describe','/:id','show','getMembers','/:id/teams','/:id/users','post','create','addTeams','put'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x5fc3,0xa8));var _0x35fc=function(_0x4b1032,_0x36952e){_0x4b1032=_0x4b1032-0x0;var _0x5a1d55=_0x5fc3[_0x4b1032];return _0x5a1d55;};'use strict';var multer=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var path=require('path');var timeout=require(_0x35fc('0x2'));var express=require(_0x35fc('0x3'));var router=express[_0x35fc('0x4')]();var fs_extra=require(_0x35fc('0x5'));var auth=require(_0x35fc('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x35fc('0x7'));var controller=require(_0x35fc('0x8'));router[_0x35fc('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x35fc('0x9')]('/describe',auth[_0x35fc('0xa')](),controller[_0x35fc('0xb')]);router[_0x35fc('0x9')](_0x35fc('0xc'),auth[_0x35fc('0xa')](),controller[_0x35fc('0xd')]);router[_0x35fc('0x9')]('/:id/members',auth[_0x35fc('0xa')](),controller[_0x35fc('0xe')]);router['get'](_0x35fc('0xf'),auth[_0x35fc('0xa')](),controller['getTeams']);router[_0x35fc('0x9')](_0x35fc('0x10'),auth['isAuthenticated'](),controller['getAgents']);router[_0x35fc('0x11')]('/',auth['isAuthenticated'](),controller[_0x35fc('0x12')]);router[_0x35fc('0x11')](_0x35fc('0xf'),auth[_0x35fc('0xa')](),controller[_0x35fc('0x13')]);router['post']('/:id/users',auth['isAuthenticated'](),controller['addAgents']);router[_0x35fc('0x14')](_0x35fc('0xc'),auth[_0x35fc('0xa')](),controller[_0x35fc('0x15')]);router[_0x35fc('0x16')](_0x35fc('0xc'),auth['isAuthenticated'](),controller[_0x35fc('0x17')]);router[_0x35fc('0x16')]('/:id/teams',auth[_0x35fc('0xa')](),controller[_0x35fc('0x18')]);router[_0x35fc('0x16')]('/:id/users',auth[_0x35fc('0xa')](),controller[_0x35fc('0x19')]);module[_0x35fc('0x1a')]=router; \ No newline at end of file +var _0x55ca=['post','addAgents','update','delete','destroy','removeTeams','removeAgents','exports','multer','util','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatQueue.controller','get','isAuthenticated','index','describe','/:id','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','addTeams'];(function(_0xf1a87d,_0x80b3a9){var _0x5e9155=function(_0x1291eb){while(--_0x1291eb){_0xf1a87d['push'](_0xf1a87d['shift']());}};_0x5e9155(++_0x80b3a9);}(_0x55ca,0x126));var _0xa55c=function(_0x256b67,_0x14e47b){_0x256b67=_0x256b67-0x0;var _0x3e2d99=_0x55ca[_0x256b67];return _0x3e2d99;};'use strict';var multer=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xa55c('0x2')]();var fs_extra=require(_0xa55c('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xa55c('0x4'));var config=require(_0xa55c('0x5'));var controller=require(_0xa55c('0x6'));router[_0xa55c('0x7')]('/',auth[_0xa55c('0x8')](),controller[_0xa55c('0x9')]);router[_0xa55c('0x7')]('/describe',auth[_0xa55c('0x8')](),controller[_0xa55c('0xa')]);router['get'](_0xa55c('0xb'),auth[_0xa55c('0x8')](),controller['show']);router['get'](_0xa55c('0xc'),auth[_0xa55c('0x8')](),controller[_0xa55c('0xd')]);router[_0xa55c('0x7')](_0xa55c('0xe'),auth[_0xa55c('0x8')](),controller[_0xa55c('0xf')]);router[_0xa55c('0x7')](_0xa55c('0x10'),auth[_0xa55c('0x8')](),controller['getAgents']);router['post']('/',auth[_0xa55c('0x8')](),controller['create']);router['post']('/:id/teams',auth[_0xa55c('0x8')](),controller[_0xa55c('0x11')]);router[_0xa55c('0x12')](_0xa55c('0x10'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x13')]);router['put'](_0xa55c('0xb'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x14')]);router[_0xa55c('0x15')](_0xa55c('0xb'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x16')]);router[_0xa55c('0x15')](_0xa55c('0xe'),auth['isAuthenticated'](),controller[_0xa55c('0x17')]);router[_0xa55c('0x15')](_0xa55c('0x10'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x18')]);module[_0xa55c('0x19')]=router; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js index b76b7ac..f8b767d 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 _0x920e=['exports','STRING','DATE','sequelize'];(function(_0x2aeef8,_0x4dc695){var _0x11e7d2=function(_0x393271){while(--_0x393271){_0x2aeef8['push'](_0x2aeef8['shift']());}};_0x11e7d2(++_0x4dc695);}(_0x920e,0xc7));var _0xe920=function(_0x1763f0,_0x2385f5){_0x1763f0=_0x1763f0-0x0;var _0x1b05f3=_0x920e[_0x1763f0];return _0x1b05f3;};'use strict';var moment=require('moment');var Sequelize=require(_0xe920('0x0'));module[_0xe920('0x1')]={'uniqueid':{'type':Sequelize[_0xe920('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0xe920('0x2')]},'joinAt':{'type':Sequelize[_0xe920('0x3')]},'leaveAt':{'type':Sequelize[_0xe920('0x3')]},'acceptAt':{'type':Sequelize[_0xe920('0x3')]},'exitAt':{'type':Sequelize[_0xe920('0x3')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x7250=['DATE','moment','sequelize','STRING'];(function(_0x263ffd,_0x140cf8){var _0x2b3b8b=function(_0x36331e){while(--_0x36331e){_0x263ffd['push'](_0x263ffd['shift']());}};_0x2b3b8b(++_0x140cf8);}(_0x7250,0x1b1));var _0x0725=function(_0x4dfb7c,_0x528bd2){_0x4dfb7c=_0x4dfb7c-0x0;var _0x4917ce=_0x7250[_0x4dfb7c];return _0x4917ce;};'use strict';var moment=require(_0x0725('0x0'));var Sequelize=require(_0x0725('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0x0725('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x0725('0x2')]},'joinAt':{'type':Sequelize[_0x0725('0x3')]},'leaveAt':{'type':Sequelize[_0x0725('0x3')]},'acceptAt':{'type':Sequelize[_0x0725('0x3')]},'exitAt':{'type':Sequelize[_0x0725('0x3')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js index 7fb5900..5b4bc9e 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 _0xd43e=['to-csv','fs-extra','lodash','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','undefined','count','offset','limit','Content-Range','json','apply','update','then','destroy','error','stack','name','index','map','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','ChatQueueReport','includeAll','findAll','rows','catch','show','params','keys','include','find','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','util','path','sox'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0xd43e,0x88));var _0xed43=function(_0x431915,_0x1db91f){_0x431915=_0x431915-0x0;var _0x546b6d=_0xd43e[_0x431915];return _0x546b6d;};'use strict';var emlformat=require(_0xed43('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xed43('0x1'));var jsonpatch=require(_0xed43('0x2'));var rp=require(_0xed43('0x3'));var moment=require(_0xed43('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xed43('0x5'));var path=require(_0xed43('0x6'));var sox=require(_0xed43('0x7'));var csv=require(_0xed43('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xed43('0x9'));var _=require(_0xed43('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xed43('0xb'));var toCsv=require(_0xed43('0x8'));var querystring=require(_0xed43('0xc'));var Papa=require(_0xed43('0xd'));var Redis=require(_0xed43('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xed43('0xf'));var as=require(_0xed43('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xed43('0x11'))(_0xed43('0x12'));var utils=require(_0xed43('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xed43('0x14'))['db'];function respondWithStatusCode(_0x34027b,_0x4eed04){_0x4eed04=_0x4eed04||0xcc;return function(_0x1519aa){if(_0x1519aa){return _0x34027b[_0xed43('0x15')](_0x4eed04);}return _0x34027b[_0xed43('0x16')](_0x4eed04)[_0xed43('0x17')]();};}function respondWithResult(_0x2adbc5,_0x403a89){_0x403a89=_0x403a89||0xc8;return function(_0x597544){if(_0x597544){return _0x2adbc5[_0xed43('0x16')](_0x403a89)['json'](_0x597544);}};}function respondWithFilteredResult(_0x2ec9c3,_0x4a9621){return function(_0x2d457a){if(_0x2d457a){var _0x4caa03=typeof _0x4a9621['offset']===_0xed43('0x18')&&typeof _0x4a9621['limit']===_0xed43('0x18');var _0x1ada9c=_0x2d457a[_0xed43('0x19')];var _0x5f5093=_0x4caa03?0x0:_0x4a9621[_0xed43('0x1a')];var _0xa8a443=_0x4caa03?_0x2d457a['count']:_0x4a9621['offset']+_0x4a9621[_0xed43('0x1b')];var _0x46a875;if(_0xa8a443>=_0x1ada9c){_0xa8a443=_0x1ada9c;_0x46a875=0xc8;}else{_0x46a875=0xce;}_0x2ec9c3[_0xed43('0x16')](_0x46a875);return _0x2ec9c3['set'](_0xed43('0x1c'),_0x5f5093+'-'+_0xa8a443+'/'+_0x1ada9c)[_0xed43('0x1d')](_0x2d457a);}return null;};}function patchUpdates(_0x5bbd5c){return function(_0x3570ef){try{jsonpatch[_0xed43('0x1e')](_0x3570ef,_0x5bbd5c,!![]);}catch(_0x336ce7){return BPromise['reject'](_0x336ce7);}return _0x3570ef['save']();};}function saveUpdates(_0x2a6329,_0x42fb48){return function(_0x7f4c4c){if(_0x7f4c4c){return _0x7f4c4c[_0xed43('0x1f')](_0x2a6329)[_0xed43('0x20')](function(_0x45a24a){return _0x45a24a;});}return null;};}function removeEntity(_0x556440,_0x414c7a){return function(_0x30b5cf){if(_0x30b5cf){return _0x30b5cf[_0xed43('0x21')]()['then'](function(){_0x556440[_0xed43('0x16')](0xcc)[_0xed43('0x17')]();});}};}function handleEntityNotFound(_0x28a908,_0x90350a){return function(_0x549f91){if(!_0x549f91){_0x28a908[_0xed43('0x15')](0x194);}return _0x549f91;};}function handleError(_0x53f575,_0x3e7442){_0x3e7442=_0x3e7442||0x1f4;return function(_0xed8706){logger[_0xed43('0x22')](_0xed8706[_0xed43('0x23')]);if(_0xed8706['name']){delete _0xed8706[_0xed43('0x24')];}_0x53f575['status'](_0x3e7442)['send'](_0xed8706);};}exports[_0xed43('0x25')]=function(_0x51f128,_0x587d85){var _0x1b2f66={},_0x139750={},_0x325ab5={'count':0x0,'rows':[]};var _0x1f1207=_[_0xed43('0x26')](db['ChatQueueReport'][_0xed43('0x27')],function(_0x32c395){return{'name':_0x32c395[_0xed43('0x28')],'type':_0x32c395[_0xed43('0x29')][_0xed43('0x2a')]};});_0x139750['model']=_[_0xed43('0x26')](_0x1f1207,_0xed43('0x24'));_0x139750[_0xed43('0x2b')]=_['keys'](_0x51f128[_0xed43('0x2b')]);_0x139750[_0xed43('0x2c')]=_[_0xed43('0x2d')](_0x139750[_0xed43('0x2e')],_0x139750[_0xed43('0x2b')]);_0x1b2f66[_0xed43('0x2f')]=_[_0xed43('0x2d')](_0x139750[_0xed43('0x2e')],qs['fields'](_0x51f128['query'][_0xed43('0x30')]));_0x1b2f66['attributes']=_0x1b2f66[_0xed43('0x2f')][_0xed43('0x31')]?_0x1b2f66['attributes']:_0x139750[_0xed43('0x2e')];if(!_0x51f128[_0xed43('0x2b')][_0xed43('0x32')](_0xed43('0x33'))){_0x1b2f66[_0xed43('0x1b')]=qs[_0xed43('0x1b')](_0x51f128[_0xed43('0x2b')][_0xed43('0x1b')]);_0x1b2f66['offset']=qs['offset'](_0x51f128[_0xed43('0x2b')][_0xed43('0x1a')]);}_0x1b2f66[_0xed43('0x34')]=qs[_0xed43('0x35')](_0x51f128[_0xed43('0x2b')]['sort']);_0x1b2f66[_0xed43('0x36')]=qs['filters'](_[_0xed43('0x37')](_0x51f128[_0xed43('0x2b')],_0x139750[_0xed43('0x2c')]),_0x1f1207);if(_0x51f128['query'][_0xed43('0x38')]){_0x1b2f66[_0xed43('0x36')]=_['merge'](_0x1b2f66[_0xed43('0x36')],{'$or':_[_0xed43('0x26')](_0x1f1207,function(_0x5bf247){if(_0x5bf247[_0xed43('0x29')]!=='VIRTUAL'){var _0x16c207={};_0x16c207[_0x5bf247[_0xed43('0x24')]]={'$like':'%'+_0x51f128['query'][_0xed43('0x38')]+'%'};return _0x16c207;}})});}_0x1b2f66=_[_0xed43('0x39')]({},_0x1b2f66,_0x51f128[_0xed43('0x3a')]);var _0x4a6ff6={'where':_0x1b2f66[_0xed43('0x36')]};return db[_0xed43('0x3b')][_0xed43('0x19')](_0x4a6ff6)[_0xed43('0x20')](function(_0xa6a7c3){_0x325ab5[_0xed43('0x19')]=_0xa6a7c3;if(_0x51f128['query'][_0xed43('0x3c')]){_0x1b2f66['include']=[{'all':!![]}];}return db[_0xed43('0x3b')][_0xed43('0x3d')](_0x1b2f66);})[_0xed43('0x20')](function(_0x2a9a15){_0x325ab5[_0xed43('0x3e')]=_0x2a9a15;return _0x325ab5;})[_0xed43('0x20')](respondWithFilteredResult(_0x587d85,_0x1b2f66))[_0xed43('0x3f')](handleError(_0x587d85,null));};exports[_0xed43('0x40')]=function(_0x19d7de,_0x32ddec){var _0x3ec9c0={'raw':!![],'where':{'id':_0x19d7de[_0xed43('0x41')]['id']}},_0x57ac6b={};_0x57ac6b[_0xed43('0x2e')]=_[_0xed43('0x42')](db['ChatQueueReport'][_0xed43('0x27')]);_0x57ac6b[_0xed43('0x2b')]=_[_0xed43('0x42')](_0x19d7de['query']);_0x57ac6b[_0xed43('0x2c')]=_['intersection'](_0x57ac6b['model'],_0x57ac6b[_0xed43('0x2b')]);_0x3ec9c0[_0xed43('0x2f')]=_[_0xed43('0x2d')](_0x57ac6b[_0xed43('0x2e')],qs['fields'](_0x19d7de[_0xed43('0x2b')][_0xed43('0x30')]));_0x3ec9c0['attributes']=_0x3ec9c0['attributes'][_0xed43('0x31')]?_0x3ec9c0['attributes']:_0x57ac6b[_0xed43('0x2e')];if(_0x19d7de['query'][_0xed43('0x3c')]){_0x3ec9c0[_0xed43('0x43')]=[{'all':!![]}];}_0x3ec9c0=_[_0xed43('0x39')]({},_0x3ec9c0,_0x19d7de[_0xed43('0x3a')]);return db[_0xed43('0x3b')][_0xed43('0x44')](_0x3ec9c0)['then'](handleEntityNotFound(_0x32ddec,null))[_0xed43('0x20')](respondWithResult(_0x32ddec,null))[_0xed43('0x3f')](handleError(_0x32ddec,null));};exports[_0xed43('0x45')]=function(_0x2ff4cf,_0x298662){return db[_0xed43('0x3b')]['create'](_0x2ff4cf[_0xed43('0x46')],{})[_0xed43('0x20')](respondWithResult(_0x298662,0xc9))[_0xed43('0x3f')](handleError(_0x298662,null));};exports[_0xed43('0x1f')]=function(_0x567327,_0xeda46e){if(_0x567327[_0xed43('0x46')]['id']){delete _0x567327['body']['id'];}return db[_0xed43('0x3b')][_0xed43('0x44')]({'where':{'id':_0x567327[_0xed43('0x41')]['id']}})[_0xed43('0x20')](handleEntityNotFound(_0xeda46e,null))[_0xed43('0x20')](saveUpdates(_0x567327[_0xed43('0x46')],null))[_0xed43('0x20')](respondWithResult(_0xeda46e,null))[_0xed43('0x3f')](handleError(_0xeda46e,null));};exports[_0xed43('0x21')]=function(_0x5f1968,_0x47cb1e){return db[_0xed43('0x3b')][_0xed43('0x44')]({'where':{'id':_0x5f1968[_0xed43('0x41')]['id']}})['then'](handleEntityNotFound(_0x47cb1e,null))['then'](removeEntity(_0x47cb1e,null))[_0xed43('0x3f')](handleError(_0x47cb1e,null));};exports[_0xed43('0x47')]=function(_0x399b30,_0x31846d){return db[_0xed43('0x3b')][_0xed43('0x47')]()[_0xed43('0x20')](respondWithResult(_0x31846d,null))[_0xed43('0x3f')](handleError(_0x31846d,null));}; \ No newline at end of file +var _0x52aa=['limit','count','Content-Range','reject','save','update','then','error','stack','name','send','index','map','ChatQueueReport','fieldName','type','key','keys','query','filters','intersection','model','attributes','fields','length','nolimit','order','sort','where','filter','VIRTUAL','includeAll','include','findAll','catch','show','params','merge','options','find','create','body','destroy','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined'];(function(_0x3b1caf,_0x8a35c5){var _0x416b17=function(_0x105e1b){while(--_0x105e1b){_0x3b1caf['push'](_0x3b1caf['shift']());}};_0x416b17(++_0x8a35c5);}(_0x52aa,0x113));var _0xa52a=function(_0x4d7eb5,_0x480265){_0x4d7eb5=_0x4d7eb5-0x0;var _0x54d90d=_0x52aa[_0x4d7eb5];return _0x54d90d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa52a('0x0'));var zipdir=require(_0xa52a('0x1'));var jsonpatch=require(_0xa52a('0x2'));var rp=require(_0xa52a('0x3'));var moment=require(_0xa52a('0x4'));var BPromise=require(_0xa52a('0x5'));var Mustache=require(_0xa52a('0x6'));var util=require(_0xa52a('0x7'));var path=require(_0xa52a('0x8'));var sox=require(_0xa52a('0x9'));var csv=require(_0xa52a('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa52a('0xb'));var squel=require(_0xa52a('0xc'));var crypto=require(_0xa52a('0xd'));var jsforce=require(_0xa52a('0xe'));var deskjs=require(_0xa52a('0xf'));var toCsv=require(_0xa52a('0xa'));var querystring=require(_0xa52a('0x10'));var Papa=require(_0xa52a('0x11'));var Redis=require(_0xa52a('0x12'));var authService=require(_0xa52a('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xa52a('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa52a('0x15'))(_0xa52a('0x16'));var utils=require(_0xa52a('0x17'));var config=require(_0xa52a('0x18'));var licenseUtil=require(_0xa52a('0x19'));var db=require(_0xa52a('0x1a'))['db'];function respondWithStatusCode(_0x3d4749,_0x140034){_0x140034=_0x140034||0xcc;return function(_0x466f96){if(_0x466f96){return _0x3d4749[_0xa52a('0x1b')](_0x140034);}return _0x3d4749[_0xa52a('0x1c')](_0x140034)[_0xa52a('0x1d')]();};}function respondWithResult(_0x381d76,_0x482f79){_0x482f79=_0x482f79||0xc8;return function(_0x56a2d2){if(_0x56a2d2){return _0x381d76[_0xa52a('0x1c')](_0x482f79)[_0xa52a('0x1e')](_0x56a2d2);}};}function respondWithFilteredResult(_0x534580,_0x2b9dc0){return function(_0x24cffa){if(_0x24cffa){var _0x1380b1=typeof _0x2b9dc0[_0xa52a('0x1f')]===_0xa52a('0x20')&&typeof _0x2b9dc0[_0xa52a('0x21')]===_0xa52a('0x20');var _0x243230=_0x24cffa[_0xa52a('0x22')];var _0x314323=_0x1380b1?0x0:_0x2b9dc0['offset'];var _0x1e2cc8=_0x1380b1?_0x24cffa[_0xa52a('0x22')]:_0x2b9dc0[_0xa52a('0x1f')]+_0x2b9dc0[_0xa52a('0x21')];var _0xf726ff;if(_0x1e2cc8>=_0x243230){_0x1e2cc8=_0x243230;_0xf726ff=0xc8;}else{_0xf726ff=0xce;}_0x534580[_0xa52a('0x1c')](_0xf726ff);return _0x534580['set'](_0xa52a('0x23'),_0x314323+'-'+_0x1e2cc8+'/'+_0x243230)[_0xa52a('0x1e')](_0x24cffa);}return null;};}function patchUpdates(_0xd4d131){return function(_0x38e52b){try{jsonpatch['apply'](_0x38e52b,_0xd4d131,!![]);}catch(_0x340129){return BPromise[_0xa52a('0x24')](_0x340129);}return _0x38e52b[_0xa52a('0x25')]();};}function saveUpdates(_0x327f82,_0x13ef38){return function(_0x4c8361){if(_0x4c8361){return _0x4c8361[_0xa52a('0x26')](_0x327f82)['then'](function(_0x56f900){return _0x56f900;});}return null;};}function removeEntity(_0x300faa,_0x1de0a5){return function(_0x598849){if(_0x598849){return _0x598849['destroy']()[_0xa52a('0x27')](function(){_0x300faa[_0xa52a('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1fbdc5,_0x46b8e6){return function(_0x1290d7){if(!_0x1290d7){_0x1fbdc5[_0xa52a('0x1b')](0x194);}return _0x1290d7;};}function handleError(_0x286280,_0x269431){_0x269431=_0x269431||0x1f4;return function(_0x3f2e9e){logger[_0xa52a('0x28')](_0x3f2e9e[_0xa52a('0x29')]);if(_0x3f2e9e[_0xa52a('0x2a')]){delete _0x3f2e9e[_0xa52a('0x2a')];}_0x286280[_0xa52a('0x1c')](_0x269431)[_0xa52a('0x2b')](_0x3f2e9e);};}exports[_0xa52a('0x2c')]=function(_0x15867e,_0x3bb4f7){var _0x1a82c4={},_0x950f7e={},_0x4d32fa={'count':0x0,'rows':[]};var _0x1903fb=_[_0xa52a('0x2d')](db[_0xa52a('0x2e')]['rawAttributes'],function(_0x49ab8f){return{'name':_0x49ab8f[_0xa52a('0x2f')],'type':_0x49ab8f[_0xa52a('0x30')][_0xa52a('0x31')]};});_0x950f7e['model']=_[_0xa52a('0x2d')](_0x1903fb,_0xa52a('0x2a'));_0x950f7e['query']=_[_0xa52a('0x32')](_0x15867e[_0xa52a('0x33')]);_0x950f7e[_0xa52a('0x34')]=_[_0xa52a('0x35')](_0x950f7e[_0xa52a('0x36')],_0x950f7e[_0xa52a('0x33')]);_0x1a82c4[_0xa52a('0x37')]=_[_0xa52a('0x35')](_0x950f7e['model'],qs[_0xa52a('0x38')](_0x15867e['query']['fields']));_0x1a82c4[_0xa52a('0x37')]=_0x1a82c4[_0xa52a('0x37')][_0xa52a('0x39')]?_0x1a82c4[_0xa52a('0x37')]:_0x950f7e['model'];if(!_0x15867e[_0xa52a('0x33')]['hasOwnProperty'](_0xa52a('0x3a'))){_0x1a82c4['limit']=qs[_0xa52a('0x21')](_0x15867e[_0xa52a('0x33')][_0xa52a('0x21')]);_0x1a82c4['offset']=qs['offset'](_0x15867e[_0xa52a('0x33')][_0xa52a('0x1f')]);}_0x1a82c4[_0xa52a('0x3b')]=qs[_0xa52a('0x3c')](_0x15867e[_0xa52a('0x33')][_0xa52a('0x3c')]);_0x1a82c4[_0xa52a('0x3d')]=qs[_0xa52a('0x34')](_['pick'](_0x15867e['query'],_0x950f7e['filters']),_0x1903fb);if(_0x15867e[_0xa52a('0x33')][_0xa52a('0x3e')]){_0x1a82c4['where']=_['merge'](_0x1a82c4[_0xa52a('0x3d')],{'$or':_['map'](_0x1903fb,function(_0x1116b7){if(_0x1116b7[_0xa52a('0x30')]!==_0xa52a('0x3f')){var _0x27264b={};_0x27264b[_0x1116b7['name']]={'$like':'%'+_0x15867e[_0xa52a('0x33')][_0xa52a('0x3e')]+'%'};return _0x27264b;}})});}_0x1a82c4=_['merge']({},_0x1a82c4,_0x15867e['options']);var _0x5ffb0f={'where':_0x1a82c4[_0xa52a('0x3d')]};return db[_0xa52a('0x2e')]['count'](_0x5ffb0f)[_0xa52a('0x27')](function(_0x4fa3ab){_0x4d32fa[_0xa52a('0x22')]=_0x4fa3ab;if(_0x15867e[_0xa52a('0x33')][_0xa52a('0x40')]){_0x1a82c4[_0xa52a('0x41')]=[{'all':!![]}];}return db[_0xa52a('0x2e')][_0xa52a('0x42')](_0x1a82c4);})[_0xa52a('0x27')](function(_0xc99441){_0x4d32fa['rows']=_0xc99441;return _0x4d32fa;})[_0xa52a('0x27')](respondWithFilteredResult(_0x3bb4f7,_0x1a82c4))[_0xa52a('0x43')](handleError(_0x3bb4f7,null));};exports[_0xa52a('0x44')]=function(_0x16e578,_0x53d5c6){var _0x1660c6={'raw':!![],'where':{'id':_0x16e578[_0xa52a('0x45')]['id']}},_0x52e5ca={};_0x52e5ca['model']=_['keys'](db[_0xa52a('0x2e')]['rawAttributes']);_0x52e5ca[_0xa52a('0x33')]=_[_0xa52a('0x32')](_0x16e578[_0xa52a('0x33')]);_0x52e5ca[_0xa52a('0x34')]=_['intersection'](_0x52e5ca[_0xa52a('0x36')],_0x52e5ca['query']);_0x1660c6[_0xa52a('0x37')]=_[_0xa52a('0x35')](_0x52e5ca[_0xa52a('0x36')],qs[_0xa52a('0x38')](_0x16e578[_0xa52a('0x33')][_0xa52a('0x38')]));_0x1660c6[_0xa52a('0x37')]=_0x1660c6['attributes'][_0xa52a('0x39')]?_0x1660c6[_0xa52a('0x37')]:_0x52e5ca['model'];if(_0x16e578['query']['includeAll']){_0x1660c6[_0xa52a('0x41')]=[{'all':!![]}];}_0x1660c6=_[_0xa52a('0x46')]({},_0x1660c6,_0x16e578[_0xa52a('0x47')]);return db['ChatQueueReport'][_0xa52a('0x48')](_0x1660c6)[_0xa52a('0x27')](handleEntityNotFound(_0x53d5c6,null))[_0xa52a('0x27')](respondWithResult(_0x53d5c6,null))['catch'](handleError(_0x53d5c6,null));};exports[_0xa52a('0x49')]=function(_0x454fbf,_0x260d55){return db[_0xa52a('0x2e')][_0xa52a('0x49')](_0x454fbf[_0xa52a('0x4a')],{})[_0xa52a('0x27')](respondWithResult(_0x260d55,0xc9))[_0xa52a('0x43')](handleError(_0x260d55,null));};exports[_0xa52a('0x26')]=function(_0x5935cc,_0x2c08e3){if(_0x5935cc[_0xa52a('0x4a')]['id']){delete _0x5935cc[_0xa52a('0x4a')]['id'];}return db[_0xa52a('0x2e')][_0xa52a('0x48')]({'where':{'id':_0x5935cc['params']['id']}})[_0xa52a('0x27')](handleEntityNotFound(_0x2c08e3,null))[_0xa52a('0x27')](saveUpdates(_0x5935cc[_0xa52a('0x4a')],null))[_0xa52a('0x27')](respondWithResult(_0x2c08e3,null))[_0xa52a('0x43')](handleError(_0x2c08e3,null));};exports[_0xa52a('0x4b')]=function(_0x2ec48d,_0x1fd43b){return db['ChatQueueReport'][_0xa52a('0x48')]({'where':{'id':_0x2ec48d[_0xa52a('0x45')]['id']}})['then'](handleEntityNotFound(_0x1fd43b,null))['then'](removeEntity(_0x1fd43b,null))[_0xa52a('0x43')](handleError(_0x1fd43b,null));};exports['describe']=function(_0x5a5e11,_0x4eb7d0){return db[_0xa52a('0x2e')][_0xa52a('0x4c')]()['then'](respondWithResult(_0x4eb7d0,null))[_0xa52a('0x43')](handleError(_0x4eb7d0,null));}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js index 8555d26..9eef8bc 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 _0xbaf0=['define','ChatQueueReport','report_chat_queue','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatQueueReport.attributes','exports'];(function(_0x2fd490,_0xb7558f){var _0x4e85bb=function(_0x29c913){while(--_0x29c913){_0x2fd490['push'](_0x2fd490['shift']());}};_0x4e85bb(++_0xb7558f);}(_0xbaf0,0x12a));var _0x0baf=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xbaf0[_0x2b4411];return _0x8e41ef;};'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 _0x757a=['report_chat_queue','uniqueid','util','../../config/logger','request-promise','path','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define'];(function(_0x185f3d,_0x4b902d){var _0x3b5db1=function(_0x16e684){while(--_0x16e684){_0x185f3d['push'](_0x185f3d['shift']());}};_0x3b5db1(++_0x4b902d);}(_0x757a,0xde));var _0xa757=function(_0x31f974,_0x13079e){_0x31f974=_0x31f974-0x0;var _0x517af1=_0x757a[_0x31f974];return _0x517af1;};'use strict';var _=require('lodash');var util=require(_0xa757('0x0'));var logger=require(_0xa757('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xa757('0x2'));var fs=require('fs');var path=require(_0xa757('0x3'));var rimraf=require(_0xa757('0x4'));var config=require(_0xa757('0x5'));var attributes=require(_0xa757('0x6'));module[_0xa757('0x7')]=function(_0x5edca8,_0xae0e7c){return _0x5edca8[_0xa757('0x8')]('ChatQueueReport',attributes,{'tableName':_0xa757('0x9'),'paranoid':![],'indexes':[{'name':_0xa757('0xa'),'fields':[_0xa757('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js index b3c29d1..b6a283a 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 _0x8d2b=['error','code','message','result','catch','CreateChatQueueReport','ChatQueueReport','create','body','options','raw','UpdateChatQueueReport','where','attributes','limit','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','stringify'];(function(_0x28394f,_0x5ebdd2){var _0x2618d2=function(_0x2ffed6){while(--_0x2ffed6){_0x28394f['push'](_0x28394f['shift']());}};_0x2618d2(++_0x5ebdd2);}(_0x8d2b,0x1c9));var _0xb8d2=function(_0x34bc30,_0x177cb0){_0x34bc30=_0x34bc30-0x0;var _0x5706de=_0x8d2b[_0x34bc30];return _0x5706de;};'use strict';var _=require(_0xb8d2('0x0'));var util=require(_0xb8d2('0x1'));var moment=require(_0xb8d2('0x2'));var BPromise=require('bluebird');var rs=require(_0xb8d2('0x3'));var fs=require('fs');var Redis=require(_0xb8d2('0x4'));var db=require(_0xb8d2('0x5'))['db'];var utils=require(_0xb8d2('0x6'));var logger=require(_0xb8d2('0x7'))(_0xb8d2('0x8'));var config=require('../../config/environment');var jayson=require(_0xb8d2('0x9'));var client=jayson[_0xb8d2('0xa')][_0xb8d2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5ad266,_0x459b58,_0x3b1c3b){return new BPromise(function(_0x5778bd,_0x3b341f){return client[_0xb8d2('0xc')](_0x5ad266,_0x3b1c3b)[_0xb8d2('0xd')](function(_0x5cb228){logger[_0xb8d2('0xe')](_0xb8d2('0xf'),_0x459b58,_0xb8d2('0x10'));logger[_0xb8d2('0x11')]('ChatQueueReport,\x20%s,\x20%s,\x20%s',_0x459b58,_0xb8d2('0x10'),JSON[_0xb8d2('0x12')](_0x5cb228));if(_0x5cb228[_0xb8d2('0x13')]){if(_0x5cb228[_0xb8d2('0x13')][_0xb8d2('0x14')]===0x1f4){logger[_0xb8d2('0x13')](_0xb8d2('0xf'),_0x459b58,_0x5cb228['error'][_0xb8d2('0x15')]);return _0x3b341f(_0x5cb228['error'][_0xb8d2('0x15')]);}logger[_0xb8d2('0x13')](_0xb8d2('0xf'),_0x459b58,_0x5cb228['error'][_0xb8d2('0x15')]);return _0x5778bd(_0x5cb228[_0xb8d2('0x13')][_0xb8d2('0x15')]);}else{logger[_0xb8d2('0xe')](_0xb8d2('0xf'),_0x459b58,_0xb8d2('0x10'));_0x5778bd(_0x5cb228[_0xb8d2('0x16')][_0xb8d2('0x15')]);}})[_0xb8d2('0x17')](function(_0xa17b11){logger['error'](_0xb8d2('0xf'),_0x459b58,_0xa17b11);_0x3b341f(_0xa17b11);});});}exports[_0xb8d2('0x18')]=function(_0x588178){var _0x13f282=this;return new Promise(function(_0x389b41,_0x34a2aa){return db[_0xb8d2('0x19')][_0xb8d2('0x1a')](_0x588178[_0xb8d2('0x1b')],{'raw':_0x588178[_0xb8d2('0x1c')]?_0x588178['options'][_0xb8d2('0x1d')]===undefined?!![]:![]:!![]})[_0xb8d2('0xd')](function(_0xb57c0c){logger['info'](_0xb8d2('0x18'),_0x588178);logger[_0xb8d2('0x11')](_0xb8d2('0x18'),_0x588178,JSON[_0xb8d2('0x12')](_0xb57c0c));_0x389b41(_0xb57c0c);})[_0xb8d2('0x17')](function(_0xee0da5){logger[_0xb8d2('0x13')](_0xb8d2('0x18'),_0xee0da5['message'],_0x588178);_0x34a2aa(_0x13f282['error'](0x1f4,_0xee0da5['message']));});});};exports[_0xb8d2('0x1e')]=function(_0x2ee906){var _0x389710=this;return new Promise(function(_0x5d9573,_0x1d84ac){return db['ChatQueueReport']['update'](_0x2ee906[_0xb8d2('0x1b')],{'raw':_0x2ee906[_0xb8d2('0x1c')]?_0x2ee906[_0xb8d2('0x1c')][_0xb8d2('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2ee906[_0xb8d2('0x1c')]?_0x2ee906[_0xb8d2('0x1c')][_0xb8d2('0x1f')]||null:null,'attributes':_0x2ee906[_0xb8d2('0x1c')]?_0x2ee906[_0xb8d2('0x1c')][_0xb8d2('0x20')]||null:null,'limit':_0x2ee906[_0xb8d2('0x1c')]?_0x2ee906[_0xb8d2('0x1c')][_0xb8d2('0x21')]||null:null})[_0xb8d2('0xd')](function(_0x4d1539){logger[_0xb8d2('0xe')](_0xb8d2('0x1e'),_0x2ee906);logger[_0xb8d2('0x11')](_0xb8d2('0x1e'),_0x2ee906,JSON['stringify'](_0x4d1539));_0x5d9573(_0x4d1539);})['catch'](function(_0x4c40cf){logger['error']('UpdateChatQueueReport',_0x4c40cf[_0xb8d2('0x15')],_0x2ee906);_0x1d84ac(_0x389710[_0xb8d2('0x13')](0x1f4,_0x4c40cf['message']));});});}; \ No newline at end of file +var _0x7006=['../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','then','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','CreateChatQueueReport','ChatQueueReport','create','body','options','raw','stringify','catch','UpdateChatQueueReport','update','where','attributes','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x7006,0xe8));var _0x6700=function(_0x16b1a5,_0x318267){_0x16b1a5=_0x16b1a5-0x0;var _0x475e25=_0x7006[_0x16b1a5];return _0x475e25;};'use strict';var _=require(_0x6700('0x0'));var util=require(_0x6700('0x1'));var moment=require(_0x6700('0x2'));var BPromise=require(_0x6700('0x3'));var rs=require(_0x6700('0x4'));var fs=require('fs');var Redis=require(_0x6700('0x5'));var db=require(_0x6700('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x6700('0x7'))(_0x6700('0x8'));var config=require('../../config/environment');var jayson=require(_0x6700('0x9'));var client=jayson[_0x6700('0xa')][_0x6700('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1461af,_0x48910e,_0xd9c345){return new BPromise(function(_0x4d34f,_0x326f53){return client[_0x6700('0xc')](_0x1461af,_0xd9c345)[_0x6700('0xd')](function(_0x13df87){logger[_0x6700('0xe')](_0x6700('0xf'),_0x48910e,_0x6700('0x10'));logger[_0x6700('0x11')]('ChatQueueReport,\x20%s,\x20%s,\x20%s',_0x48910e,_0x6700('0x10'),JSON['stringify'](_0x13df87));if(_0x13df87[_0x6700('0x12')]){if(_0x13df87[_0x6700('0x12')][_0x6700('0x13')]===0x1f4){logger[_0x6700('0x12')]('ChatQueueReport,\x20%s,\x20%s',_0x48910e,_0x13df87['error'][_0x6700('0x14')]);return _0x326f53(_0x13df87['error'][_0x6700('0x14')]);}logger[_0x6700('0x12')](_0x6700('0xf'),_0x48910e,_0x13df87[_0x6700('0x12')][_0x6700('0x14')]);return _0x4d34f(_0x13df87[_0x6700('0x12')]['message']);}else{logger[_0x6700('0xe')](_0x6700('0xf'),_0x48910e,_0x6700('0x10'));_0x4d34f(_0x13df87[_0x6700('0x15')][_0x6700('0x14')]);}})['catch'](function(_0x3f8771){logger['error'](_0x6700('0xf'),_0x48910e,_0x3f8771);_0x326f53(_0x3f8771);});});}exports[_0x6700('0x16')]=function(_0x54fafd){var _0x276980=this;return new Promise(function(_0x3bfa60,_0x3c0bb1){return db[_0x6700('0x17')][_0x6700('0x18')](_0x54fafd[_0x6700('0x19')],{'raw':_0x54fafd[_0x6700('0x1a')]?_0x54fafd['options'][_0x6700('0x1b')]===undefined?!![]:![]:!![]})['then'](function(_0x30e1e3){logger[_0x6700('0xe')](_0x6700('0x16'),_0x54fafd);logger[_0x6700('0x11')](_0x6700('0x16'),_0x54fafd,JSON[_0x6700('0x1c')](_0x30e1e3));_0x3bfa60(_0x30e1e3);})[_0x6700('0x1d')](function(_0x423d2a){logger['error'](_0x6700('0x16'),_0x423d2a['message'],_0x54fafd);_0x3c0bb1(_0x276980[_0x6700('0x12')](0x1f4,_0x423d2a['message']));});});};exports[_0x6700('0x1e')]=function(_0x523435){var _0x1f7944=this;return new Promise(function(_0x5caba5,_0x1a0fc2){return db[_0x6700('0x17')][_0x6700('0x1f')](_0x523435['body'],{'raw':_0x523435[_0x6700('0x1a')]?_0x523435['options'][_0x6700('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x523435['options']?_0x523435[_0x6700('0x1a')][_0x6700('0x20')]||null:null,'attributes':_0x523435['options']?_0x523435[_0x6700('0x1a')][_0x6700('0x21')]||null:null,'limit':_0x523435['options']?_0x523435[_0x6700('0x1a')]['limit']||null:null})[_0x6700('0xd')](function(_0x2d1be2){logger['info'](_0x6700('0x1e'),_0x523435);logger[_0x6700('0x11')](_0x6700('0x1e'),_0x523435,JSON['stringify'](_0x2d1be2));_0x5caba5(_0x2d1be2);})[_0x6700('0x1d')](function(_0x4e6b12){logger[_0x6700('0x12')]('UpdateChatQueueReport',_0x4e6b12[_0x6700('0x14')],_0x523435);_0x1a0fc2(_0x1f7944[_0x6700('0x12')](0x1f4,_0x4e6b12['message']));});});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js index fbab1d8..afecf0d 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 _0xfb2f=['../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','describe','/:id','post','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x48999d,_0x1e02cb){var _0x1ad0d1=function(_0x3f974e){while(--_0x3f974e){_0x48999d['push'](_0x48999d['shift']());}};_0x1ad0d1(++_0x1e02cb);}(_0xfb2f,0x175));var _0xffb2=function(_0x153c8a,_0x485e29){_0x153c8a=_0x153c8a-0x0;var _0x3415c3=_0xfb2f[_0x153c8a];return _0x3415c3;};'use strict';var multer=require(_0xffb2('0x0'));var util=require(_0xffb2('0x1'));var path=require(_0xffb2('0x2'));var timeout=require(_0xffb2('0x3'));var express=require(_0xffb2('0x4'));var router=express[_0xffb2('0x5')]();var fs_extra=require(_0xffb2('0x6'));var auth=require(_0xffb2('0x7'));var interaction=require(_0xffb2('0x8'));var config=require('../../config/environment');var controller=require('./chatQueueReport.controller');router[_0xffb2('0x9')]('/',auth[_0xffb2('0xa')](),controller[_0xffb2('0xb')]);router['get']('/describe',auth['isAuthenticated'](),controller[_0xffb2('0xc')]);router[_0xffb2('0x9')](_0xffb2('0xd'),auth[_0xffb2('0xa')](),controller['show']);router[_0xffb2('0xe')]('/',auth[_0xffb2('0xa')](),controller['create']);router[_0xffb2('0xf')](_0xffb2('0xd'),auth[_0xffb2('0xa')](),controller[_0xffb2('0x10')]);router[_0xffb2('0x11')]('/:id',auth[_0xffb2('0xa')](),controller[_0xffb2('0x12')]);module[_0xffb2('0x13')]=router; \ No newline at end of file +var _0xc1dc=['path','Router','../../components/auth/service','../../config/environment','./chatQueueReport.controller','get','isAuthenticated','index','/describe','show','post','put','/:id','update','exports','util'];(function(_0x3efc77,_0x1fa6ad){var _0x146c7e=function(_0x3f59ea){while(--_0x3f59ea){_0x3efc77['push'](_0x3efc77['shift']());}};_0x146c7e(++_0x1fa6ad);}(_0xc1dc,0x10f));var _0xcc1d=function(_0x501576,_0x4dfa6b){_0x501576=_0x501576-0x0;var _0x6bdb6a=_0xc1dc[_0x501576];return _0x6bdb6a;};'use strict';var multer=require('multer');var util=require(_0xcc1d('0x0'));var path=require(_0xcc1d('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xcc1d('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0xcc1d('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0xcc1d('0x4'));var controller=require(_0xcc1d('0x5'));router[_0xcc1d('0x6')]('/',auth[_0xcc1d('0x7')](),controller[_0xcc1d('0x8')]);router[_0xcc1d('0x6')](_0xcc1d('0x9'),auth['isAuthenticated'](),controller['describe']);router[_0xcc1d('0x6')]('/:id',auth['isAuthenticated'](),controller[_0xcc1d('0xa')]);router[_0xcc1d('0xb')]('/',auth['isAuthenticated'](),controller['create']);router[_0xcc1d('0xc')](_0xcc1d('0xd'),auth[_0xcc1d('0x7')](),controller[_0xcc1d('0xe')]);router['delete'](_0xcc1d('0xd'),auth[_0xcc1d('0x7')](),controller['destroy']);module[_0xcc1d('0xf')]=router; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js index 936099e..75a4152 100644 --- a/server/api/chatTransferReport/chatTransferReport.attributes.js +++ b/server/api/chatTransferReport/chatTransferReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xedd9=['account','agent','queue','NOW','sequelize','exports','STRING','ENUM'];(function(_0x5d294a,_0x29e46b){var _0xab1f01=function(_0x338fbb){while(--_0x338fbb){_0x5d294a['push'](_0x5d294a['shift']());}};_0xab1f01(++_0x29e46b);}(_0xedd9,0xfc));var _0x9edd=function(_0x11c121,_0x13227f){_0x11c121=_0x11c121-0x0;var _0x17a8ee=_0xedd9[_0x11c121];return _0x17a8ee;};'use strict';var moment=require('moment');var Sequelize=require(_0x9edd('0x0'));module[_0x9edd('0x1')]={'uniqueid':{'type':Sequelize[_0x9edd('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x9edd('0x3')](_0x9edd('0x4'),_0x9edd('0x5'),_0x9edd('0x6')),'allowNull':![],'defaultValue':_0x9edd('0x6')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x9edd('0x7')]}}; \ No newline at end of file +var _0x54ef=['agent','queue','DATE','NOW','moment','sequelize','exports','ENUM','account'];(function(_0x2731f0,_0x126b1b){var _0x36a180=function(_0x44d1a9){while(--_0x44d1a9){_0x2731f0['push'](_0x2731f0['shift']());}};_0x36a180(++_0x126b1b);}(_0x54ef,0x112));var _0xf54e=function(_0x30bc8a,_0x45d4e4){_0x30bc8a=_0x30bc8a-0x0;var _0x115501=_0x54ef[_0x30bc8a];return _0x115501;};'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 d5428c2..9e90509 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 _0x94c9=['api','../../config/utils','../../config/environment','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','sendStatus','name','send','index','map','ChatTransferReport','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','destroy','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x5c351c,_0x2046d8){var _0x26f3b3=function(_0x47ac18){while(--_0x47ac18){_0x5c351c['push'](_0x5c351c['shift']());}};_0x26f3b3(++_0x2046d8);}(_0x94c9,0xd0));var _0x994c=function(_0x23b04e,_0x4d152e){_0x23b04e=_0x23b04e-0x0;var _0xf26ea3=_0x94c9[_0x23b04e];return _0xf26ea3;};'use strict';var emlformat=require(_0x994c('0x0'));var rimraf=require(_0x994c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x994c('0x2'));var rp=require(_0x994c('0x3'));var moment=require(_0x994c('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x994c('0x5'));var util=require(_0x994c('0x6'));var path=require(_0x994c('0x7'));var sox=require(_0x994c('0x8'));var csv=require(_0x994c('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x994c('0xa'));var _=require(_0x994c('0xb'));var squel=require('squel');var crypto=require(_0x994c('0xc'));var jsforce=require(_0x994c('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x994c('0xe'));var Papa=require(_0x994c('0xf'));var Redis=require(_0x994c('0x10'));var authService=require(_0x994c('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x994c('0x12'));var hardwareService=require(_0x994c('0x13'));var logger=require('../../config/logger')(_0x994c('0x14'));var utils=require(_0x994c('0x15'));var config=require(_0x994c('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2d4646,_0x515d24){_0x515d24=_0x515d24||0xcc;return function(_0x1f8dc5){if(_0x1f8dc5){return _0x2d4646['sendStatus'](_0x515d24);}return _0x2d4646[_0x994c('0x17')](_0x515d24)[_0x994c('0x18')]();};}function respondWithResult(_0x4321d7,_0x44090f){_0x44090f=_0x44090f||0xc8;return function(_0x3bad29){if(_0x3bad29){return _0x4321d7[_0x994c('0x17')](_0x44090f)[_0x994c('0x19')](_0x3bad29);}};}function respondWithFilteredResult(_0x4bd927,_0x140541){return function(_0x1dfc18){if(_0x1dfc18){var _0x46ec07=typeof _0x140541[_0x994c('0x1a')]===_0x994c('0x1b')&&typeof _0x140541[_0x994c('0x1c')]===_0x994c('0x1b');var _0x55bb5d=_0x1dfc18[_0x994c('0x1d')];var _0x38f2a6=_0x46ec07?0x0:_0x140541['offset'];var _0x41036a=_0x46ec07?_0x1dfc18['count']:_0x140541[_0x994c('0x1a')]+_0x140541['limit'];var _0x10fde1;if(_0x41036a>=_0x55bb5d){_0x41036a=_0x55bb5d;_0x10fde1=0xc8;}else{_0x10fde1=0xce;}_0x4bd927[_0x994c('0x17')](_0x10fde1);return _0x4bd927[_0x994c('0x1e')](_0x994c('0x1f'),_0x38f2a6+'-'+_0x41036a+'/'+_0x55bb5d)[_0x994c('0x19')](_0x1dfc18);}return null;};}function patchUpdates(_0x5499dc){return function(_0x56925a){try{jsonpatch['apply'](_0x56925a,_0x5499dc,!![]);}catch(_0x141f7b){return BPromise[_0x994c('0x20')](_0x141f7b);}return _0x56925a[_0x994c('0x21')]();};}function saveUpdates(_0x2aa7ed,_0x1bf35d){return function(_0x182a13){if(_0x182a13){return _0x182a13[_0x994c('0x22')](_0x2aa7ed)[_0x994c('0x23')](function(_0xddf9cd){return _0xddf9cd;});}return null;};}function removeEntity(_0x3b309c,_0x3f060b){return function(_0x414e6b){if(_0x414e6b){return _0x414e6b['destroy']()['then'](function(){_0x3b309c[_0x994c('0x17')](0xcc)[_0x994c('0x18')]();});}};}function handleEntityNotFound(_0x2bf2f9,_0x30ee4a){return function(_0x5c4cd2){if(!_0x5c4cd2){_0x2bf2f9[_0x994c('0x24')](0x194);}return _0x5c4cd2;};}function handleError(_0x46a616,_0xe79008){_0xe79008=_0xe79008||0x1f4;return function(_0x54ac8c){logger['error'](_0x54ac8c['stack']);if(_0x54ac8c['name']){delete _0x54ac8c[_0x994c('0x25')];}_0x46a616[_0x994c('0x17')](_0xe79008)[_0x994c('0x26')](_0x54ac8c);};}exports[_0x994c('0x27')]=function(_0x5c74c4,_0x430baf){var _0x344f81={},_0x1244f4={},_0x263476={'count':0x0,'rows':[]};var _0x24f52b=_[_0x994c('0x28')](db[_0x994c('0x29')]['rawAttributes'],function(_0x8f075d){return{'name':_0x8f075d[_0x994c('0x2a')],'type':_0x8f075d[_0x994c('0x2b')][_0x994c('0x2c')]};});_0x1244f4['model']=_[_0x994c('0x28')](_0x24f52b,_0x994c('0x25'));_0x1244f4[_0x994c('0x2d')]=_[_0x994c('0x2e')](_0x5c74c4[_0x994c('0x2d')]);_0x1244f4[_0x994c('0x2f')]=_[_0x994c('0x30')](_0x1244f4[_0x994c('0x31')],_0x1244f4[_0x994c('0x2d')]);_0x344f81[_0x994c('0x32')]=_[_0x994c('0x30')](_0x1244f4[_0x994c('0x31')],qs[_0x994c('0x33')](_0x5c74c4['query'][_0x994c('0x33')]));_0x344f81[_0x994c('0x32')]=_0x344f81[_0x994c('0x32')][_0x994c('0x34')]?_0x344f81[_0x994c('0x32')]:_0x1244f4[_0x994c('0x31')];if(!_0x5c74c4['query'][_0x994c('0x35')](_0x994c('0x36'))){_0x344f81['limit']=qs['limit'](_0x5c74c4[_0x994c('0x2d')]['limit']);_0x344f81[_0x994c('0x1a')]=qs[_0x994c('0x1a')](_0x5c74c4[_0x994c('0x2d')][_0x994c('0x1a')]);}_0x344f81[_0x994c('0x37')]=qs[_0x994c('0x38')](_0x5c74c4[_0x994c('0x2d')][_0x994c('0x38')]);_0x344f81[_0x994c('0x39')]=qs[_0x994c('0x2f')](_[_0x994c('0x3a')](_0x5c74c4[_0x994c('0x2d')],_0x1244f4[_0x994c('0x2f')]),_0x24f52b);if(_0x5c74c4[_0x994c('0x2d')]['filter']){_0x344f81[_0x994c('0x39')]=_[_0x994c('0x3b')](_0x344f81[_0x994c('0x39')],{'$or':_['map'](_0x24f52b,function(_0x414070){if(_0x414070[_0x994c('0x2b')]!==_0x994c('0x3c')){var _0x2b402e={};_0x2b402e[_0x414070[_0x994c('0x25')]]={'$like':'%'+_0x5c74c4[_0x994c('0x2d')][_0x994c('0x3d')]+'%'};return _0x2b402e;}})});}_0x344f81=_[_0x994c('0x3b')]({},_0x344f81,_0x5c74c4[_0x994c('0x3e')]);var _0x3861fa={'where':_0x344f81['where']};return db[_0x994c('0x29')][_0x994c('0x1d')](_0x3861fa)['then'](function(_0xad360e){_0x263476[_0x994c('0x1d')]=_0xad360e;if(_0x5c74c4[_0x994c('0x2d')][_0x994c('0x3f')]){_0x344f81[_0x994c('0x40')]=[{'all':!![]}];}return db[_0x994c('0x29')][_0x994c('0x41')](_0x344f81);})[_0x994c('0x23')](function(_0x1e18f0){_0x263476[_0x994c('0x42')]=_0x1e18f0;return _0x263476;})['then'](respondWithFilteredResult(_0x430baf,_0x344f81))[_0x994c('0x43')](handleError(_0x430baf,null));};exports[_0x994c('0x44')]=function(_0xc5a38c,_0x23864e){var _0x230608={'raw':!![],'where':{'id':_0xc5a38c[_0x994c('0x45')]['id']}},_0x4ec9e1={};_0x4ec9e1['model']=_['keys'](db[_0x994c('0x29')][_0x994c('0x46')]);_0x4ec9e1[_0x994c('0x2d')]=_[_0x994c('0x2e')](_0xc5a38c['query']);_0x4ec9e1['filters']=_['intersection'](_0x4ec9e1[_0x994c('0x31')],_0x4ec9e1[_0x994c('0x2d')]);_0x230608[_0x994c('0x32')]=_[_0x994c('0x30')](_0x4ec9e1[_0x994c('0x31')],qs[_0x994c('0x33')](_0xc5a38c[_0x994c('0x2d')][_0x994c('0x33')]));_0x230608['attributes']=_0x230608[_0x994c('0x32')][_0x994c('0x34')]?_0x230608[_0x994c('0x32')]:_0x4ec9e1[_0x994c('0x31')];if(_0xc5a38c[_0x994c('0x2d')][_0x994c('0x3f')]){_0x230608['include']=[{'all':!![]}];}_0x230608=_[_0x994c('0x3b')]({},_0x230608,_0xc5a38c[_0x994c('0x3e')]);return db[_0x994c('0x29')][_0x994c('0x47')](_0x230608)[_0x994c('0x23')](handleEntityNotFound(_0x23864e,null))[_0x994c('0x23')](respondWithResult(_0x23864e,null))['catch'](handleError(_0x23864e,null));};exports[_0x994c('0x48')]=function(_0x45dbc9,_0x2258be){return db['ChatTransferReport'][_0x994c('0x48')](_0x45dbc9[_0x994c('0x49')],{})[_0x994c('0x23')](respondWithResult(_0x2258be,0xc9))[_0x994c('0x43')](handleError(_0x2258be,null));};exports['update']=function(_0xfed8f2,_0x43a06a){if(_0xfed8f2[_0x994c('0x49')]['id']){delete _0xfed8f2[_0x994c('0x49')]['id'];}return db['ChatTransferReport'][_0x994c('0x47')]({'where':{'id':_0xfed8f2[_0x994c('0x45')]['id']}})['then'](handleEntityNotFound(_0x43a06a,null))[_0x994c('0x23')](saveUpdates(_0xfed8f2[_0x994c('0x49')],null))[_0x994c('0x23')](respondWithResult(_0x43a06a,null))['catch'](handleError(_0x43a06a,null));};exports[_0x994c('0x4a')]=function(_0x57e26a,_0x237e5b){return db[_0x994c('0x29')][_0x994c('0x47')]({'where':{'id':_0x57e26a[_0x994c('0x45')]['id']}})[_0x994c('0x23')](handleEntityNotFound(_0x237e5b,null))['then'](removeEntity(_0x237e5b,null))[_0x994c('0x43')](handleError(_0x237e5b,null));};exports[_0x994c('0x4b')]=function(_0x3735c3,_0x267ade){return db[_0x994c('0x29')][_0x994c('0x4b')]()[_0x994c('0x23')](respondWithResult(_0x267ade,null))['catch'](handleError(_0x267ade,null));}; \ No newline at end of file +var _0xf903=['order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','show','params','options','find','catch','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','end','status','json','offset','limit','undefined','count','set','Content-Range','reject','save','update','then','destroy','sendStatus','stack','name','send','index','map','ChatTransferReport','rawAttributes','fieldName','type','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xf903,0xa6));var _0x3f90=function(_0x29113f,_0x2fb25a){_0x29113f=_0x29113f-0x0;var _0x3e2009=_0xf903[_0x29113f];return _0x3e2009;};'use strict';var emlformat=require(_0x3f90('0x0'));var rimraf=require(_0x3f90('0x1'));var zipdir=require(_0x3f90('0x2'));var jsonpatch=require(_0x3f90('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x3f90('0x4'));var Mustache=require('mustache');var util=require(_0x3f90('0x5'));var path=require(_0x3f90('0x6'));var sox=require(_0x3f90('0x7'));var csv=require(_0x3f90('0x8'));var ejs=require(_0x3f90('0x9'));var fs=require('fs');var fs_extra=require(_0x3f90('0xa'));var _=require('lodash');var squel=require(_0x3f90('0xb'));var crypto=require(_0x3f90('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x3f90('0x8'));var querystring=require('querystring');var Papa=require(_0x3f90('0xd'));var Redis=require(_0x3f90('0xe'));var authService=require(_0x3f90('0xf'));var qs=require(_0x3f90('0x10'));var as=require(_0x3f90('0x11'));var hardwareService=require(_0x3f90('0x12'));var logger=require(_0x3f90('0x13'))(_0x3f90('0x14'));var utils=require('../../config/utils');var config=require(_0x3f90('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3b4e73,_0x198818){_0x198818=_0x198818||0xcc;return function(_0x2a8551){if(_0x2a8551){return _0x3b4e73['sendStatus'](_0x198818);}return _0x3b4e73['status'](_0x198818)[_0x3f90('0x16')]();};}function respondWithResult(_0x38f5bb,_0x1ae16e){_0x1ae16e=_0x1ae16e||0xc8;return function(_0x2a4daa){if(_0x2a4daa){return _0x38f5bb[_0x3f90('0x17')](_0x1ae16e)[_0x3f90('0x18')](_0x2a4daa);}};}function respondWithFilteredResult(_0x577175,_0x3ab111){return function(_0x279d37){if(_0x279d37){var _0x586d0a=typeof _0x3ab111[_0x3f90('0x19')]==='undefined'&&typeof _0x3ab111[_0x3f90('0x1a')]===_0x3f90('0x1b');var _0x58231e=_0x279d37[_0x3f90('0x1c')];var _0x41bd2f=_0x586d0a?0x0:_0x3ab111[_0x3f90('0x19')];var _0x4fec5a=_0x586d0a?_0x279d37[_0x3f90('0x1c')]:_0x3ab111[_0x3f90('0x19')]+_0x3ab111['limit'];var _0x198571;if(_0x4fec5a>=_0x58231e){_0x4fec5a=_0x58231e;_0x198571=0xc8;}else{_0x198571=0xce;}_0x577175[_0x3f90('0x17')](_0x198571);return _0x577175[_0x3f90('0x1d')](_0x3f90('0x1e'),_0x41bd2f+'-'+_0x4fec5a+'/'+_0x58231e)['json'](_0x279d37);}return null;};}function patchUpdates(_0x1e0f1b){return function(_0xe475fd){try{jsonpatch['apply'](_0xe475fd,_0x1e0f1b,!![]);}catch(_0x52a770){return BPromise[_0x3f90('0x1f')](_0x52a770);}return _0xe475fd[_0x3f90('0x20')]();};}function saveUpdates(_0x51273d,_0x24419b){return function(_0x5699c0){if(_0x5699c0){return _0x5699c0[_0x3f90('0x21')](_0x51273d)[_0x3f90('0x22')](function(_0x9ac26f){return _0x9ac26f;});}return null;};}function removeEntity(_0x4374a6,_0x45c435){return function(_0x586cfe){if(_0x586cfe){return _0x586cfe[_0x3f90('0x23')]()[_0x3f90('0x22')](function(){_0x4374a6['status'](0xcc)[_0x3f90('0x16')]();});}};}function handleEntityNotFound(_0x45a247,_0x460ec0){return function(_0x11f3ad){if(!_0x11f3ad){_0x45a247[_0x3f90('0x24')](0x194);}return _0x11f3ad;};}function handleError(_0x3224f9,_0x88991c){_0x88991c=_0x88991c||0x1f4;return function(_0x34fae9){logger['error'](_0x34fae9[_0x3f90('0x25')]);if(_0x34fae9[_0x3f90('0x26')]){delete _0x34fae9[_0x3f90('0x26')];}_0x3224f9[_0x3f90('0x17')](_0x88991c)[_0x3f90('0x27')](_0x34fae9);};}exports[_0x3f90('0x28')]=function(_0x22b4ad,_0x500098){var _0x307fd2={},_0x1da3f0={},_0x1efe5f={'count':0x0,'rows':[]};var _0x447130=_[_0x3f90('0x29')](db[_0x3f90('0x2a')][_0x3f90('0x2b')],function(_0xdedca5){return{'name':_0xdedca5[_0x3f90('0x2c')],'type':_0xdedca5[_0x3f90('0x2d')]['key']};});_0x1da3f0[_0x3f90('0x2e')]=_[_0x3f90('0x29')](_0x447130,'name');_0x1da3f0['query']=_[_0x3f90('0x2f')](_0x22b4ad['query']);_0x1da3f0[_0x3f90('0x30')]=_[_0x3f90('0x31')](_0x1da3f0[_0x3f90('0x2e')],_0x1da3f0[_0x3f90('0x32')]);_0x307fd2[_0x3f90('0x33')]=_[_0x3f90('0x31')](_0x1da3f0[_0x3f90('0x2e')],qs['fields'](_0x22b4ad[_0x3f90('0x32')][_0x3f90('0x34')]));_0x307fd2[_0x3f90('0x33')]=_0x307fd2[_0x3f90('0x33')][_0x3f90('0x35')]?_0x307fd2[_0x3f90('0x33')]:_0x1da3f0[_0x3f90('0x2e')];if(!_0x22b4ad[_0x3f90('0x32')][_0x3f90('0x36')](_0x3f90('0x37'))){_0x307fd2[_0x3f90('0x1a')]=qs[_0x3f90('0x1a')](_0x22b4ad[_0x3f90('0x32')][_0x3f90('0x1a')]);_0x307fd2[_0x3f90('0x19')]=qs['offset'](_0x22b4ad[_0x3f90('0x32')][_0x3f90('0x19')]);}_0x307fd2[_0x3f90('0x38')]=qs[_0x3f90('0x39')](_0x22b4ad[_0x3f90('0x32')][_0x3f90('0x39')]);_0x307fd2[_0x3f90('0x3a')]=qs['filters'](_[_0x3f90('0x3b')](_0x22b4ad['query'],_0x1da3f0['filters']),_0x447130);if(_0x22b4ad[_0x3f90('0x32')][_0x3f90('0x3c')]){_0x307fd2[_0x3f90('0x3a')]=_[_0x3f90('0x3d')](_0x307fd2['where'],{'$or':_[_0x3f90('0x29')](_0x447130,function(_0x16cfa9){if(_0x16cfa9[_0x3f90('0x2d')]!==_0x3f90('0x3e')){var _0x467abe={};_0x467abe[_0x16cfa9['name']]={'$like':'%'+_0x22b4ad[_0x3f90('0x32')][_0x3f90('0x3c')]+'%'};return _0x467abe;}})});}_0x307fd2=_[_0x3f90('0x3d')]({},_0x307fd2,_0x22b4ad['options']);var _0x1911a6={'where':_0x307fd2[_0x3f90('0x3a')]};return db[_0x3f90('0x2a')][_0x3f90('0x1c')](_0x1911a6)[_0x3f90('0x22')](function(_0x544196){_0x1efe5f[_0x3f90('0x1c')]=_0x544196;if(_0x22b4ad[_0x3f90('0x32')][_0x3f90('0x3f')]){_0x307fd2[_0x3f90('0x40')]=[{'all':!![]}];}return db[_0x3f90('0x2a')][_0x3f90('0x41')](_0x307fd2);})['then'](function(_0x46877e){_0x1efe5f['rows']=_0x46877e;return _0x1efe5f;})['then'](respondWithFilteredResult(_0x500098,_0x307fd2))['catch'](handleError(_0x500098,null));};exports[_0x3f90('0x42')]=function(_0x2c7e9,_0x33ffe9){var _0x13b57b={'raw':!![],'where':{'id':_0x2c7e9[_0x3f90('0x43')]['id']}},_0x4ee69b={};_0x4ee69b[_0x3f90('0x2e')]=_[_0x3f90('0x2f')](db[_0x3f90('0x2a')][_0x3f90('0x2b')]);_0x4ee69b['query']=_[_0x3f90('0x2f')](_0x2c7e9[_0x3f90('0x32')]);_0x4ee69b['filters']=_[_0x3f90('0x31')](_0x4ee69b[_0x3f90('0x2e')],_0x4ee69b[_0x3f90('0x32')]);_0x13b57b['attributes']=_['intersection'](_0x4ee69b['model'],qs[_0x3f90('0x34')](_0x2c7e9[_0x3f90('0x32')]['fields']));_0x13b57b[_0x3f90('0x33')]=_0x13b57b[_0x3f90('0x33')]['length']?_0x13b57b[_0x3f90('0x33')]:_0x4ee69b[_0x3f90('0x2e')];if(_0x2c7e9['query'][_0x3f90('0x3f')]){_0x13b57b[_0x3f90('0x40')]=[{'all':!![]}];}_0x13b57b=_[_0x3f90('0x3d')]({},_0x13b57b,_0x2c7e9[_0x3f90('0x44')]);return db[_0x3f90('0x2a')][_0x3f90('0x45')](_0x13b57b)[_0x3f90('0x22')](handleEntityNotFound(_0x33ffe9,null))['then'](respondWithResult(_0x33ffe9,null))[_0x3f90('0x46')](handleError(_0x33ffe9,null));};exports[_0x3f90('0x47')]=function(_0x373e26,_0x1fc770){return db[_0x3f90('0x2a')]['create'](_0x373e26['body'],{})[_0x3f90('0x22')](respondWithResult(_0x1fc770,0xc9))[_0x3f90('0x46')](handleError(_0x1fc770,null));};exports[_0x3f90('0x21')]=function(_0x10bf85,_0x3ac814){if(_0x10bf85[_0x3f90('0x48')]['id']){delete _0x10bf85[_0x3f90('0x48')]['id'];}return db[_0x3f90('0x2a')]['find']({'where':{'id':_0x10bf85[_0x3f90('0x43')]['id']}})[_0x3f90('0x22')](handleEntityNotFound(_0x3ac814,null))[_0x3f90('0x22')](saveUpdates(_0x10bf85['body'],null))[_0x3f90('0x22')](respondWithResult(_0x3ac814,null))[_0x3f90('0x46')](handleError(_0x3ac814,null));};exports[_0x3f90('0x23')]=function(_0x3abf34,_0x599266){return db[_0x3f90('0x2a')][_0x3f90('0x45')]({'where':{'id':_0x3abf34['params']['id']}})[_0x3f90('0x22')](handleEntityNotFound(_0x599266,null))['then'](removeEntity(_0x599266,null))[_0x3f90('0x46')](handleError(_0x599266,null));};exports[_0x3f90('0x49')]=function(_0x262746,_0xc24c0){return db[_0x3f90('0x2a')][_0x3f90('0x49')]()[_0x3f90('0x22')](respondWithResult(_0xc24c0,null))[_0x3f90('0x46')](handleError(_0xc24c0,null));}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js index 5f3114d..49f97d7 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 _0xa0be=['./chatTransferReport.attributes','exports','define','ChatTransferReport','report_chat_transfer','uniqueid','lodash','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xa0be,0xe6));var _0xea0b=function(_0x1685ac,_0x2bf3f8){_0x1685ac=_0x1685ac-0x0;var _0x5ef81d=_0xa0be[_0x1685ac];return _0x5ef81d;};'use strict';var _=require(_0xea0b('0x0'));var util=require(_0xea0b('0x1'));var logger=require(_0xea0b('0x2'))(_0xea0b('0x3'));var moment=require('moment');var BPromise=require(_0xea0b('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xea0b('0x5'));var rimraf=require(_0xea0b('0x6'));var config=require(_0xea0b('0x7'));var attributes=require(_0xea0b('0x8'));module[_0xea0b('0x9')]=function(_0x2a09f8,_0x598b35){return _0x2a09f8[_0xea0b('0xa')](_0xea0b('0xb'),attributes,{'tableName':_0xea0b('0xc'),'paranoid':![],'indexes':[{'name':_0xea0b('0xd'),'fields':[_0xea0b('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x49e7=['exports','define','uniqueid','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x49e7,0x177));var _0x749e=function(_0x17d96b,_0x346ba7){_0x17d96b=_0x17d96b-0x0;var _0x949d6f=_0x49e7[_0x17d96b];return _0x949d6f;};'use strict';var _=require(_0x749e('0x0'));var util=require(_0x749e('0x1'));var logger=require(_0x749e('0x2'))('api');var moment=require(_0x749e('0x3'));var BPromise=require(_0x749e('0x4'));var rp=require(_0x749e('0x5'));var fs=require('fs');var path=require(_0x749e('0x6'));var rimraf=require(_0x749e('0x7'));var config=require(_0x749e('0x8'));var attributes=require('./chatTransferReport.attributes');module[_0x749e('0x9')]=function(_0x49eb6e,_0x447758){return _0x49eb6e[_0x749e('0xa')]('ChatTransferReport',attributes,{'tableName':'report_chat_transfer','paranoid':![],'indexes':[{'name':_0x749e('0xb'),'fields':[_0x749e('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js index b6b85ee..f907bf6 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 _0xadf8=['../../config/environment','jayson/promise','client','http','request','then','ChatTransferReport,\x20%s,\x20%s','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc'];(function(_0x5862c2,_0x3f6f0a){var _0x2064ab=function(_0x42b4d2){while(--_0x42b4d2){_0x5862c2['push'](_0x5862c2['shift']());}};_0x2064ab(++_0x3f6f0a);}(_0xadf8,0x158));var _0x8adf=function(_0x1e271f,_0xf14504){_0x1e271f=_0x1e271f-0x0;var _0x2b2ac5=_0xadf8[_0x1e271f];return _0x2b2ac5;};'use strict';var _=require(_0x8adf('0x0'));var util=require(_0x8adf('0x1'));var moment=require(_0x8adf('0x2'));var BPromise=require(_0x8adf('0x3'));var rs=require(_0x8adf('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x8adf('0x5'));var logger=require(_0x8adf('0x6'))(_0x8adf('0x7'));var config=require(_0x8adf('0x8'));var jayson=require(_0x8adf('0x9'));var client=jayson[_0x8adf('0xa')][_0x8adf('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x55d6d5,_0x47075c,_0x143652){return new BPromise(function(_0x335540,_0x292cd6){return client[_0x8adf('0xc')](_0x55d6d5,_0x143652)[_0x8adf('0xd')](function(_0x29ee91){logger['info'](_0x8adf('0xe'),_0x47075c,'request\x20sent');logger['debug'](_0x8adf('0xf'),_0x47075c,'request\x20sent',JSON[_0x8adf('0x10')](_0x29ee91));if(_0x29ee91[_0x8adf('0x11')]){if(_0x29ee91[_0x8adf('0x11')]['code']===0x1f4){logger[_0x8adf('0x11')]('ChatTransferReport,\x20%s,\x20%s',_0x47075c,_0x29ee91[_0x8adf('0x11')][_0x8adf('0x12')]);return _0x292cd6(_0x29ee91[_0x8adf('0x11')]['message']);}logger[_0x8adf('0x11')](_0x8adf('0xe'),_0x47075c,_0x29ee91[_0x8adf('0x11')][_0x8adf('0x12')]);return _0x335540(_0x29ee91[_0x8adf('0x11')][_0x8adf('0x12')]);}else{logger[_0x8adf('0x13')]('ChatTransferReport,\x20%s,\x20%s',_0x47075c,'request\x20sent');_0x335540(_0x29ee91[_0x8adf('0x14')][_0x8adf('0x12')]);}})[_0x8adf('0x15')](function(_0x296dfa){logger['error']('ChatTransferReport,\x20%s,\x20%s',_0x47075c,_0x296dfa);_0x292cd6(_0x296dfa);});});} \ No newline at end of file +var _0xdc33=['result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','ChatTransferReport,\x20%s,\x20%s','request\x20sent','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info'];(function(_0x4718c3,_0x39f158){var _0x13afd4=function(_0x2c1d04){while(--_0x2c1d04){_0x4718c3['push'](_0x4718c3['shift']());}};_0x13afd4(++_0x39f158);}(_0xdc33,0x1c4));var _0x3dc3=function(_0x37476b,_0x25a957){_0x37476b=_0x37476b-0x0;var _0x8c4026=_0xdc33[_0x37476b];return _0x8c4026;};'use strict';var _=require(_0x3dc3('0x0'));var util=require(_0x3dc3('0x1'));var moment=require(_0x3dc3('0x2'));var BPromise=require(_0x3dc3('0x3'));var rs=require(_0x3dc3('0x4'));var fs=require('fs');var Redis=require(_0x3dc3('0x5'));var db=require(_0x3dc3('0x6'))['db'];var utils=require(_0x3dc3('0x7'));var logger=require(_0x3dc3('0x8'))(_0x3dc3('0x9'));var config=require(_0x3dc3('0xa'));var jayson=require(_0x3dc3('0xb'));var client=jayson['client'][_0x3dc3('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x50d309,_0x16341c,_0x4fdfca){return new BPromise(function(_0x5004ab,_0x30f487){return client[_0x3dc3('0xd')](_0x50d309,_0x4fdfca)[_0x3dc3('0xe')](function(_0x41ead5){logger['info'](_0x3dc3('0xf'),_0x16341c,_0x3dc3('0x10'));logger['debug'](_0x3dc3('0x11'),_0x16341c,_0x3dc3('0x10'),JSON[_0x3dc3('0x12')](_0x41ead5));if(_0x41ead5[_0x3dc3('0x13')]){if(_0x41ead5[_0x3dc3('0x13')][_0x3dc3('0x14')]===0x1f4){logger[_0x3dc3('0x13')]('ChatTransferReport,\x20%s,\x20%s',_0x16341c,_0x41ead5[_0x3dc3('0x13')][_0x3dc3('0x15')]);return _0x30f487(_0x41ead5[_0x3dc3('0x13')][_0x3dc3('0x15')]);}logger[_0x3dc3('0x13')](_0x3dc3('0xf'),_0x16341c,_0x41ead5[_0x3dc3('0x13')][_0x3dc3('0x15')]);return _0x5004ab(_0x41ead5[_0x3dc3('0x13')]['message']);}else{logger[_0x3dc3('0x16')](_0x3dc3('0xf'),_0x16341c,_0x3dc3('0x10'));_0x5004ab(_0x41ead5[_0x3dc3('0x17')]['message']);}})[_0x3dc3('0x18')](function(_0x39fdae){logger[_0x3dc3('0x13')]('ChatTransferReport,\x20%s,\x20%s',_0x16341c,_0x39fdae);_0x30f487(_0x39fdae);});});} \ No newline at end of file diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js index 95ccce1..5d59c08 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 _0x7b11=['put','update','delete','exports','multer','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatTransferReport.controller','get','/describe','isAuthenticated','describe','/:id','show','post','create'];(function(_0x322a48,_0x3d1929){var _0x46c151=function(_0x6d4f86){while(--_0x6d4f86){_0x322a48['push'](_0x322a48['shift']());}};_0x46c151(++_0x3d1929);}(_0x7b11,0x1a8));var _0x17b1=function(_0x3332dd,_0xf4f34c){_0x3332dd=_0x3332dd-0x0;var _0x27825d=_0x7b11[_0x3332dd];return _0x27825d;};'use strict';var multer=require(_0x17b1('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x17b1('0x1'));var express=require(_0x17b1('0x2'));var router=express[_0x17b1('0x3')]();var fs_extra=require(_0x17b1('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x17b1('0x5'));var config=require(_0x17b1('0x6'));var controller=require(_0x17b1('0x7'));router[_0x17b1('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x17b1('0x8')](_0x17b1('0x9'),auth[_0x17b1('0xa')](),controller[_0x17b1('0xb')]);router[_0x17b1('0x8')](_0x17b1('0xc'),auth[_0x17b1('0xa')](),controller[_0x17b1('0xd')]);router[_0x17b1('0xe')]('/',auth[_0x17b1('0xa')](),controller[_0x17b1('0xf')]);router[_0x17b1('0x10')]('/:id',auth[_0x17b1('0xa')](),controller[_0x17b1('0x11')]);router[_0x17b1('0x12')](_0x17b1('0xc'),auth[_0x17b1('0xa')](),controller['destroy']);module[_0x17b1('0x13')]=router; \ No newline at end of file +var _0x3994=['../../components/interaction/service','./chatTransferReport.controller','get','isAuthenticated','index','/describe','post','create','put','/:id','update','delete','destroy','exports','multer','util','path','Router'];(function(_0x3f5f8e,_0x12f85c){var _0x54942b=function(_0x25bc70){while(--_0x25bc70){_0x3f5f8e['push'](_0x3f5f8e['shift']());}};_0x54942b(++_0x12f85c);}(_0x3994,0x19a));var _0x4399=function(_0xa40c1a,_0x27e5ce){_0xa40c1a=_0xa40c1a-0x0;var _0x2cb5ff=_0x3994[_0xa40c1a];return _0x2cb5ff;};'use strict';var multer=require(_0x4399('0x0'));var util=require(_0x4399('0x1'));var path=require(_0x4399('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x4399('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x4399('0x4'));var config=require('../../config/environment');var controller=require(_0x4399('0x5'));router[_0x4399('0x6')]('/',auth[_0x4399('0x7')](),controller[_0x4399('0x8')]);router[_0x4399('0x6')](_0x4399('0x9'),auth[_0x4399('0x7')](),controller['describe']);router['get']('/:id',auth[_0x4399('0x7')](),controller['show']);router[_0x4399('0xa')]('/',auth[_0x4399('0x7')](),controller[_0x4399('0xb')]);router[_0x4399('0xc')](_0x4399('0xd'),auth[_0x4399('0x7')](),controller[_0x4399('0xe')]);router[_0x4399('0xf')]('/:id',auth[_0x4399('0x7')](),controller[_0x4399('0x10')]);module[_0x4399('0x11')]=router; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js index fdf2e83..0bbf7a0 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 _0xf1f6=['textarea','Comments','Leave\x20your\x20comments','offlineForm','getDataValue','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','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','CHAT','alternate','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','sequelize','randomstring','exports','STRING','address','email','Agent','#011F6A','#ffffff','INTEGER','BOOLEAN','ENUM','rounded','squared','We\x20are\x20here!','Chat','Send','Contact\x20us','TEXT','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Type\x20a\x20message','Skip','thumb','star','input','name','text','parse','onlineForm','setDataValue','stringify'];(function(_0x402718,_0x22529c){var _0x3e6afb=function(_0x456b60){while(--_0x456b60){_0x402718['push'](_0x402718['shift']());}};_0x3e6afb(++_0x22529c);}(_0xf1f6,0x7b));var _0x6f1f=function(_0x17cd6b,_0x23de4f){_0x17cd6b=_0x17cd6b-0x0;var _0x3c66d8=_0xf1f6[_0x17cd6b];return _0x3c66d8;};'use strict';var Sequelize=require(_0x6f1f('0x0'));var rs=require(_0x6f1f('0x1'));module[_0x6f1f('0x2')]={'name':{'type':Sequelize[_0x6f1f('0x3')],'allowNull':![]},'address':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x6f1f('0x4')},'description':{'type':Sequelize[_0x6f1f('0x3')]},'mapKey':{'type':Sequelize[_0x6f1f('0x3')],'defaultValue':_0x6f1f('0x5')},'mapKeyOffline':{'type':Sequelize['STRING'],'defaultValue':'email'},'key':{'type':Sequelize['STRING'],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x6f1f('0x3')],'defaultValue':_0x6f1f('0x6')},'customerAlias':{'type':Sequelize[_0x6f1f('0x3')],'defaultValue':'Me'},'color':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x6f1f('0x7'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x6f1f('0x3')],'allowNull':![],'defaultValue':_0x6f1f('0x7'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x6f1f('0x8'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0x6f1f('0x3')],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x6f1f('0x9')],'defaultValue':0xf},'remote':{'type':Sequelize[_0x6f1f('0x3')]},'animation':{'type':Sequelize[_0x6f1f('0xa')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x6f1f('0xb')](_0x6f1f('0xc'),_0x6f1f('0xd')),'defaultValue':_0x6f1f('0xc')},'header_online':{'type':Sequelize[_0x6f1f('0x3')],'defaultValue':_0x6f1f('0xe')},'start_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0x6f1f('0xf')},'offline_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0x6f1f('0x10')},'header_offline':{'type':Sequelize[_0x6f1f('0x3')],'defaultValue':_0x6f1f('0x11')},'download_transcript':{'type':Sequelize[_0x6f1f('0xa')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x6f1f('0x9')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x6f1f('0x3')],'defaultValue':'Powered\x20by\x20xCALLY'},'defaultWhiteLabel':{'type':Sequelize[_0x6f1f('0xa')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x6f1f('0x12')]},'closingQuestion':{'type':Sequelize[_0x6f1f('0x3')],'defaultValue':'Do\x20you\x20want\x20to\x20close\x20the\x20interaction?'},'formSubmitSuccessMessage':{'type':Sequelize[_0x6f1f('0x3')],'defaultValue':_0x6f1f('0x13')},'formSubmitFailureMessage':{'type':Sequelize['STRING'],'defaultValue':_0x6f1f('0x14')},'noteTitle':{'type':Sequelize['STRING'],'defaultValue':_0x6f1f('0x15')},'placeholderMessage':{'type':Sequelize['STRING'],'defaultValue':_0x6f1f('0x16')},'closingMessage':{'type':Sequelize[_0x6f1f('0x3')],'defaultValue':'Thanks\x20you\x20for\x20your\x20time!'},'closingMessageButton':{'type':Sequelize[_0x6f1f('0x3')],'defaultValue':'Send'},'skipMessageButton':{'type':Sequelize[_0x6f1f('0x3')],'defaultValue':_0x6f1f('0x17')},'conditionAgreement':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x6f1f('0xa')],'defaultValue':![]},'enableFeedback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x6f1f('0xa')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x6f1f('0x3')],'defaultValue':'Feedback'},'ratingType':{'type':Sequelize[_0x6f1f('0xb')]('star',_0x6f1f('0x18')),'defaultValue':_0x6f1f('0x19')},'ratingStarsNumber':{'type':Sequelize[_0x6f1f('0x9')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x6f1f('0x12')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0x6f1f('0x1a'),'variable':null,'config':{'placeholder':_0x6f1f('0x1b'),'type':_0x6f1f('0x1c'),'required':!![]},'props':{'title':_0x6f1f('0x1b'),'helpText':''}},{'type':'input','props':{'title':_0x6f1f('0x5'),'helpText':''},'config':{'required':!![],'placeholder':_0x6f1f('0x5'),'type':_0x6f1f('0x5')},'variable':null}],'fromKey':0x1});},'get':function(){return this['getDataValue']('onlineForm')?JSON[_0x6f1f('0x1d')](this['getDataValue'](_0x6f1f('0x1e'))):{};},'set':function(_0x3d510b){return this[_0x6f1f('0x1f')](_0x6f1f('0x1e'),JSON[_0x6f1f('0x20')](_0x3d510b));}},'offlineForm':{'type':Sequelize[_0x6f1f('0x12')],'defaultValue':function(){return JSON[_0x6f1f('0x20')]({'items':[{'type':_0x6f1f('0x1a'),'props':{'title':_0x6f1f('0x5'),'helpText':''},'config':{'required':!![],'placeholder':_0x6f1f('0x5'),'type':_0x6f1f('0x5')},'variable':null},{'type':_0x6f1f('0x21'),'config':{'placeholder':'Comments'},'props':{'title':_0x6f1f('0x22'),'helpText':_0x6f1f('0x23')}}],'fromKey':0x0});},'get':function(){return this['getDataValue'](_0x6f1f('0x24'))?JSON['parse'](this[_0x6f1f('0x25')](_0x6f1f('0x24'))):{};},'set':function(_0x3e4011){return this[_0x6f1f('0x1f')](_0x6f1f('0x24'),JSON[_0x6f1f('0x20')](_0x3e4011));}},'token':{'type':Sequelize[_0x6f1f('0x3')],'defaultValue':function(){return rs['generate']();}},'autoclose':{'type':Sequelize[_0x6f1f('0xa')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x6f1f('0xa')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x6f1f('0xa')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x6f1f('0x3')]},'forwardOffline':{'type':Sequelize[_0x6f1f('0xa')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x6f1f('0x3')]},'waitingTitle':{'type':Sequelize['STRING'],'defaultValue':_0x6f1f('0x26')},'waitingMessage':{'type':Sequelize[_0x6f1f('0x3')],'defaultValue':'Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.'},'offlineMessageSubject':{'type':Sequelize[_0x6f1f('0x3')],'defaultValue':_0x6f1f('0x27')},'offlineMessageBody':{'type':Sequelize[_0x6f1f('0x3')],'defaultValue':_0x6f1f('0x28')},'enableUnmanagedNote':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x6f1f('0x3')],'defaultValue':_0x6f1f('0x29')},'skipUnmanaged':{'type':Sequelize[_0x6f1f('0x3')],'defaultValue':'Skip'},'sendUnmanaged':{'type':Sequelize[_0x6f1f('0x3')],'defaultValue':_0x6f1f('0x10')},'enableCustomerAttachment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x6f1f('0xa')],'defaultValue':![]},'agentAvatar':{'type':Sequelize['TEXT']},'showAgentAvatar':{'type':Sequelize[_0x6f1f('0xa')],'defaultValue':![]},'timezone':{'type':Sequelize[_0x6f1f('0x3')]},'notificationTemplate':{'type':Sequelize[_0x6f1f('0x12')],'defaultValue':function(){return _0x6f1f('0x2a');}},'notificationSound':{'type':Sequelize[_0x6f1f('0xa')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x6f1f('0xa')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x6f1f('0xa')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x6f1f('0x3')],'defaultValue':_0x6f1f('0x2b')},'waitForTheAssignedAgent':{'type':Sequelize[_0x6f1f('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0x6f1f('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x6f1f('0x3')],'defaultValue':'bottom_right'},'verticalAlignment':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0x6f1f('0x3')],'defaultValue':_0x6f1f('0x2c')},'messagesAlignment':{'type':Sequelize[_0x6f1f('0x3')],'defaultValue':_0x6f1f('0x2d')},'defaultTitle':{'type':Sequelize[_0x6f1f('0x3')]},'customerAvatar':{'type':Sequelize['TEXT']},'showCustomerAvatar':{'type':Sequelize[_0x6f1f('0xa')],'defaultValue':![]},'messageFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc},'backgroundColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#fafafa','validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x6f1f('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x6f1f('0xa')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x6f1f('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x6f1f('0x3')],'defaultValue':_0x6f1f('0x2e')},'systemAvatar':{'type':Sequelize[_0x6f1f('0x12')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x6f1f('0x9')],'comment':_0x6f1f('0x2f')},'mandatoryDisposition':{'type':Sequelize[_0x6f1f('0xa')],'defaultValue':![],'comment':_0x6f1f('0x30'),'set':function(_0x27be9e){if(!_0x27be9e)this['setDataValue'](_0x6f1f('0x31'),null);this['setDataValue'](_0x6f1f('0x32'),_0x27be9e);}},'vidaooEscalation':{'type':Sequelize[_0x6f1f('0xa')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize['STRING']},'vidaooTopic':{'type':Sequelize[_0x6f1f('0x3')],'allowNull':![],'defaultValue':_0x6f1f('0x33')},'vidaooNote':{'type':Sequelize[_0x6f1f('0x3')],'defaultValue':function(){return'Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}';}},'vidaooMetadata':{'type':Sequelize[_0x6f1f('0x12')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x6f1f('0xa')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x6f1f('0x12')]}}; \ No newline at end of file +var _0x7fb3=['Thanks\x20you\x20for\x20your\x20time!','Send','Skip','Feedback','star','thumb','TEXT','stringify','name','text','input','getDataValue','onlineForm','setDataValue','Comments','Leave\x20your\x20comments','offlineForm','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','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','CHAT','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','randomstring','STRING','address','email','#011F6A','#ffffff','INTEGER','BOOLEAN','rounded','squared','We\x20are\x20here!','Chat','Contact\x20us','Powered\x20by\x20xCALLY','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Note','Type\x20a\x20message'];(function(_0x47b58b,_0x41a189){var _0x46bebe=function(_0x22bbfa){while(--_0x22bbfa){_0x47b58b['push'](_0x47b58b['shift']());}};_0x46bebe(++_0x41a189);}(_0x7fb3,0x1cf));var _0x37fb=function(_0x9dd431,_0x389313){_0x9dd431=_0x9dd431-0x0;var _0x1aa903=_0x7fb3[_0x9dd431];return _0x1aa903;};'use strict';var Sequelize=require('sequelize');var rs=require(_0x37fb('0x0'));module['exports']={'name':{'type':Sequelize[_0x37fb('0x1')],'allowNull':![]},'address':{'type':Sequelize[_0x37fb('0x1')],'allowNull':![],'unique':_0x37fb('0x2')},'description':{'type':Sequelize['STRING']},'mapKey':{'type':Sequelize[_0x37fb('0x1')],'defaultValue':_0x37fb('0x3')},'mapKeyOffline':{'type':Sequelize[_0x37fb('0x1')],'defaultValue':_0x37fb('0x3')},'key':{'type':Sequelize[_0x37fb('0x1')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x37fb('0x1')],'defaultValue':'Agent'},'customerAlias':{'type':Sequelize[_0x37fb('0x1')],'defaultValue':'Me'},'color':{'type':Sequelize[_0x37fb('0x1')],'allowNull':![],'defaultValue':_0x37fb('0x4'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x37fb('0x1')],'allowNull':![],'defaultValue':_0x37fb('0x4'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x37fb('0x1')],'allowNull':![],'defaultValue':_0x37fb('0x5'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0x37fb('0x1')],'allowNull':![],'defaultValue':_0x37fb('0x5'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x37fb('0x6')],'defaultValue':0xf},'remote':{'type':Sequelize[_0x37fb('0x1')]},'animation':{'type':Sequelize[_0x37fb('0x7')],'defaultValue':!![]},'header_shape':{'type':Sequelize['ENUM'](_0x37fb('0x8'),_0x37fb('0x9')),'defaultValue':'rounded'},'header_online':{'type':Sequelize[_0x37fb('0x1')],'defaultValue':_0x37fb('0xa')},'start_chat_button':{'type':Sequelize[_0x37fb('0x1')],'defaultValue':_0x37fb('0xb')},'offline_chat_button':{'type':Sequelize[_0x37fb('0x1')],'defaultValue':'Send'},'header_offline':{'type':Sequelize['STRING'],'defaultValue':_0x37fb('0xc')},'download_transcript':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x37fb('0x1')],'defaultValue':_0x37fb('0xd')},'defaultWhiteLabel':{'type':Sequelize[_0x37fb('0x7')],'defaultValue':!![]},'sitepic':{'type':Sequelize['TEXT']},'closingQuestion':{'type':Sequelize[_0x37fb('0x1')],'defaultValue':_0x37fb('0xe')},'formSubmitSuccessMessage':{'type':Sequelize[_0x37fb('0x1')],'defaultValue':'Form\x20properly\x20submitted'},'formSubmitFailureMessage':{'type':Sequelize[_0x37fb('0x1')],'defaultValue':'Form\x20submission\x20error'},'noteTitle':{'type':Sequelize[_0x37fb('0x1')],'defaultValue':_0x37fb('0xf')},'placeholderMessage':{'type':Sequelize['STRING'],'defaultValue':_0x37fb('0x10')},'closingMessage':{'type':Sequelize[_0x37fb('0x1')],'defaultValue':_0x37fb('0x11')},'closingMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0x37fb('0x12')},'skipMessageButton':{'type':Sequelize[_0x37fb('0x1')],'defaultValue':_0x37fb('0x13')},'conditionAgreement':{'type':Sequelize[_0x37fb('0x7')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x37fb('0x7')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x37fb('0x7')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x37fb('0x7')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x37fb('0x1')],'defaultValue':_0x37fb('0x14')},'ratingType':{'type':Sequelize['ENUM'](_0x37fb('0x15'),_0x37fb('0x16')),'defaultValue':_0x37fb('0x15')},'ratingStarsNumber':{'type':Sequelize[_0x37fb('0x6')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x37fb('0x17')],'defaultValue':function(){return JSON[_0x37fb('0x18')]({'items':[{'type':'input','variable':null,'config':{'placeholder':_0x37fb('0x19'),'type':_0x37fb('0x1a'),'required':!![]},'props':{'title':'name','helpText':''}},{'type':_0x37fb('0x1b'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0x37fb('0x3'),'type':_0x37fb('0x3')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x37fb('0x1c')](_0x37fb('0x1d'))?JSON['parse'](this[_0x37fb('0x1c')](_0x37fb('0x1d'))):{};},'set':function(_0x5b6236){return this[_0x37fb('0x1e')](_0x37fb('0x1d'),JSON[_0x37fb('0x18')](_0x5b6236));}},'offlineForm':{'type':Sequelize[_0x37fb('0x17')],'defaultValue':function(){return JSON[_0x37fb('0x18')]({'items':[{'type':_0x37fb('0x1b'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0x37fb('0x3'),'type':'email'},'variable':null},{'type':'textarea','config':{'placeholder':'Comments'},'props':{'title':_0x37fb('0x1f'),'helpText':_0x37fb('0x20')}}],'fromKey':0x0});},'get':function(){return this[_0x37fb('0x1c')](_0x37fb('0x21'))?JSON['parse'](this[_0x37fb('0x1c')](_0x37fb('0x21'))):{};},'set':function(_0x340934){return this[_0x37fb('0x1e')](_0x37fb('0x21'),JSON[_0x37fb('0x18')](_0x340934));}},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0x37fb('0x22')]();}},'autoclose':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x37fb('0x7')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x37fb('0x1')]},'forwardOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x37fb('0x1')]},'waitingTitle':{'type':Sequelize[_0x37fb('0x1')],'defaultValue':_0x37fb('0x23')},'waitingMessage':{'type':Sequelize[_0x37fb('0x1')],'defaultValue':'Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.'},'offlineMessageSubject':{'type':Sequelize[_0x37fb('0x1')],'defaultValue':'New\x20offline\x20message\x20from\x20websiteName'},'offlineMessageBody':{'type':Sequelize['STRING'],'defaultValue':_0x37fb('0x24')},'enableUnmanagedNote':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x37fb('0x1')],'defaultValue':_0x37fb('0x25')},'skipUnmanaged':{'type':Sequelize[_0x37fb('0x1')],'defaultValue':_0x37fb('0x13')},'sendUnmanaged':{'type':Sequelize['STRING'],'defaultValue':_0x37fb('0x12')},'enableCustomerAttachment':{'type':Sequelize[_0x37fb('0x7')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x37fb('0x7')],'defaultValue':![]},'agentAvatar':{'type':Sequelize['TEXT']},'showAgentAvatar':{'type':Sequelize[_0x37fb('0x7')],'defaultValue':![]},'timezone':{'type':Sequelize[_0x37fb('0x1')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x37fb('0x26');}},'notificationSound':{'type':Sequelize[_0x37fb('0x7')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x37fb('0x7')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x37fb('0x7')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x37fb('0x1')],'defaultValue':_0x37fb('0x27')},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0x37fb('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x37fb('0x1')],'defaultValue':_0x37fb('0x28')},'verticalAlignment':{'type':Sequelize[_0x37fb('0x6')],'defaultValue':0x1e},'labelText':{'type':Sequelize['STRING'],'defaultValue':_0x37fb('0x29')},'messagesAlignment':{'type':Sequelize[_0x37fb('0x1')],'defaultValue':'alternate'},'defaultTitle':{'type':Sequelize['STRING']},'customerAvatar':{'type':Sequelize[_0x37fb('0x17')]},'showCustomerAvatar':{'type':Sequelize[_0x37fb('0x7')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x37fb('0x6')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x37fb('0x1')],'allowNull':![],'defaultValue':_0x37fb('0x2a'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x37fb('0x7')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x37fb('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x37fb('0x7')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x37fb('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x37fb('0x1')],'defaultValue':_0x37fb('0x2b')},'systemAvatar':{'type':Sequelize[_0x37fb('0x17')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x37fb('0x6')],'comment':_0x37fb('0x2c')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x37fb('0x2d'),'set':function(_0x23dc18){if(!_0x23dc18)this[_0x37fb('0x1e')]('mandatoryDispositionPauseId',null);this['setDataValue']('mandatoryDisposition',_0x23dc18);}},'vidaooEscalation':{'type':Sequelize[_0x37fb('0x7')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x37fb('0x1')]},'vidaooTopic':{'type':Sequelize[_0x37fb('0x1')],'allowNull':![],'defaultValue':_0x37fb('0x2e')},'vidaooNote':{'type':Sequelize[_0x37fb('0x1')],'defaultValue':function(){return _0x37fb('0x2f');}},'vidaooMetadata':{'type':Sequelize[_0x37fb('0x17')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x37fb('0x7')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x37fb('0x17')]}}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js index d3d6c5f..310ca5e 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 _0xa87a=['close','unmanaged','*,*,*,*','ChatMessage','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','forcedOwnership','queueId','ChatQueue','queue','Start','startRouting','EventManager','offline','files','includes','mapKeyOffline','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','server/files/templates/chatOfflineMessage.ejs','render','toPairs','offlineMessageBody','ChatOfflineMessage','fromString','originalname','mimetype','server','attachments','offline-chat','sequelize','transaction','bulkCreate','CloudProvider','Smtp','forwardOffline','getSmtpOptions','sendMail','\x22%s\x22\x20<%s>','email','forwardOfflineAddress','offlineMessageSubject','openNewInteraction','MailAccountId','subjectOffline','toPairsIn','mapValues','Chat','NotifyMailAccount','notifyMail','remove','addInteraction','omit','getInteractions','Contact','Tag','Tags','color','tag','getProactiveActions','virtual','increment','chatLicenseExceeded','readFileSync','server/files/chat/iframe.ejs','utf8','URL','address','remote','x-forwarded-for','remoteAddress','referer','alignment','verticalAlignment','labelText','textColor','textButtonColor','color_button','backgroundColor','hideWhenOffline','addApplications','Transaction','ISOLATION_LEVELS','READ_COMMITTED','ChatApplication','findAndCountAll','finally','getApplications','addProactiveActions','getFields','online','offlineForm','items','fromKey','getOfflineMessages','Attachment','Attachments','addAgents','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','mustache','util','ejs','lodash','ioredis','jayson/promise','url','../../config/environment','APIOutOfIntervalError','APINotFoundError','handleError','redis','defaults','localhost','./chatWebsite.socket','register','http','client','then','request\x20sent','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatWebsite,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','update','destroy','get','ChatWebsites','stack','name','send','Command','getSnippet','iftime\x20%s,%s','interval','timezone','format','iftime\x20%s','true','info','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','No\x20timezone','inspect','map','Intervals','all','some','user-agent-parser','user-agent','getResult','cf-connecting-ip','first','lastName','x-real-port','browser','version','%s\x20%s','unknown','device','model','vendor','type','index','Pause','mandatoryDispositionPause','rawAttributes','key','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','options','ChatWebsite','includeAll','findAll','show','params','include','find','create','body','user','role','userProfileId','autoAssociation','UserProfileResource','describe','addDisposition','Disposition','getDispositions','ChatWebsiteId','rows','removeDispositions','addAnswer','CannedAnswer','findOne','removeAnswers','ids','addLogo','sitepic','file','filename','addAvatar','agentAvatar','systemAvatar','join','root','../../config/license/util','getLicense','custom','isNil','server/files/images/logos/','download','server/files/images/avatars/default_avatar.png','existsSync','server/files/images/avatars/','server/files/images/avatars/customer_avatar.png','customerAvatar','showCustomerAvatar','server/files/images/avatars/system_avatar.png','notify','chat','CmContact','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','from','Sequelize','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','Contacts','Interval','spread','account','list','orderBy','Applications','priority','asc','ListId','contact','headers','threadId','externalUrl','ContactId','interaction','ChatInteraction','firstName','messageId','created','applications','push'];(function(_0xe094d,_0x381f9d){var _0x428a5d=function(_0x266fe3){while(--_0x266fe3){_0xe094d['push'](_0xe094d['shift']());}};_0x428a5d(++_0x381f9d);}(_0xa87a,0x194));var _0xaa87=function(_0x1e3671,_0x9ae4fc){_0x1e3671=_0x1e3671-0x0;var _0x48d5f5=_0xa87a[_0x1e3671];return _0x48d5f5;};'use strict';var Mustache=require(_0xaa87('0x0'));var util=require(_0xaa87('0x1'));var path=require('path');var ejs=require(_0xaa87('0x2'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xaa87('0x3'));var querystring=require('querystring');var htmlToText=require('html-to-text');var Redis=require(_0xaa87('0x4'));var jayson=require(_0xaa87('0x5'));var url=require(_0xaa87('0x6'));var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')('api');var config=require(_0xaa87('0x7'));var APIOutOfIntervalError=require('../../errors/api')[_0xaa87('0x8')];var APINotFoundError=require('../../errors/api')[_0xaa87('0x9')];var APIHandleError=require('../../errors/api')[_0xaa87('0xa')];var db=require('../../mysqldb')['db'];config[_0xaa87('0xb')]=_[_0xaa87('0xc')](config['redis'],{'host':_0xaa87('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xaa87('0xb')]));require(_0xaa87('0xe'))[_0xaa87('0xf')](socket);var client=jayson['client']['http']({'port':0x232c});var client9002=jayson['client'][_0xaa87('0x10')]({'port':0x232a});var client9003=jayson[_0xaa87('0x11')]['http']({'port':0x232b});var client9001=jayson[_0xaa87('0x11')][_0xaa87('0x10')]({'port':0x2329});function respondWithRpcPromise(_0x27ad08,_0x105f93,_0xbb3c83,_0xa959fa){return new Promise(function(_0x1129de,_0x2893e9){var _0x337c67=_0xa959fa||client;return _0x337c67['request'](_0x27ad08,_0xbb3c83)[_0xaa87('0x12')](function(_0xb07021){logger['info']('ChatWebsite,\x20%s,\x20%s',_0x105f93,_0xaa87('0x13'));logger['debug'](_0xaa87('0x14'),_0x105f93,_0xaa87('0x13'),JSON[_0xaa87('0x15')](_0xb07021));if(_0xb07021['error']){if(_0xb07021[_0xaa87('0x16')][_0xaa87('0x17')]===0x1f4){logger[_0xaa87('0x16')](_0xaa87('0x18'),_0x105f93,_0xb07021[_0xaa87('0x16')][_0xaa87('0x19')]);return _0x2893e9(_0xb07021['error'][_0xaa87('0x19')]);}logger[_0xaa87('0x16')](_0xaa87('0x18'),_0x105f93,_0xb07021[_0xaa87('0x16')]['message']);return _0x1129de(_0xb07021[_0xaa87('0x16')][_0xaa87('0x19')]);}else{logger['info'](_0xaa87('0x18'),_0x105f93,_0xaa87('0x13'));_0x1129de(_0xb07021[_0xaa87('0x1a')][_0xaa87('0x19')]);}})[_0xaa87('0x1b')](function(_0x981c44){logger[_0xaa87('0x16')]('ChatWebsite,\x20%s,\x20%s',_0x105f93,_0x981c44);_0x2893e9(_0x981c44);});});}function respondWithStatusCode(_0x52121c,_0xc3f947){_0xc3f947=_0xc3f947||0xcc;return function(_0x2e2489){if(_0x2e2489){return _0x52121c[_0xaa87('0x1c')](_0xc3f947);}return _0x52121c[_0xaa87('0x1d')](_0xc3f947)[_0xaa87('0x1e')]();};}function respondWithResult(_0x3d3fd2,_0x49e334){_0x49e334=_0x49e334||0xc8;return function(_0x191330){if(_0x191330){return _0x3d3fd2['status'](_0x49e334)['json'](_0x191330);}};}function respondWithFilteredResult(_0x525fb0,_0x34f3bd){return function(_0x29b5e3){if(_0x29b5e3){var _0x1a8caa=typeof _0x34f3bd[_0xaa87('0x1f')]===_0xaa87('0x20')&&typeof _0x34f3bd[_0xaa87('0x21')]===_0xaa87('0x20');var _0x16a71e=_0x29b5e3[_0xaa87('0x22')];var _0x6a0ead=_0x1a8caa?0x0:_0x34f3bd[_0xaa87('0x1f')];var _0xd19e4b=_0x1a8caa?_0x29b5e3[_0xaa87('0x22')]:_0x34f3bd[_0xaa87('0x1f')]+_0x34f3bd['limit'];var _0x59918c;if(_0xd19e4b>=_0x16a71e){_0xd19e4b=_0x16a71e;_0x59918c=0xc8;}else{_0x59918c=0xce;}_0x525fb0[_0xaa87('0x1d')](_0x59918c);return _0x525fb0[_0xaa87('0x23')](_0xaa87('0x24'),_0x6a0ead+'-'+_0xd19e4b+'/'+_0x16a71e)[_0xaa87('0x25')](_0x29b5e3);}return null;};}function saveUpdates(_0xf5c318){return function(_0x596ab1){if(_0x596ab1){return _0x596ab1[_0xaa87('0x26')](_0xf5c318)['then'](function(_0x248667){return _0x248667;});}return null;};}function removeEntity(_0x3f77a1){return function(_0x3f5764){if(_0x3f5764){return _0x3f5764[_0xaa87('0x27')]()[_0xaa87('0x12')](function(){var _0x42a815=_0x3f5764[_0xaa87('0x28')]({'plain':!![]});var _0x5a2f5c=_0xaa87('0x29');return db['UserProfileResource'][_0xaa87('0x27')]({'where':{'type':_0x5a2f5c,'resourceId':_0x42a815['id']}})[_0xaa87('0x12')](function(){return _0x3f5764;});})[_0xaa87('0x12')](function(){_0x3f77a1[_0xaa87('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3b636e){return function(_0x7b6441){if(!_0x7b6441){_0x3b636e[_0xaa87('0x1c')](0x194);}return _0x7b6441;};}function handleError(_0x1df799,_0x394462){_0x394462=_0x394462||0x1f4;return function(_0x2ce2a2){logger[_0xaa87('0x16')](_0x2ce2a2[_0xaa87('0x2a')]);if(_0x2ce2a2['name']){delete _0x2ce2a2[_0xaa87('0x2b')];}_0x1df799[_0xaa87('0x1d')](_0x394462)[_0xaa87('0x2c')](_0x2ce2a2);};}function iftimePromise(_0x58f994,_0x25a059){return respondWithRpcPromise(_0xaa87('0x2d'),_0xaa87('0x2e'),{'command':_0x25a059['timezone']?util['format'](_0xaa87('0x2f'),_0x58f994[_0xaa87('0x30')],_0x25a059[_0xaa87('0x31')]):util[_0xaa87('0x32')](_0xaa87('0x33'),_0x58f994[_0xaa87('0x30')])},client9002)[_0xaa87('0x12')](function(_0x364239){var _0x416d4b=_0x364239&&_0x364239['indexOf'](_0xaa87('0x34'))>=0x0?!![]:![];logger[_0xaa87('0x35')](_0xaa87('0x36'),_0x25a059['id'],_0x58f994['id'],_0x58f994[_0xaa87('0x30')],_0x416d4b?_0xaa87('0x37'):'OFFLINE',_0x25a059[_0xaa87('0x31')]?_0x25a059[_0xaa87('0x31')]:_0xaa87('0x38'));return _0x416d4b;})[_0xaa87('0x1b')](function(_0x191a49){logger[_0xaa87('0x16')](_0xaa87('0x36'),_0x25a059['id'],_0x58f994['id'],_0x58f994[_0xaa87('0x30')],util[_0xaa87('0x39')](_0x191a49,{'showHidden':![],'depth':null}),_0x25a059[_0xaa87('0x31')]?_0x25a059[_0xaa87('0x31')]:_0xaa87('0x38'));return![];});}function checkWebsiteIntervals(_0xb40eba){var _0x37d35e=_[_0xaa87('0x3a')](_0xb40eba['Interval'][_0xaa87('0x3b')],function(_0x8fd92b){var _0x4312ee=_0x8fd92b['get']({'plain':!![]});return iftimePromise(_0x4312ee,_0xb40eba);});return Promise[_0xaa87('0x3c')](_0x37d35e)['then'](function(_0x2c6be0){return _[_0xaa87('0x3d')](_0x2c6be0);});}function createInteractionObject(_0x183f37,_0x45b6ab,_0x409597,_0x3205ea){var _0xee878d=require(_0xaa87('0x3e'));var _0x541ac2=new _0xee878d();var _0x35700e=_0x541ac2['setUA'](_0x409597[_0xaa87('0x3f')])[_0xaa87('0x40')]();var _0x115219=_0x45b6ab['customerIp'];if(_0x409597['cf-connecting-ip']){_0x115219=_0x409597[_0xaa87('0x41')];}else if(_0x409597['x-forwarded-for']){_0x115219=_[_0xaa87('0x42')](_0x409597['x-forwarded-for']['split'](','));}return{'ContactId':_0x3205ea['id'],'ChatWebsiteId':_0x183f37,'from':(_0x3205ea['firstName']||'')+'\x20'+(_0x3205ea[_0xaa87('0x43')]||''),'customerIp':_0x115219,'customerPort':_0x409597[_0xaa87('0x44')]?_0x409597[_0xaa87('0x44')]:null,'referer':_0x45b6ab['referer'],'browserName':_0x35700e[_0xaa87('0x45')][_0xaa87('0x2b')]&&_0x35700e[_0xaa87('0x45')][_0xaa87('0x46')]?util[_0xaa87('0x32')](_0xaa87('0x47'),_0x35700e[_0xaa87('0x45')][_0xaa87('0x2b')],_0x35700e[_0xaa87('0x45')][_0xaa87('0x46')]):_0xaa87('0x48'),'browserVersion':_0x35700e[_0xaa87('0x45')][_0xaa87('0x46')]||_0xaa87('0x48'),'osName':util[_0xaa87('0x32')]('%s\x20%s',_0x35700e['os']['name'],_0x35700e['os'][_0xaa87('0x46')]),'osVersion':_0x35700e['os'][_0xaa87('0x46')],'deviceModel':_0x35700e[_0xaa87('0x49')][_0xaa87('0x4a')]&&_0x35700e[_0xaa87('0x49')][_0xaa87('0x4b')]?util[_0xaa87('0x32')]('%s\x20%s\x20%s',_0x35700e[_0xaa87('0x49')][_0xaa87('0x4a')],_0x35700e[_0xaa87('0x49')][_0xaa87('0x4b')],_0x35700e[_0xaa87('0x49')][_0xaa87('0x4c')]):null,'deviceVendor':_0x35700e[_0xaa87('0x49')][_0xaa87('0x4b')],'deviceType':_0x35700e[_0xaa87('0x49')][_0xaa87('0x4c')],'formData':JSON['stringify'](_0x45b6ab)};}exports[_0xaa87('0x4d')]=function(_0x30c316,_0x4ab4d5){var _0x52679a={'include':[{'model':db[_0xaa87('0x4e')],'as':_0xaa87('0x4f')}]},_0x5d21c0={},_0x39cf55={'count':0x0,'rows':[]};var _0x44b353=_[_0xaa87('0x3a')](db['ChatWebsite'][_0xaa87('0x50')],function(_0x164c28){return{'name':_0x164c28['fieldName'],'type':_0x164c28['type'][_0xaa87('0x51')]};});_0x5d21c0[_0xaa87('0x4a')]=_['map'](_0x44b353,_0xaa87('0x2b'));_0x5d21c0[_0xaa87('0x52')]=_[_0xaa87('0x53')](_0x30c316[_0xaa87('0x52')]);_0x5d21c0[_0xaa87('0x54')]=_[_0xaa87('0x55')](_0x5d21c0[_0xaa87('0x4a')],_0x5d21c0[_0xaa87('0x52')]);_0x52679a[_0xaa87('0x56')]=_['intersection'](_0x5d21c0['model'],qs[_0xaa87('0x57')](_0x30c316[_0xaa87('0x52')][_0xaa87('0x57')]));_0x52679a[_0xaa87('0x56')]=_0x52679a['attributes'][_0xaa87('0x58')]?_0x52679a['attributes']:_0x5d21c0['model'];if(!_0x30c316['query'][_0xaa87('0x59')](_0xaa87('0x5a'))){_0x52679a[_0xaa87('0x21')]=qs[_0xaa87('0x21')](_0x30c316['query'][_0xaa87('0x21')]);_0x52679a[_0xaa87('0x1f')]=qs[_0xaa87('0x1f')](_0x30c316['query'][_0xaa87('0x1f')]);}_0x52679a[_0xaa87('0x5b')]=qs['sort'](_0x30c316['query'][_0xaa87('0x5c')]);_0x52679a['where']=qs[_0xaa87('0x54')](_[_0xaa87('0x5d')](_0x30c316[_0xaa87('0x52')],_0x5d21c0[_0xaa87('0x54')]),_0x44b353);if(_0x30c316['query'][_0xaa87('0x5e')]){_0x52679a[_0xaa87('0x5f')]=_[_0xaa87('0x60')](_0x52679a[_0xaa87('0x5f')],{'$or':_[_0xaa87('0x3a')](_0x44b353,function(_0x506845){if(_0x506845['type']!=='VIRTUAL'){var _0xce065e={};_0xce065e[_0x506845['name']]={'$like':'%'+_0x30c316['query']['filter']+'%'};return _0xce065e;}})});}_0x52679a=_[_0xaa87('0x60')]({},_0x52679a,_0x30c316[_0xaa87('0x61')]);var _0x63a36={'where':_0x52679a['where']};return db[_0xaa87('0x62')]['count'](_0x63a36)['then'](function(_0x165e80){_0x39cf55[_0xaa87('0x22')]=_0x165e80;if(_0x30c316[_0xaa87('0x52')][_0xaa87('0x63')]){_0x52679a['include']=[{'all':!![]}];}return db[_0xaa87('0x62')][_0xaa87('0x64')](_0x52679a);})['then'](function(_0x4ec58e){_0x39cf55['rows']=_0x4ec58e;return _0x39cf55;})['then'](respondWithFilteredResult(_0x4ab4d5,_0x52679a))[_0xaa87('0x1b')](handleError(_0x4ab4d5,null));};exports[_0xaa87('0x65')]=function(_0x1a3037,_0xe3da2){var _0x1b7e0d={'raw':![],'where':{'id':_0x1a3037[_0xaa87('0x66')]['id']},'include':[{'model':db['Pause'],'as':_0xaa87('0x4f')}]},_0x4f9726={};_0x4f9726[_0xaa87('0x4a')]=_[_0xaa87('0x53')](db[_0xaa87('0x62')][_0xaa87('0x50')]);_0x4f9726[_0xaa87('0x52')]=_['keys'](_0x1a3037[_0xaa87('0x52')]);_0x4f9726[_0xaa87('0x54')]=_['intersection'](_0x4f9726['model'],_0x4f9726[_0xaa87('0x52')]);_0x1b7e0d[_0xaa87('0x56')]=_[_0xaa87('0x55')](_0x4f9726[_0xaa87('0x4a')],qs[_0xaa87('0x57')](_0x1a3037[_0xaa87('0x52')]['fields']));_0x1b7e0d[_0xaa87('0x56')]=_0x1b7e0d[_0xaa87('0x56')]['length']?_0x1b7e0d[_0xaa87('0x56')]:_0x4f9726[_0xaa87('0x4a')];if(_0x1a3037[_0xaa87('0x52')][_0xaa87('0x63')]){_0x1b7e0d[_0xaa87('0x67')]=[{'all':!![]}];}_0x1b7e0d=_[_0xaa87('0x60')]({},_0x1b7e0d,_0x1a3037[_0xaa87('0x61')]);return db['ChatWebsite'][_0xaa87('0x68')](_0x1b7e0d)[_0xaa87('0x12')](handleEntityNotFound(_0xe3da2,null))[_0xaa87('0x12')](respondWithResult(_0xe3da2,null))[_0xaa87('0x1b')](handleError(_0xe3da2,null));};exports['create']=function(_0x3a4641,_0x4db44e){return db['ChatWebsite'][_0xaa87('0x69')](_0x3a4641[_0xaa87('0x6a')],{})[_0xaa87('0x12')](function(_0x1b1873){var _0x5def38=_0x3a4641[_0xaa87('0x6b')]['get']({'plain':!![]});if(!_0x5def38)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5def38[_0xaa87('0x6c')]===_0xaa87('0x6b')){var _0xc4fef8=_0x1b1873[_0xaa87('0x28')]({'plain':!![]});var _0x3cf825=_0xaa87('0x29');return db['UserProfileSection']['find']({'where':{'name':_0x3cf825,'userProfileId':_0x5def38[_0xaa87('0x6d')]},'raw':!![]})['then'](function(_0x418e1a){if(_0x418e1a&&_0x418e1a[_0xaa87('0x6e')]===0x0){return db[_0xaa87('0x6f')][_0xaa87('0x69')]({'name':_0xc4fef8['name'],'resourceId':_0xc4fef8['id'],'type':_0x418e1a[_0xaa87('0x2b')],'sectionId':_0x418e1a['id']},{})['then'](function(){return _0x1b1873;});}else{return _0x1b1873;}})[_0xaa87('0x1b')](function(_0x477a8b){logger[_0xaa87('0x16')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x477a8b);throw _0x477a8b;});}return _0x1b1873;})[_0xaa87('0x12')](respondWithResult(_0x4db44e,0xc9))[_0xaa87('0x1b')](handleError(_0x4db44e,null));};exports['update']=function(_0x2f1d79,_0x522098){if(_0x2f1d79[_0xaa87('0x6a')]['id']){delete _0x2f1d79[_0xaa87('0x6a')]['id'];}return db['ChatWebsite'][_0xaa87('0x68')]({'where':{'id':_0x2f1d79[_0xaa87('0x66')]['id']},'include':[{'model':db[_0xaa87('0x4e')],'as':_0xaa87('0x4f')}]})[_0xaa87('0x12')](handleEntityNotFound(_0x522098,null))[_0xaa87('0x12')](saveUpdates(_0x2f1d79[_0xaa87('0x6a')],null))[_0xaa87('0x12')](respondWithResult(_0x522098,null))[_0xaa87('0x1b')](handleError(_0x522098,null));};exports[_0xaa87('0x27')]=function(_0x4e2d57,_0x2842f2){return db['ChatWebsite'][_0xaa87('0x68')]({'where':{'id':_0x4e2d57[_0xaa87('0x66')]['id']}})[_0xaa87('0x12')](handleEntityNotFound(_0x2842f2,null))[_0xaa87('0x12')](removeEntity(_0x2842f2,null))[_0xaa87('0x1b')](handleError(_0x2842f2,null));};exports['describe']=function(_0x3aa5e6,_0xbe1844){return db[_0xaa87('0x62')][_0xaa87('0x70')]()['then'](respondWithResult(_0xbe1844,null))[_0xaa87('0x1b')](handleError(_0xbe1844,null));};exports[_0xaa87('0x71')]=function(_0x27867a,_0x1e7bf7){if(_0x27867a[_0xaa87('0x6a')]['id']){delete _0x27867a[_0xaa87('0x6a')]['id'];}return db['ChatWebsite'][_0xaa87('0x68')]({'where':{'id':_0x27867a[_0xaa87('0x66')]['id']}})['then'](handleEntityNotFound(_0x1e7bf7,null))['then'](function(_0x1972c9){if(_0x1972c9){_0x27867a[_0xaa87('0x6a')]['ChatWebsiteId']=_0x1972c9['id'];return db[_0xaa87('0x72')][_0xaa87('0x69')](_0x27867a[_0xaa87('0x6a')]);}})[_0xaa87('0x12')](respondWithResult(_0x1e7bf7,null))[_0xaa87('0x1b')](handleError(_0x1e7bf7,null));};exports[_0xaa87('0x73')]=function(_0x56f176,_0x11f744){var _0x10461d={'raw':![],'where':{}};var _0x5d6908={};var _0x302231={'count':0x0,'rows':[]};return db[_0xaa87('0x62')]['findOne']({'where':{'id':_0x56f176[_0xaa87('0x66')]['id']}})[_0xaa87('0x12')](handleEntityNotFound(_0x11f744,null))[_0xaa87('0x12')](function(_0x17d09b){if(_0x17d09b){_0x5d6908[_0xaa87('0x4a')]=_[_0xaa87('0x53')](db[_0xaa87('0x72')][_0xaa87('0x50')]);_0x5d6908['query']=_[_0xaa87('0x53')](_0x56f176[_0xaa87('0x52')]);_0x5d6908[_0xaa87('0x54')]=_[_0xaa87('0x55')](_0x5d6908[_0xaa87('0x4a')],_0x5d6908[_0xaa87('0x52')]);_0x10461d['attributes']=_[_0xaa87('0x55')](_0x5d6908[_0xaa87('0x4a')],qs[_0xaa87('0x57')](_0x56f176[_0xaa87('0x52')][_0xaa87('0x57')]));_0x10461d['attributes']=_0x10461d['attributes']['length']?_0x10461d[_0xaa87('0x56')]:_0x5d6908[_0xaa87('0x4a')];if(!_0x56f176[_0xaa87('0x52')][_0xaa87('0x59')](_0xaa87('0x5a'))){_0x10461d[_0xaa87('0x21')]=qs[_0xaa87('0x21')](_0x56f176[_0xaa87('0x52')][_0xaa87('0x21')]);_0x10461d[_0xaa87('0x1f')]=qs['offset'](_0x56f176[_0xaa87('0x52')][_0xaa87('0x1f')]);}_0x10461d[_0xaa87('0x5b')]=qs['sort'](_0x56f176[_0xaa87('0x52')]['sort']);_0x10461d[_0xaa87('0x5f')]=qs[_0xaa87('0x54')](_[_0xaa87('0x5d')](_0x56f176[_0xaa87('0x52')],_0x5d6908['filters']));_0x10461d['where'][_0xaa87('0x74')]=_0x17d09b['id'];if(_0x56f176[_0xaa87('0x52')]['filter']){_0x10461d['where']=_[_0xaa87('0x60')](_0x10461d[_0xaa87('0x5f')],{'$or':_[_0xaa87('0x3a')](_0x10461d[_0xaa87('0x56')],function(_0x8e062){var _0x1f9bc0={};_0x1f9bc0[_0x8e062]={'$like':'%'+_0x56f176[_0xaa87('0x52')][_0xaa87('0x5e')]+'%'};return _0x1f9bc0;})});}_0x10461d=_[_0xaa87('0x60')]({},_0x10461d,_0x56f176[_0xaa87('0x61')]);return db['Disposition'][_0xaa87('0x22')]({'where':_0x10461d[_0xaa87('0x5f')]})[_0xaa87('0x12')](function(_0x541263){_0x302231[_0xaa87('0x22')]=_0x541263;if(_0x56f176[_0xaa87('0x52')][_0xaa87('0x63')]){_0x10461d[_0xaa87('0x67')]=[{'all':!![]}];}return db['Disposition'][_0xaa87('0x64')](_0x10461d);})[_0xaa87('0x12')](function(_0x3d6519){_0x302231[_0xaa87('0x75')]=_0x3d6519;return _0x302231;});}})[_0xaa87('0x12')](respondWithFilteredResult(_0x11f744,_0x10461d))['catch'](handleError(_0x11f744,null));};exports[_0xaa87('0x76')]=function(_0xe48915,_0x2603bc){return db[_0xaa87('0x62')][_0xaa87('0x68')]({'where':{'id':_0xe48915['params']['id']}})[_0xaa87('0x12')](handleEntityNotFound(_0x2603bc,null))[_0xaa87('0x12')](function(_0x240a12){if(_0x240a12){return _0x240a12[_0xaa87('0x76')](_0xe48915[_0xaa87('0x52')]['ids']);}})[_0xaa87('0x12')](respondWithStatusCode(_0x2603bc,null))['catch'](handleError(_0x2603bc,null));};exports[_0xaa87('0x77')]=function(_0x4c5f13,_0x1597e5){if(_0x4c5f13['body']['id']){delete _0x4c5f13[_0xaa87('0x6a')]['id'];}return db[_0xaa87('0x62')][_0xaa87('0x68')]({'where':{'id':_0x4c5f13[_0xaa87('0x66')]['id']}})[_0xaa87('0x12')](handleEntityNotFound(_0x1597e5,null))[_0xaa87('0x12')](function(_0x1a92a5){if(_0x1a92a5){_0x4c5f13['body'][_0xaa87('0x74')]=_0x1a92a5['id'];return db[_0xaa87('0x78')]['create'](_0x4c5f13['body']);}})[_0xaa87('0x12')](respondWithResult(_0x1597e5,null))[_0xaa87('0x1b')](handleError(_0x1597e5,null));};exports['getAnswers']=function(_0x36c2fc,_0xc2646b){var _0x65688b={'raw':![],'where':{}};var _0x5a4d10={};var _0x4aad8d={'count':0x0,'rows':[]};return db[_0xaa87('0x62')][_0xaa87('0x79')]({'where':{'id':_0x36c2fc[_0xaa87('0x66')]['id']}})['then'](handleEntityNotFound(_0xc2646b,null))[_0xaa87('0x12')](function(_0x50d82e){if(_0x50d82e){_0x5a4d10[_0xaa87('0x4a')]=_[_0xaa87('0x53')](db[_0xaa87('0x78')][_0xaa87('0x50')]);_0x5a4d10['query']=_[_0xaa87('0x53')](_0x36c2fc[_0xaa87('0x52')]);_0x5a4d10[_0xaa87('0x54')]=_[_0xaa87('0x55')](_0x5a4d10[_0xaa87('0x4a')],_0x5a4d10[_0xaa87('0x52')]);_0x65688b[_0xaa87('0x56')]=_[_0xaa87('0x55')](_0x5a4d10[_0xaa87('0x4a')],qs[_0xaa87('0x57')](_0x36c2fc['query'][_0xaa87('0x57')]));_0x65688b[_0xaa87('0x56')]=_0x65688b[_0xaa87('0x56')]['length']?_0x65688b[_0xaa87('0x56')]:_0x5a4d10['model'];if(!_0x36c2fc[_0xaa87('0x52')][_0xaa87('0x59')](_0xaa87('0x5a'))){_0x65688b['limit']=qs['limit'](_0x36c2fc[_0xaa87('0x52')][_0xaa87('0x21')]);_0x65688b['offset']=qs[_0xaa87('0x1f')](_0x36c2fc[_0xaa87('0x52')]['offset']);}_0x65688b[_0xaa87('0x5b')]=qs[_0xaa87('0x5c')](_0x36c2fc[_0xaa87('0x52')]['sort']);_0x65688b[_0xaa87('0x5f')]=qs[_0xaa87('0x54')](_['pick'](_0x36c2fc['query'],_0x5a4d10[_0xaa87('0x54')]));_0x65688b[_0xaa87('0x5f')][_0xaa87('0x74')]=_0x50d82e['id'];if(_0x36c2fc[_0xaa87('0x52')]['filter']){_0x65688b[_0xaa87('0x5f')]=_[_0xaa87('0x60')](_0x65688b['where'],{'$or':_[_0xaa87('0x3a')](_0x65688b['attributes'],function(_0x239b22){var _0x743f7c={};_0x743f7c[_0x239b22]={'$like':'%'+_0x36c2fc[_0xaa87('0x52')]['filter']+'%'};return _0x743f7c;})});}_0x65688b=_[_0xaa87('0x60')]({},_0x65688b,_0x36c2fc['options']);return db[_0xaa87('0x78')][_0xaa87('0x22')]({'where':_0x65688b[_0xaa87('0x5f')]})['then'](function(_0x2f144a){_0x4aad8d[_0xaa87('0x22')]=_0x2f144a;if(_0x36c2fc[_0xaa87('0x52')][_0xaa87('0x63')]){_0x65688b[_0xaa87('0x67')]=[{'all':!![]}];}return db['CannedAnswer']['findAll'](_0x65688b);})[_0xaa87('0x12')](function(_0xf5c8cc){_0x4aad8d[_0xaa87('0x75')]=_0xf5c8cc;return _0x4aad8d;});}})['then'](respondWithFilteredResult(_0xc2646b,_0x65688b))[_0xaa87('0x1b')](handleError(_0xc2646b,null));};exports[_0xaa87('0x7a')]=function(_0x3943e6,_0x43b028){return db[_0xaa87('0x62')][_0xaa87('0x68')]({'where':{'id':_0x3943e6['params']['id']}})[_0xaa87('0x12')](handleEntityNotFound(_0x43b028,null))[_0xaa87('0x12')](function(_0x18bd49){if(_0x18bd49){return _0x18bd49[_0xaa87('0x7a')](_0x3943e6['query'][_0xaa87('0x7b')]);}})[_0xaa87('0x12')](respondWithStatusCode(_0x43b028,null))[_0xaa87('0x1b')](handleError(_0x43b028,null));};exports[_0xaa87('0x7c')]=function(_0xde66be,_0x1e96cd){_0xde66be[_0xaa87('0x6a')][_0xaa87('0x7d')]=_0xde66be[_0xaa87('0x7e')][_0xaa87('0x7f')];return db['ChatWebsite'][_0xaa87('0x68')]({'where':{'id':_0xde66be['params']['id']}})[_0xaa87('0x12')](handleEntityNotFound(_0x1e96cd,null))[_0xaa87('0x12')](saveUpdates(_0xde66be[_0xaa87('0x6a')],null))[_0xaa87('0x12')](respondWithResult(_0x1e96cd,null))[_0xaa87('0x1b')](handleError(_0x1e96cd,null));};exports[_0xaa87('0x80')]=function(_0x545c74,_0x21a333){_0x545c74['body'][_0xaa87('0x81')]=_0x545c74[_0xaa87('0x7e')][_0xaa87('0x7f')];return db[_0xaa87('0x62')]['find']({'where':{'id':_0x545c74[_0xaa87('0x66')]['id']}})[_0xaa87('0x12')](handleEntityNotFound(_0x21a333,null))[_0xaa87('0x12')](saveUpdates(_0x545c74[_0xaa87('0x6a')],null))['then'](respondWithResult(_0x21a333,null))[_0xaa87('0x1b')](handleError(_0x21a333,null));};exports['addCustomerAvatar']=function(_0x48321e,_0x128d66){_0x48321e['body']['customerAvatar']=_0x48321e[_0xaa87('0x7e')][_0xaa87('0x7f')];return db[_0xaa87('0x62')]['find']({'where':{'id':_0x48321e[_0xaa87('0x66')]['id']}})[_0xaa87('0x12')](handleEntityNotFound(_0x128d66,null))[_0xaa87('0x12')](saveUpdates(_0x48321e[_0xaa87('0x6a')],null))[_0xaa87('0x12')](respondWithResult(_0x128d66,null))[_0xaa87('0x1b')](handleError(_0x128d66,null));};exports['addSystemAvatar']=function(_0x14da53,_0xf95880){_0x14da53[_0xaa87('0x6a')][_0xaa87('0x82')]=_0x14da53[_0xaa87('0x7e')][_0xaa87('0x7f')];return db[_0xaa87('0x62')][_0xaa87('0x68')]({'where':{'id':_0x14da53['params']['id']}})['then'](handleEntityNotFound(_0xf95880,null))[_0xaa87('0x12')](saveUpdates(_0x14da53[_0xaa87('0x6a')],null))[_0xaa87('0x12')](respondWithResult(_0xf95880,null))[_0xaa87('0x1b')](handleError(_0xf95880,null));};exports['getLogo']=function(_0x10cd49,_0x156a73){var _0x2e9dc1=path[_0xaa87('0x83')](config[_0xaa87('0x84')],'server/files/images/logos/default_logo.svg');var _0x1ff9ee={'where':{'id':_0x10cd49[_0xaa87('0x66')]['id']},'attributes':['id',_0xaa87('0x7d')],'raw':!![]};var _0x262c47=![];return require(_0xaa87('0x85'))[_0xaa87('0x86')]()['then'](function(_0x3e2aed){if(_0x3e2aed){_0x262c47=_0x3e2aed[_0xaa87('0x87')];}})[_0xaa87('0x12')](function(){return db[_0xaa87('0x62')]['find'](_0x1ff9ee);})[_0xaa87('0x12')](handleEntityNotFound(_0x156a73,null))[_0xaa87('0x12')](function(_0x435cbb){if(_0x435cbb){if(!_[_0xaa87('0x88')](_0x435cbb[_0xaa87('0x7d')])){if(fs['existsSync'](path[_0xaa87('0x83')](config[_0xaa87('0x84')],_0xaa87('0x89'),_0x435cbb['sitepic']))&&_0x262c47){_0x2e9dc1=path[_0xaa87('0x83')](config[_0xaa87('0x84')],_0xaa87('0x89'),_0x435cbb[_0xaa87('0x7d')]);}}return _0x156a73[_0xaa87('0x8a')](_0x2e9dc1);}})[_0xaa87('0x1b')](handleError(_0x156a73,null));};exports['getAvatar']=function(_0x402cca,_0x196b6c){var _0xa69912=path[_0xaa87('0x83')](config['root'],_0xaa87('0x8b'));var _0x37ff90={'where':{'id':_0x402cca['params']['id']},'attributes':['id','agentAvatar'],'raw':!![]};return db[_0xaa87('0x62')][_0xaa87('0x68')](_0x37ff90)[_0xaa87('0x12')](handleEntityNotFound(_0x196b6c,null))[_0xaa87('0x12')](function(_0x6df6c2){if(_0x6df6c2){if(!_[_0xaa87('0x88')](_0x6df6c2['agentAvatar'])){if(fs[_0xaa87('0x8c')](path['join'](config[_0xaa87('0x84')],_0xaa87('0x8d'),_0x6df6c2[_0xaa87('0x81')]))){_0xa69912=path[_0xaa87('0x83')](config[_0xaa87('0x84')],_0xaa87('0x8d'),_0x6df6c2[_0xaa87('0x81')]);}}return _0x196b6c[_0xaa87('0x8a')](_0xa69912);}})[_0xaa87('0x1b')](handleError(_0x196b6c,null));};exports['getCustomerAvatar']=function(_0x125a87,_0x56f818){var _0xecd4de=path[_0xaa87('0x83')](config[_0xaa87('0x84')],_0xaa87('0x8e'));var _0x1e0758={'where':{'id':_0x125a87[_0xaa87('0x66')]['id']},'attributes':['id',_0xaa87('0x8f'),_0xaa87('0x90')],'raw':!![]};return db[_0xaa87('0x62')]['find'](_0x1e0758)['then'](handleEntityNotFound(_0x56f818,null))[_0xaa87('0x12')](function(_0x48f971){if(_0x48f971){if(!_[_0xaa87('0x88')](_0x48f971[_0xaa87('0x8f')])){if(fs[_0xaa87('0x8c')](path['join'](config[_0xaa87('0x84')],_0xaa87('0x8d'),_0x48f971[_0xaa87('0x8f')]))&&_0x48f971[_0xaa87('0x90')]){_0xecd4de=path[_0xaa87('0x83')](config[_0xaa87('0x84')],_0xaa87('0x8d'),_0x48f971[_0xaa87('0x8f')]);}}return _0x56f818[_0xaa87('0x8a')](_0xecd4de);}})[_0xaa87('0x1b')](handleError(_0x56f818,null));};exports['getSystemAvatar']=function(_0x86d925,_0x12618d){var _0x5dd66f=path[_0xaa87('0x83')](config[_0xaa87('0x84')],_0xaa87('0x91'));var _0x4670f0={'where':{'id':_0x86d925[_0xaa87('0x66')]['id']},'attributes':['id',_0xaa87('0x82')],'raw':!![]};return db[_0xaa87('0x62')]['find'](_0x4670f0)[_0xaa87('0x12')](handleEntityNotFound(_0x12618d,null))['then'](function(_0x52d73d){if(_0x52d73d){if(!_[_0xaa87('0x88')](_0x52d73d[_0xaa87('0x82')])){if(fs['existsSync'](path['join'](config[_0xaa87('0x84')],_0xaa87('0x8d'),_0x52d73d[_0xaa87('0x82')]))){_0x5dd66f=path['join'](config[_0xaa87('0x84')],_0xaa87('0x8d'),_0x52d73d[_0xaa87('0x82')]);}}return _0x12618d[_0xaa87('0x8a')](_0x5dd66f);}})[_0xaa87('0x1b')](handleError(_0x12618d,null));};exports[_0xaa87('0x92')]=function(_0x31d224,_0x29afa1){var _0xc817f1={'body':_0x31d224[_0xaa87('0x6a')],'channel':_0xaa87('0x93')};var _0xf66141=[];var _0x3e5d06=[];var _0x432b96={};var _0x43cc88=![];return db[_0xaa87('0x94')]['describe']()['then'](function(_0x2f2723){if(!_0x2f2723){throw new db['Sequelize'][(_0xaa87('0x95'))](_0xaa87('0x96'));}_0xf66141=_[_0xaa87('0x97')](_[_0xaa87('0x53')](_0x2f2723),[_0xaa87('0x98'),_0xaa87('0x99')]);_0x3e5d06=_[_0xaa87('0x97')](_[_0xaa87('0x53')](_0x2f2723),[_0xaa87('0x98'),_0xaa87('0x99'),_0xaa87('0x9a'),'ListId']);if(_0x31d224[_0xaa87('0x6a')]['id']){delete _0x31d224[_0xaa87('0x6a')]['id'];}if(_['isNil'](_0x31d224[_0xaa87('0x6a')][_0xaa87('0x9b')])){throw new db[(_0xaa87('0x9c'))][(_0xaa87('0x95'))](_0xaa87('0x9d'));}if(_['isNil'](_0x31d224[_0xaa87('0x6a')]['body'])||_0x31d224['body'][_0xaa87('0x6a')]===''){throw new db[(_0xaa87('0x9c'))][(_0xaa87('0x95'))](_0xaa87('0x9e'));}if(_['isNil'](_0x31d224[_0xaa87('0x6a')][_0xaa87('0x9f')])){throw new db[(_0xaa87('0x9c'))][(_0xaa87('0x95'))](_0xaa87('0xa0')+_0x3e5d06);}if(!_['includes'](_0x3e5d06,_0x31d224[_0xaa87('0x6a')][_0xaa87('0x9f')])){throw new db[(_0xaa87('0x9c'))][(_0xaa87('0x95'))](_0xaa87('0xa1')+_0x3e5d06);}_0x432b96[_0x31d224[_0xaa87('0x6a')][_0xaa87('0x9f')]]=_0x31d224[_0xaa87('0x6a')][_0xaa87('0x9b')];})[_0xaa87('0x12')](function(){return db[_0xaa87('0x62')][_0xaa87('0x68')]({'where':{'id':_0x31d224[_0xaa87('0x66')]['id']},'include':[{'model':db[_0xaa87('0xa2')],'as':_0xaa87('0xa3'),'include':[{'model':db[_0xaa87('0x94')],'as':_0xaa87('0xa4'),'where':_0x432b96,'limit':0x1,'order':[[_0xaa87('0x99'),'DESC']]}]},{'model':db['ChatApplication'],'as':'Applications'},{'model':db[_0xaa87('0xa5')],'as':_0xaa87('0xa5'),'include':[{'model':db[_0xaa87('0xa5')],'as':_0xaa87('0x3b'),'attributes':['id','interval'],'raw':!![]}]}]});})[_0xaa87('0x12')](function(_0x26400b){if(!_0x26400b)throw new APINotFoundError(util[_0xaa87('0x32')]('Chat\x20Website\x20with\x20id\x20%s\x20not\x20found',_0x31d224[_0xaa87('0x66')]['id']));if(!_0x26400b['Interval']||!_0x26400b['Interval'][_0xaa87('0x3b')])return[_0x26400b,!![]];return[_0x26400b,checkWebsiteIntervals(_0x26400b)];})[_0xaa87('0xa6')](function(_0x503133,_0x8a78e1){if(!_0x8a78e1)throw new APIOutOfIntervalError();if(!_0x503133[_0xaa87('0xa3')])return;_0xc817f1[_0xaa87('0xa7')]=_0x503133;_0xc817f1[_0xaa87('0xa8')]=_0x503133[_0xaa87('0xa3')];_0xc817f1['applications']=_[_0xaa87('0xa9')](_0x503133[_0xaa87('0xaa')],[_0xaa87('0xab')],[_0xaa87('0xac')]);if(_0xc817f1[_0xaa87('0xa7')][_0xaa87('0xaa')]){delete _0xc817f1[_0xaa87('0xa7')]['Applications'];}if(_0xc817f1[_0xaa87('0xa7')][_0xaa87('0xa3')]&&_0xc817f1[_0xaa87('0xa7')][_0xaa87('0xa3')]['Contacts'][_0xaa87('0x58')]){return _0xc817f1[_0xaa87('0xa7')]['List'][_0xaa87('0xa4')][0x0];}var _0xd5d8df=_[_0xaa87('0xc')](_0x31d224[_0xaa87('0x6a')],{'firstName':_0x31d224[_0xaa87('0x6a')][_0xaa87('0x9b')],'ListId':_0x503133[_0xaa87('0xad')]});_0xd5d8df[_0x31d224['body'][_0xaa87('0x9f')]]=_0x31d224['body'][_0xaa87('0x9b')];return db[_0xaa87('0x94')][_0xaa87('0x69')](_0xd5d8df,{'fields':_0xf66141,'raw':!![]});})[_0xaa87('0x12')](function(_0x2d79b3){_0xc817f1[_0xaa87('0xae')]=_0x2d79b3;var _0x2a18ed=createInteractionObject(_0x31d224[_0xaa87('0x66')]['id'],_0x31d224[_0xaa87('0x6a')],_0x31d224[_0xaa87('0xaf')],_0x2d79b3);var _0x11b292={'ChatWebsiteId':_0x31d224[_0xaa87('0x66')]['id'],'closed':![]};if(_0x31d224[_0xaa87('0x6a')][_0xaa87('0xb0')]){_0x11b292[_0xaa87('0xb0')]=_0x31d224[_0xaa87('0x6a')]['threadId'];return db['ChatInteraction'][_0xaa87('0x68')]({'where':_0x11b292})['then'](function(_0x2a828b){if(_0x2a828b){_0x43cc88=!![];return _0x2a828b;}_0x2a18ed[_0xaa87('0xb0')]=_0x31d224[_0xaa87('0x6a')][_0xaa87('0xb0')];_0x2a18ed[_0xaa87('0xb1')]=_0x31d224[_0xaa87('0x6a')]['externalUrl'];return db['ChatInteraction'][_0xaa87('0x69')](_0x2a18ed);});}_0x11b292[_0xaa87('0xb2')]=_0x2d79b3['id'];if(_0x31d224[_0xaa87('0x6a')]['interaction']&&_0x31d224[_0xaa87('0x6a')][_0xaa87('0xb3')]['id']){_0x11b292['id']=_0x31d224[_0xaa87('0x6a')][_0xaa87('0xb3')]['id'];return db[_0xaa87('0xb4')][_0xaa87('0x68')]({'where':_0x11b292})[_0xaa87('0x12')](function(_0x31ab62){if(_0x31ab62){_0x43cc88=!![];return _0x31ab62;}return db[_0xaa87('0xb4')][_0xaa87('0x69')](_0x2a18ed);});}return db[_0xaa87('0xb4')][_0xaa87('0x69')](_0x2a18ed);})['then'](function(_0x178d4d){if(!_0x43cc88)return _0x178d4d;var _0xf1a670={'from':(_0xc817f1[_0xaa87('0xae')][_0xaa87('0xb5')]||'')+'\x20'+(_0xc817f1[_0xaa87('0xae')][_0xaa87('0x43')]||'')};if(_0x31d224[_0xaa87('0x6a')][_0xaa87('0xb0')]&&_0x31d224[_0xaa87('0x6a')][_0xaa87('0xb6')]&&_0x31d224[_0xaa87('0x6a')][_0xaa87('0xb0')]!=_0x31d224[_0xaa87('0x6a')]['messageId']){_0xf1a670[_0xaa87('0xb0')]=_0x31d224['body'][_0xaa87('0xb6')];}return _0x178d4d[_0xaa87('0x26')](_0xf1a670);})['then'](function(_0x24ba5a){_0xc817f1[_0xaa87('0xb3')]=_0x24ba5a[_0xaa87('0x28')]({'plain':!![]});_0xc817f1[_0xaa87('0xb3')]['created']=!_0x43cc88;if(_0xc817f1['interaction'][_0xaa87('0xb7')]){if(_0xc817f1[_0xaa87('0xa7')]['autoclose']){_0xc817f1[_0xaa87('0xb8')][_0xaa87('0xb9')]({'id':0x0,'priority':_0xc817f1[_0xaa87('0xb8')][_0xaa87('0x58')]+0x1,'app':_0xaa87('0xba'),'appdata':_0xaa87('0xbb'),'interval':_0xaa87('0xbc')});}}return db[_0xaa87('0xbd')]['create']({'body':_0x31d224[_0xaa87('0x6a')][_0xaa87('0x6a')],'ChatWebsiteId':_0x31d224['params']['id'],'ChatInteractionId':_0x24ba5a['id'],'direction':'in','ContactId':_0xc817f1[_0xaa87('0xae')]['id'],'AttachmentId':_0x31d224[_0xaa87('0x6a')][_0xaa87('0xbe')]});})[_0xaa87('0x12')](function(_0x571523){_0xc817f1[_0xaa87('0x19')]=_0x571523;if(!_0xc817f1[_0xaa87('0xb3')][_0xaa87('0xbf')]){return;}return db[_0xaa87('0xc0')][_0xaa87('0x68')]({'attributes':['id',_0xaa87('0x2b')],'where':{'id':_0xc817f1[_0xaa87('0xb3')][_0xaa87('0xbf')]}});})['then'](function(_0x1207aa){if(_0x1207aa){_0xc817f1[_0xaa87('0xb8')][_0xaa87('0xc1')]({'id':0x0,'priority':0x0,'app':_0xaa87('0xc2'),'appdata':_0x1207aa[_0xaa87('0x2b')]+','+(_0xc817f1[_0xaa87('0xa7')][_0xaa87('0xc3')]||0xa),'interval':'*,*,*,*'});_0xc817f1[_0xaa87('0xc4')]=!![];}if(!_0xc817f1[_0xaa87('0xb3')][_0xaa87('0xc5')]){return;}return db[_0xaa87('0xc6')][_0xaa87('0x68')]({'attributes':['id',_0xaa87('0x2b')],'where':{'id':_0xc817f1[_0xaa87('0xb3')][_0xaa87('0xc5')]}});})['then'](function(_0x132e82){if(_0x132e82){_0xc817f1[_0xaa87('0xb8')][_0xaa87('0xc1')]({'id':0x0,'priority':0x1,'app':_0xaa87('0xc7'),'appdata':_0x132e82['name']+','+(_0xc817f1[_0xaa87('0xa7')]['waitForTheAssignedQueue']||0x12c),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0xaa87('0xc8'),_0xaa87('0xc9'),_0xc817f1);})['then'](function(_0x5ddf16){respondWithRpcPromise(_0xaa87('0xca'),'EventManager',{'event':'notify','message':_0x5ddf16},client9002);return _0x5ddf16;})['then'](respondWithResult(_0x29afa1,null))[_0xaa87('0x1b')](APIHandleError(_0x29afa1));};exports[_0xaa87('0xcb')]=function(_0x5917f1,_0x3df7e0){var _0x1d9cf8,_0x517176,_0x58eaac;var _0x2f570c=[];var _0x451425={};var _0x1cf602=_0x5917f1[_0xaa87('0xcc')]||[];var _0x1fb1ce=[];var _0x3867f2;return db[_0xaa87('0x94')]['describe']()[_0xaa87('0x12')](function(_0x301c0f){if(!_0x301c0f){throw new db['Sequelize']['ValidationError'](_0xaa87('0x96'));}_0x2f570c=_[_0xaa87('0x97')](_[_0xaa87('0x53')](_0x301c0f),[_0xaa87('0x98'),_0xaa87('0x99'),_0xaa87('0x9a'),_0xaa87('0xad')]);if(_0x5917f1[_0xaa87('0x6a')]['id']){delete _0x5917f1[_0xaa87('0x6a')]['id'];}if(_[_0xaa87('0x88')](_0x5917f1[_0xaa87('0x6a')]['from'])){throw _0x3df7e0[_0xaa87('0x1d')](0x1f4)[_0xaa87('0x2c')](new db[(_0xaa87('0x9c'))]['ValidationError']('from\x20is\x20mandatory'));}if(_[_0xaa87('0x88')](_0x5917f1[_0xaa87('0x6a')][_0xaa87('0x6a')])||_0x5917f1[_0xaa87('0x6a')][_0xaa87('0x6a')]===''){throw _0x3df7e0[_0xaa87('0x1d')](0x1f4)[_0xaa87('0x2c')](new db[(_0xaa87('0x9c'))][(_0xaa87('0x95'))](_0xaa87('0x9e')));}if(_[_0xaa87('0x88')](_0x5917f1[_0xaa87('0x6a')]['mapKeyOffline'])){throw _0x3df7e0[_0xaa87('0x1d')](0x1f4)['send'](new db[(_0xaa87('0x9c'))][(_0xaa87('0x95'))]('mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x2f570c));}if(!_[_0xaa87('0xcd')](_0x2f570c,_0x5917f1[_0xaa87('0x6a')][_0xaa87('0xce')])){throw _0x3df7e0[_0xaa87('0x1d')](0x1f4)[_0xaa87('0x2c')](new db[(_0xaa87('0x9c'))][(_0xaa87('0x95'))](_0xaa87('0xcf')+_0x2f570c));}_0x451425[_0x5917f1[_0xaa87('0x6a')][_0xaa87('0xce')]]=_0x5917f1['body'][_0xaa87('0x9b')];})[_0xaa87('0x12')](function(){return db['ChatWebsite'][_0xaa87('0x68')]({'where':{'id':_0x5917f1[_0xaa87('0x66')]['id']},'include':[{'model':db['CmList'],'as':'List'},{'model':db[_0xaa87('0xd0')],'as':_0xaa87('0xd0')}]});})[_0xaa87('0x12')](handleEntityNotFound(_0x3df7e0,null))[_0xaa87('0x12')](function(_0x5dd4cc){if(_0x5dd4cc&&_0x5dd4cc['List']){_0x517176=_0x5dd4cc;var _0x538515=_[_0xaa87('0xc')](_0x5917f1[_0xaa87('0x6a')],{'firstName':_0x5917f1[_0xaa87('0x6a')]['from'],'phone':_0x5917f1[_0xaa87('0x6a')][_0xaa87('0x9b')],'ListId':_0x5dd4cc[_0xaa87('0xad')]});_0x538515[_0x5917f1[_0xaa87('0x6a')]['mapKeyOffline']]=_0x5917f1['body'][_0xaa87('0x9b')];return db['CmContact'][_0xaa87('0xd1')]({'where':_0x451425,'defaults':_0x538515});}})[_0xaa87('0xa6')](function(_0x4cbe1b){if(_0x4cbe1b){_0x58eaac=_0x4cbe1b;var _0x4bbb1f=fs['readFileSync'](path[_0xaa87('0x83')](config[_0xaa87('0x84')],_0xaa87('0xd2')),'utf8');var _0x31b204=ejs[_0xaa87('0xd3')](_0x4bbb1f,{'body':_[_0xaa87('0xd4')](_0x5917f1[_0xaa87('0x6a')]['body']),'bodyTitle':_0x517176[_0xaa87('0xd5')]});return db[_0xaa87('0xd6')]['create']({'body':_0x31b204,'plainBody':htmlToText[_0xaa87('0xd7')](_0x31b204),'ContactId':_0x4cbe1b['id'],'ChatWebsiteId':_0x517176['id']});}})[_0xaa87('0x12')](function(_0x251ad0){_0x3867f2=_0x251ad0;if(_0x1cf602['length']){var _0x54b6d9=_0x1cf602[_0xaa87('0x3a')](function(_0x230596){return{'name':_0x230596[_0xaa87('0xd8')],'basename':_0x230596[_0xaa87('0x7f')],'type':_0x230596[_0xaa87('0xd9')],'ChatOfflineMessageId':_0x251ad0['id']};});_0x1fb1ce=_0x54b6d9[_0xaa87('0x3a')](_0x415827=>{var _0x4e5af8={'filename':_0x415827[_0xaa87('0x2b')],'path':path[_0xaa87('0x83')](config['root'],_0xaa87('0xda'),_0xaa87('0xcc'),_0xaa87('0xdb'),_0xaa87('0xdc'),_0x415827['basename'])};return _0x4e5af8;});if(!_0x517176['openNewInteraction']){return db[_0xaa87('0xdd')][_0xaa87('0xde')](function(_0x54c849){return db['Attachment'][_0xaa87('0xdf')](_0x54b6d9,{'transaction':_0x54c849});});}}})[_0xaa87('0x12')](function(){if(_0x3867f2){_0x1d9cf8=_0x3867f2;return db[_0xaa87('0xd0')][_0xaa87('0x79')]({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':'Smtp','raw':!![],'include':[{'model':db[_0xaa87('0xe0')],'as':'CloudProvider','raw':!![]}]}]});}})['then'](function(_0x13b771){if(_0x13b771&&_0x13b771[_0xaa87('0xe1')]&&_0x517176[_0xaa87('0xe2')]&&_0x517176['forwardOfflineAddress']){var _0x2aa43a=_0x13b771[_0xaa87('0xe3')]();return respondWithRpcPromise('SendMail',_0xaa87('0xe4'),{'account':_0x2aa43a,'message':{'from':util[_0xaa87('0x32')](_0xaa87('0xe5'),_0x13b771[_0xaa87('0x2b')],_0x13b771[_0xaa87('0xe6')]||_0x13b771[_0xaa87('0xe1')][_0xaa87('0x6b')]),'to':_0x517176[_0xaa87('0xe7')],'subject':_0x517176[_0xaa87('0xe8')],'html':_0x1d9cf8[_0xaa87('0x6a')],'attachments':_0x1fb1ce}},client9003)[_0xaa87('0x12')](function(){return _0x1d9cf8;})[_0xaa87('0x1b')](function(_0x257e2e){logger['error'](_0x257e2e);});}})[_0xaa87('0x12')](function(){if(_0x517176&&_0x517176[_0xaa87('0xe9')]&&_0x517176[_0xaa87('0xea')]){var _0x192240=[];if(_0x1cf602['length']){_0x192240=_0x1cf602[_0xaa87('0x3a')](function(_0x4b7639){return{'name':_0x4b7639[_0xaa87('0xd8')],'basename':_0x4b7639[_0xaa87('0x7f')],'type':_0x4b7639[_0xaa87('0xd9')],'ChatOfflineMessageId':_0x3867f2['id']};});}var _0x4b8b01;if(!_[_0xaa87('0x88')](_0x517176[_0xaa87('0xeb')])){var _0x1f61a8=_[_0xaa87('0x3a')](_0x5917f1[_0xaa87('0x6a')],function(_0x21018c){return _0x21018c;});var _0x492e2a=_[_0xaa87('0xec')](_0x1f61a8)[0x0];var _0x1ce7dc=_[_0xaa87('0xed')](_0x492e2a,function(_0x3d17de){return _0x3d17de;});_0x4b8b01=_0x1ce7dc[0x1][_0x517176[_0xaa87('0xeb')]];}var _0x553d68={'from':_0x58eaac[_0xaa87('0xe6')],'firstName':_0x58eaac['firstName'],'lastName':_0x58eaac['lastName'],'mapKey':'email','message':{'from':_0x58eaac[_0xaa87('0xe6')],'to':_0x517176['MailAccount'][_0xaa87('0xe6')],'cc':'','subject':_[_0xaa87('0x88')](_0x4b8b01)?_0x517176['offlineMessageSubject']:_0x4b8b01,'messageId':'','sentAt':new Date(),'attach':_0x192240[_0xaa87('0x58')],'attachments':_0x192240,'originChannel':_0xaa87('0xee'),'ChatWebsiteId':_0x517176['id'],'ChatOfflineMessageId':_0x1d9cf8['id'],'originTo':_0x517176[_0xaa87('0xd0')][_0xaa87('0xe6')]},'body':_0x1d9cf8[_0xaa87('0x6a')]};var _0x332fbb={'account':{'id':_0x517176['MailAccountId']},'body':_0x553d68,'log':_0xaa87('0xef')};return respondWithRpcPromise(_0xaa87('0xef'),_0xaa87('0xf0'),_0x332fbb,client9001)[_0xaa87('0x12')](function(){return _0x1d9cf8;})[_0xaa87('0x1b')](function(_0x9ed340){logger[_0xaa87('0x16')](_0x9ed340);});}return;})[_0xaa87('0x12')](function(){if(_0x1d9cf8){return _0x1d9cf8;}})['then'](respondWithResult(_0x3df7e0,null))['catch'](function(){for(var _0x1d58a2 of _0x1cf602){var _0x11c963=path[_0xaa87('0x83')](config[_0xaa87('0x84')],_0xaa87('0xda'),_0xaa87('0xcc'),_0xaa87('0xdb'),_0xaa87('0xdc'),_0x1d58a2[_0xaa87('0x7f')]);fs_extra[_0xaa87('0xf1')](_0x11c963)['catch'](function(_0x41464d){logger[_0xaa87('0x16')]('Could\x20not\x20remove\x20attachment\x20file',_0x11c963,_0x41464d);});}});};exports[_0xaa87('0xf2')]=function(_0x458f60,_0x2a2d56){return db[_0xaa87('0xb4')]['find']({'where':{'id':_0x458f60[_0xaa87('0x66')]['id']}})['then'](handleEntityNotFound(_0x2a2d56,null))[_0xaa87('0x12')](function(_0x49f101){if(_0x49f101){return _0x49f101['addInteraction'](_0x458f60['body'][_0xaa87('0x7b')],_[_0xaa87('0xf3')](_0x458f60['body'],['ids','id'])||{});}})['then'](respondWithResult(_0x2a2d56,null))[_0xaa87('0x1b')](handleError(_0x2a2d56,null));};exports[_0xaa87('0xf4')]=function(_0x20cd4f,_0x487d17){var _0x4308aa={'raw':![],'where':{}};var _0x51853a={};var _0x2603ef={'count':0x0,'rows':[]};return db[_0xaa87('0x62')][_0xaa87('0x79')]({'where':{'id':_0x20cd4f[_0xaa87('0x66')]['id']}})['then'](handleEntityNotFound(_0x487d17,null))[_0xaa87('0x12')](function(_0x29e273){if(_0x29e273){_0x51853a['model']=_[_0xaa87('0x53')](db['ChatInteraction'][_0xaa87('0x50')]);_0x51853a[_0xaa87('0x52')]=_[_0xaa87('0x53')](_0x20cd4f[_0xaa87('0x52')]);_0x51853a[_0xaa87('0x54')]=_[_0xaa87('0x55')](_0x51853a[_0xaa87('0x4a')],_0x51853a['query']);_0x4308aa[_0xaa87('0x56')]=_[_0xaa87('0x55')](_0x51853a[_0xaa87('0x4a')],qs['fields'](_0x20cd4f[_0xaa87('0x52')]['fields']));_0x4308aa[_0xaa87('0x56')]=_0x4308aa[_0xaa87('0x56')][_0xaa87('0x58')]?_0x4308aa[_0xaa87('0x56')]:_0x51853a[_0xaa87('0x4a')];if(!_0x20cd4f['query']['hasOwnProperty'](_0xaa87('0x5a'))){_0x4308aa[_0xaa87('0x21')]=qs[_0xaa87('0x21')](_0x20cd4f['query'][_0xaa87('0x21')]);_0x4308aa[_0xaa87('0x1f')]=qs[_0xaa87('0x1f')](_0x20cd4f['query']['offset']);}_0x4308aa[_0xaa87('0x5b')]=qs[_0xaa87('0x5c')](_0x20cd4f[_0xaa87('0x52')][_0xaa87('0x5c')]);_0x4308aa['where']=qs[_0xaa87('0x54')](_['pick'](_0x20cd4f['query'],_0x51853a['filters']));_0x4308aa[_0xaa87('0x5f')][_0xaa87('0x74')]=_0x29e273['id'];if(_0x20cd4f[_0xaa87('0x52')][_0xaa87('0x5e')]){_0x4308aa['where']=_[_0xaa87('0x60')](_0x4308aa[_0xaa87('0x5f')],{'$or':_['map'](_0x4308aa[_0xaa87('0x56')],function(_0x4f4c2b){var _0x1509d2={};_0x1509d2[_0x4f4c2b]={'$like':'%'+_0x20cd4f[_0xaa87('0x52')][_0xaa87('0x5e')]+'%'};return _0x1509d2;})});}_0x4308aa=_[_0xaa87('0x60')]({},_0x4308aa,_0x20cd4f[_0xaa87('0x61')]);return db['ChatInteraction'][_0xaa87('0x22')]({'where':_0x4308aa['where']})[_0xaa87('0x12')](function(_0xfe2188){_0x2603ef['count']=_0xfe2188;if(_0x20cd4f[_0xaa87('0x52')][_0xaa87('0x63')]){_0x4308aa[_0xaa87('0x67')]=[{'model':db[_0xaa87('0x94')],'as':_0xaa87('0xf5'),'required':![]},{'model':db[_0xaa87('0xc0')],'as':'Owner','attributes':[_0xaa87('0x2b'),'fullname','internal'],'required':![]},{'model':db[_0xaa87('0xf6')],'as':_0xaa87('0xf7'),'attributes':['id',_0xaa87('0x2b'),_0xaa87('0xf8')],'where':_0x20cd4f[_0xaa87('0x52')][_0xaa87('0xf9')]?{'id':_0x20cd4f['query'][_0xaa87('0xf9')]}:undefined,'required':_0x20cd4f[_0xaa87('0x52')][_0xaa87('0xf9')]?!![]:![]}];}return db['ChatInteraction'][_0xaa87('0x64')](_0x4308aa);})[_0xaa87('0x12')](function(_0xe7b931){_0x2603ef[_0xaa87('0x75')]=_0xe7b931;return _0x2603ef;});}})[_0xaa87('0x12')](respondWithFilteredResult(_0x487d17,_0x4308aa))[_0xaa87('0x1b')](handleError(_0x487d17,null));};exports[_0xaa87('0x2e')]=function(_0x48e51b,_0x1a8684){var _0x3fc207=0x0;var _0xf50387=0x0;var _0x51655=![];var _0x12e08b;var _0x5b45fe;return db[_0xaa87('0x62')][_0xaa87('0x68')]({'where':{'id':_0x48e51b[_0xaa87('0x66')]['id']},'include':[{'model':db[_0xaa87('0xa5')],'as':'Interval','include':[{'model':db[_0xaa87('0xa5')],'as':_0xaa87('0x3b'),'attributes':['id',_0xaa87('0x30')]}]}]})['then'](handleEntityNotFound(_0x1a8684,null))[_0xaa87('0x12')](function(_0x534107){if(_0x534107){_0x12e08b=_0x534107;return _0x534107[_0xaa87('0xfa')]({'raw':!![]});}})[_0xaa87('0x12')](function(_0x584e75){if(_0x12e08b){if(_0x584e75){_0x5b45fe=_0x584e75;}}return require(_0xaa87('0x85'))[_0xaa87('0x86')]();})[_0xaa87('0x12')](function(_0x4bf3b5){if(_0x4bf3b5){_0xf50387=_0x4bf3b5[_0xaa87('0xfb')];_0x51655=_0x4bf3b5[_0xaa87('0x87')];}})[_0xaa87('0x12')](function(){return db[_0xaa87('0xb4')][_0xaa87('0x22')]({'where':{'closed':![]}});})[_0xaa87('0x12')](function(_0x22d5b7){_0x3fc207=_0x22d5b7;if(_0xf50387&&_0x22d5b7>_0xf50387){return db['License'][_0xaa87('0x79')]({'where':{'id':0x1}})['then'](function(_0x5ba44c){if(_0x5ba44c){_0x5ba44c[_0xaa87('0xfc')](_0xaa87('0xfd'));}});}})[_0xaa87('0x12')](function(){if(!_0x12e08b['Interval']||!_0x12e08b[_0xaa87('0xa5')][_0xaa87('0x3b')])return!![];return checkWebsiteIntervals(_0x12e08b);})[_0xaa87('0x12')](function(_0x1e4fa0){var _0x2d3894=fs[_0xaa87('0xfe')](path[_0xaa87('0x83')](config[_0xaa87('0x84')],_0xaa87('0xff')),_0xaa87('0x100'));var _0x5d4849=new url[(_0xaa87('0x101'))](_0x12e08b[_0xaa87('0x102')])['origin'];var _0x3eae4c='3.5.0';var _0x4087fb=![];var _0x33d3d9={'chatVersion':_0x3eae4c,'chatWebsiteAddressOrigin':_0x5d4849,'remote':_0x12e08b[_0xaa87('0x103')],'query':querystring[_0xaa87('0x15')](_['merge'](_0x12e08b[_0xaa87('0x28')]({'plain':!![]}),{'customerIp':_0x48e51b['headers'][_0xaa87('0x104')]||_0x48e51b[_0xaa87('0xaf')]['x-real-ip']||_0x48e51b['connection'][_0xaa87('0x105')]||_0x48e51b['ip'],'referer':_0x48e51b['headers'][_0xaa87('0x106')],'openedInteractions':_0x3fc207,'maxInteractions':_0xf50387,'virtual':_0x51655[_0xaa87('0xfb')],'online':_0x1e4fa0,'custom':_0x51655}))['replace'](/'/g,'\x5c\x27')};_0x1a8684[_0xaa87('0x2c')](ejs[_0xaa87('0xd3')](Mustache[_0xaa87('0xd3')](_0x2d3894,_0x33d3d9),{'proactiveActions':_0x5b45fe,'alignment':_0x12e08b[_0xaa87('0x107')],'verticalAlignment':_0x12e08b[_0xaa87('0x108')],'div_color':_0x12e08b[_0xaa87('0xf8')],'labelText':_0x12e08b[_0xaa87('0x109')],'text_color':_0x12e08b[_0xaa87('0x10a')],'text_button_color':_0x12e08b[_0xaa87('0x10b')],'button_color':_0x12e08b[_0xaa87('0x10c')],'background_color':_0x12e08b[_0xaa87('0x10d')],'hideWhenOffline':_0x12e08b[_0xaa87('0x10e')],'intervalId':_0x12e08b['IntervalId'],'isDevelopment':_0x4087fb,'chatVersion':_0x3eae4c}));})[_0xaa87('0x1b')](handleError(_0x1a8684,null));};exports[_0xaa87('0x10f')]=function(_0x1647da,_0x3df03f){var _0x36733a=_0x1647da['params']['id'];var _0x2cb029=_0x1647da[_0xaa87('0x6a')];var _0x1385da=0xc8;var _0x1e16dd=null;return db['sequelize'][_0xaa87('0xde')]({'isolationLevel':db['sequelize'][_0xaa87('0x110')][_0xaa87('0x111')][_0xaa87('0x112')]},function(_0x562a2d){return db[_0xaa87('0x62')][_0xaa87('0x79')]({'where':{'id':_0x36733a},'transaction':_0x562a2d})['then'](function(_0x4ba716){if(_0x4ba716){return db['ChatApplication'][_0xaa87('0x27')]({'where':{'ChatWebsiteId':_0x36733a},'transaction':_0x562a2d})[_0xaa87('0x12')](function(){var _0xff3bde=_[_0xaa87('0x3a')](_0x2cb029,function(_0x56dacb){_0x56dacb[_0xaa87('0x74')]=_0x36733a;return _0x56dacb;});return db[_0xaa87('0x113')][_0xaa87('0xdf')](_0xff3bde,{'transaction':_0x562a2d});});}else{_0x1385da=0x194;_0x1e16dd=[];}});})[_0xaa87('0x12')](function(){if(_0x1385da!==0x194){return db[_0xaa87('0x113')][_0xaa87('0x114')]({'where':{'ChatWebsiteId':_0x36733a},'order':_0xaa87('0xab')})['then'](function(_0x145483){_0x1e16dd=_0x145483;});}})[_0xaa87('0x1b')](function(_0xe1863c){_0x1385da=0x1f4;logger[_0xaa87('0x16')](_0xe1863c[_0xaa87('0x2a')]);if(_0xe1863c['name']){delete _0xe1863c[_0xaa87('0x2b')];}_0x1e16dd=_0xe1863c;})[_0xaa87('0x115')](function(){if(_0x1e16dd===null){_0x3df03f['sendStatus'](_0x1385da);}else{if(_0x1385da===0x1f4){_0x3df03f[_0xaa87('0x1d')](_0x1385da)[_0xaa87('0x2c')](_0x1e16dd);}else{_0x3df03f['status'](_0x1385da)[_0xaa87('0x25')](_0x1e16dd);}}});};exports['getApplications']=function(_0xfb5e6e,_0x5bfd45){var _0x3c761f={};var _0x79f8b3={};var _0x595cfc;var _0x105979;return db[_0xaa87('0x62')]['findOne']({'where':{'id':_0xfb5e6e[_0xaa87('0x66')]['id']}})[_0xaa87('0x12')](handleEntityNotFound(_0x5bfd45,null))[_0xaa87('0x12')](function(_0x26a72a){if(_0x26a72a){_0x595cfc=_0x26a72a;_0x79f8b3[_0xaa87('0x4a')]=_[_0xaa87('0x53')](db[_0xaa87('0x113')][_0xaa87('0x50')]);_0x79f8b3['query']=_[_0xaa87('0x53')](_0xfb5e6e[_0xaa87('0x52')]);_0x79f8b3[_0xaa87('0x54')]=_[_0xaa87('0x55')](_0x79f8b3[_0xaa87('0x4a')],_0x79f8b3[_0xaa87('0x52')]);_0x3c761f[_0xaa87('0x56')]=_[_0xaa87('0x55')](_0x79f8b3[_0xaa87('0x4a')],qs[_0xaa87('0x57')](_0xfb5e6e[_0xaa87('0x52')][_0xaa87('0x57')]));_0x3c761f[_0xaa87('0x56')]=_0x3c761f[_0xaa87('0x56')][_0xaa87('0x58')]?_0x3c761f[_0xaa87('0x56')]:_0x79f8b3[_0xaa87('0x4a')];_0x3c761f[_0xaa87('0x5b')]=qs['sort'](_0xfb5e6e['query'][_0xaa87('0x5c')]);_0x3c761f[_0xaa87('0x5f')]=qs[_0xaa87('0x54')](_[_0xaa87('0x5d')](_0xfb5e6e['query'],_0x79f8b3[_0xaa87('0x54')]));if(_0xfb5e6e[_0xaa87('0x52')][_0xaa87('0x5e')]){_0x3c761f[_0xaa87('0x5f')]=_[_0xaa87('0x60')](_0x3c761f['where'],{'$or':_['map'](_0x3c761f[_0xaa87('0x56')],function(_0x205a30){var _0x2d2e60={};_0x2d2e60[_0x205a30]={'$like':'%'+_0xfb5e6e[_0xaa87('0x52')][_0xaa87('0x5e')]+'%'};return _0x2d2e60;})});}_0x3c761f=_[_0xaa87('0x60')]({},_0x3c761f,_0xfb5e6e[_0xaa87('0x61')]);return _0x595cfc[_0xaa87('0x116')](_0x3c761f);}})[_0xaa87('0x12')](function(_0x1d4b28){if(_0x1d4b28){_0x105979=_0x1d4b28[_0xaa87('0x58')];if(!_0xfb5e6e[_0xaa87('0x52')][_0xaa87('0x59')](_0xaa87('0x5a'))){_0x3c761f[_0xaa87('0x21')]=qs['limit'](_0xfb5e6e[_0xaa87('0x52')][_0xaa87('0x21')]);_0x3c761f[_0xaa87('0x1f')]=qs[_0xaa87('0x1f')](_0xfb5e6e['query'][_0xaa87('0x1f')]);}return _0x595cfc[_0xaa87('0x116')](_0x3c761f);}})[_0xaa87('0x12')](function(_0x425ca4){if(_0x425ca4){return _0x425ca4?{'count':_0x105979,'rows':_0x425ca4}:null;}})[_0xaa87('0x12')](respondWithResult(_0x5bfd45,null))[_0xaa87('0x1b')](handleError(_0x5bfd45,null));};exports['addProactiveActions']=function(_0x313885,_0x311e27){return db['chatProactiveAction'][_0xaa87('0x68')]({'where':{'id':_0x313885['params']['id']}})[_0xaa87('0x12')](handleEntityNotFound(_0x311e27,null))['then'](function(_0x59913d){if(_0x59913d){return _0x59913d[_0xaa87('0x117')](_0x313885[_0xaa87('0x6a')][_0xaa87('0x7b')],_['omit'](_0x313885[_0xaa87('0x6a')],[_0xaa87('0x7b'),'id'])||{});}})[_0xaa87('0x12')](respondWithResult(_0x311e27,null))[_0xaa87('0x1b')](handleError(_0x311e27,null));};exports['getProactiveActions']=function(_0x4ed43a,_0x3ecedf){var _0x2bd5ac={};var _0x980223={};var _0x187be2;var _0x4ac917;return db['ChatWebsite'][_0xaa87('0x79')]({'where':{'id':_0x4ed43a[_0xaa87('0x66')]['id']}})['then'](handleEntityNotFound(_0x3ecedf,null))[_0xaa87('0x12')](function(_0x5a7991){if(_0x5a7991){_0x187be2=_0x5a7991;_0x980223[_0xaa87('0x4a')]=_[_0xaa87('0x53')](db['ChatProactiveAction'][_0xaa87('0x50')]);_0x980223[_0xaa87('0x52')]=_[_0xaa87('0x53')](_0x4ed43a[_0xaa87('0x52')]);_0x980223[_0xaa87('0x54')]=_[_0xaa87('0x55')](_0x980223[_0xaa87('0x4a')],_0x980223[_0xaa87('0x52')]);_0x2bd5ac['attributes']=_[_0xaa87('0x55')](_0x980223[_0xaa87('0x4a')],qs[_0xaa87('0x57')](_0x4ed43a[_0xaa87('0x52')][_0xaa87('0x57')]));_0x2bd5ac[_0xaa87('0x56')]=_0x2bd5ac[_0xaa87('0x56')]['length']?_0x2bd5ac[_0xaa87('0x56')]:_0x980223[_0xaa87('0x4a')];_0x2bd5ac[_0xaa87('0x5b')]=qs[_0xaa87('0x5c')](_0x4ed43a[_0xaa87('0x52')][_0xaa87('0x5c')]);_0x2bd5ac[_0xaa87('0x5f')]=qs[_0xaa87('0x54')](_[_0xaa87('0x5d')](_0x4ed43a['query'],_0x980223[_0xaa87('0x54')]));if(_0x4ed43a['query'][_0xaa87('0x5e')]){_0x2bd5ac[_0xaa87('0x5f')]=_[_0xaa87('0x60')](_0x2bd5ac['where'],{'$or':_[_0xaa87('0x3a')](_0x2bd5ac[_0xaa87('0x56')],function(_0x470be9){var _0x4376fa={};_0x4376fa[_0x470be9]={'$like':'%'+_0x4ed43a['query'][_0xaa87('0x5e')]+'%'};return _0x4376fa;})});}_0x2bd5ac=_['merge']({},_0x2bd5ac,_0x4ed43a[_0xaa87('0x61')]);return _0x187be2[_0xaa87('0xfa')](_0x2bd5ac);}})['then'](function(_0x3af115){if(_0x3af115){_0x4ac917=_0x3af115[_0xaa87('0x58')];if(!_0x4ed43a[_0xaa87('0x52')]['hasOwnProperty']('nolimit')){_0x2bd5ac['limit']=qs['limit'](_0x4ed43a['query'][_0xaa87('0x21')]);_0x2bd5ac[_0xaa87('0x1f')]=qs[_0xaa87('0x1f')](_0x4ed43a['query'][_0xaa87('0x1f')]);}return _0x187be2[_0xaa87('0xfa')](_0x2bd5ac);}})[_0xaa87('0x12')](function(_0x236ee8){if(_0x236ee8){return _0x236ee8?{'count':_0x4ac917,'rows':_0x236ee8}:null;}})[_0xaa87('0x12')](respondWithResult(_0x3ecedf,null))[_0xaa87('0x1b')](handleError(_0x3ecedf,null));};exports[_0xaa87('0x118')]=function(_0x15bb1a,_0x40a63f){var _0x5397e7=_0x15bb1a[_0xaa87('0x52')][_0xaa87('0x119')]==='false'?_0xaa87('0x11a'):'onlineForm';return db[_0xaa87('0x62')]['find']({'attributes':['id',_0x5397e7],'where':{'id':_0x15bb1a[_0xaa87('0x66')]['id']}})[_0xaa87('0x12')](handleEntityNotFound(_0x40a63f,null))[_0xaa87('0x12')](function(_0x35a553){if(_0x35a553){var _0x5335e1=_0x35a553[_0x5397e7];var _0x3c2f82=_0x5335e1&&_0x5335e1[_0xaa87('0x11b')]?_0x5335e1['items']:[];_0x40a63f[_0xaa87('0x2c')]({'fromKey':_[_0xaa87('0x88')](_0x5335e1[_0xaa87('0x11c')])?undefined:_0x5335e1['fromKey'],'count':_0x3c2f82[_0xaa87('0x58')],'rows':_0x3c2f82});}})[_0xaa87('0x1b')](handleError(_0x40a63f,null));};exports[_0xaa87('0x11d')]=function(_0x3058db,_0x378ff7){var _0x5c986b={'raw':![],'where':{}};var _0x2d0f78={};var _0x5a821c={'count':0x0,'rows':[]};return db[_0xaa87('0x62')][_0xaa87('0x79')]({'where':{'id':_0x3058db[_0xaa87('0x66')]['id']}})['then'](handleEntityNotFound(_0x378ff7,null))[_0xaa87('0x12')](function(_0x5eb618){if(_0x5eb618){_0x2d0f78['model']=_[_0xaa87('0x53')](db[_0xaa87('0xd6')]['rawAttributes']);_0x2d0f78['query']=_[_0xaa87('0x53')](_0x3058db[_0xaa87('0x52')]);_0x2d0f78[_0xaa87('0x54')]=_[_0xaa87('0x55')](_0x2d0f78[_0xaa87('0x4a')],_0x2d0f78[_0xaa87('0x52')]);_0x5c986b[_0xaa87('0x56')]=_[_0xaa87('0x55')](_0x2d0f78[_0xaa87('0x4a')],qs['fields'](_0x3058db[_0xaa87('0x52')][_0xaa87('0x57')]));_0x5c986b[_0xaa87('0x56')]=_0x5c986b[_0xaa87('0x56')][_0xaa87('0x58')]?_0x5c986b[_0xaa87('0x56')]:_0x2d0f78[_0xaa87('0x4a')];if(!_0x3058db[_0xaa87('0x52')][_0xaa87('0x59')](_0xaa87('0x5a'))){_0x5c986b['limit']=qs['limit'](_0x3058db['query'][_0xaa87('0x21')]);_0x5c986b[_0xaa87('0x1f')]=qs[_0xaa87('0x1f')](_0x3058db[_0xaa87('0x52')]['offset']);}_0x5c986b[_0xaa87('0x5b')]=qs[_0xaa87('0x5c')](_0x3058db[_0xaa87('0x52')][_0xaa87('0x5c')]);_0x5c986b[_0xaa87('0x5f')]=qs[_0xaa87('0x54')](_[_0xaa87('0x5d')](_0x3058db['query'],_0x2d0f78[_0xaa87('0x54')]));_0x5c986b['where']['ChatWebsiteId']=_0x5eb618['id'];if(_0x3058db[_0xaa87('0x52')][_0xaa87('0x5e')]){_0x5c986b[_0xaa87('0x5f')]=_[_0xaa87('0x60')](_0x5c986b[_0xaa87('0x5f')],{'$or':_[_0xaa87('0x3a')](_0x5c986b['attributes'],function(_0x3fba9c){var _0x50f387={};_0x50f387[_0x3fba9c]={'$like':'%'+_0x3058db[_0xaa87('0x52')][_0xaa87('0x5e')]+'%'};return _0x50f387;})});}_0x5c986b=_[_0xaa87('0x60')]({},_0x5c986b,_0x3058db['options']);return db[_0xaa87('0xd6')][_0xaa87('0x22')]({'where':_0x5c986b[_0xaa87('0x5f')]})[_0xaa87('0x12')](function(_0x3dc7bb){_0x5a821c['count']=_0x3dc7bb;if(_0x3058db[_0xaa87('0x52')][_0xaa87('0x63')]){_0x5c986b[_0xaa87('0x67')]=[{'all':!![]}];}else{_0x5c986b[_0xaa87('0x67')]=[{'model':db[_0xaa87('0x94')],'as':_0xaa87('0xf5'),'required':![]},{'model':db[_0xaa87('0x11e')],'as':_0xaa87('0x11f'),'required':![]}];}return db[_0xaa87('0xd6')][_0xaa87('0x64')](_0x5c986b);})['then'](function(_0x45d122){_0x5a821c[_0xaa87('0x75')]=_0x45d122;return _0x5a821c;});}})['then'](respondWithFilteredResult(_0x378ff7,_0x5c986b))[_0xaa87('0x1b')](handleError(_0x378ff7,null));};exports[_0xaa87('0x120')]=function(_0x2d77af,_0x7fae2b){return db['ChatWebsite']['find']({'where':{'id':_0x2d77af[_0xaa87('0x66')]['id']}})['then'](handleEntityNotFound(_0x7fae2b,null))[_0xaa87('0x12')](function(_0xbad81c){if(_0xbad81c){return _0xbad81c[_0xaa87('0x120')](_0x2d77af['body']['ids'],_[_0xaa87('0xf3')](_0x2d77af[_0xaa87('0x6a')],[_0xaa87('0x7b'),'id'])||{})['spread'](function(_0x14739b){for(var _0x383361=0x0;_0x383361<_0x2d77af['body'][_0xaa87('0x7b')]['length'];_0x383361+=0x1){socket[_0xaa87('0x121')](_0xaa87('0x122'),{'UserId':Number(_0x2d77af[_0xaa87('0x6a')]['ids'][_0x383361]),'ChatWebsiteId':Number(_0x2d77af[_0xaa87('0x66')]['id'])});}return _0x14739b;});}})[_0xaa87('0x12')](respondWithResult(_0x7fae2b,null))[_0xaa87('0x1b')](handleError(_0x7fae2b,null));};exports[_0xaa87('0x123')]=function(_0x4d9e73,_0x49bd34){return db[_0xaa87('0x62')][_0xaa87('0x68')]({'where':{'id':_0x4d9e73['params']['id']}})[_0xaa87('0x12')](handleEntityNotFound(_0x49bd34,null))[_0xaa87('0x12')](function(_0x452f20){if(_0x452f20){return _0x452f20[_0xaa87('0x123')](_0x4d9e73[_0xaa87('0x52')][_0xaa87('0x7b')])['then'](function(){if(_[_0xaa87('0x124')](_0x4d9e73[_0xaa87('0x52')][_0xaa87('0x7b')])){for(var _0x3edd74=0x0;_0x3edd74<_0x4d9e73['query']['ids'][_0xaa87('0x58')];_0x3edd74+=0x1){socket[_0xaa87('0x121')](_0xaa87('0x125'),{'UserId':Number(_0x4d9e73['query'][_0xaa87('0x7b')][_0x3edd74]),'ChatWebsiteId':Number(_0x4d9e73[_0xaa87('0x66')]['id'])});}}else{socket[_0xaa87('0x121')](_0xaa87('0x125'),{'UserId':Number(_0x4d9e73[_0xaa87('0x52')]['ids']),'ChatWebsiteId':Number(_0x4d9e73['params']['id'])});}});}})['then'](respondWithStatusCode(_0x49bd34,null))[_0xaa87('0x1b')](handleError(_0x49bd34,null));};exports[_0xaa87('0x126')]=function(_0x5ef418,_0x424596){var _0x137e04={};var _0x323d9f={};var _0x2e6841;var _0x468442;return db[_0xaa87('0x62')][_0xaa87('0x79')]({'where':{'id':_0x5ef418[_0xaa87('0x66')]['id']}})[_0xaa87('0x12')](handleEntityNotFound(_0x424596,null))[_0xaa87('0x12')](function(_0xfce783){if(_0xfce783){_0x2e6841=_0xfce783;_0x323d9f[_0xaa87('0x4a')]=_['keys'](db[_0xaa87('0xc0')][_0xaa87('0x50')]);_0x323d9f[_0xaa87('0x52')]=_[_0xaa87('0x53')](_0x5ef418[_0xaa87('0x52')]);_0x323d9f[_0xaa87('0x54')]=_[_0xaa87('0x55')](_0x323d9f[_0xaa87('0x4a')],_0x323d9f['query']);_0x137e04['attributes']=_['intersection'](_0x323d9f[_0xaa87('0x4a')],qs[_0xaa87('0x57')](_0x5ef418[_0xaa87('0x52')][_0xaa87('0x57')]));_0x137e04[_0xaa87('0x56')]=_0x137e04[_0xaa87('0x56')][_0xaa87('0x58')]?_0x137e04['attributes']:_0x323d9f[_0xaa87('0x4a')];_0x137e04[_0xaa87('0x5b')]=qs[_0xaa87('0x5c')](_0x5ef418[_0xaa87('0x52')]['sort']);_0x137e04['where']=qs[_0xaa87('0x54')](_[_0xaa87('0x5d')](_0x5ef418[_0xaa87('0x52')],_0x323d9f[_0xaa87('0x54')]));if(_0x5ef418[_0xaa87('0x52')][_0xaa87('0x5e')]){_0x137e04[_0xaa87('0x5f')]=_['merge'](_0x137e04['where'],{'$or':_['map'](_0x137e04[_0xaa87('0x56')],function(_0x5f340b){var _0x1627dd={};_0x1627dd[_0x5f340b]={'$like':'%'+_0x5ef418[_0xaa87('0x52')]['filter']+'%'};return _0x1627dd;})});}_0x137e04=_[_0xaa87('0x60')]({},_0x137e04,_0x5ef418[_0xaa87('0x61')]);return _0x2e6841[_0xaa87('0x126')](_0x137e04);}})['then'](function(_0x6dba46){if(_0x6dba46){_0x468442=_0x6dba46[_0xaa87('0x58')];if(!_0x5ef418[_0xaa87('0x52')]['hasOwnProperty']('nolimit')){_0x137e04[_0xaa87('0x21')]=qs[_0xaa87('0x21')](_0x5ef418['query'][_0xaa87('0x21')]);_0x137e04['offset']=qs[_0xaa87('0x1f')](_0x5ef418[_0xaa87('0x52')]['offset']);}return _0x2e6841['getAgents'](_0x137e04);}})[_0xaa87('0x12')](function(_0x2a0de4){if(_0x2a0de4){return _0x2a0de4?{'count':_0x468442,'rows':_0x2a0de4}:null;}})[_0xaa87('0x12')](respondWithResult(_0x424596,null))[_0xaa87('0x1b')](handleError(_0x424596,null));}; \ No newline at end of file +var _0x174b=['getLogo','join','root','server/files/images/logos/default_logo.svg','../../config/license/util','existsSync','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','isNil','server/files/images/avatars/','agentAvatar','server/files/images/avatars/customer_avatar.png','getSystemAvatar','server/files/images/avatars/system_avatar.png','systemAvatar','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','from','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','CmContact','Contacts','ChatApplication','Applications','Chat\x20Website\x20with\x20id\x20%s\x20not\x20found','account','list','List','applications','orderBy','priority','asc','ListId','contact','headers','threadId','ChatInteraction','externalUrl','ContactId','interaction','lastName','messageId','autoclose','push','close','unmanaged','*,*,*,*','ChatMessage','UserId','User','unshift','agent','forcedOwnership','ChatQueue','queueId','Start','startRouting','EventManager','notify','offline','from\x20is\x20mandatory','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','defaults','findOrCreate','spread','server/files/templates/chatOfflineMessage.ejs','toPairs','ChatOfflineMessage','fromString','originalname','server','files','offline-chat','basename','openNewInteraction','sequelize','Attachment','MailAccount','MailServerOut','CloudProvider','Smtp','forwardOfflineAddress','\x22%s\x22\x20<%s>','email','offlineMessageSubject','mimetype','subjectOffline','toPairsIn','mapValues','firstName','Chat','MailAccountId','NotifyMailAccount','attachments','remove','Could\x20not\x20remove\x20attachment\x20file','getInteractions','Owner','fullname','internal','tag','getProactiveActions','getLicense','virtual','custom','increment','chatLicenseExceeded','readFileSync','server/files/chat/iframe.ejs','utf8','address','3.5.0','remote','x-real-ip','connection','replace','render','color','labelText','textColor','textButtonColor','backgroundColor','IntervalId','addApplications','Transaction','ISOLATION_LEVELS','READ_COMMITTED','findAndCountAll','finally','getApplications','addProactiveActions','chatProactiveAction','omit','ChatProactiveAction','false','items','getOfflineMessages','Contact','Attachments','emit','userChatWebsite:save','removeAgents','userChatWebsite:remove','getAgents','mustache','util','path','ejs','lodash','querystring','html-to-text','ioredis','jayson/promise','url','../../config/logger','api','../../config/environment','../../errors/api','APIOutOfIntervalError','APINotFoundError','handleError','redis','socket.io-emitter','./chatWebsite.socket','client','http','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','update','get','ChatWebsites','UserProfileResource','destroy','stack','name','send','Command','getSnippet','timezone','format','iftime\x20%s,%s','interval','iftime\x20%s','indexOf','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','inspect','No\x20timezone','map','Interval','Intervals','all','some','user-agent','customerIp','cf-connecting-ip','x-forwarded-for','first','x-real-port','referer','browser','version','unknown','%s\x20%s','vendor','device','index','ChatWebsite','rawAttributes','type','key','query','keys','intersection','model','attributes','fields','length','nolimit','order','sort','where','filter','merge','VIRTUAL','includeAll','include','findAll','show','params','Pause','options','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','mandatoryDispositionPause','describe','addDisposition','ChatWebsiteId','Disposition','getDispositions','findOne','hasOwnProperty','pick','filters','rows','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','addLogo','sitepic','file','filename','addAvatar','customerAvatar'];(function(_0x2a2166,_0x3a077f){var _0x3bcf50=function(_0x3f0300){while(--_0x3f0300){_0x2a2166['push'](_0x2a2166['shift']());}};_0x3bcf50(++_0x3a077f);}(_0x174b,0x1c6));var _0xb174=function(_0x30dbca,_0x3d10f6){_0x30dbca=_0x30dbca-0x0;var _0xd29ae5=_0x174b[_0x30dbca];return _0xd29ae5;};'use strict';var Mustache=require(_0xb174('0x0'));var util=require(_0xb174('0x1'));var path=require(_0xb174('0x2'));var ejs=require(_0xb174('0x3'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb174('0x4'));var querystring=require(_0xb174('0x5'));var htmlToText=require(_0xb174('0x6'));var Redis=require(_0xb174('0x7'));var jayson=require(_0xb174('0x8'));var url=require(_0xb174('0x9'));var qs=require('../../components/parsers/qs');var logger=require(_0xb174('0xa'))(_0xb174('0xb'));var config=require(_0xb174('0xc'));var APIOutOfIntervalError=require(_0xb174('0xd'))[_0xb174('0xe')];var APINotFoundError=require('../../errors/api')[_0xb174('0xf')];var APIHandleError=require(_0xb174('0xd'))[_0xb174('0x10')];var db=require('../../mysqldb')['db'];config[_0xb174('0x11')]=_['defaults'](config[_0xb174('0x11')],{'host':'localhost','port':0x18eb});var socket=require(_0xb174('0x12'))(new Redis(config[_0xb174('0x11')]));require(_0xb174('0x13'))['register'](socket);var client=jayson[_0xb174('0x14')]['http']({'port':0x232c});var client9002=jayson[_0xb174('0x14')]['http']({'port':0x232a});var client9003=jayson[_0xb174('0x14')][_0xb174('0x15')]({'port':0x232b});var client9001=jayson[_0xb174('0x14')]['http']({'port':0x2329});function respondWithRpcPromise(_0x513fc6,_0x20259d,_0x538442,_0x3a0a0c){return new Promise(function(_0x4bbc62,_0x28892c){var _0x118c44=_0x3a0a0c||client;return _0x118c44[_0xb174('0x16')](_0x513fc6,_0x538442)[_0xb174('0x17')](function(_0x4b1f24){logger[_0xb174('0x18')](_0xb174('0x19'),_0x20259d,_0xb174('0x1a'));logger[_0xb174('0x1b')](_0xb174('0x1c'),_0x20259d,_0xb174('0x1a'),JSON[_0xb174('0x1d')](_0x4b1f24));if(_0x4b1f24[_0xb174('0x1e')]){if(_0x4b1f24[_0xb174('0x1e')][_0xb174('0x1f')]===0x1f4){logger[_0xb174('0x1e')]('ChatWebsite,\x20%s,\x20%s',_0x20259d,_0x4b1f24[_0xb174('0x1e')]['message']);return _0x28892c(_0x4b1f24['error'][_0xb174('0x20')]);}logger['error'](_0xb174('0x19'),_0x20259d,_0x4b1f24[_0xb174('0x1e')][_0xb174('0x20')]);return _0x4bbc62(_0x4b1f24['error'][_0xb174('0x20')]);}else{logger[_0xb174('0x18')](_0xb174('0x19'),_0x20259d,_0xb174('0x1a'));_0x4bbc62(_0x4b1f24[_0xb174('0x21')][_0xb174('0x20')]);}})[_0xb174('0x22')](function(_0x586bc4){logger[_0xb174('0x1e')](_0xb174('0x19'),_0x20259d,_0x586bc4);_0x28892c(_0x586bc4);});});}function respondWithStatusCode(_0x6242f2,_0x1f2e67){_0x1f2e67=_0x1f2e67||0xcc;return function(_0x54abfd){if(_0x54abfd){return _0x6242f2[_0xb174('0x23')](_0x1f2e67);}return _0x6242f2[_0xb174('0x24')](_0x1f2e67)[_0xb174('0x25')]();};}function respondWithResult(_0x202cf6,_0x36d46a){_0x36d46a=_0x36d46a||0xc8;return function(_0x3685de){if(_0x3685de){return _0x202cf6[_0xb174('0x24')](_0x36d46a)[_0xb174('0x26')](_0x3685de);}};}function respondWithFilteredResult(_0x1651c8,_0x4bf98a){return function(_0x26571d){if(_0x26571d){var _0x47a781=typeof _0x4bf98a[_0xb174('0x27')]===_0xb174('0x28')&&typeof _0x4bf98a['limit']===_0xb174('0x28');var _0x18c546=_0x26571d['count'];var _0x40d7ac=_0x47a781?0x0:_0x4bf98a[_0xb174('0x27')];var _0x48b42f=_0x47a781?_0x26571d[_0xb174('0x29')]:_0x4bf98a[_0xb174('0x27')]+_0x4bf98a[_0xb174('0x2a')];var _0x1fdc8c;if(_0x48b42f>=_0x18c546){_0x48b42f=_0x18c546;_0x1fdc8c=0xc8;}else{_0x1fdc8c=0xce;}_0x1651c8[_0xb174('0x24')](_0x1fdc8c);return _0x1651c8['set'](_0xb174('0x2b'),_0x40d7ac+'-'+_0x48b42f+'/'+_0x18c546)[_0xb174('0x26')](_0x26571d);}return null;};}function saveUpdates(_0x192e5e){return function(_0x18e688){if(_0x18e688){return _0x18e688[_0xb174('0x2c')](_0x192e5e)[_0xb174('0x17')](function(_0x50e8d9){return _0x50e8d9;});}return null;};}function removeEntity(_0x131772){return function(_0x8af248){if(_0x8af248){return _0x8af248['destroy']()[_0xb174('0x17')](function(){var _0x325906=_0x8af248[_0xb174('0x2d')]({'plain':!![]});var _0x1ffef2=_0xb174('0x2e');return db[_0xb174('0x2f')][_0xb174('0x30')]({'where':{'type':_0x1ffef2,'resourceId':_0x325906['id']}})[_0xb174('0x17')](function(){return _0x8af248;});})[_0xb174('0x17')](function(){_0x131772[_0xb174('0x24')](0xcc)[_0xb174('0x25')]();});}};}function handleEntityNotFound(_0xf22f0){return function(_0x5b8ed8){if(!_0x5b8ed8){_0xf22f0[_0xb174('0x23')](0x194);}return _0x5b8ed8;};}function handleError(_0x7bdb78,_0x2c840a){_0x2c840a=_0x2c840a||0x1f4;return function(_0x29cf4c){logger['error'](_0x29cf4c[_0xb174('0x31')]);if(_0x29cf4c[_0xb174('0x32')]){delete _0x29cf4c[_0xb174('0x32')];}_0x7bdb78[_0xb174('0x24')](_0x2c840a)[_0xb174('0x33')](_0x29cf4c);};}function iftimePromise(_0x263a53,_0x199362){return respondWithRpcPromise(_0xb174('0x34'),_0xb174('0x35'),{'command':_0x199362[_0xb174('0x36')]?util[_0xb174('0x37')](_0xb174('0x38'),_0x263a53[_0xb174('0x39')],_0x199362[_0xb174('0x36')]):util[_0xb174('0x37')](_0xb174('0x3a'),_0x263a53[_0xb174('0x39')])},client9002)[_0xb174('0x17')](function(_0x240164){var _0x6ea2e7=_0x240164&&_0x240164[_0xb174('0x3b')]('true')>=0x0?!![]:![];logger[_0xb174('0x18')](_0xb174('0x3c'),_0x199362['id'],_0x263a53['id'],_0x263a53[_0xb174('0x39')],_0x6ea2e7?_0xb174('0x3d'):_0xb174('0x3e'),_0x199362[_0xb174('0x36')]?_0x199362[_0xb174('0x36')]:'No\x20timezone');return _0x6ea2e7;})['catch'](function(_0x287c4c){logger[_0xb174('0x1e')](_0xb174('0x3c'),_0x199362['id'],_0x263a53['id'],_0x263a53[_0xb174('0x39')],util[_0xb174('0x3f')](_0x287c4c,{'showHidden':![],'depth':null}),_0x199362['timezone']?_0x199362[_0xb174('0x36')]:_0xb174('0x40'));return![];});}function checkWebsiteIntervals(_0x1691ca){var _0x20e0da=_[_0xb174('0x41')](_0x1691ca[_0xb174('0x42')][_0xb174('0x43')],function(_0x5e26ff){var _0x2f8540=_0x5e26ff[_0xb174('0x2d')]({'plain':!![]});return iftimePromise(_0x2f8540,_0x1691ca);});return Promise[_0xb174('0x44')](_0x20e0da)['then'](function(_0x374cf6){return _[_0xb174('0x45')](_0x374cf6);});}function createInteractionObject(_0x39162e,_0x5069a0,_0x476dc4,_0x425880){var _0x4ef727=require('user-agent-parser');var _0x340865=new _0x4ef727();var _0x56ad68=_0x340865['setUA'](_0x476dc4[_0xb174('0x46')])['getResult']();var _0x2fe87c=_0x5069a0[_0xb174('0x47')];if(_0x476dc4[_0xb174('0x48')]){_0x2fe87c=_0x476dc4[_0xb174('0x48')];}else if(_0x476dc4[_0xb174('0x49')]){_0x2fe87c=_[_0xb174('0x4a')](_0x476dc4[_0xb174('0x49')]['split'](','));}return{'ContactId':_0x425880['id'],'ChatWebsiteId':_0x39162e,'from':(_0x425880['firstName']||'')+'\x20'+(_0x425880['lastName']||''),'customerIp':_0x2fe87c,'customerPort':_0x476dc4[_0xb174('0x4b')]?_0x476dc4[_0xb174('0x4b')]:null,'referer':_0x5069a0[_0xb174('0x4c')],'browserName':_0x56ad68[_0xb174('0x4d')][_0xb174('0x32')]&&_0x56ad68[_0xb174('0x4d')][_0xb174('0x4e')]?util['format']('%s\x20%s',_0x56ad68[_0xb174('0x4d')]['name'],_0x56ad68[_0xb174('0x4d')][_0xb174('0x4e')]):_0xb174('0x4f'),'browserVersion':_0x56ad68[_0xb174('0x4d')][_0xb174('0x4e')]||'unknown','osName':util[_0xb174('0x37')](_0xb174('0x50'),_0x56ad68['os'][_0xb174('0x32')],_0x56ad68['os'][_0xb174('0x4e')]),'osVersion':_0x56ad68['os']['version'],'deviceModel':_0x56ad68['device']['model']&&_0x56ad68['device'][_0xb174('0x51')]?util[_0xb174('0x37')]('%s\x20%s\x20%s',_0x56ad68[_0xb174('0x52')]['model'],_0x56ad68[_0xb174('0x52')]['vendor'],_0x56ad68['device']['type']):null,'deviceVendor':_0x56ad68[_0xb174('0x52')][_0xb174('0x51')],'deviceType':_0x56ad68['device']['type'],'formData':JSON[_0xb174('0x1d')](_0x5069a0)};}exports[_0xb174('0x53')]=function(_0x2da8b8,_0x3650d3){var _0x537281={'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x496acc={},_0x1993b0={'count':0x0,'rows':[]};var _0x2f777a=_[_0xb174('0x41')](db[_0xb174('0x54')][_0xb174('0x55')],function(_0x5b88fb){return{'name':_0x5b88fb['fieldName'],'type':_0x5b88fb[_0xb174('0x56')][_0xb174('0x57')]};});_0x496acc['model']=_[_0xb174('0x41')](_0x2f777a,_0xb174('0x32'));_0x496acc[_0xb174('0x58')]=_[_0xb174('0x59')](_0x2da8b8[_0xb174('0x58')]);_0x496acc['filters']=_[_0xb174('0x5a')](_0x496acc[_0xb174('0x5b')],_0x496acc[_0xb174('0x58')]);_0x537281[_0xb174('0x5c')]=_[_0xb174('0x5a')](_0x496acc[_0xb174('0x5b')],qs[_0xb174('0x5d')](_0x2da8b8[_0xb174('0x58')][_0xb174('0x5d')]));_0x537281[_0xb174('0x5c')]=_0x537281[_0xb174('0x5c')][_0xb174('0x5e')]?_0x537281[_0xb174('0x5c')]:_0x496acc['model'];if(!_0x2da8b8[_0xb174('0x58')]['hasOwnProperty'](_0xb174('0x5f'))){_0x537281['limit']=qs[_0xb174('0x2a')](_0x2da8b8[_0xb174('0x58')]['limit']);_0x537281[_0xb174('0x27')]=qs[_0xb174('0x27')](_0x2da8b8[_0xb174('0x58')]['offset']);}_0x537281[_0xb174('0x60')]=qs['sort'](_0x2da8b8[_0xb174('0x58')][_0xb174('0x61')]);_0x537281[_0xb174('0x62')]=qs['filters'](_['pick'](_0x2da8b8[_0xb174('0x58')],_0x496acc['filters']),_0x2f777a);if(_0x2da8b8[_0xb174('0x58')][_0xb174('0x63')]){_0x537281[_0xb174('0x62')]=_[_0xb174('0x64')](_0x537281['where'],{'$or':_[_0xb174('0x41')](_0x2f777a,function(_0x2f152f){if(_0x2f152f[_0xb174('0x56')]!==_0xb174('0x65')){var _0x53f41e={};_0x53f41e[_0x2f152f[_0xb174('0x32')]]={'$like':'%'+_0x2da8b8[_0xb174('0x58')]['filter']+'%'};return _0x53f41e;}})});}_0x537281=_[_0xb174('0x64')]({},_0x537281,_0x2da8b8['options']);var _0x348df9={'where':_0x537281['where']};return db[_0xb174('0x54')][_0xb174('0x29')](_0x348df9)['then'](function(_0x44f399){_0x1993b0['count']=_0x44f399;if(_0x2da8b8[_0xb174('0x58')][_0xb174('0x66')]){_0x537281[_0xb174('0x67')]=[{'all':!![]}];}return db[_0xb174('0x54')][_0xb174('0x68')](_0x537281);})[_0xb174('0x17')](function(_0x15845b){_0x1993b0['rows']=_0x15845b;return _0x1993b0;})[_0xb174('0x17')](respondWithFilteredResult(_0x3650d3,_0x537281))[_0xb174('0x22')](handleError(_0x3650d3,null));};exports[_0xb174('0x69')]=function(_0x366e32,_0x501fe8){var _0x3f9f04={'raw':![],'where':{'id':_0x366e32[_0xb174('0x6a')]['id']},'include':[{'model':db[_0xb174('0x6b')],'as':'mandatoryDispositionPause'}]},_0xd413cc={};_0xd413cc[_0xb174('0x5b')]=_['keys'](db[_0xb174('0x54')][_0xb174('0x55')]);_0xd413cc[_0xb174('0x58')]=_['keys'](_0x366e32[_0xb174('0x58')]);_0xd413cc['filters']=_[_0xb174('0x5a')](_0xd413cc[_0xb174('0x5b')],_0xd413cc[_0xb174('0x58')]);_0x3f9f04['attributes']=_[_0xb174('0x5a')](_0xd413cc['model'],qs[_0xb174('0x5d')](_0x366e32['query']['fields']));_0x3f9f04[_0xb174('0x5c')]=_0x3f9f04['attributes'][_0xb174('0x5e')]?_0x3f9f04[_0xb174('0x5c')]:_0xd413cc[_0xb174('0x5b')];if(_0x366e32[_0xb174('0x58')]['includeAll']){_0x3f9f04[_0xb174('0x67')]=[{'all':!![]}];}_0x3f9f04=_[_0xb174('0x64')]({},_0x3f9f04,_0x366e32[_0xb174('0x6c')]);return db[_0xb174('0x54')][_0xb174('0x6d')](_0x3f9f04)['then'](handleEntityNotFound(_0x501fe8,null))[_0xb174('0x17')](respondWithResult(_0x501fe8,null))[_0xb174('0x22')](handleError(_0x501fe8,null));};exports[_0xb174('0x6e')]=function(_0x4eef6a,_0x53b716){return db['ChatWebsite'][_0xb174('0x6e')](_0x4eef6a['body'],{})['then'](function(_0xbd1048){var _0x5f300a=_0x4eef6a['user'][_0xb174('0x2d')]({'plain':!![]});if(!_0x5f300a)throw new Error(_0xb174('0x6f'));if(_0x5f300a[_0xb174('0x70')]===_0xb174('0x71')){var _0x225494=_0xbd1048[_0xb174('0x2d')]({'plain':!![]});var _0x452716=_0xb174('0x2e');return db[_0xb174('0x72')]['find']({'where':{'name':_0x452716,'userProfileId':_0x5f300a['userProfileId']},'raw':!![]})['then'](function(_0x498b63){if(_0x498b63&&_0x498b63['autoAssociation']===0x0){return db[_0xb174('0x2f')][_0xb174('0x6e')]({'name':_0x225494['name'],'resourceId':_0x225494['id'],'type':_0x498b63['name'],'sectionId':_0x498b63['id']},{})[_0xb174('0x17')](function(){return _0xbd1048;});}else{return _0xbd1048;}})[_0xb174('0x22')](function(_0x5ee7fb){logger[_0xb174('0x1e')](_0xb174('0x73'),_0x5ee7fb);throw _0x5ee7fb;});}return _0xbd1048;})[_0xb174('0x17')](respondWithResult(_0x53b716,0xc9))[_0xb174('0x22')](handleError(_0x53b716,null));};exports['update']=function(_0x215c0d,_0x5f56c9){if(_0x215c0d[_0xb174('0x74')]['id']){delete _0x215c0d[_0xb174('0x74')]['id'];}return db['ChatWebsite'][_0xb174('0x6d')]({'where':{'id':_0x215c0d['params']['id']},'include':[{'model':db[_0xb174('0x6b')],'as':_0xb174('0x75')}]})[_0xb174('0x17')](handleEntityNotFound(_0x5f56c9,null))['then'](saveUpdates(_0x215c0d['body'],null))[_0xb174('0x17')](respondWithResult(_0x5f56c9,null))[_0xb174('0x22')](handleError(_0x5f56c9,null));};exports[_0xb174('0x30')]=function(_0x4f8092,_0x5872dd){return db[_0xb174('0x54')][_0xb174('0x6d')]({'where':{'id':_0x4f8092[_0xb174('0x6a')]['id']}})[_0xb174('0x17')](handleEntityNotFound(_0x5872dd,null))[_0xb174('0x17')](removeEntity(_0x5872dd,null))['catch'](handleError(_0x5872dd,null));};exports[_0xb174('0x76')]=function(_0x31fcbf,_0x3f5d88){return db[_0xb174('0x54')][_0xb174('0x76')]()['then'](respondWithResult(_0x3f5d88,null))[_0xb174('0x22')](handleError(_0x3f5d88,null));};exports[_0xb174('0x77')]=function(_0x521764,_0x564e98){if(_0x521764[_0xb174('0x74')]['id']){delete _0x521764['body']['id'];}return db[_0xb174('0x54')][_0xb174('0x6d')]({'where':{'id':_0x521764['params']['id']}})['then'](handleEntityNotFound(_0x564e98,null))['then'](function(_0xee3880){if(_0xee3880){_0x521764[_0xb174('0x74')][_0xb174('0x78')]=_0xee3880['id'];return db[_0xb174('0x79')][_0xb174('0x6e')](_0x521764[_0xb174('0x74')]);}})[_0xb174('0x17')](respondWithResult(_0x564e98,null))[_0xb174('0x22')](handleError(_0x564e98,null));};exports[_0xb174('0x7a')]=function(_0x3b2259,_0x155320){var _0x10c7cc={'raw':![],'where':{}};var _0x43f0b8={};var _0x1710fd={'count':0x0,'rows':[]};return db[_0xb174('0x54')][_0xb174('0x7b')]({'where':{'id':_0x3b2259[_0xb174('0x6a')]['id']}})[_0xb174('0x17')](handleEntityNotFound(_0x155320,null))[_0xb174('0x17')](function(_0x365598){if(_0x365598){_0x43f0b8[_0xb174('0x5b')]=_['keys'](db[_0xb174('0x79')][_0xb174('0x55')]);_0x43f0b8[_0xb174('0x58')]=_['keys'](_0x3b2259[_0xb174('0x58')]);_0x43f0b8['filters']=_[_0xb174('0x5a')](_0x43f0b8['model'],_0x43f0b8[_0xb174('0x58')]);_0x10c7cc[_0xb174('0x5c')]=_[_0xb174('0x5a')](_0x43f0b8[_0xb174('0x5b')],qs[_0xb174('0x5d')](_0x3b2259[_0xb174('0x58')]['fields']));_0x10c7cc[_0xb174('0x5c')]=_0x10c7cc[_0xb174('0x5c')][_0xb174('0x5e')]?_0x10c7cc[_0xb174('0x5c')]:_0x43f0b8['model'];if(!_0x3b2259['query'][_0xb174('0x7c')]('nolimit')){_0x10c7cc['limit']=qs[_0xb174('0x2a')](_0x3b2259[_0xb174('0x58')][_0xb174('0x2a')]);_0x10c7cc['offset']=qs[_0xb174('0x27')](_0x3b2259[_0xb174('0x58')][_0xb174('0x27')]);}_0x10c7cc[_0xb174('0x60')]=qs[_0xb174('0x61')](_0x3b2259[_0xb174('0x58')][_0xb174('0x61')]);_0x10c7cc[_0xb174('0x62')]=qs['filters'](_[_0xb174('0x7d')](_0x3b2259[_0xb174('0x58')],_0x43f0b8[_0xb174('0x7e')]));_0x10c7cc['where']['ChatWebsiteId']=_0x365598['id'];if(_0x3b2259['query']['filter']){_0x10c7cc[_0xb174('0x62')]=_['merge'](_0x10c7cc['where'],{'$or':_[_0xb174('0x41')](_0x10c7cc[_0xb174('0x5c')],function(_0x43c979){var _0x4ed5bd={};_0x4ed5bd[_0x43c979]={'$like':'%'+_0x3b2259[_0xb174('0x58')][_0xb174('0x63')]+'%'};return _0x4ed5bd;})});}_0x10c7cc=_[_0xb174('0x64')]({},_0x10c7cc,_0x3b2259['options']);return db[_0xb174('0x79')]['count']({'where':_0x10c7cc[_0xb174('0x62')]})['then'](function(_0x3b2838){_0x1710fd[_0xb174('0x29')]=_0x3b2838;if(_0x3b2259['query'][_0xb174('0x66')]){_0x10c7cc[_0xb174('0x67')]=[{'all':!![]}];}return db[_0xb174('0x79')]['findAll'](_0x10c7cc);})[_0xb174('0x17')](function(_0x30f170){_0x1710fd[_0xb174('0x7f')]=_0x30f170;return _0x1710fd;});}})[_0xb174('0x17')](respondWithFilteredResult(_0x155320,_0x10c7cc))[_0xb174('0x22')](handleError(_0x155320,null));};exports[_0xb174('0x80')]=function(_0x1e58d4,_0x5e47e9){return db['ChatWebsite'][_0xb174('0x6d')]({'where':{'id':_0x1e58d4[_0xb174('0x6a')]['id']}})[_0xb174('0x17')](handleEntityNotFound(_0x5e47e9,null))[_0xb174('0x17')](function(_0x6f753e){if(_0x6f753e){return _0x6f753e[_0xb174('0x80')](_0x1e58d4[_0xb174('0x58')][_0xb174('0x81')]);}})[_0xb174('0x17')](respondWithStatusCode(_0x5e47e9,null))[_0xb174('0x22')](handleError(_0x5e47e9,null));};exports[_0xb174('0x82')]=function(_0x140ada,_0x45e3ce){if(_0x140ada[_0xb174('0x74')]['id']){delete _0x140ada[_0xb174('0x74')]['id'];}return db[_0xb174('0x54')][_0xb174('0x6d')]({'where':{'id':_0x140ada[_0xb174('0x6a')]['id']}})[_0xb174('0x17')](handleEntityNotFound(_0x45e3ce,null))['then'](function(_0x563c9e){if(_0x563c9e){_0x140ada[_0xb174('0x74')]['ChatWebsiteId']=_0x563c9e['id'];return db[_0xb174('0x83')]['create'](_0x140ada[_0xb174('0x74')]);}})[_0xb174('0x17')](respondWithResult(_0x45e3ce,null))[_0xb174('0x22')](handleError(_0x45e3ce,null));};exports[_0xb174('0x84')]=function(_0x5baeba,_0x27629f){var _0x1a38b1={'raw':![],'where':{}};var _0x30eeba={};var _0x444721={'count':0x0,'rows':[]};return db[_0xb174('0x54')][_0xb174('0x7b')]({'where':{'id':_0x5baeba[_0xb174('0x6a')]['id']}})['then'](handleEntityNotFound(_0x27629f,null))[_0xb174('0x17')](function(_0x27d274){if(_0x27d274){_0x30eeba[_0xb174('0x5b')]=_[_0xb174('0x59')](db['CannedAnswer'][_0xb174('0x55')]);_0x30eeba[_0xb174('0x58')]=_[_0xb174('0x59')](_0x5baeba[_0xb174('0x58')]);_0x30eeba[_0xb174('0x7e')]=_[_0xb174('0x5a')](_0x30eeba[_0xb174('0x5b')],_0x30eeba[_0xb174('0x58')]);_0x1a38b1[_0xb174('0x5c')]=_[_0xb174('0x5a')](_0x30eeba['model'],qs['fields'](_0x5baeba[_0xb174('0x58')][_0xb174('0x5d')]));_0x1a38b1[_0xb174('0x5c')]=_0x1a38b1[_0xb174('0x5c')][_0xb174('0x5e')]?_0x1a38b1[_0xb174('0x5c')]:_0x30eeba['model'];if(!_0x5baeba['query'][_0xb174('0x7c')]('nolimit')){_0x1a38b1[_0xb174('0x2a')]=qs[_0xb174('0x2a')](_0x5baeba[_0xb174('0x58')][_0xb174('0x2a')]);_0x1a38b1[_0xb174('0x27')]=qs[_0xb174('0x27')](_0x5baeba[_0xb174('0x58')][_0xb174('0x27')]);}_0x1a38b1[_0xb174('0x60')]=qs['sort'](_0x5baeba[_0xb174('0x58')]['sort']);_0x1a38b1[_0xb174('0x62')]=qs[_0xb174('0x7e')](_[_0xb174('0x7d')](_0x5baeba[_0xb174('0x58')],_0x30eeba[_0xb174('0x7e')]));_0x1a38b1[_0xb174('0x62')][_0xb174('0x78')]=_0x27d274['id'];if(_0x5baeba['query'][_0xb174('0x63')]){_0x1a38b1[_0xb174('0x62')]=_[_0xb174('0x64')](_0x1a38b1[_0xb174('0x62')],{'$or':_[_0xb174('0x41')](_0x1a38b1[_0xb174('0x5c')],function(_0x3359fb){var _0x46ce71={};_0x46ce71[_0x3359fb]={'$like':'%'+_0x5baeba[_0xb174('0x58')][_0xb174('0x63')]+'%'};return _0x46ce71;})});}_0x1a38b1=_['merge']({},_0x1a38b1,_0x5baeba[_0xb174('0x6c')]);return db[_0xb174('0x83')][_0xb174('0x29')]({'where':_0x1a38b1['where']})[_0xb174('0x17')](function(_0x485ca0){_0x444721[_0xb174('0x29')]=_0x485ca0;if(_0x5baeba[_0xb174('0x58')]['includeAll']){_0x1a38b1[_0xb174('0x67')]=[{'all':!![]}];}return db['CannedAnswer'][_0xb174('0x68')](_0x1a38b1);})[_0xb174('0x17')](function(_0x22b62a){_0x444721[_0xb174('0x7f')]=_0x22b62a;return _0x444721;});}})[_0xb174('0x17')](respondWithFilteredResult(_0x27629f,_0x1a38b1))[_0xb174('0x22')](handleError(_0x27629f,null));};exports['removeAnswers']=function(_0x4c35e0,_0x246a3f){return db[_0xb174('0x54')][_0xb174('0x6d')]({'where':{'id':_0x4c35e0[_0xb174('0x6a')]['id']}})[_0xb174('0x17')](handleEntityNotFound(_0x246a3f,null))[_0xb174('0x17')](function(_0x52d11b){if(_0x52d11b){return _0x52d11b[_0xb174('0x85')](_0x4c35e0[_0xb174('0x58')][_0xb174('0x81')]);}})[_0xb174('0x17')](respondWithStatusCode(_0x246a3f,null))['catch'](handleError(_0x246a3f,null));};exports[_0xb174('0x86')]=function(_0x365cef,_0x40b5b9){_0x365cef[_0xb174('0x74')][_0xb174('0x87')]=_0x365cef[_0xb174('0x88')][_0xb174('0x89')];return db[_0xb174('0x54')][_0xb174('0x6d')]({'where':{'id':_0x365cef['params']['id']}})[_0xb174('0x17')](handleEntityNotFound(_0x40b5b9,null))[_0xb174('0x17')](saveUpdates(_0x365cef[_0xb174('0x74')],null))[_0xb174('0x17')](respondWithResult(_0x40b5b9,null))[_0xb174('0x22')](handleError(_0x40b5b9,null));};exports[_0xb174('0x8a')]=function(_0x2d3026,_0x2d22c3){_0x2d3026[_0xb174('0x74')]['agentAvatar']=_0x2d3026['file'][_0xb174('0x89')];return db[_0xb174('0x54')][_0xb174('0x6d')]({'where':{'id':_0x2d3026['params']['id']}})[_0xb174('0x17')](handleEntityNotFound(_0x2d22c3,null))['then'](saveUpdates(_0x2d3026['body'],null))[_0xb174('0x17')](respondWithResult(_0x2d22c3,null))[_0xb174('0x22')](handleError(_0x2d22c3,null));};exports['addCustomerAvatar']=function(_0x20ed98,_0x4aafd6){_0x20ed98[_0xb174('0x74')][_0xb174('0x8b')]=_0x20ed98[_0xb174('0x88')][_0xb174('0x89')];return db[_0xb174('0x54')]['find']({'where':{'id':_0x20ed98[_0xb174('0x6a')]['id']}})[_0xb174('0x17')](handleEntityNotFound(_0x4aafd6,null))[_0xb174('0x17')](saveUpdates(_0x20ed98[_0xb174('0x74')],null))[_0xb174('0x17')](respondWithResult(_0x4aafd6,null))[_0xb174('0x22')](handleError(_0x4aafd6,null));};exports['addSystemAvatar']=function(_0x3f0266,_0x39184c){_0x3f0266[_0xb174('0x74')]['systemAvatar']=_0x3f0266[_0xb174('0x88')][_0xb174('0x89')];return db['ChatWebsite']['find']({'where':{'id':_0x3f0266['params']['id']}})['then'](handleEntityNotFound(_0x39184c,null))[_0xb174('0x17')](saveUpdates(_0x3f0266[_0xb174('0x74')],null))[_0xb174('0x17')](respondWithResult(_0x39184c,null))[_0xb174('0x22')](handleError(_0x39184c,null));};exports[_0xb174('0x8c')]=function(_0x34b2bf,_0x540ddc){var _0x4c88cf=path[_0xb174('0x8d')](config[_0xb174('0x8e')],_0xb174('0x8f'));var _0x497d28={'where':{'id':_0x34b2bf[_0xb174('0x6a')]['id']},'attributes':['id',_0xb174('0x87')],'raw':!![]};var _0x1f9734=![];return require(_0xb174('0x90'))['getLicense']()[_0xb174('0x17')](function(_0x19cd0d){if(_0x19cd0d){_0x1f9734=_0x19cd0d['custom'];}})[_0xb174('0x17')](function(){return db['ChatWebsite'][_0xb174('0x6d')](_0x497d28);})['then'](handleEntityNotFound(_0x540ddc,null))['then'](function(_0x2899c1){if(_0x2899c1){if(!_['isNil'](_0x2899c1['sitepic'])){if(fs[_0xb174('0x91')](path[_0xb174('0x8d')](config['root'],_0xb174('0x92'),_0x2899c1[_0xb174('0x87')]))&&_0x1f9734){_0x4c88cf=path[_0xb174('0x8d')](config[_0xb174('0x8e')],_0xb174('0x92'),_0x2899c1[_0xb174('0x87')]);}}return _0x540ddc[_0xb174('0x93')](_0x4c88cf);}})[_0xb174('0x22')](handleError(_0x540ddc,null));};exports[_0xb174('0x94')]=function(_0x58c882,_0x25f916){var _0x199b59=path[_0xb174('0x8d')](config['root'],_0xb174('0x95'));var _0x46b7f6={'where':{'id':_0x58c882['params']['id']},'attributes':['id','agentAvatar'],'raw':!![]};return db[_0xb174('0x54')][_0xb174('0x6d')](_0x46b7f6)[_0xb174('0x17')](handleEntityNotFound(_0x25f916,null))[_0xb174('0x17')](function(_0x521325){if(_0x521325){if(!_[_0xb174('0x96')](_0x521325['agentAvatar'])){if(fs[_0xb174('0x91')](path['join'](config[_0xb174('0x8e')],_0xb174('0x97'),_0x521325[_0xb174('0x98')]))){_0x199b59=path[_0xb174('0x8d')](config[_0xb174('0x8e')],_0xb174('0x97'),_0x521325[_0xb174('0x98')]);}}return _0x25f916[_0xb174('0x93')](_0x199b59);}})[_0xb174('0x22')](handleError(_0x25f916,null));};exports['getCustomerAvatar']=function(_0xdca5a6,_0x2412d4){var _0x2b38dd=path[_0xb174('0x8d')](config[_0xb174('0x8e')],_0xb174('0x99'));var _0x350b27={'where':{'id':_0xdca5a6['params']['id']},'attributes':['id',_0xb174('0x8b'),'showCustomerAvatar'],'raw':!![]};return db[_0xb174('0x54')][_0xb174('0x6d')](_0x350b27)[_0xb174('0x17')](handleEntityNotFound(_0x2412d4,null))['then'](function(_0x26dc29){if(_0x26dc29){if(!_[_0xb174('0x96')](_0x26dc29[_0xb174('0x8b')])){if(fs[_0xb174('0x91')](path[_0xb174('0x8d')](config['root'],_0xb174('0x97'),_0x26dc29['customerAvatar']))&&_0x26dc29['showCustomerAvatar']){_0x2b38dd=path[_0xb174('0x8d')](config['root'],'server/files/images/avatars/',_0x26dc29['customerAvatar']);}}return _0x2412d4['download'](_0x2b38dd);}})['catch'](handleError(_0x2412d4,null));};exports[_0xb174('0x9a')]=function(_0x1e8fa1,_0x40635e){var _0xb75d80=path['join'](config[_0xb174('0x8e')],_0xb174('0x9b'));var _0x2b9107={'where':{'id':_0x1e8fa1['params']['id']},'attributes':['id','systemAvatar'],'raw':!![]};return db[_0xb174('0x54')][_0xb174('0x6d')](_0x2b9107)[_0xb174('0x17')](handleEntityNotFound(_0x40635e,null))[_0xb174('0x17')](function(_0x34bcb1){if(_0x34bcb1){if(!_['isNil'](_0x34bcb1[_0xb174('0x9c')])){if(fs[_0xb174('0x91')](path[_0xb174('0x8d')](config[_0xb174('0x8e')],_0xb174('0x97'),_0x34bcb1['systemAvatar']))){_0xb75d80=path[_0xb174('0x8d')](config[_0xb174('0x8e')],_0xb174('0x97'),_0x34bcb1[_0xb174('0x9c')]);}}return _0x40635e[_0xb174('0x93')](_0xb75d80);}})[_0xb174('0x22')](handleError(_0x40635e,null));};exports['notify']=function(_0x2d1164,_0x36a0d7){var _0x4ebfdf={'body':_0x2d1164[_0xb174('0x74')],'channel':'chat'};var _0x5345a0=[];var _0x3fd55b=[];var _0x548cda={};var _0x40f2f6=![];return db['CmContact'][_0xb174('0x76')]()[_0xb174('0x17')](function(_0x2b4c1f){if(!_0x2b4c1f){throw new db[(_0xb174('0x9d'))][(_0xb174('0x9e'))](_0xb174('0x9f'));}_0x5345a0=_[_0xb174('0xa0')](_[_0xb174('0x59')](_0x2b4c1f),[_0xb174('0xa1'),_0xb174('0xa2')]);_0x3fd55b=_[_0xb174('0xa0')](_[_0xb174('0x59')](_0x2b4c1f),[_0xb174('0xa1'),_0xb174('0xa2'),_0xb174('0xa3'),'ListId']);if(_0x2d1164[_0xb174('0x74')]['id']){delete _0x2d1164['body']['id'];}if(_[_0xb174('0x96')](_0x2d1164[_0xb174('0x74')][_0xb174('0xa4')])){throw new db[(_0xb174('0x9d'))][(_0xb174('0x9e'))]('from\x20is\x20mandatory');}if(_[_0xb174('0x96')](_0x2d1164[_0xb174('0x74')]['body'])||_0x2d1164[_0xb174('0x74')][_0xb174('0x74')]===''){throw new db[(_0xb174('0x9d'))][(_0xb174('0x9e'))](_0xb174('0xa5'));}if(_[_0xb174('0x96')](_0x2d1164[_0xb174('0x74')][_0xb174('0xa6')])){throw new db['Sequelize']['ValidationError'](_0xb174('0xa7')+_0x3fd55b);}if(!_[_0xb174('0xa8')](_0x3fd55b,_0x2d1164['body']['mapKey'])){throw new db[(_0xb174('0x9d'))][(_0xb174('0x9e'))](_0xb174('0xa9')+_0x3fd55b);}_0x548cda[_0x2d1164[_0xb174('0x74')]['mapKey']]=_0x2d1164['body']['from'];})[_0xb174('0x17')](function(){return db[_0xb174('0x54')][_0xb174('0x6d')]({'where':{'id':_0x2d1164[_0xb174('0x6a')]['id']},'include':[{'model':db[_0xb174('0xaa')],'as':'List','include':[{'model':db[_0xb174('0xab')],'as':_0xb174('0xac'),'where':_0x548cda,'limit':0x1,'order':[[_0xb174('0xa2'),'DESC']]}]},{'model':db[_0xb174('0xad')],'as':_0xb174('0xae')},{'model':db[_0xb174('0x42')],'as':_0xb174('0x42'),'include':[{'model':db[_0xb174('0x42')],'as':'Intervals','attributes':['id','interval'],'raw':!![]}]}]});})[_0xb174('0x17')](function(_0x13d415){if(!_0x13d415)throw new APINotFoundError(util[_0xb174('0x37')](_0xb174('0xaf'),_0x2d1164['params']['id']));if(!_0x13d415['Interval']||!_0x13d415[_0xb174('0x42')][_0xb174('0x43')])return[_0x13d415,!![]];return[_0x13d415,checkWebsiteIntervals(_0x13d415)];})['spread'](function(_0x129e8d,_0x487ac8){if(!_0x487ac8)throw new APIOutOfIntervalError();if(!_0x129e8d['List'])return;_0x4ebfdf[_0xb174('0xb0')]=_0x129e8d;_0x4ebfdf[_0xb174('0xb1')]=_0x129e8d[_0xb174('0xb2')];_0x4ebfdf[_0xb174('0xb3')]=_[_0xb174('0xb4')](_0x129e8d[_0xb174('0xae')],[_0xb174('0xb5')],[_0xb174('0xb6')]);if(_0x4ebfdf['account'][_0xb174('0xae')]){delete _0x4ebfdf[_0xb174('0xb0')][_0xb174('0xae')];}if(_0x4ebfdf['account'][_0xb174('0xb2')]&&_0x4ebfdf[_0xb174('0xb0')][_0xb174('0xb2')]['Contacts'][_0xb174('0x5e')]){return _0x4ebfdf[_0xb174('0xb0')][_0xb174('0xb2')][_0xb174('0xac')][0x0];}var _0x3780ec=_['defaults'](_0x2d1164[_0xb174('0x74')],{'firstName':_0x2d1164[_0xb174('0x74')]['from'],'ListId':_0x129e8d[_0xb174('0xb7')]});_0x3780ec[_0x2d1164[_0xb174('0x74')][_0xb174('0xa6')]]=_0x2d1164[_0xb174('0x74')][_0xb174('0xa4')];return db['CmContact'][_0xb174('0x6e')](_0x3780ec,{'fields':_0x5345a0,'raw':!![]});})[_0xb174('0x17')](function(_0x552fe5){_0x4ebfdf[_0xb174('0xb8')]=_0x552fe5;var _0x411924=createInteractionObject(_0x2d1164['params']['id'],_0x2d1164['body'],_0x2d1164[_0xb174('0xb9')],_0x552fe5);var _0x1c5f39={'ChatWebsiteId':_0x2d1164[_0xb174('0x6a')]['id'],'closed':![]};if(_0x2d1164['body'][_0xb174('0xba')]){_0x1c5f39[_0xb174('0xba')]=_0x2d1164[_0xb174('0x74')]['threadId'];return db[_0xb174('0xbb')][_0xb174('0x6d')]({'where':_0x1c5f39})[_0xb174('0x17')](function(_0x1fc9e3){if(_0x1fc9e3){_0x40f2f6=!![];return _0x1fc9e3;}_0x411924['threadId']=_0x2d1164[_0xb174('0x74')]['threadId'];_0x411924[_0xb174('0xbc')]=_0x2d1164[_0xb174('0x74')][_0xb174('0xbc')];return db['ChatInteraction'][_0xb174('0x6e')](_0x411924);});}_0x1c5f39[_0xb174('0xbd')]=_0x552fe5['id'];if(_0x2d1164['body']['interaction']&&_0x2d1164[_0xb174('0x74')][_0xb174('0xbe')]['id']){_0x1c5f39['id']=_0x2d1164[_0xb174('0x74')][_0xb174('0xbe')]['id'];return db[_0xb174('0xbb')][_0xb174('0x6d')]({'where':_0x1c5f39})[_0xb174('0x17')](function(_0x48b091){if(_0x48b091){_0x40f2f6=!![];return _0x48b091;}return db[_0xb174('0xbb')][_0xb174('0x6e')](_0x411924);});}return db[_0xb174('0xbb')][_0xb174('0x6e')](_0x411924);})['then'](function(_0x2f6b63){if(!_0x40f2f6)return _0x2f6b63;var _0x26db50={'from':(_0x4ebfdf[_0xb174('0xb8')]['firstName']||'')+'\x20'+(_0x4ebfdf['contact'][_0xb174('0xbf')]||'')};if(_0x2d1164['body']['threadId']&&_0x2d1164[_0xb174('0x74')][_0xb174('0xc0')]&&_0x2d1164[_0xb174('0x74')][_0xb174('0xba')]!=_0x2d1164[_0xb174('0x74')][_0xb174('0xc0')]){_0x26db50['threadId']=_0x2d1164[_0xb174('0x74')][_0xb174('0xc0')];}return _0x2f6b63[_0xb174('0x2c')](_0x26db50);})[_0xb174('0x17')](function(_0x3df4e7){_0x4ebfdf[_0xb174('0xbe')]=_0x3df4e7['get']({'plain':!![]});_0x4ebfdf['interaction']['created']=!_0x40f2f6;if(_0x4ebfdf['interaction']['created']){if(_0x4ebfdf[_0xb174('0xb0')][_0xb174('0xc1')]){_0x4ebfdf[_0xb174('0xb3')][_0xb174('0xc2')]({'id':0x0,'priority':_0x4ebfdf[_0xb174('0xb3')]['length']+0x1,'app':_0xb174('0xc3'),'appdata':_0xb174('0xc4'),'interval':_0xb174('0xc5')});}}return db[_0xb174('0xc6')][_0xb174('0x6e')]({'body':_0x2d1164['body'][_0xb174('0x74')],'ChatWebsiteId':_0x2d1164[_0xb174('0x6a')]['id'],'ChatInteractionId':_0x3df4e7['id'],'direction':'in','ContactId':_0x4ebfdf['contact']['id'],'AttachmentId':_0x2d1164[_0xb174('0x74')]['AttachmentId']});})[_0xb174('0x17')](function(_0xf730dc){_0x4ebfdf['message']=_0xf730dc;if(!_0x4ebfdf[_0xb174('0xbe')][_0xb174('0xc7')]){return;}return db[_0xb174('0xc8')]['find']({'attributes':['id',_0xb174('0x32')],'where':{'id':_0x4ebfdf[_0xb174('0xbe')]['UserId']}});})[_0xb174('0x17')](function(_0x524f62){if(_0x524f62){_0x4ebfdf['applications'][_0xb174('0xc9')]({'id':0x0,'priority':0x0,'app':_0xb174('0xca'),'appdata':_0x524f62[_0xb174('0x32')]+','+(_0x4ebfdf[_0xb174('0xb0')]['waitForTheAssignedAgent']||0xa),'interval':_0xb174('0xc5')});_0x4ebfdf[_0xb174('0xcb')]=!![];}if(!_0x4ebfdf['interaction']['queueId']){return;}return db[_0xb174('0xcc')][_0xb174('0x6d')]({'attributes':['id',_0xb174('0x32')],'where':{'id':_0x4ebfdf[_0xb174('0xbe')][_0xb174('0xcd')]}});})[_0xb174('0x17')](function(_0x4a5ffe){if(_0x4a5ffe){_0x4ebfdf[_0xb174('0xb3')]['unshift']({'id':0x0,'priority':0x1,'app':'queue','appdata':_0x4a5ffe['name']+','+(_0x4ebfdf[_0xb174('0xb0')]['waitForTheAssignedQueue']||0x12c),'interval':_0xb174('0xc5')});}return respondWithRpcPromise(_0xb174('0xce'),_0xb174('0xcf'),_0x4ebfdf);})['then'](function(_0x2bb6){respondWithRpcPromise(_0xb174('0xd0'),_0xb174('0xd0'),{'event':_0xb174('0xd1'),'message':_0x2bb6},client9002);return _0x2bb6;})['then'](respondWithResult(_0x36a0d7,null))[_0xb174('0x22')](APIHandleError(_0x36a0d7));};exports[_0xb174('0xd2')]=function(_0x2ad319,_0x3a4105){var _0x33f961,_0x52dc05,_0x24cc14;var _0x178175=[];var _0x1c79c8={};var _0x3ed7f3=_0x2ad319['files']||[];var _0x29e3b8=[];var _0x1c1cee;return db[_0xb174('0xab')]['describe']()[_0xb174('0x17')](function(_0x6517f){if(!_0x6517f){throw new db[(_0xb174('0x9d'))][(_0xb174('0x9e'))](_0xb174('0x9f'));}_0x178175=_[_0xb174('0xa0')](_[_0xb174('0x59')](_0x6517f),[_0xb174('0xa1'),_0xb174('0xa2'),_0xb174('0xa3'),_0xb174('0xb7')]);if(_0x2ad319[_0xb174('0x74')]['id']){delete _0x2ad319['body']['id'];}if(_['isNil'](_0x2ad319[_0xb174('0x74')][_0xb174('0xa4')])){throw _0x3a4105['status'](0x1f4)[_0xb174('0x33')](new db[(_0xb174('0x9d'))][(_0xb174('0x9e'))](_0xb174('0xd3')));}if(_[_0xb174('0x96')](_0x2ad319['body'][_0xb174('0x74')])||_0x2ad319[_0xb174('0x74')][_0xb174('0x74')]===''){throw _0x3a4105[_0xb174('0x24')](0x1f4)[_0xb174('0x33')](new db[(_0xb174('0x9d'))]['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty'));}if(_[_0xb174('0x96')](_0x2ad319[_0xb174('0x74')]['mapKeyOffline'])){throw _0x3a4105[_0xb174('0x24')](0x1f4)[_0xb174('0x33')](new db[(_0xb174('0x9d'))][(_0xb174('0x9e'))](_0xb174('0xd4')+_0x178175));}if(!_[_0xb174('0xa8')](_0x178175,_0x2ad319[_0xb174('0x74')][_0xb174('0xd5')])){throw _0x3a4105[_0xb174('0x24')](0x1f4)[_0xb174('0x33')](new db['Sequelize'][(_0xb174('0x9e'))](_0xb174('0xd6')+_0x178175));}_0x1c79c8[_0x2ad319[_0xb174('0x74')][_0xb174('0xd5')]]=_0x2ad319['body']['from'];})[_0xb174('0x17')](function(){return db[_0xb174('0x54')][_0xb174('0x6d')]({'where':{'id':_0x2ad319[_0xb174('0x6a')]['id']},'include':[{'model':db[_0xb174('0xaa')],'as':'List'},{'model':db['MailAccount'],'as':'MailAccount'}]});})[_0xb174('0x17')](handleEntityNotFound(_0x3a4105,null))[_0xb174('0x17')](function(_0x10c55e){if(_0x10c55e&&_0x10c55e[_0xb174('0xb2')]){_0x52dc05=_0x10c55e;var _0x3e0285=_[_0xb174('0xd7')](_0x2ad319[_0xb174('0x74')],{'firstName':_0x2ad319[_0xb174('0x74')][_0xb174('0xa4')],'phone':_0x2ad319[_0xb174('0x74')][_0xb174('0xa4')],'ListId':_0x10c55e[_0xb174('0xb7')]});_0x3e0285[_0x2ad319[_0xb174('0x74')][_0xb174('0xd5')]]=_0x2ad319['body'][_0xb174('0xa4')];return db['CmContact'][_0xb174('0xd8')]({'where':_0x1c79c8,'defaults':_0x3e0285});}})[_0xb174('0xd9')](function(_0x204d85){if(_0x204d85){_0x24cc14=_0x204d85;var _0x3a26cb=fs['readFileSync'](path[_0xb174('0x8d')](config[_0xb174('0x8e')],_0xb174('0xda')),'utf8');var _0x4188d2=ejs['render'](_0x3a26cb,{'body':_[_0xb174('0xdb')](_0x2ad319['body'][_0xb174('0x74')]),'bodyTitle':_0x52dc05['offlineMessageBody']});return db[_0xb174('0xdc')][_0xb174('0x6e')]({'body':_0x4188d2,'plainBody':htmlToText[_0xb174('0xdd')](_0x4188d2),'ContactId':_0x204d85['id'],'ChatWebsiteId':_0x52dc05['id']});}})[_0xb174('0x17')](function(_0x4479b3){_0x1c1cee=_0x4479b3;if(_0x3ed7f3[_0xb174('0x5e')]){var _0x348e14=_0x3ed7f3[_0xb174('0x41')](function(_0x405087){return{'name':_0x405087[_0xb174('0xde')],'basename':_0x405087['filename'],'type':_0x405087['mimetype'],'ChatOfflineMessageId':_0x4479b3['id']};});_0x29e3b8=_0x348e14[_0xb174('0x41')](_0x577e0c=>{var _0x2cf12f={'filename':_0x577e0c[_0xb174('0x32')],'path':path['join'](config[_0xb174('0x8e')],_0xb174('0xdf'),_0xb174('0xe0'),'attachments',_0xb174('0xe1'),_0x577e0c[_0xb174('0xe2')])};return _0x2cf12f;});if(!_0x52dc05[_0xb174('0xe3')]){return db[_0xb174('0xe4')]['transaction'](function(_0x2dd427){return db[_0xb174('0xe5')]['bulkCreate'](_0x348e14,{'transaction':_0x2dd427});});}}})[_0xb174('0x17')](function(){if(_0x1c1cee){_0x33f961=_0x1c1cee;return db[_0xb174('0xe6')]['findOne']({'where':{'service':!![]},'include':[{'model':db[_0xb174('0xe7')],'as':'Smtp','raw':!![],'include':[{'model':db['CloudProvider'],'as':_0xb174('0xe8'),'raw':!![]}]}]});}})[_0xb174('0x17')](function(_0x4c9499){if(_0x4c9499&&_0x4c9499[_0xb174('0xe9')]&&_0x52dc05['forwardOffline']&&_0x52dc05[_0xb174('0xea')]){var _0x514804=_0x4c9499['getSmtpOptions']();return respondWithRpcPromise('SendMail','sendMail',{'account':_0x514804,'message':{'from':util[_0xb174('0x37')](_0xb174('0xeb'),_0x4c9499[_0xb174('0x32')],_0x4c9499[_0xb174('0xec')]||_0x4c9499[_0xb174('0xe9')][_0xb174('0x71')]),'to':_0x52dc05[_0xb174('0xea')],'subject':_0x52dc05[_0xb174('0xed')],'html':_0x33f961[_0xb174('0x74')],'attachments':_0x29e3b8}},client9003)[_0xb174('0x17')](function(){return _0x33f961;})[_0xb174('0x22')](function(_0x3c849e){logger['error'](_0x3c849e);});}})[_0xb174('0x17')](function(){if(_0x52dc05&&_0x52dc05[_0xb174('0xe3')]&&_0x52dc05['MailAccountId']){var _0x1d0952=[];if(_0x3ed7f3[_0xb174('0x5e')]){_0x1d0952=_0x3ed7f3[_0xb174('0x41')](function(_0x3cf226){return{'name':_0x3cf226[_0xb174('0xde')],'basename':_0x3cf226[_0xb174('0x89')],'type':_0x3cf226[_0xb174('0xee')],'ChatOfflineMessageId':_0x1c1cee['id']};});}var _0x4f977f;if(!_[_0xb174('0x96')](_0x52dc05[_0xb174('0xef')])){var _0x3c8d6a=_['map'](_0x2ad319[_0xb174('0x74')],function(_0x258706){return _0x258706;});var _0x1178ce=_[_0xb174('0xf0')](_0x3c8d6a)[0x0];var _0x230bd6=_[_0xb174('0xf1')](_0x1178ce,function(_0x2e3a55){return _0x2e3a55;});_0x4f977f=_0x230bd6[0x1][_0x52dc05[_0xb174('0xef')]];}var _0x5495ce={'from':_0x24cc14[_0xb174('0xec')],'firstName':_0x24cc14[_0xb174('0xf2')],'lastName':_0x24cc14[_0xb174('0xbf')],'mapKey':_0xb174('0xec'),'message':{'from':_0x24cc14[_0xb174('0xec')],'to':_0x52dc05['MailAccount'][_0xb174('0xec')],'cc':'','subject':_['isNil'](_0x4f977f)?_0x52dc05[_0xb174('0xed')]:_0x4f977f,'messageId':'','sentAt':new Date(),'attach':_0x1d0952[_0xb174('0x5e')],'attachments':_0x1d0952,'originChannel':_0xb174('0xf3'),'ChatWebsiteId':_0x52dc05['id'],'ChatOfflineMessageId':_0x33f961['id'],'originTo':_0x52dc05[_0xb174('0xe6')][_0xb174('0xec')]},'body':_0x33f961[_0xb174('0x74')]};var _0xb7bed1={'account':{'id':_0x52dc05[_0xb174('0xf4')]},'body':_0x5495ce,'log':_0xb174('0xf5')};return respondWithRpcPromise('NotifyMailAccount','notifyMail',_0xb7bed1,client9001)[_0xb174('0x17')](function(){return _0x33f961;})[_0xb174('0x22')](function(_0x7f3c12){logger['error'](_0x7f3c12);});}return;})[_0xb174('0x17')](function(){if(_0x33f961){return _0x33f961;}})[_0xb174('0x17')](respondWithResult(_0x3a4105,null))['catch'](function(){for(var _0x5d784a of _0x3ed7f3){var _0x19199e=path[_0xb174('0x8d')](config[_0xb174('0x8e')],'server',_0xb174('0xe0'),_0xb174('0xf6'),_0xb174('0xe1'),_0x5d784a[_0xb174('0x89')]);fs_extra[_0xb174('0xf7')](_0x19199e)[_0xb174('0x22')](function(_0x3d063f){logger[_0xb174('0x1e')](_0xb174('0xf8'),_0x19199e,_0x3d063f);});}});};exports['addInteraction']=function(_0xd36835,_0x12bc22){return db[_0xb174('0xbb')][_0xb174('0x6d')]({'where':{'id':_0xd36835[_0xb174('0x6a')]['id']}})[_0xb174('0x17')](handleEntityNotFound(_0x12bc22,null))[_0xb174('0x17')](function(_0x204676){if(_0x204676){return _0x204676['addInteraction'](_0xd36835[_0xb174('0x74')][_0xb174('0x81')],_['omit'](_0xd36835[_0xb174('0x74')],[_0xb174('0x81'),'id'])||{});}})['then'](respondWithResult(_0x12bc22,null))[_0xb174('0x22')](handleError(_0x12bc22,null));};exports[_0xb174('0xf9')]=function(_0x55d95d,_0x21f03a){var _0xf34e68={'raw':![],'where':{}};var _0x3bd124={};var _0x77aa7a={'count':0x0,'rows':[]};return db[_0xb174('0x54')][_0xb174('0x7b')]({'where':{'id':_0x55d95d[_0xb174('0x6a')]['id']}})[_0xb174('0x17')](handleEntityNotFound(_0x21f03a,null))[_0xb174('0x17')](function(_0x11b66d){if(_0x11b66d){_0x3bd124[_0xb174('0x5b')]=_[_0xb174('0x59')](db[_0xb174('0xbb')]['rawAttributes']);_0x3bd124[_0xb174('0x58')]=_[_0xb174('0x59')](_0x55d95d[_0xb174('0x58')]);_0x3bd124[_0xb174('0x7e')]=_[_0xb174('0x5a')](_0x3bd124[_0xb174('0x5b')],_0x3bd124[_0xb174('0x58')]);_0xf34e68['attributes']=_[_0xb174('0x5a')](_0x3bd124['model'],qs[_0xb174('0x5d')](_0x55d95d['query'][_0xb174('0x5d')]));_0xf34e68[_0xb174('0x5c')]=_0xf34e68[_0xb174('0x5c')]['length']?_0xf34e68[_0xb174('0x5c')]:_0x3bd124[_0xb174('0x5b')];if(!_0x55d95d['query'][_0xb174('0x7c')](_0xb174('0x5f'))){_0xf34e68[_0xb174('0x2a')]=qs[_0xb174('0x2a')](_0x55d95d[_0xb174('0x58')][_0xb174('0x2a')]);_0xf34e68[_0xb174('0x27')]=qs[_0xb174('0x27')](_0x55d95d['query']['offset']);}_0xf34e68['order']=qs[_0xb174('0x61')](_0x55d95d[_0xb174('0x58')][_0xb174('0x61')]);_0xf34e68[_0xb174('0x62')]=qs[_0xb174('0x7e')](_['pick'](_0x55d95d[_0xb174('0x58')],_0x3bd124[_0xb174('0x7e')]));_0xf34e68['where'][_0xb174('0x78')]=_0x11b66d['id'];if(_0x55d95d[_0xb174('0x58')][_0xb174('0x63')]){_0xf34e68[_0xb174('0x62')]=_['merge'](_0xf34e68[_0xb174('0x62')],{'$or':_[_0xb174('0x41')](_0xf34e68[_0xb174('0x5c')],function(_0x2a267a){var _0x3c4710={};_0x3c4710[_0x2a267a]={'$like':'%'+_0x55d95d[_0xb174('0x58')][_0xb174('0x63')]+'%'};return _0x3c4710;})});}_0xf34e68=_[_0xb174('0x64')]({},_0xf34e68,_0x55d95d[_0xb174('0x6c')]);return db['ChatInteraction'][_0xb174('0x29')]({'where':_0xf34e68[_0xb174('0x62')]})['then'](function(_0x5988ec){_0x77aa7a[_0xb174('0x29')]=_0x5988ec;if(_0x55d95d['query']['includeAll']){_0xf34e68['include']=[{'model':db[_0xb174('0xab')],'as':'Contact','required':![]},{'model':db[_0xb174('0xc8')],'as':_0xb174('0xfa'),'attributes':['name',_0xb174('0xfb'),_0xb174('0xfc')],'required':![]},{'model':db['Tag'],'as':'Tags','attributes':['id','name','color'],'where':_0x55d95d[_0xb174('0x58')][_0xb174('0xfd')]?{'id':_0x55d95d[_0xb174('0x58')]['tag']}:undefined,'required':_0x55d95d[_0xb174('0x58')]['tag']?!![]:![]}];}return db[_0xb174('0xbb')][_0xb174('0x68')](_0xf34e68);})[_0xb174('0x17')](function(_0xaa8b7a){_0x77aa7a[_0xb174('0x7f')]=_0xaa8b7a;return _0x77aa7a;});}})['then'](respondWithFilteredResult(_0x21f03a,_0xf34e68))['catch'](handleError(_0x21f03a,null));};exports['getSnippet']=function(_0x3fdfd9,_0x26619b){var _0x37da3b=0x0;var _0x237940=0x0;var _0x560a91=![];var _0x1e0c57;var _0x3b6b52;return db['ChatWebsite'][_0xb174('0x6d')]({'where':{'id':_0x3fdfd9[_0xb174('0x6a')]['id']},'include':[{'model':db[_0xb174('0x42')],'as':'Interval','include':[{'model':db[_0xb174('0x42')],'as':'Intervals','attributes':['id',_0xb174('0x39')]}]}]})[_0xb174('0x17')](handleEntityNotFound(_0x26619b,null))[_0xb174('0x17')](function(_0x2d06cd){if(_0x2d06cd){_0x1e0c57=_0x2d06cd;return _0x2d06cd[_0xb174('0xfe')]({'raw':!![]});}})[_0xb174('0x17')](function(_0x5c8151){if(_0x1e0c57){if(_0x5c8151){_0x3b6b52=_0x5c8151;}}return require(_0xb174('0x90'))[_0xb174('0xff')]();})['then'](function(_0x35126f){if(_0x35126f){_0x237940=_0x35126f[_0xb174('0x100')];_0x560a91=_0x35126f[_0xb174('0x101')];}})[_0xb174('0x17')](function(){return db[_0xb174('0xbb')][_0xb174('0x29')]({'where':{'closed':![]}});})[_0xb174('0x17')](function(_0x5394a6){_0x37da3b=_0x5394a6;if(_0x237940&&_0x5394a6>_0x237940){return db['License']['findOne']({'where':{'id':0x1}})[_0xb174('0x17')](function(_0x1ff844){if(_0x1ff844){_0x1ff844[_0xb174('0x102')](_0xb174('0x103'));}});}})[_0xb174('0x17')](function(){if(!_0x1e0c57[_0xb174('0x42')]||!_0x1e0c57[_0xb174('0x42')][_0xb174('0x43')])return!![];return checkWebsiteIntervals(_0x1e0c57);})[_0xb174('0x17')](function(_0x210bfd){var _0x3f3c1f=fs[_0xb174('0x104')](path[_0xb174('0x8d')](config[_0xb174('0x8e')],_0xb174('0x105')),_0xb174('0x106'));var _0x19717d=new url['URL'](_0x1e0c57[_0xb174('0x107')])['origin'];var _0x35f0bc=_0xb174('0x108');var _0x2c552c=![];var _0x1b26bd={'chatVersion':_0x35f0bc,'chatWebsiteAddressOrigin':_0x19717d,'remote':_0x1e0c57[_0xb174('0x109')],'query':querystring[_0xb174('0x1d')](_[_0xb174('0x64')](_0x1e0c57[_0xb174('0x2d')]({'plain':!![]}),{'customerIp':_0x3fdfd9[_0xb174('0xb9')][_0xb174('0x49')]||_0x3fdfd9['headers'][_0xb174('0x10a')]||_0x3fdfd9[_0xb174('0x10b')]['remoteAddress']||_0x3fdfd9['ip'],'referer':_0x3fdfd9[_0xb174('0xb9')][_0xb174('0x4c')],'openedInteractions':_0x37da3b,'maxInteractions':_0x237940,'virtual':_0x560a91[_0xb174('0x100')],'online':_0x210bfd,'custom':_0x560a91}))[_0xb174('0x10c')](/'/g,'\x5c\x27')};_0x26619b[_0xb174('0x33')](ejs[_0xb174('0x10d')](Mustache[_0xb174('0x10d')](_0x3f3c1f,_0x1b26bd),{'proactiveActions':_0x3b6b52,'alignment':_0x1e0c57['alignment'],'verticalAlignment':_0x1e0c57['verticalAlignment'],'div_color':_0x1e0c57[_0xb174('0x10e')],'labelText':_0x1e0c57[_0xb174('0x10f')],'text_color':_0x1e0c57[_0xb174('0x110')],'text_button_color':_0x1e0c57[_0xb174('0x111')],'button_color':_0x1e0c57['color_button'],'background_color':_0x1e0c57[_0xb174('0x112')],'hideWhenOffline':_0x1e0c57['hideWhenOffline'],'intervalId':_0x1e0c57[_0xb174('0x113')],'isDevelopment':_0x2c552c,'chatVersion':_0x35f0bc}));})[_0xb174('0x22')](handleError(_0x26619b,null));};exports[_0xb174('0x114')]=function(_0x2e9bf7,_0x4beb63){var _0x456753=_0x2e9bf7[_0xb174('0x6a')]['id'];var _0x5c2e86=_0x2e9bf7['body'];var _0x2c2f7c=0xc8;var _0xb80026=null;return db[_0xb174('0xe4')]['transaction']({'isolationLevel':db['sequelize'][_0xb174('0x115')][_0xb174('0x116')][_0xb174('0x117')]},function(_0x3af565){return db[_0xb174('0x54')][_0xb174('0x7b')]({'where':{'id':_0x456753},'transaction':_0x3af565})['then'](function(_0x58d550){if(_0x58d550){return db[_0xb174('0xad')][_0xb174('0x30')]({'where':{'ChatWebsiteId':_0x456753},'transaction':_0x3af565})[_0xb174('0x17')](function(){var _0x4316d6=_['map'](_0x5c2e86,function(_0x2872a2){_0x2872a2['ChatWebsiteId']=_0x456753;return _0x2872a2;});return db[_0xb174('0xad')]['bulkCreate'](_0x4316d6,{'transaction':_0x3af565});});}else{_0x2c2f7c=0x194;_0xb80026=[];}});})[_0xb174('0x17')](function(){if(_0x2c2f7c!==0x194){return db[_0xb174('0xad')][_0xb174('0x118')]({'where':{'ChatWebsiteId':_0x456753},'order':'priority'})['then'](function(_0xb45fb3){_0xb80026=_0xb45fb3;});}})[_0xb174('0x22')](function(_0x295683){_0x2c2f7c=0x1f4;logger[_0xb174('0x1e')](_0x295683[_0xb174('0x31')]);if(_0x295683['name']){delete _0x295683[_0xb174('0x32')];}_0xb80026=_0x295683;})[_0xb174('0x119')](function(){if(_0xb80026===null){_0x4beb63[_0xb174('0x23')](_0x2c2f7c);}else{if(_0x2c2f7c===0x1f4){_0x4beb63[_0xb174('0x24')](_0x2c2f7c)[_0xb174('0x33')](_0xb80026);}else{_0x4beb63[_0xb174('0x24')](_0x2c2f7c)[_0xb174('0x26')](_0xb80026);}}});};exports[_0xb174('0x11a')]=function(_0x22f4bd,_0x125b04){var _0x3ede59={};var _0x40bd4f={};var _0x4f133a;var _0x2d6a7b;return db[_0xb174('0x54')][_0xb174('0x7b')]({'where':{'id':_0x22f4bd[_0xb174('0x6a')]['id']}})['then'](handleEntityNotFound(_0x125b04,null))[_0xb174('0x17')](function(_0x369a45){if(_0x369a45){_0x4f133a=_0x369a45;_0x40bd4f[_0xb174('0x5b')]=_[_0xb174('0x59')](db[_0xb174('0xad')][_0xb174('0x55')]);_0x40bd4f[_0xb174('0x58')]=_['keys'](_0x22f4bd[_0xb174('0x58')]);_0x40bd4f[_0xb174('0x7e')]=_['intersection'](_0x40bd4f['model'],_0x40bd4f['query']);_0x3ede59[_0xb174('0x5c')]=_[_0xb174('0x5a')](_0x40bd4f[_0xb174('0x5b')],qs['fields'](_0x22f4bd[_0xb174('0x58')][_0xb174('0x5d')]));_0x3ede59[_0xb174('0x5c')]=_0x3ede59[_0xb174('0x5c')][_0xb174('0x5e')]?_0x3ede59[_0xb174('0x5c')]:_0x40bd4f['model'];_0x3ede59[_0xb174('0x60')]=qs['sort'](_0x22f4bd['query']['sort']);_0x3ede59[_0xb174('0x62')]=qs[_0xb174('0x7e')](_[_0xb174('0x7d')](_0x22f4bd['query'],_0x40bd4f[_0xb174('0x7e')]));if(_0x22f4bd[_0xb174('0x58')][_0xb174('0x63')]){_0x3ede59['where']=_[_0xb174('0x64')](_0x3ede59['where'],{'$or':_[_0xb174('0x41')](_0x3ede59[_0xb174('0x5c')],function(_0x1a650e){var _0x210168={};_0x210168[_0x1a650e]={'$like':'%'+_0x22f4bd[_0xb174('0x58')][_0xb174('0x63')]+'%'};return _0x210168;})});}_0x3ede59=_[_0xb174('0x64')]({},_0x3ede59,_0x22f4bd[_0xb174('0x6c')]);return _0x4f133a[_0xb174('0x11a')](_0x3ede59);}})[_0xb174('0x17')](function(_0x2cb294){if(_0x2cb294){_0x2d6a7b=_0x2cb294[_0xb174('0x5e')];if(!_0x22f4bd[_0xb174('0x58')][_0xb174('0x7c')]('nolimit')){_0x3ede59['limit']=qs[_0xb174('0x2a')](_0x22f4bd['query']['limit']);_0x3ede59[_0xb174('0x27')]=qs[_0xb174('0x27')](_0x22f4bd[_0xb174('0x58')][_0xb174('0x27')]);}return _0x4f133a[_0xb174('0x11a')](_0x3ede59);}})[_0xb174('0x17')](function(_0x90d3dc){if(_0x90d3dc){return _0x90d3dc?{'count':_0x2d6a7b,'rows':_0x90d3dc}:null;}})[_0xb174('0x17')](respondWithResult(_0x125b04,null))[_0xb174('0x22')](handleError(_0x125b04,null));};exports[_0xb174('0x11b')]=function(_0x287b8d,_0x587236){return db[_0xb174('0x11c')][_0xb174('0x6d')]({'where':{'id':_0x287b8d['params']['id']}})[_0xb174('0x17')](handleEntityNotFound(_0x587236,null))['then'](function(_0x335c00){if(_0x335c00){return _0x335c00['addProactiveActions'](_0x287b8d['body'][_0xb174('0x81')],_[_0xb174('0x11d')](_0x287b8d['body'],[_0xb174('0x81'),'id'])||{});}})[_0xb174('0x17')](respondWithResult(_0x587236,null))['catch'](handleError(_0x587236,null));};exports[_0xb174('0xfe')]=function(_0x560d03,_0x55560a){var _0x5d4fac={};var _0xf87c2d={};var _0x4d679c;var _0x8085f1;return db[_0xb174('0x54')][_0xb174('0x7b')]({'where':{'id':_0x560d03['params']['id']}})[_0xb174('0x17')](handleEntityNotFound(_0x55560a,null))[_0xb174('0x17')](function(_0x413bb5){if(_0x413bb5){_0x4d679c=_0x413bb5;_0xf87c2d[_0xb174('0x5b')]=_[_0xb174('0x59')](db[_0xb174('0x11e')][_0xb174('0x55')]);_0xf87c2d[_0xb174('0x58')]=_['keys'](_0x560d03[_0xb174('0x58')]);_0xf87c2d[_0xb174('0x7e')]=_['intersection'](_0xf87c2d[_0xb174('0x5b')],_0xf87c2d[_0xb174('0x58')]);_0x5d4fac[_0xb174('0x5c')]=_[_0xb174('0x5a')](_0xf87c2d['model'],qs['fields'](_0x560d03[_0xb174('0x58')][_0xb174('0x5d')]));_0x5d4fac['attributes']=_0x5d4fac['attributes'][_0xb174('0x5e')]?_0x5d4fac[_0xb174('0x5c')]:_0xf87c2d[_0xb174('0x5b')];_0x5d4fac[_0xb174('0x60')]=qs['sort'](_0x560d03[_0xb174('0x58')][_0xb174('0x61')]);_0x5d4fac[_0xb174('0x62')]=qs[_0xb174('0x7e')](_['pick'](_0x560d03[_0xb174('0x58')],_0xf87c2d[_0xb174('0x7e')]));if(_0x560d03[_0xb174('0x58')][_0xb174('0x63')]){_0x5d4fac[_0xb174('0x62')]=_[_0xb174('0x64')](_0x5d4fac['where'],{'$or':_['map'](_0x5d4fac[_0xb174('0x5c')],function(_0x67497c){var _0x55f3ee={};_0x55f3ee[_0x67497c]={'$like':'%'+_0x560d03[_0xb174('0x58')][_0xb174('0x63')]+'%'};return _0x55f3ee;})});}_0x5d4fac=_[_0xb174('0x64')]({},_0x5d4fac,_0x560d03[_0xb174('0x6c')]);return _0x4d679c['getProactiveActions'](_0x5d4fac);}})[_0xb174('0x17')](function(_0x44970c){if(_0x44970c){_0x8085f1=_0x44970c[_0xb174('0x5e')];if(!_0x560d03[_0xb174('0x58')][_0xb174('0x7c')]('nolimit')){_0x5d4fac[_0xb174('0x2a')]=qs[_0xb174('0x2a')](_0x560d03[_0xb174('0x58')]['limit']);_0x5d4fac[_0xb174('0x27')]=qs[_0xb174('0x27')](_0x560d03[_0xb174('0x58')][_0xb174('0x27')]);}return _0x4d679c['getProactiveActions'](_0x5d4fac);}})[_0xb174('0x17')](function(_0x290587){if(_0x290587){return _0x290587?{'count':_0x8085f1,'rows':_0x290587}:null;}})['then'](respondWithResult(_0x55560a,null))['catch'](handleError(_0x55560a,null));};exports['getFields']=function(_0x1074f0,_0x3fcebe){var _0xbd07d2=_0x1074f0[_0xb174('0x58')]['online']===_0xb174('0x11f')?'offlineForm':'onlineForm';return db[_0xb174('0x54')][_0xb174('0x6d')]({'attributes':['id',_0xbd07d2],'where':{'id':_0x1074f0[_0xb174('0x6a')]['id']}})[_0xb174('0x17')](handleEntityNotFound(_0x3fcebe,null))[_0xb174('0x17')](function(_0x2df9d3){if(_0x2df9d3){var _0x291720=_0x2df9d3[_0xbd07d2];var _0x3ffa60=_0x291720&&_0x291720['items']?_0x291720[_0xb174('0x120')]:[];_0x3fcebe[_0xb174('0x33')]({'fromKey':_[_0xb174('0x96')](_0x291720['fromKey'])?undefined:_0x291720['fromKey'],'count':_0x3ffa60[_0xb174('0x5e')],'rows':_0x3ffa60});}})[_0xb174('0x22')](handleError(_0x3fcebe,null));};exports[_0xb174('0x121')]=function(_0xce3f8e,_0x33572b){var _0x20bc5d={'raw':![],'where':{}};var _0x2b40ca={};var _0x225797={'count':0x0,'rows':[]};return db['ChatWebsite'][_0xb174('0x7b')]({'where':{'id':_0xce3f8e['params']['id']}})[_0xb174('0x17')](handleEntityNotFound(_0x33572b,null))[_0xb174('0x17')](function(_0x3f6d57){if(_0x3f6d57){_0x2b40ca[_0xb174('0x5b')]=_['keys'](db['ChatOfflineMessage'][_0xb174('0x55')]);_0x2b40ca['query']=_[_0xb174('0x59')](_0xce3f8e['query']);_0x2b40ca[_0xb174('0x7e')]=_[_0xb174('0x5a')](_0x2b40ca[_0xb174('0x5b')],_0x2b40ca['query']);_0x20bc5d[_0xb174('0x5c')]=_[_0xb174('0x5a')](_0x2b40ca['model'],qs[_0xb174('0x5d')](_0xce3f8e[_0xb174('0x58')][_0xb174('0x5d')]));_0x20bc5d[_0xb174('0x5c')]=_0x20bc5d[_0xb174('0x5c')][_0xb174('0x5e')]?_0x20bc5d[_0xb174('0x5c')]:_0x2b40ca['model'];if(!_0xce3f8e['query']['hasOwnProperty'](_0xb174('0x5f'))){_0x20bc5d[_0xb174('0x2a')]=qs[_0xb174('0x2a')](_0xce3f8e['query'][_0xb174('0x2a')]);_0x20bc5d[_0xb174('0x27')]=qs[_0xb174('0x27')](_0xce3f8e[_0xb174('0x58')]['offset']);}_0x20bc5d[_0xb174('0x60')]=qs[_0xb174('0x61')](_0xce3f8e[_0xb174('0x58')]['sort']);_0x20bc5d[_0xb174('0x62')]=qs['filters'](_[_0xb174('0x7d')](_0xce3f8e[_0xb174('0x58')],_0x2b40ca['filters']));_0x20bc5d['where'][_0xb174('0x78')]=_0x3f6d57['id'];if(_0xce3f8e[_0xb174('0x58')]['filter']){_0x20bc5d['where']=_[_0xb174('0x64')](_0x20bc5d[_0xb174('0x62')],{'$or':_[_0xb174('0x41')](_0x20bc5d['attributes'],function(_0x58411c){var _0x4db4e3={};_0x4db4e3[_0x58411c]={'$like':'%'+_0xce3f8e[_0xb174('0x58')][_0xb174('0x63')]+'%'};return _0x4db4e3;})});}_0x20bc5d=_[_0xb174('0x64')]({},_0x20bc5d,_0xce3f8e[_0xb174('0x6c')]);return db['ChatOfflineMessage']['count']({'where':_0x20bc5d[_0xb174('0x62')]})['then'](function(_0x5f550f){_0x225797[_0xb174('0x29')]=_0x5f550f;if(_0xce3f8e[_0xb174('0x58')][_0xb174('0x66')]){_0x20bc5d[_0xb174('0x67')]=[{'all':!![]}];}else{_0x20bc5d[_0xb174('0x67')]=[{'model':db[_0xb174('0xab')],'as':_0xb174('0x122'),'required':![]},{'model':db[_0xb174('0xe5')],'as':_0xb174('0x123'),'required':![]}];}return db[_0xb174('0xdc')][_0xb174('0x68')](_0x20bc5d);})['then'](function(_0x143f3e){_0x225797[_0xb174('0x7f')]=_0x143f3e;return _0x225797;});}})[_0xb174('0x17')](respondWithFilteredResult(_0x33572b,_0x20bc5d))['catch'](handleError(_0x33572b,null));};exports['addAgents']=function(_0x5ba9fb,_0xb2e2be){return db[_0xb174('0x54')][_0xb174('0x6d')]({'where':{'id':_0x5ba9fb['params']['id']}})[_0xb174('0x17')](handleEntityNotFound(_0xb2e2be,null))[_0xb174('0x17')](function(_0x482cd5){if(_0x482cd5){return _0x482cd5['addAgents'](_0x5ba9fb['body'][_0xb174('0x81')],_[_0xb174('0x11d')](_0x5ba9fb[_0xb174('0x74')],[_0xb174('0x81'),'id'])||{})[_0xb174('0xd9')](function(_0x22f6bb){for(var _0x4165fe=0x0;_0x4165fe<_0x5ba9fb[_0xb174('0x74')][_0xb174('0x81')][_0xb174('0x5e')];_0x4165fe+=0x1){socket[_0xb174('0x124')](_0xb174('0x125'),{'UserId':Number(_0x5ba9fb[_0xb174('0x74')][_0xb174('0x81')][_0x4165fe]),'ChatWebsiteId':Number(_0x5ba9fb['params']['id'])});}return _0x22f6bb;});}})[_0xb174('0x17')](respondWithResult(_0xb2e2be,null))[_0xb174('0x22')](handleError(_0xb2e2be,null));};exports['removeAgents']=function(_0x4e56b9,_0x4332db){return db['ChatWebsite'][_0xb174('0x6d')]({'where':{'id':_0x4e56b9['params']['id']}})[_0xb174('0x17')](handleEntityNotFound(_0x4332db,null))['then'](function(_0x66e3c4){if(_0x66e3c4){return _0x66e3c4[_0xb174('0x126')](_0x4e56b9[_0xb174('0x58')]['ids'])[_0xb174('0x17')](function(){if(_['isArray'](_0x4e56b9[_0xb174('0x58')][_0xb174('0x81')])){for(var _0x59c3f6=0x0;_0x59c3f6<_0x4e56b9['query'][_0xb174('0x81')]['length'];_0x59c3f6+=0x1){socket['emit'](_0xb174('0x127'),{'UserId':Number(_0x4e56b9[_0xb174('0x58')]['ids'][_0x59c3f6]),'ChatWebsiteId':Number(_0x4e56b9['params']['id'])});}}else{socket[_0xb174('0x124')](_0xb174('0x127'),{'UserId':Number(_0x4e56b9[_0xb174('0x58')][_0xb174('0x81')]),'ChatWebsiteId':Number(_0x4e56b9[_0xb174('0x6a')]['id'])});}});}})[_0xb174('0x17')](respondWithStatusCode(_0x4332db,null))[_0xb174('0x22')](handleError(_0x4332db,null));};exports[_0xb174('0x128')]=function(_0x51adfe,_0x204c81){var _0x4a14d2={};var _0x57e8b0={};var _0x134fcf;var _0x4e2c69;return db[_0xb174('0x54')][_0xb174('0x7b')]({'where':{'id':_0x51adfe[_0xb174('0x6a')]['id']}})[_0xb174('0x17')](handleEntityNotFound(_0x204c81,null))['then'](function(_0x534288){if(_0x534288){_0x134fcf=_0x534288;_0x57e8b0[_0xb174('0x5b')]=_['keys'](db[_0xb174('0xc8')][_0xb174('0x55')]);_0x57e8b0[_0xb174('0x58')]=_[_0xb174('0x59')](_0x51adfe['query']);_0x57e8b0[_0xb174('0x7e')]=_[_0xb174('0x5a')](_0x57e8b0['model'],_0x57e8b0[_0xb174('0x58')]);_0x4a14d2[_0xb174('0x5c')]=_[_0xb174('0x5a')](_0x57e8b0[_0xb174('0x5b')],qs[_0xb174('0x5d')](_0x51adfe[_0xb174('0x58')][_0xb174('0x5d')]));_0x4a14d2[_0xb174('0x5c')]=_0x4a14d2[_0xb174('0x5c')]['length']?_0x4a14d2[_0xb174('0x5c')]:_0x57e8b0[_0xb174('0x5b')];_0x4a14d2[_0xb174('0x60')]=qs[_0xb174('0x61')](_0x51adfe[_0xb174('0x58')][_0xb174('0x61')]);_0x4a14d2[_0xb174('0x62')]=qs[_0xb174('0x7e')](_[_0xb174('0x7d')](_0x51adfe[_0xb174('0x58')],_0x57e8b0[_0xb174('0x7e')]));if(_0x51adfe[_0xb174('0x58')]['filter']){_0x4a14d2['where']=_[_0xb174('0x64')](_0x4a14d2[_0xb174('0x62')],{'$or':_[_0xb174('0x41')](_0x4a14d2[_0xb174('0x5c')],function(_0x29f11e){var _0x5cc7cb={};_0x5cc7cb[_0x29f11e]={'$like':'%'+_0x51adfe['query'][_0xb174('0x63')]+'%'};return _0x5cc7cb;})});}_0x4a14d2=_[_0xb174('0x64')]({},_0x4a14d2,_0x51adfe['options']);return _0x134fcf[_0xb174('0x128')](_0x4a14d2);}})[_0xb174('0x17')](function(_0x5e2f98){if(_0x5e2f98){_0x4e2c69=_0x5e2f98[_0xb174('0x5e')];if(!_0x51adfe[_0xb174('0x58')]['hasOwnProperty'](_0xb174('0x5f'))){_0x4a14d2[_0xb174('0x2a')]=qs['limit'](_0x51adfe[_0xb174('0x58')][_0xb174('0x2a')]);_0x4a14d2[_0xb174('0x27')]=qs[_0xb174('0x27')](_0x51adfe[_0xb174('0x58')][_0xb174('0x27')]);}return _0x134fcf[_0xb174('0x128')](_0x4a14d2);}})[_0xb174('0x17')](function(_0x99699f){if(_0x99699f){return _0x99699f?{'count':_0x4e2c69,'rows':_0x99699f}:null;}})['then'](respondWithResult(_0x204c81,null))[_0xb174('0x22')](handleError(_0x204c81,null));}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js index 836fb0e..b86a3ad 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 _0xf1e1=['hook','exports','events','ChatWebsite','save','remove','emit','hasOwnProperty'];(function(_0x5816bf,_0x3f0cd7){var _0x1cd8a3=function(_0x410f91){while(--_0x410f91){_0x5816bf['push'](_0x5816bf['shift']());}};_0x1cd8a3(++_0x3f0cd7);}(_0xf1e1,0x102));var _0x1f1e=function(_0x4254e7,_0x4fc342){_0x4254e7=_0x4254e7-0x0;var _0x5e0844=_0xf1e1[_0x4254e7];return _0x5e0844;};'use strict';var EventEmitter=require(_0x1f1e('0x0'));var ChatWebsite=require('../../mysqldb')['db'][_0x1f1e('0x1')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x1f1e('0x2'),'afterUpdate':'update','afterDestroy':_0x1f1e('0x3')};function emitEvent(_0x1cad88){return function(_0x2243c6,_0x2ab1f9,_0x3b301d){ChatWebsiteEvents[_0x1f1e('0x4')](_0x1cad88+':'+_0x2243c6['id'],_0x2243c6);ChatWebsiteEvents[_0x1f1e('0x4')](_0x1cad88,_0x2243c6);_0x3b301d(null);};}for(var e in events){if(events[_0x1f1e('0x5')](e)){var event=events[e];ChatWebsite[_0x1f1e('0x6')](e,emitEvent(event));}}module[_0x1f1e('0x7')]=ChatWebsiteEvents; \ No newline at end of file +var _0x4f99=['../../mysqldb','setMaxListeners','save','update','emit','hasOwnProperty','hook','events'];(function(_0x1c6ad0,_0x51287f){var _0x48505f=function(_0x12793c){while(--_0x12793c){_0x1c6ad0['push'](_0x1c6ad0['shift']());}};_0x48505f(++_0x51287f);}(_0x4f99,0x157));var _0x94f9=function(_0x99f2b5,_0xfe1b39){_0x99f2b5=_0x99f2b5-0x0;var _0x564380=_0x4f99[_0x99f2b5];return _0x564380;};'use strict';var EventEmitter=require(_0x94f9('0x0'));var ChatWebsite=require(_0x94f9('0x1'))['db']['ChatWebsite'];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x94f9('0x2')](0x0);var events={'afterCreate':_0x94f9('0x3'),'afterUpdate':_0x94f9('0x4'),'afterDestroy':'remove'};function emitEvent(_0x15ff7c){return function(_0x879bc2,_0x560634,_0x1b4831){ChatWebsiteEvents[_0x94f9('0x5')](_0x15ff7c+':'+_0x879bc2['id'],_0x879bc2);ChatWebsiteEvents[_0x94f9('0x5')](_0x15ff7c,_0x879bc2);_0x1b4831(null);};}for(var e in events){if(events[_0x94f9('0x6')](e)){var event=events[e];ChatWebsite[_0x94f9('0x7')](e,emitEvent(event));}}module['exports']=ChatWebsiteEvents; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js index 93365af..fae425c 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 _0x9a51=['rimraf','exports','define','ChatWebsite','util','../../config/logger','api','moment','request-promise','path'];(function(_0x17cadc,_0xcebfdd){var _0x24778e=function(_0x6900b6){while(--_0x6900b6){_0x17cadc['push'](_0x17cadc['shift']());}};_0x24778e(++_0xcebfdd);}(_0x9a51,0xa4));var _0x19a5=function(_0x125233,_0x522bf1){_0x125233=_0x125233-0x0;var _0x42d385=_0x9a51[_0x125233];return _0x42d385;};'use strict';var _=require('lodash');var util=require(_0x19a5('0x0'));var logger=require(_0x19a5('0x1'))(_0x19a5('0x2'));var moment=require(_0x19a5('0x3'));var BPromise=require('bluebird');var rp=require(_0x19a5('0x4'));var fs=require('fs');var path=require(_0x19a5('0x5'));var rimraf=require(_0x19a5('0x6'));var config=require('../../config/environment');var attributes=require('./chatWebsite.attributes');module[_0x19a5('0x7')]=function(_0x25b65a,_0x25182f){return _0x25b65a[_0x19a5('0x8')](_0x19a5('0x9'),attributes,{'tableName':'chat_websites','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3419=['exports','ChatWebsite','lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x413c79,_0x1dddf4){var _0x49054e=function(_0xae7739){while(--_0xae7739){_0x413c79['push'](_0x413c79['shift']());}};_0x49054e(++_0x1dddf4);}(_0x3419,0x14c));var _0x9341=function(_0x49ad79,_0x48ee93){_0x49ad79=_0x49ad79-0x0;var _0xa4e38a=_0x3419[_0x49ad79];return _0xa4e38a;};'use strict';var _=require(_0x9341('0x0'));var util=require(_0x9341('0x1'));var logger=require(_0x9341('0x2'))('api');var moment=require(_0x9341('0x3'));var BPromise=require(_0x9341('0x4'));var rp=require(_0x9341('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9341('0x6'));var config=require(_0x9341('0x7'));var attributes=require('./chatWebsite.attributes');module[_0x9341('0x8')]=function(_0x12003b,_0x440729){return _0x12003b['define'](_0x9341('0x9'),attributes,{'tableName':'chat_websites','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.rpc.js b/server/api/chatWebsite/chatWebsite.rpc.js index 52d66be..d5f0235 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 _0x89a5=['code','message','catch','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','stringify','error'];(function(_0x5137d7,_0x4a3f10){var _0x21a4b8=function(_0x1a3f60){while(--_0x1a3f60){_0x5137d7['push'](_0x5137d7['shift']());}};_0x21a4b8(++_0x4a3f10);}(_0x89a5,0x12f));var _0x589a=function(_0x2faddb,_0xc18b78){_0x2faddb=_0x2faddb-0x0;var _0x273c05=_0x89a5[_0x2faddb];return _0x273c05;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x589a('0x0'));var BPromise=require(_0x589a('0x1'));var rs=require(_0x589a('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x589a('0x3'))['db'];var utils=require(_0x589a('0x4'));var logger=require(_0x589a('0x5'))(_0x589a('0x6'));var config=require('../../config/environment');var jayson=require(_0x589a('0x7'));var client=jayson['client'][_0x589a('0x8')]({'port':0x232a});config[_0x589a('0x9')]=_[_0x589a('0xa')](config['redis'],{'host':_0x589a('0xb'),'port':0x18eb});var socket=require(_0x589a('0xc'))(new Redis(config['redis']));require('./chatWebsite.socket')[_0x589a('0xd')](socket);function respondWithRpcPromise(_0x3edb89,_0x4a96eb,_0x38d2bb){return new BPromise(function(_0x10c405,_0x269e2e){return client[_0x589a('0xe')](_0x3edb89,_0x38d2bb)[_0x589a('0xf')](function(_0x355a5d){logger[_0x589a('0x10')](_0x589a('0x11'),_0x4a96eb,_0x589a('0x12'));logger[_0x589a('0x13')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x4a96eb,_0x589a('0x12'),JSON[_0x589a('0x14')](_0x355a5d));if(_0x355a5d[_0x589a('0x15')]){if(_0x355a5d[_0x589a('0x15')][_0x589a('0x16')]===0x1f4){logger[_0x589a('0x15')](_0x589a('0x11'),_0x4a96eb,_0x355a5d[_0x589a('0x15')][_0x589a('0x17')]);return _0x269e2e(_0x355a5d['error'][_0x589a('0x17')]);}logger[_0x589a('0x15')](_0x589a('0x11'),_0x4a96eb,_0x355a5d[_0x589a('0x15')][_0x589a('0x17')]);return _0x10c405(_0x355a5d[_0x589a('0x15')][_0x589a('0x17')]);}else{logger[_0x589a('0x10')](_0x589a('0x11'),_0x4a96eb,'request\x20sent');_0x10c405(_0x355a5d['result'][_0x589a('0x17')]);}})[_0x589a('0x18')](function(_0x36ecf7){logger[_0x589a('0x15')](_0x589a('0x11'),_0x4a96eb,_0x36ecf7);_0x269e2e(_0x36ecf7);});});} \ No newline at end of file +var _0x882a=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','util','moment'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x882a,0xdd));var _0xa882=function(_0x514ab2,_0x1d904c){_0x514ab2=_0x514ab2-0x0;var _0x249070=_0x882a[_0x514ab2];return _0x249070;};'use strict';var _=require(_0xa882('0x0'));var util=require(_0xa882('0x1'));var moment=require(_0xa882('0x2'));var BPromise=require(_0xa882('0x3'));var rs=require(_0xa882('0x4'));var fs=require('fs');var Redis=require(_0xa882('0x5'));var db=require(_0xa882('0x6'))['db'];var utils=require(_0xa882('0x7'));var logger=require(_0xa882('0x8'))(_0xa882('0x9'));var config=require(_0xa882('0xa'));var jayson=require(_0xa882('0xb'));var client=jayson[_0xa882('0xc')][_0xa882('0xd')]({'port':0x232a});config[_0xa882('0xe')]=_[_0xa882('0xf')](config[_0xa882('0xe')],{'host':_0xa882('0x10'),'port':0x18eb});var socket=require(_0xa882('0x11'))(new Redis(config[_0xa882('0xe')]));require('./chatWebsite.socket')[_0xa882('0x12')](socket);function respondWithRpcPromise(_0x2e5ea9,_0x278578,_0x2ddac6){return new BPromise(function(_0x2f04d1,_0x481585){return client[_0xa882('0x13')](_0x2e5ea9,_0x2ddac6)['then'](function(_0xb0f4d2){logger[_0xa882('0x14')](_0xa882('0x15'),_0x278578,_0xa882('0x16'));logger['debug']('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x278578,_0xa882('0x16'),JSON['stringify'](_0xb0f4d2));if(_0xb0f4d2[_0xa882('0x17')]){if(_0xb0f4d2[_0xa882('0x17')][_0xa882('0x18')]===0x1f4){logger['error'](_0xa882('0x15'),_0x278578,_0xb0f4d2[_0xa882('0x17')]['message']);return _0x481585(_0xb0f4d2[_0xa882('0x17')]['message']);}logger['error'](_0xa882('0x15'),_0x278578,_0xb0f4d2[_0xa882('0x17')][_0xa882('0x19')]);return _0x2f04d1(_0xb0f4d2['error'][_0xa882('0x19')]);}else{logger[_0xa882('0x14')](_0xa882('0x15'),_0x278578,'request\x20sent');_0x2f04d1(_0xb0f4d2[_0xa882('0x1a')][_0xa882('0x19')]);}})[_0xa882('0x1b')](function(_0x25b6aa){logger['error'](_0xa882('0x15'),_0x278578,_0x25b6aa);_0x481585(_0x25b6aa);});});} \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js index 2c3a1d8..23919cc 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 _0x9cf4=['./chatWebsite.events','remove','update','removeListener','register','length'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x9cf4,0x120));var _0x49cf=function(_0x52cc78,_0x24eb93){_0x52cc78=_0x52cc78-0x0;var _0xbe1cba=_0x9cf4[_0x52cc78];return _0xbe1cba;};'use strict';var ChatWebsiteEvents=require(_0x49cf('0x0'));var events=['save',_0x49cf('0x1'),_0x49cf('0x2')];function createListener(_0x21896b,_0xed8b9){return function(_0x5b5851){_0xed8b9['emit'](_0x21896b,_0x5b5851);};}function removeListener(_0x3e4c06,_0x4689ff){return function(){ChatWebsiteEvents[_0x49cf('0x3')](_0x3e4c06,_0x4689ff);};}exports[_0x49cf('0x4')]=function(_0x395579){for(var _0x487974=0x0,_0x170b3f=events[_0x49cf('0x5')];_0x487974<_0x170b3f;_0x487974++){var _0x45efb7=events[_0x487974];var _0xf67c99=createListener('chatWebsite:'+_0x45efb7,_0x395579);ChatWebsiteEvents['on'](_0x45efb7,_0xf67c99);}}; \ No newline at end of file +var _0x1f35=['register','length','./chatWebsite.events','remove','update','emit'];(function(_0x52efff,_0x2213b2){var _0x363d20=function(_0x37a7ab){while(--_0x37a7ab){_0x52efff['push'](_0x52efff['shift']());}};_0x363d20(++_0x2213b2);}(_0x1f35,0x80));var _0x51f3=function(_0x4f4fc1,_0xb24d69){_0x4f4fc1=_0x4f4fc1-0x0;var _0x4d0edf=_0x1f35[_0x4f4fc1];return _0x4d0edf;};'use strict';var ChatWebsiteEvents=require(_0x51f3('0x0'));var events=['save',_0x51f3('0x1'),_0x51f3('0x2')];function createListener(_0x1abe7b,_0x538d62){return function(_0x16c0ce){_0x538d62[_0x51f3('0x3')](_0x1abe7b,_0x16c0ce);};}function removeListener(_0x1ff40e,_0x43be03){return function(){ChatWebsiteEvents['removeListener'](_0x1ff40e,_0x43be03);};}exports[_0x51f3('0x4')]=function(_0x39ecf0){for(var _0x125377=0x0,_0x292da1=events[_0x51f3('0x5')];_0x125377<_0x292da1;_0x125377++){var _0x5390b9=events[_0x125377];var _0x13514e=createListener('chatWebsite:'+_0x5390b9,_0x39ecf0);ChatWebsiteEvents['on'](_0x5390b9,_0x13514e);}}; \ No newline at end of file diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js index 965753d..496ea2e 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 _0x8c85=['removeDispositions','removeAnswers','removeAgents','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','/:id/dispositions','/:id/canned_answers','/:id/logo','getLogo','getCustomerAvatar','/:id/system_avatar','/:id/interactions','getInteractions','/:id/proactive_actions','getFields','getOfflineMessages','/:id/users','post','diskStorage','join','root','format','originalname','single','file','addLogo','%s-%s','now','/:id/avatar','server/files/images/avatars/','/:id/customer_avatar','addSystemAvatar','/:id/notify','server/files','offline-chat','ensureDir','replace','extname','/:id/offline','any','/:id/applications','addApplications','addProactiveActions','addAgents','put','destroy','delete'];(function(_0x2809c3,_0x595a6b){var _0x47de12=function(_0x16ef12){while(--_0x16ef12){_0x2809c3['push'](_0x2809c3['shift']());}};_0x47de12(++_0x595a6b);}(_0x8c85,0xf4));var _0x58c8=function(_0x3e4af4,_0xe63612){_0x3e4af4=_0x3e4af4-0x0;var _0x21fdcf=_0x8c85[_0x3e4af4];return _0x21fdcf;};'use strict';var multer=require(_0x58c8('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x58c8('0x1'));var express=require(_0x58c8('0x2'));var router=express[_0x58c8('0x3')]();var fs_extra=require(_0x58c8('0x4'));var auth=require(_0x58c8('0x5'));var interaction=require(_0x58c8('0x6'));var config=require(_0x58c8('0x7'));var controller=require('./chatWebsite.controller');router[_0x58c8('0x8')]('/',auth[_0x58c8('0x9')](),controller[_0x58c8('0xa')]);router[_0x58c8('0x8')](_0x58c8('0xb'),auth[_0x58c8('0x9')](),controller[_0x58c8('0xc')]);router[_0x58c8('0x8')](_0x58c8('0xd'),auth[_0x58c8('0x9')](),controller['show']);router['get'](_0x58c8('0xe'),auth[_0x58c8('0x9')](),controller['getDispositions']);router['get'](_0x58c8('0xf'),auth['isAuthenticated'](),controller['getAnswers']);router[_0x58c8('0x8')](_0x58c8('0x10'),controller[_0x58c8('0x11')]);router[_0x58c8('0x8')]('/:id/avatar',controller['getAvatar']);router[_0x58c8('0x8')]('/:id/customer_avatar',controller[_0x58c8('0x12')]);router[_0x58c8('0x8')](_0x58c8('0x13'),controller['getSystemAvatar']);router[_0x58c8('0x8')](_0x58c8('0x14'),auth[_0x58c8('0x9')](),controller[_0x58c8('0x15')]);router[_0x58c8('0x8')]('/:id/snippet',controller['getSnippet']);router[_0x58c8('0x8')]('/:id/applications',auth[_0x58c8('0x9')](),controller['getApplications']);router['get'](_0x58c8('0x16'),auth[_0x58c8('0x9')](),controller['getProactiveActions']);router[_0x58c8('0x8')]('/:id/fields',controller[_0x58c8('0x17')]);router[_0x58c8('0x8')]('/:id/offline_messages',auth['isAuthenticated'](),controller[_0x58c8('0x18')]);router['get'](_0x58c8('0x19'),auth[_0x58c8('0x9')](),controller['getAgents']);router[_0x58c8('0x1a')]('/',auth[_0x58c8('0x9')](),controller['create']);router[_0x58c8('0x1a')](_0x58c8('0xe'),auth[_0x58c8('0x9')](),controller['addDisposition']);router[_0x58c8('0x1a')](_0x58c8('0xf'),auth['isAuthenticated'](),controller['addAnswer']);var upload=multer({'storage':multer[_0x58c8('0x1b')]({'destination':function(_0x20ad4c,_0x54ecd9,_0x1db1c7){_0x1db1c7(null,path[_0x58c8('0x1c')](config[_0x58c8('0x1d')],'server/files/images/logos/'));},'filename':function(_0x4c1359,_0xded08d,_0x514a96){_0x514a96(null,util[_0x58c8('0x1e')]('%s-%s',Date['now'](),_0xded08d[_0x58c8('0x1f')]));}})});router[_0x58c8('0x1a')](_0x58c8('0x10'),upload[_0x58c8('0x20')](_0x58c8('0x21')),controller[_0x58c8('0x22')]);var upload=multer({'storage':multer[_0x58c8('0x1b')]({'destination':function(_0xcc51c,_0x217f4c,_0x158d5a){_0x158d5a(null,path[_0x58c8('0x1c')](config[_0x58c8('0x1d')],'server/files/images/avatars/'));},'filename':function(_0x1f00c5,_0x174af1,_0x4ce34d){_0x4ce34d(null,util['format'](_0x58c8('0x23'),Date[_0x58c8('0x24')](),_0x174af1['originalname']));}})});router['post'](_0x58c8('0x25'),upload['single'](_0x58c8('0x21')),controller['addAvatar']);var upload=multer({'storage':multer[_0x58c8('0x1b')]({'destination':function(_0xfcf0cb,_0x4a2732,_0x32a77d){_0x32a77d(null,path[_0x58c8('0x1c')](config[_0x58c8('0x1d')],_0x58c8('0x26')));},'filename':function(_0x3c311b,_0x4bffdd,_0x426606){_0x426606(null,util['format'](_0x58c8('0x23'),Date['now'](),_0x4bffdd['originalname']));}})});router['post'](_0x58c8('0x27'),upload['single']('file'),controller['addCustomerAvatar']);var upload=multer({'storage':multer[_0x58c8('0x1b')]({'destination':function(_0x54e436,_0x1e1a92,_0xf23853){_0xf23853(null,path[_0x58c8('0x1c')](config[_0x58c8('0x1d')],_0x58c8('0x26')));},'filename':function(_0x428ddc,_0x3e09d0,_0x1d52d9){_0x1d52d9(null,util[_0x58c8('0x1e')](_0x58c8('0x23'),Date[_0x58c8('0x24')](),_0x3e09d0['originalname']));}})});router[_0x58c8('0x1a')]('/:id/system_avatar',upload[_0x58c8('0x20')]('file'),controller[_0x58c8('0x28')]);router[_0x58c8('0x1a')](_0x58c8('0x29'),controller['notify']);const offlineUploadMulter=multer({'storage':multer[_0x58c8('0x1b')]({'destination':function(_0x395aed,_0x73534c,_0x6b8062){const _0x512104=path[_0x58c8('0x1c')](config['root'],_0x58c8('0x2a'),'attachments',_0x58c8('0x2b'));fs_extra[_0x58c8('0x2c')](_0x512104,function(){_0x6b8062(null,_0x512104);});},'filename':function(_0xd81bb9,_0x5772fd,_0x2c7353){const _0x6a3b17=_0x5772fd[_0x58c8('0x1f')][_0x58c8('0x2d')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x41ce91=path[_0x58c8('0x2e')](_0x6a3b17);const _0x47f0a6=Date[_0x58c8('0x24')]()+'-'+_0x6a3b17[_0x58c8('0x2d')](_0x41ce91,'')+_0x41ce91;_0x2c7353(null,_0x47f0a6);}})});router[_0x58c8('0x1a')](_0x58c8('0x2f'),offlineUploadMulter[_0x58c8('0x30')](),controller['offline']);router[_0x58c8('0x1a')](_0x58c8('0x14'),auth[_0x58c8('0x9')](),controller['addInteraction']);router[_0x58c8('0x1a')](_0x58c8('0x31'),auth[_0x58c8('0x9')](),controller[_0x58c8('0x32')]);router[_0x58c8('0x1a')](_0x58c8('0x16'),auth[_0x58c8('0x9')](),controller[_0x58c8('0x33')]);router[_0x58c8('0x1a')](_0x58c8('0x19'),auth[_0x58c8('0x9')](),controller[_0x58c8('0x34')]);router[_0x58c8('0x35')](_0x58c8('0xd'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x58c8('0xd'),auth[_0x58c8('0x9')](),controller[_0x58c8('0x36')]);router[_0x58c8('0x37')](_0x58c8('0xe'),auth[_0x58c8('0x9')](),controller[_0x58c8('0x38')]);router[_0x58c8('0x37')]('/:id/canned_answers',auth[_0x58c8('0x9')](),controller[_0x58c8('0x39')]);router[_0x58c8('0x37')](_0x58c8('0x19'),auth[_0x58c8('0x9')](),controller[_0x58c8('0x3a')]);module[_0x58c8('0x3b')]=router; \ No newline at end of file +var _0x2f70=['/:id/snippet','getSnippet','getApplications','getProactiveActions','/:id/fields','getOfflineMessages','/:id/users','getAgents','create','post','addAnswer','diskStorage','join','server/files/images/logos/','format','%s-%s','now','single','file','root','server/files/images/avatars/','originalname','addAvatar','/:id/notify','server/files','attachments','offline-chat','ensureDir','replace','extname','any','offline','/:id/interactions','addInteraction','/:id/applications','addApplications','/:id/proactive_actions','addProactiveActions','put','/:id','update','delete','destroy','/:id/canned_answers','removeAnswers','removeAgents','exports','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatWebsite.controller','get','isAuthenticated','index','describe','show','/:id/dispositions','getDispositions','getAvatar','/:id/customer_avatar','/:id/system_avatar','getSystemAvatar','getInteractions'];(function(_0x46aff0,_0x122890){var _0x9d78cf=function(_0x3f14cb){while(--_0x3f14cb){_0x46aff0['push'](_0x46aff0['shift']());}};_0x9d78cf(++_0x122890);}(_0x2f70,0x1bb));var _0x02f7=function(_0x58e4bd,_0x190893){_0x58e4bd=_0x58e4bd-0x0;var _0x30293a=_0x2f70[_0x58e4bd];return _0x30293a;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x02f7('0x0'));var express=require(_0x02f7('0x1'));var router=express[_0x02f7('0x2')]();var fs_extra=require(_0x02f7('0x3'));var auth=require(_0x02f7('0x4'));var interaction=require(_0x02f7('0x5'));var config=require('../../config/environment');var controller=require(_0x02f7('0x6'));router[_0x02f7('0x7')]('/',auth[_0x02f7('0x8')](),controller[_0x02f7('0x9')]);router[_0x02f7('0x7')]('/describe',auth[_0x02f7('0x8')](),controller[_0x02f7('0xa')]);router[_0x02f7('0x7')]('/:id',auth[_0x02f7('0x8')](),controller[_0x02f7('0xb')]);router[_0x02f7('0x7')](_0x02f7('0xc'),auth['isAuthenticated'](),controller[_0x02f7('0xd')]);router[_0x02f7('0x7')]('/:id/canned_answers',auth[_0x02f7('0x8')](),controller['getAnswers']);router[_0x02f7('0x7')]('/:id/logo',controller['getLogo']);router[_0x02f7('0x7')]('/:id/avatar',controller[_0x02f7('0xe')]);router[_0x02f7('0x7')](_0x02f7('0xf'),controller['getCustomerAvatar']);router[_0x02f7('0x7')](_0x02f7('0x10'),controller[_0x02f7('0x11')]);router[_0x02f7('0x7')]('/:id/interactions',auth[_0x02f7('0x8')](),controller[_0x02f7('0x12')]);router[_0x02f7('0x7')](_0x02f7('0x13'),controller[_0x02f7('0x14')]);router['get']('/:id/applications',auth[_0x02f7('0x8')](),controller[_0x02f7('0x15')]);router[_0x02f7('0x7')]('/:id/proactive_actions',auth[_0x02f7('0x8')](),controller[_0x02f7('0x16')]);router[_0x02f7('0x7')](_0x02f7('0x17'),controller['getFields']);router['get']('/:id/offline_messages',auth['isAuthenticated'](),controller[_0x02f7('0x18')]);router[_0x02f7('0x7')](_0x02f7('0x19'),auth[_0x02f7('0x8')](),controller[_0x02f7('0x1a')]);router['post']('/',auth['isAuthenticated'](),controller[_0x02f7('0x1b')]);router[_0x02f7('0x1c')](_0x02f7('0xc'),auth['isAuthenticated'](),controller['addDisposition']);router['post']('/:id/canned_answers',auth['isAuthenticated'](),controller[_0x02f7('0x1d')]);var upload=multer({'storage':multer[_0x02f7('0x1e')]({'destination':function(_0x458ac4,_0x344c47,_0x4707bf){_0x4707bf(null,path[_0x02f7('0x1f')](config['root'],_0x02f7('0x20')));},'filename':function(_0x25956b,_0x3a9dd1,_0x20dc3a){_0x20dc3a(null,util[_0x02f7('0x21')](_0x02f7('0x22'),Date[_0x02f7('0x23')](),_0x3a9dd1['originalname']));}})});router[_0x02f7('0x1c')]('/:id/logo',upload[_0x02f7('0x24')](_0x02f7('0x25')),controller['addLogo']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x4b91ea,_0xa20f88,_0x575219){_0x575219(null,path[_0x02f7('0x1f')](config[_0x02f7('0x26')],_0x02f7('0x27')));},'filename':function(_0x4fe50e,_0x56da58,_0x3a160f){_0x3a160f(null,util['format'](_0x02f7('0x22'),Date['now'](),_0x56da58[_0x02f7('0x28')]));}})});router['post']('/:id/avatar',upload[_0x02f7('0x24')](_0x02f7('0x25')),controller[_0x02f7('0x29')]);var upload=multer({'storage':multer[_0x02f7('0x1e')]({'destination':function(_0x15e709,_0x292660,_0x8dca2c){_0x8dca2c(null,path[_0x02f7('0x1f')](config[_0x02f7('0x26')],_0x02f7('0x27')));},'filename':function(_0x2670a8,_0x3b8b07,_0x4bed58){_0x4bed58(null,util[_0x02f7('0x21')](_0x02f7('0x22'),Date[_0x02f7('0x23')](),_0x3b8b07[_0x02f7('0x28')]));}})});router['post'](_0x02f7('0xf'),upload[_0x02f7('0x24')](_0x02f7('0x25')),controller['addCustomerAvatar']);var upload=multer({'storage':multer[_0x02f7('0x1e')]({'destination':function(_0x14944c,_0x321bc0,_0x39c13e){_0x39c13e(null,path['join'](config['root'],_0x02f7('0x27')));},'filename':function(_0x37a07c,_0x4d59e2,_0x1ddcd2){_0x1ddcd2(null,util['format'](_0x02f7('0x22'),Date[_0x02f7('0x23')](),_0x4d59e2[_0x02f7('0x28')]));}})});router['post'](_0x02f7('0x10'),upload['single'](_0x02f7('0x25')),controller['addSystemAvatar']);router['post'](_0x02f7('0x2a'),controller['notify']);const offlineUploadMulter=multer({'storage':multer[_0x02f7('0x1e')]({'destination':function(_0x4c5124,_0x5f09cd,_0x2fe6a2){const _0x27ec5a=path['join'](config['root'],_0x02f7('0x2b'),_0x02f7('0x2c'),_0x02f7('0x2d'));fs_extra[_0x02f7('0x2e')](_0x27ec5a,function(){_0x2fe6a2(null,_0x27ec5a);});},'filename':function(_0x1cd628,_0x4f6877,_0x421b19){const _0xd333b9=_0x4f6877[_0x02f7('0x28')][_0x02f7('0x2f')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x13c0cf=path[_0x02f7('0x30')](_0xd333b9);const _0x17524c=Date[_0x02f7('0x23')]()+'-'+_0xd333b9[_0x02f7('0x2f')](_0x13c0cf,'')+_0x13c0cf;_0x421b19(null,_0x17524c);}})});router['post']('/:id/offline',offlineUploadMulter[_0x02f7('0x31')](),controller[_0x02f7('0x32')]);router[_0x02f7('0x1c')](_0x02f7('0x33'),auth[_0x02f7('0x8')](),controller[_0x02f7('0x34')]);router[_0x02f7('0x1c')](_0x02f7('0x35'),auth['isAuthenticated'](),controller[_0x02f7('0x36')]);router[_0x02f7('0x1c')](_0x02f7('0x37'),auth[_0x02f7('0x8')](),controller[_0x02f7('0x38')]);router[_0x02f7('0x1c')](_0x02f7('0x19'),auth[_0x02f7('0x8')](),controller['addAgents']);router[_0x02f7('0x39')](_0x02f7('0x3a'),auth[_0x02f7('0x8')](),controller[_0x02f7('0x3b')]);router[_0x02f7('0x3c')](_0x02f7('0x3a'),auth[_0x02f7('0x8')](),controller[_0x02f7('0x3d')]);router[_0x02f7('0x3c')](_0x02f7('0xc'),auth['isAuthenticated'](),controller['removeDispositions']);router[_0x02f7('0x3c')](_0x02f7('0x3e'),auth[_0x02f7('0x8')](),controller[_0x02f7('0x3f')]);router[_0x02f7('0x3c')](_0x02f7('0x19'),auth['isAuthenticated'](),controller[_0x02f7('0x40')]);module[_0x02f7('0x41')]=router; \ No newline at end of file diff --git a/server/api/client-side-logs.js b/server/api/client-side-logs.js index 3bb2e82..af0ad16 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 _0x665f=['../config/environment','Router','app','client-side-logger','/client-logs','use','isAuthenticated','exports','beaver-logger/server','express','../components/auth/service'];(function(_0x2601b4,_0x315e78){var _0x3e3661=function(_0x13b45b){while(--_0x13b45b){_0x2601b4['push'](_0x2601b4['shift']());}};_0x3e3661(++_0x315e78);}(_0x665f,0x19f));var _0xf665=function(_0x56f1d4,_0x248daf){_0x56f1d4=_0x56f1d4-0x0;var _0x19a43f=_0x665f[_0x56f1d4];return _0x19a43f;};var beaverLogger=require(_0xf665('0x0'));var express=require(_0xf665('0x1'));var auth=require(_0xf665('0x2'));var config=require(_0xf665('0x3'));var router=express[_0xf665('0x4')]();var isProduction=config['env']==='production'||![];function clientSideLogs(_0x1dd211,_0x317153,_0x4406ce){var _0x1df1d9=_0x1dd211[_0xf665('0x5')]['get'](_0xf665('0x6'));if(!_0x1df1d9){throw new Error('Client-Side\x20logger\x20not\x20found!');}return beaverLogger['expressEndpoint']({'uri':_0xf665('0x7'),'logger':_0x1df1d9,'enableCors':!isProduction})(_0x1dd211,_0x317153,_0x4406ce);}router[_0xf665('0x8')](auth[_0xf665('0x9')](),clientSideLogs);module[_0xf665('0xa')]=router; \ No newline at end of file +var _0x0371=['Client-Side\x20logger\x20not\x20found!','expressEndpoint','/client-logs','use','isAuthenticated','exports','beaver-logger/server','express','../components/auth/service','Router','env','production','get','client-side-logger'];(function(_0xbe5b4d,_0x45e137){var _0x3df6f7=function(_0x11b67f){while(--_0x11b67f){_0xbe5b4d['push'](_0xbe5b4d['shift']());}};_0x3df6f7(++_0x45e137);}(_0x0371,0x180));var _0x1037=function(_0xd0b415,_0x149675){_0xd0b415=_0xd0b415-0x0;var _0x2bdf2c=_0x0371[_0xd0b415];return _0x2bdf2c;};var beaverLogger=require(_0x1037('0x0'));var express=require(_0x1037('0x1'));var auth=require(_0x1037('0x2'));var config=require('../config/environment');var router=express[_0x1037('0x3')]();var isProduction=config[_0x1037('0x4')]===_0x1037('0x5')||![];function clientSideLogs(_0x37ecdc,_0x245273,_0x4d89cc){var _0x26284f=_0x37ecdc['app'][_0x1037('0x6')](_0x1037('0x7'));if(!_0x26284f){throw new Error(_0x1037('0x8'));}return beaverLogger[_0x1037('0x9')]({'uri':_0x1037('0xa'),'logger':_0x26284f,'enableCors':!isProduction})(_0x37ecdc,_0x245273,_0x4d89cc);}router[_0x1037('0xb')](auth[_0x1037('0xc')](),clientSideLogs);module[_0x1037('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 8882699..4729239 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 _0x084d=['sequelize','exports','ENUM','AmazonAWS','Google','MicrosoftAzure','Outlook365','Dynamics365','STRING','MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20redirect_uri','TEXT','MicrosoftAzure\x20=>\x20access_token','MicrosoftAzure\x20=>\x20refresh_token'];(function(_0x5fa60c,_0x1f4a06){var _0x38ebec=function(_0x305c4a){while(--_0x305c4a){_0x5fa60c['push'](_0x5fa60c['shift']());}};_0x38ebec(++_0x1f4a06);}(_0x084d,0x9a));var _0xd084=function(_0x40d8e2,_0x2b6c17){_0x40d8e2=_0x40d8e2-0x0;var _0x3ff3f1=_0x084d[_0x40d8e2];return _0x3ff3f1;};'use strict';var Sequelize=require(_0xd084('0x0'));module[_0xd084('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0xd084('0x2')](_0xd084('0x3'),_0xd084('0x4'),_0xd084('0x5')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0xd084('0x2')](_0xd084('0x6'),_0xd084('0x7'))},'data1':{'type':Sequelize[_0xd084('0x8')],'comment':_0xd084('0x9')},'data2':{'type':Sequelize[_0xd084('0x8')],'comment':'MicrosoftAzure\x20=>\x20tenant'},'data3':{'type':Sequelize[_0xd084('0x8')],'comment':'MicrosoftAzure\x20=>\x20client_secret'},'data4':{'type':Sequelize[_0xd084('0x8')],'comment':_0xd084('0xa')},'data5':{'type':Sequelize[_0xd084('0xb')],'comment':_0xd084('0xc')},'data6':{'type':Sequelize['TEXT'],'comment':_0xd084('0xd')},'data7':{'type':Sequelize[_0xd084('0xb')],'comment':'MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri'}}; \ No newline at end of file +var _0x6c91=['MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20client_secret','MicrosoftAzure\x20=>\x20redirect_uri','TEXT','MicrosoftAzure\x20=>\x20access_token','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','sequelize','exports','STRING','ENUM','AmazonAWS','MicrosoftAzure','MicrosoftAzure\x20=>\x20client_id'];(function(_0x3a19d4,_0x3f19a4){var _0x5b858b=function(_0x4ddce5){while(--_0x4ddce5){_0x3a19d4['push'](_0x3a19d4['shift']());}};_0x5b858b(++_0x3f19a4);}(_0x6c91,0x172));var _0x16c9=function(_0xcac2ec,_0x54b40b){_0xcac2ec=_0xcac2ec-0x0;var _0x2bb095=_0x6c91[_0xcac2ec];return _0x2bb095;};'use strict';var Sequelize=require(_0x16c9('0x0'));module[_0x16c9('0x1')]={'name':{'type':Sequelize[_0x16c9('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x16c9('0x3')](_0x16c9('0x4'),'Google',_0x16c9('0x5')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0x16c9('0x3')]('Outlook365','Dynamics365')},'data1':{'type':Sequelize['STRING'],'comment':_0x16c9('0x6')},'data2':{'type':Sequelize[_0x16c9('0x2')],'comment':_0x16c9('0x7')},'data3':{'type':Sequelize['STRING'],'comment':_0x16c9('0x8')},'data4':{'type':Sequelize['STRING'],'comment':_0x16c9('0x9')},'data5':{'type':Sequelize[_0x16c9('0xa')],'comment':_0x16c9('0xb')},'data6':{'type':Sequelize[_0x16c9('0xa')],'comment':'MicrosoftAzure\x20=>\x20refresh_token'},'data7':{'type':Sequelize[_0x16c9('0xa')],'comment':_0x16c9('0xc')}}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js index 79cb76a..30f08cc 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 _0xf61a=['limit','count','set','Content-Range','update','destroy','then','sendStatus','name','send','slice','map','CloudProvider','fieldName','type','key','model','query','keys','filters','intersection','attributes','hasOwnProperty','sort','pick','filter','merge','where','VIRTUAL','options','include','findAll','rows','MicrosoftAzure','data3','catch','rawAttributes','fields','length','includeAll','find','decryptString','create','body','Name\x20parameter\x20not\x20specified','service','Service\x20parameter\x20not\x20specified','values','includes','join','encryptString','params','oauth2MicrosoftAuthorize','oauth2MicrosoftCallback','error','get','parse','state','base64','toString','ascii','id_token','oauth2Claims','Unable\x20to\x20validate\x20id_token','del','getOauth2MicrosoftAccessToken','code','data5','access_token','data6','refresh_token','microsoftAuthorization:success','emit','microsoftAuthorization:error','Invalid\x20authentication\x20state\x20parameter','message','lodash','ioredis','../../components/parsers/qs','../../components/encryptor','../../config/environment','../../config/logger','api','../../mysqldb','./cloudProvider.oauth','defaults','redis','localhost','socket.io-emitter','end','status','offset','undefined'];(function(_0x4ae2d5,_0x265f6e){var _0x26a9aa=function(_0x1d95c6){while(--_0x1d95c6){_0x4ae2d5['push'](_0x4ae2d5['shift']());}};_0x26a9aa(++_0x265f6e);}(_0xf61a,0x106));var _0xaf61=function(_0xbdef0c,_0x4faea1){_0xbdef0c=_0xbdef0c-0x0;var _0x39ab9d=_0xf61a[_0xbdef0c];return _0x39ab9d;};'use strict';var _=require(_0xaf61('0x0'));var Redis=require(_0xaf61('0x1'));var qs=require(_0xaf61('0x2'));var encryptor=require(_0xaf61('0x3'));var config=require(_0xaf61('0x4'));var logger=require(_0xaf61('0x5'))(_0xaf61('0x6'));var db=require(_0xaf61('0x7'))['db'];var oauth=require(_0xaf61('0x8'));config['redis']=_[_0xaf61('0x9')](config[_0xaf61('0xa')],{'host':_0xaf61('0xb'),'port':0x18eb});var socket=require(_0xaf61('0xc'))(new Redis(config[_0xaf61('0xa')]));var redis=new Redis(config['redis']);function respondWithStatusCode(_0x4ba235,_0x54eed3){_0x54eed3=_0x54eed3||0xcc;return function(_0x55f58b){if(_0x55f58b){return _0x4ba235['sendStatus'](_0x54eed3);}return _0x4ba235['status'](_0x54eed3)[_0xaf61('0xd')]();};}function respondWithResult(_0x15e16d,_0x216972){_0x216972=_0x216972||0xc8;return function(_0x48f9bf){if(_0x48f9bf){return _0x15e16d[_0xaf61('0xe')](_0x216972)['json'](_0x48f9bf);}};}function respondWithFilteredResult(_0x292254,_0x30e627){return function(_0x3f1244){if(_0x3f1244){var _0x1f4960=typeof _0x30e627[_0xaf61('0xf')]===_0xaf61('0x10')&&typeof _0x30e627[_0xaf61('0x11')]===_0xaf61('0x10');var _0x32f344=_0x3f1244[_0xaf61('0x12')];var _0xbbc8ff=_0x1f4960?0x0:_0x30e627[_0xaf61('0xf')];var _0x529a55=_0x1f4960?_0x3f1244[_0xaf61('0x12')]:_0x30e627[_0xaf61('0xf')]+_0x30e627[_0xaf61('0x11')];var _0x12b407;if(_0x529a55>=_0x32f344){_0x529a55=_0x32f344;_0x12b407=0xc8;}else{_0x12b407=0xce;}_0x292254[_0xaf61('0xe')](_0x12b407);return _0x292254[_0xaf61('0x13')](_0xaf61('0x14'),_0xbbc8ff+'-'+_0x529a55+'/'+_0x32f344)['json'](_0x3f1244);}return null;};}function saveUpdates(_0x491fd4){return function(_0x453f51){if(_0x453f51){return _0x453f51[_0xaf61('0x15')](_0x491fd4)['then'](function(_0x1ed4dc){return _0x1ed4dc;});}return null;};}function removeEntity(_0x433320){return function(_0x4ce26d){if(_0x4ce26d){return _0x4ce26d[_0xaf61('0x16')]()[_0xaf61('0x17')](function(){_0x433320[_0xaf61('0xe')](0xcc)[_0xaf61('0xd')]();});}};}function handleEntityNotFound(_0x1b3d37){return function(_0x11e5ce){if(!_0x11e5ce){_0x1b3d37[_0xaf61('0x18')](0x194);}return _0x11e5ce;};}function handleError(_0x409b20,_0x4fbcae){_0x4fbcae=_0x4fbcae||0x1f4;return function(_0x1e6b95){logger['error'](_0x1e6b95['stack']);if(_0x1e6b95['name']){delete _0x1e6b95[_0xaf61('0x19')];}_0x409b20[_0xaf61('0xe')](_0x4fbcae)[_0xaf61('0x1a')](_0x1e6b95);};}function maskClientSecret(_0x51f177){return _['padEnd'](_0x51f177[_0xaf61('0x1b')](0x0,0x3),0x14,'*');}exports['index']=function(_0x2e6b3c,_0x5d9732){var _0x21df3e={},_0x1d5bac={},_0x5d1f7e={'count':0x0,'rows':[]};var _0x230784=_[_0xaf61('0x1c')](db[_0xaf61('0x1d')]['rawAttributes'],function(_0x1b5a47){return{'name':_0x1b5a47[_0xaf61('0x1e')],'type':_0x1b5a47[_0xaf61('0x1f')][_0xaf61('0x20')]};});_0x1d5bac[_0xaf61('0x21')]=_[_0xaf61('0x1c')](_0x230784,_0xaf61('0x19'));_0x1d5bac[_0xaf61('0x22')]=_[_0xaf61('0x23')](_0x2e6b3c[_0xaf61('0x22')]);_0x1d5bac[_0xaf61('0x24')]=_[_0xaf61('0x25')](_0x1d5bac[_0xaf61('0x21')],_0x1d5bac['query']);_0x21df3e['attributes']=_['intersection'](_0x1d5bac[_0xaf61('0x21')],qs['fields'](_0x2e6b3c[_0xaf61('0x22')]['fields']));_0x21df3e[_0xaf61('0x26')]=_0x21df3e['attributes']['length']?_0x21df3e[_0xaf61('0x26')]:_0x1d5bac[_0xaf61('0x21')];if(!_0x2e6b3c['query'][_0xaf61('0x27')]('nolimit')){_0x21df3e[_0xaf61('0x11')]=qs[_0xaf61('0x11')](_0x2e6b3c[_0xaf61('0x22')][_0xaf61('0x11')]);_0x21df3e[_0xaf61('0xf')]=qs['offset'](_0x2e6b3c[_0xaf61('0x22')][_0xaf61('0xf')]);}_0x21df3e['order']=qs[_0xaf61('0x28')](_0x2e6b3c['query']['sort']);_0x21df3e['where']=qs[_0xaf61('0x24')](_[_0xaf61('0x29')](_0x2e6b3c[_0xaf61('0x22')],_0x1d5bac[_0xaf61('0x24')]),_0x230784);if(_0x2e6b3c[_0xaf61('0x22')][_0xaf61('0x2a')]){_0x21df3e['where']=_[_0xaf61('0x2b')](_0x21df3e[_0xaf61('0x2c')],{'$or':_[_0xaf61('0x1c')](_0x230784,function(_0x5919c9){if(_0x5919c9[_0xaf61('0x1f')]!==_0xaf61('0x2d')){var _0x425343={};_0x425343[_0x5919c9[_0xaf61('0x19')]]={'$like':'%'+_0x2e6b3c[_0xaf61('0x22')][_0xaf61('0x2a')]+'%'};return _0x425343;}})});}_0x21df3e=_[_0xaf61('0x2b')]({},_0x21df3e,_0x2e6b3c[_0xaf61('0x2e')]);var _0x582c23={'where':_0x21df3e['where']};return db[_0xaf61('0x1d')]['count'](_0x582c23)[_0xaf61('0x17')](function(_0x2b52ca){_0x5d1f7e[_0xaf61('0x12')]=_0x2b52ca;if(_0x2e6b3c[_0xaf61('0x22')]['includeAll']){_0x21df3e[_0xaf61('0x2f')]=[{'all':!![]}];}return db[_0xaf61('0x1d')][_0xaf61('0x30')](_0x21df3e);})[_0xaf61('0x17')](function(_0x55e727){_0x5d1f7e[_0xaf61('0x31')]=_[_0xaf61('0x1c')](_0x55e727,function(_0xfeeafc){if(_0xfeeafc['service']===_0xaf61('0x32')){var _0x273b26=encryptor['decryptString'](_0xfeeafc[_0xaf61('0x33')]);_0xfeeafc[_0xaf61('0x33')]=maskClientSecret(_0x273b26);}return _0xfeeafc;});return _0x5d1f7e;})[_0xaf61('0x17')](respondWithFilteredResult(_0x5d9732,_0x21df3e))[_0xaf61('0x34')](handleError(_0x5d9732,null));};exports['show']=function(_0x41e509,_0x11e742){var _0x101a4a={'raw':!![],'where':{'id':_0x41e509['params']['id']}},_0x2b1223={};_0x2b1223[_0xaf61('0x21')]=_[_0xaf61('0x23')](db[_0xaf61('0x1d')][_0xaf61('0x35')]);_0x2b1223[_0xaf61('0x22')]=_[_0xaf61('0x23')](_0x41e509[_0xaf61('0x22')]);_0x2b1223[_0xaf61('0x24')]=_[_0xaf61('0x25')](_0x2b1223[_0xaf61('0x21')],_0x2b1223[_0xaf61('0x22')]);_0x101a4a['attributes']=_['intersection'](_0x2b1223[_0xaf61('0x21')],qs[_0xaf61('0x36')](_0x41e509[_0xaf61('0x22')]['fields']));_0x101a4a[_0xaf61('0x26')]=_0x101a4a[_0xaf61('0x26')][_0xaf61('0x37')]?_0x101a4a['attributes']:_0x2b1223[_0xaf61('0x21')];if(_0x41e509[_0xaf61('0x22')][_0xaf61('0x38')]){_0x101a4a[_0xaf61('0x2f')]=[{'all':!![]}];}_0x101a4a=_['merge']({},_0x101a4a,_0x41e509[_0xaf61('0x2e')]);return db[_0xaf61('0x1d')][_0xaf61('0x39')](_0x101a4a)[_0xaf61('0x17')](handleEntityNotFound(_0x11e742,null))[_0xaf61('0x17')](function(_0x777cf){if(_0x777cf['service']==='MicrosoftAzure'){var _0x226a6c=encryptor[_0xaf61('0x3a')](_0x777cf[_0xaf61('0x33')]);_0x777cf[_0xaf61('0x33')]=maskClientSecret(_0x226a6c);}return _0x777cf;})[_0xaf61('0x17')](respondWithResult(_0x11e742,null))[_0xaf61('0x34')](handleError(_0x11e742,null));};exports[_0xaf61('0x3b')]=function(_0x3a52a3,_0x1df4cb){if(!_0x3a52a3[_0xaf61('0x3c')][_0xaf61('0x19')])throw new Error(_0xaf61('0x3d'));if(!_0x3a52a3['body'][_0xaf61('0x3e')])throw new Error(_0xaf61('0x3f'));var _0x39824e=db[_0xaf61('0x1d')][_0xaf61('0x35')][_0xaf61('0x3e')][_0xaf61('0x40')];if(!_0x39824e[_0xaf61('0x41')](_0x3a52a3[_0xaf61('0x3c')][_0xaf61('0x3e')]))throw new Error('Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20'+_0x39824e[_0xaf61('0x42')](',\x20'));if(_0x3a52a3[_0xaf61('0x3c')]['service']==='MicrosoftAzure'&&_0x3a52a3[_0xaf61('0x3c')]['data3']){_0x3a52a3['body'][_0xaf61('0x33')]=encryptor[_0xaf61('0x43')](_0x3a52a3[_0xaf61('0x3c')][_0xaf61('0x33')]);}return db[_0xaf61('0x1d')][_0xaf61('0x3b')](_0x3a52a3['body'],{})['then'](respondWithResult(_0x1df4cb,0xc9))[_0xaf61('0x34')](handleError(_0x1df4cb,null));};exports[_0xaf61('0x15')]=function(_0x4e510b,_0x2b5a25){if(_0x4e510b[_0xaf61('0x3c')]['id']){delete _0x4e510b[_0xaf61('0x3c')]['id'];}return db[_0xaf61('0x1d')]['find']({'where':{'id':_0x4e510b[_0xaf61('0x44')]['id']}})[_0xaf61('0x17')](handleEntityNotFound(_0x2b5a25,null))['then'](function(_0x5139db){if(_0x5139db[_0xaf61('0x3e')]===_0xaf61('0x32')&&_0x4e510b['body']['data3']){_0x4e510b[_0xaf61('0x3c')][_0xaf61('0x33')]=encryptor[_0xaf61('0x43')](_0x4e510b[_0xaf61('0x3c')]['data3']);}return _0x5139db;})[_0xaf61('0x17')](saveUpdates(_0x4e510b[_0xaf61('0x3c')],null))[_0xaf61('0x17')](respondWithResult(_0x2b5a25,null))[_0xaf61('0x34')](handleError(_0x2b5a25,null));};exports[_0xaf61('0x16')]=function(_0x5767be,_0x11ea7f){return db[_0xaf61('0x1d')][_0xaf61('0x39')]({'where':{'id':_0x5767be[_0xaf61('0x44')]['id']}})[_0xaf61('0x17')](handleEntityNotFound(_0x11ea7f,null))[_0xaf61('0x17')](removeEntity(_0x11ea7f,null))[_0xaf61('0x34')](handleError(_0x11ea7f,null));};exports[_0xaf61('0x45')]=function(_0x50f02b,_0x3bdfbf){return db[_0xaf61('0x1d')]['findOne']({'where':{'id':_0x50f02b['params']['id']},'raw':!![]})[_0xaf61('0x17')](function(_0x2f18db){if(!_0x2f18db)return _0x3bdfbf[_0xaf61('0x18')](0x194);return{'url':oauth['generateMicrosoftAuthorizationUrl'](_0x2f18db,_0x50f02b['user']['id'])};})[_0xaf61('0x17')](respondWithResult(_0x3bdfbf,null))['catch'](handleError(_0x3bdfbf,null));};exports[_0xaf61('0x46')]=function(_0x22ee74,_0x317cbd){var _0x12039d=_0x22ee74[_0xaf61('0x3c')];var _0x28b4c5;var _0x18488a;if(_0x12039d[_0xaf61('0x47')])throw _0x12039d;redis[_0xaf61('0x48')](_0x12039d['state'])['then'](function(_0x18ff69){if(!_0x18ff69)throw new Error('Invalid\x20state\x20parameter');_0x28b4c5=JSON[_0xaf61('0x49')](_0x18ff69);var _0x23cc76=Buffer['from'](_0x12039d[_0xaf61('0x4a')],_0xaf61('0x4b'))[_0xaf61('0x4c')](_0xaf61('0x4d'));_0x18488a=JSON[_0xaf61('0x49')](_0x23cc76);if(!oauth['isValidIdToken'](_0x12039d[_0xaf61('0x4e')],_0x28b4c5[_0xaf61('0x4f')]))throw new Error(_0xaf61('0x50'));redis[_0xaf61('0x51')](_0x12039d[_0xaf61('0x4a')]);return oauth[_0xaf61('0x52')](_0x12039d[_0xaf61('0x53')],_0x28b4c5);})['then'](function(_0x207fe3){_0x28b4c5[_0xaf61('0x54')]=_0x207fe3[_0xaf61('0x55')];_0x28b4c5[_0xaf61('0x56')]=_0x207fe3[_0xaf61('0x57')];return db['CloudProvider'][_0xaf61('0x15')]({'data5':_0x28b4c5[_0xaf61('0x54')],'data6':_0x28b4c5[_0xaf61('0x56')]},{'where':{'id':_0x28b4c5['id']}});})[_0xaf61('0x17')](function(){oauth['startRefreshInterval'](_0x28b4c5);socket['emit'](_0xaf61('0x58'),{'id':_0x18488a['id']});return;})['then'](respondWithStatusCode(_0x317cbd,null))[_0xaf61('0x34')](function(_0x28941c){if(_0x18488a){socket[_0xaf61('0x59')](_0xaf61('0x5a'),{'id':_0x18488a['id']});}if(!_0x28b4c5){logger[_0xaf61('0x47')](_0xaf61('0x5b'),_0x28941c);return _0x317cbd[_0xaf61('0xe')](0x1f4)[_0xaf61('0x1a')](_0x28941c[_0xaf61('0x5c')]);}logger[_0xaf61('0x47')]('Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s',_0x28b4c5['id'],JSON['stringify'](_0x28941c));});}; \ No newline at end of file +var _0xed4a=['then','end','stack','name','send','slice','map','CloudProvider','rawAttributes','fieldName','type','model','query','keys','intersection','attributes','fields','hasOwnProperty','order','sort','where','filters','pick','filter','VIRTUAL','options','includeAll','findAll','rows','decryptString','data3','catch','show','params','length','include','service','MicrosoftAzure','create','body','Name\x20parameter\x20not\x20specified','Service\x20parameter\x20not\x20specified','values','includes','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','join','encryptString','find','findOne','generateMicrosoftAuthorizationUrl','user','oauth2MicrosoftCallback','error','get','state','base64','toString','parse','Unable\x20to\x20validate\x20id_token','getOauth2MicrosoftAccessToken','code','data5','data6','refresh_token','startRefreshInterval','emit','microsoftAuthorization:success','Invalid\x20authentication\x20state\x20parameter','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','stringify','ioredis','../../components/parsers/qs','../../components/encryptor','../../config/environment','../../config/logger','api','redis','defaults','localhost','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','update','destroy'];(function(_0x4b281a,_0x1733de){var _0x3149a7=function(_0x3a6b40){while(--_0x3a6b40){_0x4b281a['push'](_0x4b281a['shift']());}};_0x3149a7(++_0x1733de);}(_0xed4a,0xfa));var _0xaed4=function(_0x6a239e,_0x1cf0e4){_0x6a239e=_0x6a239e-0x0;var _0x3f3cce=_0xed4a[_0x6a239e];return _0x3f3cce;};'use strict';var _=require('lodash');var Redis=require(_0xaed4('0x0'));var qs=require(_0xaed4('0x1'));var encryptor=require(_0xaed4('0x2'));var config=require(_0xaed4('0x3'));var logger=require(_0xaed4('0x4'))(_0xaed4('0x5'));var db=require('../../mysqldb')['db'];var oauth=require('./cloudProvider.oauth');config[_0xaed4('0x6')]=_[_0xaed4('0x7')](config['redis'],{'host':_0xaed4('0x8'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xaed4('0x6')]));var redis=new Redis(config['redis']);function respondWithStatusCode(_0xdf809d,_0x2318f2){_0x2318f2=_0x2318f2||0xcc;return function(_0x40d87c){if(_0x40d87c){return _0xdf809d[_0xaed4('0x9')](_0x2318f2);}return _0xdf809d[_0xaed4('0xa')](_0x2318f2)['end']();};}function respondWithResult(_0x4e5a80,_0x34aca6){_0x34aca6=_0x34aca6||0xc8;return function(_0x3a78b0){if(_0x3a78b0){return _0x4e5a80['status'](_0x34aca6)[_0xaed4('0xb')](_0x3a78b0);}};}function respondWithFilteredResult(_0x10c588,_0x5a8d83){return function(_0x2b03d6){if(_0x2b03d6){var _0x228fbd=typeof _0x5a8d83[_0xaed4('0xc')]===_0xaed4('0xd')&&typeof _0x5a8d83[_0xaed4('0xe')]===_0xaed4('0xd');var _0x1d9d89=_0x2b03d6[_0xaed4('0xf')];var _0x3a62ee=_0x228fbd?0x0:_0x5a8d83[_0xaed4('0xc')];var _0x23b8ca=_0x228fbd?_0x2b03d6['count']:_0x5a8d83['offset']+_0x5a8d83[_0xaed4('0xe')];var _0x321023;if(_0x23b8ca>=_0x1d9d89){_0x23b8ca=_0x1d9d89;_0x321023=0xc8;}else{_0x321023=0xce;}_0x10c588[_0xaed4('0xa')](_0x321023);return _0x10c588[_0xaed4('0x10')](_0xaed4('0x11'),_0x3a62ee+'-'+_0x23b8ca+'/'+_0x1d9d89)[_0xaed4('0xb')](_0x2b03d6);}return null;};}function saveUpdates(_0x4cdbf2){return function(_0x21582e){if(_0x21582e){return _0x21582e[_0xaed4('0x12')](_0x4cdbf2)['then'](function(_0x35ce6c){return _0x35ce6c;});}return null;};}function removeEntity(_0x5267ec){return function(_0x5d6534){if(_0x5d6534){return _0x5d6534[_0xaed4('0x13')]()[_0xaed4('0x14')](function(){_0x5267ec[_0xaed4('0xa')](0xcc)[_0xaed4('0x15')]();});}};}function handleEntityNotFound(_0x2a9149){return function(_0x56552e){if(!_0x56552e){_0x2a9149[_0xaed4('0x9')](0x194);}return _0x56552e;};}function handleError(_0x2475c9,_0x59208e){_0x59208e=_0x59208e||0x1f4;return function(_0x116a9e){logger['error'](_0x116a9e[_0xaed4('0x16')]);if(_0x116a9e['name']){delete _0x116a9e[_0xaed4('0x17')];}_0x2475c9['status'](_0x59208e)[_0xaed4('0x18')](_0x116a9e);};}function maskClientSecret(_0x4c205c){return _['padEnd'](_0x4c205c[_0xaed4('0x19')](0x0,0x3),0x14,'*');}exports['index']=function(_0x2d5f85,_0x667e1e){var _0xa84b0={},_0x281b45={},_0x4f57d9={'count':0x0,'rows':[]};var _0x104074=_[_0xaed4('0x1a')](db[_0xaed4('0x1b')][_0xaed4('0x1c')],function(_0x36c761){return{'name':_0x36c761[_0xaed4('0x1d')],'type':_0x36c761[_0xaed4('0x1e')]['key']};});_0x281b45[_0xaed4('0x1f')]=_[_0xaed4('0x1a')](_0x104074,_0xaed4('0x17'));_0x281b45[_0xaed4('0x20')]=_[_0xaed4('0x21')](_0x2d5f85['query']);_0x281b45['filters']=_[_0xaed4('0x22')](_0x281b45[_0xaed4('0x1f')],_0x281b45[_0xaed4('0x20')]);_0xa84b0[_0xaed4('0x23')]=_[_0xaed4('0x22')](_0x281b45['model'],qs[_0xaed4('0x24')](_0x2d5f85[_0xaed4('0x20')]['fields']));_0xa84b0['attributes']=_0xa84b0[_0xaed4('0x23')]['length']?_0xa84b0['attributes']:_0x281b45[_0xaed4('0x1f')];if(!_0x2d5f85[_0xaed4('0x20')][_0xaed4('0x25')]('nolimit')){_0xa84b0['limit']=qs['limit'](_0x2d5f85[_0xaed4('0x20')][_0xaed4('0xe')]);_0xa84b0[_0xaed4('0xc')]=qs[_0xaed4('0xc')](_0x2d5f85[_0xaed4('0x20')][_0xaed4('0xc')]);}_0xa84b0[_0xaed4('0x26')]=qs['sort'](_0x2d5f85[_0xaed4('0x20')][_0xaed4('0x27')]);_0xa84b0[_0xaed4('0x28')]=qs[_0xaed4('0x29')](_[_0xaed4('0x2a')](_0x2d5f85['query'],_0x281b45[_0xaed4('0x29')]),_0x104074);if(_0x2d5f85[_0xaed4('0x20')][_0xaed4('0x2b')]){_0xa84b0[_0xaed4('0x28')]=_['merge'](_0xa84b0[_0xaed4('0x28')],{'$or':_[_0xaed4('0x1a')](_0x104074,function(_0x3fa738){if(_0x3fa738[_0xaed4('0x1e')]!==_0xaed4('0x2c')){var _0x265a4c={};_0x265a4c[_0x3fa738[_0xaed4('0x17')]]={'$like':'%'+_0x2d5f85['query'][_0xaed4('0x2b')]+'%'};return _0x265a4c;}})});}_0xa84b0=_['merge']({},_0xa84b0,_0x2d5f85[_0xaed4('0x2d')]);var _0x4afa9a={'where':_0xa84b0[_0xaed4('0x28')]};return db[_0xaed4('0x1b')][_0xaed4('0xf')](_0x4afa9a)['then'](function(_0x385193){_0x4f57d9[_0xaed4('0xf')]=_0x385193;if(_0x2d5f85[_0xaed4('0x20')][_0xaed4('0x2e')]){_0xa84b0['include']=[{'all':!![]}];}return db['CloudProvider'][_0xaed4('0x2f')](_0xa84b0);})[_0xaed4('0x14')](function(_0x4421e8){_0x4f57d9[_0xaed4('0x30')]=_[_0xaed4('0x1a')](_0x4421e8,function(_0x4a16e4){if(_0x4a16e4['service']==='MicrosoftAzure'){var _0x4c5e63=encryptor[_0xaed4('0x31')](_0x4a16e4[_0xaed4('0x32')]);_0x4a16e4[_0xaed4('0x32')]=maskClientSecret(_0x4c5e63);}return _0x4a16e4;});return _0x4f57d9;})['then'](respondWithFilteredResult(_0x667e1e,_0xa84b0))[_0xaed4('0x33')](handleError(_0x667e1e,null));};exports[_0xaed4('0x34')]=function(_0x1e75e0,_0x95f08a){var _0x5db455={'raw':!![],'where':{'id':_0x1e75e0[_0xaed4('0x35')]['id']}},_0xee38c2={};_0xee38c2['model']=_[_0xaed4('0x21')](db[_0xaed4('0x1b')][_0xaed4('0x1c')]);_0xee38c2['query']=_[_0xaed4('0x21')](_0x1e75e0['query']);_0xee38c2['filters']=_[_0xaed4('0x22')](_0xee38c2[_0xaed4('0x1f')],_0xee38c2['query']);_0x5db455[_0xaed4('0x23')]=_[_0xaed4('0x22')](_0xee38c2[_0xaed4('0x1f')],qs[_0xaed4('0x24')](_0x1e75e0[_0xaed4('0x20')]['fields']));_0x5db455['attributes']=_0x5db455[_0xaed4('0x23')][_0xaed4('0x36')]?_0x5db455[_0xaed4('0x23')]:_0xee38c2[_0xaed4('0x1f')];if(_0x1e75e0[_0xaed4('0x20')][_0xaed4('0x2e')]){_0x5db455[_0xaed4('0x37')]=[{'all':!![]}];}_0x5db455=_['merge']({},_0x5db455,_0x1e75e0[_0xaed4('0x2d')]);return db['CloudProvider']['find'](_0x5db455)['then'](handleEntityNotFound(_0x95f08a,null))[_0xaed4('0x14')](function(_0x3f6aa9){if(_0x3f6aa9[_0xaed4('0x38')]===_0xaed4('0x39')){var _0x230686=encryptor[_0xaed4('0x31')](_0x3f6aa9['data3']);_0x3f6aa9[_0xaed4('0x32')]=maskClientSecret(_0x230686);}return _0x3f6aa9;})[_0xaed4('0x14')](respondWithResult(_0x95f08a,null))[_0xaed4('0x33')](handleError(_0x95f08a,null));};exports[_0xaed4('0x3a')]=function(_0x507f8a,_0x294525){if(!_0x507f8a[_0xaed4('0x3b')][_0xaed4('0x17')])throw new Error(_0xaed4('0x3c'));if(!_0x507f8a[_0xaed4('0x3b')][_0xaed4('0x38')])throw new Error(_0xaed4('0x3d'));var _0x6bf1bd=db['CloudProvider'][_0xaed4('0x1c')][_0xaed4('0x38')][_0xaed4('0x3e')];if(!_0x6bf1bd[_0xaed4('0x3f')](_0x507f8a[_0xaed4('0x3b')]['service']))throw new Error(_0xaed4('0x40')+_0x6bf1bd[_0xaed4('0x41')](',\x20'));if(_0x507f8a['body'][_0xaed4('0x38')]===_0xaed4('0x39')&&_0x507f8a['body'][_0xaed4('0x32')]){_0x507f8a[_0xaed4('0x3b')]['data3']=encryptor[_0xaed4('0x42')](_0x507f8a[_0xaed4('0x3b')]['data3']);}return db[_0xaed4('0x1b')][_0xaed4('0x3a')](_0x507f8a['body'],{})[_0xaed4('0x14')](respondWithResult(_0x294525,0xc9))['catch'](handleError(_0x294525,null));};exports['update']=function(_0x54d4a2,_0x264878){if(_0x54d4a2[_0xaed4('0x3b')]['id']){delete _0x54d4a2[_0xaed4('0x3b')]['id'];}return db[_0xaed4('0x1b')][_0xaed4('0x43')]({'where':{'id':_0x54d4a2[_0xaed4('0x35')]['id']}})[_0xaed4('0x14')](handleEntityNotFound(_0x264878,null))[_0xaed4('0x14')](function(_0x37ca7b){if(_0x37ca7b[_0xaed4('0x38')]===_0xaed4('0x39')&&_0x54d4a2['body']['data3']){_0x54d4a2[_0xaed4('0x3b')]['data3']=encryptor[_0xaed4('0x42')](_0x54d4a2[_0xaed4('0x3b')][_0xaed4('0x32')]);}return _0x37ca7b;})[_0xaed4('0x14')](saveUpdates(_0x54d4a2[_0xaed4('0x3b')],null))[_0xaed4('0x14')](respondWithResult(_0x264878,null))[_0xaed4('0x33')](handleError(_0x264878,null));};exports[_0xaed4('0x13')]=function(_0x3cbc66,_0x178513){return db['CloudProvider'][_0xaed4('0x43')]({'where':{'id':_0x3cbc66[_0xaed4('0x35')]['id']}})[_0xaed4('0x14')](handleEntityNotFound(_0x178513,null))[_0xaed4('0x14')](removeEntity(_0x178513,null))[_0xaed4('0x33')](handleError(_0x178513,null));};exports['oauth2MicrosoftAuthorize']=function(_0x369c9b,_0x3a971a){return db[_0xaed4('0x1b')][_0xaed4('0x44')]({'where':{'id':_0x369c9b[_0xaed4('0x35')]['id']},'raw':!![]})['then'](function(_0x5b21b8){if(!_0x5b21b8)return _0x3a971a[_0xaed4('0x9')](0x194);return{'url':oauth[_0xaed4('0x45')](_0x5b21b8,_0x369c9b[_0xaed4('0x46')]['id'])};})['then'](respondWithResult(_0x3a971a,null))[_0xaed4('0x33')](handleError(_0x3a971a,null));};exports[_0xaed4('0x47')]=function(_0x41c6c9,_0x4c5a40){var _0xbaae57=_0x41c6c9[_0xaed4('0x3b')];var _0x19379c;var _0x16b9a2;if(_0xbaae57[_0xaed4('0x48')])throw _0xbaae57;redis[_0xaed4('0x49')](_0xbaae57['state'])[_0xaed4('0x14')](function(_0x2cc01a){if(!_0x2cc01a)throw new Error('Invalid\x20state\x20parameter');_0x19379c=JSON['parse'](_0x2cc01a);var _0x478edc=Buffer['from'](_0xbaae57[_0xaed4('0x4a')],_0xaed4('0x4b'))[_0xaed4('0x4c')]('ascii');_0x16b9a2=JSON[_0xaed4('0x4d')](_0x478edc);if(!oauth['isValidIdToken'](_0xbaae57['id_token'],_0x19379c['oauth2Claims']))throw new Error(_0xaed4('0x4e'));redis['del'](_0xbaae57[_0xaed4('0x4a')]);return oauth[_0xaed4('0x4f')](_0xbaae57[_0xaed4('0x50')],_0x19379c);})['then'](function(_0x4320c9){_0x19379c[_0xaed4('0x51')]=_0x4320c9['access_token'];_0x19379c[_0xaed4('0x52')]=_0x4320c9[_0xaed4('0x53')];return db['CloudProvider'][_0xaed4('0x12')]({'data5':_0x19379c[_0xaed4('0x51')],'data6':_0x19379c[_0xaed4('0x52')]},{'where':{'id':_0x19379c['id']}});})[_0xaed4('0x14')](function(){oauth[_0xaed4('0x54')](_0x19379c);socket[_0xaed4('0x55')](_0xaed4('0x56'),{'id':_0x16b9a2['id']});return;})[_0xaed4('0x14')](respondWithStatusCode(_0x4c5a40,null))[_0xaed4('0x33')](function(_0x34c5fe){if(_0x16b9a2){socket['emit']('microsoftAuthorization:error',{'id':_0x16b9a2['id']});}if(!_0x19379c){logger[_0xaed4('0x48')](_0xaed4('0x57'),_0x34c5fe);return _0x4c5a40[_0xaed4('0xa')](0x1f4)[_0xaed4('0x18')](_0x34c5fe['message']);}logger[_0xaed4('0x48')](_0xaed4('0x58'),_0x19379c['id'],JSON[_0xaed4('0x59')](_0x34c5fe));});}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js index f97375c..539a771 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 _0x9337=['moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','CloudProvider','cloud_providers','lodash','util','../../config/logger','api'];(function(_0x59c301,_0x359c50){var _0x3866b9=function(_0x2d380e){while(--_0x2d380e){_0x59c301['push'](_0x59c301['shift']());}};_0x3866b9(++_0x359c50);}(_0x9337,0xb2));var _0x7933=function(_0x4b581e,_0x5ed7dc){_0x4b581e=_0x4b581e-0x0;var _0x69a64d=_0x9337[_0x4b581e];return _0x69a64d;};'use strict';var _=require(_0x7933('0x0'));var util=require(_0x7933('0x1'));var logger=require(_0x7933('0x2'))(_0x7933('0x3'));var moment=require(_0x7933('0x4'));var BPromise=require(_0x7933('0x5'));var rp=require(_0x7933('0x6'));var fs=require('fs');var path=require(_0x7933('0x7'));var rimraf=require(_0x7933('0x8'));var config=require(_0x7933('0x9'));var attributes=require('./cloudProvider.attributes');module[_0x7933('0xa')]=function(_0x25e492,_0x32827e){return _0x25e492['define'](_0x7933('0xb'),attributes,{'tableName':_0x7933('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x63de=['cloud_providers','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./cloudProvider.attributes','exports','define','CloudProvider'];(function(_0xb70791,_0x1d91d6){var _0x48f939=function(_0x591c48){while(--_0x591c48){_0xb70791['push'](_0xb70791['shift']());}};_0x48f939(++_0x1d91d6);}(_0x63de,0x1eb));var _0xe63d=function(_0x2d57a6,_0x50f1ad){_0x2d57a6=_0x2d57a6-0x0;var _0x1c8d8f=_0x63de[_0x2d57a6];return _0x1c8d8f;};'use strict';var _=require(_0xe63d('0x0'));var util=require(_0xe63d('0x1'));var logger=require(_0xe63d('0x2'))(_0xe63d('0x3'));var moment=require(_0xe63d('0x4'));var BPromise=require(_0xe63d('0x5'));var rp=require(_0xe63d('0x6'));var fs=require('fs');var path=require(_0xe63d('0x7'));var rimraf=require('rimraf');var config=require(_0xe63d('0x8'));var attributes=require(_0xe63d('0x9'));module[_0xe63d('0xa')]=function(_0x162007,_0xf581f4){return _0x162007[_0xe63d('0xb')](_0xe63d('0xc'),attributes,{'tableName':_0xe63d('0xd'),'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 141390a..0a261ab 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 _0xc8ce=['login','key','value','oauth2/','set','decode','payload','iss','issuer','aud','isAfter','unix','exp','resolve','data3','CloudProvider','findOne','then','refresh_token','data6','data4','decryptString','POST','update','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','authorization_code','intervals','findAll','all','catch','inspect','error','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','exports','moment','../../components/encryptor','../../config/logger','api','../../mysqldb','redis','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','email','offline_access','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/POP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','openid','/authorize','map','type','Dynamics365','push','data7','/.default','join','Outlook365','replace','data2','id_token','from','stringify','toString','hex','client_id','data1','response_type','response_mode','scope','state','nonce','prompt'];(function(_0x5403ec,_0x372801){var _0x413815=function(_0x2c8f60){while(--_0x2c8f60){_0x5403ec['push'](_0x5403ec['shift']());}};_0x413815(++_0x372801);}(_0xc8ce,0x69));var _0xec8c=function(_0xdd827a,_0x482ad2){_0xdd827a=_0xdd827a-0x0;var _0x2f46f1=_0xc8ce[_0xdd827a];return _0x2f46f1;};'use strict';var _=require('lodash');var crypto=require('crypto');var jwt=require('jsonwebtoken');var moment=require(_0xec8c('0x0'));var Redis=require('ioredis');var rp=require('request-promise');var util=require('util');var encryptor=require(_0xec8c('0x1'));var config=require('../../config/environment');var logger=require(_0xec8c('0x2'))(_0xec8c('0x3'));var schedule=require('../../config/schedule/cloud-provider');var db=require(_0xec8c('0x4'))['db'];config[_0xec8c('0x5')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var redis=new Redis(config['redis']);var MICROSOFT_AUTH_URL=_0xec8c('0x6');var AZURE_AUTH_SCOPES={'Outlook365':['openid','profile',_0xec8c('0x7'),_0xec8c('0x8'),_0xec8c('0x9'),_0xec8c('0xa'),_0xec8c('0xb')],'Dynamics365':[_0xec8c('0xc'),_0xec8c('0x8')]};var MICROSOFT_AUTH_ENDPOINT=_0xec8c('0xd');var MICROSOFT_TOKEN_ENDPOINT='/token';var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x1136b0){var _0x126d8b=_[_0xec8c('0xe')](AZURE_AUTH_SCOPES[_0x1136b0[_0xec8c('0xf')]]);if(_0x1136b0[_0xec8c('0xf')]===_0xec8c('0x10'))_0x126d8b[_0xec8c('0x11')](_0x1136b0[_0xec8c('0x12')]+_0xec8c('0x13'));return _0x126d8b[_0xec8c('0x14')]('\x20');}function getAccessTokenScope(_0x2890b4){if(_0x2890b4[_0xec8c('0xf')]===_0xec8c('0x15'))return'https://outlook.office365.com/IMAP.AccessAsUser.All';if(_0x2890b4[_0xec8c('0xf')]===_0xec8c('0x10'))return _0x2890b4[_0xec8c('0x12')]+_0xec8c('0x13');}function generateMicrosoftAuthorizationUrl(_0x353a0f,_0x51a27e){var _0x2fe139=MICROSOFT_AUTH_URL[_0xec8c('0x16')]('{TENANT_ID}',_0x353a0f[_0xec8c('0x17')]);var _0x172715=['code',_0xec8c('0x18')];var _0x46a9f6=Buffer[_0xec8c('0x19')](JSON[_0xec8c('0x1a')]({'id':_0x51a27e}))[_0xec8c('0x1b')]('base64');var _0x20d86a=crypto['randomBytes'](0x10)[_0xec8c('0x1b')](_0xec8c('0x1c'));var _0x1b034f=getAuthorizationScopes(_0x353a0f);var _0x4a184e=[{'key':_0xec8c('0x1d'),'value':_0x353a0f[_0xec8c('0x1e')]},{'key':_0xec8c('0x1f'),'value':encodeURIComponent(_0x172715[_0xec8c('0x14')]('\x20'))},{'key':'redirect_uri','value':_0x353a0f['data4']},{'key':_0xec8c('0x20'),'value':'form_post'},{'key':_0xec8c('0x21'),'value':encodeURIComponent(_0x1b034f)},{'key':_0xec8c('0x22'),'value':_0x46a9f6},{'key':_0xec8c('0x23'),'value':_0x20d86a},{'key':_0xec8c('0x24'),'value':_0xec8c('0x25')}];var _0x39a6cf=_0x2fe139+MICROSOFT_AUTH_ENDPOINT+'?'+_['map'](_0x4a184e,function(_0x58e23d){return _0x58e23d[_0xec8c('0x26')]+'='+_0x58e23d[_0xec8c('0x27')];})[_0xec8c('0x14')]('&');_0x353a0f['oauth2Claims']={'issuer':_0x2fe139['replace'](_0xec8c('0x28'),''),'audience':_0x353a0f[_0xec8c('0x1e')],'state':_0x46a9f6,'nonce':_0x20d86a};redis[_0xec8c('0x29')](_0x46a9f6,JSON[_0xec8c('0x1a')](_0x353a0f));return _0x39a6cf;}function isValidIdToken(_0x36ea8d,_0x37f2e2){try{var _0x4c0c2d=jwt[_0xec8c('0x2a')](_0x36ea8d,{'complete':!![]});var _0x1bac6d=_0x4c0c2d[_0xec8c('0x2b')];if(_0x1bac6d[_0xec8c('0x2c')]!==_0x37f2e2[_0xec8c('0x2d')])return![];if(_0x1bac6d[_0xec8c('0x2e')]!==_0x37f2e2['audience'])return![];if(_0x1bac6d[_0xec8c('0x23')]!==_0x37f2e2[_0xec8c('0x23')])return![];if(moment()[_0xec8c('0x2f')](moment[_0xec8c('0x30')](_0x1bac6d[_0xec8c('0x31')])))return![];return!![];}catch(_0x13773b){throw _0x13773b;}}function refreshOauth2MicrosoftAccessToken(_0x54350e){return Promise[_0xec8c('0x32')]()['then'](function(){if(_0x54350e[_0xec8c('0x33')])return _0x54350e;return db[_0xec8c('0x34')][_0xec8c('0x35')]({'where':{'id':_0x54350e['id']},'raw':!![]});})[_0xec8c('0x36')](function(_0x41f297){var _0x276e4f={'grant_type':_0xec8c('0x37'),'refresh_token':_0x41f297[_0xec8c('0x38')],'scope':getAccessTokenScope(_0x41f297),'redirect_uri':_0x41f297[_0xec8c('0x39')],'client_id':_0x41f297[_0xec8c('0x1e')],'client_secret':encryptor[_0xec8c('0x3a')](_0x41f297['data3'])};var _0x32608c={'method':_0xec8c('0x3b'),'uri':MICROSOFT_AUTH_URL['replace']('{TENANT_ID}',_0x41f297[_0xec8c('0x17')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x276e4f,'json':!![]};return rp(_0x32608c);})[_0xec8c('0x36')](function(_0x26b38b){_0x54350e['data5']=_0x26b38b['access_token'];_0x54350e['data6']=_0x26b38b['refresh_token'];return db[_0xec8c('0x34')][_0xec8c('0x3c')]({'data5':_0x54350e['data5'],'data6':_0x54350e[_0xec8c('0x38')]},{'where':{'id':_0x54350e['id']}});})[_0xec8c('0x36')](function(){return _0x54350e;})['catch'](function(_0x4ca4e3){logger['error'](_0xec8c('0x3d'),_0x54350e['id'],_0x4ca4e3);});}function getOauth2MicrosoftAccessToken(_0x203222,_0x233cb2){var _0x42176a={'grant_type':_0xec8c('0x3e'),'code':_0x203222,'scope':getAccessTokenScope(_0x233cb2),'redirect_uri':_0x233cb2[_0xec8c('0x39')],'client_id':_0x233cb2['data1'],'client_secret':encryptor['decryptString'](_0x233cb2[_0xec8c('0x33')])};var _0x155ec5={'method':_0xec8c('0x3b'),'uri':MICROSOFT_AUTH_URL[_0xec8c('0x16')]('{TENANT_ID}',_0x233cb2[_0xec8c('0x17')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x42176a,'json':!![]};return rp(_0x155ec5);}function startRefreshInterval(_0x402eca){var _0x2a9989=schedule[_0xec8c('0x3f')];if(_0x2a9989[_0x402eca['id']])clearInterval(_0x2a9989[_0x402eca['id']]);_0x2a9989[_0x402eca['id']]=setInterval(refreshOauth2MicrosoftAccessToken['bind'](this,{'id':_0x402eca['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule['intervals']=_0x2a9989;}function startAllRefreshIntervals(){return db['CloudProvider'][_0xec8c('0x40')]({'where':{'data6':{'$ne':null}},'raw':!![]})[_0xec8c('0x36')](function(_0x16d13b){var _0x105bd7=_0x16d13b[_0xec8c('0xe')](function(_0x70bb87){return refreshOauth2MicrosoftAccessToken(_0x70bb87)[_0xec8c('0x36')](function(_0x36a46d){startRefreshInterval(_0x36a46d);});});return Promise[_0xec8c('0x41')](_0x105bd7);})[_0xec8c('0x42')](function(_0x20e7af){var _0x2184ca=_0x20e7af?util[_0xec8c('0x43')](_0x20e7af,{'showHidden':![],'depth':null}):'';logger[_0xec8c('0x44')](_0xec8c('0x45'),_0x2184ca);});}module[_0xec8c('0x46')]={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval}; \ No newline at end of file +var _0x0767=['oauth2/','data1','set','stringify','decode','payload','iss','issuer','aud','audience','nonce','isAfter','exp','then','data3','CloudProvider','refresh_token','data4','POST','{TENANT_ID}','data5','access_token','data6','update','catch','error','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','authorization_code','decryptString','bind','intervals','findAll','all','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','exports','lodash','crypto','jsonwebtoken','moment','ioredis','request-promise','../../components/encryptor','../../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','https://outlook.office365.com/IMAP.AccessAsUser.All','offline_access','/authorize','/token','type','push','data7','join','Outlook365','Dynamics365','/.default','replace','data2','code','id_token','base64','randomBytes','toString','hex','client_id','response_type','redirect_uri','response_mode','form_post','scope','state','prompt','login','map'];(function(_0x16e1d5,_0x26b53b){var _0x534f2c=function(_0x324736){while(--_0x324736){_0x16e1d5['push'](_0x16e1d5['shift']());}};_0x534f2c(++_0x26b53b);}(_0x0767,0x1c2));var _0x7076=function(_0x14aed4,_0x52cac4){_0x14aed4=_0x14aed4-0x0;var _0x10ae40=_0x0767[_0x14aed4];return _0x10ae40;};'use strict';var _=require(_0x7076('0x0'));var crypto=require(_0x7076('0x1'));var jwt=require(_0x7076('0x2'));var moment=require(_0x7076('0x3'));var Redis=require(_0x7076('0x4'));var rp=require(_0x7076('0x5'));var util=require('util');var encryptor=require(_0x7076('0x6'));var config=require(_0x7076('0x7'));var logger=require(_0x7076('0x8'))(_0x7076('0x9'));var schedule=require(_0x7076('0xa'));var db=require(_0x7076('0xb'))['db'];config[_0x7076('0xc')]=_[_0x7076('0xd')](config[_0x7076('0xc')],{'host':_0x7076('0xe'),'port':0x18eb});var redis=new Redis(config[_0x7076('0xc')]);var MICROSOFT_AUTH_URL=_0x7076('0xf');var AZURE_AUTH_SCOPES={'Outlook365':[_0x7076('0x10'),_0x7076('0x11'),_0x7076('0x12'),'offline_access',_0x7076('0x13'),'https://outlook.office.com/POP.AccessAsUser.All','https://outlook.office.com/SMTP.Send'],'Dynamics365':[_0x7076('0x10'),_0x7076('0x14')]};var MICROSOFT_AUTH_ENDPOINT=_0x7076('0x15');var MICROSOFT_TOKEN_ENDPOINT=_0x7076('0x16');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x57374b){var _0x20f2d3=_['map'](AZURE_AUTH_SCOPES[_0x57374b['type']]);if(_0x57374b[_0x7076('0x17')]==='Dynamics365')_0x20f2d3[_0x7076('0x18')](_0x57374b[_0x7076('0x19')]+'/.default');return _0x20f2d3[_0x7076('0x1a')]('\x20');}function getAccessTokenScope(_0x24fb36){if(_0x24fb36[_0x7076('0x17')]===_0x7076('0x1b'))return'https://outlook.office365.com/IMAP.AccessAsUser.All';if(_0x24fb36[_0x7076('0x17')]===_0x7076('0x1c'))return _0x24fb36['data7']+_0x7076('0x1d');}function generateMicrosoftAuthorizationUrl(_0x3a6e8a,_0x50d2e6){var _0x379de3=MICROSOFT_AUTH_URL[_0x7076('0x1e')]('{TENANT_ID}',_0x3a6e8a[_0x7076('0x1f')]);var _0x51494b=[_0x7076('0x20'),_0x7076('0x21')];var _0x25188c=Buffer['from'](JSON['stringify']({'id':_0x50d2e6}))['toString'](_0x7076('0x22'));var _0x4a85f0=crypto[_0x7076('0x23')](0x10)[_0x7076('0x24')](_0x7076('0x25'));var _0x4999d6=getAuthorizationScopes(_0x3a6e8a);var _0x10cadc=[{'key':_0x7076('0x26'),'value':_0x3a6e8a['data1']},{'key':_0x7076('0x27'),'value':encodeURIComponent(_0x51494b[_0x7076('0x1a')]('\x20'))},{'key':_0x7076('0x28'),'value':_0x3a6e8a['data4']},{'key':_0x7076('0x29'),'value':_0x7076('0x2a')},{'key':_0x7076('0x2b'),'value':encodeURIComponent(_0x4999d6)},{'key':_0x7076('0x2c'),'value':_0x25188c},{'key':'nonce','value':_0x4a85f0},{'key':_0x7076('0x2d'),'value':_0x7076('0x2e')}];var _0x17f20f=_0x379de3+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0x7076('0x2f')](_0x10cadc,function(_0x234f62){return _0x234f62['key']+'='+_0x234f62['value'];})['join']('&');_0x3a6e8a['oauth2Claims']={'issuer':_0x379de3[_0x7076('0x1e')](_0x7076('0x30'),''),'audience':_0x3a6e8a[_0x7076('0x31')],'state':_0x25188c,'nonce':_0x4a85f0};redis[_0x7076('0x32')](_0x25188c,JSON[_0x7076('0x33')](_0x3a6e8a));return _0x17f20f;}function isValidIdToken(_0x38dd81,_0x26c37f){try{var _0x51bbb4=jwt[_0x7076('0x34')](_0x38dd81,{'complete':!![]});var _0x281abd=_0x51bbb4[_0x7076('0x35')];if(_0x281abd[_0x7076('0x36')]!==_0x26c37f[_0x7076('0x37')])return![];if(_0x281abd[_0x7076('0x38')]!==_0x26c37f[_0x7076('0x39')])return![];if(_0x281abd[_0x7076('0x3a')]!==_0x26c37f['nonce'])return![];if(moment()[_0x7076('0x3b')](moment['unix'](_0x281abd[_0x7076('0x3c')])))return![];return!![];}catch(_0x1af88d){throw _0x1af88d;}}function refreshOauth2MicrosoftAccessToken(_0x56f4cb){return Promise['resolve']()[_0x7076('0x3d')](function(){if(_0x56f4cb[_0x7076('0x3e')])return _0x56f4cb;return db[_0x7076('0x3f')]['findOne']({'where':{'id':_0x56f4cb['id']},'raw':!![]});})[_0x7076('0x3d')](function(_0x595478){var _0x43854b={'grant_type':_0x7076('0x40'),'refresh_token':_0x595478['data6'],'scope':getAccessTokenScope(_0x595478),'redirect_uri':_0x595478[_0x7076('0x41')],'client_id':_0x595478[_0x7076('0x31')],'client_secret':encryptor['decryptString'](_0x595478['data3'])};var _0x2a6c56={'method':_0x7076('0x42'),'uri':MICROSOFT_AUTH_URL[_0x7076('0x1e')](_0x7076('0x43'),_0x595478[_0x7076('0x1f')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x43854b,'json':!![]};return rp(_0x2a6c56);})[_0x7076('0x3d')](function(_0x2e456e){_0x56f4cb[_0x7076('0x44')]=_0x2e456e[_0x7076('0x45')];_0x56f4cb[_0x7076('0x46')]=_0x2e456e[_0x7076('0x40')];return db[_0x7076('0x3f')][_0x7076('0x47')]({'data5':_0x56f4cb['data5'],'data6':_0x56f4cb[_0x7076('0x46')]},{'where':{'id':_0x56f4cb['id']}});})[_0x7076('0x3d')](function(){return _0x56f4cb;})[_0x7076('0x48')](function(_0x39eb18){logger[_0x7076('0x49')](_0x7076('0x4a'),_0x56f4cb['id'],_0x39eb18);});}function getOauth2MicrosoftAccessToken(_0xd97be7,_0x57f25b){var _0x5e0fac={'grant_type':_0x7076('0x4b'),'code':_0xd97be7,'scope':getAccessTokenScope(_0x57f25b),'redirect_uri':_0x57f25b[_0x7076('0x41')],'client_id':_0x57f25b[_0x7076('0x31')],'client_secret':encryptor[_0x7076('0x4c')](_0x57f25b[_0x7076('0x3e')])};var _0x2fb351={'method':_0x7076('0x42'),'uri':MICROSOFT_AUTH_URL[_0x7076('0x1e')](_0x7076('0x43'),_0x57f25b[_0x7076('0x1f')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x5e0fac,'json':!![]};return rp(_0x2fb351);}function startRefreshInterval(_0x533a03){var _0x5a9cc9=schedule['intervals'];if(_0x5a9cc9[_0x533a03['id']])clearInterval(_0x5a9cc9[_0x533a03['id']]);_0x5a9cc9[_0x533a03['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0x7076('0x4d')](this,{'id':_0x533a03['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0x7076('0x4e')]=_0x5a9cc9;}function startAllRefreshIntervals(){return db[_0x7076('0x3f')][_0x7076('0x4f')]({'where':{'data6':{'$ne':null}},'raw':!![]})[_0x7076('0x3d')](function(_0x4346db){var _0x423735=_0x4346db[_0x7076('0x2f')](function(_0x4ca152){return refreshOauth2MicrosoftAccessToken(_0x4ca152)['then'](function(_0x53b7b9){startRefreshInterval(_0x53b7b9);});});return Promise[_0x7076('0x50')](_0x423735);})[_0x7076('0x48')](function(_0x2da55f){var _0x47abd9=_0x2da55f?util['inspect'](_0x2da55f,{'showHidden':![],'depth':null}):'';logger['error'](_0x7076('0x51'),_0x47abd9);});}module[_0x7076('0x52')]={'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 75a557e..d27f4ee 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 _0xf108=['info','CloudProvider,\x20%s,\x20%s','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then'];(function(_0x47a7d0,_0x4e182d){var _0xb9bd08=function(_0x588ee2){while(--_0x588ee2){_0x47a7d0['push'](_0x47a7d0['shift']());}};_0xb9bd08(++_0x4e182d);}(_0xf108,0x1d9));var _0x8f10=function(_0xebfe06,_0x23291e){_0xebfe06=_0xebfe06-0x0;var _0x26dfef=_0xf108[_0xebfe06];return _0x26dfef;};'use strict';var _=require(_0x8f10('0x0'));var util=require('util');var moment=require(_0x8f10('0x1'));var BPromise=require(_0x8f10('0x2'));var rs=require(_0x8f10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x8f10('0x4'))(_0x8f10('0x5'));var config=require(_0x8f10('0x6'));var jayson=require(_0x8f10('0x7'));var client=jayson[_0x8f10('0x8')][_0x8f10('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x212efc,_0x38b45f,_0x9cf8af){return new BPromise(function(_0x22e5df,_0x3a5d06){return client['request'](_0x212efc,_0x9cf8af)[_0x8f10('0xa')](function(_0x1787d2){logger[_0x8f10('0xb')](_0x8f10('0xc'),_0x38b45f,_0x8f10('0xd'));logger[_0x8f10('0xe')](_0x8f10('0xf'),_0x38b45f,_0x8f10('0xd'),JSON[_0x8f10('0x10')](_0x1787d2));if(_0x1787d2[_0x8f10('0x11')]){if(_0x1787d2[_0x8f10('0x11')][_0x8f10('0x12')]===0x1f4){logger[_0x8f10('0x11')](_0x8f10('0xc'),_0x38b45f,_0x1787d2[_0x8f10('0x11')]['message']);return _0x3a5d06(_0x1787d2['error'][_0x8f10('0x13')]);}logger[_0x8f10('0x11')](_0x8f10('0xc'),_0x38b45f,_0x1787d2[_0x8f10('0x11')][_0x8f10('0x13')]);return _0x22e5df(_0x1787d2[_0x8f10('0x11')][_0x8f10('0x13')]);}else{logger[_0x8f10('0xb')](_0x8f10('0xc'),_0x38b45f,'request\x20sent');_0x22e5df(_0x1787d2[_0x8f10('0x14')][_0x8f10('0x13')]);}})[_0x8f10('0x15')](function(_0x52aafc){logger[_0x8f10('0x11')](_0x8f10('0xc'),_0x38b45f,_0x52aafc);_0x3a5d06(_0x52aafc);});});} \ No newline at end of file +var _0x7880=['bluebird','randomstring','ioredis','../../mysqldb','rpc','jayson/promise','client','http','request','then','info','CloudProvider,\x20%s,\x20%s','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','moment'];(function(_0x3ab78c,_0x58eed3){var _0x18a067=function(_0x1f599b){while(--_0x1f599b){_0x3ab78c['push'](_0x3ab78c['shift']());}};_0x18a067(++_0x58eed3);}(_0x7880,0x10f));var _0x0788=function(_0x567ea1,_0x3cb026){_0x567ea1=_0x567ea1-0x0;var _0x20964d=_0x7880[_0x567ea1];return _0x20964d;};'use strict';var _=require(_0x0788('0x0'));var util=require('util');var moment=require(_0x0788('0x1'));var BPromise=require(_0x0788('0x2'));var rs=require(_0x0788('0x3'));var fs=require('fs');var Redis=require(_0x0788('0x4'));var db=require(_0x0788('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x0788('0x6'));var config=require('../../config/environment');var jayson=require(_0x0788('0x7'));var client=jayson[_0x0788('0x8')][_0x0788('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5ece1c,_0x14cfa5,_0x450b71){return new BPromise(function(_0x5366c7,_0x1662a2){return client[_0x0788('0xa')](_0x5ece1c,_0x450b71)[_0x0788('0xb')](function(_0x95ebe3){logger[_0x0788('0xc')](_0x0788('0xd'),_0x14cfa5,_0x0788('0xe'));logger[_0x0788('0xf')](_0x0788('0x10'),_0x14cfa5,_0x0788('0xe'),JSON[_0x0788('0x11')](_0x95ebe3));if(_0x95ebe3['error']){if(_0x95ebe3[_0x0788('0x12')]['code']===0x1f4){logger[_0x0788('0x12')](_0x0788('0xd'),_0x14cfa5,_0x95ebe3[_0x0788('0x12')][_0x0788('0x13')]);return _0x1662a2(_0x95ebe3[_0x0788('0x12')]['message']);}logger[_0x0788('0x12')]('CloudProvider,\x20%s,\x20%s',_0x14cfa5,_0x95ebe3[_0x0788('0x12')]['message']);return _0x5366c7(_0x95ebe3['error'][_0x0788('0x13')]);}else{logger[_0x0788('0xc')](_0x0788('0xd'),_0x14cfa5,'request\x20sent');_0x5366c7(_0x95ebe3[_0x0788('0x14')][_0x0788('0x13')]);}})['catch'](function(_0x334f58){logger[_0x0788('0x12')](_0x0788('0xd'),_0x14cfa5,_0x334f58);_0x1662a2(_0x334f58);});});} \ No newline at end of file diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js index f8a6dca..217adf0 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 _0x5f66=['index','post','/:id','update','delete','/:id/oauth2/microsoft/authorize/','oauth2MicrosoftAuthorize','oauth2MicrosoftCallback','Router','./cloudProvider.controller','get','isAuthenticated'];(function(_0x3a2327,_0x57a261){var _0x14ad19=function(_0x5d3caf){while(--_0x5d3caf){_0x3a2327['push'](_0x3a2327['shift']());}};_0x14ad19(++_0x57a261);}(_0x5f66,0x1a0));var _0x65f6=function(_0x36eaaa,_0x326732){_0x36eaaa=_0x36eaaa-0x0;var _0x461349=_0x5f66[_0x36eaaa];return _0x461349;};'use strict';var express=require('express');var router=express[_0x65f6('0x0')]();var auth=require('../../components/auth/service');var controller=require(_0x65f6('0x1'));router[_0x65f6('0x2')]('/',auth[_0x65f6('0x3')](),controller[_0x65f6('0x4')]);router[_0x65f6('0x2')]('/:id',auth[_0x65f6('0x3')](),controller['show']);router[_0x65f6('0x5')]('/',auth[_0x65f6('0x3')](),controller['create']);router['put'](_0x65f6('0x6'),auth[_0x65f6('0x3')](),controller[_0x65f6('0x7')]);router[_0x65f6('0x8')](_0x65f6('0x6'),auth[_0x65f6('0x3')](),controller['destroy']);router['get'](_0x65f6('0x9'),auth[_0x65f6('0x3')](),controller[_0x65f6('0xa')]);router[_0x65f6('0x5')]('/oauth2/microsoft/callback',controller[_0x65f6('0xb')]);module['exports']=router; \ No newline at end of file +var _0x5f66=['index','post','/:id','update','delete','/:id/oauth2/microsoft/authorize/','oauth2MicrosoftAuthorize','oauth2MicrosoftCallback','Router','./cloudProvider.controller','get','isAuthenticated'];(function(_0x411255,_0x5f4109){var _0x40db5c=function(_0x4d721d){while(--_0x4d721d){_0x411255['push'](_0x411255['shift']());}};_0x40db5c(++_0x5f4109);}(_0x5f66,0x1a0));var _0x65f6=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0x5f66[_0x297fd3];return _0x2af381;};'use strict';var express=require('express');var router=express[_0x65f6('0x0')]();var auth=require('../../components/auth/service');var controller=require(_0x65f6('0x1'));router[_0x65f6('0x2')]('/',auth[_0x65f6('0x3')](),controller[_0x65f6('0x4')]);router[_0x65f6('0x2')]('/:id',auth[_0x65f6('0x3')](),controller['show']);router[_0x65f6('0x5')]('/',auth[_0x65f6('0x3')](),controller['create']);router['put'](_0x65f6('0x6'),auth[_0x65f6('0x3')](),controller[_0x65f6('0x7')]);router[_0x65f6('0x8')](_0x65f6('0x6'),auth[_0x65f6('0x3')](),controller['destroy']);router['get'](_0x65f6('0x9'),auth[_0x65f6('0x3')](),controller[_0x65f6('0xa')]);router[_0x65f6('0x5')]('/oauth2/microsoft/callback',controller[_0x65f6('0xb')]);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 b765b0b..f4ce630 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 _0x021a=['sequelize','exports','STRING'];(function(_0x810a0a,_0x5ab768){var _0x171847=function(_0x4bd0cd){while(--_0x4bd0cd){_0x810a0a['push'](_0x810a0a['shift']());}};_0x171847(++_0x5ab768);}(_0x021a,0xff));var _0xa021=function(_0x58df3b,_0x182132){_0x58df3b=_0x58df3b-0x0;var _0x1c82d6=_0x021a[_0x58df3b];return _0x1c82d6;};'use strict';var Sequelize=require(_0xa021('0x0'));module[_0xa021('0x1')]={'name':{'type':Sequelize[_0xa021('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0xa021('0x2')]},'companyId':{'type':Sequelize['STRING']},'website':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0xa021('0x2')]},'fax':{'type':Sequelize[_0xa021('0x2')]},'type':{'type':Sequelize[_0xa021('0x2')]},'street':{'type':Sequelize[_0xa021('0x2')]},'postalCode':{'type':Sequelize[_0xa021('0x2')]},'city':{'type':Sequelize[_0xa021('0x2')]},'country':{'type':Sequelize[_0xa021('0x2')]},'email':{'type':Sequelize[_0xa021('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0xa021('0x2')]},'sStreet':{'type':Sequelize['STRING']},'sPostalCode':{'type':Sequelize['STRING']},'sCity':{'type':Sequelize[_0xa021('0x2')]},'sCountry':{'type':Sequelize[_0xa021('0x2')]},'description':{'type':Sequelize[_0xa021('0x2')]}}; \ No newline at end of file +var _0x33ee=['sequelize','exports','STRING'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0x33ee,0x13e));var _0xe33e=function(_0x3b5049,_0x495a94){_0x3b5049=_0x3b5049-0x0;var _0x12454e=_0x33ee[_0x3b5049];return _0x12454e;};'use strict';var Sequelize=require(_0xe33e('0x0'));module[_0xe33e('0x1')]={'name':{'type':Sequelize[_0xe33e('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0xe33e('0x2')]},'companyId':{'type':Sequelize[_0xe33e('0x2')]},'website':{'type':Sequelize[_0xe33e('0x2')]},'phone':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0xe33e('0x2')]},'type':{'type':Sequelize['STRING']},'street':{'type':Sequelize[_0xe33e('0x2')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0xe33e('0x2')]},'country':{'type':Sequelize[_0xe33e('0x2')]},'email':{'type':Sequelize[_0xe33e('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0xe33e('0x2')]},'sStreet':{'type':Sequelize['STRING']},'sPostalCode':{'type':Sequelize[_0xe33e('0x2')]},'sCity':{'type':Sequelize[_0xe33e('0x2')]},'sCountry':{'type':Sequelize[_0xe33e('0x2')]},'description':{'type':Sequelize[_0xe33e('0x2')]}}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js index 83c4110..39a953e 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 _0xcdd5=['sort','nolimit','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','fs-extra','lodash','squel','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','then','destroy','get','Companies','UserProfileResource','sendStatus','name','index','describe','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','where','pick','merge','map','filter','options','CmCompany','include','rows','catch','rawAttributes','length','includeAll','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','error','update','addContacts','CmContact','params','ids','getContacts'];(function(_0x363486,_0x5bf43e){var _0x50297e=function(_0x1bde64){while(--_0x1bde64){_0x363486['push'](_0x363486['shift']());}};_0x50297e(++_0x5bf43e);}(_0xcdd5,0xfe));var _0x5cdd=function(_0x2f87f7,_0x408be9){_0x2f87f7=_0x2f87f7-0x0;var _0x410436=_0xcdd5[_0x2f87f7];return _0x410436;};'use strict';var emlformat=require(_0x5cdd('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x5cdd('0x1'));var rp=require(_0x5cdd('0x2'));var moment=require(_0x5cdd('0x3'));var BPromise=require(_0x5cdd('0x4'));var Mustache=require(_0x5cdd('0x5'));var util=require('util');var path=require(_0x5cdd('0x6'));var sox=require(_0x5cdd('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5cdd('0x8'));var _=require(_0x5cdd('0x9'));var squel=require(_0x5cdd('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x5cdd('0xb'));var querystring=require(_0x5cdd('0xc'));var Papa=require('papaparse');var Redis=require(_0x5cdd('0xd'));var authService=require(_0x5cdd('0xe'));var qs=require(_0x5cdd('0xf'));var as=require(_0x5cdd('0x10'));var hardwareService=require(_0x5cdd('0x11'));var logger=require(_0x5cdd('0x12'))(_0x5cdd('0x13'));var utils=require(_0x5cdd('0x14'));var config=require(_0x5cdd('0x15'));var licenseUtil=require(_0x5cdd('0x16'));var db=require(_0x5cdd('0x17'))['db'];function respondWithStatusCode(_0x566097,_0x3e25a5){_0x3e25a5=_0x3e25a5||0xcc;return function(_0x5ca585){if(_0x5ca585){return _0x566097['sendStatus'](_0x3e25a5);}return _0x566097[_0x5cdd('0x18')](_0x3e25a5)[_0x5cdd('0x19')]();};}function respondWithResult(_0x268b7b,_0x4e491a){_0x4e491a=_0x4e491a||0xc8;return function(_0x249d22){if(_0x249d22){return _0x268b7b[_0x5cdd('0x18')](_0x4e491a)[_0x5cdd('0x1a')](_0x249d22);}};}function respondWithFilteredResult(_0x3f7dd5,_0x50b471){return function(_0x4f55c0){if(_0x4f55c0){var _0x5e867d=typeof _0x50b471[_0x5cdd('0x1b')]===_0x5cdd('0x1c')&&typeof _0x50b471[_0x5cdd('0x1d')]===_0x5cdd('0x1c');var _0x5cb252=_0x4f55c0['count'];var _0x4c5b31=_0x5e867d?0x0:_0x50b471[_0x5cdd('0x1b')];var _0x36a37e=_0x5e867d?_0x4f55c0[_0x5cdd('0x1e')]:_0x50b471[_0x5cdd('0x1b')]+_0x50b471[_0x5cdd('0x1d')];var _0x4b774d;if(_0x36a37e>=_0x5cb252){_0x36a37e=_0x5cb252;_0x4b774d=0xc8;}else{_0x4b774d=0xce;}_0x3f7dd5['status'](_0x4b774d);return _0x3f7dd5['set'](_0x5cdd('0x1f'),_0x4c5b31+'-'+_0x36a37e+'/'+_0x5cb252)[_0x5cdd('0x1a')](_0x4f55c0);}return null;};}function patchUpdates(_0x12970a){return function(_0xd4370){try{jsonpatch[_0x5cdd('0x20')](_0xd4370,_0x12970a,!![]);}catch(_0x331940){return BPromise[_0x5cdd('0x21')](_0x331940);}return _0xd4370[_0x5cdd('0x22')]();};}function saveUpdates(_0x1eabfc,_0x4e90b9){return function(_0x14199d){if(_0x14199d){return _0x14199d['update'](_0x1eabfc)[_0x5cdd('0x23')](function(_0x114fef){return _0x114fef;});}return null;};}function removeEntity(_0x2ab066,_0x32996f){return function(_0x49722e){if(_0x49722e){return _0x49722e[_0x5cdd('0x24')]()[_0x5cdd('0x23')](function(){var _0x22d4bb=_0x49722e[_0x5cdd('0x25')]({'plain':!![]});var _0x4cdc12=_0x5cdd('0x26');return db[_0x5cdd('0x27')][_0x5cdd('0x24')]({'where':{'type':_0x4cdc12,'resourceId':_0x22d4bb['id']}})[_0x5cdd('0x23')](function(){return _0x49722e;});})['then'](function(){_0x2ab066[_0x5cdd('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x455cd1,_0x17fe85){return function(_0x4817a5){if(!_0x4817a5){_0x455cd1[_0x5cdd('0x28')](0x194);}return _0x4817a5;};}function handleError(_0x159064,_0x4aa602){_0x4aa602=_0x4aa602||0x1f4;return function(_0x4d1e72){logger['error'](_0x4d1e72['stack']);if(_0x4d1e72[_0x5cdd('0x29')]){delete _0x4d1e72['name'];}_0x159064[_0x5cdd('0x18')](_0x4aa602)['send'](_0x4d1e72);};}exports[_0x5cdd('0x2a')]=function(_0x533c62,_0x323818){var _0x594ce6={},_0x1b9820={},_0x3f2492={'count':0x0,'rows':[]};return db['CmCompany'][_0x5cdd('0x2b')]()[_0x5cdd('0x23')](function(_0x594492){_0x1b9820[_0x5cdd('0x2c')]=_['keys'](_0x594492);_0x1b9820[_0x5cdd('0x2d')]=_[_0x5cdd('0x2e')](_0x533c62['query']);_0x1b9820[_0x5cdd('0x2f')]=_[_0x5cdd('0x30')](_0x1b9820[_0x5cdd('0x2c')],_0x1b9820['query']);_0x594ce6[_0x5cdd('0x31')]=_[_0x5cdd('0x30')](_0x1b9820[_0x5cdd('0x2c')],qs['fields'](_0x533c62[_0x5cdd('0x2d')][_0x5cdd('0x32')]));_0x594ce6[_0x5cdd('0x31')]=_0x594ce6[_0x5cdd('0x31')]['length']?_0x594ce6['attributes']:_0x1b9820[_0x5cdd('0x2c')];if(!_0x533c62[_0x5cdd('0x2d')][_0x5cdd('0x33')]('nolimit')){_0x594ce6[_0x5cdd('0x1d')]=qs[_0x5cdd('0x1d')](_0x533c62[_0x5cdd('0x2d')][_0x5cdd('0x1d')]);_0x594ce6[_0x5cdd('0x1b')]=qs[_0x5cdd('0x1b')](_0x533c62[_0x5cdd('0x2d')][_0x5cdd('0x1b')]);}_0x594ce6[_0x5cdd('0x34')]=qs['sort'](_0x533c62['query']['sort']);_0x594ce6[_0x5cdd('0x35')]=qs['filters'](_[_0x5cdd('0x36')](_0x533c62[_0x5cdd('0x2d')],_0x1b9820['filters']),_0x594492);if(_0x533c62[_0x5cdd('0x2d')]['filter']){_0x594ce6[_0x5cdd('0x35')]=_[_0x5cdd('0x37')](_0x594ce6[_0x5cdd('0x35')],{'$or':_[_0x5cdd('0x38')](_0x594ce6[_0x5cdd('0x31')],function(_0x45182b){var _0x21020b={};_0x21020b[_0x45182b]={'$like':'%'+_0x533c62[_0x5cdd('0x2d')][_0x5cdd('0x39')]+'%'};return _0x21020b;})});}_0x594ce6=_['merge']({},_0x594ce6,_0x533c62[_0x5cdd('0x3a')]);var _0x182106={'where':_0x594ce6[_0x5cdd('0x35')]};return db[_0x5cdd('0x3b')][_0x5cdd('0x1e')](_0x182106)[_0x5cdd('0x23')](function(_0x4cc2da){_0x3f2492[_0x5cdd('0x1e')]=_0x4cc2da;if(_0x533c62[_0x5cdd('0x2d')]['includeAll']){_0x594ce6[_0x5cdd('0x3c')]=[{'all':!![]}];}return db[_0x5cdd('0x3b')]['findAll'](_0x594ce6);})['then'](function(_0x5c61d0){_0x3f2492[_0x5cdd('0x3d')]=_0x5c61d0;return _0x3f2492;})[_0x5cdd('0x23')](respondWithFilteredResult(_0x323818,_0x594ce6))[_0x5cdd('0x3e')](handleError(_0x323818,null));})[_0x5cdd('0x3e')](handleError(_0x323818,null));};exports['show']=function(_0x4bdd48,_0x12e677){var _0x49895e={'raw':![],'where':{'id':_0x4bdd48['params']['id']}},_0x152bd8={};_0x152bd8[_0x5cdd('0x2c')]=_[_0x5cdd('0x2e')](db[_0x5cdd('0x3b')][_0x5cdd('0x3f')]);_0x152bd8[_0x5cdd('0x2d')]=_[_0x5cdd('0x2e')](_0x4bdd48[_0x5cdd('0x2d')]);_0x152bd8['filters']=_['intersection'](_0x152bd8[_0x5cdd('0x2c')],_0x152bd8[_0x5cdd('0x2d')]);_0x49895e[_0x5cdd('0x31')]=_[_0x5cdd('0x30')](_0x152bd8[_0x5cdd('0x2c')],qs[_0x5cdd('0x32')](_0x4bdd48[_0x5cdd('0x2d')][_0x5cdd('0x32')]));_0x49895e['attributes']=_0x49895e[_0x5cdd('0x31')][_0x5cdd('0x40')]?_0x49895e[_0x5cdd('0x31')]:_0x152bd8[_0x5cdd('0x2c')];if(_0x4bdd48[_0x5cdd('0x2d')][_0x5cdd('0x41')]){_0x49895e['include']=[{'all':!![]}];}_0x49895e=_[_0x5cdd('0x37')]({},_0x49895e,_0x4bdd48['options']);return db[_0x5cdd('0x3b')][_0x5cdd('0x42')](_0x49895e)['then'](handleEntityNotFound(_0x12e677,null))[_0x5cdd('0x23')](respondWithResult(_0x12e677,null))[_0x5cdd('0x3e')](handleError(_0x12e677,null));};exports[_0x5cdd('0x43')]=function(_0x1f1d80,_0x599e47){return db[_0x5cdd('0x3b')][_0x5cdd('0x43')](_0x1f1d80[_0x5cdd('0x44')],{})['then'](function(_0xbc43eb){var _0x33b472=_0x1f1d80['user'][_0x5cdd('0x25')]({'plain':!![]});if(!_0x33b472)throw new Error(_0x5cdd('0x45'));if(_0x33b472[_0x5cdd('0x46')]===_0x5cdd('0x47')){var _0x3590fb=_0xbc43eb[_0x5cdd('0x25')]({'plain':!![]});var _0x30c11f=_0x5cdd('0x26');return db[_0x5cdd('0x48')][_0x5cdd('0x42')]({'where':{'name':_0x30c11f,'userProfileId':_0x33b472[_0x5cdd('0x49')]},'raw':!![]})[_0x5cdd('0x23')](function(_0x5d7e1c){if(_0x5d7e1c&&_0x5d7e1c[_0x5cdd('0x4a')]===0x0){return db[_0x5cdd('0x27')][_0x5cdd('0x43')]({'name':_0x3590fb[_0x5cdd('0x29')],'resourceId':_0x3590fb['id'],'type':_0x5d7e1c['name'],'sectionId':_0x5d7e1c['id']},{})[_0x5cdd('0x23')](function(){return _0xbc43eb;});}else{return _0xbc43eb;}})[_0x5cdd('0x3e')](function(_0x2baeb8){logger[_0x5cdd('0x4b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2baeb8);throw _0x2baeb8;});}return _0xbc43eb;})[_0x5cdd('0x23')](respondWithResult(_0x599e47,0xc9))['catch'](handleError(_0x599e47,null));};exports[_0x5cdd('0x4c')]=function(_0x354335,_0x8a28cb){if(_0x354335[_0x5cdd('0x44')]['id']){delete _0x354335[_0x5cdd('0x44')]['id'];}return db[_0x5cdd('0x3b')][_0x5cdd('0x42')]({'where':{'id':_0x354335['params']['id']}})[_0x5cdd('0x23')](handleEntityNotFound(_0x8a28cb,null))[_0x5cdd('0x23')](saveUpdates(_0x354335[_0x5cdd('0x44')],null))[_0x5cdd('0x23')](respondWithResult(_0x8a28cb,null))[_0x5cdd('0x3e')](handleError(_0x8a28cb,null));};exports[_0x5cdd('0x24')]=function(_0x4a98a4,_0x3928b7){return db[_0x5cdd('0x3b')][_0x5cdd('0x42')]({'where':{'id':_0x4a98a4['params']['id']}})[_0x5cdd('0x23')](handleEntityNotFound(_0x3928b7,null))[_0x5cdd('0x23')](removeEntity(_0x3928b7,null))['catch'](handleError(_0x3928b7,null));};exports[_0x5cdd('0x2b')]=function(_0x378b5f,_0x40d9c4){return db[_0x5cdd('0x3b')][_0x5cdd('0x2b')]()['then'](respondWithResult(_0x40d9c4,null))[_0x5cdd('0x3e')](handleError(_0x40d9c4,null));};exports[_0x5cdd('0x4d')]=function(_0x1469da,_0x27e127,_0x1b0270){return db[_0x5cdd('0x4e')][_0x5cdd('0x42')]({'where':{'id':_0x1469da[_0x5cdd('0x4f')]['id']}})[_0x5cdd('0x23')](handleEntityNotFound(_0x27e127,null))['then'](function(_0x4c8208){if(_0x4c8208){return _0x4c8208[_0x5cdd('0x4d')](_0x1469da['body'][_0x5cdd('0x50')],_['omit'](_0x1469da[_0x5cdd('0x44')],[_0x5cdd('0x50'),'id'])||{});}})['then'](respondWithResult(_0x27e127,null))[_0x5cdd('0x3e')](handleError(_0x27e127,null));};exports[_0x5cdd('0x51')]=function(_0x4dbf35,_0x53d810,_0x4a9488){var _0x30ebc7={};var _0x42f34b={};var _0x50cc1b;var _0x4b64ec;return db[_0x5cdd('0x3b')]['findOne']({'where':{'id':_0x4dbf35['params']['id']}})[_0x5cdd('0x23')](handleEntityNotFound(_0x53d810,null))[_0x5cdd('0x23')](function(_0x318cd6){if(_0x318cd6){_0x50cc1b=_0x318cd6;_0x42f34b[_0x5cdd('0x2c')]=_[_0x5cdd('0x2e')](db[_0x5cdd('0x4e')][_0x5cdd('0x3f')]);_0x42f34b[_0x5cdd('0x2d')]=_['keys'](_0x4dbf35[_0x5cdd('0x2d')]);_0x42f34b['filters']=_['intersection'](_0x42f34b[_0x5cdd('0x2c')],_0x42f34b['query']);_0x30ebc7[_0x5cdd('0x31')]=_[_0x5cdd('0x30')](_0x42f34b[_0x5cdd('0x2c')],qs[_0x5cdd('0x32')](_0x4dbf35[_0x5cdd('0x2d')][_0x5cdd('0x32')]));_0x30ebc7['attributes']=_0x30ebc7[_0x5cdd('0x31')][_0x5cdd('0x40')]?_0x30ebc7[_0x5cdd('0x31')]:_0x42f34b['model'];_0x30ebc7[_0x5cdd('0x34')]=qs[_0x5cdd('0x52')](_0x4dbf35['query'][_0x5cdd('0x52')]);_0x30ebc7['where']=qs[_0x5cdd('0x2f')](_[_0x5cdd('0x36')](_0x4dbf35['query'],_0x42f34b[_0x5cdd('0x2f')]));if(_0x4dbf35[_0x5cdd('0x2d')]['filter']){_0x30ebc7[_0x5cdd('0x35')]=_[_0x5cdd('0x37')](_0x30ebc7[_0x5cdd('0x35')],{'$or':_['map'](_0x30ebc7['attributes'],function(_0x4d9eb9){var _0x8a232={};_0x8a232[_0x4d9eb9]={'$like':'%'+_0x4dbf35[_0x5cdd('0x2d')][_0x5cdd('0x39')]+'%'};return _0x8a232;})});}_0x30ebc7=_[_0x5cdd('0x37')]({},_0x30ebc7,_0x4dbf35[_0x5cdd('0x3a')]);return _0x50cc1b[_0x5cdd('0x51')](_0x30ebc7);}})['then'](function(_0xb66d72){if(_0xb66d72){_0x4b64ec=_0xb66d72[_0x5cdd('0x40')];if(!_0x4dbf35[_0x5cdd('0x2d')][_0x5cdd('0x33')](_0x5cdd('0x53'))){_0x30ebc7[_0x5cdd('0x1d')]=qs[_0x5cdd('0x1d')](_0x4dbf35['query'][_0x5cdd('0x1d')]);_0x30ebc7[_0x5cdd('0x1b')]=qs[_0x5cdd('0x1b')](_0x4dbf35[_0x5cdd('0x2d')]['offset']);}return _0x50cc1b[_0x5cdd('0x51')](_0x30ebc7);}})[_0x5cdd('0x23')](function(_0x5aa58d){if(_0x5aa58d){return _0x5aa58d?{'count':_0x4b64ec,'rows':_0x5aa58d}:null;}})[_0x5cdd('0x23')](respondWithResult(_0x53d810,null))[_0x5cdd('0x3e')](handleError(_0x53d810,null));}; \ No newline at end of file +var _0x5e07=['moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','reject','save','update','then','destroy','get','Companies','end','error','stack','name','send','index','CmCompany','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','where','filter','merge','map','options','include','rows','catch','show','rawAttributes','length','includeAll','find','create','user','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','describe','ids','omit','getContacts','findOne','order','sort','pick','eml-format','zip-dir','fast-json-patch','request-promise'];(function(_0x2cce77,_0x4f08f5){var _0x1a41d1=function(_0x34c843){while(--_0x34c843){_0x2cce77['push'](_0x2cce77['shift']());}};_0x1a41d1(++_0x4f08f5);}(_0x5e07,0xa2));var _0x75e0=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x5e07[_0x2f5ac5];return _0x37c9a8;};'use strict';var emlformat=require(_0x75e0('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x75e0('0x1'));var jsonpatch=require(_0x75e0('0x2'));var rp=require(_0x75e0('0x3'));var moment=require(_0x75e0('0x4'));var BPromise=require(_0x75e0('0x5'));var Mustache=require(_0x75e0('0x6'));var util=require(_0x75e0('0x7'));var path=require(_0x75e0('0x8'));var sox=require(_0x75e0('0x9'));var csv=require(_0x75e0('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x75e0('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x75e0('0xc'));var jsforce=require(_0x75e0('0xd'));var deskjs=require(_0x75e0('0xe'));var toCsv=require(_0x75e0('0xa'));var querystring=require(_0x75e0('0xf'));var Papa=require('papaparse');var Redis=require(_0x75e0('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x75e0('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x75e0('0x12'));var logger=require('../../config/logger')(_0x75e0('0x13'));var utils=require(_0x75e0('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x75e0('0x15'))['db'];function respondWithStatusCode(_0x714b69,_0x20a46f){_0x20a46f=_0x20a46f||0xcc;return function(_0x1633d0){if(_0x1633d0){return _0x714b69[_0x75e0('0x16')](_0x20a46f);}return _0x714b69[_0x75e0('0x17')](_0x20a46f)['end']();};}function respondWithResult(_0x3b2a34,_0x16e568){_0x16e568=_0x16e568||0xc8;return function(_0x4ab93e){if(_0x4ab93e){return _0x3b2a34[_0x75e0('0x17')](_0x16e568)['json'](_0x4ab93e);}};}function respondWithFilteredResult(_0x58f92b,_0x2d47aa){return function(_0x1b5a69){if(_0x1b5a69){var _0x13adcb=typeof _0x2d47aa[_0x75e0('0x18')]===_0x75e0('0x19')&&typeof _0x2d47aa[_0x75e0('0x1a')]===_0x75e0('0x19');var _0x270ec1=_0x1b5a69[_0x75e0('0x1b')];var _0x120566=_0x13adcb?0x0:_0x2d47aa[_0x75e0('0x18')];var _0x2b3ff4=_0x13adcb?_0x1b5a69[_0x75e0('0x1b')]:_0x2d47aa['offset']+_0x2d47aa[_0x75e0('0x1a')];var _0x3d8c72;if(_0x2b3ff4>=_0x270ec1){_0x2b3ff4=_0x270ec1;_0x3d8c72=0xc8;}else{_0x3d8c72=0xce;}_0x58f92b[_0x75e0('0x17')](_0x3d8c72);return _0x58f92b[_0x75e0('0x1c')](_0x75e0('0x1d'),_0x120566+'-'+_0x2b3ff4+'/'+_0x270ec1)[_0x75e0('0x1e')](_0x1b5a69);}return null;};}function patchUpdates(_0x59768d){return function(_0x56af29){try{jsonpatch['apply'](_0x56af29,_0x59768d,!![]);}catch(_0x23cbbe){return BPromise[_0x75e0('0x1f')](_0x23cbbe);}return _0x56af29[_0x75e0('0x20')]();};}function saveUpdates(_0x4b77e1,_0x2e8ac6){return function(_0x25a0c7){if(_0x25a0c7){return _0x25a0c7[_0x75e0('0x21')](_0x4b77e1)[_0x75e0('0x22')](function(_0x7816df){return _0x7816df;});}return null;};}function removeEntity(_0x1c1340,_0x13d9c6){return function(_0x3c14c0){if(_0x3c14c0){return _0x3c14c0[_0x75e0('0x23')]()['then'](function(){var _0x53a246=_0x3c14c0[_0x75e0('0x24')]({'plain':!![]});var _0x200ac2=_0x75e0('0x25');return db['UserProfileResource'][_0x75e0('0x23')]({'where':{'type':_0x200ac2,'resourceId':_0x53a246['id']}})[_0x75e0('0x22')](function(){return _0x3c14c0;});})[_0x75e0('0x22')](function(){_0x1c1340['status'](0xcc)[_0x75e0('0x26')]();});}};}function handleEntityNotFound(_0x1c17c8,_0xc564c3){return function(_0x50ae92){if(!_0x50ae92){_0x1c17c8[_0x75e0('0x16')](0x194);}return _0x50ae92;};}function handleError(_0x211f91,_0x39a45e){_0x39a45e=_0x39a45e||0x1f4;return function(_0x4c45c8){logger[_0x75e0('0x27')](_0x4c45c8[_0x75e0('0x28')]);if(_0x4c45c8[_0x75e0('0x29')]){delete _0x4c45c8[_0x75e0('0x29')];}_0x211f91['status'](_0x39a45e)[_0x75e0('0x2a')](_0x4c45c8);};}exports[_0x75e0('0x2b')]=function(_0x5adf8a,_0x11f45d){var _0x35d6fa={},_0x48d428={},_0x34d8a7={'count':0x0,'rows':[]};return db[_0x75e0('0x2c')]['describe']()['then'](function(_0x3a7b4d){_0x48d428[_0x75e0('0x2d')]=_[_0x75e0('0x2e')](_0x3a7b4d);_0x48d428['query']=_['keys'](_0x5adf8a[_0x75e0('0x2f')]);_0x48d428[_0x75e0('0x30')]=_[_0x75e0('0x31')](_0x48d428[_0x75e0('0x2d')],_0x48d428[_0x75e0('0x2f')]);_0x35d6fa[_0x75e0('0x32')]=_[_0x75e0('0x31')](_0x48d428['model'],qs[_0x75e0('0x33')](_0x5adf8a[_0x75e0('0x2f')][_0x75e0('0x33')]));_0x35d6fa[_0x75e0('0x32')]=_0x35d6fa[_0x75e0('0x32')]['length']?_0x35d6fa[_0x75e0('0x32')]:_0x48d428[_0x75e0('0x2d')];if(!_0x5adf8a['query'][_0x75e0('0x34')](_0x75e0('0x35'))){_0x35d6fa['limit']=qs[_0x75e0('0x1a')](_0x5adf8a[_0x75e0('0x2f')]['limit']);_0x35d6fa['offset']=qs[_0x75e0('0x18')](_0x5adf8a[_0x75e0('0x2f')][_0x75e0('0x18')]);}_0x35d6fa['order']=qs['sort'](_0x5adf8a['query']['sort']);_0x35d6fa[_0x75e0('0x36')]=qs['filters'](_['pick'](_0x5adf8a['query'],_0x48d428[_0x75e0('0x30')]),_0x3a7b4d);if(_0x5adf8a[_0x75e0('0x2f')][_0x75e0('0x37')]){_0x35d6fa[_0x75e0('0x36')]=_[_0x75e0('0x38')](_0x35d6fa[_0x75e0('0x36')],{'$or':_[_0x75e0('0x39')](_0x35d6fa[_0x75e0('0x32')],function(_0x421838){var _0x403b83={};_0x403b83[_0x421838]={'$like':'%'+_0x5adf8a[_0x75e0('0x2f')][_0x75e0('0x37')]+'%'};return _0x403b83;})});}_0x35d6fa=_[_0x75e0('0x38')]({},_0x35d6fa,_0x5adf8a[_0x75e0('0x3a')]);var _0x470ed9={'where':_0x35d6fa[_0x75e0('0x36')]};return db['CmCompany']['count'](_0x470ed9)[_0x75e0('0x22')](function(_0x3ac2a9){_0x34d8a7[_0x75e0('0x1b')]=_0x3ac2a9;if(_0x5adf8a['query']['includeAll']){_0x35d6fa[_0x75e0('0x3b')]=[{'all':!![]}];}return db[_0x75e0('0x2c')]['findAll'](_0x35d6fa);})['then'](function(_0x1cdaf7){_0x34d8a7[_0x75e0('0x3c')]=_0x1cdaf7;return _0x34d8a7;})[_0x75e0('0x22')](respondWithFilteredResult(_0x11f45d,_0x35d6fa))[_0x75e0('0x3d')](handleError(_0x11f45d,null));})[_0x75e0('0x3d')](handleError(_0x11f45d,null));};exports[_0x75e0('0x3e')]=function(_0x46b9b5,_0x3d1726){var _0x59af24={'raw':![],'where':{'id':_0x46b9b5['params']['id']}},_0x5e06a3={};_0x5e06a3['model']=_[_0x75e0('0x2e')](db[_0x75e0('0x2c')][_0x75e0('0x3f')]);_0x5e06a3[_0x75e0('0x2f')]=_[_0x75e0('0x2e')](_0x46b9b5[_0x75e0('0x2f')]);_0x5e06a3[_0x75e0('0x30')]=_[_0x75e0('0x31')](_0x5e06a3[_0x75e0('0x2d')],_0x5e06a3['query']);_0x59af24[_0x75e0('0x32')]=_[_0x75e0('0x31')](_0x5e06a3[_0x75e0('0x2d')],qs[_0x75e0('0x33')](_0x46b9b5['query'][_0x75e0('0x33')]));_0x59af24[_0x75e0('0x32')]=_0x59af24[_0x75e0('0x32')][_0x75e0('0x40')]?_0x59af24[_0x75e0('0x32')]:_0x5e06a3[_0x75e0('0x2d')];if(_0x46b9b5[_0x75e0('0x2f')][_0x75e0('0x41')]){_0x59af24[_0x75e0('0x3b')]=[{'all':!![]}];}_0x59af24=_['merge']({},_0x59af24,_0x46b9b5['options']);return db[_0x75e0('0x2c')][_0x75e0('0x42')](_0x59af24)['then'](handleEntityNotFound(_0x3d1726,null))[_0x75e0('0x22')](respondWithResult(_0x3d1726,null))[_0x75e0('0x3d')](handleError(_0x3d1726,null));};exports[_0x75e0('0x43')]=function(_0x1bd2ba,_0x3acc07){return db[_0x75e0('0x2c')][_0x75e0('0x43')](_0x1bd2ba['body'],{})[_0x75e0('0x22')](function(_0x1b9325){var _0x338090=_0x1bd2ba[_0x75e0('0x44')][_0x75e0('0x24')]({'plain':!![]});if(!_0x338090)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x338090['role']==='user'){var _0x1e3307=_0x1b9325[_0x75e0('0x24')]({'plain':!![]});var _0x10b6b7=_0x75e0('0x25');return db[_0x75e0('0x45')]['find']({'where':{'name':_0x10b6b7,'userProfileId':_0x338090['userProfileId']},'raw':!![]})[_0x75e0('0x22')](function(_0x4d06cf){if(_0x4d06cf&&_0x4d06cf[_0x75e0('0x46')]===0x0){return db[_0x75e0('0x47')][_0x75e0('0x43')]({'name':_0x1e3307[_0x75e0('0x29')],'resourceId':_0x1e3307['id'],'type':_0x4d06cf[_0x75e0('0x29')],'sectionId':_0x4d06cf['id']},{})[_0x75e0('0x22')](function(){return _0x1b9325;});}else{return _0x1b9325;}})[_0x75e0('0x3d')](function(_0x13cc01){logger[_0x75e0('0x27')](_0x75e0('0x48'),_0x13cc01);throw _0x13cc01;});}return _0x1b9325;})[_0x75e0('0x22')](respondWithResult(_0x3acc07,0xc9))['catch'](handleError(_0x3acc07,null));};exports[_0x75e0('0x21')]=function(_0x184731,_0x22d670){if(_0x184731[_0x75e0('0x49')]['id']){delete _0x184731[_0x75e0('0x49')]['id'];}return db['CmCompany'][_0x75e0('0x42')]({'where':{'id':_0x184731['params']['id']}})[_0x75e0('0x22')](handleEntityNotFound(_0x22d670,null))[_0x75e0('0x22')](saveUpdates(_0x184731[_0x75e0('0x49')],null))[_0x75e0('0x22')](respondWithResult(_0x22d670,null))[_0x75e0('0x3d')](handleError(_0x22d670,null));};exports[_0x75e0('0x23')]=function(_0x16c2bc,_0xd42868){return db[_0x75e0('0x2c')][_0x75e0('0x42')]({'where':{'id':_0x16c2bc[_0x75e0('0x4a')]['id']}})[_0x75e0('0x22')](handleEntityNotFound(_0xd42868,null))[_0x75e0('0x22')](removeEntity(_0xd42868,null))[_0x75e0('0x3d')](handleError(_0xd42868,null));};exports[_0x75e0('0x4b')]=function(_0x24c47f,_0x5aa152){return db[_0x75e0('0x2c')]['describe']()['then'](respondWithResult(_0x5aa152,null))[_0x75e0('0x3d')](handleError(_0x5aa152,null));};exports['addContacts']=function(_0x46b66c,_0x3c452b,_0x42cb11){return db['CmContact']['find']({'where':{'id':_0x46b66c[_0x75e0('0x4a')]['id']}})[_0x75e0('0x22')](handleEntityNotFound(_0x3c452b,null))[_0x75e0('0x22')](function(_0x3742c9){if(_0x3742c9){return _0x3742c9['addContacts'](_0x46b66c[_0x75e0('0x49')][_0x75e0('0x4c')],_[_0x75e0('0x4d')](_0x46b66c['body'],['ids','id'])||{});}})[_0x75e0('0x22')](respondWithResult(_0x3c452b,null))[_0x75e0('0x3d')](handleError(_0x3c452b,null));};exports[_0x75e0('0x4e')]=function(_0x2b13c2,_0x221b11,_0x4733ac){var _0x2e9101={};var _0x4d4e0a={};var _0x5dfc77;var _0x5e38ca;return db[_0x75e0('0x2c')][_0x75e0('0x4f')]({'where':{'id':_0x2b13c2[_0x75e0('0x4a')]['id']}})[_0x75e0('0x22')](handleEntityNotFound(_0x221b11,null))['then'](function(_0x43497c){if(_0x43497c){_0x5dfc77=_0x43497c;_0x4d4e0a[_0x75e0('0x2d')]=_[_0x75e0('0x2e')](db['CmContact']['rawAttributes']);_0x4d4e0a[_0x75e0('0x2f')]=_['keys'](_0x2b13c2['query']);_0x4d4e0a[_0x75e0('0x30')]=_[_0x75e0('0x31')](_0x4d4e0a[_0x75e0('0x2d')],_0x4d4e0a[_0x75e0('0x2f')]);_0x2e9101[_0x75e0('0x32')]=_[_0x75e0('0x31')](_0x4d4e0a[_0x75e0('0x2d')],qs[_0x75e0('0x33')](_0x2b13c2[_0x75e0('0x2f')]['fields']));_0x2e9101[_0x75e0('0x32')]=_0x2e9101[_0x75e0('0x32')][_0x75e0('0x40')]?_0x2e9101[_0x75e0('0x32')]:_0x4d4e0a[_0x75e0('0x2d')];_0x2e9101[_0x75e0('0x50')]=qs[_0x75e0('0x51')](_0x2b13c2[_0x75e0('0x2f')]['sort']);_0x2e9101[_0x75e0('0x36')]=qs['filters'](_[_0x75e0('0x52')](_0x2b13c2[_0x75e0('0x2f')],_0x4d4e0a[_0x75e0('0x30')]));if(_0x2b13c2['query']['filter']){_0x2e9101[_0x75e0('0x36')]=_['merge'](_0x2e9101[_0x75e0('0x36')],{'$or':_[_0x75e0('0x39')](_0x2e9101[_0x75e0('0x32')],function(_0x50f075){var _0x353b07={};_0x353b07[_0x50f075]={'$like':'%'+_0x2b13c2[_0x75e0('0x2f')][_0x75e0('0x37')]+'%'};return _0x353b07;})});}_0x2e9101=_[_0x75e0('0x38')]({},_0x2e9101,_0x2b13c2[_0x75e0('0x3a')]);return _0x5dfc77[_0x75e0('0x4e')](_0x2e9101);}})[_0x75e0('0x22')](function(_0xc7cece){if(_0xc7cece){_0x5e38ca=_0xc7cece[_0x75e0('0x40')];if(!_0x2b13c2['query'][_0x75e0('0x34')](_0x75e0('0x35'))){_0x2e9101['limit']=qs[_0x75e0('0x1a')](_0x2b13c2[_0x75e0('0x2f')][_0x75e0('0x1a')]);_0x2e9101[_0x75e0('0x18')]=qs[_0x75e0('0x18')](_0x2b13c2[_0x75e0('0x2f')][_0x75e0('0x18')]);}return _0x5dfc77['getContacts'](_0x2e9101);}})['then'](function(_0xf73d11){if(_0xf73d11){return _0xf73d11?{'count':_0x5e38ca,'rows':_0xf73d11}:null;}})['then'](respondWithResult(_0x221b11,null))[_0x75e0('0x3d')](handleError(_0x221b11,null));}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js index 788538d..b1cc214 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 _0xdece=['api','request-promise','path','rimraf','../../config/environment','define','cm_companies','lodash','util','../../config/logger'];(function(_0x54746e,_0x1299ac){var _0x178336=function(_0x43fe21){while(--_0x43fe21){_0x54746e['push'](_0x54746e['shift']());}};_0x178336(++_0x1299ac);}(_0xdece,0x1c9));var _0xedec=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0xdece[_0x4565bf];return _0x5610ba;};'use strict';var _=require(_0xedec('0x0'));var util=require(_0xedec('0x1'));var logger=require(_0xedec('0x2'))(_0xedec('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xedec('0x4'));var fs=require('fs');var path=require(_0xedec('0x5'));var rimraf=require(_0xedec('0x6'));var config=require(_0xedec('0x7'));var attributes=require('./cmCompany.attributes');module['exports']=function(_0x37a066,_0x128dcb){return _0x37a066[_0xedec('0x8')]('CmCompany',attributes,{'tableName':_0xedec('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdfa2=['lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','CmCompany','cm_companies'];(function(_0x5a49d3,_0x30d7b2){var _0x4f2007=function(_0x25a2dd){while(--_0x25a2dd){_0x5a49d3['push'](_0x5a49d3['shift']());}};_0x4f2007(++_0x30d7b2);}(_0xdfa2,0x75));var _0x2dfa=function(_0x30ca53,_0x447982){_0x30ca53=_0x30ca53-0x0;var _0x5ae4d1=_0xdfa2[_0x30ca53];return _0x5ae4d1;};'use strict';var _=require(_0x2dfa('0x0'));var util=require(_0x2dfa('0x1'));var logger=require(_0x2dfa('0x2'))('api');var moment=require(_0x2dfa('0x3'));var BPromise=require(_0x2dfa('0x4'));var rp=require(_0x2dfa('0x5'));var fs=require('fs');var path=require(_0x2dfa('0x6'));var rimraf=require(_0x2dfa('0x7'));var config=require(_0x2dfa('0x8'));var attributes=require('./cmCompany.attributes');module[_0x2dfa('0x9')]=function(_0x141a17,_0x45cf93){return _0x141a17[_0x2dfa('0xa')](_0x2dfa('0xb'),attributes,{'tableName':_0x2dfa('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 8b6a5cf..c952440 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 _0xcb4d=['debug','CmCompany,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','CmCompany,\x20%s,\x20%s'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0xcb4d,0x1bd));var _0xdcb4=function(_0x2ff86e,_0x1d543e){_0x2ff86e=_0x2ff86e-0x0;var _0x471b38=_0xcb4d[_0x2ff86e];return _0x471b38;};'use strict';var _=require(_0xdcb4('0x0'));var util=require(_0xdcb4('0x1'));var moment=require(_0xdcb4('0x2'));var BPromise=require(_0xdcb4('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xdcb4('0x4'));var db=require(_0xdcb4('0x5'))['db'];var utils=require(_0xdcb4('0x6'));var logger=require(_0xdcb4('0x7'))(_0xdcb4('0x8'));var config=require(_0xdcb4('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0xdcb4('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4d7435,_0x299c16,_0x636caf){return new BPromise(function(_0x42a151,_0x16c75e){return client[_0xdcb4('0xb')](_0x4d7435,_0x636caf)[_0xdcb4('0xc')](function(_0x5124f2){logger[_0xdcb4('0xd')](_0xdcb4('0xe'),_0x299c16,'request\x20sent');logger[_0xdcb4('0xf')](_0xdcb4('0x10'),_0x299c16,_0xdcb4('0x11'),JSON[_0xdcb4('0x12')](_0x5124f2));if(_0x5124f2['error']){if(_0x5124f2[_0xdcb4('0x13')][_0xdcb4('0x14')]===0x1f4){logger[_0xdcb4('0x13')](_0xdcb4('0xe'),_0x299c16,_0x5124f2['error'][_0xdcb4('0x15')]);return _0x16c75e(_0x5124f2[_0xdcb4('0x13')]['message']);}logger[_0xdcb4('0x13')](_0xdcb4('0xe'),_0x299c16,_0x5124f2['error'][_0xdcb4('0x15')]);return _0x42a151(_0x5124f2['error'][_0xdcb4('0x15')]);}else{logger[_0xdcb4('0xd')](_0xdcb4('0xe'),_0x299c16,_0xdcb4('0x11'));_0x42a151(_0x5124f2[_0xdcb4('0x16')][_0xdcb4('0x15')]);}})['catch'](function(_0x1d1093){logger['error'](_0xdcb4('0xe'),_0x299c16,_0x1d1093);_0x16c75e(_0x1d1093);});});} \ No newline at end of file +var _0x4962=['util','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','info','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','code','CmCompany,\x20%s,\x20%s','message','result'];(function(_0x37af2e,_0x2814b8){var _0xc7d84f=function(_0x3743f9){while(--_0x3743f9){_0x37af2e['push'](_0x37af2e['shift']());}};_0xc7d84f(++_0x2814b8);}(_0x4962,0x154));var _0x2496=function(_0x106268,_0x510319){_0x106268=_0x106268-0x0;var _0x4367ac=_0x4962[_0x106268];return _0x4367ac;};'use strict';var _=require('lodash');var util=require(_0x2496('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x2496('0x1'));var fs=require('fs');var Redis=require(_0x2496('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x2496('0x3'));var logger=require(_0x2496('0x4'))(_0x2496('0x5'));var config=require(_0x2496('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x2496('0x7')][_0x2496('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xb33840,_0x400b34,_0x5c194d){return new BPromise(function(_0x585816,_0x14d704){return client[_0x2496('0x9')](_0xb33840,_0x5c194d)['then'](function(_0x1169f8){logger[_0x2496('0xa')]('CmCompany,\x20%s,\x20%s',_0x400b34,_0x2496('0xb'));logger[_0x2496('0xc')](_0x2496('0xd'),_0x400b34,'request\x20sent',JSON[_0x2496('0xe')](_0x1169f8));if(_0x1169f8[_0x2496('0xf')]){if(_0x1169f8[_0x2496('0xf')][_0x2496('0x10')]===0x1f4){logger[_0x2496('0xf')](_0x2496('0x11'),_0x400b34,_0x1169f8[_0x2496('0xf')][_0x2496('0x12')]);return _0x14d704(_0x1169f8[_0x2496('0xf')][_0x2496('0x12')]);}logger[_0x2496('0xf')](_0x2496('0x11'),_0x400b34,_0x1169f8[_0x2496('0xf')]['message']);return _0x585816(_0x1169f8[_0x2496('0xf')][_0x2496('0x12')]);}else{logger[_0x2496('0xa')](_0x2496('0x11'),_0x400b34,'request\x20sent');_0x585816(_0x1169f8[_0x2496('0x13')][_0x2496('0x12')]);}})['catch'](function(_0x48cbdd){logger[_0x2496('0xf')]('CmCompany,\x20%s,\x20%s',_0x400b34,_0x48cbdd);_0x14d704(_0x48cbdd);});});} \ No newline at end of file diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js index cc6d37d..cda96bd 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 _0x4989=['exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCompany.controller','get','isAuthenticated','/describe','/:id','show','/:id/contacts','getContacts','create','post','addContacts','put','update','delete','destroy'];(function(_0x28fde4,_0x4fbc40){var _0xdc3f1b=function(_0x58f4be){while(--_0x58f4be){_0x28fde4['push'](_0x28fde4['shift']());}};_0xdc3f1b(++_0x4fbc40);}(_0x4989,0xb0));var _0x9498=function(_0x223a99,_0x1ddaff){_0x223a99=_0x223a99-0x0;var _0x5a2346=_0x4989[_0x223a99];return _0x5a2346;};'use strict';var multer=require(_0x9498('0x0'));var util=require('util');var path=require(_0x9498('0x1'));var timeout=require(_0x9498('0x2'));var express=require(_0x9498('0x3'));var router=express[_0x9498('0x4')]();var fs_extra=require(_0x9498('0x5'));var auth=require(_0x9498('0x6'));var interaction=require(_0x9498('0x7'));var config=require(_0x9498('0x8'));var controller=require(_0x9498('0x9'));router[_0x9498('0xa')]('/',auth[_0x9498('0xb')](),controller['index']);router[_0x9498('0xa')](_0x9498('0xc'),auth['isAuthenticated'](),controller['describe']);router['get'](_0x9498('0xd'),auth[_0x9498('0xb')](),controller[_0x9498('0xe')]);router['get'](_0x9498('0xf'),auth[_0x9498('0xb')](),controller[_0x9498('0x10')]);router['post']('/',auth[_0x9498('0xb')](),controller[_0x9498('0x11')]);router[_0x9498('0x12')]('/:id/contacts',auth[_0x9498('0xb')](),controller[_0x9498('0x13')]);router[_0x9498('0x14')](_0x9498('0xd'),auth[_0x9498('0xb')](),controller[_0x9498('0x15')]);router[_0x9498('0x16')](_0x9498('0xd'),auth[_0x9498('0xb')](),controller[_0x9498('0x17')]);module[_0x9498('0x18')]=router; \ No newline at end of file +var _0x5db8=['/:id/contacts','getContacts','post','create','addContacts','put','/:id','delete','exports','multer','util','connect-timeout','express','Router','../../config/environment','./cmCompany.controller','get','/describe','isAuthenticated'];(function(_0x1659c7,_0x1d2e2b){var _0xe4afb8=function(_0x41b552){while(--_0x41b552){_0x1659c7['push'](_0x1659c7['shift']());}};_0xe4afb8(++_0x1d2e2b);}(_0x5db8,0x113));var _0x85db=function(_0x2067e9,_0x5e6a97){_0x2067e9=_0x2067e9-0x0;var _0x280ce4=_0x5db8[_0x2067e9];return _0x280ce4;};'use strict';var multer=require(_0x85db('0x0'));var util=require(_0x85db('0x1'));var path=require('path');var timeout=require(_0x85db('0x2'));var express=require(_0x85db('0x3'));var router=express[_0x85db('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x85db('0x5'));var controller=require(_0x85db('0x6'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x85db('0x7')](_0x85db('0x8'),auth[_0x85db('0x9')](),controller['describe']);router[_0x85db('0x7')]('/:id',auth[_0x85db('0x9')](),controller['show']);router['get'](_0x85db('0xa'),auth[_0x85db('0x9')](),controller[_0x85db('0xb')]);router[_0x85db('0xc')]('/',auth[_0x85db('0x9')](),controller[_0x85db('0xd')]);router[_0x85db('0xc')](_0x85db('0xa'),auth[_0x85db('0x9')](),controller[_0x85db('0xe')]);router[_0x85db('0xf')](_0x85db('0x10'),auth[_0x85db('0x9')](),controller['update']);router[_0x85db('0x11')](_0x85db('0x10'),auth[_0x85db('0x9')](),controller['destroy']);module[_0x85db('0x12')]=router; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js index b6f347d..57d57ea 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 _0xc283=['sequelize','STRING','INTEGER','UNSIGNED','DATE','NOW'];(function(_0x20c444,_0x233624){var _0x1df219=function(_0x567067){while(--_0x567067){_0x20c444['push'](_0x20c444['shift']());}};_0x1df219(++_0x233624);}(_0xc283,0xcc));var _0x3c28=function(_0x10e3fb,_0x4365bc){_0x10e3fb=_0x10e3fb-0x0;var _0x57213f=_0xc283[_0x10e3fb];return _0x57213f;};'use strict';var _=require('lodash');var Sequelize=require(_0x3c28('0x0'));module['exports']={'firstName':{'type':Sequelize['STRING'],'allowNull':![]},'lastName':{'type':Sequelize[_0x3c28('0x1')]},'street':{'type':Sequelize[_0x3c28('0x1')]},'postalCode':{'type':Sequelize[_0x3c28('0x1')]},'city':{'type':Sequelize[_0x3c28('0x1')]},'country':{'type':Sequelize['STRING']},'dateOfBirth':{'type':Sequelize[_0x3c28('0x1')]},'description':{'type':Sequelize['TEXT']},'phone':{'type':Sequelize[_0x3c28('0x1')]},'mobile':{'type':Sequelize[_0x3c28('0x1')]},'fax':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x3c28('0x1')]},'url':{'type':Sequelize[_0x3c28('0x1')]},'facebook':{'type':Sequelize[_0x3c28('0x1')]},'fb_data':{'type':Sequelize[_0x3c28('0x1')]},'twitter':{'type':Sequelize[_0x3c28('0x1')]},'skype':{'type':Sequelize['STRING']},'teams':{'type':Sequelize['STRING']},'viber':{'type':Sequelize[_0x3c28('0x1')]},'line':{'type':Sequelize[_0x3c28('0x1')]},'wechat':{'type':Sequelize['STRING']},'telegram':{'type':Sequelize[_0x3c28('0x1')]},'UserId':{'type':Sequelize['INTEGER']},'AdditionalPhones':{'type':Sequelize[_0x3c28('0x1')]},'priority':{'type':Sequelize[_0x3c28('0x2')](0x2)[_0x3c28('0x3')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x3c28('0x4')],'defaultValue':Sequelize[_0x3c28('0x5')]},'dialTimezone':{'type':Sequelize['STRING']},'utcOffset':{'type':Sequelize[_0x3c28('0x2')]}}; \ No newline at end of file +var _0x4b1e=['sequelize','exports','STRING','TEXT','INTEGER','UNSIGNED','NOW'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0x4b1e,0xd2));var _0xe4b1=function(_0x3aaf0a,_0x450970){_0x3aaf0a=_0x3aaf0a-0x0;var _0x33e6bc=_0x4b1e[_0x3aaf0a];return _0x33e6bc;};'use strict';var _=require('lodash');var Sequelize=require(_0xe4b1('0x0'));module[_0xe4b1('0x1')]={'firstName':{'type':Sequelize['STRING'],'allowNull':![]},'lastName':{'type':Sequelize[_0xe4b1('0x2')]},'street':{'type':Sequelize[_0xe4b1('0x2')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0xe4b1('0x2')]},'country':{'type':Sequelize['STRING']},'dateOfBirth':{'type':Sequelize[_0xe4b1('0x2')]},'description':{'type':Sequelize[_0xe4b1('0x3')]},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize[_0xe4b1('0x2')]},'fax':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0xe4b1('0x2')]},'url':{'type':Sequelize[_0xe4b1('0x2')]},'facebook':{'type':Sequelize[_0xe4b1('0x2')]},'fb_data':{'type':Sequelize['STRING']},'twitter':{'type':Sequelize[_0xe4b1('0x2')]},'skype':{'type':Sequelize[_0xe4b1('0x2')]},'teams':{'type':Sequelize[_0xe4b1('0x2')]},'viber':{'type':Sequelize[_0xe4b1('0x2')]},'line':{'type':Sequelize[_0xe4b1('0x2')]},'wechat':{'type':Sequelize[_0xe4b1('0x2')]},'telegram':{'type':Sequelize[_0xe4b1('0x2')]},'UserId':{'type':Sequelize[_0xe4b1('0x4')]},'AdditionalPhones':{'type':Sequelize[_0xe4b1('0x2')]},'priority':{'type':Sequelize[_0xe4b1('0x4')](0x2)[_0xe4b1('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':Sequelize[_0xe4b1('0x6')]},'dialTimezone':{'type':Sequelize[_0xe4b1('0x2')]},'utcOffset':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js index 92244a6..a5ba6b4 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 _0x8ff3=['parse','meta','import','User','binding','../../components/import/cm/csv2','stringify','message','start\x20child\x20process\x20correctly!','pid','exit','error\x20child\x20process','importUpdates','agent','../../components/import/cm/csvUpdates','getJourney','mail','chat','openchannel','whatsapp','voice','-createdAt','channel','includes','toLowerCase','Invalid\x20channel','range','isValid','Invalid\x20date\x20for\x20range\x20from\x20filter','Invalid\x20date\x20for\x20range\x20to\x20filter','Invalid\x20createdAt\x20filter','destination','callerid','endtime','duration','note','createdAt','userSecondDisposition','userThirdDisposition','fullname','DESC','findAndCountAll','startCase','Website','Account','closed','closedAt','disposition','secondDisposition','thirdDisposition','key','Owner','color','browserName','customerIp','customerPort','ratingType','ratingValue','substatus','externalUrl','threadId','sortBy','reverse','value','moment','bluebird','util','path','lodash','squel','papaparse','ioredis','../../components/contacts','api','redis','localhost','socket.io-emitter','./cmContact.socket','register','status','json','offset','undefined','count','set','Content-Range','update','destroy','then','sendStatus','error','stack','name','index','describe','getOptions','findAll','query','user','CmContact','find','params','tags','length','keys','startsWith','cf_','columnName','displayName','analytics','CmCustomField','alias','custom','type','values','info','Custom\x20field\x20%s\x20not\x20found\x20on\x20cm_contacts\x20table','forEach','hasOwnProperty','catch','merge','from','get','mergeWith','isArray','join','[CmContact][merge]\x20to\x20%s\x20from\x20%s','body','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','ChatMessage','MailMessage','MailInteraction','SmsInteraction','SmsMessage','FaxInteraction','FaxMessage','CmHopperFinal','CmHopperHistory','VoiceCallReport','ChatQueueReport','FaxQueueReport','MailQueueReport','OpenchannelQueueReport','JscriptySessionReport','WhatsappMessage','WhatsappQueueReport','create','isNil','dialTimezone','timezones','utcOffset','additionalPhones','bulkCreate','each','duplicates','where','$or','push','ListId','findOrCreate','contact','all','Tag','Tags','tag','CmContactHasItem','ContactItemType','ItemType','sequelize','literal','Phones.OrderBy','$and','map','format','cf_%d','omit','pickBy','isEmpty','table','cm_contacts','setFields','id\x20=\x20?','toParam','text','phone','CmHopper','getTags','model','rawAttributes','filters','attributes','sort','pick','filter','options','nolimit','limit','setTags','findOne','ids','setAdditionalPhones','items','item_types','ItemTypeId','description','contact\x20phone\x20exists','CmHopperAdditionalPhone','item','OrderBy','PHONE','`ItemType`.OrderBy','CmHopperId','getAdditionalPhones','duplicateAdditionalPhones','fromContactId','CmContactId','toContactId','rescheduleAdditionalPhones','hopperId','getHoppers','fields','ContactId','includeAll','rows','getHopperHistories','intersection','order','getJscriptySessions','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','filename','chmodSync','child_process','fork','File\x20uploaded\x20correctly!','send','upload'];(function(_0x270adf,_0x1daaa3){var _0x29eda9=function(_0x40afec){while(--_0x40afec){_0x270adf['push'](_0x270adf['shift']());}};_0x29eda9(++_0x1daaa3);}(_0x8ff3,0x13c));var _0x38ff=function(_0x5e4a9c,_0x2c0d9b){_0x5e4a9c=_0x5e4a9c-0x0;var _0x7f3c28=_0x8ff3[_0x5e4a9c];return _0x7f3c28;};'use strict';var moment=require(_0x38ff('0x0'));var BPromise=require(_0x38ff('0x1'));var util=require(_0x38ff('0x2'));var path=require(_0x38ff('0x3'));var fs=require('fs');var _=require(_0x38ff('0x4'));var squel=require(_0x38ff('0x5'));var Papa=require(_0x38ff('0x6'));var Redis=require(_0x38ff('0x7'));var contacts=require(_0x38ff('0x8'));var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')(_0x38ff('0x9'));var config=require('../../config/environment');var shared=require('../../config/environment/shared');var db=require('../../mysqldb')['db'];config[_0x38ff('0xa')]=_['defaults'](config[_0x38ff('0xa')],{'host':_0x38ff('0xb'),'port':0x18eb});var socket=require(_0x38ff('0xc'))(new Redis(config[_0x38ff('0xa')]));require(_0x38ff('0xd'))[_0x38ff('0xe')](socket);function respondWithResult(_0x461fb7,_0xb39068){_0xb39068=_0xb39068||0xc8;return function(_0x2f87fe){if(_0x2f87fe){return _0x461fb7[_0x38ff('0xf')](_0xb39068)[_0x38ff('0x10')](_0x2f87fe);}};}function respondWithFilteredResult(_0x248c48,_0x586d4e){return function(_0x2ae110){if(_0x2ae110){var _0x2944a4=typeof _0x586d4e[_0x38ff('0x11')]===_0x38ff('0x12')&&typeof _0x586d4e['limit']===_0x38ff('0x12');var _0x5a7e16=_0x2ae110[_0x38ff('0x13')];var _0x2c6eb8=_0x2944a4?0x0:_0x586d4e[_0x38ff('0x11')];var _0x4e9827=_0x2944a4?_0x2ae110[_0x38ff('0x13')]:_0x586d4e[_0x38ff('0x11')]+_0x586d4e['limit'];var _0x4f2eb8;if(_0x4e9827>=_0x5a7e16){_0x4e9827=_0x5a7e16;_0x4f2eb8=0xc8;}else{_0x4f2eb8=0xce;}_0x248c48[_0x38ff('0xf')](_0x4f2eb8);return _0x248c48[_0x38ff('0x14')](_0x38ff('0x15'),_0x2c6eb8+'-'+_0x4e9827+'/'+_0x5a7e16)['json'](_0x2ae110);}return null;};}function saveUpdates(_0x40c4a1){return function(_0x5c5aa8){if(_0x5c5aa8){return _0x5c5aa8[_0x38ff('0x16')](_0x40c4a1)['then'](function(_0x56b3f3){return _0x56b3f3;});}return null;};}function removeEntity(_0x2ae36c){return function(_0x1b312a){if(_0x1b312a){return _0x1b312a[_0x38ff('0x17')]()[_0x38ff('0x18')](function(){_0x2ae36c[_0x38ff('0xf')](0xcc)['end']();});}};}function handleEntityNotFound(_0x26d7c5){return function(_0x485d76){if(!_0x485d76){_0x26d7c5[_0x38ff('0x19')](0x194);}return _0x485d76;};}function handleError(_0x35277f,_0x4d3829){_0x4d3829=_0x4d3829||0x1f4;return function(_0x10f4e2){logger[_0x38ff('0x1a')](_0x10f4e2[_0x38ff('0x1b')]);if(_0x10f4e2[_0x38ff('0x1c')]){delete _0x10f4e2[_0x38ff('0x1c')];}_0x35277f['status'](_0x4d3829)['send'](_0x10f4e2);};}exports[_0x38ff('0x1d')]=function(_0x16d68c,_0x429f3a){var _0x49384a={};return contacts[_0x38ff('0x1e')]()[_0x38ff('0x18')](function(_0x31f0d3){_0x49384a=qs[_0x38ff('0x1f')](_0x31f0d3,_0x16d68c);return contacts[_0x38ff('0x20')](_0x16d68c[_0x38ff('0x21')],_0x16d68c[_0x38ff('0x22')],_0x49384a,_0x31f0d3);})[_0x38ff('0x18')](respondWithFilteredResult(_0x429f3a,_0x49384a))['catch'](handleError(_0x429f3a,null));};exports['destroy']=function(_0x201ca0,_0xad57df){return db[_0x38ff('0x23')][_0x38ff('0x24')]({'where':{'id':_0x201ca0[_0x38ff('0x25')]['id']}})[_0x38ff('0x18')](handleEntityNotFound(_0xad57df,null))[_0x38ff('0x18')](removeEntity(_0xad57df,null))['catch'](handleError(_0xad57df,null));};exports[_0x38ff('0x1e')]=function(_0xb6a477,_0xd65399){return db[_0x38ff('0x23')][_0x38ff('0x1e')]()[_0x38ff('0x18')](function(_0x19bcd4){delete _0x19bcd4[_0x38ff('0x26')];for(var _0x2bc278=0x0;_0x2bc2780x0){return new Promise(function(_0x554cc8){var _0x1d2f71=[];for(var _0x20d5fa=0x0;_0x20d5fa<_0x28bd60['length'];_0x20d5fa++){_0x1d2f71[_0x38ff('0x5e')](insertAdditionalPhones(_0x28bd60[_0x20d5fa][_0x38ff('0x61')],_0x28bd60[_0x20d5fa][_0x38ff('0x58')]));}Promise[_0x38ff('0x62')](_0x1d2f71)['then'](function(){_0x554cc8(0x1);});})[_0x38ff('0x18')](function(){return{'success':_0x1a8748,'failure':_0x35fbff,'duplicates':_0x1e5b77};});}else{return{'success':_0x1a8748,'failure':_0x35fbff,'duplicates':_0x1e5b77};}}})[_0x38ff('0x18')](respondWithResult(_0x11c959,0xc9))[_0x38ff('0x37')](handleError(_0x11c959,null));};exports['show']=function(_0x551ce6,_0x21a7bf){var _0x28fdfc;return db['CmContact']['describe']()[_0x38ff('0x18')](function(_0x2e023b){return db[_0x38ff('0x23')][_0x38ff('0x24')]({'where':{'id':_0x551ce6[_0x38ff('0x25')]['id']},'include':[{'model':db[_0x38ff('0x63')],'as':_0x38ff('0x64'),'attributes':['id',_0x38ff('0x1c'),'color'],'required':_0x551ce6['query'][_0x38ff('0x65')]?!![]:![]},{'model':db[_0x38ff('0x66')],'as':'Phones','where':{'CmContactId':_0x551ce6[_0x38ff('0x25')]['id']},'required':![],'include':[{'model':db[_0x38ff('0x67')],'as':_0x38ff('0x68')}]}],'order':[db[_0x38ff('0x69')][_0x38ff('0x6a')](_0x38ff('0x6b'))],'attributes':_[_0x38ff('0x28')](_0x2e023b)});})[_0x38ff('0x18')](function(_0x743c32){if(!_[_0x38ff('0x54')](_0x743c32)){_0x28fdfc=_0x743c32['get']({'plain':!![]});var _0x58ba00={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x743c32&&_0x743c32[_0x38ff('0x5f')]){if(_0x743c32[_0x38ff('0x5f')]){_0x58ba00['where'][_0x38ff('0x6c')]['push']({'ListId':{'$ne':_0x743c32['ListId']}});}}return db['CmCustomField'][_0x38ff('0x20')](_0x58ba00);}})[_0x38ff('0x18')](function(_0xd4589b){if(!_['isNil'](_0xd4589b)){return _['omit'](_0x28fdfc,_[_0x38ff('0x6d')](_0xd4589b,function(_0x5da1fa){return util[_0x38ff('0x6e')](_0x38ff('0x6f'),_0x5da1fa['id']);}));}})[_0x38ff('0x18')](handleEntityNotFound(_0x21a7bf,null))[_0x38ff('0x18')](respondWithResult(_0x21a7bf,null))[_0x38ff('0x37')](handleError(_0x21a7bf,null));};exports[_0x38ff('0x16')]=function(_0x1db797,_0x592a47){var _0x16a9c5;if(_0x1db797['body']['id']){delete _0x1db797[_0x38ff('0x3f')]['id'];}if(!_[_0x38ff('0x54')](_0x1db797['body'][_0x38ff('0x55')])){var _0x56bfd2=_0x1db797[_0x38ff('0x3f')][_0x38ff('0x55')];if(!_[_0x38ff('0x54')](shared[_0x38ff('0x56')][_0x56bfd2]))_0x1db797[_0x38ff('0x3f')]['utcOffset']=shared[_0x38ff('0x56')][_0x56bfd2]['utcOffset'];}return db['CmContact']['find']({'where':{'id':_0x1db797[_0x38ff('0x25')]['id']}})[_0x38ff('0x18')](handleEntityNotFound(_0x592a47,null))['then'](saveUpdates(_0x1db797[_0x38ff('0x3f')],null))[_0x38ff('0x18')](function(_0x41ecca){_0x16a9c5=_0x41ecca;var _0x38013f={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x41ecca&&_0x41ecca[_0x38ff('0x5f')]){if(_0x41ecca[_0x38ff('0x5f')]){_0x38013f[_0x38ff('0x5c')][_0x38ff('0x6c')][_0x38ff('0x5e')]({'ListId':{'$ne':_0x41ecca['ListId']}});}}return db['CmCustomField'][_0x38ff('0x20')](_0x38013f);})[_0x38ff('0x18')](function(_0x542ed2){if(_0x542ed2){return _[_0x38ff('0x70')](_[_0x38ff('0x71')](_0x1db797['body'],function(_0x1d992f,_0x25fd03){return _[_0x38ff('0x29')](_0x25fd03,_0x38ff('0x2a'));}),_['map'](_0x542ed2,function(_0x2258ea){return util[_0x38ff('0x6e')]('cf_%d',_0x2258ea['id']);}));}})[_0x38ff('0x18')](function(_0x14eae6){if(_0x14eae6&&!_[_0x38ff('0x72')](_0x14eae6)){var _0x30cb49=squel[_0x38ff('0x16')]()[_0x38ff('0x73')](_0x38ff('0x74'))[_0x38ff('0x75')](_0x14eae6)[_0x38ff('0x5c')](_0x38ff('0x76'),_0x1db797[_0x38ff('0x25')]['id'])[_0x38ff('0x77')]();return db[_0x38ff('0x69')][_0x38ff('0x21')](_0x30cb49[_0x38ff('0x78')],{'replacements':_0x30cb49[_0x38ff('0x32')]});}})[_0x38ff('0x18')](function(){if(_0x1db797[_0x38ff('0x3f')][_0x38ff('0x79')]&&_0x16a9c5){return db[_0x38ff('0x7a')][_0x38ff('0x16')]({'phone':_0x1db797[_0x38ff('0x3f')]['phone'],'OrderBy':0x0},{'where':{'ContactId':_0x16a9c5['id']}});}})[_0x38ff('0x18')](function(){return _0x16a9c5;})['then'](respondWithResult(_0x592a47,null))[_0x38ff('0x37')](handleError(_0x592a47,null));};exports[_0x38ff('0x7b')]=function(_0xdb1a3d,_0x3e0a32){var _0x4931fc={};var _0x31490b={};var _0x152415;var _0x242cfd;return db[_0x38ff('0x23')]['findOne']({'where':{'id':_0xdb1a3d[_0x38ff('0x25')]['id']}})[_0x38ff('0x18')](handleEntityNotFound(_0x3e0a32,null))[_0x38ff('0x18')](function(_0x20d639){if(_0x20d639){_0x152415=_0x20d639;_0x31490b[_0x38ff('0x7c')]=_[_0x38ff('0x28')](db[_0x38ff('0x63')][_0x38ff('0x7d')]);_0x31490b[_0x38ff('0x21')]=_[_0x38ff('0x28')](_0xdb1a3d[_0x38ff('0x21')]);_0x31490b[_0x38ff('0x7e')]=_['intersection'](_0x31490b['model'],_0x31490b['query']);_0x4931fc[_0x38ff('0x7f')]=_['intersection'](_0x31490b[_0x38ff('0x7c')],qs['fields'](_0xdb1a3d[_0x38ff('0x21')]['fields']));_0x4931fc[_0x38ff('0x7f')]=_0x4931fc['attributes']['length']?_0x4931fc[_0x38ff('0x7f')]:_0x31490b[_0x38ff('0x7c')];_0x4931fc['order']=qs[_0x38ff('0x80')](_0xdb1a3d[_0x38ff('0x21')]['sort']);_0x4931fc[_0x38ff('0x5c')]=qs[_0x38ff('0x7e')](_[_0x38ff('0x81')](_0xdb1a3d[_0x38ff('0x21')],_0x31490b[_0x38ff('0x7e')]));if(_0xdb1a3d['query'][_0x38ff('0x82')]){_0x4931fc[_0x38ff('0x5c')]=_['merge'](_0x4931fc[_0x38ff('0x5c')],{'$or':_[_0x38ff('0x6d')](_0x4931fc[_0x38ff('0x7f')],function(_0x519372){var _0x30e7f2={};_0x30e7f2[_0x519372]={'$like':'%'+_0xdb1a3d[_0x38ff('0x21')][_0x38ff('0x82')]+'%'};return _0x30e7f2;})});}_0x4931fc=_['merge']({},_0x4931fc,_0xdb1a3d[_0x38ff('0x83')]);return _0x152415[_0x38ff('0x7b')](_0x4931fc);}})[_0x38ff('0x18')](function(_0x402a02){if(_0x402a02){_0x242cfd=_0x402a02[_0x38ff('0x27')];if(!_0xdb1a3d[_0x38ff('0x21')][_0x38ff('0x36')](_0x38ff('0x84'))){_0x4931fc[_0x38ff('0x85')]=qs['limit'](_0xdb1a3d[_0x38ff('0x21')][_0x38ff('0x85')]);_0x4931fc[_0x38ff('0x11')]=qs[_0x38ff('0x11')](_0xdb1a3d[_0x38ff('0x21')][_0x38ff('0x11')]);}return _0x152415[_0x38ff('0x7b')](_0x4931fc);}})[_0x38ff('0x18')](function(_0x253f11){if(_0x253f11){return _0x253f11?{'count':_0x242cfd,'rows':_0x253f11}:null;}})['then'](respondWithResult(_0x3e0a32,null))['catch'](handleError(_0x3e0a32,null));};exports[_0x38ff('0x86')]=function(_0x3d540c,_0x1c9cdf){if(_0x3d540c[_0x38ff('0x3f')]['id']){delete _0x3d540c['body']['id'];}return db['CmContact'][_0x38ff('0x87')]({'where':{'id':_0x3d540c['params']['id']}})[_0x38ff('0x18')](handleEntityNotFound(_0x1c9cdf,null))[_0x38ff('0x18')](function(_0x400180){if(_0x400180){return _0x400180['setTags'](_0x3d540c[_0x38ff('0x3f')][_0x38ff('0x88')]||[]);}return null;})[_0x38ff('0x18')](respondWithResult(_0x1c9cdf,null))[_0x38ff('0x37')](handleError(_0x1c9cdf,null));};exports[_0x38ff('0x89')]=function(_0xcd6140,_0x1d1c2a){var _0x284093=[];_0x284093['push'](addAdditionalPhones(_0xcd6140['body']));Promise[_0x38ff('0x62')](_0x284093)[_0x38ff('0x18')](function(){_0x284093=[];_0x284093[_0x38ff('0x5e')](deleteCmHopperPhones(_0xcd6140[_0x38ff('0x3f')]['id']));_0x284093[_0x38ff('0x5e')](addCmHopperPhones(_0xcd6140['body']['id']));Promise[_0x38ff('0x62')](_0x284093)['then'](function(){return[0x1];})[_0x38ff('0x18')](respondWithResult(_0x1d1c2a,null));});};function addAdditionalPhones(_0x59fc7f){var _0x367684;return new Promise(function(_0x648e66){return db['CmContactHasItem'][_0x38ff('0x17')]({'where':{'CmContactId':_0x59fc7f['id']}})[_0x38ff('0x18')](function(){db[_0x38ff('0x67')]['findAll']({'raw':!![],'attributes':['id','OrderBy']})[_0x38ff('0x18')](function(_0x48d115){var _0x2bca10=[];for(var _0x2a8bd7=0x0;_0x2a8bd7<_0x59fc7f[_0x38ff('0x8a')]['length'];_0x2a8bd7++){var _0x42baaa=_0x59fc7f['item_types']?_[_0x38ff('0x54')](_0x59fc7f[_0x38ff('0x8b')][_0x2a8bd7])?'':_0x59fc7f[_0x38ff('0x8b')][_0x2a8bd7]:_0x59fc7f[_0x38ff('0x8a')][_0x2a8bd7][_0x38ff('0x8c')]?_0x59fc7f['items'][_0x2a8bd7][_0x38ff('0x8c')]:'';var _0x46ca7a=_[_0x38ff('0x54')](_0x59fc7f[_0x38ff('0x8a')][_0x2a8bd7][_0x38ff('0x8d')])?'':_0x59fc7f[_0x38ff('0x8a')][_0x2a8bd7]['description'];var _0x149d6c=_0x42baaa+':'+_0x59fc7f['items'][_0x2a8bd7][_0x38ff('0x79')]+'§'+_0x46ca7a;if(_[_0x38ff('0x54')](_0x367684))_0x367684=_0x149d6c;else _0x367684+=';'+_0x149d6c;var _0x20896e=null;var _0x176b6d=null;if(_0x59fc7f['item_types']){if(!_[_0x38ff('0x54')](_0x59fc7f[_0x38ff('0x8b')][_0x2a8bd7])){_0x176b6d=_[_0x38ff('0x24')](_0x48d115,function(_0x9ce1e0){return _0x9ce1e0['id']===_0x59fc7f['item_types'][_0x2a8bd7];});if(!_[_0x38ff('0x54')](_0x176b6d)){_0x20896e=_0x176b6d['OrderBy'];}}}else{if(!_[_0x38ff('0x54')](_0x59fc7f['items'][_0x2a8bd7])){_0x176b6d=_['find'](_0x48d115,function(_0x185ef8){return _0x185ef8['id']===_0x59fc7f['items'][_0x2a8bd7][_0x38ff('0x8c')];});if(!_[_0x38ff('0x54')](_0x176b6d)){_0x20896e=_0x2a8bd7;}}}if(_[_0x38ff('0x54')](_0x20896e)){_0x20896e=0x64;}_0x2bca10[_0x38ff('0x5e')](addAdditionalPhone(_0x59fc7f['id'],_0x59fc7f[_0x38ff('0x8a')][_0x2a8bd7]['phone'],_0x59fc7f[_0x38ff('0x8b')]?_[_0x38ff('0x54')](_0x59fc7f[_0x38ff('0x8b')][_0x2a8bd7])?null:_0x59fc7f['item_types'][_0x2a8bd7]:_0x59fc7f[_0x38ff('0x8a')][_0x2a8bd7][_0x38ff('0x8c')]?_0x59fc7f['items'][_0x2a8bd7][_0x38ff('0x8c')]:null,_0x20896e,_0x46ca7a));}Promise[_0x38ff('0x62')](_0x2bca10)[_0x38ff('0x18')](function(){db['CmContact'][_0x38ff('0x16')]({'AdditionalPhones':_0x367684},{'where':{'id':_0x59fc7f['id']}})['then'](function(){_0x648e66(0x1);});});});});});}function addAdditionalPhone(_0x9656a0,_0x25f4ca,_0x31d223,_0x27ab73,_0x4e5b2d){return db[_0x38ff('0x66')][_0x38ff('0x24')]({'where':{'CmContactId':_0x9656a0,'item':_0x25f4ca}})[_0x38ff('0x18')](function(_0x38a8b8){if(_0x38a8b8)logger[_0x38ff('0x33')](_0x38ff('0x8e'),_0x38a8b8);else{db['CmContactHasItem'][_0x38ff('0x53')]({'CmContactId':_0x9656a0,'item':_0x25f4ca,'ItemTypeId':_0x31d223,'OrderBy':_0x27ab73,'ItemClass':'PHONE','description':_0x4e5b2d});}});}function deleteCmHopperPhones(_0x11b14d){return new Promise(function(_0x4874b0){return db[_0x38ff('0x7a')][_0x38ff('0x20')]({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x11b14d}})[_0x38ff('0x18')](function(_0x3ae93e){db[_0x38ff('0x8f')][_0x38ff('0x17')]({'where':{'CmHopperId':{'$in':_['map'](_0x3ae93e,'id')}}});})['then'](function(){_0x4874b0(0x1);});});}function addCmHopperPhones(_0x304ce6){return new Promise(function(_0x8d43b1){return db[_0x38ff('0x7a')][_0x38ff('0x20')]({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x304ce6}})[_0x38ff('0x18')](function(_0x59df52){var _0x551da6=[];_[_0x38ff('0x6d')](_0x59df52,function(_0x216eb4){_0x551da6[_0x38ff('0x5e')](createCmHopperPhone(_0x304ce6,_0x216eb4['id']));});Promise[_0x38ff('0x62')](_0x551da6)[_0x38ff('0x18')](function(){_0x8d43b1(0x1);});});});}function createCmHopperPhone(_0x33965e,_0x5d8879){return new Promise(function(_0x4bdcf3){db[_0x38ff('0x66')][_0x38ff('0x20')]({'raw':!![],'attributes':[_0x38ff('0x90'),_0x38ff('0x91')],'where':{'CmContactId':_0x33965e,'ItemClass':_0x38ff('0x92')},'include':[{'model':db[_0x38ff('0x67')],'attributes':[_0x38ff('0x91')],'as':'ItemType'}],'order':['OrderBy',db[_0x38ff('0x69')]['literal'](_0x38ff('0x93'))]})[_0x38ff('0x18')](function(_0x420e71){var _0x5dc034=0x1;var _0x669e11=_[_0x38ff('0x6d')](_0x420e71,function(_0x160e84){_0x160e84[_0x38ff('0x94')]=_0x5d8879;_0x160e84[_0x38ff('0x79')]=_0x160e84[_0x38ff('0x90')];_0x160e84[_0x38ff('0x91')]=_0x5dc034;delete _0x160e84['ItemType.OrderBy'];_0x5dc034=_0x5dc034+0x1;return _0x160e84;});return db['CmHopperAdditionalPhone'][_0x38ff('0x59')](_0x669e11,{});})['then'](function(){_0x4bdcf3(0x1);});});}function insertAdditionalPhones(_0x76d0f0,_0x16917e){return new Promise(function(_0x354f97){var _0x136beb=[];for(var _0x54342e=0x0;_0x54342e<_0x16917e['length'];_0x54342e++){var _0x22a8c4=_0x16917e[_0x54342e];_0x136beb[_0x38ff('0x5e')](parseContactItemType(_0x22a8c4));}Promise['all'](_0x136beb)[_0x38ff('0x18')](function(){var _0x23311e={'id':_0x76d0f0['id'],'items':_0x16917e};return addAdditionalPhones(_0x23311e)[_0x38ff('0x18')](function(){return addCmHopperPhones(_0x76d0f0['id']);});})[_0x38ff('0x18')](function(){_0x354f97(_0x76d0f0);});});}function parseContactItemType(_0x57e703){return new Promise(function(_0x4c5350){if(_0x57e703[_0x38ff('0x36')](_0x38ff('0x8c'))){_0x4c5350(_0x57e703);}else{return db[_0x38ff('0x67')]['find']({'where':{'name':_0x57e703[_0x38ff('0x68')]}})[_0x38ff('0x18')](function(_0x500018){if(_['isNil'](_0x500018))_0x57e703[_0x38ff('0x8c')]=null;else _0x57e703['ItemTypeId']=_0x500018['id'];_0x4c5350(_0x57e703);});}});}exports[_0x38ff('0x95')]=function(_0xce555d,_0x5183d3){return db['CmContactHasItem'][_0x38ff('0x20')]({'raw':!![],'where':{'CmContactId':_0xce555d[_0x38ff('0x25')]['id'],'ItemClass':_0x38ff('0x92')},'include':[{'model':db['ContactItemType'],'as':_0x38ff('0x68')}],'order':[['OrderBy'],[db[_0x38ff('0x69')][_0x38ff('0x6a')](_0x38ff('0x93'))]]})['then'](function(_0x3ff8ab){return _0x3ff8ab;})[_0x38ff('0x18')](respondWithResult(_0x5183d3,null))[_0x38ff('0x37')](handleError(_0x5183d3,null));};exports[_0x38ff('0x96')]=function(_0x51b0f6,_0x126c3b){return db[_0x38ff('0x66')]['findAll']({'raw':!![],'where':{'CmContactId':_0x51b0f6[_0x38ff('0x3f')][_0x38ff('0x97')]}})['then'](function(_0x1f69f9){var _0x211807=_[_0x38ff('0x6d')](_0x1f69f9,function(_0x84c8da){_0x84c8da[_0x38ff('0x98')]=_0x51b0f6[_0x38ff('0x3f')][_0x38ff('0x99')];return _0x84c8da;});return db[_0x38ff('0x66')][_0x38ff('0x59')](_0x211807,{});})['then'](function(){return addCmHopperPhones(_0x51b0f6['body'][_0x38ff('0x99')]);})[_0x38ff('0x18')](function(){return['ok'];})[_0x38ff('0x18')](respondWithResult(_0x126c3b,null))['catch'](handleError(_0x126c3b,null));};exports[_0x38ff('0x9a')]=function(_0x36c8cb,_0x1255a9){var _0x4312eb=[];_0x4312eb[_0x38ff('0x5e')](createCmHopperPhone(_0x36c8cb['body']['id'],_0x36c8cb[_0x38ff('0x3f')][_0x38ff('0x9b')]));Promise['all'](_0x4312eb)[_0x38ff('0x18')](function(){return[0x1];})['then'](respondWithResult(_0x1255a9,null));};exports[_0x38ff('0x9c')]=function(_0xb8c8a8,_0xa43392){var _0x1d6c54={'raw':![],'where':{}};var _0x4e0125={};var _0x27c8a7={'count':0x0,'rows':[]};return db['CmContact'][_0x38ff('0x87')]({'where':{'id':_0xb8c8a8[_0x38ff('0x25')]['id']}})[_0x38ff('0x18')](handleEntityNotFound(_0xa43392,null))[_0x38ff('0x18')](function(_0x732487){if(_0x732487){_0x4e0125['model']=_[_0x38ff('0x28')](db['CmHopper']['rawAttributes']);_0x4e0125[_0x38ff('0x21')]=_[_0x38ff('0x28')](_0xb8c8a8['query']);_0x4e0125[_0x38ff('0x7e')]=_['intersection'](_0x4e0125[_0x38ff('0x7c')],_0x4e0125['query']);_0x1d6c54[_0x38ff('0x7f')]=_['intersection'](_0x4e0125[_0x38ff('0x7c')],qs['fields'](_0xb8c8a8['query'][_0x38ff('0x9d')]));_0x1d6c54[_0x38ff('0x7f')]=_0x1d6c54['attributes'][_0x38ff('0x27')]?_0x1d6c54[_0x38ff('0x7f')]:_0x4e0125[_0x38ff('0x7c')];if(!_0xb8c8a8[_0x38ff('0x21')][_0x38ff('0x36')](_0x38ff('0x84'))){_0x1d6c54[_0x38ff('0x85')]=qs['limit'](_0xb8c8a8['query'][_0x38ff('0x85')]);_0x1d6c54[_0x38ff('0x11')]=qs[_0x38ff('0x11')](_0xb8c8a8['query'][_0x38ff('0x11')]);}_0x1d6c54['order']=qs['sort'](_0xb8c8a8[_0x38ff('0x21')][_0x38ff('0x80')]);_0x1d6c54[_0x38ff('0x5c')]=qs[_0x38ff('0x7e')](_[_0x38ff('0x81')](_0xb8c8a8[_0x38ff('0x21')],_0x4e0125[_0x38ff('0x7e')]));_0x1d6c54[_0x38ff('0x5c')][_0x38ff('0x9e')]=_0x732487['id'];if(_0xb8c8a8['query'][_0x38ff('0x82')]){_0x1d6c54[_0x38ff('0x5c')]=_[_0x38ff('0x38')](_0x1d6c54['where'],{'$or':_[_0x38ff('0x6d')](_0x1d6c54['attributes'],function(_0x279cfe){var _0x510e94={};_0x510e94[_0x279cfe]={'$like':'%'+_0xb8c8a8['query'][_0x38ff('0x82')]+'%'};return _0x510e94;})});}_0x1d6c54=_[_0x38ff('0x38')]({},_0x1d6c54,_0xb8c8a8['options']);return db['CmHopper'][_0x38ff('0x13')]({'where':_0x1d6c54[_0x38ff('0x5c')]})[_0x38ff('0x18')](function(_0x2a9801){_0x27c8a7[_0x38ff('0x13')]=_0x2a9801;if(_0xb8c8a8[_0x38ff('0x21')][_0x38ff('0x9f')]){_0x1d6c54['include']=[{'all':!![]}];}return db[_0x38ff('0x7a')]['findAll'](_0x1d6c54);})[_0x38ff('0x18')](function(_0x47aa31){_0x27c8a7[_0x38ff('0xa0')]=_0x47aa31;return _0x27c8a7;});}})[_0x38ff('0x18')](respondWithFilteredResult(_0xa43392,_0x1d6c54))[_0x38ff('0x37')](handleError(_0xa43392,null));};exports[_0x38ff('0xa1')]=function(_0xe2b1f8,_0x5305a8){var _0x13c678={'raw':!![],'where':{}};var _0x4bf05c={};var _0x2d8d9d={'count':0x0,'rows':[]};return db[_0x38ff('0x23')]['findOne']({'where':{'id':_0xe2b1f8['params']['id']}})['then'](handleEntityNotFound(_0x5305a8,null))[_0x38ff('0x18')](function(_0x3b9542){if(_0x3b9542){_0x4bf05c[_0x38ff('0x7c')]=_[_0x38ff('0x28')](db[_0x38ff('0x4a')][_0x38ff('0x7d')]);_0x4bf05c[_0x38ff('0x21')]=_['keys'](_0xe2b1f8[_0x38ff('0x21')]);_0x4bf05c[_0x38ff('0x7e')]=_['intersection'](_0x4bf05c[_0x38ff('0x7c')],_0x4bf05c[_0x38ff('0x21')]);_0x13c678[_0x38ff('0x7f')]=_[_0x38ff('0xa2')](_0x4bf05c[_0x38ff('0x7c')],qs[_0x38ff('0x9d')](_0xe2b1f8['query'][_0x38ff('0x9d')]));_0x13c678['attributes']=_0x13c678[_0x38ff('0x7f')][_0x38ff('0x27')]?_0x13c678[_0x38ff('0x7f')]:_0x4bf05c[_0x38ff('0x7c')];if(!_0xe2b1f8[_0x38ff('0x21')]['hasOwnProperty'](_0x38ff('0x84'))){_0x13c678[_0x38ff('0x85')]=qs['limit'](_0xe2b1f8[_0x38ff('0x21')][_0x38ff('0x85')]);_0x13c678[_0x38ff('0x11')]=qs[_0x38ff('0x11')](_0xe2b1f8[_0x38ff('0x21')][_0x38ff('0x11')]);}_0x13c678[_0x38ff('0xa3')]=qs[_0x38ff('0x80')](_0xe2b1f8[_0x38ff('0x21')]['sort']);_0x13c678['where']=qs[_0x38ff('0x7e')](_[_0x38ff('0x81')](_0xe2b1f8[_0x38ff('0x21')],_0x4bf05c['filters']));_0x13c678[_0x38ff('0x5c')][_0x38ff('0x9e')]=_0x3b9542['id'];if(_0xe2b1f8['query'][_0x38ff('0x82')]){_0x13c678[_0x38ff('0x5c')]=_[_0x38ff('0x38')](_0x13c678[_0x38ff('0x5c')],{'$or':_[_0x38ff('0x6d')](_0x13c678[_0x38ff('0x7f')],function(_0x5c48cd){var _0x2ff1b7={};_0x2ff1b7[_0x5c48cd]={'$like':'%'+_0xe2b1f8[_0x38ff('0x21')][_0x38ff('0x82')]+'%'};return _0x2ff1b7;})});}_0x13c678=_[_0x38ff('0x38')]({},_0x13c678,_0xe2b1f8['options']);return db[_0x38ff('0x4a')]['count']({'where':_0x13c678['where']})['then'](function(_0x4af3ac){_0x2d8d9d[_0x38ff('0x13')]=_0x4af3ac;if(_0xe2b1f8[_0x38ff('0x21')]['includeAll']){_0x13c678['include']=[{'all':!![]}];}return db[_0x38ff('0x4a')]['findAll'](_0x13c678);})[_0x38ff('0x18')](function(_0x3c60e4){_0x2d8d9d[_0x38ff('0xa0')]=_0x3c60e4;return _0x2d8d9d;});}})['then'](respondWithFilteredResult(_0x5305a8,_0x13c678))[_0x38ff('0x37')](handleError(_0x5305a8,null));};exports['getHopperFinals']=function(_0x3275f2,_0x2623c2){var _0xf27127={'raw':!![],'where':{}};var _0x5804d8={};var _0x28a299={'count':0x0,'rows':[]};return db[_0x38ff('0x23')]['findOne']({'where':{'id':_0x3275f2['params']['id']}})['then'](handleEntityNotFound(_0x2623c2,null))[_0x38ff('0x18')](function(_0x366ea5){if(_0x366ea5){_0x5804d8[_0x38ff('0x7c')]=_[_0x38ff('0x28')](db[_0x38ff('0x49')][_0x38ff('0x7d')]);_0x5804d8[_0x38ff('0x21')]=_['keys'](_0x3275f2[_0x38ff('0x21')]);_0x5804d8[_0x38ff('0x7e')]=_[_0x38ff('0xa2')](_0x5804d8[_0x38ff('0x7c')],_0x5804d8[_0x38ff('0x21')]);_0xf27127[_0x38ff('0x7f')]=_[_0x38ff('0xa2')](_0x5804d8[_0x38ff('0x7c')],qs['fields'](_0x3275f2['query']['fields']));_0xf27127[_0x38ff('0x7f')]=_0xf27127[_0x38ff('0x7f')]['length']?_0xf27127[_0x38ff('0x7f')]:_0x5804d8[_0x38ff('0x7c')];if(!_0x3275f2[_0x38ff('0x21')][_0x38ff('0x36')](_0x38ff('0x84'))){_0xf27127[_0x38ff('0x85')]=qs[_0x38ff('0x85')](_0x3275f2[_0x38ff('0x21')][_0x38ff('0x85')]);_0xf27127[_0x38ff('0x11')]=qs[_0x38ff('0x11')](_0x3275f2[_0x38ff('0x21')][_0x38ff('0x11')]);}_0xf27127[_0x38ff('0xa3')]=qs[_0x38ff('0x80')](_0x3275f2['query']['sort']);_0xf27127['where']=qs[_0x38ff('0x7e')](_[_0x38ff('0x81')](_0x3275f2[_0x38ff('0x21')],_0x5804d8[_0x38ff('0x7e')]));_0xf27127['where']['ContactId']=_0x366ea5['id'];if(_0x3275f2['query'][_0x38ff('0x82')]){_0xf27127[_0x38ff('0x5c')]=_[_0x38ff('0x38')](_0xf27127[_0x38ff('0x5c')],{'$or':_[_0x38ff('0x6d')](_0xf27127['attributes'],function(_0xde9bf9){var _0x4a5cdd={};_0x4a5cdd[_0xde9bf9]={'$like':'%'+_0x3275f2[_0x38ff('0x21')]['filter']+'%'};return _0x4a5cdd;})});}_0xf27127=_[_0x38ff('0x38')]({},_0xf27127,_0x3275f2[_0x38ff('0x83')]);return db[_0x38ff('0x49')][_0x38ff('0x13')]({'where':_0xf27127[_0x38ff('0x5c')]})[_0x38ff('0x18')](function(_0x3f85c8){_0x28a299[_0x38ff('0x13')]=_0x3f85c8;if(_0x3275f2['query'][_0x38ff('0x9f')]){_0xf27127['include']=[{'all':!![]}];}return db[_0x38ff('0x49')][_0x38ff('0x20')](_0xf27127);})[_0x38ff('0x18')](function(_0x3b94eb){_0x28a299[_0x38ff('0xa0')]=_0x3b94eb;return _0x28a299;});}})[_0x38ff('0x18')](respondWithFilteredResult(_0x2623c2,_0xf27127))[_0x38ff('0x37')](handleError(_0x2623c2,null));};exports[_0x38ff('0xa4')]=function(_0x4be09c,_0x5146e1){var _0x4e6438={'raw':!![],'where':{}};var _0x1e17a2={};var _0x1192a1={'count':0x0,'rows':[]};return db[_0x38ff('0x23')][_0x38ff('0x87')]({'where':{'id':_0x4be09c[_0x38ff('0x25')]['id']}})[_0x38ff('0x18')](handleEntityNotFound(_0x5146e1,null))[_0x38ff('0x18')](function(_0x10a7c8){if(_0x10a7c8){_0x1e17a2['model']=_['keys'](db[_0x38ff('0x50')][_0x38ff('0x7d')]);_0x1e17a2[_0x38ff('0x21')]=_[_0x38ff('0x28')](_0x4be09c[_0x38ff('0x21')]);_0x1e17a2[_0x38ff('0x7e')]=_[_0x38ff('0xa2')](_0x1e17a2[_0x38ff('0x7c')],_0x1e17a2[_0x38ff('0x21')]);_0x4e6438['attributes']=_[_0x38ff('0xa2')](_0x1e17a2[_0x38ff('0x7c')],qs[_0x38ff('0x9d')](_0x4be09c[_0x38ff('0x21')][_0x38ff('0x9d')]));_0x4e6438[_0x38ff('0x7f')]=_0x4e6438['attributes'][_0x38ff('0x27')]?_0x4e6438[_0x38ff('0x7f')]:_0x1e17a2['model'];if(!_0x4be09c['query']['hasOwnProperty']('nolimit')){_0x4e6438['limit']=qs[_0x38ff('0x85')](_0x4be09c[_0x38ff('0x21')][_0x38ff('0x85')]);_0x4e6438[_0x38ff('0x11')]=qs[_0x38ff('0x11')](_0x4be09c[_0x38ff('0x21')][_0x38ff('0x11')]);}_0x4e6438[_0x38ff('0xa3')]=qs[_0x38ff('0x80')](_0x4be09c[_0x38ff('0x21')][_0x38ff('0x80')]);_0x4e6438[_0x38ff('0x5c')]=qs[_0x38ff('0x7e')](_[_0x38ff('0x81')](_0x4be09c[_0x38ff('0x21')],_0x1e17a2[_0x38ff('0x7e')]));_0x4e6438['where'][_0x38ff('0x9e')]=_0x10a7c8['id'];if(_0x4be09c[_0x38ff('0x21')][_0x38ff('0x82')]){_0x4e6438[_0x38ff('0x5c')]=_[_0x38ff('0x38')](_0x4e6438[_0x38ff('0x5c')],{'$or':_[_0x38ff('0x6d')](_0x4e6438[_0x38ff('0x7f')],function(_0x4c3d87){var _0x25af46={};_0x25af46[_0x4c3d87]={'$like':'%'+_0x4be09c[_0x38ff('0x21')][_0x38ff('0x82')]+'%'};return _0x25af46;})});}_0x4e6438=_[_0x38ff('0x38')]({},_0x4e6438,_0x4be09c['options']);return db[_0x38ff('0x50')][_0x38ff('0x13')]({'where':_0x4e6438[_0x38ff('0x5c')]})['then'](function(_0xa63d1c){_0x1192a1[_0x38ff('0x13')]=_0xa63d1c;if(_0x4be09c[_0x38ff('0x21')][_0x38ff('0x9f')]){_0x4e6438['include']=[{'all':!![]}];}return db[_0x38ff('0x50')][_0x38ff('0x20')](_0x4e6438);})[_0x38ff('0x18')](function(_0x1e8770){_0x1192a1['rows']=_0x1e8770;return _0x1192a1;});}})['then'](respondWithFilteredResult(_0x5146e1,_0x4e6438))[_0x38ff('0x37')](handleError(_0x5146e1,null));};exports[_0x38ff('0xa5')]=function(_0x7e9bc9,_0x31d6c6){try{if(!_0x7e9bc9[_0x38ff('0x3f')][_0x38ff('0x5f')]){throw new Error(_0x38ff('0xa6'));}if(!_0x7e9bc9[_0x38ff('0x3f')][_0x38ff('0xa7')]){throw new Error(_0x38ff('0xa8'));}if(!_0x7e9bc9[_0x38ff('0x3f')][_0x38ff('0xa9')]){throw new Error(_0x38ff('0xaa'));}if(!_0x7e9bc9[_0x38ff('0x3f')][_0x38ff('0xab')]){throw new Error(_0x38ff('0xac'));}var _0x1a7b97=_0x7e9bc9[_0x38ff('0x3f')]['binding_keys'][_0x38ff('0xad')](',');var _0xa7e59b=_0x7e9bc9[_0x38ff('0x3f')][_0x38ff('0xa9')][_0x38ff('0xad')](',');if(!_0x1a7b97['length']||!_0xa7e59b[_0x38ff('0x27')]||_0x1a7b97[_0x38ff('0x27')]!==_0xa7e59b[_0x38ff('0x27')]){throw new Error(_0x38ff('0xae'));}_0x7e9bc9[_0x38ff('0x3f')][_0x38ff('0x9d')]=_[_0x38ff('0xaf')](_0x1a7b97,_0xa7e59b);if(!_0x7e9bc9[_0x38ff('0x3f')][_0x38ff('0x9d')][_0x38ff('0x79')]){throw new Error(_0x38ff('0xb0'));}if(!_0x7e9bc9[_0x38ff('0x3f')][_0x38ff('0x9d')][_0x38ff('0xb1')]){throw new Error(_0x38ff('0xb2'));}var _0x1798a5=path[_0x38ff('0x3d')](config[_0x38ff('0xb3')],'server/files/tmp',_0x7e9bc9[_0x38ff('0xb4')][_0x38ff('0xb5')]);fs[_0x38ff('0xb6')](_0x1798a5,parseInt('0777',0x8));var _0x2822af=require(_0x38ff('0xb7'))[_0x38ff('0xb8')](path[_0x38ff('0x3d')](__dirname,'../../components/import/cm/csv'),[_0x1798a5,_0x7e9bc9[_0x38ff('0x3f')]['binding_keys'],_0x7e9bc9[_0x38ff('0x3f')][_0x38ff('0xa9')],_0x7e9bc9['body']['ListId'],_0x7e9bc9['body']['CompanyId'],_0x7e9bc9[_0x38ff('0x3f')]['duplicates'],_0x7e9bc9[_0x38ff('0x3f')][_0x38ff('0xab')]]);return _0x31d6c6[_0x38ff('0xf')](0xc8)[_0x38ff('0x10')]({'message':_0x38ff('0xb9'),'pid':_0x2822af['pid']});}catch(_0x3194dc){return _0x31d6c6['status'](0x1f4)[_0x38ff('0xba')](_0x3194dc);}};exports[_0x38ff('0xbb')]=function(_0x34a705,_0x360503){var _0x4ea509=fs['createReadStream'](_0x34a705[_0x38ff('0xb4')][_0x38ff('0x3')]);Papa[_0x38ff('0xbc')](_0x4ea509,{'header':!![],'skipEmptyLines':!![],'preview':0x1,'complete':function(_0x1bccbf){return _0x360503['status'](0xc8)['json']({'file':_0x34a705[_0x38ff('0xb4')],'fields':_0x1bccbf[_0x38ff('0xbd')][_0x38ff('0x9d')]});}});};exports[_0x38ff('0xbe')]=function(_0x26c43e,_0x3fcd8b){return db[_0x38ff('0xbf')][_0x38ff('0x20')]({'raw':!![],'attributes':['id'],'where':{'role':'agent'}})[_0x38ff('0x18')](function(_0xc1cc53){var _0x389b4e=![];if(!_0x26c43e[_0x38ff('0x3f')][_0x38ff('0x5f')]){throw new Error(_0x38ff('0xa6'));}if(!_0x26c43e['body'][_0x38ff('0xc0')][_0x38ff('0x79')]){throw new Error(_0x38ff('0xb0'));}if(!_0x26c43e[_0x38ff('0x3f')][_0x38ff('0xc0')][_0x38ff('0xb1')]){throw new Error(_0x38ff('0xb2'));}if(!_0x26c43e['body'][_0x38ff('0xab')]){throw new Error('Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed');}var _0x6b1ee0=require(_0x38ff('0xb7'))[_0x38ff('0xb8')](path[_0x38ff('0x3d')](__dirname,_0x38ff('0xc1')),[_0x26c43e[_0x38ff('0x25')]['id'],JSON[_0x38ff('0xc2')](_0x26c43e[_0x38ff('0x3f')]),JSON[_0x38ff('0xc2')](_0xc1cc53)]);_0x6b1ee0['on'](_0x38ff('0xc3'),function(){_0x389b4e=!![];return _0x3fcd8b[_0x38ff('0xf')](0xc8)['json']({'message':_0x38ff('0xc4'),'pid':_0x6b1ee0[_0x38ff('0xc5')]});});_0x6b1ee0['on'](_0x38ff('0xc6'),function(_0x11a6fa){if(_0x11a6fa&&!_0x389b4e){return _0x3fcd8b[_0x38ff('0xf')](0x1f4)[_0x38ff('0x10')]({'message':_0x38ff('0xc7'),'pid':_0x6b1ee0[_0x38ff('0xc5')]});}});})[_0x38ff('0x37')](handleError(_0x3fcd8b,null));};exports[_0x38ff('0xc8')]=function(_0x166442,_0x463459){return db[_0x38ff('0xbf')][_0x38ff('0x20')]({'raw':!![],'attributes':['id'],'where':{'role':_0x38ff('0xc9')}})[_0x38ff('0x18')](function(_0x2f47d2){var _0x4f9ef9=![];if(!_0x166442[_0x38ff('0x3f')][_0x38ff('0x5f')]){throw new Error('No\x20ListId\x20specified');}if(!_0x166442[_0x38ff('0x3f')]['binding']['phone']){throw new Error(_0x38ff('0xb0'));}if(!_0x166442['body'][_0x38ff('0xc0')][_0x38ff('0xb1')]){throw new Error(_0x38ff('0xb2'));}if(!_0x166442['body'][_0x38ff('0xab')]){throw new Error(_0x38ff('0xac'));}var _0x15c205=require(_0x38ff('0xb7'))['fork'](path['join'](__dirname,_0x38ff('0xca')),[_0x166442['params']['id'],JSON[_0x38ff('0xc2')](_0x166442[_0x38ff('0x3f')]),JSON[_0x38ff('0xc2')](_0x2f47d2)]);_0x15c205['on'](_0x38ff('0xc3'),function(){_0x4f9ef9=!![];return _0x463459[_0x38ff('0xf')](0xc8)['json']({'message':_0x38ff('0xc4'),'pid':_0x15c205[_0x38ff('0xc5')]});});_0x15c205['on']('exit',function(_0x38cff4){if(_0x38cff4&&!_0x4f9ef9){return _0x463459['status'](0x1f4)[_0x38ff('0x10')]({'message':_0x38ff('0xc7'),'pid':_0x15c205[_0x38ff('0xc5')]});}});})[_0x38ff('0x37')](handleError(_0x463459,null));};exports[_0x38ff('0xcb')]=function(_0x1aa9d0,_0x38c45c){var _0xd2053d=[_0x38ff('0xcc'),_0x38ff('0xcd'),'sms',_0x38ff('0xce'),'fax',_0x38ff('0xcf'),_0x38ff('0xd0')];var _0x48ff38={'offset':0x0,'order':qs[_0x38ff('0x80')](_0x38ff('0xd1'))},_0x9dd6a9={'count':0x0,'rows':[]};Promise['resolve']()[_0x38ff('0x18')](function(){if(_0x1aa9d0['query'][_0x38ff('0xd2')]){if(!_[_0x38ff('0xd3')](_0xd2053d,_0x1aa9d0[_0x38ff('0x21')][_0x38ff('0xd2')][_0x38ff('0xd4')]())){throw new Error(_0x38ff('0xd5'));}_0xd2053d=[_0x1aa9d0[_0x38ff('0x21')][_0x38ff('0xd2')]['toLowerCase']()];}if(_0x1aa9d0[_0x38ff('0x21')][_0x38ff('0xd6')]){try{var _0x1ea8cb=JSON['parse'](_0x1aa9d0[_0x38ff('0x21')][_0x38ff('0xd6')]);if(!moment(_0x1ea8cb[_0x38ff('0x39')])[_0x38ff('0xd7')]()){throw new Error(_0x38ff('0xd8'));}if(!moment(_0x1ea8cb['to'])[_0x38ff('0xd7')]()){throw new Error(_0x38ff('0xd9'));}}catch(_0xfcb500){throw new Error(_0x38ff('0xda'));}}if(!_0x1aa9d0['query']['hasOwnProperty'](_0x38ff('0x84'))){_0x48ff38['limit']=qs[_0x38ff('0x85')](_0x1aa9d0[_0x38ff('0x21')][_0x38ff('0x85')]||0xa);_0x48ff38[_0x38ff('0x11')]=qs[_0x38ff('0x11')](_0x1aa9d0[_0x38ff('0x21')][_0x38ff('0x11')]);}var _0x5d8296=_0xd2053d[_0x38ff('0x6d')](function(_0xd8114b){if(_0xd8114b===_0x38ff('0xd0')){var _0x1afa00={'attributes':['id','uniqueid',_0x38ff('0x31'),'source',_0x38ff('0xdb'),_0x38ff('0xdc'),'starttime',_0x38ff('0xdd'),_0x38ff('0xde'),_0x38ff('0xdf'),_0x38ff('0xe0'),'userDisposition',_0x38ff('0xe1'),_0x38ff('0xe2'),'UserId'],'where':{'ContactId':_0x1aa9d0['params']['id']},'include':[{'model':db[_0x38ff('0xbf')],'as':_0x38ff('0xbf'),'attributes':['id',_0x38ff('0x1c'),_0x38ff('0xe3'),'alias']}],'order':[[_0x38ff('0xe0'),_0x38ff('0xe4')]]};if(_0x1aa9d0['query'][_0x38ff('0xd6')]){_0x1afa00[_0x38ff('0x5c')][_0x38ff('0xe0')]={'$gte':_0x1ea8cb['from'],'$lte':_0x1ea8cb['to']};}return db[_0x38ff('0x4b')][_0x38ff('0xe5')](_0x1afa00)[_0x38ff('0x18')](function(_0x16c897){_0x9dd6a9[_0x38ff('0x13')]+=_0x16c897[_0x38ff('0x13')];return _['map'](_0x16c897[_0x38ff('0xa0')],function(_0x4fa45e){var _0x175120=_0x4fa45e[_0x38ff('0x3a')]({'plain':!![]});_0x175120[_0x38ff('0xd2')]=_0xd8114b;if(_0x175120['User']){_0x175120[_0x38ff('0xbf')]={'id':_0x175120[_0x38ff('0xbf')]['id'],'name':_0x175120[_0x38ff('0xbf')]['name'],'fullname':_0x175120['User']['fullname'],'alias':_0x175120[_0x38ff('0xbf')][_0x38ff('0x2f')]};}return _0x175120;});});}else{var _0x9b655=_[_0x38ff('0xe6')](_0xd8114b)+(_0xd8114b===_0x38ff('0xcd')?_0x38ff('0xe7'):_0x38ff('0xe8'));var _0x204402={'attributes':['id',_0x38ff('0xe9'),_0x38ff('0xea'),_0x38ff('0xe0'),_0x38ff('0xdf'),_0x38ff('0xeb'),_0x38ff('0xec'),_0x38ff('0xed'),'UserId',_0x9b655+'Id'],'where':{'ContactId':_0x1aa9d0[_0x38ff('0x25')]['id']},'include':[{'model':db[_0x9b655],'as':_0x38ff('0xe8'),'attributes':['id',_0x38ff('0x1c'),_0x38ff('0xee')]},{'model':db[_0x38ff('0xbf')],'as':_0x38ff('0xef'),'attributes':['id',_0x38ff('0x1c'),'fullname']},{'model':db['Tag'],'as':_0x38ff('0x64'),'attributes':['id',_0x38ff('0x1c'),_0x38ff('0xf0')],'through':{'attributes':[]}}],'order':[[_0x38ff('0xe0'),_0x38ff('0xe4')]]};if(_0x1aa9d0[_0x38ff('0x21')]['range']){_0x204402[_0x38ff('0x5c')][_0x38ff('0xe0')]={'$gte':_0x1ea8cb[_0x38ff('0x39')],'$lte':_0x1ea8cb['to']};}switch(_0xd8114b){case _0x38ff('0xcd'):_0x204402['attributes'][_0x38ff('0x5e')](_0x38ff('0xf1'),_0x38ff('0xf2'),_0x38ff('0xf3'),'deviceModel','osName','ratingMessage',_0x38ff('0xf4'),_0x38ff('0xf5'),'referer');break;case _0x38ff('0xcc'):_0x204402[_0x38ff('0x7f')][_0x38ff('0x5e')]('subject',_0x38ff('0xf6'));break;case _0x38ff('0xce'):_0x204402[_0x38ff('0x7f')]['push'](_0x38ff('0xf7'),_0x38ff('0xf8'));break;}return db[_[_0x38ff('0xe6')](_0xd8114b)+'Interaction'][_0x38ff('0xe5')](_0x204402)['then'](function(_0x46cf2c){_0x9dd6a9[_0x38ff('0x13')]+=_0x46cf2c[_0x38ff('0x13')];return _[_0x38ff('0x6d')](_0x46cf2c['rows'],function(_0x2a96aa){var _0x1801f8=_0x2a96aa[_0x38ff('0x3a')]({'plain':!![]});_0x1801f8[_0x38ff('0xd2')]=_0xd8114b;if(_0x1801f8[_0x38ff('0xef')]){_0x1801f8[_0x38ff('0xef')]={'id':_0x1801f8[_0x38ff('0xef')]['id'],'name':_0x1801f8['Owner']['name'],'fullname':_0x1801f8[_0x38ff('0xef')][_0x38ff('0xe3')]};}return _0x1801f8;});});}});return Promise[_0x38ff('0x62')](_0x5d8296);})[_0x38ff('0x18')](function(_0x1437ad){return _(_0x1437ad)['flatten']()[_0x38ff('0xf9')](_0x38ff('0xe0'))[_0x38ff('0xfa')]()[_0x38ff('0xfb')]();})[_0x38ff('0x18')](function(_0x2d061f){_0x9dd6a9[_0x38ff('0xa0')]=_0x48ff38['limit']?_0x2d061f['slice'](_0x48ff38[_0x38ff('0x11')],_0x48ff38[_0x38ff('0x11')]+_0x48ff38['limit']):_0x2d061f;return _0x9dd6a9;})[_0x38ff('0x18')](respondWithFilteredResult(_0x38c45c,_0x48ff38))[_0x38ff('0x37')](handleError(_0x38c45c,null));}; \ No newline at end of file +var _0xd66c=['pid','send','upload','parse','meta','import','agent','binding','No\x20phone\x20column\x20specified','../../components/import/cm/csv2','stringify','message','exit','error\x20child\x20process','importUpdates','../../components/import/cm/csvUpdates','start\x20child\x20process\x20correctly!','getJourney','chat','sms','openchannel','whatsapp','-createdAt','resolve','channel','includes','toLowerCase','Invalid\x20channel','range','isValid','Invalid\x20date\x20for\x20range\x20from\x20filter','Invalid\x20createdAt\x20filter','voice','uniqueid','source','destination','callerid','starttime','endtime','duration','note','createdAt','userDisposition','userSecondDisposition','userThirdDisposition','UserId','User','fullname','DESC','findAndCountAll','startCase','Website','closed','disposition','secondDisposition','thirdDisposition','Account','key','Owner','customerIp','customerPort','deviceModel','ratingMessage','ratingType','referer','subject','substatus','externalUrl','threadId','Interaction','sortBy','reverse','slice','moment','bluebird','util','path','lodash','papaparse','ioredis','../../components/contacts','../../config/logger','api','redis','localhost','./cmContact.socket','status','json','offset','undefined','limit','count','Content-Range','update','then','end','sendStatus','error','stack','name','index','getOptions','findAll','query','user','destroy','find','params','catch','describe','CmContact','tags','keys','length','startsWith','cf_','columnName','displayName','CmCustomField','alias','type','values','info','Custom\x20field\x20%s\x20not\x20found\x20on\x20cm_contacts\x20table','forEach','hasOwnProperty','merge','body','from','get','isArray','[CmContact][merge]\x20to\x20%s\x20from\x20%s','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatInteraction','ChatMessage','ChatOfflineMessage','MailInteraction','MailMessage','SmsMessage','FaxInteraction','OpenchannelInteraction','OpenchannelMessage','CmContactHasItem','CmHopperFinal','CmHopperHistory','ReportAgentPreview','VoiceCallReport','ChatQueueReport','FaxQueueReport','MailQueueReport','OpenchannelQueueReport','SmsQueueReport','JscriptySessionReport','WhatsappInteraction','WhatsappMessage','join','isNil','timezones','utcOffset','additionalPhones','duplicates','where','$or','push','ListId','findOrCreate','spread','contact','Tag','Tags','color','Phones','ItemType','literal','Phones.OrderBy','map','format','cf_%d','dialTimezone','$and','omit','pickBy','isEmpty','table','cm_contacts','id\x20=\x20?','toParam','sequelize','phone','CmHopper','getTags','findOne','rawAttributes','filters','model','attributes','fields','sort','pick','filter','options','nolimit','setTags','ids','setAdditionalPhones','ContactItemType','items','item_types','ItemTypeId','description','contact\x20phone\x20exists','CmHopperAdditionalPhone','all','item','OrderBy','PHONE','`ItemType`.OrderBy','ItemType.OrderBy','duplicateAdditionalPhones','fromContactId','CmContactId','toContactId','bulkCreate','rescheduleAdditionalPhones','hopperId','getHoppers','intersection','ContactId','includeAll','include','rows','getHopperHistories','order','getHopperFinals','getJscriptySessions','uploadCsv','No\x20ListId\x20specified','binding_keys','No\x20association\x20keys\x20specified!','No\x20association\x20values\x20specified!','socket_timestamp','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','split','Incorrect\x20binding\x20parameters\x20passed!','zipObject','firstName','No\x20firstName\x20column\x20specified','root','file','filename','chmodSync','0777','child_process','fork','../../components/import/cm/csv','CompanyId','File\x20uploaded\x20correctly!'];(function(_0x31abee,_0x11ff0c){var _0x3c1761=function(_0x2b5062){while(--_0x2b5062){_0x31abee['push'](_0x31abee['shift']());}};_0x3c1761(++_0x11ff0c);}(_0xd66c,0x14d));var _0xcd66=function(_0x4b6d6f,_0x34c15a){_0x4b6d6f=_0x4b6d6f-0x0;var _0x255931=_0xd66c[_0x4b6d6f];return _0x255931;};'use strict';var moment=require(_0xcd66('0x0'));var BPromise=require(_0xcd66('0x1'));var util=require(_0xcd66('0x2'));var path=require(_0xcd66('0x3'));var fs=require('fs');var _=require(_0xcd66('0x4'));var squel=require('squel');var Papa=require(_0xcd66('0x5'));var Redis=require(_0xcd66('0x6'));var contacts=require(_0xcd66('0x7'));var qs=require('../../components/parsers/qs');var logger=require(_0xcd66('0x8'))(_0xcd66('0x9'));var config=require('../../config/environment');var shared=require('../../config/environment/shared');var db=require('../../mysqldb')['db'];config[_0xcd66('0xa')]=_['defaults'](config[_0xcd66('0xa')],{'host':_0xcd66('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xcd66('0xc'))['register'](socket);function respondWithResult(_0x433bd5,_0x25beae){_0x25beae=_0x25beae||0xc8;return function(_0x20950b){if(_0x20950b){return _0x433bd5[_0xcd66('0xd')](_0x25beae)[_0xcd66('0xe')](_0x20950b);}};}function respondWithFilteredResult(_0x5f150a,_0x144c6e){return function(_0x5b6eb6){if(_0x5b6eb6){var _0x4d66f9=typeof _0x144c6e[_0xcd66('0xf')]===_0xcd66('0x10')&&typeof _0x144c6e[_0xcd66('0x11')]===_0xcd66('0x10');var _0x3b92d6=_0x5b6eb6[_0xcd66('0x12')];var _0x13cf79=_0x4d66f9?0x0:_0x144c6e[_0xcd66('0xf')];var _0x1b4837=_0x4d66f9?_0x5b6eb6[_0xcd66('0x12')]:_0x144c6e[_0xcd66('0xf')]+_0x144c6e[_0xcd66('0x11')];var _0x4bd7b7;if(_0x1b4837>=_0x3b92d6){_0x1b4837=_0x3b92d6;_0x4bd7b7=0xc8;}else{_0x4bd7b7=0xce;}_0x5f150a[_0xcd66('0xd')](_0x4bd7b7);return _0x5f150a['set'](_0xcd66('0x13'),_0x13cf79+'-'+_0x1b4837+'/'+_0x3b92d6)[_0xcd66('0xe')](_0x5b6eb6);}return null;};}function saveUpdates(_0x1c6f14){return function(_0x1b84c5){if(_0x1b84c5){return _0x1b84c5[_0xcd66('0x14')](_0x1c6f14)['then'](function(_0x1f361e){return _0x1f361e;});}return null;};}function removeEntity(_0x5e56f5){return function(_0x39298f){if(_0x39298f){return _0x39298f['destroy']()[_0xcd66('0x15')](function(){_0x5e56f5['status'](0xcc)[_0xcd66('0x16')]();});}};}function handleEntityNotFound(_0x35c48a){return function(_0x2deac8){if(!_0x2deac8){_0x35c48a[_0xcd66('0x17')](0x194);}return _0x2deac8;};}function handleError(_0x15f81d,_0x1eb0f0){_0x1eb0f0=_0x1eb0f0||0x1f4;return function(_0x57cd1d){logger[_0xcd66('0x18')](_0x57cd1d[_0xcd66('0x19')]);if(_0x57cd1d[_0xcd66('0x1a')]){delete _0x57cd1d[_0xcd66('0x1a')];}_0x15f81d[_0xcd66('0xd')](_0x1eb0f0)['send'](_0x57cd1d);};}exports[_0xcd66('0x1b')]=function(_0x2c113d,_0x217652){var _0x4413ba={};return contacts['describe']()['then'](function(_0x1dd052){_0x4413ba=qs[_0xcd66('0x1c')](_0x1dd052,_0x2c113d);return contacts[_0xcd66('0x1d')](_0x2c113d[_0xcd66('0x1e')],_0x2c113d[_0xcd66('0x1f')],_0x4413ba,_0x1dd052);})['then'](respondWithFilteredResult(_0x217652,_0x4413ba))['catch'](handleError(_0x217652,null));};exports[_0xcd66('0x20')]=function(_0x2e1b5b,_0x3963e9){return db['CmContact'][_0xcd66('0x21')]({'where':{'id':_0x2e1b5b[_0xcd66('0x22')]['id']}})[_0xcd66('0x15')](handleEntityNotFound(_0x3963e9,null))[_0xcd66('0x15')](removeEntity(_0x3963e9,null))[_0xcd66('0x23')](handleError(_0x3963e9,null));};exports[_0xcd66('0x24')]=function(_0xcfb5,_0x215cd4){return db[_0xcd66('0x25')][_0xcd66('0x24')]()[_0xcd66('0x15')](function(_0x5ea314){delete _0x5ea314[_0xcd66('0x26')];for(var _0x3db9ad=0x0;_0x3db9ad0x0){return new Promise(function(_0x1ec5cc){var _0x37cc83=[];for(var _0xedd0df=0x0;_0xedd0df<_0x289d07[_0xcd66('0x28')];_0xedd0df++){_0x37cc83[_0xcd66('0x5d')](insertAdditionalPhones(_0x289d07[_0xedd0df][_0xcd66('0x61')],_0x289d07[_0xedd0df][_0xcd66('0x59')]));}Promise['all'](_0x37cc83)[_0xcd66('0x15')](function(){_0x1ec5cc(0x1);});})[_0xcd66('0x15')](function(){return{'success':_0xd780a2,'failure':_0x4e26c8,'duplicates':_0x2ca2e7};});}else{return{'success':_0xd780a2,'failure':_0x4e26c8,'duplicates':_0x2ca2e7};}}})[_0xcd66('0x15')](respondWithResult(_0x44a06f,0xc9))['catch'](handleError(_0x44a06f,null));};exports['show']=function(_0x287469,_0x20f131){var _0x157962;return db[_0xcd66('0x25')][_0xcd66('0x24')]()[_0xcd66('0x15')](function(_0x8cb08f){return db['CmContact']['find']({'where':{'id':_0x287469[_0xcd66('0x22')]['id']},'include':[{'model':db[_0xcd66('0x62')],'as':_0xcd66('0x63'),'attributes':['id',_0xcd66('0x1a'),_0xcd66('0x64')],'required':_0x287469[_0xcd66('0x1e')]['tag']?!![]:![]},{'model':db[_0xcd66('0x48')],'as':_0xcd66('0x65'),'where':{'CmContactId':_0x287469[_0xcd66('0x22')]['id']},'required':![],'include':[{'model':db['ContactItemType'],'as':_0xcd66('0x66')}]}],'order':[db['sequelize'][_0xcd66('0x67')](_0xcd66('0x68'))],'attributes':_[_0xcd66('0x27')](_0x8cb08f)});})[_0xcd66('0x15')](function(_0x1cd739){if(!_[_0xcd66('0x56')](_0x1cd739)){_0x157962=_0x1cd739['get']({'plain':!![]});var _0xea6c57={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x1cd739&&_0x1cd739[_0xcd66('0x5e')]){if(_0x1cd739[_0xcd66('0x5e')]){_0xea6c57[_0xcd66('0x5b')]['$and']['push']({'ListId':{'$ne':_0x1cd739[_0xcd66('0x5e')]}});}}return db['CmCustomField']['findAll'](_0xea6c57);}})[_0xcd66('0x15')](function(_0x54a23d){if(!_[_0xcd66('0x56')](_0x54a23d)){return _['omit'](_0x157962,_[_0xcd66('0x69')](_0x54a23d,function(_0x5a252b){return util[_0xcd66('0x6a')](_0xcd66('0x6b'),_0x5a252b['id']);}));}})[_0xcd66('0x15')](handleEntityNotFound(_0x20f131,null))[_0xcd66('0x15')](respondWithResult(_0x20f131,null))['catch'](handleError(_0x20f131,null));};exports[_0xcd66('0x14')]=function(_0x230245,_0x4b43a6){var _0xbb6ddf;if(_0x230245['body']['id']){delete _0x230245[_0xcd66('0x36')]['id'];}if(!_[_0xcd66('0x56')](_0x230245[_0xcd66('0x36')][_0xcd66('0x6c')])){var _0x26a531=_0x230245[_0xcd66('0x36')][_0xcd66('0x6c')];if(!_[_0xcd66('0x56')](shared[_0xcd66('0x57')][_0x26a531]))_0x230245[_0xcd66('0x36')][_0xcd66('0x58')]=shared['timezones'][_0x26a531]['utcOffset'];}return db[_0xcd66('0x25')][_0xcd66('0x21')]({'where':{'id':_0x230245[_0xcd66('0x22')]['id']}})[_0xcd66('0x15')](handleEntityNotFound(_0x4b43a6,null))['then'](saveUpdates(_0x230245[_0xcd66('0x36')],null))[_0xcd66('0x15')](function(_0x1aeb64){_0xbb6ddf=_0x1aeb64;var _0xce6d5d={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x1aeb64&&_0x1aeb64[_0xcd66('0x5e')]){if(_0x1aeb64[_0xcd66('0x5e')]){_0xce6d5d[_0xcd66('0x5b')][_0xcd66('0x6d')][_0xcd66('0x5d')]({'ListId':{'$ne':_0x1aeb64[_0xcd66('0x5e')]}});}}return db[_0xcd66('0x2d')][_0xcd66('0x1d')](_0xce6d5d);})[_0xcd66('0x15')](function(_0x4f9827){if(_0x4f9827){return _[_0xcd66('0x6e')](_[_0xcd66('0x6f')](_0x230245[_0xcd66('0x36')],function(_0x343464,_0x67a5a3){return _['startsWith'](_0x67a5a3,_0xcd66('0x2a'));}),_[_0xcd66('0x69')](_0x4f9827,function(_0x7e766b){return util[_0xcd66('0x6a')](_0xcd66('0x6b'),_0x7e766b['id']);}));}})[_0xcd66('0x15')](function(_0x4a47d9){if(_0x4a47d9&&!_[_0xcd66('0x70')](_0x4a47d9)){var _0xf5ea06=squel[_0xcd66('0x14')]()[_0xcd66('0x71')](_0xcd66('0x72'))['setFields'](_0x4a47d9)[_0xcd66('0x5b')](_0xcd66('0x73'),_0x230245[_0xcd66('0x22')]['id'])[_0xcd66('0x74')]();return db[_0xcd66('0x75')][_0xcd66('0x1e')](_0xf5ea06['text'],{'replacements':_0xf5ea06[_0xcd66('0x30')]});}})[_0xcd66('0x15')](function(){if(_0x230245['body'][_0xcd66('0x76')]&&_0xbb6ddf){return db[_0xcd66('0x77')][_0xcd66('0x14')]({'phone':_0x230245['body']['phone'],'OrderBy':0x0},{'where':{'ContactId':_0xbb6ddf['id']}});}})[_0xcd66('0x15')](function(){return _0xbb6ddf;})[_0xcd66('0x15')](respondWithResult(_0x4b43a6,null))['catch'](handleError(_0x4b43a6,null));};exports[_0xcd66('0x78')]=function(_0x3a70fa,_0x9d1e47){var _0x45b949={};var _0x5accda={};var _0x3b0e93;var _0x59745b;return db[_0xcd66('0x25')][_0xcd66('0x79')]({'where':{'id':_0x3a70fa[_0xcd66('0x22')]['id']}})[_0xcd66('0x15')](handleEntityNotFound(_0x9d1e47,null))[_0xcd66('0x15')](function(_0x23bfca){if(_0x23bfca){_0x3b0e93=_0x23bfca;_0x5accda['model']=_[_0xcd66('0x27')](db[_0xcd66('0x62')][_0xcd66('0x7a')]);_0x5accda[_0xcd66('0x1e')]=_[_0xcd66('0x27')](_0x3a70fa[_0xcd66('0x1e')]);_0x5accda[_0xcd66('0x7b')]=_['intersection'](_0x5accda[_0xcd66('0x7c')],_0x5accda[_0xcd66('0x1e')]);_0x45b949[_0xcd66('0x7d')]=_['intersection'](_0x5accda[_0xcd66('0x7c')],qs[_0xcd66('0x7e')](_0x3a70fa['query'][_0xcd66('0x7e')]));_0x45b949[_0xcd66('0x7d')]=_0x45b949[_0xcd66('0x7d')]['length']?_0x45b949[_0xcd66('0x7d')]:_0x5accda[_0xcd66('0x7c')];_0x45b949['order']=qs['sort'](_0x3a70fa['query'][_0xcd66('0x7f')]);_0x45b949[_0xcd66('0x5b')]=qs[_0xcd66('0x7b')](_[_0xcd66('0x80')](_0x3a70fa[_0xcd66('0x1e')],_0x5accda[_0xcd66('0x7b')]));if(_0x3a70fa['query'][_0xcd66('0x81')]){_0x45b949[_0xcd66('0x5b')]=_[_0xcd66('0x35')](_0x45b949[_0xcd66('0x5b')],{'$or':_[_0xcd66('0x69')](_0x45b949[_0xcd66('0x7d')],function(_0x24d1bc){var _0x1414bc={};_0x1414bc[_0x24d1bc]={'$like':'%'+_0x3a70fa[_0xcd66('0x1e')][_0xcd66('0x81')]+'%'};return _0x1414bc;})});}_0x45b949=_[_0xcd66('0x35')]({},_0x45b949,_0x3a70fa[_0xcd66('0x82')]);return _0x3b0e93['getTags'](_0x45b949);}})[_0xcd66('0x15')](function(_0x2e235f){if(_0x2e235f){_0x59745b=_0x2e235f['length'];if(!_0x3a70fa[_0xcd66('0x1e')][_0xcd66('0x34')](_0xcd66('0x83'))){_0x45b949[_0xcd66('0x11')]=qs[_0xcd66('0x11')](_0x3a70fa[_0xcd66('0x1e')][_0xcd66('0x11')]);_0x45b949[_0xcd66('0xf')]=qs[_0xcd66('0xf')](_0x3a70fa[_0xcd66('0x1e')][_0xcd66('0xf')]);}return _0x3b0e93[_0xcd66('0x78')](_0x45b949);}})[_0xcd66('0x15')](function(_0x43570b){if(_0x43570b){return _0x43570b?{'count':_0x59745b,'rows':_0x43570b}:null;}})[_0xcd66('0x15')](respondWithResult(_0x9d1e47,null))[_0xcd66('0x23')](handleError(_0x9d1e47,null));};exports[_0xcd66('0x84')]=function(_0x477607,_0x29f763){if(_0x477607[_0xcd66('0x36')]['id']){delete _0x477607[_0xcd66('0x36')]['id'];}return db[_0xcd66('0x25')][_0xcd66('0x79')]({'where':{'id':_0x477607[_0xcd66('0x22')]['id']}})[_0xcd66('0x15')](handleEntityNotFound(_0x29f763,null))[_0xcd66('0x15')](function(_0x5bc50a){if(_0x5bc50a){return _0x5bc50a['setTags'](_0x477607[_0xcd66('0x36')][_0xcd66('0x85')]||[]);}return null;})[_0xcd66('0x15')](respondWithResult(_0x29f763,null))[_0xcd66('0x23')](handleError(_0x29f763,null));};exports[_0xcd66('0x86')]=function(_0x3d3a62,_0x4467e8){var _0x4585dc=[];_0x4585dc[_0xcd66('0x5d')](addAdditionalPhones(_0x3d3a62[_0xcd66('0x36')]));Promise['all'](_0x4585dc)[_0xcd66('0x15')](function(){_0x4585dc=[];_0x4585dc[_0xcd66('0x5d')](deleteCmHopperPhones(_0x3d3a62['body']['id']));_0x4585dc[_0xcd66('0x5d')](addCmHopperPhones(_0x3d3a62[_0xcd66('0x36')]['id']));Promise['all'](_0x4585dc)[_0xcd66('0x15')](function(){return[0x1];})[_0xcd66('0x15')](respondWithResult(_0x4467e8,null));});};function addAdditionalPhones(_0x1b798d){var _0x8704ad;return new Promise(function(_0x29ea0a){return db[_0xcd66('0x48')][_0xcd66('0x20')]({'where':{'CmContactId':_0x1b798d['id']}})[_0xcd66('0x15')](function(){db[_0xcd66('0x87')]['findAll']({'raw':!![],'attributes':['id','OrderBy']})['then'](function(_0x28840e){var _0x1faf87=[];for(var _0x1b336e=0x0;_0x1b336e<_0x1b798d[_0xcd66('0x88')][_0xcd66('0x28')];_0x1b336e++){var _0x463ff3=_0x1b798d[_0xcd66('0x89')]?_[_0xcd66('0x56')](_0x1b798d[_0xcd66('0x89')][_0x1b336e])?'':_0x1b798d['item_types'][_0x1b336e]:_0x1b798d['items'][_0x1b336e]['ItemTypeId']?_0x1b798d[_0xcd66('0x88')][_0x1b336e][_0xcd66('0x8a')]:'';var _0x2b8f81=_[_0xcd66('0x56')](_0x1b798d[_0xcd66('0x88')][_0x1b336e][_0xcd66('0x8b')])?'':_0x1b798d[_0xcd66('0x88')][_0x1b336e][_0xcd66('0x8b')];var _0x3a9cdf=_0x463ff3+':'+_0x1b798d[_0xcd66('0x88')][_0x1b336e]['phone']+'§'+_0x2b8f81;if(_[_0xcd66('0x56')](_0x8704ad))_0x8704ad=_0x3a9cdf;else _0x8704ad+=';'+_0x3a9cdf;var _0x47dc3a=null;var _0xe3469e=null;if(_0x1b798d['item_types']){if(!_['isNil'](_0x1b798d[_0xcd66('0x89')][_0x1b336e])){_0xe3469e=_[_0xcd66('0x21')](_0x28840e,function(_0x2cdbae){return _0x2cdbae['id']===_0x1b798d[_0xcd66('0x89')][_0x1b336e];});if(!_[_0xcd66('0x56')](_0xe3469e)){_0x47dc3a=_0xe3469e['OrderBy'];}}}else{if(!_['isNil'](_0x1b798d[_0xcd66('0x88')][_0x1b336e])){_0xe3469e=_[_0xcd66('0x21')](_0x28840e,function(_0x2f5276){return _0x2f5276['id']===_0x1b798d['items'][_0x1b336e][_0xcd66('0x8a')];});if(!_[_0xcd66('0x56')](_0xe3469e)){_0x47dc3a=_0x1b336e;}}}if(_[_0xcd66('0x56')](_0x47dc3a)){_0x47dc3a=0x64;}_0x1faf87[_0xcd66('0x5d')](addAdditionalPhone(_0x1b798d['id'],_0x1b798d['items'][_0x1b336e][_0xcd66('0x76')],_0x1b798d[_0xcd66('0x89')]?_[_0xcd66('0x56')](_0x1b798d[_0xcd66('0x89')][_0x1b336e])?null:_0x1b798d[_0xcd66('0x89')][_0x1b336e]:_0x1b798d[_0xcd66('0x88')][_0x1b336e][_0xcd66('0x8a')]?_0x1b798d['items'][_0x1b336e][_0xcd66('0x8a')]:null,_0x47dc3a,_0x2b8f81));}Promise['all'](_0x1faf87)['then'](function(){db[_0xcd66('0x25')][_0xcd66('0x14')]({'AdditionalPhones':_0x8704ad},{'where':{'id':_0x1b798d['id']}})[_0xcd66('0x15')](function(){_0x29ea0a(0x1);});});});});});}function addAdditionalPhone(_0x2944c4,_0x4be41c,_0x1c7930,_0xb91259,_0x4dfb61){return db['CmContactHasItem']['find']({'where':{'CmContactId':_0x2944c4,'item':_0x4be41c}})[_0xcd66('0x15')](function(_0x5a4619){if(_0x5a4619)logger['info'](_0xcd66('0x8c'),_0x5a4619);else{db['CmContactHasItem'][_0xcd66('0x3e')]({'CmContactId':_0x2944c4,'item':_0x4be41c,'ItemTypeId':_0x1c7930,'OrderBy':_0xb91259,'ItemClass':'PHONE','description':_0x4dfb61});}});}function deleteCmHopperPhones(_0x3041dc){return new Promise(function(_0xb0b812){return db['CmHopper'][_0xcd66('0x1d')]({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x3041dc}})['then'](function(_0x4c8f7b){db[_0xcd66('0x8d')]['destroy']({'where':{'CmHopperId':{'$in':_[_0xcd66('0x69')](_0x4c8f7b,'id')}}});})[_0xcd66('0x15')](function(){_0xb0b812(0x1);});});}function addCmHopperPhones(_0x4ff64d){return new Promise(function(_0x3b50b7){return db[_0xcd66('0x77')][_0xcd66('0x1d')]({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x4ff64d}})[_0xcd66('0x15')](function(_0x25d7aa){var _0xfcd1ab=[];_[_0xcd66('0x69')](_0x25d7aa,function(_0x1d9b58){_0xfcd1ab[_0xcd66('0x5d')](createCmHopperPhone(_0x4ff64d,_0x1d9b58['id']));});Promise[_0xcd66('0x8e')](_0xfcd1ab)[_0xcd66('0x15')](function(){_0x3b50b7(0x1);});});});}function createCmHopperPhone(_0x3455cf,_0x172224){return new Promise(function(_0x11f624){db[_0xcd66('0x48')][_0xcd66('0x1d')]({'raw':!![],'attributes':[_0xcd66('0x8f'),_0xcd66('0x90')],'where':{'CmContactId':_0x3455cf,'ItemClass':_0xcd66('0x91')},'include':[{'model':db[_0xcd66('0x87')],'attributes':[_0xcd66('0x90')],'as':_0xcd66('0x66')}],'order':[_0xcd66('0x90'),db[_0xcd66('0x75')][_0xcd66('0x67')](_0xcd66('0x92'))]})[_0xcd66('0x15')](function(_0x2a0cbb){var _0x594694=0x1;var _0x4a97e3=_[_0xcd66('0x69')](_0x2a0cbb,function(_0x420a4a){_0x420a4a['CmHopperId']=_0x172224;_0x420a4a[_0xcd66('0x76')]=_0x420a4a[_0xcd66('0x8f')];_0x420a4a['OrderBy']=_0x594694;delete _0x420a4a[_0xcd66('0x93')];_0x594694=_0x594694+0x1;return _0x420a4a;});return db[_0xcd66('0x8d')]['bulkCreate'](_0x4a97e3,{});})[_0xcd66('0x15')](function(){_0x11f624(0x1);});});}function insertAdditionalPhones(_0x554f64,_0x2988e0){return new Promise(function(_0x1463ed){var _0xcb753c=[];for(var _0x59e243=0x0;_0x59e243<_0x2988e0[_0xcd66('0x28')];_0x59e243++){var _0x237748=_0x2988e0[_0x59e243];_0xcb753c[_0xcd66('0x5d')](parseContactItemType(_0x237748));}Promise[_0xcd66('0x8e')](_0xcb753c)[_0xcd66('0x15')](function(){var _0xc31f12={'id':_0x554f64['id'],'items':_0x2988e0};return addAdditionalPhones(_0xc31f12)['then'](function(){return addCmHopperPhones(_0x554f64['id']);});})['then'](function(){_0x1463ed(_0x554f64);});});}function parseContactItemType(_0x3ae07e){return new Promise(function(_0x29bc6d){if(_0x3ae07e[_0xcd66('0x34')]('ItemTypeId')){_0x29bc6d(_0x3ae07e);}else{return db[_0xcd66('0x87')][_0xcd66('0x21')]({'where':{'name':_0x3ae07e[_0xcd66('0x66')]}})[_0xcd66('0x15')](function(_0x1dfd6c){if(_[_0xcd66('0x56')](_0x1dfd6c))_0x3ae07e[_0xcd66('0x8a')]=null;else _0x3ae07e[_0xcd66('0x8a')]=_0x1dfd6c['id'];_0x29bc6d(_0x3ae07e);});}});}exports['getAdditionalPhones']=function(_0xddc900,_0x23ba07){return db[_0xcd66('0x48')][_0xcd66('0x1d')]({'raw':!![],'where':{'CmContactId':_0xddc900[_0xcd66('0x22')]['id'],'ItemClass':_0xcd66('0x91')},'include':[{'model':db['ContactItemType'],'as':_0xcd66('0x66')}],'order':[[_0xcd66('0x90')],[db['sequelize']['literal'](_0xcd66('0x92'))]]})['then'](function(_0x53625e){return _0x53625e;})['then'](respondWithResult(_0x23ba07,null))[_0xcd66('0x23')](handleError(_0x23ba07,null));};exports[_0xcd66('0x94')]=function(_0x9bbec6,_0x44dd4e){return db[_0xcd66('0x48')][_0xcd66('0x1d')]({'raw':!![],'where':{'CmContactId':_0x9bbec6['body'][_0xcd66('0x95')]}})['then'](function(_0x2827fd){var _0x3e10f1=_['map'](_0x2827fd,function(_0x341fff){_0x341fff[_0xcd66('0x96')]=_0x9bbec6[_0xcd66('0x36')][_0xcd66('0x97')];return _0x341fff;});return db[_0xcd66('0x48')][_0xcd66('0x98')](_0x3e10f1,{});})[_0xcd66('0x15')](function(){return addCmHopperPhones(_0x9bbec6[_0xcd66('0x36')][_0xcd66('0x97')]);})[_0xcd66('0x15')](function(){return['ok'];})[_0xcd66('0x15')](respondWithResult(_0x44dd4e,null))['catch'](handleError(_0x44dd4e,null));};exports[_0xcd66('0x99')]=function(_0x216fc3,_0x1f32bb){var _0xa2fab7=[];_0xa2fab7['push'](createCmHopperPhone(_0x216fc3[_0xcd66('0x36')]['id'],_0x216fc3['body'][_0xcd66('0x9a')]));Promise[_0xcd66('0x8e')](_0xa2fab7)[_0xcd66('0x15')](function(){return[0x1];})[_0xcd66('0x15')](respondWithResult(_0x1f32bb,null));};exports[_0xcd66('0x9b')]=function(_0x478120,_0xf55291){var _0x42ae64={'raw':![],'where':{}};var _0xb9d93e={};var _0x38a59b={'count':0x0,'rows':[]};return db[_0xcd66('0x25')]['findOne']({'where':{'id':_0x478120[_0xcd66('0x22')]['id']}})[_0xcd66('0x15')](handleEntityNotFound(_0xf55291,null))['then'](function(_0x5c1981){if(_0x5c1981){_0xb9d93e[_0xcd66('0x7c')]=_[_0xcd66('0x27')](db[_0xcd66('0x77')][_0xcd66('0x7a')]);_0xb9d93e[_0xcd66('0x1e')]=_['keys'](_0x478120['query']);_0xb9d93e['filters']=_[_0xcd66('0x9c')](_0xb9d93e[_0xcd66('0x7c')],_0xb9d93e[_0xcd66('0x1e')]);_0x42ae64['attributes']=_[_0xcd66('0x9c')](_0xb9d93e['model'],qs[_0xcd66('0x7e')](_0x478120['query'][_0xcd66('0x7e')]));_0x42ae64[_0xcd66('0x7d')]=_0x42ae64[_0xcd66('0x7d')]['length']?_0x42ae64[_0xcd66('0x7d')]:_0xb9d93e[_0xcd66('0x7c')];if(!_0x478120[_0xcd66('0x1e')]['hasOwnProperty'](_0xcd66('0x83'))){_0x42ae64[_0xcd66('0x11')]=qs[_0xcd66('0x11')](_0x478120[_0xcd66('0x1e')]['limit']);_0x42ae64[_0xcd66('0xf')]=qs[_0xcd66('0xf')](_0x478120['query'][_0xcd66('0xf')]);}_0x42ae64['order']=qs[_0xcd66('0x7f')](_0x478120['query']['sort']);_0x42ae64[_0xcd66('0x5b')]=qs[_0xcd66('0x7b')](_['pick'](_0x478120[_0xcd66('0x1e')],_0xb9d93e['filters']));_0x42ae64[_0xcd66('0x5b')][_0xcd66('0x9d')]=_0x5c1981['id'];if(_0x478120[_0xcd66('0x1e')]['filter']){_0x42ae64['where']=_[_0xcd66('0x35')](_0x42ae64['where'],{'$or':_[_0xcd66('0x69')](_0x42ae64[_0xcd66('0x7d')],function(_0x1ab953){var _0x49a13b={};_0x49a13b[_0x1ab953]={'$like':'%'+_0x478120[_0xcd66('0x1e')][_0xcd66('0x81')]+'%'};return _0x49a13b;})});}_0x42ae64=_['merge']({},_0x42ae64,_0x478120[_0xcd66('0x82')]);return db[_0xcd66('0x77')][_0xcd66('0x12')]({'where':_0x42ae64['where']})[_0xcd66('0x15')](function(_0x264ede){_0x38a59b[_0xcd66('0x12')]=_0x264ede;if(_0x478120['query'][_0xcd66('0x9e')]){_0x42ae64[_0xcd66('0x9f')]=[{'all':!![]}];}return db[_0xcd66('0x77')][_0xcd66('0x1d')](_0x42ae64);})[_0xcd66('0x15')](function(_0xa5486d){_0x38a59b[_0xcd66('0xa0')]=_0xa5486d;return _0x38a59b;});}})[_0xcd66('0x15')](respondWithFilteredResult(_0xf55291,_0x42ae64))[_0xcd66('0x23')](handleError(_0xf55291,null));};exports[_0xcd66('0xa1')]=function(_0x4a0d49,_0x3741e0){var _0xf5fd1b={'raw':!![],'where':{}};var _0x5685b6={};var _0x1e2821={'count':0x0,'rows':[]};return db[_0xcd66('0x25')]['findOne']({'where':{'id':_0x4a0d49[_0xcd66('0x22')]['id']}})['then'](handleEntityNotFound(_0x3741e0,null))['then'](function(_0x2aaf83){if(_0x2aaf83){_0x5685b6['model']=_[_0xcd66('0x27')](db[_0xcd66('0x4a')][_0xcd66('0x7a')]);_0x5685b6[_0xcd66('0x1e')]=_['keys'](_0x4a0d49[_0xcd66('0x1e')]);_0x5685b6[_0xcd66('0x7b')]=_[_0xcd66('0x9c')](_0x5685b6['model'],_0x5685b6[_0xcd66('0x1e')]);_0xf5fd1b[_0xcd66('0x7d')]=_['intersection'](_0x5685b6[_0xcd66('0x7c')],qs['fields'](_0x4a0d49['query']['fields']));_0xf5fd1b[_0xcd66('0x7d')]=_0xf5fd1b[_0xcd66('0x7d')][_0xcd66('0x28')]?_0xf5fd1b[_0xcd66('0x7d')]:_0x5685b6['model'];if(!_0x4a0d49[_0xcd66('0x1e')]['hasOwnProperty'](_0xcd66('0x83'))){_0xf5fd1b[_0xcd66('0x11')]=qs[_0xcd66('0x11')](_0x4a0d49['query'][_0xcd66('0x11')]);_0xf5fd1b[_0xcd66('0xf')]=qs[_0xcd66('0xf')](_0x4a0d49[_0xcd66('0x1e')]['offset']);}_0xf5fd1b[_0xcd66('0xa2')]=qs[_0xcd66('0x7f')](_0x4a0d49[_0xcd66('0x1e')][_0xcd66('0x7f')]);_0xf5fd1b['where']=qs[_0xcd66('0x7b')](_[_0xcd66('0x80')](_0x4a0d49[_0xcd66('0x1e')],_0x5685b6[_0xcd66('0x7b')]));_0xf5fd1b['where'][_0xcd66('0x9d')]=_0x2aaf83['id'];if(_0x4a0d49[_0xcd66('0x1e')][_0xcd66('0x81')]){_0xf5fd1b[_0xcd66('0x5b')]=_[_0xcd66('0x35')](_0xf5fd1b['where'],{'$or':_['map'](_0xf5fd1b[_0xcd66('0x7d')],function(_0x41b494){var _0x2157ac={};_0x2157ac[_0x41b494]={'$like':'%'+_0x4a0d49['query'][_0xcd66('0x81')]+'%'};return _0x2157ac;})});}_0xf5fd1b=_[_0xcd66('0x35')]({},_0xf5fd1b,_0x4a0d49[_0xcd66('0x82')]);return db[_0xcd66('0x4a')][_0xcd66('0x12')]({'where':_0xf5fd1b['where']})['then'](function(_0x3fd545){_0x1e2821['count']=_0x3fd545;if(_0x4a0d49['query'][_0xcd66('0x9e')]){_0xf5fd1b[_0xcd66('0x9f')]=[{'all':!![]}];}return db['CmHopperHistory'][_0xcd66('0x1d')](_0xf5fd1b);})[_0xcd66('0x15')](function(_0x2e62f7){_0x1e2821[_0xcd66('0xa0')]=_0x2e62f7;return _0x1e2821;});}})[_0xcd66('0x15')](respondWithFilteredResult(_0x3741e0,_0xf5fd1b))[_0xcd66('0x23')](handleError(_0x3741e0,null));};exports[_0xcd66('0xa3')]=function(_0x2160b5,_0x2f52b0){var _0x2bc523={'raw':!![],'where':{}};var _0x5a70e0={};var _0x4bd99d={'count':0x0,'rows':[]};return db[_0xcd66('0x25')][_0xcd66('0x79')]({'where':{'id':_0x2160b5['params']['id']}})[_0xcd66('0x15')](handleEntityNotFound(_0x2f52b0,null))[_0xcd66('0x15')](function(_0x40adfe){if(_0x40adfe){_0x5a70e0[_0xcd66('0x7c')]=_[_0xcd66('0x27')](db[_0xcd66('0x49')][_0xcd66('0x7a')]);_0x5a70e0[_0xcd66('0x1e')]=_[_0xcd66('0x27')](_0x2160b5['query']);_0x5a70e0[_0xcd66('0x7b')]=_[_0xcd66('0x9c')](_0x5a70e0['model'],_0x5a70e0['query']);_0x2bc523[_0xcd66('0x7d')]=_[_0xcd66('0x9c')](_0x5a70e0[_0xcd66('0x7c')],qs[_0xcd66('0x7e')](_0x2160b5[_0xcd66('0x1e')][_0xcd66('0x7e')]));_0x2bc523[_0xcd66('0x7d')]=_0x2bc523[_0xcd66('0x7d')]['length']?_0x2bc523[_0xcd66('0x7d')]:_0x5a70e0['model'];if(!_0x2160b5[_0xcd66('0x1e')]['hasOwnProperty'](_0xcd66('0x83'))){_0x2bc523['limit']=qs['limit'](_0x2160b5[_0xcd66('0x1e')]['limit']);_0x2bc523[_0xcd66('0xf')]=qs[_0xcd66('0xf')](_0x2160b5[_0xcd66('0x1e')][_0xcd66('0xf')]);}_0x2bc523[_0xcd66('0xa2')]=qs[_0xcd66('0x7f')](_0x2160b5[_0xcd66('0x1e')][_0xcd66('0x7f')]);_0x2bc523[_0xcd66('0x5b')]=qs[_0xcd66('0x7b')](_[_0xcd66('0x80')](_0x2160b5[_0xcd66('0x1e')],_0x5a70e0[_0xcd66('0x7b')]));_0x2bc523[_0xcd66('0x5b')][_0xcd66('0x9d')]=_0x40adfe['id'];if(_0x2160b5[_0xcd66('0x1e')]['filter']){_0x2bc523['where']=_[_0xcd66('0x35')](_0x2bc523['where'],{'$or':_[_0xcd66('0x69')](_0x2bc523[_0xcd66('0x7d')],function(_0x122bd4){var _0x348c87={};_0x348c87[_0x122bd4]={'$like':'%'+_0x2160b5[_0xcd66('0x1e')][_0xcd66('0x81')]+'%'};return _0x348c87;})});}_0x2bc523=_['merge']({},_0x2bc523,_0x2160b5[_0xcd66('0x82')]);return db['CmHopperFinal'][_0xcd66('0x12')]({'where':_0x2bc523[_0xcd66('0x5b')]})[_0xcd66('0x15')](function(_0x449fa6){_0x4bd99d['count']=_0x449fa6;if(_0x2160b5[_0xcd66('0x1e')]['includeAll']){_0x2bc523['include']=[{'all':!![]}];}return db[_0xcd66('0x49')][_0xcd66('0x1d')](_0x2bc523);})[_0xcd66('0x15')](function(_0x4bb098){_0x4bd99d['rows']=_0x4bb098;return _0x4bd99d;});}})[_0xcd66('0x15')](respondWithFilteredResult(_0x2f52b0,_0x2bc523))[_0xcd66('0x23')](handleError(_0x2f52b0,null));};exports[_0xcd66('0xa4')]=function(_0x3c1ce3,_0x11d0ea){var _0x27a3bd={'raw':!![],'where':{}};var _0x411d3d={};var _0x53e8b7={'count':0x0,'rows':[]};return db['CmContact'][_0xcd66('0x79')]({'where':{'id':_0x3c1ce3[_0xcd66('0x22')]['id']}})[_0xcd66('0x15')](handleEntityNotFound(_0x11d0ea,null))[_0xcd66('0x15')](function(_0x1eb1b4){if(_0x1eb1b4){_0x411d3d[_0xcd66('0x7c')]=_[_0xcd66('0x27')](db['JscriptySessionReport']['rawAttributes']);_0x411d3d[_0xcd66('0x1e')]=_[_0xcd66('0x27')](_0x3c1ce3[_0xcd66('0x1e')]);_0x411d3d[_0xcd66('0x7b')]=_[_0xcd66('0x9c')](_0x411d3d['model'],_0x411d3d[_0xcd66('0x1e')]);_0x27a3bd[_0xcd66('0x7d')]=_['intersection'](_0x411d3d['model'],qs[_0xcd66('0x7e')](_0x3c1ce3[_0xcd66('0x1e')][_0xcd66('0x7e')]));_0x27a3bd[_0xcd66('0x7d')]=_0x27a3bd[_0xcd66('0x7d')][_0xcd66('0x28')]?_0x27a3bd['attributes']:_0x411d3d[_0xcd66('0x7c')];if(!_0x3c1ce3['query'][_0xcd66('0x34')](_0xcd66('0x83'))){_0x27a3bd[_0xcd66('0x11')]=qs[_0xcd66('0x11')](_0x3c1ce3[_0xcd66('0x1e')][_0xcd66('0x11')]);_0x27a3bd[_0xcd66('0xf')]=qs[_0xcd66('0xf')](_0x3c1ce3[_0xcd66('0x1e')][_0xcd66('0xf')]);}_0x27a3bd['order']=qs['sort'](_0x3c1ce3[_0xcd66('0x1e')]['sort']);_0x27a3bd[_0xcd66('0x5b')]=qs[_0xcd66('0x7b')](_[_0xcd66('0x80')](_0x3c1ce3[_0xcd66('0x1e')],_0x411d3d[_0xcd66('0x7b')]));_0x27a3bd[_0xcd66('0x5b')]['ContactId']=_0x1eb1b4['id'];if(_0x3c1ce3[_0xcd66('0x1e')][_0xcd66('0x81')]){_0x27a3bd[_0xcd66('0x5b')]=_[_0xcd66('0x35')](_0x27a3bd[_0xcd66('0x5b')],{'$or':_[_0xcd66('0x69')](_0x27a3bd[_0xcd66('0x7d')],function(_0x2dbbb6){var _0x59af46={};_0x59af46[_0x2dbbb6]={'$like':'%'+_0x3c1ce3['query'][_0xcd66('0x81')]+'%'};return _0x59af46;})});}_0x27a3bd=_[_0xcd66('0x35')]({},_0x27a3bd,_0x3c1ce3[_0xcd66('0x82')]);return db[_0xcd66('0x52')][_0xcd66('0x12')]({'where':_0x27a3bd[_0xcd66('0x5b')]})[_0xcd66('0x15')](function(_0x25aa5c){_0x53e8b7[_0xcd66('0x12')]=_0x25aa5c;if(_0x3c1ce3[_0xcd66('0x1e')]['includeAll']){_0x27a3bd[_0xcd66('0x9f')]=[{'all':!![]}];}return db['JscriptySessionReport']['findAll'](_0x27a3bd);})[_0xcd66('0x15')](function(_0x3cc0aa){_0x53e8b7[_0xcd66('0xa0')]=_0x3cc0aa;return _0x53e8b7;});}})[_0xcd66('0x15')](respondWithFilteredResult(_0x11d0ea,_0x27a3bd))['catch'](handleError(_0x11d0ea,null));};exports[_0xcd66('0xa5')]=function(_0x298945,_0x49c6c7){try{if(!_0x298945['body']['ListId']){throw new Error(_0xcd66('0xa6'));}if(!_0x298945[_0xcd66('0x36')][_0xcd66('0xa7')]){throw new Error(_0xcd66('0xa8'));}if(!_0x298945[_0xcd66('0x36')]['binding_values']){throw new Error(_0xcd66('0xa9'));}if(!_0x298945[_0xcd66('0x36')][_0xcd66('0xaa')]){throw new Error(_0xcd66('0xab'));}var _0x118154=_0x298945[_0xcd66('0x36')][_0xcd66('0xa7')]['split'](',');var _0x511564=_0x298945[_0xcd66('0x36')]['binding_values'][_0xcd66('0xac')](',');if(!_0x118154[_0xcd66('0x28')]||!_0x511564[_0xcd66('0x28')]||_0x118154['length']!==_0x511564[_0xcd66('0x28')]){throw new Error(_0xcd66('0xad'));}_0x298945['body']['fields']=_[_0xcd66('0xae')](_0x118154,_0x511564);if(!_0x298945[_0xcd66('0x36')]['fields'][_0xcd66('0x76')]){throw new Error('No\x20phone\x20column\x20specified');}if(!_0x298945['body'][_0xcd66('0x7e')][_0xcd66('0xaf')]){throw new Error(_0xcd66('0xb0'));}var _0x2a598d=path[_0xcd66('0x55')](config[_0xcd66('0xb1')],'server/files/tmp',_0x298945[_0xcd66('0xb2')][_0xcd66('0xb3')]);fs[_0xcd66('0xb4')](_0x2a598d,parseInt(_0xcd66('0xb5'),0x8));var _0x562f08=require(_0xcd66('0xb6'))[_0xcd66('0xb7')](path[_0xcd66('0x55')](__dirname,_0xcd66('0xb8')),[_0x2a598d,_0x298945[_0xcd66('0x36')][_0xcd66('0xa7')],_0x298945[_0xcd66('0x36')]['binding_values'],_0x298945[_0xcd66('0x36')][_0xcd66('0x5e')],_0x298945[_0xcd66('0x36')][_0xcd66('0xb9')],_0x298945[_0xcd66('0x36')][_0xcd66('0x5a')],_0x298945[_0xcd66('0x36')]['socket_timestamp']]);return _0x49c6c7['status'](0xc8)[_0xcd66('0xe')]({'message':_0xcd66('0xba'),'pid':_0x562f08[_0xcd66('0xbb')]});}catch(_0x1dbe43){return _0x49c6c7[_0xcd66('0xd')](0x1f4)[_0xcd66('0xbc')](_0x1dbe43);}};exports[_0xcd66('0xbd')]=function(_0x58331a,_0x1788e4){var _0x3ccb7d=fs['createReadStream'](_0x58331a[_0xcd66('0xb2')][_0xcd66('0x3')]);Papa[_0xcd66('0xbe')](_0x3ccb7d,{'header':!![],'skipEmptyLines':!![],'preview':0x1,'complete':function(_0x516760){return _0x1788e4[_0xcd66('0xd')](0xc8)[_0xcd66('0xe')]({'file':_0x58331a[_0xcd66('0xb2')],'fields':_0x516760[_0xcd66('0xbf')][_0xcd66('0x7e')]});}});};exports[_0xcd66('0xc0')]=function(_0x165f20,_0x4a227d){return db['User'][_0xcd66('0x1d')]({'raw':!![],'attributes':['id'],'where':{'role':_0xcd66('0xc1')}})[_0xcd66('0x15')](function(_0x43e4b6){var _0x1851af=![];if(!_0x165f20[_0xcd66('0x36')][_0xcd66('0x5e')]){throw new Error(_0xcd66('0xa6'));}if(!_0x165f20[_0xcd66('0x36')][_0xcd66('0xc2')][_0xcd66('0x76')]){throw new Error(_0xcd66('0xc3'));}if(!_0x165f20[_0xcd66('0x36')][_0xcd66('0xc2')][_0xcd66('0xaf')]){throw new Error(_0xcd66('0xb0'));}if(!_0x165f20[_0xcd66('0x36')]['socket_timestamp']){throw new Error('Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed');}var _0x4bff0=require(_0xcd66('0xb6'))[_0xcd66('0xb7')](path[_0xcd66('0x55')](__dirname,_0xcd66('0xc4')),[_0x165f20[_0xcd66('0x22')]['id'],JSON[_0xcd66('0xc5')](_0x165f20[_0xcd66('0x36')]),JSON[_0xcd66('0xc5')](_0x43e4b6)]);_0x4bff0['on'](_0xcd66('0xc6'),function(){_0x1851af=!![];return _0x4a227d[_0xcd66('0xd')](0xc8)[_0xcd66('0xe')]({'message':'start\x20child\x20process\x20correctly!','pid':_0x4bff0[_0xcd66('0xbb')]});});_0x4bff0['on'](_0xcd66('0xc7'),function(_0x307776){if(_0x307776&&!_0x1851af){return _0x4a227d[_0xcd66('0xd')](0x1f4)['json']({'message':_0xcd66('0xc8'),'pid':_0x4bff0[_0xcd66('0xbb')]});}});})[_0xcd66('0x23')](handleError(_0x4a227d,null));};exports[_0xcd66('0xc9')]=function(_0x1512a5,_0x24d9f0){return db['User'][_0xcd66('0x1d')]({'raw':!![],'attributes':['id'],'where':{'role':_0xcd66('0xc1')}})['then'](function(_0x4dd9de){var _0x21e04f=![];if(!_0x1512a5[_0xcd66('0x36')][_0xcd66('0x5e')]){throw new Error(_0xcd66('0xa6'));}if(!_0x1512a5[_0xcd66('0x36')]['binding'][_0xcd66('0x76')]){throw new Error(_0xcd66('0xc3'));}if(!_0x1512a5['body']['binding'][_0xcd66('0xaf')]){throw new Error(_0xcd66('0xb0'));}if(!_0x1512a5[_0xcd66('0x36')][_0xcd66('0xaa')]){throw new Error(_0xcd66('0xab'));}var _0x409bde=require(_0xcd66('0xb6'))[_0xcd66('0xb7')](path[_0xcd66('0x55')](__dirname,_0xcd66('0xca')),[_0x1512a5[_0xcd66('0x22')]['id'],JSON[_0xcd66('0xc5')](_0x1512a5['body']),JSON[_0xcd66('0xc5')](_0x4dd9de)]);_0x409bde['on'](_0xcd66('0xc6'),function(){_0x21e04f=!![];return _0x24d9f0['status'](0xc8)[_0xcd66('0xe')]({'message':_0xcd66('0xcb'),'pid':_0x409bde[_0xcd66('0xbb')]});});_0x409bde['on'](_0xcd66('0xc7'),function(_0x175867){if(_0x175867&&!_0x21e04f){return _0x24d9f0[_0xcd66('0xd')](0x1f4)[_0xcd66('0xe')]({'message':_0xcd66('0xc8'),'pid':_0x409bde['pid']});}});})['catch'](handleError(_0x24d9f0,null));};exports[_0xcd66('0xcc')]=function(_0x8b5002,_0x165d16){var _0x3a79d9=['mail',_0xcd66('0xcd'),_0xcd66('0xce'),_0xcd66('0xcf'),'fax',_0xcd66('0xd0'),'voice'];var _0x183dfd={'offset':0x0,'order':qs['sort'](_0xcd66('0xd1'))},_0x537d05={'count':0x0,'rows':[]};Promise[_0xcd66('0xd2')]()['then'](function(){if(_0x8b5002[_0xcd66('0x1e')][_0xcd66('0xd3')]){if(!_[_0xcd66('0xd4')](_0x3a79d9,_0x8b5002['query']['channel'][_0xcd66('0xd5')]())){throw new Error(_0xcd66('0xd6'));}_0x3a79d9=[_0x8b5002[_0xcd66('0x1e')][_0xcd66('0xd3')]['toLowerCase']()];}if(_0x8b5002['query'][_0xcd66('0xd7')]){try{var _0x3e8689=JSON[_0xcd66('0xbe')](_0x8b5002[_0xcd66('0x1e')]['range']);if(!moment(_0x3e8689[_0xcd66('0x37')])[_0xcd66('0xd8')]()){throw new Error(_0xcd66('0xd9'));}if(!moment(_0x3e8689['to'])[_0xcd66('0xd8')]()){throw new Error('Invalid\x20date\x20for\x20range\x20to\x20filter');}}catch(_0x161e7c){throw new Error(_0xcd66('0xda'));}}if(!_0x8b5002[_0xcd66('0x1e')][_0xcd66('0x34')](_0xcd66('0x83'))){_0x183dfd['limit']=qs[_0xcd66('0x11')](_0x8b5002[_0xcd66('0x1e')]['limit']||0xa);_0x183dfd[_0xcd66('0xf')]=qs[_0xcd66('0xf')](_0x8b5002[_0xcd66('0x1e')][_0xcd66('0xf')]);}var _0xd71368=_0x3a79d9['map'](function(_0x108af6){if(_0x108af6===_0xcd66('0xdb')){var _0x3711b5={'attributes':['id',_0xcd66('0xdc'),_0xcd66('0x2f'),_0xcd66('0xdd'),_0xcd66('0xde'),_0xcd66('0xdf'),_0xcd66('0xe0'),_0xcd66('0xe1'),_0xcd66('0xe2'),_0xcd66('0xe3'),_0xcd66('0xe4'),_0xcd66('0xe5'),_0xcd66('0xe6'),_0xcd66('0xe7'),_0xcd66('0xe8')],'where':{'ContactId':_0x8b5002[_0xcd66('0x22')]['id']},'include':[{'model':db[_0xcd66('0xe9')],'as':_0xcd66('0xe9'),'attributes':['id',_0xcd66('0x1a'),_0xcd66('0xea'),_0xcd66('0x2e')]}],'order':[['createdAt',_0xcd66('0xeb')]]};if(_0x8b5002['query'][_0xcd66('0xd7')]){_0x3711b5[_0xcd66('0x5b')][_0xcd66('0xe4')]={'$gte':_0x3e8689[_0xcd66('0x37')],'$lte':_0x3e8689['to']};}return db[_0xcd66('0x4c')][_0xcd66('0xec')](_0x3711b5)[_0xcd66('0x15')](function(_0x560705){_0x537d05[_0xcd66('0x12')]+=_0x560705[_0xcd66('0x12')];return _[_0xcd66('0x69')](_0x560705['rows'],function(_0x1a7798){var _0x5b6835=_0x1a7798[_0xcd66('0x38')]({'plain':!![]});_0x5b6835[_0xcd66('0xd3')]=_0x108af6;if(_0x5b6835['User']){_0x5b6835[_0xcd66('0xe9')]={'id':_0x5b6835[_0xcd66('0xe9')]['id'],'name':_0x5b6835[_0xcd66('0xe9')][_0xcd66('0x1a')],'fullname':_0x5b6835['User']['fullname'],'alias':_0x5b6835[_0xcd66('0xe9')][_0xcd66('0x2e')]};}return _0x5b6835;});});}else{var _0x5865fd=_[_0xcd66('0xed')](_0x108af6)+(_0x108af6==='chat'?_0xcd66('0xee'):'Account');var _0x53a8c6={'attributes':['id',_0xcd66('0xef'),'closedAt',_0xcd66('0xe4'),_0xcd66('0xe3'),_0xcd66('0xf0'),_0xcd66('0xf1'),_0xcd66('0xf2'),_0xcd66('0xe8'),_0x5865fd+'Id'],'where':{'ContactId':_0x8b5002[_0xcd66('0x22')]['id']},'include':[{'model':db[_0x5865fd],'as':_0xcd66('0xf3'),'attributes':['id',_0xcd66('0x1a'),_0xcd66('0xf4')]},{'model':db[_0xcd66('0xe9')],'as':_0xcd66('0xf5'),'attributes':['id','name',_0xcd66('0xea')]},{'model':db[_0xcd66('0x62')],'as':_0xcd66('0x63'),'attributes':['id',_0xcd66('0x1a'),_0xcd66('0x64')],'through':{'attributes':[]}}],'order':[[_0xcd66('0xe4'),_0xcd66('0xeb')]]};if(_0x8b5002[_0xcd66('0x1e')][_0xcd66('0xd7')]){_0x53a8c6['where'][_0xcd66('0xe4')]={'$gte':_0x3e8689[_0xcd66('0x37')],'$lte':_0x3e8689['to']};}switch(_0x108af6){case _0xcd66('0xcd'):_0x53a8c6[_0xcd66('0x7d')][_0xcd66('0x5d')]('browserName',_0xcd66('0xf6'),_0xcd66('0xf7'),_0xcd66('0xf8'),'osName',_0xcd66('0xf9'),_0xcd66('0xfa'),'ratingValue',_0xcd66('0xfb'));break;case'mail':_0x53a8c6[_0xcd66('0x7d')][_0xcd66('0x5d')](_0xcd66('0xfc'),_0xcd66('0xfd'));break;case _0xcd66('0xcf'):_0x53a8c6[_0xcd66('0x7d')]['push'](_0xcd66('0xfe'),_0xcd66('0xff'));break;}return db[_[_0xcd66('0xed')](_0x108af6)+_0xcd66('0x100')]['findAndCountAll'](_0x53a8c6)[_0xcd66('0x15')](function(_0x49cc13){_0x537d05[_0xcd66('0x12')]+=_0x49cc13[_0xcd66('0x12')];return _[_0xcd66('0x69')](_0x49cc13[_0xcd66('0xa0')],function(_0x132a41){var _0x218b75=_0x132a41[_0xcd66('0x38')]({'plain':!![]});_0x218b75[_0xcd66('0xd3')]=_0x108af6;if(_0x218b75['Owner']){_0x218b75[_0xcd66('0xf5')]={'id':_0x218b75[_0xcd66('0xf5')]['id'],'name':_0x218b75[_0xcd66('0xf5')][_0xcd66('0x1a')],'fullname':_0x218b75[_0xcd66('0xf5')][_0xcd66('0xea')]};}return _0x218b75;});});}});return Promise[_0xcd66('0x8e')](_0xd71368);})[_0xcd66('0x15')](function(_0xdd58be){return _(_0xdd58be)['flatten']()[_0xcd66('0x101')](_0xcd66('0xe4'))[_0xcd66('0x102')]()['value']();})[_0xcd66('0x15')](function(_0x26d9cb){_0x537d05[_0xcd66('0xa0')]=_0x183dfd[_0xcd66('0x11')]?_0x26d9cb[_0xcd66('0x103')](_0x183dfd[_0xcd66('0xf')],_0x183dfd[_0xcd66('0xf')]+_0x183dfd[_0xcd66('0x11')]):_0x26d9cb;return _0x537d05;})[_0xcd66('0x15')](respondWithFilteredResult(_0x165d16,_0x183dfd))[_0xcd66('0x23')](handleError(_0x165d16,null));}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.events.js b/server/api/cmContact/cmContact.events.js index 6e5e07a..c013c94 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 _0x81f9=['remove','emit','hasOwnProperty','hook','events','update'];(function(_0x15e102,_0xdd6073){var _0x1de943=function(_0x5b16bc){while(--_0x5b16bc){_0x15e102['push'](_0x15e102['shift']());}};_0x1de943(++_0xdd6073);}(_0x81f9,0xb2));var _0x981f=function(_0x1714a3,_0x1fc437){_0x1714a3=_0x1714a3-0x0;var _0x3d52fa=_0x81f9[_0x1714a3];return _0x3d52fa;};'use strict';var EventEmitter=require(_0x981f('0x0'));var CmContact=require('../../mysqldb')['db']['CmContact'];var CmContactEvents=new EventEmitter();CmContactEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x981f('0x1'),'afterDestroy':_0x981f('0x2')};function emitEvent(_0x388345){return function(_0x325785,_0xd55ca,_0x5e9ec6){CmContactEvents[_0x981f('0x3')](_0x388345+':'+_0x325785['id'],_0x325785);CmContactEvents[_0x981f('0x3')](_0x388345,_0x325785);_0x5e9ec6(null);};}for(var e in events){if(events[_0x981f('0x4')](e)){var event=events[e];CmContact[_0x981f('0x5')](e,emitEvent(event));}}module['exports']=CmContactEvents; \ No newline at end of file +var _0x1ce6=['remove','emit','hasOwnProperty','exports','setMaxListeners','save'];(function(_0x72b848,_0xf0350d){var _0x52b1c9=function(_0x4f4b08){while(--_0x4f4b08){_0x72b848['push'](_0x72b848['shift']());}};_0x52b1c9(++_0xf0350d);}(_0x1ce6,0x136));var _0x61ce=function(_0x58d533,_0x2bcda3){_0x58d533=_0x58d533-0x0;var _0xfb8f79=_0x1ce6[_0x58d533];return _0xfb8f79;};'use strict';var EventEmitter=require('events');var CmContact=require('../../mysqldb')['db']['CmContact'];var CmContactEvents=new EventEmitter();CmContactEvents[_0x61ce('0x0')](0x0);var events={'afterCreate':_0x61ce('0x1'),'afterUpdate':'update','afterDestroy':_0x61ce('0x2')};function emitEvent(_0x1f03e5){return function(_0x2003e8,_0x355727,_0x48a726){CmContactEvents[_0x61ce('0x3')](_0x1f03e5+':'+_0x2003e8['id'],_0x2003e8);CmContactEvents[_0x61ce('0x3')](_0x1f03e5,_0x2003e8);_0x48a726(null);};}for(var e in events){if(events[_0x61ce('0x4')](e)){var event=events[e];CmContact['hook'](e,emitEvent(event));}}module[_0x61ce('0x5')]=CmContactEvents; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.model.js b/server/api/cmContact/cmContact.model.js index caa3a6f..5ea5cb9 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 _0x5181=['findOne','ListId','Campaign','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20Campaign\x20','ret','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20Campaign\x20','CmHopperFinal','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20Campaign\x20','outbound','dialCheckDuplicateType','CmList','Lists','length','get','findAll','BlackLists','cmContact,\x20%s,\x20%s','always','CmHopperBlack','message','List\x20not\x20found','models','destroy','ContactId','VoiceQueueId','push','all','[CmContact][afterDestroy][Succesfull]','[CmContact][afterDestroy][Error]','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','../../config/environment/shared','./cmContact.attributes','exports','define','CmContact','phone','fti_cm_contacts','firstName','fax','utf8mb4','utf8mb4_unicode_ci','error','cmContact','afterCreate','inspect','scheduledat','format','YYYY-MM-DD\x20HH:mm:ss','isNil','VoiceQueue','then','timezones','dialTimezone','utcOffset','add','minutes','CmHopper','cmContact,\x20afterCreate\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','create','priority','callbackUniqueid','catch','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20VoiceQueue\x20'];(function(_0x54d4a8,_0x585a59){var _0x3b321b=function(_0x245c6a){while(--_0x245c6a){_0x54d4a8['push'](_0x54d4a8['shift']());}};_0x3b321b(++_0x585a59);}(_0x5181,0x66));var _0x1518=function(_0x5c10d3,_0x3a3b3a){_0x5c10d3=_0x5c10d3-0x0;var _0x2cbab4=_0x5181[_0x5c10d3];return _0x2cbab4;};'use strict';var _=require(_0x1518('0x0'));var util=require(_0x1518('0x1'));var logger=require(_0x1518('0x2'))(_0x1518('0x3'));var moment=require(_0x1518('0x4'));var BPromise=require(_0x1518('0x5'));var rp=require(_0x1518('0x6'));var fs=require('fs');var path=require(_0x1518('0x7'));var rimraf=require(_0x1518('0x8'));var config=require(_0x1518('0x9'));var shared=require(_0x1518('0xa'));var attributes=require(_0x1518('0xb'));module[_0x1518('0xc')]=function(_0x53ece0,_0x57d609){return _0x53ece0[_0x1518('0xd')](_0x1518('0xe'),attributes,{'tableName':'cm_contacts','paranoid':!![],'indexes':[{'name':_0x1518('0xf'),'fields':[_0x1518('0xf')]},{'name':_0x1518('0x10'),'fields':[_0x1518('0x11'),'lastName',_0x1518('0xf'),'mobile',_0x1518('0x12'),'email'],'type':'FULLTEXT'}],'timestamps':!![],'charset':_0x1518('0x13'),'collate':_0x1518('0x14'),'hooks':{'afterCreate':function(_0x711bcf,_0x5a78a9,_0x4e8b42){var _0x43c4f3=_0x53ece0['models'];var _0x3dd465=_0x711bcf['get']({'plain':!![]});function _0x7c7b53(){return function(_0x767690){logger[_0x1518('0x15')](_0x1518('0x16'),_0x1518('0x17'),util[_0x1518('0x18')](_0x767690,{'showHidden':![],'depth':null}));};}function _0x26ae7d(_0xac4a66,_0x30731f){var _0x13bc44=_0x30731f['scheduledat']?_0x30731f[_0x1518('0x19')]:moment()[_0x1518('0x1a')](_0x1518('0x1b'));return new BPromise(function(_0x53a3e6,_0x3501be){if(_[_0x1518('0x1c')](_0x30731f['dialTimezone'])){_0x53a3e6({'ret':_0x13bc44});}else{_0x43c4f3[_0x1518('0x1d')]['findOne']({'where':{'id':_0xac4a66['id']}})[_0x1518('0x1e')](function(_0xd9df0d){if(!_[_0x1518('0x1c')](_0xd9df0d)){var _0x1d5f8c=_0xd9df0d['dialTimezone'];if(!_[_0x1518('0x1c')](_0x1d5f8c)){var _0x3dc656=shared[_0x1518('0x1f')];var _0x24c7cb=_0x3dc656[_0x1d5f8c];var _0x4aa6b2=_0x3dc656[_0x30731f[_0x1518('0x20')]];if(!_['isNil'](_0x24c7cb)&&!_['isNil'](_0x4aa6b2)){var _0x25a9bb=_0x24c7cb[_0x1518('0x21')]-_0x4aa6b2[_0x1518('0x21')];_0x13bc44=_0x30731f['scheduledat']?_0x30731f[_0x1518('0x19')]:moment();var _0x1322e8=moment(_0x13bc44)[_0x1518('0x22')](_0x25a9bb,_0x1518('0x23'));_0x53a3e6({'ret':_0x1322e8[_0x1518('0x1a')](_0x1518('0x1b'))});}else _0x53a3e6({'ret':_0x13bc44});}else _0x53a3e6({'ret':_0x13bc44});}else{_0x53a3e6({'ret':_0x13bc44});}});}});return 0xa;}var _0x2d48e3=function(_0x1c3d0d){return new BPromise(function(_0x25ec4f,_0x62c2e4){_0x26ae7d(_0x1c3d0d,_0x3dd465)[_0x1518('0x1e')](function(_0x172f42){_0x3dd465[_0x1518('0x19')]=_0x172f42['ret'];_0x43c4f3[_0x1518('0x24')]['findOne']({'where':{'phone':_0x3dd465['phone'],'VoiceQueueId':_0x1c3d0d['id']}})[_0x1518('0x1e')](function(_0x35cbde){if(!_[_0x1518('0x1c')](_0x35cbde)){throw new Error(_0x1518('0x25')+_0x3dd465['phone']+_0x1518('0x26')+_0x1c3d0d['id']);}return _0x43c4f3[_0x1518('0x24')][_0x1518('0x27')]({'phone':_0x3dd465[_0x1518('0xf')],'ContactId':_0x3dd465['id'],'ListId':_0x3dd465['ListId'],'priority':_0x3dd465[_0x1518('0x28')]?_0x3dd465[_0x1518('0x28')]:0x2,'scheduledat':_0x3dd465[_0x1518('0x19')]?_0x3dd465[_0x1518('0x19')]:moment()[_0x1518('0x1a')]('YYYY-MM-DD\x20HH:mm:ss'),'callback':_0x3dd465[_0x1518('0x29')]?!![]:![],'callbackuniqueid':_0x3dd465[_0x1518('0x29')]?_0x3dd465[_0x1518('0x29')]:undefined,'callbackat':_0x3dd465[_0x1518('0x29')]?moment()[_0x1518('0x1a')](_0x1518('0x1b')):undefined,'VoiceQueueId':_0x1c3d0d['id']});})[_0x1518('0x2a')](function(_0x288088){_0x62c2e4(_0x288088);});});});};var _0x348533=function(_0x37db16){return new BPromise(function(_0x374a94,_0x184d2c){_0x26ae7d(_0x37db16,_0x3dd465)[_0x1518('0x1e')](function(_0x11be42){_0x3dd465[_0x1518('0x19')]=_0x11be42['ret'];_0x43c4f3[_0x1518('0x24')]['findOne']({'where':{'phone':_0x3dd465[_0x1518('0xf')],'VoiceQueueId':_0x37db16['id']}})['then'](function(_0x5105c5){if(!_[_0x1518('0x1c')](_0x5105c5)){throw new Error(_0x1518('0x25')+_0x3dd465[_0x1518('0xf')]+_0x1518('0x2b')+_0x37db16['id']);}return _0x43c4f3['CmHopperFinal'][_0x1518('0x2c')]({'where':{'calleridnum':_0x3dd465[_0x1518('0xf')],'VoiceQueueId':_0x37db16['id']}});})['then'](function(_0x88338){if(!_[_0x1518('0x1c')](_0x88338)){throw new Error('cmContact,\x20afterCreate,\x20'+_0x3dd465[_0x1518('0xf')]+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20VoiceQueue\x20'+_0x37db16['id']);}return _0x43c4f3[_0x1518('0x24')][_0x1518('0x27')]({'phone':_0x3dd465[_0x1518('0xf')],'ContactId':_0x3dd465['id'],'ListId':_0x3dd465[_0x1518('0x2d')],'priority':_0x3dd465['priority']?_0x3dd465[_0x1518('0x28')]:0x2,'scheduledat':_0x3dd465['scheduledat']?_0x3dd465[_0x1518('0x19')]:moment()[_0x1518('0x1a')](_0x1518('0x1b')),'callback':_0x3dd465[_0x1518('0x29')]?!![]:![],'callbackuniqueid':_0x3dd465[_0x1518('0x29')]?_0x3dd465[_0x1518('0x29')]:undefined,'callbackat':_0x3dd465[_0x1518('0x29')]?moment()['format'](_0x1518('0x1b')):undefined,'VoiceQueueId':_0x37db16['id']});})['catch'](function(_0x5db609){_0x184d2c(_0x5db609);});});});};function _0x2d7a50(){return function(_0x352cad){logger[_0x1518('0x15')](_0x1518('0x16'),_0x1518('0x17'),util[_0x1518('0x18')](_0x352cad,{'showHidden':![],'depth':null}));};}function _0x28b433(_0x42282b,_0x20148a){var _0x98f29f=_0x20148a[_0x1518('0x19')]?_0x20148a[_0x1518('0x19')]:moment()[_0x1518('0x1a')](_0x1518('0x1b'));return new BPromise(function(_0x2fa403,_0x4a8105){if(_[_0x1518('0x1c')](_0x20148a[_0x1518('0x20')])){_0x2fa403({'ret':_0x98f29f});}else{_0x43c4f3[_0x1518('0x2e')]['findOne']({'where':{'id':_0x42282b['id']}})[_0x1518('0x1e')](function(_0x3e289e){if(!_[_0x1518('0x1c')](_0x3e289e)){var _0x303817=_0x3e289e[_0x1518('0x20')];if(!_[_0x1518('0x1c')](_0x303817)){var _0x30d8cc=shared[_0x1518('0x1f')];var _0x4c6d3b=_0x30d8cc[_0x303817];var _0x38f71a=_0x30d8cc[_0x20148a['dialTimezone']];if(!_[_0x1518('0x1c')](_0x4c6d3b)&&!_[_0x1518('0x1c')](_0x38f71a)){var _0x4b6b3e=_0x4c6d3b[_0x1518('0x21')]-_0x38f71a['utcOffset'];_0x98f29f=_0x20148a[_0x1518('0x19')]?_0x20148a['scheduledat']:moment();var _0xca0ee0=moment(_0x98f29f)[_0x1518('0x22')](_0x4b6b3e,_0x1518('0x23'));_0x2fa403({'ret':_0xca0ee0[_0x1518('0x1a')]('YYYY-MM-DD\x20HH:mm:ss')});}else _0x2fa403({'ret':_0x98f29f});}else _0x2fa403({'ret':_0x98f29f});}else{_0x2fa403({'ret':_0x98f29f});}});}});return 0xa;}var _0x15bd54=function(_0x3c8d27){return new BPromise(function(_0x20226e,_0x347421){_0x28b433(_0x3c8d27,_0x3dd465)['then'](function(_0x547591){_0x3dd465[_0x1518('0x19')]=_0x547591['ret'];_0x43c4f3[_0x1518('0x24')][_0x1518('0x2c')]({'where':{'phone':_0x3dd465[_0x1518('0xf')],'CampaignId':_0x3c8d27['id']}})[_0x1518('0x1e')](function(_0x53d182){if(!_[_0x1518('0x1c')](_0x53d182)){throw new Error('cmContact,\x20afterCreate\x20'+_0x3dd465[_0x1518('0xf')]+_0x1518('0x2f')+_0x3c8d27['id']);}return _0x43c4f3['CmHopper'][_0x1518('0x27')]({'phone':_0x3dd465[_0x1518('0xf')],'ContactId':_0x3dd465['id'],'ListId':_0x3dd465['ListId'],'priority':_0x3dd465[_0x1518('0x28')]?_0x3dd465[_0x1518('0x28')]:0x2,'scheduledat':_0x3dd465[_0x1518('0x19')]?_0x3dd465[_0x1518('0x19')]:moment()[_0x1518('0x1a')](_0x1518('0x1b')),'callback':_0x3dd465['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x3dd465['callbackUniqueid']?_0x3dd465[_0x1518('0x29')]:undefined,'callbackat':_0x3dd465[_0x1518('0x29')]?moment()[_0x1518('0x1a')](_0x1518('0x1b')):undefined,'CampaignId':_0x3c8d27['id']});})[_0x1518('0x2a')](function(_0x55366f){_0x347421(_0x55366f);});});});};var _0x1346f1=function(_0x376d64){return new BPromise(function(_0x3710a3,_0x3eab5f){_0x28b433(_0x376d64,_0x3dd465)[_0x1518('0x1e')](function(_0x11c5ef){_0x3dd465[_0x1518('0x19')]=_0x11c5ef[_0x1518('0x30')];_0x43c4f3[_0x1518('0x24')][_0x1518('0x2c')]({'where':{'phone':_0x3dd465[_0x1518('0xf')],'CampaignId':_0x376d64['id']}})['then'](function(_0xb35800){if(!_[_0x1518('0x1c')](_0xb35800)){throw new Error(_0x1518('0x25')+_0x3dd465[_0x1518('0xf')]+_0x1518('0x31')+_0x376d64['id']);}return _0x43c4f3[_0x1518('0x32')][_0x1518('0x2c')]({'where':{'calleridnum':_0x3dd465[_0x1518('0xf')],'CampaignId':_0x376d64['id']}});})[_0x1518('0x1e')](function(_0x5ba68f){if(!_[_0x1518('0x1c')](_0x5ba68f)){throw new Error('cmContact,\x20afterCreate,\x20'+_0x3dd465[_0x1518('0xf')]+_0x1518('0x33')+_0x376d64['id']);}return _0x43c4f3[_0x1518('0x24')][_0x1518('0x27')]({'phone':_0x3dd465[_0x1518('0xf')],'ContactId':_0x3dd465['id'],'ListId':_0x3dd465[_0x1518('0x2d')],'priority':_0x3dd465[_0x1518('0x28')]?_0x3dd465['priority']:0x2,'scheduledat':_0x3dd465[_0x1518('0x19')]?_0x3dd465[_0x1518('0x19')]:moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'callback':_0x3dd465[_0x1518('0x29')]?!![]:![],'callbackuniqueid':_0x3dd465['callbackUniqueid']?_0x3dd465[_0x1518('0x29')]:undefined,'callbackat':_0x3dd465[_0x1518('0x29')]?moment()[_0x1518('0x1a')](_0x1518('0x1b')):undefined,'CampaignId':_0x376d64['id']});})[_0x1518('0x2a')](function(_0x509f94){_0x3eab5f(_0x509f94);});});});};if(_0x3dd465[_0x1518('0x2d')]){_0x43c4f3['VoiceQueue']['findAll']({'where':{'type':_0x1518('0x34')},'attributes':['id',_0x1518('0x35'),_0x1518('0x20')],'include':[{'model':_0x43c4f3[_0x1518('0x36')],'as':_0x1518('0x37'),'where':{'id':_0x3dd465['ListId']}}]})[_0x1518('0x1e')](function(_0x280ecf){if(_0x280ecf){var _0xf73f4c=[];for(var _0x4fe5ab=0x0,_0x402caf;_0x4fe5ab<_0x280ecf[_0x1518('0x38')];_0x4fe5ab+=0x1){_0x402caf=_0x280ecf[_0x4fe5ab][_0x1518('0x39')]({'plain':!![]});switch(_0x402caf[_0x1518('0x35')]){case'always':_0x348533(_0x402caf)[_0x1518('0x2a')](_0x7c7b53());break;case'onlyIfOpen':_0x2d48e3(_0x402caf)[_0x1518('0x2a')](_0x7c7b53());break;default:_0x28b433(_0x402caf,_0x3dd465)[_0x1518('0x1e')](function(_0xc20d6b){_0x3dd465[_0x1518('0x19')]=_0xc20d6b[_0x1518('0x30')];_0x43c4f3[_0x1518('0x24')]['create']({'phone':_0x3dd465[_0x1518('0xf')],'ContactId':_0x3dd465['id'],'ListId':_0x3dd465[_0x1518('0x2d')],'scheduledat':_0x3dd465[_0x1518('0x19')]?_0x3dd465['scheduledat']:moment()['format'](_0x1518('0x1b')),'priority':_0x3dd465[_0x1518('0x28')]?_0x3dd465[_0x1518('0x28')]:0x2,'callback':_0x3dd465[_0x1518('0x29')]?!![]:![],'callbackuniqueid':_0x3dd465['callbackUniqueid']?_0x3dd465[_0x1518('0x29')]:undefined,'callbackat':_0x3dd465[_0x1518('0x29')]?moment()[_0x1518('0x1a')](_0x1518('0x1b')):undefined,'VoiceQueueId':_0x402caf['id']})[_0x1518('0x2a')](_0x7c7b53());});}}}})[_0x1518('0x1e')](function(){return _0x43c4f3['VoiceQueue'][_0x1518('0x3a')]({'where':{'type':_0x1518('0x34')},'attributes':['id'],'include':[{'model':_0x43c4f3[_0x1518('0x36')],'as':_0x1518('0x3b'),'where':{'id':_0x3dd465[_0x1518('0x2d')]}}]})[_0x1518('0x1e')](function(_0x5c6ffb){if(_0x5c6ffb){var _0x51b40a=[];for(var _0x1f26c9=0x0,_0x37283f;_0x1f26c9<_0x5c6ffb[_0x1518('0x38')];_0x1f26c9+=0x1){_0x37283f=_0x5c6ffb[_0x1f26c9][_0x1518('0x39')]({'plain':!![]});_0x43c4f3['CmHopperBlack'][_0x1518('0x27')]({'phone':_0x3dd465[_0x1518('0xf')],'ContactId':_0x3dd465['id'],'ListId':_0x3dd465[_0x1518('0x2d')],'VoiceQueueId':_0x37283f['id']})[_0x1518('0x2a')](function(_0x14ddca){logger[_0x1518('0x15')](_0x1518('0x3c'),_0x1518('0x17'),_0x14ddca['message']);});}}});})[_0x1518('0x1e')](function(){return _0x43c4f3[_0x1518('0x2e')]['findAll']({'attributes':['id',_0x1518('0x35'),'dialTimezone'],'include':[{'model':_0x43c4f3[_0x1518('0x36')],'as':_0x1518('0x37'),'where':{'id':_0x3dd465[_0x1518('0x2d')]}}]})[_0x1518('0x1e')](function(_0x3b21df){if(_0x3b21df){var _0x5d1f6f=[];for(var _0x24e4cb=0x0,_0x2255e6;_0x24e4cb<_0x3b21df[_0x1518('0x38')];_0x24e4cb+=0x1){_0x2255e6=_0x3b21df[_0x24e4cb][_0x1518('0x39')]({'plain':!![]});switch(_0x2255e6[_0x1518('0x35')]){case _0x1518('0x3d'):_0x1346f1(_0x2255e6)[_0x1518('0x2a')](_0x2d7a50());break;case'onlyIfOpen':_0x15bd54(_0x2255e6)['catch'](_0x2d7a50());break;default:_0x43c4f3[_0x1518('0x24')]['create']({'phone':_0x3dd465[_0x1518('0xf')],'ContactId':_0x3dd465['id'],'ListId':_0x3dd465[_0x1518('0x2d')],'scheduledat':_0x3dd465[_0x1518('0x19')]?_0x3dd465[_0x1518('0x19')]:moment()['format'](_0x1518('0x1b')),'priority':_0x3dd465[_0x1518('0x28')]?_0x3dd465['priority']:0x2,'callback':_0x3dd465[_0x1518('0x29')]?!![]:![],'callbackuniqueid':_0x3dd465['callbackUniqueid']?_0x3dd465[_0x1518('0x29')]:undefined,'callbackat':_0x3dd465[_0x1518('0x29')]?moment()['format'](_0x1518('0x1b')):undefined,'CampaignId':_0x2255e6['id']})[_0x1518('0x2a')](_0x2d7a50());}}}});})[_0x1518('0x1e')](function(){return _0x43c4f3[_0x1518('0x2e')][_0x1518('0x3a')]({'attributes':['id'],'include':[{'model':_0x43c4f3[_0x1518('0x36')],'as':_0x1518('0x3b'),'where':{'id':_0x3dd465[_0x1518('0x2d')]}}]})['then'](function(_0x51ca8d){if(_0x51ca8d){var _0x499862=[];for(var _0x36fe83=0x0,_0x4f38af;_0x36fe83<_0x51ca8d[_0x1518('0x38')];_0x36fe83+=0x1){_0x4f38af=_0x51ca8d[_0x36fe83][_0x1518('0x39')]({'plain':!![]});_0x43c4f3[_0x1518('0x3e')][_0x1518('0x27')]({'phone':_0x3dd465[_0x1518('0xf')],'ContactId':_0x3dd465['id'],'ListId':_0x3dd465[_0x1518('0x2d')],'CampaignId':_0x4f38af['id']})[_0x1518('0x2a')](function(_0x1b5175){logger[_0x1518('0x15')]('cmContact,\x20%s,\x20%s','afterCreate',_0x1b5175[_0x1518('0x3f')]);});}}});})[_0x1518('0x1e')](function(){_0x4e8b42();})[_0x1518('0x2a')](function(_0x31b268){logger[_0x1518('0x15')](_0x1518('0x3c'),'afterCreate',_0x31b268[_0x1518('0x3f')]);_0x4e8b42(_0x31b268);});}else{_0x4e8b42(new Error(_0x1518('0x40')));}},'afterDestroy':function(_0x3054f4,_0x4e4833,_0x4d57e4){var _0x111087=_0x53ece0[_0x1518('0x41')];var _0x14dc8c=_0x3054f4[_0x1518('0x39')]({'plain':!![]});return _0x111087[_0x1518('0x24')][_0x1518('0x3a')]({'raw':!![],'where':{'ListId':_0x14dc8c[_0x1518('0x2d')],'ContactId':_0x14dc8c['id']}})[_0x1518('0x1e')](function(_0x58445e){if(!_['isEmpty'](_0x58445e)){var _0x16c397=[];for(var _0x339f89=0x0;_0x339f89<_0x58445e[_0x1518('0x38')];_0x339f89+=0x1){var _0x264280=_0x111087[_0x1518('0x24')][_0x1518('0x42')]({'where':{'ListId':_0x58445e[_0x339f89][_0x1518('0x2d')],'ContactId':_0x58445e[_0x339f89][_0x1518('0x43')],'VoiceQueueId':_0x58445e[_0x339f89][_0x1518('0x44')],'CampaignId':_0x58445e[_0x339f89]['CampaignId']}});_0x16c397[_0x1518('0x45')](_0x264280);}return BPromise[_0x1518('0x46')](_0x16c397);}})[_0x1518('0x1e')](function(_0x199b4b){logger['info'](_0x1518('0x47'),util['inspect'](_0x199b4b,{'showHidden':![],'depth':null}));_0x4d57e4();})[_0x1518('0x2a')](function(_0x432101){logger[_0x1518('0x15')](_0x1518('0x48'),util[_0x1518('0x18')](_0x432101,{'showHidden':![],'depth':null}));_0x4d57e4(_0x432101);});}}});}; \ No newline at end of file +var _0x8b32=['minutes','ret','CmHopper','findOne','cmContact,\x20afterCreate\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','create','callbackUniqueid','catch','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','cmContact,\x20afterCreate,\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20VoiceQueue\x20','ListId','priority','error','Campaign','timezones','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20Campaign\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20Campaign\x20','CmHopperFinal','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20Campaign\x20','outbound','CmList','length','get','onlyIfOpen','BlackLists','message','findAll','dialCheckDuplicateType','Lists','CmHopperBlack','cmContact,\x20%s,\x20%s','isEmpty','destroy','VoiceQueueId','CampaignId','push','all','[CmContact][afterDestroy][Succesfull]','[CmContact][afterDestroy][Error]','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','../../config/environment/shared','./cmContact.attributes','define','CmContact','cm_contacts','phone','fti_cm_contacts','firstName','lastName','mobile','fax','FULLTEXT','utf8mb4','utf8mb4_unicode_ci','models','cmContact','afterCreate','inspect','scheduledat','format','YYYY-MM-DD\x20HH:mm:ss','isNil','dialTimezone','VoiceQueue','then','utcOffset','add'];(function(_0x4d8b14,_0x3ba6dc){var _0x55f941=function(_0x3cb0d0){while(--_0x3cb0d0){_0x4d8b14['push'](_0x4d8b14['shift']());}};_0x55f941(++_0x3ba6dc);}(_0x8b32,0x1aa));var _0x28b3=function(_0x273c8e,_0x591de0){_0x273c8e=_0x273c8e-0x0;var _0x4cea1e=_0x8b32[_0x273c8e];return _0x4cea1e;};'use strict';var _=require(_0x28b3('0x0'));var util=require(_0x28b3('0x1'));var logger=require(_0x28b3('0x2'))(_0x28b3('0x3'));var moment=require(_0x28b3('0x4'));var BPromise=require('bluebird');var rp=require(_0x28b3('0x5'));var fs=require('fs');var path=require(_0x28b3('0x6'));var rimraf=require(_0x28b3('0x7'));var config=require(_0x28b3('0x8'));var shared=require(_0x28b3('0x9'));var attributes=require(_0x28b3('0xa'));module['exports']=function(_0x1cfc09,_0x5a3554){return _0x1cfc09[_0x28b3('0xb')](_0x28b3('0xc'),attributes,{'tableName':_0x28b3('0xd'),'paranoid':!![],'indexes':[{'name':_0x28b3('0xe'),'fields':[_0x28b3('0xe')]},{'name':_0x28b3('0xf'),'fields':[_0x28b3('0x10'),_0x28b3('0x11'),_0x28b3('0xe'),_0x28b3('0x12'),_0x28b3('0x13'),'email'],'type':_0x28b3('0x14')}],'timestamps':!![],'charset':_0x28b3('0x15'),'collate':_0x28b3('0x16'),'hooks':{'afterCreate':function(_0x288806,_0x402268,_0x2631b7){var _0x597ecd=_0x1cfc09[_0x28b3('0x17')];var _0x4cf973=_0x288806['get']({'plain':!![]});function _0x41315e(){return function(_0x549c10){logger['error'](_0x28b3('0x18'),_0x28b3('0x19'),util[_0x28b3('0x1a')](_0x549c10,{'showHidden':![],'depth':null}));};}function _0xbcbf2c(_0x38d216,_0x4cd2f1){var _0x37dfce=_0x4cd2f1[_0x28b3('0x1b')]?_0x4cd2f1[_0x28b3('0x1b')]:moment()[_0x28b3('0x1c')](_0x28b3('0x1d'));return new BPromise(function(_0x14d2f9,_0x95a039){if(_[_0x28b3('0x1e')](_0x4cd2f1[_0x28b3('0x1f')])){_0x14d2f9({'ret':_0x37dfce});}else{_0x597ecd[_0x28b3('0x20')]['findOne']({'where':{'id':_0x38d216['id']}})[_0x28b3('0x21')](function(_0x319cec){if(!_[_0x28b3('0x1e')](_0x319cec)){var _0x32a19a=_0x319cec['dialTimezone'];if(!_['isNil'](_0x32a19a)){var _0x199d5d=shared['timezones'];var _0x4d5cb4=_0x199d5d[_0x32a19a];var _0x3eff3c=_0x199d5d[_0x4cd2f1[_0x28b3('0x1f')]];if(!_[_0x28b3('0x1e')](_0x4d5cb4)&&!_[_0x28b3('0x1e')](_0x3eff3c)){var _0x3e4922=_0x4d5cb4['utcOffset']-_0x3eff3c[_0x28b3('0x22')];_0x37dfce=_0x4cd2f1[_0x28b3('0x1b')]?_0x4cd2f1[_0x28b3('0x1b')]:moment();var _0x4b64b1=moment(_0x37dfce)[_0x28b3('0x23')](_0x3e4922,_0x28b3('0x24'));_0x14d2f9({'ret':_0x4b64b1[_0x28b3('0x1c')](_0x28b3('0x1d'))});}else _0x14d2f9({'ret':_0x37dfce});}else _0x14d2f9({'ret':_0x37dfce});}else{_0x14d2f9({'ret':_0x37dfce});}});}});return 0xa;}var _0x45cb5c=function(_0x483183){return new BPromise(function(_0x2336d8,_0x5178f5){_0xbcbf2c(_0x483183,_0x4cf973)[_0x28b3('0x21')](function(_0x16519a){_0x4cf973[_0x28b3('0x1b')]=_0x16519a[_0x28b3('0x25')];_0x597ecd[_0x28b3('0x26')][_0x28b3('0x27')]({'where':{'phone':_0x4cf973[_0x28b3('0xe')],'VoiceQueueId':_0x483183['id']}})['then'](function(_0x4ded61){if(!_[_0x28b3('0x1e')](_0x4ded61)){throw new Error(_0x28b3('0x28')+_0x4cf973[_0x28b3('0xe')]+_0x28b3('0x29')+_0x483183['id']);}return _0x597ecd[_0x28b3('0x26')][_0x28b3('0x2a')]({'phone':_0x4cf973[_0x28b3('0xe')],'ContactId':_0x4cf973['id'],'ListId':_0x4cf973['ListId'],'priority':_0x4cf973['priority']?_0x4cf973['priority']:0x2,'scheduledat':_0x4cf973[_0x28b3('0x1b')]?_0x4cf973[_0x28b3('0x1b')]:moment()[_0x28b3('0x1c')](_0x28b3('0x1d')),'callback':_0x4cf973['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x4cf973[_0x28b3('0x2b')]?_0x4cf973[_0x28b3('0x2b')]:undefined,'callbackat':_0x4cf973[_0x28b3('0x2b')]?moment()[_0x28b3('0x1c')](_0x28b3('0x1d')):undefined,'VoiceQueueId':_0x483183['id']});})[_0x28b3('0x2c')](function(_0x25aeb0){_0x5178f5(_0x25aeb0);});});});};var _0x4064f7=function(_0x1a05c5){return new BPromise(function(_0x2e1743,_0x4f6f5d){_0xbcbf2c(_0x1a05c5,_0x4cf973)[_0x28b3('0x21')](function(_0x5656de){_0x4cf973['scheduledat']=_0x5656de['ret'];_0x597ecd[_0x28b3('0x26')][_0x28b3('0x27')]({'where':{'phone':_0x4cf973[_0x28b3('0xe')],'VoiceQueueId':_0x1a05c5['id']}})[_0x28b3('0x21')](function(_0x5a2fef){if(!_['isNil'](_0x5a2fef)){throw new Error(_0x28b3('0x28')+_0x4cf973[_0x28b3('0xe')]+_0x28b3('0x2d')+_0x1a05c5['id']);}return _0x597ecd['CmHopperFinal']['findOne']({'where':{'calleridnum':_0x4cf973[_0x28b3('0xe')],'VoiceQueueId':_0x1a05c5['id']}});})[_0x28b3('0x21')](function(_0x4ff89f){if(!_[_0x28b3('0x1e')](_0x4ff89f)){throw new Error(_0x28b3('0x2e')+_0x4cf973['phone']+_0x28b3('0x2f')+_0x1a05c5['id']);}return _0x597ecd[_0x28b3('0x26')]['create']({'phone':_0x4cf973[_0x28b3('0xe')],'ContactId':_0x4cf973['id'],'ListId':_0x4cf973[_0x28b3('0x30')],'priority':_0x4cf973['priority']?_0x4cf973[_0x28b3('0x31')]:0x2,'scheduledat':_0x4cf973[_0x28b3('0x1b')]?_0x4cf973[_0x28b3('0x1b')]:moment()['format'](_0x28b3('0x1d')),'callback':_0x4cf973[_0x28b3('0x2b')]?!![]:![],'callbackuniqueid':_0x4cf973[_0x28b3('0x2b')]?_0x4cf973['callbackUniqueid']:undefined,'callbackat':_0x4cf973['callbackUniqueid']?moment()[_0x28b3('0x1c')]('YYYY-MM-DD\x20HH:mm:ss'):undefined,'VoiceQueueId':_0x1a05c5['id']});})[_0x28b3('0x2c')](function(_0x39ec8d){_0x4f6f5d(_0x39ec8d);});});});};function _0xd34c1a(){return function(_0x4ddd41){logger[_0x28b3('0x32')](_0x28b3('0x18'),_0x28b3('0x19'),util[_0x28b3('0x1a')](_0x4ddd41,{'showHidden':![],'depth':null}));};}function _0x4b6b0f(_0x5d6a3f,_0x4788ee){var _0x1d5f55=_0x4788ee['scheduledat']?_0x4788ee[_0x28b3('0x1b')]:moment()[_0x28b3('0x1c')](_0x28b3('0x1d'));return new BPromise(function(_0x3d9553,_0x441f83){if(_['isNil'](_0x4788ee[_0x28b3('0x1f')])){_0x3d9553({'ret':_0x1d5f55});}else{_0x597ecd[_0x28b3('0x33')][_0x28b3('0x27')]({'where':{'id':_0x5d6a3f['id']}})[_0x28b3('0x21')](function(_0x441c88){if(!_['isNil'](_0x441c88)){var _0x77dfa1=_0x441c88[_0x28b3('0x1f')];if(!_[_0x28b3('0x1e')](_0x77dfa1)){var _0x19fc79=shared[_0x28b3('0x34')];var _0x1ad356=_0x19fc79[_0x77dfa1];var _0x195982=_0x19fc79[_0x4788ee[_0x28b3('0x1f')]];if(!_[_0x28b3('0x1e')](_0x1ad356)&&!_[_0x28b3('0x1e')](_0x195982)){var _0xc1f952=_0x1ad356['utcOffset']-_0x195982['utcOffset'];_0x1d5f55=_0x4788ee[_0x28b3('0x1b')]?_0x4788ee[_0x28b3('0x1b')]:moment();var _0x4d0e17=moment(_0x1d5f55)[_0x28b3('0x23')](_0xc1f952,_0x28b3('0x24'));_0x3d9553({'ret':_0x4d0e17['format'](_0x28b3('0x1d'))});}else _0x3d9553({'ret':_0x1d5f55});}else _0x3d9553({'ret':_0x1d5f55});}else{_0x3d9553({'ret':_0x1d5f55});}});}});return 0xa;}var _0x2fba7d=function(_0x41695f){return new BPromise(function(_0xba575,_0x1b419a){_0x4b6b0f(_0x41695f,_0x4cf973)[_0x28b3('0x21')](function(_0x2c807e){_0x4cf973[_0x28b3('0x1b')]=_0x2c807e[_0x28b3('0x25')];_0x597ecd[_0x28b3('0x26')][_0x28b3('0x27')]({'where':{'phone':_0x4cf973['phone'],'CampaignId':_0x41695f['id']}})[_0x28b3('0x21')](function(_0x1c2996){if(!_[_0x28b3('0x1e')](_0x1c2996)){throw new Error(_0x28b3('0x28')+_0x4cf973[_0x28b3('0xe')]+_0x28b3('0x35')+_0x41695f['id']);}return _0x597ecd[_0x28b3('0x26')][_0x28b3('0x2a')]({'phone':_0x4cf973['phone'],'ContactId':_0x4cf973['id'],'ListId':_0x4cf973[_0x28b3('0x30')],'priority':_0x4cf973[_0x28b3('0x31')]?_0x4cf973[_0x28b3('0x31')]:0x2,'scheduledat':_0x4cf973['scheduledat']?_0x4cf973['scheduledat']:moment()[_0x28b3('0x1c')](_0x28b3('0x1d')),'callback':_0x4cf973['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x4cf973['callbackUniqueid']?_0x4cf973['callbackUniqueid']:undefined,'callbackat':_0x4cf973[_0x28b3('0x2b')]?moment()[_0x28b3('0x1c')](_0x28b3('0x1d')):undefined,'CampaignId':_0x41695f['id']});})[_0x28b3('0x2c')](function(_0x524944){_0x1b419a(_0x524944);});});});};var _0x24de2d=function(_0x36424a){return new BPromise(function(_0x153e3f,_0x149c6e){_0x4b6b0f(_0x36424a,_0x4cf973)[_0x28b3('0x21')](function(_0x29cd96){_0x4cf973[_0x28b3('0x1b')]=_0x29cd96[_0x28b3('0x25')];_0x597ecd['CmHopper'][_0x28b3('0x27')]({'where':{'phone':_0x4cf973[_0x28b3('0xe')],'CampaignId':_0x36424a['id']}})['then'](function(_0x522c2c){if(!_[_0x28b3('0x1e')](_0x522c2c)){throw new Error('cmContact,\x20afterCreate\x20'+_0x4cf973[_0x28b3('0xe')]+_0x28b3('0x36')+_0x36424a['id']);}return _0x597ecd[_0x28b3('0x37')]['findOne']({'where':{'calleridnum':_0x4cf973[_0x28b3('0xe')],'CampaignId':_0x36424a['id']}});})['then'](function(_0x5497f4){if(!_[_0x28b3('0x1e')](_0x5497f4)){throw new Error(_0x28b3('0x2e')+_0x4cf973[_0x28b3('0xe')]+_0x28b3('0x38')+_0x36424a['id']);}return _0x597ecd[_0x28b3('0x26')][_0x28b3('0x2a')]({'phone':_0x4cf973[_0x28b3('0xe')],'ContactId':_0x4cf973['id'],'ListId':_0x4cf973[_0x28b3('0x30')],'priority':_0x4cf973[_0x28b3('0x31')]?_0x4cf973[_0x28b3('0x31')]:0x2,'scheduledat':_0x4cf973['scheduledat']?_0x4cf973[_0x28b3('0x1b')]:moment()[_0x28b3('0x1c')](_0x28b3('0x1d')),'callback':_0x4cf973[_0x28b3('0x2b')]?!![]:![],'callbackuniqueid':_0x4cf973['callbackUniqueid']?_0x4cf973[_0x28b3('0x2b')]:undefined,'callbackat':_0x4cf973[_0x28b3('0x2b')]?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined,'CampaignId':_0x36424a['id']});})[_0x28b3('0x2c')](function(_0xc3ad8d){_0x149c6e(_0xc3ad8d);});});});};if(_0x4cf973[_0x28b3('0x30')]){_0x597ecd[_0x28b3('0x20')]['findAll']({'where':{'type':_0x28b3('0x39')},'attributes':['id','dialCheckDuplicateType',_0x28b3('0x1f')],'include':[{'model':_0x597ecd[_0x28b3('0x3a')],'as':'Lists','where':{'id':_0x4cf973[_0x28b3('0x30')]}}]})[_0x28b3('0x21')](function(_0x467c74){if(_0x467c74){var _0x159843=[];for(var _0x13bbb6=0x0,_0x45d518;_0x13bbb6<_0x467c74[_0x28b3('0x3b')];_0x13bbb6+=0x1){_0x45d518=_0x467c74[_0x13bbb6][_0x28b3('0x3c')]({'plain':!![]});switch(_0x45d518['dialCheckDuplicateType']){case'always':_0x4064f7(_0x45d518)['catch'](_0x41315e());break;case _0x28b3('0x3d'):_0x45cb5c(_0x45d518)[_0x28b3('0x2c')](_0x41315e());break;default:_0x4b6b0f(_0x45d518,_0x4cf973)['then'](function(_0x9b076f){_0x4cf973[_0x28b3('0x1b')]=_0x9b076f[_0x28b3('0x25')];_0x597ecd['CmHopper'][_0x28b3('0x2a')]({'phone':_0x4cf973[_0x28b3('0xe')],'ContactId':_0x4cf973['id'],'ListId':_0x4cf973[_0x28b3('0x30')],'scheduledat':_0x4cf973[_0x28b3('0x1b')]?_0x4cf973[_0x28b3('0x1b')]:moment()['format'](_0x28b3('0x1d')),'priority':_0x4cf973[_0x28b3('0x31')]?_0x4cf973[_0x28b3('0x31')]:0x2,'callback':_0x4cf973[_0x28b3('0x2b')]?!![]:![],'callbackuniqueid':_0x4cf973[_0x28b3('0x2b')]?_0x4cf973[_0x28b3('0x2b')]:undefined,'callbackat':_0x4cf973[_0x28b3('0x2b')]?moment()[_0x28b3('0x1c')](_0x28b3('0x1d')):undefined,'VoiceQueueId':_0x45d518['id']})[_0x28b3('0x2c')](_0x41315e());});}}}})['then'](function(){return _0x597ecd[_0x28b3('0x20')]['findAll']({'where':{'type':'outbound'},'attributes':['id'],'include':[{'model':_0x597ecd[_0x28b3('0x3a')],'as':_0x28b3('0x3e'),'where':{'id':_0x4cf973[_0x28b3('0x30')]}}]})['then'](function(_0x5f4258){if(_0x5f4258){var _0x39b331=[];for(var _0x411958=0x0,_0x16f2b6;_0x411958<_0x5f4258[_0x28b3('0x3b')];_0x411958+=0x1){_0x16f2b6=_0x5f4258[_0x411958][_0x28b3('0x3c')]({'plain':!![]});_0x597ecd['CmHopperBlack']['create']({'phone':_0x4cf973[_0x28b3('0xe')],'ContactId':_0x4cf973['id'],'ListId':_0x4cf973['ListId'],'VoiceQueueId':_0x16f2b6['id']})[_0x28b3('0x2c')](function(_0x57ed40){logger[_0x28b3('0x32')]('cmContact,\x20%s,\x20%s',_0x28b3('0x19'),_0x57ed40[_0x28b3('0x3f')]);});}}});})[_0x28b3('0x21')](function(){return _0x597ecd[_0x28b3('0x33')][_0x28b3('0x40')]({'attributes':['id',_0x28b3('0x41'),_0x28b3('0x1f')],'include':[{'model':_0x597ecd['CmList'],'as':_0x28b3('0x42'),'where':{'id':_0x4cf973['ListId']}}]})[_0x28b3('0x21')](function(_0x4ee6e8){if(_0x4ee6e8){var _0x30fbf6=[];for(var _0x1100be=0x0,_0x29d9cb;_0x1100be<_0x4ee6e8[_0x28b3('0x3b')];_0x1100be+=0x1){_0x29d9cb=_0x4ee6e8[_0x1100be][_0x28b3('0x3c')]({'plain':!![]});switch(_0x29d9cb[_0x28b3('0x41')]){case'always':_0x24de2d(_0x29d9cb)[_0x28b3('0x2c')](_0xd34c1a());break;case _0x28b3('0x3d'):_0x2fba7d(_0x29d9cb)[_0x28b3('0x2c')](_0xd34c1a());break;default:_0x597ecd[_0x28b3('0x26')][_0x28b3('0x2a')]({'phone':_0x4cf973[_0x28b3('0xe')],'ContactId':_0x4cf973['id'],'ListId':_0x4cf973[_0x28b3('0x30')],'scheduledat':_0x4cf973[_0x28b3('0x1b')]?_0x4cf973[_0x28b3('0x1b')]:moment()[_0x28b3('0x1c')]('YYYY-MM-DD\x20HH:mm:ss'),'priority':_0x4cf973['priority']?_0x4cf973[_0x28b3('0x31')]:0x2,'callback':_0x4cf973['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x4cf973[_0x28b3('0x2b')]?_0x4cf973[_0x28b3('0x2b')]:undefined,'callbackat':_0x4cf973[_0x28b3('0x2b')]?moment()[_0x28b3('0x1c')](_0x28b3('0x1d')):undefined,'CampaignId':_0x29d9cb['id']})[_0x28b3('0x2c')](_0xd34c1a());}}}});})[_0x28b3('0x21')](function(){return _0x597ecd[_0x28b3('0x33')][_0x28b3('0x40')]({'attributes':['id'],'include':[{'model':_0x597ecd[_0x28b3('0x3a')],'as':_0x28b3('0x3e'),'where':{'id':_0x4cf973[_0x28b3('0x30')]}}]})[_0x28b3('0x21')](function(_0x47b844){if(_0x47b844){var _0x5be636=[];for(var _0x4940cf=0x0,_0xe9ae46;_0x4940cf<_0x47b844[_0x28b3('0x3b')];_0x4940cf+=0x1){_0xe9ae46=_0x47b844[_0x4940cf]['get']({'plain':!![]});_0x597ecd[_0x28b3('0x43')][_0x28b3('0x2a')]({'phone':_0x4cf973[_0x28b3('0xe')],'ContactId':_0x4cf973['id'],'ListId':_0x4cf973[_0x28b3('0x30')],'CampaignId':_0xe9ae46['id']})['catch'](function(_0x6200dd){logger[_0x28b3('0x32')](_0x28b3('0x44'),_0x28b3('0x19'),_0x6200dd[_0x28b3('0x3f')]);});}}});})[_0x28b3('0x21')](function(){_0x2631b7();})['catch'](function(_0x5e9a7d){logger[_0x28b3('0x32')](_0x28b3('0x44'),'afterCreate',_0x5e9a7d[_0x28b3('0x3f')]);_0x2631b7(_0x5e9a7d);});}else{_0x2631b7(new Error('List\x20not\x20found'));}},'afterDestroy':function(_0xe02c94,_0x33dd1b,_0x214675){var _0x425b84=_0x1cfc09[_0x28b3('0x17')];var _0x5b79b1=_0xe02c94[_0x28b3('0x3c')]({'plain':!![]});return _0x425b84[_0x28b3('0x26')][_0x28b3('0x40')]({'raw':!![],'where':{'ListId':_0x5b79b1['ListId'],'ContactId':_0x5b79b1['id']}})[_0x28b3('0x21')](function(_0x2471a7){if(!_[_0x28b3('0x45')](_0x2471a7)){var _0x256519=[];for(var _0x195bc9=0x0;_0x195bc9<_0x2471a7[_0x28b3('0x3b')];_0x195bc9+=0x1){var _0x4106b0=_0x425b84[_0x28b3('0x26')][_0x28b3('0x46')]({'where':{'ListId':_0x2471a7[_0x195bc9][_0x28b3('0x30')],'ContactId':_0x2471a7[_0x195bc9]['ContactId'],'VoiceQueueId':_0x2471a7[_0x195bc9][_0x28b3('0x47')],'CampaignId':_0x2471a7[_0x195bc9][_0x28b3('0x48')]}});_0x256519[_0x28b3('0x49')](_0x4106b0);}return BPromise[_0x28b3('0x4a')](_0x256519);}})[_0x28b3('0x21')](function(_0x4daa4d){logger['info'](_0x28b3('0x4b'),util[_0x28b3('0x1a')](_0x4daa4d,{'showHidden':![],'depth':null}));_0x214675();})['catch'](function(_0x42b105){logger['error'](_0x28b3('0x4c'),util[_0x28b3('0x1a')](_0x42b105,{'showHidden':![],'depth':null}));_0x214675(_0x42b105);});}}});}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.rpc.js b/server/api/cmContact/cmContact.rpc.js index 761f7b6..dc901ed 100644 --- a/server/api/cmContact/cmContact.rpc.js +++ b/server/api/cmContact/cmContact.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['phone','ListId','Contact','CmContactId','create','body','keys','length','startsWith','update','table','cm_contacts','id\x20=\x20?','sequelize','query','CreateCmContact','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','localhost','./cmContact.socket','register','info','CmContact,\x20%s,\x20%s','request\x20sent','debug','CmContact,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetCmContact','CmContact','findAll','options','where','limit','include','map','model','attributes','then','stringify','CmContactHasItem','find'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2b10c6,_0x185590){_0x2b10c6=_0x2b10c6-0x0;var _0x3789d2=_0xa9e0[_0x2b10c6];return _0x3789d2;};'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(_0x4e3ae4,_0x765a9f){var _0x4238b9=function(_0x3706f2){while(--_0x3706f2){_0x4e3ae4['push'](_0x4e3ae4['shift']());}};_0x4238b9(++_0x765a9f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47e7cb,_0x4c1b8d){_0x47e7cb=_0x47e7cb-0x0;var _0x2a8874=_0xa9e0[_0x47e7cb];return _0x2a8874;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['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 a65eae3..df971e6 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 _0x7a59=['INTEGER','PHONE','sequelize','STRING'];(function(_0x485b5a,_0x2b289b){var _0xd2b34d=function(_0x34dcbd){while(--_0x34dcbd){_0x485b5a['push'](_0x485b5a['shift']());}};_0xd2b34d(++_0x2b289b);}(_0x7a59,0x16e));var _0x97a5=function(_0x17406a,_0x1e2320){_0x17406a=_0x17406a-0x0;var _0x1501ff=_0x7a59[_0x17406a];return _0x1501ff;};'use strict';var Sequelize=require(_0x97a5('0x0'));module['exports']={'CmContactId':{'type':Sequelize['INTEGER'],'primaryKey':!![]},'item':{'type':Sequelize[_0x97a5('0x1')],'defaultValue':'','primaryKey':!![]},'ItemTypeId':{'type':Sequelize[_0x97a5('0x2')],'defaultValue':null},'ItemClass':{'type':Sequelize[_0x97a5('0x1')],'defaultValue':_0x97a5('0x3')},'OrderBy':{'type':Sequelize[_0x97a5('0x2')],'defaultValue':null},'description':{'type':Sequelize['STRING'],'defaultValue':null}}; \ No newline at end of file +var _0x0531=['INTEGER','STRING','sequelize','exports'];(function(_0x598a8a,_0x4687af){var _0xb6e8fd=function(_0x1fbdd2){while(--_0x1fbdd2){_0x598a8a['push'](_0x598a8a['shift']());}};_0xb6e8fd(++_0x4687af);}(_0x0531,0xde));var _0x1053=function(_0x2c1e7a,_0x155f86){_0x2c1e7a=_0x2c1e7a-0x0;var _0xcacb4f=_0x0531[_0x2c1e7a];return _0xcacb4f;};'use strict';var Sequelize=require(_0x1053('0x0'));module[_0x1053('0x1')]={'CmContactId':{'type':Sequelize['INTEGER'],'primaryKey':!![]},'item':{'type':Sequelize['STRING'],'defaultValue':'','primaryKey':!![]},'ItemTypeId':{'type':Sequelize[_0x1053('0x2')],'defaultValue':null},'ItemClass':{'type':Sequelize['STRING'],'defaultValue':'PHONE'},'OrderBy':{'type':Sequelize[_0x1053('0x2')],'defaultValue':null},'description':{'type':Sequelize[_0x1053('0x3')],'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 4a59954..389a2ed 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 _0x83c1=['map','CmContactHasItem','fieldName','type','key','query','keys','filters','model','attributes','fields','length','hasOwnProperty','where','filter','merge','includeAll','include','findAll','catch','params','rawAttributes','intersection','options','find','create','body','role','user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','reject','destroy','then','get','CmContactHasItems','UserProfileResource','error','stack','name','send'];(function(_0x1adb96,_0x5c8a81){var _0x13ab64=function(_0x4d031a){while(--_0x4d031a){_0x1adb96['push'](_0x1adb96['shift']());}};_0x13ab64(++_0x5c8a81);}(_0x83c1,0x73));var _0x183c=function(_0x244bc4,_0x2b463d){_0x244bc4=_0x244bc4-0x0;var _0x33a9a6=_0x83c1[_0x244bc4];return _0x33a9a6;};'use strict';var emlformat=require(_0x183c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x183c('0x1'));var jsonpatch=require(_0x183c('0x2'));var rp=require(_0x183c('0x3'));var moment=require(_0x183c('0x4'));var BPromise=require(_0x183c('0x5'));var Mustache=require('mustache');var util=require(_0x183c('0x6'));var path=require(_0x183c('0x7'));var sox=require(_0x183c('0x8'));var csv=require(_0x183c('0x9'));var ejs=require(_0x183c('0xa'));var fs=require('fs');var fs_extra=require(_0x183c('0xb'));var _=require(_0x183c('0xc'));var squel=require(_0x183c('0xd'));var crypto=require(_0x183c('0xe'));var jsforce=require(_0x183c('0xf'));var deskjs=require(_0x183c('0x10'));var toCsv=require('to-csv');var querystring=require(_0x183c('0x11'));var Papa=require(_0x183c('0x12'));var Redis=require(_0x183c('0x13'));var authService=require(_0x183c('0x14'));var qs=require(_0x183c('0x15'));var as=require(_0x183c('0x16'));var hardwareService=require(_0x183c('0x17'));var logger=require('../../config/logger')(_0x183c('0x18'));var utils=require(_0x183c('0x19'));var config=require(_0x183c('0x1a'));var licenseUtil=require(_0x183c('0x1b'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x257306,_0x536102){_0x536102=_0x536102||0xcc;return function(_0x1aebc8){if(_0x1aebc8){return _0x257306[_0x183c('0x1c')](_0x536102);}return _0x257306[_0x183c('0x1d')](_0x536102)[_0x183c('0x1e')]();};}function respondWithResult(_0x1ca69a,_0xb1d1ac){_0xb1d1ac=_0xb1d1ac||0xc8;return function(_0x71ddd6){if(_0x71ddd6){return _0x1ca69a[_0x183c('0x1d')](_0xb1d1ac)[_0x183c('0x1f')](_0x71ddd6);}};}function respondWithFilteredResult(_0x9a69b5,_0x997f8d){return function(_0x2a364f){if(_0x2a364f){var _0x18d1f4=typeof _0x997f8d['offset']===_0x183c('0x20')&&typeof _0x997f8d['limit']==='undefined';var _0x4b37ee=_0x2a364f[_0x183c('0x21')];var _0x55446e=_0x18d1f4?0x0:_0x997f8d[_0x183c('0x22')];var _0x1a3f0d=_0x18d1f4?_0x2a364f[_0x183c('0x21')]:_0x997f8d[_0x183c('0x22')]+_0x997f8d[_0x183c('0x23')];var _0x4d310c;if(_0x1a3f0d>=_0x4b37ee){_0x1a3f0d=_0x4b37ee;_0x4d310c=0xc8;}else{_0x4d310c=0xce;}_0x9a69b5[_0x183c('0x1d')](_0x4d310c);return _0x9a69b5[_0x183c('0x24')](_0x183c('0x25'),_0x55446e+'-'+_0x1a3f0d+'/'+_0x4b37ee)[_0x183c('0x1f')](_0x2a364f);}return null;};}function patchUpdates(_0x50543b){return function(_0x4cb2ae){try{jsonpatch[_0x183c('0x26')](_0x4cb2ae,_0x50543b,!![]);}catch(_0x30c816){return BPromise[_0x183c('0x27')](_0x30c816);}return _0x4cb2ae['save']();};}function saveUpdates(_0x23944f,_0x9f25b7){return function(_0x4742dc){if(_0x4742dc){return _0x4742dc['update'](_0x23944f)['then'](function(_0x536f37){return _0x536f37;});}return null;};}function removeEntity(_0x27f395,_0x390869){return function(_0x421f29){if(_0x421f29){return _0x421f29[_0x183c('0x28')]()[_0x183c('0x29')](function(){var _0x469638=_0x421f29[_0x183c('0x2a')]({'plain':!![]});var _0x5ddafb=_0x183c('0x2b');return db[_0x183c('0x2c')][_0x183c('0x28')]({'where':{'type':_0x5ddafb,'resourceId':_0x469638['id']}})[_0x183c('0x29')](function(){return _0x421f29;});})[_0x183c('0x29')](function(){_0x27f395['status'](0xcc)[_0x183c('0x1e')]();});}};}function handleEntityNotFound(_0x70f124,_0x330884){return function(_0xee11a0){if(!_0xee11a0){_0x70f124[_0x183c('0x1c')](0x194);}return _0xee11a0;};}function handleError(_0xee96a5,_0x45a63e){_0x45a63e=_0x45a63e||0x1f4;return function(_0x3d6278){logger[_0x183c('0x2d')](_0x3d6278[_0x183c('0x2e')]);if(_0x3d6278[_0x183c('0x2f')]){delete _0x3d6278[_0x183c('0x2f')];}_0xee96a5[_0x183c('0x1d')](_0x45a63e)[_0x183c('0x30')](_0x3d6278);};}exports['index']=function(_0x13a39f,_0x2d8f86){var _0x516b6e={},_0x51c4b6={},_0x1991a5={'count':0x0,'rows':[]};var _0x111300=_[_0x183c('0x31')](db[_0x183c('0x32')]['rawAttributes'],function(_0x477ae1){return{'name':_0x477ae1[_0x183c('0x33')],'type':_0x477ae1[_0x183c('0x34')][_0x183c('0x35')]};});_0x51c4b6['model']=_['map'](_0x111300,_0x183c('0x2f'));_0x51c4b6[_0x183c('0x36')]=_[_0x183c('0x37')](_0x13a39f['query']);_0x51c4b6[_0x183c('0x38')]=_['intersection'](_0x51c4b6[_0x183c('0x39')],_0x51c4b6[_0x183c('0x36')]);_0x516b6e[_0x183c('0x3a')]=_['intersection'](_0x51c4b6[_0x183c('0x39')],qs['fields'](_0x13a39f[_0x183c('0x36')][_0x183c('0x3b')]));_0x516b6e[_0x183c('0x3a')]=_0x516b6e[_0x183c('0x3a')][_0x183c('0x3c')]?_0x516b6e[_0x183c('0x3a')]:_0x51c4b6[_0x183c('0x39')];if(!_0x13a39f['query'][_0x183c('0x3d')]('nolimit')){_0x516b6e['limit']=qs[_0x183c('0x23')](_0x13a39f[_0x183c('0x36')][_0x183c('0x23')]);_0x516b6e[_0x183c('0x22')]=qs['offset'](_0x13a39f[_0x183c('0x36')][_0x183c('0x22')]);}_0x516b6e['order']=qs['sort'](_0x13a39f[_0x183c('0x36')]['sort']);_0x516b6e[_0x183c('0x3e')]=qs[_0x183c('0x38')](_['pick'](_0x13a39f[_0x183c('0x36')],_0x51c4b6[_0x183c('0x38')]),_0x111300);if(_0x13a39f[_0x183c('0x36')][_0x183c('0x3f')]){_0x516b6e['where']=_[_0x183c('0x40')](_0x516b6e[_0x183c('0x3e')],{'$or':_[_0x183c('0x31')](_0x111300,function(_0xa8d38d){if(_0xa8d38d[_0x183c('0x34')]!=='VIRTUAL'){var _0x469121={};_0x469121[_0xa8d38d[_0x183c('0x2f')]]={'$like':'%'+_0x13a39f[_0x183c('0x36')][_0x183c('0x3f')]+'%'};return _0x469121;}})});}_0x516b6e=_[_0x183c('0x40')]({},_0x516b6e,_0x13a39f['options']);var _0x56c67b={'where':_0x516b6e[_0x183c('0x3e')]};return db[_0x183c('0x32')]['count'](_0x56c67b)[_0x183c('0x29')](function(_0x28df12){_0x1991a5[_0x183c('0x21')]=_0x28df12;if(_0x13a39f[_0x183c('0x36')][_0x183c('0x41')]){_0x516b6e[_0x183c('0x42')]=[{'all':!![]}];}return db[_0x183c('0x32')][_0x183c('0x43')](_0x516b6e);})['then'](function(_0x439537){_0x1991a5['rows']=_0x439537;return _0x1991a5;})['then'](respondWithFilteredResult(_0x2d8f86,_0x516b6e))[_0x183c('0x44')](handleError(_0x2d8f86,null));};exports['show']=function(_0x49850b,_0x4ad9b0){var _0x5c6fe5={'raw':!![],'where':{'id':_0x49850b[_0x183c('0x45')]['id']}},_0x2cf0cb={};_0x2cf0cb['model']=_[_0x183c('0x37')](db[_0x183c('0x32')][_0x183c('0x46')]);_0x2cf0cb[_0x183c('0x36')]=_[_0x183c('0x37')](_0x49850b['query']);_0x2cf0cb[_0x183c('0x38')]=_[_0x183c('0x47')](_0x2cf0cb['model'],_0x2cf0cb[_0x183c('0x36')]);_0x5c6fe5['attributes']=_[_0x183c('0x47')](_0x2cf0cb[_0x183c('0x39')],qs['fields'](_0x49850b['query']['fields']));_0x5c6fe5[_0x183c('0x3a')]=_0x5c6fe5['attributes'][_0x183c('0x3c')]?_0x5c6fe5[_0x183c('0x3a')]:_0x2cf0cb[_0x183c('0x39')];if(_0x49850b[_0x183c('0x36')][_0x183c('0x41')]){_0x5c6fe5[_0x183c('0x42')]=[{'all':!![]}];}_0x5c6fe5=_[_0x183c('0x40')]({},_0x5c6fe5,_0x49850b[_0x183c('0x48')]);return db['CmContactHasItem'][_0x183c('0x49')](_0x5c6fe5)['then'](handleEntityNotFound(_0x4ad9b0,null))['then'](respondWithResult(_0x4ad9b0,null))['catch'](handleError(_0x4ad9b0,null));};exports[_0x183c('0x4a')]=function(_0xc18286,_0x54090d){return db[_0x183c('0x32')][_0x183c('0x4a')](_0xc18286[_0x183c('0x4b')],{})[_0x183c('0x29')](function(_0x410db3){var _0x3a1d31=_0xc18286['user'][_0x183c('0x2a')]({'plain':!![]});if(!_0x3a1d31)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3a1d31[_0x183c('0x4c')]===_0x183c('0x4d')){var _0x387b37=_0x410db3['get']({'plain':!![]});var _0x2e626d=_0x183c('0x2b');return db[_0x183c('0x4e')][_0x183c('0x49')]({'where':{'name':_0x2e626d,'userProfileId':_0x3a1d31[_0x183c('0x4f')]},'raw':!![]})[_0x183c('0x29')](function(_0x55870d){if(_0x55870d&&_0x55870d['autoAssociation']===0x0){return db[_0x183c('0x2c')][_0x183c('0x4a')]({'name':_0x387b37['name'],'resourceId':_0x387b37['id'],'type':_0x55870d['name'],'sectionId':_0x55870d['id']},{})[_0x183c('0x29')](function(){return _0x410db3;});}else{return _0x410db3;}})[_0x183c('0x44')](function(_0x1398d8){logger['error'](_0x183c('0x50'),_0x1398d8);throw _0x1398d8;});}return _0x410db3;})[_0x183c('0x29')](respondWithResult(_0x54090d,0xc9))[_0x183c('0x44')](handleError(_0x54090d,null));};exports[_0x183c('0x51')]=function(_0x5dc16,_0x1318fb){if(_0x5dc16[_0x183c('0x4b')]['id']){delete _0x5dc16['body']['id'];}return db[_0x183c('0x32')][_0x183c('0x49')]({'where':{'id':_0x5dc16[_0x183c('0x45')]['id']}})[_0x183c('0x29')](handleEntityNotFound(_0x1318fb,null))[_0x183c('0x29')](saveUpdates(_0x5dc16[_0x183c('0x4b')],null))[_0x183c('0x29')](respondWithResult(_0x1318fb,null))[_0x183c('0x44')](handleError(_0x1318fb,null));};exports[_0x183c('0x28')]=function(_0x3c8e6e,_0x5ee46d){return db[_0x183c('0x32')][_0x183c('0x49')]({'where':{'id':_0x3c8e6e[_0x183c('0x45')]['id']}})[_0x183c('0x29')](handleEntityNotFound(_0x5ee46d,null))[_0x183c('0x29')](removeEntity(_0x5ee46d,null))[_0x183c('0x44')](handleError(_0x5ee46d,null));}; \ No newline at end of file +var _0xdb76=['UserProfileResource','eml-format','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','lodash','jsforce','desk.js','querystring','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','update','then','destroy','get','error','stack','name','send','map','CmContactHasItem','rawAttributes','fieldName','type','query','keys','filters','intersection','model','attributes','fields','nolimit','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation'];(function(_0x253389,_0x579f51){var _0x15f8ee=function(_0x347a07){while(--_0x347a07){_0x253389['push'](_0x253389['shift']());}};_0x15f8ee(++_0x579f51);}(_0xdb76,0x178));var _0x6db7=function(_0x5ac76b,_0x27173b){_0x5ac76b=_0x5ac76b-0x0;var _0x837e60=_0xdb76[_0x5ac76b];return _0x837e60;};'use strict';var emlformat=require(_0x6db7('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6db7('0x1'));var jsonpatch=require(_0x6db7('0x2'));var rp=require('request-promise');var moment=require(_0x6db7('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x6db7('0x4'));var util=require(_0x6db7('0x5'));var path=require(_0x6db7('0x6'));var sox=require(_0x6db7('0x7'));var csv=require(_0x6db7('0x8'));var ejs=require(_0x6db7('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6db7('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x6db7('0xb'));var deskjs=require(_0x6db7('0xc'));var toCsv=require('to-csv');var querystring=require(_0x6db7('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x6db7('0xe'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6db7('0xf'));var logger=require(_0x6db7('0x10'))(_0x6db7('0x11'));var utils=require(_0x6db7('0x12'));var config=require(_0x6db7('0x13'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5d2d13,_0x32d47c){_0x32d47c=_0x32d47c||0xcc;return function(_0xf3c557){if(_0xf3c557){return _0x5d2d13[_0x6db7('0x14')](_0x32d47c);}return _0x5d2d13[_0x6db7('0x15')](_0x32d47c)[_0x6db7('0x16')]();};}function respondWithResult(_0x3712c2,_0x4772bd){_0x4772bd=_0x4772bd||0xc8;return function(_0x208a5e){if(_0x208a5e){return _0x3712c2['status'](_0x4772bd)['json'](_0x208a5e);}};}function respondWithFilteredResult(_0x57d97e,_0xe45ba2){return function(_0x54de6c){if(_0x54de6c){var _0x33bcb2=typeof _0xe45ba2[_0x6db7('0x17')]===_0x6db7('0x18')&&typeof _0xe45ba2[_0x6db7('0x19')]===_0x6db7('0x18');var _0x5df513=_0x54de6c[_0x6db7('0x1a')];var _0x374200=_0x33bcb2?0x0:_0xe45ba2[_0x6db7('0x17')];var _0x1b5d30=_0x33bcb2?_0x54de6c[_0x6db7('0x1a')]:_0xe45ba2[_0x6db7('0x17')]+_0xe45ba2[_0x6db7('0x19')];var _0x121c38;if(_0x1b5d30>=_0x5df513){_0x1b5d30=_0x5df513;_0x121c38=0xc8;}else{_0x121c38=0xce;}_0x57d97e[_0x6db7('0x15')](_0x121c38);return _0x57d97e['set'](_0x6db7('0x1b'),_0x374200+'-'+_0x1b5d30+'/'+_0x5df513)[_0x6db7('0x1c')](_0x54de6c);}return null;};}function patchUpdates(_0x4e5ea2){return function(_0x4e293c){try{jsonpatch[_0x6db7('0x1d')](_0x4e293c,_0x4e5ea2,!![]);}catch(_0x6cf019){return BPromise[_0x6db7('0x1e')](_0x6cf019);}return _0x4e293c['save']();};}function saveUpdates(_0xaf2fd1,_0x40d246){return function(_0x58a216){if(_0x58a216){return _0x58a216[_0x6db7('0x1f')](_0xaf2fd1)[_0x6db7('0x20')](function(_0x59637d){return _0x59637d;});}return null;};}function removeEntity(_0x483fad,_0x235833){return function(_0x473540){if(_0x473540){return _0x473540[_0x6db7('0x21')]()[_0x6db7('0x20')](function(){var _0x431021=_0x473540[_0x6db7('0x22')]({'plain':!![]});var _0x3f137e='CmContactHasItems';return db['UserProfileResource']['destroy']({'where':{'type':_0x3f137e,'resourceId':_0x431021['id']}})['then'](function(){return _0x473540;});})[_0x6db7('0x20')](function(){_0x483fad[_0x6db7('0x15')](0xcc)[_0x6db7('0x16')]();});}};}function handleEntityNotFound(_0x55027d,_0x8fbb49){return function(_0x963c52){if(!_0x963c52){_0x55027d[_0x6db7('0x14')](0x194);}return _0x963c52;};}function handleError(_0x587dd4,_0x4a1663){_0x4a1663=_0x4a1663||0x1f4;return function(_0x4b90b4){logger[_0x6db7('0x23')](_0x4b90b4[_0x6db7('0x24')]);if(_0x4b90b4[_0x6db7('0x25')]){delete _0x4b90b4[_0x6db7('0x25')];}_0x587dd4['status'](_0x4a1663)[_0x6db7('0x26')](_0x4b90b4);};}exports['index']=function(_0x1225da,_0x327f8c){var _0x1cbf50={},_0x205b40={},_0x3cf61a={'count':0x0,'rows':[]};var _0x4b1f8d=_[_0x6db7('0x27')](db[_0x6db7('0x28')][_0x6db7('0x29')],function(_0x3a9833){return{'name':_0x3a9833[_0x6db7('0x2a')],'type':_0x3a9833[_0x6db7('0x2b')]['key']};});_0x205b40['model']=_[_0x6db7('0x27')](_0x4b1f8d,'name');_0x205b40[_0x6db7('0x2c')]=_[_0x6db7('0x2d')](_0x1225da[_0x6db7('0x2c')]);_0x205b40[_0x6db7('0x2e')]=_[_0x6db7('0x2f')](_0x205b40[_0x6db7('0x30')],_0x205b40[_0x6db7('0x2c')]);_0x1cbf50[_0x6db7('0x31')]=_[_0x6db7('0x2f')](_0x205b40['model'],qs[_0x6db7('0x32')](_0x1225da[_0x6db7('0x2c')][_0x6db7('0x32')]));_0x1cbf50['attributes']=_0x1cbf50[_0x6db7('0x31')]['length']?_0x1cbf50[_0x6db7('0x31')]:_0x205b40[_0x6db7('0x30')];if(!_0x1225da[_0x6db7('0x2c')]['hasOwnProperty'](_0x6db7('0x33'))){_0x1cbf50[_0x6db7('0x19')]=qs['limit'](_0x1225da['query'][_0x6db7('0x19')]);_0x1cbf50['offset']=qs['offset'](_0x1225da[_0x6db7('0x2c')][_0x6db7('0x17')]);}_0x1cbf50['order']=qs[_0x6db7('0x34')](_0x1225da['query'][_0x6db7('0x34')]);_0x1cbf50[_0x6db7('0x35')]=qs[_0x6db7('0x2e')](_['pick'](_0x1225da[_0x6db7('0x2c')],_0x205b40['filters']),_0x4b1f8d);if(_0x1225da[_0x6db7('0x2c')][_0x6db7('0x36')]){_0x1cbf50[_0x6db7('0x35')]=_[_0x6db7('0x37')](_0x1cbf50[_0x6db7('0x35')],{'$or':_[_0x6db7('0x27')](_0x4b1f8d,function(_0x195151){if(_0x195151[_0x6db7('0x2b')]!==_0x6db7('0x38')){var _0x2025ee={};_0x2025ee[_0x195151[_0x6db7('0x25')]]={'$like':'%'+_0x1225da['query'][_0x6db7('0x36')]+'%'};return _0x2025ee;}})});}_0x1cbf50=_[_0x6db7('0x37')]({},_0x1cbf50,_0x1225da[_0x6db7('0x39')]);var _0x3104be={'where':_0x1cbf50[_0x6db7('0x35')]};return db[_0x6db7('0x28')][_0x6db7('0x1a')](_0x3104be)[_0x6db7('0x20')](function(_0x568cd6){_0x3cf61a['count']=_0x568cd6;if(_0x1225da[_0x6db7('0x2c')][_0x6db7('0x3a')]){_0x1cbf50[_0x6db7('0x3b')]=[{'all':!![]}];}return db[_0x6db7('0x28')][_0x6db7('0x3c')](_0x1cbf50);})[_0x6db7('0x20')](function(_0x2a2354){_0x3cf61a['rows']=_0x2a2354;return _0x3cf61a;})[_0x6db7('0x20')](respondWithFilteredResult(_0x327f8c,_0x1cbf50))[_0x6db7('0x3d')](handleError(_0x327f8c,null));};exports[_0x6db7('0x3e')]=function(_0x20fe38,_0x45a13c){var _0x15997f={'raw':!![],'where':{'id':_0x20fe38[_0x6db7('0x3f')]['id']}},_0x3dfda7={};_0x3dfda7[_0x6db7('0x30')]=_[_0x6db7('0x2d')](db[_0x6db7('0x28')]['rawAttributes']);_0x3dfda7['query']=_[_0x6db7('0x2d')](_0x20fe38[_0x6db7('0x2c')]);_0x3dfda7['filters']=_[_0x6db7('0x2f')](_0x3dfda7[_0x6db7('0x30')],_0x3dfda7[_0x6db7('0x2c')]);_0x15997f[_0x6db7('0x31')]=_['intersection'](_0x3dfda7[_0x6db7('0x30')],qs['fields'](_0x20fe38[_0x6db7('0x2c')][_0x6db7('0x32')]));_0x15997f['attributes']=_0x15997f['attributes'][_0x6db7('0x40')]?_0x15997f[_0x6db7('0x31')]:_0x3dfda7['model'];if(_0x20fe38[_0x6db7('0x2c')]['includeAll']){_0x15997f[_0x6db7('0x3b')]=[{'all':!![]}];}_0x15997f=_[_0x6db7('0x37')]({},_0x15997f,_0x20fe38[_0x6db7('0x39')]);return db['CmContactHasItem'][_0x6db7('0x41')](_0x15997f)[_0x6db7('0x20')](handleEntityNotFound(_0x45a13c,null))[_0x6db7('0x20')](respondWithResult(_0x45a13c,null))[_0x6db7('0x3d')](handleError(_0x45a13c,null));};exports[_0x6db7('0x42')]=function(_0x2cf5f2,_0x2a1004){return db[_0x6db7('0x28')][_0x6db7('0x42')](_0x2cf5f2[_0x6db7('0x43')],{})[_0x6db7('0x20')](function(_0x5dd6bc){var _0x4b04b5=_0x2cf5f2[_0x6db7('0x44')][_0x6db7('0x22')]({'plain':!![]});if(!_0x4b04b5)throw new Error(_0x6db7('0x45'));if(_0x4b04b5[_0x6db7('0x46')]===_0x6db7('0x44')){var _0x57becb=_0x5dd6bc[_0x6db7('0x22')]({'plain':!![]});var _0x4a72d3='CmContactHasItems';return db[_0x6db7('0x47')][_0x6db7('0x41')]({'where':{'name':_0x4a72d3,'userProfileId':_0x4b04b5[_0x6db7('0x48')]},'raw':!![]})[_0x6db7('0x20')](function(_0x1bbf69){if(_0x1bbf69&&_0x1bbf69[_0x6db7('0x49')]===0x0){return db[_0x6db7('0x4a')]['create']({'name':_0x57becb[_0x6db7('0x25')],'resourceId':_0x57becb['id'],'type':_0x1bbf69[_0x6db7('0x25')],'sectionId':_0x1bbf69['id']},{})[_0x6db7('0x20')](function(){return _0x5dd6bc;});}else{return _0x5dd6bc;}})['catch'](function(_0x3fba43){logger[_0x6db7('0x23')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3fba43);throw _0x3fba43;});}return _0x5dd6bc;})[_0x6db7('0x20')](respondWithResult(_0x2a1004,0xc9))[_0x6db7('0x3d')](handleError(_0x2a1004,null));};exports[_0x6db7('0x1f')]=function(_0x417317,_0x225dda){if(_0x417317[_0x6db7('0x43')]['id']){delete _0x417317[_0x6db7('0x43')]['id'];}return db[_0x6db7('0x28')][_0x6db7('0x41')]({'where':{'id':_0x417317['params']['id']}})['then'](handleEntityNotFound(_0x225dda,null))[_0x6db7('0x20')](saveUpdates(_0x417317[_0x6db7('0x43')],null))[_0x6db7('0x20')](respondWithResult(_0x225dda,null))[_0x6db7('0x3d')](handleError(_0x225dda,null));};exports[_0x6db7('0x21')]=function(_0x13553e,_0x4c8ae1){return db['CmContactHasItem']['find']({'where':{'id':_0x13553e[_0x6db7('0x3f')]['id']}})[_0x6db7('0x20')](handleEntityNotFound(_0x4c8ae1,null))[_0x6db7('0x20')](removeEntity(_0x4c8ae1,null))[_0x6db7('0x3d')](handleError(_0x4c8ae1,null));}; \ No newline at end of file diff --git a/server/api/cmContactHasItem/cmContactHasItem.model.js b/server/api/cmContactHasItem/cmContactHasItem.model.js index 6f92266..700b669 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 _0xa8fa=['cm_contact_has_items','lodash','util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','exports','define','CmContactHasItem'];(function(_0x226e82,_0x1816ee){var _0xc75e9=function(_0x1634a8){while(--_0x1634a8){_0x226e82['push'](_0x226e82['shift']());}};_0xc75e9(++_0x1816ee);}(_0xa8fa,0xe5));var _0xaa8f=function(_0x13e758,_0x317d23){_0x13e758=_0x13e758-0x0;var _0x5b53c3=_0xa8fa[_0x13e758];return _0x5b53c3;};'use strict';var _=require(_0xaa8f('0x0'));var util=require(_0xaa8f('0x1'));var logger=require(_0xaa8f('0x2'))(_0xaa8f('0x3'));var moment=require(_0xaa8f('0x4'));var BPromise=require('bluebird');var rp=require(_0xaa8f('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xaa8f('0x6'));var config=require(_0xaa8f('0x7'));var attributes=require('./cmContactHasItem.attributes');module[_0xaa8f('0x8')]=function(_0x2380ae,_0x18b73c){return _0x2380ae[_0xaa8f('0x9')](_0xaa8f('0xa'),attributes,{'tableName':_0xaa8f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x82ed=['CmContactHasItem','cm_contact_has_items','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./cmContactHasItem.attributes','exports'];(function(_0x11bf38,_0x213d7f){var _0x202699=function(_0x33659f){while(--_0x33659f){_0x11bf38['push'](_0x11bf38['shift']());}};_0x202699(++_0x213d7f);}(_0x82ed,0x1c9));var _0xd82e=function(_0x3df09c,_0x502545){_0x3df09c=_0x3df09c-0x0;var _0x18b371=_0x82ed[_0x3df09c];return _0x18b371;};'use strict';var _=require(_0xd82e('0x0'));var util=require(_0xd82e('0x1'));var logger=require(_0xd82e('0x2'))(_0xd82e('0x3'));var moment=require(_0xd82e('0x4'));var BPromise=require(_0xd82e('0x5'));var rp=require(_0xd82e('0x6'));var fs=require('fs');var path=require(_0xd82e('0x7'));var rimraf=require(_0xd82e('0x8'));var config=require('../../config/environment');var attributes=require(_0xd82e('0x9'));module[_0xd82e('0xa')]=function(_0x5d15c9,_0x12a1fc){return _0x5d15c9['define'](_0xd82e('0xb'),attributes,{'tableName':_0xd82e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmContactHasItem/cmContactHasItem.rpc.js b/server/api/cmContactHasItem/cmContactHasItem.rpc.js index d0f1f54..3eaca0e 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 _0x9bb2=['ioredis','../../config/utils','../../config/logger','jayson/promise','http','request','info','request\x20sent','debug','CmContactHasItem,\x20%s,\x20%s,\x20%s','stringify','error','CmContactHasItem,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x5eaebb,_0x3e86c5){var _0x588785=function(_0x20070e){while(--_0x20070e){_0x5eaebb['push'](_0x5eaebb['shift']());}};_0x588785(++_0x3e86c5);}(_0x9bb2,0x177));var _0x29bb=function(_0x19a6ae,_0x21e929){_0x19a6ae=_0x19a6ae-0x0;var _0x5df1ef=_0x9bb2[_0x19a6ae];return _0x5df1ef;};'use strict';var _=require(_0x29bb('0x0'));var util=require(_0x29bb('0x1'));var moment=require(_0x29bb('0x2'));var BPromise=require(_0x29bb('0x3'));var rs=require(_0x29bb('0x4'));var fs=require('fs');var Redis=require(_0x29bb('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x29bb('0x6'));var logger=require(_0x29bb('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x29bb('0x8'));var client=jayson['client'][_0x29bb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x43afcd,_0x379178,_0x41fb01){return new BPromise(function(_0x126bd6,_0x31cc3a){return client[_0x29bb('0xa')](_0x43afcd,_0x41fb01)['then'](function(_0x2e08d3){logger[_0x29bb('0xb')]('CmContactHasItem,\x20%s,\x20%s',_0x379178,_0x29bb('0xc'));logger[_0x29bb('0xd')](_0x29bb('0xe'),_0x379178,_0x29bb('0xc'),JSON[_0x29bb('0xf')](_0x2e08d3));if(_0x2e08d3[_0x29bb('0x10')]){if(_0x2e08d3['error']['code']===0x1f4){logger[_0x29bb('0x10')](_0x29bb('0x11'),_0x379178,_0x2e08d3[_0x29bb('0x10')][_0x29bb('0x12')]);return _0x31cc3a(_0x2e08d3[_0x29bb('0x10')][_0x29bb('0x12')]);}logger['error'](_0x29bb('0x11'),_0x379178,_0x2e08d3[_0x29bb('0x10')]['message']);return _0x126bd6(_0x2e08d3['error'][_0x29bb('0x12')]);}else{logger['info'](_0x29bb('0x11'),_0x379178,_0x29bb('0xc'));_0x126bd6(_0x2e08d3['result'][_0x29bb('0x12')]);}})[_0x29bb('0x13')](function(_0x149e1f){logger[_0x29bb('0x10')](_0x29bb('0x11'),_0x379178,_0x149e1f);_0x31cc3a(_0x149e1f);});});} \ No newline at end of file +var _0x2c82=['bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','then','CmContactHasItem,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','lodash','util'];(function(_0x14057a,_0x37e47a){var _0x1babf9=function(_0x42f849){while(--_0x42f849){_0x14057a['push'](_0x14057a['shift']());}};_0x1babf9(++_0x37e47a);}(_0x2c82,0x70));var _0x22c8=function(_0x568a61,_0x2124f8){_0x568a61=_0x568a61-0x0;var _0x334c3b=_0x2c82[_0x568a61];return _0x334c3b;};'use strict';var _=require(_0x22c8('0x0'));var util=require(_0x22c8('0x1'));var moment=require('moment');var BPromise=require(_0x22c8('0x2'));var rs=require(_0x22c8('0x3'));var fs=require('fs');var Redis=require(_0x22c8('0x4'));var db=require(_0x22c8('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x22c8('0x6'))('rpc');var config=require(_0x22c8('0x7'));var jayson=require(_0x22c8('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1f5a68,_0x135c99,_0x4e8b6e){return new BPromise(function(_0x2536bb,_0x322103){return client['request'](_0x1f5a68,_0x4e8b6e)[_0x22c8('0x9')](function(_0xc6ea10){logger['info'](_0x22c8('0xa'),_0x135c99,_0x22c8('0xb'));logger[_0x22c8('0xc')]('CmContactHasItem,\x20%s,\x20%s,\x20%s',_0x135c99,_0x22c8('0xb'),JSON[_0x22c8('0xd')](_0xc6ea10));if(_0xc6ea10[_0x22c8('0xe')]){if(_0xc6ea10[_0x22c8('0xe')][_0x22c8('0xf')]===0x1f4){logger[_0x22c8('0xe')]('CmContactHasItem,\x20%s,\x20%s',_0x135c99,_0xc6ea10['error'][_0x22c8('0x10')]);return _0x322103(_0xc6ea10[_0x22c8('0xe')][_0x22c8('0x10')]);}logger['error'](_0x22c8('0xa'),_0x135c99,_0xc6ea10['error'][_0x22c8('0x10')]);return _0x2536bb(_0xc6ea10['error'][_0x22c8('0x10')]);}else{logger[_0x22c8('0x11')]('CmContactHasItem,\x20%s,\x20%s',_0x135c99,_0x22c8('0xb'));_0x2536bb(_0xc6ea10['result'][_0x22c8('0x10')]);}})[_0x22c8('0x12')](function(_0x469b38){logger[_0x22c8('0xe')]('CmContactHasItem,\x20%s,\x20%s',_0x135c99,_0x469b38);_0x322103(_0x469b38);});});} \ No newline at end of file diff --git a/server/api/cmContactHasItem/index.js b/server/api/cmContactHasItem/index.js index 9209958..8500571 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 _0x28a6=['get','isAuthenticated','index','/:id','post','create','update','delete','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x26e07b,_0x113d22){var _0x1e78d3=function(_0x323912){while(--_0x323912){_0x26e07b['push'](_0x26e07b['shift']());}};_0x1e78d3(++_0x113d22);}(_0x28a6,0x8f));var _0x628a=function(_0x212b5d,_0x318113){_0x212b5d=_0x212b5d-0x0;var _0xd29835=_0x28a6[_0x212b5d];return _0xd29835;};'use strict';var multer=require(_0x628a('0x0'));var util=require(_0x628a('0x1'));var path=require(_0x628a('0x2'));var timeout=require(_0x628a('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x628a('0x4'));var auth=require(_0x628a('0x5'));var interaction=require(_0x628a('0x6'));var config=require('../../config/environment');var controller=require('./cmContactHasItem.controller');router[_0x628a('0x7')]('/',auth[_0x628a('0x8')](),controller[_0x628a('0x9')]);router[_0x628a('0x7')](_0x628a('0xa'),auth[_0x628a('0x8')](),controller['show']);router[_0x628a('0xb')]('/',auth[_0x628a('0x8')](),controller[_0x628a('0xc')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x628a('0xd')]);router[_0x628a('0xe')]('/:id',auth[_0x628a('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x4fe0=['isAuthenticated','index','show','post','create','put','/:id','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmContactHasItem.controller'];(function(_0x464f25,_0x50b657){var _0x32286c=function(_0x290b45){while(--_0x290b45){_0x464f25['push'](_0x464f25['shift']());}};_0x32286c(++_0x50b657);}(_0x4fe0,0x1d8));var _0x04fe=function(_0x8d0f51,_0x386e61){_0x8d0f51=_0x8d0f51-0x0;var _0x3166e7=_0x4fe0[_0x8d0f51];return _0x3166e7;};'use strict';var multer=require(_0x04fe('0x0'));var util=require(_0x04fe('0x1'));var path=require(_0x04fe('0x2'));var timeout=require(_0x04fe('0x3'));var express=require(_0x04fe('0x4'));var router=express[_0x04fe('0x5')]();var fs_extra=require(_0x04fe('0x6'));var auth=require(_0x04fe('0x7'));var interaction=require(_0x04fe('0x8'));var config=require(_0x04fe('0x9'));var controller=require(_0x04fe('0xa'));router['get']('/',auth[_0x04fe('0xb')](),controller[_0x04fe('0xc')]);router['get']('/:id',auth[_0x04fe('0xb')](),controller[_0x04fe('0xd')]);router[_0x04fe('0xe')]('/',auth['isAuthenticated'](),controller[_0x04fe('0xf')]);router[_0x04fe('0x10')](_0x04fe('0x11'),auth['isAuthenticated'](),controller[_0x04fe('0x12')]);router[_0x04fe('0x13')]('/:id',auth[_0x04fe('0xb')](),controller['destroy']);module[_0x04fe('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 6d9878a..253cdbc 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 _0xa65b=['ENUM','voice','sequelize','lodash','exports','VIRTUAL','getDataValue','STRING','name','TEXT','long','parse','values','isArray','setDataValue','stringify','BOOLEAN'];(function(_0x11744c,_0x4b951b){var _0x1c4ff6=function(_0x44925b){while(--_0x44925b){_0x11744c['push'](_0x11744c['shift']());}};_0x1c4ff6(++_0x4b951b);}(_0xa65b,0x1ab));var _0xba65=function(_0x30381e,_0x2a1f30){_0x30381e=_0x30381e-0x0;var _0x9fb2f3=_0xa65b[_0x30381e];return _0x9fb2f3;};'use strict';var Sequelize=require(_0xba65('0x0'));var _=require(_0xba65('0x1'));module[_0xba65('0x2')]={'name':{'type':Sequelize[_0xba65('0x3')],'get':function(_0x20eaa0){return this[_0xba65('0x4')]('alias');}},'alias':{'type':Sequelize[_0xba65('0x5')],'allowNull':![],'set':function(_0x3141f7){this['setDataValue']('alias',_0x3141f7?_0x3141f7:this['getDataValue'](_0xba65('0x6')));}},'type':{'type':Sequelize[_0xba65('0x5')],'allowNull':![]},'values':{'type':Sequelize[_0xba65('0x7')](_0xba65('0x8')),'get':function(){if(this[_0xba65('0x4')]('type')==='select'){return JSON[_0xba65('0x9')](this[_0xba65('0x4')](_0xba65('0xa')));}else{return this['getDataValue']('values');}},'set':function(_0x41527b){if(Array[_0xba65('0xb')](_0x41527b)){this[_0xba65('0xc')](_0xba65('0xa'),JSON[_0xba65('0xd')](_0x41527b));}else{this[_0xba65('0xc')]('values',_0x41527b);}}},'required':{'type':Sequelize[_0xba65('0xe')],'defaultValue':![]},'clickToAction':{'type':Sequelize[_0xba65('0xe')],'defaultValue':![]},'actionType':{'type':Sequelize[_0xba65('0xf')](_0xba65('0x10'))}}; \ No newline at end of file +var _0x45a5=['parse','values','isArray','BOOLEAN','ENUM','voice','sequelize','lodash','getDataValue','alias','setDataValue','name','STRING','TEXT','type','select'];(function(_0x4404a9,_0x1645b8){var _0x420792=function(_0x554bd4){while(--_0x554bd4){_0x4404a9['push'](_0x4404a9['shift']());}};_0x420792(++_0x1645b8);}(_0x45a5,0x136));var _0x545a=function(_0x32b21a,_0x4d8a13){_0x32b21a=_0x32b21a-0x0;var _0x5889e6=_0x45a5[_0x32b21a];return _0x5889e6;};'use strict';var Sequelize=require(_0x545a('0x0'));var _=require(_0x545a('0x1'));module['exports']={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x10d552){return this[_0x545a('0x2')](_0x545a('0x3'));}},'alias':{'type':Sequelize['STRING'],'allowNull':![],'set':function(_0x159b8d){this[_0x545a('0x4')](_0x545a('0x3'),_0x159b8d?_0x159b8d:this[_0x545a('0x2')](_0x545a('0x5')));}},'type':{'type':Sequelize[_0x545a('0x6')],'allowNull':![]},'values':{'type':Sequelize[_0x545a('0x7')]('long'),'get':function(){if(this['getDataValue'](_0x545a('0x8'))===_0x545a('0x9')){return JSON[_0x545a('0xa')](this['getDataValue'](_0x545a('0xb')));}else{return this[_0x545a('0x2')](_0x545a('0xb'));}},'set':function(_0x46234a){if(Array[_0x545a('0xc')](_0x46234a)){this[_0x545a('0x4')](_0x545a('0xb'),JSON['stringify'](_0x46234a));}else{this[_0x545a('0x4')](_0x545a('0xb'),_0x46234a);}}},'required':{'type':Sequelize[_0x545a('0xd')],'defaultValue':![]},'clickToAction':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'actionType':{'type':Sequelize[_0x545a('0xe')](_0x545a('0xf'))}}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.controller.js b/server/api/cmCustomField/cmCustomField.controller.js index 41f888e..ed88692 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 _0x32ff=['count','set','Content-Range','reject','save','then','destroy','error','stack','name','send','index','map','CmCustomField','rawAttributes','fieldName','type','key','model','differenceBy','query','keys','filters','fields','attributes','length','hasOwnProperty','nolimit','order','where','pick','filter','merge','options','includeAll','include','findAll','rows','find','catch','body','create','transaction','Sequelize','TEXT','text','number','switch','BOOLEAN','queryInterface','addColumn','cm_contacts','format','cf_%d','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','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','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit'];(function(_0x4f8f3b,_0x43281b){var _0x4c250c=function(_0x19a7ff){while(--_0x19a7ff){_0x4f8f3b['push'](_0x4f8f3b['shift']());}};_0x4c250c(++_0x43281b);}(_0x32ff,0x192));var _0xf32f=function(_0xf03588,_0x63d2b1){_0xf03588=_0xf03588-0x0;var _0x409a4d=_0x32ff[_0xf03588];return _0x409a4d;};'use strict';var emlformat=require(_0xf32f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf32f('0x1'));var jsonpatch=require(_0xf32f('0x2'));var rp=require('request-promise');var moment=require(_0xf32f('0x3'));var BPromise=require(_0xf32f('0x4'));var Mustache=require(_0xf32f('0x5'));var util=require('util');var path=require('path');var sox=require(_0xf32f('0x6'));var csv=require('to-csv');var ejs=require(_0xf32f('0x7'));var fs=require('fs');var fs_extra=require(_0xf32f('0x8'));var _=require(_0xf32f('0x9'));var squel=require('squel');var crypto=require(_0xf32f('0xa'));var jsforce=require(_0xf32f('0xb'));var deskjs=require(_0xf32f('0xc'));var toCsv=require(_0xf32f('0xd'));var querystring=require(_0xf32f('0xe'));var Papa=require(_0xf32f('0xf'));var Redis=require(_0xf32f('0x10'));var authService=require(_0xf32f('0x11'));var qs=require(_0xf32f('0x12'));var as=require(_0xf32f('0x13'));var hardwareService=require(_0xf32f('0x14'));var logger=require('../../config/logger')(_0xf32f('0x15'));var utils=require(_0xf32f('0x16'));var config=require(_0xf32f('0x17'));var licenseUtil=require(_0xf32f('0x18'));var db=require(_0xf32f('0x19'))['db'];function respondWithStatusCode(_0x4b29cb,_0x386ae3){_0x386ae3=_0x386ae3||0xcc;return function(_0x1bc4d7){if(_0x1bc4d7){return _0x4b29cb[_0xf32f('0x1a')](_0x386ae3);}return _0x4b29cb[_0xf32f('0x1b')](_0x386ae3)[_0xf32f('0x1c')]();};}function respondWithResult(_0x596821,_0x152c83){_0x152c83=_0x152c83||0xc8;return function(_0xb3af67){if(_0xb3af67){return _0x596821['status'](_0x152c83)[_0xf32f('0x1d')](_0xb3af67);}};}function respondWithFilteredResult(_0x48af1d,_0x21d9ba){return function(_0x1a84ef){if(_0x1a84ef){var _0x141c18=typeof _0x21d9ba[_0xf32f('0x1e')]===_0xf32f('0x1f')&&typeof _0x21d9ba[_0xf32f('0x20')]==='undefined';var _0x3fb9e7=_0x1a84ef['count'];var _0x214e48=_0x141c18?0x0:_0x21d9ba[_0xf32f('0x1e')];var _0x4e7f59=_0x141c18?_0x1a84ef[_0xf32f('0x21')]:_0x21d9ba[_0xf32f('0x1e')]+_0x21d9ba[_0xf32f('0x20')];var _0x2bc98e;if(_0x4e7f59>=_0x3fb9e7){_0x4e7f59=_0x3fb9e7;_0x2bc98e=0xc8;}else{_0x2bc98e=0xce;}_0x48af1d['status'](_0x2bc98e);return _0x48af1d[_0xf32f('0x22')](_0xf32f('0x23'),_0x214e48+'-'+_0x4e7f59+'/'+_0x3fb9e7)[_0xf32f('0x1d')](_0x1a84ef);}return null;};}function patchUpdates(_0x3ed853){return function(_0x5e39fd){try{jsonpatch['apply'](_0x5e39fd,_0x3ed853,!![]);}catch(_0x201d13){return BPromise[_0xf32f('0x24')](_0x201d13);}return _0x5e39fd[_0xf32f('0x25')]();};}function saveUpdates(_0x6140ea,_0x272f53){return function(_0x454c79){if(_0x454c79){return _0x454c79['update'](_0x6140ea)[_0xf32f('0x26')](function(_0x5ed977){return _0x5ed977;});}return null;};}function removeEntity(_0x129a79,_0x30ed66){return function(_0x20f885){if(_0x20f885){return _0x20f885[_0xf32f('0x27')]()[_0xf32f('0x26')](function(){_0x129a79[_0xf32f('0x1b')](0xcc)[_0xf32f('0x1c')]();});}};}function handleEntityNotFound(_0x23e681,_0x45a1b0){return function(_0x5e6ee4){if(!_0x5e6ee4){_0x23e681[_0xf32f('0x1a')](0x194);}return _0x5e6ee4;};}function handleError(_0x516182,_0x5d281b){_0x5d281b=_0x5d281b||0x1f4;return function(_0xc2e5f2){logger[_0xf32f('0x28')](_0xc2e5f2[_0xf32f('0x29')]);if(_0xc2e5f2[_0xf32f('0x2a')]){delete _0xc2e5f2[_0xf32f('0x2a')];}_0x516182[_0xf32f('0x1b')](_0x5d281b)[_0xf32f('0x2b')](_0xc2e5f2);};}exports[_0xf32f('0x2c')]=function(_0x545a6c,_0x541d1a){var _0x2b84ae={},_0x49c7e9={},_0x4fba2e={'count':0x0,'rows':[]};var _0x5b7c98=_[_0xf32f('0x2d')](db[_0xf32f('0x2e')][_0xf32f('0x2f')],function(_0x4c03f3){return{'name':_0x4c03f3[_0xf32f('0x30')],'type':_0x4c03f3[_0xf32f('0x31')][_0xf32f('0x32')]};});_0x49c7e9[_0xf32f('0x33')]=_[_0xf32f('0x34')](_[_0xf32f('0x2d')](_0x5b7c98,_0xf32f('0x2a')),[_0xf32f('0x2a')]);_0x49c7e9[_0xf32f('0x35')]=_[_0xf32f('0x36')](_0x545a6c[_0xf32f('0x35')]);_0x49c7e9[_0xf32f('0x37')]=_['intersection'](_0x49c7e9['model'],_0x49c7e9[_0xf32f('0x35')]);_0x2b84ae['attributes']=_['intersection'](_0x49c7e9['model'],qs[_0xf32f('0x38')](_0x545a6c[_0xf32f('0x35')][_0xf32f('0x38')]));_0x2b84ae[_0xf32f('0x39')]=_0x2b84ae[_0xf32f('0x39')][_0xf32f('0x3a')]?_0x2b84ae[_0xf32f('0x39')]:_0x49c7e9[_0xf32f('0x33')];if(!_0x545a6c[_0xf32f('0x35')][_0xf32f('0x3b')](_0xf32f('0x3c'))){_0x2b84ae[_0xf32f('0x20')]=qs[_0xf32f('0x20')](_0x545a6c['query'][_0xf32f('0x20')]);_0x2b84ae[_0xf32f('0x1e')]=qs[_0xf32f('0x1e')](_0x545a6c['query']['offset']);}_0x2b84ae[_0xf32f('0x3d')]=qs['sort'](_0x545a6c[_0xf32f('0x35')]['sort']);_0x2b84ae[_0xf32f('0x3e')]=qs[_0xf32f('0x37')](_[_0xf32f('0x3f')](_0x545a6c['query'],_0x49c7e9[_0xf32f('0x37')]),_0x5b7c98);if(_0x545a6c['query'][_0xf32f('0x40')]){_0x2b84ae['where']=_[_0xf32f('0x41')](_0x2b84ae['where'],{'$or':_[_0xf32f('0x2d')](_0x5b7c98,function(_0x46454c){if(_0x46454c['type']!=='VIRTUAL'){var _0x1ea54b={};_0x1ea54b[_0x46454c['name']]={'$like':'%'+_0x545a6c['query'][_0xf32f('0x40')]+'%'};return _0x1ea54b;}})});}_0x2b84ae=_[_0xf32f('0x41')]({},_0x2b84ae,_0x545a6c[_0xf32f('0x42')]);var _0x143d07={'where':_0x2b84ae['where']};return db[_0xf32f('0x2e')][_0xf32f('0x21')](_0x143d07)[_0xf32f('0x26')](function(_0x5482ba){_0x4fba2e[_0xf32f('0x21')]=_0x5482ba;if(_0x545a6c[_0xf32f('0x35')][_0xf32f('0x43')]){_0x2b84ae[_0xf32f('0x44')]=[{'all':!![]}];}return db[_0xf32f('0x2e')][_0xf32f('0x45')](_0x2b84ae);})[_0xf32f('0x26')](function(_0x2245a1){_0x4fba2e[_0xf32f('0x46')]=_0x2245a1;return _0x4fba2e;})[_0xf32f('0x26')](respondWithFilteredResult(_0x541d1a,_0x2b84ae))['catch'](handleError(_0x541d1a,null));};exports['show']=function(_0xa5f8a7,_0x3dbd7b){var _0x5e4a8b={'raw':!![],'where':{'id':_0xa5f8a7['params']['id']}},_0x210d42={};_0x210d42[_0xf32f('0x33')]=_[_0xf32f('0x36')](db[_0xf32f('0x2e')][_0xf32f('0x2f')]);_0x210d42[_0xf32f('0x35')]=_[_0xf32f('0x36')](_0xa5f8a7[_0xf32f('0x35')]);_0x210d42[_0xf32f('0x37')]=_['intersection'](_0x210d42[_0xf32f('0x33')],_0x210d42[_0xf32f('0x35')]);_0x5e4a8b[_0xf32f('0x39')]=_['intersection'](_0x210d42[_0xf32f('0x33')],qs[_0xf32f('0x38')](_0xa5f8a7[_0xf32f('0x35')][_0xf32f('0x38')]));_0x5e4a8b[_0xf32f('0x39')]=_0x5e4a8b[_0xf32f('0x39')][_0xf32f('0x3a')]?_0x5e4a8b[_0xf32f('0x39')]:_0x210d42[_0xf32f('0x33')];if(_0xa5f8a7['query'][_0xf32f('0x43')]){_0x5e4a8b[_0xf32f('0x44')]=[{'all':!![]}];}_0x5e4a8b=_[_0xf32f('0x41')]({},_0x5e4a8b,_0xa5f8a7[_0xf32f('0x42')]);return db[_0xf32f('0x2e')][_0xf32f('0x47')](_0x5e4a8b)[_0xf32f('0x26')](handleEntityNotFound(_0x3dbd7b,null))[_0xf32f('0x26')](respondWithResult(_0x3dbd7b,null))[_0xf32f('0x48')](handleError(_0x3dbd7b,null));};exports['update']=function(_0x539347,_0x56c31d){if(_0x539347['body']['id']){delete _0x539347[_0xf32f('0x49')]['id'];}return db[_0xf32f('0x2e')][_0xf32f('0x47')]({'where':{'id':_0x539347['params']['id']}})['then'](handleEntityNotFound(_0x56c31d,null))[_0xf32f('0x26')](saveUpdates(_0x539347[_0xf32f('0x49')],null))[_0xf32f('0x26')](respondWithResult(_0x56c31d,null))[_0xf32f('0x48')](handleError(_0x56c31d,null));};exports['destroy']=function(_0xc93deb,_0x219511){return db[_0xf32f('0x2e')][_0xf32f('0x47')]({'where':{'id':_0xc93deb['params']['id']}})[_0xf32f('0x26')](handleEntityNotFound(_0x219511,null))[_0xf32f('0x26')](removeEntity(_0x219511,null))[_0xf32f('0x48')](handleError(_0x219511,null));};exports[_0xf32f('0x4a')]=function(_0x3dc29f,_0x2489c7){var _0xd55967;return db['sequelize'][_0xf32f('0x4b')](function(_0x51e58f){return db[_0xf32f('0x2e')]['create'](_0x3dc29f[_0xf32f('0x49')],{'transaction':_0x51e58f})[_0xf32f('0x26')](function(_0x3c26cf){_0xd55967=_0x3c26cf;var _0x2d3e17={'type':db[_0xf32f('0x4c')][_0xf32f('0x4d')],'transaction':_0x51e58f};switch(_0x3dc29f[_0xf32f('0x49')][_0xf32f('0x31')]){case _0xf32f('0x4e'):_0x2d3e17[_0xf32f('0x31')]=db['Sequelize']['TEXT'];break;case _0xf32f('0x4f'):_0x2d3e17[_0xf32f('0x31')]=db[_0xf32f('0x4c')]['INTEGER'];break;case _0xf32f('0x50'):_0x2d3e17['type']=db[_0xf32f('0x4c')][_0xf32f('0x51')];_0x2d3e17['defaultValue']=![];break;default:}return db['sequelize'][_0xf32f('0x52')][_0xf32f('0x53')](_0xf32f('0x54'),util[_0xf32f('0x55')](_0xf32f('0x56'),_0xd55967['id']),_0x2d3e17);})[_0xf32f('0x26')](function(){return _0xd55967;});})[_0xf32f('0x26')](respondWithResult(_0x2489c7,0xc9))[_0xf32f('0x48')](handleError(_0x2489c7,null));}; \ No newline at end of file +var _0x7bc5=['map','CmCustomField','rawAttributes','type','model','differenceBy','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','then','includeAll','include','catch','show','params','find','body','create','sequelize','transaction','text','Sequelize','TEXT','switch','BOOLEAN','queryInterface','addColumn','format','cf_%d','eml-format','zip-dir','fast-json-patch','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','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','offset','undefined','count','set','json','apply','save','update','destroy','error','stack','name','send'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x7bc5,0x7c));var _0x57bc=function(_0x5b78e8,_0x55096b){_0x5b78e8=_0x5b78e8-0x0;var _0xf2c321=_0x7bc5[_0x5b78e8];return _0xf2c321;};'use strict';var emlformat=require(_0x57bc('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x57bc('0x1'));var jsonpatch=require(_0x57bc('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x57bc('0x3'));var Mustache=require('mustache');var util=require(_0x57bc('0x4'));var path=require(_0x57bc('0x5'));var sox=require(_0x57bc('0x6'));var csv=require(_0x57bc('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x57bc('0x8'));var _=require(_0x57bc('0x9'));var squel=require(_0x57bc('0xa'));var crypto=require(_0x57bc('0xb'));var jsforce=require(_0x57bc('0xc'));var deskjs=require(_0x57bc('0xd'));var toCsv=require(_0x57bc('0x7'));var querystring=require('querystring');var Papa=require(_0x57bc('0xe'));var Redis=require('ioredis');var authService=require(_0x57bc('0xf'));var qs=require(_0x57bc('0x10'));var as=require(_0x57bc('0x11'));var hardwareService=require(_0x57bc('0x12'));var logger=require(_0x57bc('0x13'))(_0x57bc('0x14'));var utils=require('../../config/utils');var config=require(_0x57bc('0x15'));var licenseUtil=require(_0x57bc('0x16'));var db=require(_0x57bc('0x17'))['db'];function respondWithStatusCode(_0x378c52,_0x1757d1){_0x1757d1=_0x1757d1||0xcc;return function(_0x16c228){if(_0x16c228){return _0x378c52[_0x57bc('0x18')](_0x1757d1);}return _0x378c52[_0x57bc('0x19')](_0x1757d1)[_0x57bc('0x1a')]();};}function respondWithResult(_0x250d8d,_0x4dd968){_0x4dd968=_0x4dd968||0xc8;return function(_0x16ecb1){if(_0x16ecb1){return _0x250d8d['status'](_0x4dd968)['json'](_0x16ecb1);}};}function respondWithFilteredResult(_0x840679,_0x1c6c79){return function(_0x1132fd){if(_0x1132fd){var _0x51a16c=typeof _0x1c6c79[_0x57bc('0x1b')]===_0x57bc('0x1c')&&typeof _0x1c6c79['limit']===_0x57bc('0x1c');var _0x272267=_0x1132fd['count'];var _0x4de161=_0x51a16c?0x0:_0x1c6c79[_0x57bc('0x1b')];var _0x45cc4d=_0x51a16c?_0x1132fd[_0x57bc('0x1d')]:_0x1c6c79[_0x57bc('0x1b')]+_0x1c6c79['limit'];var _0x754227;if(_0x45cc4d>=_0x272267){_0x45cc4d=_0x272267;_0x754227=0xc8;}else{_0x754227=0xce;}_0x840679[_0x57bc('0x19')](_0x754227);return _0x840679[_0x57bc('0x1e')]('Content-Range',_0x4de161+'-'+_0x45cc4d+'/'+_0x272267)[_0x57bc('0x1f')](_0x1132fd);}return null;};}function patchUpdates(_0x27f2ae){return function(_0x5785e7){try{jsonpatch[_0x57bc('0x20')](_0x5785e7,_0x27f2ae,!![]);}catch(_0x7cdd5e){return BPromise['reject'](_0x7cdd5e);}return _0x5785e7[_0x57bc('0x21')]();};}function saveUpdates(_0x2e9fc1,_0x103b05){return function(_0x1b28ac){if(_0x1b28ac){return _0x1b28ac[_0x57bc('0x22')](_0x2e9fc1)['then'](function(_0x189656){return _0x189656;});}return null;};}function removeEntity(_0x54079f,_0x192818){return function(_0x3c0b27){if(_0x3c0b27){return _0x3c0b27[_0x57bc('0x23')]()['then'](function(){_0x54079f['status'](0xcc)[_0x57bc('0x1a')]();});}};}function handleEntityNotFound(_0x54953d,_0x272718){return function(_0x1ddcdf){if(!_0x1ddcdf){_0x54953d[_0x57bc('0x18')](0x194);}return _0x1ddcdf;};}function handleError(_0x5bc4f3,_0xa2b666){_0xa2b666=_0xa2b666||0x1f4;return function(_0x173c0c){logger[_0x57bc('0x24')](_0x173c0c[_0x57bc('0x25')]);if(_0x173c0c[_0x57bc('0x26')]){delete _0x173c0c['name'];}_0x5bc4f3['status'](_0xa2b666)[_0x57bc('0x27')](_0x173c0c);};}exports['index']=function(_0x3e15b7,_0x3658d4){var _0xdfe04e={},_0x54c9e7={},_0x411d08={'count':0x0,'rows':[]};var _0x1cd21b=_[_0x57bc('0x28')](db[_0x57bc('0x29')][_0x57bc('0x2a')],function(_0x274daa){return{'name':_0x274daa['fieldName'],'type':_0x274daa[_0x57bc('0x2b')]['key']};});_0x54c9e7[_0x57bc('0x2c')]=_[_0x57bc('0x2d')](_[_0x57bc('0x28')](_0x1cd21b,'name'),['name']);_0x54c9e7[_0x57bc('0x2e')]=_[_0x57bc('0x2f')](_0x3e15b7['query']);_0x54c9e7[_0x57bc('0x30')]=_[_0x57bc('0x31')](_0x54c9e7['model'],_0x54c9e7[_0x57bc('0x2e')]);_0xdfe04e[_0x57bc('0x32')]=_[_0x57bc('0x31')](_0x54c9e7['model'],qs[_0x57bc('0x33')](_0x3e15b7[_0x57bc('0x2e')]['fields']));_0xdfe04e[_0x57bc('0x32')]=_0xdfe04e[_0x57bc('0x32')][_0x57bc('0x34')]?_0xdfe04e[_0x57bc('0x32')]:_0x54c9e7[_0x57bc('0x2c')];if(!_0x3e15b7[_0x57bc('0x2e')][_0x57bc('0x35')](_0x57bc('0x36'))){_0xdfe04e['limit']=qs['limit'](_0x3e15b7['query']['limit']);_0xdfe04e['offset']=qs['offset'](_0x3e15b7[_0x57bc('0x2e')][_0x57bc('0x1b')]);}_0xdfe04e[_0x57bc('0x37')]=qs[_0x57bc('0x38')](_0x3e15b7[_0x57bc('0x2e')][_0x57bc('0x38')]);_0xdfe04e[_0x57bc('0x39')]=qs['filters'](_['pick'](_0x3e15b7[_0x57bc('0x2e')],_0x54c9e7[_0x57bc('0x30')]),_0x1cd21b);if(_0x3e15b7[_0x57bc('0x2e')][_0x57bc('0x3a')]){_0xdfe04e[_0x57bc('0x39')]=_[_0x57bc('0x3b')](_0xdfe04e[_0x57bc('0x39')],{'$or':_[_0x57bc('0x28')](_0x1cd21b,function(_0x55eb2a){if(_0x55eb2a[_0x57bc('0x2b')]!==_0x57bc('0x3c')){var _0x3178a8={};_0x3178a8[_0x55eb2a['name']]={'$like':'%'+_0x3e15b7[_0x57bc('0x2e')][_0x57bc('0x3a')]+'%'};return _0x3178a8;}})});}_0xdfe04e=_['merge']({},_0xdfe04e,_0x3e15b7[_0x57bc('0x3d')]);var _0x33810a={'where':_0xdfe04e[_0x57bc('0x39')]};return db[_0x57bc('0x29')]['count'](_0x33810a)[_0x57bc('0x3e')](function(_0x2ce570){_0x411d08[_0x57bc('0x1d')]=_0x2ce570;if(_0x3e15b7['query'][_0x57bc('0x3f')]){_0xdfe04e[_0x57bc('0x40')]=[{'all':!![]}];}return db['CmCustomField']['findAll'](_0xdfe04e);})[_0x57bc('0x3e')](function(_0x734a13){_0x411d08['rows']=_0x734a13;return _0x411d08;})[_0x57bc('0x3e')](respondWithFilteredResult(_0x3658d4,_0xdfe04e))[_0x57bc('0x41')](handleError(_0x3658d4,null));};exports[_0x57bc('0x42')]=function(_0x7bf6a0,_0x5d0d42){var _0x2a5416={'raw':!![],'where':{'id':_0x7bf6a0[_0x57bc('0x43')]['id']}},_0x4da017={};_0x4da017[_0x57bc('0x2c')]=_['keys'](db['CmCustomField'][_0x57bc('0x2a')]);_0x4da017[_0x57bc('0x2e')]=_[_0x57bc('0x2f')](_0x7bf6a0['query']);_0x4da017[_0x57bc('0x30')]=_[_0x57bc('0x31')](_0x4da017[_0x57bc('0x2c')],_0x4da017[_0x57bc('0x2e')]);_0x2a5416[_0x57bc('0x32')]=_[_0x57bc('0x31')](_0x4da017[_0x57bc('0x2c')],qs[_0x57bc('0x33')](_0x7bf6a0[_0x57bc('0x2e')]['fields']));_0x2a5416['attributes']=_0x2a5416[_0x57bc('0x32')][_0x57bc('0x34')]?_0x2a5416[_0x57bc('0x32')]:_0x4da017['model'];if(_0x7bf6a0[_0x57bc('0x2e')][_0x57bc('0x3f')]){_0x2a5416[_0x57bc('0x40')]=[{'all':!![]}];}_0x2a5416=_[_0x57bc('0x3b')]({},_0x2a5416,_0x7bf6a0['options']);return db[_0x57bc('0x29')][_0x57bc('0x44')](_0x2a5416)['then'](handleEntityNotFound(_0x5d0d42,null))[_0x57bc('0x3e')](respondWithResult(_0x5d0d42,null))['catch'](handleError(_0x5d0d42,null));};exports[_0x57bc('0x22')]=function(_0x118355,_0x12c7a8){if(_0x118355[_0x57bc('0x45')]['id']){delete _0x118355[_0x57bc('0x45')]['id'];}return db[_0x57bc('0x29')]['find']({'where':{'id':_0x118355[_0x57bc('0x43')]['id']}})['then'](handleEntityNotFound(_0x12c7a8,null))[_0x57bc('0x3e')](saveUpdates(_0x118355[_0x57bc('0x45')],null))[_0x57bc('0x3e')](respondWithResult(_0x12c7a8,null))['catch'](handleError(_0x12c7a8,null));};exports[_0x57bc('0x23')]=function(_0x286031,_0x361d37){return db[_0x57bc('0x29')][_0x57bc('0x44')]({'where':{'id':_0x286031['params']['id']}})[_0x57bc('0x3e')](handleEntityNotFound(_0x361d37,null))[_0x57bc('0x3e')](removeEntity(_0x361d37,null))['catch'](handleError(_0x361d37,null));};exports[_0x57bc('0x46')]=function(_0x2db872,_0x15364a){var _0x215316;return db[_0x57bc('0x47')][_0x57bc('0x48')](function(_0xf3170e){return db[_0x57bc('0x29')]['create'](_0x2db872[_0x57bc('0x45')],{'transaction':_0xf3170e})[_0x57bc('0x3e')](function(_0x11134c){_0x215316=_0x11134c;var _0x2bc8b3={'type':db['Sequelize']['TEXT'],'transaction':_0xf3170e};switch(_0x2db872[_0x57bc('0x45')][_0x57bc('0x2b')]){case _0x57bc('0x49'):_0x2bc8b3['type']=db[_0x57bc('0x4a')][_0x57bc('0x4b')];break;case'number':_0x2bc8b3['type']=db['Sequelize']['INTEGER'];break;case _0x57bc('0x4c'):_0x2bc8b3[_0x57bc('0x2b')]=db[_0x57bc('0x4a')][_0x57bc('0x4d')];_0x2bc8b3['defaultValue']=![];break;default:}return db[_0x57bc('0x47')][_0x57bc('0x4e')][_0x57bc('0x4f')]('cm_contacts',util[_0x57bc('0x50')](_0x57bc('0x51'),_0x215316['id']),_0x2bc8b3);})[_0x57bc('0x3e')](function(){return _0x215316;});})[_0x57bc('0x3e')](respondWithResult(_0x15364a,0xc9))['catch'](handleError(_0x15364a,null));}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.model.js b/server/api/cmCustomField/cmCustomField.model.js index b8febe5..afeba66 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 _0x4301=['CmCustomField','cm_custom_fields','util','api','moment','bluebird','path','../../config/environment','./cmCustomField.attributes','exports','define'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4301,0xc8));var _0x1430=function(_0x4ba849,_0x56d82f){_0x4ba849=_0x4ba849-0x0;var _0x13979b=_0x4301[_0x4ba849];return _0x13979b;};'use strict';var _=require('lodash');var util=require(_0x1430('0x0'));var logger=require('../../config/logger')(_0x1430('0x1'));var moment=require(_0x1430('0x2'));var BPromise=require(_0x1430('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1430('0x4'));var rimraf=require('rimraf');var config=require(_0x1430('0x5'));var attributes=require(_0x1430('0x6'));module[_0x1430('0x7')]=function(_0x36c449,_0x4d1c5a){return _0x36c449[_0x1430('0x8')](_0x1430('0x9'),attributes,{'tableName':_0x1430('0xa'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x42dd=['request-promise','path','../../config/environment','./cmCustomField.attributes','CmCustomField','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x1af87e,_0x3d8886){var _0x3ad590=function(_0x4929c8){while(--_0x4929c8){_0x1af87e['push'](_0x1af87e['shift']());}};_0x3ad590(++_0x3d8886);}(_0x42dd,0x1d3));var _0xd42d=function(_0x39d544,_0x35c14f){_0x39d544=_0x39d544-0x0;var _0x5a5ff2=_0x42dd[_0x39d544];return _0x5a5ff2;};'use strict';var _=require(_0xd42d('0x0'));var util=require(_0xd42d('0x1'));var logger=require(_0xd42d('0x2'))(_0xd42d('0x3'));var moment=require(_0xd42d('0x4'));var BPromise=require(_0xd42d('0x5'));var rp=require(_0xd42d('0x6'));var fs=require('fs');var path=require(_0xd42d('0x7'));var rimraf=require('rimraf');var config=require(_0xd42d('0x8'));var attributes=require(_0xd42d('0x9'));module['exports']=function(_0x6e98f3,_0x3307dc){return _0x6e98f3['define'](_0xd42d('0xa'),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 f467dd3..ed650ef 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 _0x1e35=['info','request\x20sent','debug','stringify','error','code','CmCustomField,\x20%s,\x20%s','message','result','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then'];(function(_0x16d011,_0x4587ad){var _0x1f25cb=function(_0x209528){while(--_0x209528){_0x16d011['push'](_0x16d011['shift']());}};_0x1f25cb(++_0x4587ad);}(_0x1e35,0x127));var _0x51e3=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1e35[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x51e3('0x0'));var util=require(_0x51e3('0x1'));var moment=require(_0x51e3('0x2'));var BPromise=require('bluebird');var rs=require(_0x51e3('0x3'));var fs=require('fs');var Redis=require(_0x51e3('0x4'));var db=require(_0x51e3('0x5'))['db'];var utils=require(_0x51e3('0x6'));var logger=require(_0x51e3('0x7'))(_0x51e3('0x8'));var config=require(_0x51e3('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x51e3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4b07b9,_0x1d9b03,_0x22c490){return new BPromise(function(_0x2419dd,_0x1598c1){return client[_0x51e3('0xb')](_0x4b07b9,_0x22c490)[_0x51e3('0xc')](function(_0x393d77){logger[_0x51e3('0xd')]('CmCustomField,\x20%s,\x20%s',_0x1d9b03,_0x51e3('0xe'));logger[_0x51e3('0xf')]('CmCustomField,\x20%s,\x20%s,\x20%s',_0x1d9b03,_0x51e3('0xe'),JSON[_0x51e3('0x10')](_0x393d77));if(_0x393d77[_0x51e3('0x11')]){if(_0x393d77[_0x51e3('0x11')][_0x51e3('0x12')]===0x1f4){logger[_0x51e3('0x11')](_0x51e3('0x13'),_0x1d9b03,_0x393d77[_0x51e3('0x11')]['message']);return _0x1598c1(_0x393d77[_0x51e3('0x11')][_0x51e3('0x14')]);}logger[_0x51e3('0x11')]('CmCustomField,\x20%s,\x20%s',_0x1d9b03,_0x393d77[_0x51e3('0x11')]['message']);return _0x2419dd(_0x393d77[_0x51e3('0x11')]['message']);}else{logger[_0x51e3('0xd')](_0x51e3('0x13'),_0x1d9b03,_0x51e3('0xe'));_0x2419dd(_0x393d77[_0x51e3('0x15')][_0x51e3('0x14')]);}})['catch'](function(_0x3f36f6){logger['error']('CmCustomField,\x20%s,\x20%s',_0x1d9b03,_0x3f36f6);_0x1598c1(_0x3f36f6);});});} \ No newline at end of file +var _0xf69d=['catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/environment','client','http','request','info','CmCustomField,\x20%s,\x20%s','request\x20sent','debug','CmCustomField,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x15bf58,_0x170ea4){var _0x5d6c96=function(_0x2c5454){while(--_0x2c5454){_0x15bf58['push'](_0x15bf58['shift']());}};_0x5d6c96(++_0x170ea4);}(_0xf69d,0xa1));var _0xdf69=function(_0x6b5627,_0x573e85){_0x6b5627=_0x6b5627-0x0;var _0x46d3db=_0xf69d[_0x6b5627];return _0x46d3db;};'use strict';var _=require(_0xdf69('0x0'));var util=require(_0xdf69('0x1'));var moment=require(_0xdf69('0x2'));var BPromise=require(_0xdf69('0x3'));var rs=require(_0xdf69('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xdf69('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xdf69('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xdf69('0x7')][_0xdf69('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1b7486,_0x3674ae,_0x42f0c9){return new BPromise(function(_0x2f69d2,_0x4f6775){return client[_0xdf69('0x9')](_0x1b7486,_0x42f0c9)['then'](function(_0x35457c){logger[_0xdf69('0xa')](_0xdf69('0xb'),_0x3674ae,_0xdf69('0xc'));logger[_0xdf69('0xd')](_0xdf69('0xe'),_0x3674ae,_0xdf69('0xc'),JSON[_0xdf69('0xf')](_0x35457c));if(_0x35457c[_0xdf69('0x10')]){if(_0x35457c[_0xdf69('0x10')][_0xdf69('0x11')]===0x1f4){logger[_0xdf69('0x10')](_0xdf69('0xb'),_0x3674ae,_0x35457c['error'][_0xdf69('0x12')]);return _0x4f6775(_0x35457c[_0xdf69('0x10')][_0xdf69('0x12')]);}logger['error'](_0xdf69('0xb'),_0x3674ae,_0x35457c[_0xdf69('0x10')][_0xdf69('0x12')]);return _0x2f69d2(_0x35457c[_0xdf69('0x10')]['message']);}else{logger[_0xdf69('0xa')](_0xdf69('0xb'),_0x3674ae,_0xdf69('0xc'));_0x2f69d2(_0x35457c['result'][_0xdf69('0x12')]);}})[_0xdf69('0x13')](function(_0x328d68){logger[_0xdf69('0x10')]('CmCustomField,\x20%s,\x20%s',_0x3674ae,_0x328d68);_0x4f6775(_0x328d68);});});} \ No newline at end of file diff --git a/server/api/cmCustomField/index.js b/server/api/cmCustomField/index.js index 88288f6..2a697b7 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 _0x644f=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','show','post','create','/:id','update','delete','destroy','util','path','connect-timeout','express','Router'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x644f,0x177));var _0xf644=function(_0x2dc96f,_0x459058){_0x2dc96f=_0x2dc96f-0x0;var _0xd012da=_0x644f[_0x2dc96f];return _0xd012da;};'use strict';var multer=require('multer');var util=require(_0xf644('0x0'));var path=require(_0xf644('0x1'));var timeout=require(_0xf644('0x2'));var express=require(_0xf644('0x3'));var router=express[_0xf644('0x4')]();var fs_extra=require(_0xf644('0x5'));var auth=require(_0xf644('0x6'));var interaction=require(_0xf644('0x7'));var config=require(_0xf644('0x8'));var controller=require('./cmCustomField.controller');router['get']('/',auth[_0xf644('0x9')](),controller[_0xf644('0xa')]);router[_0xf644('0xb')]('/:id',auth[_0xf644('0x9')](),controller[_0xf644('0xc')]);router[_0xf644('0xd')]('/',auth[_0xf644('0x9')](),controller[_0xf644('0xe')]);router['put'](_0xf644('0xf'),auth[_0xf644('0x9')](),controller[_0xf644('0x10')]);router[_0xf644('0x11')]('/:id',auth['isAuthenticated'](),controller[_0xf644('0x12')]);module['exports']=router; \ No newline at end of file +var _0x0c85=['index','/:id','create','update','delete','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCustomField.controller','isAuthenticated'];(function(_0x810e4d,_0x909ef4){var _0x13f01c=function(_0x12fd89){while(--_0x12fd89){_0x810e4d['push'](_0x810e4d['shift']());}};_0x13f01c(++_0x909ef4);}(_0x0c85,0x14f));var _0x50c8=function(_0x5659d0,_0xe98b24){_0x5659d0=_0x5659d0-0x0;var _0x9059d2=_0x0c85[_0x5659d0];return _0x9059d2;};'use strict';var multer=require(_0x50c8('0x0'));var util=require(_0x50c8('0x1'));var path=require(_0x50c8('0x2'));var timeout=require('connect-timeout');var express=require(_0x50c8('0x3'));var router=express[_0x50c8('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x50c8('0x5'));var interaction=require(_0x50c8('0x6'));var config=require(_0x50c8('0x7'));var controller=require(_0x50c8('0x8'));router['get']('/',auth[_0x50c8('0x9')](),controller[_0x50c8('0xa')]);router['get'](_0x50c8('0xb'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0x50c8('0x9')](),controller[_0x50c8('0xc')]);router['put'](_0x50c8('0xb'),auth['isAuthenticated'](),controller[_0x50c8('0xd')]);router[_0x50c8('0xe')](_0x50c8('0xb'),auth[_0x50c8('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.attributes.js b/server/api/cmHopper/cmHopper.attributes.js index 179ad86..ea6b0cc 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 _0xf575=['sequelize','exports','STRING','BOOLEAN','DATE','INTEGER','UNSIGNED','contactListQueue','moment'];(function(_0x211a65,_0x30d3a7){var _0x9c6615=function(_0x4b8b87){while(--_0x4b8b87){_0x211a65['push'](_0x211a65['shift']());}};_0x9c6615(++_0x30d3a7);}(_0xf575,0x170));var _0x5f57=function(_0x27a7de,_0x5ad5a1){_0x27a7de=_0x27a7de-0x0;var _0x5c900e=_0xf575[_0x27a7de];return _0x5c900e;};'use strict';var moment=require(_0x5f57('0x0'));var Sequelize=require(_0x5f57('0x1'));module[_0x5f57('0x2')]={'phone':{'type':Sequelize[_0x5f57('0x3')],'allowNull':![]},'active':{'type':Sequelize[_0x5f57('0x4')],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0x5f57('0x5')],'defaultValue':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')},'countbusyretry':{'type':Sequelize[_0x5f57('0x6')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x5f57('0x6')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x5f57('0x6')],'defaultValue':0x0},'callback':{'type':Sequelize[_0x5f57('0x4')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize[_0x5f57('0x5')]},'priority':{'type':Sequelize[_0x5f57('0x6')](0x2)[_0x5f57('0x7')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0x5f57('0x4')],'defaultValue':![]},'ContactId':{'type':Sequelize[_0x5f57('0x6')],'unique':'contactListQueue'},'ListId':{'type':Sequelize[_0x5f57('0x6')],'unique':_0x5f57('0x8')},'UserId':{'type':Sequelize[_0x5f57('0x6')]},'VoiceQueueId':{'type':Sequelize['INTEGER'],'unique':_0x5f57('0x8')},'CampaignId':{'type':Sequelize[_0x5f57('0x6')]},'countnosuchnumberretry':{'type':Sequelize[_0x5f57('0x6')],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x5f57('0x6')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x5f57('0x6')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x5f57('0x6')],'defaultValue':0x0},'OrderBy':{'type':Sequelize[_0x5f57('0x6')],'allowNull':!![],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0x5f57('0x3')]},'recallmeNotifiedDate':{'type':Sequelize[_0x5f57('0x5')],'allowNull':!![],'defaultValue':null}}; \ No newline at end of file +var _0x763e=['YYYY-MM-DD\x20HH:mm:ss','INTEGER','UNSIGNED','BOOLEAN','contactListQueue','sequelize','exports','STRING','DATE','format'];(function(_0x886d1f,_0x47fa0a){var _0x269e4f=function(_0x2d3aa8){while(--_0x2d3aa8){_0x886d1f['push'](_0x886d1f['shift']());}};_0x269e4f(++_0x47fa0a);}(_0x763e,0x73));var _0xe763=function(_0x517b09,_0x21c003){_0x517b09=_0x517b09-0x0;var _0xe9d405=_0x763e[_0x517b09];return _0xe9d405;};'use strict';var moment=require('moment');var Sequelize=require(_0xe763('0x0'));module[_0xe763('0x1')]={'phone':{'type':Sequelize[_0xe763('0x2')],'allowNull':![]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0xe763('0x3')],'defaultValue':moment()[_0xe763('0x4')](_0xe763('0x5'))},'countbusyretry':{'type':Sequelize[_0xe763('0x6')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xe763('0x6')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xe763('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'priority':{'type':Sequelize[_0xe763('0x6')](0x2)[_0xe763('0x7')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0xe763('0x8')],'defaultValue':![]},'ContactId':{'type':Sequelize[_0xe763('0x6')],'unique':'contactListQueue'},'ListId':{'type':Sequelize[_0xe763('0x6')],'unique':_0xe763('0x9')},'UserId':{'type':Sequelize['INTEGER']},'VoiceQueueId':{'type':Sequelize['INTEGER'],'unique':_0xe763('0x9')},'CampaignId':{'type':Sequelize[_0xe763('0x6')]},'countnosuchnumberretry':{'type':Sequelize[_0xe763('0x6')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xe763('0x6')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xe763('0x6')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xe763('0x6')],'defaultValue':0x0},'OrderBy':{'type':Sequelize[_0xe763('0x6')],'allowNull':!![],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0xe763('0x2')]},'recallmeNotifiedDate':{'type':Sequelize[_0xe763('0x3')],'allowNull':!![],'defaultValue':null}}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.controller.js b/server/api/cmHopper/cmHopper.controller.js index 7c50c83..fcbb84d 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 _0xf2ca=['attributes','fields','length','nolimit','limit','sort','where','pick','filter','merge','type','includeAll','include','findAll','rows','catch','show','params','keys','options','find','create','body','describe','destroy','CampaignId','VoiceQueueId','omit','dataValues','updatedAt','state','deleted','campaign','membername','user','UserId','deletedat','format','YYYY-MM-DD\x20HH:mm:ss','calleridnum','phone','campaigntype','queue','ivr','CmContact','firstName','lastName','isNil','calleridname','finally','CmHopperFinal','CmHopperAdditionalPhone','end','getVoiceQueues','outbound','dialOrderByScheduledAt','sequelize','transaction','dialPreviewAutoRecallMe','value','direction','isEmpty','hopperIds','priority','scheduledAt','ASC','DESC','literal','COALESCE(CmHopper.UserId,\x200)\x20ASC','COALESCE(CmHopper.UserId,\x200)\x20DESC','recallme','LOCK','CmCompany','Company','CmList','List','VoiceQueue','Queue','findOne','scheduledat','Contact','dialActive','getOpenContacts','preview','entity\x20not\x20found','getTimezones','timezones','push','utcOffset','getTimezone','moment','lodash','../../components/parsers/qs','api','../../config/environment','../../mysqldb','json','offset','undefined','count','status','set','Content-Range','update','then','sendStatus','error','stack','name','index','map','CmHopper','rawAttributes','fieldName','key','model','query','filters','intersection','concat','$and','$gt','$gte','$lt','$lte','$ne','$eq','$not','$notBetween','$in','$notIn','$like','$iLike','$overlap','$contains','$any'];(function(_0x55f09c,_0x573369){var _0x28f585=function(_0x5d2675){while(--_0x5d2675){_0x55f09c['push'](_0x55f09c['shift']());}};_0x28f585(++_0x573369);}(_0xf2ca,0x16a));var _0xaf2c=function(_0x216f7d,_0x496249){_0x216f7d=_0x216f7d-0x0;var _0xc49d7f=_0xf2ca[_0x216f7d];return _0xc49d7f;};'use strict';var moment=require(_0xaf2c('0x0'));var _=require(_0xaf2c('0x1'));var qs=require(_0xaf2c('0x2'));var logger=require('../../config/logger')(_0xaf2c('0x3'));var shared=require(_0xaf2c('0x4'));var db=require(_0xaf2c('0x5'))['db'];function respondWithResult(_0x219511,_0x3a724c){_0x3a724c=_0x3a724c||0xc8;return function(_0x10c910){if(_0x10c910){return _0x219511['status'](_0x3a724c)[_0xaf2c('0x6')](_0x10c910);}};}function respondWithFilteredResult(_0x100d17,_0x297740){return function(_0x1f9531){if(_0x1f9531){var _0x58351f=typeof _0x297740[_0xaf2c('0x7')]===_0xaf2c('0x8')&&typeof _0x297740['limit']===_0xaf2c('0x8');var _0x4ba0a2=_0x1f9531[_0xaf2c('0x9')];var _0x4a0064=_0x58351f?0x0:_0x297740[_0xaf2c('0x7')];var _0x144a7a=_0x58351f?_0x1f9531[_0xaf2c('0x9')]:_0x297740[_0xaf2c('0x7')]+_0x297740['limit'];var _0x4adc8c;if(_0x144a7a>=_0x4ba0a2){_0x144a7a=_0x4ba0a2;_0x4adc8c=0xc8;}else{_0x4adc8c=0xce;}_0x100d17[_0xaf2c('0xa')](_0x4adc8c);return _0x100d17[_0xaf2c('0xb')](_0xaf2c('0xc'),_0x4a0064+'-'+_0x144a7a+'/'+_0x4ba0a2)[_0xaf2c('0x6')](_0x1f9531);}return null;};}function saveUpdates(_0x285dac,_0x59a59b){return function(_0x590126){if(_0x590126){return _0x590126[_0xaf2c('0xd')](_0x285dac)[_0xaf2c('0xe')](function(_0x935959){return _0x935959;});}return null;};}function handleEntityNotFound(_0x18a8a5,_0x293ca6){return function(_0x152c73){if(!_0x152c73){_0x18a8a5[_0xaf2c('0xf')](0x194);}return _0x152c73;};}function handleError(_0x3c1088,_0x2119c8){_0x2119c8=_0x2119c8||0x1f4;return function(_0x1d0633){logger[_0xaf2c('0x10')](_0x1d0633[_0xaf2c('0x11')]);if(_0x1d0633[_0xaf2c('0x12')]){delete _0x1d0633[_0xaf2c('0x12')];}_0x3c1088[_0xaf2c('0xa')](_0x2119c8)['send'](_0x1d0633);};}exports[_0xaf2c('0x13')]=function(_0x553163,_0x278a28){var _0x474c80={},_0x1d544a={},_0x578492={'count':0x0,'rows':[]};var _0x28ae7b=_[_0xaf2c('0x14')](db[_0xaf2c('0x15')][_0xaf2c('0x16')],function(_0x3f977c){return{'name':_0x3f977c[_0xaf2c('0x17')],'type':_0x3f977c['type'][_0xaf2c('0x18')]};});_0x1d544a[_0xaf2c('0x19')]=_[_0xaf2c('0x14')](_0x28ae7b,_0xaf2c('0x12'));_0x1d544a[_0xaf2c('0x1a')]=_['keys'](_0x553163[_0xaf2c('0x1a')]);_0x1d544a[_0xaf2c('0x1b')]=_[_0xaf2c('0x1c')](_0x1d544a['model'],_0x1d544a['query']);_0x1d544a[_0xaf2c('0x1b')]=_[_0xaf2c('0x1d')](_0x1d544a[_0xaf2c('0x1b')],[_0xaf2c('0x1e'),'$or',_0xaf2c('0x1f'),_0xaf2c('0x20'),_0xaf2c('0x21'),_0xaf2c('0x22'),_0xaf2c('0x23'),_0xaf2c('0x24'),_0xaf2c('0x25'),'$between',_0xaf2c('0x26'),_0xaf2c('0x27'),_0xaf2c('0x28'),_0xaf2c('0x29'),'$notLike',_0xaf2c('0x2a'),'$notILike',_0xaf2c('0x29'),_0xaf2c('0x2b'),_0xaf2c('0x2c'),'$contained',_0xaf2c('0x2d')]);_0x474c80[_0xaf2c('0x2e')]=_[_0xaf2c('0x1c')](_0x1d544a['model'],qs[_0xaf2c('0x2f')](_0x553163[_0xaf2c('0x1a')][_0xaf2c('0x2f')]));_0x474c80[_0xaf2c('0x2e')]=_0x474c80['attributes'][_0xaf2c('0x30')]?_0x474c80[_0xaf2c('0x2e')]:_0x1d544a[_0xaf2c('0x19')];if(!_0x553163['query']['hasOwnProperty'](_0xaf2c('0x31'))){_0x474c80['limit']=qs[_0xaf2c('0x32')](_0x553163['query'][_0xaf2c('0x32')]);_0x474c80[_0xaf2c('0x7')]=qs['offset'](_0x553163[_0xaf2c('0x1a')][_0xaf2c('0x7')]);}_0x474c80['order']=qs[_0xaf2c('0x33')](_0x553163[_0xaf2c('0x1a')][_0xaf2c('0x33')]);_0x474c80[_0xaf2c('0x34')]=qs[_0xaf2c('0x1b')](_[_0xaf2c('0x35')](_0x553163['query'],_0x1d544a[_0xaf2c('0x1b')]),_0x28ae7b);if(_0x553163['query'][_0xaf2c('0x36')]){_0x474c80['where']=_[_0xaf2c('0x37')](_0x474c80['where'],{'$or':_[_0xaf2c('0x14')](_0x28ae7b,function(_0x4e877e){if(_0x4e877e[_0xaf2c('0x38')]!=='VIRTUAL'){var _0x30fd87={};_0x30fd87[_0x4e877e[_0xaf2c('0x12')]]={'$like':'%'+_0x553163[_0xaf2c('0x1a')][_0xaf2c('0x36')]+'%'};return _0x30fd87;}})});}_0x474c80=_[_0xaf2c('0x37')]({},_0x474c80,_0x553163['options']);var _0x4cba13={'where':_0x474c80[_0xaf2c('0x34')]};return db[_0xaf2c('0x15')][_0xaf2c('0x9')](_0x4cba13)[_0xaf2c('0xe')](function(_0x4eeecf){_0x578492[_0xaf2c('0x9')]=_0x4eeecf;if(_0x553163['query'][_0xaf2c('0x39')]){_0x474c80[_0xaf2c('0x3a')]=[{'all':!![]}];}return db['CmHopper'][_0xaf2c('0x3b')](_0x474c80);})[_0xaf2c('0xe')](function(_0x25bebd){_0x578492[_0xaf2c('0x3c')]=_0x25bebd;return _0x578492;})[_0xaf2c('0xe')](respondWithFilteredResult(_0x278a28,_0x474c80))[_0xaf2c('0x3d')](handleError(_0x278a28,null));};exports[_0xaf2c('0x3e')]=function(_0x310d3b,_0x296ca8){var _0x106eb9={'raw':!![],'where':{'id':_0x310d3b[_0xaf2c('0x3f')]['id']}},_0x28e2b5={};_0x28e2b5[_0xaf2c('0x19')]=_['keys'](db['CmHopper']['rawAttributes']);_0x28e2b5[_0xaf2c('0x1a')]=_[_0xaf2c('0x40')](_0x310d3b[_0xaf2c('0x1a')]);_0x28e2b5[_0xaf2c('0x1b')]=_[_0xaf2c('0x1c')](_0x28e2b5[_0xaf2c('0x19')],_0x28e2b5['query']);_0x106eb9[_0xaf2c('0x2e')]=_[_0xaf2c('0x1c')](_0x28e2b5[_0xaf2c('0x19')],qs['fields'](_0x310d3b['query'][_0xaf2c('0x2f')]));_0x106eb9['attributes']=_0x106eb9[_0xaf2c('0x2e')][_0xaf2c('0x30')]?_0x106eb9[_0xaf2c('0x2e')]:_0x28e2b5[_0xaf2c('0x19')];if(_0x310d3b['query'][_0xaf2c('0x39')]){_0x106eb9['include']=[{'all':!![]}];}_0x106eb9=_[_0xaf2c('0x37')]({},_0x106eb9,_0x310d3b[_0xaf2c('0x41')]);return db['CmHopper'][_0xaf2c('0x42')](_0x106eb9)['then'](handleEntityNotFound(_0x296ca8,null))[_0xaf2c('0xe')](respondWithResult(_0x296ca8,null))[_0xaf2c('0x3d')](handleError(_0x296ca8,null));};exports[_0xaf2c('0x43')]=function(_0x339f35,_0x16eeb2){return db[_0xaf2c('0x15')][_0xaf2c('0x43')](_0x339f35[_0xaf2c('0x44')],{})[_0xaf2c('0xe')](respondWithResult(_0x16eeb2,0xc9))['catch'](handleError(_0x16eeb2,null));};exports['update']=function(_0x18e62b,_0x4d0977){if(_0x18e62b['body']['id']){delete _0x18e62b['body']['id'];}return db[_0xaf2c('0x15')][_0xaf2c('0x42')]({'where':{'id':_0x18e62b[_0xaf2c('0x3f')]['id']}})[_0xaf2c('0xe')](handleEntityNotFound(_0x4d0977,null))['then'](saveUpdates(_0x18e62b[_0xaf2c('0x44')],null))['then'](respondWithResult(_0x4d0977,null))[_0xaf2c('0x3d')](handleError(_0x4d0977,null));};exports['describe']=function(_0x166c26,_0x133e8c){return db[_0xaf2c('0x15')][_0xaf2c('0x45')]()[_0xaf2c('0xe')](respondWithResult(_0x133e8c,null))['catch'](handleError(_0x133e8c,null));};exports[_0xaf2c('0x46')]=function(_0x26afee,_0x4b3ca4){var _0x4e8efd;var _0x367b30=_0x26afee['params']['id'];return db[_0xaf2c('0x15')][_0xaf2c('0x42')]({'where':{'id':_0x26afee[_0xaf2c('0x3f')]['id']}})[_0xaf2c('0xe')](handleEntityNotFound(_0x4b3ca4,null))[_0xaf2c('0xe')](function(_0x27a3c0){if(_0x27a3c0){return _0x27a3c0[_0xaf2c('0x46')]()[_0xaf2c('0xe')](function(_0x31ccfe){return _0x31ccfe;});}})[_0xaf2c('0xe')](function(_0x371486){_0x4e8efd=_0x371486;if(_0x371486){if(_0x371486['VoiceQueueId']||_0x371486[_0xaf2c('0x47')]){return db[_0x371486[_0xaf2c('0x48')]?'VoiceQueue':'Campaign']['find']({'where':{'id':_0x371486[_0xaf2c('0x48')]?_0x371486[_0xaf2c('0x48')]:_0x371486['CampaignId']},'attributes':['id',_0xaf2c('0x12')],'raw':!![]});}}})[_0xaf2c('0xe')](function(_0x1497fa){var _0x3085e5={};if(_0x1497fa){_[_0xaf2c('0x37')](_0x3085e5,_[_0xaf2c('0x49')](_0x4e8efd[_0xaf2c('0x4a')],['createdAt',_0xaf2c('0x4b'),'id']));_0x3085e5[_0xaf2c('0x4c')]=0x15;_0x3085e5['statedesc']=_0xaf2c('0x4d');_0x3085e5[_0xaf2c('0x4e')]=_0x1497fa[_0xaf2c('0x12')];_0x3085e5[_0xaf2c('0x4f')]=_0x26afee[_0xaf2c('0x50')][_0xaf2c('0x12')];_0x3085e5[_0xaf2c('0x51')]=_0x26afee[_0xaf2c('0x50')]['id'];_0x3085e5[_0xaf2c('0x4d')]=!![];_0x3085e5[_0xaf2c('0x52')]=moment()[_0xaf2c('0x53')](_0xaf2c('0x54'));_0x3085e5[_0xaf2c('0x55')]=_0x4e8efd[_0xaf2c('0x56')];_0x3085e5[_0xaf2c('0x57')]=_0x4e8efd[_0xaf2c('0x48')]?_0xaf2c('0x58'):_0xaf2c('0x59');return db[_0xaf2c('0x5a')][_0xaf2c('0x42')]({'where':{'id':_0x3085e5['ContactId']},'attributes':[_0xaf2c('0x5b'),_0xaf2c('0x5c')]})[_0xaf2c('0xe')](function(_0x5b8b68){if(!_[_0xaf2c('0x5d')](_0x4b3ca4)&&!_['isNil'](_0x5b8b68[_0xaf2c('0x5b')])){_0x3085e5[_0xaf2c('0x5e')]=_0x5b8b68[_0xaf2c('0x5b')];if(!_[_0xaf2c('0x5d')](_0x5b8b68[_0xaf2c('0x5c')])){_0x3085e5[_0xaf2c('0x5e')]+='\x20'+_0x5b8b68[_0xaf2c('0x5c')];}}})[_0xaf2c('0x5f')](function(){return db[_0xaf2c('0x60')]['create'](_0x3085e5);});}})[_0xaf2c('0xe')](function(_0x400dcd){return db[_0xaf2c('0x61')][_0xaf2c('0x46')]({'where':{'CmHopperId':_0x367b30}});})[_0xaf2c('0xe')](function(){return _0x4b3ca4['status'](0xcc)[_0xaf2c('0x62')]();})[_0xaf2c('0x3d')](handleError(_0x4b3ca4,null));};exports['getPreview']=function(_0x33aa67,_0xeb3be0){var _0x4b7070=[];return db['CmContact'][_0xaf2c('0x45')]()[_0xaf2c('0xe')](function(_0xc83d19){_0x4b7070=_[_0xaf2c('0x40')](_0xc83d19);return _0x33aa67['user'][_0xaf2c('0x63')]({'where':{'type':_0xaf2c('0x64'),'dialActive':!![],'dialMethod':'preview'},'attributes':['id',_0xaf2c('0x65'),'dialPreviewAutoRecallMe'],'raw':!![]});})[_0xaf2c('0xe')](function(_0xe6a251){if(_0xe6a251&&_0xe6a251[_0xaf2c('0x30')]){return db[_0xaf2c('0x66')][_0xaf2c('0x67')](function(_0x348f7e){var _0x1c9639={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0xaf2c('0x53')](_0xaf2c('0x54'))},'VoiceQueueId':{'$in':_[_0xaf2c('0x14')](_0xe6a251,'id')},'$or':[{'UserId':null},{'UserId':_0x33aa67['user']['id']}]};var _0x79d962={'active':![],'recallme':!![],'VoiceQueueId':{'$in':_(_0xe6a251)[_0xaf2c('0x36')]([_0xaf2c('0x68'),0x0])[_0xaf2c('0x14')]('id')[_0xaf2c('0x69')]()},'$or':[{'UserId':null},{'UserId':_0x33aa67['user']['id']}]};var _0xbfb776={'$or':[_0x1c9639,_0x79d962]};var _0x28b09f=[];if(_0x33aa67[_0xaf2c('0x44')][_0xaf2c('0x6a')]&&_0x33aa67[_0xaf2c('0x44')]['direction']==='prev'){if(!_[_0xaf2c('0x6b')](_0x33aa67[_0xaf2c('0x44')]['hopperIds'])){_0xbfb776['id']={'$in':_0x33aa67[_0xaf2c('0x44')][_0xaf2c('0x6c')]};}_0x28b09f=[[_0xaf2c('0x6d'),'ASC'],[_0xaf2c('0x6e'),_0xe6a251[0x0][_0xaf2c('0x65')]===_0xaf2c('0x6f')?_0xaf2c('0x70'):'ASC'],db[_0xaf2c('0x66')][_0xaf2c('0x71')](_0xaf2c('0x72')),['id',_0xaf2c('0x70')]];}else{if(!_[_0xaf2c('0x6b')](_0x33aa67[_0xaf2c('0x44')][_0xaf2c('0x6c')])){_0xbfb776['id']={'$notIn':_0x33aa67[_0xaf2c('0x44')][_0xaf2c('0x6c')]};}_0x28b09f=[[_0xaf2c('0x6d'),_0xaf2c('0x70')],['scheduledAt',_0xe6a251[0x0][_0xaf2c('0x65')]],db['sequelize'][_0xaf2c('0x71')](_0xaf2c('0x73')),['id','ASC']];}return db[_0xaf2c('0x15')]['findOne']({'attributes':['id','scheduledat',_0xaf2c('0x56'),_0xaf2c('0x74')],'where':_0xbfb776,'order':_0x28b09f,'transaction':_0x348f7e,'lock':_0x348f7e[_0xaf2c('0x75')]['UPDATE'],'include':[{'model':db['CmContact'],'as':'Contact','attributes':_0x4b7070,'include':[{'model':db[_0xaf2c('0x76')],'as':_0xaf2c('0x77'),'attributes':['id','name']}]},{'model':db[_0xaf2c('0x78')],'as':_0xaf2c('0x79'),'attributes':['id',_0xaf2c('0x12')]},{'model':db[_0xaf2c('0x7a')],'as':_0xaf2c('0x7b'),'attributes':['id',_0xaf2c('0x12'),'dialActive']}]})[_0xaf2c('0xe')](function(_0x399a67){if(_0x399a67){return _0x399a67[_0xaf2c('0xd')]({'UserId':_0x33aa67['user']['id']},{'transaction':_0x348f7e});}});});}})[_0xaf2c('0xe')](handleEntityNotFound(_0xeb3be0,null))[_0xaf2c('0xe')](respondWithResult(_0xeb3be0,null))[_0xaf2c('0x3d')](handleError(_0xeb3be0,null));};exports['getPreviewRecall']=function(_0x3a23a8,_0x31125a,_0x433f9e){var _0x5f705=[];var _0x491160=_0x3a23a8[_0xaf2c('0x3f')]['id'];var _0x309532=_0x3a23a8[_0xaf2c('0x50')]['id'];return db['CmContact']['describe']()[_0xaf2c('0xe')](function(_0x1b7dc1){_0x5f705=_['keys'](_0x1b7dc1);return db[_0xaf2c('0x66')][_0xaf2c('0x67')](function(_0x5365fa){const _0x41e739={'id':_0x491160};return db[_0xaf2c('0x15')][_0xaf2c('0x7c')]({'attributes':['id',_0xaf2c('0x7d'),_0xaf2c('0x74')],'where':_0x41e739,'transaction':_0x5365fa,'lock':_0x5365fa['LOCK']['UPDATE'],'include':[{'model':db[_0xaf2c('0x5a')],'as':_0xaf2c('0x7e'),'attributes':_0x5f705,'include':[{'model':db[_0xaf2c('0x76')],'as':'Company','attributes':['id',_0xaf2c('0x12')]}]},{'model':db[_0xaf2c('0x78')],'as':_0xaf2c('0x79'),'attributes':['id',_0xaf2c('0x12')]},{'model':db[_0xaf2c('0x7a')],'as':'Queue','attributes':['id',_0xaf2c('0x12'),_0xaf2c('0x7f')]}]})[_0xaf2c('0xe')](function(_0x1ef61f){if(_0x1ef61f){return _0x1ef61f[_0xaf2c('0xd')]({'UserId':_0x309532},{'transaction':_0x5365fa});}});});})[_0xaf2c('0xe')](handleEntityNotFound(_0x31125a,null))['then'](respondWithResult(_0x31125a,null))[_0xaf2c('0x3d')](handleError(_0x31125a,null));};exports[_0xaf2c('0x80')]=function(_0x483774,_0x5beb89){return _0x483774['user'][_0xaf2c('0x63')]({'where':{'type':_0xaf2c('0x64'),'dialActive':!![],'dialMethod':_0xaf2c('0x81')},'attributes':['id'],'raw':!![]})[_0xaf2c('0xe')](function(_0x499bbe){if(_0x499bbe&&_0x499bbe[_0xaf2c('0x30')]){return db[_0xaf2c('0x15')][_0xaf2c('0x9')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0xaf2c('0x53')]('YYYY-MM-DD\x20HH:mm:ss')},'VoiceQueueId':{'$in':_[_0xaf2c('0x14')](_0x499bbe,'id')},'$or':[{'UserId':null},{'UserId':_0x483774[_0xaf2c('0x50')]['id']}]}});}return 0x0;})[_0xaf2c('0xe')](function(_0x205e33){if(!_[_0xaf2c('0x5d')](_0x205e33)&&_['isNumber'](_0x205e33)){return _0x5beb89[_0xaf2c('0xa')](0xc8)[_0xaf2c('0x6')]({'contacts':_0x205e33});}else{logger['error']('CmHopper,\x20%s,\x20%s,\x20%s',_0xaf2c('0x80'),0x194,_0xaf2c('0x82'));_0x5beb89['sendStatus'](0x194);}})[_0xaf2c('0x3d')](handleError(_0x5beb89,null));};exports[_0xaf2c('0x83')]=function(_0x3b084f,_0xa75d65){var _0x24a09f=shared[_0xaf2c('0x84')];var _0x2a3cb4=[];_[_0xaf2c('0x14')](_0x24a09f,function(_0x4ac636){_0x2a3cb4[_0xaf2c('0x85')]({'id':_0x4ac636['name'],'name':_0x4ac636[_0xaf2c('0x12')],'utcOffset':_0x4ac636[_0xaf2c('0x86')]});});return _0xa75d65['status'](0xc8)['json']({'tz':_0x2a3cb4});};exports[_0xaf2c('0x87')]=function(_0x201546,_0xb8fee2){var _0x542b14=shared[_0xaf2c('0x84')];var _0x25df5c={};if(!_[_0xaf2c('0x5d')](_0x542b14[_0x201546['body']['id']]))_0x25df5c=_0x542b14[_0x201546['body']['id']];return _0xb8fee2['status'](0xc8)['json'](_0x25df5c);}; \ No newline at end of file +var _0x29d4=['scheduledAt','DESC','literal','COALESCE(CmHopper.UserId,\x200)\x20DESC','scheduledat','recallme','LOCK','UPDATE','CmList','VoiceQueue','dialActive','getPreviewRecall','findOne','Company','List','Queue','getVoiceQueues','isNumber','entity\x20not\x20found','timezones','push','moment','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','status','json','undefined','count','offset','limit','set','Content-Range','update','then','sendStatus','error','stack','name','send','index','CmHopper','rawAttributes','fieldName','type','key','map','query','filters','intersection','model','$and','$gt','$gte','$lt','$lte','$eq','$not','$between','$notBetween','$in','$like','$notLike','$iLike','$notILike','$overlap','$contains','$contained','$any','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','VIRTUAL','filter','merge','includeAll','include','findAll','rows','params','options','find','catch','create','body','describe','destroy','VoiceQueueId','CampaignId','Campaign','omit','dataValues','createdAt','updatedAt','state','deleted','campaign','membername','user','UserId','deletedat','format','YYYY-MM-DD\x20HH:mm:ss','phone','CmContact','firstName','lastName','isNil','calleridname','finally','CmHopperFinal','CmHopperAdditionalPhone','end','keys','outbound','preview','dialOrderByScheduledAt','sequelize','transaction','dialPreviewAutoRecallMe','value','direction','prev','isEmpty','ASC'];(function(_0x138adb,_0x193fee){var _0x1b27f2=function(_0x5e97a2){while(--_0x5e97a2){_0x138adb['push'](_0x138adb['shift']());}};_0x1b27f2(++_0x193fee);}(_0x29d4,0x1a1));var _0x429d=function(_0x5783f4,_0x4a9e0a){_0x5783f4=_0x5783f4-0x0;var _0x28e380=_0x29d4[_0x5783f4];return _0x28e380;};'use strict';var moment=require(_0x429d('0x0'));var _=require('lodash');var qs=require(_0x429d('0x1'));var logger=require(_0x429d('0x2'))(_0x429d('0x3'));var shared=require(_0x429d('0x4'));var db=require(_0x429d('0x5'))['db'];function respondWithResult(_0x4e287b,_0xc3989d){_0xc3989d=_0xc3989d||0xc8;return function(_0x3f43f5){if(_0x3f43f5){return _0x4e287b[_0x429d('0x6')](_0xc3989d)[_0x429d('0x7')](_0x3f43f5);}};}function respondWithFilteredResult(_0x1c55aa,_0xa71445){return function(_0x56aa2f){if(_0x56aa2f){var _0x1ede3f=typeof _0xa71445['offset']===_0x429d('0x8')&&typeof _0xa71445['limit']===_0x429d('0x8');var _0x207dee=_0x56aa2f[_0x429d('0x9')];var _0x5e8430=_0x1ede3f?0x0:_0xa71445[_0x429d('0xa')];var _0x8c7cb6=_0x1ede3f?_0x56aa2f['count']:_0xa71445[_0x429d('0xa')]+_0xa71445[_0x429d('0xb')];var _0x417f77;if(_0x8c7cb6>=_0x207dee){_0x8c7cb6=_0x207dee;_0x417f77=0xc8;}else{_0x417f77=0xce;}_0x1c55aa['status'](_0x417f77);return _0x1c55aa[_0x429d('0xc')](_0x429d('0xd'),_0x5e8430+'-'+_0x8c7cb6+'/'+_0x207dee)[_0x429d('0x7')](_0x56aa2f);}return null;};}function saveUpdates(_0x1cb1cf,_0x4843af){return function(_0x1c542c){if(_0x1c542c){return _0x1c542c[_0x429d('0xe')](_0x1cb1cf)[_0x429d('0xf')](function(_0x56bf5d){return _0x56bf5d;});}return null;};}function handleEntityNotFound(_0x315d8d,_0x5dc247){return function(_0x5c32ab){if(!_0x5c32ab){_0x315d8d[_0x429d('0x10')](0x194);}return _0x5c32ab;};}function handleError(_0x2b9411,_0x1bfbdb){_0x1bfbdb=_0x1bfbdb||0x1f4;return function(_0x2ee97b){logger[_0x429d('0x11')](_0x2ee97b[_0x429d('0x12')]);if(_0x2ee97b['name']){delete _0x2ee97b[_0x429d('0x13')];}_0x2b9411['status'](_0x1bfbdb)[_0x429d('0x14')](_0x2ee97b);};}exports[_0x429d('0x15')]=function(_0x4eef9d,_0x2dc57a){var _0x51ef88={},_0x240a7d={},_0xc80aab={'count':0x0,'rows':[]};var _0x2b9e78=_['map'](db[_0x429d('0x16')][_0x429d('0x17')],function(_0x202c4e){return{'name':_0x202c4e[_0x429d('0x18')],'type':_0x202c4e[_0x429d('0x19')][_0x429d('0x1a')]};});_0x240a7d['model']=_[_0x429d('0x1b')](_0x2b9e78,_0x429d('0x13'));_0x240a7d[_0x429d('0x1c')]=_['keys'](_0x4eef9d[_0x429d('0x1c')]);_0x240a7d[_0x429d('0x1d')]=_[_0x429d('0x1e')](_0x240a7d[_0x429d('0x1f')],_0x240a7d[_0x429d('0x1c')]);_0x240a7d[_0x429d('0x1d')]=_['concat'](_0x240a7d[_0x429d('0x1d')],[_0x429d('0x20'),'$or',_0x429d('0x21'),_0x429d('0x22'),_0x429d('0x23'),_0x429d('0x24'),'$ne',_0x429d('0x25'),_0x429d('0x26'),_0x429d('0x27'),_0x429d('0x28'),_0x429d('0x29'),'$notIn',_0x429d('0x2a'),_0x429d('0x2b'),_0x429d('0x2c'),_0x429d('0x2d'),_0x429d('0x2a'),_0x429d('0x2e'),_0x429d('0x2f'),_0x429d('0x30'),_0x429d('0x31')]);_0x51ef88['attributes']=_[_0x429d('0x1e')](_0x240a7d[_0x429d('0x1f')],qs['fields'](_0x4eef9d[_0x429d('0x1c')][_0x429d('0x32')]));_0x51ef88[_0x429d('0x33')]=_0x51ef88[_0x429d('0x33')][_0x429d('0x34')]?_0x51ef88['attributes']:_0x240a7d[_0x429d('0x1f')];if(!_0x4eef9d[_0x429d('0x1c')][_0x429d('0x35')](_0x429d('0x36'))){_0x51ef88[_0x429d('0xb')]=qs[_0x429d('0xb')](_0x4eef9d['query']['limit']);_0x51ef88[_0x429d('0xa')]=qs[_0x429d('0xa')](_0x4eef9d['query']['offset']);}_0x51ef88[_0x429d('0x37')]=qs['sort'](_0x4eef9d[_0x429d('0x1c')][_0x429d('0x38')]);_0x51ef88[_0x429d('0x39')]=qs[_0x429d('0x1d')](_['pick'](_0x4eef9d[_0x429d('0x1c')],_0x240a7d[_0x429d('0x1d')]),_0x2b9e78);if(_0x4eef9d['query']['filter']){_0x51ef88['where']=_['merge'](_0x51ef88['where'],{'$or':_[_0x429d('0x1b')](_0x2b9e78,function(_0x4c5be1){if(_0x4c5be1['type']!==_0x429d('0x3a')){var _0x3e70bf={};_0x3e70bf[_0x4c5be1[_0x429d('0x13')]]={'$like':'%'+_0x4eef9d[_0x429d('0x1c')][_0x429d('0x3b')]+'%'};return _0x3e70bf;}})});}_0x51ef88=_[_0x429d('0x3c')]({},_0x51ef88,_0x4eef9d['options']);var _0x423dc8={'where':_0x51ef88[_0x429d('0x39')]};return db[_0x429d('0x16')][_0x429d('0x9')](_0x423dc8)[_0x429d('0xf')](function(_0x391d5f){_0xc80aab[_0x429d('0x9')]=_0x391d5f;if(_0x4eef9d[_0x429d('0x1c')][_0x429d('0x3d')]){_0x51ef88[_0x429d('0x3e')]=[{'all':!![]}];}return db[_0x429d('0x16')][_0x429d('0x3f')](_0x51ef88);})[_0x429d('0xf')](function(_0x10ecb8){_0xc80aab[_0x429d('0x40')]=_0x10ecb8;return _0xc80aab;})[_0x429d('0xf')](respondWithFilteredResult(_0x2dc57a,_0x51ef88))['catch'](handleError(_0x2dc57a,null));};exports['show']=function(_0x44a137,_0x346e65){var _0x569811={'raw':!![],'where':{'id':_0x44a137[_0x429d('0x41')]['id']}},_0x2ea43a={};_0x2ea43a[_0x429d('0x1f')]=_['keys'](db['CmHopper'][_0x429d('0x17')]);_0x2ea43a[_0x429d('0x1c')]=_['keys'](_0x44a137[_0x429d('0x1c')]);_0x2ea43a[_0x429d('0x1d')]=_['intersection'](_0x2ea43a[_0x429d('0x1f')],_0x2ea43a['query']);_0x569811[_0x429d('0x33')]=_[_0x429d('0x1e')](_0x2ea43a[_0x429d('0x1f')],qs[_0x429d('0x32')](_0x44a137['query'][_0x429d('0x32')]));_0x569811[_0x429d('0x33')]=_0x569811[_0x429d('0x33')]['length']?_0x569811['attributes']:_0x2ea43a[_0x429d('0x1f')];if(_0x44a137[_0x429d('0x1c')][_0x429d('0x3d')]){_0x569811[_0x429d('0x3e')]=[{'all':!![]}];}_0x569811=_['merge']({},_0x569811,_0x44a137[_0x429d('0x42')]);return db[_0x429d('0x16')][_0x429d('0x43')](_0x569811)[_0x429d('0xf')](handleEntityNotFound(_0x346e65,null))[_0x429d('0xf')](respondWithResult(_0x346e65,null))[_0x429d('0x44')](handleError(_0x346e65,null));};exports[_0x429d('0x45')]=function(_0x3d9f02,_0x271399){return db[_0x429d('0x16')]['create'](_0x3d9f02[_0x429d('0x46')],{})['then'](respondWithResult(_0x271399,0xc9))['catch'](handleError(_0x271399,null));};exports['update']=function(_0xdb38d8,_0x134514){if(_0xdb38d8['body']['id']){delete _0xdb38d8[_0x429d('0x46')]['id'];}return db[_0x429d('0x16')]['find']({'where':{'id':_0xdb38d8[_0x429d('0x41')]['id']}})[_0x429d('0xf')](handleEntityNotFound(_0x134514,null))[_0x429d('0xf')](saveUpdates(_0xdb38d8[_0x429d('0x46')],null))[_0x429d('0xf')](respondWithResult(_0x134514,null))['catch'](handleError(_0x134514,null));};exports[_0x429d('0x47')]=function(_0xd9451b,_0x21bf06){return db[_0x429d('0x16')]['describe']()[_0x429d('0xf')](respondWithResult(_0x21bf06,null))[_0x429d('0x44')](handleError(_0x21bf06,null));};exports[_0x429d('0x48')]=function(_0x58b6c7,_0x471ba5){var _0x545d43;var _0x548f71=_0x58b6c7[_0x429d('0x41')]['id'];return db[_0x429d('0x16')]['find']({'where':{'id':_0x58b6c7['params']['id']}})[_0x429d('0xf')](handleEntityNotFound(_0x471ba5,null))['then'](function(_0x3a15d0){if(_0x3a15d0){return _0x3a15d0[_0x429d('0x48')]()[_0x429d('0xf')](function(_0x25121e){return _0x25121e;});}})[_0x429d('0xf')](function(_0x10dec8){_0x545d43=_0x10dec8;if(_0x10dec8){if(_0x10dec8[_0x429d('0x49')]||_0x10dec8[_0x429d('0x4a')]){return db[_0x10dec8['VoiceQueueId']?'VoiceQueue':_0x429d('0x4b')][_0x429d('0x43')]({'where':{'id':_0x10dec8[_0x429d('0x49')]?_0x10dec8[_0x429d('0x49')]:_0x10dec8['CampaignId']},'attributes':['id',_0x429d('0x13')],'raw':!![]});}}})[_0x429d('0xf')](function(_0x2caf41){var _0x46e097={};if(_0x2caf41){_[_0x429d('0x3c')](_0x46e097,_[_0x429d('0x4c')](_0x545d43[_0x429d('0x4d')],[_0x429d('0x4e'),_0x429d('0x4f'),'id']));_0x46e097[_0x429d('0x50')]=0x15;_0x46e097['statedesc']=_0x429d('0x51');_0x46e097[_0x429d('0x52')]=_0x2caf41[_0x429d('0x13')];_0x46e097[_0x429d('0x53')]=_0x58b6c7[_0x429d('0x54')][_0x429d('0x13')];_0x46e097[_0x429d('0x55')]=_0x58b6c7['user']['id'];_0x46e097[_0x429d('0x51')]=!![];_0x46e097[_0x429d('0x56')]=moment()[_0x429d('0x57')](_0x429d('0x58'));_0x46e097['calleridnum']=_0x545d43[_0x429d('0x59')];_0x46e097['campaigntype']=_0x545d43[_0x429d('0x49')]?'queue':'ivr';return db[_0x429d('0x5a')][_0x429d('0x43')]({'where':{'id':_0x46e097['ContactId']},'attributes':[_0x429d('0x5b'),_0x429d('0x5c')]})['then'](function(_0x213b7b){if(!_[_0x429d('0x5d')](_0x471ba5)&&!_[_0x429d('0x5d')](_0x213b7b[_0x429d('0x5b')])){_0x46e097['calleridname']=_0x213b7b[_0x429d('0x5b')];if(!_[_0x429d('0x5d')](_0x213b7b[_0x429d('0x5c')])){_0x46e097[_0x429d('0x5e')]+='\x20'+_0x213b7b[_0x429d('0x5c')];}}})[_0x429d('0x5f')](function(){return db[_0x429d('0x60')][_0x429d('0x45')](_0x46e097);});}})[_0x429d('0xf')](function(_0x3f4da9){return db[_0x429d('0x61')][_0x429d('0x48')]({'where':{'CmHopperId':_0x548f71}});})[_0x429d('0xf')](function(){return _0x471ba5[_0x429d('0x6')](0xcc)[_0x429d('0x62')]();})[_0x429d('0x44')](handleError(_0x471ba5,null));};exports['getPreview']=function(_0x18f3be,_0x1c20ae){var _0x57d0ca=[];return db[_0x429d('0x5a')][_0x429d('0x47')]()['then'](function(_0x1a9119){_0x57d0ca=_[_0x429d('0x63')](_0x1a9119);return _0x18f3be[_0x429d('0x54')]['getVoiceQueues']({'where':{'type':_0x429d('0x64'),'dialActive':!![],'dialMethod':_0x429d('0x65')},'attributes':['id',_0x429d('0x66'),'dialPreviewAutoRecallMe'],'raw':!![]});})[_0x429d('0xf')](function(_0x43f7ab){if(_0x43f7ab&&_0x43f7ab[_0x429d('0x34')]){return db[_0x429d('0x67')][_0x429d('0x68')](function(_0x75686c){var _0x389d22={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x429d('0x57')](_0x429d('0x58'))},'VoiceQueueId':{'$in':_[_0x429d('0x1b')](_0x43f7ab,'id')},'$or':[{'UserId':null},{'UserId':_0x18f3be[_0x429d('0x54')]['id']}]};var _0x4cc426={'active':![],'recallme':!![],'VoiceQueueId':{'$in':_(_0x43f7ab)[_0x429d('0x3b')]([_0x429d('0x69'),0x0])[_0x429d('0x1b')]('id')[_0x429d('0x6a')]()},'$or':[{'UserId':null},{'UserId':_0x18f3be[_0x429d('0x54')]['id']}]};var _0x5c4f70={'$or':[_0x389d22,_0x4cc426]};var _0x13b777=[];if(_0x18f3be[_0x429d('0x46')][_0x429d('0x6b')]&&_0x18f3be['body'][_0x429d('0x6b')]===_0x429d('0x6c')){if(!_[_0x429d('0x6d')](_0x18f3be[_0x429d('0x46')]['hopperIds'])){_0x5c4f70['id']={'$in':_0x18f3be['body']['hopperIds']};}_0x13b777=[['priority',_0x429d('0x6e')],[_0x429d('0x6f'),_0x43f7ab[0x0][_0x429d('0x66')]===_0x429d('0x6e')?_0x429d('0x70'):'ASC'],db[_0x429d('0x67')][_0x429d('0x71')]('COALESCE(CmHopper.UserId,\x200)\x20ASC'),['id',_0x429d('0x70')]];}else{if(!_['isEmpty'](_0x18f3be['body']['hopperIds'])){_0x5c4f70['id']={'$notIn':_0x18f3be[_0x429d('0x46')]['hopperIds']};}_0x13b777=[['priority',_0x429d('0x70')],[_0x429d('0x6f'),_0x43f7ab[0x0][_0x429d('0x66')]],db[_0x429d('0x67')][_0x429d('0x71')](_0x429d('0x72')),['id','ASC']];}return db[_0x429d('0x16')]['findOne']({'attributes':['id',_0x429d('0x73'),_0x429d('0x59'),_0x429d('0x74')],'where':_0x5c4f70,'order':_0x13b777,'transaction':_0x75686c,'lock':_0x75686c[_0x429d('0x75')][_0x429d('0x76')],'include':[{'model':db[_0x429d('0x5a')],'as':'Contact','attributes':_0x57d0ca,'include':[{'model':db['CmCompany'],'as':'Company','attributes':['id',_0x429d('0x13')]}]},{'model':db[_0x429d('0x77')],'as':'List','attributes':['id',_0x429d('0x13')]},{'model':db[_0x429d('0x78')],'as':'Queue','attributes':['id','name',_0x429d('0x79')]}]})['then'](function(_0x1b1a28){if(_0x1b1a28){return _0x1b1a28[_0x429d('0xe')]({'UserId':_0x18f3be['user']['id']},{'transaction':_0x75686c});}});});}})[_0x429d('0xf')](handleEntityNotFound(_0x1c20ae,null))[_0x429d('0xf')](respondWithResult(_0x1c20ae,null))['catch'](handleError(_0x1c20ae,null));};exports[_0x429d('0x7a')]=function(_0x161e4f,_0x756d3f,_0x430e69){var _0x3025f6=[];var _0x2c686e=_0x161e4f[_0x429d('0x41')]['id'];var _0x86c0d8=_0x161e4f['user']['id'];return db[_0x429d('0x5a')][_0x429d('0x47')]()['then'](function(_0x1a1257){_0x3025f6=_[_0x429d('0x63')](_0x1a1257);return db[_0x429d('0x67')][_0x429d('0x68')](function(_0x114488){const _0x205044={'id':_0x2c686e};return db['CmHopper'][_0x429d('0x7b')]({'attributes':['id',_0x429d('0x73'),'recallme'],'where':_0x205044,'transaction':_0x114488,'lock':_0x114488[_0x429d('0x75')]['UPDATE'],'include':[{'model':db['CmContact'],'as':'Contact','attributes':_0x3025f6,'include':[{'model':db['CmCompany'],'as':_0x429d('0x7c'),'attributes':['id',_0x429d('0x13')]}]},{'model':db[_0x429d('0x77')],'as':_0x429d('0x7d'),'attributes':['id',_0x429d('0x13')]},{'model':db['VoiceQueue'],'as':_0x429d('0x7e'),'attributes':['id',_0x429d('0x13'),_0x429d('0x79')]}]})[_0x429d('0xf')](function(_0x4356f0){if(_0x4356f0){return _0x4356f0['update']({'UserId':_0x86c0d8},{'transaction':_0x114488});}});});})[_0x429d('0xf')](handleEntityNotFound(_0x756d3f,null))[_0x429d('0xf')](respondWithResult(_0x756d3f,null))[_0x429d('0x44')](handleError(_0x756d3f,null));};exports['getOpenContacts']=function(_0x1d464a,_0x225533){return _0x1d464a[_0x429d('0x54')][_0x429d('0x7f')]({'where':{'type':_0x429d('0x64'),'dialActive':!![],'dialMethod':_0x429d('0x65')},'attributes':['id'],'raw':!![]})['then'](function(_0x5397f0){if(_0x5397f0&&_0x5397f0['length']){return db[_0x429d('0x16')]['count']({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x429d('0x57')](_0x429d('0x58'))},'VoiceQueueId':{'$in':_['map'](_0x5397f0,'id')},'$or':[{'UserId':null},{'UserId':_0x1d464a['user']['id']}]}});}return 0x0;})[_0x429d('0xf')](function(_0x10ec8a){if(!_[_0x429d('0x5d')](_0x10ec8a)&&_[_0x429d('0x80')](_0x10ec8a)){return _0x225533[_0x429d('0x6')](0xc8)[_0x429d('0x7')]({'contacts':_0x10ec8a});}else{logger[_0x429d('0x11')]('CmHopper,\x20%s,\x20%s,\x20%s','getOpenContacts',0x194,_0x429d('0x81'));_0x225533[_0x429d('0x10')](0x194);}})[_0x429d('0x44')](handleError(_0x225533,null));};exports['getTimezones']=function(_0x5a7ae0,_0x36faa7){var _0x181663=shared[_0x429d('0x82')];var _0x288ee2=[];_[_0x429d('0x1b')](_0x181663,function(_0x3c5058){_0x288ee2[_0x429d('0x83')]({'id':_0x3c5058[_0x429d('0x13')],'name':_0x3c5058['name'],'utcOffset':_0x3c5058['utcOffset']});});return _0x36faa7[_0x429d('0x6')](0xc8)[_0x429d('0x7')]({'tz':_0x288ee2});};exports['getTimezone']=function(_0x1a767a,_0x4758ba){var _0x1b76e3=shared[_0x429d('0x82')];var _0x3da35a={};if(!_[_0x429d('0x5d')](_0x1b76e3[_0x1a767a['body']['id']]))_0x3da35a=_0x1b76e3[_0x1a767a['body']['id']];return _0x4758ba['status'](0xc8)['json'](_0x3da35a);}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.model.js b/server/api/cmHopper/cmHopper.model.js index 8c2976e..28692d5 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 _0xafc4=['priority','lodash','../../config/logger','moment','bluebird','request-promise','path','exports','define','CmHopper','cm_hopper','scheduledat','phone'];(function(_0x40b08f,_0x1689d8){var _0x2b4ce1=function(_0x4ab1b9){while(--_0x4ab1b9){_0x40b08f['push'](_0x40b08f['shift']());}};_0x2b4ce1(++_0x1689d8);}(_0xafc4,0x69));var _0x4afc=function(_0x1e000a,_0x535a62){_0x1e000a=_0x1e000a-0x0;var _0x12f0e1=_0xafc4[_0x1e000a];return _0x12f0e1;};'use strict';var _=require(_0x4afc('0x0'));var util=require('util');var logger=require(_0x4afc('0x1'))('api');var moment=require(_0x4afc('0x2'));var BPromise=require(_0x4afc('0x3'));var rp=require(_0x4afc('0x4'));var fs=require('fs');var path=require(_0x4afc('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./cmHopper.attributes');module[_0x4afc('0x6')]=function(_0x471d45,_0x16953b){return _0x471d45[_0x4afc('0x7')](_0x4afc('0x8'),attributes,{'tableName':_0x4afc('0x9'),'paranoid':![],'indexes':[{'name':'scheduledat','fields':[_0x4afc('0xa')]},{'name':_0x4afc('0xb'),'fields':[_0x4afc('0xb')]},{'name':_0x4afc('0xc'),'fields':[_0x4afc('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x9536=['../../config/environment','./cmHopper.attributes','exports','define','CmHopper','cm_hopper','scheduledat','phone','priority','lodash','util','../../config/logger','api','bluebird','path','rimraf'];(function(_0x24237f,_0x4cf32c){var _0x48298e=function(_0x3f7511){while(--_0x3f7511){_0x24237f['push'](_0x24237f['shift']());}};_0x48298e(++_0x4cf32c);}(_0x9536,0x179));var _0x6953=function(_0x14a0a0,_0x45d0cf){_0x14a0a0=_0x14a0a0-0x0;var _0x56b651=_0x9536[_0x14a0a0];return _0x56b651;};'use strict';var _=require(_0x6953('0x0'));var util=require(_0x6953('0x1'));var logger=require(_0x6953('0x2'))(_0x6953('0x3'));var moment=require('moment');var BPromise=require(_0x6953('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6953('0x5'));var rimraf=require(_0x6953('0x6'));var config=require(_0x6953('0x7'));var attributes=require(_0x6953('0x8'));module[_0x6953('0x9')]=function(_0x494ac2,_0x2b273e){return _0x494ac2[_0x6953('0xa')](_0x6953('0xb'),attributes,{'tableName':_0x6953('0xc'),'paranoid':![],'indexes':[{'name':_0x6953('0xd'),'fields':['scheduledat']},{'name':_0x6953('0xe'),'fields':[_0x6953('0xe')]},{'name':_0x6953('0xf'),'fields':['priority']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.rpc.js b/server/api/cmHopper/cmHopper.rpc.js index 987f94b..a5c41d6 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 _0x9d27=['where','attributes','limit','include','map','model','info','debug','stringify','catch','error','message','ShowCmHopper','CmHopper','then','CreateCmHopper','body','UpdateCmHopper','destroy','DestroyCmHopper','GetContactDialer','describe','sequelize','transaction','LOCK','UPDATE','CmContact','Contact','keys','User','Agent','voicePause','length','UserId','push','includes','all','GetContactDialer\x20hopperId\x20[%s]\x20-\x20contactId\x20[%s]\x20-\x20active\x20status\x20[%s]','dataValues','ContactId','active','MoveContactManagedDialer','CmHopperFinal','MoveContactManagedDialer\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','CountReScheduled','format','\x22%s\x22','YYYY-MM-DD\x20HH:mm:ss','GetContactRecallMe','GetContactByPhone','findOne','phone','DESC','getContactByPhone','ResetActiveCalls','update','CmHopperHandlePreviewRecallNotifications','voiceQueueIds','interval','availableAgentsIds','literal','\x20MINUTE','NOW()','lodash','util','../../mysqldb','rpc','GetCmHopper','findAll','options','raw'];(function(_0x45783c,_0x49c56d){var _0x1161da=function(_0x3c5d41){while(--_0x3c5d41){_0x45783c['push'](_0x45783c['shift']());}};_0x1161da(++_0x49c56d);}(_0x9d27,0xcd));var _0x79d2=function(_0x1acc2d,_0x597696){_0x1acc2d=_0x1acc2d-0x0;var _0xabfa6d=_0x9d27[_0x1acc2d];return _0xabfa6d;};'use strict';var _=require(_0x79d2('0x0'));var util=require(_0x79d2('0x1'));var moment=require('moment');var BPromise=require('bluebird');var db=require(_0x79d2('0x2'))['db'];var logger=require('../../config/logger')(_0x79d2('0x3'));exports[_0x79d2('0x4')]=function(_0x4c6f94){var _0x461fa4=this;return new Promise(function(_0x2b767b,_0x3d0b7a){return db['CmHopper'][_0x79d2('0x5')]({'raw':_0x4c6f94[_0x79d2('0x6')]?_0x4c6f94['options'][_0x79d2('0x7')]===undefined?!![]:![]:!![],'where':_0x4c6f94[_0x79d2('0x6')]?_0x4c6f94[_0x79d2('0x6')][_0x79d2('0x8')]||null:null,'attributes':_0x4c6f94['options']?_0x4c6f94[_0x79d2('0x6')][_0x79d2('0x9')]||null:null,'limit':_0x4c6f94[_0x79d2('0x6')]?_0x4c6f94[_0x79d2('0x6')][_0x79d2('0xa')]||null:null,'include':_0x4c6f94[_0x79d2('0x6')]?_0x4c6f94['options'][_0x79d2('0xb')]?_[_0x79d2('0xc')](_0x4c6f94[_0x79d2('0x6')]['include'],function(_0x35a5f0){return{'model':db[_0x35a5f0[_0x79d2('0xd')]],'as':_0x35a5f0['as'],'attributes':_0x35a5f0[_0x79d2('0x9')],'include':_0x35a5f0['include']?_[_0x79d2('0xc')](_0x35a5f0[_0x79d2('0xb')],function(_0x309c02){return{'model':db[_0x309c02[_0x79d2('0xd')]],'as':_0x309c02['as'],'attributes':_0x309c02[_0x79d2('0x9')],'include':_0x309c02['include']?_[_0x79d2('0xc')](_0x309c02[_0x79d2('0xb')],function(_0x563461){return{'model':db[_0x563461['model']],'as':_0x563461['as'],'attributes':_0x563461[_0x79d2('0x9')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x43fa9c){logger[_0x79d2('0xe')](_0x79d2('0x4'),_0x4c6f94);logger[_0x79d2('0xf')]('GetCmHopper',_0x4c6f94,JSON[_0x79d2('0x10')](_0x43fa9c));_0x2b767b(_0x43fa9c);})[_0x79d2('0x11')](function(_0x2654ea){logger[_0x79d2('0x12')](_0x79d2('0x4'),_0x2654ea[_0x79d2('0x13')],_0x4c6f94);_0x3d0b7a(_0x461fa4[_0x79d2('0x12')](0x1f4,_0x2654ea['message']));});});};exports[_0x79d2('0x14')]=function(_0x51ed40){var _0x167f1e=this;return new Promise(function(_0x242b44,_0x1349d0){return db[_0x79d2('0x15')]['find']({'raw':_0x51ed40[_0x79d2('0x6')]?_0x51ed40[_0x79d2('0x6')]['raw']===undefined?!![]:![]:!![],'where':_0x51ed40[_0x79d2('0x6')]?_0x51ed40[_0x79d2('0x6')][_0x79d2('0x8')]||null:null,'attributes':_0x51ed40['options']?_0x51ed40[_0x79d2('0x6')][_0x79d2('0x9')]||null:null,'include':_0x51ed40[_0x79d2('0x6')]?_0x51ed40[_0x79d2('0x6')][_0x79d2('0xb')]?_['map'](_0x51ed40[_0x79d2('0x6')]['include'],function(_0x150649){return{'model':db[_0x150649[_0x79d2('0xd')]],'as':_0x150649['as'],'attributes':_0x150649[_0x79d2('0x9')],'include':_0x150649[_0x79d2('0xb')]?_[_0x79d2('0xc')](_0x150649[_0x79d2('0xb')],function(_0x59382d){return{'model':db[_0x59382d[_0x79d2('0xd')]],'as':_0x59382d['as'],'attributes':_0x59382d[_0x79d2('0x9')],'include':_0x59382d[_0x79d2('0xb')]?_['map'](_0x59382d[_0x79d2('0xb')],function(_0x2280eb){return{'model':db[_0x2280eb['model']],'as':_0x2280eb['as'],'attributes':_0x2280eb[_0x79d2('0x9')]};}):[]};}):[]};}):[]:[]})[_0x79d2('0x16')](function(_0x16354f){logger['info'](_0x79d2('0x14'),_0x51ed40);logger['debug'](_0x79d2('0x14'),_0x51ed40,JSON[_0x79d2('0x10')](_0x16354f));_0x242b44(_0x16354f);})['catch'](function(_0xcc1d80){logger[_0x79d2('0x12')](_0x79d2('0x14'),_0xcc1d80[_0x79d2('0x13')],_0x51ed40);_0x1349d0(_0x167f1e['error'](0x1f4,_0xcc1d80[_0x79d2('0x13')]));});});};exports[_0x79d2('0x17')]=function(_0x5477ac){var _0x22d35b=this;return new Promise(function(_0x4773ac,_0x464afd){return db[_0x79d2('0x15')]['create'](_0x5477ac[_0x79d2('0x18')],{'raw':_0x5477ac[_0x79d2('0x6')]?_0x5477ac[_0x79d2('0x6')][_0x79d2('0x7')]===undefined?!![]:![]:!![]})[_0x79d2('0x16')](function(_0x1e315){logger['info'](_0x79d2('0x17'),_0x5477ac);logger[_0x79d2('0xf')](_0x79d2('0x17'),_0x5477ac,JSON[_0x79d2('0x10')](_0x1e315));_0x4773ac(_0x1e315);})[_0x79d2('0x11')](function(_0x4ce9eb){logger[_0x79d2('0x12')](_0x79d2('0x17'),_0x4ce9eb['message'],_0x5477ac);_0x464afd(_0x22d35b[_0x79d2('0x12')](0x1f4,_0x4ce9eb[_0x79d2('0x13')]));});});};exports[_0x79d2('0x19')]=function(_0x5dc7d6){var _0x13f326=this;return new Promise(function(_0x148a6e,_0x20ce31){return db[_0x79d2('0x15')]['update'](_0x5dc7d6['body'],{'raw':_0x5dc7d6[_0x79d2('0x6')]?_0x5dc7d6[_0x79d2('0x6')][_0x79d2('0x7')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5dc7d6[_0x79d2('0x6')]?_0x5dc7d6[_0x79d2('0x6')][_0x79d2('0x8')]||null:null,'attributes':_0x5dc7d6[_0x79d2('0x6')]?_0x5dc7d6[_0x79d2('0x6')]['attributes']||null:null,'limit':_0x5dc7d6[_0x79d2('0x6')]?_0x5dc7d6[_0x79d2('0x6')]['limit']||null:null})[_0x79d2('0x16')](function(_0x5426cc){logger[_0x79d2('0xe')](_0x79d2('0x19'),_0x5dc7d6);logger['info']('UpdateCmHopper\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]',JSON['stringify'](_0x5dc7d6[_0x79d2('0x6')][_0x79d2('0x8')]),_0x5dc7d6[_0x79d2('0x18')]['active']);logger[_0x79d2('0xf')]('UpdateCmHopper',_0x5dc7d6,JSON[_0x79d2('0x10')](_0x5426cc));_0x148a6e(_0x5426cc);})[_0x79d2('0x11')](function(_0x5023b8){logger[_0x79d2('0x12')](_0x79d2('0x19'),_0x5023b8[_0x79d2('0x13')],_0x5dc7d6);_0x20ce31(_0x13f326[_0x79d2('0x12')](0x1f4,_0x5023b8['message']));});});};exports['DestroyCmHopper']=function(_0x364353){var _0x4c7214=this;return new Promise(function(_0x3c84f8,_0x287467){return db[_0x79d2('0x15')][_0x79d2('0x1a')]({'where':_0x364353[_0x79d2('0x6')]?_0x364353[_0x79d2('0x6')]['where']||null:null})[_0x79d2('0x16')](function(_0xd496c){logger[_0x79d2('0xe')](_0x79d2('0x1b'),_0x364353);logger[_0x79d2('0xf')](_0x79d2('0x1b'),_0x364353,JSON[_0x79d2('0x10')](_0xd496c));_0x3c84f8(_0xd496c);})[_0x79d2('0x11')](function(_0x1ca8ca){logger[_0x79d2('0x12')](_0x79d2('0x1b'),_0x1ca8ca[_0x79d2('0x13')],_0x364353);_0x287467(_0x4c7214[_0x79d2('0x12')](0x1f4,_0x1ca8ca[_0x79d2('0x13')]));});});};exports[_0x79d2('0x1c')]=function(_0x1f968a){var _0x1e49c6=this;return new Promise(function(_0x741dbb,_0x85ab0a){return db['CmContact'][_0x79d2('0x1d')]()[_0x79d2('0x16')](function(_0xf3dd48){return db[_0x79d2('0x1e')][_0x79d2('0x1f')](function(_0x43994c){return db['CmHopper']['findAll']({'where':_0x1f968a[_0x79d2('0x6')]?_0x1f968a[_0x79d2('0x6')][_0x79d2('0x8')]||null:null,'attributes':_0x1f968a['options']?_0x1f968a[_0x79d2('0x6')]['attributes']||null:null,'limit':_0x1f968a[_0x79d2('0x6')]?_0x1f968a[_0x79d2('0x6')][_0x79d2('0xa')]||null:null,'order':_0x1f968a[_0x79d2('0x6')]?_0x1f968a['options']['order']||null:null,'transaction':_0x43994c,'lock':_0x43994c[_0x79d2('0x20')][_0x79d2('0x21')],'include':[{'model':db[_0x79d2('0x22')],'as':_0x79d2('0x23'),'attributes':_[_0x79d2('0x24')](_0xf3dd48)},{'model':db[_0x79d2('0x25')],'as':_0x79d2('0x26'),'attributes':['id','name',_0x79d2('0x27')]}]})[_0x79d2('0x16')](function(_0x18a58c){var _0x340694=[];var _0x38f3db=[];for(var _0x564b86=0x0;_0x564b86<_0x18a58c[_0x79d2('0x28')];_0x564b86+=0x1){var _0x4f2b17=_0x18a58c[_0x564b86][_0x79d2('0x29')];if(_0x4f2b17===null){_0x340694[_0x79d2('0x2a')](_0x18a58c[_0x564b86]['update'](_0x1f968a[_0x79d2('0x18')],{'transaction':_0x43994c}));}else if(!_0x38f3db[_0x79d2('0x2b')](_0x4f2b17)){_0x38f3db['push'](_0x4f2b17);_0x340694[_0x79d2('0x2a')](_0x18a58c[_0x564b86]['update'](_0x1f968a['body'],{'transaction':_0x43994c}));}}return BPromise[_0x79d2('0x2c')](_0x340694);});})[_0x79d2('0x16')](function(_0x4466b4){logger[_0x79d2('0xe')]('GetContactDialer',_0x1f968a);if(_0x4466b4[_0x79d2('0x28')]>0x0){logger[_0x79d2('0xe')](_0x79d2('0x2d'),_0x4466b4[0x0][_0x79d2('0x2e')]['id'],_0x4466b4[0x0]['dataValues'][_0x79d2('0x2f')],_0x4466b4[0x0]['dataValues'][_0x79d2('0x30')]);}logger[_0x79d2('0xf')]('GetContactDialer',_0x1f968a,JSON[_0x79d2('0x10')](_0x4466b4));_0x741dbb(_0x4466b4);})[_0x79d2('0x11')](function(_0x1b1c55){logger[_0x79d2('0x12')](_0x79d2('0x1c'),_0x1b1c55[_0x79d2('0x13')],_0x1f968a);_0x85ab0a(_0x1e49c6['error'](0x1f4,_0x1b1c55[_0x79d2('0x13')]));});});});};exports[_0x79d2('0x31')]=function(_0x212681){var _0x2fb1b2=this;return new Promise(function(_0x33ffe4,_0xd4b614){return db['sequelize'][_0x79d2('0x1f')](function(_0x284cd9){return db[_0x79d2('0x32')]['create'](_0x212681['body'],{'raw':_0x212681['options']?_0x212681['options'][_0x79d2('0x7')]===undefined?!![]:![]:!![],'transaction':_0x284cd9})['then'](function(){logger[_0x79d2('0xe')](_0x79d2('0x33'),JSON[_0x79d2('0x10')](_0x212681[_0x79d2('0x6')][_0x79d2('0x8')]),_0x212681[_0x79d2('0x6')][_0x79d2('0x8')]['active']);return db['CmHopper'][_0x79d2('0x1a')]({'where':_0x212681[_0x79d2('0x6')]?_0x212681['options']['where']||null:null,'transaction':_0x284cd9});});})['then'](function(_0x36ac2d){logger[_0x79d2('0xe')](_0x79d2('0x31'),_0x212681);logger[_0x79d2('0xf')](_0x79d2('0x31'),_0x212681,JSON[_0x79d2('0x10')](_0x36ac2d));_0x33ffe4(_0x36ac2d);})[_0x79d2('0x11')](function(_0x50560c){logger['error'](_0x79d2('0x31'),_0x50560c[_0x79d2('0x13')],_0x212681);_0xd4b614(_0x2fb1b2[_0x79d2('0x12')](0x1f4,_0x50560c[_0x79d2('0x13')]));});});};exports[_0x79d2('0x34')]=function(_0x36fd89){var _0x5ac114=this;return new Promise(function(_0x4d78ed,_0x55b602){return db['CmHopper'][_0x79d2('0x5')]({'raw':_0x36fd89[_0x79d2('0x6')]?_0x36fd89[_0x79d2('0x6')][_0x79d2('0x7')]===undefined?!![]:![]:!![],'where':_0x36fd89[_0x79d2('0x6')]?_0x36fd89[_0x79d2('0x6')][_0x79d2('0x8')]||null:null,'attributes':[[db[_0x79d2('0x1e')]['fn']('COUNT',db[_0x79d2('0x1e')]['fn']('IF',db['sequelize']['literal']('`scheduledat`\x20>=\x20'+util[_0x79d2('0x35')](_0x79d2('0x36'),moment()[_0x79d2('0x35')](_0x79d2('0x37')))+'\x20,\x201,\x20null'))),'contactsRescheduled']]})[_0x79d2('0x16')](function(_0x583c3b){logger[_0x79d2('0xe')](_0x79d2('0x34'),_0x36fd89);logger['debug'](_0x79d2('0x34'),_0x36fd89,JSON[_0x79d2('0x10')](_0x583c3b));_0x4d78ed(_0x583c3b);})['catch'](function(_0x4438d7){logger[_0x79d2('0x12')]('CountReScheduled',_0x4438d7[_0x79d2('0x13')],_0x36fd89);_0x55b602(_0x5ac114[_0x79d2('0x12')](0x1f4,_0x4438d7[_0x79d2('0x13')]));});});};exports[_0x79d2('0x38')]=function(_0x46f40d){var _0x43711c=this;return new Promise(function(_0x5d29bb,_0x15f4ec){return db['CmContact'][_0x79d2('0x1d')]()[_0x79d2('0x16')](function(){return db['sequelize'][_0x79d2('0x1f')](function(_0x1336e4){return db[_0x79d2('0x15')]['findAll']({'where':_0x46f40d['options']?_0x46f40d[_0x79d2('0x6')][_0x79d2('0x8')]||null:null,'attributes':_0x46f40d[_0x79d2('0x6')]?_0x46f40d[_0x79d2('0x6')][_0x79d2('0x9')]||null:null,'limit':0x1,'order':_0x46f40d[_0x79d2('0x6')]?_0x46f40d[_0x79d2('0x6')]['order']||null:null,'group':db['CmHopper'][_0x79d2('0x29')],'transaction':_0x1336e4,'lock':_0x1336e4['LOCK'][_0x79d2('0x21')],'include':_0x46f40d[_0x79d2('0x6')]?_0x46f40d[_0x79d2('0x6')][_0x79d2('0xb')]?_[_0x79d2('0xc')](_0x46f40d[_0x79d2('0x6')]['include'],function(_0x1f5c17){return{'model':db[_0x1f5c17[_0x79d2('0xd')]],'as':_0x1f5c17['as'],'attributes':_0x1f5c17[_0x79d2('0x9')],'include':_0x1f5c17[_0x79d2('0xb')]?_[_0x79d2('0xc')](_0x1f5c17[_0x79d2('0xb')],function(_0x3b84db){return{'model':db[_0x3b84db[_0x79d2('0xd')]],'as':_0x3b84db['as'],'attributes':_0x3b84db[_0x79d2('0x9')],'include':_0x3b84db[_0x79d2('0xb')]?_[_0x79d2('0xc')](_0x3b84db['include'],function(_0x215926){return{'model':db[_0x215926[_0x79d2('0xd')]],'as':_0x215926['as'],'attributes':_0x215926[_0x79d2('0x9')]};}):[]};}):[]};}):[]:[]})[_0x79d2('0x16')](function(_0x237848){var _0x515ae9=[];for(var _0x6122d0=0x0;_0x6122d0<_0x237848[_0x79d2('0x28')];_0x6122d0+=0x1){_0x515ae9[_0x79d2('0x2a')](_0x237848[_0x6122d0]['update'](_0x46f40d[_0x79d2('0x18')],{'transaction':_0x1336e4}));}return BPromise['all'](_0x515ae9);});})[_0x79d2('0x16')](function(_0x1d90e3){logger[_0x79d2('0xe')](_0x79d2('0x38'),_0x46f40d);logger['debug'](_0x79d2('0x38'),_0x46f40d,JSON['stringify'](_0x1d90e3));_0x5d29bb(_0x1d90e3);})['catch'](function(_0x53f233){logger[_0x79d2('0x12')]('GetContactRecallMe',_0x53f233['message'],_0x46f40d);_0x15f4ec(_0x43711c['error'](0x1f4,_0x53f233['message']));});});});};exports['GetCmHopperPreview']=function(_0x150f80){var _0x330b51=this;return new Promise(function(_0x4e4d33,_0x348e9c){db['CmContact'][_0x79d2('0x1d')]()[_0x79d2('0x16')](function(_0x3e8ad0){return db[_0x79d2('0x15')][_0x79d2('0x5')]({'raw':_0x150f80[_0x79d2('0x6')]?_0x150f80[_0x79d2('0x6')][_0x79d2('0x7')]===undefined?!![]:![]:!![],'where':_0x150f80[_0x79d2('0x6')]?_0x150f80[_0x79d2('0x6')][_0x79d2('0x8')]||null:null,'attributes':_0x150f80[_0x79d2('0x6')]?_0x150f80[_0x79d2('0x6')]['attributes']||null:null,'limit':_0x150f80['options']?_0x150f80[_0x79d2('0x6')][_0x79d2('0xa')]||null:null,'include':_0x150f80['options']?_0x150f80['options'][_0x79d2('0xb')]?_[_0x79d2('0xc')](_0x150f80[_0x79d2('0x6')][_0x79d2('0xb')],function(_0x4759ad){return{'model':db[_0x4759ad[_0x79d2('0xd')]],'as':_0x4759ad['as'],'attributes':_0x4759ad['as']==='Contact'?_['keys'](_0x3e8ad0):_0x4759ad[_0x79d2('0x9')],'include':_0x4759ad[_0x79d2('0xb')]?_[_0x79d2('0xc')](_0x4759ad['include'],function(_0x45d57e){return{'model':db[_0x45d57e[_0x79d2('0xd')]],'as':_0x45d57e['as'],'attributes':_0x45d57e[_0x79d2('0x9')],'include':_0x45d57e[_0x79d2('0xb')]?_['map'](_0x45d57e[_0x79d2('0xb')],function(_0x37252a){return{'model':db[_0x37252a['model']],'as':_0x37252a['as'],'attributes':_0x37252a[_0x79d2('0x9')]};}):[]};}):[]};}):[]:[]})[_0x79d2('0x16')](function(_0x1802bf){logger[_0x79d2('0xe')](_0x79d2('0x4'),_0x150f80);logger['debug'](_0x79d2('0x4'),_0x150f80,JSON[_0x79d2('0x10')](_0x1802bf));_0x4e4d33(_0x1802bf);})['catch'](function(_0x493ae3){logger[_0x79d2('0x12')](_0x79d2('0x4'),_0x493ae3[_0x79d2('0x13')],_0x150f80);_0x348e9c(_0x330b51['error'](0x1f4,_0x493ae3['message']));});});});};exports[_0x79d2('0x39')]=function(_0x5f2bbc){var _0x244c31=this;return new Promise(function(_0x547343,_0x8924cc){return db[_0x79d2('0x22')][_0x79d2('0x3a')]({'raw':!![],'where':{'phone':_0x5f2bbc['options'][_0x79d2('0x8')][_0x79d2('0x3b')]},'attributes':['id','dialTimezone'],'order':[['id',_0x79d2('0x3c')]]})[_0x79d2('0x16')](function(_0x30f003){logger[_0x79d2('0xe')]('getContactByPhone',_0x5f2bbc);logger[_0x79d2('0xf')](_0x79d2('0x3d'),_0x5f2bbc,JSON[_0x79d2('0x10')](_0x30f003));_0x547343(_0x30f003);})[_0x79d2('0x11')](function(_0x17eaf5){logger[_0x79d2('0x12')]('getContactByPhone',_0x17eaf5[_0x79d2('0x13')],_0x5f2bbc);_0x8924cc(_0x244c31[_0x79d2('0x12')](0x1f4,_0x17eaf5[_0x79d2('0x13')]));});});};exports[_0x79d2('0x3e')]=function(_0x27e216){var _0x28e4d4=this;return new Promise(function(_0x2c16d9,_0x33f58d){return db[_0x79d2('0x1e')][_0x79d2('0x1f')](function(_0x2430d6){var _0x46ae7b=_0x27e216['options']&&_0x27e216[_0x79d2('0x6')][_0x79d2('0x8')]?_0x27e216[_0x79d2('0x6')][_0x79d2('0x8')]:{};return db['CmHopper'][_0x79d2('0x3f')](_0x27e216[_0x79d2('0x18')],{'where':_0x46ae7b,'transaction':_0x2430d6})[_0x79d2('0x16')](function(_0x3cf2a3){logger[_0x79d2('0xe')](_0x79d2('0x3e'),_0x27e216);logger[_0x79d2('0xf')](_0x79d2('0x3e'),_0x27e216,JSON[_0x79d2('0x10')](_0x3cf2a3));_0x2c16d9(_0x3cf2a3);})[_0x79d2('0x11')](function(_0x336c95){logger[_0x79d2('0x12')](_0x79d2('0x3e'),_0x336c95[_0x79d2('0x13')],_0x27e216);_0x33f58d(_0x28e4d4[_0x79d2('0x12')](0x1f4,_0x336c95[_0x79d2('0x13')]));});});});};exports[_0x79d2('0x40')]=function(_0x4c7727){var _0x170352=this;var _0x987c5b=_0x4c7727[_0x79d2('0x18')][_0x79d2('0x8')][_0x79d2('0x41')];var _0xa6b10c=_0x4c7727[_0x79d2('0x18')]['where'][_0x79d2('0x42')];var _0x2ec144=_0x4c7727[_0x79d2('0x18')][_0x79d2('0x8')][_0x79d2('0x43')];return new Promise(function(_0x34d3bf,_0x5b2052){return db[_0x79d2('0x15')][_0x79d2('0x5')]({'where':{'voiceQueueId':{'$in':_0x987c5b},'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$and':{'$lte':db[_0x79d2('0x1e')][_0x79d2('0x44')]('NOW()\x20+\x20INTERVAL\x20'+_0xa6b10c+_0x79d2('0x45')),'$gt':db[_0x79d2('0x1e')][_0x79d2('0x44')](_0x79d2('0x46'))}},'UserId':{'$in':_0x2ec144}},'include':[{'model':db[_0x79d2('0x22')],'as':_0x79d2('0x23')},{'model':db[_0x79d2('0x25')],'as':'Agent','attributes':['id','name',_0x79d2('0x27')]},{'model':db['CmList'],'as':'List'}]})[_0x79d2('0x16')](function(_0x1d6f15){if(_0x1d6f15[_0x79d2('0x28')]>0x0){return db['sequelize'][_0x79d2('0x1f')](function(_0x48200c){return db[_0x79d2('0x15')]['update']({'recallmeNotifiedDate':db[_0x79d2('0x1e')][_0x79d2('0x44')](_0x79d2('0x46'))},{'where':{'id':{'$in':_[_0x79d2('0xc')](_0x1d6f15,'id')}},'transaction':_0x48200c})[_0x79d2('0x16')](function(){_0x34d3bf(_0x1d6f15);})[_0x79d2('0x11')](function(_0x273c03){logger[_0x79d2('0x12')](_0x79d2('0x40'),_0x273c03[_0x79d2('0x13')],_0x4c7727);_0x5b2052(_0x170352[_0x79d2('0x12')](0x1f4,_0x273c03['message']));});})['catch'](function(_0x58049a){logger[_0x79d2('0x12')](_0x79d2('0x40'),_0x58049a[_0x79d2('0x13')],_0x4c7727);_0x5b2052(_0x170352['error'](0x1f4,_0x58049a['message']));});}else{_0x34d3bf(_0x1d6f15);}});});}; \ No newline at end of file +var _0xd1c1=['voicePause','length','push','update','includes','all','GetContactDialer\x20hopperId\x20[%s]\x20-\x20contactId\x20[%s]\x20-\x20active\x20status\x20[%s]','dataValues','sequelize','CmHopperFinal','MoveContactManagedDialer\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','MoveContactManagedDialer','CountReScheduled','COUNT','`scheduledat`\x20>=\x20','format','\x22%s\x22','YYYY-MM-DD\x20HH:mm:ss','\x20,\x201,\x20null','contactsRescheduled','GetContactRecallMe','order','UserId','LOCK','GetCmHopperPreview','findOne','phone','dialTimezone','DESC','getContactByPhone','ResetActiveCalls','CmHopperHandlePreviewRecallNotifications','voiceQueueIds','interval','literal','NOW()\x20+\x20INTERVAL\x20','\x20MINUTE','NOW()','CmList','List','lodash','util','../../mysqldb','../../config/logger','rpc','GetCmHopper','findAll','options','raw','attributes','include','model','then','info','debug','stringify','error','message','CmHopper','find','where','map','ShowCmHopper','catch','CreateCmHopper','create','body','limit','UpdateCmHopper\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','active','UpdateCmHopper','DestroyCmHopper','destroy','GetContactDialer','CmContact','describe','transaction','UPDATE','Contact','keys','User','Agent','name'];(function(_0x5b34c0,_0x3ad403){var _0x242bd3=function(_0x51d0ce){while(--_0x51d0ce){_0x5b34c0['push'](_0x5b34c0['shift']());}};_0x242bd3(++_0x3ad403);}(_0xd1c1,0x7b));var _0x1d1c=function(_0x347399,_0x42bbda){_0x347399=_0x347399-0x0;var _0x24e7be=_0xd1c1[_0x347399];return _0x24e7be;};'use strict';var _=require(_0x1d1c('0x0'));var util=require(_0x1d1c('0x1'));var moment=require('moment');var BPromise=require('bluebird');var db=require(_0x1d1c('0x2'))['db'];var logger=require(_0x1d1c('0x3'))(_0x1d1c('0x4'));exports[_0x1d1c('0x5')]=function(_0x261aed){var _0x1881e3=this;return new Promise(function(_0x10ec72,_0x36591a){return db['CmHopper'][_0x1d1c('0x6')]({'raw':_0x261aed['options']?_0x261aed[_0x1d1c('0x7')][_0x1d1c('0x8')]===undefined?!![]:![]:!![],'where':_0x261aed[_0x1d1c('0x7')]?_0x261aed[_0x1d1c('0x7')]['where']||null:null,'attributes':_0x261aed[_0x1d1c('0x7')]?_0x261aed[_0x1d1c('0x7')][_0x1d1c('0x9')]||null:null,'limit':_0x261aed['options']?_0x261aed['options']['limit']||null:null,'include':_0x261aed[_0x1d1c('0x7')]?_0x261aed[_0x1d1c('0x7')][_0x1d1c('0xa')]?_['map'](_0x261aed[_0x1d1c('0x7')][_0x1d1c('0xa')],function(_0x3d4748){return{'model':db[_0x3d4748[_0x1d1c('0xb')]],'as':_0x3d4748['as'],'attributes':_0x3d4748['attributes'],'include':_0x3d4748[_0x1d1c('0xa')]?_['map'](_0x3d4748[_0x1d1c('0xa')],function(_0x4e7b52){return{'model':db[_0x4e7b52[_0x1d1c('0xb')]],'as':_0x4e7b52['as'],'attributes':_0x4e7b52[_0x1d1c('0x9')],'include':_0x4e7b52['include']?_['map'](_0x4e7b52[_0x1d1c('0xa')],function(_0x49f3c8){return{'model':db[_0x49f3c8[_0x1d1c('0xb')]],'as':_0x49f3c8['as'],'attributes':_0x49f3c8[_0x1d1c('0x9')]};}):[]};}):[]};}):[]:[]})[_0x1d1c('0xc')](function(_0xd1fbb0){logger[_0x1d1c('0xd')](_0x1d1c('0x5'),_0x261aed);logger[_0x1d1c('0xe')](_0x1d1c('0x5'),_0x261aed,JSON[_0x1d1c('0xf')](_0xd1fbb0));_0x10ec72(_0xd1fbb0);})['catch'](function(_0x4ca0ac){logger[_0x1d1c('0x10')]('GetCmHopper',_0x4ca0ac['message'],_0x261aed);_0x36591a(_0x1881e3[_0x1d1c('0x10')](0x1f4,_0x4ca0ac[_0x1d1c('0x11')]));});});};exports['ShowCmHopper']=function(_0x3678f7){var _0x74eea1=this;return new Promise(function(_0x316f58,_0x178af4){return db[_0x1d1c('0x12')][_0x1d1c('0x13')]({'raw':_0x3678f7[_0x1d1c('0x7')]?_0x3678f7[_0x1d1c('0x7')][_0x1d1c('0x8')]===undefined?!![]:![]:!![],'where':_0x3678f7[_0x1d1c('0x7')]?_0x3678f7['options'][_0x1d1c('0x14')]||null:null,'attributes':_0x3678f7[_0x1d1c('0x7')]?_0x3678f7['options'][_0x1d1c('0x9')]||null:null,'include':_0x3678f7[_0x1d1c('0x7')]?_0x3678f7[_0x1d1c('0x7')]['include']?_[_0x1d1c('0x15')](_0x3678f7[_0x1d1c('0x7')][_0x1d1c('0xa')],function(_0x53c763){return{'model':db[_0x53c763[_0x1d1c('0xb')]],'as':_0x53c763['as'],'attributes':_0x53c763[_0x1d1c('0x9')],'include':_0x53c763[_0x1d1c('0xa')]?_[_0x1d1c('0x15')](_0x53c763[_0x1d1c('0xa')],function(_0x4a4e5e){return{'model':db[_0x4a4e5e[_0x1d1c('0xb')]],'as':_0x4a4e5e['as'],'attributes':_0x4a4e5e[_0x1d1c('0x9')],'include':_0x4a4e5e[_0x1d1c('0xa')]?_[_0x1d1c('0x15')](_0x4a4e5e['include'],function(_0x49ed9b){return{'model':db[_0x49ed9b[_0x1d1c('0xb')]],'as':_0x49ed9b['as'],'attributes':_0x49ed9b[_0x1d1c('0x9')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x111ef4){logger[_0x1d1c('0xd')](_0x1d1c('0x16'),_0x3678f7);logger[_0x1d1c('0xe')](_0x1d1c('0x16'),_0x3678f7,JSON['stringify'](_0x111ef4));_0x316f58(_0x111ef4);})[_0x1d1c('0x17')](function(_0x50dd1b){logger[_0x1d1c('0x10')]('ShowCmHopper',_0x50dd1b[_0x1d1c('0x11')],_0x3678f7);_0x178af4(_0x74eea1[_0x1d1c('0x10')](0x1f4,_0x50dd1b[_0x1d1c('0x11')]));});});};exports[_0x1d1c('0x18')]=function(_0x1e0303){var _0x170358=this;return new Promise(function(_0x57d0e6,_0x474951){return db[_0x1d1c('0x12')][_0x1d1c('0x19')](_0x1e0303[_0x1d1c('0x1a')],{'raw':_0x1e0303['options']?_0x1e0303[_0x1d1c('0x7')][_0x1d1c('0x8')]===undefined?!![]:![]:!![]})[_0x1d1c('0xc')](function(_0x931b8b){logger[_0x1d1c('0xd')](_0x1d1c('0x18'),_0x1e0303);logger[_0x1d1c('0xe')](_0x1d1c('0x18'),_0x1e0303,JSON[_0x1d1c('0xf')](_0x931b8b));_0x57d0e6(_0x931b8b);})['catch'](function(_0x1b86c2){logger[_0x1d1c('0x10')](_0x1d1c('0x18'),_0x1b86c2[_0x1d1c('0x11')],_0x1e0303);_0x474951(_0x170358['error'](0x1f4,_0x1b86c2[_0x1d1c('0x11')]));});});};exports['UpdateCmHopper']=function(_0x3183ed){var _0x2cbc1f=this;return new Promise(function(_0x4cabc5,_0x1a9d71){return db[_0x1d1c('0x12')]['update'](_0x3183ed[_0x1d1c('0x1a')],{'raw':_0x3183ed['options']?_0x3183ed['options'][_0x1d1c('0x8')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3183ed[_0x1d1c('0x7')]?_0x3183ed[_0x1d1c('0x7')][_0x1d1c('0x14')]||null:null,'attributes':_0x3183ed[_0x1d1c('0x7')]?_0x3183ed['options'][_0x1d1c('0x9')]||null:null,'limit':_0x3183ed['options']?_0x3183ed['options'][_0x1d1c('0x1b')]||null:null})['then'](function(_0x1eab53){logger[_0x1d1c('0xd')]('UpdateCmHopper',_0x3183ed);logger[_0x1d1c('0xd')](_0x1d1c('0x1c'),JSON[_0x1d1c('0xf')](_0x3183ed[_0x1d1c('0x7')][_0x1d1c('0x14')]),_0x3183ed[_0x1d1c('0x1a')][_0x1d1c('0x1d')]);logger[_0x1d1c('0xe')]('UpdateCmHopper',_0x3183ed,JSON[_0x1d1c('0xf')](_0x1eab53));_0x4cabc5(_0x1eab53);})[_0x1d1c('0x17')](function(_0xea0756){logger[_0x1d1c('0x10')](_0x1d1c('0x1e'),_0xea0756[_0x1d1c('0x11')],_0x3183ed);_0x1a9d71(_0x2cbc1f[_0x1d1c('0x10')](0x1f4,_0xea0756[_0x1d1c('0x11')]));});});};exports[_0x1d1c('0x1f')]=function(_0x88720){var _0x465bd4=this;return new Promise(function(_0x1d8a5f,_0x5cca63){return db['CmHopper'][_0x1d1c('0x20')]({'where':_0x88720['options']?_0x88720[_0x1d1c('0x7')][_0x1d1c('0x14')]||null:null})['then'](function(_0x4363d0){logger[_0x1d1c('0xd')](_0x1d1c('0x1f'),_0x88720);logger[_0x1d1c('0xe')](_0x1d1c('0x1f'),_0x88720,JSON['stringify'](_0x4363d0));_0x1d8a5f(_0x4363d0);})['catch'](function(_0x16ab5b){logger['error'](_0x1d1c('0x1f'),_0x16ab5b[_0x1d1c('0x11')],_0x88720);_0x5cca63(_0x465bd4[_0x1d1c('0x10')](0x1f4,_0x16ab5b[_0x1d1c('0x11')]));});});};exports[_0x1d1c('0x21')]=function(_0x2a44a3){var _0x1893ca=this;return new Promise(function(_0x58fdf6,_0x1b920f){return db[_0x1d1c('0x22')][_0x1d1c('0x23')]()[_0x1d1c('0xc')](function(_0x2e13e5){return db['sequelize'][_0x1d1c('0x24')](function(_0x47b73a){return db[_0x1d1c('0x12')][_0x1d1c('0x6')]({'where':_0x2a44a3[_0x1d1c('0x7')]?_0x2a44a3['options'][_0x1d1c('0x14')]||null:null,'attributes':_0x2a44a3['options']?_0x2a44a3[_0x1d1c('0x7')][_0x1d1c('0x9')]||null:null,'limit':_0x2a44a3['options']?_0x2a44a3[_0x1d1c('0x7')][_0x1d1c('0x1b')]||null:null,'order':_0x2a44a3['options']?_0x2a44a3[_0x1d1c('0x7')]['order']||null:null,'transaction':_0x47b73a,'lock':_0x47b73a['LOCK'][_0x1d1c('0x25')],'include':[{'model':db[_0x1d1c('0x22')],'as':_0x1d1c('0x26'),'attributes':_[_0x1d1c('0x27')](_0x2e13e5)},{'model':db[_0x1d1c('0x28')],'as':_0x1d1c('0x29'),'attributes':['id',_0x1d1c('0x2a'),_0x1d1c('0x2b')]}]})[_0x1d1c('0xc')](function(_0x2cc8d7){var _0x437e61=[];var _0xc02302=[];for(var _0x3dc4a7=0x0;_0x3dc4a7<_0x2cc8d7[_0x1d1c('0x2c')];_0x3dc4a7+=0x1){var _0x1841de=_0x2cc8d7[_0x3dc4a7]['UserId'];if(_0x1841de===null){_0x437e61[_0x1d1c('0x2d')](_0x2cc8d7[_0x3dc4a7][_0x1d1c('0x2e')](_0x2a44a3['body'],{'transaction':_0x47b73a}));}else if(!_0xc02302[_0x1d1c('0x2f')](_0x1841de)){_0xc02302[_0x1d1c('0x2d')](_0x1841de);_0x437e61[_0x1d1c('0x2d')](_0x2cc8d7[_0x3dc4a7][_0x1d1c('0x2e')](_0x2a44a3[_0x1d1c('0x1a')],{'transaction':_0x47b73a}));}}return BPromise[_0x1d1c('0x30')](_0x437e61);});})[_0x1d1c('0xc')](function(_0x15c46f){logger[_0x1d1c('0xd')](_0x1d1c('0x21'),_0x2a44a3);if(_0x15c46f['length']>0x0){logger[_0x1d1c('0xd')](_0x1d1c('0x31'),_0x15c46f[0x0][_0x1d1c('0x32')]['id'],_0x15c46f[0x0][_0x1d1c('0x32')]['ContactId'],_0x15c46f[0x0][_0x1d1c('0x32')][_0x1d1c('0x1d')]);}logger[_0x1d1c('0xe')](_0x1d1c('0x21'),_0x2a44a3,JSON[_0x1d1c('0xf')](_0x15c46f));_0x58fdf6(_0x15c46f);})['catch'](function(_0x3401c6){logger[_0x1d1c('0x10')](_0x1d1c('0x21'),_0x3401c6[_0x1d1c('0x11')],_0x2a44a3);_0x1b920f(_0x1893ca[_0x1d1c('0x10')](0x1f4,_0x3401c6['message']));});});});};exports['MoveContactManagedDialer']=function(_0x90f7d6){var _0x849753=this;return new Promise(function(_0x1c5abc,_0x2fbf1a){return db[_0x1d1c('0x33')][_0x1d1c('0x24')](function(_0x5d84a5){return db[_0x1d1c('0x34')][_0x1d1c('0x19')](_0x90f7d6[_0x1d1c('0x1a')],{'raw':_0x90f7d6[_0x1d1c('0x7')]?_0x90f7d6['options'][_0x1d1c('0x8')]===undefined?!![]:![]:!![],'transaction':_0x5d84a5})[_0x1d1c('0xc')](function(){logger['info'](_0x1d1c('0x35'),JSON[_0x1d1c('0xf')](_0x90f7d6[_0x1d1c('0x7')][_0x1d1c('0x14')]),_0x90f7d6[_0x1d1c('0x7')][_0x1d1c('0x14')]['active']);return db[_0x1d1c('0x12')][_0x1d1c('0x20')]({'where':_0x90f7d6['options']?_0x90f7d6[_0x1d1c('0x7')][_0x1d1c('0x14')]||null:null,'transaction':_0x5d84a5});});})[_0x1d1c('0xc')](function(_0x1f0bc2){logger['info'](_0x1d1c('0x36'),_0x90f7d6);logger[_0x1d1c('0xe')](_0x1d1c('0x36'),_0x90f7d6,JSON['stringify'](_0x1f0bc2));_0x1c5abc(_0x1f0bc2);})[_0x1d1c('0x17')](function(_0x146b4f){logger[_0x1d1c('0x10')]('MoveContactManagedDialer',_0x146b4f[_0x1d1c('0x11')],_0x90f7d6);_0x2fbf1a(_0x849753['error'](0x1f4,_0x146b4f[_0x1d1c('0x11')]));});});};exports[_0x1d1c('0x37')]=function(_0x5cd182){var _0x4b3520=this;return new Promise(function(_0x1bf657,_0x3495cd){return db[_0x1d1c('0x12')][_0x1d1c('0x6')]({'raw':_0x5cd182[_0x1d1c('0x7')]?_0x5cd182[_0x1d1c('0x7')][_0x1d1c('0x8')]===undefined?!![]:![]:!![],'where':_0x5cd182['options']?_0x5cd182[_0x1d1c('0x7')]['where']||null:null,'attributes':[[db[_0x1d1c('0x33')]['fn'](_0x1d1c('0x38'),db[_0x1d1c('0x33')]['fn']('IF',db[_0x1d1c('0x33')]['literal'](_0x1d1c('0x39')+util[_0x1d1c('0x3a')](_0x1d1c('0x3b'),moment()['format'](_0x1d1c('0x3c')))+_0x1d1c('0x3d')))),_0x1d1c('0x3e')]]})[_0x1d1c('0xc')](function(_0x57d906){logger[_0x1d1c('0xd')](_0x1d1c('0x37'),_0x5cd182);logger[_0x1d1c('0xe')](_0x1d1c('0x37'),_0x5cd182,JSON[_0x1d1c('0xf')](_0x57d906));_0x1bf657(_0x57d906);})[_0x1d1c('0x17')](function(_0x2d40d0){logger['error']('CountReScheduled',_0x2d40d0[_0x1d1c('0x11')],_0x5cd182);_0x3495cd(_0x4b3520[_0x1d1c('0x10')](0x1f4,_0x2d40d0[_0x1d1c('0x11')]));});});};exports[_0x1d1c('0x3f')]=function(_0x3be51f){var _0x26de3b=this;return new Promise(function(_0x17c548,_0x237e20){return db['CmContact'][_0x1d1c('0x23')]()[_0x1d1c('0xc')](function(){return db['sequelize']['transaction'](function(_0x2dd69b){return db[_0x1d1c('0x12')][_0x1d1c('0x6')]({'where':_0x3be51f['options']?_0x3be51f[_0x1d1c('0x7')][_0x1d1c('0x14')]||null:null,'attributes':_0x3be51f[_0x1d1c('0x7')]?_0x3be51f['options'][_0x1d1c('0x9')]||null:null,'limit':0x1,'order':_0x3be51f['options']?_0x3be51f[_0x1d1c('0x7')][_0x1d1c('0x40')]||null:null,'group':db['CmHopper'][_0x1d1c('0x41')],'transaction':_0x2dd69b,'lock':_0x2dd69b[_0x1d1c('0x42')]['UPDATE'],'include':_0x3be51f[_0x1d1c('0x7')]?_0x3be51f['options']['include']?_[_0x1d1c('0x15')](_0x3be51f[_0x1d1c('0x7')][_0x1d1c('0xa')],function(_0x445d88){return{'model':db[_0x445d88[_0x1d1c('0xb')]],'as':_0x445d88['as'],'attributes':_0x445d88[_0x1d1c('0x9')],'include':_0x445d88['include']?_['map'](_0x445d88[_0x1d1c('0xa')],function(_0xec9117){return{'model':db[_0xec9117[_0x1d1c('0xb')]],'as':_0xec9117['as'],'attributes':_0xec9117[_0x1d1c('0x9')],'include':_0xec9117[_0x1d1c('0xa')]?_['map'](_0xec9117[_0x1d1c('0xa')],function(_0x1b5825){return{'model':db[_0x1b5825[_0x1d1c('0xb')]],'as':_0x1b5825['as'],'attributes':_0x1b5825[_0x1d1c('0x9')]};}):[]};}):[]};}):[]:[]})[_0x1d1c('0xc')](function(_0x3e9ec5){var _0x2abce8=[];for(var _0x1eb738=0x0;_0x1eb738<_0x3e9ec5[_0x1d1c('0x2c')];_0x1eb738+=0x1){_0x2abce8[_0x1d1c('0x2d')](_0x3e9ec5[_0x1eb738][_0x1d1c('0x2e')](_0x3be51f['body'],{'transaction':_0x2dd69b}));}return BPromise[_0x1d1c('0x30')](_0x2abce8);});})[_0x1d1c('0xc')](function(_0x3e63f7){logger[_0x1d1c('0xd')](_0x1d1c('0x3f'),_0x3be51f);logger[_0x1d1c('0xe')](_0x1d1c('0x3f'),_0x3be51f,JSON[_0x1d1c('0xf')](_0x3e63f7));_0x17c548(_0x3e63f7);})['catch'](function(_0x65c101){logger[_0x1d1c('0x10')]('GetContactRecallMe',_0x65c101['message'],_0x3be51f);_0x237e20(_0x26de3b[_0x1d1c('0x10')](0x1f4,_0x65c101[_0x1d1c('0x11')]));});});});};exports[_0x1d1c('0x43')]=function(_0x39643a){var _0x160eaf=this;return new Promise(function(_0x2a364b,_0x3343c6){db['CmContact']['describe']()[_0x1d1c('0xc')](function(_0x4e38a6){return db[_0x1d1c('0x12')]['findAll']({'raw':_0x39643a['options']?_0x39643a[_0x1d1c('0x7')][_0x1d1c('0x8')]===undefined?!![]:![]:!![],'where':_0x39643a['options']?_0x39643a['options'][_0x1d1c('0x14')]||null:null,'attributes':_0x39643a[_0x1d1c('0x7')]?_0x39643a[_0x1d1c('0x7')][_0x1d1c('0x9')]||null:null,'limit':_0x39643a[_0x1d1c('0x7')]?_0x39643a[_0x1d1c('0x7')][_0x1d1c('0x1b')]||null:null,'include':_0x39643a['options']?_0x39643a['options'][_0x1d1c('0xa')]?_[_0x1d1c('0x15')](_0x39643a['options'][_0x1d1c('0xa')],function(_0x3167f4){return{'model':db[_0x3167f4[_0x1d1c('0xb')]],'as':_0x3167f4['as'],'attributes':_0x3167f4['as']===_0x1d1c('0x26')?_[_0x1d1c('0x27')](_0x4e38a6):_0x3167f4[_0x1d1c('0x9')],'include':_0x3167f4[_0x1d1c('0xa')]?_['map'](_0x3167f4[_0x1d1c('0xa')],function(_0x1bfb37){return{'model':db[_0x1bfb37[_0x1d1c('0xb')]],'as':_0x1bfb37['as'],'attributes':_0x1bfb37[_0x1d1c('0x9')],'include':_0x1bfb37[_0x1d1c('0xa')]?_[_0x1d1c('0x15')](_0x1bfb37[_0x1d1c('0xa')],function(_0x193ad4){return{'model':db[_0x193ad4[_0x1d1c('0xb')]],'as':_0x193ad4['as'],'attributes':_0x193ad4[_0x1d1c('0x9')]};}):[]};}):[]};}):[]:[]})[_0x1d1c('0xc')](function(_0x48d00b){logger['info'](_0x1d1c('0x5'),_0x39643a);logger[_0x1d1c('0xe')](_0x1d1c('0x5'),_0x39643a,JSON['stringify'](_0x48d00b));_0x2a364b(_0x48d00b);})[_0x1d1c('0x17')](function(_0x49ef86){logger['error']('GetCmHopper',_0x49ef86[_0x1d1c('0x11')],_0x39643a);_0x3343c6(_0x160eaf['error'](0x1f4,_0x49ef86[_0x1d1c('0x11')]));});});});};exports['GetContactByPhone']=function(_0x20f578){var _0x3b77d9=this;return new Promise(function(_0x3b70a3,_0x338205){return db[_0x1d1c('0x22')][_0x1d1c('0x44')]({'raw':!![],'where':{'phone':_0x20f578[_0x1d1c('0x7')][_0x1d1c('0x14')][_0x1d1c('0x45')]},'attributes':['id',_0x1d1c('0x46')],'order':[['id',_0x1d1c('0x47')]]})[_0x1d1c('0xc')](function(_0x223ed6){logger[_0x1d1c('0xd')](_0x1d1c('0x48'),_0x20f578);logger[_0x1d1c('0xe')](_0x1d1c('0x48'),_0x20f578,JSON[_0x1d1c('0xf')](_0x223ed6));_0x3b70a3(_0x223ed6);})[_0x1d1c('0x17')](function(_0x46328f){logger[_0x1d1c('0x10')](_0x1d1c('0x48'),_0x46328f['message'],_0x20f578);_0x338205(_0x3b77d9['error'](0x1f4,_0x46328f['message']));});});};exports['ResetActiveCalls']=function(_0x228ec5){var _0x240a40=this;return new Promise(function(_0x2cc841,_0x27c0ca){return db[_0x1d1c('0x33')]['transaction'](function(_0x180bec){var _0x19cd5c=_0x228ec5[_0x1d1c('0x7')]&&_0x228ec5[_0x1d1c('0x7')]['where']?_0x228ec5[_0x1d1c('0x7')][_0x1d1c('0x14')]:{};return db[_0x1d1c('0x12')][_0x1d1c('0x2e')](_0x228ec5[_0x1d1c('0x1a')],{'where':_0x19cd5c,'transaction':_0x180bec})[_0x1d1c('0xc')](function(_0x26280a){logger['info'](_0x1d1c('0x49'),_0x228ec5);logger[_0x1d1c('0xe')](_0x1d1c('0x49'),_0x228ec5,JSON['stringify'](_0x26280a));_0x2cc841(_0x26280a);})[_0x1d1c('0x17')](function(_0x22a136){logger[_0x1d1c('0x10')]('ResetActiveCalls',_0x22a136[_0x1d1c('0x11')],_0x228ec5);_0x27c0ca(_0x240a40[_0x1d1c('0x10')](0x1f4,_0x22a136[_0x1d1c('0x11')]));});});});};exports[_0x1d1c('0x4a')]=function(_0x1d6890){var _0x24d0e8=this;var _0x487371=_0x1d6890[_0x1d1c('0x1a')]['where'][_0x1d1c('0x4b')];var _0x3fe12e=_0x1d6890[_0x1d1c('0x1a')][_0x1d1c('0x14')][_0x1d1c('0x4c')];var _0x9816dd=_0x1d6890['body']['where']['availableAgentsIds'];return new Promise(function(_0x1c023a,_0x591443){return db['CmHopper'][_0x1d1c('0x6')]({'where':{'voiceQueueId':{'$in':_0x487371},'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$and':{'$lte':db['sequelize'][_0x1d1c('0x4d')](_0x1d1c('0x4e')+_0x3fe12e+_0x1d1c('0x4f')),'$gt':db[_0x1d1c('0x33')][_0x1d1c('0x4d')](_0x1d1c('0x50'))}},'UserId':{'$in':_0x9816dd}},'include':[{'model':db[_0x1d1c('0x22')],'as':_0x1d1c('0x26')},{'model':db[_0x1d1c('0x28')],'as':_0x1d1c('0x29'),'attributes':['id','name','voicePause']},{'model':db[_0x1d1c('0x51')],'as':_0x1d1c('0x52')}]})[_0x1d1c('0xc')](function(_0x4726e1){if(_0x4726e1['length']>0x0){return db[_0x1d1c('0x33')][_0x1d1c('0x24')](function(_0x236444){return db[_0x1d1c('0x12')][_0x1d1c('0x2e')]({'recallmeNotifiedDate':db[_0x1d1c('0x33')]['literal'](_0x1d1c('0x50'))},{'where':{'id':{'$in':_['map'](_0x4726e1,'id')}},'transaction':_0x236444})[_0x1d1c('0xc')](function(){_0x1c023a(_0x4726e1);})[_0x1d1c('0x17')](function(_0x46d490){logger['error'](_0x1d1c('0x4a'),_0x46d490['message'],_0x1d6890);_0x591443(_0x24d0e8[_0x1d1c('0x10')](0x1f4,_0x46d490[_0x1d1c('0x11')]));});})[_0x1d1c('0x17')](function(_0x19ccdf){logger[_0x1d1c('0x10')]('CmHopperHandlePreviewRecallNotifications',_0x19ccdf[_0x1d1c('0x11')],_0x1d6890);_0x591443(_0x24d0e8['error'](0x1f4,_0x19ccdf['message']));});}else{_0x1c023a(_0x4726e1);}});});}; \ No newline at end of file diff --git a/server/api/cmHopper/index.js b/server/api/cmHopper/index.js index 8ce4032..153ed00 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 _0x696a=['create','/preview','getPreview','post','/timezone','getTimezone','put','update','delete','destroy','express','Router','./cmHopper.controller','get','index','/describe','isAuthenticated','describe','/opencontacts','getOpenContacts','/timezones','getTimezones','/:id','/:id/previewrecall','getPreviewRecall'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x696a,0x104));var _0xa696=function(_0x946518,_0x22816f){_0x946518=_0x946518-0x0;var _0x909b69=_0x696a[_0x946518];return _0x909b69;};'use strict';var express=require(_0xa696('0x0'));var router=express[_0xa696('0x1')]();var auth=require('../../components/auth/service');var controller=require(_0xa696('0x2'));router[_0xa696('0x3')]('/',auth['isAuthenticated'](),controller[_0xa696('0x4')]);router['get'](_0xa696('0x5'),auth[_0xa696('0x6')](),controller[_0xa696('0x7')]);router[_0xa696('0x3')](_0xa696('0x8'),auth[_0xa696('0x6')](),controller[_0xa696('0x9')]);router[_0xa696('0x3')](_0xa696('0xa'),auth[_0xa696('0x6')](),controller[_0xa696('0xb')]);router[_0xa696('0x3')](_0xa696('0xc'),auth[_0xa696('0x6')](),controller['show']);router['get'](_0xa696('0xd'),auth['isAuthenticated'](),controller[_0xa696('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0xa696('0xf')]);router['post'](_0xa696('0x10'),auth[_0xa696('0x6')](),controller[_0xa696('0x11')]);router[_0xa696('0x12')](_0xa696('0x13'),auth['isAuthenticated'](),controller[_0xa696('0x14')]);router[_0xa696('0x15')](_0xa696('0xc'),auth[_0xa696('0x6')](),controller[_0xa696('0x16')]);router[_0xa696('0x17')](_0xa696('0xc'),auth[_0xa696('0x6')](),controller[_0xa696('0x18')]);module['exports']=router; \ No newline at end of file +var _0xda4f=['post','/preview','getPreview','/timezone','getTimezone','put','update','delete','exports','express','Router','../../components/auth/service','get','isAuthenticated','/describe','getOpenContacts','/timezones','/:id','show','/:id/previewrecall','getPreviewRecall'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0xda4f,0x72));var _0xfda4=function(_0xd32b03,_0x3939d3){_0xd32b03=_0xd32b03-0x0;var _0x3e027c=_0xda4f[_0xd32b03];return _0x3e027c;};'use strict';var express=require(_0xfda4('0x0'));var router=express[_0xfda4('0x1')]();var auth=require(_0xfda4('0x2'));var controller=require('./cmHopper.controller');router[_0xfda4('0x3')]('/',auth[_0xfda4('0x4')](),controller['index']);router[_0xfda4('0x3')](_0xfda4('0x5'),auth['isAuthenticated'](),controller['describe']);router[_0xfda4('0x3')]('/opencontacts',auth[_0xfda4('0x4')](),controller[_0xfda4('0x6')]);router[_0xfda4('0x3')](_0xfda4('0x7'),auth[_0xfda4('0x4')](),controller['getTimezones']);router['get'](_0xfda4('0x8'),auth[_0xfda4('0x4')](),controller[_0xfda4('0x9')]);router['get'](_0xfda4('0xa'),auth[_0xfda4('0x4')](),controller[_0xfda4('0xb')]);router[_0xfda4('0xc')]('/',auth['isAuthenticated'](),controller['create']);router[_0xfda4('0xc')](_0xfda4('0xd'),auth['isAuthenticated'](),controller[_0xfda4('0xe')]);router[_0xfda4('0xc')](_0xfda4('0xf'),auth[_0xfda4('0x4')](),controller[_0xfda4('0x10')]);router[_0xfda4('0x11')](_0xfda4('0x8'),auth[_0xfda4('0x4')](),controller[_0xfda4('0x12')]);router[_0xfda4('0x13')](_0xfda4('0x8'),auth[_0xfda4('0x4')](),controller['destroy']);module[_0xfda4('0x14')]=router; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.attributes.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.attributes.js index 3b79338..546814d 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 _0xf165=['YYYY-MM-DD\x20HH:mm:ss','moment','sequelize','exports','STRING','INTEGER','DATE'];(function(_0x3c4737,_0x2329ec){var _0x2bb926=function(_0x3b9605){while(--_0x3b9605){_0x3c4737['push'](_0x3c4737['shift']());}};_0x2bb926(++_0x2329ec);}(_0xf165,0x16d));var _0x5f16=function(_0x4559ee,_0x261282){_0x4559ee=_0x4559ee-0x0;var _0x3302ad=_0xf165[_0x4559ee];return _0x3302ad;};'use strict';var moment=require(_0x5f16('0x0'));var Sequelize=require(_0x5f16('0x1'));module[_0x5f16('0x2')]={'CmHopperId':{'type':Sequelize['INTEGER']},'phone':{'type':Sequelize[_0x5f16('0x3')],'allowNull':![]},'OrderBy':{'type':Sequelize[_0x5f16('0x4')],'defaultValue':0x0},'scheduledat':{'type':Sequelize[_0x5f16('0x5')],'defaultValue':moment()['format'](_0x5f16('0x6'))},'countbusyretry':{'type':Sequelize[_0x5f16('0x4')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x5f16('0x4')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x5f16('0x4')],'defaultValue':0x0},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x5f16('0x4')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x5f16('0x4')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x6584=['INTEGER','STRING','YYYY-MM-DD\x20HH:mm:ss','moment','sequelize','exports'];(function(_0x43a0aa,_0x56498f){var _0x248ae4=function(_0x3c7411){while(--_0x3c7411){_0x43a0aa['push'](_0x43a0aa['shift']());}};_0x248ae4(++_0x56498f);}(_0x6584,0x11d));var _0x4658=function(_0x1034ca,_0x14ecd6){_0x1034ca=_0x1034ca-0x0;var _0x1a023a=_0x6584[_0x1034ca];return _0x1a023a;};'use strict';var moment=require(_0x4658('0x0'));var Sequelize=require(_0x4658('0x1'));module[_0x4658('0x2')]={'CmHopperId':{'type':Sequelize[_0x4658('0x3')]},'phone':{'type':Sequelize[_0x4658('0x4')],'allowNull':![]},'OrderBy':{'type':Sequelize[_0x4658('0x3')],'defaultValue':0x0},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':moment()['format'](_0x4658('0x5'))},'countbusyretry':{'type':Sequelize[_0x4658('0x3')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x4658('0x3')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x4658('0x3')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x4658('0x3')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x4658('0x3')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.controller.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.controller.js index c91b2da..65e36b9 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 _0x61cc=['userProfileId','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','apply','update','then','destroy','get','CmHopperAdditionalPhones','name','send','index','map','rawAttributes','fieldName','type','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','VIRTUAL','options','CmHopperAdditionalPhone','include','rows','catch','params','intersection','find','create','body','user','role','UserProfileSection'];(function(_0x4cb8e5,_0x410906){var _0x5f5331=function(_0x299188){while(--_0x299188){_0x4cb8e5['push'](_0x4cb8e5['shift']());}};_0x5f5331(++_0x410906);}(_0x61cc,0x19a));var _0xc61c=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x61cc[_0x3947c9];return _0x2e7871;};'use strict';var emlformat=require(_0xc61c('0x0'));var rimraf=require(_0xc61c('0x1'));var zipdir=require(_0xc61c('0x2'));var jsonpatch=require(_0xc61c('0x3'));var rp=require(_0xc61c('0x4'));var moment=require(_0xc61c('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xc61c('0x6'));var util=require(_0xc61c('0x7'));var path=require(_0xc61c('0x8'));var sox=require(_0xc61c('0x9'));var csv=require(_0xc61c('0xa'));var ejs=require(_0xc61c('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc61c('0xc'));var squel=require(_0xc61c('0xd'));var crypto=require('crypto');var jsforce=require(_0xc61c('0xe'));var deskjs=require(_0xc61c('0xf'));var toCsv=require(_0xc61c('0xa'));var querystring=require(_0xc61c('0x10'));var Papa=require(_0xc61c('0x11'));var Redis=require(_0xc61c('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc61c('0x13'));var logger=require(_0xc61c('0x14'))(_0xc61c('0x15'));var utils=require(_0xc61c('0x16'));var config=require(_0xc61c('0x17'));var licenseUtil=require(_0xc61c('0x18'));var db=require(_0xc61c('0x19'))['db'];function respondWithStatusCode(_0x580aad,_0x2960f7){_0x2960f7=_0x2960f7||0xcc;return function(_0x4a0e94){if(_0x4a0e94){return _0x580aad[_0xc61c('0x1a')](_0x2960f7);}return _0x580aad[_0xc61c('0x1b')](_0x2960f7)[_0xc61c('0x1c')]();};}function respondWithResult(_0x5b4206,_0x37b8f3){_0x37b8f3=_0x37b8f3||0xc8;return function(_0xd11859){if(_0xd11859){return _0x5b4206['status'](_0x37b8f3)[_0xc61c('0x1d')](_0xd11859);}};}function respondWithFilteredResult(_0x4a5efc,_0x4882be){return function(_0xaf4bfc){if(_0xaf4bfc){var _0x1c66ad=typeof _0x4882be[_0xc61c('0x1e')]==='undefined'&&typeof _0x4882be[_0xc61c('0x1f')]===_0xc61c('0x20');var _0x3de2f2=_0xaf4bfc['count'];var _0x5c009f=_0x1c66ad?0x0:_0x4882be[_0xc61c('0x1e')];var _0x344188=_0x1c66ad?_0xaf4bfc[_0xc61c('0x21')]:_0x4882be['offset']+_0x4882be['limit'];var _0x35c460;if(_0x344188>=_0x3de2f2){_0x344188=_0x3de2f2;_0x35c460=0xc8;}else{_0x35c460=0xce;}_0x4a5efc[_0xc61c('0x1b')](_0x35c460);return _0x4a5efc['set'](_0xc61c('0x22'),_0x5c009f+'-'+_0x344188+'/'+_0x3de2f2)['json'](_0xaf4bfc);}return null;};}function patchUpdates(_0x49d0df){return function(_0x2c9dfb){try{jsonpatch[_0xc61c('0x23')](_0x2c9dfb,_0x49d0df,!![]);}catch(_0x2ccd29){return BPromise['reject'](_0x2ccd29);}return _0x2c9dfb['save']();};}function saveUpdates(_0x4cb33e,_0xd3967f){return function(_0x419401){if(_0x419401){return _0x419401[_0xc61c('0x24')](_0x4cb33e)[_0xc61c('0x25')](function(_0x15ae2a){return _0x15ae2a;});}return null;};}function removeEntity(_0x1850f4,_0x490baa){return function(_0x344c5a){if(_0x344c5a){return _0x344c5a[_0xc61c('0x26')]()['then'](function(){var _0x8451a4=_0x344c5a[_0xc61c('0x27')]({'plain':!![]});var _0x4e4a4e=_0xc61c('0x28');return db['UserProfileResource'][_0xc61c('0x26')]({'where':{'type':_0x4e4a4e,'resourceId':_0x8451a4['id']}})['then'](function(){return _0x344c5a;});})['then'](function(){_0x1850f4[_0xc61c('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x493317,_0x42c629){return function(_0x3c64d9){if(!_0x3c64d9){_0x493317[_0xc61c('0x1a')](0x194);}return _0x3c64d9;};}function handleError(_0x171e7f,_0x527fd9){_0x527fd9=_0x527fd9||0x1f4;return function(_0x1b5236){logger['error'](_0x1b5236['stack']);if(_0x1b5236['name']){delete _0x1b5236[_0xc61c('0x29')];}_0x171e7f[_0xc61c('0x1b')](_0x527fd9)[_0xc61c('0x2a')](_0x1b5236);};}exports[_0xc61c('0x2b')]=function(_0x37b6f5,_0xfd4c0c){var _0x591319={},_0x13b334={},_0x48387a={'count':0x0,'rows':[]};var _0x27e797=_[_0xc61c('0x2c')](db['CmHopperAdditionalPhone'][_0xc61c('0x2d')],function(_0x306a93){return{'name':_0x306a93[_0xc61c('0x2e')],'type':_0x306a93[_0xc61c('0x2f')]['key']};});_0x13b334[_0xc61c('0x30')]=_[_0xc61c('0x2c')](_0x27e797,'name');_0x13b334[_0xc61c('0x31')]=_[_0xc61c('0x32')](_0x37b6f5[_0xc61c('0x31')]);_0x13b334[_0xc61c('0x33')]=_['intersection'](_0x13b334[_0xc61c('0x30')],_0x13b334['query']);_0x591319[_0xc61c('0x34')]=_['intersection'](_0x13b334[_0xc61c('0x30')],qs[_0xc61c('0x35')](_0x37b6f5[_0xc61c('0x31')][_0xc61c('0x35')]));_0x591319['attributes']=_0x591319[_0xc61c('0x34')][_0xc61c('0x36')]?_0x591319['attributes']:_0x13b334['model'];if(!_0x37b6f5[_0xc61c('0x31')][_0xc61c('0x37')](_0xc61c('0x38'))){_0x591319[_0xc61c('0x1f')]=qs['limit'](_0x37b6f5['query'][_0xc61c('0x1f')]);_0x591319[_0xc61c('0x1e')]=qs[_0xc61c('0x1e')](_0x37b6f5[_0xc61c('0x31')][_0xc61c('0x1e')]);}_0x591319['order']=qs[_0xc61c('0x39')](_0x37b6f5['query']['sort']);_0x591319['where']=qs[_0xc61c('0x33')](_[_0xc61c('0x3a')](_0x37b6f5[_0xc61c('0x31')],_0x13b334[_0xc61c('0x33')]),_0x27e797);if(_0x37b6f5['query'][_0xc61c('0x3b')]){_0x591319[_0xc61c('0x3c')]=_[_0xc61c('0x3d')](_0x591319[_0xc61c('0x3c')],{'$or':_['map'](_0x27e797,function(_0x3c8911){if(_0x3c8911[_0xc61c('0x2f')]!==_0xc61c('0x3e')){var _0x5a6b48={};_0x5a6b48[_0x3c8911[_0xc61c('0x29')]]={'$like':'%'+_0x37b6f5['query'][_0xc61c('0x3b')]+'%'};return _0x5a6b48;}})});}_0x591319=_[_0xc61c('0x3d')]({},_0x591319,_0x37b6f5[_0xc61c('0x3f')]);var _0x35dd8e={'where':_0x591319[_0xc61c('0x3c')]};return db[_0xc61c('0x40')][_0xc61c('0x21')](_0x35dd8e)[_0xc61c('0x25')](function(_0xac11b4){_0x48387a[_0xc61c('0x21')]=_0xac11b4;if(_0x37b6f5[_0xc61c('0x31')]['includeAll']){_0x591319[_0xc61c('0x41')]=[{'all':!![]}];}return db[_0xc61c('0x40')]['findAll'](_0x591319);})[_0xc61c('0x25')](function(_0x5f968f){_0x48387a[_0xc61c('0x42')]=_0x5f968f;return _0x48387a;})[_0xc61c('0x25')](respondWithFilteredResult(_0xfd4c0c,_0x591319))[_0xc61c('0x43')](handleError(_0xfd4c0c,null));};exports['show']=function(_0x4edf52,_0xffd86){var _0x25d9e4={'raw':!![],'where':{'id':_0x4edf52[_0xc61c('0x44')]['id']}},_0x25c05b={};_0x25c05b[_0xc61c('0x30')]=_[_0xc61c('0x32')](db[_0xc61c('0x40')][_0xc61c('0x2d')]);_0x25c05b[_0xc61c('0x31')]=_[_0xc61c('0x32')](_0x4edf52[_0xc61c('0x31')]);_0x25c05b['filters']=_[_0xc61c('0x45')](_0x25c05b['model'],_0x25c05b[_0xc61c('0x31')]);_0x25d9e4['attributes']=_[_0xc61c('0x45')](_0x25c05b[_0xc61c('0x30')],qs[_0xc61c('0x35')](_0x4edf52['query'][_0xc61c('0x35')]));_0x25d9e4[_0xc61c('0x34')]=_0x25d9e4[_0xc61c('0x34')][_0xc61c('0x36')]?_0x25d9e4[_0xc61c('0x34')]:_0x25c05b[_0xc61c('0x30')];if(_0x4edf52[_0xc61c('0x31')]['includeAll']){_0x25d9e4['include']=[{'all':!![]}];}_0x25d9e4=_[_0xc61c('0x3d')]({},_0x25d9e4,_0x4edf52[_0xc61c('0x3f')]);return db[_0xc61c('0x40')][_0xc61c('0x46')](_0x25d9e4)[_0xc61c('0x25')](handleEntityNotFound(_0xffd86,null))['then'](respondWithResult(_0xffd86,null))[_0xc61c('0x43')](handleError(_0xffd86,null));};exports[_0xc61c('0x47')]=function(_0x35b584,_0x7b4fdf){return db['CmHopperAdditionalPhone'][_0xc61c('0x47')](_0x35b584[_0xc61c('0x48')],{})[_0xc61c('0x25')](function(_0x395336){var _0x16a897=_0x35b584[_0xc61c('0x49')][_0xc61c('0x27')]({'plain':!![]});if(!_0x16a897)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x16a897[_0xc61c('0x4a')]===_0xc61c('0x49')){var _0x320dde=_0x395336[_0xc61c('0x27')]({'plain':!![]});var _0x1fa614=_0xc61c('0x28');return db[_0xc61c('0x4b')][_0xc61c('0x46')]({'where':{'name':_0x1fa614,'userProfileId':_0x16a897[_0xc61c('0x4c')]},'raw':!![]})[_0xc61c('0x25')](function(_0x384d52){if(_0x384d52&&_0x384d52[_0xc61c('0x4d')]===0x0){return db[_0xc61c('0x4e')]['create']({'name':_0x320dde[_0xc61c('0x29')],'resourceId':_0x320dde['id'],'type':_0x384d52[_0xc61c('0x29')],'sectionId':_0x384d52['id']},{})['then'](function(){return _0x395336;});}else{return _0x395336;}})[_0xc61c('0x43')](function(_0x2e1fb5){logger[_0xc61c('0x4f')](_0xc61c('0x50'),_0x2e1fb5);throw _0x2e1fb5;});}return _0x395336;})[_0xc61c('0x25')](respondWithResult(_0x7b4fdf,0xc9))[_0xc61c('0x43')](handleError(_0x7b4fdf,null));};exports[_0xc61c('0x24')]=function(_0x571809,_0x14ca88){if(_0x571809[_0xc61c('0x48')]['id']){delete _0x571809[_0xc61c('0x48')]['id'];}return db[_0xc61c('0x40')]['find']({'where':{'id':_0x571809[_0xc61c('0x44')]['id']}})[_0xc61c('0x25')](handleEntityNotFound(_0x14ca88,null))['then'](saveUpdates(_0x571809['body'],null))['then'](respondWithResult(_0x14ca88,null))[_0xc61c('0x43')](handleError(_0x14ca88,null));};exports['destroy']=function(_0x242e9b,_0x285985){return db[_0xc61c('0x40')][_0xc61c('0x46')]({'where':{'id':_0x242e9b['params']['id']}})['then'](handleEntityNotFound(_0x285985,null))[_0xc61c('0x25')](removeEntity(_0x285985,null))['catch'](handleError(_0x285985,null));}; \ No newline at end of file +var _0x29d6=['user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','create','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','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','CmHopperAdditionalPhones','UserProfileResource','error','stack','name','send','index','map','CmHopperAdditionalPhone','rawAttributes','fieldName','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','merge','VIRTUAL','filter','includeAll','findAll','rows','catch','show','include','find','body'];(function(_0x171462,_0x489a7e){var _0x5c4ab2=function(_0x25fa78){while(--_0x25fa78){_0x171462['push'](_0x171462['shift']());}};_0x5c4ab2(++_0x489a7e);}(_0x29d6,0x1c0));var _0x629d=function(_0x473698,_0x24371c){_0x473698=_0x473698-0x0;var _0xf60fa5=_0x29d6[_0x473698];return _0xf60fa5;};'use strict';var emlformat=require(_0x629d('0x0'));var rimraf=require(_0x629d('0x1'));var zipdir=require(_0x629d('0x2'));var jsonpatch=require(_0x629d('0x3'));var rp=require(_0x629d('0x4'));var moment=require(_0x629d('0x5'));var BPromise=require(_0x629d('0x6'));var Mustache=require(_0x629d('0x7'));var util=require(_0x629d('0x8'));var path=require('path');var sox=require(_0x629d('0x9'));var csv=require(_0x629d('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x629d('0xb'));var squel=require(_0x629d('0xc'));var crypto=require(_0x629d('0xd'));var jsforce=require(_0x629d('0xe'));var deskjs=require(_0x629d('0xf'));var toCsv=require(_0x629d('0xa'));var querystring=require(_0x629d('0x10'));var Papa=require(_0x629d('0x11'));var Redis=require(_0x629d('0x12'));var authService=require(_0x629d('0x13'));var qs=require(_0x629d('0x14'));var as=require(_0x629d('0x15'));var hardwareService=require(_0x629d('0x16'));var logger=require(_0x629d('0x17'))(_0x629d('0x18'));var utils=require('../../config/utils');var config=require(_0x629d('0x19'));var licenseUtil=require(_0x629d('0x1a'));var db=require(_0x629d('0x1b'))['db'];function respondWithStatusCode(_0x14983c,_0x659a58){_0x659a58=_0x659a58||0xcc;return function(_0x4668f2){if(_0x4668f2){return _0x14983c[_0x629d('0x1c')](_0x659a58);}return _0x14983c[_0x629d('0x1d')](_0x659a58)[_0x629d('0x1e')]();};}function respondWithResult(_0x57c7e0,_0x13c0ba){_0x13c0ba=_0x13c0ba||0xc8;return function(_0x26f65e){if(_0x26f65e){return _0x57c7e0[_0x629d('0x1d')](_0x13c0ba)[_0x629d('0x1f')](_0x26f65e);}};}function respondWithFilteredResult(_0xac9435,_0x58fdbc){return function(_0x18457f){if(_0x18457f){var _0x5cbd28=typeof _0x58fdbc[_0x629d('0x20')]===_0x629d('0x21')&&typeof _0x58fdbc[_0x629d('0x22')]==='undefined';var _0x52f4b3=_0x18457f[_0x629d('0x23')];var _0x295a63=_0x5cbd28?0x0:_0x58fdbc[_0x629d('0x20')];var _0x40267f=_0x5cbd28?_0x18457f[_0x629d('0x23')]:_0x58fdbc[_0x629d('0x20')]+_0x58fdbc[_0x629d('0x22')];var _0x267c4c;if(_0x40267f>=_0x52f4b3){_0x40267f=_0x52f4b3;_0x267c4c=0xc8;}else{_0x267c4c=0xce;}_0xac9435['status'](_0x267c4c);return _0xac9435[_0x629d('0x24')](_0x629d('0x25'),_0x295a63+'-'+_0x40267f+'/'+_0x52f4b3)[_0x629d('0x1f')](_0x18457f);}return null;};}function patchUpdates(_0x32747a){return function(_0x778bef){try{jsonpatch[_0x629d('0x26')](_0x778bef,_0x32747a,!![]);}catch(_0x38b145){return BPromise[_0x629d('0x27')](_0x38b145);}return _0x778bef[_0x629d('0x28')]();};}function saveUpdates(_0x167dc7,_0x2b5b75){return function(_0xf52445){if(_0xf52445){return _0xf52445[_0x629d('0x29')](_0x167dc7)[_0x629d('0x2a')](function(_0x481bd1){return _0x481bd1;});}return null;};}function removeEntity(_0x1299c8,_0x2f2915){return function(_0x39f100){if(_0x39f100){return _0x39f100[_0x629d('0x2b')]()['then'](function(){var _0x7983cf=_0x39f100[_0x629d('0x2c')]({'plain':!![]});var _0x1362ed=_0x629d('0x2d');return db[_0x629d('0x2e')][_0x629d('0x2b')]({'where':{'type':_0x1362ed,'resourceId':_0x7983cf['id']}})[_0x629d('0x2a')](function(){return _0x39f100;});})[_0x629d('0x2a')](function(){_0x1299c8[_0x629d('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0xb28daa,_0x25dda3){return function(_0x450d1b){if(!_0x450d1b){_0xb28daa[_0x629d('0x1c')](0x194);}return _0x450d1b;};}function handleError(_0x18829e,_0x10fa47){_0x10fa47=_0x10fa47||0x1f4;return function(_0x199b96){logger[_0x629d('0x2f')](_0x199b96[_0x629d('0x30')]);if(_0x199b96[_0x629d('0x31')]){delete _0x199b96[_0x629d('0x31')];}_0x18829e['status'](_0x10fa47)[_0x629d('0x32')](_0x199b96);};}exports[_0x629d('0x33')]=function(_0x34ac08,_0x9fda61){var _0x1db7d3={},_0x479529={},_0x1a587b={'count':0x0,'rows':[]};var _0x173d3e=_[_0x629d('0x34')](db[_0x629d('0x35')][_0x629d('0x36')],function(_0x344f87){return{'name':_0x344f87[_0x629d('0x37')],'type':_0x344f87[_0x629d('0x38')]['key']};});_0x479529[_0x629d('0x39')]=_['map'](_0x173d3e,_0x629d('0x31'));_0x479529[_0x629d('0x3a')]=_[_0x629d('0x3b')](_0x34ac08[_0x629d('0x3a')]);_0x479529['filters']=_[_0x629d('0x3c')](_0x479529[_0x629d('0x39')],_0x479529['query']);_0x1db7d3[_0x629d('0x3d')]=_[_0x629d('0x3c')](_0x479529[_0x629d('0x39')],qs[_0x629d('0x3e')](_0x34ac08[_0x629d('0x3a')][_0x629d('0x3e')]));_0x1db7d3[_0x629d('0x3d')]=_0x1db7d3['attributes'][_0x629d('0x3f')]?_0x1db7d3['attributes']:_0x479529['model'];if(!_0x34ac08[_0x629d('0x3a')][_0x629d('0x40')](_0x629d('0x41'))){_0x1db7d3[_0x629d('0x22')]=qs['limit'](_0x34ac08['query'][_0x629d('0x22')]);_0x1db7d3['offset']=qs[_0x629d('0x20')](_0x34ac08[_0x629d('0x3a')][_0x629d('0x20')]);}_0x1db7d3['order']=qs[_0x629d('0x42')](_0x34ac08[_0x629d('0x3a')]['sort']);_0x1db7d3[_0x629d('0x43')]=qs[_0x629d('0x44')](_['pick'](_0x34ac08[_0x629d('0x3a')],_0x479529[_0x629d('0x44')]),_0x173d3e);if(_0x34ac08[_0x629d('0x3a')]['filter']){_0x1db7d3['where']=_[_0x629d('0x45')](_0x1db7d3[_0x629d('0x43')],{'$or':_[_0x629d('0x34')](_0x173d3e,function(_0x28cc39){if(_0x28cc39[_0x629d('0x38')]!==_0x629d('0x46')){var _0x58cf3f={};_0x58cf3f[_0x28cc39[_0x629d('0x31')]]={'$like':'%'+_0x34ac08['query'][_0x629d('0x47')]+'%'};return _0x58cf3f;}})});}_0x1db7d3=_[_0x629d('0x45')]({},_0x1db7d3,_0x34ac08['options']);var _0x23d54d={'where':_0x1db7d3[_0x629d('0x43')]};return db['CmHopperAdditionalPhone']['count'](_0x23d54d)[_0x629d('0x2a')](function(_0xb3fa15){_0x1a587b['count']=_0xb3fa15;if(_0x34ac08[_0x629d('0x3a')][_0x629d('0x48')]){_0x1db7d3['include']=[{'all':!![]}];}return db[_0x629d('0x35')][_0x629d('0x49')](_0x1db7d3);})['then'](function(_0x26eeb8){_0x1a587b[_0x629d('0x4a')]=_0x26eeb8;return _0x1a587b;})['then'](respondWithFilteredResult(_0x9fda61,_0x1db7d3))[_0x629d('0x4b')](handleError(_0x9fda61,null));};exports[_0x629d('0x4c')]=function(_0x3b08c7,_0xac47b1){var _0x5c1b2e={'raw':!![],'where':{'id':_0x3b08c7['params']['id']}},_0x5a470a={};_0x5a470a[_0x629d('0x39')]=_[_0x629d('0x3b')](db[_0x629d('0x35')]['rawAttributes']);_0x5a470a['query']=_['keys'](_0x3b08c7[_0x629d('0x3a')]);_0x5a470a[_0x629d('0x44')]=_[_0x629d('0x3c')](_0x5a470a['model'],_0x5a470a['query']);_0x5c1b2e[_0x629d('0x3d')]=_[_0x629d('0x3c')](_0x5a470a[_0x629d('0x39')],qs[_0x629d('0x3e')](_0x3b08c7[_0x629d('0x3a')][_0x629d('0x3e')]));_0x5c1b2e['attributes']=_0x5c1b2e[_0x629d('0x3d')][_0x629d('0x3f')]?_0x5c1b2e['attributes']:_0x5a470a['model'];if(_0x3b08c7['query'][_0x629d('0x48')]){_0x5c1b2e[_0x629d('0x4d')]=[{'all':!![]}];}_0x5c1b2e=_[_0x629d('0x45')]({},_0x5c1b2e,_0x3b08c7['options']);return db[_0x629d('0x35')][_0x629d('0x4e')](_0x5c1b2e)['then'](handleEntityNotFound(_0xac47b1,null))[_0x629d('0x2a')](respondWithResult(_0xac47b1,null))[_0x629d('0x4b')](handleError(_0xac47b1,null));};exports['create']=function(_0x285d63,_0x4dcc22){return db[_0x629d('0x35')]['create'](_0x285d63[_0x629d('0x4f')],{})[_0x629d('0x2a')](function(_0x1b95d8){var _0x2154e5=_0x285d63[_0x629d('0x50')][_0x629d('0x2c')]({'plain':!![]});if(!_0x2154e5)throw new Error(_0x629d('0x51'));if(_0x2154e5[_0x629d('0x52')]===_0x629d('0x50')){var _0x1e7cbe=_0x1b95d8[_0x629d('0x2c')]({'plain':!![]});var _0x57bd99=_0x629d('0x2d');return db[_0x629d('0x53')][_0x629d('0x4e')]({'where':{'name':_0x57bd99,'userProfileId':_0x2154e5[_0x629d('0x54')]},'raw':!![]})[_0x629d('0x2a')](function(_0x2d625d){if(_0x2d625d&&_0x2d625d[_0x629d('0x55')]===0x0){return db[_0x629d('0x2e')][_0x629d('0x56')]({'name':_0x1e7cbe['name'],'resourceId':_0x1e7cbe['id'],'type':_0x2d625d[_0x629d('0x31')],'sectionId':_0x2d625d['id']},{})['then'](function(){return _0x1b95d8;});}else{return _0x1b95d8;}})['catch'](function(_0x5e7597){logger[_0x629d('0x2f')](_0x629d('0x57'),_0x5e7597);throw _0x5e7597;});}return _0x1b95d8;})['then'](respondWithResult(_0x4dcc22,0xc9))['catch'](handleError(_0x4dcc22,null));};exports['update']=function(_0x59ea36,_0x32f042){if(_0x59ea36[_0x629d('0x4f')]['id']){delete _0x59ea36[_0x629d('0x4f')]['id'];}return db[_0x629d('0x35')][_0x629d('0x4e')]({'where':{'id':_0x59ea36['params']['id']}})['then'](handleEntityNotFound(_0x32f042,null))[_0x629d('0x2a')](saveUpdates(_0x59ea36[_0x629d('0x4f')],null))[_0x629d('0x2a')](respondWithResult(_0x32f042,null))[_0x629d('0x4b')](handleError(_0x32f042,null));};exports[_0x629d('0x2b')]=function(_0x1ccfc6,_0x426030){return db['CmHopperAdditionalPhone'][_0x629d('0x4e')]({'where':{'id':_0x1ccfc6['params']['id']}})[_0x629d('0x2a')](handleEntityNotFound(_0x426030,null))[_0x629d('0x2a')](removeEntity(_0x426030,null))['catch'](handleError(_0x426030,null));}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model.js index 5bd7fde..76ff75f 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 _0xcff4=['../../config/logger','api','moment','bluebird','path','../../config/environment','./cmHopperAdditionalPhone.attributes','exports','define','cm_hopper_additional_phones','lodash','util'];(function(_0x5d80de,_0x2cf15d){var _0x1c7556=function(_0x5bd806){while(--_0x5bd806){_0x5d80de['push'](_0x5d80de['shift']());}};_0x1c7556(++_0x2cf15d);}(_0xcff4,0x11e));var _0x4cff=function(_0x4ffe01,_0x3a70ff){_0x4ffe01=_0x4ffe01-0x0;var _0x7d97d0=_0xcff4[_0x4ffe01];return _0x7d97d0;};'use strict';var _=require(_0x4cff('0x0'));var util=require(_0x4cff('0x1'));var logger=require(_0x4cff('0x2'))(_0x4cff('0x3'));var moment=require(_0x4cff('0x4'));var BPromise=require(_0x4cff('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4cff('0x6'));var rimraf=require('rimraf');var config=require(_0x4cff('0x7'));var attributes=require(_0x4cff('0x8'));module[_0x4cff('0x9')]=function(_0x46dfc1,_0x355206){return _0x46dfc1[_0x4cff('0xa')]('CmHopperAdditionalPhone',attributes,{'tableName':_0x4cff('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x15a8=['rimraf','./cmHopperAdditionalPhone.attributes','exports','define','CmHopperAdditionalPhone','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x474e3e,_0x101580){var _0x3f9ac9=function(_0x21d5b6){while(--_0x21d5b6){_0x474e3e['push'](_0x474e3e['shift']());}};_0x3f9ac9(++_0x101580);}(_0x15a8,0x6d));var _0x815a=function(_0x439be6,_0x11851f){_0x439be6=_0x439be6-0x0;var _0x56b386=_0x15a8[_0x439be6];return _0x56b386;};'use strict';var _=require(_0x815a('0x0'));var util=require(_0x815a('0x1'));var logger=require(_0x815a('0x2'))(_0x815a('0x3'));var moment=require(_0x815a('0x4'));var BPromise=require(_0x815a('0x5'));var rp=require(_0x815a('0x6'));var fs=require('fs');var path=require(_0x815a('0x7'));var rimraf=require(_0x815a('0x8'));var config=require('../../config/environment');var attributes=require(_0x815a('0x9'));module[_0x815a('0xa')]=function(_0x3a07eb,_0x4534e0){return _0x3a07eb[_0x815a('0xb')](_0x815a('0xc'),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 c95ff1e..115465e 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 _0x52b8=['message','result','CmHopper','findOne','body','ContactId','ListId','VoiceQueueId','CampaignId','CmHopperAdditionalPhone','OrderBy','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','entity','dialGlobalMaxRetry','ASC','VerifyAdditionalPhones','catch','SwapAdditionalPhones','duration','waitTime','scheduledat','add','minutes','isNil','createdAt','updatedAt','phone','sequelize','transaction','update','activateAdditionalPhone','IncrementPreviewCounters','field','util','bluebird','randomstring','../../mysqldb','../../config/logger','jayson/promise','http','request','then','info','request\x20sent','debug','CmHopperAdditionalPhone,\x20%s,\x20%s,\x20%s','stringify','error','code','CmHopperAdditionalPhone,\x20%s,\x20%s'];(function(_0x301c57,_0x2a278b){var _0x257205=function(_0x9ecfd7){while(--_0x9ecfd7){_0x301c57['push'](_0x301c57['shift']());}};_0x257205(++_0x2a278b);}(_0x52b8,0xd3));var _0x852b=function(_0x462b84,_0x419502){_0x462b84=_0x462b84-0x0;var _0x3ae6aa=_0x52b8[_0x462b84];return _0x3ae6aa;};'use strict';var _=require('lodash');var util=require(_0x852b('0x0'));var moment=require('moment');var BPromise=require(_0x852b('0x1'));var rs=require(_0x852b('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x852b('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x852b('0x4'))('rpc');var config=require('../../config/environment');var jayson=require(_0x852b('0x5'));var client=jayson['client'][_0x852b('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x270472,_0x4f7e7e,_0x51aaf5){return new BPromise(function(_0x480294,_0x375f86){return client[_0x852b('0x7')](_0x270472,_0x51aaf5)[_0x852b('0x8')](function(_0x2ae1e9){logger[_0x852b('0x9')]('CmHopperAdditionalPhone,\x20%s,\x20%s',_0x4f7e7e,_0x852b('0xa'));logger[_0x852b('0xb')](_0x852b('0xc'),_0x4f7e7e,_0x852b('0xa'),JSON[_0x852b('0xd')](_0x2ae1e9));if(_0x2ae1e9['error']){if(_0x2ae1e9[_0x852b('0xe')][_0x852b('0xf')]===0x1f4){logger['error'](_0x852b('0x10'),_0x4f7e7e,_0x2ae1e9[_0x852b('0xe')]['message']);return _0x375f86(_0x2ae1e9[_0x852b('0xe')][_0x852b('0x11')]);}logger[_0x852b('0xe')]('CmHopperAdditionalPhone,\x20%s,\x20%s',_0x4f7e7e,_0x2ae1e9[_0x852b('0xe')][_0x852b('0x11')]);return _0x480294(_0x2ae1e9[_0x852b('0xe')][_0x852b('0x11')]);}else{logger[_0x852b('0x9')](_0x852b('0x10'),_0x4f7e7e,_0x852b('0xa'));_0x480294(_0x2ae1e9[_0x852b('0x12')]['message']);}})['catch'](function(_0x2e5c4b){logger[_0x852b('0xe')](_0x852b('0x10'),_0x4f7e7e,_0x2e5c4b);_0x375f86(_0x2e5c4b);});});}exports['VerifyAdditionalPhones']=function(_0x406a0b){var _0x416a0e=this;return new Promise(function(_0x299153,_0x2cc2b9){return db[_0x852b('0x13')][_0x852b('0x14')]({'raw':!![],'where':{'ContactId':_0x406a0b[_0x852b('0x15')][_0x852b('0x16')],'ListId':_0x406a0b[_0x852b('0x15')][_0x852b('0x17')],'VoiceQueueId':_0x406a0b[_0x852b('0x15')][_0x852b('0x18')]===undefined?null:_0x406a0b[_0x852b('0x15')][_0x852b('0x18')],'CampaignId':_0x406a0b[_0x852b('0x15')][_0x852b('0x19')]===undefined?null:_0x406a0b[_0x852b('0x15')][_0x852b('0x19')]}})[_0x852b('0x8')](function(_0x2c0371){if(_0x2c0371!=null){return db[_0x852b('0x1a')][_0x852b('0x14')]({'raw':!![],'where':{'CmHopperId':_0x2c0371['id'],'OrderBy':{'$gt':_0x2c0371[_0x852b('0x1b')]}},'order':[[_0x852b('0x1b'),'ASC']]})['then'](function(_0x26f596){var _0x372401=0x0;if(_0x26f596){if(_0x26f596[_0x852b('0x1c')]+_0x26f596[_0x852b('0x1d')]+_0x26f596[_0x852b('0x1e')]+_0x26f596[_0x852b('0x1f')]+_0x26f596[_0x852b('0x20')]+_0x26f596[_0x852b('0x21')]+_0x26f596[_0x852b('0x22')]+_0x26f596[_0x852b('0x23')]<_0x406a0b[_0x852b('0x24')][_0x852b('0x25')])_0x372401=0x1;_0x299153({'additional':_0x372401});}else{return db['CmHopperAdditionalPhone']['findOne']({'raw':!![],'where':{'CmHopperId':_0x2c0371['id']},'order':[['OrderBy',_0x852b('0x26')]]})[_0x852b('0x8')](function(_0x33967b){var _0x399b1d=0x0;if(_0x33967b){if(_0x33967b[_0x852b('0x1c')]+_0x33967b[_0x852b('0x1d')]+_0x33967b[_0x852b('0x1e')]+_0x33967b[_0x852b('0x1f')]+_0x33967b[_0x852b('0x20')]+_0x33967b[_0x852b('0x21')]+_0x33967b['countmachineretry']+_0x33967b['countagentrejectretry']<_0x406a0b['entity']['dialGlobalMaxRetry'])_0x399b1d=0x1;_0x299153({'additional':_0x399b1d});}else{_0x299153({'additional':0x0});}})['catch'](function(_0x1ceb30){logger['error'](_0x852b('0x27'),_0x1ceb30[_0x852b('0x11')]);_0x2cc2b9(_0x416a0e[_0x852b('0xe')](0x1f4,_0x1ceb30[_0x852b('0x11')]));});}})[_0x852b('0x28')](function(_0x788147){logger[_0x852b('0xe')]('VerifyAdditionalPhones',_0x788147[_0x852b('0x11')]);_0x2cc2b9(_0x416a0e[_0x852b('0xe')](0x1f4,_0x788147[_0x852b('0x11')]));});}else _0x299153({'additional':0x0});});});};exports[_0x852b('0x29')]=function(_0x2903d5){var _0x445d11=this;return new Promise(function(_0xb84561,_0x5e16f3){return db[_0x852b('0x13')][_0x852b('0x14')]({'raw':!![],'where':{'ContactId':_0x2903d5[_0x852b('0x15')][_0x852b('0x16')],'ListId':_0x2903d5[_0x852b('0x15')]['ListId'],'VoiceQueueId':_0x2903d5[_0x852b('0x15')][_0x852b('0x18')]===undefined?null:_0x2903d5[_0x852b('0x15')][_0x852b('0x18')],'CampaignId':_0x2903d5[_0x852b('0x15')][_0x852b('0x19')]===undefined?null:_0x2903d5['body'][_0x852b('0x19')]}})['then'](function(_0x4860f4){if(_0x4860f4!=null){return db['CmHopperAdditionalPhone'][_0x852b('0x14')]({'raw':!![],'where':{'CmHopperId':_0x4860f4['id'],'OrderBy':{'$gte':_0x4860f4[_0x852b('0x1b')]}},'order':[['OrderBy','ASC']]})['then'](function(_0x76be9b){if(_0x76be9b)return activateAdditionalPhone(_0x4860f4,_0x2903d5['body'],_0x76be9b,_0x2903d5[_0x852b('0x2a')],_0x2903d5[_0x852b('0x2b')])[_0x852b('0x8')](function(_0x23dc8b){_0xb84561(_0x23dc8b);});else{return db[_0x852b('0x1a')][_0x852b('0x14')]({'raw':!![],'where':{'CmHopperId':_0x4860f4['id']},'order':[[_0x852b('0x1b'),_0x852b('0x26')]]})[_0x852b('0x8')](function(_0x5a8d6c){if(_0x5a8d6c)return activateAdditionalPhone(_0x4860f4,_0x2903d5[_0x852b('0x15')],_0x5a8d6c,_0x2903d5[_0x852b('0x2a')],_0x2903d5[_0x852b('0x2b')])['then'](function(_0x42b27d){_0xb84561(_0x42b27d);});else{_0xb84561({'id':_0x4860f4['id'],'phone':''});}})[_0x852b('0x28')](function(_0x5295e9){logger[_0x852b('0xe')](_0x852b('0x27'),_0x5295e9[_0x852b('0x11')]);_0x5e16f3(_0x445d11[_0x852b('0xe')](0x1f4,_0x5295e9['message']));});}})['catch'](function(_0x24e5fa){logger[_0x852b('0xe')](_0x852b('0x27'),_0x24e5fa['message']);_0x5e16f3(_0x445d11[_0x852b('0xe')](0x1f4,_0x24e5fa[_0x852b('0x11')]));});}else _0xb84561(0x1);});});};function activateAdditionalPhone(_0x150ef0,_0x4ce1ba,_0x23b889,_0x3db0b3,_0x43d19f){return new Promise(function(_0x5001e5,_0x5e12d6){var _0x148646;if(_['isNil'](_0x23b889['scheduledat'])){_0x23b889['scheduledat']=moment();}if(moment()>moment(_0x23b889[_0x852b('0x2c')])){_0x148646=moment()['add'](_0x43d19f||0x3,'minutes');}else{if(_0x23b889[_0x852b('0x1b')]==0x0){_0x148646=moment(_0x23b889[_0x852b('0x2c')]);}else{_0x148646=moment()[_0x852b('0x2d')](_0x43d19f||0x3,_0x852b('0x2e'));}}if(_[_0x852b('0x2f')](_0x148646)){_0x148646=moment()[_0x852b('0x2d')](_0x43d19f||0x3,'minutes');}var _0x33c875={'phone':_0x150ef0['phone'],'active':0x0,'OrderBy':_[_0x852b('0x2f')](_0x150ef0[_0x852b('0x1b')])?0x0:_0x150ef0[_0x852b('0x1b')],'scheduledat':moment()['add'](_0x3db0b3||0x1,_0x852b('0x2e')),'countbusyretry':_0x4ce1ba[_0x852b('0x1c')],'countcongestionretry':_0x4ce1ba[_0x852b('0x1d')],'countnoanswerretry':_0x4ce1ba[_0x852b('0x1e')],'countnosuchnumberretry':_0x4ce1ba[_0x852b('0x1f')],'countdropretry':_0x4ce1ba[_0x852b('0x20')],'countabandonedretry':_0x4ce1ba[_0x852b('0x21')],'countmachineretry':_0x4ce1ba[_0x852b('0x22')],'countagentrejectretry':_0x4ce1ba[_0x852b('0x23')],'createdAt':_0x4ce1ba[_0x852b('0x30')],'updatedAt':_0x4ce1ba[_0x852b('0x31')]};var _0x11224c={'CmHopperId':_0x150ef0['id'],'phone':_0x23b889[_0x852b('0x32')],'active':0x0,'OrderBy':_[_0x852b('0x2f')](_0x23b889['OrderBy'])?0x0:_0x23b889[_0x852b('0x1b')],'scheduledat':_0x148646,'countbusyretry':_0x23b889[_0x852b('0x1c')],'countcongestionretry':_0x23b889['countcongestionretry'],'countnoanswerretry':_0x23b889['countnoanswerretry'],'countnosuchnumberretry':_0x23b889[_0x852b('0x1f')],'countdropretry':_0x23b889[_0x852b('0x20')],'countabandonedretry':_0x23b889[_0x852b('0x21')],'countmachineretry':_0x23b889[_0x852b('0x22')],'countagentrejectretry':_0x23b889[_0x852b('0x23')],'createdAt':_0x23b889[_0x852b('0x30')],'updatedAt':_0x23b889[_0x852b('0x31')]};return db[_0x852b('0x33')][_0x852b('0x34')](function(_0x55e4c8){return db[_0x852b('0x1a')][_0x852b('0x35')](_0x33c875,{'where':{'id':_0x23b889['id']}},{'transaction':_0x55e4c8})[_0x852b('0x8')](function(){return db[_0x852b('0x13')][_0x852b('0x35')](_0x11224c,{'where':{'id':_0x150ef0['id']}},{'transaction':_0x55e4c8});});})['then'](function(_0x1b0ebc){_0x5001e5({'id':_0x150ef0['id'],'phone':_0x23b889[_0x852b('0x32')]});})['catch'](function(_0x1d53b8){logger[_0x852b('0xe')](_0x852b('0x36'),_0x1d53b8['message']);_0x5e12d6({'error':_0x1d53b8[_0x852b('0x11')]});});});}exports[_0x852b('0x37')]=function(_0x3f6883){var _0x33b7ba=this;return new Promise(function(_0x23584b,_0x117c0a){return db['CmHopper'][_0x852b('0x35')](_0x3f6883['body'][_0x852b('0x38')],{'where':{'id':_0x3f6883[_0x852b('0x15')]['id']}})[_0x852b('0x8')](function(_0x38357a){_0x23584b(_0x38357a);})[_0x852b('0x28')](function(_0x45858f){logger[_0x852b('0xe')]('IncrementPreviewCounters',_0x45858f[_0x852b('0x11')]);_0x117c0a(_0x33b7ba[_0x852b('0xe')](0x1f4,_0x45858f['message']));});});}; \ No newline at end of file +var _0x248d=['rpc','../../config/environment','jayson/promise','client','request','then','info','CmHopperAdditionalPhone,\x20%s,\x20%s','request\x20sent','debug','CmHopperAdditionalPhone,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CmHopper','body','ContactId','ListId','VoiceQueueId','CampaignId','CmHopperAdditionalPhone','findOne','OrderBy','ASC','countbusyretry','countcongestionretry','countnosuchnumberretry','countmachineretry','countagentrejectretry','countnoanswerretry','countdropretry','countabandonedretry','entity','dialGlobalMaxRetry','VerifyAdditionalPhones','SwapAdditionalPhones','duration','waitTime','isNil','scheduledat','add','minutes','phone','createdAt','updatedAt','sequelize','transaction','update','activateAdditionalPhone','field','IncrementPreviewCounters','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0x52ec77,_0x2d3ea2){var _0x2fd566=function(_0x1945df){while(--_0x1945df){_0x52ec77['push'](_0x52ec77['shift']());}};_0x2fd566(++_0x2d3ea2);}(_0x248d,0x74));var _0xd248=function(_0x1e53ba,_0x2f4c42){_0x1e53ba=_0x1e53ba-0x0;var _0x418b09=_0x248d[_0x1e53ba];return _0x418b09;};'use strict';var _=require(_0xd248('0x0'));var util=require(_0xd248('0x1'));var moment=require(_0xd248('0x2'));var BPromise=require(_0xd248('0x3'));var rs=require(_0xd248('0x4'));var fs=require('fs');var Redis=require(_0xd248('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xd248('0x6'));var logger=require(_0xd248('0x7'))(_0xd248('0x8'));var config=require(_0xd248('0x9'));var jayson=require(_0xd248('0xa'));var client=jayson[_0xd248('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2fba27,_0x27778f,_0x1bd232){return new BPromise(function(_0x3d33a8,_0x4292a3){return client[_0xd248('0xc')](_0x2fba27,_0x1bd232)[_0xd248('0xd')](function(_0x1b52ef){logger[_0xd248('0xe')](_0xd248('0xf'),_0x27778f,_0xd248('0x10'));logger[_0xd248('0x11')](_0xd248('0x12'),_0x27778f,'request\x20sent',JSON[_0xd248('0x13')](_0x1b52ef));if(_0x1b52ef[_0xd248('0x14')]){if(_0x1b52ef['error'][_0xd248('0x15')]===0x1f4){logger['error'](_0xd248('0xf'),_0x27778f,_0x1b52ef[_0xd248('0x14')][_0xd248('0x16')]);return _0x4292a3(_0x1b52ef[_0xd248('0x14')]['message']);}logger['error']('CmHopperAdditionalPhone,\x20%s,\x20%s',_0x27778f,_0x1b52ef['error'][_0xd248('0x16')]);return _0x3d33a8(_0x1b52ef['error']['message']);}else{logger[_0xd248('0xe')](_0xd248('0xf'),_0x27778f,'request\x20sent');_0x3d33a8(_0x1b52ef[_0xd248('0x17')][_0xd248('0x16')]);}})[_0xd248('0x18')](function(_0x1055a4){logger['error'](_0xd248('0xf'),_0x27778f,_0x1055a4);_0x4292a3(_0x1055a4);});});}exports['VerifyAdditionalPhones']=function(_0x1db22d){var _0x323091=this;return new Promise(function(_0x2255bb,_0x2d687e){return db[_0xd248('0x19')]['findOne']({'raw':!![],'where':{'ContactId':_0x1db22d[_0xd248('0x1a')][_0xd248('0x1b')],'ListId':_0x1db22d['body'][_0xd248('0x1c')],'VoiceQueueId':_0x1db22d['body'][_0xd248('0x1d')]===undefined?null:_0x1db22d[_0xd248('0x1a')][_0xd248('0x1d')],'CampaignId':_0x1db22d[_0xd248('0x1a')][_0xd248('0x1e')]===undefined?null:_0x1db22d[_0xd248('0x1a')][_0xd248('0x1e')]}})['then'](function(_0xfdb7dc){if(_0xfdb7dc!=null){return db[_0xd248('0x1f')][_0xd248('0x20')]({'raw':!![],'where':{'CmHopperId':_0xfdb7dc['id'],'OrderBy':{'$gt':_0xfdb7dc[_0xd248('0x21')]}},'order':[[_0xd248('0x21'),_0xd248('0x22')]]})[_0xd248('0xd')](function(_0x2a9105){var _0x35323c=0x0;if(_0x2a9105){if(_0x2a9105[_0xd248('0x23')]+_0x2a9105[_0xd248('0x24')]+_0x2a9105['countnoanswerretry']+_0x2a9105[_0xd248('0x25')]+_0x2a9105['countdropretry']+_0x2a9105['countabandonedretry']+_0x2a9105[_0xd248('0x26')]+_0x2a9105[_0xd248('0x27')]<_0x1db22d['entity']['dialGlobalMaxRetry'])_0x35323c=0x1;_0x2255bb({'additional':_0x35323c});}else{return db[_0xd248('0x1f')][_0xd248('0x20')]({'raw':!![],'where':{'CmHopperId':_0xfdb7dc['id']},'order':[[_0xd248('0x21'),_0xd248('0x22')]]})['then'](function(_0x41c631){var _0x9e5060=0x0;if(_0x41c631){if(_0x41c631[_0xd248('0x23')]+_0x41c631[_0xd248('0x24')]+_0x41c631[_0xd248('0x28')]+_0x41c631[_0xd248('0x25')]+_0x41c631[_0xd248('0x29')]+_0x41c631[_0xd248('0x2a')]+_0x41c631[_0xd248('0x26')]+_0x41c631[_0xd248('0x27')]<_0x1db22d[_0xd248('0x2b')][_0xd248('0x2c')])_0x9e5060=0x1;_0x2255bb({'additional':_0x9e5060});}else{_0x2255bb({'additional':0x0});}})[_0xd248('0x18')](function(_0x1d30cc){logger['error'](_0xd248('0x2d'),_0x1d30cc[_0xd248('0x16')]);_0x2d687e(_0x323091[_0xd248('0x14')](0x1f4,_0x1d30cc[_0xd248('0x16')]));});}})[_0xd248('0x18')](function(_0x314724){logger['error'](_0xd248('0x2d'),_0x314724[_0xd248('0x16')]);_0x2d687e(_0x323091['error'](0x1f4,_0x314724[_0xd248('0x16')]));});}else _0x2255bb({'additional':0x0});});});};exports[_0xd248('0x2e')]=function(_0x2cac2d){var _0x268a00=this;return new Promise(function(_0x3a8932,_0x144718){return db['CmHopper']['findOne']({'raw':!![],'where':{'ContactId':_0x2cac2d[_0xd248('0x1a')]['ContactId'],'ListId':_0x2cac2d[_0xd248('0x1a')][_0xd248('0x1c')],'VoiceQueueId':_0x2cac2d[_0xd248('0x1a')][_0xd248('0x1d')]===undefined?null:_0x2cac2d[_0xd248('0x1a')][_0xd248('0x1d')],'CampaignId':_0x2cac2d['body'][_0xd248('0x1e')]===undefined?null:_0x2cac2d['body'][_0xd248('0x1e')]}})[_0xd248('0xd')](function(_0xb3a271){if(_0xb3a271!=null){return db['CmHopperAdditionalPhone']['findOne']({'raw':!![],'where':{'CmHopperId':_0xb3a271['id'],'OrderBy':{'$gte':_0xb3a271[_0xd248('0x21')]}},'order':[[_0xd248('0x21'),_0xd248('0x22')]]})[_0xd248('0xd')](function(_0x5ad901){if(_0x5ad901)return activateAdditionalPhone(_0xb3a271,_0x2cac2d['body'],_0x5ad901,_0x2cac2d[_0xd248('0x2f')],_0x2cac2d['waitTime'])['then'](function(_0xd8fff9){_0x3a8932(_0xd8fff9);});else{return db[_0xd248('0x1f')][_0xd248('0x20')]({'raw':!![],'where':{'CmHopperId':_0xb3a271['id']},'order':[[_0xd248('0x21'),'ASC']]})[_0xd248('0xd')](function(_0x300ef5){if(_0x300ef5)return activateAdditionalPhone(_0xb3a271,_0x2cac2d[_0xd248('0x1a')],_0x300ef5,_0x2cac2d['duration'],_0x2cac2d[_0xd248('0x30')])[_0xd248('0xd')](function(_0x52c0d2){_0x3a8932(_0x52c0d2);});else{_0x3a8932({'id':_0xb3a271['id'],'phone':''});}})[_0xd248('0x18')](function(_0x5a192a){logger[_0xd248('0x14')](_0xd248('0x2d'),_0x5a192a['message']);_0x144718(_0x268a00['error'](0x1f4,_0x5a192a['message']));});}})[_0xd248('0x18')](function(_0x56219e){logger[_0xd248('0x14')]('VerifyAdditionalPhones',_0x56219e[_0xd248('0x16')]);_0x144718(_0x268a00[_0xd248('0x14')](0x1f4,_0x56219e[_0xd248('0x16')]));});}else _0x3a8932(0x1);});});};function activateAdditionalPhone(_0x32e67f,_0x41de02,_0x193ac7,_0x35491e,_0x4feddd){return new Promise(function(_0x3f8224,_0x4d6bf4){var _0x43179b;if(_[_0xd248('0x31')](_0x193ac7[_0xd248('0x32')])){_0x193ac7[_0xd248('0x32')]=moment();}if(moment()>moment(_0x193ac7[_0xd248('0x32')])){_0x43179b=moment()[_0xd248('0x33')](_0x4feddd||0x3,_0xd248('0x34'));}else{if(_0x193ac7[_0xd248('0x21')]==0x0){_0x43179b=moment(_0x193ac7['scheduledat']);}else{_0x43179b=moment()[_0xd248('0x33')](_0x4feddd||0x3,_0xd248('0x34'));}}if(_[_0xd248('0x31')](_0x43179b)){_0x43179b=moment()[_0xd248('0x33')](_0x4feddd||0x3,_0xd248('0x34'));}var _0x18ef99={'phone':_0x32e67f[_0xd248('0x35')],'active':0x0,'OrderBy':_[_0xd248('0x31')](_0x32e67f[_0xd248('0x21')])?0x0:_0x32e67f[_0xd248('0x21')],'scheduledat':moment()[_0xd248('0x33')](_0x35491e||0x1,_0xd248('0x34')),'countbusyretry':_0x41de02[_0xd248('0x23')],'countcongestionretry':_0x41de02['countcongestionretry'],'countnoanswerretry':_0x41de02[_0xd248('0x28')],'countnosuchnumberretry':_0x41de02[_0xd248('0x25')],'countdropretry':_0x41de02[_0xd248('0x29')],'countabandonedretry':_0x41de02[_0xd248('0x2a')],'countmachineretry':_0x41de02[_0xd248('0x26')],'countagentrejectretry':_0x41de02[_0xd248('0x27')],'createdAt':_0x41de02[_0xd248('0x36')],'updatedAt':_0x41de02[_0xd248('0x37')]};var _0x1d60da={'CmHopperId':_0x32e67f['id'],'phone':_0x193ac7[_0xd248('0x35')],'active':0x0,'OrderBy':_[_0xd248('0x31')](_0x193ac7[_0xd248('0x21')])?0x0:_0x193ac7[_0xd248('0x21')],'scheduledat':_0x43179b,'countbusyretry':_0x193ac7[_0xd248('0x23')],'countcongestionretry':_0x193ac7['countcongestionretry'],'countnoanswerretry':_0x193ac7['countnoanswerretry'],'countnosuchnumberretry':_0x193ac7[_0xd248('0x25')],'countdropretry':_0x193ac7['countdropretry'],'countabandonedretry':_0x193ac7['countabandonedretry'],'countmachineretry':_0x193ac7['countmachineretry'],'countagentrejectretry':_0x193ac7[_0xd248('0x27')],'createdAt':_0x193ac7[_0xd248('0x36')],'updatedAt':_0x193ac7[_0xd248('0x37')]};return db[_0xd248('0x38')][_0xd248('0x39')](function(_0x4e2e9c){return db['CmHopperAdditionalPhone'][_0xd248('0x3a')](_0x18ef99,{'where':{'id':_0x193ac7['id']}},{'transaction':_0x4e2e9c})['then'](function(){return db['CmHopper'][_0xd248('0x3a')](_0x1d60da,{'where':{'id':_0x32e67f['id']}},{'transaction':_0x4e2e9c});});})[_0xd248('0xd')](function(_0x9417d0){_0x3f8224({'id':_0x32e67f['id'],'phone':_0x193ac7[_0xd248('0x35')]});})[_0xd248('0x18')](function(_0x32743a){logger[_0xd248('0x14')](_0xd248('0x3b'),_0x32743a['message']);_0x4d6bf4({'error':_0x32743a[_0xd248('0x16')]});});});}exports['IncrementPreviewCounters']=function(_0x39b436){var _0x10df80=this;return new Promise(function(_0x467f79,_0x32555c){return db[_0xd248('0x19')][_0xd248('0x3a')](_0x39b436[_0xd248('0x1a')][_0xd248('0x3c')],{'where':{'id':_0x39b436[_0xd248('0x1a')]['id']}})['then'](function(_0x243861){_0x467f79(_0x243861);})[_0xd248('0x18')](function(_0x851ac9){logger[_0xd248('0x14')](_0xd248('0x3d'),_0x851ac9[_0xd248('0x16')]);_0x32555c(_0x10df80['error'](0x1f4,_0x851ac9[_0xd248('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/index.js b/server/api/cmHopperAdditionalPhone/index.js index 18e47eb..4f4254e 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 _0x5cfa=['create','/:id','delete','destroy','exports','multer','path','../../config/environment','./cmHopperAdditionalPhone.controller','isAuthenticated','index','get','show','post'];(function(_0x5cbd5b,_0x6ba562){var _0x57a0d3=function(_0x196297){while(--_0x196297){_0x5cbd5b['push'](_0x5cbd5b['shift']());}};_0x57a0d3(++_0x6ba562);}(_0x5cfa,0x12b));var _0xa5cf=function(_0x67ee28,_0x21d1e8){_0x67ee28=_0x67ee28-0x0;var _0xa69768=_0x5cfa[_0x67ee28];return _0xa69768;};'use strict';var multer=require(_0xa5cf('0x0'));var util=require('util');var path=require(_0xa5cf('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('../../components/interaction/service');var config=require(_0xa5cf('0x2'));var controller=require(_0xa5cf('0x3'));router['get']('/',auth[_0xa5cf('0x4')](),controller[_0xa5cf('0x5')]);router[_0xa5cf('0x6')]('/:id',auth[_0xa5cf('0x4')](),controller[_0xa5cf('0x7')]);router[_0xa5cf('0x8')]('/',auth[_0xa5cf('0x4')](),controller[_0xa5cf('0x9')]);router['put'](_0xa5cf('0xa'),auth[_0xa5cf('0x4')](),controller['update']);router[_0xa5cf('0xb')]('/:id',auth[_0xa5cf('0x4')](),controller[_0xa5cf('0xc')]);module[_0xa5cf('0xd')]=router; \ No newline at end of file +var _0xb678=['index','/:id','show','post','put','delete','destroy','exports','multer','util','express','../../components/auth/service','get','isAuthenticated'];(function(_0x31e965,_0xbd1e54){var _0x120351=function(_0x45229d){while(--_0x45229d){_0x31e965['push'](_0x31e965['shift']());}};_0x120351(++_0xbd1e54);}(_0xb678,0x6a));var _0x8b67=function(_0x44bcb0,_0x235aa9){_0x44bcb0=_0x44bcb0-0x0;var _0xfaf881=_0xb678[_0x44bcb0];return _0xfaf881;};'use strict';var multer=require(_0x8b67('0x0'));var util=require(_0x8b67('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x8b67('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x8b67('0x3'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./cmHopperAdditionalPhone.controller');router[_0x8b67('0x4')]('/',auth[_0x8b67('0x5')](),controller[_0x8b67('0x6')]);router[_0x8b67('0x4')](_0x8b67('0x7'),auth[_0x8b67('0x5')](),controller[_0x8b67('0x8')]);router[_0x8b67('0x9')]('/',auth[_0x8b67('0x5')](),controller['create']);router[_0x8b67('0xa')](_0x8b67('0x7'),auth[_0x8b67('0x5')](),controller['update']);router[_0x8b67('0xb')](_0x8b67('0x7'),auth[_0x8b67('0x5')](),controller[_0x8b67('0xc')]);module[_0x8b67('0xd')]=router; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.attributes.js b/server/api/cmHopperBlack/cmHopperBlack.attributes.js index 8960487..e91cfe7 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 _0x1560=['contactListQueue','moment','exports','STRING','INTEGER'];(function(_0x24697b,_0x2eb072){var _0x585b99=function(_0x261980){while(--_0x261980){_0x24697b['push'](_0x24697b['shift']());}};_0x585b99(++_0x2eb072);}(_0x1560,0x155));var _0x0156=function(_0x69583,_0x52dc5f){_0x69583=_0x69583-0x0;var _0x26086c=_0x1560[_0x69583];return _0x26086c;};'use strict';var moment=require(_0x0156('0x0'));var Sequelize=require('sequelize');module[_0x0156('0x1')]={'phone':{'type':Sequelize[_0x0156('0x2')],'allowNull':![]},'ContactId':{'type':Sequelize[_0x0156('0x3')],'unique':_0x0156('0x4')},'ListId':{'type':Sequelize['INTEGER'],'unique':_0x0156('0x4')},'VoiceQueueId':{'type':Sequelize[_0x0156('0x3')],'unique':_0x0156('0x4')}}; \ No newline at end of file +var _0x9fc3=['exports','STRING','INTEGER','contactListQueue','moment'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x9fc3,0x199));var _0x39fc=function(_0x1d0e88,_0x281724){_0x1d0e88=_0x1d0e88-0x0;var _0x1942aa=_0x9fc3[_0x1d0e88];return _0x1942aa;};'use strict';var moment=require(_0x39fc('0x0'));var Sequelize=require('sequelize');module[_0x39fc('0x1')]={'phone':{'type':Sequelize[_0x39fc('0x2')],'allowNull':![]},'ContactId':{'type':Sequelize[_0x39fc('0x3')],'unique':_0x39fc('0x4')},'ListId':{'type':Sequelize[_0x39fc('0x3')],'unique':_0x39fc('0x4')},'VoiceQueueId':{'type':Sequelize[_0x39fc('0x3')],'unique':'contactListQueue'}}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.controller.js b/server/api/cmHopperBlack/cmHopperBlack.controller.js index f689998..b1f98f1 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 _0x5aa3=['fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','jsforce','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','update','then','error','stack','name','send','index','map','CmHopperBlack','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','limit','sort','where','pick','filter','VIRTUAL','include','findAll','rows','show','params','includeAll','options','find','body','catch','destroy','describe','eml-format','zip-dir'];(function(_0x5ef25b,_0x6addf3){var _0x17232c=function(_0x14e308){while(--_0x14e308){_0x5ef25b['push'](_0x5ef25b['shift']());}};_0x17232c(++_0x6addf3);}(_0x5aa3,0x1ba));var _0x35aa=function(_0x1c8c28,_0x3ee093){_0x1c8c28=_0x1c8c28-0x0;var _0x1f59b4=_0x5aa3[_0x1c8c28];return _0x1f59b4;};'use strict';var emlformat=require(_0x35aa('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x35aa('0x1'));var jsonpatch=require(_0x35aa('0x2'));var rp=require(_0x35aa('0x3'));var moment=require(_0x35aa('0x4'));var BPromise=require(_0x35aa('0x5'));var Mustache=require(_0x35aa('0x6'));var util=require(_0x35aa('0x7'));var path=require(_0x35aa('0x8'));var sox=require(_0x35aa('0x9'));var csv=require(_0x35aa('0xa'));var ejs=require(_0x35aa('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x35aa('0xc'));var crypto=require('crypto');var jsforce=require(_0x35aa('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x35aa('0xa'));var querystring=require('querystring');var Papa=require(_0x35aa('0xe'));var Redis=require(_0x35aa('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x35aa('0x10'));var hardwareService=require(_0x35aa('0x11'));var logger=require(_0x35aa('0x12'))(_0x35aa('0x13'));var utils=require(_0x35aa('0x14'));var config=require(_0x35aa('0x15'));var licenseUtil=require(_0x35aa('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x491f91,_0x549445){_0x549445=_0x549445||0xcc;return function(_0x559c3a){if(_0x559c3a){return _0x491f91[_0x35aa('0x17')](_0x549445);}return _0x491f91[_0x35aa('0x18')](_0x549445)[_0x35aa('0x19')]();};}function respondWithResult(_0x5babfc,_0x49c9a7){_0x49c9a7=_0x49c9a7||0xc8;return function(_0x44bb5c){if(_0x44bb5c){return _0x5babfc[_0x35aa('0x18')](_0x49c9a7)[_0x35aa('0x1a')](_0x44bb5c);}};}function respondWithFilteredResult(_0x301ca1,_0x3a6303){return function(_0x4bd2f5){if(_0x4bd2f5){var _0x14a131=typeof _0x3a6303[_0x35aa('0x1b')]===_0x35aa('0x1c')&&typeof _0x3a6303['limit']===_0x35aa('0x1c');var _0x2fc408=_0x4bd2f5['count'];var _0x575662=_0x14a131?0x0:_0x3a6303['offset'];var _0x4f664c=_0x14a131?_0x4bd2f5[_0x35aa('0x1d')]:_0x3a6303[_0x35aa('0x1b')]+_0x3a6303['limit'];var _0xa3068c;if(_0x4f664c>=_0x2fc408){_0x4f664c=_0x2fc408;_0xa3068c=0xc8;}else{_0xa3068c=0xce;}_0x301ca1[_0x35aa('0x18')](_0xa3068c);return _0x301ca1[_0x35aa('0x1e')](_0x35aa('0x1f'),_0x575662+'-'+_0x4f664c+'/'+_0x2fc408)[_0x35aa('0x1a')](_0x4bd2f5);}return null;};}function patchUpdates(_0xd29a5f){return function(_0x34ec73){try{jsonpatch[_0x35aa('0x20')](_0x34ec73,_0xd29a5f,!![]);}catch(_0x4709c4){return BPromise[_0x35aa('0x21')](_0x4709c4);}return _0x34ec73['save']();};}function saveUpdates(_0x22a834,_0x57310d){return function(_0x90248a){if(_0x90248a){return _0x90248a[_0x35aa('0x22')](_0x22a834)[_0x35aa('0x23')](function(_0x219aa3){return _0x219aa3;});}return null;};}function removeEntity(_0x264156,_0x581d5a){return function(_0x4621bc){if(_0x4621bc){return _0x4621bc['destroy']()[_0x35aa('0x23')](function(){_0x264156['status'](0xcc)[_0x35aa('0x19')]();});}};}function handleEntityNotFound(_0x1ca2f2,_0x77add4){return function(_0x3754ac){if(!_0x3754ac){_0x1ca2f2['sendStatus'](0x194);}return _0x3754ac;};}function handleError(_0x16b2d0,_0x28906b){_0x28906b=_0x28906b||0x1f4;return function(_0xf4897b){logger[_0x35aa('0x24')](_0xf4897b[_0x35aa('0x25')]);if(_0xf4897b[_0x35aa('0x26')]){delete _0xf4897b[_0x35aa('0x26')];}_0x16b2d0[_0x35aa('0x18')](_0x28906b)[_0x35aa('0x27')](_0xf4897b);};}exports[_0x35aa('0x28')]=function(_0x4b610b,_0x5f03a6){var _0x2de83a={},_0x3d6dd1={},_0x28e3d3={'count':0x0,'rows':[]};var _0x195a34=_[_0x35aa('0x29')](db[_0x35aa('0x2a')][_0x35aa('0x2b')],function(_0x3fc915){return{'name':_0x3fc915[_0x35aa('0x2c')],'type':_0x3fc915[_0x35aa('0x2d')][_0x35aa('0x2e')]};});_0x3d6dd1[_0x35aa('0x2f')]=_['map'](_0x195a34,_0x35aa('0x26'));_0x3d6dd1['query']=_[_0x35aa('0x30')](_0x4b610b[_0x35aa('0x31')]);_0x3d6dd1[_0x35aa('0x32')]=_[_0x35aa('0x33')](_0x3d6dd1[_0x35aa('0x2f')],_0x3d6dd1['query']);_0x2de83a['attributes']=_['intersection'](_0x3d6dd1[_0x35aa('0x2f')],qs[_0x35aa('0x34')](_0x4b610b[_0x35aa('0x31')][_0x35aa('0x34')]));_0x2de83a[_0x35aa('0x35')]=_0x2de83a[_0x35aa('0x35')][_0x35aa('0x36')]?_0x2de83a['attributes']:_0x3d6dd1[_0x35aa('0x2f')];if(!_0x4b610b['query'][_0x35aa('0x37')]('nolimit')){_0x2de83a[_0x35aa('0x38')]=qs['limit'](_0x4b610b[_0x35aa('0x31')][_0x35aa('0x38')]);_0x2de83a['offset']=qs[_0x35aa('0x1b')](_0x4b610b[_0x35aa('0x31')][_0x35aa('0x1b')]);}_0x2de83a['order']=qs['sort'](_0x4b610b[_0x35aa('0x31')][_0x35aa('0x39')]);_0x2de83a[_0x35aa('0x3a')]=qs['filters'](_[_0x35aa('0x3b')](_0x4b610b[_0x35aa('0x31')],_0x3d6dd1[_0x35aa('0x32')]),_0x195a34);if(_0x4b610b[_0x35aa('0x31')][_0x35aa('0x3c')]){_0x2de83a['where']=_['merge'](_0x2de83a[_0x35aa('0x3a')],{'$or':_[_0x35aa('0x29')](_0x195a34,function(_0x9e0a49){if(_0x9e0a49[_0x35aa('0x2d')]!==_0x35aa('0x3d')){var _0xa6335e={};_0xa6335e[_0x9e0a49[_0x35aa('0x26')]]={'$like':'%'+_0x4b610b[_0x35aa('0x31')][_0x35aa('0x3c')]+'%'};return _0xa6335e;}})});}_0x2de83a=_['merge']({},_0x2de83a,_0x4b610b['options']);var _0x2bd418={'where':_0x2de83a[_0x35aa('0x3a')]};return db['CmHopperBlack'][_0x35aa('0x1d')](_0x2bd418)[_0x35aa('0x23')](function(_0x4fa8e9){_0x28e3d3[_0x35aa('0x1d')]=_0x4fa8e9;if(_0x4b610b[_0x35aa('0x31')]['includeAll']){_0x2de83a[_0x35aa('0x3e')]=[{'all':!![]}];}return db[_0x35aa('0x2a')][_0x35aa('0x3f')](_0x2de83a);})[_0x35aa('0x23')](function(_0x198aa2){_0x28e3d3[_0x35aa('0x40')]=_0x198aa2;return _0x28e3d3;})['then'](respondWithFilteredResult(_0x5f03a6,_0x2de83a))['catch'](handleError(_0x5f03a6,null));};exports[_0x35aa('0x41')]=function(_0x2a1223,_0x51ea84){var _0x4acbd8={'raw':!![],'where':{'id':_0x2a1223[_0x35aa('0x42')]['id']}},_0x90aa2c={};_0x90aa2c[_0x35aa('0x2f')]=_['keys'](db['CmHopperBlack'][_0x35aa('0x2b')]);_0x90aa2c[_0x35aa('0x31')]=_['keys'](_0x2a1223[_0x35aa('0x31')]);_0x90aa2c[_0x35aa('0x32')]=_[_0x35aa('0x33')](_0x90aa2c[_0x35aa('0x2f')],_0x90aa2c[_0x35aa('0x31')]);_0x4acbd8['attributes']=_[_0x35aa('0x33')](_0x90aa2c[_0x35aa('0x2f')],qs[_0x35aa('0x34')](_0x2a1223['query'][_0x35aa('0x34')]));_0x4acbd8['attributes']=_0x4acbd8[_0x35aa('0x35')][_0x35aa('0x36')]?_0x4acbd8[_0x35aa('0x35')]:_0x90aa2c[_0x35aa('0x2f')];if(_0x2a1223[_0x35aa('0x31')][_0x35aa('0x43')]){_0x4acbd8['include']=[{'all':!![]}];}_0x4acbd8=_['merge']({},_0x4acbd8,_0x2a1223[_0x35aa('0x44')]);return db[_0x35aa('0x2a')][_0x35aa('0x45')](_0x4acbd8)[_0x35aa('0x23')](handleEntityNotFound(_0x51ea84,null))[_0x35aa('0x23')](respondWithResult(_0x51ea84,null))['catch'](handleError(_0x51ea84,null));};exports[_0x35aa('0x22')]=function(_0x323fe2,_0x45406c){if(_0x323fe2[_0x35aa('0x46')]['id']){delete _0x323fe2[_0x35aa('0x46')]['id'];}return db[_0x35aa('0x2a')][_0x35aa('0x45')]({'where':{'id':_0x323fe2['params']['id']}})[_0x35aa('0x23')](handleEntityNotFound(_0x45406c,null))[_0x35aa('0x23')](saveUpdates(_0x323fe2[_0x35aa('0x46')],null))['then'](respondWithResult(_0x45406c,null))[_0x35aa('0x47')](handleError(_0x45406c,null));};exports[_0x35aa('0x48')]=function(_0x210c08,_0x4014c2){return db[_0x35aa('0x2a')][_0x35aa('0x45')]({'where':{'id':_0x210c08['params']['id']}})['then'](handleEntityNotFound(_0x4014c2,null))[_0x35aa('0x23')](removeEntity(_0x4014c2,null))[_0x35aa('0x47')](handleError(_0x4014c2,null));};exports[_0x35aa('0x49')]=function(_0x18b4c0,_0x5076f8){return db[_0x35aa('0x2a')][_0x35aa('0x49')]()['then'](respondWithResult(_0x5076f8,null))[_0x35aa('0x47')](handleError(_0x5076f8,null));}; \ No newline at end of file +var _0x1173=['attributes','fields','hasOwnProperty','limit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','length','include','find','body','destroy','describe','rimraf','zip-dir','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','json','offset','undefined','count','apply','update','then','end','sendStatus','error','stack','name','send','map','CmHopperBlack','rawAttributes','type','model','query','keys','filters','intersection'];(function(_0x20a7f9,_0x2d5a89){var _0xbefb55=function(_0x9f578){while(--_0x9f578){_0x20a7f9['push'](_0x20a7f9['shift']());}};_0xbefb55(++_0x2d5a89);}(_0x1173,0x138));var _0x3117=function(_0x459ee0,_0x1e950d){_0x459ee0=_0x459ee0-0x0;var _0x1b87c8=_0x1173[_0x459ee0];return _0x1b87c8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3117('0x0'));var zipdir=require(_0x3117('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x3117('0x2'));var BPromise=require(_0x3117('0x3'));var Mustache=require(_0x3117('0x4'));var util=require('util');var path=require(_0x3117('0x5'));var sox=require(_0x3117('0x6'));var csv=require(_0x3117('0x7'));var ejs=require(_0x3117('0x8'));var fs=require('fs');var fs_extra=require(_0x3117('0x9'));var _=require(_0x3117('0xa'));var squel=require(_0x3117('0xb'));var crypto=require(_0x3117('0xc'));var jsforce=require(_0x3117('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x3117('0x7'));var querystring=require(_0x3117('0xe'));var Papa=require(_0x3117('0xf'));var Redis=require(_0x3117('0x10'));var authService=require(_0x3117('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x3117('0x12'));var hardwareService=require(_0x3117('0x13'));var logger=require(_0x3117('0x14'))(_0x3117('0x15'));var utils=require(_0x3117('0x16'));var config=require(_0x3117('0x17'));var licenseUtil=require(_0x3117('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x244e94,_0xfc59ff){_0xfc59ff=_0xfc59ff||0xcc;return function(_0x131940){if(_0x131940){return _0x244e94['sendStatus'](_0xfc59ff);}return _0x244e94[_0x3117('0x19')](_0xfc59ff)['end']();};}function respondWithResult(_0x1123b8,_0x5797e6){_0x5797e6=_0x5797e6||0xc8;return function(_0x5926f1){if(_0x5926f1){return _0x1123b8['status'](_0x5797e6)[_0x3117('0x1a')](_0x5926f1);}};}function respondWithFilteredResult(_0x5226f0,_0xeda49f){return function(_0x36ea5d){if(_0x36ea5d){var _0x295447=typeof _0xeda49f[_0x3117('0x1b')]===_0x3117('0x1c')&&typeof _0xeda49f['limit']===_0x3117('0x1c');var _0x47e747=_0x36ea5d[_0x3117('0x1d')];var _0x1255ea=_0x295447?0x0:_0xeda49f['offset'];var _0x389787=_0x295447?_0x36ea5d[_0x3117('0x1d')]:_0xeda49f[_0x3117('0x1b')]+_0xeda49f['limit'];var _0x3ad645;if(_0x389787>=_0x47e747){_0x389787=_0x47e747;_0x3ad645=0xc8;}else{_0x3ad645=0xce;}_0x5226f0['status'](_0x3ad645);return _0x5226f0['set']('Content-Range',_0x1255ea+'-'+_0x389787+'/'+_0x47e747)[_0x3117('0x1a')](_0x36ea5d);}return null;};}function patchUpdates(_0x56c230){return function(_0x1db7da){try{jsonpatch[_0x3117('0x1e')](_0x1db7da,_0x56c230,!![]);}catch(_0x32c2bf){return BPromise['reject'](_0x32c2bf);}return _0x1db7da['save']();};}function saveUpdates(_0x4e0c2a,_0xa57415){return function(_0x496513){if(_0x496513){return _0x496513[_0x3117('0x1f')](_0x4e0c2a)[_0x3117('0x20')](function(_0x3d6950){return _0x3d6950;});}return null;};}function removeEntity(_0x29ab2e,_0x4c4ed6){return function(_0x327da7){if(_0x327da7){return _0x327da7['destroy']()['then'](function(){_0x29ab2e[_0x3117('0x19')](0xcc)[_0x3117('0x21')]();});}};}function handleEntityNotFound(_0x40b011,_0x9a3a37){return function(_0x469595){if(!_0x469595){_0x40b011[_0x3117('0x22')](0x194);}return _0x469595;};}function handleError(_0x151a25,_0x35f5e3){_0x35f5e3=_0x35f5e3||0x1f4;return function(_0x1c05a3){logger[_0x3117('0x23')](_0x1c05a3[_0x3117('0x24')]);if(_0x1c05a3[_0x3117('0x25')]){delete _0x1c05a3[_0x3117('0x25')];}_0x151a25['status'](_0x35f5e3)[_0x3117('0x26')](_0x1c05a3);};}exports['index']=function(_0x20465a,_0x13a171){var _0xeddede={},_0x458fa5={},_0x33d8af={'count':0x0,'rows':[]};var _0x9645d6=_[_0x3117('0x27')](db[_0x3117('0x28')][_0x3117('0x29')],function(_0x1d6d66){return{'name':_0x1d6d66['fieldName'],'type':_0x1d6d66[_0x3117('0x2a')]['key']};});_0x458fa5[_0x3117('0x2b')]=_['map'](_0x9645d6,_0x3117('0x25'));_0x458fa5[_0x3117('0x2c')]=_[_0x3117('0x2d')](_0x20465a[_0x3117('0x2c')]);_0x458fa5[_0x3117('0x2e')]=_[_0x3117('0x2f')](_0x458fa5[_0x3117('0x2b')],_0x458fa5[_0x3117('0x2c')]);_0xeddede[_0x3117('0x30')]=_['intersection'](_0x458fa5[_0x3117('0x2b')],qs[_0x3117('0x31')](_0x20465a[_0x3117('0x2c')][_0x3117('0x31')]));_0xeddede[_0x3117('0x30')]=_0xeddede[_0x3117('0x30')]['length']?_0xeddede['attributes']:_0x458fa5[_0x3117('0x2b')];if(!_0x20465a[_0x3117('0x2c')][_0x3117('0x32')]('nolimit')){_0xeddede['limit']=qs['limit'](_0x20465a['query'][_0x3117('0x33')]);_0xeddede['offset']=qs['offset'](_0x20465a[_0x3117('0x2c')][_0x3117('0x1b')]);}_0xeddede[_0x3117('0x34')]=qs[_0x3117('0x35')](_0x20465a['query'][_0x3117('0x35')]);_0xeddede[_0x3117('0x36')]=qs[_0x3117('0x2e')](_[_0x3117('0x37')](_0x20465a[_0x3117('0x2c')],_0x458fa5[_0x3117('0x2e')]),_0x9645d6);if(_0x20465a[_0x3117('0x2c')][_0x3117('0x38')]){_0xeddede[_0x3117('0x36')]=_[_0x3117('0x39')](_0xeddede[_0x3117('0x36')],{'$or':_[_0x3117('0x27')](_0x9645d6,function(_0x590b7a){if(_0x590b7a[_0x3117('0x2a')]!==_0x3117('0x3a')){var _0x38428f={};_0x38428f[_0x590b7a['name']]={'$like':'%'+_0x20465a['query'][_0x3117('0x38')]+'%'};return _0x38428f;}})});}_0xeddede=_['merge']({},_0xeddede,_0x20465a[_0x3117('0x3b')]);var _0x2c316e={'where':_0xeddede[_0x3117('0x36')]};return db[_0x3117('0x28')][_0x3117('0x1d')](_0x2c316e)['then'](function(_0x1fca68){_0x33d8af[_0x3117('0x1d')]=_0x1fca68;if(_0x20465a['query'][_0x3117('0x3c')]){_0xeddede['include']=[{'all':!![]}];}return db['CmHopperBlack'][_0x3117('0x3d')](_0xeddede);})[_0x3117('0x20')](function(_0x44bb66){_0x33d8af[_0x3117('0x3e')]=_0x44bb66;return _0x33d8af;})[_0x3117('0x20')](respondWithFilteredResult(_0x13a171,_0xeddede))[_0x3117('0x3f')](handleError(_0x13a171,null));};exports[_0x3117('0x40')]=function(_0x51826b,_0x65b735){var _0x1fdcc1={'raw':!![],'where':{'id':_0x51826b[_0x3117('0x41')]['id']}},_0x46e2a2={};_0x46e2a2['model']=_[_0x3117('0x2d')](db[_0x3117('0x28')][_0x3117('0x29')]);_0x46e2a2[_0x3117('0x2c')]=_[_0x3117('0x2d')](_0x51826b[_0x3117('0x2c')]);_0x46e2a2[_0x3117('0x2e')]=_[_0x3117('0x2f')](_0x46e2a2['model'],_0x46e2a2['query']);_0x1fdcc1[_0x3117('0x30')]=_[_0x3117('0x2f')](_0x46e2a2[_0x3117('0x2b')],qs['fields'](_0x51826b[_0x3117('0x2c')][_0x3117('0x31')]));_0x1fdcc1[_0x3117('0x30')]=_0x1fdcc1[_0x3117('0x30')][_0x3117('0x42')]?_0x1fdcc1[_0x3117('0x30')]:_0x46e2a2['model'];if(_0x51826b['query'][_0x3117('0x3c')]){_0x1fdcc1[_0x3117('0x43')]=[{'all':!![]}];}_0x1fdcc1=_[_0x3117('0x39')]({},_0x1fdcc1,_0x51826b['options']);return db[_0x3117('0x28')][_0x3117('0x44')](_0x1fdcc1)[_0x3117('0x20')](handleEntityNotFound(_0x65b735,null))[_0x3117('0x20')](respondWithResult(_0x65b735,null))[_0x3117('0x3f')](handleError(_0x65b735,null));};exports[_0x3117('0x1f')]=function(_0x39b351,_0x2a6c0b){if(_0x39b351[_0x3117('0x45')]['id']){delete _0x39b351[_0x3117('0x45')]['id'];}return db[_0x3117('0x28')][_0x3117('0x44')]({'where':{'id':_0x39b351[_0x3117('0x41')]['id']}})[_0x3117('0x20')](handleEntityNotFound(_0x2a6c0b,null))[_0x3117('0x20')](saveUpdates(_0x39b351[_0x3117('0x45')],null))[_0x3117('0x20')](respondWithResult(_0x2a6c0b,null))[_0x3117('0x3f')](handleError(_0x2a6c0b,null));};exports[_0x3117('0x46')]=function(_0xd5a25e,_0x26279d){return db[_0x3117('0x28')][_0x3117('0x44')]({'where':{'id':_0xd5a25e['params']['id']}})[_0x3117('0x20')](handleEntityNotFound(_0x26279d,null))['then'](removeEntity(_0x26279d,null))['catch'](handleError(_0x26279d,null));};exports[_0x3117('0x47')]=function(_0x5d2606,_0x40f08f){return db[_0x3117('0x28')]['describe']()[_0x3117('0x20')](respondWithResult(_0x40f08f,null))[_0x3117('0x3f')](handleError(_0x40f08f,null));}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.model.js b/server/api/cmHopperBlack/cmHopperBlack.model.js index ba78094..ea66d2d 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 _0x1c8d=['util','../../config/logger','request-promise','path','rimraf','./cmHopperBlack.attributes','define','CmHopperBlack'];(function(_0x4365f6,_0x13035e){var _0x1d6314=function(_0x433e60){while(--_0x433e60){_0x4365f6['push'](_0x4365f6['shift']());}};_0x1d6314(++_0x13035e);}(_0x1c8d,0x1f0));var _0xd1c8=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x1c8d[_0x5b644e];return _0x49c6bf;};'use strict';var _=require('lodash');var util=require(_0xd1c8('0x0'));var logger=require(_0xd1c8('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xd1c8('0x2'));var fs=require('fs');var path=require(_0xd1c8('0x3'));var rimraf=require(_0xd1c8('0x4'));var config=require('../../config/environment');var attributes=require(_0xd1c8('0x5'));module['exports']=function(_0x2bcccd,_0x438e1e){return _0x2bcccd[_0xd1c8('0x6')](_0xd1c8('0x7'),attributes,{'tableName':'cm_hopper_black','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3349=['./cmHopperBlack.attributes','exports','define','CmHopperBlack','cm_hopper_black','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x21c41a,_0x44c63e){var _0x7c888e=function(_0x3dad06){while(--_0x3dad06){_0x21c41a['push'](_0x21c41a['shift']());}};_0x7c888e(++_0x44c63e);}(_0x3349,0xc8));var _0x9334=function(_0x21eb10,_0x4837ee){_0x21eb10=_0x21eb10-0x0;var _0x2be61d=_0x3349[_0x21eb10];return _0x2be61d;};'use strict';var _=require(_0x9334('0x0'));var util=require(_0x9334('0x1'));var logger=require(_0x9334('0x2'))(_0x9334('0x3'));var moment=require(_0x9334('0x4'));var BPromise=require(_0x9334('0x5'));var rp=require(_0x9334('0x6'));var fs=require('fs');var path=require(_0x9334('0x7'));var rimraf=require(_0x9334('0x8'));var config=require(_0x9334('0x9'));var attributes=require(_0x9334('0xa'));module[_0x9334('0xb')]=function(_0x52600e,_0x7a2b52){return _0x52600e[_0x9334('0xc')](_0x9334('0xd'),attributes,{'tableName':_0x9334('0xe'),'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 f847747..91e113a 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 _0x333c=['options','raw','attributes','limit','include','map','model','catch','UpdateCmHopperBlack','CmHopperBlack','body','where','DestroyCmHopperBlack','lodash','util','moment','bluebird','ioredis','../../config/utils','../../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','message','result','GetCmHopperBlack'];(function(_0x4c3d41,_0x2263a1){var _0x3f198e=function(_0x30dcca){while(--_0x30dcca){_0x4c3d41['push'](_0x4c3d41['shift']());}};_0x3f198e(++_0x2263a1);}(_0x333c,0x9d));var _0xc333=function(_0x1c415e,_0x56b220){_0x1c415e=_0x1c415e-0x0;var _0x5e60ad=_0x333c[_0x1c415e];return _0x5e60ad;};'use strict';var _=require(_0xc333('0x0'));var util=require(_0xc333('0x1'));var moment=require(_0xc333('0x2'));var BPromise=require(_0xc333('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc333('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xc333('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0xc333('0x6'));var jayson=require(_0xc333('0x7'));var client=jayson[_0xc333('0x8')][_0xc333('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x167296,_0x465c27,_0x1ef00c){return new BPromise(function(_0x1ebb9a,_0x2c8307){return client[_0xc333('0xa')](_0x167296,_0x1ef00c)[_0xc333('0xb')](function(_0xe04f4){logger[_0xc333('0xc')](_0xc333('0xd'),_0x465c27,_0xc333('0xe'));logger[_0xc333('0xf')](_0xc333('0x10'),_0x465c27,_0xc333('0xe'),JSON[_0xc333('0x11')](_0xe04f4));if(_0xe04f4[_0xc333('0x12')]){if(_0xe04f4[_0xc333('0x12')][_0xc333('0x13')]===0x1f4){logger[_0xc333('0x12')](_0xc333('0xd'),_0x465c27,_0xe04f4[_0xc333('0x12')][_0xc333('0x14')]);return _0x2c8307(_0xe04f4[_0xc333('0x12')]['message']);}logger['error'](_0xc333('0xd'),_0x465c27,_0xe04f4[_0xc333('0x12')][_0xc333('0x14')]);return _0x1ebb9a(_0xe04f4[_0xc333('0x12')]['message']);}else{logger[_0xc333('0xc')](_0xc333('0xd'),_0x465c27,'request\x20sent');_0x1ebb9a(_0xe04f4[_0xc333('0x15')][_0xc333('0x14')]);}})['catch'](function(_0x23b78a){logger[_0xc333('0x12')]('CmHopperBlack,\x20%s,\x20%s',_0x465c27,_0x23b78a);_0x2c8307(_0x23b78a);});});}exports[_0xc333('0x16')]=function(_0x5a8402){var _0x18ea92=this;return new Promise(function(_0x3d35b1,_0x12d593){return db['CmHopperBlack']['findAll']({'raw':_0x5a8402[_0xc333('0x17')]?_0x5a8402[_0xc333('0x17')][_0xc333('0x18')]===undefined?!![]:![]:!![],'where':_0x5a8402[_0xc333('0x17')]?_0x5a8402[_0xc333('0x17')]['where']||null:null,'attributes':_0x5a8402['options']?_0x5a8402[_0xc333('0x17')][_0xc333('0x19')]||null:null,'limit':_0x5a8402[_0xc333('0x17')]?_0x5a8402[_0xc333('0x17')][_0xc333('0x1a')]||null:null,'include':_0x5a8402[_0xc333('0x17')]?_0x5a8402[_0xc333('0x17')][_0xc333('0x1b')]?_[_0xc333('0x1c')](_0x5a8402[_0xc333('0x17')]['include'],function(_0x5d997e){return{'model':db[_0x5d997e['model']],'as':_0x5d997e['as'],'attributes':_0x5d997e[_0xc333('0x19')],'include':_0x5d997e[_0xc333('0x1b')]?_[_0xc333('0x1c')](_0x5d997e['include'],function(_0x2fe8b6){return{'model':db[_0x2fe8b6['model']],'as':_0x2fe8b6['as'],'attributes':_0x2fe8b6['attributes'],'include':_0x2fe8b6[_0xc333('0x1b')]?_[_0xc333('0x1c')](_0x2fe8b6[_0xc333('0x1b')],function(_0x2262ac){return{'model':db[_0x2262ac[_0xc333('0x1d')]],'as':_0x2262ac['as'],'attributes':_0x2262ac[_0xc333('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4b5480){logger[_0xc333('0xc')](_0xc333('0x16'),_0x5a8402);logger['debug']('GetCmHopperBlack',_0x5a8402,JSON[_0xc333('0x11')](_0x4b5480));_0x3d35b1(_0x4b5480);})[_0xc333('0x1e')](function(_0x90b61){logger['error'](_0xc333('0x16'),_0x90b61['message'],_0x5a8402);_0x12d593(_0x18ea92[_0xc333('0x12')](0x1f4,_0x90b61[_0xc333('0x14')]));});});};exports[_0xc333('0x1f')]=function(_0x116c5a){var _0x34a247=this;return new Promise(function(_0x28c4b7,_0x3d160d){return db[_0xc333('0x20')]['update'](_0x116c5a[_0xc333('0x21')],{'raw':_0x116c5a[_0xc333('0x17')]?_0x116c5a[_0xc333('0x17')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x116c5a[_0xc333('0x17')]?_0x116c5a[_0xc333('0x17')][_0xc333('0x22')]||null:null,'attributes':_0x116c5a[_0xc333('0x17')]?_0x116c5a[_0xc333('0x17')][_0xc333('0x19')]||null:null,'limit':_0x116c5a[_0xc333('0x17')]?_0x116c5a[_0xc333('0x17')][_0xc333('0x1a')]||null:null})['then'](function(_0x27597f){logger['info'](_0xc333('0x1f'),_0x116c5a);logger[_0xc333('0xf')](_0xc333('0x1f'),_0x116c5a,JSON[_0xc333('0x11')](_0x27597f));_0x28c4b7(_0x27597f);})[_0xc333('0x1e')](function(_0x166694){logger[_0xc333('0x12')](_0xc333('0x1f'),_0x166694[_0xc333('0x14')],_0x116c5a);_0x3d160d(_0x34a247[_0xc333('0x12')](0x1f4,_0x166694[_0xc333('0x14')]));});});};exports['DestroyCmHopperBlack']=function(_0x3e54d2){var _0x2f2f24=this;return new Promise(function(_0x5d489e,_0x2e4019){return db['CmHopperBlack']['destroy']({'where':_0x3e54d2[_0xc333('0x17')]?_0x3e54d2['options'][_0xc333('0x22')]||null:null})[_0xc333('0xb')](function(_0x5e3e20){logger[_0xc333('0xc')]('DestroyCmHopperBlack',_0x3e54d2);logger[_0xc333('0xf')](_0xc333('0x23'),_0x3e54d2,JSON[_0xc333('0x11')](_0x5e3e20));_0x5d489e(_0x5e3e20);})['catch'](function(_0x2dc0c9){logger[_0xc333('0x12')]('DestroyCmHopperBlack',_0x2dc0c9['message'],_0x3e54d2);_0x2e4019(_0x2f2f24[_0xc333('0x12')](0x1f4,_0x2dc0c9[_0xc333('0x14')]));});});}; \ No newline at end of file +var _0xea19=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','CmHopperBlack,\x20%s,\x20%s','request\x20sent','CmHopperBlack,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetCmHopperBlack','CmHopperBlack','options','raw','where','limit','map','model','attributes','include','debug','UpdateCmHopperBlack','update','body','destroy','DestroyCmHopperBlack','util','moment','bluebird','randomstring'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0xea19,0x1dc));var _0x9ea1=function(_0x5c2a2b,_0x22c94e){_0x5c2a2b=_0x5c2a2b-0x0;var _0x19921f=_0xea19[_0x5c2a2b];return _0x19921f;};'use strict';var _=require('lodash');var util=require(_0x9ea1('0x0'));var moment=require(_0x9ea1('0x1'));var BPromise=require(_0x9ea1('0x2'));var rs=require(_0x9ea1('0x3'));var fs=require('fs');var Redis=require(_0x9ea1('0x4'));var db=require(_0x9ea1('0x5'))['db'];var utils=require(_0x9ea1('0x6'));var logger=require(_0x9ea1('0x7'))(_0x9ea1('0x8'));var config=require('../../config/environment');var jayson=require(_0x9ea1('0x9'));var client=jayson[_0x9ea1('0xa')][_0x9ea1('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3379ff,_0x365bfb,_0x271957){return new BPromise(function(_0x323c5,_0x53bfb6){return client[_0x9ea1('0xc')](_0x3379ff,_0x271957)[_0x9ea1('0xd')](function(_0xeff59c){logger[_0x9ea1('0xe')](_0x9ea1('0xf'),_0x365bfb,_0x9ea1('0x10'));logger['debug'](_0x9ea1('0x11'),_0x365bfb,_0x9ea1('0x10'),JSON[_0x9ea1('0x12')](_0xeff59c));if(_0xeff59c[_0x9ea1('0x13')]){if(_0xeff59c['error'][_0x9ea1('0x14')]===0x1f4){logger[_0x9ea1('0x13')](_0x9ea1('0xf'),_0x365bfb,_0xeff59c[_0x9ea1('0x13')]['message']);return _0x53bfb6(_0xeff59c[_0x9ea1('0x13')]['message']);}logger[_0x9ea1('0x13')](_0x9ea1('0xf'),_0x365bfb,_0xeff59c[_0x9ea1('0x13')][_0x9ea1('0x15')]);return _0x323c5(_0xeff59c['error'][_0x9ea1('0x15')]);}else{logger[_0x9ea1('0xe')](_0x9ea1('0xf'),_0x365bfb,'request\x20sent');_0x323c5(_0xeff59c[_0x9ea1('0x16')][_0x9ea1('0x15')]);}})[_0x9ea1('0x17')](function(_0x4608a6){logger[_0x9ea1('0x13')](_0x9ea1('0xf'),_0x365bfb,_0x4608a6);_0x53bfb6(_0x4608a6);});});}exports[_0x9ea1('0x18')]=function(_0x422f80){var _0x274af8=this;return new Promise(function(_0x3608e3,_0x13f888){return db[_0x9ea1('0x19')]['findAll']({'raw':_0x422f80[_0x9ea1('0x1a')]?_0x422f80['options'][_0x9ea1('0x1b')]===undefined?!![]:![]:!![],'where':_0x422f80[_0x9ea1('0x1a')]?_0x422f80[_0x9ea1('0x1a')][_0x9ea1('0x1c')]||null:null,'attributes':_0x422f80[_0x9ea1('0x1a')]?_0x422f80['options']['attributes']||null:null,'limit':_0x422f80[_0x9ea1('0x1a')]?_0x422f80[_0x9ea1('0x1a')][_0x9ea1('0x1d')]||null:null,'include':_0x422f80['options']?_0x422f80[_0x9ea1('0x1a')]['include']?_[_0x9ea1('0x1e')](_0x422f80[_0x9ea1('0x1a')]['include'],function(_0x28d1f3){return{'model':db[_0x28d1f3[_0x9ea1('0x1f')]],'as':_0x28d1f3['as'],'attributes':_0x28d1f3[_0x9ea1('0x20')],'include':_0x28d1f3[_0x9ea1('0x21')]?_['map'](_0x28d1f3[_0x9ea1('0x21')],function(_0x56ada6){return{'model':db[_0x56ada6[_0x9ea1('0x1f')]],'as':_0x56ada6['as'],'attributes':_0x56ada6[_0x9ea1('0x20')],'include':_0x56ada6[_0x9ea1('0x21')]?_[_0x9ea1('0x1e')](_0x56ada6[_0x9ea1('0x21')],function(_0x542f92){return{'model':db[_0x542f92[_0x9ea1('0x1f')]],'as':_0x542f92['as'],'attributes':_0x542f92[_0x9ea1('0x20')]};}):[]};}):[]};}):[]:[]})[_0x9ea1('0xd')](function(_0x1a3afd){logger['info']('GetCmHopperBlack',_0x422f80);logger[_0x9ea1('0x22')]('GetCmHopperBlack',_0x422f80,JSON['stringify'](_0x1a3afd));_0x3608e3(_0x1a3afd);})['catch'](function(_0x14f43b){logger['error'](_0x9ea1('0x18'),_0x14f43b[_0x9ea1('0x15')],_0x422f80);_0x13f888(_0x274af8['error'](0x1f4,_0x14f43b[_0x9ea1('0x15')]));});});};exports[_0x9ea1('0x23')]=function(_0x493183){var _0x13d7c1=this;return new Promise(function(_0x548ef6,_0x33d430){return db[_0x9ea1('0x19')][_0x9ea1('0x24')](_0x493183[_0x9ea1('0x25')],{'raw':_0x493183[_0x9ea1('0x1a')]?_0x493183[_0x9ea1('0x1a')][_0x9ea1('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x493183[_0x9ea1('0x1a')]?_0x493183[_0x9ea1('0x1a')][_0x9ea1('0x1c')]||null:null,'attributes':_0x493183[_0x9ea1('0x1a')]?_0x493183[_0x9ea1('0x1a')][_0x9ea1('0x20')]||null:null,'limit':_0x493183[_0x9ea1('0x1a')]?_0x493183[_0x9ea1('0x1a')][_0x9ea1('0x1d')]||null:null})[_0x9ea1('0xd')](function(_0x10dec1){logger[_0x9ea1('0xe')]('UpdateCmHopperBlack',_0x493183);logger[_0x9ea1('0x22')](_0x9ea1('0x23'),_0x493183,JSON[_0x9ea1('0x12')](_0x10dec1));_0x548ef6(_0x10dec1);})[_0x9ea1('0x17')](function(_0x4a4e45){logger['error'](_0x9ea1('0x23'),_0x4a4e45[_0x9ea1('0x15')],_0x493183);_0x33d430(_0x13d7c1[_0x9ea1('0x13')](0x1f4,_0x4a4e45[_0x9ea1('0x15')]));});});};exports['DestroyCmHopperBlack']=function(_0xf7ead0){var _0x3c5fb9=this;return new Promise(function(_0x1e6bfe,_0x30cfc1){return db['CmHopperBlack'][_0x9ea1('0x26')]({'where':_0xf7ead0[_0x9ea1('0x1a')]?_0xf7ead0[_0x9ea1('0x1a')][_0x9ea1('0x1c')]||null:null})[_0x9ea1('0xd')](function(_0x4e9a4e){logger[_0x9ea1('0xe')]('DestroyCmHopperBlack',_0xf7ead0);logger[_0x9ea1('0x22')](_0x9ea1('0x27'),_0xf7ead0,JSON[_0x9ea1('0x12')](_0x4e9a4e));_0x1e6bfe(_0x4e9a4e);})[_0x9ea1('0x17')](function(_0x8f9e25){logger[_0x9ea1('0x13')](_0x9ea1('0x27'),_0x8f9e25['message'],_0xf7ead0);_0x30cfc1(_0x3c5fb9[_0x9ea1('0x13')](0x1f4,_0x8f9e25[_0x9ea1('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/index.js b/server/api/cmHopperBlack/index.js index 8de8922..a5e58b2 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 _0x4137=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperBlack.controller','get','index','/describe','isAuthenticated','/:id','show','put','update','delete','exports','multer','util','path','connect-timeout'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0x4137,0xf8));var _0x7413=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0x4137[_0x46e363];return _0x3fb059;};'use strict';var multer=require(_0x7413('0x0'));var util=require(_0x7413('0x1'));var path=require(_0x7413('0x2'));var timeout=require(_0x7413('0x3'));var express=require(_0x7413('0x4'));var router=express[_0x7413('0x5')]();var fs_extra=require(_0x7413('0x6'));var auth=require(_0x7413('0x7'));var interaction=require(_0x7413('0x8'));var config=require(_0x7413('0x9'));var controller=require(_0x7413('0xa'));router[_0x7413('0xb')]('/',auth['isAuthenticated'](),controller[_0x7413('0xc')]);router[_0x7413('0xb')](_0x7413('0xd'),auth[_0x7413('0xe')](),controller['describe']);router[_0x7413('0xb')](_0x7413('0xf'),auth['isAuthenticated'](),controller[_0x7413('0x10')]);router[_0x7413('0x11')]('/:id',auth[_0x7413('0xe')](),controller[_0x7413('0x12')]);router[_0x7413('0x13')](_0x7413('0xf'),auth[_0x7413('0xe')](),controller['destroy']);module[_0x7413('0x14')]=router; \ No newline at end of file +var _0xf494=['path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperBlack.controller','get','isAuthenticated','index','describe','/:id','show','put','delete','destroy','multer','util'];(function(_0x192aea,_0x373ef0){var _0x5139af=function(_0x31d9b4){while(--_0x31d9b4){_0x192aea['push'](_0x192aea['shift']());}};_0x5139af(++_0x373ef0);}(_0xf494,0x1c6));var _0x4f49=function(_0x1c63b4,_0x5fc4ae){_0x1c63b4=_0x1c63b4-0x0;var _0x4eaca4=_0xf494[_0x1c63b4];return _0x4eaca4;};'use strict';var multer=require(_0x4f49('0x0'));var util=require(_0x4f49('0x1'));var path=require(_0x4f49('0x2'));var timeout=require('connect-timeout');var express=require(_0x4f49('0x3'));var router=express[_0x4f49('0x4')]();var fs_extra=require(_0x4f49('0x5'));var auth=require(_0x4f49('0x6'));var interaction=require(_0x4f49('0x7'));var config=require(_0x4f49('0x8'));var controller=require(_0x4f49('0x9'));router[_0x4f49('0xa')]('/',auth[_0x4f49('0xb')](),controller[_0x4f49('0xc')]);router[_0x4f49('0xa')]('/describe',auth['isAuthenticated'](),controller[_0x4f49('0xd')]);router[_0x4f49('0xa')](_0x4f49('0xe'),auth[_0x4f49('0xb')](),controller[_0x4f49('0xf')]);router[_0x4f49('0x10')](_0x4f49('0xe'),auth[_0x4f49('0xb')](),controller['update']);router[_0x4f49('0x11')](_0x4f49('0xe'),auth['isAuthenticated'](),controller[_0x4f49('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.attributes.js b/server/api/cmHopperFinal/cmHopperFinal.attributes.js index 3b0124e..fd1bd62 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 _0xbdc1=['seconds','BOOLEAN','sequelize','moment','STRING','DATE','INTEGER','endtime','setDataValue','diff'];(function(_0x21c3f6,_0x3c726c){var _0x288fac=function(_0x400bc7){while(--_0x400bc7){_0x21c3f6['push'](_0x21c3f6['shift']());}};_0x288fac(++_0x3c726c);}(_0xbdc1,0x84));var _0x1bdc=function(_0x5aa0ff,_0x41386b){_0x5aa0ff=_0x5aa0ff-0x0;var _0x3744aa=_0xbdc1[_0x5aa0ff];return _0x3744aa;};'use strict';var Sequelize=require(_0x1bdc('0x0'));var moment=require(_0x1bdc('0x1'));module['exports']={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize[_0x1bdc('0x2')]},'scheduledat':{'type':Sequelize[_0x1bdc('0x3')]},'countbusyretry':{'type':Sequelize[_0x1bdc('0x4')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x1bdc('0x4')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x1bdc('0x4')],'defaultValue':0x0},'countglobal':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x1bdc('0x2')]},'originatecalleridnum':{'type':Sequelize[_0x1bdc('0x2')]},'originatecalleridname':{'type':Sequelize[_0x1bdc('0x2')]},'calleridnum':{'type':Sequelize[_0x1bdc('0x2')]},'calleridname':{'type':Sequelize[_0x1bdc('0x2')]},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize[_0x1bdc('0x3')]},'answertime':{'type':Sequelize[_0x1bdc('0x3')]},'droptime':{'type':Sequelize[_0x1bdc('0x3')]},'endtime':{'type':Sequelize[_0x1bdc('0x3')]},'ringtime':{'type':Sequelize[_0x1bdc('0x4')],'defaultValue':0x0},'holdtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x1bdc('0x4')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x1bdc('0x4')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x1bdc('0x2')]},'campaign':{'type':Sequelize[_0x1bdc('0x2')]},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x1bdc('0x2')]},'reason':{'type':Sequelize[_0x1bdc('0x2')]},'disposition':{'type':Sequelize[_0x1bdc('0x2')]},'secondDisposition':{'type':Sequelize[_0x1bdc('0x2')]},'thirdDisposition':{'type':Sequelize[_0x1bdc('0x2')]},'dispositionat':{'type':Sequelize[_0x1bdc('0x3')],'set':function(_0x7b5ca3){var _0x187e1a=this['getDataValue'](_0x1bdc('0x5'));if(_0x187e1a&&_0x7b5ca3){this[_0x1bdc('0x6')]('followuptime',moment(_0x7b5ca3)[_0x1bdc('0x7')](moment(_0x187e1a),_0x1bdc('0x8')));}}},'amd':{'type':Sequelize[_0x1bdc('0x9')],'defaultValue':![]},'fax':{'type':Sequelize[_0x1bdc('0x9')],'defaultValue':![]},'blacklist':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0x1bdc('0x9')],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0x1bdc('0x3')]},'callback':{'type':Sequelize[_0x1bdc('0x9')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize[_0x1bdc('0x3')]},'deleted':{'type':Sequelize[_0x1bdc('0x2')],'defaultValue':null},'deletedat':{'type':Sequelize['DATE']},'recallme':{'type':Sequelize[_0x1bdc('0x9')],'defaultValue':![]},'agiafterat':{'type':Sequelize['DATE']},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x1bdc('0x4')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x1bdc('0x4')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0xe7ab=['endtime','setDataValue','followuptime','seconds','BOOLEAN','sequelize','exports','INTEGER','STRING','DATE'];(function(_0x4274e9,_0x2de911){var _0x563f2a=function(_0x15ac9e){while(--_0x15ac9e){_0x4274e9['push'](_0x4274e9['shift']());}};_0x563f2a(++_0x2de911);}(_0xe7ab,0x13b));var _0xbe7a=function(_0x5d6ae1,_0x2239a6){_0x5d6ae1=_0x5d6ae1-0x0;var _0x55c744=_0xe7ab[_0x5d6ae1];return _0x55c744;};'use strict';var Sequelize=require(_0xbe7a('0x0'));var moment=require('moment');module[_0xbe7a('0x1')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize['DATE']},'countbusyretry':{'type':Sequelize[_0xbe7a('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xbe7a('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xbe7a('0x2')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0xbe7a('0x2')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0xbe7a('0x3')]},'originatecalleridnum':{'type':Sequelize[_0xbe7a('0x3')]},'originatecalleridname':{'type':Sequelize[_0xbe7a('0x3')]},'calleridnum':{'type':Sequelize[_0xbe7a('0x3')]},'calleridname':{'type':Sequelize[_0xbe7a('0x3')]},'starttime':{'type':Sequelize[_0xbe7a('0x4')]},'responsetime':{'type':Sequelize[_0xbe7a('0x4')]},'answertime':{'type':Sequelize[_0xbe7a('0x4')]},'droptime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0xbe7a('0x4')]},'ringtime':{'type':Sequelize[_0xbe7a('0x2')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0xbe7a('0x2')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0xbe7a('0x2')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0xbe7a('0x2')],'defaultValue':0x0},'dropreason':{'type':Sequelize['STRING']},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0xbe7a('0x3')]},'reason':{'type':Sequelize['STRING']},'disposition':{'type':Sequelize[_0xbe7a('0x3')]},'secondDisposition':{'type':Sequelize[_0xbe7a('0x3')]},'thirdDisposition':{'type':Sequelize[_0xbe7a('0x3')]},'dispositionat':{'type':Sequelize[_0xbe7a('0x4')],'set':function(_0x25b6f8){var _0x50f4d8=this['getDataValue'](_0xbe7a('0x5'));if(_0x50f4d8&&_0x25b6f8){this[_0xbe7a('0x6')](_0xbe7a('0x7'),moment(_0x25b6f8)['diff'](moment(_0x50f4d8),_0xbe7a('0x8')));}}},'amd':{'type':Sequelize[_0xbe7a('0x9')],'defaultValue':![]},'fax':{'type':Sequelize[_0xbe7a('0x9')],'defaultValue':![]},'blacklist':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'rescheduled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0xbe7a('0x4')]},'callback':{'type':Sequelize[_0xbe7a('0x9')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xbe7a('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xbe7a('0x4')]},'deleted':{'type':Sequelize['STRING'],'defaultValue':null},'deletedat':{'type':Sequelize['DATE']},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0xbe7a('0x4')]},'countnosuchnumberretry':{'type':Sequelize[_0xbe7a('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xbe7a('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xbe7a('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xbe7a('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xbe7a('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 0d1c0f0..c021aff 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 _0x1261=['attributes','fields','length','hasOwnProperty','sort','pick','filters','where','type','VIRTUAL','filter','merge','options','findAll','rows','params','include','find','describe','catch','body','uniqueid','countContactsQueueCampaignHopperFinal','sequelize','COUNT','literal','`state`\x20=\x200,\x201,\x20null','noSuchContacts','`state`\x20=\x205,\x201,\x20null','busyContacts','`state`\x20=\x208,\x201,\x20null','congestionContacts','dropContacts','abandonedContacts','`state`\x20=\x2022,\x201,\x20null','reCallContacts','`state`\x20=\x2019,\x201,\x20null','answeringMachine','`state`\x20=\x203,\x201,\x20null','noAnswerContacts','`state`\x20=\x2010\x20,\x201,\x20null','`state`\x20=\x2011\x20,\x201,\x20null','moveContactsQueueCampaignHopperFinal','VoiceQueue','cm_hopper','fromQuery','phone','scheduledAt','createdAt','updatedAt','select','field','NOW()','ANY_VALUE(ContactId)','ContactId','ANY_VALUE(ListId)','VoiceQueueId','from','VoiceQueueId\x20=\x20?','toString','state','calleridnum\x20IS\x20NOT\x20NULL','calleridnum\x20NOT\x20IN\x20(?)','calleridnum','cm_hopper_final','state\x20=\x204','group','moveContactsIvrCampaignHopperFinal','into','ListId','CampaignId','ANY_VALUE(calleridnum)','ANY_VALUE(CampaignId)','CampaignId\x20=\x20?','state\x20=\x20?','checkContactHopper','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','error','stack','send','CmHopperFinal','model','map','name','keys','query','intersection'];(function(_0x466772,_0x290274){var _0x3545ab=function(_0x5ecac1){while(--_0x5ecac1){_0x466772['push'](_0x466772['shift']());}};_0x3545ab(++_0x290274);}(_0x1261,0x144));var _0x1126=function(_0x5da63e,_0x4d3503){_0x5da63e=_0x5da63e-0x0;var _0x442aca=_0x1261[_0x5da63e];return _0x442aca;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1126('0x0'));var zipdir=require(_0x1126('0x1'));var jsonpatch=require(_0x1126('0x2'));var rp=require(_0x1126('0x3'));var moment=require(_0x1126('0x4'));var BPromise=require(_0x1126('0x5'));var Mustache=require(_0x1126('0x6'));var util=require(_0x1126('0x7'));var path=require(_0x1126('0x8'));var sox=require(_0x1126('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1126('0xa'));var _=require(_0x1126('0xb'));var squel=require('squel');var crypto=require(_0x1126('0xc'));var jsforce=require(_0x1126('0xd'));var deskjs=require(_0x1126('0xe'));var toCsv=require(_0x1126('0xf'));var querystring=require(_0x1126('0x10'));var Papa=require('papaparse');var Redis=require(_0x1126('0x11'));var authService=require(_0x1126('0x12'));var qs=require(_0x1126('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1126('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x1126('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x1126('0x16'));var db=require(_0x1126('0x17'))['db'];function respondWithStatusCode(_0xd26a32,_0x273896){_0x273896=_0x273896||0xcc;return function(_0xca0355){if(_0xca0355){return _0xd26a32[_0x1126('0x18')](_0x273896);}return _0xd26a32[_0x1126('0x19')](_0x273896)[_0x1126('0x1a')]();};}function respondWithResult(_0x43850b,_0x53a8f0){_0x53a8f0=_0x53a8f0||0xc8;return function(_0x5de9a7){if(_0x5de9a7){return _0x43850b[_0x1126('0x19')](_0x53a8f0)[_0x1126('0x1b')](_0x5de9a7);}};}function respondWithFilteredResult(_0x279455,_0x4be0c6){return function(_0x45149c){if(_0x45149c){var _0x4794a7=typeof _0x4be0c6[_0x1126('0x1c')]===_0x1126('0x1d')&&typeof _0x4be0c6[_0x1126('0x1e')]==='undefined';var _0x245cd7=_0x45149c[_0x1126('0x1f')];var _0x4a7b49=_0x4794a7?0x0:_0x4be0c6['offset'];var _0x22ae0b=_0x4794a7?_0x45149c[_0x1126('0x1f')]:_0x4be0c6['offset']+_0x4be0c6['limit'];var _0x4564c0;if(_0x22ae0b>=_0x245cd7){_0x22ae0b=_0x245cd7;_0x4564c0=0xc8;}else{_0x4564c0=0xce;}_0x279455['status'](_0x4564c0);return _0x279455[_0x1126('0x20')](_0x1126('0x21'),_0x4a7b49+'-'+_0x22ae0b+'/'+_0x245cd7)[_0x1126('0x1b')](_0x45149c);}return null;};}function patchUpdates(_0x54400a){return function(_0x2a08ba){try{jsonpatch['apply'](_0x2a08ba,_0x54400a,!![]);}catch(_0x56efeb){return BPromise[_0x1126('0x22')](_0x56efeb);}return _0x2a08ba[_0x1126('0x23')]();};}function saveUpdates(_0x25b24b,_0x36d254){return function(_0x526ca1){if(_0x526ca1){return _0x526ca1[_0x1126('0x24')](_0x25b24b)[_0x1126('0x25')](function(_0x48a08d){return _0x48a08d;});}return null;};}function removeEntity(_0x2175fa,_0x59cd8e){return function(_0x529dd9){if(_0x529dd9){return _0x529dd9['destroy']()[_0x1126('0x25')](function(){_0x2175fa[_0x1126('0x19')](0xcc)[_0x1126('0x1a')]();});}};}function handleEntityNotFound(_0x34bcf1,_0x566c09){return function(_0x1b07a7){if(!_0x1b07a7){_0x34bcf1[_0x1126('0x18')](0x194);}return _0x1b07a7;};}function handleError(_0x38119d,_0x589725){_0x589725=_0x589725||0x1f4;return function(_0x35eec3){logger[_0x1126('0x26')](_0x35eec3[_0x1126('0x27')]);if(_0x35eec3['name']){delete _0x35eec3['name'];}_0x38119d[_0x1126('0x19')](_0x589725)[_0x1126('0x28')](_0x35eec3);};}exports['index']=function(_0x2fb797,_0x23d2bc){var _0x4a334a={},_0x3fa694={},_0x4bf807={'count':0x0,'rows':[]};var _0xc62460=_['map'](db[_0x1126('0x29')]['rawAttributes'],function(_0x378f4d){return{'name':_0x378f4d['fieldName'],'type':_0x378f4d['type']['key']};});_0x3fa694[_0x1126('0x2a')]=_[_0x1126('0x2b')](_0xc62460,_0x1126('0x2c'));_0x3fa694['query']=_[_0x1126('0x2d')](_0x2fb797[_0x1126('0x2e')]);_0x3fa694['filters']=_[_0x1126('0x2f')](_0x3fa694[_0x1126('0x2a')],_0x3fa694[_0x1126('0x2e')]);_0x4a334a[_0x1126('0x30')]=_['intersection'](_0x3fa694['model'],qs[_0x1126('0x31')](_0x2fb797[_0x1126('0x2e')][_0x1126('0x31')]));_0x4a334a[_0x1126('0x30')]=_0x4a334a['attributes'][_0x1126('0x32')]?_0x4a334a[_0x1126('0x30')]:_0x3fa694[_0x1126('0x2a')];if(!_0x2fb797[_0x1126('0x2e')][_0x1126('0x33')]('nolimit')){_0x4a334a[_0x1126('0x1e')]=qs[_0x1126('0x1e')](_0x2fb797[_0x1126('0x2e')][_0x1126('0x1e')]);_0x4a334a['offset']=qs['offset'](_0x2fb797[_0x1126('0x2e')][_0x1126('0x1c')]);}_0x4a334a['order']=qs[_0x1126('0x34')](_0x2fb797[_0x1126('0x2e')][_0x1126('0x34')]);_0x4a334a['where']=qs['filters'](_[_0x1126('0x35')](_0x2fb797[_0x1126('0x2e')],_0x3fa694[_0x1126('0x36')]),_0xc62460);if(_0x2fb797[_0x1126('0x2e')]['filter']){_0x4a334a[_0x1126('0x37')]=_['merge'](_0x4a334a[_0x1126('0x37')],{'$or':_[_0x1126('0x2b')](_0xc62460,function(_0xfa96e0){if(_0xfa96e0[_0x1126('0x38')]!==_0x1126('0x39')){var _0x5746f6={};_0x5746f6[_0xfa96e0[_0x1126('0x2c')]]={'$like':'%'+_0x2fb797[_0x1126('0x2e')][_0x1126('0x3a')]+'%'};return _0x5746f6;}})});}_0x4a334a=_[_0x1126('0x3b')]({},_0x4a334a,_0x2fb797[_0x1126('0x3c')]);var _0x3442b8={'where':_0x4a334a[_0x1126('0x37')]};return db['CmHopperFinal'][_0x1126('0x1f')](_0x3442b8)[_0x1126('0x25')](function(_0x227a6b){_0x4bf807[_0x1126('0x1f')]=_0x227a6b;if(_0x2fb797[_0x1126('0x2e')]['includeAll']){_0x4a334a['include']=[{'all':!![]}];}return db[_0x1126('0x29')][_0x1126('0x3d')](_0x4a334a);})[_0x1126('0x25')](function(_0x21c38e){_0x4bf807[_0x1126('0x3e')]=_0x21c38e;return _0x4bf807;})[_0x1126('0x25')](respondWithFilteredResult(_0x23d2bc,_0x4a334a))['catch'](handleError(_0x23d2bc,null));};exports['show']=function(_0x4cb1db,_0xb8054e){var _0x5d4194={'raw':!![],'where':{'id':_0x4cb1db[_0x1126('0x3f')]['id']}},_0xf84005={};_0xf84005[_0x1126('0x2a')]=_[_0x1126('0x2d')](db['CmHopperFinal']['rawAttributes']);_0xf84005[_0x1126('0x2e')]=_[_0x1126('0x2d')](_0x4cb1db[_0x1126('0x2e')]);_0xf84005['filters']=_[_0x1126('0x2f')](_0xf84005['model'],_0xf84005[_0x1126('0x2e')]);_0x5d4194['attributes']=_[_0x1126('0x2f')](_0xf84005[_0x1126('0x2a')],qs[_0x1126('0x31')](_0x4cb1db['query'][_0x1126('0x31')]));_0x5d4194[_0x1126('0x30')]=_0x5d4194[_0x1126('0x30')]['length']?_0x5d4194['attributes']:_0xf84005['model'];if(_0x4cb1db[_0x1126('0x2e')]['includeAll']){_0x5d4194[_0x1126('0x40')]=[{'all':!![]}];}_0x5d4194=_['merge']({},_0x5d4194,_0x4cb1db[_0x1126('0x3c')]);return db[_0x1126('0x29')][_0x1126('0x41')](_0x5d4194)[_0x1126('0x25')](handleEntityNotFound(_0xb8054e,null))[_0x1126('0x25')](respondWithResult(_0xb8054e,null))['catch'](handleError(_0xb8054e,null));};exports[_0x1126('0x42')]=function(_0x512f60,_0x5111d3){return db[_0x1126('0x29')][_0x1126('0x42')]()['then'](respondWithResult(_0x5111d3,null))[_0x1126('0x43')](handleError(_0x5111d3,null));};exports[_0x1126('0x24')]=function(_0x518e0a,_0x3e4eeb){if(_0x518e0a[_0x1126('0x44')][_0x1126('0x45')]){delete _0x518e0a['body'][_0x1126('0x45')];}return db[_0x1126('0x29')][_0x1126('0x41')]({'where':{'uniqueid':_0x518e0a[_0x1126('0x3f')]['id']}})[_0x1126('0x25')](handleEntityNotFound(_0x3e4eeb,null))[_0x1126('0x25')](saveUpdates(_0x518e0a[_0x1126('0x44')],null))[_0x1126('0x25')](respondWithResult(_0x3e4eeb,null))['catch'](handleError(_0x3e4eeb,null));};exports[_0x1126('0x46')]=function(_0x5a2287,_0x40168e,_0x2ad118){return db['CmHopperFinal']['findAll']({'raw':![],'where':{'VoiceQueueId':_0x5a2287[_0x1126('0x3f')]['id']},'attributes':[[db[_0x1126('0x47')]['fn'](_0x1126('0x48'),db['sequelize']['fn']('IF',db[_0x1126('0x47')][_0x1126('0x49')](_0x1126('0x4a')))),_0x1126('0x4b')],[db['sequelize']['fn'](_0x1126('0x48'),db[_0x1126('0x47')]['fn']('IF',db['sequelize']['literal']('`state`\x20=\x203,\x201,\x20null'))),'noAnswerContacts'],[db[_0x1126('0x47')]['fn'](_0x1126('0x48'),db['sequelize']['fn']('IF',db[_0x1126('0x47')][_0x1126('0x49')](_0x1126('0x4c')))),_0x1126('0x4d')],[db[_0x1126('0x47')]['fn']('COUNT',db[_0x1126('0x47')]['fn']('IF',db[_0x1126('0x47')]['literal'](_0x1126('0x4e')))),_0x1126('0x4f')],[db[_0x1126('0x47')]['fn'](_0x1126('0x48'),db[_0x1126('0x47')]['fn']('IF',db['sequelize'][_0x1126('0x49')]('`state`\x20=\x2010\x20,\x201,\x20null'))),_0x1126('0x50')],[db[_0x1126('0x47')]['fn'](_0x1126('0x48'),db['sequelize']['fn']('IF',db[_0x1126('0x47')][_0x1126('0x49')]('`state`\x20=\x2011\x20,\x201,\x20null'))),_0x1126('0x51')],[db[_0x1126('0x47')]['fn'](_0x1126('0x48'),db['sequelize']['fn']('IF',db[_0x1126('0x47')][_0x1126('0x49')](_0x1126('0x52')))),_0x1126('0x53')],[db[_0x1126('0x47')]['fn'](_0x1126('0x48'),db[_0x1126('0x47')]['fn']('IF',db[_0x1126('0x47')]['literal'](_0x1126('0x54')))),_0x1126('0x55')]]})[_0x1126('0x25')](handleEntityNotFound(_0x40168e,null))[_0x1126('0x25')](respondWithResult(_0x40168e,null))[_0x1126('0x43')](handleError(_0x40168e,null));};exports['countContactsIvrCampaignHopperFinal']=function(_0xcc1a95,_0x315386,_0x5e0ea1){return db[_0x1126('0x29')]['findAll']({'raw':![],'where':{'CampaignId':_0xcc1a95[_0x1126('0x3f')]['id']},'attributes':[[db[_0x1126('0x47')]['fn']('COUNT',db[_0x1126('0x47')]['fn']('IF',db[_0x1126('0x47')][_0x1126('0x49')]('`state`\x20=\x200,\x201,\x20null'))),_0x1126('0x4b')],[db['sequelize']['fn']('COUNT',db[_0x1126('0x47')]['fn']('IF',db[_0x1126('0x47')][_0x1126('0x49')](_0x1126('0x56')))),_0x1126('0x57')],[db[_0x1126('0x47')]['fn'](_0x1126('0x48'),db['sequelize']['fn']('IF',db[_0x1126('0x47')][_0x1126('0x49')](_0x1126('0x4c')))),_0x1126('0x4d')],[db[_0x1126('0x47')]['fn'](_0x1126('0x48'),db['sequelize']['fn']('IF',db['sequelize'][_0x1126('0x49')](_0x1126('0x4e')))),'congestionContacts'],[db['sequelize']['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x1126('0x47')][_0x1126('0x49')](_0x1126('0x58')))),'dropContacts'],[db[_0x1126('0x47')]['fn'](_0x1126('0x48'),db[_0x1126('0x47')]['fn']('IF',db[_0x1126('0x47')][_0x1126('0x49')](_0x1126('0x59')))),_0x1126('0x51')],[db['sequelize']['fn'](_0x1126('0x48'),db[_0x1126('0x47')]['fn']('IF',db[_0x1126('0x47')][_0x1126('0x49')](_0x1126('0x52')))),'reCallContacts'],[db['sequelize']['fn'](_0x1126('0x48'),db[_0x1126('0x47')]['fn']('IF',db['sequelize'][_0x1126('0x49')](_0x1126('0x54')))),_0x1126('0x55')]]})[_0x1126('0x25')](handleEntityNotFound(_0x315386,null))[_0x1126('0x25')](respondWithResult(_0x315386,null))[_0x1126('0x43')](handleError(_0x315386,null));};exports[_0x1126('0x5a')]=function(_0x247f12,_0xd20fbe,_0x3d5e15){return db[_0x1126('0x5b')][_0x1126('0x41')]({'where':{'id':_0x247f12[_0x1126('0x3f')]['id']}})['then'](handleEntityNotFound(_0xd20fbe,null))[_0x1126('0x25')](function(_0x274343){var _0x2b61ae;if(_0x274343){_0x2b61ae=squel['insert']()['into'](_0x1126('0x5c'))[_0x1126('0x5d')]([_0x1126('0x5e'),_0x1126('0x5f'),'ContactId','ListId','VoiceQueueId',_0x1126('0x60'),_0x1126('0x61')],squel[_0x1126('0x62')]()[_0x1126('0x63')]('ANY_VALUE(calleridnum)',_0x1126('0x5e'))['field'](_0x1126('0x64'),_0x1126('0x5f'))[_0x1126('0x63')](_0x1126('0x65'),_0x1126('0x66'))[_0x1126('0x63')](_0x1126('0x67'),'ListId')[_0x1126('0x63')]('ANY_VALUE(VoiceQueueId)',_0x1126('0x68'))[_0x1126('0x63')]('NOW()',_0x1126('0x60'))[_0x1126('0x63')]('NOW()',_0x1126('0x61'))[_0x1126('0x69')]('cm_hopper_final')['where'](_0x1126('0x6a'),_0x247f12[_0x1126('0x3f')]['id'][_0x1126('0x6b')]())['where']('state\x20=\x20?',_0x247f12['body'][_0x1126('0x6c')]['toString']())['where'](_0x1126('0x6d'))['where'](_0x1126('0x6e'),squel[_0x1126('0x62')]()['field'](_0x1126('0x5e'))[_0x1126('0x69')](_0x1126('0x5c'))[_0x1126('0x37')](_0x1126('0x6a'),_0x247f12['params']['id'][_0x1126('0x6b')]()))[_0x1126('0x37')]('calleridnum\x20NOT\x20IN\x20(?)',squel[_0x1126('0x62')]()[_0x1126('0x63')](_0x1126('0x6f'))[_0x1126('0x69')](_0x1126('0x70'))[_0x1126('0x37')](_0x1126('0x6a'),_0x247f12[_0x1126('0x3f')]['id'][_0x1126('0x6b')]())[_0x1126('0x37')](_0x1126('0x71')))[_0x1126('0x72')](_0x1126('0x66')))[_0x1126('0x6b')]();return db[_0x1126('0x47')][_0x1126('0x2e')](_0x2b61ae);}return[];})['then'](respondWithResult(_0xd20fbe,null))[_0x1126('0x43')](handleError(_0xd20fbe,null));};exports[_0x1126('0x73')]=function(_0x33cccf,_0x1483f4,_0x3be5bf){return db['Campaign'][_0x1126('0x41')]({'where':{'id':_0x33cccf['params']['id']}})['then'](handleEntityNotFound(_0x1483f4,null))[_0x1126('0x25')](function(_0x2b1884){var _0x55f366;if(_0x2b1884){_0x55f366=squel['insert']()[_0x1126('0x74')](_0x1126('0x5c'))[_0x1126('0x5d')]([_0x1126('0x5e'),_0x1126('0x5f'),_0x1126('0x66'),_0x1126('0x75'),_0x1126('0x76'),_0x1126('0x60'),'updatedAt'],squel[_0x1126('0x62')]()[_0x1126('0x63')](_0x1126('0x77'),_0x1126('0x5e'))[_0x1126('0x63')](_0x1126('0x64'),'scheduledAt')[_0x1126('0x63')](_0x1126('0x65'),_0x1126('0x66'))[_0x1126('0x63')](_0x1126('0x67'),_0x1126('0x75'))[_0x1126('0x63')](_0x1126('0x78'),_0x1126('0x76'))[_0x1126('0x63')]('NOW()','createdAt')[_0x1126('0x63')]('NOW()',_0x1126('0x61'))['from'](_0x1126('0x70'))['where'](_0x1126('0x79'),_0x33cccf['params']['id']['toString']())['where'](_0x1126('0x7a'),_0x33cccf[_0x1126('0x44')]['state']['toString']())[_0x1126('0x37')](_0x1126('0x6d'))[_0x1126('0x37')]('calleridnum\x20NOT\x20IN\x20(?)',squel['select']()[_0x1126('0x63')]('phone')[_0x1126('0x69')](_0x1126('0x5c'))[_0x1126('0x37')](_0x1126('0x79'),_0x33cccf[_0x1126('0x3f')]['id']['toString']()))['where'](_0x1126('0x6e'),squel[_0x1126('0x62')]()[_0x1126('0x63')](_0x1126('0x6f'))[_0x1126('0x69')](_0x1126('0x70'))[_0x1126('0x37')](_0x1126('0x79'),_0x33cccf[_0x1126('0x3f')]['id'][_0x1126('0x6b')]())[_0x1126('0x37')]('state\x20=\x204'))[_0x1126('0x72')]('ContactId'))[_0x1126('0x6b')]();return db['sequelize'][_0x1126('0x2e')](_0x55f366);}return[];})[_0x1126('0x25')](respondWithResult(_0x1483f4,null))[_0x1126('0x43')](handleError(_0x1483f4,null));};exports[_0x1126('0x7b')]=function(_0x59c04b,_0x429183,_0x834360){return db['CmHopper']['findOne']({'where':{'VoiceQueueId':_0x59c04b[_0x1126('0x44')][_0x1126('0x68')],'CampaignId':_0x59c04b[_0x1126('0x44')]['CampaignId'],'ContactId':_0x59c04b[_0x1126('0x44')]['ContactId']}})[_0x1126('0x25')](handleEntityNotFound(_0x429183,null))[_0x1126('0x25')](function(_0x4d6bb2){if(_0x4d6bb2){return _0x4d6bb2;}return null;})[_0x1126('0x25')](respondWithResult(_0x429183,null))[_0x1126('0x43')](handleError(_0x429183,null));}; \ No newline at end of file +var _0xadb5=['`state`\x20=\x2022,\x201,\x20null','reCallContacts','`state`\x20=\x2019,\x201,\x20null','answeringMachine','noSuchContacts','VoiceQueue','find','insert','cm_hopper','fromQuery','phone','ContactId','ListId','createdAt','select','field','NOW()','scheduledAt','ANY_VALUE(ContactId)','ANY_VALUE(VoiceQueueId)','updatedAt','cm_hopper_final','VoiceQueueId\x20=\x20?','toString','state\x20=\x20?','state','calleridnum\x20IS\x20NOT\x20NULL','calleridnum\x20NOT\x20IN\x20(?)','from','calleridnum','state\x20=\x204','group','Campaign','into','CampaignId','ANY_VALUE(calleridnum)','ANY_VALUE(ListId)','ANY_VALUE(CampaignId)','CampaignId\x20=\x20?','checkContactHopper','CmHopper','findOne','VoiceQueueId','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','end','stack','name','send','index','map','CmHopperFinal','fieldName','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filters','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','describe','body','uniqueid','countContactsQueueCampaignHopperFinal','sequelize','literal','`state`\x20=\x200,\x201,\x20null','COUNT','`state`\x20=\x203,\x201,\x20null','noAnswerContacts','`state`\x20=\x205,\x201,\x20null','busyContacts','`state`\x20=\x208,\x201,\x20null','congestionContacts','`state`\x20=\x2010\x20,\x201,\x20null','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts'];(function(_0x1c3fac,_0x384c82){var _0x4bc099=function(_0x2dff89){while(--_0x2dff89){_0x1c3fac['push'](_0x1c3fac['shift']());}};_0x4bc099(++_0x384c82);}(_0xadb5,0xad));var _0x5adb=function(_0x1b814a,_0x251c60){_0x1b814a=_0x1b814a-0x0;var _0x466dae=_0xadb5[_0x1b814a];return _0x466dae;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5adb('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5adb('0x1'));var rp=require(_0x5adb('0x2'));var moment=require(_0x5adb('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x5adb('0x4'));var util=require(_0x5adb('0x5'));var path=require(_0x5adb('0x6'));var sox=require('sox');var csv=require(_0x5adb('0x7'));var ejs=require(_0x5adb('0x8'));var fs=require('fs');var fs_extra=require(_0x5adb('0x9'));var _=require(_0x5adb('0xa'));var squel=require(_0x5adb('0xb'));var crypto=require(_0x5adb('0xc'));var jsforce=require(_0x5adb('0xd'));var deskjs=require(_0x5adb('0xe'));var toCsv=require(_0x5adb('0x7'));var querystring=require(_0x5adb('0xf'));var Papa=require(_0x5adb('0x10'));var Redis=require(_0x5adb('0x11'));var authService=require(_0x5adb('0x12'));var qs=require(_0x5adb('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x5adb('0x14'))(_0x5adb('0x15'));var utils=require(_0x5adb('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x5adb('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2a0b70,_0x5433bf){_0x5433bf=_0x5433bf||0xcc;return function(_0x8cfcc6){if(_0x8cfcc6){return _0x2a0b70[_0x5adb('0x18')](_0x5433bf);}return _0x2a0b70[_0x5adb('0x19')](_0x5433bf)['end']();};}function respondWithResult(_0x2a545b,_0x34af2c){_0x34af2c=_0x34af2c||0xc8;return function(_0xf82f72){if(_0xf82f72){return _0x2a545b['status'](_0x34af2c)[_0x5adb('0x1a')](_0xf82f72);}};}function respondWithFilteredResult(_0x518823,_0x367d82){return function(_0x42a482){if(_0x42a482){var _0x30614e=typeof _0x367d82[_0x5adb('0x1b')]===_0x5adb('0x1c')&&typeof _0x367d82[_0x5adb('0x1d')]===_0x5adb('0x1c');var _0x42f4c6=_0x42a482[_0x5adb('0x1e')];var _0x529b65=_0x30614e?0x0:_0x367d82[_0x5adb('0x1b')];var _0x5de028=_0x30614e?_0x42a482[_0x5adb('0x1e')]:_0x367d82['offset']+_0x367d82[_0x5adb('0x1d')];var _0x50e84f;if(_0x5de028>=_0x42f4c6){_0x5de028=_0x42f4c6;_0x50e84f=0xc8;}else{_0x50e84f=0xce;}_0x518823['status'](_0x50e84f);return _0x518823[_0x5adb('0x1f')](_0x5adb('0x20'),_0x529b65+'-'+_0x5de028+'/'+_0x42f4c6)[_0x5adb('0x1a')](_0x42a482);}return null;};}function patchUpdates(_0x1fd4a7){return function(_0x99bc6c){try{jsonpatch['apply'](_0x99bc6c,_0x1fd4a7,!![]);}catch(_0x3255b3){return BPromise['reject'](_0x3255b3);}return _0x99bc6c['save']();};}function saveUpdates(_0x3754cc,_0x379b33){return function(_0x1a38d3){if(_0x1a38d3){return _0x1a38d3[_0x5adb('0x21')](_0x3754cc)[_0x5adb('0x22')](function(_0x413911){return _0x413911;});}return null;};}function removeEntity(_0xfd9bb9,_0x4ca150){return function(_0x4b1957){if(_0x4b1957){return _0x4b1957[_0x5adb('0x23')]()[_0x5adb('0x22')](function(){_0xfd9bb9[_0x5adb('0x19')](0xcc)[_0x5adb('0x24')]();});}};}function handleEntityNotFound(_0x49f203,_0x2fee18){return function(_0x2e1e63){if(!_0x2e1e63){_0x49f203['sendStatus'](0x194);}return _0x2e1e63;};}function handleError(_0x1feecf,_0x1ded9f){_0x1ded9f=_0x1ded9f||0x1f4;return function(_0x1a0acd){logger['error'](_0x1a0acd[_0x5adb('0x25')]);if(_0x1a0acd[_0x5adb('0x26')]){delete _0x1a0acd[_0x5adb('0x26')];}_0x1feecf[_0x5adb('0x19')](_0x1ded9f)[_0x5adb('0x27')](_0x1a0acd);};}exports[_0x5adb('0x28')]=function(_0x4a5d46,_0x49992e){var _0x5d457e={},_0x39bddd={},_0x1eac55={'count':0x0,'rows':[]};var _0x60a672=_[_0x5adb('0x29')](db[_0x5adb('0x2a')]['rawAttributes'],function(_0x11ec2a){return{'name':_0x11ec2a[_0x5adb('0x2b')],'type':_0x11ec2a[_0x5adb('0x2c')][_0x5adb('0x2d')]};});_0x39bddd[_0x5adb('0x2e')]=_[_0x5adb('0x29')](_0x60a672,_0x5adb('0x26'));_0x39bddd[_0x5adb('0x2f')]=_[_0x5adb('0x30')](_0x4a5d46[_0x5adb('0x2f')]);_0x39bddd['filters']=_[_0x5adb('0x31')](_0x39bddd['model'],_0x39bddd[_0x5adb('0x2f')]);_0x5d457e[_0x5adb('0x32')]=_['intersection'](_0x39bddd[_0x5adb('0x2e')],qs[_0x5adb('0x33')](_0x4a5d46[_0x5adb('0x2f')]['fields']));_0x5d457e[_0x5adb('0x32')]=_0x5d457e[_0x5adb('0x32')]['length']?_0x5d457e['attributes']:_0x39bddd[_0x5adb('0x2e')];if(!_0x4a5d46['query'][_0x5adb('0x34')](_0x5adb('0x35'))){_0x5d457e[_0x5adb('0x1d')]=qs[_0x5adb('0x1d')](_0x4a5d46[_0x5adb('0x2f')]['limit']);_0x5d457e[_0x5adb('0x1b')]=qs[_0x5adb('0x1b')](_0x4a5d46[_0x5adb('0x2f')]['offset']);}_0x5d457e['order']=qs[_0x5adb('0x36')](_0x4a5d46[_0x5adb('0x2f')]['sort']);_0x5d457e[_0x5adb('0x37')]=qs['filters'](_[_0x5adb('0x38')](_0x4a5d46['query'],_0x39bddd[_0x5adb('0x39')]),_0x60a672);if(_0x4a5d46['query'][_0x5adb('0x3a')]){_0x5d457e[_0x5adb('0x37')]=_['merge'](_0x5d457e[_0x5adb('0x37')],{'$or':_['map'](_0x60a672,function(_0xadbe37){if(_0xadbe37[_0x5adb('0x2c')]!==_0x5adb('0x3b')){var _0x50edd1={};_0x50edd1[_0xadbe37[_0x5adb('0x26')]]={'$like':'%'+_0x4a5d46[_0x5adb('0x2f')][_0x5adb('0x3a')]+'%'};return _0x50edd1;}})});}_0x5d457e=_[_0x5adb('0x3c')]({},_0x5d457e,_0x4a5d46[_0x5adb('0x3d')]);var _0x52d74f={'where':_0x5d457e['where']};return db['CmHopperFinal']['count'](_0x52d74f)[_0x5adb('0x22')](function(_0x2fbe14){_0x1eac55[_0x5adb('0x1e')]=_0x2fbe14;if(_0x4a5d46[_0x5adb('0x2f')][_0x5adb('0x3e')]){_0x5d457e[_0x5adb('0x3f')]=[{'all':!![]}];}return db[_0x5adb('0x2a')][_0x5adb('0x40')](_0x5d457e);})['then'](function(_0x53f2c6){_0x1eac55[_0x5adb('0x41')]=_0x53f2c6;return _0x1eac55;})['then'](respondWithFilteredResult(_0x49992e,_0x5d457e))[_0x5adb('0x42')](handleError(_0x49992e,null));};exports[_0x5adb('0x43')]=function(_0x299746,_0x121714){var _0xdfecfd={'raw':!![],'where':{'id':_0x299746[_0x5adb('0x44')]['id']}},_0x522ee5={};_0x522ee5[_0x5adb('0x2e')]=_['keys'](db[_0x5adb('0x2a')][_0x5adb('0x45')]);_0x522ee5['query']=_[_0x5adb('0x30')](_0x299746[_0x5adb('0x2f')]);_0x522ee5[_0x5adb('0x39')]=_[_0x5adb('0x31')](_0x522ee5[_0x5adb('0x2e')],_0x522ee5[_0x5adb('0x2f')]);_0xdfecfd[_0x5adb('0x32')]=_['intersection'](_0x522ee5['model'],qs[_0x5adb('0x33')](_0x299746[_0x5adb('0x2f')][_0x5adb('0x33')]));_0xdfecfd[_0x5adb('0x32')]=_0xdfecfd['attributes']['length']?_0xdfecfd[_0x5adb('0x32')]:_0x522ee5[_0x5adb('0x2e')];if(_0x299746[_0x5adb('0x2f')][_0x5adb('0x3e')]){_0xdfecfd[_0x5adb('0x3f')]=[{'all':!![]}];}_0xdfecfd=_['merge']({},_0xdfecfd,_0x299746[_0x5adb('0x3d')]);return db[_0x5adb('0x2a')]['find'](_0xdfecfd)[_0x5adb('0x22')](handleEntityNotFound(_0x121714,null))[_0x5adb('0x22')](respondWithResult(_0x121714,null))[_0x5adb('0x42')](handleError(_0x121714,null));};exports[_0x5adb('0x46')]=function(_0x186bd2,_0x3a5409){return db[_0x5adb('0x2a')][_0x5adb('0x46')]()['then'](respondWithResult(_0x3a5409,null))[_0x5adb('0x42')](handleError(_0x3a5409,null));};exports['update']=function(_0x51bc49,_0x5015ee){if(_0x51bc49[_0x5adb('0x47')][_0x5adb('0x48')]){delete _0x51bc49[_0x5adb('0x47')]['uniqueid'];}return db[_0x5adb('0x2a')]['find']({'where':{'uniqueid':_0x51bc49[_0x5adb('0x44')]['id']}})[_0x5adb('0x22')](handleEntityNotFound(_0x5015ee,null))[_0x5adb('0x22')](saveUpdates(_0x51bc49['body'],null))[_0x5adb('0x22')](respondWithResult(_0x5015ee,null))['catch'](handleError(_0x5015ee,null));};exports[_0x5adb('0x49')]=function(_0x6dc067,_0x55c535,_0x2402a3){return db[_0x5adb('0x2a')][_0x5adb('0x40')]({'raw':![],'where':{'VoiceQueueId':_0x6dc067[_0x5adb('0x44')]['id']},'attributes':[[db[_0x5adb('0x4a')]['fn']('COUNT',db[_0x5adb('0x4a')]['fn']('IF',db[_0x5adb('0x4a')][_0x5adb('0x4b')](_0x5adb('0x4c')))),'noSuchContacts'],[db[_0x5adb('0x4a')]['fn'](_0x5adb('0x4d'),db[_0x5adb('0x4a')]['fn']('IF',db['sequelize'][_0x5adb('0x4b')](_0x5adb('0x4e')))),_0x5adb('0x4f')],[db[_0x5adb('0x4a')]['fn']('COUNT',db[_0x5adb('0x4a')]['fn']('IF',db[_0x5adb('0x4a')][_0x5adb('0x4b')](_0x5adb('0x50')))),_0x5adb('0x51')],[db['sequelize']['fn'](_0x5adb('0x4d'),db['sequelize']['fn']('IF',db[_0x5adb('0x4a')]['literal'](_0x5adb('0x52')))),_0x5adb('0x53')],[db[_0x5adb('0x4a')]['fn'](_0x5adb('0x4d'),db['sequelize']['fn']('IF',db[_0x5adb('0x4a')][_0x5adb('0x4b')](_0x5adb('0x54')))),'dropContacts'],[db['sequelize']['fn']('COUNT',db[_0x5adb('0x4a')]['fn']('IF',db[_0x5adb('0x4a')][_0x5adb('0x4b')](_0x5adb('0x55')))),_0x5adb('0x56')],[db[_0x5adb('0x4a')]['fn'](_0x5adb('0x4d'),db[_0x5adb('0x4a')]['fn']('IF',db[_0x5adb('0x4a')][_0x5adb('0x4b')](_0x5adb('0x57')))),_0x5adb('0x58')],[db[_0x5adb('0x4a')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x5adb('0x4a')][_0x5adb('0x4b')](_0x5adb('0x59')))),_0x5adb('0x5a')]]})['then'](handleEntityNotFound(_0x55c535,null))[_0x5adb('0x22')](respondWithResult(_0x55c535,null))[_0x5adb('0x42')](handleError(_0x55c535,null));};exports['countContactsIvrCampaignHopperFinal']=function(_0x5cb50e,_0x476e62,_0x1505f7){return db['CmHopperFinal'][_0x5adb('0x40')]({'raw':![],'where':{'CampaignId':_0x5cb50e[_0x5adb('0x44')]['id']},'attributes':[[db[_0x5adb('0x4a')]['fn'](_0x5adb('0x4d'),db[_0x5adb('0x4a')]['fn']('IF',db[_0x5adb('0x4a')]['literal'](_0x5adb('0x4c')))),_0x5adb('0x5b')],[db[_0x5adb('0x4a')]['fn']('COUNT',db[_0x5adb('0x4a')]['fn']('IF',db[_0x5adb('0x4a')][_0x5adb('0x4b')]('`state`\x20=\x203,\x201,\x20null'))),_0x5adb('0x4f')],[db['sequelize']['fn'](_0x5adb('0x4d'),db[_0x5adb('0x4a')]['fn']('IF',db[_0x5adb('0x4a')]['literal'](_0x5adb('0x50')))),_0x5adb('0x51')],[db['sequelize']['fn'](_0x5adb('0x4d'),db[_0x5adb('0x4a')]['fn']('IF',db[_0x5adb('0x4a')][_0x5adb('0x4b')]('`state`\x20=\x208,\x201,\x20null'))),_0x5adb('0x53')],[db[_0x5adb('0x4a')]['fn'](_0x5adb('0x4d'),db[_0x5adb('0x4a')]['fn']('IF',db['sequelize']['literal'](_0x5adb('0x54')))),'dropContacts'],[db['sequelize']['fn']('COUNT',db[_0x5adb('0x4a')]['fn']('IF',db[_0x5adb('0x4a')]['literal'](_0x5adb('0x55')))),_0x5adb('0x56')],[db[_0x5adb('0x4a')]['fn'](_0x5adb('0x4d'),db[_0x5adb('0x4a')]['fn']('IF',db[_0x5adb('0x4a')][_0x5adb('0x4b')](_0x5adb('0x57')))),'reCallContacts'],[db['sequelize']['fn']('COUNT',db[_0x5adb('0x4a')]['fn']('IF',db[_0x5adb('0x4a')][_0x5adb('0x4b')](_0x5adb('0x59')))),_0x5adb('0x5a')]]})[_0x5adb('0x22')](handleEntityNotFound(_0x476e62,null))[_0x5adb('0x22')](respondWithResult(_0x476e62,null))[_0x5adb('0x42')](handleError(_0x476e62,null));};exports['moveContactsQueueCampaignHopperFinal']=function(_0x5e55c2,_0x1fc73b,_0x56df90){return db[_0x5adb('0x5c')][_0x5adb('0x5d')]({'where':{'id':_0x5e55c2[_0x5adb('0x44')]['id']}})[_0x5adb('0x22')](handleEntityNotFound(_0x1fc73b,null))[_0x5adb('0x22')](function(_0x236f59){var _0x338aee;if(_0x236f59){_0x338aee=squel[_0x5adb('0x5e')]()['into'](_0x5adb('0x5f'))[_0x5adb('0x60')]([_0x5adb('0x61'),'scheduledAt',_0x5adb('0x62'),_0x5adb('0x63'),'VoiceQueueId',_0x5adb('0x64'),'updatedAt'],squel[_0x5adb('0x65')]()[_0x5adb('0x66')]('ANY_VALUE(calleridnum)',_0x5adb('0x61'))[_0x5adb('0x66')](_0x5adb('0x67'),_0x5adb('0x68'))[_0x5adb('0x66')](_0x5adb('0x69'),_0x5adb('0x62'))[_0x5adb('0x66')]('ANY_VALUE(ListId)',_0x5adb('0x63'))[_0x5adb('0x66')](_0x5adb('0x6a'),'VoiceQueueId')['field'](_0x5adb('0x67'),'createdAt')[_0x5adb('0x66')](_0x5adb('0x67'),_0x5adb('0x6b'))['from'](_0x5adb('0x6c'))[_0x5adb('0x37')](_0x5adb('0x6d'),_0x5e55c2[_0x5adb('0x44')]['id'][_0x5adb('0x6e')]())['where'](_0x5adb('0x6f'),_0x5e55c2[_0x5adb('0x47')][_0x5adb('0x70')][_0x5adb('0x6e')]())['where'](_0x5adb('0x71'))[_0x5adb('0x37')](_0x5adb('0x72'),squel[_0x5adb('0x65')]()[_0x5adb('0x66')](_0x5adb('0x61'))[_0x5adb('0x73')]('cm_hopper')[_0x5adb('0x37')](_0x5adb('0x6d'),_0x5e55c2['params']['id'][_0x5adb('0x6e')]()))[_0x5adb('0x37')]('calleridnum\x20NOT\x20IN\x20(?)',squel[_0x5adb('0x65')]()['field'](_0x5adb('0x74'))[_0x5adb('0x73')]('cm_hopper_final')[_0x5adb('0x37')]('VoiceQueueId\x20=\x20?',_0x5e55c2[_0x5adb('0x44')]['id'][_0x5adb('0x6e')]())[_0x5adb('0x37')](_0x5adb('0x75')))[_0x5adb('0x76')]('ContactId'))[_0x5adb('0x6e')]();return db[_0x5adb('0x4a')][_0x5adb('0x2f')](_0x338aee);}return[];})[_0x5adb('0x22')](respondWithResult(_0x1fc73b,null))['catch'](handleError(_0x1fc73b,null));};exports['moveContactsIvrCampaignHopperFinal']=function(_0x3f3db9,_0x461a07,_0x2e5c96){return db[_0x5adb('0x77')][_0x5adb('0x5d')]({'where':{'id':_0x3f3db9[_0x5adb('0x44')]['id']}})[_0x5adb('0x22')](handleEntityNotFound(_0x461a07,null))['then'](function(_0xda26cc){var _0x14bada;if(_0xda26cc){_0x14bada=squel[_0x5adb('0x5e')]()[_0x5adb('0x78')]('cm_hopper')[_0x5adb('0x60')]([_0x5adb('0x61'),_0x5adb('0x68'),_0x5adb('0x62'),_0x5adb('0x63'),_0x5adb('0x79'),_0x5adb('0x64'),_0x5adb('0x6b')],squel[_0x5adb('0x65')]()['field'](_0x5adb('0x7a'),_0x5adb('0x61'))['field'](_0x5adb('0x67'),_0x5adb('0x68'))[_0x5adb('0x66')](_0x5adb('0x69'),_0x5adb('0x62'))[_0x5adb('0x66')](_0x5adb('0x7b'),_0x5adb('0x63'))['field'](_0x5adb('0x7c'),_0x5adb('0x79'))['field'](_0x5adb('0x67'),_0x5adb('0x64'))[_0x5adb('0x66')]('NOW()','updatedAt')[_0x5adb('0x73')](_0x5adb('0x6c'))[_0x5adb('0x37')]('CampaignId\x20=\x20?',_0x3f3db9[_0x5adb('0x44')]['id'][_0x5adb('0x6e')]())[_0x5adb('0x37')](_0x5adb('0x6f'),_0x3f3db9[_0x5adb('0x47')][_0x5adb('0x70')][_0x5adb('0x6e')]())[_0x5adb('0x37')](_0x5adb('0x71'))[_0x5adb('0x37')](_0x5adb('0x72'),squel[_0x5adb('0x65')]()['field']('phone')[_0x5adb('0x73')](_0x5adb('0x5f'))['where'](_0x5adb('0x7d'),_0x3f3db9[_0x5adb('0x44')]['id'][_0x5adb('0x6e')]()))[_0x5adb('0x37')](_0x5adb('0x72'),squel[_0x5adb('0x65')]()[_0x5adb('0x66')](_0x5adb('0x74'))[_0x5adb('0x73')]('cm_hopper_final')[_0x5adb('0x37')](_0x5adb('0x7d'),_0x3f3db9[_0x5adb('0x44')]['id']['toString']())[_0x5adb('0x37')](_0x5adb('0x75')))[_0x5adb('0x76')](_0x5adb('0x62')))[_0x5adb('0x6e')]();return db[_0x5adb('0x4a')]['query'](_0x14bada);}return[];})[_0x5adb('0x22')](respondWithResult(_0x461a07,null))[_0x5adb('0x42')](handleError(_0x461a07,null));};exports[_0x5adb('0x7e')]=function(_0x1e5532,_0x2c3af8,_0x3a201a){return db[_0x5adb('0x7f')][_0x5adb('0x80')]({'where':{'VoiceQueueId':_0x1e5532[_0x5adb('0x47')][_0x5adb('0x81')],'CampaignId':_0x1e5532['body'][_0x5adb('0x79')],'ContactId':_0x1e5532['body'][_0x5adb('0x62')]}})[_0x5adb('0x22')](handleEntityNotFound(_0x2c3af8,null))[_0x5adb('0x22')](function(_0x193a29){if(_0x193a29){return _0x193a29;}return null;})[_0x5adb('0x22')](respondWithResult(_0x2c3af8,null))['catch'](handleError(_0x2c3af8,null));}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.model.js b/server/api/cmHopperFinal/cmHopperFinal.model.js index f541173..e5ccac8 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 _0x17f6=['CmHopperFinal','calleridnum','uniqueid','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','./cmHopperFinal.attributes','exports'];(function(_0x1ec73d,_0x377361){var _0x55b527=function(_0x4a8f31){while(--_0x4a8f31){_0x1ec73d['push'](_0x1ec73d['shift']());}};_0x55b527(++_0x377361);}(_0x17f6,0xdb));var _0x617f=function(_0x50006d,_0x288f46){_0x50006d=_0x50006d-0x0;var _0x35028b=_0x17f6[_0x50006d];return _0x35028b;};'use strict';var _=require(_0x617f('0x0'));var util=require(_0x617f('0x1'));var logger=require(_0x617f('0x2'))('api');var moment=require('moment');var BPromise=require(_0x617f('0x3'));var rp=require(_0x617f('0x4'));var fs=require('fs');var path=require(_0x617f('0x5'));var rimraf=require(_0x617f('0x6'));var config=require('../../config/environment');var attributes=require(_0x617f('0x7'));module[_0x617f('0x8')]=function(_0x40adf6,_0x343a92){return _0x40adf6['define'](_0x617f('0x9'),attributes,{'tableName':'cm_hopper_final','paranoid':![],'indexes':[{'name':'calleridnum','fields':[_0x617f('0xa')]},{'name':'uniqueid','fields':[_0x617f('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x78cb=['request-promise','../../config/environment','./cmHopperFinal.attributes','exports','CmHopperFinal','calleridnum','uniqueid','util','../../config/logger','moment','bluebird'];(function(_0x4500f7,_0x5715d5){var _0x411c99=function(_0x2d154e){while(--_0x2d154e){_0x4500f7['push'](_0x4500f7['shift']());}};_0x411c99(++_0x5715d5);}(_0x78cb,0xac));var _0xb78c=function(_0x1d2db6,_0x41f6ef){_0x1d2db6=_0x1d2db6-0x0;var _0x555c74=_0x78cb[_0x1d2db6];return _0x555c74;};'use strict';var _=require('lodash');var util=require(_0xb78c('0x0'));var logger=require(_0xb78c('0x1'))('api');var moment=require(_0xb78c('0x2'));var BPromise=require(_0xb78c('0x3'));var rp=require(_0xb78c('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xb78c('0x5'));var attributes=require(_0xb78c('0x6'));module[_0xb78c('0x7')]=function(_0x3b62ea,_0x4c3f51){return _0x3b62ea['define'](_0xb78c('0x8'),attributes,{'tableName':'cm_hopper_final','paranoid':![],'indexes':[{'name':_0xb78c('0x9'),'fields':[_0xb78c('0x9')]},{'name':'uniqueid','fields':[_0xb78c('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.rpc.js b/server/api/cmHopperFinal/cmHopperFinal.rpc.js index 9db174e..6e3284f 100644 --- a/server/api/cmHopperFinal/cmHopperFinal.rpc.js +++ b/server/api/cmHopperFinal/cmHopperFinal.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['../../config/environment','jayson/promise','http','info','CmHopperFinal,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','CmHopperFinal','create','body','options','raw','CreateCmHopperFinal','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x30a585,_0x650c92){var _0x4a37a7=function(_0xa49c5b){while(--_0xa49c5b){_0x30a585['push'](_0x30a585['shift']());}};_0x4a37a7(++_0x650c92);}(_0x7a54,0x106));var _0x47a5=function(_0x115591,_0x57990e){_0x115591=_0x115591-0x0;var _0x3471f0=_0x7a54[_0x115591];return _0x3471f0;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('CmHopperFinal,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}exports['CreateCmHopperFinal']=function(_0x5247fd){var _0x423a81=this;return new Promise(function(_0xaf70a6,_0x2ce454){return db[_0x47a5('0x15')][_0x47a5('0x16')](_0x5247fd[_0x47a5('0x17')],{'raw':_0x5247fd[_0x47a5('0x18')]?_0x5247fd[_0x47a5('0x18')][_0x47a5('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x1570bc){logger[_0x47a5('0xb')]('CreateCmHopperFinal',_0x5247fd);logger[_0x47a5('0xd')](_0x47a5('0x1a'),_0x5247fd,JSON[_0x47a5('0xe')](_0x1570bc));_0xaf70a6(_0x1570bc);})['catch'](function(_0xb8ae6c){logger[_0x47a5('0xf')](_0x47a5('0x1a'),_0xb8ae6c[_0x47a5('0x11')],_0x5247fd);_0x2ce454(_0x423a81['error'](0x1f4,_0xb8ae6c[_0x47a5('0x11')]));});});}; \ No newline at end of file +var _0x7a54=['../../config/environment','jayson/promise','http','info','CmHopperFinal,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','CmHopperFinal','create','body','options','raw','CreateCmHopperFinal','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x2ac069,_0x1b5a3c){var _0x5605bd=function(_0x16bd22){while(--_0x16bd22){_0x2ac069['push'](_0x2ac069['shift']());}};_0x5605bd(++_0x1b5a3c);}(_0x7a54,0x106));var _0x47a5=function(_0x149753,_0x59b596){_0x149753=_0x149753-0x0;var _0xbfdee9=_0x7a54[_0x149753];return _0xbfdee9;};'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 91283db..3a3e1ba 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 _0x1a20=['countContactsQueueCampaignHopperFinal','countContactsIvrCampaignHopperFinal','post','/voice/queue/moveContacts/:id','moveContactsIvrCampaignHopperFinal','/checkContactHopper','checkContactHopper','put','/:id','update','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./cmHopperFinal.controller','get','isAuthenticated','index','/describe','describe','show','/voice/queue/countAttributes/:id'];(function(_0x1acf45,_0x32caad){var _0x31c17f=function(_0x503be6){while(--_0x503be6){_0x1acf45['push'](_0x1acf45['shift']());}};_0x31c17f(++_0x32caad);}(_0x1a20,0xa7));var _0x01a2=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x1a20[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0x01a2('0x0'));var util=require('util');var path=require(_0x01a2('0x1'));var timeout=require(_0x01a2('0x2'));var express=require(_0x01a2('0x3'));var router=express['Router']();var fs_extra=require(_0x01a2('0x4'));var auth=require(_0x01a2('0x5'));var interaction=require(_0x01a2('0x6'));var config=require('../../config/environment');var controller=require(_0x01a2('0x7'));router[_0x01a2('0x8')]('/',auth[_0x01a2('0x9')](),controller[_0x01a2('0xa')]);router[_0x01a2('0x8')](_0x01a2('0xb'),auth['isAuthenticated'](),controller[_0x01a2('0xc')]);router['get']('/:id',auth[_0x01a2('0x9')](),controller[_0x01a2('0xd')]);router['get'](_0x01a2('0xe'),auth[_0x01a2('0x9')](),controller[_0x01a2('0xf')]);router[_0x01a2('0x8')]('/campaign/countAttributes/:id',auth[_0x01a2('0x9')](),controller[_0x01a2('0x10')]);router[_0x01a2('0x11')](_0x01a2('0x12'),auth[_0x01a2('0x9')](),controller['moveContactsQueueCampaignHopperFinal']);router[_0x01a2('0x11')]('/voice/campaign/moveContacts/:id',auth[_0x01a2('0x9')](),controller[_0x01a2('0x13')]);router[_0x01a2('0x11')](_0x01a2('0x14'),auth[_0x01a2('0x9')](),controller[_0x01a2('0x15')]);router[_0x01a2('0x16')](_0x01a2('0x17'),auth[_0x01a2('0x9')](),controller[_0x01a2('0x18')]);module[_0x01a2('0x19')]=router; \ No newline at end of file +var _0x7a7c=['show','/voice/queue/countAttributes/:id','countContactsQueueCampaignHopperFinal','/campaign/countAttributes/:id','moveContactsQueueCampaignHopperFinal','post','/voice/campaign/moveContacts/:id','moveContactsIvrCampaignHopperFinal','checkContactHopper','put','update','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./cmHopperFinal.controller','isAuthenticated','index','get','/describe','/:id'];(function(_0x15a888,_0x3f2c7a){var _0x1114d7=function(_0x456714){while(--_0x456714){_0x15a888['push'](_0x15a888['shift']());}};_0x1114d7(++_0x3f2c7a);}(_0x7a7c,0x1c6));var _0xc7a7=function(_0x4fb51f,_0x587b28){_0x4fb51f=_0x4fb51f-0x0;var _0x2d17a0=_0x7a7c[_0x4fb51f];return _0x2d17a0;};'use strict';var multer=require(_0xc7a7('0x0'));var util=require(_0xc7a7('0x1'));var path=require(_0xc7a7('0x2'));var timeout=require(_0xc7a7('0x3'));var express=require('express');var router=express[_0xc7a7('0x4')]();var fs_extra=require(_0xc7a7('0x5'));var auth=require(_0xc7a7('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xc7a7('0x7'));var controller=require(_0xc7a7('0x8'));router['get']('/',auth[_0xc7a7('0x9')](),controller[_0xc7a7('0xa')]);router[_0xc7a7('0xb')](_0xc7a7('0xc'),auth[_0xc7a7('0x9')](),controller['describe']);router[_0xc7a7('0xb')](_0xc7a7('0xd'),auth['isAuthenticated'](),controller[_0xc7a7('0xe')]);router[_0xc7a7('0xb')](_0xc7a7('0xf'),auth[_0xc7a7('0x9')](),controller[_0xc7a7('0x10')]);router[_0xc7a7('0xb')](_0xc7a7('0x11'),auth[_0xc7a7('0x9')](),controller['countContactsIvrCampaignHopperFinal']);router['post']('/voice/queue/moveContacts/:id',auth['isAuthenticated'](),controller[_0xc7a7('0x12')]);router[_0xc7a7('0x13')](_0xc7a7('0x14'),auth[_0xc7a7('0x9')](),controller[_0xc7a7('0x15')]);router[_0xc7a7('0x13')]('/checkContactHopper',auth[_0xc7a7('0x9')](),controller[_0xc7a7('0x16')]);router[_0xc7a7('0x17')](_0xc7a7('0xd'),auth[_0xc7a7('0x9')](),controller[_0xc7a7('0x18')]);module[_0xc7a7('0x19')]=router; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.attributes.js b/server/api/cmHopperHistory/cmHopperHistory.attributes.js index de42544..64c237f 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 _0xe987=['BOOLEAN','sequelize','exports','STRING','DATE','INTEGER'];(function(_0x147ab3,_0x487355){var _0x510108=function(_0x48d14f){while(--_0x48d14f){_0x147ab3['push'](_0x147ab3['shift']());}};_0x510108(++_0x487355);}(_0xe987,0x109));var _0x7e98=function(_0x49f38c,_0x2e1793){_0x49f38c=_0x49f38c-0x0;var _0x2e4559=_0xe987[_0x49f38c];return _0x2e4559;};'use strict';var Sequelize=require(_0x7e98('0x0'));module[_0x7e98('0x1')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize[_0x7e98('0x2')]},'scheduledat':{'type':Sequelize[_0x7e98('0x3')]},'countbusyretry':{'type':Sequelize[_0x7e98('0x4')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x7e98('0x4')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x7e98('0x4')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x7e98('0x4')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x7e98('0x2')]},'originatecalleridnum':{'type':Sequelize[_0x7e98('0x2')]},'originatecalleridname':{'type':Sequelize[_0x7e98('0x2')]},'calleridnum':{'type':Sequelize[_0x7e98('0x2')]},'calleridname':{'type':Sequelize[_0x7e98('0x2')]},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize[_0x7e98('0x3')]},'answertime':{'type':Sequelize['DATE']},'droptime':{'type':Sequelize[_0x7e98('0x3')]},'endtime':{'type':Sequelize[_0x7e98('0x3')]},'ringtime':{'type':Sequelize[_0x7e98('0x4')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x7e98('0x4')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x7e98('0x4')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x7e98('0x4')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x7e98('0x2')]},'campaign':{'type':Sequelize[_0x7e98('0x2')]},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x7e98('0x2')]},'reason':{'type':Sequelize[_0x7e98('0x2')]},'amd':{'type':Sequelize[_0x7e98('0x5')],'defaultValue':![]},'fax':{'type':Sequelize[_0x7e98('0x5')],'defaultValue':![]},'callback':{'type':Sequelize[_0x7e98('0x5')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x7e98('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x7e98('0x3')]},'recallme':{'type':Sequelize[_0x7e98('0x5')],'defaultValue':![]},'editedat':{'type':Sequelize[_0x7e98('0x3')]},'edited':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0x7e98('0x4')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x7e98('0x4')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x7e98('0x4')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x7e98('0x4')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dialTimezone':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xa842=['INTEGER','STRING','DATE','BOOLEAN','sequelize','exports'];(function(_0x37ded3,_0x371ebb){var _0x51e49e=function(_0x30cc78){while(--_0x30cc78){_0x37ded3['push'](_0x37ded3['shift']());}};_0x51e49e(++_0x371ebb);}(_0xa842,0x8e));var _0x2a84=function(_0x548b78,_0x1ec215){_0x548b78=_0x548b78-0x0;var _0x13224a=_0xa842[_0x548b78];return _0x13224a;};'use strict';var Sequelize=require(_0x2a84('0x0'));module[_0x2a84('0x1')]={'state':{'type':Sequelize[_0x2a84('0x2')](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize['DATE']},'countbusyretry':{'type':Sequelize[_0x2a84('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x2a84('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x2a84('0x2')],'defaultValue':0x0},'uniqueid':{'type':Sequelize['STRING']},'originatecalleridnum':{'type':Sequelize['STRING']},'originatecalleridname':{'type':Sequelize[_0x2a84('0x3')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x2a84('0x3')]},'starttime':{'type':Sequelize[_0x2a84('0x4')]},'responsetime':{'type':Sequelize[_0x2a84('0x4')]},'answertime':{'type':Sequelize['DATE']},'droptime':{'type':Sequelize[_0x2a84('0x4')]},'endtime':{'type':Sequelize[_0x2a84('0x4')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x2a84('0x2')],'defaultValue':0x0},'talktime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x2a84('0x2')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x2a84('0x3')]},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize[_0x2a84('0x3')]},'membername':{'type':Sequelize['STRING']},'reason':{'type':Sequelize[_0x2a84('0x3')]},'amd':{'type':Sequelize[_0x2a84('0x5')],'defaultValue':![]},'fax':{'type':Sequelize[_0x2a84('0x5')],'defaultValue':![]},'callback':{'type':Sequelize[_0x2a84('0x5')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize[_0x2a84('0x4')]},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'editedat':{'type':Sequelize[_0x2a84('0x4')]},'edited':{'type':Sequelize[_0x2a84('0x5')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0x2a84('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x2a84('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0x2a84('0x3')]}}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.controller.js b/server/api/cmHopperHistory/cmHopperHistory.controller.js index fd921f3..80f67b4 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 _0x348a=['count','set','Content-Range','apply','reject','save','update','destroy','then','sendStatus','stack','name','index','CmHopperHistory','rawAttributes','fieldName','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','type','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','keys','length','create','body','uniqueid','find','params','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','offset','undefined','limit'];(function(_0xe2de5a,_0x533723){var _0x1e5b6e=function(_0xb63f10){while(--_0xb63f10){_0xe2de5a['push'](_0xe2de5a['shift']());}};_0x1e5b6e(++_0x533723);}(_0x348a,0x108));var _0xa348=function(_0x4bd0b1,_0x56f9e1){_0x4bd0b1=_0x4bd0b1-0x0;var _0x201417=_0x348a[_0x4bd0b1];return _0x201417;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa348('0x0'));var zipdir=require(_0xa348('0x1'));var jsonpatch=require(_0xa348('0x2'));var rp=require(_0xa348('0x3'));var moment=require(_0xa348('0x4'));var BPromise=require(_0xa348('0x5'));var Mustache=require(_0xa348('0x6'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xa348('0x7'));var fs=require('fs');var fs_extra=require(_0xa348('0x8'));var _=require('lodash');var squel=require(_0xa348('0x9'));var crypto=require(_0xa348('0xa'));var jsforce=require(_0xa348('0xb'));var deskjs=require(_0xa348('0xc'));var toCsv=require(_0xa348('0xd'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xa348('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xa348('0xf'));var as=require(_0xa348('0x10'));var hardwareService=require(_0xa348('0x11'));var logger=require(_0xa348('0x12'))(_0xa348('0x13'));var utils=require(_0xa348('0x14'));var config=require(_0xa348('0x15'));var licenseUtil=require(_0xa348('0x16'));var db=require(_0xa348('0x17'))['db'];function respondWithStatusCode(_0x282363,_0xef2a52){_0xef2a52=_0xef2a52||0xcc;return function(_0x5d07aa){if(_0x5d07aa){return _0x282363['sendStatus'](_0xef2a52);}return _0x282363[_0xa348('0x18')](_0xef2a52)['end']();};}function respondWithResult(_0x2fcd8e,_0x1e2d4b){_0x1e2d4b=_0x1e2d4b||0xc8;return function(_0x26879f){if(_0x26879f){return _0x2fcd8e[_0xa348('0x18')](_0x1e2d4b)['json'](_0x26879f);}};}function respondWithFilteredResult(_0x2c5998,_0x230bd1){return function(_0x29c8d5){if(_0x29c8d5){var _0x5c8fb4=typeof _0x230bd1[_0xa348('0x19')]===_0xa348('0x1a')&&typeof _0x230bd1[_0xa348('0x1b')]===_0xa348('0x1a');var _0x2ce4b9=_0x29c8d5[_0xa348('0x1c')];var _0x10d211=_0x5c8fb4?0x0:_0x230bd1[_0xa348('0x19')];var _0x16a3c4=_0x5c8fb4?_0x29c8d5[_0xa348('0x1c')]:_0x230bd1['offset']+_0x230bd1['limit'];var _0x5eca33;if(_0x16a3c4>=_0x2ce4b9){_0x16a3c4=_0x2ce4b9;_0x5eca33=0xc8;}else{_0x5eca33=0xce;}_0x2c5998[_0xa348('0x18')](_0x5eca33);return _0x2c5998[_0xa348('0x1d')](_0xa348('0x1e'),_0x10d211+'-'+_0x16a3c4+'/'+_0x2ce4b9)['json'](_0x29c8d5);}return null;};}function patchUpdates(_0x364a69){return function(_0x2fca50){try{jsonpatch[_0xa348('0x1f')](_0x2fca50,_0x364a69,!![]);}catch(_0xb597c0){return BPromise[_0xa348('0x20')](_0xb597c0);}return _0x2fca50[_0xa348('0x21')]();};}function saveUpdates(_0x2912b1,_0x53a697){return function(_0x390e44){if(_0x390e44){return _0x390e44[_0xa348('0x22')](_0x2912b1)['then'](function(_0x4a2764){return _0x4a2764;});}return null;};}function removeEntity(_0x2a17bd,_0x5b0615){return function(_0xfc01ea){if(_0xfc01ea){return _0xfc01ea[_0xa348('0x23')]()[_0xa348('0x24')](function(){_0x2a17bd[_0xa348('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x53fed3,_0x108c32){return function(_0x562747){if(!_0x562747){_0x53fed3[_0xa348('0x25')](0x194);}return _0x562747;};}function handleError(_0x45a268,_0x22417e){_0x22417e=_0x22417e||0x1f4;return function(_0x58a246){logger['error'](_0x58a246[_0xa348('0x26')]);if(_0x58a246['name']){delete _0x58a246[_0xa348('0x27')];}_0x45a268['status'](_0x22417e)['send'](_0x58a246);};}exports[_0xa348('0x28')]=function(_0x4a371e,_0x3d5fdf){var _0x44fa0f={},_0x302e77={},_0x46aed9={'count':0x0,'rows':[]};var _0x5e0170=_['map'](db[_0xa348('0x29')][_0xa348('0x2a')],function(_0x5a16ed){return{'name':_0x5a16ed[_0xa348('0x2b')],'type':_0x5a16ed['type']['key']};});_0x302e77[_0xa348('0x2c')]=_[_0xa348('0x2d')](_0x5e0170,_0xa348('0x27'));_0x302e77['query']=_['keys'](_0x4a371e[_0xa348('0x2e')]);_0x302e77[_0xa348('0x2f')]=_[_0xa348('0x30')](_0x302e77[_0xa348('0x2c')],_0x302e77['query']);_0x44fa0f[_0xa348('0x31')]=_[_0xa348('0x30')](_0x302e77[_0xa348('0x2c')],qs['fields'](_0x4a371e[_0xa348('0x2e')][_0xa348('0x32')]));_0x44fa0f[_0xa348('0x31')]=_0x44fa0f[_0xa348('0x31')]['length']?_0x44fa0f[_0xa348('0x31')]:_0x302e77['model'];if(!_0x4a371e['query'][_0xa348('0x33')](_0xa348('0x34'))){_0x44fa0f[_0xa348('0x1b')]=qs[_0xa348('0x1b')](_0x4a371e[_0xa348('0x2e')][_0xa348('0x1b')]);_0x44fa0f[_0xa348('0x19')]=qs[_0xa348('0x19')](_0x4a371e[_0xa348('0x2e')][_0xa348('0x19')]);}_0x44fa0f[_0xa348('0x35')]=qs['sort'](_0x4a371e['query'][_0xa348('0x36')]);_0x44fa0f[_0xa348('0x37')]=qs['filters'](_[_0xa348('0x38')](_0x4a371e[_0xa348('0x2e')],_0x302e77[_0xa348('0x2f')]),_0x5e0170);if(_0x4a371e[_0xa348('0x2e')]['filter']){_0x44fa0f['where']=_['merge'](_0x44fa0f[_0xa348('0x37')],{'$or':_[_0xa348('0x2d')](_0x5e0170,function(_0xa0801d){if(_0xa0801d[_0xa348('0x39')]!==_0xa348('0x3a')){var _0x1d31e9={};_0x1d31e9[_0xa0801d[_0xa348('0x27')]]={'$like':'%'+_0x4a371e[_0xa348('0x2e')]['filter']+'%'};return _0x1d31e9;}})});}_0x44fa0f=_[_0xa348('0x3b')]({},_0x44fa0f,_0x4a371e[_0xa348('0x3c')]);var _0x45f118={'where':_0x44fa0f[_0xa348('0x37')]};return db[_0xa348('0x29')][_0xa348('0x1c')](_0x45f118)[_0xa348('0x24')](function(_0x367f56){_0x46aed9[_0xa348('0x1c')]=_0x367f56;if(_0x4a371e['query'][_0xa348('0x3d')]){_0x44fa0f[_0xa348('0x3e')]=[{'all':!![]}];}return db[_0xa348('0x29')][_0xa348('0x3f')](_0x44fa0f);})[_0xa348('0x24')](function(_0x4c986d){_0x46aed9[_0xa348('0x40')]=_0x4c986d;return _0x46aed9;})[_0xa348('0x24')](respondWithFilteredResult(_0x3d5fdf,_0x44fa0f))[_0xa348('0x41')](handleError(_0x3d5fdf,null));};exports['show']=function(_0x20c954,_0x2a5e3c){var _0x2afd08={'raw':!![],'where':{'id':_0x20c954['params']['id']}},_0x876a70={};_0x876a70[_0xa348('0x2c')]=_[_0xa348('0x42')](db[_0xa348('0x29')]['rawAttributes']);_0x876a70[_0xa348('0x2e')]=_[_0xa348('0x42')](_0x20c954['query']);_0x876a70[_0xa348('0x2f')]=_[_0xa348('0x30')](_0x876a70[_0xa348('0x2c')],_0x876a70[_0xa348('0x2e')]);_0x2afd08[_0xa348('0x31')]=_[_0xa348('0x30')](_0x876a70[_0xa348('0x2c')],qs[_0xa348('0x32')](_0x20c954['query']['fields']));_0x2afd08['attributes']=_0x2afd08[_0xa348('0x31')][_0xa348('0x43')]?_0x2afd08[_0xa348('0x31')]:_0x876a70[_0xa348('0x2c')];if(_0x20c954['query'][_0xa348('0x3d')]){_0x2afd08['include']=[{'all':!![]}];}_0x2afd08=_['merge']({},_0x2afd08,_0x20c954['options']);return db[_0xa348('0x29')]['find'](_0x2afd08)[_0xa348('0x24')](handleEntityNotFound(_0x2a5e3c,null))['then'](respondWithResult(_0x2a5e3c,null))[_0xa348('0x41')](handleError(_0x2a5e3c,null));};exports[_0xa348('0x44')]=function(_0x5d5a83,_0x37642d){return db[_0xa348('0x29')][_0xa348('0x44')](_0x5d5a83[_0xa348('0x45')],{})[_0xa348('0x24')](respondWithResult(_0x37642d,0xc9))[_0xa348('0x41')](handleError(_0x37642d,null));};exports['describe']=function(_0x599199,_0xa2231){return db['CmHopperHistory']['describe']()['then'](respondWithResult(_0xa2231,null))[_0xa348('0x41')](handleError(_0xa2231,null));};exports['update']=function(_0x4cd560,_0x54c7db){if(_0x4cd560['body'][_0xa348('0x46')]){delete _0x4cd560[_0xa348('0x45')]['uniqueid'];}return db[_0xa348('0x29')][_0xa348('0x47')]({'where':{'uniqueid':_0x4cd560[_0xa348('0x48')]['id']}})[_0xa348('0x24')](handleEntityNotFound(_0x54c7db,null))[_0xa348('0x24')](saveUpdates(_0x4cd560[_0xa348('0x45')],null))['then'](respondWithResult(_0x54c7db,null))[_0xa348('0x41')](handleError(_0x54c7db,null));}; \ No newline at end of file +var _0xba6e=['keys','filters','intersection','fields','attributes','nolimit','order','sort','filter','where','merge','VIRTUAL','CmHopperHistory','count','includeAll','include','findAll','rows','catch','params','length','find','create','body','describe','uniqueid','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','offset','limit','set','Content-Range','apply','reject','save','update','then','error','stack','name','send','index','rawAttributes','type','model','map','query'];(function(_0x455c6c,_0x1e78b7){var _0x488242=function(_0x3e8fb0){while(--_0x3e8fb0){_0x455c6c['push'](_0x455c6c['shift']());}};_0x488242(++_0x1e78b7);}(_0xba6e,0xb0));var _0xeba6=function(_0x3452e1,_0xd46856){_0x3452e1=_0x3452e1-0x0;var _0x553e3c=_0xba6e[_0x3452e1];return _0x553e3c;};'use strict';var emlformat=require(_0xeba6('0x0'));var rimraf=require(_0xeba6('0x1'));var zipdir=require(_0xeba6('0x2'));var jsonpatch=require(_0xeba6('0x3'));var rp=require(_0xeba6('0x4'));var moment=require(_0xeba6('0x5'));var BPromise=require(_0xeba6('0x6'));var Mustache=require(_0xeba6('0x7'));var util=require('util');var path=require(_0xeba6('0x8'));var sox=require(_0xeba6('0x9'));var csv=require(_0xeba6('0xa'));var ejs=require(_0xeba6('0xb'));var fs=require('fs');var fs_extra=require(_0xeba6('0xc'));var _=require(_0xeba6('0xd'));var squel=require(_0xeba6('0xe'));var crypto=require(_0xeba6('0xf'));var jsforce=require(_0xeba6('0x10'));var deskjs=require(_0xeba6('0x11'));var toCsv=require(_0xeba6('0xa'));var querystring=require(_0xeba6('0x12'));var Papa=require(_0xeba6('0x13'));var Redis=require(_0xeba6('0x14'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xeba6('0x15'));var utils=require(_0xeba6('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xeba6('0x17'));var db=require(_0xeba6('0x18'))['db'];function respondWithStatusCode(_0x4f854e,_0xb42f35){_0xb42f35=_0xb42f35||0xcc;return function(_0xc7add4){if(_0xc7add4){return _0x4f854e[_0xeba6('0x19')](_0xb42f35);}return _0x4f854e[_0xeba6('0x1a')](_0xb42f35)[_0xeba6('0x1b')]();};}function respondWithResult(_0x2bb2d2,_0x110258){_0x110258=_0x110258||0xc8;return function(_0x7cedd6){if(_0x7cedd6){return _0x2bb2d2[_0xeba6('0x1a')](_0x110258)[_0xeba6('0x1c')](_0x7cedd6);}};}function respondWithFilteredResult(_0x14858d,_0xf871ea){return function(_0x5d4a6d){if(_0x5d4a6d){var _0x3d7a80=typeof _0xf871ea['offset']===_0xeba6('0x1d')&&typeof _0xf871ea['limit']===_0xeba6('0x1d');var _0x3a998f=_0x5d4a6d['count'];var _0x2aef9d=_0x3d7a80?0x0:_0xf871ea[_0xeba6('0x1e')];var _0x5d2eba=_0x3d7a80?_0x5d4a6d['count']:_0xf871ea[_0xeba6('0x1e')]+_0xf871ea[_0xeba6('0x1f')];var _0x248197;if(_0x5d2eba>=_0x3a998f){_0x5d2eba=_0x3a998f;_0x248197=0xc8;}else{_0x248197=0xce;}_0x14858d[_0xeba6('0x1a')](_0x248197);return _0x14858d[_0xeba6('0x20')](_0xeba6('0x21'),_0x2aef9d+'-'+_0x5d2eba+'/'+_0x3a998f)[_0xeba6('0x1c')](_0x5d4a6d);}return null;};}function patchUpdates(_0xa85a2d){return function(_0x60c3ef){try{jsonpatch[_0xeba6('0x22')](_0x60c3ef,_0xa85a2d,!![]);}catch(_0x305a11){return BPromise[_0xeba6('0x23')](_0x305a11);}return _0x60c3ef[_0xeba6('0x24')]();};}function saveUpdates(_0x325e94,_0x195967){return function(_0x1f7d7d){if(_0x1f7d7d){return _0x1f7d7d[_0xeba6('0x25')](_0x325e94)[_0xeba6('0x26')](function(_0x5164ce){return _0x5164ce;});}return null;};}function removeEntity(_0x2b0711,_0x59e7b0){return function(_0x31eaa6){if(_0x31eaa6){return _0x31eaa6['destroy']()[_0xeba6('0x26')](function(){_0x2b0711[_0xeba6('0x1a')](0xcc)[_0xeba6('0x1b')]();});}};}function handleEntityNotFound(_0x5a15bc,_0x3dffc0){return function(_0x37f834){if(!_0x37f834){_0x5a15bc[_0xeba6('0x19')](0x194);}return _0x37f834;};}function handleError(_0x56d2be,_0x1e2951){_0x1e2951=_0x1e2951||0x1f4;return function(_0x37689a){logger[_0xeba6('0x27')](_0x37689a[_0xeba6('0x28')]);if(_0x37689a[_0xeba6('0x29')]){delete _0x37689a[_0xeba6('0x29')];}_0x56d2be['status'](_0x1e2951)[_0xeba6('0x2a')](_0x37689a);};}exports[_0xeba6('0x2b')]=function(_0x4ff212,_0x30c5d4){var _0x5f52e3={},_0x57855e={},_0x130529={'count':0x0,'rows':[]};var _0x114178=_['map'](db['CmHopperHistory'][_0xeba6('0x2c')],function(_0x3ab273){return{'name':_0x3ab273['fieldName'],'type':_0x3ab273[_0xeba6('0x2d')]['key']};});_0x57855e[_0xeba6('0x2e')]=_[_0xeba6('0x2f')](_0x114178,_0xeba6('0x29'));_0x57855e[_0xeba6('0x30')]=_[_0xeba6('0x31')](_0x4ff212['query']);_0x57855e[_0xeba6('0x32')]=_['intersection'](_0x57855e[_0xeba6('0x2e')],_0x57855e[_0xeba6('0x30')]);_0x5f52e3['attributes']=_[_0xeba6('0x33')](_0x57855e[_0xeba6('0x2e')],qs[_0xeba6('0x34')](_0x4ff212[_0xeba6('0x30')]['fields']));_0x5f52e3['attributes']=_0x5f52e3[_0xeba6('0x35')]['length']?_0x5f52e3[_0xeba6('0x35')]:_0x57855e[_0xeba6('0x2e')];if(!_0x4ff212[_0xeba6('0x30')]['hasOwnProperty'](_0xeba6('0x36'))){_0x5f52e3[_0xeba6('0x1f')]=qs[_0xeba6('0x1f')](_0x4ff212[_0xeba6('0x30')][_0xeba6('0x1f')]);_0x5f52e3['offset']=qs[_0xeba6('0x1e')](_0x4ff212[_0xeba6('0x30')][_0xeba6('0x1e')]);}_0x5f52e3[_0xeba6('0x37')]=qs['sort'](_0x4ff212[_0xeba6('0x30')][_0xeba6('0x38')]);_0x5f52e3['where']=qs[_0xeba6('0x32')](_['pick'](_0x4ff212[_0xeba6('0x30')],_0x57855e[_0xeba6('0x32')]),_0x114178);if(_0x4ff212[_0xeba6('0x30')][_0xeba6('0x39')]){_0x5f52e3[_0xeba6('0x3a')]=_[_0xeba6('0x3b')](_0x5f52e3[_0xeba6('0x3a')],{'$or':_[_0xeba6('0x2f')](_0x114178,function(_0x5979fe){if(_0x5979fe[_0xeba6('0x2d')]!==_0xeba6('0x3c')){var _0x17a1ea={};_0x17a1ea[_0x5979fe[_0xeba6('0x29')]]={'$like':'%'+_0x4ff212[_0xeba6('0x30')][_0xeba6('0x39')]+'%'};return _0x17a1ea;}})});}_0x5f52e3=_[_0xeba6('0x3b')]({},_0x5f52e3,_0x4ff212['options']);var _0xac2b9e={'where':_0x5f52e3[_0xeba6('0x3a')]};return db[_0xeba6('0x3d')][_0xeba6('0x3e')](_0xac2b9e)[_0xeba6('0x26')](function(_0x4a7bea){_0x130529['count']=_0x4a7bea;if(_0x4ff212[_0xeba6('0x30')][_0xeba6('0x3f')]){_0x5f52e3[_0xeba6('0x40')]=[{'all':!![]}];}return db['CmHopperHistory'][_0xeba6('0x41')](_0x5f52e3);})[_0xeba6('0x26')](function(_0x1c4a9e){_0x130529[_0xeba6('0x42')]=_0x1c4a9e;return _0x130529;})['then'](respondWithFilteredResult(_0x30c5d4,_0x5f52e3))[_0xeba6('0x43')](handleError(_0x30c5d4,null));};exports['show']=function(_0x729aa,_0x3b0140){var _0x6a004c={'raw':!![],'where':{'id':_0x729aa[_0xeba6('0x44')]['id']}},_0x21b812={};_0x21b812[_0xeba6('0x2e')]=_['keys'](db['CmHopperHistory'][_0xeba6('0x2c')]);_0x21b812[_0xeba6('0x30')]=_[_0xeba6('0x31')](_0x729aa['query']);_0x21b812['filters']=_['intersection'](_0x21b812[_0xeba6('0x2e')],_0x21b812[_0xeba6('0x30')]);_0x6a004c[_0xeba6('0x35')]=_[_0xeba6('0x33')](_0x21b812[_0xeba6('0x2e')],qs[_0xeba6('0x34')](_0x729aa[_0xeba6('0x30')][_0xeba6('0x34')]));_0x6a004c[_0xeba6('0x35')]=_0x6a004c['attributes'][_0xeba6('0x45')]?_0x6a004c[_0xeba6('0x35')]:_0x21b812[_0xeba6('0x2e')];if(_0x729aa[_0xeba6('0x30')]['includeAll']){_0x6a004c[_0xeba6('0x40')]=[{'all':!![]}];}_0x6a004c=_[_0xeba6('0x3b')]({},_0x6a004c,_0x729aa['options']);return db[_0xeba6('0x3d')][_0xeba6('0x46')](_0x6a004c)[_0xeba6('0x26')](handleEntityNotFound(_0x3b0140,null))['then'](respondWithResult(_0x3b0140,null))['catch'](handleError(_0x3b0140,null));};exports[_0xeba6('0x47')]=function(_0x1572d0,_0x3e283b){return db[_0xeba6('0x3d')][_0xeba6('0x47')](_0x1572d0[_0xeba6('0x48')],{})['then'](respondWithResult(_0x3e283b,0xc9))[_0xeba6('0x43')](handleError(_0x3e283b,null));};exports[_0xeba6('0x49')]=function(_0x53d3f3,_0x5cf13d){return db['CmHopperHistory'][_0xeba6('0x49')]()[_0xeba6('0x26')](respondWithResult(_0x5cf13d,null))[_0xeba6('0x43')](handleError(_0x5cf13d,null));};exports[_0xeba6('0x25')]=function(_0x4bda29,_0x4514a7){if(_0x4bda29['body'][_0xeba6('0x4a')]){delete _0x4bda29['body']['uniqueid'];}return db[_0xeba6('0x3d')][_0xeba6('0x46')]({'where':{'uniqueid':_0x4bda29[_0xeba6('0x44')]['id']}})[_0xeba6('0x26')](handleEntityNotFound(_0x4514a7,null))[_0xeba6('0x26')](saveUpdates(_0x4bda29[_0xeba6('0x48')],null))[_0xeba6('0x26')](respondWithResult(_0x4514a7,null))['catch'](handleError(_0x4514a7,null));}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.model.js b/server/api/cmHopperHistory/cmHopperHistory.model.js index abd12f5..a38bb43 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 _0x235b=['api','moment','bluebird','request-promise','path','rimraf','./cmHopperHistory.attributes','exports','define','CmHopperHistory','cm_hopper_history','endtime','lodash'];(function(_0x5ce3c1,_0x2ab59b){var _0x585640=function(_0x44bacb){while(--_0x44bacb){_0x5ce3c1['push'](_0x5ce3c1['shift']());}};_0x585640(++_0x2ab59b);}(_0x235b,0x1ed));var _0xb235=function(_0x2a9203,_0x2427a1){_0x2a9203=_0x2a9203-0x0;var _0x2e2e6e=_0x235b[_0x2a9203];return _0x2e2e6e;};'use strict';var _=require(_0xb235('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xb235('0x1'));var moment=require(_0xb235('0x2'));var BPromise=require(_0xb235('0x3'));var rp=require(_0xb235('0x4'));var fs=require('fs');var path=require(_0xb235('0x5'));var rimraf=require(_0xb235('0x6'));var config=require('../../config/environment');var attributes=require(_0xb235('0x7'));module[_0xb235('0x8')]=function(_0x334353,_0x5298de){return _0x334353[_0xb235('0x9')](_0xb235('0xa'),attributes,{'tableName':_0xb235('0xb'),'paranoid':![],'indexes':[{'name':_0xb235('0xc'),'fields':[_0xb235('0xc')]},{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xa1cc=['bluebird','request-promise','rimraf','./cmHopperHistory.attributes','exports','cm_hopper_history','endtime','lodash','util','../../config/logger','moment'];(function(_0x16771d,_0x224c60){var _0x386f11=function(_0x3d7a87){while(--_0x3d7a87){_0x16771d['push'](_0x16771d['shift']());}};_0x386f11(++_0x224c60);}(_0xa1cc,0x10f));var _0xca1c=function(_0x3e0668,_0x1829d5){_0x3e0668=_0x3e0668-0x0;var _0xf7be8d=_0xa1cc[_0x3e0668];return _0xf7be8d;};'use strict';var _=require(_0xca1c('0x0'));var util=require(_0xca1c('0x1'));var logger=require(_0xca1c('0x2'))('api');var moment=require(_0xca1c('0x3'));var BPromise=require(_0xca1c('0x4'));var rp=require(_0xca1c('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xca1c('0x6'));var config=require('../../config/environment');var attributes=require(_0xca1c('0x7'));module[_0xca1c('0x8')]=function(_0x375837,_0x98dd5f){return _0x375837['define']('CmHopperHistory',attributes,{'tableName':_0xca1c('0x9'),'paranoid':![],'indexes':[{'name':_0xca1c('0xa'),'fields':[_0xca1c('0xa')]},{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.rpc.js b/server/api/cmHopperHistory/cmHopperHistory.rpc.js index 8e9cfe4..a7e9820 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 _0xbf02=['outboundDropCallsDayTimeout','`state`\x20=\x2012,\x201,\x20null','outboundUnknownCallsDay','`state`\x20=\x2013,\x201,\x20null','outboundBlacklistCallsDay','`state`\x20=\x2014,\x201,\x20null','outboundOriginateFailureCallsDay','`state`\x20=\x2018,\x201,\x20null','outboundRejectCallsDay','`state`\x20=\x2016,\x201,\x20null','outboundAnswerAgiCallsDay','`state`\x20=\x2020,\x201,\x20null','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','GetVoiceQueueHopperHistory','findAll','ivrTotalCallsDays','GetCampaignHopperHistory','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','CmHopperHistory,\x20%s,\x20%s','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','CmHopperHistory','body','options','raw','then','CreateCmHopperHistory','catch','where','sequelize','col','`state`\x20=\x204,\x201,\x20null','predictiveIntervalAnsweredCalls','COUNT','predictiveIntervalDroppedCallsTimeout','`state`\x20=\x2011,\x201,\x20null','predictiveIntervalDroppedCallsCallersExit','`state`\x20=\x204,\x20`holdtime`,\x20null','predictiveIntervalAvgHoldtime','`state`\x20=\x204,\x20`talktime`,\x20null','predictiveIntervalAvgTalktime','AvgHandleTime','campaign','name','literal','`state`\x20=\x200,\x201,\x20null','outboundNoSuchCallsDay','`state`\x20=\x203,\x201,\x20null','outboundNoAnswerCallsDay','outboundAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','outboundBusyCallsDay','`state`\x20=\x208,\x201,\x20null','outboundCongestionCallsDay','`state`\x20=\x2010\x20,\x201,\x20null'];(function(_0x33713b,_0x4a2c87){var _0x408254=function(_0x4ecb1c){while(--_0x4ecb1c){_0x33713b['push'](_0x33713b['shift']());}};_0x408254(++_0x4a2c87);}(_0xbf02,0x139));var _0x2bf0=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0xbf02[_0x2c91e9];return _0x13f0ff;};'use strict';var _=require(_0x2bf0('0x0'));var util=require(_0x2bf0('0x1'));var moment=require(_0x2bf0('0x2'));var BPromise=require(_0x2bf0('0x3'));var rs=require(_0x2bf0('0x4'));var fs=require('fs');var Redis=require(_0x2bf0('0x5'));var db=require(_0x2bf0('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x2bf0('0x7'))('rpc');var config=require(_0x2bf0('0x8'));var jayson=require(_0x2bf0('0x9'));var client=jayson[_0x2bf0('0xa')][_0x2bf0('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3156ac,_0x10779f,_0xbd09de){return new BPromise(function(_0x559d99,_0xf79ed4){return client[_0x2bf0('0xc')](_0x3156ac,_0xbd09de)['then'](function(_0x1895e2){logger[_0x2bf0('0xd')](_0x2bf0('0xe'),_0x10779f,'request\x20sent');logger[_0x2bf0('0xf')](_0x2bf0('0x10'),_0x10779f,'request\x20sent',JSON[_0x2bf0('0x11')](_0x1895e2));if(_0x1895e2[_0x2bf0('0x12')]){if(_0x1895e2[_0x2bf0('0x12')][_0x2bf0('0x13')]===0x1f4){logger[_0x2bf0('0x12')](_0x2bf0('0xe'),_0x10779f,_0x1895e2[_0x2bf0('0x12')][_0x2bf0('0x14')]);return _0xf79ed4(_0x1895e2[_0x2bf0('0x12')][_0x2bf0('0x14')]);}logger[_0x2bf0('0x12')](_0x2bf0('0xe'),_0x10779f,_0x1895e2[_0x2bf0('0x12')][_0x2bf0('0x14')]);return _0x559d99(_0x1895e2[_0x2bf0('0x12')][_0x2bf0('0x14')]);}else{logger[_0x2bf0('0xd')](_0x2bf0('0xe'),_0x10779f,_0x2bf0('0x15'));_0x559d99(_0x1895e2[_0x2bf0('0x16')][_0x2bf0('0x14')]);}})['catch'](function(_0x5594e0){logger[_0x2bf0('0x12')](_0x2bf0('0xe'),_0x10779f,_0x5594e0);_0xf79ed4(_0x5594e0);});});}exports['CreateCmHopperHistory']=function(_0x3c4714){var _0x49ccc7=this;return new Promise(function(_0x5a7af0,_0x3587d1){return db[_0x2bf0('0x17')]['create'](_0x3c4714[_0x2bf0('0x18')],{'raw':_0x3c4714[_0x2bf0('0x19')]?_0x3c4714[_0x2bf0('0x19')][_0x2bf0('0x1a')]===undefined?!![]:![]:!![]})[_0x2bf0('0x1b')](function(_0x1dd275){logger[_0x2bf0('0xd')](_0x2bf0('0x1c'),_0x3c4714);logger['debug'](_0x2bf0('0x1c'),_0x3c4714,JSON[_0x2bf0('0x11')](_0x1dd275));_0x5a7af0(_0x1dd275);})[_0x2bf0('0x1d')](function(_0x1f76a2){logger['error']('CreateCmHopperHistory',_0x1f76a2[_0x2bf0('0x14')],_0x3c4714);_0x3587d1(_0x49ccc7[_0x2bf0('0x12')](0x1f4,_0x1f76a2[_0x2bf0('0x14')]));});});};exports['AvgHandleTime']=function(_0x4c26b1){var _0x362a51=this;return new Promise(function(_0x1200a0,_0x190528){return db[_0x2bf0('0x17')]['findAll']({'raw':_0x4c26b1[_0x2bf0('0x19')]?_0x4c26b1[_0x2bf0('0x19')][_0x2bf0('0x1a')]===undefined?!![]:![]:!![],'where':_0x4c26b1['options']?_0x4c26b1[_0x2bf0('0x19')][_0x2bf0('0x1e')]||null:null,'attributes':[[db[_0x2bf0('0x1f')]['fn']('COUNT',db['sequelize'][_0x2bf0('0x20')]('id')),'predictiveIntervalTotalCalls'],[db[_0x2bf0('0x1f')]['fn']('COUNT',db[_0x2bf0('0x1f')]['fn']('IF',db[_0x2bf0('0x1f')]['literal'](_0x2bf0('0x21')))),_0x2bf0('0x22')],[db[_0x2bf0('0x1f')]['fn'](_0x2bf0('0x23'),db[_0x2bf0('0x1f')]['fn']('IF',db[_0x2bf0('0x1f')]['literal']('`state`\x20=\x2010,\x201,\x20null'))),_0x2bf0('0x24')],[db[_0x2bf0('0x1f')]['fn'](_0x2bf0('0x23'),db[_0x2bf0('0x1f')]['fn']('IF',db[_0x2bf0('0x1f')]['literal'](_0x2bf0('0x25')))),_0x2bf0('0x26')],[db[_0x2bf0('0x1f')]['fn']('AVG',db['sequelize']['fn']('IF',db[_0x2bf0('0x1f')]['literal'](_0x2bf0('0x27')))),_0x2bf0('0x28')],[db[_0x2bf0('0x1f')]['fn']('AVG',db[_0x2bf0('0x1f')]['fn']('IF',db['sequelize']['literal'](_0x2bf0('0x29')))),_0x2bf0('0x2a')]]})[_0x2bf0('0x1b')](function(_0x2dbf2c){logger[_0x2bf0('0xd')](_0x2bf0('0x2b'),_0x4c26b1);logger[_0x2bf0('0xf')]('AvgHandleTime',_0x4c26b1,JSON[_0x2bf0('0x11')](_0x2dbf2c));_0x1200a0(_0x2dbf2c);})[_0x2bf0('0x1d')](function(_0x320933){logger[_0x2bf0('0x12')](_0x2bf0('0x2b'),_0x320933[_0x2bf0('0x14')],_0x4c26b1);_0x190528(_0x362a51[_0x2bf0('0x12')](0x1f4,_0x320933[_0x2bf0('0x14')]));});});};exports['GetVoiceQueueHopperHistory']=function(_0x3d843b){var _0x341d80=this;return new Promise(function(_0x1765c6,_0x3d6f7e){return db[_0x2bf0('0x17')]['findAll']({'raw':_0x3d843b[_0x2bf0('0x19')]?_0x3d843b['options'][_0x2bf0('0x1a')]===undefined?!![]:![]:!![],'where':_0x3d843b[_0x2bf0('0x19')]?_0x3d843b['options'][_0x2bf0('0x1e')]||null:null,'attributes':[[_0x2bf0('0x2c'),_0x2bf0('0x2d')],[db[_0x2bf0('0x1f')]['fn'](_0x2bf0('0x23'),db[_0x2bf0('0x1f')]['fn']('IF',db['sequelize'][_0x2bf0('0x2e')](_0x2bf0('0x2f')))),_0x2bf0('0x30')],[db[_0x2bf0('0x1f')]['fn'](_0x2bf0('0x23'),db[_0x2bf0('0x1f')]['fn']('IF',db['sequelize'][_0x2bf0('0x2e')](_0x2bf0('0x31')))),_0x2bf0('0x32')],[db[_0x2bf0('0x1f')]['fn'](_0x2bf0('0x23'),db['sequelize']['fn']('IF',db[_0x2bf0('0x1f')][_0x2bf0('0x2e')](_0x2bf0('0x21')))),_0x2bf0('0x33')],[db[_0x2bf0('0x1f')]['fn'](_0x2bf0('0x23'),db[_0x2bf0('0x1f')]['fn']('IF',db[_0x2bf0('0x1f')][_0x2bf0('0x2e')](_0x2bf0('0x34')))),_0x2bf0('0x35')],[db[_0x2bf0('0x1f')]['fn'](_0x2bf0('0x23'),db[_0x2bf0('0x1f')]['fn']('IF',db[_0x2bf0('0x1f')]['literal'](_0x2bf0('0x36')))),_0x2bf0('0x37')],[db[_0x2bf0('0x1f')]['fn'](_0x2bf0('0x23'),db[_0x2bf0('0x1f')]['fn']('IF',db['sequelize']['literal'](_0x2bf0('0x38')))),_0x2bf0('0x39')],[db[_0x2bf0('0x1f')]['fn'](_0x2bf0('0x23'),db[_0x2bf0('0x1f')]['fn']('IF',db[_0x2bf0('0x1f')]['literal']('`state`\x20=\x2011\x20,\x201,\x20null'))),'outboundDropCallsDayCallersExit'],[db[_0x2bf0('0x1f')]['fn'](_0x2bf0('0x23'),db[_0x2bf0('0x1f')]['fn']('IF',db['sequelize']['literal'](_0x2bf0('0x3a')))),_0x2bf0('0x3b')],[db[_0x2bf0('0x1f')]['fn']('COUNT',db[_0x2bf0('0x1f')]['fn']('IF',db[_0x2bf0('0x1f')][_0x2bf0('0x2e')](_0x2bf0('0x3c')))),_0x2bf0('0x3d')],[db['sequelize']['fn']('COUNT',db[_0x2bf0('0x1f')]['fn']('IF',db[_0x2bf0('0x1f')]['literal'](_0x2bf0('0x3e')))),_0x2bf0('0x3f')],[db[_0x2bf0('0x1f')]['fn'](_0x2bf0('0x23'),db[_0x2bf0('0x1f')]['fn']('IF',db[_0x2bf0('0x1f')]['literal'](_0x2bf0('0x40')))),_0x2bf0('0x41')],[db[_0x2bf0('0x1f')]['fn']('COUNT',db[_0x2bf0('0x1f')]['fn']('IF',db[_0x2bf0('0x1f')][_0x2bf0('0x2e')](_0x2bf0('0x42')))),_0x2bf0('0x43')],[db[_0x2bf0('0x1f')]['fn'](_0x2bf0('0x23'),db[_0x2bf0('0x1f')]['fn']('IF',db[_0x2bf0('0x1f')][_0x2bf0('0x2e')](_0x2bf0('0x44')))),_0x2bf0('0x41')],[db['sequelize']['fn']('COUNT',db[_0x2bf0('0x1f')]['fn']('IF',db[_0x2bf0('0x1f')][_0x2bf0('0x2e')](_0x2bf0('0x45')))),'outboundReCallsDay']],'group':['campaign']})['then'](function(_0x3eb683){logger[_0x2bf0('0xd')](_0x2bf0('0x46'),_0x3d843b);logger[_0x2bf0('0xf')]('GetVoiceQueueHopperHistory',_0x3d843b,JSON[_0x2bf0('0x11')](_0x3eb683));_0x1765c6(_0x3eb683);})[_0x2bf0('0x1d')](function(_0x2cffbb){logger[_0x2bf0('0x12')](_0x2bf0('0x46'),_0x2cffbb['message'],_0x3d843b);_0x3d6f7e(_0x341d80[_0x2bf0('0x12')](0x1f4,_0x2cffbb[_0x2bf0('0x14')]));});});};exports['GetCampaignHopperHistory']=function(_0x4c21f2){var _0x2e596b=this;return new Promise(function(_0x170b26,_0x305dac){return db[_0x2bf0('0x17')][_0x2bf0('0x47')]({'raw':_0x4c21f2['options']?_0x4c21f2['options'][_0x2bf0('0x1a')]===undefined?!![]:![]:!![],'where':_0x4c21f2[_0x2bf0('0x19')]?_0x4c21f2[_0x2bf0('0x19')][_0x2bf0('0x1e')]||null:null,'attributes':[['campaign','name'],[db[_0x2bf0('0x1f')]['fn'](_0x2bf0('0x23'),db[_0x2bf0('0x1f')][_0x2bf0('0x20')]('id')),_0x2bf0('0x48')],[db[_0x2bf0('0x1f')]['fn'](_0x2bf0('0x23'),db[_0x2bf0('0x1f')]['fn']('IF',db[_0x2bf0('0x1f')][_0x2bf0('0x2e')](_0x2bf0('0x21')))),'ivrAnswerCallsDay']],'group':[_0x2bf0('0x2c')]})[_0x2bf0('0x1b')](function(_0x17350f){logger[_0x2bf0('0xd')](_0x2bf0('0x49'),_0x4c21f2);logger[_0x2bf0('0xf')]('GetCampaignHopperHistory',_0x4c21f2,JSON[_0x2bf0('0x11')](_0x17350f));_0x170b26(_0x17350f);})[_0x2bf0('0x1d')](function(_0x139e38){logger[_0x2bf0('0x12')]('GetCampaignHopperHistory',_0x139e38[_0x2bf0('0x14')],_0x4c21f2);_0x305dac(_0x2e596b['error'](0x1f4,_0x139e38[_0x2bf0('0x14')]));});});}; \ No newline at end of file +var _0xb98f=['../../config/environment','jayson/promise','http','info','CmHopperHistory,\x20%s,\x20%s','CmHopperHistory,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','CreateCmHopperHistory','CmHopperHistory','create','body','options','raw','then','findAll','sequelize','col','predictiveIntervalTotalCalls','`state`\x20=\x204,\x201,\x20null','literal','`state`\x20=\x2010,\x201,\x20null','predictiveIntervalDroppedCallsTimeout','COUNT','`state`\x20=\x2011,\x201,\x20null','predictiveIntervalDroppedCallsCallersExit','`state`\x20=\x204,\x20`talktime`,\x20null','predictiveIntervalAvgTalktime','AvgHandleTime','debug','GetVoiceQueueHopperHistory','where','campaign','name','`state`\x20=\x200,\x201,\x20null','outboundNoSuchCallsDay','`state`\x20=\x203,\x201,\x20null','outboundAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','outboundBusyCallsDay','`state`\x20=\x208,\x201,\x20null','`state`\x20=\x2010\x20,\x201,\x20null','outboundDropCallsDayTimeout','`state`\x20=\x2011\x20,\x201,\x20null','outboundDropCallsDayCallersExit','`state`\x20=\x2012,\x201,\x20null','outboundUnknownCallsDay','`state`\x20=\x2013,\x201,\x20null','outboundBlacklistCallsDay','`state`\x20=\x2014,\x201,\x20null','outboundOriginateFailureCallsDay','`state`\x20=\x2018,\x201,\x20null','outboundRejectCallsDay','`state`\x20=\x2016,\x201,\x20null','`state`\x20=\x2020,\x201,\x20null','outboundReCallsDay','GetCampaignHopperHistory','ivrTotalCallsDays','ivrAnswerCallsDay','lodash','util','moment','bluebird','randomstring','../../config/logger','rpc'];(function(_0x5c3ae9,_0x450f9a){var _0x3f5950=function(_0x594c1f){while(--_0x594c1f){_0x5c3ae9['push'](_0x5c3ae9['shift']());}};_0x3f5950(++_0x450f9a);}(_0xb98f,0xce));var _0xfb98=function(_0x22d69e,_0x40c49f){_0x22d69e=_0x22d69e-0x0;var _0x5229c4=_0xb98f[_0x22d69e];return _0x5229c4;};'use strict';var _=require(_0xfb98('0x0'));var util=require(_0xfb98('0x1'));var moment=require(_0xfb98('0x2'));var BPromise=require(_0xfb98('0x3'));var rs=require(_0xfb98('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xfb98('0x5'))(_0xfb98('0x6'));var config=require(_0xfb98('0x7'));var jayson=require(_0xfb98('0x8'));var client=jayson['client'][_0xfb98('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4a6af9,_0x5683e3,_0x27b394){return new BPromise(function(_0x4d06fc,_0x5b7b33){return client['request'](_0x4a6af9,_0x27b394)['then'](function(_0x4c5e32){logger[_0xfb98('0xa')](_0xfb98('0xb'),_0x5683e3,'request\x20sent');logger['debug'](_0xfb98('0xc'),_0x5683e3,'request\x20sent',JSON[_0xfb98('0xd')](_0x4c5e32));if(_0x4c5e32[_0xfb98('0xe')]){if(_0x4c5e32[_0xfb98('0xe')][_0xfb98('0xf')]===0x1f4){logger[_0xfb98('0xe')](_0xfb98('0xb'),_0x5683e3,_0x4c5e32[_0xfb98('0xe')][_0xfb98('0x10')]);return _0x5b7b33(_0x4c5e32[_0xfb98('0xe')][_0xfb98('0x10')]);}logger[_0xfb98('0xe')](_0xfb98('0xb'),_0x5683e3,_0x4c5e32[_0xfb98('0xe')][_0xfb98('0x10')]);return _0x4d06fc(_0x4c5e32['error'][_0xfb98('0x10')]);}else{logger['info'](_0xfb98('0xb'),_0x5683e3,_0xfb98('0x11'));_0x4d06fc(_0x4c5e32[_0xfb98('0x12')][_0xfb98('0x10')]);}})[_0xfb98('0x13')](function(_0x4c030a){logger[_0xfb98('0xe')](_0xfb98('0xb'),_0x5683e3,_0x4c030a);_0x5b7b33(_0x4c030a);});});}exports[_0xfb98('0x14')]=function(_0x14b206){var _0x1ba04e=this;return new Promise(function(_0x15c4fa,_0x416b02){return db[_0xfb98('0x15')][_0xfb98('0x16')](_0x14b206[_0xfb98('0x17')],{'raw':_0x14b206[_0xfb98('0x18')]?_0x14b206[_0xfb98('0x18')][_0xfb98('0x19')]===undefined?!![]:![]:!![]})[_0xfb98('0x1a')](function(_0x23bc24){logger[_0xfb98('0xa')](_0xfb98('0x14'),_0x14b206);logger['debug'](_0xfb98('0x14'),_0x14b206,JSON[_0xfb98('0xd')](_0x23bc24));_0x15c4fa(_0x23bc24);})[_0xfb98('0x13')](function(_0x284b59){logger['error'](_0xfb98('0x14'),_0x284b59[_0xfb98('0x10')],_0x14b206);_0x416b02(_0x1ba04e[_0xfb98('0xe')](0x1f4,_0x284b59['message']));});});};exports['AvgHandleTime']=function(_0x433fce){var _0x269576=this;return new Promise(function(_0x5637d6,_0x22523a){return db['CmHopperHistory'][_0xfb98('0x1b')]({'raw':_0x433fce[_0xfb98('0x18')]?_0x433fce['options']['raw']===undefined?!![]:![]:!![],'where':_0x433fce[_0xfb98('0x18')]?_0x433fce[_0xfb98('0x18')]['where']||null:null,'attributes':[[db[_0xfb98('0x1c')]['fn']('COUNT',db[_0xfb98('0x1c')][_0xfb98('0x1d')]('id')),_0xfb98('0x1e')],[db[_0xfb98('0x1c')]['fn']('COUNT',db[_0xfb98('0x1c')]['fn']('IF',db[_0xfb98('0x1c')]['literal'](_0xfb98('0x1f')))),'predictiveIntervalAnsweredCalls'],[db['sequelize']['fn']('COUNT',db['sequelize']['fn']('IF',db['sequelize'][_0xfb98('0x20')](_0xfb98('0x21')))),_0xfb98('0x22')],[db['sequelize']['fn'](_0xfb98('0x23'),db[_0xfb98('0x1c')]['fn']('IF',db['sequelize'][_0xfb98('0x20')](_0xfb98('0x24')))),_0xfb98('0x25')],[db[_0xfb98('0x1c')]['fn']('AVG',db[_0xfb98('0x1c')]['fn']('IF',db[_0xfb98('0x1c')][_0xfb98('0x20')]('`state`\x20=\x204,\x20`holdtime`,\x20null'))),'predictiveIntervalAvgHoldtime'],[db[_0xfb98('0x1c')]['fn']('AVG',db[_0xfb98('0x1c')]['fn']('IF',db[_0xfb98('0x1c')][_0xfb98('0x20')](_0xfb98('0x26')))),_0xfb98('0x27')]]})[_0xfb98('0x1a')](function(_0x4134c9){logger[_0xfb98('0xa')](_0xfb98('0x28'),_0x433fce);logger[_0xfb98('0x29')](_0xfb98('0x28'),_0x433fce,JSON[_0xfb98('0xd')](_0x4134c9));_0x5637d6(_0x4134c9);})[_0xfb98('0x13')](function(_0x480e62){logger[_0xfb98('0xe')](_0xfb98('0x28'),_0x480e62[_0xfb98('0x10')],_0x433fce);_0x22523a(_0x269576[_0xfb98('0xe')](0x1f4,_0x480e62[_0xfb98('0x10')]));});});};exports[_0xfb98('0x2a')]=function(_0x502a26){var _0x4e955f=this;return new Promise(function(_0x1c3425,_0x5063aa){return db['CmHopperHistory']['findAll']({'raw':_0x502a26['options']?_0x502a26[_0xfb98('0x18')][_0xfb98('0x19')]===undefined?!![]:![]:!![],'where':_0x502a26['options']?_0x502a26[_0xfb98('0x18')][_0xfb98('0x2b')]||null:null,'attributes':[[_0xfb98('0x2c'),_0xfb98('0x2d')],[db['sequelize']['fn'](_0xfb98('0x23'),db[_0xfb98('0x1c')]['fn']('IF',db[_0xfb98('0x1c')]['literal'](_0xfb98('0x2e')))),_0xfb98('0x2f')],[db[_0xfb98('0x1c')]['fn'](_0xfb98('0x23'),db[_0xfb98('0x1c')]['fn']('IF',db['sequelize']['literal'](_0xfb98('0x30')))),'outboundNoAnswerCallsDay'],[db['sequelize']['fn']('COUNT',db['sequelize']['fn']('IF',db['sequelize']['literal'](_0xfb98('0x1f')))),_0xfb98('0x31')],[db[_0xfb98('0x1c')]['fn'](_0xfb98('0x23'),db[_0xfb98('0x1c')]['fn']('IF',db[_0xfb98('0x1c')]['literal'](_0xfb98('0x32')))),_0xfb98('0x33')],[db[_0xfb98('0x1c')]['fn']('COUNT',db[_0xfb98('0x1c')]['fn']('IF',db[_0xfb98('0x1c')]['literal'](_0xfb98('0x34')))),'outboundCongestionCallsDay'],[db[_0xfb98('0x1c')]['fn']('COUNT',db[_0xfb98('0x1c')]['fn']('IF',db[_0xfb98('0x1c')]['literal'](_0xfb98('0x35')))),_0xfb98('0x36')],[db[_0xfb98('0x1c')]['fn']('COUNT',db[_0xfb98('0x1c')]['fn']('IF',db[_0xfb98('0x1c')][_0xfb98('0x20')](_0xfb98('0x37')))),_0xfb98('0x38')],[db['sequelize']['fn'](_0xfb98('0x23'),db['sequelize']['fn']('IF',db[_0xfb98('0x1c')]['literal'](_0xfb98('0x39')))),_0xfb98('0x3a')],[db[_0xfb98('0x1c')]['fn'](_0xfb98('0x23'),db[_0xfb98('0x1c')]['fn']('IF',db[_0xfb98('0x1c')][_0xfb98('0x20')](_0xfb98('0x3b')))),_0xfb98('0x3c')],[db[_0xfb98('0x1c')]['fn'](_0xfb98('0x23'),db[_0xfb98('0x1c')]['fn']('IF',db[_0xfb98('0x1c')][_0xfb98('0x20')](_0xfb98('0x3d')))),_0xfb98('0x3e')],[db[_0xfb98('0x1c')]['fn'](_0xfb98('0x23'),db[_0xfb98('0x1c')]['fn']('IF',db[_0xfb98('0x1c')][_0xfb98('0x20')](_0xfb98('0x3f')))),_0xfb98('0x40')],[db[_0xfb98('0x1c')]['fn'](_0xfb98('0x23'),db[_0xfb98('0x1c')]['fn']('IF',db['sequelize']['literal'](_0xfb98('0x41')))),'outboundAnswerAgiCallsDay'],[db[_0xfb98('0x1c')]['fn'](_0xfb98('0x23'),db[_0xfb98('0x1c')]['fn']('IF',db['sequelize'][_0xfb98('0x20')](_0xfb98('0x42')))),_0xfb98('0x40')],[db[_0xfb98('0x1c')]['fn'](_0xfb98('0x23'),db[_0xfb98('0x1c')]['fn']('IF',db[_0xfb98('0x1c')][_0xfb98('0x20')]('`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null'))),_0xfb98('0x43')]],'group':['campaign']})[_0xfb98('0x1a')](function(_0x24a3d8){logger[_0xfb98('0xa')](_0xfb98('0x2a'),_0x502a26);logger['debug'](_0xfb98('0x2a'),_0x502a26,JSON[_0xfb98('0xd')](_0x24a3d8));_0x1c3425(_0x24a3d8);})[_0xfb98('0x13')](function(_0x2a6348){logger['error'](_0xfb98('0x2a'),_0x2a6348[_0xfb98('0x10')],_0x502a26);_0x5063aa(_0x4e955f['error'](0x1f4,_0x2a6348[_0xfb98('0x10')]));});});};exports[_0xfb98('0x44')]=function(_0x35f644){var _0xbf6a8a=this;return new Promise(function(_0x1ea037,_0x35f944){return db[_0xfb98('0x15')][_0xfb98('0x1b')]({'raw':_0x35f644[_0xfb98('0x18')]?_0x35f644['options'][_0xfb98('0x19')]===undefined?!![]:![]:!![],'where':_0x35f644[_0xfb98('0x18')]?_0x35f644[_0xfb98('0x18')][_0xfb98('0x2b')]||null:null,'attributes':[['campaign',_0xfb98('0x2d')],[db[_0xfb98('0x1c')]['fn'](_0xfb98('0x23'),db['sequelize'][_0xfb98('0x1d')]('id')),_0xfb98('0x45')],[db['sequelize']['fn'](_0xfb98('0x23'),db[_0xfb98('0x1c')]['fn']('IF',db[_0xfb98('0x1c')][_0xfb98('0x20')](_0xfb98('0x1f')))),_0xfb98('0x46')]],'group':[_0xfb98('0x2c')]})[_0xfb98('0x1a')](function(_0x4b07c5){logger[_0xfb98('0xa')](_0xfb98('0x44'),_0x35f644);logger[_0xfb98('0x29')](_0xfb98('0x44'),_0x35f644,JSON[_0xfb98('0xd')](_0x4b07c5));_0x1ea037(_0x4b07c5);})[_0xfb98('0x13')](function(_0x320c26){logger[_0xfb98('0xe')](_0xfb98('0x44'),_0x320c26[_0xfb98('0x10')],_0x35f644);_0x35f944(_0xbf6a8a['error'](0x1f4,_0x320c26['message']));});});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/index.js b/server/api/cmHopperHistory/index.js index 8de5413..de68eb5 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 _0x1f9f=['connect-timeout','express','Router','fs-extra','../../components/interaction/service','./cmHopperHistory.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','update','exports'];(function(_0x2f4737,_0x3e128c){var _0x1448e5=function(_0x1419c3){while(--_0x1419c3){_0x2f4737['push'](_0x2f4737['shift']());}};_0x1448e5(++_0x3e128c);}(_0x1f9f,0x1dc));var _0xf1f9=function(_0x199f29,_0x4e40e2){_0x199f29=_0x199f29-0x0;var _0x57c7b4=_0x1f9f[_0x199f29];return _0x57c7b4;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xf1f9('0x0'));var express=require(_0xf1f9('0x1'));var router=express[_0xf1f9('0x2')]();var fs_extra=require(_0xf1f9('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xf1f9('0x4'));var config=require('../../config/environment');var controller=require(_0xf1f9('0x5'));router[_0xf1f9('0x6')]('/',auth[_0xf1f9('0x7')](),controller[_0xf1f9('0x8')]);router['get'](_0xf1f9('0x9'),auth['isAuthenticated'](),controller[_0xf1f9('0xa')]);router[_0xf1f9('0x6')](_0xf1f9('0xb'),auth[_0xf1f9('0x7')](),controller[_0xf1f9('0xc')]);router[_0xf1f9('0xd')]('/',auth[_0xf1f9('0x7')](),controller[_0xf1f9('0xe')]);router['put'](_0xf1f9('0xb'),auth['isAuthenticated'](),controller[_0xf1f9('0xf')]);module[_0xf1f9('0x10')]=router; \ No newline at end of file +var _0x7a9e=['util','path','fs-extra','../../components/auth/service','../../config/environment','./cmHopperHistory.controller','get','isAuthenticated','index','/describe','describe','/:id','show','create','put','update','multer'];(function(_0x50b1b5,_0x4e6291){var _0x2252e7=function(_0x36f219){while(--_0x36f219){_0x50b1b5['push'](_0x50b1b5['shift']());}};_0x2252e7(++_0x4e6291);}(_0x7a9e,0xba));var _0xe7a9=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x7a9e[_0x40a045];return _0x1a687c;};'use strict';var multer=require(_0xe7a9('0x0'));var util=require(_0xe7a9('0x1'));var path=require(_0xe7a9('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xe7a9('0x3'));var auth=require(_0xe7a9('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xe7a9('0x5'));var controller=require(_0xe7a9('0x6'));router[_0xe7a9('0x7')]('/',auth[_0xe7a9('0x8')](),controller[_0xe7a9('0x9')]);router['get'](_0xe7a9('0xa'),auth[_0xe7a9('0x8')](),controller[_0xe7a9('0xb')]);router[_0xe7a9('0x7')](_0xe7a9('0xc'),auth[_0xe7a9('0x8')](),controller[_0xe7a9('0xd')]);router['post']('/',auth[_0xe7a9('0x8')](),controller[_0xe7a9('0xe')]);router[_0xe7a9('0xf')]('/:id',auth[_0xe7a9('0x8')](),controller[_0xe7a9('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmList/cmList.attributes.js b/server/api/cmList/cmList.attributes.js index 69342b7..63173a8 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 _0xe105=['STRING','sequelize'];(function(_0x1969a7,_0x5a133a){var _0x3d665f=function(_0x39c64b){while(--_0x39c64b){_0x1969a7['push'](_0x1969a7['shift']());}};_0x3d665f(++_0x5a133a);}(_0xe105,0xef));var _0x5e10=function(_0x2bd6d7,_0x3af84c){_0x2bd6d7=_0x2bd6d7-0x0;var _0x240110=_0xe105[_0x2bd6d7];return _0x240110;};'use strict';var Sequelize=require(_0x5e10('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']},'dialPrefix':{'type':Sequelize[_0x5e10('0x1')]}}; \ No newline at end of file +var _0x3074=['sequelize','STRING','name'];(function(_0x39187b,_0x2a6214){var _0x2cf25f=function(_0x183c3e){while(--_0x183c3e){_0x39187b['push'](_0x39187b['shift']());}};_0x2cf25f(++_0x2a6214);}(_0x3074,0x1dd));var _0x4307=function(_0x1deed1,_0x40dfb7){_0x1deed1=_0x1deed1-0x0;var _0x401d3a=_0x3074[_0x1deed1];return _0x401d3a;};'use strict';var Sequelize=require(_0x4307('0x0'));module['exports']={'name':{'type':Sequelize[_0x4307('0x1')],'unique':_0x4307('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x4307('0x1')]},'dialPrefix':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/cmList/cmList.controller.js b/server/api/cmList/cmList.controller.js index 1a4da5f..de2933d 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 _0x88bb=['stack','name','send','index','map','CmList','rawAttributes','fieldName','type','key','query','keys','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','include','show','params','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Lists','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addDisposition','Disposition','getDispositions','findOne','ListId','includeAll','rows','removeDispositions','ids','addContacts','CmContact','describe','tags','isArray','push','each','omit','success','errors','message','Malformed\x20request\x20syntax','getContacts','CmCustomField','CustomFields','concat','cf_%d','raw','getContactsCsv','ContactItemType','OrderBy','findAll','alias','cm_contacts','c.ListId\x20=\x20?','c.cf_','customField_','field','item','from','cm_contact_has_items','ItemTypeId\x20=\x20?','CmContactId\x20=\x20c.id','additionalPhone_','description','description_additionalPhone_','toString','isEmpty','now','writeFileSync','format','/tmp/list_%d_%s.csv','attachment;\x20filename=','list_%d_%s.csv','setHeader','text/csv','addCustomField','sequelize','addCustomFields','Sequelize','TEXT','number','switch','BOOLEAN','cf_%s','getCustomFields','findAndCountAll','spread','emit','userCmList:save','removeAgents','userCmList:remove','getAgents','info','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','socket.io-emitter','./cmList.socket','register','status','limit','count','offset','json','apply','reject','save','update','then','destroy','get','UserProfileResource','sendStatus'];(function(_0x4141e7,_0x2cc809){var _0x266f06=function(_0x14efa8){while(--_0x14efa8){_0x4141e7['push'](_0x4141e7['shift']());}};_0x266f06(++_0x2cc809);}(_0x88bb,0x75));var _0xb88b=function(_0x366652,_0x523cd8){_0x366652=_0x366652-0x0;var _0x5b9d39=_0x88bb[_0x366652];return _0x5b9d39;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb88b('0x0'));var zipdir=require(_0xb88b('0x1'));var jsonpatch=require(_0xb88b('0x2'));var rp=require('request-promise');var moment=require(_0xb88b('0x3'));var BPromise=require(_0xb88b('0x4'));var Mustache=require(_0xb88b('0x5'));var util=require(_0xb88b('0x6'));var path=require(_0xb88b('0x7'));var sox=require(_0xb88b('0x8'));var csv=require(_0xb88b('0x9'));var ejs=require(_0xb88b('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xb88b('0xb'));var crypto=require(_0xb88b('0xc'));var jsforce=require(_0xb88b('0xd'));var deskjs=require(_0xb88b('0xe'));var toCsv=require(_0xb88b('0x9'));var querystring=require(_0xb88b('0xf'));var Papa=require(_0xb88b('0x10'));var Redis=require(_0xb88b('0x11'));var authService=require(_0xb88b('0x12'));var qs=require(_0xb88b('0x13'));var as=require(_0xb88b('0x14'));var hardwareService=require(_0xb88b('0x15'));var logger=require(_0xb88b('0x16'))(_0xb88b('0x17'));var utils=require(_0xb88b('0x18'));var config=require(_0xb88b('0x19'));var licenseUtil=require(_0xb88b('0x1a'));var db=require('../../mysqldb')['db'];var csv_results;config[_0xb88b('0x1b')]=_[_0xb88b('0x1c')](config[_0xb88b('0x1b')],{'host':'localhost','port':0x18eb});var socket=require(_0xb88b('0x1d'))(new Redis(config[_0xb88b('0x1b')]));require(_0xb88b('0x1e'))[_0xb88b('0x1f')](socket);function respondWithStatusCode(_0x5a43f8,_0x541600){_0x541600=_0x541600||0xcc;return function(_0xc342ae){if(_0xc342ae){return _0x5a43f8['sendStatus'](_0x541600);}return _0x5a43f8['status'](_0x541600)['end']();};}function respondWithResult(_0x565b4f,_0x4da0e7){_0x4da0e7=_0x4da0e7||0xc8;return function(_0x85567e){if(_0x85567e){return _0x565b4f[_0xb88b('0x20')](_0x4da0e7)['json'](_0x85567e);}};}function respondWithFilteredResult(_0x6a5add,_0x544fca){return function(_0x301d71){if(_0x301d71){var _0x376536=typeof _0x544fca['offset']==='undefined'&&typeof _0x544fca[_0xb88b('0x21')]==='undefined';var _0xa106f6=_0x301d71[_0xb88b('0x22')];var _0x71203=_0x376536?0x0:_0x544fca[_0xb88b('0x23')];var _0x4bf13d=_0x376536?_0x301d71[_0xb88b('0x22')]:_0x544fca[_0xb88b('0x23')]+_0x544fca['limit'];var _0x22a254;if(_0x4bf13d>=_0xa106f6){_0x4bf13d=_0xa106f6;_0x22a254=0xc8;}else{_0x22a254=0xce;}_0x6a5add[_0xb88b('0x20')](_0x22a254);return _0x6a5add['set']('Content-Range',_0x71203+'-'+_0x4bf13d+'/'+_0xa106f6)[_0xb88b('0x24')](_0x301d71);}return null;};}function patchUpdates(_0x19e40a){return function(_0x1973cc){try{jsonpatch[_0xb88b('0x25')](_0x1973cc,_0x19e40a,!![]);}catch(_0x134903){return BPromise[_0xb88b('0x26')](_0x134903);}return _0x1973cc[_0xb88b('0x27')]();};}function saveUpdates(_0x65c2d9,_0x4aa94a){return function(_0x415f71){if(_0x415f71){return _0x415f71[_0xb88b('0x28')](_0x65c2d9)[_0xb88b('0x29')](function(_0x3901ef){return _0x3901ef;});}return null;};}function removeEntity(_0xf506f3,_0x54b62d){return function(_0x1c9bd3){if(_0x1c9bd3){return _0x1c9bd3[_0xb88b('0x2a')]()[_0xb88b('0x29')](function(){var _0x4b1170=_0x1c9bd3[_0xb88b('0x2b')]({'plain':!![]});var _0xcb3c3e='Lists';return db[_0xb88b('0x2c')][_0xb88b('0x2a')]({'where':{'type':_0xcb3c3e,'resourceId':_0x4b1170['id']}})[_0xb88b('0x29')](function(){return _0x1c9bd3;});})[_0xb88b('0x29')](function(){_0xf506f3['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4131de,_0x2cdd91){return function(_0xed60aa){if(!_0xed60aa){_0x4131de[_0xb88b('0x2d')](0x194);}return _0xed60aa;};}function handleError(_0x581409,_0x8f6c52){_0x8f6c52=_0x8f6c52||0x1f4;return function(_0x40afc9){logger['error'](_0x40afc9[_0xb88b('0x2e')]);if(_0x40afc9[_0xb88b('0x2f')]){delete _0x40afc9['name'];}_0x581409[_0xb88b('0x20')](_0x8f6c52)[_0xb88b('0x30')](_0x40afc9);};}exports[_0xb88b('0x31')]=function(_0x54cdb8,_0x57f7af){var _0x95b093={},_0x4bbef3={},_0x5acae3={'count':0x0,'rows':[]};var _0x2d529b=_[_0xb88b('0x32')](db[_0xb88b('0x33')][_0xb88b('0x34')],function(_0x451d87){return{'name':_0x451d87[_0xb88b('0x35')],'type':_0x451d87[_0xb88b('0x36')][_0xb88b('0x37')]};});_0x4bbef3['model']=_[_0xb88b('0x32')](_0x2d529b,_0xb88b('0x2f'));_0x4bbef3[_0xb88b('0x38')]=_[_0xb88b('0x39')](_0x54cdb8[_0xb88b('0x38')]);_0x4bbef3['filters']=_['intersection'](_0x4bbef3[_0xb88b('0x3a')],_0x4bbef3['query']);_0x95b093[_0xb88b('0x3b')]=_[_0xb88b('0x3c')](_0x4bbef3['model'],qs[_0xb88b('0x3d')](_0x54cdb8[_0xb88b('0x38')]['fields']));_0x95b093[_0xb88b('0x3b')]=_0x95b093['attributes'][_0xb88b('0x3e')]?_0x95b093[_0xb88b('0x3b')]:_0x4bbef3[_0xb88b('0x3a')];if(!_0x54cdb8['query'][_0xb88b('0x3f')](_0xb88b('0x40'))){_0x95b093['limit']=qs['limit'](_0x54cdb8['query'][_0xb88b('0x21')]);_0x95b093['offset']=qs[_0xb88b('0x23')](_0x54cdb8[_0xb88b('0x38')][_0xb88b('0x23')]);}_0x95b093[_0xb88b('0x41')]=qs[_0xb88b('0x42')](_0x54cdb8[_0xb88b('0x38')][_0xb88b('0x42')]);_0x95b093[_0xb88b('0x43')]=qs[_0xb88b('0x44')](_[_0xb88b('0x45')](_0x54cdb8[_0xb88b('0x38')],_0x4bbef3[_0xb88b('0x44')]),_0x2d529b);if(_0x54cdb8[_0xb88b('0x38')][_0xb88b('0x46')]){_0x95b093[_0xb88b('0x43')]=_[_0xb88b('0x47')](_0x95b093[_0xb88b('0x43')],{'$or':_[_0xb88b('0x32')](_0x2d529b,function(_0x576076){if(_0x576076[_0xb88b('0x36')]!==_0xb88b('0x48')){var _0x49535b={};_0x49535b[_0x576076[_0xb88b('0x2f')]]={'$like':'%'+_0x54cdb8[_0xb88b('0x38')][_0xb88b('0x46')]+'%'};return _0x49535b;}})});}_0x95b093=_[_0xb88b('0x47')]({},_0x95b093,_0x54cdb8[_0xb88b('0x49')]);var _0x55d7ea={'where':_0x95b093['where']};return db[_0xb88b('0x33')][_0xb88b('0x22')](_0x55d7ea)[_0xb88b('0x29')](function(_0xdc77b){_0x5acae3[_0xb88b('0x22')]=_0xdc77b;if(_0x54cdb8[_0xb88b('0x38')]['includeAll']){_0x95b093[_0xb88b('0x4a')]=[{'all':!![]}];}return db['CmList']['findAll'](_0x95b093);})[_0xb88b('0x29')](function(_0x37ade2){_0x5acae3['rows']=_0x37ade2;return _0x5acae3;})[_0xb88b('0x29')](respondWithFilteredResult(_0x57f7af,_0x95b093))['catch'](handleError(_0x57f7af,null));};exports[_0xb88b('0x4b')]=function(_0xba29e0,_0x599d15){var _0x29e4ef={'raw':![],'where':{'id':_0xba29e0[_0xb88b('0x4c')]['id']}},_0x37dac0={};_0x37dac0[_0xb88b('0x3a')]=_[_0xb88b('0x39')](db['CmList'][_0xb88b('0x34')]);_0x37dac0[_0xb88b('0x38')]=_[_0xb88b('0x39')](_0xba29e0[_0xb88b('0x38')]);_0x37dac0['filters']=_[_0xb88b('0x3c')](_0x37dac0[_0xb88b('0x3a')],_0x37dac0[_0xb88b('0x38')]);_0x29e4ef[_0xb88b('0x3b')]=_['intersection'](_0x37dac0[_0xb88b('0x3a')],qs['fields'](_0xba29e0[_0xb88b('0x38')][_0xb88b('0x3d')]));_0x29e4ef['attributes']=_0x29e4ef['attributes']['length']?_0x29e4ef[_0xb88b('0x3b')]:_0x37dac0[_0xb88b('0x3a')];if(_0xba29e0['query']['includeAll']){_0x29e4ef[_0xb88b('0x4a')]=[{'all':!![]}];}_0x29e4ef=_[_0xb88b('0x47')]({},_0x29e4ef,_0xba29e0['options']);return db['CmList'][_0xb88b('0x4d')](_0x29e4ef)[_0xb88b('0x29')](handleEntityNotFound(_0x599d15,null))[_0xb88b('0x29')](respondWithResult(_0x599d15,null))[_0xb88b('0x4e')](handleError(_0x599d15,null));};exports[_0xb88b('0x4f')]=function(_0x318a30,_0x358d31){return db[_0xb88b('0x33')][_0xb88b('0x4f')](_0x318a30[_0xb88b('0x50')],{})['then'](function(_0x84d4f9){var _0x16677b=_0x318a30[_0xb88b('0x51')][_0xb88b('0x2b')]({'plain':!![]});if(!_0x16677b)throw new Error(_0xb88b('0x52'));if(_0x16677b[_0xb88b('0x53')]===_0xb88b('0x51')){var _0x1aedc5=_0x84d4f9[_0xb88b('0x2b')]({'plain':!![]});var _0x5432c4=_0xb88b('0x54');return db[_0xb88b('0x55')][_0xb88b('0x4d')]({'where':{'name':_0x5432c4,'userProfileId':_0x16677b[_0xb88b('0x56')]},'raw':!![]})[_0xb88b('0x29')](function(_0x1952d8){if(_0x1952d8&&_0x1952d8[_0xb88b('0x57')]===0x0){return db[_0xb88b('0x2c')][_0xb88b('0x4f')]({'name':_0x1aedc5[_0xb88b('0x2f')],'resourceId':_0x1aedc5['id'],'type':_0x1952d8['name'],'sectionId':_0x1952d8['id']},{})[_0xb88b('0x29')](function(){return _0x84d4f9;});}else{return _0x84d4f9;}})[_0xb88b('0x4e')](function(_0x49cd4f){logger[_0xb88b('0x58')](_0xb88b('0x59'),_0x49cd4f);throw _0x49cd4f;});}return _0x84d4f9;})[_0xb88b('0x29')](respondWithResult(_0x358d31,0xc9))[_0xb88b('0x4e')](handleError(_0x358d31,null));};exports['update']=function(_0x5568f8,_0x315dd1){if(_0x5568f8['body']['id']){delete _0x5568f8[_0xb88b('0x50')]['id'];}return db['CmList'][_0xb88b('0x4d')]({'where':{'id':_0x5568f8[_0xb88b('0x4c')]['id']}})[_0xb88b('0x29')](handleEntityNotFound(_0x315dd1,null))[_0xb88b('0x29')](saveUpdates(_0x5568f8[_0xb88b('0x50')],null))['then'](respondWithResult(_0x315dd1,null))[_0xb88b('0x4e')](handleError(_0x315dd1,null));};exports[_0xb88b('0x2a')]=function(_0x1ad0a3,_0x5621b2){return db['CmList'][_0xb88b('0x4d')]({'where':{'id':_0x1ad0a3[_0xb88b('0x4c')]['id']}})[_0xb88b('0x29')](handleEntityNotFound(_0x5621b2,null))[_0xb88b('0x29')](removeEntity(_0x5621b2,null))[_0xb88b('0x4e')](handleError(_0x5621b2,null));};exports['describe']=function(_0x5f211b,_0x4f7fc2){return db[_0xb88b('0x33')]['describe']()['then'](respondWithResult(_0x4f7fc2,null))[_0xb88b('0x4e')](handleError(_0x4f7fc2,null));};exports[_0xb88b('0x5a')]=function(_0x2c93d1,_0x416d78,_0x128f1c){if(_0x2c93d1[_0xb88b('0x50')]['id']){delete _0x2c93d1['body']['id'];}return db[_0xb88b('0x33')][_0xb88b('0x4d')]({'where':{'id':_0x2c93d1[_0xb88b('0x4c')]['id']}})[_0xb88b('0x29')](handleEntityNotFound(_0x416d78,null))[_0xb88b('0x29')](function(_0x3a50c5){if(_0x3a50c5){_0x2c93d1[_0xb88b('0x50')]['ListId']=_0x3a50c5['id'];return db[_0xb88b('0x5b')][_0xb88b('0x4f')](_0x2c93d1[_0xb88b('0x50')]);}})['then'](respondWithResult(_0x416d78,null))[_0xb88b('0x4e')](handleError(_0x416d78,null));};exports[_0xb88b('0x5c')]=function(_0x373554,_0xe8e414,_0x480d5c){var _0x1a6edd={'raw':![],'where':{}};var _0x3977c9={};var _0x38e931={'count':0x0,'rows':[]};return db[_0xb88b('0x33')][_0xb88b('0x5d')]({'where':{'id':_0x373554[_0xb88b('0x4c')]['id']}})[_0xb88b('0x29')](handleEntityNotFound(_0xe8e414,null))[_0xb88b('0x29')](function(_0x253bff){if(_0x253bff){_0x3977c9[_0xb88b('0x3a')]=_[_0xb88b('0x39')](db[_0xb88b('0x5b')]['rawAttributes']);_0x3977c9['query']=_[_0xb88b('0x39')](_0x373554[_0xb88b('0x38')]);_0x3977c9[_0xb88b('0x44')]=_[_0xb88b('0x3c')](_0x3977c9[_0xb88b('0x3a')],_0x3977c9['query']);_0x1a6edd[_0xb88b('0x3b')]=_[_0xb88b('0x3c')](_0x3977c9[_0xb88b('0x3a')],qs[_0xb88b('0x3d')](_0x373554[_0xb88b('0x38')][_0xb88b('0x3d')]));_0x1a6edd[_0xb88b('0x3b')]=_0x1a6edd['attributes'][_0xb88b('0x3e')]?_0x1a6edd[_0xb88b('0x3b')]:_0x3977c9[_0xb88b('0x3a')];if(!_0x373554[_0xb88b('0x38')]['hasOwnProperty']('nolimit')){_0x1a6edd[_0xb88b('0x21')]=qs[_0xb88b('0x21')](_0x373554[_0xb88b('0x38')][_0xb88b('0x21')]);_0x1a6edd[_0xb88b('0x23')]=qs[_0xb88b('0x23')](_0x373554[_0xb88b('0x38')][_0xb88b('0x23')]);}_0x1a6edd['order']=qs[_0xb88b('0x42')](_0x373554['query'][_0xb88b('0x42')]);_0x1a6edd['where']=qs['filters'](_[_0xb88b('0x45')](_0x373554[_0xb88b('0x38')],_0x3977c9[_0xb88b('0x44')]));_0x1a6edd[_0xb88b('0x43')][_0xb88b('0x5e')]=_0x253bff['id'];if(_0x373554[_0xb88b('0x38')]['filter']){_0x1a6edd[_0xb88b('0x43')]=_[_0xb88b('0x47')](_0x1a6edd[_0xb88b('0x43')],{'$or':_[_0xb88b('0x32')](_0x1a6edd[_0xb88b('0x3b')],function(_0x5cefec){var _0x43926d={};_0x43926d[_0x5cefec]={'$like':'%'+_0x373554[_0xb88b('0x38')][_0xb88b('0x46')]+'%'};return _0x43926d;})});}_0x1a6edd=_[_0xb88b('0x47')]({},_0x1a6edd,_0x373554[_0xb88b('0x49')]);return db[_0xb88b('0x5b')][_0xb88b('0x22')]({'where':_0x1a6edd[_0xb88b('0x43')]})[_0xb88b('0x29')](function(_0x2c1b55){_0x38e931[_0xb88b('0x22')]=_0x2c1b55;if(_0x373554[_0xb88b('0x38')][_0xb88b('0x5f')]){_0x1a6edd['include']=[{'all':!![]}];}return db['Disposition']['findAll'](_0x1a6edd);})[_0xb88b('0x29')](function(_0x121e30){_0x38e931[_0xb88b('0x60')]=_0x121e30;return _0x38e931;});}})[_0xb88b('0x29')](respondWithFilteredResult(_0xe8e414,_0x1a6edd))[_0xb88b('0x4e')](handleError(_0xe8e414,null));};exports[_0xb88b('0x61')]=function(_0x4fdbf8,_0x69e9d7,_0x1640c3){return db[_0xb88b('0x33')][_0xb88b('0x4d')]({'where':{'id':_0x4fdbf8[_0xb88b('0x4c')]['id']}})['then'](handleEntityNotFound(_0x69e9d7,null))[_0xb88b('0x29')](function(_0x8dfb9){if(_0x8dfb9){return _0x8dfb9[_0xb88b('0x61')](_0x4fdbf8[_0xb88b('0x38')][_0xb88b('0x62')]);}})['then'](respondWithStatusCode(_0x69e9d7,null))[_0xb88b('0x4e')](handleError(_0x69e9d7,null));};exports[_0xb88b('0x63')]=function(_0xe99f2c,_0xa2ad3f,_0x494b9c){return db[_0xb88b('0x33')][_0xb88b('0x4d')]({'where':{'id':_0xe99f2c['params']['id']}})[_0xb88b('0x29')](handleEntityNotFound(_0xa2ad3f,null))['then'](function(_0x1fb91e){if(_0x1fb91e){var _0x38bbe0=[];var _0x3e7a58={'success':[],'errors':[]};return db[_0xb88b('0x64')][_0xb88b('0x65')]()['then'](function(_0x465479){if(_0xe99f2c[_0xb88b('0x50')][_0xb88b('0x66')]&&_[_0xb88b('0x67')](_0xe99f2c[_0xb88b('0x50')][_0xb88b('0x66')])){if(_0xe99f2c[_0xb88b('0x50')][_0xb88b('0x66')]['length']){_0xe99f2c['body']['tags']=_0xe99f2c['body'][_0xb88b('0x66')]['join'](';')+';';}else{_0xe99f2c[_0xb88b('0x50')][_0xb88b('0x66')]=null;}}else{_0xe99f2c[_0xb88b('0x50')][_0xb88b('0x66')]=null;}if(_0xe99f2c['body']&&_[_0xb88b('0x67')](_0xe99f2c[_0xb88b('0x50')])){for(var _0x8da4e0=0x0;_0x8da4e0<_0xe99f2c[_0xb88b('0x50')][_0xb88b('0x3e')];_0x8da4e0+=0x1){_0xe99f2c[_0xb88b('0x50')][_0x8da4e0][_0xb88b('0x5e')]=_0xe99f2c[_0xb88b('0x4c')]['id'];_0x38bbe0[_0xb88b('0x68')](_0xe99f2c[_0xb88b('0x50')][_0x8da4e0]);}return BPromise[_0xb88b('0x69')](_0x38bbe0,function(_0x17ae84){return db[_0xb88b('0x64')]['create'](_[_0xb88b('0x6a')](_0x17ae84,[_0xb88b('0x62'),'id'])||{},{'fields':_[_0xb88b('0x39')](_0x465479),'raw':!![]})[_0xb88b('0x29')](function(_0x5400ca){_0x3e7a58[_0xb88b('0x6b')][_0xb88b('0x68')](_0x5400ca['dataValues']);})[_0xb88b('0x4e')](function(_0x31773d){_0x3e7a58[_0xb88b('0x6c')][_0xb88b('0x68')]({'data':_0x17ae84,'error':_0x31773d[_0xb88b('0x6d')]});});})['then'](function(_0xab290f){return _0x3e7a58;})[_0xb88b('0x4e')](function(_0x488f9a){return _0x488f9a;});}else{_0xa2ad3f['status'](0x190)[_0xb88b('0x24')]({'message':_0xb88b('0x6e')});}});}})['then'](respondWithResult(_0xa2ad3f,null))[_0xb88b('0x4e')](handleError(_0xa2ad3f,null));};exports[_0xb88b('0x6f')]=function(_0x2826b8,_0x1280ef,_0x58008b){var _0xdc4a8d;return db[_0xb88b('0x33')][_0xb88b('0x4d')]({'where':{'id':_0x2826b8[_0xb88b('0x4c')]['id']},'include':[{'model':db[_0xb88b('0x70')],'as':_0xb88b('0x71')}]})[_0xb88b('0x29')](handleEntityNotFound(_0x1280ef,null))[_0xb88b('0x29')](function(_0x5e1902){if(_0x5e1902){_0xdc4a8d=_0x5e1902;return db[_0xb88b('0x64')][_0xb88b('0x34')];}})[_0xb88b('0x29')](function(_0x541342){if(_0x541342){var _0x103fe2={};var _0x2ee41d={};_0x2ee41d[_0xb88b('0x3a')]=_[_0xb88b('0x72')](_[_0xb88b('0x39')](_0x541342),_['map'](_0xdc4a8d['CustomFields'],function(_0x4ffcc0){return util['format'](_0xb88b('0x73'),_0x4ffcc0['id']);}));_0x2ee41d[_0xb88b('0x38')]=_[_0xb88b('0x39')](_0x2826b8[_0xb88b('0x38')]);_0x2ee41d[_0xb88b('0x44')]=_['intersection'](_0x2ee41d[_0xb88b('0x3a')],_0x2ee41d['query']);_0x103fe2[_0xb88b('0x3b')]=_[_0xb88b('0x3c')](_0x2ee41d['model'],qs[_0xb88b('0x3d')](_0x2826b8[_0xb88b('0x38')][_0xb88b('0x3d')]));_0x103fe2[_0xb88b('0x3b')]=_0x103fe2[_0xb88b('0x3b')][_0xb88b('0x3e')]?_0x103fe2['attributes']:_0x2ee41d['model'];if(!_0x2826b8[_0xb88b('0x38')][_0xb88b('0x3f')]('nolimit')){_0x103fe2[_0xb88b('0x21')]=qs[_0xb88b('0x21')](_0x2826b8[_0xb88b('0x38')][_0xb88b('0x21')]);_0x103fe2['offset']=qs[_0xb88b('0x23')](_0x2826b8[_0xb88b('0x38')][_0xb88b('0x23')]);}_0x103fe2[_0xb88b('0x41')]=qs[_0xb88b('0x42')](_0x2826b8['query'][_0xb88b('0x42')]);_0x103fe2[_0xb88b('0x43')]=qs[_0xb88b('0x44')](_[_0xb88b('0x45')](_0x2826b8[_0xb88b('0x38')],_0x2ee41d[_0xb88b('0x44')]));_0x103fe2[_0xb88b('0x74')]=!![];if(_0x2826b8[_0xb88b('0x38')][_0xb88b('0x46')]){_0x103fe2['where']=_['merge'](_0x103fe2[_0xb88b('0x43')],{'$or':_[_0xb88b('0x32')](_0x103fe2[_0xb88b('0x3b')],function(_0x5747a2){var _0x19eac2={};_0x19eac2[_0x5747a2]={'$like':'%'+_0x2826b8[_0xb88b('0x38')][_0xb88b('0x46')]+'%'};return _0x19eac2;})});}_0x103fe2=_[_0xb88b('0x47')]({},_0x103fe2,_0x2826b8[_0xb88b('0x49')]);return _0xdc4a8d[_0xb88b('0x6f')](_0x103fe2);}})[_0xb88b('0x29')](respondWithResult(_0x1280ef,null))['catch'](handleError(_0x1280ef,null));};exports[_0xb88b('0x75')]=function(_0x4195de,_0x4ba64c,_0x5ec4db){var _0x22fd55;var _0x450793;var _0x2b4dc5;var _0x3d985b=_0x4195de[_0xb88b('0x4c')]['id'];csv_results=[];return db[_0xb88b('0x76')]['findAll']({'attributes':['id',_0xb88b('0x2f')],'raw':!![],'order':[_0xb88b('0x77')]})[_0xb88b('0x29')](function(_0x45a73f){_0x22fd55=_0x45a73f;var _0x1d9bfd=_[_0xb88b('0x39')](db[_0xb88b('0x64')][_0xb88b('0x34')]);return db[_0xb88b('0x70')][_0xb88b('0x78')]({'raw':!![],'attributes':['id',_0xb88b('0x79')]})[_0xb88b('0x29')](function(_0x14d928){_0x450793=_0x14d928;var _0xa8aa36=squel['select']()['fields'](_0x1d9bfd)['from'](_0xb88b('0x7a'),'c')[_0xb88b('0x43')](_0xb88b('0x7b'),_0x3d985b)[_0xb88b('0x43')]('c.deletedAt\x20is\x20null')['distinct']();for(var _0x4131d8=0x0;_0x4131d8<_0x450793[_0xb88b('0x3e')];_0x4131d8++){_0xa8aa36['field'](_0xb88b('0x7c')+_0x450793[_0x4131d8]['id'],_0xb88b('0x7d')+_0x450793[_0x4131d8][_0xb88b('0x79')]);}for(var _0x4131d8=0x0;_0x4131d8<_0x22fd55[_0xb88b('0x3e')];_0x4131d8++){_0xa8aa36[_0xb88b('0x7e')](squel['select']()['field'](_0xb88b('0x7f'))[_0xb88b('0x80')](_0xb88b('0x81'))['where'](_0xb88b('0x82'),_0x22fd55[_0x4131d8]['id'])[_0xb88b('0x43')](_0xb88b('0x83')),_0xb88b('0x84')+_0x22fd55[_0x4131d8][_0xb88b('0x2f')]);_0xa8aa36[_0xb88b('0x7e')](squel['select']()['field'](_0xb88b('0x85'))[_0xb88b('0x80')](_0xb88b('0x81'))[_0xb88b('0x43')](_0xb88b('0x82'),_0x22fd55[_0x4131d8]['id'])[_0xb88b('0x43')](_0xb88b('0x83')),_0xb88b('0x86')+_0x22fd55[_0x4131d8][_0xb88b('0x2f')]);}var _0x5d32ad=[];_0x5d32ad[_0xb88b('0x68')](_0xa8aa36[_0xb88b('0x87')]());BPromise[_0xb88b('0x69')](_0x5d32ad,handleQuery)[_0xb88b('0x29')](function(_0x574c4e){handleQuery(_0xa8aa36[_0xb88b('0x87')]());var _0x2c2e04=csv_results[0x0];if(!_[_0xb88b('0x88')](_0x2c2e04)){var _0x593b8b=toCsv(_0x2c2e04);var _0x3b99fd=Date[_0xb88b('0x89')]();fs[_0xb88b('0x8a')](util[_0xb88b('0x8b')](_0xb88b('0x8c'),_0x3d985b,_0x3b99fd),_0x593b8b);_0x4ba64c['setHeader']('Content-disposition',_0xb88b('0x8d')+util['format'](_0xb88b('0x8e'),_0x3d985b,_0x3b99fd));_0x4ba64c[_0xb88b('0x8f')]('Content-type',_0xb88b('0x90'));return _0x4ba64c['download'](util[_0xb88b('0x8b')](_0xb88b('0x8c'),_0x3d985b,_0x3b99fd));}else{return _0x4ba64c[_0xb88b('0x2d')](0xcc);}});});});};exports[_0xb88b('0x91')]=function(_0x661977,_0x126254,_0x42165e){var _0x307d22;delete _0x661977[_0xb88b('0x50')]['id'];return db['CmList'][_0xb88b('0x5d')]({'where':{'id':_0x661977[_0xb88b('0x4c')]['id']}})[_0xb88b('0x29')](handleEntityNotFound(_0x126254,null))[_0xb88b('0x29')](function(_0x3886b8){if(_0x3886b8){return db[_0xb88b('0x92')]['transaction'](function(_0x4d6ee8){return db[_0xb88b('0x70')][_0xb88b('0x4f')](_0x661977[_0xb88b('0x50')],{'transaction':_0x4d6ee8})[_0xb88b('0x29')](function(_0x7a8f71){_0x307d22=_0x7a8f71;return _0x3886b8[_0xb88b('0x93')](_0x7a8f71,{'transaction':_0x4d6ee8});})[_0xb88b('0x29')](function(){var _0x293ba4={'type':db[_0xb88b('0x94')][_0xb88b('0x95')],'transaction':_0x4d6ee8};switch(_0x661977[_0xb88b('0x50')][_0xb88b('0x36')]){case'text':_0x293ba4[_0xb88b('0x36')]=db[_0xb88b('0x94')][_0xb88b('0x95')];break;case _0xb88b('0x96'):_0x293ba4[_0xb88b('0x36')]=db[_0xb88b('0x94')]['INTEGER'];break;case _0xb88b('0x97'):_0x293ba4[_0xb88b('0x36')]=db[_0xb88b('0x94')][_0xb88b('0x98')];_0x293ba4['defaultValue']=![];break;default:}return db[_0xb88b('0x92')]['queryInterface']['addColumn'](_0xb88b('0x7a'),util[_0xb88b('0x8b')](_0xb88b('0x99'),_0x307d22['id']),_0x293ba4);})[_0xb88b('0x29')](function(){return _0x307d22;});});}})[_0xb88b('0x29')](respondWithResult(_0x126254,null))['catch'](handleError(_0x126254,null));};exports[_0xb88b('0x9a')]=function(_0x2f20d1,_0x3ef73e,_0x22d336){var _0x47eed8={};var _0x3b593e={};var _0xe3bfe;var _0x110ed9;return db[_0xb88b('0x33')][_0xb88b('0x5d')]({'where':{'id':_0x2f20d1['params']['id']}})[_0xb88b('0x29')](handleEntityNotFound(_0x3ef73e,null))[_0xb88b('0x29')](function(_0x246950){if(_0x246950){_0xe3bfe=_0x246950;_0x3b593e[_0xb88b('0x3a')]=_['keys'](db[_0xb88b('0x70')][_0xb88b('0x34')]);_0x3b593e[_0xb88b('0x38')]=_[_0xb88b('0x39')](_0x2f20d1['query']);_0x3b593e[_0xb88b('0x44')]=_['intersection'](_0x3b593e['model'],_0x3b593e[_0xb88b('0x38')]);_0x47eed8[_0xb88b('0x3b')]=_[_0xb88b('0x3c')](_0x3b593e[_0xb88b('0x3a')],qs[_0xb88b('0x3d')](_0x2f20d1[_0xb88b('0x38')][_0xb88b('0x3d')]));_0x47eed8[_0xb88b('0x3b')]=_0x47eed8[_0xb88b('0x3b')][_0xb88b('0x3e')]?_0x47eed8['attributes']:_0x3b593e[_0xb88b('0x3a')];_0x47eed8[_0xb88b('0x41')]=qs[_0xb88b('0x42')](_0x2f20d1[_0xb88b('0x38')][_0xb88b('0x42')]);_0x47eed8[_0xb88b('0x43')]=qs[_0xb88b('0x44')](_[_0xb88b('0x45')](_0x2f20d1[_0xb88b('0x38')],_0x3b593e[_0xb88b('0x44')]));_0x47eed8[_0xb88b('0x43')]=_[_0xb88b('0x47')](_0x47eed8[_0xb88b('0x43')],{'$or':[{'ListId':_0x246950['id']},{'ListId':null}]});if(_0x2f20d1['query'][_0xb88b('0x46')]){_0x47eed8[_0xb88b('0x43')]=_['merge'](_0x47eed8[_0xb88b('0x43')],{'$or':_[_0xb88b('0x32')](_0x47eed8[_0xb88b('0x3b')],function(_0x996ef){var _0xb75885={};_0xb75885[_0x996ef]={'$like':'%'+_0x2f20d1[_0xb88b('0x38')][_0xb88b('0x46')]+'%'};return _0xb75885;})});}_0x47eed8=_['merge']({},_0x47eed8,_0x2f20d1[_0xb88b('0x49')]);return db[_0xb88b('0x70')][_0xb88b('0x9b')](_0x47eed8);}})[_0xb88b('0x29')](respondWithResult(_0x3ef73e,null))['catch'](handleError(_0x3ef73e,null));};exports['getGlobalCustomFields']=function(_0x124eaa,_0x4102aa){return db[_0xb88b('0x70')]['findAndCountAll']({'where':{'ListId':null}})[_0xb88b('0x29')](handleEntityNotFound(_0x4102aa,null))['then'](function(_0x24fe57){return _0x24fe57;})[_0xb88b('0x29')](respondWithResult(_0x4102aa,null))['catch'](handleError(_0x4102aa,null));};exports['addAgents']=function(_0x122a5d,_0x4ae99e,_0x5f1ed5){return db[_0xb88b('0x33')][_0xb88b('0x4d')]({'where':{'id':_0x122a5d['params']['id']}})['then'](handleEntityNotFound(_0x4ae99e,null))[_0xb88b('0x29')](function(_0x1e9f98){if(_0x1e9f98){return _0x1e9f98['addAgents'](_0x122a5d[_0xb88b('0x50')][_0xb88b('0x62')],_['omit'](_0x122a5d['body'],[_0xb88b('0x62'),'id'])||{})[_0xb88b('0x9c')](function(_0x3ba685){for(var _0x558385=0x0;_0x558385<_0x122a5d[_0xb88b('0x50')][_0xb88b('0x62')][_0xb88b('0x3e')];_0x558385+=0x1){socket[_0xb88b('0x9d')](_0xb88b('0x9e'),{'UserId':Number(_0x122a5d[_0xb88b('0x50')][_0xb88b('0x62')][_0x558385]),'CmListId':Number(_0x122a5d[_0xb88b('0x4c')]['id'])});}return _0x3ba685;});}})['then'](respondWithResult(_0x4ae99e,null))[_0xb88b('0x4e')](handleError(_0x4ae99e,null));};exports[_0xb88b('0x9f')]=function(_0x238dc2,_0x18450a,_0x5e2be3){return db[_0xb88b('0x33')][_0xb88b('0x4d')]({'where':{'id':_0x238dc2['params']['id']}})[_0xb88b('0x29')](handleEntityNotFound(_0x18450a,null))['then'](function(_0x385d3d){if(_0x385d3d){return _0x385d3d[_0xb88b('0x9f')](_0x238dc2[_0xb88b('0x38')][_0xb88b('0x62')])[_0xb88b('0x29')](function(){if(_[_0xb88b('0x67')](_0x238dc2[_0xb88b('0x38')][_0xb88b('0x62')])){for(var _0x3d0fcd=0x0;_0x3d0fcd<_0x238dc2[_0xb88b('0x38')]['ids'][_0xb88b('0x3e')];_0x3d0fcd+=0x1){socket[_0xb88b('0x9d')](_0xb88b('0xa0'),{'UserId':Number(_0x238dc2['query'][_0xb88b('0x62')][_0x3d0fcd]),'CmListId':Number(_0x238dc2[_0xb88b('0x4c')]['id'])});}}else{socket[_0xb88b('0x9d')](_0xb88b('0xa0'),{'UserId':Number(_0x238dc2[_0xb88b('0x38')][_0xb88b('0x62')]),'CmListId':Number(_0x238dc2[_0xb88b('0x4c')]['id'])});}});}})[_0xb88b('0x29')](respondWithStatusCode(_0x18450a,null))[_0xb88b('0x4e')](handleError(_0x18450a,null));};exports[_0xb88b('0xa1')]=function(_0x2ae7f0,_0x3c6eec,_0x129826){var _0x3cdc1a={};var _0x7ede7b={};var _0x45e361;var _0x215a6d;return db[_0xb88b('0x33')][_0xb88b('0x5d')]({'where':{'id':_0x2ae7f0[_0xb88b('0x4c')]['id']}})[_0xb88b('0x29')](handleEntityNotFound(_0x3c6eec,null))[_0xb88b('0x29')](function(_0xdd1346){if(_0xdd1346){_0x45e361=_0xdd1346;_0x7ede7b[_0xb88b('0x3a')]=_[_0xb88b('0x39')](db['User'][_0xb88b('0x34')]);_0x7ede7b[_0xb88b('0x38')]=_[_0xb88b('0x39')](_0x2ae7f0['query']);_0x7ede7b[_0xb88b('0x44')]=_[_0xb88b('0x3c')](_0x7ede7b['model'],_0x7ede7b[_0xb88b('0x38')]);_0x3cdc1a['attributes']=_[_0xb88b('0x3c')](_0x7ede7b['model'],qs['fields'](_0x2ae7f0[_0xb88b('0x38')]['fields']));_0x3cdc1a['attributes']=_0x3cdc1a[_0xb88b('0x3b')][_0xb88b('0x3e')]?_0x3cdc1a['attributes']:_0x7ede7b['model'];_0x3cdc1a['order']=qs[_0xb88b('0x42')](_0x2ae7f0['query'][_0xb88b('0x42')]);_0x3cdc1a['where']=qs[_0xb88b('0x44')](_['pick'](_0x2ae7f0[_0xb88b('0x38')],_0x7ede7b[_0xb88b('0x44')]));if(_0x2ae7f0[_0xb88b('0x38')]['filter']){_0x3cdc1a[_0xb88b('0x43')]=_[_0xb88b('0x47')](_0x3cdc1a[_0xb88b('0x43')],{'$or':_[_0xb88b('0x32')](_0x3cdc1a[_0xb88b('0x3b')],function(_0x1395d8){var _0xe85157={};_0xe85157[_0x1395d8]={'$like':'%'+_0x2ae7f0['query'][_0xb88b('0x46')]+'%'};return _0xe85157;})});}_0x3cdc1a=_[_0xb88b('0x47')]({},_0x3cdc1a,_0x2ae7f0[_0xb88b('0x49')]);return _0x45e361[_0xb88b('0xa1')](_0x3cdc1a);}})[_0xb88b('0x29')](function(_0x34777b){if(_0x34777b){_0x215a6d=_0x34777b[_0xb88b('0x3e')];if(!_0x2ae7f0[_0xb88b('0x38')][_0xb88b('0x3f')](_0xb88b('0x40'))){_0x3cdc1a['limit']=qs[_0xb88b('0x21')](_0x2ae7f0[_0xb88b('0x38')][_0xb88b('0x21')]);_0x3cdc1a[_0xb88b('0x23')]=qs[_0xb88b('0x23')](_0x2ae7f0[_0xb88b('0x38')][_0xb88b('0x23')]);}return _0x45e361[_0xb88b('0xa1')](_0x3cdc1a);}})[_0xb88b('0x29')](function(_0x29938b){if(_0x29938b){return _0x29938b?{'count':_0x215a6d,'rows':_0x29938b}:null;}})[_0xb88b('0x29')](respondWithResult(_0x3c6eec,null))[_0xb88b('0x4e')](handleError(_0x3c6eec,null));};function handleQuery(_0x352d09){logger[_0xb88b('0xa2')](_0x352d09);return db['sequelize'][_0xb88b('0x38')](_0x352d09)['spread'](function(_0xf3366b){csv_results['push'](_0xf3366b);})[_0xb88b('0x4e')](function(_0x5d94f4){logger[_0xb88b('0x58')](_0x5d94f4[_0xb88b('0x6d')]);});} \ No newline at end of file +var _0xb8c2=['stack','CmList','rawAttributes','fieldName','type','key','map','name','keys','filters','intersection','model','query','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','merge','VIRTUAL','filter','show','params','options','find','catch','create','body','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','addDisposition','ListId','getDispositions','findOne','Disposition','includeAll','include','findAll','removeDispositions','tags','isArray','each','omit','ids','success','push','dataValues','errors','message','Malformed\x20request\x20syntax','CmCustomField','CmContact','CustomFields','format','getContacts','ContactItemType','alias','from','cm_contacts','c.ListId\x20=\x20?','c.deletedAt\x20is\x20null','distinct','field','c.cf_','customField_','select','item','cm_contact_has_items','ItemTypeId\x20=\x20?','CmContactId\x20=\x20c.id','additionalPhone_','description','description_additionalPhone_','toString','now','writeFileSync','/tmp/list_%d_%s.csv','setHeader','Content-disposition','attachment;\x20filename=','Content-type','sequelize','transaction','addCustomFields','Sequelize','text','TEXT','number','INTEGER','switch','BOOLEAN','defaultValue','queryInterface','cf_%s','getCustomFields','findAndCountAll','getGlobalCustomFields','addAgents','spread','emit','userCmList:save','userCmList:remove','getAgents','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./cmList.socket','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','save','then','get','Lists','destroy'];(function(_0x209a17,_0x5520ab){var _0x2104d6=function(_0x2572f9){while(--_0x2572f9){_0x209a17['push'](_0x209a17['shift']());}};_0x2104d6(++_0x5520ab);}(_0xb8c2,0x1b1));var _0x2b8c=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xb8c2[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require(_0x2b8c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x2b8c('0x1'));var jsonpatch=require(_0x2b8c('0x2'));var rp=require(_0x2b8c('0x3'));var moment=require(_0x2b8c('0x4'));var BPromise=require(_0x2b8c('0x5'));var Mustache=require('mustache');var util=require(_0x2b8c('0x6'));var path=require(_0x2b8c('0x7'));var sox=require(_0x2b8c('0x8'));var csv=require(_0x2b8c('0x9'));var ejs=require(_0x2b8c('0xa'));var fs=require('fs');var fs_extra=require(_0x2b8c('0xb'));var _=require(_0x2b8c('0xc'));var squel=require(_0x2b8c('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x2b8c('0xe'));var toCsv=require(_0x2b8c('0x9'));var querystring=require(_0x2b8c('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x2b8c('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2b8c('0x11'));var logger=require(_0x2b8c('0x12'))(_0x2b8c('0x13'));var utils=require(_0x2b8c('0x14'));var config=require(_0x2b8c('0x15'));var licenseUtil=require(_0x2b8c('0x16'));var db=require('../../mysqldb')['db'];var csv_results;config[_0x2b8c('0x17')]=_[_0x2b8c('0x18')](config[_0x2b8c('0x17')],{'host':_0x2b8c('0x19'),'port':0x18eb});var socket=require(_0x2b8c('0x1a'))(new Redis(config[_0x2b8c('0x17')]));require(_0x2b8c('0x1b'))['register'](socket);function respondWithStatusCode(_0x175db3,_0x1f97a8){_0x1f97a8=_0x1f97a8||0xcc;return function(_0x2e7b4b){if(_0x2e7b4b){return _0x175db3[_0x2b8c('0x1c')](_0x1f97a8);}return _0x175db3[_0x2b8c('0x1d')](_0x1f97a8)[_0x2b8c('0x1e')]();};}function respondWithResult(_0x34e470,_0x215e1b){_0x215e1b=_0x215e1b||0xc8;return function(_0x224515){if(_0x224515){return _0x34e470['status'](_0x215e1b)[_0x2b8c('0x1f')](_0x224515);}};}function respondWithFilteredResult(_0x55a426,_0x5db4e6){return function(_0x15d9b4){if(_0x15d9b4){var _0x37c813=typeof _0x5db4e6[_0x2b8c('0x20')]===_0x2b8c('0x21')&&typeof _0x5db4e6['limit']==='undefined';var _0x4ec08f=_0x15d9b4[_0x2b8c('0x22')];var _0xa76b0a=_0x37c813?0x0:_0x5db4e6[_0x2b8c('0x20')];var _0x17b090=_0x37c813?_0x15d9b4[_0x2b8c('0x22')]:_0x5db4e6[_0x2b8c('0x20')]+_0x5db4e6['limit'];var _0x3feee5;if(_0x17b090>=_0x4ec08f){_0x17b090=_0x4ec08f;_0x3feee5=0xc8;}else{_0x3feee5=0xce;}_0x55a426['status'](_0x3feee5);return _0x55a426[_0x2b8c('0x23')](_0x2b8c('0x24'),_0xa76b0a+'-'+_0x17b090+'/'+_0x4ec08f)['json'](_0x15d9b4);}return null;};}function patchUpdates(_0x499a79){return function(_0x1e90f1){try{jsonpatch[_0x2b8c('0x25')](_0x1e90f1,_0x499a79,!![]);}catch(_0x16cd94){return BPromise[_0x2b8c('0x26')](_0x16cd94);}return _0x1e90f1[_0x2b8c('0x27')]();};}function saveUpdates(_0x1a6825,_0x5d144d){return function(_0x5b410c){if(_0x5b410c){return _0x5b410c['update'](_0x1a6825)[_0x2b8c('0x28')](function(_0x113111){return _0x113111;});}return null;};}function removeEntity(_0x9ba54b,_0x3a7a9b){return function(_0x13fec2){if(_0x13fec2){return _0x13fec2['destroy']()[_0x2b8c('0x28')](function(){var _0x52046e=_0x13fec2[_0x2b8c('0x29')]({'plain':!![]});var _0x1fb026=_0x2b8c('0x2a');return db['UserProfileResource'][_0x2b8c('0x2b')]({'where':{'type':_0x1fb026,'resourceId':_0x52046e['id']}})['then'](function(){return _0x13fec2;});})[_0x2b8c('0x28')](function(){_0x9ba54b[_0x2b8c('0x1d')](0xcc)[_0x2b8c('0x1e')]();});}};}function handleEntityNotFound(_0x3d0b98,_0x48903f){return function(_0x2b377e){if(!_0x2b377e){_0x3d0b98['sendStatus'](0x194);}return _0x2b377e;};}function handleError(_0xbc2640,_0x39af79){_0x39af79=_0x39af79||0x1f4;return function(_0x7bf4d8){logger['error'](_0x7bf4d8[_0x2b8c('0x2c')]);if(_0x7bf4d8['name']){delete _0x7bf4d8['name'];}_0xbc2640[_0x2b8c('0x1d')](_0x39af79)['send'](_0x7bf4d8);};}exports['index']=function(_0x3ed245,_0xc4007a){var _0x849ae3={},_0x223036={},_0x1bb0eb={'count':0x0,'rows':[]};var _0x12428b=_['map'](db[_0x2b8c('0x2d')][_0x2b8c('0x2e')],function(_0x25a83a){return{'name':_0x25a83a[_0x2b8c('0x2f')],'type':_0x25a83a[_0x2b8c('0x30')][_0x2b8c('0x31')]};});_0x223036['model']=_[_0x2b8c('0x32')](_0x12428b,_0x2b8c('0x33'));_0x223036['query']=_[_0x2b8c('0x34')](_0x3ed245['query']);_0x223036[_0x2b8c('0x35')]=_[_0x2b8c('0x36')](_0x223036[_0x2b8c('0x37')],_0x223036[_0x2b8c('0x38')]);_0x849ae3[_0x2b8c('0x39')]=_[_0x2b8c('0x36')](_0x223036[_0x2b8c('0x37')],qs[_0x2b8c('0x3a')](_0x3ed245[_0x2b8c('0x38')][_0x2b8c('0x3a')]));_0x849ae3[_0x2b8c('0x39')]=_0x849ae3[_0x2b8c('0x39')][_0x2b8c('0x3b')]?_0x849ae3['attributes']:_0x223036[_0x2b8c('0x37')];if(!_0x3ed245[_0x2b8c('0x38')][_0x2b8c('0x3c')](_0x2b8c('0x3d'))){_0x849ae3[_0x2b8c('0x3e')]=qs[_0x2b8c('0x3e')](_0x3ed245[_0x2b8c('0x38')]['limit']);_0x849ae3['offset']=qs['offset'](_0x3ed245['query'][_0x2b8c('0x20')]);}_0x849ae3[_0x2b8c('0x3f')]=qs[_0x2b8c('0x40')](_0x3ed245[_0x2b8c('0x38')]['sort']);_0x849ae3[_0x2b8c('0x41')]=qs[_0x2b8c('0x35')](_[_0x2b8c('0x42')](_0x3ed245['query'],_0x223036['filters']),_0x12428b);if(_0x3ed245[_0x2b8c('0x38')]['filter']){_0x849ae3['where']=_[_0x2b8c('0x43')](_0x849ae3[_0x2b8c('0x41')],{'$or':_['map'](_0x12428b,function(_0xfb8f93){if(_0xfb8f93[_0x2b8c('0x30')]!==_0x2b8c('0x44')){var _0x1a1846={};_0x1a1846[_0xfb8f93[_0x2b8c('0x33')]]={'$like':'%'+_0x3ed245[_0x2b8c('0x38')][_0x2b8c('0x45')]+'%'};return _0x1a1846;}})});}_0x849ae3=_[_0x2b8c('0x43')]({},_0x849ae3,_0x3ed245['options']);var _0x3e2af3={'where':_0x849ae3[_0x2b8c('0x41')]};return db[_0x2b8c('0x2d')][_0x2b8c('0x22')](_0x3e2af3)[_0x2b8c('0x28')](function(_0x22b298){_0x1bb0eb[_0x2b8c('0x22')]=_0x22b298;if(_0x3ed245[_0x2b8c('0x38')]['includeAll']){_0x849ae3['include']=[{'all':!![]}];}return db[_0x2b8c('0x2d')]['findAll'](_0x849ae3);})[_0x2b8c('0x28')](function(_0xfa5383){_0x1bb0eb['rows']=_0xfa5383;return _0x1bb0eb;})[_0x2b8c('0x28')](respondWithFilteredResult(_0xc4007a,_0x849ae3))['catch'](handleError(_0xc4007a,null));};exports[_0x2b8c('0x46')]=function(_0x5bcc04,_0x1c5c4d){var _0x565693={'raw':![],'where':{'id':_0x5bcc04[_0x2b8c('0x47')]['id']}},_0x2263d5={};_0x2263d5['model']=_[_0x2b8c('0x34')](db[_0x2b8c('0x2d')][_0x2b8c('0x2e')]);_0x2263d5[_0x2b8c('0x38')]=_[_0x2b8c('0x34')](_0x5bcc04[_0x2b8c('0x38')]);_0x2263d5[_0x2b8c('0x35')]=_[_0x2b8c('0x36')](_0x2263d5['model'],_0x2263d5[_0x2b8c('0x38')]);_0x565693['attributes']=_[_0x2b8c('0x36')](_0x2263d5[_0x2b8c('0x37')],qs[_0x2b8c('0x3a')](_0x5bcc04[_0x2b8c('0x38')][_0x2b8c('0x3a')]));_0x565693[_0x2b8c('0x39')]=_0x565693['attributes'][_0x2b8c('0x3b')]?_0x565693[_0x2b8c('0x39')]:_0x2263d5[_0x2b8c('0x37')];if(_0x5bcc04['query']['includeAll']){_0x565693['include']=[{'all':!![]}];}_0x565693=_[_0x2b8c('0x43')]({},_0x565693,_0x5bcc04[_0x2b8c('0x48')]);return db[_0x2b8c('0x2d')][_0x2b8c('0x49')](_0x565693)['then'](handleEntityNotFound(_0x1c5c4d,null))[_0x2b8c('0x28')](respondWithResult(_0x1c5c4d,null))[_0x2b8c('0x4a')](handleError(_0x1c5c4d,null));};exports['create']=function(_0x2868a0,_0x122176){return db[_0x2b8c('0x2d')][_0x2b8c('0x4b')](_0x2868a0[_0x2b8c('0x4c')],{})['then'](function(_0x55ed03){var _0x3f4f8a=_0x2868a0['user'][_0x2b8c('0x29')]({'plain':!![]});if(!_0x3f4f8a)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3f4f8a['role']===_0x2b8c('0x4d')){var _0x4d20e5=_0x55ed03[_0x2b8c('0x29')]({'plain':!![]});var _0x366455=_0x2b8c('0x2a');return db[_0x2b8c('0x4e')][_0x2b8c('0x49')]({'where':{'name':_0x366455,'userProfileId':_0x3f4f8a[_0x2b8c('0x4f')]},'raw':!![]})[_0x2b8c('0x28')](function(_0x1b79fa){if(_0x1b79fa&&_0x1b79fa[_0x2b8c('0x50')]===0x0){return db[_0x2b8c('0x51')][_0x2b8c('0x4b')]({'name':_0x4d20e5[_0x2b8c('0x33')],'resourceId':_0x4d20e5['id'],'type':_0x1b79fa['name'],'sectionId':_0x1b79fa['id']},{})[_0x2b8c('0x28')](function(){return _0x55ed03;});}else{return _0x55ed03;}})[_0x2b8c('0x4a')](function(_0x3e3099){logger[_0x2b8c('0x52')](_0x2b8c('0x53'),_0x3e3099);throw _0x3e3099;});}return _0x55ed03;})[_0x2b8c('0x28')](respondWithResult(_0x122176,0xc9))['catch'](handleError(_0x122176,null));};exports[_0x2b8c('0x54')]=function(_0x1a1ed7,_0x7e2673){if(_0x1a1ed7[_0x2b8c('0x4c')]['id']){delete _0x1a1ed7[_0x2b8c('0x4c')]['id'];}return db[_0x2b8c('0x2d')][_0x2b8c('0x49')]({'where':{'id':_0x1a1ed7[_0x2b8c('0x47')]['id']}})[_0x2b8c('0x28')](handleEntityNotFound(_0x7e2673,null))[_0x2b8c('0x28')](saveUpdates(_0x1a1ed7[_0x2b8c('0x4c')],null))[_0x2b8c('0x28')](respondWithResult(_0x7e2673,null))['catch'](handleError(_0x7e2673,null));};exports[_0x2b8c('0x2b')]=function(_0x1d68d6,_0x5461ea){return db['CmList'][_0x2b8c('0x49')]({'where':{'id':_0x1d68d6[_0x2b8c('0x47')]['id']}})[_0x2b8c('0x28')](handleEntityNotFound(_0x5461ea,null))['then'](removeEntity(_0x5461ea,null))['catch'](handleError(_0x5461ea,null));};exports[_0x2b8c('0x55')]=function(_0x5d8ba6,_0x14c94e){return db['CmList'][_0x2b8c('0x55')]()[_0x2b8c('0x28')](respondWithResult(_0x14c94e,null))['catch'](handleError(_0x14c94e,null));};exports[_0x2b8c('0x56')]=function(_0x13d7d2,_0x35346a,_0x39e17b){if(_0x13d7d2['body']['id']){delete _0x13d7d2[_0x2b8c('0x4c')]['id'];}return db[_0x2b8c('0x2d')][_0x2b8c('0x49')]({'where':{'id':_0x13d7d2[_0x2b8c('0x47')]['id']}})[_0x2b8c('0x28')](handleEntityNotFound(_0x35346a,null))['then'](function(_0xa944f5){if(_0xa944f5){_0x13d7d2[_0x2b8c('0x4c')][_0x2b8c('0x57')]=_0xa944f5['id'];return db['Disposition'][_0x2b8c('0x4b')](_0x13d7d2[_0x2b8c('0x4c')]);}})[_0x2b8c('0x28')](respondWithResult(_0x35346a,null))[_0x2b8c('0x4a')](handleError(_0x35346a,null));};exports[_0x2b8c('0x58')]=function(_0x24734e,_0x106c00,_0xe07959){var _0x3b5a69={'raw':![],'where':{}};var _0x1e1ba4={};var _0x889e4b={'count':0x0,'rows':[]};return db[_0x2b8c('0x2d')][_0x2b8c('0x59')]({'where':{'id':_0x24734e[_0x2b8c('0x47')]['id']}})[_0x2b8c('0x28')](handleEntityNotFound(_0x106c00,null))[_0x2b8c('0x28')](function(_0x595e60){if(_0x595e60){_0x1e1ba4[_0x2b8c('0x37')]=_[_0x2b8c('0x34')](db[_0x2b8c('0x5a')][_0x2b8c('0x2e')]);_0x1e1ba4['query']=_[_0x2b8c('0x34')](_0x24734e['query']);_0x1e1ba4['filters']=_[_0x2b8c('0x36')](_0x1e1ba4[_0x2b8c('0x37')],_0x1e1ba4[_0x2b8c('0x38')]);_0x3b5a69[_0x2b8c('0x39')]=_[_0x2b8c('0x36')](_0x1e1ba4['model'],qs['fields'](_0x24734e[_0x2b8c('0x38')][_0x2b8c('0x3a')]));_0x3b5a69['attributes']=_0x3b5a69[_0x2b8c('0x39')][_0x2b8c('0x3b')]?_0x3b5a69[_0x2b8c('0x39')]:_0x1e1ba4[_0x2b8c('0x37')];if(!_0x24734e[_0x2b8c('0x38')][_0x2b8c('0x3c')](_0x2b8c('0x3d'))){_0x3b5a69['limit']=qs['limit'](_0x24734e[_0x2b8c('0x38')][_0x2b8c('0x3e')]);_0x3b5a69[_0x2b8c('0x20')]=qs[_0x2b8c('0x20')](_0x24734e['query'][_0x2b8c('0x20')]);}_0x3b5a69['order']=qs['sort'](_0x24734e[_0x2b8c('0x38')][_0x2b8c('0x40')]);_0x3b5a69[_0x2b8c('0x41')]=qs[_0x2b8c('0x35')](_[_0x2b8c('0x42')](_0x24734e['query'],_0x1e1ba4['filters']));_0x3b5a69[_0x2b8c('0x41')]['ListId']=_0x595e60['id'];if(_0x24734e[_0x2b8c('0x38')][_0x2b8c('0x45')]){_0x3b5a69[_0x2b8c('0x41')]=_[_0x2b8c('0x43')](_0x3b5a69['where'],{'$or':_[_0x2b8c('0x32')](_0x3b5a69[_0x2b8c('0x39')],function(_0x3e2783){var _0x4f4794={};_0x4f4794[_0x3e2783]={'$like':'%'+_0x24734e['query'][_0x2b8c('0x45')]+'%'};return _0x4f4794;})});}_0x3b5a69=_[_0x2b8c('0x43')]({},_0x3b5a69,_0x24734e[_0x2b8c('0x48')]);return db[_0x2b8c('0x5a')][_0x2b8c('0x22')]({'where':_0x3b5a69[_0x2b8c('0x41')]})[_0x2b8c('0x28')](function(_0x528709){_0x889e4b[_0x2b8c('0x22')]=_0x528709;if(_0x24734e[_0x2b8c('0x38')][_0x2b8c('0x5b')]){_0x3b5a69[_0x2b8c('0x5c')]=[{'all':!![]}];}return db[_0x2b8c('0x5a')][_0x2b8c('0x5d')](_0x3b5a69);})[_0x2b8c('0x28')](function(_0x49e980){_0x889e4b['rows']=_0x49e980;return _0x889e4b;});}})[_0x2b8c('0x28')](respondWithFilteredResult(_0x106c00,_0x3b5a69))[_0x2b8c('0x4a')](handleError(_0x106c00,null));};exports[_0x2b8c('0x5e')]=function(_0x18b87c,_0x43f483,_0x51adba){return db['CmList'][_0x2b8c('0x49')]({'where':{'id':_0x18b87c[_0x2b8c('0x47')]['id']}})[_0x2b8c('0x28')](handleEntityNotFound(_0x43f483,null))[_0x2b8c('0x28')](function(_0x2a5619){if(_0x2a5619){return _0x2a5619[_0x2b8c('0x5e')](_0x18b87c['query']['ids']);}})[_0x2b8c('0x28')](respondWithStatusCode(_0x43f483,null))[_0x2b8c('0x4a')](handleError(_0x43f483,null));};exports['addContacts']=function(_0x110812,_0x370c25,_0xb09313){return db['CmList'][_0x2b8c('0x49')]({'where':{'id':_0x110812['params']['id']}})[_0x2b8c('0x28')](handleEntityNotFound(_0x370c25,null))[_0x2b8c('0x28')](function(_0x350246){if(_0x350246){var _0x536f16=[];var _0x280936={'success':[],'errors':[]};return db['CmContact'][_0x2b8c('0x55')]()[_0x2b8c('0x28')](function(_0x18c46c){if(_0x110812[_0x2b8c('0x4c')][_0x2b8c('0x5f')]&&_[_0x2b8c('0x60')](_0x110812[_0x2b8c('0x4c')][_0x2b8c('0x5f')])){if(_0x110812[_0x2b8c('0x4c')][_0x2b8c('0x5f')][_0x2b8c('0x3b')]){_0x110812[_0x2b8c('0x4c')][_0x2b8c('0x5f')]=_0x110812['body']['tags']['join'](';')+';';}else{_0x110812[_0x2b8c('0x4c')][_0x2b8c('0x5f')]=null;}}else{_0x110812[_0x2b8c('0x4c')]['tags']=null;}if(_0x110812[_0x2b8c('0x4c')]&&_[_0x2b8c('0x60')](_0x110812[_0x2b8c('0x4c')])){for(var _0x560087=0x0;_0x560087<_0x110812['body'][_0x2b8c('0x3b')];_0x560087+=0x1){_0x110812[_0x2b8c('0x4c')][_0x560087][_0x2b8c('0x57')]=_0x110812[_0x2b8c('0x47')]['id'];_0x536f16['push'](_0x110812[_0x2b8c('0x4c')][_0x560087]);}return BPromise[_0x2b8c('0x61')](_0x536f16,function(_0x527515){return db['CmContact'][_0x2b8c('0x4b')](_[_0x2b8c('0x62')](_0x527515,[_0x2b8c('0x63'),'id'])||{},{'fields':_[_0x2b8c('0x34')](_0x18c46c),'raw':!![]})[_0x2b8c('0x28')](function(_0x13f3b0){_0x280936[_0x2b8c('0x64')][_0x2b8c('0x65')](_0x13f3b0[_0x2b8c('0x66')]);})[_0x2b8c('0x4a')](function(_0x20c692){_0x280936[_0x2b8c('0x67')][_0x2b8c('0x65')]({'data':_0x527515,'error':_0x20c692[_0x2b8c('0x68')]});});})[_0x2b8c('0x28')](function(_0x243f53){return _0x280936;})[_0x2b8c('0x4a')](function(_0x44542b){return _0x44542b;});}else{_0x370c25[_0x2b8c('0x1d')](0x190)[_0x2b8c('0x1f')]({'message':_0x2b8c('0x69')});}});}})[_0x2b8c('0x28')](respondWithResult(_0x370c25,null))['catch'](handleError(_0x370c25,null));};exports['getContacts']=function(_0x968e68,_0x23a217,_0x36fa2b){var _0x30fe31;return db['CmList']['find']({'where':{'id':_0x968e68['params']['id']},'include':[{'model':db[_0x2b8c('0x6a')],'as':'CustomFields'}]})[_0x2b8c('0x28')](handleEntityNotFound(_0x23a217,null))[_0x2b8c('0x28')](function(_0x4b5a98){if(_0x4b5a98){_0x30fe31=_0x4b5a98;return db[_0x2b8c('0x6b')][_0x2b8c('0x2e')];}})['then'](function(_0x41d8fc){if(_0x41d8fc){var _0x4f0140={};var _0x1089e7={};_0x1089e7['model']=_['concat'](_['keys'](_0x41d8fc),_[_0x2b8c('0x32')](_0x30fe31[_0x2b8c('0x6c')],function(_0x43967e){return util[_0x2b8c('0x6d')]('cf_%d',_0x43967e['id']);}));_0x1089e7[_0x2b8c('0x38')]=_[_0x2b8c('0x34')](_0x968e68[_0x2b8c('0x38')]);_0x1089e7[_0x2b8c('0x35')]=_[_0x2b8c('0x36')](_0x1089e7[_0x2b8c('0x37')],_0x1089e7[_0x2b8c('0x38')]);_0x4f0140['attributes']=_[_0x2b8c('0x36')](_0x1089e7[_0x2b8c('0x37')],qs[_0x2b8c('0x3a')](_0x968e68['query']['fields']));_0x4f0140[_0x2b8c('0x39')]=_0x4f0140[_0x2b8c('0x39')][_0x2b8c('0x3b')]?_0x4f0140[_0x2b8c('0x39')]:_0x1089e7[_0x2b8c('0x37')];if(!_0x968e68['query']['hasOwnProperty'](_0x2b8c('0x3d'))){_0x4f0140[_0x2b8c('0x3e')]=qs[_0x2b8c('0x3e')](_0x968e68[_0x2b8c('0x38')][_0x2b8c('0x3e')]);_0x4f0140[_0x2b8c('0x20')]=qs[_0x2b8c('0x20')](_0x968e68[_0x2b8c('0x38')][_0x2b8c('0x20')]);}_0x4f0140['order']=qs[_0x2b8c('0x40')](_0x968e68[_0x2b8c('0x38')][_0x2b8c('0x40')]);_0x4f0140[_0x2b8c('0x41')]=qs['filters'](_[_0x2b8c('0x42')](_0x968e68[_0x2b8c('0x38')],_0x1089e7[_0x2b8c('0x35')]));_0x4f0140['raw']=!![];if(_0x968e68[_0x2b8c('0x38')]['filter']){_0x4f0140[_0x2b8c('0x41')]=_[_0x2b8c('0x43')](_0x4f0140[_0x2b8c('0x41')],{'$or':_[_0x2b8c('0x32')](_0x4f0140[_0x2b8c('0x39')],function(_0xc067d9){var _0x48e084={};_0x48e084[_0xc067d9]={'$like':'%'+_0x968e68[_0x2b8c('0x38')]['filter']+'%'};return _0x48e084;})});}_0x4f0140=_[_0x2b8c('0x43')]({},_0x4f0140,_0x968e68[_0x2b8c('0x48')]);return _0x30fe31[_0x2b8c('0x6e')](_0x4f0140);}})[_0x2b8c('0x28')](respondWithResult(_0x23a217,null))[_0x2b8c('0x4a')](handleError(_0x23a217,null));};exports['getContactsCsv']=function(_0x1e0e56,_0x18b415,_0x1ad2fd){var _0x5d8617;var _0x30be0e;var _0x33084a;var _0x5236ff=_0x1e0e56[_0x2b8c('0x47')]['id'];csv_results=[];return db[_0x2b8c('0x6f')][_0x2b8c('0x5d')]({'attributes':['id',_0x2b8c('0x33')],'raw':!![],'order':['OrderBy']})['then'](function(_0x19931d){_0x5d8617=_0x19931d;var _0x4fcfea=_['keys'](db[_0x2b8c('0x6b')][_0x2b8c('0x2e')]);return db[_0x2b8c('0x6a')][_0x2b8c('0x5d')]({'raw':!![],'attributes':['id',_0x2b8c('0x70')]})[_0x2b8c('0x28')](function(_0x41d0ed){_0x30be0e=_0x41d0ed;var _0x293234=squel['select']()['fields'](_0x4fcfea)[_0x2b8c('0x71')](_0x2b8c('0x72'),'c')[_0x2b8c('0x41')](_0x2b8c('0x73'),_0x5236ff)['where'](_0x2b8c('0x74'))[_0x2b8c('0x75')]();for(var _0x277bce=0x0;_0x277bce<_0x30be0e[_0x2b8c('0x3b')];_0x277bce++){_0x293234[_0x2b8c('0x76')](_0x2b8c('0x77')+_0x30be0e[_0x277bce]['id'],_0x2b8c('0x78')+_0x30be0e[_0x277bce][_0x2b8c('0x70')]);}for(var _0x277bce=0x0;_0x277bce<_0x5d8617[_0x2b8c('0x3b')];_0x277bce++){_0x293234[_0x2b8c('0x76')](squel[_0x2b8c('0x79')]()[_0x2b8c('0x76')](_0x2b8c('0x7a'))[_0x2b8c('0x71')](_0x2b8c('0x7b'))[_0x2b8c('0x41')](_0x2b8c('0x7c'),_0x5d8617[_0x277bce]['id'])['where'](_0x2b8c('0x7d')),_0x2b8c('0x7e')+_0x5d8617[_0x277bce]['name']);_0x293234[_0x2b8c('0x76')](squel[_0x2b8c('0x79')]()['field'](_0x2b8c('0x7f'))['from'](_0x2b8c('0x7b'))[_0x2b8c('0x41')](_0x2b8c('0x7c'),_0x5d8617[_0x277bce]['id'])[_0x2b8c('0x41')](_0x2b8c('0x7d')),_0x2b8c('0x80')+_0x5d8617[_0x277bce][_0x2b8c('0x33')]);}var _0xece6b=[];_0xece6b[_0x2b8c('0x65')](_0x293234[_0x2b8c('0x81')]());BPromise[_0x2b8c('0x61')](_0xece6b,handleQuery)['then'](function(_0x422864){handleQuery(_0x293234[_0x2b8c('0x81')]());var _0x9e1501=csv_results[0x0];if(!_['isEmpty'](_0x9e1501)){var _0x200a1f=toCsv(_0x9e1501);var _0x5dea8f=Date[_0x2b8c('0x82')]();fs[_0x2b8c('0x83')](util['format'](_0x2b8c('0x84'),_0x5236ff,_0x5dea8f),_0x200a1f);_0x18b415[_0x2b8c('0x85')](_0x2b8c('0x86'),_0x2b8c('0x87')+util[_0x2b8c('0x6d')]('list_%d_%s.csv',_0x5236ff,_0x5dea8f));_0x18b415[_0x2b8c('0x85')](_0x2b8c('0x88'),'text/csv');return _0x18b415['download'](util[_0x2b8c('0x6d')]('/tmp/list_%d_%s.csv',_0x5236ff,_0x5dea8f));}else{return _0x18b415['sendStatus'](0xcc);}});});});};exports['addCustomField']=function(_0x3954e7,_0x26fbb6,_0x3ee2b0){var _0x4b946a;delete _0x3954e7[_0x2b8c('0x4c')]['id'];return db[_0x2b8c('0x2d')][_0x2b8c('0x59')]({'where':{'id':_0x3954e7[_0x2b8c('0x47')]['id']}})[_0x2b8c('0x28')](handleEntityNotFound(_0x26fbb6,null))[_0x2b8c('0x28')](function(_0x4dc35d){if(_0x4dc35d){return db[_0x2b8c('0x89')][_0x2b8c('0x8a')](function(_0x2d7909){return db[_0x2b8c('0x6a')][_0x2b8c('0x4b')](_0x3954e7['body'],{'transaction':_0x2d7909})['then'](function(_0x2162f8){_0x4b946a=_0x2162f8;return _0x4dc35d[_0x2b8c('0x8b')](_0x2162f8,{'transaction':_0x2d7909});})[_0x2b8c('0x28')](function(){var _0x4de4f3={'type':db[_0x2b8c('0x8c')]['TEXT'],'transaction':_0x2d7909};switch(_0x3954e7[_0x2b8c('0x4c')][_0x2b8c('0x30')]){case _0x2b8c('0x8d'):_0x4de4f3[_0x2b8c('0x30')]=db['Sequelize'][_0x2b8c('0x8e')];break;case _0x2b8c('0x8f'):_0x4de4f3[_0x2b8c('0x30')]=db[_0x2b8c('0x8c')][_0x2b8c('0x90')];break;case _0x2b8c('0x91'):_0x4de4f3['type']=db[_0x2b8c('0x8c')][_0x2b8c('0x92')];_0x4de4f3[_0x2b8c('0x93')]=![];break;default:}return db[_0x2b8c('0x89')][_0x2b8c('0x94')]['addColumn'](_0x2b8c('0x72'),util[_0x2b8c('0x6d')](_0x2b8c('0x95'),_0x4b946a['id']),_0x4de4f3);})[_0x2b8c('0x28')](function(){return _0x4b946a;});});}})['then'](respondWithResult(_0x26fbb6,null))[_0x2b8c('0x4a')](handleError(_0x26fbb6,null));};exports[_0x2b8c('0x96')]=function(_0x30b18a,_0x56b722,_0x58ce89){var _0x3a8d19={};var _0x54cfe4={};var _0x2458be;var _0x1482ae;return db[_0x2b8c('0x2d')][_0x2b8c('0x59')]({'where':{'id':_0x30b18a[_0x2b8c('0x47')]['id']}})[_0x2b8c('0x28')](handleEntityNotFound(_0x56b722,null))['then'](function(_0xfbc7e){if(_0xfbc7e){_0x2458be=_0xfbc7e;_0x54cfe4[_0x2b8c('0x37')]=_[_0x2b8c('0x34')](db[_0x2b8c('0x6a')][_0x2b8c('0x2e')]);_0x54cfe4[_0x2b8c('0x38')]=_[_0x2b8c('0x34')](_0x30b18a[_0x2b8c('0x38')]);_0x54cfe4[_0x2b8c('0x35')]=_['intersection'](_0x54cfe4[_0x2b8c('0x37')],_0x54cfe4[_0x2b8c('0x38')]);_0x3a8d19[_0x2b8c('0x39')]=_['intersection'](_0x54cfe4[_0x2b8c('0x37')],qs[_0x2b8c('0x3a')](_0x30b18a[_0x2b8c('0x38')][_0x2b8c('0x3a')]));_0x3a8d19[_0x2b8c('0x39')]=_0x3a8d19[_0x2b8c('0x39')][_0x2b8c('0x3b')]?_0x3a8d19[_0x2b8c('0x39')]:_0x54cfe4[_0x2b8c('0x37')];_0x3a8d19[_0x2b8c('0x3f')]=qs[_0x2b8c('0x40')](_0x30b18a[_0x2b8c('0x38')][_0x2b8c('0x40')]);_0x3a8d19[_0x2b8c('0x41')]=qs[_0x2b8c('0x35')](_[_0x2b8c('0x42')](_0x30b18a['query'],_0x54cfe4['filters']));_0x3a8d19[_0x2b8c('0x41')]=_[_0x2b8c('0x43')](_0x3a8d19[_0x2b8c('0x41')],{'$or':[{'ListId':_0xfbc7e['id']},{'ListId':null}]});if(_0x30b18a[_0x2b8c('0x38')]['filter']){_0x3a8d19[_0x2b8c('0x41')]=_[_0x2b8c('0x43')](_0x3a8d19[_0x2b8c('0x41')],{'$or':_[_0x2b8c('0x32')](_0x3a8d19[_0x2b8c('0x39')],function(_0x17a0b4){var _0x4b108e={};_0x4b108e[_0x17a0b4]={'$like':'%'+_0x30b18a[_0x2b8c('0x38')][_0x2b8c('0x45')]+'%'};return _0x4b108e;})});}_0x3a8d19=_['merge']({},_0x3a8d19,_0x30b18a['options']);return db['CmCustomField'][_0x2b8c('0x97')](_0x3a8d19);}})[_0x2b8c('0x28')](respondWithResult(_0x56b722,null))[_0x2b8c('0x4a')](handleError(_0x56b722,null));};exports[_0x2b8c('0x98')]=function(_0x42fb37,_0x43794a){return db[_0x2b8c('0x6a')][_0x2b8c('0x97')]({'where':{'ListId':null}})[_0x2b8c('0x28')](handleEntityNotFound(_0x43794a,null))[_0x2b8c('0x28')](function(_0x27c996){return _0x27c996;})[_0x2b8c('0x28')](respondWithResult(_0x43794a,null))['catch'](handleError(_0x43794a,null));};exports['addAgents']=function(_0x28da2e,_0x43bb4b,_0x78616c){return db[_0x2b8c('0x2d')]['find']({'where':{'id':_0x28da2e['params']['id']}})[_0x2b8c('0x28')](handleEntityNotFound(_0x43bb4b,null))[_0x2b8c('0x28')](function(_0x5c0f86){if(_0x5c0f86){return _0x5c0f86[_0x2b8c('0x99')](_0x28da2e[_0x2b8c('0x4c')][_0x2b8c('0x63')],_['omit'](_0x28da2e[_0x2b8c('0x4c')],[_0x2b8c('0x63'),'id'])||{})[_0x2b8c('0x9a')](function(_0x1b4758){for(var _0x304681=0x0;_0x304681<_0x28da2e[_0x2b8c('0x4c')]['ids']['length'];_0x304681+=0x1){socket[_0x2b8c('0x9b')](_0x2b8c('0x9c'),{'UserId':Number(_0x28da2e[_0x2b8c('0x4c')][_0x2b8c('0x63')][_0x304681]),'CmListId':Number(_0x28da2e[_0x2b8c('0x47')]['id'])});}return _0x1b4758;});}})['then'](respondWithResult(_0x43bb4b,null))[_0x2b8c('0x4a')](handleError(_0x43bb4b,null));};exports['removeAgents']=function(_0x5aee8d,_0x555d67,_0x24b777){return db['CmList'][_0x2b8c('0x49')]({'where':{'id':_0x5aee8d[_0x2b8c('0x47')]['id']}})[_0x2b8c('0x28')](handleEntityNotFound(_0x555d67,null))[_0x2b8c('0x28')](function(_0x1a3d5b){if(_0x1a3d5b){return _0x1a3d5b['removeAgents'](_0x5aee8d[_0x2b8c('0x38')][_0x2b8c('0x63')])[_0x2b8c('0x28')](function(){if(_[_0x2b8c('0x60')](_0x5aee8d[_0x2b8c('0x38')][_0x2b8c('0x63')])){for(var _0x2eb84b=0x0;_0x2eb84b<_0x5aee8d['query'][_0x2b8c('0x63')][_0x2b8c('0x3b')];_0x2eb84b+=0x1){socket[_0x2b8c('0x9b')](_0x2b8c('0x9d'),{'UserId':Number(_0x5aee8d['query'][_0x2b8c('0x63')][_0x2eb84b]),'CmListId':Number(_0x5aee8d[_0x2b8c('0x47')]['id'])});}}else{socket[_0x2b8c('0x9b')](_0x2b8c('0x9d'),{'UserId':Number(_0x5aee8d[_0x2b8c('0x38')][_0x2b8c('0x63')]),'CmListId':Number(_0x5aee8d[_0x2b8c('0x47')]['id'])});}});}})[_0x2b8c('0x28')](respondWithStatusCode(_0x555d67,null))[_0x2b8c('0x4a')](handleError(_0x555d67,null));};exports[_0x2b8c('0x9e')]=function(_0x3ef597,_0x2457c2,_0x432666){var _0x3c2afb={};var _0x35eb36={};var _0x145942;var _0x341294;return db[_0x2b8c('0x2d')][_0x2b8c('0x59')]({'where':{'id':_0x3ef597[_0x2b8c('0x47')]['id']}})['then'](handleEntityNotFound(_0x2457c2,null))[_0x2b8c('0x28')](function(_0x5cf6a5){if(_0x5cf6a5){_0x145942=_0x5cf6a5;_0x35eb36[_0x2b8c('0x37')]=_[_0x2b8c('0x34')](db['User']['rawAttributes']);_0x35eb36[_0x2b8c('0x38')]=_[_0x2b8c('0x34')](_0x3ef597[_0x2b8c('0x38')]);_0x35eb36[_0x2b8c('0x35')]=_[_0x2b8c('0x36')](_0x35eb36[_0x2b8c('0x37')],_0x35eb36[_0x2b8c('0x38')]);_0x3c2afb['attributes']=_[_0x2b8c('0x36')](_0x35eb36[_0x2b8c('0x37')],qs['fields'](_0x3ef597[_0x2b8c('0x38')][_0x2b8c('0x3a')]));_0x3c2afb['attributes']=_0x3c2afb['attributes']['length']?_0x3c2afb[_0x2b8c('0x39')]:_0x35eb36[_0x2b8c('0x37')];_0x3c2afb['order']=qs['sort'](_0x3ef597['query'][_0x2b8c('0x40')]);_0x3c2afb[_0x2b8c('0x41')]=qs[_0x2b8c('0x35')](_[_0x2b8c('0x42')](_0x3ef597[_0x2b8c('0x38')],_0x35eb36[_0x2b8c('0x35')]));if(_0x3ef597[_0x2b8c('0x38')][_0x2b8c('0x45')]){_0x3c2afb[_0x2b8c('0x41')]=_['merge'](_0x3c2afb[_0x2b8c('0x41')],{'$or':_['map'](_0x3c2afb[_0x2b8c('0x39')],function(_0x29a460){var _0x49e111={};_0x49e111[_0x29a460]={'$like':'%'+_0x3ef597[_0x2b8c('0x38')]['filter']+'%'};return _0x49e111;})});}_0x3c2afb=_[_0x2b8c('0x43')]({},_0x3c2afb,_0x3ef597['options']);return _0x145942[_0x2b8c('0x9e')](_0x3c2afb);}})['then'](function(_0xec75af){if(_0xec75af){_0x341294=_0xec75af[_0x2b8c('0x3b')];if(!_0x3ef597[_0x2b8c('0x38')]['hasOwnProperty'](_0x2b8c('0x3d'))){_0x3c2afb[_0x2b8c('0x3e')]=qs['limit'](_0x3ef597[_0x2b8c('0x38')]['limit']);_0x3c2afb[_0x2b8c('0x20')]=qs['offset'](_0x3ef597[_0x2b8c('0x38')][_0x2b8c('0x20')]);}return _0x145942[_0x2b8c('0x9e')](_0x3c2afb);}})['then'](function(_0xec43b){if(_0xec43b){return _0xec43b?{'count':_0x341294,'rows':_0xec43b}:null;}})[_0x2b8c('0x28')](respondWithResult(_0x2457c2,null))[_0x2b8c('0x4a')](handleError(_0x2457c2,null));};function handleQuery(_0x10d709){logger['info'](_0x10d709);return db[_0x2b8c('0x89')][_0x2b8c('0x38')](_0x10d709)[_0x2b8c('0x9a')](function(_0x39b597){csv_results[_0x2b8c('0x65')](_0x39b597);})['catch'](function(_0x24aaa1){logger[_0x2b8c('0x52')](_0x24aaa1['message']);});} \ No newline at end of file diff --git a/server/api/cmList/cmList.events.js b/server/api/cmList/cmList.events.js index e6522a3..a5cf168 100644 --- a/server/api/cmList/cmList.events.js +++ b/server/api/cmList/cmList.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7217=['emit','hasOwnProperty','hook','exports','events','CmList','setMaxListeners','save','update','remove'];(function(_0x5e1b91,_0x236f17){var _0x59b52f=function(_0x5c05ed){while(--_0x5c05ed){_0x5e1b91['push'](_0x5e1b91['shift']());}};_0x59b52f(++_0x236f17);}(_0x7217,0x19e));var _0x7721=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0x7217[_0x311c35];return _0x5cc50c;};'use strict';var EventEmitter=require(_0x7721('0x0'));var CmList=require('../../mysqldb')['db'][_0x7721('0x1')];var CmListEvents=new EventEmitter();CmListEvents[_0x7721('0x2')](0x0);var events={'afterCreate':_0x7721('0x3'),'afterUpdate':_0x7721('0x4'),'afterDestroy':_0x7721('0x5')};function emitEvent(_0x4d6446){return function(_0x5bf160,_0x472a96,_0xce17f9){CmListEvents[_0x7721('0x6')](_0x4d6446+':'+_0x5bf160['id'],_0x5bf160);CmListEvents[_0x7721('0x6')](_0x4d6446,_0x5bf160);_0xce17f9(null);};}for(var e in events){if(events[_0x7721('0x7')](e)){var event=events[e];CmList[_0x7721('0x8')](e,emitEvent(event));}}module[_0x7721('0x9')]=CmListEvents; \ No newline at end of file +var _0x7217=['emit','hasOwnProperty','hook','exports','events','CmList','setMaxListeners','save','update','remove'];(function(_0x23b2b4,_0x1af875){var _0x4918ae=function(_0x17829a){while(--_0x17829a){_0x23b2b4['push'](_0x23b2b4['shift']());}};_0x4918ae(++_0x1af875);}(_0x7217,0x19e));var _0x7721=function(_0x31e29a,_0x349c9b){_0x31e29a=_0x31e29a-0x0;var _0x32d892=_0x7217[_0x31e29a];return _0x32d892;};'use strict';var EventEmitter=require(_0x7721('0x0'));var CmList=require('../../mysqldb')['db'][_0x7721('0x1')];var CmListEvents=new EventEmitter();CmListEvents[_0x7721('0x2')](0x0);var events={'afterCreate':_0x7721('0x3'),'afterUpdate':_0x7721('0x4'),'afterDestroy':_0x7721('0x5')};function emitEvent(_0x4d6446){return function(_0x5bf160,_0x472a96,_0xce17f9){CmListEvents[_0x7721('0x6')](_0x4d6446+':'+_0x5bf160['id'],_0x5bf160);CmListEvents[_0x7721('0x6')](_0x4d6446,_0x5bf160);_0xce17f9(null);};}for(var e in events){if(events[_0x7721('0x7')](e)){var event=events[e];CmList[_0x7721('0x8')](e,emitEvent(event));}}module[_0x7721('0x9')]=CmListEvents; \ No newline at end of file diff --git a/server/api/cmList/cmList.model.js b/server/api/cmList/cmList.model.js index c8795ae..9514f8b 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 _0x6f0d=['./cmList.attributes','define','CmList','cm_lists','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x6f0d,0x16c));var _0xd6f0=function(_0x33c7f6,_0x2a59f7){_0x33c7f6=_0x33c7f6-0x0;var _0x6ff6b8=_0x6f0d[_0x33c7f6];return _0x6ff6b8;};'use strict';var _=require('lodash');var util=require(_0xd6f0('0x0'));var logger=require(_0xd6f0('0x1'))(_0xd6f0('0x2'));var moment=require(_0xd6f0('0x3'));var BPromise=require('bluebird');var rp=require(_0xd6f0('0x4'));var fs=require('fs');var path=require(_0xd6f0('0x5'));var rimraf=require(_0xd6f0('0x6'));var config=require(_0xd6f0('0x7'));var attributes=require(_0xd6f0('0x8'));module['exports']=function(_0x2d2ce6,_0x4a8b0c){return _0x2d2ce6[_0xd6f0('0x9')](_0xd6f0('0xa'),attributes,{'tableName':_0xd6f0('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x668b=['cm_lists','lodash','util','api','moment','request-promise','rimraf','../../config/environment','./cmList.attributes','define','CmList'];(function(_0x5e795f,_0x831a4f){var _0x1a0912=function(_0x5deb65){while(--_0x5deb65){_0x5e795f['push'](_0x5e795f['shift']());}};_0x1a0912(++_0x831a4f);}(_0x668b,0x140));var _0xb668=function(_0x45fc6a,_0x166adb){_0x45fc6a=_0x45fc6a-0x0;var _0x14bcfd=_0x668b[_0x45fc6a];return _0x14bcfd;};'use strict';var _=require(_0xb668('0x0'));var util=require(_0xb668('0x1'));var logger=require('../../config/logger')(_0xb668('0x2'));var moment=require(_0xb668('0x3'));var BPromise=require('bluebird');var rp=require(_0xb668('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb668('0x5'));var config=require(_0xb668('0x6'));var attributes=require(_0xb668('0x7'));module['exports']=function(_0x9b99a8,_0x296fa9){return _0x9b99a8[_0xb668('0x8')](_0xb668('0x9'),attributes,{'tableName':_0xb668('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmList/cmList.rpc.js b/server/api/cmList/cmList.rpc.js index a335477..c988fd1 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 _0x1b60=['CmList,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','result','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','defaults','redis','localhost','./cmList.socket','register','info'];(function(_0xe3807f,_0x485ec5){var _0x4388b2=function(_0xb97e0b){while(--_0xb97e0b){_0xe3807f['push'](_0xe3807f['shift']());}};_0x4388b2(++_0x485ec5);}(_0x1b60,0x187));var _0x01b6=function(_0x12c013,_0x152d77){_0x12c013=_0x12c013-0x0;var _0x3a8ab3=_0x1b60[_0x12c013];return _0x3a8ab3;};'use strict';var _=require(_0x01b6('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x01b6('0x1'));var rs=require(_0x01b6('0x2'));var fs=require('fs');var Redis=require(_0x01b6('0x3'));var db=require(_0x01b6('0x4'))['db'];var utils=require(_0x01b6('0x5'));var logger=require(_0x01b6('0x6'))(_0x01b6('0x7'));var config=require('../../config/environment');var jayson=require(_0x01b6('0x8'));var client=jayson[_0x01b6('0x9')][_0x01b6('0xa')]({'port':0x232a});config['redis']=_[_0x01b6('0xb')](config[_0x01b6('0xc')],{'host':_0x01b6('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x01b6('0xc')]));require(_0x01b6('0xe'))[_0x01b6('0xf')](socket);function respondWithRpcPromise(_0x316260,_0x2b5266,_0x4eff42){return new BPromise(function(_0xd3be57,_0x2258ea){return client['request'](_0x316260,_0x4eff42)['then'](function(_0x10b19f){logger[_0x01b6('0x10')](_0x01b6('0x11'),_0x2b5266,'request\x20sent');logger[_0x01b6('0x12')]('CmList,\x20%s,\x20%s,\x20%s',_0x2b5266,_0x01b6('0x13'),JSON[_0x01b6('0x14')](_0x10b19f));if(_0x10b19f[_0x01b6('0x15')]){if(_0x10b19f['error']['code']===0x1f4){logger[_0x01b6('0x15')]('CmList,\x20%s,\x20%s',_0x2b5266,_0x10b19f[_0x01b6('0x15')][_0x01b6('0x16')]);return _0x2258ea(_0x10b19f[_0x01b6('0x15')]['message']);}logger[_0x01b6('0x15')](_0x01b6('0x11'),_0x2b5266,_0x10b19f[_0x01b6('0x15')][_0x01b6('0x16')]);return _0xd3be57(_0x10b19f[_0x01b6('0x15')][_0x01b6('0x16')]);}else{logger[_0x01b6('0x10')](_0x01b6('0x11'),_0x2b5266,_0x01b6('0x13'));_0xd3be57(_0x10b19f[_0x01b6('0x17')][_0x01b6('0x16')]);}})['catch'](function(_0x422b51){logger['error'](_0x01b6('0x11'),_0x2b5266,_0x422b51);_0x2258ea(_0x422b51);});});} \ No newline at end of file +var _0xc144=['socket.io-emitter','./cmList.socket','register','request','then','request\x20sent','CmList,\x20%s,\x20%s,\x20%s','stringify','error','CmList,\x20%s,\x20%s','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','client','redis','defaults','localhost'];(function(_0x4191af,_0x5783da){var _0x27bebf=function(_0x355be7){while(--_0x355be7){_0x4191af['push'](_0x4191af['shift']());}};_0x27bebf(++_0x5783da);}(_0xc144,0x97));var _0x4c14=function(_0xb372ec,_0x26a2b4){_0xb372ec=_0xb372ec-0x0;var _0x3df256=_0xc144[_0xb372ec];return _0x3df256;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x4c14('0x0'));var BPromise=require(_0x4c14('0x1'));var rs=require(_0x4c14('0x2'));var fs=require('fs');var Redis=require(_0x4c14('0x3'));var db=require(_0x4c14('0x4'))['db'];var utils=require(_0x4c14('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x4c14('0x6')]['http']({'port':0x232a});config[_0x4c14('0x7')]=_[_0x4c14('0x8')](config[_0x4c14('0x7')],{'host':_0x4c14('0x9'),'port':0x18eb});var socket=require(_0x4c14('0xa'))(new Redis(config[_0x4c14('0x7')]));require(_0x4c14('0xb'))[_0x4c14('0xc')](socket);function respondWithRpcPromise(_0x3c11ac,_0x11bca9,_0x22862f){return new BPromise(function(_0x59620e,_0x425ba9){return client[_0x4c14('0xd')](_0x3c11ac,_0x22862f)[_0x4c14('0xe')](function(_0x551d3b){logger['info']('CmList,\x20%s,\x20%s',_0x11bca9,_0x4c14('0xf'));logger['debug'](_0x4c14('0x10'),_0x11bca9,'request\x20sent',JSON[_0x4c14('0x11')](_0x551d3b));if(_0x551d3b[_0x4c14('0x12')]){if(_0x551d3b[_0x4c14('0x12')]['code']===0x1f4){logger[_0x4c14('0x12')](_0x4c14('0x13'),_0x11bca9,_0x551d3b[_0x4c14('0x12')][_0x4c14('0x14')]);return _0x425ba9(_0x551d3b['error'][_0x4c14('0x14')]);}logger[_0x4c14('0x12')]('CmList,\x20%s,\x20%s',_0x11bca9,_0x551d3b[_0x4c14('0x12')][_0x4c14('0x14')]);return _0x59620e(_0x551d3b[_0x4c14('0x12')]['message']);}else{logger['info'](_0x4c14('0x13'),_0x11bca9,_0x4c14('0xf'));_0x59620e(_0x551d3b[_0x4c14('0x15')][_0x4c14('0x14')]);}})[_0x4c14('0x16')](function(_0x42e083){logger['error'](_0x4c14('0x13'),_0x11bca9,_0x42e083);_0x425ba9(_0x42e083);});});} \ No newline at end of file diff --git a/server/api/cmList/cmList.socket.js b/server/api/cmList/cmList.socket.js index 24107c2..c289204 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 _0xb022=['removeListener','length','cmList:','./cmList.events','save','remove','update','emit'];(function(_0x13b8f3,_0x442821){var _0x1a6d06=function(_0x5126f2){while(--_0x5126f2){_0x13b8f3['push'](_0x13b8f3['shift']());}};_0x1a6d06(++_0x442821);}(_0xb022,0x1f3));var _0x2b02=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0xb022[_0x17d9e3];return _0x14192d;};'use strict';var CmListEvents=require(_0x2b02('0x0'));var events=[_0x2b02('0x1'),_0x2b02('0x2'),_0x2b02('0x3')];function createListener(_0x446bd7,_0x43dfd4){return function(_0x49be94){_0x43dfd4[_0x2b02('0x4')](_0x446bd7,_0x49be94);};}function removeListener(_0x30ad24,_0x156ff6){return function(){CmListEvents[_0x2b02('0x5')](_0x30ad24,_0x156ff6);};}exports['register']=function(_0x395b04){for(var _0x2521ef=0x0,_0x29f6ac=events[_0x2b02('0x6')];_0x2521ef<_0x29f6ac;_0x2521ef++){var _0x55c58f=events[_0x2521ef];var _0x5a297c=createListener(_0x2b02('0x7')+_0x55c58f,_0x395b04);CmListEvents['on'](_0x55c58f,_0x5a297c);}}; \ No newline at end of file +var _0x8bff=['update','emit','removeListener','register','length','cmList:','save'];(function(_0x2cfa5d,_0x31faf6){var _0x38acf4=function(_0x16b18d){while(--_0x16b18d){_0x2cfa5d['push'](_0x2cfa5d['shift']());}};_0x38acf4(++_0x31faf6);}(_0x8bff,0xa7));var _0xf8bf=function(_0x444cc9,_0x229e62){_0x444cc9=_0x444cc9-0x0;var _0x2cd2a3=_0x8bff[_0x444cc9];return _0x2cd2a3;};'use strict';var CmListEvents=require('./cmList.events');var events=[_0xf8bf('0x0'),'remove',_0xf8bf('0x1')];function createListener(_0x77d0cb,_0x5c589a){return function(_0xff94bd){_0x5c589a[_0xf8bf('0x2')](_0x77d0cb,_0xff94bd);};}function removeListener(_0x362d05,_0x100374){return function(){CmListEvents[_0xf8bf('0x3')](_0x362d05,_0x100374);};}exports[_0xf8bf('0x4')]=function(_0x44a632){for(var _0xa2da04=0x0,_0x1c3792=events[_0xf8bf('0x5')];_0xa2da04<_0x1c3792;_0xa2da04++){var _0x5d3a1b=events[_0xa2da04];var _0x45aa21=createListener(_0xf8bf('0x6')+_0x5d3a1b,_0x44a632);CmListEvents['on'](_0x5d3a1b,_0x45aa21);}}; \ No newline at end of file diff --git a/server/api/cmList/index.js b/server/api/cmList/index.js index 983e856..1217307 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 _0x7398=['isAuthenticated','index','/describe','describe','/global_fields','getGlobalCustomFields','/:id','show','/:id/dispositions','getDispositions','/:id/contacts','getContacts','/:id/contacts/csv','getContactsCsv','/:id/fields','getCustomFields','getAgents','post','create','addContacts','addCustomField','/:id/users','update','destroy','delete','removeDispositions','removeAgents','exports','util','connect-timeout','express','fs-extra','../../components/interaction/service','get'];(function(_0xe5cac7,_0x6c2f84){var _0x50df20=function(_0x3e4981){while(--_0x3e4981){_0xe5cac7['push'](_0xe5cac7['shift']());}};_0x50df20(++_0x6c2f84);}(_0x7398,0x82));var _0x8739=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7398[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0x8739('0x0'));var path=require('path');var timeout=require(_0x8739('0x1'));var express=require(_0x8739('0x2'));var router=express['Router']();var fs_extra=require(_0x8739('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x8739('0x4'));var config=require('../../config/environment');var controller=require('./cmList.controller');router[_0x8739('0x5')]('/',auth[_0x8739('0x6')](),controller[_0x8739('0x7')]);router['get'](_0x8739('0x8'),auth[_0x8739('0x6')](),controller[_0x8739('0x9')]);router[_0x8739('0x5')](_0x8739('0xa'),auth[_0x8739('0x6')](),controller[_0x8739('0xb')]);router['get'](_0x8739('0xc'),auth['isAuthenticated'](),controller[_0x8739('0xd')]);router[_0x8739('0x5')](_0x8739('0xe'),auth[_0x8739('0x6')](),controller[_0x8739('0xf')]);router[_0x8739('0x5')](_0x8739('0x10'),auth[_0x8739('0x6')](),controller[_0x8739('0x11')]);router[_0x8739('0x5')](_0x8739('0x12'),auth['isAuthenticated'](),controller[_0x8739('0x13')]);router['get'](_0x8739('0x14'),auth['isAuthenticated'](),controller[_0x8739('0x15')]);router['get']('/:id/users',auth[_0x8739('0x6')](),controller[_0x8739('0x16')]);router[_0x8739('0x17')]('/',auth[_0x8739('0x6')](),controller[_0x8739('0x18')]);router[_0x8739('0x17')]('/:id/dispositions',auth['isAuthenticated'](),controller['addDisposition']);router[_0x8739('0x17')](_0x8739('0x10'),auth[_0x8739('0x6')](),controller[_0x8739('0x19')]);router['post'](_0x8739('0x14'),auth[_0x8739('0x6')](),controller[_0x8739('0x1a')]);router[_0x8739('0x17')](_0x8739('0x1b'),auth[_0x8739('0x6')](),controller['addAgents']);router['put'](_0x8739('0xc'),auth['isAuthenticated'](),controller[_0x8739('0x1c')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x8739('0x1d')]);router[_0x8739('0x1e')]('/:id/dispositions',auth[_0x8739('0x6')](),controller[_0x8739('0x1f')]);router[_0x8739('0x1e')](_0x8739('0x1b'),auth[_0x8739('0x6')](),controller[_0x8739('0x20')]);module[_0x8739('0x21')]=router; \ No newline at end of file +var _0xa311=['../../config/environment','./cmList.controller','get','isAuthenticated','index','describe','/global_fields','getGlobalCustomFields','/:id','show','/:id/dispositions','getContacts','/:id/contacts/csv','/:id/fields','getCustomFields','/:id/users','getAgents','post','addDisposition','/:id/contacts','addContacts','addCustomField','addAgents','put','update','delete','destroy','removeDispositions','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa311,0x118));var _0x1a31=function(_0x4e4519,_0x392ae){_0x4e4519=_0x4e4519-0x0;var _0x340044=_0xa311[_0x4e4519];return _0x340044;};'use strict';var multer=require(_0x1a31('0x0'));var util=require(_0x1a31('0x1'));var path=require(_0x1a31('0x2'));var timeout=require(_0x1a31('0x3'));var express=require('express');var router=express[_0x1a31('0x4')]();var fs_extra=require(_0x1a31('0x5'));var auth=require(_0x1a31('0x6'));var interaction=require(_0x1a31('0x7'));var config=require(_0x1a31('0x8'));var controller=require(_0x1a31('0x9'));router[_0x1a31('0xa')]('/',auth[_0x1a31('0xb')](),controller[_0x1a31('0xc')]);router['get']('/describe',auth['isAuthenticated'](),controller[_0x1a31('0xd')]);router[_0x1a31('0xa')](_0x1a31('0xe'),auth['isAuthenticated'](),controller[_0x1a31('0xf')]);router[_0x1a31('0xa')](_0x1a31('0x10'),auth['isAuthenticated'](),controller[_0x1a31('0x11')]);router['get'](_0x1a31('0x12'),auth[_0x1a31('0xb')](),controller['getDispositions']);router[_0x1a31('0xa')]('/:id/contacts',auth[_0x1a31('0xb')](),controller[_0x1a31('0x13')]);router[_0x1a31('0xa')](_0x1a31('0x14'),auth[_0x1a31('0xb')](),controller['getContactsCsv']);router[_0x1a31('0xa')](_0x1a31('0x15'),auth['isAuthenticated'](),controller[_0x1a31('0x16')]);router['get'](_0x1a31('0x17'),auth['isAuthenticated'](),controller[_0x1a31('0x18')]);router[_0x1a31('0x19')]('/',auth[_0x1a31('0xb')](),controller['create']);router['post'](_0x1a31('0x12'),auth[_0x1a31('0xb')](),controller[_0x1a31('0x1a')]);router[_0x1a31('0x19')](_0x1a31('0x1b'),auth[_0x1a31('0xb')](),controller[_0x1a31('0x1c')]);router['post'](_0x1a31('0x15'),auth[_0x1a31('0xb')](),controller[_0x1a31('0x1d')]);router[_0x1a31('0x19')]('/:id/users',auth['isAuthenticated'](),controller[_0x1a31('0x1e')]);router[_0x1a31('0x1f')](_0x1a31('0x10'),auth[_0x1a31('0xb')](),controller[_0x1a31('0x20')]);router[_0x1a31('0x21')](_0x1a31('0x10'),auth['isAuthenticated'](),controller[_0x1a31('0x22')]);router[_0x1a31('0x21')](_0x1a31('0x12'),auth['isAuthenticated'](),controller[_0x1a31('0x23')]);router[_0x1a31('0x21')](_0x1a31('0x17'),auth[_0x1a31('0xb')](),controller['removeAgents']);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 f4b7d36..f618244 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 _0xce82=['field','STRING','sequelize','getDataValue'];(function(_0x20c9b2,_0x55d7b1){var _0x2c6030=function(_0x10845f){while(--_0x10845f){_0x20c9b2['push'](_0x20c9b2['shift']());}};_0x2c6030(++_0x55d7b1);}(_0xce82,0xf6));var _0x2ce8=function(_0x128b44,_0x310019){_0x128b44=_0x128b44-0x0;var _0x42707f=_0xce82[_0x128b44];return _0x42707f;};'use strict';var Sequelize=require(_0x2ce8('0x0'));module['exports']={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x890be5){return this[_0x2ce8('0x1')](_0x2ce8('0x2'));}},'field':{'type':Sequelize[_0x2ce8('0x3')],'allowNull':![]},'operator':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize[_0x2ce8('0x3')],'allowNull':![]}}; \ No newline at end of file +var _0xf3f3=['getDataValue','field','STRING','sequelize','exports'];(function(_0x19b980,_0x40c574){var _0x320fd8=function(_0x58f323){while(--_0x58f323){_0x19b980['push'](_0x19b980['shift']());}};_0x320fd8(++_0x40c574);}(_0xf3f3,0x166));var _0x3f3f=function(_0x170772,_0x1f1ee7){_0x170772=_0x170772-0x0;var _0x3ef69c=_0xf3f3[_0x170772];return _0x3ef69c;};'use strict';var Sequelize=require(_0x3f3f('0x0'));module[_0x3f3f('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x2b5566){return this[_0x3f3f('0x2')](_0x3f3f('0x3'));}},'field':{'type':Sequelize[_0x3f3f('0x4')],'allowNull':![]},'operator':{'type':Sequelize[_0x3f3f('0x4')],'allowNull':![]},'value':{'type':Sequelize[_0x3f3f('0x4')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/condition/condition.controller.js b/server/api/condition/condition.controller.js index 6642443..1f4cc13 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(_0x4f00fc,_0x2ed71e){var _0x1dec2a=function(_0x4c27f7){while(--_0x4c27f7){_0x4f00fc['push'](_0x4f00fc['shift']());}};_0x1dec2a(++_0x2ed71e);}(_0x7a54,0x106));var _0x47a5=function(_0x423417,_0x1e1072){_0x423417=_0x423417-0x0;var _0x4c7490=_0x7a54[_0x423417];return _0x4c7490;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x22')]=function(_0x136b14,_0x16631f){if(_0x136b14[_0x47a5('0x29')]['id']){delete _0x136b14[_0x47a5('0x29')]['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x2b')]({'where':{'id':_0x136b14['params']['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x16631f,null))['then'](saveUpdates(_0x136b14[_0x47a5('0x29')],null))[_0x47a5('0x23')](respondWithResult(_0x16631f,null))[_0x47a5('0x2c')](handleError(_0x16631f,null));};exports['destroy']=function(_0x256650,_0x625952){return db[_0x47a5('0x2a')][_0x47a5('0x2b')]({'where':{'id':_0x256650['params']['id']}})['then'](handleEntityNotFound(_0x625952,null))[_0x47a5('0x23')](removeEntity(_0x625952,null))[_0x47a5('0x2c')](handleError(_0x625952,null));}; \ No newline at end of file +var _0x9957=['eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','update','body','Condition','find','catch','params'];(function(_0x4182b0,_0x38ac92){var _0x293da8=function(_0x5252a2){while(--_0x5252a2){_0x4182b0['push'](_0x4182b0['shift']());}};_0x293da8(++_0x38ac92);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){if(_0x4b6f99['body']['id']){delete _0x4b6f99[_0x7995('0x2c')]['id'];}return db[_0x7995('0x2d')][_0x7995('0x2e')]({'where':{'id':_0x4b6f99['params']['id']}})['then'](handleEntityNotFound(_0x9b2a15,null))['then'](saveUpdates(_0x4b6f99[_0x7995('0x2c')],null))[_0x7995('0x26')](respondWithResult(_0x9b2a15,null))[_0x7995('0x2f')](handleError(_0x9b2a15,null));};exports[_0x7995('0x27')]=function(_0x2e3493,_0x1ca460){return db['Condition']['find']({'where':{'id':_0x2e3493[_0x7995('0x30')]['id']}})['then'](handleEntityNotFound(_0x1ca460,null))[_0x7995('0x26')](removeEntity(_0x1ca460,null))[_0x7995('0x2f')](handleError(_0x1ca460,null));}; \ No newline at end of file diff --git a/server/api/condition/condition.model.js b/server/api/condition/condition.model.js index d114cd1..d997383 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 _0xd58f=['bluebird','path','../../config/environment','./condition.attributes','Condition','tools_conditions','../../config/logger','api','moment'];(function(_0x5e93ed,_0x10cca8){var _0x45462b=function(_0x3e355e){while(--_0x3e355e){_0x5e93ed['push'](_0x5e93ed['shift']());}};_0x45462b(++_0x10cca8);}(_0xd58f,0x192));var _0xfd58=function(_0x13b820,_0x1f5f77){_0x13b820=_0x13b820-0x0;var _0x27b744=_0xd58f[_0x13b820];return _0x27b744;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xfd58('0x0'))(_0xfd58('0x1'));var moment=require(_0xfd58('0x2'));var BPromise=require(_0xfd58('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xfd58('0x4'));var rimraf=require('rimraf');var config=require(_0xfd58('0x5'));var attributes=require(_0xfd58('0x6'));module['exports']=function(_0x27b6b6,_0x311955){return _0x27b6b6['define'](_0xfd58('0x7'),attributes,{'tableName':_0xfd58('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4bc5=['../../config/environment','exports','define','tools_conditions','lodash','util','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x3d0660,_0x59ab2b){var _0x48e7e4=function(_0x3615be){while(--_0x3615be){_0x3d0660['push'](_0x3d0660['shift']());}};_0x48e7e4(++_0x59ab2b);}(_0x4bc5,0x1d8));var _0x54bc=function(_0x5a95fa,_0x4a2fc9){_0x5a95fa=_0x5a95fa-0x0;var _0x1a61b8=_0x4bc5[_0x5a95fa];return _0x1a61b8;};'use strict';var _=require(_0x54bc('0x0'));var util=require(_0x54bc('0x1'));var logger=require('../../config/logger')(_0x54bc('0x2'));var moment=require(_0x54bc('0x3'));var BPromise=require(_0x54bc('0x4'));var rp=require(_0x54bc('0x5'));var fs=require('fs');var path=require(_0x54bc('0x6'));var rimraf=require(_0x54bc('0x7'));var config=require(_0x54bc('0x8'));var attributes=require('./condition.attributes');module[_0x54bc('0x9')]=function(_0x5dcf47,_0x33ad60){return _0x5dcf47[_0x54bc('0xa')]('Condition',attributes,{'tableName':_0x54bc('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/condition/condition.rpc.js b/server/api/condition/condition.rpc.js index 1dbbb38..d8991a1 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 _0x3f08=['../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Condition,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','lodash','util','moment','bluebird','randomstring','../../config/utils'];(function(_0x468637,_0x53e3f0){var _0x108240=function(_0x10a0ef){while(--_0x10a0ef){_0x468637['push'](_0x468637['shift']());}};_0x108240(++_0x53e3f0);}(_0x3f08,0x78));var _0x83f0=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x3f08[_0x3b380d];return _0x54502b;};'use strict';var _=require(_0x83f0('0x0'));var util=require(_0x83f0('0x1'));var moment=require(_0x83f0('0x2'));var BPromise=require(_0x83f0('0x3'));var rs=require(_0x83f0('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x83f0('0x5'));var logger=require(_0x83f0('0x6'))(_0x83f0('0x7'));var config=require(_0x83f0('0x8'));var jayson=require(_0x83f0('0x9'));var client=jayson['client'][_0x83f0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x15c449,_0x3b8f97,_0x91158e){return new BPromise(function(_0x15335d,_0x410cc4){return client[_0x83f0('0xb')](_0x15c449,_0x91158e)[_0x83f0('0xc')](function(_0x4b6a29){logger[_0x83f0('0xd')](_0x83f0('0xe'),_0x3b8f97,_0x83f0('0xf'));logger[_0x83f0('0x10')]('Condition,\x20%s,\x20%s,\x20%s',_0x3b8f97,_0x83f0('0xf'),JSON[_0x83f0('0x11')](_0x4b6a29));if(_0x4b6a29[_0x83f0('0x12')]){if(_0x4b6a29[_0x83f0('0x12')][_0x83f0('0x13')]===0x1f4){logger[_0x83f0('0x12')](_0x83f0('0xe'),_0x3b8f97,_0x4b6a29[_0x83f0('0x12')][_0x83f0('0x14')]);return _0x410cc4(_0x4b6a29[_0x83f0('0x12')][_0x83f0('0x14')]);}logger['error']('Condition,\x20%s,\x20%s',_0x3b8f97,_0x4b6a29[_0x83f0('0x12')][_0x83f0('0x14')]);return _0x15335d(_0x4b6a29[_0x83f0('0x12')][_0x83f0('0x14')]);}else{logger[_0x83f0('0xd')](_0x83f0('0xe'),_0x3b8f97,'request\x20sent');_0x15335d(_0x4b6a29['result'][_0x83f0('0x14')]);}})['catch'](function(_0x23275c){logger[_0x83f0('0x12')](_0x83f0('0xe'),_0x3b8f97,_0x23275c);_0x410cc4(_0x23275c);});});} \ No newline at end of file +var _0x390d=['rpc','client','http','then','info','Condition,\x20%s,\x20%s','request\x20sent','Condition,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x4ceff8,_0x4480fb){var _0x485c5a=function(_0x3ed5b0){while(--_0x3ed5b0){_0x4ceff8['push'](_0x4ceff8['shift']());}};_0x485c5a(++_0x4480fb);}(_0x390d,0x108));var _0xd390=function(_0x44468d,_0x20fba8){_0x44468d=_0x44468d-0x0;var _0x29f159=_0x390d[_0x44468d];return _0x29f159;};'use strict';var _=require(_0xd390('0x0'));var util=require(_0xd390('0x1'));var moment=require(_0xd390('0x2'));var BPromise=require(_0xd390('0x3'));var rs=require(_0xd390('0x4'));var fs=require('fs');var Redis=require(_0xd390('0x5'));var db=require(_0xd390('0x6'))['db'];var utils=require(_0xd390('0x7'));var logger=require(_0xd390('0x8'))(_0xd390('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xd390('0xa')][_0xd390('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1a6ce2,_0x391b03,_0x26b873){return new BPromise(function(_0x45b3d5,_0x19d0e8){return client['request'](_0x1a6ce2,_0x26b873)[_0xd390('0xc')](function(_0x509f88){logger[_0xd390('0xd')](_0xd390('0xe'),_0x391b03,_0xd390('0xf'));logger['debug'](_0xd390('0x10'),_0x391b03,'request\x20sent',JSON[_0xd390('0x11')](_0x509f88));if(_0x509f88['error']){if(_0x509f88[_0xd390('0x12')]['code']===0x1f4){logger[_0xd390('0x12')]('Condition,\x20%s,\x20%s',_0x391b03,_0x509f88[_0xd390('0x12')][_0xd390('0x13')]);return _0x19d0e8(_0x509f88[_0xd390('0x12')][_0xd390('0x13')]);}logger['error'](_0xd390('0xe'),_0x391b03,_0x509f88[_0xd390('0x12')][_0xd390('0x13')]);return _0x45b3d5(_0x509f88[_0xd390('0x12')][_0xd390('0x13')]);}else{logger[_0xd390('0xd')](_0xd390('0xe'),_0x391b03,'request\x20sent');_0x45b3d5(_0x509f88[_0xd390('0x14')][_0xd390('0x13')]);}})['catch'](function(_0x143cd5){logger[_0xd390('0x12')]('Condition,\x20%s,\x20%s',_0x391b03,_0x143cd5);_0x19d0e8(_0x143cd5);});});} \ No newline at end of file diff --git a/server/api/condition/index.js b/server/api/condition/index.js index af33d45..597fd8d 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 _0x0da4=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','put','/:id','isAuthenticated','update','delete','destroy','exports','util'];(function(_0x3baeef,_0x3eadc8){var _0x58f866=function(_0x240179){while(--_0x240179){_0x3baeef['push'](_0x3baeef['shift']());}};_0x58f866(++_0x3eadc8);}(_0x0da4,0x15f));var _0x40da=function(_0x109df9,_0x506331){_0x109df9=_0x109df9-0x0;var _0x47b297=_0x0da4[_0x109df9];return _0x47b297;};'use strict';var multer=require('multer');var util=require(_0x40da('0x0'));var path=require(_0x40da('0x1'));var timeout=require(_0x40da('0x2'));var express=require(_0x40da('0x3'));var router=express[_0x40da('0x4')]();var fs_extra=require(_0x40da('0x5'));var auth=require(_0x40da('0x6'));var interaction=require(_0x40da('0x7'));var config=require(_0x40da('0x8'));var controller=require('./condition.controller');router[_0x40da('0x9')](_0x40da('0xa'),auth[_0x40da('0xb')](),controller[_0x40da('0xc')]);router[_0x40da('0xd')](_0x40da('0xa'),auth[_0x40da('0xb')](),controller[_0x40da('0xe')]);module[_0x40da('0xf')]=router; \ No newline at end of file +var _0x218e=['../../components/interaction/service','./condition.controller','put','/:id','delete','isAuthenticated','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x218e,0x1c8));var _0xe218=function(_0x554418,_0x3cb82e){_0x554418=_0x554418-0x0;var _0x59198e=_0x218e[_0x554418];return _0x59198e;};'use strict';var multer=require(_0xe218('0x0'));var util=require(_0xe218('0x1'));var path=require(_0xe218('0x2'));var timeout=require(_0xe218('0x3'));var express=require(_0xe218('0x4'));var router=express[_0xe218('0x5')]();var fs_extra=require(_0xe218('0x6'));var auth=require(_0xe218('0x7'));var interaction=require(_0xe218('0x8'));var config=require('../../config/environment');var controller=require(_0xe218('0x9'));router[_0xe218('0xa')](_0xe218('0xb'),auth['isAuthenticated'](),controller['update']);router[_0xe218('0xc')](_0xe218('0xb'),auth[_0xe218('0xd')](),controller[_0xe218('0xe')]);module[_0xe218('0xf')]=router; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.attributes.js b/server/api/contactItemType/contactItemType.attributes.js index f923f86..4564158 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 _0xc53d=['exports','STRING'];(function(_0x1ab180,_0x382b2c){var _0xfb2c2d=function(_0x1c5fd3){while(--_0x1c5fd3){_0x1ab180['push'](_0x1ab180['shift']());}};_0xfb2c2d(++_0x382b2c);}(_0xc53d,0x8c));var _0xdc53=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc53d[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module[_0xdc53('0x0')]={'name':{'type':Sequelize[_0xdc53('0x1')],'allowNull':![],'unique':'name'},'OrderBy':{'type':Sequelize['INTEGER'],'allowNull':!![]},'rgbBackgroundColor':{'type':Sequelize[_0xdc53('0x1')],'allowNull':!![]}}; \ No newline at end of file +var _0xc2ca=['INTEGER','exports','STRING','name'];(function(_0x5d4607,_0x6b5e7b){var _0x5e4a86=function(_0x46891a){while(--_0x46891a){_0x5d4607['push'](_0x5d4607['shift']());}};_0x5e4a86(++_0x6b5e7b);}(_0xc2ca,0x9d));var _0xac2c=function(_0x3c5c3c,_0x13b428){_0x3c5c3c=_0x3c5c3c-0x0;var _0x2a4714=_0xc2ca[_0x3c5c3c];return _0x2a4714;};'use strict';var Sequelize=require('sequelize');module[_0xac2c('0x0')]={'name':{'type':Sequelize[_0xac2c('0x1')],'allowNull':![],'unique':_0xac2c('0x2')},'OrderBy':{'type':Sequelize[_0xac2c('0x3')],'allowNull':!![]},'rgbBackgroundColor':{'type':Sequelize['STRING'],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.controller.js b/server/api/contactItemType/contactItemType.controller.js index d4e4e9a..d0d28de 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 _0xfb11=['show','keys','rawAttributes','includeAll','include','find','body','user','UserProfileSection','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','CmContactHasItem','eml-format','zip-dir','fast-json-patch','moment','mustache','path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','apply','reject','update','then','destroy','get','ContactItemTypes','UserProfileResource','sendStatus','error','stack','name','send','index','map','fieldName','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','VIRTUAL','options','ContactItemType','findAll','rows','catch'];(function(_0x3e468c,_0x221fff){var _0x298dbe=function(_0x1fa95b){while(--_0x1fa95b){_0x3e468c['push'](_0x3e468c['shift']());}};_0x298dbe(++_0x221fff);}(_0xfb11,0x1ad));var _0x1fb1=function(_0x3de8a4,_0x289a5c){_0x3de8a4=_0x3de8a4-0x0;var _0x4635cf=_0xfb11[_0x3de8a4];return _0x4635cf;};'use strict';var emlformat=require(_0x1fb1('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1fb1('0x1'));var jsonpatch=require(_0x1fb1('0x2'));var rp=require('request-promise');var moment=require(_0x1fb1('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x1fb1('0x4'));var util=require('util');var path=require(_0x1fb1('0x5'));var sox=require(_0x1fb1('0x6'));var csv=require('to-csv');var ejs=require(_0x1fb1('0x7'));var fs=require('fs');var fs_extra=require(_0x1fb1('0x8'));var _=require('lodash');var squel=require(_0x1fb1('0x9'));var crypto=require(_0x1fb1('0xa'));var jsforce=require(_0x1fb1('0xb'));var deskjs=require(_0x1fb1('0xc'));var toCsv=require(_0x1fb1('0xd'));var querystring=require(_0x1fb1('0xe'));var Papa=require(_0x1fb1('0xf'));var Redis=require(_0x1fb1('0x10'));var authService=require(_0x1fb1('0x11'));var qs=require(_0x1fb1('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1fb1('0x13'));var logger=require('../../config/logger')(_0x1fb1('0x14'));var utils=require('../../config/utils');var config=require(_0x1fb1('0x15'));var licenseUtil=require(_0x1fb1('0x16'));var db=require(_0x1fb1('0x17'))['db'];function respondWithStatusCode(_0x10bcac,_0x333229){_0x333229=_0x333229||0xcc;return function(_0x14f290){if(_0x14f290){return _0x10bcac['sendStatus'](_0x333229);}return _0x10bcac[_0x1fb1('0x18')](_0x333229)[_0x1fb1('0x19')]();};}function respondWithResult(_0x2c5be1,_0x44f24c){_0x44f24c=_0x44f24c||0xc8;return function(_0xd83038){if(_0xd83038){return _0x2c5be1[_0x1fb1('0x18')](_0x44f24c)[_0x1fb1('0x1a')](_0xd83038);}};}function respondWithFilteredResult(_0x316fe5,_0x358b58){return function(_0x4cbe42){if(_0x4cbe42){var _0x5c8d23=typeof _0x358b58[_0x1fb1('0x1b')]===_0x1fb1('0x1c')&&typeof _0x358b58[_0x1fb1('0x1d')]==='undefined';var _0x161ca3=_0x4cbe42[_0x1fb1('0x1e')];var _0x24d4df=_0x5c8d23?0x0:_0x358b58[_0x1fb1('0x1b')];var _0x33c6b6=_0x5c8d23?_0x4cbe42[_0x1fb1('0x1e')]:_0x358b58[_0x1fb1('0x1b')]+_0x358b58[_0x1fb1('0x1d')];var _0x4041ea;if(_0x33c6b6>=_0x161ca3){_0x33c6b6=_0x161ca3;_0x4041ea=0xc8;}else{_0x4041ea=0xce;}_0x316fe5['status'](_0x4041ea);return _0x316fe5[_0x1fb1('0x1f')]('Content-Range',_0x24d4df+'-'+_0x33c6b6+'/'+_0x161ca3)['json'](_0x4cbe42);}return null;};}function patchUpdates(_0xdf9c1b){return function(_0x313d9a){try{jsonpatch[_0x1fb1('0x20')](_0x313d9a,_0xdf9c1b,!![]);}catch(_0x54ad97){return BPromise[_0x1fb1('0x21')](_0x54ad97);}return _0x313d9a['save']();};}function saveUpdates(_0x5c76f5,_0x532c63){return function(_0x31178c){if(_0x31178c){return _0x31178c[_0x1fb1('0x22')](_0x5c76f5)[_0x1fb1('0x23')](function(_0x10924f){return _0x10924f;});}return null;};}function removeEntity(_0x303a06,_0x53b8af){return function(_0x4272c7){if(_0x4272c7){return _0x4272c7[_0x1fb1('0x24')]()[_0x1fb1('0x23')](function(){var _0x5fc9e6=_0x4272c7[_0x1fb1('0x25')]({'plain':!![]});var _0x1353a4=_0x1fb1('0x26');return db[_0x1fb1('0x27')]['destroy']({'where':{'type':_0x1353a4,'resourceId':_0x5fc9e6['id']}})[_0x1fb1('0x23')](function(){return _0x4272c7;});})[_0x1fb1('0x23')](function(){_0x303a06[_0x1fb1('0x18')](0xcc)[_0x1fb1('0x19')]();});}};}function handleEntityNotFound(_0x1898e7,_0x29e1bd){return function(_0x1a74c4){if(!_0x1a74c4){_0x1898e7[_0x1fb1('0x28')](0x194);}return _0x1a74c4;};}function handleError(_0xa7bba,_0x33a3b7){_0x33a3b7=_0x33a3b7||0x1f4;return function(_0x5e99e7){logger[_0x1fb1('0x29')](_0x5e99e7[_0x1fb1('0x2a')]);if(_0x5e99e7[_0x1fb1('0x2b')]){delete _0x5e99e7[_0x1fb1('0x2b')];}_0xa7bba['status'](_0x33a3b7)[_0x1fb1('0x2c')](_0x5e99e7);};}exports[_0x1fb1('0x2d')]=function(_0x90d8ef,_0x1b71cb){var _0x5402e9={},_0x245f84={},_0x30c8eb={'count':0x0,'rows':[]};var _0x5d45a5=_[_0x1fb1('0x2e')](db['ContactItemType']['rawAttributes'],function(_0x354e92){return{'name':_0x354e92[_0x1fb1('0x2f')],'type':_0x354e92['type'][_0x1fb1('0x30')]};});_0x245f84[_0x1fb1('0x31')]=_[_0x1fb1('0x2e')](_0x5d45a5,_0x1fb1('0x2b'));_0x245f84[_0x1fb1('0x32')]=_['keys'](_0x90d8ef[_0x1fb1('0x32')]);_0x245f84[_0x1fb1('0x33')]=_[_0x1fb1('0x34')](_0x245f84[_0x1fb1('0x31')],_0x245f84[_0x1fb1('0x32')]);_0x5402e9[_0x1fb1('0x35')]=_[_0x1fb1('0x34')](_0x245f84[_0x1fb1('0x31')],qs[_0x1fb1('0x36')](_0x90d8ef['query'][_0x1fb1('0x36')]));_0x5402e9['attributes']=_0x5402e9[_0x1fb1('0x35')]['length']?_0x5402e9[_0x1fb1('0x35')]:_0x245f84['model'];if(!_0x90d8ef['query'][_0x1fb1('0x37')](_0x1fb1('0x38'))){_0x5402e9[_0x1fb1('0x1d')]=qs[_0x1fb1('0x1d')](_0x90d8ef['query'][_0x1fb1('0x1d')]);_0x5402e9[_0x1fb1('0x1b')]=qs[_0x1fb1('0x1b')](_0x90d8ef['query'][_0x1fb1('0x1b')]);}_0x5402e9[_0x1fb1('0x39')]=qs[_0x1fb1('0x3a')](_0x90d8ef[_0x1fb1('0x32')][_0x1fb1('0x3a')]);_0x5402e9[_0x1fb1('0x3b')]=qs[_0x1fb1('0x33')](_['pick'](_0x90d8ef[_0x1fb1('0x32')],_0x245f84[_0x1fb1('0x33')]),_0x5d45a5);if(_0x90d8ef['query'][_0x1fb1('0x3c')]){_0x5402e9['where']=_[_0x1fb1('0x3d')](_0x5402e9[_0x1fb1('0x3b')],{'$or':_[_0x1fb1('0x2e')](_0x5d45a5,function(_0x439eec){if(_0x439eec[_0x1fb1('0x3e')]!==_0x1fb1('0x3f')){var _0x927301={};_0x927301[_0x439eec[_0x1fb1('0x2b')]]={'$like':'%'+_0x90d8ef[_0x1fb1('0x32')][_0x1fb1('0x3c')]+'%'};return _0x927301;}})});}_0x5402e9=_[_0x1fb1('0x3d')]({},_0x5402e9,_0x90d8ef[_0x1fb1('0x40')]);var _0xafc9a7={'where':_0x5402e9[_0x1fb1('0x3b')]};return db[_0x1fb1('0x41')]['count'](_0xafc9a7)[_0x1fb1('0x23')](function(_0xca1fd3){_0x30c8eb[_0x1fb1('0x1e')]=_0xca1fd3;if(_0x90d8ef[_0x1fb1('0x32')]['includeAll']){_0x5402e9['include']=[{'all':!![]}];}return db[_0x1fb1('0x41')][_0x1fb1('0x42')](_0x5402e9);})[_0x1fb1('0x23')](function(_0x3edc8a){_0x30c8eb[_0x1fb1('0x43')]=_0x3edc8a;return _0x30c8eb;})[_0x1fb1('0x23')](respondWithFilteredResult(_0x1b71cb,_0x5402e9))[_0x1fb1('0x44')](handleError(_0x1b71cb,null));};exports[_0x1fb1('0x45')]=function(_0x14aa27,_0x320bda){var _0x4a943c={'raw':!![],'where':{'id':_0x14aa27['params']['id']}},_0x44ccbe={};_0x44ccbe['model']=_[_0x1fb1('0x46')](db[_0x1fb1('0x41')][_0x1fb1('0x47')]);_0x44ccbe[_0x1fb1('0x32')]=_['keys'](_0x14aa27['query']);_0x44ccbe[_0x1fb1('0x33')]=_[_0x1fb1('0x34')](_0x44ccbe[_0x1fb1('0x31')],_0x44ccbe[_0x1fb1('0x32')]);_0x4a943c[_0x1fb1('0x35')]=_[_0x1fb1('0x34')](_0x44ccbe[_0x1fb1('0x31')],qs[_0x1fb1('0x36')](_0x14aa27[_0x1fb1('0x32')]['fields']));_0x4a943c['attributes']=_0x4a943c[_0x1fb1('0x35')]['length']?_0x4a943c[_0x1fb1('0x35')]:_0x44ccbe[_0x1fb1('0x31')];if(_0x14aa27[_0x1fb1('0x32')][_0x1fb1('0x48')]){_0x4a943c[_0x1fb1('0x49')]=[{'all':!![]}];}_0x4a943c=_[_0x1fb1('0x3d')]({},_0x4a943c,_0x14aa27['options']);return db[_0x1fb1('0x41')][_0x1fb1('0x4a')](_0x4a943c)[_0x1fb1('0x23')](handleEntityNotFound(_0x320bda,null))['then'](respondWithResult(_0x320bda,null))[_0x1fb1('0x44')](handleError(_0x320bda,null));};exports['create']=function(_0x6e105b,_0xba4fa7){return db[_0x1fb1('0x41')]['create'](_0x6e105b[_0x1fb1('0x4b')],{})[_0x1fb1('0x23')](function(_0x52271f){var _0xe492ab=_0x6e105b[_0x1fb1('0x4c')][_0x1fb1('0x25')]({'plain':!![]});if(!_0xe492ab)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xe492ab['role']==='user'){var _0x31a85a=_0x52271f[_0x1fb1('0x25')]({'plain':!![]});var _0x1e2754=_0x1fb1('0x26');return db[_0x1fb1('0x4d')][_0x1fb1('0x4a')]({'where':{'name':_0x1e2754,'userProfileId':_0xe492ab['userProfileId']},'raw':!![]})['then'](function(_0x267c36){if(_0x267c36&&_0x267c36[_0x1fb1('0x4e')]===0x0){return db[_0x1fb1('0x27')][_0x1fb1('0x4f')]({'name':_0x31a85a['name'],'resourceId':_0x31a85a['id'],'type':_0x267c36['name'],'sectionId':_0x267c36['id']},{})[_0x1fb1('0x23')](function(){return _0x52271f;});}else{return _0x52271f;}})['catch'](function(_0x41fefb){logger['error'](_0x1fb1('0x50'),_0x41fefb);throw _0x41fefb;});}return _0x52271f;})['then'](respondWithResult(_0xba4fa7,0xc9))[_0x1fb1('0x44')](handleError(_0xba4fa7,null));};exports[_0x1fb1('0x22')]=function(_0x1475ee,_0xca9395){if(_0x1475ee[_0x1fb1('0x4b')]['id']){delete _0x1475ee['body']['id'];}return db['ContactItemType'][_0x1fb1('0x4a')]({'where':{'id':_0x1475ee[_0x1fb1('0x51')]['id']}})['then'](handleEntityNotFound(_0xca9395,null))['then'](saveUpdates(_0x1475ee[_0x1fb1('0x4b')],null))[_0x1fb1('0x23')](respondWithResult(_0xca9395,null))[_0x1fb1('0x44')](handleError(_0xca9395,null));};exports[_0x1fb1('0x24')]=function(_0x439670,_0xc9e8d4){return db['ContactItemType'][_0x1fb1('0x4a')]({'where':{'id':_0x439670[_0x1fb1('0x51')]['id']}})[_0x1fb1('0x23')](handleEntityNotFound(_0xc9e8d4,null))[_0x1fb1('0x23')](db[_0x1fb1('0x52')][_0x1fb1('0x22')]({'ItemTypeId':null},{'where':{'ItemTypeId':_0x439670[_0x1fb1('0x51')]['id']}}))['then'](removeEntity(_0xc9e8d4,null))[_0x1fb1('0x44')](handleError(_0xc9e8d4,null));}; \ No newline at end of file +var _0x25e7=['ContactItemTypes','UserProfileResource','error','name','send','map','ContactItemType','rawAttributes','fieldName','type','key','keys','filters','model','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','includeAll','include','findAll','show','options','find','catch','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','squel','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','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','then','destroy'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x25e7,0x1d6));var _0x725e=function(_0x39fd11,_0x5d7883){_0x39fd11=_0x39fd11-0x0;var _0x302799=_0x25e7[_0x39fd11];return _0x302799;};'use strict';var emlformat=require(_0x725e('0x0'));var rimraf=require(_0x725e('0x1'));var zipdir=require(_0x725e('0x2'));var jsonpatch=require(_0x725e('0x3'));var rp=require(_0x725e('0x4'));var moment=require(_0x725e('0x5'));var BPromise=require(_0x725e('0x6'));var Mustache=require(_0x725e('0x7'));var util=require(_0x725e('0x8'));var path=require(_0x725e('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x725e('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x725e('0xb'));var crypto=require(_0x725e('0xc'));var jsforce=require(_0x725e('0xd'));var deskjs=require(_0x725e('0xe'));var toCsv=require(_0x725e('0xf'));var querystring=require(_0x725e('0x10'));var Papa=require(_0x725e('0x11'));var Redis=require(_0x725e('0x12'));var authService=require(_0x725e('0x13'));var qs=require(_0x725e('0x14'));var as=require(_0x725e('0x15'));var hardwareService=require(_0x725e('0x16'));var logger=require('../../config/logger')('api');var utils=require(_0x725e('0x17'));var config=require(_0x725e('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x11916d,_0x14218e){_0x14218e=_0x14218e||0xcc;return function(_0x5c5e44){if(_0x5c5e44){return _0x11916d[_0x725e('0x19')](_0x14218e);}return _0x11916d[_0x725e('0x1a')](_0x14218e)[_0x725e('0x1b')]();};}function respondWithResult(_0x4e0515,_0x3f8052){_0x3f8052=_0x3f8052||0xc8;return function(_0x221e02){if(_0x221e02){return _0x4e0515[_0x725e('0x1a')](_0x3f8052)[_0x725e('0x1c')](_0x221e02);}};}function respondWithFilteredResult(_0x24c3c1,_0x13fbfe){return function(_0x523422){if(_0x523422){var _0x156b99=typeof _0x13fbfe[_0x725e('0x1d')]===_0x725e('0x1e')&&typeof _0x13fbfe['limit']===_0x725e('0x1e');var _0x125fef=_0x523422[_0x725e('0x1f')];var _0x397e33=_0x156b99?0x0:_0x13fbfe[_0x725e('0x1d')];var _0x2811e7=_0x156b99?_0x523422['count']:_0x13fbfe[_0x725e('0x1d')]+_0x13fbfe[_0x725e('0x20')];var _0x1b8879;if(_0x2811e7>=_0x125fef){_0x2811e7=_0x125fef;_0x1b8879=0xc8;}else{_0x1b8879=0xce;}_0x24c3c1[_0x725e('0x1a')](_0x1b8879);return _0x24c3c1[_0x725e('0x21')](_0x725e('0x22'),_0x397e33+'-'+_0x2811e7+'/'+_0x125fef)['json'](_0x523422);}return null;};}function patchUpdates(_0x2fc416){return function(_0xd30de9){try{jsonpatch[_0x725e('0x23')](_0xd30de9,_0x2fc416,!![]);}catch(_0x40c21b){return BPromise[_0x725e('0x24')](_0x40c21b);}return _0xd30de9[_0x725e('0x25')]();};}function saveUpdates(_0x127c99,_0x262b01){return function(_0x7d0792){if(_0x7d0792){return _0x7d0792['update'](_0x127c99)[_0x725e('0x26')](function(_0x36cbab){return _0x36cbab;});}return null;};}function removeEntity(_0x389668,_0x3facae){return function(_0x5a8191){if(_0x5a8191){return _0x5a8191[_0x725e('0x27')]()['then'](function(){var _0x49a3a6=_0x5a8191['get']({'plain':!![]});var _0x2aad7b=_0x725e('0x28');return db[_0x725e('0x29')]['destroy']({'where':{'type':_0x2aad7b,'resourceId':_0x49a3a6['id']}})[_0x725e('0x26')](function(){return _0x5a8191;});})[_0x725e('0x26')](function(){_0x389668['status'](0xcc)[_0x725e('0x1b')]();});}};}function handleEntityNotFound(_0x339a58,_0x4b0d0c){return function(_0x378ace){if(!_0x378ace){_0x339a58['sendStatus'](0x194);}return _0x378ace;};}function handleError(_0x561656,_0x34b71c){_0x34b71c=_0x34b71c||0x1f4;return function(_0x5b8dec){logger[_0x725e('0x2a')](_0x5b8dec['stack']);if(_0x5b8dec['name']){delete _0x5b8dec[_0x725e('0x2b')];}_0x561656[_0x725e('0x1a')](_0x34b71c)[_0x725e('0x2c')](_0x5b8dec);};}exports['index']=function(_0x2e0534,_0x5b03d9){var _0x85d29c={},_0x1ce9c8={},_0x39932f={'count':0x0,'rows':[]};var _0x28951f=_[_0x725e('0x2d')](db[_0x725e('0x2e')][_0x725e('0x2f')],function(_0x100c63){return{'name':_0x100c63[_0x725e('0x30')],'type':_0x100c63[_0x725e('0x31')][_0x725e('0x32')]};});_0x1ce9c8['model']=_[_0x725e('0x2d')](_0x28951f,_0x725e('0x2b'));_0x1ce9c8['query']=_[_0x725e('0x33')](_0x2e0534['query']);_0x1ce9c8[_0x725e('0x34')]=_['intersection'](_0x1ce9c8[_0x725e('0x35')],_0x1ce9c8[_0x725e('0x36')]);_0x85d29c[_0x725e('0x37')]=_[_0x725e('0x38')](_0x1ce9c8[_0x725e('0x35')],qs[_0x725e('0x39')](_0x2e0534['query']['fields']));_0x85d29c[_0x725e('0x37')]=_0x85d29c[_0x725e('0x37')][_0x725e('0x3a')]?_0x85d29c['attributes']:_0x1ce9c8[_0x725e('0x35')];if(!_0x2e0534['query'][_0x725e('0x3b')](_0x725e('0x3c'))){_0x85d29c[_0x725e('0x20')]=qs[_0x725e('0x20')](_0x2e0534['query']['limit']);_0x85d29c[_0x725e('0x1d')]=qs[_0x725e('0x1d')](_0x2e0534[_0x725e('0x36')]['offset']);}_0x85d29c[_0x725e('0x3d')]=qs[_0x725e('0x3e')](_0x2e0534[_0x725e('0x36')]['sort']);_0x85d29c[_0x725e('0x3f')]=qs['filters'](_[_0x725e('0x40')](_0x2e0534[_0x725e('0x36')],_0x1ce9c8[_0x725e('0x34')]),_0x28951f);if(_0x2e0534[_0x725e('0x36')][_0x725e('0x41')]){_0x85d29c['where']=_['merge'](_0x85d29c[_0x725e('0x3f')],{'$or':_[_0x725e('0x2d')](_0x28951f,function(_0x41c1ed){if(_0x41c1ed['type']!==_0x725e('0x42')){var _0x5be83e={};_0x5be83e[_0x41c1ed[_0x725e('0x2b')]]={'$like':'%'+_0x2e0534[_0x725e('0x36')][_0x725e('0x41')]+'%'};return _0x5be83e;}})});}_0x85d29c=_[_0x725e('0x43')]({},_0x85d29c,_0x2e0534['options']);var _0x448ebc={'where':_0x85d29c[_0x725e('0x3f')]};return db[_0x725e('0x2e')][_0x725e('0x1f')](_0x448ebc)[_0x725e('0x26')](function(_0x19ed0a){_0x39932f[_0x725e('0x1f')]=_0x19ed0a;if(_0x2e0534['query'][_0x725e('0x44')]){_0x85d29c[_0x725e('0x45')]=[{'all':!![]}];}return db['ContactItemType'][_0x725e('0x46')](_0x85d29c);})[_0x725e('0x26')](function(_0x5e719e){_0x39932f['rows']=_0x5e719e;return _0x39932f;})['then'](respondWithFilteredResult(_0x5b03d9,_0x85d29c))['catch'](handleError(_0x5b03d9,null));};exports[_0x725e('0x47')]=function(_0x9c8c57,_0x89a516){var _0x59f6d0={'raw':!![],'where':{'id':_0x9c8c57['params']['id']}},_0x1eee42={};_0x1eee42['model']=_[_0x725e('0x33')](db[_0x725e('0x2e')][_0x725e('0x2f')]);_0x1eee42[_0x725e('0x36')]=_[_0x725e('0x33')](_0x9c8c57[_0x725e('0x36')]);_0x1eee42['filters']=_[_0x725e('0x38')](_0x1eee42['model'],_0x1eee42[_0x725e('0x36')]);_0x59f6d0[_0x725e('0x37')]=_['intersection'](_0x1eee42[_0x725e('0x35')],qs['fields'](_0x9c8c57[_0x725e('0x36')][_0x725e('0x39')]));_0x59f6d0['attributes']=_0x59f6d0['attributes'][_0x725e('0x3a')]?_0x59f6d0['attributes']:_0x1eee42[_0x725e('0x35')];if(_0x9c8c57['query']['includeAll']){_0x59f6d0['include']=[{'all':!![]}];}_0x59f6d0=_[_0x725e('0x43')]({},_0x59f6d0,_0x9c8c57[_0x725e('0x48')]);return db['ContactItemType'][_0x725e('0x49')](_0x59f6d0)[_0x725e('0x26')](handleEntityNotFound(_0x89a516,null))['then'](respondWithResult(_0x89a516,null))[_0x725e('0x4a')](handleError(_0x89a516,null));};exports[_0x725e('0x4b')]=function(_0x4d5415,_0x19f524){return db[_0x725e('0x2e')][_0x725e('0x4b')](_0x4d5415[_0x725e('0x4c')],{})[_0x725e('0x26')](function(_0x432285){var _0x3fdbfd=_0x4d5415[_0x725e('0x4d')][_0x725e('0x4e')]({'plain':!![]});if(!_0x3fdbfd)throw new Error(_0x725e('0x4f'));if(_0x3fdbfd['role']===_0x725e('0x4d')){var _0x5e3678=_0x432285[_0x725e('0x4e')]({'plain':!![]});var _0x1853bc=_0x725e('0x28');return db[_0x725e('0x50')][_0x725e('0x49')]({'where':{'name':_0x1853bc,'userProfileId':_0x3fdbfd[_0x725e('0x51')]},'raw':!![]})[_0x725e('0x26')](function(_0x1a9dca){if(_0x1a9dca&&_0x1a9dca[_0x725e('0x52')]===0x0){return db[_0x725e('0x29')][_0x725e('0x4b')]({'name':_0x5e3678[_0x725e('0x2b')],'resourceId':_0x5e3678['id'],'type':_0x1a9dca[_0x725e('0x2b')],'sectionId':_0x1a9dca['id']},{})[_0x725e('0x26')](function(){return _0x432285;});}else{return _0x432285;}})[_0x725e('0x4a')](function(_0x3c994e){logger[_0x725e('0x2a')](_0x725e('0x53'),_0x3c994e);throw _0x3c994e;});}return _0x432285;})['then'](respondWithResult(_0x19f524,0xc9))[_0x725e('0x4a')](handleError(_0x19f524,null));};exports['update']=function(_0x20e3ec,_0x41a343){if(_0x20e3ec['body']['id']){delete _0x20e3ec[_0x725e('0x4c')]['id'];}return db['ContactItemType'][_0x725e('0x49')]({'where':{'id':_0x20e3ec[_0x725e('0x54')]['id']}})[_0x725e('0x26')](handleEntityNotFound(_0x41a343,null))['then'](saveUpdates(_0x20e3ec[_0x725e('0x4c')],null))[_0x725e('0x26')](respondWithResult(_0x41a343,null))[_0x725e('0x4a')](handleError(_0x41a343,null));};exports[_0x725e('0x27')]=function(_0x2afb6e,_0x19c780){return db[_0x725e('0x2e')][_0x725e('0x49')]({'where':{'id':_0x2afb6e['params']['id']}})[_0x725e('0x26')](handleEntityNotFound(_0x19c780,null))[_0x725e('0x26')](db['CmContactHasItem']['update']({'ItemTypeId':null},{'where':{'ItemTypeId':_0x2afb6e[_0x725e('0x54')]['id']}}))[_0x725e('0x26')](removeEntity(_0x19c780,null))['catch'](handleError(_0x19c780,null));}; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.model.js b/server/api/contactItemType/contactItemType.model.js index e6eb0d3..e01a210 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 _0x987e=['define','lodash','util','api','moment','bluebird','request-promise','path','rimraf','exports'];(function(_0x3b16fd,_0x2c3089){var _0x196171=function(_0x43105f){while(--_0x43105f){_0x3b16fd['push'](_0x3b16fd['shift']());}};_0x196171(++_0x2c3089);}(_0x987e,0x8d));var _0xe987=function(_0x18b7e3,_0x538aee){_0x18b7e3=_0x18b7e3-0x0;var _0x17f0f7=_0x987e[_0x18b7e3];return _0x17f0f7;};'use strict';var _=require(_0xe987('0x0'));var util=require(_0xe987('0x1'));var logger=require('../../config/logger')(_0xe987('0x2'));var moment=require(_0xe987('0x3'));var BPromise=require(_0xe987('0x4'));var rp=require(_0xe987('0x5'));var fs=require('fs');var path=require(_0xe987('0x6'));var rimraf=require(_0xe987('0x7'));var config=require('../../config/environment');var attributes=require('./contactItemType.attributes');module[_0xe987('0x8')]=function(_0x45a6d5,_0x220b6f){return _0x45a6d5[_0xe987('0x9')]('ContactItemType',attributes,{'tableName':'tools_contact_item_types','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x33e7=['lodash','util','../../config/logger','api','moment','rimraf','../../config/environment','./contactItemType.attributes','define','ContactItemType','tools_contact_item_types'];(function(_0x3586ab,_0x163a70){var _0xda7bc5=function(_0x74f380){while(--_0x74f380){_0x3586ab['push'](_0x3586ab['shift']());}};_0xda7bc5(++_0x163a70);}(_0x33e7,0x6e));var _0x733e=function(_0x5dc962,_0x234cd4){_0x5dc962=_0x5dc962-0x0;var _0x13dbb3=_0x33e7[_0x5dc962];return _0x13dbb3;};'use strict';var _=require(_0x733e('0x0'));var util=require(_0x733e('0x1'));var logger=require(_0x733e('0x2'))(_0x733e('0x3'));var moment=require(_0x733e('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x733e('0x5'));var config=require(_0x733e('0x6'));var attributes=require(_0x733e('0x7'));module['exports']=function(_0x24f2d0,_0x6a9a7a){return _0x24f2d0[_0x733e('0x8')](_0x733e('0x9'),attributes,{'tableName':_0x733e('0xa'),'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 a55fd45..54d5610 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 _0x2902=['then','info','request\x20sent','debug','ContactItemType,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ContactItemType,\x20%s,\x20%s','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x31cb5f,_0x2df766){var _0x586042=function(_0x53c807){while(--_0x53c807){_0x31cb5f['push'](_0x31cb5f['shift']());}};_0x586042(++_0x2df766);}(_0x2902,0xc1));var _0x2290=function(_0x3b711c,_0x4b22dc){_0x3b711c=_0x3b711c-0x0;var _0x2685f0=_0x2902[_0x3b711c];return _0x2685f0;};'use strict';var _=require(_0x2290('0x0'));var util=require(_0x2290('0x1'));var moment=require(_0x2290('0x2'));var BPromise=require(_0x2290('0x3'));var rs=require(_0x2290('0x4'));var fs=require('fs');var Redis=require(_0x2290('0x5'));var db=require(_0x2290('0x6'))['db'];var utils=require(_0x2290('0x7'));var logger=require(_0x2290('0x8'))(_0x2290('0x9'));var config=require(_0x2290('0xa'));var jayson=require(_0x2290('0xb'));var client=jayson[_0x2290('0xc')][_0x2290('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x9db2ed,_0x2f7844,_0x33394d){return new BPromise(function(_0x212d1a,_0x1144e6){return client[_0x2290('0xe')](_0x9db2ed,_0x33394d)[_0x2290('0xf')](function(_0x5c2a99){logger[_0x2290('0x10')]('ContactItemType,\x20%s,\x20%s',_0x2f7844,_0x2290('0x11'));logger[_0x2290('0x12')](_0x2290('0x13'),_0x2f7844,_0x2290('0x11'),JSON[_0x2290('0x14')](_0x5c2a99));if(_0x5c2a99[_0x2290('0x15')]){if(_0x5c2a99[_0x2290('0x15')][_0x2290('0x16')]===0x1f4){logger[_0x2290('0x15')]('ContactItemType,\x20%s,\x20%s',_0x2f7844,_0x5c2a99[_0x2290('0x15')][_0x2290('0x17')]);return _0x1144e6(_0x5c2a99['error'][_0x2290('0x17')]);}logger[_0x2290('0x15')](_0x2290('0x18'),_0x2f7844,_0x5c2a99[_0x2290('0x15')][_0x2290('0x17')]);return _0x212d1a(_0x5c2a99[_0x2290('0x15')][_0x2290('0x17')]);}else{logger[_0x2290('0x10')](_0x2290('0x18'),_0x2f7844,_0x2290('0x11'));_0x212d1a(_0x5c2a99[_0x2290('0x19')][_0x2290('0x17')]);}})['catch'](function(_0x2d6a63){logger['error'](_0x2290('0x18'),_0x2f7844,_0x2d6a63);_0x1144e6(_0x2d6a63);});});} \ No newline at end of file +var _0xb5f8=['moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','info','ContactItemType,\x20%s,\x20%s','request\x20sent','ContactItemType,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util'];(function(_0x26e312,_0x4c0fed){var _0x3d73ce=function(_0x41e646){while(--_0x41e646){_0x26e312['push'](_0x26e312['shift']());}};_0x3d73ce(++_0x4c0fed);}(_0xb5f8,0x88));var _0x8b5f=function(_0x4f365b,_0x5350da){_0x4f365b=_0x4f365b-0x0;var _0x1a6c4b=_0xb5f8[_0x4f365b];return _0x1a6c4b;};'use strict';var _=require(_0x8b5f('0x0'));var util=require(_0x8b5f('0x1'));var moment=require(_0x8b5f('0x2'));var BPromise=require(_0x8b5f('0x3'));var rs=require(_0x8b5f('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8b5f('0x5'))['db'];var utils=require(_0x8b5f('0x6'));var logger=require('../../config/logger')(_0x8b5f('0x7'));var config=require(_0x8b5f('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x8b5f('0x9')][_0x8b5f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4d3b72,_0x56d7a2,_0x25111a){return new BPromise(function(_0x1b48e1,_0x2a348d){return client[_0x8b5f('0xb')](_0x4d3b72,_0x25111a)[_0x8b5f('0xc')](function(_0x5be920){logger[_0x8b5f('0xd')](_0x8b5f('0xe'),_0x56d7a2,_0x8b5f('0xf'));logger['debug'](_0x8b5f('0x10'),_0x56d7a2,_0x8b5f('0xf'),JSON[_0x8b5f('0x11')](_0x5be920));if(_0x5be920[_0x8b5f('0x12')]){if(_0x5be920[_0x8b5f('0x12')][_0x8b5f('0x13')]===0x1f4){logger[_0x8b5f('0x12')](_0x8b5f('0xe'),_0x56d7a2,_0x5be920[_0x8b5f('0x12')][_0x8b5f('0x14')]);return _0x2a348d(_0x5be920[_0x8b5f('0x12')]['message']);}logger[_0x8b5f('0x12')](_0x8b5f('0xe'),_0x56d7a2,_0x5be920['error']['message']);return _0x1b48e1(_0x5be920[_0x8b5f('0x12')][_0x8b5f('0x14')]);}else{logger[_0x8b5f('0xd')](_0x8b5f('0xe'),_0x56d7a2,'request\x20sent');_0x1b48e1(_0x5be920[_0x8b5f('0x15')][_0x8b5f('0x14')]);}})[_0x8b5f('0x16')](function(_0x4d4ff4){logger['error'](_0x8b5f('0xe'),_0x56d7a2,_0x4d4ff4);_0x2a348d(_0x4d4ff4);});});} \ No newline at end of file diff --git a/server/api/contactItemType/index.js b/server/api/contactItemType/index.js index f20e73a..e3eb866 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 _0xd2c0=['../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','create','put','update','destroy','exports','util','path','connect-timeout','express','fs-extra'];(function(_0x515265,_0x3dd312){var _0x3c8c8e=function(_0x373bd1){while(--_0x373bd1){_0x515265['push'](_0x515265['shift']());}};_0x3c8c8e(++_0x3dd312);}(_0xd2c0,0xb9));var _0x0d2c=function(_0xc297b5,_0x2d8a9b){_0xc297b5=_0xc297b5-0x0;var _0x58557e=_0xd2c0[_0xc297b5];return _0x58557e;};'use strict';var multer=require('multer');var util=require(_0x0d2c('0x0'));var path=require(_0x0d2c('0x1'));var timeout=require(_0x0d2c('0x2'));var express=require(_0x0d2c('0x3'));var router=express['Router']();var fs_extra=require(_0x0d2c('0x4'));var auth=require(_0x0d2c('0x5'));var interaction=require(_0x0d2c('0x6'));var config=require(_0x0d2c('0x7'));var controller=require('./contactItemType.controller');router[_0x0d2c('0x8')]('/',auth[_0x0d2c('0x9')](),controller[_0x0d2c('0xa')]);router[_0x0d2c('0x8')](_0x0d2c('0xb'),auth[_0x0d2c('0x9')](),controller[_0x0d2c('0xc')]);router[_0x0d2c('0xd')]('/',auth[_0x0d2c('0x9')](),controller[_0x0d2c('0xe')]);router[_0x0d2c('0xf')](_0x0d2c('0xb'),auth[_0x0d2c('0x9')](),controller[_0x0d2c('0x10')]);router['delete'](_0x0d2c('0xb'),auth[_0x0d2c('0x9')](),controller[_0x0d2c('0x11')]);module[_0x0d2c('0x12')]=router; \ No newline at end of file +var _0x5442=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./contactItemType.controller','get','isAuthenticated','index','show','post','create','put','update','delete','/:id','exports'];(function(_0x2e16d6,_0x38143b){var _0x204614=function(_0x50d187){while(--_0x50d187){_0x2e16d6['push'](_0x2e16d6['shift']());}};_0x204614(++_0x38143b);}(_0x5442,0xdc));var _0x2544=function(_0x5a3cf0,_0x160a68){_0x5a3cf0=_0x5a3cf0-0x0;var _0x5a64ee=_0x5442[_0x5a3cf0];return _0x5a64ee;};'use strict';var multer=require('multer');var util=require(_0x2544('0x0'));var path=require(_0x2544('0x1'));var timeout=require(_0x2544('0x2'));var express=require(_0x2544('0x3'));var router=express[_0x2544('0x4')]();var fs_extra=require(_0x2544('0x5'));var auth=require(_0x2544('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x2544('0x7'));var controller=require(_0x2544('0x8'));router[_0x2544('0x9')]('/',auth[_0x2544('0xa')](),controller[_0x2544('0xb')]);router[_0x2544('0x9')]('/:id',auth[_0x2544('0xa')](),controller[_0x2544('0xc')]);router[_0x2544('0xd')]('/',auth[_0x2544('0xa')](),controller[_0x2544('0xe')]);router[_0x2544('0xf')]('/:id',auth[_0x2544('0xa')](),controller[_0x2544('0x10')]);router[_0x2544('0x11')](_0x2544('0x12'),auth['isAuthenticated'](),controller['destroy']);module[_0x2544('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 7961b27..6fbec09 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 _0xb10b=['name','sequelize','STRING'];(function(_0xf0f4be,_0x2ed641){var _0x7c39d4=function(_0x1f306b){while(--_0x1f306b){_0xf0f4be['push'](_0xf0f4be['shift']());}};_0x7c39d4(++_0x2ed641);}(_0xb10b,0x12a));var _0xbb10=function(_0x3daa8c,_0x388a87){_0x3daa8c=_0x3daa8c-0x0;var _0x2b1bd7=_0xb10b[_0x3daa8c];return _0x2b1bd7;};'use strict';var Sequelize=require(_0xbb10('0x0'));module['exports']={'name':{'type':Sequelize[_0xbb10('0x1')],'allowNull':![],'unique':_0xbb10('0x2')},'description':{'type':Sequelize[_0xbb10('0x1')]}}; \ No newline at end of file +var _0x757a=['exports','STRING'];(function(_0x4aeff5,_0x451270){var _0x3e0dc7=function(_0x49ae0b){while(--_0x49ae0b){_0x4aeff5['push'](_0x4aeff5['shift']());}};_0x3e0dc7(++_0x451270);}(_0x757a,0xde));var _0xa757=function(_0x2467c8,_0xce4b38){_0x2467c8=_0x2467c8-0x0;var _0x17ab5c=_0x757a[_0x2467c8];return _0x17ab5c;};'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 2e1730e..bf87ce4 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 _0x88e8=['attrUrl','attrs','value','https://','custom','attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','attrChannel','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','attrSerie1','attrSerie2','attrSerie3','voice','web-report','attrReport','attrRefresh','widgetAttributes:\x20%s','stringify','DashboardId','DashboardItem','getItems','findOne','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','sox','ejs','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./dashboard.socket','register','sendStatus','status','offset','limit','undefined','count','set','Content-Range','json','apply','reject','save','update','destroy','then','get','CustomDashboards','UserProfileResource','end','error','stack','name','send','index','Dashboard','rawAttributes','type','key','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','params','keys','length','include','find','catch','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','createdAt','updatedAt','omit','body','iframe'];(function(_0x206d9f,_0x458951){var _0x52c471=function(_0x239055){while(--_0x239055){_0x206d9f['push'](_0x206d9f['shift']());}};_0x52c471(++_0x458951);}(_0x88e8,0x124));var _0x888e=function(_0x1c16a4,_0xbba97c){_0x1c16a4=_0x1c16a4-0x0;var _0xa47eb7=_0x88e8[_0x1c16a4];return _0xa47eb7;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x888e('0x0'));var zipdir=require(_0x888e('0x1'));var jsonpatch=require(_0x888e('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x888e('0x3'));var Mustache=require(_0x888e('0x4'));var util=require(_0x888e('0x5'));var path=require('path');var sox=require(_0x888e('0x6'));var csv=require('to-csv');var ejs=require(_0x888e('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x888e('0x8'));var toCsv=require(_0x888e('0x9'));var querystring=require(_0x888e('0xa'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x888e('0xb'));var qs=require(_0x888e('0xc'));var as=require(_0x888e('0xd'));var hardwareService=require(_0x888e('0xe'));var logger=require(_0x888e('0xf'))(_0x888e('0x10'));var utils=require(_0x888e('0x11'));var config=require(_0x888e('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0x888e('0x13'))['db'];config['redis']=_[_0x888e('0x14')](config[_0x888e('0x15')],{'host':_0x888e('0x16'),'port':0x18eb});var socket=require(_0x888e('0x17'))(new Redis(config['redis']));require(_0x888e('0x18'))[_0x888e('0x19')](socket);function respondWithStatusCode(_0x3e17de,_0x3a9cb0){_0x3a9cb0=_0x3a9cb0||0xcc;return function(_0x3e2205){if(_0x3e2205){return _0x3e17de[_0x888e('0x1a')](_0x3a9cb0);}return _0x3e17de[_0x888e('0x1b')](_0x3a9cb0)['end']();};}function respondWithResult(_0x2d0ffc,_0x191c43){_0x191c43=_0x191c43||0xc8;return function(_0x1a532a){if(_0x1a532a){return _0x2d0ffc['status'](_0x191c43)['json'](_0x1a532a);}};}function respondWithFilteredResult(_0x3b0f1f,_0x2dcf3b){return function(_0x51301f){if(_0x51301f){var _0x1c3397=typeof _0x2dcf3b[_0x888e('0x1c')]==='undefined'&&typeof _0x2dcf3b[_0x888e('0x1d')]===_0x888e('0x1e');var _0x5340ba=_0x51301f[_0x888e('0x1f')];var _0x2b8a65=_0x1c3397?0x0:_0x2dcf3b[_0x888e('0x1c')];var _0x29d626=_0x1c3397?_0x51301f['count']:_0x2dcf3b['offset']+_0x2dcf3b['limit'];var _0x2bae1d;if(_0x29d626>=_0x5340ba){_0x29d626=_0x5340ba;_0x2bae1d=0xc8;}else{_0x2bae1d=0xce;}_0x3b0f1f[_0x888e('0x1b')](_0x2bae1d);return _0x3b0f1f[_0x888e('0x20')](_0x888e('0x21'),_0x2b8a65+'-'+_0x29d626+'/'+_0x5340ba)[_0x888e('0x22')](_0x51301f);}return null;};}function patchUpdates(_0x40bf3e){return function(_0x33cac){try{jsonpatch[_0x888e('0x23')](_0x33cac,_0x40bf3e,!![]);}catch(_0x411297){return BPromise[_0x888e('0x24')](_0x411297);}return _0x33cac[_0x888e('0x25')]();};}function saveUpdates(_0x4a5a31,_0x11c253){return function(_0x1faa64){if(_0x1faa64){return _0x1faa64[_0x888e('0x26')](_0x4a5a31)['then'](function(_0x3ee761){return _0x3ee761;});}return null;};}function removeEntity(_0x122e5e,_0x554823){return function(_0x3cf67b){if(_0x3cf67b){return _0x3cf67b[_0x888e('0x27')]()[_0x888e('0x28')](function(){var _0x3de8fc=_0x3cf67b[_0x888e('0x29')]({'plain':!![]});var _0x400913=_0x888e('0x2a');return db[_0x888e('0x2b')][_0x888e('0x27')]({'where':{'type':_0x400913,'resourceId':_0x3de8fc['id']}})[_0x888e('0x28')](function(){return _0x3cf67b;});})[_0x888e('0x28')](function(){_0x122e5e[_0x888e('0x1b')](0xcc)[_0x888e('0x2c')]();});}};}function handleEntityNotFound(_0x48e347,_0x36117b){return function(_0x37255d){if(!_0x37255d){_0x48e347[_0x888e('0x1a')](0x194);}return _0x37255d;};}function handleError(_0x3bc2eb,_0xe8c94d){_0xe8c94d=_0xe8c94d||0x1f4;return function(_0xcb953e){logger[_0x888e('0x2d')](_0xcb953e[_0x888e('0x2e')]);if(_0xcb953e[_0x888e('0x2f')]){delete _0xcb953e['name'];}_0x3bc2eb[_0x888e('0x1b')](_0xe8c94d)[_0x888e('0x30')](_0xcb953e);};}exports[_0x888e('0x31')]=function(_0x394b98,_0x2e35be){var _0x143a62={},_0x23da47={},_0x7af7b6={'count':0x0,'rows':[]};var _0x5a2d2d=_['map'](db[_0x888e('0x32')][_0x888e('0x33')],function(_0x2d3967){return{'name':_0x2d3967['fieldName'],'type':_0x2d3967[_0x888e('0x34')][_0x888e('0x35')]};});_0x23da47[_0x888e('0x36')]=_[_0x888e('0x37')](_0x5a2d2d,_0x888e('0x2f'));_0x23da47[_0x888e('0x38')]=_['keys'](_0x394b98[_0x888e('0x38')]);_0x23da47[_0x888e('0x39')]=_[_0x888e('0x3a')](_0x23da47['model'],_0x23da47[_0x888e('0x38')]);_0x143a62[_0x888e('0x3b')]=_[_0x888e('0x3a')](_0x23da47['model'],qs[_0x888e('0x3c')](_0x394b98[_0x888e('0x38')][_0x888e('0x3c')]));_0x143a62['attributes']=_0x143a62[_0x888e('0x3b')]['length']?_0x143a62['attributes']:_0x23da47[_0x888e('0x36')];if(!_0x394b98[_0x888e('0x38')][_0x888e('0x3d')](_0x888e('0x3e'))){_0x143a62[_0x888e('0x1d')]=qs[_0x888e('0x1d')](_0x394b98[_0x888e('0x38')]['limit']);_0x143a62[_0x888e('0x1c')]=qs[_0x888e('0x1c')](_0x394b98[_0x888e('0x38')]['offset']);}_0x143a62[_0x888e('0x3f')]=qs[_0x888e('0x40')](_0x394b98['query'][_0x888e('0x40')]);_0x143a62[_0x888e('0x41')]=qs[_0x888e('0x39')](_[_0x888e('0x42')](_0x394b98[_0x888e('0x38')],_0x23da47[_0x888e('0x39')]),_0x5a2d2d);if(_0x394b98[_0x888e('0x38')][_0x888e('0x43')]){_0x143a62[_0x888e('0x41')]=_[_0x888e('0x44')](_0x143a62['where'],{'$or':_[_0x888e('0x37')](_0x5a2d2d,function(_0x4d6d0c){if(_0x4d6d0c[_0x888e('0x34')]!==_0x888e('0x45')){var _0x2dec77={};_0x2dec77[_0x4d6d0c[_0x888e('0x2f')]]={'$like':'%'+_0x394b98[_0x888e('0x38')]['filter']+'%'};return _0x2dec77;}})});}_0x143a62=_[_0x888e('0x44')]({},_0x143a62,_0x394b98[_0x888e('0x46')]);var _0x4930c9={'where':_0x143a62[_0x888e('0x41')]};return db[_0x888e('0x32')][_0x888e('0x1f')](_0x4930c9)['then'](function(_0x597201){_0x7af7b6['count']=_0x597201;if(_0x394b98[_0x888e('0x38')][_0x888e('0x47')]){_0x143a62['include']=[{'all':!![]}];}return db[_0x888e('0x32')][_0x888e('0x48')](_0x143a62);})[_0x888e('0x28')](function(_0x68c782){_0x7af7b6['rows']=_0x68c782;return _0x7af7b6;})[_0x888e('0x28')](respondWithFilteredResult(_0x2e35be,_0x143a62))['catch'](handleError(_0x2e35be,null));};exports['show']=function(_0x5209bc,_0xe6521f){var _0x3990f4={'raw':![],'where':{'id':_0x5209bc[_0x888e('0x49')]['id']}},_0x42989f={};_0x42989f[_0x888e('0x36')]=_[_0x888e('0x4a')](db[_0x888e('0x32')][_0x888e('0x33')]);_0x42989f['query']=_[_0x888e('0x4a')](_0x5209bc['query']);_0x42989f[_0x888e('0x39')]=_[_0x888e('0x3a')](_0x42989f[_0x888e('0x36')],_0x42989f[_0x888e('0x38')]);_0x3990f4[_0x888e('0x3b')]=_[_0x888e('0x3a')](_0x42989f['model'],qs['fields'](_0x5209bc['query'][_0x888e('0x3c')]));_0x3990f4[_0x888e('0x3b')]=_0x3990f4[_0x888e('0x3b')][_0x888e('0x4b')]?_0x3990f4[_0x888e('0x3b')]:_0x42989f[_0x888e('0x36')];if(_0x5209bc['query'][_0x888e('0x47')]){_0x3990f4[_0x888e('0x4c')]=[{'all':!![]}];}_0x3990f4=_[_0x888e('0x44')]({},_0x3990f4,_0x5209bc[_0x888e('0x46')]);return db[_0x888e('0x32')][_0x888e('0x4d')](_0x3990f4)[_0x888e('0x28')](handleEntityNotFound(_0xe6521f,null))[_0x888e('0x28')](respondWithResult(_0xe6521f,null))[_0x888e('0x4e')](handleError(_0xe6521f,null));};exports['create']=function(_0x1da8f1,_0x202ead){return db[_0x888e('0x32')]['create'](_0x1da8f1['body'],{})[_0x888e('0x28')](function(_0x13b129){var _0x1b25da=_0x1da8f1[_0x888e('0x4f')][_0x888e('0x29')]({'plain':!![]});if(!_0x1b25da)throw new Error(_0x888e('0x50'));if(_0x1b25da[_0x888e('0x51')]===_0x888e('0x4f')){var _0x465c1c=_0x13b129[_0x888e('0x29')]({'plain':!![]});var _0x3909dc=_0x888e('0x2a');return db[_0x888e('0x52')][_0x888e('0x4d')]({'where':{'name':_0x3909dc,'userProfileId':_0x1b25da[_0x888e('0x53')]},'raw':!![]})[_0x888e('0x28')](function(_0x59d9d2){if(_0x59d9d2&&_0x59d9d2[_0x888e('0x54')]===0x0){return db['UserProfileResource'][_0x888e('0x55')]({'name':_0x465c1c[_0x888e('0x2f')],'resourceId':_0x465c1c['id'],'type':_0x59d9d2['name'],'sectionId':_0x59d9d2['id']},{})[_0x888e('0x28')](function(){return _0x13b129;});}else{return _0x13b129;}})['catch'](function(_0x49ed3c){logger[_0x888e('0x2d')](_0x888e('0x56'),_0x49ed3c);throw _0x49ed3c;});}return _0x13b129;})[_0x888e('0x28')](respondWithResult(_0x202ead,0xc9))['catch'](handleError(_0x202ead,null));};exports['clone']=function(_0x46e2e4,_0x22b198){var _0x2c860a={'where':{'id':_0x46e2e4[_0x888e('0x49')]['id']}},_0x520cfe={};_0x520cfe['model']=_['keys'](db[_0x888e('0x32')]['rawAttributes']);_0x2c860a['attributes']=_[_0x888e('0x3a')](_0x520cfe[_0x888e('0x36')],qs[_0x888e('0x3c')](_0x46e2e4[_0x888e('0x38')][_0x888e('0x3c')]));_0x2c860a[_0x888e('0x3b')]=_0x2c860a['attributes'][_0x888e('0x4b')]?_0x2c860a['attributes']:_0x520cfe[_0x888e('0x36')];if(_0x46e2e4[_0x888e('0x38')]['includeAll']){_0x2c860a[_0x888e('0x4c')]=[{'all':!![]}];}_0x2c860a=_[_0x888e('0x44')]({},_0x2c860a,_0x46e2e4[_0x888e('0x46')]);return db[_0x888e('0x32')][_0x888e('0x4d')](_0x2c860a)[_0x888e('0x28')](handleEntityNotFound(_0x22b198,null))[_0x888e('0x28')](function(_0x6ad9bd){if(_0x6ad9bd){var _0x569a51=_0x6ad9bd[_0x888e('0x29')]({'plain':!![]});_0x569a51=qs['omit'](_0x569a51,['id',_0x888e('0x57'),_0x888e('0x58')]);_0x46e2e4['body']=_[_0x888e('0x59')](_0x46e2e4[_0x888e('0x5a')],['id','createdAt',_0x888e('0x58')]);return db[_0x888e('0x32')][_0x888e('0x55')](_[_0x888e('0x44')](_0x569a51,_0x46e2e4[_0x888e('0x5a')]),{'include':_0x46e2e4['query'][_0x888e('0x47')]?[{'all':!![]}]:undefined})[_0x888e('0x28')](function(_0x10effa){var _0x52ddec=_0x46e2e4[_0x888e('0x4f')][_0x888e('0x29')]({'plain':!![]});if(!_0x52ddec)throw new Error(_0x888e('0x50'));if(_0x52ddec[_0x888e('0x51')]===_0x888e('0x4f')){var _0x430566=_0x10effa[_0x888e('0x29')]({'plain':!![]});var _0x400d5c=_0x888e('0x2a');return db[_0x888e('0x52')][_0x888e('0x4d')]({'where':{'name':_0x400d5c,'userProfileId':_0x52ddec[_0x888e('0x53')]},'raw':!![]})[_0x888e('0x28')](function(_0x3e846f){if(_0x3e846f&&_0x3e846f[_0x888e('0x54')]===0x0){return db[_0x888e('0x2b')][_0x888e('0x55')]({'name':_0x430566['name'],'resourceId':_0x430566['id'],'type':_0x3e846f[_0x888e('0x2f')],'sectionId':_0x3e846f['id']},{})['then'](function(){return _0x10effa;});}else{return _0x10effa;}})['catch'](function(_0xdcbe86){logger['error'](_0x888e('0x56'),_0xdcbe86);throw _0xdcbe86;});}return _0x10effa;});}})[_0x888e('0x28')](respondWithResult(_0x22b198,0xc9))[_0x888e('0x4e')](handleError(_0x22b198,null));};exports['update']=function(_0x862d38,_0x2eb807){if(_0x862d38[_0x888e('0x5a')]['id']){delete _0x862d38['body']['id'];}return db[_0x888e('0x32')][_0x888e('0x4d')]({'where':{'id':_0x862d38[_0x888e('0x49')]['id']}})[_0x888e('0x28')](handleEntityNotFound(_0x2eb807,null))[_0x888e('0x28')](saveUpdates(_0x862d38[_0x888e('0x5a')],null))[_0x888e('0x28')](respondWithResult(_0x2eb807,null))[_0x888e('0x4e')](handleError(_0x2eb807,null));};exports[_0x888e('0x27')]=function(_0x4a513c,_0x1fe386){return db['Dashboard'][_0x888e('0x4d')]({'where':{'id':_0x4a513c[_0x888e('0x49')]['id']}})[_0x888e('0x28')](handleEntityNotFound(_0x1fe386,null))[_0x888e('0x28')](removeEntity(_0x1fe386,null))[_0x888e('0x4e')](handleError(_0x1fe386,null));};function widgetAttributes(_0x113822){try{switch(_0x113822['type']){case _0x888e('0x5b'):return[{'name':'attrUrl','value':_0x113822[_0x888e('0x5c')]||(_0x113822[_0x888e('0x5d')]&&_0x113822[_0x888e('0x5d')][0x0]?_0x113822[_0x888e('0x5d')][0x0][_0x888e('0x5e')]:undefined)||_0x888e('0x5f')}];case _0x888e('0x60'):return[{'name':'attrPath','value':_0x113822[_0x888e('0x61')]||(_0x113822[_0x888e('0x5d')]&&_0x113822['attrs'][0x0]?_0x113822[_0x888e('0x5d')][0x0][_0x888e('0x5e')]:undefined)||''}];case _0x888e('0x62'):return[{'name':_0x888e('0x63'),'value':_0x113822['attrHourFormat']||(_0x113822[_0x888e('0x5d')]&&_0x113822[_0x888e('0x5d')][0x0]?_0x113822[_0x888e('0x5d')][0x0][_0x888e('0x5e')]:undefined)||_0x888e('0x64')},{'name':'attrTimezone','value':_0x113822[_0x888e('0x65')]||(_0x113822[_0x888e('0x5d')]&&_0x113822[_0x888e('0x5d')][0x1]?_0x113822[_0x888e('0x5d')][0x1][_0x888e('0x5e')]:undefined)||_0x888e('0x66')},{'name':_0x888e('0x67'),'value':_0x113822[_0x888e('0x67')]||(_0x113822[_0x888e('0x5d')]&&_0x113822[_0x888e('0x5d')][0x2]?_0x113822[_0x888e('0x5d')][0x2][_0x888e('0x5e')]:undefined)||0xc}];case _0x888e('0x68'):return[{'name':_0x888e('0x69'),'value':_0x113822[_0x888e('0x69')]||(_0x113822[_0x888e('0x5d')]&&_0x113822[_0x888e('0x5d')][0x0]?_0x113822[_0x888e('0x5d')][0x0]['value']:undefined)||_0x888e('0x6a')},{'name':_0x888e('0x6b'),'value':_0x113822[_0x888e('0x6b')]||(_0x113822[_0x888e('0x5d')]&&_0x113822[_0x888e('0x5d')][0x1]?_0x113822['attrs'][0x1]['value']:undefined)||[]},{'name':_0x888e('0x67'),'value':_0x113822['attrFontSize']||(_0x113822[_0x888e('0x5d')]&&_0x113822[_0x888e('0x5d')][0x2]?_0x113822[_0x888e('0x5d')][0x2][_0x888e('0x5e')]:undefined)||0x14},{'name':_0x888e('0x6c'),'value':_0x113822[_0x888e('0x6c')]||(_0x113822[_0x888e('0x5d')]&&_0x113822[_0x888e('0x5d')][0x3]?_0x113822[_0x888e('0x5d')][0x3]['value']:undefined)||'voice'},{'name':_0x888e('0x6d'),'value':_0x113822[_0x888e('0x6d')]||(_0x113822[_0x888e('0x5d')]&&_0x113822[_0x888e('0x5d')][0x4]?_0x113822['attrs'][0x4][_0x888e('0x5e')]:undefined)||''},{'name':_0x888e('0x6e'),'value':_0x113822[_0x888e('0x6e')]||(_0x113822[_0x888e('0x5d')]&&_0x113822[_0x888e('0x5d')][0x5]?_0x113822['attrs'][0x5][_0x888e('0x5e')]:undefined)||''},{'name':_0x888e('0x6f'),'value':_0x113822[_0x888e('0x6f')]||(_0x113822[_0x888e('0x5d')]&&_0x113822[_0x888e('0x5d')][0x6]?_0x113822[_0x888e('0x5d')][0x6][_0x888e('0x5e')]:undefined)||''},{'name':_0x888e('0x70'),'value':_0x113822[_0x888e('0x70')]||(_0x113822[_0x888e('0x5d')]&&_0x113822['attrs'][0x7]?_0x113822[_0x888e('0x5d')][0x7][_0x888e('0x5e')]:undefined)||''},{'name':_0x888e('0x71'),'value':_0x113822[_0x888e('0x71')]||(_0x113822[_0x888e('0x5d')]&&_0x113822[_0x888e('0x5d')][0x8]?_0x113822[_0x888e('0x5d')][0x8][_0x888e('0x5e')]:undefined)||''},{'name':_0x888e('0x72'),'value':_0x113822[_0x888e('0x72')]||(_0x113822[_0x888e('0x5d')]&&_0x113822[_0x888e('0x5d')][0x9]?_0x113822[_0x888e('0x5d')][0x9][_0x888e('0x5e')]:undefined)||''}];case'multibar-chart':case'pie-chart':return[{'name':_0x888e('0x73'),'value':_0x113822[_0x888e('0x73')]||(_0x113822[_0x888e('0x5d')]&&_0x113822['attrs'][0x0]?_0x113822[_0x888e('0x5d')][0x0][_0x888e('0x5e')]:undefined)||_0x888e('0x6a')},{'name':_0x888e('0x74'),'value':_0x113822[_0x888e('0x74')]||(_0x113822['attrs']&&_0x113822[_0x888e('0x5d')][0x1]?_0x113822['attrs'][0x1][_0x888e('0x5e')]:undefined)||null},{'name':_0x888e('0x75'),'value':_0x113822['attrSerie3']||(_0x113822[_0x888e('0x5d')]&&_0x113822[_0x888e('0x5d')][0x2]?_0x113822[_0x888e('0x5d')][0x2]['value']:undefined)||null},{'name':_0x888e('0x6b'),'value':_0x113822[_0x888e('0x6b')]||(_0x113822[_0x888e('0x5d')]&&_0x113822[_0x888e('0x5d')][0x3]?_0x113822[_0x888e('0x5d')][0x3][_0x888e('0x5e')]:undefined)||[]},{'name':'attrChannel','value':_0x113822[_0x888e('0x6c')]||(_0x113822[_0x888e('0x5d')]&&_0x113822[_0x888e('0x5d')][0x4]?_0x113822['attrs'][0x4]['value']:undefined)||_0x888e('0x76')},{'name':_0x888e('0x6d'),'value':_0x113822[_0x888e('0x6d')]||(_0x113822[_0x888e('0x5d')]&&_0x113822[_0x888e('0x5d')][0x5]?_0x113822[_0x888e('0x5d')][0x5][_0x888e('0x5e')]:undefined)||''},{'name':_0x888e('0x6e'),'value':_0x113822['attrFaxAccounts']||(_0x113822[_0x888e('0x5d')]&&_0x113822[_0x888e('0x5d')][0x6]?_0x113822[_0x888e('0x5d')][0x6][_0x888e('0x5e')]:undefined)||''},{'name':'attrSmsAccounts','value':_0x113822[_0x888e('0x6f')]||(_0x113822[_0x888e('0x5d')]&&_0x113822['attrs'][0x7]?_0x113822[_0x888e('0x5d')][0x7]['value']:undefined)||''},{'name':_0x888e('0x70'),'value':_0x113822[_0x888e('0x70')]||(_0x113822[_0x888e('0x5d')]&&_0x113822[_0x888e('0x5d')][0x8]?_0x113822[_0x888e('0x5d')][0x8][_0x888e('0x5e')]:undefined)||''},{'name':'attrWhatsappAccounts','value':_0x113822[_0x888e('0x71')]||(_0x113822[_0x888e('0x5d')]&&_0x113822['attrs'][0x9]?_0x113822[_0x888e('0x5d')][0x9][_0x888e('0x5e')]:undefined)||''},{'name':'attrChatWebsites','value':_0x113822[_0x888e('0x72')]||(_0x113822[_0x888e('0x5d')]&&_0x113822[_0x888e('0x5d')][0xa]?_0x113822[_0x888e('0x5d')][0xa][_0x888e('0x5e')]:undefined)||''}];case _0x888e('0x77'):return[{'name':_0x888e('0x78'),'type':_0x113822['reportType']||(_0x113822[_0x888e('0x5d')]&&_0x113822['attrs'][0x0]?_0x113822[_0x888e('0x5d')][0x0][_0x888e('0x34')]:undefined)||null,'value':_0x113822[_0x888e('0x78')]||(_0x113822[_0x888e('0x5d')]&&_0x113822[_0x888e('0x5d')][0x0]?_0x113822['attrs'][0x0]['value']:undefined)||null},{'name':_0x888e('0x79'),'value':_0x113822['attrRefresh']||(_0x113822[_0x888e('0x5d')]&&_0x113822[_0x888e('0x5d')][0x1]?_0x113822['attrs'][0x1]['value']:undefined)||0x0}];default:return[];}}catch(_0x2fb526){logger[_0x888e('0x2d')](_0x888e('0x7a'),JSON[_0x888e('0x7b')](_0x2fb526));return[];}}exports['addItem']=function(_0x437f67,_0x1b1873,_0x1b91c7){if(_0x437f67[_0x888e('0x5a')]['id']){delete _0x437f67[_0x888e('0x5a')]['id'];}return db['Dashboard'][_0x888e('0x4d')]({'where':{'id':_0x437f67['params']['id']}})['then'](handleEntityNotFound(_0x1b1873,null))[_0x888e('0x28')](function(_0x50c60f){if(_0x50c60f){_0x437f67[_0x888e('0x5a')][_0x888e('0x7c')]=_0x50c60f['id'];_0x437f67[_0x888e('0x5a')][_0x888e('0x5d')]=widgetAttributes(_0x437f67[_0x888e('0x5a')]);return db[_0x888e('0x7d')][_0x888e('0x55')](_0x437f67[_0x888e('0x5a')]);}})[_0x888e('0x28')](respondWithResult(_0x1b1873,null))[_0x888e('0x4e')](handleError(_0x1b1873,null));};exports[_0x888e('0x7e')]=function(_0x2e4d12,_0x32c6d4,_0x3d0a07){var _0x17f2ec={};var _0x5c2d19={};var _0x2240cb;var _0x38253a;return db[_0x888e('0x32')][_0x888e('0x7f')]({'where':{'id':_0x2e4d12[_0x888e('0x49')]['id']}})[_0x888e('0x28')](handleEntityNotFound(_0x32c6d4,null))[_0x888e('0x28')](function(_0x21f045){if(_0x21f045){_0x2240cb=_0x21f045;_0x5c2d19['model']=_[_0x888e('0x4a')](db[_0x888e('0x7d')][_0x888e('0x33')]);_0x5c2d19['query']=_['keys'](_0x2e4d12[_0x888e('0x38')]);_0x5c2d19[_0x888e('0x39')]=_[_0x888e('0x3a')](_0x5c2d19[_0x888e('0x36')],_0x5c2d19[_0x888e('0x38')]);_0x17f2ec['attributes']=_['intersection'](_0x5c2d19[_0x888e('0x36')],qs['fields'](_0x2e4d12['query'][_0x888e('0x3c')]));_0x17f2ec[_0x888e('0x3b')]=_0x17f2ec[_0x888e('0x3b')][_0x888e('0x4b')]?_0x17f2ec[_0x888e('0x3b')]:_0x5c2d19[_0x888e('0x36')];_0x17f2ec['order']=qs[_0x888e('0x40')](_0x2e4d12['query'][_0x888e('0x40')]);_0x17f2ec[_0x888e('0x41')]=qs['filters'](_[_0x888e('0x42')](_0x2e4d12[_0x888e('0x38')],_0x5c2d19['filters']));if(_0x2e4d12['query'][_0x888e('0x43')]){_0x17f2ec[_0x888e('0x41')]=_[_0x888e('0x44')](_0x17f2ec[_0x888e('0x41')],{'$or':_['map'](_0x17f2ec[_0x888e('0x3b')],function(_0x23487b){var _0x174227={};_0x174227[_0x23487b]={'$like':'%'+_0x2e4d12[_0x888e('0x38')][_0x888e('0x43')]+'%'};return _0x174227;})});}_0x17f2ec=_[_0x888e('0x44')]({},_0x17f2ec,_0x2e4d12[_0x888e('0x46')]);return _0x2240cb[_0x888e('0x7e')](_0x17f2ec);}})[_0x888e('0x28')](function(_0x5456ab){if(_0x5456ab){_0x38253a=_0x5456ab[_0x888e('0x4b')];if(!_0x2e4d12[_0x888e('0x38')][_0x888e('0x3d')](_0x888e('0x3e'))){_0x17f2ec['limit']=qs[_0x888e('0x1d')](_0x2e4d12['query'][_0x888e('0x1d')]);_0x17f2ec[_0x888e('0x1c')]=qs[_0x888e('0x1c')](_0x2e4d12[_0x888e('0x38')]['offset']);}return _0x2240cb[_0x888e('0x7e')](_0x17f2ec);}})[_0x888e('0x28')](function(_0x42c8d3){if(_0x42c8d3){return _0x42c8d3?{'count':_0x38253a,'rows':_0x42c8d3}:null;}})['then'](respondWithResult(_0x32c6d4,null))[_0x888e('0x4e')](handleError(_0x32c6d4,null));}; \ No newline at end of file +var _0x278f=['bluebird','mustache','util','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./dashboard.socket','sendStatus','end','json','undefined','limit','count','offset','status','set','Content-Range','apply','save','update','then','destroy','get','CustomDashboards','UserProfileResource','error','name','send','index','map','Dashboard','rawAttributes','fieldName','key','model','query','keys','intersection','fields','length','attributes','hasOwnProperty','where','filters','pick','filter','merge','type','VIRTUAL','includeAll','include','catch','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','options','omit','createdAt','updatedAt','iframe','attrUrl','attrs','value','https://','custom','attrPath','clock','attrHourFormat','attrTimezone','0.00','attrFontSize','attrMetric','attrVoiceQueues','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','pie-chart','attrSerie1','attrSerie3','web-report','attrReport','reportType','attrRefresh','addItem','DashboardItem','findOne','sort','getItems','eml-format','rimraf','zip-dir','fast-json-patch','moment'];(function(_0x4953da,_0x5adaca){var _0x2d3780=function(_0x458f36){while(--_0x458f36){_0x4953da['push'](_0x4953da['shift']());}};_0x2d3780(++_0x5adaca);}(_0x278f,0xf3));var _0xf278=function(_0x4741a1,_0x2a1408){_0x4741a1=_0x4741a1-0x0;var _0x528c90=_0x278f[_0x4741a1];return _0x528c90;};'use strict';var emlformat=require(_0xf278('0x0'));var rimraf=require(_0xf278('0x1'));var zipdir=require(_0xf278('0x2'));var jsonpatch=require(_0xf278('0x3'));var rp=require('request-promise');var moment=require(_0xf278('0x4'));var BPromise=require(_0xf278('0x5'));var Mustache=require(_0xf278('0x6'));var util=require(_0xf278('0x7'));var path=require('path');var sox=require(_0xf278('0x8'));var csv=require(_0xf278('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf278('0xa'));var _=require(_0xf278('0xb'));var squel=require(_0xf278('0xc'));var crypto=require('crypto');var jsforce=require(_0xf278('0xd'));var deskjs=require(_0xf278('0xe'));var toCsv=require(_0xf278('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xf278('0xf'));var authService=require(_0xf278('0x10'));var qs=require(_0xf278('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf278('0x12'));var logger=require('../../config/logger')(_0xf278('0x13'));var utils=require(_0xf278('0x14'));var config=require(_0xf278('0x15'));var licenseUtil=require(_0xf278('0x16'));var db=require(_0xf278('0x17'))['db'];config[_0xf278('0x18')]=_[_0xf278('0x19')](config[_0xf278('0x18')],{'host':_0xf278('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf278('0x18')]));require(_0xf278('0x1b'))['register'](socket);function respondWithStatusCode(_0xca067b,_0x31c901){_0x31c901=_0x31c901||0xcc;return function(_0x12431d){if(_0x12431d){return _0xca067b[_0xf278('0x1c')](_0x31c901);}return _0xca067b['status'](_0x31c901)[_0xf278('0x1d')]();};}function respondWithResult(_0xf2d8fb,_0x46979c){_0x46979c=_0x46979c||0xc8;return function(_0x4b44a2){if(_0x4b44a2){return _0xf2d8fb['status'](_0x46979c)[_0xf278('0x1e')](_0x4b44a2);}};}function respondWithFilteredResult(_0x15bb98,_0x5648bf){return function(_0x12f8d){if(_0x12f8d){var _0x1f68c0=typeof _0x5648bf['offset']===_0xf278('0x1f')&&typeof _0x5648bf[_0xf278('0x20')]==='undefined';var _0x14a5e6=_0x12f8d[_0xf278('0x21')];var _0x4009a3=_0x1f68c0?0x0:_0x5648bf[_0xf278('0x22')];var _0x4163fd=_0x1f68c0?_0x12f8d[_0xf278('0x21')]:_0x5648bf[_0xf278('0x22')]+_0x5648bf[_0xf278('0x20')];var _0x511bf9;if(_0x4163fd>=_0x14a5e6){_0x4163fd=_0x14a5e6;_0x511bf9=0xc8;}else{_0x511bf9=0xce;}_0x15bb98[_0xf278('0x23')](_0x511bf9);return _0x15bb98[_0xf278('0x24')](_0xf278('0x25'),_0x4009a3+'-'+_0x4163fd+'/'+_0x14a5e6)[_0xf278('0x1e')](_0x12f8d);}return null;};}function patchUpdates(_0x55c827){return function(_0x45bbec){try{jsonpatch[_0xf278('0x26')](_0x45bbec,_0x55c827,!![]);}catch(_0x1f0edf){return BPromise['reject'](_0x1f0edf);}return _0x45bbec[_0xf278('0x27')]();};}function saveUpdates(_0x46a422,_0x2d1c55){return function(_0x53723c){if(_0x53723c){return _0x53723c[_0xf278('0x28')](_0x46a422)[_0xf278('0x29')](function(_0x39061c){return _0x39061c;});}return null;};}function removeEntity(_0x1c331c,_0x4cb142){return function(_0x35c885){if(_0x35c885){return _0x35c885[_0xf278('0x2a')]()[_0xf278('0x29')](function(){var _0x53af80=_0x35c885[_0xf278('0x2b')]({'plain':!![]});var _0x3e6add=_0xf278('0x2c');return db[_0xf278('0x2d')]['destroy']({'where':{'type':_0x3e6add,'resourceId':_0x53af80['id']}})[_0xf278('0x29')](function(){return _0x35c885;});})['then'](function(){_0x1c331c[_0xf278('0x23')](0xcc)['end']();});}};}function handleEntityNotFound(_0x26576e,_0x138792){return function(_0x1ce853){if(!_0x1ce853){_0x26576e['sendStatus'](0x194);}return _0x1ce853;};}function handleError(_0x3d9816,_0x2a780c){_0x2a780c=_0x2a780c||0x1f4;return function(_0x8874c3){logger[_0xf278('0x2e')](_0x8874c3['stack']);if(_0x8874c3['name']){delete _0x8874c3[_0xf278('0x2f')];}_0x3d9816[_0xf278('0x23')](_0x2a780c)[_0xf278('0x30')](_0x8874c3);};}exports[_0xf278('0x31')]=function(_0x1ebe98,_0x2b5c16){var _0x1ae53d={},_0xd29252={},_0x22fc1e={'count':0x0,'rows':[]};var _0x552b85=_[_0xf278('0x32')](db[_0xf278('0x33')][_0xf278('0x34')],function(_0x5140e8){return{'name':_0x5140e8[_0xf278('0x35')],'type':_0x5140e8['type'][_0xf278('0x36')]};});_0xd29252[_0xf278('0x37')]=_[_0xf278('0x32')](_0x552b85,_0xf278('0x2f'));_0xd29252[_0xf278('0x38')]=_[_0xf278('0x39')](_0x1ebe98[_0xf278('0x38')]);_0xd29252['filters']=_['intersection'](_0xd29252['model'],_0xd29252[_0xf278('0x38')]);_0x1ae53d['attributes']=_[_0xf278('0x3a')](_0xd29252[_0xf278('0x37')],qs['fields'](_0x1ebe98['query'][_0xf278('0x3b')]));_0x1ae53d['attributes']=_0x1ae53d['attributes'][_0xf278('0x3c')]?_0x1ae53d[_0xf278('0x3d')]:_0xd29252[_0xf278('0x37')];if(!_0x1ebe98[_0xf278('0x38')][_0xf278('0x3e')]('nolimit')){_0x1ae53d[_0xf278('0x20')]=qs[_0xf278('0x20')](_0x1ebe98[_0xf278('0x38')][_0xf278('0x20')]);_0x1ae53d[_0xf278('0x22')]=qs[_0xf278('0x22')](_0x1ebe98[_0xf278('0x38')][_0xf278('0x22')]);}_0x1ae53d['order']=qs['sort'](_0x1ebe98[_0xf278('0x38')]['sort']);_0x1ae53d[_0xf278('0x3f')]=qs[_0xf278('0x40')](_[_0xf278('0x41')](_0x1ebe98[_0xf278('0x38')],_0xd29252['filters']),_0x552b85);if(_0x1ebe98['query'][_0xf278('0x42')]){_0x1ae53d[_0xf278('0x3f')]=_[_0xf278('0x43')](_0x1ae53d[_0xf278('0x3f')],{'$or':_[_0xf278('0x32')](_0x552b85,function(_0x30702b){if(_0x30702b[_0xf278('0x44')]!==_0xf278('0x45')){var _0x42f834={};_0x42f834[_0x30702b[_0xf278('0x2f')]]={'$like':'%'+_0x1ebe98[_0xf278('0x38')][_0xf278('0x42')]+'%'};return _0x42f834;}})});}_0x1ae53d=_['merge']({},_0x1ae53d,_0x1ebe98['options']);var _0x5673ce={'where':_0x1ae53d['where']};return db[_0xf278('0x33')][_0xf278('0x21')](_0x5673ce)['then'](function(_0x2a0e6c){_0x22fc1e[_0xf278('0x21')]=_0x2a0e6c;if(_0x1ebe98['query'][_0xf278('0x46')]){_0x1ae53d[_0xf278('0x47')]=[{'all':!![]}];}return db[_0xf278('0x33')]['findAll'](_0x1ae53d);})[_0xf278('0x29')](function(_0x50581b){_0x22fc1e['rows']=_0x50581b;return _0x22fc1e;})[_0xf278('0x29')](respondWithFilteredResult(_0x2b5c16,_0x1ae53d))[_0xf278('0x48')](handleError(_0x2b5c16,null));};exports[_0xf278('0x49')]=function(_0x361a99,_0x4934df){var _0x64c49d={'raw':![],'where':{'id':_0x361a99[_0xf278('0x4a')]['id']}},_0x382177={};_0x382177[_0xf278('0x37')]=_['keys'](db['Dashboard']['rawAttributes']);_0x382177[_0xf278('0x38')]=_[_0xf278('0x39')](_0x361a99['query']);_0x382177[_0xf278('0x40')]=_['intersection'](_0x382177[_0xf278('0x37')],_0x382177[_0xf278('0x38')]);_0x64c49d[_0xf278('0x3d')]=_['intersection'](_0x382177[_0xf278('0x37')],qs[_0xf278('0x3b')](_0x361a99[_0xf278('0x38')][_0xf278('0x3b')]));_0x64c49d[_0xf278('0x3d')]=_0x64c49d['attributes'][_0xf278('0x3c')]?_0x64c49d[_0xf278('0x3d')]:_0x382177[_0xf278('0x37')];if(_0x361a99['query']['includeAll']){_0x64c49d[_0xf278('0x47')]=[{'all':!![]}];}_0x64c49d=_['merge']({},_0x64c49d,_0x361a99['options']);return db[_0xf278('0x33')][_0xf278('0x4b')](_0x64c49d)['then'](handleEntityNotFound(_0x4934df,null))[_0xf278('0x29')](respondWithResult(_0x4934df,null))[_0xf278('0x48')](handleError(_0x4934df,null));};exports['create']=function(_0x33aab9,_0x3c4f67){return db[_0xf278('0x33')][_0xf278('0x4c')](_0x33aab9[_0xf278('0x4d')],{})[_0xf278('0x29')](function(_0x2c0ac3){var _0x24a031=_0x33aab9[_0xf278('0x4e')][_0xf278('0x2b')]({'plain':!![]});if(!_0x24a031)throw new Error(_0xf278('0x4f'));if(_0x24a031[_0xf278('0x50')]===_0xf278('0x4e')){var _0x28a9d4=_0x2c0ac3[_0xf278('0x2b')]({'plain':!![]});var _0x4ad5f6=_0xf278('0x2c');return db[_0xf278('0x51')][_0xf278('0x4b')]({'where':{'name':_0x4ad5f6,'userProfileId':_0x24a031[_0xf278('0x52')]},'raw':!![]})[_0xf278('0x29')](function(_0x38c938){if(_0x38c938&&_0x38c938[_0xf278('0x53')]===0x0){return db[_0xf278('0x2d')][_0xf278('0x4c')]({'name':_0x28a9d4[_0xf278('0x2f')],'resourceId':_0x28a9d4['id'],'type':_0x38c938['name'],'sectionId':_0x38c938['id']},{})[_0xf278('0x29')](function(){return _0x2c0ac3;});}else{return _0x2c0ac3;}})['catch'](function(_0x492f10){logger['error'](_0xf278('0x54'),_0x492f10);throw _0x492f10;});}return _0x2c0ac3;})[_0xf278('0x29')](respondWithResult(_0x3c4f67,0xc9))[_0xf278('0x48')](handleError(_0x3c4f67,null));};exports[_0xf278('0x55')]=function(_0x3eafa1,_0x2d8938){var _0x2ab1f3={'where':{'id':_0x3eafa1['params']['id']}},_0x513b7c={};_0x513b7c[_0xf278('0x37')]=_[_0xf278('0x39')](db[_0xf278('0x33')][_0xf278('0x34')]);_0x2ab1f3['attributes']=_[_0xf278('0x3a')](_0x513b7c['model'],qs[_0xf278('0x3b')](_0x3eafa1[_0xf278('0x38')][_0xf278('0x3b')]));_0x2ab1f3[_0xf278('0x3d')]=_0x2ab1f3[_0xf278('0x3d')]['length']?_0x2ab1f3[_0xf278('0x3d')]:_0x513b7c[_0xf278('0x37')];if(_0x3eafa1['query'][_0xf278('0x46')]){_0x2ab1f3[_0xf278('0x47')]=[{'all':!![]}];}_0x2ab1f3=_[_0xf278('0x43')]({},_0x2ab1f3,_0x3eafa1[_0xf278('0x56')]);return db[_0xf278('0x33')]['find'](_0x2ab1f3)[_0xf278('0x29')](handleEntityNotFound(_0x2d8938,null))[_0xf278('0x29')](function(_0x826358){if(_0x826358){var _0x30620d=_0x826358[_0xf278('0x2b')]({'plain':!![]});_0x30620d=qs[_0xf278('0x57')](_0x30620d,['id',_0xf278('0x58'),_0xf278('0x59')]);_0x3eafa1[_0xf278('0x4d')]=_[_0xf278('0x57')](_0x3eafa1['body'],['id',_0xf278('0x58'),_0xf278('0x59')]);return db[_0xf278('0x33')][_0xf278('0x4c')](_[_0xf278('0x43')](_0x30620d,_0x3eafa1[_0xf278('0x4d')]),{'include':_0x3eafa1[_0xf278('0x38')][_0xf278('0x46')]?[{'all':!![]}]:undefined})[_0xf278('0x29')](function(_0x9f7a55){var _0xc04a9e=_0x3eafa1[_0xf278('0x4e')]['get']({'plain':!![]});if(!_0xc04a9e)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xc04a9e['role']==='user'){var _0x31fd0f=_0x9f7a55[_0xf278('0x2b')]({'plain':!![]});var _0x5f16de=_0xf278('0x2c');return db[_0xf278('0x51')][_0xf278('0x4b')]({'where':{'name':_0x5f16de,'userProfileId':_0xc04a9e['userProfileId']},'raw':!![]})[_0xf278('0x29')](function(_0x32920e){if(_0x32920e&&_0x32920e[_0xf278('0x53')]===0x0){return db[_0xf278('0x2d')][_0xf278('0x4c')]({'name':_0x31fd0f[_0xf278('0x2f')],'resourceId':_0x31fd0f['id'],'type':_0x32920e[_0xf278('0x2f')],'sectionId':_0x32920e['id']},{})[_0xf278('0x29')](function(){return _0x9f7a55;});}else{return _0x9f7a55;}})[_0xf278('0x48')](function(_0x455d95){logger[_0xf278('0x2e')](_0xf278('0x54'),_0x455d95);throw _0x455d95;});}return _0x9f7a55;});}})[_0xf278('0x29')](respondWithResult(_0x2d8938,0xc9))['catch'](handleError(_0x2d8938,null));};exports['update']=function(_0xed2000,_0x5d11e8){if(_0xed2000[_0xf278('0x4d')]['id']){delete _0xed2000[_0xf278('0x4d')]['id'];}return db['Dashboard'][_0xf278('0x4b')]({'where':{'id':_0xed2000[_0xf278('0x4a')]['id']}})[_0xf278('0x29')](handleEntityNotFound(_0x5d11e8,null))[_0xf278('0x29')](saveUpdates(_0xed2000[_0xf278('0x4d')],null))[_0xf278('0x29')](respondWithResult(_0x5d11e8,null))[_0xf278('0x48')](handleError(_0x5d11e8,null));};exports['destroy']=function(_0x4a7e6d,_0x28c3eb){return db[_0xf278('0x33')][_0xf278('0x4b')]({'where':{'id':_0x4a7e6d[_0xf278('0x4a')]['id']}})['then'](handleEntityNotFound(_0x28c3eb,null))[_0xf278('0x29')](removeEntity(_0x28c3eb,null))[_0xf278('0x48')](handleError(_0x28c3eb,null));};function widgetAttributes(_0x40cb8f){try{switch(_0x40cb8f['type']){case _0xf278('0x5a'):return[{'name':_0xf278('0x5b'),'value':_0x40cb8f['attrUrl']||(_0x40cb8f['attrs']&&_0x40cb8f['attrs'][0x0]?_0x40cb8f[_0xf278('0x5c')][0x0][_0xf278('0x5d')]:undefined)||_0xf278('0x5e')}];case _0xf278('0x5f'):return[{'name':_0xf278('0x60'),'value':_0x40cb8f[_0xf278('0x60')]||(_0x40cb8f[_0xf278('0x5c')]&&_0x40cb8f['attrs'][0x0]?_0x40cb8f[_0xf278('0x5c')][0x0][_0xf278('0x5d')]:undefined)||''}];case _0xf278('0x61'):return[{'name':_0xf278('0x62'),'value':_0x40cb8f['attrHourFormat']||(_0x40cb8f[_0xf278('0x5c')]&&_0x40cb8f[_0xf278('0x5c')][0x0]?_0x40cb8f[_0xf278('0x5c')][0x0][_0xf278('0x5d')]:undefined)||'HH:mm:ss'},{'name':'attrTimezone','value':_0x40cb8f[_0xf278('0x63')]||(_0x40cb8f['attrs']&&_0x40cb8f['attrs'][0x1]?_0x40cb8f[_0xf278('0x5c')][0x1]['value']:undefined)||_0xf278('0x64')},{'name':_0xf278('0x65'),'value':_0x40cb8f[_0xf278('0x65')]||(_0x40cb8f[_0xf278('0x5c')]&&_0x40cb8f['attrs'][0x2]?_0x40cb8f[_0xf278('0x5c')][0x2]['value']:undefined)||0xc}];case'counter':return[{'name':_0xf278('0x66'),'value':_0x40cb8f[_0xf278('0x66')]||(_0x40cb8f[_0xf278('0x5c')]&&_0x40cb8f[_0xf278('0x5c')][0x0]?_0x40cb8f[_0xf278('0x5c')][0x0]['value']:undefined)||'total'},{'name':_0xf278('0x67'),'value':_0x40cb8f[_0xf278('0x67')]||(_0x40cb8f[_0xf278('0x5c')]&&_0x40cb8f[_0xf278('0x5c')][0x1]?_0x40cb8f[_0xf278('0x5c')][0x1][_0xf278('0x5d')]:undefined)||[]},{'name':_0xf278('0x65'),'value':_0x40cb8f['attrFontSize']||(_0x40cb8f['attrs']&&_0x40cb8f[_0xf278('0x5c')][0x2]?_0x40cb8f[_0xf278('0x5c')][0x2][_0xf278('0x5d')]:undefined)||0x14},{'name':_0xf278('0x68'),'value':_0x40cb8f[_0xf278('0x68')]||(_0x40cb8f[_0xf278('0x5c')]&&_0x40cb8f[_0xf278('0x5c')][0x3]?_0x40cb8f[_0xf278('0x5c')][0x3][_0xf278('0x5d')]:undefined)||_0xf278('0x69')},{'name':_0xf278('0x6a'),'value':_0x40cb8f[_0xf278('0x6a')]||(_0x40cb8f[_0xf278('0x5c')]&&_0x40cb8f[_0xf278('0x5c')][0x4]?_0x40cb8f[_0xf278('0x5c')][0x4][_0xf278('0x5d')]:undefined)||''},{'name':_0xf278('0x6b'),'value':_0x40cb8f[_0xf278('0x6b')]||(_0x40cb8f['attrs']&&_0x40cb8f[_0xf278('0x5c')][0x5]?_0x40cb8f[_0xf278('0x5c')][0x5][_0xf278('0x5d')]:undefined)||''},{'name':_0xf278('0x6c'),'value':_0x40cb8f[_0xf278('0x6c')]||(_0x40cb8f[_0xf278('0x5c')]&&_0x40cb8f[_0xf278('0x5c')][0x6]?_0x40cb8f['attrs'][0x6][_0xf278('0x5d')]:undefined)||''},{'name':_0xf278('0x6d'),'value':_0x40cb8f[_0xf278('0x6d')]||(_0x40cb8f[_0xf278('0x5c')]&&_0x40cb8f[_0xf278('0x5c')][0x7]?_0x40cb8f['attrs'][0x7][_0xf278('0x5d')]:undefined)||''},{'name':_0xf278('0x6e'),'value':_0x40cb8f[_0xf278('0x6e')]||(_0x40cb8f['attrs']&&_0x40cb8f[_0xf278('0x5c')][0x8]?_0x40cb8f['attrs'][0x8][_0xf278('0x5d')]:undefined)||''},{'name':_0xf278('0x6f'),'value':_0x40cb8f[_0xf278('0x6f')]||(_0x40cb8f[_0xf278('0x5c')]&&_0x40cb8f[_0xf278('0x5c')][0x9]?_0x40cb8f['attrs'][0x9][_0xf278('0x5d')]:undefined)||''}];case'multibar-chart':case _0xf278('0x70'):return[{'name':_0xf278('0x71'),'value':_0x40cb8f[_0xf278('0x71')]||(_0x40cb8f[_0xf278('0x5c')]&&_0x40cb8f[_0xf278('0x5c')][0x0]?_0x40cb8f[_0xf278('0x5c')][0x0][_0xf278('0x5d')]:undefined)||'total'},{'name':'attrSerie2','value':_0x40cb8f['attrSerie2']||(_0x40cb8f[_0xf278('0x5c')]&&_0x40cb8f[_0xf278('0x5c')][0x1]?_0x40cb8f[_0xf278('0x5c')][0x1][_0xf278('0x5d')]:undefined)||null},{'name':_0xf278('0x72'),'value':_0x40cb8f[_0xf278('0x72')]||(_0x40cb8f['attrs']&&_0x40cb8f['attrs'][0x2]?_0x40cb8f[_0xf278('0x5c')][0x2]['value']:undefined)||null},{'name':_0xf278('0x67'),'value':_0x40cb8f[_0xf278('0x67')]||(_0x40cb8f[_0xf278('0x5c')]&&_0x40cb8f[_0xf278('0x5c')][0x3]?_0x40cb8f[_0xf278('0x5c')][0x3]['value']:undefined)||[]},{'name':_0xf278('0x68'),'value':_0x40cb8f[_0xf278('0x68')]||(_0x40cb8f[_0xf278('0x5c')]&&_0x40cb8f[_0xf278('0x5c')][0x4]?_0x40cb8f[_0xf278('0x5c')][0x4]['value']:undefined)||_0xf278('0x69')},{'name':_0xf278('0x6a'),'value':_0x40cb8f['attrEmailAccounts']||(_0x40cb8f[_0xf278('0x5c')]&&_0x40cb8f[_0xf278('0x5c')][0x5]?_0x40cb8f['attrs'][0x5][_0xf278('0x5d')]:undefined)||''},{'name':_0xf278('0x6b'),'value':_0x40cb8f[_0xf278('0x6b')]||(_0x40cb8f['attrs']&&_0x40cb8f[_0xf278('0x5c')][0x6]?_0x40cb8f[_0xf278('0x5c')][0x6][_0xf278('0x5d')]:undefined)||''},{'name':_0xf278('0x6c'),'value':_0x40cb8f[_0xf278('0x6c')]||(_0x40cb8f[_0xf278('0x5c')]&&_0x40cb8f[_0xf278('0x5c')][0x7]?_0x40cb8f[_0xf278('0x5c')][0x7][_0xf278('0x5d')]:undefined)||''},{'name':_0xf278('0x6d'),'value':_0x40cb8f[_0xf278('0x6d')]||(_0x40cb8f[_0xf278('0x5c')]&&_0x40cb8f[_0xf278('0x5c')][0x8]?_0x40cb8f[_0xf278('0x5c')][0x8][_0xf278('0x5d')]:undefined)||''},{'name':_0xf278('0x6e'),'value':_0x40cb8f['attrWhatsappAccounts']||(_0x40cb8f[_0xf278('0x5c')]&&_0x40cb8f[_0xf278('0x5c')][0x9]?_0x40cb8f['attrs'][0x9]['value']:undefined)||''},{'name':_0xf278('0x6f'),'value':_0x40cb8f['attrChatWebsites']||(_0x40cb8f[_0xf278('0x5c')]&&_0x40cb8f[_0xf278('0x5c')][0xa]?_0x40cb8f[_0xf278('0x5c')][0xa][_0xf278('0x5d')]:undefined)||''}];case _0xf278('0x73'):return[{'name':_0xf278('0x74'),'type':_0x40cb8f[_0xf278('0x75')]||(_0x40cb8f[_0xf278('0x5c')]&&_0x40cb8f[_0xf278('0x5c')][0x0]?_0x40cb8f['attrs'][0x0]['type']:undefined)||null,'value':_0x40cb8f[_0xf278('0x74')]||(_0x40cb8f[_0xf278('0x5c')]&&_0x40cb8f[_0xf278('0x5c')][0x0]?_0x40cb8f[_0xf278('0x5c')][0x0][_0xf278('0x5d')]:undefined)||null},{'name':_0xf278('0x76'),'value':_0x40cb8f['attrRefresh']||(_0x40cb8f[_0xf278('0x5c')]&&_0x40cb8f['attrs'][0x1]?_0x40cb8f[_0xf278('0x5c')][0x1][_0xf278('0x5d')]:undefined)||0x0}];default:return[];}}catch(_0x2e5e39){logger[_0xf278('0x2e')]('widgetAttributes:\x20%s',JSON['stringify'](_0x2e5e39));return[];}}exports[_0xf278('0x77')]=function(_0x7617ae,_0xd8438e,_0x10fd70){if(_0x7617ae[_0xf278('0x4d')]['id']){delete _0x7617ae[_0xf278('0x4d')]['id'];}return db[_0xf278('0x33')][_0xf278('0x4b')]({'where':{'id':_0x7617ae['params']['id']}})[_0xf278('0x29')](handleEntityNotFound(_0xd8438e,null))['then'](function(_0x710ffe){if(_0x710ffe){_0x7617ae['body']['DashboardId']=_0x710ffe['id'];_0x7617ae[_0xf278('0x4d')][_0xf278('0x5c')]=widgetAttributes(_0x7617ae[_0xf278('0x4d')]);return db[_0xf278('0x78')][_0xf278('0x4c')](_0x7617ae[_0xf278('0x4d')]);}})[_0xf278('0x29')](respondWithResult(_0xd8438e,null))[_0xf278('0x48')](handleError(_0xd8438e,null));};exports['getItems']=function(_0xfe8997,_0x36e20e,_0x1adbda){var _0x187182={};var _0x3f03aa={};var _0x4ddd8e;var _0x2d0823;return db[_0xf278('0x33')][_0xf278('0x79')]({'where':{'id':_0xfe8997['params']['id']}})[_0xf278('0x29')](handleEntityNotFound(_0x36e20e,null))[_0xf278('0x29')](function(_0x111765){if(_0x111765){_0x4ddd8e=_0x111765;_0x3f03aa[_0xf278('0x37')]=_[_0xf278('0x39')](db[_0xf278('0x78')][_0xf278('0x34')]);_0x3f03aa['query']=_[_0xf278('0x39')](_0xfe8997[_0xf278('0x38')]);_0x3f03aa[_0xf278('0x40')]=_[_0xf278('0x3a')](_0x3f03aa[_0xf278('0x37')],_0x3f03aa[_0xf278('0x38')]);_0x187182['attributes']=_[_0xf278('0x3a')](_0x3f03aa[_0xf278('0x37')],qs[_0xf278('0x3b')](_0xfe8997[_0xf278('0x38')]['fields']));_0x187182['attributes']=_0x187182[_0xf278('0x3d')]['length']?_0x187182[_0xf278('0x3d')]:_0x3f03aa[_0xf278('0x37')];_0x187182['order']=qs[_0xf278('0x7a')](_0xfe8997[_0xf278('0x38')][_0xf278('0x7a')]);_0x187182[_0xf278('0x3f')]=qs[_0xf278('0x40')](_[_0xf278('0x41')](_0xfe8997[_0xf278('0x38')],_0x3f03aa[_0xf278('0x40')]));if(_0xfe8997['query']['filter']){_0x187182[_0xf278('0x3f')]=_[_0xf278('0x43')](_0x187182[_0xf278('0x3f')],{'$or':_[_0xf278('0x32')](_0x187182[_0xf278('0x3d')],function(_0x5be4f4){var _0xcb3d85={};_0xcb3d85[_0x5be4f4]={'$like':'%'+_0xfe8997[_0xf278('0x38')][_0xf278('0x42')]+'%'};return _0xcb3d85;})});}_0x187182=_['merge']({},_0x187182,_0xfe8997[_0xf278('0x56')]);return _0x4ddd8e[_0xf278('0x7b')](_0x187182);}})[_0xf278('0x29')](function(_0xd12fab){if(_0xd12fab){_0x2d0823=_0xd12fab[_0xf278('0x3c')];if(!_0xfe8997[_0xf278('0x38')]['hasOwnProperty']('nolimit')){_0x187182[_0xf278('0x20')]=qs['limit'](_0xfe8997[_0xf278('0x38')]['limit']);_0x187182[_0xf278('0x22')]=qs[_0xf278('0x22')](_0xfe8997[_0xf278('0x38')]['offset']);}return _0x4ddd8e[_0xf278('0x7b')](_0x187182);}})[_0xf278('0x29')](function(_0x56d397){if(_0x56d397){return _0x56d397?{'count':_0x2d0823,'rows':_0x56d397}:null;}})['then'](respondWithResult(_0x36e20e,null))[_0xf278('0x48')](handleError(_0x36e20e,null));}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.events.js b/server/api/dashboard/dashboard.events.js index 54a3b3c..89c0637 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 _0xae35=['events','../../mysqldb','Dashboard','setMaxListeners','save','update','remove','emit','hook','exports'];(function(_0x441819,_0x5b8d0a){var _0x478882=function(_0x369786){while(--_0x369786){_0x441819['push'](_0x441819['shift']());}};_0x478882(++_0x5b8d0a);}(_0xae35,0x172));var _0x5ae3=function(_0x2a464f,_0x530fdd){_0x2a464f=_0x2a464f-0x0;var _0x589d0f=_0xae35[_0x2a464f];return _0x589d0f;};'use strict';var EventEmitter=require(_0x5ae3('0x0'));var Dashboard=require(_0x5ae3('0x1'))['db'][_0x5ae3('0x2')];var DashboardEvents=new EventEmitter();DashboardEvents[_0x5ae3('0x3')](0x0);var events={'afterCreate':_0x5ae3('0x4'),'afterUpdate':_0x5ae3('0x5'),'afterDestroy':_0x5ae3('0x6')};function emitEvent(_0x39d9b7){return function(_0x54c0f2,_0x6dffe3,_0x4d1536){DashboardEvents[_0x5ae3('0x7')](_0x39d9b7+':'+_0x54c0f2['id'],_0x54c0f2);DashboardEvents[_0x5ae3('0x7')](_0x39d9b7,_0x54c0f2);_0x4d1536(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Dashboard[_0x5ae3('0x8')](e,emitEvent(event));}}module[_0x5ae3('0x9')]=DashboardEvents; \ No newline at end of file +var _0x8706=['../../mysqldb','Dashboard','setMaxListeners','save','update','emit','hasOwnProperty','hook','events'];(function(_0x33bc64,_0x4d1e92){var _0x3fdd34=function(_0x4b40a4){while(--_0x4b40a4){_0x33bc64['push'](_0x33bc64['shift']());}};_0x3fdd34(++_0x4d1e92);}(_0x8706,0x104));var _0x6870=function(_0x3cf868,_0x28a57a){_0x3cf868=_0x3cf868-0x0;var _0x104034=_0x8706[_0x3cf868];return _0x104034;};'use strict';var EventEmitter=require(_0x6870('0x0'));var Dashboard=require(_0x6870('0x1'))['db'][_0x6870('0x2')];var DashboardEvents=new EventEmitter();DashboardEvents[_0x6870('0x3')](0x0);var events={'afterCreate':_0x6870('0x4'),'afterUpdate':_0x6870('0x5'),'afterDestroy':'remove'};function emitEvent(_0x54f1dd){return function(_0x301a92,_0xaef3b8,_0x42decf){DashboardEvents[_0x6870('0x6')](_0x54f1dd+':'+_0x301a92['id'],_0x301a92);DashboardEvents[_0x6870('0x6')](_0x54f1dd,_0x301a92);_0x42decf(null);};}for(var e in events){if(events[_0x6870('0x7')](e)){var event=events[e];Dashboard[_0x6870('0x8')](e,emitEvent(event));}}module['exports']=DashboardEvents; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.model.js b/server/api/dashboard/dashboard.model.js index 255f505..99ba003 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 _0x1260=['api','moment','bluebird','request-promise','rimraf','../../config/environment','./dashboard.attributes','exports','define','lodash','util','../../config/logger'];(function(_0x2536d5,_0x446f14){var _0x4fe9d5=function(_0x52574a){while(--_0x52574a){_0x2536d5['push'](_0x2536d5['shift']());}};_0x4fe9d5(++_0x446f14);}(_0x1260,0x1d1));var _0x0126=function(_0x35aab8,_0x397578){_0x35aab8=_0x35aab8-0x0;var _0x496ce3=_0x1260[_0x35aab8];return _0x496ce3;};'use strict';var _=require(_0x0126('0x0'));var util=require(_0x0126('0x1'));var logger=require(_0x0126('0x2'))(_0x0126('0x3'));var moment=require(_0x0126('0x4'));var BPromise=require(_0x0126('0x5'));var rp=require(_0x0126('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0126('0x7'));var config=require(_0x0126('0x8'));var attributes=require(_0x0126('0x9'));module[_0x0126('0xa')]=function(_0x2ca503,_0x24b57c){return _0x2ca503[_0x0126('0xb')]('Dashboard',attributes,{'tableName':'dashboards','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3b19=['define','Dashboard','dashboards','lodash','util','moment','bluebird','path','rimraf','../../config/environment','./dashboard.attributes','exports'];(function(_0x1177d5,_0x22b649){var _0xc3ddc2=function(_0x43ff95){while(--_0x43ff95){_0x1177d5['push'](_0x1177d5['shift']());}};_0xc3ddc2(++_0x22b649);}(_0x3b19,0x1e3));var _0x93b1=function(_0x3bd26a,_0x5db531){_0x3bd26a=_0x3bd26a-0x0;var _0x40eb75=_0x3b19[_0x3bd26a];return _0x40eb75;};'use strict';var _=require(_0x93b1('0x0'));var util=require(_0x93b1('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x93b1('0x2'));var BPromise=require(_0x93b1('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x93b1('0x4'));var rimraf=require(_0x93b1('0x5'));var config=require(_0x93b1('0x6'));var attributes=require(_0x93b1('0x7'));module[_0x93b1('0x8')]=function(_0x493552,_0x3abf50){return _0x493552[_0x93b1('0x9')](_0x93b1('0xa'),attributes,{'tableName':_0x93b1('0xb'),'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 e4be25f..b92d945 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 _0x4fba=['debug','error','code','message','request\x20sent','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','./dashboard.socket','register','request','then','info','Dashboard,\x20%s,\x20%s'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x4fba,0x93));var _0xa4fb=function(_0x13361c,_0x445a72){_0x13361c=_0x13361c-0x0;var _0x5a8dd7=_0x4fba[_0x13361c];return _0x5a8dd7;};'use strict';var _=require(_0xa4fb('0x0'));var util=require(_0xa4fb('0x1'));var moment=require(_0xa4fb('0x2'));var BPromise=require(_0xa4fb('0x3'));var rs=require(_0xa4fb('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa4fb('0x5'))['db'];var utils=require(_0xa4fb('0x6'));var logger=require(_0xa4fb('0x7'))(_0xa4fb('0x8'));var config=require(_0xa4fb('0x9'));var jayson=require(_0xa4fb('0xa'));var client=jayson['client'][_0xa4fb('0xb')]({'port':0x232a});config[_0xa4fb('0xc')]=_[_0xa4fb('0xd')](config[_0xa4fb('0xc')],{'host':_0xa4fb('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xa4fb('0xf'))[_0xa4fb('0x10')](socket);function respondWithRpcPromise(_0x5e6477,_0x160877,_0x2568ab){return new BPromise(function(_0xba076d,_0x37db50){return client[_0xa4fb('0x11')](_0x5e6477,_0x2568ab)[_0xa4fb('0x12')](function(_0x12ccb3){logger[_0xa4fb('0x13')](_0xa4fb('0x14'),_0x160877,'request\x20sent');logger[_0xa4fb('0x15')]('Dashboard,\x20%s,\x20%s,\x20%s',_0x160877,'request\x20sent',JSON['stringify'](_0x12ccb3));if(_0x12ccb3[_0xa4fb('0x16')]){if(_0x12ccb3[_0xa4fb('0x16')][_0xa4fb('0x17')]===0x1f4){logger['error'](_0xa4fb('0x14'),_0x160877,_0x12ccb3[_0xa4fb('0x16')]['message']);return _0x37db50(_0x12ccb3[_0xa4fb('0x16')]['message']);}logger['error'](_0xa4fb('0x14'),_0x160877,_0x12ccb3[_0xa4fb('0x16')]['message']);return _0xba076d(_0x12ccb3['error'][_0xa4fb('0x18')]);}else{logger['info'](_0xa4fb('0x14'),_0x160877,_0xa4fb('0x19'));_0xba076d(_0x12ccb3[_0xa4fb('0x1a')][_0xa4fb('0x18')]);}})[_0xa4fb('0x1b')](function(_0xf9d8c5){logger[_0xa4fb('0x16')](_0xa4fb('0x14'),_0x160877,_0xf9d8c5);_0x37db50(_0xf9d8c5);});});} \ No newline at end of file +var _0x5282=['code','message','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./dashboard.socket','register','info','Dashboard,\x20%s,\x20%s','request\x20sent','debug','Dashboard,\x20%s,\x20%s,\x20%s','error'];(function(_0x55f8b4,_0x43f30d){var _0x2475f9=function(_0xdd6f4a){while(--_0xdd6f4a){_0x55f8b4['push'](_0x55f8b4['shift']());}};_0x2475f9(++_0x43f30d);}(_0x5282,0x111));var _0x2528=function(_0x58999b,_0xea4695){_0x58999b=_0x58999b-0x0;var _0x5efc3a=_0x5282[_0x58999b];return _0x5efc3a;};'use strict';var _=require(_0x2528('0x0'));var util=require('util');var moment=require(_0x2528('0x1'));var BPromise=require(_0x2528('0x2'));var rs=require(_0x2528('0x3'));var fs=require('fs');var Redis=require(_0x2528('0x4'));var db=require(_0x2528('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x2528('0x6'))(_0x2528('0x7'));var config=require(_0x2528('0x8'));var jayson=require(_0x2528('0x9'));var client=jayson[_0x2528('0xa')][_0x2528('0xb')]({'port':0x232a});config[_0x2528('0xc')]=_[_0x2528('0xd')](config['redis'],{'host':_0x2528('0xe'),'port':0x18eb});var socket=require(_0x2528('0xf'))(new Redis(config[_0x2528('0xc')]));require(_0x2528('0x10'))[_0x2528('0x11')](socket);function respondWithRpcPromise(_0xbd312f,_0x380a78,_0x52cb01){return new BPromise(function(_0x198dbd,_0x169ee4){return client['request'](_0xbd312f,_0x52cb01)['then'](function(_0x465362){logger[_0x2528('0x12')](_0x2528('0x13'),_0x380a78,_0x2528('0x14'));logger[_0x2528('0x15')](_0x2528('0x16'),_0x380a78,_0x2528('0x14'),JSON['stringify'](_0x465362));if(_0x465362['error']){if(_0x465362[_0x2528('0x17')][_0x2528('0x18')]===0x1f4){logger[_0x2528('0x17')](_0x2528('0x13'),_0x380a78,_0x465362[_0x2528('0x17')]['message']);return _0x169ee4(_0x465362[_0x2528('0x17')]['message']);}logger[_0x2528('0x17')](_0x2528('0x13'),_0x380a78,_0x465362[_0x2528('0x17')][_0x2528('0x19')]);return _0x198dbd(_0x465362[_0x2528('0x17')][_0x2528('0x19')]);}else{logger[_0x2528('0x12')](_0x2528('0x13'),_0x380a78,_0x2528('0x14'));_0x198dbd(_0x465362['result'][_0x2528('0x19')]);}})[_0x2528('0x1a')](function(_0x4194d3){logger[_0x2528('0x17')]('Dashboard,\x20%s,\x20%s',_0x380a78,_0x4194d3);_0x169ee4(_0x4194d3);});});} \ No newline at end of file diff --git a/server/api/dashboard/dashboard.socket.js b/server/api/dashboard/dashboard.socket.js index 8084eab..fff9d36 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 _0x1402=['remove','update','emit','register','length','dashboard:','./dashboard.events','save'];(function(_0x220343,_0xcd055d){var _0x1f7c6a=function(_0x35fd8f){while(--_0x35fd8f){_0x220343['push'](_0x220343['shift']());}};_0x1f7c6a(++_0xcd055d);}(_0x1402,0x176));var _0x2140=function(_0xb15182,_0x48d8fb){_0xb15182=_0xb15182-0x0;var _0x4a8749=_0x1402[_0xb15182];return _0x4a8749;};'use strict';var DashboardEvents=require(_0x2140('0x0'));var events=[_0x2140('0x1'),_0x2140('0x2'),_0x2140('0x3')];function createListener(_0x3c4636,_0xebcd6e){return function(_0x8b2445){_0xebcd6e[_0x2140('0x4')](_0x3c4636,_0x8b2445);};}function removeListener(_0x44e934,_0x35d0ba){return function(){DashboardEvents['removeListener'](_0x44e934,_0x35d0ba);};}exports[_0x2140('0x5')]=function(_0x296c37){for(var _0x8adccc=0x0,_0x2cd411=events[_0x2140('0x6')];_0x8adccc<_0x2cd411;_0x8adccc++){var _0x4fc5cc=events[_0x8adccc];var _0x39377e=createListener(_0x2140('0x7')+_0x4fc5cc,_0x296c37);DashboardEvents['on'](_0x4fc5cc,_0x39377e);}}; \ No newline at end of file +var _0xdb6e=['emit','removeListener','length','dashboard:','./dashboard.events','save'];(function(_0xd578cb,_0x2167a3){var _0x775533=function(_0x1c340d){while(--_0x1c340d){_0xd578cb['push'](_0xd578cb['shift']());}};_0x775533(++_0x2167a3);}(_0xdb6e,0x13c));var _0xedb6=function(_0x5405cc,_0x4fa564){_0x5405cc=_0x5405cc-0x0;var _0x367541=_0xdb6e[_0x5405cc];return _0x367541;};'use strict';var DashboardEvents=require(_0xedb6('0x0'));var events=[_0xedb6('0x1'),'remove','update'];function createListener(_0x55f68f,_0x447028){return function(_0x55dd6e){_0x447028[_0xedb6('0x2')](_0x55f68f,_0x55dd6e);};}function removeListener(_0x5c1766,_0x29871e){return function(){DashboardEvents[_0xedb6('0x3')](_0x5c1766,_0x29871e);};}exports['register']=function(_0x15797b){for(var _0x2929a1=0x0,_0x3044bb=events[_0xedb6('0x4')];_0x2929a1<_0x3044bb;_0x2929a1++){var _0x54fed8=events[_0x2929a1];var _0x412bb7=createListener(_0xedb6('0x5')+_0x54fed8,_0x15797b);DashboardEvents['on'](_0x54fed8,_0x412bb7);}}; \ No newline at end of file diff --git a/server/api/dashboard/index.js b/server/api/dashboard/index.js index 23cacf3..4bd7b6b 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 _0x4e24=['exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/:id/items','getItems','post','create','/:id/clone','addItem','put','update','delete','/:id'];(function(_0x288f5e,_0x205edd){var _0x476cc9=function(_0x796f53){while(--_0x796f53){_0x288f5e['push'](_0x288f5e['shift']());}};_0x476cc9(++_0x205edd);}(_0x4e24,0xe8));var _0x44e2=function(_0x262636,_0x2d3bb6){_0x262636=_0x262636-0x0;var _0x44c73b=_0x4e24[_0x262636];return _0x44c73b;};'use strict';var multer=require(_0x44e2('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x44e2('0x1'));var express=require(_0x44e2('0x2'));var router=express[_0x44e2('0x3')]();var fs_extra=require(_0x44e2('0x4'));var auth=require(_0x44e2('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x44e2('0x6'));var controller=require('./dashboard.controller');router[_0x44e2('0x7')]('/',auth[_0x44e2('0x8')](),controller[_0x44e2('0x9')]);router[_0x44e2('0x7')]('/:id',auth[_0x44e2('0x8')](),controller['show']);router[_0x44e2('0x7')](_0x44e2('0xa'),auth[_0x44e2('0x8')](),controller[_0x44e2('0xb')]);router[_0x44e2('0xc')]('/',auth[_0x44e2('0x8')](),controller[_0x44e2('0xd')]);router[_0x44e2('0xc')](_0x44e2('0xe'),auth[_0x44e2('0x8')](),controller['clone']);router[_0x44e2('0xc')](_0x44e2('0xa'),auth[_0x44e2('0x8')](),controller[_0x44e2('0xf')]);router[_0x44e2('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x44e2('0x11')]);router[_0x44e2('0x12')](_0x44e2('0x13'),auth[_0x44e2('0x8')](),controller['destroy']);module[_0x44e2('0x14')]=router; \ No newline at end of file +var _0x3f62=['../../components/interaction/service','../../config/environment','get','index','/:id','show','isAuthenticated','getItems','post','/:id/clone','clone','/:id/items','addItem','put','delete','destroy','multer','util','path','Router','fs-extra'];(function(_0x2568e8,_0x4622c3){var _0x4169fa=function(_0x1260af){while(--_0x1260af){_0x2568e8['push'](_0x2568e8['shift']());}};_0x4169fa(++_0x4622c3);}(_0x3f62,0xf7));var _0x23f6=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0x3f62[_0x2b4411];return _0x8e41ef;};'use strict';var multer=require(_0x23f6('0x0'));var util=require(_0x23f6('0x1'));var path=require(_0x23f6('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x23f6('0x3')]();var fs_extra=require(_0x23f6('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x23f6('0x5'));var config=require(_0x23f6('0x6'));var controller=require('./dashboard.controller');router[_0x23f6('0x7')]('/',auth['isAuthenticated'](),controller[_0x23f6('0x8')]);router[_0x23f6('0x7')](_0x23f6('0x9'),auth['isAuthenticated'](),controller[_0x23f6('0xa')]);router['get']('/:id/items',auth[_0x23f6('0xb')](),controller[_0x23f6('0xc')]);router['post']('/',auth[_0x23f6('0xb')](),controller['create']);router[_0x23f6('0xd')](_0x23f6('0xe'),auth[_0x23f6('0xb')](),controller[_0x23f6('0xf')]);router[_0x23f6('0xd')](_0x23f6('0x10'),auth[_0x23f6('0xb')](),controller[_0x23f6('0x11')]);router[_0x23f6('0x12')](_0x23f6('0x9'),auth[_0x23f6('0xb')](),controller['update']);router[_0x23f6('0x13')](_0x23f6('0x9'),auth['isAuthenticated'](),controller[_0x23f6('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.attributes.js b/server/api/dashboardItem/dashboardItem.attributes.js index 13792c2..134edb7 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 _0xba34=['attrs','setDataValue','stringify','INTEGER','#ffffff','sequelize','squel','lodash','exports','STRING','parse','getDataValue'];(function(_0xe8129c,_0x2fb03c){var _0x709fc5=function(_0xb8e0c6){while(--_0xb8e0c6){_0xe8129c['push'](_0xe8129c['shift']());}};_0x709fc5(++_0x2fb03c);}(_0xba34,0x119));var _0x4ba3=function(_0x4b5f2a,_0x4864b7){_0x4b5f2a=_0x4b5f2a-0x0;var _0x14dd4a=_0xba34[_0x4b5f2a];return _0x14dd4a;};'use strict';var Sequelize=require(_0x4ba3('0x0'));var squel=require(_0x4ba3('0x1'));var _=require(_0x4ba3('0x2'));module[_0x4ba3('0x3')]={'title':{'type':Sequelize[_0x4ba3('0x4')],'allowNull':![]},'type':{'type':Sequelize['STRING'](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize['TEXT']('long'),'get':function(){try{return JSON[_0x4ba3('0x5')](this[_0x4ba3('0x6')](_0x4ba3('0x7')));}catch(_0x1011ec){return[];}},'set':function(_0x3590a1){try{this[_0x4ba3('0x8')](_0x4ba3('0x7'),JSON['stringify'](_0x3590a1));}catch(_0x6254fb){this[_0x4ba3('0x8')](_0x4ba3('0x7'),JSON[_0x4ba3('0x9')]([]));}}},'sizeX':{'type':Sequelize[_0x4ba3('0xa')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0x4ba3('0xa')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0x4ba3('0xa')]},'col':{'type':Sequelize[_0x4ba3('0xa')]},'background':{'type':Sequelize[_0x4ba3('0x4')],'allowNull':![],'defaultValue':_0x4ba3('0xb'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0x4ba3('0x4')],'allowNull':![],'defaultValue':'#2196f3','validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0x4ba3('0x4')]},'titleFontSize':{'type':Sequelize[_0x4ba3('0xa')],'defaultValue':0xc}}; \ No newline at end of file +var _0xdbf5=['squel','STRING','TEXT','long','parse','getDataValue','attrs','setDataValue','stringify','INTEGER','#ffffff'];(function(_0x3d6ac1,_0x30416b){var _0x8af0cb=function(_0x17200a){while(--_0x17200a){_0x3d6ac1['push'](_0x3d6ac1['shift']());}};_0x8af0cb(++_0x30416b);}(_0xdbf5,0x18c));var _0x5dbf=function(_0x19054,_0x56ca8c){_0x19054=_0x19054-0x0;var _0x155576=_0xdbf5[_0x19054];return _0x155576;};'use strict';var Sequelize=require('sequelize');var squel=require(_0x5dbf('0x0'));var _=require('lodash');module['exports']={'title':{'type':Sequelize[_0x5dbf('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x5dbf('0x1')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0x5dbf('0x2')](_0x5dbf('0x3')),'get':function(){try{return JSON[_0x5dbf('0x4')](this[_0x5dbf('0x5')](_0x5dbf('0x6')));}catch(_0x1decd2){return[];}},'set':function(_0x3f8628){try{this[_0x5dbf('0x7')](_0x5dbf('0x6'),JSON[_0x5dbf('0x8')](_0x3f8628));}catch(_0x93e657){this['setDataValue'](_0x5dbf('0x6'),JSON['stringify']([]));}}},'sizeX':{'type':Sequelize[_0x5dbf('0x9')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0x5dbf('0x9')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0x5dbf('0x9')]},'col':{'type':Sequelize[_0x5dbf('0x9')]},'background':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x5dbf('0xa'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#2196f3','validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0x5dbf('0x1')]},'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 5428610..8522e63 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 _0xed1f=['attrRefresh','stringify','create','body','eml-format','rimraf','request-promise','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','redis','localhost','socket.io-emitter','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','update','then','error','stack','name','send','show','model','keys','DashboardItem','rawAttributes','query','filters','intersection','attributes','fields','includeAll','merge','catch','find','params','type','attrUrl','attrs','https://','custom','value','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','attrChannel','attrFaxAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','attrSerie1','attrSerie2','attrSerie3','voice','attrEmailAccounts','attrSmsAccounts','web-report','reportType','attrReport'];(function(_0x198836,_0x203b47){var _0x2b7998=function(_0x37ade1){while(--_0x37ade1){_0x198836['push'](_0x198836['shift']());}};_0x2b7998(++_0x203b47);}(_0xed1f,0x170));var _0xfed1=function(_0x2aea9e,_0x1f587f){_0x2aea9e=_0x2aea9e-0x0;var _0x430b92=_0xed1f[_0x2aea9e];return _0x430b92;};'use strict';var emlformat=require(_0xfed1('0x0'));var rimraf=require(_0xfed1('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xfed1('0x2'));var moment=require('moment');var BPromise=require(_0xfed1('0x3'));var Mustache=require('mustache');var util=require(_0xfed1('0x4'));var path=require(_0xfed1('0x5'));var sox=require(_0xfed1('0x6'));var csv=require(_0xfed1('0x7'));var ejs=require(_0xfed1('0x8'));var fs=require('fs');var fs_extra=require(_0xfed1('0x9'));var _=require(_0xfed1('0xa'));var squel=require(_0xfed1('0xb'));var crypto=require(_0xfed1('0xc'));var jsforce=require(_0xfed1('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xfed1('0x7'));var querystring=require(_0xfed1('0xe'));var Papa=require(_0xfed1('0xf'));var Redis=require('ioredis');var authService=require(_0xfed1('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xfed1('0x11'));var logger=require(_0xfed1('0x12'))('api');var utils=require('../../config/utils');var config=require(_0xfed1('0x13'));var licenseUtil=require(_0xfed1('0x14'));var db=require('../../mysqldb')['db'];config[_0xfed1('0x15')]=_['defaults'](config[_0xfed1('0x15')],{'host':_0xfed1('0x16'),'port':0x18eb});var socket=require(_0xfed1('0x17'))(new Redis(config[_0xfed1('0x15')]));require('./dashboardItem.socket')[_0xfed1('0x18')](socket);function respondWithStatusCode(_0x3754c2,_0x4a0f51){_0x4a0f51=_0x4a0f51||0xcc;return function(_0x51631c){if(_0x51631c){return _0x3754c2[_0xfed1('0x19')](_0x4a0f51);}return _0x3754c2[_0xfed1('0x1a')](_0x4a0f51)[_0xfed1('0x1b')]();};}function respondWithResult(_0x5ed220,_0x223f42){_0x223f42=_0x223f42||0xc8;return function(_0x2218d5){if(_0x2218d5){return _0x5ed220[_0xfed1('0x1a')](_0x223f42)[_0xfed1('0x1c')](_0x2218d5);}};}function respondWithFilteredResult(_0x5ab809,_0x31ff97){return function(_0x4c492e){if(_0x4c492e){var _0x34512d=typeof _0x31ff97[_0xfed1('0x1d')]===_0xfed1('0x1e')&&typeof _0x31ff97[_0xfed1('0x1f')]===_0xfed1('0x1e');var _0x2926ac=_0x4c492e[_0xfed1('0x20')];var _0x10cc18=_0x34512d?0x0:_0x31ff97[_0xfed1('0x1d')];var _0x568405=_0x34512d?_0x4c492e[_0xfed1('0x20')]:_0x31ff97['offset']+_0x31ff97[_0xfed1('0x1f')];var _0x3e5ada;if(_0x568405>=_0x2926ac){_0x568405=_0x2926ac;_0x3e5ada=0xc8;}else{_0x3e5ada=0xce;}_0x5ab809[_0xfed1('0x1a')](_0x3e5ada);return _0x5ab809[_0xfed1('0x21')](_0xfed1('0x22'),_0x10cc18+'-'+_0x568405+'/'+_0x2926ac)[_0xfed1('0x1c')](_0x4c492e);}return null;};}function patchUpdates(_0x1748f5){return function(_0x15965d){try{jsonpatch['apply'](_0x15965d,_0x1748f5,!![]);}catch(_0x578aaa){return BPromise[_0xfed1('0x23')](_0x578aaa);}return _0x15965d['save']();};}function saveUpdates(_0x36a818,_0x4388f3){return function(_0x4cd3b8){if(_0x4cd3b8){return _0x4cd3b8[_0xfed1('0x24')](_0x36a818)[_0xfed1('0x25')](function(_0x472dbc){return _0x472dbc;});}return null;};}function removeEntity(_0x5bce5d,_0x1e8c3e){return function(_0xea7a81){if(_0xea7a81){return _0xea7a81['destroy']()[_0xfed1('0x25')](function(){_0x5bce5d[_0xfed1('0x1a')](0xcc)[_0xfed1('0x1b')]();});}};}function handleEntityNotFound(_0x5705b9,_0x1337d6){return function(_0x425a47){if(!_0x425a47){_0x5705b9[_0xfed1('0x19')](0x194);}return _0x425a47;};}function handleError(_0x5ab942,_0x3cd60e){_0x3cd60e=_0x3cd60e||0x1f4;return function(_0x46cf02){logger[_0xfed1('0x26')](_0x46cf02[_0xfed1('0x27')]);if(_0x46cf02[_0xfed1('0x28')]){delete _0x46cf02[_0xfed1('0x28')];}_0x5ab942['status'](_0x3cd60e)[_0xfed1('0x29')](_0x46cf02);};}exports[_0xfed1('0x2a')]=function(_0x55b555,_0x34e47b){var _0x3c971d={'raw':![],'where':{'id':_0x55b555['params']['id']}},_0x2d3e62={};_0x2d3e62[_0xfed1('0x2b')]=_[_0xfed1('0x2c')](db[_0xfed1('0x2d')][_0xfed1('0x2e')]);_0x2d3e62['query']=_[_0xfed1('0x2c')](_0x55b555[_0xfed1('0x2f')]);_0x2d3e62[_0xfed1('0x30')]=_[_0xfed1('0x31')](_0x2d3e62[_0xfed1('0x2b')],_0x2d3e62['query']);_0x3c971d[_0xfed1('0x32')]=_[_0xfed1('0x31')](_0x2d3e62[_0xfed1('0x2b')],qs[_0xfed1('0x33')](_0x55b555[_0xfed1('0x2f')][_0xfed1('0x33')]));_0x3c971d[_0xfed1('0x32')]=_0x3c971d[_0xfed1('0x32')]['length']?_0x3c971d['attributes']:_0x2d3e62['model'];if(_0x55b555[_0xfed1('0x2f')][_0xfed1('0x34')]){_0x3c971d['include']=[{'all':!![]}];}_0x3c971d=_[_0xfed1('0x35')]({},_0x3c971d,_0x55b555['options']);return db['DashboardItem']['find'](_0x3c971d)[_0xfed1('0x25')](handleEntityNotFound(_0x34e47b,null))[_0xfed1('0x25')](respondWithResult(_0x34e47b,null))[_0xfed1('0x36')](handleError(_0x34e47b,null));};exports['destroy']=function(_0x4d7e32,_0x2b59f7){return db[_0xfed1('0x2d')][_0xfed1('0x37')]({'where':{'id':_0x4d7e32[_0xfed1('0x38')]['id']}})[_0xfed1('0x25')](handleEntityNotFound(_0x2b59f7,null))[_0xfed1('0x25')](removeEntity(_0x2b59f7,null))[_0xfed1('0x36')](handleError(_0x2b59f7,null));};function widgetAttributes(_0x50375a){try{switch(_0x50375a[_0xfed1('0x39')]){case'iframe':return[{'name':_0xfed1('0x3a'),'value':_0x50375a[_0xfed1('0x3a')]||(_0x50375a['attrs']&&_0x50375a[_0xfed1('0x3b')][0x0]?_0x50375a[_0xfed1('0x3b')][0x0]['value']:undefined)||_0xfed1('0x3c')}];case _0xfed1('0x3d'):return[{'name':'attrPath','value':_0x50375a['attrPath']||(_0x50375a[_0xfed1('0x3b')]&&_0x50375a[_0xfed1('0x3b')][0x0]?_0x50375a[_0xfed1('0x3b')][0x0][_0xfed1('0x3e')]:undefined)||''}];case'clock':return[{'name':_0xfed1('0x3f'),'value':_0x50375a['attrHourFormat']||(_0x50375a[_0xfed1('0x3b')]&&_0x50375a['attrs'][0x0]?_0x50375a[_0xfed1('0x3b')][0x0][_0xfed1('0x3e')]:undefined)||_0xfed1('0x40')},{'name':_0xfed1('0x41'),'value':_0x50375a[_0xfed1('0x41')]||(_0x50375a['attrs']&&_0x50375a[_0xfed1('0x3b')][0x1]?_0x50375a[_0xfed1('0x3b')][0x1][_0xfed1('0x3e')]:undefined)||_0xfed1('0x42')},{'name':_0xfed1('0x43'),'value':_0x50375a['attrFontSize']||(_0x50375a[_0xfed1('0x3b')]&&_0x50375a[_0xfed1('0x3b')][0x2]?_0x50375a[_0xfed1('0x3b')][0x2][_0xfed1('0x3e')]:undefined)||0xc}];case _0xfed1('0x44'):return[{'name':_0xfed1('0x45'),'value':_0x50375a[_0xfed1('0x45')]||(_0x50375a['attrs']&&_0x50375a[_0xfed1('0x3b')][0x0]?_0x50375a['attrs'][0x0][_0xfed1('0x3e')]:undefined)||_0xfed1('0x46')},{'name':_0xfed1('0x47'),'value':_0x50375a[_0xfed1('0x47')]||(_0x50375a[_0xfed1('0x3b')]&&_0x50375a[_0xfed1('0x3b')][0x1]?_0x50375a[_0xfed1('0x3b')][0x1]['value']:undefined)||[]},{'name':_0xfed1('0x43'),'value':_0x50375a[_0xfed1('0x43')]||(_0x50375a['attrs']&&_0x50375a[_0xfed1('0x3b')][0x2]?_0x50375a[_0xfed1('0x3b')][0x2][_0xfed1('0x3e')]:undefined)||0x14},{'name':_0xfed1('0x48'),'value':_0x50375a['attrChannel']||(_0x50375a[_0xfed1('0x3b')]&&_0x50375a[_0xfed1('0x3b')][0x3]?_0x50375a[_0xfed1('0x3b')][0x3]['value']:undefined)||'voice'},{'name':'attrEmailAccounts','value':_0x50375a['attrEmailAccounts']||(_0x50375a[_0xfed1('0x3b')]&&_0x50375a[_0xfed1('0x3b')][0x4]?_0x50375a[_0xfed1('0x3b')][0x4][_0xfed1('0x3e')]:undefined)||''},{'name':_0xfed1('0x49'),'value':_0x50375a['attrFaxAccounts']||(_0x50375a['attrs']&&_0x50375a[_0xfed1('0x3b')][0x5]?_0x50375a[_0xfed1('0x3b')][0x5][_0xfed1('0x3e')]:undefined)||''},{'name':'attrSmsAccounts','value':_0x50375a['attrSmsAccounts']||(_0x50375a[_0xfed1('0x3b')]&&_0x50375a[_0xfed1('0x3b')][0x6]?_0x50375a[_0xfed1('0x3b')][0x6][_0xfed1('0x3e')]:undefined)||''},{'name':_0xfed1('0x4a'),'value':_0x50375a[_0xfed1('0x4a')]||(_0x50375a['attrs']&&_0x50375a[_0xfed1('0x3b')][0x7]?_0x50375a['attrs'][0x7][_0xfed1('0x3e')]:undefined)||''},{'name':_0xfed1('0x4b'),'value':_0x50375a['attrWhatsappAccounts']||(_0x50375a['attrs']&&_0x50375a[_0xfed1('0x3b')][0x8]?_0x50375a[_0xfed1('0x3b')][0x8][_0xfed1('0x3e')]:undefined)||''},{'name':_0xfed1('0x4c'),'value':_0x50375a['attrChatWebsites']||(_0x50375a[_0xfed1('0x3b')]&&_0x50375a[_0xfed1('0x3b')][0x9]?_0x50375a['attrs'][0x9][_0xfed1('0x3e')]:undefined)||''}];case _0xfed1('0x4d'):case'pie-chart':return[{'name':'attrSerie1','value':_0x50375a[_0xfed1('0x4e')]||(_0x50375a[_0xfed1('0x3b')]&&_0x50375a[_0xfed1('0x3b')][0x0]?_0x50375a[_0xfed1('0x3b')][0x0][_0xfed1('0x3e')]:undefined)||_0xfed1('0x46')},{'name':_0xfed1('0x4f'),'value':_0x50375a['attrSerie2']||(_0x50375a[_0xfed1('0x3b')]&&_0x50375a[_0xfed1('0x3b')][0x1]?_0x50375a['attrs'][0x1][_0xfed1('0x3e')]:undefined)||null},{'name':'attrSerie3','value':_0x50375a[_0xfed1('0x50')]||(_0x50375a[_0xfed1('0x3b')]&&_0x50375a['attrs'][0x2]?_0x50375a[_0xfed1('0x3b')][0x2][_0xfed1('0x3e')]:undefined)||null},{'name':_0xfed1('0x47'),'value':_0x50375a[_0xfed1('0x47')]||(_0x50375a[_0xfed1('0x3b')]&&_0x50375a[_0xfed1('0x3b')][0x3]?_0x50375a[_0xfed1('0x3b')][0x3][_0xfed1('0x3e')]:undefined)||[]},{'name':'attrChannel','value':_0x50375a['attrChannel']||(_0x50375a[_0xfed1('0x3b')]&&_0x50375a[_0xfed1('0x3b')][0x4]?_0x50375a['attrs'][0x4][_0xfed1('0x3e')]:undefined)||_0xfed1('0x51')},{'name':_0xfed1('0x52'),'value':_0x50375a['attrEmailAccounts']||(_0x50375a[_0xfed1('0x3b')]&&_0x50375a[_0xfed1('0x3b')][0x5]?_0x50375a[_0xfed1('0x3b')][0x5]['value']:undefined)||''},{'name':_0xfed1('0x49'),'value':_0x50375a[_0xfed1('0x49')]||(_0x50375a['attrs']&&_0x50375a[_0xfed1('0x3b')][0x6]?_0x50375a[_0xfed1('0x3b')][0x6][_0xfed1('0x3e')]:undefined)||''},{'name':_0xfed1('0x53'),'value':_0x50375a[_0xfed1('0x53')]||(_0x50375a['attrs']&&_0x50375a['attrs'][0x7]?_0x50375a[_0xfed1('0x3b')][0x7]['value']:undefined)||''},{'name':_0xfed1('0x4a'),'value':_0x50375a[_0xfed1('0x4a')]||(_0x50375a['attrs']&&_0x50375a['attrs'][0x8]?_0x50375a[_0xfed1('0x3b')][0x8]['value']:undefined)||''},{'name':'attrWhatsappAccounts','value':_0x50375a[_0xfed1('0x4b')]||(_0x50375a['attrs']&&_0x50375a[_0xfed1('0x3b')][0x9]?_0x50375a['attrs'][0x9][_0xfed1('0x3e')]:undefined)||''},{'name':_0xfed1('0x4c'),'value':_0x50375a[_0xfed1('0x4c')]||(_0x50375a[_0xfed1('0x3b')]&&_0x50375a['attrs'][0xa]?_0x50375a[_0xfed1('0x3b')][0xa][_0xfed1('0x3e')]:undefined)||''}];case _0xfed1('0x54'):return[{'name':'attrReport','type':_0x50375a[_0xfed1('0x55')]||(_0x50375a[_0xfed1('0x3b')]&&_0x50375a['attrs'][0x0]?_0x50375a[_0xfed1('0x3b')][0x0][_0xfed1('0x39')]:undefined)||null,'value':_0x50375a[_0xfed1('0x56')]||(_0x50375a[_0xfed1('0x3b')]&&_0x50375a[_0xfed1('0x3b')][0x0]?_0x50375a[_0xfed1('0x3b')][0x0][_0xfed1('0x3e')]:undefined)||null},{'name':_0xfed1('0x57'),'value':_0x50375a[_0xfed1('0x57')]||(_0x50375a[_0xfed1('0x3b')]&&_0x50375a[_0xfed1('0x3b')][0x1]?_0x50375a['attrs'][0x1][_0xfed1('0x3e')]:undefined)||0x0}];default:return[];}}catch(_0x5a8c89){logger[_0xfed1('0x26')]('widgetAttributes:\x20%s',JSON[_0xfed1('0x58')](_0x5a8c89));return[];}}exports[_0xfed1('0x59')]=function(_0xeb4848,_0x5b387a){if(_0xeb4848['body']){_0xeb4848[_0xfed1('0x5a')][_0xfed1('0x3b')]=widgetAttributes(_0xeb4848[_0xfed1('0x5a')]);}return db[_0xfed1('0x2d')][_0xfed1('0x59')](_0xeb4848['body'],{})[_0xfed1('0x25')](respondWithResult(_0x5b387a,0xc9))[_0xfed1('0x36')](handleError(_0x5b387a,null));};exports['update']=function(_0x515b23,_0x3387fc){if(_0x515b23[_0xfed1('0x5a')]['id']){delete _0x515b23[_0xfed1('0x5a')]['id'];}_0x515b23[_0xfed1('0x5a')][_0xfed1('0x3b')]=widgetAttributes(_0x515b23[_0xfed1('0x5a')]);return db[_0xfed1('0x2d')][_0xfed1('0x37')]({'where':{'id':_0x515b23[_0xfed1('0x38')]['id']}})['then'](handleEntityNotFound(_0x3387fc,null))[_0xfed1('0x25')](saveUpdates(_0x515b23[_0xfed1('0x5a')],null))['then'](respondWithResult(_0x3387fc,null))['catch'](handleError(_0x3387fc,null));}; \ No newline at end of file +var _0x9505=['bluebird','mustache','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./dashboardItem.socket','register','sendStatus','status','end','offset','undefined','count','set','Content-Range','json','apply','reject','save','destroy','error','stack','name','send','show','params','model','keys','DashboardItem','rawAttributes','query','filters','intersection','attributes','fields','includeAll','include','options','find','then','catch','type','iframe','attrUrl','attrs','custom','attrPath','value','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','pie-chart','attrSerie1','attrSerie2','attrSerie3','attrReport','reportType','attrRefresh','widgetAttributes:\x20%s','stringify','body','eml-format','rimraf','fast-json-patch','request-promise','moment'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0x9505,0x1e5));var _0x5950=function(_0x166ee8,_0x5b5920){_0x166ee8=_0x166ee8-0x0;var _0x1d37dc=_0x9505[_0x166ee8];return _0x1d37dc;};'use strict';var emlformat=require(_0x5950('0x0'));var rimraf=require(_0x5950('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5950('0x2'));var rp=require(_0x5950('0x3'));var moment=require(_0x5950('0x4'));var BPromise=require(_0x5950('0x5'));var Mustache=require(_0x5950('0x6'));var util=require('util');var path=require('path');var sox=require(_0x5950('0x7'));var csv=require(_0x5950('0x8'));var ejs=require(_0x5950('0x9'));var fs=require('fs');var fs_extra=require(_0x5950('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x5950('0xb'));var jsforce=require(_0x5950('0xc'));var deskjs=require(_0x5950('0xd'));var toCsv=require(_0x5950('0x8'));var querystring=require(_0x5950('0xe'));var Papa=require(_0x5950('0xf'));var Redis=require(_0x5950('0x10'));var authService=require(_0x5950('0x11'));var qs=require(_0x5950('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5950('0x13'));var logger=require(_0x5950('0x14'))('api');var utils=require('../../config/utils');var config=require(_0x5950('0x15'));var licenseUtil=require(_0x5950('0x16'));var db=require(_0x5950('0x17'))['db'];config[_0x5950('0x18')]=_[_0x5950('0x19')](config[_0x5950('0x18')],{'host':_0x5950('0x1a'),'port':0x18eb});var socket=require(_0x5950('0x1b'))(new Redis(config[_0x5950('0x18')]));require(_0x5950('0x1c'))[_0x5950('0x1d')](socket);function respondWithStatusCode(_0x3ace79,_0xaed862){_0xaed862=_0xaed862||0xcc;return function(_0x3f1b9b){if(_0x3f1b9b){return _0x3ace79[_0x5950('0x1e')](_0xaed862);}return _0x3ace79[_0x5950('0x1f')](_0xaed862)[_0x5950('0x20')]();};}function respondWithResult(_0x3c469d,_0x26f3c3){_0x26f3c3=_0x26f3c3||0xc8;return function(_0x10839e){if(_0x10839e){return _0x3c469d[_0x5950('0x1f')](_0x26f3c3)['json'](_0x10839e);}};}function respondWithFilteredResult(_0x5a99e8,_0x30e759){return function(_0x40f50c){if(_0x40f50c){var _0x3a7821=typeof _0x30e759[_0x5950('0x21')]===_0x5950('0x22')&&typeof _0x30e759['limit']==='undefined';var _0x119f1f=_0x40f50c[_0x5950('0x23')];var _0x1ad343=_0x3a7821?0x0:_0x30e759['offset'];var _0x1cf241=_0x3a7821?_0x40f50c[_0x5950('0x23')]:_0x30e759['offset']+_0x30e759['limit'];var _0x53fdfe;if(_0x1cf241>=_0x119f1f){_0x1cf241=_0x119f1f;_0x53fdfe=0xc8;}else{_0x53fdfe=0xce;}_0x5a99e8['status'](_0x53fdfe);return _0x5a99e8[_0x5950('0x24')](_0x5950('0x25'),_0x1ad343+'-'+_0x1cf241+'/'+_0x119f1f)[_0x5950('0x26')](_0x40f50c);}return null;};}function patchUpdates(_0x388ad0){return function(_0x5e2c98){try{jsonpatch[_0x5950('0x27')](_0x5e2c98,_0x388ad0,!![]);}catch(_0x3c58f4){return BPromise[_0x5950('0x28')](_0x3c58f4);}return _0x5e2c98[_0x5950('0x29')]();};}function saveUpdates(_0x4757fd,_0x1bd3b3){return function(_0x4683fc){if(_0x4683fc){return _0x4683fc['update'](_0x4757fd)['then'](function(_0x1b2265){return _0x1b2265;});}return null;};}function removeEntity(_0x32c197,_0x545354){return function(_0xfa0238){if(_0xfa0238){return _0xfa0238[_0x5950('0x2a')]()['then'](function(){_0x32c197['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x20679e,_0x2ca436){return function(_0xfc543b){if(!_0xfc543b){_0x20679e[_0x5950('0x1e')](0x194);}return _0xfc543b;};}function handleError(_0x3923dd,_0x170084){_0x170084=_0x170084||0x1f4;return function(_0x2ff8a3){logger[_0x5950('0x2b')](_0x2ff8a3[_0x5950('0x2c')]);if(_0x2ff8a3[_0x5950('0x2d')]){delete _0x2ff8a3[_0x5950('0x2d')];}_0x3923dd[_0x5950('0x1f')](_0x170084)[_0x5950('0x2e')](_0x2ff8a3);};}exports[_0x5950('0x2f')]=function(_0x1670ae,_0x24fd58){var _0x10f4d4={'raw':![],'where':{'id':_0x1670ae[_0x5950('0x30')]['id']}},_0x18a8ca={};_0x18a8ca[_0x5950('0x31')]=_[_0x5950('0x32')](db[_0x5950('0x33')][_0x5950('0x34')]);_0x18a8ca[_0x5950('0x35')]=_[_0x5950('0x32')](_0x1670ae[_0x5950('0x35')]);_0x18a8ca[_0x5950('0x36')]=_[_0x5950('0x37')](_0x18a8ca['model'],_0x18a8ca[_0x5950('0x35')]);_0x10f4d4[_0x5950('0x38')]=_[_0x5950('0x37')](_0x18a8ca[_0x5950('0x31')],qs[_0x5950('0x39')](_0x1670ae['query']['fields']));_0x10f4d4[_0x5950('0x38')]=_0x10f4d4[_0x5950('0x38')]['length']?_0x10f4d4[_0x5950('0x38')]:_0x18a8ca['model'];if(_0x1670ae[_0x5950('0x35')][_0x5950('0x3a')]){_0x10f4d4[_0x5950('0x3b')]=[{'all':!![]}];}_0x10f4d4=_['merge']({},_0x10f4d4,_0x1670ae[_0x5950('0x3c')]);return db['DashboardItem'][_0x5950('0x3d')](_0x10f4d4)[_0x5950('0x3e')](handleEntityNotFound(_0x24fd58,null))[_0x5950('0x3e')](respondWithResult(_0x24fd58,null))[_0x5950('0x3f')](handleError(_0x24fd58,null));};exports['destroy']=function(_0x478108,_0x2d8766){return db[_0x5950('0x33')]['find']({'where':{'id':_0x478108[_0x5950('0x30')]['id']}})[_0x5950('0x3e')](handleEntityNotFound(_0x2d8766,null))['then'](removeEntity(_0x2d8766,null))['catch'](handleError(_0x2d8766,null));};function widgetAttributes(_0x57c990){try{switch(_0x57c990[_0x5950('0x40')]){case _0x5950('0x41'):return[{'name':_0x5950('0x42'),'value':_0x57c990[_0x5950('0x42')]||(_0x57c990[_0x5950('0x43')]&&_0x57c990['attrs'][0x0]?_0x57c990['attrs'][0x0]['value']:undefined)||'https://'}];case _0x5950('0x44'):return[{'name':_0x5950('0x45'),'value':_0x57c990[_0x5950('0x45')]||(_0x57c990[_0x5950('0x43')]&&_0x57c990['attrs'][0x0]?_0x57c990[_0x5950('0x43')][0x0][_0x5950('0x46')]:undefined)||''}];case'clock':return[{'name':_0x5950('0x47'),'value':_0x57c990[_0x5950('0x47')]||(_0x57c990[_0x5950('0x43')]&&_0x57c990[_0x5950('0x43')][0x0]?_0x57c990[_0x5950('0x43')][0x0][_0x5950('0x46')]:undefined)||_0x5950('0x48')},{'name':'attrTimezone','value':_0x57c990[_0x5950('0x49')]||(_0x57c990['attrs']&&_0x57c990[_0x5950('0x43')][0x1]?_0x57c990[_0x5950('0x43')][0x1]['value']:undefined)||_0x5950('0x4a')},{'name':_0x5950('0x4b'),'value':_0x57c990[_0x5950('0x4b')]||(_0x57c990[_0x5950('0x43')]&&_0x57c990['attrs'][0x2]?_0x57c990[_0x5950('0x43')][0x2][_0x5950('0x46')]:undefined)||0xc}];case _0x5950('0x4c'):return[{'name':_0x5950('0x4d'),'value':_0x57c990['attrMetric']||(_0x57c990[_0x5950('0x43')]&&_0x57c990[_0x5950('0x43')][0x0]?_0x57c990[_0x5950('0x43')][0x0]['value']:undefined)||_0x5950('0x4e')},{'name':'attrVoiceQueues','value':_0x57c990[_0x5950('0x4f')]||(_0x57c990[_0x5950('0x43')]&&_0x57c990[_0x5950('0x43')][0x1]?_0x57c990[_0x5950('0x43')][0x1][_0x5950('0x46')]:undefined)||[]},{'name':_0x5950('0x4b'),'value':_0x57c990[_0x5950('0x4b')]||(_0x57c990['attrs']&&_0x57c990[_0x5950('0x43')][0x2]?_0x57c990[_0x5950('0x43')][0x2][_0x5950('0x46')]:undefined)||0x14},{'name':_0x5950('0x50'),'value':_0x57c990[_0x5950('0x50')]||(_0x57c990['attrs']&&_0x57c990['attrs'][0x3]?_0x57c990[_0x5950('0x43')][0x3][_0x5950('0x46')]:undefined)||_0x5950('0x51')},{'name':'attrEmailAccounts','value':_0x57c990[_0x5950('0x52')]||(_0x57c990[_0x5950('0x43')]&&_0x57c990[_0x5950('0x43')][0x4]?_0x57c990['attrs'][0x4]['value']:undefined)||''},{'name':'attrFaxAccounts','value':_0x57c990[_0x5950('0x53')]||(_0x57c990[_0x5950('0x43')]&&_0x57c990[_0x5950('0x43')][0x5]?_0x57c990[_0x5950('0x43')][0x5][_0x5950('0x46')]:undefined)||''},{'name':_0x5950('0x54'),'value':_0x57c990[_0x5950('0x54')]||(_0x57c990[_0x5950('0x43')]&&_0x57c990[_0x5950('0x43')][0x6]?_0x57c990['attrs'][0x6][_0x5950('0x46')]:undefined)||''},{'name':_0x5950('0x55'),'value':_0x57c990[_0x5950('0x55')]||(_0x57c990[_0x5950('0x43')]&&_0x57c990[_0x5950('0x43')][0x7]?_0x57c990[_0x5950('0x43')][0x7][_0x5950('0x46')]:undefined)||''},{'name':_0x5950('0x56'),'value':_0x57c990[_0x5950('0x56')]||(_0x57c990[_0x5950('0x43')]&&_0x57c990['attrs'][0x8]?_0x57c990[_0x5950('0x43')][0x8][_0x5950('0x46')]:undefined)||''},{'name':_0x5950('0x57'),'value':_0x57c990[_0x5950('0x57')]||(_0x57c990['attrs']&&_0x57c990['attrs'][0x9]?_0x57c990[_0x5950('0x43')][0x9][_0x5950('0x46')]:undefined)||''}];case'multibar-chart':case _0x5950('0x58'):return[{'name':_0x5950('0x59'),'value':_0x57c990[_0x5950('0x59')]||(_0x57c990[_0x5950('0x43')]&&_0x57c990[_0x5950('0x43')][0x0]?_0x57c990[_0x5950('0x43')][0x0]['value']:undefined)||_0x5950('0x4e')},{'name':_0x5950('0x5a'),'value':_0x57c990['attrSerie2']||(_0x57c990[_0x5950('0x43')]&&_0x57c990[_0x5950('0x43')][0x1]?_0x57c990[_0x5950('0x43')][0x1]['value']:undefined)||null},{'name':_0x5950('0x5b'),'value':_0x57c990[_0x5950('0x5b')]||(_0x57c990[_0x5950('0x43')]&&_0x57c990[_0x5950('0x43')][0x2]?_0x57c990[_0x5950('0x43')][0x2][_0x5950('0x46')]:undefined)||null},{'name':_0x5950('0x4f'),'value':_0x57c990[_0x5950('0x4f')]||(_0x57c990[_0x5950('0x43')]&&_0x57c990['attrs'][0x3]?_0x57c990[_0x5950('0x43')][0x3][_0x5950('0x46')]:undefined)||[]},{'name':_0x5950('0x50'),'value':_0x57c990[_0x5950('0x50')]||(_0x57c990[_0x5950('0x43')]&&_0x57c990[_0x5950('0x43')][0x4]?_0x57c990[_0x5950('0x43')][0x4]['value']:undefined)||_0x5950('0x51')},{'name':'attrEmailAccounts','value':_0x57c990[_0x5950('0x52')]||(_0x57c990['attrs']&&_0x57c990[_0x5950('0x43')][0x5]?_0x57c990[_0x5950('0x43')][0x5]['value']:undefined)||''},{'name':_0x5950('0x53'),'value':_0x57c990['attrFaxAccounts']||(_0x57c990[_0x5950('0x43')]&&_0x57c990[_0x5950('0x43')][0x6]?_0x57c990['attrs'][0x6]['value']:undefined)||''},{'name':_0x5950('0x54'),'value':_0x57c990[_0x5950('0x54')]||(_0x57c990[_0x5950('0x43')]&&_0x57c990[_0x5950('0x43')][0x7]?_0x57c990[_0x5950('0x43')][0x7][_0x5950('0x46')]:undefined)||''},{'name':_0x5950('0x55'),'value':_0x57c990[_0x5950('0x55')]||(_0x57c990['attrs']&&_0x57c990['attrs'][0x8]?_0x57c990[_0x5950('0x43')][0x8]['value']:undefined)||''},{'name':_0x5950('0x56'),'value':_0x57c990[_0x5950('0x56')]||(_0x57c990[_0x5950('0x43')]&&_0x57c990[_0x5950('0x43')][0x9]?_0x57c990[_0x5950('0x43')][0x9]['value']:undefined)||''},{'name':_0x5950('0x57'),'value':_0x57c990[_0x5950('0x57')]||(_0x57c990[_0x5950('0x43')]&&_0x57c990['attrs'][0xa]?_0x57c990['attrs'][0xa][_0x5950('0x46')]:undefined)||''}];case'web-report':return[{'name':_0x5950('0x5c'),'type':_0x57c990[_0x5950('0x5d')]||(_0x57c990['attrs']&&_0x57c990[_0x5950('0x43')][0x0]?_0x57c990[_0x5950('0x43')][0x0][_0x5950('0x40')]:undefined)||null,'value':_0x57c990[_0x5950('0x5c')]||(_0x57c990[_0x5950('0x43')]&&_0x57c990[_0x5950('0x43')][0x0]?_0x57c990['attrs'][0x0][_0x5950('0x46')]:undefined)||null},{'name':_0x5950('0x5e'),'value':_0x57c990[_0x5950('0x5e')]||(_0x57c990['attrs']&&_0x57c990['attrs'][0x1]?_0x57c990[_0x5950('0x43')][0x1][_0x5950('0x46')]:undefined)||0x0}];default:return[];}}catch(_0x6e40df){logger[_0x5950('0x2b')](_0x5950('0x5f'),JSON[_0x5950('0x60')](_0x6e40df));return[];}}exports['create']=function(_0x29dcac,_0x2b6d12){if(_0x29dcac[_0x5950('0x61')]){_0x29dcac[_0x5950('0x61')]['attrs']=widgetAttributes(_0x29dcac[_0x5950('0x61')]);}return db[_0x5950('0x33')]['create'](_0x29dcac[_0x5950('0x61')],{})['then'](respondWithResult(_0x2b6d12,0xc9))[_0x5950('0x3f')](handleError(_0x2b6d12,null));};exports['update']=function(_0xc5ae82,_0x306b7d){if(_0xc5ae82['body']['id']){delete _0xc5ae82[_0x5950('0x61')]['id'];}_0xc5ae82[_0x5950('0x61')][_0x5950('0x43')]=widgetAttributes(_0xc5ae82['body']);return db[_0x5950('0x33')][_0x5950('0x3d')]({'where':{'id':_0xc5ae82[_0x5950('0x30')]['id']}})[_0x5950('0x3e')](handleEntityNotFound(_0x306b7d,null))[_0x5950('0x3e')](saveUpdates(_0xc5ae82[_0x5950('0x61')],null))[_0x5950('0x3e')](respondWithResult(_0x306b7d,null))[_0x5950('0x3f')](handleError(_0x306b7d,null));}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.events.js b/server/api/dashboardItem/dashboardItem.events.js index 0e7fc4f..4656984 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 _0xfa7e=['../../mysqldb','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x36884e,_0x48008f){var _0x1cc367=function(_0x388a78){while(--_0x388a78){_0x36884e['push'](_0x36884e['shift']());}};_0x1cc367(++_0x48008f);}(_0xfa7e,0xfc));var _0xefa7=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0xfa7e[_0x618414];return _0x21c19a;};'use strict';var EventEmitter=require('events');var DashboardItem=require(_0xefa7('0x0'))['db']['DashboardItem'];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0xefa7('0x1')](0x0);var events={'afterCreate':_0xefa7('0x2'),'afterUpdate':_0xefa7('0x3'),'afterDestroy':_0xefa7('0x4')};function emitEvent(_0x3ea300){return function(_0x4b1350,_0xefe1f3,_0x111bf5){DashboardItemEvents[_0xefa7('0x5')](_0x3ea300+':'+_0x4b1350['id'],_0x4b1350);DashboardItemEvents[_0xefa7('0x5')](_0x3ea300,_0x4b1350);_0x111bf5(null);};}for(var e in events){if(events[_0xefa7('0x6')](e)){var event=events[e];DashboardItem[_0xefa7('0x7')](e,emitEvent(event));}}module[_0xefa7('0x8')]=DashboardItemEvents; \ No newline at end of file +var _0x1b31=['remove','emit','exports','events','DashboardItem'];(function(_0x360aef,_0x311481){var _0x19c36a=function(_0x5634c4){while(--_0x5634c4){_0x360aef['push'](_0x360aef['shift']());}};_0x19c36a(++_0x311481);}(_0x1b31,0x8f));var _0x11b3=function(_0x101728,_0x4584a4){_0x101728=_0x101728-0x0;var _0x4fb4e5=_0x1b31[_0x101728];return _0x4fb4e5;};'use strict';var EventEmitter=require(_0x11b3('0x0'));var DashboardItem=require('../../mysqldb')['db'][_0x11b3('0x1')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x11b3('0x2')};function emitEvent(_0xee2438){return function(_0x1cbea8,_0x170791,_0xcd793e){DashboardItemEvents[_0x11b3('0x3')](_0xee2438+':'+_0x1cbea8['id'],_0x1cbea8);DashboardItemEvents['emit'](_0xee2438,_0x1cbea8);_0xcd793e(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];DashboardItem['hook'](e,emitEvent(event));}}module[_0x11b3('0x4')]=DashboardItemEvents; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.model.js b/server/api/dashboardItem/dashboardItem.model.js index 35d82b1..467da9d 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 _0xf0db=['util','api','moment','bluebird','path','rimraf','exports','define','dashboard_items','lodash'];(function(_0x1f3890,_0x2f9aad){var _0x4af351=function(_0xd4cdfa){while(--_0xd4cdfa){_0x1f3890['push'](_0x1f3890['shift']());}};_0x4af351(++_0x2f9aad);}(_0xf0db,0x12b));var _0xbf0d=function(_0x520523,_0x468f1){_0x520523=_0x520523-0x0;var _0x1e6742=_0xf0db[_0x520523];return _0x1e6742;};'use strict';var _=require(_0xbf0d('0x0'));var util=require(_0xbf0d('0x1'));var logger=require('../../config/logger')(_0xbf0d('0x2'));var moment=require(_0xbf0d('0x3'));var BPromise=require(_0xbf0d('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbf0d('0x5'));var rimraf=require(_0xbf0d('0x6'));var config=require('../../config/environment');var attributes=require('./dashboardItem.attributes');module[_0xbf0d('0x7')]=function(_0x1e4a49,_0x28586b){return _0x1e4a49[_0xbf0d('0x8')]('DashboardItem',attributes,{'tableName':_0xbf0d('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb642=['../../config/logger','moment','bluebird','request-promise','../../config/environment','exports','define','DashboardItem','dashboard_items','util'];(function(_0x38095a,_0x58b0c4){var _0x26f49f=function(_0x390ce6){while(--_0x390ce6){_0x38095a['push'](_0x38095a['shift']());}};_0x26f49f(++_0x58b0c4);}(_0xb642,0x15d));var _0x2b64=function(_0x2b10c6,_0x185590){_0x2b10c6=_0x2b10c6-0x0;var _0x3789d2=_0xb642[_0x2b10c6];return _0x3789d2;};'use strict';var _=require('lodash');var util=require(_0x2b64('0x0'));var logger=require(_0x2b64('0x1'))('api');var moment=require(_0x2b64('0x2'));var BPromise=require(_0x2b64('0x3'));var rp=require(_0x2b64('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x2b64('0x5'));var attributes=require('./dashboardItem.attributes');module[_0x2b64('0x6')]=function(_0x4331f0,_0x4dedfc){return _0x4331f0[_0x2b64('0x7')](_0x2b64('0x8'),attributes,{'tableName':_0x2b64('0x9'),'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 28a1e40..cc3f135 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 _0x9096=['debug','stringify','error','code','message','DashboardItem,\x20%s,\x20%s','info','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','defaults','redis','socket.io-emitter','./dashboardItem.socket','request','then','request\x20sent'];(function(_0x2df118,_0x267459){var _0x2a807b=function(_0x44980b){while(--_0x44980b){_0x2df118['push'](_0x2df118['shift']());}};_0x2a807b(++_0x267459);}(_0x9096,0x14d));var _0x6909=function(_0x671ed9,_0x2a40e7){_0x671ed9=_0x671ed9-0x0;var _0x52d8c2=_0x9096[_0x671ed9];return _0x52d8c2;};'use strict';var _=require(_0x6909('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x6909('0x1'));var rs=require(_0x6909('0x2'));var fs=require('fs');var Redis=require(_0x6909('0x3'));var db=require(_0x6909('0x4'))['db'];var utils=require(_0x6909('0x5'));var logger=require(_0x6909('0x6'))(_0x6909('0x7'));var config=require(_0x6909('0x8'));var jayson=require(_0x6909('0x9'));var client=jayson[_0x6909('0xa')]['http']({'port':0x232a});config['redis']=_[_0x6909('0xb')](config[_0x6909('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x6909('0xd'))(new Redis(config[_0x6909('0xc')]));require(_0x6909('0xe'))['register'](socket);function respondWithRpcPromise(_0x3e5c47,_0x5d468a,_0x59b2ea){return new BPromise(function(_0x538071,_0x4734a8){return client[_0x6909('0xf')](_0x3e5c47,_0x59b2ea)[_0x6909('0x10')](function(_0x3aeed4){logger['info']('DashboardItem,\x20%s,\x20%s',_0x5d468a,_0x6909('0x11'));logger[_0x6909('0x12')]('DashboardItem,\x20%s,\x20%s,\x20%s',_0x5d468a,_0x6909('0x11'),JSON[_0x6909('0x13')](_0x3aeed4));if(_0x3aeed4[_0x6909('0x14')]){if(_0x3aeed4[_0x6909('0x14')][_0x6909('0x15')]===0x1f4){logger[_0x6909('0x14')]('DashboardItem,\x20%s,\x20%s',_0x5d468a,_0x3aeed4['error'][_0x6909('0x16')]);return _0x4734a8(_0x3aeed4['error'][_0x6909('0x16')]);}logger[_0x6909('0x14')](_0x6909('0x17'),_0x5d468a,_0x3aeed4[_0x6909('0x14')][_0x6909('0x16')]);return _0x538071(_0x3aeed4[_0x6909('0x14')]['message']);}else{logger[_0x6909('0x18')](_0x6909('0x17'),_0x5d468a,_0x6909('0x11'));_0x538071(_0x3aeed4[_0x6909('0x19')][_0x6909('0x16')]);}})[_0x6909('0x1a')](function(_0x189171){logger[_0x6909('0x14')](_0x6909('0x17'),_0x5d468a,_0x189171);_0x4734a8(_0x189171);});});} \ No newline at end of file +var _0x63dd=['request','then','info','DashboardItem,\x20%s,\x20%s','request\x20sent','debug','DashboardItem,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','register'];(function(_0x43e2de,_0x17fb28){var _0x3e0b8e=function(_0xbd629d){while(--_0xbd629d){_0x43e2de['push'](_0x43e2de['shift']());}};_0x3e0b8e(++_0x17fb28);}(_0x63dd,0x108));var _0xd63d=function(_0x50d642,_0x2a8478){_0x50d642=_0x50d642-0x0;var _0x61fc03=_0x63dd[_0x50d642];return _0x61fc03;};'use strict';var _=require('lodash');var util=require(_0xd63d('0x0'));var moment=require('moment');var BPromise=require(_0xd63d('0x1'));var rs=require(_0xd63d('0x2'));var fs=require('fs');var Redis=require(_0xd63d('0x3'));var db=require(_0xd63d('0x4'))['db'];var utils=require(_0xd63d('0x5'));var logger=require(_0xd63d('0x6'))(_0xd63d('0x7'));var config=require(_0xd63d('0x8'));var jayson=require(_0xd63d('0x9'));var client=jayson[_0xd63d('0xa')][_0xd63d('0xb')]({'port':0x232a});config[_0xd63d('0xc')]=_[_0xd63d('0xd')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xd63d('0xe'))(new Redis(config[_0xd63d('0xc')]));require('./dashboardItem.socket')[_0xd63d('0xf')](socket);function respondWithRpcPromise(_0x487a2b,_0x16cb41,_0x2e428b){return new BPromise(function(_0x4ab029,_0x4372e4){return client[_0xd63d('0x10')](_0x487a2b,_0x2e428b)[_0xd63d('0x11')](function(_0x4565e0){logger[_0xd63d('0x12')](_0xd63d('0x13'),_0x16cb41,_0xd63d('0x14'));logger[_0xd63d('0x15')](_0xd63d('0x16'),_0x16cb41,_0xd63d('0x14'),JSON[_0xd63d('0x17')](_0x4565e0));if(_0x4565e0[_0xd63d('0x18')]){if(_0x4565e0[_0xd63d('0x18')]['code']===0x1f4){logger[_0xd63d('0x18')](_0xd63d('0x13'),_0x16cb41,_0x4565e0[_0xd63d('0x18')][_0xd63d('0x19')]);return _0x4372e4(_0x4565e0[_0xd63d('0x18')][_0xd63d('0x19')]);}logger[_0xd63d('0x18')](_0xd63d('0x13'),_0x16cb41,_0x4565e0[_0xd63d('0x18')][_0xd63d('0x19')]);return _0x4ab029(_0x4565e0[_0xd63d('0x18')][_0xd63d('0x19')]);}else{logger[_0xd63d('0x12')]('DashboardItem,\x20%s,\x20%s',_0x16cb41,_0xd63d('0x14'));_0x4ab029(_0x4565e0[_0xd63d('0x1a')][_0xd63d('0x19')]);}})[_0xd63d('0x1b')](function(_0x4c635d){logger[_0xd63d('0x18')](_0xd63d('0x13'),_0x16cb41,_0x4c635d);_0x4372e4(_0x4c635d);});});} \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.socket.js b/server/api/dashboardItem/dashboardItem.socket.js index 26b6885..fb094bc 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 _0xa154=['save','remove','update','emit','removeListener','length','dashboardItem:','./dashboardItem.events'];(function(_0x30ae5e,_0x391fc4){var _0x1f2e93=function(_0x60307d){while(--_0x60307d){_0x30ae5e['push'](_0x30ae5e['shift']());}};_0x1f2e93(++_0x391fc4);}(_0xa154,0xdf));var _0x4a15=function(_0x21f9fc,_0x33b8f2){_0x21f9fc=_0x21f9fc-0x0;var _0x1b5af9=_0xa154[_0x21f9fc];return _0x1b5af9;};'use strict';var DashboardItemEvents=require(_0x4a15('0x0'));var events=[_0x4a15('0x1'),_0x4a15('0x2'),_0x4a15('0x3')];function createListener(_0xcdf306,_0x5cfdb9){return function(_0x5c644d){_0x5cfdb9[_0x4a15('0x4')](_0xcdf306,_0x5c644d);};}function removeListener(_0x5238c3,_0x561a5d){return function(){DashboardItemEvents[_0x4a15('0x5')](_0x5238c3,_0x561a5d);};}exports['register']=function(_0x2bd14a){for(var _0x86fe2b=0x0,_0x34cbea=events[_0x4a15('0x6')];_0x86fe2b<_0x34cbea;_0x86fe2b++){var _0x14f4b9=events[_0x86fe2b];var _0x550d67=createListener(_0x4a15('0x7')+_0x14f4b9,_0x2bd14a);DashboardItemEvents['on'](_0x14f4b9,_0x550d67);}}; \ No newline at end of file +var _0x77f6=['register','length','dashboardItem:','./dashboardItem.events','save','remove','update','emit','removeListener'];(function(_0x1b7921,_0x213308){var _0x3c8ba6=function(_0x18ccf9){while(--_0x18ccf9){_0x1b7921['push'](_0x1b7921['shift']());}};_0x3c8ba6(++_0x213308);}(_0x77f6,0x123));var _0x677f=function(_0xd7d34e,_0x4e5d8c){_0xd7d34e=_0xd7d34e-0x0;var _0x5dfdb5=_0x77f6[_0xd7d34e];return _0x5dfdb5;};'use strict';var DashboardItemEvents=require(_0x677f('0x0'));var events=[_0x677f('0x1'),_0x677f('0x2'),_0x677f('0x3')];function createListener(_0x12b6ad,_0x163d41){return function(_0x540fe0){_0x163d41[_0x677f('0x4')](_0x12b6ad,_0x540fe0);};}function removeListener(_0x56207f,_0x750957){return function(){DashboardItemEvents[_0x677f('0x5')](_0x56207f,_0x750957);};}exports[_0x677f('0x6')]=function(_0xad4a80){for(var _0x17f64a=0x0,_0x1cf799=events[_0x677f('0x7')];_0x17f64a<_0x1cf799;_0x17f64a++){var _0x4f3c8e=events[_0x17f64a];var _0xdc6331=createListener(_0x677f('0x8')+_0x4f3c8e,_0xad4a80);DashboardItemEvents['on'](_0x4f3c8e,_0xdc6331);}}; \ No newline at end of file diff --git a/server/api/dashboardItem/index.js b/server/api/dashboardItem/index.js index b0d4bd3..d2bdb01 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 _0x489d=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','/:id','isAuthenticated','show','post','create','put','update','delete','exports'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x489d,0x1ee));var _0xd489=function(_0x1ffab2,_0x1dd3c5){_0x1ffab2=_0x1ffab2-0x0;var _0x38b929=_0x489d[_0x1ffab2];return _0x38b929;};'use strict';var multer=require(_0xd489('0x0'));var util=require(_0xd489('0x1'));var path=require(_0xd489('0x2'));var timeout=require(_0xd489('0x3'));var express=require(_0xd489('0x4'));var router=express[_0xd489('0x5')]();var fs_extra=require(_0xd489('0x6'));var auth=require(_0xd489('0x7'));var interaction=require(_0xd489('0x8'));var config=require(_0xd489('0x9'));var controller=require('./dashboardItem.controller');router['get'](_0xd489('0xa'),auth[_0xd489('0xb')](),controller[_0xd489('0xc')]);router[_0xd489('0xd')]('/',auth[_0xd489('0xb')](),controller[_0xd489('0xe')]);router[_0xd489('0xf')]('/:id',auth[_0xd489('0xb')](),controller[_0xd489('0x10')]);router[_0xd489('0x11')]('/:id',auth[_0xd489('0xb')](),controller['destroy']);module[_0xd489('0x12')]=router; \ No newline at end of file +var _0x23cb=['path','connect-timeout','express','Router','../../config/environment','./dashboardItem.controller','get','isAuthenticated','show','create','put','/:id','update','delete','exports','multer','util'];(function(_0x50210d,_0x440bee){var _0x2c0fbc=function(_0x2fe9ea){while(--_0x2fe9ea){_0x50210d['push'](_0x50210d['shift']());}};_0x2c0fbc(++_0x440bee);}(_0x23cb,0x1da));var _0xb23c=function(_0x5a0b42,_0x35c33f){_0x5a0b42=_0x5a0b42-0x0;var _0x2558df=_0x23cb[_0x5a0b42];return _0x2558df;};'use strict';var multer=require(_0xb23c('0x0'));var util=require(_0xb23c('0x1'));var path=require(_0xb23c('0x2'));var timeout=require(_0xb23c('0x3'));var express=require(_0xb23c('0x4'));var router=express[_0xb23c('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xb23c('0x6'));var controller=require(_0xb23c('0x7'));router[_0xb23c('0x8')]('/:id',auth[_0xb23c('0x9')](),controller[_0xb23c('0xa')]);router['post']('/',auth[_0xb23c('0x9')](),controller[_0xb23c('0xb')]);router[_0xb23c('0xc')](_0xb23c('0xd'),auth[_0xb23c('0x9')](),controller[_0xb23c('0xe')]);router[_0xb23c('0xf')](_0xb23c('0xd'),auth[_0xb23c('0x9')](),controller['destroy']);module[_0xb23c('0x10')]=router; \ No newline at end of file diff --git a/server/api/disposition/disposition.attributes.js b/server/api/disposition/disposition.attributes.js index e657c3c..516ae6b 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 _0xb3ac=['ENUM','first','second','STRING','sequelize','exports'];(function(_0x520666,_0x3d4bbf){var _0x3debb4=function(_0x402ca3){while(--_0x402ca3){_0x520666['push'](_0x520666['shift']());}};_0x3debb4(++_0x3d4bbf);}(_0xb3ac,0x7c));var _0xcb3a=function(_0x476bf4,_0x2a3755){_0x476bf4=_0x476bf4-0x0;var _0x788ffe=_0xb3ac[_0x476bf4];return _0x788ffe;};'use strict';var Sequelize=require(_0xcb3a('0x0'));module[_0xcb3a('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'level':{'type':Sequelize[_0xcb3a('0x2')](_0xcb3a('0x3'),_0xcb3a('0x4'),'third'),'allowNull':![],'defaultValue':_0xcb3a('0x3')},'description':{'type':Sequelize[_0xcb3a('0x5')]}}; \ No newline at end of file +var _0x62b2=['exports','STRING','ENUM','first','second','third','sequelize'];(function(_0x4b45fd,_0x62bb51){var _0x232c10=function(_0x36be39){while(--_0x36be39){_0x4b45fd['push'](_0x4b45fd['shift']());}};_0x232c10(++_0x62bb51);}(_0x62b2,0x1db));var _0x262b=function(_0x4cc28a,_0x52a514){_0x4cc28a=_0x4cc28a-0x0;var _0xec799b=_0x62b2[_0x4cc28a];return _0xec799b;};'use strict';var Sequelize=require(_0x262b('0x0'));module[_0x262b('0x1')]={'name':{'type':Sequelize[_0x262b('0x2')],'allowNull':![]},'level':{'type':Sequelize[_0x262b('0x3')](_0x262b('0x4'),_0x262b('0x5'),_0x262b('0x6')),'allowNull':![],'defaultValue':_0x262b('0x4')},'description':{'type':Sequelize[_0x262b('0x2')]}}; \ No newline at end of file diff --git a/server/api/disposition/disposition.controller.js b/server/api/disposition/disposition.controller.js index e53fd1a..59b3ff5 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 _0xef6d=['params','keys','merge','options','catch','create','body','get','role','user','UserProfileSection','error','update','find','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','ejs','fs-extra','squel','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','destroy','then','Dispositions','UserProfileResource','end','stack','name','send','index','map','Disposition','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','VIRTUAL','includeAll','include','findAll','rows','show'];(function(_0x394a2e,_0x2f09b3){var _0x8c7f03=function(_0x4ec676){while(--_0x4ec676){_0x394a2e['push'](_0x394a2e['shift']());}};_0x8c7f03(++_0x2f09b3);}(_0xef6d,0xf8));var _0xdef6=function(_0x124a04,_0x404d65){_0x124a04=_0x124a04-0x0;var _0x20a9f7=_0xef6d[_0x124a04];return _0x20a9f7;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xdef6('0x0'));var jsonpatch=require(_0xdef6('0x1'));var rp=require(_0xdef6('0x2'));var moment=require(_0xdef6('0x3'));var BPromise=require(_0xdef6('0x4'));var Mustache=require(_0xdef6('0x5'));var util=require('util');var path=require(_0xdef6('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xdef6('0x7'));var fs=require('fs');var fs_extra=require(_0xdef6('0x8'));var _=require('lodash');var squel=require(_0xdef6('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xdef6('0xa'));var querystring=require(_0xdef6('0xb'));var Papa=require(_0xdef6('0xc'));var Redis=require('ioredis');var authService=require(_0xdef6('0xd'));var qs=require(_0xdef6('0xe'));var as=require(_0xdef6('0xf'));var hardwareService=require(_0xdef6('0x10'));var logger=require('../../config/logger')(_0xdef6('0x11'));var utils=require(_0xdef6('0x12'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xdef6('0x13'))['db'];function respondWithStatusCode(_0x25cf22,_0x2aa66d){_0x2aa66d=_0x2aa66d||0xcc;return function(_0x483879){if(_0x483879){return _0x25cf22[_0xdef6('0x14')](_0x2aa66d);}return _0x25cf22[_0xdef6('0x15')](_0x2aa66d)['end']();};}function respondWithResult(_0x3c9f60,_0x3ffbb0){_0x3ffbb0=_0x3ffbb0||0xc8;return function(_0x19d56a){if(_0x19d56a){return _0x3c9f60[_0xdef6('0x15')](_0x3ffbb0)[_0xdef6('0x16')](_0x19d56a);}};}function respondWithFilteredResult(_0x1da229,_0x5d0bbc){return function(_0x4c6847){if(_0x4c6847){var _0x1e6943=typeof _0x5d0bbc[_0xdef6('0x17')]===_0xdef6('0x18')&&typeof _0x5d0bbc[_0xdef6('0x19')]===_0xdef6('0x18');var _0x47bbc6=_0x4c6847['count'];var _0x3878e8=_0x1e6943?0x0:_0x5d0bbc[_0xdef6('0x17')];var _0x1a624e=_0x1e6943?_0x4c6847[_0xdef6('0x1a')]:_0x5d0bbc[_0xdef6('0x17')]+_0x5d0bbc[_0xdef6('0x19')];var _0xbe8509;if(_0x1a624e>=_0x47bbc6){_0x1a624e=_0x47bbc6;_0xbe8509=0xc8;}else{_0xbe8509=0xce;}_0x1da229[_0xdef6('0x15')](_0xbe8509);return _0x1da229[_0xdef6('0x1b')](_0xdef6('0x1c'),_0x3878e8+'-'+_0x1a624e+'/'+_0x47bbc6)[_0xdef6('0x16')](_0x4c6847);}return null;};}function patchUpdates(_0x65801b){return function(_0x5a93ab){try{jsonpatch['apply'](_0x5a93ab,_0x65801b,!![]);}catch(_0x12184f){return BPromise[_0xdef6('0x1d')](_0x12184f);}return _0x5a93ab['save']();};}function saveUpdates(_0xad05e9,_0x21095f){return function(_0xb692d2){if(_0xb692d2){return _0xb692d2['update'](_0xad05e9)['then'](function(_0x35778a){return _0x35778a;});}return null;};}function removeEntity(_0x356b6c,_0x379f70){return function(_0x384dbe){if(_0x384dbe){return _0x384dbe[_0xdef6('0x1e')]()[_0xdef6('0x1f')](function(){var _0x3a0f9e=_0x384dbe['get']({'plain':!![]});var _0x21a7ad=_0xdef6('0x20');return db[_0xdef6('0x21')][_0xdef6('0x1e')]({'where':{'type':_0x21a7ad,'resourceId':_0x3a0f9e['id']}})['then'](function(){return _0x384dbe;});})['then'](function(){_0x356b6c[_0xdef6('0x15')](0xcc)[_0xdef6('0x22')]();});}};}function handleEntityNotFound(_0x247793,_0x56bbbd){return function(_0x242b85){if(!_0x242b85){_0x247793[_0xdef6('0x14')](0x194);}return _0x242b85;};}function handleError(_0x726d84,_0x2abbbd){_0x2abbbd=_0x2abbbd||0x1f4;return function(_0x355b02){logger['error'](_0x355b02[_0xdef6('0x23')]);if(_0x355b02[_0xdef6('0x24')]){delete _0x355b02['name'];}_0x726d84[_0xdef6('0x15')](_0x2abbbd)[_0xdef6('0x25')](_0x355b02);};}exports[_0xdef6('0x26')]=function(_0xb27f65,_0x1fc420){var _0x8a3c0={},_0x13d27e={},_0x6cb48={'count':0x0,'rows':[]};var _0xe2e0da=_[_0xdef6('0x27')](db[_0xdef6('0x28')][_0xdef6('0x29')],function(_0x15632f){return{'name':_0x15632f[_0xdef6('0x2a')],'type':_0x15632f[_0xdef6('0x2b')][_0xdef6('0x2c')]};});_0x13d27e[_0xdef6('0x2d')]=_[_0xdef6('0x27')](_0xe2e0da,_0xdef6('0x24'));_0x13d27e['query']=_['keys'](_0xb27f65[_0xdef6('0x2e')]);_0x13d27e[_0xdef6('0x2f')]=_[_0xdef6('0x30')](_0x13d27e[_0xdef6('0x2d')],_0x13d27e['query']);_0x8a3c0[_0xdef6('0x31')]=_[_0xdef6('0x30')](_0x13d27e[_0xdef6('0x2d')],qs[_0xdef6('0x32')](_0xb27f65[_0xdef6('0x2e')][_0xdef6('0x32')]));_0x8a3c0['attributes']=_0x8a3c0[_0xdef6('0x31')][_0xdef6('0x33')]?_0x8a3c0[_0xdef6('0x31')]:_0x13d27e[_0xdef6('0x2d')];if(!_0xb27f65[_0xdef6('0x2e')][_0xdef6('0x34')](_0xdef6('0x35'))){_0x8a3c0[_0xdef6('0x19')]=qs[_0xdef6('0x19')](_0xb27f65[_0xdef6('0x2e')]['limit']);_0x8a3c0[_0xdef6('0x17')]=qs[_0xdef6('0x17')](_0xb27f65['query']['offset']);}_0x8a3c0[_0xdef6('0x36')]=qs[_0xdef6('0x37')](_0xb27f65[_0xdef6('0x2e')]['sort']);_0x8a3c0['where']=qs[_0xdef6('0x2f')](_[_0xdef6('0x38')](_0xb27f65[_0xdef6('0x2e')],_0x13d27e[_0xdef6('0x2f')]),_0xe2e0da);if(_0xb27f65[_0xdef6('0x2e')]['filter']){_0x8a3c0[_0xdef6('0x39')]=_['merge'](_0x8a3c0['where'],{'$or':_['map'](_0xe2e0da,function(_0x38d5cd){if(_0x38d5cd[_0xdef6('0x2b')]!==_0xdef6('0x3a')){var _0x237653={};_0x237653[_0x38d5cd[_0xdef6('0x24')]]={'$like':'%'+_0xb27f65['query']['filter']+'%'};return _0x237653;}})});}_0x8a3c0=_['merge']({},_0x8a3c0,_0xb27f65['options']);var _0x117ada={'where':_0x8a3c0['where']};return db[_0xdef6('0x28')][_0xdef6('0x1a')](_0x117ada)[_0xdef6('0x1f')](function(_0x28f11a){_0x6cb48[_0xdef6('0x1a')]=_0x28f11a;if(_0xb27f65[_0xdef6('0x2e')][_0xdef6('0x3b')]){_0x8a3c0[_0xdef6('0x3c')]=[{'all':!![]}];}return db['Disposition'][_0xdef6('0x3d')](_0x8a3c0);})['then'](function(_0x143023){_0x6cb48[_0xdef6('0x3e')]=_0x143023;return _0x6cb48;})[_0xdef6('0x1f')](respondWithFilteredResult(_0x1fc420,_0x8a3c0))['catch'](handleError(_0x1fc420,null));};exports[_0xdef6('0x3f')]=function(_0x27a27e,_0x363d64){var _0x1d4fb6={'raw':!![],'where':{'id':_0x27a27e[_0xdef6('0x40')]['id']}},_0x2ef488={};_0x2ef488['model']=_['keys'](db[_0xdef6('0x28')][_0xdef6('0x29')]);_0x2ef488[_0xdef6('0x2e')]=_[_0xdef6('0x41')](_0x27a27e[_0xdef6('0x2e')]);_0x2ef488[_0xdef6('0x2f')]=_[_0xdef6('0x30')](_0x2ef488['model'],_0x2ef488[_0xdef6('0x2e')]);_0x1d4fb6[_0xdef6('0x31')]=_[_0xdef6('0x30')](_0x2ef488[_0xdef6('0x2d')],qs[_0xdef6('0x32')](_0x27a27e[_0xdef6('0x2e')][_0xdef6('0x32')]));_0x1d4fb6['attributes']=_0x1d4fb6[_0xdef6('0x31')][_0xdef6('0x33')]?_0x1d4fb6[_0xdef6('0x31')]:_0x2ef488[_0xdef6('0x2d')];if(_0x27a27e[_0xdef6('0x2e')]['includeAll']){_0x1d4fb6[_0xdef6('0x3c')]=[{'all':!![]}];}_0x1d4fb6=_[_0xdef6('0x42')]({},_0x1d4fb6,_0x27a27e[_0xdef6('0x43')]);return db[_0xdef6('0x28')]['find'](_0x1d4fb6)[_0xdef6('0x1f')](handleEntityNotFound(_0x363d64,null))[_0xdef6('0x1f')](respondWithResult(_0x363d64,null))[_0xdef6('0x44')](handleError(_0x363d64,null));};exports[_0xdef6('0x45')]=function(_0x2ce3d3,_0x4aa732){return db['Disposition']['create'](_0x2ce3d3[_0xdef6('0x46')],{})['then'](function(_0x818c05){var _0x40fa25=_0x2ce3d3['user'][_0xdef6('0x47')]({'plain':!![]});if(!_0x40fa25)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x40fa25[_0xdef6('0x48')]===_0xdef6('0x49')){var _0x5d4707=_0x818c05[_0xdef6('0x47')]({'plain':!![]});var _0x514d74='Dispositions';return db[_0xdef6('0x4a')]['find']({'where':{'name':_0x514d74,'userProfileId':_0x40fa25['userProfileId']},'raw':!![]})[_0xdef6('0x1f')](function(_0x5aad9f){if(_0x5aad9f&&_0x5aad9f['autoAssociation']===0x0){return db['UserProfileResource'][_0xdef6('0x45')]({'name':_0x5d4707[_0xdef6('0x24')],'resourceId':_0x5d4707['id'],'type':_0x5aad9f[_0xdef6('0x24')],'sectionId':_0x5aad9f['id']},{})[_0xdef6('0x1f')](function(){return _0x818c05;});}else{return _0x818c05;}})[_0xdef6('0x44')](function(_0x1ef7c3){logger[_0xdef6('0x4b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1ef7c3);throw _0x1ef7c3;});}return _0x818c05;})[_0xdef6('0x1f')](respondWithResult(_0x4aa732,0xc9))[_0xdef6('0x44')](handleError(_0x4aa732,null));};exports[_0xdef6('0x4c')]=function(_0x5baa4b,_0x51f0fa){if(_0x5baa4b[_0xdef6('0x46')]['id']){delete _0x5baa4b[_0xdef6('0x46')]['id'];}return db[_0xdef6('0x28')][_0xdef6('0x4d')]({'where':{'id':_0x5baa4b['params']['id']}})[_0xdef6('0x1f')](handleEntityNotFound(_0x51f0fa,null))[_0xdef6('0x1f')](saveUpdates(_0x5baa4b['body'],null))[_0xdef6('0x1f')](respondWithResult(_0x51f0fa,null))[_0xdef6('0x44')](handleError(_0x51f0fa,null));};exports[_0xdef6('0x1e')]=function(_0xb2cd34,_0x46c996){return db[_0xdef6('0x28')][_0xdef6('0x4d')]({'where':{'id':_0xb2cd34['params']['id']}})[_0xdef6('0x1f')](handleEntityNotFound(_0x46c996,null))['then'](removeEntity(_0x46c996,null))['catch'](handleError(_0x46c996,null));}; \ No newline at end of file +var _0xa74d=['../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','save','update','then','destroy','get','Dispositions','error','stack','name','index','map','fieldName','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','type','options','include','findAll','rows','catch','show','Disposition','rawAttributes','includeAll','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','find','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api'];(function(_0x2c1a84,_0x304202){var _0x1426f5=function(_0x51bf9f){while(--_0x51bf9f){_0x2c1a84['push'](_0x2c1a84['shift']());}};_0x1426f5(++_0x304202);}(_0xa74d,0x193));var _0xda74=function(_0x3f31b9,_0xba9238){_0x3f31b9=_0x3f31b9-0x0;var _0x3def9d=_0xa74d[_0x3f31b9];return _0x3def9d;};'use strict';var emlformat=require(_0xda74('0x0'));var rimraf=require(_0xda74('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xda74('0x2'));var rp=require(_0xda74('0x3'));var moment=require(_0xda74('0x4'));var BPromise=require(_0xda74('0x5'));var Mustache=require(_0xda74('0x6'));var util=require(_0xda74('0x7'));var path=require(_0xda74('0x8'));var sox=require('sox');var csv=require(_0xda74('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xda74('0xa'));var _=require(_0xda74('0xb'));var squel=require('squel');var crypto=require(_0xda74('0xc'));var jsforce=require(_0xda74('0xd'));var deskjs=require(_0xda74('0xe'));var toCsv=require(_0xda74('0x9'));var querystring=require('querystring');var Papa=require(_0xda74('0xf'));var Redis=require(_0xda74('0x10'));var authService=require(_0xda74('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xda74('0x12'));var hardwareService=require(_0xda74('0x13'));var logger=require(_0xda74('0x14'))(_0xda74('0x15'));var utils=require(_0xda74('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xda74('0x17'));var db=require(_0xda74('0x18'))['db'];function respondWithStatusCode(_0x5787ed,_0x33b06d){_0x33b06d=_0x33b06d||0xcc;return function(_0x5c185a){if(_0x5c185a){return _0x5787ed[_0xda74('0x19')](_0x33b06d);}return _0x5787ed[_0xda74('0x1a')](_0x33b06d)[_0xda74('0x1b')]();};}function respondWithResult(_0x94be62,_0x57ef2a){_0x57ef2a=_0x57ef2a||0xc8;return function(_0x5e7ffd){if(_0x5e7ffd){return _0x94be62[_0xda74('0x1a')](_0x57ef2a)['json'](_0x5e7ffd);}};}function respondWithFilteredResult(_0x9fda1b,_0x2180ca){return function(_0x4b55b7){if(_0x4b55b7){var _0x1a8592=typeof _0x2180ca[_0xda74('0x1c')]===_0xda74('0x1d')&&typeof _0x2180ca[_0xda74('0x1e')]===_0xda74('0x1d');var _0xf70198=_0x4b55b7['count'];var _0x4e350e=_0x1a8592?0x0:_0x2180ca[_0xda74('0x1c')];var _0x13338d=_0x1a8592?_0x4b55b7[_0xda74('0x1f')]:_0x2180ca[_0xda74('0x1c')]+_0x2180ca['limit'];var _0x50041f;if(_0x13338d>=_0xf70198){_0x13338d=_0xf70198;_0x50041f=0xc8;}else{_0x50041f=0xce;}_0x9fda1b[_0xda74('0x1a')](_0x50041f);return _0x9fda1b[_0xda74('0x20')](_0xda74('0x21'),_0x4e350e+'-'+_0x13338d+'/'+_0xf70198)[_0xda74('0x22')](_0x4b55b7);}return null;};}function patchUpdates(_0x16c829){return function(_0x4899d2){try{jsonpatch[_0xda74('0x23')](_0x4899d2,_0x16c829,!![]);}catch(_0x56a05a){return BPromise['reject'](_0x56a05a);}return _0x4899d2[_0xda74('0x24')]();};}function saveUpdates(_0xc327c3,_0xbf8cef){return function(_0x35b69d){if(_0x35b69d){return _0x35b69d[_0xda74('0x25')](_0xc327c3)[_0xda74('0x26')](function(_0x470711){return _0x470711;});}return null;};}function removeEntity(_0x397ed4,_0xcc351e){return function(_0xd7cb7c){if(_0xd7cb7c){return _0xd7cb7c[_0xda74('0x27')]()[_0xda74('0x26')](function(){var _0x4eff38=_0xd7cb7c[_0xda74('0x28')]({'plain':!![]});var _0x3ea754=_0xda74('0x29');return db['UserProfileResource'][_0xda74('0x27')]({'where':{'type':_0x3ea754,'resourceId':_0x4eff38['id']}})[_0xda74('0x26')](function(){return _0xd7cb7c;});})[_0xda74('0x26')](function(){_0x397ed4[_0xda74('0x1a')](0xcc)[_0xda74('0x1b')]();});}};}function handleEntityNotFound(_0x4c90f9,_0x3d685a){return function(_0x1e594c){if(!_0x1e594c){_0x4c90f9[_0xda74('0x19')](0x194);}return _0x1e594c;};}function handleError(_0x10b463,_0x538474){_0x538474=_0x538474||0x1f4;return function(_0x509f03){logger[_0xda74('0x2a')](_0x509f03[_0xda74('0x2b')]);if(_0x509f03[_0xda74('0x2c')]){delete _0x509f03[_0xda74('0x2c')];}_0x10b463[_0xda74('0x1a')](_0x538474)['send'](_0x509f03);};}exports[_0xda74('0x2d')]=function(_0x487f39,_0x362945){var _0x43f34d={},_0x3cb033={},_0x6133fb={'count':0x0,'rows':[]};var _0x495ad5=_[_0xda74('0x2e')](db['Disposition']['rawAttributes'],function(_0x4a6176){return{'name':_0x4a6176[_0xda74('0x2f')],'type':_0x4a6176['type']['key']};});_0x3cb033[_0xda74('0x30')]=_[_0xda74('0x2e')](_0x495ad5,_0xda74('0x2c'));_0x3cb033['query']=_[_0xda74('0x31')](_0x487f39[_0xda74('0x32')]);_0x3cb033[_0xda74('0x33')]=_['intersection'](_0x3cb033[_0xda74('0x30')],_0x3cb033['query']);_0x43f34d['attributes']=_[_0xda74('0x34')](_0x3cb033[_0xda74('0x30')],qs['fields'](_0x487f39['query'][_0xda74('0x35')]));_0x43f34d[_0xda74('0x36')]=_0x43f34d[_0xda74('0x36')][_0xda74('0x37')]?_0x43f34d['attributes']:_0x3cb033['model'];if(!_0x487f39['query'][_0xda74('0x38')](_0xda74('0x39'))){_0x43f34d[_0xda74('0x1e')]=qs[_0xda74('0x1e')](_0x487f39['query'][_0xda74('0x1e')]);_0x43f34d[_0xda74('0x1c')]=qs[_0xda74('0x1c')](_0x487f39['query'][_0xda74('0x1c')]);}_0x43f34d[_0xda74('0x3a')]=qs[_0xda74('0x3b')](_0x487f39['query']['sort']);_0x43f34d['where']=qs[_0xda74('0x33')](_[_0xda74('0x3c')](_0x487f39[_0xda74('0x32')],_0x3cb033['filters']),_0x495ad5);if(_0x487f39[_0xda74('0x32')][_0xda74('0x3d')]){_0x43f34d['where']=_[_0xda74('0x3e')](_0x43f34d[_0xda74('0x3f')],{'$or':_[_0xda74('0x2e')](_0x495ad5,function(_0x2f4440){if(_0x2f4440[_0xda74('0x40')]!=='VIRTUAL'){var _0x38f492={};_0x38f492[_0x2f4440[_0xda74('0x2c')]]={'$like':'%'+_0x487f39['query'][_0xda74('0x3d')]+'%'};return _0x38f492;}})});}_0x43f34d=_[_0xda74('0x3e')]({},_0x43f34d,_0x487f39[_0xda74('0x41')]);var _0x439480={'where':_0x43f34d[_0xda74('0x3f')]};return db['Disposition']['count'](_0x439480)[_0xda74('0x26')](function(_0x33e10f){_0x6133fb[_0xda74('0x1f')]=_0x33e10f;if(_0x487f39[_0xda74('0x32')]['includeAll']){_0x43f34d[_0xda74('0x42')]=[{'all':!![]}];}return db['Disposition'][_0xda74('0x43')](_0x43f34d);})[_0xda74('0x26')](function(_0x32f6f4){_0x6133fb[_0xda74('0x44')]=_0x32f6f4;return _0x6133fb;})['then'](respondWithFilteredResult(_0x362945,_0x43f34d))[_0xda74('0x45')](handleError(_0x362945,null));};exports[_0xda74('0x46')]=function(_0x49549c,_0x5a2153){var _0x1b0bb6={'raw':!![],'where':{'id':_0x49549c['params']['id']}},_0x3b330e={};_0x3b330e[_0xda74('0x30')]=_[_0xda74('0x31')](db[_0xda74('0x47')][_0xda74('0x48')]);_0x3b330e[_0xda74('0x32')]=_[_0xda74('0x31')](_0x49549c[_0xda74('0x32')]);_0x3b330e[_0xda74('0x33')]=_[_0xda74('0x34')](_0x3b330e['model'],_0x3b330e['query']);_0x1b0bb6[_0xda74('0x36')]=_[_0xda74('0x34')](_0x3b330e[_0xda74('0x30')],qs['fields'](_0x49549c[_0xda74('0x32')][_0xda74('0x35')]));_0x1b0bb6['attributes']=_0x1b0bb6[_0xda74('0x36')]['length']?_0x1b0bb6[_0xda74('0x36')]:_0x3b330e[_0xda74('0x30')];if(_0x49549c[_0xda74('0x32')][_0xda74('0x49')]){_0x1b0bb6[_0xda74('0x42')]=[{'all':!![]}];}_0x1b0bb6=_[_0xda74('0x3e')]({},_0x1b0bb6,_0x49549c[_0xda74('0x41')]);return db[_0xda74('0x47')]['find'](_0x1b0bb6)[_0xda74('0x26')](handleEntityNotFound(_0x5a2153,null))[_0xda74('0x26')](respondWithResult(_0x5a2153,null))[_0xda74('0x45')](handleError(_0x5a2153,null));};exports[_0xda74('0x4a')]=function(_0x623f62,_0x3ad321){return db[_0xda74('0x47')][_0xda74('0x4a')](_0x623f62[_0xda74('0x4b')],{})[_0xda74('0x26')](function(_0x201d6c){var _0x2aa364=_0x623f62['user'][_0xda74('0x28')]({'plain':!![]});if(!_0x2aa364)throw new Error(_0xda74('0x4c'));if(_0x2aa364[_0xda74('0x4d')]===_0xda74('0x4e')){var _0x420a72=_0x201d6c[_0xda74('0x28')]({'plain':!![]});var _0x2d994c='Dispositions';return db['UserProfileSection']['find']({'where':{'name':_0x2d994c,'userProfileId':_0x2aa364[_0xda74('0x4f')]},'raw':!![]})[_0xda74('0x26')](function(_0x1e7a5d){if(_0x1e7a5d&&_0x1e7a5d[_0xda74('0x50')]===0x0){return db[_0xda74('0x51')][_0xda74('0x4a')]({'name':_0x420a72['name'],'resourceId':_0x420a72['id'],'type':_0x1e7a5d['name'],'sectionId':_0x1e7a5d['id']},{})[_0xda74('0x26')](function(){return _0x201d6c;});}else{return _0x201d6c;}})[_0xda74('0x45')](function(_0x2c89be){logger[_0xda74('0x2a')](_0xda74('0x52'),_0x2c89be);throw _0x2c89be;});}return _0x201d6c;})[_0xda74('0x26')](respondWithResult(_0x3ad321,0xc9))[_0xda74('0x45')](handleError(_0x3ad321,null));};exports[_0xda74('0x25')]=function(_0x81bf7e,_0x505e24){if(_0x81bf7e[_0xda74('0x4b')]['id']){delete _0x81bf7e[_0xda74('0x4b')]['id'];}return db['Disposition']['find']({'where':{'id':_0x81bf7e[_0xda74('0x53')]['id']}})[_0xda74('0x26')](handleEntityNotFound(_0x505e24,null))[_0xda74('0x26')](saveUpdates(_0x81bf7e['body'],null))[_0xda74('0x26')](respondWithResult(_0x505e24,null))[_0xda74('0x45')](handleError(_0x505e24,null));};exports[_0xda74('0x27')]=function(_0x5f14ea,_0x18e50a){return db['Disposition'][_0xda74('0x54')]({'where':{'id':_0x5f14ea[_0xda74('0x53')]['id']}})[_0xda74('0x26')](handleEntityNotFound(_0x18e50a,null))[_0xda74('0x26')](removeEntity(_0x18e50a,null))[_0xda74('0x45')](handleError(_0x18e50a,null));}; \ No newline at end of file diff --git a/server/api/disposition/disposition.model.js b/server/api/disposition/disposition.model.js index 0adf377..2d030a8 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 _0x7697=['name_mail','name_sms','SmsAccountId','name_fax','name_openchannel','OpenchannelAccountId','name_whatsapp','WhatsappAccountId','../../config/logger','request-promise','rimraf','./disposition.attributes','exports','define','Disposition','tools_dispositions','name_voice','name','ListId','name_chat'];(function(_0x201ca3,_0x1d231d){var _0x571eb4=function(_0x1992f5){while(--_0x1992f5){_0x201ca3['push'](_0x201ca3['shift']());}};_0x571eb4(++_0x1d231d);}(_0x7697,0x10c));var _0x7769=function(_0x522c6d,_0x4d250d){_0x522c6d=_0x522c6d-0x0;var _0x26300d=_0x7697[_0x522c6d];return _0x26300d;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x7769('0x0'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x7769('0x1'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7769('0x2'));var config=require('../../config/environment');var attributes=require(_0x7769('0x3'));module[_0x7769('0x4')]=function(_0x3b8462,_0x2c9532){return _0x3b8462[_0x7769('0x5')](_0x7769('0x6'),attributes,{'tableName':_0x7769('0x7'),'paranoid':![],'indexes':[{'unique':!![],'name':_0x7769('0x8'),'fields':[_0x7769('0x9'),_0x7769('0xa')]},{'unique':!![],'name':_0x7769('0xb'),'fields':[_0x7769('0x9'),'ChatWebsiteId']},{'unique':!![],'name':_0x7769('0xc'),'fields':[_0x7769('0x9'),'MailAccountId']},{'unique':!![],'name':_0x7769('0xd'),'fields':[_0x7769('0x9'),_0x7769('0xe')]},{'unique':!![],'name':_0x7769('0xf'),'fields':[_0x7769('0x9'),'FaxAccountId']},{'unique':!![],'name':_0x7769('0x10'),'fields':[_0x7769('0x9'),_0x7769('0x11')]},{'unique':!![],'name':_0x7769('0x12'),'fields':[_0x7769('0x9'),_0x7769('0x13')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xfde3=['api','moment','path','rimraf','../../config/environment','define','tools_dispositions','name','ListId','name_chat','ChatWebsiteId','name_mail','MailAccountId','name_sms','SmsAccountId','FaxAccountId','name_openchannel','name_whatsapp','WhatsappAccountId','util','../../config/logger'];(function(_0xa678fa,_0x2ec71f){var _0x275f86=function(_0x41e952){while(--_0x41e952){_0xa678fa['push'](_0xa678fa['shift']());}};_0x275f86(++_0x2ec71f);}(_0xfde3,0xfa));var _0x3fde=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0xfde3[_0x27af45];return _0x18df21;};'use strict';var _=require('lodash');var util=require(_0x3fde('0x0'));var logger=require(_0x3fde('0x1'))(_0x3fde('0x2'));var moment=require(_0x3fde('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x3fde('0x4'));var rimraf=require(_0x3fde('0x5'));var config=require(_0x3fde('0x6'));var attributes=require('./disposition.attributes');module['exports']=function(_0x15de10,_0x256dcd){return _0x15de10[_0x3fde('0x7')]('Disposition',attributes,{'tableName':_0x3fde('0x8'),'paranoid':![],'indexes':[{'unique':!![],'name':'name_voice','fields':[_0x3fde('0x9'),_0x3fde('0xa')]},{'unique':!![],'name':_0x3fde('0xb'),'fields':[_0x3fde('0x9'),_0x3fde('0xc')]},{'unique':!![],'name':_0x3fde('0xd'),'fields':[_0x3fde('0x9'),_0x3fde('0xe')]},{'unique':!![],'name':_0x3fde('0xf'),'fields':[_0x3fde('0x9'),_0x3fde('0x10')]},{'unique':!![],'name':'name_fax','fields':[_0x3fde('0x9'),_0x3fde('0x11')]},{'unique':!![],'name':_0x3fde('0x12'),'fields':[_0x3fde('0x9'),'OpenchannelAccountId']},{'unique':!![],'name':_0x3fde('0x13'),'fields':[_0x3fde('0x9'),_0x3fde('0x14')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/disposition/disposition.rpc.js b/server/api/disposition/disposition.rpc.js index ecc0a59..d037a53 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(_0x5dc052,_0x2708d3){var _0x2f8570=function(_0x5afd38){while(--_0x5afd38){_0x5dc052['push'](_0x5dc052['shift']());}};_0x2f8570(++_0x2708d3);}(_0xa9e0,0x123));var _0x0a9e=function(_0x34bf97,_0xc60f9d){_0x34bf97=_0x34bf97-0x0;var _0x292719=_0xa9e0[_0x34bf97];return _0x292719;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var 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(_0x4a7c35,_0x6e701c){var _0x3a6471=function(_0x553690){while(--_0x553690){_0x4a7c35['push'](_0x4a7c35['shift']());}};_0x3a6471(++_0x6e701c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5c3c0b,_0x4ee35e){_0x5c3c0b=_0x5c3c0b-0x0;var _0x52ecd2=_0xa9e0[_0x5c3c0b];return _0x52ecd2;};'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 6e54685..1cc7f33 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 _0x7ef7=['get','isAuthenticated','index','show','post','create','put','update','delete','/:id','destroy','exports','util','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./disposition.controller'];(function(_0x4f3d00,_0x188abc){var _0x484889=function(_0x13eb9c){while(--_0x13eb9c){_0x4f3d00['push'](_0x4f3d00['shift']());}};_0x484889(++_0x188abc);}(_0x7ef7,0x91));var _0x77ef=function(_0x18cd92,_0x42cdec){_0x18cd92=_0x18cd92-0x0;var _0xce3947=_0x7ef7[_0x18cd92];return _0xce3947;};'use strict';var multer=require('multer');var util=require(_0x77ef('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x77ef('0x1'));var router=express['Router']();var fs_extra=require(_0x77ef('0x2'));var auth=require(_0x77ef('0x3'));var interaction=require(_0x77ef('0x4'));var config=require(_0x77ef('0x5'));var controller=require(_0x77ef('0x6'));router[_0x77ef('0x7')]('/',auth[_0x77ef('0x8')](),controller[_0x77ef('0x9')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x77ef('0xa')]);router[_0x77ef('0xb')]('/',auth[_0x77ef('0x8')](),controller[_0x77ef('0xc')]);router[_0x77ef('0xd')]('/:id',auth[_0x77ef('0x8')](),controller[_0x77ef('0xe')]);router[_0x77ef('0xf')](_0x77ef('0x10'),auth[_0x77ef('0x8')](),controller[_0x77ef('0x11')]);module[_0x77ef('0x12')]=router; \ No newline at end of file +var _0x0c5a=['multer','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./disposition.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','destroy','exports'];(function(_0x299300,_0x154317){var _0xefb59d=function(_0x4b0fc9){while(--_0x4b0fc9){_0x299300['push'](_0x299300['shift']());}};_0xefb59d(++_0x154317);}(_0x0c5a,0xb4));var _0xa0c5=function(_0x4e8d24,_0x80f7ad){_0x4e8d24=_0x4e8d24-0x0;var _0x52f58b=_0x0c5a[_0x4e8d24];return _0x52f58b;};'use strict';var multer=require(_0xa0c5('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xa0c5('0x1'));var express=require('express');var router=express[_0xa0c5('0x2')]();var fs_extra=require(_0xa0c5('0x3'));var auth=require(_0xa0c5('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xa0c5('0x5'));var controller=require(_0xa0c5('0x6'));router[_0xa0c5('0x7')]('/',auth[_0xa0c5('0x8')](),controller[_0xa0c5('0x9')]);router[_0xa0c5('0x7')](_0xa0c5('0xa'),auth[_0xa0c5('0x8')](),controller[_0xa0c5('0xb')]);router[_0xa0c5('0xc')]('/',auth['isAuthenticated'](),controller[_0xa0c5('0xd')]);router[_0xa0c5('0xe')](_0xa0c5('0xa'),auth[_0xa0c5('0x8')](),controller[_0xa0c5('0xf')]);router['delete'](_0xa0c5('0xa'),auth[_0xa0c5('0x8')](),controller[_0xa0c5('0x10')]);module[_0xa0c5('0x11')]=router; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.attributes.js b/server/api/faxAccount/faxAccount.attributes.js index 798fb27..94600d5 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 _0x187d=['7200','9600','12000','14400','v17,v27,v29','SIP','IAX','KHOMP','TEXT','BOOLEAN','INTEGER','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','STRING','ENUM','yes','localstationid','2400','4800'];(function(_0x20a298,_0x2acce0){var _0x31a729=function(_0xcf6b5f){while(--_0xcf6b5f){_0x20a298['push'](_0x20a298['shift']());}};_0x31a729(++_0x2acce0);}(_0x187d,0x93));var _0xd187=function(_0x5447fd,_0x52a6b5){_0x5447fd=_0x5447fd-0x0;var _0x15b28a=_0x187d[_0x5447fd];return _0x15b28a;};'use strict';var Sequelize=require(_0xd187('0x0'));module['exports']={'name':{'type':Sequelize[_0xd187('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xd187('0x1')]},'ecm':{'type':Sequelize[_0xd187('0x2')](_0xd187('0x3'),'no'),'defaultValue':_0xd187('0x3')},'headerinfo':{'type':Sequelize[_0xd187('0x1')],'defaultValue':'xCALLY\x20Motion\x20Fax'},'localstationid':{'type':Sequelize[_0xd187('0x1')],'unique':_0xd187('0x4')},'minrate':{'type':Sequelize['ENUM'](_0xd187('0x5'),_0xd187('0x6'),_0xd187('0x7'),_0xd187('0x8'),_0xd187('0x9'),_0xd187('0xa')),'defaultValue':_0xd187('0x6')},'maxrate':{'type':Sequelize[_0xd187('0x2')]('2400',_0xd187('0x6'),_0xd187('0x7'),_0xd187('0x8'),_0xd187('0x9'),_0xd187('0xa')),'defaultValue':_0xd187('0xa')},'modem':{'type':Sequelize['STRING'],'defaultValue':_0xd187('0xb')},'gateway':{'type':Sequelize[_0xd187('0x1')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0xd187('0x1')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0xd187('0x2')](_0xd187('0xc'),_0xd187('0xd'),'DADHI',_0xd187('0xe')),'defaultValue':_0xd187('0xc')},'key':{'type':Sequelize[_0xd187('0x1')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0xd187('0xf')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0xd187('0x10')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xd187('0x10')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xd187('0x11')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0xd187('0x11')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xd187('0x11')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xd187('0x11')],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0xd187('0x12'),'set':function(_0x2b3290){if(!_0x2b3290)this[_0xd187('0x13')](_0xd187('0x14'),null);this[_0xd187('0x13')](_0xd187('0x15'),_0x2b3290);}}}; \ No newline at end of file +var _0xfd20=['IAX','DADHI','KHOMP','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','setDataValue','exports','ENUM','yes','STRING','localstationid','2400','4800','12000','14400','7200','INTEGER','SIP'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xfd20,0x66));var _0x0fd2=function(_0x5bc69d,_0x25137d){_0x5bc69d=_0x5bc69d-0x0;var _0x154d9c=_0xfd20[_0x5bc69d];return _0x154d9c;};'use strict';var Sequelize=require('sequelize');module[_0x0fd2('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']},'ecm':{'type':Sequelize[_0x0fd2('0x1')](_0x0fd2('0x2'),'no'),'defaultValue':'yes'},'headerinfo':{'type':Sequelize[_0x0fd2('0x3')],'defaultValue':'xCALLY\x20Motion\x20Fax'},'localstationid':{'type':Sequelize[_0x0fd2('0x3')],'unique':_0x0fd2('0x4')},'minrate':{'type':Sequelize[_0x0fd2('0x1')](_0x0fd2('0x5'),_0x0fd2('0x6'),'7200','9600',_0x0fd2('0x7'),_0x0fd2('0x8')),'defaultValue':_0x0fd2('0x6')},'maxrate':{'type':Sequelize[_0x0fd2('0x1')](_0x0fd2('0x5'),_0x0fd2('0x6'),_0x0fd2('0x9'),'9600',_0x0fd2('0x7'),_0x0fd2('0x8')),'defaultValue':'14400'},'modem':{'type':Sequelize[_0x0fd2('0x3')],'defaultValue':'v17,v27,v29'},'gateway':{'type':Sequelize[_0x0fd2('0x3')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0x0fd2('0x3')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0x0fd2('0xa')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0x0fd2('0x1')](_0x0fd2('0xb'),_0x0fd2('0xc'),_0x0fd2('0xd'),_0x0fd2('0xe')),'defaultValue':'SIP'},'key':{'type':Sequelize['STRING'],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x0fd2('0xf')],'defaultValue':function(){return _0x0fd2('0x10');}},'notificationSound':{'type':Sequelize[_0x0fd2('0x11')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x0fd2('0x11')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0x0fd2('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x0fd2('0x11')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x0fd2('0xa')],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x0fd2('0x11')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x267dfb){if(!_0x267dfb)this[_0x0fd2('0x12')]('mandatoryDispositionPauseId',null);this[_0x0fd2('0x12')]('mandatoryDisposition',_0x267dfb);}}}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.controller.js b/server/api/faxAccount/faxAccount.controller.js index 4d2c65e..28013e9 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 _0xaef6=['user','FaxAccounts','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','addDisposition','FaxAccountId','Disposition','getDispositions','findOne','removeDispositions','addAnswer','CannedAnswer','getAnswers','removeAnswers','ids','addInteraction','omit','getInteractions','order','CmContact','Contact','User','Owner','internal','Tag','Tags','tag','FaxInteraction','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','FaxApplication','bulkCreate','getApplications','context','from-voip-provider','localstationid','app','Fax\x20Extension','priority','appdata','Answer','push','CDR(type)=inbound-fax','ecm','gateway','faxdetect','headerinfo','minrate','modem','t38timeout','FAXOPT(','Set','Wait','/var/opt/motion2/server/files/attachments/fax-${CALLERID(num)}-${CUT(UNIQUEID,.,1)}-${CUT(UNIQUEID,.,2)}-${STRFTIME(,,%C%y%m%d%H%M%S)}-rx.tif,d','addAccountApplications','VoiceExtension','tech','createdAt','TrunkId','ListId','findById','FaxMessage','split','format','YYYY-MM-DD\x20HH:mm:ss','CmList','List','updatedAt','DESC','attachments','join','root','server/files/attachments','basename','CheckAfterSend','isNil','from','fax','Contacts','Send\x20Fax\x20failed','out','filename','Messages','Contact\x20not\x20found','spread','dataValues','SendFax','SendFaxRpc,\x20%s','addAgents','userFaxAccount:save','removeAgents','isArray','emit','userFaxAccount:remove','getAgents','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','./faxAccount.socket','jayson/promise','client','http','request','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','sendStatus','end','undefined','limit','count','offset','status','Content-Range','json','apply','reject','save','update','destroy','get','UserProfileResource','stack','name','index','Pause','mandatoryDispositionPause','FaxAccount','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','params','create'];(function(_0x2447ad,_0x597b29){var _0x5251e6=function(_0x29bb5a){while(--_0x29bb5a){_0x2447ad['push'](_0x2447ad['shift']());}};_0x5251e6(++_0x597b29);}(_0xaef6,0x12a));var _0x6aef=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0xaef6[_0x2c91e9];return _0x13f0ff;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6aef('0x0'));var zipdir=require(_0x6aef('0x1'));var jsonpatch=require(_0x6aef('0x2'));var rp=require(_0x6aef('0x3'));var moment=require(_0x6aef('0x4'));var BPromise=require(_0x6aef('0x5'));var Mustache=require('mustache');var util=require(_0x6aef('0x6'));var path=require(_0x6aef('0x7'));var sox=require(_0x6aef('0x8'));var csv=require('to-csv');var ejs=require(_0x6aef('0x9'));var fs=require('fs');var fs_extra=require(_0x6aef('0xa'));var _=require('lodash');var squel=require(_0x6aef('0xb'));var crypto=require(_0x6aef('0xc'));var jsforce=require(_0x6aef('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x6aef('0xe'));var querystring=require(_0x6aef('0xf'));var Papa=require(_0x6aef('0x10'));var Redis=require('ioredis');var authService=require(_0x6aef('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x6aef('0x12'));var hardwareService=require(_0x6aef('0x13'));var logger=require(_0x6aef('0x14'))(_0x6aef('0x15'));var utils=require(_0x6aef('0x16'));var config=require(_0x6aef('0x17'));var licenseUtil=require(_0x6aef('0x18'));var db=require(_0x6aef('0x19'))['db'];config[_0x6aef('0x1a')]=_[_0x6aef('0x1b')](config[_0x6aef('0x1a')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6aef('0x1a')]));require(_0x6aef('0x1c'))['register'](socket);var jayson=require(_0x6aef('0x1d'));var client=jayson[_0x6aef('0x1e')][_0x6aef('0x1f')]({'port':0x232c});var client9002=jayson[_0x6aef('0x1e')][_0x6aef('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x394a3d,_0x5d3615,_0x436f27,_0x37cbfb){return new BPromise(function(_0x6ffd5c,_0x2f47a9){var _0x61556e=_0x37cbfb||client;return _0x61556e[_0x6aef('0x20')](_0x394a3d,_0x436f27)[_0x6aef('0x21')](function(_0x197036){logger[_0x6aef('0x22')](_0x6aef('0x23'),_0x5d3615,_0x6aef('0x24'));logger[_0x6aef('0x25')]('FaxAccount,\x20%s,\x20%s,\x20%s',_0x5d3615,'request\x20sent',JSON[_0x6aef('0x26')](_0x197036));if(_0x197036[_0x6aef('0x27')]){if(_0x197036['error'][_0x6aef('0x28')]===0x1f4){logger[_0x6aef('0x27')](_0x6aef('0x23'),_0x5d3615,_0x197036['error'][_0x6aef('0x29')]);return _0x2f47a9(_0x197036[_0x6aef('0x27')][_0x6aef('0x29')]);}logger[_0x6aef('0x27')](_0x6aef('0x23'),_0x5d3615,_0x197036[_0x6aef('0x27')][_0x6aef('0x29')]);return _0x6ffd5c(_0x197036['error'][_0x6aef('0x29')]);}else{logger[_0x6aef('0x22')](_0x6aef('0x23'),_0x5d3615,'request\x20sent');_0x6ffd5c(_0x197036[_0x6aef('0x2a')][_0x6aef('0x29')]);}})[_0x6aef('0x2b')](function(_0x50a2f9){logger[_0x6aef('0x27')]('FaxAccount,\x20%s,\x20%s',_0x5d3615,_0x50a2f9);_0x2f47a9(_0x50a2f9);});});}function respondWithStatusCode(_0xeeb222,_0x5abf66){_0x5abf66=_0x5abf66||0xcc;return function(_0x5732ab){if(_0x5732ab){return _0xeeb222[_0x6aef('0x2c')](_0x5abf66);}return _0xeeb222['status'](_0x5abf66)[_0x6aef('0x2d')]();};}function respondWithResult(_0x11e651,_0x770aaf){_0x770aaf=_0x770aaf||0xc8;return function(_0x5b642a){if(_0x5b642a){return _0x11e651['status'](_0x770aaf)['json'](_0x5b642a);}};}function respondWithFilteredResult(_0x344f45,_0x1789e4){return function(_0x5cff67){if(_0x5cff67){var _0x13a907=typeof _0x1789e4['offset']===_0x6aef('0x2e')&&typeof _0x1789e4[_0x6aef('0x2f')]===_0x6aef('0x2e');var _0x4077d8=_0x5cff67[_0x6aef('0x30')];var _0xb7914d=_0x13a907?0x0:_0x1789e4[_0x6aef('0x31')];var _0x453a2f=_0x13a907?_0x5cff67[_0x6aef('0x30')]:_0x1789e4['offset']+_0x1789e4[_0x6aef('0x2f')];var _0x40e460;if(_0x453a2f>=_0x4077d8){_0x453a2f=_0x4077d8;_0x40e460=0xc8;}else{_0x40e460=0xce;}_0x344f45[_0x6aef('0x32')](_0x40e460);return _0x344f45['set'](_0x6aef('0x33'),_0xb7914d+'-'+_0x453a2f+'/'+_0x4077d8)[_0x6aef('0x34')](_0x5cff67);}return null;};}function patchUpdates(_0x5b404a){return function(_0x52f8b6){try{jsonpatch[_0x6aef('0x35')](_0x52f8b6,_0x5b404a,!![]);}catch(_0x12ce42){return BPromise[_0x6aef('0x36')](_0x12ce42);}return _0x52f8b6[_0x6aef('0x37')]();};}function saveUpdates(_0x1fb2c5,_0x15da3b){return function(_0x1d2f74){if(_0x1d2f74){return _0x1d2f74[_0x6aef('0x38')](_0x1fb2c5)[_0x6aef('0x21')](function(_0x3caf87){return _0x3caf87;});}return null;};}function removeEntity(_0x2dfe3d,_0xd2b936){return function(_0x40351f){if(_0x40351f){return _0x40351f[_0x6aef('0x39')]()[_0x6aef('0x21')](function(){var _0x42a93c=_0x40351f[_0x6aef('0x3a')]({'plain':!![]});var _0xd47e1='FaxAccounts';return db[_0x6aef('0x3b')][_0x6aef('0x39')]({'where':{'type':_0xd47e1,'resourceId':_0x42a93c['id']}})['then'](function(){return _0x40351f;});})[_0x6aef('0x21')](function(){_0x2dfe3d[_0x6aef('0x32')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4efbc4,_0x3245fb){return function(_0x1ddbc3){if(!_0x1ddbc3){_0x4efbc4[_0x6aef('0x2c')](0x194);}return _0x1ddbc3;};}function handleError(_0xa7aecf,_0x243672){_0x243672=_0x243672||0x1f4;return function(_0x431f64){logger['error'](_0x431f64[_0x6aef('0x3c')]);if(_0x431f64[_0x6aef('0x3d')]){delete _0x431f64[_0x6aef('0x3d')];}_0xa7aecf['status'](_0x243672)['send'](_0x431f64);};}exports[_0x6aef('0x3e')]=function(_0x18a7e7,_0x58778e){var _0x4312aa={'include':[{'model':db[_0x6aef('0x3f')],'as':_0x6aef('0x40')}]},_0x1369cb={},_0x13a191={'count':0x0,'rows':[]};var _0x22ffbe=_['map'](db[_0x6aef('0x41')][_0x6aef('0x42')],function(_0x2301be){return{'name':_0x2301be[_0x6aef('0x43')],'type':_0x2301be[_0x6aef('0x44')][_0x6aef('0x45')]};});_0x1369cb[_0x6aef('0x46')]=_[_0x6aef('0x47')](_0x22ffbe,_0x6aef('0x3d'));_0x1369cb[_0x6aef('0x48')]=_[_0x6aef('0x49')](_0x18a7e7[_0x6aef('0x48')]);_0x1369cb[_0x6aef('0x4a')]=_[_0x6aef('0x4b')](_0x1369cb[_0x6aef('0x46')],_0x1369cb[_0x6aef('0x48')]);_0x4312aa[_0x6aef('0x4c')]=_[_0x6aef('0x4b')](_0x1369cb['model'],qs[_0x6aef('0x4d')](_0x18a7e7['query']['fields']));_0x4312aa[_0x6aef('0x4c')]=_0x4312aa[_0x6aef('0x4c')][_0x6aef('0x4e')]?_0x4312aa[_0x6aef('0x4c')]:_0x1369cb[_0x6aef('0x46')];if(!_0x18a7e7[_0x6aef('0x48')][_0x6aef('0x4f')](_0x6aef('0x50'))){_0x4312aa[_0x6aef('0x2f')]=qs[_0x6aef('0x2f')](_0x18a7e7[_0x6aef('0x48')][_0x6aef('0x2f')]);_0x4312aa[_0x6aef('0x31')]=qs[_0x6aef('0x31')](_0x18a7e7[_0x6aef('0x48')][_0x6aef('0x31')]);}_0x4312aa['order']=qs[_0x6aef('0x51')](_0x18a7e7[_0x6aef('0x48')]['sort']);_0x4312aa[_0x6aef('0x52')]=qs[_0x6aef('0x4a')](_[_0x6aef('0x53')](_0x18a7e7[_0x6aef('0x48')],_0x1369cb[_0x6aef('0x4a')]),_0x22ffbe);if(_0x18a7e7['query']['filter']){_0x4312aa['where']=_[_0x6aef('0x54')](_0x4312aa[_0x6aef('0x52')],{'$or':_[_0x6aef('0x47')](_0x22ffbe,function(_0x22f9a7){if(_0x22f9a7[_0x6aef('0x44')]!==_0x6aef('0x55')){var _0x95fc1d={};_0x95fc1d[_0x22f9a7[_0x6aef('0x3d')]]={'$like':'%'+_0x18a7e7[_0x6aef('0x48')][_0x6aef('0x56')]+'%'};return _0x95fc1d;}})});}_0x4312aa=_[_0x6aef('0x54')]({},_0x4312aa,_0x18a7e7[_0x6aef('0x57')]);var _0x3e8cc3={'where':_0x4312aa['where']};return db[_0x6aef('0x41')][_0x6aef('0x30')](_0x3e8cc3)[_0x6aef('0x21')](function(_0x29cb61){_0x13a191[_0x6aef('0x30')]=_0x29cb61;if(_0x18a7e7[_0x6aef('0x48')][_0x6aef('0x58')]){_0x4312aa[_0x6aef('0x59')]=[{'all':!![]}];}return db['FaxAccount'][_0x6aef('0x5a')](_0x4312aa);})['then'](function(_0x4ee7dc){_0x13a191[_0x6aef('0x5b')]=_0x4ee7dc;return _0x13a191;})[_0x6aef('0x21')](respondWithFilteredResult(_0x58778e,_0x4312aa))[_0x6aef('0x2b')](handleError(_0x58778e,null));};exports['show']=function(_0x5de1d3,_0x2eb52b){var _0xb6fb6d={'raw':![],'where':{'id':_0x5de1d3[_0x6aef('0x5c')]['id']},'include':[{'model':db[_0x6aef('0x3f')],'as':'mandatoryDispositionPause'}]},_0x1ac347={};_0x1ac347[_0x6aef('0x46')]=_['keys'](db['FaxAccount']['rawAttributes']);_0x1ac347[_0x6aef('0x48')]=_[_0x6aef('0x49')](_0x5de1d3[_0x6aef('0x48')]);_0x1ac347[_0x6aef('0x4a')]=_[_0x6aef('0x4b')](_0x1ac347[_0x6aef('0x46')],_0x1ac347[_0x6aef('0x48')]);_0xb6fb6d[_0x6aef('0x4c')]=_[_0x6aef('0x4b')](_0x1ac347[_0x6aef('0x46')],qs['fields'](_0x5de1d3[_0x6aef('0x48')]['fields']));_0xb6fb6d[_0x6aef('0x4c')]=_0xb6fb6d[_0x6aef('0x4c')]['length']?_0xb6fb6d[_0x6aef('0x4c')]:_0x1ac347['model'];if(_0x5de1d3[_0x6aef('0x48')][_0x6aef('0x58')]){_0xb6fb6d[_0x6aef('0x59')]=[{'all':!![]}];}_0xb6fb6d=_[_0x6aef('0x54')]({},_0xb6fb6d,_0x5de1d3[_0x6aef('0x57')]);return db[_0x6aef('0x41')]['find'](_0xb6fb6d)[_0x6aef('0x21')](handleEntityNotFound(_0x2eb52b,null))[_0x6aef('0x21')](respondWithResult(_0x2eb52b,null))[_0x6aef('0x2b')](handleError(_0x2eb52b,null));};exports[_0x6aef('0x5d')]=function(_0x4e8ff2,_0x422a5e){return db[_0x6aef('0x41')][_0x6aef('0x5d')](_0x4e8ff2['body'],{})[_0x6aef('0x21')](function(_0x339c20){var _0x3e7bcd=_0x4e8ff2[_0x6aef('0x5e')][_0x6aef('0x3a')]({'plain':!![]});if(!_0x3e7bcd)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3e7bcd['role']===_0x6aef('0x5e')){var _0x1a5819=_0x339c20[_0x6aef('0x3a')]({'plain':!![]});var _0x311ea3=_0x6aef('0x5f');return db['UserProfileSection'][_0x6aef('0x60')]({'where':{'name':_0x311ea3,'userProfileId':_0x3e7bcd[_0x6aef('0x61')]},'raw':!![]})['then'](function(_0x29e0f6){if(_0x29e0f6&&_0x29e0f6['autoAssociation']===0x0){return db[_0x6aef('0x3b')][_0x6aef('0x5d')]({'name':_0x1a5819['name'],'resourceId':_0x1a5819['id'],'type':_0x29e0f6[_0x6aef('0x3d')],'sectionId':_0x29e0f6['id']},{})[_0x6aef('0x21')](function(){return _0x339c20;});}else{return _0x339c20;}})[_0x6aef('0x2b')](function(_0x17be0f){logger[_0x6aef('0x27')](_0x6aef('0x62'),_0x17be0f);throw _0x17be0f;});}return _0x339c20;})[_0x6aef('0x21')](respondWithResult(_0x422a5e,0xc9))['catch'](handleError(_0x422a5e,null));};exports[_0x6aef('0x38')]=function(_0x4c187a,_0x389d2e){if(_0x4c187a[_0x6aef('0x63')]['id']){delete _0x4c187a[_0x6aef('0x63')]['id'];}return db[_0x6aef('0x41')][_0x6aef('0x60')]({'where':{'id':_0x4c187a[_0x6aef('0x5c')]['id']},'include':[{'model':db['Pause'],'as':_0x6aef('0x40')}]})['then'](handleEntityNotFound(_0x389d2e,null))[_0x6aef('0x21')](saveUpdates(_0x4c187a[_0x6aef('0x63')],null))[_0x6aef('0x21')](respondWithResult(_0x389d2e,null))['catch'](handleError(_0x389d2e,null));};exports['destroy']=function(_0x1ea49d,_0x53ac58){return db[_0x6aef('0x41')][_0x6aef('0x60')]({'where':{'id':_0x1ea49d[_0x6aef('0x5c')]['id']}})[_0x6aef('0x21')](handleEntityNotFound(_0x53ac58,null))['then'](removeEntity(_0x53ac58,null))[_0x6aef('0x2b')](handleError(_0x53ac58,null));};exports[_0x6aef('0x64')]=function(_0x2adcdb,_0x2db4dd){return db['FaxAccount'][_0x6aef('0x64')]()['then'](respondWithResult(_0x2db4dd,null))['catch'](handleError(_0x2db4dd,null));};exports[_0x6aef('0x65')]=function(_0x14105a,_0x32fe05,_0x3e50fd){if(_0x14105a[_0x6aef('0x63')]['id']){delete _0x14105a[_0x6aef('0x63')]['id'];}return db[_0x6aef('0x41')]['find']({'where':{'id':_0x14105a[_0x6aef('0x5c')]['id']}})[_0x6aef('0x21')](handleEntityNotFound(_0x32fe05,null))['then'](function(_0x4c7758){if(_0x4c7758){_0x14105a[_0x6aef('0x63')][_0x6aef('0x66')]=_0x4c7758['id'];return db[_0x6aef('0x67')]['create'](_0x14105a[_0x6aef('0x63')]);}})['then'](respondWithResult(_0x32fe05,null))[_0x6aef('0x2b')](handleError(_0x32fe05,null));};exports[_0x6aef('0x68')]=function(_0xec6498,_0x258d17,_0x34c8ae){var _0x1f6d84={'raw':![],'where':{}};var _0x49d802={};var _0x534193={'count':0x0,'rows':[]};return db[_0x6aef('0x41')][_0x6aef('0x69')]({'where':{'id':_0xec6498['params']['id']}})['then'](handleEntityNotFound(_0x258d17,null))[_0x6aef('0x21')](function(_0x286851){if(_0x286851){_0x49d802[_0x6aef('0x46')]=_[_0x6aef('0x49')](db[_0x6aef('0x67')][_0x6aef('0x42')]);_0x49d802['query']=_[_0x6aef('0x49')](_0xec6498[_0x6aef('0x48')]);_0x49d802[_0x6aef('0x4a')]=_[_0x6aef('0x4b')](_0x49d802[_0x6aef('0x46')],_0x49d802[_0x6aef('0x48')]);_0x1f6d84['attributes']=_['intersection'](_0x49d802['model'],qs[_0x6aef('0x4d')](_0xec6498[_0x6aef('0x48')][_0x6aef('0x4d')]));_0x1f6d84[_0x6aef('0x4c')]=_0x1f6d84[_0x6aef('0x4c')][_0x6aef('0x4e')]?_0x1f6d84['attributes']:_0x49d802[_0x6aef('0x46')];if(!_0xec6498[_0x6aef('0x48')][_0x6aef('0x4f')](_0x6aef('0x50'))){_0x1f6d84['limit']=qs[_0x6aef('0x2f')](_0xec6498[_0x6aef('0x48')][_0x6aef('0x2f')]);_0x1f6d84[_0x6aef('0x31')]=qs[_0x6aef('0x31')](_0xec6498['query']['offset']);}_0x1f6d84['order']=qs[_0x6aef('0x51')](_0xec6498[_0x6aef('0x48')][_0x6aef('0x51')]);_0x1f6d84['where']=qs['filters'](_[_0x6aef('0x53')](_0xec6498['query'],_0x49d802['filters']));_0x1f6d84['where']['FaxAccountId']=_0x286851['id'];if(_0xec6498[_0x6aef('0x48')]['filter']){_0x1f6d84['where']=_[_0x6aef('0x54')](_0x1f6d84['where'],{'$or':_[_0x6aef('0x47')](_0x1f6d84[_0x6aef('0x4c')],function(_0x2074ad){var _0xf72f46={};_0xf72f46[_0x2074ad]={'$like':'%'+_0xec6498[_0x6aef('0x48')][_0x6aef('0x56')]+'%'};return _0xf72f46;})});}_0x1f6d84=_[_0x6aef('0x54')]({},_0x1f6d84,_0xec6498['options']);return db[_0x6aef('0x67')][_0x6aef('0x30')]({'where':_0x1f6d84[_0x6aef('0x52')]})[_0x6aef('0x21')](function(_0x365d01){_0x534193[_0x6aef('0x30')]=_0x365d01;if(_0xec6498[_0x6aef('0x48')]['includeAll']){_0x1f6d84[_0x6aef('0x59')]=[{'all':!![]}];}return db['Disposition'][_0x6aef('0x5a')](_0x1f6d84);})[_0x6aef('0x21')](function(_0x2a4889){_0x534193[_0x6aef('0x5b')]=_0x2a4889;return _0x534193;});}})['then'](respondWithFilteredResult(_0x258d17,_0x1f6d84))[_0x6aef('0x2b')](handleError(_0x258d17,null));};exports[_0x6aef('0x6a')]=function(_0x31d3c7,_0x5e4f71,_0x58ebdc){return db[_0x6aef('0x41')][_0x6aef('0x60')]({'where':{'id':_0x31d3c7[_0x6aef('0x5c')]['id']}})[_0x6aef('0x21')](handleEntityNotFound(_0x5e4f71,null))[_0x6aef('0x21')](function(_0x4f2d3e){if(_0x4f2d3e){return _0x4f2d3e['removeDispositions'](_0x31d3c7['query']['ids']);}})[_0x6aef('0x21')](respondWithStatusCode(_0x5e4f71,null))['catch'](handleError(_0x5e4f71,null));};exports[_0x6aef('0x6b')]=function(_0x585dc7,_0x64bace,_0x235695){if(_0x585dc7[_0x6aef('0x63')]['id']){delete _0x585dc7[_0x6aef('0x63')]['id'];}return db['FaxAccount'][_0x6aef('0x60')]({'where':{'id':_0x585dc7[_0x6aef('0x5c')]['id']}})[_0x6aef('0x21')](handleEntityNotFound(_0x64bace,null))[_0x6aef('0x21')](function(_0x1500e8){if(_0x1500e8){_0x585dc7[_0x6aef('0x63')][_0x6aef('0x66')]=_0x1500e8['id'];return db[_0x6aef('0x6c')][_0x6aef('0x5d')](_0x585dc7[_0x6aef('0x63')]);}})[_0x6aef('0x21')](respondWithResult(_0x64bace,null))[_0x6aef('0x2b')](handleError(_0x64bace,null));};exports[_0x6aef('0x6d')]=function(_0x334bae,_0x1e8229,_0x1390da){var _0x60846c={'raw':![],'where':{}};var _0x246b93={};var _0x13e4ec={'count':0x0,'rows':[]};return db[_0x6aef('0x41')][_0x6aef('0x69')]({'where':{'id':_0x334bae[_0x6aef('0x5c')]['id']}})[_0x6aef('0x21')](handleEntityNotFound(_0x1e8229,null))[_0x6aef('0x21')](function(_0x1df635){if(_0x1df635){_0x246b93['model']=_['keys'](db[_0x6aef('0x6c')]['rawAttributes']);_0x246b93[_0x6aef('0x48')]=_[_0x6aef('0x49')](_0x334bae[_0x6aef('0x48')]);_0x246b93[_0x6aef('0x4a')]=_[_0x6aef('0x4b')](_0x246b93[_0x6aef('0x46')],_0x246b93[_0x6aef('0x48')]);_0x60846c[_0x6aef('0x4c')]=_[_0x6aef('0x4b')](_0x246b93['model'],qs[_0x6aef('0x4d')](_0x334bae[_0x6aef('0x48')][_0x6aef('0x4d')]));_0x60846c[_0x6aef('0x4c')]=_0x60846c[_0x6aef('0x4c')][_0x6aef('0x4e')]?_0x60846c['attributes']:_0x246b93[_0x6aef('0x46')];if(!_0x334bae['query'][_0x6aef('0x4f')](_0x6aef('0x50'))){_0x60846c[_0x6aef('0x2f')]=qs['limit'](_0x334bae[_0x6aef('0x48')][_0x6aef('0x2f')]);_0x60846c['offset']=qs[_0x6aef('0x31')](_0x334bae[_0x6aef('0x48')][_0x6aef('0x31')]);}_0x60846c['order']=qs[_0x6aef('0x51')](_0x334bae['query'][_0x6aef('0x51')]);_0x60846c[_0x6aef('0x52')]=qs[_0x6aef('0x4a')](_[_0x6aef('0x53')](_0x334bae[_0x6aef('0x48')],_0x246b93['filters']));_0x60846c[_0x6aef('0x52')]['FaxAccountId']=_0x1df635['id'];if(_0x334bae['query'][_0x6aef('0x56')]){_0x60846c[_0x6aef('0x52')]=_[_0x6aef('0x54')](_0x60846c[_0x6aef('0x52')],{'$or':_[_0x6aef('0x47')](_0x60846c[_0x6aef('0x4c')],function(_0x13bab7){var _0x4c67f6={};_0x4c67f6[_0x13bab7]={'$like':'%'+_0x334bae['query']['filter']+'%'};return _0x4c67f6;})});}_0x60846c=_[_0x6aef('0x54')]({},_0x60846c,_0x334bae[_0x6aef('0x57')]);return db['CannedAnswer'][_0x6aef('0x30')]({'where':_0x60846c[_0x6aef('0x52')]})[_0x6aef('0x21')](function(_0x2fd11f){_0x13e4ec[_0x6aef('0x30')]=_0x2fd11f;if(_0x334bae[_0x6aef('0x48')]['includeAll']){_0x60846c[_0x6aef('0x59')]=[{'all':!![]}];}return db[_0x6aef('0x6c')][_0x6aef('0x5a')](_0x60846c);})[_0x6aef('0x21')](function(_0x319ab1){_0x13e4ec[_0x6aef('0x5b')]=_0x319ab1;return _0x13e4ec;});}})[_0x6aef('0x21')](respondWithFilteredResult(_0x1e8229,_0x60846c))[_0x6aef('0x2b')](handleError(_0x1e8229,null));};exports[_0x6aef('0x6e')]=function(_0x1d3330,_0x391d1f,_0x40f179){return db[_0x6aef('0x41')]['find']({'where':{'id':_0x1d3330[_0x6aef('0x5c')]['id']}})[_0x6aef('0x21')](handleEntityNotFound(_0x391d1f,null))[_0x6aef('0x21')](function(_0x566942){if(_0x566942){return _0x566942['removeAnswers'](_0x1d3330[_0x6aef('0x48')][_0x6aef('0x6f')]);}})[_0x6aef('0x21')](respondWithStatusCode(_0x391d1f,null))['catch'](handleError(_0x391d1f,null));};exports[_0x6aef('0x70')]=function(_0x467d34,_0x4e2679,_0x466b26){return db['FaxInteraction']['find']({'where':{'id':_0x467d34[_0x6aef('0x5c')]['id']}})['then'](handleEntityNotFound(_0x4e2679,null))['then'](function(_0x32dc66){if(_0x32dc66){return _0x32dc66[_0x6aef('0x70')](_0x467d34[_0x6aef('0x63')]['ids'],_[_0x6aef('0x71')](_0x467d34[_0x6aef('0x63')],[_0x6aef('0x6f'),'id'])||{});}})['then'](respondWithResult(_0x4e2679,null))[_0x6aef('0x2b')](handleError(_0x4e2679,null));};exports[_0x6aef('0x72')]=function(_0x1ebd1e,_0x5aa703,_0x33acf5){var _0x4eb3d5={'raw':![],'where':{}};var _0x14ea30={};var _0x565a2a={'count':0x0,'rows':[]};return db[_0x6aef('0x41')][_0x6aef('0x69')]({'where':{'id':_0x1ebd1e['params']['id']}})[_0x6aef('0x21')](handleEntityNotFound(_0x5aa703,null))[_0x6aef('0x21')](function(_0x3f0703){if(_0x3f0703){_0x14ea30[_0x6aef('0x46')]=_['keys'](db['FaxInteraction'][_0x6aef('0x42')]);_0x14ea30[_0x6aef('0x48')]=_[_0x6aef('0x49')](_0x1ebd1e[_0x6aef('0x48')]);_0x14ea30[_0x6aef('0x4a')]=_[_0x6aef('0x4b')](_0x14ea30['model'],_0x14ea30[_0x6aef('0x48')]);_0x4eb3d5[_0x6aef('0x4c')]=_['intersection'](_0x14ea30[_0x6aef('0x46')],qs['fields'](_0x1ebd1e['query']['fields']));_0x4eb3d5[_0x6aef('0x4c')]=_0x4eb3d5[_0x6aef('0x4c')][_0x6aef('0x4e')]?_0x4eb3d5[_0x6aef('0x4c')]:_0x14ea30[_0x6aef('0x46')];if(!_0x1ebd1e[_0x6aef('0x48')][_0x6aef('0x4f')](_0x6aef('0x50'))){_0x4eb3d5['limit']=qs['limit'](_0x1ebd1e[_0x6aef('0x48')]['limit']);_0x4eb3d5['offset']=qs[_0x6aef('0x31')](_0x1ebd1e[_0x6aef('0x48')][_0x6aef('0x31')]);}_0x4eb3d5[_0x6aef('0x73')]=qs[_0x6aef('0x51')](_0x1ebd1e[_0x6aef('0x48')][_0x6aef('0x51')]);_0x4eb3d5[_0x6aef('0x52')]=qs[_0x6aef('0x4a')](_[_0x6aef('0x53')](_0x1ebd1e[_0x6aef('0x48')],_0x14ea30['filters']));_0x4eb3d5[_0x6aef('0x52')][_0x6aef('0x66')]=_0x3f0703['id'];if(_0x1ebd1e[_0x6aef('0x48')][_0x6aef('0x56')]){_0x4eb3d5[_0x6aef('0x52')]=_[_0x6aef('0x54')](_0x4eb3d5[_0x6aef('0x52')],{'$or':_['map'](_0x4eb3d5[_0x6aef('0x4c')],function(_0x48d49a){var _0x5e383c={};_0x5e383c[_0x48d49a]={'$like':'%'+_0x1ebd1e[_0x6aef('0x48')][_0x6aef('0x56')]+'%'};return _0x5e383c;})});}_0x4eb3d5=_[_0x6aef('0x54')]({},_0x4eb3d5,_0x1ebd1e[_0x6aef('0x57')]);return db['FaxInteraction'][_0x6aef('0x30')]({'where':_0x4eb3d5[_0x6aef('0x52')]})[_0x6aef('0x21')](function(_0x5913b6){_0x565a2a[_0x6aef('0x30')]=_0x5913b6;if(_0x1ebd1e[_0x6aef('0x48')][_0x6aef('0x58')]){_0x4eb3d5['include']=[{'model':db[_0x6aef('0x74')],'as':_0x6aef('0x75'),'required':![]},{'model':db[_0x6aef('0x76')],'as':_0x6aef('0x77'),'attributes':[_0x6aef('0x3d'),'fullname',_0x6aef('0x78')],'required':![]},{'model':db[_0x6aef('0x79')],'as':_0x6aef('0x7a'),'attributes':['id',_0x6aef('0x3d'),'color'],'where':_0x1ebd1e['query'][_0x6aef('0x7b')]?{'id':_0x1ebd1e[_0x6aef('0x48')][_0x6aef('0x7b')]}:undefined,'required':_0x1ebd1e[_0x6aef('0x48')]['tag']?!![]:![]}];}return db[_0x6aef('0x7c')][_0x6aef('0x5a')](_0x4eb3d5);})[_0x6aef('0x21')](function(_0x1381a1){_0x565a2a[_0x6aef('0x5b')]=_0x1381a1;return _0x565a2a;});}})['then'](respondWithFilteredResult(_0x5aa703,_0x4eb3d5))['catch'](handleError(_0x5aa703,null));};exports[_0x6aef('0x7d')]=function(_0x128fed,_0x3bdb19){var _0x15ee9e=_0x128fed[_0x6aef('0x5c')]['id'];var _0x10f457=_0x128fed[_0x6aef('0x63')];var _0x5354a1=0xc8;var _0x46d9a5=null;return db[_0x6aef('0x7e')][_0x6aef('0x7f')]({'isolationLevel':db[_0x6aef('0x7e')][_0x6aef('0x80')][_0x6aef('0x81')][_0x6aef('0x82')]},function(_0x58c250){return db[_0x6aef('0x41')]['findOne']({'where':{'id':_0x15ee9e},'transaction':_0x58c250})['then'](function(_0x19a119){if(_0x19a119){return db[_0x6aef('0x83')][_0x6aef('0x39')]({'where':{'FaxAccountId':_0x15ee9e},'transaction':_0x58c250})[_0x6aef('0x21')](function(){var _0x407852=_[_0x6aef('0x47')](_0x10f457,function(_0x180a9a){_0x180a9a['FaxAccountId']=_0x15ee9e;return _0x180a9a;});return db[_0x6aef('0x83')][_0x6aef('0x84')](_0x407852,{'transaction':_0x58c250});});}else{_0x5354a1=0x194;_0x46d9a5=[];}});})[_0x6aef('0x21')](function(){if(_0x5354a1!==0x194){return db['FaxApplication']['findAndCountAll']({'where':{'FaxAccountId':_0x15ee9e},'order':'priority'})[_0x6aef('0x21')](function(_0x5a472c){_0x46d9a5=_0x5a472c;});}})[_0x6aef('0x2b')](function(_0x2ce875){_0x5354a1=0x1f4;logger[_0x6aef('0x27')](_0x2ce875[_0x6aef('0x3c')]);if(_0x2ce875[_0x6aef('0x3d')]){delete _0x2ce875['name'];}_0x46d9a5=_0x2ce875;})['finally'](function(){if(_0x46d9a5===null){_0x3bdb19[_0x6aef('0x2c')](_0x5354a1);}else{if(_0x5354a1===0x1f4){_0x3bdb19[_0x6aef('0x32')](_0x5354a1)['send'](_0x46d9a5);}else{_0x3bdb19['status'](_0x5354a1)[_0x6aef('0x34')](_0x46d9a5);}}});};exports['getApplications']=function(_0x2122a1,_0x969192,_0x16e2cd){var _0xa8256b={};var _0x5f1996={};var _0x4e967b;var _0x5c4aad;return db[_0x6aef('0x41')]['findOne']({'where':{'id':_0x2122a1['params']['id']}})[_0x6aef('0x21')](handleEntityNotFound(_0x969192,null))['then'](function(_0x31c7b9){if(_0x31c7b9){_0x4e967b=_0x31c7b9;_0x5f1996[_0x6aef('0x46')]=_[_0x6aef('0x49')](db[_0x6aef('0x83')][_0x6aef('0x42')]);_0x5f1996[_0x6aef('0x48')]=_[_0x6aef('0x49')](_0x2122a1[_0x6aef('0x48')]);_0x5f1996[_0x6aef('0x4a')]=_[_0x6aef('0x4b')](_0x5f1996['model'],_0x5f1996['query']);_0xa8256b[_0x6aef('0x4c')]=_[_0x6aef('0x4b')](_0x5f1996[_0x6aef('0x46')],qs[_0x6aef('0x4d')](_0x2122a1['query'][_0x6aef('0x4d')]));_0xa8256b[_0x6aef('0x4c')]=_0xa8256b['attributes']['length']?_0xa8256b[_0x6aef('0x4c')]:_0x5f1996[_0x6aef('0x46')];_0xa8256b['order']=qs[_0x6aef('0x51')](_0x2122a1['query'][_0x6aef('0x51')]);_0xa8256b[_0x6aef('0x52')]=qs[_0x6aef('0x4a')](_['pick'](_0x2122a1[_0x6aef('0x48')],_0x5f1996[_0x6aef('0x4a')]));if(_0x2122a1[_0x6aef('0x48')][_0x6aef('0x56')]){_0xa8256b[_0x6aef('0x52')]=_[_0x6aef('0x54')](_0xa8256b[_0x6aef('0x52')],{'$or':_['map'](_0xa8256b[_0x6aef('0x4c')],function(_0x26ab57){var _0x55af09={};_0x55af09[_0x26ab57]={'$like':'%'+_0x2122a1[_0x6aef('0x48')][_0x6aef('0x56')]+'%'};return _0x55af09;})});}_0xa8256b=_[_0x6aef('0x54')]({},_0xa8256b,_0x2122a1[_0x6aef('0x57')]);return _0x4e967b[_0x6aef('0x85')](_0xa8256b);}})[_0x6aef('0x21')](function(_0x1fed4f){if(_0x1fed4f){_0x5c4aad=_0x1fed4f[_0x6aef('0x4e')];if(!_0x2122a1[_0x6aef('0x48')][_0x6aef('0x4f')](_0x6aef('0x50'))){_0xa8256b[_0x6aef('0x2f')]=qs[_0x6aef('0x2f')](_0x2122a1[_0x6aef('0x48')][_0x6aef('0x2f')]);_0xa8256b['offset']=qs['offset'](_0x2122a1[_0x6aef('0x48')][_0x6aef('0x31')]);}return _0x4e967b[_0x6aef('0x85')](_0xa8256b);}})[_0x6aef('0x21')](function(_0x4241bf){if(_0x4241bf){return _0x4241bf?{'count':_0x5c4aad,'rows':_0x4241bf}:null;}})[_0x6aef('0x21')](respondWithResult(_0x969192,null))[_0x6aef('0x2b')](handleError(_0x969192,null));};function Extension(_0x1904a1,_0x22b99b,_0x242074,_0x13b425){this[_0x6aef('0x86')]=_0x6aef('0x87');this['exten']=_0x1904a1[_0x6aef('0x88')];this[_0x6aef('0x89')]=_0x13b425;this[_0x6aef('0x44')]='system';this['description']=_0x6aef('0x8a');this[_0x6aef('0x66')]=_0x1904a1['id'];this[_0x6aef('0x8b')]=_0x22b99b;this[_0x6aef('0x8c')]=_0x242074;}function createExtensionsReciveFax(_0x2f0025){var _0x27eb82=0x1;var _0x224498=[];_0x224498['push'](new Extension(_0x2f0025,_0x27eb82,'',_0x6aef('0x8d')));_0x27eb82+=0x1;_0x224498[_0x6aef('0x8e')](new Extension(_0x2f0025,_0x27eb82,_0x6aef('0x8f'),'Set'));_0x27eb82+=0x1;for(var _0x518b8c in _0x2f0025){if(_0x2f0025[_0x6aef('0x4f')](_0x518b8c)&&(_0x518b8c===_0x6aef('0x90')||_0x518b8c===_0x6aef('0x88')||_0x518b8c===_0x6aef('0x91')||_0x518b8c===_0x6aef('0x92')||_0x518b8c===_0x6aef('0x93')||_0x518b8c==='maxrate'||_0x518b8c===_0x6aef('0x94')||_0x518b8c===_0x6aef('0x95')||_0x518b8c===_0x6aef('0x96'))){_0x224498[_0x6aef('0x8e')](new Extension(_0x2f0025,_0x27eb82,_0x6aef('0x97')+_0x518b8c+')='+_0x2f0025[_0x518b8c],_0x6aef('0x98')));_0x27eb82+=0x1;}}_0x224498[_0x6aef('0x8e')](new Extension(_0x2f0025,_0x27eb82,'6',_0x6aef('0x99')));_0x27eb82+=0x1;_0x224498[_0x6aef('0x8e')](new Extension(_0x2f0025,_0x27eb82,_0x6aef('0x9a'),'ReceiveFax'));_0x27eb82=0x0;return _0x224498;}exports[_0x6aef('0x9b')]=function(_0x34300d,_0xfb1810,_0x3fa341){var _0x422fb5;return db[_0x6aef('0x7e')][_0x6aef('0x7f')](function(_0x5b8905){return db[_0x6aef('0x41')][_0x6aef('0x5d')](_0x34300d[_0x6aef('0x63')],{'transaction':_0x5b8905})[_0x6aef('0x21')](function(_0xa9c151){_0x422fb5=_0xa9c151[_0x6aef('0x3a')]({'plain':!![]});return db[_0x6aef('0x9c')][_0x6aef('0x84')](createExtensionsReciveFax(_0x422fb5),{'transaction':_0x5b8905});});})[_0x6aef('0x21')](function(){return _0x422fb5;})[_0x6aef('0x21')](respondWithResult(_0xfb1810,null))['catch'](handleError(_0xfb1810,null));};exports['updateAccountApplications']=function(_0x2c8143,_0x2c1264,_0x3dda5f){var _0x56e521;return db[_0x6aef('0x7e')]['transaction'](function(_0x1ee8ba){return db[_0x6aef('0x41')][_0x6aef('0x38')](_0x2c8143[_0x6aef('0x63')],{'where':{'id':_0x2c8143[_0x6aef('0x63')]['id']},'transaction':_0x1ee8ba})[_0x6aef('0x21')](function(_0x5ae9c7){return db['VoiceExtension']['destroy']({'where':{'FaxAccountId':_0x2c8143[_0x6aef('0x63')]['id']},'transaction':_0x1ee8ba})[_0x6aef('0x21')](function(_0x2e8331){return db[_0x6aef('0x9c')][_0x6aef('0x84')](createExtensionsReciveFax(_[_0x6aef('0x71')](_0x2c8143[_0x6aef('0x63')],[_0x6aef('0x9d'),_0x6aef('0x45'),_0x6aef('0x9e'),'updatedAt',_0x6aef('0x9f'),_0x6aef('0xa0')])),{'transaction':_0x1ee8ba});});});})[_0x6aef('0x21')](function(){return db[_0x6aef('0x41')][_0x6aef('0xa1')](_0x2c8143[_0x6aef('0x63')]['id']);})[_0x6aef('0x21')](respondWithResult(_0x2c1264,null))[_0x6aef('0x2b')](handleError(_0x2c1264,null));};exports['getMessages']=function(_0x1fbcc7,_0x2d6a62,_0xb73240){var _0x2015e1={'raw':!![],'where':{}};var _0x3f2039={};var _0x47d866={'count':0x0,'rows':[]};return db[_0x6aef('0x41')][_0x6aef('0x69')]({'where':{'id':_0x1fbcc7[_0x6aef('0x5c')]['id']}})['then'](handleEntityNotFound(_0x2d6a62,null))[_0x6aef('0x21')](function(_0x3a1e51){if(_0x3a1e51){_0x3f2039[_0x6aef('0x46')]=_[_0x6aef('0x49')](db[_0x6aef('0xa2')]['rawAttributes']);_0x3f2039['query']=_[_0x6aef('0x49')](_0x1fbcc7[_0x6aef('0x48')]);_0x3f2039[_0x6aef('0x4a')]=_['intersection'](_0x3f2039[_0x6aef('0x46')],_0x3f2039[_0x6aef('0x48')]);_0x2015e1[_0x6aef('0x4c')]=_['intersection'](_0x3f2039[_0x6aef('0x46')],qs[_0x6aef('0x4d')](_0x1fbcc7['query']['fields']));_0x2015e1['attributes']=_0x2015e1[_0x6aef('0x4c')][_0x6aef('0x4e')]?_0x2015e1[_0x6aef('0x4c')]:_0x3f2039[_0x6aef('0x46')];if(!_0x1fbcc7[_0x6aef('0x48')][_0x6aef('0x4f')](_0x6aef('0x50'))){_0x2015e1[_0x6aef('0x2f')]=qs[_0x6aef('0x2f')](_0x1fbcc7[_0x6aef('0x48')]['limit']);_0x2015e1[_0x6aef('0x31')]=qs[_0x6aef('0x31')](_0x1fbcc7[_0x6aef('0x48')][_0x6aef('0x31')]);}_0x2015e1[_0x6aef('0x73')]=qs[_0x6aef('0x51')](_0x1fbcc7[_0x6aef('0x48')][_0x6aef('0x51')]);_0x2015e1['where']=qs[_0x6aef('0x4a')](_['pick'](_0x1fbcc7[_0x6aef('0x48')],_0x3f2039[_0x6aef('0x4a')]));_0x2015e1[_0x6aef('0x52')][_0x6aef('0x66')]=_0x3a1e51['id'];if(_0x1fbcc7[_0x6aef('0x48')][_0x6aef('0x56')]){_0x2015e1[_0x6aef('0x52')]=_[_0x6aef('0x54')](_0x2015e1[_0x6aef('0x52')],{'$or':_[_0x6aef('0x47')](_0x2015e1[_0x6aef('0x4c')],function(_0x204c30){var _0x527729={};_0x527729[_0x204c30]={'$like':'%'+_0x1fbcc7[_0x6aef('0x48')][_0x6aef('0x56')]+'%'};return _0x527729;})});}if(_0x1fbcc7[_0x6aef('0x48')]['$gte']){var _0x30b130=_0x1fbcc7['query']['$gte'][_0x6aef('0xa3')](',');var _0xee103e={};_0xee103e[_0x30b130[0x0]]={'$gte':moment(_0x30b130[0x1])[_0x6aef('0xa4')](_0x6aef('0xa5'))};_0x2015e1['where']=_[_0x6aef('0x54')](_0x2015e1[_0x6aef('0x52')],_0xee103e);}_0x2015e1=_[_0x6aef('0x54')]({},_0x2015e1,_0x1fbcc7[_0x6aef('0x57')]);return db[_0x6aef('0xa2')][_0x6aef('0x30')]({'where':_0x2015e1[_0x6aef('0x52')]})[_0x6aef('0x21')](function(_0x5a503e){_0x47d866['count']=_0x5a503e;if(_0x1fbcc7[_0x6aef('0x48')][_0x6aef('0x58')]){_0x2015e1[_0x6aef('0x59')]=[{'all':!![]}];}return db[_0x6aef('0xa2')][_0x6aef('0x5a')](_0x2015e1);})[_0x6aef('0x21')](function(_0x5d2059){_0x47d866[_0x6aef('0x5b')]=_0x5d2059;return _0x47d866;});}})[_0x6aef('0x21')](respondWithFilteredResult(_0x2d6a62,_0x2015e1))['catch'](handleError(_0x2d6a62,null));};exports['send']=function(_0x260eb3,_0x528bfc,_0x1c76ed){var _0x4bafb4,_0x209e17={},_0x4e6b02;if(_0x260eb3[_0x6aef('0x63')]['to']){_0x4e6b02=_0x260eb3[_0x6aef('0x63')]['to'][0x0];}return db[_0x6aef('0x41')][_0x6aef('0x60')]({'where':{'id':_0x260eb3['params']['id']},'include':[{'model':db[_0x6aef('0xa6')],'as':_0x6aef('0xa7'),'include':[{'model':db[_0x6aef('0x74')],'as':'Contacts','where':{'fax':_0x4e6b02},'limit':0x1,'order':[[_0x6aef('0xa8'),_0x6aef('0xa9')]]}]}]})[_0x6aef('0x21')](handleEntityNotFound(_0x528bfc,null))['then'](function(_0x5e4d77){_0x4bafb4=_0x5e4d77;if(_0x260eb3[_0x6aef('0x63')][_0x6aef('0xaa')]&&_0x260eb3[_0x6aef('0x63')][_0x6aef('0xaa')][_0x6aef('0x4e')]){for(var _0x14504d=0x0;_0x14504d<_0x260eb3[_0x6aef('0x63')][_0x6aef('0xaa')][_0x6aef('0x4e')];_0x14504d+=0x1){_0x260eb3[_0x6aef('0x63')][_0x6aef('0xaa')][_0x14504d]={'filename':_0x260eb3[_0x6aef('0x63')]['attachments'][_0x14504d]['name'],'id':_0x260eb3['body'][_0x6aef('0xaa')][_0x14504d]['id'],'path':path[_0x6aef('0xab')](config[_0x6aef('0xac')],_0x6aef('0xad'),_0x260eb3[_0x6aef('0x63')]['attachments'][_0x14504d][_0x6aef('0xae')])};}}return respondWithRpcPromise(_0x6aef('0xaf'),'CheckAfterSend',{'FaxAccountId':_[_0x6aef('0xb0')](_0x260eb3[_0x6aef('0x5c')]['id'])?undefined:_0x260eb3[_0x6aef('0x5c')]['id'],'path':_[_0x6aef('0xb0')](_0x260eb3['body'][_0x6aef('0xaa')][0x0][_0x6aef('0x7')])?undefined:_0x260eb3[_0x6aef('0x63')][_0x6aef('0xaa')][0x0]['path'],'fax':_[_0x6aef('0xb0')](_0x260eb3['body']['to'][0x0])?undefined:_0x260eb3[_0x6aef('0x63')]['to'][0x0]},client9002);})['then'](function(){if(_0x4bafb4){if(_['isNil'](_0x260eb3[_0x6aef('0x63')][_0x6aef('0xb1')])){_0x260eb3[_0x6aef('0x63')][_0x6aef('0xb1')]=util[_0x6aef('0xa4')]('\x22%s\x22\x20<%s>',_0x4bafb4[_0x6aef('0x3d')],_0x4bafb4[_0x6aef('0xb2')]);}if(_0x4bafb4[_0x6aef('0xa7')]){if(_0x4bafb4[_0x6aef('0xa7')][_0x6aef('0xb3')]['length']){return _0x4bafb4[_0x6aef('0xa7')][_0x6aef('0xb3')][0x0];}else{return db[_0x6aef('0x74')][_0x6aef('0x5d')](_[_0x6aef('0x1b')](_0x260eb3['body'],{'firstName':_0x260eb3[_0x6aef('0x63')]['to'][0x0],'phone':_0x260eb3[_0x6aef('0x63')]['to'][0x0],'fax':_0x260eb3[_0x6aef('0x63')]['to'][0x0],'ListId':_0x4bafb4['ListId']}));}}else{throw new Error('List\x20not\x20found');}}else{throw new Error(_0x6aef('0xb4'));}})[_0x6aef('0x21')](function(_0xbae568){if(_0xbae568){return db['FaxInteraction'][_0x6aef('0x60')]({'where':{'ContactId':_0xbae568['id'],'closed':![],'FaxAccountId':_0x4bafb4['id']}})[_0x6aef('0x21')](function(_0x4b891a){if(_0x4b891a){return[_0x4b891a,![]];}return db[_0x6aef('0x7c')][_0x6aef('0x5d')]({'UserId':_0x260eb3[_0x6aef('0x5e')]['id'],'ContactId':_0xbae568['id'],'FaxAccountId':_0x4bafb4['id'],'fax':_0x260eb3[_0x6aef('0x63')]['to'][0x0],'firstMsgDirection':_0x6aef('0xb5'),'Messages':[_['merge'](_0x260eb3[_0x6aef('0x63')],{'read':![],'body':_0x260eb3[_0x6aef('0x63')][_0x6aef('0xaa')][0x0][_0x6aef('0xb6')],'FaxAccountId':_0x4bafb4['id'],'UserId':_0x260eb3[_0x6aef('0x5e')]['id'],'ContactId':_0xbae568['id'],'AttachmentId':_0x260eb3[_0x6aef('0x63')][_0x6aef('0xaa')][0x0]['id']})]},{'include':[{'model':db['FaxMessage'],'as':_0x6aef('0xb7')}]})[_0x6aef('0x21')](function(_0x19c087){return[_0x19c087,!![]];});});}else{throw new Error(_0x6aef('0xb8'));}})[_0x6aef('0xb9')](function(_0x1a5e19,_0x435e0b){if(_0x435e0b){return _0x1a5e19;}return db[_0x6aef('0xa2')][_0x6aef('0x5d')]({'direction':_0x6aef('0xb5'),'read':![],'body':_0x260eb3['body'][_0x6aef('0xaa')][0x0][_0x6aef('0xb6')],'FaxAccountId':_0x4bafb4['id'],'FaxInteractionId':_0x1a5e19['id'],'UserId':_0x260eb3[_0x6aef('0x5e')]['id'],'ContactId':_0x1a5e19['ContactId'],'AttachmentId':_0x260eb3['body'][_0x6aef('0xaa')][0x0]['id']})[_0x6aef('0x21')](function(_0x11e0bd){_0x1a5e19[_0x6aef('0xba')]['Messages']=[];_0x1a5e19[_0x6aef('0xba')]['Messages'][_0x6aef('0x8e')](_0x11e0bd[_0x6aef('0xba')]);return _0x1a5e19;});})[_0x6aef('0x21')](function(_0x17c132){respondWithRpcPromise(_0x6aef('0xbb'),_0x6aef('0xbb'),{'FaxAccountId':_[_0x6aef('0xb0')](_0x260eb3['params']['id'])?undefined:_0x260eb3['params']['id'],'path':_[_0x6aef('0xb0')](_0x260eb3[_0x6aef('0x63')][_0x6aef('0xaa')][0x0][_0x6aef('0x7')])?undefined:_0x260eb3[_0x6aef('0x63')][_0x6aef('0xaa')][0x0][_0x6aef('0x7')],'fax':_[_0x6aef('0xb0')](_0x260eb3[_0x6aef('0x63')]['to'][0x0])?undefined:_0x260eb3[_0x6aef('0x63')]['to'][0x0],'AttachmentId':_0x260eb3[_0x6aef('0x63')][_0x6aef('0xaa')][0x0]['id']},client9002)[_0x6aef('0x21')](function(_0x59ff0e){logger[_0x6aef('0x22')](_0x6aef('0xbc'),_0x59ff0e);})['catch'](function(_0xfff5c9){logger[_0x6aef('0x22')]('SendFaxRpc,\x20%s',_0xfff5c9);});return _0x17c132;})[_0x6aef('0x21')](respondWithResult(_0x528bfc,null))['catch'](handleError(_0x528bfc,null));};exports[_0x6aef('0xbd')]=function(_0x4566a0,_0x308820,_0x51caa1){return db[_0x6aef('0x41')][_0x6aef('0x60')]({'where':{'id':_0x4566a0[_0x6aef('0x5c')]['id']}})[_0x6aef('0x21')](handleEntityNotFound(_0x308820,null))['then'](function(_0x184b3a){if(_0x184b3a){return _0x184b3a[_0x6aef('0xbd')](_0x4566a0[_0x6aef('0x63')]['ids'],_[_0x6aef('0x71')](_0x4566a0[_0x6aef('0x63')],[_0x6aef('0x6f'),'id'])||{})[_0x6aef('0xb9')](function(_0x1c1aac){for(var _0x4004ee=0x0;_0x4004ee<_0x4566a0[_0x6aef('0x63')][_0x6aef('0x6f')]['length'];_0x4004ee+=0x1){socket['emit'](_0x6aef('0xbe'),{'UserId':Number(_0x4566a0['body'][_0x6aef('0x6f')][_0x4004ee]),'FaxAccountId':Number(_0x4566a0[_0x6aef('0x5c')]['id'])});}return _0x1c1aac;});}})['then'](respondWithResult(_0x308820,null))[_0x6aef('0x2b')](handleError(_0x308820,null));};exports['removeAgents']=function(_0x3652a8,_0x5b38b7,_0x276da5){return db[_0x6aef('0x41')][_0x6aef('0x60')]({'where':{'id':_0x3652a8['params']['id']}})[_0x6aef('0x21')](handleEntityNotFound(_0x5b38b7,null))[_0x6aef('0x21')](function(_0x388db1){if(_0x388db1){return _0x388db1[_0x6aef('0xbf')](_0x3652a8[_0x6aef('0x48')]['ids'])['then'](function(){if(_[_0x6aef('0xc0')](_0x3652a8['query']['ids'])){for(var _0x5bdd90=0x0;_0x5bdd90<_0x3652a8[_0x6aef('0x48')][_0x6aef('0x6f')][_0x6aef('0x4e')];_0x5bdd90+=0x1){socket[_0x6aef('0xc1')](_0x6aef('0xc2'),{'UserId':Number(_0x3652a8[_0x6aef('0x48')][_0x6aef('0x6f')][_0x5bdd90]),'FaxAccountId':Number(_0x3652a8[_0x6aef('0x5c')]['id'])});}}else{socket[_0x6aef('0xc1')](_0x6aef('0xc2'),{'UserId':Number(_0x3652a8[_0x6aef('0x48')][_0x6aef('0x6f')]),'FaxAccountId':Number(_0x3652a8[_0x6aef('0x5c')]['id'])});}});}})[_0x6aef('0x21')](respondWithStatusCode(_0x5b38b7,null))['catch'](handleError(_0x5b38b7,null));};exports[_0x6aef('0xc3')]=function(_0x5cdd28,_0x371acd,_0x376481){var _0x3f3eba={};var _0x2c716c={};var _0x6a9d23;var _0x16b95a;return db[_0x6aef('0x41')][_0x6aef('0x69')]({'where':{'id':_0x5cdd28[_0x6aef('0x5c')]['id']}})[_0x6aef('0x21')](handleEntityNotFound(_0x371acd,null))[_0x6aef('0x21')](function(_0x315967){if(_0x315967){_0x6a9d23=_0x315967;_0x2c716c['model']=_[_0x6aef('0x49')](db[_0x6aef('0x76')][_0x6aef('0x42')]);_0x2c716c['query']=_[_0x6aef('0x49')](_0x5cdd28['query']);_0x2c716c[_0x6aef('0x4a')]=_['intersection'](_0x2c716c[_0x6aef('0x46')],_0x2c716c[_0x6aef('0x48')]);_0x3f3eba[_0x6aef('0x4c')]=_[_0x6aef('0x4b')](_0x2c716c['model'],qs[_0x6aef('0x4d')](_0x5cdd28[_0x6aef('0x48')]['fields']));_0x3f3eba['attributes']=_0x3f3eba[_0x6aef('0x4c')][_0x6aef('0x4e')]?_0x3f3eba['attributes']:_0x2c716c[_0x6aef('0x46')];_0x3f3eba[_0x6aef('0x73')]=qs[_0x6aef('0x51')](_0x5cdd28['query'][_0x6aef('0x51')]);_0x3f3eba[_0x6aef('0x52')]=qs[_0x6aef('0x4a')](_[_0x6aef('0x53')](_0x5cdd28[_0x6aef('0x48')],_0x2c716c['filters']));if(_0x5cdd28[_0x6aef('0x48')][_0x6aef('0x56')]){_0x3f3eba[_0x6aef('0x52')]=_[_0x6aef('0x54')](_0x3f3eba[_0x6aef('0x52')],{'$or':_[_0x6aef('0x47')](_0x3f3eba[_0x6aef('0x4c')],function(_0x4e0806){var _0x43e440={};_0x43e440[_0x4e0806]={'$like':'%'+_0x5cdd28['query'][_0x6aef('0x56')]+'%'};return _0x43e440;})});}_0x3f3eba=_[_0x6aef('0x54')]({},_0x3f3eba,_0x5cdd28[_0x6aef('0x57')]);return _0x6a9d23[_0x6aef('0xc3')](_0x3f3eba);}})[_0x6aef('0x21')](function(_0x23782f){if(_0x23782f){_0x16b95a=_0x23782f[_0x6aef('0x4e')];if(!_0x5cdd28['query'][_0x6aef('0x4f')](_0x6aef('0x50'))){_0x3f3eba[_0x6aef('0x2f')]=qs[_0x6aef('0x2f')](_0x5cdd28[_0x6aef('0x48')][_0x6aef('0x2f')]);_0x3f3eba[_0x6aef('0x31')]=qs[_0x6aef('0x31')](_0x5cdd28[_0x6aef('0x48')][_0x6aef('0x31')]);}return _0x6a9d23[_0x6aef('0xc3')](_0x3f3eba);}})['then'](function(_0x1d3a16){if(_0x1d3a16){return _0x1d3a16?{'count':_0x16b95a,'rows':_0x1d3a16}:null;}})[_0x6aef('0x21')](respondWithResult(_0x371acd,null))[_0x6aef('0x2b')](handleError(_0x371acd,null));}; \ No newline at end of file +var _0xa003=['role','user','UserProfileSection','userProfileId','autoAssociation','update','body','describe','findOne','Disposition','nolimit','removeDispositions','ids','addAnswer','FaxAccountId','CannedAnswer','removeAnswers','FaxInteraction','addInteraction','omit','getInteractions','CmContact','Contact','User','Owner','fullname','Tag','Tags','color','tag','sequelize','transaction','ISOLATION_LEVELS','FaxApplication','bulkCreate','findAndCountAll','finally','send','getApplications','from-voip-provider','localstationid','app','system','description','Fax\x20Extension','appdata','Answer','push','CDR(type)=inbound-fax','Set','ecm','gateway','maxrate','minrate','modem','t38timeout','FAXOPT(','Wait','/var/opt/motion2/server/files/attachments/fax-${CALLERID(num)}-${CUT(UNIQUEID,.,1)}-${CUT(UNIQUEID,.,2)}-${STRFTIME(,,%C%y%m%d%H%M%S)}-rx.tif,d','ReceiveFax','addAccountApplications','VoiceExtension','updateAccountApplications','createdAt','updatedAt','ListId','getMessages','FaxMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','CmList','Contacts','DESC','attachments','join','root','server/files/attachments','basename','CheckAfterSend','isNil','from','List','List\x20not\x20found','Send\x20Fax\x20failed','out','filename','Messages','Contact\x20not\x20found','spread','ContactId','dataValues','SendFaxRpc,\x20%s','addAgents','emit','userFaxAccount:save','removeAgents','isArray','getAgents','eml-format','zip-dir','request-promise','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./faxAccount.socket','jayson/promise','client','http','request','then','info','FaxAccount,\x20%s,\x20%s','FaxAccount,\x20%s,\x20%s,\x20%s','error','code','message','catch','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','json','apply','save','destroy','get','UserProfileResource','stack','index','Pause','mandatoryDispositionPause','map','FaxAccount','rawAttributes','type','key','model','name','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','options','includeAll','findAll','rows','params','include','merge','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user'];(function(_0x2e6ab8,_0x4ea85c){var _0x16cba0=function(_0x4b3776){while(--_0x4b3776){_0x2e6ab8['push'](_0x2e6ab8['shift']());}};_0x16cba0(++_0x4ea85c);}(_0xa003,0x64));var _0x3a00=function(_0x37840e,_0x384ca5){_0x37840e=_0x37840e-0x0;var _0x1ab6c9=_0xa003[_0x37840e];return _0x1ab6c9;};'use strict';var emlformat=require(_0x3a00('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3a00('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3a00('0x2'));var moment=require('moment');var BPromise=require(_0x3a00('0x3'));var Mustache=require('mustache');var util=require(_0x3a00('0x4'));var path=require(_0x3a00('0x5'));var sox=require(_0x3a00('0x6'));var csv=require(_0x3a00('0x7'));var ejs=require(_0x3a00('0x8'));var fs=require('fs');var fs_extra=require(_0x3a00('0x9'));var _=require(_0x3a00('0xa'));var squel=require(_0x3a00('0xb'));var crypto=require('crypto');var jsforce=require(_0x3a00('0xc'));var deskjs=require(_0x3a00('0xd'));var toCsv=require(_0x3a00('0x7'));var querystring=require(_0x3a00('0xe'));var Papa=require(_0x3a00('0xf'));var Redis=require(_0x3a00('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x3a00('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3a00('0x12'));var logger=require(_0x3a00('0x13'))(_0x3a00('0x14'));var utils=require(_0x3a00('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x3a00('0x16'));var db=require(_0x3a00('0x17'))['db'];config['redis']=_[_0x3a00('0x18')](config[_0x3a00('0x19')],{'host':_0x3a00('0x1a'),'port':0x18eb});var socket=require(_0x3a00('0x1b'))(new Redis(config[_0x3a00('0x19')]));require(_0x3a00('0x1c'))['register'](socket);var jayson=require(_0x3a00('0x1d'));var client=jayson[_0x3a00('0x1e')][_0x3a00('0x1f')]({'port':0x232c});var client9002=jayson[_0x3a00('0x1e')][_0x3a00('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x411933,_0x3bac46,_0x52ba5e,_0x5458a0){return new BPromise(function(_0x40ca6d,_0x4cba04){var _0x271561=_0x5458a0||client;return _0x271561[_0x3a00('0x20')](_0x411933,_0x52ba5e)[_0x3a00('0x21')](function(_0x282476){logger[_0x3a00('0x22')](_0x3a00('0x23'),_0x3bac46,'request\x20sent');logger['debug'](_0x3a00('0x24'),_0x3bac46,'request\x20sent',JSON['stringify'](_0x282476));if(_0x282476[_0x3a00('0x25')]){if(_0x282476[_0x3a00('0x25')][_0x3a00('0x26')]===0x1f4){logger[_0x3a00('0x25')](_0x3a00('0x23'),_0x3bac46,_0x282476[_0x3a00('0x25')][_0x3a00('0x27')]);return _0x4cba04(_0x282476['error'][_0x3a00('0x27')]);}logger[_0x3a00('0x25')](_0x3a00('0x23'),_0x3bac46,_0x282476['error'][_0x3a00('0x27')]);return _0x40ca6d(_0x282476[_0x3a00('0x25')][_0x3a00('0x27')]);}else{logger['info'](_0x3a00('0x23'),_0x3bac46,'request\x20sent');_0x40ca6d(_0x282476['result'][_0x3a00('0x27')]);}})[_0x3a00('0x28')](function(_0x3e69d2){logger['error'](_0x3a00('0x23'),_0x3bac46,_0x3e69d2);_0x4cba04(_0x3e69d2);});});}function respondWithStatusCode(_0x1ac988,_0x57268c){_0x57268c=_0x57268c||0xcc;return function(_0x151a6e){if(_0x151a6e){return _0x1ac988[_0x3a00('0x29')](_0x57268c);}return _0x1ac988['status'](_0x57268c)[_0x3a00('0x2a')]();};}function respondWithResult(_0x3d93ff,_0x3aaa21){_0x3aaa21=_0x3aaa21||0xc8;return function(_0x2f7458){if(_0x2f7458){return _0x3d93ff[_0x3a00('0x2b')](_0x3aaa21)['json'](_0x2f7458);}};}function respondWithFilteredResult(_0x58e344,_0x571a13){return function(_0x2dafee){if(_0x2dafee){var _0x2faf8d=typeof _0x571a13[_0x3a00('0x2c')]===_0x3a00('0x2d')&&typeof _0x571a13[_0x3a00('0x2e')]===_0x3a00('0x2d');var _0x52dce6=_0x2dafee[_0x3a00('0x2f')];var _0x5ad43b=_0x2faf8d?0x0:_0x571a13[_0x3a00('0x2c')];var _0xd1a388=_0x2faf8d?_0x2dafee['count']:_0x571a13[_0x3a00('0x2c')]+_0x571a13[_0x3a00('0x2e')];var _0x4942f4;if(_0xd1a388>=_0x52dce6){_0xd1a388=_0x52dce6;_0x4942f4=0xc8;}else{_0x4942f4=0xce;}_0x58e344['status'](_0x4942f4);return _0x58e344[_0x3a00('0x30')](_0x3a00('0x31'),_0x5ad43b+'-'+_0xd1a388+'/'+_0x52dce6)[_0x3a00('0x32')](_0x2dafee);}return null;};}function patchUpdates(_0x180179){return function(_0xa284fa){try{jsonpatch[_0x3a00('0x33')](_0xa284fa,_0x180179,!![]);}catch(_0x27b2e8){return BPromise['reject'](_0x27b2e8);}return _0xa284fa[_0x3a00('0x34')]();};}function saveUpdates(_0x40ec92,_0x3ce550){return function(_0xa459fa){if(_0xa459fa){return _0xa459fa['update'](_0x40ec92)['then'](function(_0x5055df){return _0x5055df;});}return null;};}function removeEntity(_0xfc1f4e,_0x3279fd){return function(_0xd5c839){if(_0xd5c839){return _0xd5c839[_0x3a00('0x35')]()[_0x3a00('0x21')](function(){var _0x5cd13b=_0xd5c839[_0x3a00('0x36')]({'plain':!![]});var _0x397b2e='FaxAccounts';return db[_0x3a00('0x37')][_0x3a00('0x35')]({'where':{'type':_0x397b2e,'resourceId':_0x5cd13b['id']}})[_0x3a00('0x21')](function(){return _0xd5c839;});})[_0x3a00('0x21')](function(){_0xfc1f4e[_0x3a00('0x2b')](0xcc)[_0x3a00('0x2a')]();});}};}function handleEntityNotFound(_0x467ada,_0xbce758){return function(_0x208e6b){if(!_0x208e6b){_0x467ada[_0x3a00('0x29')](0x194);}return _0x208e6b;};}function handleError(_0x10737d,_0x163d31){_0x163d31=_0x163d31||0x1f4;return function(_0x33a7ca){logger[_0x3a00('0x25')](_0x33a7ca[_0x3a00('0x38')]);if(_0x33a7ca['name']){delete _0x33a7ca['name'];}_0x10737d['status'](_0x163d31)['send'](_0x33a7ca);};}exports[_0x3a00('0x39')]=function(_0x5b142f,_0xa9fa2e){var _0x2fad9e={'include':[{'model':db[_0x3a00('0x3a')],'as':_0x3a00('0x3b')}]},_0x52818c={},_0x2235a2={'count':0x0,'rows':[]};var _0x2a2948=_[_0x3a00('0x3c')](db[_0x3a00('0x3d')][_0x3a00('0x3e')],function(_0x394c2a){return{'name':_0x394c2a['fieldName'],'type':_0x394c2a[_0x3a00('0x3f')][_0x3a00('0x40')]};});_0x52818c[_0x3a00('0x41')]=_[_0x3a00('0x3c')](_0x2a2948,_0x3a00('0x42'));_0x52818c['query']=_[_0x3a00('0x43')](_0x5b142f[_0x3a00('0x44')]);_0x52818c[_0x3a00('0x45')]=_[_0x3a00('0x46')](_0x52818c[_0x3a00('0x41')],_0x52818c['query']);_0x2fad9e[_0x3a00('0x47')]=_[_0x3a00('0x46')](_0x52818c[_0x3a00('0x41')],qs[_0x3a00('0x48')](_0x5b142f[_0x3a00('0x44')][_0x3a00('0x48')]));_0x2fad9e[_0x3a00('0x47')]=_0x2fad9e['attributes'][_0x3a00('0x49')]?_0x2fad9e['attributes']:_0x52818c[_0x3a00('0x41')];if(!_0x5b142f[_0x3a00('0x44')][_0x3a00('0x4a')]('nolimit')){_0x2fad9e[_0x3a00('0x2e')]=qs['limit'](_0x5b142f[_0x3a00('0x44')][_0x3a00('0x2e')]);_0x2fad9e[_0x3a00('0x2c')]=qs['offset'](_0x5b142f[_0x3a00('0x44')][_0x3a00('0x2c')]);}_0x2fad9e[_0x3a00('0x4b')]=qs[_0x3a00('0x4c')](_0x5b142f['query'][_0x3a00('0x4c')]);_0x2fad9e[_0x3a00('0x4d')]=qs[_0x3a00('0x45')](_[_0x3a00('0x4e')](_0x5b142f[_0x3a00('0x44')],_0x52818c[_0x3a00('0x45')]),_0x2a2948);if(_0x5b142f[_0x3a00('0x44')][_0x3a00('0x4f')]){_0x2fad9e[_0x3a00('0x4d')]=_['merge'](_0x2fad9e[_0x3a00('0x4d')],{'$or':_['map'](_0x2a2948,function(_0x54edf0){if(_0x54edf0[_0x3a00('0x3f')]!=='VIRTUAL'){var _0x257a38={};_0x257a38[_0x54edf0[_0x3a00('0x42')]]={'$like':'%'+_0x5b142f[_0x3a00('0x44')][_0x3a00('0x4f')]+'%'};return _0x257a38;}})});}_0x2fad9e=_['merge']({},_0x2fad9e,_0x5b142f[_0x3a00('0x50')]);var _0x4d1171={'where':_0x2fad9e['where']};return db[_0x3a00('0x3d')][_0x3a00('0x2f')](_0x4d1171)[_0x3a00('0x21')](function(_0x52f2ef){_0x2235a2[_0x3a00('0x2f')]=_0x52f2ef;if(_0x5b142f[_0x3a00('0x44')][_0x3a00('0x51')]){_0x2fad9e['include']=[{'all':!![]}];}return db[_0x3a00('0x3d')][_0x3a00('0x52')](_0x2fad9e);})[_0x3a00('0x21')](function(_0xb161db){_0x2235a2[_0x3a00('0x53')]=_0xb161db;return _0x2235a2;})[_0x3a00('0x21')](respondWithFilteredResult(_0xa9fa2e,_0x2fad9e))[_0x3a00('0x28')](handleError(_0xa9fa2e,null));};exports['show']=function(_0x184612,_0x158307){var _0x5cd19f={'raw':![],'where':{'id':_0x184612[_0x3a00('0x54')]['id']},'include':[{'model':db[_0x3a00('0x3a')],'as':'mandatoryDispositionPause'}]},_0x2b3b50={};_0x2b3b50[_0x3a00('0x41')]=_[_0x3a00('0x43')](db[_0x3a00('0x3d')][_0x3a00('0x3e')]);_0x2b3b50['query']=_[_0x3a00('0x43')](_0x184612[_0x3a00('0x44')]);_0x2b3b50[_0x3a00('0x45')]=_[_0x3a00('0x46')](_0x2b3b50[_0x3a00('0x41')],_0x2b3b50['query']);_0x5cd19f[_0x3a00('0x47')]=_[_0x3a00('0x46')](_0x2b3b50[_0x3a00('0x41')],qs[_0x3a00('0x48')](_0x184612[_0x3a00('0x44')]['fields']));_0x5cd19f[_0x3a00('0x47')]=_0x5cd19f[_0x3a00('0x47')]['length']?_0x5cd19f[_0x3a00('0x47')]:_0x2b3b50[_0x3a00('0x41')];if(_0x184612[_0x3a00('0x44')][_0x3a00('0x51')]){_0x5cd19f[_0x3a00('0x55')]=[{'all':!![]}];}_0x5cd19f=_[_0x3a00('0x56')]({},_0x5cd19f,_0x184612['options']);return db[_0x3a00('0x3d')][_0x3a00('0x57')](_0x5cd19f)[_0x3a00('0x21')](handleEntityNotFound(_0x158307,null))[_0x3a00('0x21')](respondWithResult(_0x158307,null))[_0x3a00('0x28')](handleError(_0x158307,null));};exports['create']=function(_0x1c78f7,_0x64207d){return db[_0x3a00('0x3d')][_0x3a00('0x58')](_0x1c78f7['body'],{})[_0x3a00('0x21')](function(_0x5d6957){var _0x2a66cc=_0x1c78f7['user']['get']({'plain':!![]});if(!_0x2a66cc)throw new Error(_0x3a00('0x59'));if(_0x2a66cc[_0x3a00('0x5a')]===_0x3a00('0x5b')){var _0xaffc84=_0x5d6957['get']({'plain':!![]});var _0x19f504='FaxAccounts';return db[_0x3a00('0x5c')][_0x3a00('0x57')]({'where':{'name':_0x19f504,'userProfileId':_0x2a66cc[_0x3a00('0x5d')]},'raw':!![]})[_0x3a00('0x21')](function(_0x387bd7){if(_0x387bd7&&_0x387bd7[_0x3a00('0x5e')]===0x0){return db[_0x3a00('0x37')]['create']({'name':_0xaffc84[_0x3a00('0x42')],'resourceId':_0xaffc84['id'],'type':_0x387bd7[_0x3a00('0x42')],'sectionId':_0x387bd7['id']},{})[_0x3a00('0x21')](function(){return _0x5d6957;});}else{return _0x5d6957;}})['catch'](function(_0x3f60a3){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3f60a3);throw _0x3f60a3;});}return _0x5d6957;})[_0x3a00('0x21')](respondWithResult(_0x64207d,0xc9))[_0x3a00('0x28')](handleError(_0x64207d,null));};exports[_0x3a00('0x5f')]=function(_0x5d6070,_0x2eb232){if(_0x5d6070[_0x3a00('0x60')]['id']){delete _0x5d6070['body']['id'];}return db[_0x3a00('0x3d')][_0x3a00('0x57')]({'where':{'id':_0x5d6070[_0x3a00('0x54')]['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]})[_0x3a00('0x21')](handleEntityNotFound(_0x2eb232,null))[_0x3a00('0x21')](saveUpdates(_0x5d6070[_0x3a00('0x60')],null))['then'](respondWithResult(_0x2eb232,null))[_0x3a00('0x28')](handleError(_0x2eb232,null));};exports['destroy']=function(_0x121432,_0x2f833d){return db['FaxAccount'][_0x3a00('0x57')]({'where':{'id':_0x121432[_0x3a00('0x54')]['id']}})['then'](handleEntityNotFound(_0x2f833d,null))[_0x3a00('0x21')](removeEntity(_0x2f833d,null))['catch'](handleError(_0x2f833d,null));};exports[_0x3a00('0x61')]=function(_0x5da9e7,_0x46c1ea){return db[_0x3a00('0x3d')]['describe']()['then'](respondWithResult(_0x46c1ea,null))[_0x3a00('0x28')](handleError(_0x46c1ea,null));};exports['addDisposition']=function(_0x5e654a,_0x302847,_0x369c88){if(_0x5e654a[_0x3a00('0x60')]['id']){delete _0x5e654a['body']['id'];}return db['FaxAccount'][_0x3a00('0x57')]({'where':{'id':_0x5e654a[_0x3a00('0x54')]['id']}})[_0x3a00('0x21')](handleEntityNotFound(_0x302847,null))[_0x3a00('0x21')](function(_0x3d58ca){if(_0x3d58ca){_0x5e654a[_0x3a00('0x60')]['FaxAccountId']=_0x3d58ca['id'];return db['Disposition']['create'](_0x5e654a[_0x3a00('0x60')]);}})[_0x3a00('0x21')](respondWithResult(_0x302847,null))[_0x3a00('0x28')](handleError(_0x302847,null));};exports['getDispositions']=function(_0x1814e7,_0x5b42aa,_0x1a066b){var _0x4159ab={'raw':![],'where':{}};var _0x3f8d1a={};var _0x2c9e77={'count':0x0,'rows':[]};return db[_0x3a00('0x3d')][_0x3a00('0x62')]({'where':{'id':_0x1814e7['params']['id']}})[_0x3a00('0x21')](handleEntityNotFound(_0x5b42aa,null))[_0x3a00('0x21')](function(_0x3eb3cb){if(_0x3eb3cb){_0x3f8d1a[_0x3a00('0x41')]=_['keys'](db[_0x3a00('0x63')]['rawAttributes']);_0x3f8d1a[_0x3a00('0x44')]=_[_0x3a00('0x43')](_0x1814e7[_0x3a00('0x44')]);_0x3f8d1a[_0x3a00('0x45')]=_[_0x3a00('0x46')](_0x3f8d1a[_0x3a00('0x41')],_0x3f8d1a['query']);_0x4159ab['attributes']=_[_0x3a00('0x46')](_0x3f8d1a[_0x3a00('0x41')],qs[_0x3a00('0x48')](_0x1814e7['query'][_0x3a00('0x48')]));_0x4159ab[_0x3a00('0x47')]=_0x4159ab['attributes'][_0x3a00('0x49')]?_0x4159ab[_0x3a00('0x47')]:_0x3f8d1a[_0x3a00('0x41')];if(!_0x1814e7[_0x3a00('0x44')][_0x3a00('0x4a')](_0x3a00('0x64'))){_0x4159ab[_0x3a00('0x2e')]=qs['limit'](_0x1814e7[_0x3a00('0x44')][_0x3a00('0x2e')]);_0x4159ab['offset']=qs[_0x3a00('0x2c')](_0x1814e7[_0x3a00('0x44')][_0x3a00('0x2c')]);}_0x4159ab[_0x3a00('0x4b')]=qs[_0x3a00('0x4c')](_0x1814e7[_0x3a00('0x44')][_0x3a00('0x4c')]);_0x4159ab[_0x3a00('0x4d')]=qs[_0x3a00('0x45')](_[_0x3a00('0x4e')](_0x1814e7[_0x3a00('0x44')],_0x3f8d1a[_0x3a00('0x45')]));_0x4159ab[_0x3a00('0x4d')]['FaxAccountId']=_0x3eb3cb['id'];if(_0x1814e7[_0x3a00('0x44')][_0x3a00('0x4f')]){_0x4159ab['where']=_[_0x3a00('0x56')](_0x4159ab[_0x3a00('0x4d')],{'$or':_[_0x3a00('0x3c')](_0x4159ab[_0x3a00('0x47')],function(_0x9f4c9e){var _0x2af4a2={};_0x2af4a2[_0x9f4c9e]={'$like':'%'+_0x1814e7[_0x3a00('0x44')]['filter']+'%'};return _0x2af4a2;})});}_0x4159ab=_[_0x3a00('0x56')]({},_0x4159ab,_0x1814e7[_0x3a00('0x50')]);return db[_0x3a00('0x63')][_0x3a00('0x2f')]({'where':_0x4159ab[_0x3a00('0x4d')]})[_0x3a00('0x21')](function(_0x2bc97d){_0x2c9e77[_0x3a00('0x2f')]=_0x2bc97d;if(_0x1814e7[_0x3a00('0x44')][_0x3a00('0x51')]){_0x4159ab[_0x3a00('0x55')]=[{'all':!![]}];}return db[_0x3a00('0x63')][_0x3a00('0x52')](_0x4159ab);})[_0x3a00('0x21')](function(_0x57d8c8){_0x2c9e77['rows']=_0x57d8c8;return _0x2c9e77;});}})[_0x3a00('0x21')](respondWithFilteredResult(_0x5b42aa,_0x4159ab))['catch'](handleError(_0x5b42aa,null));};exports[_0x3a00('0x65')]=function(_0x4e7d6f,_0x356444,_0x103679){return db[_0x3a00('0x3d')][_0x3a00('0x57')]({'where':{'id':_0x4e7d6f['params']['id']}})[_0x3a00('0x21')](handleEntityNotFound(_0x356444,null))[_0x3a00('0x21')](function(_0x389d14){if(_0x389d14){return _0x389d14[_0x3a00('0x65')](_0x4e7d6f[_0x3a00('0x44')][_0x3a00('0x66')]);}})[_0x3a00('0x21')](respondWithStatusCode(_0x356444,null))[_0x3a00('0x28')](handleError(_0x356444,null));};exports[_0x3a00('0x67')]=function(_0x24a3ac,_0x55e6ff,_0x1a4f9f){if(_0x24a3ac['body']['id']){delete _0x24a3ac[_0x3a00('0x60')]['id'];}return db[_0x3a00('0x3d')][_0x3a00('0x57')]({'where':{'id':_0x24a3ac[_0x3a00('0x54')]['id']}})[_0x3a00('0x21')](handleEntityNotFound(_0x55e6ff,null))[_0x3a00('0x21')](function(_0xb4ccbe){if(_0xb4ccbe){_0x24a3ac[_0x3a00('0x60')][_0x3a00('0x68')]=_0xb4ccbe['id'];return db[_0x3a00('0x69')][_0x3a00('0x58')](_0x24a3ac['body']);}})['then'](respondWithResult(_0x55e6ff,null))[_0x3a00('0x28')](handleError(_0x55e6ff,null));};exports['getAnswers']=function(_0x1a8535,_0x50c39a,_0x5ac8af){var _0x47968a={'raw':![],'where':{}};var _0x2e5da8={};var _0x272d90={'count':0x0,'rows':[]};return db[_0x3a00('0x3d')][_0x3a00('0x62')]({'where':{'id':_0x1a8535[_0x3a00('0x54')]['id']}})[_0x3a00('0x21')](handleEntityNotFound(_0x50c39a,null))[_0x3a00('0x21')](function(_0x111745){if(_0x111745){_0x2e5da8[_0x3a00('0x41')]=_['keys'](db[_0x3a00('0x69')][_0x3a00('0x3e')]);_0x2e5da8[_0x3a00('0x44')]=_['keys'](_0x1a8535[_0x3a00('0x44')]);_0x2e5da8['filters']=_[_0x3a00('0x46')](_0x2e5da8[_0x3a00('0x41')],_0x2e5da8[_0x3a00('0x44')]);_0x47968a[_0x3a00('0x47')]=_['intersection'](_0x2e5da8[_0x3a00('0x41')],qs[_0x3a00('0x48')](_0x1a8535['query']['fields']));_0x47968a[_0x3a00('0x47')]=_0x47968a['attributes'][_0x3a00('0x49')]?_0x47968a[_0x3a00('0x47')]:_0x2e5da8['model'];if(!_0x1a8535[_0x3a00('0x44')][_0x3a00('0x4a')](_0x3a00('0x64'))){_0x47968a[_0x3a00('0x2e')]=qs[_0x3a00('0x2e')](_0x1a8535[_0x3a00('0x44')][_0x3a00('0x2e')]);_0x47968a[_0x3a00('0x2c')]=qs[_0x3a00('0x2c')](_0x1a8535[_0x3a00('0x44')][_0x3a00('0x2c')]);}_0x47968a[_0x3a00('0x4b')]=qs[_0x3a00('0x4c')](_0x1a8535[_0x3a00('0x44')][_0x3a00('0x4c')]);_0x47968a['where']=qs['filters'](_[_0x3a00('0x4e')](_0x1a8535[_0x3a00('0x44')],_0x2e5da8[_0x3a00('0x45')]));_0x47968a['where']['FaxAccountId']=_0x111745['id'];if(_0x1a8535[_0x3a00('0x44')][_0x3a00('0x4f')]){_0x47968a[_0x3a00('0x4d')]=_[_0x3a00('0x56')](_0x47968a['where'],{'$or':_[_0x3a00('0x3c')](_0x47968a['attributes'],function(_0x1bf7b3){var _0x171bc1={};_0x171bc1[_0x1bf7b3]={'$like':'%'+_0x1a8535[_0x3a00('0x44')]['filter']+'%'};return _0x171bc1;})});}_0x47968a=_[_0x3a00('0x56')]({},_0x47968a,_0x1a8535[_0x3a00('0x50')]);return db[_0x3a00('0x69')][_0x3a00('0x2f')]({'where':_0x47968a[_0x3a00('0x4d')]})[_0x3a00('0x21')](function(_0x518603){_0x272d90[_0x3a00('0x2f')]=_0x518603;if(_0x1a8535['query'][_0x3a00('0x51')]){_0x47968a[_0x3a00('0x55')]=[{'all':!![]}];}return db['CannedAnswer']['findAll'](_0x47968a);})[_0x3a00('0x21')](function(_0xf19b22){_0x272d90[_0x3a00('0x53')]=_0xf19b22;return _0x272d90;});}})[_0x3a00('0x21')](respondWithFilteredResult(_0x50c39a,_0x47968a))[_0x3a00('0x28')](handleError(_0x50c39a,null));};exports[_0x3a00('0x6a')]=function(_0x36c886,_0x26587f,_0x53b243){return db['FaxAccount']['find']({'where':{'id':_0x36c886[_0x3a00('0x54')]['id']}})['then'](handleEntityNotFound(_0x26587f,null))[_0x3a00('0x21')](function(_0x4f1e46){if(_0x4f1e46){return _0x4f1e46[_0x3a00('0x6a')](_0x36c886[_0x3a00('0x44')][_0x3a00('0x66')]);}})['then'](respondWithStatusCode(_0x26587f,null))[_0x3a00('0x28')](handleError(_0x26587f,null));};exports['addInteraction']=function(_0x4b17c1,_0x54275c,_0x3663de){return db[_0x3a00('0x6b')][_0x3a00('0x57')]({'where':{'id':_0x4b17c1[_0x3a00('0x54')]['id']}})['then'](handleEntityNotFound(_0x54275c,null))['then'](function(_0x465794){if(_0x465794){return _0x465794[_0x3a00('0x6c')](_0x4b17c1[_0x3a00('0x60')]['ids'],_[_0x3a00('0x6d')](_0x4b17c1[_0x3a00('0x60')],[_0x3a00('0x66'),'id'])||{});}})[_0x3a00('0x21')](respondWithResult(_0x54275c,null))['catch'](handleError(_0x54275c,null));};exports[_0x3a00('0x6e')]=function(_0xa5838f,_0x2e9a72,_0x4e9a14){var _0x822304={'raw':![],'where':{}};var _0x238d95={};var _0x2aab09={'count':0x0,'rows':[]};return db[_0x3a00('0x3d')][_0x3a00('0x62')]({'where':{'id':_0xa5838f[_0x3a00('0x54')]['id']}})[_0x3a00('0x21')](handleEntityNotFound(_0x2e9a72,null))['then'](function(_0x3bacbd){if(_0x3bacbd){_0x238d95[_0x3a00('0x41')]=_[_0x3a00('0x43')](db['FaxInteraction'][_0x3a00('0x3e')]);_0x238d95[_0x3a00('0x44')]=_['keys'](_0xa5838f[_0x3a00('0x44')]);_0x238d95[_0x3a00('0x45')]=_[_0x3a00('0x46')](_0x238d95[_0x3a00('0x41')],_0x238d95['query']);_0x822304[_0x3a00('0x47')]=_[_0x3a00('0x46')](_0x238d95[_0x3a00('0x41')],qs[_0x3a00('0x48')](_0xa5838f[_0x3a00('0x44')][_0x3a00('0x48')]));_0x822304[_0x3a00('0x47')]=_0x822304['attributes'][_0x3a00('0x49')]?_0x822304['attributes']:_0x238d95['model'];if(!_0xa5838f[_0x3a00('0x44')][_0x3a00('0x4a')]('nolimit')){_0x822304[_0x3a00('0x2e')]=qs['limit'](_0xa5838f[_0x3a00('0x44')]['limit']);_0x822304[_0x3a00('0x2c')]=qs[_0x3a00('0x2c')](_0xa5838f['query'][_0x3a00('0x2c')]);}_0x822304['order']=qs[_0x3a00('0x4c')](_0xa5838f['query'][_0x3a00('0x4c')]);_0x822304[_0x3a00('0x4d')]=qs[_0x3a00('0x45')](_[_0x3a00('0x4e')](_0xa5838f[_0x3a00('0x44')],_0x238d95[_0x3a00('0x45')]));_0x822304[_0x3a00('0x4d')]['FaxAccountId']=_0x3bacbd['id'];if(_0xa5838f['query'][_0x3a00('0x4f')]){_0x822304[_0x3a00('0x4d')]=_[_0x3a00('0x56')](_0x822304['where'],{'$or':_[_0x3a00('0x3c')](_0x822304[_0x3a00('0x47')],function(_0xbfc0c5){var _0x16542d={};_0x16542d[_0xbfc0c5]={'$like':'%'+_0xa5838f[_0x3a00('0x44')][_0x3a00('0x4f')]+'%'};return _0x16542d;})});}_0x822304=_[_0x3a00('0x56')]({},_0x822304,_0xa5838f['options']);return db['FaxInteraction'][_0x3a00('0x2f')]({'where':_0x822304[_0x3a00('0x4d')]})[_0x3a00('0x21')](function(_0x21e536){_0x2aab09[_0x3a00('0x2f')]=_0x21e536;if(_0xa5838f[_0x3a00('0x44')]['includeAll']){_0x822304[_0x3a00('0x55')]=[{'model':db[_0x3a00('0x6f')],'as':_0x3a00('0x70'),'required':![]},{'model':db[_0x3a00('0x71')],'as':_0x3a00('0x72'),'attributes':[_0x3a00('0x42'),_0x3a00('0x73'),'internal'],'required':![]},{'model':db[_0x3a00('0x74')],'as':_0x3a00('0x75'),'attributes':['id',_0x3a00('0x42'),_0x3a00('0x76')],'where':_0xa5838f[_0x3a00('0x44')]['tag']?{'id':_0xa5838f[_0x3a00('0x44')][_0x3a00('0x77')]}:undefined,'required':_0xa5838f[_0x3a00('0x44')][_0x3a00('0x77')]?!![]:![]}];}return db[_0x3a00('0x6b')][_0x3a00('0x52')](_0x822304);})[_0x3a00('0x21')](function(_0x5893a4){_0x2aab09[_0x3a00('0x53')]=_0x5893a4;return _0x2aab09;});}})['then'](respondWithFilteredResult(_0x2e9a72,_0x822304))[_0x3a00('0x28')](handleError(_0x2e9a72,null));};exports['addApplications']=function(_0x51fd19,_0x4ca6a4){var _0x34c0f2=_0x51fd19['params']['id'];var _0x5f0f8a=_0x51fd19[_0x3a00('0x60')];var _0x31696e=0xc8;var _0x198a08=null;return db[_0x3a00('0x78')][_0x3a00('0x79')]({'isolationLevel':db['sequelize']['Transaction'][_0x3a00('0x7a')]['READ_COMMITTED']},function(_0x20591a){return db['FaxAccount'][_0x3a00('0x62')]({'where':{'id':_0x34c0f2},'transaction':_0x20591a})[_0x3a00('0x21')](function(_0x580fb7){if(_0x580fb7){return db[_0x3a00('0x7b')][_0x3a00('0x35')]({'where':{'FaxAccountId':_0x34c0f2},'transaction':_0x20591a})[_0x3a00('0x21')](function(){var _0x1e485d=_[_0x3a00('0x3c')](_0x5f0f8a,function(_0x1522af){_0x1522af[_0x3a00('0x68')]=_0x34c0f2;return _0x1522af;});return db[_0x3a00('0x7b')][_0x3a00('0x7c')](_0x1e485d,{'transaction':_0x20591a});});}else{_0x31696e=0x194;_0x198a08=[];}});})['then'](function(){if(_0x31696e!==0x194){return db[_0x3a00('0x7b')][_0x3a00('0x7d')]({'where':{'FaxAccountId':_0x34c0f2},'order':'priority'})[_0x3a00('0x21')](function(_0x28749a){_0x198a08=_0x28749a;});}})[_0x3a00('0x28')](function(_0x5960b3){_0x31696e=0x1f4;logger[_0x3a00('0x25')](_0x5960b3['stack']);if(_0x5960b3[_0x3a00('0x42')]){delete _0x5960b3[_0x3a00('0x42')];}_0x198a08=_0x5960b3;})[_0x3a00('0x7e')](function(){if(_0x198a08===null){_0x4ca6a4[_0x3a00('0x29')](_0x31696e);}else{if(_0x31696e===0x1f4){_0x4ca6a4[_0x3a00('0x2b')](_0x31696e)[_0x3a00('0x7f')](_0x198a08);}else{_0x4ca6a4[_0x3a00('0x2b')](_0x31696e)['json'](_0x198a08);}}});};exports[_0x3a00('0x80')]=function(_0x4bfc53,_0x311a6d,_0x460667){var _0x57d65c={};var _0x2eb18b={};var _0x463d63;var _0x49bd9d;return db[_0x3a00('0x3d')][_0x3a00('0x62')]({'where':{'id':_0x4bfc53[_0x3a00('0x54')]['id']}})[_0x3a00('0x21')](handleEntityNotFound(_0x311a6d,null))['then'](function(_0x3804a8){if(_0x3804a8){_0x463d63=_0x3804a8;_0x2eb18b['model']=_['keys'](db['FaxApplication'][_0x3a00('0x3e')]);_0x2eb18b['query']=_[_0x3a00('0x43')](_0x4bfc53[_0x3a00('0x44')]);_0x2eb18b[_0x3a00('0x45')]=_[_0x3a00('0x46')](_0x2eb18b[_0x3a00('0x41')],_0x2eb18b[_0x3a00('0x44')]);_0x57d65c[_0x3a00('0x47')]=_['intersection'](_0x2eb18b[_0x3a00('0x41')],qs[_0x3a00('0x48')](_0x4bfc53[_0x3a00('0x44')][_0x3a00('0x48')]));_0x57d65c[_0x3a00('0x47')]=_0x57d65c[_0x3a00('0x47')]['length']?_0x57d65c[_0x3a00('0x47')]:_0x2eb18b[_0x3a00('0x41')];_0x57d65c[_0x3a00('0x4b')]=qs[_0x3a00('0x4c')](_0x4bfc53[_0x3a00('0x44')]['sort']);_0x57d65c[_0x3a00('0x4d')]=qs[_0x3a00('0x45')](_['pick'](_0x4bfc53[_0x3a00('0x44')],_0x2eb18b[_0x3a00('0x45')]));if(_0x4bfc53[_0x3a00('0x44')]['filter']){_0x57d65c[_0x3a00('0x4d')]=_[_0x3a00('0x56')](_0x57d65c[_0x3a00('0x4d')],{'$or':_['map'](_0x57d65c[_0x3a00('0x47')],function(_0x2dac52){var _0x568acc={};_0x568acc[_0x2dac52]={'$like':'%'+_0x4bfc53[_0x3a00('0x44')][_0x3a00('0x4f')]+'%'};return _0x568acc;})});}_0x57d65c=_[_0x3a00('0x56')]({},_0x57d65c,_0x4bfc53['options']);return _0x463d63[_0x3a00('0x80')](_0x57d65c);}})[_0x3a00('0x21')](function(_0x39b66e){if(_0x39b66e){_0x49bd9d=_0x39b66e[_0x3a00('0x49')];if(!_0x4bfc53[_0x3a00('0x44')][_0x3a00('0x4a')]('nolimit')){_0x57d65c[_0x3a00('0x2e')]=qs[_0x3a00('0x2e')](_0x4bfc53[_0x3a00('0x44')][_0x3a00('0x2e')]);_0x57d65c['offset']=qs[_0x3a00('0x2c')](_0x4bfc53[_0x3a00('0x44')][_0x3a00('0x2c')]);}return _0x463d63[_0x3a00('0x80')](_0x57d65c);}})['then'](function(_0x20cd01){if(_0x20cd01){return _0x20cd01?{'count':_0x49bd9d,'rows':_0x20cd01}:null;}})[_0x3a00('0x21')](respondWithResult(_0x311a6d,null))[_0x3a00('0x28')](handleError(_0x311a6d,null));};function Extension(_0x2c8613,_0x11b42a,_0x4cf13b,_0x196983){this['context']=_0x3a00('0x81');this['exten']=_0x2c8613[_0x3a00('0x82')];this[_0x3a00('0x83')]=_0x196983;this[_0x3a00('0x3f')]=_0x3a00('0x84');this[_0x3a00('0x85')]=_0x3a00('0x86');this[_0x3a00('0x68')]=_0x2c8613['id'];this['priority']=_0x11b42a;this[_0x3a00('0x87')]=_0x4cf13b;}function createExtensionsReciveFax(_0x361149){var _0x8a78a=0x1;var _0x499821=[];_0x499821['push'](new Extension(_0x361149,_0x8a78a,'',_0x3a00('0x88')));_0x8a78a+=0x1;_0x499821[_0x3a00('0x89')](new Extension(_0x361149,_0x8a78a,_0x3a00('0x8a'),_0x3a00('0x8b')));_0x8a78a+=0x1;for(var _0x40dc8 in _0x361149){if(_0x361149[_0x3a00('0x4a')](_0x40dc8)&&(_0x40dc8===_0x3a00('0x8c')||_0x40dc8==='localstationid'||_0x40dc8===_0x3a00('0x8d')||_0x40dc8==='faxdetect'||_0x40dc8==='headerinfo'||_0x40dc8===_0x3a00('0x8e')||_0x40dc8===_0x3a00('0x8f')||_0x40dc8===_0x3a00('0x90')||_0x40dc8===_0x3a00('0x91'))){_0x499821['push'](new Extension(_0x361149,_0x8a78a,_0x3a00('0x92')+_0x40dc8+')='+_0x361149[_0x40dc8],'Set'));_0x8a78a+=0x1;}}_0x499821[_0x3a00('0x89')](new Extension(_0x361149,_0x8a78a,'6',_0x3a00('0x93')));_0x8a78a+=0x1;_0x499821['push'](new Extension(_0x361149,_0x8a78a,_0x3a00('0x94'),_0x3a00('0x95')));_0x8a78a=0x0;return _0x499821;}exports[_0x3a00('0x96')]=function(_0x22ab3d,_0xe54251,_0x481328){var _0x1baf48;return db[_0x3a00('0x78')][_0x3a00('0x79')](function(_0x4b8a04){return db['FaxAccount'][_0x3a00('0x58')](_0x22ab3d[_0x3a00('0x60')],{'transaction':_0x4b8a04})[_0x3a00('0x21')](function(_0x53ece5){_0x1baf48=_0x53ece5[_0x3a00('0x36')]({'plain':!![]});return db[_0x3a00('0x97')][_0x3a00('0x7c')](createExtensionsReciveFax(_0x1baf48),{'transaction':_0x4b8a04});});})[_0x3a00('0x21')](function(){return _0x1baf48;})[_0x3a00('0x21')](respondWithResult(_0xe54251,null))[_0x3a00('0x28')](handleError(_0xe54251,null));};exports[_0x3a00('0x98')]=function(_0xcd3c9,_0x5bd655,_0x1f1520){var _0x40122e;return db[_0x3a00('0x78')][_0x3a00('0x79')](function(_0x2fe3d1){return db['FaxAccount'][_0x3a00('0x5f')](_0xcd3c9['body'],{'where':{'id':_0xcd3c9[_0x3a00('0x60')]['id']},'transaction':_0x2fe3d1})['then'](function(_0x4a819d){return db[_0x3a00('0x97')][_0x3a00('0x35')]({'where':{'FaxAccountId':_0xcd3c9[_0x3a00('0x60')]['id']},'transaction':_0x2fe3d1})[_0x3a00('0x21')](function(_0x9e25a4){return db[_0x3a00('0x97')]['bulkCreate'](createExtensionsReciveFax(_[_0x3a00('0x6d')](_0xcd3c9['body'],['tech',_0x3a00('0x40'),_0x3a00('0x99'),_0x3a00('0x9a'),'TrunkId',_0x3a00('0x9b')])),{'transaction':_0x2fe3d1});});});})[_0x3a00('0x21')](function(){return db['FaxAccount']['findById'](_0xcd3c9[_0x3a00('0x60')]['id']);})[_0x3a00('0x21')](respondWithResult(_0x5bd655,null))[_0x3a00('0x28')](handleError(_0x5bd655,null));};exports[_0x3a00('0x9c')]=function(_0x5195d7,_0x5220cf,_0x20d7a8){var _0x8bda19={'raw':!![],'where':{}};var _0x2444c0={};var _0x2c9047={'count':0x0,'rows':[]};return db[_0x3a00('0x3d')][_0x3a00('0x62')]({'where':{'id':_0x5195d7[_0x3a00('0x54')]['id']}})[_0x3a00('0x21')](handleEntityNotFound(_0x5220cf,null))['then'](function(_0x48af0d){if(_0x48af0d){_0x2444c0['model']=_['keys'](db[_0x3a00('0x9d')][_0x3a00('0x3e')]);_0x2444c0[_0x3a00('0x44')]=_[_0x3a00('0x43')](_0x5195d7['query']);_0x2444c0[_0x3a00('0x45')]=_[_0x3a00('0x46')](_0x2444c0[_0x3a00('0x41')],_0x2444c0['query']);_0x8bda19[_0x3a00('0x47')]=_[_0x3a00('0x46')](_0x2444c0[_0x3a00('0x41')],qs[_0x3a00('0x48')](_0x5195d7[_0x3a00('0x44')][_0x3a00('0x48')]));_0x8bda19['attributes']=_0x8bda19[_0x3a00('0x47')][_0x3a00('0x49')]?_0x8bda19[_0x3a00('0x47')]:_0x2444c0[_0x3a00('0x41')];if(!_0x5195d7['query']['hasOwnProperty'](_0x3a00('0x64'))){_0x8bda19[_0x3a00('0x2e')]=qs[_0x3a00('0x2e')](_0x5195d7['query'][_0x3a00('0x2e')]);_0x8bda19[_0x3a00('0x2c')]=qs['offset'](_0x5195d7[_0x3a00('0x44')][_0x3a00('0x2c')]);}_0x8bda19[_0x3a00('0x4b')]=qs[_0x3a00('0x4c')](_0x5195d7[_0x3a00('0x44')][_0x3a00('0x4c')]);_0x8bda19['where']=qs[_0x3a00('0x45')](_[_0x3a00('0x4e')](_0x5195d7[_0x3a00('0x44')],_0x2444c0[_0x3a00('0x45')]));_0x8bda19['where'][_0x3a00('0x68')]=_0x48af0d['id'];if(_0x5195d7[_0x3a00('0x44')][_0x3a00('0x4f')]){_0x8bda19['where']=_[_0x3a00('0x56')](_0x8bda19[_0x3a00('0x4d')],{'$or':_[_0x3a00('0x3c')](_0x8bda19[_0x3a00('0x47')],function(_0xcca32b){var _0x292090={};_0x292090[_0xcca32b]={'$like':'%'+_0x5195d7[_0x3a00('0x44')][_0x3a00('0x4f')]+'%'};return _0x292090;})});}if(_0x5195d7[_0x3a00('0x44')][_0x3a00('0x9e')]){var _0x426ff5=_0x5195d7[_0x3a00('0x44')][_0x3a00('0x9e')][_0x3a00('0x9f')](',');var _0x1aa4c3={};_0x1aa4c3[_0x426ff5[0x0]]={'$gte':moment(_0x426ff5[0x1])[_0x3a00('0xa0')](_0x3a00('0xa1'))};_0x8bda19[_0x3a00('0x4d')]=_[_0x3a00('0x56')](_0x8bda19[_0x3a00('0x4d')],_0x1aa4c3);}_0x8bda19=_['merge']({},_0x8bda19,_0x5195d7[_0x3a00('0x50')]);return db['FaxMessage']['count']({'where':_0x8bda19['where']})['then'](function(_0x2e9d96){_0x2c9047[_0x3a00('0x2f')]=_0x2e9d96;if(_0x5195d7['query'][_0x3a00('0x51')]){_0x8bda19[_0x3a00('0x55')]=[{'all':!![]}];}return db[_0x3a00('0x9d')]['findAll'](_0x8bda19);})[_0x3a00('0x21')](function(_0x1ed045){_0x2c9047[_0x3a00('0x53')]=_0x1ed045;return _0x2c9047;});}})[_0x3a00('0x21')](respondWithFilteredResult(_0x5220cf,_0x8bda19))[_0x3a00('0x28')](handleError(_0x5220cf,null));};exports[_0x3a00('0x7f')]=function(_0x5bc686,_0x50c8a8,_0x565eb6){var _0x549758,_0x309dbe={},_0x97307f;if(_0x5bc686[_0x3a00('0x60')]['to']){_0x97307f=_0x5bc686['body']['to'][0x0];}return db['FaxAccount'][_0x3a00('0x57')]({'where':{'id':_0x5bc686[_0x3a00('0x54')]['id']},'include':[{'model':db[_0x3a00('0xa2')],'as':'List','include':[{'model':db[_0x3a00('0x6f')],'as':_0x3a00('0xa3'),'where':{'fax':_0x97307f},'limit':0x1,'order':[['updatedAt',_0x3a00('0xa4')]]}]}]})['then'](handleEntityNotFound(_0x50c8a8,null))['then'](function(_0x26f099){_0x549758=_0x26f099;if(_0x5bc686[_0x3a00('0x60')]['attachments']&&_0x5bc686[_0x3a00('0x60')][_0x3a00('0xa5')][_0x3a00('0x49')]){for(var _0x22bd9f=0x0;_0x22bd9f<_0x5bc686[_0x3a00('0x60')][_0x3a00('0xa5')][_0x3a00('0x49')];_0x22bd9f+=0x1){_0x5bc686[_0x3a00('0x60')][_0x3a00('0xa5')][_0x22bd9f]={'filename':_0x5bc686[_0x3a00('0x60')][_0x3a00('0xa5')][_0x22bd9f][_0x3a00('0x42')],'id':_0x5bc686[_0x3a00('0x60')][_0x3a00('0xa5')][_0x22bd9f]['id'],'path':path[_0x3a00('0xa6')](config[_0x3a00('0xa7')],_0x3a00('0xa8'),_0x5bc686[_0x3a00('0x60')]['attachments'][_0x22bd9f][_0x3a00('0xa9')])};}}return respondWithRpcPromise('CheckAfterSend',_0x3a00('0xaa'),{'FaxAccountId':_[_0x3a00('0xab')](_0x5bc686[_0x3a00('0x54')]['id'])?undefined:_0x5bc686[_0x3a00('0x54')]['id'],'path':_[_0x3a00('0xab')](_0x5bc686[_0x3a00('0x60')][_0x3a00('0xa5')][0x0][_0x3a00('0x5')])?undefined:_0x5bc686[_0x3a00('0x60')][_0x3a00('0xa5')][0x0][_0x3a00('0x5')],'fax':_[_0x3a00('0xab')](_0x5bc686[_0x3a00('0x60')]['to'][0x0])?undefined:_0x5bc686[_0x3a00('0x60')]['to'][0x0]},client9002);})['then'](function(){if(_0x549758){if(_['isNil'](_0x5bc686[_0x3a00('0x60')][_0x3a00('0xac')])){_0x5bc686['body'][_0x3a00('0xac')]=util[_0x3a00('0xa0')]('\x22%s\x22\x20<%s>',_0x549758[_0x3a00('0x42')],_0x549758['fax']);}if(_0x549758[_0x3a00('0xad')]){if(_0x549758['List']['Contacts'][_0x3a00('0x49')]){return _0x549758[_0x3a00('0xad')][_0x3a00('0xa3')][0x0];}else{return db[_0x3a00('0x6f')][_0x3a00('0x58')](_[_0x3a00('0x18')](_0x5bc686[_0x3a00('0x60')],{'firstName':_0x5bc686['body']['to'][0x0],'phone':_0x5bc686[_0x3a00('0x60')]['to'][0x0],'fax':_0x5bc686[_0x3a00('0x60')]['to'][0x0],'ListId':_0x549758[_0x3a00('0x9b')]}));}}else{throw new Error(_0x3a00('0xae'));}}else{throw new Error(_0x3a00('0xaf'));}})['then'](function(_0x2c0591){if(_0x2c0591){return db[_0x3a00('0x6b')][_0x3a00('0x57')]({'where':{'ContactId':_0x2c0591['id'],'closed':![],'FaxAccountId':_0x549758['id']}})['then'](function(_0x64ce3e){if(_0x64ce3e){return[_0x64ce3e,![]];}return db[_0x3a00('0x6b')][_0x3a00('0x58')]({'UserId':_0x5bc686[_0x3a00('0x5b')]['id'],'ContactId':_0x2c0591['id'],'FaxAccountId':_0x549758['id'],'fax':_0x5bc686[_0x3a00('0x60')]['to'][0x0],'firstMsgDirection':_0x3a00('0xb0'),'Messages':[_[_0x3a00('0x56')](_0x5bc686[_0x3a00('0x60')],{'read':![],'body':_0x5bc686[_0x3a00('0x60')][_0x3a00('0xa5')][0x0][_0x3a00('0xb1')],'FaxAccountId':_0x549758['id'],'UserId':_0x5bc686[_0x3a00('0x5b')]['id'],'ContactId':_0x2c0591['id'],'AttachmentId':_0x5bc686['body']['attachments'][0x0]['id']})]},{'include':[{'model':db[_0x3a00('0x9d')],'as':_0x3a00('0xb2')}]})['then'](function(_0x550d51){return[_0x550d51,!![]];});});}else{throw new Error(_0x3a00('0xb3'));}})[_0x3a00('0xb4')](function(_0x54a9ec,_0x409de5){if(_0x409de5){return _0x54a9ec;}return db[_0x3a00('0x9d')][_0x3a00('0x58')]({'direction':_0x3a00('0xb0'),'read':![],'body':_0x5bc686['body'][_0x3a00('0xa5')][0x0][_0x3a00('0xb1')],'FaxAccountId':_0x549758['id'],'FaxInteractionId':_0x54a9ec['id'],'UserId':_0x5bc686[_0x3a00('0x5b')]['id'],'ContactId':_0x54a9ec[_0x3a00('0xb5')],'AttachmentId':_0x5bc686['body']['attachments'][0x0]['id']})[_0x3a00('0x21')](function(_0xd56b70){_0x54a9ec['dataValues']['Messages']=[];_0x54a9ec[_0x3a00('0xb6')][_0x3a00('0xb2')][_0x3a00('0x89')](_0xd56b70[_0x3a00('0xb6')]);return _0x54a9ec;});})[_0x3a00('0x21')](function(_0x3465e0){respondWithRpcPromise('SendFax','SendFax',{'FaxAccountId':_['isNil'](_0x5bc686[_0x3a00('0x54')]['id'])?undefined:_0x5bc686[_0x3a00('0x54')]['id'],'path':_[_0x3a00('0xab')](_0x5bc686['body'][_0x3a00('0xa5')][0x0][_0x3a00('0x5')])?undefined:_0x5bc686[_0x3a00('0x60')][_0x3a00('0xa5')][0x0]['path'],'fax':_[_0x3a00('0xab')](_0x5bc686[_0x3a00('0x60')]['to'][0x0])?undefined:_0x5bc686[_0x3a00('0x60')]['to'][0x0],'AttachmentId':_0x5bc686[_0x3a00('0x60')][_0x3a00('0xa5')][0x0]['id']},client9002)['then'](function(_0x344097){logger[_0x3a00('0x22')](_0x3a00('0xb7'),_0x344097);})[_0x3a00('0x28')](function(_0x2ae661){logger['info']('SendFaxRpc,\x20%s',_0x2ae661);});return _0x3465e0;})[_0x3a00('0x21')](respondWithResult(_0x50c8a8,null))[_0x3a00('0x28')](handleError(_0x50c8a8,null));};exports[_0x3a00('0xb8')]=function(_0x3ee7ac,_0x59aade,_0x3505f8){return db[_0x3a00('0x3d')][_0x3a00('0x57')]({'where':{'id':_0x3ee7ac[_0x3a00('0x54')]['id']}})[_0x3a00('0x21')](handleEntityNotFound(_0x59aade,null))['then'](function(_0x407686){if(_0x407686){return _0x407686[_0x3a00('0xb8')](_0x3ee7ac[_0x3a00('0x60')][_0x3a00('0x66')],_[_0x3a00('0x6d')](_0x3ee7ac['body'],[_0x3a00('0x66'),'id'])||{})[_0x3a00('0xb4')](function(_0x2c413f){for(var _0x343128=0x0;_0x343128<_0x3ee7ac[_0x3a00('0x60')]['ids'][_0x3a00('0x49')];_0x343128+=0x1){socket[_0x3a00('0xb9')](_0x3a00('0xba'),{'UserId':Number(_0x3ee7ac[_0x3a00('0x60')]['ids'][_0x343128]),'FaxAccountId':Number(_0x3ee7ac[_0x3a00('0x54')]['id'])});}return _0x2c413f;});}})[_0x3a00('0x21')](respondWithResult(_0x59aade,null))['catch'](handleError(_0x59aade,null));};exports[_0x3a00('0xbb')]=function(_0x382847,_0x1ebb7b,_0x5b60a6){return db[_0x3a00('0x3d')][_0x3a00('0x57')]({'where':{'id':_0x382847[_0x3a00('0x54')]['id']}})[_0x3a00('0x21')](handleEntityNotFound(_0x1ebb7b,null))[_0x3a00('0x21')](function(_0x2079c2){if(_0x2079c2){return _0x2079c2[_0x3a00('0xbb')](_0x382847['query'][_0x3a00('0x66')])[_0x3a00('0x21')](function(){if(_[_0x3a00('0xbc')](_0x382847[_0x3a00('0x44')]['ids'])){for(var _0x701448=0x0;_0x701448<_0x382847[_0x3a00('0x44')][_0x3a00('0x66')][_0x3a00('0x49')];_0x701448+=0x1){socket[_0x3a00('0xb9')]('userFaxAccount:remove',{'UserId':Number(_0x382847[_0x3a00('0x44')][_0x3a00('0x66')][_0x701448]),'FaxAccountId':Number(_0x382847[_0x3a00('0x54')]['id'])});}}else{socket[_0x3a00('0xb9')]('userFaxAccount:remove',{'UserId':Number(_0x382847[_0x3a00('0x44')][_0x3a00('0x66')]),'FaxAccountId':Number(_0x382847[_0x3a00('0x54')]['id'])});}});}})[_0x3a00('0x21')](respondWithStatusCode(_0x1ebb7b,null))[_0x3a00('0x28')](handleError(_0x1ebb7b,null));};exports[_0x3a00('0xbd')]=function(_0x456eb7,_0x47d31a,_0x292a93){var _0x534c1c={};var _0xf22a32={};var _0x48bbad;var _0x2e4d47;return db[_0x3a00('0x3d')][_0x3a00('0x62')]({'where':{'id':_0x456eb7[_0x3a00('0x54')]['id']}})[_0x3a00('0x21')](handleEntityNotFound(_0x47d31a,null))[_0x3a00('0x21')](function(_0x1c80d2){if(_0x1c80d2){_0x48bbad=_0x1c80d2;_0xf22a32[_0x3a00('0x41')]=_[_0x3a00('0x43')](db['User']['rawAttributes']);_0xf22a32[_0x3a00('0x44')]=_[_0x3a00('0x43')](_0x456eb7[_0x3a00('0x44')]);_0xf22a32[_0x3a00('0x45')]=_[_0x3a00('0x46')](_0xf22a32[_0x3a00('0x41')],_0xf22a32['query']);_0x534c1c[_0x3a00('0x47')]=_['intersection'](_0xf22a32[_0x3a00('0x41')],qs[_0x3a00('0x48')](_0x456eb7[_0x3a00('0x44')]['fields']));_0x534c1c[_0x3a00('0x47')]=_0x534c1c[_0x3a00('0x47')][_0x3a00('0x49')]?_0x534c1c[_0x3a00('0x47')]:_0xf22a32['model'];_0x534c1c['order']=qs[_0x3a00('0x4c')](_0x456eb7[_0x3a00('0x44')][_0x3a00('0x4c')]);_0x534c1c[_0x3a00('0x4d')]=qs[_0x3a00('0x45')](_[_0x3a00('0x4e')](_0x456eb7['query'],_0xf22a32['filters']));if(_0x456eb7['query']['filter']){_0x534c1c[_0x3a00('0x4d')]=_['merge'](_0x534c1c['where'],{'$or':_[_0x3a00('0x3c')](_0x534c1c[_0x3a00('0x47')],function(_0x4c7168){var _0x2640c6={};_0x2640c6[_0x4c7168]={'$like':'%'+_0x456eb7[_0x3a00('0x44')][_0x3a00('0x4f')]+'%'};return _0x2640c6;})});}_0x534c1c=_[_0x3a00('0x56')]({},_0x534c1c,_0x456eb7['options']);return _0x48bbad[_0x3a00('0xbd')](_0x534c1c);}})[_0x3a00('0x21')](function(_0x7b9538){if(_0x7b9538){_0x2e4d47=_0x7b9538['length'];if(!_0x456eb7[_0x3a00('0x44')][_0x3a00('0x4a')](_0x3a00('0x64'))){_0x534c1c[_0x3a00('0x2e')]=qs[_0x3a00('0x2e')](_0x456eb7[_0x3a00('0x44')][_0x3a00('0x2e')]);_0x534c1c[_0x3a00('0x2c')]=qs[_0x3a00('0x2c')](_0x456eb7[_0x3a00('0x44')][_0x3a00('0x2c')]);}return _0x48bbad['getAgents'](_0x534c1c);}})[_0x3a00('0x21')](function(_0x20be45){if(_0x20be45){return _0x20be45?{'count':_0x2e4d47,'rows':_0x20be45}:null;}})[_0x3a00('0x21')](respondWithResult(_0x47d31a,null))['catch'](handleError(_0x47d31a,null));}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.events.js b/server/api/faxAccount/faxAccount.events.js index d490fc4..7fbf7c5 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 _0xb1dc=['save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','FaxAccount','setMaxListeners'];(function(_0x20a828,_0x565f23){var _0x4f671b=function(_0x3d4c78){while(--_0x3d4c78){_0x20a828['push'](_0x20a828['shift']());}};_0x4f671b(++_0x565f23);}(_0xb1dc,0xb7));var _0xcb1d=function(_0x412342,_0x180734){_0x412342=_0x412342-0x0;var _0x3e62cb=_0xb1dc[_0x412342];return _0x3e62cb;};'use strict';var EventEmitter=require(_0xcb1d('0x0'));var FaxAccount=require(_0xcb1d('0x1'))['db'][_0xcb1d('0x2')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0xcb1d('0x3')](0x0);var events={'afterCreate':_0xcb1d('0x4'),'afterUpdate':_0xcb1d('0x5'),'afterDestroy':_0xcb1d('0x6')};function emitEvent(_0x17f14b){return function(_0x54936b,_0x37f222,_0x459801){FaxAccountEvents[_0xcb1d('0x7')](_0x17f14b+':'+_0x54936b['id'],_0x54936b);FaxAccountEvents[_0xcb1d('0x7')](_0x17f14b,_0x54936b);_0x459801(null);};}for(var e in events){if(events[_0xcb1d('0x8')](e)){var event=events[e];FaxAccount[_0xcb1d('0x9')](e,emitEvent(event));}}module[_0xcb1d('0xa')]=FaxAccountEvents; \ No newline at end of file +var _0xf347=['FaxAccount','setMaxListeners','update','remove','emit','hook','exports','events'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xf347,0xef));var _0x7f34=function(_0x10393d,_0x2c4f3b){_0x10393d=_0x10393d-0x0;var _0x8eb749=_0xf347[_0x10393d];return _0x8eb749;};'use strict';var EventEmitter=require(_0x7f34('0x0'));var FaxAccount=require('../../mysqldb')['db'][_0x7f34('0x1')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0x7f34('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x7f34('0x3'),'afterDestroy':_0x7f34('0x4')};function emitEvent(_0x2b276b){return function(_0x1425aa,_0x489801,_0x5eb177){FaxAccountEvents[_0x7f34('0x5')](_0x2b276b+':'+_0x1425aa['id'],_0x1425aa);FaxAccountEvents[_0x7f34('0x5')](_0x2b276b,_0x1425aa);_0x5eb177(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxAccount[_0x7f34('0x6')](e,emitEvent(event));}}module[_0x7f34('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 83ba8f8..5a72505 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 _0x3be1=['lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./faxAccount.attributes','exports','define','FaxAccount'];(function(_0x405ac9,_0x2c795c){var _0x2d200f=function(_0x27ae59){while(--_0x27ae59){_0x405ac9['push'](_0x405ac9['shift']());}};_0x2d200f(++_0x2c795c);}(_0x3be1,0x15f));var _0x13be=function(_0x5444a2,_0x1b8948){_0x5444a2=_0x5444a2-0x0;var _0x281f50=_0x3be1[_0x5444a2];return _0x281f50;};'use strict';var _=require(_0x13be('0x0'));var util=require(_0x13be('0x1'));var logger=require(_0x13be('0x2'))(_0x13be('0x3'));var moment=require(_0x13be('0x4'));var BPromise=require(_0x13be('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x13be('0x6'));var rimraf=require(_0x13be('0x7'));var config=require(_0x13be('0x8'));var attributes=require(_0x13be('0x9'));module[_0x13be('0xa')]=function(_0xcd4847,_0x5e0379){return _0xcd4847[_0x13be('0xb')](_0x13be('0xc'),attributes,{'tableName':'fax_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x814e=['bluebird','request-promise','path','../../config/environment','./faxAccount.attributes','exports','define','fax_accounts','lodash','util','../../config/logger','moment'];(function(_0x1189cb,_0x3f8bec){var _0x207623=function(_0x2af410){while(--_0x2af410){_0x1189cb['push'](_0x1189cb['shift']());}};_0x207623(++_0x3f8bec);}(_0x814e,0xe0));var _0xe814=function(_0x449e32,_0x508ca9){_0x449e32=_0x449e32-0x0;var _0x13cde6=_0x814e[_0x449e32];return _0x13cde6;};'use strict';var _=require(_0xe814('0x0'));var util=require(_0xe814('0x1'));var logger=require(_0xe814('0x2'))('api');var moment=require(_0xe814('0x3'));var BPromise=require(_0xe814('0x4'));var rp=require(_0xe814('0x5'));var fs=require('fs');var path=require(_0xe814('0x6'));var rimraf=require('rimraf');var config=require(_0xe814('0x7'));var attributes=require(_0xe814('0x8'));module[_0xe814('0x9')]=function(_0xa5a72e,_0x2fcff8){return _0xa5a72e[_0xe814('0xa')]('FaxAccount',attributes,{'tableName':_0xe814('0xb'),'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 1b0eb08..85f2a99 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 _0xd3fd=['map','model','NotifyFaxAccount','body','fax','CmContact','describe','Sequelize','ValidationError','difference','keys','createdAt','updatedAt','ListId','isNil','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','find','CmList','List','Contacts','DESC','Applications','get','account','applications','asc','length','create','contact','FaxInteraction','Contact\x20not\x20found','spread','autoclose','push','close','unmanaged','*,*,*,*','created','FaxMessage','AttachmentId','interaction','UserId','User','name','unshift','agent','waitForTheAssignedAgent','queueId','FaxQueue','queue','Start','startRouting','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','defaults','localhost','socket.io-emitter','./faxAccount.socket','register','then','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','FaxAccount,\x20%s,\x20%s','message','result','catch','GetFaxAccount','FaxAccount','findAll','options','raw','where','attributes','limit','include'];(function(_0x4a676b,_0x1d45c8){var _0x3cec1c=function(_0x5a3534){while(--_0x5a3534){_0x4a676b['push'](_0x4a676b['shift']());}};_0x3cec1c(++_0x1d45c8);}(_0xd3fd,0xf3));var _0xdd3f=function(_0x1442cc,_0x353c60){_0x1442cc=_0x1442cc-0x0;var _0x1ed293=_0xd3fd[_0x1442cc];return _0x1ed293;};'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('../../config/utils');var logger=require(_0xdd3f('0x7'))(_0xdd3f('0x8'));var config=require(_0xdd3f('0x9'));var jayson=require(_0xdd3f('0xa'));var client=jayson[_0xdd3f('0xb')]['http']({'port':0x232c});config['redis']=_[_0xdd3f('0xc')](config['redis'],{'host':_0xdd3f('0xd'),'port':0x18eb});var socket=require(_0xdd3f('0xe'))(new Redis(config['redis']));require(_0xdd3f('0xf'))[_0xdd3f('0x10')](socket);function respondWithRpcPromise(_0x94e3cb,_0x3c08cb,_0x111334){return new BPromise(function(_0x6a23fc,_0x45be6a){return client['request'](_0x94e3cb,_0x111334)[_0xdd3f('0x11')](function(_0xe27643){logger['info']('FaxAccount,\x20%s,\x20%s',_0x3c08cb,_0xdd3f('0x12'));logger[_0xdd3f('0x13')](_0xdd3f('0x14'),_0x3c08cb,_0xdd3f('0x12'),JSON[_0xdd3f('0x15')](_0xe27643));if(_0xe27643[_0xdd3f('0x16')]){if(_0xe27643[_0xdd3f('0x16')]['code']===0x1f4){logger[_0xdd3f('0x16')](_0xdd3f('0x17'),_0x3c08cb,_0xe27643['error'][_0xdd3f('0x18')]);return _0x45be6a(_0xe27643[_0xdd3f('0x16')][_0xdd3f('0x18')]);}logger['error']('FaxAccount,\x20%s,\x20%s',_0x3c08cb,_0xe27643[_0xdd3f('0x16')][_0xdd3f('0x18')]);return _0x6a23fc(_0xe27643[_0xdd3f('0x16')]['message']);}else{logger['info'](_0xdd3f('0x17'),_0x3c08cb,_0xdd3f('0x12'));_0x6a23fc(_0xe27643[_0xdd3f('0x19')][_0xdd3f('0x18')]);}})[_0xdd3f('0x1a')](function(_0x1a1496){logger['error']('FaxAccount,\x20%s,\x20%s',_0x3c08cb,_0x1a1496);_0x45be6a(_0x1a1496);});});}exports[_0xdd3f('0x1b')]=function(_0x158863){var _0x246863=this;return new Promise(function(_0x413805,_0x81088a){return db[_0xdd3f('0x1c')][_0xdd3f('0x1d')]({'raw':_0x158863[_0xdd3f('0x1e')]?_0x158863[_0xdd3f('0x1e')][_0xdd3f('0x1f')]===undefined?!![]:![]:!![],'where':_0x158863[_0xdd3f('0x1e')]?_0x158863[_0xdd3f('0x1e')][_0xdd3f('0x20')]||null:null,'attributes':_0x158863[_0xdd3f('0x1e')]?_0x158863[_0xdd3f('0x1e')][_0xdd3f('0x21')]||null:null,'limit':_0x158863[_0xdd3f('0x1e')]?_0x158863[_0xdd3f('0x1e')][_0xdd3f('0x22')]||null:null,'include':_0x158863['options']?_0x158863[_0xdd3f('0x1e')][_0xdd3f('0x23')]?_[_0xdd3f('0x24')](_0x158863[_0xdd3f('0x1e')][_0xdd3f('0x23')],function(_0x194a6c){return{'model':db[_0x194a6c[_0xdd3f('0x25')]],'as':_0x194a6c['as'],'attributes':_0x194a6c[_0xdd3f('0x21')],'include':_0x194a6c['include']?_[_0xdd3f('0x24')](_0x194a6c[_0xdd3f('0x23')],function(_0x39f425){return{'model':db[_0x39f425[_0xdd3f('0x25')]],'as':_0x39f425['as'],'attributes':_0x39f425[_0xdd3f('0x21')],'include':_0x39f425[_0xdd3f('0x23')]?_[_0xdd3f('0x24')](_0x39f425['include'],function(_0x2a232b){return{'model':db[_0x2a232b[_0xdd3f('0x25')]],'as':_0x2a232b['as'],'attributes':_0x2a232b[_0xdd3f('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1339dc){logger['info']('GetFaxAccount',_0x158863);logger[_0xdd3f('0x13')](_0xdd3f('0x1b'),_0x158863,JSON['stringify'](_0x1339dc));_0x413805(_0x1339dc);})[_0xdd3f('0x1a')](function(_0x12fd6a){logger[_0xdd3f('0x16')]('GetFaxAccount',_0x12fd6a[_0xdd3f('0x18')],_0x158863);_0x81088a(_0x246863[_0xdd3f('0x16')](0x1f4,_0x12fd6a[_0xdd3f('0x18')]));});});};exports[_0xdd3f('0x26')]=function(_0x5d8386,_0x3d275e,_0x6f072b){var _0x595688=this;return new Promise(function(_0x239ad2,_0x5a950a){var _0x87ea88={'body':_0x5d8386[_0xdd3f('0x27')],'channel':_0xdd3f('0x28')};var _0x411a7a=[];var _0x455415=[];var _0x2d8b0c={};return db[_0xdd3f('0x29')][_0xdd3f('0x2a')]()[_0xdd3f('0x11')](function(_0x5ad797){if(!_0x5ad797){throw new db[(_0xdd3f('0x2b'))][(_0xdd3f('0x2c'))]('no\x20available\x20attributes');}_0x411a7a=_[_0xdd3f('0x2d')](_[_0xdd3f('0x2e')](_0x5ad797),[_0xdd3f('0x2f'),'updatedAt']);_0x455415=_[_0xdd3f('0x2d')](_[_0xdd3f('0x2e')](_0x5ad797),[_0xdd3f('0x2f'),_0xdd3f('0x30'),'CompanyId',_0xdd3f('0x31')]);if(_0x5d8386[_0xdd3f('0x27')]['id']){delete _0x5d8386[_0xdd3f('0x27')]['id'];}if(_[_0xdd3f('0x32')](_0x5d8386[_0xdd3f('0x27')][_0xdd3f('0x33')])){throw new db[(_0xdd3f('0x2b'))][(_0xdd3f('0x2c'))](_0xdd3f('0x34'));}if(_[_0xdd3f('0x32')](_0x5d8386[_0xdd3f('0x27')]['body'])||_0x5d8386[_0xdd3f('0x27')]['body']===''){throw new db[(_0xdd3f('0x2b'))][(_0xdd3f('0x2c'))](_0xdd3f('0x35'));}if(_['isNil'](_0x5d8386[_0xdd3f('0x27')][_0xdd3f('0x36')])){throw new db['Sequelize'][(_0xdd3f('0x2c'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x455415);}if(!_[_0xdd3f('0x37')](_0x455415,_0x5d8386[_0xdd3f('0x27')]['mapKey'])){throw new db['Sequelize'][(_0xdd3f('0x2c'))](_0xdd3f('0x38')+_0x455415);}_0x2d8b0c[_0x5d8386[_0xdd3f('0x27')][_0xdd3f('0x36')]]=_0x5d8386[_0xdd3f('0x27')][_0xdd3f('0x33')];})[_0xdd3f('0x11')](function(){return db[_0xdd3f('0x1c')][_0xdd3f('0x39')]({'where':{'id':_0x5d8386['account']['id']},'include':[{'model':db[_0xdd3f('0x3a')],'as':_0xdd3f('0x3b'),'include':[{'model':db[_0xdd3f('0x29')],'as':_0xdd3f('0x3c'),'where':_0x2d8b0c,'limit':0x1,'order':[['updatedAt',_0xdd3f('0x3d')]]}]},{'model':db['FaxApplication'],'as':_0xdd3f('0x3e')}]});})[_0xdd3f('0x11')](function(_0x58fb55){if(_0x58fb55&&_0x58fb55[_0xdd3f('0x3b')]){var _0x4f87bd=_0x58fb55[_0xdd3f('0x3f')]({'plain':!![]});_0x87ea88[_0xdd3f('0x40')]=_0x4f87bd;_0x87ea88[_0xdd3f('0x41')]=_0x4f87bd['Applications'];_0x87ea88['list']=_0x4f87bd['List'];_0x87ea88[_0xdd3f('0x41')]=_['orderBy'](_0x87ea88[_0xdd3f('0x41')],['priority'],[_0xdd3f('0x42')]);if(_0x87ea88[_0xdd3f('0x40')][_0xdd3f('0x3e')]){delete _0x87ea88['account'][_0xdd3f('0x3e')];}if(_0x87ea88[_0xdd3f('0x40')][_0xdd3f('0x3b')]&&_0x87ea88[_0xdd3f('0x40')][_0xdd3f('0x3b')][_0xdd3f('0x3c')][_0xdd3f('0x43')]){return _0x87ea88[_0xdd3f('0x40')]['List'][_0xdd3f('0x3c')][0x0];}var _0x114967=_[_0xdd3f('0xc')](_0x5d8386[_0xdd3f('0x27')],{'firstName':_0x5d8386['body']['from'],'ListId':_0x4f87bd[_0xdd3f('0x31')]});_0x114967[_0x5d8386[_0xdd3f('0x27')]['mapKey']]=_0x5d8386['body'][_0xdd3f('0x33')];return db[_0xdd3f('0x29')][_0xdd3f('0x44')](_0x114967,{'fields':_0x411a7a,'raw':!![]});}})['then'](function(_0x2edea4){_0x87ea88[_0xdd3f('0x45')]=_0x2edea4;if(_0x2edea4){var _0x4ac26a={'ContactId':_0x2edea4['id'],'FaxAccountId':_0x5d8386['account']['id'],'fax':_0x2edea4['fax']};return db[_0xdd3f('0x46')][_0xdd3f('0x39')]({'where':{'ContactId':_0x2edea4['id'],'closed':![],'FaxAccountId':_0x5d8386['account']['id']}})[_0xdd3f('0x11')](function(_0x277be3){if(_0x277be3){return[_0x277be3,![]];}return db['FaxInteraction']['create'](_0x4ac26a)[_0xdd3f('0x11')](function(_0x52de71){return[_0x52de71,!![]];});});}else{throw new Error(_0xdd3f('0x47'));}})[_0xdd3f('0x48')](function(_0x261bf6,_0x15b7bf){var _0x45650d=_0x261bf6['get']({'plain':!![]});if(_0x15b7bf){if(_0x87ea88[_0xdd3f('0x40')][_0xdd3f('0x49')]){_0x87ea88['applications'][_0xdd3f('0x4a')]({'id':0x0,'priority':_0x87ea88[_0xdd3f('0x41')]['length']+0x1,'app':_0xdd3f('0x4b'),'appdata':_0xdd3f('0x4c'),'interval':_0xdd3f('0x4d')});}_0x45650d[_0xdd3f('0x4e')]=!![];}else{_0x45650d[_0xdd3f('0x4e')]=![];}_0x87ea88['interaction']=_0x45650d;return db[_0xdd3f('0x4f')][_0xdd3f('0x44')]({'body':_0x5d8386['body']['body'],'FaxAccountId':_0x5d8386['account']['id'],'FaxInteractionId':_0x261bf6['id'],'direction':'in','ContactId':_0x261bf6['ContactId'],'AttachmentId':_0x5d8386[_0xdd3f('0x27')][_0xdd3f('0x50')]});})[_0xdd3f('0x11')](function(_0x2f079e){_0x87ea88[_0xdd3f('0x18')]=_0x2f079e;if(!_0x87ea88[_0xdd3f('0x51')][_0xdd3f('0x52')])return;return db[_0xdd3f('0x53')][_0xdd3f('0x39')]({'attributes':['id',_0xdd3f('0x54')],'where':{'id':_0x87ea88['interaction'][_0xdd3f('0x52')]}});})[_0xdd3f('0x11')](function(_0x53f885){if(_0x53f885){_0x87ea88['applications'][_0xdd3f('0x55')]({'id':0x0,'priority':0x0,'app':_0xdd3f('0x56'),'appdata':_0x53f885[_0xdd3f('0x54')]+','+(_0x87ea88[_0xdd3f('0x40')][_0xdd3f('0x57')]||0xa),'interval':_0xdd3f('0x4d')});}if(!_0x87ea88[_0xdd3f('0x51')][_0xdd3f('0x58')])return;return db[_0xdd3f('0x59')][_0xdd3f('0x39')]({'attributes':['id',_0xdd3f('0x54')],'where':{'id':_0x87ea88[_0xdd3f('0x51')][_0xdd3f('0x58')]}});})[_0xdd3f('0x11')](function(_0x44e3d9){if(_0x44e3d9){_0x87ea88[_0xdd3f('0x41')][_0xdd3f('0x55')]({'id':0x0,'priority':0x1,'app':_0xdd3f('0x5a'),'appdata':_0x44e3d9['name']+','+(_0x87ea88[_0xdd3f('0x40')]['waitForTheAssignedQueue']||0x12c),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0xdd3f('0x5b'),_0xdd3f('0x5c'),_0x87ea88);})[_0xdd3f('0x11')](function(_0x588047){_0x239ad2(_0x588047);})[_0xdd3f('0x1a')](function(_0x3bf94f){_0x5a950a(_0x595688[_0xdd3f('0x16')](0x1f4,_0x3bf94f[_0xdd3f('0x18')]));});});}; \ No newline at end of file +var _0x4ecd=['unshift','name','queueId','queue','waitForTheAssignedQueue','*,*,*,*','Start','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/environment','http','redis','localhost','socket.io-emitter','./faxAccount.socket','request','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetFaxAccount','FaxAccount','findAll','raw','options','attributes','limit','include','model','map','stringify','NotifyFaxAccount','body','fax','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','keys','createdAt','updatedAt','CompanyId','ListId','from\x20is\x20mandatory','isNil','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','from','account','CmList','Contacts','Applications','List','applications','list','priority','asc','length','contact','FaxInteraction','find','create','Contact\x20not\x20found','get','close','created','interaction','AttachmentId','UserId','User'];(function(_0x30d13b,_0x201ba5){var _0x1b237c=function(_0x2256b2){while(--_0x2256b2){_0x30d13b['push'](_0x30d13b['shift']());}};_0x1b237c(++_0x201ba5);}(_0x4ecd,0xaf));var _0xd4ec=function(_0x4c8f89,_0x318d19){_0x4c8f89=_0x4c8f89-0x0;var _0x5c5685=_0x4ecd[_0x4c8f89];return _0x5c5685;};'use strict';var _=require(_0xd4ec('0x0'));var util=require(_0xd4ec('0x1'));var moment=require(_0xd4ec('0x2'));var BPromise=require('bluebird');var rs=require(_0xd4ec('0x3'));var fs=require('fs');var Redis=require(_0xd4ec('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xd4ec('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0xd4ec('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0xd4ec('0x7')]({'port':0x232c});config[_0xd4ec('0x8')]=_['defaults'](config[_0xd4ec('0x8')],{'host':_0xd4ec('0x9'),'port':0x18eb});var socket=require(_0xd4ec('0xa'))(new Redis(config[_0xd4ec('0x8')]));require(_0xd4ec('0xb'))['register'](socket);function respondWithRpcPromise(_0x58c194,_0x2ec499,_0xafedfc){return new BPromise(function(_0x19ac0f,_0x29e75c){return client[_0xd4ec('0xc')](_0x58c194,_0xafedfc)[_0xd4ec('0xd')](function(_0x274c0d){logger[_0xd4ec('0xe')](_0xd4ec('0xf'),_0x2ec499,_0xd4ec('0x10'));logger[_0xd4ec('0x11')](_0xd4ec('0x12'),_0x2ec499,_0xd4ec('0x10'),JSON['stringify'](_0x274c0d));if(_0x274c0d[_0xd4ec('0x13')]){if(_0x274c0d[_0xd4ec('0x13')][_0xd4ec('0x14')]===0x1f4){logger[_0xd4ec('0x13')](_0xd4ec('0xf'),_0x2ec499,_0x274c0d[_0xd4ec('0x13')][_0xd4ec('0x15')]);return _0x29e75c(_0x274c0d[_0xd4ec('0x13')]['message']);}logger[_0xd4ec('0x13')]('FaxAccount,\x20%s,\x20%s',_0x2ec499,_0x274c0d[_0xd4ec('0x13')][_0xd4ec('0x15')]);return _0x19ac0f(_0x274c0d[_0xd4ec('0x13')][_0xd4ec('0x15')]);}else{logger[_0xd4ec('0xe')](_0xd4ec('0xf'),_0x2ec499,_0xd4ec('0x10'));_0x19ac0f(_0x274c0d[_0xd4ec('0x16')]['message']);}})[_0xd4ec('0x17')](function(_0x3880b0){logger[_0xd4ec('0x13')](_0xd4ec('0xf'),_0x2ec499,_0x3880b0);_0x29e75c(_0x3880b0);});});}exports[_0xd4ec('0x18')]=function(_0xd63661){var _0xe52522=this;return new Promise(function(_0x27658e,_0x6886c){return db[_0xd4ec('0x19')][_0xd4ec('0x1a')]({'raw':_0xd63661['options']?_0xd63661['options'][_0xd4ec('0x1b')]===undefined?!![]:![]:!![],'where':_0xd63661[_0xd4ec('0x1c')]?_0xd63661[_0xd4ec('0x1c')]['where']||null:null,'attributes':_0xd63661[_0xd4ec('0x1c')]?_0xd63661['options'][_0xd4ec('0x1d')]||null:null,'limit':_0xd63661[_0xd4ec('0x1c')]?_0xd63661[_0xd4ec('0x1c')][_0xd4ec('0x1e')]||null:null,'include':_0xd63661[_0xd4ec('0x1c')]?_0xd63661[_0xd4ec('0x1c')][_0xd4ec('0x1f')]?_['map'](_0xd63661[_0xd4ec('0x1c')][_0xd4ec('0x1f')],function(_0x1f3223){return{'model':db[_0x1f3223[_0xd4ec('0x20')]],'as':_0x1f3223['as'],'attributes':_0x1f3223[_0xd4ec('0x1d')],'include':_0x1f3223[_0xd4ec('0x1f')]?_['map'](_0x1f3223['include'],function(_0x4dc599){return{'model':db[_0x4dc599['model']],'as':_0x4dc599['as'],'attributes':_0x4dc599[_0xd4ec('0x1d')],'include':_0x4dc599[_0xd4ec('0x1f')]?_[_0xd4ec('0x21')](_0x4dc599[_0xd4ec('0x1f')],function(_0x241f17){return{'model':db[_0x241f17['model']],'as':_0x241f17['as'],'attributes':_0x241f17[_0xd4ec('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x574d00){logger[_0xd4ec('0xe')](_0xd4ec('0x18'),_0xd63661);logger[_0xd4ec('0x11')]('GetFaxAccount',_0xd63661,JSON[_0xd4ec('0x22')](_0x574d00));_0x27658e(_0x574d00);})[_0xd4ec('0x17')](function(_0x42bfed){logger['error']('GetFaxAccount',_0x42bfed['message'],_0xd63661);_0x6886c(_0xe52522['error'](0x1f4,_0x42bfed[_0xd4ec('0x15')]));});});};exports[_0xd4ec('0x23')]=function(_0x26583b,_0x5806fe,_0x1896d1){var _0x575bdc=this;return new Promise(function(_0x1abbd0,_0x4cd979){var _0x542a32={'body':_0x26583b[_0xd4ec('0x24')],'channel':_0xd4ec('0x25')};var _0x25f37c=[];var _0x43269f=[];var _0x55891c={};return db[_0xd4ec('0x26')]['describe']()[_0xd4ec('0xd')](function(_0x5cc766){if(!_0x5cc766){throw new db[(_0xd4ec('0x27'))][(_0xd4ec('0x28'))](_0xd4ec('0x29'));}_0x25f37c=_[_0xd4ec('0x2a')](_[_0xd4ec('0x2b')](_0x5cc766),[_0xd4ec('0x2c'),'updatedAt']);_0x43269f=_[_0xd4ec('0x2a')](_[_0xd4ec('0x2b')](_0x5cc766),[_0xd4ec('0x2c'),_0xd4ec('0x2d'),_0xd4ec('0x2e'),_0xd4ec('0x2f')]);if(_0x26583b[_0xd4ec('0x24')]['id']){delete _0x26583b['body']['id'];}if(_['isNil'](_0x26583b[_0xd4ec('0x24')]['from'])){throw new db[(_0xd4ec('0x27'))][(_0xd4ec('0x28'))](_0xd4ec('0x30'));}if(_[_0xd4ec('0x31')](_0x26583b[_0xd4ec('0x24')][_0xd4ec('0x24')])||_0x26583b['body'][_0xd4ec('0x24')]===''){throw new db['Sequelize']['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xd4ec('0x31')](_0x26583b[_0xd4ec('0x24')][_0xd4ec('0x32')])){throw new db[(_0xd4ec('0x27'))]['ValidationError'](_0xd4ec('0x33')+_0x43269f);}if(!_[_0xd4ec('0x34')](_0x43269f,_0x26583b[_0xd4ec('0x24')][_0xd4ec('0x32')])){throw new db[(_0xd4ec('0x27'))][(_0xd4ec('0x28'))](_0xd4ec('0x35')+_0x43269f);}_0x55891c[_0x26583b['body'][_0xd4ec('0x32')]]=_0x26583b[_0xd4ec('0x24')][_0xd4ec('0x36')];})['then'](function(){return db[_0xd4ec('0x19')]['find']({'where':{'id':_0x26583b[_0xd4ec('0x37')]['id']},'include':[{'model':db[_0xd4ec('0x38')],'as':'List','include':[{'model':db[_0xd4ec('0x26')],'as':_0xd4ec('0x39'),'where':_0x55891c,'limit':0x1,'order':[[_0xd4ec('0x2d'),'DESC']]}]},{'model':db['FaxApplication'],'as':_0xd4ec('0x3a')}]});})['then'](function(_0x41ff54){if(_0x41ff54&&_0x41ff54[_0xd4ec('0x3b')]){var _0x18bbe0=_0x41ff54['get']({'plain':!![]});_0x542a32['account']=_0x18bbe0;_0x542a32[_0xd4ec('0x3c')]=_0x18bbe0[_0xd4ec('0x3a')];_0x542a32[_0xd4ec('0x3d')]=_0x18bbe0[_0xd4ec('0x3b')];_0x542a32[_0xd4ec('0x3c')]=_['orderBy'](_0x542a32[_0xd4ec('0x3c')],[_0xd4ec('0x3e')],[_0xd4ec('0x3f')]);if(_0x542a32[_0xd4ec('0x37')][_0xd4ec('0x3a')]){delete _0x542a32['account'][_0xd4ec('0x3a')];}if(_0x542a32['account']['List']&&_0x542a32['account'][_0xd4ec('0x3b')][_0xd4ec('0x39')][_0xd4ec('0x40')]){return _0x542a32[_0xd4ec('0x37')]['List'][_0xd4ec('0x39')][0x0];}var _0x46478b=_['defaults'](_0x26583b[_0xd4ec('0x24')],{'firstName':_0x26583b['body']['from'],'ListId':_0x18bbe0[_0xd4ec('0x2f')]});_0x46478b[_0x26583b[_0xd4ec('0x24')][_0xd4ec('0x32')]]=_0x26583b[_0xd4ec('0x24')]['from'];return db['CmContact']['create'](_0x46478b,{'fields':_0x25f37c,'raw':!![]});}})[_0xd4ec('0xd')](function(_0x5c5383){_0x542a32[_0xd4ec('0x41')]=_0x5c5383;if(_0x5c5383){var _0x28e96a={'ContactId':_0x5c5383['id'],'FaxAccountId':_0x26583b[_0xd4ec('0x37')]['id'],'fax':_0x5c5383[_0xd4ec('0x25')]};return db[_0xd4ec('0x42')][_0xd4ec('0x43')]({'where':{'ContactId':_0x5c5383['id'],'closed':![],'FaxAccountId':_0x26583b[_0xd4ec('0x37')]['id']}})[_0xd4ec('0xd')](function(_0x961977){if(_0x961977){return[_0x961977,![]];}return db[_0xd4ec('0x42')][_0xd4ec('0x44')](_0x28e96a)[_0xd4ec('0xd')](function(_0x42559e){return[_0x42559e,!![]];});});}else{throw new Error(_0xd4ec('0x45'));}})['spread'](function(_0x56c9ad,_0x1f3f2f){var _0x35f72a=_0x56c9ad[_0xd4ec('0x46')]({'plain':!![]});if(_0x1f3f2f){if(_0x542a32['account']['autoclose']){_0x542a32[_0xd4ec('0x3c')]['push']({'id':0x0,'priority':_0x542a32[_0xd4ec('0x3c')][_0xd4ec('0x40')]+0x1,'app':_0xd4ec('0x47'),'appdata':'unmanaged','interval':'*,*,*,*'});}_0x35f72a['created']=!![];}else{_0x35f72a[_0xd4ec('0x48')]=![];}_0x542a32[_0xd4ec('0x49')]=_0x35f72a;return db['FaxMessage']['create']({'body':_0x26583b[_0xd4ec('0x24')]['body'],'FaxAccountId':_0x26583b['account']['id'],'FaxInteractionId':_0x56c9ad['id'],'direction':'in','ContactId':_0x56c9ad['ContactId'],'AttachmentId':_0x26583b['body'][_0xd4ec('0x4a')]});})['then'](function(_0x1b875c){_0x542a32[_0xd4ec('0x15')]=_0x1b875c;if(!_0x542a32[_0xd4ec('0x49')][_0xd4ec('0x4b')])return;return db[_0xd4ec('0x4c')][_0xd4ec('0x43')]({'attributes':['id','name'],'where':{'id':_0x542a32[_0xd4ec('0x49')][_0xd4ec('0x4b')]}});})['then'](function(_0x526689){if(_0x526689){_0x542a32[_0xd4ec('0x3c')][_0xd4ec('0x4d')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x526689[_0xd4ec('0x4e')]+','+(_0x542a32['account']['waitForTheAssignedAgent']||0xa),'interval':'*,*,*,*'});}if(!_0x542a32[_0xd4ec('0x49')]['queueId'])return;return db['FaxQueue'][_0xd4ec('0x43')]({'attributes':['id','name'],'where':{'id':_0x542a32[_0xd4ec('0x49')][_0xd4ec('0x4f')]}});})['then'](function(_0x50727c){if(_0x50727c){_0x542a32[_0xd4ec('0x3c')]['unshift']({'id':0x0,'priority':0x1,'app':_0xd4ec('0x50'),'appdata':_0x50727c['name']+','+(_0x542a32[_0xd4ec('0x37')][_0xd4ec('0x51')]||0x12c),'interval':_0xd4ec('0x52')});}return respondWithRpcPromise(_0xd4ec('0x53'),'startRouting',_0x542a32);})[_0xd4ec('0xd')](function(_0x2565c2){_0x1abbd0(_0x2565c2);})[_0xd4ec('0x17')](function(_0x5ea4ed){_0x4cd979(_0x575bdc[_0xd4ec('0x13')](0x1f4,_0x5ea4ed[_0xd4ec('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.socket.js b/server/api/faxAccount/faxAccount.socket.js index 793bc5c..e1eb0f2 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 _0xac67=['register','length','faxAccount:','./faxAccount.events','save','remove','update','emit','removeListener'];(function(_0x21461c,_0x22b173){var _0x2f29b6=function(_0x88241){while(--_0x88241){_0x21461c['push'](_0x21461c['shift']());}};_0x2f29b6(++_0x22b173);}(_0xac67,0x108));var _0x7ac6=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0xac67[_0x40a045];return _0x1a687c;};'use strict';var FaxAccountEvents=require(_0x7ac6('0x0'));var events=[_0x7ac6('0x1'),_0x7ac6('0x2'),_0x7ac6('0x3')];function createListener(_0x26cd30,_0x5ece60){return function(_0x34799a){_0x5ece60[_0x7ac6('0x4')](_0x26cd30,_0x34799a);};}function removeListener(_0x43ea38,_0x117683){return function(){FaxAccountEvents[_0x7ac6('0x5')](_0x43ea38,_0x117683);};}exports[_0x7ac6('0x6')]=function(_0x12f8e9){for(var _0x12106a=0x0,_0x56c122=events[_0x7ac6('0x7')];_0x12106a<_0x56c122;_0x12106a++){var _0xeb3ec6=events[_0x12106a];var _0x22dde3=createListener(_0x7ac6('0x8')+_0xeb3ec6,_0x12f8e9);FaxAccountEvents['on'](_0xeb3ec6,_0x22dde3);}}; \ No newline at end of file +var _0xb689=['register','length','./faxAccount.events','remove','update','emit'];(function(_0x44dba1,_0x270ad5){var _0x2fbd3f=function(_0x5e0865){while(--_0x5e0865){_0x44dba1['push'](_0x44dba1['shift']());}};_0x2fbd3f(++_0x270ad5);}(_0xb689,0x12e));var _0x9b68=function(_0x464c57,_0x69ad72){_0x464c57=_0x464c57-0x0;var _0x322d49=_0xb689[_0x464c57];return _0x322d49;};'use strict';var FaxAccountEvents=require(_0x9b68('0x0'));var events=['save',_0x9b68('0x1'),_0x9b68('0x2')];function createListener(_0x49f3de,_0x8fa7e9){return function(_0x483ab3){_0x8fa7e9[_0x9b68('0x3')](_0x49f3de,_0x483ab3);};}function removeListener(_0x43f444,_0x11f7f3){return function(){FaxAccountEvents['removeListener'](_0x43f444,_0x11f7f3);};}exports[_0x9b68('0x4')]=function(_0x456424){for(var _0x409da3=0x0,_0xd23bb2=events[_0x9b68('0x5')];_0x409da3<_0xd23bb2;_0x409da3++){var _0x2ca8cb=events[_0x409da3];var _0x33f194=createListener('faxAccount:'+_0x2ca8cb,_0x456424);FaxAccountEvents['on'](_0x2ca8cb,_0x33f194);}}; \ No newline at end of file diff --git a/server/api/faxAccount/index.js b/server/api/faxAccount/index.js index f59d52a..465901a 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 _0xcc84=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxAccount.controller','get','isAuthenticated','/describe','/:id','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','getInteractions','/:id/applications','getApplications','/:id/messages','/:id/users','getAgents','post','create','addDisposition','addAnswer','/:id/interactions','addInteraction','addApplications','/addaccountapplications','/updateaccountapplications','/:id/send','addAgents','put','update','removeDispositions','delete','removeAnswers','removeAgents','multer','util','path','connect-timeout','Router'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0xcc84,0x195));var _0x4cc8=function(_0x9ad6d2,_0x183d43){_0x9ad6d2=_0x9ad6d2-0x0;var _0x5087e6=_0xcc84[_0x9ad6d2];return _0x5087e6;};'use strict';var multer=require(_0x4cc8('0x0'));var util=require(_0x4cc8('0x1'));var path=require(_0x4cc8('0x2'));var timeout=require(_0x4cc8('0x3'));var express=require('express');var router=express[_0x4cc8('0x4')]();var fs_extra=require(_0x4cc8('0x5'));var auth=require(_0x4cc8('0x6'));var interaction=require(_0x4cc8('0x7'));var config=require(_0x4cc8('0x8'));var controller=require(_0x4cc8('0x9'));router[_0x4cc8('0xa')]('/',auth[_0x4cc8('0xb')](),controller['index']);router['get'](_0x4cc8('0xc'),auth[_0x4cc8('0xb')](),controller['describe']);router[_0x4cc8('0xa')](_0x4cc8('0xd'),auth[_0x4cc8('0xb')](),controller['show']);router[_0x4cc8('0xa')](_0x4cc8('0xe'),auth[_0x4cc8('0xb')](),controller[_0x4cc8('0xf')]);router[_0x4cc8('0xa')](_0x4cc8('0x10'),auth[_0x4cc8('0xb')](),controller[_0x4cc8('0x11')]);router['get']('/:id/interactions',auth['isAuthenticated'](),controller[_0x4cc8('0x12')]);router[_0x4cc8('0xa')](_0x4cc8('0x13'),auth['isAuthenticated'](),controller[_0x4cc8('0x14')]);router[_0x4cc8('0xa')](_0x4cc8('0x15'),auth[_0x4cc8('0xb')](),controller['getMessages']);router[_0x4cc8('0xa')](_0x4cc8('0x16'),auth['isAuthenticated'](),controller[_0x4cc8('0x17')]);router[_0x4cc8('0x18')]('/',auth[_0x4cc8('0xb')](),controller[_0x4cc8('0x19')]);router[_0x4cc8('0x18')](_0x4cc8('0xe'),auth[_0x4cc8('0xb')](),controller[_0x4cc8('0x1a')]);router['post'](_0x4cc8('0x10'),auth[_0x4cc8('0xb')](),controller[_0x4cc8('0x1b')]);router['post'](_0x4cc8('0x1c'),auth[_0x4cc8('0xb')](),controller[_0x4cc8('0x1d')]);router['post']('/:id/applications',auth[_0x4cc8('0xb')](),controller[_0x4cc8('0x1e')]);router[_0x4cc8('0x18')](_0x4cc8('0x1f'),auth[_0x4cc8('0xb')](),controller['addAccountApplications']);router[_0x4cc8('0x18')](_0x4cc8('0x20'),auth[_0x4cc8('0xb')](),controller['updateAccountApplications']);router['post'](_0x4cc8('0x21'),auth[_0x4cc8('0xb')](),controller['send']);router[_0x4cc8('0x18')](_0x4cc8('0x16'),auth[_0x4cc8('0xb')](),controller[_0x4cc8('0x22')]);router[_0x4cc8('0x23')](_0x4cc8('0xd'),auth[_0x4cc8('0xb')](),controller[_0x4cc8('0x24')]);router['delete']('/:id',auth[_0x4cc8('0xb')](),controller['destroy']);router['delete']('/:id/dispositions',auth[_0x4cc8('0xb')](),controller[_0x4cc8('0x25')]);router[_0x4cc8('0x26')](_0x4cc8('0x10'),auth[_0x4cc8('0xb')](),controller[_0x4cc8('0x27')]);router['delete'](_0x4cc8('0x16'),auth[_0x4cc8('0xb')](),controller[_0x4cc8('0x28')]);module['exports']=router; \ No newline at end of file +var _0xd8bc=['post','create','/:id/dispositions','addAnswer','addInteraction','addApplications','addAccountApplications','/updateaccountapplications','updateAccountApplications','/:id/send','addAgents','put','/:id','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxAccount.controller','get','/describe','isAuthenticated','describe','show','getDispositions','/:id/canned_answers','getAnswers','/:id/interactions','getInteractions','/:id/applications','getApplications','/:id/messages','getMessages','/:id/users','getAgents'];(function(_0x14b701,_0x5b1eb8){var _0x18ab8d=function(_0xd30ac2){while(--_0xd30ac2){_0x14b701['push'](_0x14b701['shift']());}};_0x18ab8d(++_0x5b1eb8);}(_0xd8bc,0x148));var _0xcd8b=function(_0x1224bc,_0x3d13e1){_0x1224bc=_0x1224bc-0x0;var _0x4163bc=_0xd8bc[_0x1224bc];return _0x4163bc;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xcd8b('0x0'));var timeout=require(_0xcd8b('0x1'));var express=require(_0xcd8b('0x2'));var router=express[_0xcd8b('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xcd8b('0x4'));var interaction=require(_0xcd8b('0x5'));var config=require(_0xcd8b('0x6'));var controller=require(_0xcd8b('0x7'));router[_0xcd8b('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0xcd8b('0x8')](_0xcd8b('0x9'),auth[_0xcd8b('0xa')](),controller[_0xcd8b('0xb')]);router[_0xcd8b('0x8')]('/:id',auth[_0xcd8b('0xa')](),controller[_0xcd8b('0xc')]);router[_0xcd8b('0x8')]('/:id/dispositions',auth[_0xcd8b('0xa')](),controller[_0xcd8b('0xd')]);router[_0xcd8b('0x8')](_0xcd8b('0xe'),auth[_0xcd8b('0xa')](),controller[_0xcd8b('0xf')]);router['get'](_0xcd8b('0x10'),auth[_0xcd8b('0xa')](),controller[_0xcd8b('0x11')]);router['get'](_0xcd8b('0x12'),auth[_0xcd8b('0xa')](),controller[_0xcd8b('0x13')]);router[_0xcd8b('0x8')](_0xcd8b('0x14'),auth[_0xcd8b('0xa')](),controller[_0xcd8b('0x15')]);router[_0xcd8b('0x8')](_0xcd8b('0x16'),auth[_0xcd8b('0xa')](),controller[_0xcd8b('0x17')]);router[_0xcd8b('0x18')]('/',auth['isAuthenticated'](),controller[_0xcd8b('0x19')]);router[_0xcd8b('0x18')](_0xcd8b('0x1a'),auth[_0xcd8b('0xa')](),controller['addDisposition']);router['post'](_0xcd8b('0xe'),auth[_0xcd8b('0xa')](),controller[_0xcd8b('0x1b')]);router['post'](_0xcd8b('0x10'),auth[_0xcd8b('0xa')](),controller[_0xcd8b('0x1c')]);router[_0xcd8b('0x18')](_0xcd8b('0x12'),auth['isAuthenticated'](),controller[_0xcd8b('0x1d')]);router[_0xcd8b('0x18')]('/addaccountapplications',auth[_0xcd8b('0xa')](),controller[_0xcd8b('0x1e')]);router[_0xcd8b('0x18')](_0xcd8b('0x1f'),auth[_0xcd8b('0xa')](),controller[_0xcd8b('0x20')]);router[_0xcd8b('0x18')](_0xcd8b('0x21'),auth['isAuthenticated'](),controller['send']);router[_0xcd8b('0x18')](_0xcd8b('0x16'),auth[_0xcd8b('0xa')](),controller[_0xcd8b('0x22')]);router[_0xcd8b('0x23')](_0xcd8b('0x24'),auth[_0xcd8b('0xa')](),controller[_0xcd8b('0x25')]);router[_0xcd8b('0x26')](_0xcd8b('0x24'),auth[_0xcd8b('0xa')](),controller[_0xcd8b('0x27')]);router['delete']('/:id/dispositions',auth[_0xcd8b('0xa')](),controller[_0xcd8b('0x28')]);router[_0xcd8b('0x26')]('/:id/canned_answers',auth[_0xcd8b('0xa')](),controller[_0xcd8b('0x29')]);router[_0xcd8b('0x26')](_0xcd8b('0x16'),auth['isAuthenticated'](),controller[_0xcd8b('0x2a')]);module[_0xcd8b('0x2b')]=router; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.attributes.js b/server/api/faxApplication/faxApplication.attributes.js index 2ba5d5c..441915f 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 _0x5f59=['INTEGER','STRING','TEXT','*,*,*,*'];(function(_0x2f0f93,_0x41f7a4){var _0x2eae40=function(_0x17dcf9){while(--_0x17dcf9){_0x2f0f93['push'](_0x2f0f93['shift']());}};_0x2eae40(++_0x41f7a4);}(_0x5f59,0x1c0));var _0x95f5=function(_0x293bcb,_0x2b36b8){_0x293bcb=_0x293bcb-0x0;var _0x9c06ec=_0x5f59[_0x293bcb];return _0x9c06ec;};'use strict';var Sequelize=require('sequelize');module['exports']={'priority':{'type':Sequelize[_0x95f5('0x0')],'allowNull':![]},'app':{'type':Sequelize[_0x95f5('0x1')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x95f5('0x2')]()},'description':{'type':Sequelize[_0x95f5('0x1')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x95f5('0x3')}}; \ No newline at end of file +var _0xd894=['STRING','noop','TEXT','*,*,*,*','sequelize','exports','INTEGER'];(function(_0x392930,_0x307967){var _0xd87982=function(_0x104a20){while(--_0x104a20){_0x392930['push'](_0x392930['shift']());}};_0xd87982(++_0x307967);}(_0xd894,0x82));var _0x4d89=function(_0x1d7bd7,_0x7f9f1f){_0x1d7bd7=_0x1d7bd7-0x0;var _0x5e3aa1=_0xd894[_0x1d7bd7];return _0x5e3aa1;};'use strict';var Sequelize=require(_0x4d89('0x0'));module[_0x4d89('0x1')]={'priority':{'type':Sequelize[_0x4d89('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x4d89('0x3')],'allowNull':![],'defaultValue':_0x4d89('0x4')},'appdata':{'type':Sequelize[_0x4d89('0x5')]()},'description':{'type':Sequelize[_0x4d89('0x3')]},'interval':{'type':Sequelize[_0x4d89('0x3')],'defaultValue':_0x4d89('0x6')}}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.controller.js b/server/api/faxApplication/faxApplication.controller.js index a02e595..f5715b0 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 _0x63e6=['map','FaxApplication','rawAttributes','fieldName','key','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','catch','params','find','create','body','eml-format','rimraf','zip-dir','bluebird','util','sox','to-csv','ejs','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','name','send','index'];(function(_0x2223be,_0x4e4034){var _0x453496=function(_0x18f9ee){while(--_0x18f9ee){_0x2223be['push'](_0x2223be['shift']());}};_0x453496(++_0x4e4034);}(_0x63e6,0x13a));var _0x663e=function(_0x1593fa,_0x191600){_0x1593fa=_0x1593fa-0x0;var _0x169d8f=_0x63e6[_0x1593fa];return _0x169d8f;};'use strict';var emlformat=require(_0x663e('0x0'));var rimraf=require(_0x663e('0x1'));var zipdir=require(_0x663e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x663e('0x3'));var Mustache=require('mustache');var util=require(_0x663e('0x4'));var path=require('path');var sox=require(_0x663e('0x5'));var csv=require(_0x663e('0x6'));var ejs=require(_0x663e('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x663e('0x8'));var crypto=require('crypto');var jsforce=require(_0x663e('0x9'));var deskjs=require(_0x663e('0xa'));var toCsv=require(_0x663e('0x6'));var querystring=require(_0x663e('0xb'));var Papa=require('papaparse');var Redis=require(_0x663e('0xc'));var authService=require(_0x663e('0xd'));var qs=require(_0x663e('0xe'));var as=require(_0x663e('0xf'));var hardwareService=require(_0x663e('0x10'));var logger=require('../../config/logger')(_0x663e('0x11'));var utils=require('../../config/utils');var config=require(_0x663e('0x12'));var licenseUtil=require(_0x663e('0x13'));var db=require(_0x663e('0x14'))['db'];function respondWithStatusCode(_0x4c3510,_0x5eb64f){_0x5eb64f=_0x5eb64f||0xcc;return function(_0x130085){if(_0x130085){return _0x4c3510[_0x663e('0x15')](_0x5eb64f);}return _0x4c3510['status'](_0x5eb64f)[_0x663e('0x16')]();};}function respondWithResult(_0x1e8a9e,_0x355949){_0x355949=_0x355949||0xc8;return function(_0x43a0aa){if(_0x43a0aa){return _0x1e8a9e[_0x663e('0x17')](_0x355949)[_0x663e('0x18')](_0x43a0aa);}};}function respondWithFilteredResult(_0x3dffa3,_0x2fe0e2){return function(_0x1ba2c2){if(_0x1ba2c2){var _0x9f1b3=typeof _0x2fe0e2[_0x663e('0x19')]===_0x663e('0x1a')&&typeof _0x2fe0e2[_0x663e('0x1b')]===_0x663e('0x1a');var _0x18ffa0=_0x1ba2c2[_0x663e('0x1c')];var _0x48fce3=_0x9f1b3?0x0:_0x2fe0e2[_0x663e('0x19')];var _0x108571=_0x9f1b3?_0x1ba2c2['count']:_0x2fe0e2[_0x663e('0x19')]+_0x2fe0e2[_0x663e('0x1b')];var _0x58537d;if(_0x108571>=_0x18ffa0){_0x108571=_0x18ffa0;_0x58537d=0xc8;}else{_0x58537d=0xce;}_0x3dffa3[_0x663e('0x17')](_0x58537d);return _0x3dffa3[_0x663e('0x1d')](_0x663e('0x1e'),_0x48fce3+'-'+_0x108571+'/'+_0x18ffa0)[_0x663e('0x18')](_0x1ba2c2);}return null;};}function patchUpdates(_0x56244c){return function(_0x22ce8c){try{jsonpatch[_0x663e('0x1f')](_0x22ce8c,_0x56244c,!![]);}catch(_0x1e6b93){return BPromise[_0x663e('0x20')](_0x1e6b93);}return _0x22ce8c[_0x663e('0x21')]();};}function saveUpdates(_0x284014,_0x459fb9){return function(_0x2897ed){if(_0x2897ed){return _0x2897ed[_0x663e('0x22')](_0x284014)[_0x663e('0x23')](function(_0x13c824){return _0x13c824;});}return null;};}function removeEntity(_0x1fd95c,_0x57cd55){return function(_0x587640){if(_0x587640){return _0x587640[_0x663e('0x24')]()[_0x663e('0x23')](function(){_0x1fd95c['status'](0xcc)[_0x663e('0x16')]();});}};}function handleEntityNotFound(_0x155af9,_0x511bf4){return function(_0x4f16b4){if(!_0x4f16b4){_0x155af9[_0x663e('0x15')](0x194);}return _0x4f16b4;};}function handleError(_0x50c868,_0x3f63d2){_0x3f63d2=_0x3f63d2||0x1f4;return function(_0x52e385){logger[_0x663e('0x25')](_0x52e385['stack']);if(_0x52e385[_0x663e('0x26')]){delete _0x52e385[_0x663e('0x26')];}_0x50c868[_0x663e('0x17')](_0x3f63d2)[_0x663e('0x27')](_0x52e385);};}exports[_0x663e('0x28')]=function(_0x2a00a4,_0x311a1c){var _0x8b5239={},_0x5a6590={},_0x1e4b08={'count':0x0,'rows':[]};var _0x3b9df4=_[_0x663e('0x29')](db[_0x663e('0x2a')][_0x663e('0x2b')],function(_0x44f56b){return{'name':_0x44f56b[_0x663e('0x2c')],'type':_0x44f56b['type'][_0x663e('0x2d')]};});_0x5a6590['model']=_['map'](_0x3b9df4,'name');_0x5a6590[_0x663e('0x2e')]=_[_0x663e('0x2f')](_0x2a00a4['query']);_0x5a6590[_0x663e('0x30')]=_[_0x663e('0x31')](_0x5a6590[_0x663e('0x32')],_0x5a6590['query']);_0x8b5239[_0x663e('0x33')]=_[_0x663e('0x31')](_0x5a6590[_0x663e('0x32')],qs[_0x663e('0x34')](_0x2a00a4[_0x663e('0x2e')][_0x663e('0x34')]));_0x8b5239[_0x663e('0x33')]=_0x8b5239[_0x663e('0x33')]['length']?_0x8b5239['attributes']:_0x5a6590['model'];if(!_0x2a00a4['query'][_0x663e('0x35')](_0x663e('0x36'))){_0x8b5239[_0x663e('0x1b')]=qs[_0x663e('0x1b')](_0x2a00a4[_0x663e('0x2e')][_0x663e('0x1b')]);_0x8b5239[_0x663e('0x19')]=qs[_0x663e('0x19')](_0x2a00a4[_0x663e('0x2e')][_0x663e('0x19')]);}_0x8b5239[_0x663e('0x37')]=qs[_0x663e('0x38')](_0x2a00a4[_0x663e('0x2e')][_0x663e('0x38')]);_0x8b5239[_0x663e('0x39')]=qs[_0x663e('0x30')](_['pick'](_0x2a00a4[_0x663e('0x2e')],_0x5a6590[_0x663e('0x30')]),_0x3b9df4);if(_0x2a00a4[_0x663e('0x2e')][_0x663e('0x3a')]){_0x8b5239[_0x663e('0x39')]=_[_0x663e('0x3b')](_0x8b5239[_0x663e('0x39')],{'$or':_['map'](_0x3b9df4,function(_0xcfc690){if(_0xcfc690[_0x663e('0x3c')]!==_0x663e('0x3d')){var _0x20a1d2={};_0x20a1d2[_0xcfc690[_0x663e('0x26')]]={'$like':'%'+_0x2a00a4[_0x663e('0x2e')][_0x663e('0x3a')]+'%'};return _0x20a1d2;}})});}_0x8b5239=_[_0x663e('0x3b')]({},_0x8b5239,_0x2a00a4[_0x663e('0x3e')]);var _0x21e99={'where':_0x8b5239[_0x663e('0x39')]};return db[_0x663e('0x2a')]['count'](_0x21e99)[_0x663e('0x23')](function(_0x2d37ae){_0x1e4b08['count']=_0x2d37ae;if(_0x2a00a4['query'][_0x663e('0x3f')]){_0x8b5239[_0x663e('0x40')]=[{'all':!![]}];}return db['FaxApplication'][_0x663e('0x41')](_0x8b5239);})['then'](function(_0x4cb809){_0x1e4b08['rows']=_0x4cb809;return _0x1e4b08;})[_0x663e('0x23')](respondWithFilteredResult(_0x311a1c,_0x8b5239))[_0x663e('0x42')](handleError(_0x311a1c,null));};exports['show']=function(_0x1153e5,_0x1e43ca){var _0x5c74dd={'raw':!![],'where':{'id':_0x1153e5[_0x663e('0x43')]['id']}},_0x64c07b={};_0x64c07b[_0x663e('0x32')]=_[_0x663e('0x2f')](db['FaxApplication'][_0x663e('0x2b')]);_0x64c07b[_0x663e('0x2e')]=_['keys'](_0x1153e5[_0x663e('0x2e')]);_0x64c07b[_0x663e('0x30')]=_[_0x663e('0x31')](_0x64c07b['model'],_0x64c07b[_0x663e('0x2e')]);_0x5c74dd[_0x663e('0x33')]=_[_0x663e('0x31')](_0x64c07b[_0x663e('0x32')],qs['fields'](_0x1153e5['query'][_0x663e('0x34')]));_0x5c74dd[_0x663e('0x33')]=_0x5c74dd[_0x663e('0x33')]['length']?_0x5c74dd['attributes']:_0x64c07b[_0x663e('0x32')];if(_0x1153e5[_0x663e('0x2e')][_0x663e('0x3f')]){_0x5c74dd[_0x663e('0x40')]=[{'all':!![]}];}_0x5c74dd=_[_0x663e('0x3b')]({},_0x5c74dd,_0x1153e5[_0x663e('0x3e')]);return db[_0x663e('0x2a')][_0x663e('0x44')](_0x5c74dd)['then'](handleEntityNotFound(_0x1e43ca,null))[_0x663e('0x23')](respondWithResult(_0x1e43ca,null))['catch'](handleError(_0x1e43ca,null));};exports[_0x663e('0x45')]=function(_0x4e57fb,_0x3dfdf0){return db['FaxApplication'][_0x663e('0x45')](_0x4e57fb['body'],{})['then'](respondWithResult(_0x3dfdf0,0xc9))[_0x663e('0x42')](handleError(_0x3dfdf0,null));};exports[_0x663e('0x22')]=function(_0x635acb,_0x264e5c){if(_0x635acb[_0x663e('0x46')]['id']){delete _0x635acb[_0x663e('0x46')]['id'];}return db[_0x663e('0x2a')][_0x663e('0x44')]({'where':{'id':_0x635acb[_0x663e('0x43')]['id']}})[_0x663e('0x23')](handleEntityNotFound(_0x264e5c,null))[_0x663e('0x23')](saveUpdates(_0x635acb['body'],null))[_0x663e('0x23')](respondWithResult(_0x264e5c,null))[_0x663e('0x42')](handleError(_0x264e5c,null));};exports[_0x663e('0x24')]=function(_0x37050a,_0x1a8fcc){return db['FaxApplication'][_0x663e('0x44')]({'where':{'id':_0x37050a[_0x663e('0x43')]['id']}})[_0x663e('0x23')](handleEntityNotFound(_0x1a8fcc,null))['then'](removeEntity(_0x1a8fcc,null))[_0x663e('0x42')](handleError(_0x1a8fcc,null));}; \ No newline at end of file +var _0xaee6=['eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','crypto','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','sendStatus','status','end','undefined','limit','offset','set','Content-Range','json','apply','reject','save','update','destroy','then','error','stack','name','send','index','map','rawAttributes','fieldName','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','FaxApplication','count','findAll','rows','catch','show','params','keys','includeAll','include','find','create','body'];(function(_0x1589dd,_0x2b9d22){var _0x1bddd1=function(_0x3687f8){while(--_0x3687f8){_0x1589dd['push'](_0x1589dd['shift']());}};_0x1bddd1(++_0x2b9d22);}(_0xaee6,0x9a));var _0x6aee=function(_0x3b91de,_0x536448){_0x3b91de=_0x3b91de-0x0;var _0x572358=_0xaee6[_0x3b91de];return _0x572358;};'use strict';var emlformat=require(_0x6aee('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x6aee('0x1'));var rp=require(_0x6aee('0x2'));var moment=require(_0x6aee('0x3'));var BPromise=require(_0x6aee('0x4'));var Mustache=require(_0x6aee('0x5'));var util=require(_0x6aee('0x6'));var path=require(_0x6aee('0x7'));var sox=require(_0x6aee('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6aee('0x9'));var _=require(_0x6aee('0xa'));var squel=require('squel');var crypto=require(_0x6aee('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x6aee('0xc'));var toCsv=require(_0x6aee('0xd'));var querystring=require(_0x6aee('0xe'));var Papa=require('papaparse');var Redis=require(_0x6aee('0xf'));var authService=require(_0x6aee('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x6aee('0x11'));var hardwareService=require(_0x6aee('0x12'));var logger=require(_0x6aee('0x13'))(_0x6aee('0x14'));var utils=require('../../config/utils');var config=require(_0x6aee('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4da249,_0x1e61df){_0x1e61df=_0x1e61df||0xcc;return function(_0x5af244){if(_0x5af244){return _0x4da249[_0x6aee('0x16')](_0x1e61df);}return _0x4da249[_0x6aee('0x17')](_0x1e61df)[_0x6aee('0x18')]();};}function respondWithResult(_0x45a6ba,_0x5805c5){_0x5805c5=_0x5805c5||0xc8;return function(_0x3a6646){if(_0x3a6646){return _0x45a6ba[_0x6aee('0x17')](_0x5805c5)['json'](_0x3a6646);}};}function respondWithFilteredResult(_0x350b4b,_0x494fdf){return function(_0x4923bf){if(_0x4923bf){var _0x8355ac=typeof _0x494fdf['offset']===_0x6aee('0x19')&&typeof _0x494fdf[_0x6aee('0x1a')]===_0x6aee('0x19');var _0x3cd1c8=_0x4923bf['count'];var _0x3adb7c=_0x8355ac?0x0:_0x494fdf[_0x6aee('0x1b')];var _0x1cdfb3=_0x8355ac?_0x4923bf['count']:_0x494fdf[_0x6aee('0x1b')]+_0x494fdf['limit'];var _0x4cf6c1;if(_0x1cdfb3>=_0x3cd1c8){_0x1cdfb3=_0x3cd1c8;_0x4cf6c1=0xc8;}else{_0x4cf6c1=0xce;}_0x350b4b[_0x6aee('0x17')](_0x4cf6c1);return _0x350b4b[_0x6aee('0x1c')](_0x6aee('0x1d'),_0x3adb7c+'-'+_0x1cdfb3+'/'+_0x3cd1c8)[_0x6aee('0x1e')](_0x4923bf);}return null;};}function patchUpdates(_0x37385f){return function(_0x70394a){try{jsonpatch[_0x6aee('0x1f')](_0x70394a,_0x37385f,!![]);}catch(_0x13c5f8){return BPromise[_0x6aee('0x20')](_0x13c5f8);}return _0x70394a[_0x6aee('0x21')]();};}function saveUpdates(_0x421c60,_0x3c167e){return function(_0x51d628){if(_0x51d628){return _0x51d628[_0x6aee('0x22')](_0x421c60)['then'](function(_0x242886){return _0x242886;});}return null;};}function removeEntity(_0x471b7d,_0x1155c8){return function(_0x2a6615){if(_0x2a6615){return _0x2a6615[_0x6aee('0x23')]()[_0x6aee('0x24')](function(){_0x471b7d[_0x6aee('0x17')](0xcc)[_0x6aee('0x18')]();});}};}function handleEntityNotFound(_0x102c39,_0x3cf8d1){return function(_0x1343f6){if(!_0x1343f6){_0x102c39[_0x6aee('0x16')](0x194);}return _0x1343f6;};}function handleError(_0x12406,_0x4806c1){_0x4806c1=_0x4806c1||0x1f4;return function(_0x562e76){logger[_0x6aee('0x25')](_0x562e76[_0x6aee('0x26')]);if(_0x562e76[_0x6aee('0x27')]){delete _0x562e76[_0x6aee('0x27')];}_0x12406[_0x6aee('0x17')](_0x4806c1)[_0x6aee('0x28')](_0x562e76);};}exports[_0x6aee('0x29')]=function(_0x2b8ba0,_0x56900e){var _0x3abcb1={},_0x4547af={},_0x36cb2b={'count':0x0,'rows':[]};var _0x2ea601=_[_0x6aee('0x2a')](db['FaxApplication'][_0x6aee('0x2b')],function(_0x240932){return{'name':_0x240932[_0x6aee('0x2c')],'type':_0x240932['type'][_0x6aee('0x2d')]};});_0x4547af[_0x6aee('0x2e')]=_[_0x6aee('0x2a')](_0x2ea601,'name');_0x4547af[_0x6aee('0x2f')]=_['keys'](_0x2b8ba0[_0x6aee('0x2f')]);_0x4547af[_0x6aee('0x30')]=_['intersection'](_0x4547af[_0x6aee('0x2e')],_0x4547af['query']);_0x3abcb1['attributes']=_[_0x6aee('0x31')](_0x4547af[_0x6aee('0x2e')],qs['fields'](_0x2b8ba0[_0x6aee('0x2f')][_0x6aee('0x32')]));_0x3abcb1[_0x6aee('0x33')]=_0x3abcb1[_0x6aee('0x33')][_0x6aee('0x34')]?_0x3abcb1['attributes']:_0x4547af[_0x6aee('0x2e')];if(!_0x2b8ba0['query'][_0x6aee('0x35')](_0x6aee('0x36'))){_0x3abcb1['limit']=qs['limit'](_0x2b8ba0['query']['limit']);_0x3abcb1[_0x6aee('0x1b')]=qs['offset'](_0x2b8ba0['query']['offset']);}_0x3abcb1[_0x6aee('0x37')]=qs[_0x6aee('0x38')](_0x2b8ba0[_0x6aee('0x2f')][_0x6aee('0x38')]);_0x3abcb1[_0x6aee('0x39')]=qs['filters'](_[_0x6aee('0x3a')](_0x2b8ba0[_0x6aee('0x2f')],_0x4547af[_0x6aee('0x30')]),_0x2ea601);if(_0x2b8ba0['query'][_0x6aee('0x3b')]){_0x3abcb1[_0x6aee('0x39')]=_[_0x6aee('0x3c')](_0x3abcb1[_0x6aee('0x39')],{'$or':_[_0x6aee('0x2a')](_0x2ea601,function(_0x203047){if(_0x203047[_0x6aee('0x3d')]!==_0x6aee('0x3e')){var _0x542427={};_0x542427[_0x203047[_0x6aee('0x27')]]={'$like':'%'+_0x2b8ba0[_0x6aee('0x2f')][_0x6aee('0x3b')]+'%'};return _0x542427;}})});}_0x3abcb1=_[_0x6aee('0x3c')]({},_0x3abcb1,_0x2b8ba0[_0x6aee('0x3f')]);var _0xf073f2={'where':_0x3abcb1[_0x6aee('0x39')]};return db[_0x6aee('0x40')][_0x6aee('0x41')](_0xf073f2)[_0x6aee('0x24')](function(_0xf97383){_0x36cb2b[_0x6aee('0x41')]=_0xf97383;if(_0x2b8ba0['query']['includeAll']){_0x3abcb1['include']=[{'all':!![]}];}return db[_0x6aee('0x40')][_0x6aee('0x42')](_0x3abcb1);})['then'](function(_0x1e13d9){_0x36cb2b[_0x6aee('0x43')]=_0x1e13d9;return _0x36cb2b;})[_0x6aee('0x24')](respondWithFilteredResult(_0x56900e,_0x3abcb1))[_0x6aee('0x44')](handleError(_0x56900e,null));};exports[_0x6aee('0x45')]=function(_0x4569f6,_0x1b1ae3){var _0x34c9b8={'raw':!![],'where':{'id':_0x4569f6[_0x6aee('0x46')]['id']}},_0x5a5ec3={};_0x5a5ec3[_0x6aee('0x2e')]=_[_0x6aee('0x47')](db['FaxApplication'][_0x6aee('0x2b')]);_0x5a5ec3['query']=_[_0x6aee('0x47')](_0x4569f6[_0x6aee('0x2f')]);_0x5a5ec3['filters']=_[_0x6aee('0x31')](_0x5a5ec3['model'],_0x5a5ec3[_0x6aee('0x2f')]);_0x34c9b8[_0x6aee('0x33')]=_[_0x6aee('0x31')](_0x5a5ec3[_0x6aee('0x2e')],qs[_0x6aee('0x32')](_0x4569f6[_0x6aee('0x2f')]['fields']));_0x34c9b8['attributes']=_0x34c9b8[_0x6aee('0x33')][_0x6aee('0x34')]?_0x34c9b8[_0x6aee('0x33')]:_0x5a5ec3[_0x6aee('0x2e')];if(_0x4569f6['query'][_0x6aee('0x48')]){_0x34c9b8[_0x6aee('0x49')]=[{'all':!![]}];}_0x34c9b8=_[_0x6aee('0x3c')]({},_0x34c9b8,_0x4569f6[_0x6aee('0x3f')]);return db[_0x6aee('0x40')][_0x6aee('0x4a')](_0x34c9b8)['then'](handleEntityNotFound(_0x1b1ae3,null))['then'](respondWithResult(_0x1b1ae3,null))['catch'](handleError(_0x1b1ae3,null));};exports['create']=function(_0x5398cf,_0x2cdb14){return db['FaxApplication'][_0x6aee('0x4b')](_0x5398cf[_0x6aee('0x4c')],{})['then'](respondWithResult(_0x2cdb14,0xc9))['catch'](handleError(_0x2cdb14,null));};exports[_0x6aee('0x22')]=function(_0x481676,_0x220dce){if(_0x481676['body']['id']){delete _0x481676[_0x6aee('0x4c')]['id'];}return db['FaxApplication'][_0x6aee('0x4a')]({'where':{'id':_0x481676[_0x6aee('0x46')]['id']}})['then'](handleEntityNotFound(_0x220dce,null))[_0x6aee('0x24')](saveUpdates(_0x481676['body'],null))[_0x6aee('0x24')](respondWithResult(_0x220dce,null))['catch'](handleError(_0x220dce,null));};exports['destroy']=function(_0x3935cd,_0x4ea215){return db['FaxApplication'][_0x6aee('0x4a')]({'where':{'id':_0x3935cd[_0x6aee('0x46')]['id']}})['then'](handleEntityNotFound(_0x4ea215,null))[_0x6aee('0x24')](removeEntity(_0x4ea215,null))[_0x6aee('0x44')](handleError(_0x4ea215,null));}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.model.js b/server/api/faxApplication/faxApplication.model.js index 6a0b70d..974b874 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 _0x01d1=['utf8mb4','utf8mb4_unicode_ci','util','api','bluebird','request-promise','../../config/environment','./faxApplication.attributes','exports','FaxApplication','fax_applications'];(function(_0xd4eb5d,_0x182fdb){var _0x1fa19e=function(_0x15b290){while(--_0x15b290){_0xd4eb5d['push'](_0xd4eb5d['shift']());}};_0x1fa19e(++_0x182fdb);}(_0x01d1,0xb2));var _0x101d=function(_0x11ace7,_0x1d7d75){_0x11ace7=_0x11ace7-0x0;var _0xee8a2c=_0x01d1[_0x11ace7];return _0xee8a2c;};'use strict';var _=require('lodash');var util=require(_0x101d('0x0'));var logger=require('../../config/logger')(_0x101d('0x1'));var moment=require('moment');var BPromise=require(_0x101d('0x2'));var rp=require(_0x101d('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x101d('0x4'));var attributes=require(_0x101d('0x5'));module[_0x101d('0x6')]=function(_0x5d1dfe,_0x541bda){return _0x5d1dfe['define'](_0x101d('0x7'),attributes,{'tableName':_0x101d('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x101d('0x9'),'collate':_0x101d('0xa')});}; \ No newline at end of file +var _0x9cd4=['utf8mb4_unicode_ci','lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxApplication.attributes','exports','FaxApplication','utf8mb4'];(function(_0x135a75,_0x12d5cc){var _0xb83b84=function(_0x3a800e){while(--_0x3a800e){_0x135a75['push'](_0x135a75['shift']());}};_0xb83b84(++_0x12d5cc);}(_0x9cd4,0x69));var _0x49cd=function(_0xf91841,_0x182ae3){_0xf91841=_0xf91841-0x0;var _0x4b9c44=_0x9cd4[_0xf91841];return _0x4b9c44;};'use strict';var _=require(_0x49cd('0x0'));var util=require('util');var logger=require(_0x49cd('0x1'))('api');var moment=require(_0x49cd('0x2'));var BPromise=require(_0x49cd('0x3'));var rp=require(_0x49cd('0x4'));var fs=require('fs');var path=require(_0x49cd('0x5'));var rimraf=require(_0x49cd('0x6'));var config=require(_0x49cd('0x7'));var attributes=require(_0x49cd('0x8'));module[_0x49cd('0x9')]=function(_0x2d8cea,_0x3635f4){return _0x2d8cea['define'](_0x49cd('0xa'),attributes,{'tableName':'fax_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x49cd('0xb'),'collate':_0x49cd('0xc')});}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.rpc.js b/server/api/faxApplication/faxApplication.rpc.js index 50df0c5..5e49a37 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 _0xb18e=['request','then','info','FaxApplication,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','FaxApplication','update','options','where','attributes','limit','UpdateFaxApplication','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http'];(function(_0x329759,_0x30ff44){var _0x3194c2=function(_0x3ac1b4){while(--_0x3ac1b4){_0x329759['push'](_0x329759['shift']());}};_0x3194c2(++_0x30ff44);}(_0xb18e,0x199));var _0xeb18=function(_0x285824,_0x3da647){_0x285824=_0x285824-0x0;var _0x311d7e=_0xb18e[_0x285824];return _0x311d7e;};'use strict';var _=require(_0xeb18('0x0'));var util=require(_0xeb18('0x1'));var moment=require('moment');var BPromise=require(_0xeb18('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xeb18('0x3'));var db=require(_0xeb18('0x4'))['db'];var utils=require(_0xeb18('0x5'));var logger=require(_0xeb18('0x6'))('rpc');var config=require(_0xeb18('0x7'));var jayson=require(_0xeb18('0x8'));var client=jayson[_0xeb18('0x9')][_0xeb18('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1fe904,_0x1dcb5f,_0x2524f9){return new BPromise(function(_0x4ff180,_0x696331){return client[_0xeb18('0xb')](_0x1fe904,_0x2524f9)[_0xeb18('0xc')](function(_0x618635){logger[_0xeb18('0xd')](_0xeb18('0xe'),_0x1dcb5f,_0xeb18('0xf'));logger[_0xeb18('0x10')]('FaxApplication,\x20%s,\x20%s,\x20%s',_0x1dcb5f,_0xeb18('0xf'),JSON[_0xeb18('0x11')](_0x618635));if(_0x618635[_0xeb18('0x12')]){if(_0x618635[_0xeb18('0x12')][_0xeb18('0x13')]===0x1f4){logger[_0xeb18('0x12')](_0xeb18('0xe'),_0x1dcb5f,_0x618635[_0xeb18('0x12')][_0xeb18('0x14')]);return _0x696331(_0x618635[_0xeb18('0x12')][_0xeb18('0x14')]);}logger[_0xeb18('0x12')](_0xeb18('0xe'),_0x1dcb5f,_0x618635[_0xeb18('0x12')][_0xeb18('0x14')]);return _0x4ff180(_0x618635[_0xeb18('0x12')][_0xeb18('0x14')]);}else{logger[_0xeb18('0xd')]('FaxApplication,\x20%s,\x20%s',_0x1dcb5f,_0xeb18('0xf'));_0x4ff180(_0x618635['result'][_0xeb18('0x14')]);}})['catch'](function(_0x44ef40){logger[_0xeb18('0x12')](_0xeb18('0xe'),_0x1dcb5f,_0x44ef40);_0x696331(_0x44ef40);});});}exports['UpdateFaxApplication']=function(_0x1e1962){var _0x55fc68=this;return new Promise(function(_0xe3bc44,_0x2c61ff){return db[_0xeb18('0x15')][_0xeb18('0x16')](_0x1e1962['body'],{'raw':_0x1e1962['options']?_0x1e1962[_0xeb18('0x17')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1e1962[_0xeb18('0x17')]?_0x1e1962[_0xeb18('0x17')][_0xeb18('0x18')]||null:null,'attributes':_0x1e1962[_0xeb18('0x17')]?_0x1e1962[_0xeb18('0x17')][_0xeb18('0x19')]||null:null,'limit':_0x1e1962[_0xeb18('0x17')]?_0x1e1962[_0xeb18('0x17')][_0xeb18('0x1a')]||null:null})[_0xeb18('0xc')](function(_0x3b86db){logger[_0xeb18('0xd')]('UpdateFaxApplication',_0x1e1962);logger['debug'](_0xeb18('0x1b'),_0x1e1962,JSON[_0xeb18('0x11')](_0x3b86db));_0xe3bc44(_0x3b86db);})['catch'](function(_0x4f0547){logger['error']('UpdateFaxApplication',_0x4f0547[_0xeb18('0x14')],_0x1e1962);_0x2c61ff(_0x55fc68['error'](0x1f4,_0x4f0547[_0xeb18('0x14')]));});});}; \ No newline at end of file +var _0x00dd=['stringify','error','message','result','UpdateFaxApplication','update','body','options','attributes','limit','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','http','request','then','info','FaxApplication,\x20%s,\x20%s','debug','FaxApplication,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0xb0de07,_0x3ca2a0){var _0x4633d8=function(_0x2368e0){while(--_0x2368e0){_0xb0de07['push'](_0xb0de07['shift']());}};_0x4633d8(++_0x3ca2a0);}(_0x00dd,0xb9));var _0xd00d=function(_0x53e0f0,_0x4bd57b){_0x53e0f0=_0x53e0f0-0x0;var _0x51970a=_0x00dd[_0x53e0f0];return _0x51970a;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xd00d('0x0'));var BPromise=require(_0xd00d('0x1'));var rs=require(_0xd00d('0x2'));var fs=require('fs');var Redis=require(_0xd00d('0x3'));var db=require(_0xd00d('0x4'))['db'];var utils=require(_0xd00d('0x5'));var logger=require(_0xd00d('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xd00d('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x51f408,_0x1615a8,_0x1cd9c9){return new BPromise(function(_0x2f65dc,_0x334542){return client[_0xd00d('0x8')](_0x51f408,_0x1cd9c9)[_0xd00d('0x9')](function(_0x291345){logger[_0xd00d('0xa')](_0xd00d('0xb'),_0x1615a8,'request\x20sent');logger[_0xd00d('0xc')](_0xd00d('0xd'),_0x1615a8,_0xd00d('0xe'),JSON[_0xd00d('0xf')](_0x291345));if(_0x291345[_0xd00d('0x10')]){if(_0x291345[_0xd00d('0x10')]['code']===0x1f4){logger[_0xd00d('0x10')](_0xd00d('0xb'),_0x1615a8,_0x291345[_0xd00d('0x10')][_0xd00d('0x11')]);return _0x334542(_0x291345[_0xd00d('0x10')]['message']);}logger['error']('FaxApplication,\x20%s,\x20%s',_0x1615a8,_0x291345['error']['message']);return _0x2f65dc(_0x291345[_0xd00d('0x10')][_0xd00d('0x11')]);}else{logger[_0xd00d('0xa')]('FaxApplication,\x20%s,\x20%s',_0x1615a8,_0xd00d('0xe'));_0x2f65dc(_0x291345[_0xd00d('0x12')][_0xd00d('0x11')]);}})['catch'](function(_0x124a6d){logger[_0xd00d('0x10')]('FaxApplication,\x20%s,\x20%s',_0x1615a8,_0x124a6d);_0x334542(_0x124a6d);});});}exports[_0xd00d('0x13')]=function(_0x216bcb){var _0x595ce4=this;return new Promise(function(_0x3d9161,_0x4c526e){return db['FaxApplication'][_0xd00d('0x14')](_0x216bcb[_0xd00d('0x15')],{'raw':_0x216bcb[_0xd00d('0x16')]?_0x216bcb['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x216bcb['options']?_0x216bcb[_0xd00d('0x16')]['where']||null:null,'attributes':_0x216bcb[_0xd00d('0x16')]?_0x216bcb[_0xd00d('0x16')][_0xd00d('0x17')]||null:null,'limit':_0x216bcb[_0xd00d('0x16')]?_0x216bcb[_0xd00d('0x16')][_0xd00d('0x18')]||null:null})[_0xd00d('0x9')](function(_0x410711){logger['info'](_0xd00d('0x13'),_0x216bcb);logger[_0xd00d('0xc')](_0xd00d('0x13'),_0x216bcb,JSON['stringify'](_0x410711));_0x3d9161(_0x410711);})['catch'](function(_0x1b2811){logger[_0xd00d('0x10')]('UpdateFaxApplication',_0x1b2811[_0xd00d('0x11')],_0x216bcb);_0x4c526e(_0x595ce4[_0xd00d('0x10')](0x1f4,_0x1b2811['message']));});});}; \ No newline at end of file diff --git a/server/api/faxApplication/index.js b/server/api/faxApplication/index.js index dea686b..e169d11 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 _0x0b0e=['./faxApplication.controller','get','isAuthenticated','index','show','post','create','/:id','delete','destroy','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x38954c,_0x357891){var _0x19fd62=function(_0x5a390d){while(--_0x5a390d){_0x38954c['push'](_0x38954c['shift']());}};_0x19fd62(++_0x357891);}(_0x0b0e,0x187));var _0xe0b0=function(_0x4792c8,_0x5158a1){_0x4792c8=_0x4792c8-0x0;var _0x35edb1=_0x0b0e[_0x4792c8];return _0x35edb1;};'use strict';var multer=require(_0xe0b0('0x0'));var util=require('util');var path=require(_0xe0b0('0x1'));var timeout=require('connect-timeout');var express=require(_0xe0b0('0x2'));var router=express[_0xe0b0('0x3')]();var fs_extra=require(_0xe0b0('0x4'));var auth=require(_0xe0b0('0x5'));var interaction=require(_0xe0b0('0x6'));var config=require(_0xe0b0('0x7'));var controller=require(_0xe0b0('0x8'));router[_0xe0b0('0x9')]('/',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0xb')]);router[_0xe0b0('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xe0b0('0xc')]);router[_0xe0b0('0xd')]('/',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0xe')]);router['put'](_0xe0b0('0xf'),auth[_0xe0b0('0xa')](),controller['update']);router[_0xe0b0('0x10')](_0xe0b0('0xf'),auth['isAuthenticated'](),controller[_0xe0b0('0x11')]);module[_0xe0b0('0x12')]=router; \ No newline at end of file +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(_0x20c3a6,_0x40061f){var _0x3fa2db=function(_0x24d0d9){while(--_0x24d0d9){_0x20c3a6['push'](_0x20c3a6['shift']());}};_0x3fa2db(++_0x40061f);}(_0xbaf0,0x12a));var _0x0baf=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xbaf0[_0x501510];return _0x1e6ee5;};'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 diff --git a/server/api/faxInteraction/faxInteraction.attributes.js b/server/api/faxInteraction/faxInteraction.attributes.js index dfaafd2..ba05cf3 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 _0xe5af=['exports','BOOLEAN','STRING','DATE','out','INTEGER'];(function(_0x5a06f0,_0x13bb58){var _0x1c4e6d=function(_0x1e90a8){while(--_0x1e90a8){_0x5a06f0['push'](_0x5a06f0['shift']());}};_0x1c4e6d(++_0x13bb58);}(_0xe5af,0x9c));var _0xfe5a=function(_0x2bfff2,_0x26496c){_0x2bfff2=_0x2bfff2-0x0;var _0x4a21d9=_0xe5af[_0x2bfff2];return _0x4a21d9;};'use strict';var Sequelize=require('sequelize');module[_0xfe5a('0x0')]={'closed':{'type':Sequelize[_0xfe5a('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0xfe5a('0x2')]},'secondDisposition':{'type':Sequelize[_0xfe5a('0x2')]},'thirdDisposition':{'type':Sequelize[_0xfe5a('0x2')]},'note':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0xfe5a('0x3')]},'fax':{'type':Sequelize['STRING']},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0xfe5a('0x4')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xfe5a('0x3')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]},'queueId':{'type':Sequelize[_0xfe5a('0x5')]}}; \ No newline at end of file +var _0xdb28=['STRING','out','INTEGER','sequelize','exports','BOOLEAN','DATE'];(function(_0x1ca605,_0x379da4){var _0x44748d=function(_0x2c8438){while(--_0x2c8438){_0x1ca605['push'](_0x1ca605['shift']());}};_0x44748d(++_0x379da4);}(_0xdb28,0x106));var _0x8db2=function(_0x27bdf1,_0x470065){_0x27bdf1=_0x27bdf1-0x0;var _0x23231d=_0xdb28[_0x27bdf1];return _0x23231d;};'use strict';var Sequelize=require(_0x8db2('0x0'));module[_0x8db2('0x1')]={'closed':{'type':Sequelize[_0x8db2('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x8db2('0x3')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x8db2('0x4')]},'thirdDisposition':{'type':Sequelize[_0x8db2('0x4')]},'note':{'type':Sequelize[_0x8db2('0x4')]},'read1stAt':{'type':Sequelize[_0x8db2('0x3')]},'fax':{'type':Sequelize[_0x8db2('0x4')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0x8db2('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x8db2('0x3')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]},'queueId':{'type':Sequelize[_0x8db2('0x6')]}}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.controller.js b/server/api/faxInteraction/faxInteraction.controller.js index 2ec052b..cd5438f 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 _0xdc2d=['transcript-%d-%s.zip','push','Attachment','Messages','createdAt','mkdirSync','length','existsSync','createReadStream','pipe','createWriteStream','basename','resolve','log','unlinkSync','zip-dir','bluebird','util','path','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../config/environment','../../mysqldb','localhost','socket.io-emitter','redis','./faxInteraction.socket','sendStatus','status','end','json','undefined','count','Content-Range','update','then','destroy','stack','name','send','map','FaxInteraction','rawAttributes','fieldName','type','getOptions','findAll','fax','user','catch','show','params','model','keys','query','filters','intersection','attributes','fields','merge','options','find','create','body','describe','addMessage','ids','getMessages','findOne','FaxMessage','hasOwnProperty','limit','offset','order','sort','pick','where','FaxInteractionId','filter','$gte','split','format','includeAll','include','rows','setTags','omit','spread','Tag','emit','faxInteractionTags:save','removeTags','download','unix','toString','join','root','server','attachments'];(function(_0x31167c,_0x375d62){var _0x35d8cd=function(_0x40d3b3){while(--_0x40d3b3){_0x31167c['push'](_0x31167c['shift']());}};_0x35d8cd(++_0x375d62);}(_0xdc2d,0x74));var _0xddc2=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0xdc2d[_0x3e5086];return _0xfeb102;};'use strict';var rimraf=require('rimraf');var zipdir=require(_0xddc2('0x0'));var moment=require('moment');var BPromise=require(_0xddc2('0x1'));var util=require(_0xddc2('0x2'));var path=require(_0xddc2('0x3'));var fs=require('fs');var _=require(_0xddc2('0x4'));var Redis=require(_0xddc2('0x5'));var interaction=require(_0xddc2('0x6'));var qs=require(_0xddc2('0x7'));var logger=require('../../config/logger')('api');var config=require(_0xddc2('0x8'));var db=require(_0xddc2('0x9'))['db'];config['redis']=_['defaults'](config['redis'],{'host':_0xddc2('0xa'),'port':0x18eb});var socket=require(_0xddc2('0xb'))(new Redis(config[_0xddc2('0xc')]));require(_0xddc2('0xd'))['register'](socket);function respondWithStatusCode(_0x3a9e4e,_0x53c9ff){_0x53c9ff=_0x53c9ff||0xcc;return function(_0x35391d){if(_0x35391d){return _0x3a9e4e[_0xddc2('0xe')](_0x53c9ff);}return _0x3a9e4e[_0xddc2('0xf')](_0x53c9ff)[_0xddc2('0x10')]();};}function respondWithResult(_0x5bbf7c,_0x342fb2){_0x342fb2=_0x342fb2||0xc8;return function(_0x4d815a){if(_0x4d815a){return _0x5bbf7c[_0xddc2('0xf')](_0x342fb2)[_0xddc2('0x11')](_0x4d815a);}};}function respondWithFilteredResult(_0x254691,_0xf190dd){return function(_0x13f647){if(_0x13f647){var _0x1a578d=typeof _0xf190dd['offset']===_0xddc2('0x12')&&typeof _0xf190dd['limit']===_0xddc2('0x12');var _0x51b820=_0x13f647[_0xddc2('0x13')];var _0x3c4291=_0x1a578d?0x0:_0xf190dd['offset'];var _0x4f5592=_0x1a578d?_0x13f647['count']:_0xf190dd['offset']+_0xf190dd['limit'];var _0x19a08e;if(_0x4f5592>=_0x51b820){_0x4f5592=_0x51b820;_0x19a08e=0xc8;}else{_0x19a08e=0xce;}_0x254691['status'](_0x19a08e);return _0x254691['set'](_0xddc2('0x14'),_0x3c4291+'-'+_0x4f5592+'/'+_0x51b820)['json'](_0x13f647);}return null;};}function saveUpdates(_0x1b0cd8){return function(_0x1f00b7){if(_0x1f00b7){return _0x1f00b7[_0xddc2('0x15')](_0x1b0cd8)[_0xddc2('0x16')](function(_0x32a638){return _0x32a638;});}return null;};}function removeEntity(_0x3b50c2){return function(_0x2228a7){if(_0x2228a7){return _0x2228a7[_0xddc2('0x17')]()['then'](function(){_0x3b50c2[_0xddc2('0xf')](0xcc)[_0xddc2('0x10')]();});}};}function handleEntityNotFound(_0x1c97e8){return function(_0x3e5167){if(!_0x3e5167){_0x1c97e8[_0xddc2('0xe')](0x194);}return _0x3e5167;};}function handleError(_0x3edd72,_0x2ae812){_0x2ae812=_0x2ae812||0x1f4;return function(_0x596c21){logger['error'](_0x596c21[_0xddc2('0x18')]);if(_0x596c21[_0xddc2('0x19')]){delete _0x596c21['name'];}_0x3edd72[_0xddc2('0xf')](_0x2ae812)[_0xddc2('0x1a')](_0x596c21);};}exports['index']=function(_0x578550,_0x22da9b){var _0x5ace43={};var _0x2a4203=_[_0xddc2('0x1b')](db[_0xddc2('0x1c')][_0xddc2('0x1d')],function(_0x28e777){return{'name':_0x28e777[_0xddc2('0x1e')],'type':_0x28e777[_0xddc2('0x1f')]['key']};});_0x5ace43=qs[_0xddc2('0x20')](_0x2a4203,_0x578550);return interaction[_0xddc2('0x21')](_0xddc2('0x22'),_0x578550['query'],_0x578550[_0xddc2('0x23')],_0x5ace43,_0x2a4203)[_0xddc2('0x16')](respondWithFilteredResult(_0x22da9b,_0x5ace43))[_0xddc2('0x24')](handleError(_0x22da9b,null));};exports[_0xddc2('0x25')]=function(_0xdc2b5d,_0x36fd3c){var _0x4405af={'raw':![],'where':{'id':_0xdc2b5d[_0xddc2('0x26')]['id']}},_0x36a4ed={};_0x36a4ed[_0xddc2('0x27')]=_[_0xddc2('0x28')](db['FaxInteraction'][_0xddc2('0x1d')]);_0x36a4ed[_0xddc2('0x29')]=_[_0xddc2('0x28')](_0xdc2b5d[_0xddc2('0x29')]);_0x36a4ed[_0xddc2('0x2a')]=_[_0xddc2('0x2b')](_0x36a4ed[_0xddc2('0x27')],_0x36a4ed[_0xddc2('0x29')]);_0x4405af[_0xddc2('0x2c')]=_[_0xddc2('0x2b')](_0x36a4ed[_0xddc2('0x27')],qs[_0xddc2('0x2d')](_0xdc2b5d[_0xddc2('0x29')][_0xddc2('0x2d')]));_0x4405af[_0xddc2('0x2c')]=_0x4405af['attributes']['length']?_0x4405af[_0xddc2('0x2c')]:_0x36a4ed[_0xddc2('0x27')];if(_0xdc2b5d[_0xddc2('0x29')]['includeAll']){_0x4405af['include']=[{'all':!![]}];}_0x4405af=_[_0xddc2('0x2e')]({},_0x4405af,_0xdc2b5d[_0xddc2('0x2f')]);return db[_0xddc2('0x1c')][_0xddc2('0x30')](_0x4405af)['then'](handleEntityNotFound(_0x36fd3c,null))['then'](respondWithResult(_0x36fd3c,null))['catch'](handleError(_0x36fd3c,null));};exports[_0xddc2('0x31')]=function(_0x387c96,_0x282c44){return db['FaxInteraction'][_0xddc2('0x31')](_0x387c96['body'],{})[_0xddc2('0x16')](respondWithResult(_0x282c44,0xc9))[_0xddc2('0x24')](handleError(_0x282c44,null));};exports[_0xddc2('0x15')]=function(_0x1bbd26,_0x528f72){if(_0x1bbd26['body']['id']){delete _0x1bbd26[_0xddc2('0x32')]['id'];}return db[_0xddc2('0x1c')][_0xddc2('0x30')]({'where':{'id':_0x1bbd26['params']['id']}})[_0xddc2('0x16')](handleEntityNotFound(_0x528f72,null))['then'](saveUpdates(_0x1bbd26[_0xddc2('0x32')],null))['then'](respondWithResult(_0x528f72,null))[_0xddc2('0x24')](handleError(_0x528f72,null));};exports[_0xddc2('0x17')]=function(_0x373c26,_0x381d96){return db[_0xddc2('0x1c')]['find']({'where':{'id':_0x373c26[_0xddc2('0x26')]['id']}})[_0xddc2('0x16')](handleEntityNotFound(_0x381d96,null))[_0xddc2('0x16')](removeEntity(_0x381d96,null))[_0xddc2('0x24')](handleError(_0x381d96,null));};exports[_0xddc2('0x33')]=function(_0x5dd03e,_0x282f40){return db[_0xddc2('0x1c')][_0xddc2('0x33')]()[_0xddc2('0x16')](respondWithResult(_0x282f40,null))['catch'](handleError(_0x282f40,null));};exports['addMessage']=function(_0x58a426,_0x231636){return db['FaxMessage']['find']({'where':{'id':_0x58a426[_0xddc2('0x26')]['id']}})[_0xddc2('0x16')](handleEntityNotFound(_0x231636,null))[_0xddc2('0x16')](function(_0x5e0b10){if(_0x5e0b10){return _0x5e0b10[_0xddc2('0x34')](_0x58a426['body'][_0xddc2('0x35')],_['omit'](_0x58a426[_0xddc2('0x32')],[_0xddc2('0x35'),'id'])||{});}})[_0xddc2('0x16')](respondWithResult(_0x231636,null))[_0xddc2('0x24')](handleError(_0x231636,null));};exports[_0xddc2('0x36')]=function(_0xf01ed5,_0x2b6209){var _0x2f2182={'raw':![],'where':{}};var _0x39c33b={};var _0x5c8476={'count':0x0,'rows':[]};return db[_0xddc2('0x1c')][_0xddc2('0x37')]({'where':{'id':_0xf01ed5[_0xddc2('0x26')]['id']}})['then'](handleEntityNotFound(_0x2b6209,null))[_0xddc2('0x16')](function(_0x4722d4){if(_0x4722d4){_0x39c33b[_0xddc2('0x27')]=_[_0xddc2('0x28')](db[_0xddc2('0x38')][_0xddc2('0x1d')]);_0x39c33b['query']=_[_0xddc2('0x28')](_0xf01ed5[_0xddc2('0x29')]);_0x39c33b[_0xddc2('0x2a')]=_['intersection'](_0x39c33b[_0xddc2('0x27')],_0x39c33b['query']);_0x2f2182[_0xddc2('0x2c')]=_[_0xddc2('0x2b')](_0x39c33b[_0xddc2('0x27')],qs[_0xddc2('0x2d')](_0xf01ed5['query'][_0xddc2('0x2d')]));_0x2f2182[_0xddc2('0x2c')]=_0x2f2182[_0xddc2('0x2c')]['length']?_0x2f2182[_0xddc2('0x2c')]:_0x39c33b[_0xddc2('0x27')];if(!_0xf01ed5['query'][_0xddc2('0x39')]('nolimit')){_0x2f2182['limit']=qs[_0xddc2('0x3a')](_0xf01ed5['query'][_0xddc2('0x3a')]);_0x2f2182[_0xddc2('0x3b')]=qs[_0xddc2('0x3b')](_0xf01ed5[_0xddc2('0x29')][_0xddc2('0x3b')]);}_0x2f2182[_0xddc2('0x3c')]=qs[_0xddc2('0x3d')](_0xf01ed5[_0xddc2('0x29')][_0xddc2('0x3d')]);_0x2f2182['where']=qs['filters'](_[_0xddc2('0x3e')](_0xf01ed5[_0xddc2('0x29')],_0x39c33b[_0xddc2('0x2a')]));_0x2f2182[_0xddc2('0x3f')][_0xddc2('0x40')]=_0x4722d4['id'];if(_0xf01ed5[_0xddc2('0x29')]['filter']){_0x2f2182[_0xddc2('0x3f')]=_['merge'](_0x2f2182[_0xddc2('0x3f')],{'$or':_['map'](_0x2f2182[_0xddc2('0x2c')],function(_0x1453a1){var _0x3fa890={};_0x3fa890[_0x1453a1]={'$like':'%'+_0xf01ed5['query'][_0xddc2('0x41')]+'%'};return _0x3fa890;})});}if(_0xf01ed5[_0xddc2('0x29')][_0xddc2('0x42')]){var _0x148123=_0xf01ed5[_0xddc2('0x29')][_0xddc2('0x42')][_0xddc2('0x43')](',');var _0x39152e={};_0x39152e[_0x148123[0x0]]={'$gte':moment(_0x148123[0x1])[_0xddc2('0x44')]('YYYY-MM-DD\x20HH:mm:ss')};_0x2f2182[_0xddc2('0x3f')]=_[_0xddc2('0x2e')](_0x2f2182[_0xddc2('0x3f')],_0x39152e);}_0x2f2182=_['merge']({},_0x2f2182,_0xf01ed5[_0xddc2('0x2f')]);return db[_0xddc2('0x38')]['count']({'where':_0x2f2182[_0xddc2('0x3f')]})[_0xddc2('0x16')](function(_0x1484f8){_0x5c8476[_0xddc2('0x13')]=_0x1484f8;if(_0xf01ed5[_0xddc2('0x29')][_0xddc2('0x45')]){_0x2f2182[_0xddc2('0x46')]=[{'all':!![]}];}return db['FaxMessage'][_0xddc2('0x21')](_0x2f2182);})[_0xddc2('0x16')](function(_0x3008ac){_0x5c8476[_0xddc2('0x47')]=_0x3008ac;return _0x5c8476;});}})[_0xddc2('0x16')](respondWithFilteredResult(_0x2b6209,_0x2f2182))[_0xddc2('0x24')](handleError(_0x2b6209,null));};exports['addTags']=function(_0x54cb7a,_0xae471d){return db[_0xddc2('0x1c')]['find']({'where':{'id':_0x54cb7a[_0xddc2('0x26')]['id']}})['then'](handleEntityNotFound(_0xae471d,null))['then'](function(_0x5269f3){if(_0x5269f3){return _0x5269f3[_0xddc2('0x48')](_0x54cb7a[_0xddc2('0x32')][_0xddc2('0x35')],_[_0xddc2('0x49')](_0x54cb7a[_0xddc2('0x32')],[_0xddc2('0x35'),'id'])||{})[_0xddc2('0x4a')](function(){return db[_0xddc2('0x4b')][_0xddc2('0x21')]({'attributes':['id','name','color'],'where':{'id':_0x54cb7a[_0xddc2('0x32')]['ids']}});})['then'](function(_0x274f5e){socket[_0xddc2('0x4c')](_0xddc2('0x4d'),{'id':Number(_0x54cb7a[_0xddc2('0x26')]['id']),'tags':_0x274f5e||[]});return{'id':Number(_0x54cb7a[_0xddc2('0x26')]['id']),'tags':_0x274f5e||[]};});}})['then'](respondWithResult(_0xae471d,null))[_0xddc2('0x24')](handleError(_0xae471d,null));};exports[_0xddc2('0x4e')]=function(_0xb8bd39,_0x834b61){return db[_0xddc2('0x1c')][_0xddc2('0x30')]({'where':{'id':_0xb8bd39[_0xddc2('0x26')]['id']}})['then'](handleEntityNotFound(_0x834b61,null))[_0xddc2('0x16')](function(_0x557065){if(_0x557065){return _0x557065[_0xddc2('0x4e')](_0xb8bd39['query']['ids']);}})[_0xddc2('0x16')](respondWithStatusCode(_0x834b61,null))[_0xddc2('0x24')](handleError(_0x834b61,null));};exports[_0xddc2('0x4f')]=function(_0x1455a6,_0xd975ef){var _0x422158=moment()[_0xddc2('0x50')]()[_0xddc2('0x51')]();var _0x3cb968=path[_0xddc2('0x52')](config[_0xddc2('0x53')],_0xddc2('0x54'),'files','tmp');var _0x73804f=path[_0xddc2('0x52')](config[_0xddc2('0x53')],_0xddc2('0x54'),'files',_0xddc2('0x55'));var _0x591b35=path[_0xddc2('0x52')](_0x3cb968,_0x422158);var _0x2c0895=util[_0xddc2('0x44')](_0xddc2('0x56'),_0x1455a6['params']['id'],_0x422158);var _0x4b85a1=path[_0xddc2('0x52')](_0x3cb968,_0x2c0895);var _0x388489=[];_0x388489[_0xddc2('0x57')]({'model':db['Attachment'],'as':_0xddc2('0x58'),'raw':!![]});var _0x25092f=[{'model':db[_0xddc2('0x38')],'as':_0xddc2('0x59'),'attributes':['id','body',_0xddc2('0x5a')],'include':_0x388489}];return db[_0xddc2('0x1c')][_0xddc2('0x30')]({'where':{'id':_0x1455a6[_0xddc2('0x26')]['id']},'include':_0x25092f})[_0xddc2('0x16')](handleEntityNotFound(_0xd975ef,null))[_0xddc2('0x16')](function(_0x47b70e){if(_0x47b70e&&_0x47b70e[_0xddc2('0x59')]){var _0x46c6a5=_0x47b70e['get']({'plain':!![]});fs[_0xddc2('0x5b')](_0x591b35);for(var _0x5195bc=0x0;_0x5195bc<_0x46c6a5[_0xddc2('0x59')][_0xddc2('0x5c')];_0x5195bc++){var _0x2d4918=_0x46c6a5['Messages'][_0x5195bc][_0xddc2('0x58')];if(_0x2d4918){var _0x53fbc2=path[_0xddc2('0x52')](_0x73804f,_0x2d4918['basename']);if(fs[_0xddc2('0x5d')](_0x53fbc2)){fs[_0xddc2('0x5e')](_0x53fbc2)[_0xddc2('0x5f')](fs[_0xddc2('0x60')](path[_0xddc2('0x52')](_0x591b35,_0x2d4918[_0xddc2('0x61')])));}}}return BPromise[_0xddc2('0x62')]()[_0xddc2('0x16')](function(){return new BPromise(function(_0x37e46c,_0x1a60b0){zipdir(_0x591b35,{'saveTo':_0x4b85a1},function(_0x17d81f,_0xcadc21){if(_0x17d81f)return _0x1a60b0(_0x17d81f);return _0x37e46c(_0xcadc21);});})[_0xddc2('0x16')](function(){return new BPromise(function(_0x396df1,_0x2c9f65){rimraf(_0x591b35,function(_0x1d414e){if(_0x1d414e)_0x2c9f65(_0x1d414e);return _0x396df1();});});})['then'](function(){return _0xd975ef[_0xddc2('0x4f')](_0x4b85a1,_0x2c0895,function(_0x4259cf){if(_0x4259cf){console[_0xddc2('0x63')]('err',_0x4259cf);}else{fs[_0xddc2('0x64')](_0x4b85a1);}});});});}else{return _0xd975ef[_0xddc2('0xe')](0xc8);}})[_0xddc2('0x24')](handleError(_0xd975ef,null));}; \ No newline at end of file +var _0x4f4a=['findAll','query','user','catch','show','params','keys','intersection','model','attributes','fields','length','includeAll','include','options','FaxInteraction','create','body','find','destroy','describe','addMessage','FaxMessage','ids','findOne','filters','hasOwnProperty','nolimit','order','sort','where','FaxInteractionId','filter','merge','$gte','split','YYYY-MM-DD\x20HH:mm:ss','rows','addTags','setTags','omit','spread','Tag','color','faxInteractionTags:save','removeTags','download','unix','toString','files','tmp','server','join','format','transcript-%d-%s.zip','push','Attachment','Messages','get','existsSync','createReadStream','pipe','createWriteStream','basename','resolve','log','err','unlinkSync','rimraf','zip-dir','moment','bluebird','util','ioredis','../../components/interaction/service','../../config/logger','../../mysqldb','redis','defaults','socket.io-emitter','register','status','json','offset','undefined','limit','count','Content-Range','update','then','sendStatus','error','stack','name','send','map','rawAttributes','fieldName','key','getOptions'];(function(_0x3c224a,_0xfe888c){var _0x37fb70=function(_0x47f104){while(--_0x47f104){_0x3c224a['push'](_0x3c224a['shift']());}};_0x37fb70(++_0xfe888c);}(_0x4f4a,0xa8));var _0xa4f4=function(_0x26129c,_0x29bbca){_0x26129c=_0x26129c-0x0;var _0x19149a=_0x4f4a[_0x26129c];return _0x19149a;};'use strict';var rimraf=require(_0xa4f4('0x0'));var zipdir=require(_0xa4f4('0x1'));var moment=require(_0xa4f4('0x2'));var BPromise=require(_0xa4f4('0x3'));var util=require(_0xa4f4('0x4'));var path=require('path');var fs=require('fs');var _=require('lodash');var Redis=require(_0xa4f4('0x5'));var interaction=require(_0xa4f4('0x6'));var qs=require('../../components/parsers/qs');var logger=require(_0xa4f4('0x7'))('api');var config=require('../../config/environment');var db=require(_0xa4f4('0x8'))['db'];config[_0xa4f4('0x9')]=_[_0xa4f4('0xa')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xa4f4('0xb'))(new Redis(config['redis']));require('./faxInteraction.socket')[_0xa4f4('0xc')](socket);function respondWithStatusCode(_0x11b67e,_0x5a138f){_0x5a138f=_0x5a138f||0xcc;return function(_0x301272){if(_0x301272){return _0x11b67e['sendStatus'](_0x5a138f);}return _0x11b67e['status'](_0x5a138f)['end']();};}function respondWithResult(_0x1a930a,_0x1c3d2c){_0x1c3d2c=_0x1c3d2c||0xc8;return function(_0x44bdd8){if(_0x44bdd8){return _0x1a930a[_0xa4f4('0xd')](_0x1c3d2c)[_0xa4f4('0xe')](_0x44bdd8);}};}function respondWithFilteredResult(_0x261a7f,_0x46eca3){return function(_0x4724dd){if(_0x4724dd){var _0x86bc41=typeof _0x46eca3[_0xa4f4('0xf')]===_0xa4f4('0x10')&&typeof _0x46eca3[_0xa4f4('0x11')]===_0xa4f4('0x10');var _0x4cbc03=_0x4724dd['count'];var _0x36487d=_0x86bc41?0x0:_0x46eca3[_0xa4f4('0xf')];var _0x4bb7a5=_0x86bc41?_0x4724dd[_0xa4f4('0x12')]:_0x46eca3[_0xa4f4('0xf')]+_0x46eca3['limit'];var _0x27f08b;if(_0x4bb7a5>=_0x4cbc03){_0x4bb7a5=_0x4cbc03;_0x27f08b=0xc8;}else{_0x27f08b=0xce;}_0x261a7f['status'](_0x27f08b);return _0x261a7f['set'](_0xa4f4('0x13'),_0x36487d+'-'+_0x4bb7a5+'/'+_0x4cbc03)[_0xa4f4('0xe')](_0x4724dd);}return null;};}function saveUpdates(_0x13fe51){return function(_0x2e8cde){if(_0x2e8cde){return _0x2e8cde[_0xa4f4('0x14')](_0x13fe51)[_0xa4f4('0x15')](function(_0x234fb5){return _0x234fb5;});}return null;};}function removeEntity(_0x5308f4){return function(_0x5e27be){if(_0x5e27be){return _0x5e27be['destroy']()[_0xa4f4('0x15')](function(){_0x5308f4[_0xa4f4('0xd')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4df118){return function(_0x4a7262){if(!_0x4a7262){_0x4df118[_0xa4f4('0x16')](0x194);}return _0x4a7262;};}function handleError(_0x20c156,_0x413cf1){_0x413cf1=_0x413cf1||0x1f4;return function(_0x347671){logger[_0xa4f4('0x17')](_0x347671[_0xa4f4('0x18')]);if(_0x347671['name']){delete _0x347671[_0xa4f4('0x19')];}_0x20c156[_0xa4f4('0xd')](_0x413cf1)[_0xa4f4('0x1a')](_0x347671);};}exports['index']=function(_0xf3451b,_0x2c2b12){var _0x3e2cff={};var _0x2bcc98=_[_0xa4f4('0x1b')](db['FaxInteraction'][_0xa4f4('0x1c')],function(_0x2d5808){return{'name':_0x2d5808[_0xa4f4('0x1d')],'type':_0x2d5808['type'][_0xa4f4('0x1e')]};});_0x3e2cff=qs[_0xa4f4('0x1f')](_0x2bcc98,_0xf3451b);return interaction[_0xa4f4('0x20')]('fax',_0xf3451b[_0xa4f4('0x21')],_0xf3451b[_0xa4f4('0x22')],_0x3e2cff,_0x2bcc98)[_0xa4f4('0x15')](respondWithFilteredResult(_0x2c2b12,_0x3e2cff))[_0xa4f4('0x23')](handleError(_0x2c2b12,null));};exports[_0xa4f4('0x24')]=function(_0x2234f7,_0x415467){var _0x50e90b={'raw':![],'where':{'id':_0x2234f7[_0xa4f4('0x25')]['id']}},_0x47bf09={};_0x47bf09['model']=_[_0xa4f4('0x26')](db['FaxInteraction'][_0xa4f4('0x1c')]);_0x47bf09[_0xa4f4('0x21')]=_['keys'](_0x2234f7[_0xa4f4('0x21')]);_0x47bf09['filters']=_[_0xa4f4('0x27')](_0x47bf09[_0xa4f4('0x28')],_0x47bf09['query']);_0x50e90b[_0xa4f4('0x29')]=_['intersection'](_0x47bf09[_0xa4f4('0x28')],qs[_0xa4f4('0x2a')](_0x2234f7[_0xa4f4('0x21')][_0xa4f4('0x2a')]));_0x50e90b['attributes']=_0x50e90b[_0xa4f4('0x29')][_0xa4f4('0x2b')]?_0x50e90b['attributes']:_0x47bf09[_0xa4f4('0x28')];if(_0x2234f7[_0xa4f4('0x21')][_0xa4f4('0x2c')]){_0x50e90b[_0xa4f4('0x2d')]=[{'all':!![]}];}_0x50e90b=_['merge']({},_0x50e90b,_0x2234f7[_0xa4f4('0x2e')]);return db[_0xa4f4('0x2f')]['find'](_0x50e90b)[_0xa4f4('0x15')](handleEntityNotFound(_0x415467,null))[_0xa4f4('0x15')](respondWithResult(_0x415467,null))[_0xa4f4('0x23')](handleError(_0x415467,null));};exports['create']=function(_0x1c4d4e,_0x176c29){return db[_0xa4f4('0x2f')][_0xa4f4('0x30')](_0x1c4d4e[_0xa4f4('0x31')],{})['then'](respondWithResult(_0x176c29,0xc9))[_0xa4f4('0x23')](handleError(_0x176c29,null));};exports[_0xa4f4('0x14')]=function(_0x290941,_0x5c604d){if(_0x290941[_0xa4f4('0x31')]['id']){delete _0x290941[_0xa4f4('0x31')]['id'];}return db[_0xa4f4('0x2f')][_0xa4f4('0x32')]({'where':{'id':_0x290941[_0xa4f4('0x25')]['id']}})[_0xa4f4('0x15')](handleEntityNotFound(_0x5c604d,null))[_0xa4f4('0x15')](saveUpdates(_0x290941[_0xa4f4('0x31')],null))[_0xa4f4('0x15')](respondWithResult(_0x5c604d,null))[_0xa4f4('0x23')](handleError(_0x5c604d,null));};exports[_0xa4f4('0x33')]=function(_0x47c736,_0x5a9c71){return db['FaxInteraction'][_0xa4f4('0x32')]({'where':{'id':_0x47c736[_0xa4f4('0x25')]['id']}})[_0xa4f4('0x15')](handleEntityNotFound(_0x5a9c71,null))['then'](removeEntity(_0x5a9c71,null))[_0xa4f4('0x23')](handleError(_0x5a9c71,null));};exports['describe']=function(_0x24aeca,_0x1dfa7c){return db[_0xa4f4('0x2f')][_0xa4f4('0x34')]()[_0xa4f4('0x15')](respondWithResult(_0x1dfa7c,null))[_0xa4f4('0x23')](handleError(_0x1dfa7c,null));};exports[_0xa4f4('0x35')]=function(_0x39bb62,_0x5c49b2){return db[_0xa4f4('0x36')][_0xa4f4('0x32')]({'where':{'id':_0x39bb62['params']['id']}})[_0xa4f4('0x15')](handleEntityNotFound(_0x5c49b2,null))[_0xa4f4('0x15')](function(_0x20d3f6){if(_0x20d3f6){return _0x20d3f6[_0xa4f4('0x35')](_0x39bb62[_0xa4f4('0x31')][_0xa4f4('0x37')],_['omit'](_0x39bb62[_0xa4f4('0x31')],[_0xa4f4('0x37'),'id'])||{});}})[_0xa4f4('0x15')](respondWithResult(_0x5c49b2,null))['catch'](handleError(_0x5c49b2,null));};exports['getMessages']=function(_0x223191,_0xe74178){var _0x2b85c0={'raw':![],'where':{}};var _0x3ac0ac={};var _0x5a65a6={'count':0x0,'rows':[]};return db[_0xa4f4('0x2f')][_0xa4f4('0x38')]({'where':{'id':_0x223191['params']['id']}})[_0xa4f4('0x15')](handleEntityNotFound(_0xe74178,null))['then'](function(_0x33e4ee){if(_0x33e4ee){_0x3ac0ac[_0xa4f4('0x28')]=_[_0xa4f4('0x26')](db['FaxMessage'][_0xa4f4('0x1c')]);_0x3ac0ac[_0xa4f4('0x21')]=_[_0xa4f4('0x26')](_0x223191[_0xa4f4('0x21')]);_0x3ac0ac[_0xa4f4('0x39')]=_[_0xa4f4('0x27')](_0x3ac0ac[_0xa4f4('0x28')],_0x3ac0ac[_0xa4f4('0x21')]);_0x2b85c0[_0xa4f4('0x29')]=_[_0xa4f4('0x27')](_0x3ac0ac['model'],qs[_0xa4f4('0x2a')](_0x223191[_0xa4f4('0x21')][_0xa4f4('0x2a')]));_0x2b85c0['attributes']=_0x2b85c0[_0xa4f4('0x29')][_0xa4f4('0x2b')]?_0x2b85c0[_0xa4f4('0x29')]:_0x3ac0ac['model'];if(!_0x223191['query'][_0xa4f4('0x3a')](_0xa4f4('0x3b'))){_0x2b85c0[_0xa4f4('0x11')]=qs[_0xa4f4('0x11')](_0x223191[_0xa4f4('0x21')]['limit']);_0x2b85c0['offset']=qs['offset'](_0x223191[_0xa4f4('0x21')][_0xa4f4('0xf')]);}_0x2b85c0[_0xa4f4('0x3c')]=qs[_0xa4f4('0x3d')](_0x223191[_0xa4f4('0x21')][_0xa4f4('0x3d')]);_0x2b85c0['where']=qs[_0xa4f4('0x39')](_['pick'](_0x223191[_0xa4f4('0x21')],_0x3ac0ac['filters']));_0x2b85c0[_0xa4f4('0x3e')][_0xa4f4('0x3f')]=_0x33e4ee['id'];if(_0x223191[_0xa4f4('0x21')][_0xa4f4('0x40')]){_0x2b85c0[_0xa4f4('0x3e')]=_[_0xa4f4('0x41')](_0x2b85c0['where'],{'$or':_[_0xa4f4('0x1b')](_0x2b85c0['attributes'],function(_0x1057b2){var _0x386a8c={};_0x386a8c[_0x1057b2]={'$like':'%'+_0x223191[_0xa4f4('0x21')]['filter']+'%'};return _0x386a8c;})});}if(_0x223191['query'][_0xa4f4('0x42')]){var _0x34097a=_0x223191['query'][_0xa4f4('0x42')][_0xa4f4('0x43')](',');var _0x4d908f={};_0x4d908f[_0x34097a[0x0]]={'$gte':moment(_0x34097a[0x1])['format'](_0xa4f4('0x44'))};_0x2b85c0[_0xa4f4('0x3e')]=_[_0xa4f4('0x41')](_0x2b85c0[_0xa4f4('0x3e')],_0x4d908f);}_0x2b85c0=_['merge']({},_0x2b85c0,_0x223191[_0xa4f4('0x2e')]);return db[_0xa4f4('0x36')]['count']({'where':_0x2b85c0[_0xa4f4('0x3e')]})['then'](function(_0x5eed73){_0x5a65a6[_0xa4f4('0x12')]=_0x5eed73;if(_0x223191[_0xa4f4('0x21')][_0xa4f4('0x2c')]){_0x2b85c0['include']=[{'all':!![]}];}return db[_0xa4f4('0x36')][_0xa4f4('0x20')](_0x2b85c0);})[_0xa4f4('0x15')](function(_0x5e166c){_0x5a65a6[_0xa4f4('0x45')]=_0x5e166c;return _0x5a65a6;});}})[_0xa4f4('0x15')](respondWithFilteredResult(_0xe74178,_0x2b85c0))[_0xa4f4('0x23')](handleError(_0xe74178,null));};exports[_0xa4f4('0x46')]=function(_0x299dd8,_0x5dfed4){return db[_0xa4f4('0x2f')]['find']({'where':{'id':_0x299dd8['params']['id']}})[_0xa4f4('0x15')](handleEntityNotFound(_0x5dfed4,null))[_0xa4f4('0x15')](function(_0x16bf41){if(_0x16bf41){return _0x16bf41[_0xa4f4('0x47')](_0x299dd8['body']['ids'],_[_0xa4f4('0x48')](_0x299dd8[_0xa4f4('0x31')],[_0xa4f4('0x37'),'id'])||{})[_0xa4f4('0x49')](function(){return db[_0xa4f4('0x4a')]['findAll']({'attributes':['id',_0xa4f4('0x19'),_0xa4f4('0x4b')],'where':{'id':_0x299dd8[_0xa4f4('0x31')][_0xa4f4('0x37')]}});})[_0xa4f4('0x15')](function(_0x211a88){socket['emit'](_0xa4f4('0x4c'),{'id':Number(_0x299dd8[_0xa4f4('0x25')]['id']),'tags':_0x211a88||[]});return{'id':Number(_0x299dd8[_0xa4f4('0x25')]['id']),'tags':_0x211a88||[]};});}})[_0xa4f4('0x15')](respondWithResult(_0x5dfed4,null))[_0xa4f4('0x23')](handleError(_0x5dfed4,null));};exports[_0xa4f4('0x4d')]=function(_0x3c8b9c,_0x3fb372){return db[_0xa4f4('0x2f')][_0xa4f4('0x32')]({'where':{'id':_0x3c8b9c['params']['id']}})[_0xa4f4('0x15')](handleEntityNotFound(_0x3fb372,null))[_0xa4f4('0x15')](function(_0x295f2f){if(_0x295f2f){return _0x295f2f[_0xa4f4('0x4d')](_0x3c8b9c[_0xa4f4('0x21')][_0xa4f4('0x37')]);}})[_0xa4f4('0x15')](respondWithStatusCode(_0x3fb372,null))[_0xa4f4('0x23')](handleError(_0x3fb372,null));};exports[_0xa4f4('0x4e')]=function(_0x3c42ea,_0x260218){var _0x43e728=moment()[_0xa4f4('0x4f')]()[_0xa4f4('0x50')]();var _0x8046d9=path['join'](config['root'],'server',_0xa4f4('0x51'),_0xa4f4('0x52'));var _0x1eaf4e=path['join'](config['root'],_0xa4f4('0x53'),_0xa4f4('0x51'),'attachments');var _0x5d7453=path[_0xa4f4('0x54')](_0x8046d9,_0x43e728);var _0xbba3dd=util[_0xa4f4('0x55')](_0xa4f4('0x56'),_0x3c42ea['params']['id'],_0x43e728);var _0x8e7c6f=path[_0xa4f4('0x54')](_0x8046d9,_0xbba3dd);var _0x2e46f4=[];_0x2e46f4[_0xa4f4('0x57')]({'model':db[_0xa4f4('0x58')],'as':_0xa4f4('0x58'),'raw':!![]});var _0x374523=[{'model':db['FaxMessage'],'as':'Messages','attributes':['id',_0xa4f4('0x31'),'createdAt'],'include':_0x2e46f4}];return db[_0xa4f4('0x2f')][_0xa4f4('0x32')]({'where':{'id':_0x3c42ea[_0xa4f4('0x25')]['id']},'include':_0x374523})[_0xa4f4('0x15')](handleEntityNotFound(_0x260218,null))[_0xa4f4('0x15')](function(_0x55f55c){if(_0x55f55c&&_0x55f55c[_0xa4f4('0x59')]){var _0x7e9f1=_0x55f55c[_0xa4f4('0x5a')]({'plain':!![]});fs['mkdirSync'](_0x5d7453);for(var _0xb0d06e=0x0;_0xb0d06e<_0x7e9f1[_0xa4f4('0x59')]['length'];_0xb0d06e++){var _0x1fcab2=_0x7e9f1['Messages'][_0xb0d06e][_0xa4f4('0x58')];if(_0x1fcab2){var _0x5cedad=path[_0xa4f4('0x54')](_0x1eaf4e,_0x1fcab2['basename']);if(fs[_0xa4f4('0x5b')](_0x5cedad)){fs[_0xa4f4('0x5c')](_0x5cedad)[_0xa4f4('0x5d')](fs[_0xa4f4('0x5e')](path['join'](_0x5d7453,_0x1fcab2[_0xa4f4('0x5f')])));}}}return BPromise[_0xa4f4('0x60')]()[_0xa4f4('0x15')](function(){return new BPromise(function(_0x5190c2,_0x282a3a){zipdir(_0x5d7453,{'saveTo':_0x8e7c6f},function(_0x440a08,_0xd1e5f3){if(_0x440a08)return _0x282a3a(_0x440a08);return _0x5190c2(_0xd1e5f3);});})[_0xa4f4('0x15')](function(){return new BPromise(function(_0x1d73f2,_0x570b6a){rimraf(_0x5d7453,function(_0x5486aa){if(_0x5486aa)_0x570b6a(_0x5486aa);return _0x1d73f2();});});})[_0xa4f4('0x15')](function(){return _0x260218[_0xa4f4('0x4e')](_0x8e7c6f,_0xbba3dd,function(_0xc0fbb){if(_0xc0fbb){console[_0xa4f4('0x61')](_0xa4f4('0x62'),_0xc0fbb);}else{fs[_0xa4f4('0x63')](_0x8e7c6f);}});});});}else{return _0x260218[_0xa4f4('0x16')](0xc8);}})[_0xa4f4('0x23')](handleError(_0x260218,null));}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.events.js b/server/api/faxInteraction/faxInteraction.events.js index d4b9118..367fef1 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 _0x2748=['map','then','length','emit','catch','hasOwnProperty','hook','events','../../mysqldb','FaxInteraction','FaxMessage','save','update','remove','getUsers','setDataValue','Users'];(function(_0x431ba5,_0xa4ff29){var _0x5d0d7f=function(_0x39b149){while(--_0x39b149){_0x431ba5['push'](_0x431ba5['shift']());}};_0x5d0d7f(++_0xa4ff29);}(_0x2748,0x1b0));var _0x8274=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x2748[_0x432682];return _0x463d05;};'use strict';var EventEmitter=require(_0x8274('0x0'));var FaxInteraction=require(_0x8274('0x1'))['db'][_0x8274('0x2')];var FaxMessage=require(_0x8274('0x1'))['db'][_0x8274('0x3')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x8274('0x4'),'afterUpdate':_0x8274('0x5'),'afterDestroy':_0x8274('0x6')};function emitEvent(_0x293401){return function(_0x38a428,_0x537b59,_0x3dbb8c){_0x38a428[_0x8274('0x7')]({'attributes':['id'],'raw':!![]})['then'](function(_0x3f673f){_0x38a428[_0x8274('0x8')](_0x8274('0x9'),_0x3f673f[_0x8274('0xa')](function(_0x12b74c){return{'id':_0x12b74c['id']};}));return FaxMessage['findAll']({'where':{'FaxInteractionId':_0x38a428['id'],'direction':'in','read':![]},'raw':!![]});})[_0x8274('0xb')](function(_0x4da802){_0x38a428['setDataValue']('unreadMessages',_0x4da802[_0x8274('0xc')]);FaxInteractionEvents[_0x8274('0xd')](_0x293401+':'+_0x38a428['id'],_0x38a428);FaxInteractionEvents[_0x8274('0xd')](_0x293401,_0x38a428);_0x3dbb8c(null);})[_0x8274('0xe')](_0x3dbb8c(null));};}for(var e in events){if(events[_0x8274('0xf')](e)){var event=events[e];FaxInteraction[_0x8274('0x10')](e,emitEvent(event));}}module['exports']=FaxInteractionEvents; \ No newline at end of file +var _0x8648=['setDataValue','Users','findAll','then','emit','hasOwnProperty','hook','exports','events','../../mysqldb','FaxInteraction','FaxMessage','setMaxListeners','save','getUsers'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0x8648,0x1ac));var _0x8864=function(_0xdb638,_0x27b7d2){_0xdb638=_0xdb638-0x0;var _0x192640=_0x8648[_0xdb638];return _0x192640;};'use strict';var EventEmitter=require(_0x8864('0x0'));var FaxInteraction=require(_0x8864('0x1'))['db'][_0x8864('0x2')];var FaxMessage=require(_0x8864('0x1'))['db'][_0x8864('0x3')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0x8864('0x4')](0x0);var events={'afterCreate':_0x8864('0x5'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x3d918b){return function(_0x51dd63,_0x124a9c,_0x3f9a15){_0x51dd63[_0x8864('0x6')]({'attributes':['id'],'raw':!![]})['then'](function(_0x54296b){_0x51dd63[_0x8864('0x7')](_0x8864('0x8'),_0x54296b['map'](function(_0x138f92){return{'id':_0x138f92['id']};}));return FaxMessage[_0x8864('0x9')]({'where':{'FaxInteractionId':_0x51dd63['id'],'direction':'in','read':![]},'raw':!![]});})[_0x8864('0xa')](function(_0x4608a3){_0x51dd63['setDataValue']('unreadMessages',_0x4608a3['length']);FaxInteractionEvents['emit'](_0x3d918b+':'+_0x51dd63['id'],_0x51dd63);FaxInteractionEvents[_0x8864('0xb')](_0x3d918b,_0x51dd63);_0x3f9a15(null);})['catch'](_0x3f9a15(null));};}for(var e in events){if(events[_0x8864('0xc')](e)){var event=events[e];FaxInteraction[_0x8864('0xd')](e,emitEvent(event));}}module[_0x8864('0xe')]=FaxInteractionEvents; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.model.js b/server/api/faxInteraction/faxInteraction.model.js index 4909ddd..d4ab601 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 _0x8c03=['closedAt','format','lodash','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','FaxInteraction','changed','closed'];(function(_0x36bf8e,_0xc065a2){var _0x567be4=function(_0xbb7002){while(--_0xbb7002){_0x36bf8e['push'](_0x36bf8e['shift']());}};_0x567be4(++_0xc065a2);}(_0x8c03,0x152));var _0x38c0=function(_0x3822d1,_0x424bba){_0x3822d1=_0x3822d1-0x0;var _0xb7e282=_0x8c03[_0x3822d1];return _0xb7e282;};'use strict';var _=require(_0x38c0('0x0'));var util=require('util');var logger=require(_0x38c0('0x1'))('api');var moment=require('moment');var BPromise=require(_0x38c0('0x2'));var rp=require(_0x38c0('0x3'));var fs=require('fs');var path=require(_0x38c0('0x4'));var rimraf=require(_0x38c0('0x5'));var config=require(_0x38c0('0x6'));var attributes=require('./faxInteraction.attributes');module[_0x38c0('0x7')]=function(_0x3a8c22,_0x4cacc8){return _0x3a8c22[_0x38c0('0x8')](_0x38c0('0x9'),attributes,{'tableName':'fax_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0xb36c7,_0x40fe32,_0x35b2ef){if(_0xb36c7[_0x38c0('0xa')](_0x38c0('0xb'))){_0xb36c7[_0x38c0('0xc')]=moment()[_0x38c0('0xd')]('YYYY-MM-DD\x20HH:mm:ss');}_0x35b2ef(null,_0xb36c7);}}});}; \ No newline at end of file +var _0xde4d=['YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','moment','bluebird','exports','FaxInteraction','fax_interactions','closed','format'];(function(_0x555791,_0x21a9cf){var _0x50a635=function(_0x4a0236){while(--_0x4a0236){_0x555791['push'](_0x555791['shift']());}};_0x50a635(++_0x21a9cf);}(_0xde4d,0xf1));var _0xdde4=function(_0x1fb1d2,_0x36f5ac){_0x1fb1d2=_0x1fb1d2-0x0;var _0x4c1d72=_0xde4d[_0x1fb1d2];return _0x4c1d72;};'use strict';var _=require(_0xdde4('0x0'));var util=require(_0xdde4('0x1'));var logger=require(_0xdde4('0x2'))(_0xdde4('0x3'));var moment=require(_0xdde4('0x4'));var BPromise=require(_0xdde4('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./faxInteraction.attributes');module[_0xdde4('0x6')]=function(_0x4b8cbd,_0x3d7216){return _0x4b8cbd['define'](_0xdde4('0x7'),attributes,{'tableName':_0xdde4('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x3b998e,_0x29f975,_0x2d358e){if(_0x3b998e['changed'](_0xdde4('0x9'))){_0x3b998e['closedAt']=moment()[_0xdde4('0xa')](_0xdde4('0xb'));}_0x2d358e(null,_0x3b998e);}}});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.rpc.js b/server/api/faxInteraction/faxInteraction.rpc.js index 598d69b..bb498ab 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 _0x311d=['rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./faxInteraction.socket','register','then','info','FaxInteraction,\x20%s,\x20%s','request\x20sent','debug','FaxInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateFaxInteraction','FaxInteraction','update','body','options','raw','where','attributes','AddTagsToFaxInteraction','find','addTags','spread','AddTags','lodash','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x4aef90,_0x572dde){var _0x1ac2db=function(_0x1fb18e){while(--_0x1fb18e){_0x4aef90['push'](_0x4aef90['shift']());}};_0x1ac2db(++_0x572dde);}(_0x311d,0x1e6));var _0xd311=function(_0xdb7c5a,_0x233831){_0xdb7c5a=_0xdb7c5a-0x0;var _0x26a35f=_0x311d[_0xdb7c5a];return _0x26a35f;};'use strict';var _=require(_0xd311('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xd311('0x1'));var fs=require('fs');var Redis=require(_0xd311('0x2'));var db=require(_0xd311('0x3'))['db'];var utils=require(_0xd311('0x4'));var logger=require(_0xd311('0x5'))(_0xd311('0x6'));var config=require(_0xd311('0x7'));var jayson=require(_0xd311('0x8'));var client=jayson[_0xd311('0x9')]['http']({'port':0x232a});config[_0xd311('0xa')]=_[_0xd311('0xb')](config[_0xd311('0xa')],{'host':_0xd311('0xc'),'port':0x18eb});var socket=require(_0xd311('0xd'))(new Redis(config[_0xd311('0xa')]));require(_0xd311('0xe'))[_0xd311('0xf')](socket);function respondWithRpcPromise(_0x4266ab,_0x15a46f,_0x17c0c6){return new BPromise(function(_0x3a68df,_0x2babf8){return client['request'](_0x4266ab,_0x17c0c6)[_0xd311('0x10')](function(_0x44f89e){logger[_0xd311('0x11')](_0xd311('0x12'),_0x15a46f,_0xd311('0x13'));logger[_0xd311('0x14')](_0xd311('0x15'),_0x15a46f,'request\x20sent',JSON[_0xd311('0x16')](_0x44f89e));if(_0x44f89e['error']){if(_0x44f89e[_0xd311('0x17')][_0xd311('0x18')]===0x1f4){logger['error']('FaxInteraction,\x20%s,\x20%s',_0x15a46f,_0x44f89e[_0xd311('0x17')]['message']);return _0x2babf8(_0x44f89e['error'][_0xd311('0x19')]);}logger[_0xd311('0x17')](_0xd311('0x12'),_0x15a46f,_0x44f89e['error'][_0xd311('0x19')]);return _0x3a68df(_0x44f89e[_0xd311('0x17')]['message']);}else{logger[_0xd311('0x11')](_0xd311('0x12'),_0x15a46f,_0xd311('0x13'));_0x3a68df(_0x44f89e[_0xd311('0x1a')][_0xd311('0x19')]);}})[_0xd311('0x1b')](function(_0x1f81a7){logger[_0xd311('0x17')]('FaxInteraction,\x20%s,\x20%s',_0x15a46f,_0x1f81a7);_0x2babf8(_0x1f81a7);});});}exports[_0xd311('0x1c')]=function(_0x2201df){var _0x286be1=this;return new Promise(function(_0x37f498,_0x89ef70){return db[_0xd311('0x1d')][_0xd311('0x1e')](_0x2201df[_0xd311('0x1f')],{'raw':_0x2201df[_0xd311('0x20')]?_0x2201df['options'][_0xd311('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2201df[_0xd311('0x20')]?_0x2201df['options'][_0xd311('0x22')]||null:null,'attributes':_0x2201df[_0xd311('0x20')]?_0x2201df['options'][_0xd311('0x23')]||null:null,'limit':_0x2201df['options']?_0x2201df[_0xd311('0x20')]['limit']||null:null})[_0xd311('0x10')](function(_0x415b8a){logger[_0xd311('0x11')](_0xd311('0x1c'),_0x2201df);logger['debug'](_0xd311('0x1c'),_0x2201df,JSON[_0xd311('0x16')](_0x415b8a));_0x37f498(_0x415b8a);})[_0xd311('0x1b')](function(_0x2e33a4){logger[_0xd311('0x17')](_0xd311('0x1c'),_0x2e33a4[_0xd311('0x19')],_0x2201df);_0x89ef70(_0x286be1[_0xd311('0x17')](0x1f4,_0x2e33a4[_0xd311('0x19')]));});});};exports[_0xd311('0x24')]=function(_0x4adc73){return new Promise(function(_0x332c5c,_0x23e93d){return db[_0xd311('0x1d')][_0xd311('0x25')]({'where':_0x4adc73[_0xd311('0x20')]?_0x4adc73[_0xd311('0x20')][_0xd311('0x22')]||null:null})[_0xd311('0x10')](function(_0x31c9aa){if(_0x31c9aa){return _0x31c9aa[_0xd311('0x26')](_0x4adc73[_0xd311('0x1f')]['ids'],_['omit'](_0x4adc73[_0xd311('0x1f')],['ids','id'])||{});}})[_0xd311('0x27')](function(_0x56cbca){logger[_0xd311('0x11')](_0xd311('0x28'),_0x4adc73);logger[_0xd311('0x14')](_0xd311('0x28'),_0x4adc73,JSON['stringify'](_0x56cbca));_0x332c5c(_0x56cbca);})[_0xd311('0x1b')](function(_0x2e3d65){logger[_0xd311('0x17')](_0xd311('0x28'),_0x2e3d65[_0xd311('0x19')],_0x4adc73);_0x23e93d(_this[_0xd311('0x17')](0x1f4,_0x2e3d65[_0xd311('0x19')]));});});}; \ No newline at end of file +var _0xef18=['find','where','addTags','ids','omit','AddTags','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','socket.io-emitter','./faxInteraction.socket','register','request','then','FaxInteraction,\x20%s,\x20%s','request\x20sent','FaxInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','UpdateFaxInteraction','FaxInteraction','body','options','raw','attributes','limit','debug','AddTagsToFaxInteraction'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xef18,0x180));var _0x8ef1=function(_0x40b3f2,_0x2c4f5f){_0x40b3f2=_0x40b3f2-0x0;var _0x4ce90c=_0xef18[_0x40b3f2];return _0x4ce90c;};'use strict';var _=require('lodash');var util=require(_0x8ef1('0x0'));var moment=require(_0x8ef1('0x1'));var BPromise=require(_0x8ef1('0x2'));var rs=require(_0x8ef1('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8ef1('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x8ef1('0x5'))(_0x8ef1('0x6'));var config=require(_0x8ef1('0x7'));var jayson=require(_0x8ef1('0x8'));var client=jayson[_0x8ef1('0x9')]['http']({'port':0x232a});config[_0x8ef1('0xa')]=_[_0x8ef1('0xb')](config[_0x8ef1('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x8ef1('0xc'))(new Redis(config[_0x8ef1('0xa')]));require(_0x8ef1('0xd'))[_0x8ef1('0xe')](socket);function respondWithRpcPromise(_0x1878f1,_0x1ad5c3,_0x382578){return new BPromise(function(_0x520574,_0x5828bf){return client[_0x8ef1('0xf')](_0x1878f1,_0x382578)[_0x8ef1('0x10')](function(_0x4536d6){logger['info'](_0x8ef1('0x11'),_0x1ad5c3,_0x8ef1('0x12'));logger['debug'](_0x8ef1('0x13'),_0x1ad5c3,_0x8ef1('0x12'),JSON[_0x8ef1('0x14')](_0x4536d6));if(_0x4536d6[_0x8ef1('0x15')]){if(_0x4536d6[_0x8ef1('0x15')][_0x8ef1('0x16')]===0x1f4){logger[_0x8ef1('0x15')](_0x8ef1('0x11'),_0x1ad5c3,_0x4536d6[_0x8ef1('0x15')][_0x8ef1('0x17')]);return _0x5828bf(_0x4536d6[_0x8ef1('0x15')][_0x8ef1('0x17')]);}logger[_0x8ef1('0x15')]('FaxInteraction,\x20%s,\x20%s',_0x1ad5c3,_0x4536d6['error'][_0x8ef1('0x17')]);return _0x520574(_0x4536d6[_0x8ef1('0x15')][_0x8ef1('0x17')]);}else{logger[_0x8ef1('0x18')](_0x8ef1('0x11'),_0x1ad5c3,'request\x20sent');_0x520574(_0x4536d6[_0x8ef1('0x19')][_0x8ef1('0x17')]);}})[_0x8ef1('0x1a')](function(_0x3ea715){logger['error'](_0x8ef1('0x11'),_0x1ad5c3,_0x3ea715);_0x5828bf(_0x3ea715);});});}exports[_0x8ef1('0x1b')]=function(_0x19c04b){var _0x5b50f4=this;return new Promise(function(_0x48dd29,_0x138a39){return db[_0x8ef1('0x1c')]['update'](_0x19c04b[_0x8ef1('0x1d')],{'raw':_0x19c04b[_0x8ef1('0x1e')]?_0x19c04b[_0x8ef1('0x1e')][_0x8ef1('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x19c04b[_0x8ef1('0x1e')]?_0x19c04b['options']['where']||null:null,'attributes':_0x19c04b[_0x8ef1('0x1e')]?_0x19c04b[_0x8ef1('0x1e')][_0x8ef1('0x20')]||null:null,'limit':_0x19c04b[_0x8ef1('0x1e')]?_0x19c04b[_0x8ef1('0x1e')][_0x8ef1('0x21')]||null:null})[_0x8ef1('0x10')](function(_0x205d68){logger[_0x8ef1('0x18')](_0x8ef1('0x1b'),_0x19c04b);logger[_0x8ef1('0x22')](_0x8ef1('0x1b'),_0x19c04b,JSON['stringify'](_0x205d68));_0x48dd29(_0x205d68);})[_0x8ef1('0x1a')](function(_0x38722b){logger['error'](_0x8ef1('0x1b'),_0x38722b[_0x8ef1('0x17')],_0x19c04b);_0x138a39(_0x5b50f4['error'](0x1f4,_0x38722b[_0x8ef1('0x17')]));});});};exports[_0x8ef1('0x23')]=function(_0x461e53){return new Promise(function(_0xa0dcea,_0x5e67ee){return db['FaxInteraction'][_0x8ef1('0x24')]({'where':_0x461e53[_0x8ef1('0x1e')]?_0x461e53[_0x8ef1('0x1e')][_0x8ef1('0x25')]||null:null})['then'](function(_0x3f04fa){if(_0x3f04fa){return _0x3f04fa[_0x8ef1('0x26')](_0x461e53[_0x8ef1('0x1d')][_0x8ef1('0x27')],_[_0x8ef1('0x28')](_0x461e53[_0x8ef1('0x1d')],[_0x8ef1('0x27'),'id'])||{});}})['spread'](function(_0x3a350a){logger[_0x8ef1('0x18')]('AddTags',_0x461e53);logger['debug']('AddTags',_0x461e53,JSON[_0x8ef1('0x14')](_0x3a350a));_0xa0dcea(_0x3a350a);})[_0x8ef1('0x1a')](function(_0x1c8794){logger[_0x8ef1('0x15')](_0x8ef1('0x29'),_0x1c8794[_0x8ef1('0x17')],_0x461e53);_0x5e67ee(_this[_0x8ef1('0x15')](0x1f4,_0x1c8794[_0x8ef1('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.socket.js b/server/api/faxInteraction/faxInteraction.socket.js index 24e94a5..4c14037 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 _0xd5bf=['./faxInteraction.events','save','remove','update','emit','removeListener','register','length','faxInteraction:'];(function(_0xe594d6,_0x241a38){var _0x1fdf8d=function(_0x212184){while(--_0x212184){_0xe594d6['push'](_0xe594d6['shift']());}};_0x1fdf8d(++_0x241a38);}(_0xd5bf,0x132));var _0xfd5b=function(_0x16c66d,_0x506b4c){_0x16c66d=_0x16c66d-0x0;var _0x3b0add=_0xd5bf[_0x16c66d];return _0x3b0add;};'use strict';var FaxInteractionEvents=require(_0xfd5b('0x0'));var events=[_0xfd5b('0x1'),_0xfd5b('0x2'),_0xfd5b('0x3')];function createListener(_0x159d12,_0x62f50a){return function(_0x56beca){_0x62f50a[_0xfd5b('0x4')](_0x159d12,_0x56beca);};}function removeListener(_0x59df40,_0x41b3f6){return function(){FaxInteractionEvents[_0xfd5b('0x5')](_0x59df40,_0x41b3f6);};}exports[_0xfd5b('0x6')]=function(_0x574604){for(var _0x4b7818=0x0,_0x1f8da4=events[_0xfd5b('0x7')];_0x4b7818<_0x1f8da4;_0x4b7818++){var _0xf747b2=events[_0x4b7818];var _0x561878=createListener(_0xfd5b('0x8')+_0xf747b2,_0x574604);FaxInteractionEvents['on'](_0xf747b2,_0x561878);}}; \ No newline at end of file +var _0x0905=['update','emit','removeListener','length','faxInteraction:','save','remove'];(function(_0x56cdfe,_0xc9c3a7){var _0x5a4388=function(_0x587d74){while(--_0x587d74){_0x56cdfe['push'](_0x56cdfe['shift']());}};_0x5a4388(++_0xc9c3a7);}(_0x0905,0x91));var _0x5090=function(_0xb102e6,_0x32ef09){_0xb102e6=_0xb102e6-0x0;var _0x5136ee=_0x0905[_0xb102e6];return _0x5136ee;};'use strict';var FaxInteractionEvents=require('./faxInteraction.events');var events=[_0x5090('0x0'),_0x5090('0x1'),_0x5090('0x2')];function createListener(_0x28ba8b,_0xce3c27){return function(_0x5f1c0b){_0xce3c27[_0x5090('0x3')](_0x28ba8b,_0x5f1c0b);};}function removeListener(_0x5837a8,_0x3e3e34){return function(){FaxInteractionEvents[_0x5090('0x4')](_0x5837a8,_0x3e3e34);};}exports['register']=function(_0x2a0e8c){for(var _0x53b5d5=0x0,_0x1b3ffe=events[_0x5090('0x5')];_0x53b5d5<_0x1b3ffe;_0x53b5d5++){var _0x1aabd1=events[_0x53b5d5];var _0x40f038=createListener(_0x5090('0x6')+_0x1aabd1,_0x2a0e8c);FaxInteractionEvents['on'](_0x1aabd1,_0x40f038);}}; \ No newline at end of file diff --git a/server/api/faxInteraction/index.js b/server/api/faxInteraction/index.js index e2288b2..11bee65 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 _0x89c7=['delete','removeTags','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxInteraction.controller','get','index','/describe','isAuthenticated','describe','/:id','show','/:id/messages','getMessages','download','post','create','addMessage','/:id/tags','tracked','faxinteraction:addtags','addTags','fax','update','faxinteraction:destroy','destroy'];(function(_0x322a46,_0x4ac56d){var _0xf1913f=function(_0x54879d){while(--_0x54879d){_0x322a46['push'](_0x322a46['shift']());}};_0xf1913f(++_0x4ac56d);}(_0x89c7,0x135));var _0x789c=function(_0x32c04b,_0x187085){_0x32c04b=_0x32c04b-0x0;var _0x2947b1=_0x89c7[_0x32c04b];return _0x2947b1;};'use strict';var multer=require(_0x789c('0x0'));var util=require(_0x789c('0x1'));var path=require(_0x789c('0x2'));var timeout=require(_0x789c('0x3'));var express=require('express');var router=express[_0x789c('0x4')]();var fs_extra=require(_0x789c('0x5'));var auth=require(_0x789c('0x6'));var interaction=require(_0x789c('0x7'));var config=require(_0x789c('0x8'));var controller=require(_0x789c('0x9'));router[_0x789c('0xa')]('/',auth['isAuthenticated'](),controller[_0x789c('0xb')]);router['get'](_0x789c('0xc'),auth[_0x789c('0xd')](),controller[_0x789c('0xe')]);router[_0x789c('0xa')](_0x789c('0xf'),auth[_0x789c('0xd')](),controller[_0x789c('0x10')]);router[_0x789c('0xa')](_0x789c('0x11'),auth[_0x789c('0xd')](),controller[_0x789c('0x12')]);router[_0x789c('0xa')]('/:id/download',auth[_0x789c('0xd')](),controller[_0x789c('0x13')]);router[_0x789c('0x14')]('/',auth[_0x789c('0xd')](),controller[_0x789c('0x15')]);router[_0x789c('0x14')](_0x789c('0x11'),auth[_0x789c('0xd')](),controller[_0x789c('0x16')]);router[_0x789c('0x14')](_0x789c('0x17'),auth[_0x789c('0xd')](),interaction[_0x789c('0x18')]('fax',_0x789c('0x19')),controller[_0x789c('0x1a')]);router['put'](_0x789c('0xf'),auth[_0x789c('0xd')](),interaction[_0x789c('0x18')](_0x789c('0x1b'),'faxinteraction:update'),controller[_0x789c('0x1c')]);router['delete'](_0x789c('0xf'),auth[_0x789c('0xd')](),interaction[_0x789c('0x18')](_0x789c('0x1b'),_0x789c('0x1d')),controller[_0x789c('0x1e')]);router[_0x789c('0x1f')]('/:id/tags',auth['isAuthenticated'](),controller[_0x789c('0x20')]);module[_0x789c('0x21')]=router; \ No newline at end of file +var _0xa3dc=['./faxInteraction.controller','get','isAuthenticated','index','describe','show','/:id/messages','/:id/download','download','post','create','addMessage','tracked','fax','faxinteraction:addtags','addTags','put','/:id','faxinteraction:update','delete','faxinteraction:destroy','removeTags','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x123cdb,_0x464a44){var _0xbf0938=function(_0x4a7edb){while(--_0x4a7edb){_0x123cdb['push'](_0x123cdb['shift']());}};_0xbf0938(++_0x464a44);}(_0xa3dc,0x1d6));var _0xca3d=function(_0x3bc997,_0x48a681){_0x3bc997=_0x3bc997-0x0;var _0xaf83fb=_0xa3dc[_0x3bc997];return _0xaf83fb;};'use strict';var multer=require(_0xca3d('0x0'));var util=require(_0xca3d('0x1'));var path=require(_0xca3d('0x2'));var timeout=require(_0xca3d('0x3'));var express=require(_0xca3d('0x4'));var router=express[_0xca3d('0x5')]();var fs_extra=require(_0xca3d('0x6'));var auth=require(_0xca3d('0x7'));var interaction=require(_0xca3d('0x8'));var config=require(_0xca3d('0x9'));var controller=require(_0xca3d('0xa'));router[_0xca3d('0xb')]('/',auth[_0xca3d('0xc')](),controller[_0xca3d('0xd')]);router[_0xca3d('0xb')]('/describe',auth[_0xca3d('0xc')](),controller[_0xca3d('0xe')]);router['get']('/:id',auth[_0xca3d('0xc')](),controller[_0xca3d('0xf')]);router['get'](_0xca3d('0x10'),auth[_0xca3d('0xc')](),controller['getMessages']);router[_0xca3d('0xb')](_0xca3d('0x11'),auth['isAuthenticated'](),controller[_0xca3d('0x12')]);router[_0xca3d('0x13')]('/',auth[_0xca3d('0xc')](),controller[_0xca3d('0x14')]);router[_0xca3d('0x13')](_0xca3d('0x10'),auth[_0xca3d('0xc')](),controller[_0xca3d('0x15')]);router[_0xca3d('0x13')]('/:id/tags',auth[_0xca3d('0xc')](),interaction[_0xca3d('0x16')](_0xca3d('0x17'),_0xca3d('0x18')),controller[_0xca3d('0x19')]);router[_0xca3d('0x1a')](_0xca3d('0x1b'),auth[_0xca3d('0xc')](),interaction[_0xca3d('0x16')](_0xca3d('0x17'),_0xca3d('0x1c')),controller['update']);router[_0xca3d('0x1d')](_0xca3d('0x1b'),auth[_0xca3d('0xc')](),interaction['tracked']('fax',_0xca3d('0x1e')),controller['destroy']);router['delete']('/:id/tags',auth[_0xca3d('0xc')](),controller[_0xca3d('0x1f')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.attributes.js b/server/api/faxMessage/faxMessage.attributes.js index 3263239..b20bb85 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 _0xe0c3=['ENUM','out','DATE','sequelize','TEXT','medium','BOOLEAN'];(function(_0x3bb359,_0x5ce40d){var _0x38d431=function(_0x2e3afd){while(--_0x2e3afd){_0x3bb359['push'](_0x3bb359['shift']());}};_0x38d431(++_0x5ce40d);}(_0xe0c3,0xea));var _0x3e0c=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xe0c3[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0x3e0c('0x0'));module['exports']={'body':{'type':Sequelize[_0x3e0c('0x1')](_0x3e0c('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x3e0c('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x3e0c('0x4')]('in',_0x3e0c('0x5')),'defaultValue':_0x3e0c('0x5'),'allowNull':![]},'failMessage':{'type':Sequelize[_0x3e0c('0x1')],'defaultValue':null},'readAt':{'type':Sequelize[_0x3e0c('0x6')]}}; \ No newline at end of file +var _0xaa19=['out','DATE','sequelize','exports','TEXT','medium','ENUM'];(function(_0xc4001c,_0x1bf8f0){var _0x49f7bc=function(_0x1059b8){while(--_0x1059b8){_0xc4001c['push'](_0xc4001c['shift']());}};_0x49f7bc(++_0x1bf8f0);}(_0xaa19,0x79));var _0x9aa1=function(_0x309759,_0x2a8e07){_0x309759=_0x309759-0x0;var _0x388668=_0xaa19[_0x309759];return _0x388668;};'use strict';var Sequelize=require(_0x9aa1('0x0'));module[_0x9aa1('0x1')]={'body':{'type':Sequelize[_0x9aa1('0x2')](_0x9aa1('0x3')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x9aa1('0x4')]('in','out'),'defaultValue':_0x9aa1('0x5'),'allowNull':![]},'failMessage':{'type':Sequelize['TEXT'],'defaultValue':null},'readAt':{'type':Sequelize[_0x9aa1('0x6')]}}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.controller.js b/server/api/faxMessage/faxMessage.controller.js index 92092ca..015536e 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 _0xaf79=['agent','get','FaxInteraction','FaxInteractionId','isNil','interaction','role','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','User','fullname','email','internal','manual','interface','SIP/%s','channel','motionChannel','event','accept','EventManager','reject','null','RejectMessage','rejectmessage','create','CmContact','findOne','AttachmentId','SendFax','/var/opt/motion2/server/files/attachments/%s','basename','download','join','root','server','files','attachments','Attachment','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','defaults','redis','socket.io-emitter','./faxMessage.socket','register','jayson/promise','client','http','request','then','FaxMessage,\x20%s,\x20%s','debug','FaxMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','stack','name','index','map','FaxMessage','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','filter','options','include','findAll','rows','show','rawAttributes','filters','find','body','params','destroy','describe','fax-interactions','fax','read','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user'];(function(_0x1eac9b,_0x24bf2f){var _0x33dfd6=function(_0x5ba3bc){while(--_0x5ba3bc){_0x1eac9b['push'](_0x1eac9b['shift']());}};_0x33dfd6(++_0x24bf2f);}(_0xaf79,0x1de));var _0x9af7=function(_0x47c485,_0x1f5759){_0x47c485=_0x47c485-0x0;var _0x579c46=_0xaf79[_0x47c485];return _0x579c46;};'use strict';var emlformat=require(_0x9af7('0x0'));var rimraf=require(_0x9af7('0x1'));var zipdir=require(_0x9af7('0x2'));var jsonpatch=require(_0x9af7('0x3'));var rp=require('request-promise');var moment=require(_0x9af7('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x9af7('0x5'));var util=require(_0x9af7('0x6'));var path=require(_0x9af7('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9af7('0x8'));var _=require(_0x9af7('0x9'));var squel=require(_0x9af7('0xa'));var crypto=require(_0x9af7('0xb'));var jsforce=require(_0x9af7('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x9af7('0xd'));var Papa=require(_0x9af7('0xe'));var Redis=require(_0x9af7('0xf'));var authService=require(_0x9af7('0x10'));var qs=require(_0x9af7('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x9af7('0x12'))(_0x9af7('0x13'));var utils=require(_0x9af7('0x14'));var config=require(_0x9af7('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config['redis']=_[_0x9af7('0x16')](config[_0x9af7('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0x9af7('0x18'))(new Redis(config[_0x9af7('0x17')]));require(_0x9af7('0x19'))[_0x9af7('0x1a')](socket);var jayson=require(_0x9af7('0x1b'));var client=jayson[_0x9af7('0x1c')]['http']({'port':0x232c});var client9002=jayson[_0x9af7('0x1c')][_0x9af7('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0xad92da,_0x4cc0ff,_0x9230e2,_0x58751c){return new BPromise(function(_0x2ccdd0,_0x28e0e4){var _0x422882=_0x58751c||client;return _0x422882[_0x9af7('0x1e')](_0xad92da,_0x9230e2)[_0x9af7('0x1f')](function(_0x488050){logger['info'](_0x9af7('0x20'),_0x4cc0ff,'request\x20sent');logger[_0x9af7('0x21')](_0x9af7('0x22'),_0x4cc0ff,_0x9af7('0x23'),JSON[_0x9af7('0x24')](_0x488050));if(_0x488050[_0x9af7('0x25')]){if(_0x488050['error'][_0x9af7('0x26')]===0x1f4){logger[_0x9af7('0x25')](_0x9af7('0x20'),_0x4cc0ff,_0x488050[_0x9af7('0x25')][_0x9af7('0x27')]);return _0x28e0e4(_0x488050[_0x9af7('0x25')]['message']);}logger[_0x9af7('0x25')](_0x9af7('0x20'),_0x4cc0ff,_0x488050[_0x9af7('0x25')][_0x9af7('0x27')]);return _0x2ccdd0(_0x488050[_0x9af7('0x25')][_0x9af7('0x27')]);}else{logger[_0x9af7('0x28')](_0x9af7('0x20'),_0x4cc0ff,_0x9af7('0x23'));_0x2ccdd0(_0x488050[_0x9af7('0x29')][_0x9af7('0x27')]);}})[_0x9af7('0x2a')](function(_0x46b348){logger[_0x9af7('0x25')](_0x9af7('0x20'),_0x4cc0ff,_0x46b348);_0x28e0e4(_0x46b348);});});}function respondWithStatusCode(_0x586724,_0x1e549c){_0x1e549c=_0x1e549c||0xcc;return function(_0x20858a){if(_0x20858a){return _0x586724[_0x9af7('0x2b')](_0x1e549c);}return _0x586724[_0x9af7('0x2c')](_0x1e549c)[_0x9af7('0x2d')]();};}function respondWithResult(_0xd5eda2,_0x612da){_0x612da=_0x612da||0xc8;return function(_0x4768c5){if(_0x4768c5){return _0xd5eda2['status'](_0x612da)[_0x9af7('0x2e')](_0x4768c5);}};}function respondWithFilteredResult(_0x10f3bd,_0xdd168){return function(_0x37155f){if(_0x37155f){var _0x1a27f6=typeof _0xdd168[_0x9af7('0x2f')]===_0x9af7('0x30')&&typeof _0xdd168[_0x9af7('0x31')]==='undefined';var _0x704f17=_0x37155f[_0x9af7('0x32')];var _0xe9fc89=_0x1a27f6?0x0:_0xdd168[_0x9af7('0x2f')];var _0x25660b=_0x1a27f6?_0x37155f[_0x9af7('0x32')]:_0xdd168['offset']+_0xdd168[_0x9af7('0x31')];var _0x4e656f;if(_0x25660b>=_0x704f17){_0x25660b=_0x704f17;_0x4e656f=0xc8;}else{_0x4e656f=0xce;}_0x10f3bd[_0x9af7('0x2c')](_0x4e656f);return _0x10f3bd[_0x9af7('0x33')](_0x9af7('0x34'),_0xe9fc89+'-'+_0x25660b+'/'+_0x704f17)[_0x9af7('0x2e')](_0x37155f);}return null;};}function patchUpdates(_0x17a44c){return function(_0x170ab2){try{jsonpatch[_0x9af7('0x35')](_0x170ab2,_0x17a44c,!![]);}catch(_0x49084f){return BPromise['reject'](_0x49084f);}return _0x170ab2[_0x9af7('0x36')]();};}function saveUpdates(_0xa75c0d,_0x5f2d61){return function(_0x314c67){if(_0x314c67){return _0x314c67[_0x9af7('0x37')](_0xa75c0d)['then'](function(_0x445cbd){return _0x445cbd;});}return null;};}function removeEntity(_0x418bab,_0x519cc7){return function(_0x32435b){if(_0x32435b){return _0x32435b['destroy']()['then'](function(){_0x418bab[_0x9af7('0x2c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3e0c3b,_0x2ea3e5){return function(_0x333ee5){if(!_0x333ee5){_0x3e0c3b[_0x9af7('0x2b')](0x194);}return _0x333ee5;};}function handleError(_0x2bc3bc,_0x45146d){_0x45146d=_0x45146d||0x1f4;return function(_0x5419a9){logger[_0x9af7('0x25')](_0x5419a9[_0x9af7('0x38')]);if(_0x5419a9[_0x9af7('0x39')]){delete _0x5419a9[_0x9af7('0x39')];}_0x2bc3bc[_0x9af7('0x2c')](_0x45146d)['send'](_0x5419a9);};}exports[_0x9af7('0x3a')]=function(_0x265b71,_0x72256d){var _0x153600={},_0x16d487={},_0x36ae25={'count':0x0,'rows':[]};var _0x3db1ed=_[_0x9af7('0x3b')](db[_0x9af7('0x3c')]['rawAttributes'],function(_0x34b1b7){return{'name':_0x34b1b7[_0x9af7('0x3d')],'type':_0x34b1b7[_0x9af7('0x3e')][_0x9af7('0x3f')]};});_0x16d487[_0x9af7('0x40')]=_[_0x9af7('0x3b')](_0x3db1ed,_0x9af7('0x39'));_0x16d487[_0x9af7('0x41')]=_[_0x9af7('0x42')](_0x265b71[_0x9af7('0x41')]);_0x16d487['filters']=_[_0x9af7('0x43')](_0x16d487[_0x9af7('0x40')],_0x16d487[_0x9af7('0x41')]);_0x153600[_0x9af7('0x44')]=_[_0x9af7('0x43')](_0x16d487[_0x9af7('0x40')],qs[_0x9af7('0x45')](_0x265b71['query'][_0x9af7('0x45')]));_0x153600[_0x9af7('0x44')]=_0x153600[_0x9af7('0x44')][_0x9af7('0x46')]?_0x153600['attributes']:_0x16d487[_0x9af7('0x40')];if(!_0x265b71[_0x9af7('0x41')][_0x9af7('0x47')](_0x9af7('0x48'))){_0x153600['limit']=qs[_0x9af7('0x31')](_0x265b71[_0x9af7('0x41')][_0x9af7('0x31')]);_0x153600[_0x9af7('0x2f')]=qs[_0x9af7('0x2f')](_0x265b71['query']['offset']);}_0x153600['order']=qs[_0x9af7('0x49')](_0x265b71[_0x9af7('0x41')]['sort']);_0x153600[_0x9af7('0x4a')]=qs['filters'](_[_0x9af7('0x4b')](_0x265b71[_0x9af7('0x41')],_0x16d487['filters']),_0x3db1ed);if(_0x265b71[_0x9af7('0x41')]['filter']){_0x153600[_0x9af7('0x4a')]=_[_0x9af7('0x4c')](_0x153600[_0x9af7('0x4a')],{'$or':_[_0x9af7('0x3b')](_0x3db1ed,function(_0x3ebef3){if(_0x3ebef3['type']!==_0x9af7('0x4d')){var _0x812188={};_0x812188[_0x3ebef3[_0x9af7('0x39')]]={'$like':'%'+_0x265b71['query'][_0x9af7('0x4e')]+'%'};return _0x812188;}})});}_0x153600=_[_0x9af7('0x4c')]({},_0x153600,_0x265b71[_0x9af7('0x4f')]);var _0x24c2a2={'where':_0x153600[_0x9af7('0x4a')]};return db[_0x9af7('0x3c')]['count'](_0x24c2a2)[_0x9af7('0x1f')](function(_0x38d734){_0x36ae25[_0x9af7('0x32')]=_0x38d734;if(_0x265b71[_0x9af7('0x41')]['includeAll']){_0x153600[_0x9af7('0x50')]=[{'all':!![]}];}return db[_0x9af7('0x3c')][_0x9af7('0x51')](_0x153600);})[_0x9af7('0x1f')](function(_0x3ab08f){_0x36ae25[_0x9af7('0x52')]=_0x3ab08f;return _0x36ae25;})[_0x9af7('0x1f')](respondWithFilteredResult(_0x72256d,_0x153600))['catch'](handleError(_0x72256d,null));};exports[_0x9af7('0x53')]=function(_0x18cc34,_0x3a5b7e){var _0x3c00c4={'raw':!![],'where':{'id':_0x18cc34['params']['id']}},_0x229468={};_0x229468[_0x9af7('0x40')]=_['keys'](db[_0x9af7('0x3c')][_0x9af7('0x54')]);_0x229468[_0x9af7('0x41')]=_[_0x9af7('0x42')](_0x18cc34[_0x9af7('0x41')]);_0x229468[_0x9af7('0x55')]=_[_0x9af7('0x43')](_0x229468['model'],_0x229468[_0x9af7('0x41')]);_0x3c00c4['attributes']=_[_0x9af7('0x43')](_0x229468[_0x9af7('0x40')],qs[_0x9af7('0x45')](_0x18cc34[_0x9af7('0x41')]['fields']));_0x3c00c4[_0x9af7('0x44')]=_0x3c00c4['attributes'][_0x9af7('0x46')]?_0x3c00c4['attributes']:_0x229468[_0x9af7('0x40')];if(_0x18cc34[_0x9af7('0x41')]['includeAll']){_0x3c00c4[_0x9af7('0x50')]=[{'all':!![]}];}_0x3c00c4=_['merge']({},_0x3c00c4,_0x18cc34['options']);return db[_0x9af7('0x3c')][_0x9af7('0x56')](_0x3c00c4)['then'](handleEntityNotFound(_0x3a5b7e,null))[_0x9af7('0x1f')](respondWithResult(_0x3a5b7e,null))[_0x9af7('0x2a')](handleError(_0x3a5b7e,null));};exports['update']=function(_0x186885,_0x11d8c1){if(_0x186885['body']['id']){delete _0x186885[_0x9af7('0x57')]['id'];}return db[_0x9af7('0x3c')][_0x9af7('0x56')]({'where':{'id':_0x186885[_0x9af7('0x58')]['id']}})['then'](handleEntityNotFound(_0x11d8c1,null))[_0x9af7('0x1f')](saveUpdates(_0x186885['body'],null))[_0x9af7('0x1f')](respondWithResult(_0x11d8c1,null))[_0x9af7('0x2a')](handleError(_0x11d8c1,null));};exports[_0x9af7('0x59')]=function(_0x2b3307,_0x1165ee){return db['FaxMessage'][_0x9af7('0x56')]({'where':{'id':_0x2b3307[_0x9af7('0x58')]['id']}})[_0x9af7('0x1f')](handleEntityNotFound(_0x1165ee,null))['then'](removeEntity(_0x1165ee,null))['catch'](handleError(_0x1165ee,null));};exports[_0x9af7('0x5a')]=function(_0x12871c,_0x1a5050){return db[_0x9af7('0x3c')][_0x9af7('0x5a')]()['then'](respondWithResult(_0x1a5050,null))[_0x9af7('0x2a')](handleError(_0x1a5050,null));};var interaction_log=require('../../config/logger')(_0x9af7('0x5b'));exports['accept']=function(_0xf323a0,_0x4177eb,_0x1887a3){var _0x40079f={'agent':{},'channel':_0x9af7('0x5c')};if(_0xf323a0[_0x9af7('0x57')]['id']){delete _0xf323a0[_0x9af7('0x57')]['id'];}_0xf323a0[_0x9af7('0x57')][_0x9af7('0x5d')]=!![];_0xf323a0[_0x9af7('0x57')]['readAt']=moment()[_0x9af7('0x5e')](_0x9af7('0x5f'));_0xf323a0[_0x9af7('0x57')][_0x9af7('0x60')]=_0xf323a0[_0x9af7('0x57')][_0x9af7('0x60')]||_0xf323a0[_0x9af7('0x61')]['id'];_0x40079f[_0x9af7('0x62')]['id']=_0xf323a0[_0x9af7('0x57')]['UserId'];return db[_0x9af7('0x3c')][_0x9af7('0x56')]({'where':{'id':_0xf323a0[_0x9af7('0x58')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x4177eb,null))[_0x9af7('0x1f')](saveUpdates(_0xf323a0[_0x9af7('0x57')],null))[_0x9af7('0x1f')](function(_0x4d76f5){if(_0x4d76f5){_0x40079f[_0x9af7('0x27')]=_0x4d76f5[_0x9af7('0x63')]({'plain':!![]});return db[_0x9af7('0x64')][_0x9af7('0x56')]({'where':{'id':_0x4d76f5[_0x9af7('0x65')]}});}return null;})[_0x9af7('0x1f')](handleEntityNotFound(_0x4177eb,null))[_0x9af7('0x1f')](function(_0x4830ce){if(_0x4830ce){return _0x4830ce[_0x9af7('0x37')]({'UserId':_0xf323a0['body'][_0x9af7('0x60')],'read1stAt':_[_0x9af7('0x66')](_0x4830ce['read1stAt'])?moment()[_0x9af7('0x5e')](_0x9af7('0x5f')):undefined});}return null;})[_0x9af7('0x1f')](function(_0xb3b6d1){if(_0xb3b6d1){_0x40079f[_0x9af7('0x67')]=_0xb3b6d1[_0x9af7('0x63')]({'plain':!![]});interaction_log[_0x9af7('0x28')]('[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0xf323a0[_0x9af7('0x61')]['id'],_0xf323a0[_0x9af7('0x61')]['name'],_0xf323a0[_0x9af7('0x61')][_0x9af7('0x68')],_0x40079f[_0x9af7('0x67')]['id'],_0xf323a0[_0x9af7('0x57')]?JSON[_0x9af7('0x24')](_0xf323a0[_0x9af7('0x57')]):'null');return respondWithRpcPromise(_0x9af7('0x69'),_0x9af7('0x6a'),_0x40079f);}return null;})[_0x9af7('0x1f')](function(_0x3ff9a9){var _0x35c8b1=_0x9af7('0x6b')+_0x3ff9a9[_0x9af7('0x27')][_0x9af7('0x6c')];return db[_0x9af7('0x6d')][_0x9af7('0x41')](_0x35c8b1,{'type':db[_0x9af7('0x6e')][_0x9af7('0x6f')][_0x9af7('0x70')],'raw':!![]})['then'](function(_0x42ea32){return _0x42ea32;});})[_0x9af7('0x1f')](function(_0x18441e){if(_0x18441e){_0x40079f['message'][_0x9af7('0x71')]=_0x18441e[0x0];if(!_0xf323a0[_0x9af7('0x57')][_0x9af7('0x60')])return;return db[_0x9af7('0x72')][_0x9af7('0x56')]({'where':{'id':_0xf323a0[_0x9af7('0x57')][_0x9af7('0x60')],'role':'agent'},'attributes':['id',_0x9af7('0x39'),_0x9af7('0x73'),_0x9af7('0x74'),_0x9af7('0x75')],'raw':!![]});}return null;})[_0x9af7('0x1f')](function(_0x34855f){if(!_0x34855f)return null;_0x40079f[_0x9af7('0x27')]['agent']=_0x34855f;return _0x40079f;})[_0x9af7('0x1f')](function(_0x16ef48){if(_0x16ef48){if(_0xf323a0[_0x9af7('0x57')][_0x9af7('0x76')]){_0x40079f[_0x9af7('0x27')][_0x9af7('0x77')]=util[_0x9af7('0x5e')](_0x9af7('0x78'),_0xf323a0[_0x9af7('0x61')][_0x9af7('0x39')]);_0x40079f[_0x9af7('0x27')][_0x9af7('0x79')]=_0x40079f[_0x9af7('0x79')];_0x40079f[_0x9af7('0x27')][_0x9af7('0x7a')]=_0x40079f[_0x9af7('0x79')];_0x40079f[_0x9af7('0x27')][_0x9af7('0x7b')]=_0x9af7('0x7c');return respondWithRpcPromise(_0x9af7('0x7d'),_0x9af7('0x7d'),{'event':'acceptmessage','message':_0x40079f[_0x9af7('0x27')]},client9002)[_0x9af7('0x1f')](function(){return _0x40079f;});}return _0x40079f;}return null;})[_0x9af7('0x1f')](respondWithResult(_0x4177eb,null))[_0x9af7('0x2a')](handleError(_0x4177eb,null));};var interaction_log=require(_0x9af7('0x12'))('fax-interactions');exports[_0x9af7('0x7e')]=function(_0x480d33,_0x377f61,_0x3800b6){var _0x234e91={'agent':{},'channel':'fax'};if(_0x480d33[_0x9af7('0x57')]['id']){delete _0x480d33[_0x9af7('0x57')]['id'];}_0x480d33[_0x9af7('0x57')][_0x9af7('0x60')]=_0x480d33[_0x9af7('0x57')]['UserId']||_0x480d33[_0x9af7('0x61')]['id'];_0x234e91[_0x9af7('0x62')]['id']=_0x480d33[_0x9af7('0x57')][_0x9af7('0x60')];return db[_0x9af7('0x3c')][_0x9af7('0x56')]({'where':{'id':_0x480d33[_0x9af7('0x58')]['id'],'UserId':null}})[_0x9af7('0x1f')](handleEntityNotFound(_0x377f61,null))['then'](function(_0x211925){if(_0x211925){_0x234e91[_0x9af7('0x27')]=_0x211925['get']({'plain':!![]});return db[_0x9af7('0x64')][_0x9af7('0x56')]({'where':{'id':_0x211925[_0x9af7('0x65')]}});}return null;})[_0x9af7('0x1f')](handleEntityNotFound(_0x377f61,null))[_0x9af7('0x1f')](function(_0x2aae6c){if(_0x2aae6c){_0x234e91[_0x9af7('0x67')]=_0x2aae6c[_0x9af7('0x63')]({'plain':!![]});interaction_log[_0x9af7('0x28')]('[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x480d33[_0x9af7('0x61')]['id'],_0x480d33['user'][_0x9af7('0x39')],_0x480d33[_0x9af7('0x61')]['role'],_0x234e91['interaction']['id'],_0x480d33[_0x9af7('0x57')]?JSON[_0x9af7('0x24')](_0x480d33['body']):_0x9af7('0x7f'));return respondWithRpcPromise(_0x9af7('0x80'),'rejectMessage',_0x234e91);}return null;})['then'](function(_0x1e65c8){var _0x519545=_0x9af7('0x6b')+_0x1e65c8[_0x9af7('0x27')][_0x9af7('0x6c')];return db[_0x9af7('0x6d')]['query'](_0x519545,{'type':db['Sequelize'][_0x9af7('0x6f')]['SELECT'],'raw':!![]})[_0x9af7('0x1f')](function(_0x200363){return _0x200363;});})[_0x9af7('0x1f')](function(_0x24d2ca){if(_0x24d2ca){_0x234e91[_0x9af7('0x27')]['contact']=_0x24d2ca[0x0];if(!_0x480d33[_0x9af7('0x57')][_0x9af7('0x60')])return;return db[_0x9af7('0x72')][_0x9af7('0x56')]({'where':{'id':_0x480d33[_0x9af7('0x57')][_0x9af7('0x60')],'role':_0x9af7('0x62')},'attributes':['id',_0x9af7('0x39'),_0x9af7('0x73'),'email',_0x9af7('0x75')],'raw':!![]});}return null;})[_0x9af7('0x1f')](function(_0x3c5ce9){if(!_0x3c5ce9)return null;_0x234e91[_0x9af7('0x27')]['agent']=_0x3c5ce9;return _0x234e91;})['then'](function(_0x5430ee){if(_0x5430ee){_0x5430ee[_0x9af7('0x27')][_0x9af7('0x77')]=util[_0x9af7('0x5e')](_0x9af7('0x78'),_0x480d33[_0x9af7('0x61')][_0x9af7('0x39')]);_0x5430ee['message'][_0x9af7('0x79')]=_0x234e91['channel'];_0x5430ee['message'][_0x9af7('0x7a')]=_0x234e91[_0x9af7('0x79')];_0x5430ee[_0x9af7('0x27')][_0x9af7('0x7b')]='reject';respondWithRpcPromise('EventManager',_0x9af7('0x7d'),{'event':_0x9af7('0x81'),'message':_0x5430ee[_0x9af7('0x27')]},client9002);return _0x234e91;}return null;})['then'](respondWithResult(_0x377f61,null))[_0x9af7('0x2a')](handleError(_0x377f61,null));};exports['create']=function(_0x46778d,_0x1879e1){var _0x48339e;return db[_0x9af7('0x3c')][_0x9af7('0x82')](_0x46778d[_0x9af7('0x57')],{})[_0x9af7('0x1f')](function(_0x50ccf3){_0x48339e=_0x50ccf3;return db[_0x9af7('0x83')][_0x9af7('0x84')]({'where':{'id':_0x48339e['ContactId']}});})[_0x9af7('0x1f')](function(_0x427d18){if(_[_0x9af7('0x66')](_0x427d18)){return;}else{_0x48339e[_0x9af7('0x5c')]=_0x427d18[_0x9af7('0x5c')];return db['Attachment'][_0x9af7('0x84')]({'where':{'id':_0x48339e[_0x9af7('0x85')]}});}})[_0x9af7('0x1f')](function(_0x18c32e){return respondWithRpcPromise(_0x9af7('0x86'),_0x9af7('0x86'),{'FaxAccountId':_[_0x9af7('0x66')](_0x46778d[_0x9af7('0x57')])?undefined:_0x46778d['body']['FaxAccountId'],'path':_[_0x9af7('0x66')](_0x18c32e)?undefined:util['format'](_0x9af7('0x87'),_0x18c32e[_0x9af7('0x88')]),'fax':_['isNil'](_0x48339e[_0x9af7('0x5c')])?undefined:_0x48339e['fax'],'AttachmentId':_0x48339e[_0x9af7('0x85')]},client9002);})[_0x9af7('0x1f')](respondWithResult(_0x1879e1,0xc9))['catch'](handleError(_0x1879e1,null));};exports[_0x9af7('0x89')]=function(_0x5046e8,_0x31b762){var _0x3ce45c=path[_0x9af7('0x8a')](config[_0x9af7('0x8b')],_0x9af7('0x8c'),_0x9af7('0x8d'),_0x9af7('0x8e'));return db['FaxMessage']['find']({'where':{'id':_0x5046e8[_0x9af7('0x58')]['id']},'include':[{'model':db[_0x9af7('0x8f')],'as':_0x9af7('0x8f')}]})[_0x9af7('0x1f')](handleEntityNotFound(_0x31b762,null))['then'](function(_0x14bdc6){if(_0x14bdc6){return _0x31b762[_0x9af7('0x89')](path[_0x9af7('0x8a')](_0x3ce45c,_0x14bdc6[_0x9af7('0x8f')]['basename']));}})[_0x9af7('0x2a')](handleError(_0x31b762,null));}; \ No newline at end of file +var _0x5818=['name','index','map','FaxMessage','rawAttributes','fieldName','type','key','model','query','attributes','intersection','fields','length','nolimit','limit','order','sort','where','filters','pick','filter','merge','VIRTUAL','includeAll','findAll','rows','show','params','keys','options','find','body','fax-interactions','accept','fax','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','FaxInteraction','isNil','read1stAt','interaction','[FAXMESSAGE: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','QueryTypes','SELECT','contact','fullname','email','interface','SIP/%s','channel','motionChannel','event','EventManager','FaxInteractionId','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','Sequelize','internal','rejectmessage','create','CmContact','findOne','SendFax','FaxAccountId','/var/opt/motion2/server/files/attachments/%s','basename','AttachmentId','download','join','root','server','files','attachments','Attachment','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','ioredis','../../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','./faxMessage.socket','register','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','code','FaxMessage,\x20%s,\x20%s','message','result','catch','sendStatus','status','json','offset','undefined','count','set','Content-Range','apply','reject','save','update','destroy','stack'];(function(_0x495c65,_0x219ebf){var _0x3fc432=function(_0x16a734){while(--_0x16a734){_0x495c65['push'](_0x495c65['shift']());}};_0x3fc432(++_0x219ebf);}(_0x5818,0x17e));var _0x8581=function(_0x40ac12,_0x43ea9f){_0x40ac12=_0x40ac12-0x0;var _0x33b6b0=_0x5818[_0x40ac12];return _0x33b6b0;};'use strict';var emlformat=require(_0x8581('0x0'));var rimraf=require(_0x8581('0x1'));var zipdir=require(_0x8581('0x2'));var jsonpatch=require(_0x8581('0x3'));var rp=require(_0x8581('0x4'));var moment=require(_0x8581('0x5'));var BPromise=require(_0x8581('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x8581('0x7'));var sox=require(_0x8581('0x8'));var csv=require(_0x8581('0x9'));var ejs=require(_0x8581('0xa'));var fs=require('fs');var fs_extra=require(_0x8581('0xb'));var _=require('lodash');var squel=require(_0x8581('0xc'));var crypto=require('crypto');var jsforce=require(_0x8581('0xd'));var deskjs=require(_0x8581('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x8581('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x8581('0x10'));var as=require(_0x8581('0x11'));var hardwareService=require(_0x8581('0x12'));var logger=require(_0x8581('0x13'))(_0x8581('0x14'));var utils=require(_0x8581('0x15'));var config=require(_0x8581('0x16'));var licenseUtil=require(_0x8581('0x17'));var db=require('../../mysqldb')['db'];config[_0x8581('0x18')]=_[_0x8581('0x19')](config[_0x8581('0x18')],{'host':_0x8581('0x1a'),'port':0x18eb});var socket=require(_0x8581('0x1b'))(new Redis(config[_0x8581('0x18')]));require(_0x8581('0x1c'))[_0x8581('0x1d')](socket);var jayson=require(_0x8581('0x1e'));var client=jayson[_0x8581('0x1f')][_0x8581('0x20')]({'port':0x232c});var client9002=jayson['client'][_0x8581('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x5783f4,_0xaf6b5c,_0x294753,_0x364f7e){return new BPromise(function(_0x31dbb3,_0x20eec9){var _0xaae931=_0x364f7e||client;return _0xaae931[_0x8581('0x21')](_0x5783f4,_0x294753)[_0x8581('0x22')](function(_0x2f7a2a){logger[_0x8581('0x23')]('FaxMessage,\x20%s,\x20%s',_0xaf6b5c,_0x8581('0x24'));logger[_0x8581('0x25')]('FaxMessage,\x20%s,\x20%s,\x20%s',_0xaf6b5c,_0x8581('0x24'),JSON[_0x8581('0x26')](_0x2f7a2a));if(_0x2f7a2a[_0x8581('0x27')]){if(_0x2f7a2a[_0x8581('0x27')][_0x8581('0x28')]===0x1f4){logger[_0x8581('0x27')](_0x8581('0x29'),_0xaf6b5c,_0x2f7a2a[_0x8581('0x27')]['message']);return _0x20eec9(_0x2f7a2a['error'][_0x8581('0x2a')]);}logger[_0x8581('0x27')](_0x8581('0x29'),_0xaf6b5c,_0x2f7a2a[_0x8581('0x27')][_0x8581('0x2a')]);return _0x31dbb3(_0x2f7a2a['error']['message']);}else{logger['info'](_0x8581('0x29'),_0xaf6b5c,_0x8581('0x24'));_0x31dbb3(_0x2f7a2a[_0x8581('0x2b')]['message']);}})[_0x8581('0x2c')](function(_0x2e7829){logger[_0x8581('0x27')](_0x8581('0x29'),_0xaf6b5c,_0x2e7829);_0x20eec9(_0x2e7829);});});}function respondWithStatusCode(_0x3f2d37,_0x40b381){_0x40b381=_0x40b381||0xcc;return function(_0x4bf0c5){if(_0x4bf0c5){return _0x3f2d37[_0x8581('0x2d')](_0x40b381);}return _0x3f2d37[_0x8581('0x2e')](_0x40b381)['end']();};}function respondWithResult(_0x7ea7a5,_0x346b42){_0x346b42=_0x346b42||0xc8;return function(_0x1d2e42){if(_0x1d2e42){return _0x7ea7a5[_0x8581('0x2e')](_0x346b42)[_0x8581('0x2f')](_0x1d2e42);}};}function respondWithFilteredResult(_0x3541ec,_0x27ea89){return function(_0x40fef7){if(_0x40fef7){var _0x37b733=typeof _0x27ea89[_0x8581('0x30')]===_0x8581('0x31')&&typeof _0x27ea89['limit']==='undefined';var _0x1cad14=_0x40fef7[_0x8581('0x32')];var _0x34ba26=_0x37b733?0x0:_0x27ea89[_0x8581('0x30')];var _0x58a9f2=_0x37b733?_0x40fef7[_0x8581('0x32')]:_0x27ea89['offset']+_0x27ea89['limit'];var _0x501c13;if(_0x58a9f2>=_0x1cad14){_0x58a9f2=_0x1cad14;_0x501c13=0xc8;}else{_0x501c13=0xce;}_0x3541ec[_0x8581('0x2e')](_0x501c13);return _0x3541ec[_0x8581('0x33')](_0x8581('0x34'),_0x34ba26+'-'+_0x58a9f2+'/'+_0x1cad14)[_0x8581('0x2f')](_0x40fef7);}return null;};}function patchUpdates(_0x3122a1){return function(_0x2984f4){try{jsonpatch[_0x8581('0x35')](_0x2984f4,_0x3122a1,!![]);}catch(_0x1a9676){return BPromise[_0x8581('0x36')](_0x1a9676);}return _0x2984f4[_0x8581('0x37')]();};}function saveUpdates(_0x51405b,_0x5f0892){return function(_0x522a9f){if(_0x522a9f){return _0x522a9f[_0x8581('0x38')](_0x51405b)[_0x8581('0x22')](function(_0x64c05c){return _0x64c05c;});}return null;};}function removeEntity(_0x4760e4,_0x35f878){return function(_0x1603ec){if(_0x1603ec){return _0x1603ec[_0x8581('0x39')]()[_0x8581('0x22')](function(){_0x4760e4[_0x8581('0x2e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4803b3,_0x11f129){return function(_0x134874){if(!_0x134874){_0x4803b3['sendStatus'](0x194);}return _0x134874;};}function handleError(_0x3716a4,_0x3e43a0){_0x3e43a0=_0x3e43a0||0x1f4;return function(_0x44a44c){logger['error'](_0x44a44c[_0x8581('0x3a')]);if(_0x44a44c[_0x8581('0x3b')]){delete _0x44a44c[_0x8581('0x3b')];}_0x3716a4['status'](_0x3e43a0)['send'](_0x44a44c);};}exports[_0x8581('0x3c')]=function(_0x4c7761,_0xd6959f){var _0x39497a={},_0x12a1ef={},_0x4db05a={'count':0x0,'rows':[]};var _0x2f662f=_[_0x8581('0x3d')](db[_0x8581('0x3e')][_0x8581('0x3f')],function(_0x35b0a0){return{'name':_0x35b0a0[_0x8581('0x40')],'type':_0x35b0a0[_0x8581('0x41')][_0x8581('0x42')]};});_0x12a1ef[_0x8581('0x43')]=_[_0x8581('0x3d')](_0x2f662f,_0x8581('0x3b'));_0x12a1ef[_0x8581('0x44')]=_['keys'](_0x4c7761[_0x8581('0x44')]);_0x12a1ef['filters']=_['intersection'](_0x12a1ef['model'],_0x12a1ef[_0x8581('0x44')]);_0x39497a[_0x8581('0x45')]=_[_0x8581('0x46')](_0x12a1ef[_0x8581('0x43')],qs[_0x8581('0x47')](_0x4c7761['query'][_0x8581('0x47')]));_0x39497a[_0x8581('0x45')]=_0x39497a[_0x8581('0x45')][_0x8581('0x48')]?_0x39497a[_0x8581('0x45')]:_0x12a1ef[_0x8581('0x43')];if(!_0x4c7761[_0x8581('0x44')]['hasOwnProperty'](_0x8581('0x49'))){_0x39497a['limit']=qs[_0x8581('0x4a')](_0x4c7761[_0x8581('0x44')][_0x8581('0x4a')]);_0x39497a[_0x8581('0x30')]=qs[_0x8581('0x30')](_0x4c7761['query'][_0x8581('0x30')]);}_0x39497a[_0x8581('0x4b')]=qs[_0x8581('0x4c')](_0x4c7761['query'][_0x8581('0x4c')]);_0x39497a[_0x8581('0x4d')]=qs[_0x8581('0x4e')](_[_0x8581('0x4f')](_0x4c7761[_0x8581('0x44')],_0x12a1ef[_0x8581('0x4e')]),_0x2f662f);if(_0x4c7761[_0x8581('0x44')][_0x8581('0x50')]){_0x39497a[_0x8581('0x4d')]=_[_0x8581('0x51')](_0x39497a['where'],{'$or':_[_0x8581('0x3d')](_0x2f662f,function(_0x165444){if(_0x165444['type']!==_0x8581('0x52')){var _0x404412={};_0x404412[_0x165444[_0x8581('0x3b')]]={'$like':'%'+_0x4c7761[_0x8581('0x44')]['filter']+'%'};return _0x404412;}})});}_0x39497a=_[_0x8581('0x51')]({},_0x39497a,_0x4c7761['options']);var _0x4f0d88={'where':_0x39497a['where']};return db[_0x8581('0x3e')]['count'](_0x4f0d88)[_0x8581('0x22')](function(_0x14e7c6){_0x4db05a[_0x8581('0x32')]=_0x14e7c6;if(_0x4c7761['query'][_0x8581('0x53')]){_0x39497a['include']=[{'all':!![]}];}return db[_0x8581('0x3e')][_0x8581('0x54')](_0x39497a);})[_0x8581('0x22')](function(_0x98504a){_0x4db05a[_0x8581('0x55')]=_0x98504a;return _0x4db05a;})[_0x8581('0x22')](respondWithFilteredResult(_0xd6959f,_0x39497a))[_0x8581('0x2c')](handleError(_0xd6959f,null));};exports[_0x8581('0x56')]=function(_0x3453ab,_0x39db2d){var _0x2fa363={'raw':!![],'where':{'id':_0x3453ab[_0x8581('0x57')]['id']}},_0x46e684={};_0x46e684['model']=_[_0x8581('0x58')](db[_0x8581('0x3e')][_0x8581('0x3f')]);_0x46e684[_0x8581('0x44')]=_[_0x8581('0x58')](_0x3453ab[_0x8581('0x44')]);_0x46e684['filters']=_['intersection'](_0x46e684[_0x8581('0x43')],_0x46e684[_0x8581('0x44')]);_0x2fa363['attributes']=_[_0x8581('0x46')](_0x46e684[_0x8581('0x43')],qs[_0x8581('0x47')](_0x3453ab[_0x8581('0x44')][_0x8581('0x47')]));_0x2fa363['attributes']=_0x2fa363[_0x8581('0x45')][_0x8581('0x48')]?_0x2fa363['attributes']:_0x46e684[_0x8581('0x43')];if(_0x3453ab[_0x8581('0x44')][_0x8581('0x53')]){_0x2fa363['include']=[{'all':!![]}];}_0x2fa363=_[_0x8581('0x51')]({},_0x2fa363,_0x3453ab[_0x8581('0x59')]);return db['FaxMessage'][_0x8581('0x5a')](_0x2fa363)[_0x8581('0x22')](handleEntityNotFound(_0x39db2d,null))[_0x8581('0x22')](respondWithResult(_0x39db2d,null))['catch'](handleError(_0x39db2d,null));};exports[_0x8581('0x38')]=function(_0x134b6b,_0x17f839){if(_0x134b6b['body']['id']){delete _0x134b6b[_0x8581('0x5b')]['id'];}return db[_0x8581('0x3e')]['find']({'where':{'id':_0x134b6b['params']['id']}})[_0x8581('0x22')](handleEntityNotFound(_0x17f839,null))[_0x8581('0x22')](saveUpdates(_0x134b6b['body'],null))['then'](respondWithResult(_0x17f839,null))[_0x8581('0x2c')](handleError(_0x17f839,null));};exports[_0x8581('0x39')]=function(_0x23885d,_0x4b6d54){return db[_0x8581('0x3e')][_0x8581('0x5a')]({'where':{'id':_0x23885d['params']['id']}})[_0x8581('0x22')](handleEntityNotFound(_0x4b6d54,null))[_0x8581('0x22')](removeEntity(_0x4b6d54,null))[_0x8581('0x2c')](handleError(_0x4b6d54,null));};exports['describe']=function(_0x4c17e3,_0x4ec281){return db[_0x8581('0x3e')]['describe']()['then'](respondWithResult(_0x4ec281,null))[_0x8581('0x2c')](handleError(_0x4ec281,null));};var interaction_log=require(_0x8581('0x13'))(_0x8581('0x5c'));exports[_0x8581('0x5d')]=function(_0x163d90,_0x544240,_0x487d4e){var _0x2db2d9={'agent':{},'channel':_0x8581('0x5e')};if(_0x163d90[_0x8581('0x5b')]['id']){delete _0x163d90['body']['id'];}_0x163d90[_0x8581('0x5b')][_0x8581('0x5f')]=!![];_0x163d90[_0x8581('0x5b')][_0x8581('0x60')]=moment()[_0x8581('0x61')](_0x8581('0x62'));_0x163d90[_0x8581('0x5b')][_0x8581('0x63')]=_0x163d90[_0x8581('0x5b')][_0x8581('0x63')]||_0x163d90[_0x8581('0x64')]['id'];_0x2db2d9[_0x8581('0x65')]['id']=_0x163d90[_0x8581('0x5b')][_0x8581('0x63')];return db[_0x8581('0x3e')][_0x8581('0x5a')]({'where':{'id':_0x163d90[_0x8581('0x57')]['id'],'UserId':null}})[_0x8581('0x22')](handleEntityNotFound(_0x544240,null))[_0x8581('0x22')](saveUpdates(_0x163d90[_0x8581('0x5b')],null))[_0x8581('0x22')](function(_0x359a51){if(_0x359a51){_0x2db2d9['message']=_0x359a51[_0x8581('0x66')]({'plain':!![]});return db[_0x8581('0x67')][_0x8581('0x5a')]({'where':{'id':_0x359a51['FaxInteractionId']}});}return null;})[_0x8581('0x22')](handleEntityNotFound(_0x544240,null))['then'](function(_0xa1231b){if(_0xa1231b){return _0xa1231b[_0x8581('0x38')]({'UserId':_0x163d90['body']['UserId'],'read1stAt':_[_0x8581('0x68')](_0xa1231b[_0x8581('0x69')])?moment()['format'](_0x8581('0x62')):undefined});}return null;})[_0x8581('0x22')](function(_0x7c3b1c){if(_0x7c3b1c){_0x2db2d9[_0x8581('0x6a')]=_0x7c3b1c[_0x8581('0x66')]({'plain':!![]});interaction_log[_0x8581('0x23')](_0x8581('0x6b'),_0x163d90['user']['id'],_0x163d90[_0x8581('0x64')]['name'],_0x163d90['user'][_0x8581('0x6c')],_0x2db2d9[_0x8581('0x6a')]['id'],_0x163d90['body']?JSON[_0x8581('0x26')](_0x163d90[_0x8581('0x5b')]):_0x8581('0x6d'));return respondWithRpcPromise(_0x8581('0x6e'),_0x8581('0x6f'),_0x2db2d9);}return null;})[_0x8581('0x22')](function(_0x237dcb){var _0x5e13e6=_0x8581('0x70')+_0x237dcb[_0x8581('0x2a')][_0x8581('0x71')];return db[_0x8581('0x72')][_0x8581('0x44')](_0x5e13e6,{'type':db['Sequelize'][_0x8581('0x73')][_0x8581('0x74')],'raw':!![]})[_0x8581('0x22')](function(_0x4583b1){return _0x4583b1;});})['then'](function(_0x50b772){if(_0x50b772){_0x2db2d9[_0x8581('0x2a')][_0x8581('0x75')]=_0x50b772[0x0];if(!_0x163d90[_0x8581('0x5b')]['UserId'])return;return db['User']['find']({'where':{'id':_0x163d90[_0x8581('0x5b')][_0x8581('0x63')],'role':_0x8581('0x65')},'attributes':['id',_0x8581('0x3b'),_0x8581('0x76'),_0x8581('0x77'),'internal'],'raw':!![]});}return null;})[_0x8581('0x22')](function(_0x3b458b){if(!_0x3b458b)return null;_0x2db2d9[_0x8581('0x2a')]['agent']=_0x3b458b;return _0x2db2d9;})[_0x8581('0x22')](function(_0x1788e5){if(_0x1788e5){if(_0x163d90[_0x8581('0x5b')]['manual']){_0x2db2d9[_0x8581('0x2a')][_0x8581('0x78')]=util['format'](_0x8581('0x79'),_0x163d90[_0x8581('0x64')][_0x8581('0x3b')]);_0x2db2d9['message'][_0x8581('0x7a')]=_0x2db2d9[_0x8581('0x7a')];_0x2db2d9[_0x8581('0x2a')][_0x8581('0x7b')]=_0x2db2d9[_0x8581('0x7a')];_0x2db2d9[_0x8581('0x2a')][_0x8581('0x7c')]='accept';return respondWithRpcPromise(_0x8581('0x7d'),'EventManager',{'event':'acceptmessage','message':_0x2db2d9[_0x8581('0x2a')]},client9002)[_0x8581('0x22')](function(){return _0x2db2d9;});}return _0x2db2d9;}return null;})['then'](respondWithResult(_0x544240,null))[_0x8581('0x2c')](handleError(_0x544240,null));};var interaction_log=require(_0x8581('0x13'))(_0x8581('0x5c'));exports[_0x8581('0x36')]=function(_0x3a36f6,_0x29c14d,_0x13cfe3){var _0x118211={'agent':{},'channel':'fax'};if(_0x3a36f6['body']['id']){delete _0x3a36f6[_0x8581('0x5b')]['id'];}_0x3a36f6[_0x8581('0x5b')]['UserId']=_0x3a36f6[_0x8581('0x5b')][_0x8581('0x63')]||_0x3a36f6[_0x8581('0x64')]['id'];_0x118211[_0x8581('0x65')]['id']=_0x3a36f6[_0x8581('0x5b')]['UserId'];return db[_0x8581('0x3e')][_0x8581('0x5a')]({'where':{'id':_0x3a36f6[_0x8581('0x57')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x29c14d,null))[_0x8581('0x22')](function(_0xbc1002){if(_0xbc1002){_0x118211[_0x8581('0x2a')]=_0xbc1002[_0x8581('0x66')]({'plain':!![]});return db[_0x8581('0x67')][_0x8581('0x5a')]({'where':{'id':_0xbc1002[_0x8581('0x7e')]}});}return null;})['then'](handleEntityNotFound(_0x29c14d,null))[_0x8581('0x22')](function(_0xbedb0b){if(_0xbedb0b){_0x118211[_0x8581('0x6a')]=_0xbedb0b[_0x8581('0x66')]({'plain':!![]});interaction_log['info'](_0x8581('0x7f'),_0x3a36f6[_0x8581('0x64')]['id'],_0x3a36f6[_0x8581('0x64')][_0x8581('0x3b')],_0x3a36f6['user']['role'],_0x118211['interaction']['id'],_0x3a36f6[_0x8581('0x5b')]?JSON[_0x8581('0x26')](_0x3a36f6[_0x8581('0x5b')]):'null');return respondWithRpcPromise(_0x8581('0x80'),'rejectMessage',_0x118211);}return null;})[_0x8581('0x22')](function(_0x3b1b86){var _0x1bd131=_0x8581('0x70')+_0x3b1b86['message'][_0x8581('0x71')];return db[_0x8581('0x72')][_0x8581('0x44')](_0x1bd131,{'type':db[_0x8581('0x81')][_0x8581('0x73')][_0x8581('0x74')],'raw':!![]})[_0x8581('0x22')](function(_0x334024){return _0x334024;});})[_0x8581('0x22')](function(_0x322933){if(_0x322933){_0x118211[_0x8581('0x2a')]['contact']=_0x322933[0x0];if(!_0x3a36f6[_0x8581('0x5b')][_0x8581('0x63')])return;return db['User']['find']({'where':{'id':_0x3a36f6['body'][_0x8581('0x63')],'role':'agent'},'attributes':['id',_0x8581('0x3b'),_0x8581('0x76'),_0x8581('0x77'),_0x8581('0x82')],'raw':!![]});}return null;})[_0x8581('0x22')](function(_0x3987c8){if(!_0x3987c8)return null;_0x118211[_0x8581('0x2a')][_0x8581('0x65')]=_0x3987c8;return _0x118211;})['then'](function(_0x4aa8e8){if(_0x4aa8e8){_0x4aa8e8[_0x8581('0x2a')][_0x8581('0x78')]=util[_0x8581('0x61')]('SIP/%s',_0x3a36f6[_0x8581('0x64')][_0x8581('0x3b')]);_0x4aa8e8[_0x8581('0x2a')][_0x8581('0x7a')]=_0x118211['channel'];_0x4aa8e8[_0x8581('0x2a')][_0x8581('0x7b')]=_0x118211[_0x8581('0x7a')];_0x4aa8e8[_0x8581('0x2a')]['event']='reject';respondWithRpcPromise('EventManager',_0x8581('0x7d'),{'event':_0x8581('0x83'),'message':_0x4aa8e8['message']},client9002);return _0x118211;}return null;})[_0x8581('0x22')](respondWithResult(_0x29c14d,null))[_0x8581('0x2c')](handleError(_0x29c14d,null));};exports[_0x8581('0x84')]=function(_0xb14a7a,_0x58cf7a){var _0x25d81c;return db[_0x8581('0x3e')]['create'](_0xb14a7a[_0x8581('0x5b')],{})['then'](function(_0x5de84f){_0x25d81c=_0x5de84f;return db[_0x8581('0x85')][_0x8581('0x86')]({'where':{'id':_0x25d81c[_0x8581('0x71')]}});})[_0x8581('0x22')](function(_0x1653df){if(_['isNil'](_0x1653df)){return;}else{_0x25d81c[_0x8581('0x5e')]=_0x1653df[_0x8581('0x5e')];return db['Attachment'][_0x8581('0x86')]({'where':{'id':_0x25d81c['AttachmentId']}});}})[_0x8581('0x22')](function(_0x308d13){return respondWithRpcPromise(_0x8581('0x87'),_0x8581('0x87'),{'FaxAccountId':_[_0x8581('0x68')](_0xb14a7a[_0x8581('0x5b')])?undefined:_0xb14a7a[_0x8581('0x5b')][_0x8581('0x88')],'path':_[_0x8581('0x68')](_0x308d13)?undefined:util[_0x8581('0x61')](_0x8581('0x89'),_0x308d13[_0x8581('0x8a')]),'fax':_[_0x8581('0x68')](_0x25d81c[_0x8581('0x5e')])?undefined:_0x25d81c[_0x8581('0x5e')],'AttachmentId':_0x25d81c[_0x8581('0x8b')]},client9002);})['then'](respondWithResult(_0x58cf7a,0xc9))['catch'](handleError(_0x58cf7a,null));};exports[_0x8581('0x8c')]=function(_0x3506f1,_0x372693){var _0x9a674=path[_0x8581('0x8d')](config[_0x8581('0x8e')],_0x8581('0x8f'),_0x8581('0x90'),_0x8581('0x91'));return db[_0x8581('0x3e')][_0x8581('0x5a')]({'where':{'id':_0x3506f1[_0x8581('0x57')]['id']},'include':[{'model':db[_0x8581('0x92')],'as':_0x8581('0x92')}]})[_0x8581('0x22')](handleEntityNotFound(_0x372693,null))[_0x8581('0x22')](function(_0x3e5ba2){if(_0x3e5ba2){return _0x372693[_0x8581('0x8c')](path[_0x8581('0x8d')](_0x9a674,_0x3e5ba2[_0x8581('0x92')][_0x8581('0x8a')]));}})[_0x8581('0x2c')](handleError(_0x372693,null));}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.events.js b/server/api/faxMessage/faxMessage.events.js index f0102f2..730e697 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 _0x7c71=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','FaxMessage','setMaxListeners','update'];(function(_0x15c7e0,_0x552b54){var _0x3a9380=function(_0x25af19){while(--_0x25af19){_0x15c7e0['push'](_0x15c7e0['shift']());}};_0x3a9380(++_0x552b54);}(_0x7c71,0x177));var _0x17c7=function(_0x5d4607,_0x6b5e7b){_0x5d4607=_0x5d4607-0x0;var _0x5e4a86=_0x7c71[_0x5d4607];return _0x5e4a86;};'use strict';var EventEmitter=require(_0x17c7('0x0'));var FaxMessage=require(_0x17c7('0x1'))['db'][_0x17c7('0x2')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0x17c7('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x17c7('0x4'),'afterDestroy':_0x17c7('0x5')};function emitEvent(_0x3f9105){return function(_0x5a4923,_0x4fed29,_0xa4e319){FaxMessageEvents[_0x17c7('0x6')](_0x3f9105+':'+_0x5a4923['id'],_0x5a4923);FaxMessageEvents[_0x17c7('0x6')](_0x3f9105,_0x5a4923);_0xa4e319(null);};}for(var e in events){if(events[_0x17c7('0x7')](e)){var event=events[e];FaxMessage[_0x17c7('0x8')](e,emitEvent(event));}}module[_0x17c7('0x9')]=FaxMessageEvents; \ No newline at end of file +var _0x2e88=['../../mysqldb','FaxMessage','setMaxListeners','save','update','emit','hasOwnProperty','hook','exports','events'];(function(_0x30a528,_0x1d04f2){var _0x3e029c=function(_0x4e4b97){while(--_0x4e4b97){_0x30a528['push'](_0x30a528['shift']());}};_0x3e029c(++_0x1d04f2);}(_0x2e88,0x95));var _0x82e8=function(_0xd050c6,_0x58ffb4){_0xd050c6=_0xd050c6-0x0;var _0x7278a=_0x2e88[_0xd050c6];return _0x7278a;};'use strict';var EventEmitter=require(_0x82e8('0x0'));var FaxMessage=require(_0x82e8('0x1'))['db'][_0x82e8('0x2')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0x82e8('0x3')](0x0);var events={'afterCreate':_0x82e8('0x4'),'afterUpdate':_0x82e8('0x5'),'afterDestroy':'remove'};function emitEvent(_0x40c9c5){return function(_0x1d7415,_0x576435,_0x3aed37){FaxMessageEvents[_0x82e8('0x6')](_0x40c9c5+':'+_0x1d7415['id'],_0x1d7415);FaxMessageEvents['emit'](_0x40c9c5,_0x1d7415);_0x3aed37(null);};}for(var e in events){if(events[_0x82e8('0x7')](e)){var event=events[e];FaxMessage[_0x82e8('0x8')](e,emitEvent(event));}}module[_0x82e8('0x9')]=FaxMessageEvents; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.model.js b/server/api/faxMessage/faxMessage.model.js index af9e4fc..7c8d619 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 _0x6489=['FaxInteraction','findOne','FaxInteractionId','then','catch','error','lodash','util','api','moment','bluebird','request-promise','path','../../config/environment','./faxMessage.attributes','exports','define','FaxMessage','fti_fax_messages','body','get','direction','toLowerCase','secret','isNil','UserId'];(function(_0x12eb53,_0x56aaf4){var _0x55a135=function(_0x291587){while(--_0x291587){_0x12eb53['push'](_0x12eb53['shift']());}};_0x55a135(++_0x56aaf4);}(_0x6489,0xd6));var _0x9648=function(_0x53f743,_0x5714ee){_0x53f743=_0x53f743-0x0;var _0x57ce78=_0x6489[_0x53f743];return _0x57ce78;};'use strict';var _=require(_0x9648('0x0'));var util=require(_0x9648('0x1'));var logger=require('../../config/logger')(_0x9648('0x2'));var moment=require(_0x9648('0x3'));var BPromise=require(_0x9648('0x4'));var rp=require(_0x9648('0x5'));var fs=require('fs');var path=require(_0x9648('0x6'));var rimraf=require('rimraf');var config=require(_0x9648('0x7'));var attributes=require(_0x9648('0x8'));module[_0x9648('0x9')]=function(_0x2b65a4,_0x51dbff){return _0x2b65a4[_0x9648('0xa')](_0x9648('0xb'),attributes,{'tableName':'fax_messages','paranoid':![],'indexes':[{'name':_0x9648('0xc'),'fields':[_0x9648('0xd')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x5b798d,_0x16611d,_0x337d7e){var _0x15fdda=_0x2b65a4['models'];var _0x544c8e=_0x5b798d[_0x9648('0xe')]({'plain':!![]});if(_0x544c8e[_0x9648('0xf')]['toLowerCase']()==='in'||_0x544c8e['direction'][_0x9648('0x10')]()==='out'&&!_0x544c8e[_0x9648('0x11')]&&!_[_0x9648('0x12')](_0x544c8e[_0x9648('0x13')])){_0x15fdda[_0x9648('0x14')][_0x9648('0x15')]({'where':{'id':_0x544c8e[_0x9648('0x16')]}})[_0x9648('0x17')](function(_0x2adf7d){if(_0x2adf7d){_0x2adf7d['update']({'lastMsgAt':_0x544c8e['createdAt'],'lastMsgDirection':_0x544c8e[_0x9648('0xf')]['toLowerCase']()});}})[_0x9648('0x18')](function(_0xc50efa){console[_0x9648('0x19')](_0xc50efa);});}_0x337d7e();}},'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xbd1b=['bluebird','request-promise','path','rimraf','../../config/environment','./faxMessage.attributes','exports','FaxMessage','fax_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil','UserId','FaxInteraction','findOne','FaxInteractionId','then','createdAt','catch','error','utf8mb4_unicode_ci','lodash','util','api','moment'];(function(_0x8eab9c,_0x58385b){var _0x24e5c5=function(_0x4b2d2c){while(--_0x4b2d2c){_0x8eab9c['push'](_0x8eab9c['shift']());}};_0x24e5c5(++_0x58385b);}(_0xbd1b,0x97));var _0xbbd1=function(_0x30d3a5,_0x58e40d){_0x30d3a5=_0x30d3a5-0x0;var _0x4a6cd2=_0xbd1b[_0x30d3a5];return _0x4a6cd2;};'use strict';var _=require(_0xbbd1('0x0'));var util=require(_0xbbd1('0x1'));var logger=require('../../config/logger')(_0xbbd1('0x2'));var moment=require(_0xbbd1('0x3'));var BPromise=require(_0xbbd1('0x4'));var rp=require(_0xbbd1('0x5'));var fs=require('fs');var path=require(_0xbbd1('0x6'));var rimraf=require(_0xbbd1('0x7'));var config=require(_0xbbd1('0x8'));var attributes=require(_0xbbd1('0x9'));module[_0xbbd1('0xa')]=function(_0x3f93ac,_0x22ce60){return _0x3f93ac['define'](_0xbbd1('0xb'),attributes,{'tableName':_0xbbd1('0xc'),'paranoid':![],'indexes':[{'name':'fti_fax_messages','fields':[_0xbbd1('0xd')],'type':_0xbbd1('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0xe0e15,_0x1e5486,_0x41daf0){var _0xe0d83b=_0x3f93ac[_0xbbd1('0xf')];var _0x15a232=_0xe0e15[_0xbbd1('0x10')]({'plain':!![]});if(_0x15a232[_0xbbd1('0x11')][_0xbbd1('0x12')]()==='in'||_0x15a232[_0xbbd1('0x11')]['toLowerCase']()===_0xbbd1('0x13')&&!_0x15a232[_0xbbd1('0x14')]&&!_[_0xbbd1('0x15')](_0x15a232[_0xbbd1('0x16')])){_0xe0d83b[_0xbbd1('0x17')][_0xbbd1('0x18')]({'where':{'id':_0x15a232[_0xbbd1('0x19')]}})[_0xbbd1('0x1a')](function(_0x29b49c){if(_0x29b49c){_0x29b49c['update']({'lastMsgAt':_0x15a232[_0xbbd1('0x1b')],'lastMsgDirection':_0x15a232[_0xbbd1('0x11')][_0xbbd1('0x12')]()});}})[_0xbbd1('0x1c')](function(_0x471cc7){console[_0xbbd1('0x1d')](_0x471cc7);});}_0x41daf0();}},'charset':'utf8mb4','collate':_0xbbd1('0x1e')});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.rpc.js b/server/api/faxMessage/faxMessage.rpc.js index 76cbda9..006bb63 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 _0x425d=['lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./faxMessage.socket','register','request','then','info','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','CreateFaxMessage','FaxMessage','body','options','raw','catch','UpdateFaxMessage','where','attributes','limit'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x425d,0x1e0));var _0xd425=function(_0x5ca62a,_0x3dffb9){_0x5ca62a=_0x5ca62a-0x0;var _0xcabff4=_0x425d[_0x5ca62a];return _0xcabff4;};'use strict';var _=require(_0xd425('0x0'));var util=require('util');var moment=require(_0xd425('0x1'));var BPromise=require(_0xd425('0x2'));var rs=require(_0xd425('0x3'));var fs=require('fs');var Redis=require(_0xd425('0x4'));var db=require(_0xd425('0x5'))['db'];var utils=require(_0xd425('0x6'));var logger=require(_0xd425('0x7'))('rpc');var config=require(_0xd425('0x8'));var jayson=require(_0xd425('0x9'));var client=jayson[_0xd425('0xa')][_0xd425('0xb')]({'port':0x232a});config[_0xd425('0xc')]=_[_0xd425('0xd')](config['redis'],{'host':_0xd425('0xe'),'port':0x18eb});var socket=require(_0xd425('0xf'))(new Redis(config[_0xd425('0xc')]));require(_0xd425('0x10'))[_0xd425('0x11')](socket);function respondWithRpcPromise(_0x2beb20,_0x30111e,_0x1969ba){return new BPromise(function(_0x3a7a01,_0x35a7f4){return client[_0xd425('0x12')](_0x2beb20,_0x1969ba)[_0xd425('0x13')](function(_0x26f6d2){logger[_0xd425('0x14')](_0xd425('0x15'),_0x30111e,_0xd425('0x16'));logger[_0xd425('0x17')](_0xd425('0x18'),_0x30111e,_0xd425('0x16'),JSON[_0xd425('0x19')](_0x26f6d2));if(_0x26f6d2['error']){if(_0x26f6d2[_0xd425('0x1a')][_0xd425('0x1b')]===0x1f4){logger[_0xd425('0x1a')]('FaxMessage,\x20%s,\x20%s',_0x30111e,_0x26f6d2[_0xd425('0x1a')][_0xd425('0x1c')]);return _0x35a7f4(_0x26f6d2[_0xd425('0x1a')][_0xd425('0x1c')]);}logger[_0xd425('0x1a')]('FaxMessage,\x20%s,\x20%s',_0x30111e,_0x26f6d2[_0xd425('0x1a')][_0xd425('0x1c')]);return _0x3a7a01(_0x26f6d2[_0xd425('0x1a')][_0xd425('0x1c')]);}else{logger['info'](_0xd425('0x15'),_0x30111e,_0xd425('0x16'));_0x3a7a01(_0x26f6d2[_0xd425('0x1d')][_0xd425('0x1c')]);}})['catch'](function(_0x58a0c1){logger['error']('FaxMessage,\x20%s,\x20%s',_0x30111e,_0x58a0c1);_0x35a7f4(_0x58a0c1);});});}exports[_0xd425('0x1e')]=function(_0xb92870){var _0x3c98db=this;return new Promise(function(_0x5e797a,_0x355af0){return db[_0xd425('0x1f')]['create'](_0xb92870[_0xd425('0x20')],{'raw':_0xb92870[_0xd425('0x21')]?_0xb92870[_0xd425('0x21')][_0xd425('0x22')]===undefined?!![]:![]:!![]})[_0xd425('0x13')](function(_0xb240c4){logger[_0xd425('0x14')](_0xd425('0x1e'),_0xb92870);logger[_0xd425('0x17')](_0xd425('0x1e'),_0xb92870,JSON[_0xd425('0x19')](_0xb240c4));_0x5e797a(_0xb240c4);})[_0xd425('0x23')](function(_0x47f44a){logger[_0xd425('0x1a')](_0xd425('0x1e'),_0x47f44a[_0xd425('0x1c')],_0xb92870);_0x355af0(_0x3c98db[_0xd425('0x1a')](0x1f4,_0x47f44a[_0xd425('0x1c')]));});});};exports[_0xd425('0x24')]=function(_0x3c3402){var _0x577e4b=this;return new Promise(function(_0x12f951,_0x177de2){return db[_0xd425('0x1f')]['update'](_0x3c3402[_0xd425('0x20')],{'raw':_0x3c3402[_0xd425('0x21')]?_0x3c3402[_0xd425('0x21')][_0xd425('0x22')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3c3402[_0xd425('0x21')]?_0x3c3402[_0xd425('0x21')][_0xd425('0x25')]||null:null,'attributes':_0x3c3402[_0xd425('0x21')]?_0x3c3402[_0xd425('0x21')][_0xd425('0x26')]||null:null,'limit':_0x3c3402['options']?_0x3c3402[_0xd425('0x21')][_0xd425('0x27')]||null:null})[_0xd425('0x13')](function(_0x3695dd){logger[_0xd425('0x14')](_0xd425('0x24'),_0x3c3402);logger[_0xd425('0x17')](_0xd425('0x24'),_0x3c3402,JSON[_0xd425('0x19')](_0x3695dd));_0x12f951(_0x3695dd);})[_0xd425('0x23')](function(_0x3583b0){logger['error'](_0xd425('0x24'),_0x3583b0[_0xd425('0x1c')],_0x3c3402);_0x177de2(_0x577e4b[_0xd425('0x1a')](0x1f4,_0x3583b0[_0xd425('0x1c')]));});});}; \ No newline at end of file +var _0x24ca=['redis','defaults','socket.io-emitter','./faxMessage.socket','request','then','info','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','error','code','FaxMessage,\x20%s,\x20%s','message','result','catch','CreateFaxMessage','create','body','options','stringify','UpdateFaxMessage','FaxMessage','update','where','attributes','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x36eaaa,_0x326732){var _0x461349=function(_0x4e4180){while(--_0x4e4180){_0x36eaaa['push'](_0x36eaaa['shift']());}};_0x461349(++_0x326732);}(_0x24ca,0x1bc));var _0xa24c=function(_0x403c20,_0x4a7b99){_0x403c20=_0x403c20-0x0;var _0x2b271a=_0x24ca[_0x403c20];return _0x2b271a;};'use strict';var _=require(_0xa24c('0x0'));var util=require('util');var moment=require(_0xa24c('0x1'));var BPromise=require(_0xa24c('0x2'));var rs=require(_0xa24c('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa24c('0x4'))['db'];var utils=require(_0xa24c('0x5'));var logger=require(_0xa24c('0x6'))(_0xa24c('0x7'));var config=require(_0xa24c('0x8'));var jayson=require(_0xa24c('0x9'));var client=jayson[_0xa24c('0xa')][_0xa24c('0xb')]({'port':0x232a});config[_0xa24c('0xc')]=_[_0xa24c('0xd')](config[_0xa24c('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0xa24c('0xe'))(new Redis(config[_0xa24c('0xc')]));require(_0xa24c('0xf'))['register'](socket);function respondWithRpcPromise(_0x399f32,_0x325c6d,_0x288f76){return new BPromise(function(_0x211003,_0x169632){return client[_0xa24c('0x10')](_0x399f32,_0x288f76)[_0xa24c('0x11')](function(_0xc82af0){logger[_0xa24c('0x12')]('FaxMessage,\x20%s,\x20%s',_0x325c6d,_0xa24c('0x13'));logger[_0xa24c('0x14')](_0xa24c('0x15'),_0x325c6d,_0xa24c('0x13'),JSON['stringify'](_0xc82af0));if(_0xc82af0[_0xa24c('0x16')]){if(_0xc82af0[_0xa24c('0x16')][_0xa24c('0x17')]===0x1f4){logger[_0xa24c('0x16')](_0xa24c('0x18'),_0x325c6d,_0xc82af0[_0xa24c('0x16')][_0xa24c('0x19')]);return _0x169632(_0xc82af0['error']['message']);}logger[_0xa24c('0x16')](_0xa24c('0x18'),_0x325c6d,_0xc82af0['error']['message']);return _0x211003(_0xc82af0[_0xa24c('0x16')][_0xa24c('0x19')]);}else{logger['info'](_0xa24c('0x18'),_0x325c6d,'request\x20sent');_0x211003(_0xc82af0[_0xa24c('0x1a')][_0xa24c('0x19')]);}})[_0xa24c('0x1b')](function(_0xefdbd9){logger['error'](_0xa24c('0x18'),_0x325c6d,_0xefdbd9);_0x169632(_0xefdbd9);});});}exports[_0xa24c('0x1c')]=function(_0x773f70){var _0x4d4bab=this;return new Promise(function(_0x48a768,_0x506424){return db['FaxMessage'][_0xa24c('0x1d')](_0x773f70[_0xa24c('0x1e')],{'raw':_0x773f70[_0xa24c('0x1f')]?_0x773f70[_0xa24c('0x1f')]['raw']===undefined?!![]:![]:!![]})[_0xa24c('0x11')](function(_0x5f299e){logger[_0xa24c('0x12')](_0xa24c('0x1c'),_0x773f70);logger['debug'](_0xa24c('0x1c'),_0x773f70,JSON[_0xa24c('0x20')](_0x5f299e));_0x48a768(_0x5f299e);})[_0xa24c('0x1b')](function(_0x188ee2){logger[_0xa24c('0x16')]('CreateFaxMessage',_0x188ee2[_0xa24c('0x19')],_0x773f70);_0x506424(_0x4d4bab['error'](0x1f4,_0x188ee2[_0xa24c('0x19')]));});});};exports[_0xa24c('0x21')]=function(_0x294685){var _0x51dc3f=this;return new Promise(function(_0x1beb55,_0x31c4d9){return db[_0xa24c('0x22')][_0xa24c('0x23')](_0x294685[_0xa24c('0x1e')],{'raw':_0x294685[_0xa24c('0x1f')]?_0x294685[_0xa24c('0x1f')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x294685[_0xa24c('0x1f')]?_0x294685[_0xa24c('0x1f')][_0xa24c('0x24')]||null:null,'attributes':_0x294685[_0xa24c('0x1f')]?_0x294685['options'][_0xa24c('0x25')]||null:null,'limit':_0x294685[_0xa24c('0x1f')]?_0x294685[_0xa24c('0x1f')]['limit']||null:null})[_0xa24c('0x11')](function(_0x3dcb1b){logger[_0xa24c('0x12')]('UpdateFaxMessage',_0x294685);logger[_0xa24c('0x14')]('UpdateFaxMessage',_0x294685,JSON[_0xa24c('0x20')](_0x3dcb1b));_0x1beb55(_0x3dcb1b);})[_0xa24c('0x1b')](function(_0x1a247b){logger['error'](_0xa24c('0x21'),_0x1a247b[_0xa24c('0x19')],_0x294685);_0x31c4d9(_0x51dc3f[_0xa24c('0x16')](0x1f4,_0x1a247b['message']));});});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.socket.js b/server/api/faxMessage/faxMessage.socket.js index ad8e175..dd7b963 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 _0x76bf=['register','save','update','emit'];(function(_0x3616bb,_0x86fe00){var _0x1c0994=function(_0x46a1d4){while(--_0x46a1d4){_0x3616bb['push'](_0x3616bb['shift']());}};_0x1c0994(++_0x86fe00);}(_0x76bf,0x79));var _0xf76b=function(_0x3ed944,_0x11229){_0x3ed944=_0x3ed944-0x0;var _0x39ef2a=_0x76bf[_0x3ed944];return _0x39ef2a;};'use strict';var FaxMessageEvents=require('./faxMessage.events');var events=[_0xf76b('0x0'),'remove',_0xf76b('0x1')];function createListener(_0x2d500a,_0x3fac47){return function(_0x319f42){_0x3fac47[_0xf76b('0x2')](_0x2d500a,_0x319f42);};}function removeListener(_0xe68955,_0x55f893){return function(){FaxMessageEvents['removeListener'](_0xe68955,_0x55f893);};}exports[_0xf76b('0x3')]=function(_0x2996da){for(var _0x3e46cf=0x0,_0x32fed8=events['length'];_0x3e46cf<_0x32fed8;_0x3e46cf++){var _0xebb852=events[_0x3e46cf];var _0x5ec6f2=createListener('faxMessage:'+_0xebb852,_0x2996da);FaxMessageEvents['on'](_0xebb852,_0x5ec6f2);}}; \ No newline at end of file +var _0x3a12=['remove','emit','removeListener','register','length','./faxMessage.events','save'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x3a12,0x1a9));var _0x23a1=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x3a12[_0x20a584];return _0x4b41a8;};'use strict';var FaxMessageEvents=require(_0x23a1('0x0'));var events=[_0x23a1('0x1'),_0x23a1('0x2'),'update'];function createListener(_0x3376ef,_0x5c3411){return function(_0x40136b){_0x5c3411[_0x23a1('0x3')](_0x3376ef,_0x40136b);};}function removeListener(_0x5b66b7,_0x4905cd){return function(){FaxMessageEvents[_0x23a1('0x4')](_0x5b66b7,_0x4905cd);};}exports[_0x23a1('0x5')]=function(_0x3db19c){for(var _0x47d337=0x0,_0x13cbd4=events[_0x23a1('0x6')];_0x47d337<_0x13cbd4;_0x47d337++){var _0x253ef0=events[_0x47d337];var _0x3eefc6=createListener('faxMessage:'+_0x253ef0,_0x3db19c);FaxMessageEvents['on'](_0x253ef0,_0x3eefc6);}}; \ No newline at end of file diff --git a/server/api/faxMessage/index.js b/server/api/faxMessage/index.js index 629fa29..413a84d 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 _0xb7e7=['get','/describe','describe','/:id','isAuthenticated','show','/:id/download','download','post','tracked','fax','faxmessage:create','create','put','update','/:id/reject','reject','delete','exports','multer','path','express','fs-extra','../../components/interaction/service','../../config/environment','./faxMessage.controller','index'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xb7e7,0x121));var _0x7b7e=function(_0x42bc91,_0x41f40a){_0x42bc91=_0x42bc91-0x0;var _0x3f5507=_0xb7e7[_0x42bc91];return _0x3f5507;};'use strict';var multer=require(_0x7b7e('0x0'));var util=require('util');var path=require(_0x7b7e('0x1'));var timeout=require('connect-timeout');var express=require(_0x7b7e('0x2'));var router=express['Router']();var fs_extra=require(_0x7b7e('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x7b7e('0x4'));var config=require(_0x7b7e('0x5'));var controller=require(_0x7b7e('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x7b7e('0x7')]);router[_0x7b7e('0x8')](_0x7b7e('0x9'),auth['isAuthenticated'](),controller[_0x7b7e('0xa')]);router[_0x7b7e('0x8')](_0x7b7e('0xb'),auth[_0x7b7e('0xc')](),controller[_0x7b7e('0xd')]);router[_0x7b7e('0x8')](_0x7b7e('0xe'),auth['isAuthenticated'](),controller[_0x7b7e('0xf')]);router[_0x7b7e('0x10')]('/',auth[_0x7b7e('0xc')](),interaction[_0x7b7e('0x11')](_0x7b7e('0x12'),_0x7b7e('0x13')),controller[_0x7b7e('0x14')]);router[_0x7b7e('0x15')](_0x7b7e('0xb'),auth['isAuthenticated'](),controller[_0x7b7e('0x16')]);router[_0x7b7e('0x15')]('/:id/accept',auth[_0x7b7e('0xc')](),controller['accept']);router['put'](_0x7b7e('0x17'),auth[_0x7b7e('0xc')](),controller[_0x7b7e('0x18')]);router[_0x7b7e('0x19')](_0x7b7e('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0x7b7e('0x1a')]=router; \ No newline at end of file +var _0x2f68=['/:id/reject','reject','destroy','exports','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','/:id','/:id/download','download','post','tracked','fax','faxmessage:create','put','update','/:id/accept','accept'];(function(_0x2ea20d,_0x5e8e3c){var _0x3ba66a=function(_0x164ca6){while(--_0x164ca6){_0x2ea20d['push'](_0x2ea20d['shift']());}};_0x3ba66a(++_0x5e8e3c);}(_0x2f68,0x9a));var _0x82f6=function(_0x4863d8,_0x252e0d){_0x4863d8=_0x4863d8-0x0;var _0x13a624=_0x2f68[_0x4863d8];return _0x13a624;};'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('./faxMessage.controller');router[_0x82f6('0x7')]('/',auth[_0x82f6('0x8')](),controller['index']);router['get'](_0x82f6('0x9'),auth['isAuthenticated'](),controller['describe']);router[_0x82f6('0x7')](_0x82f6('0xa'),auth[_0x82f6('0x8')](),controller['show']);router[_0x82f6('0x7')](_0x82f6('0xb'),auth['isAuthenticated'](),controller[_0x82f6('0xc')]);router[_0x82f6('0xd')]('/',auth[_0x82f6('0x8')](),interaction[_0x82f6('0xe')](_0x82f6('0xf'),_0x82f6('0x10')),controller['create']);router[_0x82f6('0x11')](_0x82f6('0xa'),auth['isAuthenticated'](),controller[_0x82f6('0x12')]);router[_0x82f6('0x11')](_0x82f6('0x13'),auth[_0x82f6('0x8')](),controller[_0x82f6('0x14')]);router[_0x82f6('0x11')](_0x82f6('0x15'),auth[_0x82f6('0x8')](),controller[_0x82f6('0x16')]);router['delete'](_0x82f6('0xa'),auth['isAuthenticated'](),controller[_0x82f6('0x17')]);module[_0x82f6('0x18')]=router; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.attributes.js b/server/api/faxQueue/faxQueue.attributes.js index 2ac757c..609e56e 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 _0xe6af=['beepall','roundrobin','exports','STRING','name'];(function(_0x47c42c,_0x5a1a6a){var _0x25f852=function(_0x109f9f){while(--_0x109f9f){_0x47c42c['push'](_0x47c42c['shift']());}};_0x25f852(++_0x5a1a6a);}(_0xe6af,0x106));var _0xfe6a=function(_0x5bbbbe,_0x5e584b){_0x5bbbbe=_0x5bbbbe-0x0;var _0x46a87b=_0xe6af[_0x5bbbbe];return _0x46a87b;};'use strict';var Sequelize=require('sequelize');module[_0xfe6a('0x0')]={'name':{'type':Sequelize[_0xfe6a('0x1')],'unique':_0xfe6a('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xfe6a('0x1')]},'timeout':{'type':Sequelize['INTEGER'],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM']('rrmemory',_0xfe6a('0x3'),_0xfe6a('0x4')),'allowNull':![]},'lastAgent':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x6811=['roundrobin','sequelize','exports','STRING','name','INTEGER','ENUM','rrmemory','beepall'];(function(_0x3c18bc,_0x2ff6b8){var _0x3f5854=function(_0x3560ca){while(--_0x3560ca){_0x3c18bc['push'](_0x3c18bc['shift']());}};_0x3f5854(++_0x2ff6b8);}(_0x6811,0x121));var _0x1681=function(_0x21c222,_0x406d0a){_0x21c222=_0x21c222-0x0;var _0x5ec82a=_0x6811[_0x21c222];return _0x5ec82a;};'use strict';var Sequelize=require(_0x1681('0x0'));module[_0x1681('0x1')]={'name':{'type':Sequelize[_0x1681('0x2')],'unique':_0x1681('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x1681('0x2')]},'timeout':{'type':Sequelize[_0x1681('0x4')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x1681('0x5')](_0x1681('0x6'),_0x1681('0x7'),_0x1681('0x8')),'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 47df39d..2626786 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 _0xa6bb=['includeAll','merge','options','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','update','find','params','describe','getMembers','findOne','UserFaxQueue','rawAttributes','nolimit','limit','order','sort','where','FaxQueueId','filter','findAll','User','findAndCountAll','UserId','updatedAt','createdAt','format','SIP','faxPause','getTeams','Team','pick','hasOwnProperty','addTeams','ids','Agents','online','interface','flatMap','sequelize','findOrCreate','emit','userFaxQueue:save','select','from','team_has_fax_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','TeamId','all','union','removeTeams','isEmpty','forEach','userFaxQueue:remove','addAgents','omit','spread','removeAgents','getAgents','util','lodash','squel','ioredis','../../components/parsers/qs','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./faxQueue.socket','sendStatus','status','end','undefined','count','offset','json','destroy','then','get','UserProfileResource','error','stack','name','map','FaxQueue','fieldName','type','getOptions','include','rows','catch','show','keys','query','filters','intersection','model','attributes','fields','length'];(function(_0x244336,_0x34ceb2){var _0xab951d=function(_0x5e71bb){while(--_0x5e71bb){_0x244336['push'](_0x244336['shift']());}};_0xab951d(++_0x34ceb2);}(_0xa6bb,0x12c));var _0xba6b=function(_0x1cd5ac,_0x42e861){_0x1cd5ac=_0x1cd5ac-0x0;var _0x12cd65=_0xa6bb[_0x1cd5ac];return _0x12cd65;};'use strict';var BPromise=require('bluebird');var util=require(_0xba6b('0x0'));var _=require(_0xba6b('0x1'));var squel=require(_0xba6b('0x2'));var Redis=require(_0xba6b('0x3'));var qs=require(_0xba6b('0x4'));var logger=require('../../config/logger')('api');var config=require(_0xba6b('0x5'));var db=require(_0xba6b('0x6'))['db'];config[_0xba6b('0x7')]=_[_0xba6b('0x8')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xba6b('0x9'))(new Redis(config[_0xba6b('0x7')]));require(_0xba6b('0xa'))['register'](socket);function respondWithStatusCode(_0x55f5c3,_0x135892){_0x135892=_0x135892||0xcc;return function(_0x16bfde){if(_0x16bfde){return _0x55f5c3[_0xba6b('0xb')](_0x135892);}return _0x55f5c3[_0xba6b('0xc')](_0x135892)[_0xba6b('0xd')]();};}function respondWithResult(_0x534849,_0x17e6c8){_0x17e6c8=_0x17e6c8||0xc8;return function(_0x297f02){if(_0x297f02){return _0x534849[_0xba6b('0xc')](_0x17e6c8)['json'](_0x297f02);}};}function respondWithFilteredResult(_0x16fd15,_0x35e23d){return function(_0x3bf240){if(_0x3bf240){var _0x11bcb9=typeof _0x35e23d['offset']===_0xba6b('0xe')&&typeof _0x35e23d['limit']===_0xba6b('0xe');var _0x1adc27=_0x3bf240[_0xba6b('0xf')];var _0x15d4e2=_0x11bcb9?0x0:_0x35e23d[_0xba6b('0x10')];var _0x53ec00=_0x11bcb9?_0x3bf240[_0xba6b('0xf')]:_0x35e23d[_0xba6b('0x10')]+_0x35e23d['limit'];var _0x16c3d0;if(_0x53ec00>=_0x1adc27){_0x53ec00=_0x1adc27;_0x16c3d0=0xc8;}else{_0x16c3d0=0xce;}_0x16fd15[_0xba6b('0xc')](_0x16c3d0);return _0x16fd15['set']('Content-Range',_0x15d4e2+'-'+_0x53ec00+'/'+_0x1adc27)[_0xba6b('0x11')](_0x3bf240);}return null;};}function saveUpdates(_0x5b32cd){return function(_0x5d5a6c){if(_0x5d5a6c){return _0x5d5a6c['update'](_0x5b32cd)['then'](function(_0x4be059){return _0x4be059;});}return null;};}function removeEntity(_0x16b130){return function(_0x34aa97){if(_0x34aa97){return _0x34aa97[_0xba6b('0x12')]()[_0xba6b('0x13')](function(){var _0x300399=_0x34aa97[_0xba6b('0x14')]({'plain':!![]});var _0x44a7a3='FaxQueues';return db[_0xba6b('0x15')]['destroy']({'where':{'type':_0x44a7a3,'resourceId':_0x300399['id']}})['then'](function(){return _0x34aa97;});})[_0xba6b('0x13')](function(){_0x16b130[_0xba6b('0xc')](0xcc)[_0xba6b('0xd')]();});}};}function handleEntityNotFound(_0x1751f3){return function(_0x47b615){if(!_0x47b615){_0x1751f3[_0xba6b('0xb')](0x194);}return _0x47b615;};}function handleError(_0x436623,_0x548c1b){_0x548c1b=_0x548c1b||0x1f4;return function(_0x38c46a){logger[_0xba6b('0x16')](_0x38c46a[_0xba6b('0x17')]);if(_0x38c46a[_0xba6b('0x18')]){delete _0x38c46a[_0xba6b('0x18')];}_0x436623['status'](_0x548c1b)['send'](_0x38c46a);};}exports['index']=function(_0x5d9163,_0x211434){var _0x2525f8={};var _0x2f5343={'count':0x0,'rows':[]};var _0x39f052=_[_0xba6b('0x19')](db[_0xba6b('0x1a')]['rawAttributes'],function(_0x876e58){return{'name':_0x876e58[_0xba6b('0x1b')],'type':_0x876e58[_0xba6b('0x1c')]['key']};});_0x2525f8=qs[_0xba6b('0x1d')](_0x39f052,_0x5d9163);var _0x131830={'where':_0x2525f8['where']};return db[_0xba6b('0x1a')][_0xba6b('0xf')](_0x131830)[_0xba6b('0x13')](function(_0x41a0e0){_0x2f5343[_0xba6b('0xf')]=_0x41a0e0;_0x2525f8['include']=qs[_0xba6b('0x1e')](_0x5d9163['query']);return db[_0xba6b('0x1a')]['findAll'](_0x2525f8);})[_0xba6b('0x13')](function(_0x53649d){_0x2f5343[_0xba6b('0x1f')]=_0x53649d;return _0x2f5343;})['then'](respondWithFilteredResult(_0x211434,_0x2525f8))[_0xba6b('0x20')](handleError(_0x211434,null));};exports[_0xba6b('0x21')]=function(_0xc20433,_0x474cc7){var _0x5e87ed={'raw':!![],'where':{'id':_0xc20433['params']['id']}},_0x2e9bda={};_0x2e9bda['model']=_[_0xba6b('0x22')](db[_0xba6b('0x1a')]['rawAttributes']);_0x2e9bda[_0xba6b('0x23')]=_['keys'](_0xc20433['query']);_0x2e9bda[_0xba6b('0x24')]=_[_0xba6b('0x25')](_0x2e9bda[_0xba6b('0x26')],_0x2e9bda[_0xba6b('0x23')]);_0x5e87ed[_0xba6b('0x27')]=_['intersection'](_0x2e9bda[_0xba6b('0x26')],qs[_0xba6b('0x28')](_0xc20433[_0xba6b('0x23')][_0xba6b('0x28')]));_0x5e87ed[_0xba6b('0x27')]=_0x5e87ed[_0xba6b('0x27')][_0xba6b('0x29')]?_0x5e87ed[_0xba6b('0x27')]:_0x2e9bda[_0xba6b('0x26')];if(_0xc20433['query'][_0xba6b('0x2a')]){_0x5e87ed[_0xba6b('0x1e')]=[{'all':!![]}];}_0x5e87ed=_[_0xba6b('0x2b')]({},_0x5e87ed,_0xc20433[_0xba6b('0x2c')]);return db['FaxQueue']['find'](_0x5e87ed)[_0xba6b('0x13')](handleEntityNotFound(_0x474cc7,null))[_0xba6b('0x13')](respondWithResult(_0x474cc7,null))[_0xba6b('0x20')](handleError(_0x474cc7,null));};exports[_0xba6b('0x2d')]=function(_0x4a3386,_0x3ed42a){return db[_0xba6b('0x1a')]['create'](_0x4a3386[_0xba6b('0x2e')],{})['then'](function(_0x142eb0){var _0x36df21=_0x4a3386[_0xba6b('0x2f')]['get']({'plain':!![]});if(!_0x36df21)throw new Error(_0xba6b('0x30'));if(_0x36df21[_0xba6b('0x31')]==='user'){var _0x2ecbb7=_0x142eb0['get']({'plain':!![]});var _0x87884b='FaxQueues';return db[_0xba6b('0x32')]['find']({'where':{'name':_0x87884b,'userProfileId':_0x36df21[_0xba6b('0x33')]},'raw':!![]})['then'](function(_0x37dcb6){if(_0x37dcb6&&_0x37dcb6[_0xba6b('0x34')]===0x0){return db[_0xba6b('0x15')][_0xba6b('0x2d')]({'name':_0x2ecbb7['name'],'resourceId':_0x2ecbb7['id'],'type':_0x37dcb6[_0xba6b('0x18')],'sectionId':_0x37dcb6['id']},{})[_0xba6b('0x13')](function(){return _0x142eb0;});}else{return _0x142eb0;}})[_0xba6b('0x20')](function(_0x31fe5a){logger[_0xba6b('0x16')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x31fe5a);throw _0x31fe5a;});}return _0x142eb0;})[_0xba6b('0x13')](respondWithResult(_0x3ed42a,0xc9))['catch'](handleError(_0x3ed42a,null));};exports[_0xba6b('0x35')]=function(_0x7cb298,_0x5b710a){if(_0x7cb298['body']['id']){delete _0x7cb298[_0xba6b('0x2e')]['id'];}return db[_0xba6b('0x1a')][_0xba6b('0x36')]({'where':{'id':_0x7cb298[_0xba6b('0x37')]['id']}})['then'](handleEntityNotFound(_0x5b710a,null))[_0xba6b('0x13')](saveUpdates(_0x7cb298[_0xba6b('0x2e')],null))[_0xba6b('0x13')](respondWithResult(_0x5b710a,null))[_0xba6b('0x20')](handleError(_0x5b710a,null));};exports['destroy']=function(_0x25d208,_0x1029b6){return db[_0xba6b('0x1a')][_0xba6b('0x36')]({'where':{'id':_0x25d208[_0xba6b('0x37')]['id']}})[_0xba6b('0x13')](handleEntityNotFound(_0x1029b6,null))['then'](removeEntity(_0x1029b6,null))[_0xba6b('0x20')](handleError(_0x1029b6,null));};exports[_0xba6b('0x38')]=function(_0x652c9a,_0x4c166e){return db[_0xba6b('0x1a')][_0xba6b('0x38')]()[_0xba6b('0x13')](respondWithResult(_0x4c166e,null))[_0xba6b('0x20')](handleError(_0x4c166e,null));};exports[_0xba6b('0x39')]=function(_0x3e1071,_0x29bbad){var _0x37c4a4={'raw':!![],'where':{}},_0x4f2e50={},_0x15e3c5;return db[_0xba6b('0x1a')][_0xba6b('0x3a')]({'where':{'id':_0x3e1071['params']['id']}})[_0xba6b('0x13')](handleEntityNotFound(_0x29bbad,null))[_0xba6b('0x13')](function(_0x268e05){if(_0x268e05){_0x15e3c5=_0x268e05[_0xba6b('0x14')]({'plain':!![]});_0x4f2e50[_0xba6b('0x26')]=_[_0xba6b('0x22')](db[_0xba6b('0x3b')][_0xba6b('0x3c')]);_0x4f2e50[_0xba6b('0x23')]=_['keys'](_0x3e1071[_0xba6b('0x23')]);_0x4f2e50[_0xba6b('0x24')]=_[_0xba6b('0x25')](_0x4f2e50[_0xba6b('0x26')],_0x4f2e50[_0xba6b('0x23')]);_0x37c4a4[_0xba6b('0x27')]=_[_0xba6b('0x25')](_0x4f2e50[_0xba6b('0x26')],qs[_0xba6b('0x28')](_0x3e1071[_0xba6b('0x23')]['fields']));_0x37c4a4[_0xba6b('0x27')]=_0x37c4a4[_0xba6b('0x27')]['length']?_0x37c4a4[_0xba6b('0x27')]:_0x4f2e50[_0xba6b('0x26')];if(!_0x3e1071[_0xba6b('0x23')]['hasOwnProperty'](_0xba6b('0x3d'))){_0x37c4a4[_0xba6b('0x3e')]=qs[_0xba6b('0x3e')](_0x3e1071['query'][_0xba6b('0x3e')]);_0x37c4a4['offset']=qs['offset'](_0x3e1071['query']['offset']);}_0x37c4a4[_0xba6b('0x3f')]=qs[_0xba6b('0x40')](_0x3e1071[_0xba6b('0x23')]['sort']);_0x37c4a4[_0xba6b('0x41')]=qs['filters'](_['pick'](_0x3e1071[_0xba6b('0x23')],_0x4f2e50[_0xba6b('0x24')]));_0x37c4a4[_0xba6b('0x41')][_0xba6b('0x42')]=_0x268e05['id'];if(_0x3e1071[_0xba6b('0x23')]['filter']){_0x37c4a4['where']=_[_0xba6b('0x2b')](_0x37c4a4[_0xba6b('0x41')],{'$or':_['map'](_0x37c4a4[_0xba6b('0x27')],function(_0x5ac0fe){var _0x3f59de={};_0x3f59de[_0x5ac0fe]={'$like':'%'+_0x3e1071[_0xba6b('0x23')][_0xba6b('0x43')]+'%'};return _0x3f59de;})});}_0x37c4a4=_[_0xba6b('0x2b')]({},_0x37c4a4,_0x3e1071['options']);return db[_0xba6b('0x3b')][_0xba6b('0x44')](_0x37c4a4);}})['then'](function(_0x2731fe){if(_0x2731fe){return db[_0xba6b('0x45')][_0xba6b('0x46')]({'where':{'id':_['map'](_0x2731fe,_0xba6b('0x47')),'role':'agent'},'attributes':['id','name','faxPause',_0xba6b('0x48'),_0xba6b('0x49')]});}})['then'](function(_0xdd7a79){if(_0xdd7a79){return{'count':_0xdd7a79[_0xba6b('0xf')],'rows':_[_0xba6b('0x19')](_0xdd7a79[_0xba6b('0x1f')],function(_0x587aa6){return{'membername':_0x587aa6[_0xba6b('0x18')],'UserId':_0x587aa6['id'],'queue_name':_0x15e3c5[_0xba6b('0x18')],'FaxQueueId':_0x15e3c5['id'],'interface':util[_0xba6b('0x4a')]('%s/%s',_0xba6b('0x4b'),_0x587aa6['name']),'penalty':0x0,'paused':_0x587aa6[_0xba6b('0x4c')],'createdAt':_0x587aa6[_0xba6b('0x49')],'updatedAt':_0x587aa6[_0xba6b('0x48')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xba6b('0x13')](respondWithFilteredResult(_0x29bbad,_0x37c4a4))[_0xba6b('0x20')](handleError(_0x29bbad,null));};exports[_0xba6b('0x4d')]=function(_0x21e692,_0x326ebd){var _0x2056bc={};var _0x54efaf={};var _0x2072bc;var _0x37bfa8;return db[_0xba6b('0x1a')][_0xba6b('0x3a')]({'where':{'id':_0x21e692[_0xba6b('0x37')]['id']}})[_0xba6b('0x13')](handleEntityNotFound(_0x326ebd,null))[_0xba6b('0x13')](function(_0x1442a4){if(_0x1442a4){_0x2072bc=_0x1442a4;_0x54efaf[_0xba6b('0x26')]=_[_0xba6b('0x22')](db[_0xba6b('0x4e')][_0xba6b('0x3c')]);_0x54efaf[_0xba6b('0x23')]=_['keys'](_0x21e692['query']);_0x54efaf[_0xba6b('0x24')]=_[_0xba6b('0x25')](_0x54efaf['model'],_0x54efaf[_0xba6b('0x23')]);_0x2056bc[_0xba6b('0x27')]=_[_0xba6b('0x25')](_0x54efaf[_0xba6b('0x26')],qs[_0xba6b('0x28')](_0x21e692['query'][_0xba6b('0x28')]));_0x2056bc[_0xba6b('0x27')]=_0x2056bc[_0xba6b('0x27')]['length']?_0x2056bc['attributes']:_0x54efaf[_0xba6b('0x26')];_0x2056bc['order']=qs[_0xba6b('0x40')](_0x21e692['query'][_0xba6b('0x40')]);_0x2056bc['where']=qs[_0xba6b('0x24')](_[_0xba6b('0x4f')](_0x21e692['query'],_0x54efaf['filters']));if(_0x21e692[_0xba6b('0x23')]['filter']){_0x2056bc[_0xba6b('0x41')]=_[_0xba6b('0x2b')](_0x2056bc[_0xba6b('0x41')],{'$or':_[_0xba6b('0x19')](_0x2056bc[_0xba6b('0x27')],function(_0x56ae09){var _0xe11c3d={};_0xe11c3d[_0x56ae09]={'$like':'%'+_0x21e692[_0xba6b('0x23')]['filter']+'%'};return _0xe11c3d;})});}_0x2056bc=_[_0xba6b('0x2b')]({},_0x2056bc,_0x21e692[_0xba6b('0x2c')]);return _0x2072bc['getTeams'](_0x2056bc);}})['then'](function(_0x3b4837){if(_0x3b4837){_0x37bfa8=_0x3b4837[_0xba6b('0x29')];if(!_0x21e692['query'][_0xba6b('0x50')]('nolimit')){_0x2056bc[_0xba6b('0x3e')]=qs['limit'](_0x21e692[_0xba6b('0x23')][_0xba6b('0x3e')]);_0x2056bc['offset']=qs[_0xba6b('0x10')](_0x21e692[_0xba6b('0x23')][_0xba6b('0x10')]);}return _0x2072bc[_0xba6b('0x4d')](_0x2056bc);}})['then'](function(_0x166df4){if(_0x166df4){return _0x166df4?{'count':_0x37bfa8,'rows':_0x166df4}:null;}})[_0xba6b('0x13')](respondWithResult(_0x326ebd,null))['catch'](handleError(_0x326ebd,null));};exports[_0xba6b('0x51')]=function(_0x4f0ea3,_0x2c9db2){var _0x573407=_0x4f0ea3[_0xba6b('0x2e')][_0xba6b('0x52')];return db['Team']['findAll']({'where':{'id':_0x573407},'attributes':['id'],'include':[{'model':db['User'],'as':_0xba6b('0x53'),'attributes':['id',_0xba6b('0x18'),_0xba6b('0x54'),'voicePause',_0xba6b('0x55')],'raw':!![]}]})[_0xba6b('0x13')](function(_0x25f58b){if(_0x25f58b){var _0x21d5b7=_[_0xba6b('0x56')](_0x25f58b,function(_0x523279){var _0x110ec0=_0x523279[_0xba6b('0x14')]({'plain':!![]});return _0x110ec0['Agents'];});return db[_0xba6b('0x1a')][_0xba6b('0x36')]({'where':{'id':_0x4f0ea3[_0xba6b('0x37')]['id']}})[_0xba6b('0x13')](function(_0x30506e){return db[_0xba6b('0x57')]['transaction'](function(_0x2ad609){return _0x30506e[_0xba6b('0x51')](_0x573407,{'transaction':_0x2ad609})[_0xba6b('0x13')](function(){return BPromise['each'](_0x21d5b7,function(_0x4f2faa){return db[_0xba6b('0x3b')][_0xba6b('0x58')]({'where':{'UserId':_0x4f2faa['id'],'FaxQueueId':_0x4f0ea3[_0xba6b('0x37')]['id']},'transaction':_0x2ad609});});})[_0xba6b('0x13')](function(){_0x21d5b7['forEach'](function(_0xf85bb6){socket[_0xba6b('0x59')](_0xba6b('0x5a'),{'UserId':_0xf85bb6['id'],'FaxQueueId':_0x30506e['id']});});});});});}})[_0xba6b('0x13')](respondWithStatusCode(_0x2c9db2,null))[_0xba6b('0x20')](handleError(_0x2c9db2,null));};exports['removeTeams']=function(_0x214954,_0x270e4c){return db['Team'][_0xba6b('0x44')]({'where':{'id':_0x214954['query'][_0xba6b('0x52')]},'attributes':['id'],'include':[{'model':db[_0xba6b('0x45')],'as':_0xba6b('0x53'),'attributes':['id'],'raw':!![]}]})[_0xba6b('0x13')](handleEntityNotFound(_0x270e4c,null))[_0xba6b('0x13')](function(_0x3b6ce6){var _0x2f1a44=_[_0xba6b('0x19')](_0x3b6ce6,'id');var _0x276696=[];var _0x309cc1=[];var _0x59b6ea=squel[_0xba6b('0x5b')]();_0x59b6ea['field']('tq.TeamId')[_0xba6b('0x5c')](_0xba6b('0x5d'),'tq')[_0xba6b('0x5e')](_0xba6b('0x5f'),'ut',_0xba6b('0x60'))[_0xba6b('0x41')]('FaxQueueId\x20=\x20?',_0x214954[_0xba6b('0x37')]['id']);for(var _0x3a003d=0x0;_0x3a003d<_0x3b6ce6[_0xba6b('0x29')];_0x3a003d+=0x1){let _0x86fa58=_0x3b6ce6[_0x3a003d];for(var _0x2e4297=0x0;_0x2e4297<_0x86fa58[_0xba6b('0x53')][_0xba6b('0x29')];_0x2e4297+=0x1){let _0x475c57=_0x86fa58['Agents'][_0x2e4297];var _0xa063f6=_0x59b6ea[_0xba6b('0x61')]();_0xa063f6[_0xba6b('0x41')](_0xba6b('0x62'),_0x475c57['id']);_0x309cc1[_0xba6b('0x63')](db[_0xba6b('0x57')][_0xba6b('0x23')](_0xa063f6[_0xba6b('0x64')](),{'type':db[_0xba6b('0x57')][_0xba6b('0x65')]['SELECT']})[_0xba6b('0x13')](function(_0x35521e){if(_0x35521e[_0xba6b('0x29')]===0x1){return _0x475c57['id'];}else{var _0x55e141=_['every'](_[_0xba6b('0x19')](_0x35521e,_0xba6b('0x66')),function(_0x428f9f){return _['includes'](_0x2f1a44,_0x428f9f);});if(_0x55e141){return _0x475c57['id'];}}}));}}return BPromise[_0xba6b('0x67')](_0x309cc1)[_0xba6b('0x13')](function(_0x1d5a33){_0x276696=_(_0x276696)[_0xba6b('0x68')](_0x1d5a33)['compact']()['value']();return db[_0xba6b('0x1a')]['find']({'where':{'id':_0x214954[_0xba6b('0x37')]['id']}})['then'](function(_0x2597b8){return db[_0xba6b('0x57')]['transaction'](function(_0x279c89){return _0x2597b8[_0xba6b('0x69')](_0x214954[_0xba6b('0x23')][_0xba6b('0x52')],{'transaction':_0x279c89})[_0xba6b('0x13')](function(){if(!_[_0xba6b('0x6a')](_0x276696)){return _0x2597b8['removeAgents'](_0x276696,{'transaction':_0x279c89});}})['then'](function(){_0x276696[_0xba6b('0x6b')](function(_0x5ee33d){socket[_0xba6b('0x59')](_0xba6b('0x6c'),{'UserId':_0x5ee33d,'FaxQueueId':_0x2597b8['id']});});});});});});})[_0xba6b('0x13')](respondWithStatusCode(_0x270e4c,null))['catch'](handleError(_0x270e4c,null));};exports[_0xba6b('0x6d')]=function(_0x2d8590,_0x8244cf){return db[_0xba6b('0x1a')][_0xba6b('0x36')]({'where':{'id':_0x2d8590['params']['id']}})[_0xba6b('0x13')](handleEntityNotFound(_0x8244cf,null))[_0xba6b('0x13')](function(_0x69582a){if(_0x69582a){return _0x69582a[_0xba6b('0x6d')](_0x2d8590[_0xba6b('0x2e')][_0xba6b('0x52')],_[_0xba6b('0x6e')](_0x2d8590[_0xba6b('0x2e')],['ids','id'])||{})[_0xba6b('0x6f')](function(_0x1ec6d5){for(var _0x2b82cc=0x0;_0x2b82cc<_0x2d8590[_0xba6b('0x2e')][_0xba6b('0x52')][_0xba6b('0x29')];_0x2b82cc+=0x1){socket[_0xba6b('0x59')](_0xba6b('0x5a'),{'UserId':Number(_0x2d8590[_0xba6b('0x2e')][_0xba6b('0x52')][_0x2b82cc]),'FaxQueueId':Number(_0x2d8590[_0xba6b('0x37')]['id'])});}return _0x1ec6d5;});}})[_0xba6b('0x13')](respondWithResult(_0x8244cf,null))[_0xba6b('0x20')](handleError(_0x8244cf,null));};exports[_0xba6b('0x70')]=function(_0x50aa25,_0x4fa4ef){return db['FaxQueue']['find']({'where':{'id':_0x50aa25['params']['id']}})[_0xba6b('0x13')](handleEntityNotFound(_0x4fa4ef,null))[_0xba6b('0x13')](function(_0x297ab8){if(_0x297ab8){return _0x297ab8[_0xba6b('0x70')](_0x50aa25[_0xba6b('0x23')]['ids'])[_0xba6b('0x13')](function(){if(_['isArray'](_0x50aa25['query']['ids'])){for(var _0x677b76=0x0;_0x677b76<_0x50aa25[_0xba6b('0x23')][_0xba6b('0x52')]['length'];_0x677b76+=0x1){socket['emit'](_0xba6b('0x6c'),{'UserId':Number(_0x50aa25[_0xba6b('0x23')][_0xba6b('0x52')][_0x677b76]),'FaxQueueId':Number(_0x50aa25['params']['id'])});}}else{socket[_0xba6b('0x59')](_0xba6b('0x6c'),{'UserId':Number(_0x50aa25['query'][_0xba6b('0x52')]),'FaxQueueId':Number(_0x50aa25['params']['id'])});}});}})[_0xba6b('0x13')](respondWithStatusCode(_0x4fa4ef,null))[_0xba6b('0x20')](handleError(_0x4fa4ef,null));};exports[_0xba6b('0x71')]=function(_0x33f7ce,_0xf93a0d){var _0x51a44e={};var _0x11ee0b={};var _0x53b63a;var _0x3b172b;return db[_0xba6b('0x1a')]['findOne']({'where':{'id':_0x33f7ce[_0xba6b('0x37')]['id']}})['then'](handleEntityNotFound(_0xf93a0d,null))[_0xba6b('0x13')](function(_0x671948){if(_0x671948){_0x53b63a=_0x671948;_0x11ee0b['model']=_[_0xba6b('0x22')](db[_0xba6b('0x45')]['rawAttributes']);_0x11ee0b[_0xba6b('0x23')]=_[_0xba6b('0x22')](_0x33f7ce[_0xba6b('0x23')]);_0x11ee0b[_0xba6b('0x24')]=_[_0xba6b('0x25')](_0x11ee0b[_0xba6b('0x26')],_0x11ee0b[_0xba6b('0x23')]);_0x51a44e['attributes']=_['intersection'](_0x11ee0b[_0xba6b('0x26')],qs[_0xba6b('0x28')](_0x33f7ce[_0xba6b('0x23')][_0xba6b('0x28')]));_0x51a44e[_0xba6b('0x27')]=_0x51a44e['attributes'][_0xba6b('0x29')]?_0x51a44e[_0xba6b('0x27')]:_0x11ee0b[_0xba6b('0x26')];_0x51a44e[_0xba6b('0x3f')]=qs[_0xba6b('0x40')](_0x33f7ce['query']['sort']);_0x51a44e[_0xba6b('0x41')]=qs[_0xba6b('0x24')](_[_0xba6b('0x4f')](_0x33f7ce[_0xba6b('0x23')],_0x11ee0b[_0xba6b('0x24')]));if(_0x33f7ce['query'][_0xba6b('0x43')]){_0x51a44e['where']=_['merge'](_0x51a44e[_0xba6b('0x41')],{'$or':_[_0xba6b('0x19')](_0x51a44e[_0xba6b('0x27')],function(_0x23c320){var _0x51fa51={};_0x51fa51[_0x23c320]={'$like':'%'+_0x33f7ce['query'][_0xba6b('0x43')]+'%'};return _0x51fa51;})});}_0x51a44e=_[_0xba6b('0x2b')]({},_0x51a44e,_0x33f7ce['options']);return _0x53b63a[_0xba6b('0x71')](_0x51a44e);}})['then'](function(_0x44ecea){if(_0x44ecea){_0x3b172b=_0x44ecea[_0xba6b('0x29')];if(!_0x33f7ce['query']['hasOwnProperty'](_0xba6b('0x3d'))){_0x51a44e[_0xba6b('0x3e')]=qs[_0xba6b('0x3e')](_0x33f7ce[_0xba6b('0x23')]['limit']);_0x51a44e['offset']=qs[_0xba6b('0x10')](_0x33f7ce['query']['offset']);}return _0x53b63a[_0xba6b('0x71')](_0x51a44e);}})[_0xba6b('0x13')](function(_0x2eee24){if(_0x2eee24){return _0x2eee24?{'count':_0x3b172b,'rows':_0x2eee24}:null;}})['then'](respondWithResult(_0xf93a0d,null))[_0xba6b('0x20')](handleError(_0xf93a0d,null));}; \ No newline at end of file +var _0x8ca9=['ids','Agents','voicePause','flatMap','sequelize','transaction','addTeams','each','findOrCreate','forEach','emit','userFaxQueue:save','removeTeams','select','field','tq.TeamId','from','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','FaxQueueId\x20=\x20?','clone','push','toString','SELECT','every','TeamId','includes','union','value','isEmpty','removeAgents','addAgents','omit','spread','userFaxQueue:remove','getAgents','bluebird','util','lodash','squel','ioredis','../../components/parsers/qs','../../config/logger','../../mysqldb','defaults','localhost','socket.io-emitter','redis','./faxQueue.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','get','FaxQueues','error','name','send','index','map','FaxQueue','type','include','query','rows','params','keys','filters','intersection','attributes','model','fields','length','includeAll','merge','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','catch','describe','getMembers','findOne','UserFaxQueue','rawAttributes','hasOwnProperty','nolimit','order','sort','where','pick','FaxQueueId','filter','options','findAll','User','UserId','agent','updatedAt','createdAt','SIP','faxPause','getTeams','Team'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0x8ca9,0x9c));var _0x98ca=function(_0x21f50a,_0xcc877f){_0x21f50a=_0x21f50a-0x0;var _0x2e5850=_0x8ca9[_0x21f50a];return _0x2e5850;};'use strict';var BPromise=require(_0x98ca('0x0'));var util=require(_0x98ca('0x1'));var _=require(_0x98ca('0x2'));var squel=require(_0x98ca('0x3'));var Redis=require(_0x98ca('0x4'));var qs=require(_0x98ca('0x5'));var logger=require(_0x98ca('0x6'))('api');var config=require('../../config/environment');var db=require(_0x98ca('0x7'))['db'];config['redis']=_[_0x98ca('0x8')](config['redis'],{'host':_0x98ca('0x9'),'port':0x18eb});var socket=require(_0x98ca('0xa'))(new Redis(config[_0x98ca('0xb')]));require(_0x98ca('0xc'))[_0x98ca('0xd')](socket);function respondWithStatusCode(_0x28a37a,_0x162bd0){_0x162bd0=_0x162bd0||0xcc;return function(_0x210234){if(_0x210234){return _0x28a37a[_0x98ca('0xe')](_0x162bd0);}return _0x28a37a[_0x98ca('0xf')](_0x162bd0)[_0x98ca('0x10')]();};}function respondWithResult(_0x2074fb,_0x25b06a){_0x25b06a=_0x25b06a||0xc8;return function(_0x1bec99){if(_0x1bec99){return _0x2074fb[_0x98ca('0xf')](_0x25b06a)[_0x98ca('0x11')](_0x1bec99);}};}function respondWithFilteredResult(_0x276213,_0x17ee87){return function(_0x496b46){if(_0x496b46){var _0x16221a=typeof _0x17ee87[_0x98ca('0x12')]===_0x98ca('0x13')&&typeof _0x17ee87[_0x98ca('0x14')]==='undefined';var _0xf78589=_0x496b46[_0x98ca('0x15')];var _0x9a230e=_0x16221a?0x0:_0x17ee87[_0x98ca('0x12')];var _0x3df0ef=_0x16221a?_0x496b46[_0x98ca('0x15')]:_0x17ee87[_0x98ca('0x12')]+_0x17ee87['limit'];var _0x330713;if(_0x3df0ef>=_0xf78589){_0x3df0ef=_0xf78589;_0x330713=0xc8;}else{_0x330713=0xce;}_0x276213[_0x98ca('0xf')](_0x330713);return _0x276213[_0x98ca('0x16')](_0x98ca('0x17'),_0x9a230e+'-'+_0x3df0ef+'/'+_0xf78589)['json'](_0x496b46);}return null;};}function saveUpdates(_0x238c1a){return function(_0x3c2f65){if(_0x3c2f65){return _0x3c2f65[_0x98ca('0x18')](_0x238c1a)[_0x98ca('0x19')](function(_0x4523bb){return _0x4523bb;});}return null;};}function removeEntity(_0x3ca209){return function(_0x28c8a6){if(_0x28c8a6){return _0x28c8a6[_0x98ca('0x1a')]()[_0x98ca('0x19')](function(){var _0x110f9f=_0x28c8a6[_0x98ca('0x1b')]({'plain':!![]});var _0x4806a3=_0x98ca('0x1c');return db['UserProfileResource'][_0x98ca('0x1a')]({'where':{'type':_0x4806a3,'resourceId':_0x110f9f['id']}})[_0x98ca('0x19')](function(){return _0x28c8a6;});})['then'](function(){_0x3ca209['status'](0xcc)[_0x98ca('0x10')]();});}};}function handleEntityNotFound(_0x170688){return function(_0x130544){if(!_0x130544){_0x170688['sendStatus'](0x194);}return _0x130544;};}function handleError(_0x2f7742,_0xc23332){_0xc23332=_0xc23332||0x1f4;return function(_0x56f799){logger[_0x98ca('0x1d')](_0x56f799['stack']);if(_0x56f799[_0x98ca('0x1e')]){delete _0x56f799[_0x98ca('0x1e')];}_0x2f7742[_0x98ca('0xf')](_0xc23332)[_0x98ca('0x1f')](_0x56f799);};}exports[_0x98ca('0x20')]=function(_0xe5091e,_0x2a59e3){var _0x50b1a2={};var _0x2029cb={'count':0x0,'rows':[]};var _0x4fc3c9=_[_0x98ca('0x21')](db[_0x98ca('0x22')]['rawAttributes'],function(_0x1f569b){return{'name':_0x1f569b['fieldName'],'type':_0x1f569b[_0x98ca('0x23')]['key']};});_0x50b1a2=qs['getOptions'](_0x4fc3c9,_0xe5091e);var _0x14bfb4={'where':_0x50b1a2['where']};return db[_0x98ca('0x22')][_0x98ca('0x15')](_0x14bfb4)[_0x98ca('0x19')](function(_0x21a12a){_0x2029cb[_0x98ca('0x15')]=_0x21a12a;_0x50b1a2[_0x98ca('0x24')]=qs[_0x98ca('0x24')](_0xe5091e[_0x98ca('0x25')]);return db[_0x98ca('0x22')]['findAll'](_0x50b1a2);})[_0x98ca('0x19')](function(_0x4cc74f){_0x2029cb[_0x98ca('0x26')]=_0x4cc74f;return _0x2029cb;})[_0x98ca('0x19')](respondWithFilteredResult(_0x2a59e3,_0x50b1a2))['catch'](handleError(_0x2a59e3,null));};exports['show']=function(_0x5adf7d,_0x4b37b4){var _0x3990d7={'raw':!![],'where':{'id':_0x5adf7d[_0x98ca('0x27')]['id']}},_0x4f1622={};_0x4f1622['model']=_[_0x98ca('0x28')](db[_0x98ca('0x22')]['rawAttributes']);_0x4f1622[_0x98ca('0x25')]=_[_0x98ca('0x28')](_0x5adf7d['query']);_0x4f1622[_0x98ca('0x29')]=_[_0x98ca('0x2a')](_0x4f1622['model'],_0x4f1622[_0x98ca('0x25')]);_0x3990d7[_0x98ca('0x2b')]=_[_0x98ca('0x2a')](_0x4f1622[_0x98ca('0x2c')],qs[_0x98ca('0x2d')](_0x5adf7d['query'][_0x98ca('0x2d')]));_0x3990d7[_0x98ca('0x2b')]=_0x3990d7['attributes'][_0x98ca('0x2e')]?_0x3990d7[_0x98ca('0x2b')]:_0x4f1622[_0x98ca('0x2c')];if(_0x5adf7d['query'][_0x98ca('0x2f')]){_0x3990d7[_0x98ca('0x24')]=[{'all':!![]}];}_0x3990d7=_[_0x98ca('0x30')]({},_0x3990d7,_0x5adf7d['options']);return db[_0x98ca('0x22')][_0x98ca('0x31')](_0x3990d7)[_0x98ca('0x19')](handleEntityNotFound(_0x4b37b4,null))['then'](respondWithResult(_0x4b37b4,null))['catch'](handleError(_0x4b37b4,null));};exports[_0x98ca('0x32')]=function(_0xe77d02,_0x3b13f9){return db['FaxQueue'][_0x98ca('0x32')](_0xe77d02[_0x98ca('0x33')],{})[_0x98ca('0x19')](function(_0x5a9de7){var _0x1f513b=_0xe77d02[_0x98ca('0x34')][_0x98ca('0x1b')]({'plain':!![]});if(!_0x1f513b)throw new Error(_0x98ca('0x35'));if(_0x1f513b[_0x98ca('0x36')]==='user'){var _0x578b2f=_0x5a9de7['get']({'plain':!![]});var _0x405691=_0x98ca('0x1c');return db[_0x98ca('0x37')][_0x98ca('0x31')]({'where':{'name':_0x405691,'userProfileId':_0x1f513b[_0x98ca('0x38')]},'raw':!![]})[_0x98ca('0x19')](function(_0x29801f){if(_0x29801f&&_0x29801f['autoAssociation']===0x0){return db['UserProfileResource'][_0x98ca('0x32')]({'name':_0x578b2f[_0x98ca('0x1e')],'resourceId':_0x578b2f['id'],'type':_0x29801f[_0x98ca('0x1e')],'sectionId':_0x29801f['id']},{})[_0x98ca('0x19')](function(){return _0x5a9de7;});}else{return _0x5a9de7;}})[_0x98ca('0x39')](function(_0x535fdc){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x535fdc);throw _0x535fdc;});}return _0x5a9de7;})[_0x98ca('0x19')](respondWithResult(_0x3b13f9,0xc9))[_0x98ca('0x39')](handleError(_0x3b13f9,null));};exports[_0x98ca('0x18')]=function(_0x3f260b,_0x4ede34){if(_0x3f260b['body']['id']){delete _0x3f260b[_0x98ca('0x33')]['id'];}return db[_0x98ca('0x22')][_0x98ca('0x31')]({'where':{'id':_0x3f260b[_0x98ca('0x27')]['id']}})[_0x98ca('0x19')](handleEntityNotFound(_0x4ede34,null))[_0x98ca('0x19')](saveUpdates(_0x3f260b[_0x98ca('0x33')],null))[_0x98ca('0x19')](respondWithResult(_0x4ede34,null))[_0x98ca('0x39')](handleError(_0x4ede34,null));};exports[_0x98ca('0x1a')]=function(_0x2ee7a3,_0x49bd0c){return db[_0x98ca('0x22')][_0x98ca('0x31')]({'where':{'id':_0x2ee7a3[_0x98ca('0x27')]['id']}})[_0x98ca('0x19')](handleEntityNotFound(_0x49bd0c,null))[_0x98ca('0x19')](removeEntity(_0x49bd0c,null))[_0x98ca('0x39')](handleError(_0x49bd0c,null));};exports[_0x98ca('0x3a')]=function(_0x2b9e89,_0x4a4c95){return db['FaxQueue'][_0x98ca('0x3a')]()[_0x98ca('0x19')](respondWithResult(_0x4a4c95,null))['catch'](handleError(_0x4a4c95,null));};exports[_0x98ca('0x3b')]=function(_0x4f2444,_0x3946b3){var _0x39f4fd={'raw':!![],'where':{}},_0x6a9045={},_0x1dbf62;return db[_0x98ca('0x22')][_0x98ca('0x3c')]({'where':{'id':_0x4f2444[_0x98ca('0x27')]['id']}})[_0x98ca('0x19')](handleEntityNotFound(_0x3946b3,null))[_0x98ca('0x19')](function(_0x42a53d){if(_0x42a53d){_0x1dbf62=_0x42a53d[_0x98ca('0x1b')]({'plain':!![]});_0x6a9045[_0x98ca('0x2c')]=_['keys'](db[_0x98ca('0x3d')][_0x98ca('0x3e')]);_0x6a9045[_0x98ca('0x25')]=_[_0x98ca('0x28')](_0x4f2444['query']);_0x6a9045[_0x98ca('0x29')]=_[_0x98ca('0x2a')](_0x6a9045[_0x98ca('0x2c')],_0x6a9045[_0x98ca('0x25')]);_0x39f4fd[_0x98ca('0x2b')]=_[_0x98ca('0x2a')](_0x6a9045[_0x98ca('0x2c')],qs['fields'](_0x4f2444['query']['fields']));_0x39f4fd[_0x98ca('0x2b')]=_0x39f4fd[_0x98ca('0x2b')][_0x98ca('0x2e')]?_0x39f4fd[_0x98ca('0x2b')]:_0x6a9045['model'];if(!_0x4f2444['query'][_0x98ca('0x3f')](_0x98ca('0x40'))){_0x39f4fd[_0x98ca('0x14')]=qs[_0x98ca('0x14')](_0x4f2444[_0x98ca('0x25')][_0x98ca('0x14')]);_0x39f4fd[_0x98ca('0x12')]=qs[_0x98ca('0x12')](_0x4f2444[_0x98ca('0x25')][_0x98ca('0x12')]);}_0x39f4fd[_0x98ca('0x41')]=qs[_0x98ca('0x42')](_0x4f2444[_0x98ca('0x25')]['sort']);_0x39f4fd[_0x98ca('0x43')]=qs['filters'](_[_0x98ca('0x44')](_0x4f2444[_0x98ca('0x25')],_0x6a9045[_0x98ca('0x29')]));_0x39f4fd[_0x98ca('0x43')][_0x98ca('0x45')]=_0x42a53d['id'];if(_0x4f2444['query'][_0x98ca('0x46')]){_0x39f4fd[_0x98ca('0x43')]=_['merge'](_0x39f4fd[_0x98ca('0x43')],{'$or':_[_0x98ca('0x21')](_0x39f4fd[_0x98ca('0x2b')],function(_0x5ddaae){var _0x9525bb={};_0x9525bb[_0x5ddaae]={'$like':'%'+_0x4f2444[_0x98ca('0x25')]['filter']+'%'};return _0x9525bb;})});}_0x39f4fd=_[_0x98ca('0x30')]({},_0x39f4fd,_0x4f2444[_0x98ca('0x47')]);return db[_0x98ca('0x3d')][_0x98ca('0x48')](_0x39f4fd);}})[_0x98ca('0x19')](function(_0x42a2ab){if(_0x42a2ab){return db[_0x98ca('0x49')]['findAndCountAll']({'where':{'id':_[_0x98ca('0x21')](_0x42a2ab,_0x98ca('0x4a')),'role':_0x98ca('0x4b')},'attributes':['id','name','faxPause',_0x98ca('0x4c'),_0x98ca('0x4d')]});}})[_0x98ca('0x19')](function(_0x44ce87){if(_0x44ce87){return{'count':_0x44ce87[_0x98ca('0x15')],'rows':_[_0x98ca('0x21')](_0x44ce87[_0x98ca('0x26')],function(_0x205645){return{'membername':_0x205645['name'],'UserId':_0x205645['id'],'queue_name':_0x1dbf62[_0x98ca('0x1e')],'FaxQueueId':_0x1dbf62['id'],'interface':util['format']('%s/%s',_0x98ca('0x4e'),_0x205645[_0x98ca('0x1e')]),'penalty':0x0,'paused':_0x205645[_0x98ca('0x4f')],'createdAt':_0x205645[_0x98ca('0x4d')],'updatedAt':_0x205645[_0x98ca('0x4c')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x98ca('0x19')](respondWithFilteredResult(_0x3946b3,_0x39f4fd))['catch'](handleError(_0x3946b3,null));};exports[_0x98ca('0x50')]=function(_0x3adb59,_0x2ea856){var _0x59f5ae={};var _0x5ecc8e={};var _0x37f0bc;var _0x2143b2;return db[_0x98ca('0x22')][_0x98ca('0x3c')]({'where':{'id':_0x3adb59[_0x98ca('0x27')]['id']}})[_0x98ca('0x19')](handleEntityNotFound(_0x2ea856,null))[_0x98ca('0x19')](function(_0x2e2fcb){if(_0x2e2fcb){_0x37f0bc=_0x2e2fcb;_0x5ecc8e[_0x98ca('0x2c')]=_[_0x98ca('0x28')](db[_0x98ca('0x51')][_0x98ca('0x3e')]);_0x5ecc8e['query']=_[_0x98ca('0x28')](_0x3adb59[_0x98ca('0x25')]);_0x5ecc8e[_0x98ca('0x29')]=_[_0x98ca('0x2a')](_0x5ecc8e[_0x98ca('0x2c')],_0x5ecc8e[_0x98ca('0x25')]);_0x59f5ae[_0x98ca('0x2b')]=_[_0x98ca('0x2a')](_0x5ecc8e[_0x98ca('0x2c')],qs['fields'](_0x3adb59[_0x98ca('0x25')][_0x98ca('0x2d')]));_0x59f5ae[_0x98ca('0x2b')]=_0x59f5ae['attributes'][_0x98ca('0x2e')]?_0x59f5ae[_0x98ca('0x2b')]:_0x5ecc8e[_0x98ca('0x2c')];_0x59f5ae[_0x98ca('0x41')]=qs[_0x98ca('0x42')](_0x3adb59['query'][_0x98ca('0x42')]);_0x59f5ae[_0x98ca('0x43')]=qs['filters'](_[_0x98ca('0x44')](_0x3adb59[_0x98ca('0x25')],_0x5ecc8e[_0x98ca('0x29')]));if(_0x3adb59[_0x98ca('0x25')][_0x98ca('0x46')]){_0x59f5ae[_0x98ca('0x43')]=_['merge'](_0x59f5ae[_0x98ca('0x43')],{'$or':_[_0x98ca('0x21')](_0x59f5ae[_0x98ca('0x2b')],function(_0xdb7eeb){var _0x519816={};_0x519816[_0xdb7eeb]={'$like':'%'+_0x3adb59[_0x98ca('0x25')][_0x98ca('0x46')]+'%'};return _0x519816;})});}_0x59f5ae=_['merge']({},_0x59f5ae,_0x3adb59[_0x98ca('0x47')]);return _0x37f0bc[_0x98ca('0x50')](_0x59f5ae);}})['then'](function(_0x30c8c0){if(_0x30c8c0){_0x2143b2=_0x30c8c0[_0x98ca('0x2e')];if(!_0x3adb59[_0x98ca('0x25')][_0x98ca('0x3f')](_0x98ca('0x40'))){_0x59f5ae[_0x98ca('0x14')]=qs['limit'](_0x3adb59[_0x98ca('0x25')][_0x98ca('0x14')]);_0x59f5ae[_0x98ca('0x12')]=qs[_0x98ca('0x12')](_0x3adb59[_0x98ca('0x25')][_0x98ca('0x12')]);}return _0x37f0bc[_0x98ca('0x50')](_0x59f5ae);}})['then'](function(_0x248582){if(_0x248582){return _0x248582?{'count':_0x2143b2,'rows':_0x248582}:null;}})[_0x98ca('0x19')](respondWithResult(_0x2ea856,null))[_0x98ca('0x39')](handleError(_0x2ea856,null));};exports['addTeams']=function(_0x142325,_0x39c158){var _0xd7bc2b=_0x142325['body'][_0x98ca('0x52')];return db[_0x98ca('0x51')][_0x98ca('0x48')]({'where':{'id':_0xd7bc2b},'attributes':['id'],'include':[{'model':db[_0x98ca('0x49')],'as':_0x98ca('0x53'),'attributes':['id','name','online',_0x98ca('0x54'),'interface'],'raw':!![]}]})[_0x98ca('0x19')](function(_0x119ef7){if(_0x119ef7){var _0x9ebc46=_[_0x98ca('0x55')](_0x119ef7,function(_0x50e9e3){var _0x2e269b=_0x50e9e3[_0x98ca('0x1b')]({'plain':!![]});return _0x2e269b['Agents'];});return db[_0x98ca('0x22')][_0x98ca('0x31')]({'where':{'id':_0x142325[_0x98ca('0x27')]['id']}})[_0x98ca('0x19')](function(_0x45c25f){return db[_0x98ca('0x56')][_0x98ca('0x57')](function(_0x25cfb0){return _0x45c25f[_0x98ca('0x58')](_0xd7bc2b,{'transaction':_0x25cfb0})[_0x98ca('0x19')](function(){return BPromise[_0x98ca('0x59')](_0x9ebc46,function(_0x21b803){return db[_0x98ca('0x3d')][_0x98ca('0x5a')]({'where':{'UserId':_0x21b803['id'],'FaxQueueId':_0x142325[_0x98ca('0x27')]['id']},'transaction':_0x25cfb0});});})[_0x98ca('0x19')](function(){_0x9ebc46[_0x98ca('0x5b')](function(_0xee90db){socket[_0x98ca('0x5c')](_0x98ca('0x5d'),{'UserId':_0xee90db['id'],'FaxQueueId':_0x45c25f['id']});});});});});}})[_0x98ca('0x19')](respondWithStatusCode(_0x39c158,null))['catch'](handleError(_0x39c158,null));};exports[_0x98ca('0x5e')]=function(_0x37aaf6,_0x5e1044){return db[_0x98ca('0x51')][_0x98ca('0x48')]({'where':{'id':_0x37aaf6['query'][_0x98ca('0x52')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x98ca('0x53'),'attributes':['id'],'raw':!![]}]})[_0x98ca('0x19')](handleEntityNotFound(_0x5e1044,null))[_0x98ca('0x19')](function(_0x464b29){var _0x3b212d=_['map'](_0x464b29,'id');var _0x54975d=[];var _0x2a997d=[];var _0x3f1057=squel[_0x98ca('0x5f')]();_0x3f1057[_0x98ca('0x60')](_0x98ca('0x61'))[_0x98ca('0x62')]('team_has_fax_queues','tq')[_0x98ca('0x63')](_0x98ca('0x64'),'ut',_0x98ca('0x65'))[_0x98ca('0x43')](_0x98ca('0x66'),_0x37aaf6[_0x98ca('0x27')]['id']);for(var _0x19904b=0x0;_0x19904b<_0x464b29[_0x98ca('0x2e')];_0x19904b+=0x1){let _0x12ee29=_0x464b29[_0x19904b];for(var _0x192e43=0x0;_0x192e43<_0x12ee29[_0x98ca('0x53')][_0x98ca('0x2e')];_0x192e43+=0x1){let _0x4f329e=_0x12ee29['Agents'][_0x192e43];var _0x164006=_0x3f1057[_0x98ca('0x67')]();_0x164006[_0x98ca('0x43')]('ut.UserId\x20=\x20?',_0x4f329e['id']);_0x2a997d[_0x98ca('0x68')](db[_0x98ca('0x56')][_0x98ca('0x25')](_0x164006[_0x98ca('0x69')](),{'type':db[_0x98ca('0x56')]['QueryTypes'][_0x98ca('0x6a')]})[_0x98ca('0x19')](function(_0x5de908){if(_0x5de908[_0x98ca('0x2e')]===0x1){return _0x4f329e['id'];}else{var _0x430135=_[_0x98ca('0x6b')](_['map'](_0x5de908,_0x98ca('0x6c')),function(_0x35b123){return _[_0x98ca('0x6d')](_0x3b212d,_0x35b123);});if(_0x430135){return _0x4f329e['id'];}}}));}}return BPromise['all'](_0x2a997d)[_0x98ca('0x19')](function(_0x25d199){_0x54975d=_(_0x54975d)[_0x98ca('0x6e')](_0x25d199)['compact']()[_0x98ca('0x6f')]();return db['FaxQueue'][_0x98ca('0x31')]({'where':{'id':_0x37aaf6[_0x98ca('0x27')]['id']}})['then'](function(_0x326920){return db[_0x98ca('0x56')][_0x98ca('0x57')](function(_0x5ea550){return _0x326920['removeTeams'](_0x37aaf6[_0x98ca('0x25')][_0x98ca('0x52')],{'transaction':_0x5ea550})[_0x98ca('0x19')](function(){if(!_[_0x98ca('0x70')](_0x54975d)){return _0x326920[_0x98ca('0x71')](_0x54975d,{'transaction':_0x5ea550});}})[_0x98ca('0x19')](function(){_0x54975d[_0x98ca('0x5b')](function(_0x410932){socket[_0x98ca('0x5c')]('userFaxQueue:remove',{'UserId':_0x410932,'FaxQueueId':_0x326920['id']});});});});});});})[_0x98ca('0x19')](respondWithStatusCode(_0x5e1044,null))[_0x98ca('0x39')](handleError(_0x5e1044,null));};exports[_0x98ca('0x72')]=function(_0x2fa265,_0x11076a){return db[_0x98ca('0x22')][_0x98ca('0x31')]({'where':{'id':_0x2fa265[_0x98ca('0x27')]['id']}})[_0x98ca('0x19')](handleEntityNotFound(_0x11076a,null))[_0x98ca('0x19')](function(_0x461736){if(_0x461736){return _0x461736[_0x98ca('0x72')](_0x2fa265['body'][_0x98ca('0x52')],_[_0x98ca('0x73')](_0x2fa265[_0x98ca('0x33')],[_0x98ca('0x52'),'id'])||{})[_0x98ca('0x74')](function(_0x239b13){for(var _0x108e13=0x0;_0x108e13<_0x2fa265['body'][_0x98ca('0x52')][_0x98ca('0x2e')];_0x108e13+=0x1){socket[_0x98ca('0x5c')](_0x98ca('0x5d'),{'UserId':Number(_0x2fa265[_0x98ca('0x33')]['ids'][_0x108e13]),'FaxQueueId':Number(_0x2fa265[_0x98ca('0x27')]['id'])});}return _0x239b13;});}})[_0x98ca('0x19')](respondWithResult(_0x11076a,null))[_0x98ca('0x39')](handleError(_0x11076a,null));};exports['removeAgents']=function(_0x191779,_0x58a2d2){return db['FaxQueue'][_0x98ca('0x31')]({'where':{'id':_0x191779[_0x98ca('0x27')]['id']}})['then'](handleEntityNotFound(_0x58a2d2,null))['then'](function(_0x5bc317){if(_0x5bc317){return _0x5bc317['removeAgents'](_0x191779[_0x98ca('0x25')]['ids'])[_0x98ca('0x19')](function(){if(_['isArray'](_0x191779['query'][_0x98ca('0x52')])){for(var _0x426b0d=0x0;_0x426b0d<_0x191779[_0x98ca('0x25')]['ids'][_0x98ca('0x2e')];_0x426b0d+=0x1){socket['emit']('userFaxQueue:remove',{'UserId':Number(_0x191779[_0x98ca('0x25')][_0x98ca('0x52')][_0x426b0d]),'FaxQueueId':Number(_0x191779[_0x98ca('0x27')]['id'])});}}else{socket[_0x98ca('0x5c')](_0x98ca('0x75'),{'UserId':Number(_0x191779[_0x98ca('0x25')][_0x98ca('0x52')]),'FaxQueueId':Number(_0x191779['params']['id'])});}});}})[_0x98ca('0x19')](respondWithStatusCode(_0x58a2d2,null))[_0x98ca('0x39')](handleError(_0x58a2d2,null));};exports[_0x98ca('0x76')]=function(_0x165799,_0x13d426){var _0x26a31d={};var _0x46af62={};var _0x263585;var _0x59d994;return db['FaxQueue']['findOne']({'where':{'id':_0x165799[_0x98ca('0x27')]['id']}})['then'](handleEntityNotFound(_0x13d426,null))[_0x98ca('0x19')](function(_0x1d2201){if(_0x1d2201){_0x263585=_0x1d2201;_0x46af62['model']=_[_0x98ca('0x28')](db[_0x98ca('0x49')][_0x98ca('0x3e')]);_0x46af62[_0x98ca('0x25')]=_[_0x98ca('0x28')](_0x165799['query']);_0x46af62['filters']=_['intersection'](_0x46af62[_0x98ca('0x2c')],_0x46af62['query']);_0x26a31d[_0x98ca('0x2b')]=_['intersection'](_0x46af62['model'],qs[_0x98ca('0x2d')](_0x165799['query'][_0x98ca('0x2d')]));_0x26a31d['attributes']=_0x26a31d[_0x98ca('0x2b')][_0x98ca('0x2e')]?_0x26a31d[_0x98ca('0x2b')]:_0x46af62[_0x98ca('0x2c')];_0x26a31d[_0x98ca('0x41')]=qs[_0x98ca('0x42')](_0x165799[_0x98ca('0x25')][_0x98ca('0x42')]);_0x26a31d[_0x98ca('0x43')]=qs['filters'](_[_0x98ca('0x44')](_0x165799[_0x98ca('0x25')],_0x46af62[_0x98ca('0x29')]));if(_0x165799[_0x98ca('0x25')][_0x98ca('0x46')]){_0x26a31d[_0x98ca('0x43')]=_[_0x98ca('0x30')](_0x26a31d[_0x98ca('0x43')],{'$or':_[_0x98ca('0x21')](_0x26a31d['attributes'],function(_0x3d7d4f){var _0x1ee052={};_0x1ee052[_0x3d7d4f]={'$like':'%'+_0x165799['query']['filter']+'%'};return _0x1ee052;})});}_0x26a31d=_[_0x98ca('0x30')]({},_0x26a31d,_0x165799[_0x98ca('0x47')]);return _0x263585['getAgents'](_0x26a31d);}})[_0x98ca('0x19')](function(_0x119ffb){if(_0x119ffb){_0x59d994=_0x119ffb[_0x98ca('0x2e')];if(!_0x165799[_0x98ca('0x25')]['hasOwnProperty'](_0x98ca('0x40'))){_0x26a31d['limit']=qs['limit'](_0x165799['query'][_0x98ca('0x14')]);_0x26a31d[_0x98ca('0x12')]=qs[_0x98ca('0x12')](_0x165799['query'][_0x98ca('0x12')]);}return _0x263585[_0x98ca('0x76')](_0x26a31d);}})[_0x98ca('0x19')](function(_0x17d926){if(_0x17d926){return _0x17d926?{'count':_0x59d994,'rows':_0x17d926}:null;}})['then'](respondWithResult(_0x13d426,null))[_0x98ca('0x39')](handleError(_0x13d426,null));}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.events.js b/server/api/faxQueue/faxQueue.events.js index 7ad30cf..5c39b27 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 _0x02e9=['exports','events','../../mysqldb','FaxQueue','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x57643b,_0x1706fe){var _0x53a35b=function(_0x2625e8){while(--_0x2625e8){_0x57643b['push'](_0x57643b['shift']());}};_0x53a35b(++_0x1706fe);}(_0x02e9,0x9b));var _0x902e=function(_0x175eb9,_0x3d724a){_0x175eb9=_0x175eb9-0x0;var _0x34de13=_0x02e9[_0x175eb9];return _0x34de13;};'use strict';var EventEmitter=require(_0x902e('0x0'));var FaxQueue=require(_0x902e('0x1'))['db'][_0x902e('0x2')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0x902e('0x3')](0x0);var events={'afterCreate':_0x902e('0x4'),'afterUpdate':_0x902e('0x5'),'afterDestroy':_0x902e('0x6')};function emitEvent(_0x1e1b09){return function(_0x38741b,_0x176d3d,_0x2f6fa5){FaxQueueEvents[_0x902e('0x7')](_0x1e1b09+':'+_0x38741b['id'],_0x38741b);FaxQueueEvents['emit'](_0x1e1b09,_0x38741b);_0x2f6fa5(null);};}for(var e in events){if(events[_0x902e('0x8')](e)){var event=events[e];FaxQueue[_0x902e('0x9')](e,emitEvent(event));}}module[_0x902e('0xa')]=FaxQueueEvents; \ No newline at end of file +var _0x9252=['emit','exports','events','../../mysqldb','setMaxListeners','save','update','remove'];(function(_0x24db98,_0x58d9f1){var _0x46476a=function(_0x1863ee){while(--_0x1863ee){_0x24db98['push'](_0x24db98['shift']());}};_0x46476a(++_0x58d9f1);}(_0x9252,0x1e2));var _0x2925=function(_0x3511d3,_0x4107ae){_0x3511d3=_0x3511d3-0x0;var _0x5d6321=_0x9252[_0x3511d3];return _0x5d6321;};'use strict';var EventEmitter=require(_0x2925('0x0'));var FaxQueue=require(_0x2925('0x1'))['db']['FaxQueue'];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0x2925('0x2')](0x0);var events={'afterCreate':_0x2925('0x3'),'afterUpdate':_0x2925('0x4'),'afterDestroy':_0x2925('0x5')};function emitEvent(_0x5100a2){return function(_0x48a6c3,_0x5b823a,_0x34d51c){FaxQueueEvents[_0x2925('0x6')](_0x5100a2+':'+_0x48a6c3['id'],_0x48a6c3);FaxQueueEvents['emit'](_0x5100a2,_0x48a6c3);_0x34d51c(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxQueue['hook'](e,emitEvent(event));}}module[_0x2925('0x7')]=FaxQueueEvents; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.model.js b/server/api/faxQueue/faxQueue.model.js index 03842ac..32ba650 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 _0x5693=['request-promise','path','rimraf','../../config/environment','./faxQueue.attributes','exports','define','FaxQueue','fax_queues','lodash','../../config/logger','bluebird'];(function(_0x320d18,_0x7a06d9){var _0x18166f=function(_0x15c016){while(--_0x15c016){_0x320d18['push'](_0x320d18['shift']());}};_0x18166f(++_0x7a06d9);}(_0x5693,0x69));var _0x3569=function(_0x9dca4c,_0xc09e49){_0x9dca4c=_0x9dca4c-0x0;var _0x4c8506=_0x5693[_0x9dca4c];return _0x4c8506;};'use strict';var _=require(_0x3569('0x0'));var util=require('util');var logger=require(_0x3569('0x1'))('api');var moment=require('moment');var BPromise=require(_0x3569('0x2'));var rp=require(_0x3569('0x3'));var fs=require('fs');var path=require(_0x3569('0x4'));var rimraf=require(_0x3569('0x5'));var config=require(_0x3569('0x6'));var attributes=require(_0x3569('0x7'));module[_0x3569('0x8')]=function(_0x3c3057,_0x2284fc){return _0x3c3057[_0x3569('0x9')](_0x3569('0xa'),attributes,{'tableName':_0x3569('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x18d4=['../../config/environment','exports','define','FaxQueue','lodash','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x3d07d9,_0x3acc3d){var _0x57e9a9=function(_0x18b4b0){while(--_0x18b4b0){_0x3d07d9['push'](_0x3d07d9['shift']());}};_0x57e9a9(++_0x3acc3d);}(_0x18d4,0x1bc));var _0x418d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x18d4[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x418d('0x0'));var util=require('util');var logger=require(_0x418d('0x1'))(_0x418d('0x2'));var moment=require(_0x418d('0x3'));var BPromise=require(_0x418d('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x418d('0x5'));var rimraf=require(_0x418d('0x6'));var config=require(_0x418d('0x7'));var attributes=require('./faxQueue.attributes');module[_0x418d('0x8')]=function(_0x1eb1fa,_0x260f1f){return _0x1eb1fa[_0x418d('0x9')](_0x418d('0xa'),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 4ddd2a6..05e8703 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 _0x6011=['raw','where','attributes','include','map','model','then','ShowFaxQueue','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','socket.io-emitter','./faxQueue.socket','request\x20sent','debug','stringify','error','code','FaxQueue,\x20%s,\x20%s','message','result','catch','GetFaxQueue','FaxQueue','options'];(function(_0x5560f6,_0x225f9c){var _0x25d4ef=function(_0xa642c0){while(--_0xa642c0){_0x5560f6['push'](_0x5560f6['shift']());}};_0x25d4ef(++_0x225f9c);}(_0x6011,0x78));var _0x1601=function(_0x341293,_0x32071d){_0x341293=_0x341293-0x0;var _0x116692=_0x6011[_0x341293];return _0x116692;};'use strict';var _=require(_0x1601('0x0'));var util=require(_0x1601('0x1'));var moment=require(_0x1601('0x2'));var BPromise=require(_0x1601('0x3'));var rs=require(_0x1601('0x4'));var fs=require('fs');var Redis=require(_0x1601('0x5'));var db=require(_0x1601('0x6'))['db'];var utils=require(_0x1601('0x7'));var logger=require(_0x1601('0x8'))(_0x1601('0x9'));var config=require(_0x1601('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x1601('0xb')][_0x1601('0xc')]({'port':0x232a});config['redis']=_['defaults'](config[_0x1601('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0x1601('0xe'))(new Redis(config['redis']));require(_0x1601('0xf'))['register'](socket);function respondWithRpcPromise(_0x20b688,_0xf6041a,_0x298f82){return new BPromise(function(_0x41e084,_0x57be24){return client['request'](_0x20b688,_0x298f82)['then'](function(_0x108ef3){logger['info']('FaxQueue,\x20%s,\x20%s',_0xf6041a,_0x1601('0x10'));logger[_0x1601('0x11')]('FaxQueue,\x20%s,\x20%s,\x20%s',_0xf6041a,_0x1601('0x10'),JSON[_0x1601('0x12')](_0x108ef3));if(_0x108ef3[_0x1601('0x13')]){if(_0x108ef3[_0x1601('0x13')][_0x1601('0x14')]===0x1f4){logger[_0x1601('0x13')](_0x1601('0x15'),_0xf6041a,_0x108ef3[_0x1601('0x13')]['message']);return _0x57be24(_0x108ef3[_0x1601('0x13')]['message']);}logger[_0x1601('0x13')]('FaxQueue,\x20%s,\x20%s',_0xf6041a,_0x108ef3[_0x1601('0x13')][_0x1601('0x16')]);return _0x41e084(_0x108ef3['error'][_0x1601('0x16')]);}else{logger['info'](_0x1601('0x15'),_0xf6041a,_0x1601('0x10'));_0x41e084(_0x108ef3[_0x1601('0x17')][_0x1601('0x16')]);}})[_0x1601('0x18')](function(_0x4aa7db){logger[_0x1601('0x13')](_0x1601('0x15'),_0xf6041a,_0x4aa7db);_0x57be24(_0x4aa7db);});});}exports[_0x1601('0x19')]=function(_0x1a2236){var _0x503d92=this;return new Promise(function(_0x1af401,_0x29850e){return db[_0x1601('0x1a')]['findAll']({'raw':_0x1a2236[_0x1601('0x1b')]?_0x1a2236['options'][_0x1601('0x1c')]===undefined?!![]:![]:!![],'where':_0x1a2236[_0x1601('0x1b')]?_0x1a2236[_0x1601('0x1b')][_0x1601('0x1d')]||null:null,'attributes':_0x1a2236['options']?_0x1a2236[_0x1601('0x1b')][_0x1601('0x1e')]||null:null,'limit':_0x1a2236['options']?_0x1a2236[_0x1601('0x1b')]['limit']||null:null,'include':_0x1a2236[_0x1601('0x1b')]?_0x1a2236[_0x1601('0x1b')][_0x1601('0x1f')]?_[_0x1601('0x20')](_0x1a2236[_0x1601('0x1b')][_0x1601('0x1f')],function(_0x406d98){return{'model':db[_0x406d98[_0x1601('0x21')]],'as':_0x406d98['as'],'attributes':_0x406d98[_0x1601('0x1e')],'include':_0x406d98[_0x1601('0x1f')]?_[_0x1601('0x20')](_0x406d98[_0x1601('0x1f')],function(_0x49648c){return{'model':db[_0x49648c[_0x1601('0x21')]],'as':_0x49648c['as'],'attributes':_0x49648c[_0x1601('0x1e')],'include':_0x49648c[_0x1601('0x1f')]?_[_0x1601('0x20')](_0x49648c[_0x1601('0x1f')],function(_0x211f9d){return{'model':db[_0x211f9d[_0x1601('0x21')]],'as':_0x211f9d['as'],'attributes':_0x211f9d[_0x1601('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x1601('0x22')](function(_0x37c48){logger['info'](_0x1601('0x19'),_0x1a2236);logger['debug'](_0x1601('0x19'),_0x1a2236,JSON[_0x1601('0x12')](_0x37c48));_0x1af401(_0x37c48);})[_0x1601('0x18')](function(_0x373a78){logger['error']('GetFaxQueue',_0x373a78['message'],_0x1a2236);_0x29850e(_0x503d92['error'](0x1f4,_0x373a78[_0x1601('0x16')]));});});};exports[_0x1601('0x23')]=function(_0x8a6b49){var _0x3c33b9=this;return new Promise(function(_0x5bf40a,_0x2d6c8c){return db[_0x1601('0x1a')][_0x1601('0x24')]({'raw':_0x8a6b49['options']?_0x8a6b49[_0x1601('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x8a6b49['options']?_0x8a6b49[_0x1601('0x1b')][_0x1601('0x1d')]||null:null,'attributes':_0x8a6b49[_0x1601('0x1b')]?_0x8a6b49[_0x1601('0x1b')][_0x1601('0x1e')]||null:null,'include':_0x8a6b49[_0x1601('0x1b')]?_0x8a6b49[_0x1601('0x1b')][_0x1601('0x1f')]?_['map'](_0x8a6b49[_0x1601('0x1b')][_0x1601('0x1f')],function(_0x4f3e9c){return{'model':db[_0x4f3e9c[_0x1601('0x21')]],'as':_0x4f3e9c['as'],'attributes':_0x4f3e9c['attributes'],'include':_0x4f3e9c[_0x1601('0x1f')]?_[_0x1601('0x20')](_0x4f3e9c[_0x1601('0x1f')],function(_0x4690b1){return{'model':db[_0x4690b1[_0x1601('0x21')]],'as':_0x4690b1['as'],'attributes':_0x4690b1[_0x1601('0x1e')],'include':_0x4690b1['include']?_['map'](_0x4690b1[_0x1601('0x1f')],function(_0x51318c){return{'model':db[_0x51318c[_0x1601('0x21')]],'as':_0x51318c['as'],'attributes':_0x51318c[_0x1601('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x1601('0x22')](function(_0xbce31){logger['info'](_0x1601('0x23'),_0x8a6b49);logger[_0x1601('0x11')](_0x1601('0x23'),_0x8a6b49,JSON[_0x1601('0x12')](_0xbce31));_0x5bf40a(_0xbce31);})[_0x1601('0x18')](function(_0x442d7c){logger[_0x1601('0x13')](_0x1601('0x23'),_0x442d7c[_0x1601('0x16')],_0x8a6b49);_0x2d6c8c(_0x3c33b9[_0x1601('0x13')](0x1f4,_0x442d7c[_0x1601('0x16')]));});});}; \ No newline at end of file +var _0xe6b6=['../../config/logger','rpc','../../config/environment','jayson/promise','defaults','socket.io-emitter','redis','register','then','FaxQueue,\x20%s,\x20%s','request\x20sent','debug','FaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetFaxQueue','FaxQueue','findAll','options','raw','where','limit','include','map','model','attributes','info','ShowFaxQueue','find','lodash','util','moment','bluebird','../../config/utils'];(function(_0x46a285,_0x2ce4e0){var _0xe0b757=function(_0x183a4f){while(--_0x183a4f){_0x46a285['push'](_0x46a285['shift']());}};_0xe0b757(++_0x2ce4e0);}(_0xe6b6,0x16d));var _0x6e6b=function(_0x422855,_0x5bef82){_0x422855=_0x422855-0x0;var _0xdd7935=_0xe6b6[_0x422855];return _0xdd7935;};'use strict';var _=require(_0x6e6b('0x0'));var util=require(_0x6e6b('0x1'));var moment=require(_0x6e6b('0x2'));var BPromise=require(_0x6e6b('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x6e6b('0x4'));var logger=require(_0x6e6b('0x5'))(_0x6e6b('0x6'));var config=require(_0x6e6b('0x7'));var jayson=require(_0x6e6b('0x8'));var client=jayson['client']['http']({'port':0x232a});config['redis']=_[_0x6e6b('0x9')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x6e6b('0xa'))(new Redis(config[_0x6e6b('0xb')]));require('./faxQueue.socket')[_0x6e6b('0xc')](socket);function respondWithRpcPromise(_0x61cc27,_0x195fea,_0x4d4bab){return new BPromise(function(_0x18fa66,_0x428c43){return client['request'](_0x61cc27,_0x4d4bab)[_0x6e6b('0xd')](function(_0x4471b4){logger['info'](_0x6e6b('0xe'),_0x195fea,_0x6e6b('0xf'));logger[_0x6e6b('0x10')](_0x6e6b('0x11'),_0x195fea,_0x6e6b('0xf'),JSON[_0x6e6b('0x12')](_0x4471b4));if(_0x4471b4[_0x6e6b('0x13')]){if(_0x4471b4['error'][_0x6e6b('0x14')]===0x1f4){logger['error'](_0x6e6b('0xe'),_0x195fea,_0x4471b4[_0x6e6b('0x13')][_0x6e6b('0x15')]);return _0x428c43(_0x4471b4[_0x6e6b('0x13')][_0x6e6b('0x15')]);}logger[_0x6e6b('0x13')](_0x6e6b('0xe'),_0x195fea,_0x4471b4[_0x6e6b('0x13')][_0x6e6b('0x15')]);return _0x18fa66(_0x4471b4[_0x6e6b('0x13')][_0x6e6b('0x15')]);}else{logger['info'](_0x6e6b('0xe'),_0x195fea,_0x6e6b('0xf'));_0x18fa66(_0x4471b4['result']['message']);}})[_0x6e6b('0x16')](function(_0x1f2291){logger[_0x6e6b('0x13')](_0x6e6b('0xe'),_0x195fea,_0x1f2291);_0x428c43(_0x1f2291);});});}exports[_0x6e6b('0x17')]=function(_0xbb24cc){var _0x465170=this;return new Promise(function(_0x683229,_0x43468b){return db[_0x6e6b('0x18')][_0x6e6b('0x19')]({'raw':_0xbb24cc['options']?_0xbb24cc[_0x6e6b('0x1a')][_0x6e6b('0x1b')]===undefined?!![]:![]:!![],'where':_0xbb24cc[_0x6e6b('0x1a')]?_0xbb24cc[_0x6e6b('0x1a')][_0x6e6b('0x1c')]||null:null,'attributes':_0xbb24cc[_0x6e6b('0x1a')]?_0xbb24cc[_0x6e6b('0x1a')]['attributes']||null:null,'limit':_0xbb24cc[_0x6e6b('0x1a')]?_0xbb24cc[_0x6e6b('0x1a')][_0x6e6b('0x1d')]||null:null,'include':_0xbb24cc[_0x6e6b('0x1a')]?_0xbb24cc[_0x6e6b('0x1a')][_0x6e6b('0x1e')]?_[_0x6e6b('0x1f')](_0xbb24cc[_0x6e6b('0x1a')][_0x6e6b('0x1e')],function(_0x40070a){return{'model':db[_0x40070a[_0x6e6b('0x20')]],'as':_0x40070a['as'],'attributes':_0x40070a[_0x6e6b('0x21')],'include':_0x40070a['include']?_[_0x6e6b('0x1f')](_0x40070a[_0x6e6b('0x1e')],function(_0x2d98a7){return{'model':db[_0x2d98a7[_0x6e6b('0x20')]],'as':_0x2d98a7['as'],'attributes':_0x2d98a7[_0x6e6b('0x21')],'include':_0x2d98a7[_0x6e6b('0x1e')]?_[_0x6e6b('0x1f')](_0x2d98a7['include'],function(_0x1352c1){return{'model':db[_0x1352c1[_0x6e6b('0x20')]],'as':_0x1352c1['as'],'attributes':_0x1352c1[_0x6e6b('0x21')]};}):[]};}):[]};}):[]:[]})[_0x6e6b('0xd')](function(_0x483ac4){logger[_0x6e6b('0x22')](_0x6e6b('0x17'),_0xbb24cc);logger[_0x6e6b('0x10')]('GetFaxQueue',_0xbb24cc,JSON[_0x6e6b('0x12')](_0x483ac4));_0x683229(_0x483ac4);})['catch'](function(_0x3ba24f){logger[_0x6e6b('0x13')](_0x6e6b('0x17'),_0x3ba24f['message'],_0xbb24cc);_0x43468b(_0x465170[_0x6e6b('0x13')](0x1f4,_0x3ba24f['message']));});});};exports[_0x6e6b('0x23')]=function(_0x329544){var _0xe8f364=this;return new Promise(function(_0x484ff5,_0xa50fca){return db['FaxQueue'][_0x6e6b('0x24')]({'raw':_0x329544[_0x6e6b('0x1a')]?_0x329544[_0x6e6b('0x1a')][_0x6e6b('0x1b')]===undefined?!![]:![]:!![],'where':_0x329544[_0x6e6b('0x1a')]?_0x329544['options'][_0x6e6b('0x1c')]||null:null,'attributes':_0x329544[_0x6e6b('0x1a')]?_0x329544['options'][_0x6e6b('0x21')]||null:null,'include':_0x329544[_0x6e6b('0x1a')]?_0x329544[_0x6e6b('0x1a')][_0x6e6b('0x1e')]?_[_0x6e6b('0x1f')](_0x329544[_0x6e6b('0x1a')][_0x6e6b('0x1e')],function(_0x2038de){return{'model':db[_0x2038de[_0x6e6b('0x20')]],'as':_0x2038de['as'],'attributes':_0x2038de[_0x6e6b('0x21')],'include':_0x2038de[_0x6e6b('0x1e')]?_['map'](_0x2038de[_0x6e6b('0x1e')],function(_0x35a595){return{'model':db[_0x35a595[_0x6e6b('0x20')]],'as':_0x35a595['as'],'attributes':_0x35a595[_0x6e6b('0x21')],'include':_0x35a595['include']?_[_0x6e6b('0x1f')](_0x35a595['include'],function(_0x141518){return{'model':db[_0x141518[_0x6e6b('0x20')]],'as':_0x141518['as'],'attributes':_0x141518[_0x6e6b('0x21')]};}):[]};}):[]};}):[]:[]})[_0x6e6b('0xd')](function(_0x1f4d06){logger['info']('ShowFaxQueue',_0x329544);logger[_0x6e6b('0x10')](_0x6e6b('0x23'),_0x329544,JSON[_0x6e6b('0x12')](_0x1f4d06));_0x484ff5(_0x1f4d06);})[_0x6e6b('0x16')](function(_0x2c8c22){logger[_0x6e6b('0x13')]('ShowFaxQueue',_0x2c8c22[_0x6e6b('0x15')],_0x329544);_0xa50fca(_0xe8f364[_0x6e6b('0x13')](0x1f4,_0x2c8c22['message']));});});}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.socket.js b/server/api/faxQueue/faxQueue.socket.js index ccf952c..274fe1c 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 _0xadae=['length','faxQueue:','./faxQueue.events','save','remove','register'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xadae,0x134));var _0xeada=function(_0x484e36,_0x4482d8){_0x484e36=_0x484e36-0x0;var _0xafc85d=_0xadae[_0x484e36];return _0xafc85d;};'use strict';var FaxQueueEvents=require(_0xeada('0x0'));var events=[_0xeada('0x1'),_0xeada('0x2'),'update'];function createListener(_0x4f062f,_0x5a3a55){return function(_0x58a941){_0x5a3a55['emit'](_0x4f062f,_0x58a941);};}function removeListener(_0x5b455b,_0x4bb0e3){return function(){FaxQueueEvents['removeListener'](_0x5b455b,_0x4bb0e3);};}exports[_0xeada('0x3')]=function(_0x5ef766){for(var _0x5967e6=0x0,_0x5ed8c8=events[_0xeada('0x4')];_0x5967e6<_0x5ed8c8;_0x5967e6++){var _0x36f731=events[_0x5967e6];var _0x2e9199=createListener(_0xeada('0x5')+_0x36f731,_0x5ef766);FaxQueueEvents['on'](_0x36f731,_0x2e9199);}}; \ No newline at end of file +var _0x572b=['length','faxQueue:','./faxQueue.events','save','remove','update','emit','removeListener','register'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x572b,0x1b2));var _0xb572=function(_0x142ec2,_0x5bb03d){_0x142ec2=_0x142ec2-0x0;var _0x45ef4e=_0x572b[_0x142ec2];return _0x45ef4e;};'use strict';var FaxQueueEvents=require(_0xb572('0x0'));var events=[_0xb572('0x1'),_0xb572('0x2'),_0xb572('0x3')];function createListener(_0x3ddc44,_0x52b8bf){return function(_0x4378f5){_0x52b8bf[_0xb572('0x4')](_0x3ddc44,_0x4378f5);};}function removeListener(_0x7d9c53,_0x536bd9){return function(){FaxQueueEvents[_0xb572('0x5')](_0x7d9c53,_0x536bd9);};}exports[_0xb572('0x6')]=function(_0x46ed9a){for(var _0x2925dc=0x0,_0x2fa9a5=events[_0xb572('0x7')];_0x2925dc<_0x2fa9a5;_0x2925dc++){var _0xe9c455=events[_0x2925dc];var _0x2166ee=createListener(_0xb572('0x8')+_0xe9c455,_0x46ed9a);FaxQueueEvents['on'](_0xe9c455,_0x2166ee);}}; \ No newline at end of file diff --git a/server/api/faxQueue/index.js b/server/api/faxQueue/index.js index 1c8f530..46c6da7 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 _0xa46e=['post','addTeams','addAgents','put','delete','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../config/environment','get','index','isAuthenticated','describe','/:id','getMembers','/:id/teams','getTeams','/:id/users'];(function(_0x2dadb9,_0x42cfe6){var _0x2f0097=function(_0x21163f){while(--_0x21163f){_0x2dadb9['push'](_0x2dadb9['shift']());}};_0x2f0097(++_0x42cfe6);}(_0xa46e,0x8a));var _0xea46=function(_0x403c20,_0x4a7b99){_0x403c20=_0x403c20-0x0;var _0x2b271a=_0xa46e[_0x403c20];return _0x2b271a;};'use strict';var multer=require(_0xea46('0x0'));var util=require(_0xea46('0x1'));var path=require('path');var timeout=require(_0xea46('0x2'));var express=require(_0xea46('0x3'));var router=express[_0xea46('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xea46('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xea46('0x6'));var controller=require('./faxQueue.controller');router[_0xea46('0x7')]('/',auth['isAuthenticated'](),controller[_0xea46('0x8')]);router[_0xea46('0x7')]('/describe',auth[_0xea46('0x9')](),controller[_0xea46('0xa')]);router[_0xea46('0x7')](_0xea46('0xb'),auth[_0xea46('0x9')](),controller['show']);router['get']('/:id/members',auth[_0xea46('0x9')](),controller[_0xea46('0xc')]);router['get'](_0xea46('0xd'),auth[_0xea46('0x9')](),controller[_0xea46('0xe')]);router['get'](_0xea46('0xf'),auth[_0xea46('0x9')](),controller['getAgents']);router[_0xea46('0x10')]('/',auth[_0xea46('0x9')](),controller['create']);router[_0xea46('0x10')]('/:id/teams',auth[_0xea46('0x9')](),controller[_0xea46('0x11')]);router[_0xea46('0x10')](_0xea46('0xf'),auth[_0xea46('0x9')](),controller[_0xea46('0x12')]);router[_0xea46('0x13')](_0xea46('0xb'),auth[_0xea46('0x9')](),controller['update']);router[_0xea46('0x14')](_0xea46('0xb'),auth[_0xea46('0x9')](),controller['destroy']);router['delete'](_0xea46('0xd'),auth[_0xea46('0x9')](),controller['removeTeams']);router['delete'](_0xea46('0xf'),auth[_0xea46('0x9')](),controller['removeAgents']);module[_0xea46('0x15')]=router; \ No newline at end of file +var _0xe5af=['util','path','express','Router','fs-extra','../../components/interaction/service','get','isAuthenticated','/describe','describe','/:id/members','/:id/teams','getTeams','getAgents','post','create','addTeams','/:id/users','addAgents','put','/:id','update','delete','destroy','removeTeams','removeAgents'];(function(_0x5a5fe6,_0x38511d){var _0x343454=function(_0xcd0e41){while(--_0xcd0e41){_0x5a5fe6['push'](_0x5a5fe6['shift']());}};_0x343454(++_0x38511d);}(_0xe5af,0x9c));var _0xfe5a=function(_0x15b101,_0x2a629c){_0x15b101=_0x15b101-0x0;var _0x399e7b=_0xe5af[_0x15b101];return _0x399e7b;};'use strict';var multer=require('multer');var util=require(_0xfe5a('0x0'));var path=require(_0xfe5a('0x1'));var timeout=require('connect-timeout');var express=require(_0xfe5a('0x2'));var router=express[_0xfe5a('0x3')]();var fs_extra=require(_0xfe5a('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xfe5a('0x5'));var config=require('../../config/environment');var controller=require('./faxQueue.controller');router[_0xfe5a('0x6')]('/',auth[_0xfe5a('0x7')](),controller['index']);router['get'](_0xfe5a('0x8'),auth[_0xfe5a('0x7')](),controller[_0xfe5a('0x9')]);router[_0xfe5a('0x6')]('/:id',auth[_0xfe5a('0x7')](),controller['show']);router['get'](_0xfe5a('0xa'),auth[_0xfe5a('0x7')](),controller['getMembers']);router[_0xfe5a('0x6')](_0xfe5a('0xb'),auth[_0xfe5a('0x7')](),controller[_0xfe5a('0xc')]);router[_0xfe5a('0x6')]('/:id/users',auth[_0xfe5a('0x7')](),controller[_0xfe5a('0xd')]);router[_0xfe5a('0xe')]('/',auth[_0xfe5a('0x7')](),controller[_0xfe5a('0xf')]);router['post'](_0xfe5a('0xb'),auth[_0xfe5a('0x7')](),controller[_0xfe5a('0x10')]);router[_0xfe5a('0xe')](_0xfe5a('0x11'),auth[_0xfe5a('0x7')](),controller[_0xfe5a('0x12')]);router[_0xfe5a('0x13')](_0xfe5a('0x14'),auth[_0xfe5a('0x7')](),controller[_0xfe5a('0x15')]);router[_0xfe5a('0x16')](_0xfe5a('0x14'),auth[_0xfe5a('0x7')](),controller[_0xfe5a('0x17')]);router[_0xfe5a('0x16')]('/:id/teams',auth[_0xfe5a('0x7')](),controller[_0xfe5a('0x18')]);router['delete'](_0xfe5a('0x11'),auth[_0xfe5a('0x7')](),controller[_0xfe5a('0x19')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.attributes.js b/server/api/faxQueueReport/faxQueueReport.attributes.js index db5f2f6..6e5b0cb 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 _0x3141=['DATE','moment','exports','STRING'];(function(_0x4046c3,_0x23ec82){var _0x5a4e0b=function(_0x440742){while(--_0x440742){_0x4046c3['push'](_0x4046c3['shift']());}};_0x5a4e0b(++_0x23ec82);}(_0x3141,0x6d));var _0x1314=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x3141[_0x4a9fb1];return _0x348672;};'use strict';var moment=require(_0x1314('0x0'));var Sequelize=require('sequelize');module[_0x1314('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x1314('0x2')]},'joinAt':{'type':Sequelize[_0x1314('0x3')]},'leaveAt':{'type':Sequelize[_0x1314('0x3')]},'acceptAt':{'type':Sequelize[_0x1314('0x3')]},'exitAt':{'type':Sequelize[_0x1314('0x3')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xaee9=['DATE','moment','exports','STRING'];(function(_0x2142c8,_0x3001eb){var _0x4286e9=function(_0x43d768){while(--_0x43d768){_0x2142c8['push'](_0x2142c8['shift']());}};_0x4286e9(++_0x3001eb);}(_0xaee9,0xd9));var _0x9aee=function(_0x19bf73,_0x58542e){_0x19bf73=_0x19bf73-0x0;var _0xf87243=_0xaee9[_0x19bf73];return _0xf87243;};'use strict';var moment=require(_0x9aee('0x0'));var Sequelize=require('sequelize');module[_0x9aee('0x1')]={'uniqueid':{'type':Sequelize[_0x9aee('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x9aee('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x9aee('0x3')]},'exitAt':{'type':Sequelize[_0x9aee('0x3')]},'reason':{'type':Sequelize[_0x9aee('0x2')]}}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.controller.js b/server/api/faxQueueReport/faxQueueReport.controller.js index 9c5baf1..fd08416 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 _0xfa7c=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','json','update','then','destroy','error','stack','name','send','index','rawAttributes','type','key','model','map','query','keys','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','options','FaxQueueReport','includeAll','findAll','catch','params','intersection','length','include','find','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse'];(function(_0x508835,_0x80e24b){var _0x5b8e84=function(_0x299554){while(--_0x299554){_0x508835['push'](_0x508835['shift']());}};_0x5b8e84(++_0x80e24b);}(_0xfa7c,0x15b));var _0xcfa7=function(_0x5c3eb8,_0x1beddf){_0x5c3eb8=_0x5c3eb8-0x0;var _0x461e61=_0xfa7c[_0x5c3eb8];return _0x461e61;};'use strict';var emlformat=require(_0xcfa7('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xcfa7('0x1'));var jsonpatch=require(_0xcfa7('0x2'));var rp=require(_0xcfa7('0x3'));var moment=require(_0xcfa7('0x4'));var BPromise=require(_0xcfa7('0x5'));var Mustache=require(_0xcfa7('0x6'));var util=require(_0xcfa7('0x7'));var path=require(_0xcfa7('0x8'));var sox=require('sox');var csv=require(_0xcfa7('0x9'));var ejs=require(_0xcfa7('0xa'));var fs=require('fs');var fs_extra=require(_0xcfa7('0xb'));var _=require(_0xcfa7('0xc'));var squel=require('squel');var crypto=require(_0xcfa7('0xd'));var jsforce=require(_0xcfa7('0xe'));var deskjs=require(_0xcfa7('0xf'));var toCsv=require(_0xcfa7('0x9'));var querystring=require(_0xcfa7('0x10'));var Papa=require(_0xcfa7('0x11'));var Redis=require('ioredis');var authService=require(_0xcfa7('0x12'));var qs=require(_0xcfa7('0x13'));var as=require(_0xcfa7('0x14'));var hardwareService=require(_0xcfa7('0x15'));var logger=require(_0xcfa7('0x16'))('api');var utils=require('../../config/utils');var config=require(_0xcfa7('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xcfa7('0x18'))['db'];function respondWithStatusCode(_0x18e202,_0x53d0fb){_0x53d0fb=_0x53d0fb||0xcc;return function(_0x299280){if(_0x299280){return _0x18e202[_0xcfa7('0x19')](_0x53d0fb);}return _0x18e202[_0xcfa7('0x1a')](_0x53d0fb)[_0xcfa7('0x1b')]();};}function respondWithResult(_0x2f69ef,_0x578718){_0x578718=_0x578718||0xc8;return function(_0x42500c){if(_0x42500c){return _0x2f69ef['status'](_0x578718)['json'](_0x42500c);}};}function respondWithFilteredResult(_0x465d21,_0x470a55){return function(_0x29cef5){if(_0x29cef5){var _0x349679=typeof _0x470a55[_0xcfa7('0x1c')]==='undefined'&&typeof _0x470a55[_0xcfa7('0x1d')]===_0xcfa7('0x1e');var _0x1236d5=_0x29cef5[_0xcfa7('0x1f')];var _0x4e2a46=_0x349679?0x0:_0x470a55[_0xcfa7('0x1c')];var _0x34f829=_0x349679?_0x29cef5['count']:_0x470a55['offset']+_0x470a55[_0xcfa7('0x1d')];var _0x3f582f;if(_0x34f829>=_0x1236d5){_0x34f829=_0x1236d5;_0x3f582f=0xc8;}else{_0x3f582f=0xce;}_0x465d21[_0xcfa7('0x1a')](_0x3f582f);return _0x465d21[_0xcfa7('0x20')](_0xcfa7('0x21'),_0x4e2a46+'-'+_0x34f829+'/'+_0x1236d5)[_0xcfa7('0x22')](_0x29cef5);}return null;};}function patchUpdates(_0x2312fd){return function(_0x602f15){try{jsonpatch['apply'](_0x602f15,_0x2312fd,!![]);}catch(_0x47519a){return BPromise['reject'](_0x47519a);}return _0x602f15['save']();};}function saveUpdates(_0x5a567d,_0xdf35fa){return function(_0x49e624){if(_0x49e624){return _0x49e624[_0xcfa7('0x23')](_0x5a567d)[_0xcfa7('0x24')](function(_0x3816fb){return _0x3816fb;});}return null;};}function removeEntity(_0x3423ad,_0xdd7c11){return function(_0x2d00e1){if(_0x2d00e1){return _0x2d00e1[_0xcfa7('0x25')]()[_0xcfa7('0x24')](function(){_0x3423ad['status'](0xcc)[_0xcfa7('0x1b')]();});}};}function handleEntityNotFound(_0x222ce2,_0x312efb){return function(_0x1d5e9c){if(!_0x1d5e9c){_0x222ce2['sendStatus'](0x194);}return _0x1d5e9c;};}function handleError(_0x49a904,_0xabfa5b){_0xabfa5b=_0xabfa5b||0x1f4;return function(_0x3fece6){logger[_0xcfa7('0x26')](_0x3fece6[_0xcfa7('0x27')]);if(_0x3fece6['name']){delete _0x3fece6[_0xcfa7('0x28')];}_0x49a904[_0xcfa7('0x1a')](_0xabfa5b)[_0xcfa7('0x29')](_0x3fece6);};}exports[_0xcfa7('0x2a')]=function(_0x5daee2,_0x4c8bf0){var _0x569f4e={},_0x10f85f={},_0xdcdae7={'count':0x0,'rows':[]};var _0x2fd1bd=_['map'](db['FaxQueueReport'][_0xcfa7('0x2b')],function(_0x590c35){return{'name':_0x590c35['fieldName'],'type':_0x590c35[_0xcfa7('0x2c')][_0xcfa7('0x2d')]};});_0x10f85f[_0xcfa7('0x2e')]=_[_0xcfa7('0x2f')](_0x2fd1bd,_0xcfa7('0x28'));_0x10f85f[_0xcfa7('0x30')]=_[_0xcfa7('0x31')](_0x5daee2[_0xcfa7('0x30')]);_0x10f85f['filters']=_['intersection'](_0x10f85f[_0xcfa7('0x2e')],_0x10f85f[_0xcfa7('0x30')]);_0x569f4e[_0xcfa7('0x32')]=_['intersection'](_0x10f85f['model'],qs[_0xcfa7('0x33')](_0x5daee2[_0xcfa7('0x30')][_0xcfa7('0x33')]));_0x569f4e['attributes']=_0x569f4e[_0xcfa7('0x32')]['length']?_0x569f4e[_0xcfa7('0x32')]:_0x10f85f['model'];if(!_0x5daee2[_0xcfa7('0x30')][_0xcfa7('0x34')](_0xcfa7('0x35'))){_0x569f4e[_0xcfa7('0x1d')]=qs[_0xcfa7('0x1d')](_0x5daee2[_0xcfa7('0x30')][_0xcfa7('0x1d')]);_0x569f4e['offset']=qs[_0xcfa7('0x1c')](_0x5daee2[_0xcfa7('0x30')][_0xcfa7('0x1c')]);}_0x569f4e[_0xcfa7('0x36')]=qs[_0xcfa7('0x37')](_0x5daee2[_0xcfa7('0x30')][_0xcfa7('0x37')]);_0x569f4e[_0xcfa7('0x38')]=qs[_0xcfa7('0x39')](_[_0xcfa7('0x3a')](_0x5daee2['query'],_0x10f85f['filters']),_0x2fd1bd);if(_0x5daee2[_0xcfa7('0x30')]['filter']){_0x569f4e[_0xcfa7('0x38')]=_[_0xcfa7('0x3b')](_0x569f4e[_0xcfa7('0x38')],{'$or':_['map'](_0x2fd1bd,function(_0x10c208){if(_0x10c208[_0xcfa7('0x2c')]!=='VIRTUAL'){var _0x118e38={};_0x118e38[_0x10c208[_0xcfa7('0x28')]]={'$like':'%'+_0x5daee2[_0xcfa7('0x30')]['filter']+'%'};return _0x118e38;}})});}_0x569f4e=_[_0xcfa7('0x3b')]({},_0x569f4e,_0x5daee2[_0xcfa7('0x3c')]);var _0x219682={'where':_0x569f4e[_0xcfa7('0x38')]};return db[_0xcfa7('0x3d')][_0xcfa7('0x1f')](_0x219682)['then'](function(_0x3a776a){_0xdcdae7['count']=_0x3a776a;if(_0x5daee2[_0xcfa7('0x30')][_0xcfa7('0x3e')]){_0x569f4e['include']=[{'all':!![]}];}return db[_0xcfa7('0x3d')][_0xcfa7('0x3f')](_0x569f4e);})['then'](function(_0x443d5b){_0xdcdae7['rows']=_0x443d5b;return _0xdcdae7;})[_0xcfa7('0x24')](respondWithFilteredResult(_0x4c8bf0,_0x569f4e))[_0xcfa7('0x40')](handleError(_0x4c8bf0,null));};exports['show']=function(_0x1b5e41,_0x3ff0e0){var _0x441e86={'raw':!![],'where':{'id':_0x1b5e41[_0xcfa7('0x41')]['id']}},_0x98a340={};_0x98a340[_0xcfa7('0x2e')]=_[_0xcfa7('0x31')](db[_0xcfa7('0x3d')]['rawAttributes']);_0x98a340[_0xcfa7('0x30')]=_[_0xcfa7('0x31')](_0x1b5e41[_0xcfa7('0x30')]);_0x98a340[_0xcfa7('0x39')]=_[_0xcfa7('0x42')](_0x98a340['model'],_0x98a340[_0xcfa7('0x30')]);_0x441e86['attributes']=_[_0xcfa7('0x42')](_0x98a340[_0xcfa7('0x2e')],qs[_0xcfa7('0x33')](_0x1b5e41['query'][_0xcfa7('0x33')]));_0x441e86[_0xcfa7('0x32')]=_0x441e86[_0xcfa7('0x32')][_0xcfa7('0x43')]?_0x441e86[_0xcfa7('0x32')]:_0x98a340[_0xcfa7('0x2e')];if(_0x1b5e41['query'][_0xcfa7('0x3e')]){_0x441e86[_0xcfa7('0x44')]=[{'all':!![]}];}_0x441e86=_[_0xcfa7('0x3b')]({},_0x441e86,_0x1b5e41[_0xcfa7('0x3c')]);return db[_0xcfa7('0x3d')][_0xcfa7('0x45')](_0x441e86)[_0xcfa7('0x24')](handleEntityNotFound(_0x3ff0e0,null))[_0xcfa7('0x24')](respondWithResult(_0x3ff0e0,null))[_0xcfa7('0x40')](handleError(_0x3ff0e0,null));};exports['create']=function(_0x4721cf,_0x2e7800){return db[_0xcfa7('0x3d')][_0xcfa7('0x46')](_0x4721cf[_0xcfa7('0x47')],{})[_0xcfa7('0x24')](respondWithResult(_0x2e7800,0xc9))[_0xcfa7('0x40')](handleError(_0x2e7800,null));};exports['update']=function(_0x4ba0de,_0x33660d){if(_0x4ba0de[_0xcfa7('0x47')]['id']){delete _0x4ba0de['body']['id'];}return db[_0xcfa7('0x3d')][_0xcfa7('0x45')]({'where':{'id':_0x4ba0de['params']['id']}})[_0xcfa7('0x24')](handleEntityNotFound(_0x33660d,null))[_0xcfa7('0x24')](saveUpdates(_0x4ba0de[_0xcfa7('0x47')],null))['then'](respondWithResult(_0x33660d,null))[_0xcfa7('0x40')](handleError(_0x33660d,null));};exports[_0xcfa7('0x25')]=function(_0x57c24d,_0x2a471c){return db[_0xcfa7('0x3d')][_0xcfa7('0x45')]({'where':{'id':_0x57c24d[_0xcfa7('0x41')]['id']}})['then'](handleEntityNotFound(_0x2a471c,null))[_0xcfa7('0x24')](removeEntity(_0x2a471c,null))[_0xcfa7('0x40')](handleError(_0x2a471c,null));};exports['describe']=function(_0x1a5ac6,_0x40dd2d){return db['FaxQueueReport'][_0xcfa7('0x48')]()[_0xcfa7('0x24')](respondWithResult(_0x40dd2d,null))[_0xcfa7('0x40')](handleError(_0x40dd2d,null));}; \ No newline at end of file +var _0xf4eb=['length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','VIRTUAL','merge','includeAll','include','findAll','rows','show','params','options','find','create','body','catch','update','describe','eml-format','moment','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','save','then','destroy','error','name','send','map','FaxQueueReport','rawAttributes','fieldName','type','key','model','keys','query','intersection','attributes','fields'];(function(_0x78938,_0x408af6){var _0xe2fd6c=function(_0x22d032){while(--_0x22d032){_0x78938['push'](_0x78938['shift']());}};_0xe2fd6c(++_0x408af6);}(_0xf4eb,0xec));var _0xbf4e=function(_0x471f5c,_0x2a793b){_0x471f5c=_0x471f5c-0x0;var _0x231984=_0xf4eb[_0x471f5c];return _0x231984;};'use strict';var emlformat=require(_0xbf4e('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xbf4e('0x1'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xbf4e('0x2'));var path=require(_0xbf4e('0x3'));var sox=require(_0xbf4e('0x4'));var csv=require(_0xbf4e('0x5'));var ejs=require(_0xbf4e('0x6'));var fs=require('fs');var fs_extra=require(_0xbf4e('0x7'));var _=require(_0xbf4e('0x8'));var squel=require('squel');var crypto=require(_0xbf4e('0x9'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xbf4e('0x5'));var querystring=require(_0xbf4e('0xa'));var Papa=require(_0xbf4e('0xb'));var Redis=require(_0xbf4e('0xc'));var authService=require(_0xbf4e('0xd'));var qs=require(_0xbf4e('0xe'));var as=require(_0xbf4e('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xbf4e('0x10'));var utils=require('../../config/utils');var config=require(_0xbf4e('0x11'));var licenseUtil=require(_0xbf4e('0x12'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x17fd01,_0x5a3035){_0x5a3035=_0x5a3035||0xcc;return function(_0x56d185){if(_0x56d185){return _0x17fd01[_0xbf4e('0x13')](_0x5a3035);}return _0x17fd01[_0xbf4e('0x14')](_0x5a3035)[_0xbf4e('0x15')]();};}function respondWithResult(_0x302841,_0x3b74bd){_0x3b74bd=_0x3b74bd||0xc8;return function(_0x61bd54){if(_0x61bd54){return _0x302841['status'](_0x3b74bd)['json'](_0x61bd54);}};}function respondWithFilteredResult(_0x180432,_0x1735ae){return function(_0x28fc6b){if(_0x28fc6b){var _0x542909=typeof _0x1735ae[_0xbf4e('0x16')]===_0xbf4e('0x17')&&typeof _0x1735ae[_0xbf4e('0x18')]===_0xbf4e('0x17');var _0x5a631e=_0x28fc6b[_0xbf4e('0x19')];var _0x577c27=_0x542909?0x0:_0x1735ae['offset'];var _0x566ec3=_0x542909?_0x28fc6b['count']:_0x1735ae[_0xbf4e('0x16')]+_0x1735ae[_0xbf4e('0x18')];var _0x1fc800;if(_0x566ec3>=_0x5a631e){_0x566ec3=_0x5a631e;_0x1fc800=0xc8;}else{_0x1fc800=0xce;}_0x180432['status'](_0x1fc800);return _0x180432['set'](_0xbf4e('0x1a'),_0x577c27+'-'+_0x566ec3+'/'+_0x5a631e)[_0xbf4e('0x1b')](_0x28fc6b);}return null;};}function patchUpdates(_0x3be138){return function(_0x3a875b){try{jsonpatch[_0xbf4e('0x1c')](_0x3a875b,_0x3be138,!![]);}catch(_0x1e2a68){return BPromise[_0xbf4e('0x1d')](_0x1e2a68);}return _0x3a875b[_0xbf4e('0x1e')]();};}function saveUpdates(_0xd09e12,_0x376832){return function(_0x30539b){if(_0x30539b){return _0x30539b['update'](_0xd09e12)[_0xbf4e('0x1f')](function(_0x2e7673){return _0x2e7673;});}return null;};}function removeEntity(_0x51648c,_0x31e3f5){return function(_0x30994d){if(_0x30994d){return _0x30994d[_0xbf4e('0x20')]()[_0xbf4e('0x1f')](function(){_0x51648c[_0xbf4e('0x14')](0xcc)['end']();});}};}function handleEntityNotFound(_0x90635e,_0x36688a){return function(_0x3d6863){if(!_0x3d6863){_0x90635e['sendStatus'](0x194);}return _0x3d6863;};}function handleError(_0x2fb490,_0x5e08b1){_0x5e08b1=_0x5e08b1||0x1f4;return function(_0x5bcf71){logger[_0xbf4e('0x21')](_0x5bcf71['stack']);if(_0x5bcf71[_0xbf4e('0x22')]){delete _0x5bcf71[_0xbf4e('0x22')];}_0x2fb490[_0xbf4e('0x14')](_0x5e08b1)[_0xbf4e('0x23')](_0x5bcf71);};}exports['index']=function(_0x2d4686,_0x8e0ab5){var _0x43879d={},_0x4cd4a1={},_0x681c3b={'count':0x0,'rows':[]};var _0x590c85=_[_0xbf4e('0x24')](db[_0xbf4e('0x25')][_0xbf4e('0x26')],function(_0x498dbd){return{'name':_0x498dbd[_0xbf4e('0x27')],'type':_0x498dbd[_0xbf4e('0x28')][_0xbf4e('0x29')]};});_0x4cd4a1[_0xbf4e('0x2a')]=_[_0xbf4e('0x24')](_0x590c85,_0xbf4e('0x22'));_0x4cd4a1['query']=_[_0xbf4e('0x2b')](_0x2d4686[_0xbf4e('0x2c')]);_0x4cd4a1['filters']=_[_0xbf4e('0x2d')](_0x4cd4a1[_0xbf4e('0x2a')],_0x4cd4a1['query']);_0x43879d[_0xbf4e('0x2e')]=_['intersection'](_0x4cd4a1[_0xbf4e('0x2a')],qs['fields'](_0x2d4686[_0xbf4e('0x2c')][_0xbf4e('0x2f')]));_0x43879d[_0xbf4e('0x2e')]=_0x43879d['attributes'][_0xbf4e('0x30')]?_0x43879d[_0xbf4e('0x2e')]:_0x4cd4a1[_0xbf4e('0x2a')];if(!_0x2d4686[_0xbf4e('0x2c')][_0xbf4e('0x31')](_0xbf4e('0x32'))){_0x43879d['limit']=qs[_0xbf4e('0x18')](_0x2d4686[_0xbf4e('0x2c')][_0xbf4e('0x18')]);_0x43879d[_0xbf4e('0x16')]=qs[_0xbf4e('0x16')](_0x2d4686['query']['offset']);}_0x43879d['order']=qs['sort'](_0x2d4686[_0xbf4e('0x2c')][_0xbf4e('0x33')]);_0x43879d[_0xbf4e('0x34')]=qs[_0xbf4e('0x35')](_[_0xbf4e('0x36')](_0x2d4686[_0xbf4e('0x2c')],_0x4cd4a1[_0xbf4e('0x35')]),_0x590c85);if(_0x2d4686[_0xbf4e('0x2c')][_0xbf4e('0x37')]){_0x43879d['where']=_['merge'](_0x43879d[_0xbf4e('0x34')],{'$or':_[_0xbf4e('0x24')](_0x590c85,function(_0x2cf1b0){if(_0x2cf1b0['type']!==_0xbf4e('0x38')){var _0x4e72a2={};_0x4e72a2[_0x2cf1b0[_0xbf4e('0x22')]]={'$like':'%'+_0x2d4686[_0xbf4e('0x2c')][_0xbf4e('0x37')]+'%'};return _0x4e72a2;}})});}_0x43879d=_[_0xbf4e('0x39')]({},_0x43879d,_0x2d4686['options']);var _0x31d8dc={'where':_0x43879d[_0xbf4e('0x34')]};return db[_0xbf4e('0x25')][_0xbf4e('0x19')](_0x31d8dc)['then'](function(_0x3d08d5){_0x681c3b[_0xbf4e('0x19')]=_0x3d08d5;if(_0x2d4686[_0xbf4e('0x2c')][_0xbf4e('0x3a')]){_0x43879d[_0xbf4e('0x3b')]=[{'all':!![]}];}return db[_0xbf4e('0x25')][_0xbf4e('0x3c')](_0x43879d);})['then'](function(_0x176166){_0x681c3b[_0xbf4e('0x3d')]=_0x176166;return _0x681c3b;})['then'](respondWithFilteredResult(_0x8e0ab5,_0x43879d))['catch'](handleError(_0x8e0ab5,null));};exports[_0xbf4e('0x3e')]=function(_0x35bd69,_0x495e53){var _0x5bfc4d={'raw':!![],'where':{'id':_0x35bd69[_0xbf4e('0x3f')]['id']}},_0x2b1bf4={};_0x2b1bf4[_0xbf4e('0x2a')]=_[_0xbf4e('0x2b')](db[_0xbf4e('0x25')][_0xbf4e('0x26')]);_0x2b1bf4['query']=_[_0xbf4e('0x2b')](_0x35bd69[_0xbf4e('0x2c')]);_0x2b1bf4['filters']=_['intersection'](_0x2b1bf4['model'],_0x2b1bf4['query']);_0x5bfc4d[_0xbf4e('0x2e')]=_['intersection'](_0x2b1bf4[_0xbf4e('0x2a')],qs[_0xbf4e('0x2f')](_0x35bd69['query']['fields']));_0x5bfc4d[_0xbf4e('0x2e')]=_0x5bfc4d[_0xbf4e('0x2e')][_0xbf4e('0x30')]?_0x5bfc4d[_0xbf4e('0x2e')]:_0x2b1bf4[_0xbf4e('0x2a')];if(_0x35bd69['query'][_0xbf4e('0x3a')]){_0x5bfc4d[_0xbf4e('0x3b')]=[{'all':!![]}];}_0x5bfc4d=_[_0xbf4e('0x39')]({},_0x5bfc4d,_0x35bd69[_0xbf4e('0x40')]);return db[_0xbf4e('0x25')][_0xbf4e('0x41')](_0x5bfc4d)[_0xbf4e('0x1f')](handleEntityNotFound(_0x495e53,null))[_0xbf4e('0x1f')](respondWithResult(_0x495e53,null))['catch'](handleError(_0x495e53,null));};exports[_0xbf4e('0x42')]=function(_0xb55a98,_0x1833c1){return db[_0xbf4e('0x25')][_0xbf4e('0x42')](_0xb55a98[_0xbf4e('0x43')],{})[_0xbf4e('0x1f')](respondWithResult(_0x1833c1,0xc9))[_0xbf4e('0x44')](handleError(_0x1833c1,null));};exports[_0xbf4e('0x45')]=function(_0x3447ab,_0x2fdba9){if(_0x3447ab[_0xbf4e('0x43')]['id']){delete _0x3447ab[_0xbf4e('0x43')]['id'];}return db[_0xbf4e('0x25')][_0xbf4e('0x41')]({'where':{'id':_0x3447ab[_0xbf4e('0x3f')]['id']}})[_0xbf4e('0x1f')](handleEntityNotFound(_0x2fdba9,null))['then'](saveUpdates(_0x3447ab[_0xbf4e('0x43')],null))[_0xbf4e('0x1f')](respondWithResult(_0x2fdba9,null))[_0xbf4e('0x44')](handleError(_0x2fdba9,null));};exports['destroy']=function(_0x33ab9a,_0x5ed838){return db['FaxQueueReport'][_0xbf4e('0x41')]({'where':{'id':_0x33ab9a[_0xbf4e('0x3f')]['id']}})['then'](handleEntityNotFound(_0x5ed838,null))[_0xbf4e('0x1f')](removeEntity(_0x5ed838,null))[_0xbf4e('0x44')](handleError(_0x5ed838,null));};exports[_0xbf4e('0x46')]=function(_0xa7af68,_0x42eef6){return db[_0xbf4e('0x25')][_0xbf4e('0x46')]()[_0xbf4e('0x1f')](respondWithResult(_0x42eef6,null))[_0xbf4e('0x44')](handleError(_0x42eef6,null));}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.model.js b/server/api/faxQueueReport/faxQueueReport.model.js index 35bad6a..e9c86ca 100644 --- a/server/api/faxQueueReport/faxQueueReport.model.js +++ b/server/api/faxQueueReport/faxQueueReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xabce=['path','rimraf','../../config/environment','define','report_fax_queue','uniqueid','lodash','util','../../config/logger','api','moment'];(function(_0x164737,_0x307811){var _0x21d4eb=function(_0x5e6ee9){while(--_0x5e6ee9){_0x164737['push'](_0x164737['shift']());}};_0x21d4eb(++_0x307811);}(_0xabce,0x103));var _0xeabc=function(_0x4bb66f,_0x3cd682){_0x4bb66f=_0x4bb66f-0x0;var _0xf2772f=_0xabce[_0x4bb66f];return _0xf2772f;};'use strict';var _=require(_0xeabc('0x0'));var util=require(_0xeabc('0x1'));var logger=require(_0xeabc('0x2'))(_0xeabc('0x3'));var moment=require(_0xeabc('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xeabc('0x5'));var rimraf=require(_0xeabc('0x6'));var config=require(_0xeabc('0x7'));var attributes=require('./faxQueueReport.attributes');module['exports']=function(_0x1b07a8,_0x52a4d7){return _0x1b07a8[_0xeabc('0x8')]('FaxQueueReport',attributes,{'tableName':_0xeabc('0x9'),'paranoid':![],'indexes':[{'name':_0xeabc('0xa'),'fields':[_0xeabc('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x7217=['api','moment','bluebird','request-promise','../../config/environment','./faxQueueReport.attributes','exports','define','FaxQueueReport','report_fax_queue','uniqueid','lodash','../../config/logger'];(function(_0xff7c05,_0x2456ca){var _0x1c1ab9=function(_0x187d56){while(--_0x187d56){_0xff7c05['push'](_0xff7c05['shift']());}};_0x1c1ab9(++_0x2456ca);}(_0x7217,0x19e));var _0x7721=function(_0x2b10c6,_0x185590){_0x2b10c6=_0x2b10c6-0x0;var _0x3789d2=_0x7217[_0x2b10c6];return _0x3789d2;};'use strict';var _=require(_0x7721('0x0'));var util=require('util');var logger=require(_0x7721('0x1'))(_0x7721('0x2'));var moment=require(_0x7721('0x3'));var BPromise=require(_0x7721('0x4'));var rp=require(_0x7721('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x7721('0x6'));var attributes=require(_0x7721('0x7'));module[_0x7721('0x8')]=function(_0x3fe47c,_0xb239e0){return _0x3fe47c[_0x7721('0x9')](_0x7721('0xa'),attributes,{'tableName':_0x7721('0xb'),'paranoid':![],'indexes':[{'name':_0x7721('0xc'),'fields':[_0x7721('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.rpc.js b/server/api/faxQueueReport/faxQueueReport.rpc.js index e52bcba..99be519 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 _0x0ca4=['UpdateFaxQueueReport','update','body','where','attributes','limit','lodash','util','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','FaxQueueReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','result','catch','CreateFaxQueueReport','FaxQueueReport','create','options','raw','stringify'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x0ca4,0x17a));var _0x40ca=function(_0x273503,_0x17dee3){_0x273503=_0x273503-0x0;var _0x348df0=_0x0ca4[_0x273503];return _0x348df0;};'use strict';var _=require(_0x40ca('0x0'));var util=require(_0x40ca('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x40ca('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x40ca('0x3'));var logger=require('../../config/logger')(_0x40ca('0x4'));var config=require(_0x40ca('0x5'));var jayson=require(_0x40ca('0x6'));var client=jayson['client'][_0x40ca('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x432e3b,_0x14407f,_0xf3f951){return new BPromise(function(_0x406bbf,_0x791d78){return client[_0x40ca('0x8')](_0x432e3b,_0xf3f951)[_0x40ca('0x9')](function(_0x511371){logger['info'](_0x40ca('0xa'),_0x14407f,_0x40ca('0xb'));logger[_0x40ca('0xc')]('FaxQueueReport,\x20%s,\x20%s,\x20%s',_0x14407f,_0x40ca('0xb'),JSON['stringify'](_0x511371));if(_0x511371['error']){if(_0x511371[_0x40ca('0xd')][_0x40ca('0xe')]===0x1f4){logger['error'](_0x40ca('0xa'),_0x14407f,_0x511371[_0x40ca('0xd')][_0x40ca('0xf')]);return _0x791d78(_0x511371['error']['message']);}logger['error'](_0x40ca('0xa'),_0x14407f,_0x511371[_0x40ca('0xd')][_0x40ca('0xf')]);return _0x406bbf(_0x511371[_0x40ca('0xd')][_0x40ca('0xf')]);}else{logger[_0x40ca('0x10')](_0x40ca('0xa'),_0x14407f,_0x40ca('0xb'));_0x406bbf(_0x511371[_0x40ca('0x11')][_0x40ca('0xf')]);}})[_0x40ca('0x12')](function(_0x39069d){logger[_0x40ca('0xd')](_0x40ca('0xa'),_0x14407f,_0x39069d);_0x791d78(_0x39069d);});});}exports[_0x40ca('0x13')]=function(_0x4ed3ec){var _0x260e33=this;return new Promise(function(_0x2c5f76,_0x1decd9){return db[_0x40ca('0x14')][_0x40ca('0x15')](_0x4ed3ec['body'],{'raw':_0x4ed3ec[_0x40ca('0x16')]?_0x4ed3ec[_0x40ca('0x16')][_0x40ca('0x17')]===undefined?!![]:![]:!![]})[_0x40ca('0x9')](function(_0x54049d){logger[_0x40ca('0x10')](_0x40ca('0x13'),_0x4ed3ec);logger[_0x40ca('0xc')]('CreateFaxQueueReport',_0x4ed3ec,JSON[_0x40ca('0x18')](_0x54049d));_0x2c5f76(_0x54049d);})[_0x40ca('0x12')](function(_0x269737){logger[_0x40ca('0xd')](_0x40ca('0x13'),_0x269737[_0x40ca('0xf')],_0x4ed3ec);_0x1decd9(_0x260e33[_0x40ca('0xd')](0x1f4,_0x269737[_0x40ca('0xf')]));});});};exports[_0x40ca('0x19')]=function(_0x2ef648){var _0x4a4652=this;return new Promise(function(_0xabcbf5,_0x5e614b){return db[_0x40ca('0x14')][_0x40ca('0x1a')](_0x2ef648[_0x40ca('0x1b')],{'raw':_0x2ef648[_0x40ca('0x16')]?_0x2ef648[_0x40ca('0x16')][_0x40ca('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2ef648['options']?_0x2ef648[_0x40ca('0x16')][_0x40ca('0x1c')]||null:null,'attributes':_0x2ef648[_0x40ca('0x16')]?_0x2ef648[_0x40ca('0x16')][_0x40ca('0x1d')]||null:null,'limit':_0x2ef648[_0x40ca('0x16')]?_0x2ef648[_0x40ca('0x16')][_0x40ca('0x1e')]||null:null})[_0x40ca('0x9')](function(_0xfb8efc){logger[_0x40ca('0x10')](_0x40ca('0x19'),_0x2ef648);logger['debug'](_0x40ca('0x19'),_0x2ef648,JSON[_0x40ca('0x18')](_0xfb8efc));_0xabcbf5(_0xfb8efc);})[_0x40ca('0x12')](function(_0x5e8013){logger['error']('UpdateFaxQueueReport',_0x5e8013[_0x40ca('0xf')],_0x2ef648);_0x5e614b(_0x4a4652[_0x40ca('0xd')](0x1f4,_0x5e8013[_0x40ca('0xf')]));});});}; \ No newline at end of file +var _0x9d81=['ioredis','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','FaxQueueReport,\x20%s,\x20%s','debug','FaxQueueReport,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','result','catch','CreateFaxQueueReport','body','options','raw','stringify','UpdateFaxQueueReport','FaxQueueReport','where','attributes','limit','lodash','util','moment','bluebird','randomstring'];(function(_0x478414,_0xcf142d){var _0x5eb6b9=function(_0x10e6fe){while(--_0x10e6fe){_0x478414['push'](_0x478414['shift']());}};_0x5eb6b9(++_0xcf142d);}(_0x9d81,0x1a8));var _0x19d8=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x9d81[_0x2c91e9];return _0x13f0ff;};'use strict';var _=require(_0x19d8('0x0'));var util=require(_0x19d8('0x1'));var moment=require(_0x19d8('0x2'));var BPromise=require(_0x19d8('0x3'));var rs=require(_0x19d8('0x4'));var fs=require('fs');var Redis=require(_0x19d8('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x19d8('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x19d8('0x7'));var jayson=require(_0x19d8('0x8'));var client=jayson[_0x19d8('0x9')][_0x19d8('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4b8572,_0x33cef5,_0x3f3433){return new BPromise(function(_0x4eeda6,_0x3f232c){return client[_0x19d8('0xb')](_0x4b8572,_0x3f3433)[_0x19d8('0xc')](function(_0x54274c){logger[_0x19d8('0xd')](_0x19d8('0xe'),_0x33cef5,'request\x20sent');logger[_0x19d8('0xf')](_0x19d8('0x10'),_0x33cef5,'request\x20sent',JSON['stringify'](_0x54274c));if(_0x54274c[_0x19d8('0x11')]){if(_0x54274c['error'][_0x19d8('0x12')]===0x1f4){logger['error'](_0x19d8('0xe'),_0x33cef5,_0x54274c[_0x19d8('0x11')][_0x19d8('0x13')]);return _0x3f232c(_0x54274c[_0x19d8('0x11')]['message']);}logger['error'](_0x19d8('0xe'),_0x33cef5,_0x54274c[_0x19d8('0x11')][_0x19d8('0x13')]);return _0x4eeda6(_0x54274c[_0x19d8('0x11')]['message']);}else{logger['info'](_0x19d8('0xe'),_0x33cef5,_0x19d8('0x14'));_0x4eeda6(_0x54274c[_0x19d8('0x15')][_0x19d8('0x13')]);}})[_0x19d8('0x16')](function(_0x3b56c2){logger[_0x19d8('0x11')]('FaxQueueReport,\x20%s,\x20%s',_0x33cef5,_0x3b56c2);_0x3f232c(_0x3b56c2);});});}exports[_0x19d8('0x17')]=function(_0x5c3e8b){var _0x22a9d7=this;return new Promise(function(_0x26943a,_0x295ce8){return db['FaxQueueReport']['create'](_0x5c3e8b[_0x19d8('0x18')],{'raw':_0x5c3e8b[_0x19d8('0x19')]?_0x5c3e8b[_0x19d8('0x19')][_0x19d8('0x1a')]===undefined?!![]:![]:!![]})[_0x19d8('0xc')](function(_0x5c3a0b){logger[_0x19d8('0xd')]('CreateFaxQueueReport',_0x5c3e8b);logger['debug']('CreateFaxQueueReport',_0x5c3e8b,JSON[_0x19d8('0x1b')](_0x5c3a0b));_0x26943a(_0x5c3a0b);})[_0x19d8('0x16')](function(_0x2f1aef){logger[_0x19d8('0x11')](_0x19d8('0x17'),_0x2f1aef['message'],_0x5c3e8b);_0x295ce8(_0x22a9d7[_0x19d8('0x11')](0x1f4,_0x2f1aef[_0x19d8('0x13')]));});});};exports[_0x19d8('0x1c')]=function(_0x86be68){var _0x2e674f=this;return new Promise(function(_0x5d136a,_0x27babb){return db[_0x19d8('0x1d')]['update'](_0x86be68['body'],{'raw':_0x86be68[_0x19d8('0x19')]?_0x86be68[_0x19d8('0x19')][_0x19d8('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x86be68[_0x19d8('0x19')]?_0x86be68[_0x19d8('0x19')][_0x19d8('0x1e')]||null:null,'attributes':_0x86be68['options']?_0x86be68[_0x19d8('0x19')][_0x19d8('0x1f')]||null:null,'limit':_0x86be68[_0x19d8('0x19')]?_0x86be68[_0x19d8('0x19')][_0x19d8('0x20')]||null:null})[_0x19d8('0xc')](function(_0x2045fc){logger[_0x19d8('0xd')](_0x19d8('0x1c'),_0x86be68);logger['debug'](_0x19d8('0x1c'),_0x86be68,JSON[_0x19d8('0x1b')](_0x2045fc));_0x5d136a(_0x2045fc);})['catch'](function(_0x2eaaf1){logger[_0x19d8('0x11')](_0x19d8('0x1c'),_0x2eaaf1['message'],_0x86be68);_0x27babb(_0x2e674f[_0x19d8('0x11')](0x1f4,_0x2eaaf1[_0x19d8('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/index.js b/server/api/faxQueueReport/index.js index f5879cb..eb1140e 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 _0xc73e=['post','put','delete','/:id','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxQueueReport.controller','get','isAuthenticated','index','show'];(function(_0x5b0093,_0x14e824){var _0x26d058=function(_0xa90026){while(--_0xa90026){_0x5b0093['push'](_0x5b0093['shift']());}};_0x26d058(++_0x14e824);}(_0xc73e,0x11e));var _0xec73=function(_0x1bbc6b,_0x2efebc){_0x1bbc6b=_0x1bbc6b-0x0;var _0x322034=_0xc73e[_0x1bbc6b];return _0x322034;};'use strict';var multer=require(_0xec73('0x0'));var util=require(_0xec73('0x1'));var path=require('path');var timeout=require(_0xec73('0x2'));var express=require(_0xec73('0x3'));var router=express[_0xec73('0x4')]();var fs_extra=require(_0xec73('0x5'));var auth=require(_0xec73('0x6'));var interaction=require(_0xec73('0x7'));var config=require(_0xec73('0x8'));var controller=require(_0xec73('0x9'));router[_0xec73('0xa')]('/',auth[_0xec73('0xb')](),controller[_0xec73('0xc')]);router[_0xec73('0xa')]('/describe',auth[_0xec73('0xb')](),controller['describe']);router[_0xec73('0xa')]('/:id',auth[_0xec73('0xb')](),controller[_0xec73('0xd')]);router[_0xec73('0xe')]('/',auth[_0xec73('0xb')](),controller['create']);router[_0xec73('0xf')]('/:id',auth[_0xec73('0xb')](),controller['update']);router[_0xec73('0x10')](_0xec73('0x11'),auth[_0xec73('0xb')](),controller[_0xec73('0x12')]);module[_0xec73('0x13')]=router; \ No newline at end of file +var _0x3b44=['destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./faxQueueReport.controller','get','index','/describe','isAuthenticated','describe','show','create','put','/:id','delete'];(function(_0x45e23d,_0x5be96d){var _0x1b82d1=function(_0x333cde){while(--_0x333cde){_0x45e23d['push'](_0x45e23d['shift']());}};_0x1b82d1(++_0x5be96d);}(_0x3b44,0x178));var _0x43b4=function(_0x36e5b0,_0x2008b7){_0x36e5b0=_0x36e5b0-0x0;var _0xdc93d9=_0x3b44[_0x36e5b0];return _0xdc93d9;};'use strict';var multer=require(_0x43b4('0x0'));var util=require(_0x43b4('0x1'));var path=require(_0x43b4('0x2'));var timeout=require(_0x43b4('0x3'));var express=require(_0x43b4('0x4'));var router=express[_0x43b4('0x5')]();var fs_extra=require(_0x43b4('0x6'));var auth=require(_0x43b4('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x43b4('0x8'));var controller=require(_0x43b4('0x9'));router[_0x43b4('0xa')]('/',auth['isAuthenticated'](),controller[_0x43b4('0xb')]);router[_0x43b4('0xa')](_0x43b4('0xc'),auth[_0x43b4('0xd')](),controller[_0x43b4('0xe')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x43b4('0xf')]);router['post']('/',auth[_0x43b4('0xd')](),controller[_0x43b4('0x10')]);router[_0x43b4('0x11')](_0x43b4('0x12'),auth['isAuthenticated'](),controller['update']);router[_0x43b4('0x13')](_0x43b4('0x12'),auth['isAuthenticated'](),controller[_0x43b4('0x14')]);module[_0x43b4('0x15')]=router; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.attributes.js b/server/api/faxTransferReport/faxTransferReport.attributes.js index 7bde9fe..c8390f0 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 _0xedd9=['account','agent','queue','NOW','sequelize','exports','STRING','ENUM'];(function(_0x53f7d7,_0x39d621){var _0x3ae0f4=function(_0x2a6ccb){while(--_0x2a6ccb){_0x53f7d7['push'](_0x53f7d7['shift']());}};_0x3ae0f4(++_0x39d621);}(_0xedd9,0xfc));var _0x9edd=function(_0x399dc9,_0x7d695){_0x399dc9=_0x399dc9-0x0;var _0x20e94b=_0xedd9[_0x399dc9];return _0x20e94b;};'use strict';var moment=require('moment');var Sequelize=require(_0x9edd('0x0'));module[_0x9edd('0x1')]={'uniqueid':{'type':Sequelize[_0x9edd('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x9edd('0x3')](_0x9edd('0x4'),_0x9edd('0x5'),_0x9edd('0x6')),'allowNull':![],'defaultValue':_0x9edd('0x6')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x9edd('0x7')]}}; \ No newline at end of file +var _0xf3cd=['exports','STRING','ENUM','account','queue','DATE','moment','sequelize'];(function(_0x375bf2,_0x114598){var _0x3ff9fc=function(_0x35b7ac){while(--_0x35b7ac){_0x375bf2['push'](_0x375bf2['shift']());}};_0x3ff9fc(++_0x114598);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x3bc298,_0x583d14){_0x3bc298=_0x3bc298-0x0;var _0x31bf58=_0xf3cd[_0x3bc298];return _0x31bf58;};'use strict';var moment=require(_0xdf3c('0x0'));var Sequelize=require(_0xdf3c('0x1'));module[_0xdf3c('0x2')]={'uniqueid':{'type':Sequelize[_0xdf3c('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xdf3c('0x4')](_0xdf3c('0x5'),'agent',_0xdf3c('0x6')),'allowNull':![],'defaultValue':_0xdf3c('0x6')},'transferredAt':{'type':Sequelize[_0xdf3c('0x7')],'allowNull':![],'defaultValue':Sequelize['NOW']}}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.controller.js b/server/api/faxTransferReport/faxTransferReport.controller.js index 343b480..238b668 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 _0x02e5=['../../mysqldb','sendStatus','status','undefined','limit','offset','count','Content-Range','json','apply','reject','save','update','destroy','then','end','error','stack','name','send','index','FaxTransferReport','fieldName','type','key','model','map','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','includeAll','include','rows','catch','show','rawAttributes','find','create','body','params','describe','rimraf','fast-json-patch','moment','bluebird','path','sox','fs-extra','lodash','squel','crypto','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils'];(function(_0x4aa608,_0x55e3fa){var _0x4e806d=function(_0x1bd48b){while(--_0x1bd48b){_0x4aa608['push'](_0x4aa608['shift']());}};_0x4e806d(++_0x55e3fa);}(_0x02e5,0x10d));var _0x502e=function(_0x4e87e4,_0x520f8c){_0x4e87e4=_0x4e87e4-0x0;var _0xb230fc=_0x02e5[_0x4e87e4];return _0xb230fc;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x502e('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x502e('0x1'));var rp=require('request-promise');var moment=require(_0x502e('0x2'));var BPromise=require(_0x502e('0x3'));var Mustache=require('mustache');var util=require('util');var path=require(_0x502e('0x4'));var sox=require(_0x502e('0x5'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x502e('0x6'));var _=require(_0x502e('0x7'));var squel=require(_0x502e('0x8'));var crypto=require(_0x502e('0x9'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x502e('0xa'));var querystring=require(_0x502e('0xb'));var Papa=require(_0x502e('0xc'));var Redis=require(_0x502e('0xd'));var authService=require(_0x502e('0xe'));var qs=require(_0x502e('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x502e('0x10'));var logger=require('../../config/logger')(_0x502e('0x11'));var utils=require(_0x502e('0x12'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x502e('0x13'))['db'];function respondWithStatusCode(_0x1adab0,_0x53b100){_0x53b100=_0x53b100||0xcc;return function(_0x4d1264){if(_0x4d1264){return _0x1adab0[_0x502e('0x14')](_0x53b100);}return _0x1adab0[_0x502e('0x15')](_0x53b100)['end']();};}function respondWithResult(_0x56bf81,_0x5eea87){_0x5eea87=_0x5eea87||0xc8;return function(_0x5f0a5d){if(_0x5f0a5d){return _0x56bf81['status'](_0x5eea87)['json'](_0x5f0a5d);}};}function respondWithFilteredResult(_0x1ef2e7,_0x136d4f){return function(_0x151998){if(_0x151998){var _0x4b178e=typeof _0x136d4f['offset']===_0x502e('0x16')&&typeof _0x136d4f[_0x502e('0x17')]===_0x502e('0x16');var _0x26ff40=_0x151998['count'];var _0x54734d=_0x4b178e?0x0:_0x136d4f[_0x502e('0x18')];var _0x3ee930=_0x4b178e?_0x151998[_0x502e('0x19')]:_0x136d4f['offset']+_0x136d4f[_0x502e('0x17')];var _0x12a569;if(_0x3ee930>=_0x26ff40){_0x3ee930=_0x26ff40;_0x12a569=0xc8;}else{_0x12a569=0xce;}_0x1ef2e7[_0x502e('0x15')](_0x12a569);return _0x1ef2e7['set'](_0x502e('0x1a'),_0x54734d+'-'+_0x3ee930+'/'+_0x26ff40)[_0x502e('0x1b')](_0x151998);}return null;};}function patchUpdates(_0x13c135){return function(_0x375e99){try{jsonpatch[_0x502e('0x1c')](_0x375e99,_0x13c135,!![]);}catch(_0x35cc01){return BPromise[_0x502e('0x1d')](_0x35cc01);}return _0x375e99[_0x502e('0x1e')]();};}function saveUpdates(_0x3d6745,_0x50f111){return function(_0x2c667f){if(_0x2c667f){return _0x2c667f[_0x502e('0x1f')](_0x3d6745)['then'](function(_0x3b6b9f){return _0x3b6b9f;});}return null;};}function removeEntity(_0x30f291,_0x255ddb){return function(_0x188a2d){if(_0x188a2d){return _0x188a2d[_0x502e('0x20')]()[_0x502e('0x21')](function(){_0x30f291[_0x502e('0x15')](0xcc)[_0x502e('0x22')]();});}};}function handleEntityNotFound(_0x45e6ec,_0x10e648){return function(_0x35f552){if(!_0x35f552){_0x45e6ec[_0x502e('0x14')](0x194);}return _0x35f552;};}function handleError(_0x36484e,_0x3d093a){_0x3d093a=_0x3d093a||0x1f4;return function(_0x5cddc6){logger[_0x502e('0x23')](_0x5cddc6[_0x502e('0x24')]);if(_0x5cddc6[_0x502e('0x25')]){delete _0x5cddc6[_0x502e('0x25')];}_0x36484e[_0x502e('0x15')](_0x3d093a)[_0x502e('0x26')](_0x5cddc6);};}exports[_0x502e('0x27')]=function(_0x194a1c,_0x242a0d){var _0x11adb8={},_0x402b6e={},_0x4ac312={'count':0x0,'rows':[]};var _0x3a4ee0=_['map'](db[_0x502e('0x28')]['rawAttributes'],function(_0x4244b5){return{'name':_0x4244b5[_0x502e('0x29')],'type':_0x4244b5[_0x502e('0x2a')][_0x502e('0x2b')]};});_0x402b6e[_0x502e('0x2c')]=_[_0x502e('0x2d')](_0x3a4ee0,_0x502e('0x25'));_0x402b6e['query']=_[_0x502e('0x2e')](_0x194a1c[_0x502e('0x2f')]);_0x402b6e[_0x502e('0x30')]=_[_0x502e('0x31')](_0x402b6e['model'],_0x402b6e[_0x502e('0x2f')]);_0x11adb8[_0x502e('0x32')]=_[_0x502e('0x31')](_0x402b6e['model'],qs[_0x502e('0x33')](_0x194a1c['query'][_0x502e('0x33')]));_0x11adb8[_0x502e('0x32')]=_0x11adb8[_0x502e('0x32')][_0x502e('0x34')]?_0x11adb8['attributes']:_0x402b6e[_0x502e('0x2c')];if(!_0x194a1c[_0x502e('0x2f')][_0x502e('0x35')](_0x502e('0x36'))){_0x11adb8[_0x502e('0x17')]=qs['limit'](_0x194a1c[_0x502e('0x2f')]['limit']);_0x11adb8[_0x502e('0x18')]=qs[_0x502e('0x18')](_0x194a1c[_0x502e('0x2f')]['offset']);}_0x11adb8['order']=qs['sort'](_0x194a1c[_0x502e('0x2f')][_0x502e('0x37')]);_0x11adb8[_0x502e('0x38')]=qs[_0x502e('0x30')](_[_0x502e('0x39')](_0x194a1c[_0x502e('0x2f')],_0x402b6e[_0x502e('0x30')]),_0x3a4ee0);if(_0x194a1c[_0x502e('0x2f')][_0x502e('0x3a')]){_0x11adb8[_0x502e('0x38')]=_[_0x502e('0x3b')](_0x11adb8[_0x502e('0x38')],{'$or':_[_0x502e('0x2d')](_0x3a4ee0,function(_0x5cfd6f){if(_0x5cfd6f[_0x502e('0x2a')]!=='VIRTUAL'){var _0x35066a={};_0x35066a[_0x5cfd6f[_0x502e('0x25')]]={'$like':'%'+_0x194a1c[_0x502e('0x2f')][_0x502e('0x3a')]+'%'};return _0x35066a;}})});}_0x11adb8=_[_0x502e('0x3b')]({},_0x11adb8,_0x194a1c[_0x502e('0x3c')]);var _0x119de8={'where':_0x11adb8['where']};return db[_0x502e('0x28')]['count'](_0x119de8)[_0x502e('0x21')](function(_0x2c2da2){_0x4ac312[_0x502e('0x19')]=_0x2c2da2;if(_0x194a1c[_0x502e('0x2f')][_0x502e('0x3d')]){_0x11adb8[_0x502e('0x3e')]=[{'all':!![]}];}return db[_0x502e('0x28')]['findAll'](_0x11adb8);})[_0x502e('0x21')](function(_0xc1789a){_0x4ac312[_0x502e('0x3f')]=_0xc1789a;return _0x4ac312;})[_0x502e('0x21')](respondWithFilteredResult(_0x242a0d,_0x11adb8))[_0x502e('0x40')](handleError(_0x242a0d,null));};exports[_0x502e('0x41')]=function(_0x5cdca1,_0x235201){var _0x5bf951={'raw':!![],'where':{'id':_0x5cdca1['params']['id']}},_0x188004={};_0x188004['model']=_[_0x502e('0x2e')](db['FaxTransferReport'][_0x502e('0x42')]);_0x188004[_0x502e('0x2f')]=_['keys'](_0x5cdca1[_0x502e('0x2f')]);_0x188004['filters']=_[_0x502e('0x31')](_0x188004[_0x502e('0x2c')],_0x188004['query']);_0x5bf951[_0x502e('0x32')]=_[_0x502e('0x31')](_0x188004[_0x502e('0x2c')],qs[_0x502e('0x33')](_0x5cdca1[_0x502e('0x2f')][_0x502e('0x33')]));_0x5bf951[_0x502e('0x32')]=_0x5bf951['attributes'][_0x502e('0x34')]?_0x5bf951[_0x502e('0x32')]:_0x188004[_0x502e('0x2c')];if(_0x5cdca1[_0x502e('0x2f')][_0x502e('0x3d')]){_0x5bf951[_0x502e('0x3e')]=[{'all':!![]}];}_0x5bf951=_['merge']({},_0x5bf951,_0x5cdca1[_0x502e('0x3c')]);return db[_0x502e('0x28')][_0x502e('0x43')](_0x5bf951)['then'](handleEntityNotFound(_0x235201,null))['then'](respondWithResult(_0x235201,null))[_0x502e('0x40')](handleError(_0x235201,null));};exports[_0x502e('0x44')]=function(_0x1bd59d,_0x3bef6b){return db[_0x502e('0x28')][_0x502e('0x44')](_0x1bd59d['body'],{})[_0x502e('0x21')](respondWithResult(_0x3bef6b,0xc9))['catch'](handleError(_0x3bef6b,null));};exports[_0x502e('0x1f')]=function(_0x4336a6,_0x4cc640){if(_0x4336a6['body']['id']){delete _0x4336a6[_0x502e('0x45')]['id'];}return db[_0x502e('0x28')][_0x502e('0x43')]({'where':{'id':_0x4336a6['params']['id']}})[_0x502e('0x21')](handleEntityNotFound(_0x4cc640,null))[_0x502e('0x21')](saveUpdates(_0x4336a6[_0x502e('0x45')],null))[_0x502e('0x21')](respondWithResult(_0x4cc640,null))[_0x502e('0x40')](handleError(_0x4cc640,null));};exports[_0x502e('0x20')]=function(_0xe3601,_0xb2ceeb){return db[_0x502e('0x28')][_0x502e('0x43')]({'where':{'id':_0xe3601[_0x502e('0x46')]['id']}})['then'](handleEntityNotFound(_0xb2ceeb,null))[_0x502e('0x21')](removeEntity(_0xb2ceeb,null))[_0x502e('0x40')](handleError(_0xb2ceeb,null));};exports[_0x502e('0x47')]=function(_0x4eb1d2,_0x50079c){return db[_0x502e('0x28')][_0x502e('0x47')]()['then'](respondWithResult(_0x50079c,null))[_0x502e('0x40')](handleError(_0x50079c,null));}; \ No newline at end of file +var _0x7dd3=['rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','end','sendStatus','error','name','index','map','FaxTransferReport','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','catch','params','includeAll','find','create','body','destroy','describe','eml-format'];(function(_0xf908b,_0x16ed65){var _0x5228fc=function(_0x320ab2){while(--_0x320ab2){_0xf908b['push'](_0xf908b['shift']());}};_0x5228fc(++_0x16ed65);}(_0x7dd3,0xdd));var _0x37dd=function(_0x2ca0cf,_0x2f56c3){_0x2ca0cf=_0x2ca0cf-0x0;var _0x12e852=_0x7dd3[_0x2ca0cf];return _0x12e852;};'use strict';var emlformat=require(_0x37dd('0x0'));var rimraf=require(_0x37dd('0x1'));var zipdir=require(_0x37dd('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x37dd('0x3'));var moment=require(_0x37dd('0x4'));var BPromise=require(_0x37dd('0x5'));var Mustache=require(_0x37dd('0x6'));var util=require(_0x37dd('0x7'));var path=require(_0x37dd('0x8'));var sox=require(_0x37dd('0x9'));var csv=require(_0x37dd('0xa'));var ejs=require(_0x37dd('0xb'));var fs=require('fs');var fs_extra=require(_0x37dd('0xc'));var _=require(_0x37dd('0xd'));var squel=require(_0x37dd('0xe'));var crypto=require(_0x37dd('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x37dd('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x37dd('0x11'));var Redis=require('ioredis');var authService=require(_0x37dd('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x37dd('0x13'));var logger=require(_0x37dd('0x14'))(_0x37dd('0x15'));var utils=require(_0x37dd('0x16'));var config=require(_0x37dd('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x37dd('0x18'))['db'];function respondWithStatusCode(_0x1aea00,_0x2c65a2){_0x2c65a2=_0x2c65a2||0xcc;return function(_0x46ea41){if(_0x46ea41){return _0x1aea00['sendStatus'](_0x2c65a2);}return _0x1aea00['status'](_0x2c65a2)['end']();};}function respondWithResult(_0x2344a0,_0x17bb89){_0x17bb89=_0x17bb89||0xc8;return function(_0x3a7512){if(_0x3a7512){return _0x2344a0[_0x37dd('0x19')](_0x17bb89)[_0x37dd('0x1a')](_0x3a7512);}};}function respondWithFilteredResult(_0x4427ae,_0x20912a){return function(_0x4a86f5){if(_0x4a86f5){var _0x5209c4=typeof _0x20912a['offset']===_0x37dd('0x1b')&&typeof _0x20912a[_0x37dd('0x1c')]===_0x37dd('0x1b');var _0x1566ff=_0x4a86f5[_0x37dd('0x1d')];var _0x2f70ed=_0x5209c4?0x0:_0x20912a[_0x37dd('0x1e')];var _0x268ccb=_0x5209c4?_0x4a86f5['count']:_0x20912a[_0x37dd('0x1e')]+_0x20912a[_0x37dd('0x1c')];var _0xbeb928;if(_0x268ccb>=_0x1566ff){_0x268ccb=_0x1566ff;_0xbeb928=0xc8;}else{_0xbeb928=0xce;}_0x4427ae[_0x37dd('0x19')](_0xbeb928);return _0x4427ae[_0x37dd('0x1f')](_0x37dd('0x20'),_0x2f70ed+'-'+_0x268ccb+'/'+_0x1566ff)[_0x37dd('0x1a')](_0x4a86f5);}return null;};}function patchUpdates(_0x51e2c1){return function(_0x12c391){try{jsonpatch[_0x37dd('0x21')](_0x12c391,_0x51e2c1,!![]);}catch(_0x4fbec0){return BPromise[_0x37dd('0x22')](_0x4fbec0);}return _0x12c391[_0x37dd('0x23')]();};}function saveUpdates(_0xec80a1,_0xddd727){return function(_0x16d172){if(_0x16d172){return _0x16d172[_0x37dd('0x24')](_0xec80a1)[_0x37dd('0x25')](function(_0x340f35){return _0x340f35;});}return null;};}function removeEntity(_0x4600b6,_0x5f139a){return function(_0xb22c2b){if(_0xb22c2b){return _0xb22c2b['destroy']()['then'](function(){_0x4600b6[_0x37dd('0x19')](0xcc)[_0x37dd('0x26')]();});}};}function handleEntityNotFound(_0x528d53,_0x53af54){return function(_0x4118c9){if(!_0x4118c9){_0x528d53[_0x37dd('0x27')](0x194);}return _0x4118c9;};}function handleError(_0x156ed0,_0x5e8b49){_0x5e8b49=_0x5e8b49||0x1f4;return function(_0x1a5a8e){logger[_0x37dd('0x28')](_0x1a5a8e['stack']);if(_0x1a5a8e[_0x37dd('0x29')]){delete _0x1a5a8e[_0x37dd('0x29')];}_0x156ed0[_0x37dd('0x19')](_0x5e8b49)['send'](_0x1a5a8e);};}exports[_0x37dd('0x2a')]=function(_0xd8267e,_0x4abf50){var _0xde5b3c={},_0x10dc36={},_0x3480af={'count':0x0,'rows':[]};var _0x21fb53=_[_0x37dd('0x2b')](db[_0x37dd('0x2c')]['rawAttributes'],function(_0x325577){return{'name':_0x325577[_0x37dd('0x2d')],'type':_0x325577[_0x37dd('0x2e')][_0x37dd('0x2f')]};});_0x10dc36[_0x37dd('0x30')]=_[_0x37dd('0x2b')](_0x21fb53,_0x37dd('0x29'));_0x10dc36['query']=_[_0x37dd('0x31')](_0xd8267e[_0x37dd('0x32')]);_0x10dc36[_0x37dd('0x33')]=_[_0x37dd('0x34')](_0x10dc36[_0x37dd('0x30')],_0x10dc36[_0x37dd('0x32')]);_0xde5b3c[_0x37dd('0x35')]=_[_0x37dd('0x34')](_0x10dc36[_0x37dd('0x30')],qs['fields'](_0xd8267e['query'][_0x37dd('0x36')]));_0xde5b3c[_0x37dd('0x35')]=_0xde5b3c[_0x37dd('0x35')][_0x37dd('0x37')]?_0xde5b3c[_0x37dd('0x35')]:_0x10dc36[_0x37dd('0x30')];if(!_0xd8267e['query'][_0x37dd('0x38')]('nolimit')){_0xde5b3c[_0x37dd('0x1c')]=qs['limit'](_0xd8267e['query']['limit']);_0xde5b3c['offset']=qs[_0x37dd('0x1e')](_0xd8267e[_0x37dd('0x32')][_0x37dd('0x1e')]);}_0xde5b3c['order']=qs['sort'](_0xd8267e[_0x37dd('0x32')][_0x37dd('0x39')]);_0xde5b3c[_0x37dd('0x3a')]=qs[_0x37dd('0x33')](_[_0x37dd('0x3b')](_0xd8267e[_0x37dd('0x32')],_0x10dc36[_0x37dd('0x33')]),_0x21fb53);if(_0xd8267e['query'][_0x37dd('0x3c')]){_0xde5b3c[_0x37dd('0x3a')]=_[_0x37dd('0x3d')](_0xde5b3c['where'],{'$or':_[_0x37dd('0x2b')](_0x21fb53,function(_0x1b3ecb){if(_0x1b3ecb['type']!==_0x37dd('0x3e')){var _0x4d9e71={};_0x4d9e71[_0x1b3ecb[_0x37dd('0x29')]]={'$like':'%'+_0xd8267e['query'][_0x37dd('0x3c')]+'%'};return _0x4d9e71;}})});}_0xde5b3c=_['merge']({},_0xde5b3c,_0xd8267e[_0x37dd('0x3f')]);var _0x41da5b={'where':_0xde5b3c[_0x37dd('0x3a')]};return db[_0x37dd('0x2c')][_0x37dd('0x1d')](_0x41da5b)[_0x37dd('0x25')](function(_0x1f0771){_0x3480af[_0x37dd('0x1d')]=_0x1f0771;if(_0xd8267e[_0x37dd('0x32')]['includeAll']){_0xde5b3c[_0x37dd('0x40')]=[{'all':!![]}];}return db[_0x37dd('0x2c')][_0x37dd('0x41')](_0xde5b3c);})[_0x37dd('0x25')](function(_0xda26fa){_0x3480af['rows']=_0xda26fa;return _0x3480af;})[_0x37dd('0x25')](respondWithFilteredResult(_0x4abf50,_0xde5b3c))[_0x37dd('0x42')](handleError(_0x4abf50,null));};exports['show']=function(_0x4159b5,_0x1a3312){var _0xf76a4d={'raw':!![],'where':{'id':_0x4159b5[_0x37dd('0x43')]['id']}},_0x584931={};_0x584931[_0x37dd('0x30')]=_[_0x37dd('0x31')](db[_0x37dd('0x2c')]['rawAttributes']);_0x584931[_0x37dd('0x32')]=_[_0x37dd('0x31')](_0x4159b5[_0x37dd('0x32')]);_0x584931[_0x37dd('0x33')]=_['intersection'](_0x584931['model'],_0x584931['query']);_0xf76a4d[_0x37dd('0x35')]=_[_0x37dd('0x34')](_0x584931[_0x37dd('0x30')],qs[_0x37dd('0x36')](_0x4159b5[_0x37dd('0x32')][_0x37dd('0x36')]));_0xf76a4d[_0x37dd('0x35')]=_0xf76a4d[_0x37dd('0x35')][_0x37dd('0x37')]?_0xf76a4d['attributes']:_0x584931['model'];if(_0x4159b5[_0x37dd('0x32')][_0x37dd('0x44')]){_0xf76a4d[_0x37dd('0x40')]=[{'all':!![]}];}_0xf76a4d=_['merge']({},_0xf76a4d,_0x4159b5['options']);return db[_0x37dd('0x2c')][_0x37dd('0x45')](_0xf76a4d)['then'](handleEntityNotFound(_0x1a3312,null))[_0x37dd('0x25')](respondWithResult(_0x1a3312,null))[_0x37dd('0x42')](handleError(_0x1a3312,null));};exports[_0x37dd('0x46')]=function(_0x11a238,_0x5bc74d){return db[_0x37dd('0x2c')][_0x37dd('0x46')](_0x11a238['body'],{})[_0x37dd('0x25')](respondWithResult(_0x5bc74d,0xc9))[_0x37dd('0x42')](handleError(_0x5bc74d,null));};exports['update']=function(_0x79161d,_0x1da161){if(_0x79161d[_0x37dd('0x47')]['id']){delete _0x79161d['body']['id'];}return db[_0x37dd('0x2c')][_0x37dd('0x45')]({'where':{'id':_0x79161d[_0x37dd('0x43')]['id']}})[_0x37dd('0x25')](handleEntityNotFound(_0x1da161,null))[_0x37dd('0x25')](saveUpdates(_0x79161d['body'],null))[_0x37dd('0x25')](respondWithResult(_0x1da161,null))[_0x37dd('0x42')](handleError(_0x1da161,null));};exports[_0x37dd('0x48')]=function(_0x1bd2f8,_0x144e24){return db[_0x37dd('0x2c')]['find']({'where':{'id':_0x1bd2f8[_0x37dd('0x43')]['id']}})[_0x37dd('0x25')](handleEntityNotFound(_0x144e24,null))['then'](removeEntity(_0x144e24,null))['catch'](handleError(_0x144e24,null));};exports[_0x37dd('0x49')]=function(_0x492d40,_0x216105){return db[_0x37dd('0x2c')][_0x37dd('0x49')]()[_0x37dd('0x25')](respondWithResult(_0x216105,null))['catch'](handleError(_0x216105,null));}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.model.js b/server/api/faxTransferReport/faxTransferReport.model.js index 3fde4b3..e29d671 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 _0x929b=['define','FaxTransferReport','report_fax_transfer','uniqueid','util','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxTransferReport.attributes','exports'];(function(_0x229532,_0x1c0e67){var _0x598c8a=function(_0x3e25ac){while(--_0x3e25ac){_0x229532['push'](_0x229532['shift']());}};_0x598c8a(++_0x1c0e67);}(_0x929b,0x1f2));var _0xb929=function(_0x205c11,_0x941d3d){_0x205c11=_0x205c11-0x0;var _0x550e7b=_0x929b[_0x205c11];return _0x550e7b;};'use strict';var _=require('lodash');var util=require(_0xb929('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0xb929('0x1'));var BPromise=require(_0xb929('0x2'));var rp=require(_0xb929('0x3'));var fs=require('fs');var path=require(_0xb929('0x4'));var rimraf=require(_0xb929('0x5'));var config=require(_0xb929('0x6'));var attributes=require(_0xb929('0x7'));module[_0xb929('0x8')]=function(_0x28d21f,_0x1b2c99){return _0x28d21f[_0xb929('0x9')](_0xb929('0xa'),attributes,{'tableName':_0xb929('0xb'),'paranoid':![],'indexes':[{'name':_0xb929('0xc'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xaa00=['./faxTransferReport.attributes','exports','define','report_fax_transfer','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x59f0dc,_0x1e2497){var _0x5b5445=function(_0x57ca91){while(--_0x57ca91){_0x59f0dc['push'](_0x59f0dc['shift']());}};_0x5b5445(++_0x1e2497);}(_0xaa00,0x91));var _0x0aa0=function(_0x5e015c,_0x5910b7){_0x5e015c=_0x5e015c-0x0;var _0xae5b93=_0xaa00[_0x5e015c];return _0xae5b93;};'use strict';var _=require(_0x0aa0('0x0'));var util=require(_0x0aa0('0x1'));var logger=require(_0x0aa0('0x2'))(_0x0aa0('0x3'));var moment=require(_0x0aa0('0x4'));var BPromise=require(_0x0aa0('0x5'));var rp=require(_0x0aa0('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0aa0('0x7'));var config=require(_0x0aa0('0x8'));var attributes=require(_0x0aa0('0x9'));module[_0x0aa0('0xa')]=function(_0x516ea2,_0x42f14d){return _0x516ea2[_0x0aa0('0xb')]('FaxTransferReport',attributes,{'tableName':_0x0aa0('0xc'),'paranoid':![],'indexes':[{'name':_0x0aa0('0xd'),'fields':[_0x0aa0('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.rpc.js b/server/api/faxTransferReport/faxTransferReport.rpc.js index 1f11d98..933d1d3 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 _0xd07a=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','FaxTransferReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x563af1,_0x37924c){var _0x58fccb=function(_0x509595){while(--_0x509595){_0x563af1['push'](_0x563af1['shift']());}};_0x58fccb(++_0x37924c);}(_0xd07a,0x14a));var _0xad07=function(_0x996bc8,_0x291e01){_0x996bc8=_0x996bc8-0x0;var _0x20b0ea=_0xd07a[_0x996bc8];return _0x20b0ea;};'use strict';var _=require('lodash');var util=require(_0xad07('0x0'));var moment=require(_0xad07('0x1'));var BPromise=require(_0xad07('0x2'));var rs=require(_0xad07('0x3'));var fs=require('fs');var Redis=require(_0xad07('0x4'));var db=require(_0xad07('0x5'))['db'];var utils=require(_0xad07('0x6'));var logger=require(_0xad07('0x7'))(_0xad07('0x8'));var config=require(_0xad07('0x9'));var jayson=require(_0xad07('0xa'));var client=jayson[_0xad07('0xb')][_0xad07('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4dca5d,_0x59324b,_0x20f141){return new BPromise(function(_0x31db74,_0x357584){return client[_0xad07('0xd')](_0x4dca5d,_0x20f141)['then'](function(_0x5a5ac1){logger[_0xad07('0xe')](_0xad07('0xf'),_0x59324b,_0xad07('0x10'));logger[_0xad07('0x11')]('FaxTransferReport,\x20%s,\x20%s,\x20%s',_0x59324b,_0xad07('0x10'),JSON[_0xad07('0x12')](_0x5a5ac1));if(_0x5a5ac1[_0xad07('0x13')]){if(_0x5a5ac1[_0xad07('0x13')][_0xad07('0x14')]===0x1f4){logger[_0xad07('0x13')]('FaxTransferReport,\x20%s,\x20%s',_0x59324b,_0x5a5ac1[_0xad07('0x13')][_0xad07('0x15')]);return _0x357584(_0x5a5ac1[_0xad07('0x13')]['message']);}logger[_0xad07('0x13')](_0xad07('0xf'),_0x59324b,_0x5a5ac1[_0xad07('0x13')]['message']);return _0x31db74(_0x5a5ac1[_0xad07('0x13')]['message']);}else{logger[_0xad07('0xe')](_0xad07('0xf'),_0x59324b,_0xad07('0x10'));_0x31db74(_0x5a5ac1[_0xad07('0x16')]['message']);}})[_0xad07('0x17')](function(_0x329699){logger[_0xad07('0x13')]('FaxTransferReport,\x20%s,\x20%s',_0x59324b,_0x329699);_0x357584(_0x329699);});});} \ No newline at end of file +var _0x08c0=['FaxTransferReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','util','randomstring','ioredis','../../config/logger','rpc','client','http','request','info'];(function(_0x38d15a,_0x5cc888){var _0x51b55e=function(_0x49bf3c){while(--_0x49bf3c){_0x38d15a['push'](_0x38d15a['shift']());}};_0x51b55e(++_0x5cc888);}(_0x08c0,0x171));var _0x008c=function(_0x1cd565,_0x2b2d3a){_0x1cd565=_0x1cd565-0x0;var _0x5d5715=_0x08c0[_0x1cd565];return _0x5d5715;};'use strict';var _=require('lodash');var util=require(_0x008c('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x008c('0x1'));var fs=require('fs');var Redis=require(_0x008c('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x008c('0x3'))(_0x008c('0x4'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x008c('0x5')][_0x008c('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x146749,_0x23d5d6,_0x33fe75){return new BPromise(function(_0x22dfb3,_0x282ef9){return client[_0x008c('0x7')](_0x146749,_0x33fe75)['then'](function(_0x1731f8){logger[_0x008c('0x8')](_0x008c('0x9'),_0x23d5d6,_0x008c('0xa'));logger[_0x008c('0xb')]('FaxTransferReport,\x20%s,\x20%s,\x20%s',_0x23d5d6,_0x008c('0xa'),JSON[_0x008c('0xc')](_0x1731f8));if(_0x1731f8[_0x008c('0xd')]){if(_0x1731f8[_0x008c('0xd')][_0x008c('0xe')]===0x1f4){logger[_0x008c('0xd')]('FaxTransferReport,\x20%s,\x20%s',_0x23d5d6,_0x1731f8[_0x008c('0xd')]['message']);return _0x282ef9(_0x1731f8[_0x008c('0xd')]['message']);}logger[_0x008c('0xd')](_0x008c('0x9'),_0x23d5d6,_0x1731f8['error']['message']);return _0x22dfb3(_0x1731f8[_0x008c('0xd')][_0x008c('0xf')]);}else{logger[_0x008c('0x8')](_0x008c('0x9'),_0x23d5d6,_0x008c('0xa'));_0x22dfb3(_0x1731f8[_0x008c('0x10')][_0x008c('0xf')]);}})[_0x008c('0x11')](function(_0x5bdf73){logger[_0x008c('0xd')]('FaxTransferReport,\x20%s,\x20%s',_0x23d5d6,_0x5bdf73);_0x282ef9(_0x5bdf73);});});} \ No newline at end of file diff --git a/server/api/faxTransferReport/index.js b/server/api/faxTransferReport/index.js index 492d6b8..60d5eab 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 _0xb08f=['post','create','put','update','delete','exports','multer','util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxTransferReport.controller','get','index','isAuthenticated','/:id','show'];(function(_0x49beea,_0x47add1){var _0x27693a=function(_0x192ed8){while(--_0x192ed8){_0x49beea['push'](_0x49beea['shift']());}};_0x27693a(++_0x47add1);}(_0xb08f,0x136));var _0xfb08=function(_0x198432,_0xcf40aa){_0x198432=_0x198432-0x0;var _0xc383ec=_0xb08f[_0x198432];return _0xc383ec;};'use strict';var multer=require(_0xfb08('0x0'));var util=require(_0xfb08('0x1'));var path=require('path');var timeout=require(_0xfb08('0x2'));var express=require(_0xfb08('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xfb08('0x4'));var interaction=require(_0xfb08('0x5'));var config=require(_0xfb08('0x6'));var controller=require(_0xfb08('0x7'));router[_0xfb08('0x8')]('/',auth['isAuthenticated'](),controller[_0xfb08('0x9')]);router[_0xfb08('0x8')]('/describe',auth[_0xfb08('0xa')](),controller['describe']);router[_0xfb08('0x8')](_0xfb08('0xb'),auth[_0xfb08('0xa')](),controller[_0xfb08('0xc')]);router[_0xfb08('0xd')]('/',auth[_0xfb08('0xa')](),controller[_0xfb08('0xe')]);router[_0xfb08('0xf')](_0xfb08('0xb'),auth[_0xfb08('0xa')](),controller[_0xfb08('0x10')]);router[_0xfb08('0x11')](_0xfb08('0xb'),auth[_0xfb08('0xa')](),controller['destroy']);module[_0xfb08('0x12')]=router; \ No newline at end of file +var _0xf876=['destroy','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./faxTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','delete'];(function(_0x2516a9,_0x363e3e){var _0x177fad=function(_0x52adf6){while(--_0x52adf6){_0x2516a9['push'](_0x2516a9['shift']());}};_0x177fad(++_0x363e3e);}(_0xf876,0x178));var _0x6f87=function(_0x460150,_0x232949){_0x460150=_0x460150-0x0;var _0x340677=_0xf876[_0x460150];return _0x340677;};'use strict';var multer=require('multer');var util=require(_0x6f87('0x0'));var path=require(_0x6f87('0x1'));var timeout=require(_0x6f87('0x2'));var express=require(_0x6f87('0x3'));var router=express['Router']();var fs_extra=require(_0x6f87('0x4'));var auth=require(_0x6f87('0x5'));var interaction=require(_0x6f87('0x6'));var config=require('../../config/environment');var controller=require(_0x6f87('0x7'));router[_0x6f87('0x8')]('/',auth[_0x6f87('0x9')](),controller[_0x6f87('0xa')]);router[_0x6f87('0x8')](_0x6f87('0xb'),auth[_0x6f87('0x9')](),controller[_0x6f87('0xc')]);router[_0x6f87('0x8')](_0x6f87('0xd'),auth[_0x6f87('0x9')](),controller[_0x6f87('0xe')]);router[_0x6f87('0xf')]('/',auth['isAuthenticated'](),controller[_0x6f87('0x10')]);router[_0x6f87('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x6f87('0x12')]);router[_0x6f87('0x13')](_0x6f87('0xd'),auth['isAuthenticated'](),controller[_0x6f87('0x14')]);module[_0x6f87('0x15')]=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/index.js b/server/api/intDeskAccount/index.js index c3635e5..8a4a6bb 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 _0x3525=['../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskAccount.controller','get','isAuthenticated','index','show','getConfigurations','/:id/fields','getFields','create','post','/:id/configurations','addConfiguration','put','/:id','update','delete','destroy','multer','path','connect-timeout'];(function(_0x26142d,_0x2f74bb){var _0x16d0fb=function(_0x28f9d1){while(--_0x28f9d1){_0x26142d['push'](_0x26142d['shift']());}};_0x16d0fb(++_0x2f74bb);}(_0x3525,0x1c9));var _0x5352=function(_0x1a32fe,_0xdab6ac){_0x1a32fe=_0x1a32fe-0x0;var _0x1abca6=_0x3525[_0x1a32fe];return _0x1abca6;};'use strict';var multer=require(_0x5352('0x0'));var util=require('util');var path=require(_0x5352('0x1'));var timeout=require(_0x5352('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x5352('0x3'));var interaction=require(_0x5352('0x4'));var config=require(_0x5352('0x5'));var controller=require(_0x5352('0x6'));router[_0x5352('0x7')]('/',auth[_0x5352('0x8')](),controller[_0x5352('0x9')]);router[_0x5352('0x7')]('/:id',auth[_0x5352('0x8')](),controller[_0x5352('0xa')]);router[_0x5352('0x7')]('/:id/configurations',auth[_0x5352('0x8')](),controller[_0x5352('0xb')]);router['get'](_0x5352('0xc'),auth[_0x5352('0x8')](),controller[_0x5352('0xd')]);router['post']('/',auth[_0x5352('0x8')](),controller[_0x5352('0xe')]);router[_0x5352('0xf')](_0x5352('0x10'),auth[_0x5352('0x8')](),controller[_0x5352('0x11')]);router[_0x5352('0x12')](_0x5352('0x13'),auth[_0x5352('0x8')](),controller[_0x5352('0x14')]);router[_0x5352('0x15')](_0x5352('0x13'),auth[_0x5352('0x8')](),controller[_0x5352('0x16')]);module['exports']=router; \ No newline at end of file +var _0x49f4=['path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','isAuthenticated','index','get','show','getConfigurations','/:id/fields','getFields','create','post','put','/:id','destroy','exports','multer','util'];(function(_0x30eab4,_0x165886){var _0x4c2fc0=function(_0x21a8d7){while(--_0x21a8d7){_0x30eab4['push'](_0x30eab4['shift']());}};_0x4c2fc0(++_0x165886);}(_0x49f4,0x18d));var _0x449f=function(_0x196e1b,_0x55fa06){_0x196e1b=_0x196e1b-0x0;var _0x5e1f18=_0x49f4[_0x196e1b];return _0x5e1f18;};'use strict';var multer=require(_0x449f('0x0'));var util=require(_0x449f('0x1'));var path=require(_0x449f('0x2'));var timeout=require(_0x449f('0x3'));var express=require(_0x449f('0x4'));var router=express[_0x449f('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x449f('0x6'));var interaction=require(_0x449f('0x7'));var config=require('../../config/environment');var controller=require('./intDeskAccount.controller');router['get']('/',auth[_0x449f('0x8')](),controller[_0x449f('0x9')]);router[_0x449f('0xa')]('/:id',auth[_0x449f('0x8')](),controller[_0x449f('0xb')]);router[_0x449f('0xa')]('/:id/configurations',auth[_0x449f('0x8')](),controller[_0x449f('0xc')]);router[_0x449f('0xa')](_0x449f('0xd'),auth[_0x449f('0x8')](),controller[_0x449f('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0x449f('0xf')]);router[_0x449f('0x10')]('/:id/configurations',auth[_0x449f('0x8')](),controller['addConfiguration']);router[_0x449f('0x11')](_0x449f('0x12'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x449f('0x12'),auth[_0x449f('0x8')](),controller[_0x449f('0x13')]);module[_0x449f('0x14')]=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.attributes.js b/server/api/intDeskAccount/intDeskAccount.attributes.js index d10f866..a0b08ed 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 _0x5397=['STRING','ENUM','basic','sequelize'];(function(_0x4f82ff,_0x410b69){var _0x15ad7c=function(_0x32c1c){while(--_0x32c1c){_0x4f82ff['push'](_0x4f82ff['shift']());}};_0x15ad7c(++_0x410b69);}(_0x5397,0x6b));var _0x7539=function(_0x234848,_0x5e2944){_0x234848=_0x234848-0x0;var _0x360b93=_0x5397[_0x234848];return _0x360b93;};'use strict';var Sequelize=require(_0x7539('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x7539('0x1')]},'remoteUri':{'type':Sequelize[_0x7539('0x1')]},'authType':{'type':Sequelize[_0x7539('0x2')]('basic'),'defaultValue':_0x7539('0x3')},'password':{'type':Sequelize[_0x7539('0x1')]},'consumerKey':{'type':Sequelize[_0x7539('0x1')]},'consumerSecret':{'type':Sequelize[_0x7539('0x1')]},'token':{'type':Sequelize[_0x7539('0x1')]},'tokenSecret':{'type':Sequelize[_0x7539('0x1')]},'serverUrl':{'type':Sequelize[_0x7539('0x1')],'allowNull':![]},'type':{'type':Sequelize['ENUM']('integrationTab','newTab'),'defaultValue':'integrationTab'}}; \ No newline at end of file +var _0xdade=['newTab','exports','STRING','basic','ENUM','integrationTab'];(function(_0x119ed1,_0x30f869){var _0x411bbb=function(_0x2f07e4){while(--_0x2f07e4){_0x119ed1['push'](_0x119ed1['shift']());}};_0x411bbb(++_0x30f869);}(_0xdade,0x16f));var _0xedad=function(_0x52c1f6,_0x4eda0b){_0x52c1f6=_0x52c1f6-0x0;var _0x4df981=_0xdade[_0x52c1f6];return _0x4df981;};'use strict';var Sequelize=require('sequelize');module[_0xedad('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xedad('0x1')]},'username':{'type':Sequelize[_0xedad('0x1')]},'remoteUri':{'type':Sequelize[_0xedad('0x1')]},'authType':{'type':Sequelize['ENUM']('basic'),'defaultValue':_0xedad('0x2')},'password':{'type':Sequelize[_0xedad('0x1')]},'consumerKey':{'type':Sequelize['STRING']},'consumerSecret':{'type':Sequelize['STRING']},'token':{'type':Sequelize['STRING']},'tokenSecret':{'type':Sequelize[_0xedad('0x1')]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xedad('0x3')](_0xedad('0x4'),_0xedad('0x5')),'defaultValue':'integrationTab'}}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.controller.js b/server/api/intDeskAccount/intDeskAccount.controller.js index 313c3ed..00e06b3 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 _0x5ff1=['label','test','getFields,\x20%s,\x20%s,\x20%s','getFields','statusCode','zip-dir','moment','bluebird','mustache','util','path','to-csv','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','send','map','DeskAccount','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','nolimit','order','sort','where','pick','filter','options','includeAll','include','findAll','catch','show','params','rawAttributes','merge','find','create','body','findOne','DeskConfiguration','getConfigurations','length','addConfiguration','AccountId','Subjects','getSubjects','Descriptions','getDescriptions','DeskField','priority','username','password','consumerKey','token','tokenSecret','remoteUri','slice','substring','format','%s/custom_fields','application/json','authType','basic','headers','Authorization','toString','base64','concat','active'];(function(_0x520801,_0x121afa){var _0x55fce6=function(_0x9a709){while(--_0x9a709){_0x520801['push'](_0x520801['shift']());}};_0x55fce6(++_0x121afa);}(_0x5ff1,0x1b1));var _0x15ff=function(_0x11a55c,_0x4eced9){_0x11a55c=_0x11a55c-0x0;var _0x26c390=_0x5ff1[_0x11a55c];return _0x26c390;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x15ff('0x0'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x15ff('0x1'));var BPromise=require(_0x15ff('0x2'));var Mustache=require(_0x15ff('0x3'));var util=require(_0x15ff('0x4'));var path=require(_0x15ff('0x5'));var sox=require('sox');var csv=require(_0x15ff('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x15ff('0x7'));var crypto=require(_0x15ff('0x8'));var jsforce=require(_0x15ff('0x9'));var deskjs=require(_0x15ff('0xa'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x15ff('0xb'));var Redis=require(_0x15ff('0xc'));var authService=require(_0x15ff('0xd'));var qs=require(_0x15ff('0xe'));var as=require(_0x15ff('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x15ff('0x10'))(_0x15ff('0x11'));var utils=require(_0x15ff('0x12'));var config=require(_0x15ff('0x13'));var licenseUtil=require(_0x15ff('0x14'));var db=require(_0x15ff('0x15'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x3ff1dd,_0x274e99){_0x274e99=_0x274e99||0xcc;return function(_0x3f7bc5){if(_0x3f7bc5){return _0x3ff1dd[_0x15ff('0x16')](_0x274e99);}return _0x3ff1dd['status'](_0x274e99)[_0x15ff('0x17')]();};}function respondWithResult(_0x5d8644,_0x23beb3){_0x23beb3=_0x23beb3||0xc8;return function(_0x4bbe77){if(_0x4bbe77){return _0x5d8644[_0x15ff('0x18')](_0x23beb3)['json'](_0x4bbe77);}};}function respondWithFilteredResult(_0x29fe64,_0x3f273c){return function(_0x3d6a31){if(_0x3d6a31){var _0x3fac48=typeof _0x3f273c[_0x15ff('0x19')]===_0x15ff('0x1a')&&typeof _0x3f273c[_0x15ff('0x1b')]==='undefined';var _0xc25efc=_0x3d6a31[_0x15ff('0x1c')];var _0x4adb81=_0x3fac48?0x0:_0x3f273c[_0x15ff('0x19')];var _0x5a6f2a=_0x3fac48?_0x3d6a31['count']:_0x3f273c[_0x15ff('0x19')]+_0x3f273c[_0x15ff('0x1b')];var _0x22f8f2;if(_0x5a6f2a>=_0xc25efc){_0x5a6f2a=_0xc25efc;_0x22f8f2=0xc8;}else{_0x22f8f2=0xce;}_0x29fe64[_0x15ff('0x18')](_0x22f8f2);return _0x29fe64['set'](_0x15ff('0x1d'),_0x4adb81+'-'+_0x5a6f2a+'/'+_0xc25efc)[_0x15ff('0x1e')](_0x3d6a31);}return null;};}function patchUpdates(_0x45e379){return function(_0x32ea8f){try{jsonpatch[_0x15ff('0x1f')](_0x32ea8f,_0x45e379,!![]);}catch(_0x1f1170){return BPromise[_0x15ff('0x20')](_0x1f1170);}return _0x32ea8f[_0x15ff('0x21')]();};}function saveUpdates(_0x3e8e81,_0x4f75d5){return function(_0x1d5698){if(_0x1d5698){return _0x1d5698[_0x15ff('0x22')](_0x3e8e81)[_0x15ff('0x23')](function(_0x507ef9){return _0x507ef9;});}return null;};}function removeEntity(_0x5c32ae,_0x4c864a){return function(_0x13f30d){if(_0x13f30d){return _0x13f30d[_0x15ff('0x24')]()[_0x15ff('0x23')](function(){_0x5c32ae['status'](0xcc)[_0x15ff('0x17')]();});}};}function handleEntityNotFound(_0x32ffb6,_0x1e52fd){return function(_0x1f478c){if(!_0x1f478c){_0x32ffb6[_0x15ff('0x16')](0x194);}return _0x1f478c;};}function handleError(_0x3225b3,_0x1f6121){_0x1f6121=_0x1f6121||0x1f4;return function(_0x29e9be){logger[_0x15ff('0x25')](_0x29e9be[_0x15ff('0x26')]);if(_0x29e9be[_0x15ff('0x27')]){delete _0x29e9be[_0x15ff('0x27')];}_0x3225b3[_0x15ff('0x18')](_0x1f6121)[_0x15ff('0x28')](_0x29e9be);};}exports['index']=function(_0x48363f,_0x37980f){var _0x3a53ec={},_0x543270={},_0x506658={'count':0x0,'rows':[]};var _0x2b9aa2=_[_0x15ff('0x29')](db[_0x15ff('0x2a')]['rawAttributes'],function(_0x3ba9fb){return{'name':_0x3ba9fb[_0x15ff('0x2b')],'type':_0x3ba9fb[_0x15ff('0x2c')][_0x15ff('0x2d')]};});_0x543270[_0x15ff('0x2e')]=_[_0x15ff('0x29')](_0x2b9aa2,_0x15ff('0x27'));_0x543270[_0x15ff('0x2f')]=_[_0x15ff('0x30')](_0x48363f[_0x15ff('0x2f')]);_0x543270[_0x15ff('0x31')]=_[_0x15ff('0x32')](_0x543270['model'],_0x543270['query']);_0x3a53ec[_0x15ff('0x33')]=_['intersection'](_0x543270[_0x15ff('0x2e')],qs['fields'](_0x48363f[_0x15ff('0x2f')][_0x15ff('0x34')]));_0x3a53ec[_0x15ff('0x33')]=_0x3a53ec[_0x15ff('0x33')]['length']?_0x3a53ec['attributes']:_0x543270[_0x15ff('0x2e')];if(!_0x48363f['query']['hasOwnProperty'](_0x15ff('0x35'))){_0x3a53ec[_0x15ff('0x1b')]=qs[_0x15ff('0x1b')](_0x48363f[_0x15ff('0x2f')][_0x15ff('0x1b')]);_0x3a53ec[_0x15ff('0x19')]=qs[_0x15ff('0x19')](_0x48363f['query'][_0x15ff('0x19')]);}_0x3a53ec[_0x15ff('0x36')]=qs['sort'](_0x48363f[_0x15ff('0x2f')][_0x15ff('0x37')]);_0x3a53ec[_0x15ff('0x38')]=qs[_0x15ff('0x31')](_[_0x15ff('0x39')](_0x48363f['query'],_0x543270[_0x15ff('0x31')]),_0x2b9aa2);if(_0x48363f['query'][_0x15ff('0x3a')]){_0x3a53ec[_0x15ff('0x38')]=_['merge'](_0x3a53ec[_0x15ff('0x38')],{'$or':_[_0x15ff('0x29')](_0x2b9aa2,function(_0x509849){if(_0x509849[_0x15ff('0x2c')]!=='VIRTUAL'){var _0x2a6eeb={};_0x2a6eeb[_0x509849[_0x15ff('0x27')]]={'$like':'%'+_0x48363f[_0x15ff('0x2f')][_0x15ff('0x3a')]+'%'};return _0x2a6eeb;}})});}_0x3a53ec=_['merge']({},_0x3a53ec,_0x48363f[_0x15ff('0x3b')]);var _0x2dc745={'where':_0x3a53ec[_0x15ff('0x38')]};return db[_0x15ff('0x2a')][_0x15ff('0x1c')](_0x2dc745)[_0x15ff('0x23')](function(_0x3445ba){_0x506658['count']=_0x3445ba;if(_0x48363f[_0x15ff('0x2f')][_0x15ff('0x3c')]){_0x3a53ec[_0x15ff('0x3d')]=[{'all':!![]}];}return db[_0x15ff('0x2a')][_0x15ff('0x3e')](_0x3a53ec);})[_0x15ff('0x23')](function(_0x3dd402){_0x506658['rows']=_0x3dd402;return _0x506658;})[_0x15ff('0x23')](respondWithFilteredResult(_0x37980f,_0x3a53ec))[_0x15ff('0x3f')](handleError(_0x37980f,null));};exports[_0x15ff('0x40')]=function(_0x22cfc5,_0x250b46){var _0x4cf1d2={'raw':![],'where':{'id':_0x22cfc5[_0x15ff('0x41')]['id']}},_0x520c0d={};_0x520c0d[_0x15ff('0x2e')]=_['keys'](db['DeskAccount'][_0x15ff('0x42')]);_0x520c0d['query']=_[_0x15ff('0x30')](_0x22cfc5[_0x15ff('0x2f')]);_0x520c0d[_0x15ff('0x31')]=_['intersection'](_0x520c0d['model'],_0x520c0d[_0x15ff('0x2f')]);_0x4cf1d2[_0x15ff('0x33')]=_[_0x15ff('0x32')](_0x520c0d[_0x15ff('0x2e')],qs[_0x15ff('0x34')](_0x22cfc5[_0x15ff('0x2f')]['fields']));_0x4cf1d2['attributes']=_0x4cf1d2[_0x15ff('0x33')]['length']?_0x4cf1d2[_0x15ff('0x33')]:_0x520c0d[_0x15ff('0x2e')];if(_0x22cfc5[_0x15ff('0x2f')][_0x15ff('0x3c')]){_0x4cf1d2[_0x15ff('0x3d')]=[{'all':!![]}];}_0x4cf1d2=_[_0x15ff('0x43')]({},_0x4cf1d2,_0x22cfc5[_0x15ff('0x3b')]);return db['DeskAccount'][_0x15ff('0x44')](_0x4cf1d2)[_0x15ff('0x23')](handleEntityNotFound(_0x250b46,null))[_0x15ff('0x23')](respondWithResult(_0x250b46,null))['catch'](handleError(_0x250b46,null));};exports[_0x15ff('0x45')]=function(_0x40df70,_0x436fa3){return db['DeskAccount'][_0x15ff('0x45')](_0x40df70[_0x15ff('0x46')],{})[_0x15ff('0x23')](respondWithResult(_0x436fa3,0xc9))[_0x15ff('0x3f')](handleError(_0x436fa3,null));};exports[_0x15ff('0x22')]=function(_0x3c4d67,_0x128d4d){if(_0x3c4d67[_0x15ff('0x46')]['id']){delete _0x3c4d67[_0x15ff('0x46')]['id'];}return db[_0x15ff('0x2a')][_0x15ff('0x44')]({'where':{'id':_0x3c4d67[_0x15ff('0x41')]['id']}})[_0x15ff('0x23')](handleEntityNotFound(_0x128d4d,null))['then'](saveUpdates(_0x3c4d67[_0x15ff('0x46')],null))[_0x15ff('0x23')](respondWithResult(_0x128d4d,null))[_0x15ff('0x3f')](handleError(_0x128d4d,null));};exports[_0x15ff('0x24')]=function(_0x58d7d0,_0x467a8f){return db[_0x15ff('0x2a')][_0x15ff('0x44')]({'where':{'id':_0x58d7d0['params']['id']}})[_0x15ff('0x23')](handleEntityNotFound(_0x467a8f,null))[_0x15ff('0x23')](removeEntity(_0x467a8f,null))[_0x15ff('0x3f')](handleError(_0x467a8f,null));};exports['getConfigurations']=function(_0xfbde2a,_0x3bbaf3,_0x21dd46){var _0x4062c2={};var _0x2e478a={};var _0xad62b8;var _0x149be9;return db[_0x15ff('0x2a')][_0x15ff('0x47')]({'where':{'id':_0xfbde2a[_0x15ff('0x41')]['id']}})['then'](handleEntityNotFound(_0x3bbaf3,null))[_0x15ff('0x23')](function(_0x20c320){if(_0x20c320){_0xad62b8=_0x20c320;_0x2e478a[_0x15ff('0x2e')]=_[_0x15ff('0x30')](db[_0x15ff('0x48')][_0x15ff('0x42')]);_0x2e478a[_0x15ff('0x2f')]=_[_0x15ff('0x30')](_0xfbde2a[_0x15ff('0x2f')]);_0x2e478a[_0x15ff('0x31')]=_['intersection'](_0x2e478a[_0x15ff('0x2e')],_0x2e478a[_0x15ff('0x2f')]);_0x4062c2[_0x15ff('0x33')]=_[_0x15ff('0x32')](_0x2e478a['model'],qs[_0x15ff('0x34')](_0xfbde2a['query'][_0x15ff('0x34')]));_0x4062c2['attributes']=_0x4062c2[_0x15ff('0x33')]['length']?_0x4062c2[_0x15ff('0x33')]:_0x2e478a[_0x15ff('0x2e')];_0x4062c2[_0x15ff('0x36')]=qs[_0x15ff('0x37')](_0xfbde2a[_0x15ff('0x2f')]['sort']);_0x4062c2[_0x15ff('0x38')]=qs[_0x15ff('0x31')](_[_0x15ff('0x39')](_0xfbde2a[_0x15ff('0x2f')],_0x2e478a['filters']));if(_0xfbde2a[_0x15ff('0x2f')][_0x15ff('0x3a')]){_0x4062c2['where']=_[_0x15ff('0x43')](_0x4062c2[_0x15ff('0x38')],{'$or':_[_0x15ff('0x29')](_0x4062c2[_0x15ff('0x33')],function(_0x170669){var _0xc1bb08={};_0xc1bb08[_0x170669]={'$like':'%'+_0xfbde2a[_0x15ff('0x2f')]['filter']+'%'};return _0xc1bb08;})});}_0x4062c2=_[_0x15ff('0x43')]({},_0x4062c2,_0xfbde2a['options']);return _0xad62b8[_0x15ff('0x49')](_0x4062c2);}})[_0x15ff('0x23')](function(_0x8c6ca6){if(_0x8c6ca6){_0x149be9=_0x8c6ca6[_0x15ff('0x4a')];if(!_0xfbde2a['query']['hasOwnProperty'](_0x15ff('0x35'))){_0x4062c2[_0x15ff('0x1b')]=qs[_0x15ff('0x1b')](_0xfbde2a[_0x15ff('0x2f')][_0x15ff('0x1b')]);_0x4062c2[_0x15ff('0x19')]=qs[_0x15ff('0x19')](_0xfbde2a['query'][_0x15ff('0x19')]);}return _0xad62b8[_0x15ff('0x49')](_0x4062c2);}})['then'](function(_0x22ed87){if(_0x22ed87){return _0x22ed87?{'count':_0x149be9,'rows':_0x22ed87}:null;}})[_0x15ff('0x23')](respondWithResult(_0x3bbaf3,null))[_0x15ff('0x3f')](handleError(_0x3bbaf3,null));};exports[_0x15ff('0x4b')]=function(_0x21a4b3,_0x4e7ec5,_0x438929){if(_0x21a4b3[_0x15ff('0x46')]['id']){delete _0x21a4b3[_0x15ff('0x46')]['id'];}return db[_0x15ff('0x2a')]['findOne']({'where':{'id':_0x21a4b3[_0x15ff('0x41')]['id']}})['then'](handleEntityNotFound(_0x4e7ec5,null))[_0x15ff('0x23')](function(_0x53c148){if(_0x53c148){_0x21a4b3[_0x15ff('0x46')][_0x15ff('0x4c')]=_0x53c148['id'];_0x21a4b3[_0x15ff('0x46')][_0x15ff('0x4d')]=integrations[_0x15ff('0x4e')](_0x21a4b3[_0x15ff('0x46')]['channel'],_0x21a4b3[_0x15ff('0x46')]['type']);_0x21a4b3['body'][_0x15ff('0x4f')]=integrations[_0x15ff('0x50')](_0x21a4b3[_0x15ff('0x46')]['channel'],_0x21a4b3['body'][_0x15ff('0x2c')]);return db[_0x15ff('0x48')][_0x15ff('0x45')](_0x21a4b3['body'],{'include':[{'model':db[_0x15ff('0x51')],'as':'Subjects'},{'model':db['DeskField'],'as':_0x15ff('0x4f')}]});}return null;})[_0x15ff('0x23')](respondWithResult(_0x4e7ec5,null))[_0x15ff('0x3f')](handleError(_0x4e7ec5,null));};exports['getFields']=function(_0x2d3d7d,_0x3f848a,_0x1247bd){var _0x412cc3=[{'name':'priority','label':_0x15ff('0x52'),'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 _0x37da87='';return db[_0x15ff('0x2a')][_0x15ff('0x47')]({'where':{'id':_0x2d3d7d[_0x15ff('0x41')]['id']},'attributes':['id','remoteUri','authType',_0x15ff('0x53'),_0x15ff('0x54'),_0x15ff('0x55'),'consumerSecret',_0x15ff('0x56'),_0x15ff('0x57')]})['then'](handleEntityNotFound(_0x3f848a,null))[_0x15ff('0x23')](function(_0x240ce2){if(_0x240ce2){_0x37da87=_0x240ce2[_0x15ff('0x58')];var _0x170b22=_0x37da87[_0x15ff('0x59')](-0x1);if(_0x170b22==='/'){_0x37da87=_0x37da87[_0x15ff('0x5a')](0x0,_0x37da87['lastIndexOf'](_0x170b22));}var _0x5be641={'method':'GET','uri':util[_0x15ff('0x5b')](_0x15ff('0x5c'),_0x37da87),'headers':{'Content-Type':_0x15ff('0x5d'),'Accept':'application/json'},'json':!![]};if(_0x240ce2[_0x15ff('0x5e')]===_0x15ff('0x5f')){_0x5be641[_0x15ff('0x60')][_0x15ff('0x61')]=util['format']('Basic\x20%s',new Buffer(util[_0x15ff('0x5b')]('%s:%s',_0x240ce2[_0x15ff('0x53')],_0x240ce2['password']))[_0x15ff('0x62')](_0x15ff('0x63')));}return rp(_0x5be641)['then'](function(_0x29e411){return _0x412cc3[_0x15ff('0x64')](_[_0x15ff('0x29')](_0x29e411['_embedded']['entries'],function(_0x1dd129){return{'id':_0x1dd129[_0x15ff('0x27')],'name':_0x1dd129[_0x15ff('0x27')],'type':_0x1dd129['type'],'active':_0x1dd129[_0x15ff('0x65')],'label':_0x1dd129[_0x15ff('0x66')],'custom':!![]};}));});}})['then'](function(_0xd19f1){return{'count':_0xd19f1[_0x15ff('0x4a')],'rows':_0xd19f1};})[_0x15ff('0x23')](respondWithResult(_0x3f848a,null))[_0x15ff('0x3f')](function(_0x24bef6){var _0x499646=_0x2d3d7d[_0x15ff('0x2f')][_0x15ff('0x67')]?0x1f4:_0x24bef6['statusCode']||0x1f4;logger[_0x15ff('0x25')](_0x15ff('0x68'),_0x15ff('0x69'),_0x499646,JSON['stringify'](_0x24bef6));delete _0x24bef6[_0x15ff('0x27')];if(_0x499646===0x191){_0x499646=0x190;}_0x3f848a['status'](_0x499646)[_0x15ff('0x28')](_0x2d3d7d[_0x15ff('0x2f')][_0x15ff('0x67')]?{'message':'Wrong\x20credentials','statusCode':_0x24bef6[_0x15ff('0x6a')]}:_0x24bef6);});}; \ No newline at end of file +var _0x8ddc=['getFields','priority','authType','username','password','consumerSecret','token','tokenSecret','remoteUri','slice','substring','lastIndexOf','GET','format','%s/custom_fields','application/json','basic','headers','Authorization','Basic\x20%s','toString','concat','_embedded','entries','statusCode','stringify','test','Wrong\x20credentials','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','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/environment','../../mysqldb','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','index','map','DeskAccount','fieldName','type','key','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','catch','show','rawAttributes','find','create','body','params','getConfigurations','DeskConfiguration','order','addConfiguration','findOne','AccountId','getSubjects','channel','Descriptions','DeskField'];(function(_0x444435,_0x529006){var _0x583ad3=function(_0x95ef86){while(--_0x95ef86){_0x444435['push'](_0x444435['shift']());}};_0x583ad3(++_0x529006);}(_0x8ddc,0x16f));var _0xc8dd=function(_0x1bbc08,_0x444008){_0x1bbc08=_0x1bbc08-0x0;var _0x5d825b=_0x8ddc[_0x1bbc08];return _0x5d825b;};'use strict';var emlformat=require(_0xc8dd('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc8dd('0x1'));var jsonpatch=require(_0xc8dd('0x2'));var rp=require(_0xc8dd('0x3'));var moment=require(_0xc8dd('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xc8dd('0x5'));var util=require(_0xc8dd('0x6'));var path=require('path');var sox=require(_0xc8dd('0x7'));var csv=require(_0xc8dd('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc8dd('0x9'));var _=require(_0xc8dd('0xa'));var squel=require(_0xc8dd('0xb'));var crypto=require('crypto');var jsforce=require(_0xc8dd('0xc'));var deskjs=require(_0xc8dd('0xd'));var toCsv=require('to-csv');var querystring=require(_0xc8dd('0xe'));var Papa=require(_0xc8dd('0xf'));var Redis=require(_0xc8dd('0x10'));var authService=require(_0xc8dd('0x11'));var qs=require(_0xc8dd('0x12'));var as=require(_0xc8dd('0x13'));var hardwareService=require(_0xc8dd('0x14'));var logger=require(_0xc8dd('0x15'))(_0xc8dd('0x16'));var utils=require('../../config/utils');var config=require(_0xc8dd('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xc8dd('0x18'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x43fc39,_0x3b1607){_0x3b1607=_0x3b1607||0xcc;return function(_0x4b8708){if(_0x4b8708){return _0x43fc39['sendStatus'](_0x3b1607);}return _0x43fc39[_0xc8dd('0x19')](_0x3b1607)[_0xc8dd('0x1a')]();};}function respondWithResult(_0x2e745a,_0x1b9b23){_0x1b9b23=_0x1b9b23||0xc8;return function(_0x4e1cbc){if(_0x4e1cbc){return _0x2e745a['status'](_0x1b9b23)[_0xc8dd('0x1b')](_0x4e1cbc);}};}function respondWithFilteredResult(_0x449fe8,_0xc325e9){return function(_0x39b8d3){if(_0x39b8d3){var _0x311ee6=typeof _0xc325e9[_0xc8dd('0x1c')]==='undefined'&&typeof _0xc325e9[_0xc8dd('0x1d')]===_0xc8dd('0x1e');var _0x16a3b2=_0x39b8d3['count'];var _0x3bffd8=_0x311ee6?0x0:_0xc325e9['offset'];var _0x5474d8=_0x311ee6?_0x39b8d3[_0xc8dd('0x1f')]:_0xc325e9[_0xc8dd('0x1c')]+_0xc325e9[_0xc8dd('0x1d')];var _0x1c12fc;if(_0x5474d8>=_0x16a3b2){_0x5474d8=_0x16a3b2;_0x1c12fc=0xc8;}else{_0x1c12fc=0xce;}_0x449fe8[_0xc8dd('0x19')](_0x1c12fc);return _0x449fe8[_0xc8dd('0x20')](_0xc8dd('0x21'),_0x3bffd8+'-'+_0x5474d8+'/'+_0x16a3b2)['json'](_0x39b8d3);}return null;};}function patchUpdates(_0x4a4dc3){return function(_0x5c3188){try{jsonpatch[_0xc8dd('0x22')](_0x5c3188,_0x4a4dc3,!![]);}catch(_0x4ea38d){return BPromise[_0xc8dd('0x23')](_0x4ea38d);}return _0x5c3188[_0xc8dd('0x24')]();};}function saveUpdates(_0x30b9c1,_0x3f5930){return function(_0x3f7b44){if(_0x3f7b44){return _0x3f7b44[_0xc8dd('0x25')](_0x30b9c1)['then'](function(_0x2eebf5){return _0x2eebf5;});}return null;};}function removeEntity(_0x3972af,_0x5817da){return function(_0xb62c4c){if(_0xb62c4c){return _0xb62c4c[_0xc8dd('0x26')]()[_0xc8dd('0x27')](function(){_0x3972af['status'](0xcc)[_0xc8dd('0x1a')]();});}};}function handleEntityNotFound(_0x1d7e6e,_0x4a88f5){return function(_0x406f41){if(!_0x406f41){_0x1d7e6e['sendStatus'](0x194);}return _0x406f41;};}function handleError(_0x303e88,_0x47ecdb){_0x47ecdb=_0x47ecdb||0x1f4;return function(_0x4c8734){logger[_0xc8dd('0x28')](_0x4c8734[_0xc8dd('0x29')]);if(_0x4c8734['name']){delete _0x4c8734[_0xc8dd('0x2a')];}_0x303e88[_0xc8dd('0x19')](_0x47ecdb)[_0xc8dd('0x2b')](_0x4c8734);};}exports[_0xc8dd('0x2c')]=function(_0x452ddb,_0xb8feea){var _0x45581a={},_0x5ece62={},_0x2dec59={'count':0x0,'rows':[]};var _0x451063=_[_0xc8dd('0x2d')](db[_0xc8dd('0x2e')]['rawAttributes'],function(_0x3e2676){return{'name':_0x3e2676[_0xc8dd('0x2f')],'type':_0x3e2676[_0xc8dd('0x30')][_0xc8dd('0x31')]};});_0x5ece62['model']=_[_0xc8dd('0x2d')](_0x451063,_0xc8dd('0x2a'));_0x5ece62[_0xc8dd('0x32')]=_[_0xc8dd('0x33')](_0x452ddb['query']);_0x5ece62[_0xc8dd('0x34')]=_['intersection'](_0x5ece62[_0xc8dd('0x35')],_0x5ece62[_0xc8dd('0x32')]);_0x45581a[_0xc8dd('0x36')]=_[_0xc8dd('0x37')](_0x5ece62[_0xc8dd('0x35')],qs['fields'](_0x452ddb[_0xc8dd('0x32')][_0xc8dd('0x38')]));_0x45581a[_0xc8dd('0x36')]=_0x45581a[_0xc8dd('0x36')][_0xc8dd('0x39')]?_0x45581a['attributes']:_0x5ece62[_0xc8dd('0x35')];if(!_0x452ddb[_0xc8dd('0x32')][_0xc8dd('0x3a')](_0xc8dd('0x3b'))){_0x45581a['limit']=qs['limit'](_0x452ddb[_0xc8dd('0x32')][_0xc8dd('0x1d')]);_0x45581a[_0xc8dd('0x1c')]=qs[_0xc8dd('0x1c')](_0x452ddb[_0xc8dd('0x32')][_0xc8dd('0x1c')]);}_0x45581a['order']=qs[_0xc8dd('0x3c')](_0x452ddb[_0xc8dd('0x32')]['sort']);_0x45581a[_0xc8dd('0x3d')]=qs[_0xc8dd('0x34')](_[_0xc8dd('0x3e')](_0x452ddb[_0xc8dd('0x32')],_0x5ece62['filters']),_0x451063);if(_0x452ddb['query'][_0xc8dd('0x3f')]){_0x45581a[_0xc8dd('0x3d')]=_['merge'](_0x45581a['where'],{'$or':_[_0xc8dd('0x2d')](_0x451063,function(_0x364944){if(_0x364944[_0xc8dd('0x30')]!==_0xc8dd('0x40')){var _0x274b31={};_0x274b31[_0x364944[_0xc8dd('0x2a')]]={'$like':'%'+_0x452ddb[_0xc8dd('0x32')][_0xc8dd('0x3f')]+'%'};return _0x274b31;}})});}_0x45581a=_[_0xc8dd('0x41')]({},_0x45581a,_0x452ddb[_0xc8dd('0x42')]);var _0xd07f={'where':_0x45581a[_0xc8dd('0x3d')]};return db[_0xc8dd('0x2e')][_0xc8dd('0x1f')](_0xd07f)['then'](function(_0x458744){_0x2dec59[_0xc8dd('0x1f')]=_0x458744;if(_0x452ddb[_0xc8dd('0x32')][_0xc8dd('0x43')]){_0x45581a['include']=[{'all':!![]}];}return db[_0xc8dd('0x2e')]['findAll'](_0x45581a);})[_0xc8dd('0x27')](function(_0x3e7670){_0x2dec59['rows']=_0x3e7670;return _0x2dec59;})[_0xc8dd('0x27')](respondWithFilteredResult(_0xb8feea,_0x45581a))[_0xc8dd('0x44')](handleError(_0xb8feea,null));};exports[_0xc8dd('0x45')]=function(_0xe7175c,_0x4bcbe9){var _0x5f3128={'raw':![],'where':{'id':_0xe7175c['params']['id']}},_0x540cf6={};_0x540cf6[_0xc8dd('0x35')]=_[_0xc8dd('0x33')](db[_0xc8dd('0x2e')][_0xc8dd('0x46')]);_0x540cf6[_0xc8dd('0x32')]=_[_0xc8dd('0x33')](_0xe7175c['query']);_0x540cf6['filters']=_['intersection'](_0x540cf6[_0xc8dd('0x35')],_0x540cf6[_0xc8dd('0x32')]);_0x5f3128[_0xc8dd('0x36')]=_[_0xc8dd('0x37')](_0x540cf6['model'],qs[_0xc8dd('0x38')](_0xe7175c[_0xc8dd('0x32')][_0xc8dd('0x38')]));_0x5f3128[_0xc8dd('0x36')]=_0x5f3128[_0xc8dd('0x36')][_0xc8dd('0x39')]?_0x5f3128[_0xc8dd('0x36')]:_0x540cf6[_0xc8dd('0x35')];if(_0xe7175c[_0xc8dd('0x32')]['includeAll']){_0x5f3128['include']=[{'all':!![]}];}_0x5f3128=_[_0xc8dd('0x41')]({},_0x5f3128,_0xe7175c[_0xc8dd('0x42')]);return db[_0xc8dd('0x2e')][_0xc8dd('0x47')](_0x5f3128)[_0xc8dd('0x27')](handleEntityNotFound(_0x4bcbe9,null))['then'](respondWithResult(_0x4bcbe9,null))[_0xc8dd('0x44')](handleError(_0x4bcbe9,null));};exports[_0xc8dd('0x48')]=function(_0x404221,_0x59dfc3){return db[_0xc8dd('0x2e')][_0xc8dd('0x48')](_0x404221['body'],{})['then'](respondWithResult(_0x59dfc3,0xc9))[_0xc8dd('0x44')](handleError(_0x59dfc3,null));};exports[_0xc8dd('0x25')]=function(_0x18034f,_0x1b2c4c){if(_0x18034f[_0xc8dd('0x49')]['id']){delete _0x18034f[_0xc8dd('0x49')]['id'];}return db[_0xc8dd('0x2e')][_0xc8dd('0x47')]({'where':{'id':_0x18034f[_0xc8dd('0x4a')]['id']}})[_0xc8dd('0x27')](handleEntityNotFound(_0x1b2c4c,null))[_0xc8dd('0x27')](saveUpdates(_0x18034f[_0xc8dd('0x49')],null))[_0xc8dd('0x27')](respondWithResult(_0x1b2c4c,null))[_0xc8dd('0x44')](handleError(_0x1b2c4c,null));};exports['destroy']=function(_0x529fef,_0x1fe380){return db['DeskAccount'][_0xc8dd('0x47')]({'where':{'id':_0x529fef[_0xc8dd('0x4a')]['id']}})[_0xc8dd('0x27')](handleEntityNotFound(_0x1fe380,null))['then'](removeEntity(_0x1fe380,null))['catch'](handleError(_0x1fe380,null));};exports[_0xc8dd('0x4b')]=function(_0x419798,_0x4b98b4,_0x2c1b67){var _0x3346c4={};var _0x143aaa={};var _0x4d67e5;var _0x48a711;return db[_0xc8dd('0x2e')]['findOne']({'where':{'id':_0x419798[_0xc8dd('0x4a')]['id']}})['then'](handleEntityNotFound(_0x4b98b4,null))[_0xc8dd('0x27')](function(_0x4b252e){if(_0x4b252e){_0x4d67e5=_0x4b252e;_0x143aaa[_0xc8dd('0x35')]=_[_0xc8dd('0x33')](db[_0xc8dd('0x4c')][_0xc8dd('0x46')]);_0x143aaa['query']=_['keys'](_0x419798['query']);_0x143aaa[_0xc8dd('0x34')]=_[_0xc8dd('0x37')](_0x143aaa[_0xc8dd('0x35')],_0x143aaa[_0xc8dd('0x32')]);_0x3346c4[_0xc8dd('0x36')]=_['intersection'](_0x143aaa[_0xc8dd('0x35')],qs[_0xc8dd('0x38')](_0x419798[_0xc8dd('0x32')][_0xc8dd('0x38')]));_0x3346c4[_0xc8dd('0x36')]=_0x3346c4['attributes'][_0xc8dd('0x39')]?_0x3346c4['attributes']:_0x143aaa[_0xc8dd('0x35')];_0x3346c4[_0xc8dd('0x4d')]=qs['sort'](_0x419798['query'][_0xc8dd('0x3c')]);_0x3346c4[_0xc8dd('0x3d')]=qs['filters'](_[_0xc8dd('0x3e')](_0x419798[_0xc8dd('0x32')],_0x143aaa[_0xc8dd('0x34')]));if(_0x419798[_0xc8dd('0x32')][_0xc8dd('0x3f')]){_0x3346c4[_0xc8dd('0x3d')]=_[_0xc8dd('0x41')](_0x3346c4['where'],{'$or':_[_0xc8dd('0x2d')](_0x3346c4[_0xc8dd('0x36')],function(_0x213563){var _0x5efdb2={};_0x5efdb2[_0x213563]={'$like':'%'+_0x419798['query']['filter']+'%'};return _0x5efdb2;})});}_0x3346c4=_[_0xc8dd('0x41')]({},_0x3346c4,_0x419798[_0xc8dd('0x42')]);return _0x4d67e5['getConfigurations'](_0x3346c4);}})[_0xc8dd('0x27')](function(_0x1193e9){if(_0x1193e9){_0x48a711=_0x1193e9['length'];if(!_0x419798[_0xc8dd('0x32')][_0xc8dd('0x3a')](_0xc8dd('0x3b'))){_0x3346c4['limit']=qs['limit'](_0x419798[_0xc8dd('0x32')][_0xc8dd('0x1d')]);_0x3346c4['offset']=qs[_0xc8dd('0x1c')](_0x419798['query']['offset']);}return _0x4d67e5['getConfigurations'](_0x3346c4);}})[_0xc8dd('0x27')](function(_0x547e6b){if(_0x547e6b){return _0x547e6b?{'count':_0x48a711,'rows':_0x547e6b}:null;}})[_0xc8dd('0x27')](respondWithResult(_0x4b98b4,null))['catch'](handleError(_0x4b98b4,null));};exports[_0xc8dd('0x4e')]=function(_0xded8b,_0x1d4a81,_0x5f08d9){if(_0xded8b[_0xc8dd('0x49')]['id']){delete _0xded8b[_0xc8dd('0x49')]['id'];}return db[_0xc8dd('0x2e')][_0xc8dd('0x4f')]({'where':{'id':_0xded8b[_0xc8dd('0x4a')]['id']}})[_0xc8dd('0x27')](handleEntityNotFound(_0x1d4a81,null))[_0xc8dd('0x27')](function(_0xee7cfc){if(_0xee7cfc){_0xded8b['body'][_0xc8dd('0x50')]=_0xee7cfc['id'];_0xded8b['body']['Subjects']=integrations[_0xc8dd('0x51')](_0xded8b['body'][_0xc8dd('0x52')],_0xded8b['body'][_0xc8dd('0x30')]);_0xded8b['body'][_0xc8dd('0x53')]=integrations['getDescriptions'](_0xded8b[_0xc8dd('0x49')][_0xc8dd('0x52')],_0xded8b['body'][_0xc8dd('0x30')]);return db[_0xc8dd('0x4c')]['create'](_0xded8b['body'],{'include':[{'model':db[_0xc8dd('0x54')],'as':'Subjects'},{'model':db[_0xc8dd('0x54')],'as':'Descriptions'}]});}return null;})[_0xc8dd('0x27')](respondWithResult(_0x1d4a81,null))[_0xc8dd('0x44')](handleError(_0x1d4a81,null));};exports[_0xc8dd('0x55')]=function(_0x3df08c,_0x278fda,_0x2178e2){var _0x301267=[{'name':_0xc8dd('0x56'),'label':_0xc8dd('0x56'),'custom':![],'options':[{'name':0x1,'value':0x1},{'name':0x2,'value':0x2},{'name':0x3,'value':0x3},{'name':0x4,'value':0x4},{'name':0x5,'value':0x5},{'name':0x6,'value':0x6},{'name':0x7,'value':0x7},{'name':0x8,'value':0x8},{'name':0x9,'value':0x9},{'name':0xa,'value':0xa}]}];var _0x2260ce='';return db[_0xc8dd('0x2e')][_0xc8dd('0x4f')]({'where':{'id':_0x3df08c[_0xc8dd('0x4a')]['id']},'attributes':['id','remoteUri',_0xc8dd('0x57'),_0xc8dd('0x58'),_0xc8dd('0x59'),'consumerKey',_0xc8dd('0x5a'),_0xc8dd('0x5b'),_0xc8dd('0x5c')]})[_0xc8dd('0x27')](handleEntityNotFound(_0x278fda,null))[_0xc8dd('0x27')](function(_0x3bc169){if(_0x3bc169){_0x2260ce=_0x3bc169[_0xc8dd('0x5d')];var _0x5b335e=_0x2260ce[_0xc8dd('0x5e')](-0x1);if(_0x5b335e==='/'){_0x2260ce=_0x2260ce[_0xc8dd('0x5f')](0x0,_0x2260ce[_0xc8dd('0x60')](_0x5b335e));}var _0x573722={'method':_0xc8dd('0x61'),'uri':util[_0xc8dd('0x62')](_0xc8dd('0x63'),_0x2260ce),'headers':{'Content-Type':_0xc8dd('0x64'),'Accept':'application/json'},'json':!![]};if(_0x3bc169[_0xc8dd('0x57')]===_0xc8dd('0x65')){_0x573722[_0xc8dd('0x66')][_0xc8dd('0x67')]=util[_0xc8dd('0x62')](_0xc8dd('0x68'),new Buffer(util[_0xc8dd('0x62')]('%s:%s',_0x3bc169['username'],_0x3bc169[_0xc8dd('0x59')]))[_0xc8dd('0x69')]('base64'));}return rp(_0x573722)[_0xc8dd('0x27')](function(_0x490a6c){return _0x301267[_0xc8dd('0x6a')](_[_0xc8dd('0x2d')](_0x490a6c[_0xc8dd('0x6b')][_0xc8dd('0x6c')],function(_0x36ce51){return{'id':_0x36ce51[_0xc8dd('0x2a')],'name':_0x36ce51[_0xc8dd('0x2a')],'type':_0x36ce51[_0xc8dd('0x30')],'active':_0x36ce51['active'],'label':_0x36ce51['label'],'custom':!![]};}));});}})['then'](function(_0xaf932c){return{'count':_0xaf932c[_0xc8dd('0x39')],'rows':_0xaf932c};})['then'](respondWithResult(_0x278fda,null))[_0xc8dd('0x44')](function(_0x2d82fc){var _0x42b9e8=_0x3df08c[_0xc8dd('0x32')]['test']?0x1f4:_0x2d82fc[_0xc8dd('0x6d')]||0x1f4;logger[_0xc8dd('0x28')]('getFields,\x20%s,\x20%s,\x20%s','getFields',_0x42b9e8,JSON[_0xc8dd('0x6e')](_0x2d82fc));delete _0x2d82fc[_0xc8dd('0x2a')];if(_0x42b9e8===0x191){_0x42b9e8=0x190;}_0x278fda[_0xc8dd('0x19')](_0x42b9e8)[_0xc8dd('0x2b')](_0x3df08c[_0xc8dd('0x32')][_0xc8dd('0x6f')]?{'message':_0xc8dd('0x70'),'statusCode':_0x2d82fc[_0xc8dd('0x6d')]}:_0x2d82fc);});}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.model.js b/server/api/intDeskAccount/intDeskAccount.model.js index 05ea377..890bcdf 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 _0x5824=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','../../components/integrations/configuration','exports','define','int_desk_accounts','../../config/logger'];(function(_0x5b4be3,_0x3e79b1){var _0x3437ff=function(_0x2200db){while(--_0x2200db){_0x5b4be3['push'](_0x5b4be3['shift']());}};_0x3437ff(++_0x3e79b1);}(_0x5824,0x9b));var _0x4582=function(_0x1195ec,_0x1737ec){_0x1195ec=_0x1195ec-0x0;var _0x47af30=_0x5824[_0x1195ec];return _0x47af30;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x4582('0x0'))(_0x4582('0x1'));var moment=require(_0x4582('0x2'));var BPromise=require(_0x4582('0x3'));var rp=require(_0x4582('0x4'));var fs=require('fs');var path=require(_0x4582('0x5'));var rimraf=require(_0x4582('0x6'));var config=require(_0x4582('0x7'));var attributes=require('./intDeskAccount.attributes');var integrations=require(_0x4582('0x8'));module[_0x4582('0x9')]=function(_0x3ddd4d,_0x2833cc){return _0x3ddd4d[_0x4582('0xa')]('DeskAccount',attributes,{'tableName':_0x4582('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xcfa5=['api','moment','bluebird','request-promise','./intDeskAccount.attributes','../../components/integrations/configuration','exports','DeskAccount','int_desk_accounts','lodash','util','../../config/logger'];(function(_0x441f7a,_0x576321){var _0x4821da=function(_0x5c5b52){while(--_0x5c5b52){_0x441f7a['push'](_0x441f7a['shift']());}};_0x4821da(++_0x576321);}(_0xcfa5,0x1c5));var _0x5cfa=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xcfa5[_0x3ab51d];return _0x29a04e;};'use strict';var _=require(_0x5cfa('0x0'));var util=require(_0x5cfa('0x1'));var logger=require(_0x5cfa('0x2'))(_0x5cfa('0x3'));var moment=require(_0x5cfa('0x4'));var BPromise=require(_0x5cfa('0x5'));var rp=require(_0x5cfa('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x5cfa('0x7'));var integrations=require(_0x5cfa('0x8'));module[_0x5cfa('0x9')]=function(_0x16b914,_0x1bc082){return _0x16b914['define'](_0x5cfa('0xa'),attributes,{'tableName':_0x5cfa('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 59414dd..2e3135f 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 _0x0ba6=['info','DeskAccount,\x20%s,\x20%s','request\x20sent','debug','DeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetDeskAccount','findAll','options','where','attributes','limit','include','map','model','DeskAccount','find','then','ShowDeskAccount','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http'];(function(_0x1f9b8a,_0x1a4006){var _0x58f668=function(_0x5ef92f){while(--_0x5ef92f){_0x1f9b8a['push'](_0x1f9b8a['shift']());}};_0x58f668(++_0x1a4006);}(_0x0ba6,0xc6));var _0x60ba=function(_0x20aadb,_0x5a607a){_0x20aadb=_0x20aadb-0x0;var _0x520018=_0x0ba6[_0x20aadb];return _0x520018;};'use strict';var _=require(_0x60ba('0x0'));var util=require('util');var moment=require(_0x60ba('0x1'));var BPromise=require(_0x60ba('0x2'));var rs=require(_0x60ba('0x3'));var fs=require('fs');var Redis=require(_0x60ba('0x4'));var db=require(_0x60ba('0x5'))['db'];var utils=require(_0x60ba('0x6'));var logger=require(_0x60ba('0x7'))('rpc');var config=require(_0x60ba('0x8'));var jayson=require(_0x60ba('0x9'));var client=jayson[_0x60ba('0xa')][_0x60ba('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1b934b,_0x5973d3,_0x520d2b){return new BPromise(function(_0x44b306,_0x57f5af){return client['request'](_0x1b934b,_0x520d2b)['then'](function(_0x4db4ce){logger[_0x60ba('0xc')](_0x60ba('0xd'),_0x5973d3,_0x60ba('0xe'));logger[_0x60ba('0xf')](_0x60ba('0x10'),_0x5973d3,_0x60ba('0xe'),JSON[_0x60ba('0x11')](_0x4db4ce));if(_0x4db4ce[_0x60ba('0x12')]){if(_0x4db4ce[_0x60ba('0x12')]['code']===0x1f4){logger[_0x60ba('0x12')]('DeskAccount,\x20%s,\x20%s',_0x5973d3,_0x4db4ce[_0x60ba('0x12')][_0x60ba('0x13')]);return _0x57f5af(_0x4db4ce[_0x60ba('0x12')]['message']);}logger[_0x60ba('0x12')](_0x60ba('0xd'),_0x5973d3,_0x4db4ce['error'][_0x60ba('0x13')]);return _0x44b306(_0x4db4ce['error'][_0x60ba('0x13')]);}else{logger['info'](_0x60ba('0xd'),_0x5973d3,_0x60ba('0xe'));_0x44b306(_0x4db4ce[_0x60ba('0x14')][_0x60ba('0x13')]);}})[_0x60ba('0x15')](function(_0x20b005){logger[_0x60ba('0x12')](_0x60ba('0xd'),_0x5973d3,_0x20b005);_0x57f5af(_0x20b005);});});}exports[_0x60ba('0x16')]=function(_0x145ce8){var _0x138a36=this;return new Promise(function(_0x1f9bfa,_0x318200){return db['DeskAccount'][_0x60ba('0x17')]({'raw':_0x145ce8['options']?_0x145ce8[_0x60ba('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x145ce8[_0x60ba('0x18')]?_0x145ce8['options'][_0x60ba('0x19')]||null:null,'attributes':_0x145ce8[_0x60ba('0x18')]?_0x145ce8['options'][_0x60ba('0x1a')]||null:null,'limit':_0x145ce8[_0x60ba('0x18')]?_0x145ce8[_0x60ba('0x18')][_0x60ba('0x1b')]||null:null,'include':_0x145ce8[_0x60ba('0x18')]?_0x145ce8[_0x60ba('0x18')][_0x60ba('0x1c')]?_[_0x60ba('0x1d')](_0x145ce8[_0x60ba('0x18')][_0x60ba('0x1c')],function(_0xbe03f3){return{'model':db[_0xbe03f3[_0x60ba('0x1e')]],'as':_0xbe03f3['as'],'attributes':_0xbe03f3[_0x60ba('0x1a')],'include':_0xbe03f3['include']?_[_0x60ba('0x1d')](_0xbe03f3[_0x60ba('0x1c')],function(_0x2fdb46){return{'model':db[_0x2fdb46['model']],'as':_0x2fdb46['as'],'attributes':_0x2fdb46[_0x60ba('0x1a')],'include':_0x2fdb46[_0x60ba('0x1c')]?_[_0x60ba('0x1d')](_0x2fdb46[_0x60ba('0x1c')],function(_0x42cf1c){return{'model':db[_0x42cf1c['model']],'as':_0x42cf1c['as'],'attributes':_0x42cf1c[_0x60ba('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x43ad2f){logger[_0x60ba('0xc')]('GetDeskAccount',_0x145ce8);logger[_0x60ba('0xf')](_0x60ba('0x16'),_0x145ce8,JSON[_0x60ba('0x11')](_0x43ad2f));_0x1f9bfa(_0x43ad2f);})[_0x60ba('0x15')](function(_0x23a45d){logger['error'](_0x60ba('0x16'),_0x23a45d[_0x60ba('0x13')],_0x145ce8);_0x318200(_0x138a36[_0x60ba('0x12')](0x1f4,_0x23a45d['message']));});});};exports['ShowDeskAccount']=function(_0x2551a6){var _0x51946a=this;return new Promise(function(_0x326678,_0x1cac15){return db[_0x60ba('0x1f')][_0x60ba('0x20')]({'raw':_0x2551a6[_0x60ba('0x18')]?_0x2551a6['options']['raw']===undefined?!![]:![]:!![],'where':_0x2551a6['options']?_0x2551a6[_0x60ba('0x18')][_0x60ba('0x19')]||null:null,'attributes':_0x2551a6[_0x60ba('0x18')]?_0x2551a6[_0x60ba('0x18')][_0x60ba('0x1a')]||null:null,'include':_0x2551a6[_0x60ba('0x18')]?_0x2551a6[_0x60ba('0x18')][_0x60ba('0x1c')]?_['map'](_0x2551a6[_0x60ba('0x18')]['include'],function(_0x1b542f){return{'model':db[_0x1b542f[_0x60ba('0x1e')]],'as':_0x1b542f['as'],'attributes':_0x1b542f[_0x60ba('0x1a')],'include':_0x1b542f[_0x60ba('0x1c')]?_[_0x60ba('0x1d')](_0x1b542f[_0x60ba('0x1c')],function(_0x320cb7){return{'model':db[_0x320cb7[_0x60ba('0x1e')]],'as':_0x320cb7['as'],'attributes':_0x320cb7[_0x60ba('0x1a')],'include':_0x320cb7['include']?_['map'](_0x320cb7['include'],function(_0x53b607){return{'model':db[_0x53b607[_0x60ba('0x1e')]],'as':_0x53b607['as'],'attributes':_0x53b607['attributes']};}):[]};}):[]};}):[]:[]})[_0x60ba('0x21')](function(_0x3d236e){logger[_0x60ba('0xc')](_0x60ba('0x22'),_0x2551a6);logger[_0x60ba('0xf')](_0x60ba('0x22'),_0x2551a6,JSON['stringify'](_0x3d236e));_0x326678(_0x3d236e);})[_0x60ba('0x15')](function(_0x91f325){logger[_0x60ba('0x12')](_0x60ba('0x22'),_0x91f325[_0x60ba('0x13')],_0x2551a6);_0x1cac15(_0x51946a['error'](0x1f4,_0x91f325['message']));});});}; \ No newline at end of file +var _0x64d3=['where','ShowDeskAccount','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','DeskAccount,\x20%s,\x20%s','request\x20sent','debug','DeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetDeskAccount','DeskAccount','options','raw','attributes','limit','include','map','model'];(function(_0x506fe3,_0x270525){var _0x22f5c9=function(_0x1b806f){while(--_0x1b806f){_0x506fe3['push'](_0x506fe3['shift']());}};_0x22f5c9(++_0x270525);}(_0x64d3,0x12b));var _0x364d=function(_0x572085,_0x24eda9){_0x572085=_0x572085-0x0;var _0x3da37f=_0x64d3[_0x572085];return _0x3da37f;};'use strict';var _=require('lodash');var util=require(_0x364d('0x0'));var moment=require(_0x364d('0x1'));var BPromise=require(_0x364d('0x2'));var rs=require(_0x364d('0x3'));var fs=require('fs');var Redis=require(_0x364d('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x364d('0x5'));var logger=require(_0x364d('0x6'))(_0x364d('0x7'));var config=require(_0x364d('0x8'));var jayson=require(_0x364d('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3577d9,_0x596638,_0xb98e06){return new BPromise(function(_0x4109b2,_0x2749e9){return client[_0x364d('0xa')](_0x3577d9,_0xb98e06)[_0x364d('0xb')](function(_0xb4006d){logger[_0x364d('0xc')](_0x364d('0xd'),_0x596638,_0x364d('0xe'));logger[_0x364d('0xf')](_0x364d('0x10'),_0x596638,_0x364d('0xe'),JSON[_0x364d('0x11')](_0xb4006d));if(_0xb4006d[_0x364d('0x12')]){if(_0xb4006d['error']['code']===0x1f4){logger[_0x364d('0x12')]('DeskAccount,\x20%s,\x20%s',_0x596638,_0xb4006d['error'][_0x364d('0x13')]);return _0x2749e9(_0xb4006d['error'][_0x364d('0x13')]);}logger['error']('DeskAccount,\x20%s,\x20%s',_0x596638,_0xb4006d[_0x364d('0x12')][_0x364d('0x13')]);return _0x4109b2(_0xb4006d['error'][_0x364d('0x13')]);}else{logger['info'](_0x364d('0xd'),_0x596638,'request\x20sent');_0x4109b2(_0xb4006d[_0x364d('0x14')]['message']);}})[_0x364d('0x15')](function(_0x10aa14){logger[_0x364d('0x12')](_0x364d('0xd'),_0x596638,_0x10aa14);_0x2749e9(_0x10aa14);});});}exports[_0x364d('0x16')]=function(_0x95af92){var _0x3dadd9=this;return new Promise(function(_0x1a1ea1,_0x4d6a99){return db[_0x364d('0x17')]['findAll']({'raw':_0x95af92[_0x364d('0x18')]?_0x95af92['options'][_0x364d('0x19')]===undefined?!![]:![]:!![],'where':_0x95af92[_0x364d('0x18')]?_0x95af92['options']['where']||null:null,'attributes':_0x95af92[_0x364d('0x18')]?_0x95af92[_0x364d('0x18')][_0x364d('0x1a')]||null:null,'limit':_0x95af92[_0x364d('0x18')]?_0x95af92['options'][_0x364d('0x1b')]||null:null,'include':_0x95af92['options']?_0x95af92[_0x364d('0x18')][_0x364d('0x1c')]?_[_0x364d('0x1d')](_0x95af92[_0x364d('0x18')][_0x364d('0x1c')],function(_0x2f93c4){return{'model':db[_0x2f93c4[_0x364d('0x1e')]],'as':_0x2f93c4['as'],'attributes':_0x2f93c4[_0x364d('0x1a')],'include':_0x2f93c4[_0x364d('0x1c')]?_[_0x364d('0x1d')](_0x2f93c4[_0x364d('0x1c')],function(_0x342ebe){return{'model':db[_0x342ebe[_0x364d('0x1e')]],'as':_0x342ebe['as'],'attributes':_0x342ebe[_0x364d('0x1a')],'include':_0x342ebe[_0x364d('0x1c')]?_['map'](_0x342ebe[_0x364d('0x1c')],function(_0x432372){return{'model':db[_0x432372[_0x364d('0x1e')]],'as':_0x432372['as'],'attributes':_0x432372[_0x364d('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x364d('0xb')](function(_0x5c8447){logger[_0x364d('0xc')]('GetDeskAccount',_0x95af92);logger[_0x364d('0xf')](_0x364d('0x16'),_0x95af92,JSON[_0x364d('0x11')](_0x5c8447));_0x1a1ea1(_0x5c8447);})[_0x364d('0x15')](function(_0x1e2a19){logger[_0x364d('0x12')](_0x364d('0x16'),_0x1e2a19[_0x364d('0x13')],_0x95af92);_0x4d6a99(_0x3dadd9[_0x364d('0x12')](0x1f4,_0x1e2a19['message']));});});};exports['ShowDeskAccount']=function(_0xc204b4){var _0x426c0b=this;return new Promise(function(_0x22afc0,_0x565f5d){return db[_0x364d('0x17')]['find']({'raw':_0xc204b4[_0x364d('0x18')]?_0xc204b4['options'][_0x364d('0x19')]===undefined?!![]:![]:!![],'where':_0xc204b4[_0x364d('0x18')]?_0xc204b4['options'][_0x364d('0x1f')]||null:null,'attributes':_0xc204b4[_0x364d('0x18')]?_0xc204b4[_0x364d('0x18')][_0x364d('0x1a')]||null:null,'include':_0xc204b4['options']?_0xc204b4['options'][_0x364d('0x1c')]?_['map'](_0xc204b4[_0x364d('0x18')]['include'],function(_0x3903d6){return{'model':db[_0x3903d6[_0x364d('0x1e')]],'as':_0x3903d6['as'],'attributes':_0x3903d6[_0x364d('0x1a')],'include':_0x3903d6[_0x364d('0x1c')]?_[_0x364d('0x1d')](_0x3903d6[_0x364d('0x1c')],function(_0x568914){return{'model':db[_0x568914[_0x364d('0x1e')]],'as':_0x568914['as'],'attributes':_0x568914[_0x364d('0x1a')],'include':_0x568914[_0x364d('0x1c')]?_[_0x364d('0x1d')](_0x568914[_0x364d('0x1c')],function(_0x47d2e7){return{'model':db[_0x47d2e7['model']],'as':_0x47d2e7['as'],'attributes':_0x47d2e7[_0x364d('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x364d('0xb')](function(_0xcd48cd){logger[_0x364d('0xc')](_0x364d('0x20'),_0xc204b4);logger[_0x364d('0xf')](_0x364d('0x20'),_0xc204b4,JSON[_0x364d('0x11')](_0xcd48cd));_0x22afc0(_0xcd48cd);})[_0x364d('0x15')](function(_0x13ad2a){logger[_0x364d('0x12')](_0x364d('0x20'),_0x13ad2a['message'],_0xc204b4);_0x565f5d(_0x426c0b['error'](0x1f4,_0x13ad2a[_0x364d('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/index.js b/server/api/intDeskConfiguration/index.js index 0e4bd10..50e5484 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(_0x163fed,_0x416124){var _0x1b90aa=function(_0x20b94f){while(--_0x20b94f){_0x163fed['push'](_0x163fed['shift']());}};_0x1b90aa(++_0x416124);}(_0x008c,0x188));var _0xc008=function(_0x338581,_0x85c756){_0x338581=_0x338581-0x0;var _0x306123=_0x008c[_0x338581];return _0x306123;};'use strict';var multer=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var path=require(_0xc008('0x2'));var timeout=require(_0xc008('0x3'));var express=require(_0xc008('0x4'));var router=express['Router']();var fs_extra=require(_0xc008('0x5'));var auth=require(_0xc008('0x6'));var interaction=require(_0xc008('0x7'));var config=require(_0xc008('0x8'));var controller=require(_0xc008('0x9'));router[_0xc008('0xa')]('/',auth[_0xc008('0xb')](),controller[_0xc008('0xc')]);router[_0xc008('0xa')]('/:id',auth[_0xc008('0xb')](),controller['show']);router[_0xc008('0xa')]('/:id/fields',auth['isAuthenticated'](),controller[_0xc008('0xd')]);router[_0xc008('0xa')]('/:id/subjects',auth['isAuthenticated'](),controller['getSubjects']);router[_0xc008('0xa')](_0xc008('0xe'),auth['isAuthenticated'](),controller[_0xc008('0xf')]);router[_0xc008('0xa')](_0xc008('0x10'),auth[_0xc008('0xb')](),controller[_0xc008('0x11')]);router[_0xc008('0x12')]('/',auth[_0xc008('0xb')](),controller['create']);router['post'](_0xc008('0x10'),auth['isAuthenticated'](),controller[_0xc008('0x13')]);router[_0xc008('0x14')](_0xc008('0x15'),auth[_0xc008('0xb')](),controller[_0xc008('0x16')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xc008('0x17')]);module[_0xc008('0x18')]=router; \ No newline at end of file +var _0xedd9=['getTags','post','create','setTags','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intDeskConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getSubjects','/:id/descriptions','/:id/tags'];(function(_0x471814,_0x2634bc){var _0x4ccedc=function(_0x4d0dde){while(--_0x4d0dde){_0x471814['push'](_0x471814['shift']());}};_0x4ccedc(++_0x2634bc);}(_0xedd9,0xfc));var _0x9edd=function(_0x366efc,_0x4a3867){_0x366efc=_0x366efc-0x0;var _0x44684e=_0xedd9[_0x366efc];return _0x44684e;};'use strict';var multer=require('multer');var util=require(_0x9edd('0x0'));var path=require(_0x9edd('0x1'));var timeout=require(_0x9edd('0x2'));var express=require(_0x9edd('0x3'));var router=express[_0x9edd('0x4')]();var fs_extra=require(_0x9edd('0x5'));var auth=require(_0x9edd('0x6'));var interaction=require(_0x9edd('0x7'));var config=require('../../config/environment');var controller=require(_0x9edd('0x8'));router[_0x9edd('0x9')]('/',auth[_0x9edd('0xa')](),controller[_0x9edd('0xb')]);router['get'](_0x9edd('0xc'),auth['isAuthenticated'](),controller[_0x9edd('0xd')]);router[_0x9edd('0x9')](_0x9edd('0xe'),auth[_0x9edd('0xa')](),controller['getFields']);router[_0x9edd('0x9')]('/:id/subjects',auth[_0x9edd('0xa')](),controller[_0x9edd('0xf')]);router['get'](_0x9edd('0x10'),auth[_0x9edd('0xa')](),controller['getDescriptions']);router[_0x9edd('0x9')](_0x9edd('0x11'),auth[_0x9edd('0xa')](),controller[_0x9edd('0x12')]);router[_0x9edd('0x13')]('/',auth[_0x9edd('0xa')](),controller[_0x9edd('0x14')]);router[_0x9edd('0x13')]('/:id/tags',auth[_0x9edd('0xa')](),controller[_0x9edd('0x15')]);router[_0x9edd('0x16')](_0x9edd('0xc'),auth[_0x9edd('0xa')](),controller[_0x9edd('0x17')]);router[_0x9edd('0x18')](_0x9edd('0xc'),auth['isAuthenticated'](),controller[_0x9edd('0x19')]);module[_0x9edd('0x1a')]=router; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js b/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js index 6e735fc..7db0dcb 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 _0x559f=['STRING','sequelize'];(function(_0x43c394,_0x2d9e21){var _0x50f077=function(_0x386189){while(--_0x386189){_0x43c394['push'](_0x43c394['shift']());}};_0x50f077(++_0x2d9e21);}(_0x559f,0x1e3));var _0xf559=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x559f[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xf559('0x0'));module['exports']={'name':{'type':Sequelize[_0xf559('0x1')]},'description':{'type':Sequelize[_0xf559('0x1')]}}; \ No newline at end of file +var _0x3321=['STRING','sequelize','exports'];(function(_0x4a23af,_0x2fc8cb){var _0x683d75=function(_0x3f0fa1){while(--_0x3f0fa1){_0x4a23af['push'](_0x4a23af['shift']());}};_0x683d75(++_0x2fc8cb);}(_0x3321,0x7c));var _0x1332=function(_0xa962b6,_0xc2ea2){_0xa962b6=_0xa962b6-0x0;var _0x2a997d=_0x3321[_0xa962b6];return _0x2a997d;};'use strict';var Sequelize=require(_0x1332('0x0'));module[_0x1332('0x1')]={'name':{'type':Sequelize[_0x1332('0x2')]},'description':{'type':Sequelize[_0x1332('0x2')]}}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.controller.js b/server/api/intDeskConfiguration/intDeskConfiguration.controller.js index 9450765..2460578 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 _0x6a0f=['nolimit','order','sort','where','filter','merge','VIRTUAL','include','rows','catch','show','includeAll','options','create','body','find','params','destroy','findOne','DeskField','pick','getFields','getSubjects','getDescriptions','getTags','setTags','ids','eml-format','zip-dir','request-promise','moment','mustache','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','json','apply','save','update','then','error','stack','name','index','map','DeskConfiguration','rawAttributes','fieldName','type','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty'];(function(_0x16de73,_0x3888b7){var _0x5f0217=function(_0x134dc3){while(--_0x134dc3){_0x16de73['push'](_0x16de73['shift']());}};_0x5f0217(++_0x3888b7);}(_0x6a0f,0x153));var _0xf6a0=function(_0x8f7c6e,_0x15f067){_0x8f7c6e=_0x8f7c6e-0x0;var _0x3cb0d5=_0x6a0f[_0x8f7c6e];return _0x3cb0d5;};'use strict';var emlformat=require(_0xf6a0('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf6a0('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf6a0('0x2'));var moment=require(_0xf6a0('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xf6a0('0x4'));var util=require('util');var path=require('path');var sox=require(_0xf6a0('0x5'));var csv=require(_0xf6a0('0x6'));var ejs=require(_0xf6a0('0x7'));var fs=require('fs');var fs_extra=require(_0xf6a0('0x8'));var _=require('lodash');var squel=require(_0xf6a0('0x9'));var crypto=require(_0xf6a0('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xf6a0('0xb'));var toCsv=require(_0xf6a0('0x6'));var querystring=require(_0xf6a0('0xc'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xf6a0('0xd'));var qs=require(_0xf6a0('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf6a0('0xf'));var logger=require(_0xf6a0('0x10'))('api');var utils=require(_0xf6a0('0x11'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xf6a0('0x12'))['db'];function respondWithStatusCode(_0x173be3,_0x5ccf07){_0x5ccf07=_0x5ccf07||0xcc;return function(_0x193ba0){if(_0x193ba0){return _0x173be3[_0xf6a0('0x13')](_0x5ccf07);}return _0x173be3[_0xf6a0('0x14')](_0x5ccf07)[_0xf6a0('0x15')]();};}function respondWithResult(_0x5aae7c,_0x1cf872){_0x1cf872=_0x1cf872||0xc8;return function(_0x2dd0dc){if(_0x2dd0dc){return _0x5aae7c['status'](_0x1cf872)['json'](_0x2dd0dc);}};}function respondWithFilteredResult(_0x402657,_0x54f86e){return function(_0x52a5d){if(_0x52a5d){var _0x23ceef=typeof _0x54f86e[_0xf6a0('0x16')]==='undefined'&&typeof _0x54f86e[_0xf6a0('0x17')]===_0xf6a0('0x18');var _0x291bd8=_0x52a5d[_0xf6a0('0x19')];var _0x4ab24b=_0x23ceef?0x0:_0x54f86e[_0xf6a0('0x16')];var _0x14660b=_0x23ceef?_0x52a5d[_0xf6a0('0x19')]:_0x54f86e[_0xf6a0('0x16')]+_0x54f86e[_0xf6a0('0x17')];var _0x2ac539;if(_0x14660b>=_0x291bd8){_0x14660b=_0x291bd8;_0x2ac539=0xc8;}else{_0x2ac539=0xce;}_0x402657[_0xf6a0('0x14')](_0x2ac539);return _0x402657[_0xf6a0('0x1a')](_0xf6a0('0x1b'),_0x4ab24b+'-'+_0x14660b+'/'+_0x291bd8)[_0xf6a0('0x1c')](_0x52a5d);}return null;};}function patchUpdates(_0x401e2d){return function(_0x32045c){try{jsonpatch[_0xf6a0('0x1d')](_0x32045c,_0x401e2d,!![]);}catch(_0x506092){return BPromise['reject'](_0x506092);}return _0x32045c[_0xf6a0('0x1e')]();};}function saveUpdates(_0x33976e,_0xf98f8){return function(_0x23ac1d){if(_0x23ac1d){return _0x23ac1d[_0xf6a0('0x1f')](_0x33976e)[_0xf6a0('0x20')](function(_0x549eb9){return _0x549eb9;});}return null;};}function removeEntity(_0x48a9a7,_0x5a574f){return function(_0x451a28){if(_0x451a28){return _0x451a28['destroy']()['then'](function(){_0x48a9a7[_0xf6a0('0x14')](0xcc)[_0xf6a0('0x15')]();});}};}function handleEntityNotFound(_0x294949,_0x52b7c8){return function(_0x4a22ec){if(!_0x4a22ec){_0x294949[_0xf6a0('0x13')](0x194);}return _0x4a22ec;};}function handleError(_0x35c4d2,_0x36d32d){_0x36d32d=_0x36d32d||0x1f4;return function(_0x1052b7){logger[_0xf6a0('0x21')](_0x1052b7[_0xf6a0('0x22')]);if(_0x1052b7[_0xf6a0('0x23')]){delete _0x1052b7['name'];}_0x35c4d2['status'](_0x36d32d)['send'](_0x1052b7);};}exports[_0xf6a0('0x24')]=function(_0x4d517f,_0x5a1f74){var _0x4339ef={},_0x3150d0={},_0x228200={'count':0x0,'rows':[]};var _0x49030d=_[_0xf6a0('0x25')](db[_0xf6a0('0x26')][_0xf6a0('0x27')],function(_0x30379d){return{'name':_0x30379d[_0xf6a0('0x28')],'type':_0x30379d[_0xf6a0('0x29')]['key']};});_0x3150d0['model']=_[_0xf6a0('0x25')](_0x49030d,_0xf6a0('0x23'));_0x3150d0[_0xf6a0('0x2a')]=_[_0xf6a0('0x2b')](_0x4d517f[_0xf6a0('0x2a')]);_0x3150d0[_0xf6a0('0x2c')]=_[_0xf6a0('0x2d')](_0x3150d0[_0xf6a0('0x2e')],_0x3150d0['query']);_0x4339ef[_0xf6a0('0x2f')]=_[_0xf6a0('0x2d')](_0x3150d0[_0xf6a0('0x2e')],qs['fields'](_0x4d517f['query'][_0xf6a0('0x30')]));_0x4339ef[_0xf6a0('0x2f')]=_0x4339ef['attributes'][_0xf6a0('0x31')]?_0x4339ef[_0xf6a0('0x2f')]:_0x3150d0[_0xf6a0('0x2e')];if(!_0x4d517f[_0xf6a0('0x2a')][_0xf6a0('0x32')](_0xf6a0('0x33'))){_0x4339ef[_0xf6a0('0x17')]=qs[_0xf6a0('0x17')](_0x4d517f[_0xf6a0('0x2a')][_0xf6a0('0x17')]);_0x4339ef[_0xf6a0('0x16')]=qs[_0xf6a0('0x16')](_0x4d517f['query'][_0xf6a0('0x16')]);}_0x4339ef[_0xf6a0('0x34')]=qs[_0xf6a0('0x35')](_0x4d517f[_0xf6a0('0x2a')]['sort']);_0x4339ef[_0xf6a0('0x36')]=qs[_0xf6a0('0x2c')](_['pick'](_0x4d517f[_0xf6a0('0x2a')],_0x3150d0[_0xf6a0('0x2c')]),_0x49030d);if(_0x4d517f[_0xf6a0('0x2a')][_0xf6a0('0x37')]){_0x4339ef['where']=_[_0xf6a0('0x38')](_0x4339ef[_0xf6a0('0x36')],{'$or':_[_0xf6a0('0x25')](_0x49030d,function(_0x4d898a){if(_0x4d898a[_0xf6a0('0x29')]!==_0xf6a0('0x39')){var _0x1e6177={};_0x1e6177[_0x4d898a['name']]={'$like':'%'+_0x4d517f[_0xf6a0('0x2a')][_0xf6a0('0x37')]+'%'};return _0x1e6177;}})});}_0x4339ef=_[_0xf6a0('0x38')]({},_0x4339ef,_0x4d517f['options']);var _0x4fca25={'where':_0x4339ef[_0xf6a0('0x36')]};return db[_0xf6a0('0x26')][_0xf6a0('0x19')](_0x4fca25)[_0xf6a0('0x20')](function(_0x82116e){_0x228200['count']=_0x82116e;if(_0x4d517f['query']['includeAll']){_0x4339ef[_0xf6a0('0x3a')]=[{'all':!![]}];}return db[_0xf6a0('0x26')]['findAll'](_0x4339ef);})['then'](function(_0x1dcb42){_0x228200[_0xf6a0('0x3b')]=_0x1dcb42;return _0x228200;})[_0xf6a0('0x20')](respondWithFilteredResult(_0x5a1f74,_0x4339ef))[_0xf6a0('0x3c')](handleError(_0x5a1f74,null));};exports[_0xf6a0('0x3d')]=function(_0x828777,_0x264397){var _0x23f063={'raw':![],'where':{'id':_0x828777['params']['id']}},_0x1fe0c3={};_0x1fe0c3[_0xf6a0('0x2e')]=_['keys'](db['DeskConfiguration']['rawAttributes']);_0x1fe0c3[_0xf6a0('0x2a')]=_[_0xf6a0('0x2b')](_0x828777[_0xf6a0('0x2a')]);_0x1fe0c3[_0xf6a0('0x2c')]=_['intersection'](_0x1fe0c3[_0xf6a0('0x2e')],_0x1fe0c3[_0xf6a0('0x2a')]);_0x23f063[_0xf6a0('0x2f')]=_[_0xf6a0('0x2d')](_0x1fe0c3[_0xf6a0('0x2e')],qs['fields'](_0x828777['query'][_0xf6a0('0x30')]));_0x23f063[_0xf6a0('0x2f')]=_0x23f063['attributes']['length']?_0x23f063[_0xf6a0('0x2f')]:_0x1fe0c3['model'];if(_0x828777[_0xf6a0('0x2a')][_0xf6a0('0x3e')]){_0x23f063[_0xf6a0('0x3a')]=[{'all':!![]}];}_0x23f063=_[_0xf6a0('0x38')]({},_0x23f063,_0x828777[_0xf6a0('0x3f')]);return db[_0xf6a0('0x26')]['find'](_0x23f063)[_0xf6a0('0x20')](handleEntityNotFound(_0x264397,null))[_0xf6a0('0x20')](respondWithResult(_0x264397,null))[_0xf6a0('0x3c')](handleError(_0x264397,null));};exports[_0xf6a0('0x40')]=function(_0x5a5800,_0x6169b){return db[_0xf6a0('0x26')][_0xf6a0('0x40')](_0x5a5800['body'],{})['then'](respondWithResult(_0x6169b,0xc9))[_0xf6a0('0x3c')](handleError(_0x6169b,null));};exports['update']=function(_0x2ea0c2,_0x40bbbe){if(_0x2ea0c2[_0xf6a0('0x41')]['id']){delete _0x2ea0c2[_0xf6a0('0x41')]['id'];}return db[_0xf6a0('0x26')][_0xf6a0('0x42')]({'where':{'id':_0x2ea0c2[_0xf6a0('0x43')]['id']}})[_0xf6a0('0x20')](handleEntityNotFound(_0x40bbbe,null))[_0xf6a0('0x20')](saveUpdates(_0x2ea0c2[_0xf6a0('0x41')],null))[_0xf6a0('0x20')](respondWithResult(_0x40bbbe,null))[_0xf6a0('0x3c')](handleError(_0x40bbbe,null));};exports[_0xf6a0('0x44')]=function(_0x413745,_0xbed6fe){return db[_0xf6a0('0x26')]['find']({'where':{'id':_0x413745[_0xf6a0('0x43')]['id']}})['then'](handleEntityNotFound(_0xbed6fe,null))[_0xf6a0('0x20')](removeEntity(_0xbed6fe,null))[_0xf6a0('0x3c')](handleError(_0xbed6fe,null));};exports['getFields']=function(_0x1e8ab2,_0x1a6dae,_0x4d5456){var _0x75aacb={};var _0x30d630={};var _0x52f159;var _0x327aeb;return db[_0xf6a0('0x26')][_0xf6a0('0x45')]({'where':{'id':_0x1e8ab2[_0xf6a0('0x43')]['id']}})[_0xf6a0('0x20')](handleEntityNotFound(_0x1a6dae,null))[_0xf6a0('0x20')](function(_0xfc7261){if(_0xfc7261){_0x52f159=_0xfc7261;_0x30d630[_0xf6a0('0x2e')]=_['keys'](db[_0xf6a0('0x46')][_0xf6a0('0x27')]);_0x30d630[_0xf6a0('0x2a')]=_[_0xf6a0('0x2b')](_0x1e8ab2['query']);_0x30d630[_0xf6a0('0x2c')]=_[_0xf6a0('0x2d')](_0x30d630[_0xf6a0('0x2e')],_0x30d630['query']);_0x75aacb[_0xf6a0('0x2f')]=_[_0xf6a0('0x2d')](_0x30d630[_0xf6a0('0x2e')],qs[_0xf6a0('0x30')](_0x1e8ab2[_0xf6a0('0x2a')][_0xf6a0('0x30')]));_0x75aacb[_0xf6a0('0x2f')]=_0x75aacb[_0xf6a0('0x2f')][_0xf6a0('0x31')]?_0x75aacb[_0xf6a0('0x2f')]:_0x30d630[_0xf6a0('0x2e')];_0x75aacb[_0xf6a0('0x34')]=qs[_0xf6a0('0x35')](_0x1e8ab2['query']['sort']);_0x75aacb[_0xf6a0('0x36')]=qs['filters'](_[_0xf6a0('0x47')](_0x1e8ab2[_0xf6a0('0x2a')],_0x30d630[_0xf6a0('0x2c')]));if(_0x1e8ab2[_0xf6a0('0x2a')][_0xf6a0('0x37')]){_0x75aacb[_0xf6a0('0x36')]=_[_0xf6a0('0x38')](_0x75aacb['where'],{'$or':_[_0xf6a0('0x25')](_0x75aacb[_0xf6a0('0x2f')],function(_0x3cfcc3){var _0x3162b0={};_0x3162b0[_0x3cfcc3]={'$like':'%'+_0x1e8ab2[_0xf6a0('0x2a')]['filter']+'%'};return _0x3162b0;})});}_0x75aacb=_[_0xf6a0('0x38')]({},_0x75aacb,_0x1e8ab2['options']);return _0x52f159[_0xf6a0('0x48')](_0x75aacb);}})[_0xf6a0('0x20')](function(_0x24280c){if(_0x24280c){_0x327aeb=_0x24280c[_0xf6a0('0x31')];if(!_0x1e8ab2[_0xf6a0('0x2a')][_0xf6a0('0x32')]('nolimit')){_0x75aacb[_0xf6a0('0x17')]=qs['limit'](_0x1e8ab2['query'][_0xf6a0('0x17')]);_0x75aacb[_0xf6a0('0x16')]=qs[_0xf6a0('0x16')](_0x1e8ab2['query'][_0xf6a0('0x16')]);}return _0x52f159['getFields'](_0x75aacb);}})[_0xf6a0('0x20')](function(_0x13c100){if(_0x13c100){return _0x13c100?{'count':_0x327aeb,'rows':_0x13c100}:null;}})[_0xf6a0('0x20')](respondWithResult(_0x1a6dae,null))[_0xf6a0('0x3c')](handleError(_0x1a6dae,null));};exports[_0xf6a0('0x49')]=function(_0x29b12e,_0x540ecd,_0x1cb847){var _0x219db8={};var _0x525103={};var _0x814bc3;var _0x591159;return db[_0xf6a0('0x26')][_0xf6a0('0x45')]({'where':{'id':_0x29b12e[_0xf6a0('0x43')]['id']}})[_0xf6a0('0x20')](handleEntityNotFound(_0x540ecd,null))[_0xf6a0('0x20')](function(_0x767781){if(_0x767781){_0x814bc3=_0x767781;_0x525103[_0xf6a0('0x2e')]=_['keys'](db[_0xf6a0('0x46')]['rawAttributes']);_0x525103[_0xf6a0('0x2a')]=_[_0xf6a0('0x2b')](_0x29b12e['query']);_0x525103[_0xf6a0('0x2c')]=_['intersection'](_0x525103['model'],_0x525103[_0xf6a0('0x2a')]);_0x219db8[_0xf6a0('0x2f')]=_[_0xf6a0('0x2d')](_0x525103[_0xf6a0('0x2e')],qs[_0xf6a0('0x30')](_0x29b12e[_0xf6a0('0x2a')][_0xf6a0('0x30')]));_0x219db8['attributes']=_0x219db8['attributes'][_0xf6a0('0x31')]?_0x219db8[_0xf6a0('0x2f')]:_0x525103[_0xf6a0('0x2e')];_0x219db8[_0xf6a0('0x34')]=qs[_0xf6a0('0x35')](_0x29b12e[_0xf6a0('0x2a')]['sort']);_0x219db8[_0xf6a0('0x36')]=qs[_0xf6a0('0x2c')](_[_0xf6a0('0x47')](_0x29b12e[_0xf6a0('0x2a')],_0x525103[_0xf6a0('0x2c')]));if(_0x29b12e[_0xf6a0('0x2a')][_0xf6a0('0x37')]){_0x219db8[_0xf6a0('0x36')]=_[_0xf6a0('0x38')](_0x219db8['where'],{'$or':_[_0xf6a0('0x25')](_0x219db8[_0xf6a0('0x2f')],function(_0x37ea1b){var _0x517e4d={};_0x517e4d[_0x37ea1b]={'$like':'%'+_0x29b12e['query']['filter']+'%'};return _0x517e4d;})});}_0x219db8=_[_0xf6a0('0x38')]({},_0x219db8,_0x29b12e[_0xf6a0('0x3f')]);return _0x814bc3[_0xf6a0('0x49')](_0x219db8);}})[_0xf6a0('0x20')](function(_0x31b654){if(_0x31b654){_0x591159=_0x31b654[_0xf6a0('0x31')];if(!_0x29b12e[_0xf6a0('0x2a')][_0xf6a0('0x32')](_0xf6a0('0x33'))){_0x219db8['limit']=qs[_0xf6a0('0x17')](_0x29b12e[_0xf6a0('0x2a')][_0xf6a0('0x17')]);_0x219db8[_0xf6a0('0x16')]=qs[_0xf6a0('0x16')](_0x29b12e['query'][_0xf6a0('0x16')]);}return _0x814bc3[_0xf6a0('0x49')](_0x219db8);}})[_0xf6a0('0x20')](function(_0x302158){if(_0x302158){return _0x302158?{'count':_0x591159,'rows':_0x302158}:null;}})[_0xf6a0('0x20')](respondWithResult(_0x540ecd,null))[_0xf6a0('0x3c')](handleError(_0x540ecd,null));};exports[_0xf6a0('0x4a')]=function(_0x1f0784,_0x258258,_0x27acb9){var _0x2dd546={};var _0xfccbd0={};var _0x3a1c31;var _0x4ed5a8;return db['DeskConfiguration'][_0xf6a0('0x45')]({'where':{'id':_0x1f0784[_0xf6a0('0x43')]['id']}})[_0xf6a0('0x20')](handleEntityNotFound(_0x258258,null))[_0xf6a0('0x20')](function(_0x350916){if(_0x350916){_0x3a1c31=_0x350916;_0xfccbd0['model']=_[_0xf6a0('0x2b')](db['DeskField']['rawAttributes']);_0xfccbd0[_0xf6a0('0x2a')]=_[_0xf6a0('0x2b')](_0x1f0784[_0xf6a0('0x2a')]);_0xfccbd0[_0xf6a0('0x2c')]=_[_0xf6a0('0x2d')](_0xfccbd0[_0xf6a0('0x2e')],_0xfccbd0[_0xf6a0('0x2a')]);_0x2dd546['attributes']=_[_0xf6a0('0x2d')](_0xfccbd0[_0xf6a0('0x2e')],qs[_0xf6a0('0x30')](_0x1f0784[_0xf6a0('0x2a')][_0xf6a0('0x30')]));_0x2dd546[_0xf6a0('0x2f')]=_0x2dd546[_0xf6a0('0x2f')][_0xf6a0('0x31')]?_0x2dd546['attributes']:_0xfccbd0[_0xf6a0('0x2e')];_0x2dd546[_0xf6a0('0x34')]=qs[_0xf6a0('0x35')](_0x1f0784[_0xf6a0('0x2a')][_0xf6a0('0x35')]);_0x2dd546[_0xf6a0('0x36')]=qs['filters'](_['pick'](_0x1f0784[_0xf6a0('0x2a')],_0xfccbd0[_0xf6a0('0x2c')]));if(_0x1f0784[_0xf6a0('0x2a')][_0xf6a0('0x37')]){_0x2dd546[_0xf6a0('0x36')]=_[_0xf6a0('0x38')](_0x2dd546[_0xf6a0('0x36')],{'$or':_[_0xf6a0('0x25')](_0x2dd546[_0xf6a0('0x2f')],function(_0x51cb58){var _0x4f1897={};_0x4f1897[_0x51cb58]={'$like':'%'+_0x1f0784[_0xf6a0('0x2a')][_0xf6a0('0x37')]+'%'};return _0x4f1897;})});}_0x2dd546=_[_0xf6a0('0x38')]({},_0x2dd546,_0x1f0784[_0xf6a0('0x3f')]);return _0x3a1c31[_0xf6a0('0x4a')](_0x2dd546);}})[_0xf6a0('0x20')](function(_0x3a6c07){if(_0x3a6c07){_0x4ed5a8=_0x3a6c07[_0xf6a0('0x31')];if(!_0x1f0784[_0xf6a0('0x2a')][_0xf6a0('0x32')](_0xf6a0('0x33'))){_0x2dd546[_0xf6a0('0x17')]=qs['limit'](_0x1f0784[_0xf6a0('0x2a')][_0xf6a0('0x17')]);_0x2dd546[_0xf6a0('0x16')]=qs['offset'](_0x1f0784['query'][_0xf6a0('0x16')]);}return _0x3a1c31['getDescriptions'](_0x2dd546);}})[_0xf6a0('0x20')](function(_0x476558){if(_0x476558){return _0x476558?{'count':_0x4ed5a8,'rows':_0x476558}:null;}})[_0xf6a0('0x20')](respondWithResult(_0x258258,null))[_0xf6a0('0x3c')](handleError(_0x258258,null));};exports[_0xf6a0('0x4b')]=function(_0x195fec,_0x1f04cb,_0x52e340){var _0x16b1bb={};var _0x38f3c5={};var _0x5311ec;var _0xe0eba3;return db['DeskConfiguration'][_0xf6a0('0x45')]({'where':{'id':_0x195fec['params']['id']}})[_0xf6a0('0x20')](handleEntityNotFound(_0x1f04cb,null))['then'](function(_0x50d176){if(_0x50d176){_0x5311ec=_0x50d176;_0x38f3c5['model']=_[_0xf6a0('0x2b')](db['Tag'][_0xf6a0('0x27')]);_0x38f3c5[_0xf6a0('0x2a')]=_[_0xf6a0('0x2b')](_0x195fec['query']);_0x38f3c5['filters']=_[_0xf6a0('0x2d')](_0x38f3c5[_0xf6a0('0x2e')],_0x38f3c5[_0xf6a0('0x2a')]);_0x16b1bb[_0xf6a0('0x2f')]=_[_0xf6a0('0x2d')](_0x38f3c5[_0xf6a0('0x2e')],qs[_0xf6a0('0x30')](_0x195fec[_0xf6a0('0x2a')][_0xf6a0('0x30')]));_0x16b1bb[_0xf6a0('0x2f')]=_0x16b1bb[_0xf6a0('0x2f')][_0xf6a0('0x31')]?_0x16b1bb['attributes']:_0x38f3c5['model'];_0x16b1bb['order']=qs[_0xf6a0('0x35')](_0x195fec[_0xf6a0('0x2a')][_0xf6a0('0x35')]);_0x16b1bb[_0xf6a0('0x36')]=qs[_0xf6a0('0x2c')](_[_0xf6a0('0x47')](_0x195fec['query'],_0x38f3c5['filters']));if(_0x195fec[_0xf6a0('0x2a')][_0xf6a0('0x37')]){_0x16b1bb[_0xf6a0('0x36')]=_['merge'](_0x16b1bb[_0xf6a0('0x36')],{'$or':_[_0xf6a0('0x25')](_0x16b1bb[_0xf6a0('0x2f')],function(_0x5e2a63){var _0x21a089={};_0x21a089[_0x5e2a63]={'$like':'%'+_0x195fec['query'][_0xf6a0('0x37')]+'%'};return _0x21a089;})});}_0x16b1bb=_[_0xf6a0('0x38')]({},_0x16b1bb,_0x195fec[_0xf6a0('0x3f')]);return _0x5311ec[_0xf6a0('0x4b')](_0x16b1bb);}})[_0xf6a0('0x20')](function(_0x1a43e2){if(_0x1a43e2){_0xe0eba3=_0x1a43e2[_0xf6a0('0x31')];if(!_0x195fec['query'][_0xf6a0('0x32')](_0xf6a0('0x33'))){_0x16b1bb[_0xf6a0('0x17')]=qs[_0xf6a0('0x17')](_0x195fec['query'][_0xf6a0('0x17')]);_0x16b1bb[_0xf6a0('0x16')]=qs[_0xf6a0('0x16')](_0x195fec[_0xf6a0('0x2a')]['offset']);}return _0x5311ec[_0xf6a0('0x4b')](_0x16b1bb);}})[_0xf6a0('0x20')](function(_0x290a40){if(_0x290a40){return _0x290a40?{'count':_0xe0eba3,'rows':_0x290a40}:null;}})[_0xf6a0('0x20')](respondWithResult(_0x1f04cb,null))[_0xf6a0('0x3c')](handleError(_0x1f04cb,null));};exports[_0xf6a0('0x4c')]=function(_0xacf9fc,_0xef2834,_0x45cb81){if(_0xacf9fc[_0xf6a0('0x41')]['id']){delete _0xacf9fc[_0xf6a0('0x41')]['id'];}return db['DeskConfiguration']['findOne']({'where':{'id':_0xacf9fc[_0xf6a0('0x43')]['id']}})['then'](handleEntityNotFound(_0xef2834,null))[_0xf6a0('0x20')](function(_0x39eae6){if(_0x39eae6){return _0x39eae6[_0xf6a0('0x4c')](_0xacf9fc[_0xf6a0('0x41')][_0xf6a0('0x4d')]||[]);}return null;})[_0xf6a0('0x20')](respondWithResult(_0xef2834,null))[_0xf6a0('0x3c')](handleError(_0xef2834,null));}; \ No newline at end of file +var _0xa53d=['options','find','create','body','params','destroy','getFields','findOne','DeskField','getSubjects','getDescriptions','getTags','setTags','ids','eml-format','rimraf','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','Content-Range','reject','save','update','end','error','stack','name','send','map','DeskConfiguration','rawAttributes','query','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','type','merge','count','then','includeAll','findAll','catch','keys'];(function(_0x12f88f,_0x552290){var _0x47d8b9=function(_0x142e0d){while(--_0x142e0d){_0x12f88f['push'](_0x12f88f['shift']());}};_0x47d8b9(++_0x552290);}(_0xa53d,0xa4));var _0xda53=function(_0x3998b4,_0x319f3a){_0x3998b4=_0x3998b4-0x0;var _0x573725=_0xa53d[_0x3998b4];return _0x573725;};'use strict';var emlformat=require(_0xda53('0x0'));var rimraf=require(_0xda53('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xda53('0x2'));var Mustache=require(_0xda53('0x3'));var util=require(_0xda53('0x4'));var path=require(_0xda53('0x5'));var sox=require(_0xda53('0x6'));var csv=require(_0xda53('0x7'));var ejs=require(_0xda53('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xda53('0x9'));var squel=require(_0xda53('0xa'));var crypto=require(_0xda53('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xda53('0xc'));var toCsv=require('to-csv');var querystring=require(_0xda53('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xda53('0xe'));var qs=require(_0xda53('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xda53('0x10'));var logger=require(_0xda53('0x11'))('api');var utils=require(_0xda53('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0xda53('0x13'));var db=require(_0xda53('0x14'))['db'];function respondWithStatusCode(_0x4ccf66,_0x1d1190){_0x1d1190=_0x1d1190||0xcc;return function(_0x27e1c8){if(_0x27e1c8){return _0x4ccf66[_0xda53('0x15')](_0x1d1190);}return _0x4ccf66[_0xda53('0x16')](_0x1d1190)['end']();};}function respondWithResult(_0x553327,_0x1a7f59){_0x1a7f59=_0x1a7f59||0xc8;return function(_0x4f58a8){if(_0x4f58a8){return _0x553327[_0xda53('0x16')](_0x1a7f59)[_0xda53('0x17')](_0x4f58a8);}};}function respondWithFilteredResult(_0xd937bb,_0x4f99ff){return function(_0x5bece2){if(_0x5bece2){var _0x4f8808=typeof _0x4f99ff[_0xda53('0x18')]===_0xda53('0x19')&&typeof _0x4f99ff[_0xda53('0x1a')]===_0xda53('0x19');var _0x32c4da=_0x5bece2['count'];var _0x57227f=_0x4f8808?0x0:_0x4f99ff[_0xda53('0x18')];var _0x395b20=_0x4f8808?_0x5bece2['count']:_0x4f99ff[_0xda53('0x18')]+_0x4f99ff['limit'];var _0x501526;if(_0x395b20>=_0x32c4da){_0x395b20=_0x32c4da;_0x501526=0xc8;}else{_0x501526=0xce;}_0xd937bb[_0xda53('0x16')](_0x501526);return _0xd937bb['set'](_0xda53('0x1b'),_0x57227f+'-'+_0x395b20+'/'+_0x32c4da)['json'](_0x5bece2);}return null;};}function patchUpdates(_0x3e0148){return function(_0x2749e8){try{jsonpatch['apply'](_0x2749e8,_0x3e0148,!![]);}catch(_0x2df21f){return BPromise[_0xda53('0x1c')](_0x2df21f);}return _0x2749e8[_0xda53('0x1d')]();};}function saveUpdates(_0x3bf643,_0x236146){return function(_0x4dd4ac){if(_0x4dd4ac){return _0x4dd4ac[_0xda53('0x1e')](_0x3bf643)['then'](function(_0x4a5899){return _0x4a5899;});}return null;};}function removeEntity(_0x928560,_0x32ab4c){return function(_0x35e3ae){if(_0x35e3ae){return _0x35e3ae['destroy']()['then'](function(){_0x928560[_0xda53('0x16')](0xcc)[_0xda53('0x1f')]();});}};}function handleEntityNotFound(_0x32b52d,_0x44adb3){return function(_0x45dee3){if(!_0x45dee3){_0x32b52d[_0xda53('0x15')](0x194);}return _0x45dee3;};}function handleError(_0x3b75b3,_0x2b218a){_0x2b218a=_0x2b218a||0x1f4;return function(_0x4dec6c){logger[_0xda53('0x20')](_0x4dec6c[_0xda53('0x21')]);if(_0x4dec6c[_0xda53('0x22')]){delete _0x4dec6c[_0xda53('0x22')];}_0x3b75b3[_0xda53('0x16')](_0x2b218a)[_0xda53('0x23')](_0x4dec6c);};}exports['index']=function(_0x12d2c1,_0x58c297){var _0x26d5b4={},_0x3181f0={},_0x16a7e5={'count':0x0,'rows':[]};var _0x3410fe=_[_0xda53('0x24')](db[_0xda53('0x25')][_0xda53('0x26')],function(_0x363d8c){return{'name':_0x363d8c['fieldName'],'type':_0x363d8c['type']['key']};});_0x3181f0['model']=_[_0xda53('0x24')](_0x3410fe,_0xda53('0x22'));_0x3181f0[_0xda53('0x27')]=_['keys'](_0x12d2c1[_0xda53('0x27')]);_0x3181f0['filters']=_[_0xda53('0x28')](_0x3181f0[_0xda53('0x29')],_0x3181f0[_0xda53('0x27')]);_0x26d5b4['attributes']=_[_0xda53('0x28')](_0x3181f0[_0xda53('0x29')],qs[_0xda53('0x2a')](_0x12d2c1[_0xda53('0x27')][_0xda53('0x2a')]));_0x26d5b4[_0xda53('0x2b')]=_0x26d5b4['attributes'][_0xda53('0x2c')]?_0x26d5b4[_0xda53('0x2b')]:_0x3181f0[_0xda53('0x29')];if(!_0x12d2c1[_0xda53('0x27')][_0xda53('0x2d')](_0xda53('0x2e'))){_0x26d5b4[_0xda53('0x1a')]=qs[_0xda53('0x1a')](_0x12d2c1[_0xda53('0x27')]['limit']);_0x26d5b4[_0xda53('0x18')]=qs[_0xda53('0x18')](_0x12d2c1[_0xda53('0x27')][_0xda53('0x18')]);}_0x26d5b4[_0xda53('0x2f')]=qs[_0xda53('0x30')](_0x12d2c1['query'][_0xda53('0x30')]);_0x26d5b4['where']=qs[_0xda53('0x31')](_[_0xda53('0x32')](_0x12d2c1['query'],_0x3181f0['filters']),_0x3410fe);if(_0x12d2c1[_0xda53('0x27')][_0xda53('0x33')]){_0x26d5b4['where']=_['merge'](_0x26d5b4[_0xda53('0x34')],{'$or':_[_0xda53('0x24')](_0x3410fe,function(_0x4e64f5){if(_0x4e64f5[_0xda53('0x35')]!=='VIRTUAL'){var _0x3e11fc={};_0x3e11fc[_0x4e64f5[_0xda53('0x22')]]={'$like':'%'+_0x12d2c1[_0xda53('0x27')][_0xda53('0x33')]+'%'};return _0x3e11fc;}})});}_0x26d5b4=_[_0xda53('0x36')]({},_0x26d5b4,_0x12d2c1['options']);var _0xfaf80e={'where':_0x26d5b4['where']};return db[_0xda53('0x25')][_0xda53('0x37')](_0xfaf80e)[_0xda53('0x38')](function(_0x22d5e2){_0x16a7e5[_0xda53('0x37')]=_0x22d5e2;if(_0x12d2c1[_0xda53('0x27')][_0xda53('0x39')]){_0x26d5b4['include']=[{'all':!![]}];}return db['DeskConfiguration'][_0xda53('0x3a')](_0x26d5b4);})['then'](function(_0x14d6b8){_0x16a7e5['rows']=_0x14d6b8;return _0x16a7e5;})[_0xda53('0x38')](respondWithFilteredResult(_0x58c297,_0x26d5b4))[_0xda53('0x3b')](handleError(_0x58c297,null));};exports['show']=function(_0x1abe3b,_0x2c3819){var _0x35b9b5={'raw':![],'where':{'id':_0x1abe3b['params']['id']}},_0x2008ec={};_0x2008ec[_0xda53('0x29')]=_[_0xda53('0x3c')](db['DeskConfiguration'][_0xda53('0x26')]);_0x2008ec[_0xda53('0x27')]=_[_0xda53('0x3c')](_0x1abe3b[_0xda53('0x27')]);_0x2008ec[_0xda53('0x31')]=_['intersection'](_0x2008ec[_0xda53('0x29')],_0x2008ec['query']);_0x35b9b5[_0xda53('0x2b')]=_[_0xda53('0x28')](_0x2008ec[_0xda53('0x29')],qs[_0xda53('0x2a')](_0x1abe3b[_0xda53('0x27')][_0xda53('0x2a')]));_0x35b9b5[_0xda53('0x2b')]=_0x35b9b5['attributes'][_0xda53('0x2c')]?_0x35b9b5[_0xda53('0x2b')]:_0x2008ec[_0xda53('0x29')];if(_0x1abe3b['query']['includeAll']){_0x35b9b5['include']=[{'all':!![]}];}_0x35b9b5=_[_0xda53('0x36')]({},_0x35b9b5,_0x1abe3b[_0xda53('0x3d')]);return db[_0xda53('0x25')][_0xda53('0x3e')](_0x35b9b5)['then'](handleEntityNotFound(_0x2c3819,null))['then'](respondWithResult(_0x2c3819,null))[_0xda53('0x3b')](handleError(_0x2c3819,null));};exports[_0xda53('0x3f')]=function(_0x46b279,_0x499731){return db[_0xda53('0x25')][_0xda53('0x3f')](_0x46b279[_0xda53('0x40')],{})[_0xda53('0x38')](respondWithResult(_0x499731,0xc9))[_0xda53('0x3b')](handleError(_0x499731,null));};exports[_0xda53('0x1e')]=function(_0x520fb1,_0x37bb12){if(_0x520fb1[_0xda53('0x40')]['id']){delete _0x520fb1[_0xda53('0x40')]['id'];}return db[_0xda53('0x25')]['find']({'where':{'id':_0x520fb1[_0xda53('0x41')]['id']}})[_0xda53('0x38')](handleEntityNotFound(_0x37bb12,null))[_0xda53('0x38')](saveUpdates(_0x520fb1[_0xda53('0x40')],null))[_0xda53('0x38')](respondWithResult(_0x37bb12,null))[_0xda53('0x3b')](handleError(_0x37bb12,null));};exports[_0xda53('0x42')]=function(_0x5e090f,_0x374593){return db['DeskConfiguration'][_0xda53('0x3e')]({'where':{'id':_0x5e090f[_0xda53('0x41')]['id']}})[_0xda53('0x38')](handleEntityNotFound(_0x374593,null))[_0xda53('0x38')](removeEntity(_0x374593,null))[_0xda53('0x3b')](handleError(_0x374593,null));};exports[_0xda53('0x43')]=function(_0x5be40e,_0xd8ba48,_0x4372ee){var _0x186ba1={};var _0xc35608={};var _0x253174;var _0x2cba2c;return db['DeskConfiguration'][_0xda53('0x44')]({'where':{'id':_0x5be40e['params']['id']}})[_0xda53('0x38')](handleEntityNotFound(_0xd8ba48,null))[_0xda53('0x38')](function(_0x246328){if(_0x246328){_0x253174=_0x246328;_0xc35608['model']=_[_0xda53('0x3c')](db[_0xda53('0x45')]['rawAttributes']);_0xc35608[_0xda53('0x27')]=_[_0xda53('0x3c')](_0x5be40e[_0xda53('0x27')]);_0xc35608[_0xda53('0x31')]=_[_0xda53('0x28')](_0xc35608[_0xda53('0x29')],_0xc35608[_0xda53('0x27')]);_0x186ba1[_0xda53('0x2b')]=_[_0xda53('0x28')](_0xc35608[_0xda53('0x29')],qs['fields'](_0x5be40e[_0xda53('0x27')][_0xda53('0x2a')]));_0x186ba1[_0xda53('0x2b')]=_0x186ba1[_0xda53('0x2b')][_0xda53('0x2c')]?_0x186ba1[_0xda53('0x2b')]:_0xc35608['model'];_0x186ba1[_0xda53('0x2f')]=qs[_0xda53('0x30')](_0x5be40e[_0xda53('0x27')][_0xda53('0x30')]);_0x186ba1[_0xda53('0x34')]=qs['filters'](_[_0xda53('0x32')](_0x5be40e['query'],_0xc35608[_0xda53('0x31')]));if(_0x5be40e['query'][_0xda53('0x33')]){_0x186ba1[_0xda53('0x34')]=_['merge'](_0x186ba1['where'],{'$or':_['map'](_0x186ba1[_0xda53('0x2b')],function(_0x5ec94b){var _0x373322={};_0x373322[_0x5ec94b]={'$like':'%'+_0x5be40e[_0xda53('0x27')]['filter']+'%'};return _0x373322;})});}_0x186ba1=_[_0xda53('0x36')]({},_0x186ba1,_0x5be40e[_0xda53('0x3d')]);return _0x253174[_0xda53('0x43')](_0x186ba1);}})[_0xda53('0x38')](function(_0x57b62e){if(_0x57b62e){_0x2cba2c=_0x57b62e['length'];if(!_0x5be40e['query']['hasOwnProperty'](_0xda53('0x2e'))){_0x186ba1[_0xda53('0x1a')]=qs['limit'](_0x5be40e['query'][_0xda53('0x1a')]);_0x186ba1['offset']=qs['offset'](_0x5be40e[_0xda53('0x27')]['offset']);}return _0x253174['getFields'](_0x186ba1);}})['then'](function(_0x354a0c){if(_0x354a0c){return _0x354a0c?{'count':_0x2cba2c,'rows':_0x354a0c}:null;}})[_0xda53('0x38')](respondWithResult(_0xd8ba48,null))[_0xda53('0x3b')](handleError(_0xd8ba48,null));};exports[_0xda53('0x46')]=function(_0x4836c0,_0x395c76,_0x3a9ed9){var _0x2b874e={};var _0x45132b={};var _0x2b46f2;var _0x55884e;return db[_0xda53('0x25')][_0xda53('0x44')]({'where':{'id':_0x4836c0[_0xda53('0x41')]['id']}})[_0xda53('0x38')](handleEntityNotFound(_0x395c76,null))[_0xda53('0x38')](function(_0x18d0c2){if(_0x18d0c2){_0x2b46f2=_0x18d0c2;_0x45132b[_0xda53('0x29')]=_[_0xda53('0x3c')](db[_0xda53('0x45')][_0xda53('0x26')]);_0x45132b[_0xda53('0x27')]=_[_0xda53('0x3c')](_0x4836c0['query']);_0x45132b[_0xda53('0x31')]=_[_0xda53('0x28')](_0x45132b[_0xda53('0x29')],_0x45132b['query']);_0x2b874e['attributes']=_[_0xda53('0x28')](_0x45132b[_0xda53('0x29')],qs[_0xda53('0x2a')](_0x4836c0[_0xda53('0x27')][_0xda53('0x2a')]));_0x2b874e[_0xda53('0x2b')]=_0x2b874e[_0xda53('0x2b')]['length']?_0x2b874e[_0xda53('0x2b')]:_0x45132b[_0xda53('0x29')];_0x2b874e[_0xda53('0x2f')]=qs[_0xda53('0x30')](_0x4836c0[_0xda53('0x27')][_0xda53('0x30')]);_0x2b874e[_0xda53('0x34')]=qs[_0xda53('0x31')](_['pick'](_0x4836c0['query'],_0x45132b[_0xda53('0x31')]));if(_0x4836c0[_0xda53('0x27')][_0xda53('0x33')]){_0x2b874e[_0xda53('0x34')]=_[_0xda53('0x36')](_0x2b874e[_0xda53('0x34')],{'$or':_[_0xda53('0x24')](_0x2b874e[_0xda53('0x2b')],function(_0x4e4e1f){var _0x4cb254={};_0x4cb254[_0x4e4e1f]={'$like':'%'+_0x4836c0[_0xda53('0x27')][_0xda53('0x33')]+'%'};return _0x4cb254;})});}_0x2b874e=_[_0xda53('0x36')]({},_0x2b874e,_0x4836c0[_0xda53('0x3d')]);return _0x2b46f2[_0xda53('0x46')](_0x2b874e);}})[_0xda53('0x38')](function(_0x5be272){if(_0x5be272){_0x55884e=_0x5be272[_0xda53('0x2c')];if(!_0x4836c0[_0xda53('0x27')][_0xda53('0x2d')]('nolimit')){_0x2b874e[_0xda53('0x1a')]=qs[_0xda53('0x1a')](_0x4836c0[_0xda53('0x27')][_0xda53('0x1a')]);_0x2b874e[_0xda53('0x18')]=qs[_0xda53('0x18')](_0x4836c0[_0xda53('0x27')]['offset']);}return _0x2b46f2['getSubjects'](_0x2b874e);}})[_0xda53('0x38')](function(_0x50df73){if(_0x50df73){return _0x50df73?{'count':_0x55884e,'rows':_0x50df73}:null;}})[_0xda53('0x38')](respondWithResult(_0x395c76,null))[_0xda53('0x3b')](handleError(_0x395c76,null));};exports[_0xda53('0x47')]=function(_0xfc08b,_0x1ca68d,_0x5ce15f){var _0x2442e7={};var _0x5e5b1e={};var _0x2be12e;var _0x37c3ec;return db[_0xda53('0x25')]['findOne']({'where':{'id':_0xfc08b[_0xda53('0x41')]['id']}})[_0xda53('0x38')](handleEntityNotFound(_0x1ca68d,null))['then'](function(_0x59588a){if(_0x59588a){_0x2be12e=_0x59588a;_0x5e5b1e[_0xda53('0x29')]=_[_0xda53('0x3c')](db[_0xda53('0x45')]['rawAttributes']);_0x5e5b1e[_0xda53('0x27')]=_[_0xda53('0x3c')](_0xfc08b[_0xda53('0x27')]);_0x5e5b1e[_0xda53('0x31')]=_[_0xda53('0x28')](_0x5e5b1e['model'],_0x5e5b1e[_0xda53('0x27')]);_0x2442e7[_0xda53('0x2b')]=_['intersection'](_0x5e5b1e[_0xda53('0x29')],qs[_0xda53('0x2a')](_0xfc08b[_0xda53('0x27')][_0xda53('0x2a')]));_0x2442e7[_0xda53('0x2b')]=_0x2442e7[_0xda53('0x2b')][_0xda53('0x2c')]?_0x2442e7['attributes']:_0x5e5b1e['model'];_0x2442e7[_0xda53('0x2f')]=qs['sort'](_0xfc08b[_0xda53('0x27')][_0xda53('0x30')]);_0x2442e7[_0xda53('0x34')]=qs[_0xda53('0x31')](_[_0xda53('0x32')](_0xfc08b[_0xda53('0x27')],_0x5e5b1e[_0xda53('0x31')]));if(_0xfc08b[_0xda53('0x27')][_0xda53('0x33')]){_0x2442e7[_0xda53('0x34')]=_[_0xda53('0x36')](_0x2442e7[_0xda53('0x34')],{'$or':_[_0xda53('0x24')](_0x2442e7[_0xda53('0x2b')],function(_0x29b1cb){var _0xdb3a0b={};_0xdb3a0b[_0x29b1cb]={'$like':'%'+_0xfc08b[_0xda53('0x27')]['filter']+'%'};return _0xdb3a0b;})});}_0x2442e7=_[_0xda53('0x36')]({},_0x2442e7,_0xfc08b[_0xda53('0x3d')]);return _0x2be12e[_0xda53('0x47')](_0x2442e7);}})[_0xda53('0x38')](function(_0x5e0fea){if(_0x5e0fea){_0x37c3ec=_0x5e0fea[_0xda53('0x2c')];if(!_0xfc08b[_0xda53('0x27')][_0xda53('0x2d')](_0xda53('0x2e'))){_0x2442e7[_0xda53('0x1a')]=qs[_0xda53('0x1a')](_0xfc08b[_0xda53('0x27')]['limit']);_0x2442e7[_0xda53('0x18')]=qs[_0xda53('0x18')](_0xfc08b[_0xda53('0x27')][_0xda53('0x18')]);}return _0x2be12e[_0xda53('0x47')](_0x2442e7);}})['then'](function(_0x1c7df5){if(_0x1c7df5){return _0x1c7df5?{'count':_0x37c3ec,'rows':_0x1c7df5}:null;}})[_0xda53('0x38')](respondWithResult(_0x1ca68d,null))[_0xda53('0x3b')](handleError(_0x1ca68d,null));};exports[_0xda53('0x48')]=function(_0x8245f4,_0x55cd3a,_0xb2bb8c){var _0xe0cf08={};var _0x3e1439={};var _0x1d0cea;var _0x5de1c4;return db['DeskConfiguration']['findOne']({'where':{'id':_0x8245f4['params']['id']}})['then'](handleEntityNotFound(_0x55cd3a,null))[_0xda53('0x38')](function(_0x7b6278){if(_0x7b6278){_0x1d0cea=_0x7b6278;_0x3e1439[_0xda53('0x29')]=_['keys'](db['Tag']['rawAttributes']);_0x3e1439[_0xda53('0x27')]=_['keys'](_0x8245f4['query']);_0x3e1439['filters']=_['intersection'](_0x3e1439[_0xda53('0x29')],_0x3e1439[_0xda53('0x27')]);_0xe0cf08[_0xda53('0x2b')]=_[_0xda53('0x28')](_0x3e1439[_0xda53('0x29')],qs[_0xda53('0x2a')](_0x8245f4[_0xda53('0x27')][_0xda53('0x2a')]));_0xe0cf08[_0xda53('0x2b')]=_0xe0cf08[_0xda53('0x2b')][_0xda53('0x2c')]?_0xe0cf08['attributes']:_0x3e1439[_0xda53('0x29')];_0xe0cf08[_0xda53('0x2f')]=qs[_0xda53('0x30')](_0x8245f4['query'][_0xda53('0x30')]);_0xe0cf08[_0xda53('0x34')]=qs[_0xda53('0x31')](_[_0xda53('0x32')](_0x8245f4[_0xda53('0x27')],_0x3e1439[_0xda53('0x31')]));if(_0x8245f4[_0xda53('0x27')][_0xda53('0x33')]){_0xe0cf08[_0xda53('0x34')]=_[_0xda53('0x36')](_0xe0cf08[_0xda53('0x34')],{'$or':_['map'](_0xe0cf08[_0xda53('0x2b')],function(_0x26dfb6){var _0x16e2f3={};_0x16e2f3[_0x26dfb6]={'$like':'%'+_0x8245f4['query']['filter']+'%'};return _0x16e2f3;})});}_0xe0cf08=_[_0xda53('0x36')]({},_0xe0cf08,_0x8245f4[_0xda53('0x3d')]);return _0x1d0cea['getTags'](_0xe0cf08);}})['then'](function(_0x45ee9e){if(_0x45ee9e){_0x5de1c4=_0x45ee9e['length'];if(!_0x8245f4[_0xda53('0x27')]['hasOwnProperty']('nolimit')){_0xe0cf08[_0xda53('0x1a')]=qs[_0xda53('0x1a')](_0x8245f4[_0xda53('0x27')][_0xda53('0x1a')]);_0xe0cf08[_0xda53('0x18')]=qs[_0xda53('0x18')](_0x8245f4[_0xda53('0x27')][_0xda53('0x18')]);}return _0x1d0cea[_0xda53('0x48')](_0xe0cf08);}})[_0xda53('0x38')](function(_0x460dd7){if(_0x460dd7){return _0x460dd7?{'count':_0x5de1c4,'rows':_0x460dd7}:null;}})['then'](respondWithResult(_0x55cd3a,null))[_0xda53('0x3b')](handleError(_0x55cd3a,null));};exports[_0xda53('0x49')]=function(_0x5c3e9c,_0x451fee,_0x46d95a){if(_0x5c3e9c[_0xda53('0x40')]['id']){delete _0x5c3e9c[_0xda53('0x40')]['id'];}return db['DeskConfiguration']['findOne']({'where':{'id':_0x5c3e9c[_0xda53('0x41')]['id']}})[_0xda53('0x38')](handleEntityNotFound(_0x451fee,null))['then'](function(_0x5207e4){if(_0x5207e4){return _0x5207e4['setTags'](_0x5c3e9c[_0xda53('0x40')][_0xda53('0x4a')]||[]);}return null;})[_0xda53('0x38')](respondWithResult(_0x451fee,null))[_0xda53('0x3b')](handleError(_0x451fee,null));}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.model.js b/server/api/intDeskConfiguration/intDeskConfiguration.model.js index 388365d..7996bf6 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 _0x8ee5=['int_desk_configurations','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','define'];(function(_0x5f08a6,_0x400121){var _0x5d0641=function(_0x304467){while(--_0x304467){_0x5f08a6['push'](_0x5f08a6['shift']());}};_0x5d0641(++_0x400121);}(_0x8ee5,0xbc));var _0x58ee=function(_0x149802,_0x37fe1a){_0x149802=_0x149802-0x0;var _0x29cb48=_0x8ee5[_0x149802];return _0x29cb48;};'use strict';var _=require(_0x58ee('0x0'));var util=require(_0x58ee('0x1'));var logger=require(_0x58ee('0x2'))(_0x58ee('0x3'));var moment=require(_0x58ee('0x4'));var BPromise=require(_0x58ee('0x5'));var rp=require(_0x58ee('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x58ee('0x7'));var config=require(_0x58ee('0x8'));var attributes=require('./intDeskConfiguration.attributes');module['exports']=function(_0x506c67,_0x25758f){return _0x506c67[_0x58ee('0x9')]('DeskConfiguration',attributes,{'tableName':_0x58ee('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5e3e=['../../config/environment','./intDeskConfiguration.attributes','exports','define','int_desk_configurations','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf'];(function(_0x13b8f3,_0x442821){var _0x1a6d06=function(_0x5126f2){while(--_0x5126f2){_0x13b8f3['push'](_0x13b8f3['shift']());}};_0x1a6d06(++_0x442821);}(_0x5e3e,0x123));var _0xe5e3=function(_0x178ca4,_0x5aaa16){_0x178ca4=_0x178ca4-0x0;var _0x57f6a8=_0x5e3e[_0x178ca4];return _0x57f6a8;};'use strict';var _=require(_0xe5e3('0x0'));var util=require(_0xe5e3('0x1'));var logger=require(_0xe5e3('0x2'))(_0xe5e3('0x3'));var moment=require(_0xe5e3('0x4'));var BPromise=require('bluebird');var rp=require(_0xe5e3('0x5'));var fs=require('fs');var path=require(_0xe5e3('0x6'));var rimraf=require(_0xe5e3('0x7'));var config=require(_0xe5e3('0x8'));var attributes=require(_0xe5e3('0x9'));module[_0xe5e3('0xa')]=function(_0x1d8739,_0x105b6c){return _0x1d8739[_0xe5e3('0xb')]('DeskConfiguration',attributes,{'tableName':_0xe5e3('0xc'),'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 bd2418d..50cd355 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 _0xfed7=['result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','info','DeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message'];(function(_0x169200,_0x42aab1){var _0x28e864=function(_0x5e89ca){while(--_0x5e89ca){_0x169200['push'](_0x169200['shift']());}};_0x28e864(++_0x42aab1);}(_0xfed7,0x190));var _0x7fed=function(_0x2715cf,_0x517bb2){_0x2715cf=_0x2715cf-0x0;var _0x1bdcb8=_0xfed7[_0x2715cf];return _0x1bdcb8;};'use strict';var _=require(_0x7fed('0x0'));var util=require(_0x7fed('0x1'));var moment=require(_0x7fed('0x2'));var BPromise=require(_0x7fed('0x3'));var rs=require(_0x7fed('0x4'));var fs=require('fs');var Redis=require(_0x7fed('0x5'));var db=require(_0x7fed('0x6'))['db'];var utils=require(_0x7fed('0x7'));var logger=require(_0x7fed('0x8'))(_0x7fed('0x9'));var config=require('../../config/environment');var jayson=require(_0x7fed('0xa'));var client=jayson[_0x7fed('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5eeb9f,_0x42415f,_0x14fb65){return new BPromise(function(_0x1ebaad,_0x1a62bb){return client[_0x7fed('0xc')](_0x5eeb9f,_0x14fb65)['then'](function(_0x15a895){logger[_0x7fed('0xd')](_0x7fed('0xe'),_0x42415f,_0x7fed('0xf'));logger[_0x7fed('0x10')]('DeskConfiguration,\x20%s,\x20%s,\x20%s',_0x42415f,_0x7fed('0xf'),JSON[_0x7fed('0x11')](_0x15a895));if(_0x15a895[_0x7fed('0x12')]){if(_0x15a895['error']['code']===0x1f4){logger['error']('DeskConfiguration,\x20%s,\x20%s',_0x42415f,_0x15a895[_0x7fed('0x12')][_0x7fed('0x13')]);return _0x1a62bb(_0x15a895[_0x7fed('0x12')][_0x7fed('0x13')]);}logger[_0x7fed('0x12')]('DeskConfiguration,\x20%s,\x20%s',_0x42415f,_0x15a895[_0x7fed('0x12')][_0x7fed('0x13')]);return _0x1ebaad(_0x15a895[_0x7fed('0x12')][_0x7fed('0x13')]);}else{logger['info']('DeskConfiguration,\x20%s,\x20%s',_0x42415f,_0x7fed('0xf'));_0x1ebaad(_0x15a895[_0x7fed('0x14')]['message']);}})['catch'](function(_0x32a10b){logger[_0x7fed('0x12')](_0x7fed('0xe'),_0x42415f,_0x32a10b);_0x1a62bb(_0x32a10b);});});} \ No newline at end of file +var _0x29f1=['info','request\x20sent','debug','stringify','error','code','DeskConfiguration,\x20%s,\x20%s','message','result','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x1a0c59,_0x3b4dcc){var _0xed67c9=function(_0x247698){while(--_0x247698){_0x1a0c59['push'](_0x1a0c59['shift']());}};_0xed67c9(++_0x3b4dcc);}(_0x29f1,0x195));var _0x129f=function(_0x4ac4e3,_0x18247b){_0x4ac4e3=_0x4ac4e3-0x0;var _0x40d88b=_0x29f1[_0x4ac4e3];return _0x40d88b;};'use strict';var _=require('lodash');var util=require(_0x129f('0x0'));var moment=require('moment');var BPromise=require(_0x129f('0x1'));var rs=require(_0x129f('0x2'));var fs=require('fs');var Redis=require(_0x129f('0x3'));var db=require(_0x129f('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x129f('0x5'))(_0x129f('0x6'));var config=require(_0x129f('0x7'));var jayson=require(_0x129f('0x8'));var client=jayson[_0x129f('0x9')][_0x129f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x364841,_0x16e416,_0x27e5ee){return new BPromise(function(_0x4ceb6d,_0x4a94cf){return client[_0x129f('0xb')](_0x364841,_0x27e5ee)[_0x129f('0xc')](function(_0x3bfdf7){logger[_0x129f('0xd')]('DeskConfiguration,\x20%s,\x20%s',_0x16e416,_0x129f('0xe'));logger[_0x129f('0xf')]('DeskConfiguration,\x20%s,\x20%s,\x20%s',_0x16e416,_0x129f('0xe'),JSON[_0x129f('0x10')](_0x3bfdf7));if(_0x3bfdf7['error']){if(_0x3bfdf7[_0x129f('0x11')][_0x129f('0x12')]===0x1f4){logger[_0x129f('0x11')](_0x129f('0x13'),_0x16e416,_0x3bfdf7[_0x129f('0x11')][_0x129f('0x14')]);return _0x4a94cf(_0x3bfdf7['error'][_0x129f('0x14')]);}logger['error'](_0x129f('0x13'),_0x16e416,_0x3bfdf7['error'][_0x129f('0x14')]);return _0x4ceb6d(_0x3bfdf7[_0x129f('0x11')][_0x129f('0x14')]);}else{logger[_0x129f('0xd')](_0x129f('0x13'),_0x16e416,'request\x20sent');_0x4ceb6d(_0x3bfdf7[_0x129f('0x15')]['message']);}})['catch'](function(_0x5028a3){logger[_0x129f('0x11')](_0x129f('0x13'),_0x16e416,_0x5028a3);_0x4a94cf(_0x5028a3);});});} \ No newline at end of file diff --git a/server/api/intDeskField/index.js b/server/api/intDeskField/index.js index 819609f..e4ed3de 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 _0x8863=['put','update','destroy','util','path','connect-timeout','express','../../config/environment','./intDeskField.controller','isAuthenticated','index','/:id','show','post','create'];(function(_0x33fcbb,_0x291d0f){var _0x2efe40=function(_0x2e9442){while(--_0x2e9442){_0x33fcbb['push'](_0x33fcbb['shift']());}};_0x2efe40(++_0x291d0f);}(_0x8863,0x1b6));var _0x3886=function(_0x14fdb2,_0x2c8741){_0x14fdb2=_0x14fdb2-0x0;var _0x1afe6c=_0x8863[_0x14fdb2];return _0x1afe6c;};'use strict';var multer=require('multer');var util=require(_0x3886('0x0'));var path=require(_0x3886('0x1'));var timeout=require(_0x3886('0x2'));var express=require(_0x3886('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x3886('0x4'));var controller=require(_0x3886('0x5'));router['get']('/',auth[_0x3886('0x6')](),controller[_0x3886('0x7')]);router['get'](_0x3886('0x8'),auth[_0x3886('0x6')](),controller[_0x3886('0x9')]);router[_0x3886('0xa')]('/',auth['isAuthenticated'](),controller[_0x3886('0xb')]);router[_0x3886('0xc')](_0x3886('0x8'),auth[_0x3886('0x6')](),controller[_0x3886('0xd')]);router['delete'](_0x3886('0x8'),auth[_0x3886('0x6')](),controller[_0x3886('0xe')]);module['exports']=router; \ No newline at end of file +var _0xd9eb=['../../components/interaction/service','../../config/environment','./intDeskField.controller','get','isAuthenticated','/:id','show','post','create','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x5d33d5,_0x41ae02){var _0x1fea86=function(_0x21ae3c){while(--_0x21ae3c){_0x5d33d5['push'](_0x5d33d5['shift']());}};_0x1fea86(++_0x41ae02);}(_0xd9eb,0xca));var _0xbd9e=function(_0x1a20ec,_0x27626c){_0x1a20ec=_0x1a20ec-0x0;var _0x3a2ec1=_0xd9eb[_0x1a20ec];return _0x3a2ec1;};'use strict';var multer=require(_0xbd9e('0x0'));var util=require(_0xbd9e('0x1'));var path=require(_0xbd9e('0x2'));var timeout=require(_0xbd9e('0x3'));var express=require(_0xbd9e('0x4'));var router=express[_0xbd9e('0x5')]();var fs_extra=require(_0xbd9e('0x6'));var auth=require(_0xbd9e('0x7'));var interaction=require(_0xbd9e('0x8'));var config=require(_0xbd9e('0x9'));var controller=require(_0xbd9e('0xa'));router[_0xbd9e('0xb')]('/',auth[_0xbd9e('0xc')](),controller['index']);router[_0xbd9e('0xb')](_0xbd9e('0xd'),auth[_0xbd9e('0xc')](),controller[_0xbd9e('0xe')]);router[_0xbd9e('0xf')]('/',auth[_0xbd9e('0xc')](),controller[_0xbd9e('0x10')]);router[_0xbd9e('0x11')](_0xbd9e('0xd'),auth[_0xbd9e('0xc')](),controller[_0xbd9e('0x12')]);router[_0xbd9e('0x13')]('/:id',auth[_0xbd9e('0xc')](),controller[_0xbd9e('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.attributes.js b/server/api/intDeskField/intDeskField.attributes.js index 3ed9a72..7b03632 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 _0xa8dd=['ENUM','customVariable','BOOLEAN','sequelize','exports','string','variable','keyValue','picklist','STRING'];(function(_0x4070f3,_0x35d7bb){var _0x1f9f66=function(_0x29241c){while(--_0x29241c){_0x4070f3['push'](_0x4070f3['shift']());}};_0x1f9f66(++_0x35d7bb);}(_0xa8dd,0x1ed));var _0xda8d=function(_0x4aa348,_0x1659bd){_0x4aa348=_0x4aa348-0x0;var _0x3d1670=_0xa8dd[_0x4aa348];return _0x3d1670;};'use strict';var Sequelize=require(_0xda8d('0x0'));module[_0xda8d('0x1')]={'type':{'type':Sequelize['ENUM'](_0xda8d('0x2'),_0xda8d('0x3'),'customVariable',_0xda8d('0x4'),_0xda8d('0x5')),'defaultValue':_0xda8d('0x2')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xda8d('0x6')]},'keyType':{'type':Sequelize[_0xda8d('0x7')](_0xda8d('0x2'),_0xda8d('0x3'),_0xda8d('0x8'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0xda8d('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xda8d('0x6')]}}; \ No newline at end of file +var _0xfe59=['keyValue','picklist','STRING','customVariable','BOOLEAN','sequelize','exports','ENUM','string','variable'];(function(_0x5dd3f4,_0x4d9ae4){var _0x5abc91=function(_0x454e39){while(--_0x454e39){_0x5dd3f4['push'](_0x5dd3f4['shift']());}};_0x5abc91(++_0x4d9ae4);}(_0xfe59,0x91));var _0x9fe5=function(_0x428c62,_0x59ec56){_0x428c62=_0x428c62-0x0;var _0x40431c=_0xfe59[_0x428c62];return _0x40431c;};'use strict';var Sequelize=require(_0x9fe5('0x0'));module[_0x9fe5('0x1')]={'type':{'type':Sequelize[_0x9fe5('0x2')](_0x9fe5('0x3'),_0x9fe5('0x4'),'customVariable',_0x9fe5('0x5'),_0x9fe5('0x6')),'defaultValue':_0x9fe5('0x3')},'content':{'type':Sequelize[_0x9fe5('0x7')]},'key':{'type':Sequelize[_0x9fe5('0x7')]},'keyType':{'type':Sequelize['ENUM'](_0x9fe5('0x3'),'variable',_0x9fe5('0x8'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x9fe5('0x7')]},'nameField':{'type':Sequelize[_0x9fe5('0x7')]},'customField':{'type':Sequelize[_0x9fe5('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x9fe5('0x7')]}}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.controller.js b/server/api/intDeskField/intDeskField.controller.js index ce64051..c380d26 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 _0xd9ce=['intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','includeAll','include','rows','rawAttributes','find','create','body','catch','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','limit','undefined','count','set','reject','save','update','then','error','stack','name','send','index','map','DeskField','fieldName','type','key','model','query','keys','filters','attributes'];(function(_0x1f95ff,_0x5617a6){var _0x2706db=function(_0x48cabd){while(--_0x48cabd){_0x1f95ff['push'](_0x1f95ff['shift']());}};_0x2706db(++_0x5617a6);}(_0xd9ce,0xeb));var _0xed9c=function(_0xae1364,_0x44863f){_0xae1364=_0xae1364-0x0;var _0x55104f=_0xd9ce[_0xae1364];return _0x55104f;};'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('util');var path=require(_0xed9c('0x8'));var sox=require(_0xed9c('0x9'));var csv=require(_0xed9c('0xa'));var ejs=require(_0xed9c('0xb'));var fs=require('fs');var fs_extra=require(_0xed9c('0xc'));var _=require(_0xed9c('0xd'));var squel=require('squel');var crypto=require(_0xed9c('0xe'));var jsforce=require(_0xed9c('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xed9c('0x10'));var Papa=require('papaparse');var Redis=require(_0xed9c('0x11'));var authService=require(_0xed9c('0x12'));var qs=require(_0xed9c('0x13'));var as=require(_0xed9c('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xed9c('0x15'))(_0xed9c('0x16'));var utils=require(_0xed9c('0x17'));var config=require(_0xed9c('0x18'));var licenseUtil=require(_0xed9c('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x52be22,_0x88a8f9){_0x88a8f9=_0x88a8f9||0xcc;return function(_0x2153be){if(_0x2153be){return _0x52be22[_0xed9c('0x1a')](_0x88a8f9);}return _0x52be22[_0xed9c('0x1b')](_0x88a8f9)['end']();};}function respondWithResult(_0x5a5d8d,_0x99a5ee){_0x99a5ee=_0x99a5ee||0xc8;return function(_0x50a934){if(_0x50a934){return _0x5a5d8d[_0xed9c('0x1b')](_0x99a5ee)[_0xed9c('0x1c')](_0x50a934);}};}function respondWithFilteredResult(_0x95f79,_0x3fd63e){return function(_0x737656){if(_0x737656){var _0x22a28d=typeof _0x3fd63e[_0xed9c('0x1d')]==='undefined'&&typeof _0x3fd63e[_0xed9c('0x1e')]===_0xed9c('0x1f');var _0x2d45d9=_0x737656['count'];var _0x485029=_0x22a28d?0x0:_0x3fd63e[_0xed9c('0x1d')];var _0x48b7b4=_0x22a28d?_0x737656[_0xed9c('0x20')]:_0x3fd63e[_0xed9c('0x1d')]+_0x3fd63e[_0xed9c('0x1e')];var _0x2d432e;if(_0x48b7b4>=_0x2d45d9){_0x48b7b4=_0x2d45d9;_0x2d432e=0xc8;}else{_0x2d432e=0xce;}_0x95f79[_0xed9c('0x1b')](_0x2d432e);return _0x95f79[_0xed9c('0x21')]('Content-Range',_0x485029+'-'+_0x48b7b4+'/'+_0x2d45d9)[_0xed9c('0x1c')](_0x737656);}return null;};}function patchUpdates(_0x32c67e){return function(_0x45dc96){try{jsonpatch['apply'](_0x45dc96,_0x32c67e,!![]);}catch(_0x129c5f){return BPromise[_0xed9c('0x22')](_0x129c5f);}return _0x45dc96[_0xed9c('0x23')]();};}function saveUpdates(_0xd5bac1,_0x55ef58){return function(_0x538a70){if(_0x538a70){return _0x538a70[_0xed9c('0x24')](_0xd5bac1)[_0xed9c('0x25')](function(_0xc7a92a){return _0xc7a92a;});}return null;};}function removeEntity(_0x2ae3ce,_0x1fd75d){return function(_0x340c6){if(_0x340c6){return _0x340c6['destroy']()[_0xed9c('0x25')](function(){_0x2ae3ce['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x495055,_0x4855b0){return function(_0xc02cd5){if(!_0xc02cd5){_0x495055[_0xed9c('0x1a')](0x194);}return _0xc02cd5;};}function handleError(_0x1536b3,_0x4f1a3f){_0x4f1a3f=_0x4f1a3f||0x1f4;return function(_0x2a1fac){logger[_0xed9c('0x26')](_0x2a1fac[_0xed9c('0x27')]);if(_0x2a1fac['name']){delete _0x2a1fac[_0xed9c('0x28')];}_0x1536b3[_0xed9c('0x1b')](_0x4f1a3f)[_0xed9c('0x29')](_0x2a1fac);};}exports[_0xed9c('0x2a')]=function(_0x548eab,_0x15d6e7){var _0x48dae4={},_0x42c134={},_0x438a31={'count':0x0,'rows':[]};var _0x16c27c=_[_0xed9c('0x2b')](db[_0xed9c('0x2c')]['rawAttributes'],function(_0x55d27e){return{'name':_0x55d27e[_0xed9c('0x2d')],'type':_0x55d27e[_0xed9c('0x2e')][_0xed9c('0x2f')]};});_0x42c134[_0xed9c('0x30')]=_['map'](_0x16c27c,_0xed9c('0x28'));_0x42c134[_0xed9c('0x31')]=_[_0xed9c('0x32')](_0x548eab[_0xed9c('0x31')]);_0x42c134[_0xed9c('0x33')]=_['intersection'](_0x42c134[_0xed9c('0x30')],_0x42c134['query']);_0x48dae4[_0xed9c('0x34')]=_[_0xed9c('0x35')](_0x42c134[_0xed9c('0x30')],qs[_0xed9c('0x36')](_0x548eab[_0xed9c('0x31')][_0xed9c('0x36')]));_0x48dae4[_0xed9c('0x34')]=_0x48dae4[_0xed9c('0x34')][_0xed9c('0x37')]?_0x48dae4[_0xed9c('0x34')]:_0x42c134[_0xed9c('0x30')];if(!_0x548eab[_0xed9c('0x31')][_0xed9c('0x38')](_0xed9c('0x39'))){_0x48dae4[_0xed9c('0x1e')]=qs[_0xed9c('0x1e')](_0x548eab['query'][_0xed9c('0x1e')]);_0x48dae4[_0xed9c('0x1d')]=qs[_0xed9c('0x1d')](_0x548eab[_0xed9c('0x31')]['offset']);}_0x48dae4[_0xed9c('0x3a')]=qs[_0xed9c('0x3b')](_0x548eab[_0xed9c('0x31')][_0xed9c('0x3b')]);_0x48dae4[_0xed9c('0x3c')]=qs[_0xed9c('0x33')](_[_0xed9c('0x3d')](_0x548eab[_0xed9c('0x31')],_0x42c134[_0xed9c('0x33')]),_0x16c27c);if(_0x548eab[_0xed9c('0x31')]['filter']){_0x48dae4['where']=_[_0xed9c('0x3e')](_0x48dae4[_0xed9c('0x3c')],{'$or':_[_0xed9c('0x2b')](_0x16c27c,function(_0x503b02){if(_0x503b02[_0xed9c('0x2e')]!=='VIRTUAL'){var _0x4ee934={};_0x4ee934[_0x503b02[_0xed9c('0x28')]]={'$like':'%'+_0x548eab['query']['filter']+'%'};return _0x4ee934;}})});}_0x48dae4=_[_0xed9c('0x3e')]({},_0x48dae4,_0x548eab['options']);var _0x2aef00={'where':_0x48dae4['where']};return db[_0xed9c('0x2c')]['count'](_0x2aef00)[_0xed9c('0x25')](function(_0x19e151){_0x438a31[_0xed9c('0x20')]=_0x19e151;if(_0x548eab[_0xed9c('0x31')][_0xed9c('0x3f')]){_0x48dae4[_0xed9c('0x40')]=[{'all':!![]}];}return db[_0xed9c('0x2c')]['findAll'](_0x48dae4);})[_0xed9c('0x25')](function(_0x18918f){_0x438a31[_0xed9c('0x41')]=_0x18918f;return _0x438a31;})['then'](respondWithFilteredResult(_0x15d6e7,_0x48dae4))['catch'](handleError(_0x15d6e7,null));};exports['show']=function(_0x4f07f5,_0x1c6188){var _0x46cde2={'raw':!![],'where':{'id':_0x4f07f5['params']['id']}},_0x30894d={};_0x30894d['model']=_[_0xed9c('0x32')](db[_0xed9c('0x2c')][_0xed9c('0x42')]);_0x30894d[_0xed9c('0x31')]=_[_0xed9c('0x32')](_0x4f07f5[_0xed9c('0x31')]);_0x30894d[_0xed9c('0x33')]=_[_0xed9c('0x35')](_0x30894d[_0xed9c('0x30')],_0x30894d[_0xed9c('0x31')]);_0x46cde2[_0xed9c('0x34')]=_[_0xed9c('0x35')](_0x30894d[_0xed9c('0x30')],qs['fields'](_0x4f07f5['query']['fields']));_0x46cde2['attributes']=_0x46cde2[_0xed9c('0x34')][_0xed9c('0x37')]?_0x46cde2[_0xed9c('0x34')]:_0x30894d[_0xed9c('0x30')];if(_0x4f07f5[_0xed9c('0x31')][_0xed9c('0x3f')]){_0x46cde2[_0xed9c('0x40')]=[{'all':!![]}];}_0x46cde2=_['merge']({},_0x46cde2,_0x4f07f5['options']);return db[_0xed9c('0x2c')][_0xed9c('0x43')](_0x46cde2)['then'](handleEntityNotFound(_0x1c6188,null))[_0xed9c('0x25')](respondWithResult(_0x1c6188,null))['catch'](handleError(_0x1c6188,null));};exports[_0xed9c('0x44')]=function(_0x39d420,_0xbb0ef6){return db[_0xed9c('0x2c')]['create'](_0x39d420[_0xed9c('0x45')],{})[_0xed9c('0x25')](respondWithResult(_0xbb0ef6,0xc9))[_0xed9c('0x46')](handleError(_0xbb0ef6,null));};exports[_0xed9c('0x24')]=function(_0x4b488e,_0x108c46){if(_0x4b488e['body']['id']){delete _0x4b488e['body']['id'];}return db[_0xed9c('0x2c')][_0xed9c('0x43')]({'where':{'id':_0x4b488e['params']['id']}})[_0xed9c('0x25')](handleEntityNotFound(_0x108c46,null))[_0xed9c('0x25')](saveUpdates(_0x4b488e['body'],null))[_0xed9c('0x25')](respondWithResult(_0x108c46,null))[_0xed9c('0x46')](handleError(_0x108c46,null));};exports['destroy']=function(_0x4f304a,_0x22033a){return db[_0xed9c('0x2c')][_0xed9c('0x43')]({'where':{'id':_0x4f304a[_0xed9c('0x47')]['id']}})[_0xed9c('0x25')](handleEntityNotFound(_0x22033a,null))[_0xed9c('0x25')](removeEntity(_0x22033a,null))[_0xed9c('0x46')](handleError(_0x22033a,null));}; \ No newline at end of file +var _0xc9c3=['options','includeAll','include','rows','catch','show','params','find','create','body','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','count','set','apply','reject','update','then','destroy','end','sendStatus','error','stack','name','index','DeskField','rawAttributes','fieldName','key','model','map','query','keys','filters','attributes','intersection','fields','length','nolimit','limit','sort','pick','filter','where','merge'];(function(_0x243b59,_0x3f9495){var _0x3e1676=function(_0x354052){while(--_0x354052){_0x243b59['push'](_0x243b59['shift']());}};_0x3e1676(++_0x3f9495);}(_0xc9c3,0x96));var _0x3c9c=function(_0x65ec60,_0x5b7b7f){_0x65ec60=_0x65ec60-0x0;var _0x2d1fc1=_0xc9c3[_0x65ec60];return _0x2d1fc1;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x3c9c('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3c9c('0x1'));var moment=require(_0x3c9c('0x2'));var BPromise=require(_0x3c9c('0x3'));var Mustache=require(_0x3c9c('0x4'));var util=require(_0x3c9c('0x5'));var path=require(_0x3c9c('0x6'));var sox=require(_0x3c9c('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3c9c('0x8'));var squel=require(_0x3c9c('0x9'));var crypto=require(_0x3c9c('0xa'));var jsforce=require(_0x3c9c('0xb'));var deskjs=require(_0x3c9c('0xc'));var toCsv=require(_0x3c9c('0xd'));var querystring=require(_0x3c9c('0xe'));var Papa=require(_0x3c9c('0xf'));var Redis=require(_0x3c9c('0x10'));var authService=require(_0x3c9c('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x3c9c('0x12'));var hardwareService=require(_0x3c9c('0x13'));var logger=require('../../config/logger')(_0x3c9c('0x14'));var utils=require('../../config/utils');var config=require(_0x3c9c('0x15'));var licenseUtil=require(_0x3c9c('0x16'));var db=require(_0x3c9c('0x17'))['db'];function respondWithStatusCode(_0x3f464d,_0x4a17ed){_0x4a17ed=_0x4a17ed||0xcc;return function(_0x50cf96){if(_0x50cf96){return _0x3f464d['sendStatus'](_0x4a17ed);}return _0x3f464d[_0x3c9c('0x18')](_0x4a17ed)['end']();};}function respondWithResult(_0x5e8c0e,_0x53b3ca){_0x53b3ca=_0x53b3ca||0xc8;return function(_0x22c495){if(_0x22c495){return _0x5e8c0e['status'](_0x53b3ca)[_0x3c9c('0x19')](_0x22c495);}};}function respondWithFilteredResult(_0xf16337,_0x1f725b){return function(_0x824e63){if(_0x824e63){var _0x4a43d2=typeof _0x1f725b[_0x3c9c('0x1a')]==='undefined'&&typeof _0x1f725b['limit']==='undefined';var _0x3200a3=_0x824e63[_0x3c9c('0x1b')];var _0x216fd8=_0x4a43d2?0x0:_0x1f725b[_0x3c9c('0x1a')];var _0x3e63e0=_0x4a43d2?_0x824e63[_0x3c9c('0x1b')]:_0x1f725b[_0x3c9c('0x1a')]+_0x1f725b['limit'];var _0x15a90a;if(_0x3e63e0>=_0x3200a3){_0x3e63e0=_0x3200a3;_0x15a90a=0xc8;}else{_0x15a90a=0xce;}_0xf16337['status'](_0x15a90a);return _0xf16337[_0x3c9c('0x1c')]('Content-Range',_0x216fd8+'-'+_0x3e63e0+'/'+_0x3200a3)[_0x3c9c('0x19')](_0x824e63);}return null;};}function patchUpdates(_0x1152d5){return function(_0x5f51fb){try{jsonpatch[_0x3c9c('0x1d')](_0x5f51fb,_0x1152d5,!![]);}catch(_0x29e4ac){return BPromise[_0x3c9c('0x1e')](_0x29e4ac);}return _0x5f51fb['save']();};}function saveUpdates(_0x3faad1,_0x249747){return function(_0x2d5ffc){if(_0x2d5ffc){return _0x2d5ffc[_0x3c9c('0x1f')](_0x3faad1)[_0x3c9c('0x20')](function(_0x3bc5c4){return _0x3bc5c4;});}return null;};}function removeEntity(_0x338c2d,_0x32e4c2){return function(_0x509bf7){if(_0x509bf7){return _0x509bf7[_0x3c9c('0x21')]()['then'](function(){_0x338c2d[_0x3c9c('0x18')](0xcc)[_0x3c9c('0x22')]();});}};}function handleEntityNotFound(_0x4ca078,_0x527bb9){return function(_0x379880){if(!_0x379880){_0x4ca078[_0x3c9c('0x23')](0x194);}return _0x379880;};}function handleError(_0x1b57ec,_0x43d1f0){_0x43d1f0=_0x43d1f0||0x1f4;return function(_0x4c283d){logger[_0x3c9c('0x24')](_0x4c283d[_0x3c9c('0x25')]);if(_0x4c283d['name']){delete _0x4c283d[_0x3c9c('0x26')];}_0x1b57ec['status'](_0x43d1f0)['send'](_0x4c283d);};}exports[_0x3c9c('0x27')]=function(_0x39ea8d,_0x333f2b){var _0x248de1={},_0x7bdf33={},_0x5da4e9={'count':0x0,'rows':[]};var _0x18eebd=_['map'](db[_0x3c9c('0x28')][_0x3c9c('0x29')],function(_0x4a0644){return{'name':_0x4a0644[_0x3c9c('0x2a')],'type':_0x4a0644['type'][_0x3c9c('0x2b')]};});_0x7bdf33[_0x3c9c('0x2c')]=_[_0x3c9c('0x2d')](_0x18eebd,_0x3c9c('0x26'));_0x7bdf33[_0x3c9c('0x2e')]=_[_0x3c9c('0x2f')](_0x39ea8d[_0x3c9c('0x2e')]);_0x7bdf33[_0x3c9c('0x30')]=_['intersection'](_0x7bdf33[_0x3c9c('0x2c')],_0x7bdf33[_0x3c9c('0x2e')]);_0x248de1[_0x3c9c('0x31')]=_[_0x3c9c('0x32')](_0x7bdf33[_0x3c9c('0x2c')],qs[_0x3c9c('0x33')](_0x39ea8d[_0x3c9c('0x2e')][_0x3c9c('0x33')]));_0x248de1[_0x3c9c('0x31')]=_0x248de1[_0x3c9c('0x31')][_0x3c9c('0x34')]?_0x248de1[_0x3c9c('0x31')]:_0x7bdf33[_0x3c9c('0x2c')];if(!_0x39ea8d[_0x3c9c('0x2e')]['hasOwnProperty'](_0x3c9c('0x35'))){_0x248de1[_0x3c9c('0x36')]=qs[_0x3c9c('0x36')](_0x39ea8d['query'][_0x3c9c('0x36')]);_0x248de1[_0x3c9c('0x1a')]=qs[_0x3c9c('0x1a')](_0x39ea8d[_0x3c9c('0x2e')]['offset']);}_0x248de1['order']=qs[_0x3c9c('0x37')](_0x39ea8d[_0x3c9c('0x2e')][_0x3c9c('0x37')]);_0x248de1['where']=qs['filters'](_[_0x3c9c('0x38')](_0x39ea8d['query'],_0x7bdf33['filters']),_0x18eebd);if(_0x39ea8d[_0x3c9c('0x2e')][_0x3c9c('0x39')]){_0x248de1[_0x3c9c('0x3a')]=_['merge'](_0x248de1[_0x3c9c('0x3a')],{'$or':_[_0x3c9c('0x2d')](_0x18eebd,function(_0x4024aa){if(_0x4024aa['type']!=='VIRTUAL'){var _0x4826d3={};_0x4826d3[_0x4024aa[_0x3c9c('0x26')]]={'$like':'%'+_0x39ea8d[_0x3c9c('0x2e')][_0x3c9c('0x39')]+'%'};return _0x4826d3;}})});}_0x248de1=_[_0x3c9c('0x3b')]({},_0x248de1,_0x39ea8d[_0x3c9c('0x3c')]);var _0x1125ff={'where':_0x248de1['where']};return db['DeskField'][_0x3c9c('0x1b')](_0x1125ff)[_0x3c9c('0x20')](function(_0xe23844){_0x5da4e9['count']=_0xe23844;if(_0x39ea8d[_0x3c9c('0x2e')][_0x3c9c('0x3d')]){_0x248de1[_0x3c9c('0x3e')]=[{'all':!![]}];}return db['DeskField']['findAll'](_0x248de1);})[_0x3c9c('0x20')](function(_0xdbac2a){_0x5da4e9[_0x3c9c('0x3f')]=_0xdbac2a;return _0x5da4e9;})['then'](respondWithFilteredResult(_0x333f2b,_0x248de1))[_0x3c9c('0x40')](handleError(_0x333f2b,null));};exports[_0x3c9c('0x41')]=function(_0xd81ea4,_0x3dbfc7){var _0x5be9a3={'raw':!![],'where':{'id':_0xd81ea4[_0x3c9c('0x42')]['id']}},_0x412a21={};_0x412a21['model']=_['keys'](db[_0x3c9c('0x28')][_0x3c9c('0x29')]);_0x412a21['query']=_[_0x3c9c('0x2f')](_0xd81ea4[_0x3c9c('0x2e')]);_0x412a21[_0x3c9c('0x30')]=_[_0x3c9c('0x32')](_0x412a21[_0x3c9c('0x2c')],_0x412a21[_0x3c9c('0x2e')]);_0x5be9a3['attributes']=_[_0x3c9c('0x32')](_0x412a21[_0x3c9c('0x2c')],qs[_0x3c9c('0x33')](_0xd81ea4[_0x3c9c('0x2e')][_0x3c9c('0x33')]));_0x5be9a3['attributes']=_0x5be9a3['attributes'][_0x3c9c('0x34')]?_0x5be9a3[_0x3c9c('0x31')]:_0x412a21[_0x3c9c('0x2c')];if(_0xd81ea4[_0x3c9c('0x2e')][_0x3c9c('0x3d')]){_0x5be9a3['include']=[{'all':!![]}];}_0x5be9a3=_[_0x3c9c('0x3b')]({},_0x5be9a3,_0xd81ea4[_0x3c9c('0x3c')]);return db[_0x3c9c('0x28')][_0x3c9c('0x43')](_0x5be9a3)[_0x3c9c('0x20')](handleEntityNotFound(_0x3dbfc7,null))['then'](respondWithResult(_0x3dbfc7,null))[_0x3c9c('0x40')](handleError(_0x3dbfc7,null));};exports[_0x3c9c('0x44')]=function(_0x1804e3,_0x24b1f0){return db[_0x3c9c('0x28')][_0x3c9c('0x44')](_0x1804e3[_0x3c9c('0x45')],{})['then'](respondWithResult(_0x24b1f0,0xc9))[_0x3c9c('0x40')](handleError(_0x24b1f0,null));};exports[_0x3c9c('0x1f')]=function(_0xbcf5fb,_0x278f77){if(_0xbcf5fb[_0x3c9c('0x45')]['id']){delete _0xbcf5fb[_0x3c9c('0x45')]['id'];}return db['DeskField'][_0x3c9c('0x43')]({'where':{'id':_0xbcf5fb[_0x3c9c('0x42')]['id']}})[_0x3c9c('0x20')](handleEntityNotFound(_0x278f77,null))[_0x3c9c('0x20')](saveUpdates(_0xbcf5fb[_0x3c9c('0x45')],null))[_0x3c9c('0x20')](respondWithResult(_0x278f77,null))[_0x3c9c('0x40')](handleError(_0x278f77,null));};exports[_0x3c9c('0x21')]=function(_0xb62338,_0x31e63d){return db[_0x3c9c('0x28')][_0x3c9c('0x43')]({'where':{'id':_0xb62338[_0x3c9c('0x42')]['id']}})[_0x3c9c('0x20')](handleEntityNotFound(_0x31e63d,null))[_0x3c9c('0x20')](removeEntity(_0x31e63d,null))[_0x3c9c('0x40')](handleError(_0x31e63d,null));}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.model.js b/server/api/intDeskField/intDeskField.model.js index 73447c1..a06df70 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 _0x86b2=['FieldId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./intDeskField.attributes','exports','DeskField','int_desk_fields','desk_unique_index','idField'];(function(_0x5714e0,_0xbf4ccd){var _0x348053=function(_0x32e904){while(--_0x32e904){_0x5714e0['push'](_0x5714e0['shift']());}};_0x348053(++_0xbf4ccd);}(_0x86b2,0x181));var _0x286b=function(_0x1a36a5,_0x746928){_0x1a36a5=_0x1a36a5-0x0;var _0x746243=_0x86b2[_0x1a36a5];return _0x746243;};'use strict';var _=require(_0x286b('0x0'));var util=require(_0x286b('0x1'));var logger=require(_0x286b('0x2'))(_0x286b('0x3'));var moment=require(_0x286b('0x4'));var BPromise=require(_0x286b('0x5'));var rp=require(_0x286b('0x6'));var fs=require('fs');var path=require(_0x286b('0x7'));var rimraf=require(_0x286b('0x8'));var config=require('../../config/environment');var attributes=require(_0x286b('0x9'));module[_0x286b('0xa')]=function(_0x454ba1,_0x42bef6){return _0x454ba1['define'](_0x286b('0xb'),attributes,{'tableName':_0x286b('0xc'),'paranoid':![],'indexes':[{'name':_0x286b('0xd'),'fields':[_0x286b('0xe'),_0x286b('0xf')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x8a3f=['int_desk_fields','desk_unique_index','idField','FieldId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./intDeskField.attributes','exports','DeskField'];(function(_0x51046d,_0x57e4e0){var _0x37050b=function(_0x21066c){while(--_0x21066c){_0x51046d['push'](_0x51046d['shift']());}};_0x37050b(++_0x57e4e0);}(_0x8a3f,0x144));var _0xf8a3=function(_0x5e2f7b,_0x2af342){_0x5e2f7b=_0x5e2f7b-0x0;var _0x3c6584=_0x8a3f[_0x5e2f7b];return _0x3c6584;};'use strict';var _=require(_0xf8a3('0x0'));var util=require(_0xf8a3('0x1'));var logger=require(_0xf8a3('0x2'))(_0xf8a3('0x3'));var moment=require(_0xf8a3('0x4'));var BPromise=require(_0xf8a3('0x5'));var rp=require(_0xf8a3('0x6'));var fs=require('fs');var path=require(_0xf8a3('0x7'));var rimraf=require('rimraf');var config=require(_0xf8a3('0x8'));var attributes=require(_0xf8a3('0x9'));module[_0xf8a3('0xa')]=function(_0x4cea56,_0x4e4c5f){return _0x4cea56['define'](_0xf8a3('0xb'),attributes,{'tableName':_0xf8a3('0xc'),'paranoid':![],'indexes':[{'name':_0xf8a3('0xd'),'fields':[_0xf8a3('0xe'),_0xf8a3('0xf')],'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 0bade64..ef38db0 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 _0x29ec=['debug','DeskField,\x20%s,\x20%s,\x20%s','stringify','error','DeskField,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','request\x20sent'];(function(_0x5a3cf0,_0x160a68){var _0x5a64ee=function(_0x34cd1d){while(--_0x34cd1d){_0x5a3cf0['push'](_0x5a3cf0['shift']());}};_0x5a64ee(++_0x160a68);}(_0x29ec,0xa9));var _0xc29e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x29ec[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xc29e('0x0'));var util=require(_0xc29e('0x1'));var moment=require(_0xc29e('0x2'));var BPromise=require(_0xc29e('0x3'));var rs=require(_0xc29e('0x4'));var fs=require('fs');var Redis=require(_0xc29e('0x5'));var db=require(_0xc29e('0x6'))['db'];var utils=require(_0xc29e('0x7'));var logger=require(_0xc29e('0x8'))(_0xc29e('0x9'));var config=require(_0xc29e('0xa'));var jayson=require('jayson/promise');var client=jayson[_0xc29e('0xb')][_0xc29e('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3a25f8,_0xf265c4,_0x40892b){return new BPromise(function(_0x120bb5,_0x57490e){return client[_0xc29e('0xd')](_0x3a25f8,_0x40892b)['then'](function(_0x11d254){logger['info']('DeskField,\x20%s,\x20%s',_0xf265c4,_0xc29e('0xe'));logger[_0xc29e('0xf')](_0xc29e('0x10'),_0xf265c4,_0xc29e('0xe'),JSON[_0xc29e('0x11')](_0x11d254));if(_0x11d254[_0xc29e('0x12')]){if(_0x11d254[_0xc29e('0x12')]['code']===0x1f4){logger['error'](_0xc29e('0x13'),_0xf265c4,_0x11d254[_0xc29e('0x12')]['message']);return _0x57490e(_0x11d254[_0xc29e('0x12')][_0xc29e('0x14')]);}logger[_0xc29e('0x12')](_0xc29e('0x13'),_0xf265c4,_0x11d254[_0xc29e('0x12')][_0xc29e('0x14')]);return _0x120bb5(_0x11d254[_0xc29e('0x12')][_0xc29e('0x14')]);}else{logger['info']('DeskField,\x20%s,\x20%s',_0xf265c4,_0xc29e('0xe'));_0x120bb5(_0x11d254[_0xc29e('0x15')][_0xc29e('0x14')]);}})[_0xc29e('0x16')](function(_0x2e9831){logger[_0xc29e('0x12')]('DeskField,\x20%s,\x20%s',_0xf265c4,_0x2e9831);_0x57490e(_0x2e9831);});});} \ No newline at end of file +var _0x2e53=['../../config/environment','client','request','then','info','DeskField,\x20%s,\x20%s','debug','DeskField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','rpc'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x2e53,0xeb));var _0x32e5=function(_0x3cb152,_0x57eb54){_0x3cb152=_0x3cb152-0x0;var _0x4f54c3=_0x2e53[_0x3cb152];return _0x4f54c3;};'use strict';var _=require(_0x32e5('0x0'));var util=require(_0x32e5('0x1'));var moment=require('moment');var BPromise=require(_0x32e5('0x2'));var rs=require(_0x32e5('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x32e5('0x4'))['db'];var utils=require(_0x32e5('0x5'));var logger=require('../../config/logger')(_0x32e5('0x6'));var config=require(_0x32e5('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x32e5('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3d0411,_0x42e8a9,_0x4d683f){return new BPromise(function(_0x5dcce2,_0x5a4548){return client[_0x32e5('0x9')](_0x3d0411,_0x4d683f)[_0x32e5('0xa')](function(_0x305348){logger[_0x32e5('0xb')](_0x32e5('0xc'),_0x42e8a9,'request\x20sent');logger[_0x32e5('0xd')](_0x32e5('0xe'),_0x42e8a9,_0x32e5('0xf'),JSON[_0x32e5('0x10')](_0x305348));if(_0x305348[_0x32e5('0x11')]){if(_0x305348[_0x32e5('0x11')][_0x32e5('0x12')]===0x1f4){logger[_0x32e5('0x11')]('DeskField,\x20%s,\x20%s',_0x42e8a9,_0x305348['error']['message']);return _0x5a4548(_0x305348[_0x32e5('0x11')]['message']);}logger[_0x32e5('0x11')](_0x32e5('0xc'),_0x42e8a9,_0x305348[_0x32e5('0x11')][_0x32e5('0x13')]);return _0x5dcce2(_0x305348['error'][_0x32e5('0x13')]);}else{logger[_0x32e5('0xb')](_0x32e5('0xc'),_0x42e8a9,_0x32e5('0xf'));_0x5dcce2(_0x305348[_0x32e5('0x14')]['message']);}})[_0x32e5('0x15')](function(_0x7bf337){logger[_0x32e5('0x11')](_0x32e5('0xc'),_0x42e8a9,_0x7bf337);_0x5a4548(_0x7bf337);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/index.js b/server/api/intDynamics365Account/index.js index 434da75..aeec6e3 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 _0xcc19=['../../config/environment','./intDynamics365Account.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','delete','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x4ed4d2,_0x47acf7){var _0x15ae2e=function(_0x3199f0){while(--_0x3199f0){_0x4ed4d2['push'](_0x4ed4d2['shift']());}};_0x15ae2e(++_0x47acf7);}(_0xcc19,0x1c5));var _0x9cc1=function(_0x3cdbc7,_0x2a7cb3){_0x3cdbc7=_0x3cdbc7-0x0;var _0x422d20=_0xcc19[_0x3cdbc7];return _0x422d20;};'use strict';var multer=require(_0x9cc1('0x0'));var util=require('util');var path=require(_0x9cc1('0x1'));var timeout=require(_0x9cc1('0x2'));var express=require(_0x9cc1('0x3'));var router=express['Router']();var fs_extra=require(_0x9cc1('0x4'));var auth=require(_0x9cc1('0x5'));var interaction=require(_0x9cc1('0x6'));var config=require(_0x9cc1('0x7'));var controller=require(_0x9cc1('0x8'));router[_0x9cc1('0x9')]('/',auth[_0x9cc1('0xa')](),controller[_0x9cc1('0xb')]);router[_0x9cc1('0x9')](_0x9cc1('0xc'),auth[_0x9cc1('0xa')](),controller[_0x9cc1('0xd')]);router[_0x9cc1('0x9')](_0x9cc1('0xe'),auth[_0x9cc1('0xa')](),controller[_0x9cc1('0xf')]);router['get'](_0x9cc1('0x10'),auth['isAuthenticated'](),controller[_0x9cc1('0x11')]);router[_0x9cc1('0x12')]('/',auth[_0x9cc1('0xa')](),controller[_0x9cc1('0x13')]);router[_0x9cc1('0x12')](_0x9cc1('0xe'),auth[_0x9cc1('0xa')](),controller[_0x9cc1('0x14')]);router['put'](_0x9cc1('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x9cc1('0x15')](_0x9cc1('0xc'),auth[_0x9cc1('0xa')](),controller['destroy']);module[_0x9cc1('0x16')]=router; \ No newline at end of file +var _0x8a3a=['index','get','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','addConfiguration','put','delete','destroy','exports','util','path','express','../../components/auth/service','./intDynamics365Account.controller','isAuthenticated'];(function(_0x1c5142,_0x30ea72){var _0x1268cb=function(_0xaa2299){while(--_0xaa2299){_0x1c5142['push'](_0x1c5142['shift']());}};_0x1268cb(++_0x30ea72);}(_0x8a3a,0x86));var _0xa8a3=function(_0x24273c,_0x3cf515){_0x24273c=_0x24273c-0x0;var _0x10beb4=_0x8a3a[_0x24273c];return _0x10beb4;};'use strict';var multer=require('multer');var util=require(_0xa8a3('0x0'));var path=require(_0xa8a3('0x1'));var timeout=require('connect-timeout');var express=require(_0xa8a3('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xa8a3('0x3'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xa8a3('0x4'));router['get']('/',auth[_0xa8a3('0x5')](),controller[_0xa8a3('0x6')]);router[_0xa8a3('0x7')](_0xa8a3('0x8'),auth[_0xa8a3('0x5')](),controller[_0xa8a3('0x9')]);router[_0xa8a3('0x7')](_0xa8a3('0xa'),auth['isAuthenticated'](),controller[_0xa8a3('0xb')]);router[_0xa8a3('0x7')](_0xa8a3('0xc'),auth['isAuthenticated'](),controller[_0xa8a3('0xd')]);router[_0xa8a3('0xe')]('/',auth[_0xa8a3('0x5')](),controller['create']);router['post']('/:id/configurations',auth['isAuthenticated'](),controller[_0xa8a3('0xf')]);router[_0xa8a3('0x10')](_0xa8a3('0x8'),auth[_0xa8a3('0x5')](),controller['update']);router[_0xa8a3('0x11')]('/:id',auth[_0xa8a3('0x5')](),controller[_0xa8a3('0x12')]);module[_0xa8a3('0x13')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.attributes.js b/server/api/intDynamics365Account/intDynamics365Account.attributes.js index bb1aa1c..081bc22 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 _0x425d=['sequelize','STRING','BOOLEAN'];(function(_0x4fde08,_0x463a36){var _0x12e725=function(_0x2670c5){while(--_0x2670c5){_0x4fde08['push'](_0x4fde08['shift']());}};_0x12e725(++_0x463a36);}(_0x425d,0x1e0));var _0xd425=function(_0x1291b3,_0x54cc6b){_0x1291b3=_0x1291b3-0x0;var _0x48645f=_0x425d[_0x1291b3];return _0x48645f;};'use strict';var Sequelize=require(_0xd425('0x0'));module['exports']={'name':{'type':Sequelize[_0xd425('0x1')]},'username':{'type':Sequelize[_0xd425('0x1')]},'password':{'type':Sequelize[_0xd425('0x1')]},'remoteUri':{'type':Sequelize[_0xd425('0x1')]},'tenantId':{'type':Sequelize[_0xd425('0x1')]},'clientId':{'type':Sequelize[_0xd425('0x1')]},'clientSecret':{'type':Sequelize[_0xd425('0x1')]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xd425('0x1')]},'modernAuthentication':{'type':Sequelize[_0xd425('0x2')],'defaultValue':!![]}}; \ No newline at end of file +var _0xa566=['exports','STRING','sequelize'];(function(_0x4b10e5,_0x4395d1){var _0x529f70=function(_0x1b2e3b){while(--_0x1b2e3b){_0x4b10e5['push'](_0x4b10e5['shift']());}};_0x529f70(++_0x4395d1);}(_0xa566,0x1c1));var _0x6a56=function(_0x5c6a07,_0x2c396b){_0x5c6a07=_0x5c6a07-0x0;var _0x338ff7=_0xa566[_0x5c6a07];return _0x338ff7;};'use strict';var Sequelize=require(_0x6a56('0x0'));module[_0x6a56('0x1')]={'name':{'type':Sequelize[_0x6a56('0x2')]},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0x6a56('0x2')]},'remoteUri':{'type':Sequelize[_0x6a56('0x2')]},'tenantId':{'type':Sequelize[_0x6a56('0x2')]},'clientId':{'type':Sequelize[_0x6a56('0x2')]},'clientSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0x6a56('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'modernAuthentication':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.controller.js b/server/api/intDynamics365Account/intDynamics365Account.controller.js index 42708e3..f8dcf22 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 _0xf446=['parentcaseidname','primarycontactidname','prioritycodename','responseby','responsiblecontactidname','responsiblecontactidyominame','slaname','statecode','statuscode','subjectidname','timezoneruleversionnumber','transactioncurrencyidname','utcconversiontimezonecode','versionnumber','concat','password','remoteUri','tenantId','clientId','clientSecret','modernAuthentication','CloudProvider','data5','data7','POST','/oauth2/token','username','access_token','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','Bearer\x20','value','MetadataId','GET','EntityDefinitions(','4.0','Attributes','includes','LogicalName','@odata.type','PicklistAttributeMetadata','push','all','isNil','lastIndexOf','BooleanAttributeMetadata','forEach','StringAttributeMetadata','DoubleAttributeMetadata','BigIntAttributeMetadata','DateTimeAttributeMetadata','EntityNameAttributeMetadata','test','statusCode','error','Wrong\x20credentials',')/Attributes(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','OptionSet','Options','Label','UserLocalizedLabel','DisplayName',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','TrueOption','true','FalseOption','false',')/Microsoft.Dynamics.CRM.','?$select=DisplayName,LogicalName','util','lodash','../../components/parsers/qs','../../config/logger','api','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','stack','name','send','index','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','sort','where','pick','merge','filter','options','Dynamics365Account','includeAll','include','rows','catch','params','length','find','create','body','getConfigurations','findOne','Dynamics365Configuration','order','addConfiguration','AccountId','Subjects','getSubjects','channel','getDescriptions','Dynamics365Field','Descriptions','slice','substring','%s/api/data/v9.0/','ticketType','incident','Incident','PhoneCall','description','customerid','ownerid','caseorigincode','regardingobjectid','accountidname','accountidyominame','contactidname','contactidyominame','createdbyexternalpartyname','createdbyexternalpartyyominame','createdbyname','createdbyyominame','createdon','createdonbehalfbyname','createdonbehalfbyyominame','customeridname','customeridtype','customeridyominame','emailaddress','entitlementidname','entityimage_timestamp','entityimage_url','escalatedon','firstresponsebykpiidname','followupby','importsequencenumber','influencescore','kbarticleidname','masteridname','modifiedbyexternalpartyname','modifiedbyexternalpartyyominame','modifiedbyname','modifiedbyyominame','modifiedon','modifiedonbehalfbyname','modifiedonbehalfbyyominame','msdyn_incidenttypename','msdyn_iotalertname','numberofchildincidents','onholdtime','owneridname','owneridtype','owneridyominame'];(function(_0x286f26,_0x2f09c7){var _0x1d2c0d=function(_0x5951ba){while(--_0x5951ba){_0x286f26['push'](_0x286f26['shift']());}};_0x1d2c0d(++_0x2f09c7);}(_0xf446,0xfd));var _0x6f44=function(_0x438bed,_0xb68dd7){_0x438bed=_0x438bed-0x0;var _0x87f65a=_0xf446[_0x438bed];return _0x87f65a;};'use strict';var rp=require('request-promise');var util=require(_0x6f44('0x0'));var _=require(_0x6f44('0x1'));var qs=require(_0x6f44('0x2'));var logger=require(_0x6f44('0x3'))(_0x6f44('0x4'));var db=require(_0x6f44('0x5'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithResult(_0x5796f4,_0x3b3a59){_0x3b3a59=_0x3b3a59||0xc8;return function(_0x548b38){if(_0x548b38){return _0x5796f4[_0x6f44('0x6')](_0x3b3a59)[_0x6f44('0x7')](_0x548b38);}};}function respondWithFilteredResult(_0x212dd5,_0x496943){return function(_0x1d9d3a){if(_0x1d9d3a){var _0x4a7c16=typeof _0x496943[_0x6f44('0x8')]===_0x6f44('0x9')&&typeof _0x496943[_0x6f44('0xa')]===_0x6f44('0x9');var _0xc1d8fd=_0x1d9d3a[_0x6f44('0xb')];var _0x54e8e5=_0x4a7c16?0x0:_0x496943['offset'];var _0xe218e4=_0x4a7c16?_0x1d9d3a[_0x6f44('0xb')]:_0x496943[_0x6f44('0x8')]+_0x496943[_0x6f44('0xa')];var _0x4d5957;if(_0xe218e4>=_0xc1d8fd){_0xe218e4=_0xc1d8fd;_0x4d5957=0xc8;}else{_0x4d5957=0xce;}_0x212dd5[_0x6f44('0x6')](_0x4d5957);return _0x212dd5[_0x6f44('0xc')](_0x6f44('0xd'),_0x54e8e5+'-'+_0xe218e4+'/'+_0xc1d8fd)[_0x6f44('0x7')](_0x1d9d3a);}return null;};}function saveUpdates(_0x3979af){return function(_0x1b2e74){if(_0x1b2e74){return _0x1b2e74[_0x6f44('0xe')](_0x3979af)[_0x6f44('0xf')](function(_0x47f98e){return _0x47f98e;});}return null;};}function removeEntity(_0x3ca6ce){return function(_0x8a340e){if(_0x8a340e){return _0x8a340e[_0x6f44('0x10')]()['then'](function(){_0x3ca6ce['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x19bfd3){return function(_0x58448b){if(!_0x58448b){_0x19bfd3['sendStatus'](0x194);}return _0x58448b;};}function handleError(_0x482070,_0x447bf6){_0x447bf6=_0x447bf6||0x1f4;return function(_0x5d0347){logger['error'](_0x5d0347[_0x6f44('0x11')]);if(_0x5d0347[_0x6f44('0x12')]){delete _0x5d0347[_0x6f44('0x12')];}_0x482070[_0x6f44('0x6')](_0x447bf6)[_0x6f44('0x13')](_0x5d0347);};}exports[_0x6f44('0x14')]=function(_0x2b1f2a,_0x2dadbc){var _0x36c2da={},_0xa0570c={},_0x4a001f={'count':0x0,'rows':[]};var _0x342d58=_[_0x6f44('0x15')](db['Dynamics365Account'][_0x6f44('0x16')],function(_0x35b41e){return{'name':_0x35b41e[_0x6f44('0x17')],'type':_0x35b41e[_0x6f44('0x18')]['key']};});_0xa0570c[_0x6f44('0x19')]=_['map'](_0x342d58,_0x6f44('0x12'));_0xa0570c[_0x6f44('0x1a')]=_[_0x6f44('0x1b')](_0x2b1f2a[_0x6f44('0x1a')]);_0xa0570c[_0x6f44('0x1c')]=_[_0x6f44('0x1d')](_0xa0570c[_0x6f44('0x19')],_0xa0570c[_0x6f44('0x1a')]);_0x36c2da['attributes']=_['intersection'](_0xa0570c[_0x6f44('0x19')],qs[_0x6f44('0x1e')](_0x2b1f2a[_0x6f44('0x1a')][_0x6f44('0x1e')]));_0x36c2da[_0x6f44('0x1f')]=_0x36c2da[_0x6f44('0x1f')]['length']?_0x36c2da[_0x6f44('0x1f')]:_0xa0570c[_0x6f44('0x19')];if(!_0x2b1f2a['query'][_0x6f44('0x20')](_0x6f44('0x21'))){_0x36c2da['limit']=qs['limit'](_0x2b1f2a[_0x6f44('0x1a')][_0x6f44('0xa')]);_0x36c2da['offset']=qs['offset'](_0x2b1f2a[_0x6f44('0x1a')][_0x6f44('0x8')]);}_0x36c2da['order']=qs['sort'](_0x2b1f2a['query'][_0x6f44('0x22')]);_0x36c2da[_0x6f44('0x23')]=qs[_0x6f44('0x1c')](_[_0x6f44('0x24')](_0x2b1f2a[_0x6f44('0x1a')],_0xa0570c[_0x6f44('0x1c')]),_0x342d58);if(_0x2b1f2a[_0x6f44('0x1a')]['filter']){_0x36c2da[_0x6f44('0x23')]=_[_0x6f44('0x25')](_0x36c2da[_0x6f44('0x23')],{'$or':_[_0x6f44('0x15')](_0x342d58,function(_0x1e83f1){if(_0x1e83f1[_0x6f44('0x18')]!=='VIRTUAL'){var _0x16e3e6={};_0x16e3e6[_0x1e83f1[_0x6f44('0x12')]]={'$like':'%'+_0x2b1f2a[_0x6f44('0x1a')][_0x6f44('0x26')]+'%'};return _0x16e3e6;}})});}_0x36c2da=_[_0x6f44('0x25')]({},_0x36c2da,_0x2b1f2a[_0x6f44('0x27')]);var _0x1963e8={'where':_0x36c2da['where']};return db[_0x6f44('0x28')]['count'](_0x1963e8)['then'](function(_0x4d3e42){_0x4a001f[_0x6f44('0xb')]=_0x4d3e42;if(_0x2b1f2a[_0x6f44('0x1a')][_0x6f44('0x29')]){_0x36c2da[_0x6f44('0x2a')]=[{'all':!![]}];}return db[_0x6f44('0x28')]['findAll'](_0x36c2da);})['then'](function(_0x26e209){_0x4a001f[_0x6f44('0x2b')]=_0x26e209;return _0x4a001f;})['then'](respondWithFilteredResult(_0x2dadbc,_0x36c2da))[_0x6f44('0x2c')](handleError(_0x2dadbc,null));};exports['show']=function(_0x32a8c5,_0x2b1e01){var _0x39f5c9={'raw':![],'where':{'id':_0x32a8c5[_0x6f44('0x2d')]['id']}},_0xde6331={};_0xde6331[_0x6f44('0x19')]=_[_0x6f44('0x1b')](db[_0x6f44('0x28')][_0x6f44('0x16')]);_0xde6331[_0x6f44('0x1a')]=_[_0x6f44('0x1b')](_0x32a8c5[_0x6f44('0x1a')]);_0xde6331[_0x6f44('0x1c')]=_[_0x6f44('0x1d')](_0xde6331['model'],_0xde6331[_0x6f44('0x1a')]);_0x39f5c9['attributes']=_[_0x6f44('0x1d')](_0xde6331[_0x6f44('0x19')],qs[_0x6f44('0x1e')](_0x32a8c5[_0x6f44('0x1a')]['fields']));_0x39f5c9[_0x6f44('0x1f')]=_0x39f5c9[_0x6f44('0x1f')][_0x6f44('0x2e')]?_0x39f5c9[_0x6f44('0x1f')]:_0xde6331[_0x6f44('0x19')];if(_0x32a8c5[_0x6f44('0x1a')]['includeAll']){_0x39f5c9[_0x6f44('0x2a')]=[{'all':!![]}];}_0x39f5c9=_['merge']({},_0x39f5c9,_0x32a8c5[_0x6f44('0x27')]);return db['Dynamics365Account'][_0x6f44('0x2f')](_0x39f5c9)[_0x6f44('0xf')](handleEntityNotFound(_0x2b1e01,null))[_0x6f44('0xf')](respondWithResult(_0x2b1e01,null))[_0x6f44('0x2c')](handleError(_0x2b1e01,null));};exports[_0x6f44('0x30')]=function(_0x349936,_0x574512){return db[_0x6f44('0x28')][_0x6f44('0x30')](_0x349936[_0x6f44('0x31')],{})[_0x6f44('0xf')](respondWithResult(_0x574512,0xc9))['catch'](handleError(_0x574512,null));};exports[_0x6f44('0xe')]=function(_0x1c4130,_0x24ca49){if(_0x1c4130[_0x6f44('0x31')]['id']){delete _0x1c4130[_0x6f44('0x31')]['id'];}return db[_0x6f44('0x28')][_0x6f44('0x2f')]({'where':{'id':_0x1c4130[_0x6f44('0x2d')]['id']}})['then'](handleEntityNotFound(_0x24ca49,null))[_0x6f44('0xf')](saveUpdates(_0x1c4130['body'],null))['then'](respondWithResult(_0x24ca49,null))['catch'](handleError(_0x24ca49,null));};exports[_0x6f44('0x10')]=function(_0x4c7bcc,_0x214bc8){return db[_0x6f44('0x28')][_0x6f44('0x2f')]({'where':{'id':_0x4c7bcc[_0x6f44('0x2d')]['id']}})['then'](handleEntityNotFound(_0x214bc8,null))['then'](removeEntity(_0x214bc8,null))[_0x6f44('0x2c')](handleError(_0x214bc8,null));};exports[_0x6f44('0x32')]=function(_0x28db8c,_0x496a59){var _0x16138d={};var _0x49384a={};var _0x570c61;var _0x2e2b24;return db[_0x6f44('0x28')][_0x6f44('0x33')]({'where':{'id':_0x28db8c[_0x6f44('0x2d')]['id']}})['then'](handleEntityNotFound(_0x496a59,null))[_0x6f44('0xf')](function(_0x38a46c){if(_0x38a46c){_0x570c61=_0x38a46c;_0x49384a['model']=_[_0x6f44('0x1b')](db[_0x6f44('0x34')][_0x6f44('0x16')]);_0x49384a[_0x6f44('0x1a')]=_['keys'](_0x28db8c[_0x6f44('0x1a')]);_0x49384a['filters']=_[_0x6f44('0x1d')](_0x49384a[_0x6f44('0x19')],_0x49384a[_0x6f44('0x1a')]);_0x16138d[_0x6f44('0x1f')]=_[_0x6f44('0x1d')](_0x49384a[_0x6f44('0x19')],qs[_0x6f44('0x1e')](_0x28db8c['query'][_0x6f44('0x1e')]));_0x16138d[_0x6f44('0x1f')]=_0x16138d[_0x6f44('0x1f')][_0x6f44('0x2e')]?_0x16138d[_0x6f44('0x1f')]:_0x49384a[_0x6f44('0x19')];_0x16138d[_0x6f44('0x35')]=qs[_0x6f44('0x22')](_0x28db8c['query'][_0x6f44('0x22')]);_0x16138d[_0x6f44('0x23')]=qs[_0x6f44('0x1c')](_[_0x6f44('0x24')](_0x28db8c[_0x6f44('0x1a')],_0x49384a['filters']));if(_0x28db8c[_0x6f44('0x1a')][_0x6f44('0x26')]){_0x16138d[_0x6f44('0x23')]=_['merge'](_0x16138d[_0x6f44('0x23')],{'$or':_[_0x6f44('0x15')](_0x16138d[_0x6f44('0x1f')],function(_0x5952b9){var _0x66efc4={};_0x66efc4[_0x5952b9]={'$like':'%'+_0x28db8c[_0x6f44('0x1a')][_0x6f44('0x26')]+'%'};return _0x66efc4;})});}_0x16138d=_[_0x6f44('0x25')]({},_0x16138d,_0x28db8c['options']);return _0x570c61['getConfigurations'](_0x16138d);}})[_0x6f44('0xf')](function(_0x2e634b){if(_0x2e634b){_0x2e2b24=_0x2e634b[_0x6f44('0x2e')];if(!_0x28db8c[_0x6f44('0x1a')][_0x6f44('0x20')](_0x6f44('0x21'))){_0x16138d[_0x6f44('0xa')]=qs[_0x6f44('0xa')](_0x28db8c['query'][_0x6f44('0xa')]);_0x16138d[_0x6f44('0x8')]=qs[_0x6f44('0x8')](_0x28db8c[_0x6f44('0x1a')][_0x6f44('0x8')]);}return _0x570c61[_0x6f44('0x32')](_0x16138d);}})[_0x6f44('0xf')](function(_0x415cf5){if(_0x415cf5){return _0x415cf5?{'count':_0x2e2b24,'rows':_0x415cf5}:null;}})[_0x6f44('0xf')](respondWithResult(_0x496a59,null))[_0x6f44('0x2c')](handleError(_0x496a59,null));};exports[_0x6f44('0x36')]=function(_0x5618c3,_0x312317){if(_0x5618c3[_0x6f44('0x31')]['id']){delete _0x5618c3[_0x6f44('0x31')]['id'];}return db[_0x6f44('0x28')]['findOne']({'where':{'id':_0x5618c3[_0x6f44('0x2d')]['id']}})[_0x6f44('0xf')](handleEntityNotFound(_0x312317,null))['then'](function(_0x9ff8ad){if(_0x9ff8ad){_0x5618c3[_0x6f44('0x31')][_0x6f44('0x37')]=_0x9ff8ad['id'];_0x5618c3['body'][_0x6f44('0x38')]=integrations[_0x6f44('0x39')](_0x5618c3[_0x6f44('0x31')][_0x6f44('0x3a')],_0x5618c3[_0x6f44('0x31')][_0x6f44('0x18')]);_0x5618c3['body']['Descriptions']=integrations[_0x6f44('0x3b')](_0x5618c3[_0x6f44('0x31')][_0x6f44('0x3a')],_0x5618c3[_0x6f44('0x31')]['type']);return db[_0x6f44('0x34')][_0x6f44('0x30')](_0x5618c3['body'],{'include':[{'model':db['Dynamics365Field'],'as':_0x6f44('0x38')},{'model':db[_0x6f44('0x3c')],'as':_0x6f44('0x3d')}]});}return null;})[_0x6f44('0xf')](respondWithResult(_0x312317,null))[_0x6f44('0x2c')](handleError(_0x312317,null));};function sanitizeRemoteUri(_0x32c352){var _0x29b4aa=_0x32c352[_0x6f44('0x3e')](-0x1);if(_0x29b4aa==='/')return _0x32c352[_0x6f44('0x3f')](0x0,_0x32c352['lastIndexOf'](_0x29b4aa));return _0x32c352;}function getWebApiUrl(_0x452b5c){return util['format'](_0x6f44('0x40'),_0x452b5c);}exports['getFields']=function(_0x4e76ad,_0x26dc45){var _0x4a5e67=_0x4e76ad[_0x6f44('0x1a')][_0x6f44('0x41')];var _0x256b7d=_0x4a5e67===_0x6f44('0x42')?_0x6f44('0x43'):_0x6f44('0x44');var _0x1fce18='';var _0x3dcfdc='';var _0x1b961d='';var _0x35b765='';var _0x409a15='';var _0x466d7b='';var _0x24e310='';var _0x45f37e='';var _0x1519fe=['title',_0x6f44('0x45'),_0x6f44('0x46'),_0x6f44('0x47'),_0x6f44('0x48'),'subject','phonenumber',_0x6f44('0x49'),'directioncode','phonecall_activity_parties'];var _0x2fca96=[_0x6f44('0x4a'),_0x6f44('0x4b'),'actualserviceunits','billedserviceunits',_0x6f44('0x4c'),_0x6f44('0x4d'),'contractdetailidname','contractidname',_0x6f44('0x4e'),_0x6f44('0x4f'),_0x6f44('0x50'),_0x6f44('0x51'),_0x6f44('0x52'),_0x6f44('0x53'),_0x6f44('0x54'),_0x6f44('0x55'),_0x6f44('0x56'),_0x6f44('0x57'),_0x6f44('0x58'),_0x6f44('0x59'),_0x6f44('0x5a'),_0x6f44('0x5b'),_0x6f44('0x5c'),'exchangerate',_0x6f44('0x5d'),_0x6f44('0x5e'),_0x6f44('0x5f'),_0x6f44('0x60'),_0x6f44('0x61'),'lastonholdtime',_0x6f44('0x62'),_0x6f44('0x63'),_0x6f44('0x64'),_0x6f44('0x65'),_0x6f44('0x66'),_0x6f44('0x67'),_0x6f44('0x68'),_0x6f44('0x69'),_0x6f44('0x6a'),_0x6f44('0x6b'),_0x6f44('0x6c'),_0x6f44('0x6d'),'overriddencreatedon',_0x6f44('0x6e'),_0x6f44('0x6f'),_0x6f44('0x70'),_0x6f44('0x71'),_0x6f44('0x72'),'primarycontactidyominame',_0x6f44('0x73'),'productidname','productserialnumber','resolveby','resolvebykpiidname',_0x6f44('0x74'),_0x6f44('0x75'),_0x6f44('0x76'),'sentimentvalue','slainvokedidname',_0x6f44('0x77'),'socialprofileidname',_0x6f44('0x78'),_0x6f44('0x79'),_0x6f44('0x7a'),'ticketnumber',_0x6f44('0x7b'),_0x6f44('0x7c'),'traversedpath',_0x6f44('0x7d'),_0x6f44('0x7e')];var _0x45c0fc=_0x1519fe[_0x6f44('0x7f')](_0x2fca96);return db[_0x6f44('0x28')]['findOne']({'where':{'id':_0x4e76ad[_0x6f44('0x2d')]['id']},'attributes':['id','username',_0x6f44('0x80'),_0x6f44('0x81'),_0x6f44('0x82'),_0x6f44('0x83'),_0x6f44('0x84'),_0x6f44('0x85')],'include':[{'model':db[_0x6f44('0x86')],'as':_0x6f44('0x86'),'attributes':['id',_0x6f44('0x87'),_0x6f44('0x88')]}]})[_0x6f44('0xf')](handleEntityNotFound(_0x26dc45,null))[_0x6f44('0xf')](function(_0x13fe65){if(_0x13fe65){if(_0x13fe65[_0x6f44('0x85')]){_0x13fe65['access_token']=_0x13fe65[_0x6f44('0x86')][_0x6f44('0x87')];_0x45f37e=sanitizeRemoteUri(_0x13fe65[_0x6f44('0x86')][_0x6f44('0x88')]);_0x24e310=getWebApiUrl(_0x45f37e);return _0x13fe65;}_0x45f37e=sanitizeRemoteUri(_0x13fe65[_0x6f44('0x81')]);_0x24e310=getWebApiUrl(_0x45f37e);var _0x969818={'method':_0x6f44('0x89'),'uri':'https://login.microsoftonline.com/'+_0x13fe65[_0x6f44('0x82')]+_0x6f44('0x8a'),'form':{'client_id':_0x13fe65['clientId'],'resource':_0x45f37e,'username':_0x13fe65[_0x6f44('0x8b')],'password':_0x13fe65[_0x6f44('0x80')],'grant_type':_0x6f44('0x80'),'client_secret':_0x13fe65[_0x6f44('0x84')]},'json':!![]};return rp(_0x969818);}})['then'](function(_0x560a7f){_0x466d7b=_0x560a7f[_0x6f44('0x8c')];var _0x36444f={'method':'GET','uri':encodeURI(_0x24e310+_0x6f44('0x8d')+_0x256b7d+'\x27'),'headers':{'Authorization':_0x6f44('0x8e')+_0x466d7b,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x36444f);})['then'](function(_0x47ffcf){var _0x1c739c=_0x47ffcf[_0x6f44('0x8f')][0x0];var _0x5dc335=_0x1c739c[_0x6f44('0x90')];var _0x35da33={'method':_0x6f44('0x91'),'uri':_0x24e310+_0x6f44('0x92')+_0x5dc335+')?$select=LogicalName&$expand=Attributes($select=LogicalName)','headers':{'Authorization':_0x6f44('0x8e')+_0x466d7b,'If-None-Match':null,'OData-Version':_0x6f44('0x93')},'json':!![]};return rp(_0x35da33);})[_0x6f44('0xf')](function(_0x1bf554){_0x1fce18=_0x1bf554;_0x3dcfdc=_0x1fce18[_0x6f44('0x94')];_0x3dcfdc=_['remove'](_0x3dcfdc,function(_0x241b85){return!_0x45c0fc[_0x6f44('0x95')](_0x241b85[_0x6f44('0x96')]);});var _0x1a041c=[];var _0x1c65d7=[];_0x3dcfdc['forEach'](function(_0x59c351){if(_0x59c351['@odata.type']){var _0x434cbb=_0x59c351[_0x6f44('0x97')][_0x6f44('0x3f')](_0x59c351[_0x6f44('0x97')]['lastIndexOf']('.')+0x1);if(_0x434cbb===_0x6f44('0x98')){_0x1a041c[_0x6f44('0x99')](getSelectList(_0x24e310,_0x4a5e67,_0x1c65d7,_0x1fce18[_0x6f44('0x90')],_0x59c351[_0x6f44('0x90')],_0x466d7b));}}});return Promise[_0x6f44('0x9a')](_0x1a041c);})['then'](function(_0x4a3515){_0x1b961d=_0x4a3515[0x0];var _0x4947e0=[];var _0x56bd5b=[];_0x3dcfdc['forEach'](function(_0x1aaab7){if(!_[_0x6f44('0x9b')](_0x1aaab7[_0x6f44('0x97')])){var _0x152655=_0x1aaab7[_0x6f44('0x97')][_0x6f44('0x3f')](_0x1aaab7[_0x6f44('0x97')][_0x6f44('0x9c')]('.')+0x1);if(_0x152655===_0x6f44('0x9d')){_0x4947e0[_0x6f44('0x99')](getBooleanList(_0x24e310,_0x4a5e67,_0x56bd5b,_0x1fce18[_0x6f44('0x90')],_0x1aaab7[_0x6f44('0x90')],_0x466d7b));}}});return Promise['all'](_0x4947e0);})['then'](function(_0x10620b){_0x35b765=_0x10620b[0x0];var _0x37a61a=[];var _0x1dc8f4=[];_0x3dcfdc[_0x6f44('0x9e')](function(_0xe0058b){if(_0xe0058b['@odata.type']){var _0x23bfef=_0xe0058b[_0x6f44('0x97')][_0x6f44('0x3f')](_0xe0058b['@odata.type'][_0x6f44('0x9c')]('.')+0x1);if(_0x23bfef===_0x6f44('0x9f')||_0x23bfef===_0x6f44('0xa0')||_0x23bfef===_0x6f44('0xa1')||_0x23bfef==='IntegerAttributeMetadata'||_0x23bfef==='MemoAttributeMetadata'||_0x23bfef===_0x6f44('0xa2')||_0x23bfef==='StatusAttributeMetadata'||_0x23bfef===_0x6f44('0xa3')||_0x23bfef==='StateAttributeMetadata'||_0x23bfef==='DecimalAttributeMetadata'){_0x37a61a['push'](getInputList(_0x24e310,_0x4a5e67,_0x23bfef,_0x1dc8f4,_0x1fce18['MetadataId'],_0xe0058b['MetadataId'],_0x466d7b));}}});return Promise[_0x6f44('0x9a')](_0x37a61a);})[_0x6f44('0xf')](function(_0x4786a3){_0x409a15=_0x4786a3[0x0];var _0x2f7719=_0x1b961d[_0x6f44('0x7f')](_0x35b765)[_0x6f44('0x7f')](_0x409a15);var _0x380476={'count':_0x2f7719[_0x6f44('0x2e')],'rows':_0x2f7719};return _0x380476;})[_0x6f44('0xf')](respondWithResult(_0x26dc45,null))[_0x6f44('0x2c')](function(_0x417edf){var _0x2f2a90=_0x4e76ad[_0x6f44('0x1a')][_0x6f44('0xa4')]?0x1f4:_0x417edf[_0x6f44('0xa5')]||0x1f4;logger[_0x6f44('0xa6')](_0x417edf['stack']);delete _0x417edf[_0x6f44('0x12')];if(_0x2f2a90===0x191){_0x2f2a90=0x190;}_0x26dc45[_0x6f44('0x6')](_0x2f2a90)[_0x6f44('0x13')](_0x4e76ad[_0x6f44('0x1a')][_0x6f44('0xa4')]?{'message':_0x6f44('0xa7'),'statusCode':_0x417edf[_0x6f44('0xa5')]}:_0x417edf);});};function getSelectList(_0x3826f2,_0x21c3c2,_0x2d12ad,_0x4bd9e5,_0x1ca181,_0x4d892d){var _0x176a94={'method':_0x6f44('0x91'),'uri':_0x3826f2+_0x6f44('0x92')+_0x4bd9e5+_0x6f44('0xa8')+_0x1ca181+_0x6f44('0xa9')+_0x6f44('0xaa'),'headers':{'Authorization':_0x6f44('0x8e')+_0x4d892d,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x176a94)[_0x6f44('0xf')](function(_0x225a41){var _0x60fda7=[];var _0x174274=_0x225a41[_0x6f44('0xab')][_0x6f44('0xac')];_0x174274[_0x6f44('0x9e')](function(_0x515b93){_0x60fda7[_0x6f44('0x99')]({'name':_0x515b93[_0x6f44('0xad')][_0x6f44('0xae')][_0x6f44('0xad')],'value':String(_0x515b93['Value'])});});var _0x270efc={'id':_0x21c3c2+'_'+_0x225a41['LogicalName'],'name':_0x225a41[_0x6f44('0xaf')][_0x6f44('0xae')][_0x6f44('0xad')],'custom':![],'options':_0x60fda7};_0x2d12ad['push'](_0x270efc);return _0x2d12ad;});}function getBooleanList(_0x5aa92a,_0x368605,_0x3befd2,_0x6c3517,_0x3f7122,_0x3ee0b6){var _0x46db94={'method':_0x6f44('0x91'),'uri':_0x5aa92a+'EntityDefinitions('+_0x6c3517+_0x6f44('0xa8')+_0x3f7122+_0x6f44('0xb0'),'headers':{'Authorization':'Bearer\x20'+_0x3ee0b6,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x46db94)['then'](function(_0x196397){var _0x5a3f3f=[];_0x5a3f3f[_0x6f44('0x99')]({'name':_0x196397['OptionSet'][_0x6f44('0xb1')]['Label']['UserLocalizedLabel']['Label'],'value':_0x6f44('0xb2')},{'name':_0x196397['OptionSet'][_0x6f44('0xb3')][_0x6f44('0xad')][_0x6f44('0xae')][_0x6f44('0xad')],'value':_0x6f44('0xb4')});var _0x5dc392={'id':_0x368605+'_'+_0x196397[_0x6f44('0x96')],'name':_0x196397[_0x6f44('0xaf')][_0x6f44('0xae')][_0x6f44('0xad')],'custom':![],'options':_0x5a3f3f};_0x3befd2[_0x6f44('0x99')](_0x5dc392);return _0x3befd2;});}function getInputList(_0x49dff2,_0x53d77e,_0x3f765b,_0x4c1873,_0x488db6,_0x39a03a,_0x189996){var _0x1b187f={'method':'GET','uri':_0x49dff2+_0x6f44('0x92')+_0x488db6+')/Attributes('+_0x39a03a+_0x6f44('0xb5')+_0x3f765b+_0x6f44('0xb6'),'headers':{'Authorization':_0x6f44('0x8e')+_0x189996,'If-None-Match':null,'OData-Version':_0x6f44('0x93')},'json':!![]};return rp(_0x1b187f)['then'](function(_0x5a4d45){var _0x162509={'id':_0x53d77e+'_'+_0x5a4d45[_0x6f44('0x96')],'name':_0x5a4d45[_0x6f44('0xaf')][_0x6f44('0xae')]?_0x5a4d45[_0x6f44('0xaf')][_0x6f44('0xae')][_0x6f44('0xad')]:_0x5a4d45[_0x6f44('0x96')],'custom':![],'options':[]};_0x4c1873['push'](_0x162509);return _0x4c1873;});} \ No newline at end of file +var _0xc434=['undefined','count','limit','set','update','destroy','then','end','sendStatus','error','stack','name','send','index','map','Dynamics365Account','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','type','includeAll','include','findAll','rows','show','params','rawAttributes','options','find','catch','create','body','findOne','addConfiguration','AccountId','Subjects','getDescriptions','Dynamics365Configuration','Dynamics365Field','Descriptions','slice','lastIndexOf','format','%s/api/data/v9.0/','ticketType','incident','PhoneCall','customerid','ownerid','regardingobjectid','directioncode','accountidname','accountidyominame','actualserviceunits','contactidname','contactidyominame','contractidname','createdbyexternalpartyname','createdbyexternalpartyyominame','createdbyyominame','createdon','customeridname','customeridyominame','entitlementidname','entityimage_timestamp','entityimage_url','exchangerate','firstresponsebykpiidname','followupby','importsequencenumber','kbarticleidname','lastonholdtime','masteridname','modifiedbyexternalpartyname','modifiedbyname','modifiedbyyominame','modifiedon','modifiedonbehalfbyname','modifiedonbehalfbyyominame','msdyn_incidenttypename','msdyn_iotalertname','numberofchildincidents','onholdtime','overriddencreatedon','owneridyominame','parentcaseidname','primarycontactidname','prioritycodename','productidname','productserialnumber','resolvebykpiidname','responseby','responsiblecontactidname','sentimentvalue','slaname','socialprofileidname','statecode','statuscode','ticketnumber','timezoneruleversionnumber','transactioncurrencyidname','traversedpath','utcconversiontimezonecode','versionnumber','password','tenantId','modernAuthentication','CloudProvider','data7','remoteUri','POST','https://login.microsoftonline.com/','/oauth2/token','clientId','username','clientSecret','access_token','GET','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','Bearer\x20','4.0','value','MetadataId','EntityDefinitions(',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','Attributes','remove','includes','LogicalName','forEach','@odata.type','substring','push','all','isNil','BooleanAttributeMetadata','StringAttributeMetadata','DoubleAttributeMetadata','BigIntAttributeMetadata','MemoAttributeMetadata','DateTimeAttributeMetadata','StatusAttributeMetadata','StateAttributeMetadata','DecimalAttributeMetadata','concat','test','statusCode','Wrong\x20credentials',')/Attributes(','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','OptionSet','Options','Label','Value','DisplayName','UserLocalizedLabel',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','TrueOption','true','FalseOption','false','?$select=DisplayName,LogicalName','request-promise','util','lodash','../../components/parsers/qs','../../config/logger','api','../../mysqldb','../../components/integrations/configuration','status','json','offset'];(function(_0x5a66ef,_0x32c4ec){var _0x4f2ec7=function(_0x594fa9){while(--_0x594fa9){_0x5a66ef['push'](_0x5a66ef['shift']());}};_0x4f2ec7(++_0x32c4ec);}(_0xc434,0x16b));var _0x4c43=function(_0x525c7b,_0x488fcc){_0x525c7b=_0x525c7b-0x0;var _0x27b33e=_0xc434[_0x525c7b];return _0x27b33e;};'use strict';var rp=require(_0x4c43('0x0'));var util=require(_0x4c43('0x1'));var _=require(_0x4c43('0x2'));var qs=require(_0x4c43('0x3'));var logger=require(_0x4c43('0x4'))(_0x4c43('0x5'));var db=require(_0x4c43('0x6'))['db'];var integrations=require(_0x4c43('0x7'));function respondWithResult(_0x52f1d0,_0x248703){_0x248703=_0x248703||0xc8;return function(_0x1ca0a2){if(_0x1ca0a2){return _0x52f1d0[_0x4c43('0x8')](_0x248703)[_0x4c43('0x9')](_0x1ca0a2);}};}function respondWithFilteredResult(_0x20c8af,_0x38f781){return function(_0x7864b4){if(_0x7864b4){var _0x1b974e=typeof _0x38f781[_0x4c43('0xa')]===_0x4c43('0xb')&&typeof _0x38f781['limit']===_0x4c43('0xb');var _0x3b6b7d=_0x7864b4[_0x4c43('0xc')];var _0x4fb2fc=_0x1b974e?0x0:_0x38f781[_0x4c43('0xa')];var _0x23b930=_0x1b974e?_0x7864b4[_0x4c43('0xc')]:_0x38f781[_0x4c43('0xa')]+_0x38f781[_0x4c43('0xd')];var _0x39acf3;if(_0x23b930>=_0x3b6b7d){_0x23b930=_0x3b6b7d;_0x39acf3=0xc8;}else{_0x39acf3=0xce;}_0x20c8af[_0x4c43('0x8')](_0x39acf3);return _0x20c8af[_0x4c43('0xe')]('Content-Range',_0x4fb2fc+'-'+_0x23b930+'/'+_0x3b6b7d)[_0x4c43('0x9')](_0x7864b4);}return null;};}function saveUpdates(_0x56b866){return function(_0x55827f){if(_0x55827f){return _0x55827f[_0x4c43('0xf')](_0x56b866)['then'](function(_0x36fe0b){return _0x36fe0b;});}return null;};}function removeEntity(_0x300614){return function(_0x127c45){if(_0x127c45){return _0x127c45[_0x4c43('0x10')]()[_0x4c43('0x11')](function(){_0x300614['status'](0xcc)[_0x4c43('0x12')]();});}};}function handleEntityNotFound(_0x56627d){return function(_0x134040){if(!_0x134040){_0x56627d[_0x4c43('0x13')](0x194);}return _0x134040;};}function handleError(_0xd93120,_0x23d4a2){_0x23d4a2=_0x23d4a2||0x1f4;return function(_0x7380da){logger[_0x4c43('0x14')](_0x7380da[_0x4c43('0x15')]);if(_0x7380da[_0x4c43('0x16')]){delete _0x7380da[_0x4c43('0x16')];}_0xd93120[_0x4c43('0x8')](_0x23d4a2)[_0x4c43('0x17')](_0x7380da);};}exports[_0x4c43('0x18')]=function(_0xec8eb3,_0x52713e){var _0x5940c0={},_0x53f51d={},_0x196e83={'count':0x0,'rows':[]};var _0x55de93=_[_0x4c43('0x19')](db[_0x4c43('0x1a')]['rawAttributes'],function(_0x123c90){return{'name':_0x123c90['fieldName'],'type':_0x123c90['type'][_0x4c43('0x1b')]};});_0x53f51d['model']=_[_0x4c43('0x19')](_0x55de93,'name');_0x53f51d[_0x4c43('0x1c')]=_[_0x4c43('0x1d')](_0xec8eb3[_0x4c43('0x1c')]);_0x53f51d['filters']=_[_0x4c43('0x1e')](_0x53f51d[_0x4c43('0x1f')],_0x53f51d[_0x4c43('0x1c')]);_0x5940c0[_0x4c43('0x20')]=_[_0x4c43('0x1e')](_0x53f51d['model'],qs[_0x4c43('0x21')](_0xec8eb3[_0x4c43('0x1c')][_0x4c43('0x21')]));_0x5940c0[_0x4c43('0x20')]=_0x5940c0[_0x4c43('0x20')][_0x4c43('0x22')]?_0x5940c0['attributes']:_0x53f51d[_0x4c43('0x1f')];if(!_0xec8eb3[_0x4c43('0x1c')][_0x4c43('0x23')](_0x4c43('0x24'))){_0x5940c0['limit']=qs[_0x4c43('0xd')](_0xec8eb3[_0x4c43('0x1c')][_0x4c43('0xd')]);_0x5940c0[_0x4c43('0xa')]=qs[_0x4c43('0xa')](_0xec8eb3[_0x4c43('0x1c')]['offset']);}_0x5940c0[_0x4c43('0x25')]=qs[_0x4c43('0x26')](_0xec8eb3[_0x4c43('0x1c')][_0x4c43('0x26')]);_0x5940c0[_0x4c43('0x27')]=qs[_0x4c43('0x28')](_[_0x4c43('0x29')](_0xec8eb3[_0x4c43('0x1c')],_0x53f51d['filters']),_0x55de93);if(_0xec8eb3[_0x4c43('0x1c')][_0x4c43('0x2a')]){_0x5940c0[_0x4c43('0x27')]=_[_0x4c43('0x2b')](_0x5940c0[_0x4c43('0x27')],{'$or':_[_0x4c43('0x19')](_0x55de93,function(_0x26ab30){if(_0x26ab30[_0x4c43('0x2c')]!=='VIRTUAL'){var _0x2f7d6a={};_0x2f7d6a[_0x26ab30[_0x4c43('0x16')]]={'$like':'%'+_0xec8eb3[_0x4c43('0x1c')]['filter']+'%'};return _0x2f7d6a;}})});}_0x5940c0=_['merge']({},_0x5940c0,_0xec8eb3['options']);var _0x53cf94={'where':_0x5940c0['where']};return db['Dynamics365Account'][_0x4c43('0xc')](_0x53cf94)['then'](function(_0x4cc68c){_0x196e83['count']=_0x4cc68c;if(_0xec8eb3[_0x4c43('0x1c')][_0x4c43('0x2d')]){_0x5940c0[_0x4c43('0x2e')]=[{'all':!![]}];}return db[_0x4c43('0x1a')][_0x4c43('0x2f')](_0x5940c0);})[_0x4c43('0x11')](function(_0x129152){_0x196e83[_0x4c43('0x30')]=_0x129152;return _0x196e83;})[_0x4c43('0x11')](respondWithFilteredResult(_0x52713e,_0x5940c0))['catch'](handleError(_0x52713e,null));};exports[_0x4c43('0x31')]=function(_0x5b42aa,_0x1aaa92){var _0x5d9720={'raw':![],'where':{'id':_0x5b42aa[_0x4c43('0x32')]['id']}},_0x281e4d={};_0x281e4d[_0x4c43('0x1f')]=_[_0x4c43('0x1d')](db[_0x4c43('0x1a')][_0x4c43('0x33')]);_0x281e4d[_0x4c43('0x1c')]=_[_0x4c43('0x1d')](_0x5b42aa[_0x4c43('0x1c')]);_0x281e4d[_0x4c43('0x28')]=_[_0x4c43('0x1e')](_0x281e4d[_0x4c43('0x1f')],_0x281e4d[_0x4c43('0x1c')]);_0x5d9720[_0x4c43('0x20')]=_[_0x4c43('0x1e')](_0x281e4d[_0x4c43('0x1f')],qs[_0x4c43('0x21')](_0x5b42aa[_0x4c43('0x1c')][_0x4c43('0x21')]));_0x5d9720[_0x4c43('0x20')]=_0x5d9720['attributes'][_0x4c43('0x22')]?_0x5d9720[_0x4c43('0x20')]:_0x281e4d[_0x4c43('0x1f')];if(_0x5b42aa[_0x4c43('0x1c')][_0x4c43('0x2d')]){_0x5d9720[_0x4c43('0x2e')]=[{'all':!![]}];}_0x5d9720=_[_0x4c43('0x2b')]({},_0x5d9720,_0x5b42aa[_0x4c43('0x34')]);return db[_0x4c43('0x1a')][_0x4c43('0x35')](_0x5d9720)[_0x4c43('0x11')](handleEntityNotFound(_0x1aaa92,null))['then'](respondWithResult(_0x1aaa92,null))[_0x4c43('0x36')](handleError(_0x1aaa92,null));};exports[_0x4c43('0x37')]=function(_0x2405cc,_0x58702a){return db['Dynamics365Account'][_0x4c43('0x37')](_0x2405cc[_0x4c43('0x38')],{})['then'](respondWithResult(_0x58702a,0xc9))[_0x4c43('0x36')](handleError(_0x58702a,null));};exports['update']=function(_0x538a7c,_0xfae424){if(_0x538a7c[_0x4c43('0x38')]['id']){delete _0x538a7c[_0x4c43('0x38')]['id'];}return db[_0x4c43('0x1a')][_0x4c43('0x35')]({'where':{'id':_0x538a7c[_0x4c43('0x32')]['id']}})[_0x4c43('0x11')](handleEntityNotFound(_0xfae424,null))['then'](saveUpdates(_0x538a7c[_0x4c43('0x38')],null))[_0x4c43('0x11')](respondWithResult(_0xfae424,null))['catch'](handleError(_0xfae424,null));};exports[_0x4c43('0x10')]=function(_0x19f9d6,_0x7a4ca2){return db[_0x4c43('0x1a')]['find']({'where':{'id':_0x19f9d6[_0x4c43('0x32')]['id']}})[_0x4c43('0x11')](handleEntityNotFound(_0x7a4ca2,null))[_0x4c43('0x11')](removeEntity(_0x7a4ca2,null))[_0x4c43('0x36')](handleError(_0x7a4ca2,null));};exports['getConfigurations']=function(_0x337c22,_0x32daac){var _0x47d87e={};var _0x166ead={};var _0x111243;var _0x3f9a9a;return db[_0x4c43('0x1a')][_0x4c43('0x39')]({'where':{'id':_0x337c22['params']['id']}})[_0x4c43('0x11')](handleEntityNotFound(_0x32daac,null))[_0x4c43('0x11')](function(_0x57d0f5){if(_0x57d0f5){_0x111243=_0x57d0f5;_0x166ead[_0x4c43('0x1f')]=_[_0x4c43('0x1d')](db['Dynamics365Configuration'][_0x4c43('0x33')]);_0x166ead[_0x4c43('0x1c')]=_['keys'](_0x337c22['query']);_0x166ead[_0x4c43('0x28')]=_['intersection'](_0x166ead[_0x4c43('0x1f')],_0x166ead['query']);_0x47d87e[_0x4c43('0x20')]=_[_0x4c43('0x1e')](_0x166ead['model'],qs[_0x4c43('0x21')](_0x337c22[_0x4c43('0x1c')][_0x4c43('0x21')]));_0x47d87e[_0x4c43('0x20')]=_0x47d87e[_0x4c43('0x20')][_0x4c43('0x22')]?_0x47d87e['attributes']:_0x166ead[_0x4c43('0x1f')];_0x47d87e['order']=qs[_0x4c43('0x26')](_0x337c22[_0x4c43('0x1c')][_0x4c43('0x26')]);_0x47d87e['where']=qs[_0x4c43('0x28')](_[_0x4c43('0x29')](_0x337c22[_0x4c43('0x1c')],_0x166ead[_0x4c43('0x28')]));if(_0x337c22[_0x4c43('0x1c')][_0x4c43('0x2a')]){_0x47d87e[_0x4c43('0x27')]=_['merge'](_0x47d87e['where'],{'$or':_[_0x4c43('0x19')](_0x47d87e[_0x4c43('0x20')],function(_0xbf4524){var _0x2ecd44={};_0x2ecd44[_0xbf4524]={'$like':'%'+_0x337c22[_0x4c43('0x1c')][_0x4c43('0x2a')]+'%'};return _0x2ecd44;})});}_0x47d87e=_[_0x4c43('0x2b')]({},_0x47d87e,_0x337c22[_0x4c43('0x34')]);return _0x111243['getConfigurations'](_0x47d87e);}})['then'](function(_0x188351){if(_0x188351){_0x3f9a9a=_0x188351[_0x4c43('0x22')];if(!_0x337c22['query']['hasOwnProperty']('nolimit')){_0x47d87e[_0x4c43('0xd')]=qs[_0x4c43('0xd')](_0x337c22[_0x4c43('0x1c')][_0x4c43('0xd')]);_0x47d87e[_0x4c43('0xa')]=qs[_0x4c43('0xa')](_0x337c22[_0x4c43('0x1c')][_0x4c43('0xa')]);}return _0x111243['getConfigurations'](_0x47d87e);}})[_0x4c43('0x11')](function(_0x533264){if(_0x533264){return _0x533264?{'count':_0x3f9a9a,'rows':_0x533264}:null;}})[_0x4c43('0x11')](respondWithResult(_0x32daac,null))['catch'](handleError(_0x32daac,null));};exports[_0x4c43('0x3a')]=function(_0x413921,_0x122861){if(_0x413921[_0x4c43('0x38')]['id']){delete _0x413921['body']['id'];}return db[_0x4c43('0x1a')][_0x4c43('0x39')]({'where':{'id':_0x413921[_0x4c43('0x32')]['id']}})[_0x4c43('0x11')](handleEntityNotFound(_0x122861,null))['then'](function(_0x5337ce){if(_0x5337ce){_0x413921[_0x4c43('0x38')][_0x4c43('0x3b')]=_0x5337ce['id'];_0x413921['body'][_0x4c43('0x3c')]=integrations['getSubjects'](_0x413921[_0x4c43('0x38')]['channel'],_0x413921['body'][_0x4c43('0x2c')]);_0x413921[_0x4c43('0x38')]['Descriptions']=integrations[_0x4c43('0x3d')](_0x413921[_0x4c43('0x38')]['channel'],_0x413921[_0x4c43('0x38')][_0x4c43('0x2c')]);return db[_0x4c43('0x3e')][_0x4c43('0x37')](_0x413921[_0x4c43('0x38')],{'include':[{'model':db[_0x4c43('0x3f')],'as':_0x4c43('0x3c')},{'model':db[_0x4c43('0x3f')],'as':_0x4c43('0x40')}]});}return null;})[_0x4c43('0x11')](respondWithResult(_0x122861,null))[_0x4c43('0x36')](handleError(_0x122861,null));};function sanitizeRemoteUri(_0x186a15){var _0x4fe565=_0x186a15[_0x4c43('0x41')](-0x1);if(_0x4fe565==='/')return _0x186a15['substring'](0x0,_0x186a15[_0x4c43('0x42')](_0x4fe565));return _0x186a15;}function getWebApiUrl(_0x504d03){return util[_0x4c43('0x43')](_0x4c43('0x44'),_0x504d03);}exports['getFields']=function(_0x50617a,_0x2dc326){var _0x2ba80c=_0x50617a[_0x4c43('0x1c')][_0x4c43('0x45')];var _0x1a30bd=_0x2ba80c===_0x4c43('0x46')?'Incident':_0x4c43('0x47');var _0x318ae2='';var _0x1fc273='';var _0x280008='';var _0x421084='';var _0x19f525='';var _0x486566='';var _0x290083='';var _0x22a79a='';var _0x382f1e=['title','description',_0x4c43('0x48'),_0x4c43('0x49'),'caseorigincode','subject','phonenumber',_0x4c43('0x4a'),_0x4c43('0x4b'),'phonecall_activity_parties'];var _0x5e3544=[_0x4c43('0x4c'),_0x4c43('0x4d'),_0x4c43('0x4e'),'billedserviceunits',_0x4c43('0x4f'),_0x4c43('0x50'),'contractdetailidname',_0x4c43('0x51'),_0x4c43('0x52'),_0x4c43('0x53'),'createdbyname',_0x4c43('0x54'),_0x4c43('0x55'),'createdonbehalfbyname','createdonbehalfbyyominame',_0x4c43('0x56'),'customeridtype',_0x4c43('0x57'),'emailaddress',_0x4c43('0x58'),_0x4c43('0x59'),_0x4c43('0x5a'),'escalatedon',_0x4c43('0x5b'),_0x4c43('0x5c'),_0x4c43('0x5d'),_0x4c43('0x5e'),'influencescore',_0x4c43('0x5f'),_0x4c43('0x60'),_0x4c43('0x61'),_0x4c43('0x62'),'modifiedbyexternalpartyyominame',_0x4c43('0x63'),_0x4c43('0x64'),_0x4c43('0x65'),_0x4c43('0x66'),_0x4c43('0x67'),_0x4c43('0x68'),_0x4c43('0x69'),_0x4c43('0x6a'),_0x4c43('0x6b'),_0x4c43('0x6c'),'owneridname','owneridtype',_0x4c43('0x6d'),_0x4c43('0x6e'),_0x4c43('0x6f'),'primarycontactidyominame',_0x4c43('0x70'),_0x4c43('0x71'),_0x4c43('0x72'),'resolveby',_0x4c43('0x73'),_0x4c43('0x74'),_0x4c43('0x75'),'responsiblecontactidyominame',_0x4c43('0x76'),'slainvokedidname',_0x4c43('0x77'),_0x4c43('0x78'),_0x4c43('0x79'),_0x4c43('0x7a'),'subjectidname',_0x4c43('0x7b'),_0x4c43('0x7c'),_0x4c43('0x7d'),_0x4c43('0x7e'),_0x4c43('0x7f'),_0x4c43('0x80')];var _0xad1c10=_0x382f1e['concat'](_0x5e3544);return db[_0x4c43('0x1a')]['findOne']({'where':{'id':_0x50617a[_0x4c43('0x32')]['id']},'attributes':['id','username',_0x4c43('0x81'),'remoteUri',_0x4c43('0x82'),'clientId','clientSecret',_0x4c43('0x83')],'include':[{'model':db[_0x4c43('0x84')],'as':_0x4c43('0x84'),'attributes':['id','data5',_0x4c43('0x85')]}]})[_0x4c43('0x11')](handleEntityNotFound(_0x2dc326,null))[_0x4c43('0x11')](function(_0x8c609f){if(_0x8c609f){if(_0x8c609f['modernAuthentication']){_0x8c609f['access_token']=_0x8c609f[_0x4c43('0x84')]['data5'];_0x22a79a=sanitizeRemoteUri(_0x8c609f[_0x4c43('0x84')][_0x4c43('0x85')]);_0x290083=getWebApiUrl(_0x22a79a);return _0x8c609f;}_0x22a79a=sanitizeRemoteUri(_0x8c609f[_0x4c43('0x86')]);_0x290083=getWebApiUrl(_0x22a79a);var _0x3e05b9={'method':_0x4c43('0x87'),'uri':_0x4c43('0x88')+_0x8c609f['tenantId']+_0x4c43('0x89'),'form':{'client_id':_0x8c609f[_0x4c43('0x8a')],'resource':_0x22a79a,'username':_0x8c609f[_0x4c43('0x8b')],'password':_0x8c609f['password'],'grant_type':_0x4c43('0x81'),'client_secret':_0x8c609f[_0x4c43('0x8c')]},'json':!![]};return rp(_0x3e05b9);}})[_0x4c43('0x11')](function(_0x304d6f){_0x486566=_0x304d6f[_0x4c43('0x8d')];var _0x490f61={'method':_0x4c43('0x8e'),'uri':encodeURI(_0x290083+_0x4c43('0x8f')+_0x1a30bd+'\x27'),'headers':{'Authorization':_0x4c43('0x90')+_0x486566,'If-None-Match':null,'OData-Version':_0x4c43('0x91')},'json':!![]};return rp(_0x490f61);})[_0x4c43('0x11')](function(_0x485e7f){var _0x167ff3=_0x485e7f[_0x4c43('0x92')][0x0];var _0x5b203d=_0x167ff3[_0x4c43('0x93')];var _0x46622a={'method':'GET','uri':_0x290083+_0x4c43('0x94')+_0x5b203d+_0x4c43('0x95'),'headers':{'Authorization':'Bearer\x20'+_0x486566,'If-None-Match':null,'OData-Version':_0x4c43('0x91')},'json':!![]};return rp(_0x46622a);})[_0x4c43('0x11')](function(_0x504ff7){_0x318ae2=_0x504ff7;_0x1fc273=_0x318ae2[_0x4c43('0x96')];_0x1fc273=_[_0x4c43('0x97')](_0x1fc273,function(_0x10cab2){return!_0xad1c10[_0x4c43('0x98')](_0x10cab2[_0x4c43('0x99')]);});var _0x2c3fe4=[];var _0x9cd0e0=[];_0x1fc273[_0x4c43('0x9a')](function(_0x1bbf06){if(_0x1bbf06['@odata.type']){var _0x27a409=_0x1bbf06[_0x4c43('0x9b')][_0x4c43('0x9c')](_0x1bbf06[_0x4c43('0x9b')][_0x4c43('0x42')]('.')+0x1);if(_0x27a409==='PicklistAttributeMetadata'){_0x2c3fe4[_0x4c43('0x9d')](getSelectList(_0x290083,_0x2ba80c,_0x9cd0e0,_0x318ae2[_0x4c43('0x93')],_0x1bbf06[_0x4c43('0x93')],_0x486566));}}});return Promise[_0x4c43('0x9e')](_0x2c3fe4);})[_0x4c43('0x11')](function(_0x24a878){_0x280008=_0x24a878[0x0];var _0xafe00b=[];var _0x4d7fc3=[];_0x1fc273[_0x4c43('0x9a')](function(_0x2c1cc5){if(!_[_0x4c43('0x9f')](_0x2c1cc5[_0x4c43('0x9b')])){var _0x21b12b=_0x2c1cc5['@odata.type']['substring'](_0x2c1cc5[_0x4c43('0x9b')][_0x4c43('0x42')]('.')+0x1);if(_0x21b12b===_0x4c43('0xa0')){_0xafe00b[_0x4c43('0x9d')](getBooleanList(_0x290083,_0x2ba80c,_0x4d7fc3,_0x318ae2[_0x4c43('0x93')],_0x2c1cc5['MetadataId'],_0x486566));}}});return Promise[_0x4c43('0x9e')](_0xafe00b);})['then'](function(_0x8fa214){_0x421084=_0x8fa214[0x0];var _0x176140=[];var _0x1c8ace=[];_0x1fc273[_0x4c43('0x9a')](function(_0x22a48a){if(_0x22a48a[_0x4c43('0x9b')]){var _0x336035=_0x22a48a[_0x4c43('0x9b')][_0x4c43('0x9c')](_0x22a48a[_0x4c43('0x9b')][_0x4c43('0x42')]('.')+0x1);if(_0x336035===_0x4c43('0xa1')||_0x336035===_0x4c43('0xa2')||_0x336035===_0x4c43('0xa3')||_0x336035==='IntegerAttributeMetadata'||_0x336035===_0x4c43('0xa4')||_0x336035===_0x4c43('0xa5')||_0x336035===_0x4c43('0xa6')||_0x336035==='EntityNameAttributeMetadata'||_0x336035===_0x4c43('0xa7')||_0x336035===_0x4c43('0xa8')){_0x176140[_0x4c43('0x9d')](getInputList(_0x290083,_0x2ba80c,_0x336035,_0x1c8ace,_0x318ae2[_0x4c43('0x93')],_0x22a48a[_0x4c43('0x93')],_0x486566));}}});return Promise[_0x4c43('0x9e')](_0x176140);})[_0x4c43('0x11')](function(_0x42ea0e){_0x19f525=_0x42ea0e[0x0];var _0x53581d=_0x280008[_0x4c43('0xa9')](_0x421084)[_0x4c43('0xa9')](_0x19f525);var _0x190067={'count':_0x53581d['length'],'rows':_0x53581d};return _0x190067;})[_0x4c43('0x11')](respondWithResult(_0x2dc326,null))[_0x4c43('0x36')](function(_0x176ce8){var _0xaf752b=_0x50617a[_0x4c43('0x1c')][_0x4c43('0xaa')]?0x1f4:_0x176ce8[_0x4c43('0xab')]||0x1f4;logger[_0x4c43('0x14')](_0x176ce8[_0x4c43('0x15')]);delete _0x176ce8[_0x4c43('0x16')];if(_0xaf752b===0x191){_0xaf752b=0x190;}_0x2dc326[_0x4c43('0x8')](_0xaf752b)['send'](_0x50617a['query'][_0x4c43('0xaa')]?{'message':_0x4c43('0xac'),'statusCode':_0x176ce8[_0x4c43('0xab')]}:_0x176ce8);});};function getSelectList(_0x385442,_0x3029dc,_0xa6d360,_0x5dd22f,_0x35dcea,_0x11128a){var _0x5bd290={'method':_0x4c43('0x8e'),'uri':_0x385442+'EntityDefinitions('+_0x5dd22f+_0x4c43('0xad')+_0x35dcea+')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?'+_0x4c43('0xae'),'headers':{'Authorization':_0x4c43('0x90')+_0x11128a,'If-None-Match':null,'OData-Version':_0x4c43('0x91')},'json':!![]};return rp(_0x5bd290)[_0x4c43('0x11')](function(_0x3cf501){var _0x52ad03=[];var _0x35275a=_0x3cf501[_0x4c43('0xaf')][_0x4c43('0xb0')];_0x35275a[_0x4c43('0x9a')](function(_0x1f3580){_0x52ad03[_0x4c43('0x9d')]({'name':_0x1f3580[_0x4c43('0xb1')]['UserLocalizedLabel'][_0x4c43('0xb1')],'value':String(_0x1f3580[_0x4c43('0xb2')])});});var _0xeff584={'id':_0x3029dc+'_'+_0x3cf501['LogicalName'],'name':_0x3cf501[_0x4c43('0xb3')][_0x4c43('0xb4')][_0x4c43('0xb1')],'custom':![],'options':_0x52ad03};_0xa6d360[_0x4c43('0x9d')](_0xeff584);return _0xa6d360;});}function getBooleanList(_0x26c01c,_0x202502,_0x405b17,_0x29b013,_0x2c58d6,_0x36272f){var _0x446bf1={'method':_0x4c43('0x8e'),'uri':_0x26c01c+'EntityDefinitions('+_0x29b013+_0x4c43('0xad')+_0x2c58d6+_0x4c43('0xb5'),'headers':{'Authorization':'Bearer\x20'+_0x36272f,'If-None-Match':null,'OData-Version':_0x4c43('0x91')},'json':!![]};return rp(_0x446bf1)[_0x4c43('0x11')](function(_0x5dd297){var _0x117d30=[];_0x117d30['push']({'name':_0x5dd297[_0x4c43('0xaf')][_0x4c43('0xb6')]['Label'][_0x4c43('0xb4')][_0x4c43('0xb1')],'value':_0x4c43('0xb7')},{'name':_0x5dd297['OptionSet'][_0x4c43('0xb8')][_0x4c43('0xb1')][_0x4c43('0xb4')][_0x4c43('0xb1')],'value':_0x4c43('0xb9')});var _0x29d58a={'id':_0x202502+'_'+_0x5dd297['LogicalName'],'name':_0x5dd297[_0x4c43('0xb3')][_0x4c43('0xb4')][_0x4c43('0xb1')],'custom':![],'options':_0x117d30};_0x405b17[_0x4c43('0x9d')](_0x29d58a);return _0x405b17;});}function getInputList(_0x55c417,_0x5bb427,_0x2ef0f3,_0x4b193c,_0x376f58,_0x4c7a06,_0x3e2403){var _0x393d7e={'method':'GET','uri':_0x55c417+'EntityDefinitions('+_0x376f58+_0x4c43('0xad')+_0x4c7a06+')/Microsoft.Dynamics.CRM.'+_0x2ef0f3+_0x4c43('0xba'),'headers':{'Authorization':'Bearer\x20'+_0x3e2403,'If-None-Match':null,'OData-Version':_0x4c43('0x91')},'json':!![]};return rp(_0x393d7e)['then'](function(_0x48e777){var _0x38adc7={'id':_0x5bb427+'_'+_0x48e777['LogicalName'],'name':_0x48e777[_0x4c43('0xb3')]['UserLocalizedLabel']?_0x48e777['DisplayName'][_0x4c43('0xb4')][_0x4c43('0xb1')]:_0x48e777[_0x4c43('0x99')],'custom':![],'options':[]};_0x4b193c[_0x4c43('0x9d')](_0x38adc7);return _0x4b193c;});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.model.js b/server/api/intDynamics365Account/intDynamics365Account.model.js index 63c5bd9..13a7577 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(_0x242c3c,_0x8446da){var _0x266fa0=function(_0x19f628){while(--_0x19f628){_0x242c3c['push'](_0x242c3c['shift']());}};_0x266fa0(++_0x8446da);}(_0xe706,0xa3));var _0x6e70=function(_0xb67251,_0x1f6208){_0xb67251=_0xb67251-0x0;var _0x979d96=_0xe706[_0xb67251];return _0x979d96;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var logger=require(_0x6e70('0x2'))('api');var moment=require(_0x6e70('0x3'));var BPromise=require(_0x6e70('0x4'));var rp=require(_0x6e70('0x5'));var fs=require('fs');var path=require(_0x6e70('0x6'));var rimraf=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var attributes=require(_0x6e70('0x9'));var integrations=require(_0x6e70('0xa'));module[_0x6e70('0xb')]=function(_0x4381d1,_0x36357b){return _0x4381d1[_0x6e70('0xc')](_0x6e70('0xd'),attributes,{'tableName':_0x6e70('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbaf0=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intDynamics365Account.attributes','../../components/integrations/configuration','exports','define','Dynamics365Account','util'];(function(_0x24fb18,_0x2ac339){var _0xccb7fd=function(_0x373912){while(--_0x373912){_0x24fb18['push'](_0x24fb18['shift']());}};_0xccb7fd(++_0x2ac339);}(_0xbaf0,0x12a));var _0x0baf=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0xbaf0[_0x465028];return _0xb783d4;};'use strict';var _=require('lodash');var util=require(_0x0baf('0x0'));var logger=require(_0x0baf('0x1'))(_0x0baf('0x2'));var moment=require(_0x0baf('0x3'));var BPromise=require(_0x0baf('0x4'));var rp=require(_0x0baf('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0baf('0x6'));var config=require(_0x0baf('0x7'));var attributes=require(_0x0baf('0x8'));var integrations=require(_0x0baf('0x9'));module[_0x0baf('0xa')]=function(_0x335e24,_0x1a10b1){return _0x335e24[_0x0baf('0xb')](_0x0baf('0xc'),attributes,{'tableName':'int_dynamics365_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.rpc.js b/server/api/intDynamics365Account/intDynamics365Account.rpc.js index ddc40ca..5ceceed 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 _0x80a9=['limit','include','map','model','attributes','ShowDynamics365Account','find','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Dynamics365Account,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','GetDynamics365Account','Dynamics365Account','options','raw','where'];(function(_0x46623a,_0x4b9afd){var _0xd02773=function(_0xbac4d2){while(--_0xbac4d2){_0x46623a['push'](_0x46623a['shift']());}};_0xd02773(++_0x4b9afd);}(_0x80a9,0x165));var _0x980a=function(_0x68ee8b,_0x3cc6c5){_0x68ee8b=_0x68ee8b-0x0;var _0x5148f7=_0x80a9[_0x68ee8b];return _0x5148f7;};'use strict';var _=require(_0x980a('0x0'));var util=require(_0x980a('0x1'));var moment=require(_0x980a('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x980a('0x3'));var db=require(_0x980a('0x4'))['db'];var utils=require(_0x980a('0x5'));var logger=require(_0x980a('0x6'))(_0x980a('0x7'));var config=require(_0x980a('0x8'));var jayson=require(_0x980a('0x9'));var client=jayson['client'][_0x980a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xdabaaf,_0x3504e8,_0x415439){return new BPromise(function(_0x8b11e,_0x7959fc){return client[_0x980a('0xb')](_0xdabaaf,_0x415439)[_0x980a('0xc')](function(_0x3664eb){logger[_0x980a('0xd')](_0x980a('0xe'),_0x3504e8,_0x980a('0xf'));logger[_0x980a('0x10')]('Dynamics365Account,\x20%s,\x20%s,\x20%s',_0x3504e8,_0x980a('0xf'),JSON[_0x980a('0x11')](_0x3664eb));if(_0x3664eb[_0x980a('0x12')]){if(_0x3664eb[_0x980a('0x12')][_0x980a('0x13')]===0x1f4){logger[_0x980a('0x12')](_0x980a('0xe'),_0x3504e8,_0x3664eb[_0x980a('0x12')][_0x980a('0x14')]);return _0x7959fc(_0x3664eb[_0x980a('0x12')][_0x980a('0x14')]);}logger[_0x980a('0x12')](_0x980a('0xe'),_0x3504e8,_0x3664eb[_0x980a('0x12')][_0x980a('0x14')]);return _0x8b11e(_0x3664eb[_0x980a('0x12')][_0x980a('0x14')]);}else{logger[_0x980a('0xd')](_0x980a('0xe'),_0x3504e8,_0x980a('0xf'));_0x8b11e(_0x3664eb[_0x980a('0x15')][_0x980a('0x14')]);}})[_0x980a('0x16')](function(_0x5136be){logger[_0x980a('0x12')](_0x980a('0xe'),_0x3504e8,_0x5136be);_0x7959fc(_0x5136be);});});}exports[_0x980a('0x17')]=function(_0x4fdc74){var _0x16bd05=this;return new Promise(function(_0x2bedeb,_0x5a6216){return db[_0x980a('0x18')]['findAll']({'raw':_0x4fdc74[_0x980a('0x19')]?_0x4fdc74[_0x980a('0x19')][_0x980a('0x1a')]===undefined?!![]:![]:!![],'where':_0x4fdc74[_0x980a('0x19')]?_0x4fdc74[_0x980a('0x19')][_0x980a('0x1b')]||null:null,'attributes':_0x4fdc74[_0x980a('0x19')]?_0x4fdc74[_0x980a('0x19')]['attributes']||null:null,'limit':_0x4fdc74[_0x980a('0x19')]?_0x4fdc74[_0x980a('0x19')][_0x980a('0x1c')]||null:null,'include':_0x4fdc74[_0x980a('0x19')]?_0x4fdc74[_0x980a('0x19')][_0x980a('0x1d')]?_[_0x980a('0x1e')](_0x4fdc74['options']['include'],function(_0x60eeeb){return{'model':db[_0x60eeeb[_0x980a('0x1f')]],'as':_0x60eeeb['as'],'attributes':_0x60eeeb['attributes'],'include':_0x60eeeb['include']?_[_0x980a('0x1e')](_0x60eeeb[_0x980a('0x1d')],function(_0x1d1101){return{'model':db[_0x1d1101[_0x980a('0x1f')]],'as':_0x1d1101['as'],'attributes':_0x1d1101['attributes'],'include':_0x1d1101[_0x980a('0x1d')]?_['map'](_0x1d1101['include'],function(_0x44587b){return{'model':db[_0x44587b[_0x980a('0x1f')]],'as':_0x44587b['as'],'attributes':_0x44587b[_0x980a('0x20')]};}):[]};}):[]};}):[]:[]})[_0x980a('0xc')](function(_0x365cea){logger['info']('GetDynamics365Account',_0x4fdc74);logger[_0x980a('0x10')](_0x980a('0x17'),_0x4fdc74,JSON[_0x980a('0x11')](_0x365cea));_0x2bedeb(_0x365cea);})[_0x980a('0x16')](function(_0x368451){logger[_0x980a('0x12')](_0x980a('0x17'),_0x368451['message'],_0x4fdc74);_0x5a6216(_0x16bd05[_0x980a('0x12')](0x1f4,_0x368451['message']));});});};exports[_0x980a('0x21')]=function(_0x428075){var _0x3bc259=this;return new Promise(function(_0x42bf97,_0xfb079c){return db[_0x980a('0x18')][_0x980a('0x22')]({'raw':_0x428075['options']?_0x428075['options']['raw']===undefined?!![]:![]:!![],'where':_0x428075[_0x980a('0x19')]?_0x428075[_0x980a('0x19')][_0x980a('0x1b')]||null:null,'attributes':_0x428075['options']?_0x428075['options'][_0x980a('0x20')]||null:null,'include':_0x428075[_0x980a('0x19')]?_0x428075[_0x980a('0x19')][_0x980a('0x1d')]?_['map'](_0x428075[_0x980a('0x19')][_0x980a('0x1d')],function(_0x4ee396){return{'model':db[_0x4ee396[_0x980a('0x1f')]],'as':_0x4ee396['as'],'attributes':_0x4ee396[_0x980a('0x20')],'include':_0x4ee396[_0x980a('0x1d')]?_['map'](_0x4ee396[_0x980a('0x1d')],function(_0x26b3ea){return{'model':db[_0x26b3ea[_0x980a('0x1f')]],'as':_0x26b3ea['as'],'attributes':_0x26b3ea[_0x980a('0x20')],'include':_0x26b3ea['include']?_['map'](_0x26b3ea['include'],function(_0x5a63f2){return{'model':db[_0x5a63f2['model']],'as':_0x5a63f2['as'],'attributes':_0x5a63f2[_0x980a('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3f9033){logger['info'](_0x980a('0x21'),_0x428075);logger[_0x980a('0x10')](_0x980a('0x21'),_0x428075,JSON[_0x980a('0x11')](_0x3f9033));_0x42bf97(_0x3f9033);})[_0x980a('0x16')](function(_0x2a443c){logger[_0x980a('0x12')](_0x980a('0x21'),_0x2a443c['message'],_0x428075);_0xfb079c(_0x3bc259[_0x980a('0x12')](0x1f4,_0x2a443c['message']));});});}; \ No newline at end of file +var _0xf97f=['options','raw','attributes','limit','map','include','model','GetDynamics365Account','catch','ShowDynamics365Account','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info','Dynamics365Account,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','stringify','error','message','Dynamics365Account','findAll'];(function(_0xd56143,_0x2d3844){var _0x229eda=function(_0x3ee7e6){while(--_0x3ee7e6){_0xd56143['push'](_0xd56143['shift']());}};_0x229eda(++_0x2d3844);}(_0xf97f,0x112));var _0xff97=function(_0x50a623,_0x2d6363){_0x50a623=_0x50a623-0x0;var _0x266fbb=_0xf97f[_0x50a623];return _0x266fbb;};'use strict';var _=require(_0xff97('0x0'));var util=require('util');var moment=require(_0xff97('0x1'));var BPromise=require(_0xff97('0x2'));var rs=require(_0xff97('0x3'));var fs=require('fs');var Redis=require(_0xff97('0x4'));var db=require(_0xff97('0x5'))['db'];var utils=require(_0xff97('0x6'));var logger=require(_0xff97('0x7'))(_0xff97('0x8'));var config=require('../../config/environment');var jayson=require(_0xff97('0x9'));var client=jayson[_0xff97('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x585613,_0x483caa,_0x131faa){return new BPromise(function(_0x44e0e8,_0x404378){return client[_0xff97('0xb')](_0x585613,_0x131faa)[_0xff97('0xc')](function(_0x5d5e56){logger[_0xff97('0xd')](_0xff97('0xe'),_0x483caa,_0xff97('0xf'));logger[_0xff97('0x10')](_0xff97('0x11'),_0x483caa,'request\x20sent',JSON[_0xff97('0x12')](_0x5d5e56));if(_0x5d5e56[_0xff97('0x13')]){if(_0x5d5e56[_0xff97('0x13')]['code']===0x1f4){logger[_0xff97('0x13')](_0xff97('0xe'),_0x483caa,_0x5d5e56[_0xff97('0x13')][_0xff97('0x14')]);return _0x404378(_0x5d5e56[_0xff97('0x13')][_0xff97('0x14')]);}logger[_0xff97('0x13')](_0xff97('0xe'),_0x483caa,_0x5d5e56[_0xff97('0x13')]['message']);return _0x44e0e8(_0x5d5e56[_0xff97('0x13')]['message']);}else{logger[_0xff97('0xd')](_0xff97('0xe'),_0x483caa,_0xff97('0xf'));_0x44e0e8(_0x5d5e56['result'][_0xff97('0x14')]);}})['catch'](function(_0x7ad659){logger[_0xff97('0x13')](_0xff97('0xe'),_0x483caa,_0x7ad659);_0x404378(_0x7ad659);});});}exports['GetDynamics365Account']=function(_0x14c51b){var _0x24712a=this;return new Promise(function(_0xc6c27,_0x4f2b46){return db[_0xff97('0x15')][_0xff97('0x16')]({'raw':_0x14c51b['options']?_0x14c51b[_0xff97('0x17')][_0xff97('0x18')]===undefined?!![]:![]:!![],'where':_0x14c51b['options']?_0x14c51b['options']['where']||null:null,'attributes':_0x14c51b['options']?_0x14c51b[_0xff97('0x17')][_0xff97('0x19')]||null:null,'limit':_0x14c51b[_0xff97('0x17')]?_0x14c51b[_0xff97('0x17')][_0xff97('0x1a')]||null:null,'include':_0x14c51b['options']?_0x14c51b[_0xff97('0x17')]['include']?_[_0xff97('0x1b')](_0x14c51b[_0xff97('0x17')][_0xff97('0x1c')],function(_0x4e8835){return{'model':db[_0x4e8835['model']],'as':_0x4e8835['as'],'attributes':_0x4e8835['attributes'],'include':_0x4e8835[_0xff97('0x1c')]?_[_0xff97('0x1b')](_0x4e8835[_0xff97('0x1c')],function(_0x1a33b4){return{'model':db[_0x1a33b4[_0xff97('0x1d')]],'as':_0x1a33b4['as'],'attributes':_0x1a33b4[_0xff97('0x19')],'include':_0x1a33b4[_0xff97('0x1c')]?_[_0xff97('0x1b')](_0x1a33b4[_0xff97('0x1c')],function(_0x5efa8e){return{'model':db[_0x5efa8e[_0xff97('0x1d')]],'as':_0x5efa8e['as'],'attributes':_0x5efa8e[_0xff97('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5ceecf){logger[_0xff97('0xd')]('GetDynamics365Account',_0x14c51b);logger[_0xff97('0x10')](_0xff97('0x1e'),_0x14c51b,JSON['stringify'](_0x5ceecf));_0xc6c27(_0x5ceecf);})[_0xff97('0x1f')](function(_0x18cf73){logger['error'](_0xff97('0x1e'),_0x18cf73[_0xff97('0x14')],_0x14c51b);_0x4f2b46(_0x24712a['error'](0x1f4,_0x18cf73[_0xff97('0x14')]));});});};exports['ShowDynamics365Account']=function(_0x4f0a94){var _0x522fdb=this;return new Promise(function(_0x33698f,_0x5b7677){return db[_0xff97('0x15')]['find']({'raw':_0x4f0a94[_0xff97('0x17')]?_0x4f0a94['options']['raw']===undefined?!![]:![]:!![],'where':_0x4f0a94[_0xff97('0x17')]?_0x4f0a94[_0xff97('0x17')]['where']||null:null,'attributes':_0x4f0a94[_0xff97('0x17')]?_0x4f0a94[_0xff97('0x17')][_0xff97('0x19')]||null:null,'include':_0x4f0a94['options']?_0x4f0a94[_0xff97('0x17')][_0xff97('0x1c')]?_[_0xff97('0x1b')](_0x4f0a94[_0xff97('0x17')][_0xff97('0x1c')],function(_0x1bf017){return{'model':db[_0x1bf017['model']],'as':_0x1bf017['as'],'attributes':_0x1bf017[_0xff97('0x19')],'include':_0x1bf017[_0xff97('0x1c')]?_[_0xff97('0x1b')](_0x1bf017['include'],function(_0x146702){return{'model':db[_0x146702[_0xff97('0x1d')]],'as':_0x146702['as'],'attributes':_0x146702['attributes'],'include':_0x146702[_0xff97('0x1c')]?_['map'](_0x146702['include'],function(_0x1a35be){return{'model':db[_0x1a35be[_0xff97('0x1d')]],'as':_0x1a35be['as'],'attributes':_0x1a35be['attributes']};}):[]};}):[]};}):[]:[]})[_0xff97('0xc')](function(_0x13eeeb){logger[_0xff97('0xd')](_0xff97('0x20'),_0x4f0a94);logger[_0xff97('0x10')]('ShowDynamics365Account',_0x4f0a94,JSON['stringify'](_0x13eeeb));_0x33698f(_0x13eeeb);})[_0xff97('0x1f')](function(_0x3cfa7a){logger[_0xff97('0x13')]('ShowDynamics365Account',_0x3cfa7a['message'],_0x4f0a94);_0x5b7677(_0x522fdb[_0xff97('0x13')](0x1f4,_0x3cfa7a[_0xff97('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/index.js b/server/api/intDynamics365Configuration/index.js index 3f568cd..b9ee1ca 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 _0xd786=['get','index','isAuthenticated','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','put','/:id','update','delete','destroy','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Configuration.controller'];(function(_0x3498f4,_0x5138b1){var _0x4cd9a4=function(_0x2c41e3){while(--_0x2c41e3){_0x3498f4['push'](_0x3498f4['shift']());}};_0x4cd9a4(++_0x5138b1);}(_0xd786,0x1dc));var _0x6d78=function(_0x31e29a,_0x349c9b){_0x31e29a=_0x31e29a-0x0;var _0x32d892=_0xd786[_0x31e29a];return _0x32d892;};'use strict';var multer=require(_0x6d78('0x0'));var util=require(_0x6d78('0x1'));var path=require(_0x6d78('0x2'));var timeout=require(_0x6d78('0x3'));var express=require('express');var router=express[_0x6d78('0x4')]();var fs_extra=require(_0x6d78('0x5'));var auth=require(_0x6d78('0x6'));var interaction=require(_0x6d78('0x7'));var config=require(_0x6d78('0x8'));var controller=require(_0x6d78('0x9'));router[_0x6d78('0xa')]('/',auth['isAuthenticated'](),controller[_0x6d78('0xb')]);router[_0x6d78('0xa')]('/:id',auth[_0x6d78('0xc')](),controller[_0x6d78('0xd')]);router[_0x6d78('0xa')](_0x6d78('0xe'),auth['isAuthenticated'](),controller[_0x6d78('0xf')]);router[_0x6d78('0xa')](_0x6d78('0x10'),auth['isAuthenticated'](),controller[_0x6d78('0x11')]);router[_0x6d78('0xa')](_0x6d78('0x12'),auth[_0x6d78('0xc')](),controller[_0x6d78('0x13')]);router[_0x6d78('0x14')]('/',auth[_0x6d78('0xc')](),controller[_0x6d78('0x15')]);router[_0x6d78('0x16')](_0x6d78('0x17'),auth['isAuthenticated'](),controller[_0x6d78('0x18')]);router[_0x6d78('0x19')](_0x6d78('0x17'),auth[_0x6d78('0xc')](),controller[_0x6d78('0x1a')]);module['exports']=router; \ No newline at end of file +var _0x2ffe=['/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/:id','show','/:id/fields','getFields'];(function(_0x1ff804,_0x263135){var _0x3454b8=function(_0x5a95ec){while(--_0x5a95ec){_0x1ff804['push'](_0x1ff804['shift']());}};_0x3454b8(++_0x263135);}(_0x2ffe,0x6a));var _0xe2ff=function(_0x36862f,_0x2231cd){_0x36862f=_0x36862f-0x0;var _0x1ed290=_0x2ffe[_0x36862f];return _0x1ed290;};'use strict';var multer=require('multer');var util=require(_0xe2ff('0x0'));var path=require(_0xe2ff('0x1'));var timeout=require(_0xe2ff('0x2'));var express=require(_0xe2ff('0x3'));var router=express[_0xe2ff('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xe2ff('0x5'));var interaction=require(_0xe2ff('0x6'));var config=require('../../config/environment');var controller=require('./intDynamics365Configuration.controller');router[_0xe2ff('0x7')]('/',auth[_0xe2ff('0x8')](),controller[_0xe2ff('0x9')]);router['get'](_0xe2ff('0xa'),auth[_0xe2ff('0x8')](),controller[_0xe2ff('0xb')]);router[_0xe2ff('0x7')](_0xe2ff('0xc'),auth[_0xe2ff('0x8')](),controller[_0xe2ff('0xd')]);router[_0xe2ff('0x7')](_0xe2ff('0xe'),auth[_0xe2ff('0x8')](),controller[_0xe2ff('0xf')]);router[_0xe2ff('0x7')](_0xe2ff('0x10'),auth[_0xe2ff('0x8')](),controller[_0xe2ff('0x11')]);router[_0xe2ff('0x12')]('/',auth[_0xe2ff('0x8')](),controller['create']);router[_0xe2ff('0x13')](_0xe2ff('0xa'),auth['isAuthenticated'](),controller[_0xe2ff('0x14')]);router[_0xe2ff('0x15')](_0xe2ff('0xa'),auth[_0xe2ff('0x8')](),controller[_0xe2ff('0x16')]);module[_0xe2ff('0x17')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js index 31de73f..e04d794 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 _0x7153=['contact','BOOLEAN','sequelize','exports','STRING','ENUM','incident','phonecall'];(function(_0x13d57b,_0x4296dd){var _0x479400=function(_0x4abf88){while(--_0x4abf88){_0x13d57b['push'](_0x13d57b['shift']());}};_0x479400(++_0x4296dd);}(_0x7153,0x12a));var _0x3715=function(_0x4b9806,_0x1517c0){_0x4b9806=_0x4b9806-0x0;var _0x12f4d4=_0x7153[_0x4b9806];return _0x12f4d4;};'use strict';var Sequelize=require(_0x3715('0x0'));module[_0x3715('0x1')]={'name':{'type':Sequelize[_0x3715('0x2')]},'description':{'type':Sequelize['STRING']},'ticketType':{'type':Sequelize[_0x3715('0x3')](_0x3715('0x4'),_0x3715('0x5')),'defaultValue':'incident'},'moduleCreate':{'type':Sequelize['ENUM'](_0x3715('0x6'),'nothing'),'defaultValue':_0x3715('0x6'),'allowNull':![]},'additionalSearchContact':{'type':Sequelize[_0x3715('0x2')],'allowNull':!![]},'openNewTab':{'type':Sequelize[_0x3715('0x7')],'defaultValue':!![]}}; \ No newline at end of file +var _0x14b5=['incident','phonecall','ENUM','contact','nothing','BOOLEAN','sequelize','STRING'];(function(_0x3a9611,_0x55b428){var _0x179af3=function(_0x189bd5){while(--_0x189bd5){_0x3a9611['push'](_0x3a9611['shift']());}};_0x179af3(++_0x55b428);}(_0x14b5,0x1c6));var _0x514b=function(_0x42391f,_0x5a8b01){_0x42391f=_0x42391f-0x0;var _0x119652=_0x14b5[_0x42391f];return _0x119652;};'use strict';var Sequelize=require(_0x514b('0x0'));module['exports']={'name':{'type':Sequelize[_0x514b('0x1')]},'description':{'type':Sequelize[_0x514b('0x1')]},'ticketType':{'type':Sequelize['ENUM'](_0x514b('0x2'),_0x514b('0x3')),'defaultValue':'incident'},'moduleCreate':{'type':Sequelize[_0x514b('0x4')](_0x514b('0x5'),_0x514b('0x6')),'defaultValue':'contact','allowNull':![]},'additionalSearchContact':{'type':Sequelize['STRING'],'allowNull':!![]},'openNewTab':{'type':Sequelize[_0x514b('0x7')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js index 8bc06fb..3929f3a 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 _0xcae6=['desk.js','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/license/util','../../mysqldb','status','offset','undefined','limit','count','set','Content-Range','json','reject','save','update','destroy','then','end','sendStatus','error','send','index','map','Dynamics365Configuration','rawAttributes','fieldName','key','model','name','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','merge','where','type','VIRTUAL','filter','includeAll','include','findAll','rows','catch','show','keys','options','find','create','body','params','findOne','getFields','Dynamics365Field','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce'];(function(_0x514aa2,_0x5441d7){var _0x4308bc=function(_0x99c223){while(--_0x99c223){_0x514aa2['push'](_0x514aa2['shift']());}};_0x4308bc(++_0x5441d7);}(_0xcae6,0xe4));var _0x6cae=function(_0x4f6d08,_0x1b3dd0){_0x4f6d08=_0x4f6d08-0x0;var _0x53a9c6=_0xcae6[_0x4f6d08];return _0x53a9c6;};'use strict';var emlformat=require(_0x6cae('0x0'));var rimraf=require(_0x6cae('0x1'));var zipdir=require(_0x6cae('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x6cae('0x3'));var BPromise=require(_0x6cae('0x4'));var Mustache=require(_0x6cae('0x5'));var util=require(_0x6cae('0x6'));var path=require(_0x6cae('0x7'));var sox=require(_0x6cae('0x8'));var csv=require(_0x6cae('0x9'));var ejs=require(_0x6cae('0xa'));var fs=require('fs');var fs_extra=require(_0x6cae('0xb'));var _=require(_0x6cae('0xc'));var squel=require('squel');var crypto=require(_0x6cae('0xd'));var jsforce=require(_0x6cae('0xe'));var deskjs=require(_0x6cae('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x6cae('0x10'));var qs=require(_0x6cae('0x11'));var as=require(_0x6cae('0x12'));var hardwareService=require(_0x6cae('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x6cae('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x6cae('0x15'));var db=require(_0x6cae('0x16'))['db'];function respondWithStatusCode(_0x44ca69,_0x5acb3d){_0x5acb3d=_0x5acb3d||0xcc;return function(_0x36d482){if(_0x36d482){return _0x44ca69['sendStatus'](_0x5acb3d);}return _0x44ca69[_0x6cae('0x17')](_0x5acb3d)['end']();};}function respondWithResult(_0x4fbfcc,_0x266c44){_0x266c44=_0x266c44||0xc8;return function(_0x4951a5){if(_0x4951a5){return _0x4fbfcc[_0x6cae('0x17')](_0x266c44)['json'](_0x4951a5);}};}function respondWithFilteredResult(_0x24430c,_0x2e6736){return function(_0x30fa93){if(_0x30fa93){var _0x3fad63=typeof _0x2e6736[_0x6cae('0x18')]===_0x6cae('0x19')&&typeof _0x2e6736[_0x6cae('0x1a')]===_0x6cae('0x19');var _0x35a13c=_0x30fa93[_0x6cae('0x1b')];var _0x1cb5d1=_0x3fad63?0x0:_0x2e6736[_0x6cae('0x18')];var _0x147b61=_0x3fad63?_0x30fa93[_0x6cae('0x1b')]:_0x2e6736[_0x6cae('0x18')]+_0x2e6736['limit'];var _0x4c6b27;if(_0x147b61>=_0x35a13c){_0x147b61=_0x35a13c;_0x4c6b27=0xc8;}else{_0x4c6b27=0xce;}_0x24430c[_0x6cae('0x17')](_0x4c6b27);return _0x24430c[_0x6cae('0x1c')](_0x6cae('0x1d'),_0x1cb5d1+'-'+_0x147b61+'/'+_0x35a13c)[_0x6cae('0x1e')](_0x30fa93);}return null;};}function patchUpdates(_0x49e783){return function(_0x252959){try{jsonpatch['apply'](_0x252959,_0x49e783,!![]);}catch(_0xcae4da){return BPromise[_0x6cae('0x1f')](_0xcae4da);}return _0x252959[_0x6cae('0x20')]();};}function saveUpdates(_0xeb082d,_0x16c632){return function(_0x5752ec){if(_0x5752ec){return _0x5752ec[_0x6cae('0x21')](_0xeb082d)['then'](function(_0x5a36a5){return _0x5a36a5;});}return null;};}function removeEntity(_0x26ff71,_0x443e0d){return function(_0x2bb1f4){if(_0x2bb1f4){return _0x2bb1f4[_0x6cae('0x22')]()[_0x6cae('0x23')](function(){_0x26ff71[_0x6cae('0x17')](0xcc)[_0x6cae('0x24')]();});}};}function handleEntityNotFound(_0x354020,_0x2fa337){return function(_0x57765e){if(!_0x57765e){_0x354020[_0x6cae('0x25')](0x194);}return _0x57765e;};}function handleError(_0x51eb59,_0x54ba1c){_0x54ba1c=_0x54ba1c||0x1f4;return function(_0x48f381){logger[_0x6cae('0x26')](_0x48f381['stack']);if(_0x48f381['name']){delete _0x48f381['name'];}_0x51eb59['status'](_0x54ba1c)[_0x6cae('0x27')](_0x48f381);};}exports[_0x6cae('0x28')]=function(_0x26b6b2,_0x16547d){var _0x535856={},_0x93683a={},_0x32437e={'count':0x0,'rows':[]};var _0x18c8d0=_[_0x6cae('0x29')](db[_0x6cae('0x2a')][_0x6cae('0x2b')],function(_0x115eb2){return{'name':_0x115eb2[_0x6cae('0x2c')],'type':_0x115eb2['type'][_0x6cae('0x2d')]};});_0x93683a[_0x6cae('0x2e')]=_[_0x6cae('0x29')](_0x18c8d0,_0x6cae('0x2f'));_0x93683a[_0x6cae('0x30')]=_['keys'](_0x26b6b2[_0x6cae('0x30')]);_0x93683a[_0x6cae('0x31')]=_[_0x6cae('0x32')](_0x93683a[_0x6cae('0x2e')],_0x93683a[_0x6cae('0x30')]);_0x535856['attributes']=_['intersection'](_0x93683a[_0x6cae('0x2e')],qs[_0x6cae('0x33')](_0x26b6b2[_0x6cae('0x30')][_0x6cae('0x33')]));_0x535856['attributes']=_0x535856[_0x6cae('0x34')][_0x6cae('0x35')]?_0x535856[_0x6cae('0x34')]:_0x93683a[_0x6cae('0x2e')];if(!_0x26b6b2[_0x6cae('0x30')][_0x6cae('0x36')](_0x6cae('0x37'))){_0x535856[_0x6cae('0x1a')]=qs['limit'](_0x26b6b2['query'][_0x6cae('0x1a')]);_0x535856['offset']=qs['offset'](_0x26b6b2[_0x6cae('0x30')][_0x6cae('0x18')]);}_0x535856[_0x6cae('0x38')]=qs[_0x6cae('0x39')](_0x26b6b2[_0x6cae('0x30')][_0x6cae('0x39')]);_0x535856['where']=qs[_0x6cae('0x31')](_[_0x6cae('0x3a')](_0x26b6b2[_0x6cae('0x30')],_0x93683a[_0x6cae('0x31')]),_0x18c8d0);if(_0x26b6b2[_0x6cae('0x30')]['filter']){_0x535856['where']=_[_0x6cae('0x3b')](_0x535856[_0x6cae('0x3c')],{'$or':_[_0x6cae('0x29')](_0x18c8d0,function(_0x442223){if(_0x442223[_0x6cae('0x3d')]!==_0x6cae('0x3e')){var _0x56269b={};_0x56269b[_0x442223[_0x6cae('0x2f')]]={'$like':'%'+_0x26b6b2[_0x6cae('0x30')][_0x6cae('0x3f')]+'%'};return _0x56269b;}})});}_0x535856=_[_0x6cae('0x3b')]({},_0x535856,_0x26b6b2['options']);var _0x4ee693={'where':_0x535856[_0x6cae('0x3c')]};return db[_0x6cae('0x2a')]['count'](_0x4ee693)[_0x6cae('0x23')](function(_0x3efb85){_0x32437e[_0x6cae('0x1b')]=_0x3efb85;if(_0x26b6b2[_0x6cae('0x30')][_0x6cae('0x40')]){_0x535856[_0x6cae('0x41')]=[{'all':!![]}];}return db[_0x6cae('0x2a')][_0x6cae('0x42')](_0x535856);})[_0x6cae('0x23')](function(_0xdeae59){_0x32437e[_0x6cae('0x43')]=_0xdeae59;return _0x32437e;})[_0x6cae('0x23')](respondWithFilteredResult(_0x16547d,_0x535856))[_0x6cae('0x44')](handleError(_0x16547d,null));};exports[_0x6cae('0x45')]=function(_0x378fe1,_0x3a8752){var _0x3006d7={'raw':![],'where':{'id':_0x378fe1['params']['id']}},_0x18de00={};_0x18de00['model']=_[_0x6cae('0x46')](db[_0x6cae('0x2a')]['rawAttributes']);_0x18de00['query']=_['keys'](_0x378fe1[_0x6cae('0x30')]);_0x18de00[_0x6cae('0x31')]=_[_0x6cae('0x32')](_0x18de00['model'],_0x18de00[_0x6cae('0x30')]);_0x3006d7[_0x6cae('0x34')]=_[_0x6cae('0x32')](_0x18de00[_0x6cae('0x2e')],qs[_0x6cae('0x33')](_0x378fe1[_0x6cae('0x30')][_0x6cae('0x33')]));_0x3006d7['attributes']=_0x3006d7[_0x6cae('0x34')][_0x6cae('0x35')]?_0x3006d7[_0x6cae('0x34')]:_0x18de00[_0x6cae('0x2e')];if(_0x378fe1[_0x6cae('0x30')][_0x6cae('0x40')]){_0x3006d7[_0x6cae('0x41')]=[{'all':!![]}];}_0x3006d7=_[_0x6cae('0x3b')]({},_0x3006d7,_0x378fe1[_0x6cae('0x47')]);return db[_0x6cae('0x2a')][_0x6cae('0x48')](_0x3006d7)[_0x6cae('0x23')](handleEntityNotFound(_0x3a8752,null))[_0x6cae('0x23')](respondWithResult(_0x3a8752,null))[_0x6cae('0x44')](handleError(_0x3a8752,null));};exports[_0x6cae('0x49')]=function(_0x4dbbe4,_0x5725f7){return db[_0x6cae('0x2a')][_0x6cae('0x49')](_0x4dbbe4[_0x6cae('0x4a')],{})[_0x6cae('0x23')](respondWithResult(_0x5725f7,0xc9))[_0x6cae('0x44')](handleError(_0x5725f7,null));};exports['update']=function(_0x11000b,_0x2555c9){if(_0x11000b[_0x6cae('0x4a')]['id']){delete _0x11000b[_0x6cae('0x4a')]['id'];}return db['Dynamics365Configuration']['find']({'where':{'id':_0x11000b['params']['id']}})[_0x6cae('0x23')](handleEntityNotFound(_0x2555c9,null))[_0x6cae('0x23')](saveUpdates(_0x11000b['body'],null))[_0x6cae('0x23')](respondWithResult(_0x2555c9,null))[_0x6cae('0x44')](handleError(_0x2555c9,null));};exports[_0x6cae('0x22')]=function(_0x363040,_0x5e3d51){return db['Dynamics365Configuration'][_0x6cae('0x48')]({'where':{'id':_0x363040[_0x6cae('0x4b')]['id']}})[_0x6cae('0x23')](handleEntityNotFound(_0x5e3d51,null))[_0x6cae('0x23')](removeEntity(_0x5e3d51,null))[_0x6cae('0x44')](handleError(_0x5e3d51,null));};exports['getFields']=function(_0x29ffe0,_0x4b01ae,_0x2b0815){var _0x75de29={};var _0x3f393c={};var _0x130998;var _0x4433e6;return db[_0x6cae('0x2a')][_0x6cae('0x4c')]({'where':{'id':_0x29ffe0[_0x6cae('0x4b')]['id']}})[_0x6cae('0x23')](handleEntityNotFound(_0x4b01ae,null))[_0x6cae('0x23')](function(_0x13dcea){if(_0x13dcea){_0x130998=_0x13dcea;_0x3f393c['model']=_[_0x6cae('0x46')](db['Dynamics365Field'][_0x6cae('0x2b')]);_0x3f393c[_0x6cae('0x30')]=_['keys'](_0x29ffe0[_0x6cae('0x30')]);_0x3f393c[_0x6cae('0x31')]=_[_0x6cae('0x32')](_0x3f393c[_0x6cae('0x2e')],_0x3f393c[_0x6cae('0x30')]);_0x75de29[_0x6cae('0x34')]=_['intersection'](_0x3f393c[_0x6cae('0x2e')],qs['fields'](_0x29ffe0['query'][_0x6cae('0x33')]));_0x75de29['attributes']=_0x75de29[_0x6cae('0x34')][_0x6cae('0x35')]?_0x75de29[_0x6cae('0x34')]:_0x3f393c['model'];_0x75de29[_0x6cae('0x38')]=qs[_0x6cae('0x39')](_0x29ffe0[_0x6cae('0x30')]['sort']);_0x75de29['where']=qs[_0x6cae('0x31')](_[_0x6cae('0x3a')](_0x29ffe0[_0x6cae('0x30')],_0x3f393c['filters']));if(_0x29ffe0[_0x6cae('0x30')][_0x6cae('0x3f')]){_0x75de29[_0x6cae('0x3c')]=_[_0x6cae('0x3b')](_0x75de29['where'],{'$or':_[_0x6cae('0x29')](_0x75de29['attributes'],function(_0x5318f9){var _0x5e4fc8={};_0x5e4fc8[_0x5318f9]={'$like':'%'+_0x29ffe0['query'][_0x6cae('0x3f')]+'%'};return _0x5e4fc8;})});}_0x75de29=_[_0x6cae('0x3b')]({},_0x75de29,_0x29ffe0[_0x6cae('0x47')]);return _0x130998[_0x6cae('0x4d')](_0x75de29);}})['then'](function(_0x33bbe5){if(_0x33bbe5){_0x4433e6=_0x33bbe5['length'];if(!_0x29ffe0[_0x6cae('0x30')][_0x6cae('0x36')](_0x6cae('0x37'))){_0x75de29[_0x6cae('0x1a')]=qs[_0x6cae('0x1a')](_0x29ffe0['query']['limit']);_0x75de29['offset']=qs['offset'](_0x29ffe0[_0x6cae('0x30')][_0x6cae('0x18')]);}return _0x130998['getFields'](_0x75de29);}})[_0x6cae('0x23')](function(_0x55e9a6){if(_0x55e9a6){return _0x55e9a6?{'count':_0x4433e6,'rows':_0x55e9a6}:null;}})[_0x6cae('0x23')](respondWithResult(_0x4b01ae,null))[_0x6cae('0x44')](handleError(_0x4b01ae,null));};exports['getSubjects']=function(_0x271ece,_0x4b482a,_0x4b65f2){var _0x37e8dd={};var _0x5b0ff2={};var _0x5e43d8;var _0x379ef2;return db[_0x6cae('0x2a')][_0x6cae('0x4c')]({'where':{'id':_0x271ece[_0x6cae('0x4b')]['id']}})[_0x6cae('0x23')](handleEntityNotFound(_0x4b482a,null))['then'](function(_0x52e56f){if(_0x52e56f){_0x5e43d8=_0x52e56f;_0x5b0ff2[_0x6cae('0x2e')]=_[_0x6cae('0x46')](db[_0x6cae('0x4e')][_0x6cae('0x2b')]);_0x5b0ff2[_0x6cae('0x30')]=_[_0x6cae('0x46')](_0x271ece[_0x6cae('0x30')]);_0x5b0ff2[_0x6cae('0x31')]=_[_0x6cae('0x32')](_0x5b0ff2['model'],_0x5b0ff2[_0x6cae('0x30')]);_0x37e8dd[_0x6cae('0x34')]=_[_0x6cae('0x32')](_0x5b0ff2[_0x6cae('0x2e')],qs[_0x6cae('0x33')](_0x271ece['query'][_0x6cae('0x33')]));_0x37e8dd[_0x6cae('0x34')]=_0x37e8dd[_0x6cae('0x34')][_0x6cae('0x35')]?_0x37e8dd[_0x6cae('0x34')]:_0x5b0ff2[_0x6cae('0x2e')];_0x37e8dd[_0x6cae('0x38')]=qs[_0x6cae('0x39')](_0x271ece['query'][_0x6cae('0x39')]);_0x37e8dd[_0x6cae('0x3c')]=qs[_0x6cae('0x31')](_[_0x6cae('0x3a')](_0x271ece['query'],_0x5b0ff2[_0x6cae('0x31')]));if(_0x271ece['query'][_0x6cae('0x3f')]){_0x37e8dd[_0x6cae('0x3c')]=_[_0x6cae('0x3b')](_0x37e8dd[_0x6cae('0x3c')],{'$or':_[_0x6cae('0x29')](_0x37e8dd[_0x6cae('0x34')],function(_0x1d0909){var _0x30bb1a={};_0x30bb1a[_0x1d0909]={'$like':'%'+_0x271ece[_0x6cae('0x30')][_0x6cae('0x3f')]+'%'};return _0x30bb1a;})});}_0x37e8dd=_[_0x6cae('0x3b')]({},_0x37e8dd,_0x271ece[_0x6cae('0x47')]);return _0x5e43d8[_0x6cae('0x4f')](_0x37e8dd);}})[_0x6cae('0x23')](function(_0x2a9c19){if(_0x2a9c19){_0x379ef2=_0x2a9c19['length'];if(!_0x271ece[_0x6cae('0x30')][_0x6cae('0x36')](_0x6cae('0x37'))){_0x37e8dd['limit']=qs[_0x6cae('0x1a')](_0x271ece[_0x6cae('0x30')][_0x6cae('0x1a')]);_0x37e8dd[_0x6cae('0x18')]=qs[_0x6cae('0x18')](_0x271ece[_0x6cae('0x30')][_0x6cae('0x18')]);}return _0x5e43d8[_0x6cae('0x4f')](_0x37e8dd);}})[_0x6cae('0x23')](function(_0x201006){if(_0x201006){return _0x201006?{'count':_0x379ef2,'rows':_0x201006}:null;}})[_0x6cae('0x23')](respondWithResult(_0x4b482a,null))[_0x6cae('0x44')](handleError(_0x4b482a,null));};exports[_0x6cae('0x50')]=function(_0x4f7945,_0x3f5650,_0x21e173){var _0x496536={};var _0x189d15={};var _0x7421e9;var _0x2ec0db;return db[_0x6cae('0x2a')][_0x6cae('0x4c')]({'where':{'id':_0x4f7945[_0x6cae('0x4b')]['id']}})[_0x6cae('0x23')](handleEntityNotFound(_0x3f5650,null))['then'](function(_0x1b4a03){if(_0x1b4a03){_0x7421e9=_0x1b4a03;_0x189d15[_0x6cae('0x2e')]=_[_0x6cae('0x46')](db[_0x6cae('0x4e')][_0x6cae('0x2b')]);_0x189d15[_0x6cae('0x30')]=_[_0x6cae('0x46')](_0x4f7945[_0x6cae('0x30')]);_0x189d15[_0x6cae('0x31')]=_[_0x6cae('0x32')](_0x189d15[_0x6cae('0x2e')],_0x189d15[_0x6cae('0x30')]);_0x496536[_0x6cae('0x34')]=_[_0x6cae('0x32')](_0x189d15[_0x6cae('0x2e')],qs[_0x6cae('0x33')](_0x4f7945[_0x6cae('0x30')][_0x6cae('0x33')]));_0x496536[_0x6cae('0x34')]=_0x496536[_0x6cae('0x34')][_0x6cae('0x35')]?_0x496536[_0x6cae('0x34')]:_0x189d15[_0x6cae('0x2e')];_0x496536[_0x6cae('0x38')]=qs[_0x6cae('0x39')](_0x4f7945[_0x6cae('0x30')][_0x6cae('0x39')]);_0x496536[_0x6cae('0x3c')]=qs[_0x6cae('0x31')](_[_0x6cae('0x3a')](_0x4f7945[_0x6cae('0x30')],_0x189d15['filters']));if(_0x4f7945[_0x6cae('0x30')][_0x6cae('0x3f')]){_0x496536[_0x6cae('0x3c')]=_['merge'](_0x496536['where'],{'$or':_[_0x6cae('0x29')](_0x496536['attributes'],function(_0x38d98f){var _0x2ed796={};_0x2ed796[_0x38d98f]={'$like':'%'+_0x4f7945[_0x6cae('0x30')]['filter']+'%'};return _0x2ed796;})});}_0x496536=_[_0x6cae('0x3b')]({},_0x496536,_0x4f7945[_0x6cae('0x47')]);return _0x7421e9['getDescriptions'](_0x496536);}})[_0x6cae('0x23')](function(_0x5de444){if(_0x5de444){_0x2ec0db=_0x5de444[_0x6cae('0x35')];if(!_0x4f7945[_0x6cae('0x30')]['hasOwnProperty'](_0x6cae('0x37'))){_0x496536['limit']=qs[_0x6cae('0x1a')](_0x4f7945[_0x6cae('0x30')]['limit']);_0x496536['offset']=qs[_0x6cae('0x18')](_0x4f7945[_0x6cae('0x30')][_0x6cae('0x18')]);}return _0x7421e9[_0x6cae('0x50')](_0x496536);}})['then'](function(_0x488ab9){if(_0x488ab9){return _0x488ab9?{'count':_0x2ec0db,'rows':_0x488ab9}:null;}})[_0x6cae('0x23')](respondWithResult(_0x3f5650,null))[_0x6cae('0x44')](handleError(_0x3f5650,null));}; \ No newline at end of file +var _0xbf86=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','offset','limit','undefined','count','set','Content-Range','json','reject','update','then','destroy','stack','name','send','index','Dynamics365Configuration','rawAttributes','fieldName','type','key','map','query','keys','model','attributes','intersection','fields','length','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','includeAll','find','create','body','Dynamics365Field','order','getFields','getSubjects','hasOwnProperty','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs'];(function(_0x388b47,_0x5cdac5){var _0x4859df=function(_0x466a16){while(--_0x466a16){_0x388b47['push'](_0x388b47['shift']());}};_0x4859df(++_0x5cdac5);}(_0xbf86,0x134));var _0x6bf8=function(_0xb08125,_0x561acb){_0xb08125=_0xb08125-0x0;var _0x2ace23=_0xbf86[_0xb08125];return _0x2ace23;};'use strict';var emlformat=require(_0x6bf8('0x0'));var rimraf=require(_0x6bf8('0x1'));var zipdir=require(_0x6bf8('0x2'));var jsonpatch=require(_0x6bf8('0x3'));var rp=require(_0x6bf8('0x4'));var moment=require(_0x6bf8('0x5'));var BPromise=require(_0x6bf8('0x6'));var Mustache=require('mustache');var util=require(_0x6bf8('0x7'));var path=require(_0x6bf8('0x8'));var sox=require(_0x6bf8('0x9'));var csv=require(_0x6bf8('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6bf8('0xb'));var _=require(_0x6bf8('0xc'));var squel=require(_0x6bf8('0xd'));var crypto=require(_0x6bf8('0xe'));var jsforce=require(_0x6bf8('0xf'));var deskjs=require(_0x6bf8('0x10'));var toCsv=require(_0x6bf8('0xa'));var querystring=require('querystring');var Papa=require(_0x6bf8('0x11'));var Redis=require('ioredis');var authService=require(_0x6bf8('0x12'));var qs=require(_0x6bf8('0x13'));var as=require(_0x6bf8('0x14'));var hardwareService=require(_0x6bf8('0x15'));var logger=require(_0x6bf8('0x16'))(_0x6bf8('0x17'));var utils=require(_0x6bf8('0x18'));var config=require(_0x6bf8('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x6bf8('0x1a'))['db'];function respondWithStatusCode(_0x248360,_0x15ef62){_0x15ef62=_0x15ef62||0xcc;return function(_0x30877b){if(_0x30877b){return _0x248360['sendStatus'](_0x15ef62);}return _0x248360[_0x6bf8('0x1b')](_0x15ef62)[_0x6bf8('0x1c')]();};}function respondWithResult(_0x300713,_0x41c3bd){_0x41c3bd=_0x41c3bd||0xc8;return function(_0x3f5410){if(_0x3f5410){return _0x300713[_0x6bf8('0x1b')](_0x41c3bd)['json'](_0x3f5410);}};}function respondWithFilteredResult(_0x49b056,_0x295423){return function(_0x4c5552){if(_0x4c5552){var _0x35c7b5=typeof _0x295423[_0x6bf8('0x1d')]==='undefined'&&typeof _0x295423[_0x6bf8('0x1e')]===_0x6bf8('0x1f');var _0x9000f7=_0x4c5552[_0x6bf8('0x20')];var _0x48969d=_0x35c7b5?0x0:_0x295423[_0x6bf8('0x1d')];var _0x3b197a=_0x35c7b5?_0x4c5552[_0x6bf8('0x20')]:_0x295423[_0x6bf8('0x1d')]+_0x295423['limit'];var _0x56cb4e;if(_0x3b197a>=_0x9000f7){_0x3b197a=_0x9000f7;_0x56cb4e=0xc8;}else{_0x56cb4e=0xce;}_0x49b056[_0x6bf8('0x1b')](_0x56cb4e);return _0x49b056[_0x6bf8('0x21')](_0x6bf8('0x22'),_0x48969d+'-'+_0x3b197a+'/'+_0x9000f7)[_0x6bf8('0x23')](_0x4c5552);}return null;};}function patchUpdates(_0x34fd4a){return function(_0x376f6d){try{jsonpatch['apply'](_0x376f6d,_0x34fd4a,!![]);}catch(_0x4c39b6){return BPromise[_0x6bf8('0x24')](_0x4c39b6);}return _0x376f6d['save']();};}function saveUpdates(_0x51bfd2,_0x266747){return function(_0x27e11e){if(_0x27e11e){return _0x27e11e[_0x6bf8('0x25')](_0x51bfd2)[_0x6bf8('0x26')](function(_0x6d9b13){return _0x6d9b13;});}return null;};}function removeEntity(_0x5e6d95,_0x59317e){return function(_0x4bf155){if(_0x4bf155){return _0x4bf155[_0x6bf8('0x27')]()['then'](function(){_0x5e6d95[_0x6bf8('0x1b')](0xcc)[_0x6bf8('0x1c')]();});}};}function handleEntityNotFound(_0x158229,_0x353708){return function(_0x310876){if(!_0x310876){_0x158229['sendStatus'](0x194);}return _0x310876;};}function handleError(_0x4f460d,_0x7500f0){_0x7500f0=_0x7500f0||0x1f4;return function(_0x5be012){logger['error'](_0x5be012[_0x6bf8('0x28')]);if(_0x5be012[_0x6bf8('0x29')]){delete _0x5be012[_0x6bf8('0x29')];}_0x4f460d['status'](_0x7500f0)[_0x6bf8('0x2a')](_0x5be012);};}exports[_0x6bf8('0x2b')]=function(_0x17db70,_0x2c71ed){var _0x5277e6={},_0x4f722f={},_0x48ed73={'count':0x0,'rows':[]};var _0x5b1084=_['map'](db[_0x6bf8('0x2c')][_0x6bf8('0x2d')],function(_0x46fdac){return{'name':_0x46fdac[_0x6bf8('0x2e')],'type':_0x46fdac[_0x6bf8('0x2f')][_0x6bf8('0x30')]};});_0x4f722f['model']=_[_0x6bf8('0x31')](_0x5b1084,'name');_0x4f722f[_0x6bf8('0x32')]=_[_0x6bf8('0x33')](_0x17db70[_0x6bf8('0x32')]);_0x4f722f['filters']=_['intersection'](_0x4f722f[_0x6bf8('0x34')],_0x4f722f[_0x6bf8('0x32')]);_0x5277e6[_0x6bf8('0x35')]=_[_0x6bf8('0x36')](_0x4f722f[_0x6bf8('0x34')],qs[_0x6bf8('0x37')](_0x17db70['query'][_0x6bf8('0x37')]));_0x5277e6[_0x6bf8('0x35')]=_0x5277e6[_0x6bf8('0x35')][_0x6bf8('0x38')]?_0x5277e6[_0x6bf8('0x35')]:_0x4f722f[_0x6bf8('0x34')];if(!_0x17db70[_0x6bf8('0x32')]['hasOwnProperty'](_0x6bf8('0x39'))){_0x5277e6[_0x6bf8('0x1e')]=qs[_0x6bf8('0x1e')](_0x17db70[_0x6bf8('0x32')][_0x6bf8('0x1e')]);_0x5277e6[_0x6bf8('0x1d')]=qs['offset'](_0x17db70[_0x6bf8('0x32')][_0x6bf8('0x1d')]);}_0x5277e6['order']=qs[_0x6bf8('0x3a')](_0x17db70[_0x6bf8('0x32')]['sort']);_0x5277e6[_0x6bf8('0x3b')]=qs[_0x6bf8('0x3c')](_[_0x6bf8('0x3d')](_0x17db70[_0x6bf8('0x32')],_0x4f722f[_0x6bf8('0x3c')]),_0x5b1084);if(_0x17db70[_0x6bf8('0x32')][_0x6bf8('0x3e')]){_0x5277e6[_0x6bf8('0x3b')]=_[_0x6bf8('0x3f')](_0x5277e6[_0x6bf8('0x3b')],{'$or':_[_0x6bf8('0x31')](_0x5b1084,function(_0x3a0afc){if(_0x3a0afc[_0x6bf8('0x2f')]!==_0x6bf8('0x40')){var _0x4ca13b={};_0x4ca13b[_0x3a0afc[_0x6bf8('0x29')]]={'$like':'%'+_0x17db70['query']['filter']+'%'};return _0x4ca13b;}})});}_0x5277e6=_[_0x6bf8('0x3f')]({},_0x5277e6,_0x17db70[_0x6bf8('0x41')]);var _0x334929={'where':_0x5277e6[_0x6bf8('0x3b')]};return db['Dynamics365Configuration']['count'](_0x334929)[_0x6bf8('0x26')](function(_0x3ba09c){_0x48ed73[_0x6bf8('0x20')]=_0x3ba09c;if(_0x17db70[_0x6bf8('0x32')]['includeAll']){_0x5277e6[_0x6bf8('0x42')]=[{'all':!![]}];}return db[_0x6bf8('0x2c')][_0x6bf8('0x43')](_0x5277e6);})['then'](function(_0x373c10){_0x48ed73[_0x6bf8('0x44')]=_0x373c10;return _0x48ed73;})[_0x6bf8('0x26')](respondWithFilteredResult(_0x2c71ed,_0x5277e6))[_0x6bf8('0x45')](handleError(_0x2c71ed,null));};exports[_0x6bf8('0x46')]=function(_0x352edb,_0x4dcbb0){var _0x249aa2={'raw':![],'where':{'id':_0x352edb[_0x6bf8('0x47')]['id']}},_0x309a04={};_0x309a04['model']=_[_0x6bf8('0x33')](db[_0x6bf8('0x2c')][_0x6bf8('0x2d')]);_0x309a04[_0x6bf8('0x32')]=_[_0x6bf8('0x33')](_0x352edb['query']);_0x309a04['filters']=_[_0x6bf8('0x36')](_0x309a04['model'],_0x309a04['query']);_0x249aa2[_0x6bf8('0x35')]=_[_0x6bf8('0x36')](_0x309a04[_0x6bf8('0x34')],qs[_0x6bf8('0x37')](_0x352edb[_0x6bf8('0x32')][_0x6bf8('0x37')]));_0x249aa2['attributes']=_0x249aa2[_0x6bf8('0x35')][_0x6bf8('0x38')]?_0x249aa2[_0x6bf8('0x35')]:_0x309a04['model'];if(_0x352edb['query'][_0x6bf8('0x48')]){_0x249aa2['include']=[{'all':!![]}];}_0x249aa2=_[_0x6bf8('0x3f')]({},_0x249aa2,_0x352edb[_0x6bf8('0x41')]);return db[_0x6bf8('0x2c')][_0x6bf8('0x49')](_0x249aa2)['then'](handleEntityNotFound(_0x4dcbb0,null))[_0x6bf8('0x26')](respondWithResult(_0x4dcbb0,null))['catch'](handleError(_0x4dcbb0,null));};exports[_0x6bf8('0x4a')]=function(_0x36a4fb,_0x4a89de){return db[_0x6bf8('0x2c')][_0x6bf8('0x4a')](_0x36a4fb[_0x6bf8('0x4b')],{})[_0x6bf8('0x26')](respondWithResult(_0x4a89de,0xc9))[_0x6bf8('0x45')](handleError(_0x4a89de,null));};exports[_0x6bf8('0x25')]=function(_0x25c3e3,_0x4c4b82){if(_0x25c3e3['body']['id']){delete _0x25c3e3['body']['id'];}return db[_0x6bf8('0x2c')][_0x6bf8('0x49')]({'where':{'id':_0x25c3e3[_0x6bf8('0x47')]['id']}})[_0x6bf8('0x26')](handleEntityNotFound(_0x4c4b82,null))[_0x6bf8('0x26')](saveUpdates(_0x25c3e3[_0x6bf8('0x4b')],null))[_0x6bf8('0x26')](respondWithResult(_0x4c4b82,null))['catch'](handleError(_0x4c4b82,null));};exports[_0x6bf8('0x27')]=function(_0x26ff13,_0x4972f6){return db[_0x6bf8('0x2c')]['find']({'where':{'id':_0x26ff13[_0x6bf8('0x47')]['id']}})[_0x6bf8('0x26')](handleEntityNotFound(_0x4972f6,null))[_0x6bf8('0x26')](removeEntity(_0x4972f6,null))[_0x6bf8('0x45')](handleError(_0x4972f6,null));};exports['getFields']=function(_0xc85585,_0x23ff36,_0x429c74){var _0x4b3c24={};var _0x353edf={};var _0x52a63f;var _0x598629;return db[_0x6bf8('0x2c')]['findOne']({'where':{'id':_0xc85585[_0x6bf8('0x47')]['id']}})['then'](handleEntityNotFound(_0x23ff36,null))['then'](function(_0x425744){if(_0x425744){_0x52a63f=_0x425744;_0x353edf['model']=_['keys'](db[_0x6bf8('0x4c')][_0x6bf8('0x2d')]);_0x353edf[_0x6bf8('0x32')]=_['keys'](_0xc85585[_0x6bf8('0x32')]);_0x353edf[_0x6bf8('0x3c')]=_[_0x6bf8('0x36')](_0x353edf['model'],_0x353edf[_0x6bf8('0x32')]);_0x4b3c24['attributes']=_[_0x6bf8('0x36')](_0x353edf[_0x6bf8('0x34')],qs[_0x6bf8('0x37')](_0xc85585['query'][_0x6bf8('0x37')]));_0x4b3c24[_0x6bf8('0x35')]=_0x4b3c24['attributes'][_0x6bf8('0x38')]?_0x4b3c24[_0x6bf8('0x35')]:_0x353edf[_0x6bf8('0x34')];_0x4b3c24[_0x6bf8('0x4d')]=qs[_0x6bf8('0x3a')](_0xc85585[_0x6bf8('0x32')][_0x6bf8('0x3a')]);_0x4b3c24['where']=qs[_0x6bf8('0x3c')](_[_0x6bf8('0x3d')](_0xc85585[_0x6bf8('0x32')],_0x353edf[_0x6bf8('0x3c')]));if(_0xc85585[_0x6bf8('0x32')][_0x6bf8('0x3e')]){_0x4b3c24[_0x6bf8('0x3b')]=_[_0x6bf8('0x3f')](_0x4b3c24[_0x6bf8('0x3b')],{'$or':_[_0x6bf8('0x31')](_0x4b3c24[_0x6bf8('0x35')],function(_0x150db5){var _0x365473={};_0x365473[_0x150db5]={'$like':'%'+_0xc85585['query']['filter']+'%'};return _0x365473;})});}_0x4b3c24=_['merge']({},_0x4b3c24,_0xc85585[_0x6bf8('0x41')]);return _0x52a63f['getFields'](_0x4b3c24);}})[_0x6bf8('0x26')](function(_0x326fca){if(_0x326fca){_0x598629=_0x326fca[_0x6bf8('0x38')];if(!_0xc85585[_0x6bf8('0x32')]['hasOwnProperty']('nolimit')){_0x4b3c24[_0x6bf8('0x1e')]=qs[_0x6bf8('0x1e')](_0xc85585[_0x6bf8('0x32')][_0x6bf8('0x1e')]);_0x4b3c24[_0x6bf8('0x1d')]=qs['offset'](_0xc85585[_0x6bf8('0x32')][_0x6bf8('0x1d')]);}return _0x52a63f[_0x6bf8('0x4e')](_0x4b3c24);}})['then'](function(_0x5456e5){if(_0x5456e5){return _0x5456e5?{'count':_0x598629,'rows':_0x5456e5}:null;}})[_0x6bf8('0x26')](respondWithResult(_0x23ff36,null))[_0x6bf8('0x45')](handleError(_0x23ff36,null));};exports[_0x6bf8('0x4f')]=function(_0x1dcd6b,_0x522dd1,_0x3ec637){var _0xca9fa6={};var _0x3f7f8c={};var _0x4dbcf0;var _0x1be9b3;return db[_0x6bf8('0x2c')]['findOne']({'where':{'id':_0x1dcd6b[_0x6bf8('0x47')]['id']}})['then'](handleEntityNotFound(_0x522dd1,null))[_0x6bf8('0x26')](function(_0x4b8cf4){if(_0x4b8cf4){_0x4dbcf0=_0x4b8cf4;_0x3f7f8c['model']=_['keys'](db['Dynamics365Field']['rawAttributes']);_0x3f7f8c[_0x6bf8('0x32')]=_[_0x6bf8('0x33')](_0x1dcd6b[_0x6bf8('0x32')]);_0x3f7f8c[_0x6bf8('0x3c')]=_[_0x6bf8('0x36')](_0x3f7f8c['model'],_0x3f7f8c[_0x6bf8('0x32')]);_0xca9fa6[_0x6bf8('0x35')]=_['intersection'](_0x3f7f8c['model'],qs[_0x6bf8('0x37')](_0x1dcd6b[_0x6bf8('0x32')][_0x6bf8('0x37')]));_0xca9fa6[_0x6bf8('0x35')]=_0xca9fa6[_0x6bf8('0x35')][_0x6bf8('0x38')]?_0xca9fa6[_0x6bf8('0x35')]:_0x3f7f8c['model'];_0xca9fa6['order']=qs['sort'](_0x1dcd6b['query']['sort']);_0xca9fa6[_0x6bf8('0x3b')]=qs[_0x6bf8('0x3c')](_[_0x6bf8('0x3d')](_0x1dcd6b[_0x6bf8('0x32')],_0x3f7f8c[_0x6bf8('0x3c')]));if(_0x1dcd6b[_0x6bf8('0x32')][_0x6bf8('0x3e')]){_0xca9fa6[_0x6bf8('0x3b')]=_[_0x6bf8('0x3f')](_0xca9fa6[_0x6bf8('0x3b')],{'$or':_[_0x6bf8('0x31')](_0xca9fa6['attributes'],function(_0x6d17c6){var _0x3ff4a1={};_0x3ff4a1[_0x6d17c6]={'$like':'%'+_0x1dcd6b[_0x6bf8('0x32')][_0x6bf8('0x3e')]+'%'};return _0x3ff4a1;})});}_0xca9fa6=_[_0x6bf8('0x3f')]({},_0xca9fa6,_0x1dcd6b['options']);return _0x4dbcf0[_0x6bf8('0x4f')](_0xca9fa6);}})[_0x6bf8('0x26')](function(_0x1fe347){if(_0x1fe347){_0x1be9b3=_0x1fe347['length'];if(!_0x1dcd6b[_0x6bf8('0x32')][_0x6bf8('0x50')]('nolimit')){_0xca9fa6['limit']=qs['limit'](_0x1dcd6b[_0x6bf8('0x32')][_0x6bf8('0x1e')]);_0xca9fa6[_0x6bf8('0x1d')]=qs['offset'](_0x1dcd6b[_0x6bf8('0x32')][_0x6bf8('0x1d')]);}return _0x4dbcf0[_0x6bf8('0x4f')](_0xca9fa6);}})[_0x6bf8('0x26')](function(_0x4ed7fb){if(_0x4ed7fb){return _0x4ed7fb?{'count':_0x1be9b3,'rows':_0x4ed7fb}:null;}})[_0x6bf8('0x26')](respondWithResult(_0x522dd1,null))[_0x6bf8('0x45')](handleError(_0x522dd1,null));};exports[_0x6bf8('0x51')]=function(_0x2a7652,_0x246c33,_0x3a1d74){var _0x381b4a={};var _0x574f1e={};var _0x408885;var _0x5442b6;return db['Dynamics365Configuration']['findOne']({'where':{'id':_0x2a7652[_0x6bf8('0x47')]['id']}})[_0x6bf8('0x26')](handleEntityNotFound(_0x246c33,null))['then'](function(_0x3888d7){if(_0x3888d7){_0x408885=_0x3888d7;_0x574f1e[_0x6bf8('0x34')]=_[_0x6bf8('0x33')](db[_0x6bf8('0x4c')][_0x6bf8('0x2d')]);_0x574f1e[_0x6bf8('0x32')]=_[_0x6bf8('0x33')](_0x2a7652[_0x6bf8('0x32')]);_0x574f1e[_0x6bf8('0x3c')]=_[_0x6bf8('0x36')](_0x574f1e[_0x6bf8('0x34')],_0x574f1e['query']);_0x381b4a[_0x6bf8('0x35')]=_[_0x6bf8('0x36')](_0x574f1e['model'],qs[_0x6bf8('0x37')](_0x2a7652['query'][_0x6bf8('0x37')]));_0x381b4a[_0x6bf8('0x35')]=_0x381b4a[_0x6bf8('0x35')][_0x6bf8('0x38')]?_0x381b4a['attributes']:_0x574f1e['model'];_0x381b4a[_0x6bf8('0x4d')]=qs[_0x6bf8('0x3a')](_0x2a7652['query'][_0x6bf8('0x3a')]);_0x381b4a[_0x6bf8('0x3b')]=qs[_0x6bf8('0x3c')](_[_0x6bf8('0x3d')](_0x2a7652[_0x6bf8('0x32')],_0x574f1e[_0x6bf8('0x3c')]));if(_0x2a7652[_0x6bf8('0x32')]['filter']){_0x381b4a[_0x6bf8('0x3b')]=_[_0x6bf8('0x3f')](_0x381b4a[_0x6bf8('0x3b')],{'$or':_[_0x6bf8('0x31')](_0x381b4a[_0x6bf8('0x35')],function(_0xe6f006){var _0x578af3={};_0x578af3[_0xe6f006]={'$like':'%'+_0x2a7652[_0x6bf8('0x32')][_0x6bf8('0x3e')]+'%'};return _0x578af3;})});}_0x381b4a=_['merge']({},_0x381b4a,_0x2a7652[_0x6bf8('0x41')]);return _0x408885[_0x6bf8('0x51')](_0x381b4a);}})[_0x6bf8('0x26')](function(_0x163514){if(_0x163514){_0x5442b6=_0x163514['length'];if(!_0x2a7652[_0x6bf8('0x32')]['hasOwnProperty'](_0x6bf8('0x39'))){_0x381b4a[_0x6bf8('0x1e')]=qs[_0x6bf8('0x1e')](_0x2a7652[_0x6bf8('0x32')][_0x6bf8('0x1e')]);_0x381b4a[_0x6bf8('0x1d')]=qs[_0x6bf8('0x1d')](_0x2a7652[_0x6bf8('0x32')]['offset']);}return _0x408885['getDescriptions'](_0x381b4a);}})[_0x6bf8('0x26')](function(_0xd53316){if(_0xd53316){return _0xd53316?{'count':_0x5442b6,'rows':_0xd53316}:null;}})['then'](respondWithResult(_0x246c33,null))[_0x6bf8('0x45')](handleError(_0x246c33,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js index c16f4bf..caa2fa6 100644 --- a/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js +++ b/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5b02=['define','Dynamics365Configuration','lodash','util','../../config/logger','api','request-promise','rimraf','../../config/environment','./intDynamics365Configuration.attributes','exports'];(function(_0x2c5ac3,_0x42d24d){var _0x39f860=function(_0x424ca6){while(--_0x424ca6){_0x2c5ac3['push'](_0x2c5ac3['shift']());}};_0x39f860(++_0x42d24d);}(_0x5b02,0xe9));var _0x25b0=function(_0x40b912,_0x735fda){_0x40b912=_0x40b912-0x0;var _0x209ac3=_0x5b02[_0x40b912];return _0x209ac3;};'use strict';var _=require(_0x25b0('0x0'));var util=require(_0x25b0('0x1'));var logger=require(_0x25b0('0x2'))(_0x25b0('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x25b0('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x25b0('0x5'));var config=require(_0x25b0('0x6'));var attributes=require(_0x25b0('0x7'));module[_0x25b0('0x8')]=function(_0x2d84a9,_0x4eea55){return _0x2d84a9[_0x25b0('0x9')](_0x25b0('0xa'),attributes,{'tableName':'int_dynamics365_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x54ef=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intDynamics365Configuration.attributes','define','Dynamics365Configuration','lodash','util'];(function(_0x1b6ef7,_0x1df246){var _0x4e22bb=function(_0x379444){while(--_0x379444){_0x1b6ef7['push'](_0x1b6ef7['shift']());}};_0x4e22bb(++_0x1df246);}(_0x54ef,0x112));var _0xf54e=function(_0x2e3aba,_0x3c0747){_0x2e3aba=_0x2e3aba-0x0;var _0x57af1a=_0x54ef[_0x2e3aba];return _0x57af1a;};'use strict';var _=require(_0xf54e('0x0'));var util=require(_0xf54e('0x1'));var logger=require(_0xf54e('0x2'))('api');var moment=require(_0xf54e('0x3'));var BPromise=require(_0xf54e('0x4'));var rp=require(_0xf54e('0x5'));var fs=require('fs');var path=require(_0xf54e('0x6'));var rimraf=require(_0xf54e('0x7'));var config=require(_0xf54e('0x8'));var attributes=require(_0xf54e('0x9'));module['exports']=function(_0x55e611,_0x18e84e){return _0x55e611[_0xf54e('0xa')](_0xf54e('0xb'),attributes,{'tableName':'int_dynamics365_configurations','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 1ed2604..a61c431 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 _0x7458=['Dynamics365Configuration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','info','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x557fd2,_0x2c0a7a){var _0x1b54a2=function(_0x2e439b){while(--_0x2e439b){_0x557fd2['push'](_0x557fd2['shift']());}};_0x1b54a2(++_0x2c0a7a);}(_0x7458,0x9a));var _0x8745=function(_0x22a5c1,_0x4bf385){_0x22a5c1=_0x22a5c1-0x0;var _0x1e956e=_0x7458[_0x22a5c1];return _0x1e956e;};'use strict';var _=require(_0x8745('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x8745('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8745('0x2'));var db=require(_0x8745('0x3'))['db'];var utils=require(_0x8745('0x4'));var logger=require(_0x8745('0x5'))(_0x8745('0x6'));var config=require(_0x8745('0x7'));var jayson=require(_0x8745('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x531740,_0x3dbaf0,_0xb5f516){return new BPromise(function(_0x6b81e3,_0x293e1f){return client[_0x8745('0x9')](_0x531740,_0xb5f516)['then'](function(_0x3c0423){logger[_0x8745('0xa')](_0x8745('0xb'),_0x3dbaf0,_0x8745('0xc'));logger[_0x8745('0xd')](_0x8745('0xe'),_0x3dbaf0,'request\x20sent',JSON[_0x8745('0xf')](_0x3c0423));if(_0x3c0423[_0x8745('0x10')]){if(_0x3c0423[_0x8745('0x10')][_0x8745('0x11')]===0x1f4){logger[_0x8745('0x10')](_0x8745('0xb'),_0x3dbaf0,_0x3c0423['error'][_0x8745('0x12')]);return _0x293e1f(_0x3c0423['error'][_0x8745('0x12')]);}logger['error'](_0x8745('0xb'),_0x3dbaf0,_0x3c0423['error'][_0x8745('0x12')]);return _0x6b81e3(_0x3c0423[_0x8745('0x10')]['message']);}else{logger[_0x8745('0xa')](_0x8745('0xb'),_0x3dbaf0,_0x8745('0xc'));_0x6b81e3(_0x3c0423[_0x8745('0x13')][_0x8745('0x12')]);}})[_0x8745('0x14')](function(_0x3ce4ad){logger[_0x8745('0x10')]('Dynamics365Configuration,\x20%s,\x20%s',_0x3dbaf0,_0x3ce4ad);_0x293e1f(_0x3ce4ad);});});} \ No newline at end of file +var _0xd670=['../../config/utils','rpc','jayson/promise','http','request','then','info','request\x20sent','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','stringify','code','error','Dynamics365Configuration,\x20%s,\x20%s','message','result','lodash','moment','bluebird','randomstring','ioredis'];(function(_0x24259d,_0x64a194){var _0x5a701=function(_0x204516){while(--_0x204516){_0x24259d['push'](_0x24259d['shift']());}};_0x5a701(++_0x64a194);}(_0xd670,0xff));var _0x0d67=function(_0x1e0fd0,_0x59f0a4){_0x1e0fd0=_0x1e0fd0-0x0;var _0x23c29e=_0xd670[_0x1e0fd0];return _0x23c29e;};'use strict';var _=require(_0x0d67('0x0'));var util=require('util');var moment=require(_0x0d67('0x1'));var BPromise=require(_0x0d67('0x2'));var rs=require(_0x0d67('0x3'));var fs=require('fs');var Redis=require(_0x0d67('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x0d67('0x5'));var logger=require('../../config/logger')(_0x0d67('0x6'));var config=require('../../config/environment');var jayson=require(_0x0d67('0x7'));var client=jayson['client'][_0x0d67('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4d043f,_0x1b5d17,_0x2f89dc){return new BPromise(function(_0x59c2da,_0x1d461b){return client[_0x0d67('0x9')](_0x4d043f,_0x2f89dc)[_0x0d67('0xa')](function(_0x5badf6){logger[_0x0d67('0xb')]('Dynamics365Configuration,\x20%s,\x20%s',_0x1b5d17,_0x0d67('0xc'));logger['debug'](_0x0d67('0xd'),_0x1b5d17,'request\x20sent',JSON[_0x0d67('0xe')](_0x5badf6));if(_0x5badf6['error']){if(_0x5badf6['error'][_0x0d67('0xf')]===0x1f4){logger[_0x0d67('0x10')](_0x0d67('0x11'),_0x1b5d17,_0x5badf6['error'][_0x0d67('0x12')]);return _0x1d461b(_0x5badf6[_0x0d67('0x10')][_0x0d67('0x12')]);}logger[_0x0d67('0x10')](_0x0d67('0x11'),_0x1b5d17,_0x5badf6[_0x0d67('0x10')]['message']);return _0x59c2da(_0x5badf6[_0x0d67('0x10')][_0x0d67('0x12')]);}else{logger[_0x0d67('0xb')]('Dynamics365Configuration,\x20%s,\x20%s',_0x1b5d17,'request\x20sent');_0x59c2da(_0x5badf6[_0x0d67('0x13')][_0x0d67('0x12')]);}})['catch'](function(_0x4bf7a4){logger[_0x0d67('0x10')]('Dynamics365Configuration,\x20%s,\x20%s',_0x1b5d17,_0x4bf7a4);_0x1d461b(_0x4bf7a4);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Field/index.js b/server/api/intDynamics365Field/index.js index 5dd1a7f..fba0d49 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 _0x14f4=['isAuthenticated','index','/:id','show','post','put','update','delete','destroy','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Field.controller','get'];(function(_0x47a7d0,_0x4e182d){var _0xb9bd08=function(_0x588ee2){while(--_0x588ee2){_0x47a7d0['push'](_0x47a7d0['shift']());}};_0xb9bd08(++_0x4e182d);}(_0x14f4,0xbd));var _0x414f=function(_0x4a68,_0x174f67){_0x4a68=_0x4a68-0x0;var _0x595b12=_0x14f4[_0x4a68];return _0x595b12;};'use strict';var multer=require(_0x414f('0x0'));var util=require(_0x414f('0x1'));var path=require(_0x414f('0x2'));var timeout=require('connect-timeout');var express=require(_0x414f('0x3'));var router=express[_0x414f('0x4')]();var fs_extra=require(_0x414f('0x5'));var auth=require(_0x414f('0x6'));var interaction=require(_0x414f('0x7'));var config=require(_0x414f('0x8'));var controller=require(_0x414f('0x9'));router[_0x414f('0xa')]('/',auth[_0x414f('0xb')](),controller[_0x414f('0xc')]);router['get'](_0x414f('0xd'),auth[_0x414f('0xb')](),controller[_0x414f('0xe')]);router[_0x414f('0xf')]('/',auth[_0x414f('0xb')](),controller['create']);router[_0x414f('0x10')](_0x414f('0xd'),auth[_0x414f('0xb')](),controller[_0x414f('0x11')]);router[_0x414f('0x12')](_0x414f('0xd'),auth['isAuthenticated'](),controller[_0x414f('0x13')]);module['exports']=router; \ No newline at end of file +var _0xe2f8=['get','isAuthenticated','post','create','put','/:id','destroy','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intDynamics365Field.controller'];(function(_0x413813,_0xafa8f7){var _0x1f7e54=function(_0x3cd07e){while(--_0x3cd07e){_0x413813['push'](_0x413813['shift']());}};_0x1f7e54(++_0xafa8f7);}(_0xe2f8,0x9d));var _0x8e2f=function(_0x38161d,_0x3865d0){_0x38161d=_0x38161d-0x0;var _0x218802=_0xe2f8[_0x38161d];return _0x218802;};'use strict';var multer=require('multer');var util=require(_0x8e2f('0x0'));var path=require(_0x8e2f('0x1'));var timeout=require('connect-timeout');var express=require(_0x8e2f('0x2'));var router=express[_0x8e2f('0x3')]();var fs_extra=require(_0x8e2f('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x8e2f('0x5'));var config=require(_0x8e2f('0x6'));var controller=require(_0x8e2f('0x7'));router[_0x8e2f('0x8')]('/',auth[_0x8e2f('0x9')](),controller['index']);router[_0x8e2f('0x8')]('/:id',auth[_0x8e2f('0x9')](),controller['show']);router[_0x8e2f('0xa')]('/',auth[_0x8e2f('0x9')](),controller[_0x8e2f('0xb')]);router[_0x8e2f('0xc')](_0x8e2f('0xd'),auth[_0x8e2f('0x9')](),controller['update']);router['delete'](_0x8e2f('0xd'),auth[_0x8e2f('0x9')](),controller[_0x8e2f('0xe')]);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 6c150ae..413d164 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 _0x8da2=['customVariable','keyValue','picklist','STRING','BOOLEAN','exports','ENUM','string','variable'];(function(_0x1ca9eb,_0x99a10b){var _0x2e284e=function(_0x1196a4){while(--_0x1196a4){_0x1ca9eb['push'](_0x1ca9eb['shift']());}};_0x2e284e(++_0x99a10b);}(_0x8da2,0xd4));var _0x28da=function(_0x552444,_0x460612){_0x552444=_0x552444-0x0;var _0x4bac58=_0x8da2[_0x552444];return _0x4bac58;};'use strict';var Sequelize=require('sequelize');module[_0x28da('0x0')]={'type':{'type':Sequelize[_0x28da('0x1')](_0x28da('0x2'),_0x28da('0x3'),_0x28da('0x4'),_0x28da('0x5'),_0x28da('0x6')),'defaultValue':_0x28da('0x2')},'content':{'type':Sequelize[_0x28da('0x7')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x28da('0x1')](_0x28da('0x2'),'variable',_0x28da('0x4'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x28da('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x28da('0x7')]}}; \ No newline at end of file +var _0x50de=['STRING','variable','sequelize','exports','ENUM','string','customVariable','keyValue','picklist'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0x50de,0xd1));var _0xe50d=function(_0x10d0f0,_0x1eba3d){_0x10d0f0=_0x10d0f0-0x0;var _0x93e308=_0x50de[_0x10d0f0];return _0x93e308;};'use strict';var Sequelize=require(_0xe50d('0x0'));module[_0xe50d('0x1')]={'type':{'type':Sequelize[_0xe50d('0x2')](_0xe50d('0x3'),'variable',_0xe50d('0x4'),_0xe50d('0x5'),_0xe50d('0x6')),'defaultValue':'string'},'content':{'type':Sequelize[_0xe50d('0x7')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xe50d('0x2')](_0xe50d('0x3'),_0xe50d('0x8'),_0xe50d('0x4'))},'keyContent':{'type':Sequelize[_0xe50d('0x7')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0xe50d('0x7')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xe50d('0x7')]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.controller.js b/server/api/intDynamics365Field/intDynamics365Field.controller.js index 0af6874..054dc4b 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 _0x31f4=['sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','include','create','body','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','json','reject','save','update','then','destroy','error','stack','name','map','Dynamics365Field','rawAttributes','fieldName','type','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order'];(function(_0x549ede,_0x359243){var _0x43d15d=function(_0x1253bf){while(--_0x1253bf){_0x549ede['push'](_0x549ede['shift']());}};_0x43d15d(++_0x359243);}(_0x31f4,0xef));var _0x431f=function(_0xc40b9f,_0x17ec1f){_0xc40b9f=_0xc40b9f-0x0;var _0x535b9c=_0x31f4[_0xc40b9f];return _0x535b9c;};'use strict';var emlformat=require(_0x431f('0x0'));var rimraf=require(_0x431f('0x1'));var zipdir=require(_0x431f('0x2'));var jsonpatch=require(_0x431f('0x3'));var rp=require(_0x431f('0x4'));var moment=require(_0x431f('0x5'));var BPromise=require(_0x431f('0x6'));var Mustache=require('mustache');var util=require(_0x431f('0x7'));var path=require(_0x431f('0x8'));var sox=require(_0x431f('0x9'));var csv=require(_0x431f('0xa'));var ejs=require(_0x431f('0xb'));var fs=require('fs');var fs_extra=require(_0x431f('0xc'));var _=require('lodash');var squel=require(_0x431f('0xd'));var crypto=require('crypto');var jsforce=require(_0x431f('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x431f('0xa'));var querystring=require('querystring');var Papa=require(_0x431f('0xf'));var Redis=require(_0x431f('0x10'));var authService=require(_0x431f('0x11'));var qs=require(_0x431f('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x431f('0x13'));var logger=require('../../config/logger')(_0x431f('0x14'));var utils=require(_0x431f('0x15'));var config=require(_0x431f('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x431f('0x17'))['db'];function respondWithStatusCode(_0x52be6e,_0x445b21){_0x445b21=_0x445b21||0xcc;return function(_0x896d8d){if(_0x896d8d){return _0x52be6e[_0x431f('0x18')](_0x445b21);}return _0x52be6e[_0x431f('0x19')](_0x445b21)[_0x431f('0x1a')]();};}function respondWithResult(_0xc75e66,_0x4a6127){_0x4a6127=_0x4a6127||0xc8;return function(_0x51e433){if(_0x51e433){return _0xc75e66[_0x431f('0x19')](_0x4a6127)['json'](_0x51e433);}};}function respondWithFilteredResult(_0xb84fa,_0xacc352){return function(_0x327ca7){if(_0x327ca7){var _0x34a150=typeof _0xacc352[_0x431f('0x1b')]===_0x431f('0x1c')&&typeof _0xacc352[_0x431f('0x1d')]==='undefined';var _0x142654=_0x327ca7[_0x431f('0x1e')];var _0x2f6fb9=_0x34a150?0x0:_0xacc352['offset'];var _0x23052c=_0x34a150?_0x327ca7[_0x431f('0x1e')]:_0xacc352[_0x431f('0x1b')]+_0xacc352[_0x431f('0x1d')];var _0x588754;if(_0x23052c>=_0x142654){_0x23052c=_0x142654;_0x588754=0xc8;}else{_0x588754=0xce;}_0xb84fa['status'](_0x588754);return _0xb84fa[_0x431f('0x1f')]('Content-Range',_0x2f6fb9+'-'+_0x23052c+'/'+_0x142654)[_0x431f('0x20')](_0x327ca7);}return null;};}function patchUpdates(_0x18af9d){return function(_0xfbd316){try{jsonpatch['apply'](_0xfbd316,_0x18af9d,!![]);}catch(_0x237965){return BPromise[_0x431f('0x21')](_0x237965);}return _0xfbd316[_0x431f('0x22')]();};}function saveUpdates(_0x2ef6a8,_0xad6869){return function(_0x1a536b){if(_0x1a536b){return _0x1a536b[_0x431f('0x23')](_0x2ef6a8)[_0x431f('0x24')](function(_0x3cd2e2){return _0x3cd2e2;});}return null;};}function removeEntity(_0x229da9,_0x1c7e11){return function(_0x5daeb1){if(_0x5daeb1){return _0x5daeb1[_0x431f('0x25')]()[_0x431f('0x24')](function(){_0x229da9[_0x431f('0x19')](0xcc)[_0x431f('0x1a')]();});}};}function handleEntityNotFound(_0x52f018,_0x2c55dd){return function(_0xd93866){if(!_0xd93866){_0x52f018[_0x431f('0x18')](0x194);}return _0xd93866;};}function handleError(_0x38ceaf,_0x4b290e){_0x4b290e=_0x4b290e||0x1f4;return function(_0xfb6bed){logger[_0x431f('0x26')](_0xfb6bed[_0x431f('0x27')]);if(_0xfb6bed[_0x431f('0x28')]){delete _0xfb6bed[_0x431f('0x28')];}_0x38ceaf[_0x431f('0x19')](_0x4b290e)['send'](_0xfb6bed);};}exports['index']=function(_0x2be18f,_0x5bd66b){var _0x2b6c9b={},_0x18c3d8={},_0x4eb18b={'count':0x0,'rows':[]};var _0x1bed3d=_[_0x431f('0x29')](db[_0x431f('0x2a')][_0x431f('0x2b')],function(_0x342242){return{'name':_0x342242[_0x431f('0x2c')],'type':_0x342242[_0x431f('0x2d')]['key']};});_0x18c3d8['model']=_[_0x431f('0x29')](_0x1bed3d,'name');_0x18c3d8[_0x431f('0x2e')]=_[_0x431f('0x2f')](_0x2be18f[_0x431f('0x2e')]);_0x18c3d8[_0x431f('0x30')]=_[_0x431f('0x31')](_0x18c3d8[_0x431f('0x32')],_0x18c3d8['query']);_0x2b6c9b['attributes']=_['intersection'](_0x18c3d8[_0x431f('0x32')],qs['fields'](_0x2be18f[_0x431f('0x2e')][_0x431f('0x33')]));_0x2b6c9b[_0x431f('0x34')]=_0x2b6c9b['attributes'][_0x431f('0x35')]?_0x2b6c9b[_0x431f('0x34')]:_0x18c3d8['model'];if(!_0x2be18f[_0x431f('0x2e')][_0x431f('0x36')](_0x431f('0x37'))){_0x2b6c9b[_0x431f('0x1d')]=qs['limit'](_0x2be18f[_0x431f('0x2e')][_0x431f('0x1d')]);_0x2b6c9b[_0x431f('0x1b')]=qs['offset'](_0x2be18f[_0x431f('0x2e')]['offset']);}_0x2b6c9b[_0x431f('0x38')]=qs[_0x431f('0x39')](_0x2be18f[_0x431f('0x2e')][_0x431f('0x39')]);_0x2b6c9b[_0x431f('0x3a')]=qs[_0x431f('0x30')](_[_0x431f('0x3b')](_0x2be18f[_0x431f('0x2e')],_0x18c3d8['filters']),_0x1bed3d);if(_0x2be18f[_0x431f('0x2e')][_0x431f('0x3c')]){_0x2b6c9b[_0x431f('0x3a')]=_[_0x431f('0x3d')](_0x2b6c9b[_0x431f('0x3a')],{'$or':_[_0x431f('0x29')](_0x1bed3d,function(_0x45d9e5){if(_0x45d9e5[_0x431f('0x2d')]!==_0x431f('0x3e')){var _0x149e77={};_0x149e77[_0x45d9e5['name']]={'$like':'%'+_0x2be18f[_0x431f('0x2e')][_0x431f('0x3c')]+'%'};return _0x149e77;}})});}_0x2b6c9b=_[_0x431f('0x3d')]({},_0x2b6c9b,_0x2be18f[_0x431f('0x3f')]);var _0x3f2631={'where':_0x2b6c9b['where']};return db[_0x431f('0x2a')][_0x431f('0x1e')](_0x3f2631)['then'](function(_0xd73bcb){_0x4eb18b[_0x431f('0x1e')]=_0xd73bcb;if(_0x2be18f[_0x431f('0x2e')][_0x431f('0x40')]){_0x2b6c9b['include']=[{'all':!![]}];}return db[_0x431f('0x2a')][_0x431f('0x41')](_0x2b6c9b);})[_0x431f('0x24')](function(_0x588016){_0x4eb18b[_0x431f('0x42')]=_0x588016;return _0x4eb18b;})[_0x431f('0x24')](respondWithFilteredResult(_0x5bd66b,_0x2b6c9b))[_0x431f('0x43')](handleError(_0x5bd66b,null));};exports[_0x431f('0x44')]=function(_0xe93d8,_0xac3461){var _0x4e7963={'raw':!![],'where':{'id':_0xe93d8[_0x431f('0x45')]['id']}},_0x34cdd5={};_0x34cdd5[_0x431f('0x32')]=_[_0x431f('0x2f')](db[_0x431f('0x2a')][_0x431f('0x2b')]);_0x34cdd5['query']=_[_0x431f('0x2f')](_0xe93d8[_0x431f('0x2e')]);_0x34cdd5[_0x431f('0x30')]=_['intersection'](_0x34cdd5[_0x431f('0x32')],_0x34cdd5[_0x431f('0x2e')]);_0x4e7963[_0x431f('0x34')]=_[_0x431f('0x31')](_0x34cdd5[_0x431f('0x32')],qs['fields'](_0xe93d8[_0x431f('0x2e')]['fields']));_0x4e7963[_0x431f('0x34')]=_0x4e7963[_0x431f('0x34')][_0x431f('0x35')]?_0x4e7963['attributes']:_0x34cdd5[_0x431f('0x32')];if(_0xe93d8[_0x431f('0x2e')]['includeAll']){_0x4e7963[_0x431f('0x46')]=[{'all':!![]}];}_0x4e7963=_['merge']({},_0x4e7963,_0xe93d8[_0x431f('0x3f')]);return db[_0x431f('0x2a')]['find'](_0x4e7963)[_0x431f('0x24')](handleEntityNotFound(_0xac3461,null))['then'](respondWithResult(_0xac3461,null))[_0x431f('0x43')](handleError(_0xac3461,null));};exports[_0x431f('0x47')]=function(_0x407334,_0x920ba2){return db[_0x431f('0x2a')][_0x431f('0x47')](_0x407334[_0x431f('0x48')],{})[_0x431f('0x24')](respondWithResult(_0x920ba2,0xc9))['catch'](handleError(_0x920ba2,null));};exports[_0x431f('0x23')]=function(_0x444b7c,_0x1a17dc){if(_0x444b7c[_0x431f('0x48')]['id']){delete _0x444b7c[_0x431f('0x48')]['id'];}return db[_0x431f('0x2a')][_0x431f('0x49')]({'where':{'id':_0x444b7c['params']['id']}})[_0x431f('0x24')](handleEntityNotFound(_0x1a17dc,null))[_0x431f('0x24')](saveUpdates(_0x444b7c[_0x431f('0x48')],null))[_0x431f('0x24')](respondWithResult(_0x1a17dc,null))['catch'](handleError(_0x1a17dc,null));};exports[_0x431f('0x25')]=function(_0x17301e,_0x584897){return db[_0x431f('0x2a')][_0x431f('0x49')]({'where':{'id':_0x17301e['params']['id']}})[_0x431f('0x24')](handleEntityNotFound(_0x584897,null))[_0x431f('0x24')](removeEntity(_0x584897,null))[_0x431f('0x43')](handleError(_0x584897,null));}; \ No newline at end of file +var _0x626f=['util','path','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','save','update','then','destroy','error','stack','name','send','Dynamics365Field','rawAttributes','type','model','map','keys','query','fields','attributes','hasOwnProperty','nolimit','sort','where','filters','filter','merge','VIRTUAL','include','findAll','rows','show','params','intersection','length','includeAll','options','catch','create','body','eml-format','rimraf','fast-json-patch','moment','mustache'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x626f,0x113));var _0xf626=function(_0x2e3ee3,_0x362ac4){_0x2e3ee3=_0x2e3ee3-0x0;var _0x57e2c9=_0x626f[_0x2e3ee3];return _0x57e2c9;};'use strict';var emlformat=require(_0xf626('0x0'));var rimraf=require(_0xf626('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf626('0x2'));var rp=require('request-promise');var moment=require(_0xf626('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xf626('0x4'));var util=require(_0xf626('0x5'));var path=require(_0xf626('0x6'));var sox=require(_0xf626('0x7'));var csv=require('to-csv');var ejs=require(_0xf626('0x8'));var fs=require('fs');var fs_extra=require(_0xf626('0x9'));var _=require(_0xf626('0xa'));var squel=require(_0xf626('0xb'));var crypto=require('crypto');var jsforce=require(_0xf626('0xc'));var deskjs=require(_0xf626('0xd'));var toCsv=require(_0xf626('0xe'));var querystring=require(_0xf626('0xf'));var Papa=require(_0xf626('0x10'));var Redis=require(_0xf626('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xf626('0x12'));var as=require(_0xf626('0x13'));var hardwareService=require(_0xf626('0x14'));var logger=require(_0xf626('0x15'))('api');var utils=require('../../config/utils');var config=require(_0xf626('0x16'));var licenseUtil=require(_0xf626('0x17'));var db=require(_0xf626('0x18'))['db'];function respondWithStatusCode(_0x2ed8e9,_0x52f32f){_0x52f32f=_0x52f32f||0xcc;return function(_0x55d5f1){if(_0x55d5f1){return _0x2ed8e9[_0xf626('0x19')](_0x52f32f);}return _0x2ed8e9[_0xf626('0x1a')](_0x52f32f)[_0xf626('0x1b')]();};}function respondWithResult(_0x1997e8,_0x1df196){_0x1df196=_0x1df196||0xc8;return function(_0x547fe6){if(_0x547fe6){return _0x1997e8['status'](_0x1df196)[_0xf626('0x1c')](_0x547fe6);}};}function respondWithFilteredResult(_0x3c9f5e,_0x4cdb32){return function(_0x162eff){if(_0x162eff){var _0xb6e72b=typeof _0x4cdb32[_0xf626('0x1d')]==='undefined'&&typeof _0x4cdb32[_0xf626('0x1e')]===_0xf626('0x1f');var _0x33ac56=_0x162eff[_0xf626('0x20')];var _0x47752e=_0xb6e72b?0x0:_0x4cdb32[_0xf626('0x1d')];var _0x3a66ae=_0xb6e72b?_0x162eff[_0xf626('0x20')]:_0x4cdb32[_0xf626('0x1d')]+_0x4cdb32['limit'];var _0x2da3f4;if(_0x3a66ae>=_0x33ac56){_0x3a66ae=_0x33ac56;_0x2da3f4=0xc8;}else{_0x2da3f4=0xce;}_0x3c9f5e[_0xf626('0x1a')](_0x2da3f4);return _0x3c9f5e['set']('Content-Range',_0x47752e+'-'+_0x3a66ae+'/'+_0x33ac56)[_0xf626('0x1c')](_0x162eff);}return null;};}function patchUpdates(_0x151bff){return function(_0x3a9318){try{jsonpatch['apply'](_0x3a9318,_0x151bff,!![]);}catch(_0x41c5ad){return BPromise['reject'](_0x41c5ad);}return _0x3a9318[_0xf626('0x21')]();};}function saveUpdates(_0x12a01c,_0x1d27ad){return function(_0x42e934){if(_0x42e934){return _0x42e934[_0xf626('0x22')](_0x12a01c)[_0xf626('0x23')](function(_0x1221ad){return _0x1221ad;});}return null;};}function removeEntity(_0x17752a,_0x5f2dcb){return function(_0x29ec16){if(_0x29ec16){return _0x29ec16[_0xf626('0x24')]()[_0xf626('0x23')](function(){_0x17752a['status'](0xcc)[_0xf626('0x1b')]();});}};}function handleEntityNotFound(_0x53664a,_0xf25e0a){return function(_0x4aa633){if(!_0x4aa633){_0x53664a[_0xf626('0x19')](0x194);}return _0x4aa633;};}function handleError(_0x39f1fe,_0x1d3477){_0x1d3477=_0x1d3477||0x1f4;return function(_0x266ede){logger[_0xf626('0x25')](_0x266ede[_0xf626('0x26')]);if(_0x266ede[_0xf626('0x27')]){delete _0x266ede[_0xf626('0x27')];}_0x39f1fe[_0xf626('0x1a')](_0x1d3477)[_0xf626('0x28')](_0x266ede);};}exports['index']=function(_0x2ffb86,_0x1d316e){var _0x47c99d={},_0x3e91f6={},_0x4394b8={'count':0x0,'rows':[]};var _0x1c88a9=_['map'](db[_0xf626('0x29')][_0xf626('0x2a')],function(_0x3d8d22){return{'name':_0x3d8d22['fieldName'],'type':_0x3d8d22[_0xf626('0x2b')]['key']};});_0x3e91f6[_0xf626('0x2c')]=_[_0xf626('0x2d')](_0x1c88a9,_0xf626('0x27'));_0x3e91f6['query']=_[_0xf626('0x2e')](_0x2ffb86[_0xf626('0x2f')]);_0x3e91f6['filters']=_['intersection'](_0x3e91f6[_0xf626('0x2c')],_0x3e91f6['query']);_0x47c99d['attributes']=_['intersection'](_0x3e91f6[_0xf626('0x2c')],qs[_0xf626('0x30')](_0x2ffb86[_0xf626('0x2f')][_0xf626('0x30')]));_0x47c99d['attributes']=_0x47c99d['attributes']['length']?_0x47c99d[_0xf626('0x31')]:_0x3e91f6[_0xf626('0x2c')];if(!_0x2ffb86[_0xf626('0x2f')][_0xf626('0x32')](_0xf626('0x33'))){_0x47c99d['limit']=qs[_0xf626('0x1e')](_0x2ffb86[_0xf626('0x2f')][_0xf626('0x1e')]);_0x47c99d[_0xf626('0x1d')]=qs['offset'](_0x2ffb86[_0xf626('0x2f')][_0xf626('0x1d')]);}_0x47c99d['order']=qs[_0xf626('0x34')](_0x2ffb86[_0xf626('0x2f')][_0xf626('0x34')]);_0x47c99d[_0xf626('0x35')]=qs[_0xf626('0x36')](_['pick'](_0x2ffb86[_0xf626('0x2f')],_0x3e91f6[_0xf626('0x36')]),_0x1c88a9);if(_0x2ffb86[_0xf626('0x2f')][_0xf626('0x37')]){_0x47c99d[_0xf626('0x35')]=_[_0xf626('0x38')](_0x47c99d[_0xf626('0x35')],{'$or':_['map'](_0x1c88a9,function(_0x377739){if(_0x377739[_0xf626('0x2b')]!==_0xf626('0x39')){var _0x51d388={};_0x51d388[_0x377739[_0xf626('0x27')]]={'$like':'%'+_0x2ffb86['query'][_0xf626('0x37')]+'%'};return _0x51d388;}})});}_0x47c99d=_[_0xf626('0x38')]({},_0x47c99d,_0x2ffb86['options']);var _0x4edc45={'where':_0x47c99d['where']};return db[_0xf626('0x29')][_0xf626('0x20')](_0x4edc45)[_0xf626('0x23')](function(_0xd8f2a0){_0x4394b8['count']=_0xd8f2a0;if(_0x2ffb86[_0xf626('0x2f')]['includeAll']){_0x47c99d[_0xf626('0x3a')]=[{'all':!![]}];}return db['Dynamics365Field'][_0xf626('0x3b')](_0x47c99d);})[_0xf626('0x23')](function(_0x3b5400){_0x4394b8[_0xf626('0x3c')]=_0x3b5400;return _0x4394b8;})[_0xf626('0x23')](respondWithFilteredResult(_0x1d316e,_0x47c99d))['catch'](handleError(_0x1d316e,null));};exports[_0xf626('0x3d')]=function(_0x5efbd4,_0x4cb745){var _0x2a75d5={'raw':!![],'where':{'id':_0x5efbd4[_0xf626('0x3e')]['id']}},_0x5bf1a0={};_0x5bf1a0[_0xf626('0x2c')]=_[_0xf626('0x2e')](db[_0xf626('0x29')][_0xf626('0x2a')]);_0x5bf1a0[_0xf626('0x2f')]=_[_0xf626('0x2e')](_0x5efbd4[_0xf626('0x2f')]);_0x5bf1a0[_0xf626('0x36')]=_[_0xf626('0x3f')](_0x5bf1a0[_0xf626('0x2c')],_0x5bf1a0['query']);_0x2a75d5['attributes']=_[_0xf626('0x3f')](_0x5bf1a0[_0xf626('0x2c')],qs[_0xf626('0x30')](_0x5efbd4[_0xf626('0x2f')][_0xf626('0x30')]));_0x2a75d5[_0xf626('0x31')]=_0x2a75d5['attributes'][_0xf626('0x40')]?_0x2a75d5[_0xf626('0x31')]:_0x5bf1a0[_0xf626('0x2c')];if(_0x5efbd4[_0xf626('0x2f')][_0xf626('0x41')]){_0x2a75d5[_0xf626('0x3a')]=[{'all':!![]}];}_0x2a75d5=_[_0xf626('0x38')]({},_0x2a75d5,_0x5efbd4[_0xf626('0x42')]);return db[_0xf626('0x29')]['find'](_0x2a75d5)[_0xf626('0x23')](handleEntityNotFound(_0x4cb745,null))[_0xf626('0x23')](respondWithResult(_0x4cb745,null))[_0xf626('0x43')](handleError(_0x4cb745,null));};exports[_0xf626('0x44')]=function(_0x50e16d,_0x64c1cf){return db[_0xf626('0x29')][_0xf626('0x44')](_0x50e16d[_0xf626('0x45')],{})['then'](respondWithResult(_0x64c1cf,0xc9))[_0xf626('0x43')](handleError(_0x64c1cf,null));};exports[_0xf626('0x22')]=function(_0x610356,_0x2d3e73){if(_0x610356[_0xf626('0x45')]['id']){delete _0x610356['body']['id'];}return db['Dynamics365Field']['find']({'where':{'id':_0x610356[_0xf626('0x3e')]['id']}})['then'](handleEntityNotFound(_0x2d3e73,null))[_0xf626('0x23')](saveUpdates(_0x610356[_0xf626('0x45')],null))[_0xf626('0x23')](respondWithResult(_0x2d3e73,null))['catch'](handleError(_0x2d3e73,null));};exports[_0xf626('0x24')]=function(_0x54145e,_0x1c79d1){return db[_0xf626('0x29')]['find']({'where':{'id':_0x54145e[_0xf626('0x3e')]['id']}})[_0xf626('0x23')](handleEntityNotFound(_0x1c79d1,null))['then'](removeEntity(_0x1c79d1,null))[_0xf626('0x43')](handleError(_0x1c79d1,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.model.js b/server/api/intDynamics365Field/intDynamics365Field.model.js index f01fcc5..d1d9d2a 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 _0x55a5=['idField','FieldId','lodash','api','bluebird','request-promise','rimraf','./intDynamics365Field.attributes','exports','define','Dynamics365Field','int_dynamics365_fields','dynamics365_unique_index'];(function(_0x57d263,_0x30da3f){var _0x29d218=function(_0x154e97){while(--_0x154e97){_0x57d263['push'](_0x57d263['shift']());}};_0x29d218(++_0x30da3f);}(_0x55a5,0xf9));var _0x555a=function(_0x21b762,_0xc8ef11){_0x21b762=_0x21b762-0x0;var _0x2ea6d4=_0x55a5[_0x21b762];return _0x2ea6d4;};'use strict';var _=require(_0x555a('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x555a('0x1'));var moment=require('moment');var BPromise=require(_0x555a('0x2'));var rp=require(_0x555a('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x555a('0x4'));var config=require('../../config/environment');var attributes=require(_0x555a('0x5'));module[_0x555a('0x6')]=function(_0x476176,_0x309580){return _0x476176[_0x555a('0x7')](_0x555a('0x8'),attributes,{'tableName':_0x555a('0x9'),'paranoid':![],'indexes':[{'name':_0x555a('0xa'),'fields':[_0x555a('0xb'),_0x555a('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x31c5=['bluebird','path','../../config/environment','./intDynamics365Field.attributes','exports','define','Dynamics365Field','dynamics365_unique_index','FieldId','lodash','../../config/logger','api','moment'];(function(_0x2becba,_0x4ea656){var _0x90b5dd=function(_0x26ae2b){while(--_0x26ae2b){_0x2becba['push'](_0x2becba['shift']());}};_0x90b5dd(++_0x4ea656);}(_0x31c5,0x1c3));var _0x531c=function(_0x2aaeff,_0x55bf64){_0x2aaeff=_0x2aaeff-0x0;var _0x3777f5=_0x31c5[_0x2aaeff];return _0x3777f5;};'use strict';var _=require(_0x531c('0x0'));var util=require('util');var logger=require(_0x531c('0x1'))(_0x531c('0x2'));var moment=require(_0x531c('0x3'));var BPromise=require(_0x531c('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x531c('0x5'));var rimraf=require('rimraf');var config=require(_0x531c('0x6'));var attributes=require(_0x531c('0x7'));module[_0x531c('0x8')]=function(_0x41dede,_0x4f902c){return _0x41dede[_0x531c('0x9')](_0x531c('0xa'),attributes,{'tableName':'int_dynamics365_fields','paranoid':![],'indexes':[{'name':_0x531c('0xb'),'fields':['idField',_0x531c('0xc')],'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 7e8b43c..41b0a15 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 _0xc0e4=['../../config/utils','rpc','jayson/promise','request','info','Dynamics365Field,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','util','moment','bluebird','randomstring','../../mysqldb'];(function(_0x556f7d,_0x5a2c69){var _0x28c061=function(_0x477409){while(--_0x477409){_0x556f7d['push'](_0x556f7d['shift']());}};_0x28c061(++_0x5a2c69);}(_0xc0e4,0x163));var _0x4c0e=function(_0x2d89ce,_0x24d58d){_0x2d89ce=_0x2d89ce-0x0;var _0x3fad10=_0xc0e4[_0x2d89ce];return _0x3fad10;};'use strict';var _=require('lodash');var util=require(_0x4c0e('0x0'));var moment=require(_0x4c0e('0x1'));var BPromise=require(_0x4c0e('0x2'));var rs=require(_0x4c0e('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4c0e('0x4'))['db'];var utils=require(_0x4c0e('0x5'));var logger=require('../../config/logger')(_0x4c0e('0x6'));var config=require('../../config/environment');var jayson=require(_0x4c0e('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5dadb3,_0x10cd97,_0x12ccfd){return new BPromise(function(_0x1d1eac,_0x28420d){return client[_0x4c0e('0x8')](_0x5dadb3,_0x12ccfd)['then'](function(_0x126c4e){logger[_0x4c0e('0x9')](_0x4c0e('0xa'),_0x10cd97,_0x4c0e('0xb'));logger[_0x4c0e('0xc')]('Dynamics365Field,\x20%s,\x20%s,\x20%s',_0x10cd97,'request\x20sent',JSON[_0x4c0e('0xd')](_0x126c4e));if(_0x126c4e['error']){if(_0x126c4e[_0x4c0e('0xe')][_0x4c0e('0xf')]===0x1f4){logger[_0x4c0e('0xe')]('Dynamics365Field,\x20%s,\x20%s',_0x10cd97,_0x126c4e[_0x4c0e('0xe')][_0x4c0e('0x10')]);return _0x28420d(_0x126c4e['error'][_0x4c0e('0x10')]);}logger[_0x4c0e('0xe')](_0x4c0e('0xa'),_0x10cd97,_0x126c4e[_0x4c0e('0xe')][_0x4c0e('0x10')]);return _0x1d1eac(_0x126c4e[_0x4c0e('0xe')][_0x4c0e('0x10')]);}else{logger[_0x4c0e('0x9')](_0x4c0e('0xa'),_0x10cd97,_0x4c0e('0xb'));_0x1d1eac(_0x126c4e['result'][_0x4c0e('0x10')]);}})[_0x4c0e('0x11')](function(_0xe77cd0){logger[_0x4c0e('0xe')](_0x4c0e('0xa'),_0x10cd97,_0xe77cd0);_0x28420d(_0xe77cd0);});});} \ No newline at end of file +var _0xe0ae=['util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','request','info','Dynamics365Field,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Field,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash'];(function(_0x5f0501,_0x19196e){var _0x3c2c45=function(_0x107fe6){while(--_0x107fe6){_0x5f0501['push'](_0x5f0501['shift']());}};_0x3c2c45(++_0x19196e);}(_0xe0ae,0x1e3));var _0xee0a=function(_0x7ad123,_0xeeeef3){_0x7ad123=_0x7ad123-0x0;var _0x37d073=_0xe0ae[_0x7ad123];return _0x37d073;};'use strict';var _=require(_0xee0a('0x0'));var util=require(_0xee0a('0x1'));var moment=require(_0xee0a('0x2'));var BPromise=require(_0xee0a('0x3'));var rs=require(_0xee0a('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xee0a('0x5'))['db'];var utils=require(_0xee0a('0x6'));var logger=require(_0xee0a('0x7'))('rpc');var config=require(_0xee0a('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xee0a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xa80554,_0x157c02,_0xfa68d1){return new BPromise(function(_0x205528,_0x44cde7){return client[_0xee0a('0xa')](_0xa80554,_0xfa68d1)['then'](function(_0x3e6f9c){logger[_0xee0a('0xb')](_0xee0a('0xc'),_0x157c02,_0xee0a('0xd'));logger[_0xee0a('0xe')](_0xee0a('0xf'),_0x157c02,'request\x20sent',JSON[_0xee0a('0x10')](_0x3e6f9c));if(_0x3e6f9c[_0xee0a('0x11')]){if(_0x3e6f9c[_0xee0a('0x11')][_0xee0a('0x12')]===0x1f4){logger[_0xee0a('0x11')]('Dynamics365Field,\x20%s,\x20%s',_0x157c02,_0x3e6f9c[_0xee0a('0x11')]['message']);return _0x44cde7(_0x3e6f9c[_0xee0a('0x11')][_0xee0a('0x13')]);}logger[_0xee0a('0x11')](_0xee0a('0xc'),_0x157c02,_0x3e6f9c[_0xee0a('0x11')][_0xee0a('0x13')]);return _0x205528(_0x3e6f9c[_0xee0a('0x11')][_0xee0a('0x13')]);}else{logger[_0xee0a('0xb')](_0xee0a('0xc'),_0x157c02,'request\x20sent');_0x205528(_0x3e6f9c[_0xee0a('0x14')][_0xee0a('0x13')]);}})[_0xee0a('0x15')](function(_0x400e19){logger[_0xee0a('0x11')](_0xee0a('0xc'),_0x157c02,_0x400e19);_0x44cde7(_0x400e19);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/index.js b/server/api/intFreshdeskAccount/index.js index 7bd646b..2321d44 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 _0x3399=['../../components/auth/service','../../config/environment','./intFreshdeskAccount.controller','get','isAuthenticated','index','show','/:id/configurations','getConfigurations','/:id/fields','getFields','create','post','/:id','update','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra'];(function(_0x4629ed,_0x59ef85){var _0x52ca04=function(_0x59dc63){while(--_0x59dc63){_0x4629ed['push'](_0x4629ed['shift']());}};_0x52ca04(++_0x59ef85);}(_0x3399,0x126));var _0x9339=function(_0x1b0424,_0x3c71f7){_0x1b0424=_0x1b0424-0x0;var _0x15a4cb=_0x3399[_0x1b0424];return _0x15a4cb;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x9339('0x0'));var timeout=require(_0x9339('0x1'));var express=require(_0x9339('0x2'));var router=express[_0x9339('0x3')]();var fs_extra=require(_0x9339('0x4'));var auth=require(_0x9339('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x9339('0x6'));var controller=require(_0x9339('0x7'));router[_0x9339('0x8')]('/',auth[_0x9339('0x9')](),controller[_0x9339('0xa')]);router[_0x9339('0x8')]('/:id',auth[_0x9339('0x9')](),controller[_0x9339('0xb')]);router['get'](_0x9339('0xc'),auth[_0x9339('0x9')](),controller[_0x9339('0xd')]);router[_0x9339('0x8')](_0x9339('0xe'),auth[_0x9339('0x9')](),controller[_0x9339('0xf')]);router['post']('/',auth['isAuthenticated'](),controller[_0x9339('0x10')]);router[_0x9339('0x11')](_0x9339('0xc'),auth[_0x9339('0x9')](),controller['addConfiguration']);router['put'](_0x9339('0x12'),auth[_0x9339('0x9')](),controller[_0x9339('0x13')]);router[_0x9339('0x14')]('/:id',auth[_0x9339('0x9')](),controller[_0x9339('0x15')]);module[_0x9339('0x16')]=router; \ No newline at end of file +var _0x700c=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','post','create','addConfiguration','update','delete','destroy','util','connect-timeout','express'];(function(_0x319b18,_0x285f68){var _0x335166=function(_0x45a5bd){while(--_0x45a5bd){_0x319b18['push'](_0x319b18['shift']());}};_0x335166(++_0x285f68);}(_0x700c,0x138));var _0xc700=function(_0x260ea1,_0x138867){_0x260ea1=_0x260ea1-0x0;var _0x48c0bf=_0x700c[_0x260ea1];return _0x48c0bf;};'use strict';var multer=require('multer');var util=require(_0xc700('0x0'));var path=require('path');var timeout=require(_0xc700('0x1'));var express=require(_0xc700('0x2'));var router=express[_0xc700('0x3')]();var fs_extra=require(_0xc700('0x4'));var auth=require(_0xc700('0x5'));var interaction=require(_0xc700('0x6'));var config=require('../../config/environment');var controller=require('./intFreshdeskAccount.controller');router[_0xc700('0x7')]('/',auth[_0xc700('0x8')](),controller[_0xc700('0x9')]);router['get'](_0xc700('0xa'),auth[_0xc700('0x8')](),controller[_0xc700('0xb')]);router[_0xc700('0x7')](_0xc700('0xc'),auth[_0xc700('0x8')](),controller[_0xc700('0xd')]);router[_0xc700('0x7')](_0xc700('0xe'),auth[_0xc700('0x8')](),controller['getFields']);router[_0xc700('0xf')]('/',auth[_0xc700('0x8')](),controller[_0xc700('0x10')]);router['post'](_0xc700('0xc'),auth[_0xc700('0x8')](),controller[_0xc700('0x11')]);router['put'](_0xc700('0xa'),auth[_0xc700('0x8')](),controller[_0xc700('0x12')]);router[_0xc700('0x13')](_0xc700('0xa'),auth[_0xc700('0x8')](),controller[_0xc700('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js index fd57c30..f690a9d 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 _0x2542=['remoteUri','sequelize','exports','STRING','username'];(function(_0x44946b,_0xf874ec){var _0x249bc4=function(_0x40a23e){while(--_0x40a23e){_0x44946b['push'](_0x44946b['shift']());}};_0x249bc4(++_0xf874ec);}(_0x2542,0x169));var _0x2254=function(_0x31857c,_0x2c0239){_0x31857c=_0x31857c-0x0;var _0x46c473=_0x2542[_0x31857c];return _0x46c473;};'use strict';var Sequelize=require(_0x2254('0x0'));module[_0x2254('0x1')]={'name':{'type':Sequelize[_0x2254('0x2')]},'description':{'type':Sequelize[_0x2254('0x2')]},'username':{'type':Sequelize['STRING'],'unique':_0x2254('0x3')},'apiKey':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x2254('0x2')],'unique':_0x2254('0x4')},'serverUrl':{'type':Sequelize[_0x2254('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x8603=['remoteUri','exports','STRING'];(function(_0x8dd42f,_0x33f377){var _0x171a44=function(_0x203ce3){while(--_0x203ce3){_0x8dd42f['push'](_0x8dd42f['shift']());}};_0x171a44(++_0x33f377);}(_0x8603,0x190));var _0x3860=function(_0x594cea,_0x1142c3){_0x594cea=_0x594cea-0x0;var _0xe0a5e4=_0x8603[_0x594cea];return _0xe0a5e4;};'use strict';var Sequelize=require('sequelize');module[_0x3860('0x0')]={'name':{'type':Sequelize[_0x3860('0x1')]},'description':{'type':Sequelize[_0x3860('0x1')]},'username':{'type':Sequelize['STRING'],'unique':'username'},'apiKey':{'type':Sequelize[_0x3860('0x1')]},'remoteUri':{'type':Sequelize[_0x3860('0x1')],'unique':_0x3860('0x2')},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js index 3996935..fc9c6a0 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 _0x4ffa=['index','FreshdeskAccount','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','find','create','body','params','getConfigurations','findOne','FreshdeskConfiguration','hasOwnProperty','AccountId','Subjects','getSubjects','channel','Descriptions','FreshdeskField','getFields','remoteUri','slice','substring','GET','format','%s/%s','api/v2/ticket_fields','apiKey','toString','base64','subject','description','priority','group','source','ticket_type','company','default','custom_text','label','choices','capitalize','test','error','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','statusCode','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','jsforce','desk.js','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../components/integrations/configuration','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','apply','reject','update','destroy','then','stack','name','send'];(function(_0x24fa8f,_0x56b265){var _0x380153=function(_0x182363){while(--_0x182363){_0x24fa8f['push'](_0x24fa8f['shift']());}};_0x380153(++_0x56b265);}(_0x4ffa,0x124));var _0xa4ff=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x4ffa[_0x57b54c];return _0x59cc19;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xa4ff('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa4ff('0x1'));var moment=require(_0xa4ff('0x2'));var BPromise=require(_0xa4ff('0x3'));var Mustache=require(_0xa4ff('0x4'));var util=require(_0xa4ff('0x5'));var path=require(_0xa4ff('0x6'));var sox=require('sox');var csv=require(_0xa4ff('0x7'));var ejs=require(_0xa4ff('0x8'));var fs=require('fs');var fs_extra=require(_0xa4ff('0x9'));var _=require('lodash');var squel=require(_0xa4ff('0xa'));var crypto=require('crypto');var jsforce=require(_0xa4ff('0xb'));var deskjs=require(_0xa4ff('0xc'));var toCsv=require(_0xa4ff('0x7'));var querystring=require('querystring');var Papa=require(_0xa4ff('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xa4ff('0xe'));var hardwareService=require(_0xa4ff('0xf'));var logger=require(_0xa4ff('0x10'))(_0xa4ff('0x11'));var utils=require('../../config/utils');var config=require(_0xa4ff('0x12'));var licenseUtil=require(_0xa4ff('0x13'));var db=require('../../mysqldb')['db'];var integrations=require(_0xa4ff('0x14'));function respondWithStatusCode(_0x345044,_0x5b11b0){_0x5b11b0=_0x5b11b0||0xcc;return function(_0x11f78a){if(_0x11f78a){return _0x345044[_0xa4ff('0x15')](_0x5b11b0);}return _0x345044['status'](_0x5b11b0)[_0xa4ff('0x16')]();};}function respondWithResult(_0x4d2d2c,_0x34f681){_0x34f681=_0x34f681||0xc8;return function(_0x5a3869){if(_0x5a3869){return _0x4d2d2c[_0xa4ff('0x17')](_0x34f681)[_0xa4ff('0x18')](_0x5a3869);}};}function respondWithFilteredResult(_0x56e4e9,_0x308f00){return function(_0x199d1e){if(_0x199d1e){var _0x27f8d8=typeof _0x308f00[_0xa4ff('0x19')]===_0xa4ff('0x1a')&&typeof _0x308f00[_0xa4ff('0x1b')]==='undefined';var _0x93e247=_0x199d1e[_0xa4ff('0x1c')];var _0x2fd522=_0x27f8d8?0x0:_0x308f00['offset'];var _0x377665=_0x27f8d8?_0x199d1e[_0xa4ff('0x1c')]:_0x308f00['offset']+_0x308f00['limit'];var _0x28a1bc;if(_0x377665>=_0x93e247){_0x377665=_0x93e247;_0x28a1bc=0xc8;}else{_0x28a1bc=0xce;}_0x56e4e9['status'](_0x28a1bc);return _0x56e4e9['set'](_0xa4ff('0x1d'),_0x2fd522+'-'+_0x377665+'/'+_0x93e247)[_0xa4ff('0x18')](_0x199d1e);}return null;};}function patchUpdates(_0x2857e7){return function(_0x15450d){try{jsonpatch[_0xa4ff('0x1e')](_0x15450d,_0x2857e7,!![]);}catch(_0x569a3f){return BPromise[_0xa4ff('0x1f')](_0x569a3f);}return _0x15450d['save']();};}function saveUpdates(_0x570458,_0x2598b4){return function(_0x53fce2){if(_0x53fce2){return _0x53fce2[_0xa4ff('0x20')](_0x570458)['then'](function(_0x3012fa){return _0x3012fa;});}return null;};}function removeEntity(_0x4a678e,_0x520bdc){return function(_0x132633){if(_0x132633){return _0x132633[_0xa4ff('0x21')]()[_0xa4ff('0x22')](function(){_0x4a678e[_0xa4ff('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4a649c,_0x1a62ba){return function(_0x38f633){if(!_0x38f633){_0x4a649c[_0xa4ff('0x15')](0x194);}return _0x38f633;};}function handleError(_0x3532e3,_0x20e611){_0x20e611=_0x20e611||0x1f4;return function(_0x289525){logger['error'](_0x289525[_0xa4ff('0x23')]);if(_0x289525[_0xa4ff('0x24')]){delete _0x289525['name'];}_0x3532e3['status'](_0x20e611)[_0xa4ff('0x25')](_0x289525);};}exports[_0xa4ff('0x26')]=function(_0x3c3431,_0x56c618){var _0x30d2aa={},_0x31bf4d={},_0x3548e1={'count':0x0,'rows':[]};var _0x340e2d=_['map'](db[_0xa4ff('0x27')][_0xa4ff('0x28')],function(_0x4ca7ce){return{'name':_0x4ca7ce[_0xa4ff('0x29')],'type':_0x4ca7ce[_0xa4ff('0x2a')][_0xa4ff('0x2b')]};});_0x31bf4d[_0xa4ff('0x2c')]=_[_0xa4ff('0x2d')](_0x340e2d,_0xa4ff('0x24'));_0x31bf4d[_0xa4ff('0x2e')]=_[_0xa4ff('0x2f')](_0x3c3431[_0xa4ff('0x2e')]);_0x31bf4d[_0xa4ff('0x30')]=_['intersection'](_0x31bf4d[_0xa4ff('0x2c')],_0x31bf4d[_0xa4ff('0x2e')]);_0x30d2aa['attributes']=_[_0xa4ff('0x31')](_0x31bf4d[_0xa4ff('0x2c')],qs[_0xa4ff('0x32')](_0x3c3431[_0xa4ff('0x2e')]['fields']));_0x30d2aa[_0xa4ff('0x33')]=_0x30d2aa[_0xa4ff('0x33')][_0xa4ff('0x34')]?_0x30d2aa['attributes']:_0x31bf4d['model'];if(!_0x3c3431[_0xa4ff('0x2e')]['hasOwnProperty'](_0xa4ff('0x35'))){_0x30d2aa[_0xa4ff('0x1b')]=qs[_0xa4ff('0x1b')](_0x3c3431['query'][_0xa4ff('0x1b')]);_0x30d2aa[_0xa4ff('0x19')]=qs[_0xa4ff('0x19')](_0x3c3431[_0xa4ff('0x2e')]['offset']);}_0x30d2aa[_0xa4ff('0x36')]=qs[_0xa4ff('0x37')](_0x3c3431[_0xa4ff('0x2e')]['sort']);_0x30d2aa[_0xa4ff('0x38')]=qs[_0xa4ff('0x30')](_['pick'](_0x3c3431[_0xa4ff('0x2e')],_0x31bf4d['filters']),_0x340e2d);if(_0x3c3431[_0xa4ff('0x2e')]['filter']){_0x30d2aa['where']=_[_0xa4ff('0x39')](_0x30d2aa[_0xa4ff('0x38')],{'$or':_[_0xa4ff('0x2d')](_0x340e2d,function(_0x4a5f68){if(_0x4a5f68[_0xa4ff('0x2a')]!==_0xa4ff('0x3a')){var _0x54f56e={};_0x54f56e[_0x4a5f68[_0xa4ff('0x24')]]={'$like':'%'+_0x3c3431['query'][_0xa4ff('0x3b')]+'%'};return _0x54f56e;}})});}_0x30d2aa=_[_0xa4ff('0x39')]({},_0x30d2aa,_0x3c3431[_0xa4ff('0x3c')]);var _0x21731b={'where':_0x30d2aa[_0xa4ff('0x38')]};return db[_0xa4ff('0x27')][_0xa4ff('0x1c')](_0x21731b)[_0xa4ff('0x22')](function(_0x6148bb){_0x3548e1[_0xa4ff('0x1c')]=_0x6148bb;if(_0x3c3431[_0xa4ff('0x2e')][_0xa4ff('0x3d')]){_0x30d2aa[_0xa4ff('0x3e')]=[{'all':!![]}];}return db[_0xa4ff('0x27')][_0xa4ff('0x3f')](_0x30d2aa);})[_0xa4ff('0x22')](function(_0x5b9152){_0x3548e1[_0xa4ff('0x40')]=_0x5b9152;return _0x3548e1;})['then'](respondWithFilteredResult(_0x56c618,_0x30d2aa))[_0xa4ff('0x41')](handleError(_0x56c618,null));};exports[_0xa4ff('0x42')]=function(_0x5d9a26,_0x15837b){var _0x1b32c9={'raw':![],'where':{'id':_0x5d9a26['params']['id']}},_0x20d0ba={};_0x20d0ba[_0xa4ff('0x2c')]=_[_0xa4ff('0x2f')](db[_0xa4ff('0x27')][_0xa4ff('0x28')]);_0x20d0ba['query']=_[_0xa4ff('0x2f')](_0x5d9a26[_0xa4ff('0x2e')]);_0x20d0ba['filters']=_['intersection'](_0x20d0ba[_0xa4ff('0x2c')],_0x20d0ba[_0xa4ff('0x2e')]);_0x1b32c9['attributes']=_['intersection'](_0x20d0ba[_0xa4ff('0x2c')],qs['fields'](_0x5d9a26[_0xa4ff('0x2e')][_0xa4ff('0x32')]));_0x1b32c9[_0xa4ff('0x33')]=_0x1b32c9[_0xa4ff('0x33')]['length']?_0x1b32c9[_0xa4ff('0x33')]:_0x20d0ba[_0xa4ff('0x2c')];if(_0x5d9a26[_0xa4ff('0x2e')]['includeAll']){_0x1b32c9[_0xa4ff('0x3e')]=[{'all':!![]}];}_0x1b32c9=_[_0xa4ff('0x39')]({},_0x1b32c9,_0x5d9a26['options']);return db[_0xa4ff('0x27')][_0xa4ff('0x43')](_0x1b32c9)['then'](handleEntityNotFound(_0x15837b,null))[_0xa4ff('0x22')](respondWithResult(_0x15837b,null))[_0xa4ff('0x41')](handleError(_0x15837b,null));};exports[_0xa4ff('0x44')]=function(_0xb2772,_0x3fccab){return db[_0xa4ff('0x27')]['create'](_0xb2772[_0xa4ff('0x45')],{})[_0xa4ff('0x22')](respondWithResult(_0x3fccab,0xc9))[_0xa4ff('0x41')](handleError(_0x3fccab,null));};exports[_0xa4ff('0x20')]=function(_0x5bb625,_0x4ec06c){if(_0x5bb625['body']['id']){delete _0x5bb625[_0xa4ff('0x45')]['id'];}return db['FreshdeskAccount']['find']({'where':{'id':_0x5bb625[_0xa4ff('0x46')]['id']}})['then'](handleEntityNotFound(_0x4ec06c,null))[_0xa4ff('0x22')](saveUpdates(_0x5bb625[_0xa4ff('0x45')],null))[_0xa4ff('0x22')](respondWithResult(_0x4ec06c,null))['catch'](handleError(_0x4ec06c,null));};exports[_0xa4ff('0x21')]=function(_0x5da1c6,_0x4055ae){return db[_0xa4ff('0x27')][_0xa4ff('0x43')]({'where':{'id':_0x5da1c6[_0xa4ff('0x46')]['id']}})[_0xa4ff('0x22')](handleEntityNotFound(_0x4055ae,null))[_0xa4ff('0x22')](removeEntity(_0x4055ae,null))[_0xa4ff('0x41')](handleError(_0x4055ae,null));};exports[_0xa4ff('0x47')]=function(_0x370e3a,_0x3ec139,_0x590f1a){var _0x1b31c4={};var _0x598d2c={};var _0x29df4c;var _0x459c69;return db['FreshdeskAccount'][_0xa4ff('0x48')]({'where':{'id':_0x370e3a[_0xa4ff('0x46')]['id']}})[_0xa4ff('0x22')](handleEntityNotFound(_0x3ec139,null))[_0xa4ff('0x22')](function(_0x4b92a8){if(_0x4b92a8){_0x29df4c=_0x4b92a8;_0x598d2c[_0xa4ff('0x2c')]=_[_0xa4ff('0x2f')](db[_0xa4ff('0x49')][_0xa4ff('0x28')]);_0x598d2c['query']=_['keys'](_0x370e3a[_0xa4ff('0x2e')]);_0x598d2c[_0xa4ff('0x30')]=_['intersection'](_0x598d2c[_0xa4ff('0x2c')],_0x598d2c[_0xa4ff('0x2e')]);_0x1b31c4[_0xa4ff('0x33')]=_[_0xa4ff('0x31')](_0x598d2c[_0xa4ff('0x2c')],qs[_0xa4ff('0x32')](_0x370e3a[_0xa4ff('0x2e')]['fields']));_0x1b31c4['attributes']=_0x1b31c4['attributes'][_0xa4ff('0x34')]?_0x1b31c4[_0xa4ff('0x33')]:_0x598d2c[_0xa4ff('0x2c')];_0x1b31c4[_0xa4ff('0x36')]=qs[_0xa4ff('0x37')](_0x370e3a[_0xa4ff('0x2e')]['sort']);_0x1b31c4[_0xa4ff('0x38')]=qs[_0xa4ff('0x30')](_['pick'](_0x370e3a[_0xa4ff('0x2e')],_0x598d2c[_0xa4ff('0x30')]));if(_0x370e3a['query'][_0xa4ff('0x3b')]){_0x1b31c4[_0xa4ff('0x38')]=_[_0xa4ff('0x39')](_0x1b31c4[_0xa4ff('0x38')],{'$or':_[_0xa4ff('0x2d')](_0x1b31c4['attributes'],function(_0x226890){var _0x24414e={};_0x24414e[_0x226890]={'$like':'%'+_0x370e3a[_0xa4ff('0x2e')][_0xa4ff('0x3b')]+'%'};return _0x24414e;})});}_0x1b31c4=_[_0xa4ff('0x39')]({},_0x1b31c4,_0x370e3a[_0xa4ff('0x3c')]);return _0x29df4c[_0xa4ff('0x47')](_0x1b31c4);}})['then'](function(_0x500f03){if(_0x500f03){_0x459c69=_0x500f03[_0xa4ff('0x34')];if(!_0x370e3a['query'][_0xa4ff('0x4a')](_0xa4ff('0x35'))){_0x1b31c4[_0xa4ff('0x1b')]=qs[_0xa4ff('0x1b')](_0x370e3a['query'][_0xa4ff('0x1b')]);_0x1b31c4[_0xa4ff('0x19')]=qs['offset'](_0x370e3a[_0xa4ff('0x2e')][_0xa4ff('0x19')]);}return _0x29df4c['getConfigurations'](_0x1b31c4);}})[_0xa4ff('0x22')](function(_0x55d8d2){if(_0x55d8d2){return _0x55d8d2?{'count':_0x459c69,'rows':_0x55d8d2}:null;}})[_0xa4ff('0x22')](respondWithResult(_0x3ec139,null))[_0xa4ff('0x41')](handleError(_0x3ec139,null));};exports['addConfiguration']=function(_0x132a36,_0x443fa2,_0x10bf9a){if(_0x132a36['body']['id']){delete _0x132a36[_0xa4ff('0x45')]['id'];}return db[_0xa4ff('0x27')][_0xa4ff('0x48')]({'where':{'id':_0x132a36[_0xa4ff('0x46')]['id']}})[_0xa4ff('0x22')](handleEntityNotFound(_0x443fa2,null))[_0xa4ff('0x22')](function(_0x5ed9e9){if(_0x5ed9e9){_0x132a36[_0xa4ff('0x45')][_0xa4ff('0x4b')]=_0x5ed9e9['id'];_0x132a36[_0xa4ff('0x45')][_0xa4ff('0x4c')]=integrations[_0xa4ff('0x4d')](_0x132a36['body'][_0xa4ff('0x4e')],_0x132a36['body'][_0xa4ff('0x2a')]);_0x132a36[_0xa4ff('0x45')][_0xa4ff('0x4f')]=integrations['getDescriptions'](_0x132a36['body'][_0xa4ff('0x4e')],_0x132a36[_0xa4ff('0x45')][_0xa4ff('0x2a')]);return db['FreshdeskConfiguration'][_0xa4ff('0x44')](_0x132a36[_0xa4ff('0x45')],{'include':[{'model':db['FreshdeskField'],'as':_0xa4ff('0x4c')},{'model':db[_0xa4ff('0x50')],'as':_0xa4ff('0x4f')}]});}return null;})[_0xa4ff('0x22')](respondWithResult(_0x443fa2,null))[_0xa4ff('0x41')](handleError(_0x443fa2,null));};exports[_0xa4ff('0x51')]=function(_0x364507,_0x53db00,_0x429211){var _0x27c756='';return db[_0xa4ff('0x27')]['findOne']({'where':{'id':_0x364507[_0xa4ff('0x46')]['id']},'attributes':['id',_0xa4ff('0x52'),'apiKey']})[_0xa4ff('0x22')](handleEntityNotFound(_0x53db00,null))[_0xa4ff('0x22')](function(_0xe0ccb8){if(_0xe0ccb8){_0x27c756=_0xe0ccb8['remoteUri'];var _0x34b2ad=_0x27c756[_0xa4ff('0x53')](-0x1);if(_0x34b2ad==='/'){_0x27c756=_0x27c756[_0xa4ff('0x54')](0x0,_0x27c756['lastIndexOf'](_0x34b2ad));}return rp({'method':_0xa4ff('0x55'),'uri':util[_0xa4ff('0x56')](_0xa4ff('0x57'),_0x27c756,_0xa4ff('0x58')),'headers':{'Authorization':util[_0xa4ff('0x56')]('Basic\x20%s',new Buffer(util[_0xa4ff('0x56')]('%s:X',_0xe0ccb8[_0xa4ff('0x59')]))[_0xa4ff('0x5a')](_0xa4ff('0x5b')))},'json':!![]});}})[_0xa4ff('0x22')](function(_0x4d76e8){if(_0x4d76e8){var _0x5dbb76=['requester',_0xa4ff('0x5c'),'agent',_0xa4ff('0x5d'),_0xa4ff('0x17'),_0xa4ff('0x5e'),_0xa4ff('0x5f'),_0xa4ff('0x60'),_0xa4ff('0x61'),_0xa4ff('0x5f'),_0xa4ff('0x62')];_['remove'](_0x4d76e8,function(_0x5aa8b1){return _0x5dbb76['includes'](_0x5aa8b1[_0xa4ff('0x24')])||!_0x5aa8b1[_0xa4ff('0x63')]&&_0x5aa8b1[_0xa4ff('0x2a')]!==_0xa4ff('0x64')&&_0x5aa8b1[_0xa4ff('0x2a')]!=='custom_dropdown';});return{'count':_0x4d76e8[_0xa4ff('0x34')],'rows':_[_0xa4ff('0x2d')](_0x4d76e8,function(_0x57b9a0){return{'id':_0x57b9a0[_0xa4ff('0x24')],'name':_0x57b9a0[_0xa4ff('0x65')],'custom':!_0x57b9a0[_0xa4ff('0x63')],'options':_0x57b9a0[_0xa4ff('0x66')]?_[_0xa4ff('0x2d')](_0x57b9a0[_0xa4ff('0x66')],function(_0x278c1e){return{'name':_[_0xa4ff('0x67')](_0x278c1e),'value':_0x278c1e};}):[]};})};}})[_0xa4ff('0x22')](respondWithResult(_0x53db00,null))['catch'](function(_0x28daec){var _0x1c6c6d=_0x364507[_0xa4ff('0x2e')][_0xa4ff('0x68')]?0x1f4:_0x28daec['statusCode']||0x1f4;logger[_0xa4ff('0x69')](_0xa4ff('0x6a'),_0xa4ff('0x51'),_0x1c6c6d,JSON[_0xa4ff('0x6b')](_0x28daec));delete _0x28daec['name'];if(_0x1c6c6d===0x191){_0x1c6c6d=0x190;}_0x53db00[_0xa4ff('0x17')](_0x1c6c6d)['send'](_0x364507[_0xa4ff('0x2e')][_0xa4ff('0x68')]?{'message':_0xa4ff('0x6c'),'statusCode':_0x28daec[_0xa4ff('0x6d')]}:_0x28daec);});}; \ No newline at end of file +var _0xea5b=['../../components/integrations/configuration','end','status','offset','undefined','count','limit','set','json','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','FreshdeskAccount','rawAttributes','fieldName','type','key','model','keys','query','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','length','create','body','find','getConfigurations','findOne','FreshdeskConfiguration','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','FreshdeskField','getFields','apiKey','remoteUri','slice','lastIndexOf','format','%s/%s','api/v2/ticket_fields','Basic\x20%s','%s:X','toString','base64','requester','subject','agent','description','priority','source','ticket_type','group','company','includes','custom_text','label','default','choices','capitalize','getFields,\x20%s,\x20%s,\x20%s','stringify','test','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util'];(function(_0x3481b9,_0xdc3295){var _0xf494a3=function(_0x2866ba){while(--_0x2866ba){_0x3481b9['push'](_0x3481b9['shift']());}};_0xf494a3(++_0xdc3295);}(_0xea5b,0x152));var _0xbea5=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0xea5b[_0x5d6456];return _0x4d66c1;};'use strict';var emlformat=require(_0xbea5('0x0'));var rimraf=require(_0xbea5('0x1'));var zipdir=require(_0xbea5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xbea5('0x3'));var BPromise=require(_0xbea5('0x4'));var Mustache=require(_0xbea5('0x5'));var util=require(_0xbea5('0x6'));var path=require('path');var sox=require(_0xbea5('0x7'));var csv=require('to-csv');var ejs=require(_0xbea5('0x8'));var fs=require('fs');var fs_extra=require(_0xbea5('0x9'));var _=require(_0xbea5('0xa'));var squel=require(_0xbea5('0xb'));var crypto=require(_0xbea5('0xc'));var jsforce=require(_0xbea5('0xd'));var deskjs=require(_0xbea5('0xe'));var toCsv=require(_0xbea5('0xf'));var querystring=require(_0xbea5('0x10'));var Papa=require(_0xbea5('0x11'));var Redis=require(_0xbea5('0x12'));var authService=require(_0xbea5('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbea5('0x14'));var logger=require(_0xbea5('0x15'))(_0xbea5('0x16'));var utils=require('../../config/utils');var config=require(_0xbea5('0x17'));var licenseUtil=require(_0xbea5('0x18'));var db=require('../../mysqldb')['db'];var integrations=require(_0xbea5('0x19'));function respondWithStatusCode(_0xa02bd,_0x1026ab){_0x1026ab=_0x1026ab||0xcc;return function(_0x2b7ed6){if(_0x2b7ed6){return _0xa02bd['sendStatus'](_0x1026ab);}return _0xa02bd['status'](_0x1026ab)[_0xbea5('0x1a')]();};}function respondWithResult(_0x491f82,_0x5d4b86){_0x5d4b86=_0x5d4b86||0xc8;return function(_0x43aba5){if(_0x43aba5){return _0x491f82[_0xbea5('0x1b')](_0x5d4b86)['json'](_0x43aba5);}};}function respondWithFilteredResult(_0x3a453b,_0x3cc4a3){return function(_0x3889fa){if(_0x3889fa){var _0x3bf144=typeof _0x3cc4a3[_0xbea5('0x1c')]===_0xbea5('0x1d')&&typeof _0x3cc4a3['limit']===_0xbea5('0x1d');var _0x3f8686=_0x3889fa[_0xbea5('0x1e')];var _0x47fd40=_0x3bf144?0x0:_0x3cc4a3[_0xbea5('0x1c')];var _0x6c50f4=_0x3bf144?_0x3889fa[_0xbea5('0x1e')]:_0x3cc4a3[_0xbea5('0x1c')]+_0x3cc4a3[_0xbea5('0x1f')];var _0x4a81d3;if(_0x6c50f4>=_0x3f8686){_0x6c50f4=_0x3f8686;_0x4a81d3=0xc8;}else{_0x4a81d3=0xce;}_0x3a453b[_0xbea5('0x1b')](_0x4a81d3);return _0x3a453b[_0xbea5('0x20')]('Content-Range',_0x47fd40+'-'+_0x6c50f4+'/'+_0x3f8686)[_0xbea5('0x21')](_0x3889fa);}return null;};}function patchUpdates(_0xf38123){return function(_0x3e83e6){try{jsonpatch[_0xbea5('0x22')](_0x3e83e6,_0xf38123,!![]);}catch(_0x325620){return BPromise[_0xbea5('0x23')](_0x325620);}return _0x3e83e6[_0xbea5('0x24')]();};}function saveUpdates(_0x89e334,_0x59a3db){return function(_0x461ccd){if(_0x461ccd){return _0x461ccd[_0xbea5('0x25')](_0x89e334)[_0xbea5('0x26')](function(_0xec4d42){return _0xec4d42;});}return null;};}function removeEntity(_0x44bf41,_0x6fb47f){return function(_0x2d7aa6){if(_0x2d7aa6){return _0x2d7aa6[_0xbea5('0x27')]()[_0xbea5('0x26')](function(){_0x44bf41[_0xbea5('0x1b')](0xcc)[_0xbea5('0x1a')]();});}};}function handleEntityNotFound(_0x375e45,_0x4d027c){return function(_0x5aa682){if(!_0x5aa682){_0x375e45[_0xbea5('0x28')](0x194);}return _0x5aa682;};}function handleError(_0x40596e,_0x3da75f){_0x3da75f=_0x3da75f||0x1f4;return function(_0x32313d){logger[_0xbea5('0x29')](_0x32313d[_0xbea5('0x2a')]);if(_0x32313d[_0xbea5('0x2b')]){delete _0x32313d[_0xbea5('0x2b')];}_0x40596e[_0xbea5('0x1b')](_0x3da75f)[_0xbea5('0x2c')](_0x32313d);};}exports[_0xbea5('0x2d')]=function(_0x60bfd6,_0x48b122){var _0x368e22={},_0xbc7ff5={},_0x1c2410={'count':0x0,'rows':[]};var _0x6d16eb=_[_0xbea5('0x2e')](db[_0xbea5('0x2f')][_0xbea5('0x30')],function(_0x259559){return{'name':_0x259559[_0xbea5('0x31')],'type':_0x259559[_0xbea5('0x32')][_0xbea5('0x33')]};});_0xbc7ff5[_0xbea5('0x34')]=_[_0xbea5('0x2e')](_0x6d16eb,_0xbea5('0x2b'));_0xbc7ff5['query']=_[_0xbea5('0x35')](_0x60bfd6[_0xbea5('0x36')]);_0xbc7ff5['filters']=_[_0xbea5('0x37')](_0xbc7ff5['model'],_0xbc7ff5[_0xbea5('0x36')]);_0x368e22[_0xbea5('0x38')]=_[_0xbea5('0x37')](_0xbc7ff5[_0xbea5('0x34')],qs['fields'](_0x60bfd6[_0xbea5('0x36')][_0xbea5('0x39')]));_0x368e22['attributes']=_0x368e22[_0xbea5('0x38')]['length']?_0x368e22[_0xbea5('0x38')]:_0xbc7ff5[_0xbea5('0x34')];if(!_0x60bfd6[_0xbea5('0x36')][_0xbea5('0x3a')](_0xbea5('0x3b'))){_0x368e22[_0xbea5('0x1f')]=qs[_0xbea5('0x1f')](_0x60bfd6[_0xbea5('0x36')][_0xbea5('0x1f')]);_0x368e22[_0xbea5('0x1c')]=qs[_0xbea5('0x1c')](_0x60bfd6[_0xbea5('0x36')][_0xbea5('0x1c')]);}_0x368e22[_0xbea5('0x3c')]=qs[_0xbea5('0x3d')](_0x60bfd6[_0xbea5('0x36')][_0xbea5('0x3d')]);_0x368e22[_0xbea5('0x3e')]=qs[_0xbea5('0x3f')](_[_0xbea5('0x40')](_0x60bfd6['query'],_0xbc7ff5['filters']),_0x6d16eb);if(_0x60bfd6['query'][_0xbea5('0x41')]){_0x368e22[_0xbea5('0x3e')]=_[_0xbea5('0x42')](_0x368e22[_0xbea5('0x3e')],{'$or':_[_0xbea5('0x2e')](_0x6d16eb,function(_0x38a0a5){if(_0x38a0a5['type']!==_0xbea5('0x43')){var _0x5241f9={};_0x5241f9[_0x38a0a5[_0xbea5('0x2b')]]={'$like':'%'+_0x60bfd6[_0xbea5('0x36')][_0xbea5('0x41')]+'%'};return _0x5241f9;}})});}_0x368e22=_[_0xbea5('0x42')]({},_0x368e22,_0x60bfd6[_0xbea5('0x44')]);var _0x538902={'where':_0x368e22[_0xbea5('0x3e')]};return db['FreshdeskAccount'][_0xbea5('0x1e')](_0x538902)['then'](function(_0x50d48a){_0x1c2410['count']=_0x50d48a;if(_0x60bfd6[_0xbea5('0x36')][_0xbea5('0x45')]){_0x368e22[_0xbea5('0x46')]=[{'all':!![]}];}return db[_0xbea5('0x2f')][_0xbea5('0x47')](_0x368e22);})['then'](function(_0x6c1bc1){_0x1c2410[_0xbea5('0x48')]=_0x6c1bc1;return _0x1c2410;})['then'](respondWithFilteredResult(_0x48b122,_0x368e22))[_0xbea5('0x49')](handleError(_0x48b122,null));};exports[_0xbea5('0x4a')]=function(_0x24105e,_0x537b18){var _0x3ac392={'raw':![],'where':{'id':_0x24105e[_0xbea5('0x4b')]['id']}},_0xab12c1={};_0xab12c1['model']=_[_0xbea5('0x35')](db['FreshdeskAccount']['rawAttributes']);_0xab12c1[_0xbea5('0x36')]=_[_0xbea5('0x35')](_0x24105e[_0xbea5('0x36')]);_0xab12c1['filters']=_['intersection'](_0xab12c1[_0xbea5('0x34')],_0xab12c1[_0xbea5('0x36')]);_0x3ac392['attributes']=_[_0xbea5('0x37')](_0xab12c1[_0xbea5('0x34')],qs[_0xbea5('0x39')](_0x24105e['query'][_0xbea5('0x39')]));_0x3ac392[_0xbea5('0x38')]=_0x3ac392[_0xbea5('0x38')][_0xbea5('0x4c')]?_0x3ac392[_0xbea5('0x38')]:_0xab12c1[_0xbea5('0x34')];if(_0x24105e[_0xbea5('0x36')][_0xbea5('0x45')]){_0x3ac392[_0xbea5('0x46')]=[{'all':!![]}];}_0x3ac392=_[_0xbea5('0x42')]({},_0x3ac392,_0x24105e[_0xbea5('0x44')]);return db['FreshdeskAccount']['find'](_0x3ac392)[_0xbea5('0x26')](handleEntityNotFound(_0x537b18,null))[_0xbea5('0x26')](respondWithResult(_0x537b18,null))[_0xbea5('0x49')](handleError(_0x537b18,null));};exports['create']=function(_0x43e6d4,_0x168422){return db[_0xbea5('0x2f')][_0xbea5('0x4d')](_0x43e6d4[_0xbea5('0x4e')],{})['then'](respondWithResult(_0x168422,0xc9))[_0xbea5('0x49')](handleError(_0x168422,null));};exports[_0xbea5('0x25')]=function(_0x37f725,_0x5b1b84){if(_0x37f725[_0xbea5('0x4e')]['id']){delete _0x37f725[_0xbea5('0x4e')]['id'];}return db[_0xbea5('0x2f')][_0xbea5('0x4f')]({'where':{'id':_0x37f725['params']['id']}})[_0xbea5('0x26')](handleEntityNotFound(_0x5b1b84,null))[_0xbea5('0x26')](saveUpdates(_0x37f725[_0xbea5('0x4e')],null))['then'](respondWithResult(_0x5b1b84,null))[_0xbea5('0x49')](handleError(_0x5b1b84,null));};exports[_0xbea5('0x27')]=function(_0x3849d4,_0x2f650a){return db['FreshdeskAccount'][_0xbea5('0x4f')]({'where':{'id':_0x3849d4[_0xbea5('0x4b')]['id']}})[_0xbea5('0x26')](handleEntityNotFound(_0x2f650a,null))[_0xbea5('0x26')](removeEntity(_0x2f650a,null))['catch'](handleError(_0x2f650a,null));};exports[_0xbea5('0x50')]=function(_0x2cffad,_0x2b2086,_0x177205){var _0x377820={};var _0x4d0bf1={};var _0x1f8f87;var _0x5ef7a7;return db['FreshdeskAccount'][_0xbea5('0x51')]({'where':{'id':_0x2cffad[_0xbea5('0x4b')]['id']}})[_0xbea5('0x26')](handleEntityNotFound(_0x2b2086,null))['then'](function(_0x3b2cc1){if(_0x3b2cc1){_0x1f8f87=_0x3b2cc1;_0x4d0bf1[_0xbea5('0x34')]=_['keys'](db[_0xbea5('0x52')][_0xbea5('0x30')]);_0x4d0bf1['query']=_[_0xbea5('0x35')](_0x2cffad[_0xbea5('0x36')]);_0x4d0bf1[_0xbea5('0x3f')]=_[_0xbea5('0x37')](_0x4d0bf1[_0xbea5('0x34')],_0x4d0bf1['query']);_0x377820[_0xbea5('0x38')]=_[_0xbea5('0x37')](_0x4d0bf1[_0xbea5('0x34')],qs[_0xbea5('0x39')](_0x2cffad['query']['fields']));_0x377820['attributes']=_0x377820[_0xbea5('0x38')]['length']?_0x377820['attributes']:_0x4d0bf1['model'];_0x377820[_0xbea5('0x3c')]=qs[_0xbea5('0x3d')](_0x2cffad[_0xbea5('0x36')][_0xbea5('0x3d')]);_0x377820[_0xbea5('0x3e')]=qs['filters'](_['pick'](_0x2cffad['query'],_0x4d0bf1[_0xbea5('0x3f')]));if(_0x2cffad[_0xbea5('0x36')]['filter']){_0x377820[_0xbea5('0x3e')]=_[_0xbea5('0x42')](_0x377820[_0xbea5('0x3e')],{'$or':_[_0xbea5('0x2e')](_0x377820[_0xbea5('0x38')],function(_0x4414f8){var _0x14d99c={};_0x14d99c[_0x4414f8]={'$like':'%'+_0x2cffad[_0xbea5('0x36')][_0xbea5('0x41')]+'%'};return _0x14d99c;})});}_0x377820=_[_0xbea5('0x42')]({},_0x377820,_0x2cffad[_0xbea5('0x44')]);return _0x1f8f87[_0xbea5('0x50')](_0x377820);}})[_0xbea5('0x26')](function(_0x578ad2){if(_0x578ad2){_0x5ef7a7=_0x578ad2['length'];if(!_0x2cffad[_0xbea5('0x36')][_0xbea5('0x3a')]('nolimit')){_0x377820[_0xbea5('0x1f')]=qs['limit'](_0x2cffad['query']['limit']);_0x377820[_0xbea5('0x1c')]=qs[_0xbea5('0x1c')](_0x2cffad['query']['offset']);}return _0x1f8f87[_0xbea5('0x50')](_0x377820);}})[_0xbea5('0x26')](function(_0x4b5e84){if(_0x4b5e84){return _0x4b5e84?{'count':_0x5ef7a7,'rows':_0x4b5e84}:null;}})[_0xbea5('0x26')](respondWithResult(_0x2b2086,null))[_0xbea5('0x49')](handleError(_0x2b2086,null));};exports[_0xbea5('0x53')]=function(_0x2d8948,_0x39949b,_0x187f92){if(_0x2d8948[_0xbea5('0x4e')]['id']){delete _0x2d8948[_0xbea5('0x4e')]['id'];}return db[_0xbea5('0x2f')]['findOne']({'where':{'id':_0x2d8948[_0xbea5('0x4b')]['id']}})['then'](handleEntityNotFound(_0x39949b,null))['then'](function(_0x4d9440){if(_0x4d9440){_0x2d8948[_0xbea5('0x4e')][_0xbea5('0x54')]=_0x4d9440['id'];_0x2d8948[_0xbea5('0x4e')][_0xbea5('0x55')]=integrations[_0xbea5('0x56')](_0x2d8948[_0xbea5('0x4e')][_0xbea5('0x57')],_0x2d8948[_0xbea5('0x4e')][_0xbea5('0x32')]);_0x2d8948[_0xbea5('0x4e')][_0xbea5('0x58')]=integrations[_0xbea5('0x59')](_0x2d8948[_0xbea5('0x4e')][_0xbea5('0x57')],_0x2d8948[_0xbea5('0x4e')][_0xbea5('0x32')]);return db[_0xbea5('0x52')][_0xbea5('0x4d')](_0x2d8948[_0xbea5('0x4e')],{'include':[{'model':db['FreshdeskField'],'as':_0xbea5('0x55')},{'model':db[_0xbea5('0x5a')],'as':_0xbea5('0x58')}]});}return null;})['then'](respondWithResult(_0x39949b,null))['catch'](handleError(_0x39949b,null));};exports[_0xbea5('0x5b')]=function(_0x57d772,_0x17ab21,_0x7b697){var _0x7e23ef='';return db[_0xbea5('0x2f')][_0xbea5('0x51')]({'where':{'id':_0x57d772[_0xbea5('0x4b')]['id']},'attributes':['id','remoteUri',_0xbea5('0x5c')]})[_0xbea5('0x26')](handleEntityNotFound(_0x17ab21,null))[_0xbea5('0x26')](function(_0x506550){if(_0x506550){_0x7e23ef=_0x506550[_0xbea5('0x5d')];var _0x4ee113=_0x7e23ef[_0xbea5('0x5e')](-0x1);if(_0x4ee113==='/'){_0x7e23ef=_0x7e23ef['substring'](0x0,_0x7e23ef[_0xbea5('0x5f')](_0x4ee113));}return rp({'method':'GET','uri':util[_0xbea5('0x60')](_0xbea5('0x61'),_0x7e23ef,_0xbea5('0x62')),'headers':{'Authorization':util[_0xbea5('0x60')](_0xbea5('0x63'),new Buffer(util[_0xbea5('0x60')](_0xbea5('0x64'),_0x506550[_0xbea5('0x5c')]))[_0xbea5('0x65')](_0xbea5('0x66')))},'json':!![]});}})['then'](function(_0x2b6f8a){if(_0x2b6f8a){var _0x54e4f8=[_0xbea5('0x67'),_0xbea5('0x68'),_0xbea5('0x69'),_0xbea5('0x6a'),_0xbea5('0x1b'),_0xbea5('0x6b'),'group',_0xbea5('0x6c'),_0xbea5('0x6d'),_0xbea5('0x6e'),_0xbea5('0x6f')];_['remove'](_0x2b6f8a,function(_0x44cf19){return _0x54e4f8[_0xbea5('0x70')](_0x44cf19[_0xbea5('0x2b')])||!_0x44cf19['default']&&_0x44cf19['type']!==_0xbea5('0x71')&&_0x44cf19[_0xbea5('0x32')]!=='custom_dropdown';});return{'count':_0x2b6f8a[_0xbea5('0x4c')],'rows':_[_0xbea5('0x2e')](_0x2b6f8a,function(_0x234b62){return{'id':_0x234b62['name'],'name':_0x234b62[_0xbea5('0x72')],'custom':!_0x234b62[_0xbea5('0x73')],'options':_0x234b62['choices']?_[_0xbea5('0x2e')](_0x234b62[_0xbea5('0x74')],function(_0x1e6137){return{'name':_[_0xbea5('0x75')](_0x1e6137),'value':_0x1e6137};}):[]};})};}})[_0xbea5('0x26')](respondWithResult(_0x17ab21,null))[_0xbea5('0x49')](function(_0x20c1cd){var _0x14c835=_0x57d772[_0xbea5('0x36')]['test']?0x1f4:_0x20c1cd['statusCode']||0x1f4;logger[_0xbea5('0x29')](_0xbea5('0x76'),_0xbea5('0x5b'),_0x14c835,JSON[_0xbea5('0x77')](_0x20c1cd));delete _0x20c1cd[_0xbea5('0x2b')];if(_0x14c835===0x191){_0x14c835=0x190;}_0x17ab21[_0xbea5('0x1b')](_0x14c835)[_0xbea5('0x2c')](_0x57d772[_0xbea5('0x36')][_0xbea5('0x78')]?{'message':'Wrong\x20credentials','statusCode':_0x20c1cd['statusCode']}:_0x20c1cd);});}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js index 1a36924..1f0ef8a 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 _0x6cbd=['bluebird','path','rimraf','./intFreshdeskAccount.attributes','../../components/integrations/configuration','exports','define','FreshdeskAccount','lodash','../../config/logger','moment'];(function(_0x17d20c,_0x3e7967){var _0x438c59=function(_0x547a10){while(--_0x547a10){_0x17d20c['push'](_0x17d20c['shift']());}};_0x438c59(++_0x3e7967);}(_0x6cbd,0xe4));var _0xd6cb=function(_0x18ab2a,_0x4debcd){_0x18ab2a=_0x18ab2a-0x0;var _0x16dcee=_0x6cbd[_0x18ab2a];return _0x16dcee;};'use strict';var _=require(_0xd6cb('0x0'));var util=require('util');var logger=require(_0xd6cb('0x1'))('api');var moment=require(_0xd6cb('0x2'));var BPromise=require(_0xd6cb('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd6cb('0x4'));var rimraf=require(_0xd6cb('0x5'));var config=require('../../config/environment');var attributes=require(_0xd6cb('0x6'));var integrations=require(_0xd6cb('0x7'));module[_0xd6cb('0x8')]=function(_0x538fae,_0xb8176a){return _0x538fae[_0xd6cb('0x9')](_0xd6cb('0xa'),attributes,{'tableName':'int_freshdesk_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x23a0=['define','FreshdeskAccount','int_freshdesk_accounts','lodash','../../config/logger','api','moment','bluebird','path','rimraf','./intFreshdeskAccount.attributes'];(function(_0x11b55e,_0x3262f3){var _0x141f2e=function(_0x25c45a){while(--_0x25c45a){_0x11b55e['push'](_0x11b55e['shift']());}};_0x141f2e(++_0x3262f3);}(_0x23a0,0xa8));var _0x023a=function(_0x1bb58c,_0x2c8a4d){_0x1bb58c=_0x1bb58c-0x0;var _0x277586=_0x23a0[_0x1bb58c];return _0x277586;};'use strict';var _=require(_0x023a('0x0'));var util=require('util');var logger=require(_0x023a('0x1'))(_0x023a('0x2'));var moment=require(_0x023a('0x3'));var BPromise=require(_0x023a('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x023a('0x5'));var rimraf=require(_0x023a('0x6'));var config=require('../../config/environment');var attributes=require(_0x023a('0x7'));var integrations=require('../../components/integrations/configuration');module['exports']=function(_0xf9f377,_0x29e6c2){return _0xf9f377[_0x023a('0x8')](_0x023a('0x9'),attributes,{'tableName':_0x023a('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.rpc.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.rpc.js index 25f7ba1..6e1a9a1 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 _0x49fe=['client','http','request','then','request\x20sent','debug','stringify','error','code','FreshdeskAccount,\x20%s,\x20%s','message','info','result','GetFreshdeskAccount','findAll','options','raw','where','attributes','limit','map','include','model','catch','ShowFreshdeskAccount','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x310043,_0x435e95){var _0x43283d=function(_0x247ab8){while(--_0x247ab8){_0x310043['push'](_0x310043['shift']());}};_0x43283d(++_0x435e95);}(_0x49fe,0x100));var _0xe49f=function(_0x47db81,_0x4d0f93){_0x47db81=_0x47db81-0x0;var _0x55c0e0=_0x49fe[_0x47db81];return _0x55c0e0;};'use strict';var _=require(_0xe49f('0x0'));var util=require(_0xe49f('0x1'));var moment=require(_0xe49f('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe49f('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xe49f('0x4'));var logger=require(_0xe49f('0x5'))(_0xe49f('0x6'));var config=require(_0xe49f('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xe49f('0x8')][_0xe49f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xbef6f5,_0x26eac9,_0x4f9b1f){return new BPromise(function(_0x384c48,_0x18f791){return client[_0xe49f('0xa')](_0xbef6f5,_0x4f9b1f)[_0xe49f('0xb')](function(_0x826f00){logger['info']('FreshdeskAccount,\x20%s,\x20%s',_0x26eac9,_0xe49f('0xc'));logger[_0xe49f('0xd')]('FreshdeskAccount,\x20%s,\x20%s,\x20%s',_0x26eac9,'request\x20sent',JSON[_0xe49f('0xe')](_0x826f00));if(_0x826f00[_0xe49f('0xf')]){if(_0x826f00[_0xe49f('0xf')][_0xe49f('0x10')]===0x1f4){logger[_0xe49f('0xf')](_0xe49f('0x11'),_0x26eac9,_0x826f00['error']['message']);return _0x18f791(_0x826f00[_0xe49f('0xf')][_0xe49f('0x12')]);}logger[_0xe49f('0xf')](_0xe49f('0x11'),_0x26eac9,_0x826f00[_0xe49f('0xf')]['message']);return _0x384c48(_0x826f00[_0xe49f('0xf')][_0xe49f('0x12')]);}else{logger[_0xe49f('0x13')]('FreshdeskAccount,\x20%s,\x20%s',_0x26eac9,_0xe49f('0xc'));_0x384c48(_0x826f00[_0xe49f('0x14')][_0xe49f('0x12')]);}})['catch'](function(_0xcb0d16){logger[_0xe49f('0xf')](_0xe49f('0x11'),_0x26eac9,_0xcb0d16);_0x18f791(_0xcb0d16);});});}exports[_0xe49f('0x15')]=function(_0x3fcfa4){var _0x7b1b0a=this;return new Promise(function(_0xdec8d,_0x3e2baa){return db['FreshdeskAccount'][_0xe49f('0x16')]({'raw':_0x3fcfa4['options']?_0x3fcfa4[_0xe49f('0x17')][_0xe49f('0x18')]===undefined?!![]:![]:!![],'where':_0x3fcfa4[_0xe49f('0x17')]?_0x3fcfa4[_0xe49f('0x17')][_0xe49f('0x19')]||null:null,'attributes':_0x3fcfa4[_0xe49f('0x17')]?_0x3fcfa4['options'][_0xe49f('0x1a')]||null:null,'limit':_0x3fcfa4[_0xe49f('0x17')]?_0x3fcfa4[_0xe49f('0x17')][_0xe49f('0x1b')]||null:null,'include':_0x3fcfa4[_0xe49f('0x17')]?_0x3fcfa4[_0xe49f('0x17')]['include']?_[_0xe49f('0x1c')](_0x3fcfa4[_0xe49f('0x17')][_0xe49f('0x1d')],function(_0x5e8908){return{'model':db[_0x5e8908[_0xe49f('0x1e')]],'as':_0x5e8908['as'],'attributes':_0x5e8908[_0xe49f('0x1a')],'include':_0x5e8908[_0xe49f('0x1d')]?_[_0xe49f('0x1c')](_0x5e8908[_0xe49f('0x1d')],function(_0x4d8f38){return{'model':db[_0x4d8f38[_0xe49f('0x1e')]],'as':_0x4d8f38['as'],'attributes':_0x4d8f38[_0xe49f('0x1a')],'include':_0x4d8f38[_0xe49f('0x1d')]?_[_0xe49f('0x1c')](_0x4d8f38[_0xe49f('0x1d')],function(_0x47aee6){return{'model':db[_0x47aee6['model']],'as':_0x47aee6['as'],'attributes':_0x47aee6[_0xe49f('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xe49f('0xb')](function(_0x2fec02){logger['info'](_0xe49f('0x15'),_0x3fcfa4);logger[_0xe49f('0xd')](_0xe49f('0x15'),_0x3fcfa4,JSON[_0xe49f('0xe')](_0x2fec02));_0xdec8d(_0x2fec02);})[_0xe49f('0x1f')](function(_0x28d6c0){logger[_0xe49f('0xf')](_0xe49f('0x15'),_0x28d6c0[_0xe49f('0x12')],_0x3fcfa4);_0x3e2baa(_0x7b1b0a[_0xe49f('0xf')](0x1f4,_0x28d6c0[_0xe49f('0x12')]));});});};exports[_0xe49f('0x20')]=function(_0x15e7c4){var _0x5d7211=this;return new Promise(function(_0x3e3588,_0x1d575c){return db['FreshdeskAccount']['find']({'raw':_0x15e7c4[_0xe49f('0x17')]?_0x15e7c4['options'][_0xe49f('0x18')]===undefined?!![]:![]:!![],'where':_0x15e7c4[_0xe49f('0x17')]?_0x15e7c4[_0xe49f('0x17')]['where']||null:null,'attributes':_0x15e7c4[_0xe49f('0x17')]?_0x15e7c4['options'][_0xe49f('0x1a')]||null:null,'include':_0x15e7c4[_0xe49f('0x17')]?_0x15e7c4[_0xe49f('0x17')][_0xe49f('0x1d')]?_[_0xe49f('0x1c')](_0x15e7c4[_0xe49f('0x17')][_0xe49f('0x1d')],function(_0x10aa33){return{'model':db[_0x10aa33[_0xe49f('0x1e')]],'as':_0x10aa33['as'],'attributes':_0x10aa33['attributes'],'include':_0x10aa33[_0xe49f('0x1d')]?_[_0xe49f('0x1c')](_0x10aa33[_0xe49f('0x1d')],function(_0x454890){return{'model':db[_0x454890[_0xe49f('0x1e')]],'as':_0x454890['as'],'attributes':_0x454890[_0xe49f('0x1a')],'include':_0x454890[_0xe49f('0x1d')]?_[_0xe49f('0x1c')](_0x454890[_0xe49f('0x1d')],function(_0x12f835){return{'model':db[_0x12f835['model']],'as':_0x12f835['as'],'attributes':_0x12f835['attributes']};}):[]};}):[]};}):[]:[]})[_0xe49f('0xb')](function(_0x1dc3e2){logger['info'](_0xe49f('0x20'),_0x15e7c4);logger['debug'](_0xe49f('0x20'),_0x15e7c4,JSON[_0xe49f('0xe')](_0x1dc3e2));_0x3e3588(_0x1dc3e2);})['catch'](function(_0x46d74b){logger[_0xe49f('0xf')](_0xe49f('0x20'),_0x46d74b[_0xe49f('0x12')],_0x15e7c4);_0x1d575c(_0x5d7211[_0xe49f('0xf')](0x1f4,_0x46d74b[_0xe49f('0x12')]));});});}; \ No newline at end of file +var _0xdc1e=['FreshdeskAccount,\x20%s,\x20%s','request\x20sent','FreshdeskAccount,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','GetFreshdeskAccount','FreshdeskAccount','findAll','options','where','attributes','limit','include','map','model','debug','ShowFreshdeskAccount','find','raw','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','request','then','info'];(function(_0x37bd3d,_0x1ba811){var _0x194889=function(_0x175337){while(--_0x175337){_0x37bd3d['push'](_0x37bd3d['shift']());}};_0x194889(++_0x1ba811);}(_0xdc1e,0xc1));var _0xedc1=function(_0x8fee7c,_0x385787){_0x8fee7c=_0x8fee7c-0x0;var _0x482778=_0xdc1e[_0x8fee7c];return _0x482778;};'use strict';var _=require(_0xedc1('0x0'));var util=require(_0xedc1('0x1'));var moment=require(_0xedc1('0x2'));var BPromise=require('bluebird');var rs=require(_0xedc1('0x3'));var fs=require('fs');var Redis=require(_0xedc1('0x4'));var db=require(_0xedc1('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xedc1('0x6'))('rpc');var config=require(_0xedc1('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x258114,_0x5bffd0,_0x1cd76d){return new BPromise(function(_0x20b443,_0x53718d){return client[_0xedc1('0x8')](_0x258114,_0x1cd76d)[_0xedc1('0x9')](function(_0x1d9fcc){logger[_0xedc1('0xa')](_0xedc1('0xb'),_0x5bffd0,_0xedc1('0xc'));logger['debug'](_0xedc1('0xd'),_0x5bffd0,'request\x20sent',JSON[_0xedc1('0xe')](_0x1d9fcc));if(_0x1d9fcc['error']){if(_0x1d9fcc['error'][_0xedc1('0xf')]===0x1f4){logger[_0xedc1('0x10')](_0xedc1('0xb'),_0x5bffd0,_0x1d9fcc[_0xedc1('0x10')][_0xedc1('0x11')]);return _0x53718d(_0x1d9fcc[_0xedc1('0x10')][_0xedc1('0x11')]);}logger[_0xedc1('0x10')](_0xedc1('0xb'),_0x5bffd0,_0x1d9fcc[_0xedc1('0x10')][_0xedc1('0x11')]);return _0x20b443(_0x1d9fcc[_0xedc1('0x10')]['message']);}else{logger['info'](_0xedc1('0xb'),_0x5bffd0,_0xedc1('0xc'));_0x20b443(_0x1d9fcc[_0xedc1('0x12')]['message']);}})[_0xedc1('0x13')](function(_0x21e4ee){logger[_0xedc1('0x10')]('FreshdeskAccount,\x20%s,\x20%s',_0x5bffd0,_0x21e4ee);_0x53718d(_0x21e4ee);});});}exports[_0xedc1('0x14')]=function(_0x366999){var _0x38c01e=this;return new Promise(function(_0x51035b,_0x18124e){return db[_0xedc1('0x15')][_0xedc1('0x16')]({'raw':_0x366999[_0xedc1('0x17')]?_0x366999[_0xedc1('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x366999['options']?_0x366999[_0xedc1('0x17')][_0xedc1('0x18')]||null:null,'attributes':_0x366999[_0xedc1('0x17')]?_0x366999[_0xedc1('0x17')][_0xedc1('0x19')]||null:null,'limit':_0x366999[_0xedc1('0x17')]?_0x366999[_0xedc1('0x17')][_0xedc1('0x1a')]||null:null,'include':_0x366999['options']?_0x366999[_0xedc1('0x17')][_0xedc1('0x1b')]?_[_0xedc1('0x1c')](_0x366999[_0xedc1('0x17')][_0xedc1('0x1b')],function(_0x5a2115){return{'model':db[_0x5a2115[_0xedc1('0x1d')]],'as':_0x5a2115['as'],'attributes':_0x5a2115[_0xedc1('0x19')],'include':_0x5a2115['include']?_[_0xedc1('0x1c')](_0x5a2115[_0xedc1('0x1b')],function(_0x5cb1e0){return{'model':db[_0x5cb1e0[_0xedc1('0x1d')]],'as':_0x5cb1e0['as'],'attributes':_0x5cb1e0[_0xedc1('0x19')],'include':_0x5cb1e0[_0xedc1('0x1b')]?_[_0xedc1('0x1c')](_0x5cb1e0[_0xedc1('0x1b')],function(_0x543a01){return{'model':db[_0x543a01[_0xedc1('0x1d')]],'as':_0x543a01['as'],'attributes':_0x543a01[_0xedc1('0x19')]};}):[]};}):[]};}):[]:[]})[_0xedc1('0x9')](function(_0x13aa50){logger['info']('GetFreshdeskAccount',_0x366999);logger[_0xedc1('0x1e')]('GetFreshdeskAccount',_0x366999,JSON[_0xedc1('0xe')](_0x13aa50));_0x51035b(_0x13aa50);})[_0xedc1('0x13')](function(_0x4d6beb){logger['error'](_0xedc1('0x14'),_0x4d6beb[_0xedc1('0x11')],_0x366999);_0x18124e(_0x38c01e[_0xedc1('0x10')](0x1f4,_0x4d6beb[_0xedc1('0x11')]));});});};exports[_0xedc1('0x1f')]=function(_0x2a5529){var _0x139236=this;return new Promise(function(_0x58ba04,_0x437ebe){return db[_0xedc1('0x15')][_0xedc1('0x20')]({'raw':_0x2a5529[_0xedc1('0x17')]?_0x2a5529[_0xedc1('0x17')][_0xedc1('0x21')]===undefined?!![]:![]:!![],'where':_0x2a5529['options']?_0x2a5529[_0xedc1('0x17')][_0xedc1('0x18')]||null:null,'attributes':_0x2a5529['options']?_0x2a5529[_0xedc1('0x17')][_0xedc1('0x19')]||null:null,'include':_0x2a5529['options']?_0x2a5529[_0xedc1('0x17')][_0xedc1('0x1b')]?_[_0xedc1('0x1c')](_0x2a5529[_0xedc1('0x17')]['include'],function(_0x1ee6c8){return{'model':db[_0x1ee6c8['model']],'as':_0x1ee6c8['as'],'attributes':_0x1ee6c8[_0xedc1('0x19')],'include':_0x1ee6c8[_0xedc1('0x1b')]?_[_0xedc1('0x1c')](_0x1ee6c8[_0xedc1('0x1b')],function(_0x497cae){return{'model':db[_0x497cae[_0xedc1('0x1d')]],'as':_0x497cae['as'],'attributes':_0x497cae[_0xedc1('0x19')],'include':_0x497cae['include']?_[_0xedc1('0x1c')](_0x497cae['include'],function(_0xcdb948){return{'model':db[_0xcdb948[_0xedc1('0x1d')]],'as':_0xcdb948['as'],'attributes':_0xcdb948[_0xedc1('0x19')]};}):[]};}):[]};}):[]:[]})[_0xedc1('0x9')](function(_0x29bb43){logger[_0xedc1('0xa')](_0xedc1('0x1f'),_0x2a5529);logger[_0xedc1('0x1e')](_0xedc1('0x1f'),_0x2a5529,JSON[_0xedc1('0xe')](_0x29bb43));_0x58ba04(_0x29bb43);})['catch'](function(_0x185162){logger['error'](_0xedc1('0x1f'),_0x185162[_0xedc1('0x11')],_0x2a5529);_0x437ebe(_0x139236[_0xedc1('0x10')](0x1f4,_0x185162['message']));});});}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/index.js b/server/api/intFreshdeskConfiguration/index.js index 947c507..ed67f7f 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 _0x9835=['path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','getDescriptions','/:id/tags','getTags','post','create','setTags','put','update','delete','destroy','multer'];(function(_0x52f70f,_0x5b9f75){var _0xc04c24=function(_0x3e674d){while(--_0x3e674d){_0x52f70f['push'](_0x52f70f['shift']());}};_0xc04c24(++_0x5b9f75);}(_0x9835,0xe9));var _0x5983=function(_0x89944e,_0x5c341a){_0x89944e=_0x89944e-0x0;var _0x3ab4ec=_0x9835[_0x89944e];return _0x3ab4ec;};'use strict';var multer=require(_0x5983('0x0'));var util=require('util');var path=require(_0x5983('0x1'));var timeout=require(_0x5983('0x2'));var express=require(_0x5983('0x3'));var router=express[_0x5983('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x5983('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x5983('0x6'));var controller=require('./intFreshdeskConfiguration.controller');router[_0x5983('0x7')]('/',auth[_0x5983('0x8')](),controller[_0x5983('0x9')]);router[_0x5983('0x7')](_0x5983('0xa'),auth[_0x5983('0x8')](),controller[_0x5983('0xb')]);router[_0x5983('0x7')](_0x5983('0xc'),auth[_0x5983('0x8')](),controller[_0x5983('0xd')]);router[_0x5983('0x7')](_0x5983('0xe'),auth[_0x5983('0x8')](),controller[_0x5983('0xf')]);router[_0x5983('0x7')]('/:id/descriptions',auth[_0x5983('0x8')](),controller[_0x5983('0x10')]);router[_0x5983('0x7')](_0x5983('0x11'),auth[_0x5983('0x8')](),controller[_0x5983('0x12')]);router[_0x5983('0x13')]('/',auth[_0x5983('0x8')](),controller[_0x5983('0x14')]);router[_0x5983('0x13')](_0x5983('0x11'),auth[_0x5983('0x8')](),controller[_0x5983('0x15')]);router[_0x5983('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x5983('0x17')]);router[_0x5983('0x18')](_0x5983('0xa'),auth[_0x5983('0x8')](),controller[_0x5983('0x19')]);module['exports']=router; \ No newline at end of file +var _0xc02a=['util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','get','isAuthenticated','/:id','/:id/fields','getFields','/:id/descriptions','/:id/tags','post','create','put','update','destroy','multer'];(function(_0xf21b53,_0x38e767){var _0x1d3c2d=function(_0x47dff8){while(--_0x47dff8){_0xf21b53['push'](_0xf21b53['shift']());}};_0x1d3c2d(++_0x38e767);}(_0xc02a,0x1cb));var _0xac02=function(_0x237546,_0xa81b26){_0x237546=_0x237546-0x0;var _0x233e29=_0xc02a[_0x237546];return _0x233e29;};'use strict';var multer=require(_0xac02('0x0'));var util=require(_0xac02('0x1'));var path=require(_0xac02('0x2'));var timeout=require(_0xac02('0x3'));var express=require(_0xac02('0x4'));var router=express[_0xac02('0x5')]();var fs_extra=require(_0xac02('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xac02('0x7'));var config=require('../../config/environment');var controller=require('./intFreshdeskConfiguration.controller');router[_0xac02('0x8')]('/',auth[_0xac02('0x9')](),controller['index']);router[_0xac02('0x8')](_0xac02('0xa'),auth[_0xac02('0x9')](),controller['show']);router['get'](_0xac02('0xb'),auth['isAuthenticated'](),controller[_0xac02('0xc')]);router[_0xac02('0x8')]('/:id/subjects',auth['isAuthenticated'](),controller['getSubjects']);router['get'](_0xac02('0xd'),auth['isAuthenticated'](),controller['getDescriptions']);router[_0xac02('0x8')](_0xac02('0xe'),auth[_0xac02('0x9')](),controller['getTags']);router[_0xac02('0xf')]('/',auth['isAuthenticated'](),controller[_0xac02('0x10')]);router[_0xac02('0xf')]('/:id/tags',auth['isAuthenticated'](),controller['setTags']);router[_0xac02('0x11')](_0xac02('0xa'),auth[_0xac02('0x9')](),controller[_0xac02('0x12')]);router['delete'](_0xac02('0xa'),auth[_0xac02('0x9')](),controller[_0xac02('0x13')]);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 683a9d9..da6533c 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 _0xa0bc=['sequelize','STRING'];(function(_0x3aa1da,_0xcdd198){var _0x3ea744=function(_0x2503ce){while(--_0x2503ce){_0x3aa1da['push'](_0x3aa1da['shift']());}};_0x3ea744(++_0xcdd198);}(_0xa0bc,0x156));var _0xca0b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa0bc[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xca0b('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xca0b('0x1')]}}; \ No newline at end of file +var _0x392c=['exports','STRING'];(function(_0x659aaa,_0x4d1480){var _0x42cc0d=function(_0x24d526){while(--_0x24d526){_0x659aaa['push'](_0x659aaa['shift']());}};_0x42cc0d(++_0x4d1480);}(_0x392c,0x1aa));var _0xc392=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x392c[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module[_0xc392('0x0')]={'name':{'type':Sequelize[_0xc392('0x1')]},'description':{'type':Sequelize[_0xc392('0x1')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js index e734d49..dfe90f8 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 _0xb534=['ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','limit','undefined','offset','count','Content-Range','json','reject','save','update','then','error','stack','name','index','map','FreshdeskConfiguration','rawAttributes','fieldName','type','key','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','params','find','create','body','getFields','findOne','FreshdeskField','getSubjects','getDescriptions','setTags','eml-format','rimraf','zip-dir','fast-json-patch','moment','util','path','sox','to-csv'];(function(_0x2763f2,_0x416af8){var _0x3ef471=function(_0x288aa2){while(--_0x288aa2){_0x2763f2['push'](_0x2763f2['shift']());}};_0x3ef471(++_0x416af8);}(_0xb534,0x1d1));var _0x4b53=function(_0x50be14,_0x3cea6d){_0x50be14=_0x50be14-0x0;var _0x400646=_0xb534[_0x50be14];return _0x400646;};'use strict';var emlformat=require(_0x4b53('0x0'));var rimraf=require(_0x4b53('0x1'));var zipdir=require(_0x4b53('0x2'));var jsonpatch=require(_0x4b53('0x3'));var rp=require('request-promise');var moment=require(_0x4b53('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x4b53('0x5'));var path=require(_0x4b53('0x6'));var sox=require(_0x4b53('0x7'));var csv=require(_0x4b53('0x8'));var ejs=require(_0x4b53('0x9'));var fs=require('fs');var fs_extra=require(_0x4b53('0xa'));var _=require(_0x4b53('0xb'));var squel=require(_0x4b53('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x4b53('0xd'));var toCsv=require(_0x4b53('0x8'));var querystring=require(_0x4b53('0xe'));var Papa=require(_0x4b53('0xf'));var Redis=require('ioredis');var authService=require(_0x4b53('0x10'));var qs=require(_0x4b53('0x11'));var as=require(_0x4b53('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4b53('0x13'))('api');var utils=require(_0x4b53('0x14'));var config=require(_0x4b53('0x15'));var licenseUtil=require(_0x4b53('0x16'));var db=require(_0x4b53('0x17'))['db'];function respondWithStatusCode(_0xc6fb81,_0x3260de){_0x3260de=_0x3260de||0xcc;return function(_0x3f323d){if(_0x3f323d){return _0xc6fb81[_0x4b53('0x18')](_0x3260de);}return _0xc6fb81[_0x4b53('0x19')](_0x3260de)['end']();};}function respondWithResult(_0x136ef1,_0x3a6a05){_0x3a6a05=_0x3a6a05||0xc8;return function(_0x4bc4c9){if(_0x4bc4c9){return _0x136ef1['status'](_0x3a6a05)['json'](_0x4bc4c9);}};}function respondWithFilteredResult(_0x2d4ef3,_0x45bb75){return function(_0x465915){if(_0x465915){var _0x105ca9=typeof _0x45bb75['offset']==='undefined'&&typeof _0x45bb75[_0x4b53('0x1a')]===_0x4b53('0x1b');var _0x13de44=_0x465915['count'];var _0x2114eb=_0x105ca9?0x0:_0x45bb75[_0x4b53('0x1c')];var _0x3a81fb=_0x105ca9?_0x465915[_0x4b53('0x1d')]:_0x45bb75[_0x4b53('0x1c')]+_0x45bb75['limit'];var _0x53646a;if(_0x3a81fb>=_0x13de44){_0x3a81fb=_0x13de44;_0x53646a=0xc8;}else{_0x53646a=0xce;}_0x2d4ef3[_0x4b53('0x19')](_0x53646a);return _0x2d4ef3['set'](_0x4b53('0x1e'),_0x2114eb+'-'+_0x3a81fb+'/'+_0x13de44)[_0x4b53('0x1f')](_0x465915);}return null;};}function patchUpdates(_0x2a4c59){return function(_0x3052ce){try{jsonpatch['apply'](_0x3052ce,_0x2a4c59,!![]);}catch(_0x174be3){return BPromise[_0x4b53('0x20')](_0x174be3);}return _0x3052ce[_0x4b53('0x21')]();};}function saveUpdates(_0x47989e,_0x32a0ef){return function(_0x2d6201){if(_0x2d6201){return _0x2d6201[_0x4b53('0x22')](_0x47989e)[_0x4b53('0x23')](function(_0x43713f){return _0x43713f;});}return null;};}function removeEntity(_0x5180ec,_0x457a16){return function(_0x13b76f){if(_0x13b76f){return _0x13b76f['destroy']()[_0x4b53('0x23')](function(){_0x5180ec[_0x4b53('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1e0aa9,_0x5782ca){return function(_0xa2f505){if(!_0xa2f505){_0x1e0aa9[_0x4b53('0x18')](0x194);}return _0xa2f505;};}function handleError(_0x7f62dc,_0x1ebbfc){_0x1ebbfc=_0x1ebbfc||0x1f4;return function(_0x1ab548){logger[_0x4b53('0x24')](_0x1ab548[_0x4b53('0x25')]);if(_0x1ab548[_0x4b53('0x26')]){delete _0x1ab548['name'];}_0x7f62dc[_0x4b53('0x19')](_0x1ebbfc)['send'](_0x1ab548);};}exports[_0x4b53('0x27')]=function(_0x459944,_0x5a1500){var _0x4b2280={},_0x51532e={},_0x1c6e2e={'count':0x0,'rows':[]};var _0x95b31d=_[_0x4b53('0x28')](db[_0x4b53('0x29')][_0x4b53('0x2a')],function(_0x320d3b){return{'name':_0x320d3b[_0x4b53('0x2b')],'type':_0x320d3b[_0x4b53('0x2c')][_0x4b53('0x2d')]};});_0x51532e['model']=_['map'](_0x95b31d,_0x4b53('0x26'));_0x51532e[_0x4b53('0x2e')]=_[_0x4b53('0x2f')](_0x459944[_0x4b53('0x2e')]);_0x51532e[_0x4b53('0x30')]=_[_0x4b53('0x31')](_0x51532e['model'],_0x51532e[_0x4b53('0x2e')]);_0x4b2280[_0x4b53('0x32')]=_['intersection'](_0x51532e[_0x4b53('0x33')],qs['fields'](_0x459944[_0x4b53('0x2e')][_0x4b53('0x34')]));_0x4b2280[_0x4b53('0x32')]=_0x4b2280[_0x4b53('0x32')][_0x4b53('0x35')]?_0x4b2280[_0x4b53('0x32')]:_0x51532e[_0x4b53('0x33')];if(!_0x459944[_0x4b53('0x2e')][_0x4b53('0x36')](_0x4b53('0x37'))){_0x4b2280[_0x4b53('0x1a')]=qs[_0x4b53('0x1a')](_0x459944[_0x4b53('0x2e')]['limit']);_0x4b2280[_0x4b53('0x1c')]=qs[_0x4b53('0x1c')](_0x459944['query'][_0x4b53('0x1c')]);}_0x4b2280[_0x4b53('0x38')]=qs[_0x4b53('0x39')](_0x459944['query']['sort']);_0x4b2280[_0x4b53('0x3a')]=qs[_0x4b53('0x30')](_[_0x4b53('0x3b')](_0x459944[_0x4b53('0x2e')],_0x51532e[_0x4b53('0x30')]),_0x95b31d);if(_0x459944['query']['filter']){_0x4b2280[_0x4b53('0x3a')]=_[_0x4b53('0x3c')](_0x4b2280[_0x4b53('0x3a')],{'$or':_[_0x4b53('0x28')](_0x95b31d,function(_0x13506a){if(_0x13506a[_0x4b53('0x2c')]!==_0x4b53('0x3d')){var _0xdbb35={};_0xdbb35[_0x13506a[_0x4b53('0x26')]]={'$like':'%'+_0x459944[_0x4b53('0x2e')][_0x4b53('0x3e')]+'%'};return _0xdbb35;}})});}_0x4b2280=_[_0x4b53('0x3c')]({},_0x4b2280,_0x459944[_0x4b53('0x3f')]);var _0x1c4d8c={'where':_0x4b2280['where']};return db[_0x4b53('0x29')]['count'](_0x1c4d8c)[_0x4b53('0x23')](function(_0x1f2168){_0x1c6e2e[_0x4b53('0x1d')]=_0x1f2168;if(_0x459944[_0x4b53('0x2e')][_0x4b53('0x40')]){_0x4b2280[_0x4b53('0x41')]=[{'all':!![]}];}return db[_0x4b53('0x29')][_0x4b53('0x42')](_0x4b2280);})[_0x4b53('0x23')](function(_0x9fe85c){_0x1c6e2e[_0x4b53('0x43')]=_0x9fe85c;return _0x1c6e2e;})[_0x4b53('0x23')](respondWithFilteredResult(_0x5a1500,_0x4b2280))[_0x4b53('0x44')](handleError(_0x5a1500,null));};exports['show']=function(_0x57092d,_0x42e794){var _0x2f3309={'raw':![],'where':{'id':_0x57092d[_0x4b53('0x45')]['id']}},_0x5a20fe={};_0x5a20fe[_0x4b53('0x33')]=_['keys'](db['FreshdeskConfiguration']['rawAttributes']);_0x5a20fe[_0x4b53('0x2e')]=_[_0x4b53('0x2f')](_0x57092d[_0x4b53('0x2e')]);_0x5a20fe['filters']=_[_0x4b53('0x31')](_0x5a20fe['model'],_0x5a20fe['query']);_0x2f3309[_0x4b53('0x32')]=_[_0x4b53('0x31')](_0x5a20fe[_0x4b53('0x33')],qs[_0x4b53('0x34')](_0x57092d['query'][_0x4b53('0x34')]));_0x2f3309[_0x4b53('0x32')]=_0x2f3309[_0x4b53('0x32')][_0x4b53('0x35')]?_0x2f3309[_0x4b53('0x32')]:_0x5a20fe[_0x4b53('0x33')];if(_0x57092d['query']['includeAll']){_0x2f3309['include']=[{'all':!![]}];}_0x2f3309=_[_0x4b53('0x3c')]({},_0x2f3309,_0x57092d['options']);return db[_0x4b53('0x29')][_0x4b53('0x46')](_0x2f3309)[_0x4b53('0x23')](handleEntityNotFound(_0x42e794,null))[_0x4b53('0x23')](respondWithResult(_0x42e794,null))[_0x4b53('0x44')](handleError(_0x42e794,null));};exports[_0x4b53('0x47')]=function(_0x256943,_0x275aba){return db[_0x4b53('0x29')]['create'](_0x256943['body'],{})[_0x4b53('0x23')](respondWithResult(_0x275aba,0xc9))[_0x4b53('0x44')](handleError(_0x275aba,null));};exports[_0x4b53('0x22')]=function(_0x3766af,_0x21768e){if(_0x3766af[_0x4b53('0x48')]['id']){delete _0x3766af[_0x4b53('0x48')]['id'];}return db[_0x4b53('0x29')][_0x4b53('0x46')]({'where':{'id':_0x3766af[_0x4b53('0x45')]['id']}})['then'](handleEntityNotFound(_0x21768e,null))[_0x4b53('0x23')](saveUpdates(_0x3766af['body'],null))[_0x4b53('0x23')](respondWithResult(_0x21768e,null))[_0x4b53('0x44')](handleError(_0x21768e,null));};exports['destroy']=function(_0x2efe46,_0x263015){return db['FreshdeskConfiguration']['find']({'where':{'id':_0x2efe46[_0x4b53('0x45')]['id']}})[_0x4b53('0x23')](handleEntityNotFound(_0x263015,null))[_0x4b53('0x23')](removeEntity(_0x263015,null))[_0x4b53('0x44')](handleError(_0x263015,null));};exports[_0x4b53('0x49')]=function(_0x94d89e,_0x3940ba,_0x1a1f6a){var _0x159e0a={};var _0x577df7={};var _0x182e36;var _0xef4c9b;return db['FreshdeskConfiguration'][_0x4b53('0x4a')]({'where':{'id':_0x94d89e[_0x4b53('0x45')]['id']}})['then'](handleEntityNotFound(_0x3940ba,null))['then'](function(_0x1b6e10){if(_0x1b6e10){_0x182e36=_0x1b6e10;_0x577df7[_0x4b53('0x33')]=_[_0x4b53('0x2f')](db[_0x4b53('0x4b')][_0x4b53('0x2a')]);_0x577df7[_0x4b53('0x2e')]=_[_0x4b53('0x2f')](_0x94d89e[_0x4b53('0x2e')]);_0x577df7[_0x4b53('0x30')]=_['intersection'](_0x577df7[_0x4b53('0x33')],_0x577df7[_0x4b53('0x2e')]);_0x159e0a[_0x4b53('0x32')]=_[_0x4b53('0x31')](_0x577df7[_0x4b53('0x33')],qs[_0x4b53('0x34')](_0x94d89e[_0x4b53('0x2e')][_0x4b53('0x34')]));_0x159e0a[_0x4b53('0x32')]=_0x159e0a[_0x4b53('0x32')][_0x4b53('0x35')]?_0x159e0a['attributes']:_0x577df7['model'];_0x159e0a[_0x4b53('0x38')]=qs[_0x4b53('0x39')](_0x94d89e[_0x4b53('0x2e')][_0x4b53('0x39')]);_0x159e0a[_0x4b53('0x3a')]=qs[_0x4b53('0x30')](_['pick'](_0x94d89e['query'],_0x577df7[_0x4b53('0x30')]));if(_0x94d89e[_0x4b53('0x2e')][_0x4b53('0x3e')]){_0x159e0a[_0x4b53('0x3a')]=_['merge'](_0x159e0a[_0x4b53('0x3a')],{'$or':_[_0x4b53('0x28')](_0x159e0a['attributes'],function(_0x451b0c){var _0xe515b7={};_0xe515b7[_0x451b0c]={'$like':'%'+_0x94d89e['query'][_0x4b53('0x3e')]+'%'};return _0xe515b7;})});}_0x159e0a=_[_0x4b53('0x3c')]({},_0x159e0a,_0x94d89e[_0x4b53('0x3f')]);return _0x182e36['getFields'](_0x159e0a);}})[_0x4b53('0x23')](function(_0x2374db){if(_0x2374db){_0xef4c9b=_0x2374db['length'];if(!_0x94d89e[_0x4b53('0x2e')][_0x4b53('0x36')](_0x4b53('0x37'))){_0x159e0a[_0x4b53('0x1a')]=qs[_0x4b53('0x1a')](_0x94d89e['query'][_0x4b53('0x1a')]);_0x159e0a[_0x4b53('0x1c')]=qs[_0x4b53('0x1c')](_0x94d89e[_0x4b53('0x2e')][_0x4b53('0x1c')]);}return _0x182e36['getFields'](_0x159e0a);}})[_0x4b53('0x23')](function(_0x241428){if(_0x241428){return _0x241428?{'count':_0xef4c9b,'rows':_0x241428}:null;}})[_0x4b53('0x23')](respondWithResult(_0x3940ba,null))['catch'](handleError(_0x3940ba,null));};exports['getSubjects']=function(_0x30c622,_0x1e8ef4,_0x4f45d7){var _0xf2275f={};var _0x50e958={};var _0x3c0dde;var _0x4a8b41;return db['FreshdeskConfiguration'][_0x4b53('0x4a')]({'where':{'id':_0x30c622[_0x4b53('0x45')]['id']}})[_0x4b53('0x23')](handleEntityNotFound(_0x1e8ef4,null))[_0x4b53('0x23')](function(_0x594523){if(_0x594523){_0x3c0dde=_0x594523;_0x50e958[_0x4b53('0x33')]=_[_0x4b53('0x2f')](db['FreshdeskField'][_0x4b53('0x2a')]);_0x50e958[_0x4b53('0x2e')]=_[_0x4b53('0x2f')](_0x30c622[_0x4b53('0x2e')]);_0x50e958[_0x4b53('0x30')]=_[_0x4b53('0x31')](_0x50e958[_0x4b53('0x33')],_0x50e958[_0x4b53('0x2e')]);_0xf2275f[_0x4b53('0x32')]=_[_0x4b53('0x31')](_0x50e958[_0x4b53('0x33')],qs[_0x4b53('0x34')](_0x30c622[_0x4b53('0x2e')]['fields']));_0xf2275f[_0x4b53('0x32')]=_0xf2275f[_0x4b53('0x32')][_0x4b53('0x35')]?_0xf2275f[_0x4b53('0x32')]:_0x50e958[_0x4b53('0x33')];_0xf2275f[_0x4b53('0x38')]=qs[_0x4b53('0x39')](_0x30c622[_0x4b53('0x2e')][_0x4b53('0x39')]);_0xf2275f[_0x4b53('0x3a')]=qs[_0x4b53('0x30')](_[_0x4b53('0x3b')](_0x30c622[_0x4b53('0x2e')],_0x50e958['filters']));if(_0x30c622[_0x4b53('0x2e')][_0x4b53('0x3e')]){_0xf2275f[_0x4b53('0x3a')]=_['merge'](_0xf2275f['where'],{'$or':_[_0x4b53('0x28')](_0xf2275f[_0x4b53('0x32')],function(_0x15d1c1){var _0x4d8c94={};_0x4d8c94[_0x15d1c1]={'$like':'%'+_0x30c622[_0x4b53('0x2e')][_0x4b53('0x3e')]+'%'};return _0x4d8c94;})});}_0xf2275f=_['merge']({},_0xf2275f,_0x30c622['options']);return _0x3c0dde[_0x4b53('0x4c')](_0xf2275f);}})[_0x4b53('0x23')](function(_0x8e789b){if(_0x8e789b){_0x4a8b41=_0x8e789b['length'];if(!_0x30c622['query'][_0x4b53('0x36')](_0x4b53('0x37'))){_0xf2275f[_0x4b53('0x1a')]=qs['limit'](_0x30c622[_0x4b53('0x2e')][_0x4b53('0x1a')]);_0xf2275f['offset']=qs['offset'](_0x30c622['query'][_0x4b53('0x1c')]);}return _0x3c0dde[_0x4b53('0x4c')](_0xf2275f);}})[_0x4b53('0x23')](function(_0x3812d8){if(_0x3812d8){return _0x3812d8?{'count':_0x4a8b41,'rows':_0x3812d8}:null;}})['then'](respondWithResult(_0x1e8ef4,null))[_0x4b53('0x44')](handleError(_0x1e8ef4,null));};exports['getDescriptions']=function(_0x393156,_0x460ad6,_0x459cec){var _0x2ada28={};var _0x3bb1f7={};var _0x516734;var _0x5bb5c9;return db[_0x4b53('0x29')]['findOne']({'where':{'id':_0x393156[_0x4b53('0x45')]['id']}})[_0x4b53('0x23')](handleEntityNotFound(_0x460ad6,null))[_0x4b53('0x23')](function(_0x542985){if(_0x542985){_0x516734=_0x542985;_0x3bb1f7[_0x4b53('0x33')]=_[_0x4b53('0x2f')](db[_0x4b53('0x4b')]['rawAttributes']);_0x3bb1f7[_0x4b53('0x2e')]=_[_0x4b53('0x2f')](_0x393156['query']);_0x3bb1f7[_0x4b53('0x30')]=_[_0x4b53('0x31')](_0x3bb1f7[_0x4b53('0x33')],_0x3bb1f7[_0x4b53('0x2e')]);_0x2ada28[_0x4b53('0x32')]=_[_0x4b53('0x31')](_0x3bb1f7[_0x4b53('0x33')],qs[_0x4b53('0x34')](_0x393156[_0x4b53('0x2e')][_0x4b53('0x34')]));_0x2ada28[_0x4b53('0x32')]=_0x2ada28[_0x4b53('0x32')]['length']?_0x2ada28[_0x4b53('0x32')]:_0x3bb1f7[_0x4b53('0x33')];_0x2ada28['order']=qs[_0x4b53('0x39')](_0x393156['query'][_0x4b53('0x39')]);_0x2ada28[_0x4b53('0x3a')]=qs[_0x4b53('0x30')](_[_0x4b53('0x3b')](_0x393156[_0x4b53('0x2e')],_0x3bb1f7[_0x4b53('0x30')]));if(_0x393156[_0x4b53('0x2e')]['filter']){_0x2ada28['where']=_[_0x4b53('0x3c')](_0x2ada28[_0x4b53('0x3a')],{'$or':_[_0x4b53('0x28')](_0x2ada28[_0x4b53('0x32')],function(_0x1ad19d){var _0x474266={};_0x474266[_0x1ad19d]={'$like':'%'+_0x393156['query'][_0x4b53('0x3e')]+'%'};return _0x474266;})});}_0x2ada28=_[_0x4b53('0x3c')]({},_0x2ada28,_0x393156[_0x4b53('0x3f')]);return _0x516734[_0x4b53('0x4d')](_0x2ada28);}})['then'](function(_0x27311e){if(_0x27311e){_0x5bb5c9=_0x27311e[_0x4b53('0x35')];if(!_0x393156[_0x4b53('0x2e')][_0x4b53('0x36')](_0x4b53('0x37'))){_0x2ada28[_0x4b53('0x1a')]=qs[_0x4b53('0x1a')](_0x393156['query']['limit']);_0x2ada28['offset']=qs['offset'](_0x393156[_0x4b53('0x2e')][_0x4b53('0x1c')]);}return _0x516734[_0x4b53('0x4d')](_0x2ada28);}})[_0x4b53('0x23')](function(_0xac1de2){if(_0xac1de2){return _0xac1de2?{'count':_0x5bb5c9,'rows':_0xac1de2}:null;}})[_0x4b53('0x23')](respondWithResult(_0x460ad6,null))[_0x4b53('0x44')](handleError(_0x460ad6,null));};exports['getTags']=function(_0x5d9202,_0x325531,_0x5f4361){var _0x3fb9d7={};var _0x522408={};var _0x3d4c39;var _0x42df1d;return db[_0x4b53('0x29')][_0x4b53('0x4a')]({'where':{'id':_0x5d9202[_0x4b53('0x45')]['id']}})['then'](handleEntityNotFound(_0x325531,null))[_0x4b53('0x23')](function(_0x1f6a6c){if(_0x1f6a6c){_0x3d4c39=_0x1f6a6c;_0x522408[_0x4b53('0x33')]=_[_0x4b53('0x2f')](db['Tag']['rawAttributes']);_0x522408[_0x4b53('0x2e')]=_['keys'](_0x5d9202[_0x4b53('0x2e')]);_0x522408[_0x4b53('0x30')]=_['intersection'](_0x522408[_0x4b53('0x33')],_0x522408['query']);_0x3fb9d7[_0x4b53('0x32')]=_[_0x4b53('0x31')](_0x522408[_0x4b53('0x33')],qs['fields'](_0x5d9202['query'][_0x4b53('0x34')]));_0x3fb9d7['attributes']=_0x3fb9d7[_0x4b53('0x32')]['length']?_0x3fb9d7[_0x4b53('0x32')]:_0x522408[_0x4b53('0x33')];_0x3fb9d7['order']=qs[_0x4b53('0x39')](_0x5d9202[_0x4b53('0x2e')][_0x4b53('0x39')]);_0x3fb9d7[_0x4b53('0x3a')]=qs[_0x4b53('0x30')](_[_0x4b53('0x3b')](_0x5d9202[_0x4b53('0x2e')],_0x522408[_0x4b53('0x30')]));if(_0x5d9202[_0x4b53('0x2e')][_0x4b53('0x3e')]){_0x3fb9d7[_0x4b53('0x3a')]=_[_0x4b53('0x3c')](_0x3fb9d7[_0x4b53('0x3a')],{'$or':_['map'](_0x3fb9d7[_0x4b53('0x32')],function(_0x1607db){var _0x1255be={};_0x1255be[_0x1607db]={'$like':'%'+_0x5d9202['query'][_0x4b53('0x3e')]+'%'};return _0x1255be;})});}_0x3fb9d7=_[_0x4b53('0x3c')]({},_0x3fb9d7,_0x5d9202[_0x4b53('0x3f')]);return _0x3d4c39['getTags'](_0x3fb9d7);}})[_0x4b53('0x23')](function(_0x184a37){if(_0x184a37){_0x42df1d=_0x184a37[_0x4b53('0x35')];if(!_0x5d9202['query'][_0x4b53('0x36')]('nolimit')){_0x3fb9d7[_0x4b53('0x1a')]=qs[_0x4b53('0x1a')](_0x5d9202[_0x4b53('0x2e')]['limit']);_0x3fb9d7[_0x4b53('0x1c')]=qs[_0x4b53('0x1c')](_0x5d9202[_0x4b53('0x2e')][_0x4b53('0x1c')]);}return _0x3d4c39['getTags'](_0x3fb9d7);}})[_0x4b53('0x23')](function(_0x33a448){if(_0x33a448){return _0x33a448?{'count':_0x42df1d,'rows':_0x33a448}:null;}})[_0x4b53('0x23')](respondWithResult(_0x325531,null))['catch'](handleError(_0x325531,null));};exports[_0x4b53('0x4e')]=function(_0x2837b3,_0x5e6b50,_0x4215cf){if(_0x2837b3[_0x4b53('0x48')]['id']){delete _0x2837b3[_0x4b53('0x48')]['id'];}return db[_0x4b53('0x29')]['findOne']({'where':{'id':_0x2837b3[_0x4b53('0x45')]['id']}})[_0x4b53('0x23')](handleEntityNotFound(_0x5e6b50,null))[_0x4b53('0x23')](function(_0x7ab8a8){if(_0x7ab8a8){return _0x7ab8a8[_0x4b53('0x4e')](_0x2837b3[_0x4b53('0x48')]['ids']||[]);}return null;})[_0x4b53('0x23')](respondWithResult(_0x5e6b50,null))['catch'](handleError(_0x5e6b50,null));}; \ No newline at end of file +var _0x29a7=['FreshdeskField','getSubjects','getDescriptions','getTags','Tag','setTags','ids','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/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set','apply','save','update','then','destroy','error','stack','name','send','fieldName','key','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','type','VIRTUAL','merge','options','includeAll','include','FreshdeskConfiguration','findAll','params','rawAttributes','length','find','catch','create','body','getFields','findOne'];(function(_0x4d4b06,_0x26153d){var _0x37dc95=function(_0xee1638){while(--_0xee1638){_0x4d4b06['push'](_0x4d4b06['shift']());}};_0x37dc95(++_0x26153d);}(_0x29a7,0x10c));var _0x729a=function(_0x3ab0c2,_0x3eb25d){_0x3ab0c2=_0x3ab0c2-0x0;var _0x59980f=_0x29a7[_0x3ab0c2];return _0x59980f;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x729a('0x0'));var jsonpatch=require(_0x729a('0x1'));var rp=require(_0x729a('0x2'));var moment=require(_0x729a('0x3'));var BPromise=require(_0x729a('0x4'));var Mustache=require(_0x729a('0x5'));var util=require(_0x729a('0x6'));var path=require(_0x729a('0x7'));var sox=require(_0x729a('0x8'));var csv=require(_0x729a('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x729a('0xa'));var _=require(_0x729a('0xb'));var squel=require(_0x729a('0xc'));var crypto=require(_0x729a('0xd'));var jsforce=require(_0x729a('0xe'));var deskjs=require(_0x729a('0xf'));var toCsv=require(_0x729a('0x9'));var querystring=require(_0x729a('0x10'));var Papa=require(_0x729a('0x11'));var Redis=require(_0x729a('0x12'));var authService=require(_0x729a('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x729a('0x14'));var hardwareService=require(_0x729a('0x15'));var logger=require(_0x729a('0x16'))(_0x729a('0x17'));var utils=require(_0x729a('0x18'));var config=require(_0x729a('0x19'));var licenseUtil=require(_0x729a('0x1a'));var db=require(_0x729a('0x1b'))['db'];function respondWithStatusCode(_0x35445e,_0x459c08){_0x459c08=_0x459c08||0xcc;return function(_0x38244d){if(_0x38244d){return _0x35445e[_0x729a('0x1c')](_0x459c08);}return _0x35445e[_0x729a('0x1d')](_0x459c08)[_0x729a('0x1e')]();};}function respondWithResult(_0x59740,_0x2077c0){_0x2077c0=_0x2077c0||0xc8;return function(_0x441fa9){if(_0x441fa9){return _0x59740[_0x729a('0x1d')](_0x2077c0)[_0x729a('0x1f')](_0x441fa9);}};}function respondWithFilteredResult(_0x2ce9be,_0x26589a){return function(_0x59cd86){if(_0x59cd86){var _0x4b3625=typeof _0x26589a[_0x729a('0x20')]===_0x729a('0x21')&&typeof _0x26589a['limit']===_0x729a('0x21');var _0xbf5da1=_0x59cd86['count'];var _0x5c201e=_0x4b3625?0x0:_0x26589a['offset'];var _0x4489c0=_0x4b3625?_0x59cd86[_0x729a('0x22')]:_0x26589a[_0x729a('0x20')]+_0x26589a['limit'];var _0x5b7efc;if(_0x4489c0>=_0xbf5da1){_0x4489c0=_0xbf5da1;_0x5b7efc=0xc8;}else{_0x5b7efc=0xce;}_0x2ce9be[_0x729a('0x1d')](_0x5b7efc);return _0x2ce9be[_0x729a('0x23')]('Content-Range',_0x5c201e+'-'+_0x4489c0+'/'+_0xbf5da1)[_0x729a('0x1f')](_0x59cd86);}return null;};}function patchUpdates(_0x22aeda){return function(_0x2a0fb1){try{jsonpatch[_0x729a('0x24')](_0x2a0fb1,_0x22aeda,!![]);}catch(_0x32ea03){return BPromise['reject'](_0x32ea03);}return _0x2a0fb1[_0x729a('0x25')]();};}function saveUpdates(_0x57df61,_0x33c642){return function(_0x453790){if(_0x453790){return _0x453790[_0x729a('0x26')](_0x57df61)[_0x729a('0x27')](function(_0x31028f){return _0x31028f;});}return null;};}function removeEntity(_0x15cdcc,_0x1f2a1a){return function(_0x4f6500){if(_0x4f6500){return _0x4f6500[_0x729a('0x28')]()[_0x729a('0x27')](function(){_0x15cdcc[_0x729a('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x21356d,_0x253a2d){return function(_0x5dd0d8){if(!_0x5dd0d8){_0x21356d['sendStatus'](0x194);}return _0x5dd0d8;};}function handleError(_0x1d9297,_0x3656b6){_0x3656b6=_0x3656b6||0x1f4;return function(_0x165f2b){logger[_0x729a('0x29')](_0x165f2b[_0x729a('0x2a')]);if(_0x165f2b[_0x729a('0x2b')]){delete _0x165f2b['name'];}_0x1d9297[_0x729a('0x1d')](_0x3656b6)[_0x729a('0x2c')](_0x165f2b);};}exports['index']=function(_0x443bfb,_0x1265ff){var _0x323249={},_0x5549d2={},_0x574d6e={'count':0x0,'rows':[]};var _0x1ae6db=_['map'](db['FreshdeskConfiguration']['rawAttributes'],function(_0x41919b){return{'name':_0x41919b[_0x729a('0x2d')],'type':_0x41919b['type'][_0x729a('0x2e')]};});_0x5549d2[_0x729a('0x2f')]=_[_0x729a('0x30')](_0x1ae6db,_0x729a('0x2b'));_0x5549d2[_0x729a('0x31')]=_[_0x729a('0x32')](_0x443bfb[_0x729a('0x31')]);_0x5549d2[_0x729a('0x33')]=_[_0x729a('0x34')](_0x5549d2['model'],_0x5549d2[_0x729a('0x31')]);_0x323249[_0x729a('0x35')]=_['intersection'](_0x5549d2[_0x729a('0x2f')],qs[_0x729a('0x36')](_0x443bfb[_0x729a('0x31')]['fields']));_0x323249['attributes']=_0x323249[_0x729a('0x35')]['length']?_0x323249[_0x729a('0x35')]:_0x5549d2[_0x729a('0x2f')];if(!_0x443bfb[_0x729a('0x31')][_0x729a('0x37')](_0x729a('0x38'))){_0x323249[_0x729a('0x39')]=qs[_0x729a('0x39')](_0x443bfb[_0x729a('0x31')]['limit']);_0x323249[_0x729a('0x20')]=qs[_0x729a('0x20')](_0x443bfb[_0x729a('0x31')][_0x729a('0x20')]);}_0x323249[_0x729a('0x3a')]=qs[_0x729a('0x3b')](_0x443bfb[_0x729a('0x31')][_0x729a('0x3b')]);_0x323249[_0x729a('0x3c')]=qs[_0x729a('0x33')](_[_0x729a('0x3d')](_0x443bfb[_0x729a('0x31')],_0x5549d2[_0x729a('0x33')]),_0x1ae6db);if(_0x443bfb[_0x729a('0x31')][_0x729a('0x3e')]){_0x323249['where']=_['merge'](_0x323249[_0x729a('0x3c')],{'$or':_[_0x729a('0x30')](_0x1ae6db,function(_0x351ab6){if(_0x351ab6[_0x729a('0x3f')]!==_0x729a('0x40')){var _0x4e039b={};_0x4e039b[_0x351ab6[_0x729a('0x2b')]]={'$like':'%'+_0x443bfb[_0x729a('0x31')][_0x729a('0x3e')]+'%'};return _0x4e039b;}})});}_0x323249=_[_0x729a('0x41')]({},_0x323249,_0x443bfb[_0x729a('0x42')]);var _0x4c9b8c={'where':_0x323249[_0x729a('0x3c')]};return db['FreshdeskConfiguration'][_0x729a('0x22')](_0x4c9b8c)[_0x729a('0x27')](function(_0x10afb5){_0x574d6e['count']=_0x10afb5;if(_0x443bfb[_0x729a('0x31')][_0x729a('0x43')]){_0x323249[_0x729a('0x44')]=[{'all':!![]}];}return db[_0x729a('0x45')][_0x729a('0x46')](_0x323249);})['then'](function(_0x35a842){_0x574d6e['rows']=_0x35a842;return _0x574d6e;})[_0x729a('0x27')](respondWithFilteredResult(_0x1265ff,_0x323249))['catch'](handleError(_0x1265ff,null));};exports['show']=function(_0x2fd608,_0x8ebe9f){var _0x496d47={'raw':![],'where':{'id':_0x2fd608[_0x729a('0x47')]['id']}},_0x487805={};_0x487805['model']=_['keys'](db[_0x729a('0x45')][_0x729a('0x48')]);_0x487805['query']=_['keys'](_0x2fd608[_0x729a('0x31')]);_0x487805[_0x729a('0x33')]=_[_0x729a('0x34')](_0x487805[_0x729a('0x2f')],_0x487805['query']);_0x496d47[_0x729a('0x35')]=_[_0x729a('0x34')](_0x487805[_0x729a('0x2f')],qs[_0x729a('0x36')](_0x2fd608[_0x729a('0x31')][_0x729a('0x36')]));_0x496d47[_0x729a('0x35')]=_0x496d47[_0x729a('0x35')][_0x729a('0x49')]?_0x496d47[_0x729a('0x35')]:_0x487805[_0x729a('0x2f')];if(_0x2fd608[_0x729a('0x31')]['includeAll']){_0x496d47[_0x729a('0x44')]=[{'all':!![]}];}_0x496d47=_['merge']({},_0x496d47,_0x2fd608[_0x729a('0x42')]);return db[_0x729a('0x45')][_0x729a('0x4a')](_0x496d47)[_0x729a('0x27')](handleEntityNotFound(_0x8ebe9f,null))[_0x729a('0x27')](respondWithResult(_0x8ebe9f,null))[_0x729a('0x4b')](handleError(_0x8ebe9f,null));};exports[_0x729a('0x4c')]=function(_0x2326de,_0x23d09e){return db[_0x729a('0x45')][_0x729a('0x4c')](_0x2326de['body'],{})[_0x729a('0x27')](respondWithResult(_0x23d09e,0xc9))[_0x729a('0x4b')](handleError(_0x23d09e,null));};exports[_0x729a('0x26')]=function(_0x5bc4ef,_0xcce503){if(_0x5bc4ef['body']['id']){delete _0x5bc4ef[_0x729a('0x4d')]['id'];}return db[_0x729a('0x45')]['find']({'where':{'id':_0x5bc4ef[_0x729a('0x47')]['id']}})[_0x729a('0x27')](handleEntityNotFound(_0xcce503,null))['then'](saveUpdates(_0x5bc4ef['body'],null))[_0x729a('0x27')](respondWithResult(_0xcce503,null))['catch'](handleError(_0xcce503,null));};exports[_0x729a('0x28')]=function(_0x205772,_0x3359a4){return db[_0x729a('0x45')][_0x729a('0x4a')]({'where':{'id':_0x205772[_0x729a('0x47')]['id']}})[_0x729a('0x27')](handleEntityNotFound(_0x3359a4,null))['then'](removeEntity(_0x3359a4,null))[_0x729a('0x4b')](handleError(_0x3359a4,null));};exports[_0x729a('0x4e')]=function(_0x19484b,_0x5ea7e5,_0x171504){var _0x219134={};var _0x4336ae={};var _0x5e20a2;var _0x29df7d;return db[_0x729a('0x45')][_0x729a('0x4f')]({'where':{'id':_0x19484b[_0x729a('0x47')]['id']}})[_0x729a('0x27')](handleEntityNotFound(_0x5ea7e5,null))['then'](function(_0x54ae17){if(_0x54ae17){_0x5e20a2=_0x54ae17;_0x4336ae[_0x729a('0x2f')]=_[_0x729a('0x32')](db[_0x729a('0x50')][_0x729a('0x48')]);_0x4336ae[_0x729a('0x31')]=_['keys'](_0x19484b[_0x729a('0x31')]);_0x4336ae[_0x729a('0x33')]=_[_0x729a('0x34')](_0x4336ae[_0x729a('0x2f')],_0x4336ae[_0x729a('0x31')]);_0x219134[_0x729a('0x35')]=_[_0x729a('0x34')](_0x4336ae[_0x729a('0x2f')],qs[_0x729a('0x36')](_0x19484b['query'][_0x729a('0x36')]));_0x219134['attributes']=_0x219134[_0x729a('0x35')][_0x729a('0x49')]?_0x219134['attributes']:_0x4336ae[_0x729a('0x2f')];_0x219134['order']=qs[_0x729a('0x3b')](_0x19484b[_0x729a('0x31')][_0x729a('0x3b')]);_0x219134[_0x729a('0x3c')]=qs[_0x729a('0x33')](_['pick'](_0x19484b[_0x729a('0x31')],_0x4336ae[_0x729a('0x33')]));if(_0x19484b[_0x729a('0x31')][_0x729a('0x3e')]){_0x219134['where']=_['merge'](_0x219134[_0x729a('0x3c')],{'$or':_[_0x729a('0x30')](_0x219134[_0x729a('0x35')],function(_0x1e3366){var _0xd74da={};_0xd74da[_0x1e3366]={'$like':'%'+_0x19484b[_0x729a('0x31')][_0x729a('0x3e')]+'%'};return _0xd74da;})});}_0x219134=_[_0x729a('0x41')]({},_0x219134,_0x19484b[_0x729a('0x42')]);return _0x5e20a2[_0x729a('0x4e')](_0x219134);}})['then'](function(_0x307deb){if(_0x307deb){_0x29df7d=_0x307deb[_0x729a('0x49')];if(!_0x19484b[_0x729a('0x31')][_0x729a('0x37')](_0x729a('0x38'))){_0x219134[_0x729a('0x39')]=qs['limit'](_0x19484b[_0x729a('0x31')]['limit']);_0x219134['offset']=qs[_0x729a('0x20')](_0x19484b[_0x729a('0x31')]['offset']);}return _0x5e20a2[_0x729a('0x4e')](_0x219134);}})[_0x729a('0x27')](function(_0x531727){if(_0x531727){return _0x531727?{'count':_0x29df7d,'rows':_0x531727}:null;}})[_0x729a('0x27')](respondWithResult(_0x5ea7e5,null))[_0x729a('0x4b')](handleError(_0x5ea7e5,null));};exports[_0x729a('0x51')]=function(_0x4ff69a,_0x3d438b,_0x353fb6){var _0x26c251={};var _0x442fab={};var _0x1009e5;var _0x39d247;return db[_0x729a('0x45')][_0x729a('0x4f')]({'where':{'id':_0x4ff69a['params']['id']}})[_0x729a('0x27')](handleEntityNotFound(_0x3d438b,null))[_0x729a('0x27')](function(_0x526ef1){if(_0x526ef1){_0x1009e5=_0x526ef1;_0x442fab[_0x729a('0x2f')]=_['keys'](db['FreshdeskField'][_0x729a('0x48')]);_0x442fab[_0x729a('0x31')]=_['keys'](_0x4ff69a[_0x729a('0x31')]);_0x442fab[_0x729a('0x33')]=_[_0x729a('0x34')](_0x442fab[_0x729a('0x2f')],_0x442fab[_0x729a('0x31')]);_0x26c251[_0x729a('0x35')]=_['intersection'](_0x442fab[_0x729a('0x2f')],qs['fields'](_0x4ff69a[_0x729a('0x31')][_0x729a('0x36')]));_0x26c251['attributes']=_0x26c251['attributes']['length']?_0x26c251[_0x729a('0x35')]:_0x442fab['model'];_0x26c251[_0x729a('0x3a')]=qs['sort'](_0x4ff69a[_0x729a('0x31')][_0x729a('0x3b')]);_0x26c251[_0x729a('0x3c')]=qs[_0x729a('0x33')](_['pick'](_0x4ff69a[_0x729a('0x31')],_0x442fab[_0x729a('0x33')]));if(_0x4ff69a[_0x729a('0x31')][_0x729a('0x3e')]){_0x26c251[_0x729a('0x3c')]=_[_0x729a('0x41')](_0x26c251[_0x729a('0x3c')],{'$or':_[_0x729a('0x30')](_0x26c251[_0x729a('0x35')],function(_0x465537){var _0x4e7a87={};_0x4e7a87[_0x465537]={'$like':'%'+_0x4ff69a[_0x729a('0x31')]['filter']+'%'};return _0x4e7a87;})});}_0x26c251=_['merge']({},_0x26c251,_0x4ff69a[_0x729a('0x42')]);return _0x1009e5[_0x729a('0x51')](_0x26c251);}})['then'](function(_0x5ca6e5){if(_0x5ca6e5){_0x39d247=_0x5ca6e5['length'];if(!_0x4ff69a[_0x729a('0x31')][_0x729a('0x37')](_0x729a('0x38'))){_0x26c251[_0x729a('0x39')]=qs[_0x729a('0x39')](_0x4ff69a[_0x729a('0x31')][_0x729a('0x39')]);_0x26c251['offset']=qs[_0x729a('0x20')](_0x4ff69a['query']['offset']);}return _0x1009e5[_0x729a('0x51')](_0x26c251);}})[_0x729a('0x27')](function(_0x3ebe1f){if(_0x3ebe1f){return _0x3ebe1f?{'count':_0x39d247,'rows':_0x3ebe1f}:null;}})[_0x729a('0x27')](respondWithResult(_0x3d438b,null))[_0x729a('0x4b')](handleError(_0x3d438b,null));};exports['getDescriptions']=function(_0xce1071,_0x4bf8ed,_0x52a853){var _0x50dcd2={};var _0x358429={};var _0x501c05;var _0x27196a;return db['FreshdeskConfiguration'][_0x729a('0x4f')]({'where':{'id':_0xce1071[_0x729a('0x47')]['id']}})[_0x729a('0x27')](handleEntityNotFound(_0x4bf8ed,null))[_0x729a('0x27')](function(_0xc3ebe9){if(_0xc3ebe9){_0x501c05=_0xc3ebe9;_0x358429[_0x729a('0x2f')]=_[_0x729a('0x32')](db[_0x729a('0x50')][_0x729a('0x48')]);_0x358429[_0x729a('0x31')]=_[_0x729a('0x32')](_0xce1071[_0x729a('0x31')]);_0x358429[_0x729a('0x33')]=_[_0x729a('0x34')](_0x358429[_0x729a('0x2f')],_0x358429[_0x729a('0x31')]);_0x50dcd2['attributes']=_['intersection'](_0x358429[_0x729a('0x2f')],qs[_0x729a('0x36')](_0xce1071['query'][_0x729a('0x36')]));_0x50dcd2[_0x729a('0x35')]=_0x50dcd2['attributes'][_0x729a('0x49')]?_0x50dcd2[_0x729a('0x35')]:_0x358429[_0x729a('0x2f')];_0x50dcd2['order']=qs[_0x729a('0x3b')](_0xce1071[_0x729a('0x31')][_0x729a('0x3b')]);_0x50dcd2[_0x729a('0x3c')]=qs[_0x729a('0x33')](_[_0x729a('0x3d')](_0xce1071[_0x729a('0x31')],_0x358429['filters']));if(_0xce1071['query'][_0x729a('0x3e')]){_0x50dcd2[_0x729a('0x3c')]=_[_0x729a('0x41')](_0x50dcd2[_0x729a('0x3c')],{'$or':_[_0x729a('0x30')](_0x50dcd2[_0x729a('0x35')],function(_0x36fb9d){var _0x441b18={};_0x441b18[_0x36fb9d]={'$like':'%'+_0xce1071[_0x729a('0x31')][_0x729a('0x3e')]+'%'};return _0x441b18;})});}_0x50dcd2=_[_0x729a('0x41')]({},_0x50dcd2,_0xce1071['options']);return _0x501c05[_0x729a('0x52')](_0x50dcd2);}})['then'](function(_0x1d7796){if(_0x1d7796){_0x27196a=_0x1d7796[_0x729a('0x49')];if(!_0xce1071['query'][_0x729a('0x37')](_0x729a('0x38'))){_0x50dcd2['limit']=qs[_0x729a('0x39')](_0xce1071[_0x729a('0x31')]['limit']);_0x50dcd2[_0x729a('0x20')]=qs[_0x729a('0x20')](_0xce1071[_0x729a('0x31')]['offset']);}return _0x501c05['getDescriptions'](_0x50dcd2);}})[_0x729a('0x27')](function(_0x48f001){if(_0x48f001){return _0x48f001?{'count':_0x27196a,'rows':_0x48f001}:null;}})[_0x729a('0x27')](respondWithResult(_0x4bf8ed,null))[_0x729a('0x4b')](handleError(_0x4bf8ed,null));};exports[_0x729a('0x53')]=function(_0x14b7f1,_0x52777e,_0x2ed8f1){var _0x179ab0={};var _0xfb83b4={};var _0x263c2a;var _0x54d4d5;return db[_0x729a('0x45')][_0x729a('0x4f')]({'where':{'id':_0x14b7f1[_0x729a('0x47')]['id']}})[_0x729a('0x27')](handleEntityNotFound(_0x52777e,null))[_0x729a('0x27')](function(_0x50c0e9){if(_0x50c0e9){_0x263c2a=_0x50c0e9;_0xfb83b4[_0x729a('0x2f')]=_[_0x729a('0x32')](db[_0x729a('0x54')]['rawAttributes']);_0xfb83b4['query']=_[_0x729a('0x32')](_0x14b7f1[_0x729a('0x31')]);_0xfb83b4[_0x729a('0x33')]=_[_0x729a('0x34')](_0xfb83b4[_0x729a('0x2f')],_0xfb83b4[_0x729a('0x31')]);_0x179ab0['attributes']=_['intersection'](_0xfb83b4[_0x729a('0x2f')],qs[_0x729a('0x36')](_0x14b7f1[_0x729a('0x31')][_0x729a('0x36')]));_0x179ab0[_0x729a('0x35')]=_0x179ab0[_0x729a('0x35')][_0x729a('0x49')]?_0x179ab0[_0x729a('0x35')]:_0xfb83b4[_0x729a('0x2f')];_0x179ab0['order']=qs[_0x729a('0x3b')](_0x14b7f1[_0x729a('0x31')][_0x729a('0x3b')]);_0x179ab0[_0x729a('0x3c')]=qs[_0x729a('0x33')](_[_0x729a('0x3d')](_0x14b7f1[_0x729a('0x31')],_0xfb83b4[_0x729a('0x33')]));if(_0x14b7f1['query']['filter']){_0x179ab0[_0x729a('0x3c')]=_[_0x729a('0x41')](_0x179ab0[_0x729a('0x3c')],{'$or':_[_0x729a('0x30')](_0x179ab0['attributes'],function(_0x5b1326){var _0x1d3810={};_0x1d3810[_0x5b1326]={'$like':'%'+_0x14b7f1[_0x729a('0x31')][_0x729a('0x3e')]+'%'};return _0x1d3810;})});}_0x179ab0=_[_0x729a('0x41')]({},_0x179ab0,_0x14b7f1[_0x729a('0x42')]);return _0x263c2a[_0x729a('0x53')](_0x179ab0);}})[_0x729a('0x27')](function(_0x3cea9f){if(_0x3cea9f){_0x54d4d5=_0x3cea9f[_0x729a('0x49')];if(!_0x14b7f1[_0x729a('0x31')][_0x729a('0x37')](_0x729a('0x38'))){_0x179ab0['limit']=qs[_0x729a('0x39')](_0x14b7f1[_0x729a('0x31')][_0x729a('0x39')]);_0x179ab0[_0x729a('0x20')]=qs[_0x729a('0x20')](_0x14b7f1[_0x729a('0x31')]['offset']);}return _0x263c2a[_0x729a('0x53')](_0x179ab0);}})[_0x729a('0x27')](function(_0xa0ea47){if(_0xa0ea47){return _0xa0ea47?{'count':_0x54d4d5,'rows':_0xa0ea47}:null;}})[_0x729a('0x27')](respondWithResult(_0x52777e,null))[_0x729a('0x4b')](handleError(_0x52777e,null));};exports[_0x729a('0x55')]=function(_0x1e4112,_0x3ce182,_0x5da941){if(_0x1e4112[_0x729a('0x4d')]['id']){delete _0x1e4112[_0x729a('0x4d')]['id'];}return db['FreshdeskConfiguration'][_0x729a('0x4f')]({'where':{'id':_0x1e4112[_0x729a('0x47')]['id']}})['then'](handleEntityNotFound(_0x3ce182,null))[_0x729a('0x27')](function(_0x3f2278){if(_0x3f2278){return _0x3f2278['setTags'](_0x1e4112[_0x729a('0x4d')][_0x729a('0x56')]||[]);}return null;})['then'](respondWithResult(_0x3ce182,null))['catch'](handleError(_0x3ce182,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js index d46cb2d..fb5967f 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 _0xd3a7=['define','FreshdeskConfiguration','int_freshdesk_configurations','lodash','util','../../config/logger','api','moment','bluebird','path','../../config/environment','./intFreshdeskConfiguration.attributes','exports'];(function(_0x114099,_0x11c1b4){var _0x3ccb0d=function(_0xe935b4){while(--_0xe935b4){_0x114099['push'](_0x114099['shift']());}};_0x3ccb0d(++_0x11c1b4);}(_0xd3a7,0xfa));var _0x7d3a=function(_0x507f1d,_0x42ad2c){_0x507f1d=_0x507f1d-0x0;var _0xffc2=_0xd3a7[_0x507f1d];return _0xffc2;};'use strict';var _=require(_0x7d3a('0x0'));var util=require(_0x7d3a('0x1'));var logger=require(_0x7d3a('0x2'))(_0x7d3a('0x3'));var moment=require(_0x7d3a('0x4'));var BPromise=require(_0x7d3a('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7d3a('0x6'));var rimraf=require('rimraf');var config=require(_0x7d3a('0x7'));var attributes=require(_0x7d3a('0x8'));module[_0x7d3a('0x9')]=function(_0x461c38,_0x54857d){return _0x461c38[_0x7d3a('0xa')](_0x7d3a('0xb'),attributes,{'tableName':_0x7d3a('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc45e=['FreshdeskConfiguration','int_freshdesk_configurations','lodash','util','api','moment','bluebird','request-promise','path','../../config/environment','./intFreshdeskConfiguration.attributes','exports'];(function(_0x300bf2,_0x4fe6d7){var _0x3db2a5=function(_0x13a69f){while(--_0x13a69f){_0x300bf2['push'](_0x300bf2['shift']());}};_0x3db2a5(++_0x4fe6d7);}(_0xc45e,0x19a));var _0xec45=function(_0x302b5e,_0x564a8e){_0x302b5e=_0x302b5e-0x0;var _0x523ab7=_0xc45e[_0x302b5e];return _0x523ab7;};'use strict';var _=require(_0xec45('0x0'));var util=require(_0xec45('0x1'));var logger=require('../../config/logger')(_0xec45('0x2'));var moment=require(_0xec45('0x3'));var BPromise=require(_0xec45('0x4'));var rp=require(_0xec45('0x5'));var fs=require('fs');var path=require(_0xec45('0x6'));var rimraf=require('rimraf');var config=require(_0xec45('0x7'));var attributes=require(_0xec45('0x8'));module[_0xec45('0x9')]=function(_0x508295,_0x381e52){return _0x508295['define'](_0xec45('0xa'),attributes,{'tableName':_0xec45('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 b4fbafc..e73f34e 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 _0x2283=['request\x20sent','debug','stringify','error','code','FreshdeskConfiguration,\x20%s,\x20%s','message','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','info'];(function(_0x20ca06,_0x4cc9f3){var _0x270a6b=function(_0x5b8642){while(--_0x5b8642){_0x20ca06['push'](_0x20ca06['shift']());}};_0x270a6b(++_0x4cc9f3);}(_0x2283,0x12e));var _0x3228=function(_0x293afb,_0x3559a7){_0x293afb=_0x293afb-0x0;var _0x1dbd5a=_0x2283[_0x293afb];return _0x1dbd5a;};'use strict';var _=require(_0x3228('0x0'));var util=require(_0x3228('0x1'));var moment=require('moment');var BPromise=require(_0x3228('0x2'));var rs=require(_0x3228('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3228('0x4'))['db'];var utils=require(_0x3228('0x5'));var logger=require(_0x3228('0x6'))(_0x3228('0x7'));var config=require(_0x3228('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x3228('0x9')][_0x3228('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1b3a75,_0x5f1015,_0x3a80db){return new BPromise(function(_0x1aa697,_0x153bb4){return client['request'](_0x1b3a75,_0x3a80db)[_0x3228('0xb')](function(_0x57cbe1){logger[_0x3228('0xc')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x5f1015,_0x3228('0xd'));logger[_0x3228('0xe')]('FreshdeskConfiguration,\x20%s,\x20%s,\x20%s',_0x5f1015,_0x3228('0xd'),JSON[_0x3228('0xf')](_0x57cbe1));if(_0x57cbe1[_0x3228('0x10')]){if(_0x57cbe1['error'][_0x3228('0x11')]===0x1f4){logger[_0x3228('0x10')](_0x3228('0x12'),_0x5f1015,_0x57cbe1[_0x3228('0x10')]['message']);return _0x153bb4(_0x57cbe1['error'][_0x3228('0x13')]);}logger[_0x3228('0x10')](_0x3228('0x12'),_0x5f1015,_0x57cbe1[_0x3228('0x10')][_0x3228('0x13')]);return _0x1aa697(_0x57cbe1[_0x3228('0x10')][_0x3228('0x13')]);}else{logger['info'](_0x3228('0x12'),_0x5f1015,_0x3228('0xd'));_0x1aa697(_0x57cbe1['result'][_0x3228('0x13')]);}})[_0x3228('0x14')](function(_0x5b18d6){logger[_0x3228('0x10')](_0x3228('0x12'),_0x5f1015,_0x5b18d6);_0x153bb4(_0x5b18d6);});});} \ No newline at end of file +var _0xd4c5=['code','message','result','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','then','info','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x173441,_0x26b0d9){var _0x2423a8=function(_0x4d96c2){while(--_0x4d96c2){_0x173441['push'](_0x173441['shift']());}};_0x2423a8(++_0x26b0d9);}(_0xd4c5,0x192));var _0x5d4c=function(_0x5c0f29,_0x3d88d3){_0x5c0f29=_0x5c0f29-0x0;var _0x4bbfeb=_0xd4c5[_0x5c0f29];return _0x4bbfeb;};'use strict';var _=require('lodash');var util=require(_0x5d4c('0x0'));var moment=require('moment');var BPromise=require(_0x5d4c('0x1'));var rs=require(_0x5d4c('0x2'));var fs=require('fs');var Redis=require(_0x5d4c('0x3'));var db=require(_0x5d4c('0x4'))['db'];var utils=require(_0x5d4c('0x5'));var logger=require(_0x5d4c('0x6'))('rpc');var config=require(_0x5d4c('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x5d4c('0x8')][_0x5d4c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x6c019c,_0x1060a1,_0x216f70){return new BPromise(function(_0x1d3ef9,_0x3f9558){return client['request'](_0x6c019c,_0x216f70)[_0x5d4c('0xa')](function(_0x4e56f1){logger[_0x5d4c('0xb')](_0x5d4c('0xc'),_0x1060a1,_0x5d4c('0xd'));logger[_0x5d4c('0xe')](_0x5d4c('0xf'),_0x1060a1,'request\x20sent',JSON[_0x5d4c('0x10')](_0x4e56f1));if(_0x4e56f1[_0x5d4c('0x11')]){if(_0x4e56f1[_0x5d4c('0x11')][_0x5d4c('0x12')]===0x1f4){logger['error']('FreshdeskConfiguration,\x20%s,\x20%s',_0x1060a1,_0x4e56f1['error'][_0x5d4c('0x13')]);return _0x3f9558(_0x4e56f1[_0x5d4c('0x11')][_0x5d4c('0x13')]);}logger[_0x5d4c('0x11')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x1060a1,_0x4e56f1[_0x5d4c('0x11')]['message']);return _0x1d3ef9(_0x4e56f1[_0x5d4c('0x11')][_0x5d4c('0x13')]);}else{logger[_0x5d4c('0xb')](_0x5d4c('0xc'),_0x1060a1,'request\x20sent');_0x1d3ef9(_0x4e56f1[_0x5d4c('0x14')][_0x5d4c('0x13')]);}})['catch'](function(_0x4f76e2){logger[_0x5d4c('0x11')](_0x5d4c('0xc'),_0x1060a1,_0x4f76e2);_0x3f9558(_0x4f76e2);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskField/index.js b/server/api/intFreshdeskField/index.js index 91b9065..b48328f 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 _0x24c9=['update','delete','exports','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','isAuthenticated','index','get','show','post','create','/:id'];(function(_0x35fd15,_0x3543a8){var _0x4aa1c8=function(_0x2ebac5){while(--_0x2ebac5){_0x35fd15['push'](_0x35fd15['shift']());}};_0x4aa1c8(++_0x3543a8);}(_0x24c9,0x1b6));var _0x924c=function(_0x3bfbc9,_0x293f9b){_0x3bfbc9=_0x3bfbc9-0x0;var _0x3f3d8d=_0x24c9[_0x3bfbc9];return _0x3f3d8d;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x924c('0x0'));var express=require(_0x924c('0x1'));var router=express['Router']();var fs_extra=require(_0x924c('0x2'));var auth=require(_0x924c('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x924c('0x4'));var controller=require('./intFreshdeskField.controller');router['get']('/',auth[_0x924c('0x5')](),controller[_0x924c('0x6')]);router[_0x924c('0x7')]('/:id',auth['isAuthenticated'](),controller[_0x924c('0x8')]);router[_0x924c('0x9')]('/',auth[_0x924c('0x5')](),controller[_0x924c('0xa')]);router['put'](_0x924c('0xb'),auth['isAuthenticated'](),controller[_0x924c('0xc')]);router[_0x924c('0xd')](_0x924c('0xb'),auth[_0x924c('0x5')](),controller['destroy']);module[_0x924c('0xe')]=router; \ No newline at end of file +var _0xc8ca=['get','isAuthenticated','index','/:id','post','create','put','update','destroy','exports','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskField.controller'];(function(_0x3e368f,_0x118354){var _0x5d7cd3=function(_0x355283){while(--_0x355283){_0x3e368f['push'](_0x3e368f['shift']());}};_0x5d7cd3(++_0x118354);}(_0xc8ca,0x160));var _0xac8c=function(_0x21b814,_0x29959c){_0x21b814=_0x21b814-0x0;var _0x4efbbe=_0xc8ca[_0x21b814];return _0x4efbbe;};'use strict';var multer=require(_0xac8c('0x0'));var util=require(_0xac8c('0x1'));var path=require('path');var timeout=require(_0xac8c('0x2'));var express=require('express');var router=express[_0xac8c('0x3')]();var fs_extra=require(_0xac8c('0x4'));var auth=require(_0xac8c('0x5'));var interaction=require(_0xac8c('0x6'));var config=require(_0xac8c('0x7'));var controller=require(_0xac8c('0x8'));router[_0xac8c('0x9')]('/',auth[_0xac8c('0xa')](),controller[_0xac8c('0xb')]);router[_0xac8c('0x9')](_0xac8c('0xc'),auth['isAuthenticated'](),controller['show']);router[_0xac8c('0xd')]('/',auth[_0xac8c('0xa')](),controller[_0xac8c('0xe')]);router[_0xac8c('0xf')]('/:id',auth[_0xac8c('0xa')](),controller[_0xac8c('0x10')]);router['delete'](_0xac8c('0xc'),auth[_0xac8c('0xa')](),controller[_0xac8c('0x11')]);module[_0xac8c('0x12')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.attributes.js b/server/api/intFreshdeskField/intFreshdeskField.attributes.js index 04b9104..4f64b81 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 _0x4af8=['exports','ENUM','string','variable','customVariable','keyValue','STRING','BOOLEAN','sequelize'];(function(_0x1a794d,_0xbd9a41){var _0x1b3887=function(_0x2133f5){while(--_0x2133f5){_0x1a794d['push'](_0x1a794d['shift']());}};_0x1b3887(++_0xbd9a41);}(_0x4af8,0x15e));var _0x84af=function(_0xc6be3a,_0x540e05){_0xc6be3a=_0xc6be3a-0x0;var _0x56a310=_0x4af8[_0xc6be3a];return _0x56a310;};'use strict';var Sequelize=require(_0x84af('0x0'));module[_0x84af('0x1')]={'type':{'type':Sequelize[_0x84af('0x2')](_0x84af('0x3'),_0x84af('0x4'),_0x84af('0x5'),_0x84af('0x6'),'picklist'),'defaultValue':_0x84af('0x3')},'content':{'type':Sequelize[_0x84af('0x7')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x84af('0x2')](_0x84af('0x3'),_0x84af('0x4'),_0x84af('0x5'))},'keyContent':{'type':Sequelize[_0x84af('0x7')]},'idField':{'type':Sequelize[_0x84af('0x7')]},'nameField':{'type':Sequelize[_0x84af('0x7')]},'customField':{'type':Sequelize[_0x84af('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x84af('0x7')]}}; \ No newline at end of file +var _0x0357=['string','variable','customVariable','keyValue','picklist','STRING','ENUM','BOOLEAN'];(function(_0x299984,_0x383734){var _0xae48c9=function(_0x836ac6){while(--_0x836ac6){_0x299984['push'](_0x299984['shift']());}};_0xae48c9(++_0x383734);}(_0x0357,0x118));var _0x7035=function(_0x4462fe,_0x1f3849){_0x4462fe=_0x4462fe-0x0;var _0x3089db=_0x0357[_0x4462fe];return _0x3089db;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize['ENUM'](_0x7035('0x0'),_0x7035('0x1'),_0x7035('0x2'),_0x7035('0x3'),_0x7035('0x4')),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x7035('0x5')]},'keyType':{'type':Sequelize[_0x7035('0x6')](_0x7035('0x0'),_0x7035('0x1'),_0x7035('0x2'))},'keyContent':{'type':Sequelize[_0x7035('0x5')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x7035('0x5')]},'customField':{'type':Sequelize[_0x7035('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x7035('0x5')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.controller.js b/server/api/intFreshdeskField/intFreshdeskField.controller.js index 02d70d4..9e11b89 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 _0xcea2=['undefined','limit','count','Content-Range','apply','reject','save','then','destroy','sendStatus','error','stack','name','send','map','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','nolimit','order','sort','pick','VIRTUAL','filter','merge','options','where','FreshdeskField','includeAll','include','findAll','rows','catch','params','length','find','create','body','update','eml-format','zip-dir','request-promise','moment','bluebird','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','status','end','json','offset'];(function(_0x2cf50a,_0x5c1378){var _0x436f8d=function(_0x28df68){while(--_0x28df68){_0x2cf50a['push'](_0x2cf50a['shift']());}};_0x436f8d(++_0x5c1378);}(_0xcea2,0x15a));var _0x2cea=function(_0x411017,_0x4a8117){_0x411017=_0x411017-0x0;var _0x2adeea=_0xcea2[_0x411017];return _0x2adeea;};'use strict';var emlformat=require(_0x2cea('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x2cea('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2cea('0x2'));var moment=require(_0x2cea('0x3'));var BPromise=require(_0x2cea('0x4'));var Mustache=require('mustache');var util=require(_0x2cea('0x5'));var path=require(_0x2cea('0x6'));var sox=require(_0x2cea('0x7'));var csv=require('to-csv');var ejs=require(_0x2cea('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2cea('0x9'));var squel=require(_0x2cea('0xa'));var crypto=require(_0x2cea('0xb'));var jsforce=require(_0x2cea('0xc'));var deskjs=require(_0x2cea('0xd'));var toCsv=require(_0x2cea('0xe'));var querystring=require('querystring');var Papa=require(_0x2cea('0xf'));var Redis=require(_0x2cea('0x10'));var authService=require(_0x2cea('0x11'));var qs=require(_0x2cea('0x12'));var as=require(_0x2cea('0x13'));var hardwareService=require(_0x2cea('0x14'));var logger=require(_0x2cea('0x15'))(_0x2cea('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x2cea('0x17'));var db=require(_0x2cea('0x18'))['db'];function respondWithStatusCode(_0x528c1d,_0x4bd265){_0x4bd265=_0x4bd265||0xcc;return function(_0x160eaf){if(_0x160eaf){return _0x528c1d['sendStatus'](_0x4bd265);}return _0x528c1d[_0x2cea('0x19')](_0x4bd265)[_0x2cea('0x1a')]();};}function respondWithResult(_0x4377b1,_0x5cf805){_0x5cf805=_0x5cf805||0xc8;return function(_0x4d7f8b){if(_0x4d7f8b){return _0x4377b1['status'](_0x5cf805)[_0x2cea('0x1b')](_0x4d7f8b);}};}function respondWithFilteredResult(_0x586ad5,_0x3c7130){return function(_0x338669){if(_0x338669){var _0x981e3f=typeof _0x3c7130[_0x2cea('0x1c')]===_0x2cea('0x1d')&&typeof _0x3c7130[_0x2cea('0x1e')]===_0x2cea('0x1d');var _0x1ead4c=_0x338669['count'];var _0x19927a=_0x981e3f?0x0:_0x3c7130[_0x2cea('0x1c')];var _0x20c46c=_0x981e3f?_0x338669[_0x2cea('0x1f')]:_0x3c7130[_0x2cea('0x1c')]+_0x3c7130[_0x2cea('0x1e')];var _0x5d75c4;if(_0x20c46c>=_0x1ead4c){_0x20c46c=_0x1ead4c;_0x5d75c4=0xc8;}else{_0x5d75c4=0xce;}_0x586ad5[_0x2cea('0x19')](_0x5d75c4);return _0x586ad5['set'](_0x2cea('0x20'),_0x19927a+'-'+_0x20c46c+'/'+_0x1ead4c)[_0x2cea('0x1b')](_0x338669);}return null;};}function patchUpdates(_0xa73bea){return function(_0x4fd3d5){try{jsonpatch[_0x2cea('0x21')](_0x4fd3d5,_0xa73bea,!![]);}catch(_0x22249e){return BPromise[_0x2cea('0x22')](_0x22249e);}return _0x4fd3d5[_0x2cea('0x23')]();};}function saveUpdates(_0x3246bc,_0x3f6f0e){return function(_0x10f13a){if(_0x10f13a){return _0x10f13a['update'](_0x3246bc)[_0x2cea('0x24')](function(_0x5e5b46){return _0x5e5b46;});}return null;};}function removeEntity(_0x7d88b9,_0x4926ff){return function(_0x3966d5){if(_0x3966d5){return _0x3966d5[_0x2cea('0x25')]()['then'](function(){_0x7d88b9[_0x2cea('0x19')](0xcc)[_0x2cea('0x1a')]();});}};}function handleEntityNotFound(_0x101314,_0xf0bfbe){return function(_0x3f3ee0){if(!_0x3f3ee0){_0x101314[_0x2cea('0x26')](0x194);}return _0x3f3ee0;};}function handleError(_0x5d032f,_0x4ec9b3){_0x4ec9b3=_0x4ec9b3||0x1f4;return function(_0x32b6a3){logger[_0x2cea('0x27')](_0x32b6a3[_0x2cea('0x28')]);if(_0x32b6a3[_0x2cea('0x29')]){delete _0x32b6a3[_0x2cea('0x29')];}_0x5d032f[_0x2cea('0x19')](_0x4ec9b3)[_0x2cea('0x2a')](_0x32b6a3);};}exports['index']=function(_0xff69ad,_0x128863){var _0x5f3fb4={},_0xfeb8bd={},_0xc398c5={'count':0x0,'rows':[]};var _0x271b2f=_[_0x2cea('0x2b')](db['FreshdeskField'][_0x2cea('0x2c')],function(_0x128934){return{'name':_0x128934['fieldName'],'type':_0x128934[_0x2cea('0x2d')][_0x2cea('0x2e')]};});_0xfeb8bd[_0x2cea('0x2f')]=_[_0x2cea('0x2b')](_0x271b2f,_0x2cea('0x29'));_0xfeb8bd[_0x2cea('0x30')]=_[_0x2cea('0x31')](_0xff69ad[_0x2cea('0x30')]);_0xfeb8bd[_0x2cea('0x32')]=_[_0x2cea('0x33')](_0xfeb8bd[_0x2cea('0x2f')],_0xfeb8bd['query']);_0x5f3fb4[_0x2cea('0x34')]=_[_0x2cea('0x33')](_0xfeb8bd[_0x2cea('0x2f')],qs[_0x2cea('0x35')](_0xff69ad['query']['fields']));_0x5f3fb4[_0x2cea('0x34')]=_0x5f3fb4[_0x2cea('0x34')]['length']?_0x5f3fb4[_0x2cea('0x34')]:_0xfeb8bd['model'];if(!_0xff69ad[_0x2cea('0x30')]['hasOwnProperty'](_0x2cea('0x36'))){_0x5f3fb4['limit']=qs[_0x2cea('0x1e')](_0xff69ad[_0x2cea('0x30')]['limit']);_0x5f3fb4[_0x2cea('0x1c')]=qs[_0x2cea('0x1c')](_0xff69ad['query'][_0x2cea('0x1c')]);}_0x5f3fb4[_0x2cea('0x37')]=qs[_0x2cea('0x38')](_0xff69ad[_0x2cea('0x30')][_0x2cea('0x38')]);_0x5f3fb4['where']=qs[_0x2cea('0x32')](_[_0x2cea('0x39')](_0xff69ad['query'],_0xfeb8bd['filters']),_0x271b2f);if(_0xff69ad[_0x2cea('0x30')]['filter']){_0x5f3fb4['where']=_['merge'](_0x5f3fb4['where'],{'$or':_[_0x2cea('0x2b')](_0x271b2f,function(_0xb5b358){if(_0xb5b358['type']!==_0x2cea('0x3a')){var _0x3e0683={};_0x3e0683[_0xb5b358[_0x2cea('0x29')]]={'$like':'%'+_0xff69ad['query'][_0x2cea('0x3b')]+'%'};return _0x3e0683;}})});}_0x5f3fb4=_[_0x2cea('0x3c')]({},_0x5f3fb4,_0xff69ad[_0x2cea('0x3d')]);var _0x37d175={'where':_0x5f3fb4[_0x2cea('0x3e')]};return db[_0x2cea('0x3f')][_0x2cea('0x1f')](_0x37d175)[_0x2cea('0x24')](function(_0x2cfa0e){_0xc398c5[_0x2cea('0x1f')]=_0x2cfa0e;if(_0xff69ad[_0x2cea('0x30')][_0x2cea('0x40')]){_0x5f3fb4[_0x2cea('0x41')]=[{'all':!![]}];}return db[_0x2cea('0x3f')][_0x2cea('0x42')](_0x5f3fb4);})[_0x2cea('0x24')](function(_0x36efa8){_0xc398c5[_0x2cea('0x43')]=_0x36efa8;return _0xc398c5;})['then'](respondWithFilteredResult(_0x128863,_0x5f3fb4))[_0x2cea('0x44')](handleError(_0x128863,null));};exports['show']=function(_0x29ab58,_0x1afbb9){var _0x22ce6b={'raw':!![],'where':{'id':_0x29ab58[_0x2cea('0x45')]['id']}},_0x5b5d71={};_0x5b5d71[_0x2cea('0x2f')]=_[_0x2cea('0x31')](db[_0x2cea('0x3f')][_0x2cea('0x2c')]);_0x5b5d71[_0x2cea('0x30')]=_['keys'](_0x29ab58['query']);_0x5b5d71[_0x2cea('0x32')]=_[_0x2cea('0x33')](_0x5b5d71['model'],_0x5b5d71[_0x2cea('0x30')]);_0x22ce6b['attributes']=_[_0x2cea('0x33')](_0x5b5d71['model'],qs[_0x2cea('0x35')](_0x29ab58[_0x2cea('0x30')][_0x2cea('0x35')]));_0x22ce6b[_0x2cea('0x34')]=_0x22ce6b[_0x2cea('0x34')][_0x2cea('0x46')]?_0x22ce6b[_0x2cea('0x34')]:_0x5b5d71[_0x2cea('0x2f')];if(_0x29ab58[_0x2cea('0x30')][_0x2cea('0x40')]){_0x22ce6b['include']=[{'all':!![]}];}_0x22ce6b=_[_0x2cea('0x3c')]({},_0x22ce6b,_0x29ab58[_0x2cea('0x3d')]);return db[_0x2cea('0x3f')][_0x2cea('0x47')](_0x22ce6b)['then'](handleEntityNotFound(_0x1afbb9,null))['then'](respondWithResult(_0x1afbb9,null))[_0x2cea('0x44')](handleError(_0x1afbb9,null));};exports[_0x2cea('0x48')]=function(_0xd922c6,_0x510e0f){return db[_0x2cea('0x3f')][_0x2cea('0x48')](_0xd922c6[_0x2cea('0x49')],{})[_0x2cea('0x24')](respondWithResult(_0x510e0f,0xc9))['catch'](handleError(_0x510e0f,null));};exports[_0x2cea('0x4a')]=function(_0x526e92,_0x4d1b77){if(_0x526e92[_0x2cea('0x49')]['id']){delete _0x526e92[_0x2cea('0x49')]['id'];}return db[_0x2cea('0x3f')][_0x2cea('0x47')]({'where':{'id':_0x526e92['params']['id']}})['then'](handleEntityNotFound(_0x4d1b77,null))[_0x2cea('0x24')](saveUpdates(_0x526e92[_0x2cea('0x49')],null))[_0x2cea('0x24')](respondWithResult(_0x4d1b77,null))[_0x2cea('0x44')](handleError(_0x4d1b77,null));};exports['destroy']=function(_0x4ec462,_0x5d7cb6){return db[_0x2cea('0x3f')][_0x2cea('0x47')]({'where':{'id':_0x4ec462[_0x2cea('0x45')]['id']}})[_0x2cea('0x24')](handleEntityNotFound(_0x5d7cb6,null))[_0x2cea('0x24')](removeEntity(_0x5d7cb6,null))[_0x2cea('0x44')](handleError(_0x5d7cb6,null));}; \ No newline at end of file +var _0xa9e0=['nolimit','sort','where','filter','merge','type','options','includeAll','include','findAll','catch','show','params','find','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','index','FreshdeskField','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty'];(function(_0x212f01,_0x56c74f){var _0x196389=function(_0x435afb){while(--_0x435afb){_0x212f01['push'](_0x212f01['shift']());}};_0x196389(++_0x56c74f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x34bc30,_0x177cb0){_0x34bc30=_0x34bc30-0x0;var _0x5706de=_0xa9e0[_0x34bc30];return _0x5706de;};'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['FreshdeskField'][_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));}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.model.js b/server/api/intFreshdeskField/intFreshdeskField.model.js index d590dec..b75181a 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 _0x0140=['../../config/logger','api','bluebird','rimraf','../../config/environment','exports','define','idField','lodash','util'];(function(_0xc4df1,_0x4851a3){var _0x1867d1=function(_0x37f5b4){while(--_0x37f5b4){_0xc4df1['push'](_0xc4df1['shift']());}};_0x1867d1(++_0x4851a3);}(_0x0140,0x148));var _0x0014=function(_0x58e469,_0x95ee3e){_0x58e469=_0x58e469-0x0;var _0x4c01c5=_0x0140[_0x58e469];return _0x4c01c5;};'use strict';var _=require(_0x0014('0x0'));var util=require(_0x0014('0x1'));var logger=require(_0x0014('0x2'))(_0x0014('0x3'));var moment=require('moment');var BPromise=require(_0x0014('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x0014('0x5'));var config=require(_0x0014('0x6'));var attributes=require('./intFreshdeskField.attributes');module[_0x0014('0x7')]=function(_0x1e4548,_0x5d69ef){return _0x1e4548[_0x0014('0x8')]('FreshdeskField',attributes,{'tableName':'int_freshdesk_fields','paranoid':![],'indexes':[{'name':'freshdesk_unique_index','fields':[_0x0014('0x9'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xf0cc=['path','./intFreshdeskField.attributes','exports','define','FreshdeskField','int_freshdesk_fields','FieldId','lodash','api','request-promise'];(function(_0x4e936b,_0x193d71){var _0xda6dd6=function(_0x465be7){while(--_0x465be7){_0x4e936b['push'](_0x4e936b['shift']());}};_0xda6dd6(++_0x193d71);}(_0xf0cc,0xa7));var _0xcf0c=function(_0x4581f6,_0x1943fd){_0x4581f6=_0x4581f6-0x0;var _0x448611=_0xf0cc[_0x4581f6];return _0x448611;};'use strict';var _=require(_0xcf0c('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xcf0c('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xcf0c('0x2'));var fs=require('fs');var path=require(_0xcf0c('0x3'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xcf0c('0x4'));module[_0xcf0c('0x5')]=function(_0x1a6003,_0x497363){return _0x1a6003[_0xcf0c('0x6')](_0xcf0c('0x7'),attributes,{'tableName':_0xcf0c('0x8'),'paranoid':![],'indexes':[{'name':'freshdesk_unique_index','fields':['idField',_0xcf0c('0x9')],'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 836b724..b2ec4a2 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 _0x11d7=['rpc','jayson/promise','client','then','info','FreshdeskField,\x20%s,\x20%s','debug','error','code','message','request\x20sent','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0x12bcf7,_0xc11103){var _0x2825a=function(_0x4452ba){while(--_0x4452ba){_0x12bcf7['push'](_0x12bcf7['shift']());}};_0x2825a(++_0xc11103);}(_0x11d7,0x161));var _0x711d=function(_0x206711,_0x4125b4){_0x206711=_0x206711-0x0;var _0x4fe02b=_0x11d7[_0x206711];return _0x4fe02b;};'use strict';var _=require(_0x711d('0x0'));var util=require(_0x711d('0x1'));var moment=require(_0x711d('0x2'));var BPromise=require(_0x711d('0x3'));var rs=require(_0x711d('0x4'));var fs=require('fs');var Redis=require(_0x711d('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x711d('0x6'));var logger=require(_0x711d('0x7'))(_0x711d('0x8'));var config=require('../../config/environment');var jayson=require(_0x711d('0x9'));var client=jayson[_0x711d('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4c4a1a,_0xdfa997,_0x500b70){return new BPromise(function(_0x5c5679,_0x1da7e0){return client['request'](_0x4c4a1a,_0x500b70)[_0x711d('0xb')](function(_0xd4f1a1){logger[_0x711d('0xc')](_0x711d('0xd'),_0xdfa997,'request\x20sent');logger[_0x711d('0xe')]('FreshdeskField,\x20%s,\x20%s,\x20%s',_0xdfa997,'request\x20sent',JSON['stringify'](_0xd4f1a1));if(_0xd4f1a1['error']){if(_0xd4f1a1[_0x711d('0xf')][_0x711d('0x10')]===0x1f4){logger[_0x711d('0xf')](_0x711d('0xd'),_0xdfa997,_0xd4f1a1['error'][_0x711d('0x11')]);return _0x1da7e0(_0xd4f1a1[_0x711d('0xf')][_0x711d('0x11')]);}logger[_0x711d('0xf')](_0x711d('0xd'),_0xdfa997,_0xd4f1a1[_0x711d('0xf')][_0x711d('0x11')]);return _0x5c5679(_0xd4f1a1[_0x711d('0xf')][_0x711d('0x11')]);}else{logger['info'](_0x711d('0xd'),_0xdfa997,_0x711d('0x12'));_0x5c5679(_0xd4f1a1['result'][_0x711d('0x11')]);}})['catch'](function(_0x333137){logger[_0x711d('0xf')](_0x711d('0xd'),_0xdfa997,_0x333137);_0x1da7e0(_0x333137);});});} \ No newline at end of file +var _0xabe4=['client','http','info','request\x20sent','debug','stringify','error','message','FreshdeskField,\x20%s,\x20%s','result','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x3a548d,_0x5bd628){var _0x3bba63=function(_0x515078){while(--_0x515078){_0x3a548d['push'](_0x3a548d['shift']());}};_0x3bba63(++_0x5bd628);}(_0xabe4,0xb5));var _0x4abe=function(_0x911aa,_0x5cb8b5){_0x911aa=_0x911aa-0x0;var _0x327202=_0xabe4[_0x911aa];return _0x327202;};'use strict';var _=require(_0x4abe('0x0'));var util=require(_0x4abe('0x1'));var moment=require(_0x4abe('0x2'));var BPromise=require(_0x4abe('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4abe('0x4'))['db'];var utils=require(_0x4abe('0x5'));var logger=require(_0x4abe('0x6'))(_0x4abe('0x7'));var config=require(_0x4abe('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x4abe('0x9')][_0x4abe('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x26fff6,_0xcbc316,_0x36463b){return new BPromise(function(_0x41f6c2,_0x197bfc){return client['request'](_0x26fff6,_0x36463b)['then'](function(_0x85b159){logger[_0x4abe('0xb')]('FreshdeskField,\x20%s,\x20%s',_0xcbc316,_0x4abe('0xc'));logger[_0x4abe('0xd')]('FreshdeskField,\x20%s,\x20%s,\x20%s',_0xcbc316,_0x4abe('0xc'),JSON[_0x4abe('0xe')](_0x85b159));if(_0x85b159['error']){if(_0x85b159[_0x4abe('0xf')]['code']===0x1f4){logger[_0x4abe('0xf')]('FreshdeskField,\x20%s,\x20%s',_0xcbc316,_0x85b159[_0x4abe('0xf')][_0x4abe('0x10')]);return _0x197bfc(_0x85b159['error'][_0x4abe('0x10')]);}logger[_0x4abe('0xf')](_0x4abe('0x11'),_0xcbc316,_0x85b159[_0x4abe('0xf')][_0x4abe('0x10')]);return _0x41f6c2(_0x85b159[_0x4abe('0xf')][_0x4abe('0x10')]);}else{logger[_0x4abe('0xb')](_0x4abe('0x11'),_0xcbc316,_0x4abe('0xc'));_0x41f6c2(_0x85b159[_0x4abe('0x12')][_0x4abe('0x10')]);}})['catch'](function(_0x6f4765){logger[_0x4abe('0xf')](_0x4abe('0x11'),_0xcbc316,_0x6f4765);_0x197bfc(_0x6f4765);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/index.js b/server/api/intFreshsalesAccount/index.js index e004a72..094084f 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 _0x4e81=['update','delete','exports','multer','util','path','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesAccount.controller','get','/:id','isAuthenticated','show','/:id/configurations','getConfigurations','getFields','post','create','put'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x4e81,0x1bc));var _0x14e8=function(_0x1559a5,_0x41924e){_0x1559a5=_0x1559a5-0x0;var _0x17a783=_0x4e81[_0x1559a5];return _0x17a783;};'use strict';var multer=require(_0x14e8('0x0'));var util=require(_0x14e8('0x1'));var path=require(_0x14e8('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x14e8('0x3'));var auth=require(_0x14e8('0x4'));var interaction=require(_0x14e8('0x5'));var config=require(_0x14e8('0x6'));var controller=require(_0x14e8('0x7'));router[_0x14e8('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x14e8('0x8')](_0x14e8('0x9'),auth[_0x14e8('0xa')](),controller[_0x14e8('0xb')]);router[_0x14e8('0x8')](_0x14e8('0xc'),auth[_0x14e8('0xa')](),controller[_0x14e8('0xd')]);router[_0x14e8('0x8')]('/:id/fields',auth[_0x14e8('0xa')](),controller[_0x14e8('0xe')]);router[_0x14e8('0xf')]('/',auth[_0x14e8('0xa')](),controller[_0x14e8('0x10')]);router[_0x14e8('0xf')](_0x14e8('0xc'),auth[_0x14e8('0xa')](),controller['addConfiguration']);router[_0x14e8('0x11')]('/:id',auth[_0x14e8('0xa')](),controller[_0x14e8('0x12')]);router[_0x14e8('0x13')]('/:id',auth[_0x14e8('0xa')](),controller['destroy']);module[_0x14e8('0x14')]=router; \ No newline at end of file +var _0xf290=['destroy','exports','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','addConfiguration','put','update'];(function(_0x19d28e,_0x105e57){var _0x3d6118=function(_0x336c92){while(--_0x336c92){_0x19d28e['push'](_0x19d28e['shift']());}};_0x3d6118(++_0x105e57);}(_0xf290,0xde));var _0x0f29=function(_0x5416db,_0x55683a){_0x5416db=_0x5416db-0x0;var _0x243e35=_0xf290[_0x5416db];return _0x243e35;};'use strict';var multer=require('multer');var util=require(_0x0f29('0x0'));var path=require('path');var timeout=require(_0x0f29('0x1'));var express=require('express');var router=express[_0x0f29('0x2')]();var fs_extra=require(_0x0f29('0x3'));var auth=require(_0x0f29('0x4'));var interaction=require(_0x0f29('0x5'));var config=require(_0x0f29('0x6'));var controller=require('./intFreshsalesAccount.controller');router[_0x0f29('0x7')]('/',auth['isAuthenticated'](),controller[_0x0f29('0x8')]);router[_0x0f29('0x7')](_0x0f29('0x9'),auth[_0x0f29('0xa')](),controller[_0x0f29('0xb')]);router[_0x0f29('0x7')](_0x0f29('0xc'),auth[_0x0f29('0xa')](),controller[_0x0f29('0xd')]);router[_0x0f29('0x7')](_0x0f29('0xe'),auth[_0x0f29('0xa')](),controller[_0x0f29('0xf')]);router[_0x0f29('0x10')]('/',auth[_0x0f29('0xa')](),controller['create']);router[_0x0f29('0x10')]('/:id/configurations',auth[_0x0f29('0xa')](),controller[_0x0f29('0x11')]);router[_0x0f29('0x12')](_0x0f29('0x9'),auth[_0x0f29('0xa')](),controller[_0x0f29('0x13')]);router['delete'](_0x0f29('0x9'),auth[_0x0f29('0xa')](),controller[_0x0f29('0x14')]);module[_0x0f29('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 f78d8ef..0793a07 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 _0xdf55=['exports','STRING','remoteUri','sequelize'];(function(_0x339b48,_0x2e1c69){var _0x1f0db0=function(_0x2d6ec1){while(--_0x2d6ec1){_0x339b48['push'](_0x339b48['shift']());}};_0x1f0db0(++_0x2e1c69);}(_0xdf55,0x83));var _0x5df5=function(_0x440e51,_0x4fc63a){_0x440e51=_0x440e51-0x0;var _0x9be905=_0xdf55[_0x440e51];return _0x9be905;};'use strict';var Sequelize=require(_0x5df5('0x0'));module[_0x5df5('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x5df5('0x2')]},'username':{'type':Sequelize[_0x5df5('0x2')],'unique':'username'},'apiKey':{'type':Sequelize[_0x5df5('0x2')]},'remoteUri':{'type':Sequelize[_0x5df5('0x2')],'unique':_0x5df5('0x3')},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file +var _0x4325=['exports','STRING','username','remoteUri','sequelize'];(function(_0x3bc080,_0x458452){var _0x218c0e=function(_0x1130ee){while(--_0x1130ee){_0x3bc080['push'](_0x3bc080['shift']());}};_0x218c0e(++_0x458452);}(_0x4325,0x1da));var _0x5432=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x4325[_0x397e5f];return _0x5302b8;};'use strict';var Sequelize=require(_0x5432('0x0'));module[_0x5432('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x5432('0x2')]},'username':{'type':Sequelize[_0x5432('0x2')],'unique':_0x5432('0x3')},'apiKey':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize['STRING'],'unique':_0x5432('0x4')},'serverUrl':{'type':Sequelize[_0x5432('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js index f5c3f94..7722963 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 _0xb049=['where','pick','merge','VIRTUAL','filter','includeAll','findAll','then','rows','catch','show','params','include','find','create','body','update','destroy','FreshsalesConfiguration','options','getConfigurations','addConfiguration','findOne','getSubjects','channel','FreshsalesField','Descriptions','getFields','username','remoteUri','substring','GET','format','%s%s','/api/selector/owners','users','email','Requested\x20Resource\x20not\x20Found','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','reject','save','error','stack','name','send','index','map','FreshsalesAccount','rawAttributes','fieldName','type','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort'];(function(_0x314810,_0x5d0e31){var _0xec232d=function(_0x50ca9e){while(--_0x50ca9e){_0x314810['push'](_0x314810['shift']());}};_0xec232d(++_0x5d0e31);}(_0xb049,0xf3));var _0x9b04=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xb049[_0x3947c9];return _0x2e7871;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9b04('0x0'));var zipdir=require(_0x9b04('0x1'));var jsonpatch=require(_0x9b04('0x2'));var rp=require('request-promise');var moment=require(_0x9b04('0x3'));var BPromise=require(_0x9b04('0x4'));var Mustache=require(_0x9b04('0x5'));var util=require(_0x9b04('0x6'));var path=require('path');var sox=require(_0x9b04('0x7'));var csv=require(_0x9b04('0x8'));var ejs=require(_0x9b04('0x9'));var fs=require('fs');var fs_extra=require(_0x9b04('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x9b04('0xb'));var jsforce=require(_0x9b04('0xc'));var deskjs=require(_0x9b04('0xd'));var toCsv=require(_0x9b04('0x8'));var querystring=require(_0x9b04('0xe'));var Papa=require(_0x9b04('0xf'));var Redis=require(_0x9b04('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x9b04('0x11'));var as=require(_0x9b04('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9b04('0x13'))(_0x9b04('0x14'));var utils=require(_0x9b04('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x9b04('0x16'));var db=require(_0x9b04('0x17'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x1c45c1,_0x3f45c1){_0x3f45c1=_0x3f45c1||0xcc;return function(_0x1aa34f){if(_0x1aa34f){return _0x1c45c1[_0x9b04('0x18')](_0x3f45c1);}return _0x1c45c1[_0x9b04('0x19')](_0x3f45c1)[_0x9b04('0x1a')]();};}function respondWithResult(_0x216d30,_0x55e498){_0x55e498=_0x55e498||0xc8;return function(_0x3b455d){if(_0x3b455d){return _0x216d30['status'](_0x55e498)['json'](_0x3b455d);}};}function respondWithFilteredResult(_0x4a905b,_0x5ebdb7){return function(_0x658905){if(_0x658905){var _0x436c18=typeof _0x5ebdb7[_0x9b04('0x1b')]===_0x9b04('0x1c')&&typeof _0x5ebdb7[_0x9b04('0x1d')]==='undefined';var _0x4f1d11=_0x658905[_0x9b04('0x1e')];var _0x5825a0=_0x436c18?0x0:_0x5ebdb7[_0x9b04('0x1b')];var _0x54646a=_0x436c18?_0x658905[_0x9b04('0x1e')]:_0x5ebdb7[_0x9b04('0x1b')]+_0x5ebdb7['limit'];var _0x2fe291;if(_0x54646a>=_0x4f1d11){_0x54646a=_0x4f1d11;_0x2fe291=0xc8;}else{_0x2fe291=0xce;}_0x4a905b['status'](_0x2fe291);return _0x4a905b['set'](_0x9b04('0x1f'),_0x5825a0+'-'+_0x54646a+'/'+_0x4f1d11)[_0x9b04('0x20')](_0x658905);}return null;};}function patchUpdates(_0x4f1c61){return function(_0x2a112b){try{jsonpatch['apply'](_0x2a112b,_0x4f1c61,!![]);}catch(_0x10b14d){return BPromise[_0x9b04('0x21')](_0x10b14d);}return _0x2a112b[_0x9b04('0x22')]();};}function saveUpdates(_0x3532b0,_0x5a9925){return function(_0x13c6b7){if(_0x13c6b7){return _0x13c6b7['update'](_0x3532b0)['then'](function(_0xefad5f){return _0xefad5f;});}return null;};}function removeEntity(_0x3adf7f,_0x37b711){return function(_0x308041){if(_0x308041){return _0x308041['destroy']()['then'](function(){_0x3adf7f[_0x9b04('0x19')](0xcc)[_0x9b04('0x1a')]();});}};}function handleEntityNotFound(_0x59e79c,_0x1580af){return function(_0x20659f){if(!_0x20659f){_0x59e79c[_0x9b04('0x18')](0x194);}return _0x20659f;};}function handleError(_0x2ea281,_0x32b4a6){_0x32b4a6=_0x32b4a6||0x1f4;return function(_0xd9ec54){logger[_0x9b04('0x23')](_0xd9ec54[_0x9b04('0x24')]);if(_0xd9ec54[_0x9b04('0x25')]){delete _0xd9ec54[_0x9b04('0x25')];}_0x2ea281['status'](_0x32b4a6)[_0x9b04('0x26')](_0xd9ec54);};}exports[_0x9b04('0x27')]=function(_0x3343a3,_0xa7c216){var _0x47be30={},_0x33853d={},_0x3a481c={'count':0x0,'rows':[]};var _0x30e99c=_[_0x9b04('0x28')](db[_0x9b04('0x29')][_0x9b04('0x2a')],function(_0x14bcb0){return{'name':_0x14bcb0[_0x9b04('0x2b')],'type':_0x14bcb0[_0x9b04('0x2c')]['key']};});_0x33853d[_0x9b04('0x2d')]=_[_0x9b04('0x28')](_0x30e99c,_0x9b04('0x25'));_0x33853d[_0x9b04('0x2e')]=_[_0x9b04('0x2f')](_0x3343a3[_0x9b04('0x2e')]);_0x33853d[_0x9b04('0x30')]=_['intersection'](_0x33853d[_0x9b04('0x2d')],_0x33853d['query']);_0x47be30[_0x9b04('0x31')]=_[_0x9b04('0x32')](_0x33853d[_0x9b04('0x2d')],qs[_0x9b04('0x33')](_0x3343a3[_0x9b04('0x2e')][_0x9b04('0x33')]));_0x47be30[_0x9b04('0x31')]=_0x47be30[_0x9b04('0x31')][_0x9b04('0x34')]?_0x47be30[_0x9b04('0x31')]:_0x33853d[_0x9b04('0x2d')];if(!_0x3343a3[_0x9b04('0x2e')][_0x9b04('0x35')](_0x9b04('0x36'))){_0x47be30[_0x9b04('0x1d')]=qs[_0x9b04('0x1d')](_0x3343a3[_0x9b04('0x2e')][_0x9b04('0x1d')]);_0x47be30['offset']=qs[_0x9b04('0x1b')](_0x3343a3[_0x9b04('0x2e')][_0x9b04('0x1b')]);}_0x47be30[_0x9b04('0x37')]=qs[_0x9b04('0x38')](_0x3343a3[_0x9b04('0x2e')][_0x9b04('0x38')]);_0x47be30[_0x9b04('0x39')]=qs['filters'](_[_0x9b04('0x3a')](_0x3343a3['query'],_0x33853d[_0x9b04('0x30')]),_0x30e99c);if(_0x3343a3[_0x9b04('0x2e')]['filter']){_0x47be30[_0x9b04('0x39')]=_[_0x9b04('0x3b')](_0x47be30['where'],{'$or':_['map'](_0x30e99c,function(_0x803077){if(_0x803077[_0x9b04('0x2c')]!==_0x9b04('0x3c')){var _0x419687={};_0x419687[_0x803077[_0x9b04('0x25')]]={'$like':'%'+_0x3343a3[_0x9b04('0x2e')][_0x9b04('0x3d')]+'%'};return _0x419687;}})});}_0x47be30=_[_0x9b04('0x3b')]({},_0x47be30,_0x3343a3['options']);var _0x4dae2f={'where':_0x47be30[_0x9b04('0x39')]};return db[_0x9b04('0x29')][_0x9b04('0x1e')](_0x4dae2f)['then'](function(_0x763c7b){_0x3a481c[_0x9b04('0x1e')]=_0x763c7b;if(_0x3343a3[_0x9b04('0x2e')][_0x9b04('0x3e')]){_0x47be30['include']=[{'all':!![]}];}return db[_0x9b04('0x29')][_0x9b04('0x3f')](_0x47be30);})[_0x9b04('0x40')](function(_0x3045f5){_0x3a481c[_0x9b04('0x41')]=_0x3045f5;return _0x3a481c;})[_0x9b04('0x40')](respondWithFilteredResult(_0xa7c216,_0x47be30))[_0x9b04('0x42')](handleError(_0xa7c216,null));};exports[_0x9b04('0x43')]=function(_0x13cfcc,_0x398da7){var _0x29bfe8={'raw':![],'where':{'id':_0x13cfcc[_0x9b04('0x44')]['id']}},_0x1cbaaa={};_0x1cbaaa[_0x9b04('0x2d')]=_['keys'](db[_0x9b04('0x29')][_0x9b04('0x2a')]);_0x1cbaaa[_0x9b04('0x2e')]=_[_0x9b04('0x2f')](_0x13cfcc[_0x9b04('0x2e')]);_0x1cbaaa[_0x9b04('0x30')]=_[_0x9b04('0x32')](_0x1cbaaa[_0x9b04('0x2d')],_0x1cbaaa['query']);_0x29bfe8[_0x9b04('0x31')]=_[_0x9b04('0x32')](_0x1cbaaa[_0x9b04('0x2d')],qs[_0x9b04('0x33')](_0x13cfcc['query'][_0x9b04('0x33')]));_0x29bfe8[_0x9b04('0x31')]=_0x29bfe8[_0x9b04('0x31')][_0x9b04('0x34')]?_0x29bfe8[_0x9b04('0x31')]:_0x1cbaaa[_0x9b04('0x2d')];if(_0x13cfcc['query'][_0x9b04('0x3e')]){_0x29bfe8[_0x9b04('0x45')]=[{'all':!![]}];}_0x29bfe8=_[_0x9b04('0x3b')]({},_0x29bfe8,_0x13cfcc['options']);return db[_0x9b04('0x29')][_0x9b04('0x46')](_0x29bfe8)[_0x9b04('0x40')](handleEntityNotFound(_0x398da7,null))[_0x9b04('0x40')](respondWithResult(_0x398da7,null))[_0x9b04('0x42')](handleError(_0x398da7,null));};exports[_0x9b04('0x47')]=function(_0xef13e7,_0x514e68){return db[_0x9b04('0x29')][_0x9b04('0x47')](_0xef13e7[_0x9b04('0x48')],{})[_0x9b04('0x40')](respondWithResult(_0x514e68,0xc9))['catch'](handleError(_0x514e68,null));};exports[_0x9b04('0x49')]=function(_0x15dd44,_0x2b23f1){if(_0x15dd44['body']['id']){delete _0x15dd44[_0x9b04('0x48')]['id'];}return db['FreshsalesAccount'][_0x9b04('0x46')]({'where':{'id':_0x15dd44[_0x9b04('0x44')]['id']}})['then'](handleEntityNotFound(_0x2b23f1,null))[_0x9b04('0x40')](saveUpdates(_0x15dd44[_0x9b04('0x48')],null))[_0x9b04('0x40')](respondWithResult(_0x2b23f1,null))[_0x9b04('0x42')](handleError(_0x2b23f1,null));};exports[_0x9b04('0x4a')]=function(_0x3ab4da,_0x18d9e0){return db['FreshsalesAccount'][_0x9b04('0x46')]({'where':{'id':_0x3ab4da['params']['id']}})['then'](handleEntityNotFound(_0x18d9e0,null))[_0x9b04('0x40')](removeEntity(_0x18d9e0,null))[_0x9b04('0x42')](handleError(_0x18d9e0,null));};exports['getConfigurations']=function(_0x7ec687,_0x13ff4e,_0x1ab82e){var _0x581553={};var _0x2cc9c2={};var _0x10cce1;var _0x38c927;return db['FreshsalesAccount']['findOne']({'where':{'id':_0x7ec687[_0x9b04('0x44')]['id']}})['then'](handleEntityNotFound(_0x13ff4e,null))[_0x9b04('0x40')](function(_0x17af59){if(_0x17af59){_0x10cce1=_0x17af59;_0x2cc9c2['model']=_[_0x9b04('0x2f')](db[_0x9b04('0x4b')][_0x9b04('0x2a')]);_0x2cc9c2['query']=_[_0x9b04('0x2f')](_0x7ec687['query']);_0x2cc9c2['filters']=_[_0x9b04('0x32')](_0x2cc9c2[_0x9b04('0x2d')],_0x2cc9c2['query']);_0x581553[_0x9b04('0x31')]=_[_0x9b04('0x32')](_0x2cc9c2[_0x9b04('0x2d')],qs[_0x9b04('0x33')](_0x7ec687[_0x9b04('0x2e')][_0x9b04('0x33')]));_0x581553[_0x9b04('0x31')]=_0x581553[_0x9b04('0x31')][_0x9b04('0x34')]?_0x581553[_0x9b04('0x31')]:_0x2cc9c2[_0x9b04('0x2d')];_0x581553[_0x9b04('0x37')]=qs['sort'](_0x7ec687['query'][_0x9b04('0x38')]);_0x581553[_0x9b04('0x39')]=qs['filters'](_['pick'](_0x7ec687[_0x9b04('0x2e')],_0x2cc9c2['filters']));if(_0x7ec687[_0x9b04('0x2e')][_0x9b04('0x3d')]){_0x581553[_0x9b04('0x39')]=_[_0x9b04('0x3b')](_0x581553[_0x9b04('0x39')],{'$or':_['map'](_0x581553[_0x9b04('0x31')],function(_0x468e27){var _0x4a5764={};_0x4a5764[_0x468e27]={'$like':'%'+_0x7ec687[_0x9b04('0x2e')][_0x9b04('0x3d')]+'%'};return _0x4a5764;})});}_0x581553=_['merge']({},_0x581553,_0x7ec687[_0x9b04('0x4c')]);return _0x10cce1[_0x9b04('0x4d')](_0x581553);}})[_0x9b04('0x40')](function(_0x1a511a){if(_0x1a511a){_0x38c927=_0x1a511a[_0x9b04('0x34')];if(!_0x7ec687[_0x9b04('0x2e')][_0x9b04('0x35')](_0x9b04('0x36'))){_0x581553[_0x9b04('0x1d')]=qs[_0x9b04('0x1d')](_0x7ec687[_0x9b04('0x2e')][_0x9b04('0x1d')]);_0x581553[_0x9b04('0x1b')]=qs[_0x9b04('0x1b')](_0x7ec687['query'][_0x9b04('0x1b')]);}return _0x10cce1[_0x9b04('0x4d')](_0x581553);}})[_0x9b04('0x40')](function(_0x2fc92e){if(_0x2fc92e){return _0x2fc92e?{'count':_0x38c927,'rows':_0x2fc92e}:null;}})[_0x9b04('0x40')](respondWithResult(_0x13ff4e,null))[_0x9b04('0x42')](handleError(_0x13ff4e,null));};exports[_0x9b04('0x4e')]=function(_0x30f039,_0xd4a3d5,_0x2fb6f3){if(_0x30f039[_0x9b04('0x48')]['id']){delete _0x30f039[_0x9b04('0x48')]['id'];}return db[_0x9b04('0x29')][_0x9b04('0x4f')]({'where':{'id':_0x30f039[_0x9b04('0x44')]['id']}})[_0x9b04('0x40')](handleEntityNotFound(_0xd4a3d5,null))[_0x9b04('0x40')](function(_0xaec9){if(_0xaec9){_0x30f039[_0x9b04('0x48')]['AccountId']=_0xaec9['id'];_0x30f039[_0x9b04('0x48')]['Subjects']=integrations[_0x9b04('0x50')](_0x30f039[_0x9b04('0x48')][_0x9b04('0x51')],_0x30f039[_0x9b04('0x48')][_0x9b04('0x2c')]);_0x30f039[_0x9b04('0x48')]['Descriptions']=integrations['getDescriptions'](_0x30f039[_0x9b04('0x48')]['channel'],_0x30f039[_0x9b04('0x48')][_0x9b04('0x2c')]);return db['FreshsalesConfiguration']['create'](_0x30f039[_0x9b04('0x48')],{'include':[{'model':db['FreshsalesField'],'as':'Subjects'},{'model':db[_0x9b04('0x52')],'as':_0x9b04('0x53')}]});}return null;})['then'](respondWithResult(_0xd4a3d5,null))['catch'](handleError(_0xd4a3d5,null));};exports[_0x9b04('0x54')]=function(_0x5c4cbe,_0x52a3be,_0x572cf2){var _0x480830='';var _0x5bffb5='';return db[_0x9b04('0x29')]['findOne']({'where':{'id':_0x5c4cbe[_0x9b04('0x44')]['id']},'attributes':['id',_0x9b04('0x55'),_0x9b04('0x56'),'apiKey']})[_0x9b04('0x40')](handleEntityNotFound(_0x52a3be,null))[_0x9b04('0x40')](function(_0x4bf5bb){if(_0x4bf5bb){_0x5bffb5=_0x4bf5bb['username'];_0x480830=_0x4bf5bb[_0x9b04('0x56')];var _0x192eae=_0x4bf5bb[_0x9b04('0x56')]['slice'](-0x1);if(_0x192eae==='/'){_0x480830=_0x480830[_0x9b04('0x57')](0x0,_0x480830['lastIndexOf'](_0x192eae));}return rp({'method':_0x9b04('0x58'),'uri':util[_0x9b04('0x59')](_0x9b04('0x5a'),_0x480830,_0x9b04('0x5b')),'headers':{'Authorization':'Token\x20token='+_0x4bf5bb['apiKey']},'json':!![]});}})[_0x9b04('0x40')](function(_0x48a536){if(_0x48a536){var _0x55d28d=_0x48a536[_0x9b04('0x5c')];var _0x45373c=![];var _0x254c68=null;for(_0x254c68=0x0;_0x254c68<_0x55d28d['length'];_0x254c68++){if(_0x55d28d[_0x254c68][_0x9b04('0x5d')]===_0x5bffb5){_0x45373c=!![];}}if(_0x45373c){return!![];}else{throw new Error({'statusCode':0x194,'message':_0x9b04('0x5e')});}}})[_0x9b04('0x40')](respondWithResult(_0x52a3be,null))[_0x9b04('0x42')](function(_0x56c897){var _0x416c31=_0x5c4cbe[_0x9b04('0x2e')][_0x9b04('0x5f')]?0x1f4:_0x56c897[_0x9b04('0x60')]||0x1f4;logger[_0x9b04('0x23')](_0x9b04('0x61'),_0x9b04('0x54'),_0x416c31,JSON[_0x9b04('0x62')](_0x56c897));delete _0x56c897[_0x9b04('0x25')];if(_0x416c31===0x191){_0x416c31=0x190;}_0x52a3be['status'](_0x416c31)[_0x9b04('0x26')](_0x5c4cbe['query']['test']?{'message':_0x9b04('0x63'),'statusCode':_0x56c897[_0x9b04('0x60')]}:_0x56c897);});}; \ No newline at end of file +var _0x7613=['../../components/integrations/configuration','sendStatus','end','json','offset','undefined','limit','count','status','Content-Range','apply','reject','destroy','error','stack','name','send','index','FreshsalesAccount','rawAttributes','fieldName','type','key','map','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filters','filter','merge','includeAll','include','then','rows','catch','show','params','options','find','create','body','update','findOne','order','getConfigurations','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','FreshsalesConfiguration','FreshsalesField','getFields','username','remoteUri','GET','%s%s','/api/selector/owners','Token\x20token=','apiKey','users','email','Requested\x20Resource\x20not\x20Found','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb'];(function(_0x1f9883,_0x5c994b){var _0x1ef1bd=function(_0x5c2e1a){while(--_0x5c2e1a){_0x1f9883['push'](_0x1f9883['shift']());}};_0x1ef1bd(++_0x5c994b);}(_0x7613,0x11c));var _0x3761=function(_0x9e05d1,_0x3cef4a){_0x9e05d1=_0x9e05d1-0x0;var _0x4f7e97=_0x7613[_0x9e05d1];return _0x4f7e97;};'use strict';var emlformat=require(_0x3761('0x0'));var rimraf=require(_0x3761('0x1'));var zipdir=require(_0x3761('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3761('0x3'));var moment=require(_0x3761('0x4'));var BPromise=require(_0x3761('0x5'));var Mustache=require(_0x3761('0x6'));var util=require('util');var path=require(_0x3761('0x7'));var sox=require(_0x3761('0x8'));var csv=require(_0x3761('0x9'));var ejs=require(_0x3761('0xa'));var fs=require('fs');var fs_extra=require(_0x3761('0xb'));var _=require(_0x3761('0xc'));var squel=require('squel');var crypto=require(_0x3761('0xd'));var jsforce=require(_0x3761('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x3761('0xf'));var Redis=require(_0x3761('0x10'));var authService=require(_0x3761('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x3761('0x12'));var hardwareService=require(_0x3761('0x13'));var logger=require(_0x3761('0x14'))(_0x3761('0x15'));var utils=require(_0x3761('0x16'));var config=require(_0x3761('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x3761('0x18'))['db'];var integrations=require(_0x3761('0x19'));function respondWithStatusCode(_0x45ddd1,_0x412c95){_0x412c95=_0x412c95||0xcc;return function(_0x4f9111){if(_0x4f9111){return _0x45ddd1[_0x3761('0x1a')](_0x412c95);}return _0x45ddd1['status'](_0x412c95)[_0x3761('0x1b')]();};}function respondWithResult(_0x4d912a,_0x6f17e7){_0x6f17e7=_0x6f17e7||0xc8;return function(_0x45fa30){if(_0x45fa30){return _0x4d912a['status'](_0x6f17e7)[_0x3761('0x1c')](_0x45fa30);}};}function respondWithFilteredResult(_0x45c47a,_0x3f7df9){return function(_0x411ef4){if(_0x411ef4){var _0x384971=typeof _0x3f7df9[_0x3761('0x1d')]===_0x3761('0x1e')&&typeof _0x3f7df9[_0x3761('0x1f')]===_0x3761('0x1e');var _0x369cd0=_0x411ef4[_0x3761('0x20')];var _0x5d42c9=_0x384971?0x0:_0x3f7df9[_0x3761('0x1d')];var _0x5021d6=_0x384971?_0x411ef4[_0x3761('0x20')]:_0x3f7df9[_0x3761('0x1d')]+_0x3f7df9[_0x3761('0x1f')];var _0x120c3f;if(_0x5021d6>=_0x369cd0){_0x5021d6=_0x369cd0;_0x120c3f=0xc8;}else{_0x120c3f=0xce;}_0x45c47a[_0x3761('0x21')](_0x120c3f);return _0x45c47a['set'](_0x3761('0x22'),_0x5d42c9+'-'+_0x5021d6+'/'+_0x369cd0)[_0x3761('0x1c')](_0x411ef4);}return null;};}function patchUpdates(_0xefe89b){return function(_0x3fd7b7){try{jsonpatch[_0x3761('0x23')](_0x3fd7b7,_0xefe89b,!![]);}catch(_0x5dd768){return BPromise[_0x3761('0x24')](_0x5dd768);}return _0x3fd7b7['save']();};}function saveUpdates(_0x53c93c,_0x3e2559){return function(_0x424fc3){if(_0x424fc3){return _0x424fc3['update'](_0x53c93c)['then'](function(_0x331fad){return _0x331fad;});}return null;};}function removeEntity(_0x506f7c,_0x409efc){return function(_0xf50a33){if(_0xf50a33){return _0xf50a33[_0x3761('0x25')]()['then'](function(){_0x506f7c['status'](0xcc)[_0x3761('0x1b')]();});}};}function handleEntityNotFound(_0x5823e0,_0xaa03e0){return function(_0x558631){if(!_0x558631){_0x5823e0[_0x3761('0x1a')](0x194);}return _0x558631;};}function handleError(_0x2886e5,_0xdbd9dc){_0xdbd9dc=_0xdbd9dc||0x1f4;return function(_0x4b701c){logger[_0x3761('0x26')](_0x4b701c[_0x3761('0x27')]);if(_0x4b701c[_0x3761('0x28')]){delete _0x4b701c['name'];}_0x2886e5[_0x3761('0x21')](_0xdbd9dc)[_0x3761('0x29')](_0x4b701c);};}exports[_0x3761('0x2a')]=function(_0x196519,_0x4cf355){var _0x1ce838={},_0x2370b1={},_0x486b6a={'count':0x0,'rows':[]};var _0x41a74e=_['map'](db[_0x3761('0x2b')][_0x3761('0x2c')],function(_0x3470c7){return{'name':_0x3470c7[_0x3761('0x2d')],'type':_0x3470c7[_0x3761('0x2e')][_0x3761('0x2f')]};});_0x2370b1['model']=_[_0x3761('0x30')](_0x41a74e,_0x3761('0x28'));_0x2370b1[_0x3761('0x31')]=_[_0x3761('0x32')](_0x196519[_0x3761('0x31')]);_0x2370b1['filters']=_[_0x3761('0x33')](_0x2370b1[_0x3761('0x34')],_0x2370b1['query']);_0x1ce838[_0x3761('0x35')]=_['intersection'](_0x2370b1[_0x3761('0x34')],qs[_0x3761('0x36')](_0x196519[_0x3761('0x31')]['fields']));_0x1ce838[_0x3761('0x35')]=_0x1ce838[_0x3761('0x35')][_0x3761('0x37')]?_0x1ce838[_0x3761('0x35')]:_0x2370b1[_0x3761('0x34')];if(!_0x196519[_0x3761('0x31')][_0x3761('0x38')](_0x3761('0x39'))){_0x1ce838[_0x3761('0x1f')]=qs[_0x3761('0x1f')](_0x196519[_0x3761('0x31')][_0x3761('0x1f')]);_0x1ce838[_0x3761('0x1d')]=qs['offset'](_0x196519[_0x3761('0x31')][_0x3761('0x1d')]);}_0x1ce838['order']=qs['sort'](_0x196519[_0x3761('0x31')][_0x3761('0x3a')]);_0x1ce838[_0x3761('0x3b')]=qs['filters'](_[_0x3761('0x3c')](_0x196519[_0x3761('0x31')],_0x2370b1[_0x3761('0x3d')]),_0x41a74e);if(_0x196519[_0x3761('0x31')][_0x3761('0x3e')]){_0x1ce838[_0x3761('0x3b')]=_['merge'](_0x1ce838[_0x3761('0x3b')],{'$or':_[_0x3761('0x30')](_0x41a74e,function(_0x514994){if(_0x514994[_0x3761('0x2e')]!=='VIRTUAL'){var _0x4017ff={};_0x4017ff[_0x514994[_0x3761('0x28')]]={'$like':'%'+_0x196519[_0x3761('0x31')][_0x3761('0x3e')]+'%'};return _0x4017ff;}})});}_0x1ce838=_[_0x3761('0x3f')]({},_0x1ce838,_0x196519['options']);var _0x555f00={'where':_0x1ce838[_0x3761('0x3b')]};return db[_0x3761('0x2b')][_0x3761('0x20')](_0x555f00)['then'](function(_0x2cb1b5){_0x486b6a['count']=_0x2cb1b5;if(_0x196519[_0x3761('0x31')][_0x3761('0x40')]){_0x1ce838[_0x3761('0x41')]=[{'all':!![]}];}return db[_0x3761('0x2b')]['findAll'](_0x1ce838);})[_0x3761('0x42')](function(_0x2c1f98){_0x486b6a[_0x3761('0x43')]=_0x2c1f98;return _0x486b6a;})[_0x3761('0x42')](respondWithFilteredResult(_0x4cf355,_0x1ce838))[_0x3761('0x44')](handleError(_0x4cf355,null));};exports[_0x3761('0x45')]=function(_0xf5b9f7,_0x37ccb3){var _0x5ab591={'raw':![],'where':{'id':_0xf5b9f7[_0x3761('0x46')]['id']}},_0x4d2145={};_0x4d2145[_0x3761('0x34')]=_[_0x3761('0x32')](db['FreshsalesAccount']['rawAttributes']);_0x4d2145[_0x3761('0x31')]=_[_0x3761('0x32')](_0xf5b9f7[_0x3761('0x31')]);_0x4d2145[_0x3761('0x3d')]=_[_0x3761('0x33')](_0x4d2145[_0x3761('0x34')],_0x4d2145[_0x3761('0x31')]);_0x5ab591[_0x3761('0x35')]=_[_0x3761('0x33')](_0x4d2145[_0x3761('0x34')],qs['fields'](_0xf5b9f7[_0x3761('0x31')][_0x3761('0x36')]));_0x5ab591[_0x3761('0x35')]=_0x5ab591['attributes'][_0x3761('0x37')]?_0x5ab591[_0x3761('0x35')]:_0x4d2145[_0x3761('0x34')];if(_0xf5b9f7['query'][_0x3761('0x40')]){_0x5ab591[_0x3761('0x41')]=[{'all':!![]}];}_0x5ab591=_[_0x3761('0x3f')]({},_0x5ab591,_0xf5b9f7[_0x3761('0x47')]);return db[_0x3761('0x2b')][_0x3761('0x48')](_0x5ab591)[_0x3761('0x42')](handleEntityNotFound(_0x37ccb3,null))['then'](respondWithResult(_0x37ccb3,null))[_0x3761('0x44')](handleError(_0x37ccb3,null));};exports[_0x3761('0x49')]=function(_0x1baa76,_0x1220c3){return db['FreshsalesAccount'][_0x3761('0x49')](_0x1baa76[_0x3761('0x4a')],{})['then'](respondWithResult(_0x1220c3,0xc9))[_0x3761('0x44')](handleError(_0x1220c3,null));};exports[_0x3761('0x4b')]=function(_0x3e79dd,_0x16cf74){if(_0x3e79dd[_0x3761('0x4a')]['id']){delete _0x3e79dd[_0x3761('0x4a')]['id'];}return db[_0x3761('0x2b')][_0x3761('0x48')]({'where':{'id':_0x3e79dd['params']['id']}})[_0x3761('0x42')](handleEntityNotFound(_0x16cf74,null))['then'](saveUpdates(_0x3e79dd[_0x3761('0x4a')],null))[_0x3761('0x42')](respondWithResult(_0x16cf74,null))['catch'](handleError(_0x16cf74,null));};exports[_0x3761('0x25')]=function(_0x393b3e,_0x48b607){return db[_0x3761('0x2b')][_0x3761('0x48')]({'where':{'id':_0x393b3e['params']['id']}})[_0x3761('0x42')](handleEntityNotFound(_0x48b607,null))[_0x3761('0x42')](removeEntity(_0x48b607,null))[_0x3761('0x44')](handleError(_0x48b607,null));};exports['getConfigurations']=function(_0x11b6e9,_0x5f01dc,_0x16fa1f){var _0x4510f5={};var _0x5113aa={};var _0x47099d;var _0xa92770;return db['FreshsalesAccount'][_0x3761('0x4c')]({'where':{'id':_0x11b6e9[_0x3761('0x46')]['id']}})[_0x3761('0x42')](handleEntityNotFound(_0x5f01dc,null))['then'](function(_0x3e42f7){if(_0x3e42f7){_0x47099d=_0x3e42f7;_0x5113aa[_0x3761('0x34')]=_[_0x3761('0x32')](db['FreshsalesConfiguration']['rawAttributes']);_0x5113aa[_0x3761('0x31')]=_[_0x3761('0x32')](_0x11b6e9[_0x3761('0x31')]);_0x5113aa[_0x3761('0x3d')]=_[_0x3761('0x33')](_0x5113aa['model'],_0x5113aa['query']);_0x4510f5[_0x3761('0x35')]=_[_0x3761('0x33')](_0x5113aa[_0x3761('0x34')],qs[_0x3761('0x36')](_0x11b6e9[_0x3761('0x31')][_0x3761('0x36')]));_0x4510f5[_0x3761('0x35')]=_0x4510f5[_0x3761('0x35')][_0x3761('0x37')]?_0x4510f5[_0x3761('0x35')]:_0x5113aa[_0x3761('0x34')];_0x4510f5[_0x3761('0x4d')]=qs[_0x3761('0x3a')](_0x11b6e9[_0x3761('0x31')][_0x3761('0x3a')]);_0x4510f5[_0x3761('0x3b')]=qs[_0x3761('0x3d')](_[_0x3761('0x3c')](_0x11b6e9[_0x3761('0x31')],_0x5113aa['filters']));if(_0x11b6e9[_0x3761('0x31')]['filter']){_0x4510f5[_0x3761('0x3b')]=_['merge'](_0x4510f5[_0x3761('0x3b')],{'$or':_[_0x3761('0x30')](_0x4510f5['attributes'],function(_0x4b5d2f){var _0x29722c={};_0x29722c[_0x4b5d2f]={'$like':'%'+_0x11b6e9['query'][_0x3761('0x3e')]+'%'};return _0x29722c;})});}_0x4510f5=_[_0x3761('0x3f')]({},_0x4510f5,_0x11b6e9[_0x3761('0x47')]);return _0x47099d[_0x3761('0x4e')](_0x4510f5);}})[_0x3761('0x42')](function(_0x2bac0b){if(_0x2bac0b){_0xa92770=_0x2bac0b['length'];if(!_0x11b6e9[_0x3761('0x31')]['hasOwnProperty']('nolimit')){_0x4510f5[_0x3761('0x1f')]=qs[_0x3761('0x1f')](_0x11b6e9[_0x3761('0x31')]['limit']);_0x4510f5['offset']=qs[_0x3761('0x1d')](_0x11b6e9[_0x3761('0x31')]['offset']);}return _0x47099d[_0x3761('0x4e')](_0x4510f5);}})[_0x3761('0x42')](function(_0x2ef8df){if(_0x2ef8df){return _0x2ef8df?{'count':_0xa92770,'rows':_0x2ef8df}:null;}})['then'](respondWithResult(_0x5f01dc,null))[_0x3761('0x44')](handleError(_0x5f01dc,null));};exports[_0x3761('0x4f')]=function(_0x343db4,_0x5abbdd,_0x74b56b){if(_0x343db4[_0x3761('0x4a')]['id']){delete _0x343db4[_0x3761('0x4a')]['id'];}return db[_0x3761('0x2b')][_0x3761('0x4c')]({'where':{'id':_0x343db4[_0x3761('0x46')]['id']}})[_0x3761('0x42')](handleEntityNotFound(_0x5abbdd,null))['then'](function(_0x32c59e){if(_0x32c59e){_0x343db4[_0x3761('0x4a')][_0x3761('0x50')]=_0x32c59e['id'];_0x343db4[_0x3761('0x4a')][_0x3761('0x51')]=integrations[_0x3761('0x52')](_0x343db4[_0x3761('0x4a')][_0x3761('0x53')],_0x343db4[_0x3761('0x4a')]['type']);_0x343db4[_0x3761('0x4a')][_0x3761('0x54')]=integrations[_0x3761('0x55')](_0x343db4[_0x3761('0x4a')][_0x3761('0x53')],_0x343db4[_0x3761('0x4a')][_0x3761('0x2e')]);return db[_0x3761('0x56')][_0x3761('0x49')](_0x343db4[_0x3761('0x4a')],{'include':[{'model':db[_0x3761('0x57')],'as':_0x3761('0x51')},{'model':db[_0x3761('0x57')],'as':_0x3761('0x54')}]});}return null;})['then'](respondWithResult(_0x5abbdd,null))[_0x3761('0x44')](handleError(_0x5abbdd,null));};exports[_0x3761('0x58')]=function(_0xe12d7e,_0x4c0fd9,_0x1989f9){var _0x906b56='';var _0x10e7cb='';return db['FreshsalesAccount'][_0x3761('0x4c')]({'where':{'id':_0xe12d7e[_0x3761('0x46')]['id']},'attributes':['id',_0x3761('0x59'),_0x3761('0x5a'),'apiKey']})[_0x3761('0x42')](handleEntityNotFound(_0x4c0fd9,null))[_0x3761('0x42')](function(_0x4d4327){if(_0x4d4327){_0x10e7cb=_0x4d4327[_0x3761('0x59')];_0x906b56=_0x4d4327[_0x3761('0x5a')];var _0x20de3f=_0x4d4327[_0x3761('0x5a')]['slice'](-0x1);if(_0x20de3f==='/'){_0x906b56=_0x906b56['substring'](0x0,_0x906b56['lastIndexOf'](_0x20de3f));}return rp({'method':_0x3761('0x5b'),'uri':util['format'](_0x3761('0x5c'),_0x906b56,_0x3761('0x5d')),'headers':{'Authorization':_0x3761('0x5e')+_0x4d4327[_0x3761('0x5f')]},'json':!![]});}})['then'](function(_0x1c6f26){if(_0x1c6f26){var _0x2d8ac3=_0x1c6f26[_0x3761('0x60')];var _0x3fdc43=![];var _0x2c4ea7=null;for(_0x2c4ea7=0x0;_0x2c4ea7<_0x2d8ac3[_0x3761('0x37')];_0x2c4ea7++){if(_0x2d8ac3[_0x2c4ea7][_0x3761('0x61')]===_0x10e7cb){_0x3fdc43=!![];}}if(_0x3fdc43){return!![];}else{throw new Error({'statusCode':0x194,'message':_0x3761('0x62')});}}})[_0x3761('0x42')](respondWithResult(_0x4c0fd9,null))[_0x3761('0x44')](function(_0x5803a3){var _0x266a16=_0xe12d7e[_0x3761('0x31')]['test']?0x1f4:_0x5803a3[_0x3761('0x63')]||0x1f4;logger[_0x3761('0x26')](_0x3761('0x64'),_0x3761('0x58'),_0x266a16,JSON[_0x3761('0x65')](_0x5803a3));delete _0x5803a3[_0x3761('0x28')];if(_0x266a16===0x191){_0x266a16=0x190;}_0x4c0fd9[_0x3761('0x21')](_0x266a16)[_0x3761('0x29')](_0xe12d7e[_0x3761('0x31')]['test']?{'message':_0x3761('0x66'),'statusCode':_0x5803a3[_0x3761('0x63')]}:_0x5803a3);});}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js index e859c9a..13d4666 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 _0x90b1=['define','FreshsalesAccount','int_freshsales_accounts','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x90b1,0x1bb));var _0x190b=function(_0x9de67e,_0x17f767){_0x9de67e=_0x9de67e-0x0;var _0x317287=_0x90b1[_0x9de67e];return _0x317287;};'use strict';var _=require(_0x190b('0x0'));var util=require(_0x190b('0x1'));var logger=require(_0x190b('0x2'))('api');var moment=require('moment');var BPromise=require(_0x190b('0x3'));var rp=require(_0x190b('0x4'));var fs=require('fs');var path=require(_0x190b('0x5'));var rimraf=require(_0x190b('0x6'));var config=require('../../config/environment');var attributes=require('./intFreshsalesAccount.attributes');var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x27ff8c,_0x34a689){return _0x27ff8c[_0x190b('0x7')](_0x190b('0x8'),attributes,{'tableName':_0x190b('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfb11=['lodash','../../config/logger','api','bluebird','path','../../config/environment','./intFreshsalesAccount.attributes','exports','define','FreshsalesAccount','int_freshsales_accounts'];(function(_0x40fe05,_0x5d720c){var _0x5aa791=function(_0x19d710){while(--_0x19d710){_0x40fe05['push'](_0x40fe05['shift']());}};_0x5aa791(++_0x5d720c);}(_0xfb11,0x1ad));var _0x1fb1=function(_0xbb091,_0x3fe7ee){_0xbb091=_0xbb091-0x0;var _0x467a04=_0xfb11[_0xbb091];return _0x467a04;};'use strict';var _=require(_0x1fb1('0x0'));var util=require('util');var logger=require(_0x1fb1('0x1'))(_0x1fb1('0x2'));var moment=require('moment');var BPromise=require(_0x1fb1('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1fb1('0x4'));var rimraf=require('rimraf');var config=require(_0x1fb1('0x5'));var attributes=require(_0x1fb1('0x6'));var integrations=require('../../components/integrations/configuration');module[_0x1fb1('0x7')]=function(_0x133727,_0x4c098d){return _0x133727[_0x1fb1('0x8')](_0x1fb1('0x9'),attributes,{'tableName':_0x1fb1('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.rpc.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.rpc.js index 9e7a5b4..c1ee2a6 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 _0x1967=['../../config/environment','client','http','request','then','info','FreshsalesAccount,\x20%s,\x20%s','FreshsalesAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetFreshsalesAccount','FreshsalesAccount','findAll','options','raw','where','limit','include','map','model','attributes','ShowFreshsalesAccount','find','debug','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x1062d3,_0x9e45b7){var _0x3ac68c=function(_0x745c97){while(--_0x745c97){_0x1062d3['push'](_0x1062d3['shift']());}};_0x3ac68c(++_0x9e45b7);}(_0x1967,0x173));var _0x7196=function(_0x39f8d2,_0x12173f){_0x39f8d2=_0x39f8d2-0x0;var _0x36ada5=_0x1967[_0x39f8d2];return _0x36ada5;};'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);});});}exports[_0x7196('0x18')]=function(_0x32fe2b){var _0x385f2d=this;return new Promise(function(_0x5b716a,_0x4c4f91){return db[_0x7196('0x19')][_0x7196('0x1a')]({'raw':_0x32fe2b[_0x7196('0x1b')]?_0x32fe2b['options'][_0x7196('0x1c')]===undefined?!![]:![]:!![],'where':_0x32fe2b['options']?_0x32fe2b['options'][_0x7196('0x1d')]||null:null,'attributes':_0x32fe2b[_0x7196('0x1b')]?_0x32fe2b[_0x7196('0x1b')]['attributes']||null:null,'limit':_0x32fe2b['options']?_0x32fe2b[_0x7196('0x1b')][_0x7196('0x1e')]||null:null,'include':_0x32fe2b['options']?_0x32fe2b[_0x7196('0x1b')][_0x7196('0x1f')]?_[_0x7196('0x20')](_0x32fe2b[_0x7196('0x1b')][_0x7196('0x1f')],function(_0x549f34){return{'model':db[_0x549f34[_0x7196('0x21')]],'as':_0x549f34['as'],'attributes':_0x549f34['attributes'],'include':_0x549f34[_0x7196('0x1f')]?_[_0x7196('0x20')](_0x549f34[_0x7196('0x1f')],function(_0xa69810){return{'model':db[_0xa69810[_0x7196('0x21')]],'as':_0xa69810['as'],'attributes':_0xa69810[_0x7196('0x22')],'include':_0xa69810['include']?_['map'](_0xa69810[_0x7196('0x1f')],function(_0x2d284f){return{'model':db[_0x2d284f[_0x7196('0x21')]],'as':_0x2d284f['as'],'attributes':_0x2d284f['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x41cfd2){logger[_0x7196('0xe')](_0x7196('0x18'),_0x32fe2b);logger['debug'](_0x7196('0x18'),_0x32fe2b,JSON['stringify'](_0x41cfd2));_0x5b716a(_0x41cfd2);})[_0x7196('0x17')](function(_0x59d79d){logger[_0x7196('0x13')](_0x7196('0x18'),_0x59d79d[_0x7196('0x15')],_0x32fe2b);_0x4c4f91(_0x385f2d['error'](0x1f4,_0x59d79d[_0x7196('0x15')]));});});};exports[_0x7196('0x23')]=function(_0x2f9583){var _0xf999e9=this;return new Promise(function(_0x50c386,_0x39710d){return db[_0x7196('0x19')][_0x7196('0x24')]({'raw':_0x2f9583[_0x7196('0x1b')]?_0x2f9583[_0x7196('0x1b')][_0x7196('0x1c')]===undefined?!![]:![]:!![],'where':_0x2f9583[_0x7196('0x1b')]?_0x2f9583[_0x7196('0x1b')][_0x7196('0x1d')]||null:null,'attributes':_0x2f9583[_0x7196('0x1b')]?_0x2f9583[_0x7196('0x1b')]['attributes']||null:null,'include':_0x2f9583[_0x7196('0x1b')]?_0x2f9583['options'][_0x7196('0x1f')]?_['map'](_0x2f9583[_0x7196('0x1b')][_0x7196('0x1f')],function(_0x5616ed){return{'model':db[_0x5616ed[_0x7196('0x21')]],'as':_0x5616ed['as'],'attributes':_0x5616ed[_0x7196('0x22')],'include':_0x5616ed[_0x7196('0x1f')]?_[_0x7196('0x20')](_0x5616ed[_0x7196('0x1f')],function(_0x4a8580){return{'model':db[_0x4a8580[_0x7196('0x21')]],'as':_0x4a8580['as'],'attributes':_0x4a8580[_0x7196('0x22')],'include':_0x4a8580[_0x7196('0x1f')]?_[_0x7196('0x20')](_0x4a8580[_0x7196('0x1f')],function(_0x123cad){return{'model':db[_0x123cad['model']],'as':_0x123cad['as'],'attributes':_0x123cad[_0x7196('0x22')]};}):[]};}):[]};}):[]:[]})[_0x7196('0xd')](function(_0x191df2){logger['info'](_0x7196('0x23'),_0x2f9583);logger[_0x7196('0x25')](_0x7196('0x23'),_0x2f9583,JSON[_0x7196('0x12')](_0x191df2));_0x50c386(_0x191df2);})[_0x7196('0x17')](function(_0x31fca7){logger[_0x7196('0x13')](_0x7196('0x23'),_0x31fca7[_0x7196('0x15')],_0x2f9583);_0x39710d(_0xf999e9[_0x7196('0x13')](0x1f4,_0x31fca7['message']));});});}; \ No newline at end of file +var _0x6050=['debug','FreshsalesAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','GetFreshsalesAccount','FreshsalesAccount','findAll','options','where','attributes','limit','map','include','model','ShowFreshsalesAccount','find','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','http','request','then','FreshsalesAccount,\x20%s,\x20%s','request\x20sent'];(function(_0x29c514,_0x132737){var _0x5bee1a=function(_0x2a453e){while(--_0x2a453e){_0x29c514['push'](_0x29c514['shift']());}};_0x5bee1a(++_0x132737);}(_0x6050,0x196));var _0x0605=function(_0x2d90e2,_0xe7c912){_0x2d90e2=_0x2d90e2-0x0;var _0x2a5d84=_0x6050[_0x2d90e2];return _0x2a5d84;};'use strict';var _=require(_0x0605('0x0'));var util=require(_0x0605('0x1'));var moment=require(_0x0605('0x2'));var BPromise=require(_0x0605('0x3'));var rs=require(_0x0605('0x4'));var fs=require('fs');var Redis=require(_0x0605('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x0605('0x6'));var logger=require(_0x0605('0x7'))(_0x0605('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x0605('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x578623,_0x58f7d2,_0x5660ad){return new BPromise(function(_0x1629bf,_0x11b8b5){return client[_0x0605('0xa')](_0x578623,_0x5660ad)[_0x0605('0xb')](function(_0x44fdd3){logger['info'](_0x0605('0xc'),_0x58f7d2,_0x0605('0xd'));logger[_0x0605('0xe')](_0x0605('0xf'),_0x58f7d2,_0x0605('0xd'),JSON[_0x0605('0x10')](_0x44fdd3));if(_0x44fdd3[_0x0605('0x11')]){if(_0x44fdd3[_0x0605('0x11')][_0x0605('0x12')]===0x1f4){logger[_0x0605('0x11')](_0x0605('0xc'),_0x58f7d2,_0x44fdd3[_0x0605('0x11')][_0x0605('0x13')]);return _0x11b8b5(_0x44fdd3[_0x0605('0x11')][_0x0605('0x13')]);}logger[_0x0605('0x11')](_0x0605('0xc'),_0x58f7d2,_0x44fdd3[_0x0605('0x11')][_0x0605('0x13')]);return _0x1629bf(_0x44fdd3['error'][_0x0605('0x13')]);}else{logger[_0x0605('0x14')](_0x0605('0xc'),_0x58f7d2,'request\x20sent');_0x1629bf(_0x44fdd3['result'][_0x0605('0x13')]);}})[_0x0605('0x15')](function(_0xa83443){logger[_0x0605('0x11')](_0x0605('0xc'),_0x58f7d2,_0xa83443);_0x11b8b5(_0xa83443);});});}exports[_0x0605('0x16')]=function(_0x2b7b5a){var _0x1d57ba=this;return new Promise(function(_0x193520,_0x40abb2){return db[_0x0605('0x17')][_0x0605('0x18')]({'raw':_0x2b7b5a[_0x0605('0x19')]?_0x2b7b5a[_0x0605('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x2b7b5a[_0x0605('0x19')]?_0x2b7b5a[_0x0605('0x19')][_0x0605('0x1a')]||null:null,'attributes':_0x2b7b5a[_0x0605('0x19')]?_0x2b7b5a[_0x0605('0x19')][_0x0605('0x1b')]||null:null,'limit':_0x2b7b5a[_0x0605('0x19')]?_0x2b7b5a[_0x0605('0x19')][_0x0605('0x1c')]||null:null,'include':_0x2b7b5a['options']?_0x2b7b5a[_0x0605('0x19')]['include']?_[_0x0605('0x1d')](_0x2b7b5a[_0x0605('0x19')][_0x0605('0x1e')],function(_0xf182c4){return{'model':db[_0xf182c4[_0x0605('0x1f')]],'as':_0xf182c4['as'],'attributes':_0xf182c4[_0x0605('0x1b')],'include':_0xf182c4[_0x0605('0x1e')]?_[_0x0605('0x1d')](_0xf182c4[_0x0605('0x1e')],function(_0x2896d7){return{'model':db[_0x2896d7[_0x0605('0x1f')]],'as':_0x2896d7['as'],'attributes':_0x2896d7[_0x0605('0x1b')],'include':_0x2896d7['include']?_[_0x0605('0x1d')](_0x2896d7[_0x0605('0x1e')],function(_0x4b1e0c){return{'model':db[_0x4b1e0c['model']],'as':_0x4b1e0c['as'],'attributes':_0x4b1e0c['attributes']};}):[]};}):[]};}):[]:[]})[_0x0605('0xb')](function(_0x226825){logger[_0x0605('0x14')](_0x0605('0x16'),_0x2b7b5a);logger[_0x0605('0xe')](_0x0605('0x16'),_0x2b7b5a,JSON['stringify'](_0x226825));_0x193520(_0x226825);})[_0x0605('0x15')](function(_0x5daef6){logger[_0x0605('0x11')](_0x0605('0x16'),_0x5daef6[_0x0605('0x13')],_0x2b7b5a);_0x40abb2(_0x1d57ba[_0x0605('0x11')](0x1f4,_0x5daef6[_0x0605('0x13')]));});});};exports[_0x0605('0x20')]=function(_0x56dd1a){var _0x165a0c=this;return new Promise(function(_0xf885cc,_0x2764b6){return db[_0x0605('0x17')][_0x0605('0x21')]({'raw':_0x56dd1a[_0x0605('0x19')]?_0x56dd1a[_0x0605('0x19')][_0x0605('0x22')]===undefined?!![]:![]:!![],'where':_0x56dd1a[_0x0605('0x19')]?_0x56dd1a[_0x0605('0x19')][_0x0605('0x1a')]||null:null,'attributes':_0x56dd1a[_0x0605('0x19')]?_0x56dd1a[_0x0605('0x19')][_0x0605('0x1b')]||null:null,'include':_0x56dd1a[_0x0605('0x19')]?_0x56dd1a[_0x0605('0x19')][_0x0605('0x1e')]?_[_0x0605('0x1d')](_0x56dd1a[_0x0605('0x19')][_0x0605('0x1e')],function(_0x3a1c75){return{'model':db[_0x3a1c75[_0x0605('0x1f')]],'as':_0x3a1c75['as'],'attributes':_0x3a1c75[_0x0605('0x1b')],'include':_0x3a1c75[_0x0605('0x1e')]?_[_0x0605('0x1d')](_0x3a1c75[_0x0605('0x1e')],function(_0xe7701d){return{'model':db[_0xe7701d['model']],'as':_0xe7701d['as'],'attributes':_0xe7701d[_0x0605('0x1b')],'include':_0xe7701d[_0x0605('0x1e')]?_['map'](_0xe7701d[_0x0605('0x1e')],function(_0x128428){return{'model':db[_0x128428['model']],'as':_0x128428['as'],'attributes':_0x128428[_0x0605('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x0605('0xb')](function(_0x239e8f){logger[_0x0605('0x14')](_0x0605('0x20'),_0x56dd1a);logger[_0x0605('0xe')]('ShowFreshsalesAccount',_0x56dd1a,JSON['stringify'](_0x239e8f));_0xf885cc(_0x239e8f);})[_0x0605('0x15')](function(_0x18f7f2){logger[_0x0605('0x11')]('ShowFreshsalesAccount',_0x18f7f2[_0x0605('0x13')],_0x56dd1a);_0x2764b6(_0x165a0c['error'](0x1f4,_0x18f7f2[_0x0605('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/index.js b/server/api/intFreshsalesConfiguration/index.js index e5e5067..6917573 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 _0xc62a=['exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesConfiguration.controller','get','isAuthenticated','/:id','show','/:id/descriptions','getDescriptions','getFields','post','create','put','update','delete','destroy'];(function(_0x276cef,_0x33827d){var _0x272ed7=function(_0x1a8c21){while(--_0x1a8c21){_0x276cef['push'](_0x276cef['shift']());}};_0x272ed7(++_0x33827d);}(_0xc62a,0x19f));var _0xac62=function(_0x3f3c57,_0x339d65){_0x3f3c57=_0x3f3c57-0x0;var _0x33fcac=_0xc62a[_0x3f3c57];return _0x33fcac;};'use strict';var multer=require(_0xac62('0x0'));var util=require('util');var path=require(_0xac62('0x1'));var timeout=require(_0xac62('0x2'));var express=require('express');var router=express[_0xac62('0x3')]();var fs_extra=require(_0xac62('0x4'));var auth=require(_0xac62('0x5'));var interaction=require(_0xac62('0x6'));var config=require(_0xac62('0x7'));var controller=require(_0xac62('0x8'));router[_0xac62('0x9')]('/',auth[_0xac62('0xa')](),controller['index']);router[_0xac62('0x9')](_0xac62('0xb'),auth[_0xac62('0xa')](),controller[_0xac62('0xc')]);router['get']('/:id/subjects',auth[_0xac62('0xa')](),controller['getSubjects']);router[_0xac62('0x9')](_0xac62('0xd'),auth[_0xac62('0xa')](),controller[_0xac62('0xe')]);router[_0xac62('0x9')]('/:id/fields',auth[_0xac62('0xa')](),controller[_0xac62('0xf')]);router[_0xac62('0x10')]('/',auth['isAuthenticated'](),controller[_0xac62('0x11')]);router[_0xac62('0x12')](_0xac62('0xb'),auth[_0xac62('0xa')](),controller[_0xac62('0x13')]);router[_0xac62('0x14')](_0xac62('0xb'),auth['isAuthenticated'](),controller[_0xac62('0x15')]);module[_0xac62('0x16')]=router; \ No newline at end of file +var _0xae13=['put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/subjects','getSubjects','/:id/fields','getFields','post','create'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xae13,0xfe));var _0x3ae1=function(_0x589ed8,_0x8739b4){_0x589ed8=_0x589ed8-0x0;var _0x28db2c=_0xae13[_0x589ed8];return _0x28db2c;};'use strict';var multer=require(_0x3ae1('0x0'));var util=require(_0x3ae1('0x1'));var path=require(_0x3ae1('0x2'));var timeout=require(_0x3ae1('0x3'));var express=require(_0x3ae1('0x4'));var router=express[_0x3ae1('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x3ae1('0x6'));var interaction=require(_0x3ae1('0x7'));var config=require(_0x3ae1('0x8'));var controller=require(_0x3ae1('0x9'));router[_0x3ae1('0xa')]('/',auth[_0x3ae1('0xb')](),controller[_0x3ae1('0xc')]);router['get'](_0x3ae1('0xd'),auth[_0x3ae1('0xb')](),controller[_0x3ae1('0xe')]);router[_0x3ae1('0xa')](_0x3ae1('0xf'),auth[_0x3ae1('0xb')](),controller[_0x3ae1('0x10')]);router[_0x3ae1('0xa')]('/:id/descriptions',auth['isAuthenticated'](),controller['getDescriptions']);router[_0x3ae1('0xa')](_0x3ae1('0x11'),auth['isAuthenticated'](),controller[_0x3ae1('0x12')]);router[_0x3ae1('0x13')]('/',auth[_0x3ae1('0xb')](),controller[_0x3ae1('0x14')]);router[_0x3ae1('0x15')](_0x3ae1('0xd'),auth[_0x3ae1('0xb')](),controller['update']);router[_0x3ae1('0x16')](_0x3ae1('0xd'),auth[_0x3ae1('0xb')](),controller[_0x3ae1('0x17')]);module[_0x3ae1('0x18')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js index 0b2d4e0..00db715 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 _0xe8b7=['exports','STRING'];(function(_0x515e9b,_0x403d31){var _0x450d89=function(_0x4c3c2a){while(--_0x4c3c2a){_0x515e9b['push'](_0x515e9b['shift']());}};_0x450d89(++_0x403d31);}(_0xe8b7,0x174));var _0x7e8b=function(_0x59c846,_0x35e527){_0x59c846=_0x59c846-0x0;var _0x218c1c=_0xe8b7[_0x59c846];return _0x218c1c;};'use strict';var Sequelize=require('sequelize');module[_0x7e8b('0x0')]={'name':{'type':Sequelize[_0x7e8b('0x1')]},'description':{'type':Sequelize[_0x7e8b('0x1')]}}; \ No newline at end of file +var _0x37d3=['exports','STRING'];(function(_0x33aa96,_0x50354f){var _0x1abf8c=function(_0x1fcd91){while(--_0x1fcd91){_0x33aa96['push'](_0x33aa96['shift']());}};_0x1abf8c(++_0x50354f);}(_0x37d3,0x64));var _0x337d=function(_0x1dbcb4,_0xbdcee0){_0x1dbcb4=_0x1dbcb4-0x0;var _0x28c086=_0x37d3[_0x1dbcb4];return _0x28c086;};'use strict';var Sequelize=require('sequelize');module[_0x337d('0x0')]={'name':{'type':Sequelize[_0x337d('0x1')]},'description':{'type':Sequelize[_0x337d('0x1')]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js index a5109b9..7e6df80 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 _0x6258=['FreshsalesConfiguration','rawAttributes','fieldName','type','key','model','query','intersection','attributes','fields','hasOwnProperty','nolimit','where','pick','filters','filter','merge','VIRTUAL','options','includeAll','include','catch','show','params','keys','length','create','body','update','find','getSubjects','findOne','FreshsalesField','order','getDescriptions','sort','getFields','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','then','error','name','send','index','map'];(function(_0x47636c,_0x2fec7e){var _0x5642e5=function(_0x55b60e){while(--_0x55b60e){_0x47636c['push'](_0x47636c['shift']());}};_0x5642e5(++_0x2fec7e);}(_0x6258,0x151));var _0x8625=function(_0x23f935,_0x6c00ab){_0x23f935=_0x23f935-0x0;var _0x145b5a=_0x6258[_0x23f935];return _0x145b5a;};'use strict';var emlformat=require(_0x8625('0x0'));var rimraf=require(_0x8625('0x1'));var zipdir=require(_0x8625('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8625('0x3'));var moment=require(_0x8625('0x4'));var BPromise=require(_0x8625('0x5'));var Mustache=require('mustache');var util=require(_0x8625('0x6'));var path=require('path');var sox=require(_0x8625('0x7'));var csv=require(_0x8625('0x8'));var ejs=require(_0x8625('0x9'));var fs=require('fs');var fs_extra=require(_0x8625('0xa'));var _=require('lodash');var squel=require(_0x8625('0xb'));var crypto=require('crypto');var jsforce=require(_0x8625('0xc'));var deskjs=require(_0x8625('0xd'));var toCsv=require(_0x8625('0x8'));var querystring=require(_0x8625('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x8625('0xf'));var qs=require(_0x8625('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x8625('0x11'))(_0x8625('0x12'));var utils=require('../../config/utils');var config=require(_0x8625('0x13'));var licenseUtil=require(_0x8625('0x14'));var db=require(_0x8625('0x15'))['db'];function respondWithStatusCode(_0x1d74f2,_0x280000){_0x280000=_0x280000||0xcc;return function(_0x28e3c7){if(_0x28e3c7){return _0x1d74f2[_0x8625('0x16')](_0x280000);}return _0x1d74f2[_0x8625('0x17')](_0x280000)[_0x8625('0x18')]();};}function respondWithResult(_0x1e4ff9,_0x6a2849){_0x6a2849=_0x6a2849||0xc8;return function(_0x1bec24){if(_0x1bec24){return _0x1e4ff9[_0x8625('0x17')](_0x6a2849)[_0x8625('0x19')](_0x1bec24);}};}function respondWithFilteredResult(_0x42f5b0,_0x38dbfa){return function(_0x312393){if(_0x312393){var _0x5d5c01=typeof _0x38dbfa[_0x8625('0x1a')]===_0x8625('0x1b')&&typeof _0x38dbfa[_0x8625('0x1c')]===_0x8625('0x1b');var _0x4f6751=_0x312393[_0x8625('0x1d')];var _0x25ef87=_0x5d5c01?0x0:_0x38dbfa[_0x8625('0x1a')];var _0x64afa2=_0x5d5c01?_0x312393[_0x8625('0x1d')]:_0x38dbfa[_0x8625('0x1a')]+_0x38dbfa[_0x8625('0x1c')];var _0x116cbc;if(_0x64afa2>=_0x4f6751){_0x64afa2=_0x4f6751;_0x116cbc=0xc8;}else{_0x116cbc=0xce;}_0x42f5b0[_0x8625('0x17')](_0x116cbc);return _0x42f5b0['set'](_0x8625('0x1e'),_0x25ef87+'-'+_0x64afa2+'/'+_0x4f6751)[_0x8625('0x19')](_0x312393);}return null;};}function patchUpdates(_0x42fbb3){return function(_0xd926cc){try{jsonpatch[_0x8625('0x1f')](_0xd926cc,_0x42fbb3,!![]);}catch(_0x9d15b8){return BPromise['reject'](_0x9d15b8);}return _0xd926cc['save']();};}function saveUpdates(_0x201cfc,_0x51bbb6){return function(_0x512ddc){if(_0x512ddc){return _0x512ddc['update'](_0x201cfc)['then'](function(_0x222557){return _0x222557;});}return null;};}function removeEntity(_0x41c7a1,_0x554ed1){return function(_0x38e67b){if(_0x38e67b){return _0x38e67b['destroy']()[_0x8625('0x20')](function(){_0x41c7a1['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4a4eea,_0x44145b){return function(_0x1daab2){if(!_0x1daab2){_0x4a4eea[_0x8625('0x16')](0x194);}return _0x1daab2;};}function handleError(_0x1c2dd6,_0xf34402){_0xf34402=_0xf34402||0x1f4;return function(_0x1d6ab9){logger[_0x8625('0x21')](_0x1d6ab9['stack']);if(_0x1d6ab9[_0x8625('0x22')]){delete _0x1d6ab9['name'];}_0x1c2dd6[_0x8625('0x17')](_0xf34402)[_0x8625('0x23')](_0x1d6ab9);};}exports[_0x8625('0x24')]=function(_0x51f952,_0x3ea0db){var _0x28a909={},_0x42c6fa={},_0x358997={'count':0x0,'rows':[]};var _0x456938=_[_0x8625('0x25')](db[_0x8625('0x26')][_0x8625('0x27')],function(_0x56f1ad){return{'name':_0x56f1ad[_0x8625('0x28')],'type':_0x56f1ad[_0x8625('0x29')][_0x8625('0x2a')]};});_0x42c6fa[_0x8625('0x2b')]=_['map'](_0x456938,_0x8625('0x22'));_0x42c6fa[_0x8625('0x2c')]=_['keys'](_0x51f952[_0x8625('0x2c')]);_0x42c6fa['filters']=_[_0x8625('0x2d')](_0x42c6fa[_0x8625('0x2b')],_0x42c6fa[_0x8625('0x2c')]);_0x28a909[_0x8625('0x2e')]=_[_0x8625('0x2d')](_0x42c6fa['model'],qs[_0x8625('0x2f')](_0x51f952[_0x8625('0x2c')][_0x8625('0x2f')]));_0x28a909[_0x8625('0x2e')]=_0x28a909['attributes']['length']?_0x28a909[_0x8625('0x2e')]:_0x42c6fa['model'];if(!_0x51f952[_0x8625('0x2c')][_0x8625('0x30')](_0x8625('0x31'))){_0x28a909[_0x8625('0x1c')]=qs['limit'](_0x51f952['query']['limit']);_0x28a909[_0x8625('0x1a')]=qs[_0x8625('0x1a')](_0x51f952[_0x8625('0x2c')][_0x8625('0x1a')]);}_0x28a909['order']=qs['sort'](_0x51f952[_0x8625('0x2c')]['sort']);_0x28a909[_0x8625('0x32')]=qs['filters'](_[_0x8625('0x33')](_0x51f952[_0x8625('0x2c')],_0x42c6fa[_0x8625('0x34')]),_0x456938);if(_0x51f952[_0x8625('0x2c')][_0x8625('0x35')]){_0x28a909[_0x8625('0x32')]=_[_0x8625('0x36')](_0x28a909[_0x8625('0x32')],{'$or':_['map'](_0x456938,function(_0x1ab7b8){if(_0x1ab7b8[_0x8625('0x29')]!==_0x8625('0x37')){var _0x605ead={};_0x605ead[_0x1ab7b8[_0x8625('0x22')]]={'$like':'%'+_0x51f952[_0x8625('0x2c')][_0x8625('0x35')]+'%'};return _0x605ead;}})});}_0x28a909=_[_0x8625('0x36')]({},_0x28a909,_0x51f952[_0x8625('0x38')]);var _0x2d4943={'where':_0x28a909[_0x8625('0x32')]};return db[_0x8625('0x26')][_0x8625('0x1d')](_0x2d4943)[_0x8625('0x20')](function(_0x309765){_0x358997[_0x8625('0x1d')]=_0x309765;if(_0x51f952['query'][_0x8625('0x39')]){_0x28a909[_0x8625('0x3a')]=[{'all':!![]}];}return db['FreshsalesConfiguration']['findAll'](_0x28a909);})['then'](function(_0x11c6ac){_0x358997['rows']=_0x11c6ac;return _0x358997;})[_0x8625('0x20')](respondWithFilteredResult(_0x3ea0db,_0x28a909))[_0x8625('0x3b')](handleError(_0x3ea0db,null));};exports[_0x8625('0x3c')]=function(_0x37d774,_0x407d55){var _0x19160a={'raw':![],'where':{'id':_0x37d774[_0x8625('0x3d')]['id']}},_0x4d905b={};_0x4d905b[_0x8625('0x2b')]=_[_0x8625('0x3e')](db[_0x8625('0x26')][_0x8625('0x27')]);_0x4d905b[_0x8625('0x2c')]=_[_0x8625('0x3e')](_0x37d774['query']);_0x4d905b[_0x8625('0x34')]=_['intersection'](_0x4d905b[_0x8625('0x2b')],_0x4d905b[_0x8625('0x2c')]);_0x19160a['attributes']=_[_0x8625('0x2d')](_0x4d905b[_0x8625('0x2b')],qs[_0x8625('0x2f')](_0x37d774[_0x8625('0x2c')][_0x8625('0x2f')]));_0x19160a['attributes']=_0x19160a['attributes'][_0x8625('0x3f')]?_0x19160a[_0x8625('0x2e')]:_0x4d905b['model'];if(_0x37d774[_0x8625('0x2c')][_0x8625('0x39')]){_0x19160a[_0x8625('0x3a')]=[{'all':!![]}];}_0x19160a=_[_0x8625('0x36')]({},_0x19160a,_0x37d774['options']);return db[_0x8625('0x26')]['find'](_0x19160a)['then'](handleEntityNotFound(_0x407d55,null))['then'](respondWithResult(_0x407d55,null))[_0x8625('0x3b')](handleError(_0x407d55,null));};exports['create']=function(_0x4d795b,_0x453bcb){return db['FreshsalesConfiguration'][_0x8625('0x40')](_0x4d795b[_0x8625('0x41')],{})[_0x8625('0x20')](respondWithResult(_0x453bcb,0xc9))[_0x8625('0x3b')](handleError(_0x453bcb,null));};exports[_0x8625('0x42')]=function(_0x557d2c,_0xfab1bb){if(_0x557d2c['body']['id']){delete _0x557d2c[_0x8625('0x41')]['id'];}return db[_0x8625('0x26')][_0x8625('0x43')]({'where':{'id':_0x557d2c['params']['id']}})[_0x8625('0x20')](handleEntityNotFound(_0xfab1bb,null))[_0x8625('0x20')](saveUpdates(_0x557d2c[_0x8625('0x41')],null))[_0x8625('0x20')](respondWithResult(_0xfab1bb,null))[_0x8625('0x3b')](handleError(_0xfab1bb,null));};exports['destroy']=function(_0xbda2b1,_0x3010cf){return db[_0x8625('0x26')][_0x8625('0x43')]({'where':{'id':_0xbda2b1['params']['id']}})['then'](handleEntityNotFound(_0x3010cf,null))[_0x8625('0x20')](removeEntity(_0x3010cf,null))[_0x8625('0x3b')](handleError(_0x3010cf,null));};exports[_0x8625('0x44')]=function(_0x9f76fc,_0x451c90,_0x3bbc77){var _0xabe04={};var _0x6c2a9={};var _0x9c0708;var _0x4f926a;return db[_0x8625('0x26')][_0x8625('0x45')]({'where':{'id':_0x9f76fc['params']['id']}})[_0x8625('0x20')](handleEntityNotFound(_0x451c90,null))['then'](function(_0xee725){if(_0xee725){_0x9c0708=_0xee725;_0x6c2a9['model']=_['keys'](db[_0x8625('0x46')][_0x8625('0x27')]);_0x6c2a9[_0x8625('0x2c')]=_[_0x8625('0x3e')](_0x9f76fc[_0x8625('0x2c')]);_0x6c2a9[_0x8625('0x34')]=_[_0x8625('0x2d')](_0x6c2a9[_0x8625('0x2b')],_0x6c2a9['query']);_0xabe04[_0x8625('0x2e')]=_[_0x8625('0x2d')](_0x6c2a9[_0x8625('0x2b')],qs[_0x8625('0x2f')](_0x9f76fc[_0x8625('0x2c')][_0x8625('0x2f')]));_0xabe04['attributes']=_0xabe04[_0x8625('0x2e')][_0x8625('0x3f')]?_0xabe04[_0x8625('0x2e')]:_0x6c2a9[_0x8625('0x2b')];_0xabe04[_0x8625('0x47')]=qs['sort'](_0x9f76fc[_0x8625('0x2c')]['sort']);_0xabe04['where']=qs[_0x8625('0x34')](_[_0x8625('0x33')](_0x9f76fc[_0x8625('0x2c')],_0x6c2a9[_0x8625('0x34')]));if(_0x9f76fc[_0x8625('0x2c')][_0x8625('0x35')]){_0xabe04['where']=_[_0x8625('0x36')](_0xabe04[_0x8625('0x32')],{'$or':_[_0x8625('0x25')](_0xabe04['attributes'],function(_0x28f13a){var _0x3d21fc={};_0x3d21fc[_0x28f13a]={'$like':'%'+_0x9f76fc[_0x8625('0x2c')][_0x8625('0x35')]+'%'};return _0x3d21fc;})});}_0xabe04=_[_0x8625('0x36')]({},_0xabe04,_0x9f76fc[_0x8625('0x38')]);return _0x9c0708[_0x8625('0x44')](_0xabe04);}})[_0x8625('0x20')](function(_0x424de8){if(_0x424de8){_0x4f926a=_0x424de8[_0x8625('0x3f')];if(!_0x9f76fc[_0x8625('0x2c')]['hasOwnProperty'](_0x8625('0x31'))){_0xabe04['limit']=qs['limit'](_0x9f76fc[_0x8625('0x2c')][_0x8625('0x1c')]);_0xabe04['offset']=qs[_0x8625('0x1a')](_0x9f76fc[_0x8625('0x2c')][_0x8625('0x1a')]);}return _0x9c0708[_0x8625('0x44')](_0xabe04);}})[_0x8625('0x20')](function(_0x1251db){if(_0x1251db){return _0x1251db?{'count':_0x4f926a,'rows':_0x1251db}:null;}})[_0x8625('0x20')](respondWithResult(_0x451c90,null))['catch'](handleError(_0x451c90,null));};exports[_0x8625('0x48')]=function(_0x210468,_0x17c815,_0x38198b){var _0x1c4711={};var _0x51cc49={};var _0x1cd6d2;var _0x509764;return db[_0x8625('0x26')][_0x8625('0x45')]({'where':{'id':_0x210468[_0x8625('0x3d')]['id']}})[_0x8625('0x20')](handleEntityNotFound(_0x17c815,null))['then'](function(_0x3838a6){if(_0x3838a6){_0x1cd6d2=_0x3838a6;_0x51cc49[_0x8625('0x2b')]=_[_0x8625('0x3e')](db[_0x8625('0x46')][_0x8625('0x27')]);_0x51cc49[_0x8625('0x2c')]=_['keys'](_0x210468[_0x8625('0x2c')]);_0x51cc49[_0x8625('0x34')]=_[_0x8625('0x2d')](_0x51cc49[_0x8625('0x2b')],_0x51cc49[_0x8625('0x2c')]);_0x1c4711['attributes']=_[_0x8625('0x2d')](_0x51cc49[_0x8625('0x2b')],qs[_0x8625('0x2f')](_0x210468[_0x8625('0x2c')][_0x8625('0x2f')]));_0x1c4711[_0x8625('0x2e')]=_0x1c4711[_0x8625('0x2e')][_0x8625('0x3f')]?_0x1c4711[_0x8625('0x2e')]:_0x51cc49[_0x8625('0x2b')];_0x1c4711[_0x8625('0x47')]=qs[_0x8625('0x49')](_0x210468[_0x8625('0x2c')][_0x8625('0x49')]);_0x1c4711[_0x8625('0x32')]=qs[_0x8625('0x34')](_['pick'](_0x210468[_0x8625('0x2c')],_0x51cc49[_0x8625('0x34')]));if(_0x210468[_0x8625('0x2c')][_0x8625('0x35')]){_0x1c4711[_0x8625('0x32')]=_[_0x8625('0x36')](_0x1c4711[_0x8625('0x32')],{'$or':_['map'](_0x1c4711[_0x8625('0x2e')],function(_0x242b58){var _0x47d106={};_0x47d106[_0x242b58]={'$like':'%'+_0x210468['query'][_0x8625('0x35')]+'%'};return _0x47d106;})});}_0x1c4711=_[_0x8625('0x36')]({},_0x1c4711,_0x210468[_0x8625('0x38')]);return _0x1cd6d2[_0x8625('0x48')](_0x1c4711);}})[_0x8625('0x20')](function(_0x448d6c){if(_0x448d6c){_0x509764=_0x448d6c[_0x8625('0x3f')];if(!_0x210468['query'][_0x8625('0x30')](_0x8625('0x31'))){_0x1c4711[_0x8625('0x1c')]=qs[_0x8625('0x1c')](_0x210468['query'][_0x8625('0x1c')]);_0x1c4711['offset']=qs['offset'](_0x210468[_0x8625('0x2c')][_0x8625('0x1a')]);}return _0x1cd6d2[_0x8625('0x48')](_0x1c4711);}})[_0x8625('0x20')](function(_0x2fa471){if(_0x2fa471){return _0x2fa471?{'count':_0x509764,'rows':_0x2fa471}:null;}})[_0x8625('0x20')](respondWithResult(_0x17c815,null))[_0x8625('0x3b')](handleError(_0x17c815,null));};exports['getFields']=function(_0x290319,_0x33b16f,_0xb68849){var _0x5261c9={};var _0x5409b5={};var _0x47384f;var _0x1b9da0;return db[_0x8625('0x26')][_0x8625('0x45')]({'where':{'id':_0x290319[_0x8625('0x3d')]['id']}})[_0x8625('0x20')](handleEntityNotFound(_0x33b16f,null))[_0x8625('0x20')](function(_0x368e4b){if(_0x368e4b){_0x47384f=_0x368e4b;_0x5409b5[_0x8625('0x2b')]=_[_0x8625('0x3e')](db[_0x8625('0x46')][_0x8625('0x27')]);_0x5409b5['query']=_[_0x8625('0x3e')](_0x290319[_0x8625('0x2c')]);_0x5409b5[_0x8625('0x34')]=_[_0x8625('0x2d')](_0x5409b5['model'],_0x5409b5[_0x8625('0x2c')]);_0x5261c9[_0x8625('0x2e')]=_['intersection'](_0x5409b5[_0x8625('0x2b')],qs['fields'](_0x290319[_0x8625('0x2c')][_0x8625('0x2f')]));_0x5261c9[_0x8625('0x2e')]=_0x5261c9['attributes'][_0x8625('0x3f')]?_0x5261c9[_0x8625('0x2e')]:_0x5409b5[_0x8625('0x2b')];_0x5261c9[_0x8625('0x47')]=qs[_0x8625('0x49')](_0x290319[_0x8625('0x2c')][_0x8625('0x49')]);_0x5261c9[_0x8625('0x32')]=qs[_0x8625('0x34')](_['pick'](_0x290319[_0x8625('0x2c')],_0x5409b5[_0x8625('0x34')]));if(_0x290319[_0x8625('0x2c')]['filter']){_0x5261c9['where']=_['merge'](_0x5261c9['where'],{'$or':_[_0x8625('0x25')](_0x5261c9[_0x8625('0x2e')],function(_0x24df5b){var _0x2d0dfa={};_0x2d0dfa[_0x24df5b]={'$like':'%'+_0x290319['query'][_0x8625('0x35')]+'%'};return _0x2d0dfa;})});}_0x5261c9=_[_0x8625('0x36')]({},_0x5261c9,_0x290319[_0x8625('0x38')]);return _0x47384f[_0x8625('0x4a')](_0x5261c9);}})[_0x8625('0x20')](function(_0xe67080){if(_0xe67080){_0x1b9da0=_0xe67080['length'];if(!_0x290319[_0x8625('0x2c')]['hasOwnProperty'](_0x8625('0x31'))){_0x5261c9[_0x8625('0x1c')]=qs[_0x8625('0x1c')](_0x290319['query'][_0x8625('0x1c')]);_0x5261c9[_0x8625('0x1a')]=qs[_0x8625('0x1a')](_0x290319['query'][_0x8625('0x1a')]);}return _0x47384f[_0x8625('0x4a')](_0x5261c9);}})['then'](function(_0x3fb641){if(_0x3fb641){return _0x3fb641?{'count':_0x1b9da0,'rows':_0x3fb641}:null;}})[_0x8625('0x20')](respondWithResult(_0x33b16f,null))['catch'](handleError(_0x33b16f,null));}; \ No newline at end of file +var _0x06bc=['rows','catch','show','params','fields','length','include','find','create','body','update','destroy','findOne','FreshsalesField','getSubjects','getDescriptions','getFields','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','error','stack','name','send','index','map','FreshsalesConfiguration','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','options','includeAll','findAll'];(function(_0x40d339,_0xb726c3){var _0x5cbd0b=function(_0xf239d3){while(--_0xf239d3){_0x40d339['push'](_0x40d339['shift']());}};_0x5cbd0b(++_0xb726c3);}(_0x06bc,0xb1));var _0xc06b=function(_0x63f7f7,_0xa3889c){_0x63f7f7=_0x63f7f7-0x0;var _0x2c4308=_0x06bc[_0x63f7f7];return _0x2c4308;};'use strict';var emlformat=require(_0xc06b('0x0'));var rimraf=require(_0xc06b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc06b('0x2'));var rp=require(_0xc06b('0x3'));var moment=require(_0xc06b('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xc06b('0x5'));var util=require(_0xc06b('0x6'));var path=require(_0xc06b('0x7'));var sox=require('sox');var csv=require(_0xc06b('0x8'));var ejs=require(_0xc06b('0x9'));var fs=require('fs');var fs_extra=require(_0xc06b('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xc06b('0xb'));var jsforce=require(_0xc06b('0xc'));var deskjs=require(_0xc06b('0xd'));var toCsv=require(_0xc06b('0x8'));var querystring=require(_0xc06b('0xe'));var Papa=require(_0xc06b('0xf'));var Redis=require(_0xc06b('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc06b('0x11'));var logger=require('../../config/logger')(_0xc06b('0x12'));var utils=require(_0xc06b('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xc06b('0x14'));var db=require(_0xc06b('0x15'))['db'];function respondWithStatusCode(_0x36f4d7,_0x106e54){_0x106e54=_0x106e54||0xcc;return function(_0x997afe){if(_0x997afe){return _0x36f4d7[_0xc06b('0x16')](_0x106e54);}return _0x36f4d7[_0xc06b('0x17')](_0x106e54)[_0xc06b('0x18')]();};}function respondWithResult(_0x27bbfa,_0xa0763f){_0xa0763f=_0xa0763f||0xc8;return function(_0x37c4ee){if(_0x37c4ee){return _0x27bbfa[_0xc06b('0x17')](_0xa0763f)[_0xc06b('0x19')](_0x37c4ee);}};}function respondWithFilteredResult(_0x2e467e,_0x18c91b){return function(_0x163db1){if(_0x163db1){var _0x3014e4=typeof _0x18c91b['offset']===_0xc06b('0x1a')&&typeof _0x18c91b['limit']===_0xc06b('0x1a');var _0x136a0a=_0x163db1[_0xc06b('0x1b')];var _0x330dee=_0x3014e4?0x0:_0x18c91b[_0xc06b('0x1c')];var _0x496e4a=_0x3014e4?_0x163db1['count']:_0x18c91b['offset']+_0x18c91b[_0xc06b('0x1d')];var _0x46b250;if(_0x496e4a>=_0x136a0a){_0x496e4a=_0x136a0a;_0x46b250=0xc8;}else{_0x46b250=0xce;}_0x2e467e[_0xc06b('0x17')](_0x46b250);return _0x2e467e[_0xc06b('0x1e')](_0xc06b('0x1f'),_0x330dee+'-'+_0x496e4a+'/'+_0x136a0a)[_0xc06b('0x19')](_0x163db1);}return null;};}function patchUpdates(_0x4c84dc){return function(_0x525fe3){try{jsonpatch['apply'](_0x525fe3,_0x4c84dc,!![]);}catch(_0x490bfa){return BPromise[_0xc06b('0x20')](_0x490bfa);}return _0x525fe3[_0xc06b('0x21')]();};}function saveUpdates(_0x4cca70,_0x2c0d95){return function(_0x55da05){if(_0x55da05){return _0x55da05['update'](_0x4cca70)[_0xc06b('0x22')](function(_0x224b4e){return _0x224b4e;});}return null;};}function removeEntity(_0x39edc2,_0x5600bf){return function(_0xc09b5e){if(_0xc09b5e){return _0xc09b5e['destroy']()['then'](function(){_0x39edc2[_0xc06b('0x17')](0xcc)[_0xc06b('0x18')]();});}};}function handleEntityNotFound(_0x4f44e6,_0x4d597c){return function(_0x1dd681){if(!_0x1dd681){_0x4f44e6[_0xc06b('0x16')](0x194);}return _0x1dd681;};}function handleError(_0x10e074,_0x16a706){_0x16a706=_0x16a706||0x1f4;return function(_0x3b6f47){logger[_0xc06b('0x23')](_0x3b6f47[_0xc06b('0x24')]);if(_0x3b6f47['name']){delete _0x3b6f47[_0xc06b('0x25')];}_0x10e074[_0xc06b('0x17')](_0x16a706)[_0xc06b('0x26')](_0x3b6f47);};}exports[_0xc06b('0x27')]=function(_0x54d2ea,_0x3b11c1){var _0x282091={},_0x2c813b={},_0x46d581={'count':0x0,'rows':[]};var _0x114ea1=_[_0xc06b('0x28')](db[_0xc06b('0x29')][_0xc06b('0x2a')],function(_0x3c348c){return{'name':_0x3c348c[_0xc06b('0x2b')],'type':_0x3c348c[_0xc06b('0x2c')][_0xc06b('0x2d')]};});_0x2c813b[_0xc06b('0x2e')]=_[_0xc06b('0x28')](_0x114ea1,_0xc06b('0x25'));_0x2c813b['query']=_[_0xc06b('0x2f')](_0x54d2ea[_0xc06b('0x30')]);_0x2c813b[_0xc06b('0x31')]=_[_0xc06b('0x32')](_0x2c813b[_0xc06b('0x2e')],_0x2c813b[_0xc06b('0x30')]);_0x282091[_0xc06b('0x33')]=_['intersection'](_0x2c813b[_0xc06b('0x2e')],qs['fields'](_0x54d2ea[_0xc06b('0x30')]['fields']));_0x282091[_0xc06b('0x33')]=_0x282091[_0xc06b('0x33')]['length']?_0x282091[_0xc06b('0x33')]:_0x2c813b[_0xc06b('0x2e')];if(!_0x54d2ea[_0xc06b('0x30')][_0xc06b('0x34')](_0xc06b('0x35'))){_0x282091[_0xc06b('0x1d')]=qs['limit'](_0x54d2ea[_0xc06b('0x30')][_0xc06b('0x1d')]);_0x282091[_0xc06b('0x1c')]=qs['offset'](_0x54d2ea[_0xc06b('0x30')][_0xc06b('0x1c')]);}_0x282091[_0xc06b('0x36')]=qs[_0xc06b('0x37')](_0x54d2ea[_0xc06b('0x30')][_0xc06b('0x37')]);_0x282091['where']=qs[_0xc06b('0x31')](_[_0xc06b('0x38')](_0x54d2ea[_0xc06b('0x30')],_0x2c813b[_0xc06b('0x31')]),_0x114ea1);if(_0x54d2ea['query'][_0xc06b('0x39')]){_0x282091[_0xc06b('0x3a')]=_[_0xc06b('0x3b')](_0x282091['where'],{'$or':_[_0xc06b('0x28')](_0x114ea1,function(_0x4fba89){if(_0x4fba89[_0xc06b('0x2c')]!=='VIRTUAL'){var _0xf40baf={};_0xf40baf[_0x4fba89[_0xc06b('0x25')]]={'$like':'%'+_0x54d2ea[_0xc06b('0x30')][_0xc06b('0x39')]+'%'};return _0xf40baf;}})});}_0x282091=_[_0xc06b('0x3b')]({},_0x282091,_0x54d2ea[_0xc06b('0x3c')]);var _0x33ed86={'where':_0x282091['where']};return db['FreshsalesConfiguration'][_0xc06b('0x1b')](_0x33ed86)[_0xc06b('0x22')](function(_0x784ac9){_0x46d581[_0xc06b('0x1b')]=_0x784ac9;if(_0x54d2ea[_0xc06b('0x30')][_0xc06b('0x3d')]){_0x282091['include']=[{'all':!![]}];}return db[_0xc06b('0x29')][_0xc06b('0x3e')](_0x282091);})[_0xc06b('0x22')](function(_0x3a25e5){_0x46d581[_0xc06b('0x3f')]=_0x3a25e5;return _0x46d581;})[_0xc06b('0x22')](respondWithFilteredResult(_0x3b11c1,_0x282091))[_0xc06b('0x40')](handleError(_0x3b11c1,null));};exports[_0xc06b('0x41')]=function(_0x56a6b2,_0x465ba8){var _0x199718={'raw':![],'where':{'id':_0x56a6b2[_0xc06b('0x42')]['id']}},_0x4de386={};_0x4de386[_0xc06b('0x2e')]=_[_0xc06b('0x2f')](db[_0xc06b('0x29')][_0xc06b('0x2a')]);_0x4de386[_0xc06b('0x30')]=_['keys'](_0x56a6b2[_0xc06b('0x30')]);_0x4de386['filters']=_[_0xc06b('0x32')](_0x4de386[_0xc06b('0x2e')],_0x4de386[_0xc06b('0x30')]);_0x199718['attributes']=_[_0xc06b('0x32')](_0x4de386['model'],qs[_0xc06b('0x43')](_0x56a6b2[_0xc06b('0x30')][_0xc06b('0x43')]));_0x199718['attributes']=_0x199718[_0xc06b('0x33')][_0xc06b('0x44')]?_0x199718[_0xc06b('0x33')]:_0x4de386[_0xc06b('0x2e')];if(_0x56a6b2[_0xc06b('0x30')][_0xc06b('0x3d')]){_0x199718[_0xc06b('0x45')]=[{'all':!![]}];}_0x199718=_[_0xc06b('0x3b')]({},_0x199718,_0x56a6b2[_0xc06b('0x3c')]);return db[_0xc06b('0x29')][_0xc06b('0x46')](_0x199718)[_0xc06b('0x22')](handleEntityNotFound(_0x465ba8,null))[_0xc06b('0x22')](respondWithResult(_0x465ba8,null))[_0xc06b('0x40')](handleError(_0x465ba8,null));};exports[_0xc06b('0x47')]=function(_0x91ff9b,_0x3eb5e3){return db[_0xc06b('0x29')]['create'](_0x91ff9b[_0xc06b('0x48')],{})[_0xc06b('0x22')](respondWithResult(_0x3eb5e3,0xc9))['catch'](handleError(_0x3eb5e3,null));};exports[_0xc06b('0x49')]=function(_0x5e47be,_0x57d3f4){if(_0x5e47be[_0xc06b('0x48')]['id']){delete _0x5e47be[_0xc06b('0x48')]['id'];}return db[_0xc06b('0x29')][_0xc06b('0x46')]({'where':{'id':_0x5e47be[_0xc06b('0x42')]['id']}})['then'](handleEntityNotFound(_0x57d3f4,null))[_0xc06b('0x22')](saveUpdates(_0x5e47be[_0xc06b('0x48')],null))[_0xc06b('0x22')](respondWithResult(_0x57d3f4,null))[_0xc06b('0x40')](handleError(_0x57d3f4,null));};exports[_0xc06b('0x4a')]=function(_0x51a9da,_0x1520f2){return db['FreshsalesConfiguration'][_0xc06b('0x46')]({'where':{'id':_0x51a9da[_0xc06b('0x42')]['id']}})['then'](handleEntityNotFound(_0x1520f2,null))[_0xc06b('0x22')](removeEntity(_0x1520f2,null))[_0xc06b('0x40')](handleError(_0x1520f2,null));};exports['getSubjects']=function(_0x53c94f,_0x159982,_0x50e29d){var _0x4a09a5={};var _0x51d247={};var _0x111a49;var _0x4fbbe1;return db[_0xc06b('0x29')][_0xc06b('0x4b')]({'where':{'id':_0x53c94f[_0xc06b('0x42')]['id']}})[_0xc06b('0x22')](handleEntityNotFound(_0x159982,null))[_0xc06b('0x22')](function(_0x4e0183){if(_0x4e0183){_0x111a49=_0x4e0183;_0x51d247['model']=_['keys'](db[_0xc06b('0x4c')][_0xc06b('0x2a')]);_0x51d247[_0xc06b('0x30')]=_[_0xc06b('0x2f')](_0x53c94f[_0xc06b('0x30')]);_0x51d247[_0xc06b('0x31')]=_['intersection'](_0x51d247[_0xc06b('0x2e')],_0x51d247[_0xc06b('0x30')]);_0x4a09a5[_0xc06b('0x33')]=_[_0xc06b('0x32')](_0x51d247['model'],qs['fields'](_0x53c94f['query'][_0xc06b('0x43')]));_0x4a09a5['attributes']=_0x4a09a5[_0xc06b('0x33')]['length']?_0x4a09a5[_0xc06b('0x33')]:_0x51d247[_0xc06b('0x2e')];_0x4a09a5[_0xc06b('0x36')]=qs['sort'](_0x53c94f[_0xc06b('0x30')][_0xc06b('0x37')]);_0x4a09a5['where']=qs[_0xc06b('0x31')](_[_0xc06b('0x38')](_0x53c94f['query'],_0x51d247[_0xc06b('0x31')]));if(_0x53c94f[_0xc06b('0x30')][_0xc06b('0x39')]){_0x4a09a5[_0xc06b('0x3a')]=_[_0xc06b('0x3b')](_0x4a09a5[_0xc06b('0x3a')],{'$or':_[_0xc06b('0x28')](_0x4a09a5['attributes'],function(_0x17e648){var _0x400fad={};_0x400fad[_0x17e648]={'$like':'%'+_0x53c94f[_0xc06b('0x30')][_0xc06b('0x39')]+'%'};return _0x400fad;})});}_0x4a09a5=_[_0xc06b('0x3b')]({},_0x4a09a5,_0x53c94f[_0xc06b('0x3c')]);return _0x111a49[_0xc06b('0x4d')](_0x4a09a5);}})[_0xc06b('0x22')](function(_0x4f546f){if(_0x4f546f){_0x4fbbe1=_0x4f546f['length'];if(!_0x53c94f['query'][_0xc06b('0x34')](_0xc06b('0x35'))){_0x4a09a5[_0xc06b('0x1d')]=qs['limit'](_0x53c94f[_0xc06b('0x30')][_0xc06b('0x1d')]);_0x4a09a5['offset']=qs[_0xc06b('0x1c')](_0x53c94f[_0xc06b('0x30')]['offset']);}return _0x111a49['getSubjects'](_0x4a09a5);}})[_0xc06b('0x22')](function(_0x6cbf4c){if(_0x6cbf4c){return _0x6cbf4c?{'count':_0x4fbbe1,'rows':_0x6cbf4c}:null;}})['then'](respondWithResult(_0x159982,null))['catch'](handleError(_0x159982,null));};exports['getDescriptions']=function(_0x509343,_0x325eae,_0x59fafc){var _0x1afd08={};var _0x365ce8={};var _0x4a1a55;var _0x67f691;return db['FreshsalesConfiguration'][_0xc06b('0x4b')]({'where':{'id':_0x509343[_0xc06b('0x42')]['id']}})['then'](handleEntityNotFound(_0x325eae,null))[_0xc06b('0x22')](function(_0x3605b1){if(_0x3605b1){_0x4a1a55=_0x3605b1;_0x365ce8[_0xc06b('0x2e')]=_[_0xc06b('0x2f')](db[_0xc06b('0x4c')][_0xc06b('0x2a')]);_0x365ce8[_0xc06b('0x30')]=_['keys'](_0x509343[_0xc06b('0x30')]);_0x365ce8[_0xc06b('0x31')]=_[_0xc06b('0x32')](_0x365ce8[_0xc06b('0x2e')],_0x365ce8[_0xc06b('0x30')]);_0x1afd08[_0xc06b('0x33')]=_[_0xc06b('0x32')](_0x365ce8[_0xc06b('0x2e')],qs[_0xc06b('0x43')](_0x509343[_0xc06b('0x30')][_0xc06b('0x43')]));_0x1afd08[_0xc06b('0x33')]=_0x1afd08[_0xc06b('0x33')][_0xc06b('0x44')]?_0x1afd08[_0xc06b('0x33')]:_0x365ce8[_0xc06b('0x2e')];_0x1afd08[_0xc06b('0x36')]=qs[_0xc06b('0x37')](_0x509343[_0xc06b('0x30')]['sort']);_0x1afd08[_0xc06b('0x3a')]=qs[_0xc06b('0x31')](_[_0xc06b('0x38')](_0x509343[_0xc06b('0x30')],_0x365ce8['filters']));if(_0x509343['query'][_0xc06b('0x39')]){_0x1afd08[_0xc06b('0x3a')]=_[_0xc06b('0x3b')](_0x1afd08[_0xc06b('0x3a')],{'$or':_[_0xc06b('0x28')](_0x1afd08[_0xc06b('0x33')],function(_0x1c4e0f){var _0x1878dd={};_0x1878dd[_0x1c4e0f]={'$like':'%'+_0x509343[_0xc06b('0x30')][_0xc06b('0x39')]+'%'};return _0x1878dd;})});}_0x1afd08=_[_0xc06b('0x3b')]({},_0x1afd08,_0x509343['options']);return _0x4a1a55[_0xc06b('0x4e')](_0x1afd08);}})['then'](function(_0x2c46a5){if(_0x2c46a5){_0x67f691=_0x2c46a5[_0xc06b('0x44')];if(!_0x509343[_0xc06b('0x30')][_0xc06b('0x34')](_0xc06b('0x35'))){_0x1afd08[_0xc06b('0x1d')]=qs['limit'](_0x509343[_0xc06b('0x30')][_0xc06b('0x1d')]);_0x1afd08[_0xc06b('0x1c')]=qs['offset'](_0x509343[_0xc06b('0x30')][_0xc06b('0x1c')]);}return _0x4a1a55['getDescriptions'](_0x1afd08);}})[_0xc06b('0x22')](function(_0x30d382){if(_0x30d382){return _0x30d382?{'count':_0x67f691,'rows':_0x30d382}:null;}})[_0xc06b('0x22')](respondWithResult(_0x325eae,null))[_0xc06b('0x40')](handleError(_0x325eae,null));};exports['getFields']=function(_0x55cfc4,_0x3109bf,_0x49d51c){var _0x3a6d24={};var _0x2134ad={};var _0x24fddf;var _0x8c704f;return db[_0xc06b('0x29')][_0xc06b('0x4b')]({'where':{'id':_0x55cfc4[_0xc06b('0x42')]['id']}})[_0xc06b('0x22')](handleEntityNotFound(_0x3109bf,null))[_0xc06b('0x22')](function(_0x47640f){if(_0x47640f){_0x24fddf=_0x47640f;_0x2134ad[_0xc06b('0x2e')]=_[_0xc06b('0x2f')](db[_0xc06b('0x4c')][_0xc06b('0x2a')]);_0x2134ad[_0xc06b('0x30')]=_[_0xc06b('0x2f')](_0x55cfc4[_0xc06b('0x30')]);_0x2134ad[_0xc06b('0x31')]=_['intersection'](_0x2134ad[_0xc06b('0x2e')],_0x2134ad['query']);_0x3a6d24[_0xc06b('0x33')]=_[_0xc06b('0x32')](_0x2134ad[_0xc06b('0x2e')],qs['fields'](_0x55cfc4[_0xc06b('0x30')]['fields']));_0x3a6d24[_0xc06b('0x33')]=_0x3a6d24[_0xc06b('0x33')]['length']?_0x3a6d24[_0xc06b('0x33')]:_0x2134ad[_0xc06b('0x2e')];_0x3a6d24['order']=qs[_0xc06b('0x37')](_0x55cfc4['query'][_0xc06b('0x37')]);_0x3a6d24['where']=qs[_0xc06b('0x31')](_[_0xc06b('0x38')](_0x55cfc4['query'],_0x2134ad[_0xc06b('0x31')]));if(_0x55cfc4['query'][_0xc06b('0x39')]){_0x3a6d24[_0xc06b('0x3a')]=_[_0xc06b('0x3b')](_0x3a6d24[_0xc06b('0x3a')],{'$or':_[_0xc06b('0x28')](_0x3a6d24['attributes'],function(_0x3b4295){var _0x1b0c6f={};_0x1b0c6f[_0x3b4295]={'$like':'%'+_0x55cfc4[_0xc06b('0x30')]['filter']+'%'};return _0x1b0c6f;})});}_0x3a6d24=_[_0xc06b('0x3b')]({},_0x3a6d24,_0x55cfc4[_0xc06b('0x3c')]);return _0x24fddf[_0xc06b('0x4f')](_0x3a6d24);}})[_0xc06b('0x22')](function(_0x44aabd){if(_0x44aabd){_0x8c704f=_0x44aabd['length'];if(!_0x55cfc4[_0xc06b('0x30')][_0xc06b('0x34')](_0xc06b('0x35'))){_0x3a6d24[_0xc06b('0x1d')]=qs[_0xc06b('0x1d')](_0x55cfc4[_0xc06b('0x30')][_0xc06b('0x1d')]);_0x3a6d24['offset']=qs[_0xc06b('0x1c')](_0x55cfc4[_0xc06b('0x30')]['offset']);}return _0x24fddf['getFields'](_0x3a6d24);}})[_0xc06b('0x22')](function(_0x26c24c){if(_0x26c24c){return _0x26c24c?{'count':_0x8c704f,'rows':_0x26c24c}:null;}})[_0xc06b('0x22')](respondWithResult(_0x3109bf,null))[_0xc06b('0x40')](handleError(_0x3109bf,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js index 77b2091..aa4c12f 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 _0x12f9=['int_freshsales_configurations','lodash','util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./intFreshsalesConfiguration.attributes','exports','define'];(function(_0x4257b6,_0x2348c7){var _0x4ad68c=function(_0x33a6e8){while(--_0x33a6e8){_0x4257b6['push'](_0x4257b6['shift']());}};_0x4ad68c(++_0x2348c7);}(_0x12f9,0x6d));var _0x912f=function(_0x1eafb1,_0x1ee5f4){_0x1eafb1=_0x1eafb1-0x0;var _0x25fb76=_0x12f9[_0x1eafb1];return _0x25fb76;};'use strict';var _=require(_0x912f('0x0'));var util=require(_0x912f('0x1'));var logger=require(_0x912f('0x2'))(_0x912f('0x3'));var moment=require(_0x912f('0x4'));var BPromise=require('bluebird');var rp=require(_0x912f('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x912f('0x6'));var config=require(_0x912f('0x7'));var attributes=require(_0x912f('0x8'));module[_0x912f('0x9')]=function(_0x399407,_0x491e02){return _0x399407[_0x912f('0xa')]('FreshsalesConfiguration',attributes,{'tableName':_0x912f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd2f9=['path','rimraf','../../config/environment','./intFreshsalesConfiguration.attributes','exports','define','FreshsalesConfiguration','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x1d24eb,_0x12295b){var _0x1dc576=function(_0x4d5770){while(--_0x4d5770){_0x1d24eb['push'](_0x1d24eb['shift']());}};_0x1dc576(++_0x12295b);}(_0xd2f9,0xb0));var _0x9d2f=function(_0x5e9876,_0x16052d){_0x5e9876=_0x5e9876-0x0;var _0x576c48=_0xd2f9[_0x5e9876];return _0x576c48;};'use strict';var _=require(_0x9d2f('0x0'));var util=require('util');var logger=require(_0x9d2f('0x1'))(_0x9d2f('0x2'));var moment=require(_0x9d2f('0x3'));var BPromise=require(_0x9d2f('0x4'));var rp=require(_0x9d2f('0x5'));var fs=require('fs');var path=require(_0x9d2f('0x6'));var rimraf=require(_0x9d2f('0x7'));var config=require(_0x9d2f('0x8'));var attributes=require(_0x9d2f('0x9'));module[_0x9d2f('0xa')]=function(_0x5f3794,_0x9471d3){return _0x5f3794[_0x9d2f('0xb')](_0x9d2f('0xc'),attributes,{'tableName':'int_freshsales_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.rpc.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.rpc.js index bc0391f..4aefb6c 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 _0x9664=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','request\x20sent','debug','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','FreshsalesConfiguration,\x20%s,\x20%s','message','result','lodash','util','moment','bluebird','randomstring'];(function(_0x23991f,_0x11b6cd){var _0x163c7f=function(_0x2046a0){while(--_0x2046a0){_0x23991f['push'](_0x23991f['shift']());}};_0x163c7f(++_0x11b6cd);}(_0x9664,0xc3));var _0x4966=function(_0x42ef69,_0xbac429){_0x42ef69=_0x42ef69-0x0;var _0x2e5689=_0x9664[_0x42ef69];return _0x2e5689;};'use strict';var _=require(_0x4966('0x0'));var util=require(_0x4966('0x1'));var moment=require(_0x4966('0x2'));var BPromise=require(_0x4966('0x3'));var rs=require(_0x4966('0x4'));var fs=require('fs');var Redis=require(_0x4966('0x5'));var db=require(_0x4966('0x6'))['db'];var utils=require(_0x4966('0x7'));var logger=require(_0x4966('0x8'))(_0x4966('0x9'));var config=require('../../config/environment');var jayson=require(_0x4966('0xa'));var client=jayson[_0x4966('0xb')][_0x4966('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5f0e61,_0x5d2265,_0x48b875){return new BPromise(function(_0x28ee69,_0x1bd2fe){return client[_0x4966('0xd')](_0x5f0e61,_0x48b875)[_0x4966('0xe')](function(_0x2236bd){logger[_0x4966('0xf')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x5d2265,_0x4966('0x10'));logger[_0x4966('0x11')](_0x4966('0x12'),_0x5d2265,_0x4966('0x10'),JSON[_0x4966('0x13')](_0x2236bd));if(_0x2236bd[_0x4966('0x14')]){if(_0x2236bd[_0x4966('0x14')][_0x4966('0x15')]===0x1f4){logger[_0x4966('0x14')](_0x4966('0x16'),_0x5d2265,_0x2236bd[_0x4966('0x14')][_0x4966('0x17')]);return _0x1bd2fe(_0x2236bd[_0x4966('0x14')][_0x4966('0x17')]);}logger[_0x4966('0x14')](_0x4966('0x16'),_0x5d2265,_0x2236bd[_0x4966('0x14')]['message']);return _0x28ee69(_0x2236bd[_0x4966('0x14')]['message']);}else{logger['info'](_0x4966('0x16'),_0x5d2265,_0x4966('0x10'));_0x28ee69(_0x2236bd[_0x4966('0x18')][_0x4966('0x17')]);}})['catch'](function(_0x100040){logger[_0x4966('0x14')](_0x4966('0x16'),_0x5d2265,_0x100040);_0x1bd2fe(_0x100040);});});} \ No newline at end of file +var _0xe3a5=['code','message','info','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','client','http','FreshsalesConfiguration,\x20%s,\x20%s','request\x20sent','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe3a5,0x1ba));var _0x5e3a=function(_0x3a0646,_0x2f72b6){_0x3a0646=_0x3a0646-0x0;var _0x2063d9=_0xe3a5[_0x3a0646];return _0x2063d9;};'use strict';var _=require('lodash');var util=require(_0x5e3a('0x0'));var moment=require(_0x5e3a('0x1'));var BPromise=require(_0x5e3a('0x2'));var rs=require(_0x5e3a('0x3'));var fs=require('fs');var Redis=require(_0x5e3a('0x4'));var db=require(_0x5e3a('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x5e3a('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x5e3a('0x7')][_0x5e3a('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xe1ed67,_0x2ce79a,_0x58d3b4){return new BPromise(function(_0x3ce037,_0x24c5cb){return client['request'](_0xe1ed67,_0x58d3b4)['then'](function(_0x18464e){logger['info'](_0x5e3a('0x9'),_0x2ce79a,_0x5e3a('0xa'));logger['debug'](_0x5e3a('0xb'),_0x2ce79a,'request\x20sent',JSON[_0x5e3a('0xc')](_0x18464e));if(_0x18464e[_0x5e3a('0xd')]){if(_0x18464e[_0x5e3a('0xd')][_0x5e3a('0xe')]===0x1f4){logger[_0x5e3a('0xd')](_0x5e3a('0x9'),_0x2ce79a,_0x18464e['error']['message']);return _0x24c5cb(_0x18464e[_0x5e3a('0xd')][_0x5e3a('0xf')]);}logger[_0x5e3a('0xd')](_0x5e3a('0x9'),_0x2ce79a,_0x18464e[_0x5e3a('0xd')][_0x5e3a('0xf')]);return _0x3ce037(_0x18464e['error'][_0x5e3a('0xf')]);}else{logger[_0x5e3a('0x10')](_0x5e3a('0x9'),_0x2ce79a,'request\x20sent');_0x3ce037(_0x18464e[_0x5e3a('0x11')][_0x5e3a('0xf')]);}})[_0x5e3a('0x12')](function(_0x554542){logger[_0x5e3a('0xd')](_0x5e3a('0x9'),_0x2ce79a,_0x554542);_0x24c5cb(_0x554542);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesField/index.js b/server/api/intFreshsalesField/index.js index 5282c76..5ab8919 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 _0x3eec=['post','create','put','update','delete','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesField.controller','isAuthenticated','index','get','/:id','show'];(function(_0x4b9bc6,_0x3b8547){var _0x2cc0d2=function(_0x3d1c3c){while(--_0x3d1c3c){_0x4b9bc6['push'](_0x4b9bc6['shift']());}};_0x2cc0d2(++_0x3b8547);}(_0x3eec,0x1e9));var _0xc3ee=function(_0x1cb539,_0x466a48){_0x1cb539=_0x1cb539-0x0;var _0x4179af=_0x3eec[_0x1cb539];return _0x4179af;};'use strict';var multer=require(_0xc3ee('0x0'));var util=require(_0xc3ee('0x1'));var path=require(_0xc3ee('0x2'));var timeout=require(_0xc3ee('0x3'));var express=require('express');var router=express[_0xc3ee('0x4')]();var fs_extra=require(_0xc3ee('0x5'));var auth=require(_0xc3ee('0x6'));var interaction=require(_0xc3ee('0x7'));var config=require(_0xc3ee('0x8'));var controller=require(_0xc3ee('0x9'));router['get']('/',auth[_0xc3ee('0xa')](),controller[_0xc3ee('0xb')]);router[_0xc3ee('0xc')](_0xc3ee('0xd'),auth[_0xc3ee('0xa')](),controller[_0xc3ee('0xe')]);router[_0xc3ee('0xf')]('/',auth[_0xc3ee('0xa')](),controller[_0xc3ee('0x10')]);router[_0xc3ee('0x11')]('/:id',auth['isAuthenticated'](),controller[_0xc3ee('0x12')]);router[_0xc3ee('0x13')](_0xc3ee('0xd'),auth[_0xc3ee('0xa')](),controller['destroy']);module[_0xc3ee('0x14')]=router; \ No newline at end of file +var _0x4f29=['exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesField.controller','get','/:id','isAuthenticated','show','post','update','delete'];(function(_0x5b9a30,_0x2b3667){var _0x35f722=function(_0xfb962b){while(--_0xfb962b){_0x5b9a30['push'](_0x5b9a30['shift']());}};_0x35f722(++_0x2b3667);}(_0x4f29,0xfd));var _0x94f2=function(_0x3493b1,_0x57c931){_0x3493b1=_0x3493b1-0x0;var _0xeb8872=_0x4f29[_0x3493b1];return _0xeb8872;};'use strict';var multer=require('multer');var util=require(_0x94f2('0x0'));var path=require(_0x94f2('0x1'));var timeout=require(_0x94f2('0x2'));var express=require(_0x94f2('0x3'));var router=express[_0x94f2('0x4')]();var fs_extra=require(_0x94f2('0x5'));var auth=require(_0x94f2('0x6'));var interaction=require(_0x94f2('0x7'));var config=require(_0x94f2('0x8'));var controller=require(_0x94f2('0x9'));router[_0x94f2('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0x94f2('0xa')](_0x94f2('0xb'),auth[_0x94f2('0xc')](),controller[_0x94f2('0xd')]);router[_0x94f2('0xe')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x94f2('0xb'),auth['isAuthenticated'](),controller[_0x94f2('0xf')]);router[_0x94f2('0x10')](_0x94f2('0xb'),auth[_0x94f2('0xc')](),controller['destroy']);module[_0x94f2('0x11')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.attributes.js b/server/api/intFreshsalesField/intFreshsalesField.attributes.js index bc0b8a4..c90a7ce 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 _0x7fac=['exports','string','variable','keyValue','picklist','STRING','ENUM','customVariable','BOOLEAN','sequelize'];(function(_0x290694,_0x281935){var _0x5a0f2e=function(_0x58d7d4){while(--_0x58d7d4){_0x290694['push'](_0x290694['shift']());}};_0x5a0f2e(++_0x281935);}(_0x7fac,0x1e9));var _0xc7fa=function(_0x40bffc,_0x3a45d7){_0x40bffc=_0x40bffc-0x0;var _0x3007e9=_0x7fac[_0x40bffc];return _0x3007e9;};'use strict';var Sequelize=require(_0xc7fa('0x0'));module[_0xc7fa('0x1')]={'type':{'type':Sequelize['ENUM'](_0xc7fa('0x2'),_0xc7fa('0x3'),'customVariable',_0xc7fa('0x4'),_0xc7fa('0x5')),'defaultValue':_0xc7fa('0x2')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xc7fa('0x6')]},'keyType':{'type':Sequelize[_0xc7fa('0x7')](_0xc7fa('0x2'),_0xc7fa('0x3'),_0xc7fa('0x8'))},'keyContent':{'type':Sequelize[_0xc7fa('0x6')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0xc7fa('0x6')]},'customField':{'type':Sequelize[_0xc7fa('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xc7fa('0x6')]}}; \ No newline at end of file +var _0x0739=['customVariable','BOOLEAN','sequelize','exports','ENUM','variable','keyValue','picklist','string','STRING'];(function(_0x1dd47a,_0x1c98ea){var _0x3f9fd5=function(_0x5573e5){while(--_0x5573e5){_0x1dd47a['push'](_0x1dd47a['shift']());}};_0x3f9fd5(++_0x1c98ea);}(_0x0739,0x174));var _0x9073=function(_0xff47a4,_0x15c74d){_0xff47a4=_0xff47a4-0x0;var _0x5e1882=_0x0739[_0xff47a4];return _0x5e1882;};'use strict';var Sequelize=require(_0x9073('0x0'));module[_0x9073('0x1')]={'type':{'type':Sequelize[_0x9073('0x2')]('string',_0x9073('0x3'),'customVariable',_0x9073('0x4'),_0x9073('0x5')),'defaultValue':_0x9073('0x6')},'content':{'type':Sequelize[_0x9073('0x7')]},'key':{'type':Sequelize[_0x9073('0x7')]},'keyType':{'type':Sequelize[_0x9073('0x2')](_0x9073('0x6'),_0x9073('0x3'),_0x9073('0x8'))},'keyContent':{'type':Sequelize[_0x9073('0x7')]},'idField':{'type':Sequelize[_0x9073('0x7')]},'nameField':{'type':Sequelize[_0x9073('0x7')]},'customField':{'type':Sequelize[_0x9073('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x9073('0x7')]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.controller.js b/server/api/intFreshsalesField/intFreshsalesField.controller.js index 12aa091..ee6fa43 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 _0x1b5e=['../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','json','offset','undefined','limit','count','status','set','Content-Range','apply','reject','update','then','destroy','end','error','stack','name','send','index','rawAttributes','fieldName','key','map','query','keys','filters','attributes','intersection','fields','model','sort','where','pick','filter','merge','type','FreshsalesField','rows','catch','show','params','length','includeAll','include','options','body','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','lodash','squel','crypto','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs'];(function(_0x457a14,_0x26bf82){var _0xc07298=function(_0x248693){while(--_0x248693){_0x457a14['push'](_0x457a14['shift']());}};_0xc07298(++_0x26bf82);}(_0x1b5e,0x19e));var _0xe1b5=function(_0x4c7cbe,_0x5897e0){_0x4c7cbe=_0x4c7cbe-0x0;var _0x1d0442=_0x1b5e[_0x4c7cbe];return _0x1d0442;};'use strict';var emlformat=require(_0xe1b5('0x0'));var rimraf=require(_0xe1b5('0x1'));var zipdir=require(_0xe1b5('0x2'));var jsonpatch=require(_0xe1b5('0x3'));var rp=require(_0xe1b5('0x4'));var moment=require(_0xe1b5('0x5'));var BPromise=require(_0xe1b5('0x6'));var Mustache=require('mustache');var util=require(_0xe1b5('0x7'));var path=require(_0xe1b5('0x8'));var sox=require(_0xe1b5('0x9'));var csv=require('to-csv');var ejs=require(_0xe1b5('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe1b5('0xb'));var squel=require(_0xe1b5('0xc'));var crypto=require(_0xe1b5('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xe1b5('0xe'));var querystring=require('querystring');var Papa=require(_0xe1b5('0xf'));var Redis=require('ioredis');var authService=require(_0xe1b5('0x10'));var qs=require(_0xe1b5('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xe1b5('0x12'))(_0xe1b5('0x13'));var utils=require(_0xe1b5('0x14'));var config=require(_0xe1b5('0x15'));var licenseUtil=require(_0xe1b5('0x16'));var db=require(_0xe1b5('0x17'))['db'];function respondWithStatusCode(_0xc7536,_0x307562){_0x307562=_0x307562||0xcc;return function(_0x5a6ff8){if(_0x5a6ff8){return _0xc7536[_0xe1b5('0x18')](_0x307562);}return _0xc7536['status'](_0x307562)['end']();};}function respondWithResult(_0x317f44,_0x3470f0){_0x3470f0=_0x3470f0||0xc8;return function(_0x2ffb5a){if(_0x2ffb5a){return _0x317f44['status'](_0x3470f0)[_0xe1b5('0x19')](_0x2ffb5a);}};}function respondWithFilteredResult(_0xf1c782,_0x2fc6c9){return function(_0x35f576){if(_0x35f576){var _0x28bbed=typeof _0x2fc6c9[_0xe1b5('0x1a')]===_0xe1b5('0x1b')&&typeof _0x2fc6c9[_0xe1b5('0x1c')]==='undefined';var _0x29bfb5=_0x35f576[_0xe1b5('0x1d')];var _0x3b61d5=_0x28bbed?0x0:_0x2fc6c9[_0xe1b5('0x1a')];var _0x5d7554=_0x28bbed?_0x35f576['count']:_0x2fc6c9[_0xe1b5('0x1a')]+_0x2fc6c9[_0xe1b5('0x1c')];var _0xb8c58e;if(_0x5d7554>=_0x29bfb5){_0x5d7554=_0x29bfb5;_0xb8c58e=0xc8;}else{_0xb8c58e=0xce;}_0xf1c782[_0xe1b5('0x1e')](_0xb8c58e);return _0xf1c782[_0xe1b5('0x1f')](_0xe1b5('0x20'),_0x3b61d5+'-'+_0x5d7554+'/'+_0x29bfb5)[_0xe1b5('0x19')](_0x35f576);}return null;};}function patchUpdates(_0x198a11){return function(_0x404456){try{jsonpatch[_0xe1b5('0x21')](_0x404456,_0x198a11,!![]);}catch(_0x1ea16e){return BPromise[_0xe1b5('0x22')](_0x1ea16e);}return _0x404456['save']();};}function saveUpdates(_0x48b929,_0x180024){return function(_0x3b7cdc){if(_0x3b7cdc){return _0x3b7cdc[_0xe1b5('0x23')](_0x48b929)[_0xe1b5('0x24')](function(_0x14f7dd){return _0x14f7dd;});}return null;};}function removeEntity(_0x2cf08f,_0x3e0f47){return function(_0x31204e){if(_0x31204e){return _0x31204e[_0xe1b5('0x25')]()[_0xe1b5('0x24')](function(){_0x2cf08f['status'](0xcc)[_0xe1b5('0x26')]();});}};}function handleEntityNotFound(_0x4ad99a,_0x337f56){return function(_0x35c79a){if(!_0x35c79a){_0x4ad99a['sendStatus'](0x194);}return _0x35c79a;};}function handleError(_0x329c73,_0x22557f){_0x22557f=_0x22557f||0x1f4;return function(_0x4c89ad){logger[_0xe1b5('0x27')](_0x4c89ad[_0xe1b5('0x28')]);if(_0x4c89ad[_0xe1b5('0x29')]){delete _0x4c89ad[_0xe1b5('0x29')];}_0x329c73[_0xe1b5('0x1e')](_0x22557f)[_0xe1b5('0x2a')](_0x4c89ad);};}exports[_0xe1b5('0x2b')]=function(_0x502807,_0x1d490c){var _0x28f4e4={},_0x2d40e3={},_0x192033={'count':0x0,'rows':[]};var _0x5d1d9f=_['map'](db['FreshsalesField'][_0xe1b5('0x2c')],function(_0x517e1a){return{'name':_0x517e1a[_0xe1b5('0x2d')],'type':_0x517e1a['type'][_0xe1b5('0x2e')]};});_0x2d40e3['model']=_[_0xe1b5('0x2f')](_0x5d1d9f,'name');_0x2d40e3[_0xe1b5('0x30')]=_[_0xe1b5('0x31')](_0x502807[_0xe1b5('0x30')]);_0x2d40e3[_0xe1b5('0x32')]=_['intersection'](_0x2d40e3['model'],_0x2d40e3[_0xe1b5('0x30')]);_0x28f4e4[_0xe1b5('0x33')]=_[_0xe1b5('0x34')](_0x2d40e3['model'],qs[_0xe1b5('0x35')](_0x502807[_0xe1b5('0x30')]['fields']));_0x28f4e4[_0xe1b5('0x33')]=_0x28f4e4[_0xe1b5('0x33')]['length']?_0x28f4e4[_0xe1b5('0x33')]:_0x2d40e3[_0xe1b5('0x36')];if(!_0x502807[_0xe1b5('0x30')]['hasOwnProperty']('nolimit')){_0x28f4e4[_0xe1b5('0x1c')]=qs[_0xe1b5('0x1c')](_0x502807[_0xe1b5('0x30')][_0xe1b5('0x1c')]);_0x28f4e4['offset']=qs[_0xe1b5('0x1a')](_0x502807['query'][_0xe1b5('0x1a')]);}_0x28f4e4['order']=qs[_0xe1b5('0x37')](_0x502807['query'][_0xe1b5('0x37')]);_0x28f4e4[_0xe1b5('0x38')]=qs[_0xe1b5('0x32')](_[_0xe1b5('0x39')](_0x502807[_0xe1b5('0x30')],_0x2d40e3[_0xe1b5('0x32')]),_0x5d1d9f);if(_0x502807['query'][_0xe1b5('0x3a')]){_0x28f4e4['where']=_[_0xe1b5('0x3b')](_0x28f4e4[_0xe1b5('0x38')],{'$or':_[_0xe1b5('0x2f')](_0x5d1d9f,function(_0x5bf411){if(_0x5bf411[_0xe1b5('0x3c')]!=='VIRTUAL'){var _0x2f6487={};_0x2f6487[_0x5bf411[_0xe1b5('0x29')]]={'$like':'%'+_0x502807[_0xe1b5('0x30')][_0xe1b5('0x3a')]+'%'};return _0x2f6487;}})});}_0x28f4e4=_['merge']({},_0x28f4e4,_0x502807['options']);var _0xaaa93d={'where':_0x28f4e4[_0xe1b5('0x38')]};return db['FreshsalesField']['count'](_0xaaa93d)[_0xe1b5('0x24')](function(_0x443faa){_0x192033[_0xe1b5('0x1d')]=_0x443faa;if(_0x502807[_0xe1b5('0x30')]['includeAll']){_0x28f4e4['include']=[{'all':!![]}];}return db[_0xe1b5('0x3d')]['findAll'](_0x28f4e4);})[_0xe1b5('0x24')](function(_0x1c7bc7){_0x192033[_0xe1b5('0x3e')]=_0x1c7bc7;return _0x192033;})[_0xe1b5('0x24')](respondWithFilteredResult(_0x1d490c,_0x28f4e4))[_0xe1b5('0x3f')](handleError(_0x1d490c,null));};exports[_0xe1b5('0x40')]=function(_0x5b359c,_0x20ddac){var _0x21c4b5={'raw':!![],'where':{'id':_0x5b359c[_0xe1b5('0x41')]['id']}},_0x225188={};_0x225188[_0xe1b5('0x36')]=_['keys'](db[_0xe1b5('0x3d')][_0xe1b5('0x2c')]);_0x225188[_0xe1b5('0x30')]=_[_0xe1b5('0x31')](_0x5b359c[_0xe1b5('0x30')]);_0x225188[_0xe1b5('0x32')]=_[_0xe1b5('0x34')](_0x225188['model'],_0x225188['query']);_0x21c4b5['attributes']=_['intersection'](_0x225188['model'],qs[_0xe1b5('0x35')](_0x5b359c['query'][_0xe1b5('0x35')]));_0x21c4b5[_0xe1b5('0x33')]=_0x21c4b5[_0xe1b5('0x33')][_0xe1b5('0x42')]?_0x21c4b5['attributes']:_0x225188[_0xe1b5('0x36')];if(_0x5b359c['query'][_0xe1b5('0x43')]){_0x21c4b5[_0xe1b5('0x44')]=[{'all':!![]}];}_0x21c4b5=_[_0xe1b5('0x3b')]({},_0x21c4b5,_0x5b359c[_0xe1b5('0x45')]);return db[_0xe1b5('0x3d')]['find'](_0x21c4b5)[_0xe1b5('0x24')](handleEntityNotFound(_0x20ddac,null))[_0xe1b5('0x24')](respondWithResult(_0x20ddac,null))[_0xe1b5('0x3f')](handleError(_0x20ddac,null));};exports['create']=function(_0x3ce89f,_0x161e88){return db[_0xe1b5('0x3d')]['create'](_0x3ce89f['body'],{})[_0xe1b5('0x24')](respondWithResult(_0x161e88,0xc9))[_0xe1b5('0x3f')](handleError(_0x161e88,null));};exports[_0xe1b5('0x23')]=function(_0x5a7385,_0x51471a){if(_0x5a7385[_0xe1b5('0x46')]['id']){delete _0x5a7385[_0xe1b5('0x46')]['id'];}return db['FreshsalesField'][_0xe1b5('0x47')]({'where':{'id':_0x5a7385[_0xe1b5('0x41')]['id']}})[_0xe1b5('0x24')](handleEntityNotFound(_0x51471a,null))[_0xe1b5('0x24')](saveUpdates(_0x5a7385['body'],null))[_0xe1b5('0x24')](respondWithResult(_0x51471a,null))[_0xe1b5('0x3f')](handleError(_0x51471a,null));};exports[_0xe1b5('0x25')]=function(_0x3c90fb,_0x16cf82){return db[_0xe1b5('0x3d')][_0xe1b5('0x47')]({'where':{'id':_0x3c90fb[_0xe1b5('0x41')]['id']}})['then'](handleEntityNotFound(_0x16cf82,null))[_0xe1b5('0x24')](removeEntity(_0x16cf82,null))[_0xe1b5('0x3f')](handleError(_0x16cf82,null));}; \ No newline at end of file +var _0x9deb=['querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','offset','limit','undefined','count','set','apply','reject','save','then','destroy','error','stack','name','send','index','map','FreshsalesField','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','catch','create','body','update','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','squel','crypto','desk.js','to-csv'];(function(_0x16e15b,_0x4dcded){var _0xc0396e=function(_0x38f302){while(--_0x38f302){_0x16e15b['push'](_0x16e15b['shift']());}};_0xc0396e(++_0x4dcded);}(_0x9deb,0x1b7));var _0xb9de=function(_0x139cfb,_0x230e90){_0x139cfb=_0x139cfb-0x0;var _0x4cde55=_0x9deb[_0x139cfb];return _0x4cde55;};'use strict';var emlformat=require(_0xb9de('0x0'));var rimraf=require(_0xb9de('0x1'));var zipdir=require(_0xb9de('0x2'));var jsonpatch=require(_0xb9de('0x3'));var rp=require(_0xb9de('0x4'));var moment=require(_0xb9de('0x5'));var BPromise=require(_0xb9de('0x6'));var Mustache=require(_0xb9de('0x7'));var util=require(_0xb9de('0x8'));var path=require(_0xb9de('0x9'));var sox=require(_0xb9de('0xa'));var csv=require('to-csv');var ejs=require(_0xb9de('0xb'));var fs=require('fs');var fs_extra=require(_0xb9de('0xc'));var _=require('lodash');var squel=require(_0xb9de('0xd'));var crypto=require(_0xb9de('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xb9de('0xf'));var toCsv=require(_0xb9de('0x10'));var querystring=require(_0xb9de('0x11'));var Papa=require('papaparse');var Redis=require(_0xb9de('0x12'));var authService=require(_0xb9de('0x13'));var qs=require(_0xb9de('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xb9de('0x15'));var config=require(_0xb9de('0x16'));var licenseUtil=require(_0xb9de('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2077ac,_0x3ff1b5){_0x3ff1b5=_0x3ff1b5||0xcc;return function(_0x5b5811){if(_0x5b5811){return _0x2077ac[_0xb9de('0x18')](_0x3ff1b5);}return _0x2077ac[_0xb9de('0x19')](_0x3ff1b5)['end']();};}function respondWithResult(_0x4b27f5,_0x4a6479){_0x4a6479=_0x4a6479||0xc8;return function(_0x3e4123){if(_0x3e4123){return _0x4b27f5[_0xb9de('0x19')](_0x4a6479)['json'](_0x3e4123);}};}function respondWithFilteredResult(_0x240200,_0x8872f1){return function(_0x29504c){if(_0x29504c){var _0x528da2=typeof _0x8872f1[_0xb9de('0x1a')]==='undefined'&&typeof _0x8872f1[_0xb9de('0x1b')]===_0xb9de('0x1c');var _0x33f49f=_0x29504c[_0xb9de('0x1d')];var _0x3829ee=_0x528da2?0x0:_0x8872f1[_0xb9de('0x1a')];var _0xa744e1=_0x528da2?_0x29504c[_0xb9de('0x1d')]:_0x8872f1[_0xb9de('0x1a')]+_0x8872f1[_0xb9de('0x1b')];var _0x51e9cd;if(_0xa744e1>=_0x33f49f){_0xa744e1=_0x33f49f;_0x51e9cd=0xc8;}else{_0x51e9cd=0xce;}_0x240200[_0xb9de('0x19')](_0x51e9cd);return _0x240200[_0xb9de('0x1e')]('Content-Range',_0x3829ee+'-'+_0xa744e1+'/'+_0x33f49f)['json'](_0x29504c);}return null;};}function patchUpdates(_0x36d593){return function(_0xd92619){try{jsonpatch[_0xb9de('0x1f')](_0xd92619,_0x36d593,!![]);}catch(_0x3b2c9e){return BPromise[_0xb9de('0x20')](_0x3b2c9e);}return _0xd92619[_0xb9de('0x21')]();};}function saveUpdates(_0x538f99,_0xe859d4){return function(_0x121f2f){if(_0x121f2f){return _0x121f2f['update'](_0x538f99)[_0xb9de('0x22')](function(_0x2e1296){return _0x2e1296;});}return null;};}function removeEntity(_0xefe2ce,_0x183d09){return function(_0x3f9851){if(_0x3f9851){return _0x3f9851[_0xb9de('0x23')]()[_0xb9de('0x22')](function(){_0xefe2ce[_0xb9de('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0xb13cc1,_0x170826){return function(_0x48e712){if(!_0x48e712){_0xb13cc1[_0xb9de('0x18')](0x194);}return _0x48e712;};}function handleError(_0x33865d,_0x7a51b){_0x7a51b=_0x7a51b||0x1f4;return function(_0xa96ea1){logger[_0xb9de('0x24')](_0xa96ea1[_0xb9de('0x25')]);if(_0xa96ea1[_0xb9de('0x26')]){delete _0xa96ea1['name'];}_0x33865d[_0xb9de('0x19')](_0x7a51b)[_0xb9de('0x27')](_0xa96ea1);};}exports[_0xb9de('0x28')]=function(_0x30bba7,_0xb2d235){var _0x2b3c10={},_0x4f53ac={},_0x288859={'count':0x0,'rows':[]};var _0x1a4eac=_[_0xb9de('0x29')](db[_0xb9de('0x2a')][_0xb9de('0x2b')],function(_0x33f38a){return{'name':_0x33f38a[_0xb9de('0x2c')],'type':_0x33f38a[_0xb9de('0x2d')][_0xb9de('0x2e')]};});_0x4f53ac[_0xb9de('0x2f')]=_['map'](_0x1a4eac,_0xb9de('0x26'));_0x4f53ac[_0xb9de('0x30')]=_[_0xb9de('0x31')](_0x30bba7[_0xb9de('0x30')]);_0x4f53ac[_0xb9de('0x32')]=_[_0xb9de('0x33')](_0x4f53ac[_0xb9de('0x2f')],_0x4f53ac[_0xb9de('0x30')]);_0x2b3c10[_0xb9de('0x34')]=_[_0xb9de('0x33')](_0x4f53ac[_0xb9de('0x2f')],qs[_0xb9de('0x35')](_0x30bba7[_0xb9de('0x30')][_0xb9de('0x35')]));_0x2b3c10[_0xb9de('0x34')]=_0x2b3c10['attributes'][_0xb9de('0x36')]?_0x2b3c10[_0xb9de('0x34')]:_0x4f53ac[_0xb9de('0x2f')];if(!_0x30bba7[_0xb9de('0x30')][_0xb9de('0x37')](_0xb9de('0x38'))){_0x2b3c10[_0xb9de('0x1b')]=qs[_0xb9de('0x1b')](_0x30bba7['query'][_0xb9de('0x1b')]);_0x2b3c10[_0xb9de('0x1a')]=qs[_0xb9de('0x1a')](_0x30bba7[_0xb9de('0x30')][_0xb9de('0x1a')]);}_0x2b3c10[_0xb9de('0x39')]=qs[_0xb9de('0x3a')](_0x30bba7[_0xb9de('0x30')][_0xb9de('0x3a')]);_0x2b3c10[_0xb9de('0x3b')]=qs[_0xb9de('0x32')](_[_0xb9de('0x3c')](_0x30bba7['query'],_0x4f53ac['filters']),_0x1a4eac);if(_0x30bba7[_0xb9de('0x30')][_0xb9de('0x3d')]){_0x2b3c10['where']=_[_0xb9de('0x3e')](_0x2b3c10['where'],{'$or':_[_0xb9de('0x29')](_0x1a4eac,function(_0x245d05){if(_0x245d05['type']!==_0xb9de('0x3f')){var _0x14d730={};_0x14d730[_0x245d05[_0xb9de('0x26')]]={'$like':'%'+_0x30bba7[_0xb9de('0x30')][_0xb9de('0x3d')]+'%'};return _0x14d730;}})});}_0x2b3c10=_[_0xb9de('0x3e')]({},_0x2b3c10,_0x30bba7[_0xb9de('0x40')]);var _0x26f778={'where':_0x2b3c10[_0xb9de('0x3b')]};return db[_0xb9de('0x2a')][_0xb9de('0x1d')](_0x26f778)[_0xb9de('0x22')](function(_0x4fcdd8){_0x288859[_0xb9de('0x1d')]=_0x4fcdd8;if(_0x30bba7[_0xb9de('0x30')][_0xb9de('0x41')]){_0x2b3c10[_0xb9de('0x42')]=[{'all':!![]}];}return db['FreshsalesField'][_0xb9de('0x43')](_0x2b3c10);})[_0xb9de('0x22')](function(_0x4ef39c){_0x288859[_0xb9de('0x44')]=_0x4ef39c;return _0x288859;})[_0xb9de('0x22')](respondWithFilteredResult(_0xb2d235,_0x2b3c10))['catch'](handleError(_0xb2d235,null));};exports[_0xb9de('0x45')]=function(_0x5673da,_0x26f732){var _0x56b0a6={'raw':!![],'where':{'id':_0x5673da[_0xb9de('0x46')]['id']}},_0x3f0de9={};_0x3f0de9[_0xb9de('0x2f')]=_[_0xb9de('0x31')](db[_0xb9de('0x2a')][_0xb9de('0x2b')]);_0x3f0de9['query']=_['keys'](_0x5673da[_0xb9de('0x30')]);_0x3f0de9[_0xb9de('0x32')]=_[_0xb9de('0x33')](_0x3f0de9['model'],_0x3f0de9[_0xb9de('0x30')]);_0x56b0a6[_0xb9de('0x34')]=_[_0xb9de('0x33')](_0x3f0de9[_0xb9de('0x2f')],qs['fields'](_0x5673da['query'][_0xb9de('0x35')]));_0x56b0a6[_0xb9de('0x34')]=_0x56b0a6[_0xb9de('0x34')][_0xb9de('0x36')]?_0x56b0a6['attributes']:_0x3f0de9[_0xb9de('0x2f')];if(_0x5673da[_0xb9de('0x30')][_0xb9de('0x41')]){_0x56b0a6[_0xb9de('0x42')]=[{'all':!![]}];}_0x56b0a6=_['merge']({},_0x56b0a6,_0x5673da[_0xb9de('0x40')]);return db[_0xb9de('0x2a')]['find'](_0x56b0a6)[_0xb9de('0x22')](handleEntityNotFound(_0x26f732,null))['then'](respondWithResult(_0x26f732,null))[_0xb9de('0x47')](handleError(_0x26f732,null));};exports['create']=function(_0xc2be51,_0x45210d){return db[_0xb9de('0x2a')][_0xb9de('0x48')](_0xc2be51[_0xb9de('0x49')],{})[_0xb9de('0x22')](respondWithResult(_0x45210d,0xc9))[_0xb9de('0x47')](handleError(_0x45210d,null));};exports[_0xb9de('0x4a')]=function(_0x57f778,_0x16c9c6){if(_0x57f778[_0xb9de('0x49')]['id']){delete _0x57f778[_0xb9de('0x49')]['id'];}return db[_0xb9de('0x2a')][_0xb9de('0x4b')]({'where':{'id':_0x57f778['params']['id']}})[_0xb9de('0x22')](handleEntityNotFound(_0x16c9c6,null))['then'](saveUpdates(_0x57f778[_0xb9de('0x49')],null))[_0xb9de('0x22')](respondWithResult(_0x16c9c6,null))['catch'](handleError(_0x16c9c6,null));};exports[_0xb9de('0x23')]=function(_0x5bbe2e,_0x9162e2){return db[_0xb9de('0x2a')][_0xb9de('0x4b')]({'where':{'id':_0x5bbe2e['params']['id']}})[_0xb9de('0x22')](handleEntityNotFound(_0x9162e2,null))[_0xb9de('0x22')](removeEntity(_0x9162e2,null))[_0xb9de('0x47')](handleError(_0x9162e2,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.model.js b/server/api/intFreshsalesField/intFreshsalesField.model.js index e5be168..f1977b7 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 _0xa486=['define','FreshsalesField','int_freshsales_fields','freshsales_unique_index','idField','FieldId','lodash','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./intFreshsalesField.attributes','exports'];(function(_0x140725,_0x3ebf63){var _0x343393=function(_0x520846){while(--_0x520846){_0x140725['push'](_0x140725['shift']());}};_0x343393(++_0x3ebf63);}(_0xa486,0x17d));var _0x6a48=function(_0x574a3e,_0x482e70){_0x574a3e=_0x574a3e-0x0;var _0x3f5387=_0xa486[_0x574a3e];return _0x3f5387;};'use strict';var _=require(_0x6a48('0x0'));var util=require('util');var logger=require(_0x6a48('0x1'))('api');var moment=require(_0x6a48('0x2'));var BPromise=require('bluebird');var rp=require(_0x6a48('0x3'));var fs=require('fs');var path=require(_0x6a48('0x4'));var rimraf=require(_0x6a48('0x5'));var config=require(_0x6a48('0x6'));var attributes=require(_0x6a48('0x7'));module[_0x6a48('0x8')]=function(_0x29c0eb,_0x3d81f7){return _0x29c0eb[_0x6a48('0x9')](_0x6a48('0xa'),attributes,{'tableName':_0x6a48('0xb'),'paranoid':![],'indexes':[{'name':_0x6a48('0xc'),'fields':[_0x6a48('0xd'),_0x6a48('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xb1fa=['define','int_freshsales_fields','freshsales_unique_index','FieldId','../../config/logger','moment','./intFreshsalesField.attributes'];(function(_0x302ead,_0x1f301a){var _0x5b508a=function(_0x1dbd9b){while(--_0x1dbd9b){_0x302ead['push'](_0x302ead['shift']());}};_0x5b508a(++_0x1f301a);}(_0xb1fa,0x9e));var _0xab1f=function(_0x39f417,_0x2f382d){_0x39f417=_0x39f417-0x0;var _0x3fe8f6=_0xb1fa[_0x39f417];return _0x3fe8f6;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xab1f('0x0'))('api');var moment=require(_0xab1f('0x1'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xab1f('0x2'));module['exports']=function(_0x50ada8,_0x4ee73b){return _0x50ada8[_0xab1f('0x3')]('FreshsalesField',attributes,{'tableName':_0xab1f('0x4'),'paranoid':![],'indexes':[{'name':_0xab1f('0x5'),'fields':['idField',_0xab1f('0x6')],'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 7b71653..03966ca 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 _0x90b1=['message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','http','request','info','FreshsalesField,\x20%s,\x20%s','request\x20sent','debug','FreshsalesField,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0xb41579,_0x25491a){var _0x21a9ba=function(_0x596380){while(--_0x596380){_0xb41579['push'](_0xb41579['shift']());}};_0x21a9ba(++_0x25491a);}(_0x90b1,0x1bb));var _0x190b=function(_0x243b5a,_0x4c3ec0){_0x243b5a=_0x243b5a-0x0;var _0x3584f0=_0x90b1[_0x243b5a];return _0x3584f0;};'use strict';var _=require(_0x190b('0x0'));var util=require(_0x190b('0x1'));var moment=require(_0x190b('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x190b('0x3'));var db=require(_0x190b('0x4'))['db'];var utils=require(_0x190b('0x5'));var logger=require(_0x190b('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x190b('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x34a689,_0x3b57f7,_0x626aa1){return new BPromise(function(_0x311161,_0x802924){return client[_0x190b('0x8')](_0x34a689,_0x626aa1)['then'](function(_0x14b93d){logger[_0x190b('0x9')](_0x190b('0xa'),_0x3b57f7,_0x190b('0xb'));logger[_0x190b('0xc')](_0x190b('0xd'),_0x3b57f7,_0x190b('0xb'),JSON[_0x190b('0xe')](_0x14b93d));if(_0x14b93d['error']){if(_0x14b93d[_0x190b('0xf')][_0x190b('0x10')]===0x1f4){logger['error'](_0x190b('0xa'),_0x3b57f7,_0x14b93d[_0x190b('0xf')][_0x190b('0x11')]);return _0x802924(_0x14b93d[_0x190b('0xf')][_0x190b('0x11')]);}logger[_0x190b('0xf')](_0x190b('0xa'),_0x3b57f7,_0x14b93d[_0x190b('0xf')][_0x190b('0x11')]);return _0x311161(_0x14b93d[_0x190b('0xf')][_0x190b('0x11')]);}else{logger[_0x190b('0x9')](_0x190b('0xa'),_0x3b57f7,_0x190b('0xb'));_0x311161(_0x14b93d[_0x190b('0x12')][_0x190b('0x11')]);}})[_0x190b('0x13')](function(_0x5c63d9){logger[_0x190b('0xf')]('FreshsalesField,\x20%s,\x20%s',_0x3b57f7,_0x5c63d9);_0x802924(_0x5c63d9);});});} \ No newline at end of file +var _0x2bd8=['info','request\x20sent','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','FreshsalesField,\x20%s,\x20%s','FreshsalesField,\x20%s,\x20%s,\x20%s','error','message'];(function(_0xa863b9,_0x2f16f0){var _0x388d89=function(_0xd1e819){while(--_0xd1e819){_0xa863b9['push'](_0xa863b9['shift']());}};_0x388d89(++_0x2f16f0);}(_0x2bd8,0x130));var _0x82bd=function(_0x568c89,_0x2a054b){_0x568c89=_0x568c89-0x0;var _0xdabc29=_0x2bd8[_0x568c89];return _0xdabc29;};'use strict';var _=require(_0x82bd('0x0'));var util=require('util');var moment=require(_0x82bd('0x1'));var BPromise=require(_0x82bd('0x2'));var rs=require(_0x82bd('0x3'));var fs=require('fs');var Redis=require(_0x82bd('0x4'));var db=require(_0x82bd('0x5'))['db'];var utils=require(_0x82bd('0x6'));var logger=require(_0x82bd('0x7'))('rpc');var config=require(_0x82bd('0x8'));var jayson=require(_0x82bd('0x9'));var client=jayson[_0x82bd('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x19dbb1,_0x77d7a9,_0x226f60){return new BPromise(function(_0x1f7463,_0x4dc3a6){return client[_0x82bd('0xb')](_0x19dbb1,_0x226f60)['then'](function(_0x4a9b2c){logger['info'](_0x82bd('0xc'),_0x77d7a9,'request\x20sent');logger['debug'](_0x82bd('0xd'),_0x77d7a9,'request\x20sent',JSON['stringify'](_0x4a9b2c));if(_0x4a9b2c[_0x82bd('0xe')]){if(_0x4a9b2c[_0x82bd('0xe')]['code']===0x1f4){logger[_0x82bd('0xe')]('FreshsalesField,\x20%s,\x20%s',_0x77d7a9,_0x4a9b2c[_0x82bd('0xe')]['message']);return _0x4dc3a6(_0x4a9b2c[_0x82bd('0xe')][_0x82bd('0xf')]);}logger[_0x82bd('0xe')](_0x82bd('0xc'),_0x77d7a9,_0x4a9b2c['error'][_0x82bd('0xf')]);return _0x1f7463(_0x4a9b2c[_0x82bd('0xe')]['message']);}else{logger[_0x82bd('0x10')]('FreshsalesField,\x20%s,\x20%s',_0x77d7a9,_0x82bd('0x11'));_0x1f7463(_0x4a9b2c[_0x82bd('0x12')][_0x82bd('0xf')]);}})[_0x82bd('0x13')](function(_0x209081){logger[_0x82bd('0xe')](_0x82bd('0xc'),_0x77d7a9,_0x209081);_0x4dc3a6(_0x209081);});});} \ No newline at end of file diff --git a/server/api/intSalesforceAccount/index.js b/server/api/intSalesforceAccount/index.js index 211c32c..be12bc4 100644 --- a/server/api/intSalesforceAccount/index.js +++ b/server/api/intSalesforceAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intSalesforceAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path'];(function(_0x13e298,_0x39a6f2){var _0x3e73bd=function(_0x200464){while(--_0x200464){_0x13e298['push'](_0x13e298['shift']());}};_0x3e73bd(++_0x39a6f2);}(_0x9957,0x93));var _0x7995=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x9957[_0x2f5ac5];return _0x37c9a8;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')]('/',auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x11')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x17')]);module[_0x7995('0x18')]=router; \ No newline at end of file +var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceAccount.controller','get','index','/:id','getConfigurations','/:id/fields','isAuthenticated','getFields','post','addConfiguration','put','update','destroy','exports','multer','util','path'];(function(_0xc666ec,_0x56535f){var _0x4d6608=function(_0x1ec21a){while(--_0x1ec21a){_0xc666ec['push'](_0xc666ec['shift']());}};_0x4d6608(++_0x56535f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x37c22c,_0x28a70d){_0x37c22c=_0x37c22c-0x0;var _0x119d79=_0xa9e0[_0x37c22c];return _0x119d79;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));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 7358bb5..90c8836 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 _0x27fb=['STRING','ENUM','integrationTab','newTab','sequelize','exports'];(function(_0x17550d,_0x1a571f){var _0x32402e=function(_0x472b63){while(--_0x472b63){_0x17550d['push'](_0x17550d['shift']());}};_0x32402e(++_0x1a571f);}(_0x27fb,0x1de));var _0xb27f=function(_0x17ec07,_0xe3ca90){_0x17ec07=_0x17ec07-0x0;var _0x5a6c45=_0x27fb[_0x17ec07];return _0x5a6c45;};'use strict';var Sequelize=require(_0xb27f('0x0'));module[_0xb27f('0x1')]={'name':{'type':Sequelize[_0xb27f('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xb27f('0x2')],'unique':'username'},'remoteUri':{'type':Sequelize[_0xb27f('0x2')]},'password':{'type':Sequelize[_0xb27f('0x2')]},'clientId':{'type':Sequelize[_0xb27f('0x2')]},'clientSecret':{'type':Sequelize['STRING']},'securityToken':{'type':Sequelize[_0xb27f('0x2')]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xb27f('0x3')](_0xb27f('0x4'),_0xb27f('0x5')),'defaultValue':_0xb27f('0x4')}}; \ No newline at end of file +var _0xba37=['ENUM','integrationTab','sequelize','STRING'];(function(_0x49c653,_0x390195){var _0x31e169=function(_0x3684ac){while(--_0x3684ac){_0x49c653['push'](_0x49c653['shift']());}};_0x31e169(++_0x390195);}(_0xba37,0xb6));var _0x7ba3=function(_0x45d3f0,_0x4be53f){_0x45d3f0=_0x45d3f0-0x0;var _0x314b79=_0xba37[_0x45d3f0];return _0x314b79;};'use strict';var Sequelize=require(_0x7ba3('0x0'));module['exports']={'name':{'type':Sequelize[_0x7ba3('0x1')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x7ba3('0x1')],'unique':'username'},'remoteUri':{'type':Sequelize[_0x7ba3('0x1')]},'password':{'type':Sequelize[_0x7ba3('0x1')]},'clientId':{'type':Sequelize[_0x7ba3('0x1')]},'clientSecret':{'type':Sequelize[_0x7ba3('0x1')]},'securityToken':{'type':Sequelize[_0x7ba3('0x1')]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x7ba3('0x2')]('integrationTab','newTab'),'defaultValue':_0x7ba3('0x3')}}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.controller.js b/server/api/intSalesforceAccount/intSalesforceAccount.controller.js index a337bf2..7fdf7f2 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 _0xb192=['bluebird','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','sendStatus','end','json','offset','undefined','limit','count','status','Content-Range','reject','update','then','destroy','error','name','send','index','SalesforceAccount','rawAttributes','type','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','merge','VIRTUAL','options','includeAll','findAll','rows','show','params','keys','include','find','catch','create','body','getConfigurations','SalesforceConfiguration','sort','pick','filter','findOne','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','SalesforceField','remoteUri','clientId','clientSecret','securityToken','substring','Connection','login','username','password','concat','isNil','ticketType','sobject','describe','OwnerId','ActivityDate','IsReminderSet','IsRecurrence','Subject','Description','string','int','picklist','textarea','phone','remove','includes','label','picklistValues','value','boolean','True','false','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','Wrong\x20credentials','eml-format','rimraf','fast-json-patch','request-promise','moment'];(function(_0x186314,_0x840569){var _0x311aaf=function(_0x31d7f7){while(--_0x31d7f7){_0x186314['push'](_0x186314['shift']());}};_0x311aaf(++_0x840569);}(_0xb192,0x16f));var _0x2b19=function(_0x212b9a,_0x1d7bda){_0x212b9a=_0x212b9a-0x0;var _0x285da6=_0xb192[_0x212b9a];return _0x285da6;};'use strict';var emlformat=require(_0x2b19('0x0'));var rimraf=require(_0x2b19('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2b19('0x2'));var rp=require(_0x2b19('0x3'));var moment=require(_0x2b19('0x4'));var BPromise=require(_0x2b19('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x2b19('0x6'));var csv=require('to-csv');var ejs=require(_0x2b19('0x7'));var fs=require('fs');var fs_extra=require(_0x2b19('0x8'));var _=require('lodash');var squel=require(_0x2b19('0x9'));var crypto=require(_0x2b19('0xa'));var jsforce=require(_0x2b19('0xb'));var deskjs=require(_0x2b19('0xc'));var toCsv=require(_0x2b19('0xd'));var querystring=require(_0x2b19('0xe'));var Papa=require(_0x2b19('0xf'));var Redis=require(_0x2b19('0x10'));var authService=require(_0x2b19('0x11'));var qs=require(_0x2b19('0x12'));var as=require(_0x2b19('0x13'));var hardwareService=require(_0x2b19('0x14'));var logger=require('../../config/logger')(_0x2b19('0x15'));var utils=require(_0x2b19('0x16'));var config=require(_0x2b19('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x2b19('0x18'))['db'];var integrations=require(_0x2b19('0x19'));function respondWithStatusCode(_0x3257b5,_0x31b7fc){_0x31b7fc=_0x31b7fc||0xcc;return function(_0x29a995){if(_0x29a995){return _0x3257b5[_0x2b19('0x1a')](_0x31b7fc);}return _0x3257b5['status'](_0x31b7fc)[_0x2b19('0x1b')]();};}function respondWithResult(_0xa10406,_0x5891ee){_0x5891ee=_0x5891ee||0xc8;return function(_0x21e011){if(_0x21e011){return _0xa10406['status'](_0x5891ee)[_0x2b19('0x1c')](_0x21e011);}};}function respondWithFilteredResult(_0x3a4841,_0x4b876e){return function(_0x1b7dc4){if(_0x1b7dc4){var _0x321665=typeof _0x4b876e[_0x2b19('0x1d')]===_0x2b19('0x1e')&&typeof _0x4b876e[_0x2b19('0x1f')]==='undefined';var _0x2acf62=_0x1b7dc4[_0x2b19('0x20')];var _0x2faef4=_0x321665?0x0:_0x4b876e[_0x2b19('0x1d')];var _0x28cc98=_0x321665?_0x1b7dc4[_0x2b19('0x20')]:_0x4b876e['offset']+_0x4b876e[_0x2b19('0x1f')];var _0x2487f7;if(_0x28cc98>=_0x2acf62){_0x28cc98=_0x2acf62;_0x2487f7=0xc8;}else{_0x2487f7=0xce;}_0x3a4841[_0x2b19('0x21')](_0x2487f7);return _0x3a4841['set'](_0x2b19('0x22'),_0x2faef4+'-'+_0x28cc98+'/'+_0x2acf62)['json'](_0x1b7dc4);}return null;};}function patchUpdates(_0x3b1996){return function(_0x333c75){try{jsonpatch['apply'](_0x333c75,_0x3b1996,!![]);}catch(_0x5eb7cd){return BPromise[_0x2b19('0x23')](_0x5eb7cd);}return _0x333c75['save']();};}function saveUpdates(_0x2a3883,_0x758f57){return function(_0x544fbf){if(_0x544fbf){return _0x544fbf[_0x2b19('0x24')](_0x2a3883)[_0x2b19('0x25')](function(_0x1b535f){return _0x1b535f;});}return null;};}function removeEntity(_0x1035c9,_0x4b3c9d){return function(_0x1c6bfc){if(_0x1c6bfc){return _0x1c6bfc[_0x2b19('0x26')]()[_0x2b19('0x25')](function(){_0x1035c9[_0x2b19('0x21')](0xcc)[_0x2b19('0x1b')]();});}};}function handleEntityNotFound(_0x25f65e,_0x26f819){return function(_0x27ddea){if(!_0x27ddea){_0x25f65e[_0x2b19('0x1a')](0x194);}return _0x27ddea;};}function handleError(_0x1404bf,_0x219c6c){_0x219c6c=_0x219c6c||0x1f4;return function(_0xe6f5b1){logger[_0x2b19('0x27')](_0xe6f5b1['stack']);if(_0xe6f5b1[_0x2b19('0x28')]){delete _0xe6f5b1[_0x2b19('0x28')];}_0x1404bf[_0x2b19('0x21')](_0x219c6c)[_0x2b19('0x29')](_0xe6f5b1);};}exports[_0x2b19('0x2a')]=function(_0x240d1a,_0x5a04c8){var _0x39506e={},_0x2be179={},_0x4df76e={'count':0x0,'rows':[]};var _0x2b1f4f=_['map'](db[_0x2b19('0x2b')][_0x2b19('0x2c')],function(_0x4f9bb0){return{'name':_0x4f9bb0['fieldName'],'type':_0x4f9bb0[_0x2b19('0x2d')][_0x2b19('0x2e')]};});_0x2be179[_0x2b19('0x2f')]=_[_0x2b19('0x30')](_0x2b1f4f,_0x2b19('0x28'));_0x2be179[_0x2b19('0x31')]=_['keys'](_0x240d1a[_0x2b19('0x31')]);_0x2be179[_0x2b19('0x32')]=_[_0x2b19('0x33')](_0x2be179[_0x2b19('0x2f')],_0x2be179['query']);_0x39506e[_0x2b19('0x34')]=_['intersection'](_0x2be179[_0x2b19('0x2f')],qs[_0x2b19('0x35')](_0x240d1a[_0x2b19('0x31')][_0x2b19('0x35')]));_0x39506e['attributes']=_0x39506e['attributes'][_0x2b19('0x36')]?_0x39506e[_0x2b19('0x34')]:_0x2be179[_0x2b19('0x2f')];if(!_0x240d1a[_0x2b19('0x31')][_0x2b19('0x37')](_0x2b19('0x38'))){_0x39506e[_0x2b19('0x1f')]=qs[_0x2b19('0x1f')](_0x240d1a[_0x2b19('0x31')]['limit']);_0x39506e[_0x2b19('0x1d')]=qs[_0x2b19('0x1d')](_0x240d1a[_0x2b19('0x31')][_0x2b19('0x1d')]);}_0x39506e[_0x2b19('0x39')]=qs['sort'](_0x240d1a['query']['sort']);_0x39506e[_0x2b19('0x3a')]=qs['filters'](_['pick'](_0x240d1a[_0x2b19('0x31')],_0x2be179['filters']),_0x2b1f4f);if(_0x240d1a[_0x2b19('0x31')]['filter']){_0x39506e[_0x2b19('0x3a')]=_[_0x2b19('0x3b')](_0x39506e[_0x2b19('0x3a')],{'$or':_[_0x2b19('0x30')](_0x2b1f4f,function(_0x65a6c5){if(_0x65a6c5[_0x2b19('0x2d')]!==_0x2b19('0x3c')){var _0x2b2427={};_0x2b2427[_0x65a6c5[_0x2b19('0x28')]]={'$like':'%'+_0x240d1a[_0x2b19('0x31')]['filter']+'%'};return _0x2b2427;}})});}_0x39506e=_[_0x2b19('0x3b')]({},_0x39506e,_0x240d1a[_0x2b19('0x3d')]);var _0x460ea7={'where':_0x39506e[_0x2b19('0x3a')]};return db[_0x2b19('0x2b')][_0x2b19('0x20')](_0x460ea7)[_0x2b19('0x25')](function(_0x26c0ad){_0x4df76e[_0x2b19('0x20')]=_0x26c0ad;if(_0x240d1a[_0x2b19('0x31')][_0x2b19('0x3e')]){_0x39506e['include']=[{'all':!![]}];}return db[_0x2b19('0x2b')][_0x2b19('0x3f')](_0x39506e);})[_0x2b19('0x25')](function(_0x36966e){_0x4df76e[_0x2b19('0x40')]=_0x36966e;return _0x4df76e;})[_0x2b19('0x25')](respondWithFilteredResult(_0x5a04c8,_0x39506e))['catch'](handleError(_0x5a04c8,null));};exports[_0x2b19('0x41')]=function(_0x3ab250,_0x3932fe){var _0x3bac3e={'raw':![],'where':{'id':_0x3ab250[_0x2b19('0x42')]['id']}},_0x5c0591={};_0x5c0591[_0x2b19('0x2f')]=_['keys'](db[_0x2b19('0x2b')][_0x2b19('0x2c')]);_0x5c0591[_0x2b19('0x31')]=_[_0x2b19('0x43')](_0x3ab250[_0x2b19('0x31')]);_0x5c0591[_0x2b19('0x32')]=_[_0x2b19('0x33')](_0x5c0591[_0x2b19('0x2f')],_0x5c0591['query']);_0x3bac3e['attributes']=_[_0x2b19('0x33')](_0x5c0591[_0x2b19('0x2f')],qs[_0x2b19('0x35')](_0x3ab250[_0x2b19('0x31')][_0x2b19('0x35')]));_0x3bac3e[_0x2b19('0x34')]=_0x3bac3e[_0x2b19('0x34')]['length']?_0x3bac3e[_0x2b19('0x34')]:_0x5c0591[_0x2b19('0x2f')];if(_0x3ab250[_0x2b19('0x31')][_0x2b19('0x3e')]){_0x3bac3e[_0x2b19('0x44')]=[{'all':!![]}];}_0x3bac3e=_['merge']({},_0x3bac3e,_0x3ab250[_0x2b19('0x3d')]);return db[_0x2b19('0x2b')][_0x2b19('0x45')](_0x3bac3e)['then'](handleEntityNotFound(_0x3932fe,null))['then'](respondWithResult(_0x3932fe,null))[_0x2b19('0x46')](handleError(_0x3932fe,null));};exports[_0x2b19('0x47')]=function(_0x5bd33b,_0xbd8b5){return db['SalesforceAccount'][_0x2b19('0x47')](_0x5bd33b[_0x2b19('0x48')],{})[_0x2b19('0x25')](respondWithResult(_0xbd8b5,0xc9))[_0x2b19('0x46')](handleError(_0xbd8b5,null));};exports[_0x2b19('0x24')]=function(_0x5354c8,_0x23b0cb){if(_0x5354c8[_0x2b19('0x48')]['id']){delete _0x5354c8[_0x2b19('0x48')]['id'];}return db[_0x2b19('0x2b')][_0x2b19('0x45')]({'where':{'id':_0x5354c8[_0x2b19('0x42')]['id']}})['then'](handleEntityNotFound(_0x23b0cb,null))[_0x2b19('0x25')](saveUpdates(_0x5354c8['body'],null))['then'](respondWithResult(_0x23b0cb,null))['catch'](handleError(_0x23b0cb,null));};exports[_0x2b19('0x26')]=function(_0x4999d0,_0x14f250){return db[_0x2b19('0x2b')][_0x2b19('0x45')]({'where':{'id':_0x4999d0['params']['id']}})[_0x2b19('0x25')](handleEntityNotFound(_0x14f250,null))[_0x2b19('0x25')](removeEntity(_0x14f250,null))['catch'](handleError(_0x14f250,null));};exports[_0x2b19('0x49')]=function(_0x3b7c11,_0x30ef02,_0xfc6ab0){var _0x56efae={};var _0x5b721c={};var _0x40c45d;var _0x3d578a;return db['SalesforceAccount']['findOne']({'where':{'id':_0x3b7c11[_0x2b19('0x42')]['id']}})[_0x2b19('0x25')](handleEntityNotFound(_0x30ef02,null))[_0x2b19('0x25')](function(_0x23247f){if(_0x23247f){_0x40c45d=_0x23247f;_0x5b721c[_0x2b19('0x2f')]=_[_0x2b19('0x43')](db[_0x2b19('0x4a')][_0x2b19('0x2c')]);_0x5b721c[_0x2b19('0x31')]=_[_0x2b19('0x43')](_0x3b7c11[_0x2b19('0x31')]);_0x5b721c['filters']=_['intersection'](_0x5b721c[_0x2b19('0x2f')],_0x5b721c[_0x2b19('0x31')]);_0x56efae[_0x2b19('0x34')]=_[_0x2b19('0x33')](_0x5b721c[_0x2b19('0x2f')],qs[_0x2b19('0x35')](_0x3b7c11[_0x2b19('0x31')][_0x2b19('0x35')]));_0x56efae['attributes']=_0x56efae[_0x2b19('0x34')][_0x2b19('0x36')]?_0x56efae['attributes']:_0x5b721c[_0x2b19('0x2f')];_0x56efae[_0x2b19('0x39')]=qs[_0x2b19('0x4b')](_0x3b7c11[_0x2b19('0x31')][_0x2b19('0x4b')]);_0x56efae[_0x2b19('0x3a')]=qs[_0x2b19('0x32')](_[_0x2b19('0x4c')](_0x3b7c11[_0x2b19('0x31')],_0x5b721c[_0x2b19('0x32')]));if(_0x3b7c11[_0x2b19('0x31')][_0x2b19('0x4d')]){_0x56efae[_0x2b19('0x3a')]=_[_0x2b19('0x3b')](_0x56efae[_0x2b19('0x3a')],{'$or':_[_0x2b19('0x30')](_0x56efae[_0x2b19('0x34')],function(_0x29572a){var _0x120cbf={};_0x120cbf[_0x29572a]={'$like':'%'+_0x3b7c11[_0x2b19('0x31')]['filter']+'%'};return _0x120cbf;})});}_0x56efae=_[_0x2b19('0x3b')]({},_0x56efae,_0x3b7c11['options']);return _0x40c45d['getConfigurations'](_0x56efae);}})[_0x2b19('0x25')](function(_0x36c08d){if(_0x36c08d){_0x3d578a=_0x36c08d[_0x2b19('0x36')];if(!_0x3b7c11['query'][_0x2b19('0x37')](_0x2b19('0x38'))){_0x56efae[_0x2b19('0x1f')]=qs[_0x2b19('0x1f')](_0x3b7c11[_0x2b19('0x31')]['limit']);_0x56efae[_0x2b19('0x1d')]=qs[_0x2b19('0x1d')](_0x3b7c11['query'][_0x2b19('0x1d')]);}return _0x40c45d[_0x2b19('0x49')](_0x56efae);}})[_0x2b19('0x25')](function(_0x4327c2){if(_0x4327c2){return _0x4327c2?{'count':_0x3d578a,'rows':_0x4327c2}:null;}})[_0x2b19('0x25')](respondWithResult(_0x30ef02,null))['catch'](handleError(_0x30ef02,null));};exports['addConfiguration']=function(_0x567b3e,_0x58cf0f,_0x1e015c){if(_0x567b3e[_0x2b19('0x48')]['id']){delete _0x567b3e['body']['id'];}return db[_0x2b19('0x2b')][_0x2b19('0x4e')]({'where':{'id':_0x567b3e[_0x2b19('0x42')]['id']}})[_0x2b19('0x25')](handleEntityNotFound(_0x58cf0f,null))[_0x2b19('0x25')](function(_0x460ab7){if(_0x460ab7){_0x567b3e[_0x2b19('0x48')][_0x2b19('0x4f')]=_0x460ab7['id'];_0x567b3e[_0x2b19('0x48')][_0x2b19('0x50')]=integrations[_0x2b19('0x51')](_0x567b3e[_0x2b19('0x48')][_0x2b19('0x52')],_0x567b3e['body'][_0x2b19('0x2d')]);_0x567b3e[_0x2b19('0x48')][_0x2b19('0x53')]=integrations[_0x2b19('0x54')](_0x567b3e[_0x2b19('0x48')][_0x2b19('0x52')],_0x567b3e[_0x2b19('0x48')]['type']);return db[_0x2b19('0x4a')][_0x2b19('0x47')](_0x567b3e['body'],{'include':[{'model':db[_0x2b19('0x55')],'as':_0x2b19('0x50')},{'model':db[_0x2b19('0x55')],'as':_0x2b19('0x53')}]});}return null;})[_0x2b19('0x25')](respondWithResult(_0x58cf0f,null))[_0x2b19('0x46')](handleError(_0x58cf0f,null));};exports['getFields']=function(_0x1db585,_0x3dc0fb,_0x1e3763){var _0x3d2fd9;var _0x1a38c5='';var _0x37aedb='Task';return db[_0x2b19('0x2b')][_0x2b19('0x4e')]({'where':{'id':_0x1db585[_0x2b19('0x42')]['id']},'attributes':['id',_0x2b19('0x56'),_0x2b19('0x57'),_0x2b19('0x58'),'username','password',_0x2b19('0x59')]})[_0x2b19('0x25')](handleEntityNotFound(_0x3dc0fb,null))[_0x2b19('0x25')](function(_0x3ee137){if(_0x3ee137){_0x1a38c5=_0x3ee137['remoteUri'];var _0x3c6781=_0x1a38c5['slice'](-0x1);if(_0x3c6781==='/'){_0x1a38c5=_0x1a38c5[_0x2b19('0x5a')](0x0,_0x1a38c5['lastIndexOf'](_0x3c6781));}_0x3d2fd9=new jsforce[(_0x2b19('0x5b'))]({'oauth2':{'loginUrl':_0x1a38c5,'clientId':_0x3ee137[_0x2b19('0x57')],'clientSecret':_0x3ee137['clientSecret']}});return _0x3d2fd9[_0x2b19('0x5c')](_0x3ee137[_0x2b19('0x5d')],_0x3ee137[_0x2b19('0x5e')][_0x2b19('0x5f')](_0x3ee137[_0x2b19('0x59')]));}})[_0x2b19('0x25')](function(_0x147a26){if(_0x147a26){if(!_[_0x2b19('0x60')](_0x1db585[_0x2b19('0x31')][_0x2b19('0x61')])){_0x37aedb=_0x1db585[_0x2b19('0x31')][_0x2b19('0x61')];}return _0x3d2fd9[_0x2b19('0x62')](_0x37aedb)[_0x2b19('0x63')]();}})['then'](function(_0x53adcc){var _0x433d0=[_0x2b19('0x64'),_0x2b19('0x65'),_0x2b19('0x66'),_0x2b19('0x67'),_0x2b19('0x68'),_0x2b19('0x69')];var _0x3d268a=[_0x2b19('0x6a'),_0x2b19('0x6b'),_0x2b19('0x6c'),'boolean','email',_0x2b19('0x6d'),_0x2b19('0x6e')];if(_0x53adcc){_[_0x2b19('0x6f')](_0x53adcc[_0x2b19('0x35')],function(_0x1341c7){return _0x433d0[_0x2b19('0x70')](_0x1341c7['name'])||!_0x3d268a[_0x2b19('0x70')](_0x1341c7[_0x2b19('0x2d')]);});return{'count':_0x53adcc['fields'][_0x2b19('0x36')],'rows':_[_0x2b19('0x30')](_0x53adcc[_0x2b19('0x35')],function(_0x5bf64d){return{'id':_0x5bf64d['name'],'name':_0x5bf64d[_0x2b19('0x71')],'custom':_0x5bf64d['custom'],'options':_0x5bf64d['picklistValues'][_0x2b19('0x36')]>0x0?_['map'](_0x5bf64d[_0x2b19('0x72')],function(_0x3721f5){return{'name':_0x3721f5[_0x2b19('0x71')],'value':_0x3721f5[_0x2b19('0x73')]};}):_0x5bf64d[_0x2b19('0x2d')]==_0x2b19('0x74')?[{'name':_0x2b19('0x75'),'value':'true'},{'name':'False','value':_0x2b19('0x76')}]:[]};})};}})[_0x2b19('0x25')](respondWithResult(_0x3dc0fb,null))[_0x2b19('0x46')](function(_0x30aba3){var _0x16f5a5=_0x1db585[_0x2b19('0x31')][_0x2b19('0x77')]?0x1f4:_0x30aba3[_0x2b19('0x78')]||0x1f4;logger[_0x2b19('0x27')](_0x2b19('0x79'),_0x2b19('0x7a'),_0x16f5a5,JSON['stringify'](_0x30aba3));delete _0x30aba3['name'];if(_0x16f5a5===0x191){_0x16f5a5=0x190;}_0x3dc0fb['status'](_0x16f5a5)[_0x2b19('0x29')](_0x1db585[_0x2b19('0x31')][_0x2b19('0x77')]?{'message':_0x2b19('0x7b'),'statusCode':_0x30aba3[_0x2b19('0x78')]}:_0x30aba3);});}; \ No newline at end of file +var _0xcb69=['getConfigurations','addConfiguration','getSubjects','channel','getDescriptions','SalesforceConfiguration','SalesforceField','Descriptions','getFields','Task','remoteUri','clientId','clientSecret','username','slice','substring','Connection','login','concat','securityToken','isNil','ticketType','sobject','OwnerId','ActivityDate','IsReminderSet','Subject','string','picklist','email','textarea','phone','includes','picklistValues','label','value','True','true','False','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','test','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','destroy','then','error','stack','name','send','index','map','SalesforceAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','catch','show','params','create','body','update','find','findOne','nolimit'];(function(_0x1d9e40,_0x1c44db){var _0x2ee94f=function(_0x37a330){while(--_0x37a330){_0x1d9e40['push'](_0x1d9e40['shift']());}};_0x2ee94f(++_0x1c44db);}(_0xcb69,0xab));var _0x9cb6=function(_0x6ee536,_0x312299){_0x6ee536=_0x6ee536-0x0;var _0x2d4126=_0xcb69[_0x6ee536];return _0x2d4126;};'use strict';var emlformat=require(_0x9cb6('0x0'));var rimraf=require(_0x9cb6('0x1'));var zipdir=require(_0x9cb6('0x2'));var jsonpatch=require(_0x9cb6('0x3'));var rp=require(_0x9cb6('0x4'));var moment=require(_0x9cb6('0x5'));var BPromise=require(_0x9cb6('0x6'));var Mustache=require(_0x9cb6('0x7'));var util=require('util');var path=require(_0x9cb6('0x8'));var sox=require(_0x9cb6('0x9'));var csv=require('to-csv');var ejs=require(_0x9cb6('0xa'));var fs=require('fs');var fs_extra=require(_0x9cb6('0xb'));var _=require(_0x9cb6('0xc'));var squel=require(_0x9cb6('0xd'));var crypto=require('crypto');var jsforce=require(_0x9cb6('0xe'));var deskjs=require(_0x9cb6('0xf'));var toCsv=require(_0x9cb6('0x10'));var querystring=require(_0x9cb6('0x11'));var Papa=require(_0x9cb6('0x12'));var Redis=require(_0x9cb6('0x13'));var authService=require(_0x9cb6('0x14'));var qs=require(_0x9cb6('0x15'));var as=require(_0x9cb6('0x16'));var hardwareService=require(_0x9cb6('0x17'));var logger=require('../../config/logger')(_0x9cb6('0x18'));var utils=require(_0x9cb6('0x19'));var config=require(_0x9cb6('0x1a'));var licenseUtil=require(_0x9cb6('0x1b'));var db=require(_0x9cb6('0x1c'))['db'];var integrations=require(_0x9cb6('0x1d'));function respondWithStatusCode(_0x33d367,_0x11a14a){_0x11a14a=_0x11a14a||0xcc;return function(_0xa76558){if(_0xa76558){return _0x33d367[_0x9cb6('0x1e')](_0x11a14a);}return _0x33d367['status'](_0x11a14a)[_0x9cb6('0x1f')]();};}function respondWithResult(_0x1906c5,_0x1fe52b){_0x1fe52b=_0x1fe52b||0xc8;return function(_0x5585f6){if(_0x5585f6){return _0x1906c5[_0x9cb6('0x20')](_0x1fe52b)[_0x9cb6('0x21')](_0x5585f6);}};}function respondWithFilteredResult(_0x803b65,_0x22cb6f){return function(_0x46bbe4){if(_0x46bbe4){var _0x31bf68=typeof _0x22cb6f[_0x9cb6('0x22')]===_0x9cb6('0x23')&&typeof _0x22cb6f[_0x9cb6('0x24')]===_0x9cb6('0x23');var _0x3dc58f=_0x46bbe4[_0x9cb6('0x25')];var _0x2cf023=_0x31bf68?0x0:_0x22cb6f[_0x9cb6('0x22')];var _0x37e5e0=_0x31bf68?_0x46bbe4[_0x9cb6('0x25')]:_0x22cb6f[_0x9cb6('0x22')]+_0x22cb6f[_0x9cb6('0x24')];var _0x16ebd4;if(_0x37e5e0>=_0x3dc58f){_0x37e5e0=_0x3dc58f;_0x16ebd4=0xc8;}else{_0x16ebd4=0xce;}_0x803b65[_0x9cb6('0x20')](_0x16ebd4);return _0x803b65[_0x9cb6('0x26')](_0x9cb6('0x27'),_0x2cf023+'-'+_0x37e5e0+'/'+_0x3dc58f)[_0x9cb6('0x21')](_0x46bbe4);}return null;};}function patchUpdates(_0x3ea571){return function(_0x5a628f){try{jsonpatch[_0x9cb6('0x28')](_0x5a628f,_0x3ea571,!![]);}catch(_0x3fdf64){return BPromise['reject'](_0x3fdf64);}return _0x5a628f[_0x9cb6('0x29')]();};}function saveUpdates(_0x228f04,_0x54c771){return function(_0xa92dd1){if(_0xa92dd1){return _0xa92dd1['update'](_0x228f04)['then'](function(_0x2c735c){return _0x2c735c;});}return null;};}function removeEntity(_0x1dbd15,_0x5c9899){return function(_0x3ee97f){if(_0x3ee97f){return _0x3ee97f[_0x9cb6('0x2a')]()[_0x9cb6('0x2b')](function(){_0x1dbd15[_0x9cb6('0x20')](0xcc)[_0x9cb6('0x1f')]();});}};}function handleEntityNotFound(_0x3b2249,_0x2993f6){return function(_0x56e9ad){if(!_0x56e9ad){_0x3b2249['sendStatus'](0x194);}return _0x56e9ad;};}function handleError(_0x1ef587,_0x459cda){_0x459cda=_0x459cda||0x1f4;return function(_0x2ff020){logger[_0x9cb6('0x2c')](_0x2ff020[_0x9cb6('0x2d')]);if(_0x2ff020[_0x9cb6('0x2e')]){delete _0x2ff020[_0x9cb6('0x2e')];}_0x1ef587[_0x9cb6('0x20')](_0x459cda)[_0x9cb6('0x2f')](_0x2ff020);};}exports[_0x9cb6('0x30')]=function(_0x483ce9,_0xb15516){var _0x42e167={},_0x54c5bf={},_0x44057e={'count':0x0,'rows':[]};var _0x119aa4=_[_0x9cb6('0x31')](db[_0x9cb6('0x32')][_0x9cb6('0x33')],function(_0xfee2a9){return{'name':_0xfee2a9[_0x9cb6('0x34')],'type':_0xfee2a9[_0x9cb6('0x35')][_0x9cb6('0x36')]};});_0x54c5bf[_0x9cb6('0x37')]=_[_0x9cb6('0x31')](_0x119aa4,_0x9cb6('0x2e'));_0x54c5bf[_0x9cb6('0x38')]=_[_0x9cb6('0x39')](_0x483ce9[_0x9cb6('0x38')]);_0x54c5bf[_0x9cb6('0x3a')]=_['intersection'](_0x54c5bf[_0x9cb6('0x37')],_0x54c5bf[_0x9cb6('0x38')]);_0x42e167['attributes']=_[_0x9cb6('0x3b')](_0x54c5bf['model'],qs[_0x9cb6('0x3c')](_0x483ce9[_0x9cb6('0x38')]['fields']));_0x42e167[_0x9cb6('0x3d')]=_0x42e167[_0x9cb6('0x3d')][_0x9cb6('0x3e')]?_0x42e167[_0x9cb6('0x3d')]:_0x54c5bf[_0x9cb6('0x37')];if(!_0x483ce9[_0x9cb6('0x38')][_0x9cb6('0x3f')]('nolimit')){_0x42e167[_0x9cb6('0x24')]=qs[_0x9cb6('0x24')](_0x483ce9[_0x9cb6('0x38')][_0x9cb6('0x24')]);_0x42e167[_0x9cb6('0x22')]=qs['offset'](_0x483ce9[_0x9cb6('0x38')][_0x9cb6('0x22')]);}_0x42e167[_0x9cb6('0x40')]=qs['sort'](_0x483ce9[_0x9cb6('0x38')][_0x9cb6('0x41')]);_0x42e167[_0x9cb6('0x42')]=qs[_0x9cb6('0x3a')](_[_0x9cb6('0x43')](_0x483ce9['query'],_0x54c5bf[_0x9cb6('0x3a')]),_0x119aa4);if(_0x483ce9['query'][_0x9cb6('0x44')]){_0x42e167['where']=_[_0x9cb6('0x45')](_0x42e167[_0x9cb6('0x42')],{'$or':_[_0x9cb6('0x31')](_0x119aa4,function(_0xca1c65){if(_0xca1c65[_0x9cb6('0x35')]!=='VIRTUAL'){var _0x4893ac={};_0x4893ac[_0xca1c65[_0x9cb6('0x2e')]]={'$like':'%'+_0x483ce9[_0x9cb6('0x38')][_0x9cb6('0x44')]+'%'};return _0x4893ac;}})});}_0x42e167=_['merge']({},_0x42e167,_0x483ce9[_0x9cb6('0x46')]);var _0x34bc6b={'where':_0x42e167[_0x9cb6('0x42')]};return db[_0x9cb6('0x32')]['count'](_0x34bc6b)[_0x9cb6('0x2b')](function(_0x4c181a){_0x44057e[_0x9cb6('0x25')]=_0x4c181a;if(_0x483ce9[_0x9cb6('0x38')][_0x9cb6('0x47')]){_0x42e167[_0x9cb6('0x48')]=[{'all':!![]}];}return db[_0x9cb6('0x32')][_0x9cb6('0x49')](_0x42e167);})[_0x9cb6('0x2b')](function(_0x25ca19){_0x44057e['rows']=_0x25ca19;return _0x44057e;})['then'](respondWithFilteredResult(_0xb15516,_0x42e167))[_0x9cb6('0x4a')](handleError(_0xb15516,null));};exports[_0x9cb6('0x4b')]=function(_0x16cd6b,_0x40aa9e){var _0x45b2fa={'raw':![],'where':{'id':_0x16cd6b[_0x9cb6('0x4c')]['id']}},_0x4a6db4={};_0x4a6db4[_0x9cb6('0x37')]=_[_0x9cb6('0x39')](db[_0x9cb6('0x32')][_0x9cb6('0x33')]);_0x4a6db4[_0x9cb6('0x38')]=_['keys'](_0x16cd6b[_0x9cb6('0x38')]);_0x4a6db4['filters']=_[_0x9cb6('0x3b')](_0x4a6db4['model'],_0x4a6db4[_0x9cb6('0x38')]);_0x45b2fa[_0x9cb6('0x3d')]=_['intersection'](_0x4a6db4['model'],qs[_0x9cb6('0x3c')](_0x16cd6b[_0x9cb6('0x38')][_0x9cb6('0x3c')]));_0x45b2fa[_0x9cb6('0x3d')]=_0x45b2fa[_0x9cb6('0x3d')][_0x9cb6('0x3e')]?_0x45b2fa['attributes']:_0x4a6db4[_0x9cb6('0x37')];if(_0x16cd6b[_0x9cb6('0x38')][_0x9cb6('0x47')]){_0x45b2fa[_0x9cb6('0x48')]=[{'all':!![]}];}_0x45b2fa=_['merge']({},_0x45b2fa,_0x16cd6b['options']);return db[_0x9cb6('0x32')]['find'](_0x45b2fa)[_0x9cb6('0x2b')](handleEntityNotFound(_0x40aa9e,null))[_0x9cb6('0x2b')](respondWithResult(_0x40aa9e,null))[_0x9cb6('0x4a')](handleError(_0x40aa9e,null));};exports[_0x9cb6('0x4d')]=function(_0x212b40,_0x288e7f){return db[_0x9cb6('0x32')]['create'](_0x212b40[_0x9cb6('0x4e')],{})['then'](respondWithResult(_0x288e7f,0xc9))[_0x9cb6('0x4a')](handleError(_0x288e7f,null));};exports[_0x9cb6('0x4f')]=function(_0x44f06c,_0x3b06e0){if(_0x44f06c[_0x9cb6('0x4e')]['id']){delete _0x44f06c[_0x9cb6('0x4e')]['id'];}return db[_0x9cb6('0x32')][_0x9cb6('0x50')]({'where':{'id':_0x44f06c[_0x9cb6('0x4c')]['id']}})[_0x9cb6('0x2b')](handleEntityNotFound(_0x3b06e0,null))[_0x9cb6('0x2b')](saveUpdates(_0x44f06c[_0x9cb6('0x4e')],null))['then'](respondWithResult(_0x3b06e0,null))['catch'](handleError(_0x3b06e0,null));};exports[_0x9cb6('0x2a')]=function(_0x48f8c1,_0x4c2b28){return db['SalesforceAccount']['find']({'where':{'id':_0x48f8c1[_0x9cb6('0x4c')]['id']}})['then'](handleEntityNotFound(_0x4c2b28,null))[_0x9cb6('0x2b')](removeEntity(_0x4c2b28,null))[_0x9cb6('0x4a')](handleError(_0x4c2b28,null));};exports['getConfigurations']=function(_0x138824,_0x2d9969,_0x56545e){var _0x345841={};var _0x249109={};var _0x43b913;var _0x564767;return db[_0x9cb6('0x32')][_0x9cb6('0x51')]({'where':{'id':_0x138824[_0x9cb6('0x4c')]['id']}})['then'](handleEntityNotFound(_0x2d9969,null))[_0x9cb6('0x2b')](function(_0x27ae3c){if(_0x27ae3c){_0x43b913=_0x27ae3c;_0x249109[_0x9cb6('0x37')]=_[_0x9cb6('0x39')](db['SalesforceConfiguration'][_0x9cb6('0x33')]);_0x249109['query']=_[_0x9cb6('0x39')](_0x138824['query']);_0x249109[_0x9cb6('0x3a')]=_[_0x9cb6('0x3b')](_0x249109[_0x9cb6('0x37')],_0x249109[_0x9cb6('0x38')]);_0x345841[_0x9cb6('0x3d')]=_[_0x9cb6('0x3b')](_0x249109[_0x9cb6('0x37')],qs[_0x9cb6('0x3c')](_0x138824[_0x9cb6('0x38')][_0x9cb6('0x3c')]));_0x345841['attributes']=_0x345841[_0x9cb6('0x3d')][_0x9cb6('0x3e')]?_0x345841[_0x9cb6('0x3d')]:_0x249109[_0x9cb6('0x37')];_0x345841[_0x9cb6('0x40')]=qs['sort'](_0x138824[_0x9cb6('0x38')][_0x9cb6('0x41')]);_0x345841[_0x9cb6('0x42')]=qs[_0x9cb6('0x3a')](_[_0x9cb6('0x43')](_0x138824[_0x9cb6('0x38')],_0x249109[_0x9cb6('0x3a')]));if(_0x138824[_0x9cb6('0x38')][_0x9cb6('0x44')]){_0x345841[_0x9cb6('0x42')]=_[_0x9cb6('0x45')](_0x345841[_0x9cb6('0x42')],{'$or':_[_0x9cb6('0x31')](_0x345841[_0x9cb6('0x3d')],function(_0x4d4731){var _0x3db745={};_0x3db745[_0x4d4731]={'$like':'%'+_0x138824['query'][_0x9cb6('0x44')]+'%'};return _0x3db745;})});}_0x345841=_[_0x9cb6('0x45')]({},_0x345841,_0x138824[_0x9cb6('0x46')]);return _0x43b913['getConfigurations'](_0x345841);}})[_0x9cb6('0x2b')](function(_0x267056){if(_0x267056){_0x564767=_0x267056[_0x9cb6('0x3e')];if(!_0x138824[_0x9cb6('0x38')][_0x9cb6('0x3f')](_0x9cb6('0x52'))){_0x345841['limit']=qs['limit'](_0x138824[_0x9cb6('0x38')][_0x9cb6('0x24')]);_0x345841['offset']=qs['offset'](_0x138824[_0x9cb6('0x38')]['offset']);}return _0x43b913[_0x9cb6('0x53')](_0x345841);}})['then'](function(_0x566ea4){if(_0x566ea4){return _0x566ea4?{'count':_0x564767,'rows':_0x566ea4}:null;}})[_0x9cb6('0x2b')](respondWithResult(_0x2d9969,null))[_0x9cb6('0x4a')](handleError(_0x2d9969,null));};exports[_0x9cb6('0x54')]=function(_0x30027c,_0x255f32,_0x41f641){if(_0x30027c[_0x9cb6('0x4e')]['id']){delete _0x30027c['body']['id'];}return db['SalesforceAccount'][_0x9cb6('0x51')]({'where':{'id':_0x30027c[_0x9cb6('0x4c')]['id']}})['then'](handleEntityNotFound(_0x255f32,null))['then'](function(_0x13914d){if(_0x13914d){_0x30027c[_0x9cb6('0x4e')]['AccountId']=_0x13914d['id'];_0x30027c[_0x9cb6('0x4e')]['Subjects']=integrations[_0x9cb6('0x55')](_0x30027c[_0x9cb6('0x4e')][_0x9cb6('0x56')],_0x30027c[_0x9cb6('0x4e')][_0x9cb6('0x35')]);_0x30027c['body']['Descriptions']=integrations[_0x9cb6('0x57')](_0x30027c[_0x9cb6('0x4e')][_0x9cb6('0x56')],_0x30027c[_0x9cb6('0x4e')][_0x9cb6('0x35')]);return db[_0x9cb6('0x58')]['create'](_0x30027c[_0x9cb6('0x4e')],{'include':[{'model':db[_0x9cb6('0x59')],'as':'Subjects'},{'model':db['SalesforceField'],'as':_0x9cb6('0x5a')}]});}return null;})['then'](respondWithResult(_0x255f32,null))[_0x9cb6('0x4a')](handleError(_0x255f32,null));};exports[_0x9cb6('0x5b')]=function(_0x4ad55e,_0x4ebbbe,_0x5d33a8){var _0x3d65c2;var _0x270718='';var _0x3f61bb=_0x9cb6('0x5c');return db[_0x9cb6('0x32')][_0x9cb6('0x51')]({'where':{'id':_0x4ad55e[_0x9cb6('0x4c')]['id']},'attributes':['id',_0x9cb6('0x5d'),_0x9cb6('0x5e'),_0x9cb6('0x5f'),_0x9cb6('0x60'),'password','securityToken']})[_0x9cb6('0x2b')](handleEntityNotFound(_0x4ebbbe,null))[_0x9cb6('0x2b')](function(_0x243fb6){if(_0x243fb6){_0x270718=_0x243fb6[_0x9cb6('0x5d')];var _0x4b4bb4=_0x270718[_0x9cb6('0x61')](-0x1);if(_0x4b4bb4==='/'){_0x270718=_0x270718[_0x9cb6('0x62')](0x0,_0x270718['lastIndexOf'](_0x4b4bb4));}_0x3d65c2=new jsforce[(_0x9cb6('0x63'))]({'oauth2':{'loginUrl':_0x270718,'clientId':_0x243fb6[_0x9cb6('0x5e')],'clientSecret':_0x243fb6[_0x9cb6('0x5f')]}});return _0x3d65c2[_0x9cb6('0x64')](_0x243fb6['username'],_0x243fb6['password'][_0x9cb6('0x65')](_0x243fb6[_0x9cb6('0x66')]));}})[_0x9cb6('0x2b')](function(_0x3d18f3){if(_0x3d18f3){if(!_[_0x9cb6('0x67')](_0x4ad55e[_0x9cb6('0x38')][_0x9cb6('0x68')])){_0x3f61bb=_0x4ad55e[_0x9cb6('0x38')][_0x9cb6('0x68')];}return _0x3d65c2[_0x9cb6('0x69')](_0x3f61bb)['describe']();}})[_0x9cb6('0x2b')](function(_0x1bd1f7){var _0x2b102f=[_0x9cb6('0x6a'),_0x9cb6('0x6b'),_0x9cb6('0x6c'),'IsRecurrence',_0x9cb6('0x6d'),'Description'];var _0x28b946=[_0x9cb6('0x6e'),'int',_0x9cb6('0x6f'),'boolean',_0x9cb6('0x70'),_0x9cb6('0x71'),_0x9cb6('0x72')];if(_0x1bd1f7){_['remove'](_0x1bd1f7[_0x9cb6('0x3c')],function(_0xe46d1d){return _0x2b102f[_0x9cb6('0x73')](_0xe46d1d['name'])||!_0x28b946[_0x9cb6('0x73')](_0xe46d1d[_0x9cb6('0x35')]);});return{'count':_0x1bd1f7[_0x9cb6('0x3c')][_0x9cb6('0x3e')],'rows':_[_0x9cb6('0x31')](_0x1bd1f7[_0x9cb6('0x3c')],function(_0x3ee70a){return{'id':_0x3ee70a['name'],'name':_0x3ee70a['label'],'custom':_0x3ee70a['custom'],'options':_0x3ee70a[_0x9cb6('0x74')][_0x9cb6('0x3e')]>0x0?_[_0x9cb6('0x31')](_0x3ee70a['picklistValues'],function(_0x5dc19e){return{'name':_0x5dc19e[_0x9cb6('0x75')],'value':_0x5dc19e[_0x9cb6('0x76')]};}):_0x3ee70a[_0x9cb6('0x35')]=='boolean'?[{'name':_0x9cb6('0x77'),'value':_0x9cb6('0x78')},{'name':_0x9cb6('0x79'),'value':'false'}]:[]};})};}})[_0x9cb6('0x2b')](respondWithResult(_0x4ebbbe,null))['catch'](function(_0x84e492){var _0x25a054=_0x4ad55e[_0x9cb6('0x38')]['test']?0x1f4:_0x84e492[_0x9cb6('0x7a')]||0x1f4;logger[_0x9cb6('0x2c')](_0x9cb6('0x7b'),_0x9cb6('0x5b'),_0x25a054,JSON[_0x9cb6('0x7c')](_0x84e492));delete _0x84e492['name'];if(_0x25a054===0x191){_0x25a054=0x190;}_0x4ebbbe[_0x9cb6('0x20')](_0x25a054)['send'](_0x4ad55e[_0x9cb6('0x38')][_0x9cb6('0x7d')]?{'message':_0x9cb6('0x7e'),'statusCode':_0x84e492[_0x9cb6('0x7a')]}:_0x84e492);});}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.model.js b/server/api/intSalesforceAccount/intSalesforceAccount.model.js index b2a5d2c..147e42c 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 _0xaf1b=['rimraf','../../components/integrations/configuration','exports','define','SalesforceAccount','int_salesforce_accounts','lodash','../../config/logger','api','moment'];(function(_0x1533fb,_0x5e9e7c){var _0x3ea3a8=function(_0x4ff676){while(--_0x4ff676){_0x1533fb['push'](_0x1533fb['shift']());}};_0x3ea3a8(++_0x5e9e7c);}(_0xaf1b,0x182));var _0xbaf1=function(_0x2a9693,_0x899be4){_0x2a9693=_0x2a9693-0x0;var _0x355c54=_0xaf1b[_0x2a9693];return _0x355c54;};'use strict';var _=require(_0xbaf1('0x0'));var util=require('util');var logger=require(_0xbaf1('0x1'))(_0xbaf1('0x2'));var moment=require(_0xbaf1('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xbaf1('0x4'));var config=require('../../config/environment');var attributes=require('./intSalesforceAccount.attributes');var integrations=require(_0xbaf1('0x5'));module[_0xbaf1('0x6')]=function(_0x11e407,_0x5e4e19){return _0x11e407[_0xbaf1('0x7')](_0xbaf1('0x8'),attributes,{'tableName':_0xbaf1('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2d57=['../../components/integrations/configuration','exports','int_salesforce_accounts','../../config/logger','api','moment','bluebird','request-promise','rimraf'];(function(_0x22d72b,_0x112e6d){var _0x35f65f=function(_0x23d67f){while(--_0x23d67f){_0x22d72b['push'](_0x22d72b['shift']());}};_0x35f65f(++_0x112e6d);}(_0x2d57,0x111));var _0x72d5=function(_0x44474f,_0x431580){_0x44474f=_0x44474f-0x0;var _0x427d97=_0x2d57[_0x44474f];return _0x427d97;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x72d5('0x0'))(_0x72d5('0x1'));var moment=require(_0x72d5('0x2'));var BPromise=require(_0x72d5('0x3'));var rp=require(_0x72d5('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x72d5('0x5'));var config=require('../../config/environment');var attributes=require('./intSalesforceAccount.attributes');var integrations=require(_0x72d5('0x6'));module[_0x72d5('0x7')]=function(_0x5ba7cf,_0x2877a7){return _0x5ba7cf['define']('SalesforceAccount',attributes,{'tableName':_0x72d5('0x8'),'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 536cb09..88ffb18 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 _0x0eaf=['model','ShowSalesforceAccount','find','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','SalesforceAccount,\x20%s,\x20%s','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','GetSalesforceAccount','SalesforceAccount','findAll','options','raw','where','attributes','limit','map','include'];(function(_0x2554d0,_0xaf59b2){var _0x55faf1=function(_0x2d1ba5){while(--_0x2d1ba5){_0x2554d0['push'](_0x2554d0['shift']());}};_0x55faf1(++_0xaf59b2);}(_0x0eaf,0x1ed));var _0xf0ea=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0x0eaf[_0x5d6456];return _0x4d66c1;};'use strict';var _=require(_0xf0ea('0x0'));var util=require(_0xf0ea('0x1'));var moment=require(_0xf0ea('0x2'));var BPromise=require(_0xf0ea('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf0ea('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xf0ea('0x5'));var logger=require(_0xf0ea('0x6'))('rpc');var config=require(_0xf0ea('0x7'));var jayson=require(_0xf0ea('0x8'));var client=jayson['client'][_0xf0ea('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3f1ff2,_0x39b0ba,_0x30a4f1){return new BPromise(function(_0x50a4e8,_0x4537f7){return client[_0xf0ea('0xa')](_0x3f1ff2,_0x30a4f1)[_0xf0ea('0xb')](function(_0x11a29e){logger[_0xf0ea('0xc')](_0xf0ea('0xd'),_0x39b0ba,'request\x20sent');logger[_0xf0ea('0xe')](_0xf0ea('0xf'),_0x39b0ba,_0xf0ea('0x10'),JSON[_0xf0ea('0x11')](_0x11a29e));if(_0x11a29e[_0xf0ea('0x12')]){if(_0x11a29e[_0xf0ea('0x12')][_0xf0ea('0x13')]===0x1f4){logger[_0xf0ea('0x12')]('SalesforceAccount,\x20%s,\x20%s',_0x39b0ba,_0x11a29e['error'][_0xf0ea('0x14')]);return _0x4537f7(_0x11a29e['error'][_0xf0ea('0x14')]);}logger[_0xf0ea('0x12')](_0xf0ea('0xd'),_0x39b0ba,_0x11a29e[_0xf0ea('0x12')][_0xf0ea('0x14')]);return _0x50a4e8(_0x11a29e[_0xf0ea('0x12')][_0xf0ea('0x14')]);}else{logger[_0xf0ea('0xc')](_0xf0ea('0xd'),_0x39b0ba,'request\x20sent');_0x50a4e8(_0x11a29e['result']['message']);}})[_0xf0ea('0x15')](function(_0x31a1a9){logger[_0xf0ea('0x12')](_0xf0ea('0xd'),_0x39b0ba,_0x31a1a9);_0x4537f7(_0x31a1a9);});});}exports[_0xf0ea('0x16')]=function(_0x5dadf3){var _0x4cdb1c=this;return new Promise(function(_0x57f6f4,_0x1e1b63){return db[_0xf0ea('0x17')][_0xf0ea('0x18')]({'raw':_0x5dadf3[_0xf0ea('0x19')]?_0x5dadf3[_0xf0ea('0x19')][_0xf0ea('0x1a')]===undefined?!![]:![]:!![],'where':_0x5dadf3['options']?_0x5dadf3[_0xf0ea('0x19')][_0xf0ea('0x1b')]||null:null,'attributes':_0x5dadf3[_0xf0ea('0x19')]?_0x5dadf3['options'][_0xf0ea('0x1c')]||null:null,'limit':_0x5dadf3[_0xf0ea('0x19')]?_0x5dadf3['options'][_0xf0ea('0x1d')]||null:null,'include':_0x5dadf3['options']?_0x5dadf3[_0xf0ea('0x19')]['include']?_[_0xf0ea('0x1e')](_0x5dadf3[_0xf0ea('0x19')][_0xf0ea('0x1f')],function(_0x5d3d57){return{'model':db[_0x5d3d57[_0xf0ea('0x20')]],'as':_0x5d3d57['as'],'attributes':_0x5d3d57[_0xf0ea('0x1c')],'include':_0x5d3d57['include']?_[_0xf0ea('0x1e')](_0x5d3d57[_0xf0ea('0x1f')],function(_0x461ea3){return{'model':db[_0x461ea3[_0xf0ea('0x20')]],'as':_0x461ea3['as'],'attributes':_0x461ea3[_0xf0ea('0x1c')],'include':_0x461ea3['include']?_[_0xf0ea('0x1e')](_0x461ea3[_0xf0ea('0x1f')],function(_0x41c1dd){return{'model':db[_0x41c1dd[_0xf0ea('0x20')]],'as':_0x41c1dd['as'],'attributes':_0x41c1dd['attributes']};}):[]};}):[]};}):[]:[]})[_0xf0ea('0xb')](function(_0x5145be){logger[_0xf0ea('0xc')](_0xf0ea('0x16'),_0x5dadf3);logger[_0xf0ea('0xe')](_0xf0ea('0x16'),_0x5dadf3,JSON[_0xf0ea('0x11')](_0x5145be));_0x57f6f4(_0x5145be);})[_0xf0ea('0x15')](function(_0x1673c7){logger['error']('GetSalesforceAccount',_0x1673c7[_0xf0ea('0x14')],_0x5dadf3);_0x1e1b63(_0x4cdb1c['error'](0x1f4,_0x1673c7[_0xf0ea('0x14')]));});});};exports[_0xf0ea('0x21')]=function(_0x19721d){var _0x2732de=this;return new Promise(function(_0x35e165,_0x5dc8e2){return db[_0xf0ea('0x17')][_0xf0ea('0x22')]({'raw':_0x19721d['options']?_0x19721d[_0xf0ea('0x19')][_0xf0ea('0x1a')]===undefined?!![]:![]:!![],'where':_0x19721d[_0xf0ea('0x19')]?_0x19721d[_0xf0ea('0x19')][_0xf0ea('0x1b')]||null:null,'attributes':_0x19721d[_0xf0ea('0x19')]?_0x19721d[_0xf0ea('0x19')][_0xf0ea('0x1c')]||null:null,'include':_0x19721d[_0xf0ea('0x19')]?_0x19721d[_0xf0ea('0x19')][_0xf0ea('0x1f')]?_[_0xf0ea('0x1e')](_0x19721d[_0xf0ea('0x19')][_0xf0ea('0x1f')],function(_0x50354e){return{'model':db[_0x50354e[_0xf0ea('0x20')]],'as':_0x50354e['as'],'attributes':_0x50354e['attributes'],'include':_0x50354e[_0xf0ea('0x1f')]?_[_0xf0ea('0x1e')](_0x50354e['include'],function(_0x385ed1){return{'model':db[_0x385ed1['model']],'as':_0x385ed1['as'],'attributes':_0x385ed1[_0xf0ea('0x1c')],'include':_0x385ed1[_0xf0ea('0x1f')]?_[_0xf0ea('0x1e')](_0x385ed1[_0xf0ea('0x1f')],function(_0x4725d0){return{'model':db[_0x4725d0[_0xf0ea('0x20')]],'as':_0x4725d0['as'],'attributes':_0x4725d0['attributes']};}):[]};}):[]};}):[]:[]})[_0xf0ea('0xb')](function(_0x4ead3c){logger[_0xf0ea('0xc')](_0xf0ea('0x21'),_0x19721d);logger['debug'](_0xf0ea('0x21'),_0x19721d,JSON[_0xf0ea('0x11')](_0x4ead3c));_0x35e165(_0x4ead3c);})[_0xf0ea('0x15')](function(_0x1709bc){logger[_0xf0ea('0x12')](_0xf0ea('0x21'),_0x1709bc['message'],_0x19721d);_0x5dc8e2(_0x2732de[_0xf0ea('0x12')](0x1f4,_0x1709bc['message']));});});}; \ No newline at end of file +var _0xf8cc=['SalesforceAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','GetSalesforceAccount','SalesforceAccount','findAll','options','raw','where','limit','include','map','model','attributes','ShowSalesforceAccount','lodash','util','randomstring','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','then','SalesforceAccount,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x273c39,_0x1052e6){var _0x46d6b5=function(_0x44f1fb){while(--_0x44f1fb){_0x273c39['push'](_0x273c39['shift']());}};_0x46d6b5(++_0x1052e6);}(_0xf8cc,0x173));var _0xcf8c=function(_0x30ab14,_0x225a5e){_0x30ab14=_0x30ab14-0x0;var _0x34b9ef=_0xf8cc[_0x30ab14];return _0x34b9ef;};'use strict';var _=require(_0xcf8c('0x0'));var util=require(_0xcf8c('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xcf8c('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xcf8c('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xcf8c('0x4'))('rpc');var config=require(_0xcf8c('0x5'));var jayson=require(_0xcf8c('0x6'));var client=jayson[_0xcf8c('0x7')][_0xcf8c('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1f77d2,_0x50b6eb,_0x391bb8){return new BPromise(function(_0x3ec3d0,_0xaa9d78){return client['request'](_0x1f77d2,_0x391bb8)[_0xcf8c('0x9')](function(_0x41a3e3){logger['info'](_0xcf8c('0xa'),_0x50b6eb,_0xcf8c('0xb'));logger[_0xcf8c('0xc')](_0xcf8c('0xd'),_0x50b6eb,_0xcf8c('0xb'),JSON[_0xcf8c('0xe')](_0x41a3e3));if(_0x41a3e3['error']){if(_0x41a3e3['error']['code']===0x1f4){logger['error'](_0xcf8c('0xa'),_0x50b6eb,_0x41a3e3[_0xcf8c('0xf')][_0xcf8c('0x10')]);return _0xaa9d78(_0x41a3e3[_0xcf8c('0xf')][_0xcf8c('0x10')]);}logger[_0xcf8c('0xf')](_0xcf8c('0xa'),_0x50b6eb,_0x41a3e3[_0xcf8c('0xf')][_0xcf8c('0x10')]);return _0x3ec3d0(_0x41a3e3['error'][_0xcf8c('0x10')]);}else{logger[_0xcf8c('0x11')](_0xcf8c('0xa'),_0x50b6eb,_0xcf8c('0xb'));_0x3ec3d0(_0x41a3e3[_0xcf8c('0x12')][_0xcf8c('0x10')]);}})[_0xcf8c('0x13')](function(_0x24855a){logger[_0xcf8c('0xf')](_0xcf8c('0xa'),_0x50b6eb,_0x24855a);_0xaa9d78(_0x24855a);});});}exports[_0xcf8c('0x14')]=function(_0x5da595){var _0x205a77=this;return new Promise(function(_0x35d751,_0x1d82cb){return db[_0xcf8c('0x15')][_0xcf8c('0x16')]({'raw':_0x5da595['options']?_0x5da595[_0xcf8c('0x17')][_0xcf8c('0x18')]===undefined?!![]:![]:!![],'where':_0x5da595[_0xcf8c('0x17')]?_0x5da595[_0xcf8c('0x17')][_0xcf8c('0x19')]||null:null,'attributes':_0x5da595[_0xcf8c('0x17')]?_0x5da595[_0xcf8c('0x17')]['attributes']||null:null,'limit':_0x5da595[_0xcf8c('0x17')]?_0x5da595['options'][_0xcf8c('0x1a')]||null:null,'include':_0x5da595[_0xcf8c('0x17')]?_0x5da595[_0xcf8c('0x17')][_0xcf8c('0x1b')]?_[_0xcf8c('0x1c')](_0x5da595[_0xcf8c('0x17')][_0xcf8c('0x1b')],function(_0x54a6c7){return{'model':db[_0x54a6c7[_0xcf8c('0x1d')]],'as':_0x54a6c7['as'],'attributes':_0x54a6c7['attributes'],'include':_0x54a6c7[_0xcf8c('0x1b')]?_[_0xcf8c('0x1c')](_0x54a6c7[_0xcf8c('0x1b')],function(_0x2d3c12){return{'model':db[_0x2d3c12[_0xcf8c('0x1d')]],'as':_0x2d3c12['as'],'attributes':_0x2d3c12[_0xcf8c('0x1e')],'include':_0x2d3c12['include']?_[_0xcf8c('0x1c')](_0x2d3c12[_0xcf8c('0x1b')],function(_0x589f67){return{'model':db[_0x589f67['model']],'as':_0x589f67['as'],'attributes':_0x589f67[_0xcf8c('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3dee06){logger[_0xcf8c('0x11')](_0xcf8c('0x14'),_0x5da595);logger[_0xcf8c('0xc')]('GetSalesforceAccount',_0x5da595,JSON['stringify'](_0x3dee06));_0x35d751(_0x3dee06);})[_0xcf8c('0x13')](function(_0x288828){logger[_0xcf8c('0xf')]('GetSalesforceAccount',_0x288828[_0xcf8c('0x10')],_0x5da595);_0x1d82cb(_0x205a77[_0xcf8c('0xf')](0x1f4,_0x288828[_0xcf8c('0x10')]));});});};exports[_0xcf8c('0x1f')]=function(_0x35124b){var _0x30a75d=this;return new Promise(function(_0x21533c,_0x442c73){return db[_0xcf8c('0x15')]['find']({'raw':_0x35124b[_0xcf8c('0x17')]?_0x35124b[_0xcf8c('0x17')][_0xcf8c('0x18')]===undefined?!![]:![]:!![],'where':_0x35124b['options']?_0x35124b['options'][_0xcf8c('0x19')]||null:null,'attributes':_0x35124b[_0xcf8c('0x17')]?_0x35124b['options'][_0xcf8c('0x1e')]||null:null,'include':_0x35124b[_0xcf8c('0x17')]?_0x35124b[_0xcf8c('0x17')][_0xcf8c('0x1b')]?_[_0xcf8c('0x1c')](_0x35124b[_0xcf8c('0x17')][_0xcf8c('0x1b')],function(_0x43c77a){return{'model':db[_0x43c77a[_0xcf8c('0x1d')]],'as':_0x43c77a['as'],'attributes':_0x43c77a[_0xcf8c('0x1e')],'include':_0x43c77a[_0xcf8c('0x1b')]?_[_0xcf8c('0x1c')](_0x43c77a[_0xcf8c('0x1b')],function(_0x162582){return{'model':db[_0x162582['model']],'as':_0x162582['as'],'attributes':_0x162582[_0xcf8c('0x1e')],'include':_0x162582['include']?_[_0xcf8c('0x1c')](_0x162582[_0xcf8c('0x1b')],function(_0x39fadf){return{'model':db[_0x39fadf[_0xcf8c('0x1d')]],'as':_0x39fadf['as'],'attributes':_0x39fadf[_0xcf8c('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xcf8c('0x9')](function(_0x1cf40f){logger['info'](_0xcf8c('0x1f'),_0x35124b);logger[_0xcf8c('0xc')](_0xcf8c('0x1f'),_0x35124b,JSON[_0xcf8c('0xe')](_0x1cf40f));_0x21533c(_0x1cf40f);})[_0xcf8c('0x13')](function(_0x561ef9){logger[_0xcf8c('0xf')](_0xcf8c('0x1f'),_0x561ef9[_0xcf8c('0x10')],_0x35124b);_0x442c73(_0x30a75d[_0xcf8c('0xf')](0x1f4,_0x561ef9['message']));});});}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/index.js b/server/api/intSalesforceConfiguration/index.js index d5714dd..dae2253 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 _0x7a54=['getSubjects','getDescriptions','post','create','put','update','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceConfiguration.controller','get','index','/:id','isAuthenticated','/:id/subjects'];(function(_0x3f3182,_0x39b127){var _0x1c4929=function(_0x3c1f85){while(--_0x3c1f85){_0x3f3182['push'](_0x3f3182['shift']());}};_0x1c4929(++_0x39b127);}(_0x7a54,0x106));var _0x47a5=function(_0x4dccb5,_0x3dfe43){_0x4dccb5=_0x4dccb5-0x0;var _0x2d10b1=_0x7a54[_0x4dccb5];return _0x2d10b1;};'use strict';var multer=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var path=require(_0x47a5('0x2'));var timeout=require('connect-timeout');var express=require(_0x47a5('0x3'));var router=express[_0x47a5('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x47a5('0x5'));var interaction=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var controller=require(_0x47a5('0x8'));router[_0x47a5('0x9')]('/',auth['isAuthenticated'](),controller[_0x47a5('0xa')]);router['get'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['show']);router[_0x47a5('0x9')]('/:id/fields',auth['isAuthenticated'](),controller['getFields']);router[_0x47a5('0x9')](_0x47a5('0xd'),auth['isAuthenticated'](),controller[_0x47a5('0xe')]);router['get']('/:id/descriptions',auth[_0x47a5('0xc')](),controller[_0x47a5('0xf')]);router[_0x47a5('0x10')]('/',auth[_0x47a5('0xc')](),controller[_0x47a5('0x11')]);router[_0x47a5('0x12')](_0x47a5('0xb'),auth['isAuthenticated'](),controller[_0x47a5('0x13')]);router[_0x47a5('0x14')](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller[_0x47a5('0x15')]);module[_0x47a5('0x16')]=router; \ No newline at end of file +var _0x0b0e=['post','create','put','/:id','update','destroy','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceConfiguration.controller','get','isAuthenticated','index','show','/:id/fields','/:id/subjects','getSubjects','getDescriptions'];(function(_0x5e36d1,_0x471178){var _0x950b9e=function(_0x1872f3){while(--_0x1872f3){_0x5e36d1['push'](_0x5e36d1['shift']());}};_0x950b9e(++_0x471178);}(_0x0b0e,0x187));var _0xe0b0=function(_0x2650e9,_0xb91cc){_0x2650e9=_0x2650e9-0x0;var _0x3511c8=_0x0b0e[_0x2650e9];return _0x3511c8;};'use strict';var multer=require(_0xe0b0('0x0'));var util=require('util');var path=require(_0xe0b0('0x1'));var timeout=require('connect-timeout');var express=require(_0xe0b0('0x2'));var router=express[_0xe0b0('0x3')]();var fs_extra=require(_0xe0b0('0x4'));var auth=require(_0xe0b0('0x5'));var interaction=require(_0xe0b0('0x6'));var config=require(_0xe0b0('0x7'));var controller=require(_0xe0b0('0x8'));router[_0xe0b0('0x9')]('/',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0xb')]);router[_0xe0b0('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xe0b0('0xc')]);router[_0xe0b0('0x9')](_0xe0b0('0xd'),auth[_0xe0b0('0xa')](),controller['getFields']);router[_0xe0b0('0x9')](_0xe0b0('0xe'),auth['isAuthenticated'](),controller[_0xe0b0('0xf')]);router[_0xe0b0('0x9')]('/:id/descriptions',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0x10')]);router[_0xe0b0('0x11')]('/',auth['isAuthenticated'](),controller[_0xe0b0('0x12')]);router[_0xe0b0('0x13')](_0xe0b0('0x14'),auth[_0xe0b0('0xa')](),controller[_0xe0b0('0x15')]);router['delete'](_0xe0b0('0x14'),auth[_0xe0b0('0xa')](),controller[_0xe0b0('0x16')]);module[_0xe0b0('0x17')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js index d774e02..7f50b97 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 _0xa06a=['contact_lead','lead','sequelize','exports','STRING','ENUM','contact','account_contact_lead','account'];(function(_0x2e79cc,_0x5ba75b){var _0x49915f=function(_0x4dbe48){while(--_0x4dbe48){_0x2e79cc['push'](_0x2e79cc['shift']());}};_0x49915f(++_0x5ba75b);}(_0xa06a,0x122));var _0xaa06=function(_0x3f662c,_0x1054d2){_0x3f662c=_0x3f662c-0x0;var _0x4b4186=_0xa06a[_0x3f662c];return _0x4b4186;};'use strict';var Sequelize=require(_0xaa06('0x0'));module[_0xaa06('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xaa06('0x2')]},'ticketType':{'type':Sequelize[_0xaa06('0x3')]('Task','Case'),'defaultValue':'Task'},'moduleSearch':{'type':Sequelize[_0xaa06('0x3')]('contact_lead',_0xaa06('0x4'),'lead',_0xaa06('0x5'),_0xaa06('0x6')),'defaultValue':_0xaa06('0x7')},'moduleCreate':{'type':Sequelize[_0xaa06('0x3')]('nothing','contact','lead',_0xaa06('0x6')),'defaultValue':_0xaa06('0x8')},'leadId':{'type':Sequelize[_0xaa06('0x2')]},'additionalSearchAccount':{'type':Sequelize[_0xaa06('0x2')]},'additionalSearchContact':{'type':Sequelize[_0xaa06('0x2')]},'additionalSearchLead':{'type':Sequelize[_0xaa06('0x2')]}}; \ No newline at end of file +var _0x5a1c=['account_contact_lead','account','nothing','contact','STRING','sequelize','exports','ENUM','Case','Task','contact_lead','lead'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x5a1c,0x1b5));var _0xc5a1=function(_0x4121df,_0x4f9645){_0x4121df=_0x4121df-0x0;var _0x3b1449=_0x5a1c[_0x4121df];return _0x3b1449;};'use strict';var Sequelize=require(_0xc5a1('0x0'));module[_0xc5a1('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'ticketType':{'type':Sequelize[_0xc5a1('0x2')]('Task',_0xc5a1('0x3')),'defaultValue':_0xc5a1('0x4')},'moduleSearch':{'type':Sequelize[_0xc5a1('0x2')](_0xc5a1('0x5'),'contact',_0xc5a1('0x6'),_0xc5a1('0x7'),_0xc5a1('0x8')),'defaultValue':'contact_lead'},'moduleCreate':{'type':Sequelize[_0xc5a1('0x2')](_0xc5a1('0x9'),_0xc5a1('0xa'),_0xc5a1('0x6'),_0xc5a1('0x8')),'defaultValue':_0xc5a1('0x6')},'leadId':{'type':Sequelize[_0xc5a1('0xb')]},'additionalSearchAccount':{'type':Sequelize[_0xc5a1('0xb')]},'additionalSearchContact':{'type':Sequelize[_0xc5a1('0xb')]},'additionalSearchLead':{'type':Sequelize[_0xc5a1('0xb')]}}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js index 4a23664..f6ec05a 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 _0x16b4=['moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','limit','undefined','count','set','Content-Range','json','apply','save','update','then','error','stack','send','index','map','SalesforceConfiguration','rawAttributes','fieldName','type','key','model','name','query','keys','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','includeAll','include','rows','catch','fields','options','find','create','body','params','destroy','findOne','SalesforceField','getFields','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise'];(function(_0x687bdb,_0x227948){var _0x3451e5=function(_0x531c9c){while(--_0x531c9c){_0x687bdb['push'](_0x687bdb['shift']());}};_0x3451e5(++_0x227948);}(_0x16b4,0xa9));var _0x416b=function(_0x2a0e3a,_0xfc2f30){_0x2a0e3a=_0x2a0e3a-0x0;var _0x4e4761=_0x16b4[_0x2a0e3a];return _0x4e4761;};'use strict';var emlformat=require(_0x416b('0x0'));var rimraf=require(_0x416b('0x1'));var zipdir=require(_0x416b('0x2'));var jsonpatch=require(_0x416b('0x3'));var rp=require(_0x416b('0x4'));var moment=require(_0x416b('0x5'));var BPromise=require(_0x416b('0x6'));var Mustache=require(_0x416b('0x7'));var util=require(_0x416b('0x8'));var path=require(_0x416b('0x9'));var sox=require(_0x416b('0xa'));var csv=require(_0x416b('0xb'));var ejs=require(_0x416b('0xc'));var fs=require('fs');var fs_extra=require(_0x416b('0xd'));var _=require(_0x416b('0xe'));var squel=require(_0x416b('0xf'));var crypto=require(_0x416b('0x10'));var jsforce=require(_0x416b('0x11'));var deskjs=require(_0x416b('0x12'));var toCsv=require(_0x416b('0xb'));var querystring=require('querystring');var Papa=require(_0x416b('0x13'));var Redis=require(_0x416b('0x14'));var authService=require(_0x416b('0x15'));var qs=require(_0x416b('0x16'));var as=require(_0x416b('0x17'));var hardwareService=require(_0x416b('0x18'));var logger=require(_0x416b('0x19'))(_0x416b('0x1a'));var utils=require(_0x416b('0x1b'));var config=require('../../config/environment');var licenseUtil=require(_0x416b('0x1c'));var db=require(_0x416b('0x1d'))['db'];function respondWithStatusCode(_0xaf0d94,_0x396c3a){_0x396c3a=_0x396c3a||0xcc;return function(_0x56faf5){if(_0x56faf5){return _0xaf0d94[_0x416b('0x1e')](_0x396c3a);}return _0xaf0d94['status'](_0x396c3a)[_0x416b('0x1f')]();};}function respondWithResult(_0xf786ae,_0x3f0f22){_0x3f0f22=_0x3f0f22||0xc8;return function(_0x2bc635){if(_0x2bc635){return _0xf786ae[_0x416b('0x20')](_0x3f0f22)['json'](_0x2bc635);}};}function respondWithFilteredResult(_0x4d02e9,_0x443633){return function(_0x17e7e2){if(_0x17e7e2){var _0x1819c9=typeof _0x443633[_0x416b('0x21')]==='undefined'&&typeof _0x443633[_0x416b('0x22')]===_0x416b('0x23');var _0x4cdfb2=_0x17e7e2['count'];var _0xe738=_0x1819c9?0x0:_0x443633[_0x416b('0x21')];var _0xa18cfe=_0x1819c9?_0x17e7e2[_0x416b('0x24')]:_0x443633[_0x416b('0x21')]+_0x443633[_0x416b('0x22')];var _0x1f9d62;if(_0xa18cfe>=_0x4cdfb2){_0xa18cfe=_0x4cdfb2;_0x1f9d62=0xc8;}else{_0x1f9d62=0xce;}_0x4d02e9[_0x416b('0x20')](_0x1f9d62);return _0x4d02e9[_0x416b('0x25')](_0x416b('0x26'),_0xe738+'-'+_0xa18cfe+'/'+_0x4cdfb2)[_0x416b('0x27')](_0x17e7e2);}return null;};}function patchUpdates(_0x9b9935){return function(_0x282688){try{jsonpatch[_0x416b('0x28')](_0x282688,_0x9b9935,!![]);}catch(_0x274ade){return BPromise['reject'](_0x274ade);}return _0x282688[_0x416b('0x29')]();};}function saveUpdates(_0x29577a,_0x367404){return function(_0x240989){if(_0x240989){return _0x240989[_0x416b('0x2a')](_0x29577a)[_0x416b('0x2b')](function(_0x38cdbe){return _0x38cdbe;});}return null;};}function removeEntity(_0x433684,_0x479bca){return function(_0x37f7e1){if(_0x37f7e1){return _0x37f7e1['destroy']()[_0x416b('0x2b')](function(){_0x433684['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x471a67,_0x2d84f0){return function(_0x2e3ace){if(!_0x2e3ace){_0x471a67[_0x416b('0x1e')](0x194);}return _0x2e3ace;};}function handleError(_0x1f0d04,_0x1a0b54){_0x1a0b54=_0x1a0b54||0x1f4;return function(_0x125f9c){logger[_0x416b('0x2c')](_0x125f9c[_0x416b('0x2d')]);if(_0x125f9c['name']){delete _0x125f9c['name'];}_0x1f0d04[_0x416b('0x20')](_0x1a0b54)[_0x416b('0x2e')](_0x125f9c);};}exports[_0x416b('0x2f')]=function(_0x495995,_0x3efa32){var _0xd086a6={},_0x3762ab={},_0x33512d={'count':0x0,'rows':[]};var _0x227ead=_[_0x416b('0x30')](db[_0x416b('0x31')][_0x416b('0x32')],function(_0x5bd09e){return{'name':_0x5bd09e[_0x416b('0x33')],'type':_0x5bd09e[_0x416b('0x34')][_0x416b('0x35')]};});_0x3762ab[_0x416b('0x36')]=_['map'](_0x227ead,_0x416b('0x37'));_0x3762ab[_0x416b('0x38')]=_[_0x416b('0x39')](_0x495995[_0x416b('0x38')]);_0x3762ab['filters']=_[_0x416b('0x3a')](_0x3762ab[_0x416b('0x36')],_0x3762ab[_0x416b('0x38')]);_0xd086a6['attributes']=_[_0x416b('0x3a')](_0x3762ab[_0x416b('0x36')],qs['fields'](_0x495995[_0x416b('0x38')]['fields']));_0xd086a6[_0x416b('0x3b')]=_0xd086a6[_0x416b('0x3b')][_0x416b('0x3c')]?_0xd086a6['attributes']:_0x3762ab[_0x416b('0x36')];if(!_0x495995['query'][_0x416b('0x3d')](_0x416b('0x3e'))){_0xd086a6['limit']=qs[_0x416b('0x22')](_0x495995[_0x416b('0x38')][_0x416b('0x22')]);_0xd086a6[_0x416b('0x21')]=qs[_0x416b('0x21')](_0x495995[_0x416b('0x38')][_0x416b('0x21')]);}_0xd086a6[_0x416b('0x3f')]=qs['sort'](_0x495995['query'][_0x416b('0x40')]);_0xd086a6[_0x416b('0x41')]=qs[_0x416b('0x42')](_[_0x416b('0x43')](_0x495995[_0x416b('0x38')],_0x3762ab[_0x416b('0x42')]),_0x227ead);if(_0x495995[_0x416b('0x38')][_0x416b('0x44')]){_0xd086a6[_0x416b('0x41')]=_[_0x416b('0x45')](_0xd086a6['where'],{'$or':_[_0x416b('0x30')](_0x227ead,function(_0x254d57){if(_0x254d57[_0x416b('0x34')]!==_0x416b('0x46')){var _0x1d2d6d={};_0x1d2d6d[_0x254d57[_0x416b('0x37')]]={'$like':'%'+_0x495995[_0x416b('0x38')][_0x416b('0x44')]+'%'};return _0x1d2d6d;}})});}_0xd086a6=_[_0x416b('0x45')]({},_0xd086a6,_0x495995['options']);var _0x20df78={'where':_0xd086a6[_0x416b('0x41')]};return db[_0x416b('0x31')][_0x416b('0x24')](_0x20df78)['then'](function(_0x4c5c89){_0x33512d[_0x416b('0x24')]=_0x4c5c89;if(_0x495995[_0x416b('0x38')][_0x416b('0x47')]){_0xd086a6[_0x416b('0x48')]=[{'all':!![]}];}return db[_0x416b('0x31')]['findAll'](_0xd086a6);})[_0x416b('0x2b')](function(_0x52af18){_0x33512d[_0x416b('0x49')]=_0x52af18;return _0x33512d;})[_0x416b('0x2b')](respondWithFilteredResult(_0x3efa32,_0xd086a6))[_0x416b('0x4a')](handleError(_0x3efa32,null));};exports['show']=function(_0x4bd6dd,_0xeabc67){var _0x97a041={'raw':![],'where':{'id':_0x4bd6dd['params']['id']}},_0x30839b={};_0x30839b[_0x416b('0x36')]=_[_0x416b('0x39')](db[_0x416b('0x31')]['rawAttributes']);_0x30839b[_0x416b('0x38')]=_[_0x416b('0x39')](_0x4bd6dd[_0x416b('0x38')]);_0x30839b[_0x416b('0x42')]=_[_0x416b('0x3a')](_0x30839b[_0x416b('0x36')],_0x30839b[_0x416b('0x38')]);_0x97a041[_0x416b('0x3b')]=_[_0x416b('0x3a')](_0x30839b['model'],qs[_0x416b('0x4b')](_0x4bd6dd[_0x416b('0x38')][_0x416b('0x4b')]));_0x97a041[_0x416b('0x3b')]=_0x97a041[_0x416b('0x3b')]['length']?_0x97a041[_0x416b('0x3b')]:_0x30839b[_0x416b('0x36')];if(_0x4bd6dd[_0x416b('0x38')]['includeAll']){_0x97a041[_0x416b('0x48')]=[{'all':!![]}];}_0x97a041=_[_0x416b('0x45')]({},_0x97a041,_0x4bd6dd[_0x416b('0x4c')]);return db[_0x416b('0x31')][_0x416b('0x4d')](_0x97a041)[_0x416b('0x2b')](handleEntityNotFound(_0xeabc67,null))[_0x416b('0x2b')](respondWithResult(_0xeabc67,null))[_0x416b('0x4a')](handleError(_0xeabc67,null));};exports[_0x416b('0x4e')]=function(_0x4a71d0,_0x5b31d5){return db[_0x416b('0x31')][_0x416b('0x4e')](_0x4a71d0[_0x416b('0x4f')],{})[_0x416b('0x2b')](respondWithResult(_0x5b31d5,0xc9))[_0x416b('0x4a')](handleError(_0x5b31d5,null));};exports[_0x416b('0x2a')]=function(_0x290248,_0x5b39d6){if(_0x290248[_0x416b('0x4f')]['id']){delete _0x290248[_0x416b('0x4f')]['id'];}return db[_0x416b('0x31')][_0x416b('0x4d')]({'where':{'id':_0x290248[_0x416b('0x50')]['id']}})[_0x416b('0x2b')](handleEntityNotFound(_0x5b39d6,null))[_0x416b('0x2b')](saveUpdates(_0x290248[_0x416b('0x4f')],null))[_0x416b('0x2b')](respondWithResult(_0x5b39d6,null))[_0x416b('0x4a')](handleError(_0x5b39d6,null));};exports[_0x416b('0x51')]=function(_0x5043fe,_0x22bc76){return db[_0x416b('0x31')][_0x416b('0x4d')]({'where':{'id':_0x5043fe[_0x416b('0x50')]['id']}})[_0x416b('0x2b')](handleEntityNotFound(_0x22bc76,null))['then'](removeEntity(_0x22bc76,null))['catch'](handleError(_0x22bc76,null));};exports['getFields']=function(_0x46969f,_0x47ad61,_0x2826ce){var _0xa1fe8e={};var _0x413268={};var _0x1c985;var _0x407d84;return db['SalesforceConfiguration'][_0x416b('0x52')]({'where':{'id':_0x46969f[_0x416b('0x50')]['id']}})['then'](handleEntityNotFound(_0x47ad61,null))[_0x416b('0x2b')](function(_0x5b0797){if(_0x5b0797){_0x1c985=_0x5b0797;_0x413268[_0x416b('0x36')]=_[_0x416b('0x39')](db[_0x416b('0x53')][_0x416b('0x32')]);_0x413268[_0x416b('0x38')]=_[_0x416b('0x39')](_0x46969f[_0x416b('0x38')]);_0x413268[_0x416b('0x42')]=_[_0x416b('0x3a')](_0x413268[_0x416b('0x36')],_0x413268[_0x416b('0x38')]);_0xa1fe8e['attributes']=_[_0x416b('0x3a')](_0x413268['model'],qs[_0x416b('0x4b')](_0x46969f[_0x416b('0x38')][_0x416b('0x4b')]));_0xa1fe8e[_0x416b('0x3b')]=_0xa1fe8e[_0x416b('0x3b')][_0x416b('0x3c')]?_0xa1fe8e[_0x416b('0x3b')]:_0x413268[_0x416b('0x36')];_0xa1fe8e['order']=qs[_0x416b('0x40')](_0x46969f[_0x416b('0x38')]['sort']);_0xa1fe8e['where']=qs[_0x416b('0x42')](_['pick'](_0x46969f[_0x416b('0x38')],_0x413268[_0x416b('0x42')]));if(_0x46969f[_0x416b('0x38')][_0x416b('0x44')]){_0xa1fe8e[_0x416b('0x41')]=_[_0x416b('0x45')](_0xa1fe8e[_0x416b('0x41')],{'$or':_[_0x416b('0x30')](_0xa1fe8e[_0x416b('0x3b')],function(_0x3e301d){var _0x57c64b={};_0x57c64b[_0x3e301d]={'$like':'%'+_0x46969f[_0x416b('0x38')]['filter']+'%'};return _0x57c64b;})});}_0xa1fe8e=_[_0x416b('0x45')]({},_0xa1fe8e,_0x46969f[_0x416b('0x4c')]);return _0x1c985[_0x416b('0x54')](_0xa1fe8e);}})[_0x416b('0x2b')](function(_0x381348){if(_0x381348){_0x407d84=_0x381348[_0x416b('0x3c')];if(!_0x46969f[_0x416b('0x38')][_0x416b('0x3d')]('nolimit')){_0xa1fe8e[_0x416b('0x22')]=qs['limit'](_0x46969f[_0x416b('0x38')][_0x416b('0x22')]);_0xa1fe8e['offset']=qs['offset'](_0x46969f[_0x416b('0x38')]['offset']);}return _0x1c985[_0x416b('0x54')](_0xa1fe8e);}})[_0x416b('0x2b')](function(_0x2b5983){if(_0x2b5983){return _0x2b5983?{'count':_0x407d84,'rows':_0x2b5983}:null;}})[_0x416b('0x2b')](respondWithResult(_0x47ad61,null))[_0x416b('0x4a')](handleError(_0x47ad61,null));};exports[_0x416b('0x55')]=function(_0x164bcd,_0x4f3390,_0x46c51b){var _0x742cf5={};var _0x4b018f={};var _0x20363a;var _0x5c7d9d;return db['SalesforceConfiguration'][_0x416b('0x52')]({'where':{'id':_0x164bcd['params']['id']}})[_0x416b('0x2b')](handleEntityNotFound(_0x4f3390,null))[_0x416b('0x2b')](function(_0x5a83a9){if(_0x5a83a9){_0x20363a=_0x5a83a9;_0x4b018f[_0x416b('0x36')]=_[_0x416b('0x39')](db[_0x416b('0x53')][_0x416b('0x32')]);_0x4b018f['query']=_['keys'](_0x164bcd[_0x416b('0x38')]);_0x4b018f['filters']=_[_0x416b('0x3a')](_0x4b018f[_0x416b('0x36')],_0x4b018f[_0x416b('0x38')]);_0x742cf5['attributes']=_[_0x416b('0x3a')](_0x4b018f[_0x416b('0x36')],qs[_0x416b('0x4b')](_0x164bcd['query'][_0x416b('0x4b')]));_0x742cf5[_0x416b('0x3b')]=_0x742cf5[_0x416b('0x3b')]['length']?_0x742cf5['attributes']:_0x4b018f['model'];_0x742cf5['order']=qs[_0x416b('0x40')](_0x164bcd['query'][_0x416b('0x40')]);_0x742cf5[_0x416b('0x41')]=qs[_0x416b('0x42')](_[_0x416b('0x43')](_0x164bcd[_0x416b('0x38')],_0x4b018f['filters']));if(_0x164bcd[_0x416b('0x38')][_0x416b('0x44')]){_0x742cf5[_0x416b('0x41')]=_[_0x416b('0x45')](_0x742cf5[_0x416b('0x41')],{'$or':_[_0x416b('0x30')](_0x742cf5['attributes'],function(_0x470d8e){var _0x42c3e8={};_0x42c3e8[_0x470d8e]={'$like':'%'+_0x164bcd['query'][_0x416b('0x44')]+'%'};return _0x42c3e8;})});}_0x742cf5=_['merge']({},_0x742cf5,_0x164bcd[_0x416b('0x4c')]);return _0x20363a[_0x416b('0x55')](_0x742cf5);}})[_0x416b('0x2b')](function(_0x50c228){if(_0x50c228){_0x5c7d9d=_0x50c228[_0x416b('0x3c')];if(!_0x164bcd[_0x416b('0x38')][_0x416b('0x3d')](_0x416b('0x3e'))){_0x742cf5[_0x416b('0x22')]=qs[_0x416b('0x22')](_0x164bcd[_0x416b('0x38')]['limit']);_0x742cf5['offset']=qs[_0x416b('0x21')](_0x164bcd['query'][_0x416b('0x21')]);}return _0x20363a[_0x416b('0x55')](_0x742cf5);}})[_0x416b('0x2b')](function(_0x5a6e5b){if(_0x5a6e5b){return _0x5a6e5b?{'count':_0x5c7d9d,'rows':_0x5a6e5b}:null;}})['then'](respondWithResult(_0x4f3390,null))[_0x416b('0x4a')](handleError(_0x4f3390,null));};exports['getDescriptions']=function(_0x1d0385,_0x309cb4,_0x2cc5d7){var _0x31dd58={};var _0x58472c={};var _0x377f6a;var _0x501fcb;return db[_0x416b('0x31')][_0x416b('0x52')]({'where':{'id':_0x1d0385[_0x416b('0x50')]['id']}})[_0x416b('0x2b')](handleEntityNotFound(_0x309cb4,null))[_0x416b('0x2b')](function(_0x13d5dd){if(_0x13d5dd){_0x377f6a=_0x13d5dd;_0x58472c[_0x416b('0x36')]=_[_0x416b('0x39')](db[_0x416b('0x53')][_0x416b('0x32')]);_0x58472c[_0x416b('0x38')]=_[_0x416b('0x39')](_0x1d0385['query']);_0x58472c[_0x416b('0x42')]=_[_0x416b('0x3a')](_0x58472c['model'],_0x58472c['query']);_0x31dd58[_0x416b('0x3b')]=_[_0x416b('0x3a')](_0x58472c[_0x416b('0x36')],qs[_0x416b('0x4b')](_0x1d0385['query'][_0x416b('0x4b')]));_0x31dd58[_0x416b('0x3b')]=_0x31dd58[_0x416b('0x3b')][_0x416b('0x3c')]?_0x31dd58['attributes']:_0x58472c['model'];_0x31dd58[_0x416b('0x3f')]=qs['sort'](_0x1d0385[_0x416b('0x38')]['sort']);_0x31dd58['where']=qs[_0x416b('0x42')](_['pick'](_0x1d0385[_0x416b('0x38')],_0x58472c[_0x416b('0x42')]));if(_0x1d0385[_0x416b('0x38')][_0x416b('0x44')]){_0x31dd58[_0x416b('0x41')]=_['merge'](_0x31dd58[_0x416b('0x41')],{'$or':_[_0x416b('0x30')](_0x31dd58[_0x416b('0x3b')],function(_0x14dbbb){var _0x3bd527={};_0x3bd527[_0x14dbbb]={'$like':'%'+_0x1d0385['query'][_0x416b('0x44')]+'%'};return _0x3bd527;})});}_0x31dd58=_[_0x416b('0x45')]({},_0x31dd58,_0x1d0385['options']);return _0x377f6a[_0x416b('0x56')](_0x31dd58);}})[_0x416b('0x2b')](function(_0x381b72){if(_0x381b72){_0x501fcb=_0x381b72[_0x416b('0x3c')];if(!_0x1d0385['query'][_0x416b('0x3d')](_0x416b('0x3e'))){_0x31dd58['limit']=qs[_0x416b('0x22')](_0x1d0385['query']['limit']);_0x31dd58[_0x416b('0x21')]=qs[_0x416b('0x21')](_0x1d0385['query'][_0x416b('0x21')]);}return _0x377f6a[_0x416b('0x56')](_0x31dd58);}})[_0x416b('0x2b')](function(_0x1523fe){if(_0x1523fe){return _0x1523fe?{'count':_0x501fcb,'rows':_0x1523fe}:null;}})[_0x416b('0x2b')](respondWithResult(_0x309cb4,null))[_0x416b('0x4a')](handleError(_0x309cb4,null));}; \ No newline at end of file +var _0x5bb7=['show','fields','find','catch','create','body','params','getFields','findOne','SalesforceField','length','order','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','error','stack','name','send','index','map','SalesforceConfiguration','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows'];(function(_0x31428b,_0x15eb8a){var _0x4cc1e3=function(_0x3ff4e4){while(--_0x3ff4e4){_0x31428b['push'](_0x31428b['shift']());}};_0x4cc1e3(++_0x15eb8a);}(_0x5bb7,0x1ee));var _0x75bb=function(_0x484e36,_0x4482d8){_0x484e36=_0x484e36-0x0;var _0xafc85d=_0x5bb7[_0x484e36];return _0xafc85d;};'use strict';var emlformat=require(_0x75bb('0x0'));var rimraf=require(_0x75bb('0x1'));var zipdir=require(_0x75bb('0x2'));var jsonpatch=require(_0x75bb('0x3'));var rp=require(_0x75bb('0x4'));var moment=require(_0x75bb('0x5'));var BPromise=require(_0x75bb('0x6'));var Mustache=require(_0x75bb('0x7'));var util=require('util');var path=require(_0x75bb('0x8'));var sox=require(_0x75bb('0x9'));var csv=require(_0x75bb('0xa'));var ejs=require(_0x75bb('0xb'));var fs=require('fs');var fs_extra=require(_0x75bb('0xc'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x75bb('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x75bb('0xa'));var querystring=require(_0x75bb('0xe'));var Papa=require(_0x75bb('0xf'));var Redis=require(_0x75bb('0x10'));var authService=require(_0x75bb('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x75bb('0x12'));var hardwareService=require(_0x75bb('0x13'));var logger=require(_0x75bb('0x14'))(_0x75bb('0x15'));var utils=require(_0x75bb('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2b4083,_0x4b3a64){_0x4b3a64=_0x4b3a64||0xcc;return function(_0xf4025){if(_0xf4025){return _0x2b4083[_0x75bb('0x17')](_0x4b3a64);}return _0x2b4083[_0x75bb('0x18')](_0x4b3a64)[_0x75bb('0x19')]();};}function respondWithResult(_0x4dd54e,_0x4c0162){_0x4c0162=_0x4c0162||0xc8;return function(_0x67dcb2){if(_0x67dcb2){return _0x4dd54e[_0x75bb('0x18')](_0x4c0162)[_0x75bb('0x1a')](_0x67dcb2);}};}function respondWithFilteredResult(_0x17b9c8,_0x3afbe3){return function(_0x389059){if(_0x389059){var _0x4e022c=typeof _0x3afbe3[_0x75bb('0x1b')]===_0x75bb('0x1c')&&typeof _0x3afbe3[_0x75bb('0x1d')]===_0x75bb('0x1c');var _0x4b1062=_0x389059[_0x75bb('0x1e')];var _0x6ea9f5=_0x4e022c?0x0:_0x3afbe3[_0x75bb('0x1b')];var _0x531356=_0x4e022c?_0x389059[_0x75bb('0x1e')]:_0x3afbe3['offset']+_0x3afbe3[_0x75bb('0x1d')];var _0xbf3042;if(_0x531356>=_0x4b1062){_0x531356=_0x4b1062;_0xbf3042=0xc8;}else{_0xbf3042=0xce;}_0x17b9c8['status'](_0xbf3042);return _0x17b9c8[_0x75bb('0x1f')](_0x75bb('0x20'),_0x6ea9f5+'-'+_0x531356+'/'+_0x4b1062)['json'](_0x389059);}return null;};}function patchUpdates(_0x926dfc){return function(_0xe8235b){try{jsonpatch[_0x75bb('0x21')](_0xe8235b,_0x926dfc,!![]);}catch(_0x518f10){return BPromise['reject'](_0x518f10);}return _0xe8235b[_0x75bb('0x22')]();};}function saveUpdates(_0x2d8951,_0x40feba){return function(_0x4bee28){if(_0x4bee28){return _0x4bee28[_0x75bb('0x23')](_0x2d8951)[_0x75bb('0x24')](function(_0x2fb53b){return _0x2fb53b;});}return null;};}function removeEntity(_0x1ecaf6,_0x5813ab){return function(_0x61f9f2){if(_0x61f9f2){return _0x61f9f2[_0x75bb('0x25')]()[_0x75bb('0x24')](function(){_0x1ecaf6[_0x75bb('0x18')](0xcc)[_0x75bb('0x19')]();});}};}function handleEntityNotFound(_0x8bc1a9,_0x1d8bbb){return function(_0x7973d9){if(!_0x7973d9){_0x8bc1a9[_0x75bb('0x17')](0x194);}return _0x7973d9;};}function handleError(_0x7aeee2,_0x9a2bdb){_0x9a2bdb=_0x9a2bdb||0x1f4;return function(_0x4ccd44){logger[_0x75bb('0x26')](_0x4ccd44[_0x75bb('0x27')]);if(_0x4ccd44[_0x75bb('0x28')]){delete _0x4ccd44[_0x75bb('0x28')];}_0x7aeee2[_0x75bb('0x18')](_0x9a2bdb)[_0x75bb('0x29')](_0x4ccd44);};}exports[_0x75bb('0x2a')]=function(_0x475db1,_0x5f51d7){var _0x46b608={},_0x259531={},_0x339dcf={'count':0x0,'rows':[]};var _0x20b671=_[_0x75bb('0x2b')](db[_0x75bb('0x2c')][_0x75bb('0x2d')],function(_0x2279ac){return{'name':_0x2279ac[_0x75bb('0x2e')],'type':_0x2279ac[_0x75bb('0x2f')]['key']};});_0x259531[_0x75bb('0x30')]=_[_0x75bb('0x2b')](_0x20b671,_0x75bb('0x28'));_0x259531[_0x75bb('0x31')]=_[_0x75bb('0x32')](_0x475db1[_0x75bb('0x31')]);_0x259531[_0x75bb('0x33')]=_[_0x75bb('0x34')](_0x259531['model'],_0x259531['query']);_0x46b608[_0x75bb('0x35')]=_[_0x75bb('0x34')](_0x259531[_0x75bb('0x30')],qs['fields'](_0x475db1[_0x75bb('0x31')]['fields']));_0x46b608[_0x75bb('0x35')]=_0x46b608[_0x75bb('0x35')]['length']?_0x46b608[_0x75bb('0x35')]:_0x259531['model'];if(!_0x475db1['query'][_0x75bb('0x36')](_0x75bb('0x37'))){_0x46b608[_0x75bb('0x1d')]=qs[_0x75bb('0x1d')](_0x475db1[_0x75bb('0x31')][_0x75bb('0x1d')]);_0x46b608[_0x75bb('0x1b')]=qs[_0x75bb('0x1b')](_0x475db1['query']['offset']);}_0x46b608['order']=qs[_0x75bb('0x38')](_0x475db1[_0x75bb('0x31')]['sort']);_0x46b608[_0x75bb('0x39')]=qs[_0x75bb('0x33')](_[_0x75bb('0x3a')](_0x475db1[_0x75bb('0x31')],_0x259531[_0x75bb('0x33')]),_0x20b671);if(_0x475db1['query']['filter']){_0x46b608['where']=_['merge'](_0x46b608['where'],{'$or':_[_0x75bb('0x2b')](_0x20b671,function(_0x1740fd){if(_0x1740fd[_0x75bb('0x2f')]!=='VIRTUAL'){var _0x352a16={};_0x352a16[_0x1740fd[_0x75bb('0x28')]]={'$like':'%'+_0x475db1[_0x75bb('0x31')][_0x75bb('0x3b')]+'%'};return _0x352a16;}})});}_0x46b608=_[_0x75bb('0x3c')]({},_0x46b608,_0x475db1[_0x75bb('0x3d')]);var _0x19749e={'where':_0x46b608['where']};return db[_0x75bb('0x2c')][_0x75bb('0x1e')](_0x19749e)[_0x75bb('0x24')](function(_0x555f6e){_0x339dcf['count']=_0x555f6e;if(_0x475db1['query'][_0x75bb('0x3e')]){_0x46b608[_0x75bb('0x3f')]=[{'all':!![]}];}return db[_0x75bb('0x2c')][_0x75bb('0x40')](_0x46b608);})[_0x75bb('0x24')](function(_0x55279b){_0x339dcf[_0x75bb('0x41')]=_0x55279b;return _0x339dcf;})[_0x75bb('0x24')](respondWithFilteredResult(_0x5f51d7,_0x46b608))['catch'](handleError(_0x5f51d7,null));};exports[_0x75bb('0x42')]=function(_0x346d9f,_0x202088){var _0x1f4aaa={'raw':![],'where':{'id':_0x346d9f['params']['id']}},_0x255f52={};_0x255f52[_0x75bb('0x30')]=_['keys'](db[_0x75bb('0x2c')][_0x75bb('0x2d')]);_0x255f52[_0x75bb('0x31')]=_[_0x75bb('0x32')](_0x346d9f['query']);_0x255f52[_0x75bb('0x33')]=_[_0x75bb('0x34')](_0x255f52[_0x75bb('0x30')],_0x255f52[_0x75bb('0x31')]);_0x1f4aaa[_0x75bb('0x35')]=_['intersection'](_0x255f52[_0x75bb('0x30')],qs[_0x75bb('0x43')](_0x346d9f[_0x75bb('0x31')][_0x75bb('0x43')]));_0x1f4aaa[_0x75bb('0x35')]=_0x1f4aaa['attributes']['length']?_0x1f4aaa[_0x75bb('0x35')]:_0x255f52[_0x75bb('0x30')];if(_0x346d9f[_0x75bb('0x31')][_0x75bb('0x3e')]){_0x1f4aaa['include']=[{'all':!![]}];}_0x1f4aaa=_[_0x75bb('0x3c')]({},_0x1f4aaa,_0x346d9f['options']);return db['SalesforceConfiguration'][_0x75bb('0x44')](_0x1f4aaa)[_0x75bb('0x24')](handleEntityNotFound(_0x202088,null))[_0x75bb('0x24')](respondWithResult(_0x202088,null))[_0x75bb('0x45')](handleError(_0x202088,null));};exports[_0x75bb('0x46')]=function(_0x41aaf8,_0x3c232c){return db['SalesforceConfiguration']['create'](_0x41aaf8[_0x75bb('0x47')],{})[_0x75bb('0x24')](respondWithResult(_0x3c232c,0xc9))[_0x75bb('0x45')](handleError(_0x3c232c,null));};exports[_0x75bb('0x23')]=function(_0x20befc,_0x43188e){if(_0x20befc[_0x75bb('0x47')]['id']){delete _0x20befc['body']['id'];}return db[_0x75bb('0x2c')][_0x75bb('0x44')]({'where':{'id':_0x20befc[_0x75bb('0x48')]['id']}})[_0x75bb('0x24')](handleEntityNotFound(_0x43188e,null))['then'](saveUpdates(_0x20befc[_0x75bb('0x47')],null))[_0x75bb('0x24')](respondWithResult(_0x43188e,null))[_0x75bb('0x45')](handleError(_0x43188e,null));};exports[_0x75bb('0x25')]=function(_0x21b28a,_0x57ecbf){return db[_0x75bb('0x2c')][_0x75bb('0x44')]({'where':{'id':_0x21b28a[_0x75bb('0x48')]['id']}})[_0x75bb('0x24')](handleEntityNotFound(_0x57ecbf,null))[_0x75bb('0x24')](removeEntity(_0x57ecbf,null))[_0x75bb('0x45')](handleError(_0x57ecbf,null));};exports[_0x75bb('0x49')]=function(_0x214b4b,_0x1eaabb,_0x3ea165){var _0x6ffb46={};var _0x3748da={};var _0x443536;var _0xdafb05;return db[_0x75bb('0x2c')][_0x75bb('0x4a')]({'where':{'id':_0x214b4b[_0x75bb('0x48')]['id']}})['then'](handleEntityNotFound(_0x1eaabb,null))[_0x75bb('0x24')](function(_0x435644){if(_0x435644){_0x443536=_0x435644;_0x3748da[_0x75bb('0x30')]=_['keys'](db[_0x75bb('0x4b')][_0x75bb('0x2d')]);_0x3748da[_0x75bb('0x31')]=_[_0x75bb('0x32')](_0x214b4b[_0x75bb('0x31')]);_0x3748da['filters']=_[_0x75bb('0x34')](_0x3748da[_0x75bb('0x30')],_0x3748da[_0x75bb('0x31')]);_0x6ffb46[_0x75bb('0x35')]=_[_0x75bb('0x34')](_0x3748da[_0x75bb('0x30')],qs['fields'](_0x214b4b[_0x75bb('0x31')]['fields']));_0x6ffb46[_0x75bb('0x35')]=_0x6ffb46[_0x75bb('0x35')][_0x75bb('0x4c')]?_0x6ffb46[_0x75bb('0x35')]:_0x3748da[_0x75bb('0x30')];_0x6ffb46[_0x75bb('0x4d')]=qs[_0x75bb('0x38')](_0x214b4b[_0x75bb('0x31')][_0x75bb('0x38')]);_0x6ffb46['where']=qs[_0x75bb('0x33')](_[_0x75bb('0x3a')](_0x214b4b[_0x75bb('0x31')],_0x3748da[_0x75bb('0x33')]));if(_0x214b4b[_0x75bb('0x31')][_0x75bb('0x3b')]){_0x6ffb46[_0x75bb('0x39')]=_[_0x75bb('0x3c')](_0x6ffb46['where'],{'$or':_['map'](_0x6ffb46[_0x75bb('0x35')],function(_0x5a01d9){var _0x23eaa4={};_0x23eaa4[_0x5a01d9]={'$like':'%'+_0x214b4b['query'][_0x75bb('0x3b')]+'%'};return _0x23eaa4;})});}_0x6ffb46=_[_0x75bb('0x3c')]({},_0x6ffb46,_0x214b4b['options']);return _0x443536['getFields'](_0x6ffb46);}})[_0x75bb('0x24')](function(_0x2e9eeb){if(_0x2e9eeb){_0xdafb05=_0x2e9eeb[_0x75bb('0x4c')];if(!_0x214b4b[_0x75bb('0x31')][_0x75bb('0x36')](_0x75bb('0x37'))){_0x6ffb46['limit']=qs[_0x75bb('0x1d')](_0x214b4b[_0x75bb('0x31')][_0x75bb('0x1d')]);_0x6ffb46[_0x75bb('0x1b')]=qs[_0x75bb('0x1b')](_0x214b4b['query']['offset']);}return _0x443536[_0x75bb('0x49')](_0x6ffb46);}})['then'](function(_0x27064d){if(_0x27064d){return _0x27064d?{'count':_0xdafb05,'rows':_0x27064d}:null;}})[_0x75bb('0x24')](respondWithResult(_0x1eaabb,null))['catch'](handleError(_0x1eaabb,null));};exports['getSubjects']=function(_0x1ff418,_0x36bd96,_0x5d3aba){var _0x237cde={};var _0x4b43b5={};var _0x216f4e;var _0x568d54;return db[_0x75bb('0x2c')][_0x75bb('0x4a')]({'where':{'id':_0x1ff418[_0x75bb('0x48')]['id']}})[_0x75bb('0x24')](handleEntityNotFound(_0x36bd96,null))['then'](function(_0x497f9e){if(_0x497f9e){_0x216f4e=_0x497f9e;_0x4b43b5[_0x75bb('0x30')]=_[_0x75bb('0x32')](db[_0x75bb('0x4b')][_0x75bb('0x2d')]);_0x4b43b5[_0x75bb('0x31')]=_[_0x75bb('0x32')](_0x1ff418[_0x75bb('0x31')]);_0x4b43b5[_0x75bb('0x33')]=_[_0x75bb('0x34')](_0x4b43b5[_0x75bb('0x30')],_0x4b43b5[_0x75bb('0x31')]);_0x237cde[_0x75bb('0x35')]=_[_0x75bb('0x34')](_0x4b43b5[_0x75bb('0x30')],qs[_0x75bb('0x43')](_0x1ff418['query'][_0x75bb('0x43')]));_0x237cde[_0x75bb('0x35')]=_0x237cde['attributes']['length']?_0x237cde[_0x75bb('0x35')]:_0x4b43b5[_0x75bb('0x30')];_0x237cde[_0x75bb('0x4d')]=qs[_0x75bb('0x38')](_0x1ff418[_0x75bb('0x31')][_0x75bb('0x38')]);_0x237cde[_0x75bb('0x39')]=qs[_0x75bb('0x33')](_[_0x75bb('0x3a')](_0x1ff418['query'],_0x4b43b5['filters']));if(_0x1ff418[_0x75bb('0x31')][_0x75bb('0x3b')]){_0x237cde[_0x75bb('0x39')]=_[_0x75bb('0x3c')](_0x237cde[_0x75bb('0x39')],{'$or':_['map'](_0x237cde['attributes'],function(_0x863a7a){var _0x3fdd10={};_0x3fdd10[_0x863a7a]={'$like':'%'+_0x1ff418[_0x75bb('0x31')][_0x75bb('0x3b')]+'%'};return _0x3fdd10;})});}_0x237cde=_[_0x75bb('0x3c')]({},_0x237cde,_0x1ff418[_0x75bb('0x3d')]);return _0x216f4e[_0x75bb('0x4e')](_0x237cde);}})[_0x75bb('0x24')](function(_0x965ecb){if(_0x965ecb){_0x568d54=_0x965ecb[_0x75bb('0x4c')];if(!_0x1ff418[_0x75bb('0x31')]['hasOwnProperty'](_0x75bb('0x37'))){_0x237cde['limit']=qs[_0x75bb('0x1d')](_0x1ff418[_0x75bb('0x31')]['limit']);_0x237cde[_0x75bb('0x1b')]=qs[_0x75bb('0x1b')](_0x1ff418['query']['offset']);}return _0x216f4e[_0x75bb('0x4e')](_0x237cde);}})[_0x75bb('0x24')](function(_0x276f38){if(_0x276f38){return _0x276f38?{'count':_0x568d54,'rows':_0x276f38}:null;}})['then'](respondWithResult(_0x36bd96,null))[_0x75bb('0x45')](handleError(_0x36bd96,null));};exports[_0x75bb('0x4f')]=function(_0x5a0b4a,_0xf53cb4,_0x21a5fc){var _0x2d1f1a={};var _0x3f0e9b={};var _0x1092c0;var _0x360829;return db[_0x75bb('0x2c')]['findOne']({'where':{'id':_0x5a0b4a['params']['id']}})[_0x75bb('0x24')](handleEntityNotFound(_0xf53cb4,null))['then'](function(_0x4b46bf){if(_0x4b46bf){_0x1092c0=_0x4b46bf;_0x3f0e9b[_0x75bb('0x30')]=_[_0x75bb('0x32')](db[_0x75bb('0x4b')][_0x75bb('0x2d')]);_0x3f0e9b[_0x75bb('0x31')]=_[_0x75bb('0x32')](_0x5a0b4a[_0x75bb('0x31')]);_0x3f0e9b['filters']=_['intersection'](_0x3f0e9b[_0x75bb('0x30')],_0x3f0e9b['query']);_0x2d1f1a[_0x75bb('0x35')]=_['intersection'](_0x3f0e9b['model'],qs[_0x75bb('0x43')](_0x5a0b4a[_0x75bb('0x31')][_0x75bb('0x43')]));_0x2d1f1a[_0x75bb('0x35')]=_0x2d1f1a[_0x75bb('0x35')][_0x75bb('0x4c')]?_0x2d1f1a[_0x75bb('0x35')]:_0x3f0e9b[_0x75bb('0x30')];_0x2d1f1a['order']=qs[_0x75bb('0x38')](_0x5a0b4a[_0x75bb('0x31')]['sort']);_0x2d1f1a[_0x75bb('0x39')]=qs['filters'](_[_0x75bb('0x3a')](_0x5a0b4a[_0x75bb('0x31')],_0x3f0e9b['filters']));if(_0x5a0b4a[_0x75bb('0x31')][_0x75bb('0x3b')]){_0x2d1f1a[_0x75bb('0x39')]=_[_0x75bb('0x3c')](_0x2d1f1a[_0x75bb('0x39')],{'$or':_[_0x75bb('0x2b')](_0x2d1f1a[_0x75bb('0x35')],function(_0x218a50){var _0x1c9bfd={};_0x1c9bfd[_0x218a50]={'$like':'%'+_0x5a0b4a[_0x75bb('0x31')][_0x75bb('0x3b')]+'%'};return _0x1c9bfd;})});}_0x2d1f1a=_[_0x75bb('0x3c')]({},_0x2d1f1a,_0x5a0b4a[_0x75bb('0x3d')]);return _0x1092c0[_0x75bb('0x4f')](_0x2d1f1a);}})[_0x75bb('0x24')](function(_0x2792fc){if(_0x2792fc){_0x360829=_0x2792fc['length'];if(!_0x5a0b4a[_0x75bb('0x31')]['hasOwnProperty'](_0x75bb('0x37'))){_0x2d1f1a[_0x75bb('0x1d')]=qs[_0x75bb('0x1d')](_0x5a0b4a[_0x75bb('0x31')]['limit']);_0x2d1f1a[_0x75bb('0x1b')]=qs[_0x75bb('0x1b')](_0x5a0b4a[_0x75bb('0x31')]['offset']);}return _0x1092c0[_0x75bb('0x4f')](_0x2d1f1a);}})[_0x75bb('0x24')](function(_0x3041c7){if(_0x3041c7){return _0x3041c7?{'count':_0x360829,'rows':_0x3041c7}:null;}})[_0x75bb('0x24')](respondWithResult(_0xf53cb4,null))[_0x75bb('0x45')](handleError(_0xf53cb4,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js index b9b120d..758cf3d 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 _0x7924=['path','rimraf','exports','define','int_salesforce_configurations','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x50811c,_0xb8e3ca){var _0x588a5d=function(_0x5f9a40){while(--_0x5f9a40){_0x50811c['push'](_0x50811c['shift']());}};_0x588a5d(++_0xb8e3ca);}(_0x7924,0x7d));var _0x4792=function(_0x3f7598,_0x212e37){_0x3f7598=_0x3f7598-0x0;var _0x51fb16=_0x7924[_0x3f7598];return _0x51fb16;};'use strict';var _=require(_0x4792('0x0'));var util=require(_0x4792('0x1'));var logger=require(_0x4792('0x2'))(_0x4792('0x3'));var moment=require(_0x4792('0x4'));var BPromise=require(_0x4792('0x5'));var rp=require(_0x4792('0x6'));var fs=require('fs');var path=require(_0x4792('0x7'));var rimraf=require(_0x4792('0x8'));var config=require('../../config/environment');var attributes=require('./intSalesforceConfiguration.attributes');module[_0x4792('0x9')]=function(_0x498d88,_0x18dbdc){return _0x498d88[_0x4792('0xa')]('SalesforceConfiguration',attributes,{'tableName':_0x4792('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x68fb=['path','rimraf','../../config/environment','exports','define','SalesforceConfiguration','int_salesforce_configurations','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x68fb,0xd9));var _0xb68f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x68fb[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xb68f('0x0'));var util=require(_0xb68f('0x1'));var logger=require(_0xb68f('0x2'))(_0xb68f('0x3'));var moment=require(_0xb68f('0x4'));var BPromise=require(_0xb68f('0x5'));var rp=require(_0xb68f('0x6'));var fs=require('fs');var path=require(_0xb68f('0x7'));var rimraf=require(_0xb68f('0x8'));var config=require(_0xb68f('0x9'));var attributes=require('./intSalesforceConfiguration.attributes');module[_0xb68f('0xa')]=function(_0x2e5ca1,_0x151fc9){return _0x2e5ca1[_0xb68f('0xb')](_0xb68f('0xc'),attributes,{'tableName':_0xb68f('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 703cb12..5398236 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 _0x507a=['then','info','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','code','error','message','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http'];(function(_0xce8409,_0x3b8d67){var _0x1fa889=function(_0x4d22e2){while(--_0x4d22e2){_0xce8409['push'](_0xce8409['shift']());}};_0x1fa889(++_0x3b8d67);}(_0x507a,0xf9));var _0xa507=function(_0x49c6ee,_0x1aa991){_0x49c6ee=_0x49c6ee-0x0;var _0x14259f=_0x507a[_0x49c6ee];return _0x14259f;};'use strict';var _=require(_0xa507('0x0'));var util=require(_0xa507('0x1'));var moment=require(_0xa507('0x2'));var BPromise=require(_0xa507('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa507('0x4'));var db=require(_0xa507('0x5'))['db'];var utils=require(_0xa507('0x6'));var logger=require(_0xa507('0x7'))(_0xa507('0x8'));var config=require(_0xa507('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0xa507('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3b154a,_0x2845c7,_0x39053f){return new BPromise(function(_0x40a41c,_0x29c92f){return client['request'](_0x3b154a,_0x39053f)[_0xa507('0xb')](function(_0x8c7a9a){logger[_0xa507('0xc')](_0xa507('0xd'),_0x2845c7,_0xa507('0xe'));logger['debug'](_0xa507('0xf'),_0x2845c7,_0xa507('0xe'),JSON['stringify'](_0x8c7a9a));if(_0x8c7a9a['error']){if(_0x8c7a9a['error'][_0xa507('0x10')]===0x1f4){logger[_0xa507('0x11')]('SalesforceConfiguration,\x20%s,\x20%s',_0x2845c7,_0x8c7a9a[_0xa507('0x11')][_0xa507('0x12')]);return _0x29c92f(_0x8c7a9a[_0xa507('0x11')]['message']);}logger[_0xa507('0x11')](_0xa507('0xd'),_0x2845c7,_0x8c7a9a[_0xa507('0x11')][_0xa507('0x12')]);return _0x40a41c(_0x8c7a9a['error'][_0xa507('0x12')]);}else{logger[_0xa507('0xc')](_0xa507('0xd'),_0x2845c7,_0xa507('0xe'));_0x40a41c(_0x8c7a9a['result'][_0xa507('0x12')]);}})[_0xa507('0x13')](function(_0x26b9d2){logger[_0xa507('0x11')](_0xa507('0xd'),_0x2845c7,_0x26b9d2);_0x29c92f(_0x26b9d2);});});} \ No newline at end of file +var _0x9c44=['randomstring','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','info','SalesforceConfiguration,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','lodash','util','moment'];(function(_0x2534cf,_0x545be6){var _0x221461=function(_0x379e83){while(--_0x379e83){_0x2534cf['push'](_0x2534cf['shift']());}};_0x221461(++_0x545be6);}(_0x9c44,0xed));var _0x49c4=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0x9c44[_0x53ccf2];return _0x5a2964;};'use strict';var _=require(_0x49c4('0x0'));var util=require(_0x49c4('0x1'));var moment=require(_0x49c4('0x2'));var BPromise=require('bluebird');var rs=require(_0x49c4('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x49c4('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x49c4('0x5'))('rpc');var config=require(_0x49c4('0x6'));var jayson=require(_0x49c4('0x7'));var client=jayson[_0x49c4('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2378a3,_0x12c248,_0x1b5ab6){return new BPromise(function(_0x583f1a,_0x259126){return client['request'](_0x2378a3,_0x1b5ab6)['then'](function(_0x248f66){logger[_0x49c4('0x9')](_0x49c4('0xa'),_0x12c248,'request\x20sent');logger[_0x49c4('0xb')]('SalesforceConfiguration,\x20%s,\x20%s,\x20%s',_0x12c248,_0x49c4('0xc'),JSON[_0x49c4('0xd')](_0x248f66));if(_0x248f66[_0x49c4('0xe')]){if(_0x248f66['error']['code']===0x1f4){logger['error'](_0x49c4('0xa'),_0x12c248,_0x248f66['error'][_0x49c4('0xf')]);return _0x259126(_0x248f66['error'][_0x49c4('0xf')]);}logger[_0x49c4('0xe')](_0x49c4('0xa'),_0x12c248,_0x248f66[_0x49c4('0xe')][_0x49c4('0xf')]);return _0x583f1a(_0x248f66[_0x49c4('0xe')][_0x49c4('0xf')]);}else{logger[_0x49c4('0x9')](_0x49c4('0xa'),_0x12c248,_0x49c4('0xc'));_0x583f1a(_0x248f66['result']['message']);}})['catch'](function(_0x5a8dc6){logger[_0x49c4('0xe')](_0x49c4('0xa'),_0x12c248,_0x5a8dc6);_0x259126(_0x5a8dc6);});});} \ No newline at end of file diff --git a/server/api/intSalesforceField/index.js b/server/api/intSalesforceField/index.js index f763bac..9277366 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 _0xa7d0=['multer','util','path','connect-timeout','Router','../../components/auth/service','get','isAuthenticated','show','post','create','put','/:id','update','delete','destroy','exports'];(function(_0x36ed48,_0x1ee0d4){var _0x51c63a=function(_0x2d0a40){while(--_0x2d0a40){_0x36ed48['push'](_0x36ed48['shift']());}};_0x51c63a(++_0x1ee0d4);}(_0xa7d0,0xbb));var _0x0a7d=function(_0x43497b,_0x1db319){_0x43497b=_0x43497b-0x0;var _0x30ff01=_0xa7d0[_0x43497b];return _0x30ff01;};'use strict';var multer=require(_0x0a7d('0x0'));var util=require(_0x0a7d('0x1'));var path=require(_0x0a7d('0x2'));var timeout=require(_0x0a7d('0x3'));var express=require('express');var router=express[_0x0a7d('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x0a7d('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./intSalesforceField.controller');router[_0x0a7d('0x6')]('/',auth[_0x0a7d('0x7')](),controller['index']);router[_0x0a7d('0x6')]('/:id',auth['isAuthenticated'](),controller[_0x0a7d('0x8')]);router[_0x0a7d('0x9')]('/',auth['isAuthenticated'](),controller[_0x0a7d('0xa')]);router[_0x0a7d('0xb')](_0x0a7d('0xc'),auth['isAuthenticated'](),controller[_0x0a7d('0xd')]);router[_0x0a7d('0xe')](_0x0a7d('0xc'),auth[_0x0a7d('0x7')](),controller[_0x0a7d('0xf')]);module[_0x0a7d('0x10')]=router; \ No newline at end of file +var _0x9423=['/:id','post','put','delete','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceField.controller','get','isAuthenticated'];(function(_0x2e1a7b,_0x26706e){var _0x101ffa=function(_0x2f3df5){while(--_0x2f3df5){_0x2e1a7b['push'](_0x2e1a7b['shift']());}};_0x101ffa(++_0x26706e);}(_0x9423,0x137));var _0x3942=function(_0x3c3055,_0x125fe7){_0x3c3055=_0x3c3055-0x0;var _0x376f34=_0x9423[_0x3c3055];return _0x376f34;};'use strict';var multer=require(_0x3942('0x0'));var util=require(_0x3942('0x1'));var path=require(_0x3942('0x2'));var timeout=require('connect-timeout');var express=require(_0x3942('0x3'));var router=express[_0x3942('0x4')]();var fs_extra=require(_0x3942('0x5'));var auth=require(_0x3942('0x6'));var interaction=require(_0x3942('0x7'));var config=require(_0x3942('0x8'));var controller=require(_0x3942('0x9'));router[_0x3942('0xa')]('/',auth[_0x3942('0xb')](),controller['index']);router[_0x3942('0xa')](_0x3942('0xc'),auth[_0x3942('0xb')](),controller['show']);router[_0x3942('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0x3942('0xe')](_0x3942('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x3942('0xf')](_0x3942('0xc'),auth[_0x3942('0xb')](),controller['destroy']);module[_0x3942('0x10')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.attributes.js b/server/api/intSalesforceField/intSalesforceField.attributes.js index e9cdf80..77e8ffa 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 _0x155b=['string','variable','customVariable','picklist','STRING','sequelize','ENUM'];(function(_0x17db61,_0x364236){var _0x7ac96b=function(_0x329bf4){while(--_0x329bf4){_0x17db61['push'](_0x17db61['shift']());}};_0x7ac96b(++_0x364236);}(_0x155b,0x1c5));var _0xb155=function(_0x4f2d40,_0x2b76f8){_0x4f2d40=_0x4f2d40-0x0;var _0x227027=_0x155b[_0x4f2d40];return _0x227027;};'use strict';var Sequelize=require(_0xb155('0x0'));module['exports']={'type':{'type':Sequelize[_0xb155('0x1')](_0xb155('0x2'),_0xb155('0x3'),_0xb155('0x4'),'keyValue',_0xb155('0x5')),'defaultValue':_0xb155('0x2')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xb155('0x1')]('string','variable',_0xb155('0x4'))},'keyContent':{'type':Sequelize[_0xb155('0x6')]},'idField':{'type':Sequelize[_0xb155('0x6')]},'variableName':{'type':Sequelize[_0xb155('0x6')]}}; \ No newline at end of file +var _0xc1c1=['sequelize','exports','ENUM','string','variable','keyValue','picklist','STRING','customVariable'];(function(_0x56482c,_0x16118d){var _0x5aae7a=function(_0x52512f){while(--_0x52512f){_0x56482c['push'](_0x56482c['shift']());}};_0x5aae7a(++_0x16118d);}(_0xc1c1,0x195));var _0x1c1c=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xc1c1[_0x2641f9];return _0x585741;};'use strict';var Sequelize=require(_0x1c1c('0x0'));module[_0x1c1c('0x1')]={'type':{'type':Sequelize[_0x1c1c('0x2')](_0x1c1c('0x3'),_0x1c1c('0x4'),'customVariable',_0x1c1c('0x5'),_0x1c1c('0x6')),'defaultValue':_0x1c1c('0x3')},'content':{'type':Sequelize[_0x1c1c('0x7')]},'key':{'type':Sequelize[_0x1c1c('0x7')]},'keyType':{'type':Sequelize[_0x1c1c('0x2')](_0x1c1c('0x3'),_0x1c1c('0x4'),_0x1c1c('0x8'))},'keyContent':{'type':Sequelize[_0x1c1c('0x7')]},'idField':{'type':Sequelize[_0x1c1c('0x7')]},'variableName':{'type':Sequelize[_0x1c1c('0x7')]}}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.controller.js b/server/api/intSalesforceField/intSalesforceField.controller.js index 348f939..b1f7958 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 _0x33cb=['crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','sendStatus','end','json','offset','undefined','limit','count','status','set','Content-Range','apply','reject','save','update','then','error','stack','name','send','index','map','SalesforceField','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','include','findAll','rows','show','params','keys','rawAttributes','includeAll','find','catch','body','destroy','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash'];(function(_0x1e8d09,_0x290b78){var _0x145fcd=function(_0xcb521b){while(--_0xcb521b){_0x1e8d09['push'](_0x1e8d09['shift']());}};_0x145fcd(++_0x290b78);}(_0x33cb,0xcd));var _0xb33c=function(_0x188511,_0x546f07){_0x188511=_0x188511-0x0;var _0x34a561=_0x33cb[_0x188511];return _0x34a561;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xb33c('0x0'));var jsonpatch=require(_0xb33c('0x1'));var rp=require(_0xb33c('0x2'));var moment=require(_0xb33c('0x3'));var BPromise=require(_0xb33c('0x4'));var Mustache=require(_0xb33c('0x5'));var util=require('util');var path=require('path');var sox=require(_0xb33c('0x6'));var csv=require(_0xb33c('0x7'));var ejs=require(_0xb33c('0x8'));var fs=require('fs');var fs_extra=require(_0xb33c('0x9'));var _=require(_0xb33c('0xa'));var squel=require('squel');var crypto=require(_0xb33c('0xb'));var jsforce=require(_0xb33c('0xc'));var deskjs=require(_0xb33c('0xd'));var toCsv=require(_0xb33c('0x7'));var querystring=require('querystring');var Papa=require(_0xb33c('0xe'));var Redis=require(_0xb33c('0xf'));var authService=require(_0xb33c('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xb33c('0x11'));var hardwareService=require(_0xb33c('0x12'));var logger=require('../../config/logger')(_0xb33c('0x13'));var utils=require(_0xb33c('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xb33c('0x15'))['db'];function respondWithStatusCode(_0x47507d,_0x2c29a6){_0x2c29a6=_0x2c29a6||0xcc;return function(_0x44764d){if(_0x44764d){return _0x47507d[_0xb33c('0x16')](_0x2c29a6);}return _0x47507d['status'](_0x2c29a6)[_0xb33c('0x17')]();};}function respondWithResult(_0x263fa2,_0x4565d5){_0x4565d5=_0x4565d5||0xc8;return function(_0x58c471){if(_0x58c471){return _0x263fa2['status'](_0x4565d5)[_0xb33c('0x18')](_0x58c471);}};}function respondWithFilteredResult(_0x58ed32,_0x42de6d){return function(_0x55e546){if(_0x55e546){var _0x2ad916=typeof _0x42de6d[_0xb33c('0x19')]===_0xb33c('0x1a')&&typeof _0x42de6d[_0xb33c('0x1b')]===_0xb33c('0x1a');var _0x21c009=_0x55e546[_0xb33c('0x1c')];var _0x3b0dca=_0x2ad916?0x0:_0x42de6d[_0xb33c('0x19')];var _0x1f30c8=_0x2ad916?_0x55e546[_0xb33c('0x1c')]:_0x42de6d[_0xb33c('0x19')]+_0x42de6d[_0xb33c('0x1b')];var _0x274bb1;if(_0x1f30c8>=_0x21c009){_0x1f30c8=_0x21c009;_0x274bb1=0xc8;}else{_0x274bb1=0xce;}_0x58ed32[_0xb33c('0x1d')](_0x274bb1);return _0x58ed32[_0xb33c('0x1e')](_0xb33c('0x1f'),_0x3b0dca+'-'+_0x1f30c8+'/'+_0x21c009)[_0xb33c('0x18')](_0x55e546);}return null;};}function patchUpdates(_0x1dba03){return function(_0x44d31b){try{jsonpatch[_0xb33c('0x20')](_0x44d31b,_0x1dba03,!![]);}catch(_0x1eb750){return BPromise[_0xb33c('0x21')](_0x1eb750);}return _0x44d31b[_0xb33c('0x22')]();};}function saveUpdates(_0x2f82d9,_0x4803e5){return function(_0x5efe71){if(_0x5efe71){return _0x5efe71[_0xb33c('0x23')](_0x2f82d9)[_0xb33c('0x24')](function(_0x41688f){return _0x41688f;});}return null;};}function removeEntity(_0x26b296,_0x284934){return function(_0x3ba054){if(_0x3ba054){return _0x3ba054['destroy']()[_0xb33c('0x24')](function(){_0x26b296[_0xb33c('0x1d')](0xcc)[_0xb33c('0x17')]();});}};}function handleEntityNotFound(_0x500f45,_0x135b7c){return function(_0x216dd4){if(!_0x216dd4){_0x500f45[_0xb33c('0x16')](0x194);}return _0x216dd4;};}function handleError(_0x4a3e7c,_0x490251){_0x490251=_0x490251||0x1f4;return function(_0x11a51c){logger[_0xb33c('0x25')](_0x11a51c[_0xb33c('0x26')]);if(_0x11a51c[_0xb33c('0x27')]){delete _0x11a51c[_0xb33c('0x27')];}_0x4a3e7c[_0xb33c('0x1d')](_0x490251)[_0xb33c('0x28')](_0x11a51c);};}exports[_0xb33c('0x29')]=function(_0x23c8c8,_0x1b3067){var _0x583c79={},_0x503a05={},_0x46b31a={'count':0x0,'rows':[]};var _0x4c13ef=_[_0xb33c('0x2a')](db[_0xb33c('0x2b')]['rawAttributes'],function(_0x5cecfb){return{'name':_0x5cecfb['fieldName'],'type':_0x5cecfb[_0xb33c('0x2c')][_0xb33c('0x2d')]};});_0x503a05[_0xb33c('0x2e')]=_[_0xb33c('0x2a')](_0x4c13ef,'name');_0x503a05[_0xb33c('0x2f')]=_['keys'](_0x23c8c8[_0xb33c('0x2f')]);_0x503a05[_0xb33c('0x30')]=_[_0xb33c('0x31')](_0x503a05[_0xb33c('0x2e')],_0x503a05[_0xb33c('0x2f')]);_0x583c79[_0xb33c('0x32')]=_['intersection'](_0x503a05[_0xb33c('0x2e')],qs['fields'](_0x23c8c8[_0xb33c('0x2f')][_0xb33c('0x33')]));_0x583c79[_0xb33c('0x32')]=_0x583c79[_0xb33c('0x32')]['length']?_0x583c79['attributes']:_0x503a05['model'];if(!_0x23c8c8['query'][_0xb33c('0x34')](_0xb33c('0x35'))){_0x583c79[_0xb33c('0x1b')]=qs[_0xb33c('0x1b')](_0x23c8c8[_0xb33c('0x2f')][_0xb33c('0x1b')]);_0x583c79['offset']=qs['offset'](_0x23c8c8[_0xb33c('0x2f')][_0xb33c('0x19')]);}_0x583c79[_0xb33c('0x36')]=qs[_0xb33c('0x37')](_0x23c8c8[_0xb33c('0x2f')]['sort']);_0x583c79[_0xb33c('0x38')]=qs['filters'](_['pick'](_0x23c8c8[_0xb33c('0x2f')],_0x503a05[_0xb33c('0x30')]),_0x4c13ef);if(_0x23c8c8[_0xb33c('0x2f')]['filter']){_0x583c79[_0xb33c('0x38')]=_['merge'](_0x583c79[_0xb33c('0x38')],{'$or':_['map'](_0x4c13ef,function(_0x43fe9c){if(_0x43fe9c[_0xb33c('0x2c')]!=='VIRTUAL'){var _0x5e07b2={};_0x5e07b2[_0x43fe9c['name']]={'$like':'%'+_0x23c8c8['query'][_0xb33c('0x39')]+'%'};return _0x5e07b2;}})});}_0x583c79=_[_0xb33c('0x3a')]({},_0x583c79,_0x23c8c8[_0xb33c('0x3b')]);var _0x7f4a82={'where':_0x583c79['where']};return db[_0xb33c('0x2b')]['count'](_0x7f4a82)[_0xb33c('0x24')](function(_0x2ea829){_0x46b31a[_0xb33c('0x1c')]=_0x2ea829;if(_0x23c8c8[_0xb33c('0x2f')]['includeAll']){_0x583c79[_0xb33c('0x3c')]=[{'all':!![]}];}return db['SalesforceField'][_0xb33c('0x3d')](_0x583c79);})[_0xb33c('0x24')](function(_0x1fe1f1){_0x46b31a[_0xb33c('0x3e')]=_0x1fe1f1;return _0x46b31a;})[_0xb33c('0x24')](respondWithFilteredResult(_0x1b3067,_0x583c79))['catch'](handleError(_0x1b3067,null));};exports[_0xb33c('0x3f')]=function(_0x55e9d0,_0x1dbf95){var _0x35a19d={'raw':!![],'where':{'id':_0x55e9d0[_0xb33c('0x40')]['id']}},_0x35aca6={};_0x35aca6[_0xb33c('0x2e')]=_[_0xb33c('0x41')](db['SalesforceField'][_0xb33c('0x42')]);_0x35aca6[_0xb33c('0x2f')]=_[_0xb33c('0x41')](_0x55e9d0['query']);_0x35aca6['filters']=_[_0xb33c('0x31')](_0x35aca6[_0xb33c('0x2e')],_0x35aca6['query']);_0x35a19d[_0xb33c('0x32')]=_[_0xb33c('0x31')](_0x35aca6[_0xb33c('0x2e')],qs[_0xb33c('0x33')](_0x55e9d0[_0xb33c('0x2f')]['fields']));_0x35a19d['attributes']=_0x35a19d['attributes']['length']?_0x35a19d[_0xb33c('0x32')]:_0x35aca6['model'];if(_0x55e9d0['query'][_0xb33c('0x43')]){_0x35a19d[_0xb33c('0x3c')]=[{'all':!![]}];}_0x35a19d=_[_0xb33c('0x3a')]({},_0x35a19d,_0x55e9d0[_0xb33c('0x3b')]);return db[_0xb33c('0x2b')][_0xb33c('0x44')](_0x35a19d)['then'](handleEntityNotFound(_0x1dbf95,null))['then'](respondWithResult(_0x1dbf95,null))[_0xb33c('0x45')](handleError(_0x1dbf95,null));};exports['create']=function(_0x1cdb2d,_0x97562a){return db[_0xb33c('0x2b')]['create'](_0x1cdb2d['body'],{})[_0xb33c('0x24')](respondWithResult(_0x97562a,0xc9))[_0xb33c('0x45')](handleError(_0x97562a,null));};exports[_0xb33c('0x23')]=function(_0x1f2fe4,_0x14d5fd){if(_0x1f2fe4[_0xb33c('0x46')]['id']){delete _0x1f2fe4[_0xb33c('0x46')]['id'];}return db[_0xb33c('0x2b')][_0xb33c('0x44')]({'where':{'id':_0x1f2fe4['params']['id']}})[_0xb33c('0x24')](handleEntityNotFound(_0x14d5fd,null))[_0xb33c('0x24')](saveUpdates(_0x1f2fe4[_0xb33c('0x46')],null))[_0xb33c('0x24')](respondWithResult(_0x14d5fd,null))[_0xb33c('0x45')](handleError(_0x14d5fd,null));};exports[_0xb33c('0x47')]=function(_0x531499,_0x2755ea){return db[_0xb33c('0x2b')][_0xb33c('0x44')]({'where':{'id':_0x531499[_0xb33c('0x40')]['id']}})[_0xb33c('0x24')](handleEntityNotFound(_0x2755ea,null))['then'](removeEntity(_0x2755ea,null))[_0xb33c('0x45')](handleError(_0x2755ea,null));}; \ No newline at end of file +var _0x8544=['undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','index','SalesforceField','fieldName','key','map','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','rows','catch','show','model','find','create','body','update','params','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','offset'];(function(_0x24a654,_0x2ca441){var _0x458651=function(_0x1ecda1){while(--_0x1ecda1){_0x24a654['push'](_0x24a654['shift']());}};_0x458651(++_0x2ca441);}(_0x8544,0x11c));var _0x4854=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0x8544[_0x27af45];return _0x18df21;};'use strict';var emlformat=require(_0x4854('0x0'));var rimraf=require(_0x4854('0x1'));var zipdir=require(_0x4854('0x2'));var jsonpatch=require(_0x4854('0x3'));var rp=require('request-promise');var moment=require(_0x4854('0x4'));var BPromise=require(_0x4854('0x5'));var Mustache=require(_0x4854('0x6'));var util=require(_0x4854('0x7'));var path=require(_0x4854('0x8'));var sox=require(_0x4854('0x9'));var csv=require(_0x4854('0xa'));var ejs=require(_0x4854('0xb'));var fs=require('fs');var fs_extra=require(_0x4854('0xc'));var _=require(_0x4854('0xd'));var squel=require(_0x4854('0xe'));var crypto=require(_0x4854('0xf'));var jsforce=require(_0x4854('0x10'));var deskjs=require(_0x4854('0x11'));var toCsv=require(_0x4854('0xa'));var querystring=require(_0x4854('0x12'));var Papa=require('papaparse');var Redis=require(_0x4854('0x13'));var authService=require(_0x4854('0x14'));var qs=require(_0x4854('0x15'));var as=require(_0x4854('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4854('0x17'))(_0x4854('0x18'));var utils=require(_0x4854('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0x4854('0x1a'));var db=require(_0x4854('0x1b'))['db'];function respondWithStatusCode(_0x26dbfd,_0x1f9c2b){_0x1f9c2b=_0x1f9c2b||0xcc;return function(_0x132796){if(_0x132796){return _0x26dbfd[_0x4854('0x1c')](_0x1f9c2b);}return _0x26dbfd[_0x4854('0x1d')](_0x1f9c2b)[_0x4854('0x1e')]();};}function respondWithResult(_0x59ecac,_0x383580){_0x383580=_0x383580||0xc8;return function(_0xd43a02){if(_0xd43a02){return _0x59ecac[_0x4854('0x1d')](_0x383580)['json'](_0xd43a02);}};}function respondWithFilteredResult(_0x4d25e1,_0x5aeafe){return function(_0x5efaed){if(_0x5efaed){var _0x3b80cf=typeof _0x5aeafe[_0x4854('0x1f')]===_0x4854('0x20')&&typeof _0x5aeafe[_0x4854('0x21')]===_0x4854('0x20');var _0x514b32=_0x5efaed[_0x4854('0x22')];var _0x10fbd2=_0x3b80cf?0x0:_0x5aeafe[_0x4854('0x1f')];var _0x2e7ecd=_0x3b80cf?_0x5efaed[_0x4854('0x22')]:_0x5aeafe[_0x4854('0x1f')]+_0x5aeafe[_0x4854('0x21')];var _0xe93230;if(_0x2e7ecd>=_0x514b32){_0x2e7ecd=_0x514b32;_0xe93230=0xc8;}else{_0xe93230=0xce;}_0x4d25e1[_0x4854('0x1d')](_0xe93230);return _0x4d25e1[_0x4854('0x23')](_0x4854('0x24'),_0x10fbd2+'-'+_0x2e7ecd+'/'+_0x514b32)['json'](_0x5efaed);}return null;};}function patchUpdates(_0x4eb4ea){return function(_0x2c27f1){try{jsonpatch[_0x4854('0x25')](_0x2c27f1,_0x4eb4ea,!![]);}catch(_0x2c1dc5){return BPromise[_0x4854('0x26')](_0x2c1dc5);}return _0x2c27f1[_0x4854('0x27')]();};}function saveUpdates(_0x5026f5,_0x101803){return function(_0x3ad899){if(_0x3ad899){return _0x3ad899['update'](_0x5026f5)[_0x4854('0x28')](function(_0x4d29f4){return _0x4d29f4;});}return null;};}function removeEntity(_0x549456,_0x337d67){return function(_0x24336b){if(_0x24336b){return _0x24336b[_0x4854('0x29')]()[_0x4854('0x28')](function(){_0x549456[_0x4854('0x1d')](0xcc)[_0x4854('0x1e')]();});}};}function handleEntityNotFound(_0x1f1df2,_0x1f275d){return function(_0x4a5e08){if(!_0x4a5e08){_0x1f1df2[_0x4854('0x1c')](0x194);}return _0x4a5e08;};}function handleError(_0x40205b,_0x249c10){_0x249c10=_0x249c10||0x1f4;return function(_0xc2335){logger[_0x4854('0x2a')](_0xc2335[_0x4854('0x2b')]);if(_0xc2335[_0x4854('0x2c')]){delete _0xc2335[_0x4854('0x2c')];}_0x40205b[_0x4854('0x1d')](_0x249c10)[_0x4854('0x2d')](_0xc2335);};}exports[_0x4854('0x2e')]=function(_0x1f401e,_0x586cf4){var _0x1ebf15={},_0x139444={},_0x4ab15b={'count':0x0,'rows':[]};var _0x40a655=_['map'](db[_0x4854('0x2f')]['rawAttributes'],function(_0x17c82a){return{'name':_0x17c82a[_0x4854('0x30')],'type':_0x17c82a['type'][_0x4854('0x31')]};});_0x139444['model']=_[_0x4854('0x32')](_0x40a655,_0x4854('0x2c'));_0x139444['query']=_[_0x4854('0x33')](_0x1f401e[_0x4854('0x34')]);_0x139444[_0x4854('0x35')]=_[_0x4854('0x36')](_0x139444['model'],_0x139444[_0x4854('0x34')]);_0x1ebf15[_0x4854('0x37')]=_['intersection'](_0x139444['model'],qs[_0x4854('0x38')](_0x1f401e['query'][_0x4854('0x38')]));_0x1ebf15[_0x4854('0x37')]=_0x1ebf15[_0x4854('0x37')][_0x4854('0x39')]?_0x1ebf15['attributes']:_0x139444['model'];if(!_0x1f401e[_0x4854('0x34')][_0x4854('0x3a')](_0x4854('0x3b'))){_0x1ebf15[_0x4854('0x21')]=qs[_0x4854('0x21')](_0x1f401e[_0x4854('0x34')][_0x4854('0x21')]);_0x1ebf15[_0x4854('0x1f')]=qs[_0x4854('0x1f')](_0x1f401e['query'][_0x4854('0x1f')]);}_0x1ebf15['order']=qs[_0x4854('0x3c')](_0x1f401e[_0x4854('0x34')][_0x4854('0x3c')]);_0x1ebf15[_0x4854('0x3d')]=qs[_0x4854('0x35')](_[_0x4854('0x3e')](_0x1f401e[_0x4854('0x34')],_0x139444[_0x4854('0x35')]),_0x40a655);if(_0x1f401e[_0x4854('0x34')][_0x4854('0x3f')]){_0x1ebf15[_0x4854('0x3d')]=_[_0x4854('0x40')](_0x1ebf15[_0x4854('0x3d')],{'$or':_[_0x4854('0x32')](_0x40a655,function(_0x1b1975){if(_0x1b1975[_0x4854('0x41')]!==_0x4854('0x42')){var _0xf9fbb3={};_0xf9fbb3[_0x1b1975[_0x4854('0x2c')]]={'$like':'%'+_0x1f401e['query']['filter']+'%'};return _0xf9fbb3;}})});}_0x1ebf15=_[_0x4854('0x40')]({},_0x1ebf15,_0x1f401e[_0x4854('0x43')]);var _0x433e7f={'where':_0x1ebf15[_0x4854('0x3d')]};return db[_0x4854('0x2f')][_0x4854('0x22')](_0x433e7f)[_0x4854('0x28')](function(_0x1b18ec){_0x4ab15b['count']=_0x1b18ec;if(_0x1f401e[_0x4854('0x34')][_0x4854('0x44')]){_0x1ebf15[_0x4854('0x45')]=[{'all':!![]}];}return db['SalesforceField']['findAll'](_0x1ebf15);})[_0x4854('0x28')](function(_0x3c5969){_0x4ab15b[_0x4854('0x46')]=_0x3c5969;return _0x4ab15b;})[_0x4854('0x28')](respondWithFilteredResult(_0x586cf4,_0x1ebf15))[_0x4854('0x47')](handleError(_0x586cf4,null));};exports[_0x4854('0x48')]=function(_0x4e5c9d,_0x44e881){var _0x36204d={'raw':!![],'where':{'id':_0x4e5c9d['params']['id']}},_0x213039={};_0x213039[_0x4854('0x49')]=_[_0x4854('0x33')](db[_0x4854('0x2f')]['rawAttributes']);_0x213039[_0x4854('0x34')]=_[_0x4854('0x33')](_0x4e5c9d['query']);_0x213039[_0x4854('0x35')]=_[_0x4854('0x36')](_0x213039['model'],_0x213039['query']);_0x36204d['attributes']=_[_0x4854('0x36')](_0x213039['model'],qs[_0x4854('0x38')](_0x4e5c9d[_0x4854('0x34')][_0x4854('0x38')]));_0x36204d[_0x4854('0x37')]=_0x36204d[_0x4854('0x37')][_0x4854('0x39')]?_0x36204d['attributes']:_0x213039['model'];if(_0x4e5c9d['query'][_0x4854('0x44')]){_0x36204d[_0x4854('0x45')]=[{'all':!![]}];}_0x36204d=_[_0x4854('0x40')]({},_0x36204d,_0x4e5c9d['options']);return db['SalesforceField'][_0x4854('0x4a')](_0x36204d)[_0x4854('0x28')](handleEntityNotFound(_0x44e881,null))[_0x4854('0x28')](respondWithResult(_0x44e881,null))[_0x4854('0x47')](handleError(_0x44e881,null));};exports[_0x4854('0x4b')]=function(_0x478d9e,_0x17530d){return db['SalesforceField']['create'](_0x478d9e[_0x4854('0x4c')],{})[_0x4854('0x28')](respondWithResult(_0x17530d,0xc9))[_0x4854('0x47')](handleError(_0x17530d,null));};exports[_0x4854('0x4d')]=function(_0xe6f995,_0x582d2a){if(_0xe6f995[_0x4854('0x4c')]['id']){delete _0xe6f995[_0x4854('0x4c')]['id'];}return db[_0x4854('0x2f')]['find']({'where':{'id':_0xe6f995[_0x4854('0x4e')]['id']}})[_0x4854('0x28')](handleEntityNotFound(_0x582d2a,null))['then'](saveUpdates(_0xe6f995['body'],null))[_0x4854('0x28')](respondWithResult(_0x582d2a,null))[_0x4854('0x47')](handleError(_0x582d2a,null));};exports[_0x4854('0x29')]=function(_0x1745ee,_0x2056fd){return db['SalesforceField'][_0x4854('0x4a')]({'where':{'id':_0x1745ee[_0x4854('0x4e')]['id']}})[_0x4854('0x28')](handleEntityNotFound(_0x2056fd,null))[_0x4854('0x28')](removeEntity(_0x2056fd,null))[_0x4854('0x47')](handleError(_0x2056fd,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.model.js b/server/api/intSalesforceField/intSalesforceField.model.js index e08fb4c..45682e7 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 _0x3595=['idField','FieldId','util','api','moment','request-promise','path','rimraf','./intSalesforceField.attributes','exports','define','SalesforceField','int_salesforce_fields'];(function(_0x212ba4,_0x29d98e){var _0x16a20b=function(_0x1156ba){while(--_0x1156ba){_0x212ba4['push'](_0x212ba4['shift']());}};_0x16a20b(++_0x29d98e);}(_0x3595,0x195));var _0x5359=function(_0x38fef6,_0x535135){_0x38fef6=_0x38fef6-0x0;var _0x5502f9=_0x3595[_0x38fef6];return _0x5502f9;};'use strict';var _=require('lodash');var util=require(_0x5359('0x0'));var logger=require('../../config/logger')(_0x5359('0x1'));var moment=require(_0x5359('0x2'));var BPromise=require('bluebird');var rp=require(_0x5359('0x3'));var fs=require('fs');var path=require(_0x5359('0x4'));var rimraf=require(_0x5359('0x5'));var config=require('../../config/environment');var attributes=require(_0x5359('0x6'));module[_0x5359('0x7')]=function(_0x18d483,_0xac37aa){return _0x18d483[_0x5359('0x8')](_0x5359('0x9'),attributes,{'tableName':_0x5359('0xa'),'paranoid':![],'indexes':[{'name':'salesforce_unique_index','fields':[_0x5359('0xb'),_0x5359('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xc61c=['bluebird','path','rimraf','../../config/environment','./intSalesforceField.attributes','exports','define','idField','FieldId','lodash','util','../../config/logger'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc61c,0x159));var _0xcc61=function(_0x1e9ac0,_0x554574){_0x1e9ac0=_0x1e9ac0-0x0;var _0x40ce36=_0xc61c[_0x1e9ac0];return _0x40ce36;};'use strict';var _=require(_0xcc61('0x0'));var util=require(_0xcc61('0x1'));var logger=require(_0xcc61('0x2'))('api');var moment=require('moment');var BPromise=require(_0xcc61('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xcc61('0x4'));var rimraf=require(_0xcc61('0x5'));var config=require(_0xcc61('0x6'));var attributes=require(_0xcc61('0x7'));module[_0xcc61('0x8')]=function(_0x12b640,_0xdca2f8){return _0x12b640[_0xcc61('0x9')]('SalesforceField',attributes,{'tableName':'int_salesforce_fields','paranoid':![],'indexes':[{'name':'salesforce_unique_index','fields':[_0xcc61('0xa'),_0xcc61('0xb')],'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 b055131..099d875 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 _0x465e=['lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','request','then','info','SalesforceField,\x20%s,\x20%s','debug','SalesforceField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message'];(function(_0x2c7618,_0x26be9c){var _0x5ce3f0=function(_0x1837b3){while(--_0x1837b3){_0x2c7618['push'](_0x2c7618['shift']());}};_0x5ce3f0(++_0x26be9c);}(_0x465e,0xa0));var _0xe465=function(_0x46698a,_0x8de1e4){_0x46698a=_0x46698a-0x0;var _0x356db0=_0x465e[_0x46698a];return _0x356db0;};'use strict';var _=require(_0xe465('0x0'));var util=require(_0xe465('0x1'));var moment=require('moment');var BPromise=require(_0xe465('0x2'));var rs=require(_0xe465('0x3'));var fs=require('fs');var Redis=require(_0xe465('0x4'));var db=require(_0xe465('0x5'))['db'];var utils=require(_0xe465('0x6'));var logger=require(_0xe465('0x7'))(_0xe465('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x47ce95,_0x446d17,_0x410adf){return new BPromise(function(_0x3c8158,_0xb4b628){return client[_0xe465('0x9')](_0x47ce95,_0x410adf)[_0xe465('0xa')](function(_0x1d12b1){logger[_0xe465('0xb')](_0xe465('0xc'),_0x446d17,'request\x20sent');logger[_0xe465('0xd')](_0xe465('0xe'),_0x446d17,_0xe465('0xf'),JSON[_0xe465('0x10')](_0x1d12b1));if(_0x1d12b1[_0xe465('0x11')]){if(_0x1d12b1[_0xe465('0x11')][_0xe465('0x12')]===0x1f4){logger[_0xe465('0x11')](_0xe465('0xc'),_0x446d17,_0x1d12b1['error']['message']);return _0xb4b628(_0x1d12b1[_0xe465('0x11')][_0xe465('0x13')]);}logger[_0xe465('0x11')](_0xe465('0xc'),_0x446d17,_0x1d12b1[_0xe465('0x11')][_0xe465('0x13')]);return _0x3c8158(_0x1d12b1[_0xe465('0x11')]['message']);}else{logger[_0xe465('0xb')](_0xe465('0xc'),_0x446d17,_0xe465('0xf'));_0x3c8158(_0x1d12b1['result'][_0xe465('0x13')]);}})['catch'](function(_0x50012b){logger[_0xe465('0x11')](_0xe465('0xc'),_0x446d17,_0x50012b);_0xb4b628(_0x50012b);});});} \ No newline at end of file +var _0x4ba3=['request','then','SalesforceField,\x20%s,\x20%s','request\x20sent','debug','SalesforceField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http'];(function(_0x4793ec,_0x2c98e7){var _0x180cf4=function(_0x213bf5){while(--_0x213bf5){_0x4793ec['push'](_0x4793ec['shift']());}};_0x180cf4(++_0x2c98e7);}(_0x4ba3,0x1ef));var _0x34ba=function(_0xaf3247,_0x39e1bf){_0xaf3247=_0xaf3247-0x0;var _0x4eea43=_0x4ba3[_0xaf3247];return _0x4eea43;};'use strict';var _=require(_0x34ba('0x0'));var util=require('util');var moment=require(_0x34ba('0x1'));var BPromise=require(_0x34ba('0x2'));var rs=require(_0x34ba('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x34ba('0x4'))['db'];var utils=require(_0x34ba('0x5'));var logger=require(_0x34ba('0x6'))('rpc');var config=require(_0x34ba('0x7'));var jayson=require(_0x34ba('0x8'));var client=jayson[_0x34ba('0x9')][_0x34ba('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xca87bd,_0x342dfb,_0x49ae4d){return new BPromise(function(_0x263ced,_0x40fb33){return client[_0x34ba('0xb')](_0xca87bd,_0x49ae4d)[_0x34ba('0xc')](function(_0x332415){logger['info'](_0x34ba('0xd'),_0x342dfb,_0x34ba('0xe'));logger[_0x34ba('0xf')](_0x34ba('0x10'),_0x342dfb,'request\x20sent',JSON[_0x34ba('0x11')](_0x332415));if(_0x332415['error']){if(_0x332415[_0x34ba('0x12')][_0x34ba('0x13')]===0x1f4){logger['error'](_0x34ba('0xd'),_0x342dfb,_0x332415['error']['message']);return _0x40fb33(_0x332415['error'][_0x34ba('0x14')]);}logger[_0x34ba('0x12')](_0x34ba('0xd'),_0x342dfb,_0x332415[_0x34ba('0x12')][_0x34ba('0x14')]);return _0x263ced(_0x332415[_0x34ba('0x12')][_0x34ba('0x14')]);}else{logger['info'](_0x34ba('0xd'),_0x342dfb,'request\x20sent');_0x263ced(_0x332415[_0x34ba('0x15')][_0x34ba('0x14')]);}})['catch'](function(_0x11e00e){logger[_0x34ba('0x12')](_0x34ba('0xd'),_0x342dfb,_0x11e00e);_0x40fb33(_0x11e00e);});});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/index.js b/server/api/intServicenowAccount/index.js index c1c6525..b0baa45 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 _0x0a88=['get','/:id','/:id/fields','getFields','post','create','/:id/configurations','delete','destroy','exports','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index'];(function(_0x4b7288,_0x795ae6){var _0x3ce313=function(_0x3d6fd3){while(--_0x3d6fd3){_0x4b7288['push'](_0x4b7288['shift']());}};_0x3ce313(++_0x795ae6);}(_0x0a88,0xac));var _0x80a8=function(_0x2e913b,_0x4b7071){_0x2e913b=_0x2e913b-0x0;var _0x173899=_0x0a88[_0x2e913b];return _0x173899;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x80a8('0x0'));var timeout=require(_0x80a8('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x80a8('0x2'));var auth=require(_0x80a8('0x3'));var interaction=require(_0x80a8('0x4'));var config=require(_0x80a8('0x5'));var controller=require('./intServicenowAccount.controller');router['get']('/',auth[_0x80a8('0x6')](),controller[_0x80a8('0x7')]);router[_0x80a8('0x8')](_0x80a8('0x9'),auth[_0x80a8('0x6')](),controller['show']);router['get']('/:id/configurations',auth['isAuthenticated'](),controller['getConfigurations']);router[_0x80a8('0x8')](_0x80a8('0xa'),auth[_0x80a8('0x6')](),controller[_0x80a8('0xb')]);router[_0x80a8('0xc')]('/',auth[_0x80a8('0x6')](),controller[_0x80a8('0xd')]);router['post'](_0x80a8('0xe'),auth[_0x80a8('0x6')](),controller['addConfiguration']);router['put'](_0x80a8('0x9'),auth[_0x80a8('0x6')](),controller['update']);router[_0x80a8('0xf')](_0x80a8('0x9'),auth['isAuthenticated'](),controller[_0x80a8('0x10')]);module[_0x80a8('0x11')]=router; \ No newline at end of file +var _0x0f1e=['express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intServicenowAccount.controller','get','isAuthenticated','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','addConfiguration','put','/:id','update','delete','destroy','path'];(function(_0x43c523,_0x29c3de){var _0x38131f=function(_0x1a1085){while(--_0x1a1085){_0x43c523['push'](_0x43c523['shift']());}};_0x38131f(++_0x29c3de);}(_0x0f1e,0x18e));var _0xe0f1=function(_0x2f58bb,_0x26a4d3){_0x2f58bb=_0x2f58bb-0x0;var _0x419b5b=_0x0f1e[_0x2f58bb];return _0x419b5b;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xe0f1('0x0'));var timeout=require('connect-timeout');var express=require(_0xe0f1('0x1'));var router=express[_0xe0f1('0x2')]();var fs_extra=require(_0xe0f1('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xe0f1('0x4'));var config=require(_0xe0f1('0x5'));var controller=require(_0xe0f1('0x6'));router[_0xe0f1('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0xe0f1('0x7')]('/:id',auth[_0xe0f1('0x8')](),controller[_0xe0f1('0x9')]);router['get'](_0xe0f1('0xa'),auth[_0xe0f1('0x8')](),controller[_0xe0f1('0xb')]);router[_0xe0f1('0x7')](_0xe0f1('0xc'),auth[_0xe0f1('0x8')](),controller[_0xe0f1('0xd')]);router[_0xe0f1('0xe')]('/',auth[_0xe0f1('0x8')](),controller['create']);router['post']('/:id/configurations',auth['isAuthenticated'](),controller[_0xe0f1('0xf')]);router[_0xe0f1('0x10')](_0xe0f1('0x11'),auth['isAuthenticated'](),controller[_0xe0f1('0x12')]);router[_0xe0f1('0x13')]('/:id',auth[_0xe0f1('0x8')](),controller[_0xe0f1('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.attributes.js b/server/api/intServicenowAccount/intServicenowAccount.attributes.js index 2c94ee0..6f797c4 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 _0xdd89=['username','remoteUri','STRING'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xdd89,0x19a));var _0x9dd8=function(_0xf73c09,_0x4e424e){_0xf73c09=_0xf73c09-0x0;var _0xa8923c=_0xdd89[_0xf73c09];return _0xa8923c;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x9dd8('0x0')]},'description':{'type':Sequelize[_0x9dd8('0x0')]},'username':{'type':Sequelize[_0x9dd8('0x0')],'unique':_0x9dd8('0x1')},'password':{'type':Sequelize[_0x9dd8('0x0')]},'email':{'type':Sequelize[_0x9dd8('0x0')]},'remoteUri':{'type':Sequelize[_0x9dd8('0x0')],'unique':_0x9dd8('0x2')},'serverUrl':{'type':Sequelize[_0x9dd8('0x0')],'allowNull':![]}}; \ No newline at end of file +var _0x2b40=['remoteUri','exports','STRING'];(function(_0x105de5,_0xc19e1a){var _0x2007b2=function(_0xc24d92){while(--_0xc24d92){_0x105de5['push'](_0x105de5['shift']());}};_0x2007b2(++_0xc19e1a);}(_0x2b40,0xa6));var _0x02b4=function(_0xc74b1b,_0x2d57e1){_0xc74b1b=_0xc74b1b-0x0;var _0x93ada=_0x2b40[_0xc74b1b];return _0x93ada;};'use strict';var Sequelize=require('sequelize');module[_0x02b4('0x0')]={'name':{'type':Sequelize[_0x02b4('0x1')]},'description':{'type':Sequelize[_0x02b4('0x1')]},'username':{'type':Sequelize['STRING'],'unique':'username'},'password':{'type':Sequelize[_0x02b4('0x1')]},'email':{'type':Sequelize[_0x02b4('0x1')]},'remoteUri':{'type':Sequelize[_0x02b4('0x1')],'unique':_0x02b4('0x2')},'serverUrl':{'type':Sequelize[_0x02b4('0x1')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.controller.js b/server/api/intServicenowAccount/intServicenowAccount.controller.js index c5603d4..3384148 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 _0x15d5=['pick','map','addConfiguration','AccountId','getSubjects','channel','Descriptions','getDescriptions','ServicenowField','Subjects','hold_reason','knowledge','subcategory','close_code','notify','incident_state','category','parent','caused_by','upon_reject','number','resolved_by','sys_updated_by','opened_by','user_input','sys_domain','state','sys_created_by','calendar_stc','closed_at','delivery_plan','impact','active','work_notes_list','priority','sys_domain_path','expected_start','group_list','reopened_time','resolved_at','work_notes','short_description','delivery_task','work_start','assignment_group','business_stc','additional_assignee_list','description','calendar_duration','sys_class_name','close_notes','closed_by','follow_up','parent_incident','sys_id','contact_type','reopened_by','urgency','problem_id','company','reassignment_count','activity_due','assigned_to','severity','comments','sla_due','approval','due_date','sys_mod_count','sys_tags','escalation','correlation_id','location','username','password','serverUrl','remoteUri','slice','substring','lastIndexOf','format','%s/api/now/doc/table/schema/','GET','incident?sysparm_display_value=all','result','log','incident\x20table\x20objects','assign','remove','includes','forEach','internalType','label','push','all','TCL:\x20_object','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','concat','test','statusCode','send','Wrong\x20credentials','boolean','True','false','sys_choice?sysparm_query=name=incident^element=','inactive','value','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','error','stack','index','rawAttributes','fieldName','type','key','model','name','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','ServicenowAccount','includeAll','findAll','rows','catch','show','params','keys','include','find','create','body','destroy','getConfigurations','findOne','ServicenowConfiguration'];(function(_0x4fde08,_0x463a36){var _0x12e725=function(_0x2670c5){while(--_0x2670c5){_0x4fde08['push'](_0x4fde08['shift']());}};_0x12e725(++_0x463a36);}(_0x15d5,0x6c));var _0x515d=function(_0x5931aa,_0x28442f){_0x5931aa=_0x5931aa-0x0;var _0x57088e=_0x15d5[_0x5931aa];return _0x57088e;};'use strict';var emlformat=require(_0x515d('0x0'));var rimraf=require(_0x515d('0x1'));var zipdir=require(_0x515d('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x515d('0x3'));var moment=require(_0x515d('0x4'));var BPromise=require(_0x515d('0x5'));var Mustache=require('mustache');var util=require(_0x515d('0x6'));var path=require(_0x515d('0x7'));var sox=require(_0x515d('0x8'));var csv=require(_0x515d('0x9'));var ejs=require(_0x515d('0xa'));var fs=require('fs');var fs_extra=require(_0x515d('0xb'));var _=require(_0x515d('0xc'));var squel=require(_0x515d('0xd'));var crypto=require('crypto');var jsforce=require(_0x515d('0xe'));var deskjs=require(_0x515d('0xf'));var toCsv=require('to-csv');var querystring=require(_0x515d('0x10'));var Papa=require(_0x515d('0x11'));var Redis=require(_0x515d('0x12'));var authService=require(_0x515d('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x515d('0x14'));var hardwareService=require(_0x515d('0x15'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x515d('0x16'));var licenseUtil=require(_0x515d('0x17'));var db=require(_0x515d('0x18'))['db'];var integrations=require(_0x515d('0x19'));function respondWithStatusCode(_0x4bd83e,_0x1c915a){_0x1c915a=_0x1c915a||0xcc;return function(_0x58fdb2){if(_0x58fdb2){return _0x4bd83e[_0x515d('0x1a')](_0x1c915a);}return _0x4bd83e[_0x515d('0x1b')](_0x1c915a)[_0x515d('0x1c')]();};}function respondWithResult(_0x4462e6,_0x5f3e9){_0x5f3e9=_0x5f3e9||0xc8;return function(_0x3cc3e5){if(_0x3cc3e5){return _0x4462e6['status'](_0x5f3e9)[_0x515d('0x1d')](_0x3cc3e5);}};}function respondWithFilteredResult(_0x2ab9a8,_0x42db01){return function(_0x2b7f2d){if(_0x2b7f2d){var _0x5d17a7=typeof _0x42db01[_0x515d('0x1e')]===_0x515d('0x1f')&&typeof _0x42db01[_0x515d('0x20')]===_0x515d('0x1f');var _0x17b9ae=_0x2b7f2d['count'];var _0x16e242=_0x5d17a7?0x0:_0x42db01['offset'];var _0x1f0c35=_0x5d17a7?_0x2b7f2d[_0x515d('0x21')]:_0x42db01['offset']+_0x42db01['limit'];var _0x27d708;if(_0x1f0c35>=_0x17b9ae){_0x1f0c35=_0x17b9ae;_0x27d708=0xc8;}else{_0x27d708=0xce;}_0x2ab9a8[_0x515d('0x1b')](_0x27d708);return _0x2ab9a8[_0x515d('0x22')](_0x515d('0x23'),_0x16e242+'-'+_0x1f0c35+'/'+_0x17b9ae)['json'](_0x2b7f2d);}return null;};}function patchUpdates(_0x58d08c){return function(_0x48bf71){try{jsonpatch[_0x515d('0x24')](_0x48bf71,_0x58d08c,!![]);}catch(_0x17f477){return BPromise[_0x515d('0x25')](_0x17f477);}return _0x48bf71[_0x515d('0x26')]();};}function saveUpdates(_0x112ca3,_0x41ed0d){return function(_0x1a5eaf){if(_0x1a5eaf){return _0x1a5eaf[_0x515d('0x27')](_0x112ca3)[_0x515d('0x28')](function(_0x4b2227){return _0x4b2227;});}return null;};}function removeEntity(_0x4d31d9,_0x5c819f){return function(_0x5bd5bf){if(_0x5bd5bf){return _0x5bd5bf['destroy']()[_0x515d('0x28')](function(){_0x4d31d9['status'](0xcc)[_0x515d('0x1c')]();});}};}function handleEntityNotFound(_0x4284e8,_0xa90ed9){return function(_0x93a1b){if(!_0x93a1b){_0x4284e8[_0x515d('0x1a')](0x194);}return _0x93a1b;};}function handleError(_0x8a632,_0x4c2335){_0x4c2335=_0x4c2335||0x1f4;return function(_0x14476a){logger[_0x515d('0x29')](_0x14476a[_0x515d('0x2a')]);if(_0x14476a['name']){delete _0x14476a['name'];}_0x8a632[_0x515d('0x1b')](_0x4c2335)['send'](_0x14476a);};}exports[_0x515d('0x2b')]=function(_0x4bf82c,_0xf922b1){var _0x5ede49={},_0x5f556c={},_0x360217={'count':0x0,'rows':[]};var _0x530ef6=_['map'](db['ServicenowAccount'][_0x515d('0x2c')],function(_0x206f80){return{'name':_0x206f80[_0x515d('0x2d')],'type':_0x206f80[_0x515d('0x2e')][_0x515d('0x2f')]};});_0x5f556c[_0x515d('0x30')]=_['map'](_0x530ef6,_0x515d('0x31'));_0x5f556c[_0x515d('0x32')]=_['keys'](_0x4bf82c[_0x515d('0x32')]);_0x5f556c[_0x515d('0x33')]=_[_0x515d('0x34')](_0x5f556c[_0x515d('0x30')],_0x5f556c[_0x515d('0x32')]);_0x5ede49[_0x515d('0x35')]=_[_0x515d('0x34')](_0x5f556c['model'],qs[_0x515d('0x36')](_0x4bf82c[_0x515d('0x32')][_0x515d('0x36')]));_0x5ede49[_0x515d('0x35')]=_0x5ede49[_0x515d('0x35')][_0x515d('0x37')]?_0x5ede49[_0x515d('0x35')]:_0x5f556c[_0x515d('0x30')];if(!_0x4bf82c[_0x515d('0x32')][_0x515d('0x38')](_0x515d('0x39'))){_0x5ede49[_0x515d('0x20')]=qs['limit'](_0x4bf82c[_0x515d('0x32')][_0x515d('0x20')]);_0x5ede49[_0x515d('0x1e')]=qs[_0x515d('0x1e')](_0x4bf82c[_0x515d('0x32')][_0x515d('0x1e')]);}_0x5ede49[_0x515d('0x3a')]=qs['sort'](_0x4bf82c[_0x515d('0x32')][_0x515d('0x3b')]);_0x5ede49[_0x515d('0x3c')]=qs['filters'](_['pick'](_0x4bf82c['query'],_0x5f556c[_0x515d('0x33')]),_0x530ef6);if(_0x4bf82c[_0x515d('0x32')][_0x515d('0x3d')]){_0x5ede49[_0x515d('0x3c')]=_['merge'](_0x5ede49[_0x515d('0x3c')],{'$or':_['map'](_0x530ef6,function(_0x530a19){if(_0x530a19[_0x515d('0x2e')]!=='VIRTUAL'){var _0x565230={};_0x565230[_0x530a19[_0x515d('0x31')]]={'$like':'%'+_0x4bf82c['query']['filter']+'%'};return _0x565230;}})});}_0x5ede49=_[_0x515d('0x3e')]({},_0x5ede49,_0x4bf82c[_0x515d('0x3f')]);var _0x3f5e8c={'where':_0x5ede49[_0x515d('0x3c')]};return db[_0x515d('0x40')][_0x515d('0x21')](_0x3f5e8c)['then'](function(_0x1446dd){_0x360217[_0x515d('0x21')]=_0x1446dd;if(_0x4bf82c[_0x515d('0x32')][_0x515d('0x41')]){_0x5ede49['include']=[{'all':!![]}];}return db[_0x515d('0x40')][_0x515d('0x42')](_0x5ede49);})[_0x515d('0x28')](function(_0x510ba4){_0x360217[_0x515d('0x43')]=_0x510ba4;return _0x360217;})[_0x515d('0x28')](respondWithFilteredResult(_0xf922b1,_0x5ede49))[_0x515d('0x44')](handleError(_0xf922b1,null));};exports[_0x515d('0x45')]=function(_0x282e61,_0x5d3936){var _0x508846={'raw':![],'where':{'id':_0x282e61[_0x515d('0x46')]['id']}},_0x58496f={};_0x58496f[_0x515d('0x30')]=_[_0x515d('0x47')](db[_0x515d('0x40')][_0x515d('0x2c')]);_0x58496f[_0x515d('0x32')]=_[_0x515d('0x47')](_0x282e61[_0x515d('0x32')]);_0x58496f['filters']=_[_0x515d('0x34')](_0x58496f[_0x515d('0x30')],_0x58496f[_0x515d('0x32')]);_0x508846[_0x515d('0x35')]=_[_0x515d('0x34')](_0x58496f['model'],qs[_0x515d('0x36')](_0x282e61['query'][_0x515d('0x36')]));_0x508846['attributes']=_0x508846[_0x515d('0x35')][_0x515d('0x37')]?_0x508846[_0x515d('0x35')]:_0x58496f[_0x515d('0x30')];if(_0x282e61[_0x515d('0x32')][_0x515d('0x41')]){_0x508846[_0x515d('0x48')]=[{'all':!![]}];}_0x508846=_[_0x515d('0x3e')]({},_0x508846,_0x282e61[_0x515d('0x3f')]);return db[_0x515d('0x40')][_0x515d('0x49')](_0x508846)[_0x515d('0x28')](handleEntityNotFound(_0x5d3936,null))[_0x515d('0x28')](respondWithResult(_0x5d3936,null))[_0x515d('0x44')](handleError(_0x5d3936,null));};exports[_0x515d('0x4a')]=function(_0x2a33f2,_0x515466){return db[_0x515d('0x40')]['create'](_0x2a33f2[_0x515d('0x4b')],{})[_0x515d('0x28')](respondWithResult(_0x515466,0xc9))[_0x515d('0x44')](handleError(_0x515466,null));};exports[_0x515d('0x27')]=function(_0x3d02e4,_0x3cfcd0){if(_0x3d02e4[_0x515d('0x4b')]['id']){delete _0x3d02e4[_0x515d('0x4b')]['id'];}return db[_0x515d('0x40')]['find']({'where':{'id':_0x3d02e4[_0x515d('0x46')]['id']}})[_0x515d('0x28')](handleEntityNotFound(_0x3cfcd0,null))[_0x515d('0x28')](saveUpdates(_0x3d02e4[_0x515d('0x4b')],null))[_0x515d('0x28')](respondWithResult(_0x3cfcd0,null))[_0x515d('0x44')](handleError(_0x3cfcd0,null));};exports[_0x515d('0x4c')]=function(_0x21646e,_0x372493){return db[_0x515d('0x40')][_0x515d('0x49')]({'where':{'id':_0x21646e[_0x515d('0x46')]['id']}})['then'](handleEntityNotFound(_0x372493,null))[_0x515d('0x28')](removeEntity(_0x372493,null))[_0x515d('0x44')](handleError(_0x372493,null));};exports[_0x515d('0x4d')]=function(_0x4bbedf,_0x1ecce5,_0x159918){var _0x38c537={};var _0x548498={};var _0x989eac;var _0x6428f2;return db[_0x515d('0x40')][_0x515d('0x4e')]({'where':{'id':_0x4bbedf[_0x515d('0x46')]['id']}})['then'](handleEntityNotFound(_0x1ecce5,null))[_0x515d('0x28')](function(_0x248904){if(_0x248904){_0x989eac=_0x248904;_0x548498[_0x515d('0x30')]=_['keys'](db[_0x515d('0x4f')][_0x515d('0x2c')]);_0x548498['query']=_[_0x515d('0x47')](_0x4bbedf['query']);_0x548498[_0x515d('0x33')]=_['intersection'](_0x548498[_0x515d('0x30')],_0x548498['query']);_0x38c537[_0x515d('0x35')]=_[_0x515d('0x34')](_0x548498[_0x515d('0x30')],qs[_0x515d('0x36')](_0x4bbedf[_0x515d('0x32')][_0x515d('0x36')]));_0x38c537[_0x515d('0x35')]=_0x38c537[_0x515d('0x35')][_0x515d('0x37')]?_0x38c537['attributes']:_0x548498[_0x515d('0x30')];_0x38c537['order']=qs[_0x515d('0x3b')](_0x4bbedf[_0x515d('0x32')][_0x515d('0x3b')]);_0x38c537[_0x515d('0x3c')]=qs['filters'](_[_0x515d('0x50')](_0x4bbedf[_0x515d('0x32')],_0x548498[_0x515d('0x33')]));if(_0x4bbedf[_0x515d('0x32')][_0x515d('0x3d')]){_0x38c537['where']=_[_0x515d('0x3e')](_0x38c537[_0x515d('0x3c')],{'$or':_[_0x515d('0x51')](_0x38c537[_0x515d('0x35')],function(_0x282b84){var _0x4bedcb={};_0x4bedcb[_0x282b84]={'$like':'%'+_0x4bbedf[_0x515d('0x32')][_0x515d('0x3d')]+'%'};return _0x4bedcb;})});}_0x38c537=_['merge']({},_0x38c537,_0x4bbedf[_0x515d('0x3f')]);return _0x989eac[_0x515d('0x4d')](_0x38c537);}})[_0x515d('0x28')](function(_0x4e3f0a){if(_0x4e3f0a){_0x6428f2=_0x4e3f0a[_0x515d('0x37')];if(!_0x4bbedf[_0x515d('0x32')][_0x515d('0x38')](_0x515d('0x39'))){_0x38c537['limit']=qs[_0x515d('0x20')](_0x4bbedf[_0x515d('0x32')][_0x515d('0x20')]);_0x38c537['offset']=qs[_0x515d('0x1e')](_0x4bbedf[_0x515d('0x32')][_0x515d('0x1e')]);}return _0x989eac[_0x515d('0x4d')](_0x38c537);}})[_0x515d('0x28')](function(_0x289bb8){if(_0x289bb8){return _0x289bb8?{'count':_0x6428f2,'rows':_0x289bb8}:null;}})[_0x515d('0x28')](respondWithResult(_0x1ecce5,null))['catch'](handleError(_0x1ecce5,null));};exports[_0x515d('0x52')]=function(_0x5805b3,_0x4b3279,_0xf424ca){if(_0x5805b3[_0x515d('0x4b')]['id']){delete _0x5805b3[_0x515d('0x4b')]['id'];}return db[_0x515d('0x40')]['findOne']({'where':{'id':_0x5805b3[_0x515d('0x46')]['id']}})[_0x515d('0x28')](handleEntityNotFound(_0x4b3279,null))[_0x515d('0x28')](function(_0x2fdd81){if(_0x2fdd81){_0x5805b3[_0x515d('0x4b')][_0x515d('0x53')]=_0x2fdd81['id'];_0x5805b3['body']['Subjects']=integrations[_0x515d('0x54')](_0x5805b3[_0x515d('0x4b')][_0x515d('0x55')],_0x5805b3[_0x515d('0x4b')][_0x515d('0x2e')]);_0x5805b3[_0x515d('0x4b')][_0x515d('0x56')]=integrations[_0x515d('0x57')](_0x5805b3[_0x515d('0x4b')]['channel'],_0x5805b3[_0x515d('0x4b')][_0x515d('0x2e')]);return db[_0x515d('0x4f')]['create'](_0x5805b3['body'],{'include':[{'model':db[_0x515d('0x58')],'as':_0x515d('0x59')},{'model':db[_0x515d('0x58')],'as':_0x515d('0x56')}]});}return null;})[_0x515d('0x28')](respondWithResult(_0x4b3279,null))[_0x515d('0x44')](handleError(_0x4b3279,null));};exports['getFields']=function(_0xf4eccc,_0x5c4a34,_0x4d8d82){var _0x353a86=['made_sla',_0x515d('0x5a'),_0x515d('0x5b'),_0x515d('0x5c'),_0x515d('0x5d'),_0x515d('0x5e'),_0x515d('0x5f'),'severity',_0x515d('0x60')];var _0x55e7cb=[_0x515d('0x61'),'made_sla',_0x515d('0x62'),'watch_list',_0x515d('0x63'),'sys_updated_on','child_incidents',_0x515d('0x5a'),'approval_history',_0x515d('0x64'),_0x515d('0x65'),_0x515d('0x66'),_0x515d('0x67'),_0x515d('0x68'),'sys_created_on',_0x515d('0x69'),_0x515d('0x6a'),_0x515d('0x6b'),'knowledge','order',_0x515d('0x6c'),_0x515d('0x6d'),'cmdb_ci',_0x515d('0x6e'),_0x515d('0x6f'),_0x515d('0x70'),_0x515d('0x71'),'business_service',_0x515d('0x72'),_0x515d('0x73'),'rfc','time_worked',_0x515d('0x74'),'opened_at','business_duration',_0x515d('0x75'),'work_end',_0x515d('0x76'),_0x515d('0x77'),'caller_id','approval_set',_0x515d('0x5c'),_0x515d('0x78'),_0x515d('0x79'),_0x515d('0x5d'),'correlation_display',_0x515d('0x7a'),_0x515d('0x7b'),_0x515d('0x7c'),_0x515d('0x7d'),_0x515d('0x7e'),_0x515d('0x7f'),_0x515d('0x80'),'notify',_0x515d('0x81'),_0x515d('0x82'),_0x515d('0x83'),_0x515d('0x84'),_0x515d('0x85'),_0x515d('0x86'),_0x515d('0x87'),_0x515d('0x88'),_0x515d('0x5f'),_0x515d('0x89'),_0x515d('0x8a'),_0x515d('0x8b'),_0x515d('0x8c'),_0x515d('0x8d'),_0x515d('0x8e'),_0x515d('0x8f'),_0x515d('0x90'),_0x515d('0x91'),_0x515d('0x92'),'comments_and_work_notes',_0x515d('0x93'),_0x515d('0x94'),'reopen_count',_0x515d('0x95'),_0x515d('0x96'),'upon_approval',_0x515d('0x97'),_0x515d('0x98'),_0x515d('0x60')];var _0x56dec4='';var _0x5030e5='';var _0x4f3193=[];var _0x5a1165='';var _0x15d1b6='';var _0x516ac7=[];var _0x112723='';var _0x4c4942='';var _0x4c1494={};var _0x21270d='';return db[_0x515d('0x40')][_0x515d('0x4e')]({'where':{'id':_0xf4eccc['params']['id']},'attributes':['id',_0x515d('0x99'),_0x515d('0x9a'),'email','remoteUri',_0x515d('0x9b')]})[_0x515d('0x28')](handleEntityNotFound(_0x5c4a34,null))[_0x515d('0x28')](function(_0x14c51a){if(_0x14c51a){_0x21270d=_0x14c51a[_0x515d('0x9c')];var _0x22fed3=_0x21270d[_0x515d('0x9d')](-0x1);if(_0x22fed3==='/'){_0x21270d=_0x21270d[_0x515d('0x9e')](0x0,_0x21270d[_0x515d('0x9f')](_0x22fed3));}_0x4c4942=util[_0x515d('0xa0')](_0x515d('0xa1'),_0x21270d);_0x112723=util[_0x515d('0xa0')]('%s/api/now/table/',_0x21270d);_0x4c1494={'user':_0x14c51a[_0x515d('0x99')],'pass':_0x14c51a['password']};var _0x3cddc4={'method':_0x515d('0xa2'),'uri':_0x4c4942+_0x515d('0xa3'),'auth':_0x4c1494,'json':!![]};return rp(_0x3cddc4);}})[_0x515d('0x28')](function(_0x43bf76){if(_0x43bf76[_0x515d('0xa4')][_0x515d('0x37')]>0x0){_0x56dec4=_0x43bf76['result'];}console[_0x515d('0xa5')](_0x515d('0xa6'),_0x56dec4);_0x516ac7=[];_0x5030e5=Object[_0x515d('0xa7')]([],_0x56dec4);_[_0x515d('0xa8')](_0x5030e5,function(_0x2688b5){return!_0x353a86[_0x515d('0xa9')](_0x2688b5['name']);});_0x5030e5[_0x515d('0xaa')](function(_0x208dfc){var _0xf8c56=createFieldObject(_0x112723,_0x4c1494,_0x208dfc[_0x515d('0xab')],_0x208dfc[_0x515d('0x31')],_0x208dfc[_0x515d('0xac')],![]);_0x516ac7[_0x515d('0xad')](_0xf8c56);});return Promise[_0x515d('0xae')](_0x516ac7);})['then'](function(_0x44bae8){_0x4f3193=_0x44bae8;_0x5a1165=Object[_0x515d('0xa7')]([],_0x56dec4);console[_0x515d('0xa5')](_0x515d('0xaf'),_0x56dec4);_[_0x515d('0xa8')](_0x5a1165,function(_0x8d8f6c){return _0x55e7cb[_0x515d('0xa9')](_0x8d8f6c[_0x515d('0x31')]);});console[_0x515d('0xa5')](_0x515d('0xb0'),_0x5a1165);_0x516ac7=[];_0x5a1165[_0x515d('0xaa')](function(_0xcfc01d){var _0x36a24d=createFieldObject(_0x112723,_0x4c1494,_0xcfc01d[_0x515d('0xab')],_0xcfc01d['name'],_0xcfc01d[_0x515d('0xac')],!![]);_0x516ac7['push'](_0x36a24d);});return Promise[_0x515d('0xae')](_0x516ac7);})[_0x515d('0x28')](function(_0x2d142f){_0x15d1b6=_0x2d142f;var _0x3e2e7e=_0x4f3193[_0x515d('0xb1')](_0x15d1b6);return{'count':_0x3e2e7e['length'],'rows':_0x3e2e7e};})[_0x515d('0x28')](respondWithResult(_0x5c4a34,null))[_0x515d('0x44')](function(_0x308154){console[_0x515d('0xa5')]('ServiceNow\x20error:\x20'+_0x308154);var _0x3a32fd=_0xf4eccc[_0x515d('0x32')][_0x515d('0xb2')]?0x1f4:_0x308154[_0x515d('0xb3')]||0x1f4;logger[_0x515d('0x29')](_0x308154[_0x515d('0x2a')]);delete _0x308154['name'];if(_0x3a32fd===0x191){_0x3a32fd=0x190;}_0x5c4a34['status'](_0x3a32fd)[_0x515d('0xb4')](_0xf4eccc[_0x515d('0x32')][_0x515d('0xb2')]?{'message':_0x515d('0xb5'),'statusCode':_0x308154[_0x515d('0xb3')]}:_0x308154);});};function createFieldObject(_0x407fa0,_0xc5de2d,_0x1f4801,_0x2d1b0f,_0x3e0b0b,_0x46eb9b){return new Promise(function(_0x3fc228,_0x86db5e){var _0x5ce44a={'id':_0x2d1b0f,'name':_0x3e0b0b,'custom':_0x46eb9b};if(_0x1f4801===_0x515d('0xb6')){_0x5ce44a[_0x515d('0x3f')]=[{'name':_0x515d('0xb7'),'value':'true'},{'name':'False','value':_0x515d('0xb8')}];_0x3fc228(_0x5ce44a);}else{var _0x46a7c5={'method':_0x515d('0xa2'),'uri':_0x407fa0+_0x515d('0xb9')+_0x2d1b0f,'auth':_0xc5de2d,'json':!![]};return rp(_0x46a7c5)[_0x515d('0x28')](function(_0x4c4d63){var _0x26f3a1=[];if(_0x4c4d63[_0x515d('0xa4')][_0x515d('0x37')]>0x0){_0x4c4d63['result'][_0x515d('0xaa')](function(_0x29937b){if(_0x29937b[_0x515d('0xba')]===_0x515d('0xb8')){var _0x22a439={'name':_0x29937b[_0x515d('0xac')],'value':_0x29937b[_0x515d('0xbb')]};_0x26f3a1[_0x515d('0xad')](_0x22a439);}});}_0x5ce44a['options']=_0x26f3a1;if(_0x5ce44a[_0x515d('0x3f')]['length']>0x0){_0x3fc228(_0x5ce44a);}else{if(_0x46eb9b==![]){_0x3fc228();}else{_0x3fc228(_0x5ce44a);}}});}});} \ No newline at end of file +var _0xc52a=['assigned_to','sla_due','approval','comments_and_work_notes','due_date','sys_mod_count','sys_tags','escalation','upon_approval','location','username','password','email','remoteUri','serverUrl','slice','substring','lastIndexOf','format','%s/api/now/doc/table/schema/','%s/api/now/table/','GET','incident?sysparm_display_value=all','result','incident\x20table\x20objects','assign','includes','forEach','internalType','label','push','all','log','remove','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','concat','ServiceNow\x20error:\x20','send','Wrong\x20credentials','statusCode','True','False','sys_choice?sysparm_query=name=incident^element=','inactive','false','value','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','sox','to-csv','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','end','status','limit','undefined','count','set','Content-Range','json','apply','save','update','then','error','stack','index','ServicenowAccount','rawAttributes','fieldName','type','key','model','map','name','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','offset','sort','filters','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','find','create','body','params','destroy','getConfigurations','ServicenowConfiguration','order','addConfiguration','findOne','AccountId','Subjects','getSubjects','channel','getDescriptions','ServicenowField','Descriptions','getFields','made_sla','knowledge','notify','incident_state','severity','category','caused_by','watch_list','upon_reject','sys_updated_on','child_incidents','hold_reason','approval_history','number','sys_updated_by','opened_by','sys_created_on','sys_domain','state','closed_at','active','work_notes_list','sys_domain_path','rfc','opened_at','business_duration','work_end','reopened_time','resolved_at','caller_id','approval_set','subcategory','work_notes','short_description','close_code','correlation_display','delivery_task','work_start','description','calendar_duration','sys_class_name','close_notes','closed_by','follow_up','parent_incident','sys_id','contact_type','reopened_by','urgency','problem_id','reassignment_count'];(function(_0x18a79d,_0x57bd2c){var _0x4f8848=function(_0x28af80){while(--_0x28af80){_0x18a79d['push'](_0x18a79d['shift']());}};_0x4f8848(++_0x57bd2c);}(_0xc52a,0xe6));var _0xac52=function(_0x3c600d,_0x4b5c85){_0x3c600d=_0x3c600d-0x0;var _0xd195e3=_0xc52a[_0x3c600d];return _0xd195e3;};'use strict';var emlformat=require(_0xac52('0x0'));var rimraf=require(_0xac52('0x1'));var zipdir=require(_0xac52('0x2'));var jsonpatch=require(_0xac52('0x3'));var rp=require(_0xac52('0x4'));var moment=require('moment');var BPromise=require(_0xac52('0x5'));var Mustache=require(_0xac52('0x6'));var util=require('util');var path=require('path');var sox=require(_0xac52('0x7'));var csv=require(_0xac52('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xac52('0x9'));var _=require(_0xac52('0xa'));var squel=require(_0xac52('0xb'));var crypto=require(_0xac52('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xac52('0x8'));var querystring=require(_0xac52('0xd'));var Papa=require(_0xac52('0xe'));var Redis=require(_0xac52('0xf'));var authService=require(_0xac52('0x10'));var qs=require(_0xac52('0x11'));var as=require(_0xac52('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xac52('0x13'))(_0xac52('0x14'));var utils=require('../../config/utils');var config=require(_0xac52('0x15'));var licenseUtil=require(_0xac52('0x16'));var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x71bfc,_0x151a29){_0x151a29=_0x151a29||0xcc;return function(_0x44f4fd){if(_0x44f4fd){return _0x71bfc[_0xac52('0x17')](_0x151a29);}return _0x71bfc['status'](_0x151a29)[_0xac52('0x18')]();};}function respondWithResult(_0x519d6e,_0x3c8085){_0x3c8085=_0x3c8085||0xc8;return function(_0x400a32){if(_0x400a32){return _0x519d6e[_0xac52('0x19')](_0x3c8085)['json'](_0x400a32);}};}function respondWithFilteredResult(_0x410500,_0x2a18af){return function(_0x2238e3){if(_0x2238e3){var _0x289be8=typeof _0x2a18af['offset']==='undefined'&&typeof _0x2a18af[_0xac52('0x1a')]===_0xac52('0x1b');var _0x384039=_0x2238e3['count'];var _0x48797f=_0x289be8?0x0:_0x2a18af['offset'];var _0x56d165=_0x289be8?_0x2238e3[_0xac52('0x1c')]:_0x2a18af['offset']+_0x2a18af[_0xac52('0x1a')];var _0x3c901f;if(_0x56d165>=_0x384039){_0x56d165=_0x384039;_0x3c901f=0xc8;}else{_0x3c901f=0xce;}_0x410500[_0xac52('0x19')](_0x3c901f);return _0x410500[_0xac52('0x1d')](_0xac52('0x1e'),_0x48797f+'-'+_0x56d165+'/'+_0x384039)[_0xac52('0x1f')](_0x2238e3);}return null;};}function patchUpdates(_0x2807e1){return function(_0x17ac54){try{jsonpatch[_0xac52('0x20')](_0x17ac54,_0x2807e1,!![]);}catch(_0x199cf5){return BPromise['reject'](_0x199cf5);}return _0x17ac54[_0xac52('0x21')]();};}function saveUpdates(_0x57c1f0,_0x2c9e55){return function(_0x518c1d){if(_0x518c1d){return _0x518c1d[_0xac52('0x22')](_0x57c1f0)['then'](function(_0x2a5373){return _0x2a5373;});}return null;};}function removeEntity(_0x184a3c,_0x198f4c){return function(_0x73f9a5){if(_0x73f9a5){return _0x73f9a5['destroy']()[_0xac52('0x23')](function(){_0x184a3c[_0xac52('0x19')](0xcc)[_0xac52('0x18')]();});}};}function handleEntityNotFound(_0x1fb46b,_0x586d3f){return function(_0xbceccf){if(!_0xbceccf){_0x1fb46b[_0xac52('0x17')](0x194);}return _0xbceccf;};}function handleError(_0x1ff40a,_0x1c6387){_0x1c6387=_0x1c6387||0x1f4;return function(_0x4fc7b3){logger[_0xac52('0x24')](_0x4fc7b3[_0xac52('0x25')]);if(_0x4fc7b3['name']){delete _0x4fc7b3['name'];}_0x1ff40a[_0xac52('0x19')](_0x1c6387)['send'](_0x4fc7b3);};}exports[_0xac52('0x26')]=function(_0x319940,_0x245942){var _0x55f480={},_0xed057b={},_0xce4762={'count':0x0,'rows':[]};var _0x2d48aa=_['map'](db[_0xac52('0x27')][_0xac52('0x28')],function(_0x40073d){return{'name':_0x40073d[_0xac52('0x29')],'type':_0x40073d[_0xac52('0x2a')][_0xac52('0x2b')]};});_0xed057b[_0xac52('0x2c')]=_[_0xac52('0x2d')](_0x2d48aa,_0xac52('0x2e'));_0xed057b[_0xac52('0x2f')]=_[_0xac52('0x30')](_0x319940[_0xac52('0x2f')]);_0xed057b['filters']=_[_0xac52('0x31')](_0xed057b[_0xac52('0x2c')],_0xed057b[_0xac52('0x2f')]);_0x55f480['attributes']=_[_0xac52('0x31')](_0xed057b[_0xac52('0x2c')],qs[_0xac52('0x32')](_0x319940[_0xac52('0x2f')]['fields']));_0x55f480['attributes']=_0x55f480[_0xac52('0x33')][_0xac52('0x34')]?_0x55f480[_0xac52('0x33')]:_0xed057b[_0xac52('0x2c')];if(!_0x319940[_0xac52('0x2f')][_0xac52('0x35')](_0xac52('0x36'))){_0x55f480[_0xac52('0x1a')]=qs[_0xac52('0x1a')](_0x319940[_0xac52('0x2f')]['limit']);_0x55f480[_0xac52('0x37')]=qs[_0xac52('0x37')](_0x319940[_0xac52('0x2f')][_0xac52('0x37')]);}_0x55f480['order']=qs['sort'](_0x319940[_0xac52('0x2f')][_0xac52('0x38')]);_0x55f480['where']=qs[_0xac52('0x39')](_[_0xac52('0x3a')](_0x319940[_0xac52('0x2f')],_0xed057b['filters']),_0x2d48aa);if(_0x319940[_0xac52('0x2f')][_0xac52('0x3b')]){_0x55f480[_0xac52('0x3c')]=_[_0xac52('0x3d')](_0x55f480[_0xac52('0x3c')],{'$or':_['map'](_0x2d48aa,function(_0x262413){if(_0x262413['type']!==_0xac52('0x3e')){var _0x1590ea={};_0x1590ea[_0x262413['name']]={'$like':'%'+_0x319940[_0xac52('0x2f')]['filter']+'%'};return _0x1590ea;}})});}_0x55f480=_['merge']({},_0x55f480,_0x319940[_0xac52('0x3f')]);var _0x585910={'where':_0x55f480[_0xac52('0x3c')]};return db['ServicenowAccount'][_0xac52('0x1c')](_0x585910)['then'](function(_0x310579){_0xce4762['count']=_0x310579;if(_0x319940[_0xac52('0x2f')][_0xac52('0x40')]){_0x55f480[_0xac52('0x41')]=[{'all':!![]}];}return db[_0xac52('0x27')][_0xac52('0x42')](_0x55f480);})[_0xac52('0x23')](function(_0x345227){_0xce4762['rows']=_0x345227;return _0xce4762;})[_0xac52('0x23')](respondWithFilteredResult(_0x245942,_0x55f480))[_0xac52('0x43')](handleError(_0x245942,null));};exports[_0xac52('0x44')]=function(_0x43501e,_0x8e4fac){var _0x21d8e5={'raw':![],'where':{'id':_0x43501e['params']['id']}},_0x5213b3={};_0x5213b3[_0xac52('0x2c')]=_[_0xac52('0x30')](db[_0xac52('0x27')][_0xac52('0x28')]);_0x5213b3[_0xac52('0x2f')]=_[_0xac52('0x30')](_0x43501e[_0xac52('0x2f')]);_0x5213b3['filters']=_[_0xac52('0x31')](_0x5213b3[_0xac52('0x2c')],_0x5213b3[_0xac52('0x2f')]);_0x21d8e5[_0xac52('0x33')]=_[_0xac52('0x31')](_0x5213b3[_0xac52('0x2c')],qs['fields'](_0x43501e[_0xac52('0x2f')]['fields']));_0x21d8e5[_0xac52('0x33')]=_0x21d8e5[_0xac52('0x33')][_0xac52('0x34')]?_0x21d8e5[_0xac52('0x33')]:_0x5213b3[_0xac52('0x2c')];if(_0x43501e[_0xac52('0x2f')][_0xac52('0x40')]){_0x21d8e5[_0xac52('0x41')]=[{'all':!![]}];}_0x21d8e5=_[_0xac52('0x3d')]({},_0x21d8e5,_0x43501e[_0xac52('0x3f')]);return db[_0xac52('0x27')][_0xac52('0x45')](_0x21d8e5)['then'](handleEntityNotFound(_0x8e4fac,null))[_0xac52('0x23')](respondWithResult(_0x8e4fac,null))[_0xac52('0x43')](handleError(_0x8e4fac,null));};exports[_0xac52('0x46')]=function(_0x15999e,_0x354381){return db[_0xac52('0x27')][_0xac52('0x46')](_0x15999e['body'],{})[_0xac52('0x23')](respondWithResult(_0x354381,0xc9))[_0xac52('0x43')](handleError(_0x354381,null));};exports['update']=function(_0x34229b,_0x5278fd){if(_0x34229b['body']['id']){delete _0x34229b[_0xac52('0x47')]['id'];}return db[_0xac52('0x27')][_0xac52('0x45')]({'where':{'id':_0x34229b[_0xac52('0x48')]['id']}})['then'](handleEntityNotFound(_0x5278fd,null))[_0xac52('0x23')](saveUpdates(_0x34229b['body'],null))[_0xac52('0x23')](respondWithResult(_0x5278fd,null))[_0xac52('0x43')](handleError(_0x5278fd,null));};exports[_0xac52('0x49')]=function(_0x22fcfd,_0x37bfa6){return db[_0xac52('0x27')][_0xac52('0x45')]({'where':{'id':_0x22fcfd['params']['id']}})[_0xac52('0x23')](handleEntityNotFound(_0x37bfa6,null))['then'](removeEntity(_0x37bfa6,null))[_0xac52('0x43')](handleError(_0x37bfa6,null));};exports[_0xac52('0x4a')]=function(_0x5825f9,_0x281778,_0x226973){var _0x9c2845={};var _0x161fe4={};var _0x4fe047;var _0x4b47bb;return db[_0xac52('0x27')]['findOne']({'where':{'id':_0x5825f9['params']['id']}})[_0xac52('0x23')](handleEntityNotFound(_0x281778,null))[_0xac52('0x23')](function(_0x2b0840){if(_0x2b0840){_0x4fe047=_0x2b0840;_0x161fe4[_0xac52('0x2c')]=_[_0xac52('0x30')](db[_0xac52('0x4b')][_0xac52('0x28')]);_0x161fe4[_0xac52('0x2f')]=_[_0xac52('0x30')](_0x5825f9['query']);_0x161fe4['filters']=_[_0xac52('0x31')](_0x161fe4[_0xac52('0x2c')],_0x161fe4[_0xac52('0x2f')]);_0x9c2845[_0xac52('0x33')]=_[_0xac52('0x31')](_0x161fe4[_0xac52('0x2c')],qs[_0xac52('0x32')](_0x5825f9[_0xac52('0x2f')][_0xac52('0x32')]));_0x9c2845[_0xac52('0x33')]=_0x9c2845[_0xac52('0x33')][_0xac52('0x34')]?_0x9c2845['attributes']:_0x161fe4[_0xac52('0x2c')];_0x9c2845[_0xac52('0x4c')]=qs['sort'](_0x5825f9['query'][_0xac52('0x38')]);_0x9c2845[_0xac52('0x3c')]=qs[_0xac52('0x39')](_[_0xac52('0x3a')](_0x5825f9[_0xac52('0x2f')],_0x161fe4[_0xac52('0x39')]));if(_0x5825f9[_0xac52('0x2f')][_0xac52('0x3b')]){_0x9c2845[_0xac52('0x3c')]=_[_0xac52('0x3d')](_0x9c2845[_0xac52('0x3c')],{'$or':_[_0xac52('0x2d')](_0x9c2845[_0xac52('0x33')],function(_0x260bd6){var _0x5db68f={};_0x5db68f[_0x260bd6]={'$like':'%'+_0x5825f9[_0xac52('0x2f')]['filter']+'%'};return _0x5db68f;})});}_0x9c2845=_[_0xac52('0x3d')]({},_0x9c2845,_0x5825f9[_0xac52('0x3f')]);return _0x4fe047[_0xac52('0x4a')](_0x9c2845);}})[_0xac52('0x23')](function(_0x432627){if(_0x432627){_0x4b47bb=_0x432627[_0xac52('0x34')];if(!_0x5825f9['query'][_0xac52('0x35')](_0xac52('0x36'))){_0x9c2845['limit']=qs[_0xac52('0x1a')](_0x5825f9[_0xac52('0x2f')][_0xac52('0x1a')]);_0x9c2845[_0xac52('0x37')]=qs[_0xac52('0x37')](_0x5825f9['query'][_0xac52('0x37')]);}return _0x4fe047[_0xac52('0x4a')](_0x9c2845);}})[_0xac52('0x23')](function(_0x1b9c50){if(_0x1b9c50){return _0x1b9c50?{'count':_0x4b47bb,'rows':_0x1b9c50}:null;}})[_0xac52('0x23')](respondWithResult(_0x281778,null))[_0xac52('0x43')](handleError(_0x281778,null));};exports[_0xac52('0x4d')]=function(_0x17b6cd,_0x39b21a,_0x129a71){if(_0x17b6cd[_0xac52('0x47')]['id']){delete _0x17b6cd['body']['id'];}return db['ServicenowAccount'][_0xac52('0x4e')]({'where':{'id':_0x17b6cd[_0xac52('0x48')]['id']}})['then'](handleEntityNotFound(_0x39b21a,null))[_0xac52('0x23')](function(_0xc5eb91){if(_0xc5eb91){_0x17b6cd[_0xac52('0x47')][_0xac52('0x4f')]=_0xc5eb91['id'];_0x17b6cd['body'][_0xac52('0x50')]=integrations[_0xac52('0x51')](_0x17b6cd[_0xac52('0x47')][_0xac52('0x52')],_0x17b6cd['body'][_0xac52('0x2a')]);_0x17b6cd['body']['Descriptions']=integrations[_0xac52('0x53')](_0x17b6cd[_0xac52('0x47')]['channel'],_0x17b6cd['body'][_0xac52('0x2a')]);return db['ServicenowConfiguration'][_0xac52('0x46')](_0x17b6cd[_0xac52('0x47')],{'include':[{'model':db[_0xac52('0x54')],'as':'Subjects'},{'model':db[_0xac52('0x54')],'as':_0xac52('0x55')}]});}return null;})['then'](respondWithResult(_0x39b21a,null))[_0xac52('0x43')](handleError(_0x39b21a,null));};exports[_0xac52('0x56')]=function(_0x52530c,_0x2d6565,_0x3ca376){var _0x4820c1=[_0xac52('0x57'),'hold_reason',_0xac52('0x58'),'subcategory','close_code',_0xac52('0x59'),_0xac52('0x5a'),_0xac52('0x5b'),_0xac52('0x5c')];var _0x43c4ff=['parent','made_sla',_0xac52('0x5d'),_0xac52('0x5e'),_0xac52('0x5f'),_0xac52('0x60'),_0xac52('0x61'),_0xac52('0x62'),_0xac52('0x63'),_0xac52('0x64'),'resolved_by',_0xac52('0x65'),_0xac52('0x66'),'user_input',_0xac52('0x67'),_0xac52('0x68'),_0xac52('0x69'),'sys_created_by','knowledge',_0xac52('0x4c'),'calendar_stc',_0xac52('0x6a'),'cmdb_ci','delivery_plan','impact',_0xac52('0x6b'),_0xac52('0x6c'),'business_service','priority',_0xac52('0x6d'),_0xac52('0x6e'),'time_worked','expected_start',_0xac52('0x6f'),_0xac52('0x70'),'group_list',_0xac52('0x71'),_0xac52('0x72'),_0xac52('0x73'),_0xac52('0x74'),_0xac52('0x75'),_0xac52('0x76'),_0xac52('0x77'),_0xac52('0x78'),_0xac52('0x79'),_0xac52('0x7a'),_0xac52('0x7b'),_0xac52('0x7c'),'assignment_group','business_stc','additional_assignee_list',_0xac52('0x7d'),_0xac52('0x7e'),_0xac52('0x59'),_0xac52('0x7f'),_0xac52('0x80'),_0xac52('0x81'),_0xac52('0x82'),_0xac52('0x83'),_0xac52('0x84'),_0xac52('0x85'),_0xac52('0x86'),_0xac52('0x5a'),_0xac52('0x87'),_0xac52('0x88'),'company',_0xac52('0x89'),'activity_due',_0xac52('0x8a'),_0xac52('0x5b'),'comments',_0xac52('0x8b'),_0xac52('0x8c'),_0xac52('0x8d'),_0xac52('0x8e'),_0xac52('0x8f'),'reopen_count',_0xac52('0x90'),_0xac52('0x91'),_0xac52('0x92'),'correlation_id',_0xac52('0x93'),'category'];var _0x377ed7='';var _0xc3a776='';var _0x84fb5a=[];var _0x17ee65='';var _0x120d87='';var _0x1d5520=[];var _0x3cdb9f='';var _0x3b1ce3='';var _0x4cdc36={};var _0x35838c='';return db[_0xac52('0x27')][_0xac52('0x4e')]({'where':{'id':_0x52530c[_0xac52('0x48')]['id']},'attributes':['id',_0xac52('0x94'),_0xac52('0x95'),_0xac52('0x96'),_0xac52('0x97'),_0xac52('0x98')]})[_0xac52('0x23')](handleEntityNotFound(_0x2d6565,null))['then'](function(_0x2fc0a9){if(_0x2fc0a9){_0x35838c=_0x2fc0a9[_0xac52('0x97')];var _0x4b654c=_0x35838c[_0xac52('0x99')](-0x1);if(_0x4b654c==='/'){_0x35838c=_0x35838c[_0xac52('0x9a')](0x0,_0x35838c[_0xac52('0x9b')](_0x4b654c));}_0x3b1ce3=util[_0xac52('0x9c')](_0xac52('0x9d'),_0x35838c);_0x3cdb9f=util['format'](_0xac52('0x9e'),_0x35838c);_0x4cdc36={'user':_0x2fc0a9[_0xac52('0x94')],'pass':_0x2fc0a9[_0xac52('0x95')]};var _0x46ca62={'method':_0xac52('0x9f'),'uri':_0x3b1ce3+_0xac52('0xa0'),'auth':_0x4cdc36,'json':!![]};return rp(_0x46ca62);}})[_0xac52('0x23')](function(_0x1070f8){if(_0x1070f8[_0xac52('0xa1')][_0xac52('0x34')]>0x0){_0x377ed7=_0x1070f8[_0xac52('0xa1')];}console['log'](_0xac52('0xa2'),_0x377ed7);_0x1d5520=[];_0xc3a776=Object[_0xac52('0xa3')]([],_0x377ed7);_['remove'](_0xc3a776,function(_0x30185c){return!_0x4820c1[_0xac52('0xa4')](_0x30185c[_0xac52('0x2e')]);});_0xc3a776[_0xac52('0xa5')](function(_0x88530a){var _0x86c336=createFieldObject(_0x3cdb9f,_0x4cdc36,_0x88530a[_0xac52('0xa6')],_0x88530a[_0xac52('0x2e')],_0x88530a[_0xac52('0xa7')],![]);_0x1d5520[_0xac52('0xa8')](_0x86c336);});return Promise[_0xac52('0xa9')](_0x1d5520);})[_0xac52('0x23')](function(_0x20b120){_0x84fb5a=_0x20b120;_0x17ee65=Object[_0xac52('0xa3')]([],_0x377ed7);console[_0xac52('0xaa')]('TCL:\x20_object',_0x377ed7);_[_0xac52('0xab')](_0x17ee65,function(_0x49c2db){return _0x43c4ff[_0xac52('0xa4')](_0x49c2db['name']);});console[_0xac52('0xaa')](_0xac52('0xac'),_0x17ee65);_0x1d5520=[];_0x17ee65[_0xac52('0xa5')](function(_0x5928d4){var _0x11d269=createFieldObject(_0x3cdb9f,_0x4cdc36,_0x5928d4['internalType'],_0x5928d4['name'],_0x5928d4['label'],!![]);_0x1d5520[_0xac52('0xa8')](_0x11d269);});return Promise[_0xac52('0xa9')](_0x1d5520);})[_0xac52('0x23')](function(_0x926bcc){_0x120d87=_0x926bcc;var _0xace955=_0x84fb5a[_0xac52('0xad')](_0x120d87);return{'count':_0xace955[_0xac52('0x34')],'rows':_0xace955};})['then'](respondWithResult(_0x2d6565,null))[_0xac52('0x43')](function(_0x56657d){console[_0xac52('0xaa')](_0xac52('0xae')+_0x56657d);var _0x5947f2=_0x52530c['query']['test']?0x1f4:_0x56657d['statusCode']||0x1f4;logger['error'](_0x56657d[_0xac52('0x25')]);delete _0x56657d[_0xac52('0x2e')];if(_0x5947f2===0x191){_0x5947f2=0x190;}_0x2d6565['status'](_0x5947f2)[_0xac52('0xaf')](_0x52530c[_0xac52('0x2f')]['test']?{'message':_0xac52('0xb0'),'statusCode':_0x56657d[_0xac52('0xb1')]}:_0x56657d);});};function createFieldObject(_0x79ea3b,_0x43b804,_0x5a54e7,_0x49edb0,_0x13df73,_0x181b36){return new Promise(function(_0x33b7c6,_0x247c1c){var _0x262f9c={'id':_0x49edb0,'name':_0x13df73,'custom':_0x181b36};if(_0x5a54e7==='boolean'){_0x262f9c[_0xac52('0x3f')]=[{'name':_0xac52('0xb2'),'value':'true'},{'name':_0xac52('0xb3'),'value':'false'}];_0x33b7c6(_0x262f9c);}else{var _0x167873={'method':_0xac52('0x9f'),'uri':_0x79ea3b+_0xac52('0xb4')+_0x49edb0,'auth':_0x43b804,'json':!![]};return rp(_0x167873)[_0xac52('0x23')](function(_0x246f66){var _0x5f3067=[];if(_0x246f66[_0xac52('0xa1')][_0xac52('0x34')]>0x0){_0x246f66[_0xac52('0xa1')][_0xac52('0xa5')](function(_0xca317c){if(_0xca317c[_0xac52('0xb5')]===_0xac52('0xb6')){var _0x496947={'name':_0xca317c['label'],'value':_0xca317c[_0xac52('0xb7')]};_0x5f3067['push'](_0x496947);}});}_0x262f9c['options']=_0x5f3067;if(_0x262f9c[_0xac52('0x3f')][_0xac52('0x34')]>0x0){_0x33b7c6(_0x262f9c);}else{if(_0x181b36==![]){_0x33b7c6();}else{_0x33b7c6(_0x262f9c);}}});}});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.model.js b/server/api/intServicenowAccount/intServicenowAccount.model.js index 7f4756d..2c302c5 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 _0x4819=['request-promise','path','rimraf','../../config/environment','./intServicenowAccount.attributes','exports','define','ServicenowAccount','int_servicenow_accounts','util','../../config/logger','api','moment','bluebird'];(function(_0x1218fb,_0x1aaa69){var _0x4cf02f=function(_0x177e33){while(--_0x177e33){_0x1218fb['push'](_0x1218fb['shift']());}};_0x4cf02f(++_0x1aaa69);}(_0x4819,0xcd));var _0x9481=function(_0x16803c,_0x21deb4){_0x16803c=_0x16803c-0x0;var _0x4a272c=_0x4819[_0x16803c];return _0x4a272c;};'use strict';var _=require('lodash');var util=require(_0x9481('0x0'));var logger=require(_0x9481('0x1'))(_0x9481('0x2'));var moment=require(_0x9481('0x3'));var BPromise=require(_0x9481('0x4'));var rp=require(_0x9481('0x5'));var fs=require('fs');var path=require(_0x9481('0x6'));var rimraf=require(_0x9481('0x7'));var config=require(_0x9481('0x8'));var attributes=require(_0x9481('0x9'));var integrations=require('../../components/integrations/configuration');module[_0x9481('0xa')]=function(_0x5def07,_0x54cc78){return _0x5def07[_0x9481('0xb')](_0x9481('0xc'),attributes,{'tableName':_0x9481('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9c5a=['int_servicenow_accounts','lodash','util','api','moment','bluebird','request-promise','rimraf','../../config/environment','../../components/integrations/configuration'];(function(_0x3d8d51,_0xc7a11f){var _0x393b53=function(_0x2b2388){while(--_0x2b2388){_0x3d8d51['push'](_0x3d8d51['shift']());}};_0x393b53(++_0xc7a11f);}(_0x9c5a,0x1c3));var _0xa9c5=function(_0x17277a,_0x283bc9){_0x17277a=_0x17277a-0x0;var _0x4ec599=_0x9c5a[_0x17277a];return _0x4ec599;};'use strict';var _=require(_0xa9c5('0x0'));var util=require(_0xa9c5('0x1'));var logger=require('../../config/logger')(_0xa9c5('0x2'));var moment=require(_0xa9c5('0x3'));var BPromise=require(_0xa9c5('0x4'));var rp=require(_0xa9c5('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa9c5('0x6'));var config=require(_0xa9c5('0x7'));var attributes=require('./intServicenowAccount.attributes');var integrations=require(_0xa9c5('0x8'));module['exports']=function(_0x394d84,_0x3df556){return _0x394d84['define']('ServicenowAccount',attributes,{'tableName':_0xa9c5('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.rpc.js b/server/api/intServicenowAccount/intServicenowAccount.rpc.js index c88d0e6..8757293 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 _0x2f55=['GetServicenowAccount','findAll','options','where','attributes','limit','include','map','model','then','ServicenowAccount','find','raw','ShowServicenowAccount','lodash','util','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','info','request\x20sent','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','ServicenowAccount,\x20%s,\x20%s','message','result','catch'];(function(_0x3b90ab,_0x174a22){var _0x206e92=function(_0x21fbd3){while(--_0x21fbd3){_0x3b90ab['push'](_0x3b90ab['shift']());}};_0x206e92(++_0x174a22);}(_0x2f55,0x1b2));var _0x52f5=function(_0x45a545,_0x122dbc){_0x45a545=_0x45a545-0x0;var _0x4b891e=_0x2f55[_0x45a545];return _0x4b891e;};'use strict';var _=require(_0x52f5('0x0'));var util=require(_0x52f5('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x52f5('0x2'));var db=require(_0x52f5('0x3'))['db'];var utils=require(_0x52f5('0x4'));var logger=require(_0x52f5('0x5'))(_0x52f5('0x6'));var config=require(_0x52f5('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x52f5('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x560db7,_0x255fa3,_0x23c597){return new BPromise(function(_0x444b4e,_0xb3073a){return client[_0x52f5('0x9')](_0x560db7,_0x23c597)['then'](function(_0x2eb498){logger[_0x52f5('0xa')]('ServicenowAccount,\x20%s,\x20%s',_0x255fa3,_0x52f5('0xb'));logger[_0x52f5('0xc')](_0x52f5('0xd'),_0x255fa3,'request\x20sent',JSON[_0x52f5('0xe')](_0x2eb498));if(_0x2eb498[_0x52f5('0xf')]){if(_0x2eb498[_0x52f5('0xf')][_0x52f5('0x10')]===0x1f4){logger[_0x52f5('0xf')](_0x52f5('0x11'),_0x255fa3,_0x2eb498[_0x52f5('0xf')][_0x52f5('0x12')]);return _0xb3073a(_0x2eb498['error'][_0x52f5('0x12')]);}logger['error'](_0x52f5('0x11'),_0x255fa3,_0x2eb498[_0x52f5('0xf')][_0x52f5('0x12')]);return _0x444b4e(_0x2eb498['error'][_0x52f5('0x12')]);}else{logger[_0x52f5('0xa')](_0x52f5('0x11'),_0x255fa3,_0x52f5('0xb'));_0x444b4e(_0x2eb498[_0x52f5('0x13')][_0x52f5('0x12')]);}})[_0x52f5('0x14')](function(_0x1cb6c0){logger[_0x52f5('0xf')](_0x52f5('0x11'),_0x255fa3,_0x1cb6c0);_0xb3073a(_0x1cb6c0);});});}exports[_0x52f5('0x15')]=function(_0x3e760a){var _0x15ee0a=this;return new Promise(function(_0x4d0ad0,_0x2eeba9){return db['ServicenowAccount'][_0x52f5('0x16')]({'raw':_0x3e760a[_0x52f5('0x17')]?_0x3e760a['options']['raw']===undefined?!![]:![]:!![],'where':_0x3e760a[_0x52f5('0x17')]?_0x3e760a[_0x52f5('0x17')][_0x52f5('0x18')]||null:null,'attributes':_0x3e760a['options']?_0x3e760a[_0x52f5('0x17')][_0x52f5('0x19')]||null:null,'limit':_0x3e760a['options']?_0x3e760a['options'][_0x52f5('0x1a')]||null:null,'include':_0x3e760a[_0x52f5('0x17')]?_0x3e760a['options'][_0x52f5('0x1b')]?_[_0x52f5('0x1c')](_0x3e760a[_0x52f5('0x17')][_0x52f5('0x1b')],function(_0x2e3175){return{'model':db[_0x2e3175[_0x52f5('0x1d')]],'as':_0x2e3175['as'],'attributes':_0x2e3175[_0x52f5('0x19')],'include':_0x2e3175['include']?_['map'](_0x2e3175[_0x52f5('0x1b')],function(_0x5bfb6f){return{'model':db[_0x5bfb6f[_0x52f5('0x1d')]],'as':_0x5bfb6f['as'],'attributes':_0x5bfb6f['attributes'],'include':_0x5bfb6f[_0x52f5('0x1b')]?_[_0x52f5('0x1c')](_0x5bfb6f[_0x52f5('0x1b')],function(_0x2af32d){return{'model':db[_0x2af32d['model']],'as':_0x2af32d['as'],'attributes':_0x2af32d['attributes']};}):[]};}):[]};}):[]:[]})[_0x52f5('0x1e')](function(_0x29f80d){logger[_0x52f5('0xa')](_0x52f5('0x15'),_0x3e760a);logger[_0x52f5('0xc')]('GetServicenowAccount',_0x3e760a,JSON[_0x52f5('0xe')](_0x29f80d));_0x4d0ad0(_0x29f80d);})['catch'](function(_0x50fea9){logger[_0x52f5('0xf')](_0x52f5('0x15'),_0x50fea9[_0x52f5('0x12')],_0x3e760a);_0x2eeba9(_0x15ee0a[_0x52f5('0xf')](0x1f4,_0x50fea9[_0x52f5('0x12')]));});});};exports['ShowServicenowAccount']=function(_0x2d6b2e){var _0x38b09e=this;return new Promise(function(_0x24881d,_0x519f50){return db[_0x52f5('0x1f')][_0x52f5('0x20')]({'raw':_0x2d6b2e['options']?_0x2d6b2e[_0x52f5('0x17')][_0x52f5('0x21')]===undefined?!![]:![]:!![],'where':_0x2d6b2e[_0x52f5('0x17')]?_0x2d6b2e[_0x52f5('0x17')][_0x52f5('0x18')]||null:null,'attributes':_0x2d6b2e[_0x52f5('0x17')]?_0x2d6b2e[_0x52f5('0x17')][_0x52f5('0x19')]||null:null,'include':_0x2d6b2e['options']?_0x2d6b2e[_0x52f5('0x17')][_0x52f5('0x1b')]?_[_0x52f5('0x1c')](_0x2d6b2e['options'][_0x52f5('0x1b')],function(_0x40d22b){return{'model':db[_0x40d22b['model']],'as':_0x40d22b['as'],'attributes':_0x40d22b[_0x52f5('0x19')],'include':_0x40d22b[_0x52f5('0x1b')]?_['map'](_0x40d22b[_0x52f5('0x1b')],function(_0x353413){return{'model':db[_0x353413[_0x52f5('0x1d')]],'as':_0x353413['as'],'attributes':_0x353413[_0x52f5('0x19')],'include':_0x353413[_0x52f5('0x1b')]?_[_0x52f5('0x1c')](_0x353413[_0x52f5('0x1b')],function(_0x129fb5){return{'model':db[_0x129fb5['model']],'as':_0x129fb5['as'],'attributes':_0x129fb5[_0x52f5('0x19')]};}):[]};}):[]};}):[]:[]})[_0x52f5('0x1e')](function(_0x22b541){logger[_0x52f5('0xa')](_0x52f5('0x22'),_0x2d6b2e);logger['debug'](_0x52f5('0x22'),_0x2d6b2e,JSON['stringify'](_0x22b541));_0x24881d(_0x22b541);})['catch'](function(_0x19c862){logger[_0x52f5('0xf')]('ShowServicenowAccount',_0x19c862[_0x52f5('0x12')],_0x2d6b2e);_0x519f50(_0x38b09e['error'](0x1f4,_0x19c862[_0x52f5('0x12')]));});});}; \ No newline at end of file +var _0xff98=['ServicenowAccount,\x20%s,\x20%s','message','catch','GetServicenowAccount','findAll','options','raw','where','attributes','limit','include','map','model','ShowServicenowAccount','ServicenowAccount','find','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','request\x20sent','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x54b396,_0x3612ee){var _0x532e6d=function(_0xc8286e){while(--_0xc8286e){_0x54b396['push'](_0x54b396['shift']());}};_0x532e6d(++_0x3612ee);}(_0xff98,0x15d));var _0x8ff9=function(_0x52246d,_0x11236f){_0x52246d=_0x52246d-0x0;var _0xe30b1=_0xff98[_0x52246d];return _0xe30b1;};'use strict';var _=require('lodash');var util=require(_0x8ff9('0x0'));var moment=require(_0x8ff9('0x1'));var BPromise=require(_0x8ff9('0x2'));var rs=require(_0x8ff9('0x3'));var fs=require('fs');var Redis=require(_0x8ff9('0x4'));var db=require(_0x8ff9('0x5'))['db'];var utils=require(_0x8ff9('0x6'));var logger=require(_0x8ff9('0x7'))(_0x8ff9('0x8'));var config=require('../../config/environment');var jayson=require(_0x8ff9('0x9'));var client=jayson[_0x8ff9('0xa')][_0x8ff9('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2206c3,_0x320e49,_0x46e610){return new BPromise(function(_0x1bcc4e,_0x37c584){return client[_0x8ff9('0xc')](_0x2206c3,_0x46e610)[_0x8ff9('0xd')](function(_0xba6c39){logger[_0x8ff9('0xe')]('ServicenowAccount,\x20%s,\x20%s',_0x320e49,_0x8ff9('0xf'));logger[_0x8ff9('0x10')](_0x8ff9('0x11'),_0x320e49,_0x8ff9('0xf'),JSON[_0x8ff9('0x12')](_0xba6c39));if(_0xba6c39[_0x8ff9('0x13')]){if(_0xba6c39[_0x8ff9('0x13')][_0x8ff9('0x14')]===0x1f4){logger['error'](_0x8ff9('0x15'),_0x320e49,_0xba6c39['error'][_0x8ff9('0x16')]);return _0x37c584(_0xba6c39[_0x8ff9('0x13')][_0x8ff9('0x16')]);}logger[_0x8ff9('0x13')]('ServicenowAccount,\x20%s,\x20%s',_0x320e49,_0xba6c39[_0x8ff9('0x13')][_0x8ff9('0x16')]);return _0x1bcc4e(_0xba6c39[_0x8ff9('0x13')][_0x8ff9('0x16')]);}else{logger[_0x8ff9('0xe')](_0x8ff9('0x15'),_0x320e49,_0x8ff9('0xf'));_0x1bcc4e(_0xba6c39['result'][_0x8ff9('0x16')]);}})[_0x8ff9('0x17')](function(_0x42919f){logger[_0x8ff9('0x13')](_0x8ff9('0x15'),_0x320e49,_0x42919f);_0x37c584(_0x42919f);});});}exports[_0x8ff9('0x18')]=function(_0x18eff2){var _0x181551=this;return new Promise(function(_0x46b8ee,_0x373f1d){return db['ServicenowAccount'][_0x8ff9('0x19')]({'raw':_0x18eff2[_0x8ff9('0x1a')]?_0x18eff2[_0x8ff9('0x1a')][_0x8ff9('0x1b')]===undefined?!![]:![]:!![],'where':_0x18eff2[_0x8ff9('0x1a')]?_0x18eff2[_0x8ff9('0x1a')][_0x8ff9('0x1c')]||null:null,'attributes':_0x18eff2[_0x8ff9('0x1a')]?_0x18eff2[_0x8ff9('0x1a')][_0x8ff9('0x1d')]||null:null,'limit':_0x18eff2[_0x8ff9('0x1a')]?_0x18eff2[_0x8ff9('0x1a')][_0x8ff9('0x1e')]||null:null,'include':_0x18eff2['options']?_0x18eff2[_0x8ff9('0x1a')][_0x8ff9('0x1f')]?_['map'](_0x18eff2['options']['include'],function(_0x5316e9){return{'model':db[_0x5316e9['model']],'as':_0x5316e9['as'],'attributes':_0x5316e9[_0x8ff9('0x1d')],'include':_0x5316e9[_0x8ff9('0x1f')]?_[_0x8ff9('0x20')](_0x5316e9[_0x8ff9('0x1f')],function(_0x3115bf){return{'model':db[_0x3115bf[_0x8ff9('0x21')]],'as':_0x3115bf['as'],'attributes':_0x3115bf['attributes'],'include':_0x3115bf[_0x8ff9('0x1f')]?_[_0x8ff9('0x20')](_0x3115bf[_0x8ff9('0x1f')],function(_0x2999c0){return{'model':db[_0x2999c0[_0x8ff9('0x21')]],'as':_0x2999c0['as'],'attributes':_0x2999c0[_0x8ff9('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x74a432){logger[_0x8ff9('0xe')]('GetServicenowAccount',_0x18eff2);logger[_0x8ff9('0x10')](_0x8ff9('0x18'),_0x18eff2,JSON[_0x8ff9('0x12')](_0x74a432));_0x46b8ee(_0x74a432);})[_0x8ff9('0x17')](function(_0x322bb3){logger[_0x8ff9('0x13')](_0x8ff9('0x18'),_0x322bb3[_0x8ff9('0x16')],_0x18eff2);_0x373f1d(_0x181551[_0x8ff9('0x13')](0x1f4,_0x322bb3[_0x8ff9('0x16')]));});});};exports[_0x8ff9('0x22')]=function(_0x531507){var _0x543bc8=this;return new Promise(function(_0x3b90a2,_0x3c7214){return db[_0x8ff9('0x23')][_0x8ff9('0x24')]({'raw':_0x531507[_0x8ff9('0x1a')]?_0x531507['options']['raw']===undefined?!![]:![]:!![],'where':_0x531507[_0x8ff9('0x1a')]?_0x531507['options'][_0x8ff9('0x1c')]||null:null,'attributes':_0x531507[_0x8ff9('0x1a')]?_0x531507[_0x8ff9('0x1a')]['attributes']||null:null,'include':_0x531507[_0x8ff9('0x1a')]?_0x531507[_0x8ff9('0x1a')][_0x8ff9('0x1f')]?_[_0x8ff9('0x20')](_0x531507['options'][_0x8ff9('0x1f')],function(_0x4e3df0){return{'model':db[_0x4e3df0[_0x8ff9('0x21')]],'as':_0x4e3df0['as'],'attributes':_0x4e3df0[_0x8ff9('0x1d')],'include':_0x4e3df0[_0x8ff9('0x1f')]?_[_0x8ff9('0x20')](_0x4e3df0['include'],function(_0x202562){return{'model':db[_0x202562[_0x8ff9('0x21')]],'as':_0x202562['as'],'attributes':_0x202562[_0x8ff9('0x1d')],'include':_0x202562['include']?_[_0x8ff9('0x20')](_0x202562[_0x8ff9('0x1f')],function(_0x271eb7){return{'model':db[_0x271eb7['model']],'as':_0x271eb7['as'],'attributes':_0x271eb7[_0x8ff9('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x8ff9('0xd')](function(_0x3a2c83){logger[_0x8ff9('0xe')](_0x8ff9('0x22'),_0x531507);logger[_0x8ff9('0x10')](_0x8ff9('0x22'),_0x531507,JSON[_0x8ff9('0x12')](_0x3a2c83));_0x3b90a2(_0x3a2c83);})[_0x8ff9('0x17')](function(_0x31e9ab){logger[_0x8ff9('0x13')](_0x8ff9('0x22'),_0x31e9ab[_0x8ff9('0x16')],_0x531507);_0x3c7214(_0x543bc8[_0x8ff9('0x13')](0x1f4,_0x31e9ab['message']));});});}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/index.js b/server/api/intServicenowConfiguration/index.js index 39b5cf8..a77d15f 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 _0x7163=['put','update','delete','destroy','multer','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowConfiguration.controller','get','index','/:id','isAuthenticated','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','post'];(function(_0x3b69a9,_0x276067){var _0x264636=function(_0x54e5f9){while(--_0x54e5f9){_0x3b69a9['push'](_0x3b69a9['shift']());}};_0x264636(++_0x276067);}(_0x7163,0x164));var _0x3716=function(_0xf2628e,_0x521bf7){_0xf2628e=_0xf2628e-0x0;var _0x13863a=_0x7163[_0xf2628e];return _0x13863a;};'use strict';var multer=require(_0x3716('0x0'));var util=require(_0x3716('0x1'));var path=require('path');var timeout=require(_0x3716('0x2'));var express=require('express');var router=express[_0x3716('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x3716('0x4'));var interaction=require(_0x3716('0x5'));var config=require(_0x3716('0x6'));var controller=require(_0x3716('0x7'));router[_0x3716('0x8')]('/',auth['isAuthenticated'](),controller[_0x3716('0x9')]);router[_0x3716('0x8')](_0x3716('0xa'),auth[_0x3716('0xb')](),controller['show']);router[_0x3716('0x8')](_0x3716('0xc'),auth[_0x3716('0xb')](),controller[_0x3716('0xd')]);router[_0x3716('0x8')](_0x3716('0xe'),auth['isAuthenticated'](),controller[_0x3716('0xf')]);router[_0x3716('0x8')](_0x3716('0x10'),auth[_0x3716('0xb')](),controller['getDescriptions']);router[_0x3716('0x11')]('/',auth[_0x3716('0xb')](),controller['create']);router[_0x3716('0x12')]('/:id',auth['isAuthenticated'](),controller[_0x3716('0x13')]);router[_0x3716('0x14')]('/:id',auth[_0x3716('0xb')](),controller[_0x3716('0x15')]);module['exports']=router; \ No newline at end of file +var _0xb461=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowConfiguration.controller','isAuthenticated','index','get','show','/:id/fields','getFields','getSubjects','/:id/descriptions','getDescriptions','post','put','/:id','update','delete','exports','multer','path','express','Router'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb461,0xec));var _0x1b46=function(_0x2ad792,_0x481da1){_0x2ad792=_0x2ad792-0x0;var _0xd8386e=_0xb461[_0x2ad792];return _0xd8386e;};'use strict';var multer=require(_0x1b46('0x0'));var util=require('util');var path=require(_0x1b46('0x1'));var timeout=require('connect-timeout');var express=require(_0x1b46('0x2'));var router=express[_0x1b46('0x3')]();var fs_extra=require(_0x1b46('0x4'));var auth=require(_0x1b46('0x5'));var interaction=require(_0x1b46('0x6'));var config=require(_0x1b46('0x7'));var controller=require(_0x1b46('0x8'));router['get']('/',auth[_0x1b46('0x9')](),controller[_0x1b46('0xa')]);router[_0x1b46('0xb')]('/:id',auth[_0x1b46('0x9')](),controller[_0x1b46('0xc')]);router[_0x1b46('0xb')](_0x1b46('0xd'),auth['isAuthenticated'](),controller[_0x1b46('0xe')]);router[_0x1b46('0xb')]('/:id/subjects',auth[_0x1b46('0x9')](),controller[_0x1b46('0xf')]);router[_0x1b46('0xb')](_0x1b46('0x10'),auth[_0x1b46('0x9')](),controller[_0x1b46('0x11')]);router[_0x1b46('0x12')]('/',auth[_0x1b46('0x9')](),controller['create']);router[_0x1b46('0x13')](_0x1b46('0x14'),auth['isAuthenticated'](),controller[_0x1b46('0x15')]);router[_0x1b46('0x16')](_0x1b46('0x14'),auth[_0x1b46('0x9')](),controller['destroy']);module[_0x1b46('0x17')]=router; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js index 269a36f..9c0b28f 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 _0x2e4d=['sequelize','exports','STRING'];(function(_0x944a5e,_0x5b3984){var _0x321756=function(_0x50a0bf){while(--_0x50a0bf){_0x944a5e['push'](_0x944a5e['shift']());}};_0x321756(++_0x5b3984);}(_0x2e4d,0x120));var _0xd2e4=function(_0x2749e,_0xb90a91){_0x2749e=_0x2749e-0x0;var _0x2d383a=_0x2e4d[_0x2749e];return _0x2d383a;};'use strict';var Sequelize=require(_0xd2e4('0x0'));module[_0xd2e4('0x1')]={'name':{'type':Sequelize[_0xd2e4('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x819a=['sequelize'];(function(_0x1e3c16,_0x372caa){var _0x47a0c9=function(_0x47f81d){while(--_0x47f81d){_0x1e3c16['push'](_0x1e3c16['shift']());}};_0x47a0c9(++_0x372caa);}(_0x819a,0xda));var _0xa819=function(_0x3ca6d6,_0x1e644c){_0x3ca6d6=_0x3ca6d6-0x0;var _0xc88cfc=_0x819a[_0x3ca6d6];return _0xc88cfc;};'use strict';var Sequelize=require(_0xa819('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js index 0515112..ec059a9 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 _0xcc27=['json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','map','ServicenowConfiguration','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','keys','body','find','getFields','ServicenowField','findOne','getSubjects','hasOwnProperty','getDescriptions','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status'];(function(_0x2c2e16,_0x1d9e1a){var _0x39d6c2=function(_0x205150){while(--_0x205150){_0x2c2e16['push'](_0x2c2e16['shift']());}};_0x39d6c2(++_0x1d9e1a);}(_0xcc27,0x128));var _0x7cc2=function(_0x28c301,_0x49d078){_0x28c301=_0x28c301-0x0;var _0x342017=_0xcc27[_0x28c301];return _0x342017;};'use strict';var emlformat=require(_0x7cc2('0x0'));var rimraf=require(_0x7cc2('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7cc2('0x2'));var rp=require(_0x7cc2('0x3'));var moment=require(_0x7cc2('0x4'));var BPromise=require(_0x7cc2('0x5'));var Mustache=require('mustache');var util=require(_0x7cc2('0x6'));var path=require(_0x7cc2('0x7'));var sox=require(_0x7cc2('0x8'));var csv=require(_0x7cc2('0x9'));var ejs=require(_0x7cc2('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x7cc2('0xb'));var crypto=require(_0x7cc2('0xc'));var jsforce=require(_0x7cc2('0xd'));var deskjs=require(_0x7cc2('0xe'));var toCsv=require(_0x7cc2('0x9'));var querystring=require(_0x7cc2('0xf'));var Papa=require(_0x7cc2('0x10'));var Redis=require(_0x7cc2('0x11'));var authService=require(_0x7cc2('0x12'));var qs=require(_0x7cc2('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7cc2('0x14'));var logger=require('../../config/logger')(_0x7cc2('0x15'));var utils=require(_0x7cc2('0x16'));var config=require(_0x7cc2('0x17'));var licenseUtil=require(_0x7cc2('0x18'));var db=require(_0x7cc2('0x19'))['db'];function respondWithStatusCode(_0x2c36b9,_0xa6e33e){_0xa6e33e=_0xa6e33e||0xcc;return function(_0x21cdb1){if(_0x21cdb1){return _0x2c36b9[_0x7cc2('0x1a')](_0xa6e33e);}return _0x2c36b9[_0x7cc2('0x1b')](_0xa6e33e)['end']();};}function respondWithResult(_0xde5868,_0x8b4343){_0x8b4343=_0x8b4343||0xc8;return function(_0x4f70ea){if(_0x4f70ea){return _0xde5868[_0x7cc2('0x1b')](_0x8b4343)[_0x7cc2('0x1c')](_0x4f70ea);}};}function respondWithFilteredResult(_0x3c633e,_0x2ab46b){return function(_0x5a0a36){if(_0x5a0a36){var _0x3e1f4d=typeof _0x2ab46b[_0x7cc2('0x1d')]===_0x7cc2('0x1e')&&typeof _0x2ab46b[_0x7cc2('0x1f')]===_0x7cc2('0x1e');var _0x1d54ba=_0x5a0a36['count'];var _0x53a01a=_0x3e1f4d?0x0:_0x2ab46b[_0x7cc2('0x1d')];var _0x5ad9f8=_0x3e1f4d?_0x5a0a36[_0x7cc2('0x20')]:_0x2ab46b['offset']+_0x2ab46b['limit'];var _0x3fd2dc;if(_0x5ad9f8>=_0x1d54ba){_0x5ad9f8=_0x1d54ba;_0x3fd2dc=0xc8;}else{_0x3fd2dc=0xce;}_0x3c633e[_0x7cc2('0x1b')](_0x3fd2dc);return _0x3c633e[_0x7cc2('0x21')](_0x7cc2('0x22'),_0x53a01a+'-'+_0x5ad9f8+'/'+_0x1d54ba)['json'](_0x5a0a36);}return null;};}function patchUpdates(_0x1f8960){return function(_0x4e693b){try{jsonpatch[_0x7cc2('0x23')](_0x4e693b,_0x1f8960,!![]);}catch(_0x58185e){return BPromise[_0x7cc2('0x24')](_0x58185e);}return _0x4e693b[_0x7cc2('0x25')]();};}function saveUpdates(_0x4b9457,_0x40f8db){return function(_0x254f9f){if(_0x254f9f){return _0x254f9f[_0x7cc2('0x26')](_0x4b9457)['then'](function(_0x1692b8){return _0x1692b8;});}return null;};}function removeEntity(_0x3eb5c3,_0x14acf2){return function(_0x536a53){if(_0x536a53){return _0x536a53[_0x7cc2('0x27')]()[_0x7cc2('0x28')](function(){_0x3eb5c3[_0x7cc2('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2455e4,_0x23d6ac){return function(_0x31f9a1){if(!_0x31f9a1){_0x2455e4[_0x7cc2('0x1a')](0x194);}return _0x31f9a1;};}function handleError(_0x4bb0d8,_0x51e3e0){_0x51e3e0=_0x51e3e0||0x1f4;return function(_0x446576){logger[_0x7cc2('0x29')](_0x446576[_0x7cc2('0x2a')]);if(_0x446576[_0x7cc2('0x2b')]){delete _0x446576[_0x7cc2('0x2b')];}_0x4bb0d8[_0x7cc2('0x1b')](_0x51e3e0)[_0x7cc2('0x2c')](_0x446576);};}exports['index']=function(_0x27e548,_0x143df3){var _0x3d833c={},_0x52ce28={},_0x539b35={'count':0x0,'rows':[]};var _0x1c456f=_[_0x7cc2('0x2d')](db[_0x7cc2('0x2e')][_0x7cc2('0x2f')],function(_0x19b836){return{'name':_0x19b836[_0x7cc2('0x30')],'type':_0x19b836[_0x7cc2('0x31')]['key']};});_0x52ce28[_0x7cc2('0x32')]=_[_0x7cc2('0x2d')](_0x1c456f,'name');_0x52ce28[_0x7cc2('0x33')]=_['keys'](_0x27e548[_0x7cc2('0x33')]);_0x52ce28[_0x7cc2('0x34')]=_[_0x7cc2('0x35')](_0x52ce28['model'],_0x52ce28[_0x7cc2('0x33')]);_0x3d833c[_0x7cc2('0x36')]=_[_0x7cc2('0x35')](_0x52ce28['model'],qs[_0x7cc2('0x37')](_0x27e548[_0x7cc2('0x33')][_0x7cc2('0x37')]));_0x3d833c[_0x7cc2('0x36')]=_0x3d833c[_0x7cc2('0x36')][_0x7cc2('0x38')]?_0x3d833c[_0x7cc2('0x36')]:_0x52ce28[_0x7cc2('0x32')];if(!_0x27e548['query']['hasOwnProperty'](_0x7cc2('0x39'))){_0x3d833c['limit']=qs[_0x7cc2('0x1f')](_0x27e548[_0x7cc2('0x33')][_0x7cc2('0x1f')]);_0x3d833c[_0x7cc2('0x1d')]=qs[_0x7cc2('0x1d')](_0x27e548[_0x7cc2('0x33')][_0x7cc2('0x1d')]);}_0x3d833c[_0x7cc2('0x3a')]=qs[_0x7cc2('0x3b')](_0x27e548[_0x7cc2('0x33')][_0x7cc2('0x3b')]);_0x3d833c[_0x7cc2('0x3c')]=qs[_0x7cc2('0x34')](_[_0x7cc2('0x3d')](_0x27e548[_0x7cc2('0x33')],_0x52ce28[_0x7cc2('0x34')]),_0x1c456f);if(_0x27e548[_0x7cc2('0x33')][_0x7cc2('0x3e')]){_0x3d833c[_0x7cc2('0x3c')]=_[_0x7cc2('0x3f')](_0x3d833c[_0x7cc2('0x3c')],{'$or':_[_0x7cc2('0x2d')](_0x1c456f,function(_0x29bbdd){if(_0x29bbdd[_0x7cc2('0x31')]!==_0x7cc2('0x40')){var _0x467fe0={};_0x467fe0[_0x29bbdd['name']]={'$like':'%'+_0x27e548['query'][_0x7cc2('0x3e')]+'%'};return _0x467fe0;}})});}_0x3d833c=_[_0x7cc2('0x3f')]({},_0x3d833c,_0x27e548[_0x7cc2('0x41')]);var _0x46e562={'where':_0x3d833c[_0x7cc2('0x3c')]};return db[_0x7cc2('0x2e')][_0x7cc2('0x20')](_0x46e562)[_0x7cc2('0x28')](function(_0x4bcefa){_0x539b35['count']=_0x4bcefa;if(_0x27e548[_0x7cc2('0x33')][_0x7cc2('0x42')]){_0x3d833c[_0x7cc2('0x43')]=[{'all':!![]}];}return db[_0x7cc2('0x2e')][_0x7cc2('0x44')](_0x3d833c);})[_0x7cc2('0x28')](function(_0x99e296){_0x539b35['rows']=_0x99e296;return _0x539b35;})[_0x7cc2('0x28')](respondWithFilteredResult(_0x143df3,_0x3d833c))[_0x7cc2('0x45')](handleError(_0x143df3,null));};exports[_0x7cc2('0x46')]=function(_0x3a9ccb,_0x9ba789){var _0x266e0a={'raw':![],'where':{'id':_0x3a9ccb[_0x7cc2('0x47')]['id']}},_0x2b3985={};_0x2b3985[_0x7cc2('0x32')]=_[_0x7cc2('0x48')](db[_0x7cc2('0x2e')][_0x7cc2('0x2f')]);_0x2b3985[_0x7cc2('0x33')]=_[_0x7cc2('0x48')](_0x3a9ccb[_0x7cc2('0x33')]);_0x2b3985['filters']=_[_0x7cc2('0x35')](_0x2b3985['model'],_0x2b3985[_0x7cc2('0x33')]);_0x266e0a[_0x7cc2('0x36')]=_[_0x7cc2('0x35')](_0x2b3985['model'],qs[_0x7cc2('0x37')](_0x3a9ccb[_0x7cc2('0x33')][_0x7cc2('0x37')]));_0x266e0a[_0x7cc2('0x36')]=_0x266e0a[_0x7cc2('0x36')][_0x7cc2('0x38')]?_0x266e0a[_0x7cc2('0x36')]:_0x2b3985[_0x7cc2('0x32')];if(_0x3a9ccb['query'][_0x7cc2('0x42')]){_0x266e0a[_0x7cc2('0x43')]=[{'all':!![]}];}_0x266e0a=_[_0x7cc2('0x3f')]({},_0x266e0a,_0x3a9ccb[_0x7cc2('0x41')]);return db[_0x7cc2('0x2e')]['find'](_0x266e0a)['then'](handleEntityNotFound(_0x9ba789,null))[_0x7cc2('0x28')](respondWithResult(_0x9ba789,null))[_0x7cc2('0x45')](handleError(_0x9ba789,null));};exports['create']=function(_0x402ea8,_0x4cec3e){return db['ServicenowConfiguration']['create'](_0x402ea8[_0x7cc2('0x49')],{})[_0x7cc2('0x28')](respondWithResult(_0x4cec3e,0xc9))[_0x7cc2('0x45')](handleError(_0x4cec3e,null));};exports['update']=function(_0x18151f,_0x218ca2){if(_0x18151f[_0x7cc2('0x49')]['id']){delete _0x18151f[_0x7cc2('0x49')]['id'];}return db[_0x7cc2('0x2e')][_0x7cc2('0x4a')]({'where':{'id':_0x18151f[_0x7cc2('0x47')]['id']}})[_0x7cc2('0x28')](handleEntityNotFound(_0x218ca2,null))[_0x7cc2('0x28')](saveUpdates(_0x18151f[_0x7cc2('0x49')],null))[_0x7cc2('0x28')](respondWithResult(_0x218ca2,null))[_0x7cc2('0x45')](handleError(_0x218ca2,null));};exports[_0x7cc2('0x27')]=function(_0xe8024,_0x333bb5){return db[_0x7cc2('0x2e')]['find']({'where':{'id':_0xe8024[_0x7cc2('0x47')]['id']}})['then'](handleEntityNotFound(_0x333bb5,null))[_0x7cc2('0x28')](removeEntity(_0x333bb5,null))[_0x7cc2('0x45')](handleError(_0x333bb5,null));};exports[_0x7cc2('0x4b')]=function(_0x562e38,_0x2a2da0,_0x2a79ff){var _0x173e5e={};var _0xf21511={};var _0x13d9d4;var _0x21c6e7;return db[_0x7cc2('0x2e')]['findOne']({'where':{'id':_0x562e38[_0x7cc2('0x47')]['id']}})['then'](handleEntityNotFound(_0x2a2da0,null))[_0x7cc2('0x28')](function(_0x554236){if(_0x554236){_0x13d9d4=_0x554236;_0xf21511['model']=_['keys'](db[_0x7cc2('0x4c')][_0x7cc2('0x2f')]);_0xf21511[_0x7cc2('0x33')]=_['keys'](_0x562e38['query']);_0xf21511[_0x7cc2('0x34')]=_[_0x7cc2('0x35')](_0xf21511['model'],_0xf21511[_0x7cc2('0x33')]);_0x173e5e[_0x7cc2('0x36')]=_['intersection'](_0xf21511[_0x7cc2('0x32')],qs[_0x7cc2('0x37')](_0x562e38[_0x7cc2('0x33')]['fields']));_0x173e5e[_0x7cc2('0x36')]=_0x173e5e[_0x7cc2('0x36')][_0x7cc2('0x38')]?_0x173e5e['attributes']:_0xf21511[_0x7cc2('0x32')];_0x173e5e[_0x7cc2('0x3a')]=qs[_0x7cc2('0x3b')](_0x562e38[_0x7cc2('0x33')][_0x7cc2('0x3b')]);_0x173e5e[_0x7cc2('0x3c')]=qs[_0x7cc2('0x34')](_[_0x7cc2('0x3d')](_0x562e38['query'],_0xf21511['filters']));if(_0x562e38[_0x7cc2('0x33')][_0x7cc2('0x3e')]){_0x173e5e['where']=_['merge'](_0x173e5e[_0x7cc2('0x3c')],{'$or':_[_0x7cc2('0x2d')](_0x173e5e[_0x7cc2('0x36')],function(_0x2fbd9c){var _0x44e48e={};_0x44e48e[_0x2fbd9c]={'$like':'%'+_0x562e38[_0x7cc2('0x33')][_0x7cc2('0x3e')]+'%'};return _0x44e48e;})});}_0x173e5e=_[_0x7cc2('0x3f')]({},_0x173e5e,_0x562e38[_0x7cc2('0x41')]);return _0x13d9d4[_0x7cc2('0x4b')](_0x173e5e);}})['then'](function(_0x456479){if(_0x456479){_0x21c6e7=_0x456479[_0x7cc2('0x38')];if(!_0x562e38[_0x7cc2('0x33')]['hasOwnProperty'](_0x7cc2('0x39'))){_0x173e5e[_0x7cc2('0x1f')]=qs[_0x7cc2('0x1f')](_0x562e38[_0x7cc2('0x33')][_0x7cc2('0x1f')]);_0x173e5e[_0x7cc2('0x1d')]=qs[_0x7cc2('0x1d')](_0x562e38['query'][_0x7cc2('0x1d')]);}return _0x13d9d4['getFields'](_0x173e5e);}})[_0x7cc2('0x28')](function(_0x264a2e){if(_0x264a2e){return _0x264a2e?{'count':_0x21c6e7,'rows':_0x264a2e}:null;}})['then'](respondWithResult(_0x2a2da0,null))[_0x7cc2('0x45')](handleError(_0x2a2da0,null));};exports['getSubjects']=function(_0xbaa2e9,_0x5343eb,_0x1a760c){var _0x4c53ff={};var _0x3cb6c0={};var _0x3b348f;var _0x1d7fb6;return db[_0x7cc2('0x2e')][_0x7cc2('0x4d')]({'where':{'id':_0xbaa2e9[_0x7cc2('0x47')]['id']}})[_0x7cc2('0x28')](handleEntityNotFound(_0x5343eb,null))[_0x7cc2('0x28')](function(_0xb88305){if(_0xb88305){_0x3b348f=_0xb88305;_0x3cb6c0[_0x7cc2('0x32')]=_[_0x7cc2('0x48')](db[_0x7cc2('0x4c')][_0x7cc2('0x2f')]);_0x3cb6c0[_0x7cc2('0x33')]=_[_0x7cc2('0x48')](_0xbaa2e9[_0x7cc2('0x33')]);_0x3cb6c0[_0x7cc2('0x34')]=_[_0x7cc2('0x35')](_0x3cb6c0[_0x7cc2('0x32')],_0x3cb6c0['query']);_0x4c53ff[_0x7cc2('0x36')]=_[_0x7cc2('0x35')](_0x3cb6c0['model'],qs[_0x7cc2('0x37')](_0xbaa2e9[_0x7cc2('0x33')][_0x7cc2('0x37')]));_0x4c53ff['attributes']=_0x4c53ff[_0x7cc2('0x36')][_0x7cc2('0x38')]?_0x4c53ff[_0x7cc2('0x36')]:_0x3cb6c0[_0x7cc2('0x32')];_0x4c53ff[_0x7cc2('0x3a')]=qs[_0x7cc2('0x3b')](_0xbaa2e9[_0x7cc2('0x33')][_0x7cc2('0x3b')]);_0x4c53ff[_0x7cc2('0x3c')]=qs['filters'](_[_0x7cc2('0x3d')](_0xbaa2e9[_0x7cc2('0x33')],_0x3cb6c0[_0x7cc2('0x34')]));if(_0xbaa2e9['query'][_0x7cc2('0x3e')]){_0x4c53ff['where']=_[_0x7cc2('0x3f')](_0x4c53ff['where'],{'$or':_[_0x7cc2('0x2d')](_0x4c53ff[_0x7cc2('0x36')],function(_0x450ffe){var _0x54a24b={};_0x54a24b[_0x450ffe]={'$like':'%'+_0xbaa2e9[_0x7cc2('0x33')][_0x7cc2('0x3e')]+'%'};return _0x54a24b;})});}_0x4c53ff=_[_0x7cc2('0x3f')]({},_0x4c53ff,_0xbaa2e9[_0x7cc2('0x41')]);return _0x3b348f[_0x7cc2('0x4e')](_0x4c53ff);}})['then'](function(_0x59c33c){if(_0x59c33c){_0x1d7fb6=_0x59c33c['length'];if(!_0xbaa2e9[_0x7cc2('0x33')][_0x7cc2('0x4f')](_0x7cc2('0x39'))){_0x4c53ff['limit']=qs[_0x7cc2('0x1f')](_0xbaa2e9[_0x7cc2('0x33')]['limit']);_0x4c53ff[_0x7cc2('0x1d')]=qs[_0x7cc2('0x1d')](_0xbaa2e9['query'][_0x7cc2('0x1d')]);}return _0x3b348f[_0x7cc2('0x4e')](_0x4c53ff);}})[_0x7cc2('0x28')](function(_0x4946cf){if(_0x4946cf){return _0x4946cf?{'count':_0x1d7fb6,'rows':_0x4946cf}:null;}})['then'](respondWithResult(_0x5343eb,null))[_0x7cc2('0x45')](handleError(_0x5343eb,null));};exports[_0x7cc2('0x50')]=function(_0x44aac8,_0x4a3eec,_0xa9a899){var _0x97328f={};var _0x51e9ca={};var _0x29b520;var _0x53ca62;return db[_0x7cc2('0x2e')][_0x7cc2('0x4d')]({'where':{'id':_0x44aac8[_0x7cc2('0x47')]['id']}})['then'](handleEntityNotFound(_0x4a3eec,null))[_0x7cc2('0x28')](function(_0x41bd1c){if(_0x41bd1c){_0x29b520=_0x41bd1c;_0x51e9ca[_0x7cc2('0x32')]=_[_0x7cc2('0x48')](db[_0x7cc2('0x4c')][_0x7cc2('0x2f')]);_0x51e9ca['query']=_['keys'](_0x44aac8['query']);_0x51e9ca['filters']=_[_0x7cc2('0x35')](_0x51e9ca[_0x7cc2('0x32')],_0x51e9ca[_0x7cc2('0x33')]);_0x97328f[_0x7cc2('0x36')]=_[_0x7cc2('0x35')](_0x51e9ca['model'],qs[_0x7cc2('0x37')](_0x44aac8[_0x7cc2('0x33')][_0x7cc2('0x37')]));_0x97328f['attributes']=_0x97328f['attributes'][_0x7cc2('0x38')]?_0x97328f[_0x7cc2('0x36')]:_0x51e9ca[_0x7cc2('0x32')];_0x97328f[_0x7cc2('0x3a')]=qs[_0x7cc2('0x3b')](_0x44aac8[_0x7cc2('0x33')][_0x7cc2('0x3b')]);_0x97328f[_0x7cc2('0x3c')]=qs[_0x7cc2('0x34')](_[_0x7cc2('0x3d')](_0x44aac8[_0x7cc2('0x33')],_0x51e9ca[_0x7cc2('0x34')]));if(_0x44aac8[_0x7cc2('0x33')][_0x7cc2('0x3e')]){_0x97328f[_0x7cc2('0x3c')]=_[_0x7cc2('0x3f')](_0x97328f['where'],{'$or':_[_0x7cc2('0x2d')](_0x97328f[_0x7cc2('0x36')],function(_0x182493){var _0x50c93c={};_0x50c93c[_0x182493]={'$like':'%'+_0x44aac8[_0x7cc2('0x33')]['filter']+'%'};return _0x50c93c;})});}_0x97328f=_['merge']({},_0x97328f,_0x44aac8[_0x7cc2('0x41')]);return _0x29b520[_0x7cc2('0x50')](_0x97328f);}})[_0x7cc2('0x28')](function(_0x5d4288){if(_0x5d4288){_0x53ca62=_0x5d4288[_0x7cc2('0x38')];if(!_0x44aac8[_0x7cc2('0x33')]['hasOwnProperty'](_0x7cc2('0x39'))){_0x97328f[_0x7cc2('0x1f')]=qs[_0x7cc2('0x1f')](_0x44aac8['query'][_0x7cc2('0x1f')]);_0x97328f[_0x7cc2('0x1d')]=qs[_0x7cc2('0x1d')](_0x44aac8['query'][_0x7cc2('0x1d')]);}return _0x29b520[_0x7cc2('0x50')](_0x97328f);}})[_0x7cc2('0x28')](function(_0xc0c0af){if(_0xc0c0af){return _0xc0c0af?{'count':_0x53ca62,'rows':_0xc0c0af}:null;}})[_0x7cc2('0x28')](respondWithResult(_0x4a3eec,null))[_0x7cc2('0x45')](handleError(_0x4a3eec,null));}; \ No newline at end of file +var _0x5814=['end','status','json','limit','undefined','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','error','name','send','index','map','ServicenowConfiguration','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','filters','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','params','create','body','find','catch','findOne','ServicenowField','getFields','nolimit','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus'];(function(_0x45ec99,_0x27bfc9){var _0xe3e98e=function(_0x3db08c){while(--_0x3db08c){_0x45ec99['push'](_0x45ec99['shift']());}};_0xe3e98e(++_0x27bfc9);}(_0x5814,0x8d));var _0x4581=function(_0x4a75f1,_0x4d758b){_0x4a75f1=_0x4a75f1-0x0;var _0x4bf7f4=_0x5814[_0x4a75f1];return _0x4bf7f4;};'use strict';var emlformat=require(_0x4581('0x0'));var rimraf=require(_0x4581('0x1'));var zipdir=require(_0x4581('0x2'));var jsonpatch=require(_0x4581('0x3'));var rp=require(_0x4581('0x4'));var moment=require(_0x4581('0x5'));var BPromise=require(_0x4581('0x6'));var Mustache=require(_0x4581('0x7'));var util=require('util');var path=require(_0x4581('0x8'));var sox=require(_0x4581('0x9'));var csv=require('to-csv');var ejs=require(_0x4581('0xa'));var fs=require('fs');var fs_extra=require(_0x4581('0xb'));var _=require(_0x4581('0xc'));var squel=require('squel');var crypto=require(_0x4581('0xd'));var jsforce=require(_0x4581('0xe'));var deskjs=require(_0x4581('0xf'));var toCsv=require('to-csv');var querystring=require(_0x4581('0x10'));var Papa=require(_0x4581('0x11'));var Redis=require(_0x4581('0x12'));var authService=require(_0x4581('0x13'));var qs=require(_0x4581('0x14'));var as=require(_0x4581('0x15'));var hardwareService=require(_0x4581('0x16'));var logger=require('../../config/logger')(_0x4581('0x17'));var utils=require(_0x4581('0x18'));var config=require(_0x4581('0x19'));var licenseUtil=require(_0x4581('0x1a'));var db=require(_0x4581('0x1b'))['db'];function respondWithStatusCode(_0x57eb51,_0x247114){_0x247114=_0x247114||0xcc;return function(_0x201aeb){if(_0x201aeb){return _0x57eb51[_0x4581('0x1c')](_0x247114);}return _0x57eb51['status'](_0x247114)[_0x4581('0x1d')]();};}function respondWithResult(_0x552c4b,_0x2622c2){_0x2622c2=_0x2622c2||0xc8;return function(_0x38d302){if(_0x38d302){return _0x552c4b[_0x4581('0x1e')](_0x2622c2)[_0x4581('0x1f')](_0x38d302);}};}function respondWithFilteredResult(_0x185048,_0x30e57d){return function(_0x4a9d19){if(_0x4a9d19){var _0x4501e2=typeof _0x30e57d['offset']==='undefined'&&typeof _0x30e57d[_0x4581('0x20')]===_0x4581('0x21');var _0x1fdd4a=_0x4a9d19[_0x4581('0x22')];var _0x1827bd=_0x4501e2?0x0:_0x30e57d['offset'];var _0x4320fa=_0x4501e2?_0x4a9d19[_0x4581('0x22')]:_0x30e57d[_0x4581('0x23')]+_0x30e57d['limit'];var _0x128e57;if(_0x4320fa>=_0x1fdd4a){_0x4320fa=_0x1fdd4a;_0x128e57=0xc8;}else{_0x128e57=0xce;}_0x185048['status'](_0x128e57);return _0x185048[_0x4581('0x24')](_0x4581('0x25'),_0x1827bd+'-'+_0x4320fa+'/'+_0x1fdd4a)[_0x4581('0x1f')](_0x4a9d19);}return null;};}function patchUpdates(_0x5b372d){return function(_0x1cc19b){try{jsonpatch[_0x4581('0x26')](_0x1cc19b,_0x5b372d,!![]);}catch(_0x167c98){return BPromise[_0x4581('0x27')](_0x167c98);}return _0x1cc19b[_0x4581('0x28')]();};}function saveUpdates(_0x236fc6,_0x3fecfb){return function(_0x2e9391){if(_0x2e9391){return _0x2e9391[_0x4581('0x29')](_0x236fc6)[_0x4581('0x2a')](function(_0x1b7579){return _0x1b7579;});}return null;};}function removeEntity(_0x4cc229,_0x212f88){return function(_0x3b31f7){if(_0x3b31f7){return _0x3b31f7[_0x4581('0x2b')]()[_0x4581('0x2a')](function(){_0x4cc229[_0x4581('0x1e')](0xcc)[_0x4581('0x1d')]();});}};}function handleEntityNotFound(_0x30d55b,_0x5e38df){return function(_0x30df12){if(!_0x30df12){_0x30d55b[_0x4581('0x1c')](0x194);}return _0x30df12;};}function handleError(_0x43048a,_0x1b22b5){_0x1b22b5=_0x1b22b5||0x1f4;return function(_0x3ecdcc){logger[_0x4581('0x2c')](_0x3ecdcc['stack']);if(_0x3ecdcc[_0x4581('0x2d')]){delete _0x3ecdcc[_0x4581('0x2d')];}_0x43048a['status'](_0x1b22b5)[_0x4581('0x2e')](_0x3ecdcc);};}exports[_0x4581('0x2f')]=function(_0x1f2d20,_0x44e739){var _0x5ceba2={},_0x38ad33={},_0x398f29={'count':0x0,'rows':[]};var _0x32a9b2=_[_0x4581('0x30')](db[_0x4581('0x31')][_0x4581('0x32')],function(_0x533355){return{'name':_0x533355[_0x4581('0x33')],'type':_0x533355[_0x4581('0x34')][_0x4581('0x35')]};});_0x38ad33[_0x4581('0x36')]=_['map'](_0x32a9b2,'name');_0x38ad33[_0x4581('0x37')]=_[_0x4581('0x38')](_0x1f2d20[_0x4581('0x37')]);_0x38ad33['filters']=_['intersection'](_0x38ad33[_0x4581('0x36')],_0x38ad33[_0x4581('0x37')]);_0x5ceba2['attributes']=_[_0x4581('0x39')](_0x38ad33[_0x4581('0x36')],qs[_0x4581('0x3a')](_0x1f2d20[_0x4581('0x37')][_0x4581('0x3a')]));_0x5ceba2[_0x4581('0x3b')]=_0x5ceba2[_0x4581('0x3b')][_0x4581('0x3c')]?_0x5ceba2[_0x4581('0x3b')]:_0x38ad33['model'];if(!_0x1f2d20['query'][_0x4581('0x3d')]('nolimit')){_0x5ceba2['limit']=qs[_0x4581('0x20')](_0x1f2d20[_0x4581('0x37')][_0x4581('0x20')]);_0x5ceba2[_0x4581('0x23')]=qs[_0x4581('0x23')](_0x1f2d20['query']['offset']);}_0x5ceba2[_0x4581('0x3e')]=qs[_0x4581('0x3f')](_0x1f2d20['query'][_0x4581('0x3f')]);_0x5ceba2[_0x4581('0x40')]=qs[_0x4581('0x41')](_[_0x4581('0x42')](_0x1f2d20[_0x4581('0x37')],_0x38ad33['filters']),_0x32a9b2);if(_0x1f2d20['query']['filter']){_0x5ceba2[_0x4581('0x40')]=_[_0x4581('0x43')](_0x5ceba2[_0x4581('0x40')],{'$or':_[_0x4581('0x30')](_0x32a9b2,function(_0x578afb){if(_0x578afb[_0x4581('0x34')]!==_0x4581('0x44')){var _0x12038c={};_0x12038c[_0x578afb['name']]={'$like':'%'+_0x1f2d20[_0x4581('0x37')][_0x4581('0x45')]+'%'};return _0x12038c;}})});}_0x5ceba2=_[_0x4581('0x43')]({},_0x5ceba2,_0x1f2d20[_0x4581('0x46')]);var _0x1a0d71={'where':_0x5ceba2[_0x4581('0x40')]};return db[_0x4581('0x31')]['count'](_0x1a0d71)['then'](function(_0x3b033a){_0x398f29[_0x4581('0x22')]=_0x3b033a;if(_0x1f2d20[_0x4581('0x37')][_0x4581('0x47')]){_0x5ceba2[_0x4581('0x48')]=[{'all':!![]}];}return db['ServicenowConfiguration'][_0x4581('0x49')](_0x5ceba2);})['then'](function(_0x5e6e16){_0x398f29['rows']=_0x5e6e16;return _0x398f29;})['then'](respondWithFilteredResult(_0x44e739,_0x5ceba2))['catch'](handleError(_0x44e739,null));};exports['show']=function(_0x4a17ab,_0x4f5b94){var _0x3edb9e={'raw':![],'where':{'id':_0x4a17ab[_0x4581('0x4a')]['id']}},_0x4136a2={};_0x4136a2[_0x4581('0x36')]=_[_0x4581('0x38')](db[_0x4581('0x31')][_0x4581('0x32')]);_0x4136a2[_0x4581('0x37')]=_[_0x4581('0x38')](_0x4a17ab[_0x4581('0x37')]);_0x4136a2['filters']=_[_0x4581('0x39')](_0x4136a2[_0x4581('0x36')],_0x4136a2[_0x4581('0x37')]);_0x3edb9e['attributes']=_[_0x4581('0x39')](_0x4136a2[_0x4581('0x36')],qs[_0x4581('0x3a')](_0x4a17ab[_0x4581('0x37')][_0x4581('0x3a')]));_0x3edb9e['attributes']=_0x3edb9e['attributes'][_0x4581('0x3c')]?_0x3edb9e[_0x4581('0x3b')]:_0x4136a2[_0x4581('0x36')];if(_0x4a17ab[_0x4581('0x37')]['includeAll']){_0x3edb9e[_0x4581('0x48')]=[{'all':!![]}];}_0x3edb9e=_[_0x4581('0x43')]({},_0x3edb9e,_0x4a17ab[_0x4581('0x46')]);return db[_0x4581('0x31')]['find'](_0x3edb9e)[_0x4581('0x2a')](handleEntityNotFound(_0x4f5b94,null))['then'](respondWithResult(_0x4f5b94,null))['catch'](handleError(_0x4f5b94,null));};exports['create']=function(_0x941f4d,_0x1b92d8){return db[_0x4581('0x31')][_0x4581('0x4b')](_0x941f4d[_0x4581('0x4c')],{})[_0x4581('0x2a')](respondWithResult(_0x1b92d8,0xc9))['catch'](handleError(_0x1b92d8,null));};exports[_0x4581('0x29')]=function(_0x15e47a,_0x1c297f){if(_0x15e47a[_0x4581('0x4c')]['id']){delete _0x15e47a[_0x4581('0x4c')]['id'];}return db[_0x4581('0x31')][_0x4581('0x4d')]({'where':{'id':_0x15e47a[_0x4581('0x4a')]['id']}})[_0x4581('0x2a')](handleEntityNotFound(_0x1c297f,null))['then'](saveUpdates(_0x15e47a[_0x4581('0x4c')],null))[_0x4581('0x2a')](respondWithResult(_0x1c297f,null))[_0x4581('0x4e')](handleError(_0x1c297f,null));};exports['destroy']=function(_0x2ad616,_0x4de85a){return db['ServicenowConfiguration']['find']({'where':{'id':_0x2ad616[_0x4581('0x4a')]['id']}})[_0x4581('0x2a')](handleEntityNotFound(_0x4de85a,null))[_0x4581('0x2a')](removeEntity(_0x4de85a,null))[_0x4581('0x4e')](handleError(_0x4de85a,null));};exports['getFields']=function(_0x51728c,_0x5210c5,_0x1ab8ad){var _0x1c821d={};var _0x5736a2={};var _0x201e29;var _0x5f4fb4;return db[_0x4581('0x31')][_0x4581('0x4f')]({'where':{'id':_0x51728c[_0x4581('0x4a')]['id']}})[_0x4581('0x2a')](handleEntityNotFound(_0x5210c5,null))[_0x4581('0x2a')](function(_0x4d917a){if(_0x4d917a){_0x201e29=_0x4d917a;_0x5736a2[_0x4581('0x36')]=_[_0x4581('0x38')](db[_0x4581('0x50')][_0x4581('0x32')]);_0x5736a2['query']=_[_0x4581('0x38')](_0x51728c[_0x4581('0x37')]);_0x5736a2['filters']=_[_0x4581('0x39')](_0x5736a2['model'],_0x5736a2['query']);_0x1c821d['attributes']=_[_0x4581('0x39')](_0x5736a2[_0x4581('0x36')],qs['fields'](_0x51728c[_0x4581('0x37')][_0x4581('0x3a')]));_0x1c821d['attributes']=_0x1c821d[_0x4581('0x3b')][_0x4581('0x3c')]?_0x1c821d['attributes']:_0x5736a2[_0x4581('0x36')];_0x1c821d[_0x4581('0x3e')]=qs['sort'](_0x51728c[_0x4581('0x37')][_0x4581('0x3f')]);_0x1c821d[_0x4581('0x40')]=qs[_0x4581('0x41')](_[_0x4581('0x42')](_0x51728c[_0x4581('0x37')],_0x5736a2[_0x4581('0x41')]));if(_0x51728c[_0x4581('0x37')][_0x4581('0x45')]){_0x1c821d['where']=_[_0x4581('0x43')](_0x1c821d[_0x4581('0x40')],{'$or':_[_0x4581('0x30')](_0x1c821d[_0x4581('0x3b')],function(_0x11bd5a){var _0x2afe11={};_0x2afe11[_0x11bd5a]={'$like':'%'+_0x51728c[_0x4581('0x37')][_0x4581('0x45')]+'%'};return _0x2afe11;})});}_0x1c821d=_[_0x4581('0x43')]({},_0x1c821d,_0x51728c[_0x4581('0x46')]);return _0x201e29[_0x4581('0x51')](_0x1c821d);}})['then'](function(_0x3b0ae3){if(_0x3b0ae3){_0x5f4fb4=_0x3b0ae3[_0x4581('0x3c')];if(!_0x51728c[_0x4581('0x37')][_0x4581('0x3d')](_0x4581('0x52'))){_0x1c821d[_0x4581('0x20')]=qs['limit'](_0x51728c[_0x4581('0x37')][_0x4581('0x20')]);_0x1c821d[_0x4581('0x23')]=qs[_0x4581('0x23')](_0x51728c[_0x4581('0x37')][_0x4581('0x23')]);}return _0x201e29[_0x4581('0x51')](_0x1c821d);}})[_0x4581('0x2a')](function(_0xe98d52){if(_0xe98d52){return _0xe98d52?{'count':_0x5f4fb4,'rows':_0xe98d52}:null;}})[_0x4581('0x2a')](respondWithResult(_0x5210c5,null))[_0x4581('0x4e')](handleError(_0x5210c5,null));};exports[_0x4581('0x53')]=function(_0x557dc8,_0x299fda,_0x30bafb){var _0x36d2b0={};var _0x17c54a={};var _0x255799;var _0x8564f2;return db[_0x4581('0x31')][_0x4581('0x4f')]({'where':{'id':_0x557dc8[_0x4581('0x4a')]['id']}})['then'](handleEntityNotFound(_0x299fda,null))[_0x4581('0x2a')](function(_0x4b4d4d){if(_0x4b4d4d){_0x255799=_0x4b4d4d;_0x17c54a[_0x4581('0x36')]=_[_0x4581('0x38')](db[_0x4581('0x50')][_0x4581('0x32')]);_0x17c54a['query']=_[_0x4581('0x38')](_0x557dc8[_0x4581('0x37')]);_0x17c54a['filters']=_['intersection'](_0x17c54a[_0x4581('0x36')],_0x17c54a[_0x4581('0x37')]);_0x36d2b0['attributes']=_['intersection'](_0x17c54a[_0x4581('0x36')],qs['fields'](_0x557dc8[_0x4581('0x37')]['fields']));_0x36d2b0['attributes']=_0x36d2b0['attributes'][_0x4581('0x3c')]?_0x36d2b0[_0x4581('0x3b')]:_0x17c54a[_0x4581('0x36')];_0x36d2b0[_0x4581('0x3e')]=qs['sort'](_0x557dc8[_0x4581('0x37')]['sort']);_0x36d2b0[_0x4581('0x40')]=qs['filters'](_[_0x4581('0x42')](_0x557dc8[_0x4581('0x37')],_0x17c54a[_0x4581('0x41')]));if(_0x557dc8[_0x4581('0x37')]['filter']){_0x36d2b0[_0x4581('0x40')]=_[_0x4581('0x43')](_0x36d2b0['where'],{'$or':_[_0x4581('0x30')](_0x36d2b0[_0x4581('0x3b')],function(_0x354749){var _0x3cc5bb={};_0x3cc5bb[_0x354749]={'$like':'%'+_0x557dc8[_0x4581('0x37')]['filter']+'%'};return _0x3cc5bb;})});}_0x36d2b0=_['merge']({},_0x36d2b0,_0x557dc8[_0x4581('0x46')]);return _0x255799[_0x4581('0x53')](_0x36d2b0);}})['then'](function(_0x4d54ec){if(_0x4d54ec){_0x8564f2=_0x4d54ec[_0x4581('0x3c')];if(!_0x557dc8[_0x4581('0x37')]['hasOwnProperty'](_0x4581('0x52'))){_0x36d2b0[_0x4581('0x20')]=qs['limit'](_0x557dc8['query'][_0x4581('0x20')]);_0x36d2b0[_0x4581('0x23')]=qs['offset'](_0x557dc8[_0x4581('0x37')][_0x4581('0x23')]);}return _0x255799[_0x4581('0x53')](_0x36d2b0);}})[_0x4581('0x2a')](function(_0x123b6c){if(_0x123b6c){return _0x123b6c?{'count':_0x8564f2,'rows':_0x123b6c}:null;}})['then'](respondWithResult(_0x299fda,null))[_0x4581('0x4e')](handleError(_0x299fda,null));};exports[_0x4581('0x54')]=function(_0x3e0f6c,_0x313d3a,_0x4453fa){var _0x4ba62b={};var _0x4eb530={};var _0x39ddd4;var _0xac3603;return db[_0x4581('0x31')][_0x4581('0x4f')]({'where':{'id':_0x3e0f6c[_0x4581('0x4a')]['id']}})['then'](handleEntityNotFound(_0x313d3a,null))[_0x4581('0x2a')](function(_0xb2c614){if(_0xb2c614){_0x39ddd4=_0xb2c614;_0x4eb530[_0x4581('0x36')]=_['keys'](db[_0x4581('0x50')][_0x4581('0x32')]);_0x4eb530['query']=_[_0x4581('0x38')](_0x3e0f6c[_0x4581('0x37')]);_0x4eb530[_0x4581('0x41')]=_[_0x4581('0x39')](_0x4eb530[_0x4581('0x36')],_0x4eb530[_0x4581('0x37')]);_0x4ba62b[_0x4581('0x3b')]=_[_0x4581('0x39')](_0x4eb530[_0x4581('0x36')],qs[_0x4581('0x3a')](_0x3e0f6c['query'][_0x4581('0x3a')]));_0x4ba62b[_0x4581('0x3b')]=_0x4ba62b['attributes'][_0x4581('0x3c')]?_0x4ba62b[_0x4581('0x3b')]:_0x4eb530['model'];_0x4ba62b['order']=qs[_0x4581('0x3f')](_0x3e0f6c[_0x4581('0x37')][_0x4581('0x3f')]);_0x4ba62b['where']=qs[_0x4581('0x41')](_[_0x4581('0x42')](_0x3e0f6c[_0x4581('0x37')],_0x4eb530[_0x4581('0x41')]));if(_0x3e0f6c[_0x4581('0x37')][_0x4581('0x45')]){_0x4ba62b[_0x4581('0x40')]=_[_0x4581('0x43')](_0x4ba62b[_0x4581('0x40')],{'$or':_[_0x4581('0x30')](_0x4ba62b[_0x4581('0x3b')],function(_0xec1ce2){var _0x363d61={};_0x363d61[_0xec1ce2]={'$like':'%'+_0x3e0f6c[_0x4581('0x37')][_0x4581('0x45')]+'%'};return _0x363d61;})});}_0x4ba62b=_['merge']({},_0x4ba62b,_0x3e0f6c[_0x4581('0x46')]);return _0x39ddd4[_0x4581('0x54')](_0x4ba62b);}})[_0x4581('0x2a')](function(_0x6d4078){if(_0x6d4078){_0xac3603=_0x6d4078[_0x4581('0x3c')];if(!_0x3e0f6c['query'][_0x4581('0x3d')]('nolimit')){_0x4ba62b['limit']=qs[_0x4581('0x20')](_0x3e0f6c[_0x4581('0x37')]['limit']);_0x4ba62b[_0x4581('0x23')]=qs[_0x4581('0x23')](_0x3e0f6c[_0x4581('0x37')][_0x4581('0x23')]);}return _0x39ddd4[_0x4581('0x54')](_0x4ba62b);}})[_0x4581('0x2a')](function(_0x8495fe){if(_0x8495fe){return _0x8495fe?{'count':_0xac3603,'rows':_0x8495fe}:null;}})[_0x4581('0x2a')](respondWithResult(_0x313d3a,null))[_0x4581('0x4e')](handleError(_0x313d3a,null));}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js index d428dde..d5efb83 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 _0x48ac=['../../config/environment','./intServicenowConfiguration.attributes','exports','int_servicenow_configurations','util','api','moment','bluebird','path','rimraf'];(function(_0x161d41,_0x306119){var _0x21daf6=function(_0x1429fa){while(--_0x1429fa){_0x161d41['push'](_0x161d41['shift']());}};_0x21daf6(++_0x306119);}(_0x48ac,0xe0));var _0xc48a=function(_0x228ea4,_0x455e60){_0x228ea4=_0x228ea4-0x0;var _0x2ca52c=_0x48ac[_0x228ea4];return _0x2ca52c;};'use strict';var _=require('lodash');var util=require(_0xc48a('0x0'));var logger=require('../../config/logger')(_0xc48a('0x1'));var moment=require(_0xc48a('0x2'));var BPromise=require(_0xc48a('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc48a('0x4'));var rimraf=require(_0xc48a('0x5'));var config=require(_0xc48a('0x6'));var attributes=require(_0xc48a('0x7'));module[_0xc48a('0x8')]=function(_0x499749,_0x48205f){return _0x499749['define']('ServicenowConfiguration',attributes,{'tableName':_0xc48a('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf894=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intServicenowConfiguration.attributes','exports','define','ServicenowConfiguration','int_servicenow_configurations','lodash','util'];(function(_0x245545,_0x4983b3){var _0x106a5f=function(_0x278277){while(--_0x278277){_0x245545['push'](_0x245545['shift']());}};_0x106a5f(++_0x4983b3);}(_0xf894,0xfd));var _0x4f89=function(_0x4f0e5c,_0x4f8b7d){_0x4f0e5c=_0x4f0e5c-0x0;var _0x66e0f0=_0xf894[_0x4f0e5c];return _0x66e0f0;};'use strict';var _=require(_0x4f89('0x0'));var util=require(_0x4f89('0x1'));var logger=require(_0x4f89('0x2'))(_0x4f89('0x3'));var moment=require(_0x4f89('0x4'));var BPromise=require(_0x4f89('0x5'));var rp=require(_0x4f89('0x6'));var fs=require('fs');var path=require(_0x4f89('0x7'));var rimraf=require(_0x4f89('0x8'));var config=require(_0x4f89('0x9'));var attributes=require(_0x4f89('0xa'));module[_0x4f89('0xb')]=function(_0x8837a0,_0x343593){return _0x8837a0[_0x4f89('0xc')](_0x4f89('0xd'),attributes,{'tableName':_0x4f89('0xe'),'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 8a7f11e..2ae0c9b 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 _0x7f9c=['message','info','result','catch','lodash','util','moment','bluebird','randomstring','rpc','../../config/environment','client','request','then','request\x20sent','stringify','error','code','ServicenowConfiguration,\x20%s,\x20%s'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x7f9c,0x9c));var _0xc7f9=function(_0x52ad1a,_0x2e14ab){_0x52ad1a=_0x52ad1a-0x0;var _0xd3fc7d=_0x7f9c[_0x52ad1a];return _0xd3fc7d;};'use strict';var _=require(_0xc7f9('0x0'));var util=require(_0xc7f9('0x1'));var moment=require(_0xc7f9('0x2'));var BPromise=require(_0xc7f9('0x3'));var rs=require(_0xc7f9('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xc7f9('0x5'));var config=require(_0xc7f9('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xc7f9('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x54f1f2,_0x153a92,_0x263f2d){return new BPromise(function(_0x5637fc,_0xfab036){return client[_0xc7f9('0x8')](_0x54f1f2,_0x263f2d)[_0xc7f9('0x9')](function(_0x399b92){logger['info']('ServicenowConfiguration,\x20%s,\x20%s',_0x153a92,_0xc7f9('0xa'));logger['debug']('ServicenowConfiguration,\x20%s,\x20%s,\x20%s',_0x153a92,_0xc7f9('0xa'),JSON[_0xc7f9('0xb')](_0x399b92));if(_0x399b92[_0xc7f9('0xc')]){if(_0x399b92[_0xc7f9('0xc')][_0xc7f9('0xd')]===0x1f4){logger[_0xc7f9('0xc')](_0xc7f9('0xe'),_0x153a92,_0x399b92['error'][_0xc7f9('0xf')]);return _0xfab036(_0x399b92[_0xc7f9('0xc')][_0xc7f9('0xf')]);}logger[_0xc7f9('0xc')](_0xc7f9('0xe'),_0x153a92,_0x399b92[_0xc7f9('0xc')][_0xc7f9('0xf')]);return _0x5637fc(_0x399b92[_0xc7f9('0xc')][_0xc7f9('0xf')]);}else{logger[_0xc7f9('0x10')]('ServicenowConfiguration,\x20%s,\x20%s',_0x153a92,'request\x20sent');_0x5637fc(_0x399b92[_0xc7f9('0x11')]['message']);}})[_0xc7f9('0x12')](function(_0xc2be79){logger[_0xc7f9('0xc')](_0xc7f9('0xe'),_0x153a92,_0xc2be79);_0xfab036(_0xc2be79);});});} \ No newline at end of file +var _0xbcf0=['then','info','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x5c3ae9,_0x450f9a){var _0x3f5950=function(_0x594c1f){while(--_0x594c1f){_0x5c3ae9['push'](_0x5c3ae9['shift']());}};_0x3f5950(++_0x450f9a);}(_0xbcf0,0xdb));var _0x0bcf=function(_0xaa0309,_0x1c8008){_0xaa0309=_0xaa0309-0x0;var _0x5de7ce=_0xbcf0[_0xaa0309];return _0x5de7ce;};'use strict';var _=require('lodash');var util=require(_0x0bcf('0x0'));var moment=require(_0x0bcf('0x1'));var BPromise=require(_0x0bcf('0x2'));var rs=require(_0x0bcf('0x3'));var fs=require('fs');var Redis=require(_0x0bcf('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x0bcf('0x5'));var logger=require(_0x0bcf('0x6'))(_0x0bcf('0x7'));var config=require(_0x0bcf('0x8'));var jayson=require(_0x0bcf('0x9'));var client=jayson['client'][_0x0bcf('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x21ec59,_0x1af427,_0x161c49){return new BPromise(function(_0x5ee03a,_0x2684b0){return client['request'](_0x21ec59,_0x161c49)[_0x0bcf('0xb')](function(_0x8bd8a){logger[_0x0bcf('0xc')](_0x0bcf('0xd'),_0x1af427,_0x0bcf('0xe'));logger[_0x0bcf('0xf')](_0x0bcf('0x10'),_0x1af427,_0x0bcf('0xe'),JSON[_0x0bcf('0x11')](_0x8bd8a));if(_0x8bd8a[_0x0bcf('0x12')]){if(_0x8bd8a[_0x0bcf('0x12')][_0x0bcf('0x13')]===0x1f4){logger[_0x0bcf('0x12')](_0x0bcf('0xd'),_0x1af427,_0x8bd8a['error'][_0x0bcf('0x14')]);return _0x2684b0(_0x8bd8a[_0x0bcf('0x12')][_0x0bcf('0x14')]);}logger[_0x0bcf('0x12')](_0x0bcf('0xd'),_0x1af427,_0x8bd8a[_0x0bcf('0x12')][_0x0bcf('0x14')]);return _0x5ee03a(_0x8bd8a[_0x0bcf('0x12')][_0x0bcf('0x14')]);}else{logger['info'](_0x0bcf('0xd'),_0x1af427,_0x0bcf('0xe'));_0x5ee03a(_0x8bd8a[_0x0bcf('0x15')]['message']);}})[_0x0bcf('0x16')](function(_0x5b2173){logger[_0x0bcf('0x12')]('ServicenowConfiguration,\x20%s,\x20%s',_0x1af427,_0x5b2173);_0x2684b0(_0x5b2173);});});} \ No newline at end of file diff --git a/server/api/intServicenowField/index.js b/server/api/intServicenowField/index.js index 1a89cf8..ebf831e 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 _0x50a9=['index','show','post','create','put','/:id','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated'];(function(_0x2a4095,_0x13f4f0){var _0x52eeab=function(_0x3950dd){while(--_0x3950dd){_0x2a4095['push'](_0x2a4095['shift']());}};_0x52eeab(++_0x13f4f0);}(_0x50a9,0x171));var _0x950a=function(_0x26db0b,_0x4fd5b0){_0x26db0b=_0x26db0b-0x0;var _0x19a034=_0x50a9[_0x26db0b];return _0x19a034;};'use strict';var multer=require(_0x950a('0x0'));var util=require(_0x950a('0x1'));var path=require(_0x950a('0x2'));var timeout=require('connect-timeout');var express=require(_0x950a('0x3'));var router=express[_0x950a('0x4')]();var fs_extra=require(_0x950a('0x5'));var auth=require(_0x950a('0x6'));var interaction=require(_0x950a('0x7'));var config=require(_0x950a('0x8'));var controller=require('./intServicenowField.controller');router[_0x950a('0x9')]('/',auth[_0x950a('0xa')](),controller[_0x950a('0xb')]);router['get']('/:id',auth[_0x950a('0xa')](),controller[_0x950a('0xc')]);router[_0x950a('0xd')]('/',auth[_0x950a('0xa')](),controller[_0x950a('0xe')]);router[_0x950a('0xf')](_0x950a('0x10'),auth[_0x950a('0xa')](),controller['update']);router['delete'](_0x950a('0x10'),auth[_0x950a('0xa')](),controller[_0x950a('0x11')]);module[_0x950a('0x12')]=router; \ No newline at end of file +var _0x4fa0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowField.controller','get','isAuthenticated','/:id','create','put','update','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x276480,_0x54aa01){var _0x26d6be=function(_0x49a62d){while(--_0x49a62d){_0x276480['push'](_0x276480['shift']());}};_0x26d6be(++_0x54aa01);}(_0x4fa0,0x1b0));var _0x04fa=function(_0x316af7,_0x72e80c){_0x316af7=_0x316af7-0x0;var _0x286d96=_0x4fa0[_0x316af7];return _0x286d96;};'use strict';var multer=require(_0x04fa('0x0'));var util=require(_0x04fa('0x1'));var path=require(_0x04fa('0x2'));var timeout=require(_0x04fa('0x3'));var express=require(_0x04fa('0x4'));var router=express[_0x04fa('0x5')]();var fs_extra=require(_0x04fa('0x6'));var auth=require(_0x04fa('0x7'));var interaction=require(_0x04fa('0x8'));var config=require(_0x04fa('0x9'));var controller=require(_0x04fa('0xa'));router[_0x04fa('0xb')]('/',auth[_0x04fa('0xc')](),controller['index']);router['get'](_0x04fa('0xd'),auth[_0x04fa('0xc')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0x04fa('0xe')]);router[_0x04fa('0xf')]('/:id',auth[_0x04fa('0xc')](),controller[_0x04fa('0x10')]);router['delete'](_0x04fa('0xd'),auth[_0x04fa('0xc')](),controller[_0x04fa('0x11')]);module[_0x04fa('0x12')]=router; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.attributes.js b/server/api/intServicenowField/intServicenowField.attributes.js index 185496e..0eeb86f 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 _0x603d=['variable','customVariable','keyValue','picklist','STRING','BOOLEAN','sequelize','string'];(function(_0x1d8ef8,_0x16b97c){var _0x300e78=function(_0x510c8b){while(--_0x510c8b){_0x1d8ef8['push'](_0x1d8ef8['shift']());}};_0x300e78(++_0x16b97c);}(_0x603d,0x15e));var _0xd603=function(_0x4a0fc8,_0x1819f3){_0x4a0fc8=_0x4a0fc8-0x0;var _0x46403b=_0x603d[_0x4a0fc8];return _0x46403b;};'use strict';var Sequelize=require(_0xd603('0x0'));module['exports']={'type':{'type':Sequelize['ENUM'](_0xd603('0x1'),_0xd603('0x2'),_0xd603('0x3'),_0xd603('0x4'),_0xd603('0x5')),'defaultValue':_0xd603('0x1')},'content':{'type':Sequelize[_0xd603('0x6')]},'key':{'type':Sequelize[_0xd603('0x6')]},'keyType':{'type':Sequelize['ENUM'](_0xd603('0x1'),_0xd603('0x2'),_0xd603('0x3'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xd603('0x6')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0xd603('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xd603('0x6')]}}; \ No newline at end of file +var _0xc824=['BOOLEAN','exports','ENUM','string','variable','customVariable','keyValue','picklist','STRING'];(function(_0xab6091,_0x216d13){var _0x26f486=function(_0x3e49c1){while(--_0x3e49c1){_0xab6091['push'](_0xab6091['shift']());}};_0x26f486(++_0x216d13);}(_0xc824,0x64));var _0x4c82=function(_0x34e5a4,_0x307401){_0x34e5a4=_0x34e5a4-0x0;var _0x3d77a7=_0xc824[_0x34e5a4];return _0x3d77a7;};'use strict';var Sequelize=require('sequelize');module[_0x4c82('0x0')]={'type':{'type':Sequelize[_0x4c82('0x1')](_0x4c82('0x2'),_0x4c82('0x3'),_0x4c82('0x4'),_0x4c82('0x5'),_0x4c82('0x6')),'defaultValue':'string'},'content':{'type':Sequelize[_0x4c82('0x7')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x4c82('0x1')]('string','variable',_0x4c82('0x4'))},'keyContent':{'type':Sequelize[_0x4c82('0x7')]},'idField':{'type':Sequelize[_0x4c82('0x7')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x4c82('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x4c82('0x7')]}}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.controller.js b/server/api/intServicenowField/intServicenowField.controller.js index a391a4e..2b94204 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 _0x8206=['limit','undefined','count','reject','save','update','then','destroy','error','stack','name','send','index','map','fieldName','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','filters','pick','merge','where','type','VIRTUAL','options','ServicenowField','includeAll','include','findAll','rows','catch','show','rawAttributes','length','find','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','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/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset'];(function(_0x1f1e29,_0x222430){var _0x1d1b00=function(_0x2ffc7d){while(--_0x2ffc7d){_0x1f1e29['push'](_0x1f1e29['shift']());}};_0x1d1b00(++_0x222430);}(_0x8206,0x7a));var _0x6820=function(_0x3aaf97,_0x4fa2e8){_0x3aaf97=_0x3aaf97-0x0;var _0xeba75e=_0x8206[_0x3aaf97];return _0xeba75e;};'use strict';var emlformat=require(_0x6820('0x0'));var rimraf=require(_0x6820('0x1'));var zipdir=require(_0x6820('0x2'));var jsonpatch=require(_0x6820('0x3'));var rp=require('request-promise');var moment=require(_0x6820('0x4'));var BPromise=require(_0x6820('0x5'));var Mustache=require('mustache');var util=require(_0x6820('0x6'));var path=require(_0x6820('0x7'));var sox=require('sox');var csv=require(_0x6820('0x8'));var ejs=require(_0x6820('0x9'));var fs=require('fs');var fs_extra=require(_0x6820('0xa'));var _=require('lodash');var squel=require(_0x6820('0xb'));var crypto=require(_0x6820('0xc'));var jsforce=require(_0x6820('0xd'));var deskjs=require(_0x6820('0xe'));var toCsv=require(_0x6820('0x8'));var querystring=require(_0x6820('0xf'));var Papa=require(_0x6820('0x10'));var Redis=require(_0x6820('0x11'));var authService=require(_0x6820('0x12'));var qs=require(_0x6820('0x13'));var as=require(_0x6820('0x14'));var hardwareService=require(_0x6820('0x15'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x6820('0x16'));var licenseUtil=require(_0x6820('0x17'));var db=require(_0x6820('0x18'))['db'];function respondWithStatusCode(_0x1c2cd3,_0xb278eb){_0xb278eb=_0xb278eb||0xcc;return function(_0x4bca07){if(_0x4bca07){return _0x1c2cd3[_0x6820('0x19')](_0xb278eb);}return _0x1c2cd3[_0x6820('0x1a')](_0xb278eb)[_0x6820('0x1b')]();};}function respondWithResult(_0x34a539,_0x5ab72d){_0x5ab72d=_0x5ab72d||0xc8;return function(_0x12e3aa){if(_0x12e3aa){return _0x34a539[_0x6820('0x1a')](_0x5ab72d)[_0x6820('0x1c')](_0x12e3aa);}};}function respondWithFilteredResult(_0x5175a5,_0x48da2d){return function(_0x89da1b){if(_0x89da1b){var _0x266eb7=typeof _0x48da2d[_0x6820('0x1d')]==='undefined'&&typeof _0x48da2d[_0x6820('0x1e')]===_0x6820('0x1f');var _0x130511=_0x89da1b[_0x6820('0x20')];var _0x571912=_0x266eb7?0x0:_0x48da2d[_0x6820('0x1d')];var _0x598421=_0x266eb7?_0x89da1b['count']:_0x48da2d[_0x6820('0x1d')]+_0x48da2d[_0x6820('0x1e')];var _0x1311f9;if(_0x598421>=_0x130511){_0x598421=_0x130511;_0x1311f9=0xc8;}else{_0x1311f9=0xce;}_0x5175a5['status'](_0x1311f9);return _0x5175a5['set']('Content-Range',_0x571912+'-'+_0x598421+'/'+_0x130511)['json'](_0x89da1b);}return null;};}function patchUpdates(_0x4225af){return function(_0x10b026){try{jsonpatch['apply'](_0x10b026,_0x4225af,!![]);}catch(_0x21143e){return BPromise[_0x6820('0x21')](_0x21143e);}return _0x10b026[_0x6820('0x22')]();};}function saveUpdates(_0x550e00,_0x2a165f){return function(_0x12510c){if(_0x12510c){return _0x12510c[_0x6820('0x23')](_0x550e00)[_0x6820('0x24')](function(_0x3c5320){return _0x3c5320;});}return null;};}function removeEntity(_0x2a4986,_0x36b054){return function(_0x1e3a2a){if(_0x1e3a2a){return _0x1e3a2a[_0x6820('0x25')]()['then'](function(){_0x2a4986[_0x6820('0x1a')](0xcc)[_0x6820('0x1b')]();});}};}function handleEntityNotFound(_0x43418e,_0x556c3f){return function(_0x42f627){if(!_0x42f627){_0x43418e[_0x6820('0x19')](0x194);}return _0x42f627;};}function handleError(_0x11d9a6,_0x58421a){_0x58421a=_0x58421a||0x1f4;return function(_0x970d53){logger[_0x6820('0x26')](_0x970d53[_0x6820('0x27')]);if(_0x970d53['name']){delete _0x970d53[_0x6820('0x28')];}_0x11d9a6['status'](_0x58421a)[_0x6820('0x29')](_0x970d53);};}exports[_0x6820('0x2a')]=function(_0x461b19,_0x464e4d){var _0x5d01e0={},_0x1c88d5={},_0x53d239={'count':0x0,'rows':[]};var _0x4f2ffc=_[_0x6820('0x2b')](db['ServicenowField']['rawAttributes'],function(_0x7330ab){return{'name':_0x7330ab[_0x6820('0x2c')],'type':_0x7330ab['type'][_0x6820('0x2d')]};});_0x1c88d5[_0x6820('0x2e')]=_[_0x6820('0x2b')](_0x4f2ffc,_0x6820('0x28'));_0x1c88d5[_0x6820('0x2f')]=_[_0x6820('0x30')](_0x461b19[_0x6820('0x2f')]);_0x1c88d5['filters']=_[_0x6820('0x31')](_0x1c88d5[_0x6820('0x2e')],_0x1c88d5[_0x6820('0x2f')]);_0x5d01e0[_0x6820('0x32')]=_[_0x6820('0x31')](_0x1c88d5[_0x6820('0x2e')],qs[_0x6820('0x33')](_0x461b19[_0x6820('0x2f')][_0x6820('0x33')]));_0x5d01e0['attributes']=_0x5d01e0['attributes']['length']?_0x5d01e0['attributes']:_0x1c88d5['model'];if(!_0x461b19[_0x6820('0x2f')][_0x6820('0x34')](_0x6820('0x35'))){_0x5d01e0[_0x6820('0x1e')]=qs[_0x6820('0x1e')](_0x461b19[_0x6820('0x2f')][_0x6820('0x1e')]);_0x5d01e0[_0x6820('0x1d')]=qs[_0x6820('0x1d')](_0x461b19['query'][_0x6820('0x1d')]);}_0x5d01e0[_0x6820('0x36')]=qs[_0x6820('0x37')](_0x461b19['query'][_0x6820('0x37')]);_0x5d01e0['where']=qs[_0x6820('0x38')](_[_0x6820('0x39')](_0x461b19[_0x6820('0x2f')],_0x1c88d5[_0x6820('0x38')]),_0x4f2ffc);if(_0x461b19[_0x6820('0x2f')]['filter']){_0x5d01e0['where']=_[_0x6820('0x3a')](_0x5d01e0[_0x6820('0x3b')],{'$or':_[_0x6820('0x2b')](_0x4f2ffc,function(_0x3a573f){if(_0x3a573f[_0x6820('0x3c')]!==_0x6820('0x3d')){var _0x106d7f={};_0x106d7f[_0x3a573f['name']]={'$like':'%'+_0x461b19[_0x6820('0x2f')]['filter']+'%'};return _0x106d7f;}})});}_0x5d01e0=_[_0x6820('0x3a')]({},_0x5d01e0,_0x461b19[_0x6820('0x3e')]);var _0x5df977={'where':_0x5d01e0[_0x6820('0x3b')]};return db[_0x6820('0x3f')][_0x6820('0x20')](_0x5df977)['then'](function(_0x316942){_0x53d239[_0x6820('0x20')]=_0x316942;if(_0x461b19[_0x6820('0x2f')][_0x6820('0x40')]){_0x5d01e0[_0x6820('0x41')]=[{'all':!![]}];}return db[_0x6820('0x3f')][_0x6820('0x42')](_0x5d01e0);})[_0x6820('0x24')](function(_0x10cf32){_0x53d239[_0x6820('0x43')]=_0x10cf32;return _0x53d239;})[_0x6820('0x24')](respondWithFilteredResult(_0x464e4d,_0x5d01e0))[_0x6820('0x44')](handleError(_0x464e4d,null));};exports[_0x6820('0x45')]=function(_0x2bd82f,_0x5e0019){var _0x2c8d4c={'raw':!![],'where':{'id':_0x2bd82f['params']['id']}},_0x6e7f0b={};_0x6e7f0b[_0x6820('0x2e')]=_[_0x6820('0x30')](db[_0x6820('0x3f')][_0x6820('0x46')]);_0x6e7f0b[_0x6820('0x2f')]=_[_0x6820('0x30')](_0x2bd82f['query']);_0x6e7f0b[_0x6820('0x38')]=_[_0x6820('0x31')](_0x6e7f0b[_0x6820('0x2e')],_0x6e7f0b[_0x6820('0x2f')]);_0x2c8d4c[_0x6820('0x32')]=_[_0x6820('0x31')](_0x6e7f0b['model'],qs[_0x6820('0x33')](_0x2bd82f['query']['fields']));_0x2c8d4c['attributes']=_0x2c8d4c[_0x6820('0x32')][_0x6820('0x47')]?_0x2c8d4c[_0x6820('0x32')]:_0x6e7f0b['model'];if(_0x2bd82f[_0x6820('0x2f')][_0x6820('0x40')]){_0x2c8d4c[_0x6820('0x41')]=[{'all':!![]}];}_0x2c8d4c=_[_0x6820('0x3a')]({},_0x2c8d4c,_0x2bd82f[_0x6820('0x3e')]);return db[_0x6820('0x3f')][_0x6820('0x48')](_0x2c8d4c)[_0x6820('0x24')](handleEntityNotFound(_0x5e0019,null))[_0x6820('0x24')](respondWithResult(_0x5e0019,null))[_0x6820('0x44')](handleError(_0x5e0019,null));};exports['create']=function(_0x3d020c,_0x54b42c){return db[_0x6820('0x3f')][_0x6820('0x49')](_0x3d020c[_0x6820('0x4a')],{})['then'](respondWithResult(_0x54b42c,0xc9))[_0x6820('0x44')](handleError(_0x54b42c,null));};exports['update']=function(_0x9588a4,_0x103fba){if(_0x9588a4[_0x6820('0x4a')]['id']){delete _0x9588a4[_0x6820('0x4a')]['id'];}return db[_0x6820('0x3f')][_0x6820('0x48')]({'where':{'id':_0x9588a4[_0x6820('0x4b')]['id']}})[_0x6820('0x24')](handleEntityNotFound(_0x103fba,null))[_0x6820('0x24')](saveUpdates(_0x9588a4[_0x6820('0x4a')],null))[_0x6820('0x24')](respondWithResult(_0x103fba,null))['catch'](handleError(_0x103fba,null));};exports['destroy']=function(_0x50ebb5,_0x2a55dc){return db['ServicenowField'][_0x6820('0x48')]({'where':{'id':_0x50ebb5[_0x6820('0x4b')]['id']}})[_0x6820('0x24')](handleEntityNotFound(_0x2a55dc,null))['then'](removeEntity(_0x2a55dc,null))[_0x6820('0x44')](handleError(_0x2a55dc,null));}; \ No newline at end of file +var _0xc8c0=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','count','offset','Content-Range','reject','update','then','destroy','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','key','query','keys','filters','model','attributes','intersection','fields','length','nolimit','limit','sort','pick','merge','where','type','VIRTUAL','filter','options','ServicenowField','includeAll','include','findAll','rows','show','params','catch','create','find','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis'];(function(_0x10f6e8,_0x351db6){var _0x35bb3c=function(_0x30a39b){while(--_0x30a39b){_0x10f6e8['push'](_0x10f6e8['shift']());}};_0x35bb3c(++_0x351db6);}(_0xc8c0,0x8b));var _0x0c8c=function(_0x85a9c2,_0x5d0c93){_0x85a9c2=_0x85a9c2-0x0;var _0x16ecd5=_0xc8c0[_0x85a9c2];return _0x16ecd5;};'use strict';var emlformat=require(_0x0c8c('0x0'));var rimraf=require(_0x0c8c('0x1'));var zipdir=require(_0x0c8c('0x2'));var jsonpatch=require(_0x0c8c('0x3'));var rp=require(_0x0c8c('0x4'));var moment=require(_0x0c8c('0x5'));var BPromise=require(_0x0c8c('0x6'));var Mustache=require(_0x0c8c('0x7'));var util=require('util');var path=require(_0x0c8c('0x8'));var sox=require(_0x0c8c('0x9'));var csv=require('to-csv');var ejs=require(_0x0c8c('0xa'));var fs=require('fs');var fs_extra=require(_0x0c8c('0xb'));var _=require(_0x0c8c('0xc'));var squel=require(_0x0c8c('0xd'));var crypto=require(_0x0c8c('0xe'));var jsforce=require(_0x0c8c('0xf'));var deskjs=require(_0x0c8c('0x10'));var toCsv=require(_0x0c8c('0x11'));var querystring=require(_0x0c8c('0x12'));var Papa=require(_0x0c8c('0x13'));var Redis=require(_0x0c8c('0x14'));var authService=require(_0x0c8c('0x15'));var qs=require(_0x0c8c('0x16'));var as=require(_0x0c8c('0x17'));var hardwareService=require(_0x0c8c('0x18'));var logger=require(_0x0c8c('0x19'))('api');var utils=require(_0x0c8c('0x1a'));var config=require(_0x0c8c('0x1b'));var licenseUtil=require(_0x0c8c('0x1c'));var db=require(_0x0c8c('0x1d'))['db'];function respondWithStatusCode(_0xe484e5,_0xe87b4c){_0xe87b4c=_0xe87b4c||0xcc;return function(_0x5b2cc5){if(_0x5b2cc5){return _0xe484e5['sendStatus'](_0xe87b4c);}return _0xe484e5[_0x0c8c('0x1e')](_0xe87b4c)[_0x0c8c('0x1f')]();};}function respondWithResult(_0x3ce358,_0x449543){_0x449543=_0x449543||0xc8;return function(_0x50016d){if(_0x50016d){return _0x3ce358['status'](_0x449543)[_0x0c8c('0x20')](_0x50016d);}};}function respondWithFilteredResult(_0x6f59ed,_0x5396f0){return function(_0x4504c1){if(_0x4504c1){var _0x532d5f=typeof _0x5396f0['offset']==='undefined'&&typeof _0x5396f0['limit']===_0x0c8c('0x21');var _0x1ae95a=_0x4504c1[_0x0c8c('0x22')];var _0x1a63ad=_0x532d5f?0x0:_0x5396f0['offset'];var _0x41fe92=_0x532d5f?_0x4504c1['count']:_0x5396f0[_0x0c8c('0x23')]+_0x5396f0['limit'];var _0x3faaa7;if(_0x41fe92>=_0x1ae95a){_0x41fe92=_0x1ae95a;_0x3faaa7=0xc8;}else{_0x3faaa7=0xce;}_0x6f59ed['status'](_0x3faaa7);return _0x6f59ed['set'](_0x0c8c('0x24'),_0x1a63ad+'-'+_0x41fe92+'/'+_0x1ae95a)[_0x0c8c('0x20')](_0x4504c1);}return null;};}function patchUpdates(_0x16ca06){return function(_0x237f1d){try{jsonpatch['apply'](_0x237f1d,_0x16ca06,!![]);}catch(_0x2c6be3){return BPromise[_0x0c8c('0x25')](_0x2c6be3);}return _0x237f1d['save']();};}function saveUpdates(_0x236d76,_0x52dca1){return function(_0x1c4bbe){if(_0x1c4bbe){return _0x1c4bbe[_0x0c8c('0x26')](_0x236d76)[_0x0c8c('0x27')](function(_0x48d115){return _0x48d115;});}return null;};}function removeEntity(_0x14eae5,_0xa33f03){return function(_0x1d85e9){if(_0x1d85e9){return _0x1d85e9[_0x0c8c('0x28')]()[_0x0c8c('0x27')](function(){_0x14eae5[_0x0c8c('0x1e')](0xcc)[_0x0c8c('0x1f')]();});}};}function handleEntityNotFound(_0x4d8014,_0x433a74){return function(_0x26ed58){if(!_0x26ed58){_0x4d8014[_0x0c8c('0x29')](0x194);}return _0x26ed58;};}function handleError(_0x14ea1d,_0xc36029){_0xc36029=_0xc36029||0x1f4;return function(_0x1bf5a6){logger[_0x0c8c('0x2a')](_0x1bf5a6[_0x0c8c('0x2b')]);if(_0x1bf5a6[_0x0c8c('0x2c')]){delete _0x1bf5a6[_0x0c8c('0x2c')];}_0x14ea1d[_0x0c8c('0x1e')](_0xc36029)[_0x0c8c('0x2d')](_0x1bf5a6);};}exports[_0x0c8c('0x2e')]=function(_0x331be5,_0x25e367){var _0x21026b={},_0x4c683f={},_0x5b1dc4={'count':0x0,'rows':[]};var _0x21e6af=_[_0x0c8c('0x2f')](db['ServicenowField'][_0x0c8c('0x30')],function(_0x27817f){return{'name':_0x27817f[_0x0c8c('0x31')],'type':_0x27817f['type'][_0x0c8c('0x32')]};});_0x4c683f['model']=_['map'](_0x21e6af,'name');_0x4c683f[_0x0c8c('0x33')]=_[_0x0c8c('0x34')](_0x331be5[_0x0c8c('0x33')]);_0x4c683f[_0x0c8c('0x35')]=_['intersection'](_0x4c683f[_0x0c8c('0x36')],_0x4c683f[_0x0c8c('0x33')]);_0x21026b[_0x0c8c('0x37')]=_[_0x0c8c('0x38')](_0x4c683f[_0x0c8c('0x36')],qs[_0x0c8c('0x39')](_0x331be5[_0x0c8c('0x33')][_0x0c8c('0x39')]));_0x21026b[_0x0c8c('0x37')]=_0x21026b[_0x0c8c('0x37')][_0x0c8c('0x3a')]?_0x21026b['attributes']:_0x4c683f[_0x0c8c('0x36')];if(!_0x331be5[_0x0c8c('0x33')]['hasOwnProperty'](_0x0c8c('0x3b'))){_0x21026b[_0x0c8c('0x3c')]=qs[_0x0c8c('0x3c')](_0x331be5[_0x0c8c('0x33')]['limit']);_0x21026b[_0x0c8c('0x23')]=qs[_0x0c8c('0x23')](_0x331be5[_0x0c8c('0x33')][_0x0c8c('0x23')]);}_0x21026b['order']=qs['sort'](_0x331be5['query'][_0x0c8c('0x3d')]);_0x21026b['where']=qs['filters'](_[_0x0c8c('0x3e')](_0x331be5['query'],_0x4c683f[_0x0c8c('0x35')]),_0x21e6af);if(_0x331be5[_0x0c8c('0x33')]['filter']){_0x21026b['where']=_[_0x0c8c('0x3f')](_0x21026b[_0x0c8c('0x40')],{'$or':_['map'](_0x21e6af,function(_0x43d87f){if(_0x43d87f[_0x0c8c('0x41')]!==_0x0c8c('0x42')){var _0x426a55={};_0x426a55[_0x43d87f[_0x0c8c('0x2c')]]={'$like':'%'+_0x331be5[_0x0c8c('0x33')][_0x0c8c('0x43')]+'%'};return _0x426a55;}})});}_0x21026b=_[_0x0c8c('0x3f')]({},_0x21026b,_0x331be5[_0x0c8c('0x44')]);var _0x4f023c={'where':_0x21026b[_0x0c8c('0x40')]};return db[_0x0c8c('0x45')][_0x0c8c('0x22')](_0x4f023c)[_0x0c8c('0x27')](function(_0x30f9b0){_0x5b1dc4[_0x0c8c('0x22')]=_0x30f9b0;if(_0x331be5[_0x0c8c('0x33')][_0x0c8c('0x46')]){_0x21026b[_0x0c8c('0x47')]=[{'all':!![]}];}return db['ServicenowField'][_0x0c8c('0x48')](_0x21026b);})[_0x0c8c('0x27')](function(_0x200bd1){_0x5b1dc4[_0x0c8c('0x49')]=_0x200bd1;return _0x5b1dc4;})[_0x0c8c('0x27')](respondWithFilteredResult(_0x25e367,_0x21026b))['catch'](handleError(_0x25e367,null));};exports[_0x0c8c('0x4a')]=function(_0x411cb2,_0x13ba64){var _0x2abc3f={'raw':!![],'where':{'id':_0x411cb2[_0x0c8c('0x4b')]['id']}},_0x98e6b1={};_0x98e6b1['model']=_['keys'](db['ServicenowField'][_0x0c8c('0x30')]);_0x98e6b1['query']=_[_0x0c8c('0x34')](_0x411cb2['query']);_0x98e6b1[_0x0c8c('0x35')]=_[_0x0c8c('0x38')](_0x98e6b1['model'],_0x98e6b1[_0x0c8c('0x33')]);_0x2abc3f[_0x0c8c('0x37')]=_[_0x0c8c('0x38')](_0x98e6b1[_0x0c8c('0x36')],qs['fields'](_0x411cb2[_0x0c8c('0x33')]['fields']));_0x2abc3f[_0x0c8c('0x37')]=_0x2abc3f[_0x0c8c('0x37')][_0x0c8c('0x3a')]?_0x2abc3f[_0x0c8c('0x37')]:_0x98e6b1[_0x0c8c('0x36')];if(_0x411cb2[_0x0c8c('0x33')][_0x0c8c('0x46')]){_0x2abc3f[_0x0c8c('0x47')]=[{'all':!![]}];}_0x2abc3f=_[_0x0c8c('0x3f')]({},_0x2abc3f,_0x411cb2['options']);return db[_0x0c8c('0x45')]['find'](_0x2abc3f)[_0x0c8c('0x27')](handleEntityNotFound(_0x13ba64,null))[_0x0c8c('0x27')](respondWithResult(_0x13ba64,null))[_0x0c8c('0x4c')](handleError(_0x13ba64,null));};exports[_0x0c8c('0x4d')]=function(_0x3a1765,_0x3bb8aa){return db['ServicenowField'][_0x0c8c('0x4d')](_0x3a1765['body'],{})[_0x0c8c('0x27')](respondWithResult(_0x3bb8aa,0xc9))[_0x0c8c('0x4c')](handleError(_0x3bb8aa,null));};exports[_0x0c8c('0x26')]=function(_0x44688f,_0x4ad7e1){if(_0x44688f['body']['id']){delete _0x44688f['body']['id'];}return db['ServicenowField'][_0x0c8c('0x4e')]({'where':{'id':_0x44688f[_0x0c8c('0x4b')]['id']}})[_0x0c8c('0x27')](handleEntityNotFound(_0x4ad7e1,null))[_0x0c8c('0x27')](saveUpdates(_0x44688f[_0x0c8c('0x4f')],null))[_0x0c8c('0x27')](respondWithResult(_0x4ad7e1,null))['catch'](handleError(_0x4ad7e1,null));};exports[_0x0c8c('0x28')]=function(_0x8e9ab7,_0x35fd42){return db[_0x0c8c('0x45')][_0x0c8c('0x4e')]({'where':{'id':_0x8e9ab7[_0x0c8c('0x4b')]['id']}})[_0x0c8c('0x27')](handleEntityNotFound(_0x35fd42,null))[_0x0c8c('0x27')](removeEntity(_0x35fd42,null))[_0x0c8c('0x4c')](handleError(_0x35fd42,null));}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.model.js b/server/api/intServicenowField/intServicenowField.model.js index 69c64b4..86edb8a 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 _0xbd3d=['path','rimraf','./intServicenowField.attributes','define','ServicenowField','servicenow_unique_index','idField','lodash','util','../../config/logger','api','moment'];(function(_0x1b5c55,_0x2afae7){var _0x2489c9=function(_0x208282){while(--_0x208282){_0x1b5c55['push'](_0x1b5c55['shift']());}};_0x2489c9(++_0x2afae7);}(_0xbd3d,0xd3));var _0xdbd3=function(_0x7eb8b1,_0x361564){_0x7eb8b1=_0x7eb8b1-0x0;var _0x381f87=_0xbd3d[_0x7eb8b1];return _0x381f87;};'use strict';var _=require(_0xdbd3('0x0'));var util=require(_0xdbd3('0x1'));var logger=require(_0xdbd3('0x2'))(_0xdbd3('0x3'));var moment=require(_0xdbd3('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xdbd3('0x5'));var rimraf=require(_0xdbd3('0x6'));var config=require('../../config/environment');var attributes=require(_0xdbd3('0x7'));module['exports']=function(_0x28994a,_0x3e72c4){return _0x28994a[_0xdbd3('0x8')](_0xdbd3('0x9'),attributes,{'tableName':'int_servicenow_fields','paranoid':![],'indexes':[{'name':_0xdbd3('0xa'),'fields':[_0xdbd3('0xb'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x9d94=['FieldId','lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intServicenowField.attributes','exports','define','int_servicenow_fields','servicenow_unique_index','idField'];(function(_0x155697,_0xc1a1de){var _0x883a84=function(_0x4f92b8){while(--_0x4f92b8){_0x155697['push'](_0x155697['shift']());}};_0x883a84(++_0xc1a1de);}(_0x9d94,0x11e));var _0x49d9=function(_0x1893c8,_0x523b52){_0x1893c8=_0x1893c8-0x0;var _0x16f02e=_0x9d94[_0x1893c8];return _0x16f02e;};'use strict';var _=require(_0x49d9('0x0'));var util=require('util');var logger=require(_0x49d9('0x1'))('api');var moment=require(_0x49d9('0x2'));var BPromise=require(_0x49d9('0x3'));var rp=require(_0x49d9('0x4'));var fs=require('fs');var path=require(_0x49d9('0x5'));var rimraf=require(_0x49d9('0x6'));var config=require(_0x49d9('0x7'));var attributes=require(_0x49d9('0x8'));module[_0x49d9('0x9')]=function(_0x59428f,_0x385571){return _0x59428f[_0x49d9('0xa')]('ServicenowField',attributes,{'tableName':_0x49d9('0xb'),'paranoid':![],'indexes':[{'name':_0x49d9('0xc'),'fields':[_0x49d9('0xd'),_0x49d9('0xe')],'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 dbce5c3..d4879ff 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 _0x9bde=['code','message','ServicenowField,\x20%s,\x20%s','result','catch','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','debug','ServicenowField,\x20%s,\x20%s,\x20%s','request\x20sent','error'];(function(_0x31289d,_0x467c4d){var _0x426823=function(_0x87356f){while(--_0x87356f){_0x31289d['push'](_0x31289d['shift']());}};_0x426823(++_0x467c4d);}(_0x9bde,0xe1));var _0xe9bd=function(_0x3ccd90,_0x1a3d86){_0x3ccd90=_0x3ccd90-0x0;var _0xa95d2b=_0x9bde[_0x3ccd90];return _0xa95d2b;};'use strict';var _=require('lodash');var util=require(_0xe9bd('0x0'));var moment=require('moment');var BPromise=require(_0xe9bd('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe9bd('0x2'));var db=require(_0xe9bd('0x3'))['db'];var utils=require(_0xe9bd('0x4'));var logger=require(_0xe9bd('0x5'))(_0xe9bd('0x6'));var config=require(_0xe9bd('0x7'));var jayson=require(_0xe9bd('0x8'));var client=jayson['client'][_0xe9bd('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5f18fe,_0x22a438,_0xa66ae2){return new BPromise(function(_0x2d5c75,_0x3ef9e3){return client[_0xe9bd('0xa')](_0x5f18fe,_0xa66ae2)[_0xe9bd('0xb')](function(_0x439abc){logger[_0xe9bd('0xc')]('ServicenowField,\x20%s,\x20%s',_0x22a438,'request\x20sent');logger[_0xe9bd('0xd')](_0xe9bd('0xe'),_0x22a438,_0xe9bd('0xf'),JSON['stringify'](_0x439abc));if(_0x439abc[_0xe9bd('0x10')]){if(_0x439abc[_0xe9bd('0x10')][_0xe9bd('0x11')]===0x1f4){logger[_0xe9bd('0x10')]('ServicenowField,\x20%s,\x20%s',_0x22a438,_0x439abc[_0xe9bd('0x10')]['message']);return _0x3ef9e3(_0x439abc[_0xe9bd('0x10')][_0xe9bd('0x12')]);}logger[_0xe9bd('0x10')]('ServicenowField,\x20%s,\x20%s',_0x22a438,_0x439abc['error'][_0xe9bd('0x12')]);return _0x2d5c75(_0x439abc[_0xe9bd('0x10')][_0xe9bd('0x12')]);}else{logger[_0xe9bd('0xc')](_0xe9bd('0x13'),_0x22a438,_0xe9bd('0xf'));_0x2d5c75(_0x439abc[_0xe9bd('0x14')]['message']);}})[_0xe9bd('0x15')](function(_0x464a1b){logger[_0xe9bd('0x10')]('ServicenowField,\x20%s,\x20%s',_0x22a438,_0x464a1b);_0x3ef9e3(_0x464a1b);});});} \ No newline at end of file +var _0xb43b=['rpc','../../config/environment','http','request','info','request\x20sent','debug','ServicenowField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ServicenowField,\x20%s,\x20%s','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0x41d1a6,_0x3f996a){var _0x51f68a=function(_0x96ab3d){while(--_0x96ab3d){_0x41d1a6['push'](_0x41d1a6['shift']());}};_0x51f68a(++_0x3f996a);}(_0xb43b,0x1b2));var _0xbb43=function(_0x4b9624,_0xe7fb81){_0x4b9624=_0x4b9624-0x0;var _0x582490=_0xb43b[_0x4b9624];return _0x582490;};'use strict';var _=require(_0xbb43('0x0'));var util=require(_0xbb43('0x1'));var moment=require('moment');var BPromise=require(_0xbb43('0x2'));var rs=require(_0xbb43('0x3'));var fs=require('fs');var Redis=require(_0xbb43('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xbb43('0x5'));var logger=require(_0xbb43('0x6'))(_0xbb43('0x7'));var config=require(_0xbb43('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xbb43('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x553520,_0x80fe61,_0x1ccd49){return new BPromise(function(_0x2a2f11,_0x29ae1a){return client[_0xbb43('0xa')](_0x553520,_0x1ccd49)['then'](function(_0x208c2b){logger[_0xbb43('0xb')]('ServicenowField,\x20%s,\x20%s',_0x80fe61,_0xbb43('0xc'));logger[_0xbb43('0xd')](_0xbb43('0xe'),_0x80fe61,_0xbb43('0xc'),JSON[_0xbb43('0xf')](_0x208c2b));if(_0x208c2b[_0xbb43('0x10')]){if(_0x208c2b['error'][_0xbb43('0x11')]===0x1f4){logger[_0xbb43('0x10')]('ServicenowField,\x20%s,\x20%s',_0x80fe61,_0x208c2b['error'][_0xbb43('0x12')]);return _0x29ae1a(_0x208c2b['error']['message']);}logger[_0xbb43('0x10')]('ServicenowField,\x20%s,\x20%s',_0x80fe61,_0x208c2b[_0xbb43('0x10')][_0xbb43('0x12')]);return _0x2a2f11(_0x208c2b['error']['message']);}else{logger['info'](_0xbb43('0x13'),_0x80fe61,_0xbb43('0xc'));_0x2a2f11(_0x208c2b['result']['message']);}})[_0xbb43('0x14')](function(_0x563ce1){logger['error'](_0xbb43('0x13'),_0x80fe61,_0x563ce1);_0x29ae1a(_0x563ce1);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/index.js b/server/api/intSugarcrmAccount/index.js index 8bfe13e..77c538b 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(_0x300c86,_0x316eb3){var _0x4d9dd1=function(_0x267b3d){while(--_0x267b3d){_0x300c86['push'](_0x300c86['shift']());}};_0x4d9dd1(++_0x316eb3);}(_0x9957,0x93));var _0x7995=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x9957[_0x6c993a];return _0x27f547;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')]('/',auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x11')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x17')]);module[_0x7995('0x18')]=router; \ No newline at end of file +var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmAccount.controller','get','index','/:id','getConfigurations','/:id/fields','isAuthenticated','getFields','post','addConfiguration','put','update','destroy','exports','multer','util','path'];(function(_0x35d2ad,_0x17de1e){var _0x2ddfc2=function(_0x2f59ae){while(--_0x2f59ae){_0x35d2ad['push'](_0x35d2ad['shift']());}};_0x2ddfc2(++_0x17de1e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xa9e0[_0x2b4411];return _0x8e41ef;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/configurations',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);module[_0x0a9e('0x14')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js index 691c182..fc478b1 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(_0x4813f4,_0x1eecda){var _0x6f5f8f=function(_0x2ba2a9){while(--_0x2ba2a9){_0x4813f4['push'](_0x4813f4['shift']());}};_0x6f5f8f(++_0x1eecda);}(_0xa9e0,0x123));var _0x0a9e=function(_0x37c22c,_0x28a70d){_0x37c22c=_0x37c22c-0x0;var _0x119d79=_0xa9e0[_0x37c22c];return _0x119d79;};'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(_0x56bba4,_0x53bf3c){var _0x56b37e=function(_0x46bbdb){while(--_0x46bbdb){_0x56bba4['push'](_0x56bba4['shift']());}};_0x56b37e(++_0x53bf3c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x373dee,_0x1a8c45){_0x373dee=_0x373dee-0x0;var _0x46798f=_0xa9e0[_0x373dee];return _0x46798f;};'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 e9f1b8b..d813d1b 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 _0xf1e5=['eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','end','stack','name','send','map','SugarcrmAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','pick','where','VIRTUAL','filter','include','findAll','rows','catch','params','merge','find','body','getConfigurations','SugarcrmConfiguration','order','sort','options','addConfiguration','findOne','AccountId','Subjects','channel','Descriptions','getDescriptions','SugarcrmField','getFields','assigned_user_id','created_by','description','date_start','duration_hours','duration_minutes','parent_id','parent_name','username','remoteUri','slice','substring','lastIndexOf','POST','%s%s','/service/v4_1/rest.php','login','JSON','stringify','password','PLAIN','xCALLY\x20Motion\x20Integration','Invalid\x20Login','format','get_module_fields','Calls','remove','label','endsWith','values','value','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','test','Wrong\x20credentials'];(function(_0x1f1530,_0x91afaa){var _0x45f25f=function(_0x1636d2){while(--_0x1636d2){_0x1f1530['push'](_0x1f1530['shift']());}};_0x45f25f(++_0x91afaa);}(_0xf1e5,0x16b));var _0x5f1e=function(_0x302099,_0xe61dca){_0x302099=_0x302099-0x0;var _0x24a042=_0xf1e5[_0x302099];return _0x24a042;};'use strict';var emlformat=require(_0x5f1e('0x0'));var rimraf=require(_0x5f1e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x5f1e('0x2'));var moment=require('moment');var BPromise=require(_0x5f1e('0x3'));var Mustache=require(_0x5f1e('0x4'));var util=require(_0x5f1e('0x5'));var path=require(_0x5f1e('0x6'));var sox=require(_0x5f1e('0x7'));var csv=require(_0x5f1e('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5f1e('0x9'));var _=require(_0x5f1e('0xa'));var squel=require(_0x5f1e('0xb'));var crypto=require(_0x5f1e('0xc'));var jsforce=require(_0x5f1e('0xd'));var deskjs=require(_0x5f1e('0xe'));var toCsv=require(_0x5f1e('0x8'));var querystring=require('querystring');var Papa=require(_0x5f1e('0xf'));var Redis=require(_0x5f1e('0x10'));var authService=require(_0x5f1e('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x5f1e('0x12'));var hardwareService=require(_0x5f1e('0x13'));var logger=require('../../config/logger')(_0x5f1e('0x14'));var utils=require(_0x5f1e('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x5f1e('0x16'));var db=require(_0x5f1e('0x17'))['db'];var integrations=require(_0x5f1e('0x18'));function respondWithStatusCode(_0x496d5e,_0x1f03db){_0x1f03db=_0x1f03db||0xcc;return function(_0x2c27fd){if(_0x2c27fd){return _0x496d5e[_0x5f1e('0x19')](_0x1f03db);}return _0x496d5e[_0x5f1e('0x1a')](_0x1f03db)['end']();};}function respondWithResult(_0x341d9,_0x56952d){_0x56952d=_0x56952d||0xc8;return function(_0x4126c5){if(_0x4126c5){return _0x341d9[_0x5f1e('0x1a')](_0x56952d)[_0x5f1e('0x1b')](_0x4126c5);}};}function respondWithFilteredResult(_0x526441,_0x208e79){return function(_0x4c45ec){if(_0x4c45ec){var _0x18af52=typeof _0x208e79[_0x5f1e('0x1c')]===_0x5f1e('0x1d')&&typeof _0x208e79[_0x5f1e('0x1e')]===_0x5f1e('0x1d');var _0x11acd=_0x4c45ec[_0x5f1e('0x1f')];var _0x3d2fc6=_0x18af52?0x0:_0x208e79[_0x5f1e('0x1c')];var _0x4cde79=_0x18af52?_0x4c45ec[_0x5f1e('0x1f')]:_0x208e79[_0x5f1e('0x1c')]+_0x208e79[_0x5f1e('0x1e')];var _0x4dc579;if(_0x4cde79>=_0x11acd){_0x4cde79=_0x11acd;_0x4dc579=0xc8;}else{_0x4dc579=0xce;}_0x526441[_0x5f1e('0x1a')](_0x4dc579);return _0x526441[_0x5f1e('0x20')](_0x5f1e('0x21'),_0x3d2fc6+'-'+_0x4cde79+'/'+_0x11acd)[_0x5f1e('0x1b')](_0x4c45ec);}return null;};}function patchUpdates(_0x55a61f){return function(_0x175686){try{jsonpatch['apply'](_0x175686,_0x55a61f,!![]);}catch(_0x3211c5){return BPromise[_0x5f1e('0x22')](_0x3211c5);}return _0x175686[_0x5f1e('0x23')]();};}function saveUpdates(_0x309fa3,_0x4c25f6){return function(_0x398c90){if(_0x398c90){return _0x398c90[_0x5f1e('0x24')](_0x309fa3)[_0x5f1e('0x25')](function(_0x1c4849){return _0x1c4849;});}return null;};}function removeEntity(_0x20284f,_0x112853){return function(_0xb376c2){if(_0xb376c2){return _0xb376c2[_0x5f1e('0x26')]()[_0x5f1e('0x25')](function(){_0x20284f[_0x5f1e('0x1a')](0xcc)[_0x5f1e('0x27')]();});}};}function handleEntityNotFound(_0x5e9d08,_0x1eb578){return function(_0x22adbe){if(!_0x22adbe){_0x5e9d08[_0x5f1e('0x19')](0x194);}return _0x22adbe;};}function handleError(_0x2a5f85,_0x5d6d8e){_0x5d6d8e=_0x5d6d8e||0x1f4;return function(_0x477987){logger['error'](_0x477987[_0x5f1e('0x28')]);if(_0x477987[_0x5f1e('0x29')]){delete _0x477987[_0x5f1e('0x29')];}_0x2a5f85['status'](_0x5d6d8e)[_0x5f1e('0x2a')](_0x477987);};}exports['index']=function(_0x1f7969,_0x4ceee4){var _0x5d547b={},_0x3b9171={},_0xdafe1a={'count':0x0,'rows':[]};var _0x30f420=_[_0x5f1e('0x2b')](db[_0x5f1e('0x2c')][_0x5f1e('0x2d')],function(_0x3220ba){return{'name':_0x3220ba[_0x5f1e('0x2e')],'type':_0x3220ba[_0x5f1e('0x2f')][_0x5f1e('0x30')]};});_0x3b9171[_0x5f1e('0x31')]=_[_0x5f1e('0x2b')](_0x30f420,'name');_0x3b9171[_0x5f1e('0x32')]=_[_0x5f1e('0x33')](_0x1f7969[_0x5f1e('0x32')]);_0x3b9171[_0x5f1e('0x34')]=_[_0x5f1e('0x35')](_0x3b9171['model'],_0x3b9171[_0x5f1e('0x32')]);_0x5d547b[_0x5f1e('0x36')]=_[_0x5f1e('0x35')](_0x3b9171[_0x5f1e('0x31')],qs[_0x5f1e('0x37')](_0x1f7969['query']['fields']));_0x5d547b[_0x5f1e('0x36')]=_0x5d547b[_0x5f1e('0x36')][_0x5f1e('0x38')]?_0x5d547b[_0x5f1e('0x36')]:_0x3b9171[_0x5f1e('0x31')];if(!_0x1f7969[_0x5f1e('0x32')][_0x5f1e('0x39')](_0x5f1e('0x3a'))){_0x5d547b[_0x5f1e('0x1e')]=qs[_0x5f1e('0x1e')](_0x1f7969['query'][_0x5f1e('0x1e')]);_0x5d547b['offset']=qs['offset'](_0x1f7969[_0x5f1e('0x32')][_0x5f1e('0x1c')]);}_0x5d547b['order']=qs['sort'](_0x1f7969['query']['sort']);_0x5d547b['where']=qs[_0x5f1e('0x34')](_[_0x5f1e('0x3b')](_0x1f7969[_0x5f1e('0x32')],_0x3b9171['filters']),_0x30f420);if(_0x1f7969['query']['filter']){_0x5d547b[_0x5f1e('0x3c')]=_['merge'](_0x5d547b[_0x5f1e('0x3c')],{'$or':_[_0x5f1e('0x2b')](_0x30f420,function(_0x2112c5){if(_0x2112c5[_0x5f1e('0x2f')]!==_0x5f1e('0x3d')){var _0x1d5ad0={};_0x1d5ad0[_0x2112c5['name']]={'$like':'%'+_0x1f7969[_0x5f1e('0x32')][_0x5f1e('0x3e')]+'%'};return _0x1d5ad0;}})});}_0x5d547b=_['merge']({},_0x5d547b,_0x1f7969['options']);var _0x38b992={'where':_0x5d547b['where']};return db[_0x5f1e('0x2c')][_0x5f1e('0x1f')](_0x38b992)[_0x5f1e('0x25')](function(_0x118e22){_0xdafe1a[_0x5f1e('0x1f')]=_0x118e22;if(_0x1f7969[_0x5f1e('0x32')]['includeAll']){_0x5d547b[_0x5f1e('0x3f')]=[{'all':!![]}];}return db[_0x5f1e('0x2c')][_0x5f1e('0x40')](_0x5d547b);})[_0x5f1e('0x25')](function(_0x4909df){_0xdafe1a[_0x5f1e('0x41')]=_0x4909df;return _0xdafe1a;})[_0x5f1e('0x25')](respondWithFilteredResult(_0x4ceee4,_0x5d547b))[_0x5f1e('0x42')](handleError(_0x4ceee4,null));};exports['show']=function(_0xfb17d1,_0x4a7d36){var _0xbf2abe={'raw':![],'where':{'id':_0xfb17d1[_0x5f1e('0x43')]['id']}},_0x45030d={};_0x45030d[_0x5f1e('0x31')]=_[_0x5f1e('0x33')](db['SugarcrmAccount'][_0x5f1e('0x2d')]);_0x45030d[_0x5f1e('0x32')]=_[_0x5f1e('0x33')](_0xfb17d1[_0x5f1e('0x32')]);_0x45030d[_0x5f1e('0x34')]=_[_0x5f1e('0x35')](_0x45030d['model'],_0x45030d[_0x5f1e('0x32')]);_0xbf2abe[_0x5f1e('0x36')]=_[_0x5f1e('0x35')](_0x45030d['model'],qs[_0x5f1e('0x37')](_0xfb17d1[_0x5f1e('0x32')]['fields']));_0xbf2abe[_0x5f1e('0x36')]=_0xbf2abe[_0x5f1e('0x36')][_0x5f1e('0x38')]?_0xbf2abe[_0x5f1e('0x36')]:_0x45030d[_0x5f1e('0x31')];if(_0xfb17d1['query']['includeAll']){_0xbf2abe['include']=[{'all':!![]}];}_0xbf2abe=_[_0x5f1e('0x44')]({},_0xbf2abe,_0xfb17d1['options']);return db['SugarcrmAccount'][_0x5f1e('0x45')](_0xbf2abe)[_0x5f1e('0x25')](handleEntityNotFound(_0x4a7d36,null))['then'](respondWithResult(_0x4a7d36,null))[_0x5f1e('0x42')](handleError(_0x4a7d36,null));};exports['create']=function(_0x2e914e,_0x1fadfb){return db[_0x5f1e('0x2c')]['create'](_0x2e914e['body'],{})[_0x5f1e('0x25')](respondWithResult(_0x1fadfb,0xc9))[_0x5f1e('0x42')](handleError(_0x1fadfb,null));};exports['update']=function(_0x32aca1,_0x46a5cb){if(_0x32aca1[_0x5f1e('0x46')]['id']){delete _0x32aca1['body']['id'];}return db[_0x5f1e('0x2c')][_0x5f1e('0x45')]({'where':{'id':_0x32aca1[_0x5f1e('0x43')]['id']}})['then'](handleEntityNotFound(_0x46a5cb,null))['then'](saveUpdates(_0x32aca1['body'],null))['then'](respondWithResult(_0x46a5cb,null))[_0x5f1e('0x42')](handleError(_0x46a5cb,null));};exports[_0x5f1e('0x26')]=function(_0xd11c06,_0x1ac668){return db[_0x5f1e('0x2c')]['find']({'where':{'id':_0xd11c06[_0x5f1e('0x43')]['id']}})['then'](handleEntityNotFound(_0x1ac668,null))['then'](removeEntity(_0x1ac668,null))['catch'](handleError(_0x1ac668,null));};exports[_0x5f1e('0x47')]=function(_0x5526fe,_0x5a8f92,_0x3ce928){var _0x4367b8={};var _0x1d2af4={};var _0x3105bf;var _0x38689a;return db[_0x5f1e('0x2c')]['findOne']({'where':{'id':_0x5526fe['params']['id']}})['then'](handleEntityNotFound(_0x5a8f92,null))[_0x5f1e('0x25')](function(_0x5b1ffe){if(_0x5b1ffe){_0x3105bf=_0x5b1ffe;_0x1d2af4[_0x5f1e('0x31')]=_[_0x5f1e('0x33')](db[_0x5f1e('0x48')][_0x5f1e('0x2d')]);_0x1d2af4['query']=_[_0x5f1e('0x33')](_0x5526fe[_0x5f1e('0x32')]);_0x1d2af4['filters']=_[_0x5f1e('0x35')](_0x1d2af4['model'],_0x1d2af4[_0x5f1e('0x32')]);_0x4367b8['attributes']=_[_0x5f1e('0x35')](_0x1d2af4[_0x5f1e('0x31')],qs[_0x5f1e('0x37')](_0x5526fe['query']['fields']));_0x4367b8[_0x5f1e('0x36')]=_0x4367b8[_0x5f1e('0x36')][_0x5f1e('0x38')]?_0x4367b8[_0x5f1e('0x36')]:_0x1d2af4[_0x5f1e('0x31')];_0x4367b8[_0x5f1e('0x49')]=qs[_0x5f1e('0x4a')](_0x5526fe[_0x5f1e('0x32')][_0x5f1e('0x4a')]);_0x4367b8['where']=qs[_0x5f1e('0x34')](_[_0x5f1e('0x3b')](_0x5526fe['query'],_0x1d2af4[_0x5f1e('0x34')]));if(_0x5526fe[_0x5f1e('0x32')][_0x5f1e('0x3e')]){_0x4367b8['where']=_[_0x5f1e('0x44')](_0x4367b8[_0x5f1e('0x3c')],{'$or':_[_0x5f1e('0x2b')](_0x4367b8[_0x5f1e('0x36')],function(_0x1fb2d7){var _0x1abdad={};_0x1abdad[_0x1fb2d7]={'$like':'%'+_0x5526fe[_0x5f1e('0x32')][_0x5f1e('0x3e')]+'%'};return _0x1abdad;})});}_0x4367b8=_['merge']({},_0x4367b8,_0x5526fe[_0x5f1e('0x4b')]);return _0x3105bf['getConfigurations'](_0x4367b8);}})[_0x5f1e('0x25')](function(_0x40bd73){if(_0x40bd73){_0x38689a=_0x40bd73['length'];if(!_0x5526fe['query'][_0x5f1e('0x39')](_0x5f1e('0x3a'))){_0x4367b8[_0x5f1e('0x1e')]=qs[_0x5f1e('0x1e')](_0x5526fe[_0x5f1e('0x32')][_0x5f1e('0x1e')]);_0x4367b8[_0x5f1e('0x1c')]=qs[_0x5f1e('0x1c')](_0x5526fe[_0x5f1e('0x32')]['offset']);}return _0x3105bf[_0x5f1e('0x47')](_0x4367b8);}})[_0x5f1e('0x25')](function(_0x19c6fd){if(_0x19c6fd){return _0x19c6fd?{'count':_0x38689a,'rows':_0x19c6fd}:null;}})[_0x5f1e('0x25')](respondWithResult(_0x5a8f92,null))[_0x5f1e('0x42')](handleError(_0x5a8f92,null));};exports[_0x5f1e('0x4c')]=function(_0x480196,_0x1178cd,_0x221662){if(_0x480196['body']['id']){delete _0x480196[_0x5f1e('0x46')]['id'];}return db[_0x5f1e('0x2c')][_0x5f1e('0x4d')]({'where':{'id':_0x480196[_0x5f1e('0x43')]['id']}})[_0x5f1e('0x25')](handleEntityNotFound(_0x1178cd,null))[_0x5f1e('0x25')](function(_0x586c16){if(_0x586c16){_0x480196['body'][_0x5f1e('0x4e')]=_0x586c16['id'];_0x480196['body'][_0x5f1e('0x4f')]=integrations['getSubjects'](_0x480196[_0x5f1e('0x46')][_0x5f1e('0x50')],_0x480196[_0x5f1e('0x46')]['type']);_0x480196[_0x5f1e('0x46')][_0x5f1e('0x51')]=integrations[_0x5f1e('0x52')](_0x480196[_0x5f1e('0x46')][_0x5f1e('0x50')],_0x480196['body'][_0x5f1e('0x2f')]);return db[_0x5f1e('0x48')]['create'](_0x480196[_0x5f1e('0x46')],{'include':[{'model':db[_0x5f1e('0x53')],'as':_0x5f1e('0x4f')},{'model':db[_0x5f1e('0x53')],'as':_0x5f1e('0x51')}]});}return null;})['then'](respondWithResult(_0x1178cd,null))['catch'](handleError(_0x1178cd,null));};exports[_0x5f1e('0x54')]=function(_0x17a120,_0x1d5180,_0x15075b){var _0x5d2f6a='';var _0x5044c6=['id',_0x5f1e('0x29'),_0x5f1e('0x55'),_0x5f1e('0x56'),_0x5f1e('0x57'),_0x5f1e('0x58'),_0x5f1e('0x59'),_0x5f1e('0x5a'),_0x5f1e('0x5b'),'parent_type',_0x5f1e('0x5c'),'direction'];return db['SugarcrmAccount'][_0x5f1e('0x4d')]({'where':{'id':_0x17a120[_0x5f1e('0x43')]['id']},'attributes':['id',_0x5f1e('0x5d'),'password',_0x5f1e('0x5e')]})[_0x5f1e('0x25')](handleEntityNotFound(_0x1d5180,null))[_0x5f1e('0x25')](function(_0x49d68f){if(_0x49d68f){_0x5d2f6a=_0x49d68f['remoteUri'];var _0x258508=_0x5d2f6a[_0x5f1e('0x5f')](-0x1);if(_0x258508==='/'){_0x5d2f6a=_0x5d2f6a[_0x5f1e('0x60')](0x0,_0x5d2f6a[_0x5f1e('0x61')](_0x258508));}return rp({'method':_0x5f1e('0x62'),'uri':util['format'](_0x5f1e('0x63'),_0x5d2f6a,_0x5f1e('0x64')),'json':!![],'form':{'method':_0x5f1e('0x65'),'input_type':_0x5f1e('0x66'),'response_type':_0x5f1e('0x66'),'rest_data':JSON[_0x5f1e('0x67')]({'user_auth':{'user_name':_0x49d68f[_0x5f1e('0x5d')],'password':_0x49d68f[_0x5f1e('0x68')],'encryption':_0x5f1e('0x69')},'application':_0x5f1e('0x6a')})}});}})[_0x5f1e('0x25')](function(_0x457ea6){if(_0x457ea6&&_0x457ea6[_0x5f1e('0x29')]!==_0x5f1e('0x6b')&&_0x457ea6[_0x5f1e('0x29')]!=='Password\x20Expired'){return rp({'method':_0x5f1e('0x62'),'uri':util[_0x5f1e('0x6c')](_0x5f1e('0x63'),_0x5d2f6a,_0x5f1e('0x64')),'json':!![],'form':{'method':_0x5f1e('0x6d'),'input_type':_0x5f1e('0x66'),'response_type':'JSON','rest_data':JSON[_0x5f1e('0x67')]({'session':_0x457ea6['id'],'module_name':_0x5f1e('0x6e')})}})[_0x5f1e('0x25')](function(_0x226249){if(_0x226249){var _0x55f140=_['values'](_0x226249['module_fields']);_[_0x5f1e('0x6f')](_0x55f140,function(_0x3f9fa6){return _0x5044c6['includes'](_0x3f9fa6[_0x5f1e('0x29')]);});return{'count':_0x55f140[_0x5f1e('0x38')],'rows':_[_0x5f1e('0x2b')](_0x55f140,function(_0x27e30a){return{'id':_0x27e30a[_0x5f1e('0x29')],'name':_0x27e30a[_0x5f1e('0x70')],'custom':_[_0x5f1e('0x71')](_0x27e30a['name'],'_c')?!![]:![],'options':_0x27e30a['options']?_['map'](_[_0x5f1e('0x72')](_0x27e30a[_0x5f1e('0x4b')]),function(_0x5867ff){return{'name':_0x5867ff[_0x5f1e('0x73')],'value':_0x5867ff[_0x5f1e('0x29')]};}):[]};})};}})[_0x5f1e('0x25')](respondWithResult(_0x1d5180,null))['catch'](function(_0x4ed3d9){var _0x3f56c4=_0x17a120[_0x5f1e('0x32')]['test']?0x1f4:_0x4ed3d9[_0x5f1e('0x74')]||0x1f4;logger[_0x5f1e('0x75')](_0x5f1e('0x76'),_0x5f1e('0x54'),_0x3f56c4,JSON[_0x5f1e('0x67')](_0x4ed3d9));delete _0x4ed3d9['name'];if(_0x3f56c4===0x191){_0x3f56c4=0x190;}_0x1d5180[_0x5f1e('0x1a')](_0x3f56c4)['send'](_0x17a120[_0x5f1e('0x32')][_0x5f1e('0x77')]?{'message':_0x5f1e('0x78'),'statusCode':_0x4ed3d9['statusCode']}:_0x4ed3d9);});}else{var _0x305341=0x1f4;_0x1d5180['status'](_0x305341)[_0x5f1e('0x2a')]({'message':_0x5f1e('0x78'),'statusCode':0x190});}});}; \ No newline at end of file +var _0xf464=['to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../components/integrations/configuration','status','end','offset','count','Content-Range','json','apply','reject','then','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','options','SugarcrmAccount','includeAll','rows','params','include','catch','create','update','body','find','getConfigurations','findOne','SugarcrmConfiguration','hasOwnProperty','AccountId','getSubjects','channel','Descriptions','getDescriptions','SugarcrmField','getFields','assigned_user_id','created_by','description','duration_hours','parent_id','parent_type','parent_name','direction','username','remoteUri','slice','substring','lastIndexOf','POST','format','%s%s','/service/v4_1/rest.php','login','JSON','stringify','password','PLAIN','xCALLY\x20Motion\x20Integration','Invalid\x20Login','Password\x20Expired','get_module_fields','Calls','values','module_fields','remove','includes','label','value','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox'];(function(_0x23813b,_0x2447ca){var _0xd6a169=function(_0x771614){while(--_0x771614){_0x23813b['push'](_0x23813b['shift']());}};_0xd6a169(++_0x2447ca);}(_0xf464,0x161));var _0x4f46=function(_0x451404,_0x4f6650){_0x451404=_0x451404-0x0;var _0x4bb2ba=_0xf464[_0x451404];return _0x4bb2ba;};'use strict';var emlformat=require(_0x4f46('0x0'));var rimraf=require(_0x4f46('0x1'));var zipdir=require(_0x4f46('0x2'));var jsonpatch=require(_0x4f46('0x3'));var rp=require(_0x4f46('0x4'));var moment=require(_0x4f46('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x4f46('0x6'));var util=require(_0x4f46('0x7'));var path=require(_0x4f46('0x8'));var sox=require(_0x4f46('0x9'));var csv=require(_0x4f46('0xa'));var ejs=require(_0x4f46('0xb'));var fs=require('fs');var fs_extra=require(_0x4f46('0xc'));var _=require(_0x4f46('0xd'));var squel=require(_0x4f46('0xe'));var crypto=require('crypto');var jsforce=require(_0x4f46('0xf'));var deskjs=require(_0x4f46('0x10'));var toCsv=require(_0x4f46('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x4f46('0x11'));var authService=require(_0x4f46('0x12'));var qs=require(_0x4f46('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4f46('0x14'));var logger=require(_0x4f46('0x15'))('api');var utils=require(_0x4f46('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x4f46('0x17'));var db=require('../../mysqldb')['db'];var integrations=require(_0x4f46('0x18'));function respondWithStatusCode(_0x2d749e,_0x4a204b){_0x4a204b=_0x4a204b||0xcc;return function(_0x2646ed){if(_0x2646ed){return _0x2d749e['sendStatus'](_0x4a204b);}return _0x2d749e[_0x4f46('0x19')](_0x4a204b)[_0x4f46('0x1a')]();};}function respondWithResult(_0x502eab,_0xfc06e6){_0xfc06e6=_0xfc06e6||0xc8;return function(_0x2018c3){if(_0x2018c3){return _0x502eab[_0x4f46('0x19')](_0xfc06e6)['json'](_0x2018c3);}};}function respondWithFilteredResult(_0x2db193,_0x583eb8){return function(_0x47e1fd){if(_0x47e1fd){var _0x9b72e4=typeof _0x583eb8[_0x4f46('0x1b')]==='undefined'&&typeof _0x583eb8['limit']==='undefined';var _0xfc0800=_0x47e1fd[_0x4f46('0x1c')];var _0x12e8cf=_0x9b72e4?0x0:_0x583eb8[_0x4f46('0x1b')];var _0x2a7c39=_0x9b72e4?_0x47e1fd['count']:_0x583eb8[_0x4f46('0x1b')]+_0x583eb8['limit'];var _0x45ca67;if(_0x2a7c39>=_0xfc0800){_0x2a7c39=_0xfc0800;_0x45ca67=0xc8;}else{_0x45ca67=0xce;}_0x2db193['status'](_0x45ca67);return _0x2db193['set'](_0x4f46('0x1d'),_0x12e8cf+'-'+_0x2a7c39+'/'+_0xfc0800)[_0x4f46('0x1e')](_0x47e1fd);}return null;};}function patchUpdates(_0x38ece0){return function(_0x32af0e){try{jsonpatch[_0x4f46('0x1f')](_0x32af0e,_0x38ece0,!![]);}catch(_0x2810f2){return BPromise[_0x4f46('0x20')](_0x2810f2);}return _0x32af0e['save']();};}function saveUpdates(_0x88b64b,_0x329aec){return function(_0x4bc1af){if(_0x4bc1af){return _0x4bc1af['update'](_0x88b64b)[_0x4f46('0x21')](function(_0x315f9f){return _0x315f9f;});}return null;};}function removeEntity(_0x188d55,_0x11adb1){return function(_0x4035e8){if(_0x4035e8){return _0x4035e8['destroy']()['then'](function(){_0x188d55[_0x4f46('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5c8eeb,_0x15178f){return function(_0x386ade){if(!_0x386ade){_0x5c8eeb[_0x4f46('0x22')](0x194);}return _0x386ade;};}function handleError(_0x236437,_0x3a6cae){_0x3a6cae=_0x3a6cae||0x1f4;return function(_0x38d807){logger[_0x4f46('0x23')](_0x38d807[_0x4f46('0x24')]);if(_0x38d807[_0x4f46('0x25')]){delete _0x38d807['name'];}_0x236437[_0x4f46('0x19')](_0x3a6cae)[_0x4f46('0x26')](_0x38d807);};}exports[_0x4f46('0x27')]=function(_0x16e69c,_0x1d6315){var _0x195794={},_0x573c65={},_0x2af73f={'count':0x0,'rows':[]};var _0x136016=_[_0x4f46('0x28')](db['SugarcrmAccount'][_0x4f46('0x29')],function(_0x2835ac){return{'name':_0x2835ac[_0x4f46('0x2a')],'type':_0x2835ac[_0x4f46('0x2b')][_0x4f46('0x2c')]};});_0x573c65[_0x4f46('0x2d')]=_[_0x4f46('0x28')](_0x136016,_0x4f46('0x25'));_0x573c65[_0x4f46('0x2e')]=_[_0x4f46('0x2f')](_0x16e69c[_0x4f46('0x2e')]);_0x573c65[_0x4f46('0x30')]=_[_0x4f46('0x31')](_0x573c65[_0x4f46('0x2d')],_0x573c65['query']);_0x195794[_0x4f46('0x32')]=_[_0x4f46('0x31')](_0x573c65[_0x4f46('0x2d')],qs[_0x4f46('0x33')](_0x16e69c[_0x4f46('0x2e')][_0x4f46('0x33')]));_0x195794['attributes']=_0x195794[_0x4f46('0x32')][_0x4f46('0x34')]?_0x195794[_0x4f46('0x32')]:_0x573c65[_0x4f46('0x2d')];if(!_0x16e69c[_0x4f46('0x2e')]['hasOwnProperty'](_0x4f46('0x35'))){_0x195794[_0x4f46('0x36')]=qs[_0x4f46('0x36')](_0x16e69c[_0x4f46('0x2e')][_0x4f46('0x36')]);_0x195794['offset']=qs[_0x4f46('0x1b')](_0x16e69c[_0x4f46('0x2e')][_0x4f46('0x1b')]);}_0x195794[_0x4f46('0x37')]=qs[_0x4f46('0x38')](_0x16e69c[_0x4f46('0x2e')][_0x4f46('0x38')]);_0x195794[_0x4f46('0x39')]=qs['filters'](_[_0x4f46('0x3a')](_0x16e69c['query'],_0x573c65['filters']),_0x136016);if(_0x16e69c[_0x4f46('0x2e')][_0x4f46('0x3b')]){_0x195794[_0x4f46('0x39')]=_[_0x4f46('0x3c')](_0x195794[_0x4f46('0x39')],{'$or':_[_0x4f46('0x28')](_0x136016,function(_0x130759){if(_0x130759['type']!==_0x4f46('0x3d')){var _0x360f08={};_0x360f08[_0x130759['name']]={'$like':'%'+_0x16e69c[_0x4f46('0x2e')][_0x4f46('0x3b')]+'%'};return _0x360f08;}})});}_0x195794=_[_0x4f46('0x3c')]({},_0x195794,_0x16e69c[_0x4f46('0x3e')]);var _0x1fffcb={'where':_0x195794['where']};return db[_0x4f46('0x3f')][_0x4f46('0x1c')](_0x1fffcb)['then'](function(_0x4df16d){_0x2af73f['count']=_0x4df16d;if(_0x16e69c[_0x4f46('0x2e')][_0x4f46('0x40')]){_0x195794['include']=[{'all':!![]}];}return db[_0x4f46('0x3f')]['findAll'](_0x195794);})[_0x4f46('0x21')](function(_0x1540ce){_0x2af73f[_0x4f46('0x41')]=_0x1540ce;return _0x2af73f;})[_0x4f46('0x21')](respondWithFilteredResult(_0x1d6315,_0x195794))['catch'](handleError(_0x1d6315,null));};exports['show']=function(_0x146bf7,_0x5c8819){var _0x582462={'raw':![],'where':{'id':_0x146bf7[_0x4f46('0x42')]['id']}},_0x212109={};_0x212109[_0x4f46('0x2d')]=_['keys'](db[_0x4f46('0x3f')]['rawAttributes']);_0x212109[_0x4f46('0x2e')]=_[_0x4f46('0x2f')](_0x146bf7['query']);_0x212109[_0x4f46('0x30')]=_[_0x4f46('0x31')](_0x212109['model'],_0x212109[_0x4f46('0x2e')]);_0x582462[_0x4f46('0x32')]=_[_0x4f46('0x31')](_0x212109[_0x4f46('0x2d')],qs[_0x4f46('0x33')](_0x146bf7[_0x4f46('0x2e')][_0x4f46('0x33')]));_0x582462['attributes']=_0x582462[_0x4f46('0x32')][_0x4f46('0x34')]?_0x582462['attributes']:_0x212109['model'];if(_0x146bf7[_0x4f46('0x2e')][_0x4f46('0x40')]){_0x582462[_0x4f46('0x43')]=[{'all':!![]}];}_0x582462=_[_0x4f46('0x3c')]({},_0x582462,_0x146bf7['options']);return db['SugarcrmAccount']['find'](_0x582462)[_0x4f46('0x21')](handleEntityNotFound(_0x5c8819,null))[_0x4f46('0x21')](respondWithResult(_0x5c8819,null))[_0x4f46('0x44')](handleError(_0x5c8819,null));};exports[_0x4f46('0x45')]=function(_0x4ce57e,_0x2b0b39){return db[_0x4f46('0x3f')]['create'](_0x4ce57e['body'],{})[_0x4f46('0x21')](respondWithResult(_0x2b0b39,0xc9))['catch'](handleError(_0x2b0b39,null));};exports[_0x4f46('0x46')]=function(_0x16c485,_0x1f593d){if(_0x16c485[_0x4f46('0x47')]['id']){delete _0x16c485[_0x4f46('0x47')]['id'];}return db['SugarcrmAccount'][_0x4f46('0x48')]({'where':{'id':_0x16c485[_0x4f46('0x42')]['id']}})[_0x4f46('0x21')](handleEntityNotFound(_0x1f593d,null))[_0x4f46('0x21')](saveUpdates(_0x16c485['body'],null))[_0x4f46('0x21')](respondWithResult(_0x1f593d,null))['catch'](handleError(_0x1f593d,null));};exports['destroy']=function(_0x1f8e98,_0x18426c){return db[_0x4f46('0x3f')]['find']({'where':{'id':_0x1f8e98[_0x4f46('0x42')]['id']}})[_0x4f46('0x21')](handleEntityNotFound(_0x18426c,null))[_0x4f46('0x21')](removeEntity(_0x18426c,null))[_0x4f46('0x44')](handleError(_0x18426c,null));};exports[_0x4f46('0x49')]=function(_0x4957b5,_0x49a904,_0x44edc6){var _0x325cd8={};var _0x24d51c={};var _0x15702e;var _0x3084c4;return db[_0x4f46('0x3f')][_0x4f46('0x4a')]({'where':{'id':_0x4957b5['params']['id']}})['then'](handleEntityNotFound(_0x49a904,null))[_0x4f46('0x21')](function(_0x547079){if(_0x547079){_0x15702e=_0x547079;_0x24d51c[_0x4f46('0x2d')]=_[_0x4f46('0x2f')](db[_0x4f46('0x4b')][_0x4f46('0x29')]);_0x24d51c[_0x4f46('0x2e')]=_[_0x4f46('0x2f')](_0x4957b5[_0x4f46('0x2e')]);_0x24d51c['filters']=_[_0x4f46('0x31')](_0x24d51c[_0x4f46('0x2d')],_0x24d51c[_0x4f46('0x2e')]);_0x325cd8[_0x4f46('0x32')]=_[_0x4f46('0x31')](_0x24d51c[_0x4f46('0x2d')],qs[_0x4f46('0x33')](_0x4957b5[_0x4f46('0x2e')][_0x4f46('0x33')]));_0x325cd8[_0x4f46('0x32')]=_0x325cd8[_0x4f46('0x32')][_0x4f46('0x34')]?_0x325cd8[_0x4f46('0x32')]:_0x24d51c[_0x4f46('0x2d')];_0x325cd8[_0x4f46('0x37')]=qs['sort'](_0x4957b5[_0x4f46('0x2e')]['sort']);_0x325cd8[_0x4f46('0x39')]=qs[_0x4f46('0x30')](_[_0x4f46('0x3a')](_0x4957b5['query'],_0x24d51c[_0x4f46('0x30')]));if(_0x4957b5[_0x4f46('0x2e')]['filter']){_0x325cd8['where']=_[_0x4f46('0x3c')](_0x325cd8[_0x4f46('0x39')],{'$or':_[_0x4f46('0x28')](_0x325cd8[_0x4f46('0x32')],function(_0x4c7f3e){var _0x151f6e={};_0x151f6e[_0x4c7f3e]={'$like':'%'+_0x4957b5[_0x4f46('0x2e')][_0x4f46('0x3b')]+'%'};return _0x151f6e;})});}_0x325cd8=_['merge']({},_0x325cd8,_0x4957b5[_0x4f46('0x3e')]);return _0x15702e[_0x4f46('0x49')](_0x325cd8);}})[_0x4f46('0x21')](function(_0x15436a){if(_0x15436a){_0x3084c4=_0x15436a[_0x4f46('0x34')];if(!_0x4957b5[_0x4f46('0x2e')][_0x4f46('0x4c')](_0x4f46('0x35'))){_0x325cd8[_0x4f46('0x36')]=qs[_0x4f46('0x36')](_0x4957b5[_0x4f46('0x2e')][_0x4f46('0x36')]);_0x325cd8[_0x4f46('0x1b')]=qs[_0x4f46('0x1b')](_0x4957b5[_0x4f46('0x2e')]['offset']);}return _0x15702e[_0x4f46('0x49')](_0x325cd8);}})[_0x4f46('0x21')](function(_0x558ec8){if(_0x558ec8){return _0x558ec8?{'count':_0x3084c4,'rows':_0x558ec8}:null;}})[_0x4f46('0x21')](respondWithResult(_0x49a904,null))[_0x4f46('0x44')](handleError(_0x49a904,null));};exports['addConfiguration']=function(_0x308b06,_0x204244,_0x44419a){if(_0x308b06[_0x4f46('0x47')]['id']){delete _0x308b06[_0x4f46('0x47')]['id'];}return db[_0x4f46('0x3f')][_0x4f46('0x4a')]({'where':{'id':_0x308b06[_0x4f46('0x42')]['id']}})[_0x4f46('0x21')](handleEntityNotFound(_0x204244,null))[_0x4f46('0x21')](function(_0x22bcc5){if(_0x22bcc5){_0x308b06[_0x4f46('0x47')][_0x4f46('0x4d')]=_0x22bcc5['id'];_0x308b06['body']['Subjects']=integrations[_0x4f46('0x4e')](_0x308b06[_0x4f46('0x47')][_0x4f46('0x4f')],_0x308b06[_0x4f46('0x47')]['type']);_0x308b06[_0x4f46('0x47')][_0x4f46('0x50')]=integrations[_0x4f46('0x51')](_0x308b06[_0x4f46('0x47')][_0x4f46('0x4f')],_0x308b06[_0x4f46('0x47')][_0x4f46('0x2b')]);return db['SugarcrmConfiguration'][_0x4f46('0x45')](_0x308b06[_0x4f46('0x47')],{'include':[{'model':db[_0x4f46('0x52')],'as':'Subjects'},{'model':db[_0x4f46('0x52')],'as':'Descriptions'}]});}return null;})['then'](respondWithResult(_0x204244,null))['catch'](handleError(_0x204244,null));};exports[_0x4f46('0x53')]=function(_0x25213a,_0x4d31cc,_0x1a89b9){var _0x506e55='';var _0x48ebed=['id',_0x4f46('0x25'),_0x4f46('0x54'),_0x4f46('0x55'),_0x4f46('0x56'),'date_start',_0x4f46('0x57'),'duration_minutes',_0x4f46('0x58'),_0x4f46('0x59'),_0x4f46('0x5a'),_0x4f46('0x5b')];return db[_0x4f46('0x3f')][_0x4f46('0x4a')]({'where':{'id':_0x25213a['params']['id']},'attributes':['id',_0x4f46('0x5c'),'password',_0x4f46('0x5d')]})['then'](handleEntityNotFound(_0x4d31cc,null))['then'](function(_0x3ec9b7){if(_0x3ec9b7){_0x506e55=_0x3ec9b7[_0x4f46('0x5d')];var _0x1d2029=_0x506e55[_0x4f46('0x5e')](-0x1);if(_0x1d2029==='/'){_0x506e55=_0x506e55[_0x4f46('0x5f')](0x0,_0x506e55[_0x4f46('0x60')](_0x1d2029));}return rp({'method':_0x4f46('0x61'),'uri':util[_0x4f46('0x62')](_0x4f46('0x63'),_0x506e55,_0x4f46('0x64')),'json':!![],'form':{'method':_0x4f46('0x65'),'input_type':_0x4f46('0x66'),'response_type':'JSON','rest_data':JSON[_0x4f46('0x67')]({'user_auth':{'user_name':_0x3ec9b7[_0x4f46('0x5c')],'password':_0x3ec9b7[_0x4f46('0x68')],'encryption':_0x4f46('0x69')},'application':_0x4f46('0x6a')})}});}})[_0x4f46('0x21')](function(_0x19b007){if(_0x19b007&&_0x19b007[_0x4f46('0x25')]!==_0x4f46('0x6b')&&_0x19b007[_0x4f46('0x25')]!==_0x4f46('0x6c')){return rp({'method':_0x4f46('0x61'),'uri':util[_0x4f46('0x62')](_0x4f46('0x63'),_0x506e55,_0x4f46('0x64')),'json':!![],'form':{'method':_0x4f46('0x6d'),'input_type':_0x4f46('0x66'),'response_type':_0x4f46('0x66'),'rest_data':JSON[_0x4f46('0x67')]({'session':_0x19b007['id'],'module_name':_0x4f46('0x6e')})}})['then'](function(_0x30015c){if(_0x30015c){var _0x3ae6eb=_[_0x4f46('0x6f')](_0x30015c[_0x4f46('0x70')]);_[_0x4f46('0x71')](_0x3ae6eb,function(_0xc297cb){return _0x48ebed[_0x4f46('0x72')](_0xc297cb[_0x4f46('0x25')]);});return{'count':_0x3ae6eb[_0x4f46('0x34')],'rows':_[_0x4f46('0x28')](_0x3ae6eb,function(_0x419ab0){return{'id':_0x419ab0['name'],'name':_0x419ab0[_0x4f46('0x73')],'custom':_['endsWith'](_0x419ab0[_0x4f46('0x25')],'_c')?!![]:![],'options':_0x419ab0[_0x4f46('0x3e')]?_[_0x4f46('0x28')](_[_0x4f46('0x6f')](_0x419ab0[_0x4f46('0x3e')]),function(_0x45e5c1){return{'name':_0x45e5c1[_0x4f46('0x74')],'value':_0x45e5c1[_0x4f46('0x25')]};}):[]};})};}})[_0x4f46('0x21')](respondWithResult(_0x4d31cc,null))[_0x4f46('0x44')](function(_0x300f5f){var _0xcf60ac=_0x25213a[_0x4f46('0x2e')][_0x4f46('0x75')]?0x1f4:_0x300f5f[_0x4f46('0x76')]||0x1f4;logger[_0x4f46('0x23')](_0x4f46('0x77'),'getFields',_0xcf60ac,JSON[_0x4f46('0x67')](_0x300f5f));delete _0x300f5f[_0x4f46('0x25')];if(_0xcf60ac===0x191){_0xcf60ac=0x190;}_0x4d31cc[_0x4f46('0x19')](_0xcf60ac)[_0x4f46('0x26')](_0x25213a['query']['test']?{'message':'Wrong\x20credentials','statusCode':_0x300f5f[_0x4f46('0x76')]}:_0x300f5f);});}else{var _0x7ad886=0x1f4;_0x4d31cc[_0x4f46('0x19')](_0x7ad886)[_0x4f46('0x26')]({'message':_0x4f46('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 bb6ab57..3915daf 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 _0x1617=['request-promise','path','rimraf','../../config/environment','./intSugarcrmAccount.attributes','../../components/integrations/configuration','define','SugarcrmAccount','int_sugarcrm_accounts','util','api','bluebird'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x1617,0xa5));var _0x7161=function(_0x4e8286,_0x4eaeb4){_0x4e8286=_0x4e8286-0x0;var _0x44a440=_0x1617[_0x4e8286];return _0x44a440;};'use strict';var _=require('lodash');var util=require(_0x7161('0x0'));var logger=require('../../config/logger')(_0x7161('0x1'));var moment=require('moment');var BPromise=require(_0x7161('0x2'));var rp=require(_0x7161('0x3'));var fs=require('fs');var path=require(_0x7161('0x4'));var rimraf=require(_0x7161('0x5'));var config=require(_0x7161('0x6'));var attributes=require(_0x7161('0x7'));var integrations=require(_0x7161('0x8'));module['exports']=function(_0x579241,_0x24f962){return _0x579241[_0x7161('0x9')](_0x7161('0xa'),attributes,{'tableName':_0x7161('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa7d7=['rimraf','../../config/environment','./intSugarcrmAccount.attributes','../../components/integrations/configuration','int_sugarcrm_accounts','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x4f0fc1,_0x521e45){var _0x182520=function(_0x2a0a3a){while(--_0x2a0a3a){_0x4f0fc1['push'](_0x4f0fc1['shift']());}};_0x182520(++_0x521e45);}(_0xa7d7,0x149));var _0x7a7d=function(_0xb833b1,_0x1c3d3f){_0xb833b1=_0xb833b1-0x0;var _0x1ab87a=_0xa7d7[_0xb833b1];return _0x1ab87a;};'use strict';var _=require('lodash');var util=require(_0x7a7d('0x0'));var logger=require(_0x7a7d('0x1'))(_0x7a7d('0x2'));var moment=require(_0x7a7d('0x3'));var BPromise=require(_0x7a7d('0x4'));var rp=require(_0x7a7d('0x5'));var fs=require('fs');var path=require(_0x7a7d('0x6'));var rimraf=require(_0x7a7d('0x7'));var config=require(_0x7a7d('0x8'));var attributes=require(_0x7a7d('0x9'));var integrations=require(_0x7a7d('0xa'));module['exports']=function(_0x7e4d3f,_0x31e260){return _0x7e4d3f['define']('SugarcrmAccount',attributes,{'tableName':_0x7a7d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.rpc.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.rpc.js index 523ead3..a7b0d1f 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 _0xcc53=['find','ShowSugarcrmAccount','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','debug','request\x20sent','stringify','error','SugarcrmAccount,\x20%s,\x20%s','message','result','GetSugarcrmAccount','SugarcrmAccount','findAll','options','where','attributes','include','map','model','catch'];(function(_0x5dc45d,_0x55f90f){var _0x4ce697=function(_0x4e6e21){while(--_0x4e6e21){_0x5dc45d['push'](_0x5dc45d['shift']());}};_0x4ce697(++_0x55f90f);}(_0xcc53,0x82));var _0x3cc5=function(_0x515171,_0x340955){_0x515171=_0x515171-0x0;var _0x11e257=_0xcc53[_0x515171];return _0x11e257;};'use strict';var _=require(_0x3cc5('0x0'));var util=require(_0x3cc5('0x1'));var moment=require('moment');var BPromise=require(_0x3cc5('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3cc5('0x3'));var db=require(_0x3cc5('0x4'))['db'];var utils=require(_0x3cc5('0x5'));var logger=require(_0x3cc5('0x6'))(_0x3cc5('0x7'));var config=require(_0x3cc5('0x8'));var jayson=require(_0x3cc5('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x495c91,_0x197bc8,_0x1943c7){return new BPromise(function(_0x5a6b82,_0x47f568){return client[_0x3cc5('0xa')](_0x495c91,_0x1943c7)[_0x3cc5('0xb')](function(_0x4ffc0c){logger[_0x3cc5('0xc')]('SugarcrmAccount,\x20%s,\x20%s',_0x197bc8,'request\x20sent');logger[_0x3cc5('0xd')]('SugarcrmAccount,\x20%s,\x20%s,\x20%s',_0x197bc8,_0x3cc5('0xe'),JSON[_0x3cc5('0xf')](_0x4ffc0c));if(_0x4ffc0c[_0x3cc5('0x10')]){if(_0x4ffc0c[_0x3cc5('0x10')]['code']===0x1f4){logger[_0x3cc5('0x10')](_0x3cc5('0x11'),_0x197bc8,_0x4ffc0c['error'][_0x3cc5('0x12')]);return _0x47f568(_0x4ffc0c[_0x3cc5('0x10')][_0x3cc5('0x12')]);}logger['error'](_0x3cc5('0x11'),_0x197bc8,_0x4ffc0c[_0x3cc5('0x10')][_0x3cc5('0x12')]);return _0x5a6b82(_0x4ffc0c['error'][_0x3cc5('0x12')]);}else{logger[_0x3cc5('0xc')](_0x3cc5('0x11'),_0x197bc8,_0x3cc5('0xe'));_0x5a6b82(_0x4ffc0c[_0x3cc5('0x13')][_0x3cc5('0x12')]);}})['catch'](function(_0x128f66){logger[_0x3cc5('0x10')](_0x3cc5('0x11'),_0x197bc8,_0x128f66);_0x47f568(_0x128f66);});});}exports[_0x3cc5('0x14')]=function(_0x15a54c){var _0x479eac=this;return new Promise(function(_0x599b08,_0x1c15f2){return db[_0x3cc5('0x15')][_0x3cc5('0x16')]({'raw':_0x15a54c[_0x3cc5('0x17')]?_0x15a54c[_0x3cc5('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x15a54c[_0x3cc5('0x17')]?_0x15a54c[_0x3cc5('0x17')][_0x3cc5('0x18')]||null:null,'attributes':_0x15a54c[_0x3cc5('0x17')]?_0x15a54c['options'][_0x3cc5('0x19')]||null:null,'limit':_0x15a54c[_0x3cc5('0x17')]?_0x15a54c[_0x3cc5('0x17')]['limit']||null:null,'include':_0x15a54c['options']?_0x15a54c[_0x3cc5('0x17')][_0x3cc5('0x1a')]?_[_0x3cc5('0x1b')](_0x15a54c[_0x3cc5('0x17')][_0x3cc5('0x1a')],function(_0x4703b3){return{'model':db[_0x4703b3[_0x3cc5('0x1c')]],'as':_0x4703b3['as'],'attributes':_0x4703b3[_0x3cc5('0x19')],'include':_0x4703b3['include']?_[_0x3cc5('0x1b')](_0x4703b3[_0x3cc5('0x1a')],function(_0x32af8d){return{'model':db[_0x32af8d['model']],'as':_0x32af8d['as'],'attributes':_0x32af8d['attributes'],'include':_0x32af8d[_0x3cc5('0x1a')]?_[_0x3cc5('0x1b')](_0x32af8d[_0x3cc5('0x1a')],function(_0x3db898){return{'model':db[_0x3db898[_0x3cc5('0x1c')]],'as':_0x3db898['as'],'attributes':_0x3db898['attributes']};}):[]};}):[]};}):[]:[]})[_0x3cc5('0xb')](function(_0x10ef7a){logger['info'](_0x3cc5('0x14'),_0x15a54c);logger[_0x3cc5('0xd')](_0x3cc5('0x14'),_0x15a54c,JSON['stringify'](_0x10ef7a));_0x599b08(_0x10ef7a);})[_0x3cc5('0x1d')](function(_0x1b9fbf){logger[_0x3cc5('0x10')](_0x3cc5('0x14'),_0x1b9fbf[_0x3cc5('0x12')],_0x15a54c);_0x1c15f2(_0x479eac[_0x3cc5('0x10')](0x1f4,_0x1b9fbf['message']));});});};exports['ShowSugarcrmAccount']=function(_0x24c51f){var _0x3c6286=this;return new Promise(function(_0x59c482,_0x29bd66){return db[_0x3cc5('0x15')][_0x3cc5('0x1e')]({'raw':_0x24c51f[_0x3cc5('0x17')]?_0x24c51f[_0x3cc5('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x24c51f[_0x3cc5('0x17')]?_0x24c51f[_0x3cc5('0x17')][_0x3cc5('0x18')]||null:null,'attributes':_0x24c51f[_0x3cc5('0x17')]?_0x24c51f['options'][_0x3cc5('0x19')]||null:null,'include':_0x24c51f[_0x3cc5('0x17')]?_0x24c51f[_0x3cc5('0x17')][_0x3cc5('0x1a')]?_['map'](_0x24c51f['options']['include'],function(_0x5efd7f){return{'model':db[_0x5efd7f[_0x3cc5('0x1c')]],'as':_0x5efd7f['as'],'attributes':_0x5efd7f['attributes'],'include':_0x5efd7f[_0x3cc5('0x1a')]?_[_0x3cc5('0x1b')](_0x5efd7f['include'],function(_0x2b2f21){return{'model':db[_0x2b2f21[_0x3cc5('0x1c')]],'as':_0x2b2f21['as'],'attributes':_0x2b2f21[_0x3cc5('0x19')],'include':_0x2b2f21[_0x3cc5('0x1a')]?_['map'](_0x2b2f21[_0x3cc5('0x1a')],function(_0x10aab0){return{'model':db[_0x10aab0[_0x3cc5('0x1c')]],'as':_0x10aab0['as'],'attributes':_0x10aab0['attributes']};}):[]};}):[]};}):[]:[]})[_0x3cc5('0xb')](function(_0x4b5c5e){logger[_0x3cc5('0xc')](_0x3cc5('0x1f'),_0x24c51f);logger[_0x3cc5('0xd')](_0x3cc5('0x1f'),_0x24c51f,JSON['stringify'](_0x4b5c5e));_0x59c482(_0x4b5c5e);})[_0x3cc5('0x1d')](function(_0x5d48a9){logger[_0x3cc5('0x10')](_0x3cc5('0x1f'),_0x5d48a9['message'],_0x24c51f);_0x29bd66(_0x3c6286['error'](0x1f4,_0x5d48a9[_0x3cc5('0x12')]));});});}; \ No newline at end of file +var _0x56b2=['model','attributes','info','ShowSugarcrmAccount','find','raw','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','stringify','code','error','message','catch','GetSugarcrmAccount','SugarcrmAccount','findAll','options','where','limit','include','map'];(function(_0x51b294,_0x2fc218){var _0x3babce=function(_0x3ff145){while(--_0x3ff145){_0x51b294['push'](_0x51b294['shift']());}};_0x3babce(++_0x2fc218);}(_0x56b2,0x96));var _0x256b=function(_0x37f612,_0x273fc8){_0x37f612=_0x37f612-0x0;var _0x58a05c=_0x56b2[_0x37f612];return _0x58a05c;};'use strict';var _=require(_0x256b('0x0'));var util=require(_0x256b('0x1'));var moment=require(_0x256b('0x2'));var BPromise=require(_0x256b('0x3'));var rs=require(_0x256b('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x256b('0x5'))['db'];var utils=require(_0x256b('0x6'));var logger=require(_0x256b('0x7'))(_0x256b('0x8'));var config=require(_0x256b('0x9'));var jayson=require(_0x256b('0xa'));var client=jayson[_0x256b('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4f4ada,_0x1c286,_0x284107){return new BPromise(function(_0x1d95f8,_0x291995){return client['request'](_0x4f4ada,_0x284107)[_0x256b('0xc')](function(_0xe23c8b){logger['info'](_0x256b('0xd'),_0x1c286,_0x256b('0xe'));logger[_0x256b('0xf')](_0x256b('0x10'),_0x1c286,_0x256b('0xe'),JSON[_0x256b('0x11')](_0xe23c8b));if(_0xe23c8b['error']){if(_0xe23c8b['error'][_0x256b('0x12')]===0x1f4){logger['error'](_0x256b('0xd'),_0x1c286,_0xe23c8b[_0x256b('0x13')]['message']);return _0x291995(_0xe23c8b[_0x256b('0x13')][_0x256b('0x14')]);}logger[_0x256b('0x13')](_0x256b('0xd'),_0x1c286,_0xe23c8b[_0x256b('0x13')][_0x256b('0x14')]);return _0x1d95f8(_0xe23c8b[_0x256b('0x13')][_0x256b('0x14')]);}else{logger['info'](_0x256b('0xd'),_0x1c286,'request\x20sent');_0x1d95f8(_0xe23c8b['result']['message']);}})[_0x256b('0x15')](function(_0xe0ca09){logger[_0x256b('0x13')](_0x256b('0xd'),_0x1c286,_0xe0ca09);_0x291995(_0xe0ca09);});});}exports[_0x256b('0x16')]=function(_0xdf4e9d){var _0x229f66=this;return new Promise(function(_0x28f18b,_0x22fa92){return db[_0x256b('0x17')][_0x256b('0x18')]({'raw':_0xdf4e9d[_0x256b('0x19')]?_0xdf4e9d[_0x256b('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0xdf4e9d[_0x256b('0x19')]?_0xdf4e9d[_0x256b('0x19')][_0x256b('0x1a')]||null:null,'attributes':_0xdf4e9d[_0x256b('0x19')]?_0xdf4e9d[_0x256b('0x19')]['attributes']||null:null,'limit':_0xdf4e9d[_0x256b('0x19')]?_0xdf4e9d[_0x256b('0x19')][_0x256b('0x1b')]||null:null,'include':_0xdf4e9d[_0x256b('0x19')]?_0xdf4e9d[_0x256b('0x19')][_0x256b('0x1c')]?_[_0x256b('0x1d')](_0xdf4e9d[_0x256b('0x19')][_0x256b('0x1c')],function(_0x52945e){return{'model':db[_0x52945e[_0x256b('0x1e')]],'as':_0x52945e['as'],'attributes':_0x52945e[_0x256b('0x1f')],'include':_0x52945e['include']?_[_0x256b('0x1d')](_0x52945e[_0x256b('0x1c')],function(_0x58b312){return{'model':db[_0x58b312['model']],'as':_0x58b312['as'],'attributes':_0x58b312['attributes'],'include':_0x58b312[_0x256b('0x1c')]?_[_0x256b('0x1d')](_0x58b312[_0x256b('0x1c')],function(_0x1fb874){return{'model':db[_0x1fb874[_0x256b('0x1e')]],'as':_0x1fb874['as'],'attributes':_0x1fb874[_0x256b('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x256b('0xc')](function(_0x492986){logger[_0x256b('0x20')](_0x256b('0x16'),_0xdf4e9d);logger['debug'](_0x256b('0x16'),_0xdf4e9d,JSON[_0x256b('0x11')](_0x492986));_0x28f18b(_0x492986);})[_0x256b('0x15')](function(_0x3212dd){logger[_0x256b('0x13')](_0x256b('0x16'),_0x3212dd[_0x256b('0x14')],_0xdf4e9d);_0x22fa92(_0x229f66['error'](0x1f4,_0x3212dd[_0x256b('0x14')]));});});};exports[_0x256b('0x21')]=function(_0x1047b7){var _0x500073=this;return new Promise(function(_0x1d7fca,_0x21ae25){return db[_0x256b('0x17')][_0x256b('0x22')]({'raw':_0x1047b7[_0x256b('0x19')]?_0x1047b7[_0x256b('0x19')][_0x256b('0x23')]===undefined?!![]:![]:!![],'where':_0x1047b7[_0x256b('0x19')]?_0x1047b7['options'][_0x256b('0x1a')]||null:null,'attributes':_0x1047b7['options']?_0x1047b7[_0x256b('0x19')][_0x256b('0x1f')]||null:null,'include':_0x1047b7[_0x256b('0x19')]?_0x1047b7[_0x256b('0x19')]['include']?_[_0x256b('0x1d')](_0x1047b7[_0x256b('0x19')]['include'],function(_0x512404){return{'model':db[_0x512404['model']],'as':_0x512404['as'],'attributes':_0x512404[_0x256b('0x1f')],'include':_0x512404[_0x256b('0x1c')]?_['map'](_0x512404['include'],function(_0x45e504){return{'model':db[_0x45e504[_0x256b('0x1e')]],'as':_0x45e504['as'],'attributes':_0x45e504['attributes'],'include':_0x45e504[_0x256b('0x1c')]?_['map'](_0x45e504[_0x256b('0x1c')],function(_0x1a5a32){return{'model':db[_0x1a5a32[_0x256b('0x1e')]],'as':_0x1a5a32['as'],'attributes':_0x1a5a32[_0x256b('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x256b('0xc')](function(_0x192da9){logger[_0x256b('0x20')](_0x256b('0x21'),_0x1047b7);logger[_0x256b('0xf')](_0x256b('0x21'),_0x1047b7,JSON[_0x256b('0x11')](_0x192da9));_0x1d7fca(_0x192da9);})[_0x256b('0x15')](function(_0x32e451){logger['error'](_0x256b('0x21'),_0x32e451[_0x256b('0x14')],_0x1047b7);_0x21ae25(_0x500073[_0x256b('0x13')](0x1f4,_0x32e451[_0x256b('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/index.js b/server/api/intSugarcrmConfiguration/index.js index 1f630d2..74eba56 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 _0x9216=['multer','util','path','express','Router','../../components/auth/service','../../config/environment','./intSugarcrmConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','getSubjects','/:id/descriptions','getDescriptions','post','update','destroy','exports'];(function(_0xfe33d1,_0x4490ab){var _0x5606a6=function(_0x409d81){while(--_0x409d81){_0xfe33d1['push'](_0xfe33d1['shift']());}};_0x5606a6(++_0x4490ab);}(_0x9216,0x11e));var _0x6921=function(_0x549278,_0x450754){_0x549278=_0x549278-0x0;var _0x1ea9a1=_0x9216[_0x549278];return _0x1ea9a1;};'use strict';var multer=require(_0x6921('0x0'));var util=require(_0x6921('0x1'));var path=require(_0x6921('0x2'));var timeout=require('connect-timeout');var express=require(_0x6921('0x3'));var router=express[_0x6921('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x6921('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x6921('0x6'));var controller=require(_0x6921('0x7'));router[_0x6921('0x8')]('/',auth[_0x6921('0x9')](),controller[_0x6921('0xa')]);router['get'](_0x6921('0xb'),auth[_0x6921('0x9')](),controller[_0x6921('0xc')]);router[_0x6921('0x8')](_0x6921('0xd'),auth['isAuthenticated'](),controller[_0x6921('0xe')]);router[_0x6921('0x8')]('/:id/subjects',auth[_0x6921('0x9')](),controller[_0x6921('0xf')]);router[_0x6921('0x8')](_0x6921('0x10'),auth[_0x6921('0x9')](),controller[_0x6921('0x11')]);router[_0x6921('0x12')]('/',auth[_0x6921('0x9')](),controller['create']);router['put'](_0x6921('0xb'),auth[_0x6921('0x9')](),controller[_0x6921('0x13')]);router['delete']('/:id',auth[_0x6921('0x9')](),controller[_0x6921('0x14')]);module[_0x6921('0x15')]=router; \ No newline at end of file +var _0xb6c9=['post','create','put','update','delete','destroy','multer','util','path','express','Router','fs-extra','../../components/interaction/service','./intSugarcrmConfiguration.controller','isAuthenticated','get','/:id','show','getFields','/:id/subjects','getSubjects','/:id/descriptions'];(function(_0x2c2d83,_0x1fc9fb){var _0x5128db=function(_0x3ec6da){while(--_0x3ec6da){_0x2c2d83['push'](_0x2c2d83['shift']());}};_0x5128db(++_0x1fc9fb);}(_0xb6c9,0x1be));var _0x9b6c=function(_0x4e1a81,_0x4c3697){_0x4e1a81=_0x4e1a81-0x0;var _0x52ea72=_0xb6c9[_0x4e1a81];return _0x52ea72;};'use strict';var multer=require(_0x9b6c('0x0'));var util=require(_0x9b6c('0x1'));var path=require(_0x9b6c('0x2'));var timeout=require('connect-timeout');var express=require(_0x9b6c('0x3'));var router=express[_0x9b6c('0x4')]();var fs_extra=require(_0x9b6c('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x9b6c('0x6'));var config=require('../../config/environment');var controller=require(_0x9b6c('0x7'));router['get']('/',auth[_0x9b6c('0x8')](),controller['index']);router[_0x9b6c('0x9')](_0x9b6c('0xa'),auth[_0x9b6c('0x8')](),controller[_0x9b6c('0xb')]);router[_0x9b6c('0x9')]('/:id/fields',auth[_0x9b6c('0x8')](),controller[_0x9b6c('0xc')]);router['get'](_0x9b6c('0xd'),auth[_0x9b6c('0x8')](),controller[_0x9b6c('0xe')]);router['get'](_0x9b6c('0xf'),auth['isAuthenticated'](),controller['getDescriptions']);router[_0x9b6c('0x10')]('/',auth['isAuthenticated'](),controller[_0x9b6c('0x11')]);router[_0x9b6c('0x12')](_0x9b6c('0xa'),auth[_0x9b6c('0x8')](),controller[_0x9b6c('0x13')]);router[_0x9b6c('0x14')](_0x9b6c('0xa'),auth['isAuthenticated'](),controller[_0x9b6c('0x15')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js index 63941bd..58e9998 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 _0x7838=['exports','STRING','sequelize'];(function(_0x4f4c71,_0x3d0c67){var _0x5c1ad3=function(_0x4d230e){while(--_0x4d230e){_0x4f4c71['push'](_0x4f4c71['shift']());}};_0x5c1ad3(++_0x3d0c67);}(_0x7838,0x16d));var _0x8783=function(_0x4baae2,_0x487ab6){_0x4baae2=_0x4baae2-0x0;var _0x1a2285=_0x7838[_0x4baae2];return _0x1a2285;};'use strict';var Sequelize=require(_0x8783('0x0'));module[_0x8783('0x1')]={'name':{'type':Sequelize[_0x8783('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xcaed=['STRING','exports'];(function(_0x90ca33,_0x99448a){var _0x1e6a9a=function(_0x20e0b1){while(--_0x20e0b1){_0x90ca33['push'](_0x90ca33['shift']());}};_0x1e6a9a(++_0x99448a);}(_0xcaed,0x19d));var _0xdcae=function(_0x1da119,_0x258d53){_0x1da119=_0x1da119-0x0;var _0x4d2a56=_0xcaed[_0x1da119];return _0x4d2a56;};'use strict';var Sequelize=require('sequelize');module[_0xdcae('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xdcae('0x1')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js index d33466c..b88ca2b 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 _0x4223=['pick','filter','merge','VIRTUAL','options','include','findAll','catch','show','fields','includeAll','find','create','body','params','getFields','findOne','SugarcrmField','getSubjects','getDescriptions','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../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','error','stack','name','index','map','SugarcrmConfiguration','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','filters'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x4223,0x1ae));var _0x3422=function(_0x5e365a,_0x52d517){_0x5e365a=_0x5e365a-0x0;var _0x344151=_0x4223[_0x5e365a];return _0x344151;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3422('0x0'));var zipdir=require(_0x3422('0x1'));var jsonpatch=require(_0x3422('0x2'));var rp=require('request-promise');var moment=require(_0x3422('0x3'));var BPromise=require(_0x3422('0x4'));var Mustache=require(_0x3422('0x5'));var util=require(_0x3422('0x6'));var path=require(_0x3422('0x7'));var sox=require(_0x3422('0x8'));var csv=require(_0x3422('0x9'));var ejs=require(_0x3422('0xa'));var fs=require('fs');var fs_extra=require(_0x3422('0xb'));var _=require(_0x3422('0xc'));var squel=require(_0x3422('0xd'));var crypto=require(_0x3422('0xe'));var jsforce=require(_0x3422('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x3422('0x10'));var Redis=require(_0x3422('0x11'));var authService=require(_0x3422('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x3422('0x13'))(_0x3422('0x14'));var utils=require(_0x3422('0x15'));var config=require(_0x3422('0x16'));var licenseUtil=require(_0x3422('0x17'));var db=require(_0x3422('0x18'))['db'];function respondWithStatusCode(_0x46c1d2,_0x57c00f){_0x57c00f=_0x57c00f||0xcc;return function(_0x2a0a61){if(_0x2a0a61){return _0x46c1d2[_0x3422('0x19')](_0x57c00f);}return _0x46c1d2['status'](_0x57c00f)[_0x3422('0x1a')]();};}function respondWithResult(_0x326cc0,_0x50b869){_0x50b869=_0x50b869||0xc8;return function(_0x5cacbb){if(_0x5cacbb){return _0x326cc0['status'](_0x50b869)[_0x3422('0x1b')](_0x5cacbb);}};}function respondWithFilteredResult(_0x6ff7e5,_0x22a009){return function(_0x1fd4f1){if(_0x1fd4f1){var _0x38dec7=typeof _0x22a009[_0x3422('0x1c')]===_0x3422('0x1d')&&typeof _0x22a009['limit']===_0x3422('0x1d');var _0x1f21ad=_0x1fd4f1['count'];var _0x55337d=_0x38dec7?0x0:_0x22a009['offset'];var _0x46b52d=_0x38dec7?_0x1fd4f1[_0x3422('0x1e')]:_0x22a009[_0x3422('0x1c')]+_0x22a009['limit'];var _0x1a8534;if(_0x46b52d>=_0x1f21ad){_0x46b52d=_0x1f21ad;_0x1a8534=0xc8;}else{_0x1a8534=0xce;}_0x6ff7e5[_0x3422('0x1f')](_0x1a8534);return _0x6ff7e5[_0x3422('0x20')](_0x3422('0x21'),_0x55337d+'-'+_0x46b52d+'/'+_0x1f21ad)['json'](_0x1fd4f1);}return null;};}function patchUpdates(_0x122d4c){return function(_0x36208e){try{jsonpatch['apply'](_0x36208e,_0x122d4c,!![]);}catch(_0x5f28bf){return BPromise[_0x3422('0x22')](_0x5f28bf);}return _0x36208e[_0x3422('0x23')]();};}function saveUpdates(_0x4f95f6,_0x3e406e){return function(_0x1da69f){if(_0x1da69f){return _0x1da69f[_0x3422('0x24')](_0x4f95f6)[_0x3422('0x25')](function(_0x2c4603){return _0x2c4603;});}return null;};}function removeEntity(_0x11182e,_0x500eff){return function(_0x179792){if(_0x179792){return _0x179792[_0x3422('0x26')]()[_0x3422('0x25')](function(){_0x11182e[_0x3422('0x1f')](0xcc)[_0x3422('0x1a')]();});}};}function handleEntityNotFound(_0x509b16,_0x59548f){return function(_0x4af73e){if(!_0x4af73e){_0x509b16[_0x3422('0x19')](0x194);}return _0x4af73e;};}function handleError(_0x5653d7,_0xe22ba8){_0xe22ba8=_0xe22ba8||0x1f4;return function(_0x3fdf60){logger[_0x3422('0x27')](_0x3fdf60[_0x3422('0x28')]);if(_0x3fdf60['name']){delete _0x3fdf60[_0x3422('0x29')];}_0x5653d7[_0x3422('0x1f')](_0xe22ba8)['send'](_0x3fdf60);};}exports[_0x3422('0x2a')]=function(_0x3cbbc5,_0x1c10ab){var _0x414a6b={},_0x59b661={},_0x2a46ff={'count':0x0,'rows':[]};var _0xb2c163=_[_0x3422('0x2b')](db[_0x3422('0x2c')][_0x3422('0x2d')],function(_0x3a9842){return{'name':_0x3a9842[_0x3422('0x2e')],'type':_0x3a9842[_0x3422('0x2f')][_0x3422('0x30')]};});_0x59b661[_0x3422('0x31')]=_[_0x3422('0x2b')](_0xb2c163,_0x3422('0x29'));_0x59b661[_0x3422('0x32')]=_[_0x3422('0x33')](_0x3cbbc5[_0x3422('0x32')]);_0x59b661['filters']=_[_0x3422('0x34')](_0x59b661[_0x3422('0x31')],_0x59b661[_0x3422('0x32')]);_0x414a6b[_0x3422('0x35')]=_[_0x3422('0x34')](_0x59b661[_0x3422('0x31')],qs['fields'](_0x3cbbc5[_0x3422('0x32')]['fields']));_0x414a6b[_0x3422('0x35')]=_0x414a6b['attributes'][_0x3422('0x36')]?_0x414a6b[_0x3422('0x35')]:_0x59b661[_0x3422('0x31')];if(!_0x3cbbc5[_0x3422('0x32')][_0x3422('0x37')](_0x3422('0x38'))){_0x414a6b[_0x3422('0x39')]=qs[_0x3422('0x39')](_0x3cbbc5[_0x3422('0x32')][_0x3422('0x39')]);_0x414a6b[_0x3422('0x1c')]=qs['offset'](_0x3cbbc5['query']['offset']);}_0x414a6b[_0x3422('0x3a')]=qs[_0x3422('0x3b')](_0x3cbbc5[_0x3422('0x32')][_0x3422('0x3b')]);_0x414a6b[_0x3422('0x3c')]=qs[_0x3422('0x3d')](_[_0x3422('0x3e')](_0x3cbbc5[_0x3422('0x32')],_0x59b661[_0x3422('0x3d')]),_0xb2c163);if(_0x3cbbc5[_0x3422('0x32')][_0x3422('0x3f')]){_0x414a6b[_0x3422('0x3c')]=_[_0x3422('0x40')](_0x414a6b[_0x3422('0x3c')],{'$or':_[_0x3422('0x2b')](_0xb2c163,function(_0x4130d7){if(_0x4130d7[_0x3422('0x2f')]!==_0x3422('0x41')){var _0x172bcb={};_0x172bcb[_0x4130d7[_0x3422('0x29')]]={'$like':'%'+_0x3cbbc5[_0x3422('0x32')][_0x3422('0x3f')]+'%'};return _0x172bcb;}})});}_0x414a6b=_[_0x3422('0x40')]({},_0x414a6b,_0x3cbbc5[_0x3422('0x42')]);var _0x3743e0={'where':_0x414a6b[_0x3422('0x3c')]};return db[_0x3422('0x2c')][_0x3422('0x1e')](_0x3743e0)['then'](function(_0x17f2b0){_0x2a46ff['count']=_0x17f2b0;if(_0x3cbbc5['query']['includeAll']){_0x414a6b[_0x3422('0x43')]=[{'all':!![]}];}return db[_0x3422('0x2c')][_0x3422('0x44')](_0x414a6b);})[_0x3422('0x25')](function(_0x491738){_0x2a46ff['rows']=_0x491738;return _0x2a46ff;})[_0x3422('0x25')](respondWithFilteredResult(_0x1c10ab,_0x414a6b))[_0x3422('0x45')](handleError(_0x1c10ab,null));};exports[_0x3422('0x46')]=function(_0x2840ab,_0x34dc47){var _0x58ee59={'raw':![],'where':{'id':_0x2840ab['params']['id']}},_0x28d504={};_0x28d504[_0x3422('0x31')]=_[_0x3422('0x33')](db[_0x3422('0x2c')][_0x3422('0x2d')]);_0x28d504['query']=_[_0x3422('0x33')](_0x2840ab[_0x3422('0x32')]);_0x28d504['filters']=_['intersection'](_0x28d504[_0x3422('0x31')],_0x28d504[_0x3422('0x32')]);_0x58ee59[_0x3422('0x35')]=_[_0x3422('0x34')](_0x28d504[_0x3422('0x31')],qs['fields'](_0x2840ab['query'][_0x3422('0x47')]));_0x58ee59[_0x3422('0x35')]=_0x58ee59[_0x3422('0x35')][_0x3422('0x36')]?_0x58ee59['attributes']:_0x28d504[_0x3422('0x31')];if(_0x2840ab['query'][_0x3422('0x48')]){_0x58ee59[_0x3422('0x43')]=[{'all':!![]}];}_0x58ee59=_[_0x3422('0x40')]({},_0x58ee59,_0x2840ab[_0x3422('0x42')]);return db[_0x3422('0x2c')][_0x3422('0x49')](_0x58ee59)[_0x3422('0x25')](handleEntityNotFound(_0x34dc47,null))['then'](respondWithResult(_0x34dc47,null))['catch'](handleError(_0x34dc47,null));};exports[_0x3422('0x4a')]=function(_0x39f11b,_0x46478b){return db[_0x3422('0x2c')]['create'](_0x39f11b[_0x3422('0x4b')],{})['then'](respondWithResult(_0x46478b,0xc9))[_0x3422('0x45')](handleError(_0x46478b,null));};exports[_0x3422('0x24')]=function(_0x270121,_0x28220c){if(_0x270121['body']['id']){delete _0x270121['body']['id'];}return db['SugarcrmConfiguration'][_0x3422('0x49')]({'where':{'id':_0x270121[_0x3422('0x4c')]['id']}})[_0x3422('0x25')](handleEntityNotFound(_0x28220c,null))['then'](saveUpdates(_0x270121[_0x3422('0x4b')],null))[_0x3422('0x25')](respondWithResult(_0x28220c,null))[_0x3422('0x45')](handleError(_0x28220c,null));};exports['destroy']=function(_0x2b08e7,_0x3671c4){return db[_0x3422('0x2c')]['find']({'where':{'id':_0x2b08e7['params']['id']}})[_0x3422('0x25')](handleEntityNotFound(_0x3671c4,null))[_0x3422('0x25')](removeEntity(_0x3671c4,null))[_0x3422('0x45')](handleError(_0x3671c4,null));};exports[_0x3422('0x4d')]=function(_0x3f83a4,_0x1ba859,_0x570b84){var _0x33a1d4={};var _0x2d152={};var _0x3798ee;var _0x218d73;return db['SugarcrmConfiguration'][_0x3422('0x4e')]({'where':{'id':_0x3f83a4[_0x3422('0x4c')]['id']}})[_0x3422('0x25')](handleEntityNotFound(_0x1ba859,null))[_0x3422('0x25')](function(_0xe7490e){if(_0xe7490e){_0x3798ee=_0xe7490e;_0x2d152[_0x3422('0x31')]=_['keys'](db[_0x3422('0x4f')]['rawAttributes']);_0x2d152[_0x3422('0x32')]=_[_0x3422('0x33')](_0x3f83a4[_0x3422('0x32')]);_0x2d152[_0x3422('0x3d')]=_['intersection'](_0x2d152['model'],_0x2d152[_0x3422('0x32')]);_0x33a1d4[_0x3422('0x35')]=_[_0x3422('0x34')](_0x2d152[_0x3422('0x31')],qs[_0x3422('0x47')](_0x3f83a4[_0x3422('0x32')]['fields']));_0x33a1d4['attributes']=_0x33a1d4[_0x3422('0x35')]['length']?_0x33a1d4[_0x3422('0x35')]:_0x2d152['model'];_0x33a1d4[_0x3422('0x3a')]=qs[_0x3422('0x3b')](_0x3f83a4[_0x3422('0x32')][_0x3422('0x3b')]);_0x33a1d4[_0x3422('0x3c')]=qs['filters'](_[_0x3422('0x3e')](_0x3f83a4['query'],_0x2d152['filters']));if(_0x3f83a4[_0x3422('0x32')][_0x3422('0x3f')]){_0x33a1d4['where']=_[_0x3422('0x40')](_0x33a1d4[_0x3422('0x3c')],{'$or':_[_0x3422('0x2b')](_0x33a1d4[_0x3422('0x35')],function(_0x5b790d){var _0x27bd8e={};_0x27bd8e[_0x5b790d]={'$like':'%'+_0x3f83a4[_0x3422('0x32')][_0x3422('0x3f')]+'%'};return _0x27bd8e;})});}_0x33a1d4=_[_0x3422('0x40')]({},_0x33a1d4,_0x3f83a4[_0x3422('0x42')]);return _0x3798ee[_0x3422('0x4d')](_0x33a1d4);}})[_0x3422('0x25')](function(_0x2adc99){if(_0x2adc99){_0x218d73=_0x2adc99[_0x3422('0x36')];if(!_0x3f83a4['query']['hasOwnProperty'](_0x3422('0x38'))){_0x33a1d4[_0x3422('0x39')]=qs[_0x3422('0x39')](_0x3f83a4[_0x3422('0x32')]['limit']);_0x33a1d4[_0x3422('0x1c')]=qs[_0x3422('0x1c')](_0x3f83a4[_0x3422('0x32')]['offset']);}return _0x3798ee[_0x3422('0x4d')](_0x33a1d4);}})[_0x3422('0x25')](function(_0x9e8871){if(_0x9e8871){return _0x9e8871?{'count':_0x218d73,'rows':_0x9e8871}:null;}})[_0x3422('0x25')](respondWithResult(_0x1ba859,null))[_0x3422('0x45')](handleError(_0x1ba859,null));};exports[_0x3422('0x50')]=function(_0x5f4c29,_0x2b5ab5,_0x4bf9ce){var _0x3b736a={};var _0x1d4387={};var _0x47180e;var _0x56a3c9;return db[_0x3422('0x2c')]['findOne']({'where':{'id':_0x5f4c29[_0x3422('0x4c')]['id']}})[_0x3422('0x25')](handleEntityNotFound(_0x2b5ab5,null))[_0x3422('0x25')](function(_0x2b3bb3){if(_0x2b3bb3){_0x47180e=_0x2b3bb3;_0x1d4387['model']=_[_0x3422('0x33')](db[_0x3422('0x4f')][_0x3422('0x2d')]);_0x1d4387[_0x3422('0x32')]=_['keys'](_0x5f4c29['query']);_0x1d4387['filters']=_[_0x3422('0x34')](_0x1d4387[_0x3422('0x31')],_0x1d4387['query']);_0x3b736a[_0x3422('0x35')]=_['intersection'](_0x1d4387[_0x3422('0x31')],qs[_0x3422('0x47')](_0x5f4c29['query'][_0x3422('0x47')]));_0x3b736a[_0x3422('0x35')]=_0x3b736a[_0x3422('0x35')]['length']?_0x3b736a[_0x3422('0x35')]:_0x1d4387[_0x3422('0x31')];_0x3b736a['order']=qs[_0x3422('0x3b')](_0x5f4c29[_0x3422('0x32')][_0x3422('0x3b')]);_0x3b736a[_0x3422('0x3c')]=qs[_0x3422('0x3d')](_[_0x3422('0x3e')](_0x5f4c29[_0x3422('0x32')],_0x1d4387[_0x3422('0x3d')]));if(_0x5f4c29[_0x3422('0x32')][_0x3422('0x3f')]){_0x3b736a['where']=_[_0x3422('0x40')](_0x3b736a[_0x3422('0x3c')],{'$or':_['map'](_0x3b736a[_0x3422('0x35')],function(_0xa8a933){var _0x36e2e9={};_0x36e2e9[_0xa8a933]={'$like':'%'+_0x5f4c29['query'][_0x3422('0x3f')]+'%'};return _0x36e2e9;})});}_0x3b736a=_[_0x3422('0x40')]({},_0x3b736a,_0x5f4c29[_0x3422('0x42')]);return _0x47180e[_0x3422('0x50')](_0x3b736a);}})[_0x3422('0x25')](function(_0x34ae48){if(_0x34ae48){_0x56a3c9=_0x34ae48[_0x3422('0x36')];if(!_0x5f4c29[_0x3422('0x32')][_0x3422('0x37')](_0x3422('0x38'))){_0x3b736a[_0x3422('0x39')]=qs[_0x3422('0x39')](_0x5f4c29[_0x3422('0x32')][_0x3422('0x39')]);_0x3b736a['offset']=qs[_0x3422('0x1c')](_0x5f4c29[_0x3422('0x32')]['offset']);}return _0x47180e[_0x3422('0x50')](_0x3b736a);}})[_0x3422('0x25')](function(_0x1cfb65){if(_0x1cfb65){return _0x1cfb65?{'count':_0x56a3c9,'rows':_0x1cfb65}:null;}})[_0x3422('0x25')](respondWithResult(_0x2b5ab5,null))['catch'](handleError(_0x2b5ab5,null));};exports[_0x3422('0x51')]=function(_0x5b5576,_0x442dc6,_0x3fb417){var _0x11bb8b={};var _0x18688c={};var _0x391fee;var _0x2b8f6c;return db[_0x3422('0x2c')][_0x3422('0x4e')]({'where':{'id':_0x5b5576[_0x3422('0x4c')]['id']}})[_0x3422('0x25')](handleEntityNotFound(_0x442dc6,null))[_0x3422('0x25')](function(_0x26ee01){if(_0x26ee01){_0x391fee=_0x26ee01;_0x18688c[_0x3422('0x31')]=_[_0x3422('0x33')](db[_0x3422('0x4f')][_0x3422('0x2d')]);_0x18688c[_0x3422('0x32')]=_[_0x3422('0x33')](_0x5b5576['query']);_0x18688c['filters']=_[_0x3422('0x34')](_0x18688c[_0x3422('0x31')],_0x18688c[_0x3422('0x32')]);_0x11bb8b['attributes']=_['intersection'](_0x18688c['model'],qs['fields'](_0x5b5576[_0x3422('0x32')][_0x3422('0x47')]));_0x11bb8b[_0x3422('0x35')]=_0x11bb8b[_0x3422('0x35')]['length']?_0x11bb8b[_0x3422('0x35')]:_0x18688c['model'];_0x11bb8b[_0x3422('0x3a')]=qs['sort'](_0x5b5576[_0x3422('0x32')]['sort']);_0x11bb8b[_0x3422('0x3c')]=qs[_0x3422('0x3d')](_['pick'](_0x5b5576[_0x3422('0x32')],_0x18688c[_0x3422('0x3d')]));if(_0x5b5576[_0x3422('0x32')][_0x3422('0x3f')]){_0x11bb8b[_0x3422('0x3c')]=_[_0x3422('0x40')](_0x11bb8b[_0x3422('0x3c')],{'$or':_['map'](_0x11bb8b[_0x3422('0x35')],function(_0x5f64b9){var _0x240890={};_0x240890[_0x5f64b9]={'$like':'%'+_0x5b5576['query'][_0x3422('0x3f')]+'%'};return _0x240890;})});}_0x11bb8b=_[_0x3422('0x40')]({},_0x11bb8b,_0x5b5576['options']);return _0x391fee[_0x3422('0x51')](_0x11bb8b);}})[_0x3422('0x25')](function(_0x2b3fdb){if(_0x2b3fdb){_0x2b8f6c=_0x2b3fdb[_0x3422('0x36')];if(!_0x5b5576['query'][_0x3422('0x37')]('nolimit')){_0x11bb8b['limit']=qs[_0x3422('0x39')](_0x5b5576['query'][_0x3422('0x39')]);_0x11bb8b[_0x3422('0x1c')]=qs[_0x3422('0x1c')](_0x5b5576[_0x3422('0x32')]['offset']);}return _0x391fee[_0x3422('0x51')](_0x11bb8b);}})[_0x3422('0x25')](function(_0x1937ef){if(_0x1937ef){return _0x1937ef?{'count':_0x2b8f6c,'rows':_0x1937ef}:null;}})[_0x3422('0x25')](respondWithResult(_0x442dc6,null))[_0x3422('0x45')](handleError(_0x442dc6,null));}; \ No newline at end of file +var _0x8af5=['path','sox','to-csv','fs-extra','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','reject','save','update','then','stack','name','send','index','map','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','type','options','SugarcrmConfiguration','includeAll','findAll','rows','catch','show','params','include','find','create','body','destroy','getFields','findOne','SugarcrmField','nolimit','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache'];(function(_0x24061a,_0x1c9f4d){var _0x82054e=function(_0x2ec346){while(--_0x2ec346){_0x24061a['push'](_0x24061a['shift']());}};_0x82054e(++_0x1c9f4d);}(_0x8af5,0x17f));var _0x58af=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8af5[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x58af('0x0'));var rimraf=require(_0x58af('0x1'));var zipdir=require(_0x58af('0x2'));var jsonpatch=require(_0x58af('0x3'));var rp=require(_0x58af('0x4'));var moment=require('moment');var BPromise=require(_0x58af('0x5'));var Mustache=require(_0x58af('0x6'));var util=require('util');var path=require(_0x58af('0x7'));var sox=require(_0x58af('0x8'));var csv=require(_0x58af('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x58af('0xa'));var _=require('lodash');var squel=require(_0x58af('0xb'));var crypto=require('crypto');var jsforce=require(_0x58af('0xc'));var deskjs=require(_0x58af('0xd'));var toCsv=require(_0x58af('0x9'));var querystring=require(_0x58af('0xe'));var Papa=require(_0x58af('0xf'));var Redis=require('ioredis');var authService=require(_0x58af('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x58af('0x11'));var utils=require('../../config/utils');var config=require(_0x58af('0x12'));var licenseUtil=require(_0x58af('0x13'));var db=require(_0x58af('0x14'))['db'];function respondWithStatusCode(_0x17d8aa,_0x4e9802){_0x4e9802=_0x4e9802||0xcc;return function(_0x52692a){if(_0x52692a){return _0x17d8aa[_0x58af('0x15')](_0x4e9802);}return _0x17d8aa[_0x58af('0x16')](_0x4e9802)[_0x58af('0x17')]();};}function respondWithResult(_0x2be2e5,_0x28b27b){_0x28b27b=_0x28b27b||0xc8;return function(_0x2c1b43){if(_0x2c1b43){return _0x2be2e5[_0x58af('0x16')](_0x28b27b)['json'](_0x2c1b43);}};}function respondWithFilteredResult(_0x49c624,_0x71f263){return function(_0x1d9103){if(_0x1d9103){var _0x1c7e3d=typeof _0x71f263[_0x58af('0x18')]===_0x58af('0x19')&&typeof _0x71f263[_0x58af('0x1a')]===_0x58af('0x19');var _0x2eedba=_0x1d9103[_0x58af('0x1b')];var _0x10f775=_0x1c7e3d?0x0:_0x71f263[_0x58af('0x18')];var _0xa66d2=_0x1c7e3d?_0x1d9103[_0x58af('0x1b')]:_0x71f263[_0x58af('0x18')]+_0x71f263['limit'];var _0x5d7073;if(_0xa66d2>=_0x2eedba){_0xa66d2=_0x2eedba;_0x5d7073=0xc8;}else{_0x5d7073=0xce;}_0x49c624[_0x58af('0x16')](_0x5d7073);return _0x49c624[_0x58af('0x1c')](_0x58af('0x1d'),_0x10f775+'-'+_0xa66d2+'/'+_0x2eedba)[_0x58af('0x1e')](_0x1d9103);}return null;};}function patchUpdates(_0x461b83){return function(_0x44b0e9){try{jsonpatch['apply'](_0x44b0e9,_0x461b83,!![]);}catch(_0x1c51c4){return BPromise[_0x58af('0x1f')](_0x1c51c4);}return _0x44b0e9[_0x58af('0x20')]();};}function saveUpdates(_0x1a4ff4,_0x1b0faa){return function(_0x1af6e3){if(_0x1af6e3){return _0x1af6e3[_0x58af('0x21')](_0x1a4ff4)[_0x58af('0x22')](function(_0x56287b){return _0x56287b;});}return null;};}function removeEntity(_0x326c77,_0x577801){return function(_0x4941d2){if(_0x4941d2){return _0x4941d2['destroy']()[_0x58af('0x22')](function(){_0x326c77[_0x58af('0x16')](0xcc)[_0x58af('0x17')]();});}};}function handleEntityNotFound(_0x2472cc,_0x178c63){return function(_0x3d9b2c){if(!_0x3d9b2c){_0x2472cc[_0x58af('0x15')](0x194);}return _0x3d9b2c;};}function handleError(_0x70c45b,_0x3f3c8a){_0x3f3c8a=_0x3f3c8a||0x1f4;return function(_0x2688d6){logger['error'](_0x2688d6[_0x58af('0x23')]);if(_0x2688d6[_0x58af('0x24')]){delete _0x2688d6['name'];}_0x70c45b[_0x58af('0x16')](_0x3f3c8a)[_0x58af('0x25')](_0x2688d6);};}exports[_0x58af('0x26')]=function(_0x16e205,_0x4b156c){var _0x3bea7c={},_0xe09960={},_0x5886f0={'count':0x0,'rows':[]};var _0x23e593=_[_0x58af('0x27')](db['SugarcrmConfiguration'][_0x58af('0x28')],function(_0x22bd82){return{'name':_0x22bd82[_0x58af('0x29')],'type':_0x22bd82['type'][_0x58af('0x2a')]};});_0xe09960[_0x58af('0x2b')]=_['map'](_0x23e593,_0x58af('0x24'));_0xe09960[_0x58af('0x2c')]=_[_0x58af('0x2d')](_0x16e205[_0x58af('0x2c')]);_0xe09960[_0x58af('0x2e')]=_[_0x58af('0x2f')](_0xe09960[_0x58af('0x2b')],_0xe09960[_0x58af('0x2c')]);_0x3bea7c[_0x58af('0x30')]=_[_0x58af('0x2f')](_0xe09960['model'],qs[_0x58af('0x31')](_0x16e205[_0x58af('0x2c')]['fields']));_0x3bea7c[_0x58af('0x30')]=_0x3bea7c[_0x58af('0x30')][_0x58af('0x32')]?_0x3bea7c[_0x58af('0x30')]:_0xe09960[_0x58af('0x2b')];if(!_0x16e205[_0x58af('0x2c')][_0x58af('0x33')]('nolimit')){_0x3bea7c['limit']=qs[_0x58af('0x1a')](_0x16e205['query'][_0x58af('0x1a')]);_0x3bea7c[_0x58af('0x18')]=qs['offset'](_0x16e205[_0x58af('0x2c')]['offset']);}_0x3bea7c[_0x58af('0x34')]=qs['sort'](_0x16e205['query'][_0x58af('0x35')]);_0x3bea7c[_0x58af('0x36')]=qs[_0x58af('0x2e')](_[_0x58af('0x37')](_0x16e205[_0x58af('0x2c')],_0xe09960['filters']),_0x23e593);if(_0x16e205[_0x58af('0x2c')][_0x58af('0x38')]){_0x3bea7c[_0x58af('0x36')]=_[_0x58af('0x39')](_0x3bea7c[_0x58af('0x36')],{'$or':_[_0x58af('0x27')](_0x23e593,function(_0x59dbb7){if(_0x59dbb7[_0x58af('0x3a')]!=='VIRTUAL'){var _0x2dcb35={};_0x2dcb35[_0x59dbb7[_0x58af('0x24')]]={'$like':'%'+_0x16e205[_0x58af('0x2c')][_0x58af('0x38')]+'%'};return _0x2dcb35;}})});}_0x3bea7c=_[_0x58af('0x39')]({},_0x3bea7c,_0x16e205[_0x58af('0x3b')]);var _0x2dcc83={'where':_0x3bea7c[_0x58af('0x36')]};return db[_0x58af('0x3c')][_0x58af('0x1b')](_0x2dcc83)[_0x58af('0x22')](function(_0x2c7719){_0x5886f0['count']=_0x2c7719;if(_0x16e205[_0x58af('0x2c')][_0x58af('0x3d')]){_0x3bea7c['include']=[{'all':!![]}];}return db['SugarcrmConfiguration'][_0x58af('0x3e')](_0x3bea7c);})['then'](function(_0x19b758){_0x5886f0[_0x58af('0x3f')]=_0x19b758;return _0x5886f0;})[_0x58af('0x22')](respondWithFilteredResult(_0x4b156c,_0x3bea7c))[_0x58af('0x40')](handleError(_0x4b156c,null));};exports[_0x58af('0x41')]=function(_0x25950f,_0x29b0cf){var _0xfe4e6e={'raw':![],'where':{'id':_0x25950f[_0x58af('0x42')]['id']}},_0x2fb065={};_0x2fb065[_0x58af('0x2b')]=_[_0x58af('0x2d')](db[_0x58af('0x3c')]['rawAttributes']);_0x2fb065[_0x58af('0x2c')]=_[_0x58af('0x2d')](_0x25950f[_0x58af('0x2c')]);_0x2fb065[_0x58af('0x2e')]=_[_0x58af('0x2f')](_0x2fb065[_0x58af('0x2b')],_0x2fb065[_0x58af('0x2c')]);_0xfe4e6e[_0x58af('0x30')]=_['intersection'](_0x2fb065['model'],qs[_0x58af('0x31')](_0x25950f[_0x58af('0x2c')][_0x58af('0x31')]));_0xfe4e6e[_0x58af('0x30')]=_0xfe4e6e[_0x58af('0x30')][_0x58af('0x32')]?_0xfe4e6e[_0x58af('0x30')]:_0x2fb065[_0x58af('0x2b')];if(_0x25950f[_0x58af('0x2c')][_0x58af('0x3d')]){_0xfe4e6e[_0x58af('0x43')]=[{'all':!![]}];}_0xfe4e6e=_[_0x58af('0x39')]({},_0xfe4e6e,_0x25950f[_0x58af('0x3b')]);return db[_0x58af('0x3c')][_0x58af('0x44')](_0xfe4e6e)[_0x58af('0x22')](handleEntityNotFound(_0x29b0cf,null))[_0x58af('0x22')](respondWithResult(_0x29b0cf,null))['catch'](handleError(_0x29b0cf,null));};exports[_0x58af('0x45')]=function(_0x286813,_0x9950a2){return db['SugarcrmConfiguration']['create'](_0x286813[_0x58af('0x46')],{})[_0x58af('0x22')](respondWithResult(_0x9950a2,0xc9))[_0x58af('0x40')](handleError(_0x9950a2,null));};exports['update']=function(_0x85c6a9,_0x1546a7){if(_0x85c6a9[_0x58af('0x46')]['id']){delete _0x85c6a9[_0x58af('0x46')]['id'];}return db[_0x58af('0x3c')][_0x58af('0x44')]({'where':{'id':_0x85c6a9[_0x58af('0x42')]['id']}})[_0x58af('0x22')](handleEntityNotFound(_0x1546a7,null))[_0x58af('0x22')](saveUpdates(_0x85c6a9[_0x58af('0x46')],null))['then'](respondWithResult(_0x1546a7,null))[_0x58af('0x40')](handleError(_0x1546a7,null));};exports[_0x58af('0x47')]=function(_0x40311e,_0x1c3a8a){return db['SugarcrmConfiguration'][_0x58af('0x44')]({'where':{'id':_0x40311e[_0x58af('0x42')]['id']}})['then'](handleEntityNotFound(_0x1c3a8a,null))[_0x58af('0x22')](removeEntity(_0x1c3a8a,null))[_0x58af('0x40')](handleError(_0x1c3a8a,null));};exports[_0x58af('0x48')]=function(_0x3d446b,_0x30e4b9,_0x5bd328){var _0x14dbb7={};var _0x5e4967={};var _0x5d361b;var _0x25c4e0;return db[_0x58af('0x3c')][_0x58af('0x49')]({'where':{'id':_0x3d446b[_0x58af('0x42')]['id']}})[_0x58af('0x22')](handleEntityNotFound(_0x30e4b9,null))[_0x58af('0x22')](function(_0x114841){if(_0x114841){_0x5d361b=_0x114841;_0x5e4967[_0x58af('0x2b')]=_[_0x58af('0x2d')](db[_0x58af('0x4a')][_0x58af('0x28')]);_0x5e4967[_0x58af('0x2c')]=_['keys'](_0x3d446b[_0x58af('0x2c')]);_0x5e4967[_0x58af('0x2e')]=_['intersection'](_0x5e4967[_0x58af('0x2b')],_0x5e4967[_0x58af('0x2c')]);_0x14dbb7[_0x58af('0x30')]=_[_0x58af('0x2f')](_0x5e4967[_0x58af('0x2b')],qs[_0x58af('0x31')](_0x3d446b[_0x58af('0x2c')][_0x58af('0x31')]));_0x14dbb7[_0x58af('0x30')]=_0x14dbb7['attributes'][_0x58af('0x32')]?_0x14dbb7[_0x58af('0x30')]:_0x5e4967[_0x58af('0x2b')];_0x14dbb7[_0x58af('0x34')]=qs['sort'](_0x3d446b[_0x58af('0x2c')][_0x58af('0x35')]);_0x14dbb7['where']=qs['filters'](_['pick'](_0x3d446b[_0x58af('0x2c')],_0x5e4967[_0x58af('0x2e')]));if(_0x3d446b['query'][_0x58af('0x38')]){_0x14dbb7[_0x58af('0x36')]=_[_0x58af('0x39')](_0x14dbb7[_0x58af('0x36')],{'$or':_[_0x58af('0x27')](_0x14dbb7[_0x58af('0x30')],function(_0x3b669b){var _0x6d0874={};_0x6d0874[_0x3b669b]={'$like':'%'+_0x3d446b['query'][_0x58af('0x38')]+'%'};return _0x6d0874;})});}_0x14dbb7=_['merge']({},_0x14dbb7,_0x3d446b[_0x58af('0x3b')]);return _0x5d361b[_0x58af('0x48')](_0x14dbb7);}})[_0x58af('0x22')](function(_0x4a1c2d){if(_0x4a1c2d){_0x25c4e0=_0x4a1c2d[_0x58af('0x32')];if(!_0x3d446b[_0x58af('0x2c')]['hasOwnProperty'](_0x58af('0x4b'))){_0x14dbb7['limit']=qs[_0x58af('0x1a')](_0x3d446b[_0x58af('0x2c')][_0x58af('0x1a')]);_0x14dbb7[_0x58af('0x18')]=qs['offset'](_0x3d446b[_0x58af('0x2c')]['offset']);}return _0x5d361b['getFields'](_0x14dbb7);}})[_0x58af('0x22')](function(_0xe4e4d9){if(_0xe4e4d9){return _0xe4e4d9?{'count':_0x25c4e0,'rows':_0xe4e4d9}:null;}})[_0x58af('0x22')](respondWithResult(_0x30e4b9,null))[_0x58af('0x40')](handleError(_0x30e4b9,null));};exports['getSubjects']=function(_0x37aa7c,_0x1aa964,_0x556e8b){var _0x5344b7={};var _0xc74b52={};var _0x34ac56;var _0x19878b;return db[_0x58af('0x3c')][_0x58af('0x49')]({'where':{'id':_0x37aa7c[_0x58af('0x42')]['id']}})[_0x58af('0x22')](handleEntityNotFound(_0x1aa964,null))[_0x58af('0x22')](function(_0xd83f80){if(_0xd83f80){_0x34ac56=_0xd83f80;_0xc74b52[_0x58af('0x2b')]=_[_0x58af('0x2d')](db[_0x58af('0x4a')][_0x58af('0x28')]);_0xc74b52[_0x58af('0x2c')]=_['keys'](_0x37aa7c[_0x58af('0x2c')]);_0xc74b52[_0x58af('0x2e')]=_[_0x58af('0x2f')](_0xc74b52[_0x58af('0x2b')],_0xc74b52[_0x58af('0x2c')]);_0x5344b7[_0x58af('0x30')]=_[_0x58af('0x2f')](_0xc74b52['model'],qs[_0x58af('0x31')](_0x37aa7c['query'][_0x58af('0x31')]));_0x5344b7[_0x58af('0x30')]=_0x5344b7[_0x58af('0x30')][_0x58af('0x32')]?_0x5344b7['attributes']:_0xc74b52['model'];_0x5344b7[_0x58af('0x34')]=qs[_0x58af('0x35')](_0x37aa7c[_0x58af('0x2c')][_0x58af('0x35')]);_0x5344b7[_0x58af('0x36')]=qs[_0x58af('0x2e')](_[_0x58af('0x37')](_0x37aa7c[_0x58af('0x2c')],_0xc74b52['filters']));if(_0x37aa7c[_0x58af('0x2c')][_0x58af('0x38')]){_0x5344b7[_0x58af('0x36')]=_[_0x58af('0x39')](_0x5344b7[_0x58af('0x36')],{'$or':_[_0x58af('0x27')](_0x5344b7[_0x58af('0x30')],function(_0x56918e){var _0x321647={};_0x321647[_0x56918e]={'$like':'%'+_0x37aa7c[_0x58af('0x2c')]['filter']+'%'};return _0x321647;})});}_0x5344b7=_['merge']({},_0x5344b7,_0x37aa7c[_0x58af('0x3b')]);return _0x34ac56[_0x58af('0x4c')](_0x5344b7);}})['then'](function(_0x224ff4){if(_0x224ff4){_0x19878b=_0x224ff4['length'];if(!_0x37aa7c['query']['hasOwnProperty']('nolimit')){_0x5344b7[_0x58af('0x1a')]=qs[_0x58af('0x1a')](_0x37aa7c[_0x58af('0x2c')]['limit']);_0x5344b7[_0x58af('0x18')]=qs[_0x58af('0x18')](_0x37aa7c[_0x58af('0x2c')][_0x58af('0x18')]);}return _0x34ac56['getSubjects'](_0x5344b7);}})[_0x58af('0x22')](function(_0x44e6e3){if(_0x44e6e3){return _0x44e6e3?{'count':_0x19878b,'rows':_0x44e6e3}:null;}})[_0x58af('0x22')](respondWithResult(_0x1aa964,null))[_0x58af('0x40')](handleError(_0x1aa964,null));};exports[_0x58af('0x4d')]=function(_0xd97f4,_0x2eb4fd,_0x3c166c){var _0x434588={};var _0x5c7362={};var _0x40288d;var _0x500580;return db[_0x58af('0x3c')][_0x58af('0x49')]({'where':{'id':_0xd97f4[_0x58af('0x42')]['id']}})[_0x58af('0x22')](handleEntityNotFound(_0x2eb4fd,null))[_0x58af('0x22')](function(_0xcd3ddd){if(_0xcd3ddd){_0x40288d=_0xcd3ddd;_0x5c7362['model']=_[_0x58af('0x2d')](db['SugarcrmField'][_0x58af('0x28')]);_0x5c7362[_0x58af('0x2c')]=_['keys'](_0xd97f4[_0x58af('0x2c')]);_0x5c7362[_0x58af('0x2e')]=_[_0x58af('0x2f')](_0x5c7362[_0x58af('0x2b')],_0x5c7362[_0x58af('0x2c')]);_0x434588[_0x58af('0x30')]=_[_0x58af('0x2f')](_0x5c7362[_0x58af('0x2b')],qs[_0x58af('0x31')](_0xd97f4[_0x58af('0x2c')]['fields']));_0x434588[_0x58af('0x30')]=_0x434588['attributes'][_0x58af('0x32')]?_0x434588[_0x58af('0x30')]:_0x5c7362['model'];_0x434588['order']=qs[_0x58af('0x35')](_0xd97f4[_0x58af('0x2c')][_0x58af('0x35')]);_0x434588[_0x58af('0x36')]=qs[_0x58af('0x2e')](_['pick'](_0xd97f4[_0x58af('0x2c')],_0x5c7362[_0x58af('0x2e')]));if(_0xd97f4[_0x58af('0x2c')][_0x58af('0x38')]){_0x434588[_0x58af('0x36')]=_[_0x58af('0x39')](_0x434588[_0x58af('0x36')],{'$or':_[_0x58af('0x27')](_0x434588['attributes'],function(_0x5158fb){var _0x128a09={};_0x128a09[_0x5158fb]={'$like':'%'+_0xd97f4['query']['filter']+'%'};return _0x128a09;})});}_0x434588=_[_0x58af('0x39')]({},_0x434588,_0xd97f4[_0x58af('0x3b')]);return _0x40288d[_0x58af('0x4d')](_0x434588);}})[_0x58af('0x22')](function(_0x385477){if(_0x385477){_0x500580=_0x385477[_0x58af('0x32')];if(!_0xd97f4[_0x58af('0x2c')][_0x58af('0x33')](_0x58af('0x4b'))){_0x434588[_0x58af('0x1a')]=qs['limit'](_0xd97f4[_0x58af('0x2c')][_0x58af('0x1a')]);_0x434588[_0x58af('0x18')]=qs[_0x58af('0x18')](_0xd97f4[_0x58af('0x2c')][_0x58af('0x18')]);}return _0x40288d[_0x58af('0x4d')](_0x434588);}})['then'](function(_0x38cbb3){if(_0x38cbb3){return _0x38cbb3?{'count':_0x500580,'rows':_0x38cbb3}:null;}})[_0x58af('0x22')](respondWithResult(_0x2eb4fd,null))['catch'](handleError(_0x2eb4fd,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js index e53d7a7..23fec9e 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 _0x236f=['path','../../config/environment','./intSugarcrmConfiguration.attributes','define','SugarcrmConfiguration','util','../../config/logger','api','moment'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x236f,0x1e2));var _0xf236=function(_0x53e4c7,_0x350b33){_0x53e4c7=_0x53e4c7-0x0;var _0x2fc110=_0x236f[_0x53e4c7];return _0x2fc110;};'use strict';var _=require('lodash');var util=require(_0xf236('0x0'));var logger=require(_0xf236('0x1'))(_0xf236('0x2'));var moment=require(_0xf236('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xf236('0x4'));var rimraf=require('rimraf');var config=require(_0xf236('0x5'));var attributes=require(_0xf236('0x6'));module['exports']=function(_0x454eba,_0x3bc75d){return _0x454eba[_0xf236('0x7')](_0xf236('0x8'),attributes,{'tableName':'int_sugarcrm_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x063b=['define','SugarcrmConfiguration','lodash','../../config/logger','moment','bluebird','rimraf','../../config/environment','./intSugarcrmConfiguration.attributes'];(function(_0x403c8d,_0x5e3825){var _0x4ca60d=function(_0x9326c1){while(--_0x9326c1){_0x403c8d['push'](_0x403c8d['shift']());}};_0x4ca60d(++_0x5e3825);}(_0x063b,0xa4));var _0xb063=function(_0xc9201a,_0x56c603){_0xc9201a=_0xc9201a-0x0;var _0x3bd498=_0x063b[_0xc9201a];return _0x3bd498;};'use strict';var _=require(_0xb063('0x0'));var util=require('util');var logger=require(_0xb063('0x1'))('api');var moment=require(_0xb063('0x2'));var BPromise=require(_0xb063('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xb063('0x4'));var config=require(_0xb063('0x5'));var attributes=require(_0xb063('0x6'));module['exports']=function(_0x5babc6,_0x1ebf62){return _0x5babc6[_0xb063('0x7')](_0xb063('0x8'),attributes,{'tableName':'int_sugarcrm_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.rpc.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.rpc.js index 3bb255f..de5c36e 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 _0x9256=['ioredis','../../config/logger','../../config/environment','jayson/promise','client','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','error','code','message','info','result','catch','util','randomstring'];(function(_0x1669cc,_0x227ed6){var _0x3ce80c=function(_0x8d87db){while(--_0x8d87db){_0x1669cc['push'](_0x1669cc['shift']());}};_0x3ce80c(++_0x227ed6);}(_0x9256,0x1a2));var _0x6925=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9256[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x6925('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x6925('0x1'));var fs=require('fs');var Redis=require(_0x6925('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x6925('0x3'))('rpc');var config=require(_0x6925('0x4'));var jayson=require(_0x6925('0x5'));var client=jayson[_0x6925('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x41dd7a,_0x2c9f4f,_0xba9ea3){return new BPromise(function(_0x2048d4,_0x150436){return client['request'](_0x41dd7a,_0xba9ea3)['then'](function(_0x4e0df0){logger['info'](_0x6925('0x7'),_0x2c9f4f,'request\x20sent');logger['debug']('SugarcrmConfiguration,\x20%s,\x20%s,\x20%s',_0x2c9f4f,_0x6925('0x8'),JSON['stringify'](_0x4e0df0));if(_0x4e0df0[_0x6925('0x9')]){if(_0x4e0df0[_0x6925('0x9')][_0x6925('0xa')]===0x1f4){logger[_0x6925('0x9')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x2c9f4f,_0x4e0df0[_0x6925('0x9')][_0x6925('0xb')]);return _0x150436(_0x4e0df0['error']['message']);}logger[_0x6925('0x9')](_0x6925('0x7'),_0x2c9f4f,_0x4e0df0[_0x6925('0x9')]['message']);return _0x2048d4(_0x4e0df0[_0x6925('0x9')][_0x6925('0xb')]);}else{logger[_0x6925('0xc')](_0x6925('0x7'),_0x2c9f4f,_0x6925('0x8'));_0x2048d4(_0x4e0df0[_0x6925('0xd')][_0x6925('0xb')]);}})[_0x6925('0xe')](function(_0x1ea375){logger[_0x6925('0x9')](_0x6925('0x7'),_0x2c9f4f,_0x1ea375);_0x150436(_0x1ea375);});});} \ No newline at end of file +var _0x3c89=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','http','request','info','request\x20sent','debug','stringify','error','code','SugarcrmConfiguration,\x20%s,\x20%s','message','result','catch','lodash','moment'];(function(_0x201226,_0x578dfc){var _0x4b2f4a=function(_0x2a1037){while(--_0x2a1037){_0x201226['push'](_0x201226['shift']());}};_0x4b2f4a(++_0x578dfc);}(_0x3c89,0xfa));var _0x93c8=function(_0x1207f8,_0x2ecdb0){_0x1207f8=_0x1207f8-0x0;var _0x3dbcff=_0x3c89[_0x1207f8];return _0x3dbcff;};'use strict';var _=require(_0x93c8('0x0'));var util=require('util');var moment=require(_0x93c8('0x1'));var BPromise=require(_0x93c8('0x2'));var rs=require(_0x93c8('0x3'));var fs=require('fs');var Redis=require(_0x93c8('0x4'));var db=require(_0x93c8('0x5'))['db'];var utils=require(_0x93c8('0x6'));var logger=require('../../config/logger')(_0x93c8('0x7'));var config=require('../../config/environment');var jayson=require(_0x93c8('0x8'));var client=jayson['client'][_0x93c8('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4b2249,_0x27c921,_0xfa67ad){return new BPromise(function(_0x1b1149,_0x3688f5){return client[_0x93c8('0xa')](_0x4b2249,_0xfa67ad)['then'](function(_0x5c872a){logger[_0x93c8('0xb')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x27c921,_0x93c8('0xc'));logger[_0x93c8('0xd')]('SugarcrmConfiguration,\x20%s,\x20%s,\x20%s',_0x27c921,_0x93c8('0xc'),JSON[_0x93c8('0xe')](_0x5c872a));if(_0x5c872a[_0x93c8('0xf')]){if(_0x5c872a[_0x93c8('0xf')][_0x93c8('0x10')]===0x1f4){logger[_0x93c8('0xf')](_0x93c8('0x11'),_0x27c921,_0x5c872a['error'][_0x93c8('0x12')]);return _0x3688f5(_0x5c872a['error'][_0x93c8('0x12')]);}logger[_0x93c8('0xf')](_0x93c8('0x11'),_0x27c921,_0x5c872a[_0x93c8('0xf')][_0x93c8('0x12')]);return _0x1b1149(_0x5c872a['error'][_0x93c8('0x12')]);}else{logger[_0x93c8('0xb')](_0x93c8('0x11'),_0x27c921,_0x93c8('0xc'));_0x1b1149(_0x5c872a[_0x93c8('0x13')]['message']);}})[_0x93c8('0x14')](function(_0x56778f){logger[_0x93c8('0xf')](_0x93c8('0x11'),_0x27c921,_0x56778f);_0x3688f5(_0x56778f);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmField/index.js b/server/api/intSugarcrmField/index.js index 32aa263..c6cb1b8 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 _0xac41=['../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmField.controller','get','isAuthenticated','post','create','update','/:id','exports','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x1dab5f,_0x10cd21){var _0x40c2f3=function(_0x325a0d){while(--_0x325a0d){_0x1dab5f['push'](_0x1dab5f['shift']());}};_0x40c2f3(++_0x10cd21);}(_0xac41,0x12b));var _0x1ac4=function(_0x970c0c,_0x24de2c){_0x970c0c=_0x970c0c-0x0;var _0x2c62dc=_0xac41[_0x970c0c];return _0x2c62dc;};'use strict';var multer=require(_0x1ac4('0x0'));var util=require(_0x1ac4('0x1'));var path=require(_0x1ac4('0x2'));var timeout=require(_0x1ac4('0x3'));var express=require(_0x1ac4('0x4'));var router=express[_0x1ac4('0x5')]();var fs_extra=require(_0x1ac4('0x6'));var auth=require(_0x1ac4('0x7'));var interaction=require(_0x1ac4('0x8'));var config=require(_0x1ac4('0x9'));var controller=require(_0x1ac4('0xa'));router[_0x1ac4('0xb')]('/',auth[_0x1ac4('0xc')](),controller['index']);router[_0x1ac4('0xb')]('/:id',auth[_0x1ac4('0xc')](),controller['show']);router[_0x1ac4('0xd')]('/',auth[_0x1ac4('0xc')](),controller[_0x1ac4('0xe')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x1ac4('0xf')]);router['delete'](_0x1ac4('0x10'),auth['isAuthenticated'](),controller['destroy']);module[_0x1ac4('0x11')]=router; \ No newline at end of file +var _0x90be=['isAuthenticated','index','get','/:id','show','put','update','delete','destroy','exports','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x130c9a,_0x404ae9){var _0x121d64=function(_0xe4c73b){while(--_0xe4c73b){_0x130c9a['push'](_0x130c9a['shift']());}};_0x121d64(++_0x404ae9);}(_0x90be,0x160));var _0xe90b=function(_0x5b1968,_0x16e4eb){_0x5b1968=_0x5b1968-0x0;var _0x2e01ca=_0x90be[_0x5b1968];return _0x2e01ca;};'use strict';var multer=require(_0xe90b('0x0'));var util=require(_0xe90b('0x1'));var path=require('path');var timeout=require(_0xe90b('0x2'));var express=require('express');var router=express[_0xe90b('0x3')]();var fs_extra=require(_0xe90b('0x4'));var auth=require(_0xe90b('0x5'));var interaction=require(_0xe90b('0x6'));var config=require(_0xe90b('0x7'));var controller=require('./intSugarcrmField.controller');router['get']('/',auth[_0xe90b('0x8')](),controller[_0xe90b('0x9')]);router[_0xe90b('0xa')](_0xe90b('0xb'),auth[_0xe90b('0x8')](),controller[_0xe90b('0xc')]);router['post']('/',auth[_0xe90b('0x8')](),controller['create']);router[_0xe90b('0xd')]('/:id',auth['isAuthenticated'](),controller[_0xe90b('0xe')]);router[_0xe90b('0xf')](_0xe90b('0xb'),auth[_0xe90b('0x8')](),controller[_0xe90b('0x10')]);module[_0xe90b('0x11')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.attributes.js b/server/api/intSugarcrmField/intSugarcrmField.attributes.js index 3159513..20dcfad 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 _0xaf55=['keyValue','picklist','string','STRING','BOOLEAN','sequelize','exports','ENUM','variable','customVariable'];(function(_0x2357eb,_0x4d4338){var _0x555054=function(_0x5948e4){while(--_0x5948e4){_0x2357eb['push'](_0x2357eb['shift']());}};_0x555054(++_0x4d4338);}(_0xaf55,0x16d));var _0x5af5=function(_0x3c8e9a,_0x384306){_0x3c8e9a=_0x3c8e9a-0x0;var _0x2d4c57=_0xaf55[_0x3c8e9a];return _0x2d4c57;};'use strict';var Sequelize=require(_0x5af5('0x0'));module[_0x5af5('0x1')]={'type':{'type':Sequelize[_0x5af5('0x2')]('string',_0x5af5('0x3'),_0x5af5('0x4'),_0x5af5('0x5'),_0x5af5('0x6')),'defaultValue':_0x5af5('0x7')},'content':{'type':Sequelize[_0x5af5('0x8')]},'key':{'type':Sequelize[_0x5af5('0x8')]},'keyType':{'type':Sequelize[_0x5af5('0x2')]('string',_0x5af5('0x3'),'customVariable')},'keyContent':{'type':Sequelize[_0x5af5('0x8')]},'idField':{'type':Sequelize[_0x5af5('0x8')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x5af5('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x5af5('0x8')]}}; \ No newline at end of file +var _0xf00a=['BOOLEAN','exports','ENUM','string','keyValue','picklist','STRING','variable','customVariable'];(function(_0x13189c,_0x522313){var _0x3ee66e=function(_0x3f1d1c){while(--_0x3f1d1c){_0x13189c['push'](_0x13189c['shift']());}};_0x3ee66e(++_0x522313);}(_0xf00a,0x1c3));var _0xaf00=function(_0x3fa7d3,_0x37f83c){_0x3fa7d3=_0x3fa7d3-0x0;var _0x4c51bd=_0xf00a[_0x3fa7d3];return _0x4c51bd;};'use strict';var Sequelize=require('sequelize');module[_0xaf00('0x0')]={'type':{'type':Sequelize[_0xaf00('0x1')](_0xaf00('0x2'),'variable','customVariable',_0xaf00('0x3'),_0xaf00('0x4')),'defaultValue':_0xaf00('0x2')},'content':{'type':Sequelize[_0xaf00('0x5')]},'key':{'type':Sequelize[_0xaf00('0x5')]},'keyType':{'type':Sequelize[_0xaf00('0x1')](_0xaf00('0x2'),_0xaf00('0x6'),_0xaf00('0x7'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xaf00('0x5')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0xaf00('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xaf00('0x5')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.controller.js b/server/api/intSugarcrmField/intSugarcrmField.controller.js index c14a182..679d72e 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 _0x32b7=['../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','count','set','Content-Range','json','apply','reject','save','then','destroy','error','stack','name','send','index','SugarcrmField','rawAttributes','fieldName','key','model','map','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','type','includeAll','findAll','rows','catch','show','params','include','options','create','body','update','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x28a71a,_0x471c4d){var _0x43d164=function(_0x577b9e){while(--_0x577b9e){_0x28a71a['push'](_0x28a71a['shift']());}};_0x43d164(++_0x471c4d);}(_0x32b7,0xd8));var _0x732b=function(_0x3761e8,_0x47afb9){_0x3761e8=_0x3761e8-0x0;var _0x366d01=_0x32b7[_0x3761e8];return _0x366d01;};'use strict';var emlformat=require(_0x732b('0x0'));var rimraf=require(_0x732b('0x1'));var zipdir=require(_0x732b('0x2'));var jsonpatch=require(_0x732b('0x3'));var rp=require(_0x732b('0x4'));var moment=require(_0x732b('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x732b('0x6'));var util=require('util');var path=require(_0x732b('0x7'));var sox=require(_0x732b('0x8'));var csv=require('to-csv');var ejs=require(_0x732b('0x9'));var fs=require('fs');var fs_extra=require(_0x732b('0xa'));var _=require(_0x732b('0xb'));var squel=require(_0x732b('0xc'));var crypto=require('crypto');var jsforce=require(_0x732b('0xd'));var deskjs=require(_0x732b('0xe'));var toCsv=require(_0x732b('0xf'));var querystring=require(_0x732b('0x10'));var Papa=require(_0x732b('0x11'));var Redis=require(_0x732b('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x732b('0x13'));var as=require(_0x732b('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x732b('0x15'))('api');var utils=require('../../config/utils');var config=require(_0x732b('0x16'));var licenseUtil=require(_0x732b('0x17'));var db=require(_0x732b('0x18'))['db'];function respondWithStatusCode(_0x556ae8,_0x33eca1){_0x33eca1=_0x33eca1||0xcc;return function(_0x34ce01){if(_0x34ce01){return _0x556ae8[_0x732b('0x19')](_0x33eca1);}return _0x556ae8['status'](_0x33eca1)[_0x732b('0x1a')]();};}function respondWithResult(_0x453155,_0x69d9f1){_0x69d9f1=_0x69d9f1||0xc8;return function(_0x3ee7a0){if(_0x3ee7a0){return _0x453155[_0x732b('0x1b')](_0x69d9f1)['json'](_0x3ee7a0);}};}function respondWithFilteredResult(_0x19f1ca,_0x5ce078){return function(_0x415df1){if(_0x415df1){var _0x1aa361=typeof _0x5ce078[_0x732b('0x1c')]===_0x732b('0x1d')&&typeof _0x5ce078['limit']===_0x732b('0x1d');var _0x5aa77f=_0x415df1[_0x732b('0x1e')];var _0x18454f=_0x1aa361?0x0:_0x5ce078[_0x732b('0x1c')];var _0x52f0af=_0x1aa361?_0x415df1['count']:_0x5ce078[_0x732b('0x1c')]+_0x5ce078['limit'];var _0x2c9a4b;if(_0x52f0af>=_0x5aa77f){_0x52f0af=_0x5aa77f;_0x2c9a4b=0xc8;}else{_0x2c9a4b=0xce;}_0x19f1ca[_0x732b('0x1b')](_0x2c9a4b);return _0x19f1ca[_0x732b('0x1f')](_0x732b('0x20'),_0x18454f+'-'+_0x52f0af+'/'+_0x5aa77f)[_0x732b('0x21')](_0x415df1);}return null;};}function patchUpdates(_0x1aa795){return function(_0x364a78){try{jsonpatch[_0x732b('0x22')](_0x364a78,_0x1aa795,!![]);}catch(_0x23350c){return BPromise[_0x732b('0x23')](_0x23350c);}return _0x364a78[_0x732b('0x24')]();};}function saveUpdates(_0x16cb59,_0x4a5ee3){return function(_0x3d1eac){if(_0x3d1eac){return _0x3d1eac['update'](_0x16cb59)[_0x732b('0x25')](function(_0x10ab9a){return _0x10ab9a;});}return null;};}function removeEntity(_0x2f6bb3,_0x40d6bb){return function(_0x1091a0){if(_0x1091a0){return _0x1091a0[_0x732b('0x26')]()[_0x732b('0x25')](function(){_0x2f6bb3['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xc21308,_0xddcf2f){return function(_0x12f53c){if(!_0x12f53c){_0xc21308[_0x732b('0x19')](0x194);}return _0x12f53c;};}function handleError(_0x2cf4e6,_0x51f7b1){_0x51f7b1=_0x51f7b1||0x1f4;return function(_0x50f197){logger[_0x732b('0x27')](_0x50f197[_0x732b('0x28')]);if(_0x50f197[_0x732b('0x29')]){delete _0x50f197['name'];}_0x2cf4e6['status'](_0x51f7b1)[_0x732b('0x2a')](_0x50f197);};}exports[_0x732b('0x2b')]=function(_0x517f80,_0x4056c6){var _0x23029c={},_0x5d0527={},_0x334996={'count':0x0,'rows':[]};var _0x2ffecf=_['map'](db[_0x732b('0x2c')][_0x732b('0x2d')],function(_0x45e99b){return{'name':_0x45e99b[_0x732b('0x2e')],'type':_0x45e99b['type'][_0x732b('0x2f')]};});_0x5d0527[_0x732b('0x30')]=_[_0x732b('0x31')](_0x2ffecf,_0x732b('0x29'));_0x5d0527[_0x732b('0x32')]=_[_0x732b('0x33')](_0x517f80['query']);_0x5d0527[_0x732b('0x34')]=_['intersection'](_0x5d0527[_0x732b('0x30')],_0x5d0527[_0x732b('0x32')]);_0x23029c[_0x732b('0x35')]=_[_0x732b('0x36')](_0x5d0527[_0x732b('0x30')],qs['fields'](_0x517f80[_0x732b('0x32')][_0x732b('0x37')]));_0x23029c['attributes']=_0x23029c['attributes'][_0x732b('0x38')]?_0x23029c['attributes']:_0x5d0527[_0x732b('0x30')];if(!_0x517f80['query'][_0x732b('0x39')](_0x732b('0x3a'))){_0x23029c['limit']=qs[_0x732b('0x3b')](_0x517f80['query']['limit']);_0x23029c['offset']=qs[_0x732b('0x1c')](_0x517f80[_0x732b('0x32')][_0x732b('0x1c')]);}_0x23029c[_0x732b('0x3c')]=qs[_0x732b('0x3d')](_0x517f80[_0x732b('0x32')][_0x732b('0x3d')]);_0x23029c[_0x732b('0x3e')]=qs[_0x732b('0x34')](_[_0x732b('0x3f')](_0x517f80[_0x732b('0x32')],_0x5d0527[_0x732b('0x34')]),_0x2ffecf);if(_0x517f80[_0x732b('0x32')][_0x732b('0x40')]){_0x23029c[_0x732b('0x3e')]=_[_0x732b('0x41')](_0x23029c[_0x732b('0x3e')],{'$or':_[_0x732b('0x31')](_0x2ffecf,function(_0x9e7bc){if(_0x9e7bc[_0x732b('0x42')]!=='VIRTUAL'){var _0x5de6f3={};_0x5de6f3[_0x9e7bc['name']]={'$like':'%'+_0x517f80[_0x732b('0x32')][_0x732b('0x40')]+'%'};return _0x5de6f3;}})});}_0x23029c=_[_0x732b('0x41')]({},_0x23029c,_0x517f80['options']);var _0x161c0c={'where':_0x23029c[_0x732b('0x3e')]};return db[_0x732b('0x2c')][_0x732b('0x1e')](_0x161c0c)[_0x732b('0x25')](function(_0x49b311){_0x334996[_0x732b('0x1e')]=_0x49b311;if(_0x517f80[_0x732b('0x32')][_0x732b('0x43')]){_0x23029c['include']=[{'all':!![]}];}return db[_0x732b('0x2c')][_0x732b('0x44')](_0x23029c);})[_0x732b('0x25')](function(_0x4e1478){_0x334996[_0x732b('0x45')]=_0x4e1478;return _0x334996;})[_0x732b('0x25')](respondWithFilteredResult(_0x4056c6,_0x23029c))[_0x732b('0x46')](handleError(_0x4056c6,null));};exports[_0x732b('0x47')]=function(_0x33276a,_0x48f778){var _0x1aaad6={'raw':!![],'where':{'id':_0x33276a[_0x732b('0x48')]['id']}},_0x33678e={};_0x33678e[_0x732b('0x30')]=_['keys'](db['SugarcrmField']['rawAttributes']);_0x33678e[_0x732b('0x32')]=_['keys'](_0x33276a[_0x732b('0x32')]);_0x33678e['filters']=_[_0x732b('0x36')](_0x33678e[_0x732b('0x30')],_0x33678e['query']);_0x1aaad6[_0x732b('0x35')]=_[_0x732b('0x36')](_0x33678e[_0x732b('0x30')],qs[_0x732b('0x37')](_0x33276a[_0x732b('0x32')]['fields']));_0x1aaad6['attributes']=_0x1aaad6[_0x732b('0x35')]['length']?_0x1aaad6['attributes']:_0x33678e[_0x732b('0x30')];if(_0x33276a['query'][_0x732b('0x43')]){_0x1aaad6[_0x732b('0x49')]=[{'all':!![]}];}_0x1aaad6=_['merge']({},_0x1aaad6,_0x33276a[_0x732b('0x4a')]);return db['SugarcrmField']['find'](_0x1aaad6)['then'](handleEntityNotFound(_0x48f778,null))[_0x732b('0x25')](respondWithResult(_0x48f778,null))[_0x732b('0x46')](handleError(_0x48f778,null));};exports[_0x732b('0x4b')]=function(_0x41c5db,_0x28d781){return db['SugarcrmField'][_0x732b('0x4b')](_0x41c5db[_0x732b('0x4c')],{})[_0x732b('0x25')](respondWithResult(_0x28d781,0xc9))['catch'](handleError(_0x28d781,null));};exports[_0x732b('0x4d')]=function(_0x1203be,_0x2e2070){if(_0x1203be['body']['id']){delete _0x1203be[_0x732b('0x4c')]['id'];}return db[_0x732b('0x2c')][_0x732b('0x4e')]({'where':{'id':_0x1203be[_0x732b('0x48')]['id']}})[_0x732b('0x25')](handleEntityNotFound(_0x2e2070,null))[_0x732b('0x25')](saveUpdates(_0x1203be[_0x732b('0x4c')],null))[_0x732b('0x25')](respondWithResult(_0x2e2070,null))['catch'](handleError(_0x2e2070,null));};exports['destroy']=function(_0x8c3f3b,_0x4e746b){return db[_0x732b('0x2c')][_0x732b('0x4e')]({'where':{'id':_0x8c3f3b['params']['id']}})[_0x732b('0x25')](handleEntityNotFound(_0x4e746b,null))[_0x732b('0x25')](removeEntity(_0x4e746b,null))[_0x732b('0x46')](handleError(_0x4e746b,null));}; \ No newline at end of file +var _0x6ad9=['length','hasOwnProperty','nolimit','order','sort','where','filters','filter','type','VIRTUAL','options','count','includeAll','include','findAll','rows','params','create','catch','update','body','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','limit','set','Content-Range','apply','reject','then','destroy','sendStatus','stack','name','send','index','map','SugarcrmField','rawAttributes','fieldName','keys','query','intersection','model','attributes','fields'];(function(_0x1e6726,_0x5c979b){var _0x335a43=function(_0x1b9b49){while(--_0x1b9b49){_0x1e6726['push'](_0x1e6726['shift']());}};_0x335a43(++_0x5c979b);}(_0x6ad9,0x183));var _0x96ad=function(_0x1e51c6,_0x8f6738){_0x1e51c6=_0x1e51c6-0x0;var _0x47bd56=_0x6ad9[_0x1e51c6];return _0x47bd56;};'use strict';var emlformat=require(_0x96ad('0x0'));var rimraf=require(_0x96ad('0x1'));var zipdir=require(_0x96ad('0x2'));var jsonpatch=require(_0x96ad('0x3'));var rp=require(_0x96ad('0x4'));var moment=require(_0x96ad('0x5'));var BPromise=require(_0x96ad('0x6'));var Mustache=require(_0x96ad('0x7'));var util=require(_0x96ad('0x8'));var path=require(_0x96ad('0x9'));var sox=require('sox');var csv=require(_0x96ad('0xa'));var ejs=require(_0x96ad('0xb'));var fs=require('fs');var fs_extra=require(_0x96ad('0xc'));var _=require('lodash');var squel=require(_0x96ad('0xd'));var crypto=require('crypto');var jsforce=require(_0x96ad('0xe'));var deskjs=require(_0x96ad('0xf'));var toCsv=require(_0x96ad('0xa'));var querystring=require(_0x96ad('0x10'));var Papa=require('papaparse');var Redis=require(_0x96ad('0x11'));var authService=require(_0x96ad('0x12'));var qs=require(_0x96ad('0x13'));var as=require(_0x96ad('0x14'));var hardwareService=require(_0x96ad('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0x96ad('0x16'));var config=require(_0x96ad('0x17'));var licenseUtil=require(_0x96ad('0x18'));var db=require(_0x96ad('0x19'))['db'];function respondWithStatusCode(_0x408dd0,_0x56196a){_0x56196a=_0x56196a||0xcc;return function(_0x2af4ed){if(_0x2af4ed){return _0x408dd0['sendStatus'](_0x56196a);}return _0x408dd0[_0x96ad('0x1a')](_0x56196a)['end']();};}function respondWithResult(_0x3b3f38,_0x218251){_0x218251=_0x218251||0xc8;return function(_0x1a0b4a){if(_0x1a0b4a){return _0x3b3f38['status'](_0x218251)[_0x96ad('0x1b')](_0x1a0b4a);}};}function respondWithFilteredResult(_0x7caf62,_0x3a77e3){return function(_0x2d7726){if(_0x2d7726){var _0x23711d=typeof _0x3a77e3[_0x96ad('0x1c')]==='undefined'&&typeof _0x3a77e3[_0x96ad('0x1d')]==='undefined';var _0x280da6=_0x2d7726['count'];var _0x411ecc=_0x23711d?0x0:_0x3a77e3[_0x96ad('0x1c')];var _0x2af3ef=_0x23711d?_0x2d7726['count']:_0x3a77e3[_0x96ad('0x1c')]+_0x3a77e3[_0x96ad('0x1d')];var _0x3c80b6;if(_0x2af3ef>=_0x280da6){_0x2af3ef=_0x280da6;_0x3c80b6=0xc8;}else{_0x3c80b6=0xce;}_0x7caf62[_0x96ad('0x1a')](_0x3c80b6);return _0x7caf62[_0x96ad('0x1e')](_0x96ad('0x1f'),_0x411ecc+'-'+_0x2af3ef+'/'+_0x280da6)[_0x96ad('0x1b')](_0x2d7726);}return null;};}function patchUpdates(_0x376bf1){return function(_0x8e9a6c){try{jsonpatch[_0x96ad('0x20')](_0x8e9a6c,_0x376bf1,!![]);}catch(_0x47037f){return BPromise[_0x96ad('0x21')](_0x47037f);}return _0x8e9a6c['save']();};}function saveUpdates(_0x5b158e,_0x499a99){return function(_0x482ec4){if(_0x482ec4){return _0x482ec4['update'](_0x5b158e)[_0x96ad('0x22')](function(_0x25a533){return _0x25a533;});}return null;};}function removeEntity(_0x16135,_0x4a6517){return function(_0x3d93d0){if(_0x3d93d0){return _0x3d93d0[_0x96ad('0x23')]()[_0x96ad('0x22')](function(){_0x16135['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3a13cd,_0x10c233){return function(_0x5f2622){if(!_0x5f2622){_0x3a13cd[_0x96ad('0x24')](0x194);}return _0x5f2622;};}function handleError(_0x469c9c,_0x21773d){_0x21773d=_0x21773d||0x1f4;return function(_0x2ed314){logger['error'](_0x2ed314[_0x96ad('0x25')]);if(_0x2ed314[_0x96ad('0x26')]){delete _0x2ed314[_0x96ad('0x26')];}_0x469c9c['status'](_0x21773d)[_0x96ad('0x27')](_0x2ed314);};}exports[_0x96ad('0x28')]=function(_0x1c7759,_0x30174c){var _0x5a6f15={},_0x31a351={},_0x40e14e={'count':0x0,'rows':[]};var _0x38d806=_[_0x96ad('0x29')](db[_0x96ad('0x2a')][_0x96ad('0x2b')],function(_0x21766f){return{'name':_0x21766f[_0x96ad('0x2c')],'type':_0x21766f['type']['key']};});_0x31a351['model']=_['map'](_0x38d806,_0x96ad('0x26'));_0x31a351['query']=_[_0x96ad('0x2d')](_0x1c7759[_0x96ad('0x2e')]);_0x31a351['filters']=_[_0x96ad('0x2f')](_0x31a351[_0x96ad('0x30')],_0x31a351[_0x96ad('0x2e')]);_0x5a6f15[_0x96ad('0x31')]=_[_0x96ad('0x2f')](_0x31a351[_0x96ad('0x30')],qs[_0x96ad('0x32')](_0x1c7759[_0x96ad('0x2e')]['fields']));_0x5a6f15[_0x96ad('0x31')]=_0x5a6f15[_0x96ad('0x31')][_0x96ad('0x33')]?_0x5a6f15['attributes']:_0x31a351[_0x96ad('0x30')];if(!_0x1c7759[_0x96ad('0x2e')][_0x96ad('0x34')](_0x96ad('0x35'))){_0x5a6f15[_0x96ad('0x1d')]=qs[_0x96ad('0x1d')](_0x1c7759[_0x96ad('0x2e')]['limit']);_0x5a6f15[_0x96ad('0x1c')]=qs[_0x96ad('0x1c')](_0x1c7759['query'][_0x96ad('0x1c')]);}_0x5a6f15[_0x96ad('0x36')]=qs['sort'](_0x1c7759[_0x96ad('0x2e')][_0x96ad('0x37')]);_0x5a6f15[_0x96ad('0x38')]=qs[_0x96ad('0x39')](_['pick'](_0x1c7759[_0x96ad('0x2e')],_0x31a351['filters']),_0x38d806);if(_0x1c7759[_0x96ad('0x2e')][_0x96ad('0x3a')]){_0x5a6f15[_0x96ad('0x38')]=_['merge'](_0x5a6f15[_0x96ad('0x38')],{'$or':_[_0x96ad('0x29')](_0x38d806,function(_0x3a8261){if(_0x3a8261[_0x96ad('0x3b')]!==_0x96ad('0x3c')){var _0x34f375={};_0x34f375[_0x3a8261[_0x96ad('0x26')]]={'$like':'%'+_0x1c7759[_0x96ad('0x2e')]['filter']+'%'};return _0x34f375;}})});}_0x5a6f15=_['merge']({},_0x5a6f15,_0x1c7759[_0x96ad('0x3d')]);var _0x3dbdc5={'where':_0x5a6f15['where']};return db[_0x96ad('0x2a')][_0x96ad('0x3e')](_0x3dbdc5)[_0x96ad('0x22')](function(_0x1c3bf1){_0x40e14e[_0x96ad('0x3e')]=_0x1c3bf1;if(_0x1c7759[_0x96ad('0x2e')][_0x96ad('0x3f')]){_0x5a6f15[_0x96ad('0x40')]=[{'all':!![]}];}return db[_0x96ad('0x2a')][_0x96ad('0x41')](_0x5a6f15);})[_0x96ad('0x22')](function(_0x317b69){_0x40e14e[_0x96ad('0x42')]=_0x317b69;return _0x40e14e;})[_0x96ad('0x22')](respondWithFilteredResult(_0x30174c,_0x5a6f15))['catch'](handleError(_0x30174c,null));};exports['show']=function(_0x26d3ff,_0x41bca7){var _0x54d399={'raw':!![],'where':{'id':_0x26d3ff[_0x96ad('0x43')]['id']}},_0x28698e={};_0x28698e[_0x96ad('0x30')]=_[_0x96ad('0x2d')](db[_0x96ad('0x2a')][_0x96ad('0x2b')]);_0x28698e[_0x96ad('0x2e')]=_['keys'](_0x26d3ff['query']);_0x28698e[_0x96ad('0x39')]=_[_0x96ad('0x2f')](_0x28698e[_0x96ad('0x30')],_0x28698e[_0x96ad('0x2e')]);_0x54d399[_0x96ad('0x31')]=_[_0x96ad('0x2f')](_0x28698e['model'],qs[_0x96ad('0x32')](_0x26d3ff[_0x96ad('0x2e')]['fields']));_0x54d399[_0x96ad('0x31')]=_0x54d399[_0x96ad('0x31')][_0x96ad('0x33')]?_0x54d399['attributes']:_0x28698e[_0x96ad('0x30')];if(_0x26d3ff[_0x96ad('0x2e')][_0x96ad('0x3f')]){_0x54d399[_0x96ad('0x40')]=[{'all':!![]}];}_0x54d399=_['merge']({},_0x54d399,_0x26d3ff[_0x96ad('0x3d')]);return db[_0x96ad('0x2a')]['find'](_0x54d399)[_0x96ad('0x22')](handleEntityNotFound(_0x41bca7,null))[_0x96ad('0x22')](respondWithResult(_0x41bca7,null))['catch'](handleError(_0x41bca7,null));};exports[_0x96ad('0x44')]=function(_0x503d27,_0x5c9421){return db['SugarcrmField']['create'](_0x503d27['body'],{})[_0x96ad('0x22')](respondWithResult(_0x5c9421,0xc9))[_0x96ad('0x45')](handleError(_0x5c9421,null));};exports[_0x96ad('0x46')]=function(_0x34cb97,_0x2a7d43){if(_0x34cb97[_0x96ad('0x47')]['id']){delete _0x34cb97['body']['id'];}return db[_0x96ad('0x2a')][_0x96ad('0x48')]({'where':{'id':_0x34cb97[_0x96ad('0x43')]['id']}})['then'](handleEntityNotFound(_0x2a7d43,null))[_0x96ad('0x22')](saveUpdates(_0x34cb97[_0x96ad('0x47')],null))[_0x96ad('0x22')](respondWithResult(_0x2a7d43,null))[_0x96ad('0x45')](handleError(_0x2a7d43,null));};exports[_0x96ad('0x23')]=function(_0x31267e,_0x34beca){return db[_0x96ad('0x2a')][_0x96ad('0x48')]({'where':{'id':_0x31267e[_0x96ad('0x43')]['id']}})['then'](handleEntityNotFound(_0x34beca,null))[_0x96ad('0x22')](removeEntity(_0x34beca,null))[_0x96ad('0x45')](handleError(_0x34beca,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.model.js b/server/api/intSugarcrmField/intSugarcrmField.model.js index 6aa16ba..6826412 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 _0xa322=['FieldId','util','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intSugarcrmField.attributes','define','SugarcrmField','sugarcrm_unique_index'];(function(_0x2c5976,_0x319edf){var _0x334ec7=function(_0x5bf036){while(--_0x5bf036){_0x2c5976['push'](_0x2c5976['shift']());}};_0x334ec7(++_0x319edf);}(_0xa322,0x181));var _0x2a32=function(_0x395411,_0x187c4f){_0x395411=_0x395411-0x0;var _0x493867=_0xa322[_0x395411];return _0x493867;};'use strict';var _=require('lodash');var util=require(_0x2a32('0x0'));var logger=require('../../config/logger')(_0x2a32('0x1'));var moment=require(_0x2a32('0x2'));var BPromise=require(_0x2a32('0x3'));var rp=require(_0x2a32('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2a32('0x5'));var config=require(_0x2a32('0x6'));var attributes=require(_0x2a32('0x7'));module['exports']=function(_0x2cd00d,_0x2ba080){return _0x2cd00d[_0x2a32('0x8')](_0x2a32('0x9'),attributes,{'tableName':'int_sugarcrm_fields','paranoid':![],'indexes':[{'name':_0x2a32('0xa'),'fields':['idField',_0x2a32('0xb')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x19b9=['./intSugarcrmField.attributes','exports','define','SugarcrmField','int_sugarcrm_fields','FieldId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x19b9,0x1a6));var _0x919b=function(_0x800c5c,_0x406c35){_0x800c5c=_0x800c5c-0x0;var _0x1f8b5e=_0x19b9[_0x800c5c];return _0x1f8b5e;};'use strict';var _=require(_0x919b('0x0'));var util=require(_0x919b('0x1'));var logger=require(_0x919b('0x2'))(_0x919b('0x3'));var moment=require(_0x919b('0x4'));var BPromise=require(_0x919b('0x5'));var rp=require(_0x919b('0x6'));var fs=require('fs');var path=require(_0x919b('0x7'));var rimraf=require(_0x919b('0x8'));var config=require(_0x919b('0x9'));var attributes=require(_0x919b('0xa'));module[_0x919b('0xb')]=function(_0xca1036,_0x4eb6db){return _0xca1036[_0x919b('0xc')](_0x919b('0xd'),attributes,{'tableName':_0x919b('0xe'),'paranoid':![],'indexes':[{'name':'sugarcrm_unique_index','fields':['idField',_0x919b('0xf')],'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 d014685..f111ec7 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 _0xf078=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','SugarcrmField,\x20%s,\x20%s','request\x20sent','debug','SugarcrmField,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x221686,_0x1b686e){var _0x3a8d5b=function(_0x232794){while(--_0x232794){_0x221686['push'](_0x221686['shift']());}};_0x3a8d5b(++_0x1b686e);}(_0xf078,0x127));var _0x8f07=function(_0x48c464,_0x2e2d59){_0x48c464=_0x48c464-0x0;var _0x395c1a=_0xf078[_0x48c464];return _0x395c1a;};'use strict';var _=require(_0x8f07('0x0'));var util=require(_0x8f07('0x1'));var moment=require(_0x8f07('0x2'));var BPromise=require(_0x8f07('0x3'));var rs=require(_0x8f07('0x4'));var fs=require('fs');var Redis=require(_0x8f07('0x5'));var db=require(_0x8f07('0x6'))['db'];var utils=require(_0x8f07('0x7'));var logger=require(_0x8f07('0x8'))(_0x8f07('0x9'));var config=require(_0x8f07('0xa'));var jayson=require(_0x8f07('0xb'));var client=jayson['client'][_0x8f07('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1d0f20,_0x554b9e,_0x3fdb6e){return new BPromise(function(_0x2a44a5,_0x18d2f7){return client[_0x8f07('0xd')](_0x1d0f20,_0x3fdb6e)[_0x8f07('0xe')](function(_0x186f13){logger[_0x8f07('0xf')](_0x8f07('0x10'),_0x554b9e,_0x8f07('0x11'));logger[_0x8f07('0x12')](_0x8f07('0x13'),_0x554b9e,_0x8f07('0x11'),JSON[_0x8f07('0x14')](_0x186f13));if(_0x186f13[_0x8f07('0x15')]){if(_0x186f13[_0x8f07('0x15')]['code']===0x1f4){logger[_0x8f07('0x15')](_0x8f07('0x10'),_0x554b9e,_0x186f13[_0x8f07('0x15')][_0x8f07('0x16')]);return _0x18d2f7(_0x186f13[_0x8f07('0x15')][_0x8f07('0x16')]);}logger[_0x8f07('0x15')](_0x8f07('0x10'),_0x554b9e,_0x186f13[_0x8f07('0x15')][_0x8f07('0x16')]);return _0x2a44a5(_0x186f13[_0x8f07('0x15')][_0x8f07('0x16')]);}else{logger[_0x8f07('0xf')](_0x8f07('0x10'),_0x554b9e,_0x8f07('0x11'));_0x2a44a5(_0x186f13[_0x8f07('0x17')][_0x8f07('0x16')]);}})[_0x8f07('0x18')](function(_0xcc9185){logger[_0x8f07('0x15')](_0x8f07('0x10'),_0x554b9e,_0xcc9185);_0x18d2f7(_0xcc9185);});});} \ No newline at end of file +var _0xea0a=['SugarcrmField,\x20%s,\x20%s,\x20%s','error','code','SugarcrmField,\x20%s,\x20%s','message','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','debug'];(function(_0x513d3d,_0xd84f95){var _0x3f31e8=function(_0x4c5025){while(--_0x4c5025){_0x513d3d['push'](_0x513d3d['shift']());}};_0x3f31e8(++_0xd84f95);}(_0xea0a,0x16b));var _0xaea0=function(_0x3f229a,_0xfabdac){_0x3f229a=_0x3f229a-0x0;var _0x39d382=_0xea0a[_0x3f229a];return _0x39d382;};'use strict';var _=require(_0xaea0('0x0'));var util=require(_0xaea0('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xaea0('0x2'));var fs=require('fs');var Redis=require(_0xaea0('0x3'));var db=require(_0xaea0('0x4'))['db'];var utils=require(_0xaea0('0x5'));var logger=require('../../config/logger')(_0xaea0('0x6'));var config=require(_0xaea0('0x7'));var jayson=require(_0xaea0('0x8'));var client=jayson['client'][_0xaea0('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1b08d1,_0xdd213d,_0x189985){return new BPromise(function(_0x4a0e75,_0x59f51b){return client[_0xaea0('0xa')](_0x1b08d1,_0x189985)[_0xaea0('0xb')](function(_0x51ec03){logger[_0xaea0('0xc')]('SugarcrmField,\x20%s,\x20%s',_0xdd213d,_0xaea0('0xd'));logger[_0xaea0('0xe')](_0xaea0('0xf'),_0xdd213d,_0xaea0('0xd'),JSON['stringify'](_0x51ec03));if(_0x51ec03['error']){if(_0x51ec03[_0xaea0('0x10')][_0xaea0('0x11')]===0x1f4){logger['error'](_0xaea0('0x12'),_0xdd213d,_0x51ec03[_0xaea0('0x10')]['message']);return _0x59f51b(_0x51ec03[_0xaea0('0x10')][_0xaea0('0x13')]);}logger[_0xaea0('0x10')]('SugarcrmField,\x20%s,\x20%s',_0xdd213d,_0x51ec03[_0xaea0('0x10')]['message']);return _0x4a0e75(_0x51ec03[_0xaea0('0x10')][_0xaea0('0x13')]);}else{logger[_0xaea0('0xc')](_0xaea0('0x12'),_0xdd213d,'request\x20sent');_0x4a0e75(_0x51ec03['result'][_0xaea0('0x13')]);}})[_0xaea0('0x14')](function(_0xe86a66){logger[_0xaea0('0x10')](_0xaea0('0x12'),_0xdd213d,_0xe86a66);_0x59f51b(_0xe86a66);});});} \ No newline at end of file diff --git a/server/api/intVtigerAccount/index.js b/server/api/intVtigerAccount/index.js index fcfd250..68944a9 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 _0x2821=['../../config/environment','./intVtigerAccount.controller','isAuthenticated','index','get','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','create','put','update','delete','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x3e07cb,_0x9eb372){var _0x1119c9=function(_0x2dfb1a){while(--_0x2dfb1a){_0x3e07cb['push'](_0x3e07cb['shift']());}};_0x1119c9(++_0x9eb372);}(_0x2821,0x87));var _0x1282=function(_0x27939a,_0x12cfbb){_0x27939a=_0x27939a-0x0;var _0xb9238b=_0x2821[_0x27939a];return _0xb9238b;};'use strict';var multer=require(_0x1282('0x0'));var util=require(_0x1282('0x1'));var path=require(_0x1282('0x2'));var timeout=require(_0x1282('0x3'));var express=require(_0x1282('0x4'));var router=express[_0x1282('0x5')]();var fs_extra=require(_0x1282('0x6'));var auth=require(_0x1282('0x7'));var interaction=require(_0x1282('0x8'));var config=require(_0x1282('0x9'));var controller=require(_0x1282('0xa'));router['get']('/',auth[_0x1282('0xb')](),controller[_0x1282('0xc')]);router[_0x1282('0xd')](_0x1282('0xe'),auth[_0x1282('0xb')](),controller[_0x1282('0xf')]);router[_0x1282('0xd')](_0x1282('0x10'),auth['isAuthenticated'](),controller[_0x1282('0x11')]);router[_0x1282('0xd')](_0x1282('0x12'),auth[_0x1282('0xb')](),controller[_0x1282('0x13')]);router['post']('/',auth[_0x1282('0xb')](),controller[_0x1282('0x14')]);router['post'](_0x1282('0x10'),auth[_0x1282('0xb')](),controller['addConfiguration']);router[_0x1282('0x15')]('/:id',auth['isAuthenticated'](),controller[_0x1282('0x16')]);router[_0x1282('0x17')](_0x1282('0xe'),auth[_0x1282('0xb')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x447b=['/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','destroy','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerAccount.controller','get','isAuthenticated'];(function(_0x53ec96,_0x499000){var _0x493088=function(_0x1f22df){while(--_0x1f22df){_0x53ec96['push'](_0x53ec96['shift']());}};_0x493088(++_0x499000);}(_0x447b,0xe4));var _0xb447=function(_0x55cf7a,_0x3e6bc5){_0x55cf7a=_0x55cf7a-0x0;var _0x3b79f2=_0x447b[_0x55cf7a];return _0x3b79f2;};'use strict';var multer=require(_0xb447('0x0'));var util=require(_0xb447('0x1'));var path=require('path');var timeout=require(_0xb447('0x2'));var express=require(_0xb447('0x3'));var router=express[_0xb447('0x4')]();var fs_extra=require(_0xb447('0x5'));var auth=require(_0xb447('0x6'));var interaction=require(_0xb447('0x7'));var config=require(_0xb447('0x8'));var controller=require(_0xb447('0x9'));router[_0xb447('0xa')]('/',auth[_0xb447('0xb')](),controller['index']);router['get'](_0xb447('0xc'),auth['isAuthenticated'](),controller[_0xb447('0xd')]);router[_0xb447('0xa')](_0xb447('0xe'),auth[_0xb447('0xb')](),controller[_0xb447('0xf')]);router['get'](_0xb447('0x10'),auth[_0xb447('0xb')](),controller[_0xb447('0x11')]);router[_0xb447('0x12')]('/',auth['isAuthenticated'](),controller[_0xb447('0x13')]);router[_0xb447('0x12')](_0xb447('0xe'),auth[_0xb447('0xb')](),controller[_0xb447('0x14')]);router[_0xb447('0x15')](_0xb447('0xc'),auth[_0xb447('0xb')](),controller[_0xb447('0x16')]);router['delete']('/:id',auth[_0xb447('0xb')](),controller[_0xb447('0x17')]);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 4ee7274..7d9cf8d 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 _0x13d1=['STRING','HelpDesk','sequelize','exports'];(function(_0x1be13c,_0x953182){var _0x486384=function(_0x379fc9){while(--_0x379fc9){_0x1be13c['push'](_0x1be13c['shift']());}};_0x486384(++_0x953182);}(_0x13d1,0x1b6));var _0x113d=function(_0x18c740,_0x1fb28a){_0x18c740=_0x18c740-0x0;var _0x2f10cf=_0x13d1[_0x18c740];return _0x2f10cf;};'use strict';var Sequelize=require(_0x113d('0x0'));module[_0x113d('0x1')]={'name':{'type':Sequelize[_0x113d('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x113d('0x2')]},'username':{'type':Sequelize[_0x113d('0x2')],'allowNull':![]},'moduleName':{'type':Sequelize[_0x113d('0x2')],'allowNull':![],'defaultValue':_0x113d('0x3')},'remoteUri':{'type':Sequelize['STRING'],'allowNull':![]},'serverUrl':{'type':Sequelize[_0x113d('0x2')],'allowNull':![]},'accessKey':{'type':Sequelize[_0x113d('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0xf998=['sequelize','STRING'];(function(_0x5d63a8,_0x456a5e){var _0x2139c2=function(_0xcdf75f){while(--_0xcdf75f){_0x5d63a8['push'](_0x5d63a8['shift']());}};_0x2139c2(++_0x456a5e);}(_0xf998,0xa8));var _0x8f99=function(_0x4e4f0e,_0x1c3892){_0x4e4f0e=_0x4e4f0e-0x0;var _0x1a7219=_0xf998[_0x4e4f0e];return _0x1a7219;};'use strict';var Sequelize=require(_0x8f99('0x0'));module['exports']={'name':{'type':Sequelize[_0x8f99('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x8f99('0x1')],'allowNull':![]},'moduleName':{'type':Sequelize[_0x8f99('0x1')],'allowNull':![],'defaultValue':'HelpDesk'},'remoteUri':{'type':Sequelize[_0x8f99('0x1')],'allowNull':![]},'serverUrl':{'type':Sequelize[_0x8f99('0x1')],'allowNull':![]},'accessKey':{'type':Sequelize[_0x8f99('0x1')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.controller.js b/server/api/intVtigerAccount/intVtigerAccount.controller.js index 4bffc4d..c25a423 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 _0x97c4=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../components/integrations/configuration','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','then','name','send','index','VtigerAccount','rawAttributes','fieldName','type','key','map','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','includeAll','include','findAll','catch','options','find','create','body','update','destroy','params','getConfigurations','nolimit','addConfiguration','findOne','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','VtigerConfiguration','VtigerField','md5','getFields','username','moduleName','remoteUri','serverUrl','accessKey','slice','substring','lastIndexOf','format','%s/webservice.php','GET','getchallenge','success','POST','login','token','describe','result','sessionName','autogenerated','owner','remove','includes','editable','false','startsWith','cf_','picklist','picklistValues','label','value','log','vTiger\x20error:\x20','statusCode','getFields,\x20%s,\x20%s,\x20%s','test','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','lodash','crypto','desk.js','ioredis'];(function(_0x15d153,_0x4fb61c){var _0x1693d0=function(_0x5a6d95){while(--_0x5a6d95){_0x15d153['push'](_0x15d153['shift']());}};_0x1693d0(++_0x4fb61c);}(_0x97c4,0xe1));var _0x497c=function(_0x5a471b,_0x187188){_0x5a471b=_0x5a471b-0x0;var _0x257554=_0x97c4[_0x5a471b];return _0x257554;};'use strict';var emlformat=require(_0x497c('0x0'));var rimraf=require(_0x497c('0x1'));var zipdir=require(_0x497c('0x2'));var jsonpatch=require(_0x497c('0x3'));var rp=require(_0x497c('0x4'));var moment=require(_0x497c('0x5'));var BPromise=require(_0x497c('0x6'));var Mustache=require(_0x497c('0x7'));var util=require(_0x497c('0x8'));var path=require('path');var sox=require(_0x497c('0x9'));var csv=require('to-csv');var ejs=require(_0x497c('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x497c('0xb'));var squel=require('squel');var crypto=require(_0x497c('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x497c('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x497c('0xe'));var authService=require(_0x497c('0xf'));var qs=require(_0x497c('0x10'));var as=require(_0x497c('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x497c('0x12'))(_0x497c('0x13'));var utils=require('../../config/utils');var config=require(_0x497c('0x14'));var licenseUtil=require(_0x497c('0x15'));var db=require('../../mysqldb')['db'];var integrations=require(_0x497c('0x16'));function respondWithStatusCode(_0x390e05,_0x56d750){_0x56d750=_0x56d750||0xcc;return function(_0x2542bf){if(_0x2542bf){return _0x390e05['sendStatus'](_0x56d750);}return _0x390e05[_0x497c('0x17')](_0x56d750)['end']();};}function respondWithResult(_0x1e6fb2,_0x2fb5e2){_0x2fb5e2=_0x2fb5e2||0xc8;return function(_0x40c441){if(_0x40c441){return _0x1e6fb2['status'](_0x2fb5e2)[_0x497c('0x18')](_0x40c441);}};}function respondWithFilteredResult(_0x258531,_0x2883ac){return function(_0x5cccdb){if(_0x5cccdb){var _0x50fbbb=typeof _0x2883ac[_0x497c('0x19')]==='undefined'&&typeof _0x2883ac['limit']===_0x497c('0x1a');var _0x9d43c0=_0x5cccdb[_0x497c('0x1b')];var _0x1f5ad3=_0x50fbbb?0x0:_0x2883ac[_0x497c('0x19')];var _0x216d23=_0x50fbbb?_0x5cccdb[_0x497c('0x1b')]:_0x2883ac[_0x497c('0x19')]+_0x2883ac[_0x497c('0x1c')];var _0x40abfa;if(_0x216d23>=_0x9d43c0){_0x216d23=_0x9d43c0;_0x40abfa=0xc8;}else{_0x40abfa=0xce;}_0x258531[_0x497c('0x17')](_0x40abfa);return _0x258531[_0x497c('0x1d')](_0x497c('0x1e'),_0x1f5ad3+'-'+_0x216d23+'/'+_0x9d43c0)['json'](_0x5cccdb);}return null;};}function patchUpdates(_0x107006){return function(_0x31338c){try{jsonpatch[_0x497c('0x1f')](_0x31338c,_0x107006,!![]);}catch(_0x4b8dbe){return BPromise[_0x497c('0x20')](_0x4b8dbe);}return _0x31338c['save']();};}function saveUpdates(_0x2e96ec,_0x4fd601){return function(_0x4cd27a){if(_0x4cd27a){return _0x4cd27a['update'](_0x2e96ec)[_0x497c('0x21')](function(_0x316851){return _0x316851;});}return null;};}function removeEntity(_0x2fd508,_0x5c8374){return function(_0x3df785){if(_0x3df785){return _0x3df785['destroy']()['then'](function(){_0x2fd508[_0x497c('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x308af2,_0x4ce571){return function(_0x5fca67){if(!_0x5fca67){_0x308af2['sendStatus'](0x194);}return _0x5fca67;};}function handleError(_0x349708,_0xc34696){_0xc34696=_0xc34696||0x1f4;return function(_0x409726){logger['error'](_0x409726['stack']);if(_0x409726[_0x497c('0x22')]){delete _0x409726[_0x497c('0x22')];}_0x349708[_0x497c('0x17')](_0xc34696)[_0x497c('0x23')](_0x409726);};}exports[_0x497c('0x24')]=function(_0x115438,_0x2f7c68){var _0x5bb56a={},_0x560641={},_0x46fc90={'count':0x0,'rows':[]};var _0x166055=_['map'](db[_0x497c('0x25')][_0x497c('0x26')],function(_0x42a841){return{'name':_0x42a841[_0x497c('0x27')],'type':_0x42a841[_0x497c('0x28')][_0x497c('0x29')]};});_0x560641['model']=_[_0x497c('0x2a')](_0x166055,_0x497c('0x22'));_0x560641[_0x497c('0x2b')]=_[_0x497c('0x2c')](_0x115438[_0x497c('0x2b')]);_0x560641[_0x497c('0x2d')]=_[_0x497c('0x2e')](_0x560641[_0x497c('0x2f')],_0x560641[_0x497c('0x2b')]);_0x5bb56a[_0x497c('0x30')]=_[_0x497c('0x2e')](_0x560641[_0x497c('0x2f')],qs['fields'](_0x115438['query'][_0x497c('0x31')]));_0x5bb56a[_0x497c('0x30')]=_0x5bb56a[_0x497c('0x30')][_0x497c('0x32')]?_0x5bb56a[_0x497c('0x30')]:_0x560641['model'];if(!_0x115438['query'][_0x497c('0x33')]('nolimit')){_0x5bb56a[_0x497c('0x1c')]=qs[_0x497c('0x1c')](_0x115438[_0x497c('0x2b')][_0x497c('0x1c')]);_0x5bb56a[_0x497c('0x19')]=qs[_0x497c('0x19')](_0x115438[_0x497c('0x2b')][_0x497c('0x19')]);}_0x5bb56a[_0x497c('0x34')]=qs[_0x497c('0x35')](_0x115438[_0x497c('0x2b')]['sort']);_0x5bb56a[_0x497c('0x36')]=qs['filters'](_[_0x497c('0x37')](_0x115438[_0x497c('0x2b')],_0x560641[_0x497c('0x2d')]),_0x166055);if(_0x115438[_0x497c('0x2b')][_0x497c('0x38')]){_0x5bb56a[_0x497c('0x36')]=_['merge'](_0x5bb56a[_0x497c('0x36')],{'$or':_['map'](_0x166055,function(_0x1de2ac){if(_0x1de2ac[_0x497c('0x28')]!=='VIRTUAL'){var _0x2301aa={};_0x2301aa[_0x1de2ac['name']]={'$like':'%'+_0x115438[_0x497c('0x2b')][_0x497c('0x38')]+'%'};return _0x2301aa;}})});}_0x5bb56a=_[_0x497c('0x39')]({},_0x5bb56a,_0x115438['options']);var _0x14e1f2={'where':_0x5bb56a[_0x497c('0x36')]};return db[_0x497c('0x25')][_0x497c('0x1b')](_0x14e1f2)[_0x497c('0x21')](function(_0x888ff2){_0x46fc90[_0x497c('0x1b')]=_0x888ff2;if(_0x115438[_0x497c('0x2b')][_0x497c('0x3a')]){_0x5bb56a[_0x497c('0x3b')]=[{'all':!![]}];}return db[_0x497c('0x25')][_0x497c('0x3c')](_0x5bb56a);})[_0x497c('0x21')](function(_0x1e8670){_0x46fc90['rows']=_0x1e8670;return _0x46fc90;})['then'](respondWithFilteredResult(_0x2f7c68,_0x5bb56a))[_0x497c('0x3d')](handleError(_0x2f7c68,null));};exports['show']=function(_0x53a4aa,_0x307459){var _0x327d93={'raw':![],'where':{'id':_0x53a4aa['params']['id']}},_0xc68bdd={};_0xc68bdd[_0x497c('0x2f')]=_['keys'](db[_0x497c('0x25')][_0x497c('0x26')]);_0xc68bdd['query']=_[_0x497c('0x2c')](_0x53a4aa[_0x497c('0x2b')]);_0xc68bdd[_0x497c('0x2d')]=_['intersection'](_0xc68bdd[_0x497c('0x2f')],_0xc68bdd[_0x497c('0x2b')]);_0x327d93[_0x497c('0x30')]=_['intersection'](_0xc68bdd['model'],qs[_0x497c('0x31')](_0x53a4aa[_0x497c('0x2b')]['fields']));_0x327d93[_0x497c('0x30')]=_0x327d93[_0x497c('0x30')][_0x497c('0x32')]?_0x327d93[_0x497c('0x30')]:_0xc68bdd[_0x497c('0x2f')];if(_0x53a4aa[_0x497c('0x2b')]['includeAll']){_0x327d93[_0x497c('0x3b')]=[{'all':!![]}];}_0x327d93=_[_0x497c('0x39')]({},_0x327d93,_0x53a4aa[_0x497c('0x3e')]);return db['VtigerAccount'][_0x497c('0x3f')](_0x327d93)[_0x497c('0x21')](handleEntityNotFound(_0x307459,null))[_0x497c('0x21')](respondWithResult(_0x307459,null))[_0x497c('0x3d')](handleError(_0x307459,null));};exports[_0x497c('0x40')]=function(_0x4596fa,_0x5e901f){return db[_0x497c('0x25')][_0x497c('0x40')](_0x4596fa[_0x497c('0x41')],{})[_0x497c('0x21')](respondWithResult(_0x5e901f,0xc9))['catch'](handleError(_0x5e901f,null));};exports[_0x497c('0x42')]=function(_0x73e86c,_0x4158d0){if(_0x73e86c[_0x497c('0x41')]['id']){delete _0x73e86c[_0x497c('0x41')]['id'];}return db[_0x497c('0x25')]['find']({'where':{'id':_0x73e86c['params']['id']}})[_0x497c('0x21')](handleEntityNotFound(_0x4158d0,null))[_0x497c('0x21')](saveUpdates(_0x73e86c[_0x497c('0x41')],null))[_0x497c('0x21')](respondWithResult(_0x4158d0,null))[_0x497c('0x3d')](handleError(_0x4158d0,null));};exports[_0x497c('0x43')]=function(_0x537c17,_0x103d59){return db[_0x497c('0x25')]['find']({'where':{'id':_0x537c17['params']['id']}})[_0x497c('0x21')](handleEntityNotFound(_0x103d59,null))[_0x497c('0x21')](removeEntity(_0x103d59,null))['catch'](handleError(_0x103d59,null));};exports['getConfigurations']=function(_0x335be8,_0xd05bf5,_0x2b63d1){var _0x29869c={};var _0x50c77e={};var _0x244dc4;var _0x3a94b3;return db[_0x497c('0x25')]['findOne']({'where':{'id':_0x335be8[_0x497c('0x44')]['id']}})[_0x497c('0x21')](handleEntityNotFound(_0xd05bf5,null))[_0x497c('0x21')](function(_0x85d11c){if(_0x85d11c){_0x244dc4=_0x85d11c;_0x50c77e[_0x497c('0x2f')]=_['keys'](db['VtigerConfiguration'][_0x497c('0x26')]);_0x50c77e['query']=_[_0x497c('0x2c')](_0x335be8[_0x497c('0x2b')]);_0x50c77e['filters']=_[_0x497c('0x2e')](_0x50c77e['model'],_0x50c77e['query']);_0x29869c[_0x497c('0x30')]=_[_0x497c('0x2e')](_0x50c77e[_0x497c('0x2f')],qs[_0x497c('0x31')](_0x335be8[_0x497c('0x2b')][_0x497c('0x31')]));_0x29869c[_0x497c('0x30')]=_0x29869c['attributes'][_0x497c('0x32')]?_0x29869c[_0x497c('0x30')]:_0x50c77e[_0x497c('0x2f')];_0x29869c['order']=qs[_0x497c('0x35')](_0x335be8[_0x497c('0x2b')][_0x497c('0x35')]);_0x29869c[_0x497c('0x36')]=qs['filters'](_[_0x497c('0x37')](_0x335be8[_0x497c('0x2b')],_0x50c77e[_0x497c('0x2d')]));if(_0x335be8[_0x497c('0x2b')][_0x497c('0x38')]){_0x29869c['where']=_[_0x497c('0x39')](_0x29869c[_0x497c('0x36')],{'$or':_[_0x497c('0x2a')](_0x29869c[_0x497c('0x30')],function(_0x22c9da){var _0x2f28ae={};_0x2f28ae[_0x22c9da]={'$like':'%'+_0x335be8[_0x497c('0x2b')]['filter']+'%'};return _0x2f28ae;})});}_0x29869c=_['merge']({},_0x29869c,_0x335be8['options']);return _0x244dc4[_0x497c('0x45')](_0x29869c);}})[_0x497c('0x21')](function(_0x673268){if(_0x673268){_0x3a94b3=_0x673268[_0x497c('0x32')];if(!_0x335be8['query'][_0x497c('0x33')](_0x497c('0x46'))){_0x29869c[_0x497c('0x1c')]=qs[_0x497c('0x1c')](_0x335be8[_0x497c('0x2b')][_0x497c('0x1c')]);_0x29869c[_0x497c('0x19')]=qs[_0x497c('0x19')](_0x335be8[_0x497c('0x2b')][_0x497c('0x19')]);}return _0x244dc4[_0x497c('0x45')](_0x29869c);}})[_0x497c('0x21')](function(_0x2935dc){if(_0x2935dc){return _0x2935dc?{'count':_0x3a94b3,'rows':_0x2935dc}:null;}})['then'](respondWithResult(_0xd05bf5,null))['catch'](handleError(_0xd05bf5,null));};exports[_0x497c('0x47')]=function(_0x4190e1,_0x408b70,_0x18b74f){if(_0x4190e1[_0x497c('0x41')]['id']){delete _0x4190e1[_0x497c('0x41')]['id'];}return db[_0x497c('0x25')][_0x497c('0x48')]({'where':{'id':_0x4190e1['params']['id']}})['then'](handleEntityNotFound(_0x408b70,null))[_0x497c('0x21')](function(_0x1b5805){if(_0x1b5805){_0x4190e1[_0x497c('0x41')][_0x497c('0x49')]=_0x1b5805['id'];_0x4190e1[_0x497c('0x41')][_0x497c('0x4a')]=integrations[_0x497c('0x4b')](_0x4190e1[_0x497c('0x41')][_0x497c('0x4c')],_0x4190e1['body'][_0x497c('0x28')]);_0x4190e1['body'][_0x497c('0x4d')]=integrations[_0x497c('0x4e')](_0x4190e1[_0x497c('0x41')][_0x497c('0x4c')],_0x4190e1[_0x497c('0x41')][_0x497c('0x28')]);return db[_0x497c('0x4f')][_0x497c('0x40')](_0x4190e1[_0x497c('0x41')],{'include':[{'model':db[_0x497c('0x50')],'as':_0x497c('0x4a')},{'model':db[_0x497c('0x50')],'as':'Descriptions'}]});}return null;})[_0x497c('0x21')](respondWithResult(_0x408b70,null))[_0x497c('0x3d')](handleError(_0x408b70,null));};var md5=require(_0x497c('0x51'));exports[_0x497c('0x52')]=function(_0x46c5d4,_0x75a8d,_0x1415ce){var _0x2ca96a=null;var _0xaf58de=null;var _0x5bd69d=null;var _0x576926=null;var _0x3ae934='';return db[_0x497c('0x25')][_0x497c('0x48')]({'where':{'id':_0x46c5d4[_0x497c('0x44')]['id']},'attributes':['id',_0x497c('0x22'),_0x497c('0x53'),'description',_0x497c('0x54'),_0x497c('0x55'),_0x497c('0x56'),'accessKey']})[_0x497c('0x21')](handleEntityNotFound(_0x75a8d,null))['then'](function(_0x8ec9b2){if(_0x8ec9b2){_0x2ca96a=_0x8ec9b2[_0x497c('0x53')];_0xaf58de=_0x8ec9b2[_0x497c('0x57')];_0x5bd69d=_0x8ec9b2[_0x497c('0x54')];_0x3ae934=_0x8ec9b2[_0x497c('0x55')];var _0x18fce9=_0x3ae934[_0x497c('0x58')](-0x1);if(_0x18fce9==='/'){_0x3ae934=_0x3ae934[_0x497c('0x59')](0x0,_0x3ae934[_0x497c('0x5a')](_0x18fce9));}_0x576926=util[_0x497c('0x5b')](_0x497c('0x5c'),_0x3ae934);var _0x1e015a={'method':_0x497c('0x5d'),'uri':_0x576926,'qs':{'operation':_0x497c('0x5e'),'username':_0x8ec9b2[_0x497c('0x53')]},'json':!![]};return rp(_0x1e015a);}})[_0x497c('0x21')](function(_0x2af997){if(_0x2af997[_0x497c('0x5f')]){var _0x4b82de={'method':_0x497c('0x60'),'uri':_0x576926,'form':{'operation':_0x497c('0x61'),'username':_0x2ca96a,'accessKey':md5(_0x2af997['result'][_0x497c('0x62')]+_0xaf58de)},'json':!![]};return rp(_0x4b82de);}})[_0x497c('0x21')](function(_0x360809){if(_0x360809['success']){var _0x76006c={'method':_0x497c('0x5d'),'uri':_0x576926,'qs':{'operation':_0x497c('0x63'),'username':_0x2ca96a,'sessionName':_0x360809[_0x497c('0x64')][_0x497c('0x65')],'elementType':_0x5bd69d},'json':!![]};return rp(_0x76006c);}})[_0x497c('0x21')](function(_0x32dac8){if(_0x32dac8[_0x497c('0x5f')]){var _0x1ab266=[_0x497c('0x66'),'reference',_0x497c('0x67')];_[_0x497c('0x68')](_0x32dac8[_0x497c('0x64')][_0x497c('0x31')],function(_0xe064e){return _0x1ab266[_0x497c('0x69')](_0xe064e['type']['name']);});_['remove'](_0x32dac8[_0x497c('0x64')][_0x497c('0x31')],function(_0x17edf7){return _0x17edf7[_0x497c('0x6a')]===_0x497c('0x6b');});return{'count':_0x32dac8['result'][_0x497c('0x31')]['length'],'rows':_[_0x497c('0x2a')](_0x32dac8[_0x497c('0x64')][_0x497c('0x31')],function(_0x392166){return{'id':_0x392166[_0x497c('0x22')],'name':_0x392166['label'],'custom':_[_0x497c('0x6c')](_0x392166[_0x497c('0x22')],_0x497c('0x6d'))?!![]:![],'options':_0x392166[_0x497c('0x28')]['name']===_0x497c('0x6e')&&_0x392166[_0x497c('0x28')][_0x497c('0x6f')][_0x497c('0x32')]>0x0?_['map'](_0x392166[_0x497c('0x28')][_0x497c('0x6f')],function(_0x51b599){return{'name':_0x51b599[_0x497c('0x70')],'value':_0x51b599[_0x497c('0x71')]};}):[]};})};}})['then'](respondWithResult(_0x75a8d,null))[_0x497c('0x3d')](function(_0x5d3c3){console[_0x497c('0x72')](_0x497c('0x73')+_0x5d3c3);var _0x46e8ea=_0x46c5d4[_0x497c('0x2b')]['test']?0x1f4:_0x5d3c3[_0x497c('0x74')]||0x1f4;logger['error'](_0x497c('0x75'),'getFields',_0x46e8ea,JSON['stringify'](_0x5d3c3));delete _0x5d3c3[_0x497c('0x22')];if(_0x46e8ea===0x191){_0x46e8ea=0x190;}_0x75a8d[_0x497c('0x17')](_0x46e8ea)[_0x497c('0x23')](_0x46c5d4['query'][_0x497c('0x76')]?{'message':_0x497c('0x77'),'statusCode':_0x5d3c3['statusCode']}:_0x5d3c3);});}; \ No newline at end of file +var _0xb82f=['rawAttributes','order','filter','nolimit','addConfiguration','AccountId','getSubjects','channel','VtigerField','Subjects','Descriptions','md5','username','description','moduleName','remoteUri','serverUrl','accessKey','slice','lastIndexOf','format','%s/webservice.php','GET','getchallenge','success','POST','login','result','token','reference','owner','remove','editable','false','label','cf_','picklistValues','value','log','vTiger\x20error:\x20','test','statusCode','error','getFields','stringify','Wrong\x20credentials','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','Content-Range','reject','save','update','then','destroy','stack','name','index','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','limit','sort','where','pick','merge','VIRTUAL','options','findAll','show','params','VtigerAccount','includeAll','find','catch','create','body','getConfigurations','findOne','VtigerConfiguration'];(function(_0x1eaf9a,_0x4d11ad){var _0x7d8d28=function(_0x59d491){while(--_0x59d491){_0x1eaf9a['push'](_0x1eaf9a['shift']());}};_0x7d8d28(++_0x4d11ad);}(_0xb82f,0x196));var _0xfb82=function(_0x51a786,_0x1f6958){_0x51a786=_0x51a786-0x0;var _0xf6c00c=_0xb82f[_0x51a786];return _0xf6c00c;};'use strict';var emlformat=require(_0xfb82('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xfb82('0x1'));var jsonpatch=require(_0xfb82('0x2'));var rp=require(_0xfb82('0x3'));var moment=require(_0xfb82('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xfb82('0x5'));var util=require(_0xfb82('0x6'));var path=require(_0xfb82('0x7'));var sox=require(_0xfb82('0x8'));var csv=require(_0xfb82('0x9'));var ejs=require(_0xfb82('0xa'));var fs=require('fs');var fs_extra=require(_0xfb82('0xb'));var _=require(_0xfb82('0xc'));var squel=require(_0xfb82('0xd'));var crypto=require(_0xfb82('0xe'));var jsforce=require(_0xfb82('0xf'));var deskjs=require(_0xfb82('0x10'));var toCsv=require(_0xfb82('0x9'));var querystring=require(_0xfb82('0x11'));var Papa=require(_0xfb82('0x12'));var Redis=require(_0xfb82('0x13'));var authService=require(_0xfb82('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0xfb82('0x15'));var hardwareService=require(_0xfb82('0x16'));var logger=require(_0xfb82('0x17'))(_0xfb82('0x18'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xfb82('0x19'));var db=require(_0xfb82('0x1a'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x4fb42b,_0x33e0a6){_0x33e0a6=_0x33e0a6||0xcc;return function(_0x19eab6){if(_0x19eab6){return _0x4fb42b[_0xfb82('0x1b')](_0x33e0a6);}return _0x4fb42b[_0xfb82('0x1c')](_0x33e0a6)[_0xfb82('0x1d')]();};}function respondWithResult(_0x5bcece,_0x40459a){_0x40459a=_0x40459a||0xc8;return function(_0x4e2572){if(_0x4e2572){return _0x5bcece[_0xfb82('0x1c')](_0x40459a)[_0xfb82('0x1e')](_0x4e2572);}};}function respondWithFilteredResult(_0x291b50,_0x493b21){return function(_0x5481b6){if(_0x5481b6){var _0x36897a=typeof _0x493b21[_0xfb82('0x1f')]===_0xfb82('0x20')&&typeof _0x493b21['limit']==='undefined';var _0x312343=_0x5481b6[_0xfb82('0x21')];var _0x2df0f9=_0x36897a?0x0:_0x493b21[_0xfb82('0x1f')];var _0x18589a=_0x36897a?_0x5481b6[_0xfb82('0x21')]:_0x493b21['offset']+_0x493b21['limit'];var _0x55c121;if(_0x18589a>=_0x312343){_0x18589a=_0x312343;_0x55c121=0xc8;}else{_0x55c121=0xce;}_0x291b50[_0xfb82('0x1c')](_0x55c121);return _0x291b50['set'](_0xfb82('0x22'),_0x2df0f9+'-'+_0x18589a+'/'+_0x312343)[_0xfb82('0x1e')](_0x5481b6);}return null;};}function patchUpdates(_0x2f6ca8){return function(_0x6c2c80){try{jsonpatch['apply'](_0x6c2c80,_0x2f6ca8,!![]);}catch(_0x4a3314){return BPromise[_0xfb82('0x23')](_0x4a3314);}return _0x6c2c80[_0xfb82('0x24')]();};}function saveUpdates(_0x51d52b,_0x1efc00){return function(_0xae450a){if(_0xae450a){return _0xae450a[_0xfb82('0x25')](_0x51d52b)[_0xfb82('0x26')](function(_0x2ec96d){return _0x2ec96d;});}return null;};}function removeEntity(_0x25e718,_0x58990d){return function(_0x1a1193){if(_0x1a1193){return _0x1a1193[_0xfb82('0x27')]()['then'](function(){_0x25e718[_0xfb82('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5c13f6,_0x5c1aae){return function(_0x28fb65){if(!_0x28fb65){_0x5c13f6[_0xfb82('0x1b')](0x194);}return _0x28fb65;};}function handleError(_0x45c1b3,_0x5a65db){_0x5a65db=_0x5a65db||0x1f4;return function(_0x3f6970){logger['error'](_0x3f6970[_0xfb82('0x28')]);if(_0x3f6970[_0xfb82('0x29')]){delete _0x3f6970[_0xfb82('0x29')];}_0x45c1b3['status'](_0x5a65db)['send'](_0x3f6970);};}exports[_0xfb82('0x2a')]=function(_0x19cacf,_0x5b040d){var _0x3ee677={},_0x365d64={},_0x1e6273={'count':0x0,'rows':[]};var _0x1e3d4c=_['map'](db['VtigerAccount']['rawAttributes'],function(_0x164b63){return{'name':_0x164b63['fieldName'],'type':_0x164b63[_0xfb82('0x2b')][_0xfb82('0x2c')]};});_0x365d64[_0xfb82('0x2d')]=_[_0xfb82('0x2e')](_0x1e3d4c,_0xfb82('0x29'));_0x365d64[_0xfb82('0x2f')]=_[_0xfb82('0x30')](_0x19cacf[_0xfb82('0x2f')]);_0x365d64[_0xfb82('0x31')]=_[_0xfb82('0x32')](_0x365d64[_0xfb82('0x2d')],_0x365d64['query']);_0x3ee677[_0xfb82('0x33')]=_[_0xfb82('0x32')](_0x365d64['model'],qs['fields'](_0x19cacf[_0xfb82('0x2f')][_0xfb82('0x34')]));_0x3ee677[_0xfb82('0x33')]=_0x3ee677[_0xfb82('0x33')][_0xfb82('0x35')]?_0x3ee677[_0xfb82('0x33')]:_0x365d64[_0xfb82('0x2d')];if(!_0x19cacf['query'][_0xfb82('0x36')]('nolimit')){_0x3ee677['limit']=qs['limit'](_0x19cacf[_0xfb82('0x2f')][_0xfb82('0x37')]);_0x3ee677[_0xfb82('0x1f')]=qs[_0xfb82('0x1f')](_0x19cacf[_0xfb82('0x2f')][_0xfb82('0x1f')]);}_0x3ee677['order']=qs[_0xfb82('0x38')](_0x19cacf[_0xfb82('0x2f')][_0xfb82('0x38')]);_0x3ee677[_0xfb82('0x39')]=qs[_0xfb82('0x31')](_[_0xfb82('0x3a')](_0x19cacf['query'],_0x365d64[_0xfb82('0x31')]),_0x1e3d4c);if(_0x19cacf[_0xfb82('0x2f')]['filter']){_0x3ee677['where']=_[_0xfb82('0x3b')](_0x3ee677['where'],{'$or':_[_0xfb82('0x2e')](_0x1e3d4c,function(_0x3dd4fd){if(_0x3dd4fd[_0xfb82('0x2b')]!==_0xfb82('0x3c')){var _0x5310d1={};_0x5310d1[_0x3dd4fd[_0xfb82('0x29')]]={'$like':'%'+_0x19cacf[_0xfb82('0x2f')]['filter']+'%'};return _0x5310d1;}})});}_0x3ee677=_['merge']({},_0x3ee677,_0x19cacf[_0xfb82('0x3d')]);var _0x4d56d6={'where':_0x3ee677['where']};return db['VtigerAccount'][_0xfb82('0x21')](_0x4d56d6)[_0xfb82('0x26')](function(_0x5443a5){_0x1e6273[_0xfb82('0x21')]=_0x5443a5;if(_0x19cacf[_0xfb82('0x2f')]['includeAll']){_0x3ee677['include']=[{'all':!![]}];}return db['VtigerAccount'][_0xfb82('0x3e')](_0x3ee677);})[_0xfb82('0x26')](function(_0x48eb31){_0x1e6273['rows']=_0x48eb31;return _0x1e6273;})[_0xfb82('0x26')](respondWithFilteredResult(_0x5b040d,_0x3ee677))['catch'](handleError(_0x5b040d,null));};exports[_0xfb82('0x3f')]=function(_0x26f3af,_0x1887a6){var _0xa3a683={'raw':![],'where':{'id':_0x26f3af[_0xfb82('0x40')]['id']}},_0x50505a={};_0x50505a['model']=_[_0xfb82('0x30')](db[_0xfb82('0x41')]['rawAttributes']);_0x50505a[_0xfb82('0x2f')]=_[_0xfb82('0x30')](_0x26f3af['query']);_0x50505a[_0xfb82('0x31')]=_[_0xfb82('0x32')](_0x50505a[_0xfb82('0x2d')],_0x50505a['query']);_0xa3a683['attributes']=_[_0xfb82('0x32')](_0x50505a[_0xfb82('0x2d')],qs[_0xfb82('0x34')](_0x26f3af[_0xfb82('0x2f')]['fields']));_0xa3a683[_0xfb82('0x33')]=_0xa3a683['attributes']['length']?_0xa3a683['attributes']:_0x50505a['model'];if(_0x26f3af[_0xfb82('0x2f')][_0xfb82('0x42')]){_0xa3a683['include']=[{'all':!![]}];}_0xa3a683=_[_0xfb82('0x3b')]({},_0xa3a683,_0x26f3af[_0xfb82('0x3d')]);return db[_0xfb82('0x41')][_0xfb82('0x43')](_0xa3a683)[_0xfb82('0x26')](handleEntityNotFound(_0x1887a6,null))[_0xfb82('0x26')](respondWithResult(_0x1887a6,null))[_0xfb82('0x44')](handleError(_0x1887a6,null));};exports[_0xfb82('0x45')]=function(_0x21e4e3,_0x13af4c){return db[_0xfb82('0x41')][_0xfb82('0x45')](_0x21e4e3[_0xfb82('0x46')],{})['then'](respondWithResult(_0x13af4c,0xc9))[_0xfb82('0x44')](handleError(_0x13af4c,null));};exports['update']=function(_0x3dea0c,_0xcb5b0d){if(_0x3dea0c[_0xfb82('0x46')]['id']){delete _0x3dea0c[_0xfb82('0x46')]['id'];}return db[_0xfb82('0x41')][_0xfb82('0x43')]({'where':{'id':_0x3dea0c[_0xfb82('0x40')]['id']}})['then'](handleEntityNotFound(_0xcb5b0d,null))[_0xfb82('0x26')](saveUpdates(_0x3dea0c['body'],null))['then'](respondWithResult(_0xcb5b0d,null))[_0xfb82('0x44')](handleError(_0xcb5b0d,null));};exports['destroy']=function(_0x1233a6,_0x405194){return db[_0xfb82('0x41')][_0xfb82('0x43')]({'where':{'id':_0x1233a6[_0xfb82('0x40')]['id']}})[_0xfb82('0x26')](handleEntityNotFound(_0x405194,null))[_0xfb82('0x26')](removeEntity(_0x405194,null))['catch'](handleError(_0x405194,null));};exports[_0xfb82('0x47')]=function(_0x241632,_0x3c2669,_0x26b44c){var _0x3fdd4e={};var _0x5039f1={};var _0x5a73f0;var _0xca934f;return db[_0xfb82('0x41')][_0xfb82('0x48')]({'where':{'id':_0x241632[_0xfb82('0x40')]['id']}})['then'](handleEntityNotFound(_0x3c2669,null))['then'](function(_0x285f57){if(_0x285f57){_0x5a73f0=_0x285f57;_0x5039f1[_0xfb82('0x2d')]=_[_0xfb82('0x30')](db[_0xfb82('0x49')][_0xfb82('0x4a')]);_0x5039f1[_0xfb82('0x2f')]=_[_0xfb82('0x30')](_0x241632[_0xfb82('0x2f')]);_0x5039f1['filters']=_['intersection'](_0x5039f1[_0xfb82('0x2d')],_0x5039f1['query']);_0x3fdd4e['attributes']=_[_0xfb82('0x32')](_0x5039f1[_0xfb82('0x2d')],qs['fields'](_0x241632['query'][_0xfb82('0x34')]));_0x3fdd4e[_0xfb82('0x33')]=_0x3fdd4e[_0xfb82('0x33')][_0xfb82('0x35')]?_0x3fdd4e[_0xfb82('0x33')]:_0x5039f1[_0xfb82('0x2d')];_0x3fdd4e[_0xfb82('0x4b')]=qs[_0xfb82('0x38')](_0x241632[_0xfb82('0x2f')][_0xfb82('0x38')]);_0x3fdd4e[_0xfb82('0x39')]=qs[_0xfb82('0x31')](_[_0xfb82('0x3a')](_0x241632[_0xfb82('0x2f')],_0x5039f1[_0xfb82('0x31')]));if(_0x241632[_0xfb82('0x2f')][_0xfb82('0x4c')]){_0x3fdd4e[_0xfb82('0x39')]=_['merge'](_0x3fdd4e[_0xfb82('0x39')],{'$or':_[_0xfb82('0x2e')](_0x3fdd4e[_0xfb82('0x33')],function(_0x48ca8a){var _0xfe7fb8={};_0xfe7fb8[_0x48ca8a]={'$like':'%'+_0x241632[_0xfb82('0x2f')]['filter']+'%'};return _0xfe7fb8;})});}_0x3fdd4e=_[_0xfb82('0x3b')]({},_0x3fdd4e,_0x241632[_0xfb82('0x3d')]);return _0x5a73f0['getConfigurations'](_0x3fdd4e);}})[_0xfb82('0x26')](function(_0x7b2638){if(_0x7b2638){_0xca934f=_0x7b2638['length'];if(!_0x241632[_0xfb82('0x2f')][_0xfb82('0x36')](_0xfb82('0x4d'))){_0x3fdd4e['limit']=qs[_0xfb82('0x37')](_0x241632[_0xfb82('0x2f')][_0xfb82('0x37')]);_0x3fdd4e[_0xfb82('0x1f')]=qs[_0xfb82('0x1f')](_0x241632[_0xfb82('0x2f')]['offset']);}return _0x5a73f0[_0xfb82('0x47')](_0x3fdd4e);}})[_0xfb82('0x26')](function(_0x12ed7f){if(_0x12ed7f){return _0x12ed7f?{'count':_0xca934f,'rows':_0x12ed7f}:null;}})['then'](respondWithResult(_0x3c2669,null))['catch'](handleError(_0x3c2669,null));};exports[_0xfb82('0x4e')]=function(_0x36ae5a,_0x517eaf,_0x211573){if(_0x36ae5a[_0xfb82('0x46')]['id']){delete _0x36ae5a[_0xfb82('0x46')]['id'];}return db['VtigerAccount'][_0xfb82('0x48')]({'where':{'id':_0x36ae5a[_0xfb82('0x40')]['id']}})['then'](handleEntityNotFound(_0x517eaf,null))['then'](function(_0xd6719d){if(_0xd6719d){_0x36ae5a[_0xfb82('0x46')][_0xfb82('0x4f')]=_0xd6719d['id'];_0x36ae5a['body']['Subjects']=integrations[_0xfb82('0x50')](_0x36ae5a[_0xfb82('0x46')][_0xfb82('0x51')],_0x36ae5a[_0xfb82('0x46')][_0xfb82('0x2b')]);_0x36ae5a['body']['Descriptions']=integrations['getDescriptions'](_0x36ae5a[_0xfb82('0x46')][_0xfb82('0x51')],_0x36ae5a[_0xfb82('0x46')][_0xfb82('0x2b')]);return db[_0xfb82('0x49')][_0xfb82('0x45')](_0x36ae5a[_0xfb82('0x46')],{'include':[{'model':db[_0xfb82('0x52')],'as':_0xfb82('0x53')},{'model':db[_0xfb82('0x52')],'as':_0xfb82('0x54')}]});}return null;})[_0xfb82('0x26')](respondWithResult(_0x517eaf,null))[_0xfb82('0x44')](handleError(_0x517eaf,null));};var md5=require(_0xfb82('0x55'));exports['getFields']=function(_0x1e1124,_0x137284,_0x3fbaee){var _0x493505=null;var _0x4af789=null;var _0x665621=null;var _0xbd845a=null;var _0x3849a7='';return db[_0xfb82('0x41')][_0xfb82('0x48')]({'where':{'id':_0x1e1124['params']['id']},'attributes':['id',_0xfb82('0x29'),_0xfb82('0x56'),_0xfb82('0x57'),_0xfb82('0x58'),_0xfb82('0x59'),_0xfb82('0x5a'),_0xfb82('0x5b')]})[_0xfb82('0x26')](handleEntityNotFound(_0x137284,null))['then'](function(_0x1e3ce6){if(_0x1e3ce6){_0x493505=_0x1e3ce6[_0xfb82('0x56')];_0x4af789=_0x1e3ce6[_0xfb82('0x5b')];_0x665621=_0x1e3ce6[_0xfb82('0x58')];_0x3849a7=_0x1e3ce6['remoteUri'];var _0xb8a831=_0x3849a7[_0xfb82('0x5c')](-0x1);if(_0xb8a831==='/'){_0x3849a7=_0x3849a7['substring'](0x0,_0x3849a7[_0xfb82('0x5d')](_0xb8a831));}_0xbd845a=util[_0xfb82('0x5e')](_0xfb82('0x5f'),_0x3849a7);var _0x569390={'method':_0xfb82('0x60'),'uri':_0xbd845a,'qs':{'operation':_0xfb82('0x61'),'username':_0x1e3ce6[_0xfb82('0x56')]},'json':!![]};return rp(_0x569390);}})[_0xfb82('0x26')](function(_0xae79b3){if(_0xae79b3[_0xfb82('0x62')]){var _0x25aa10={'method':_0xfb82('0x63'),'uri':_0xbd845a,'form':{'operation':_0xfb82('0x64'),'username':_0x493505,'accessKey':md5(_0xae79b3[_0xfb82('0x65')][_0xfb82('0x66')]+_0x4af789)},'json':!![]};return rp(_0x25aa10);}})[_0xfb82('0x26')](function(_0x129444){if(_0x129444['success']){var _0x1dee25={'method':_0xfb82('0x60'),'uri':_0xbd845a,'qs':{'operation':'describe','username':_0x493505,'sessionName':_0x129444[_0xfb82('0x65')]['sessionName'],'elementType':_0x665621},'json':!![]};return rp(_0x1dee25);}})['then'](function(_0x331311){if(_0x331311[_0xfb82('0x62')]){var _0x418701=['autogenerated',_0xfb82('0x67'),_0xfb82('0x68')];_[_0xfb82('0x69')](_0x331311[_0xfb82('0x65')][_0xfb82('0x34')],function(_0x12fa9a){return _0x418701['includes'](_0x12fa9a['type']['name']);});_[_0xfb82('0x69')](_0x331311[_0xfb82('0x65')][_0xfb82('0x34')],function(_0x45cdbd){return _0x45cdbd[_0xfb82('0x6a')]===_0xfb82('0x6b');});return{'count':_0x331311[_0xfb82('0x65')][_0xfb82('0x34')][_0xfb82('0x35')],'rows':_[_0xfb82('0x2e')](_0x331311[_0xfb82('0x65')]['fields'],function(_0x9c7e06){return{'id':_0x9c7e06[_0xfb82('0x29')],'name':_0x9c7e06[_0xfb82('0x6c')],'custom':_['startsWith'](_0x9c7e06['name'],_0xfb82('0x6d'))?!![]:![],'options':_0x9c7e06[_0xfb82('0x2b')]['name']==='picklist'&&_0x9c7e06[_0xfb82('0x2b')][_0xfb82('0x6e')]['length']>0x0?_[_0xfb82('0x2e')](_0x9c7e06[_0xfb82('0x2b')]['picklistValues'],function(_0x1ccfb2){return{'name':_0x1ccfb2['label'],'value':_0x1ccfb2[_0xfb82('0x6f')]};}):[]};})};}})[_0xfb82('0x26')](respondWithResult(_0x137284,null))[_0xfb82('0x44')](function(_0x5cdbb8){console[_0xfb82('0x70')](_0xfb82('0x71')+_0x5cdbb8);var _0x3f2d1c=_0x1e1124[_0xfb82('0x2f')][_0xfb82('0x72')]?0x1f4:_0x5cdbb8[_0xfb82('0x73')]||0x1f4;logger[_0xfb82('0x74')]('getFields,\x20%s,\x20%s,\x20%s',_0xfb82('0x75'),_0x3f2d1c,JSON[_0xfb82('0x76')](_0x5cdbb8));delete _0x5cdbb8[_0xfb82('0x29')];if(_0x3f2d1c===0x191){_0x3f2d1c=0x190;}_0x137284[_0xfb82('0x1c')](_0x3f2d1c)['send'](_0x1e1124[_0xfb82('0x2f')]['test']?{'message':_0xfb82('0x77'),'statusCode':_0x5cdbb8[_0xfb82('0x73')]}:_0x5cdbb8);});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.model.js b/server/api/intVtigerAccount/intVtigerAccount.model.js index 4c63d8b..2810f85 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 _0xf2f1=['./intVtigerAccount.attributes','../../components/integrations/configuration','exports','define','int_vtiger_accounts','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x34e662,_0x52c76e){var _0x5e09b9=function(_0x4dc5de){while(--_0x4dc5de){_0x34e662['push'](_0x34e662['shift']());}};_0x5e09b9(++_0x52c76e);}(_0xf2f1,0x1e1));var _0x1f2f=function(_0x48f29a,_0x1f9f1a){_0x48f29a=_0x48f29a-0x0;var _0x467232=_0xf2f1[_0x48f29a];return _0x467232;};'use strict';var _=require(_0x1f2f('0x0'));var util=require(_0x1f2f('0x1'));var logger=require(_0x1f2f('0x2'))(_0x1f2f('0x3'));var moment=require(_0x1f2f('0x4'));var BPromise=require(_0x1f2f('0x5'));var rp=require(_0x1f2f('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1f2f('0x7'));var config=require(_0x1f2f('0x8'));var attributes=require(_0x1f2f('0x9'));var integrations=require(_0x1f2f('0xa'));module[_0x1f2f('0xb')]=function(_0xe0b7fb,_0x238f36){return _0xe0b7fb[_0x1f2f('0xc')]('VtigerAccount',attributes,{'tableName':_0x1f2f('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8f75=['exports','VtigerAccount','int_vtiger_accounts','lodash','util','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0xfc6d05,_0x8d51f1){var _0x9f6a29=function(_0x5bf3e9){while(--_0x5bf3e9){_0xfc6d05['push'](_0xfc6d05['shift']());}};_0x9f6a29(++_0x8d51f1);}(_0x8f75,0xad));var _0x58f7=function(_0xaac54a,_0x355b74){_0xaac54a=_0xaac54a-0x0;var _0x31751f=_0x8f75[_0xaac54a];return _0x31751f;};'use strict';var _=require(_0x58f7('0x0'));var util=require(_0x58f7('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x58f7('0x2'));var BPromise=require(_0x58f7('0x3'));var rp=require(_0x58f7('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x58f7('0x5'));var config=require(_0x58f7('0x6'));var attributes=require('./intVtigerAccount.attributes');var integrations=require('../../components/integrations/configuration');module[_0x58f7('0x7')]=function(_0x15023b,_0x478da8){return _0x15023b['define'](_0x58f7('0x8'),attributes,{'tableName':_0x58f7('0x9'),'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 58329d5..697919a 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 _0xcf66=['raw','where','attributes','limit','include','map','model','info','ShowVtigerAccount','find','debug','lodash','util','moment','randomstring','ioredis','../../config/logger','rpc','jayson/promise','client','http','request','then','request\x20sent','VtigerAccount,\x20%s,\x20%s,\x20%s','stringify','error','VtigerAccount,\x20%s,\x20%s','message','result','catch','GetVtigerAccount','VtigerAccount','options'];(function(_0x4aa028,_0x591cd2){var _0x159bd8=function(_0x55f402){while(--_0x55f402){_0x4aa028['push'](_0x4aa028['shift']());}};_0x159bd8(++_0x591cd2);}(_0xcf66,0x71));var _0x6cf6=function(_0x5d9697,_0x217298){_0x5d9697=_0x5d9697-0x0;var _0x205dec=_0xcf66[_0x5d9697];return _0x205dec;};'use strict';var _=require(_0x6cf6('0x0'));var util=require(_0x6cf6('0x1'));var moment=require(_0x6cf6('0x2'));var BPromise=require('bluebird');var rs=require(_0x6cf6('0x3'));var fs=require('fs');var Redis=require(_0x6cf6('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x6cf6('0x5'))(_0x6cf6('0x6'));var config=require('../../config/environment');var jayson=require(_0x6cf6('0x7'));var client=jayson[_0x6cf6('0x8')][_0x6cf6('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5eb082,_0x94c6a9,_0x308d0d){return new BPromise(function(_0x36b892,_0x748c93){return client[_0x6cf6('0xa')](_0x5eb082,_0x308d0d)[_0x6cf6('0xb')](function(_0x5b3827){logger['info']('VtigerAccount,\x20%s,\x20%s',_0x94c6a9,_0x6cf6('0xc'));logger['debug'](_0x6cf6('0xd'),_0x94c6a9,_0x6cf6('0xc'),JSON[_0x6cf6('0xe')](_0x5b3827));if(_0x5b3827[_0x6cf6('0xf')]){if(_0x5b3827['error']['code']===0x1f4){logger['error'](_0x6cf6('0x10'),_0x94c6a9,_0x5b3827[_0x6cf6('0xf')][_0x6cf6('0x11')]);return _0x748c93(_0x5b3827[_0x6cf6('0xf')][_0x6cf6('0x11')]);}logger[_0x6cf6('0xf')]('VtigerAccount,\x20%s,\x20%s',_0x94c6a9,_0x5b3827[_0x6cf6('0xf')]['message']);return _0x36b892(_0x5b3827[_0x6cf6('0xf')][_0x6cf6('0x11')]);}else{logger['info'](_0x6cf6('0x10'),_0x94c6a9,_0x6cf6('0xc'));_0x36b892(_0x5b3827[_0x6cf6('0x12')][_0x6cf6('0x11')]);}})[_0x6cf6('0x13')](function(_0x2bdb12){logger[_0x6cf6('0xf')](_0x6cf6('0x10'),_0x94c6a9,_0x2bdb12);_0x748c93(_0x2bdb12);});});}exports[_0x6cf6('0x14')]=function(_0x2ca2b1){var _0x5e8b11=this;return new Promise(function(_0x11d994,_0x22915c){return db[_0x6cf6('0x15')]['findAll']({'raw':_0x2ca2b1[_0x6cf6('0x16')]?_0x2ca2b1[_0x6cf6('0x16')][_0x6cf6('0x17')]===undefined?!![]:![]:!![],'where':_0x2ca2b1[_0x6cf6('0x16')]?_0x2ca2b1[_0x6cf6('0x16')][_0x6cf6('0x18')]||null:null,'attributes':_0x2ca2b1[_0x6cf6('0x16')]?_0x2ca2b1['options'][_0x6cf6('0x19')]||null:null,'limit':_0x2ca2b1[_0x6cf6('0x16')]?_0x2ca2b1[_0x6cf6('0x16')][_0x6cf6('0x1a')]||null:null,'include':_0x2ca2b1[_0x6cf6('0x16')]?_0x2ca2b1[_0x6cf6('0x16')][_0x6cf6('0x1b')]?_[_0x6cf6('0x1c')](_0x2ca2b1['options']['include'],function(_0x276225){return{'model':db[_0x276225['model']],'as':_0x276225['as'],'attributes':_0x276225[_0x6cf6('0x19')],'include':_0x276225[_0x6cf6('0x1b')]?_[_0x6cf6('0x1c')](_0x276225[_0x6cf6('0x1b')],function(_0x3f9871){return{'model':db[_0x3f9871[_0x6cf6('0x1d')]],'as':_0x3f9871['as'],'attributes':_0x3f9871[_0x6cf6('0x19')],'include':_0x3f9871['include']?_[_0x6cf6('0x1c')](_0x3f9871[_0x6cf6('0x1b')],function(_0x3eaa31){return{'model':db[_0x3eaa31['model']],'as':_0x3eaa31['as'],'attributes':_0x3eaa31[_0x6cf6('0x19')]};}):[]};}):[]};}):[]:[]})[_0x6cf6('0xb')](function(_0x2224db){logger[_0x6cf6('0x1e')]('GetVtigerAccount',_0x2ca2b1);logger['debug'](_0x6cf6('0x14'),_0x2ca2b1,JSON[_0x6cf6('0xe')](_0x2224db));_0x11d994(_0x2224db);})[_0x6cf6('0x13')](function(_0x5869e9){logger['error'](_0x6cf6('0x14'),_0x5869e9['message'],_0x2ca2b1);_0x22915c(_0x5e8b11['error'](0x1f4,_0x5869e9['message']));});});};exports[_0x6cf6('0x1f')]=function(_0x65433){var _0x33d308=this;return new Promise(function(_0x42f488,_0x11c848){return db['VtigerAccount'][_0x6cf6('0x20')]({'raw':_0x65433[_0x6cf6('0x16')]?_0x65433[_0x6cf6('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x65433[_0x6cf6('0x16')]?_0x65433[_0x6cf6('0x16')][_0x6cf6('0x18')]||null:null,'attributes':_0x65433[_0x6cf6('0x16')]?_0x65433[_0x6cf6('0x16')][_0x6cf6('0x19')]||null:null,'include':_0x65433[_0x6cf6('0x16')]?_0x65433[_0x6cf6('0x16')][_0x6cf6('0x1b')]?_[_0x6cf6('0x1c')](_0x65433[_0x6cf6('0x16')][_0x6cf6('0x1b')],function(_0x4620b6){return{'model':db[_0x4620b6[_0x6cf6('0x1d')]],'as':_0x4620b6['as'],'attributes':_0x4620b6[_0x6cf6('0x19')],'include':_0x4620b6[_0x6cf6('0x1b')]?_[_0x6cf6('0x1c')](_0x4620b6[_0x6cf6('0x1b')],function(_0x5cc6cd){return{'model':db[_0x5cc6cd[_0x6cf6('0x1d')]],'as':_0x5cc6cd['as'],'attributes':_0x5cc6cd[_0x6cf6('0x19')],'include':_0x5cc6cd[_0x6cf6('0x1b')]?_[_0x6cf6('0x1c')](_0x5cc6cd[_0x6cf6('0x1b')],function(_0x2cf3a3){return{'model':db[_0x2cf3a3[_0x6cf6('0x1d')]],'as':_0x2cf3a3['as'],'attributes':_0x2cf3a3[_0x6cf6('0x19')]};}):[]};}):[]};}):[]:[]})[_0x6cf6('0xb')](function(_0x3718a1){logger[_0x6cf6('0x1e')]('ShowVtigerAccount',_0x65433);logger[_0x6cf6('0x21')](_0x6cf6('0x1f'),_0x65433,JSON[_0x6cf6('0xe')](_0x3718a1));_0x42f488(_0x3718a1);})[_0x6cf6('0x13')](function(_0x31c822){logger[_0x6cf6('0xf')](_0x6cf6('0x1f'),_0x31c822[_0x6cf6('0x11')],_0x65433);_0x11c848(_0x33d308[_0x6cf6('0xf')](0x1f4,_0x31c822['message']));});});}; \ No newline at end of file +var _0x84a0=['bluebird','ioredis','../../mysqldb','rpc','../../config/environment','client','http','request','then','info','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','VtigerAccount,\x20%s,\x20%s','message','result','catch','VtigerAccount','findAll','options','raw','where','attributes','limit','include','model','map','GetVtigerAccount','ShowVtigerAccount','find','lodash','util','moment'];(function(_0x5d825a,_0x324068){var _0x5a252d=function(_0x43e463){while(--_0x43e463){_0x5d825a['push'](_0x5d825a['shift']());}};_0x5a252d(++_0x324068);}(_0x84a0,0x66));var _0x084a=function(_0x53309c,_0x21c68a){_0x53309c=_0x53309c-0x0;var _0x13d243=_0x84a0[_0x53309c];return _0x13d243;};'use strict';var _=require(_0x084a('0x0'));var util=require(_0x084a('0x1'));var moment=require(_0x084a('0x2'));var BPromise=require(_0x084a('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x084a('0x4'));var db=require(_0x084a('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x084a('0x6'));var config=require(_0x084a('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x084a('0x8')][_0x084a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2e6810,_0x373d2,_0x2b30bc){return new BPromise(function(_0x58d419,_0x1051a9){return client[_0x084a('0xa')](_0x2e6810,_0x2b30bc)[_0x084a('0xb')](function(_0x2888e3){logger[_0x084a('0xc')]('VtigerAccount,\x20%s,\x20%s',_0x373d2,'request\x20sent');logger[_0x084a('0xd')](_0x084a('0xe'),_0x373d2,_0x084a('0xf'),JSON[_0x084a('0x10')](_0x2888e3));if(_0x2888e3[_0x084a('0x11')]){if(_0x2888e3['error']['code']===0x1f4){logger[_0x084a('0x11')](_0x084a('0x12'),_0x373d2,_0x2888e3[_0x084a('0x11')][_0x084a('0x13')]);return _0x1051a9(_0x2888e3[_0x084a('0x11')][_0x084a('0x13')]);}logger[_0x084a('0x11')](_0x084a('0x12'),_0x373d2,_0x2888e3['error'][_0x084a('0x13')]);return _0x58d419(_0x2888e3['error'][_0x084a('0x13')]);}else{logger[_0x084a('0xc')](_0x084a('0x12'),_0x373d2,_0x084a('0xf'));_0x58d419(_0x2888e3[_0x084a('0x14')]['message']);}})[_0x084a('0x15')](function(_0x4abd81){logger[_0x084a('0x11')](_0x084a('0x12'),_0x373d2,_0x4abd81);_0x1051a9(_0x4abd81);});});}exports['GetVtigerAccount']=function(_0xf2c333){var _0x32c729=this;return new Promise(function(_0x4134b9,_0x14bb19){return db[_0x084a('0x16')][_0x084a('0x17')]({'raw':_0xf2c333[_0x084a('0x18')]?_0xf2c333[_0x084a('0x18')][_0x084a('0x19')]===undefined?!![]:![]:!![],'where':_0xf2c333[_0x084a('0x18')]?_0xf2c333[_0x084a('0x18')][_0x084a('0x1a')]||null:null,'attributes':_0xf2c333[_0x084a('0x18')]?_0xf2c333[_0x084a('0x18')][_0x084a('0x1b')]||null:null,'limit':_0xf2c333['options']?_0xf2c333[_0x084a('0x18')][_0x084a('0x1c')]||null:null,'include':_0xf2c333[_0x084a('0x18')]?_0xf2c333[_0x084a('0x18')][_0x084a('0x1d')]?_['map'](_0xf2c333[_0x084a('0x18')][_0x084a('0x1d')],function(_0x6346a5){return{'model':db[_0x6346a5[_0x084a('0x1e')]],'as':_0x6346a5['as'],'attributes':_0x6346a5[_0x084a('0x1b')],'include':_0x6346a5[_0x084a('0x1d')]?_['map'](_0x6346a5[_0x084a('0x1d')],function(_0x2af138){return{'model':db[_0x2af138[_0x084a('0x1e')]],'as':_0x2af138['as'],'attributes':_0x2af138['attributes'],'include':_0x2af138[_0x084a('0x1d')]?_[_0x084a('0x1f')](_0x2af138[_0x084a('0x1d')],function(_0x4c5658){return{'model':db[_0x4c5658['model']],'as':_0x4c5658['as'],'attributes':_0x4c5658['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x33b88f){logger['info']('GetVtigerAccount',_0xf2c333);logger['debug'](_0x084a('0x20'),_0xf2c333,JSON[_0x084a('0x10')](_0x33b88f));_0x4134b9(_0x33b88f);})[_0x084a('0x15')](function(_0x2c4149){logger[_0x084a('0x11')](_0x084a('0x20'),_0x2c4149[_0x084a('0x13')],_0xf2c333);_0x14bb19(_0x32c729[_0x084a('0x11')](0x1f4,_0x2c4149['message']));});});};exports[_0x084a('0x21')]=function(_0x3b2b38){var _0x501a16=this;return new Promise(function(_0xe1980b,_0x24bcf5){return db[_0x084a('0x16')][_0x084a('0x22')]({'raw':_0x3b2b38[_0x084a('0x18')]?_0x3b2b38[_0x084a('0x18')][_0x084a('0x19')]===undefined?!![]:![]:!![],'where':_0x3b2b38[_0x084a('0x18')]?_0x3b2b38[_0x084a('0x18')][_0x084a('0x1a')]||null:null,'attributes':_0x3b2b38[_0x084a('0x18')]?_0x3b2b38[_0x084a('0x18')][_0x084a('0x1b')]||null:null,'include':_0x3b2b38['options']?_0x3b2b38['options'][_0x084a('0x1d')]?_[_0x084a('0x1f')](_0x3b2b38[_0x084a('0x18')][_0x084a('0x1d')],function(_0x83f94f){return{'model':db[_0x83f94f['model']],'as':_0x83f94f['as'],'attributes':_0x83f94f[_0x084a('0x1b')],'include':_0x83f94f[_0x084a('0x1d')]?_[_0x084a('0x1f')](_0x83f94f['include'],function(_0x109593){return{'model':db[_0x109593[_0x084a('0x1e')]],'as':_0x109593['as'],'attributes':_0x109593[_0x084a('0x1b')],'include':_0x109593['include']?_['map'](_0x109593['include'],function(_0xf97d1b){return{'model':db[_0xf97d1b[_0x084a('0x1e')]],'as':_0xf97d1b['as'],'attributes':_0xf97d1b[_0x084a('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3c09c3){logger[_0x084a('0xc')](_0x084a('0x21'),_0x3b2b38);logger[_0x084a('0xd')](_0x084a('0x21'),_0x3b2b38,JSON[_0x084a('0x10')](_0x3c09c3));_0xe1980b(_0x3c09c3);})[_0x084a('0x15')](function(_0x19354f){logger[_0x084a('0x11')](_0x084a('0x21'),_0x19354f[_0x084a('0x13')],_0x3b2b38);_0x24bcf5(_0x501a16[_0x084a('0x11')](0x1f4,_0x19354f[_0x084a('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/index.js b/server/api/intVtigerConfiguration/index.js index c26e4be..a4b9150 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 _0xa611=['/:id','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','update','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./intVtigerConfiguration.controller','get','isAuthenticated','index'];(function(_0x21549c,_0x6d64d1){var _0x426cbd=function(_0x323f5b){while(--_0x323f5b){_0x21549c['push'](_0x21549c['shift']());}};_0x426cbd(++_0x6d64d1);}(_0xa611,0x174));var _0x1a61=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xa611[_0x2dafbe];return _0x58a45a;};'use strict';var multer=require(_0x1a61('0x0'));var util=require(_0x1a61('0x1'));var path=require(_0x1a61('0x2'));var timeout=require(_0x1a61('0x3'));var express=require(_0x1a61('0x4'));var router=express['Router']();var fs_extra=require(_0x1a61('0x5'));var auth=require(_0x1a61('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x1a61('0x7'));var controller=require(_0x1a61('0x8'));router[_0x1a61('0x9')]('/',auth[_0x1a61('0xa')](),controller[_0x1a61('0xb')]);router[_0x1a61('0x9')](_0x1a61('0xc'),auth[_0x1a61('0xa')](),controller['show']);router[_0x1a61('0x9')](_0x1a61('0xd'),auth[_0x1a61('0xa')](),controller[_0x1a61('0xe')]);router[_0x1a61('0x9')](_0x1a61('0xf'),auth[_0x1a61('0xa')](),controller[_0x1a61('0x10')]);router['get'](_0x1a61('0x11'),auth['isAuthenticated'](),controller[_0x1a61('0x12')]);router[_0x1a61('0x13')]('/',auth['isAuthenticated'](),controller[_0x1a61('0x14')]);router['put'](_0x1a61('0xc'),auth[_0x1a61('0xa')](),controller[_0x1a61('0x15')]);router['delete'](_0x1a61('0xc'),auth[_0x1a61('0xa')](),controller[_0x1a61('0x16')]);module[_0x1a61('0x17')]=router; \ No newline at end of file +var _0x1d53=['Router','fs-extra','../../components/auth/service','./intVtigerConfiguration.controller','isAuthenticated','index','get','/:id','show','/:id/fields','getFields','getSubjects','/:id/descriptions','post','put','update','exports','multer','util','path','connect-timeout','express'];(function(_0x23e645,_0x892529){var _0x542458=function(_0x31945f){while(--_0x31945f){_0x23e645['push'](_0x23e645['shift']());}};_0x542458(++_0x892529);}(_0x1d53,0x1b3));var _0x31d5=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x1d53[_0x2c91e9];return _0x13f0ff;};'use strict';var multer=require(_0x31d5('0x0'));var util=require(_0x31d5('0x1'));var path=require(_0x31d5('0x2'));var timeout=require(_0x31d5('0x3'));var express=require(_0x31d5('0x4'));var router=express[_0x31d5('0x5')]();var fs_extra=require(_0x31d5('0x6'));var auth=require(_0x31d5('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x31d5('0x8'));router['get']('/',auth[_0x31d5('0x9')](),controller[_0x31d5('0xa')]);router[_0x31d5('0xb')](_0x31d5('0xc'),auth[_0x31d5('0x9')](),controller[_0x31d5('0xd')]);router[_0x31d5('0xb')](_0x31d5('0xe'),auth[_0x31d5('0x9')](),controller[_0x31d5('0xf')]);router[_0x31d5('0xb')]('/:id/subjects',auth[_0x31d5('0x9')](),controller[_0x31d5('0x10')]);router['get'](_0x31d5('0x11'),auth[_0x31d5('0x9')](),controller['getDescriptions']);router[_0x31d5('0x12')]('/',auth[_0x31d5('0x9')](),controller['create']);router[_0x31d5('0x13')](_0x31d5('0xc'),auth[_0x31d5('0x9')](),controller[_0x31d5('0x14')]);router['delete'](_0x31d5('0xc'),auth[_0x31d5('0x9')](),controller['destroy']);module[_0x31d5('0x15')]=router; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js index fd2316e..a0b2a56 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 _0xac84=['STRING','sequelize','exports'];(function(_0x59bae2,_0x191125){var _0x1e44a0=function(_0xf6fd79){while(--_0xf6fd79){_0x59bae2['push'](_0x59bae2['shift']());}};_0x1e44a0(++_0x191125);}(_0xac84,0xf4));var _0x4ac8=function(_0x4b6cc8,_0x355e5b){_0x4b6cc8=_0x4b6cc8-0x0;var _0x5c4743=_0xac84[_0x4b6cc8];return _0x5c4743;};'use strict';var Sequelize=require(_0x4ac8('0x0'));module[_0x4ac8('0x1')]={'name':{'type':Sequelize[_0x4ac8('0x2')]},'description':{'type':Sequelize[_0x4ac8('0x2')]}}; \ No newline at end of file +var _0x9462=['STRING','sequelize'];(function(_0x371136,_0x2a6e45){var _0x8aa978=function(_0xcfd27b){while(--_0xcfd27b){_0x371136['push'](_0x371136['shift']());}};_0x8aa978(++_0x2a6e45);}(_0x9462,0xfd));var _0x2946=function(_0x3104a0,_0x1fc39b){_0x3104a0=_0x3104a0-0x0;var _0x419167=_0x9462[_0x3104a0];return _0x419167;};'use strict';var Sequelize=require(_0x2946('0x0'));module['exports']={'name':{'type':Sequelize[_0x2946('0x1')]},'description':{'type':Sequelize[_0x2946('0x1')]}}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js index 8aef5ac..bbb1b83 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 _0xbdb8=['getDescriptions','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','fs-extra','squel','desk.js','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','sendStatus','end','json','offset','undefined','limit','count','status','set','Content-Range','apply','save','then','destroy','error','stack','name','send','index','map','VtigerConfiguration','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','pick','where','merge','VIRTUAL','include','findAll','rows','catch','show','params','includeAll','options','find','create','body','getFields','findOne','VtigerField','length','order','filter','getSubjects'];(function(_0x375fc5,_0x540485){var _0x2b539e=function(_0x53ad3e){while(--_0x53ad3e){_0x375fc5['push'](_0x375fc5['shift']());}};_0x2b539e(++_0x540485);}(_0xbdb8,0xe2));var _0x8bdb=function(_0x2ce9c3,_0x20a165){_0x2ce9c3=_0x2ce9c3-0x0;var _0x109b3a=_0xbdb8[_0x2ce9c3];return _0x109b3a;};'use strict';var emlformat=require(_0x8bdb('0x0'));var rimraf=require(_0x8bdb('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8bdb('0x2'));var rp=require(_0x8bdb('0x3'));var moment=require('moment');var BPromise=require(_0x8bdb('0x4'));var Mustache=require(_0x8bdb('0x5'));var util=require(_0x8bdb('0x6'));var path=require('path');var sox=require(_0x8bdb('0x7'));var csv=require(_0x8bdb('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8bdb('0x9'));var _=require('lodash');var squel=require(_0x8bdb('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x8bdb('0xb'));var toCsv=require(_0x8bdb('0x8'));var querystring=require(_0x8bdb('0xc'));var Papa=require('papaparse');var Redis=require(_0x8bdb('0xd'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x8bdb('0xe'));var hardwareService=require(_0x8bdb('0xf'));var logger=require(_0x8bdb('0x10'))('api');var utils=require('../../config/utils');var config=require(_0x8bdb('0x11'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4cab19,_0x337ee9){_0x337ee9=_0x337ee9||0xcc;return function(_0x3107ea){if(_0x3107ea){return _0x4cab19[_0x8bdb('0x12')](_0x337ee9);}return _0x4cab19['status'](_0x337ee9)[_0x8bdb('0x13')]();};}function respondWithResult(_0x48fbd7,_0x34b025){_0x34b025=_0x34b025||0xc8;return function(_0xc11f59){if(_0xc11f59){return _0x48fbd7['status'](_0x34b025)[_0x8bdb('0x14')](_0xc11f59);}};}function respondWithFilteredResult(_0x4d4c1d,_0x845519){return function(_0x362607){if(_0x362607){var _0x3d08f4=typeof _0x845519[_0x8bdb('0x15')]===_0x8bdb('0x16')&&typeof _0x845519[_0x8bdb('0x17')]==='undefined';var _0x55fa92=_0x362607[_0x8bdb('0x18')];var _0x2d417a=_0x3d08f4?0x0:_0x845519[_0x8bdb('0x15')];var _0x470d17=_0x3d08f4?_0x362607[_0x8bdb('0x18')]:_0x845519[_0x8bdb('0x15')]+_0x845519[_0x8bdb('0x17')];var _0x5d41e4;if(_0x470d17>=_0x55fa92){_0x470d17=_0x55fa92;_0x5d41e4=0xc8;}else{_0x5d41e4=0xce;}_0x4d4c1d[_0x8bdb('0x19')](_0x5d41e4);return _0x4d4c1d[_0x8bdb('0x1a')](_0x8bdb('0x1b'),_0x2d417a+'-'+_0x470d17+'/'+_0x55fa92)[_0x8bdb('0x14')](_0x362607);}return null;};}function patchUpdates(_0xfc2878){return function(_0x459a36){try{jsonpatch[_0x8bdb('0x1c')](_0x459a36,_0xfc2878,!![]);}catch(_0xee5a39){return BPromise['reject'](_0xee5a39);}return _0x459a36[_0x8bdb('0x1d')]();};}function saveUpdates(_0x55140f,_0x4f8437){return function(_0x3c28d3){if(_0x3c28d3){return _0x3c28d3['update'](_0x55140f)[_0x8bdb('0x1e')](function(_0x34e41d){return _0x34e41d;});}return null;};}function removeEntity(_0x320b80,_0x394e64){return function(_0x225d3f){if(_0x225d3f){return _0x225d3f[_0x8bdb('0x1f')]()[_0x8bdb('0x1e')](function(){_0x320b80[_0x8bdb('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x500e1b,_0x18a923){return function(_0x49fb53){if(!_0x49fb53){_0x500e1b[_0x8bdb('0x12')](0x194);}return _0x49fb53;};}function handleError(_0x2035db,_0x2ab0a4){_0x2ab0a4=_0x2ab0a4||0x1f4;return function(_0x2f683a){logger[_0x8bdb('0x20')](_0x2f683a[_0x8bdb('0x21')]);if(_0x2f683a[_0x8bdb('0x22')]){delete _0x2f683a[_0x8bdb('0x22')];}_0x2035db[_0x8bdb('0x19')](_0x2ab0a4)[_0x8bdb('0x23')](_0x2f683a);};}exports[_0x8bdb('0x24')]=function(_0x91402e,_0x8640bb){var _0x7f6b75={},_0xeb5095={},_0x458a0b={'count':0x0,'rows':[]};var _0x56fa5e=_[_0x8bdb('0x25')](db[_0x8bdb('0x26')][_0x8bdb('0x27')],function(_0x14da7d){return{'name':_0x14da7d['fieldName'],'type':_0x14da7d[_0x8bdb('0x28')][_0x8bdb('0x29')]};});_0xeb5095[_0x8bdb('0x2a')]=_[_0x8bdb('0x25')](_0x56fa5e,'name');_0xeb5095[_0x8bdb('0x2b')]=_[_0x8bdb('0x2c')](_0x91402e['query']);_0xeb5095[_0x8bdb('0x2d')]=_[_0x8bdb('0x2e')](_0xeb5095['model'],_0xeb5095[_0x8bdb('0x2b')]);_0x7f6b75[_0x8bdb('0x2f')]=_[_0x8bdb('0x2e')](_0xeb5095[_0x8bdb('0x2a')],qs[_0x8bdb('0x30')](_0x91402e[_0x8bdb('0x2b')][_0x8bdb('0x30')]));_0x7f6b75[_0x8bdb('0x2f')]=_0x7f6b75[_0x8bdb('0x2f')]['length']?_0x7f6b75[_0x8bdb('0x2f')]:_0xeb5095['model'];if(!_0x91402e['query'][_0x8bdb('0x31')](_0x8bdb('0x32'))){_0x7f6b75['limit']=qs[_0x8bdb('0x17')](_0x91402e[_0x8bdb('0x2b')][_0x8bdb('0x17')]);_0x7f6b75[_0x8bdb('0x15')]=qs['offset'](_0x91402e['query']['offset']);}_0x7f6b75['order']=qs[_0x8bdb('0x33')](_0x91402e[_0x8bdb('0x2b')][_0x8bdb('0x33')]);_0x7f6b75['where']=qs[_0x8bdb('0x2d')](_[_0x8bdb('0x34')](_0x91402e[_0x8bdb('0x2b')],_0xeb5095[_0x8bdb('0x2d')]),_0x56fa5e);if(_0x91402e['query']['filter']){_0x7f6b75[_0x8bdb('0x35')]=_[_0x8bdb('0x36')](_0x7f6b75[_0x8bdb('0x35')],{'$or':_[_0x8bdb('0x25')](_0x56fa5e,function(_0x51172c){if(_0x51172c[_0x8bdb('0x28')]!==_0x8bdb('0x37')){var _0x286a78={};_0x286a78[_0x51172c[_0x8bdb('0x22')]]={'$like':'%'+_0x91402e['query']['filter']+'%'};return _0x286a78;}})});}_0x7f6b75=_['merge']({},_0x7f6b75,_0x91402e['options']);var _0x1623f0={'where':_0x7f6b75['where']};return db[_0x8bdb('0x26')]['count'](_0x1623f0)[_0x8bdb('0x1e')](function(_0x2d792d){_0x458a0b[_0x8bdb('0x18')]=_0x2d792d;if(_0x91402e[_0x8bdb('0x2b')]['includeAll']){_0x7f6b75[_0x8bdb('0x38')]=[{'all':!![]}];}return db[_0x8bdb('0x26')][_0x8bdb('0x39')](_0x7f6b75);})[_0x8bdb('0x1e')](function(_0x57f933){_0x458a0b[_0x8bdb('0x3a')]=_0x57f933;return _0x458a0b;})['then'](respondWithFilteredResult(_0x8640bb,_0x7f6b75))[_0x8bdb('0x3b')](handleError(_0x8640bb,null));};exports[_0x8bdb('0x3c')]=function(_0x4c8d61,_0x28d25c){var _0x65e0a8={'raw':![],'where':{'id':_0x4c8d61[_0x8bdb('0x3d')]['id']}},_0x525d7e={};_0x525d7e[_0x8bdb('0x2a')]=_[_0x8bdb('0x2c')](db[_0x8bdb('0x26')][_0x8bdb('0x27')]);_0x525d7e['query']=_[_0x8bdb('0x2c')](_0x4c8d61[_0x8bdb('0x2b')]);_0x525d7e[_0x8bdb('0x2d')]=_[_0x8bdb('0x2e')](_0x525d7e[_0x8bdb('0x2a')],_0x525d7e[_0x8bdb('0x2b')]);_0x65e0a8[_0x8bdb('0x2f')]=_[_0x8bdb('0x2e')](_0x525d7e['model'],qs[_0x8bdb('0x30')](_0x4c8d61[_0x8bdb('0x2b')][_0x8bdb('0x30')]));_0x65e0a8[_0x8bdb('0x2f')]=_0x65e0a8[_0x8bdb('0x2f')]['length']?_0x65e0a8[_0x8bdb('0x2f')]:_0x525d7e[_0x8bdb('0x2a')];if(_0x4c8d61[_0x8bdb('0x2b')][_0x8bdb('0x3e')]){_0x65e0a8[_0x8bdb('0x38')]=[{'all':!![]}];}_0x65e0a8=_[_0x8bdb('0x36')]({},_0x65e0a8,_0x4c8d61[_0x8bdb('0x3f')]);return db[_0x8bdb('0x26')][_0x8bdb('0x40')](_0x65e0a8)['then'](handleEntityNotFound(_0x28d25c,null))[_0x8bdb('0x1e')](respondWithResult(_0x28d25c,null))[_0x8bdb('0x3b')](handleError(_0x28d25c,null));};exports[_0x8bdb('0x41')]=function(_0x22bbe0,_0x20bc8f){return db[_0x8bdb('0x26')][_0x8bdb('0x41')](_0x22bbe0[_0x8bdb('0x42')],{})['then'](respondWithResult(_0x20bc8f,0xc9))[_0x8bdb('0x3b')](handleError(_0x20bc8f,null));};exports['update']=function(_0xe0281,_0x40ae68){if(_0xe0281['body']['id']){delete _0xe0281[_0x8bdb('0x42')]['id'];}return db[_0x8bdb('0x26')][_0x8bdb('0x40')]({'where':{'id':_0xe0281[_0x8bdb('0x3d')]['id']}})[_0x8bdb('0x1e')](handleEntityNotFound(_0x40ae68,null))[_0x8bdb('0x1e')](saveUpdates(_0xe0281[_0x8bdb('0x42')],null))['then'](respondWithResult(_0x40ae68,null))[_0x8bdb('0x3b')](handleError(_0x40ae68,null));};exports[_0x8bdb('0x1f')]=function(_0x1849fe,_0x2d1180){return db[_0x8bdb('0x26')][_0x8bdb('0x40')]({'where':{'id':_0x1849fe[_0x8bdb('0x3d')]['id']}})[_0x8bdb('0x1e')](handleEntityNotFound(_0x2d1180,null))[_0x8bdb('0x1e')](removeEntity(_0x2d1180,null))['catch'](handleError(_0x2d1180,null));};exports[_0x8bdb('0x43')]=function(_0x51dce2,_0x36924e,_0x546f3f){var _0x5d47f9={};var _0xb79a68={};var _0x32f652;var _0x58d054;return db[_0x8bdb('0x26')][_0x8bdb('0x44')]({'where':{'id':_0x51dce2[_0x8bdb('0x3d')]['id']}})[_0x8bdb('0x1e')](handleEntityNotFound(_0x36924e,null))[_0x8bdb('0x1e')](function(_0x54c749){if(_0x54c749){_0x32f652=_0x54c749;_0xb79a68[_0x8bdb('0x2a')]=_[_0x8bdb('0x2c')](db[_0x8bdb('0x45')]['rawAttributes']);_0xb79a68[_0x8bdb('0x2b')]=_[_0x8bdb('0x2c')](_0x51dce2['query']);_0xb79a68[_0x8bdb('0x2d')]=_[_0x8bdb('0x2e')](_0xb79a68['model'],_0xb79a68['query']);_0x5d47f9[_0x8bdb('0x2f')]=_[_0x8bdb('0x2e')](_0xb79a68[_0x8bdb('0x2a')],qs[_0x8bdb('0x30')](_0x51dce2[_0x8bdb('0x2b')][_0x8bdb('0x30')]));_0x5d47f9[_0x8bdb('0x2f')]=_0x5d47f9[_0x8bdb('0x2f')][_0x8bdb('0x46')]?_0x5d47f9['attributes']:_0xb79a68[_0x8bdb('0x2a')];_0x5d47f9[_0x8bdb('0x47')]=qs[_0x8bdb('0x33')](_0x51dce2[_0x8bdb('0x2b')][_0x8bdb('0x33')]);_0x5d47f9[_0x8bdb('0x35')]=qs[_0x8bdb('0x2d')](_[_0x8bdb('0x34')](_0x51dce2['query'],_0xb79a68['filters']));if(_0x51dce2['query'][_0x8bdb('0x48')]){_0x5d47f9[_0x8bdb('0x35')]=_[_0x8bdb('0x36')](_0x5d47f9[_0x8bdb('0x35')],{'$or':_[_0x8bdb('0x25')](_0x5d47f9[_0x8bdb('0x2f')],function(_0x4ab4b0){var _0x3cc6e7={};_0x3cc6e7[_0x4ab4b0]={'$like':'%'+_0x51dce2[_0x8bdb('0x2b')][_0x8bdb('0x48')]+'%'};return _0x3cc6e7;})});}_0x5d47f9=_['merge']({},_0x5d47f9,_0x51dce2[_0x8bdb('0x3f')]);return _0x32f652[_0x8bdb('0x43')](_0x5d47f9);}})['then'](function(_0x160894){if(_0x160894){_0x58d054=_0x160894[_0x8bdb('0x46')];if(!_0x51dce2[_0x8bdb('0x2b')][_0x8bdb('0x31')](_0x8bdb('0x32'))){_0x5d47f9[_0x8bdb('0x17')]=qs[_0x8bdb('0x17')](_0x51dce2[_0x8bdb('0x2b')][_0x8bdb('0x17')]);_0x5d47f9[_0x8bdb('0x15')]=qs['offset'](_0x51dce2['query'][_0x8bdb('0x15')]);}return _0x32f652[_0x8bdb('0x43')](_0x5d47f9);}})[_0x8bdb('0x1e')](function(_0x27053a){if(_0x27053a){return _0x27053a?{'count':_0x58d054,'rows':_0x27053a}:null;}})['then'](respondWithResult(_0x36924e,null))['catch'](handleError(_0x36924e,null));};exports[_0x8bdb('0x49')]=function(_0x532b08,_0x174650,_0x2b0538){var _0x36a88f={};var _0x419a08={};var _0x123308;var _0x5dad19;return db[_0x8bdb('0x26')][_0x8bdb('0x44')]({'where':{'id':_0x532b08[_0x8bdb('0x3d')]['id']}})[_0x8bdb('0x1e')](handleEntityNotFound(_0x174650,null))[_0x8bdb('0x1e')](function(_0x52c117){if(_0x52c117){_0x123308=_0x52c117;_0x419a08[_0x8bdb('0x2a')]=_[_0x8bdb('0x2c')](db[_0x8bdb('0x45')][_0x8bdb('0x27')]);_0x419a08[_0x8bdb('0x2b')]=_['keys'](_0x532b08[_0x8bdb('0x2b')]);_0x419a08['filters']=_[_0x8bdb('0x2e')](_0x419a08[_0x8bdb('0x2a')],_0x419a08[_0x8bdb('0x2b')]);_0x36a88f[_0x8bdb('0x2f')]=_[_0x8bdb('0x2e')](_0x419a08['model'],qs[_0x8bdb('0x30')](_0x532b08['query'][_0x8bdb('0x30')]));_0x36a88f['attributes']=_0x36a88f[_0x8bdb('0x2f')]['length']?_0x36a88f['attributes']:_0x419a08['model'];_0x36a88f['order']=qs['sort'](_0x532b08[_0x8bdb('0x2b')][_0x8bdb('0x33')]);_0x36a88f[_0x8bdb('0x35')]=qs[_0x8bdb('0x2d')](_[_0x8bdb('0x34')](_0x532b08[_0x8bdb('0x2b')],_0x419a08[_0x8bdb('0x2d')]));if(_0x532b08[_0x8bdb('0x2b')][_0x8bdb('0x48')]){_0x36a88f['where']=_['merge'](_0x36a88f[_0x8bdb('0x35')],{'$or':_['map'](_0x36a88f['attributes'],function(_0x462bd1){var _0x3ed588={};_0x3ed588[_0x462bd1]={'$like':'%'+_0x532b08[_0x8bdb('0x2b')]['filter']+'%'};return _0x3ed588;})});}_0x36a88f=_[_0x8bdb('0x36')]({},_0x36a88f,_0x532b08[_0x8bdb('0x3f')]);return _0x123308[_0x8bdb('0x49')](_0x36a88f);}})[_0x8bdb('0x1e')](function(_0x14a5f9){if(_0x14a5f9){_0x5dad19=_0x14a5f9[_0x8bdb('0x46')];if(!_0x532b08['query'][_0x8bdb('0x31')](_0x8bdb('0x32'))){_0x36a88f[_0x8bdb('0x17')]=qs[_0x8bdb('0x17')](_0x532b08['query'][_0x8bdb('0x17')]);_0x36a88f[_0x8bdb('0x15')]=qs[_0x8bdb('0x15')](_0x532b08[_0x8bdb('0x2b')][_0x8bdb('0x15')]);}return _0x123308[_0x8bdb('0x49')](_0x36a88f);}})['then'](function(_0x5be538){if(_0x5be538){return _0x5be538?{'count':_0x5dad19,'rows':_0x5be538}:null;}})[_0x8bdb('0x1e')](respondWithResult(_0x174650,null))[_0x8bdb('0x3b')](handleError(_0x174650,null));};exports[_0x8bdb('0x4a')]=function(_0x449307,_0x5be53d,_0x2957f4){var _0x1df758={};var _0x4c04bd={};var _0x166f31;var _0x785332;return db['VtigerConfiguration'][_0x8bdb('0x44')]({'where':{'id':_0x449307[_0x8bdb('0x3d')]['id']}})[_0x8bdb('0x1e')](handleEntityNotFound(_0x5be53d,null))[_0x8bdb('0x1e')](function(_0x22f85b){if(_0x22f85b){_0x166f31=_0x22f85b;_0x4c04bd[_0x8bdb('0x2a')]=_[_0x8bdb('0x2c')](db[_0x8bdb('0x45')][_0x8bdb('0x27')]);_0x4c04bd[_0x8bdb('0x2b')]=_['keys'](_0x449307[_0x8bdb('0x2b')]);_0x4c04bd[_0x8bdb('0x2d')]=_[_0x8bdb('0x2e')](_0x4c04bd[_0x8bdb('0x2a')],_0x4c04bd[_0x8bdb('0x2b')]);_0x1df758[_0x8bdb('0x2f')]=_['intersection'](_0x4c04bd[_0x8bdb('0x2a')],qs[_0x8bdb('0x30')](_0x449307[_0x8bdb('0x2b')][_0x8bdb('0x30')]));_0x1df758['attributes']=_0x1df758[_0x8bdb('0x2f')][_0x8bdb('0x46')]?_0x1df758[_0x8bdb('0x2f')]:_0x4c04bd[_0x8bdb('0x2a')];_0x1df758[_0x8bdb('0x47')]=qs[_0x8bdb('0x33')](_0x449307[_0x8bdb('0x2b')][_0x8bdb('0x33')]);_0x1df758[_0x8bdb('0x35')]=qs[_0x8bdb('0x2d')](_['pick'](_0x449307[_0x8bdb('0x2b')],_0x4c04bd[_0x8bdb('0x2d')]));if(_0x449307[_0x8bdb('0x2b')][_0x8bdb('0x48')]){_0x1df758[_0x8bdb('0x35')]=_['merge'](_0x1df758['where'],{'$or':_[_0x8bdb('0x25')](_0x1df758[_0x8bdb('0x2f')],function(_0x4ff9c9){var _0x10a8be={};_0x10a8be[_0x4ff9c9]={'$like':'%'+_0x449307['query'][_0x8bdb('0x48')]+'%'};return _0x10a8be;})});}_0x1df758=_[_0x8bdb('0x36')]({},_0x1df758,_0x449307[_0x8bdb('0x3f')]);return _0x166f31[_0x8bdb('0x4a')](_0x1df758);}})[_0x8bdb('0x1e')](function(_0x42822c){if(_0x42822c){_0x785332=_0x42822c[_0x8bdb('0x46')];if(!_0x449307[_0x8bdb('0x2b')][_0x8bdb('0x31')]('nolimit')){_0x1df758[_0x8bdb('0x17')]=qs[_0x8bdb('0x17')](_0x449307[_0x8bdb('0x2b')]['limit']);_0x1df758[_0x8bdb('0x15')]=qs['offset'](_0x449307[_0x8bdb('0x2b')][_0x8bdb('0x15')]);}return _0x166f31[_0x8bdb('0x4a')](_0x1df758);}})['then'](function(_0x3019f6){if(_0x3019f6){return _0x3019f6?{'count':_0x785332,'rows':_0x3019f6}:null;}})['then'](respondWithResult(_0x5be53d,null))[_0x8bdb('0x3b')](handleError(_0x5be53d,null));}; \ No newline at end of file +var _0xbb67=['end','json','offset','limit','count','set','Content-Range','apply','reject','save','update','then','status','error','stack','name','send','index','VtigerConfiguration','rawAttributes','fieldName','key','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','findAll','catch','includeAll','include','find','create','body','destroy','params','getFields','findOne','map','hasOwnProperty','getSubjects','VtigerField','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0xbb67,0x8b));var _0x7bb6=function(_0x58e70b,_0x12b374){_0x58e70b=_0x58e70b-0x0;var _0x2d71b2=_0xbb67[_0x58e70b];return _0x2d71b2;};'use strict';var emlformat=require(_0x7bb6('0x0'));var rimraf=require(_0x7bb6('0x1'));var zipdir=require(_0x7bb6('0x2'));var jsonpatch=require(_0x7bb6('0x3'));var rp=require(_0x7bb6('0x4'));var moment=require(_0x7bb6('0x5'));var BPromise=require(_0x7bb6('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x7bb6('0x7'));var sox=require('sox');var csv=require(_0x7bb6('0x8'));var ejs=require(_0x7bb6('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x7bb6('0xa'));var crypto=require(_0x7bb6('0xb'));var jsforce=require(_0x7bb6('0xc'));var deskjs=require(_0x7bb6('0xd'));var toCsv=require(_0x7bb6('0x8'));var querystring=require(_0x7bb6('0xe'));var Papa=require(_0x7bb6('0xf'));var Redis=require(_0x7bb6('0x10'));var authService=require(_0x7bb6('0x11'));var qs=require(_0x7bb6('0x12'));var as=require(_0x7bb6('0x13'));var hardwareService=require(_0x7bb6('0x14'));var logger=require(_0x7bb6('0x15'))(_0x7bb6('0x16'));var utils=require(_0x7bb6('0x17'));var config=require(_0x7bb6('0x18'));var licenseUtil=require(_0x7bb6('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2b0ba3,_0x165954){_0x165954=_0x165954||0xcc;return function(_0x58e29b){if(_0x58e29b){return _0x2b0ba3[_0x7bb6('0x1a')](_0x165954);}return _0x2b0ba3['status'](_0x165954)[_0x7bb6('0x1b')]();};}function respondWithResult(_0x594e14,_0x570184){_0x570184=_0x570184||0xc8;return function(_0x4c5ef5){if(_0x4c5ef5){return _0x594e14['status'](_0x570184)[_0x7bb6('0x1c')](_0x4c5ef5);}};}function respondWithFilteredResult(_0x32289c,_0x2fbd8d){return function(_0x2c5ec1){if(_0x2c5ec1){var _0x31059c=typeof _0x2fbd8d[_0x7bb6('0x1d')]==='undefined'&&typeof _0x2fbd8d[_0x7bb6('0x1e')]==='undefined';var _0x532de7=_0x2c5ec1[_0x7bb6('0x1f')];var _0x20b1b8=_0x31059c?0x0:_0x2fbd8d[_0x7bb6('0x1d')];var _0x306901=_0x31059c?_0x2c5ec1[_0x7bb6('0x1f')]:_0x2fbd8d['offset']+_0x2fbd8d[_0x7bb6('0x1e')];var _0x55a8b0;if(_0x306901>=_0x532de7){_0x306901=_0x532de7;_0x55a8b0=0xc8;}else{_0x55a8b0=0xce;}_0x32289c['status'](_0x55a8b0);return _0x32289c[_0x7bb6('0x20')](_0x7bb6('0x21'),_0x20b1b8+'-'+_0x306901+'/'+_0x532de7)[_0x7bb6('0x1c')](_0x2c5ec1);}return null;};}function patchUpdates(_0x32d6ee){return function(_0xc49bff){try{jsonpatch[_0x7bb6('0x22')](_0xc49bff,_0x32d6ee,!![]);}catch(_0x53536b){return BPromise[_0x7bb6('0x23')](_0x53536b);}return _0xc49bff[_0x7bb6('0x24')]();};}function saveUpdates(_0x4bc8da,_0x203853){return function(_0x362589){if(_0x362589){return _0x362589[_0x7bb6('0x25')](_0x4bc8da)[_0x7bb6('0x26')](function(_0x573808){return _0x573808;});}return null;};}function removeEntity(_0x1d9dd1,_0x3731b0){return function(_0x12d41f){if(_0x12d41f){return _0x12d41f['destroy']()['then'](function(){_0x1d9dd1[_0x7bb6('0x27')](0xcc)[_0x7bb6('0x1b')]();});}};}function handleEntityNotFound(_0x65b76a,_0x182c5f){return function(_0x1b1da0){if(!_0x1b1da0){_0x65b76a[_0x7bb6('0x1a')](0x194);}return _0x1b1da0;};}function handleError(_0x2ab454,_0x37a832){_0x37a832=_0x37a832||0x1f4;return function(_0x34fbfa){logger[_0x7bb6('0x28')](_0x34fbfa[_0x7bb6('0x29')]);if(_0x34fbfa[_0x7bb6('0x2a')]){delete _0x34fbfa['name'];}_0x2ab454[_0x7bb6('0x27')](_0x37a832)[_0x7bb6('0x2b')](_0x34fbfa);};}exports[_0x7bb6('0x2c')]=function(_0xa9cd89,_0x8f1ac6){var _0x317dbc={},_0xdf163={},_0x5c914d={'count':0x0,'rows':[]};var _0x6b4673=_['map'](db[_0x7bb6('0x2d')][_0x7bb6('0x2e')],function(_0x5157c2){return{'name':_0x5157c2[_0x7bb6('0x2f')],'type':_0x5157c2['type'][_0x7bb6('0x30')]};});_0xdf163[_0x7bb6('0x31')]=_['map'](_0x6b4673,'name');_0xdf163['query']=_[_0x7bb6('0x32')](_0xa9cd89[_0x7bb6('0x33')]);_0xdf163[_0x7bb6('0x34')]=_[_0x7bb6('0x35')](_0xdf163[_0x7bb6('0x31')],_0xdf163[_0x7bb6('0x33')]);_0x317dbc[_0x7bb6('0x36')]=_[_0x7bb6('0x35')](_0xdf163[_0x7bb6('0x31')],qs[_0x7bb6('0x37')](_0xa9cd89[_0x7bb6('0x33')]['fields']));_0x317dbc['attributes']=_0x317dbc[_0x7bb6('0x36')][_0x7bb6('0x38')]?_0x317dbc[_0x7bb6('0x36')]:_0xdf163[_0x7bb6('0x31')];if(!_0xa9cd89[_0x7bb6('0x33')]['hasOwnProperty'](_0x7bb6('0x39'))){_0x317dbc[_0x7bb6('0x1e')]=qs[_0x7bb6('0x1e')](_0xa9cd89[_0x7bb6('0x33')][_0x7bb6('0x1e')]);_0x317dbc[_0x7bb6('0x1d')]=qs[_0x7bb6('0x1d')](_0xa9cd89[_0x7bb6('0x33')][_0x7bb6('0x1d')]);}_0x317dbc[_0x7bb6('0x3a')]=qs[_0x7bb6('0x3b')](_0xa9cd89[_0x7bb6('0x33')]['sort']);_0x317dbc[_0x7bb6('0x3c')]=qs[_0x7bb6('0x34')](_[_0x7bb6('0x3d')](_0xa9cd89['query'],_0xdf163[_0x7bb6('0x34')]),_0x6b4673);if(_0xa9cd89[_0x7bb6('0x33')][_0x7bb6('0x3e')]){_0x317dbc[_0x7bb6('0x3c')]=_[_0x7bb6('0x3f')](_0x317dbc[_0x7bb6('0x3c')],{'$or':_['map'](_0x6b4673,function(_0x182747){if(_0x182747[_0x7bb6('0x40')]!==_0x7bb6('0x41')){var _0x17b1f9={};_0x17b1f9[_0x182747[_0x7bb6('0x2a')]]={'$like':'%'+_0xa9cd89[_0x7bb6('0x33')][_0x7bb6('0x3e')]+'%'};return _0x17b1f9;}})});}_0x317dbc=_[_0x7bb6('0x3f')]({},_0x317dbc,_0xa9cd89[_0x7bb6('0x42')]);var _0x39ba29={'where':_0x317dbc['where']};return db[_0x7bb6('0x2d')][_0x7bb6('0x1f')](_0x39ba29)['then'](function(_0x256a94){_0x5c914d[_0x7bb6('0x1f')]=_0x256a94;if(_0xa9cd89['query']['includeAll']){_0x317dbc['include']=[{'all':!![]}];}return db[_0x7bb6('0x2d')][_0x7bb6('0x43')](_0x317dbc);})['then'](function(_0x43cd99){_0x5c914d['rows']=_0x43cd99;return _0x5c914d;})['then'](respondWithFilteredResult(_0x8f1ac6,_0x317dbc))[_0x7bb6('0x44')](handleError(_0x8f1ac6,null));};exports['show']=function(_0xada43f,_0x5ba55d){var _0x25cb80={'raw':![],'where':{'id':_0xada43f['params']['id']}},_0x39fc69={};_0x39fc69['model']=_[_0x7bb6('0x32')](db[_0x7bb6('0x2d')][_0x7bb6('0x2e')]);_0x39fc69['query']=_['keys'](_0xada43f['query']);_0x39fc69[_0x7bb6('0x34')]=_['intersection'](_0x39fc69['model'],_0x39fc69[_0x7bb6('0x33')]);_0x25cb80[_0x7bb6('0x36')]=_['intersection'](_0x39fc69['model'],qs[_0x7bb6('0x37')](_0xada43f[_0x7bb6('0x33')][_0x7bb6('0x37')]));_0x25cb80[_0x7bb6('0x36')]=_0x25cb80[_0x7bb6('0x36')][_0x7bb6('0x38')]?_0x25cb80['attributes']:_0x39fc69[_0x7bb6('0x31')];if(_0xada43f['query'][_0x7bb6('0x45')]){_0x25cb80[_0x7bb6('0x46')]=[{'all':!![]}];}_0x25cb80=_['merge']({},_0x25cb80,_0xada43f[_0x7bb6('0x42')]);return db[_0x7bb6('0x2d')][_0x7bb6('0x47')](_0x25cb80)[_0x7bb6('0x26')](handleEntityNotFound(_0x5ba55d,null))[_0x7bb6('0x26')](respondWithResult(_0x5ba55d,null))[_0x7bb6('0x44')](handleError(_0x5ba55d,null));};exports['create']=function(_0x513995,_0x548a3e){return db[_0x7bb6('0x2d')][_0x7bb6('0x48')](_0x513995[_0x7bb6('0x49')],{})['then'](respondWithResult(_0x548a3e,0xc9))[_0x7bb6('0x44')](handleError(_0x548a3e,null));};exports[_0x7bb6('0x25')]=function(_0x141f03,_0x4833da){if(_0x141f03[_0x7bb6('0x49')]['id']){delete _0x141f03[_0x7bb6('0x49')]['id'];}return db[_0x7bb6('0x2d')]['find']({'where':{'id':_0x141f03['params']['id']}})[_0x7bb6('0x26')](handleEntityNotFound(_0x4833da,null))[_0x7bb6('0x26')](saveUpdates(_0x141f03[_0x7bb6('0x49')],null))['then'](respondWithResult(_0x4833da,null))['catch'](handleError(_0x4833da,null));};exports[_0x7bb6('0x4a')]=function(_0xf89128,_0x333b1c){return db[_0x7bb6('0x2d')][_0x7bb6('0x47')]({'where':{'id':_0xf89128[_0x7bb6('0x4b')]['id']}})[_0x7bb6('0x26')](handleEntityNotFound(_0x333b1c,null))[_0x7bb6('0x26')](removeEntity(_0x333b1c,null))[_0x7bb6('0x44')](handleError(_0x333b1c,null));};exports[_0x7bb6('0x4c')]=function(_0x5229a8,_0x39066e,_0x1953a0){var _0x21fd0c={};var _0x4d49fe={};var _0xbac067;var _0x313e86;return db['VtigerConfiguration'][_0x7bb6('0x4d')]({'where':{'id':_0x5229a8[_0x7bb6('0x4b')]['id']}})[_0x7bb6('0x26')](handleEntityNotFound(_0x39066e,null))['then'](function(_0x2faf42){if(_0x2faf42){_0xbac067=_0x2faf42;_0x4d49fe['model']=_[_0x7bb6('0x32')](db['VtigerField'][_0x7bb6('0x2e')]);_0x4d49fe[_0x7bb6('0x33')]=_[_0x7bb6('0x32')](_0x5229a8[_0x7bb6('0x33')]);_0x4d49fe[_0x7bb6('0x34')]=_[_0x7bb6('0x35')](_0x4d49fe[_0x7bb6('0x31')],_0x4d49fe[_0x7bb6('0x33')]);_0x21fd0c[_0x7bb6('0x36')]=_[_0x7bb6('0x35')](_0x4d49fe[_0x7bb6('0x31')],qs[_0x7bb6('0x37')](_0x5229a8['query']['fields']));_0x21fd0c[_0x7bb6('0x36')]=_0x21fd0c[_0x7bb6('0x36')]['length']?_0x21fd0c[_0x7bb6('0x36')]:_0x4d49fe[_0x7bb6('0x31')];_0x21fd0c[_0x7bb6('0x3a')]=qs[_0x7bb6('0x3b')](_0x5229a8[_0x7bb6('0x33')][_0x7bb6('0x3b')]);_0x21fd0c[_0x7bb6('0x3c')]=qs[_0x7bb6('0x34')](_[_0x7bb6('0x3d')](_0x5229a8[_0x7bb6('0x33')],_0x4d49fe[_0x7bb6('0x34')]));if(_0x5229a8['query'][_0x7bb6('0x3e')]){_0x21fd0c[_0x7bb6('0x3c')]=_[_0x7bb6('0x3f')](_0x21fd0c[_0x7bb6('0x3c')],{'$or':_[_0x7bb6('0x4e')](_0x21fd0c[_0x7bb6('0x36')],function(_0x19b40a){var _0x2a0aba={};_0x2a0aba[_0x19b40a]={'$like':'%'+_0x5229a8[_0x7bb6('0x33')][_0x7bb6('0x3e')]+'%'};return _0x2a0aba;})});}_0x21fd0c=_[_0x7bb6('0x3f')]({},_0x21fd0c,_0x5229a8[_0x7bb6('0x42')]);return _0xbac067['getFields'](_0x21fd0c);}})[_0x7bb6('0x26')](function(_0x5b84d4){if(_0x5b84d4){_0x313e86=_0x5b84d4[_0x7bb6('0x38')];if(!_0x5229a8[_0x7bb6('0x33')][_0x7bb6('0x4f')]('nolimit')){_0x21fd0c[_0x7bb6('0x1e')]=qs[_0x7bb6('0x1e')](_0x5229a8[_0x7bb6('0x33')][_0x7bb6('0x1e')]);_0x21fd0c['offset']=qs[_0x7bb6('0x1d')](_0x5229a8[_0x7bb6('0x33')][_0x7bb6('0x1d')]);}return _0xbac067['getFields'](_0x21fd0c);}})['then'](function(_0x10fedf){if(_0x10fedf){return _0x10fedf?{'count':_0x313e86,'rows':_0x10fedf}:null;}})['then'](respondWithResult(_0x39066e,null))[_0x7bb6('0x44')](handleError(_0x39066e,null));};exports[_0x7bb6('0x50')]=function(_0x114330,_0x5c01c8,_0x10dfb8){var _0x431902={};var _0x46f88d={};var _0x1f9204;var _0x41c865;return db[_0x7bb6('0x2d')][_0x7bb6('0x4d')]({'where':{'id':_0x114330[_0x7bb6('0x4b')]['id']}})[_0x7bb6('0x26')](handleEntityNotFound(_0x5c01c8,null))['then'](function(_0x48999a){if(_0x48999a){_0x1f9204=_0x48999a;_0x46f88d[_0x7bb6('0x31')]=_['keys'](db[_0x7bb6('0x51')]['rawAttributes']);_0x46f88d[_0x7bb6('0x33')]=_['keys'](_0x114330[_0x7bb6('0x33')]);_0x46f88d[_0x7bb6('0x34')]=_[_0x7bb6('0x35')](_0x46f88d[_0x7bb6('0x31')],_0x46f88d[_0x7bb6('0x33')]);_0x431902[_0x7bb6('0x36')]=_[_0x7bb6('0x35')](_0x46f88d['model'],qs[_0x7bb6('0x37')](_0x114330['query'][_0x7bb6('0x37')]));_0x431902[_0x7bb6('0x36')]=_0x431902[_0x7bb6('0x36')][_0x7bb6('0x38')]?_0x431902[_0x7bb6('0x36')]:_0x46f88d[_0x7bb6('0x31')];_0x431902[_0x7bb6('0x3a')]=qs[_0x7bb6('0x3b')](_0x114330['query'][_0x7bb6('0x3b')]);_0x431902['where']=qs['filters'](_[_0x7bb6('0x3d')](_0x114330[_0x7bb6('0x33')],_0x46f88d[_0x7bb6('0x34')]));if(_0x114330[_0x7bb6('0x33')][_0x7bb6('0x3e')]){_0x431902['where']=_['merge'](_0x431902[_0x7bb6('0x3c')],{'$or':_[_0x7bb6('0x4e')](_0x431902[_0x7bb6('0x36')],function(_0xc5a30b){var _0x4b6648={};_0x4b6648[_0xc5a30b]={'$like':'%'+_0x114330[_0x7bb6('0x33')][_0x7bb6('0x3e')]+'%'};return _0x4b6648;})});}_0x431902=_['merge']({},_0x431902,_0x114330['options']);return _0x1f9204['getSubjects'](_0x431902);}})[_0x7bb6('0x26')](function(_0x3a45b0){if(_0x3a45b0){_0x41c865=_0x3a45b0[_0x7bb6('0x38')];if(!_0x114330[_0x7bb6('0x33')][_0x7bb6('0x4f')]('nolimit')){_0x431902[_0x7bb6('0x1e')]=qs['limit'](_0x114330[_0x7bb6('0x33')][_0x7bb6('0x1e')]);_0x431902['offset']=qs[_0x7bb6('0x1d')](_0x114330[_0x7bb6('0x33')][_0x7bb6('0x1d')]);}return _0x1f9204[_0x7bb6('0x50')](_0x431902);}})['then'](function(_0x1636ae){if(_0x1636ae){return _0x1636ae?{'count':_0x41c865,'rows':_0x1636ae}:null;}})[_0x7bb6('0x26')](respondWithResult(_0x5c01c8,null))[_0x7bb6('0x44')](handleError(_0x5c01c8,null));};exports[_0x7bb6('0x52')]=function(_0x35061f,_0x4affe7,_0x52f415){var _0x14ee4b={};var _0x5a0874={};var _0x529a4c;var _0x238613;return db['VtigerConfiguration'][_0x7bb6('0x4d')]({'where':{'id':_0x35061f[_0x7bb6('0x4b')]['id']}})[_0x7bb6('0x26')](handleEntityNotFound(_0x4affe7,null))[_0x7bb6('0x26')](function(_0x5da135){if(_0x5da135){_0x529a4c=_0x5da135;_0x5a0874[_0x7bb6('0x31')]=_[_0x7bb6('0x32')](db['VtigerField'][_0x7bb6('0x2e')]);_0x5a0874[_0x7bb6('0x33')]=_['keys'](_0x35061f[_0x7bb6('0x33')]);_0x5a0874[_0x7bb6('0x34')]=_[_0x7bb6('0x35')](_0x5a0874['model'],_0x5a0874[_0x7bb6('0x33')]);_0x14ee4b[_0x7bb6('0x36')]=_[_0x7bb6('0x35')](_0x5a0874[_0x7bb6('0x31')],qs[_0x7bb6('0x37')](_0x35061f['query'][_0x7bb6('0x37')]));_0x14ee4b[_0x7bb6('0x36')]=_0x14ee4b[_0x7bb6('0x36')][_0x7bb6('0x38')]?_0x14ee4b[_0x7bb6('0x36')]:_0x5a0874[_0x7bb6('0x31')];_0x14ee4b[_0x7bb6('0x3a')]=qs[_0x7bb6('0x3b')](_0x35061f[_0x7bb6('0x33')][_0x7bb6('0x3b')]);_0x14ee4b['where']=qs[_0x7bb6('0x34')](_[_0x7bb6('0x3d')](_0x35061f[_0x7bb6('0x33')],_0x5a0874['filters']));if(_0x35061f['query'][_0x7bb6('0x3e')]){_0x14ee4b[_0x7bb6('0x3c')]=_[_0x7bb6('0x3f')](_0x14ee4b[_0x7bb6('0x3c')],{'$or':_['map'](_0x14ee4b[_0x7bb6('0x36')],function(_0x2f44ee){var _0x1b3185={};_0x1b3185[_0x2f44ee]={'$like':'%'+_0x35061f['query'][_0x7bb6('0x3e')]+'%'};return _0x1b3185;})});}_0x14ee4b=_[_0x7bb6('0x3f')]({},_0x14ee4b,_0x35061f[_0x7bb6('0x42')]);return _0x529a4c['getDescriptions'](_0x14ee4b);}})[_0x7bb6('0x26')](function(_0x91aa4a){if(_0x91aa4a){_0x238613=_0x91aa4a[_0x7bb6('0x38')];if(!_0x35061f[_0x7bb6('0x33')][_0x7bb6('0x4f')]('nolimit')){_0x14ee4b['limit']=qs[_0x7bb6('0x1e')](_0x35061f['query'][_0x7bb6('0x1e')]);_0x14ee4b[_0x7bb6('0x1d')]=qs[_0x7bb6('0x1d')](_0x35061f[_0x7bb6('0x33')]['offset']);}return _0x529a4c[_0x7bb6('0x52')](_0x14ee4b);}})[_0x7bb6('0x26')](function(_0x4be599){if(_0x4be599){return _0x4be599?{'count':_0x238613,'rows':_0x4be599}:null;}})[_0x7bb6('0x26')](respondWithResult(_0x4affe7,null))['catch'](handleError(_0x4affe7,null));}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js index 71ef3f2..dda4fd9 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 _0x57dd=['path','./intVtigerConfiguration.attributes','exports','define','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x32bc16,_0x542550){var _0xd8beb1=function(_0x363051){while(--_0x363051){_0x32bc16['push'](_0x32bc16['shift']());}};_0xd8beb1(++_0x542550);}(_0x57dd,0x19e));var _0xd57d=function(_0x2274ec,_0xb001c4){_0x2274ec=_0x2274ec-0x0;var _0x1e378b=_0x57dd[_0x2274ec];return _0x1e378b;};'use strict';var _=require(_0xd57d('0x0'));var util=require(_0xd57d('0x1'));var logger=require(_0xd57d('0x2'))(_0xd57d('0x3'));var moment=require(_0xd57d('0x4'));var BPromise=require(_0xd57d('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd57d('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xd57d('0x7'));module[_0xd57d('0x8')]=function(_0x2c000e,_0x166a86){return _0x2c000e[_0xd57d('0x9')]('VtigerConfiguration',attributes,{'tableName':'int_vtiger_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x75fd=['../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./intVtigerConfiguration.attributes','exports','define','VtigerConfiguration','int_vtiger_configurations','util'];(function(_0x3b22d8,_0x2791e){var _0x19f3a1=function(_0x1f0f78){while(--_0x1f0f78){_0x3b22d8['push'](_0x3b22d8['shift']());}};_0x19f3a1(++_0x2791e);}(_0x75fd,0x14f));var _0xd75f=function(_0x167f5a,_0x1f5931){_0x167f5a=_0x167f5a-0x0;var _0x4f4837=_0x75fd[_0x167f5a];return _0x4f4837;};'use strict';var _=require('lodash');var util=require(_0xd75f('0x0'));var logger=require(_0xd75f('0x1'))(_0xd75f('0x2'));var moment=require(_0xd75f('0x3'));var BPromise=require('bluebird');var rp=require(_0xd75f('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd75f('0x5'));var config=require(_0xd75f('0x6'));var attributes=require(_0xd75f('0x7'));module[_0xd75f('0x8')]=function(_0x3db270,_0x413c49){return _0x3db270[_0xd75f('0x9')](_0xd75f('0xa'),attributes,{'tableName':_0xd75f('0xb'),'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 23b97d8..385c556 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 _0x5cae=['moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','request','then','info','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x5cae,0x1e1));var _0xe5ca=function(_0x1e6659,_0x1f860c){_0x1e6659=_0x1e6659-0x0;var _0x4d16e4=_0x5cae[_0x1e6659];return _0x4d16e4;};'use strict';var _=require(_0xe5ca('0x0'));var util=require(_0xe5ca('0x1'));var moment=require(_0xe5ca('0x2'));var BPromise=require(_0xe5ca('0x3'));var rs=require(_0xe5ca('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe5ca('0x5'))['db'];var utils=require(_0xe5ca('0x6'));var logger=require(_0xe5ca('0x7'))(_0xe5ca('0x8'));var config=require(_0xe5ca('0x9'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0xd4e8dd,_0x3e07b6,_0x113ca7){return new BPromise(function(_0x4baac2,_0x1fa246){return client[_0xe5ca('0xa')](_0xd4e8dd,_0x113ca7)[_0xe5ca('0xb')](function(_0x41e895){logger[_0xe5ca('0xc')](_0xe5ca('0xd'),_0x3e07b6,_0xe5ca('0xe'));logger['debug']('VtigerConfiguration,\x20%s,\x20%s,\x20%s',_0x3e07b6,'request\x20sent',JSON[_0xe5ca('0xf')](_0x41e895));if(_0x41e895[_0xe5ca('0x10')]){if(_0x41e895[_0xe5ca('0x10')][_0xe5ca('0x11')]===0x1f4){logger[_0xe5ca('0x10')](_0xe5ca('0xd'),_0x3e07b6,_0x41e895[_0xe5ca('0x10')][_0xe5ca('0x12')]);return _0x1fa246(_0x41e895['error']['message']);}logger[_0xe5ca('0x10')](_0xe5ca('0xd'),_0x3e07b6,_0x41e895[_0xe5ca('0x10')][_0xe5ca('0x12')]);return _0x4baac2(_0x41e895[_0xe5ca('0x10')][_0xe5ca('0x12')]);}else{logger['info'](_0xe5ca('0xd'),_0x3e07b6,_0xe5ca('0xe'));_0x4baac2(_0x41e895[_0xe5ca('0x13')]['message']);}})[_0xe5ca('0x14')](function(_0x1516d2){logger[_0xe5ca('0x10')](_0xe5ca('0xd'),_0x3e07b6,_0x1516d2);_0x1fa246(_0x1516d2);});});} \ No newline at end of file +var _0x8cee=['../../config/environment','client','http','request','then','info','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x78f7b,_0x3cd79a){var _0x5de5a7=function(_0x319b75){while(--_0x319b75){_0x78f7b['push'](_0x78f7b['shift']());}};_0x5de5a7(++_0x3cd79a);}(_0x8cee,0xd8));var _0xe8ce=function(_0x5a1f0c,_0x338240){_0x5a1f0c=_0x5a1f0c-0x0;var _0xf378a6=_0x8cee[_0x5a1f0c];return _0xf378a6;};'use strict';var _=require(_0xe8ce('0x0'));var util=require(_0xe8ce('0x1'));var moment=require(_0xe8ce('0x2'));var BPromise=require(_0xe8ce('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe8ce('0x4'));var db=require(_0xe8ce('0x5'))['db'];var utils=require(_0xe8ce('0x6'));var logger=require(_0xe8ce('0x7'))(_0xe8ce('0x8'));var config=require(_0xe8ce('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xe8ce('0xa')][_0xe8ce('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x557e7b,_0x292678,_0x322764){return new BPromise(function(_0x46417d,_0x4cc697){return client[_0xe8ce('0xc')](_0x557e7b,_0x322764)[_0xe8ce('0xd')](function(_0x1b82d2){logger[_0xe8ce('0xe')](_0xe8ce('0xf'),_0x292678,_0xe8ce('0x10'));logger[_0xe8ce('0x11')](_0xe8ce('0x12'),_0x292678,_0xe8ce('0x10'),JSON[_0xe8ce('0x13')](_0x1b82d2));if(_0x1b82d2['error']){if(_0x1b82d2[_0xe8ce('0x14')][_0xe8ce('0x15')]===0x1f4){logger[_0xe8ce('0x14')](_0xe8ce('0xf'),_0x292678,_0x1b82d2[_0xe8ce('0x14')]['message']);return _0x4cc697(_0x1b82d2['error']['message']);}logger['error']('VtigerConfiguration,\x20%s,\x20%s',_0x292678,_0x1b82d2[_0xe8ce('0x14')][_0xe8ce('0x16')]);return _0x46417d(_0x1b82d2[_0xe8ce('0x14')][_0xe8ce('0x16')]);}else{logger[_0xe8ce('0xe')](_0xe8ce('0xf'),_0x292678,_0xe8ce('0x10'));_0x46417d(_0x1b82d2[_0xe8ce('0x17')][_0xe8ce('0x16')]);}})[_0xe8ce('0x18')](function(_0x2b3297){logger[_0xe8ce('0x14')]('VtigerConfiguration,\x20%s,\x20%s',_0x292678,_0x2b3297);_0x4cc697(_0x2b3297);});});} \ No newline at end of file diff --git a/server/api/intVtigerField/index.js b/server/api/intVtigerField/index.js index e2541c1..c803f2a 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 _0xc804=['isAuthenticated','index','/:id','post','create','update','delete','destroy','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get'];(function(_0x46cf00,_0x457a43){var _0x3974dc=function(_0x4b5d0a){while(--_0x4b5d0a){_0x46cf00['push'](_0x46cf00['shift']());}};_0x3974dc(++_0x457a43);}(_0xc804,0x1d8));var _0x4c80=function(_0x3cb604,_0x253799){_0x3cb604=_0x3cb604-0x0;var _0x2b2062=_0xc804[_0x3cb604];return _0x2b2062;};'use strict';var multer=require('multer');var util=require(_0x4c80('0x0'));var path=require(_0x4c80('0x1'));var timeout=require(_0x4c80('0x2'));var express=require('express');var router=express[_0x4c80('0x3')]();var fs_extra=require(_0x4c80('0x4'));var auth=require(_0x4c80('0x5'));var interaction=require(_0x4c80('0x6'));var config=require('../../config/environment');var controller=require('./intVtigerField.controller');router[_0x4c80('0x7')]('/',auth[_0x4c80('0x8')](),controller[_0x4c80('0x9')]);router[_0x4c80('0x7')](_0x4c80('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x4c80('0xb')]('/',auth[_0x4c80('0x8')](),controller[_0x4c80('0xc')]);router['put'](_0x4c80('0xa'),auth['isAuthenticated'](),controller[_0x4c80('0xd')]);router[_0x4c80('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x4c80('0xf')]);module['exports']=router; \ No newline at end of file +var _0xfd1a=['exports','multer','connect-timeout','express','Router','get','isAuthenticated','index','/:id','show','post','create','update','destroy'];(function(_0x589063,_0x2ba158){var _0x5a7bef=function(_0x469151){while(--_0x469151){_0x589063['push'](_0x589063['shift']());}};_0x5a7bef(++_0x2ba158);}(_0xfd1a,0x15f));var _0xafd1=function(_0x2ada60,_0x556c77){_0x2ada60=_0x2ada60-0x0;var _0x2c4a96=_0xfd1a[_0x2ada60];return _0x2c4a96;};'use strict';var multer=require(_0xafd1('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xafd1('0x1'));var express=require(_0xafd1('0x2'));var router=express[_0xafd1('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('./intVtigerField.controller');router[_0xafd1('0x4')]('/',auth[_0xafd1('0x5')](),controller[_0xafd1('0x6')]);router[_0xafd1('0x4')](_0xafd1('0x7'),auth[_0xafd1('0x5')](),controller[_0xafd1('0x8')]);router[_0xafd1('0x9')]('/',auth[_0xafd1('0x5')](),controller[_0xafd1('0xa')]);router['put'](_0xafd1('0x7'),auth['isAuthenticated'](),controller[_0xafd1('0xb')]);router['delete'](_0xafd1('0x7'),auth[_0xafd1('0x5')](),controller[_0xafd1('0xc')]);module[_0xafd1('0xd')]=router; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.attributes.js b/server/api/intVtigerField/intVtigerField.attributes.js index ef01474..dd7c215 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 _0xa667=['keyValue','STRING','variable','BOOLEAN','sequelize','exports','ENUM','string','customVariable'];(function(_0x1f7413,_0x3388c3){var _0x2d2775=function(_0x5e5b4){while(--_0x5e5b4){_0x1f7413['push'](_0x1f7413['shift']());}};_0x2d2775(++_0x3388c3);}(_0xa667,0x15a));var _0x7a66=function(_0x4178a6,_0x3992a0){_0x4178a6=_0x4178a6-0x0;var _0x505132=_0xa667[_0x4178a6];return _0x505132;};'use strict';var Sequelize=require(_0x7a66('0x0'));module[_0x7a66('0x1')]={'type':{'type':Sequelize[_0x7a66('0x2')](_0x7a66('0x3'),'variable',_0x7a66('0x4'),_0x7a66('0x5'),'picklist'),'defaultValue':_0x7a66('0x3')},'content':{'type':Sequelize[_0x7a66('0x6')]},'key':{'type':Sequelize[_0x7a66('0x6')]},'keyType':{'type':Sequelize[_0x7a66('0x2')](_0x7a66('0x3'),_0x7a66('0x7'),_0x7a66('0x4'))},'keyContent':{'type':Sequelize[_0x7a66('0x6')]},'idField':{'type':Sequelize[_0x7a66('0x6')]},'nameField':{'type':Sequelize[_0x7a66('0x6')]},'customField':{'type':Sequelize[_0x7a66('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xfade=['picklist','string','STRING','variable','BOOLEAN','sequelize','exports','ENUM','customVariable','keyValue'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0xfade,0x1b3));var _0xefad=function(_0x1d866d,_0x1dcb0a){_0x1d866d=_0x1d866d-0x0;var _0x155b1c=_0xfade[_0x1d866d];return _0x155b1c;};'use strict';var Sequelize=require(_0xefad('0x0'));module[_0xefad('0x1')]={'type':{'type':Sequelize[_0xefad('0x2')]('string','variable',_0xefad('0x3'),_0xefad('0x4'),_0xefad('0x5')),'defaultValue':_0xefad('0x6')},'content':{'type':Sequelize[_0xefad('0x7')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM'](_0xefad('0x6'),_0xefad('0x8'),_0xefad('0x3'))},'keyContent':{'type':Sequelize[_0xefad('0x7')]},'idField':{'type':Sequelize[_0xefad('0x7')]},'nameField':{'type':Sequelize[_0xefad('0x7')]},'customField':{'type':Sequelize[_0xefad('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xefad('0x7')]}}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.controller.js b/server/api/intVtigerField/intVtigerField.controller.js index c740321..e1af3a5 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 _0x2d6f=['desk.js','querystring','papaparse','ioredis','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','set','Content-Range','apply','reject','then','sendStatus','error','stack','name','send','index','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','limit','order','where','filter','VIRTUAL','merge','options','count','includeAll','include','VtigerField','catch','show','params','find','create','body','update','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','fs-extra','lodash','squel','crypto'];(function(_0x178e48,_0x3c9509){var _0x440d7e=function(_0xc2f8a0){while(--_0xc2f8a0){_0x178e48['push'](_0x178e48['shift']());}};_0x440d7e(++_0x3c9509);}(_0x2d6f,0x19c));var _0xf2d6=function(_0x1c469b,_0x1f9b7a){_0x1c469b=_0x1c469b-0x0;var _0x547834=_0x2d6f[_0x1c469b];return _0x547834;};'use strict';var emlformat=require(_0xf2d6('0x0'));var rimraf=require(_0xf2d6('0x1'));var zipdir=require(_0xf2d6('0x2'));var jsonpatch=require(_0xf2d6('0x3'));var rp=require(_0xf2d6('0x4'));var moment=require(_0xf2d6('0x5'));var BPromise=require(_0xf2d6('0x6'));var Mustache=require(_0xf2d6('0x7'));var util=require('util');var path=require(_0xf2d6('0x8'));var sox=require(_0xf2d6('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf2d6('0xa'));var _=require(_0xf2d6('0xb'));var squel=require(_0xf2d6('0xc'));var crypto=require(_0xf2d6('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xf2d6('0xe'));var toCsv=require('to-csv');var querystring=require(_0xf2d6('0xf'));var Papa=require(_0xf2d6('0x10'));var Redis=require(_0xf2d6('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf2d6('0x12'));var logger=require(_0xf2d6('0x13'))(_0xf2d6('0x14'));var utils=require('../../config/utils');var config=require(_0xf2d6('0x15'));var licenseUtil=require(_0xf2d6('0x16'));var db=require(_0xf2d6('0x17'))['db'];function respondWithStatusCode(_0x2a76c7,_0x4c69d8){_0x4c69d8=_0x4c69d8||0xcc;return function(_0x87206c){if(_0x87206c){return _0x2a76c7['sendStatus'](_0x4c69d8);}return _0x2a76c7[_0xf2d6('0x18')](_0x4c69d8)['end']();};}function respondWithResult(_0x2d6e00,_0x89687a){_0x89687a=_0x89687a||0xc8;return function(_0x5318d1){if(_0x5318d1){return _0x2d6e00['status'](_0x89687a)[_0xf2d6('0x19')](_0x5318d1);}};}function respondWithFilteredResult(_0x1abd24,_0x2779bf){return function(_0x18f0b4){if(_0x18f0b4){var _0x2a3b21=typeof _0x2779bf[_0xf2d6('0x1a')]==='undefined'&&typeof _0x2779bf['limit']===_0xf2d6('0x1b');var _0x165d67=_0x18f0b4['count'];var _0x17e444=_0x2a3b21?0x0:_0x2779bf['offset'];var _0xa68bf3=_0x2a3b21?_0x18f0b4['count']:_0x2779bf['offset']+_0x2779bf['limit'];var _0x545538;if(_0xa68bf3>=_0x165d67){_0xa68bf3=_0x165d67;_0x545538=0xc8;}else{_0x545538=0xce;}_0x1abd24['status'](_0x545538);return _0x1abd24[_0xf2d6('0x1c')](_0xf2d6('0x1d'),_0x17e444+'-'+_0xa68bf3+'/'+_0x165d67)['json'](_0x18f0b4);}return null;};}function patchUpdates(_0x4989ff){return function(_0x18b6d6){try{jsonpatch[_0xf2d6('0x1e')](_0x18b6d6,_0x4989ff,!![]);}catch(_0x38a800){return BPromise[_0xf2d6('0x1f')](_0x38a800);}return _0x18b6d6['save']();};}function saveUpdates(_0x3e566d,_0x12ebb1){return function(_0x128809){if(_0x128809){return _0x128809['update'](_0x3e566d)['then'](function(_0x285b4b){return _0x285b4b;});}return null;};}function removeEntity(_0x1283a5,_0x42711a){return function(_0x2ced22){if(_0x2ced22){return _0x2ced22['destroy']()[_0xf2d6('0x20')](function(){_0x1283a5['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x79d545,_0x51b373){return function(_0x92578b){if(!_0x92578b){_0x79d545[_0xf2d6('0x21')](0x194);}return _0x92578b;};}function handleError(_0x2e1b7a,_0x268823){_0x268823=_0x268823||0x1f4;return function(_0x4a1950){logger[_0xf2d6('0x22')](_0x4a1950[_0xf2d6('0x23')]);if(_0x4a1950[_0xf2d6('0x24')]){delete _0x4a1950['name'];}_0x2e1b7a[_0xf2d6('0x18')](_0x268823)[_0xf2d6('0x25')](_0x4a1950);};}exports[_0xf2d6('0x26')]=function(_0xf89c35,_0x56206d){var _0x20465a={},_0x4cd045={},_0x16e56={'count':0x0,'rows':[]};var _0x62e67c=_['map'](db['VtigerField'][_0xf2d6('0x27')],function(_0xc949ae){return{'name':_0xc949ae[_0xf2d6('0x28')],'type':_0xc949ae[_0xf2d6('0x29')][_0xf2d6('0x2a')]};});_0x4cd045[_0xf2d6('0x2b')]=_[_0xf2d6('0x2c')](_0x62e67c,_0xf2d6('0x24'));_0x4cd045[_0xf2d6('0x2d')]=_[_0xf2d6('0x2e')](_0xf89c35[_0xf2d6('0x2d')]);_0x4cd045[_0xf2d6('0x2f')]=_[_0xf2d6('0x30')](_0x4cd045[_0xf2d6('0x2b')],_0x4cd045[_0xf2d6('0x2d')]);_0x20465a[_0xf2d6('0x31')]=_['intersection'](_0x4cd045['model'],qs[_0xf2d6('0x32')](_0xf89c35[_0xf2d6('0x2d')][_0xf2d6('0x32')]));_0x20465a[_0xf2d6('0x31')]=_0x20465a[_0xf2d6('0x31')]['length']?_0x20465a[_0xf2d6('0x31')]:_0x4cd045[_0xf2d6('0x2b')];if(!_0xf89c35[_0xf2d6('0x2d')][_0xf2d6('0x33')]('nolimit')){_0x20465a[_0xf2d6('0x34')]=qs['limit'](_0xf89c35[_0xf2d6('0x2d')]['limit']);_0x20465a[_0xf2d6('0x1a')]=qs[_0xf2d6('0x1a')](_0xf89c35[_0xf2d6('0x2d')]['offset']);}_0x20465a[_0xf2d6('0x35')]=qs['sort'](_0xf89c35[_0xf2d6('0x2d')]['sort']);_0x20465a[_0xf2d6('0x36')]=qs[_0xf2d6('0x2f')](_['pick'](_0xf89c35[_0xf2d6('0x2d')],_0x4cd045[_0xf2d6('0x2f')]),_0x62e67c);if(_0xf89c35[_0xf2d6('0x2d')][_0xf2d6('0x37')]){_0x20465a[_0xf2d6('0x36')]=_['merge'](_0x20465a[_0xf2d6('0x36')],{'$or':_[_0xf2d6('0x2c')](_0x62e67c,function(_0x397e73){if(_0x397e73[_0xf2d6('0x29')]!==_0xf2d6('0x38')){var _0x51d130={};_0x51d130[_0x397e73['name']]={'$like':'%'+_0xf89c35['query'][_0xf2d6('0x37')]+'%'};return _0x51d130;}})});}_0x20465a=_[_0xf2d6('0x39')]({},_0x20465a,_0xf89c35[_0xf2d6('0x3a')]);var _0x52d1cd={'where':_0x20465a['where']};return db['VtigerField']['count'](_0x52d1cd)[_0xf2d6('0x20')](function(_0x275b3e){_0x16e56[_0xf2d6('0x3b')]=_0x275b3e;if(_0xf89c35[_0xf2d6('0x2d')][_0xf2d6('0x3c')]){_0x20465a[_0xf2d6('0x3d')]=[{'all':!![]}];}return db[_0xf2d6('0x3e')]['findAll'](_0x20465a);})['then'](function(_0x34c32c){_0x16e56['rows']=_0x34c32c;return _0x16e56;})[_0xf2d6('0x20')](respondWithFilteredResult(_0x56206d,_0x20465a))[_0xf2d6('0x3f')](handleError(_0x56206d,null));};exports[_0xf2d6('0x40')]=function(_0x179f34,_0x20aece){var _0x3018f5={'raw':!![],'where':{'id':_0x179f34[_0xf2d6('0x41')]['id']}},_0x4cc011={};_0x4cc011[_0xf2d6('0x2b')]=_[_0xf2d6('0x2e')](db['VtigerField'][_0xf2d6('0x27')]);_0x4cc011[_0xf2d6('0x2d')]=_[_0xf2d6('0x2e')](_0x179f34[_0xf2d6('0x2d')]);_0x4cc011[_0xf2d6('0x2f')]=_['intersection'](_0x4cc011['model'],_0x4cc011[_0xf2d6('0x2d')]);_0x3018f5[_0xf2d6('0x31')]=_[_0xf2d6('0x30')](_0x4cc011[_0xf2d6('0x2b')],qs[_0xf2d6('0x32')](_0x179f34[_0xf2d6('0x2d')][_0xf2d6('0x32')]));_0x3018f5[_0xf2d6('0x31')]=_0x3018f5[_0xf2d6('0x31')]['length']?_0x3018f5[_0xf2d6('0x31')]:_0x4cc011[_0xf2d6('0x2b')];if(_0x179f34[_0xf2d6('0x2d')][_0xf2d6('0x3c')]){_0x3018f5[_0xf2d6('0x3d')]=[{'all':!![]}];}_0x3018f5=_['merge']({},_0x3018f5,_0x179f34[_0xf2d6('0x3a')]);return db[_0xf2d6('0x3e')][_0xf2d6('0x42')](_0x3018f5)['then'](handleEntityNotFound(_0x20aece,null))[_0xf2d6('0x20')](respondWithResult(_0x20aece,null))[_0xf2d6('0x3f')](handleError(_0x20aece,null));};exports[_0xf2d6('0x43')]=function(_0x5a9f06,_0x4354e2){return db['VtigerField']['create'](_0x5a9f06[_0xf2d6('0x44')],{})['then'](respondWithResult(_0x4354e2,0xc9))[_0xf2d6('0x3f')](handleError(_0x4354e2,null));};exports[_0xf2d6('0x45')]=function(_0x59be11,_0x5a3b56){if(_0x59be11['body']['id']){delete _0x59be11[_0xf2d6('0x44')]['id'];}return db[_0xf2d6('0x3e')][_0xf2d6('0x42')]({'where':{'id':_0x59be11['params']['id']}})[_0xf2d6('0x20')](handleEntityNotFound(_0x5a3b56,null))[_0xf2d6('0x20')](saveUpdates(_0x59be11[_0xf2d6('0x44')],null))[_0xf2d6('0x20')](respondWithResult(_0x5a3b56,null))[_0xf2d6('0x3f')](handleError(_0x5a3b56,null));};exports[_0xf2d6('0x46')]=function(_0x45c90b,_0x19c130){return db['VtigerField']['find']({'where':{'id':_0x45c90b[_0xf2d6('0x41')]['id']}})[_0xf2d6('0x20')](handleEntityNotFound(_0x19c130,null))[_0xf2d6('0x20')](removeEntity(_0x19c130,null))[_0xf2d6('0x3f')](handleError(_0x19c130,null));}; \ No newline at end of file +var _0xa675=['stack','name','send','index','map','VtigerField','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','catch','params','options','find','create','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','sox','ejs','lodash','squel','jsforce','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','apply','save','then'];(function(_0x1fa2e7,_0x1bea2a){var _0x1b29e0=function(_0xd6437c){while(--_0xd6437c){_0x1fa2e7['push'](_0x1fa2e7['shift']());}};_0x1b29e0(++_0x1bea2a);}(_0xa675,0x17c));var _0x5a67=function(_0x498e3c,_0x2455c4){_0x498e3c=_0x498e3c-0x0;var _0x1e5f5f=_0xa675[_0x498e3c];return _0x1e5f5f;};'use strict';var emlformat=require(_0x5a67('0x0'));var rimraf=require(_0x5a67('0x1'));var zipdir=require(_0x5a67('0x2'));var jsonpatch=require(_0x5a67('0x3'));var rp=require('request-promise');var moment=require(_0x5a67('0x4'));var BPromise=require(_0x5a67('0x5'));var Mustache=require('mustache');var util=require(_0x5a67('0x6'));var path=require('path');var sox=require(_0x5a67('0x7'));var csv=require('to-csv');var ejs=require(_0x5a67('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5a67('0x9'));var squel=require(_0x5a67('0xa'));var crypto=require('crypto');var jsforce=require(_0x5a67('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x5a67('0xc'));var querystring=require(_0x5a67('0xd'));var Papa=require(_0x5a67('0xe'));var Redis=require('ioredis');var authService=require(_0x5a67('0xf'));var qs=require(_0x5a67('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5a67('0x11'));var logger=require(_0x5a67('0x12'))('api');var utils=require(_0x5a67('0x13'));var config=require(_0x5a67('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x5a67('0x15'))['db'];function respondWithStatusCode(_0x2e3def,_0xada495){_0xada495=_0xada495||0xcc;return function(_0x1b39cc){if(_0x1b39cc){return _0x2e3def[_0x5a67('0x16')](_0xada495);}return _0x2e3def[_0x5a67('0x17')](_0xada495)[_0x5a67('0x18')]();};}function respondWithResult(_0x1ea356,_0x29fa87){_0x29fa87=_0x29fa87||0xc8;return function(_0x4450cb){if(_0x4450cb){return _0x1ea356[_0x5a67('0x17')](_0x29fa87)[_0x5a67('0x19')](_0x4450cb);}};}function respondWithFilteredResult(_0x638ab7,_0x3b77f8){return function(_0x10f847){if(_0x10f847){var _0x57f1a6=typeof _0x3b77f8[_0x5a67('0x1a')]===_0x5a67('0x1b')&&typeof _0x3b77f8['limit']===_0x5a67('0x1b');var _0x106c9a=_0x10f847[_0x5a67('0x1c')];var _0x2bd001=_0x57f1a6?0x0:_0x3b77f8['offset'];var _0x52c00a=_0x57f1a6?_0x10f847[_0x5a67('0x1c')]:_0x3b77f8[_0x5a67('0x1a')]+_0x3b77f8[_0x5a67('0x1d')];var _0x4339b8;if(_0x52c00a>=_0x106c9a){_0x52c00a=_0x106c9a;_0x4339b8=0xc8;}else{_0x4339b8=0xce;}_0x638ab7[_0x5a67('0x17')](_0x4339b8);return _0x638ab7[_0x5a67('0x1e')]('Content-Range',_0x2bd001+'-'+_0x52c00a+'/'+_0x106c9a)[_0x5a67('0x19')](_0x10f847);}return null;};}function patchUpdates(_0x31ffb3){return function(_0x47caa2){try{jsonpatch[_0x5a67('0x1f')](_0x47caa2,_0x31ffb3,!![]);}catch(_0x40cb73){return BPromise['reject'](_0x40cb73);}return _0x47caa2[_0x5a67('0x20')]();};}function saveUpdates(_0x2f86d9,_0x3ca8e0){return function(_0x268ecd){if(_0x268ecd){return _0x268ecd['update'](_0x2f86d9)[_0x5a67('0x21')](function(_0x1d8dd5){return _0x1d8dd5;});}return null;};}function removeEntity(_0x3aa994,_0x223a46){return function(_0x2f54e5){if(_0x2f54e5){return _0x2f54e5['destroy']()[_0x5a67('0x21')](function(){_0x3aa994[_0x5a67('0x17')](0xcc)[_0x5a67('0x18')]();});}};}function handleEntityNotFound(_0x258db8,_0x2f592a){return function(_0x3864bc){if(!_0x3864bc){_0x258db8[_0x5a67('0x16')](0x194);}return _0x3864bc;};}function handleError(_0x52f180,_0x37a1db){_0x37a1db=_0x37a1db||0x1f4;return function(_0x301909){logger['error'](_0x301909[_0x5a67('0x22')]);if(_0x301909[_0x5a67('0x23')]){delete _0x301909[_0x5a67('0x23')];}_0x52f180[_0x5a67('0x17')](_0x37a1db)[_0x5a67('0x24')](_0x301909);};}exports[_0x5a67('0x25')]=function(_0x3daff6,_0x474b85){var _0x5d782c={},_0xd21802={},_0x1d3dbb={'count':0x0,'rows':[]};var _0x3b1fad=_[_0x5a67('0x26')](db[_0x5a67('0x27')][_0x5a67('0x28')],function(_0x6287d7){return{'name':_0x6287d7[_0x5a67('0x29')],'type':_0x6287d7[_0x5a67('0x2a')][_0x5a67('0x2b')]};});_0xd21802['model']=_[_0x5a67('0x26')](_0x3b1fad,_0x5a67('0x23'));_0xd21802[_0x5a67('0x2c')]=_[_0x5a67('0x2d')](_0x3daff6[_0x5a67('0x2c')]);_0xd21802[_0x5a67('0x2e')]=_[_0x5a67('0x2f')](_0xd21802['model'],_0xd21802['query']);_0x5d782c['attributes']=_[_0x5a67('0x2f')](_0xd21802[_0x5a67('0x30')],qs['fields'](_0x3daff6[_0x5a67('0x2c')][_0x5a67('0x31')]));_0x5d782c[_0x5a67('0x32')]=_0x5d782c[_0x5a67('0x32')][_0x5a67('0x33')]?_0x5d782c[_0x5a67('0x32')]:_0xd21802[_0x5a67('0x30')];if(!_0x3daff6[_0x5a67('0x2c')][_0x5a67('0x34')]('nolimit')){_0x5d782c[_0x5a67('0x1d')]=qs[_0x5a67('0x1d')](_0x3daff6[_0x5a67('0x2c')]['limit']);_0x5d782c[_0x5a67('0x1a')]=qs[_0x5a67('0x1a')](_0x3daff6['query']['offset']);}_0x5d782c['order']=qs[_0x5a67('0x35')](_0x3daff6[_0x5a67('0x2c')]['sort']);_0x5d782c[_0x5a67('0x36')]=qs[_0x5a67('0x2e')](_[_0x5a67('0x37')](_0x3daff6[_0x5a67('0x2c')],_0xd21802[_0x5a67('0x2e')]),_0x3b1fad);if(_0x3daff6[_0x5a67('0x2c')][_0x5a67('0x38')]){_0x5d782c[_0x5a67('0x36')]=_[_0x5a67('0x39')](_0x5d782c[_0x5a67('0x36')],{'$or':_[_0x5a67('0x26')](_0x3b1fad,function(_0x30a538){if(_0x30a538[_0x5a67('0x2a')]!==_0x5a67('0x3a')){var _0x3a3331={};_0x3a3331[_0x30a538[_0x5a67('0x23')]]={'$like':'%'+_0x3daff6[_0x5a67('0x2c')]['filter']+'%'};return _0x3a3331;}})});}_0x5d782c=_[_0x5a67('0x39')]({},_0x5d782c,_0x3daff6['options']);var _0x57255c={'where':_0x5d782c[_0x5a67('0x36')]};return db[_0x5a67('0x27')][_0x5a67('0x1c')](_0x57255c)[_0x5a67('0x21')](function(_0x4eb4fc){_0x1d3dbb[_0x5a67('0x1c')]=_0x4eb4fc;if(_0x3daff6[_0x5a67('0x2c')][_0x5a67('0x3b')]){_0x5d782c[_0x5a67('0x3c')]=[{'all':!![]}];}return db['VtigerField'][_0x5a67('0x3d')](_0x5d782c);})[_0x5a67('0x21')](function(_0x3cfe59){_0x1d3dbb['rows']=_0x3cfe59;return _0x1d3dbb;})[_0x5a67('0x21')](respondWithFilteredResult(_0x474b85,_0x5d782c))[_0x5a67('0x3e')](handleError(_0x474b85,null));};exports['show']=function(_0x360f44,_0x1b72dd){var _0x2d58ef={'raw':!![],'where':{'id':_0x360f44[_0x5a67('0x3f')]['id']}},_0x398770={};_0x398770[_0x5a67('0x30')]=_[_0x5a67('0x2d')](db[_0x5a67('0x27')][_0x5a67('0x28')]);_0x398770['query']=_['keys'](_0x360f44[_0x5a67('0x2c')]);_0x398770[_0x5a67('0x2e')]=_[_0x5a67('0x2f')](_0x398770[_0x5a67('0x30')],_0x398770['query']);_0x2d58ef['attributes']=_[_0x5a67('0x2f')](_0x398770[_0x5a67('0x30')],qs[_0x5a67('0x31')](_0x360f44[_0x5a67('0x2c')]['fields']));_0x2d58ef[_0x5a67('0x32')]=_0x2d58ef[_0x5a67('0x32')][_0x5a67('0x33')]?_0x2d58ef[_0x5a67('0x32')]:_0x398770[_0x5a67('0x30')];if(_0x360f44[_0x5a67('0x2c')][_0x5a67('0x3b')]){_0x2d58ef[_0x5a67('0x3c')]=[{'all':!![]}];}_0x2d58ef=_[_0x5a67('0x39')]({},_0x2d58ef,_0x360f44[_0x5a67('0x40')]);return db[_0x5a67('0x27')][_0x5a67('0x41')](_0x2d58ef)[_0x5a67('0x21')](handleEntityNotFound(_0x1b72dd,null))[_0x5a67('0x21')](respondWithResult(_0x1b72dd,null))[_0x5a67('0x3e')](handleError(_0x1b72dd,null));};exports[_0x5a67('0x42')]=function(_0x52732f,_0x25efd9){return db[_0x5a67('0x27')][_0x5a67('0x42')](_0x52732f['body'],{})['then'](respondWithResult(_0x25efd9,0xc9))[_0x5a67('0x3e')](handleError(_0x25efd9,null));};exports['update']=function(_0x5d9d47,_0x3b514e){if(_0x5d9d47[_0x5a67('0x43')]['id']){delete _0x5d9d47[_0x5a67('0x43')]['id'];}return db[_0x5a67('0x27')][_0x5a67('0x41')]({'where':{'id':_0x5d9d47[_0x5a67('0x3f')]['id']}})[_0x5a67('0x21')](handleEntityNotFound(_0x3b514e,null))[_0x5a67('0x21')](saveUpdates(_0x5d9d47[_0x5a67('0x43')],null))[_0x5a67('0x21')](respondWithResult(_0x3b514e,null))[_0x5a67('0x3e')](handleError(_0x3b514e,null));};exports[_0x5a67('0x44')]=function(_0x4cf358,_0x3c2e68){return db[_0x5a67('0x27')][_0x5a67('0x41')]({'where':{'id':_0x4cf358[_0x5a67('0x3f')]['id']}})['then'](handleEntityNotFound(_0x3c2e68,null))[_0x5a67('0x21')](removeEntity(_0x3c2e68,null))['catch'](handleError(_0x3c2e68,null));}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.model.js b/server/api/intVtigerField/intVtigerField.model.js index 83c700f..b8ef219 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 _0x8178=['exports','VtigerField','int_vtiger_fields','vtiger_unique_index','idField','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0x8178,0x17c));var _0x8817=function(_0x14405e,_0x545f06){_0x14405e=_0x14405e-0x0;var _0x57abad=_0x8178[_0x14405e];return _0x57abad;};'use strict';var _=require(_0x8817('0x0'));var util=require(_0x8817('0x1'));var logger=require(_0x8817('0x2'))(_0x8817('0x3'));var moment=require(_0x8817('0x4'));var BPromise=require(_0x8817('0x5'));var rp=require(_0x8817('0x6'));var fs=require('fs');var path=require(_0x8817('0x7'));var rimraf=require(_0x8817('0x8'));var config=require(_0x8817('0x9'));var attributes=require('./intVtigerField.attributes');module[_0x8817('0xa')]=function(_0x47d7dc,_0x1c65a5){return _0x47d7dc['define'](_0x8817('0xb'),attributes,{'tableName':_0x8817('0xc'),'paranoid':![],'indexes':[{'name':_0x8817('0xd'),'fields':[_0x8817('0xe'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xcdd0=['../../config/logger','api','moment','request-promise','path','exports','define','VtigerField','int_vtiger_fields','vtiger_unique_index','FieldId','util'];(function(_0x42033b,_0x1f5fec){var _0x543c19=function(_0x38bd3c){while(--_0x38bd3c){_0x42033b['push'](_0x42033b['shift']());}};_0x543c19(++_0x1f5fec);}(_0xcdd0,0xe3));var _0x0cdd=function(_0x2160a9,_0x3cbd9e){_0x2160a9=_0x2160a9-0x0;var _0xa88cf7=_0xcdd0[_0x2160a9];return _0xa88cf7;};'use strict';var _=require('lodash');var util=require(_0x0cdd('0x0'));var logger=require(_0x0cdd('0x1'))(_0x0cdd('0x2'));var moment=require(_0x0cdd('0x3'));var BPromise=require('bluebird');var rp=require(_0x0cdd('0x4'));var fs=require('fs');var path=require(_0x0cdd('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./intVtigerField.attributes');module[_0x0cdd('0x6')]=function(_0x266a2,_0x49ec91){return _0x266a2[_0x0cdd('0x7')](_0x0cdd('0x8'),attributes,{'tableName':_0x0cdd('0x9'),'paranoid':![],'indexes':[{'name':_0x0cdd('0xa'),'fields':['idField',_0x0cdd('0xb')],'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 3f02bf0..0ba7168 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 _0x9f69=['error','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','VtigerField,\x20%s,\x20%s','debug','request\x20sent'];(function(_0x27d493,_0x61bbef){var _0x44ab0e=function(_0x437b0f){while(--_0x437b0f){_0x27d493['push'](_0x27d493['shift']());}};_0x44ab0e(++_0x61bbef);}(_0x9f69,0x9e));var _0x99f6=function(_0x2deabf,_0x165203){_0x2deabf=_0x2deabf-0x0;var _0x53b5a1=_0x9f69[_0x2deabf];return _0x53b5a1;};'use strict';var _=require(_0x99f6('0x0'));var util=require('util');var moment=require(_0x99f6('0x1'));var BPromise=require(_0x99f6('0x2'));var rs=require(_0x99f6('0x3'));var fs=require('fs');var Redis=require(_0x99f6('0x4'));var db=require(_0x99f6('0x5'))['db'];var utils=require(_0x99f6('0x6'));var logger=require(_0x99f6('0x7'))('rpc');var config=require(_0x99f6('0x8'));var jayson=require(_0x99f6('0x9'));var client=jayson[_0x99f6('0xa')][_0x99f6('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4a0fe2,_0x4ab780,_0x3c37d2){return new BPromise(function(_0xa9f9e1,_0x1f33c5){return client[_0x99f6('0xc')](_0x4a0fe2,_0x3c37d2)[_0x99f6('0xd')](function(_0x135943){logger[_0x99f6('0xe')](_0x99f6('0xf'),_0x4ab780,'request\x20sent');logger[_0x99f6('0x10')]('VtigerField,\x20%s,\x20%s,\x20%s',_0x4ab780,_0x99f6('0x11'),JSON['stringify'](_0x135943));if(_0x135943['error']){if(_0x135943[_0x99f6('0x12')]['code']===0x1f4){logger[_0x99f6('0x12')](_0x99f6('0xf'),_0x4ab780,_0x135943['error']['message']);return _0x1f33c5(_0x135943[_0x99f6('0x12')][_0x99f6('0x13')]);}logger[_0x99f6('0x12')]('VtigerField,\x20%s,\x20%s',_0x4ab780,_0x135943[_0x99f6('0x12')][_0x99f6('0x13')]);return _0xa9f9e1(_0x135943['error']['message']);}else{logger[_0x99f6('0xe')](_0x99f6('0xf'),_0x4ab780,_0x99f6('0x11'));_0xa9f9e1(_0x135943[_0x99f6('0x14')][_0x99f6('0x13')]);}})[_0x99f6('0x15')](function(_0x4cae3a){logger['error'](_0x99f6('0xf'),_0x4ab780,_0x4cae3a);_0x1f33c5(_0x4cae3a);});});} \ No newline at end of file +var _0x765f=['client','request','then','info','VtigerField,\x20%s,\x20%s','request\x20sent','debug','VtigerField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise'];(function(_0x14477e,_0x44d4da){var _0x5d4a05=function(_0x5e0fa3){while(--_0x5e0fa3){_0x14477e['push'](_0x14477e['shift']());}};_0x5d4a05(++_0x44d4da);}(_0x765f,0x1b1));var _0xf765=function(_0x42d489,_0x42a731){_0x42d489=_0x42d489-0x0;var _0x336d81=_0x765f[_0x42d489];return _0x336d81;};'use strict';var _=require('lodash');var util=require(_0xf765('0x0'));var moment=require(_0xf765('0x1'));var BPromise=require('bluebird');var rs=require(_0xf765('0x2'));var fs=require('fs');var Redis=require(_0xf765('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xf765('0x4'));var logger=require(_0xf765('0x5'))('rpc');var config=require(_0xf765('0x6'));var jayson=require(_0xf765('0x7'));var client=jayson[_0xf765('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1aead7,_0xf326cc,_0x3488be){return new BPromise(function(_0x3cfc23,_0x40f04a){return client[_0xf765('0x9')](_0x1aead7,_0x3488be)[_0xf765('0xa')](function(_0x304155){logger[_0xf765('0xb')](_0xf765('0xc'),_0xf326cc,_0xf765('0xd'));logger[_0xf765('0xe')](_0xf765('0xf'),_0xf326cc,_0xf765('0xd'),JSON[_0xf765('0x10')](_0x304155));if(_0x304155['error']){if(_0x304155[_0xf765('0x11')][_0xf765('0x12')]===0x1f4){logger['error']('VtigerField,\x20%s,\x20%s',_0xf326cc,_0x304155[_0xf765('0x11')][_0xf765('0x13')]);return _0x40f04a(_0x304155[_0xf765('0x11')]['message']);}logger[_0xf765('0x11')]('VtigerField,\x20%s,\x20%s',_0xf326cc,_0x304155[_0xf765('0x11')]['message']);return _0x3cfc23(_0x304155[_0xf765('0x11')][_0xf765('0x13')]);}else{logger[_0xf765('0xb')](_0xf765('0xc'),_0xf326cc,'request\x20sent');_0x3cfc23(_0x304155[_0xf765('0x14')][_0xf765('0x13')]);}})['catch'](function(_0x326f38){logger[_0xf765('0x11')](_0xf765('0xc'),_0xf326cc,_0x326f38);_0x40f04a(_0x326f38);});});} \ No newline at end of file diff --git a/server/api/intZendeskAccount/index.js b/server/api/intZendeskAccount/index.js index 8f29eaf..a545b53 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 _0x461a=['../../components/auth/service','../../config/environment','./intZendeskAccount.controller','isAuthenticated','index','get','/:id','getConfigurations','getFields','post','create','/:id/configurations','addConfiguration','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x29cd7b,_0x2e06ed){var _0x2a6af5=function(_0xedfa08){while(--_0xedfa08){_0x29cd7b['push'](_0x29cd7b['shift']());}};_0x2a6af5(++_0x2e06ed);}(_0x461a,0x192));var _0xa461=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x461a[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0xa461('0x0'));var path=require(_0xa461('0x1'));var timeout=require(_0xa461('0x2'));var express=require(_0xa461('0x3'));var router=express[_0xa461('0x4')]();var fs_extra=require(_0xa461('0x5'));var auth=require(_0xa461('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xa461('0x7'));var controller=require(_0xa461('0x8'));router['get']('/',auth[_0xa461('0x9')](),controller[_0xa461('0xa')]);router[_0xa461('0xb')](_0xa461('0xc'),auth['isAuthenticated'](),controller['show']);router[_0xa461('0xb')]('/:id/configurations',auth[_0xa461('0x9')](),controller[_0xa461('0xd')]);router[_0xa461('0xb')]('/:id/fields',auth[_0xa461('0x9')](),controller[_0xa461('0xe')]);router[_0xa461('0xf')]('/',auth[_0xa461('0x9')](),controller[_0xa461('0x10')]);router[_0xa461('0xf')](_0xa461('0x11'),auth[_0xa461('0x9')](),controller[_0xa461('0x12')]);router[_0xa461('0x13')](_0xa461('0xc'),auth[_0xa461('0x9')](),controller[_0xa461('0x14')]);router[_0xa461('0x15')](_0xa461('0xc'),auth[_0xa461('0x9')](),controller[_0xa461('0x16')]);module[_0xa461('0x17')]=router; \ No newline at end of file +var _0x7531=['../../components/interaction/service','get','isAuthenticated','index','/:id','/:id/configurations','getConfigurations','/:id/fields','getFields','post','addConfiguration','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x4391a5,_0x2e0533){var _0x193f2a=function(_0x4b8fac){while(--_0x4b8fac){_0x4391a5['push'](_0x4391a5['shift']());}};_0x193f2a(++_0x2e0533);}(_0x7531,0xd6));var _0x1753=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x7531[_0x2dafbe];return _0x58a45a;};'use strict';var multer=require(_0x1753('0x0'));var util=require('util');var path=require(_0x1753('0x1'));var timeout=require(_0x1753('0x2'));var express=require(_0x1753('0x3'));var router=express[_0x1753('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x1753('0x5'));var interaction=require(_0x1753('0x6'));var config=require('../../config/environment');var controller=require('./intZendeskAccount.controller');router[_0x1753('0x7')]('/',auth[_0x1753('0x8')](),controller[_0x1753('0x9')]);router[_0x1753('0x7')](_0x1753('0xa'),auth[_0x1753('0x8')](),controller['show']);router['get'](_0x1753('0xb'),auth[_0x1753('0x8')](),controller[_0x1753('0xc')]);router[_0x1753('0x7')](_0x1753('0xd'),auth['isAuthenticated'](),controller[_0x1753('0xe')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x1753('0xf')](_0x1753('0xb'),auth[_0x1753('0x8')](),controller[_0x1753('0x10')]);router[_0x1753('0x11')]('/:id',auth[_0x1753('0x8')](),controller[_0x1753('0x12')]);router[_0x1753('0x13')](_0x1753('0xa'),auth[_0x1753('0x8')](),controller[_0x1753('0x14')]);module[_0x1753('0x15')]=router; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.attributes.js b/server/api/intZendeskAccount/intZendeskAccount.attributes.js index fc7c25b..20dabc0 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 _0x3588=['password','integrationTab','sequelize','exports','STRING','username','remoteUri','ENUM'];(function(_0x334d1e,_0x28a488){var _0x3b33ba=function(_0x25afca){while(--_0x25afca){_0x334d1e['push'](_0x334d1e['shift']());}};_0x3b33ba(++_0x28a488);}(_0x3588,0x82));var _0x8358=function(_0x3ff332,_0x145564){_0x3ff332=_0x3ff332-0x0;var _0x5a2264=_0x3588[_0x3ff332];return _0x5a2264;};'use strict';var Sequelize=require(_0x8358('0x0'));module[_0x8358('0x1')]={'name':{'type':Sequelize[_0x8358('0x2')]},'description':{'type':Sequelize[_0x8358('0x2')]},'username':{'type':Sequelize[_0x8358('0x2')],'unique':_0x8358('0x3')},'password':{'type':Sequelize[_0x8358('0x2')]},'token':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x8358('0x2')],'unique':_0x8358('0x4')},'authType':{'type':Sequelize[_0x8358('0x5')](_0x8358('0x6'),'token'),'defaultValue':_0x8358('0x6')},'serverUrl':{'type':Sequelize[_0x8358('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x8358('0x7'),'newTab'),'defaultValue':_0x8358('0x7')}}; \ No newline at end of file +var _0x7f94=['integrationTab','newTab','sequelize','STRING','username','remoteUri','ENUM','password','token'];(function(_0x1ccdf7,_0x215d5a){var _0x52a0ae=function(_0x40324a){while(--_0x40324a){_0x1ccdf7['push'](_0x1ccdf7['shift']());}};_0x52a0ae(++_0x215d5a);}(_0x7f94,0x65));var _0x47f9=function(_0x30e578,_0x2967ca){_0x30e578=_0x30e578-0x0;var _0x4f5d50=_0x7f94[_0x30e578];return _0x4f5d50;};'use strict';var Sequelize=require(_0x47f9('0x0'));module['exports']={'name':{'type':Sequelize[_0x47f9('0x1')]},'description':{'type':Sequelize[_0x47f9('0x1')]},'username':{'type':Sequelize[_0x47f9('0x1')],'unique':_0x47f9('0x2')},'password':{'type':Sequelize['STRING']},'token':{'type':Sequelize[_0x47f9('0x1')]},'remoteUri':{'type':Sequelize[_0x47f9('0x1')],'unique':_0x47f9('0x3')},'authType':{'type':Sequelize[_0x47f9('0x4')](_0x47f9('0x5'),_0x47f9('0x6')),'defaultValue':_0x47f9('0x5')},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x47f9('0x4')](_0x47f9('0x7'),_0x47f9('0x8')),'defaultValue':_0x47f9('0x7')}}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.controller.js b/server/api/intZendeskAccount/intZendeskAccount.controller.js index e912069..bf83b46 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 _0x3f8c=['%s/%s','headers','Basic\x20%s','%s:%s','toString','base64','token','%s/token:%s','Sequelize','ValidationError','Unknown\x20authentication\x20type','subject','description','remove','ticket_fields','includes','position','system_field_options','custom_field_options','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','zip-dir','fast-json-patch','request-promise','moment','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','undefined','count','offset','set','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','map','ZendeskAccount','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filter','VIRTUAL','merge','options','includeAll','include','rows','catch','show','params','find','create','body','getConfigurations','findOne','ZendeskConfiguration','pick','addConfiguration','AccountId','Subjects','getSubjects','channel','getDescriptions','ZendeskField','Descriptions','getFields','username','password','authType','remoteUri','substring','lastIndexOf','format'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3f8c,0x104));var _0xc3f8=function(_0x23e30b,_0x5349fa){_0x23e30b=_0x23e30b-0x0;var _0x3f3cda=_0x3f8c[_0x23e30b];return _0x3f3cda;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xc3f8('0x0'));var jsonpatch=require(_0xc3f8('0x1'));var rp=require(_0xc3f8('0x2'));var moment=require(_0xc3f8('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xc3f8('0x4'));var ejs=require(_0xc3f8('0x5'));var fs=require('fs');var fs_extra=require(_0xc3f8('0x6'));var _=require(_0xc3f8('0x7'));var squel=require(_0xc3f8('0x8'));var crypto=require(_0xc3f8('0x9'));var jsforce=require('jsforce');var deskjs=require(_0xc3f8('0xa'));var toCsv=require(_0xc3f8('0x4'));var querystring=require(_0xc3f8('0xb'));var Papa=require(_0xc3f8('0xc'));var Redis=require(_0xc3f8('0xd'));var authService=require(_0xc3f8('0xe'));var qs=require(_0xc3f8('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc3f8('0x10'));var logger=require(_0xc3f8('0x11'))(_0xc3f8('0x12'));var utils=require(_0xc3f8('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xc3f8('0x14'));var db=require(_0xc3f8('0x15'))['db'];var integrations=require(_0xc3f8('0x16'));function respondWithStatusCode(_0x155c80,_0x511763){_0x511763=_0x511763||0xcc;return function(_0x84f489){if(_0x84f489){return _0x155c80[_0xc3f8('0x17')](_0x511763);}return _0x155c80[_0xc3f8('0x18')](_0x511763)[_0xc3f8('0x19')]();};}function respondWithResult(_0x6155e9,_0x47754c){_0x47754c=_0x47754c||0xc8;return function(_0x29e2b6){if(_0x29e2b6){return _0x6155e9[_0xc3f8('0x18')](_0x47754c)[_0xc3f8('0x1a')](_0x29e2b6);}};}function respondWithFilteredResult(_0x2fd8e8,_0x3cb28a){return function(_0x2a9f64){if(_0x2a9f64){var _0x29d031=typeof _0x3cb28a['offset']===_0xc3f8('0x1b')&&typeof _0x3cb28a['limit']==='undefined';var _0x3df137=_0x2a9f64[_0xc3f8('0x1c')];var _0x35500f=_0x29d031?0x0:_0x3cb28a[_0xc3f8('0x1d')];var _0x47a185=_0x29d031?_0x2a9f64[_0xc3f8('0x1c')]:_0x3cb28a[_0xc3f8('0x1d')]+_0x3cb28a['limit'];var _0xe14074;if(_0x47a185>=_0x3df137){_0x47a185=_0x3df137;_0xe14074=0xc8;}else{_0xe14074=0xce;}_0x2fd8e8['status'](_0xe14074);return _0x2fd8e8[_0xc3f8('0x1e')](_0xc3f8('0x1f'),_0x35500f+'-'+_0x47a185+'/'+_0x3df137)[_0xc3f8('0x1a')](_0x2a9f64);}return null;};}function patchUpdates(_0x53ada5){return function(_0x543dca){try{jsonpatch[_0xc3f8('0x20')](_0x543dca,_0x53ada5,!![]);}catch(_0x2a7096){return BPromise[_0xc3f8('0x21')](_0x2a7096);}return _0x543dca[_0xc3f8('0x22')]();};}function saveUpdates(_0x6522e9,_0x251bf7){return function(_0x43b2b4){if(_0x43b2b4){return _0x43b2b4[_0xc3f8('0x23')](_0x6522e9)['then'](function(_0x571f92){return _0x571f92;});}return null;};}function removeEntity(_0x4b83f0,_0x2559a4){return function(_0x5e1d14){if(_0x5e1d14){return _0x5e1d14[_0xc3f8('0x24')]()[_0xc3f8('0x25')](function(){_0x4b83f0['status'](0xcc)[_0xc3f8('0x19')]();});}};}function handleEntityNotFound(_0x327b2d,_0x2d237e){return function(_0xb883b5){if(!_0xb883b5){_0x327b2d[_0xc3f8('0x17')](0x194);}return _0xb883b5;};}function handleError(_0x9d43b4,_0xf1d460){_0xf1d460=_0xf1d460||0x1f4;return function(_0x7f14ad){logger[_0xc3f8('0x26')](_0x7f14ad[_0xc3f8('0x27')]);if(_0x7f14ad[_0xc3f8('0x28')]){delete _0x7f14ad[_0xc3f8('0x28')];}_0x9d43b4[_0xc3f8('0x18')](_0xf1d460)[_0xc3f8('0x29')](_0x7f14ad);};}exports['index']=function(_0x58b303,_0x2909f8){var _0x218029={},_0x5bf6e2={},_0x151bba={'count':0x0,'rows':[]};var _0x4d39a0=_[_0xc3f8('0x2a')](db[_0xc3f8('0x2b')]['rawAttributes'],function(_0x48b32e){return{'name':_0x48b32e[_0xc3f8('0x2c')],'type':_0x48b32e[_0xc3f8('0x2d')][_0xc3f8('0x2e')]};});_0x5bf6e2[_0xc3f8('0x2f')]=_[_0xc3f8('0x2a')](_0x4d39a0,_0xc3f8('0x28'));_0x5bf6e2[_0xc3f8('0x30')]=_[_0xc3f8('0x31')](_0x58b303[_0xc3f8('0x30')]);_0x5bf6e2[_0xc3f8('0x32')]=_['intersection'](_0x5bf6e2[_0xc3f8('0x2f')],_0x5bf6e2[_0xc3f8('0x30')]);_0x218029[_0xc3f8('0x33')]=_[_0xc3f8('0x34')](_0x5bf6e2[_0xc3f8('0x2f')],qs['fields'](_0x58b303['query'][_0xc3f8('0x35')]));_0x218029[_0xc3f8('0x33')]=_0x218029[_0xc3f8('0x33')][_0xc3f8('0x36')]?_0x218029[_0xc3f8('0x33')]:_0x5bf6e2['model'];if(!_0x58b303[_0xc3f8('0x30')][_0xc3f8('0x37')](_0xc3f8('0x38'))){_0x218029['limit']=qs[_0xc3f8('0x39')](_0x58b303[_0xc3f8('0x30')][_0xc3f8('0x39')]);_0x218029['offset']=qs[_0xc3f8('0x1d')](_0x58b303[_0xc3f8('0x30')]['offset']);}_0x218029[_0xc3f8('0x3a')]=qs[_0xc3f8('0x3b')](_0x58b303[_0xc3f8('0x30')][_0xc3f8('0x3b')]);_0x218029[_0xc3f8('0x3c')]=qs[_0xc3f8('0x32')](_['pick'](_0x58b303[_0xc3f8('0x30')],_0x5bf6e2[_0xc3f8('0x32')]),_0x4d39a0);if(_0x58b303[_0xc3f8('0x30')][_0xc3f8('0x3d')]){_0x218029[_0xc3f8('0x3c')]=_['merge'](_0x218029[_0xc3f8('0x3c')],{'$or':_[_0xc3f8('0x2a')](_0x4d39a0,function(_0xaa4c98){if(_0xaa4c98['type']!==_0xc3f8('0x3e')){var _0x83b7ab={};_0x83b7ab[_0xaa4c98[_0xc3f8('0x28')]]={'$like':'%'+_0x58b303[_0xc3f8('0x30')]['filter']+'%'};return _0x83b7ab;}})});}_0x218029=_[_0xc3f8('0x3f')]({},_0x218029,_0x58b303[_0xc3f8('0x40')]);var _0x2df096={'where':_0x218029[_0xc3f8('0x3c')]};return db['ZendeskAccount'][_0xc3f8('0x1c')](_0x2df096)['then'](function(_0x5d144b){_0x151bba[_0xc3f8('0x1c')]=_0x5d144b;if(_0x58b303[_0xc3f8('0x30')][_0xc3f8('0x41')]){_0x218029[_0xc3f8('0x42')]=[{'all':!![]}];}return db['ZendeskAccount']['findAll'](_0x218029);})[_0xc3f8('0x25')](function(_0x16805c){_0x151bba[_0xc3f8('0x43')]=_0x16805c;return _0x151bba;})[_0xc3f8('0x25')](respondWithFilteredResult(_0x2909f8,_0x218029))[_0xc3f8('0x44')](handleError(_0x2909f8,null));};exports[_0xc3f8('0x45')]=function(_0x3113b4,_0x45e6ea){var _0x13d8dc={'raw':![],'where':{'id':_0x3113b4[_0xc3f8('0x46')]['id']}},_0x34bccd={};_0x34bccd['model']=_[_0xc3f8('0x31')](db[_0xc3f8('0x2b')]['rawAttributes']);_0x34bccd[_0xc3f8('0x30')]=_[_0xc3f8('0x31')](_0x3113b4['query']);_0x34bccd[_0xc3f8('0x32')]=_[_0xc3f8('0x34')](_0x34bccd[_0xc3f8('0x2f')],_0x34bccd[_0xc3f8('0x30')]);_0x13d8dc[_0xc3f8('0x33')]=_[_0xc3f8('0x34')](_0x34bccd[_0xc3f8('0x2f')],qs[_0xc3f8('0x35')](_0x3113b4[_0xc3f8('0x30')][_0xc3f8('0x35')]));_0x13d8dc[_0xc3f8('0x33')]=_0x13d8dc['attributes'][_0xc3f8('0x36')]?_0x13d8dc[_0xc3f8('0x33')]:_0x34bccd['model'];if(_0x3113b4[_0xc3f8('0x30')][_0xc3f8('0x41')]){_0x13d8dc[_0xc3f8('0x42')]=[{'all':!![]}];}_0x13d8dc=_[_0xc3f8('0x3f')]({},_0x13d8dc,_0x3113b4['options']);return db['ZendeskAccount'][_0xc3f8('0x47')](_0x13d8dc)[_0xc3f8('0x25')](handleEntityNotFound(_0x45e6ea,null))[_0xc3f8('0x25')](respondWithResult(_0x45e6ea,null))['catch'](handleError(_0x45e6ea,null));};exports[_0xc3f8('0x48')]=function(_0x3a665e,_0x418961){return db[_0xc3f8('0x2b')][_0xc3f8('0x48')](_0x3a665e['body'],{})[_0xc3f8('0x25')](respondWithResult(_0x418961,0xc9))[_0xc3f8('0x44')](handleError(_0x418961,null));};exports['update']=function(_0x1becae,_0x3fcb6a){if(_0x1becae[_0xc3f8('0x49')]['id']){delete _0x1becae[_0xc3f8('0x49')]['id'];}return db[_0xc3f8('0x2b')][_0xc3f8('0x47')]({'where':{'id':_0x1becae[_0xc3f8('0x46')]['id']}})['then'](handleEntityNotFound(_0x3fcb6a,null))[_0xc3f8('0x25')](saveUpdates(_0x1becae[_0xc3f8('0x49')],null))['then'](respondWithResult(_0x3fcb6a,null))[_0xc3f8('0x44')](handleError(_0x3fcb6a,null));};exports[_0xc3f8('0x24')]=function(_0x2448bf,_0x33e5c5){return db[_0xc3f8('0x2b')][_0xc3f8('0x47')]({'where':{'id':_0x2448bf[_0xc3f8('0x46')]['id']}})['then'](handleEntityNotFound(_0x33e5c5,null))[_0xc3f8('0x25')](removeEntity(_0x33e5c5,null))[_0xc3f8('0x44')](handleError(_0x33e5c5,null));};exports[_0xc3f8('0x4a')]=function(_0x267c95,_0x3e6c1d,_0x3d752a){var _0x97a88e={};var _0x920f4b={};var _0x4fc02c;var _0x51249a;return db[_0xc3f8('0x2b')][_0xc3f8('0x4b')]({'where':{'id':_0x267c95['params']['id']}})['then'](handleEntityNotFound(_0x3e6c1d,null))[_0xc3f8('0x25')](function(_0x4b4adb){if(_0x4b4adb){_0x4fc02c=_0x4b4adb;_0x920f4b[_0xc3f8('0x2f')]=_[_0xc3f8('0x31')](db[_0xc3f8('0x4c')]['rawAttributes']);_0x920f4b[_0xc3f8('0x30')]=_['keys'](_0x267c95['query']);_0x920f4b[_0xc3f8('0x32')]=_['intersection'](_0x920f4b[_0xc3f8('0x2f')],_0x920f4b[_0xc3f8('0x30')]);_0x97a88e[_0xc3f8('0x33')]=_['intersection'](_0x920f4b[_0xc3f8('0x2f')],qs[_0xc3f8('0x35')](_0x267c95[_0xc3f8('0x30')][_0xc3f8('0x35')]));_0x97a88e[_0xc3f8('0x33')]=_0x97a88e['attributes']['length']?_0x97a88e[_0xc3f8('0x33')]:_0x920f4b[_0xc3f8('0x2f')];_0x97a88e[_0xc3f8('0x3a')]=qs[_0xc3f8('0x3b')](_0x267c95[_0xc3f8('0x30')]['sort']);_0x97a88e[_0xc3f8('0x3c')]=qs['filters'](_[_0xc3f8('0x4d')](_0x267c95[_0xc3f8('0x30')],_0x920f4b[_0xc3f8('0x32')]));if(_0x267c95[_0xc3f8('0x30')]['filter']){_0x97a88e[_0xc3f8('0x3c')]=_['merge'](_0x97a88e['where'],{'$or':_['map'](_0x97a88e['attributes'],function(_0x12df02){var _0x143d50={};_0x143d50[_0x12df02]={'$like':'%'+_0x267c95[_0xc3f8('0x30')][_0xc3f8('0x3d')]+'%'};return _0x143d50;})});}_0x97a88e=_[_0xc3f8('0x3f')]({},_0x97a88e,_0x267c95[_0xc3f8('0x40')]);return _0x4fc02c[_0xc3f8('0x4a')](_0x97a88e);}})[_0xc3f8('0x25')](function(_0x5250df){if(_0x5250df){_0x51249a=_0x5250df[_0xc3f8('0x36')];if(!_0x267c95[_0xc3f8('0x30')][_0xc3f8('0x37')](_0xc3f8('0x38'))){_0x97a88e[_0xc3f8('0x39')]=qs['limit'](_0x267c95[_0xc3f8('0x30')][_0xc3f8('0x39')]);_0x97a88e[_0xc3f8('0x1d')]=qs[_0xc3f8('0x1d')](_0x267c95[_0xc3f8('0x30')]['offset']);}return _0x4fc02c[_0xc3f8('0x4a')](_0x97a88e);}})[_0xc3f8('0x25')](function(_0x42b255){if(_0x42b255){return _0x42b255?{'count':_0x51249a,'rows':_0x42b255}:null;}})[_0xc3f8('0x25')](respondWithResult(_0x3e6c1d,null))[_0xc3f8('0x44')](handleError(_0x3e6c1d,null));};exports[_0xc3f8('0x4e')]=function(_0x56fd61,_0x2f199d,_0x4ca426){if(_0x56fd61[_0xc3f8('0x49')]['id']){delete _0x56fd61['body']['id'];}return db[_0xc3f8('0x2b')][_0xc3f8('0x4b')]({'where':{'id':_0x56fd61['params']['id']}})['then'](handleEntityNotFound(_0x2f199d,null))[_0xc3f8('0x25')](function(_0x2c7ab9){if(_0x2c7ab9){_0x56fd61['body'][_0xc3f8('0x4f')]=_0x2c7ab9['id'];_0x56fd61[_0xc3f8('0x49')][_0xc3f8('0x50')]=integrations[_0xc3f8('0x51')](_0x56fd61[_0xc3f8('0x49')][_0xc3f8('0x52')],_0x56fd61[_0xc3f8('0x49')][_0xc3f8('0x2d')]);_0x56fd61['body']['Descriptions']=integrations[_0xc3f8('0x53')](_0x56fd61['body']['channel'],_0x56fd61['body']['type']);return db['ZendeskConfiguration'][_0xc3f8('0x48')](_0x56fd61[_0xc3f8('0x49')],{'include':[{'model':db[_0xc3f8('0x54')],'as':_0xc3f8('0x50')},{'model':db['ZendeskField'],'as':_0xc3f8('0x55')}]});}return null;})[_0xc3f8('0x25')](respondWithResult(_0x2f199d,null))['catch'](handleError(_0x2f199d,null));};exports[_0xc3f8('0x56')]=function(_0x273faf,_0x104eec,_0x531de8){var _0xaedf89='';return db['ZendeskAccount']['findOne']({'where':{'id':_0x273faf['params']['id']},'attributes':['id',_0xc3f8('0x57'),_0xc3f8('0x58'),'token',_0xc3f8('0x59'),_0xc3f8('0x5a')]})['then'](handleEntityNotFound(_0x104eec,null))[_0xc3f8('0x25')](function(_0x2f957a){if(_0x2f957a){_0xaedf89=_0x2f957a['remoteUri'];var _0x34edb9=_0xaedf89['slice'](-0x1);if(_0x34edb9==='/'){_0xaedf89=_0xaedf89[_0xc3f8('0x5b')](0x0,_0xaedf89[_0xc3f8('0x5c')](_0x34edb9));}var _0x4cc654={'method':'GET','uri':util[_0xc3f8('0x5d')](_0xc3f8('0x5e'),_0xaedf89,'ticket_fields'),'json':!![]};switch(_0x2f957a[_0xc3f8('0x59')]){case'password':_0x4cc654[_0xc3f8('0x5f')]={'Authorization':util['format'](_0xc3f8('0x60'),new Buffer(util[_0xc3f8('0x5d')](_0xc3f8('0x61'),_0x2f957a[_0xc3f8('0x57')],_0x2f957a[_0xc3f8('0x58')]))[_0xc3f8('0x62')](_0xc3f8('0x63')))};break;case _0xc3f8('0x64'):_0x4cc654[_0xc3f8('0x5f')]={'Authorization':util['format'](_0xc3f8('0x60'),new Buffer(util[_0xc3f8('0x5d')](_0xc3f8('0x65'),_0x2f957a[_0xc3f8('0x57')],_0x2f957a[_0xc3f8('0x64')]))['toString'](_0xc3f8('0x63')))};break;default:throw new db[(_0xc3f8('0x66'))][(_0xc3f8('0x67'))](_0xc3f8('0x68'));}return rp(_0x4cc654);}})[_0xc3f8('0x25')](function(_0x53c815){if(_0x53c815){var _0x2f69f7=[_0xc3f8('0x69'),_0xc3f8('0x6a'),'group','assignee'];_[_0xc3f8('0x6b')](_0x53c815[_0xc3f8('0x6c')],function(_0x1a9c33){return _0x2f69f7[_0xc3f8('0x6d')](_0x1a9c33['type']);});return{'count':_0x53c815[_0xc3f8('0x6c')][_0xc3f8('0x36')],'rows':_[_0xc3f8('0x2a')](_0x53c815['ticket_fields'],function(_0x2a29fa){return{'id':_0x2a29fa['id'],'name':_0x2a29fa[_0xc3f8('0x6e')]>0x7?_0x2a29fa['title']:_0x2a29fa['type'],'custom':_0x2a29fa[_0xc3f8('0x6e')]>0x7?!![]:![],'options':_0x2a29fa[_0xc3f8('0x6f')]?_0x2a29fa['system_field_options']:_0x2a29fa[_0xc3f8('0x70')]?_0x2a29fa[_0xc3f8('0x70')]:[]};})};}})['then'](respondWithResult(_0x104eec,null))[_0xc3f8('0x44')](function(_0x5f2d86){var _0x3d080a=_0x273faf['query'][_0xc3f8('0x71')]?0x1f4:_0x5f2d86[_0xc3f8('0x72')]||0x1f4;logger[_0xc3f8('0x26')](_0xc3f8('0x73'),_0xc3f8('0x56'),_0x3d080a,JSON[_0xc3f8('0x74')](_0x5f2d86));delete _0x5f2d86[_0xc3f8('0x28')];if(_0x3d080a===0x191){_0x3d080a=0x190;}_0x104eec[_0xc3f8('0x18')](_0x3d080a)[_0xc3f8('0x29')](_0x273faf['query']['test']?{'message':_0xc3f8('0x75'),'statusCode':_0x5f2d86['statusCode']}:_0x5f2d86);});}; \ No newline at end of file +var _0x087b=['nolimit','order','sort','where','filter','merge','options','includeAll','include','findAll','catch','params','length','find','create','body','getConfigurations','findOne','ZendeskConfiguration','pick','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','ZendeskField','getFields','username','password','token','authType','remoteUri','slice','lastIndexOf','GET','format','ticket_fields','headers','Basic\x20%s','toString','base64','Sequelize','Unknown\x20authentication\x20type','description','group','assignee','remove','position','system_field_options','custom_field_options','test','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','undefined','limit','count','offset','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','ZendeskAccount','rawAttributes','fieldName','type','keys','query','filters','intersection','model','attributes','fields','hasOwnProperty'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x087b,0x11a));var _0xb087=function(_0x59d89e,_0x55edf5){_0x59d89e=_0x59d89e-0x0;var _0x554e93=_0x087b[_0x59d89e];return _0x554e93;};'use strict';var emlformat=require(_0xb087('0x0'));var rimraf=require(_0xb087('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xb087('0x2'));var moment=require('moment');var BPromise=require(_0xb087('0x3'));var Mustache=require(_0xb087('0x4'));var util=require(_0xb087('0x5'));var path=require(_0xb087('0x6'));var sox=require(_0xb087('0x7'));var csv=require(_0xb087('0x8'));var ejs=require(_0xb087('0x9'));var fs=require('fs');var fs_extra=require(_0xb087('0xa'));var _=require(_0xb087('0xb'));var squel=require(_0xb087('0xc'));var crypto=require(_0xb087('0xd'));var jsforce=require(_0xb087('0xe'));var deskjs=require(_0xb087('0xf'));var toCsv=require(_0xb087('0x8'));var querystring=require(_0xb087('0x10'));var Papa=require(_0xb087('0x11'));var Redis=require(_0xb087('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xb087('0x13'));var as=require(_0xb087('0x14'));var hardwareService=require(_0xb087('0x15'));var logger=require(_0xb087('0x16'))(_0xb087('0x17'));var utils=require(_0xb087('0x18'));var config=require(_0xb087('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xb087('0x1a'))['db'];var integrations=require(_0xb087('0x1b'));function respondWithStatusCode(_0x323656,_0x51ceaa){_0x51ceaa=_0x51ceaa||0xcc;return function(_0x3001e3){if(_0x3001e3){return _0x323656[_0xb087('0x1c')](_0x51ceaa);}return _0x323656[_0xb087('0x1d')](_0x51ceaa)[_0xb087('0x1e')]();};}function respondWithResult(_0x11784c,_0x12d0db){_0x12d0db=_0x12d0db||0xc8;return function(_0x5e9757){if(_0x5e9757){return _0x11784c[_0xb087('0x1d')](_0x12d0db)[_0xb087('0x1f')](_0x5e9757);}};}function respondWithFilteredResult(_0x16d0b7,_0x5193a4){return function(_0x43e576){if(_0x43e576){var _0x412b48=typeof _0x5193a4['offset']===_0xb087('0x20')&&typeof _0x5193a4[_0xb087('0x21')]===_0xb087('0x20');var _0x5bb80b=_0x43e576[_0xb087('0x22')];var _0x3c680f=_0x412b48?0x0:_0x5193a4[_0xb087('0x23')];var _0x45d074=_0x412b48?_0x43e576['count']:_0x5193a4[_0xb087('0x23')]+_0x5193a4[_0xb087('0x21')];var _0x10bb5b;if(_0x45d074>=_0x5bb80b){_0x45d074=_0x5bb80b;_0x10bb5b=0xc8;}else{_0x10bb5b=0xce;}_0x16d0b7[_0xb087('0x1d')](_0x10bb5b);return _0x16d0b7['set']('Content-Range',_0x3c680f+'-'+_0x45d074+'/'+_0x5bb80b)['json'](_0x43e576);}return null;};}function patchUpdates(_0x49450a){return function(_0x45a6cf){try{jsonpatch[_0xb087('0x24')](_0x45a6cf,_0x49450a,!![]);}catch(_0x3d0f57){return BPromise[_0xb087('0x25')](_0x3d0f57);}return _0x45a6cf[_0xb087('0x26')]();};}function saveUpdates(_0x258b4c,_0x31ae01){return function(_0x5587f7){if(_0x5587f7){return _0x5587f7[_0xb087('0x27')](_0x258b4c)[_0xb087('0x28')](function(_0x1de654){return _0x1de654;});}return null;};}function removeEntity(_0x1cfb3e,_0x3ad74e){return function(_0x4d9028){if(_0x4d9028){return _0x4d9028[_0xb087('0x29')]()[_0xb087('0x28')](function(){_0x1cfb3e['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x50745a,_0x598b99){return function(_0x5a4ee0){if(!_0x5a4ee0){_0x50745a[_0xb087('0x1c')](0x194);}return _0x5a4ee0;};}function handleError(_0x45685d,_0x1d124f){_0x1d124f=_0x1d124f||0x1f4;return function(_0x3ca2df){logger[_0xb087('0x2a')](_0x3ca2df[_0xb087('0x2b')]);if(_0x3ca2df[_0xb087('0x2c')]){delete _0x3ca2df[_0xb087('0x2c')];}_0x45685d[_0xb087('0x1d')](_0x1d124f)[_0xb087('0x2d')](_0x3ca2df);};}exports[_0xb087('0x2e')]=function(_0x31e3e6,_0xb0baf6){var _0x263259={},_0x593b78={},_0x37393a={'count':0x0,'rows':[]};var _0x1335d9=_[_0xb087('0x2f')](db[_0xb087('0x30')][_0xb087('0x31')],function(_0xa6d90c){return{'name':_0xa6d90c[_0xb087('0x32')],'type':_0xa6d90c[_0xb087('0x33')]['key']};});_0x593b78['model']=_[_0xb087('0x2f')](_0x1335d9,_0xb087('0x2c'));_0x593b78['query']=_[_0xb087('0x34')](_0x31e3e6[_0xb087('0x35')]);_0x593b78[_0xb087('0x36')]=_[_0xb087('0x37')](_0x593b78[_0xb087('0x38')],_0x593b78[_0xb087('0x35')]);_0x263259[_0xb087('0x39')]=_[_0xb087('0x37')](_0x593b78[_0xb087('0x38')],qs[_0xb087('0x3a')](_0x31e3e6[_0xb087('0x35')][_0xb087('0x3a')]));_0x263259['attributes']=_0x263259[_0xb087('0x39')]['length']?_0x263259[_0xb087('0x39')]:_0x593b78[_0xb087('0x38')];if(!_0x31e3e6[_0xb087('0x35')][_0xb087('0x3b')](_0xb087('0x3c'))){_0x263259[_0xb087('0x21')]=qs[_0xb087('0x21')](_0x31e3e6[_0xb087('0x35')][_0xb087('0x21')]);_0x263259['offset']=qs['offset'](_0x31e3e6[_0xb087('0x35')][_0xb087('0x23')]);}_0x263259[_0xb087('0x3d')]=qs[_0xb087('0x3e')](_0x31e3e6[_0xb087('0x35')]['sort']);_0x263259[_0xb087('0x3f')]=qs[_0xb087('0x36')](_['pick'](_0x31e3e6['query'],_0x593b78[_0xb087('0x36')]),_0x1335d9);if(_0x31e3e6[_0xb087('0x35')][_0xb087('0x40')]){_0x263259['where']=_[_0xb087('0x41')](_0x263259[_0xb087('0x3f')],{'$or':_[_0xb087('0x2f')](_0x1335d9,function(_0x1ed2c9){if(_0x1ed2c9[_0xb087('0x33')]!=='VIRTUAL'){var _0x7e1315={};_0x7e1315[_0x1ed2c9['name']]={'$like':'%'+_0x31e3e6[_0xb087('0x35')]['filter']+'%'};return _0x7e1315;}})});}_0x263259=_[_0xb087('0x41')]({},_0x263259,_0x31e3e6[_0xb087('0x42')]);var _0x513332={'where':_0x263259[_0xb087('0x3f')]};return db['ZendeskAccount'][_0xb087('0x22')](_0x513332)['then'](function(_0x2d2c74){_0x37393a[_0xb087('0x22')]=_0x2d2c74;if(_0x31e3e6[_0xb087('0x35')][_0xb087('0x43')]){_0x263259[_0xb087('0x44')]=[{'all':!![]}];}return db[_0xb087('0x30')][_0xb087('0x45')](_0x263259);})['then'](function(_0x1625f6){_0x37393a['rows']=_0x1625f6;return _0x37393a;})[_0xb087('0x28')](respondWithFilteredResult(_0xb0baf6,_0x263259))[_0xb087('0x46')](handleError(_0xb0baf6,null));};exports['show']=function(_0xb662bf,_0x45dc6f){var _0x7650c5={'raw':![],'where':{'id':_0xb662bf[_0xb087('0x47')]['id']}},_0x4c33cc={};_0x4c33cc['model']=_[_0xb087('0x34')](db[_0xb087('0x30')]['rawAttributes']);_0x4c33cc[_0xb087('0x35')]=_[_0xb087('0x34')](_0xb662bf['query']);_0x4c33cc[_0xb087('0x36')]=_[_0xb087('0x37')](_0x4c33cc['model'],_0x4c33cc[_0xb087('0x35')]);_0x7650c5[_0xb087('0x39')]=_[_0xb087('0x37')](_0x4c33cc[_0xb087('0x38')],qs['fields'](_0xb662bf['query'][_0xb087('0x3a')]));_0x7650c5[_0xb087('0x39')]=_0x7650c5[_0xb087('0x39')][_0xb087('0x48')]?_0x7650c5[_0xb087('0x39')]:_0x4c33cc[_0xb087('0x38')];if(_0xb662bf['query']['includeAll']){_0x7650c5[_0xb087('0x44')]=[{'all':!![]}];}_0x7650c5=_['merge']({},_0x7650c5,_0xb662bf[_0xb087('0x42')]);return db[_0xb087('0x30')][_0xb087('0x49')](_0x7650c5)[_0xb087('0x28')](handleEntityNotFound(_0x45dc6f,null))['then'](respondWithResult(_0x45dc6f,null))[_0xb087('0x46')](handleError(_0x45dc6f,null));};exports['create']=function(_0x2fe8a0,_0x73413b){return db[_0xb087('0x30')][_0xb087('0x4a')](_0x2fe8a0[_0xb087('0x4b')],{})['then'](respondWithResult(_0x73413b,0xc9))[_0xb087('0x46')](handleError(_0x73413b,null));};exports[_0xb087('0x27')]=function(_0x588d96,_0x4fba31){if(_0x588d96[_0xb087('0x4b')]['id']){delete _0x588d96['body']['id'];}return db['ZendeskAccount'][_0xb087('0x49')]({'where':{'id':_0x588d96[_0xb087('0x47')]['id']}})['then'](handleEntityNotFound(_0x4fba31,null))[_0xb087('0x28')](saveUpdates(_0x588d96[_0xb087('0x4b')],null))[_0xb087('0x28')](respondWithResult(_0x4fba31,null))['catch'](handleError(_0x4fba31,null));};exports['destroy']=function(_0x30cc83,_0x54862a){return db['ZendeskAccount'][_0xb087('0x49')]({'where':{'id':_0x30cc83[_0xb087('0x47')]['id']}})[_0xb087('0x28')](handleEntityNotFound(_0x54862a,null))[_0xb087('0x28')](removeEntity(_0x54862a,null))[_0xb087('0x46')](handleError(_0x54862a,null));};exports[_0xb087('0x4c')]=function(_0xbd849d,_0xfb8827,_0x1fe178){var _0x18d93b={};var _0x47d47c={};var _0x2cfc44;var _0x55e653;return db[_0xb087('0x30')][_0xb087('0x4d')]({'where':{'id':_0xbd849d['params']['id']}})[_0xb087('0x28')](handleEntityNotFound(_0xfb8827,null))[_0xb087('0x28')](function(_0x343830){if(_0x343830){_0x2cfc44=_0x343830;_0x47d47c[_0xb087('0x38')]=_[_0xb087('0x34')](db[_0xb087('0x4e')][_0xb087('0x31')]);_0x47d47c[_0xb087('0x35')]=_[_0xb087('0x34')](_0xbd849d[_0xb087('0x35')]);_0x47d47c[_0xb087('0x36')]=_['intersection'](_0x47d47c[_0xb087('0x38')],_0x47d47c['query']);_0x18d93b[_0xb087('0x39')]=_['intersection'](_0x47d47c[_0xb087('0x38')],qs[_0xb087('0x3a')](_0xbd849d[_0xb087('0x35')][_0xb087('0x3a')]));_0x18d93b[_0xb087('0x39')]=_0x18d93b[_0xb087('0x39')][_0xb087('0x48')]?_0x18d93b[_0xb087('0x39')]:_0x47d47c[_0xb087('0x38')];_0x18d93b[_0xb087('0x3d')]=qs[_0xb087('0x3e')](_0xbd849d[_0xb087('0x35')][_0xb087('0x3e')]);_0x18d93b[_0xb087('0x3f')]=qs[_0xb087('0x36')](_[_0xb087('0x4f')](_0xbd849d[_0xb087('0x35')],_0x47d47c[_0xb087('0x36')]));if(_0xbd849d[_0xb087('0x35')][_0xb087('0x40')]){_0x18d93b[_0xb087('0x3f')]=_[_0xb087('0x41')](_0x18d93b['where'],{'$or':_[_0xb087('0x2f')](_0x18d93b[_0xb087('0x39')],function(_0xe81087){var _0x561c40={};_0x561c40[_0xe81087]={'$like':'%'+_0xbd849d[_0xb087('0x35')][_0xb087('0x40')]+'%'};return _0x561c40;})});}_0x18d93b=_['merge']({},_0x18d93b,_0xbd849d[_0xb087('0x42')]);return _0x2cfc44[_0xb087('0x4c')](_0x18d93b);}})[_0xb087('0x28')](function(_0x596264){if(_0x596264){_0x55e653=_0x596264[_0xb087('0x48')];if(!_0xbd849d[_0xb087('0x35')][_0xb087('0x3b')](_0xb087('0x3c'))){_0x18d93b[_0xb087('0x21')]=qs[_0xb087('0x21')](_0xbd849d[_0xb087('0x35')][_0xb087('0x21')]);_0x18d93b['offset']=qs[_0xb087('0x23')](_0xbd849d[_0xb087('0x35')][_0xb087('0x23')]);}return _0x2cfc44['getConfigurations'](_0x18d93b);}})[_0xb087('0x28')](function(_0x4a26d0){if(_0x4a26d0){return _0x4a26d0?{'count':_0x55e653,'rows':_0x4a26d0}:null;}})['then'](respondWithResult(_0xfb8827,null))[_0xb087('0x46')](handleError(_0xfb8827,null));};exports[_0xb087('0x50')]=function(_0x48c00c,_0x298fdb,_0x524d18){if(_0x48c00c[_0xb087('0x4b')]['id']){delete _0x48c00c[_0xb087('0x4b')]['id'];}return db['ZendeskAccount']['findOne']({'where':{'id':_0x48c00c[_0xb087('0x47')]['id']}})['then'](handleEntityNotFound(_0x298fdb,null))['then'](function(_0x3c97ab){if(_0x3c97ab){_0x48c00c['body'][_0xb087('0x51')]=_0x3c97ab['id'];_0x48c00c['body'][_0xb087('0x52')]=integrations[_0xb087('0x53')](_0x48c00c[_0xb087('0x4b')][_0xb087('0x54')],_0x48c00c[_0xb087('0x4b')][_0xb087('0x33')]);_0x48c00c['body'][_0xb087('0x55')]=integrations['getDescriptions'](_0x48c00c[_0xb087('0x4b')][_0xb087('0x54')],_0x48c00c[_0xb087('0x4b')]['type']);return db[_0xb087('0x4e')]['create'](_0x48c00c[_0xb087('0x4b')],{'include':[{'model':db[_0xb087('0x56')],'as':_0xb087('0x52')},{'model':db[_0xb087('0x56')],'as':_0xb087('0x55')}]});}return null;})[_0xb087('0x28')](respondWithResult(_0x298fdb,null))['catch'](handleError(_0x298fdb,null));};exports[_0xb087('0x57')]=function(_0xd01a6b,_0x4bedbd,_0x25a45f){var _0x58de88='';return db[_0xb087('0x30')][_0xb087('0x4d')]({'where':{'id':_0xd01a6b[_0xb087('0x47')]['id']},'attributes':['id',_0xb087('0x58'),_0xb087('0x59'),_0xb087('0x5a'),_0xb087('0x5b'),_0xb087('0x5c')]})['then'](handleEntityNotFound(_0x4bedbd,null))['then'](function(_0x5c727f){if(_0x5c727f){_0x58de88=_0x5c727f[_0xb087('0x5c')];var _0x5190a4=_0x58de88[_0xb087('0x5d')](-0x1);if(_0x5190a4==='/'){_0x58de88=_0x58de88['substring'](0x0,_0x58de88[_0xb087('0x5e')](_0x5190a4));}var _0x43bf47={'method':_0xb087('0x5f'),'uri':util[_0xb087('0x60')]('%s/%s',_0x58de88,_0xb087('0x61')),'json':!![]};switch(_0x5c727f['authType']){case _0xb087('0x59'):_0x43bf47[_0xb087('0x62')]={'Authorization':util[_0xb087('0x60')](_0xb087('0x63'),new Buffer(util['format']('%s:%s',_0x5c727f[_0xb087('0x58')],_0x5c727f['password']))[_0xb087('0x64')](_0xb087('0x65')))};break;case _0xb087('0x5a'):_0x43bf47[_0xb087('0x62')]={'Authorization':util['format']('Basic\x20%s',new Buffer(util[_0xb087('0x60')]('%s/token:%s',_0x5c727f[_0xb087('0x58')],_0x5c727f[_0xb087('0x5a')]))[_0xb087('0x64')](_0xb087('0x65')))};break;default:throw new db[(_0xb087('0x66'))]['ValidationError'](_0xb087('0x67'));}return rp(_0x43bf47);}})[_0xb087('0x28')](function(_0x5b9c5f){if(_0x5b9c5f){var _0x544ee0=['subject',_0xb087('0x68'),_0xb087('0x69'),_0xb087('0x6a')];_[_0xb087('0x6b')](_0x5b9c5f[_0xb087('0x61')],function(_0x19d7ae){return _0x544ee0['includes'](_0x19d7ae[_0xb087('0x33')]);});return{'count':_0x5b9c5f[_0xb087('0x61')][_0xb087('0x48')],'rows':_[_0xb087('0x2f')](_0x5b9c5f[_0xb087('0x61')],function(_0x3330b2){return{'id':_0x3330b2['id'],'name':_0x3330b2[_0xb087('0x6c')]>0x7?_0x3330b2['title']:_0x3330b2[_0xb087('0x33')],'custom':_0x3330b2[_0xb087('0x6c')]>0x7?!![]:![],'options':_0x3330b2[_0xb087('0x6d')]?_0x3330b2['system_field_options']:_0x3330b2[_0xb087('0x6e')]?_0x3330b2['custom_field_options']:[]};})};}})[_0xb087('0x28')](respondWithResult(_0x4bedbd,null))[_0xb087('0x46')](function(_0x45da69){var _0x267dea=_0xd01a6b[_0xb087('0x35')][_0xb087('0x6f')]?0x1f4:_0x45da69['statusCode']||0x1f4;logger['error'](_0xb087('0x70'),_0xb087('0x57'),_0x267dea,JSON['stringify'](_0x45da69));delete _0x45da69[_0xb087('0x2c')];if(_0x267dea===0x191){_0x267dea=0x190;}_0x4bedbd[_0xb087('0x1d')](_0x267dea)[_0xb087('0x2d')](_0xd01a6b[_0xb087('0x35')][_0xb087('0x6f')]?{'message':_0xb087('0x71'),'statusCode':_0x45da69['statusCode']}:_0x45da69);});}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.model.js b/server/api/intZendeskAccount/intZendeskAccount.model.js index 0ab067b..b39994b 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 _0x3227=['int_zendesk_accounts','util','bluebird','request-promise','path','rimraf','../../config/environment','./intZendeskAccount.attributes','define','ZendeskAccount'];(function(_0x2fd077,_0x4dfd0b){var _0x23ba49=function(_0x3f0b66){while(--_0x3f0b66){_0x2fd077['push'](_0x2fd077['shift']());}};_0x23ba49(++_0x4dfd0b);}(_0x3227,0x1af));var _0x7322=function(_0x1d0b84,_0x4a6a70){_0x1d0b84=_0x1d0b84-0x0;var _0x6726f0=_0x3227[_0x1d0b84];return _0x6726f0;};'use strict';var _=require('lodash');var util=require(_0x7322('0x0'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x7322('0x1'));var rp=require(_0x7322('0x2'));var fs=require('fs');var path=require(_0x7322('0x3'));var rimraf=require(_0x7322('0x4'));var config=require(_0x7322('0x5'));var attributes=require(_0x7322('0x6'));var integrations=require('../../components/integrations/configuration');module['exports']=function(_0xc8162f,_0x5973ac){return _0xc8162f[_0x7322('0x7')](_0x7322('0x8'),attributes,{'tableName':_0x7322('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc49a=['rimraf','../../config/environment','./intZendeskAccount.attributes','exports','ZendeskAccount','util','api','moment','bluebird','path'];(function(_0x5c54a1,_0x42bbd2){var _0x504e0b=function(_0x3eb5c8){while(--_0x3eb5c8){_0x5c54a1['push'](_0x5c54a1['shift']());}};_0x504e0b(++_0x42bbd2);}(_0xc49a,0x14f));var _0xac49=function(_0xc079b4,_0x4f4d22){_0xc079b4=_0xc079b4-0x0;var _0xe09d37=_0xc49a[_0xc079b4];return _0xe09d37;};'use strict';var _=require('lodash');var util=require(_0xac49('0x0'));var logger=require('../../config/logger')(_0xac49('0x1'));var moment=require(_0xac49('0x2'));var BPromise=require(_0xac49('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xac49('0x4'));var rimraf=require(_0xac49('0x5'));var config=require(_0xac49('0x6'));var attributes=require(_0xac49('0x7'));var integrations=require('../../components/integrations/configuration');module[_0xac49('0x8')]=function(_0x36690c,_0x24e81c){return _0x36690c['define'](_0xac49('0x9'),attributes,{'tableName':'int_zendesk_accounts','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 43b347b..f8194d7 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 _0x340b=['code','message','ZendeskAccount','findAll','options','where','attributes','limit','map','include','model','GetZendeskAccount','catch','ShowZendeskAccount','find','raw','lodash','util','bluebird','randomstring','ioredis','../../config/logger','jayson/promise','client','http','request','then','info','ZendeskAccount,\x20%s,\x20%s','debug','request\x20sent','stringify','error'];(function(_0x31eb98,_0x592fa2){var _0x20cf3e=function(_0x5e30b1){while(--_0x5e30b1){_0x31eb98['push'](_0x31eb98['shift']());}};_0x20cf3e(++_0x592fa2);}(_0x340b,0x15a));var _0xb340=function(_0x9deb64,_0x30255b){_0x9deb64=_0x9deb64-0x0;var _0x35e81f=_0x340b[_0x9deb64];return _0x35e81f;};'use strict';var _=require(_0xb340('0x0'));var util=require(_0xb340('0x1'));var moment=require('moment');var BPromise=require(_0xb340('0x2'));var rs=require(_0xb340('0x3'));var fs=require('fs');var Redis=require(_0xb340('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xb340('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0xb340('0x6'));var client=jayson[_0xb340('0x7')][_0xb340('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x39756c,_0x81df1f,_0x367e80){return new BPromise(function(_0x26d977,_0x1f11d7){return client[_0xb340('0x9')](_0x39756c,_0x367e80)[_0xb340('0xa')](function(_0x5768e9){logger[_0xb340('0xb')](_0xb340('0xc'),_0x81df1f,'request\x20sent');logger[_0xb340('0xd')]('ZendeskAccount,\x20%s,\x20%s,\x20%s',_0x81df1f,_0xb340('0xe'),JSON[_0xb340('0xf')](_0x5768e9));if(_0x5768e9[_0xb340('0x10')]){if(_0x5768e9['error'][_0xb340('0x11')]===0x1f4){logger['error'](_0xb340('0xc'),_0x81df1f,_0x5768e9[_0xb340('0x10')][_0xb340('0x12')]);return _0x1f11d7(_0x5768e9['error'][_0xb340('0x12')]);}logger[_0xb340('0x10')]('ZendeskAccount,\x20%s,\x20%s',_0x81df1f,_0x5768e9[_0xb340('0x10')]['message']);return _0x26d977(_0x5768e9[_0xb340('0x10')][_0xb340('0x12')]);}else{logger['info']('ZendeskAccount,\x20%s,\x20%s',_0x81df1f,'request\x20sent');_0x26d977(_0x5768e9['result'][_0xb340('0x12')]);}})['catch'](function(_0x637fc8){logger[_0xb340('0x10')](_0xb340('0xc'),_0x81df1f,_0x637fc8);_0x1f11d7(_0x637fc8);});});}exports['GetZendeskAccount']=function(_0x19d47e){var _0x1ef876=this;return new Promise(function(_0x25453b,_0x33f693){return db[_0xb340('0x13')][_0xb340('0x14')]({'raw':_0x19d47e[_0xb340('0x15')]?_0x19d47e[_0xb340('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x19d47e[_0xb340('0x15')]?_0x19d47e['options'][_0xb340('0x16')]||null:null,'attributes':_0x19d47e[_0xb340('0x15')]?_0x19d47e['options'][_0xb340('0x17')]||null:null,'limit':_0x19d47e[_0xb340('0x15')]?_0x19d47e[_0xb340('0x15')][_0xb340('0x18')]||null:null,'include':_0x19d47e[_0xb340('0x15')]?_0x19d47e['options']['include']?_[_0xb340('0x19')](_0x19d47e[_0xb340('0x15')][_0xb340('0x1a')],function(_0x35e14d){return{'model':db[_0x35e14d['model']],'as':_0x35e14d['as'],'attributes':_0x35e14d[_0xb340('0x17')],'include':_0x35e14d['include']?_['map'](_0x35e14d[_0xb340('0x1a')],function(_0x4eb41f){return{'model':db[_0x4eb41f[_0xb340('0x1b')]],'as':_0x4eb41f['as'],'attributes':_0x4eb41f[_0xb340('0x17')],'include':_0x4eb41f[_0xb340('0x1a')]?_[_0xb340('0x19')](_0x4eb41f['include'],function(_0x903860){return{'model':db[_0x903860[_0xb340('0x1b')]],'as':_0x903860['as'],'attributes':_0x903860[_0xb340('0x17')]};}):[]};}):[]};}):[]:[]})[_0xb340('0xa')](function(_0x35b344){logger[_0xb340('0xb')](_0xb340('0x1c'),_0x19d47e);logger[_0xb340('0xd')](_0xb340('0x1c'),_0x19d47e,JSON['stringify'](_0x35b344));_0x25453b(_0x35b344);})[_0xb340('0x1d')](function(_0x2def49){logger[_0xb340('0x10')](_0xb340('0x1c'),_0x2def49[_0xb340('0x12')],_0x19d47e);_0x33f693(_0x1ef876[_0xb340('0x10')](0x1f4,_0x2def49['message']));});});};exports[_0xb340('0x1e')]=function(_0x50ad71){var _0x3871e1=this;return new Promise(function(_0x1793b5,_0x590880){return db['ZendeskAccount'][_0xb340('0x1f')]({'raw':_0x50ad71[_0xb340('0x15')]?_0x50ad71['options'][_0xb340('0x20')]===undefined?!![]:![]:!![],'where':_0x50ad71[_0xb340('0x15')]?_0x50ad71['options'][_0xb340('0x16')]||null:null,'attributes':_0x50ad71[_0xb340('0x15')]?_0x50ad71[_0xb340('0x15')]['attributes']||null:null,'include':_0x50ad71['options']?_0x50ad71[_0xb340('0x15')][_0xb340('0x1a')]?_['map'](_0x50ad71['options'][_0xb340('0x1a')],function(_0x56720b){return{'model':db[_0x56720b[_0xb340('0x1b')]],'as':_0x56720b['as'],'attributes':_0x56720b[_0xb340('0x17')],'include':_0x56720b[_0xb340('0x1a')]?_[_0xb340('0x19')](_0x56720b[_0xb340('0x1a')],function(_0x5d389f){return{'model':db[_0x5d389f[_0xb340('0x1b')]],'as':_0x5d389f['as'],'attributes':_0x5d389f['attributes'],'include':_0x5d389f[_0xb340('0x1a')]?_[_0xb340('0x19')](_0x5d389f['include'],function(_0x1e312a){return{'model':db[_0x1e312a[_0xb340('0x1b')]],'as':_0x1e312a['as'],'attributes':_0x1e312a[_0xb340('0x17')]};}):[]};}):[]};}):[]:[]})[_0xb340('0xa')](function(_0x55a2e8){logger[_0xb340('0xb')](_0xb340('0x1e'),_0x50ad71);logger[_0xb340('0xd')](_0xb340('0x1e'),_0x50ad71,JSON[_0xb340('0xf')](_0x55a2e8));_0x1793b5(_0x55a2e8);})[_0xb340('0x1d')](function(_0x475273){logger[_0xb340('0x10')](_0xb340('0x1e'),_0x475273[_0xb340('0x12')],_0x50ad71);_0x590880(_0x3871e1[_0xb340('0x10')](0x1f4,_0x475273[_0xb340('0x12')]));});});}; \ No newline at end of file +var _0xc8fa=['info','ZendeskAccount,\x20%s,\x20%s','request\x20sent','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','error','message','result','catch','GetZendeskAccount','ZendeskAccount','findAll','options','raw','where','attributes','include','map','model','stringify','ShowZendeskAccount','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','request','then'];(function(_0x5d0f1d,_0x389048){var _0x10b3d3=function(_0x11416c){while(--_0x11416c){_0x5d0f1d['push'](_0x5d0f1d['shift']());}};_0x10b3d3(++_0x389048);}(_0xc8fa,0x7f));var _0xac8f=function(_0x9c9660,_0x523234){_0x9c9660=_0x9c9660-0x0;var _0x35913e=_0xc8fa[_0x9c9660];return _0x35913e;};'use strict';var _=require(_0xac8f('0x0'));var util=require(_0xac8f('0x1'));var moment=require(_0xac8f('0x2'));var BPromise=require(_0xac8f('0x3'));var rs=require(_0xac8f('0x4'));var fs=require('fs');var Redis=require(_0xac8f('0x5'));var db=require(_0xac8f('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xac8f('0x7'))('rpc');var config=require(_0xac8f('0x8'));var jayson=require(_0xac8f('0x9'));var client=jayson[_0xac8f('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4af023,_0x20d2bf,_0x516be0){return new BPromise(function(_0x4f6c03,_0x1f99ad){return client[_0xac8f('0xb')](_0x4af023,_0x516be0)[_0xac8f('0xc')](function(_0x1755d4){logger[_0xac8f('0xd')](_0xac8f('0xe'),_0x20d2bf,_0xac8f('0xf'));logger[_0xac8f('0x10')](_0xac8f('0x11'),_0x20d2bf,'request\x20sent',JSON['stringify'](_0x1755d4));if(_0x1755d4[_0xac8f('0x12')]){if(_0x1755d4[_0xac8f('0x12')]['code']===0x1f4){logger[_0xac8f('0x12')](_0xac8f('0xe'),_0x20d2bf,_0x1755d4[_0xac8f('0x12')][_0xac8f('0x13')]);return _0x1f99ad(_0x1755d4[_0xac8f('0x12')][_0xac8f('0x13')]);}logger[_0xac8f('0x12')](_0xac8f('0xe'),_0x20d2bf,_0x1755d4[_0xac8f('0x12')][_0xac8f('0x13')]);return _0x4f6c03(_0x1755d4[_0xac8f('0x12')][_0xac8f('0x13')]);}else{logger['info'](_0xac8f('0xe'),_0x20d2bf,_0xac8f('0xf'));_0x4f6c03(_0x1755d4[_0xac8f('0x14')][_0xac8f('0x13')]);}})[_0xac8f('0x15')](function(_0x1dc4bc){logger[_0xac8f('0x12')]('ZendeskAccount,\x20%s,\x20%s',_0x20d2bf,_0x1dc4bc);_0x1f99ad(_0x1dc4bc);});});}exports[_0xac8f('0x16')]=function(_0x4b1248){var _0x5a1a3f=this;return new Promise(function(_0x2da357,_0x33f6c7){return db[_0xac8f('0x17')][_0xac8f('0x18')]({'raw':_0x4b1248['options']?_0x4b1248[_0xac8f('0x19')][_0xac8f('0x1a')]===undefined?!![]:![]:!![],'where':_0x4b1248[_0xac8f('0x19')]?_0x4b1248[_0xac8f('0x19')][_0xac8f('0x1b')]||null:null,'attributes':_0x4b1248[_0xac8f('0x19')]?_0x4b1248[_0xac8f('0x19')][_0xac8f('0x1c')]||null:null,'limit':_0x4b1248[_0xac8f('0x19')]?_0x4b1248[_0xac8f('0x19')]['limit']||null:null,'include':_0x4b1248[_0xac8f('0x19')]?_0x4b1248[_0xac8f('0x19')][_0xac8f('0x1d')]?_[_0xac8f('0x1e')](_0x4b1248[_0xac8f('0x19')][_0xac8f('0x1d')],function(_0x2d4cee){return{'model':db[_0x2d4cee['model']],'as':_0x2d4cee['as'],'attributes':_0x2d4cee[_0xac8f('0x1c')],'include':_0x2d4cee['include']?_['map'](_0x2d4cee[_0xac8f('0x1d')],function(_0x457de9){return{'model':db[_0x457de9[_0xac8f('0x1f')]],'as':_0x457de9['as'],'attributes':_0x457de9[_0xac8f('0x1c')],'include':_0x457de9['include']?_[_0xac8f('0x1e')](_0x457de9[_0xac8f('0x1d')],function(_0x3e126c){return{'model':db[_0x3e126c[_0xac8f('0x1f')]],'as':_0x3e126c['as'],'attributes':_0x3e126c['attributes']};}):[]};}):[]};}):[]:[]})[_0xac8f('0xc')](function(_0x325887){logger[_0xac8f('0xd')](_0xac8f('0x16'),_0x4b1248);logger[_0xac8f('0x10')](_0xac8f('0x16'),_0x4b1248,JSON[_0xac8f('0x20')](_0x325887));_0x2da357(_0x325887);})['catch'](function(_0x30670e){logger[_0xac8f('0x12')](_0xac8f('0x16'),_0x30670e[_0xac8f('0x13')],_0x4b1248);_0x33f6c7(_0x5a1a3f['error'](0x1f4,_0x30670e[_0xac8f('0x13')]));});});};exports[_0xac8f('0x21')]=function(_0x3dbe21){var _0x1e0e87=this;return new Promise(function(_0xe9dec5,_0x476ec2){return db[_0xac8f('0x17')][_0xac8f('0x22')]({'raw':_0x3dbe21[_0xac8f('0x19')]?_0x3dbe21[_0xac8f('0x19')][_0xac8f('0x1a')]===undefined?!![]:![]:!![],'where':_0x3dbe21[_0xac8f('0x19')]?_0x3dbe21['options']['where']||null:null,'attributes':_0x3dbe21[_0xac8f('0x19')]?_0x3dbe21[_0xac8f('0x19')][_0xac8f('0x1c')]||null:null,'include':_0x3dbe21[_0xac8f('0x19')]?_0x3dbe21[_0xac8f('0x19')][_0xac8f('0x1d')]?_['map'](_0x3dbe21['options'][_0xac8f('0x1d')],function(_0x55973d){return{'model':db[_0x55973d[_0xac8f('0x1f')]],'as':_0x55973d['as'],'attributes':_0x55973d[_0xac8f('0x1c')],'include':_0x55973d[_0xac8f('0x1d')]?_[_0xac8f('0x1e')](_0x55973d[_0xac8f('0x1d')],function(_0x159243){return{'model':db[_0x159243['model']],'as':_0x159243['as'],'attributes':_0x159243[_0xac8f('0x1c')],'include':_0x159243[_0xac8f('0x1d')]?_[_0xac8f('0x1e')](_0x159243[_0xac8f('0x1d')],function(_0x31fae9){return{'model':db[_0x31fae9[_0xac8f('0x1f')]],'as':_0x31fae9['as'],'attributes':_0x31fae9[_0xac8f('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xac8f('0xc')](function(_0x2f044a){logger[_0xac8f('0xd')](_0xac8f('0x21'),_0x3dbe21);logger[_0xac8f('0x10')](_0xac8f('0x21'),_0x3dbe21,JSON[_0xac8f('0x20')](_0x2f044a));_0xe9dec5(_0x2f044a);})[_0xac8f('0x15')](function(_0x210d1c){logger[_0xac8f('0x12')](_0xac8f('0x21'),_0x210d1c[_0xac8f('0x13')],_0x3dbe21);_0x476ec2(_0x1e0e87[_0xac8f('0x12')](0x1f4,_0x210d1c[_0xac8f('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/index.js b/server/api/intZendeskConfiguration/index.js index 5e86ee7..3e1b9bb 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 _0xe706=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','/:id/tags','getTags','post','create','put','update','delete','exports','multer','util','path','express','Router'];(function(_0x4d1a76,_0x3b5f5e){var _0x51396e=function(_0x1c78d9){while(--_0x1c78d9){_0x4d1a76['push'](_0x4d1a76['shift']());}};_0x51396e(++_0x3b5f5e);}(_0xe706,0xa3));var _0x6e70=function(_0x565c49,_0x54acd0){_0x565c49=_0x565c49-0x0;var _0x20ca34=_0xe706[_0x565c49];return _0x20ca34;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var controller=require(_0x6e70('0x9'));router[_0x6e70('0xa')]('/',auth[_0x6e70('0xb')](),controller[_0x6e70('0xc')]);router[_0x6e70('0xa')](_0x6e70('0xd'),auth[_0x6e70('0xb')](),controller[_0x6e70('0xe')]);router[_0x6e70('0xa')](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x10')]);router[_0x6e70('0xa')](_0x6e70('0x11'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x12')]);router[_0x6e70('0xa')](_0x6e70('0x13'),auth['isAuthenticated'](),controller['getDescriptions']);router[_0x6e70('0xa')](_0x6e70('0x14'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x15')]);router[_0x6e70('0x16')]('/',auth[_0x6e70('0xb')](),controller[_0x6e70('0x17')]);router[_0x6e70('0x16')]('/:id/tags',auth['isAuthenticated'](),controller['setTags']);router[_0x6e70('0x18')]('/:id',auth['isAuthenticated'](),controller[_0x6e70('0x19')]);router[_0x6e70('0x1a')]('/:id',auth[_0x6e70('0xb')](),controller['destroy']);module[_0x6e70('0x1b')]=router; \ No newline at end of file +var _0xa571=['util','path','connect-timeout','Router','fs-extra','../../config/environment','get','isAuthenticated','index','/:id','/:id/fields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','getTags','post','create','put','update','exports','multer'];(function(_0x1957bf,_0x141381){var _0x1b7163=function(_0x32cbc1){while(--_0x32cbc1){_0x1957bf['push'](_0x1957bf['shift']());}};_0x1b7163(++_0x141381);}(_0xa571,0x107));var _0x1a57=function(_0x5555eb,_0x7217b5){_0x5555eb=_0x5555eb-0x0;var _0x4e4a36=_0xa571[_0x5555eb];return _0x4e4a36;};'use strict';var multer=require(_0x1a57('0x0'));var util=require(_0x1a57('0x1'));var path=require(_0x1a57('0x2'));var timeout=require(_0x1a57('0x3'));var express=require('express');var router=express[_0x1a57('0x4')]();var fs_extra=require(_0x1a57('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x1a57('0x6'));var controller=require('./intZendeskConfiguration.controller');router[_0x1a57('0x7')]('/',auth[_0x1a57('0x8')](),controller[_0x1a57('0x9')]);router[_0x1a57('0x7')](_0x1a57('0xa'),auth[_0x1a57('0x8')](),controller['show']);router[_0x1a57('0x7')](_0x1a57('0xb'),auth[_0x1a57('0x8')](),controller['getFields']);router[_0x1a57('0x7')](_0x1a57('0xc'),auth[_0x1a57('0x8')](),controller[_0x1a57('0xd')]);router[_0x1a57('0x7')](_0x1a57('0xe'),auth[_0x1a57('0x8')](),controller[_0x1a57('0xf')]);router['get']('/:id/tags',auth[_0x1a57('0x8')](),controller[_0x1a57('0x10')]);router[_0x1a57('0x11')]('/',auth['isAuthenticated'](),controller[_0x1a57('0x12')]);router[_0x1a57('0x11')]('/:id/tags',auth[_0x1a57('0x8')](),controller['setTags']);router[_0x1a57('0x13')](_0x1a57('0xa'),auth[_0x1a57('0x8')](),controller[_0x1a57('0x14')]);router['delete'](_0x1a57('0xa'),auth['isAuthenticated'](),controller['destroy']);module[_0x1a57('0x15')]=router; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js index de9363f..4b4b3ed 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 _0xc217=['exports','STRING','sequelize'];(function(_0x39cd3c,_0xa21102){var _0x47a0ae=function(_0x330b05){while(--_0x330b05){_0x39cd3c['push'](_0x39cd3c['shift']());}};_0x47a0ae(++_0xa21102);}(_0xc217,0x194));var _0x7c21=function(_0x3d38ae,_0x51102b){_0x3d38ae=_0x3d38ae-0x0;var _0x3757ee=_0xc217[_0x3d38ae];return _0x3757ee;};'use strict';var Sequelize=require(_0x7c21('0x0'));module[_0x7c21('0x1')]={'name':{'type':Sequelize[_0x7c21('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xe74a=['sequelize','exports','STRING'];(function(_0x444be6,_0x2218b2){var _0x3b7727=function(_0x30761d){while(--_0x30761d){_0x444be6['push'](_0x444be6['shift']());}};_0x3b7727(++_0x2218b2);}(_0xe74a,0x11d));var _0xae74=function(_0x15fab0,_0x416c7d){_0x15fab0=_0x15fab0-0x0;var _0x1b41a8=_0xe74a[_0x15fab0];return _0x1b41a8;};'use strict';var Sequelize=require(_0xae74('0x0'));module[_0xae74('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xae74('0x2')]}}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js index 75dee7d..53dcd2d 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 _0x6f95=['lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','apply','save','then','destroy','error','name','send','index','ZendeskConfiguration','fieldName','type','model','map','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','keys','rawAttributes','includeAll','find','create','body','update','getFields','findOne','ZendeskField','filter','getSubjects','getDescriptions','getTags','Tag','ids','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra'];(function(_0x1c1ae8,_0xb8fae0){var _0x260b1a=function(_0x12f30f){while(--_0x12f30f){_0x1c1ae8['push'](_0x1c1ae8['shift']());}};_0x260b1a(++_0xb8fae0);}(_0x6f95,0x9f));var _0x56f9=function(_0x243b2f,_0x30aa15){_0x243b2f=_0x243b2f-0x0;var _0xcb3c2d=_0x6f95[_0x243b2f];return _0xcb3c2d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x56f9('0x0'));var zipdir=require(_0x56f9('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x56f9('0x2'));var moment=require(_0x56f9('0x3'));var BPromise=require(_0x56f9('0x4'));var Mustache=require(_0x56f9('0x5'));var util=require(_0x56f9('0x6'));var path=require(_0x56f9('0x7'));var sox=require(_0x56f9('0x8'));var csv=require(_0x56f9('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x56f9('0xa'));var _=require(_0x56f9('0xb'));var squel=require('squel');var crypto=require(_0x56f9('0xc'));var jsforce=require(_0x56f9('0xd'));var deskjs=require(_0x56f9('0xe'));var toCsv=require('to-csv');var querystring=require(_0x56f9('0xf'));var Papa=require('papaparse');var Redis=require(_0x56f9('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x56f9('0x11'));var as=require(_0x56f9('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x56f9('0x13'))(_0x56f9('0x14'));var utils=require(_0x56f9('0x15'));var config=require(_0x56f9('0x16'));var licenseUtil=require(_0x56f9('0x17'));var db=require(_0x56f9('0x18'))['db'];function respondWithStatusCode(_0x5aa6a4,_0x32e09f){_0x32e09f=_0x32e09f||0xcc;return function(_0x2d159e){if(_0x2d159e){return _0x5aa6a4[_0x56f9('0x19')](_0x32e09f);}return _0x5aa6a4['status'](_0x32e09f)[_0x56f9('0x1a')]();};}function respondWithResult(_0x22b9c0,_0x33439d){_0x33439d=_0x33439d||0xc8;return function(_0x209422){if(_0x209422){return _0x22b9c0[_0x56f9('0x1b')](_0x33439d)[_0x56f9('0x1c')](_0x209422);}};}function respondWithFilteredResult(_0x51cb4d,_0x34c403){return function(_0x37aeda){if(_0x37aeda){var _0x45fc43=typeof _0x34c403[_0x56f9('0x1d')]===_0x56f9('0x1e')&&typeof _0x34c403['limit']===_0x56f9('0x1e');var _0x568d8c=_0x37aeda[_0x56f9('0x1f')];var _0x457d5c=_0x45fc43?0x0:_0x34c403[_0x56f9('0x1d')];var _0x156a6f=_0x45fc43?_0x37aeda[_0x56f9('0x1f')]:_0x34c403['offset']+_0x34c403[_0x56f9('0x20')];var _0x1e5637;if(_0x156a6f>=_0x568d8c){_0x156a6f=_0x568d8c;_0x1e5637=0xc8;}else{_0x1e5637=0xce;}_0x51cb4d['status'](_0x1e5637);return _0x51cb4d[_0x56f9('0x21')](_0x56f9('0x22'),_0x457d5c+'-'+_0x156a6f+'/'+_0x568d8c)[_0x56f9('0x1c')](_0x37aeda);}return null;};}function patchUpdates(_0x4b8675){return function(_0x269108){try{jsonpatch[_0x56f9('0x23')](_0x269108,_0x4b8675,!![]);}catch(_0x5eac42){return BPromise['reject'](_0x5eac42);}return _0x269108[_0x56f9('0x24')]();};}function saveUpdates(_0x395e33,_0x27f51a){return function(_0x5c6849){if(_0x5c6849){return _0x5c6849['update'](_0x395e33)[_0x56f9('0x25')](function(_0x32b84e){return _0x32b84e;});}return null;};}function removeEntity(_0x169b6b,_0x104078){return function(_0x2d4cac){if(_0x2d4cac){return _0x2d4cac[_0x56f9('0x26')]()[_0x56f9('0x25')](function(){_0x169b6b[_0x56f9('0x1b')](0xcc)[_0x56f9('0x1a')]();});}};}function handleEntityNotFound(_0x1c497f,_0x38ae1c){return function(_0x559447){if(!_0x559447){_0x1c497f[_0x56f9('0x19')](0x194);}return _0x559447;};}function handleError(_0x3ff33b,_0x52d921){_0x52d921=_0x52d921||0x1f4;return function(_0x3aa021){logger[_0x56f9('0x27')](_0x3aa021['stack']);if(_0x3aa021[_0x56f9('0x28')]){delete _0x3aa021[_0x56f9('0x28')];}_0x3ff33b[_0x56f9('0x1b')](_0x52d921)[_0x56f9('0x29')](_0x3aa021);};}exports[_0x56f9('0x2a')]=function(_0x510309,_0x37ebe3){var _0x533a0a={},_0x1aa924={},_0x4cf20f={'count':0x0,'rows':[]};var _0x1ce034=_['map'](db[_0x56f9('0x2b')]['rawAttributes'],function(_0x21fc08){return{'name':_0x21fc08[_0x56f9('0x2c')],'type':_0x21fc08[_0x56f9('0x2d')]['key']};});_0x1aa924[_0x56f9('0x2e')]=_[_0x56f9('0x2f')](_0x1ce034,'name');_0x1aa924[_0x56f9('0x30')]=_['keys'](_0x510309[_0x56f9('0x30')]);_0x1aa924[_0x56f9('0x31')]=_['intersection'](_0x1aa924[_0x56f9('0x2e')],_0x1aa924['query']);_0x533a0a['attributes']=_[_0x56f9('0x32')](_0x1aa924[_0x56f9('0x2e')],qs[_0x56f9('0x33')](_0x510309[_0x56f9('0x30')][_0x56f9('0x33')]));_0x533a0a[_0x56f9('0x34')]=_0x533a0a[_0x56f9('0x34')][_0x56f9('0x35')]?_0x533a0a[_0x56f9('0x34')]:_0x1aa924[_0x56f9('0x2e')];if(!_0x510309[_0x56f9('0x30')][_0x56f9('0x36')](_0x56f9('0x37'))){_0x533a0a[_0x56f9('0x20')]=qs[_0x56f9('0x20')](_0x510309['query'][_0x56f9('0x20')]);_0x533a0a['offset']=qs[_0x56f9('0x1d')](_0x510309[_0x56f9('0x30')][_0x56f9('0x1d')]);}_0x533a0a[_0x56f9('0x38')]=qs[_0x56f9('0x39')](_0x510309[_0x56f9('0x30')][_0x56f9('0x39')]);_0x533a0a[_0x56f9('0x3a')]=qs[_0x56f9('0x31')](_[_0x56f9('0x3b')](_0x510309[_0x56f9('0x30')],_0x1aa924['filters']),_0x1ce034);if(_0x510309[_0x56f9('0x30')]['filter']){_0x533a0a['where']=_[_0x56f9('0x3c')](_0x533a0a['where'],{'$or':_[_0x56f9('0x2f')](_0x1ce034,function(_0x2ce3ad){if(_0x2ce3ad[_0x56f9('0x2d')]!==_0x56f9('0x3d')){var _0x384cda={};_0x384cda[_0x2ce3ad['name']]={'$like':'%'+_0x510309[_0x56f9('0x30')]['filter']+'%'};return _0x384cda;}})});}_0x533a0a=_[_0x56f9('0x3c')]({},_0x533a0a,_0x510309[_0x56f9('0x3e')]);var _0x44386d={'where':_0x533a0a[_0x56f9('0x3a')]};return db[_0x56f9('0x2b')][_0x56f9('0x1f')](_0x44386d)[_0x56f9('0x25')](function(_0x1130ec){_0x4cf20f[_0x56f9('0x1f')]=_0x1130ec;if(_0x510309[_0x56f9('0x30')]['includeAll']){_0x533a0a[_0x56f9('0x3f')]=[{'all':!![]}];}return db[_0x56f9('0x2b')][_0x56f9('0x40')](_0x533a0a);})[_0x56f9('0x25')](function(_0x2dcdd4){_0x4cf20f[_0x56f9('0x41')]=_0x2dcdd4;return _0x4cf20f;})[_0x56f9('0x25')](respondWithFilteredResult(_0x37ebe3,_0x533a0a))[_0x56f9('0x42')](handleError(_0x37ebe3,null));};exports[_0x56f9('0x43')]=function(_0xc4de77,_0x73dc0c){var _0x27898f={'raw':![],'where':{'id':_0xc4de77[_0x56f9('0x44')]['id']}},_0x2e8099={};_0x2e8099[_0x56f9('0x2e')]=_[_0x56f9('0x45')](db['ZendeskConfiguration'][_0x56f9('0x46')]);_0x2e8099[_0x56f9('0x30')]=_[_0x56f9('0x45')](_0xc4de77[_0x56f9('0x30')]);_0x2e8099[_0x56f9('0x31')]=_[_0x56f9('0x32')](_0x2e8099[_0x56f9('0x2e')],_0x2e8099[_0x56f9('0x30')]);_0x27898f[_0x56f9('0x34')]=_[_0x56f9('0x32')](_0x2e8099[_0x56f9('0x2e')],qs[_0x56f9('0x33')](_0xc4de77[_0x56f9('0x30')]['fields']));_0x27898f[_0x56f9('0x34')]=_0x27898f[_0x56f9('0x34')]['length']?_0x27898f['attributes']:_0x2e8099[_0x56f9('0x2e')];if(_0xc4de77[_0x56f9('0x30')][_0x56f9('0x47')]){_0x27898f[_0x56f9('0x3f')]=[{'all':!![]}];}_0x27898f=_['merge']({},_0x27898f,_0xc4de77[_0x56f9('0x3e')]);return db[_0x56f9('0x2b')][_0x56f9('0x48')](_0x27898f)[_0x56f9('0x25')](handleEntityNotFound(_0x73dc0c,null))[_0x56f9('0x25')](respondWithResult(_0x73dc0c,null))[_0x56f9('0x42')](handleError(_0x73dc0c,null));};exports['create']=function(_0x646aa4,_0x119c32){return db['ZendeskConfiguration'][_0x56f9('0x49')](_0x646aa4[_0x56f9('0x4a')],{})[_0x56f9('0x25')](respondWithResult(_0x119c32,0xc9))['catch'](handleError(_0x119c32,null));};exports[_0x56f9('0x4b')]=function(_0x5a1038,_0x1ca422){if(_0x5a1038[_0x56f9('0x4a')]['id']){delete _0x5a1038[_0x56f9('0x4a')]['id'];}return db[_0x56f9('0x2b')][_0x56f9('0x48')]({'where':{'id':_0x5a1038[_0x56f9('0x44')]['id']}})[_0x56f9('0x25')](handleEntityNotFound(_0x1ca422,null))[_0x56f9('0x25')](saveUpdates(_0x5a1038[_0x56f9('0x4a')],null))['then'](respondWithResult(_0x1ca422,null))[_0x56f9('0x42')](handleError(_0x1ca422,null));};exports[_0x56f9('0x26')]=function(_0x14537a,_0x18c20f){return db[_0x56f9('0x2b')][_0x56f9('0x48')]({'where':{'id':_0x14537a[_0x56f9('0x44')]['id']}})['then'](handleEntityNotFound(_0x18c20f,null))[_0x56f9('0x25')](removeEntity(_0x18c20f,null))[_0x56f9('0x42')](handleError(_0x18c20f,null));};exports[_0x56f9('0x4c')]=function(_0xe0aba3,_0x2a2dac,_0x5c25e0){var _0x34216b={};var _0x318e50={};var _0x3c63bb;var _0x155db9;return db[_0x56f9('0x2b')][_0x56f9('0x4d')]({'where':{'id':_0xe0aba3['params']['id']}})[_0x56f9('0x25')](handleEntityNotFound(_0x2a2dac,null))[_0x56f9('0x25')](function(_0x109ab0){if(_0x109ab0){_0x3c63bb=_0x109ab0;_0x318e50[_0x56f9('0x2e')]=_[_0x56f9('0x45')](db[_0x56f9('0x4e')][_0x56f9('0x46')]);_0x318e50[_0x56f9('0x30')]=_['keys'](_0xe0aba3[_0x56f9('0x30')]);_0x318e50[_0x56f9('0x31')]=_[_0x56f9('0x32')](_0x318e50[_0x56f9('0x2e')],_0x318e50[_0x56f9('0x30')]);_0x34216b[_0x56f9('0x34')]=_['intersection'](_0x318e50['model'],qs[_0x56f9('0x33')](_0xe0aba3[_0x56f9('0x30')]['fields']));_0x34216b[_0x56f9('0x34')]=_0x34216b[_0x56f9('0x34')][_0x56f9('0x35')]?_0x34216b[_0x56f9('0x34')]:_0x318e50[_0x56f9('0x2e')];_0x34216b[_0x56f9('0x38')]=qs[_0x56f9('0x39')](_0xe0aba3[_0x56f9('0x30')]['sort']);_0x34216b[_0x56f9('0x3a')]=qs[_0x56f9('0x31')](_[_0x56f9('0x3b')](_0xe0aba3[_0x56f9('0x30')],_0x318e50[_0x56f9('0x31')]));if(_0xe0aba3[_0x56f9('0x30')][_0x56f9('0x4f')]){_0x34216b[_0x56f9('0x3a')]=_['merge'](_0x34216b[_0x56f9('0x3a')],{'$or':_['map'](_0x34216b['attributes'],function(_0x5ccc5c){var _0x32800d={};_0x32800d[_0x5ccc5c]={'$like':'%'+_0xe0aba3[_0x56f9('0x30')][_0x56f9('0x4f')]+'%'};return _0x32800d;})});}_0x34216b=_[_0x56f9('0x3c')]({},_0x34216b,_0xe0aba3[_0x56f9('0x3e')]);return _0x3c63bb[_0x56f9('0x4c')](_0x34216b);}})['then'](function(_0x54b8e5){if(_0x54b8e5){_0x155db9=_0x54b8e5[_0x56f9('0x35')];if(!_0xe0aba3[_0x56f9('0x30')][_0x56f9('0x36')](_0x56f9('0x37'))){_0x34216b[_0x56f9('0x20')]=qs[_0x56f9('0x20')](_0xe0aba3['query'][_0x56f9('0x20')]);_0x34216b[_0x56f9('0x1d')]=qs['offset'](_0xe0aba3[_0x56f9('0x30')][_0x56f9('0x1d')]);}return _0x3c63bb[_0x56f9('0x4c')](_0x34216b);}})[_0x56f9('0x25')](function(_0x4b555a){if(_0x4b555a){return _0x4b555a?{'count':_0x155db9,'rows':_0x4b555a}:null;}})[_0x56f9('0x25')](respondWithResult(_0x2a2dac,null))[_0x56f9('0x42')](handleError(_0x2a2dac,null));};exports[_0x56f9('0x50')]=function(_0x1c9a6e,_0x14dd76,_0x178e20){var _0x7a2a0f={};var _0x5a3353={};var _0x18647a;var _0x1b2be4;return db[_0x56f9('0x2b')]['findOne']({'where':{'id':_0x1c9a6e[_0x56f9('0x44')]['id']}})['then'](handleEntityNotFound(_0x14dd76,null))[_0x56f9('0x25')](function(_0x3f6900){if(_0x3f6900){_0x18647a=_0x3f6900;_0x5a3353[_0x56f9('0x2e')]=_[_0x56f9('0x45')](db['ZendeskField'][_0x56f9('0x46')]);_0x5a3353[_0x56f9('0x30')]=_[_0x56f9('0x45')](_0x1c9a6e[_0x56f9('0x30')]);_0x5a3353[_0x56f9('0x31')]=_[_0x56f9('0x32')](_0x5a3353[_0x56f9('0x2e')],_0x5a3353[_0x56f9('0x30')]);_0x7a2a0f[_0x56f9('0x34')]=_[_0x56f9('0x32')](_0x5a3353[_0x56f9('0x2e')],qs[_0x56f9('0x33')](_0x1c9a6e[_0x56f9('0x30')][_0x56f9('0x33')]));_0x7a2a0f[_0x56f9('0x34')]=_0x7a2a0f['attributes'][_0x56f9('0x35')]?_0x7a2a0f[_0x56f9('0x34')]:_0x5a3353[_0x56f9('0x2e')];_0x7a2a0f[_0x56f9('0x38')]=qs[_0x56f9('0x39')](_0x1c9a6e[_0x56f9('0x30')][_0x56f9('0x39')]);_0x7a2a0f[_0x56f9('0x3a')]=qs[_0x56f9('0x31')](_['pick'](_0x1c9a6e['query'],_0x5a3353['filters']));if(_0x1c9a6e[_0x56f9('0x30')]['filter']){_0x7a2a0f[_0x56f9('0x3a')]=_[_0x56f9('0x3c')](_0x7a2a0f[_0x56f9('0x3a')],{'$or':_[_0x56f9('0x2f')](_0x7a2a0f['attributes'],function(_0xd9962f){var _0x2e3d4c={};_0x2e3d4c[_0xd9962f]={'$like':'%'+_0x1c9a6e[_0x56f9('0x30')]['filter']+'%'};return _0x2e3d4c;})});}_0x7a2a0f=_['merge']({},_0x7a2a0f,_0x1c9a6e[_0x56f9('0x3e')]);return _0x18647a['getSubjects'](_0x7a2a0f);}})[_0x56f9('0x25')](function(_0xc891f){if(_0xc891f){_0x1b2be4=_0xc891f['length'];if(!_0x1c9a6e['query'][_0x56f9('0x36')](_0x56f9('0x37'))){_0x7a2a0f[_0x56f9('0x20')]=qs[_0x56f9('0x20')](_0x1c9a6e['query']['limit']);_0x7a2a0f[_0x56f9('0x1d')]=qs[_0x56f9('0x1d')](_0x1c9a6e[_0x56f9('0x30')]['offset']);}return _0x18647a[_0x56f9('0x50')](_0x7a2a0f);}})['then'](function(_0x4890ba){if(_0x4890ba){return _0x4890ba?{'count':_0x1b2be4,'rows':_0x4890ba}:null;}})['then'](respondWithResult(_0x14dd76,null))[_0x56f9('0x42')](handleError(_0x14dd76,null));};exports[_0x56f9('0x51')]=function(_0x1685c3,_0x588820,_0x2d6745){var _0xcca18={};var _0x49e50d={};var _0x5e201c;var _0x507a6b;return db[_0x56f9('0x2b')][_0x56f9('0x4d')]({'where':{'id':_0x1685c3['params']['id']}})[_0x56f9('0x25')](handleEntityNotFound(_0x588820,null))[_0x56f9('0x25')](function(_0x4f58c1){if(_0x4f58c1){_0x5e201c=_0x4f58c1;_0x49e50d[_0x56f9('0x2e')]=_[_0x56f9('0x45')](db[_0x56f9('0x4e')]['rawAttributes']);_0x49e50d['query']=_[_0x56f9('0x45')](_0x1685c3[_0x56f9('0x30')]);_0x49e50d[_0x56f9('0x31')]=_[_0x56f9('0x32')](_0x49e50d[_0x56f9('0x2e')],_0x49e50d[_0x56f9('0x30')]);_0xcca18[_0x56f9('0x34')]=_[_0x56f9('0x32')](_0x49e50d['model'],qs['fields'](_0x1685c3[_0x56f9('0x30')][_0x56f9('0x33')]));_0xcca18[_0x56f9('0x34')]=_0xcca18[_0x56f9('0x34')][_0x56f9('0x35')]?_0xcca18['attributes']:_0x49e50d[_0x56f9('0x2e')];_0xcca18['order']=qs[_0x56f9('0x39')](_0x1685c3['query'][_0x56f9('0x39')]);_0xcca18['where']=qs[_0x56f9('0x31')](_[_0x56f9('0x3b')](_0x1685c3[_0x56f9('0x30')],_0x49e50d['filters']));if(_0x1685c3[_0x56f9('0x30')][_0x56f9('0x4f')]){_0xcca18['where']=_['merge'](_0xcca18['where'],{'$or':_[_0x56f9('0x2f')](_0xcca18[_0x56f9('0x34')],function(_0x10d26d){var _0xd5f611={};_0xd5f611[_0x10d26d]={'$like':'%'+_0x1685c3[_0x56f9('0x30')]['filter']+'%'};return _0xd5f611;})});}_0xcca18=_[_0x56f9('0x3c')]({},_0xcca18,_0x1685c3[_0x56f9('0x3e')]);return _0x5e201c[_0x56f9('0x51')](_0xcca18);}})['then'](function(_0x5812b0){if(_0x5812b0){_0x507a6b=_0x5812b0[_0x56f9('0x35')];if(!_0x1685c3[_0x56f9('0x30')]['hasOwnProperty'](_0x56f9('0x37'))){_0xcca18[_0x56f9('0x20')]=qs[_0x56f9('0x20')](_0x1685c3[_0x56f9('0x30')]['limit']);_0xcca18['offset']=qs[_0x56f9('0x1d')](_0x1685c3[_0x56f9('0x30')]['offset']);}return _0x5e201c[_0x56f9('0x51')](_0xcca18);}})[_0x56f9('0x25')](function(_0x258bbc){if(_0x258bbc){return _0x258bbc?{'count':_0x507a6b,'rows':_0x258bbc}:null;}})[_0x56f9('0x25')](respondWithResult(_0x588820,null))[_0x56f9('0x42')](handleError(_0x588820,null));};exports[_0x56f9('0x52')]=function(_0x4e5fbb,_0x120fe9,_0x104d90){var _0x514f63={};var _0x4c9478={};var _0x2ec14e;var _0x43c26d;return db[_0x56f9('0x2b')][_0x56f9('0x4d')]({'where':{'id':_0x4e5fbb[_0x56f9('0x44')]['id']}})[_0x56f9('0x25')](handleEntityNotFound(_0x120fe9,null))[_0x56f9('0x25')](function(_0x5839bf){if(_0x5839bf){_0x2ec14e=_0x5839bf;_0x4c9478['model']=_[_0x56f9('0x45')](db[_0x56f9('0x53')][_0x56f9('0x46')]);_0x4c9478[_0x56f9('0x30')]=_[_0x56f9('0x45')](_0x4e5fbb['query']);_0x4c9478[_0x56f9('0x31')]=_[_0x56f9('0x32')](_0x4c9478[_0x56f9('0x2e')],_0x4c9478['query']);_0x514f63[_0x56f9('0x34')]=_['intersection'](_0x4c9478[_0x56f9('0x2e')],qs[_0x56f9('0x33')](_0x4e5fbb[_0x56f9('0x30')][_0x56f9('0x33')]));_0x514f63['attributes']=_0x514f63['attributes'][_0x56f9('0x35')]?_0x514f63[_0x56f9('0x34')]:_0x4c9478[_0x56f9('0x2e')];_0x514f63['order']=qs[_0x56f9('0x39')](_0x4e5fbb[_0x56f9('0x30')]['sort']);_0x514f63[_0x56f9('0x3a')]=qs[_0x56f9('0x31')](_[_0x56f9('0x3b')](_0x4e5fbb['query'],_0x4c9478[_0x56f9('0x31')]));if(_0x4e5fbb[_0x56f9('0x30')][_0x56f9('0x4f')]){_0x514f63[_0x56f9('0x3a')]=_[_0x56f9('0x3c')](_0x514f63[_0x56f9('0x3a')],{'$or':_[_0x56f9('0x2f')](_0x514f63[_0x56f9('0x34')],function(_0x31041c){var _0x3e3ad7={};_0x3e3ad7[_0x31041c]={'$like':'%'+_0x4e5fbb['query'][_0x56f9('0x4f')]+'%'};return _0x3e3ad7;})});}_0x514f63=_[_0x56f9('0x3c')]({},_0x514f63,_0x4e5fbb[_0x56f9('0x3e')]);return _0x2ec14e[_0x56f9('0x52')](_0x514f63);}})[_0x56f9('0x25')](function(_0x46ce09){if(_0x46ce09){_0x43c26d=_0x46ce09['length'];if(!_0x4e5fbb[_0x56f9('0x30')][_0x56f9('0x36')]('nolimit')){_0x514f63['limit']=qs[_0x56f9('0x20')](_0x4e5fbb['query']['limit']);_0x514f63['offset']=qs['offset'](_0x4e5fbb[_0x56f9('0x30')][_0x56f9('0x1d')]);}return _0x2ec14e[_0x56f9('0x52')](_0x514f63);}})[_0x56f9('0x25')](function(_0x5d62bb){if(_0x5d62bb){return _0x5d62bb?{'count':_0x43c26d,'rows':_0x5d62bb}:null;}})['then'](respondWithResult(_0x120fe9,null))[_0x56f9('0x42')](handleError(_0x120fe9,null));};exports['setTags']=function(_0x362f25,_0x2b6ad6,_0x4a6ab7){if(_0x362f25[_0x56f9('0x4a')]['id']){delete _0x362f25[_0x56f9('0x4a')]['id'];}return db[_0x56f9('0x2b')]['findOne']({'where':{'id':_0x362f25[_0x56f9('0x44')]['id']}})[_0x56f9('0x25')](handleEntityNotFound(_0x2b6ad6,null))['then'](function(_0x185c17){if(_0x185c17){return _0x185c17['setTags'](_0x362f25[_0x56f9('0x4a')][_0x56f9('0x54')]||[]);}return null;})[_0x56f9('0x25')](respondWithResult(_0x2b6ad6,null))[_0x56f9('0x42')](handleError(_0x2b6ad6,null));}; \ No newline at end of file +var _0x6f9c=['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','offset','undefined','limit','count','set','json','reject','save','update','then','destroy','end','name','send','index','map','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','VIRTUAL','filter','merge','ZendeskConfiguration','includeAll','include','rows','catch','show','params','rawAttributes','options','create','body','find','getFields','findOne','ZendeskField','pick','getSubjects','getDescriptions','getTags','Tag','setTags','ids','rimraf','fast-json-patch','moment','bluebird','mustache','path','to-csv','ejs','lodash','squel'];(function(_0x13f3e2,_0x35a070){var _0x50e06d=function(_0x27dcd4){while(--_0x27dcd4){_0x13f3e2['push'](_0x13f3e2['shift']());}};_0x50e06d(++_0x35a070);}(_0x6f9c,0xec));var _0xc6f9=function(_0x58e484,_0x5549fb){_0x58e484=_0x58e484-0x0;var _0x4f2e96=_0x6f9c[_0x58e484];return _0x4f2e96;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc6f9('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc6f9('0x1'));var rp=require('request-promise');var moment=require(_0xc6f9('0x2'));var BPromise=require(_0xc6f9('0x3'));var Mustache=require(_0xc6f9('0x4'));var util=require('util');var path=require(_0xc6f9('0x5'));var sox=require('sox');var csv=require(_0xc6f9('0x6'));var ejs=require(_0xc6f9('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc6f9('0x8'));var squel=require(_0xc6f9('0x9'));var crypto=require('crypto');var jsforce=require(_0xc6f9('0xa'));var deskjs=require(_0xc6f9('0xb'));var toCsv=require(_0xc6f9('0x6'));var querystring=require(_0xc6f9('0xc'));var Papa=require(_0xc6f9('0xd'));var Redis=require('ioredis');var authService=require(_0xc6f9('0xe'));var qs=require(_0xc6f9('0xf'));var as=require(_0xc6f9('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc6f9('0x11'))(_0xc6f9('0x12'));var utils=require(_0xc6f9('0x13'));var config=require(_0xc6f9('0x14'));var licenseUtil=require(_0xc6f9('0x15'));var db=require(_0xc6f9('0x16'))['db'];function respondWithStatusCode(_0x51a6d9,_0x35e14b){_0x35e14b=_0x35e14b||0xcc;return function(_0x49bb77){if(_0x49bb77){return _0x51a6d9[_0xc6f9('0x17')](_0x35e14b);}return _0x51a6d9[_0xc6f9('0x18')](_0x35e14b)['end']();};}function respondWithResult(_0x3dfdbd,_0x39cbcb){_0x39cbcb=_0x39cbcb||0xc8;return function(_0x438fbf){if(_0x438fbf){return _0x3dfdbd['status'](_0x39cbcb)['json'](_0x438fbf);}};}function respondWithFilteredResult(_0x32e688,_0x2883b7){return function(_0x2442f2){if(_0x2442f2){var _0x121c75=typeof _0x2883b7[_0xc6f9('0x19')]===_0xc6f9('0x1a')&&typeof _0x2883b7[_0xc6f9('0x1b')]===_0xc6f9('0x1a');var _0x2a857f=_0x2442f2[_0xc6f9('0x1c')];var _0x9729c7=_0x121c75?0x0:_0x2883b7['offset'];var _0x54582b=_0x121c75?_0x2442f2[_0xc6f9('0x1c')]:_0x2883b7[_0xc6f9('0x19')]+_0x2883b7[_0xc6f9('0x1b')];var _0x48ba1e;if(_0x54582b>=_0x2a857f){_0x54582b=_0x2a857f;_0x48ba1e=0xc8;}else{_0x48ba1e=0xce;}_0x32e688['status'](_0x48ba1e);return _0x32e688[_0xc6f9('0x1d')]('Content-Range',_0x9729c7+'-'+_0x54582b+'/'+_0x2a857f)[_0xc6f9('0x1e')](_0x2442f2);}return null;};}function patchUpdates(_0xa3ed3f){return function(_0x56d716){try{jsonpatch['apply'](_0x56d716,_0xa3ed3f,!![]);}catch(_0x3b5033){return BPromise[_0xc6f9('0x1f')](_0x3b5033);}return _0x56d716[_0xc6f9('0x20')]();};}function saveUpdates(_0x1b2327,_0x4cd237){return function(_0x316026){if(_0x316026){return _0x316026[_0xc6f9('0x21')](_0x1b2327)[_0xc6f9('0x22')](function(_0x171eea){return _0x171eea;});}return null;};}function removeEntity(_0x2a20f9,_0x148ad2){return function(_0x24d55f){if(_0x24d55f){return _0x24d55f[_0xc6f9('0x23')]()[_0xc6f9('0x22')](function(){_0x2a20f9[_0xc6f9('0x18')](0xcc)[_0xc6f9('0x24')]();});}};}function handleEntityNotFound(_0x490d01,_0x4cfc5a){return function(_0x5685d0){if(!_0x5685d0){_0x490d01[_0xc6f9('0x17')](0x194);}return _0x5685d0;};}function handleError(_0x2227d2,_0x5d42dc){_0x5d42dc=_0x5d42dc||0x1f4;return function(_0x394e1e){logger['error'](_0x394e1e['stack']);if(_0x394e1e[_0xc6f9('0x25')]){delete _0x394e1e['name'];}_0x2227d2[_0xc6f9('0x18')](_0x5d42dc)[_0xc6f9('0x26')](_0x394e1e);};}exports[_0xc6f9('0x27')]=function(_0x99b8f0,_0x5aac42){var _0x3c4477={},_0x258478={},_0x11c0b={'count':0x0,'rows':[]};var _0x279755=_[_0xc6f9('0x28')](db['ZendeskConfiguration']['rawAttributes'],function(_0x513204){return{'name':_0x513204[_0xc6f9('0x29')],'type':_0x513204[_0xc6f9('0x2a')][_0xc6f9('0x2b')]};});_0x258478[_0xc6f9('0x2c')]=_[_0xc6f9('0x28')](_0x279755,'name');_0x258478[_0xc6f9('0x2d')]=_[_0xc6f9('0x2e')](_0x99b8f0['query']);_0x258478[_0xc6f9('0x2f')]=_[_0xc6f9('0x30')](_0x258478[_0xc6f9('0x2c')],_0x258478[_0xc6f9('0x2d')]);_0x3c4477[_0xc6f9('0x31')]=_['intersection'](_0x258478[_0xc6f9('0x2c')],qs[_0xc6f9('0x32')](_0x99b8f0[_0xc6f9('0x2d')]['fields']));_0x3c4477[_0xc6f9('0x31')]=_0x3c4477[_0xc6f9('0x31')][_0xc6f9('0x33')]?_0x3c4477[_0xc6f9('0x31')]:_0x258478[_0xc6f9('0x2c')];if(!_0x99b8f0[_0xc6f9('0x2d')][_0xc6f9('0x34')](_0xc6f9('0x35'))){_0x3c4477['limit']=qs[_0xc6f9('0x1b')](_0x99b8f0[_0xc6f9('0x2d')]['limit']);_0x3c4477[_0xc6f9('0x19')]=qs[_0xc6f9('0x19')](_0x99b8f0['query'][_0xc6f9('0x19')]);}_0x3c4477[_0xc6f9('0x36')]=qs[_0xc6f9('0x37')](_0x99b8f0['query'][_0xc6f9('0x37')]);_0x3c4477[_0xc6f9('0x38')]=qs[_0xc6f9('0x2f')](_['pick'](_0x99b8f0['query'],_0x258478[_0xc6f9('0x2f')]),_0x279755);if(_0x99b8f0[_0xc6f9('0x2d')]['filter']){_0x3c4477['where']=_['merge'](_0x3c4477[_0xc6f9('0x38')],{'$or':_[_0xc6f9('0x28')](_0x279755,function(_0x4a4e86){if(_0x4a4e86[_0xc6f9('0x2a')]!==_0xc6f9('0x39')){var _0x686667={};_0x686667[_0x4a4e86[_0xc6f9('0x25')]]={'$like':'%'+_0x99b8f0[_0xc6f9('0x2d')][_0xc6f9('0x3a')]+'%'};return _0x686667;}})});}_0x3c4477=_[_0xc6f9('0x3b')]({},_0x3c4477,_0x99b8f0['options']);var _0x4b3816={'where':_0x3c4477[_0xc6f9('0x38')]};return db[_0xc6f9('0x3c')]['count'](_0x4b3816)[_0xc6f9('0x22')](function(_0x9d4d69){_0x11c0b[_0xc6f9('0x1c')]=_0x9d4d69;if(_0x99b8f0[_0xc6f9('0x2d')][_0xc6f9('0x3d')]){_0x3c4477[_0xc6f9('0x3e')]=[{'all':!![]}];}return db[_0xc6f9('0x3c')]['findAll'](_0x3c4477);})[_0xc6f9('0x22')](function(_0x2646f1){_0x11c0b[_0xc6f9('0x3f')]=_0x2646f1;return _0x11c0b;})[_0xc6f9('0x22')](respondWithFilteredResult(_0x5aac42,_0x3c4477))[_0xc6f9('0x40')](handleError(_0x5aac42,null));};exports[_0xc6f9('0x41')]=function(_0x47ac6c,_0x3c5421){var _0x1503d0={'raw':![],'where':{'id':_0x47ac6c[_0xc6f9('0x42')]['id']}},_0x2a5f66={};_0x2a5f66[_0xc6f9('0x2c')]=_[_0xc6f9('0x2e')](db['ZendeskConfiguration'][_0xc6f9('0x43')]);_0x2a5f66[_0xc6f9('0x2d')]=_[_0xc6f9('0x2e')](_0x47ac6c[_0xc6f9('0x2d')]);_0x2a5f66[_0xc6f9('0x2f')]=_[_0xc6f9('0x30')](_0x2a5f66['model'],_0x2a5f66['query']);_0x1503d0[_0xc6f9('0x31')]=_[_0xc6f9('0x30')](_0x2a5f66['model'],qs['fields'](_0x47ac6c[_0xc6f9('0x2d')][_0xc6f9('0x32')]));_0x1503d0[_0xc6f9('0x31')]=_0x1503d0[_0xc6f9('0x31')]['length']?_0x1503d0['attributes']:_0x2a5f66['model'];if(_0x47ac6c[_0xc6f9('0x2d')]['includeAll']){_0x1503d0[_0xc6f9('0x3e')]=[{'all':!![]}];}_0x1503d0=_[_0xc6f9('0x3b')]({},_0x1503d0,_0x47ac6c[_0xc6f9('0x44')]);return db[_0xc6f9('0x3c')]['find'](_0x1503d0)[_0xc6f9('0x22')](handleEntityNotFound(_0x3c5421,null))[_0xc6f9('0x22')](respondWithResult(_0x3c5421,null))['catch'](handleError(_0x3c5421,null));};exports[_0xc6f9('0x45')]=function(_0x47f6af,_0x8c7966){return db[_0xc6f9('0x3c')][_0xc6f9('0x45')](_0x47f6af['body'],{})['then'](respondWithResult(_0x8c7966,0xc9))[_0xc6f9('0x40')](handleError(_0x8c7966,null));};exports['update']=function(_0x22bd21,_0x2bb884){if(_0x22bd21[_0xc6f9('0x46')]['id']){delete _0x22bd21['body']['id'];}return db['ZendeskConfiguration'][_0xc6f9('0x47')]({'where':{'id':_0x22bd21[_0xc6f9('0x42')]['id']}})[_0xc6f9('0x22')](handleEntityNotFound(_0x2bb884,null))['then'](saveUpdates(_0x22bd21[_0xc6f9('0x46')],null))[_0xc6f9('0x22')](respondWithResult(_0x2bb884,null))[_0xc6f9('0x40')](handleError(_0x2bb884,null));};exports[_0xc6f9('0x23')]=function(_0x17932d,_0xd589c4){return db[_0xc6f9('0x3c')]['find']({'where':{'id':_0x17932d[_0xc6f9('0x42')]['id']}})[_0xc6f9('0x22')](handleEntityNotFound(_0xd589c4,null))[_0xc6f9('0x22')](removeEntity(_0xd589c4,null))['catch'](handleError(_0xd589c4,null));};exports[_0xc6f9('0x48')]=function(_0x3d2c11,_0x1d3aad,_0xba9cd8){var _0x39441c={};var _0x34451f={};var _0x5c5145;var _0x5ccf26;return db[_0xc6f9('0x3c')][_0xc6f9('0x49')]({'where':{'id':_0x3d2c11[_0xc6f9('0x42')]['id']}})[_0xc6f9('0x22')](handleEntityNotFound(_0x1d3aad,null))['then'](function(_0x2d28c7){if(_0x2d28c7){_0x5c5145=_0x2d28c7;_0x34451f[_0xc6f9('0x2c')]=_['keys'](db[_0xc6f9('0x4a')][_0xc6f9('0x43')]);_0x34451f[_0xc6f9('0x2d')]=_[_0xc6f9('0x2e')](_0x3d2c11['query']);_0x34451f[_0xc6f9('0x2f')]=_[_0xc6f9('0x30')](_0x34451f[_0xc6f9('0x2c')],_0x34451f[_0xc6f9('0x2d')]);_0x39441c['attributes']=_[_0xc6f9('0x30')](_0x34451f[_0xc6f9('0x2c')],qs[_0xc6f9('0x32')](_0x3d2c11['query'][_0xc6f9('0x32')]));_0x39441c[_0xc6f9('0x31')]=_0x39441c['attributes'][_0xc6f9('0x33')]?_0x39441c[_0xc6f9('0x31')]:_0x34451f[_0xc6f9('0x2c')];_0x39441c[_0xc6f9('0x36')]=qs[_0xc6f9('0x37')](_0x3d2c11[_0xc6f9('0x2d')][_0xc6f9('0x37')]);_0x39441c[_0xc6f9('0x38')]=qs[_0xc6f9('0x2f')](_[_0xc6f9('0x4b')](_0x3d2c11[_0xc6f9('0x2d')],_0x34451f[_0xc6f9('0x2f')]));if(_0x3d2c11[_0xc6f9('0x2d')][_0xc6f9('0x3a')]){_0x39441c[_0xc6f9('0x38')]=_[_0xc6f9('0x3b')](_0x39441c['where'],{'$or':_[_0xc6f9('0x28')](_0x39441c[_0xc6f9('0x31')],function(_0x5631d1){var _0x20be45={};_0x20be45[_0x5631d1]={'$like':'%'+_0x3d2c11[_0xc6f9('0x2d')][_0xc6f9('0x3a')]+'%'};return _0x20be45;})});}_0x39441c=_[_0xc6f9('0x3b')]({},_0x39441c,_0x3d2c11[_0xc6f9('0x44')]);return _0x5c5145['getFields'](_0x39441c);}})['then'](function(_0x2415d2){if(_0x2415d2){_0x5ccf26=_0x2415d2[_0xc6f9('0x33')];if(!_0x3d2c11[_0xc6f9('0x2d')][_0xc6f9('0x34')](_0xc6f9('0x35'))){_0x39441c[_0xc6f9('0x1b')]=qs['limit'](_0x3d2c11['query'][_0xc6f9('0x1b')]);_0x39441c[_0xc6f9('0x19')]=qs[_0xc6f9('0x19')](_0x3d2c11[_0xc6f9('0x2d')][_0xc6f9('0x19')]);}return _0x5c5145[_0xc6f9('0x48')](_0x39441c);}})[_0xc6f9('0x22')](function(_0x1e7b20){if(_0x1e7b20){return _0x1e7b20?{'count':_0x5ccf26,'rows':_0x1e7b20}:null;}})['then'](respondWithResult(_0x1d3aad,null))['catch'](handleError(_0x1d3aad,null));};exports[_0xc6f9('0x4c')]=function(_0x10c88b,_0x2d2917,_0x34ba46){var _0x4efd0a={};var _0x2d5753={};var _0x148cd9;var _0x475580;return db[_0xc6f9('0x3c')][_0xc6f9('0x49')]({'where':{'id':_0x10c88b[_0xc6f9('0x42')]['id']}})[_0xc6f9('0x22')](handleEntityNotFound(_0x2d2917,null))[_0xc6f9('0x22')](function(_0xf48e29){if(_0xf48e29){_0x148cd9=_0xf48e29;_0x2d5753['model']=_[_0xc6f9('0x2e')](db[_0xc6f9('0x4a')][_0xc6f9('0x43')]);_0x2d5753[_0xc6f9('0x2d')]=_[_0xc6f9('0x2e')](_0x10c88b[_0xc6f9('0x2d')]);_0x2d5753[_0xc6f9('0x2f')]=_[_0xc6f9('0x30')](_0x2d5753[_0xc6f9('0x2c')],_0x2d5753[_0xc6f9('0x2d')]);_0x4efd0a[_0xc6f9('0x31')]=_[_0xc6f9('0x30')](_0x2d5753[_0xc6f9('0x2c')],qs[_0xc6f9('0x32')](_0x10c88b[_0xc6f9('0x2d')][_0xc6f9('0x32')]));_0x4efd0a[_0xc6f9('0x31')]=_0x4efd0a[_0xc6f9('0x31')][_0xc6f9('0x33')]?_0x4efd0a[_0xc6f9('0x31')]:_0x2d5753[_0xc6f9('0x2c')];_0x4efd0a['order']=qs['sort'](_0x10c88b[_0xc6f9('0x2d')]['sort']);_0x4efd0a[_0xc6f9('0x38')]=qs['filters'](_['pick'](_0x10c88b['query'],_0x2d5753[_0xc6f9('0x2f')]));if(_0x10c88b[_0xc6f9('0x2d')][_0xc6f9('0x3a')]){_0x4efd0a[_0xc6f9('0x38')]=_[_0xc6f9('0x3b')](_0x4efd0a[_0xc6f9('0x38')],{'$or':_[_0xc6f9('0x28')](_0x4efd0a[_0xc6f9('0x31')],function(_0x919d74){var _0x2055c7={};_0x2055c7[_0x919d74]={'$like':'%'+_0x10c88b['query'][_0xc6f9('0x3a')]+'%'};return _0x2055c7;})});}_0x4efd0a=_['merge']({},_0x4efd0a,_0x10c88b[_0xc6f9('0x44')]);return _0x148cd9[_0xc6f9('0x4c')](_0x4efd0a);}})[_0xc6f9('0x22')](function(_0x3d56d6){if(_0x3d56d6){_0x475580=_0x3d56d6[_0xc6f9('0x33')];if(!_0x10c88b[_0xc6f9('0x2d')]['hasOwnProperty'](_0xc6f9('0x35'))){_0x4efd0a[_0xc6f9('0x1b')]=qs[_0xc6f9('0x1b')](_0x10c88b[_0xc6f9('0x2d')][_0xc6f9('0x1b')]);_0x4efd0a[_0xc6f9('0x19')]=qs[_0xc6f9('0x19')](_0x10c88b[_0xc6f9('0x2d')][_0xc6f9('0x19')]);}return _0x148cd9['getSubjects'](_0x4efd0a);}})['then'](function(_0x247d1e){if(_0x247d1e){return _0x247d1e?{'count':_0x475580,'rows':_0x247d1e}:null;}})[_0xc6f9('0x22')](respondWithResult(_0x2d2917,null))[_0xc6f9('0x40')](handleError(_0x2d2917,null));};exports[_0xc6f9('0x4d')]=function(_0x44bab3,_0x1f03d8,_0x2cd016){var _0x420820={};var _0xe98661={};var _0x16d405;var _0x44075a;return db[_0xc6f9('0x3c')][_0xc6f9('0x49')]({'where':{'id':_0x44bab3[_0xc6f9('0x42')]['id']}})[_0xc6f9('0x22')](handleEntityNotFound(_0x1f03d8,null))['then'](function(_0x3649f9){if(_0x3649f9){_0x16d405=_0x3649f9;_0xe98661[_0xc6f9('0x2c')]=_[_0xc6f9('0x2e')](db['ZendeskField'][_0xc6f9('0x43')]);_0xe98661[_0xc6f9('0x2d')]=_[_0xc6f9('0x2e')](_0x44bab3[_0xc6f9('0x2d')]);_0xe98661[_0xc6f9('0x2f')]=_[_0xc6f9('0x30')](_0xe98661[_0xc6f9('0x2c')],_0xe98661[_0xc6f9('0x2d')]);_0x420820[_0xc6f9('0x31')]=_[_0xc6f9('0x30')](_0xe98661[_0xc6f9('0x2c')],qs['fields'](_0x44bab3['query'][_0xc6f9('0x32')]));_0x420820['attributes']=_0x420820[_0xc6f9('0x31')][_0xc6f9('0x33')]?_0x420820[_0xc6f9('0x31')]:_0xe98661['model'];_0x420820[_0xc6f9('0x36')]=qs[_0xc6f9('0x37')](_0x44bab3['query'][_0xc6f9('0x37')]);_0x420820[_0xc6f9('0x38')]=qs[_0xc6f9('0x2f')](_[_0xc6f9('0x4b')](_0x44bab3[_0xc6f9('0x2d')],_0xe98661[_0xc6f9('0x2f')]));if(_0x44bab3[_0xc6f9('0x2d')][_0xc6f9('0x3a')]){_0x420820['where']=_['merge'](_0x420820[_0xc6f9('0x38')],{'$or':_[_0xc6f9('0x28')](_0x420820['attributes'],function(_0x254ab6){var _0x19e2aa={};_0x19e2aa[_0x254ab6]={'$like':'%'+_0x44bab3[_0xc6f9('0x2d')][_0xc6f9('0x3a')]+'%'};return _0x19e2aa;})});}_0x420820=_['merge']({},_0x420820,_0x44bab3[_0xc6f9('0x44')]);return _0x16d405['getDescriptions'](_0x420820);}})['then'](function(_0x27f3d2){if(_0x27f3d2){_0x44075a=_0x27f3d2['length'];if(!_0x44bab3['query'][_0xc6f9('0x34')](_0xc6f9('0x35'))){_0x420820[_0xc6f9('0x1b')]=qs[_0xc6f9('0x1b')](_0x44bab3['query'][_0xc6f9('0x1b')]);_0x420820[_0xc6f9('0x19')]=qs[_0xc6f9('0x19')](_0x44bab3['query'][_0xc6f9('0x19')]);}return _0x16d405[_0xc6f9('0x4d')](_0x420820);}})[_0xc6f9('0x22')](function(_0xadc955){if(_0xadc955){return _0xadc955?{'count':_0x44075a,'rows':_0xadc955}:null;}})[_0xc6f9('0x22')](respondWithResult(_0x1f03d8,null))[_0xc6f9('0x40')](handleError(_0x1f03d8,null));};exports[_0xc6f9('0x4e')]=function(_0x419d38,_0x5e6b08,_0xebaa2){var _0x1c9e6d={};var _0x18d4de={};var _0x5b8a5c;var _0x4779d6;return db['ZendeskConfiguration'][_0xc6f9('0x49')]({'where':{'id':_0x419d38[_0xc6f9('0x42')]['id']}})[_0xc6f9('0x22')](handleEntityNotFound(_0x5e6b08,null))[_0xc6f9('0x22')](function(_0x4a6a73){if(_0x4a6a73){_0x5b8a5c=_0x4a6a73;_0x18d4de['model']=_[_0xc6f9('0x2e')](db[_0xc6f9('0x4f')]['rawAttributes']);_0x18d4de['query']=_[_0xc6f9('0x2e')](_0x419d38[_0xc6f9('0x2d')]);_0x18d4de['filters']=_[_0xc6f9('0x30')](_0x18d4de[_0xc6f9('0x2c')],_0x18d4de[_0xc6f9('0x2d')]);_0x1c9e6d[_0xc6f9('0x31')]=_[_0xc6f9('0x30')](_0x18d4de['model'],qs[_0xc6f9('0x32')](_0x419d38[_0xc6f9('0x2d')]['fields']));_0x1c9e6d[_0xc6f9('0x31')]=_0x1c9e6d['attributes']['length']?_0x1c9e6d['attributes']:_0x18d4de[_0xc6f9('0x2c')];_0x1c9e6d['order']=qs[_0xc6f9('0x37')](_0x419d38[_0xc6f9('0x2d')][_0xc6f9('0x37')]);_0x1c9e6d['where']=qs[_0xc6f9('0x2f')](_[_0xc6f9('0x4b')](_0x419d38[_0xc6f9('0x2d')],_0x18d4de[_0xc6f9('0x2f')]));if(_0x419d38[_0xc6f9('0x2d')]['filter']){_0x1c9e6d[_0xc6f9('0x38')]=_[_0xc6f9('0x3b')](_0x1c9e6d['where'],{'$or':_[_0xc6f9('0x28')](_0x1c9e6d['attributes'],function(_0x374a4f){var _0x200893={};_0x200893[_0x374a4f]={'$like':'%'+_0x419d38['query'][_0xc6f9('0x3a')]+'%'};return _0x200893;})});}_0x1c9e6d=_[_0xc6f9('0x3b')]({},_0x1c9e6d,_0x419d38[_0xc6f9('0x44')]);return _0x5b8a5c[_0xc6f9('0x4e')](_0x1c9e6d);}})[_0xc6f9('0x22')](function(_0x27b35b){if(_0x27b35b){_0x4779d6=_0x27b35b[_0xc6f9('0x33')];if(!_0x419d38[_0xc6f9('0x2d')][_0xc6f9('0x34')]('nolimit')){_0x1c9e6d['limit']=qs[_0xc6f9('0x1b')](_0x419d38[_0xc6f9('0x2d')][_0xc6f9('0x1b')]);_0x1c9e6d[_0xc6f9('0x19')]=qs['offset'](_0x419d38['query'][_0xc6f9('0x19')]);}return _0x5b8a5c[_0xc6f9('0x4e')](_0x1c9e6d);}})[_0xc6f9('0x22')](function(_0x498c94){if(_0x498c94){return _0x498c94?{'count':_0x4779d6,'rows':_0x498c94}:null;}})[_0xc6f9('0x22')](respondWithResult(_0x5e6b08,null))[_0xc6f9('0x40')](handleError(_0x5e6b08,null));};exports[_0xc6f9('0x50')]=function(_0x3e650e,_0x47ca2d,_0x49c4b6){if(_0x3e650e[_0xc6f9('0x46')]['id']){delete _0x3e650e[_0xc6f9('0x46')]['id'];}return db[_0xc6f9('0x3c')][_0xc6f9('0x49')]({'where':{'id':_0x3e650e[_0xc6f9('0x42')]['id']}})[_0xc6f9('0x22')](handleEntityNotFound(_0x47ca2d,null))[_0xc6f9('0x22')](function(_0x41b576){if(_0x41b576){return _0x41b576[_0xc6f9('0x50')](_0x3e650e[_0xc6f9('0x46')][_0xc6f9('0x51')]||[]);}return null;})[_0xc6f9('0x22')](respondWithResult(_0x47ca2d,null))['catch'](handleError(_0x47ca2d,null));}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js index 1d91a38..1d06a48 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 _0xb9be=['path','rimraf','exports','ZendeskConfiguration','int_zendesk_configurations','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x2d7ab1,_0x39fc08){var _0x22b255=function(_0x4e6bdf){while(--_0x4e6bdf){_0x2d7ab1['push'](_0x2d7ab1['shift']());}};_0x22b255(++_0x39fc08);}(_0xb9be,0xc5));var _0xeb9b=function(_0x469a3c,_0x5ebc10){_0x469a3c=_0x469a3c-0x0;var _0x968f4=_0xb9be[_0x469a3c];return _0x968f4;};'use strict';var _=require(_0xeb9b('0x0'));var util=require(_0xeb9b('0x1'));var logger=require(_0xeb9b('0x2'))(_0xeb9b('0x3'));var moment=require(_0xeb9b('0x4'));var BPromise=require(_0xeb9b('0x5'));var rp=require(_0xeb9b('0x6'));var fs=require('fs');var path=require(_0xeb9b('0x7'));var rimraf=require(_0xeb9b('0x8'));var config=require('../../config/environment');var attributes=require('./intZendeskConfiguration.attributes');module[_0xeb9b('0x9')]=function(_0x181810,_0x2529cb){return _0x181810['define'](_0xeb9b('0xa'),attributes,{'tableName':_0xeb9b('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdb94=['lodash','util','../../config/logger','api','moment','request-promise','path','./intZendeskConfiguration.attributes','ZendeskConfiguration'];(function(_0x494965,_0x48ace5){var _0x3e682e=function(_0x463373){while(--_0x463373){_0x494965['push'](_0x494965['shift']());}};_0x3e682e(++_0x48ace5);}(_0xdb94,0xab));var _0x4db9=function(_0x54c408,_0x219fdf){_0x54c408=_0x54c408-0x0;var _0x45ae13=_0xdb94[_0x54c408];return _0x45ae13;};'use strict';var _=require(_0x4db9('0x0'));var util=require(_0x4db9('0x1'));var logger=require(_0x4db9('0x2'))(_0x4db9('0x3'));var moment=require(_0x4db9('0x4'));var BPromise=require('bluebird');var rp=require(_0x4db9('0x5'));var fs=require('fs');var path=require(_0x4db9('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x4db9('0x7'));module['exports']=function(_0x47a3f5,_0x31dd9f){return _0x47a3f5['define'](_0x4db9('0x8'),attributes,{'tableName':'int_zendesk_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.rpc.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.rpc.js index 9a3d895..1514885 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 _0x45ad=['result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','request\x20sent','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','ZendeskConfiguration,\x20%s,\x20%s','message','info'];(function(_0x5f1203,_0x2d995e){var _0x406e95=function(_0x20f035){while(--_0x20f035){_0x5f1203['push'](_0x5f1203['shift']());}};_0x406e95(++_0x2d995e);}(_0x45ad,0x12e));var _0xd45a=function(_0x20be28,_0x24b925){_0x20be28=_0x20be28-0x0;var _0x8ab067=_0x45ad[_0x20be28];return _0x8ab067;};'use strict';var _=require(_0xd45a('0x0'));var util=require('util');var moment=require(_0xd45a('0x1'));var BPromise=require(_0xd45a('0x2'));var rs=require(_0xd45a('0x3'));var fs=require('fs');var Redis=require(_0xd45a('0x4'));var db=require(_0xd45a('0x5'))['db'];var utils=require(_0xd45a('0x6'));var logger=require(_0xd45a('0x7'))(_0xd45a('0x8'));var config=require(_0xd45a('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xd45a('0xa')][_0xd45a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x266c71,_0x1d470b,_0x236607){return new BPromise(function(_0x5587ef,_0x15da1c){return client[_0xd45a('0xc')](_0x266c71,_0x236607)[_0xd45a('0xd')](function(_0x48fb35){logger['info']('ZendeskConfiguration,\x20%s,\x20%s',_0x1d470b,_0xd45a('0xe'));logger[_0xd45a('0xf')](_0xd45a('0x10'),_0x1d470b,_0xd45a('0xe'),JSON[_0xd45a('0x11')](_0x48fb35));if(_0x48fb35[_0xd45a('0x12')]){if(_0x48fb35[_0xd45a('0x12')][_0xd45a('0x13')]===0x1f4){logger[_0xd45a('0x12')](_0xd45a('0x14'),_0x1d470b,_0x48fb35[_0xd45a('0x12')][_0xd45a('0x15')]);return _0x15da1c(_0x48fb35[_0xd45a('0x12')][_0xd45a('0x15')]);}logger[_0xd45a('0x12')](_0xd45a('0x14'),_0x1d470b,_0x48fb35[_0xd45a('0x12')][_0xd45a('0x15')]);return _0x5587ef(_0x48fb35[_0xd45a('0x12')][_0xd45a('0x15')]);}else{logger[_0xd45a('0x16')](_0xd45a('0x14'),_0x1d470b,_0xd45a('0xe'));_0x5587ef(_0x48fb35[_0xd45a('0x17')]['message']);}})[_0xd45a('0x18')](function(_0x4ea999){logger[_0xd45a('0x12')](_0xd45a('0x14'),_0x1d470b,_0x4ea999);_0x15da1c(_0x4ea999);});});} \ No newline at end of file +var _0xd4b0=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','info','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash','util','moment','bluebird','ioredis'];(function(_0x4dd353,_0x56c20d){var _0x57c3d7=function(_0x1d9384){while(--_0x1d9384){_0x4dd353['push'](_0x4dd353['shift']());}};_0x57c3d7(++_0x56c20d);}(_0xd4b0,0xd7));var _0x0d4b=function(_0xb7ecf7,_0x47dd9a){_0xb7ecf7=_0xb7ecf7-0x0;var _0x49099c=_0xd4b0[_0xb7ecf7];return _0x49099c;};'use strict';var _=require(_0x0d4b('0x0'));var util=require(_0x0d4b('0x1'));var moment=require(_0x0d4b('0x2'));var BPromise=require(_0x0d4b('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0d4b('0x4'));var db=require(_0x0d4b('0x5'))['db'];var utils=require(_0x0d4b('0x6'));var logger=require(_0x0d4b('0x7'))(_0x0d4b('0x8'));var config=require(_0x0d4b('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x0d4b('0xa')][_0x0d4b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xc953ae,_0x1ce852,_0x11ea18){return new BPromise(function(_0x50f7e2,_0x24f8ab){return client[_0x0d4b('0xc')](_0xc953ae,_0x11ea18)['then'](function(_0x146efb){logger[_0x0d4b('0xd')](_0x0d4b('0xe'),_0x1ce852,_0x0d4b('0xf'));logger[_0x0d4b('0x10')](_0x0d4b('0x11'),_0x1ce852,_0x0d4b('0xf'),JSON['stringify'](_0x146efb));if(_0x146efb[_0x0d4b('0x12')]){if(_0x146efb['error'][_0x0d4b('0x13')]===0x1f4){logger[_0x0d4b('0x12')](_0x0d4b('0xe'),_0x1ce852,_0x146efb[_0x0d4b('0x12')][_0x0d4b('0x14')]);return _0x24f8ab(_0x146efb['error']['message']);}logger['error'](_0x0d4b('0xe'),_0x1ce852,_0x146efb[_0x0d4b('0x12')][_0x0d4b('0x14')]);return _0x50f7e2(_0x146efb[_0x0d4b('0x12')][_0x0d4b('0x14')]);}else{logger[_0x0d4b('0xd')]('ZendeskConfiguration,\x20%s,\x20%s',_0x1ce852,'request\x20sent');_0x50f7e2(_0x146efb[_0x0d4b('0x15')][_0x0d4b('0x14')]);}})['catch'](function(_0x3b8d42){logger[_0x0d4b('0x12')]('ZendeskConfiguration,\x20%s,\x20%s',_0x1ce852,_0x3b8d42);_0x24f8ab(_0x3b8d42);});});} \ No newline at end of file diff --git a/server/api/intZendeskField/index.js b/server/api/intZendeskField/index.js index 4c2b67a..2947760 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 _0x086f=['destroy','exports','multer','util','path','express','../../components/auth/service','../../components/interaction/service','./intZendeskField.controller','get','index','/:id','isAuthenticated','post','create','put','update'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x086f,0x145));var _0xf086=function(_0x227f5c,_0x2d9ee5){_0x227f5c=_0x227f5c-0x0;var _0x57e726=_0x086f[_0x227f5c];return _0x57e726;};'use strict';var multer=require(_0xf086('0x0'));var util=require(_0xf086('0x1'));var path=require(_0xf086('0x2'));var timeout=require('connect-timeout');var express=require(_0xf086('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xf086('0x4'));var interaction=require(_0xf086('0x5'));var config=require('../../config/environment');var controller=require(_0xf086('0x6'));router[_0xf086('0x7')]('/',auth['isAuthenticated'](),controller[_0xf086('0x8')]);router[_0xf086('0x7')](_0xf086('0x9'),auth[_0xf086('0xa')](),controller['show']);router[_0xf086('0xb')]('/',auth['isAuthenticated'](),controller[_0xf086('0xc')]);router[_0xf086('0xd')]('/:id',auth[_0xf086('0xa')](),controller[_0xf086('0xe')]);router['delete'](_0xf086('0x9'),auth[_0xf086('0xa')](),controller[_0xf086('0xf')]);module[_0xf086('0x10')]=router; \ No newline at end of file +var _0x50dd=['show','put','/:id','update','delete','destroy','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0x50dd,0x73));var _0xd50d=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x50dd[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0xd50d('0x0'));var util=require(_0xd50d('0x1'));var path=require(_0xd50d('0x2'));var timeout=require('connect-timeout');var express=require(_0xd50d('0x3'));var router=express['Router']();var fs_extra=require(_0xd50d('0x4'));var auth=require(_0xd50d('0x5'));var interaction=require(_0xd50d('0x6'));var config=require(_0xd50d('0x7'));var controller=require('./intZendeskField.controller');router[_0xd50d('0x8')]('/',auth[_0xd50d('0x9')](),controller[_0xd50d('0xa')]);router[_0xd50d('0x8')]('/:id',auth[_0xd50d('0x9')](),controller[_0xd50d('0xb')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xd50d('0xc')](_0xd50d('0xd'),auth['isAuthenticated'](),controller[_0xd50d('0xe')]);router[_0xd50d('0xf')](_0xd50d('0xd'),auth[_0xd50d('0x9')](),controller[_0xd50d('0x10')]);module[_0xd50d('0x11')]=router; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.attributes.js b/server/api/intZendeskField/intZendeskField.attributes.js index 9fcbf41..ac3964e 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 _0x995f=['keyValue','picklist','STRING','ENUM','customVariable','BOOLEAN','sequelize','exports','string','variable'];(function(_0xb66df,_0x4fb5ce){var _0x42a702=function(_0x252d1d){while(--_0x252d1d){_0xb66df['push'](_0xb66df['shift']());}};_0x42a702(++_0x4fb5ce);}(_0x995f,0x1a0));var _0xf995=function(_0x13f38e,_0x10ecce){_0x13f38e=_0x13f38e-0x0;var _0x2a4b96=_0x995f[_0x13f38e];return _0x2a4b96;};'use strict';var Sequelize=require(_0xf995('0x0'));module[_0xf995('0x1')]={'type':{'type':Sequelize['ENUM'](_0xf995('0x2'),_0xf995('0x3'),'customVariable',_0xf995('0x4'),_0xf995('0x5')),'defaultValue':_0xf995('0x2')},'content':{'type':Sequelize[_0xf995('0x6')]},'key':{'type':Sequelize[_0xf995('0x6')]},'keyType':{'type':Sequelize[_0xf995('0x7')](_0xf995('0x2'),_0xf995('0x3'),_0xf995('0x8'))},'keyContent':{'type':Sequelize[_0xf995('0x6')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0xf995('0x6')]},'customField':{'type':Sequelize[_0xf995('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xf995('0x6')]}}; \ No newline at end of file +var _0x82c9=['ENUM','string','variable','STRING','BOOLEAN','sequelize','exports','customVariable','keyValue','picklist'];(function(_0x507c6e,_0x5b7703){var _0x236242=function(_0x39a756){while(--_0x39a756){_0x507c6e['push'](_0x507c6e['shift']());}};_0x236242(++_0x5b7703);}(_0x82c9,0x145));var _0x982c=function(_0x21648e,_0x3c3dff){_0x21648e=_0x21648e-0x0;var _0x2098d4=_0x82c9[_0x21648e];return _0x2098d4;};'use strict';var Sequelize=require(_0x982c('0x0'));module[_0x982c('0x1')]={'type':{'type':Sequelize['ENUM']('string','variable',_0x982c('0x2'),_0x982c('0x3'),_0x982c('0x4')),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x982c('0x5')](_0x982c('0x6'),_0x982c('0x7'),_0x982c('0x2'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x982c('0x8')]},'nameField':{'type':Sequelize[_0x982c('0x8')]},'customField':{'type':Sequelize[_0x982c('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x982c('0x8')]}}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.controller.js b/server/api/intZendeskField/intZendeskField.controller.js index 4599dcb..a5e05b8 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 _0x1fee=['includeAll','merge','create','update','body','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','count','limit','set','apply','reject','save','then','destroy','sendStatus','stack','send','index','map','ZendeskField','rawAttributes','type','key','model','name','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','options','include','catch','show','params','filters'];(function(_0x15ff6e,_0x500de8){var _0xf0ac40=function(_0x44b259){while(--_0x44b259){_0x15ff6e['push'](_0x15ff6e['shift']());}};_0xf0ac40(++_0x500de8);}(_0x1fee,0x12e));var _0xe1fe=function(_0x2e213f,_0x4dd092){_0x2e213f=_0x2e213f-0x0;var _0x5c8903=_0x1fee[_0x2e213f];return _0x5c8903;};'use strict';var emlformat=require(_0xe1fe('0x0'));var rimraf=require(_0xe1fe('0x1'));var zipdir=require(_0xe1fe('0x2'));var jsonpatch=require(_0xe1fe('0x3'));var rp=require(_0xe1fe('0x4'));var moment=require('moment');var BPromise=require(_0xe1fe('0x5'));var Mustache=require(_0xe1fe('0x6'));var util=require(_0xe1fe('0x7'));var path=require(_0xe1fe('0x8'));var sox=require(_0xe1fe('0x9'));var csv=require(_0xe1fe('0xa'));var ejs=require(_0xe1fe('0xb'));var fs=require('fs');var fs_extra=require(_0xe1fe('0xc'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xe1fe('0xd'));var jsforce=require(_0xe1fe('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xe1fe('0xa'));var querystring=require('querystring');var Papa=require(_0xe1fe('0xf'));var Redis=require(_0xe1fe('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xe1fe('0x11'));var as=require(_0xe1fe('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe1fe('0x13'))(_0xe1fe('0x14'));var utils=require(_0xe1fe('0x15'));var config=require(_0xe1fe('0x16'));var licenseUtil=require(_0xe1fe('0x17'));var db=require(_0xe1fe('0x18'))['db'];function respondWithStatusCode(_0x258e92,_0x1a17c6){_0x1a17c6=_0x1a17c6||0xcc;return function(_0x313635){if(_0x313635){return _0x258e92['sendStatus'](_0x1a17c6);}return _0x258e92['status'](_0x1a17c6)[_0xe1fe('0x19')]();};}function respondWithResult(_0x303315,_0x42ca66){_0x42ca66=_0x42ca66||0xc8;return function(_0x1ff5d5){if(_0x1ff5d5){return _0x303315[_0xe1fe('0x1a')](_0x42ca66)[_0xe1fe('0x1b')](_0x1ff5d5);}};}function respondWithFilteredResult(_0x444834,_0x115684){return function(_0x18bc19){if(_0x18bc19){var _0x3bbcec=typeof _0x115684[_0xe1fe('0x1c')]===_0xe1fe('0x1d')&&typeof _0x115684['limit']===_0xe1fe('0x1d');var _0x50e403=_0x18bc19[_0xe1fe('0x1e')];var _0xdc8d47=_0x3bbcec?0x0:_0x115684['offset'];var _0x374b4f=_0x3bbcec?_0x18bc19[_0xe1fe('0x1e')]:_0x115684[_0xe1fe('0x1c')]+_0x115684[_0xe1fe('0x1f')];var _0x2fc7f0;if(_0x374b4f>=_0x50e403){_0x374b4f=_0x50e403;_0x2fc7f0=0xc8;}else{_0x2fc7f0=0xce;}_0x444834[_0xe1fe('0x1a')](_0x2fc7f0);return _0x444834[_0xe1fe('0x20')]('Content-Range',_0xdc8d47+'-'+_0x374b4f+'/'+_0x50e403)[_0xe1fe('0x1b')](_0x18bc19);}return null;};}function patchUpdates(_0x53f8ed){return function(_0x531a88){try{jsonpatch[_0xe1fe('0x21')](_0x531a88,_0x53f8ed,!![]);}catch(_0x106c90){return BPromise[_0xe1fe('0x22')](_0x106c90);}return _0x531a88[_0xe1fe('0x23')]();};}function saveUpdates(_0x14d89b,_0x874a69){return function(_0x170ff8){if(_0x170ff8){return _0x170ff8['update'](_0x14d89b)[_0xe1fe('0x24')](function(_0x499fc1){return _0x499fc1;});}return null;};}function removeEntity(_0x3ab672,_0x389d1e){return function(_0x2da709){if(_0x2da709){return _0x2da709[_0xe1fe('0x25')]()[_0xe1fe('0x24')](function(){_0x3ab672['status'](0xcc)[_0xe1fe('0x19')]();});}};}function handleEntityNotFound(_0x1a09bb,_0x38cce8){return function(_0x4afe73){if(!_0x4afe73){_0x1a09bb[_0xe1fe('0x26')](0x194);}return _0x4afe73;};}function handleError(_0x34089c,_0x291f64){_0x291f64=_0x291f64||0x1f4;return function(_0x5b4128){logger['error'](_0x5b4128[_0xe1fe('0x27')]);if(_0x5b4128['name']){delete _0x5b4128['name'];}_0x34089c[_0xe1fe('0x1a')](_0x291f64)[_0xe1fe('0x28')](_0x5b4128);};}exports[_0xe1fe('0x29')]=function(_0x5b71f5,_0x226461){var _0x16b38d={},_0x522ffb={},_0x22c348={'count':0x0,'rows':[]};var _0x3e4248=_[_0xe1fe('0x2a')](db[_0xe1fe('0x2b')][_0xe1fe('0x2c')],function(_0x376e17){return{'name':_0x376e17['fieldName'],'type':_0x376e17[_0xe1fe('0x2d')][_0xe1fe('0x2e')]};});_0x522ffb[_0xe1fe('0x2f')]=_[_0xe1fe('0x2a')](_0x3e4248,_0xe1fe('0x30'));_0x522ffb[_0xe1fe('0x31')]=_[_0xe1fe('0x32')](_0x5b71f5[_0xe1fe('0x31')]);_0x522ffb['filters']=_[_0xe1fe('0x33')](_0x522ffb[_0xe1fe('0x2f')],_0x522ffb[_0xe1fe('0x31')]);_0x16b38d[_0xe1fe('0x34')]=_['intersection'](_0x522ffb['model'],qs[_0xe1fe('0x35')](_0x5b71f5[_0xe1fe('0x31')][_0xe1fe('0x35')]));_0x16b38d['attributes']=_0x16b38d['attributes'][_0xe1fe('0x36')]?_0x16b38d[_0xe1fe('0x34')]:_0x522ffb[_0xe1fe('0x2f')];if(!_0x5b71f5['query'][_0xe1fe('0x37')](_0xe1fe('0x38'))){_0x16b38d[_0xe1fe('0x1f')]=qs[_0xe1fe('0x1f')](_0x5b71f5[_0xe1fe('0x31')][_0xe1fe('0x1f')]);_0x16b38d[_0xe1fe('0x1c')]=qs[_0xe1fe('0x1c')](_0x5b71f5[_0xe1fe('0x31')][_0xe1fe('0x1c')]);}_0x16b38d[_0xe1fe('0x39')]=qs[_0xe1fe('0x3a')](_0x5b71f5['query'][_0xe1fe('0x3a')]);_0x16b38d[_0xe1fe('0x3b')]=qs['filters'](_[_0xe1fe('0x3c')](_0x5b71f5[_0xe1fe('0x31')],_0x522ffb['filters']),_0x3e4248);if(_0x5b71f5['query'][_0xe1fe('0x3d')]){_0x16b38d[_0xe1fe('0x3b')]=_['merge'](_0x16b38d[_0xe1fe('0x3b')],{'$or':_[_0xe1fe('0x2a')](_0x3e4248,function(_0x585ae9){if(_0x585ae9[_0xe1fe('0x2d')]!=='VIRTUAL'){var _0x2c75c0={};_0x2c75c0[_0x585ae9[_0xe1fe('0x30')]]={'$like':'%'+_0x5b71f5['query'][_0xe1fe('0x3d')]+'%'};return _0x2c75c0;}})});}_0x16b38d=_['merge']({},_0x16b38d,_0x5b71f5[_0xe1fe('0x3e')]);var _0x56f9be={'where':_0x16b38d['where']};return db['ZendeskField'][_0xe1fe('0x1e')](_0x56f9be)[_0xe1fe('0x24')](function(_0x3fbc1d){_0x22c348[_0xe1fe('0x1e')]=_0x3fbc1d;if(_0x5b71f5[_0xe1fe('0x31')]['includeAll']){_0x16b38d[_0xe1fe('0x3f')]=[{'all':!![]}];}return db[_0xe1fe('0x2b')]['findAll'](_0x16b38d);})[_0xe1fe('0x24')](function(_0x4fb603){_0x22c348['rows']=_0x4fb603;return _0x22c348;})[_0xe1fe('0x24')](respondWithFilteredResult(_0x226461,_0x16b38d))[_0xe1fe('0x40')](handleError(_0x226461,null));};exports[_0xe1fe('0x41')]=function(_0x34752a,_0x5c8afe){var _0x57f62f={'raw':!![],'where':{'id':_0x34752a[_0xe1fe('0x42')]['id']}},_0x4dc6e4={};_0x4dc6e4[_0xe1fe('0x2f')]=_['keys'](db[_0xe1fe('0x2b')][_0xe1fe('0x2c')]);_0x4dc6e4['query']=_['keys'](_0x34752a[_0xe1fe('0x31')]);_0x4dc6e4[_0xe1fe('0x43')]=_[_0xe1fe('0x33')](_0x4dc6e4[_0xe1fe('0x2f')],_0x4dc6e4[_0xe1fe('0x31')]);_0x57f62f[_0xe1fe('0x34')]=_[_0xe1fe('0x33')](_0x4dc6e4[_0xe1fe('0x2f')],qs[_0xe1fe('0x35')](_0x34752a[_0xe1fe('0x31')][_0xe1fe('0x35')]));_0x57f62f[_0xe1fe('0x34')]=_0x57f62f[_0xe1fe('0x34')][_0xe1fe('0x36')]?_0x57f62f[_0xe1fe('0x34')]:_0x4dc6e4[_0xe1fe('0x2f')];if(_0x34752a[_0xe1fe('0x31')][_0xe1fe('0x44')]){_0x57f62f[_0xe1fe('0x3f')]=[{'all':!![]}];}_0x57f62f=_[_0xe1fe('0x45')]({},_0x57f62f,_0x34752a[_0xe1fe('0x3e')]);return db[_0xe1fe('0x2b')]['find'](_0x57f62f)[_0xe1fe('0x24')](handleEntityNotFound(_0x5c8afe,null))[_0xe1fe('0x24')](respondWithResult(_0x5c8afe,null))[_0xe1fe('0x40')](handleError(_0x5c8afe,null));};exports[_0xe1fe('0x46')]=function(_0x31c33b,_0x369d26){return db[_0xe1fe('0x2b')][_0xe1fe('0x46')](_0x31c33b['body'],{})[_0xe1fe('0x24')](respondWithResult(_0x369d26,0xc9))['catch'](handleError(_0x369d26,null));};exports[_0xe1fe('0x47')]=function(_0x5d6b8b,_0x24422f){if(_0x5d6b8b[_0xe1fe('0x48')]['id']){delete _0x5d6b8b[_0xe1fe('0x48')]['id'];}return db['ZendeskField'][_0xe1fe('0x49')]({'where':{'id':_0x5d6b8b[_0xe1fe('0x42')]['id']}})[_0xe1fe('0x24')](handleEntityNotFound(_0x24422f,null))[_0xe1fe('0x24')](saveUpdates(_0x5d6b8b[_0xe1fe('0x48')],null))['then'](respondWithResult(_0x24422f,null))['catch'](handleError(_0x24422f,null));};exports['destroy']=function(_0x3d34eb,_0x2fe111){return db[_0xe1fe('0x2b')][_0xe1fe('0x49')]({'where':{'id':_0x3d34eb[_0xe1fe('0x42')]['id']}})[_0xe1fe('0x24')](handleEntityNotFound(_0x2fe111,null))['then'](removeEntity(_0x2fe111,null))[_0xe1fe('0x40')](handleError(_0x2fe111,null));}; \ No newline at end of file +var _0x491d=['ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','destroy','then','error','name','index','ZendeskField','rawAttributes','type','model','map','query','keys','filters','attributes','fields','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','intersection','length','find','create','catch','body','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv'];(function(_0x3227c1,_0x4318c5){var _0x31fd48=function(_0x5c5850){while(--_0x5c5850){_0x3227c1['push'](_0x3227c1['shift']());}};_0x31fd48(++_0x4318c5);}(_0x491d,0x1be));var _0xd491=function(_0x7ec158,_0x49334a){_0x7ec158=_0x7ec158-0x0;var _0x5ea2a6=_0x491d[_0x7ec158];return _0x5ea2a6;};'use strict';var emlformat=require(_0xd491('0x0'));var rimraf=require(_0xd491('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd491('0x2'));var rp=require('request-promise');var moment=require(_0xd491('0x3'));var BPromise=require(_0xd491('0x4'));var Mustache=require(_0xd491('0x5'));var util=require(_0xd491('0x6'));var path=require(_0xd491('0x7'));var sox=require(_0xd491('0x8'));var csv=require(_0xd491('0x9'));var ejs=require(_0xd491('0xa'));var fs=require('fs');var fs_extra=require(_0xd491('0xb'));var _=require(_0xd491('0xc'));var squel=require(_0xd491('0xd'));var crypto=require(_0xd491('0xe'));var jsforce=require(_0xd491('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xd491('0x9'));var querystring=require(_0xd491('0x10'));var Papa=require('papaparse');var Redis=require(_0xd491('0x11'));var authService=require(_0xd491('0x12'));var qs=require(_0xd491('0x13'));var as=require(_0xd491('0x14'));var hardwareService=require(_0xd491('0x15'));var logger=require(_0xd491('0x16'))(_0xd491('0x17'));var utils=require(_0xd491('0x18'));var config=require(_0xd491('0x19'));var licenseUtil=require(_0xd491('0x1a'));var db=require(_0xd491('0x1b'))['db'];function respondWithStatusCode(_0x51a2a2,_0x47a2cd){_0x47a2cd=_0x47a2cd||0xcc;return function(_0x1bace5){if(_0x1bace5){return _0x51a2a2[_0xd491('0x1c')](_0x47a2cd);}return _0x51a2a2[_0xd491('0x1d')](_0x47a2cd)[_0xd491('0x1e')]();};}function respondWithResult(_0x4e668f,_0x2261e6){_0x2261e6=_0x2261e6||0xc8;return function(_0x35faff){if(_0x35faff){return _0x4e668f['status'](_0x2261e6)[_0xd491('0x1f')](_0x35faff);}};}function respondWithFilteredResult(_0x497793,_0x4d6bc1){return function(_0x1cff1f){if(_0x1cff1f){var _0x1c72f5=typeof _0x4d6bc1['offset']===_0xd491('0x20')&&typeof _0x4d6bc1[_0xd491('0x21')]===_0xd491('0x20');var _0x450da6=_0x1cff1f[_0xd491('0x22')];var _0x53c743=_0x1c72f5?0x0:_0x4d6bc1[_0xd491('0x23')];var _0x1d9166=_0x1c72f5?_0x1cff1f['count']:_0x4d6bc1['offset']+_0x4d6bc1['limit'];var _0x34ff4d;if(_0x1d9166>=_0x450da6){_0x1d9166=_0x450da6;_0x34ff4d=0xc8;}else{_0x34ff4d=0xce;}_0x497793[_0xd491('0x1d')](_0x34ff4d);return _0x497793[_0xd491('0x24')](_0xd491('0x25'),_0x53c743+'-'+_0x1d9166+'/'+_0x450da6)[_0xd491('0x1f')](_0x1cff1f);}return null;};}function patchUpdates(_0x510a25){return function(_0xc40993){try{jsonpatch[_0xd491('0x26')](_0xc40993,_0x510a25,!![]);}catch(_0x5a7fe1){return BPromise[_0xd491('0x27')](_0x5a7fe1);}return _0xc40993[_0xd491('0x28')]();};}function saveUpdates(_0x54162b,_0x2eaaa5){return function(_0x41326e){if(_0x41326e){return _0x41326e['update'](_0x54162b)['then'](function(_0x28c010){return _0x28c010;});}return null;};}function removeEntity(_0x180bc7,_0x94ad9e){return function(_0x367b98){if(_0x367b98){return _0x367b98[_0xd491('0x29')]()[_0xd491('0x2a')](function(){_0x180bc7[_0xd491('0x1d')](0xcc)[_0xd491('0x1e')]();});}};}function handleEntityNotFound(_0x49d72c,_0x53fd43){return function(_0x504322){if(!_0x504322){_0x49d72c[_0xd491('0x1c')](0x194);}return _0x504322;};}function handleError(_0x246173,_0x3eaee1){_0x3eaee1=_0x3eaee1||0x1f4;return function(_0x444c1a){logger[_0xd491('0x2b')](_0x444c1a['stack']);if(_0x444c1a[_0xd491('0x2c')]){delete _0x444c1a[_0xd491('0x2c')];}_0x246173[_0xd491('0x1d')](_0x3eaee1)['send'](_0x444c1a);};}exports[_0xd491('0x2d')]=function(_0x5eefa5,_0x2e8823){var _0x4684b3={},_0x5d26e8={},_0x50c3b6={'count':0x0,'rows':[]};var _0xc741cd=_['map'](db[_0xd491('0x2e')][_0xd491('0x2f')],function(_0xc86170){return{'name':_0xc86170['fieldName'],'type':_0xc86170[_0xd491('0x30')]['key']};});_0x5d26e8[_0xd491('0x31')]=_[_0xd491('0x32')](_0xc741cd,_0xd491('0x2c'));_0x5d26e8[_0xd491('0x33')]=_[_0xd491('0x34')](_0x5eefa5[_0xd491('0x33')]);_0x5d26e8[_0xd491('0x35')]=_['intersection'](_0x5d26e8['model'],_0x5d26e8[_0xd491('0x33')]);_0x4684b3[_0xd491('0x36')]=_['intersection'](_0x5d26e8[_0xd491('0x31')],qs[_0xd491('0x37')](_0x5eefa5[_0xd491('0x33')][_0xd491('0x37')]));_0x4684b3[_0xd491('0x36')]=_0x4684b3['attributes']['length']?_0x4684b3[_0xd491('0x36')]:_0x5d26e8[_0xd491('0x31')];if(!_0x5eefa5['query']['hasOwnProperty'](_0xd491('0x38'))){_0x4684b3[_0xd491('0x21')]=qs['limit'](_0x5eefa5[_0xd491('0x33')][_0xd491('0x21')]);_0x4684b3[_0xd491('0x23')]=qs[_0xd491('0x23')](_0x5eefa5[_0xd491('0x33')]['offset']);}_0x4684b3['order']=qs[_0xd491('0x39')](_0x5eefa5['query'][_0xd491('0x39')]);_0x4684b3[_0xd491('0x3a')]=qs['filters'](_[_0xd491('0x3b')](_0x5eefa5[_0xd491('0x33')],_0x5d26e8[_0xd491('0x35')]),_0xc741cd);if(_0x5eefa5[_0xd491('0x33')][_0xd491('0x3c')]){_0x4684b3[_0xd491('0x3a')]=_[_0xd491('0x3d')](_0x4684b3['where'],{'$or':_[_0xd491('0x32')](_0xc741cd,function(_0x2e6a47){if(_0x2e6a47[_0xd491('0x30')]!==_0xd491('0x3e')){var _0x1cf8c3={};_0x1cf8c3[_0x2e6a47[_0xd491('0x2c')]]={'$like':'%'+_0x5eefa5[_0xd491('0x33')][_0xd491('0x3c')]+'%'};return _0x1cf8c3;}})});}_0x4684b3=_['merge']({},_0x4684b3,_0x5eefa5[_0xd491('0x3f')]);var _0x145a12={'where':_0x4684b3[_0xd491('0x3a')]};return db[_0xd491('0x2e')][_0xd491('0x22')](_0x145a12)['then'](function(_0x2203a9){_0x50c3b6[_0xd491('0x22')]=_0x2203a9;if(_0x5eefa5[_0xd491('0x33')][_0xd491('0x40')]){_0x4684b3[_0xd491('0x41')]=[{'all':!![]}];}return db[_0xd491('0x2e')][_0xd491('0x42')](_0x4684b3);})[_0xd491('0x2a')](function(_0x5bed0f){_0x50c3b6[_0xd491('0x43')]=_0x5bed0f;return _0x50c3b6;})['then'](respondWithFilteredResult(_0x2e8823,_0x4684b3))['catch'](handleError(_0x2e8823,null));};exports[_0xd491('0x44')]=function(_0x5b48c3,_0x24063c){var _0x194327={'raw':!![],'where':{'id':_0x5b48c3[_0xd491('0x45')]['id']}},_0x7774ae={};_0x7774ae['model']=_[_0xd491('0x34')](db[_0xd491('0x2e')][_0xd491('0x2f')]);_0x7774ae['query']=_[_0xd491('0x34')](_0x5b48c3[_0xd491('0x33')]);_0x7774ae[_0xd491('0x35')]=_[_0xd491('0x46')](_0x7774ae[_0xd491('0x31')],_0x7774ae['query']);_0x194327[_0xd491('0x36')]=_[_0xd491('0x46')](_0x7774ae[_0xd491('0x31')],qs[_0xd491('0x37')](_0x5b48c3[_0xd491('0x33')][_0xd491('0x37')]));_0x194327['attributes']=_0x194327[_0xd491('0x36')][_0xd491('0x47')]?_0x194327[_0xd491('0x36')]:_0x7774ae['model'];if(_0x5b48c3[_0xd491('0x33')][_0xd491('0x40')]){_0x194327[_0xd491('0x41')]=[{'all':!![]}];}_0x194327=_[_0xd491('0x3d')]({},_0x194327,_0x5b48c3[_0xd491('0x3f')]);return db['ZendeskField'][_0xd491('0x48')](_0x194327)['then'](handleEntityNotFound(_0x24063c,null))[_0xd491('0x2a')](respondWithResult(_0x24063c,null))['catch'](handleError(_0x24063c,null));};exports[_0xd491('0x49')]=function(_0x8e0471,_0x5d5a07){return db[_0xd491('0x2e')][_0xd491('0x49')](_0x8e0471['body'],{})[_0xd491('0x2a')](respondWithResult(_0x5d5a07,0xc9))[_0xd491('0x4a')](handleError(_0x5d5a07,null));};exports['update']=function(_0x586421,_0x48d36d){if(_0x586421[_0xd491('0x4b')]['id']){delete _0x586421[_0xd491('0x4b')]['id'];}return db['ZendeskField']['find']({'where':{'id':_0x586421[_0xd491('0x45')]['id']}})['then'](handleEntityNotFound(_0x48d36d,null))[_0xd491('0x2a')](saveUpdates(_0x586421['body'],null))[_0xd491('0x2a')](respondWithResult(_0x48d36d,null))[_0xd491('0x4a')](handleError(_0x48d36d,null));};exports['destroy']=function(_0x458d32,_0x304a02){return db[_0xd491('0x2e')]['find']({'where':{'id':_0x458d32[_0xd491('0x45')]['id']}})[_0xd491('0x2a')](handleEntityNotFound(_0x304a02,null))[_0xd491('0x2a')](removeEntity(_0x304a02,null))[_0xd491('0x4a')](handleError(_0x304a02,null));}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.model.js b/server/api/intZendeskField/intZendeskField.model.js index e5e4671..da822df 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 _0x808d=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intZendeskField.attributes','exports','define','int_zendesk_fields','idField','FieldId'];(function(_0x1a7a55,_0x143069){var _0x5dbfa2=function(_0x5855dd){while(--_0x5855dd){_0x1a7a55['push'](_0x1a7a55['shift']());}};_0x5dbfa2(++_0x143069);}(_0x808d,0x1ef));var _0xd808=function(_0x2a7b7d,_0x58a1cd){_0x2a7b7d=_0x2a7b7d-0x0;var _0x58e5bf=_0x808d[_0x2a7b7d];return _0x58e5bf;};'use strict';var _=require('lodash');var util=require(_0xd808('0x0'));var logger=require(_0xd808('0x1'))(_0xd808('0x2'));var moment=require(_0xd808('0x3'));var BPromise=require(_0xd808('0x4'));var rp=require(_0xd808('0x5'));var fs=require('fs');var path=require(_0xd808('0x6'));var rimraf=require(_0xd808('0x7'));var config=require(_0xd808('0x8'));var attributes=require(_0xd808('0x9'));module[_0xd808('0xa')]=function(_0x35efd6,_0x1e452d){return _0x35efd6[_0xd808('0xb')]('ZendeskField',attributes,{'tableName':_0xd808('0xc'),'paranoid':![],'indexes':[{'name':'zendesk_unique_index','fields':[_0xd808('0xd'),_0xd808('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x3d21=['FieldId','lodash','../../config/logger','api','moment','bluebird','request-promise','path','./intZendeskField.attributes','exports','ZendeskField','int_zendesk_fields','zendesk_unique_index','idField'];(function(_0x47bcee,_0x5c0311){var _0x4b88a8=function(_0x170762){while(--_0x170762){_0x47bcee['push'](_0x47bcee['shift']());}};_0x4b88a8(++_0x5c0311);}(_0x3d21,0x1b3));var _0x13d2=function(_0x3498b9,_0x41a0df){_0x3498b9=_0x3498b9-0x0;var _0x2c012e=_0x3d21[_0x3498b9];return _0x2c012e;};'use strict';var _=require(_0x13d2('0x0'));var util=require('util');var logger=require(_0x13d2('0x1'))(_0x13d2('0x2'));var moment=require(_0x13d2('0x3'));var BPromise=require(_0x13d2('0x4'));var rp=require(_0x13d2('0x5'));var fs=require('fs');var path=require(_0x13d2('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x13d2('0x7'));module[_0x13d2('0x8')]=function(_0x1dc4d3,_0x16c00f){return _0x1dc4d3['define'](_0x13d2('0x9'),attributes,{'tableName':_0x13d2('0xa'),'paranoid':![],'indexes':[{'name':_0x13d2('0xb'),'fields':[_0x13d2('0xc'),_0x13d2('0xd')],'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 791d83e..9909bda 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 _0x53d9=['stringify','error','code','ZendeskField,\x20%s,\x20%s','message','request\x20sent','result','catch','lodash','util','moment','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','info','ZendeskField,\x20%s,\x20%s,\x20%s'];(function(_0x396910,_0x397bda){var _0x217d81=function(_0x1e6ab9){while(--_0x1e6ab9){_0x396910['push'](_0x396910['shift']());}};_0x217d81(++_0x397bda);}(_0x53d9,0x134));var _0x953d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x53d9[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x953d('0x0'));var util=require(_0x953d('0x1'));var moment=require(_0x953d('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x953d('0x3'))['db'];var utils=require(_0x953d('0x4'));var logger=require('../../config/logger')(_0x953d('0x5'));var config=require(_0x953d('0x6'));var jayson=require(_0x953d('0x7'));var client=jayson[_0x953d('0x8')][_0x953d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3c53ec,_0x86ab39,_0x18c464){return new BPromise(function(_0x50628e,_0x362403){return client['request'](_0x3c53ec,_0x18c464)['then'](function(_0x3c9c8e){logger[_0x953d('0xa')]('ZendeskField,\x20%s,\x20%s',_0x86ab39,'request\x20sent');logger['debug'](_0x953d('0xb'),_0x86ab39,'request\x20sent',JSON[_0x953d('0xc')](_0x3c9c8e));if(_0x3c9c8e[_0x953d('0xd')]){if(_0x3c9c8e[_0x953d('0xd')][_0x953d('0xe')]===0x1f4){logger[_0x953d('0xd')](_0x953d('0xf'),_0x86ab39,_0x3c9c8e['error']['message']);return _0x362403(_0x3c9c8e[_0x953d('0xd')][_0x953d('0x10')]);}logger[_0x953d('0xd')](_0x953d('0xf'),_0x86ab39,_0x3c9c8e[_0x953d('0xd')][_0x953d('0x10')]);return _0x50628e(_0x3c9c8e[_0x953d('0xd')][_0x953d('0x10')]);}else{logger[_0x953d('0xa')]('ZendeskField,\x20%s,\x20%s',_0x86ab39,_0x953d('0x11'));_0x50628e(_0x3c9c8e[_0x953d('0x12')][_0x953d('0x10')]);}})[_0x953d('0x13')](function(_0x15b09b){logger[_0x953d('0xd')](_0x953d('0xf'),_0x86ab39,_0x15b09b);_0x362403(_0x15b09b);});});} \ No newline at end of file +var _0x9f93=['then','info','ZendeskField,\x20%s,\x20%s','request\x20sent','debug','ZendeskField,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','moment','bluebird','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','http','request'];(function(_0x1401f1,_0x59f0be){var _0x46c9cb=function(_0x1c17bd){while(--_0x1c17bd){_0x1401f1['push'](_0x1401f1['shift']());}};_0x46c9cb(++_0x59f0be);}(_0x9f93,0x15b));var _0x39f9=function(_0x2adcde,_0x4720e1){_0x2adcde=_0x2adcde-0x0;var _0x509b47=_0x9f93[_0x2adcde];return _0x509b47;};'use strict';var _=require(_0x39f9('0x0'));var util=require('util');var moment=require(_0x39f9('0x1'));var BPromise=require(_0x39f9('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x39f9('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x39f9('0x4'));var logger=require('../../config/logger')(_0x39f9('0x5'));var config=require(_0x39f9('0x6'));var jayson=require(_0x39f9('0x7'));var client=jayson['client'][_0x39f9('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x350f00,_0x19a953,_0x2625af){return new BPromise(function(_0x469cfa,_0x590375){return client[_0x39f9('0x9')](_0x350f00,_0x2625af)[_0x39f9('0xa')](function(_0xf15f1b){logger[_0x39f9('0xb')](_0x39f9('0xc'),_0x19a953,_0x39f9('0xd'));logger[_0x39f9('0xe')](_0x39f9('0xf'),_0x19a953,'request\x20sent',JSON[_0x39f9('0x10')](_0xf15f1b));if(_0xf15f1b[_0x39f9('0x11')]){if(_0xf15f1b[_0x39f9('0x11')]['code']===0x1f4){logger[_0x39f9('0x11')](_0x39f9('0xc'),_0x19a953,_0xf15f1b[_0x39f9('0x11')]['message']);return _0x590375(_0xf15f1b['error']['message']);}logger[_0x39f9('0x11')](_0x39f9('0xc'),_0x19a953,_0xf15f1b[_0x39f9('0x11')][_0x39f9('0x12')]);return _0x469cfa(_0xf15f1b['error'][_0x39f9('0x12')]);}else{logger[_0x39f9('0xb')]('ZendeskField,\x20%s,\x20%s',_0x19a953,'request\x20sent');_0x469cfa(_0xf15f1b[_0x39f9('0x13')]['message']);}})[_0x39f9('0x14')](function(_0x4550bd){logger[_0x39f9('0x11')]('ZendeskField,\x20%s,\x20%s',_0x19a953,_0x4550bd);_0x590375(_0x4550bd);});});} \ No newline at end of file diff --git a/server/api/intZohoAccount/index.js b/server/api/intZohoAccount/index.js index 02da5bd..02a4549 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 _0x4abd=['index','/:id','isAuthenticated','/:id/fields','post','create','/:id/configurations','addConfiguration','destroy','exports','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./intZohoAccount.controller','get'];(function(_0x40045a,_0xdde4e9){var _0x45c7f9=function(_0x1fb90a){while(--_0x1fb90a){_0x40045a['push'](_0x40045a['shift']());}};_0x45c7f9(++_0xdde4e9);}(_0x4abd,0x9a));var _0xd4ab=function(_0x51b665,_0x39ba8e){_0x51b665=_0x51b665-0x0;var _0x5bef86=_0x4abd[_0x51b665];return _0x5bef86;};'use strict';var multer=require('multer');var util=require(_0xd4ab('0x0'));var path=require(_0xd4ab('0x1'));var timeout=require(_0xd4ab('0x2'));var express=require('express');var router=express[_0xd4ab('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xd4ab('0x4'));var interaction=require(_0xd4ab('0x5'));var config=require('../../config/environment');var controller=require(_0xd4ab('0x6'));router[_0xd4ab('0x7')]('/',auth['isAuthenticated'](),controller[_0xd4ab('0x8')]);router[_0xd4ab('0x7')](_0xd4ab('0x9'),auth['isAuthenticated'](),controller['show']);router['get']('/:id/configurations',auth[_0xd4ab('0xa')](),controller['getConfigurations']);router[_0xd4ab('0x7')](_0xd4ab('0xb'),auth[_0xd4ab('0xa')](),controller['getFields']);router[_0xd4ab('0xc')]('/',auth[_0xd4ab('0xa')](),controller[_0xd4ab('0xd')]);router[_0xd4ab('0xc')](_0xd4ab('0xe'),auth['isAuthenticated'](),controller[_0xd4ab('0xf')]);router['put'](_0xd4ab('0x9'),auth[_0xd4ab('0xa')](),controller['update']);router['delete']('/:id',auth[_0xd4ab('0xa')](),controller[_0xd4ab('0x10')]);module[_0xd4ab('0x11')]=router; \ No newline at end of file +var _0xc76c=['get','show','/:id/configurations','isAuthenticated','getConfigurations','/:id/fields','getFields','post','create','put','/:id','update','delete','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intZohoAccount.controller'];(function(_0x130cc9,_0x152424){var _0x5bfad8=function(_0x3bd691){while(--_0x3bd691){_0x130cc9['push'](_0x130cc9['shift']());}};_0x5bfad8(++_0x152424);}(_0xc76c,0x19a));var _0xcc76=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc76c[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xcc76('0x0'));var util=require(_0xcc76('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xcc76('0x2'));var router=express[_0xcc76('0x3')]();var fs_extra=require(_0xcc76('0x4'));var auth=require(_0xcc76('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xcc76('0x6'));var controller=require(_0xcc76('0x7'));router[_0xcc76('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0xcc76('0x8')]('/:id',auth['isAuthenticated'](),controller[_0xcc76('0x9')]);router['get'](_0xcc76('0xa'),auth[_0xcc76('0xb')](),controller[_0xcc76('0xc')]);router['get'](_0xcc76('0xd'),auth[_0xcc76('0xb')](),controller[_0xcc76('0xe')]);router[_0xcc76('0xf')]('/',auth[_0xcc76('0xb')](),controller[_0xcc76('0x10')]);router[_0xcc76('0xf')](_0xcc76('0xa'),auth['isAuthenticated'](),controller['addConfiguration']);router[_0xcc76('0x11')](_0xcc76('0x12'),auth[_0xcc76('0xb')](),controller[_0xcc76('0x13')]);router[_0xcc76('0x14')](_0xcc76('0x12'),auth['isAuthenticated'](),controller['destroy']);module[_0xcc76('0x15')]=router; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.attributes.js b/server/api/intZohoAccount/intZohoAccount.attributes.js index 9515469..c68ed1c 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 _0xe14d=['exports','STRING','sequelize'];(function(_0x4eef09,_0x26573a){var _0x2b3ace=function(_0x3afaa6){while(--_0x3afaa6){_0x4eef09['push'](_0x4eef09['shift']());}};_0x2b3ace(++_0x26573a);}(_0xe14d,0x1ee));var _0xde14=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0xe14d[_0x2d7f0e];return _0x110b07;};'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 +var _0x91a7=['STRING','exports'];(function(_0x501ab8,_0x974cd){var _0x5bafd4=function(_0x5a2efe){while(--_0x5a2efe){_0x501ab8['push'](_0x501ab8['shift']());}};_0x5bafd4(++_0x974cd);}(_0x91a7,0xe7));var _0x791a=function(_0x2158d9,_0x1f15f8){_0x2158d9=_0x2158d9-0x0;var _0x2e7045=_0x91a7[_0x2158d9];return _0x2e7045;};'use strict';var Sequelize=require('sequelize');module[_0x791a('0x0')]={'name':{'type':Sequelize[_0x791a('0x1')]},'description':{'type':Sequelize[_0x791a('0x1')]},'host':{'type':Sequelize['STRING']},'zone':{'type':Sequelize[_0x791a('0x1')]},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize[_0x791a('0x1')]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'code':{'type':Sequelize['STRING']},'refreshToken':{'type':Sequelize[_0x791a('0x1')]}}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.controller.js b/server/api/intZohoAccount/intZohoAccount.controller.js index 5f9fbcc..eb86fd8 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 _0x3957=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','reject','save','update','then','destroy','error','stack','name','send','map','ZohoAccount','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','length','hasOwnProperty','nolimit','order','sort','pick','where','filter','includeAll','include','findAll','rows','catch','show','params','fields','find','create','body','findOne','ZohoConfiguration','merge','options','getConfigurations','addConfiguration','AccountId','channel','ZohoField','Descriptions','zone','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','refreshToken','clientId','clientSecret','refresh_token','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','host','serverUrl','code','zoho.eu','com','substring','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','format','https://www.zohoapis.%s/crm/v2/settings/fields','Calls','Zoho-oauthtoken\x20','response','message','Owner','Description','WhoId','Call_Duration','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','getFields','stringify','Wrong\x20credentials','eml-format','rimraf','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis'];(function(_0x352f88,_0x358488){var _0x377970=function(_0x207a10){while(--_0x207a10){_0x352f88['push'](_0x352f88['shift']());}};_0x377970(++_0x358488);}(_0x3957,0x73));var _0x7395=function(_0x4abcf4,_0x4d80bc){_0x4abcf4=_0x4abcf4-0x0;var _0x24c066=_0x3957[_0x4abcf4];return _0x24c066;};'use strict';var emlformat=require(_0x7395('0x0'));var rimraf=require(_0x7395('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x7395('0x2'));var moment=require(_0x7395('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x7395('0x4'));var util=require(_0x7395('0x5'));var path=require(_0x7395('0x6'));var sox=require('sox');var csv=require(_0x7395('0x7'));var ejs=require(_0x7395('0x8'));var fs=require('fs');var fs_extra=require(_0x7395('0x9'));var _=require(_0x7395('0xa'));var squel=require(_0x7395('0xb'));var crypto=require(_0x7395('0xc'));var jsforce=require(_0x7395('0xd'));var deskjs=require(_0x7395('0xe'));var toCsv=require(_0x7395('0x7'));var querystring=require('querystring');var Papa=require(_0x7395('0xf'));var Redis=require(_0x7395('0x10'));var authService=require(_0x7395('0x11'));var qs=require(_0x7395('0x12'));var as=require(_0x7395('0x13'));var hardwareService=require(_0x7395('0x14'));var logger=require(_0x7395('0x15'))('api');var utils=require(_0x7395('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x7395('0x17'))['db'];var integrations=require(_0x7395('0x18'));function respondWithStatusCode(_0x53c983,_0x14df73){_0x14df73=_0x14df73||0xcc;return function(_0x167227){if(_0x167227){return _0x53c983[_0x7395('0x19')](_0x14df73);}return _0x53c983[_0x7395('0x1a')](_0x14df73)[_0x7395('0x1b')]();};}function respondWithResult(_0x352296,_0x3432f8){_0x3432f8=_0x3432f8||0xc8;return function(_0x113a04){if(_0x113a04){return _0x352296[_0x7395('0x1a')](_0x3432f8)['json'](_0x113a04);}};}function respondWithFilteredResult(_0x2d22b5,_0x477766){return function(_0x55015f){if(_0x55015f){var _0x574c00=typeof _0x477766[_0x7395('0x1c')]===_0x7395('0x1d')&&typeof _0x477766[_0x7395('0x1e')]===_0x7395('0x1d');var _0x54d146=_0x55015f['count'];var _0x35f383=_0x574c00?0x0:_0x477766[_0x7395('0x1c')];var _0x1a184c=_0x574c00?_0x55015f[_0x7395('0x1f')]:_0x477766[_0x7395('0x1c')]+_0x477766[_0x7395('0x1e')];var _0x2a310c;if(_0x1a184c>=_0x54d146){_0x1a184c=_0x54d146;_0x2a310c=0xc8;}else{_0x2a310c=0xce;}_0x2d22b5[_0x7395('0x1a')](_0x2a310c);return _0x2d22b5[_0x7395('0x20')](_0x7395('0x21'),_0x35f383+'-'+_0x1a184c+'/'+_0x54d146)[_0x7395('0x22')](_0x55015f);}return null;};}function patchUpdates(_0x4d0cc0){return function(_0xb17776){try{jsonpatch['apply'](_0xb17776,_0x4d0cc0,!![]);}catch(_0x1b5ed9){return BPromise[_0x7395('0x23')](_0x1b5ed9);}return _0xb17776[_0x7395('0x24')]();};}function saveUpdates(_0x40a15a,_0x1d6503){return function(_0x1299bf){if(_0x1299bf){return _0x1299bf[_0x7395('0x25')](_0x40a15a)[_0x7395('0x26')](function(_0x5f6cff){return _0x5f6cff;});}return null;};}function removeEntity(_0x352195,_0x50ce0e){return function(_0x4e2976){if(_0x4e2976){return _0x4e2976[_0x7395('0x27')]()[_0x7395('0x26')](function(){_0x352195[_0x7395('0x1a')](0xcc)[_0x7395('0x1b')]();});}};}function handleEntityNotFound(_0x2d6936,_0x10cba9){return function(_0x3c65a5){if(!_0x3c65a5){_0x2d6936[_0x7395('0x19')](0x194);}return _0x3c65a5;};}function handleError(_0x15e7c5,_0x46067e){_0x46067e=_0x46067e||0x1f4;return function(_0xe4b5d2){logger[_0x7395('0x28')](_0xe4b5d2[_0x7395('0x29')]);if(_0xe4b5d2[_0x7395('0x2a')]){delete _0xe4b5d2['name'];}_0x15e7c5[_0x7395('0x1a')](_0x46067e)[_0x7395('0x2b')](_0xe4b5d2);};}exports['index']=function(_0x3b358b,_0x10a46b){var _0x21bf96={},_0x2bee7b={},_0xee9ee3={'count':0x0,'rows':[]};var _0x939ec3=_[_0x7395('0x2c')](db[_0x7395('0x2d')][_0x7395('0x2e')],function(_0xdda6af){return{'name':_0xdda6af[_0x7395('0x2f')],'type':_0xdda6af[_0x7395('0x30')][_0x7395('0x31')]};});_0x2bee7b['model']=_[_0x7395('0x2c')](_0x939ec3,_0x7395('0x2a'));_0x2bee7b[_0x7395('0x32')]=_[_0x7395('0x33')](_0x3b358b['query']);_0x2bee7b[_0x7395('0x34')]=_[_0x7395('0x35')](_0x2bee7b[_0x7395('0x36')],_0x2bee7b[_0x7395('0x32')]);_0x21bf96[_0x7395('0x37')]=_['intersection'](_0x2bee7b[_0x7395('0x36')],qs['fields'](_0x3b358b[_0x7395('0x32')]['fields']));_0x21bf96[_0x7395('0x37')]=_0x21bf96[_0x7395('0x37')][_0x7395('0x38')]?_0x21bf96[_0x7395('0x37')]:_0x2bee7b[_0x7395('0x36')];if(!_0x3b358b[_0x7395('0x32')][_0x7395('0x39')](_0x7395('0x3a'))){_0x21bf96[_0x7395('0x1e')]=qs[_0x7395('0x1e')](_0x3b358b['query'][_0x7395('0x1e')]);_0x21bf96[_0x7395('0x1c')]=qs[_0x7395('0x1c')](_0x3b358b[_0x7395('0x32')][_0x7395('0x1c')]);}_0x21bf96[_0x7395('0x3b')]=qs[_0x7395('0x3c')](_0x3b358b[_0x7395('0x32')][_0x7395('0x3c')]);_0x21bf96['where']=qs['filters'](_[_0x7395('0x3d')](_0x3b358b[_0x7395('0x32')],_0x2bee7b[_0x7395('0x34')]),_0x939ec3);if(_0x3b358b[_0x7395('0x32')]['filter']){_0x21bf96[_0x7395('0x3e')]=_['merge'](_0x21bf96['where'],{'$or':_['map'](_0x939ec3,function(_0x21b67a){if(_0x21b67a[_0x7395('0x30')]!=='VIRTUAL'){var _0x7813b4={};_0x7813b4[_0x21b67a[_0x7395('0x2a')]]={'$like':'%'+_0x3b358b[_0x7395('0x32')][_0x7395('0x3f')]+'%'};return _0x7813b4;}})});}_0x21bf96=_['merge']({},_0x21bf96,_0x3b358b['options']);var _0x34e561={'where':_0x21bf96[_0x7395('0x3e')]};return db['ZohoAccount'][_0x7395('0x1f')](_0x34e561)[_0x7395('0x26')](function(_0x23c721){_0xee9ee3['count']=_0x23c721;if(_0x3b358b[_0x7395('0x32')][_0x7395('0x40')]){_0x21bf96[_0x7395('0x41')]=[{'all':!![]}];}return db['ZohoAccount'][_0x7395('0x42')](_0x21bf96);})[_0x7395('0x26')](function(_0x45caf0){_0xee9ee3[_0x7395('0x43')]=_0x45caf0;return _0xee9ee3;})[_0x7395('0x26')](respondWithFilteredResult(_0x10a46b,_0x21bf96))[_0x7395('0x44')](handleError(_0x10a46b,null));};exports[_0x7395('0x45')]=function(_0x5d867f,_0x1005d7){var _0x429b6b={'raw':![],'where':{'id':_0x5d867f[_0x7395('0x46')]['id']}},_0x30bad1={};_0x30bad1[_0x7395('0x36')]=_[_0x7395('0x33')](db[_0x7395('0x2d')]['rawAttributes']);_0x30bad1[_0x7395('0x32')]=_[_0x7395('0x33')](_0x5d867f[_0x7395('0x32')]);_0x30bad1['filters']=_[_0x7395('0x35')](_0x30bad1[_0x7395('0x36')],_0x30bad1[_0x7395('0x32')]);_0x429b6b[_0x7395('0x37')]=_[_0x7395('0x35')](_0x30bad1['model'],qs['fields'](_0x5d867f['query'][_0x7395('0x47')]));_0x429b6b['attributes']=_0x429b6b['attributes']['length']?_0x429b6b['attributes']:_0x30bad1[_0x7395('0x36')];if(_0x5d867f['query'][_0x7395('0x40')]){_0x429b6b['include']=[{'all':!![]}];}_0x429b6b=_['merge']({},_0x429b6b,_0x5d867f['options']);return db[_0x7395('0x2d')][_0x7395('0x48')](_0x429b6b)[_0x7395('0x26')](handleEntityNotFound(_0x1005d7,null))[_0x7395('0x26')](respondWithResult(_0x1005d7,null))[_0x7395('0x44')](handleError(_0x1005d7,null));};exports['create']=function(_0x4f0fc8,_0x33739d){return db[_0x7395('0x2d')][_0x7395('0x49')](_0x4f0fc8['body'],{})[_0x7395('0x26')](respondWithResult(_0x33739d,0xc9))[_0x7395('0x44')](handleError(_0x33739d,null));};exports[_0x7395('0x25')]=function(_0x3f00e5,_0x5315ba){if(_0x3f00e5[_0x7395('0x4a')]['id']){delete _0x3f00e5['body']['id'];}return db['ZohoAccount'][_0x7395('0x48')]({'where':{'id':_0x3f00e5['params']['id']}})['then'](handleEntityNotFound(_0x5315ba,null))['then'](saveUpdates(_0x3f00e5[_0x7395('0x4a')],null))[_0x7395('0x26')](respondWithResult(_0x5315ba,null))['catch'](handleError(_0x5315ba,null));};exports[_0x7395('0x27')]=function(_0x2586bc,_0x523202){return db[_0x7395('0x2d')][_0x7395('0x48')]({'where':{'id':_0x2586bc['params']['id']}})[_0x7395('0x26')](handleEntityNotFound(_0x523202,null))[_0x7395('0x26')](removeEntity(_0x523202,null))[_0x7395('0x44')](handleError(_0x523202,null));};exports['getConfigurations']=function(_0x56361e,_0x439308,_0x3b4ff7){var _0x59d124={};var _0x364831={};var _0x4d94e9;var _0x3f3af4;return db[_0x7395('0x2d')][_0x7395('0x4b')]({'where':{'id':_0x56361e[_0x7395('0x46')]['id']}})[_0x7395('0x26')](handleEntityNotFound(_0x439308,null))['then'](function(_0xeda581){if(_0xeda581){_0x4d94e9=_0xeda581;_0x364831[_0x7395('0x36')]=_['keys'](db[_0x7395('0x4c')][_0x7395('0x2e')]);_0x364831[_0x7395('0x32')]=_[_0x7395('0x33')](_0x56361e[_0x7395('0x32')]);_0x364831['filters']=_[_0x7395('0x35')](_0x364831[_0x7395('0x36')],_0x364831['query']);_0x59d124['attributes']=_[_0x7395('0x35')](_0x364831['model'],qs[_0x7395('0x47')](_0x56361e[_0x7395('0x32')]['fields']));_0x59d124[_0x7395('0x37')]=_0x59d124[_0x7395('0x37')][_0x7395('0x38')]?_0x59d124[_0x7395('0x37')]:_0x364831[_0x7395('0x36')];_0x59d124['order']=qs['sort'](_0x56361e['query'][_0x7395('0x3c')]);_0x59d124[_0x7395('0x3e')]=qs[_0x7395('0x34')](_[_0x7395('0x3d')](_0x56361e[_0x7395('0x32')],_0x364831[_0x7395('0x34')]));if(_0x56361e['query'][_0x7395('0x3f')]){_0x59d124[_0x7395('0x3e')]=_[_0x7395('0x4d')](_0x59d124[_0x7395('0x3e')],{'$or':_[_0x7395('0x2c')](_0x59d124[_0x7395('0x37')],function(_0x296099){var _0x406464={};_0x406464[_0x296099]={'$like':'%'+_0x56361e[_0x7395('0x32')]['filter']+'%'};return _0x406464;})});}_0x59d124=_[_0x7395('0x4d')]({},_0x59d124,_0x56361e[_0x7395('0x4e')]);return _0x4d94e9[_0x7395('0x4f')](_0x59d124);}})[_0x7395('0x26')](function(_0x724e45){if(_0x724e45){_0x3f3af4=_0x724e45[_0x7395('0x38')];if(!_0x56361e[_0x7395('0x32')][_0x7395('0x39')](_0x7395('0x3a'))){_0x59d124[_0x7395('0x1e')]=qs['limit'](_0x56361e[_0x7395('0x32')][_0x7395('0x1e')]);_0x59d124[_0x7395('0x1c')]=qs[_0x7395('0x1c')](_0x56361e[_0x7395('0x32')]['offset']);}return _0x4d94e9[_0x7395('0x4f')](_0x59d124);}})[_0x7395('0x26')](function(_0x529ad0){if(_0x529ad0){return _0x529ad0?{'count':_0x3f3af4,'rows':_0x529ad0}:null;}})[_0x7395('0x26')](respondWithResult(_0x439308,null))[_0x7395('0x44')](handleError(_0x439308,null));};exports[_0x7395('0x50')]=function(_0x9de62,_0x19f1ca,_0x31411a){if(_0x9de62[_0x7395('0x4a')]['id']){delete _0x9de62[_0x7395('0x4a')]['id'];}return db['ZohoAccount'][_0x7395('0x4b')]({'where':{'id':_0x9de62[_0x7395('0x46')]['id']}})[_0x7395('0x26')](handleEntityNotFound(_0x19f1ca,null))[_0x7395('0x26')](function(_0x5af912){if(_0x5af912){_0x9de62[_0x7395('0x4a')][_0x7395('0x51')]=_0x5af912['id'];_0x9de62['body']['Subjects']=integrations['getSubjects'](_0x9de62[_0x7395('0x4a')][_0x7395('0x52')],_0x9de62[_0x7395('0x4a')][_0x7395('0x30')]);_0x9de62[_0x7395('0x4a')]['Descriptions']=integrations['getDescriptions'](_0x9de62[_0x7395('0x4a')][_0x7395('0x52')],_0x9de62[_0x7395('0x4a')]['type']);return db['ZohoConfiguration'][_0x7395('0x49')](_0x9de62[_0x7395('0x4a')],{'include':[{'model':db[_0x7395('0x53')],'as':'Subjects'},{'model':db[_0x7395('0x53')],'as':_0x7395('0x54')}]});}return null;})[_0x7395('0x26')](respondWithResult(_0x19f1ca,null))['catch'](handleError(_0x19f1ca,null));};function getAccessToken(_0x5997b5){return new Promise(function(_0xe88d70,_0x3a19d8){var _0x537ac8;switch(_0x5997b5[_0x7395('0x55')]){case'US':_0x537ac8='https://accounts.zoho.com';break;case'AU':_0x537ac8=_0x7395('0x56');break;case'EU':_0x537ac8=_0x7395('0x57');break;case'IN':_0x537ac8=_0x7395('0x58');break;case'CN':_0x537ac8=_0x7395('0x59');break;default:_0x537ac8=_0x7395('0x57');break;}var _0x4fde1c={'method':_0x7395('0x5a'),'uri':_0x537ac8+'/oauth/v2/token','qs':{'refresh_token':_0x5997b5[_0x7395('0x5b')],'client_id':_0x5997b5[_0x7395('0x5c')],'client_secret':_0x5997b5[_0x7395('0x5d')],'grant_type':_0x7395('0x5e')},'json':!![]};return rp(_0x4fde1c)[_0x7395('0x26')](function(_0x3e0b39){if(_0x3e0b39[_0x7395('0x5f')]){_0xe88d70(_0x3e0b39[_0x7395('0x5f')]);}else{_0x3a19d8(_0x7395('0x60'));}})[_0x7395('0x44')](function(_0x36b8dd){_0x3a19d8(_0x36b8dd);});});}exports['getFields']=function(_0x79204,_0x2e9267,_0x1d7b26){var _0x56bc57,_0x37b2a2,_0x45f18b,_0x285d22,_0x3d4db8;return db['ZohoAccount'][_0x7395('0x4b')]({'where':{'id':_0x79204[_0x7395('0x46')]['id']},'attributes':['id',_0x7395('0x61'),_0x7395('0x55'),_0x7395('0x5c'),_0x7395('0x5d'),_0x7395('0x62'),_0x7395('0x63'),_0x7395('0x5b')]})['then'](handleEntityNotFound(_0x2e9267,null))['then'](function(_0x2f9a0d){_0x3d4db8=_0x2f9a0d;_0x56bc57=_0x3d4db8[_0x7395('0x61')];_0x37b2a2=_0x56bc57===_0x7395('0x64')?'eu':_0x7395('0x65');_0x45f18b=_0x3d4db8['serverUrl'];var _0x539228=_0x45f18b['slice'](-0x1);if(_0x539228==='/'||_0x539228==='\x5c'||_0x539228===':'){_0x45f18b=_0x45f18b[_0x7395('0x66')](0x0,_0x45f18b['lastIndexOf'](_0x539228));}if(!_0x3d4db8[_0x7395('0x5b')]){throw new Error(_0x7395('0x67'));}return getAccessToken(_0x3d4db8);})[_0x7395('0x26')](function(_0x471c6e){if(_0x471c6e){return rp({'method':'GET','uri':util[_0x7395('0x68')](_0x7395('0x69'),_0x37b2a2),'qs':{'module':_0x7395('0x6a')},'headers':{'Authorization':_0x7395('0x6b')+_0x471c6e},'json':!![]});}})['then'](function(_0x24bc11){if(_0x24bc11){if(_0x24bc11[_0x7395('0x6c')]&&_0x24bc11[_0x7395('0x6c')][_0x7395('0x28')]){throw new Error(_0x24bc11[_0x7395('0x6c')][_0x7395('0x28')][_0x7395('0x6d')]);}var _0x303155=[];var _0x224d72=[];var _0x524993=[_0x7395('0x6e'),'Subject',_0x7395('0x6f'),_0x7395('0x70'),_0x7395('0x71'),_0x7395('0x72'),_0x7395('0x73'),_0x7395('0x74')];_0x224d72=_[_0x7395('0x75')](_0x24bc11[_0x7395('0x47')],function(_0x5116a9){return _0x524993[_0x7395('0x76')](_0x5116a9[_0x7395('0x77')]);});for(var _0x1c9cd3=0x0;_0x1c9cd3<_0x224d72[_0x7395('0x38')];_0x1c9cd3++){if(_0x224d72[_0x1c9cd3][_0x7395('0x78')]===![]){_0x303155[_0x7395('0x79')]({'id':_0x224d72[_0x1c9cd3]['id'],'name':_0x224d72[_0x1c9cd3]['display_label'],'custom':_0x224d72[_0x1c9cd3][_0x7395('0x7a')],'options':_0x224d72[_0x1c9cd3][_0x7395('0x7b')]===_0x7395('0x7c')&&_0x224d72[_0x1c9cd3][_0x7395('0x7d')][_0x7395('0x38')]>-0x1?_[_0x7395('0x2c')](_0x224d72[_0x1c9cd3][_0x7395('0x7d')],function(_0x35001c){return{'name':_0x35001c,'value':_0x35001c};}):[]});}}return{'count':_0x303155['length'],'rows':_0x303155};}else{return{'count':0x0,'rows':[]};}})[_0x7395('0x26')](respondWithResult(_0x2e9267,null))[_0x7395('0x44')](function(_0x4f6406){var _0x30ad12=_0x79204[_0x7395('0x32')][_0x7395('0x7e')]?0x1f4:_0x4f6406[_0x7395('0x7f')]||0x1f4;logger[_0x7395('0x28')](_0x7395('0x80'),_0x7395('0x81'),_0x30ad12,JSON[_0x7395('0x82')](_0x4f6406));delete _0x4f6406[_0x7395('0x2a')];if(_0x30ad12===0x191){_0x30ad12=0x190;}_0x2e9267['status'](_0x30ad12)['send'](_0x79204[_0x7395('0x32')]['test']?{'message':_0x7395('0x83'),'statusCode':_0x4f6406[_0x7395('0x7f')]}:_0x4f6406);});}; \ No newline at end of file +var _0x00c6=['https://www.zohoapis.%s/crm/v2/settings/fields','Zoho-oauthtoken\x20','response','message','Owner','Subject','Description','WhoId','Call_Start_Time','Call_Type','remove','includes','system_mandatory','push','display_label','custom_field','picklist','pick_list_values','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','status','offset','limit','undefined','count','set','Content-Range','json','apply','reject','save','update','then','destroy','end','error','stack','name','send','map','ZohoAccount','rawAttributes','fieldName','type','key','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','filters','pick','filter','merge','VIRTUAL','options','where','findAll','rows','catch','includeAll','include','find','create','body','getConfigurations','findOne','params','ZohoConfiguration','addConfiguration','AccountId','Subjects','Descriptions','channel','ZohoField','zone','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','serverUrl','code','com','slice','substring','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account'];(function(_0x3227c1,_0x4318c5){var _0x31fd48=function(_0x5c5850){while(--_0x5c5850){_0x3227c1['push'](_0x3227c1['shift']());}};_0x31fd48(++_0x4318c5);}(_0x00c6,0x11b));var _0x600c=function(_0x43b447,_0x9e7eea){_0x43b447=_0x43b447-0x0;var _0x1c4046=_0x00c6[_0x43b447];return _0x1c4046;};'use strict';var emlformat=require(_0x600c('0x0'));var rimraf=require(_0x600c('0x1'));var zipdir=require(_0x600c('0x2'));var jsonpatch=require(_0x600c('0x3'));var rp=require(_0x600c('0x4'));var moment=require(_0x600c('0x5'));var BPromise=require(_0x600c('0x6'));var Mustache=require(_0x600c('0x7'));var util=require(_0x600c('0x8'));var path=require(_0x600c('0x9'));var sox=require(_0x600c('0xa'));var csv=require(_0x600c('0xb'));var ejs=require(_0x600c('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x600c('0xd'));var crypto=require(_0x600c('0xe'));var jsforce=require(_0x600c('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x600c('0xb'));var querystring=require(_0x600c('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x600c('0x11'));var qs=require(_0x600c('0x12'));var as=require(_0x600c('0x13'));var hardwareService=require(_0x600c('0x14'));var logger=require(_0x600c('0x15'))(_0x600c('0x16'));var utils=require(_0x600c('0x17'));var config=require(_0x600c('0x18'));var licenseUtil=require(_0x600c('0x19'));var db=require(_0x600c('0x1a'))['db'];var integrations=require(_0x600c('0x1b'));function respondWithStatusCode(_0x1a3952,_0x960191){_0x960191=_0x960191||0xcc;return function(_0x42efd2){if(_0x42efd2){return _0x1a3952['sendStatus'](_0x960191);}return _0x1a3952['status'](_0x960191)['end']();};}function respondWithResult(_0x1cc158,_0x39f16){_0x39f16=_0x39f16||0xc8;return function(_0x25d197){if(_0x25d197){return _0x1cc158[_0x600c('0x1c')](_0x39f16)['json'](_0x25d197);}};}function respondWithFilteredResult(_0x2e5c79,_0x366c42){return function(_0x34ead6){if(_0x34ead6){var _0x30b046=typeof _0x366c42[_0x600c('0x1d')]==='undefined'&&typeof _0x366c42[_0x600c('0x1e')]===_0x600c('0x1f');var _0x345a13=_0x34ead6[_0x600c('0x20')];var _0x56d82a=_0x30b046?0x0:_0x366c42[_0x600c('0x1d')];var _0xed3a49=_0x30b046?_0x34ead6[_0x600c('0x20')]:_0x366c42[_0x600c('0x1d')]+_0x366c42[_0x600c('0x1e')];var _0x24497a;if(_0xed3a49>=_0x345a13){_0xed3a49=_0x345a13;_0x24497a=0xc8;}else{_0x24497a=0xce;}_0x2e5c79[_0x600c('0x1c')](_0x24497a);return _0x2e5c79[_0x600c('0x21')](_0x600c('0x22'),_0x56d82a+'-'+_0xed3a49+'/'+_0x345a13)[_0x600c('0x23')](_0x34ead6);}return null;};}function patchUpdates(_0x14a22d){return function(_0x32f7fb){try{jsonpatch[_0x600c('0x24')](_0x32f7fb,_0x14a22d,!![]);}catch(_0x1642a5){return BPromise[_0x600c('0x25')](_0x1642a5);}return _0x32f7fb[_0x600c('0x26')]();};}function saveUpdates(_0x769200,_0x571b76){return function(_0x2de159){if(_0x2de159){return _0x2de159[_0x600c('0x27')](_0x769200)[_0x600c('0x28')](function(_0x4326cd){return _0x4326cd;});}return null;};}function removeEntity(_0x341390,_0x2c1b8b){return function(_0x37798f){if(_0x37798f){return _0x37798f[_0x600c('0x29')]()[_0x600c('0x28')](function(){_0x341390[_0x600c('0x1c')](0xcc)[_0x600c('0x2a')]();});}};}function handleEntityNotFound(_0x682272,_0x556223){return function(_0x4e97b5){if(!_0x4e97b5){_0x682272['sendStatus'](0x194);}return _0x4e97b5;};}function handleError(_0x1dd8b3,_0x1185d2){_0x1185d2=_0x1185d2||0x1f4;return function(_0x2b438b){logger[_0x600c('0x2b')](_0x2b438b[_0x600c('0x2c')]);if(_0x2b438b[_0x600c('0x2d')]){delete _0x2b438b['name'];}_0x1dd8b3[_0x600c('0x1c')](_0x1185d2)[_0x600c('0x2e')](_0x2b438b);};}exports['index']=function(_0x3bf39b,_0x25c6d6){var _0xda24e6={},_0x436376={},_0x48b898={'count':0x0,'rows':[]};var _0x1918c9=_[_0x600c('0x2f')](db[_0x600c('0x30')][_0x600c('0x31')],function(_0x4e802b){return{'name':_0x4e802b[_0x600c('0x32')],'type':_0x4e802b[_0x600c('0x33')][_0x600c('0x34')]};});_0x436376[_0x600c('0x35')]=_[_0x600c('0x2f')](_0x1918c9,'name');_0x436376[_0x600c('0x36')]=_[_0x600c('0x37')](_0x3bf39b[_0x600c('0x36')]);_0x436376['filters']=_['intersection'](_0x436376[_0x600c('0x35')],_0x436376['query']);_0xda24e6[_0x600c('0x38')]=_[_0x600c('0x39')](_0x436376[_0x600c('0x35')],qs[_0x600c('0x3a')](_0x3bf39b[_0x600c('0x36')][_0x600c('0x3a')]));_0xda24e6['attributes']=_0xda24e6['attributes'][_0x600c('0x3b')]?_0xda24e6[_0x600c('0x38')]:_0x436376[_0x600c('0x35')];if(!_0x3bf39b[_0x600c('0x36')][_0x600c('0x3c')](_0x600c('0x3d'))){_0xda24e6[_0x600c('0x1e')]=qs[_0x600c('0x1e')](_0x3bf39b['query'][_0x600c('0x1e')]);_0xda24e6[_0x600c('0x1d')]=qs['offset'](_0x3bf39b[_0x600c('0x36')]['offset']);}_0xda24e6['order']=qs[_0x600c('0x3e')](_0x3bf39b[_0x600c('0x36')][_0x600c('0x3e')]);_0xda24e6['where']=qs[_0x600c('0x3f')](_[_0x600c('0x40')](_0x3bf39b[_0x600c('0x36')],_0x436376[_0x600c('0x3f')]),_0x1918c9);if(_0x3bf39b['query'][_0x600c('0x41')]){_0xda24e6['where']=_[_0x600c('0x42')](_0xda24e6['where'],{'$or':_[_0x600c('0x2f')](_0x1918c9,function(_0x12681e){if(_0x12681e['type']!==_0x600c('0x43')){var _0x43351d={};_0x43351d[_0x12681e[_0x600c('0x2d')]]={'$like':'%'+_0x3bf39b[_0x600c('0x36')]['filter']+'%'};return _0x43351d;}})});}_0xda24e6=_['merge']({},_0xda24e6,_0x3bf39b[_0x600c('0x44')]);var _0x461055={'where':_0xda24e6[_0x600c('0x45')]};return db[_0x600c('0x30')][_0x600c('0x20')](_0x461055)['then'](function(_0x13c145){_0x48b898[_0x600c('0x20')]=_0x13c145;if(_0x3bf39b['query']['includeAll']){_0xda24e6['include']=[{'all':!![]}];}return db[_0x600c('0x30')][_0x600c('0x46')](_0xda24e6);})[_0x600c('0x28')](function(_0xfd876e){_0x48b898[_0x600c('0x47')]=_0xfd876e;return _0x48b898;})[_0x600c('0x28')](respondWithFilteredResult(_0x25c6d6,_0xda24e6))[_0x600c('0x48')](handleError(_0x25c6d6,null));};exports['show']=function(_0x407ee3,_0x4871e1){var _0x5fc171={'raw':![],'where':{'id':_0x407ee3['params']['id']}},_0x4795f1={};_0x4795f1[_0x600c('0x35')]=_[_0x600c('0x37')](db['ZohoAccount'][_0x600c('0x31')]);_0x4795f1[_0x600c('0x36')]=_['keys'](_0x407ee3[_0x600c('0x36')]);_0x4795f1['filters']=_['intersection'](_0x4795f1[_0x600c('0x35')],_0x4795f1[_0x600c('0x36')]);_0x5fc171[_0x600c('0x38')]=_[_0x600c('0x39')](_0x4795f1['model'],qs['fields'](_0x407ee3[_0x600c('0x36')][_0x600c('0x3a')]));_0x5fc171[_0x600c('0x38')]=_0x5fc171['attributes'][_0x600c('0x3b')]?_0x5fc171['attributes']:_0x4795f1[_0x600c('0x35')];if(_0x407ee3['query'][_0x600c('0x49')]){_0x5fc171[_0x600c('0x4a')]=[{'all':!![]}];}_0x5fc171=_[_0x600c('0x42')]({},_0x5fc171,_0x407ee3[_0x600c('0x44')]);return db[_0x600c('0x30')][_0x600c('0x4b')](_0x5fc171)[_0x600c('0x28')](handleEntityNotFound(_0x4871e1,null))[_0x600c('0x28')](respondWithResult(_0x4871e1,null))[_0x600c('0x48')](handleError(_0x4871e1,null));};exports[_0x600c('0x4c')]=function(_0x1144fc,_0x2b3a11){return db[_0x600c('0x30')]['create'](_0x1144fc['body'],{})[_0x600c('0x28')](respondWithResult(_0x2b3a11,0xc9))['catch'](handleError(_0x2b3a11,null));};exports[_0x600c('0x27')]=function(_0x748791,_0x267c1d){if(_0x748791[_0x600c('0x4d')]['id']){delete _0x748791[_0x600c('0x4d')]['id'];}return db[_0x600c('0x30')][_0x600c('0x4b')]({'where':{'id':_0x748791['params']['id']}})[_0x600c('0x28')](handleEntityNotFound(_0x267c1d,null))['then'](saveUpdates(_0x748791[_0x600c('0x4d')],null))[_0x600c('0x28')](respondWithResult(_0x267c1d,null))[_0x600c('0x48')](handleError(_0x267c1d,null));};exports[_0x600c('0x29')]=function(_0x3f6773,_0x4a159b){return db['ZohoAccount'][_0x600c('0x4b')]({'where':{'id':_0x3f6773['params']['id']}})[_0x600c('0x28')](handleEntityNotFound(_0x4a159b,null))[_0x600c('0x28')](removeEntity(_0x4a159b,null))[_0x600c('0x48')](handleError(_0x4a159b,null));};exports[_0x600c('0x4e')]=function(_0x194b39,_0x578101,_0xcc15d9){var _0x4d3d96={};var _0x312e0a={};var _0x1bece9;var _0x4741d0;return db[_0x600c('0x30')][_0x600c('0x4f')]({'where':{'id':_0x194b39[_0x600c('0x50')]['id']}})[_0x600c('0x28')](handleEntityNotFound(_0x578101,null))[_0x600c('0x28')](function(_0x33327f){if(_0x33327f){_0x1bece9=_0x33327f;_0x312e0a[_0x600c('0x35')]=_['keys'](db[_0x600c('0x51')][_0x600c('0x31')]);_0x312e0a[_0x600c('0x36')]=_['keys'](_0x194b39[_0x600c('0x36')]);_0x312e0a[_0x600c('0x3f')]=_[_0x600c('0x39')](_0x312e0a[_0x600c('0x35')],_0x312e0a[_0x600c('0x36')]);_0x4d3d96[_0x600c('0x38')]=_[_0x600c('0x39')](_0x312e0a[_0x600c('0x35')],qs[_0x600c('0x3a')](_0x194b39[_0x600c('0x36')][_0x600c('0x3a')]));_0x4d3d96[_0x600c('0x38')]=_0x4d3d96[_0x600c('0x38')]['length']?_0x4d3d96[_0x600c('0x38')]:_0x312e0a['model'];_0x4d3d96['order']=qs['sort'](_0x194b39[_0x600c('0x36')][_0x600c('0x3e')]);_0x4d3d96[_0x600c('0x45')]=qs['filters'](_[_0x600c('0x40')](_0x194b39['query'],_0x312e0a['filters']));if(_0x194b39['query'][_0x600c('0x41')]){_0x4d3d96[_0x600c('0x45')]=_[_0x600c('0x42')](_0x4d3d96[_0x600c('0x45')],{'$or':_[_0x600c('0x2f')](_0x4d3d96[_0x600c('0x38')],function(_0xd5ea8){var _0x202e34={};_0x202e34[_0xd5ea8]={'$like':'%'+_0x194b39[_0x600c('0x36')][_0x600c('0x41')]+'%'};return _0x202e34;})});}_0x4d3d96=_['merge']({},_0x4d3d96,_0x194b39['options']);return _0x1bece9['getConfigurations'](_0x4d3d96);}})[_0x600c('0x28')](function(_0x1cde6d){if(_0x1cde6d){_0x4741d0=_0x1cde6d[_0x600c('0x3b')];if(!_0x194b39['query'][_0x600c('0x3c')](_0x600c('0x3d'))){_0x4d3d96[_0x600c('0x1e')]=qs[_0x600c('0x1e')](_0x194b39['query']['limit']);_0x4d3d96['offset']=qs[_0x600c('0x1d')](_0x194b39[_0x600c('0x36')][_0x600c('0x1d')]);}return _0x1bece9['getConfigurations'](_0x4d3d96);}})[_0x600c('0x28')](function(_0x3c5d09){if(_0x3c5d09){return _0x3c5d09?{'count':_0x4741d0,'rows':_0x3c5d09}:null;}})[_0x600c('0x28')](respondWithResult(_0x578101,null))['catch'](handleError(_0x578101,null));};exports[_0x600c('0x52')]=function(_0x4c5d5f,_0x479515,_0x10637c){if(_0x4c5d5f[_0x600c('0x4d')]['id']){delete _0x4c5d5f[_0x600c('0x4d')]['id'];}return db['ZohoAccount'][_0x600c('0x4f')]({'where':{'id':_0x4c5d5f[_0x600c('0x50')]['id']}})[_0x600c('0x28')](handleEntityNotFound(_0x479515,null))[_0x600c('0x28')](function(_0x3f3f47){if(_0x3f3f47){_0x4c5d5f['body'][_0x600c('0x53')]=_0x3f3f47['id'];_0x4c5d5f[_0x600c('0x4d')][_0x600c('0x54')]=integrations['getSubjects'](_0x4c5d5f['body']['channel'],_0x4c5d5f['body'][_0x600c('0x33')]);_0x4c5d5f[_0x600c('0x4d')][_0x600c('0x55')]=integrations['getDescriptions'](_0x4c5d5f[_0x600c('0x4d')][_0x600c('0x56')],_0x4c5d5f[_0x600c('0x4d')][_0x600c('0x33')]);return db[_0x600c('0x51')][_0x600c('0x4c')](_0x4c5d5f[_0x600c('0x4d')],{'include':[{'model':db[_0x600c('0x57')],'as':_0x600c('0x54')},{'model':db[_0x600c('0x57')],'as':'Descriptions'}]});}return null;})[_0x600c('0x28')](respondWithResult(_0x479515,null))[_0x600c('0x48')](handleError(_0x479515,null));};function getAccessToken(_0x2422f1){return new Promise(function(_0x431d4f,_0x446ca4){var _0x3372f4;switch(_0x2422f1[_0x600c('0x58')]){case'US':_0x3372f4='https://accounts.zoho.com';break;case'AU':_0x3372f4='https://accounts.zoho.com.au';break;case'EU':_0x3372f4=_0x600c('0x59');break;case'IN':_0x3372f4=_0x600c('0x5a');break;case'CN':_0x3372f4=_0x600c('0x5b');break;default:_0x3372f4=_0x600c('0x59');break;}var _0x48b0b3={'method':_0x600c('0x5c'),'uri':_0x3372f4+_0x600c('0x5d'),'qs':{'refresh_token':_0x2422f1[_0x600c('0x5e')],'client_id':_0x2422f1[_0x600c('0x5f')],'client_secret':_0x2422f1[_0x600c('0x60')],'grant_type':_0x600c('0x61')},'json':!![]};return rp(_0x48b0b3)[_0x600c('0x28')](function(_0x2a7c1c){if(_0x2a7c1c[_0x600c('0x62')]){_0x431d4f(_0x2a7c1c['access_token']);}else{_0x446ca4(_0x600c('0x63'));}})[_0x600c('0x48')](function(_0x481a3d){_0x446ca4(_0x481a3d);});});}exports[_0x600c('0x64')]=function(_0x20b176,_0x5bf93f,_0x5674a2){var _0x199a97,_0x27ea58,_0x4d43b4,_0x354893,_0xe3235b;return db[_0x600c('0x30')]['findOne']({'where':{'id':_0x20b176[_0x600c('0x50')]['id']},'attributes':['id','host','zone',_0x600c('0x5f'),'clientSecret',_0x600c('0x65'),_0x600c('0x66'),_0x600c('0x5e')]})['then'](handleEntityNotFound(_0x5bf93f,null))[_0x600c('0x28')](function(_0x449ca0){_0xe3235b=_0x449ca0;_0x199a97=_0xe3235b['host'];_0x27ea58=_0x199a97==='zoho.eu'?'eu':_0x600c('0x67');_0x4d43b4=_0xe3235b[_0x600c('0x65')];var _0x7806ad=_0x4d43b4[_0x600c('0x68')](-0x1);if(_0x7806ad==='/'||_0x7806ad==='\x5c'||_0x7806ad===':'){_0x4d43b4=_0x4d43b4[_0x600c('0x69')](0x0,_0x4d43b4['lastIndexOf'](_0x7806ad));}if(!_0xe3235b['refreshToken']){throw new Error(_0x600c('0x6a'));}return getAccessToken(_0xe3235b);})[_0x600c('0x28')](function(_0x1cf7d6){if(_0x1cf7d6){return rp({'method':'GET','uri':util['format'](_0x600c('0x6b'),_0x27ea58),'qs':{'module':'Calls'},'headers':{'Authorization':_0x600c('0x6c')+_0x1cf7d6},'json':!![]});}})[_0x600c('0x28')](function(_0x2c62d0){if(_0x2c62d0){if(_0x2c62d0[_0x600c('0x6d')]&&_0x2c62d0['response'][_0x600c('0x2b')]){throw new Error(_0x2c62d0[_0x600c('0x6d')]['error'][_0x600c('0x6e')]);}var _0x168dbf=[];var _0x325b6c=[];var _0x1b90e4=[_0x600c('0x6f'),_0x600c('0x70'),_0x600c('0x71'),_0x600c('0x72'),'Call_Duration','Call_Result',_0x600c('0x73'),_0x600c('0x74')];_0x325b6c=_[_0x600c('0x75')](_0x2c62d0['fields'],function(_0x1e38dd){return _0x1b90e4[_0x600c('0x76')](_0x1e38dd['api_name']);});for(var _0x106243=0x0;_0x106243<_0x325b6c[_0x600c('0x3b')];_0x106243++){if(_0x325b6c[_0x106243][_0x600c('0x77')]===![]){_0x168dbf[_0x600c('0x78')]({'id':_0x325b6c[_0x106243]['id'],'name':_0x325b6c[_0x106243][_0x600c('0x79')],'custom':_0x325b6c[_0x106243][_0x600c('0x7a')],'options':_0x325b6c[_0x106243]['data_type']===_0x600c('0x7b')&&_0x325b6c[_0x106243][_0x600c('0x7c')][_0x600c('0x3b')]>-0x1?_[_0x600c('0x2f')](_0x325b6c[_0x106243][_0x600c('0x7c')],function(_0x4d59ee){return{'name':_0x4d59ee,'value':_0x4d59ee};}):[]});}}return{'count':_0x168dbf[_0x600c('0x3b')],'rows':_0x168dbf};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithResult(_0x5bf93f,null))[_0x600c('0x48')](function(_0x38bb62){var _0x303b44=_0x20b176[_0x600c('0x36')][_0x600c('0x7d')]?0x1f4:_0x38bb62[_0x600c('0x7e')]||0x1f4;logger['error'](_0x600c('0x7f'),_0x600c('0x64'),_0x303b44,JSON[_0x600c('0x80')](_0x38bb62));delete _0x38bb62[_0x600c('0x2d')];if(_0x303b44===0x191){_0x303b44=0x190;}_0x5bf93f[_0x600c('0x1c')](_0x303b44)['send'](_0x20b176['query']['test']?{'message':_0x600c('0x81'),'statusCode':_0x38bb62[_0x600c('0x7e')]}:_0x38bb62);});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.model.js b/server/api/intZohoAccount/intZohoAccount.model.js index f23684d..e8fb3fd 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 _0x85ee=['path','rimraf','./intZohoAccount.attributes','../../components/integrations/configuration','exports','int_zoho_accounts','changed','serverUrl','clientId','clientSecret','code','host','substring','lastIndexOf','zone','https://accounts.zoho.com.au','POST','/oauth/v2/token','authorization_code','application/x-www-form-urlencoded','then','parse','refreshToken','refresh_token','info','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','name','format','inspect','catch','error','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','slice','https://accounts.zoho.com','https://accounts.zoho.com.cn','https://accounts.zoho.eu','util','../../config/logger','bluebird','request-promise'];(function(_0x34def0,_0x554b5b){var _0x2be1c9=function(_0x45b895){while(--_0x45b895){_0x34def0['push'](_0x34def0['shift']());}};_0x2be1c9(++_0x554b5b);}(_0x85ee,0x18c));var _0xe85e=function(_0x3be062,_0x392ff0){_0x3be062=_0x3be062-0x0;var _0x336579=_0x85ee[_0x3be062];return _0x336579;};'use strict';var _=require('lodash');var util=require(_0xe85e('0x0'));var logger=require(_0xe85e('0x1'))('api');var moment=require('moment');var BPromise=require(_0xe85e('0x2'));var rp=require(_0xe85e('0x3'));var fs=require('fs');var path=require(_0xe85e('0x4'));var rimraf=require(_0xe85e('0x5'));var config=require('../../config/environment');var attributes=require(_0xe85e('0x6'));var integrations=require(_0xe85e('0x7'));module[_0xe85e('0x8')]=function(_0xfe54fa,_0x5c6045){return _0xfe54fa['define']('ZohoAccount',attributes,{'tableName':_0xe85e('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x41f788,_0xb86769,_0xb7c9b0){if(_0x41f788[_0xe85e('0xa')]('zone')||_0x41f788[_0xe85e('0xa')](_0xe85e('0xb'))||_0x41f788[_0xe85e('0xa')](_0xe85e('0xc'))||_0x41f788[_0xe85e('0xa')](_0xe85e('0xd'))||_0x41f788[_0xe85e('0xa')](_0xe85e('0xe'))||_0x41f788[_0xe85e('0xa')](_0xe85e('0xf'))){var _0x18b97a,_0x32a91c;_0x18b97a=_0x41f788[_0xe85e('0xb')];var _0x4a08ca=_0x18b97a['slice'](-0x1);if(_0x4a08ca==='/'||_0x4a08ca==='\x5c'||_0x4a08ca===':'){_0x18b97a=_0x18b97a[_0xe85e('0x10')](0x0,_0x18b97a[_0xe85e('0x11')](_0x4a08ca));}switch(_0x41f788[_0xe85e('0x12')]){case'US':_0x32a91c='https://accounts.zoho.com';break;case'AU':_0x32a91c=_0xe85e('0x13');break;case'IN':_0x32a91c='https://accounts.zoho.in';break;case'CN':_0x32a91c='https://accounts.zoho.com.cn';break;default:_0x32a91c='https://accounts.zoho.eu';break;}var _0x5dded2={'method':_0xe85e('0x14'),'uri':_0x32a91c+_0xe85e('0x15'),'form':{'grant_type':_0xe85e('0x16'),'client_id':_0x41f788[_0xe85e('0xc')],'client_secret':_0x41f788[_0xe85e('0xd')],'redirect_uri':_0x41f788['serverUrl'],'code':_0x41f788['code']},'headers':{'Content-Type':_0xe85e('0x17')}};return rp(_0x5dded2)[_0xe85e('0x18')](function(_0x3081fd){var _0xaba7f4=JSON[_0xe85e('0x19')](_0x3081fd);if(_0xaba7f4['refresh_token']){_0x41f788[_0xe85e('0x1a')]=_0xaba7f4[_0xe85e('0x1b')];logger[_0xe85e('0x1c')](util['format'](_0xe85e('0x1d'),_0x41f788[_0xe85e('0x1e')],_0x41f788['id']));}else{logger['error'](util[_0xe85e('0x1f')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x41f788['name'],_0x41f788['id']),util[_0xe85e('0x20')](_0xaba7f4,{'showHidden':![],'depth':null}));}return _0xb7c9b0(null,_0xb86769);})[_0xe85e('0x21')](function(_0x5879bf){logger[_0xe85e('0x22')](util['format'](_0xe85e('0x23'),_0x41f788['name'],_0x41f788['id']),util[_0xe85e('0x20')](parsedResult,{'showHidden':![],'depth':null}));return _0xb7c9b0(_0x5879bf);});}else{return _0xb7c9b0(null,_0xb86769);}},'beforeUpdate':function(_0xef6c76,_0x35b2b2,_0x3127d6){if(_0xef6c76[_0xe85e('0xa')](_0xe85e('0x12'))||_0xef6c76[_0xe85e('0xa')]('serverUrl')||_0xef6c76['changed']('clientId')||_0xef6c76['changed'](_0xe85e('0xd'))||_0xef6c76[_0xe85e('0xa')]('code')||_0xef6c76[_0xe85e('0xa')](_0xe85e('0xf'))){var _0x1d2198,_0x54507c;_0x1d2198=_0xef6c76['serverUrl'];var _0x6602e9=_0x1d2198[_0xe85e('0x24')](-0x1);if(_0x6602e9==='/'||_0x6602e9==='\x5c'||_0x6602e9===':'){_0x1d2198=_0x1d2198[_0xe85e('0x10')](0x0,_0x1d2198[_0xe85e('0x11')](_0x6602e9));}switch(_0xef6c76['zone']){case'US':_0x54507c=_0xe85e('0x25');break;case'AU':_0x54507c='https://accounts.zoho.com.au';break;case'IN':_0x54507c='https://accounts.zoho.in';break;case'CN':_0x54507c=_0xe85e('0x26');break;default:_0x54507c=_0xe85e('0x27');break;}var _0xb5e8e5={'method':'POST','uri':_0x54507c+_0xe85e('0x15'),'form':{'grant_type':_0xe85e('0x16'),'client_id':_0xef6c76[_0xe85e('0xc')],'client_secret':_0xef6c76[_0xe85e('0xd')],'redirect_uri':_0xef6c76[_0xe85e('0xb')],'code':_0xef6c76[_0xe85e('0xe')]},'headers':{'Content-Type':'application/x-www-form-urlencoded'}};return rp(_0xb5e8e5)[_0xe85e('0x18')](function(_0x59801c){var _0x373b8b=JSON[_0xe85e('0x19')](_0x59801c);if(_0x373b8b['refresh_token']){_0xef6c76['refreshToken']=_0x373b8b[_0xe85e('0x1b')];logger[_0xe85e('0x1c')](util[_0xe85e('0x1f')](_0xe85e('0x1d'),_0xef6c76[_0xe85e('0x1e')],_0xef6c76['id']));}else{logger[_0xe85e('0x22')](util[_0xe85e('0x1f')](_0xe85e('0x23'),_0xef6c76[_0xe85e('0x1e')],_0xef6c76['id']),util[_0xe85e('0x20')](_0x373b8b,{'showHidden':![],'depth':null}));}return _0x3127d6(null,_0x35b2b2);})['catch'](function(_0x1b17b6){logger['error'](util[_0xe85e('0x1f')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0xef6c76[_0xe85e('0x1e')],_0xef6c76['id']),util[_0xe85e('0x20')](parsedResult,{'showHidden':![],'depth':null}));return _0x3127d6(_0x1b17b6);});}else{return _0x3127d6(null,_0x35b2b2);}}}});}; \ No newline at end of file +var _0xadfa=['inspect','catch','host','https://accounts.zoho.com','/oauth/v2/token','parse','lodash','util','../../config/logger','api','moment','bluebird','path','../../config/environment','./intZohoAccount.attributes','../../components/integrations/configuration','exports','define','ZohoAccount','int_zoho_accounts','zone','changed','clientId','code','serverUrl','slice','substring','lastIndexOf','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.com.cn','https://accounts.zoho.eu','POST','authorization_code','clientSecret','then','refresh_token','refreshToken','info','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','name','error','format'];(function(_0x53f34d,_0x5902b6){var _0x55028f=function(_0x571da5){while(--_0x571da5){_0x53f34d['push'](_0x53f34d['shift']());}};_0x55028f(++_0x5902b6);}(_0xadfa,0x133));var _0xaadf=function(_0x4a8e73,_0x2993f5){_0x4a8e73=_0x4a8e73-0x0;var _0x298d2c=_0xadfa[_0x4a8e73];return _0x298d2c;};'use strict';var _=require(_0xaadf('0x0'));var util=require(_0xaadf('0x1'));var logger=require(_0xaadf('0x2'))(_0xaadf('0x3'));var moment=require(_0xaadf('0x4'));var BPromise=require(_0xaadf('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xaadf('0x6'));var rimraf=require('rimraf');var config=require(_0xaadf('0x7'));var attributes=require(_0xaadf('0x8'));var integrations=require(_0xaadf('0x9'));module[_0xaadf('0xa')]=function(_0x59c265,_0x3bb514){return _0x59c265[_0xaadf('0xb')](_0xaadf('0xc'),attributes,{'tableName':_0xaadf('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x5383b4,_0x50c71d,_0x545b87){if(_0x5383b4['changed'](_0xaadf('0xe'))||_0x5383b4[_0xaadf('0xf')]('serverUrl')||_0x5383b4[_0xaadf('0xf')](_0xaadf('0x10'))||_0x5383b4['changed']('clientSecret')||_0x5383b4['changed'](_0xaadf('0x11'))||_0x5383b4[_0xaadf('0xf')]('host')){var _0x25dd9f,_0x23ca2a;_0x25dd9f=_0x5383b4[_0xaadf('0x12')];var _0x17c420=_0x25dd9f[_0xaadf('0x13')](-0x1);if(_0x17c420==='/'||_0x17c420==='\x5c'||_0x17c420===':'){_0x25dd9f=_0x25dd9f[_0xaadf('0x14')](0x0,_0x25dd9f[_0xaadf('0x15')](_0x17c420));}switch(_0x5383b4[_0xaadf('0xe')]){case'US':_0x23ca2a='https://accounts.zoho.com';break;case'AU':_0x23ca2a=_0xaadf('0x16');break;case'IN':_0x23ca2a=_0xaadf('0x17');break;case'CN':_0x23ca2a=_0xaadf('0x18');break;default:_0x23ca2a=_0xaadf('0x19');break;}var _0x1dac9a={'method':_0xaadf('0x1a'),'uri':_0x23ca2a+'/oauth/v2/token','form':{'grant_type':_0xaadf('0x1b'),'client_id':_0x5383b4['clientId'],'client_secret':_0x5383b4[_0xaadf('0x1c')],'redirect_uri':_0x5383b4[_0xaadf('0x12')],'code':_0x5383b4['code']},'headers':{'Content-Type':'application/x-www-form-urlencoded'}};return rp(_0x1dac9a)[_0xaadf('0x1d')](function(_0x5b67e0){var _0x3fc887=JSON['parse'](_0x5b67e0);if(_0x3fc887[_0xaadf('0x1e')]){_0x5383b4[_0xaadf('0x1f')]=_0x3fc887[_0xaadf('0x1e')];logger[_0xaadf('0x20')](util['format'](_0xaadf('0x21'),_0x5383b4[_0xaadf('0x22')],_0x5383b4['id']));}else{logger[_0xaadf('0x23')](util[_0xaadf('0x24')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x5383b4['name'],_0x5383b4['id']),util[_0xaadf('0x25')](_0x3fc887,{'showHidden':![],'depth':null}));}return _0x545b87(null,_0x50c71d);})[_0xaadf('0x26')](function(_0x640933){logger[_0xaadf('0x23')](util[_0xaadf('0x24')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x5383b4[_0xaadf('0x22')],_0x5383b4['id']),util[_0xaadf('0x25')](parsedResult,{'showHidden':![],'depth':null}));return _0x545b87(_0x640933);});}else{return _0x545b87(null,_0x50c71d);}},'beforeUpdate':function(_0x5a06cb,_0x4abed7,_0x1c067d){if(_0x5a06cb['changed'](_0xaadf('0xe'))||_0x5a06cb['changed'](_0xaadf('0x12'))||_0x5a06cb[_0xaadf('0xf')](_0xaadf('0x10'))||_0x5a06cb['changed'](_0xaadf('0x1c'))||_0x5a06cb[_0xaadf('0xf')](_0xaadf('0x11'))||_0x5a06cb[_0xaadf('0xf')](_0xaadf('0x27'))){var _0x117ad1,_0x54d250;_0x117ad1=_0x5a06cb[_0xaadf('0x12')];var _0x357dcb=_0x117ad1[_0xaadf('0x13')](-0x1);if(_0x357dcb==='/'||_0x357dcb==='\x5c'||_0x357dcb===':'){_0x117ad1=_0x117ad1[_0xaadf('0x14')](0x0,_0x117ad1[_0xaadf('0x15')](_0x357dcb));}switch(_0x5a06cb['zone']){case'US':_0x54d250=_0xaadf('0x28');break;case'AU':_0x54d250=_0xaadf('0x16');break;case'IN':_0x54d250=_0xaadf('0x17');break;case'CN':_0x54d250=_0xaadf('0x18');break;default:_0x54d250=_0xaadf('0x19');break;}var _0x56991f={'method':_0xaadf('0x1a'),'uri':_0x54d250+_0xaadf('0x29'),'form':{'grant_type':'authorization_code','client_id':_0x5a06cb[_0xaadf('0x10')],'client_secret':_0x5a06cb['clientSecret'],'redirect_uri':_0x5a06cb[_0xaadf('0x12')],'code':_0x5a06cb[_0xaadf('0x11')]},'headers':{'Content-Type':'application/x-www-form-urlencoded'}};return rp(_0x56991f)[_0xaadf('0x1d')](function(_0x42797e){var _0x13f2f1=JSON[_0xaadf('0x2a')](_0x42797e);if(_0x13f2f1[_0xaadf('0x1e')]){_0x5a06cb[_0xaadf('0x1f')]=_0x13f2f1['refresh_token'];logger[_0xaadf('0x20')](util[_0xaadf('0x24')](_0xaadf('0x21'),_0x5a06cb[_0xaadf('0x22')],_0x5a06cb['id']));}else{logger[_0xaadf('0x23')](util[_0xaadf('0x24')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x5a06cb[_0xaadf('0x22')],_0x5a06cb['id']),util[_0xaadf('0x25')](_0x13f2f1,{'showHidden':![],'depth':null}));}return _0x1c067d(null,_0x4abed7);})[_0xaadf('0x26')](function(_0xb96c45){logger['error'](util['format']('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x5a06cb[_0xaadf('0x22')],_0x5a06cb['id']),util[_0xaadf('0x25')](parsedResult,{'showHidden':![],'depth':null}));return _0x1c067d(_0xb96c45);});}else{return _0x1c067d(null,_0x4abed7);}}}});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.rpc.js b/server/api/intZohoAccount/intZohoAccount.rpc.js index c3e6c8f..b593a01 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 _0xbcae=['request\x20sent','stringify','error','code','message','result','GetZohoAccount','findAll','options','raw','where','attributes','limit','include','map','model','debug','catch','ShowZohoAccount','ZohoAccount','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info','ZohoAccount,\x20%s,\x20%s'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xbcae,0xa9));var _0xebca=function(_0x35c3fe,_0x37a5dc){_0x35c3fe=_0x35c3fe-0x0;var _0x2ec18c=_0xbcae[_0x35c3fe];return _0x2ec18c;};'use strict';var _=require(_0xebca('0x0'));var util=require(_0xebca('0x1'));var moment=require(_0xebca('0x2'));var BPromise=require(_0xebca('0x3'));var rs=require(_0xebca('0x4'));var fs=require('fs');var Redis=require(_0xebca('0x5'));var db=require(_0xebca('0x6'))['db'];var utils=require(_0xebca('0x7'));var logger=require(_0xebca('0x8'))(_0xebca('0x9'));var config=require('../../config/environment');var jayson=require(_0xebca('0xa'));var client=jayson[_0xebca('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x331ef7,_0x3781e0,_0x3830a6){return new BPromise(function(_0x49cea1,_0x27bf87){return client[_0xebca('0xc')](_0x331ef7,_0x3830a6)[_0xebca('0xd')](function(_0x1a371f){logger[_0xebca('0xe')](_0xebca('0xf'),_0x3781e0,'request\x20sent');logger['debug']('ZohoAccount,\x20%s,\x20%s,\x20%s',_0x3781e0,_0xebca('0x10'),JSON[_0xebca('0x11')](_0x1a371f));if(_0x1a371f[_0xebca('0x12')]){if(_0x1a371f[_0xebca('0x12')][_0xebca('0x13')]===0x1f4){logger['error'](_0xebca('0xf'),_0x3781e0,_0x1a371f[_0xebca('0x12')][_0xebca('0x14')]);return _0x27bf87(_0x1a371f[_0xebca('0x12')][_0xebca('0x14')]);}logger[_0xebca('0x12')](_0xebca('0xf'),_0x3781e0,_0x1a371f[_0xebca('0x12')]['message']);return _0x49cea1(_0x1a371f['error'][_0xebca('0x14')]);}else{logger['info'](_0xebca('0xf'),_0x3781e0,_0xebca('0x10'));_0x49cea1(_0x1a371f[_0xebca('0x15')][_0xebca('0x14')]);}})['catch'](function(_0x33f471){logger[_0xebca('0x12')](_0xebca('0xf'),_0x3781e0,_0x33f471);_0x27bf87(_0x33f471);});});}exports[_0xebca('0x16')]=function(_0x500855){var _0x3ee019=this;return new Promise(function(_0x12ed50,_0x23b411){return db['ZohoAccount'][_0xebca('0x17')]({'raw':_0x500855[_0xebca('0x18')]?_0x500855['options'][_0xebca('0x19')]===undefined?!![]:![]:!![],'where':_0x500855[_0xebca('0x18')]?_0x500855[_0xebca('0x18')][_0xebca('0x1a')]||null:null,'attributes':_0x500855[_0xebca('0x18')]?_0x500855[_0xebca('0x18')][_0xebca('0x1b')]||null:null,'limit':_0x500855[_0xebca('0x18')]?_0x500855[_0xebca('0x18')][_0xebca('0x1c')]||null:null,'include':_0x500855[_0xebca('0x18')]?_0x500855[_0xebca('0x18')][_0xebca('0x1d')]?_[_0xebca('0x1e')](_0x500855['options'][_0xebca('0x1d')],function(_0x41d17e){return{'model':db[_0x41d17e[_0xebca('0x1f')]],'as':_0x41d17e['as'],'attributes':_0x41d17e['attributes'],'include':_0x41d17e['include']?_[_0xebca('0x1e')](_0x41d17e[_0xebca('0x1d')],function(_0x555a9a){return{'model':db[_0x555a9a[_0xebca('0x1f')]],'as':_0x555a9a['as'],'attributes':_0x555a9a[_0xebca('0x1b')],'include':_0x555a9a[_0xebca('0x1d')]?_['map'](_0x555a9a[_0xebca('0x1d')],function(_0x23557b){return{'model':db[_0x23557b[_0xebca('0x1f')]],'as':_0x23557b['as'],'attributes':_0x23557b[_0xebca('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xebca('0xd')](function(_0x1652e4){logger[_0xebca('0xe')](_0xebca('0x16'),_0x500855);logger[_0xebca('0x20')](_0xebca('0x16'),_0x500855,JSON[_0xebca('0x11')](_0x1652e4));_0x12ed50(_0x1652e4);})[_0xebca('0x21')](function(_0xf66ad3){logger[_0xebca('0x12')](_0xebca('0x16'),_0xf66ad3[_0xebca('0x14')],_0x500855);_0x23b411(_0x3ee019[_0xebca('0x12')](0x1f4,_0xf66ad3[_0xebca('0x14')]));});});};exports[_0xebca('0x22')]=function(_0x166112){var _0x217398=this;return new Promise(function(_0x2a62a4,_0x1aeac4){return db[_0xebca('0x23')][_0xebca('0x24')]({'raw':_0x166112[_0xebca('0x18')]?_0x166112['options'][_0xebca('0x19')]===undefined?!![]:![]:!![],'where':_0x166112[_0xebca('0x18')]?_0x166112[_0xebca('0x18')]['where']||null:null,'attributes':_0x166112['options']?_0x166112[_0xebca('0x18')][_0xebca('0x1b')]||null:null,'include':_0x166112[_0xebca('0x18')]?_0x166112[_0xebca('0x18')][_0xebca('0x1d')]?_[_0xebca('0x1e')](_0x166112[_0xebca('0x18')][_0xebca('0x1d')],function(_0x340b7c){return{'model':db[_0x340b7c[_0xebca('0x1f')]],'as':_0x340b7c['as'],'attributes':_0x340b7c['attributes'],'include':_0x340b7c[_0xebca('0x1d')]?_[_0xebca('0x1e')](_0x340b7c[_0xebca('0x1d')],function(_0x3885d1){return{'model':db[_0x3885d1['model']],'as':_0x3885d1['as'],'attributes':_0x3885d1[_0xebca('0x1b')],'include':_0x3885d1[_0xebca('0x1d')]?_[_0xebca('0x1e')](_0x3885d1[_0xebca('0x1d')],function(_0x21fcd0){return{'model':db[_0x21fcd0[_0xebca('0x1f')]],'as':_0x21fcd0['as'],'attributes':_0x21fcd0[_0xebca('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xebca('0xd')](function(_0x2e2933){logger[_0xebca('0xe')](_0xebca('0x22'),_0x166112);logger[_0xebca('0x20')](_0xebca('0x22'),_0x166112,JSON[_0xebca('0x11')](_0x2e2933));_0x2a62a4(_0x2e2933);})[_0xebca('0x21')](function(_0x4ecd9f){logger[_0xebca('0x12')]('ShowZohoAccount',_0x4ecd9f[_0xebca('0x14')],_0x166112);_0x1aeac4(_0x217398[_0xebca('0x12')](0x1f4,_0x4ecd9f['message']));});});}; \ No newline at end of file +var _0xba37=['stringify','error','code','message','result','GetZohoAccount','ZohoAccount','options','raw','limit','include','map','model','attributes','catch','ShowZohoAccount','where','lodash','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','info','ZohoAccount,\x20%s,\x20%s','request\x20sent','debug','ZohoAccount,\x20%s,\x20%s,\x20%s'];(function(_0x2e9d4c,_0x1e71ef){var _0x3f759e=function(_0x18eed1){while(--_0x18eed1){_0x2e9d4c['push'](_0x2e9d4c['shift']());}};_0x3f759e(++_0x1e71ef);}(_0xba37,0xb6));var _0x7ba3=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0xba37[_0x5d6456];return _0x4d66c1;};'use strict';var _=require(_0x7ba3('0x0'));var util=require('util');var moment=require(_0x7ba3('0x1'));var BPromise=require('bluebird');var rs=require(_0x7ba3('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7ba3('0x3'))['db'];var utils=require(_0x7ba3('0x4'));var logger=require(_0x7ba3('0x5'))(_0x7ba3('0x6'));var config=require(_0x7ba3('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x7ba3('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4b4052,_0x1cac44,_0x39d42a){return new BPromise(function(_0x539743,_0x3388e9){return client[_0x7ba3('0x9')](_0x4b4052,_0x39d42a)[_0x7ba3('0xa')](function(_0x108326){logger[_0x7ba3('0xb')](_0x7ba3('0xc'),_0x1cac44,_0x7ba3('0xd'));logger[_0x7ba3('0xe')](_0x7ba3('0xf'),_0x1cac44,'request\x20sent',JSON[_0x7ba3('0x10')](_0x108326));if(_0x108326[_0x7ba3('0x11')]){if(_0x108326[_0x7ba3('0x11')][_0x7ba3('0x12')]===0x1f4){logger['error'](_0x7ba3('0xc'),_0x1cac44,_0x108326[_0x7ba3('0x11')][_0x7ba3('0x13')]);return _0x3388e9(_0x108326[_0x7ba3('0x11')][_0x7ba3('0x13')]);}logger[_0x7ba3('0x11')](_0x7ba3('0xc'),_0x1cac44,_0x108326['error'][_0x7ba3('0x13')]);return _0x539743(_0x108326[_0x7ba3('0x11')][_0x7ba3('0x13')]);}else{logger[_0x7ba3('0xb')](_0x7ba3('0xc'),_0x1cac44,_0x7ba3('0xd'));_0x539743(_0x108326[_0x7ba3('0x14')][_0x7ba3('0x13')]);}})['catch'](function(_0x5e5e72){logger[_0x7ba3('0x11')](_0x7ba3('0xc'),_0x1cac44,_0x5e5e72);_0x3388e9(_0x5e5e72);});});}exports[_0x7ba3('0x15')]=function(_0x1ec30e){var _0x21a74b=this;return new Promise(function(_0x5e41f0,_0x3e8a79){return db[_0x7ba3('0x16')]['findAll']({'raw':_0x1ec30e[_0x7ba3('0x17')]?_0x1ec30e['options'][_0x7ba3('0x18')]===undefined?!![]:![]:!![],'where':_0x1ec30e[_0x7ba3('0x17')]?_0x1ec30e[_0x7ba3('0x17')]['where']||null:null,'attributes':_0x1ec30e['options']?_0x1ec30e[_0x7ba3('0x17')]['attributes']||null:null,'limit':_0x1ec30e[_0x7ba3('0x17')]?_0x1ec30e['options'][_0x7ba3('0x19')]||null:null,'include':_0x1ec30e['options']?_0x1ec30e[_0x7ba3('0x17')][_0x7ba3('0x1a')]?_[_0x7ba3('0x1b')](_0x1ec30e[_0x7ba3('0x17')][_0x7ba3('0x1a')],function(_0x949e6b){return{'model':db[_0x949e6b[_0x7ba3('0x1c')]],'as':_0x949e6b['as'],'attributes':_0x949e6b[_0x7ba3('0x1d')],'include':_0x949e6b['include']?_[_0x7ba3('0x1b')](_0x949e6b[_0x7ba3('0x1a')],function(_0x285951){return{'model':db[_0x285951[_0x7ba3('0x1c')]],'as':_0x285951['as'],'attributes':_0x285951['attributes'],'include':_0x285951['include']?_['map'](_0x285951['include'],function(_0x4d7bc7){return{'model':db[_0x4d7bc7[_0x7ba3('0x1c')]],'as':_0x4d7bc7['as'],'attributes':_0x4d7bc7[_0x7ba3('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x50bed9){logger[_0x7ba3('0xb')]('GetZohoAccount',_0x1ec30e);logger['debug'](_0x7ba3('0x15'),_0x1ec30e,JSON[_0x7ba3('0x10')](_0x50bed9));_0x5e41f0(_0x50bed9);})[_0x7ba3('0x1e')](function(_0x2ba832){logger[_0x7ba3('0x11')](_0x7ba3('0x15'),_0x2ba832[_0x7ba3('0x13')],_0x1ec30e);_0x3e8a79(_0x21a74b[_0x7ba3('0x11')](0x1f4,_0x2ba832[_0x7ba3('0x13')]));});});};exports[_0x7ba3('0x1f')]=function(_0x5702cb){var _0x258f3c=this;return new Promise(function(_0x4dd0b3,_0x407c42){return db['ZohoAccount']['find']({'raw':_0x5702cb['options']?_0x5702cb[_0x7ba3('0x17')][_0x7ba3('0x18')]===undefined?!![]:![]:!![],'where':_0x5702cb['options']?_0x5702cb['options'][_0x7ba3('0x20')]||null:null,'attributes':_0x5702cb['options']?_0x5702cb[_0x7ba3('0x17')]['attributes']||null:null,'include':_0x5702cb[_0x7ba3('0x17')]?_0x5702cb[_0x7ba3('0x17')][_0x7ba3('0x1a')]?_[_0x7ba3('0x1b')](_0x5702cb[_0x7ba3('0x17')][_0x7ba3('0x1a')],function(_0x178c19){return{'model':db[_0x178c19[_0x7ba3('0x1c')]],'as':_0x178c19['as'],'attributes':_0x178c19[_0x7ba3('0x1d')],'include':_0x178c19[_0x7ba3('0x1a')]?_['map'](_0x178c19['include'],function(_0x93d028){return{'model':db[_0x93d028['model']],'as':_0x93d028['as'],'attributes':_0x93d028['attributes'],'include':_0x93d028[_0x7ba3('0x1a')]?_[_0x7ba3('0x1b')](_0x93d028[_0x7ba3('0x1a')],function(_0xf66ca1){return{'model':db[_0xf66ca1[_0x7ba3('0x1c')]],'as':_0xf66ca1['as'],'attributes':_0xf66ca1['attributes']};}):[]};}):[]};}):[]:[]})[_0x7ba3('0xa')](function(_0x4d6202){logger[_0x7ba3('0xb')](_0x7ba3('0x1f'),_0x5702cb);logger[_0x7ba3('0xe')](_0x7ba3('0x1f'),_0x5702cb,JSON[_0x7ba3('0x10')](_0x4d6202));_0x4dd0b3(_0x4d6202);})[_0x7ba3('0x1e')](function(_0x5b9f34){logger[_0x7ba3('0x11')](_0x7ba3('0x1f'),_0x5b9f34[_0x7ba3('0x13')],_0x5702cb);_0x407c42(_0x258f3c[_0x7ba3('0x11')](0x1f4,_0x5b9f34[_0x7ba3('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/index.js b/server/api/intZohoConfiguration/index.js index 24cc72e..a8c24b8 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 _0xc2a9=['/:id','destroy','multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show','getFields','/:id/subjects','getSubjects','getDescriptions','post','create','update'];(function(_0x1f6288,_0x8e501){var _0x306f4b=function(_0x37316b){while(--_0x37316b){_0x1f6288['push'](_0x1f6288['shift']());}};_0x306f4b(++_0x8e501);}(_0xc2a9,0xd4));var _0x9c2a=function(_0xab800b,_0x1d70cd){_0xab800b=_0xab800b-0x0;var _0x1cfb63=_0xc2a9[_0xab800b];return _0x1cfb63;};'use strict';var multer=require(_0x9c2a('0x0'));var util=require(_0x9c2a('0x1'));var path=require(_0x9c2a('0x2'));var timeout=require(_0x9c2a('0x3'));var express=require('express');var router=express[_0x9c2a('0x4')]();var fs_extra=require(_0x9c2a('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x9c2a('0x6'));var config=require(_0x9c2a('0x7'));var controller=require('./intZohoConfiguration.controller');router[_0x9c2a('0x8')]('/',auth[_0x9c2a('0x9')](),controller[_0x9c2a('0xa')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x9c2a('0xb')]);router['get']('/:id/fields',auth[_0x9c2a('0x9')](),controller[_0x9c2a('0xc')]);router[_0x9c2a('0x8')](_0x9c2a('0xd'),auth[_0x9c2a('0x9')](),controller[_0x9c2a('0xe')]);router[_0x9c2a('0x8')]('/:id/descriptions',auth['isAuthenticated'](),controller[_0x9c2a('0xf')]);router[_0x9c2a('0x10')]('/',auth[_0x9c2a('0x9')](),controller[_0x9c2a('0x11')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x9c2a('0x12')]);router['delete'](_0x9c2a('0x13'),auth[_0x9c2a('0x9')](),controller[_0x9c2a('0x14')]);module['exports']=router; \ No newline at end of file +var _0x7bf6=['show','/:id/fields','getFields','/:id/subjects','getSubjects','getDescriptions','post','create','put','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoConfiguration.controller','get','isAuthenticated','/:id'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0x7bf6,0x8e));var _0x67bf=function(_0x10d813,_0x2aabc2){_0x10d813=_0x10d813-0x0;var _0x49e015=_0x7bf6[_0x10d813];return _0x49e015;};'use strict';var multer=require(_0x67bf('0x0'));var util=require('util');var path=require(_0x67bf('0x1'));var timeout=require(_0x67bf('0x2'));var express=require(_0x67bf('0x3'));var router=express['Router']();var fs_extra=require(_0x67bf('0x4'));var auth=require(_0x67bf('0x5'));var interaction=require(_0x67bf('0x6'));var config=require(_0x67bf('0x7'));var controller=require(_0x67bf('0x8'));router[_0x67bf('0x9')]('/',auth[_0x67bf('0xa')](),controller['index']);router[_0x67bf('0x9')](_0x67bf('0xb'),auth['isAuthenticated'](),controller[_0x67bf('0xc')]);router['get'](_0x67bf('0xd'),auth[_0x67bf('0xa')](),controller[_0x67bf('0xe')]);router['get'](_0x67bf('0xf'),auth[_0x67bf('0xa')](),controller[_0x67bf('0x10')]);router['get']('/:id/descriptions',auth[_0x67bf('0xa')](),controller[_0x67bf('0x11')]);router[_0x67bf('0x12')]('/',auth[_0x67bf('0xa')](),controller[_0x67bf('0x13')]);router[_0x67bf('0x14')](_0x67bf('0xb'),auth[_0x67bf('0xa')](),controller['update']);router['delete']('/:id',auth[_0x67bf('0xa')](),controller['destroy']);module[_0x67bf('0x15')]=router; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js b/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js index f8fbfd3..e648f43 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 _0x944e=['contact','sequelize','exports','STRING','ENUM','lead','nothing','contact_lead'];(function(_0x5a79e2,_0x319b1a){var _0x266c45=function(_0x172478){while(--_0x172478){_0x5a79e2['push'](_0x5a79e2['shift']());}};_0x266c45(++_0x319b1a);}(_0x944e,0x89));var _0xe944=function(_0x50f2fa,_0x378bb0){_0x50f2fa=_0x50f2fa-0x0;var _0x14a182=_0x944e[_0x50f2fa];return _0x14a182;};'use strict';var Sequelize=require(_0xe944('0x0'));module[_0xe944('0x1')]={'name':{'type':Sequelize[_0xe944('0x2')]},'moduleCreate':{'type':Sequelize[_0xe944('0x3')](_0xe944('0x4'),'contact',_0xe944('0x5')),'defaultValue':_0xe944('0x4')},'moduleSearch':{'type':Sequelize['ENUM'](_0xe944('0x6'),_0xe944('0x7'),_0xe944('0x4')),'defaultValue':_0xe944('0x6')},'description':{'type':Sequelize[_0xe944('0x2')]}}; \ No newline at end of file +var _0x4dd1=['contact','contact_lead','sequelize','STRING','ENUM','lead'];(function(_0xbd7fee,_0x207cf4){var _0x14ede4=function(_0x523d85){while(--_0x523d85){_0xbd7fee['push'](_0xbd7fee['shift']());}};_0x14ede4(++_0x207cf4);}(_0x4dd1,0xb0));var _0x14dd=function(_0x5aa696,_0x48895b){_0x5aa696=_0x5aa696-0x0;var _0x33cf8c=_0x4dd1[_0x5aa696];return _0x33cf8c;};'use strict';var Sequelize=require(_0x14dd('0x0'));module['exports']={'name':{'type':Sequelize[_0x14dd('0x1')]},'moduleCreate':{'type':Sequelize[_0x14dd('0x2')](_0x14dd('0x3'),_0x14dd('0x4'),'nothing'),'defaultValue':_0x14dd('0x3')},'moduleSearch':{'type':Sequelize[_0x14dd('0x2')](_0x14dd('0x5'),_0x14dd('0x4'),_0x14dd('0x3')),'defaultValue':_0x14dd('0x5')},'description':{'type':Sequelize[_0x14dd('0x1')]}}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.controller.js b/server/api/intZohoConfiguration/intZohoConfiguration.controller.js index 2aebf22..7b55b31 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 _0xa96f=['show','params','options','find','create','body','catch','getFields','findOne','ZohoField','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','set','apply','update','then','destroy','sendStatus','stack','name','send','index','map','ZohoConfiguration','rawAttributes','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','type','VIRTUAL','merge','include','findAll','rows'];(function(_0x191e86,_0x212fe7){var _0x5a3722=function(_0x563e6c){while(--_0x563e6c){_0x191e86['push'](_0x191e86['shift']());}};_0x5a3722(++_0x212fe7);}(_0xa96f,0x144));var _0xfa96=function(_0x2f6541,_0x363cba){_0x2f6541=_0x2f6541-0x0;var _0x4d76d8=_0xa96f[_0x2f6541];return _0x4d76d8;};'use strict';var emlformat=require(_0xfa96('0x0'));var rimraf=require(_0xfa96('0x1'));var zipdir=require(_0xfa96('0x2'));var jsonpatch=require(_0xfa96('0x3'));var rp=require(_0xfa96('0x4'));var moment=require(_0xfa96('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xfa96('0x6'));var util=require(_0xfa96('0x7'));var path=require('path');var sox=require(_0xfa96('0x8'));var csv=require(_0xfa96('0x9'));var ejs=require(_0xfa96('0xa'));var fs=require('fs');var fs_extra=require(_0xfa96('0xb'));var _=require(_0xfa96('0xc'));var squel=require(_0xfa96('0xd'));var crypto=require(_0xfa96('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xfa96('0xf'));var toCsv=require(_0xfa96('0x9'));var querystring=require(_0xfa96('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xfa96('0x11'));var as=require(_0xfa96('0x12'));var hardwareService=require(_0xfa96('0x13'));var logger=require('../../config/logger')(_0xfa96('0x14'));var utils=require(_0xfa96('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xfa96('0x16'));var db=require(_0xfa96('0x17'))['db'];function respondWithStatusCode(_0x1d01fe,_0x3f4f27){_0x3f4f27=_0x3f4f27||0xcc;return function(_0x1d48ae){if(_0x1d48ae){return _0x1d01fe['sendStatus'](_0x3f4f27);}return _0x1d01fe[_0xfa96('0x18')](_0x3f4f27)[_0xfa96('0x19')]();};}function respondWithResult(_0x1c41c7,_0x1f0fda){_0x1f0fda=_0x1f0fda||0xc8;return function(_0x3476cf){if(_0x3476cf){return _0x1c41c7[_0xfa96('0x18')](_0x1f0fda)[_0xfa96('0x1a')](_0x3476cf);}};}function respondWithFilteredResult(_0x74eb77,_0x11c396){return function(_0x449c5f){if(_0x449c5f){var _0x5e95a4=typeof _0x11c396[_0xfa96('0x1b')]===_0xfa96('0x1c')&&typeof _0x11c396['limit']==='undefined';var _0xb2cf43=_0x449c5f[_0xfa96('0x1d')];var _0x3b111b=_0x5e95a4?0x0:_0x11c396[_0xfa96('0x1b')];var _0x480e62=_0x5e95a4?_0x449c5f[_0xfa96('0x1d')]:_0x11c396[_0xfa96('0x1b')]+_0x11c396['limit'];var _0x37b38b;if(_0x480e62>=_0xb2cf43){_0x480e62=_0xb2cf43;_0x37b38b=0xc8;}else{_0x37b38b=0xce;}_0x74eb77['status'](_0x37b38b);return _0x74eb77[_0xfa96('0x1e')]('Content-Range',_0x3b111b+'-'+_0x480e62+'/'+_0xb2cf43)['json'](_0x449c5f);}return null;};}function patchUpdates(_0x4d4e38){return function(_0x3a09bb){try{jsonpatch[_0xfa96('0x1f')](_0x3a09bb,_0x4d4e38,!![]);}catch(_0xa64a1b){return BPromise['reject'](_0xa64a1b);}return _0x3a09bb['save']();};}function saveUpdates(_0xb26fe7,_0x494ffc){return function(_0x18a9a3){if(_0x18a9a3){return _0x18a9a3[_0xfa96('0x20')](_0xb26fe7)[_0xfa96('0x21')](function(_0xa07233){return _0xa07233;});}return null;};}function removeEntity(_0x11a241,_0x53b38d){return function(_0x895c7a){if(_0x895c7a){return _0x895c7a[_0xfa96('0x22')]()[_0xfa96('0x21')](function(){_0x11a241['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4b4bf2,_0x39002e){return function(_0xcb5b26){if(!_0xcb5b26){_0x4b4bf2[_0xfa96('0x23')](0x194);}return _0xcb5b26;};}function handleError(_0x2081cb,_0x483a44){_0x483a44=_0x483a44||0x1f4;return function(_0x295841){logger['error'](_0x295841[_0xfa96('0x24')]);if(_0x295841[_0xfa96('0x25')]){delete _0x295841[_0xfa96('0x25')];}_0x2081cb[_0xfa96('0x18')](_0x483a44)[_0xfa96('0x26')](_0x295841);};}exports[_0xfa96('0x27')]=function(_0x5c09c9,_0x1436f0){var _0x17083c={},_0x275834={},_0x1aed95={'count':0x0,'rows':[]};var _0x4d03ee=_[_0xfa96('0x28')](db[_0xfa96('0x29')][_0xfa96('0x2a')],function(_0x227ec1){return{'name':_0x227ec1['fieldName'],'type':_0x227ec1['type'][_0xfa96('0x2b')]};});_0x275834['model']=_['map'](_0x4d03ee,_0xfa96('0x25'));_0x275834[_0xfa96('0x2c')]=_[_0xfa96('0x2d')](_0x5c09c9[_0xfa96('0x2c')]);_0x275834[_0xfa96('0x2e')]=_[_0xfa96('0x2f')](_0x275834[_0xfa96('0x30')],_0x275834[_0xfa96('0x2c')]);_0x17083c['attributes']=_[_0xfa96('0x2f')](_0x275834['model'],qs[_0xfa96('0x31')](_0x5c09c9[_0xfa96('0x2c')][_0xfa96('0x31')]));_0x17083c[_0xfa96('0x32')]=_0x17083c[_0xfa96('0x32')][_0xfa96('0x33')]?_0x17083c['attributes']:_0x275834[_0xfa96('0x30')];if(!_0x5c09c9[_0xfa96('0x2c')][_0xfa96('0x34')](_0xfa96('0x35'))){_0x17083c[_0xfa96('0x36')]=qs[_0xfa96('0x36')](_0x5c09c9['query']['limit']);_0x17083c[_0xfa96('0x1b')]=qs[_0xfa96('0x1b')](_0x5c09c9[_0xfa96('0x2c')][_0xfa96('0x1b')]);}_0x17083c[_0xfa96('0x37')]=qs[_0xfa96('0x38')](_0x5c09c9[_0xfa96('0x2c')][_0xfa96('0x38')]);_0x17083c[_0xfa96('0x39')]=qs['filters'](_[_0xfa96('0x3a')](_0x5c09c9[_0xfa96('0x2c')],_0x275834[_0xfa96('0x2e')]),_0x4d03ee);if(_0x5c09c9['query'][_0xfa96('0x3b')]){_0x17083c[_0xfa96('0x39')]=_['merge'](_0x17083c[_0xfa96('0x39')],{'$or':_[_0xfa96('0x28')](_0x4d03ee,function(_0x37243b){if(_0x37243b[_0xfa96('0x3c')]!==_0xfa96('0x3d')){var _0x38ce58={};_0x38ce58[_0x37243b['name']]={'$like':'%'+_0x5c09c9['query']['filter']+'%'};return _0x38ce58;}})});}_0x17083c=_[_0xfa96('0x3e')]({},_0x17083c,_0x5c09c9['options']);var _0x4c9add={'where':_0x17083c[_0xfa96('0x39')]};return db['ZohoConfiguration'][_0xfa96('0x1d')](_0x4c9add)[_0xfa96('0x21')](function(_0x23f5ac){_0x1aed95[_0xfa96('0x1d')]=_0x23f5ac;if(_0x5c09c9[_0xfa96('0x2c')]['includeAll']){_0x17083c[_0xfa96('0x3f')]=[{'all':!![]}];}return db['ZohoConfiguration'][_0xfa96('0x40')](_0x17083c);})['then'](function(_0x37268a){_0x1aed95[_0xfa96('0x41')]=_0x37268a;return _0x1aed95;})[_0xfa96('0x21')](respondWithFilteredResult(_0x1436f0,_0x17083c))['catch'](handleError(_0x1436f0,null));};exports[_0xfa96('0x42')]=function(_0x412e71,_0x52cd43){var _0x333ba4={'raw':![],'where':{'id':_0x412e71[_0xfa96('0x43')]['id']}},_0xd9e71d={};_0xd9e71d['model']=_[_0xfa96('0x2d')](db[_0xfa96('0x29')]['rawAttributes']);_0xd9e71d['query']=_['keys'](_0x412e71['query']);_0xd9e71d[_0xfa96('0x2e')]=_[_0xfa96('0x2f')](_0xd9e71d[_0xfa96('0x30')],_0xd9e71d[_0xfa96('0x2c')]);_0x333ba4['attributes']=_[_0xfa96('0x2f')](_0xd9e71d[_0xfa96('0x30')],qs[_0xfa96('0x31')](_0x412e71[_0xfa96('0x2c')]['fields']));_0x333ba4['attributes']=_0x333ba4[_0xfa96('0x32')][_0xfa96('0x33')]?_0x333ba4['attributes']:_0xd9e71d['model'];if(_0x412e71[_0xfa96('0x2c')]['includeAll']){_0x333ba4['include']=[{'all':!![]}];}_0x333ba4=_[_0xfa96('0x3e')]({},_0x333ba4,_0x412e71[_0xfa96('0x44')]);return db[_0xfa96('0x29')][_0xfa96('0x45')](_0x333ba4)[_0xfa96('0x21')](handleEntityNotFound(_0x52cd43,null))[_0xfa96('0x21')](respondWithResult(_0x52cd43,null))['catch'](handleError(_0x52cd43,null));};exports[_0xfa96('0x46')]=function(_0x4ffcbf,_0x40bd48){return db[_0xfa96('0x29')][_0xfa96('0x46')](_0x4ffcbf['body'],{})[_0xfa96('0x21')](respondWithResult(_0x40bd48,0xc9))['catch'](handleError(_0x40bd48,null));};exports['update']=function(_0x3e7c4e,_0x299b55){if(_0x3e7c4e['body']['id']){delete _0x3e7c4e[_0xfa96('0x47')]['id'];}return db[_0xfa96('0x29')][_0xfa96('0x45')]({'where':{'id':_0x3e7c4e[_0xfa96('0x43')]['id']}})[_0xfa96('0x21')](handleEntityNotFound(_0x299b55,null))[_0xfa96('0x21')](saveUpdates(_0x3e7c4e[_0xfa96('0x47')],null))[_0xfa96('0x21')](respondWithResult(_0x299b55,null))[_0xfa96('0x48')](handleError(_0x299b55,null));};exports[_0xfa96('0x22')]=function(_0x46b086,_0x4026d6){return db[_0xfa96('0x29')][_0xfa96('0x45')]({'where':{'id':_0x46b086['params']['id']}})['then'](handleEntityNotFound(_0x4026d6,null))['then'](removeEntity(_0x4026d6,null))[_0xfa96('0x48')](handleError(_0x4026d6,null));};exports[_0xfa96('0x49')]=function(_0x5d1055,_0x193779,_0x590a39){var _0x549ee0={};var _0x10ea20={};var _0x3b8ecd;var _0x57d8d0;return db[_0xfa96('0x29')][_0xfa96('0x4a')]({'where':{'id':_0x5d1055[_0xfa96('0x43')]['id']}})[_0xfa96('0x21')](handleEntityNotFound(_0x193779,null))[_0xfa96('0x21')](function(_0xd0abcd){if(_0xd0abcd){_0x3b8ecd=_0xd0abcd;_0x10ea20['model']=_[_0xfa96('0x2d')](db[_0xfa96('0x4b')]['rawAttributes']);_0x10ea20[_0xfa96('0x2c')]=_['keys'](_0x5d1055[_0xfa96('0x2c')]);_0x10ea20[_0xfa96('0x2e')]=_[_0xfa96('0x2f')](_0x10ea20[_0xfa96('0x30')],_0x10ea20['query']);_0x549ee0['attributes']=_[_0xfa96('0x2f')](_0x10ea20[_0xfa96('0x30')],qs[_0xfa96('0x31')](_0x5d1055['query']['fields']));_0x549ee0[_0xfa96('0x32')]=_0x549ee0[_0xfa96('0x32')][_0xfa96('0x33')]?_0x549ee0[_0xfa96('0x32')]:_0x10ea20[_0xfa96('0x30')];_0x549ee0[_0xfa96('0x37')]=qs[_0xfa96('0x38')](_0x5d1055[_0xfa96('0x2c')]['sort']);_0x549ee0[_0xfa96('0x39')]=qs['filters'](_[_0xfa96('0x3a')](_0x5d1055[_0xfa96('0x2c')],_0x10ea20['filters']));if(_0x5d1055[_0xfa96('0x2c')][_0xfa96('0x3b')]){_0x549ee0['where']=_[_0xfa96('0x3e')](_0x549ee0[_0xfa96('0x39')],{'$or':_['map'](_0x549ee0['attributes'],function(_0x6397c1){var _0x45c20c={};_0x45c20c[_0x6397c1]={'$like':'%'+_0x5d1055['query']['filter']+'%'};return _0x45c20c;})});}_0x549ee0=_['merge']({},_0x549ee0,_0x5d1055['options']);return _0x3b8ecd[_0xfa96('0x49')](_0x549ee0);}})[_0xfa96('0x21')](function(_0x6e3a5b){if(_0x6e3a5b){_0x57d8d0=_0x6e3a5b['length'];if(!_0x5d1055[_0xfa96('0x2c')][_0xfa96('0x34')](_0xfa96('0x35'))){_0x549ee0[_0xfa96('0x36')]=qs[_0xfa96('0x36')](_0x5d1055['query'][_0xfa96('0x36')]);_0x549ee0[_0xfa96('0x1b')]=qs[_0xfa96('0x1b')](_0x5d1055['query'][_0xfa96('0x1b')]);}return _0x3b8ecd['getFields'](_0x549ee0);}})[_0xfa96('0x21')](function(_0x4c6c37){if(_0x4c6c37){return _0x4c6c37?{'count':_0x57d8d0,'rows':_0x4c6c37}:null;}})[_0xfa96('0x21')](respondWithResult(_0x193779,null))['catch'](handleError(_0x193779,null));};exports[_0xfa96('0x4c')]=function(_0x3977f5,_0x1ab49c,_0x29a06f){var _0x163e9e={};var _0x312a63={};var _0x1c9618;var _0x443ba8;return db[_0xfa96('0x29')][_0xfa96('0x4a')]({'where':{'id':_0x3977f5['params']['id']}})['then'](handleEntityNotFound(_0x1ab49c,null))[_0xfa96('0x21')](function(_0xf4e779){if(_0xf4e779){_0x1c9618=_0xf4e779;_0x312a63[_0xfa96('0x30')]=_[_0xfa96('0x2d')](db[_0xfa96('0x4b')][_0xfa96('0x2a')]);_0x312a63[_0xfa96('0x2c')]=_['keys'](_0x3977f5[_0xfa96('0x2c')]);_0x312a63['filters']=_[_0xfa96('0x2f')](_0x312a63[_0xfa96('0x30')],_0x312a63[_0xfa96('0x2c')]);_0x163e9e[_0xfa96('0x32')]=_[_0xfa96('0x2f')](_0x312a63[_0xfa96('0x30')],qs[_0xfa96('0x31')](_0x3977f5[_0xfa96('0x2c')]['fields']));_0x163e9e[_0xfa96('0x32')]=_0x163e9e[_0xfa96('0x32')][_0xfa96('0x33')]?_0x163e9e[_0xfa96('0x32')]:_0x312a63[_0xfa96('0x30')];_0x163e9e[_0xfa96('0x37')]=qs[_0xfa96('0x38')](_0x3977f5['query']['sort']);_0x163e9e[_0xfa96('0x39')]=qs[_0xfa96('0x2e')](_[_0xfa96('0x3a')](_0x3977f5['query'],_0x312a63[_0xfa96('0x2e')]));if(_0x3977f5[_0xfa96('0x2c')][_0xfa96('0x3b')]){_0x163e9e['where']=_[_0xfa96('0x3e')](_0x163e9e[_0xfa96('0x39')],{'$or':_[_0xfa96('0x28')](_0x163e9e['attributes'],function(_0x4c80bf){var _0x5b6718={};_0x5b6718[_0x4c80bf]={'$like':'%'+_0x3977f5[_0xfa96('0x2c')][_0xfa96('0x3b')]+'%'};return _0x5b6718;})});}_0x163e9e=_[_0xfa96('0x3e')]({},_0x163e9e,_0x3977f5['options']);return _0x1c9618['getSubjects'](_0x163e9e);}})[_0xfa96('0x21')](function(_0x41988d){if(_0x41988d){_0x443ba8=_0x41988d['length'];if(!_0x3977f5[_0xfa96('0x2c')]['hasOwnProperty'](_0xfa96('0x35'))){_0x163e9e['limit']=qs[_0xfa96('0x36')](_0x3977f5[_0xfa96('0x2c')]['limit']);_0x163e9e[_0xfa96('0x1b')]=qs['offset'](_0x3977f5[_0xfa96('0x2c')][_0xfa96('0x1b')]);}return _0x1c9618['getSubjects'](_0x163e9e);}})[_0xfa96('0x21')](function(_0x4b4eb1){if(_0x4b4eb1){return _0x4b4eb1?{'count':_0x443ba8,'rows':_0x4b4eb1}:null;}})[_0xfa96('0x21')](respondWithResult(_0x1ab49c,null))[_0xfa96('0x48')](handleError(_0x1ab49c,null));};exports['getDescriptions']=function(_0x3620e3,_0x55b58d,_0x2c6301){var _0x57880b={};var _0x38296f={};var _0x113bfb;var _0x150eb8;return db['ZohoConfiguration'][_0xfa96('0x4a')]({'where':{'id':_0x3620e3[_0xfa96('0x43')]['id']}})[_0xfa96('0x21')](handleEntityNotFound(_0x55b58d,null))[_0xfa96('0x21')](function(_0x191e94){if(_0x191e94){_0x113bfb=_0x191e94;_0x38296f[_0xfa96('0x30')]=_['keys'](db[_0xfa96('0x4b')][_0xfa96('0x2a')]);_0x38296f[_0xfa96('0x2c')]=_[_0xfa96('0x2d')](_0x3620e3[_0xfa96('0x2c')]);_0x38296f[_0xfa96('0x2e')]=_['intersection'](_0x38296f[_0xfa96('0x30')],_0x38296f[_0xfa96('0x2c')]);_0x57880b[_0xfa96('0x32')]=_[_0xfa96('0x2f')](_0x38296f[_0xfa96('0x30')],qs[_0xfa96('0x31')](_0x3620e3['query'][_0xfa96('0x31')]));_0x57880b[_0xfa96('0x32')]=_0x57880b[_0xfa96('0x32')][_0xfa96('0x33')]?_0x57880b['attributes']:_0x38296f[_0xfa96('0x30')];_0x57880b[_0xfa96('0x37')]=qs[_0xfa96('0x38')](_0x3620e3[_0xfa96('0x2c')]['sort']);_0x57880b[_0xfa96('0x39')]=qs[_0xfa96('0x2e')](_['pick'](_0x3620e3[_0xfa96('0x2c')],_0x38296f[_0xfa96('0x2e')]));if(_0x3620e3['query'][_0xfa96('0x3b')]){_0x57880b[_0xfa96('0x39')]=_[_0xfa96('0x3e')](_0x57880b[_0xfa96('0x39')],{'$or':_[_0xfa96('0x28')](_0x57880b[_0xfa96('0x32')],function(_0xd84bc7){var _0x4e87c3={};_0x4e87c3[_0xd84bc7]={'$like':'%'+_0x3620e3[_0xfa96('0x2c')][_0xfa96('0x3b')]+'%'};return _0x4e87c3;})});}_0x57880b=_['merge']({},_0x57880b,_0x3620e3[_0xfa96('0x44')]);return _0x113bfb[_0xfa96('0x4d')](_0x57880b);}})['then'](function(_0x5f57ad){if(_0x5f57ad){_0x150eb8=_0x5f57ad[_0xfa96('0x33')];if(!_0x3620e3['query']['hasOwnProperty'](_0xfa96('0x35'))){_0x57880b[_0xfa96('0x36')]=qs['limit'](_0x3620e3[_0xfa96('0x2c')]['limit']);_0x57880b[_0xfa96('0x1b')]=qs[_0xfa96('0x1b')](_0x3620e3[_0xfa96('0x2c')][_0xfa96('0x1b')]);}return _0x113bfb['getDescriptions'](_0x57880b);}})[_0xfa96('0x21')](function(_0x124c21){if(_0x124c21){return _0x124c21?{'count':_0x150eb8,'rows':_0x124c21}:null;}})[_0xfa96('0x21')](respondWithResult(_0x55b58d,null))[_0xfa96('0x48')](handleError(_0x55b58d,null));}; \ No newline at end of file +var _0xa13e=['merge','VIRTUAL','ZohoConfiguration','include','findAll','rows','catch','show','rawAttributes','fields','includeAll','create','body','update','find','getFields','params','ZohoField','pick','options','getSubjects','findOne','nolimit','getDescriptions','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','sox','ejs','fs-extra','lodash','squel','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','save','then','destroy','stack','name','send','index','map','fieldName','type','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','order','sort','where','filter'];(function(_0x120ab8,_0x577eb9){var _0x597e51=function(_0x165bf4){while(--_0x165bf4){_0x120ab8['push'](_0x120ab8['shift']());}};_0x597e51(++_0x577eb9);}(_0xa13e,0x68));var _0xea13=function(_0x248bc3,_0x48d58b){_0x248bc3=_0x248bc3-0x0;var _0x5ba8d4=_0xa13e[_0x248bc3];return _0x5ba8d4;};'use strict';var emlformat=require(_0xea13('0x0'));var rimraf=require(_0xea13('0x1'));var zipdir=require(_0xea13('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xea13('0x3'));var moment=require(_0xea13('0x4'));var BPromise=require(_0xea13('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xea13('0x6'));var csv=require('to-csv');var ejs=require(_0xea13('0x7'));var fs=require('fs');var fs_extra=require(_0xea13('0x8'));var _=require(_0xea13('0x9'));var squel=require(_0xea13('0xa'));var crypto=require('crypto');var jsforce=require(_0xea13('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xea13('0xc'));var querystring=require(_0xea13('0xd'));var Papa=require(_0xea13('0xe'));var Redis=require(_0xea13('0xf'));var authService=require(_0xea13('0x10'));var qs=require(_0xea13('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xea13('0x12'));var logger=require('../../config/logger')(_0xea13('0x13'));var utils=require('../../config/utils');var config=require(_0xea13('0x14'));var licenseUtil=require(_0xea13('0x15'));var db=require(_0xea13('0x16'))['db'];function respondWithStatusCode(_0x5e8674,_0x46dec5){_0x46dec5=_0x46dec5||0xcc;return function(_0x3890fd){if(_0x3890fd){return _0x5e8674[_0xea13('0x17')](_0x46dec5);}return _0x5e8674[_0xea13('0x18')](_0x46dec5)[_0xea13('0x19')]();};}function respondWithResult(_0x3068fb,_0xa5543){_0xa5543=_0xa5543||0xc8;return function(_0x45c316){if(_0x45c316){return _0x3068fb[_0xea13('0x18')](_0xa5543)[_0xea13('0x1a')](_0x45c316);}};}function respondWithFilteredResult(_0x234ca8,_0x579e99){return function(_0x2b4dee){if(_0x2b4dee){var _0x5088d6=typeof _0x579e99[_0xea13('0x1b')]==='undefined'&&typeof _0x579e99['limit']===_0xea13('0x1c');var _0x182c15=_0x2b4dee[_0xea13('0x1d')];var _0x500b05=_0x5088d6?0x0:_0x579e99[_0xea13('0x1b')];var _0x4db583=_0x5088d6?_0x2b4dee['count']:_0x579e99['offset']+_0x579e99[_0xea13('0x1e')];var _0x3ec00f;if(_0x4db583>=_0x182c15){_0x4db583=_0x182c15;_0x3ec00f=0xc8;}else{_0x3ec00f=0xce;}_0x234ca8[_0xea13('0x18')](_0x3ec00f);return _0x234ca8[_0xea13('0x1f')](_0xea13('0x20'),_0x500b05+'-'+_0x4db583+'/'+_0x182c15)[_0xea13('0x1a')](_0x2b4dee);}return null;};}function patchUpdates(_0x9815bf){return function(_0x3ff0d4){try{jsonpatch[_0xea13('0x21')](_0x3ff0d4,_0x9815bf,!![]);}catch(_0x1824c6){return BPromise['reject'](_0x1824c6);}return _0x3ff0d4[_0xea13('0x22')]();};}function saveUpdates(_0x2f914a,_0x35623a){return function(_0x29b849){if(_0x29b849){return _0x29b849['update'](_0x2f914a)[_0xea13('0x23')](function(_0x132088){return _0x132088;});}return null;};}function removeEntity(_0x53b33b,_0x4c7b8f){return function(_0x51cb54){if(_0x51cb54){return _0x51cb54[_0xea13('0x24')]()[_0xea13('0x23')](function(){_0x53b33b[_0xea13('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x40001e,_0x4e6fac){return function(_0x36c5ef){if(!_0x36c5ef){_0x40001e[_0xea13('0x17')](0x194);}return _0x36c5ef;};}function handleError(_0x5cdefd,_0x22e5af){_0x22e5af=_0x22e5af||0x1f4;return function(_0x42b2b7){logger['error'](_0x42b2b7[_0xea13('0x25')]);if(_0x42b2b7['name']){delete _0x42b2b7[_0xea13('0x26')];}_0x5cdefd[_0xea13('0x18')](_0x22e5af)[_0xea13('0x27')](_0x42b2b7);};}exports[_0xea13('0x28')]=function(_0x4b1718,_0x5e4a77){var _0x2fd36d={},_0x2dcd18={},_0x21b256={'count':0x0,'rows':[]};var _0x1affbf=_[_0xea13('0x29')](db['ZohoConfiguration']['rawAttributes'],function(_0x25f9d2){return{'name':_0x25f9d2[_0xea13('0x2a')],'type':_0x25f9d2[_0xea13('0x2b')]['key']};});_0x2dcd18[_0xea13('0x2c')]=_['map'](_0x1affbf,_0xea13('0x26'));_0x2dcd18[_0xea13('0x2d')]=_[_0xea13('0x2e')](_0x4b1718['query']);_0x2dcd18[_0xea13('0x2f')]=_[_0xea13('0x30')](_0x2dcd18[_0xea13('0x2c')],_0x2dcd18[_0xea13('0x2d')]);_0x2fd36d[_0xea13('0x31')]=_[_0xea13('0x30')](_0x2dcd18[_0xea13('0x2c')],qs['fields'](_0x4b1718[_0xea13('0x2d')]['fields']));_0x2fd36d['attributes']=_0x2fd36d[_0xea13('0x31')][_0xea13('0x32')]?_0x2fd36d[_0xea13('0x31')]:_0x2dcd18[_0xea13('0x2c')];if(!_0x4b1718[_0xea13('0x2d')][_0xea13('0x33')]('nolimit')){_0x2fd36d[_0xea13('0x1e')]=qs[_0xea13('0x1e')](_0x4b1718[_0xea13('0x2d')][_0xea13('0x1e')]);_0x2fd36d[_0xea13('0x1b')]=qs[_0xea13('0x1b')](_0x4b1718[_0xea13('0x2d')][_0xea13('0x1b')]);}_0x2fd36d[_0xea13('0x34')]=qs['sort'](_0x4b1718[_0xea13('0x2d')][_0xea13('0x35')]);_0x2fd36d[_0xea13('0x36')]=qs[_0xea13('0x2f')](_['pick'](_0x4b1718['query'],_0x2dcd18[_0xea13('0x2f')]),_0x1affbf);if(_0x4b1718[_0xea13('0x2d')][_0xea13('0x37')]){_0x2fd36d[_0xea13('0x36')]=_[_0xea13('0x38')](_0x2fd36d[_0xea13('0x36')],{'$or':_[_0xea13('0x29')](_0x1affbf,function(_0x2ef847){if(_0x2ef847[_0xea13('0x2b')]!==_0xea13('0x39')){var _0x55cd00={};_0x55cd00[_0x2ef847[_0xea13('0x26')]]={'$like':'%'+_0x4b1718[_0xea13('0x2d')][_0xea13('0x37')]+'%'};return _0x55cd00;}})});}_0x2fd36d=_[_0xea13('0x38')]({},_0x2fd36d,_0x4b1718['options']);var _0x1d1805={'where':_0x2fd36d[_0xea13('0x36')]};return db[_0xea13('0x3a')][_0xea13('0x1d')](_0x1d1805)[_0xea13('0x23')](function(_0x51e1ba){_0x21b256[_0xea13('0x1d')]=_0x51e1ba;if(_0x4b1718['query']['includeAll']){_0x2fd36d[_0xea13('0x3b')]=[{'all':!![]}];}return db[_0xea13('0x3a')][_0xea13('0x3c')](_0x2fd36d);})[_0xea13('0x23')](function(_0x24df54){_0x21b256[_0xea13('0x3d')]=_0x24df54;return _0x21b256;})[_0xea13('0x23')](respondWithFilteredResult(_0x5e4a77,_0x2fd36d))[_0xea13('0x3e')](handleError(_0x5e4a77,null));};exports[_0xea13('0x3f')]=function(_0x119338,_0x1d0f19){var _0x498618={'raw':![],'where':{'id':_0x119338['params']['id']}},_0x36aa87={};_0x36aa87[_0xea13('0x2c')]=_[_0xea13('0x2e')](db[_0xea13('0x3a')][_0xea13('0x40')]);_0x36aa87[_0xea13('0x2d')]=_['keys'](_0x119338[_0xea13('0x2d')]);_0x36aa87['filters']=_[_0xea13('0x30')](_0x36aa87[_0xea13('0x2c')],_0x36aa87[_0xea13('0x2d')]);_0x498618['attributes']=_['intersection'](_0x36aa87[_0xea13('0x2c')],qs['fields'](_0x119338[_0xea13('0x2d')][_0xea13('0x41')]));_0x498618[_0xea13('0x31')]=_0x498618[_0xea13('0x31')]['length']?_0x498618[_0xea13('0x31')]:_0x36aa87[_0xea13('0x2c')];if(_0x119338[_0xea13('0x2d')][_0xea13('0x42')]){_0x498618[_0xea13('0x3b')]=[{'all':!![]}];}_0x498618=_[_0xea13('0x38')]({},_0x498618,_0x119338['options']);return db[_0xea13('0x3a')]['find'](_0x498618)[_0xea13('0x23')](handleEntityNotFound(_0x1d0f19,null))[_0xea13('0x23')](respondWithResult(_0x1d0f19,null))['catch'](handleError(_0x1d0f19,null));};exports[_0xea13('0x43')]=function(_0x1bdee4,_0x5b2fe4){return db[_0xea13('0x3a')]['create'](_0x1bdee4[_0xea13('0x44')],{})[_0xea13('0x23')](respondWithResult(_0x5b2fe4,0xc9))[_0xea13('0x3e')](handleError(_0x5b2fe4,null));};exports[_0xea13('0x45')]=function(_0x253c41,_0x4554b8){if(_0x253c41[_0xea13('0x44')]['id']){delete _0x253c41[_0xea13('0x44')]['id'];}return db[_0xea13('0x3a')][_0xea13('0x46')]({'where':{'id':_0x253c41['params']['id']}})[_0xea13('0x23')](handleEntityNotFound(_0x4554b8,null))['then'](saveUpdates(_0x253c41[_0xea13('0x44')],null))[_0xea13('0x23')](respondWithResult(_0x4554b8,null))[_0xea13('0x3e')](handleError(_0x4554b8,null));};exports['destroy']=function(_0x1a3b15,_0x1c90c4){return db[_0xea13('0x3a')][_0xea13('0x46')]({'where':{'id':_0x1a3b15['params']['id']}})[_0xea13('0x23')](handleEntityNotFound(_0x1c90c4,null))[_0xea13('0x23')](removeEntity(_0x1c90c4,null))[_0xea13('0x3e')](handleError(_0x1c90c4,null));};exports[_0xea13('0x47')]=function(_0x1af958,_0x3f8b0f,_0x409c2d){var _0x4d8a1a={};var _0x331c81={};var _0x50b485;var _0x13fc1e;return db['ZohoConfiguration']['findOne']({'where':{'id':_0x1af958[_0xea13('0x48')]['id']}})[_0xea13('0x23')](handleEntityNotFound(_0x3f8b0f,null))[_0xea13('0x23')](function(_0x53e0fb){if(_0x53e0fb){_0x50b485=_0x53e0fb;_0x331c81[_0xea13('0x2c')]=_[_0xea13('0x2e')](db[_0xea13('0x49')]['rawAttributes']);_0x331c81[_0xea13('0x2d')]=_['keys'](_0x1af958[_0xea13('0x2d')]);_0x331c81[_0xea13('0x2f')]=_[_0xea13('0x30')](_0x331c81[_0xea13('0x2c')],_0x331c81[_0xea13('0x2d')]);_0x4d8a1a['attributes']=_[_0xea13('0x30')](_0x331c81[_0xea13('0x2c')],qs['fields'](_0x1af958[_0xea13('0x2d')][_0xea13('0x41')]));_0x4d8a1a['attributes']=_0x4d8a1a[_0xea13('0x31')][_0xea13('0x32')]?_0x4d8a1a['attributes']:_0x331c81[_0xea13('0x2c')];_0x4d8a1a['order']=qs['sort'](_0x1af958[_0xea13('0x2d')][_0xea13('0x35')]);_0x4d8a1a[_0xea13('0x36')]=qs[_0xea13('0x2f')](_[_0xea13('0x4a')](_0x1af958[_0xea13('0x2d')],_0x331c81[_0xea13('0x2f')]));if(_0x1af958[_0xea13('0x2d')][_0xea13('0x37')]){_0x4d8a1a[_0xea13('0x36')]=_['merge'](_0x4d8a1a[_0xea13('0x36')],{'$or':_[_0xea13('0x29')](_0x4d8a1a[_0xea13('0x31')],function(_0x5de598){var _0x4eeb07={};_0x4eeb07[_0x5de598]={'$like':'%'+_0x1af958[_0xea13('0x2d')][_0xea13('0x37')]+'%'};return _0x4eeb07;})});}_0x4d8a1a=_[_0xea13('0x38')]({},_0x4d8a1a,_0x1af958[_0xea13('0x4b')]);return _0x50b485['getFields'](_0x4d8a1a);}})[_0xea13('0x23')](function(_0xccc2cf){if(_0xccc2cf){_0x13fc1e=_0xccc2cf[_0xea13('0x32')];if(!_0x1af958['query'][_0xea13('0x33')]('nolimit')){_0x4d8a1a[_0xea13('0x1e')]=qs[_0xea13('0x1e')](_0x1af958[_0xea13('0x2d')][_0xea13('0x1e')]);_0x4d8a1a[_0xea13('0x1b')]=qs[_0xea13('0x1b')](_0x1af958['query']['offset']);}return _0x50b485[_0xea13('0x47')](_0x4d8a1a);}})[_0xea13('0x23')](function(_0x59fa40){if(_0x59fa40){return _0x59fa40?{'count':_0x13fc1e,'rows':_0x59fa40}:null;}})['then'](respondWithResult(_0x3f8b0f,null))['catch'](handleError(_0x3f8b0f,null));};exports[_0xea13('0x4c')]=function(_0x451833,_0x4f1aee,_0x943638){var _0x101dbd={};var _0x1ec590={};var _0xebb6dd;var _0x5858b1;return db[_0xea13('0x3a')][_0xea13('0x4d')]({'where':{'id':_0x451833['params']['id']}})[_0xea13('0x23')](handleEntityNotFound(_0x4f1aee,null))[_0xea13('0x23')](function(_0x4f8ecc){if(_0x4f8ecc){_0xebb6dd=_0x4f8ecc;_0x1ec590['model']=_[_0xea13('0x2e')](db['ZohoField'][_0xea13('0x40')]);_0x1ec590[_0xea13('0x2d')]=_[_0xea13('0x2e')](_0x451833[_0xea13('0x2d')]);_0x1ec590[_0xea13('0x2f')]=_[_0xea13('0x30')](_0x1ec590[_0xea13('0x2c')],_0x1ec590['query']);_0x101dbd['attributes']=_['intersection'](_0x1ec590['model'],qs[_0xea13('0x41')](_0x451833[_0xea13('0x2d')][_0xea13('0x41')]));_0x101dbd[_0xea13('0x31')]=_0x101dbd[_0xea13('0x31')][_0xea13('0x32')]?_0x101dbd[_0xea13('0x31')]:_0x1ec590[_0xea13('0x2c')];_0x101dbd['order']=qs[_0xea13('0x35')](_0x451833[_0xea13('0x2d')][_0xea13('0x35')]);_0x101dbd[_0xea13('0x36')]=qs['filters'](_[_0xea13('0x4a')](_0x451833[_0xea13('0x2d')],_0x1ec590['filters']));if(_0x451833[_0xea13('0x2d')]['filter']){_0x101dbd[_0xea13('0x36')]=_[_0xea13('0x38')](_0x101dbd[_0xea13('0x36')],{'$or':_[_0xea13('0x29')](_0x101dbd[_0xea13('0x31')],function(_0x2d3bbe){var _0xd9ab3f={};_0xd9ab3f[_0x2d3bbe]={'$like':'%'+_0x451833[_0xea13('0x2d')][_0xea13('0x37')]+'%'};return _0xd9ab3f;})});}_0x101dbd=_[_0xea13('0x38')]({},_0x101dbd,_0x451833['options']);return _0xebb6dd[_0xea13('0x4c')](_0x101dbd);}})[_0xea13('0x23')](function(_0x119815){if(_0x119815){_0x5858b1=_0x119815[_0xea13('0x32')];if(!_0x451833[_0xea13('0x2d')][_0xea13('0x33')](_0xea13('0x4e'))){_0x101dbd[_0xea13('0x1e')]=qs[_0xea13('0x1e')](_0x451833['query']['limit']);_0x101dbd[_0xea13('0x1b')]=qs[_0xea13('0x1b')](_0x451833[_0xea13('0x2d')][_0xea13('0x1b')]);}return _0xebb6dd[_0xea13('0x4c')](_0x101dbd);}})[_0xea13('0x23')](function(_0x5506d1){if(_0x5506d1){return _0x5506d1?{'count':_0x5858b1,'rows':_0x5506d1}:null;}})[_0xea13('0x23')](respondWithResult(_0x4f1aee,null))[_0xea13('0x3e')](handleError(_0x4f1aee,null));};exports[_0xea13('0x4f')]=function(_0x19dfd2,_0x52f6ab,_0x2a787c){var _0x1aeb68={};var _0x2d376e={};var _0x52334c;var _0x13ae40;return db[_0xea13('0x3a')][_0xea13('0x4d')]({'where':{'id':_0x19dfd2[_0xea13('0x48')]['id']}})[_0xea13('0x23')](handleEntityNotFound(_0x52f6ab,null))[_0xea13('0x23')](function(_0x266c59){if(_0x266c59){_0x52334c=_0x266c59;_0x2d376e['model']=_[_0xea13('0x2e')](db[_0xea13('0x49')][_0xea13('0x40')]);_0x2d376e[_0xea13('0x2d')]=_[_0xea13('0x2e')](_0x19dfd2[_0xea13('0x2d')]);_0x2d376e['filters']=_[_0xea13('0x30')](_0x2d376e[_0xea13('0x2c')],_0x2d376e[_0xea13('0x2d')]);_0x1aeb68['attributes']=_['intersection'](_0x2d376e['model'],qs[_0xea13('0x41')](_0x19dfd2[_0xea13('0x2d')][_0xea13('0x41')]));_0x1aeb68['attributes']=_0x1aeb68['attributes'][_0xea13('0x32')]?_0x1aeb68[_0xea13('0x31')]:_0x2d376e[_0xea13('0x2c')];_0x1aeb68[_0xea13('0x34')]=qs[_0xea13('0x35')](_0x19dfd2[_0xea13('0x2d')][_0xea13('0x35')]);_0x1aeb68['where']=qs['filters'](_['pick'](_0x19dfd2[_0xea13('0x2d')],_0x2d376e['filters']));if(_0x19dfd2[_0xea13('0x2d')][_0xea13('0x37')]){_0x1aeb68['where']=_[_0xea13('0x38')](_0x1aeb68[_0xea13('0x36')],{'$or':_[_0xea13('0x29')](_0x1aeb68[_0xea13('0x31')],function(_0x5b6e78){var _0x1c521a={};_0x1c521a[_0x5b6e78]={'$like':'%'+_0x19dfd2[_0xea13('0x2d')][_0xea13('0x37')]+'%'};return _0x1c521a;})});}_0x1aeb68=_[_0xea13('0x38')]({},_0x1aeb68,_0x19dfd2[_0xea13('0x4b')]);return _0x52334c['getDescriptions'](_0x1aeb68);}})[_0xea13('0x23')](function(_0x2ac320){if(_0x2ac320){_0x13ae40=_0x2ac320['length'];if(!_0x19dfd2[_0xea13('0x2d')][_0xea13('0x33')](_0xea13('0x4e'))){_0x1aeb68[_0xea13('0x1e')]=qs[_0xea13('0x1e')](_0x19dfd2[_0xea13('0x2d')]['limit']);_0x1aeb68[_0xea13('0x1b')]=qs[_0xea13('0x1b')](_0x19dfd2[_0xea13('0x2d')]['offset']);}return _0x52334c[_0xea13('0x4f')](_0x1aeb68);}})[_0xea13('0x23')](function(_0xf8f46d){if(_0xf8f46d){return _0xf8f46d?{'count':_0x13ae40,'rows':_0xf8f46d}:null;}})['then'](respondWithResult(_0x52f6ab,null))['catch'](handleError(_0x52f6ab,null));}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.model.js b/server/api/intZohoConfiguration/intZohoConfiguration.model.js index 858be4d..138641a 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 _0xa47d=['request-promise','path','rimraf','../../config/environment','exports','define','ZohoConfiguration','util','../../config/logger','moment','bluebird'];(function(_0x3f2e2e,_0x3d72bd){var _0xeb92b1=function(_0x53d92b){while(--_0x53d92b){_0x3f2e2e['push'](_0x3f2e2e['shift']());}};_0xeb92b1(++_0x3d72bd);}(_0xa47d,0x1ca));var _0xda47=function(_0x41362c,_0x216d09){_0x41362c=_0x41362c-0x0;var _0x3db5ca=_0xa47d[_0x41362c];return _0x3db5ca;};'use strict';var _=require('lodash');var util=require(_0xda47('0x0'));var logger=require(_0xda47('0x1'))('api');var moment=require(_0xda47('0x2'));var BPromise=require(_0xda47('0x3'));var rp=require(_0xda47('0x4'));var fs=require('fs');var path=require(_0xda47('0x5'));var rimraf=require(_0xda47('0x6'));var config=require(_0xda47('0x7'));var attributes=require('./intZohoConfiguration.attributes');module[_0xda47('0x8')]=function(_0x28c9da,_0xbdd1c2){return _0x28c9da[_0xda47('0x9')](_0xda47('0xa'),attributes,{'tableName':'int_zoho_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xaa7a=['lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','ZohoConfiguration'];(function(_0x5d3282,_0x4f4219){var _0x485e6c=function(_0x43e2a1){while(--_0x43e2a1){_0x5d3282['push'](_0x5d3282['shift']());}};_0x485e6c(++_0x4f4219);}(_0xaa7a,0x1b0));var _0xaaa7=function(_0x476bf4,_0x2a3755){_0x476bf4=_0x476bf4-0x0;var _0x788ffe=_0xaa7a[_0x476bf4];return _0x788ffe;};'use strict';var _=require(_0xaaa7('0x0'));var util=require(_0xaaa7('0x1'));var logger=require('../../config/logger')(_0xaaa7('0x2'));var moment=require(_0xaaa7('0x3'));var BPromise=require(_0xaaa7('0x4'));var rp=require(_0xaaa7('0x5'));var fs=require('fs');var path=require(_0xaaa7('0x6'));var rimraf=require(_0xaaa7('0x7'));var config=require(_0xaaa7('0x8'));var attributes=require('./intZohoConfiguration.attributes');module[_0xaaa7('0x9')]=function(_0x2a2922,_0x94b928){return _0x2a2922[_0xaaa7('0xa')](_0xaaa7('0xb'),attributes,{'tableName':'int_zoho_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.rpc.js b/server/api/intZohoConfiguration/intZohoConfiguration.rpc.js index 490deb8..a43afc8 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 _0xc61d=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','ZohoConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb'];(function(_0x465c8d,_0x308d2e){var _0x3e64a8=function(_0x4ded4e){while(--_0x4ded4e){_0x465c8d['push'](_0x465c8d['shift']());}};_0x3e64a8(++_0x308d2e);}(_0xc61d,0x102));var _0xdc61=function(_0x2c5ca3,_0x4e31fe){_0x2c5ca3=_0x2c5ca3-0x0;var _0x2499c6=_0xc61d[_0x2c5ca3];return _0x2499c6;};'use strict';var _=require(_0xdc61('0x0'));var util=require(_0xdc61('0x1'));var moment=require(_0xdc61('0x2'));var BPromise=require('bluebird');var rs=require(_0xdc61('0x3'));var fs=require('fs');var Redis=require(_0xdc61('0x4'));var db=require(_0xdc61('0x5'))['db'];var utils=require(_0xdc61('0x6'));var logger=require(_0xdc61('0x7'))(_0xdc61('0x8'));var config=require(_0xdc61('0x9'));var jayson=require(_0xdc61('0xa'));var client=jayson[_0xdc61('0xb')][_0xdc61('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x238716,_0x2c1525,_0x27f94a){return new BPromise(function(_0x3749e4,_0x5b563c){return client[_0xdc61('0xd')](_0x238716,_0x27f94a)[_0xdc61('0xe')](function(_0x306dbd){logger[_0xdc61('0xf')](_0xdc61('0x10'),_0x2c1525,_0xdc61('0x11'));logger['debug'](_0xdc61('0x12'),_0x2c1525,_0xdc61('0x11'),JSON['stringify'](_0x306dbd));if(_0x306dbd[_0xdc61('0x13')]){if(_0x306dbd['error'][_0xdc61('0x14')]===0x1f4){logger[_0xdc61('0x13')](_0xdc61('0x10'),_0x2c1525,_0x306dbd[_0xdc61('0x13')][_0xdc61('0x15')]);return _0x5b563c(_0x306dbd[_0xdc61('0x13')][_0xdc61('0x15')]);}logger[_0xdc61('0x13')]('ZohoConfiguration,\x20%s,\x20%s',_0x2c1525,_0x306dbd[_0xdc61('0x13')]['message']);return _0x3749e4(_0x306dbd[_0xdc61('0x13')][_0xdc61('0x15')]);}else{logger[_0xdc61('0xf')](_0xdc61('0x10'),_0x2c1525,_0xdc61('0x11'));_0x3749e4(_0x306dbd[_0xdc61('0x16')][_0xdc61('0x15')]);}})[_0xdc61('0x17')](function(_0x318ae2){logger[_0xdc61('0x13')](_0xdc61('0x10'),_0x2c1525,_0x318ae2);_0x5b563c(_0x318ae2);});});} \ No newline at end of file +var _0xd1fa=['../../config/logger','rpc','../../config/environment','client','http','request','then','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','ZohoConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils'];(function(_0x3794a0,_0x1a9cfc){var _0x5bdaba=function(_0x14a764){while(--_0x14a764){_0x3794a0['push'](_0x3794a0['shift']());}};_0x5bdaba(++_0x1a9cfc);}(_0xd1fa,0x13c));var _0xad1f=function(_0x256b72,_0x340985){_0x256b72=_0x256b72-0x0;var _0x2183e3=_0xd1fa[_0x256b72];return _0x2183e3;};'use strict';var _=require(_0xad1f('0x0'));var util=require(_0xad1f('0x1'));var moment=require(_0xad1f('0x2'));var BPromise=require('bluebird');var rs=require(_0xad1f('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xad1f('0x4'))['db'];var utils=require(_0xad1f('0x5'));var logger=require(_0xad1f('0x6'))(_0xad1f('0x7'));var config=require(_0xad1f('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xad1f('0x9')][_0xad1f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x286513,_0x5e299f,_0x3bb906){return new BPromise(function(_0x5f51ad,_0x58b3a6){return client[_0xad1f('0xb')](_0x286513,_0x3bb906)[_0xad1f('0xc')](function(_0x2662b5){logger['info'](_0xad1f('0xd'),_0x5e299f,_0xad1f('0xe'));logger['debug'](_0xad1f('0xf'),_0x5e299f,_0xad1f('0xe'),JSON[_0xad1f('0x10')](_0x2662b5));if(_0x2662b5[_0xad1f('0x11')]){if(_0x2662b5[_0xad1f('0x11')][_0xad1f('0x12')]===0x1f4){logger[_0xad1f('0x11')]('ZohoConfiguration,\x20%s,\x20%s',_0x5e299f,_0x2662b5[_0xad1f('0x11')][_0xad1f('0x13')]);return _0x58b3a6(_0x2662b5[_0xad1f('0x11')][_0xad1f('0x13')]);}logger[_0xad1f('0x11')](_0xad1f('0xd'),_0x5e299f,_0x2662b5['error'][_0xad1f('0x13')]);return _0x5f51ad(_0x2662b5[_0xad1f('0x11')][_0xad1f('0x13')]);}else{logger[_0xad1f('0x14')](_0xad1f('0xd'),_0x5e299f,_0xad1f('0xe'));_0x5f51ad(_0x2662b5[_0xad1f('0x15')]['message']);}})[_0xad1f('0x16')](function(_0x26217e){logger[_0xad1f('0x11')]('ZohoConfiguration,\x20%s,\x20%s',_0x5e299f,_0x26217e);_0x58b3a6(_0x26217e);});});} \ No newline at end of file diff --git a/server/api/intZohoField/index.js b/server/api/intZohoField/index.js index 0f29fb7..a98c3c3 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 _0x7033=['update','delete','destroy','exports','multer','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoField.controller','get','isAuthenticated','index','/:id','show','post','create'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7033,0xc2));var _0x3703=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x7033[_0xfae23b];return _0x200640;};'use strict';var multer=require(_0x3703('0x0'));var util=require('util');var path=require(_0x3703('0x1'));var timeout=require('connect-timeout');var express=require(_0x3703('0x2'));var router=express[_0x3703('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x3703('0x4'));var interaction=require(_0x3703('0x5'));var config=require(_0x3703('0x6'));var controller=require(_0x3703('0x7'));router[_0x3703('0x8')]('/',auth[_0x3703('0x9')](),controller[_0x3703('0xa')]);router[_0x3703('0x8')](_0x3703('0xb'),auth[_0x3703('0x9')](),controller[_0x3703('0xc')]);router[_0x3703('0xd')]('/',auth[_0x3703('0x9')](),controller[_0x3703('0xe')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x3703('0xf')]);router[_0x3703('0x10')](_0x3703('0xb'),auth[_0x3703('0x9')](),controller[_0x3703('0x11')]);module[_0x3703('0x12')]=router; \ No newline at end of file +var _0xb744=['../../config/environment','./intZohoField.controller','get','isAuthenticated','/:id','show','post','create','put','update','destroy','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x1bc0ae,_0x439dfe){var _0x501104=function(_0x2ade0d){while(--_0x2ade0d){_0x1bc0ae['push'](_0x1bc0ae['shift']());}};_0x501104(++_0x439dfe);}(_0xb744,0xdd));var _0x4b74=function(_0x55f1e5,_0xda2070){_0x55f1e5=_0x55f1e5-0x0;var _0x111f50=_0xb744[_0x55f1e5];return _0x111f50;};'use strict';var multer=require(_0x4b74('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x4b74('0x1'));var express=require(_0x4b74('0x2'));var router=express[_0x4b74('0x3')]();var fs_extra=require(_0x4b74('0x4'));var auth=require(_0x4b74('0x5'));var interaction=require(_0x4b74('0x6'));var config=require(_0x4b74('0x7'));var controller=require(_0x4b74('0x8'));router[_0x4b74('0x9')]('/',auth[_0x4b74('0xa')](),controller['index']);router[_0x4b74('0x9')](_0x4b74('0xb'),auth[_0x4b74('0xa')](),controller[_0x4b74('0xc')]);router[_0x4b74('0xd')]('/',auth[_0x4b74('0xa')](),controller[_0x4b74('0xe')]);router[_0x4b74('0xf')]('/:id',auth[_0x4b74('0xa')](),controller[_0x4b74('0x10')]);router['delete'](_0x4b74('0xb'),auth['isAuthenticated'](),controller[_0x4b74('0x11')]);module[_0x4b74('0x12')]=router; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.attributes.js b/server/api/intZohoField/intZohoField.attributes.js index ecae8c4..e03ff2c 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 _0xb55c=['variable','sequelize','exports','string','customVariable','picklist','STRING','ENUM'];(function(_0x1b1e01,_0x1eb3e7){var _0x51e835=function(_0x592f69){while(--_0x592f69){_0x1b1e01['push'](_0x1b1e01['shift']());}};_0x51e835(++_0x1eb3e7);}(_0xb55c,0x189));var _0xcb55=function(_0x5b2c66,_0x188f9d){_0x5b2c66=_0x5b2c66-0x0;var _0x1b1e53=_0xb55c[_0x5b2c66];return _0x1b1e53;};'use strict';var Sequelize=require(_0xcb55('0x0'));module[_0xcb55('0x1')]={'type':{'type':Sequelize['ENUM'](_0xcb55('0x2'),'variable',_0xcb55('0x3'),'keyValue',_0xcb55('0x4')),'defaultValue':_0xcb55('0x2')},'content':{'type':Sequelize[_0xcb55('0x5')]},'key':{'type':Sequelize[_0xcb55('0x5')]},'keyType':{'type':Sequelize[_0xcb55('0x6')](_0xcb55('0x2'),_0xcb55('0x7'),'customVariable')},'keyContent':{'type':Sequelize[_0xcb55('0x5')]},'idField':{'type':Sequelize[_0xcb55('0x5')]},'nameField':{'type':Sequelize[_0xcb55('0x5')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xcb55('0x5')]}}; \ No newline at end of file +var _0x3225=['sequelize','exports','string','variable','customVariable','keyValue','picklist','STRING'];(function(_0x455136,_0x1b39c5){var _0x41f0bd=function(_0x19e847){while(--_0x19e847){_0x455136['push'](_0x455136['shift']());}};_0x41f0bd(++_0x1b39c5);}(_0x3225,0x1b0));var _0x5322=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3225[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x5322('0x0'));module[_0x5322('0x1')]={'type':{'type':Sequelize['ENUM'](_0x5322('0x2'),_0x5322('0x3'),_0x5322('0x4'),_0x5322('0x5'),_0x5322('0x6')),'defaultValue':'string'},'content':{'type':Sequelize[_0x5322('0x7')]},'key':{'type':Sequelize[_0x5322('0x7')]},'keyType':{'type':Sequelize['ENUM'](_0x5322('0x2'),_0x5322('0x3'),_0x5322('0x4'))},'keyContent':{'type':Sequelize[_0x5322('0x7')]},'idField':{'type':Sequelize[_0x5322('0x7')]},'nameField':{'type':Sequelize[_0x5322('0x7')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x5322('0x7')]}}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.controller.js b/server/api/intZohoField/intZohoField.controller.js index cbbabe1..96fa255 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 _0x8138=['ejs','fs-extra','jsforce','desk.js','querystring','papaparse','ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','count','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','ZohoField','rawAttributes','fieldName','type','key','model','query','intersection','attributes','fields','nolimit','order','sort','where','filters','pick','filter','merge','map','VIRTUAL','options','includeAll','include','catch','params','keys','create','body','find','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','to-csv'];(function(_0x281684,_0x1eae63){var _0x513920=function(_0x3f80e8){while(--_0x3f80e8){_0x281684['push'](_0x281684['shift']());}};_0x513920(++_0x1eae63);}(_0x8138,0x155));var _0x8813=function(_0x529abc,_0x17b97e){_0x529abc=_0x529abc-0x0;var _0x453afa=_0x8138[_0x529abc];return _0x453afa;};'use strict';var emlformat=require(_0x8813('0x0'));var rimraf=require(_0x8813('0x1'));var zipdir=require(_0x8813('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8813('0x3'));var moment=require(_0x8813('0x4'));var BPromise=require(_0x8813('0x5'));var Mustache=require(_0x8813('0x6'));var util=require(_0x8813('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x8813('0x8'));var ejs=require(_0x8813('0x9'));var fs=require('fs');var fs_extra=require(_0x8813('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x8813('0xb'));var deskjs=require(_0x8813('0xc'));var toCsv=require('to-csv');var querystring=require(_0x8813('0xd'));var Papa=require(_0x8813('0xe'));var Redis=require(_0x8813('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8813('0x10'));var logger=require(_0x8813('0x11'))(_0x8813('0x12'));var utils=require(_0x8813('0x13'));var config=require(_0x8813('0x14'));var licenseUtil=require(_0x8813('0x15'));var db=require(_0x8813('0x16'))['db'];function respondWithStatusCode(_0x53a1c3,_0x48332b){_0x48332b=_0x48332b||0xcc;return function(_0x3e58c4){if(_0x3e58c4){return _0x53a1c3[_0x8813('0x17')](_0x48332b);}return _0x53a1c3[_0x8813('0x18')](_0x48332b)[_0x8813('0x19')]();};}function respondWithResult(_0x1ad52e,_0x28474e){_0x28474e=_0x28474e||0xc8;return function(_0x365480){if(_0x365480){return _0x1ad52e['status'](_0x28474e)[_0x8813('0x1a')](_0x365480);}};}function respondWithFilteredResult(_0x48dd3b,_0x307e96){return function(_0x3a478f){if(_0x3a478f){var _0x1cf218=typeof _0x307e96[_0x8813('0x1b')]==='undefined'&&typeof _0x307e96[_0x8813('0x1c')]==='undefined';var _0x5178c2=_0x3a478f['count'];var _0x3c224b=_0x1cf218?0x0:_0x307e96[_0x8813('0x1b')];var _0x578f05=_0x1cf218?_0x3a478f[_0x8813('0x1d')]:_0x307e96['offset']+_0x307e96[_0x8813('0x1c')];var _0x1b88b8;if(_0x578f05>=_0x5178c2){_0x578f05=_0x5178c2;_0x1b88b8=0xc8;}else{_0x1b88b8=0xce;}_0x48dd3b[_0x8813('0x18')](_0x1b88b8);return _0x48dd3b['set'](_0x8813('0x1e'),_0x3c224b+'-'+_0x578f05+'/'+_0x5178c2)[_0x8813('0x1a')](_0x3a478f);}return null;};}function patchUpdates(_0x4358ce){return function(_0x6c3538){try{jsonpatch[_0x8813('0x1f')](_0x6c3538,_0x4358ce,!![]);}catch(_0x278117){return BPromise[_0x8813('0x20')](_0x278117);}return _0x6c3538['save']();};}function saveUpdates(_0x19eeee,_0x27857a){return function(_0xea0532){if(_0xea0532){return _0xea0532[_0x8813('0x21')](_0x19eeee)[_0x8813('0x22')](function(_0x214ed3){return _0x214ed3;});}return null;};}function removeEntity(_0x40f67,_0x1cbe32){return function(_0xfc5130){if(_0xfc5130){return _0xfc5130[_0x8813('0x23')]()[_0x8813('0x22')](function(){_0x40f67[_0x8813('0x18')](0xcc)[_0x8813('0x19')]();});}};}function handleEntityNotFound(_0x34bc52,_0x59777b){return function(_0x22833e){if(!_0x22833e){_0x34bc52[_0x8813('0x17')](0x194);}return _0x22833e;};}function handleError(_0x4124d5,_0x14d55a){_0x14d55a=_0x14d55a||0x1f4;return function(_0x197545){logger[_0x8813('0x24')](_0x197545[_0x8813('0x25')]);if(_0x197545[_0x8813('0x26')]){delete _0x197545[_0x8813('0x26')];}_0x4124d5[_0x8813('0x18')](_0x14d55a)[_0x8813('0x27')](_0x197545);};}exports[_0x8813('0x28')]=function(_0x2ba68d,_0x7486a3){var _0x1335e9={},_0xd661c1={},_0x4628fe={'count':0x0,'rows':[]};var _0x5a372c=_['map'](db[_0x8813('0x29')][_0x8813('0x2a')],function(_0x1f6979){return{'name':_0x1f6979[_0x8813('0x2b')],'type':_0x1f6979[_0x8813('0x2c')][_0x8813('0x2d')]};});_0xd661c1[_0x8813('0x2e')]=_['map'](_0x5a372c,_0x8813('0x26'));_0xd661c1[_0x8813('0x2f')]=_['keys'](_0x2ba68d['query']);_0xd661c1['filters']=_[_0x8813('0x30')](_0xd661c1[_0x8813('0x2e')],_0xd661c1[_0x8813('0x2f')]);_0x1335e9[_0x8813('0x31')]=_[_0x8813('0x30')](_0xd661c1[_0x8813('0x2e')],qs[_0x8813('0x32')](_0x2ba68d[_0x8813('0x2f')][_0x8813('0x32')]));_0x1335e9[_0x8813('0x31')]=_0x1335e9[_0x8813('0x31')]['length']?_0x1335e9[_0x8813('0x31')]:_0xd661c1['model'];if(!_0x2ba68d[_0x8813('0x2f')]['hasOwnProperty'](_0x8813('0x33'))){_0x1335e9['limit']=qs[_0x8813('0x1c')](_0x2ba68d[_0x8813('0x2f')][_0x8813('0x1c')]);_0x1335e9[_0x8813('0x1b')]=qs['offset'](_0x2ba68d[_0x8813('0x2f')][_0x8813('0x1b')]);}_0x1335e9[_0x8813('0x34')]=qs['sort'](_0x2ba68d['query'][_0x8813('0x35')]);_0x1335e9[_0x8813('0x36')]=qs[_0x8813('0x37')](_[_0x8813('0x38')](_0x2ba68d[_0x8813('0x2f')],_0xd661c1[_0x8813('0x37')]),_0x5a372c);if(_0x2ba68d[_0x8813('0x2f')][_0x8813('0x39')]){_0x1335e9[_0x8813('0x36')]=_[_0x8813('0x3a')](_0x1335e9[_0x8813('0x36')],{'$or':_[_0x8813('0x3b')](_0x5a372c,function(_0x3cc86f){if(_0x3cc86f[_0x8813('0x2c')]!==_0x8813('0x3c')){var _0x4ca76a={};_0x4ca76a[_0x3cc86f['name']]={'$like':'%'+_0x2ba68d[_0x8813('0x2f')]['filter']+'%'};return _0x4ca76a;}})});}_0x1335e9=_['merge']({},_0x1335e9,_0x2ba68d[_0x8813('0x3d')]);var _0x4f3523={'where':_0x1335e9[_0x8813('0x36')]};return db[_0x8813('0x29')][_0x8813('0x1d')](_0x4f3523)[_0x8813('0x22')](function(_0x3fdbcd){_0x4628fe['count']=_0x3fdbcd;if(_0x2ba68d[_0x8813('0x2f')][_0x8813('0x3e')]){_0x1335e9[_0x8813('0x3f')]=[{'all':!![]}];}return db['ZohoField']['findAll'](_0x1335e9);})[_0x8813('0x22')](function(_0x3171d0){_0x4628fe['rows']=_0x3171d0;return _0x4628fe;})[_0x8813('0x22')](respondWithFilteredResult(_0x7486a3,_0x1335e9))[_0x8813('0x40')](handleError(_0x7486a3,null));};exports['show']=function(_0x1a4206,_0xd16c17){var _0x353811={'raw':!![],'where':{'id':_0x1a4206[_0x8813('0x41')]['id']}},_0x149849={};_0x149849['model']=_['keys'](db['ZohoField']['rawAttributes']);_0x149849[_0x8813('0x2f')]=_[_0x8813('0x42')](_0x1a4206[_0x8813('0x2f')]);_0x149849[_0x8813('0x37')]=_[_0x8813('0x30')](_0x149849['model'],_0x149849[_0x8813('0x2f')]);_0x353811[_0x8813('0x31')]=_[_0x8813('0x30')](_0x149849[_0x8813('0x2e')],qs[_0x8813('0x32')](_0x1a4206[_0x8813('0x2f')][_0x8813('0x32')]));_0x353811[_0x8813('0x31')]=_0x353811[_0x8813('0x31')]['length']?_0x353811['attributes']:_0x149849['model'];if(_0x1a4206[_0x8813('0x2f')][_0x8813('0x3e')]){_0x353811[_0x8813('0x3f')]=[{'all':!![]}];}_0x353811=_[_0x8813('0x3a')]({},_0x353811,_0x1a4206[_0x8813('0x3d')]);return db[_0x8813('0x29')]['find'](_0x353811)[_0x8813('0x22')](handleEntityNotFound(_0xd16c17,null))[_0x8813('0x22')](respondWithResult(_0xd16c17,null))[_0x8813('0x40')](handleError(_0xd16c17,null));};exports[_0x8813('0x43')]=function(_0x5f30a3,_0x1b30e7){return db[_0x8813('0x29')][_0x8813('0x43')](_0x5f30a3['body'],{})['then'](respondWithResult(_0x1b30e7,0xc9))[_0x8813('0x40')](handleError(_0x1b30e7,null));};exports['update']=function(_0x190512,_0x590e99){if(_0x190512[_0x8813('0x44')]['id']){delete _0x190512[_0x8813('0x44')]['id'];}return db[_0x8813('0x29')][_0x8813('0x45')]({'where':{'id':_0x190512[_0x8813('0x41')]['id']}})[_0x8813('0x22')](handleEntityNotFound(_0x590e99,null))[_0x8813('0x22')](saveUpdates(_0x190512['body'],null))[_0x8813('0x22')](respondWithResult(_0x590e99,null))['catch'](handleError(_0x590e99,null));};exports[_0x8813('0x23')]=function(_0x238ef5,_0x1826d5){return db[_0x8813('0x29')]['find']({'where':{'id':_0x238ef5['params']['id']}})['then'](handleEntityNotFound(_0x1826d5,null))[_0x8813('0x22')](removeEntity(_0x1826d5,null))[_0x8813('0x40')](handleError(_0x1826d5,null));}; \ No newline at end of file +var _0x6dc9=['hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','ZohoField','includeAll','include','rows','catch','params','length','options','find','create','body','rimraf','zip-dir','fast-json-patch','bluebird','util','path','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','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','Content-Range','reject','update','then','destroy','sendStatus','error','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields'];(function(_0x51ab83,_0x2721b9){var _0x14b6de=function(_0x243483){while(--_0x243483){_0x51ab83['push'](_0x51ab83['shift']());}};_0x14b6de(++_0x2721b9);}(_0x6dc9,0x140));var _0x96dc=function(_0x34b71e,_0x58f44d){_0x34b71e=_0x34b71e-0x0;var _0x2cb29b=_0x6dc9[_0x34b71e];return _0x2cb29b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x96dc('0x0'));var zipdir=require(_0x96dc('0x1'));var jsonpatch=require(_0x96dc('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x96dc('0x3'));var Mustache=require('mustache');var util=require(_0x96dc('0x4'));var path=require(_0x96dc('0x5'));var sox=require(_0x96dc('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x96dc('0x7'));var _=require(_0x96dc('0x8'));var squel=require(_0x96dc('0x9'));var crypto=require('crypto');var jsforce=require(_0x96dc('0xa'));var deskjs=require(_0x96dc('0xb'));var toCsv=require(_0x96dc('0xc'));var querystring=require(_0x96dc('0xd'));var Papa=require(_0x96dc('0xe'));var Redis=require(_0x96dc('0xf'));var authService=require(_0x96dc('0x10'));var qs=require(_0x96dc('0x11'));var as=require(_0x96dc('0x12'));var hardwareService=require(_0x96dc('0x13'));var logger=require(_0x96dc('0x14'))(_0x96dc('0x15'));var utils=require(_0x96dc('0x16'));var config=require(_0x96dc('0x17'));var licenseUtil=require(_0x96dc('0x18'));var db=require(_0x96dc('0x19'))['db'];function respondWithStatusCode(_0x3dee24,_0x5d79d3){_0x5d79d3=_0x5d79d3||0xcc;return function(_0x205e86){if(_0x205e86){return _0x3dee24['sendStatus'](_0x5d79d3);}return _0x3dee24[_0x96dc('0x1a')](_0x5d79d3)[_0x96dc('0x1b')]();};}function respondWithResult(_0x4bc4ca,_0x127a56){_0x127a56=_0x127a56||0xc8;return function(_0x4ecce9){if(_0x4ecce9){return _0x4bc4ca[_0x96dc('0x1a')](_0x127a56)[_0x96dc('0x1c')](_0x4ecce9);}};}function respondWithFilteredResult(_0x256467,_0x515a1f){return function(_0x1c362e){if(_0x1c362e){var _0x190314=typeof _0x515a1f[_0x96dc('0x1d')]===_0x96dc('0x1e')&&typeof _0x515a1f[_0x96dc('0x1f')]==='undefined';var _0x3c25ca=_0x1c362e[_0x96dc('0x20')];var _0x5568c9=_0x190314?0x0:_0x515a1f['offset'];var _0x40b425=_0x190314?_0x1c362e[_0x96dc('0x20')]:_0x515a1f[_0x96dc('0x1d')]+_0x515a1f['limit'];var _0x5a4381;if(_0x40b425>=_0x3c25ca){_0x40b425=_0x3c25ca;_0x5a4381=0xc8;}else{_0x5a4381=0xce;}_0x256467['status'](_0x5a4381);return _0x256467['set'](_0x96dc('0x21'),_0x5568c9+'-'+_0x40b425+'/'+_0x3c25ca)[_0x96dc('0x1c')](_0x1c362e);}return null;};}function patchUpdates(_0x50d8b1){return function(_0x49aeb7){try{jsonpatch['apply'](_0x49aeb7,_0x50d8b1,!![]);}catch(_0xa94676){return BPromise[_0x96dc('0x22')](_0xa94676);}return _0x49aeb7['save']();};}function saveUpdates(_0x28d5da,_0x15111e){return function(_0x42b43b){if(_0x42b43b){return _0x42b43b[_0x96dc('0x23')](_0x28d5da)[_0x96dc('0x24')](function(_0x216759){return _0x216759;});}return null;};}function removeEntity(_0x2796d3,_0x2fcbbe){return function(_0x2bfa4f){if(_0x2bfa4f){return _0x2bfa4f[_0x96dc('0x25')]()[_0x96dc('0x24')](function(){_0x2796d3['status'](0xcc)[_0x96dc('0x1b')]();});}};}function handleEntityNotFound(_0x59d741,_0x1181d0){return function(_0x557bb7){if(!_0x557bb7){_0x59d741[_0x96dc('0x26')](0x194);}return _0x557bb7;};}function handleError(_0x35f52c,_0x5b031a){_0x5b031a=_0x5b031a||0x1f4;return function(_0x556c66){logger[_0x96dc('0x27')](_0x556c66['stack']);if(_0x556c66[_0x96dc('0x28')]){delete _0x556c66[_0x96dc('0x28')];}_0x35f52c[_0x96dc('0x1a')](_0x5b031a)[_0x96dc('0x29')](_0x556c66);};}exports[_0x96dc('0x2a')]=function(_0x11ea6d,_0x47959f){var _0x35e1ba={},_0x1733b4={},_0xbc8e7f={'count':0x0,'rows':[]};var _0x4c757f=_[_0x96dc('0x2b')](db['ZohoField'][_0x96dc('0x2c')],function(_0x1968b7){return{'name':_0x1968b7[_0x96dc('0x2d')],'type':_0x1968b7[_0x96dc('0x2e')][_0x96dc('0x2f')]};});_0x1733b4[_0x96dc('0x30')]=_[_0x96dc('0x2b')](_0x4c757f,'name');_0x1733b4[_0x96dc('0x31')]=_[_0x96dc('0x32')](_0x11ea6d['query']);_0x1733b4[_0x96dc('0x33')]=_[_0x96dc('0x34')](_0x1733b4[_0x96dc('0x30')],_0x1733b4[_0x96dc('0x31')]);_0x35e1ba[_0x96dc('0x35')]=_[_0x96dc('0x34')](_0x1733b4[_0x96dc('0x30')],qs[_0x96dc('0x36')](_0x11ea6d['query'][_0x96dc('0x36')]));_0x35e1ba[_0x96dc('0x35')]=_0x35e1ba[_0x96dc('0x35')]['length']?_0x35e1ba[_0x96dc('0x35')]:_0x1733b4['model'];if(!_0x11ea6d[_0x96dc('0x31')][_0x96dc('0x37')](_0x96dc('0x38'))){_0x35e1ba[_0x96dc('0x1f')]=qs['limit'](_0x11ea6d[_0x96dc('0x31')][_0x96dc('0x1f')]);_0x35e1ba[_0x96dc('0x1d')]=qs[_0x96dc('0x1d')](_0x11ea6d['query']['offset']);}_0x35e1ba[_0x96dc('0x39')]=qs[_0x96dc('0x3a')](_0x11ea6d[_0x96dc('0x31')][_0x96dc('0x3a')]);_0x35e1ba[_0x96dc('0x3b')]=qs[_0x96dc('0x33')](_[_0x96dc('0x3c')](_0x11ea6d[_0x96dc('0x31')],_0x1733b4[_0x96dc('0x33')]),_0x4c757f);if(_0x11ea6d[_0x96dc('0x31')][_0x96dc('0x3d')]){_0x35e1ba[_0x96dc('0x3b')]=_[_0x96dc('0x3e')](_0x35e1ba[_0x96dc('0x3b')],{'$or':_[_0x96dc('0x2b')](_0x4c757f,function(_0x1cc20d){if(_0x1cc20d[_0x96dc('0x2e')]!==_0x96dc('0x3f')){var _0x54433a={};_0x54433a[_0x1cc20d[_0x96dc('0x28')]]={'$like':'%'+_0x11ea6d[_0x96dc('0x31')][_0x96dc('0x3d')]+'%'};return _0x54433a;}})});}_0x35e1ba=_[_0x96dc('0x3e')]({},_0x35e1ba,_0x11ea6d['options']);var _0x1297c1={'where':_0x35e1ba[_0x96dc('0x3b')]};return db[_0x96dc('0x40')]['count'](_0x1297c1)[_0x96dc('0x24')](function(_0x1fdd7c){_0xbc8e7f[_0x96dc('0x20')]=_0x1fdd7c;if(_0x11ea6d['query'][_0x96dc('0x41')]){_0x35e1ba[_0x96dc('0x42')]=[{'all':!![]}];}return db['ZohoField']['findAll'](_0x35e1ba);})[_0x96dc('0x24')](function(_0x174bcf){_0xbc8e7f[_0x96dc('0x43')]=_0x174bcf;return _0xbc8e7f;})[_0x96dc('0x24')](respondWithFilteredResult(_0x47959f,_0x35e1ba))[_0x96dc('0x44')](handleError(_0x47959f,null));};exports['show']=function(_0x20a0e8,_0x13a0dd){var _0x41e57a={'raw':!![],'where':{'id':_0x20a0e8[_0x96dc('0x45')]['id']}},_0x2198aa={};_0x2198aa[_0x96dc('0x30')]=_[_0x96dc('0x32')](db[_0x96dc('0x40')][_0x96dc('0x2c')]);_0x2198aa[_0x96dc('0x31')]=_[_0x96dc('0x32')](_0x20a0e8[_0x96dc('0x31')]);_0x2198aa[_0x96dc('0x33')]=_[_0x96dc('0x34')](_0x2198aa[_0x96dc('0x30')],_0x2198aa['query']);_0x41e57a['attributes']=_[_0x96dc('0x34')](_0x2198aa[_0x96dc('0x30')],qs[_0x96dc('0x36')](_0x20a0e8[_0x96dc('0x31')]['fields']));_0x41e57a[_0x96dc('0x35')]=_0x41e57a['attributes'][_0x96dc('0x46')]?_0x41e57a[_0x96dc('0x35')]:_0x2198aa[_0x96dc('0x30')];if(_0x20a0e8[_0x96dc('0x31')][_0x96dc('0x41')]){_0x41e57a['include']=[{'all':!![]}];}_0x41e57a=_['merge']({},_0x41e57a,_0x20a0e8[_0x96dc('0x47')]);return db[_0x96dc('0x40')][_0x96dc('0x48')](_0x41e57a)[_0x96dc('0x24')](handleEntityNotFound(_0x13a0dd,null))[_0x96dc('0x24')](respondWithResult(_0x13a0dd,null))[_0x96dc('0x44')](handleError(_0x13a0dd,null));};exports[_0x96dc('0x49')]=function(_0x2faacb,_0xad8136){return db[_0x96dc('0x40')][_0x96dc('0x49')](_0x2faacb[_0x96dc('0x4a')],{})[_0x96dc('0x24')](respondWithResult(_0xad8136,0xc9))[_0x96dc('0x44')](handleError(_0xad8136,null));};exports[_0x96dc('0x23')]=function(_0x131e2b,_0x4541a5){if(_0x131e2b[_0x96dc('0x4a')]['id']){delete _0x131e2b[_0x96dc('0x4a')]['id'];}return db['ZohoField']['find']({'where':{'id':_0x131e2b['params']['id']}})[_0x96dc('0x24')](handleEntityNotFound(_0x4541a5,null))[_0x96dc('0x24')](saveUpdates(_0x131e2b[_0x96dc('0x4a')],null))[_0x96dc('0x24')](respondWithResult(_0x4541a5,null))[_0x96dc('0x44')](handleError(_0x4541a5,null));};exports[_0x96dc('0x25')]=function(_0x1e9597,_0x59d79f){return db[_0x96dc('0x40')][_0x96dc('0x48')]({'where':{'id':_0x1e9597[_0x96dc('0x45')]['id']}})[_0x96dc('0x24')](handleEntityNotFound(_0x59d79f,null))[_0x96dc('0x24')](removeEntity(_0x59d79f,null))[_0x96dc('0x44')](handleError(_0x59d79f,null));}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.model.js b/server/api/intZohoField/intZohoField.model.js index 92765e3..d12e714 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 _0x71ab=['rimraf','../../config/environment','./intZohoField.attributes','exports','define','ZohoField','int_zoho_fields','zoho_unique_index','idField','FieldId','util','api','bluebird','request-promise','path'];(function(_0x1fb37e,_0x49de19){var _0x15177d=function(_0xb07731){while(--_0xb07731){_0x1fb37e['push'](_0x1fb37e['shift']());}};_0x15177d(++_0x49de19);}(_0x71ab,0x64));var _0xb71a=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0x71ab[_0x138adb];return _0x1b27f2;};'use strict';var _=require('lodash');var util=require(_0xb71a('0x0'));var logger=require('../../config/logger')(_0xb71a('0x1'));var moment=require('moment');var BPromise=require(_0xb71a('0x2'));var rp=require(_0xb71a('0x3'));var fs=require('fs');var path=require(_0xb71a('0x4'));var rimraf=require(_0xb71a('0x5'));var config=require(_0xb71a('0x6'));var attributes=require(_0xb71a('0x7'));module[_0xb71a('0x8')]=function(_0x38d931,_0x22c072){return _0x38d931[_0xb71a('0x9')](_0xb71a('0xa'),attributes,{'tableName':_0xb71a('0xb'),'paranoid':![],'indexes':[{'name':_0xb71a('0xc'),'fields':[_0xb71a('0xd'),_0xb71a('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xe2fe=['zoho_unique_index','FieldId','lodash','api','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','ZohoField'];(function(_0x23a79e,_0x235f89){var _0x3dab57=function(_0x346cf4){while(--_0x346cf4){_0x23a79e['push'](_0x23a79e['shift']());}};_0x3dab57(++_0x235f89);}(_0xe2fe,0x86));var _0xee2f=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xe2fe[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xee2f('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xee2f('0x1'));var moment=require('moment');var BPromise=require(_0xee2f('0x2'));var rp=require(_0xee2f('0x3'));var fs=require('fs');var path=require(_0xee2f('0x4'));var rimraf=require(_0xee2f('0x5'));var config=require(_0xee2f('0x6'));var attributes=require('./intZohoField.attributes');module[_0xee2f('0x7')]=function(_0x2b7e7c,_0x49926b){return _0x2b7e7c[_0xee2f('0x8')](_0xee2f('0x9'),attributes,{'tableName':'int_zoho_fields','paranoid':![],'indexes':[{'name':_0xee2f('0xa'),'fields':['idField',_0xee2f('0xb')],'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 a8ce683..262c02f 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 _0xcb4f=['code','ZohoField,\x20%s,\x20%s','message','info','result','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','request\x20sent','ZohoField,\x20%s,\x20%s,\x20%s','error'];(function(_0x193109,_0x50a9ca){var _0x4af109=function(_0x21c390){while(--_0x21c390){_0x193109['push'](_0x193109['shift']());}};_0x4af109(++_0x50a9ca);}(_0xcb4f,0x116));var _0xfcb4=function(_0x24061a,_0x1c9f4d){_0x24061a=_0x24061a-0x0;var _0x82054e=_0xcb4f[_0x24061a];return _0x82054e;};'use strict';var _=require(_0xfcb4('0x0'));var util=require('util');var moment=require(_0xfcb4('0x1'));var BPromise=require(_0xfcb4('0x2'));var rs=require(_0xfcb4('0x3'));var fs=require('fs');var Redis=require(_0xfcb4('0x4'));var db=require(_0xfcb4('0x5'))['db'];var utils=require(_0xfcb4('0x6'));var logger=require(_0xfcb4('0x7'))(_0xfcb4('0x8'));var config=require('../../config/environment');var jayson=require(_0xfcb4('0x9'));var client=jayson[_0xfcb4('0xa')][_0xfcb4('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x468018,_0x176c42,_0x4436e8){return new BPromise(function(_0x4e5f25,_0x324bd6){return client[_0xfcb4('0xc')](_0x468018,_0x4436e8)['then'](function(_0x1d6d3c){logger['info']('ZohoField,\x20%s,\x20%s',_0x176c42,_0xfcb4('0xd'));logger['debug'](_0xfcb4('0xe'),_0x176c42,_0xfcb4('0xd'),JSON['stringify'](_0x1d6d3c));if(_0x1d6d3c[_0xfcb4('0xf')]){if(_0x1d6d3c['error'][_0xfcb4('0x10')]===0x1f4){logger[_0xfcb4('0xf')](_0xfcb4('0x11'),_0x176c42,_0x1d6d3c[_0xfcb4('0xf')][_0xfcb4('0x12')]);return _0x324bd6(_0x1d6d3c[_0xfcb4('0xf')][_0xfcb4('0x12')]);}logger[_0xfcb4('0xf')](_0xfcb4('0x11'),_0x176c42,_0x1d6d3c[_0xfcb4('0xf')][_0xfcb4('0x12')]);return _0x4e5f25(_0x1d6d3c[_0xfcb4('0xf')][_0xfcb4('0x12')]);}else{logger[_0xfcb4('0x13')](_0xfcb4('0x11'),_0x176c42,_0xfcb4('0xd'));_0x4e5f25(_0x1d6d3c[_0xfcb4('0x14')]['message']);}})['catch'](function(_0x2c6676){logger[_0xfcb4('0xf')](_0xfcb4('0x11'),_0x176c42,_0x2c6676);_0x324bd6(_0x2c6676);});});} \ No newline at end of file +var _0xc02b=['jayson/promise','client','http','request','info','ZohoField,\x20%s,\x20%s','request\x20sent','debug','ZohoField,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x5eb2a8,_0x69a5cd){var _0x53e5f7=function(_0x654d6b){while(--_0x654d6b){_0x5eb2a8['push'](_0x5eb2a8['shift']());}};_0x53e5f7(++_0x69a5cd);}(_0xc02b,0x142));var _0xbc02=function(_0x4154a6,_0x2c0b8e){_0x4154a6=_0x4154a6-0x0;var _0x3b2786=_0xc02b[_0x4154a6];return _0x3b2786;};'use strict';var _=require(_0xbc02('0x0'));var util=require('util');var moment=require(_0xbc02('0x1'));var BPromise=require(_0xbc02('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbc02('0x3'))['db'];var utils=require(_0xbc02('0x4'));var logger=require(_0xbc02('0x5'))(_0xbc02('0x6'));var config=require(_0xbc02('0x7'));var jayson=require(_0xbc02('0x8'));var client=jayson[_0xbc02('0x9')][_0xbc02('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xdd83df,_0x59f81b,_0x598c40){return new BPromise(function(_0x572a2c,_0x21ed16){return client[_0xbc02('0xb')](_0xdd83df,_0x598c40)['then'](function(_0x2dc4dc){logger[_0xbc02('0xc')](_0xbc02('0xd'),_0x59f81b,_0xbc02('0xe'));logger[_0xbc02('0xf')](_0xbc02('0x10'),_0x59f81b,_0xbc02('0xe'),JSON[_0xbc02('0x11')](_0x2dc4dc));if(_0x2dc4dc[_0xbc02('0x12')]){if(_0x2dc4dc[_0xbc02('0x12')]['code']===0x1f4){logger['error'](_0xbc02('0xd'),_0x59f81b,_0x2dc4dc[_0xbc02('0x12')][_0xbc02('0x13')]);return _0x21ed16(_0x2dc4dc['error'][_0xbc02('0x13')]);}logger['error'](_0xbc02('0xd'),_0x59f81b,_0x2dc4dc[_0xbc02('0x12')]['message']);return _0x572a2c(_0x2dc4dc[_0xbc02('0x12')][_0xbc02('0x13')]);}else{logger['info'](_0xbc02('0xd'),_0x59f81b,'request\x20sent');_0x572a2c(_0x2dc4dc[_0xbc02('0x14')]['message']);}})[_0xbc02('0x15')](function(_0x4c6bb5){logger['error'](_0xbc02('0xd'),_0x59f81b,_0x4c6bb5);_0x21ed16(_0x4c6bb5);});});} \ No newline at end of file diff --git a/server/api/integration/index.js b/server/api/integration/index.js index f5746ca..4a3a8e5 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 _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x34a9ec,_0x274e6e){var _0x153926=function(_0x315284){while(--_0x315284){_0x34a9ec['push'](_0x34a9ec['shift']());}};_0x153926(++_0x274e6e);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x2f0057,_0x448b27){_0x2f0057=_0x2f0057-0x0;var _0x17f2c3=_0xcb91[_0x2f0057];return _0x17f2c3;};'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 _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0xaae0aa,_0x1503ce){var _0x304945=function(_0x4f9e4b){while(--_0x4f9e4b){_0xaae0aa['push'](_0xaae0aa['shift']());}};_0x304945(++_0x1503ce);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x1b4b23,_0x5dd6d6){_0x1b4b23=_0x1b4b23-0x0;var _0x2a325b=_0xcb91[_0x1b4b23];return _0x2a325b;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router; \ No newline at end of file diff --git a/server/api/integration/integration.attributes.js b/server/api/integration/integration.attributes.js index 224ddd0..1746a8c 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 _0xa583=['unique_name_and_version','STRING','INTEGER','exports'];(function(_0x5e1e25,_0xdc1421){var _0x548e5f=function(_0x576360){while(--_0x576360){_0x5e1e25['push'](_0x5e1e25['shift']());}};_0x548e5f(++_0xdc1421);}(_0xa583,0x127));var _0x3a58=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0xa583[_0x167cc1];return _0x10bc4b;};'use strict';var Sequelize=require('sequelize');module[_0x3a58('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x3a58('0x1')},'version':{'type':Sequelize[_0x3a58('0x2')],'allowNull':![],'unique':_0x3a58('0x1')},'main':{'type':Sequelize[_0x3a58('0x2')],'defaultValue':'app.js'},'filename':{'type':Sequelize[_0x3a58('0x2')]},'path':{'type':Sequelize[_0x3a58('0x2')]},'type':{'type':Sequelize[_0x3a58('0x2')]},'size':{'type':Sequelize[_0x3a58('0x3')]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'author':{'type':Sequelize['STRING']},'logo':{'type':Sequelize['STRING']},'state':{'type':Sequelize[_0x3a58('0x2')],'unique':'state'},'description':{'type':Sequelize[_0x3a58('0x2')]},'title':{'type':Sequelize[_0x3a58('0x2')]},'remoteUri':{'type':Sequelize[_0x3a58('0x2')]},'link':{'type':Sequelize[_0x3a58('0x2')],'defaultValue':'#'}}; \ No newline at end of file +var _0xd7ed=['app.js','INTEGER','BOOLEAN','sequelize','STRING','unique_name_and_version'];(function(_0x560beb,_0x276f9c){var _0x31fd32=function(_0x41fd2a){while(--_0x41fd2a){_0x560beb['push'](_0x560beb['shift']());}};_0x31fd32(++_0x276f9c);}(_0xd7ed,0x1a1));var _0xdd7e=function(_0x58e469,_0x95ee3e){_0x58e469=_0x58e469-0x0;var _0x4c01c5=_0xd7ed[_0x58e469];return _0x4c01c5;};'use strict';var Sequelize=require(_0xdd7e('0x0'));module['exports']={'name':{'type':Sequelize[_0xdd7e('0x1')],'allowNull':![],'unique':_0xdd7e('0x2')},'version':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xdd7e('0x2')},'main':{'type':Sequelize[_0xdd7e('0x1')],'defaultValue':_0xdd7e('0x3')},'filename':{'type':Sequelize[_0xdd7e('0x1')]},'path':{'type':Sequelize[_0xdd7e('0x1')]},'type':{'type':Sequelize[_0xdd7e('0x1')]},'size':{'type':Sequelize[_0xdd7e('0x4')]},'active':{'type':Sequelize[_0xdd7e('0x5')],'defaultValue':![]},'author':{'type':Sequelize[_0xdd7e('0x1')]},'logo':{'type':Sequelize[_0xdd7e('0x1')]},'state':{'type':Sequelize['STRING'],'unique':'state'},'description':{'type':Sequelize[_0xdd7e('0x1')]},'title':{'type':Sequelize[_0xdd7e('0x1')]},'remoteUri':{'type':Sequelize['STRING']},'link':{'type':Sequelize[_0xdd7e('0x1')],'defaultValue':'#'}}; \ No newline at end of file diff --git a/server/api/integration/integration.controller.js b/server/api/integration/integration.controller.js index 3ccd042..e395dc7 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 _0xc4aa=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','map','Integration','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','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'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x4d613c,_0x55f220){_0x4d613c=_0x4d613c-0x0;var _0x301fe3=_0xc4aa[_0x4d613c];return _0x301fe3;};'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['Integration']['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));}; \ No newline at end of file +var _0xd117=['hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','count','findAll','rows','catch','show','params','rawAttributes','includeAll','find','create','update','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','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','Integration','fieldName','type','map','keys','query','filters','model','intersection','fields','attributes','length'];(function(_0x597d45,_0x3c4f12){var _0x38bf03=function(_0x2f09a5){while(--_0x2f09a5){_0x597d45['push'](_0x597d45['shift']());}};_0x38bf03(++_0x3c4f12);}(_0xd117,0x182));var _0x7d11=function(_0x7611ce,_0x4a4441){_0x7611ce=_0x7611ce-0x0;var _0x67d3ab=_0xd117[_0x7611ce];return _0x67d3ab;};'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')]['create'](_0x161213['body'],{})['then'](respondWithResult(_0x193631,0xc9))[_0x7d11('0x40')](handleError(_0x193631,null));};exports[_0x7d11('0x47')]=function(_0x20297a,_0x18ae0e){if(_0x20297a[_0x7d11('0x48')]['id']){delete _0x20297a[_0x7d11('0x48')]['id'];}return db[_0x7d11('0x28')][_0x7d11('0x45')]({'where':{'id':_0x20297a[_0x7d11('0x42')]['id']}})[_0x7d11('0x22')](handleEntityNotFound(_0x18ae0e,null))[_0x7d11('0x22')](saveUpdates(_0x20297a[_0x7d11('0x48')],null))['then'](respondWithResult(_0x18ae0e,null))[_0x7d11('0x40')](handleError(_0x18ae0e,null));};exports[_0x7d11('0x23')]=function(_0x29207f,_0x553a03){return db['Integration'][_0x7d11('0x45')]({'where':{'id':_0x29207f[_0x7d11('0x42')]['id']}})[_0x7d11('0x22')](handleEntityNotFound(_0x553a03,null))['then'](removeEntity(_0x553a03,null))['catch'](handleError(_0x553a03,null));}; \ No newline at end of file diff --git a/server/api/integration/integration.model.js b/server/api/integration/integration.model.js index b428d49..c4493bf 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 _0x3088=['./integration.attributes','exports','Integration','lodash','util','../../config/logger','api','moment','path','../../config/environment'];(function(_0x1142da,_0x4ee9cb){var _0x234ff9=function(_0x17365d){while(--_0x17365d){_0x1142da['push'](_0x1142da['shift']());}};_0x234ff9(++_0x4ee9cb);}(_0x3088,0x157));var _0x8308=function(_0x24875d,_0x4fb24d){_0x24875d=_0x24875d-0x0;var _0x181471=_0x3088[_0x24875d];return _0x181471;};'use strict';var _=require(_0x8308('0x0'));var util=require(_0x8308('0x1'));var logger=require(_0x8308('0x2'))(_0x8308('0x3'));var moment=require(_0x8308('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x8308('0x5'));var rimraf=require('rimraf');var config=require(_0x8308('0x6'));var attributes=require(_0x8308('0x7'));module[_0x8308('0x8')]=function(_0x35d9c6,_0x4ca05b){return _0x35d9c6['define'](_0x8308('0x9'),attributes,{'tableName':'integrations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x36f3=['../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./integration.attributes','exports','Integration','lodash','util'];(function(_0x3fc14,_0x41a3b8){var _0x349ebd=function(_0x493ff8){while(--_0x493ff8){_0x3fc14['push'](_0x3fc14['shift']());}};_0x349ebd(++_0x41a3b8);}(_0x36f3,0xcf));var _0x336f=function(_0xbdc74b,_0x1b1eae){_0xbdc74b=_0xbdc74b-0x0;var _0x113118=_0x36f3[_0xbdc74b];return _0x113118;};'use strict';var _=require(_0x336f('0x0'));var util=require(_0x336f('0x1'));var logger=require(_0x336f('0x2'))('api');var moment=require('moment');var BPromise=require(_0x336f('0x3'));var rp=require(_0x336f('0x4'));var fs=require('fs');var path=require(_0x336f('0x5'));var rimraf=require(_0x336f('0x6'));var config=require(_0x336f('0x7'));var attributes=require(_0x336f('0x8'));module[_0x336f('0x9')]=function(_0x526436,_0x233572){return _0x526436['define'](_0x336f('0xa'),attributes,{'tableName':'integrations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/integration/integration.rpc.js b/server/api/integration/integration.rpc.js index 47abf6d..de8e5f5 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 _0xc6ac=['http','request','then','info','Integration,\x20%s,\x20%s','debug','Integration,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x4eac13,_0x3b5a14){var _0x2082d3=function(_0x41da3c){while(--_0x41da3c){_0x4eac13['push'](_0x4eac13['shift']());}};_0x2082d3(++_0x3b5a14);}(_0xc6ac,0x15b));var _0xcc6a=function(_0x3ab3da,_0x27aaba){_0x3ab3da=_0x3ab3da-0x0;var _0x42a321=_0xc6ac[_0x3ab3da];return _0x42a321;};'use strict';var _=require(_0xcc6a('0x0'));var util=require(_0xcc6a('0x1'));var moment=require(_0xcc6a('0x2'));var BPromise=require(_0xcc6a('0x3'));var rs=require(_0xcc6a('0x4'));var fs=require('fs');var Redis=require(_0xcc6a('0x5'));var db=require(_0xcc6a('0x6'))['db'];var utils=require(_0xcc6a('0x7'));var logger=require(_0xcc6a('0x8'))(_0xcc6a('0x9'));var config=require(_0xcc6a('0xa'));var jayson=require(_0xcc6a('0xb'));var client=jayson[_0xcc6a('0xc')][_0xcc6a('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x5f3887,_0x3dd497,_0x11b919){return new BPromise(function(_0xf02261,_0x560cc4){return client[_0xcc6a('0xe')](_0x5f3887,_0x11b919)[_0xcc6a('0xf')](function(_0x7806a0){logger[_0xcc6a('0x10')](_0xcc6a('0x11'),_0x3dd497,'request\x20sent');logger[_0xcc6a('0x12')](_0xcc6a('0x13'),_0x3dd497,_0xcc6a('0x14'),JSON['stringify'](_0x7806a0));if(_0x7806a0[_0xcc6a('0x15')]){if(_0x7806a0[_0xcc6a('0x15')][_0xcc6a('0x16')]===0x1f4){logger['error']('Integration,\x20%s,\x20%s',_0x3dd497,_0x7806a0[_0xcc6a('0x15')][_0xcc6a('0x17')]);return _0x560cc4(_0x7806a0[_0xcc6a('0x15')]['message']);}logger['error'](_0xcc6a('0x11'),_0x3dd497,_0x7806a0[_0xcc6a('0x15')][_0xcc6a('0x17')]);return _0xf02261(_0x7806a0[_0xcc6a('0x15')][_0xcc6a('0x17')]);}else{logger[_0xcc6a('0x10')](_0xcc6a('0x11'),_0x3dd497,_0xcc6a('0x14'));_0xf02261(_0x7806a0['result']['message']);}})['catch'](function(_0x395a55){logger[_0xcc6a('0x15')](_0xcc6a('0x11'),_0x3dd497,_0x395a55);_0x560cc4(_0x395a55);});});} \ No newline at end of file +var _0x4137=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','request\x20sent','debug','Integration,\x20%s,\x20%s,\x20%s','stringify','error','code','Integration,\x20%s,\x20%s','message','lodash','util','moment','bluebird','randomstring'];(function(_0x568cf0,_0x1a44cb){var _0x360f81=function(_0x414953){while(--_0x414953){_0x568cf0['push'](_0x568cf0['shift']());}};_0x360f81(++_0x1a44cb);}(_0x4137,0xf8));var _0x7413=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x4137[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0x7413('0x0'));var util=require(_0x7413('0x1'));var moment=require(_0x7413('0x2'));var BPromise=require(_0x7413('0x3'));var rs=require(_0x7413('0x4'));var fs=require('fs');var Redis=require(_0x7413('0x5'));var db=require(_0x7413('0x6'))['db'];var utils=require(_0x7413('0x7'));var logger=require(_0x7413('0x8'))(_0x7413('0x9'));var config=require(_0x7413('0xa'));var jayson=require(_0x7413('0xb'));var client=jayson['client'][_0x7413('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x188d89,_0x5b39ac,_0x15af0d){return new BPromise(function(_0x5f4cd0,_0x3236ec){return client[_0x7413('0xd')](_0x188d89,_0x15af0d)['then'](function(_0x422bf5){logger[_0x7413('0xe')]('Integration,\x20%s,\x20%s',_0x5b39ac,_0x7413('0xf'));logger[_0x7413('0x10')](_0x7413('0x11'),_0x5b39ac,_0x7413('0xf'),JSON[_0x7413('0x12')](_0x422bf5));if(_0x422bf5['error']){if(_0x422bf5[_0x7413('0x13')][_0x7413('0x14')]===0x1f4){logger['error'](_0x7413('0x15'),_0x5b39ac,_0x422bf5[_0x7413('0x13')][_0x7413('0x16')]);return _0x3236ec(_0x422bf5['error']['message']);}logger['error'](_0x7413('0x15'),_0x5b39ac,_0x422bf5[_0x7413('0x13')]['message']);return _0x5f4cd0(_0x422bf5[_0x7413('0x13')][_0x7413('0x16')]);}else{logger['info'](_0x7413('0x15'),_0x5b39ac,'request\x20sent');_0x5f4cd0(_0x422bf5['result'][_0x7413('0x16')]);}})['catch'](function(_0x195c72){logger['error'](_0x7413('0x15'),_0x5b39ac,_0x195c72);_0x3236ec(_0x195c72);});});} \ No newline at end of file diff --git a/server/api/integrationReport/index.js b/server/api/integrationReport/index.js index 4ba4e7f..05f5ea8 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 _0xc6ac=['./integrationReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','put','delete','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x3d24eb,_0x3b393f){var _0x488897=function(_0x40b036){while(--_0x40b036){_0x3d24eb['push'](_0x3d24eb['shift']());}};_0x488897(++_0x3b393f);}(_0xc6ac,0x15b));var _0xcc6a=function(_0x3ebfcc,_0x288363){_0x3ebfcc=_0x3ebfcc-0x0;var _0x1d5382=_0xc6ac[_0x3ebfcc];return _0x1d5382;};'use strict';var multer=require(_0xcc6a('0x0'));var util=require(_0xcc6a('0x1'));var path=require(_0xcc6a('0x2'));var timeout=require(_0xcc6a('0x3'));var express=require(_0xcc6a('0x4'));var router=express[_0xcc6a('0x5')]();var fs_extra=require(_0xcc6a('0x6'));var auth=require(_0xcc6a('0x7'));var interaction=require(_0xcc6a('0x8'));var config=require(_0xcc6a('0x9'));var controller=require(_0xcc6a('0xa'));router[_0xcc6a('0xb')]('/',auth[_0xcc6a('0xc')](),controller[_0xcc6a('0xd')]);router['get'](_0xcc6a('0xe'),auth[_0xcc6a('0xc')](),controller[_0xcc6a('0xf')]);router['get'](_0xcc6a('0x10'),auth[_0xcc6a('0xc')](),controller[_0xcc6a('0x11')]);router[_0xcc6a('0x12')]('/',auth[_0xcc6a('0xc')](),controller['create']);router[_0xcc6a('0x13')](_0xcc6a('0x10'),auth[_0xcc6a('0xc')](),controller['update']);router[_0xcc6a('0x14')](_0xcc6a('0x10'),auth[_0xcc6a('0xc')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xdb28=['destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','/:id','show','create','put','update'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0xdb28,0x106));var _0x8db2=function(_0x12cef3,_0x3da9ad){_0x12cef3=_0x12cef3-0x0;var _0x2805b3=_0xdb28[_0x12cef3];return _0x2805b3;};'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('./integrationReport.controller');router[_0x8db2('0x9')]('/',auth[_0x8db2('0xa')](),controller['index']);router['get'](_0x8db2('0xb'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xc')]);router[_0x8db2('0x9')](_0x8db2('0xd'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xe')]);router['post']('/',auth[_0x8db2('0xa')](),controller[_0x8db2('0xf')]);router[_0x8db2('0x10')]('/:id',auth[_0x8db2('0xa')](),controller[_0x8db2('0x11')]);router['delete'](_0x8db2('0xd'),auth[_0x8db2('0xa')](),controller[_0x8db2('0x12')]);module[_0x8db2('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 529eb63..f4cf9e7 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 _0x6b21=['STRING','INTEGER','DATE','BOOLEAN','TEXT','ENUM','SENT','SENDING','RECEIVED','FAILED','sequelize','exports'];(function(_0x47cd84,_0x3056b9){var _0x800299=function(_0x7a34ba){while(--_0x7a34ba){_0x47cd84['push'](_0x47cd84['shift']());}};_0x800299(++_0x3056b9);}(_0x6b21,0x12a));var _0x16b2=function(_0x27097a,_0x1b7f8b){_0x27097a=_0x27097a-0x0;var _0x26378b=_0x6b21[_0x27097a];return _0x26378b;};'use strict';var Sequelize=require(_0x16b2('0x0'));module[_0x16b2('0x1')]={'integration':{'type':Sequelize[_0x16b2('0x2')]},'eventChannel':{'type':Sequelize['STRING']},'exitStatus':{'type':Sequelize['STRING']},'ticketId':{'type':Sequelize[_0x16b2('0x2')]},'integrationId':{'type':Sequelize[_0x16b2('0x3')]},'contacts':{'type':Sequelize[_0x16b2('0x2')]},'uniqueid':{'type':Sequelize[_0x16b2('0x2')]},'calleridnum':{'type':Sequelize[_0x16b2('0x2')]},'calleridname':{'type':Sequelize[_0x16b2('0x2')]},'queue':{'type':Sequelize[_0x16b2('0x2')]},'interface':{'type':Sequelize[_0x16b2('0x2')]},'membername':{'type':Sequelize[_0x16b2('0x2')]},'agentcalledAt':{'type':Sequelize['DATE']},'agentconnectAt':{'type':Sequelize[_0x16b2('0x4')]},'holdtime':{'type':Sequelize[_0x16b2('0x3')]},'agentcomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize['DATE']},'talktime':{'type':Sequelize[_0x16b2('0x3')]},'agentacw':{'type':Sequelize[_0x16b2('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x16b2('0x3')]},'reason':{'type':Sequelize[_0x16b2('0x2')]},'agentringnoanswer':{'type':Sequelize[_0x16b2('0x5')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0x16b2('0x4')]},'agentdump':{'type':Sequelize[_0x16b2('0x5')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0x16b2('0x4')]},'lastevent':{'type':Sequelize[_0x16b2('0x2')]},'channel':{'type':Sequelize[_0x16b2('0x2')]},'channelstate':{'type':Sequelize[_0x16b2('0x3')]},'channelstatedesc':{'type':Sequelize[_0x16b2('0x2')]},'connectedlinenum':{'type':Sequelize[_0x16b2('0x2')]},'connectedlinename':{'type':Sequelize[_0x16b2('0x2')]},'language':{'type':Sequelize[_0x16b2('0x2')]},'accountcode':{'type':Sequelize[_0x16b2('0x2')]},'context':{'type':Sequelize[_0x16b2('0x2')]},'exten':{'type':Sequelize[_0x16b2('0x2')]},'priority':{'type':Sequelize[_0x16b2('0x2')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0x16b2('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0x16b2('0x2')]},'destcalleridnum':{'type':Sequelize[_0x16b2('0x2')]},'destcalleridname':{'type':Sequelize[_0x16b2('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0x16b2('0x2')]},'destconnectedlinename':{'type':Sequelize[_0x16b2('0x2')]},'destlanguage':{'type':Sequelize[_0x16b2('0x2')]},'destaccountcode':{'type':Sequelize[_0x16b2('0x2')]},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize[_0x16b2('0x2')]},'destpriority':{'type':Sequelize['STRING']},'destuniqueid':{'type':Sequelize['STRING']},'messageId':{'type':Sequelize[_0x16b2('0x2')]},'inReplyTo':{'type':Sequelize[_0x16b2('0x2')]},'subject':{'type':Sequelize[_0x16b2('0x2')]},'from':{'type':Sequelize[_0x16b2('0x2')]},'to':{'type':Sequelize[_0x16b2('0x2')]},'cc':{'type':Sequelize[_0x16b2('0x2')]},'attachment':{'type':Sequelize[_0x16b2('0x6')]},'html':{'type':Sequelize[_0x16b2('0x6')]},'text':{'type':Sequelize['TEXT']},'status':{'type':Sequelize[_0x16b2('0x7')](_0x16b2('0x8'),_0x16b2('0x9'),_0x16b2('0xa'),_0x16b2('0xb'))},'url':{'type':Sequelize[_0x16b2('0x2')]},'app':{'type':Sequelize[_0x16b2('0x2')]},'appdata':{'type':Sequelize[_0x16b2('0x2')]},'projectId':{'type':Sequelize[_0x16b2('0x3')]}}; \ No newline at end of file +var _0x7787=['FAILED','sequelize','exports','STRING','INTEGER','DATE','BOOLEAN','TEXT','ENUM','SENT','SENDING','RECEIVED'];(function(_0x2de91a,_0x542708){var _0x49d0b8=function(_0x2e4bcf){while(--_0x2e4bcf){_0x2de91a['push'](_0x2de91a['shift']());}};_0x49d0b8(++_0x542708);}(_0x7787,0x6d));var _0x7778=function(_0x300d85,_0x2b448f){_0x300d85=_0x300d85-0x0;var _0x48912b=_0x7787[_0x300d85];return _0x48912b;};'use strict';var Sequelize=require(_0x7778('0x0'));module[_0x7778('0x1')]={'integration':{'type':Sequelize[_0x7778('0x2')]},'eventChannel':{'type':Sequelize['STRING']},'exitStatus':{'type':Sequelize['STRING']},'ticketId':{'type':Sequelize[_0x7778('0x2')]},'integrationId':{'type':Sequelize[_0x7778('0x3')]},'contacts':{'type':Sequelize[_0x7778('0x2')]},'uniqueid':{'type':Sequelize[_0x7778('0x2')]},'calleridnum':{'type':Sequelize[_0x7778('0x2')]},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x7778('0x2')]},'interface':{'type':Sequelize[_0x7778('0x2')]},'membername':{'type':Sequelize['STRING']},'agentcalledAt':{'type':Sequelize['DATE']},'agentconnectAt':{'type':Sequelize[_0x7778('0x4')]},'holdtime':{'type':Sequelize[_0x7778('0x3')]},'agentcomplete':{'type':Sequelize[_0x7778('0x5')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0x7778('0x4')]},'talktime':{'type':Sequelize[_0x7778('0x3')]},'agentacw':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x7778('0x3')]},'reason':{'type':Sequelize[_0x7778('0x2')]},'agentringnoanswer':{'type':Sequelize[_0x7778('0x5')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize['DATE']},'agentdump':{'type':Sequelize[_0x7778('0x5')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0x7778('0x4')]},'lastevent':{'type':Sequelize[_0x7778('0x2')]},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize[_0x7778('0x3')]},'channelstatedesc':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x7778('0x2')]},'connectedlinename':{'type':Sequelize[_0x7778('0x2')]},'language':{'type':Sequelize[_0x7778('0x2')]},'accountcode':{'type':Sequelize[_0x7778('0x2')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0x7778('0x2')]},'priority':{'type':Sequelize[_0x7778('0x2')]},'destchannel':{'type':Sequelize[_0x7778('0x2')]},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize[_0x7778('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0x7778('0x2')]},'destconnectedlinename':{'type':Sequelize[_0x7778('0x2')]},'destlanguage':{'type':Sequelize[_0x7778('0x2')]},'destaccountcode':{'type':Sequelize[_0x7778('0x2')]},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize[_0x7778('0x2')]},'destpriority':{'type':Sequelize['STRING']},'destuniqueid':{'type':Sequelize[_0x7778('0x2')]},'messageId':{'type':Sequelize[_0x7778('0x2')]},'inReplyTo':{'type':Sequelize[_0x7778('0x2')]},'subject':{'type':Sequelize['STRING']},'from':{'type':Sequelize[_0x7778('0x2')]},'to':{'type':Sequelize[_0x7778('0x2')]},'cc':{'type':Sequelize[_0x7778('0x2')]},'attachment':{'type':Sequelize['TEXT']},'html':{'type':Sequelize['TEXT']},'text':{'type':Sequelize[_0x7778('0x6')]},'status':{'type':Sequelize[_0x7778('0x7')](_0x7778('0x8'),_0x7778('0x9'),_0x7778('0xa'),_0x7778('0xb'))},'url':{'type':Sequelize[_0x7778('0x2')]},'app':{'type':Sequelize[_0x7778('0x2')]},'appdata':{'type':Sequelize[_0x7778('0x2')]},'projectId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.controller.js b/server/api/integrationReport/integrationReport.controller.js index fe0d96c..ab4a376 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 _0xcaad=['options','includeAll','include','findAll','rows','catch','show','create','body','find','params','describe','eml-format','zip-dir','fast-json-patch','moment','bluebird','util','path','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/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','limit','undefined','count','offset','apply','reject','save','update','then','destroy','error','stack','name','IntegrationReport','rawAttributes','fieldName','type','key','model','map','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge'];(function(_0x12fc8d,_0x19ee33){var _0x3f9d04=function(_0x52e51c){while(--_0x52e51c){_0x12fc8d['push'](_0x12fc8d['shift']());}};_0x3f9d04(++_0x19ee33);}(_0xcaad,0x192));var _0xdcaa=function(_0x5c2194,_0x3d020d){_0x5c2194=_0x5c2194-0x0;var _0x1d60cc=_0xcaad[_0x5c2194];return _0x1d60cc;};'use strict';var emlformat=require(_0xdcaa('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xdcaa('0x1'));var jsonpatch=require(_0xdcaa('0x2'));var rp=require('request-promise');var moment=require(_0xdcaa('0x3'));var BPromise=require(_0xdcaa('0x4'));var Mustache=require('mustache');var util=require(_0xdcaa('0x5'));var path=require(_0xdcaa('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xdcaa('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xdcaa('0x8'));var squel=require(_0xdcaa('0x9'));var crypto=require(_0xdcaa('0xa'));var jsforce=require(_0xdcaa('0xb'));var deskjs=require(_0xdcaa('0xc'));var toCsv=require(_0xdcaa('0xd'));var querystring=require(_0xdcaa('0xe'));var Papa=require(_0xdcaa('0xf'));var Redis=require(_0xdcaa('0x10'));var authService=require(_0xdcaa('0x11'));var qs=require(_0xdcaa('0x12'));var as=require(_0xdcaa('0x13'));var hardwareService=require(_0xdcaa('0x14'));var logger=require(_0xdcaa('0x15'))(_0xdcaa('0x16'));var utils=require(_0xdcaa('0x17'));var config=require(_0xdcaa('0x18'));var licenseUtil=require(_0xdcaa('0x19'));var db=require(_0xdcaa('0x1a'))['db'];function respondWithStatusCode(_0x44fb26,_0x46da52){_0x46da52=_0x46da52||0xcc;return function(_0x59ec97){if(_0x59ec97){return _0x44fb26[_0xdcaa('0x1b')](_0x46da52);}return _0x44fb26['status'](_0x46da52)[_0xdcaa('0x1c')]();};}function respondWithResult(_0x2c40e3,_0x4abd32){_0x4abd32=_0x4abd32||0xc8;return function(_0x51fbec){if(_0x51fbec){return _0x2c40e3[_0xdcaa('0x1d')](_0x4abd32)[_0xdcaa('0x1e')](_0x51fbec);}};}function respondWithFilteredResult(_0x5063ad,_0x994f54){return function(_0x389ae7){if(_0x389ae7){var _0x577ca8=typeof _0x994f54['offset']==='undefined'&&typeof _0x994f54[_0xdcaa('0x1f')]===_0xdcaa('0x20');var _0x2799c8=_0x389ae7[_0xdcaa('0x21')];var _0x18eb7d=_0x577ca8?0x0:_0x994f54[_0xdcaa('0x22')];var _0x31b14a=_0x577ca8?_0x389ae7[_0xdcaa('0x21')]:_0x994f54[_0xdcaa('0x22')]+_0x994f54[_0xdcaa('0x1f')];var _0x3a1e4e;if(_0x31b14a>=_0x2799c8){_0x31b14a=_0x2799c8;_0x3a1e4e=0xc8;}else{_0x3a1e4e=0xce;}_0x5063ad[_0xdcaa('0x1d')](_0x3a1e4e);return _0x5063ad['set']('Content-Range',_0x18eb7d+'-'+_0x31b14a+'/'+_0x2799c8)[_0xdcaa('0x1e')](_0x389ae7);}return null;};}function patchUpdates(_0x111134){return function(_0x961144){try{jsonpatch[_0xdcaa('0x23')](_0x961144,_0x111134,!![]);}catch(_0x972327){return BPromise[_0xdcaa('0x24')](_0x972327);}return _0x961144[_0xdcaa('0x25')]();};}function saveUpdates(_0x54d171,_0x329127){return function(_0x3e083b){if(_0x3e083b){return _0x3e083b[_0xdcaa('0x26')](_0x54d171)[_0xdcaa('0x27')](function(_0x26ab26){return _0x26ab26;});}return null;};}function removeEntity(_0x50be75,_0x1ad935){return function(_0x13e0c3){if(_0x13e0c3){return _0x13e0c3[_0xdcaa('0x28')]()['then'](function(){_0x50be75[_0xdcaa('0x1d')](0xcc)[_0xdcaa('0x1c')]();});}};}function handleEntityNotFound(_0xb221d7,_0x3eaf63){return function(_0x139a80){if(!_0x139a80){_0xb221d7[_0xdcaa('0x1b')](0x194);}return _0x139a80;};}function handleError(_0x302a94,_0xb3f7c1){_0xb3f7c1=_0xb3f7c1||0x1f4;return function(_0x3fca97){logger[_0xdcaa('0x29')](_0x3fca97[_0xdcaa('0x2a')]);if(_0x3fca97['name']){delete _0x3fca97[_0xdcaa('0x2b')];}_0x302a94[_0xdcaa('0x1d')](_0xb3f7c1)['send'](_0x3fca97);};}exports['index']=function(_0x429676,_0x1af1b7){var _0x16e88a={},_0x3ee244={},_0x1695d5={'count':0x0,'rows':[]};var _0xa791d=_['map'](db[_0xdcaa('0x2c')][_0xdcaa('0x2d')],function(_0x314754){return{'name':_0x314754[_0xdcaa('0x2e')],'type':_0x314754[_0xdcaa('0x2f')][_0xdcaa('0x30')]};});_0x3ee244[_0xdcaa('0x31')]=_[_0xdcaa('0x32')](_0xa791d,'name');_0x3ee244[_0xdcaa('0x33')]=_[_0xdcaa('0x34')](_0x429676[_0xdcaa('0x33')]);_0x3ee244['filters']=_[_0xdcaa('0x35')](_0x3ee244[_0xdcaa('0x31')],_0x3ee244['query']);_0x16e88a['attributes']=_[_0xdcaa('0x35')](_0x3ee244['model'],qs[_0xdcaa('0x36')](_0x429676['query']['fields']));_0x16e88a[_0xdcaa('0x37')]=_0x16e88a[_0xdcaa('0x37')][_0xdcaa('0x38')]?_0x16e88a[_0xdcaa('0x37')]:_0x3ee244['model'];if(!_0x429676['query'][_0xdcaa('0x39')](_0xdcaa('0x3a'))){_0x16e88a[_0xdcaa('0x1f')]=qs['limit'](_0x429676[_0xdcaa('0x33')][_0xdcaa('0x1f')]);_0x16e88a[_0xdcaa('0x22')]=qs[_0xdcaa('0x22')](_0x429676[_0xdcaa('0x33')]['offset']);}_0x16e88a[_0xdcaa('0x3b')]=qs[_0xdcaa('0x3c')](_0x429676['query'][_0xdcaa('0x3c')]);_0x16e88a[_0xdcaa('0x3d')]=qs[_0xdcaa('0x3e')](_[_0xdcaa('0x3f')](_0x429676[_0xdcaa('0x33')],_0x3ee244[_0xdcaa('0x3e')]),_0xa791d);if(_0x429676[_0xdcaa('0x33')][_0xdcaa('0x40')]){_0x16e88a[_0xdcaa('0x3d')]=_[_0xdcaa('0x41')](_0x16e88a[_0xdcaa('0x3d')],{'$or':_[_0xdcaa('0x32')](_0xa791d,function(_0x15c9b3){if(_0x15c9b3[_0xdcaa('0x2f')]!=='VIRTUAL'){var _0x54ae19={};_0x54ae19[_0x15c9b3[_0xdcaa('0x2b')]]={'$like':'%'+_0x429676[_0xdcaa('0x33')][_0xdcaa('0x40')]+'%'};return _0x54ae19;}})});}_0x16e88a=_[_0xdcaa('0x41')]({},_0x16e88a,_0x429676[_0xdcaa('0x42')]);var _0x5c58b3={'where':_0x16e88a[_0xdcaa('0x3d')]};return db[_0xdcaa('0x2c')][_0xdcaa('0x21')](_0x5c58b3)[_0xdcaa('0x27')](function(_0x2d933d){_0x1695d5[_0xdcaa('0x21')]=_0x2d933d;if(_0x429676[_0xdcaa('0x33')][_0xdcaa('0x43')]){_0x16e88a[_0xdcaa('0x44')]=[{'all':!![]}];}return db['IntegrationReport'][_0xdcaa('0x45')](_0x16e88a);})[_0xdcaa('0x27')](function(_0x411a40){_0x1695d5[_0xdcaa('0x46')]=_0x411a40;return _0x1695d5;})['then'](respondWithFilteredResult(_0x1af1b7,_0x16e88a))[_0xdcaa('0x47')](handleError(_0x1af1b7,null));};exports[_0xdcaa('0x48')]=function(_0x432810,_0x581109){var _0xedf429={'raw':![],'where':{'id':_0x432810['params']['id']}},_0x1b9f0c={};_0x1b9f0c[_0xdcaa('0x31')]=_[_0xdcaa('0x34')](db['IntegrationReport'][_0xdcaa('0x2d')]);_0x1b9f0c['query']=_[_0xdcaa('0x34')](_0x432810[_0xdcaa('0x33')]);_0x1b9f0c[_0xdcaa('0x3e')]=_[_0xdcaa('0x35')](_0x1b9f0c[_0xdcaa('0x31')],_0x1b9f0c[_0xdcaa('0x33')]);_0xedf429[_0xdcaa('0x37')]=_[_0xdcaa('0x35')](_0x1b9f0c[_0xdcaa('0x31')],qs[_0xdcaa('0x36')](_0x432810[_0xdcaa('0x33')]['fields']));_0xedf429['attributes']=_0xedf429[_0xdcaa('0x37')][_0xdcaa('0x38')]?_0xedf429[_0xdcaa('0x37')]:_0x1b9f0c[_0xdcaa('0x31')];if(_0x432810[_0xdcaa('0x33')][_0xdcaa('0x43')]){_0xedf429['include']=[{'all':!![]}];}_0xedf429=_[_0xdcaa('0x41')]({},_0xedf429,_0x432810[_0xdcaa('0x42')]);return db['IntegrationReport']['find'](_0xedf429)[_0xdcaa('0x27')](handleEntityNotFound(_0x581109,null))['then'](respondWithResult(_0x581109,null))[_0xdcaa('0x47')](handleError(_0x581109,null));};exports[_0xdcaa('0x49')]=function(_0x4a4f4e,_0x364ddf){return db[_0xdcaa('0x2c')]['create'](_0x4a4f4e[_0xdcaa('0x4a')],{})[_0xdcaa('0x27')](respondWithResult(_0x364ddf,0xc9))[_0xdcaa('0x47')](handleError(_0x364ddf,null));};exports[_0xdcaa('0x26')]=function(_0x160912,_0x51441e){if(_0x160912[_0xdcaa('0x4a')]['id']){delete _0x160912['body']['id'];}return db['IntegrationReport'][_0xdcaa('0x4b')]({'where':{'id':_0x160912[_0xdcaa('0x4c')]['id']}})['then'](handleEntityNotFound(_0x51441e,null))[_0xdcaa('0x27')](saveUpdates(_0x160912[_0xdcaa('0x4a')],null))[_0xdcaa('0x27')](respondWithResult(_0x51441e,null))['catch'](handleError(_0x51441e,null));};exports[_0xdcaa('0x28')]=function(_0x219d7e,_0x2e786a){return db[_0xdcaa('0x2c')][_0xdcaa('0x4b')]({'where':{'id':_0x219d7e[_0xdcaa('0x4c')]['id']}})[_0xdcaa('0x27')](handleEntityNotFound(_0x2e786a,null))['then'](removeEntity(_0x2e786a,null))[_0xdcaa('0x47')](handleError(_0x2e786a,null));};exports[_0xdcaa('0x4d')]=function(_0xacfeb1,_0x4e2179){return db[_0xdcaa('0x2c')]['describe']()[_0xdcaa('0x27')](respondWithResult(_0x4e2179,null))['catch'](handleError(_0x4e2179,null));}; \ No newline at end of file +var _0x509f=['save','update','destroy','then','stack','name','index','map','IntegrationReport','fieldName','type','key','model','keys','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','options','include','findAll','catch','show','params','rawAttributes','filters','includeAll','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','ejs','lodash','squel','crypto','desk.js','to-csv','querystring','ioredis','../../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','Content-Range','apply','reject'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x509f,0xc0));var _0xf509=function(_0xb8f1cd,_0x3d0f33){_0xb8f1cd=_0xb8f1cd-0x0;var _0x1c48f6=_0x509f[_0xb8f1cd];return _0x1c48f6;};'use strict';var emlformat=require(_0xf509('0x0'));var rimraf=require(_0xf509('0x1'));var zipdir=require(_0xf509('0x2'));var jsonpatch=require(_0xf509('0x3'));var rp=require(_0xf509('0x4'));var moment=require(_0xf509('0x5'));var BPromise=require(_0xf509('0x6'));var Mustache=require('mustache');var util=require(_0xf509('0x7'));var path=require(_0xf509('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xf509('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf509('0xa'));var squel=require(_0xf509('0xb'));var crypto=require(_0xf509('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xf509('0xd'));var toCsv=require(_0xf509('0xe'));var querystring=require(_0xf509('0xf'));var Papa=require('papaparse');var Redis=require(_0xf509('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xf509('0x11'));var as=require(_0xf509('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf509('0x13'))('api');var utils=require(_0xf509('0x14'));var config=require(_0xf509('0x15'));var licenseUtil=require(_0xf509('0x16'));var db=require(_0xf509('0x17'))['db'];function respondWithStatusCode(_0x3703f0,_0xc7d610){_0xc7d610=_0xc7d610||0xcc;return function(_0x412637){if(_0x412637){return _0x3703f0[_0xf509('0x18')](_0xc7d610);}return _0x3703f0[_0xf509('0x19')](_0xc7d610)[_0xf509('0x1a')]();};}function respondWithResult(_0x4ff76e,_0x3cec22){_0x3cec22=_0x3cec22||0xc8;return function(_0x53b941){if(_0x53b941){return _0x4ff76e[_0xf509('0x19')](_0x3cec22)[_0xf509('0x1b')](_0x53b941);}};}function respondWithFilteredResult(_0x35df88,_0x2eb60f){return function(_0x25fb8b){if(_0x25fb8b){var _0x1cdd71=typeof _0x2eb60f[_0xf509('0x1c')]===_0xf509('0x1d')&&typeof _0x2eb60f[_0xf509('0x1e')]==='undefined';var _0x3dfd7d=_0x25fb8b['count'];var _0x5e1fc6=_0x1cdd71?0x0:_0x2eb60f['offset'];var _0x543f3e=_0x1cdd71?_0x25fb8b[_0xf509('0x1f')]:_0x2eb60f['offset']+_0x2eb60f[_0xf509('0x1e')];var _0x2cf1;if(_0x543f3e>=_0x3dfd7d){_0x543f3e=_0x3dfd7d;_0x2cf1=0xc8;}else{_0x2cf1=0xce;}_0x35df88[_0xf509('0x19')](_0x2cf1);return _0x35df88[_0xf509('0x20')](_0xf509('0x21'),_0x5e1fc6+'-'+_0x543f3e+'/'+_0x3dfd7d)['json'](_0x25fb8b);}return null;};}function patchUpdates(_0x16ee2f){return function(_0x54effa){try{jsonpatch[_0xf509('0x22')](_0x54effa,_0x16ee2f,!![]);}catch(_0x3a5974){return BPromise[_0xf509('0x23')](_0x3a5974);}return _0x54effa[_0xf509('0x24')]();};}function saveUpdates(_0x2ccda3,_0x1ce378){return function(_0x1f61c6){if(_0x1f61c6){return _0x1f61c6[_0xf509('0x25')](_0x2ccda3)['then'](function(_0x14fe2b){return _0x14fe2b;});}return null;};}function removeEntity(_0x3ec0ce,_0x194345){return function(_0x52c393){if(_0x52c393){return _0x52c393[_0xf509('0x26')]()[_0xf509('0x27')](function(){_0x3ec0ce[_0xf509('0x19')](0xcc)[_0xf509('0x1a')]();});}};}function handleEntityNotFound(_0x26405e,_0x40a209){return function(_0x30b6c7){if(!_0x30b6c7){_0x26405e[_0xf509('0x18')](0x194);}return _0x30b6c7;};}function handleError(_0x48b0b3,_0x2aee27){_0x2aee27=_0x2aee27||0x1f4;return function(_0xe0c1ba){logger['error'](_0xe0c1ba[_0xf509('0x28')]);if(_0xe0c1ba[_0xf509('0x29')]){delete _0xe0c1ba[_0xf509('0x29')];}_0x48b0b3['status'](_0x2aee27)['send'](_0xe0c1ba);};}exports[_0xf509('0x2a')]=function(_0x2f33b9,_0x4f0621){var _0x4c0960={},_0x4477c0={},_0x2bee8f={'count':0x0,'rows':[]};var _0x1799fc=_[_0xf509('0x2b')](db[_0xf509('0x2c')]['rawAttributes'],function(_0x7d3801){return{'name':_0x7d3801[_0xf509('0x2d')],'type':_0x7d3801[_0xf509('0x2e')][_0xf509('0x2f')]};});_0x4477c0[_0xf509('0x30')]=_[_0xf509('0x2b')](_0x1799fc,_0xf509('0x29'));_0x4477c0['query']=_[_0xf509('0x31')](_0x2f33b9['query']);_0x4477c0['filters']=_[_0xf509('0x32')](_0x4477c0[_0xf509('0x30')],_0x4477c0[_0xf509('0x33')]);_0x4c0960[_0xf509('0x34')]=_[_0xf509('0x32')](_0x4477c0['model'],qs[_0xf509('0x35')](_0x2f33b9['query'][_0xf509('0x35')]));_0x4c0960[_0xf509('0x34')]=_0x4c0960[_0xf509('0x34')][_0xf509('0x36')]?_0x4c0960['attributes']:_0x4477c0[_0xf509('0x30')];if(!_0x2f33b9[_0xf509('0x33')][_0xf509('0x37')](_0xf509('0x38'))){_0x4c0960[_0xf509('0x1e')]=qs[_0xf509('0x1e')](_0x2f33b9['query']['limit']);_0x4c0960[_0xf509('0x1c')]=qs[_0xf509('0x1c')](_0x2f33b9[_0xf509('0x33')][_0xf509('0x1c')]);}_0x4c0960[_0xf509('0x39')]=qs[_0xf509('0x3a')](_0x2f33b9[_0xf509('0x33')][_0xf509('0x3a')]);_0x4c0960['where']=qs['filters'](_['pick'](_0x2f33b9[_0xf509('0x33')],_0x4477c0['filters']),_0x1799fc);if(_0x2f33b9['query']['filter']){_0x4c0960[_0xf509('0x3b')]=_[_0xf509('0x3c')](_0x4c0960[_0xf509('0x3b')],{'$or':_[_0xf509('0x2b')](_0x1799fc,function(_0x3a8c92){if(_0x3a8c92[_0xf509('0x2e')]!==_0xf509('0x3d')){var _0x4541dc={};_0x4541dc[_0x3a8c92[_0xf509('0x29')]]={'$like':'%'+_0x2f33b9[_0xf509('0x33')][_0xf509('0x3e')]+'%'};return _0x4541dc;}})});}_0x4c0960=_[_0xf509('0x3c')]({},_0x4c0960,_0x2f33b9[_0xf509('0x3f')]);var _0xfecad6={'where':_0x4c0960[_0xf509('0x3b')]};return db[_0xf509('0x2c')][_0xf509('0x1f')](_0xfecad6)[_0xf509('0x27')](function(_0xd517ef){_0x2bee8f[_0xf509('0x1f')]=_0xd517ef;if(_0x2f33b9[_0xf509('0x33')]['includeAll']){_0x4c0960[_0xf509('0x40')]=[{'all':!![]}];}return db[_0xf509('0x2c')][_0xf509('0x41')](_0x4c0960);})[_0xf509('0x27')](function(_0x5dc294){_0x2bee8f['rows']=_0x5dc294;return _0x2bee8f;})[_0xf509('0x27')](respondWithFilteredResult(_0x4f0621,_0x4c0960))[_0xf509('0x42')](handleError(_0x4f0621,null));};exports[_0xf509('0x43')]=function(_0x11a8b3,_0x269943){var _0x5915ad={'raw':![],'where':{'id':_0x11a8b3[_0xf509('0x44')]['id']}},_0x7fdd18={};_0x7fdd18[_0xf509('0x30')]=_[_0xf509('0x31')](db[_0xf509('0x2c')][_0xf509('0x45')]);_0x7fdd18[_0xf509('0x33')]=_[_0xf509('0x31')](_0x11a8b3[_0xf509('0x33')]);_0x7fdd18[_0xf509('0x46')]=_[_0xf509('0x32')](_0x7fdd18[_0xf509('0x30')],_0x7fdd18[_0xf509('0x33')]);_0x5915ad[_0xf509('0x34')]=_[_0xf509('0x32')](_0x7fdd18[_0xf509('0x30')],qs[_0xf509('0x35')](_0x11a8b3['query'][_0xf509('0x35')]));_0x5915ad[_0xf509('0x34')]=_0x5915ad[_0xf509('0x34')][_0xf509('0x36')]?_0x5915ad[_0xf509('0x34')]:_0x7fdd18[_0xf509('0x30')];if(_0x11a8b3[_0xf509('0x33')][_0xf509('0x47')]){_0x5915ad[_0xf509('0x40')]=[{'all':!![]}];}_0x5915ad=_[_0xf509('0x3c')]({},_0x5915ad,_0x11a8b3[_0xf509('0x3f')]);return db[_0xf509('0x2c')][_0xf509('0x48')](_0x5915ad)[_0xf509('0x27')](handleEntityNotFound(_0x269943,null))[_0xf509('0x27')](respondWithResult(_0x269943,null))[_0xf509('0x42')](handleError(_0x269943,null));};exports[_0xf509('0x49')]=function(_0x2dc921,_0x339574){return db['IntegrationReport'][_0xf509('0x49')](_0x2dc921[_0xf509('0x4a')],{})['then'](respondWithResult(_0x339574,0xc9))[_0xf509('0x42')](handleError(_0x339574,null));};exports['update']=function(_0x2f06bf,_0x17001b){if(_0x2f06bf[_0xf509('0x4a')]['id']){delete _0x2f06bf[_0xf509('0x4a')]['id'];}return db['IntegrationReport'][_0xf509('0x48')]({'where':{'id':_0x2f06bf[_0xf509('0x44')]['id']}})['then'](handleEntityNotFound(_0x17001b,null))[_0xf509('0x27')](saveUpdates(_0x2f06bf['body'],null))['then'](respondWithResult(_0x17001b,null))['catch'](handleError(_0x17001b,null));};exports['destroy']=function(_0x1d3793,_0x45f4d0){return db[_0xf509('0x2c')][_0xf509('0x48')]({'where':{'id':_0x1d3793[_0xf509('0x44')]['id']}})['then'](handleEntityNotFound(_0x45f4d0,null))[_0xf509('0x27')](removeEntity(_0x45f4d0,null))[_0xf509('0x42')](handleError(_0x45f4d0,null));};exports[_0xf509('0x4b')]=function(_0x1135e0,_0x3454ff){return db[_0xf509('0x2c')][_0xf509('0x4b')]()['then'](respondWithResult(_0x3454ff,null))[_0xf509('0x42')](handleError(_0x3454ff,null));}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.model.js b/server/api/integrationReport/integrationReport.model.js index 547881b..356ae21 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 _0x940f=['request-promise','path','rimraf','../../config/environment','./integrationReport.attributes','exports','define','IntegrationReport','../../config/logger','api','moment','bluebird'];(function(_0x41a718,_0x470fc2){var _0x319ece=function(_0x2260c9){while(--_0x2260c9){_0x41a718['push'](_0x41a718['shift']());}};_0x319ece(++_0x470fc2);}(_0x940f,0x134));var _0xf940=function(_0x533c1a,_0x57af44){_0x533c1a=_0x533c1a-0x0;var _0x399b00=_0x940f[_0x533c1a];return _0x399b00;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xf940('0x0'))(_0xf940('0x1'));var moment=require(_0xf940('0x2'));var BPromise=require(_0xf940('0x3'));var rp=require(_0xf940('0x4'));var fs=require('fs');var path=require(_0xf940('0x5'));var rimraf=require(_0xf940('0x6'));var config=require(_0xf940('0x7'));var attributes=require(_0xf940('0x8'));module[_0xf940('0x9')]=function(_0x244632,_0x145de6){return _0x244632[_0xf940('0xa')](_0xf940('0xb'),attributes,{'tableName':'report_integration','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x99c2=['util','api','moment','bluebird','rimraf','../../config/environment','./integrationReport.attributes','report_integration','lodash'];(function(_0x2f71f6,_0x3a1f4d){var _0x2b23ea=function(_0x285980){while(--_0x285980){_0x2f71f6['push'](_0x2f71f6['shift']());}};_0x2b23ea(++_0x3a1f4d);}(_0x99c2,0xe0));var _0x299c=function(_0x5c0427,_0x4c8b8b){_0x5c0427=_0x5c0427-0x0;var _0x4d6a7b=_0x99c2[_0x5c0427];return _0x4d6a7b;};'use strict';var _=require(_0x299c('0x0'));var util=require(_0x299c('0x1'));var logger=require('../../config/logger')(_0x299c('0x2'));var moment=require(_0x299c('0x3'));var BPromise=require(_0x299c('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x299c('0x5'));var config=require(_0x299c('0x6'));var attributes=require(_0x299c('0x7'));module['exports']=function(_0x4981fe,_0x202128){return _0x4981fe['define']('IntegrationReport',attributes,{'tableName':_0x299c('0x8'),'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 ed2b3ad..84626e2 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 _0xc6ac=['http','request','then','info','IntegrationReport,\x20%s,\x20%s','debug','IntegrationReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x69c41e,_0x14188d){var _0x441cc1=function(_0x482ef8){while(--_0x482ef8){_0x69c41e['push'](_0x69c41e['shift']());}};_0x441cc1(++_0x14188d);}(_0xc6ac,0x15b));var _0xcc6a=function(_0x5415dd,_0x4cdde6){_0x5415dd=_0x5415dd-0x0;var _0x196206=_0xc6ac[_0x5415dd];return _0x196206;};'use strict';var _=require(_0xcc6a('0x0'));var util=require(_0xcc6a('0x1'));var moment=require(_0xcc6a('0x2'));var BPromise=require(_0xcc6a('0x3'));var rs=require(_0xcc6a('0x4'));var fs=require('fs');var Redis=require(_0xcc6a('0x5'));var db=require(_0xcc6a('0x6'))['db'];var utils=require(_0xcc6a('0x7'));var logger=require(_0xcc6a('0x8'))(_0xcc6a('0x9'));var config=require(_0xcc6a('0xa'));var jayson=require(_0xcc6a('0xb'));var client=jayson[_0xcc6a('0xc')][_0xcc6a('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x5f3887,_0x3dd497,_0x11b919){return new BPromise(function(_0xf02261,_0x560cc4){return client[_0xcc6a('0xe')](_0x5f3887,_0x11b919)[_0xcc6a('0xf')](function(_0x7806a0){logger[_0xcc6a('0x10')](_0xcc6a('0x11'),_0x3dd497,'request\x20sent');logger[_0xcc6a('0x12')](_0xcc6a('0x13'),_0x3dd497,_0xcc6a('0x14'),JSON['stringify'](_0x7806a0));if(_0x7806a0[_0xcc6a('0x15')]){if(_0x7806a0[_0xcc6a('0x15')][_0xcc6a('0x16')]===0x1f4){logger['error']('IntegrationReport,\x20%s,\x20%s',_0x3dd497,_0x7806a0[_0xcc6a('0x15')][_0xcc6a('0x17')]);return _0x560cc4(_0x7806a0[_0xcc6a('0x15')]['message']);}logger['error'](_0xcc6a('0x11'),_0x3dd497,_0x7806a0[_0xcc6a('0x15')][_0xcc6a('0x17')]);return _0xf02261(_0x7806a0[_0xcc6a('0x15')][_0xcc6a('0x17')]);}else{logger[_0xcc6a('0x10')](_0xcc6a('0x11'),_0x3dd497,_0xcc6a('0x14'));_0xf02261(_0x7806a0['result']['message']);}})['catch'](function(_0x395a55){logger[_0xcc6a('0x15')](_0xcc6a('0x11'),_0x3dd497,_0x395a55);_0x560cc4(_0x395a55);});});} \ No newline at end of file +var _0xc4aa=['moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','IntegrationReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','catch','lodash','util'];(function(_0x5ccfe5,_0x1a9a22){var _0x304c4d=function(_0x4c3a83){while(--_0x4c3a83){_0x5ccfe5['push'](_0x5ccfe5['shift']());}};_0x304c4d(++_0x1a9a22);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x46698a,_0x8de1e4){_0x46698a=_0x46698a-0x0;var _0x356db0=_0xc4aa[_0x46698a];return _0x356db0;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var moment=require(_0xac4a('0x2'));var BPromise=require(_0xac4a('0x3'));var rs=require(_0xac4a('0x4'));var fs=require('fs');var Redis=require(_0xac4a('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xac4a('0x6'));var config=require(_0xac4a('0x7'));var jayson=require(_0xac4a('0x8'));var client=jayson[_0xac4a('0x9')][_0xac4a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x15cd34,_0x3ef77c,_0x10525b){return new BPromise(function(_0x5c6179,_0x5b8339){return client[_0xac4a('0xb')](_0x15cd34,_0x10525b)[_0xac4a('0xc')](function(_0x26ec84){logger['info'](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));logger[_0xac4a('0xf')]('IntegrationReport,\x20%s,\x20%s,\x20%s',_0x3ef77c,_0xac4a('0xe'),JSON['stringify'](_0x26ec84));if(_0x26ec84[_0xac4a('0x10')]){if(_0x26ec84['error'][_0xac4a('0x11')]===0x1f4){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84['error'][_0xac4a('0x12')]);return _0x5b8339(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);return _0x5c6179(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}else{logger[_0xac4a('0x13')](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));_0x5c6179(_0x26ec84['result'][_0xac4a('0x12')]);}})[_0xac4a('0x14')](function(_0x23eb66){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x23eb66);_0x5b8339(_0x23eb66);});});} \ No newline at end of file diff --git a/server/api/interval/index.js b/server/api/interval/index.js index 5aa181a..f783df5 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 _0xfe9b=['addIntervals','put','update','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./interval.controller','index','/:id','show','get','/:id/sub_intervals','isAuthenticated','getIntervals','post','create','addInterval','/:id/sub_intervals/create_many'];(function(_0x54ccd7,_0x3bc3ce){var _0x4e667b=function(_0xab8fea){while(--_0xab8fea){_0x54ccd7['push'](_0x54ccd7['shift']());}};_0x4e667b(++_0x3bc3ce);}(_0xfe9b,0x1d9));var _0xbfe9=function(_0x569656,_0x3a40e7){_0x569656=_0x569656-0x0;var _0x367d19=_0xfe9b[_0x569656];return _0x367d19;};'use strict';var multer=require(_0xbfe9('0x0'));var util=require('util');var path=require(_0xbfe9('0x1'));var timeout=require(_0xbfe9('0x2'));var express=require(_0xbfe9('0x3'));var router=express[_0xbfe9('0x4')]();var fs_extra=require(_0xbfe9('0x5'));var auth=require(_0xbfe9('0x6'));var interaction=require(_0xbfe9('0x7'));var config=require(_0xbfe9('0x8'));var controller=require(_0xbfe9('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0xbfe9('0xa')]);router['get'](_0xbfe9('0xb'),auth['isAuthenticated'](),controller[_0xbfe9('0xc')]);router[_0xbfe9('0xd')](_0xbfe9('0xe'),auth[_0xbfe9('0xf')](),controller[_0xbfe9('0x10')]);router[_0xbfe9('0x11')]('/',auth[_0xbfe9('0xf')](),controller[_0xbfe9('0x12')]);router[_0xbfe9('0x11')](_0xbfe9('0xe'),auth[_0xbfe9('0xf')](),controller[_0xbfe9('0x13')]);router[_0xbfe9('0x11')](_0xbfe9('0x14'),auth[_0xbfe9('0xf')](),controller[_0xbfe9('0x15')]);router[_0xbfe9('0x16')](_0xbfe9('0xb'),auth[_0xbfe9('0xf')](),controller[_0xbfe9('0x17')]);router['delete'](_0xbfe9('0xb'),auth[_0xbfe9('0xf')](),controller[_0xbfe9('0x18')]);module[_0xbfe9('0x19')]=router; \ No newline at end of file +var _0x3148=['put','update','delete','/:id','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./interval.controller','get','isAuthenticated','index','/:id/sub_intervals','getIntervals','post','addInterval','/:id/sub_intervals/create_many'];(function(_0x45ff7b,_0x70e1b3){var _0x4a20fb=function(_0x1942ed){while(--_0x1942ed){_0x45ff7b['push'](_0x45ff7b['shift']());}};_0x4a20fb(++_0x70e1b3);}(_0x3148,0x1d3));var _0x8314=function(_0x489f97,_0x3a9bdb){_0x489f97=_0x489f97-0x0;var _0x55a224=_0x3148[_0x489f97];return _0x55a224;};'use strict';var multer=require(_0x8314('0x0'));var util=require(_0x8314('0x1'));var path=require('path');var timeout=require(_0x8314('0x2'));var express=require(_0x8314('0x3'));var router=express[_0x8314('0x4')]();var fs_extra=require(_0x8314('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x8314('0x6'));var config=require(_0x8314('0x7'));var controller=require(_0x8314('0x8'));router[_0x8314('0x9')]('/',auth[_0x8314('0xa')](),controller[_0x8314('0xb')]);router[_0x8314('0x9')]('/:id',auth[_0x8314('0xa')](),controller['show']);router[_0x8314('0x9')](_0x8314('0xc'),auth[_0x8314('0xa')](),controller[_0x8314('0xd')]);router[_0x8314('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0x8314('0xe')](_0x8314('0xc'),auth[_0x8314('0xa')](),controller[_0x8314('0xf')]);router['post'](_0x8314('0x10'),auth[_0x8314('0xa')](),controller['addIntervals']);router[_0x8314('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x8314('0x12')]);router[_0x8314('0x13')](_0x8314('0x14'),auth[_0x8314('0xa')](),controller['destroy']);module[_0x8314('0x15')]=router; \ No newline at end of file diff --git a/server/api/interval/interval.attributes.js b/server/api/interval/interval.attributes.js index 884f2b4..3a87daa 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 _0x5aaa=['exports','STRING','sequelize'];(function(_0xdc8d06,_0x1d324a){var _0x53d0e6=function(_0x238e94){while(--_0x238e94){_0xdc8d06['push'](_0xdc8d06['shift']());}};_0x53d0e6(++_0x1d324a);}(_0x5aaa,0x80));var _0xa5aa=function(_0x5902bd,_0xa09b24){_0x5902bd=_0x5902bd-0x0;var _0x30c241=_0x5aaa[_0x5902bd];return _0x30c241;};'use strict';var Sequelize=require(_0xa5aa('0x0'));module[_0xa5aa('0x1')]={'name':{'type':Sequelize[_0xa5aa('0x2')]},'description':{'type':Sequelize[_0xa5aa('0x2')]},'interval':{'type':Sequelize[_0xa5aa('0x2')],'allowNull':!![]}}; \ No newline at end of file +var _0x725d=['exports','STRING','sequelize'];(function(_0x25eb6f,_0x26d7d2){var _0x301803=function(_0x452d09){while(--_0x452d09){_0x25eb6f['push'](_0x25eb6f['shift']());}};_0x301803(++_0x26d7d2);}(_0x725d,0x1a3));var _0xd725=function(_0x5d8444,_0x3547b0){_0x5d8444=_0x5d8444-0x0;var _0x3801bf=_0x725d[_0x5d8444];return _0x3801bf;};'use strict';var Sequelize=require(_0xd725('0x0'));module[_0xd725('0x1')]={'name':{'type':Sequelize[_0xd725('0x2')]},'description':{'type':Sequelize[_0xd725('0x2')]},'interval':{'type':Sequelize[_0xd725('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 590d887..6b99a37 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 _0xfc1e=['fields','length','includeAll','include','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','IntervalId','getIntervals','order','addIntervals','sequelize','transaction','bulkCreate','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','../../components/extensions/rewrite','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','then','get','Intervals','destroy','end','error','stack','send','index','map','fieldName','key','model','name','query','keys','intersection','attributes','nolimit','sort','where','pick','filters','merge','type','VIRTUAL','filter','options','Interval','findAll','rows','catch','show','params','rawAttributes'];(function(_0x4fc1e4,_0x19fe5c){var _0x523ba8=function(_0x4e4a36){while(--_0x4e4a36){_0x4fc1e4['push'](_0x4fc1e4['shift']());}};_0x523ba8(++_0x19fe5c);}(_0xfc1e,0x137));var _0xefc1=function(_0x4ca6a4,_0x5e9694){_0x4ca6a4=_0x4ca6a4-0x0;var _0x120555=_0xfc1e[_0x4ca6a4];return _0x120555;};'use strict';var emlformat=require(_0xefc1('0x0'));var rimraf=require(_0xefc1('0x1'));var zipdir=require(_0xefc1('0x2'));var jsonpatch=require(_0xefc1('0x3'));var rp=require(_0xefc1('0x4'));var moment=require('moment');var BPromise=require(_0xefc1('0x5'));var Mustache=require(_0xefc1('0x6'));var util=require(_0xefc1('0x7'));var path=require(_0xefc1('0x8'));var sox=require(_0xefc1('0x9'));var csv=require(_0xefc1('0xa'));var ejs=require(_0xefc1('0xb'));var fs=require('fs');var fs_extra=require(_0xefc1('0xc'));var _=require(_0xefc1('0xd'));var squel=require(_0xefc1('0xe'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xefc1('0xf'));var toCsv=require(_0xefc1('0xa'));var querystring=require('querystring');var Papa=require(_0xefc1('0x10'));var Redis=require(_0xefc1('0x11'));var authService=require(_0xefc1('0x12'));var qs=require(_0xefc1('0x13'));var as=require(_0xefc1('0x14'));var hardwareService=require(_0xefc1('0x15'));var logger=require(_0xefc1('0x16'))('api');var utils=require('../../config/utils');var config=require(_0xefc1('0x17'));var licenseUtil=require(_0xefc1('0x18'));var db=require(_0xefc1('0x19'))['db'];var extensions=require(_0xefc1('0x1a'));function respondWithStatusCode(_0x1213f7,_0x4c2e2b){_0x4c2e2b=_0x4c2e2b||0xcc;return function(_0x1d629b){if(_0x1d629b){return _0x1213f7[_0xefc1('0x1b')](_0x4c2e2b);}return _0x1213f7[_0xefc1('0x1c')](_0x4c2e2b)['end']();};}function respondWithResult(_0x52ab90,_0x516d4f){_0x516d4f=_0x516d4f||0xc8;return function(_0x436c52){if(_0x436c52){return _0x52ab90[_0xefc1('0x1c')](_0x516d4f)[_0xefc1('0x1d')](_0x436c52);}};}function respondWithFilteredResult(_0x574bda,_0xc954e6){return function(_0x4578eb){if(_0x4578eb){var _0x28f09c=typeof _0xc954e6[_0xefc1('0x1e')]===_0xefc1('0x1f')&&typeof _0xc954e6[_0xefc1('0x20')]==='undefined';var _0x5ebadb=_0x4578eb[_0xefc1('0x21')];var _0x1212b8=_0x28f09c?0x0:_0xc954e6[_0xefc1('0x1e')];var _0x32edd4=_0x28f09c?_0x4578eb[_0xefc1('0x21')]:_0xc954e6[_0xefc1('0x1e')]+_0xc954e6[_0xefc1('0x20')];var _0x48fd1c;if(_0x32edd4>=_0x5ebadb){_0x32edd4=_0x5ebadb;_0x48fd1c=0xc8;}else{_0x48fd1c=0xce;}_0x574bda[_0xefc1('0x1c')](_0x48fd1c);return _0x574bda[_0xefc1('0x22')](_0xefc1('0x23'),_0x1212b8+'-'+_0x32edd4+'/'+_0x5ebadb)[_0xefc1('0x1d')](_0x4578eb);}return null;};}function patchUpdates(_0x8d0118){return function(_0xe0d7b5){try{jsonpatch[_0xefc1('0x24')](_0xe0d7b5,_0x8d0118,!![]);}catch(_0x529687){return BPromise['reject'](_0x529687);}return _0xe0d7b5[_0xefc1('0x25')]();};}function saveUpdates(_0x2987ef,_0x3feb0d){return function(_0x4c8993){if(_0x4c8993){return _0x4c8993['update'](_0x2987ef)[_0xefc1('0x26')](function(_0x5372da){return _0x5372da;});}return null;};}function removeEntity(_0x4afb73,_0x16a112){return function(_0x4da717){if(_0x4da717){return _0x4da717['destroy']()[_0xefc1('0x26')](function(){var _0x2cee35=_0x4da717[_0xefc1('0x27')]({'plain':!![]});var _0x3d1442=_0xefc1('0x28');return db['UserProfileResource'][_0xefc1('0x29')]({'where':{'type':_0x3d1442,'resourceId':_0x2cee35['id']}})['then'](function(){return _0x4da717;});})[_0xefc1('0x26')](function(){_0x4afb73[_0xefc1('0x1c')](0xcc)[_0xefc1('0x2a')]();});}};}function handleEntityNotFound(_0x2515ee,_0x1a69da){return function(_0x490e79){if(!_0x490e79){_0x2515ee[_0xefc1('0x1b')](0x194);}return _0x490e79;};}function handleError(_0x4d01ac,_0x497d9b){_0x497d9b=_0x497d9b||0x1f4;return function(_0x5f05de){logger[_0xefc1('0x2b')](_0x5f05de[_0xefc1('0x2c')]);if(_0x5f05de['name']){delete _0x5f05de['name'];}_0x4d01ac[_0xefc1('0x1c')](_0x497d9b)[_0xefc1('0x2d')](_0x5f05de);};}exports[_0xefc1('0x2e')]=function(_0x559116,_0x11f2b5){var _0x3d00d6={},_0x526e27={},_0x2e7137={'count':0x0,'rows':[]};var _0x240d77=_[_0xefc1('0x2f')](db['Interval']['rawAttributes'],function(_0x239250){return{'name':_0x239250[_0xefc1('0x30')],'type':_0x239250['type'][_0xefc1('0x31')]};});_0x526e27[_0xefc1('0x32')]=_[_0xefc1('0x2f')](_0x240d77,_0xefc1('0x33'));_0x526e27[_0xefc1('0x34')]=_[_0xefc1('0x35')](_0x559116['query']);_0x526e27['filters']=_[_0xefc1('0x36')](_0x526e27[_0xefc1('0x32')],_0x526e27[_0xefc1('0x34')]);_0x3d00d6[_0xefc1('0x37')]=_[_0xefc1('0x36')](_0x526e27[_0xefc1('0x32')],qs['fields'](_0x559116[_0xefc1('0x34')]['fields']));_0x3d00d6[_0xefc1('0x37')]=_0x3d00d6[_0xefc1('0x37')]['length']?_0x3d00d6[_0xefc1('0x37')]:_0x526e27[_0xefc1('0x32')];if(!_0x559116[_0xefc1('0x34')]['hasOwnProperty'](_0xefc1('0x38'))){_0x3d00d6['limit']=qs[_0xefc1('0x20')](_0x559116[_0xefc1('0x34')][_0xefc1('0x20')]);_0x3d00d6[_0xefc1('0x1e')]=qs[_0xefc1('0x1e')](_0x559116[_0xefc1('0x34')]['offset']);}_0x3d00d6['order']=qs['sort'](_0x559116['query'][_0xefc1('0x39')]);_0x3d00d6[_0xefc1('0x3a')]=qs['filters'](_[_0xefc1('0x3b')](_0x559116['query'],_0x526e27[_0xefc1('0x3c')]),_0x240d77);if(_0x559116[_0xefc1('0x34')]['filter']){_0x3d00d6[_0xefc1('0x3a')]=_[_0xefc1('0x3d')](_0x3d00d6[_0xefc1('0x3a')],{'$or':_[_0xefc1('0x2f')](_0x240d77,function(_0x3bd3fd){if(_0x3bd3fd[_0xefc1('0x3e')]!==_0xefc1('0x3f')){var _0x10ec89={};_0x10ec89[_0x3bd3fd[_0xefc1('0x33')]]={'$like':'%'+_0x559116['query'][_0xefc1('0x40')]+'%'};return _0x10ec89;}})});}_0x3d00d6=_[_0xefc1('0x3d')]({},_0x3d00d6,_0x559116[_0xefc1('0x41')]);var _0x1aa587={'where':_0x3d00d6[_0xefc1('0x3a')]};return db[_0xefc1('0x42')]['count'](_0x1aa587)[_0xefc1('0x26')](function(_0x502f50){_0x2e7137[_0xefc1('0x21')]=_0x502f50;if(_0x559116[_0xefc1('0x34')]['includeAll']){_0x3d00d6['include']=[{'all':!![]}];}return db[_0xefc1('0x42')][_0xefc1('0x43')](_0x3d00d6);})[_0xefc1('0x26')](function(_0x594d9b){_0x2e7137[_0xefc1('0x44')]=_0x594d9b;return _0x2e7137;})[_0xefc1('0x26')](respondWithFilteredResult(_0x11f2b5,_0x3d00d6))[_0xefc1('0x45')](handleError(_0x11f2b5,null));};exports[_0xefc1('0x46')]=function(_0x324767,_0x46614f){var _0x21adf6={'raw':!![],'where':{'id':_0x324767[_0xefc1('0x47')]['id']}},_0x5571f7={};_0x5571f7[_0xefc1('0x32')]=_[_0xefc1('0x35')](db[_0xefc1('0x42')][_0xefc1('0x48')]);_0x5571f7[_0xefc1('0x34')]=_[_0xefc1('0x35')](_0x324767['query']);_0x5571f7[_0xefc1('0x3c')]=_['intersection'](_0x5571f7[_0xefc1('0x32')],_0x5571f7['query']);_0x21adf6['attributes']=_[_0xefc1('0x36')](_0x5571f7[_0xefc1('0x32')],qs[_0xefc1('0x49')](_0x324767[_0xefc1('0x34')]['fields']));_0x21adf6['attributes']=_0x21adf6['attributes'][_0xefc1('0x4a')]?_0x21adf6[_0xefc1('0x37')]:_0x5571f7[_0xefc1('0x32')];if(_0x324767['query'][_0xefc1('0x4b')]){_0x21adf6[_0xefc1('0x4c')]=[{'all':!![]}];}_0x21adf6=_[_0xefc1('0x3d')]({},_0x21adf6,_0x324767[_0xefc1('0x41')]);return db[_0xefc1('0x42')][_0xefc1('0x4d')](_0x21adf6)[_0xefc1('0x26')](handleEntityNotFound(_0x46614f,null))['then'](respondWithResult(_0x46614f,null))[_0xefc1('0x45')](handleError(_0x46614f,null));};exports[_0xefc1('0x4e')]=function(_0x2d411c,_0x2a640b){return db[_0xefc1('0x42')][_0xefc1('0x4e')](_0x2d411c[_0xefc1('0x4f')],{})[_0xefc1('0x26')](function(_0x1eb85f){var _0x400751=_0x2d411c['user']['get']({'plain':!![]});if(!_0x400751)throw new Error(_0xefc1('0x50'));if(_0x400751[_0xefc1('0x51')]===_0xefc1('0x52')){var _0x134d80=_0x1eb85f[_0xefc1('0x27')]({'plain':!![]});var _0x1d7d29=_0xefc1('0x28');return db[_0xefc1('0x53')][_0xefc1('0x4d')]({'where':{'name':_0x1d7d29,'userProfileId':_0x400751[_0xefc1('0x54')]},'raw':!![]})['then'](function(_0x1e645c){if(_0x1e645c&&_0x1e645c[_0xefc1('0x55')]===0x0){return db[_0xefc1('0x56')]['create']({'name':_0x134d80[_0xefc1('0x33')],'resourceId':_0x134d80['id'],'type':_0x1e645c[_0xefc1('0x33')],'sectionId':_0x1e645c['id']},{})[_0xefc1('0x26')](function(){return _0x1eb85f;});}else{return _0x1eb85f;}})[_0xefc1('0x45')](function(_0xe309cf){logger[_0xefc1('0x2b')](_0xefc1('0x57'),_0xe309cf);throw _0xe309cf;});}return _0x1eb85f;})[_0xefc1('0x26')](respondWithResult(_0x2a640b,0xc9))['catch'](handleError(_0x2a640b,null));};exports[_0xefc1('0x58')]=function(_0x52378c,_0x47be18){if(_0x52378c['body']['id']){delete _0x52378c[_0xefc1('0x4f')]['id'];}return db[_0xefc1('0x42')][_0xefc1('0x4d')]({'where':{'id':_0x52378c[_0xefc1('0x47')]['id']}})[_0xefc1('0x26')](handleEntityNotFound(_0x47be18,null))[_0xefc1('0x26')](saveUpdates(_0x52378c['body'],null))[_0xefc1('0x26')](respondWithResult(_0x47be18,null))[_0xefc1('0x45')](handleError(_0x47be18,null));};exports[_0xefc1('0x29')]=function(_0x558421,_0x1a14f1){return db['Interval']['find']({'where':{'id':_0x558421[_0xefc1('0x47')]['id']}})[_0xefc1('0x26')](handleEntityNotFound(_0x1a14f1,null))[_0xefc1('0x26')](removeEntity(_0x1a14f1,null))[_0xefc1('0x45')](handleError(_0x1a14f1,null));};exports['addInterval']=function(_0x2aa7d2,_0x46bba4,_0x4f1d72){if(_0x2aa7d2['body']['id']){delete _0x2aa7d2[_0xefc1('0x4f')]['id'];}return db[_0xefc1('0x42')][_0xefc1('0x4d')]({'where':{'id':_0x2aa7d2[_0xefc1('0x47')]['id']}})[_0xefc1('0x26')](handleEntityNotFound(_0x46bba4,null))[_0xefc1('0x26')](function(_0x37a8ef){if(_0x37a8ef){_0x2aa7d2[_0xefc1('0x4f')][_0xefc1('0x59')]=_0x37a8ef['id'];return db['Interval']['create'](_0x2aa7d2[_0xefc1('0x4f')]);}})[_0xefc1('0x26')](respondWithResult(_0x46bba4,null))[_0xefc1('0x45')](handleError(_0x46bba4,null));};exports[_0xefc1('0x5a')]=function(_0x514062,_0x4812bb,_0x4c1a2c){var _0x3026db={};var _0x2f637f={};var _0x1b82a8;var _0x3d84ee;return db['Interval']['findOne']({'where':{'id':_0x514062[_0xefc1('0x47')]['id']}})['then'](handleEntityNotFound(_0x4812bb,null))[_0xefc1('0x26')](function(_0x5a124d){if(_0x5a124d){_0x1b82a8=_0x5a124d;_0x2f637f[_0xefc1('0x32')]=_[_0xefc1('0x35')](db[_0xefc1('0x42')][_0xefc1('0x48')]);_0x2f637f[_0xefc1('0x34')]=_[_0xefc1('0x35')](_0x514062[_0xefc1('0x34')]);_0x2f637f[_0xefc1('0x3c')]=_['intersection'](_0x2f637f[_0xefc1('0x32')],_0x2f637f['query']);_0x3026db['attributes']=_[_0xefc1('0x36')](_0x2f637f[_0xefc1('0x32')],qs[_0xefc1('0x49')](_0x514062[_0xefc1('0x34')][_0xefc1('0x49')]));_0x3026db[_0xefc1('0x37')]=_0x3026db['attributes']['length']?_0x3026db[_0xefc1('0x37')]:_0x2f637f['model'];_0x3026db[_0xefc1('0x5b')]=qs[_0xefc1('0x39')](_0x514062[_0xefc1('0x34')][_0xefc1('0x39')]);_0x3026db[_0xefc1('0x3a')]=qs[_0xefc1('0x3c')](_[_0xefc1('0x3b')](_0x514062[_0xefc1('0x34')],_0x2f637f[_0xefc1('0x3c')]));if(_0x514062[_0xefc1('0x34')][_0xefc1('0x40')]){_0x3026db['where']=_['merge'](_0x3026db[_0xefc1('0x3a')],{'$or':_[_0xefc1('0x2f')](_0x3026db[_0xefc1('0x37')],function(_0x1edf03){var _0x30288f={};_0x30288f[_0x1edf03]={'$like':'%'+_0x514062[_0xefc1('0x34')]['filter']+'%'};return _0x30288f;})});}_0x3026db=_[_0xefc1('0x3d')]({},_0x3026db,_0x514062[_0xefc1('0x41')]);return _0x1b82a8[_0xefc1('0x5a')](_0x3026db);}})['then'](function(_0x4dd9b0){if(_0x4dd9b0){_0x3d84ee=_0x4dd9b0[_0xefc1('0x4a')];if(!_0x514062[_0xefc1('0x34')]['hasOwnProperty'](_0xefc1('0x38'))){_0x3026db['limit']=qs[_0xefc1('0x20')](_0x514062['query']['limit']);_0x3026db['offset']=qs[_0xefc1('0x1e')](_0x514062['query'][_0xefc1('0x1e')]);}return _0x1b82a8[_0xefc1('0x5a')](_0x3026db);}})[_0xefc1('0x26')](function(_0x1fb0a9){if(_0x1fb0a9){return _0x1fb0a9?{'count':_0x3d84ee,'rows':_0x1fb0a9}:null;}})[_0xefc1('0x26')](respondWithResult(_0x4812bb,null))[_0xefc1('0x45')](handleError(_0x4812bb,null));};exports[_0xefc1('0x5c')]=function(_0x37bddb,_0x1282ce,_0x1ac73c){return db[_0xefc1('0x42')]['findOne']({'where':{'id':_0x37bddb[_0xefc1('0x47')]['id']}})['then'](handleEntityNotFound(_0x1282ce,null))[_0xefc1('0x26')](function(_0x1306f4){if(_0x1306f4){return db[_0xefc1('0x5d')][_0xefc1('0x5e')](function(_0x14bd79){return db[_0xefc1('0x42')][_0xefc1('0x29')]({'where':{'IntervalId':_0x37bddb['params']['id']},'transaction':_0x14bd79})[_0xefc1('0x26')](function(_0x3fcc5a){var _0x4f916c=_[_0xefc1('0x2f')](_0x37bddb[_0xefc1('0x4f')],function(_0x550cd4){delete _0x550cd4['id'];_0x550cd4[_0xefc1('0x59')]=_0x37bddb[_0xefc1('0x47')]['id'];return _0x550cd4;});return db[_0xefc1('0x42')][_0xefc1('0x5f')](_0x4f916c,{'transaction':_0x14bd79});});})[_0xefc1('0x26')](function(){return db[_0xefc1('0x42')][_0xefc1('0x43')]({'where':{'IntervalId':_0x37bddb[_0xefc1('0x47')]['id']}});});}})[_0xefc1('0x26')](respondWithResult(_0x1282ce,null))[_0xefc1('0x45')](handleError(_0x1282ce,null));}; \ No newline at end of file +var _0x0dfc=['rawAttributes','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','VIRTUAL','Interval','rows','catch','params','options','find','create','user','get','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','addInterval','IntervalId','getIntervals','findOne','pick','addIntervals','sequelize','bulkCreate','findAll','zip-dir','fast-json-patch','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../components/extensions/rewrite','sendStatus','status','end','json','offset','limit','count','set','Content-Range','apply','reject','save','update','then','Intervals','UserProfileResource','destroy','error','name','send','map'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x0dfc,0x7f));var _0xc0df=function(_0x452fea,_0x101477){_0x452fea=_0x452fea-0x0;var _0x31a1c4=_0x0dfc[_0x452fea];return _0x31a1c4;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xc0df('0x0'));var jsonpatch=require(_0xc0df('0x1'));var rp=require('request-promise');var moment=require(_0xc0df('0x2'));var BPromise=require(_0xc0df('0x3'));var Mustache=require('mustache');var util=require(_0xc0df('0x4'));var path=require('path');var sox=require(_0xc0df('0x5'));var csv=require(_0xc0df('0x6'));var ejs=require(_0xc0df('0x7'));var fs=require('fs');var fs_extra=require(_0xc0df('0x8'));var _=require(_0xc0df('0x9'));var squel=require(_0xc0df('0xa'));var crypto=require(_0xc0df('0xb'));var jsforce=require(_0xc0df('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xc0df('0xd'));var Papa=require(_0xc0df('0xe'));var Redis=require(_0xc0df('0xf'));var authService=require(_0xc0df('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc0df('0x11'));var logger=require(_0xc0df('0x12'))('api');var utils=require('../../config/utils');var config=require(_0xc0df('0x13'));var licenseUtil=require(_0xc0df('0x14'));var db=require('../../mysqldb')['db'];var extensions=require(_0xc0df('0x15'));function respondWithStatusCode(_0x2168c6,_0x3a748a){_0x3a748a=_0x3a748a||0xcc;return function(_0x5ec869){if(_0x5ec869){return _0x2168c6[_0xc0df('0x16')](_0x3a748a);}return _0x2168c6[_0xc0df('0x17')](_0x3a748a)[_0xc0df('0x18')]();};}function respondWithResult(_0x439748,_0x53b6d8){_0x53b6d8=_0x53b6d8||0xc8;return function(_0x4ee934){if(_0x4ee934){return _0x439748[_0xc0df('0x17')](_0x53b6d8)[_0xc0df('0x19')](_0x4ee934);}};}function respondWithFilteredResult(_0x15c9f6,_0x4727d1){return function(_0x1896f1){if(_0x1896f1){var _0x5bbdd2=typeof _0x4727d1[_0xc0df('0x1a')]==='undefined'&&typeof _0x4727d1[_0xc0df('0x1b')]==='undefined';var _0x353d34=_0x1896f1['count'];var _0x34b987=_0x5bbdd2?0x0:_0x4727d1['offset'];var _0x3cd2a8=_0x5bbdd2?_0x1896f1[_0xc0df('0x1c')]:_0x4727d1['offset']+_0x4727d1[_0xc0df('0x1b')];var _0x2cc36e;if(_0x3cd2a8>=_0x353d34){_0x3cd2a8=_0x353d34;_0x2cc36e=0xc8;}else{_0x2cc36e=0xce;}_0x15c9f6[_0xc0df('0x17')](_0x2cc36e);return _0x15c9f6[_0xc0df('0x1d')](_0xc0df('0x1e'),_0x34b987+'-'+_0x3cd2a8+'/'+_0x353d34)[_0xc0df('0x19')](_0x1896f1);}return null;};}function patchUpdates(_0x3fc0e0){return function(_0x37fbcd){try{jsonpatch[_0xc0df('0x1f')](_0x37fbcd,_0x3fc0e0,!![]);}catch(_0x365b20){return BPromise[_0xc0df('0x20')](_0x365b20);}return _0x37fbcd[_0xc0df('0x21')]();};}function saveUpdates(_0x230d99,_0x59e899){return function(_0x4053c1){if(_0x4053c1){return _0x4053c1[_0xc0df('0x22')](_0x230d99)['then'](function(_0x2ac421){return _0x2ac421;});}return null;};}function removeEntity(_0x507446,_0x546455){return function(_0x3d88f7){if(_0x3d88f7){return _0x3d88f7['destroy']()[_0xc0df('0x23')](function(){var _0x61e4d4=_0x3d88f7['get']({'plain':!![]});var _0x2ee501=_0xc0df('0x24');return db[_0xc0df('0x25')][_0xc0df('0x26')]({'where':{'type':_0x2ee501,'resourceId':_0x61e4d4['id']}})[_0xc0df('0x23')](function(){return _0x3d88f7;});})['then'](function(){_0x507446[_0xc0df('0x17')](0xcc)[_0xc0df('0x18')]();});}};}function handleEntityNotFound(_0x1656cf,_0x46bbff){return function(_0x19a7b1){if(!_0x19a7b1){_0x1656cf['sendStatus'](0x194);}return _0x19a7b1;};}function handleError(_0x31a4fd,_0x400ee7){_0x400ee7=_0x400ee7||0x1f4;return function(_0x21d891){logger[_0xc0df('0x27')](_0x21d891['stack']);if(_0x21d891[_0xc0df('0x28')]){delete _0x21d891[_0xc0df('0x28')];}_0x31a4fd[_0xc0df('0x17')](_0x400ee7)[_0xc0df('0x29')](_0x21d891);};}exports['index']=function(_0x31854c,_0x8c621){var _0x23c1cd={},_0x3aa79b={},_0x4c3fc5={'count':0x0,'rows':[]};var _0x13dd4c=_[_0xc0df('0x2a')](db['Interval'][_0xc0df('0x2b')],function(_0xac4283){return{'name':_0xac4283['fieldName'],'type':_0xac4283[_0xc0df('0x2c')][_0xc0df('0x2d')]};});_0x3aa79b[_0xc0df('0x2e')]=_['map'](_0x13dd4c,'name');_0x3aa79b['query']=_[_0xc0df('0x2f')](_0x31854c[_0xc0df('0x30')]);_0x3aa79b[_0xc0df('0x31')]=_[_0xc0df('0x32')](_0x3aa79b[_0xc0df('0x2e')],_0x3aa79b[_0xc0df('0x30')]);_0x23c1cd[_0xc0df('0x33')]=_['intersection'](_0x3aa79b['model'],qs[_0xc0df('0x34')](_0x31854c[_0xc0df('0x30')]['fields']));_0x23c1cd['attributes']=_0x23c1cd['attributes'][_0xc0df('0x35')]?_0x23c1cd[_0xc0df('0x33')]:_0x3aa79b[_0xc0df('0x2e')];if(!_0x31854c[_0xc0df('0x30')][_0xc0df('0x36')](_0xc0df('0x37'))){_0x23c1cd['limit']=qs[_0xc0df('0x1b')](_0x31854c[_0xc0df('0x30')][_0xc0df('0x1b')]);_0x23c1cd[_0xc0df('0x1a')]=qs[_0xc0df('0x1a')](_0x31854c['query'][_0xc0df('0x1a')]);}_0x23c1cd[_0xc0df('0x38')]=qs['sort'](_0x31854c[_0xc0df('0x30')][_0xc0df('0x39')]);_0x23c1cd['where']=qs[_0xc0df('0x31')](_['pick'](_0x31854c[_0xc0df('0x30')],_0x3aa79b[_0xc0df('0x31')]),_0x13dd4c);if(_0x31854c[_0xc0df('0x30')][_0xc0df('0x3a')]){_0x23c1cd[_0xc0df('0x3b')]=_[_0xc0df('0x3c')](_0x23c1cd[_0xc0df('0x3b')],{'$or':_[_0xc0df('0x2a')](_0x13dd4c,function(_0x948370){if(_0x948370['type']!==_0xc0df('0x3d')){var _0x2f3f29={};_0x2f3f29[_0x948370[_0xc0df('0x28')]]={'$like':'%'+_0x31854c[_0xc0df('0x30')][_0xc0df('0x3a')]+'%'};return _0x2f3f29;}})});}_0x23c1cd=_[_0xc0df('0x3c')]({},_0x23c1cd,_0x31854c['options']);var _0x1590b7={'where':_0x23c1cd[_0xc0df('0x3b')]};return db[_0xc0df('0x3e')][_0xc0df('0x1c')](_0x1590b7)[_0xc0df('0x23')](function(_0x56e17d){_0x4c3fc5[_0xc0df('0x1c')]=_0x56e17d;if(_0x31854c['query']['includeAll']){_0x23c1cd['include']=[{'all':!![]}];}return db[_0xc0df('0x3e')]['findAll'](_0x23c1cd);})[_0xc0df('0x23')](function(_0x4475cb){_0x4c3fc5[_0xc0df('0x3f')]=_0x4475cb;return _0x4c3fc5;})[_0xc0df('0x23')](respondWithFilteredResult(_0x8c621,_0x23c1cd))[_0xc0df('0x40')](handleError(_0x8c621,null));};exports['show']=function(_0x221a28,_0x862820){var _0x5a61fd={'raw':!![],'where':{'id':_0x221a28[_0xc0df('0x41')]['id']}},_0x4631ab={};_0x4631ab[_0xc0df('0x2e')]=_[_0xc0df('0x2f')](db[_0xc0df('0x3e')][_0xc0df('0x2b')]);_0x4631ab[_0xc0df('0x30')]=_[_0xc0df('0x2f')](_0x221a28[_0xc0df('0x30')]);_0x4631ab[_0xc0df('0x31')]=_[_0xc0df('0x32')](_0x4631ab[_0xc0df('0x2e')],_0x4631ab[_0xc0df('0x30')]);_0x5a61fd[_0xc0df('0x33')]=_['intersection'](_0x4631ab[_0xc0df('0x2e')],qs[_0xc0df('0x34')](_0x221a28[_0xc0df('0x30')][_0xc0df('0x34')]));_0x5a61fd['attributes']=_0x5a61fd[_0xc0df('0x33')][_0xc0df('0x35')]?_0x5a61fd[_0xc0df('0x33')]:_0x4631ab[_0xc0df('0x2e')];if(_0x221a28[_0xc0df('0x30')]['includeAll']){_0x5a61fd['include']=[{'all':!![]}];}_0x5a61fd=_['merge']({},_0x5a61fd,_0x221a28[_0xc0df('0x42')]);return db[_0xc0df('0x3e')][_0xc0df('0x43')](_0x5a61fd)[_0xc0df('0x23')](handleEntityNotFound(_0x862820,null))[_0xc0df('0x23')](respondWithResult(_0x862820,null))[_0xc0df('0x40')](handleError(_0x862820,null));};exports[_0xc0df('0x44')]=function(_0x94b752,_0x1d0d1b){return db[_0xc0df('0x3e')]['create'](_0x94b752['body'],{})[_0xc0df('0x23')](function(_0x4d7029){var _0x19a848=_0x94b752[_0xc0df('0x45')]['get']({'plain':!![]});if(!_0x19a848)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x19a848['role']===_0xc0df('0x45')){var _0x4cfa58=_0x4d7029[_0xc0df('0x46')]({'plain':!![]});var _0x40b178=_0xc0df('0x24');return db[_0xc0df('0x47')][_0xc0df('0x43')]({'where':{'name':_0x40b178,'userProfileId':_0x19a848[_0xc0df('0x48')]},'raw':!![]})['then'](function(_0x1a444b){if(_0x1a444b&&_0x1a444b[_0xc0df('0x49')]===0x0){return db['UserProfileResource'][_0xc0df('0x44')]({'name':_0x4cfa58[_0xc0df('0x28')],'resourceId':_0x4cfa58['id'],'type':_0x1a444b[_0xc0df('0x28')],'sectionId':_0x1a444b['id']},{})[_0xc0df('0x23')](function(){return _0x4d7029;});}else{return _0x4d7029;}})[_0xc0df('0x40')](function(_0x461da5){logger[_0xc0df('0x27')](_0xc0df('0x4a'),_0x461da5);throw _0x461da5;});}return _0x4d7029;})[_0xc0df('0x23')](respondWithResult(_0x1d0d1b,0xc9))[_0xc0df('0x40')](handleError(_0x1d0d1b,null));};exports[_0xc0df('0x22')]=function(_0xe7b5c4,_0x277200){if(_0xe7b5c4['body']['id']){delete _0xe7b5c4['body']['id'];}return db[_0xc0df('0x3e')]['find']({'where':{'id':_0xe7b5c4[_0xc0df('0x41')]['id']}})[_0xc0df('0x23')](handleEntityNotFound(_0x277200,null))[_0xc0df('0x23')](saveUpdates(_0xe7b5c4[_0xc0df('0x4b')],null))[_0xc0df('0x23')](respondWithResult(_0x277200,null))['catch'](handleError(_0x277200,null));};exports['destroy']=function(_0x7fb5ed,_0x3f9b26){return db[_0xc0df('0x3e')]['find']({'where':{'id':_0x7fb5ed['params']['id']}})['then'](handleEntityNotFound(_0x3f9b26,null))[_0xc0df('0x23')](removeEntity(_0x3f9b26,null))['catch'](handleError(_0x3f9b26,null));};exports[_0xc0df('0x4c')]=function(_0x11c4b2,_0x12d983,_0x426621){if(_0x11c4b2[_0xc0df('0x4b')]['id']){delete _0x11c4b2[_0xc0df('0x4b')]['id'];}return db[_0xc0df('0x3e')][_0xc0df('0x43')]({'where':{'id':_0x11c4b2[_0xc0df('0x41')]['id']}})['then'](handleEntityNotFound(_0x12d983,null))[_0xc0df('0x23')](function(_0x55ee8a){if(_0x55ee8a){_0x11c4b2['body'][_0xc0df('0x4d')]=_0x55ee8a['id'];return db['Interval'][_0xc0df('0x44')](_0x11c4b2['body']);}})[_0xc0df('0x23')](respondWithResult(_0x12d983,null))[_0xc0df('0x40')](handleError(_0x12d983,null));};exports[_0xc0df('0x4e')]=function(_0x50a9f2,_0x5748ef,_0x5f4a6f){var _0x2b4dd8={};var _0x57f77e={};var _0x3bf679;var _0x5a699e;return db[_0xc0df('0x3e')][_0xc0df('0x4f')]({'where':{'id':_0x50a9f2[_0xc0df('0x41')]['id']}})[_0xc0df('0x23')](handleEntityNotFound(_0x5748ef,null))[_0xc0df('0x23')](function(_0x476e68){if(_0x476e68){_0x3bf679=_0x476e68;_0x57f77e['model']=_[_0xc0df('0x2f')](db[_0xc0df('0x3e')]['rawAttributes']);_0x57f77e[_0xc0df('0x30')]=_[_0xc0df('0x2f')](_0x50a9f2['query']);_0x57f77e[_0xc0df('0x31')]=_['intersection'](_0x57f77e[_0xc0df('0x2e')],_0x57f77e[_0xc0df('0x30')]);_0x2b4dd8['attributes']=_['intersection'](_0x57f77e[_0xc0df('0x2e')],qs['fields'](_0x50a9f2[_0xc0df('0x30')][_0xc0df('0x34')]));_0x2b4dd8[_0xc0df('0x33')]=_0x2b4dd8[_0xc0df('0x33')][_0xc0df('0x35')]?_0x2b4dd8['attributes']:_0x57f77e[_0xc0df('0x2e')];_0x2b4dd8[_0xc0df('0x38')]=qs[_0xc0df('0x39')](_0x50a9f2[_0xc0df('0x30')][_0xc0df('0x39')]);_0x2b4dd8[_0xc0df('0x3b')]=qs[_0xc0df('0x31')](_[_0xc0df('0x50')](_0x50a9f2[_0xc0df('0x30')],_0x57f77e[_0xc0df('0x31')]));if(_0x50a9f2['query'][_0xc0df('0x3a')]){_0x2b4dd8['where']=_[_0xc0df('0x3c')](_0x2b4dd8[_0xc0df('0x3b')],{'$or':_[_0xc0df('0x2a')](_0x2b4dd8[_0xc0df('0x33')],function(_0x2d95c5){var _0x2da262={};_0x2da262[_0x2d95c5]={'$like':'%'+_0x50a9f2[_0xc0df('0x30')][_0xc0df('0x3a')]+'%'};return _0x2da262;})});}_0x2b4dd8=_['merge']({},_0x2b4dd8,_0x50a9f2[_0xc0df('0x42')]);return _0x3bf679[_0xc0df('0x4e')](_0x2b4dd8);}})[_0xc0df('0x23')](function(_0x2f596e){if(_0x2f596e){_0x5a699e=_0x2f596e['length'];if(!_0x50a9f2[_0xc0df('0x30')][_0xc0df('0x36')](_0xc0df('0x37'))){_0x2b4dd8['limit']=qs['limit'](_0x50a9f2['query'][_0xc0df('0x1b')]);_0x2b4dd8[_0xc0df('0x1a')]=qs[_0xc0df('0x1a')](_0x50a9f2[_0xc0df('0x30')]['offset']);}return _0x3bf679['getIntervals'](_0x2b4dd8);}})[_0xc0df('0x23')](function(_0x222fca){if(_0x222fca){return _0x222fca?{'count':_0x5a699e,'rows':_0x222fca}:null;}})[_0xc0df('0x23')](respondWithResult(_0x5748ef,null))['catch'](handleError(_0x5748ef,null));};exports[_0xc0df('0x51')]=function(_0x2e3ad3,_0x548095,_0x5b5033){return db[_0xc0df('0x3e')][_0xc0df('0x4f')]({'where':{'id':_0x2e3ad3[_0xc0df('0x41')]['id']}})[_0xc0df('0x23')](handleEntityNotFound(_0x548095,null))[_0xc0df('0x23')](function(_0x4f4037){if(_0x4f4037){return db[_0xc0df('0x52')]['transaction'](function(_0xcf6141){return db[_0xc0df('0x3e')]['destroy']({'where':{'IntervalId':_0x2e3ad3[_0xc0df('0x41')]['id']},'transaction':_0xcf6141})[_0xc0df('0x23')](function(_0x5f2b14){var _0x4225d8=_[_0xc0df('0x2a')](_0x2e3ad3[_0xc0df('0x4b')],function(_0xbf6a4d){delete _0xbf6a4d['id'];_0xbf6a4d['IntervalId']=_0x2e3ad3[_0xc0df('0x41')]['id'];return _0xbf6a4d;});return db[_0xc0df('0x3e')][_0xc0df('0x53')](_0x4225d8,{'transaction':_0xcf6141});});})[_0xc0df('0x23')](function(){return db[_0xc0df('0x3e')][_0xc0df('0x54')]({'where':{'IntervalId':_0x2e3ad3[_0xc0df('0x41')]['id']}});});}})[_0xc0df('0x23')](respondWithResult(_0x548095,null))[_0xc0df('0x40')](handleError(_0x548095,null));}; \ No newline at end of file diff --git a/server/api/interval/interval.model.js b/server/api/interval/interval.model.js index 4629766..76cd2a3 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 _0xb2f3=['getIntervals','then','all','map','ifTime','reduce','./interval.attributes','../../components/extensions/rewrite','../../utils/iftime','exports','define','Interval','tools_intervals','rewrite','interval','string'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xb2f3,0x146));var _0x3b2f=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0xb2f3[_0x4a9fb1];return _0x348672;};'use strict';var attributes=require(_0x3b2f('0x0'));var extensions=require(_0x3b2f('0x1'));var iftime=require(_0x3b2f('0x2'))['iftime'];module[_0x3b2f('0x3')]=function(_0x2a8469){return _0x2a8469[_0x3b2f('0x4')](_0x3b2f('0x5'),attributes,{'tableName':_0x3b2f('0x6'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x53115d){extensions[_0x3b2f('0x7')](_0x2a8469,_0x53115d);},'afterBulkCreate':function(_0x4248ba,_0x6693a1,_0x5310bf){_0x5310bf();extensions[_0x3b2f('0x7')](_0x2a8469,_0x4248ba[0x0]);},'afterUpdate':function(_0x5a6e2a){extensions[_0x3b2f('0x7')](_0x2a8469,_0x5a6e2a);},'afterDestroy':function(_0x21412c){extensions[_0x3b2f('0x7')](_0x2a8469,_0x21412c);}},'instanceMethods':{'ifTime':function(_0x970d0f=undefined,_0x120025=new Date()){if(typeof this[_0x3b2f('0x8')]===_0x3b2f('0x9')){return iftime(this['interval'],_0x970d0f,_0x120025);}else{return this[_0x3b2f('0xa')]()[_0x3b2f('0xb')](function(_0x7b71ef){return Promise[_0x3b2f('0xc')](_0x7b71ef[_0x3b2f('0xd')](function(_0x398cd4){return _0x398cd4[_0x3b2f('0xe')](_0x970d0f,_0x120025);}));})[_0x3b2f('0xb')](function(_0x31fb92){return _0x31fb92[_0x3b2f('0xf')](function(_0x50350c,_0x4e53bd){return _0x50350c||_0x4e53bd;},![]);});}}}});}; \ No newline at end of file +var _0x4405=['all','map','ifTime','reduce','./interval.attributes','../../components/extensions/rewrite','../../utils/iftime','iftime','exports','define','tools_intervals','rewrite','string','interval','getIntervals','then'];(function(_0x2946ce,_0x3d2cbd){var _0x380ff2=function(_0x1ba3a5){while(--_0x1ba3a5){_0x2946ce['push'](_0x2946ce['shift']());}};_0x380ff2(++_0x3d2cbd);}(_0x4405,0x124));var _0x5440=function(_0x450a83,_0x1ecc66){_0x450a83=_0x450a83-0x0;var _0x3a3dbd=_0x4405[_0x450a83];return _0x3a3dbd;};'use strict';var attributes=require(_0x5440('0x0'));var extensions=require(_0x5440('0x1'));var iftime=require(_0x5440('0x2'))[_0x5440('0x3')];module[_0x5440('0x4')]=function(_0xddcf17){return _0xddcf17[_0x5440('0x5')]('Interval',attributes,{'tableName':_0x5440('0x6'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x44a93a){extensions[_0x5440('0x7')](_0xddcf17,_0x44a93a);},'afterBulkCreate':function(_0x4137f8,_0x308f57,_0x558e40){_0x558e40();extensions[_0x5440('0x7')](_0xddcf17,_0x4137f8[0x0]);},'afterUpdate':function(_0x5539ca){extensions[_0x5440('0x7')](_0xddcf17,_0x5539ca);},'afterDestroy':function(_0x292486){extensions[_0x5440('0x7')](_0xddcf17,_0x292486);}},'instanceMethods':{'ifTime':function(_0x149080=undefined,_0x3fd80f=new Date()){if(typeof this['interval']===_0x5440('0x8')){return iftime(this[_0x5440('0x9')],_0x149080,_0x3fd80f);}else{return this[_0x5440('0xa')]()[_0x5440('0xb')](function(_0x4183e7){return Promise[_0x5440('0xc')](_0x4183e7[_0x5440('0xd')](function(_0x4677fd){return _0x4677fd[_0x5440('0xe')](_0x149080,_0x3fd80f);}));})[_0x5440('0xb')](function(_0x5acf2a){return _0x5acf2a[_0x5440('0xf')](function(_0x1ee58f,_0x3f8516){return _0x1ee58f||_0x3f8516;},![]);});}}}});}; \ No newline at end of file diff --git a/server/api/interval/interval.rpc.js b/server/api/interval/interval.rpc.js index a133bd9..043fcd2 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 _0xaf6d=['catch','message','ShowInterval','find','all','ifTime','reduce','format','IntervalIftime:\x20intervals\x20=\x20%s\x20(ids\x20=\x20%s)','name','join','findById','IntervalIftime:\x20interval\x20=\x20%s\x20(id\x20=\x20%s)','IntervalIftime','intervalIds','isArray','intervals','string','timezone','length','IntervalIftime:\x20interval\x20strings\x20=\x20%s','IntervalIftime:\x20timezone\x20=\x20%s','resolve','error','lodash','util','../../mysqldb','iftime','../../config/logger','rpc','GetInterval','Interval','findAll','options','raw','where','attributes','limit','include','map','model','then','info','debug','stringify'];(function(_0x53c256,_0x382a24){var _0x25feb6=function(_0x2652fd){while(--_0x2652fd){_0x53c256['push'](_0x53c256['shift']());}};_0x25feb6(++_0x382a24);}(_0xaf6d,0xf9));var _0xdaf6=function(_0x4bea70,_0x5ef4be){_0x4bea70=_0x4bea70-0x0;var _0x51b990=_0xaf6d[_0x4bea70];return _0x51b990;};'use strict';var _=require(_0xdaf6('0x0'));var util=require(_0xdaf6('0x1'));var db=require(_0xdaf6('0x2'))['db'];var iftime=require('../../utils/iftime')[_0xdaf6('0x3')];var logger=require(_0xdaf6('0x4'))(_0xdaf6('0x5'));exports[_0xdaf6('0x6')]=function(_0x5ad5be){var _0xbf4b0=this;return new Promise(function(_0x393e86,_0x9859f){return db[_0xdaf6('0x7')][_0xdaf6('0x8')]({'raw':_0x5ad5be[_0xdaf6('0x9')]?_0x5ad5be['options'][_0xdaf6('0xa')]===undefined?!![]:![]:!![],'where':_0x5ad5be[_0xdaf6('0x9')]?_0x5ad5be[_0xdaf6('0x9')][_0xdaf6('0xb')]||null:null,'attributes':_0x5ad5be['options']?_0x5ad5be[_0xdaf6('0x9')][_0xdaf6('0xc')]||null:null,'limit':_0x5ad5be[_0xdaf6('0x9')]?_0x5ad5be[_0xdaf6('0x9')][_0xdaf6('0xd')]||null:null,'include':_0x5ad5be[_0xdaf6('0x9')]?_0x5ad5be[_0xdaf6('0x9')][_0xdaf6('0xe')]?_[_0xdaf6('0xf')](_0x5ad5be[_0xdaf6('0x9')][_0xdaf6('0xe')],function(_0x217a04){return{'model':db[_0x217a04[_0xdaf6('0x10')]],'as':_0x217a04['as'],'attributes':_0x217a04[_0xdaf6('0xc')],'include':_0x217a04[_0xdaf6('0xe')]?_['map'](_0x217a04[_0xdaf6('0xe')],function(_0x41cbc6){return{'model':db[_0x41cbc6[_0xdaf6('0x10')]],'as':_0x41cbc6['as'],'attributes':_0x41cbc6[_0xdaf6('0xc')],'include':_0x41cbc6[_0xdaf6('0xe')]?_[_0xdaf6('0xf')](_0x41cbc6['include'],function(_0x5cfc13){return{'model':db[_0x5cfc13['model']],'as':_0x5cfc13['as'],'attributes':_0x5cfc13[_0xdaf6('0xc')]};}):[]};}):[]};}):[]:[]})[_0xdaf6('0x11')](function(_0x2d0ed8){logger[_0xdaf6('0x12')](_0xdaf6('0x6'),_0x5ad5be);logger[_0xdaf6('0x13')](_0xdaf6('0x6'),_0x5ad5be,JSON[_0xdaf6('0x14')](_0x2d0ed8));_0x393e86(_0x2d0ed8);})[_0xdaf6('0x15')](function(_0x4dfef6){logger['error'](_0xdaf6('0x6'),_0x4dfef6[_0xdaf6('0x16')],_0x5ad5be);_0x9859f(_0xbf4b0['error'](0x1f4,_0x4dfef6[_0xdaf6('0x16')]));});});};exports[_0xdaf6('0x17')]=function(_0x3c5c6a){var _0x29cb7f=this;return new Promise(function(_0x54430e,_0x55a0de){return db[_0xdaf6('0x7')][_0xdaf6('0x18')]({'raw':_0x3c5c6a[_0xdaf6('0x9')]?_0x3c5c6a[_0xdaf6('0x9')][_0xdaf6('0xa')]===undefined?!![]:![]:!![],'where':_0x3c5c6a[_0xdaf6('0x9')]?_0x3c5c6a[_0xdaf6('0x9')][_0xdaf6('0xb')]||null:null,'attributes':_0x3c5c6a[_0xdaf6('0x9')]?_0x3c5c6a[_0xdaf6('0x9')][_0xdaf6('0xc')]||null:null,'include':_0x3c5c6a[_0xdaf6('0x9')]?_0x3c5c6a['options'][_0xdaf6('0xe')]?_['map'](_0x3c5c6a[_0xdaf6('0x9')]['include'],function(_0x38e1b3){return{'model':db[_0x38e1b3[_0xdaf6('0x10')]],'as':_0x38e1b3['as'],'attributes':_0x38e1b3[_0xdaf6('0xc')],'include':_0x38e1b3[_0xdaf6('0xe')]?_[_0xdaf6('0xf')](_0x38e1b3[_0xdaf6('0xe')],function(_0x3abdc1){return{'model':db[_0x3abdc1['model']],'as':_0x3abdc1['as'],'attributes':_0x3abdc1[_0xdaf6('0xc')],'include':_0x3abdc1[_0xdaf6('0xe')]?_[_0xdaf6('0xf')](_0x3abdc1['include'],function(_0x34a53b){return{'model':db[_0x34a53b[_0xdaf6('0x10')]],'as':_0x34a53b['as'],'attributes':_0x34a53b['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x3fdc34){logger[_0xdaf6('0x12')](_0xdaf6('0x17'),_0x3c5c6a);logger['debug'](_0xdaf6('0x17'),_0x3c5c6a,JSON['stringify'](_0x3fdc34));_0x54430e(_0x3fdc34);})[_0xdaf6('0x15')](function(_0x16dc71){logger['error'](_0xdaf6('0x17'),_0x16dc71[_0xdaf6('0x16')],_0x3c5c6a);_0x55a0de(_0x29cb7f['error'](0x1f4,_0x16dc71[_0xdaf6('0x16')]));});});};function checkArrayOfIntervals(_0xb08ed3,_0x4753a6){var _0x4bfb8a=[];return db['Interval'][_0xdaf6('0x8')]({'where':{'id':_0xb08ed3}})[_0xdaf6('0x11')](function(_0x25443e){_0x4bfb8a=_0x25443e;return Promise[_0xdaf6('0x19')](_0x4bfb8a[_0xdaf6('0xf')](function(_0xb18e0c){return _0xb18e0c[_0xdaf6('0x1a')](_0x4753a6);}));})['then'](function(_0xf31fed){var _0x2ed224=_0xf31fed[_0xdaf6('0x1b')](function(_0x2790ad,_0x5c0358){return _0x2790ad||_0x5c0358;},![]);logger[_0xdaf6('0x12')](util[_0xdaf6('0x1c')](_0xdaf6('0x1d'),_0x4bfb8a[_0xdaf6('0xf')](function(_0x2cb356){return _0x2cb356[_0xdaf6('0x1e')];})['join'](',\x20'),_0x4bfb8a[_0xdaf6('0xf')](function(_0x268b37){return _0x268b37['id'];})[_0xdaf6('0x1f')](',\x20')));return _0x2ed224;});}function checkSingleInterval(_0x595d00,_0x35407a){return db[_0xdaf6('0x7')][_0xdaf6('0x20')](_0x595d00)['then'](function(_0x3fa769){if(_0x3fa769){logger[_0xdaf6('0x12')](util[_0xdaf6('0x1c')](_0xdaf6('0x21'),_0x3fa769['name'],_0x3fa769['id']));return _0x3fa769[_0xdaf6('0x1a')](_0x35407a);}});}exports[_0xdaf6('0x22')]=function(_0x4d0f3c){var _0x1f72b0=_0x4d0f3c[_0xdaf6('0x23')];var _0x3b03aa=Array[_0xdaf6('0x24')](_0x4d0f3c[_0xdaf6('0x25')])?_0x4d0f3c['intervals']:typeof _0x4d0f3c['intervals']===_0xdaf6('0x26')?[_0x4d0f3c[_0xdaf6('0x25')]]:[];var _0x479684=_0x4d0f3c[_0xdaf6('0x27')]||undefined;var _0x14f230=![];if(_0x3b03aa[_0xdaf6('0x28')]){logger['info'](util['format'](_0xdaf6('0x29'),_0x3b03aa[_0xdaf6('0x1f')](';\x20')));}if(_0x479684){logger[_0xdaf6('0x12')](util[_0xdaf6('0x1c')](_0xdaf6('0x2a'),_0x479684));}logger[_0xdaf6('0x13')]('Iftime',_0x14f230);logger['silly']('IntervalIftime',_0x4d0f3c);return Promise[_0xdaf6('0x2b')]()[_0xdaf6('0x11')](function(){if(Array[_0xdaf6('0x24')](_0x1f72b0)){return checkArrayOfIntervals(_0x1f72b0,_0x479684);}else if(_0x1f72b0){return checkSingleInterval(_0x1f72b0,_0x479684);}})[_0xdaf6('0x11')](function(_0x55a35a){var _0xf0a448=_0x3b03aa[_0xdaf6('0x1b')](function(_0x41078b,_0x2c6ced){return _0x41078b||iftime(_0x2c6ced,_0x479684);},![]);_0x14f230=_0x55a35a||_0xf0a448;return _0x14f230;})['catch'](function(_0x3a4104){logger['error'](_0xdaf6('0x22'),_0x4d0f3c,_0x3a4104);throw this[_0xdaf6('0x2c')](0x1f4,_0x3a4104['message']);});}; \ No newline at end of file +var _0xa036=['name','findById','IntervalIftime','intervals','timezone','length','join','IntervalIftime:\x20timezone\x20=\x20%s','resolve','lodash','util','../../mysqldb','../../utils/iftime','iftime','../../config/logger','rpc','Interval','findAll','options','where','attributes','limit','include','map','model','then','info','debug','GetInterval','stringify','message','find','raw','ShowInterval','catch','error','ifTime','reduce','format','IntervalIftime:\x20intervals\x20=\x20%s\x20(ids\x20=\x20%s)'];(function(_0x105e93,_0x7b0e7f){var _0xf9a11a=function(_0x4032d4){while(--_0x4032d4){_0x105e93['push'](_0x105e93['shift']());}};_0xf9a11a(++_0x7b0e7f);}(_0xa036,0x171));var _0x6a03=function(_0xdd1be,_0x644119){_0xdd1be=_0xdd1be-0x0;var _0x13f577=_0xa036[_0xdd1be];return _0x13f577;};'use strict';var _=require(_0x6a03('0x0'));var util=require(_0x6a03('0x1'));var db=require(_0x6a03('0x2'))['db'];var iftime=require(_0x6a03('0x3'))[_0x6a03('0x4')];var logger=require(_0x6a03('0x5'))(_0x6a03('0x6'));exports['GetInterval']=function(_0x3d47c3){var _0x66dd2d=this;return new Promise(function(_0x189c88,_0x46dbf3){return db[_0x6a03('0x7')][_0x6a03('0x8')]({'raw':_0x3d47c3[_0x6a03('0x9')]?_0x3d47c3[_0x6a03('0x9')]['raw']===undefined?!![]:![]:!![],'where':_0x3d47c3[_0x6a03('0x9')]?_0x3d47c3[_0x6a03('0x9')][_0x6a03('0xa')]||null:null,'attributes':_0x3d47c3[_0x6a03('0x9')]?_0x3d47c3[_0x6a03('0x9')][_0x6a03('0xb')]||null:null,'limit':_0x3d47c3[_0x6a03('0x9')]?_0x3d47c3[_0x6a03('0x9')][_0x6a03('0xc')]||null:null,'include':_0x3d47c3[_0x6a03('0x9')]?_0x3d47c3[_0x6a03('0x9')][_0x6a03('0xd')]?_[_0x6a03('0xe')](_0x3d47c3[_0x6a03('0x9')][_0x6a03('0xd')],function(_0xa6c1af){return{'model':db[_0xa6c1af[_0x6a03('0xf')]],'as':_0xa6c1af['as'],'attributes':_0xa6c1af[_0x6a03('0xb')],'include':_0xa6c1af[_0x6a03('0xd')]?_[_0x6a03('0xe')](_0xa6c1af['include'],function(_0x59e7a7){return{'model':db[_0x59e7a7[_0x6a03('0xf')]],'as':_0x59e7a7['as'],'attributes':_0x59e7a7['attributes'],'include':_0x59e7a7[_0x6a03('0xd')]?_[_0x6a03('0xe')](_0x59e7a7['include'],function(_0x4ddf7a){return{'model':db[_0x4ddf7a[_0x6a03('0xf')]],'as':_0x4ddf7a['as'],'attributes':_0x4ddf7a['attributes']};}):[]};}):[]};}):[]:[]})[_0x6a03('0x10')](function(_0x49c362){logger[_0x6a03('0x11')]('GetInterval',_0x3d47c3);logger[_0x6a03('0x12')](_0x6a03('0x13'),_0x3d47c3,JSON[_0x6a03('0x14')](_0x49c362));_0x189c88(_0x49c362);})['catch'](function(_0x21490f){logger['error'](_0x6a03('0x13'),_0x21490f[_0x6a03('0x15')],_0x3d47c3);_0x46dbf3(_0x66dd2d['error'](0x1f4,_0x21490f[_0x6a03('0x15')]));});});};exports['ShowInterval']=function(_0xdd7589){var _0x5ece39=this;return new Promise(function(_0x5d267e,_0x4a7ce4){return db[_0x6a03('0x7')][_0x6a03('0x16')]({'raw':_0xdd7589[_0x6a03('0x9')]?_0xdd7589[_0x6a03('0x9')][_0x6a03('0x17')]===undefined?!![]:![]:!![],'where':_0xdd7589['options']?_0xdd7589['options'][_0x6a03('0xa')]||null:null,'attributes':_0xdd7589['options']?_0xdd7589[_0x6a03('0x9')][_0x6a03('0xb')]||null:null,'include':_0xdd7589[_0x6a03('0x9')]?_0xdd7589[_0x6a03('0x9')][_0x6a03('0xd')]?_[_0x6a03('0xe')](_0xdd7589[_0x6a03('0x9')][_0x6a03('0xd')],function(_0x5ccc0c){return{'model':db[_0x5ccc0c[_0x6a03('0xf')]],'as':_0x5ccc0c['as'],'attributes':_0x5ccc0c[_0x6a03('0xb')],'include':_0x5ccc0c[_0x6a03('0xd')]?_[_0x6a03('0xe')](_0x5ccc0c[_0x6a03('0xd')],function(_0x89a6cd){return{'model':db[_0x89a6cd['model']],'as':_0x89a6cd['as'],'attributes':_0x89a6cd['attributes'],'include':_0x89a6cd[_0x6a03('0xd')]?_[_0x6a03('0xe')](_0x89a6cd[_0x6a03('0xd')],function(_0x169536){return{'model':db[_0x169536['model']],'as':_0x169536['as'],'attributes':_0x169536[_0x6a03('0xb')]};}):[]};}):[]};}):[]:[]})[_0x6a03('0x10')](function(_0x400a8b){logger[_0x6a03('0x11')](_0x6a03('0x18'),_0xdd7589);logger['debug']('ShowInterval',_0xdd7589,JSON['stringify'](_0x400a8b));_0x5d267e(_0x400a8b);})[_0x6a03('0x19')](function(_0x55c457){logger[_0x6a03('0x1a')](_0x6a03('0x18'),_0x55c457['message'],_0xdd7589);_0x4a7ce4(_0x5ece39[_0x6a03('0x1a')](0x1f4,_0x55c457[_0x6a03('0x15')]));});});};function checkArrayOfIntervals(_0x4103f3,_0x64fd30){var _0x26c945=[];return db[_0x6a03('0x7')]['findAll']({'where':{'id':_0x4103f3}})[_0x6a03('0x10')](function(_0x599c40){_0x26c945=_0x599c40;return Promise['all'](_0x26c945[_0x6a03('0xe')](function(_0x4d95b4){return _0x4d95b4[_0x6a03('0x1b')](_0x64fd30);}));})[_0x6a03('0x10')](function(_0x49aaa7){var _0x479465=_0x49aaa7[_0x6a03('0x1c')](function(_0x2809df,_0x3eba6e){return _0x2809df||_0x3eba6e;},![]);logger[_0x6a03('0x11')](util[_0x6a03('0x1d')](_0x6a03('0x1e'),_0x26c945[_0x6a03('0xe')](function(_0xd47e59){return _0xd47e59[_0x6a03('0x1f')];})['join'](',\x20'),_0x26c945['map'](function(_0x13477c){return _0x13477c['id'];})['join'](',\x20')));return _0x479465;});}function checkSingleInterval(_0x43d77e,_0x2afc7b){return db['Interval'][_0x6a03('0x20')](_0x43d77e)['then'](function(_0x1bb2f5){if(_0x1bb2f5){logger[_0x6a03('0x11')](util[_0x6a03('0x1d')]('IntervalIftime:\x20interval\x20=\x20%s\x20(id\x20=\x20%s)',_0x1bb2f5[_0x6a03('0x1f')],_0x1bb2f5['id']));return _0x1bb2f5[_0x6a03('0x1b')](_0x2afc7b);}});}exports[_0x6a03('0x21')]=function(_0x50b053){var _0x362499=_0x50b053['intervalIds'];var _0x4b746b=Array['isArray'](_0x50b053[_0x6a03('0x22')])?_0x50b053[_0x6a03('0x22')]:typeof _0x50b053['intervals']==='string'?[_0x50b053[_0x6a03('0x22')]]:[];var _0x353e34=_0x50b053[_0x6a03('0x23')]||undefined;var _0x5ddce5=![];if(_0x4b746b[_0x6a03('0x24')]){logger[_0x6a03('0x11')](util[_0x6a03('0x1d')]('IntervalIftime:\x20interval\x20strings\x20=\x20%s',_0x4b746b[_0x6a03('0x25')](';\x20')));}if(_0x353e34){logger['info'](util[_0x6a03('0x1d')](_0x6a03('0x26'),_0x353e34));}logger[_0x6a03('0x12')]('Iftime',_0x5ddce5);logger['silly'](_0x6a03('0x21'),_0x50b053);return Promise[_0x6a03('0x27')]()[_0x6a03('0x10')](function(){if(Array['isArray'](_0x362499)){return checkArrayOfIntervals(_0x362499,_0x353e34);}else if(_0x362499){return checkSingleInterval(_0x362499,_0x353e34);}})[_0x6a03('0x10')](function(_0x38f63c){var _0x2fd36b=_0x4b746b[_0x6a03('0x1c')](function(_0x5d1057,_0x4e63d2){return _0x5d1057||iftime(_0x4e63d2,_0x353e34);},![]);_0x5ddce5=_0x38f63c||_0x2fd36b;return _0x5ddce5;})[_0x6a03('0x19')](function(_0x508b1a){logger[_0x6a03('0x1a')]('IntervalIftime',_0x50b053,_0x508b1a);throw this['error'](0x1f4,_0x508b1a[_0x6a03('0x15')]);});}; \ No newline at end of file diff --git a/server/api/jira/index.js b/server/api/jira/index.js index a4a8ee3..ead8abc 100644 --- a/server/api/jira/index.js +++ b/server/api/jira/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5f2f=['isAuthenticated','send','exports','express','Router','../../components/auth/service','./jira.controller','post'];(function(_0x50e89b,_0x4bded8){var _0x4b9202=function(_0x2b3dc6){while(--_0x2b3dc6){_0x50e89b['push'](_0x50e89b['shift']());}};_0x4b9202(++_0x4bded8);}(_0x5f2f,0x73));var _0xf5f2=function(_0x4521c8,_0x500b0a){_0x4521c8=_0x4521c8-0x0;var _0x139c2b=_0x5f2f[_0x4521c8];return _0x139c2b;};'use strict';var express=require(_0xf5f2('0x0'));var router=express[_0xf5f2('0x1')]();var auth=require(_0xf5f2('0x2'));var controller=require(_0xf5f2('0x3'));router[_0xf5f2('0x4')]('/',auth[_0xf5f2('0x5')](),controller[_0xf5f2('0x6')]);module[_0xf5f2('0x7')]=router; \ No newline at end of file +var _0x5f66=['send','exports','Router','./jira.controller','post','isAuthenticated'];(function(_0x215e65,_0x183f97){var _0xa85842=function(_0x43bf45){while(--_0x43bf45){_0x215e65['push'](_0x215e65['shift']());}};_0xa85842(++_0x183f97);}(_0x5f66,0x1a0));var _0x65f6=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0x5f66[_0x138adb];return _0x1b27f2;};'use strict';var express=require('express');var router=express[_0x65f6('0x0')]();var auth=require('../../components/auth/service');var controller=require(_0x65f6('0x1'));router[_0x65f6('0x2')]('/',auth[_0x65f6('0x3')](),controller[_0x65f6('0x4')]);module[_0x65f6('0x5')]=router; \ No newline at end of file diff --git a/server/api/jira/jira.controller.js b/server/api/jira/jira.controller.js index 453c732..779e0a2 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 _0x1c2a=['status','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','api.jira','openIssue','send','body','headers','socket','remoteAddress','connection','https','../../config/logger','api','support','3eAmWpBVP0','key','MOTGUI','summary','Report','description','stringify','Bug','fields','customfield_11500','email','customfield_11501','oldToken','customfield_11502','newToken','customfield_11503','name','customfield_11504','reason','customfield_10102','/rest/api/2/issue','POST','Basic\x20','base64','request','utf8','data','end','json','parse','error'];(function(_0x2e4aa2,_0x11956a){var _0x5e6092=function(_0x4c12c2){while(--_0x4c12c2){_0x2e4aa2['push'](_0x2e4aa2['shift']());}};_0x5e6092(++_0x11956a);}(_0x1c2a,0x91));var _0xa1c2=function(_0x3c4b93,_0xcd17da){_0x3c4b93=_0x3c4b93-0x0;var _0xdfa1d9=_0x1c2a[_0x3c4b93];return _0xdfa1d9;};'use strict';var BPromise=require('bluebird');var https=require(_0xa1c2('0x0'));var logger=require(_0xa1c2('0x1'))(_0xa1c2('0x2'));var USERNAME=_0xa1c2('0x3');var PASSWORD=_0xa1c2('0x4');function openIssue(_0x273f15,_0x5abdef){var _0x42e2c3={'fields':{'project':{'key':_0x273f15[_0xa1c2('0x5')]||_0xa1c2('0x6')},'summary':(_0x273f15[_0xa1c2('0x7')]||_0xa1c2('0x8'))+'\x20from\x20'+_0x273f15['ip'],'description':_0x273f15[_0xa1c2('0x9')]||JSON[_0xa1c2('0xa')](_0x273f15),'issuetype':{'name':_0x273f15['issuetype']||_0xa1c2('0xb')}}};_0x42e2c3[_0xa1c2('0xc')][_0xa1c2('0xd')]=_0x273f15[_0xa1c2('0xe')];_0x42e2c3[_0xa1c2('0xc')][_0xa1c2('0xf')]=_0x273f15[_0xa1c2('0x10')];_0x42e2c3[_0xa1c2('0xc')][_0xa1c2('0x11')]=_0x273f15[_0xa1c2('0x12')];_0x42e2c3[_0xa1c2('0xc')][_0xa1c2('0x13')]=_0x273f15[_0xa1c2('0x14')];_0x42e2c3[_0xa1c2('0xc')][_0xa1c2('0x15')]=_0x273f15[_0xa1c2('0x16')];_0x42e2c3['fields'][_0xa1c2('0x17')]=_0x273f15['ip'];var _0x41ad23={'host':'track.xcallymotion.com','port':0x1bb,'path':_0xa1c2('0x18'),'method':_0xa1c2('0x19'),'timeout':0x4e20,'headers':{'Content-Type':'application/json','Authorization':_0xa1c2('0x1a')+new Buffer(USERNAME+':'+PASSWORD)['toString'](_0xa1c2('0x1b'))}};var _0x49319e=JSON[_0xa1c2('0xa')](_0x42e2c3);var _0x17294e=https[_0xa1c2('0x1c')](_0x41ad23,function(_0x10baa7){_0x10baa7['setEncoding'](_0xa1c2('0x1d'));var _0x1d5cb8='';_0x10baa7['on'](_0xa1c2('0x1e'),function(_0x5b80a4){_0x1d5cb8+=_0x5b80a4;});_0x10baa7['on'](_0xa1c2('0x1f'),function(){if(_0x5abdef){return _0x5abdef['status'](_0x10baa7['statusCode'])[_0xa1c2('0x20')](JSON[_0xa1c2('0x21')](_0x1d5cb8));}});});_0x17294e['on'](_0xa1c2('0x22'),function(_0x2ba826){if(_0x5abdef){return _0x5abdef[_0xa1c2('0x23')](0x1f4)[_0xa1c2('0x20')]({'errors':[{'message':_0xa1c2('0x24'),'type':_0xa1c2('0x25')}]});}});_0x17294e['write'](_0x49319e);_0x17294e['end']();}exports[_0xa1c2('0x26')]=openIssue;exports[_0xa1c2('0x27')]=function(_0x397e48,_0x42ea6c){_0x397e48[_0xa1c2('0x28')]['ip']=_0x397e48[_0xa1c2('0x29')]['x-forwarded-for']||_0x397e48['connection']['remoteAddress']||_0x397e48[_0xa1c2('0x2a')][_0xa1c2('0x2b')]||_0x397e48[_0xa1c2('0x2c')][_0xa1c2('0x2a')][_0xa1c2('0x2b')];return openIssue(_0x397e48[_0xa1c2('0x28')],_0x42ea6c);}; \ No newline at end of file +var _0x450a=['write','openIssue','send','body','x-forwarded-for','connection','remoteAddress','socket','https','../../config/logger','api','3eAmWpBVP0','description','stringify','customfield_11501','fields','newToken','customfield_11503','name','reason','customfield_10102','track.xcallymotion.com','/rest/api/2/issue','POST','application/json','Basic\x20','toString','base64','setEncoding','data','end','statusCode','json','parse','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','api.jira'];(function(_0x208d75,_0x92d742){var _0x382d27=function(_0x3aaba3){while(--_0x3aaba3){_0x208d75['push'](_0x208d75['shift']());}};_0x382d27(++_0x92d742);}(_0x450a,0x128));var _0xa450=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x450a[_0x2641f9];return _0x585741;};'use strict';var BPromise=require('bluebird');var https=require(_0xa450('0x0'));var logger=require(_0xa450('0x1'))(_0xa450('0x2'));var USERNAME='support';var PASSWORD=_0xa450('0x3');function openIssue(_0x534226,_0x24fc88){var _0x239957={'fields':{'project':{'key':_0x534226['key']||'MOTGUI'},'summary':(_0x534226['summary']||'Report')+'\x20from\x20'+_0x534226['ip'],'description':_0x534226[_0xa450('0x4')]||JSON[_0xa450('0x5')](_0x534226),'issuetype':{'name':_0x534226['issuetype']||'Bug'}}};_0x239957['fields']['customfield_11500']=_0x534226['email'];_0x239957['fields'][_0xa450('0x6')]=_0x534226['oldToken'];_0x239957[_0xa450('0x7')]['customfield_11502']=_0x534226[_0xa450('0x8')];_0x239957[_0xa450('0x7')][_0xa450('0x9')]=_0x534226[_0xa450('0xa')];_0x239957[_0xa450('0x7')]['customfield_11504']=_0x534226[_0xa450('0xb')];_0x239957[_0xa450('0x7')][_0xa450('0xc')]=_0x534226['ip'];var _0x607b3a={'host':_0xa450('0xd'),'port':0x1bb,'path':_0xa450('0xe'),'method':_0xa450('0xf'),'timeout':0x4e20,'headers':{'Content-Type':_0xa450('0x10'),'Authorization':_0xa450('0x11')+new Buffer(USERNAME+':'+PASSWORD)[_0xa450('0x12')](_0xa450('0x13'))}};var _0x81bca1=JSON['stringify'](_0x239957);var _0x244487=https['request'](_0x607b3a,function(_0x147a0e){_0x147a0e[_0xa450('0x14')]('utf8');var _0x5308dd='';_0x147a0e['on'](_0xa450('0x15'),function(_0x592dd0){_0x5308dd+=_0x592dd0;});_0x147a0e['on'](_0xa450('0x16'),function(){if(_0x24fc88){return _0x24fc88['status'](_0x147a0e[_0xa450('0x17')])[_0xa450('0x18')](JSON[_0xa450('0x19')](_0x5308dd));}});});_0x244487['on']('error',function(_0x2753df){if(_0x24fc88){return _0x24fc88['status'](0x1f4)[_0xa450('0x18')]({'errors':[{'message':_0xa450('0x1a'),'type':_0xa450('0x1b')}]});}});_0x244487[_0xa450('0x1c')](_0x81bca1);_0x244487[_0xa450('0x16')]();}exports[_0xa450('0x1d')]=openIssue;exports[_0xa450('0x1e')]=function(_0x9cb84,_0x5b85c3){_0x9cb84[_0xa450('0x1f')]['ip']=_0x9cb84['headers'][_0xa450('0x20')]||_0x9cb84[_0xa450('0x21')]['remoteAddress']||_0x9cb84['socket'][_0xa450('0x22')]||_0x9cb84[_0xa450('0x21')][_0xa450('0x23')][_0xa450('0x22')];return openIssue(_0x9cb84['body'],_0x5b85c3);}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/index.js b/server/api/jscriptyAnswerReport/index.js index ef1654f..3605194 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 _0x17ba=['/describe','describe','/:id','show','create','put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyAnswerReport.controller','get','isAuthenticated','index'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x17ba,0xab));var _0xa17b=function(_0x343a43,_0x4bd649){_0x343a43=_0x343a43-0x0;var _0x32a773=_0x17ba[_0x343a43];return _0x32a773;};'use strict';var multer=require(_0xa17b('0x0'));var util=require(_0xa17b('0x1'));var path=require('path');var timeout=require(_0xa17b('0x2'));var express=require(_0xa17b('0x3'));var router=express[_0xa17b('0x4')]();var fs_extra=require(_0xa17b('0x5'));var auth=require(_0xa17b('0x6'));var interaction=require(_0xa17b('0x7'));var config=require(_0xa17b('0x8'));var controller=require(_0xa17b('0x9'));router[_0xa17b('0xa')]('/',auth[_0xa17b('0xb')](),controller[_0xa17b('0xc')]);router[_0xa17b('0xa')](_0xa17b('0xd'),auth[_0xa17b('0xb')](),controller[_0xa17b('0xe')]);router[_0xa17b('0xa')](_0xa17b('0xf'),auth[_0xa17b('0xb')](),controller[_0xa17b('0x10')]);router['post']('/',auth[_0xa17b('0xb')](),controller[_0xa17b('0x11')]);router[_0xa17b('0x12')](_0xa17b('0xf'),auth[_0xa17b('0xb')](),controller[_0xa17b('0x13')]);router[_0xa17b('0x14')]('/:id',auth[_0xa17b('0xb')](),controller[_0xa17b('0x15')]);module[_0xa17b('0x16')]=router; \ No newline at end of file +var _0x2750=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyAnswerReport.controller','get','index','/describe','isAuthenticated','/:id','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router'];(function(_0x46800d,_0x588500){var _0x3824cd=function(_0x14b132){while(--_0x14b132){_0x46800d['push'](_0x46800d['shift']());}};_0x3824cd(++_0x588500);}(_0x2750,0x13b));var _0x0275=function(_0x38d495,_0x2800f9){_0x38d495=_0x38d495-0x0;var _0x1e5c8d=_0x2750[_0x38d495];return _0x1e5c8d;};'use strict';var multer=require(_0x0275('0x0'));var util=require('util');var path=require(_0x0275('0x1'));var timeout=require(_0x0275('0x2'));var express=require(_0x0275('0x3'));var router=express[_0x0275('0x4')]();var fs_extra=require(_0x0275('0x5'));var auth=require(_0x0275('0x6'));var interaction=require(_0x0275('0x7'));var config=require(_0x0275('0x8'));var controller=require(_0x0275('0x9'));router[_0x0275('0xa')]('/',auth['isAuthenticated'](),controller[_0x0275('0xb')]);router[_0x0275('0xa')](_0x0275('0xc'),auth[_0x0275('0xd')](),controller['describe']);router[_0x0275('0xa')](_0x0275('0xe'),auth[_0x0275('0xd')](),controller['show']);router['post']('/',auth[_0x0275('0xd')](),controller['create']);router[_0x0275('0xf')](_0x0275('0xe'),auth[_0x0275('0xd')](),controller[_0x0275('0x10')]);router[_0x0275('0x11')]('/:id',auth[_0x0275('0xd')](),controller[_0x0275('0x12')]);module[_0x0275('0x13')]=router; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js index dc4998e..4892f62 100644 --- a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js +++ b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['long','STRING','sequelize','exports','TEXT'];(function(_0x21549c,_0x6d64d1){var _0x426cbd=function(_0x323f5b){while(--_0x323f5b){_0x21549c['push'](_0x21549c['shift']());}};_0x426cbd(++_0x6d64d1);}(_0x7a54,0x106));var _0x47a5=function(_0x19ba90,_0x9904a3){_0x19ba90=_0x19ba90-0x0;var _0x5cc9ee=_0x7a54[_0x19ba90];return _0x5cc9ee;};'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(_0x82129b,_0x484ae9){var _0x2ae5dc=function(_0x299e34){while(--_0x299e34){_0x82129b['push'](_0x82129b['shift']());}};_0x2ae5dc(++_0x484ae9);}(_0x7a54,0x106));var _0x47a5=function(_0x19ac09,_0x423db5){_0x19ac09=_0x19ac09-0x0;var _0x1d5244=_0x7a54[_0x19ac09];return _0x1d5244;};'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 2c520a8..6052331 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 _0x0e4b=['ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count','set','json','apply','reject','save','update','destroy','then','error','stack','name','send','index','JscriptyAnswerReport','rawAttributes','fieldName','type','key','model','map','keys','intersection','query','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filter','options','include','findAll','rows','catch','show','params','filters','length','includeAll','merge','find','create','body','describe','eml-format','rimraf','zip-dir','request-promise','path','sox','ejs','fs-extra','lodash','squel','crypto','to-csv','querystring','papaparse'];(function(_0xd77f8,_0x25170f){var _0x40de16=function(_0x1c80d3){while(--_0x1c80d3){_0xd77f8['push'](_0xd77f8['shift']());}};_0x40de16(++_0x25170f);}(_0x0e4b,0xdc));var _0xb0e4=function(_0x157f58,_0x44475e){_0x157f58=_0x157f58-0x0;var _0x4f08e5=_0x0e4b[_0x157f58];return _0x4f08e5;};'use strict';var emlformat=require(_0xb0e4('0x0'));var rimraf=require(_0xb0e4('0x1'));var zipdir=require(_0xb0e4('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb0e4('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xb0e4('0x4'));var sox=require(_0xb0e4('0x5'));var csv=require('to-csv');var ejs=require(_0xb0e4('0x6'));var fs=require('fs');var fs_extra=require(_0xb0e4('0x7'));var _=require(_0xb0e4('0x8'));var squel=require(_0xb0e4('0x9'));var crypto=require(_0xb0e4('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xb0e4('0xb'));var querystring=require(_0xb0e4('0xc'));var Papa=require(_0xb0e4('0xd'));var Redis=require(_0xb0e4('0xe'));var authService=require(_0xb0e4('0xf'));var qs=require(_0xb0e4('0x10'));var as=require(_0xb0e4('0x11'));var hardwareService=require(_0xb0e4('0x12'));var logger=require(_0xb0e4('0x13'))(_0xb0e4('0x14'));var utils=require(_0xb0e4('0x15'));var config=require(_0xb0e4('0x16'));var licenseUtil=require(_0xb0e4('0x17'));var db=require(_0xb0e4('0x18'))['db'];function respondWithStatusCode(_0xdfa7fd,_0x4c19ee){_0x4c19ee=_0x4c19ee||0xcc;return function(_0x190a90){if(_0x190a90){return _0xdfa7fd[_0xb0e4('0x19')](_0x4c19ee);}return _0xdfa7fd['status'](_0x4c19ee)[_0xb0e4('0x1a')]();};}function respondWithResult(_0x26f664,_0x291e3f){_0x291e3f=_0x291e3f||0xc8;return function(_0x460180){if(_0x460180){return _0x26f664[_0xb0e4('0x1b')](_0x291e3f)['json'](_0x460180);}};}function respondWithFilteredResult(_0x4b3f3f,_0x17419f){return function(_0x3a140c){if(_0x3a140c){var _0x5b219a=typeof _0x17419f[_0xb0e4('0x1c')]===_0xb0e4('0x1d')&&typeof _0x17419f[_0xb0e4('0x1e')]===_0xb0e4('0x1d');var _0x74c379=_0x3a140c[_0xb0e4('0x1f')];var _0x570886=_0x5b219a?0x0:_0x17419f['offset'];var _0x4ba49e=_0x5b219a?_0x3a140c[_0xb0e4('0x1f')]:_0x17419f[_0xb0e4('0x1c')]+_0x17419f[_0xb0e4('0x1e')];var _0x690682;if(_0x4ba49e>=_0x74c379){_0x4ba49e=_0x74c379;_0x690682=0xc8;}else{_0x690682=0xce;}_0x4b3f3f[_0xb0e4('0x1b')](_0x690682);return _0x4b3f3f[_0xb0e4('0x20')]('Content-Range',_0x570886+'-'+_0x4ba49e+'/'+_0x74c379)[_0xb0e4('0x21')](_0x3a140c);}return null;};}function patchUpdates(_0x459684){return function(_0x2e8372){try{jsonpatch[_0xb0e4('0x22')](_0x2e8372,_0x459684,!![]);}catch(_0x4bbb10){return BPromise[_0xb0e4('0x23')](_0x4bbb10);}return _0x2e8372[_0xb0e4('0x24')]();};}function saveUpdates(_0x52b55e,_0x2663f3){return function(_0x2774be){if(_0x2774be){return _0x2774be[_0xb0e4('0x25')](_0x52b55e)['then'](function(_0x1a6810){return _0x1a6810;});}return null;};}function removeEntity(_0x4d4f7f,_0x4bc636){return function(_0x21276c){if(_0x21276c){return _0x21276c[_0xb0e4('0x26')]()[_0xb0e4('0x27')](function(){_0x4d4f7f[_0xb0e4('0x1b')](0xcc)[_0xb0e4('0x1a')]();});}};}function handleEntityNotFound(_0x248aa5,_0x6665e){return function(_0x50fe9e){if(!_0x50fe9e){_0x248aa5[_0xb0e4('0x19')](0x194);}return _0x50fe9e;};}function handleError(_0x4821dd,_0x45de79){_0x45de79=_0x45de79||0x1f4;return function(_0x22033f){logger[_0xb0e4('0x28')](_0x22033f[_0xb0e4('0x29')]);if(_0x22033f['name']){delete _0x22033f[_0xb0e4('0x2a')];}_0x4821dd[_0xb0e4('0x1b')](_0x45de79)[_0xb0e4('0x2b')](_0x22033f);};}exports[_0xb0e4('0x2c')]=function(_0x447f41,_0x5c0ad0){var _0x1dad0e={},_0x31a339={},_0x4e1f2f={'count':0x0,'rows':[]};var _0x1d5ba8=_['map'](db[_0xb0e4('0x2d')][_0xb0e4('0x2e')],function(_0x50cef9){return{'name':_0x50cef9[_0xb0e4('0x2f')],'type':_0x50cef9[_0xb0e4('0x30')][_0xb0e4('0x31')]};});_0x31a339[_0xb0e4('0x32')]=_[_0xb0e4('0x33')](_0x1d5ba8,_0xb0e4('0x2a'));_0x31a339['query']=_[_0xb0e4('0x34')](_0x447f41['query']);_0x31a339['filters']=_[_0xb0e4('0x35')](_0x31a339['model'],_0x31a339[_0xb0e4('0x36')]);_0x1dad0e['attributes']=_[_0xb0e4('0x35')](_0x31a339['model'],qs[_0xb0e4('0x37')](_0x447f41[_0xb0e4('0x36')][_0xb0e4('0x37')]));_0x1dad0e['attributes']=_0x1dad0e[_0xb0e4('0x38')]['length']?_0x1dad0e[_0xb0e4('0x38')]:_0x31a339[_0xb0e4('0x32')];if(!_0x447f41[_0xb0e4('0x36')][_0xb0e4('0x39')](_0xb0e4('0x3a'))){_0x1dad0e['limit']=qs[_0xb0e4('0x1e')](_0x447f41['query'][_0xb0e4('0x1e')]);_0x1dad0e[_0xb0e4('0x1c')]=qs[_0xb0e4('0x1c')](_0x447f41['query'][_0xb0e4('0x1c')]);}_0x1dad0e[_0xb0e4('0x3b')]=qs[_0xb0e4('0x3c')](_0x447f41[_0xb0e4('0x36')]['sort']);_0x1dad0e['where']=qs['filters'](_['pick'](_0x447f41[_0xb0e4('0x36')],_0x31a339['filters']),_0x1d5ba8);if(_0x447f41[_0xb0e4('0x36')]['filter']){_0x1dad0e[_0xb0e4('0x3d')]=_['merge'](_0x1dad0e[_0xb0e4('0x3d')],{'$or':_[_0xb0e4('0x33')](_0x1d5ba8,function(_0x331de4){if(_0x331de4[_0xb0e4('0x30')]!=='VIRTUAL'){var _0xee83f7={};_0xee83f7[_0x331de4[_0xb0e4('0x2a')]]={'$like':'%'+_0x447f41['query'][_0xb0e4('0x3e')]+'%'};return _0xee83f7;}})});}_0x1dad0e=_['merge']({},_0x1dad0e,_0x447f41[_0xb0e4('0x3f')]);var _0x15d92c={'where':_0x1dad0e['where']};return db[_0xb0e4('0x2d')]['count'](_0x15d92c)['then'](function(_0x4ec8c6){_0x4e1f2f[_0xb0e4('0x1f')]=_0x4ec8c6;if(_0x447f41[_0xb0e4('0x36')]['includeAll']){_0x1dad0e[_0xb0e4('0x40')]=[{'all':!![]}];}return db['JscriptyAnswerReport'][_0xb0e4('0x41')](_0x1dad0e);})[_0xb0e4('0x27')](function(_0x2a5c01){_0x4e1f2f[_0xb0e4('0x42')]=_0x2a5c01;return _0x4e1f2f;})['then'](respondWithFilteredResult(_0x5c0ad0,_0x1dad0e))[_0xb0e4('0x43')](handleError(_0x5c0ad0,null));};exports[_0xb0e4('0x44')]=function(_0x1a524b,_0x3e839e){var _0x387122={'raw':!![],'where':{'id':_0x1a524b[_0xb0e4('0x45')]['id']}},_0x3c9e8a={};_0x3c9e8a[_0xb0e4('0x32')]=_[_0xb0e4('0x34')](db[_0xb0e4('0x2d')][_0xb0e4('0x2e')]);_0x3c9e8a[_0xb0e4('0x36')]=_[_0xb0e4('0x34')](_0x1a524b[_0xb0e4('0x36')]);_0x3c9e8a[_0xb0e4('0x46')]=_[_0xb0e4('0x35')](_0x3c9e8a['model'],_0x3c9e8a[_0xb0e4('0x36')]);_0x387122[_0xb0e4('0x38')]=_[_0xb0e4('0x35')](_0x3c9e8a[_0xb0e4('0x32')],qs['fields'](_0x1a524b[_0xb0e4('0x36')][_0xb0e4('0x37')]));_0x387122['attributes']=_0x387122[_0xb0e4('0x38')][_0xb0e4('0x47')]?_0x387122[_0xb0e4('0x38')]:_0x3c9e8a[_0xb0e4('0x32')];if(_0x1a524b['query'][_0xb0e4('0x48')]){_0x387122[_0xb0e4('0x40')]=[{'all':!![]}];}_0x387122=_[_0xb0e4('0x49')]({},_0x387122,_0x1a524b[_0xb0e4('0x3f')]);return db[_0xb0e4('0x2d')][_0xb0e4('0x4a')](_0x387122)[_0xb0e4('0x27')](handleEntityNotFound(_0x3e839e,null))[_0xb0e4('0x27')](respondWithResult(_0x3e839e,null))[_0xb0e4('0x43')](handleError(_0x3e839e,null));};exports[_0xb0e4('0x4b')]=function(_0x12380c,_0x5b04a4){return db[_0xb0e4('0x2d')][_0xb0e4('0x4b')](_0x12380c['body'],{})['then'](respondWithResult(_0x5b04a4,0xc9))['catch'](handleError(_0x5b04a4,null));};exports[_0xb0e4('0x25')]=function(_0x335b20,_0x4c2036){if(_0x335b20['body']['id']){delete _0x335b20['body']['id'];}return db['JscriptyAnswerReport']['find']({'where':{'id':_0x335b20['params']['id']}})[_0xb0e4('0x27')](handleEntityNotFound(_0x4c2036,null))['then'](saveUpdates(_0x335b20[_0xb0e4('0x4c')],null))[_0xb0e4('0x27')](respondWithResult(_0x4c2036,null))[_0xb0e4('0x43')](handleError(_0x4c2036,null));};exports[_0xb0e4('0x26')]=function(_0x502d5e,_0x36778c){return db[_0xb0e4('0x2d')]['find']({'where':{'id':_0x502d5e[_0xb0e4('0x45')]['id']}})['then'](handleEntityNotFound(_0x36778c,null))[_0xb0e4('0x27')](removeEntity(_0x36778c,null))[_0xb0e4('0x43')](handleError(_0x36778c,null));};exports[_0xb0e4('0x4d')]=function(_0x2e2b07,_0x4b1d48){return db[_0xb0e4('0x2d')][_0xb0e4('0x4d')]()[_0xb0e4('0x27')](respondWithResult(_0x4b1d48,null))[_0xb0e4('0x43')](handleError(_0x4b1d48,null));}; \ No newline at end of file +var _0x4074=['params','rawAttributes','intersection','include','find','catch','create','body','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','count','offset','Content-Range','apply','save','update','destroy','error','stack','name','index','fieldName','type','key','model','map','query','keys','attributes','fields','length','nolimit','order','sort','filters','filter','merge','where','VIRTUAL','options','JscriptyAnswerReport','then','includeAll','findAll','rows','show'];(function(_0x30f444,_0x5c0d0d){var _0x5bc947=function(_0x5ba1f1){while(--_0x5ba1f1){_0x30f444['push'](_0x30f444['shift']());}};_0x5bc947(++_0x5c0d0d);}(_0x4074,0xf0));var _0x4407=function(_0xc6209f,_0x584d30){_0xc6209f=_0xc6209f-0x0;var _0x604fb7=_0x4074[_0xc6209f];return _0x604fb7;};'use strict';var emlformat=require(_0x4407('0x0'));var rimraf=require(_0x4407('0x1'));var zipdir=require(_0x4407('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4407('0x3'));var moment=require(_0x4407('0x4'));var BPromise=require(_0x4407('0x5'));var Mustache=require(_0x4407('0x6'));var util=require(_0x4407('0x7'));var path=require(_0x4407('0x8'));var sox=require(_0x4407('0x9'));var csv=require(_0x4407('0xa'));var ejs=require(_0x4407('0xb'));var fs=require('fs');var fs_extra=require(_0x4407('0xc'));var _=require('lodash');var squel=require(_0x4407('0xd'));var crypto=require('crypto');var jsforce=require(_0x4407('0xe'));var deskjs=require(_0x4407('0xf'));var toCsv=require(_0x4407('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x4407('0x10'));var qs=require(_0x4407('0x11'));var as=require(_0x4407('0x12'));var hardwareService=require(_0x4407('0x13'));var logger=require(_0x4407('0x14'))(_0x4407('0x15'));var utils=require(_0x4407('0x16'));var config=require(_0x4407('0x17'));var licenseUtil=require(_0x4407('0x18'));var db=require(_0x4407('0x19'))['db'];function respondWithStatusCode(_0x14f398,_0x5d0c41){_0x5d0c41=_0x5d0c41||0xcc;return function(_0x3f8f23){if(_0x3f8f23){return _0x14f398[_0x4407('0x1a')](_0x5d0c41);}return _0x14f398['status'](_0x5d0c41)[_0x4407('0x1b')]();};}function respondWithResult(_0x4c62b9,_0x1d2ec8){_0x1d2ec8=_0x1d2ec8||0xc8;return function(_0x27724a){if(_0x27724a){return _0x4c62b9[_0x4407('0x1c')](_0x1d2ec8)[_0x4407('0x1d')](_0x27724a);}};}function respondWithFilteredResult(_0x1840dd,_0x417e19){return function(_0x1c5a0c){if(_0x1c5a0c){var _0x2e709f=typeof _0x417e19['offset']===_0x4407('0x1e')&&typeof _0x417e19[_0x4407('0x1f')]===_0x4407('0x1e');var _0x367d55=_0x1c5a0c[_0x4407('0x20')];var _0x5b50b7=_0x2e709f?0x0:_0x417e19[_0x4407('0x21')];var _0x54caa1=_0x2e709f?_0x1c5a0c[_0x4407('0x20')]:_0x417e19[_0x4407('0x21')]+_0x417e19[_0x4407('0x1f')];var _0x2db8b2;if(_0x54caa1>=_0x367d55){_0x54caa1=_0x367d55;_0x2db8b2=0xc8;}else{_0x2db8b2=0xce;}_0x1840dd[_0x4407('0x1c')](_0x2db8b2);return _0x1840dd['set'](_0x4407('0x22'),_0x5b50b7+'-'+_0x54caa1+'/'+_0x367d55)['json'](_0x1c5a0c);}return null;};}function patchUpdates(_0x36a948){return function(_0x28bb2c){try{jsonpatch[_0x4407('0x23')](_0x28bb2c,_0x36a948,!![]);}catch(_0x445fe6){return BPromise['reject'](_0x445fe6);}return _0x28bb2c[_0x4407('0x24')]();};}function saveUpdates(_0x1fa9f1,_0x137f8e){return function(_0x2c880a){if(_0x2c880a){return _0x2c880a[_0x4407('0x25')](_0x1fa9f1)['then'](function(_0xa7265d){return _0xa7265d;});}return null;};}function removeEntity(_0x16272f,_0x5e214c){return function(_0x21b048){if(_0x21b048){return _0x21b048[_0x4407('0x26')]()['then'](function(){_0x16272f[_0x4407('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x309274,_0x5386f4){return function(_0x40fb1e){if(!_0x40fb1e){_0x309274['sendStatus'](0x194);}return _0x40fb1e;};}function handleError(_0x374754,_0x4bf227){_0x4bf227=_0x4bf227||0x1f4;return function(_0x57ba27){logger[_0x4407('0x27')](_0x57ba27[_0x4407('0x28')]);if(_0x57ba27[_0x4407('0x29')]){delete _0x57ba27['name'];}_0x374754['status'](_0x4bf227)['send'](_0x57ba27);};}exports[_0x4407('0x2a')]=function(_0x2feb6b,_0x1f9828){var _0x84a8a={},_0x1d6b3d={},_0x37fba1={'count':0x0,'rows':[]};var _0x182bd9=_['map'](db['JscriptyAnswerReport']['rawAttributes'],function(_0x28e99e){return{'name':_0x28e99e[_0x4407('0x2b')],'type':_0x28e99e[_0x4407('0x2c')][_0x4407('0x2d')]};});_0x1d6b3d[_0x4407('0x2e')]=_[_0x4407('0x2f')](_0x182bd9,_0x4407('0x29'));_0x1d6b3d[_0x4407('0x30')]=_[_0x4407('0x31')](_0x2feb6b[_0x4407('0x30')]);_0x1d6b3d['filters']=_['intersection'](_0x1d6b3d[_0x4407('0x2e')],_0x1d6b3d[_0x4407('0x30')]);_0x84a8a[_0x4407('0x32')]=_['intersection'](_0x1d6b3d[_0x4407('0x2e')],qs[_0x4407('0x33')](_0x2feb6b[_0x4407('0x30')][_0x4407('0x33')]));_0x84a8a[_0x4407('0x32')]=_0x84a8a['attributes'][_0x4407('0x34')]?_0x84a8a['attributes']:_0x1d6b3d[_0x4407('0x2e')];if(!_0x2feb6b['query']['hasOwnProperty'](_0x4407('0x35'))){_0x84a8a[_0x4407('0x1f')]=qs[_0x4407('0x1f')](_0x2feb6b[_0x4407('0x30')][_0x4407('0x1f')]);_0x84a8a[_0x4407('0x21')]=qs[_0x4407('0x21')](_0x2feb6b['query'][_0x4407('0x21')]);}_0x84a8a[_0x4407('0x36')]=qs[_0x4407('0x37')](_0x2feb6b[_0x4407('0x30')][_0x4407('0x37')]);_0x84a8a['where']=qs[_0x4407('0x38')](_['pick'](_0x2feb6b[_0x4407('0x30')],_0x1d6b3d[_0x4407('0x38')]),_0x182bd9);if(_0x2feb6b[_0x4407('0x30')][_0x4407('0x39')]){_0x84a8a['where']=_[_0x4407('0x3a')](_0x84a8a[_0x4407('0x3b')],{'$or':_[_0x4407('0x2f')](_0x182bd9,function(_0x1bf4e2){if(_0x1bf4e2[_0x4407('0x2c')]!==_0x4407('0x3c')){var _0x30de66={};_0x30de66[_0x1bf4e2[_0x4407('0x29')]]={'$like':'%'+_0x2feb6b[_0x4407('0x30')]['filter']+'%'};return _0x30de66;}})});}_0x84a8a=_['merge']({},_0x84a8a,_0x2feb6b[_0x4407('0x3d')]);var _0xc47d0e={'where':_0x84a8a[_0x4407('0x3b')]};return db[_0x4407('0x3e')]['count'](_0xc47d0e)[_0x4407('0x3f')](function(_0x2cb65e){_0x37fba1[_0x4407('0x20')]=_0x2cb65e;if(_0x2feb6b['query'][_0x4407('0x40')]){_0x84a8a['include']=[{'all':!![]}];}return db['JscriptyAnswerReport'][_0x4407('0x41')](_0x84a8a);})[_0x4407('0x3f')](function(_0x234fa5){_0x37fba1[_0x4407('0x42')]=_0x234fa5;return _0x37fba1;})[_0x4407('0x3f')](respondWithFilteredResult(_0x1f9828,_0x84a8a))['catch'](handleError(_0x1f9828,null));};exports[_0x4407('0x43')]=function(_0xf79768,_0x819b8b){var _0x15ba7b={'raw':!![],'where':{'id':_0xf79768[_0x4407('0x44')]['id']}},_0x5b41cf={};_0x5b41cf[_0x4407('0x2e')]=_[_0x4407('0x31')](db[_0x4407('0x3e')][_0x4407('0x45')]);_0x5b41cf['query']=_[_0x4407('0x31')](_0xf79768['query']);_0x5b41cf['filters']=_[_0x4407('0x46')](_0x5b41cf[_0x4407('0x2e')],_0x5b41cf['query']);_0x15ba7b[_0x4407('0x32')]=_[_0x4407('0x46')](_0x5b41cf[_0x4407('0x2e')],qs[_0x4407('0x33')](_0xf79768['query'][_0x4407('0x33')]));_0x15ba7b[_0x4407('0x32')]=_0x15ba7b[_0x4407('0x32')][_0x4407('0x34')]?_0x15ba7b[_0x4407('0x32')]:_0x5b41cf['model'];if(_0xf79768[_0x4407('0x30')][_0x4407('0x40')]){_0x15ba7b[_0x4407('0x47')]=[{'all':!![]}];}_0x15ba7b=_[_0x4407('0x3a')]({},_0x15ba7b,_0xf79768[_0x4407('0x3d')]);return db['JscriptyAnswerReport'][_0x4407('0x48')](_0x15ba7b)[_0x4407('0x3f')](handleEntityNotFound(_0x819b8b,null))[_0x4407('0x3f')](respondWithResult(_0x819b8b,null))[_0x4407('0x49')](handleError(_0x819b8b,null));};exports['create']=function(_0x18ff16,_0x2b18b8){return db['JscriptyAnswerReport'][_0x4407('0x4a')](_0x18ff16[_0x4407('0x4b')],{})['then'](respondWithResult(_0x2b18b8,0xc9))[_0x4407('0x49')](handleError(_0x2b18b8,null));};exports[_0x4407('0x25')]=function(_0x5ea36,_0x4fbc1f){if(_0x5ea36[_0x4407('0x4b')]['id']){delete _0x5ea36['body']['id'];}return db['JscriptyAnswerReport'][_0x4407('0x48')]({'where':{'id':_0x5ea36[_0x4407('0x44')]['id']}})['then'](handleEntityNotFound(_0x4fbc1f,null))[_0x4407('0x3f')](saveUpdates(_0x5ea36[_0x4407('0x4b')],null))[_0x4407('0x3f')](respondWithResult(_0x4fbc1f,null))[_0x4407('0x49')](handleError(_0x4fbc1f,null));};exports[_0x4407('0x26')]=function(_0x5a2c2b,_0x39865e){return db[_0x4407('0x3e')][_0x4407('0x48')]({'where':{'id':_0x5a2c2b[_0x4407('0x44')]['id']}})[_0x4407('0x3f')](handleEntityNotFound(_0x39865e,null))[_0x4407('0x3f')](removeEntity(_0x39865e,null))[_0x4407('0x49')](handleError(_0x39865e,null));};exports[_0x4407('0x4c')]=function(_0xd1dd66,_0x55f0ef){return db[_0x4407('0x3e')]['describe']()[_0x4407('0x3f')](respondWithResult(_0x55f0ef,null))[_0x4407('0x49')](handleError(_0x55f0ef,null));}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js index 8216ef3..950c719 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 _0x975e=['api','moment','request-promise','rimraf','../../config/environment','define','JscriptyAnswerReport','report_jscripty_answers','lodash','../../config/logger'];(function(_0x1b800f,_0x2ce783){var _0x35cc65=function(_0x35035d){while(--_0x35035d){_0x1b800f['push'](_0x1b800f['shift']());}};_0x35cc65(++_0x2ce783);}(_0x975e,0xc6));var _0xe975=function(_0x38782c,_0x5c9fef){_0x38782c=_0x38782c-0x0;var _0x3708bf=_0x975e[_0x38782c];return _0x3708bf;};'use strict';var _=require(_0xe975('0x0'));var util=require('util');var logger=require(_0xe975('0x1'))(_0xe975('0x2'));var moment=require(_0xe975('0x3'));var BPromise=require('bluebird');var rp=require(_0xe975('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe975('0x5'));var config=require(_0xe975('0x6'));var attributes=require('./jscriptyAnswerReport.attributes');module['exports']=function(_0x43e2c5,_0x40df50){return _0x43e2c5[_0xe975('0x7')](_0xe975('0x8'),attributes,{'tableName':_0xe975('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x33be=['exports','define','JscriptyAnswerReport','report_jscripty_answers','util','api','bluebird','request-promise','rimraf','../../config/environment','./jscriptyAnswerReport.attributes'];(function(_0x13410f,_0x4a56eb){var _0x1eff8e=function(_0x34ec41){while(--_0x34ec41){_0x13410f['push'](_0x13410f['shift']());}};_0x1eff8e(++_0x4a56eb);}(_0x33be,0x19b));var _0xe33b=function(_0x5f1391,_0x19c132){_0x5f1391=_0x5f1391-0x0;var _0x50ebe3=_0x33be[_0x5f1391];return _0x50ebe3;};'use strict';var _=require('lodash');var util=require(_0xe33b('0x0'));var logger=require('../../config/logger')(_0xe33b('0x1'));var moment=require('moment');var BPromise=require(_0xe33b('0x2'));var rp=require(_0xe33b('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe33b('0x4'));var config=require(_0xe33b('0x5'));var attributes=require(_0xe33b('0x6'));module[_0xe33b('0x7')]=function(_0x8f85c4,_0x2ca9dd){return _0x8f85c4[_0xe33b('0x8')](_0xe33b('0x9'),attributes,{'tableName':_0xe33b('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.rpc.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.rpc.js index 848fe57..54e6182 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 _0x847f=['catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','info','JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x847f,0x19f));var _0xf847=function(_0x1b9d41,_0xd4009d){_0x1b9d41=_0x1b9d41-0x0;var _0x38ec46=_0x847f[_0x1b9d41];return _0x38ec46;};'use strict';var _=require('lodash');var util=require(_0xf847('0x0'));var moment=require(_0xf847('0x1'));var BPromise=require(_0xf847('0x2'));var rs=require(_0xf847('0x3'));var fs=require('fs');var Redis=require(_0xf847('0x4'));var db=require(_0xf847('0x5'))['db'];var utils=require(_0xf847('0x6'));var logger=require('../../config/logger')(_0xf847('0x7'));var config=require(_0xf847('0x8'));var jayson=require(_0xf847('0x9'));var client=jayson[_0xf847('0xa')][_0xf847('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x78454f,_0x554f3b,_0x22e7e3){return new BPromise(function(_0xd5d7a8,_0x1410a8){return client['request'](_0x78454f,_0x22e7e3)['then'](function(_0x349298){logger[_0xf847('0xc')](_0xf847('0xd'),_0x554f3b,_0xf847('0xe'));logger[_0xf847('0xf')](_0xf847('0x10'),_0x554f3b,_0xf847('0xe'),JSON[_0xf847('0x11')](_0x349298));if(_0x349298[_0xf847('0x12')]){if(_0x349298[_0xf847('0x12')][_0xf847('0x13')]===0x1f4){logger['error'](_0xf847('0xd'),_0x554f3b,_0x349298['error'][_0xf847('0x14')]);return _0x1410a8(_0x349298[_0xf847('0x12')]['message']);}logger[_0xf847('0x12')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x554f3b,_0x349298['error'][_0xf847('0x14')]);return _0xd5d7a8(_0x349298['error'][_0xf847('0x14')]);}else{logger['info']('JscriptyAnswerReport,\x20%s,\x20%s',_0x554f3b,_0xf847('0xe'));_0xd5d7a8(_0x349298[_0xf847('0x15')][_0xf847('0x14')]);}})[_0xf847('0x16')](function(_0x16bbfc){logger['error'](_0xf847('0xd'),_0x554f3b,_0x16bbfc);_0x1410a8(_0x16bbfc);});});} \ No newline at end of file +var _0xddb3=['result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','http','then','info','JscriptyAnswerReport,\x20%s,\x20%s','debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','request\x20sent','code','error','message'];(function(_0x13b7fd,_0x4eaf7f){var _0x32a74a=function(_0x2c5d80){while(--_0x2c5d80){_0x13b7fd['push'](_0x13b7fd['shift']());}};_0x32a74a(++_0x4eaf7f);}(_0xddb3,0x167));var _0x3ddb=function(_0x20a96e,_0x5473c0){_0x20a96e=_0x20a96e-0x0;var _0x124361=_0xddb3[_0x20a96e];return _0x124361;};'use strict';var _=require(_0x3ddb('0x0'));var util=require('util');var moment=require(_0x3ddb('0x1'));var BPromise=require(_0x3ddb('0x2'));var rs=require(_0x3ddb('0x3'));var fs=require('fs');var Redis=require(_0x3ddb('0x4'));var db=require(_0x3ddb('0x5'))['db'];var utils=require(_0x3ddb('0x6'));var logger=require('../../config/logger')(_0x3ddb('0x7'));var config=require(_0x3ddb('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x3ddb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x174f42,_0x568196,_0x3191d1){return new BPromise(function(_0x359368,_0x478b07){return client['request'](_0x174f42,_0x3191d1)[_0x3ddb('0xa')](function(_0x42908b){logger[_0x3ddb('0xb')](_0x3ddb('0xc'),_0x568196,'request\x20sent');logger[_0x3ddb('0xd')](_0x3ddb('0xe'),_0x568196,_0x3ddb('0xf'),JSON['stringify'](_0x42908b));if(_0x42908b['error']){if(_0x42908b['error'][_0x3ddb('0x10')]===0x1f4){logger[_0x3ddb('0x11')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x568196,_0x42908b['error'][_0x3ddb('0x12')]);return _0x478b07(_0x42908b[_0x3ddb('0x11')]['message']);}logger['error'](_0x3ddb('0xc'),_0x568196,_0x42908b[_0x3ddb('0x11')][_0x3ddb('0x12')]);return _0x359368(_0x42908b[_0x3ddb('0x11')]['message']);}else{logger[_0x3ddb('0xb')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x568196,_0x3ddb('0xf'));_0x359368(_0x42908b[_0x3ddb('0x13')]['message']);}})[_0x3ddb('0x14')](function(_0x4b7060){logger[_0x3ddb('0x11')](_0x3ddb('0xc'),_0x568196,_0x4b7060);_0x478b07(_0x4b7060);});});} \ No newline at end of file diff --git a/server/api/jscriptyProject/index.js b/server/api/jscriptyProject/index.js index e791130..ef3373f 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 _0x963e=['index','get','/:id','show','getSessions','/:id/answers','/:id/summary','30s','getSummary','post','create','/:id/clone','clone','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../config/environment','./jscriptyProject.controller','isAuthenticated'];(function(_0xf4ac3,_0x3e2cb9){var _0x2385d3=function(_0x2074f9){while(--_0x2074f9){_0xf4ac3['push'](_0xf4ac3['shift']());}};_0x2385d3(++_0x3e2cb9);}(_0x963e,0x1ca));var _0xe963=function(_0x34325b,_0x5e5afe){_0x34325b=_0x34325b-0x0;var _0x3da348=_0x963e[_0x34325b];return _0x3da348;};'use strict';var multer=require(_0xe963('0x0'));var util=require(_0xe963('0x1'));var path=require(_0xe963('0x2'));var timeout=require(_0xe963('0x3'));var express=require(_0xe963('0x4'));var router=express[_0xe963('0x5')]();var fs_extra=require(_0xe963('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xe963('0x7'));var controller=require(_0xe963('0x8'));router['get']('/',auth[_0xe963('0x9')](),controller[_0xe963('0xa')]);router[_0xe963('0xb')](_0xe963('0xc'),auth[_0xe963('0x9')](),controller[_0xe963('0xd')]);router['get']('/:id/sessions',auth[_0xe963('0x9')](),controller[_0xe963('0xe')]);router['get'](_0xe963('0xf'),auth[_0xe963('0x9')](),controller['getAnswers']);router['get'](_0xe963('0x10'),auth[_0xe963('0x9')](),timeout(_0xe963('0x11')),controller[_0xe963('0x12')]);router[_0xe963('0x13')]('/',auth[_0xe963('0x9')](),controller[_0xe963('0x14')]);router[_0xe963('0x13')](_0xe963('0x15'),auth['isAuthenticated'](),controller[_0xe963('0x16')]);router['put'](_0xe963('0xc'),auth[_0xe963('0x9')](),controller[_0xe963('0x17')]);router['delete']('/:id',auth[_0xe963('0x9')](),controller[_0xe963('0x18')]);module[_0xe963('0x19')]=router; \ No newline at end of file +var _0x9603=['../../components/interaction/service','../../config/environment','./jscriptyProject.controller','get','index','isAuthenticated','show','/:id/sessions','getSessions','/:id/answers','getAnswers','/:id/summary','30s','getSummary','post','create','/:id/clone','clone','put','/:id','update','exports','multer','path','connect-timeout','express','fs-extra'];(function(_0x20040f,_0x314eea){var _0x44653e=function(_0x7ac0a8){while(--_0x7ac0a8){_0x20040f['push'](_0x20040f['shift']());}};_0x44653e(++_0x314eea);}(_0x9603,0x9d));var _0x3960=function(_0x19ee64,_0x56496c){_0x19ee64=_0x19ee64-0x0;var _0x1680ab=_0x9603[_0x19ee64];return _0x1680ab;};'use strict';var multer=require(_0x3960('0x0'));var util=require('util');var path=require(_0x3960('0x1'));var timeout=require(_0x3960('0x2'));var express=require(_0x3960('0x3'));var router=express['Router']();var fs_extra=require(_0x3960('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3960('0x5'));var config=require(_0x3960('0x6'));var controller=require(_0x3960('0x7'));router[_0x3960('0x8')]('/',auth['isAuthenticated'](),controller[_0x3960('0x9')]);router[_0x3960('0x8')]('/:id',auth[_0x3960('0xa')](),controller[_0x3960('0xb')]);router[_0x3960('0x8')](_0x3960('0xc'),auth[_0x3960('0xa')](),controller[_0x3960('0xd')]);router[_0x3960('0x8')](_0x3960('0xe'),auth[_0x3960('0xa')](),controller[_0x3960('0xf')]);router[_0x3960('0x8')](_0x3960('0x10'),auth['isAuthenticated'](),timeout(_0x3960('0x11')),controller[_0x3960('0x12')]);router[_0x3960('0x13')]('/',auth[_0x3960('0xa')](),controller[_0x3960('0x14')]);router[_0x3960('0x13')](_0x3960('0x15'),auth['isAuthenticated'](),controller[_0x3960('0x16')]);router[_0x3960('0x17')](_0x3960('0x18'),auth[_0x3960('0xa')](),controller[_0x3960('0x19')]);router['delete'](_0x3960('0x18'),auth[_0x3960('0xa')](),controller['destroy']);module[_0x3960('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 468b210..b1e5d88 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 _0x37c6=['format','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','description','BOOLEAN','lodash','util','exports','STRING','name','TEXT','long','isObjectLike','formData','stringify','isString','setDataValue'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0x37c6,0x114));var _0x637c=function(_0x2071a8,_0x25f455){_0x2071a8=_0x2071a8-0x0;var _0x3b3935=_0x37c6[_0x2071a8];return _0x3b3935;};'use strict';var Sequelize=require('sequelize');var _=require(_0x637c('0x0'));var util=require(_0x637c('0x1'));module[_0x637c('0x2')]={'name':{'type':Sequelize[_0x637c('0x3')],'unique':_0x637c('0x4')},'description':{'type':Sequelize[_0x637c('0x3')]},'formData':{'type':Sequelize[_0x637c('0x5')](_0x637c('0x6')),'set':function(_0x159245){if(_[_0x637c('0x7')](_0x159245)){this['setDataValue'](_0x637c('0x8'),JSON[_0x637c('0x9')](_0x159245));}else if(_[_0x637c('0xa')](_0x159245)){this[_0x637c('0xb')]('formData',_0x159245);}else{this['setDataValue'](_0x637c('0x8'),util[_0x637c('0xc')](_0x637c('0xd'),this['getDataValue'](_0x637c('0x4'))||'',this['getDataValue'](_0x637c('0xe'))||''));}}},'enableUncompleteSave':{'type':Sequelize[_0x637c('0xf')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0x637c('0xf')],'defaultValue':![]}}; \ No newline at end of file +var _0xd5ce=['stringify','isString','formData','format','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue','description','BOOLEAN','lodash','util','STRING','name','setDataValue'];(function(_0x585c86,_0x472ef9){var _0x26ce5d=function(_0x20beb4){while(--_0x20beb4){_0x585c86['push'](_0x585c86['shift']());}};_0x26ce5d(++_0x472ef9);}(_0xd5ce,0x1cf));var _0xed5c=function(_0x346bed,_0x4ddcc6){_0x346bed=_0x346bed-0x0;var _0x5cf76e=_0xd5ce[_0x346bed];return _0x5cf76e;};'use strict';var Sequelize=require('sequelize');var _=require(_0xed5c('0x0'));var util=require(_0xed5c('0x1'));module['exports']={'name':{'type':Sequelize[_0xed5c('0x2')],'unique':_0xed5c('0x3')},'description':{'type':Sequelize[_0xed5c('0x2')]},'formData':{'type':Sequelize['TEXT']('long'),'set':function(_0x25a810){if(_['isObjectLike'](_0x25a810)){this[_0xed5c('0x4')]('formData',JSON[_0xed5c('0x5')](_0x25a810));}else if(_[_0xed5c('0x6')](_0x25a810)){this[_0xed5c('0x4')](_0xed5c('0x7'),_0x25a810);}else{this['setDataValue'](_0xed5c('0x7'),util[_0xed5c('0x8')](_0xed5c('0x9'),this[_0xed5c('0xa')](_0xed5c('0x3'))||'',this[_0xed5c('0xa')](_0xed5c('0xb'))||''));}}},'enableUncompleteSave':{'type':Sequelize[_0xed5c('0xc')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0xed5c('0xc')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.controller.js b/server/api/jscriptyProject/jscriptyProject.controller.js index 9b459e2..8f27b9e 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 _0xcb9c=['updatedAt','Unable\x20to\x20retrieve\x20the\x20current\x20user','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getSessions','findOne','JscriptySessionReport','pick','ProjectId','getAnswers','JscriptyAnswerReport','hasOwnProperty','fromCharCode','toString','indexOf','getSummary','startTime','starttime','parse','JscriptyQuestionReport','-createdAt','questionId','question','answer','isEmpty','now','writeFileSync','format','/tmp/Jscripty_Project_%d_Summary_%s.csv','setHeader','Content-disposition','Jscripty_Project_%d_Summary_%s.csv','Content-type','text/csv','download','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','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','undefined','set','Content-Range','apply','update','then','destroy','get','Projects','UserProfileResource','sendStatus','stack','index','map','JscriptyProject','rawAttributes','fieldName','type','name','query','intersection','model','fields','attributes','length','nolimit','limit','order','sort','where','filters','filter','VIRTUAL','merge','options','count','includeAll','include','findAll','rows','show','params','keys','find','create','body','user','UserProfileSection','userProfileId','autoAssociation','error','catch','clone','omit','createdAt'];(function(_0xc735a3,_0x2aa18c){var _0x21d6a1=function(_0x28c9e0){while(--_0x28c9e0){_0xc735a3['push'](_0xc735a3['shift']());}};_0x21d6a1(++_0x2aa18c);}(_0xcb9c,0x110));var _0xccb9=function(_0x4e9e4c,_0x5013a9){_0x4e9e4c=_0x4e9e4c-0x0;var _0x2e065c=_0xcb9c[_0x4e9e4c];return _0x2e065c;};'use strict';var emlformat=require(_0xccb9('0x0'));var rimraf=require(_0xccb9('0x1'));var zipdir=require(_0xccb9('0x2'));var jsonpatch=require(_0xccb9('0x3'));var rp=require(_0xccb9('0x4'));var moment=require(_0xccb9('0x5'));var BPromise=require(_0xccb9('0x6'));var Mustache=require(_0xccb9('0x7'));var util=require('util');var path=require(_0xccb9('0x8'));var sox=require(_0xccb9('0x9'));var csv=require(_0xccb9('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xccb9('0xb'));var _=require(_0xccb9('0xc'));var squel=require(_0xccb9('0xd'));var crypto=require('crypto');var jsforce=require(_0xccb9('0xe'));var deskjs=require(_0xccb9('0xf'));var toCsv=require(_0xccb9('0xa'));var querystring=require(_0xccb9('0x10'));var Papa=require('papaparse');var Redis=require(_0xccb9('0x11'));var authService=require(_0xccb9('0x12'));var qs=require(_0xccb9('0x13'));var as=require(_0xccb9('0x14'));var hardwareService=require(_0xccb9('0x15'));var logger=require('../../config/logger')(_0xccb9('0x16'));var utils=require(_0xccb9('0x17'));var config=require(_0xccb9('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xccb9('0x19'))['db'];function respondWithStatusCode(_0x31ff60,_0x123ab6){_0x123ab6=_0x123ab6||0xcc;return function(_0xd80853){if(_0xd80853){return _0x31ff60['sendStatus'](_0x123ab6);}return _0x31ff60[_0xccb9('0x1a')](_0x123ab6)[_0xccb9('0x1b')]();};}function respondWithResult(_0x4542da,_0x317f41){_0x317f41=_0x317f41||0xc8;return function(_0x18a535){if(_0x18a535){return _0x4542da[_0xccb9('0x1a')](_0x317f41)[_0xccb9('0x1c')](_0x18a535);}};}function respondWithFilteredResult(_0x3c6784,_0x2fa3c8){return function(_0x587ab5){if(_0x587ab5){var _0xbcc64=typeof _0x2fa3c8[_0xccb9('0x1d')]===_0xccb9('0x1e')&&typeof _0x2fa3c8['limit']==='undefined';var _0x2fc874=_0x587ab5['count'];var _0x231b19=_0xbcc64?0x0:_0x2fa3c8[_0xccb9('0x1d')];var _0x53ab83=_0xbcc64?_0x587ab5['count']:_0x2fa3c8[_0xccb9('0x1d')]+_0x2fa3c8['limit'];var _0x58890f;if(_0x53ab83>=_0x2fc874){_0x53ab83=_0x2fc874;_0x58890f=0xc8;}else{_0x58890f=0xce;}_0x3c6784[_0xccb9('0x1a')](_0x58890f);return _0x3c6784[_0xccb9('0x1f')](_0xccb9('0x20'),_0x231b19+'-'+_0x53ab83+'/'+_0x2fc874)[_0xccb9('0x1c')](_0x587ab5);}return null;};}function patchUpdates(_0x28ae56){return function(_0x2eca45){try{jsonpatch[_0xccb9('0x21')](_0x2eca45,_0x28ae56,!![]);}catch(_0x13f7ec){return BPromise['reject'](_0x13f7ec);}return _0x2eca45['save']();};}function saveUpdates(_0x25fe91,_0x3f2e30){return function(_0x5e3133){if(_0x5e3133){return _0x5e3133[_0xccb9('0x22')](_0x25fe91)[_0xccb9('0x23')](function(_0x4c7e71){return _0x4c7e71;});}return null;};}function removeEntity(_0x40196c,_0x26504f){return function(_0x25d40f){if(_0x25d40f){return _0x25d40f[_0xccb9('0x24')]()[_0xccb9('0x23')](function(){var _0x2bf5df=_0x25d40f[_0xccb9('0x25')]({'plain':!![]});var _0x190cd7=_0xccb9('0x26');return db[_0xccb9('0x27')]['destroy']({'where':{'type':_0x190cd7,'resourceId':_0x2bf5df['id']}})['then'](function(){return _0x25d40f;});})[_0xccb9('0x23')](function(){_0x40196c[_0xccb9('0x1a')](0xcc)[_0xccb9('0x1b')]();});}};}function handleEntityNotFound(_0x1d1011,_0x15ee0c){return function(_0x569fd3){if(!_0x569fd3){_0x1d1011[_0xccb9('0x28')](0x194);}return _0x569fd3;};}function handleError(_0x4717d4,_0x2b44b4){_0x2b44b4=_0x2b44b4||0x1f4;return function(_0x3d76bd){logger['error'](_0x3d76bd[_0xccb9('0x29')]);if(_0x3d76bd['name']){delete _0x3d76bd['name'];}_0x4717d4[_0xccb9('0x1a')](_0x2b44b4)['send'](_0x3d76bd);};}exports[_0xccb9('0x2a')]=function(_0x289c56,_0x2680ad){var _0x56263c={},_0x570647={},_0x29e936={'count':0x0,'rows':[]};var _0x337ebf=_[_0xccb9('0x2b')](db[_0xccb9('0x2c')][_0xccb9('0x2d')],function(_0x1d34e2){return{'name':_0x1d34e2[_0xccb9('0x2e')],'type':_0x1d34e2[_0xccb9('0x2f')]['key']};});_0x570647['model']=_[_0xccb9('0x2b')](_0x337ebf,_0xccb9('0x30'));_0x570647[_0xccb9('0x31')]=_['keys'](_0x289c56['query']);_0x570647['filters']=_[_0xccb9('0x32')](_0x570647[_0xccb9('0x33')],_0x570647[_0xccb9('0x31')]);_0x56263c['attributes']=_[_0xccb9('0x32')](_0x570647['model'],qs[_0xccb9('0x34')](_0x289c56['query'][_0xccb9('0x34')]));_0x56263c[_0xccb9('0x35')]=_0x56263c[_0xccb9('0x35')][_0xccb9('0x36')]?_0x56263c['attributes']:_0x570647[_0xccb9('0x33')];if(!_0x289c56[_0xccb9('0x31')]['hasOwnProperty'](_0xccb9('0x37'))){_0x56263c['limit']=qs[_0xccb9('0x38')](_0x289c56[_0xccb9('0x31')][_0xccb9('0x38')]);_0x56263c[_0xccb9('0x1d')]=qs[_0xccb9('0x1d')](_0x289c56[_0xccb9('0x31')][_0xccb9('0x1d')]);}_0x56263c[_0xccb9('0x39')]=qs[_0xccb9('0x3a')](_0x289c56[_0xccb9('0x31')][_0xccb9('0x3a')]);_0x56263c[_0xccb9('0x3b')]=qs[_0xccb9('0x3c')](_['pick'](_0x289c56[_0xccb9('0x31')],_0x570647[_0xccb9('0x3c')]),_0x337ebf);if(_0x289c56[_0xccb9('0x31')][_0xccb9('0x3d')]){_0x56263c['where']=_['merge'](_0x56263c[_0xccb9('0x3b')],{'$or':_[_0xccb9('0x2b')](_0x337ebf,function(_0x24db60){if(_0x24db60['type']!==_0xccb9('0x3e')){var _0x5ab145={};_0x5ab145[_0x24db60[_0xccb9('0x30')]]={'$like':'%'+_0x289c56[_0xccb9('0x31')][_0xccb9('0x3d')]+'%'};return _0x5ab145;}})});}_0x56263c=_[_0xccb9('0x3f')]({},_0x56263c,_0x289c56[_0xccb9('0x40')]);var _0x3a2e9c={'where':_0x56263c[_0xccb9('0x3b')]};return db['JscriptyProject'][_0xccb9('0x41')](_0x3a2e9c)[_0xccb9('0x23')](function(_0x251c6b){_0x29e936[_0xccb9('0x41')]=_0x251c6b;if(_0x289c56[_0xccb9('0x31')][_0xccb9('0x42')]){_0x56263c[_0xccb9('0x43')]=[{'all':!![]}];}return db[_0xccb9('0x2c')][_0xccb9('0x44')](_0x56263c);})[_0xccb9('0x23')](function(_0x2d626b){_0x29e936[_0xccb9('0x45')]=_0x2d626b;return _0x29e936;})[_0xccb9('0x23')](respondWithFilteredResult(_0x2680ad,_0x56263c))['catch'](handleError(_0x2680ad,null));};exports[_0xccb9('0x46')]=function(_0x5215ba,_0x7d59ca){var _0x2e8f12={'raw':![],'where':{'id':_0x5215ba[_0xccb9('0x47')]['id']}},_0x4a65d8={};_0x4a65d8[_0xccb9('0x33')]=_['keys'](db[_0xccb9('0x2c')]['rawAttributes']);_0x4a65d8['query']=_[_0xccb9('0x48')](_0x5215ba['query']);_0x4a65d8[_0xccb9('0x3c')]=_[_0xccb9('0x32')](_0x4a65d8['model'],_0x4a65d8[_0xccb9('0x31')]);_0x2e8f12[_0xccb9('0x35')]=_['intersection'](_0x4a65d8[_0xccb9('0x33')],qs[_0xccb9('0x34')](_0x5215ba[_0xccb9('0x31')]['fields']));_0x2e8f12[_0xccb9('0x35')]=_0x2e8f12['attributes'][_0xccb9('0x36')]?_0x2e8f12[_0xccb9('0x35')]:_0x4a65d8[_0xccb9('0x33')];if(_0x5215ba[_0xccb9('0x31')][_0xccb9('0x42')]){_0x2e8f12[_0xccb9('0x43')]=[{'all':!![]}];}_0x2e8f12=_[_0xccb9('0x3f')]({},_0x2e8f12,_0x5215ba[_0xccb9('0x40')]);return db['JscriptyProject'][_0xccb9('0x49')](_0x2e8f12)[_0xccb9('0x23')](handleEntityNotFound(_0x7d59ca,null))[_0xccb9('0x23')](respondWithResult(_0x7d59ca,null))['catch'](handleError(_0x7d59ca,null));};exports[_0xccb9('0x4a')]=function(_0x2382fa,_0x345a4b){return db[_0xccb9('0x2c')][_0xccb9('0x4a')](_0x2382fa[_0xccb9('0x4b')],{})[_0xccb9('0x23')](function(_0x17414e){var _0x13dc97=_0x2382fa['user'][_0xccb9('0x25')]({'plain':!![]});if(!_0x13dc97)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x13dc97['role']===_0xccb9('0x4c')){var _0x246ddc=_0x17414e['get']({'plain':!![]});var _0xcbc9e3=_0xccb9('0x26');return db[_0xccb9('0x4d')][_0xccb9('0x49')]({'where':{'name':_0xcbc9e3,'userProfileId':_0x13dc97[_0xccb9('0x4e')]},'raw':!![]})['then'](function(_0x13280a){if(_0x13280a&&_0x13280a[_0xccb9('0x4f')]===0x0){return db[_0xccb9('0x27')][_0xccb9('0x4a')]({'name':_0x246ddc[_0xccb9('0x30')],'resourceId':_0x246ddc['id'],'type':_0x13280a['name'],'sectionId':_0x13280a['id']},{})['then'](function(){return _0x17414e;});}else{return _0x17414e;}})['catch'](function(_0x45df4d){logger[_0xccb9('0x50')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x45df4d);throw _0x45df4d;});}return _0x17414e;})[_0xccb9('0x23')](respondWithResult(_0x345a4b,0xc9))[_0xccb9('0x51')](handleError(_0x345a4b,null));};exports[_0xccb9('0x52')]=function(_0x2979cc,_0x5b11a0){var _0x42142c={'where':{'id':_0x2979cc[_0xccb9('0x47')]['id']}},_0x442c7a={};_0x442c7a['model']=_[_0xccb9('0x48')](db['JscriptyProject'][_0xccb9('0x2d')]);_0x42142c[_0xccb9('0x35')]=_[_0xccb9('0x32')](_0x442c7a[_0xccb9('0x33')],qs[_0xccb9('0x34')](_0x2979cc[_0xccb9('0x31')][_0xccb9('0x34')]));_0x42142c[_0xccb9('0x35')]=_0x42142c[_0xccb9('0x35')][_0xccb9('0x36')]?_0x42142c[_0xccb9('0x35')]:_0x442c7a[_0xccb9('0x33')];if(_0x2979cc[_0xccb9('0x31')][_0xccb9('0x42')]){_0x42142c['include']=[{'all':!![]}];}_0x42142c=_['merge']({},_0x42142c,_0x2979cc[_0xccb9('0x40')]);return db[_0xccb9('0x2c')][_0xccb9('0x49')](_0x42142c)[_0xccb9('0x23')](handleEntityNotFound(_0x5b11a0,null))[_0xccb9('0x23')](function(_0xae625a){if(_0xae625a){var _0x23f981=_0xae625a[_0xccb9('0x25')]({'plain':!![]});_0x23f981=qs[_0xccb9('0x53')](_0x23f981,['id','createdAt','updatedAt']);_0x2979cc[_0xccb9('0x4b')]=_[_0xccb9('0x53')](_0x2979cc[_0xccb9('0x4b')],['id',_0xccb9('0x54'),_0xccb9('0x55')]);return db[_0xccb9('0x2c')][_0xccb9('0x4a')](_[_0xccb9('0x3f')](_0x23f981,_0x2979cc[_0xccb9('0x4b')]),{'include':_0x2979cc[_0xccb9('0x31')][_0xccb9('0x42')]?[{'all':!![]}]:undefined})[_0xccb9('0x23')](function(_0x2274e6){var _0x3c623b=_0x2979cc['user'][_0xccb9('0x25')]({'plain':!![]});if(!_0x3c623b)throw new Error(_0xccb9('0x56'));if(_0x3c623b['role']===_0xccb9('0x4c')){var _0xd79de7=_0x2274e6[_0xccb9('0x25')]({'plain':!![]});var _0x9ad3db='Projects';return db['UserProfileSection']['find']({'where':{'name':_0x9ad3db,'userProfileId':_0x3c623b[_0xccb9('0x4e')]},'raw':!![]})[_0xccb9('0x23')](function(_0xbd51a0){if(_0xbd51a0&&_0xbd51a0[_0xccb9('0x4f')]===0x0){return db[_0xccb9('0x27')][_0xccb9('0x4a')]({'name':_0xd79de7['name'],'resourceId':_0xd79de7['id'],'type':_0xbd51a0[_0xccb9('0x30')],'sectionId':_0xbd51a0['id']},{})[_0xccb9('0x23')](function(){return _0x2274e6;});}else{return _0x2274e6;}})['catch'](function(_0x54147f){logger[_0xccb9('0x50')](_0xccb9('0x57'),_0x54147f);throw _0x54147f;});}return _0x2274e6;});}})[_0xccb9('0x23')](respondWithResult(_0x5b11a0,0xc9))['catch'](handleError(_0x5b11a0,null));};exports['update']=function(_0x2df544,_0x3cb87a){if(_0x2df544['body']['id']){delete _0x2df544[_0xccb9('0x4b')]['id'];}return db[_0xccb9('0x2c')][_0xccb9('0x49')]({'where':{'id':_0x2df544[_0xccb9('0x47')]['id']}})[_0xccb9('0x23')](handleEntityNotFound(_0x3cb87a,null))['then'](saveUpdates(_0x2df544[_0xccb9('0x4b')],null))['then'](respondWithResult(_0x3cb87a,null))[_0xccb9('0x51')](handleError(_0x3cb87a,null));};exports[_0xccb9('0x24')]=function(_0x5be2dc,_0x2db3aa){return db[_0xccb9('0x2c')]['find']({'where':{'id':_0x5be2dc[_0xccb9('0x47')]['id']}})['then'](handleEntityNotFound(_0x2db3aa,null))[_0xccb9('0x23')](removeEntity(_0x2db3aa,null))[_0xccb9('0x51')](handleError(_0x2db3aa,null));};exports[_0xccb9('0x58')]=function(_0x497cd9,_0x4e621e,_0x2276cb){var _0x6a7e72={'raw':!![],'where':{}};var _0x4a67b4={};var _0x53ab96={'count':0x0,'rows':[]};return db[_0xccb9('0x2c')][_0xccb9('0x59')]({'where':{'id':_0x497cd9[_0xccb9('0x47')]['id']}})[_0xccb9('0x23')](handleEntityNotFound(_0x4e621e,null))[_0xccb9('0x23')](function(_0x254e0b){if(_0x254e0b){_0x4a67b4[_0xccb9('0x33')]=_[_0xccb9('0x48')](db[_0xccb9('0x5a')][_0xccb9('0x2d')]);_0x4a67b4[_0xccb9('0x31')]=_[_0xccb9('0x48')](_0x497cd9['query']);_0x4a67b4[_0xccb9('0x3c')]=_[_0xccb9('0x32')](_0x4a67b4[_0xccb9('0x33')],_0x4a67b4[_0xccb9('0x31')]);_0x6a7e72[_0xccb9('0x35')]=_['intersection'](_0x4a67b4[_0xccb9('0x33')],qs[_0xccb9('0x34')](_0x497cd9['query'][_0xccb9('0x34')]));_0x6a7e72['attributes']=_0x6a7e72[_0xccb9('0x35')][_0xccb9('0x36')]?_0x6a7e72[_0xccb9('0x35')]:_0x4a67b4['model'];if(!_0x497cd9[_0xccb9('0x31')]['hasOwnProperty'](_0xccb9('0x37'))){_0x6a7e72['limit']=qs[_0xccb9('0x38')](_0x497cd9['query'][_0xccb9('0x38')]);_0x6a7e72[_0xccb9('0x1d')]=qs[_0xccb9('0x1d')](_0x497cd9[_0xccb9('0x31')][_0xccb9('0x1d')]);}_0x6a7e72['order']=qs[_0xccb9('0x3a')](_0x497cd9[_0xccb9('0x31')][_0xccb9('0x3a')]);_0x6a7e72[_0xccb9('0x3b')]=qs[_0xccb9('0x3c')](_[_0xccb9('0x5b')](_0x497cd9[_0xccb9('0x31')],_0x4a67b4[_0xccb9('0x3c')]));_0x6a7e72[_0xccb9('0x3b')][_0xccb9('0x5c')]=_0x254e0b['id'];if(_0x497cd9[_0xccb9('0x31')]['filter']){_0x6a7e72[_0xccb9('0x3b')]=_[_0xccb9('0x3f')](_0x6a7e72[_0xccb9('0x3b')],{'$or':_[_0xccb9('0x2b')](_0x6a7e72[_0xccb9('0x35')],function(_0x1302b0){var _0x16e620={};_0x16e620[_0x1302b0]={'$like':'%'+_0x497cd9['query']['filter']+'%'};return _0x16e620;})});}_0x6a7e72=_[_0xccb9('0x3f')]({},_0x6a7e72,_0x497cd9['options']);return db['JscriptySessionReport'][_0xccb9('0x41')]({'where':_0x6a7e72[_0xccb9('0x3b')]})[_0xccb9('0x23')](function(_0x307b72){_0x53ab96[_0xccb9('0x41')]=_0x307b72;if(_0x497cd9[_0xccb9('0x31')][_0xccb9('0x42')]){_0x6a7e72['include']=[{'all':!![]}];}return db[_0xccb9('0x5a')][_0xccb9('0x44')](_0x6a7e72);})[_0xccb9('0x23')](function(_0x14362f){_0x53ab96[_0xccb9('0x45')]=_0x14362f;return _0x53ab96;});}})[_0xccb9('0x23')](respondWithFilteredResult(_0x4e621e,_0x6a7e72))[_0xccb9('0x51')](handleError(_0x4e621e,null));};exports[_0xccb9('0x5d')]=function(_0x712710,_0x1ee5e8,_0x2bd519){var _0x1234f1={'raw':!![],'where':{}};var _0x4e7bd4={};var _0x3d106c={'count':0x0,'rows':[]};return db[_0xccb9('0x2c')]['findOne']({'where':{'id':_0x712710[_0xccb9('0x47')]['id']}})[_0xccb9('0x23')](handleEntityNotFound(_0x1ee5e8,null))['then'](function(_0x203606){if(_0x203606){_0x4e7bd4['model']=_[_0xccb9('0x48')](db[_0xccb9('0x5e')][_0xccb9('0x2d')]);_0x4e7bd4[_0xccb9('0x31')]=_[_0xccb9('0x48')](_0x712710[_0xccb9('0x31')]);_0x4e7bd4[_0xccb9('0x3c')]=_['intersection'](_0x4e7bd4[_0xccb9('0x33')],_0x4e7bd4[_0xccb9('0x31')]);_0x1234f1['attributes']=_[_0xccb9('0x32')](_0x4e7bd4['model'],qs[_0xccb9('0x34')](_0x712710[_0xccb9('0x31')][_0xccb9('0x34')]));_0x1234f1[_0xccb9('0x35')]=_0x1234f1[_0xccb9('0x35')][_0xccb9('0x36')]?_0x1234f1['attributes']:_0x4e7bd4[_0xccb9('0x33')];if(!_0x712710[_0xccb9('0x31')][_0xccb9('0x5f')](_0xccb9('0x37'))){_0x1234f1[_0xccb9('0x38')]=qs[_0xccb9('0x38')](_0x712710['query'][_0xccb9('0x38')]);_0x1234f1[_0xccb9('0x1d')]=qs['offset'](_0x712710[_0xccb9('0x31')][_0xccb9('0x1d')]);}_0x1234f1[_0xccb9('0x39')]=qs[_0xccb9('0x3a')](_0x712710[_0xccb9('0x31')]['sort']);_0x1234f1[_0xccb9('0x3b')]=qs['filters'](_[_0xccb9('0x5b')](_0x712710[_0xccb9('0x31')],_0x4e7bd4[_0xccb9('0x3c')]));_0x1234f1['where'][_0xccb9('0x5c')]=_0x203606['id'];if(_0x712710[_0xccb9('0x31')]['filter']){_0x1234f1[_0xccb9('0x3b')]=_['merge'](_0x1234f1[_0xccb9('0x3b')],{'$or':_['map'](_0x1234f1[_0xccb9('0x35')],function(_0x3c2a20){var _0x4e4367={};_0x4e4367[_0x3c2a20]={'$like':'%'+_0x712710[_0xccb9('0x31')][_0xccb9('0x3d')]+'%'};return _0x4e4367;})});}_0x1234f1=_[_0xccb9('0x3f')]({},_0x1234f1,_0x712710[_0xccb9('0x40')]);return db[_0xccb9('0x5e')][_0xccb9('0x41')]({'where':_0x1234f1[_0xccb9('0x3b')]})[_0xccb9('0x23')](function(_0x26a0d5){_0x3d106c[_0xccb9('0x41')]=_0x26a0d5;if(_0x712710[_0xccb9('0x31')][_0xccb9('0x42')]){_0x1234f1[_0xccb9('0x43')]=[{'all':!![]}];}return db['JscriptyAnswerReport']['findAll'](_0x1234f1);})[_0xccb9('0x23')](function(_0x239655){_0x3d106c['rows']=_0x239655;return _0x3d106c;});}})[_0xccb9('0x23')](respondWithFilteredResult(_0x1ee5e8,_0x1234f1))[_0xccb9('0x51')](handleError(_0x1ee5e8,null));};function char(_0x13ae32){return'number'===typeof _0x13ae32?String[_0xccb9('0x60')][_0xccb9('0x21')](null,arguments):_0x13ae32;}function needsEncapsulation(_0x24e631){return!!_0x24e631&&(_0x24e631[_0xccb9('0x61')]()[_0xccb9('0x62')](char(0xd))>=0x0||_0x24e631['toString']()[_0xccb9('0x62')](char(0xa))>=0x0||_0x24e631['toString']()[_0xccb9('0x62')](char(0x2c))>=0x0||_0x24e631[_0xccb9('0x61')]()['indexOf'](char(0x22))>=0x0);}function encapsulate(_0x244bee){var _0x15dae3=char(0x22),_0x5e95ba='\x5c'+char(0x22),_0x2141ac=_0x244bee['toString']()['replace'](new RegExp(_0x15dae3,'g'),_0x5e95ba);return _0x15dae3+_0x2141ac+_0x15dae3;}exports[_0xccb9('0x63')]=function(_0x10e7d5,_0x2bb9c4,_0x3efb9d){var _0xb65668,_0x378b96;var _0x16c40e={'where':{'ProjectId':_0x10e7d5[_0xccb9('0x47')]['id']}};if(_0x10e7d5[_0xccb9('0x31')][_0xccb9('0x64')]){_0x16c40e[_0xccb9('0x3b')][_0xccb9('0x65')]=JSON[_0xccb9('0x66')](_0x10e7d5['query']['startTime']);}return db[_0xccb9('0x5a')]['findAll'](_0x16c40e)['then'](handleEntityNotFound(_0x2bb9c4,null))['then'](function(_0x38b426){if(_0x38b426){_0xb65668=_0x38b426;return db[_0xccb9('0x67')]['findAll']({'where':{'SessionId':{'$in':_['map'](_0xb65668,'id')},'ProjectId':_0x10e7d5['params']['id']},'order':_0xccb9('0x68')});}})[_0xccb9('0x23')](handleEntityNotFound(_0x2bb9c4,null))[_0xccb9('0x23')](function(_0x12ddd9){if(_0x12ddd9){_0x378b96=_0x12ddd9;var _0x1dc390={};for(var _0x22efbf=0x0,_0x56a7e8=_0x378b96[_0xccb9('0x36')];_0x22efbf<_0x56a7e8;_0x22efbf++){if(!_0x1dc390[_0xccb9('0x5f')](_0x378b96[_0x22efbf][_0xccb9('0x69')])){_0x1dc390[_0x378b96[_0x22efbf]['questionId']]=needsEncapsulation(_0x378b96[_0x22efbf][_0xccb9('0x6a')])?encapsulate(_0x378b96[_0x22efbf]['question']):_0x378b96[_0x22efbf]['question'];}}var _0x3e02ea=[],_0x341916={};for(var _0x1cdd86=0x0,_0x49c074=_0xb65668['length'];_0x1cdd86<_0x49c074;_0x1cdd86++){_0x341916={'ProjectId':_0x10e7d5[_0xccb9('0x47')]['id'],'SessionId':_0xb65668[_0x1cdd86]['id'],'StartTime':moment(_0xb65668[_0x1cdd86][_0xccb9('0x65')])['format']('YYYY-MM-DD\x20HH:mm:ss')};for(var _0x32b6f8=0x0,_0x324f6a=_0x378b96['length'];_0x32b6f8<_0x324f6a;_0x32b6f8++){if(_0x378b96[_0x32b6f8]['SessionId']==_0xb65668[_0x1cdd86]['id']&&_0x1dc390['hasOwnProperty'](_0x378b96[_0x32b6f8][_0xccb9('0x69')])){_0x341916[_0x1dc390[_0x378b96[_0x32b6f8][_0xccb9('0x69')]]]=_0x378b96[_0x32b6f8][_0xccb9('0x6b')];}}for(var _0x2c56e1 in _0x1dc390){if(!_0x341916['hasOwnProperty'](_0x1dc390[_0x2c56e1])){_0x341916[_0x1dc390[_0x2c56e1]]=null;}}_0x3e02ea['push'](_0x341916);}return _0x3e02ea;}})[_0xccb9('0x23')](function(_0x37381b){if(!_[_0xccb9('0x6c')](_0x37381b)){var _0x110bde=toCsv(_0x37381b);var _0x27e2c2=Date[_0xccb9('0x6d')]();fs[_0xccb9('0x6e')](util[_0xccb9('0x6f')](_0xccb9('0x70'),_0x10e7d5[_0xccb9('0x47')]['id'],_0x27e2c2),_0x110bde);_0x2bb9c4[_0xccb9('0x71')](_0xccb9('0x72'),'attachment;\x20filename='+util[_0xccb9('0x6f')](_0xccb9('0x73'),_0x10e7d5[_0xccb9('0x47')]['id'],_0x27e2c2));_0x2bb9c4['setHeader'](_0xccb9('0x74'),_0xccb9('0x75'));return _0x2bb9c4[_0xccb9('0x76')](util[_0xccb9('0x6f')](_0xccb9('0x70'),_0x10e7d5[_0xccb9('0x47')]['id'],_0x27e2c2));}else{return _0x2bb9c4[_0xccb9('0x28')](0xcc);}})[_0xccb9('0x51')](handleError(_0x2bb9c4,null));}; \ No newline at end of file +var _0x4c8c=['reject','update','then','destroy','get','UserProfileResource','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filters','filter','where','VIRTUAL','merge','options','JscriptyProject','findAll','rows','catch','show','params','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Projects','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','includeAll','omit','updatedAt','createdAt','findOne','JscriptySessionReport','order','ProjectId','getAnswers','JscriptyAnswerReport','fromCharCode','apply','indexOf','toString','replace','getSummary','startTime','parse','JscriptyQuestionReport','-createdAt','questionId','question','starttime','format','SessionId','push','isEmpty','now','writeFileSync','/tmp/Jscripty_Project_%d_Summary_%s.csv','setHeader','Content-type','text/csv','download','eml-format','fast-json-patch','request-promise','moment','mustache','util','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/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range'];(function(_0xc5247e,_0x343c02){var _0xedb087=function(_0x1def02){while(--_0x1def02){_0xc5247e['push'](_0xc5247e['shift']());}};_0xedb087(++_0x343c02);}(_0x4c8c,0x1b3));var _0xc4c8=function(_0x3c4737,_0x2329ec){_0x3c4737=_0x3c4737-0x0;var _0x2bb926=_0x4c8c[_0x3c4737];return _0x2bb926;};'use strict';var emlformat=require(_0xc4c8('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xc4c8('0x1'));var rp=require(_0xc4c8('0x2'));var moment=require(_0xc4c8('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xc4c8('0x4'));var util=require(_0xc4c8('0x5'));var path=require('path');var sox=require(_0xc4c8('0x6'));var csv=require(_0xc4c8('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc4c8('0x8'));var _=require(_0xc4c8('0x9'));var squel=require(_0xc4c8('0xa'));var crypto=require(_0xc4c8('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xc4c8('0xc'));var toCsv=require(_0xc4c8('0x7'));var querystring=require('querystring');var Papa=require(_0xc4c8('0xd'));var Redis=require(_0xc4c8('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xc4c8('0xf'));var as=require(_0xc4c8('0x10'));var hardwareService=require(_0xc4c8('0x11'));var logger=require(_0xc4c8('0x12'))(_0xc4c8('0x13'));var utils=require(_0xc4c8('0x14'));var config=require(_0xc4c8('0x15'));var licenseUtil=require(_0xc4c8('0x16'));var db=require(_0xc4c8('0x17'))['db'];function respondWithStatusCode(_0x4eddfd,_0x25c8c5){_0x25c8c5=_0x25c8c5||0xcc;return function(_0x1af9e5){if(_0x1af9e5){return _0x4eddfd[_0xc4c8('0x18')](_0x25c8c5);}return _0x4eddfd[_0xc4c8('0x19')](_0x25c8c5)[_0xc4c8('0x1a')]();};}function respondWithResult(_0x19681d,_0x13c88f){_0x13c88f=_0x13c88f||0xc8;return function(_0x28f922){if(_0x28f922){return _0x19681d[_0xc4c8('0x19')](_0x13c88f)['json'](_0x28f922);}};}function respondWithFilteredResult(_0x2f0f06,_0x1fb608){return function(_0x43345c){if(_0x43345c){var _0x5b48dd=typeof _0x1fb608['offset']===_0xc4c8('0x1b')&&typeof _0x1fb608[_0xc4c8('0x1c')]==='undefined';var _0xb4e9fa=_0x43345c[_0xc4c8('0x1d')];var _0x1ee0fa=_0x5b48dd?0x0:_0x1fb608['offset'];var _0x365034=_0x5b48dd?_0x43345c[_0xc4c8('0x1d')]:_0x1fb608[_0xc4c8('0x1e')]+_0x1fb608['limit'];var _0x3eee84;if(_0x365034>=_0xb4e9fa){_0x365034=_0xb4e9fa;_0x3eee84=0xc8;}else{_0x3eee84=0xce;}_0x2f0f06[_0xc4c8('0x19')](_0x3eee84);return _0x2f0f06[_0xc4c8('0x1f')](_0xc4c8('0x20'),_0x1ee0fa+'-'+_0x365034+'/'+_0xb4e9fa)['json'](_0x43345c);}return null;};}function patchUpdates(_0xda36da){return function(_0x53ddfd){try{jsonpatch['apply'](_0x53ddfd,_0xda36da,!![]);}catch(_0x35b189){return BPromise[_0xc4c8('0x21')](_0x35b189);}return _0x53ddfd['save']();};}function saveUpdates(_0x116c67,_0x148215){return function(_0x1f9b68){if(_0x1f9b68){return _0x1f9b68[_0xc4c8('0x22')](_0x116c67)[_0xc4c8('0x23')](function(_0x2533f1){return _0x2533f1;});}return null;};}function removeEntity(_0x1c3ea9,_0x4404dd){return function(_0xedf812){if(_0xedf812){return _0xedf812[_0xc4c8('0x24')]()[_0xc4c8('0x23')](function(){var _0x2a0939=_0xedf812[_0xc4c8('0x25')]({'plain':!![]});var _0x21a0de='Projects';return db[_0xc4c8('0x26')][_0xc4c8('0x24')]({'where':{'type':_0x21a0de,'resourceId':_0x2a0939['id']}})[_0xc4c8('0x23')](function(){return _0xedf812;});})[_0xc4c8('0x23')](function(){_0x1c3ea9['status'](0xcc)[_0xc4c8('0x1a')]();});}};}function handleEntityNotFound(_0x4d2bef,_0x2d2ae4){return function(_0x8b3f0c){if(!_0x8b3f0c){_0x4d2bef[_0xc4c8('0x18')](0x194);}return _0x8b3f0c;};}function handleError(_0x4eced0,_0xd5106a){_0xd5106a=_0xd5106a||0x1f4;return function(_0x3e7b5b){logger[_0xc4c8('0x27')](_0x3e7b5b[_0xc4c8('0x28')]);if(_0x3e7b5b['name']){delete _0x3e7b5b[_0xc4c8('0x29')];}_0x4eced0[_0xc4c8('0x19')](_0xd5106a)[_0xc4c8('0x2a')](_0x3e7b5b);};}exports['index']=function(_0xa9b2c2,_0x747a32){var _0x32a38c={},_0x4599d7={},_0x55195a={'count':0x0,'rows':[]};var _0x149df1=_[_0xc4c8('0x2b')](db['JscriptyProject'][_0xc4c8('0x2c')],function(_0x43dfc0){return{'name':_0x43dfc0[_0xc4c8('0x2d')],'type':_0x43dfc0[_0xc4c8('0x2e')][_0xc4c8('0x2f')]};});_0x4599d7[_0xc4c8('0x30')]=_[_0xc4c8('0x2b')](_0x149df1,_0xc4c8('0x29'));_0x4599d7[_0xc4c8('0x31')]=_[_0xc4c8('0x32')](_0xa9b2c2[_0xc4c8('0x31')]);_0x4599d7['filters']=_[_0xc4c8('0x33')](_0x4599d7[_0xc4c8('0x30')],_0x4599d7[_0xc4c8('0x31')]);_0x32a38c[_0xc4c8('0x34')]=_[_0xc4c8('0x33')](_0x4599d7['model'],qs[_0xc4c8('0x35')](_0xa9b2c2[_0xc4c8('0x31')]['fields']));_0x32a38c['attributes']=_0x32a38c['attributes'][_0xc4c8('0x36')]?_0x32a38c[_0xc4c8('0x34')]:_0x4599d7[_0xc4c8('0x30')];if(!_0xa9b2c2[_0xc4c8('0x31')][_0xc4c8('0x37')](_0xc4c8('0x38'))){_0x32a38c[_0xc4c8('0x1c')]=qs[_0xc4c8('0x1c')](_0xa9b2c2[_0xc4c8('0x31')]['limit']);_0x32a38c['offset']=qs[_0xc4c8('0x1e')](_0xa9b2c2['query'][_0xc4c8('0x1e')]);}_0x32a38c['order']=qs[_0xc4c8('0x39')](_0xa9b2c2[_0xc4c8('0x31')][_0xc4c8('0x39')]);_0x32a38c['where']=qs['filters'](_[_0xc4c8('0x3a')](_0xa9b2c2[_0xc4c8('0x31')],_0x4599d7[_0xc4c8('0x3b')]),_0x149df1);if(_0xa9b2c2[_0xc4c8('0x31')][_0xc4c8('0x3c')]){_0x32a38c[_0xc4c8('0x3d')]=_['merge'](_0x32a38c[_0xc4c8('0x3d')],{'$or':_[_0xc4c8('0x2b')](_0x149df1,function(_0xab6fc5){if(_0xab6fc5[_0xc4c8('0x2e')]!==_0xc4c8('0x3e')){var _0x25c909={};_0x25c909[_0xab6fc5[_0xc4c8('0x29')]]={'$like':'%'+_0xa9b2c2[_0xc4c8('0x31')]['filter']+'%'};return _0x25c909;}})});}_0x32a38c=_[_0xc4c8('0x3f')]({},_0x32a38c,_0xa9b2c2[_0xc4c8('0x40')]);var _0x15e71a={'where':_0x32a38c[_0xc4c8('0x3d')]};return db['JscriptyProject'][_0xc4c8('0x1d')](_0x15e71a)[_0xc4c8('0x23')](function(_0xbdda33){_0x55195a['count']=_0xbdda33;if(_0xa9b2c2[_0xc4c8('0x31')]['includeAll']){_0x32a38c['include']=[{'all':!![]}];}return db[_0xc4c8('0x41')][_0xc4c8('0x42')](_0x32a38c);})[_0xc4c8('0x23')](function(_0x9aebe){_0x55195a[_0xc4c8('0x43')]=_0x9aebe;return _0x55195a;})[_0xc4c8('0x23')](respondWithFilteredResult(_0x747a32,_0x32a38c))[_0xc4c8('0x44')](handleError(_0x747a32,null));};exports[_0xc4c8('0x45')]=function(_0x1456d9,_0x41cb78){var _0x5a02fd={'raw':![],'where':{'id':_0x1456d9[_0xc4c8('0x46')]['id']}},_0x1b7f8f={};_0x1b7f8f['model']=_[_0xc4c8('0x32')](db[_0xc4c8('0x41')][_0xc4c8('0x2c')]);_0x1b7f8f['query']=_['keys'](_0x1456d9[_0xc4c8('0x31')]);_0x1b7f8f[_0xc4c8('0x3b')]=_[_0xc4c8('0x33')](_0x1b7f8f[_0xc4c8('0x30')],_0x1b7f8f[_0xc4c8('0x31')]);_0x5a02fd['attributes']=_[_0xc4c8('0x33')](_0x1b7f8f[_0xc4c8('0x30')],qs[_0xc4c8('0x35')](_0x1456d9['query']['fields']));_0x5a02fd[_0xc4c8('0x34')]=_0x5a02fd[_0xc4c8('0x34')][_0xc4c8('0x36')]?_0x5a02fd[_0xc4c8('0x34')]:_0x1b7f8f[_0xc4c8('0x30')];if(_0x1456d9[_0xc4c8('0x31')]['includeAll']){_0x5a02fd[_0xc4c8('0x47')]=[{'all':!![]}];}_0x5a02fd=_[_0xc4c8('0x3f')]({},_0x5a02fd,_0x1456d9[_0xc4c8('0x40')]);return db['JscriptyProject'][_0xc4c8('0x48')](_0x5a02fd)[_0xc4c8('0x23')](handleEntityNotFound(_0x41cb78,null))[_0xc4c8('0x23')](respondWithResult(_0x41cb78,null))[_0xc4c8('0x44')](handleError(_0x41cb78,null));};exports[_0xc4c8('0x49')]=function(_0x3fc031,_0x40f81a){return db[_0xc4c8('0x41')]['create'](_0x3fc031[_0xc4c8('0x4a')],{})[_0xc4c8('0x23')](function(_0x2ed6ea){var _0x15ba83=_0x3fc031[_0xc4c8('0x4b')][_0xc4c8('0x25')]({'plain':!![]});if(!_0x15ba83)throw new Error(_0xc4c8('0x4c'));if(_0x15ba83[_0xc4c8('0x4d')]===_0xc4c8('0x4b')){var _0x29c726=_0x2ed6ea[_0xc4c8('0x25')]({'plain':!![]});var _0x30feee=_0xc4c8('0x4e');return db[_0xc4c8('0x4f')][_0xc4c8('0x48')]({'where':{'name':_0x30feee,'userProfileId':_0x15ba83[_0xc4c8('0x50')]},'raw':!![]})[_0xc4c8('0x23')](function(_0x2cbfd8){if(_0x2cbfd8&&_0x2cbfd8[_0xc4c8('0x51')]===0x0){return db[_0xc4c8('0x26')]['create']({'name':_0x29c726[_0xc4c8('0x29')],'resourceId':_0x29c726['id'],'type':_0x2cbfd8[_0xc4c8('0x29')],'sectionId':_0x2cbfd8['id']},{})[_0xc4c8('0x23')](function(){return _0x2ed6ea;});}else{return _0x2ed6ea;}})[_0xc4c8('0x44')](function(_0x33b638){logger[_0xc4c8('0x27')](_0xc4c8('0x52'),_0x33b638);throw _0x33b638;});}return _0x2ed6ea;})[_0xc4c8('0x23')](respondWithResult(_0x40f81a,0xc9))[_0xc4c8('0x44')](handleError(_0x40f81a,null));};exports['clone']=function(_0xf1c86a,_0x2b33ee){var _0x5c73d0={'where':{'id':_0xf1c86a[_0xc4c8('0x46')]['id']}},_0x4dca2b={};_0x4dca2b[_0xc4c8('0x30')]=_[_0xc4c8('0x32')](db[_0xc4c8('0x41')][_0xc4c8('0x2c')]);_0x5c73d0[_0xc4c8('0x34')]=_[_0xc4c8('0x33')](_0x4dca2b[_0xc4c8('0x30')],qs['fields'](_0xf1c86a[_0xc4c8('0x31')][_0xc4c8('0x35')]));_0x5c73d0[_0xc4c8('0x34')]=_0x5c73d0[_0xc4c8('0x34')]['length']?_0x5c73d0[_0xc4c8('0x34')]:_0x4dca2b[_0xc4c8('0x30')];if(_0xf1c86a['query'][_0xc4c8('0x53')]){_0x5c73d0['include']=[{'all':!![]}];}_0x5c73d0=_[_0xc4c8('0x3f')]({},_0x5c73d0,_0xf1c86a[_0xc4c8('0x40')]);return db[_0xc4c8('0x41')]['find'](_0x5c73d0)[_0xc4c8('0x23')](handleEntityNotFound(_0x2b33ee,null))[_0xc4c8('0x23')](function(_0x294ef8){if(_0x294ef8){var _0x442c3d=_0x294ef8[_0xc4c8('0x25')]({'plain':!![]});_0x442c3d=qs[_0xc4c8('0x54')](_0x442c3d,['id','createdAt',_0xc4c8('0x55')]);_0xf1c86a['body']=_[_0xc4c8('0x54')](_0xf1c86a[_0xc4c8('0x4a')],['id',_0xc4c8('0x56'),_0xc4c8('0x55')]);return db['JscriptyProject'][_0xc4c8('0x49')](_[_0xc4c8('0x3f')](_0x442c3d,_0xf1c86a[_0xc4c8('0x4a')]),{'include':_0xf1c86a['query'][_0xc4c8('0x53')]?[{'all':!![]}]:undefined})[_0xc4c8('0x23')](function(_0x3a33c4){var _0x378635=_0xf1c86a[_0xc4c8('0x4b')][_0xc4c8('0x25')]({'plain':!![]});if(!_0x378635)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x378635['role']==='user'){var _0x2b9c07=_0x3a33c4[_0xc4c8('0x25')]({'plain':!![]});var _0x4fd9bd='Projects';return db[_0xc4c8('0x4f')][_0xc4c8('0x48')]({'where':{'name':_0x4fd9bd,'userProfileId':_0x378635[_0xc4c8('0x50')]},'raw':!![]})[_0xc4c8('0x23')](function(_0x15a1b6){if(_0x15a1b6&&_0x15a1b6[_0xc4c8('0x51')]===0x0){return db[_0xc4c8('0x26')][_0xc4c8('0x49')]({'name':_0x2b9c07[_0xc4c8('0x29')],'resourceId':_0x2b9c07['id'],'type':_0x15a1b6[_0xc4c8('0x29')],'sectionId':_0x15a1b6['id']},{})[_0xc4c8('0x23')](function(){return _0x3a33c4;});}else{return _0x3a33c4;}})[_0xc4c8('0x44')](function(_0x365e72){logger[_0xc4c8('0x27')](_0xc4c8('0x52'),_0x365e72);throw _0x365e72;});}return _0x3a33c4;});}})[_0xc4c8('0x23')](respondWithResult(_0x2b33ee,0xc9))[_0xc4c8('0x44')](handleError(_0x2b33ee,null));};exports[_0xc4c8('0x22')]=function(_0x1232d9,_0x384901){if(_0x1232d9[_0xc4c8('0x4a')]['id']){delete _0x1232d9[_0xc4c8('0x4a')]['id'];}return db[_0xc4c8('0x41')]['find']({'where':{'id':_0x1232d9[_0xc4c8('0x46')]['id']}})[_0xc4c8('0x23')](handleEntityNotFound(_0x384901,null))[_0xc4c8('0x23')](saveUpdates(_0x1232d9[_0xc4c8('0x4a')],null))['then'](respondWithResult(_0x384901,null))[_0xc4c8('0x44')](handleError(_0x384901,null));};exports['destroy']=function(_0x9e0355,_0x55c042){return db['JscriptyProject'][_0xc4c8('0x48')]({'where':{'id':_0x9e0355[_0xc4c8('0x46')]['id']}})['then'](handleEntityNotFound(_0x55c042,null))[_0xc4c8('0x23')](removeEntity(_0x55c042,null))['catch'](handleError(_0x55c042,null));};exports['getSessions']=function(_0x4e5d79,_0x184487,_0x26836b){var _0x311593={'raw':!![],'where':{}};var _0xa6490={};var _0x345e01={'count':0x0,'rows':[]};return db[_0xc4c8('0x41')][_0xc4c8('0x57')]({'where':{'id':_0x4e5d79[_0xc4c8('0x46')]['id']}})[_0xc4c8('0x23')](handleEntityNotFound(_0x184487,null))['then'](function(_0x5aa94e){if(_0x5aa94e){_0xa6490[_0xc4c8('0x30')]=_[_0xc4c8('0x32')](db[_0xc4c8('0x58')][_0xc4c8('0x2c')]);_0xa6490['query']=_[_0xc4c8('0x32')](_0x4e5d79['query']);_0xa6490[_0xc4c8('0x3b')]=_[_0xc4c8('0x33')](_0xa6490[_0xc4c8('0x30')],_0xa6490[_0xc4c8('0x31')]);_0x311593[_0xc4c8('0x34')]=_[_0xc4c8('0x33')](_0xa6490[_0xc4c8('0x30')],qs[_0xc4c8('0x35')](_0x4e5d79['query'][_0xc4c8('0x35')]));_0x311593[_0xc4c8('0x34')]=_0x311593[_0xc4c8('0x34')][_0xc4c8('0x36')]?_0x311593['attributes']:_0xa6490[_0xc4c8('0x30')];if(!_0x4e5d79[_0xc4c8('0x31')][_0xc4c8('0x37')](_0xc4c8('0x38'))){_0x311593[_0xc4c8('0x1c')]=qs['limit'](_0x4e5d79['query']['limit']);_0x311593[_0xc4c8('0x1e')]=qs[_0xc4c8('0x1e')](_0x4e5d79[_0xc4c8('0x31')][_0xc4c8('0x1e')]);}_0x311593[_0xc4c8('0x59')]=qs[_0xc4c8('0x39')](_0x4e5d79['query']['sort']);_0x311593[_0xc4c8('0x3d')]=qs['filters'](_[_0xc4c8('0x3a')](_0x4e5d79['query'],_0xa6490[_0xc4c8('0x3b')]));_0x311593['where'][_0xc4c8('0x5a')]=_0x5aa94e['id'];if(_0x4e5d79[_0xc4c8('0x31')][_0xc4c8('0x3c')]){_0x311593[_0xc4c8('0x3d')]=_[_0xc4c8('0x3f')](_0x311593[_0xc4c8('0x3d')],{'$or':_[_0xc4c8('0x2b')](_0x311593[_0xc4c8('0x34')],function(_0x2b4340){var _0x30e473={};_0x30e473[_0x2b4340]={'$like':'%'+_0x4e5d79['query']['filter']+'%'};return _0x30e473;})});}_0x311593=_[_0xc4c8('0x3f')]({},_0x311593,_0x4e5d79[_0xc4c8('0x40')]);return db['JscriptySessionReport'][_0xc4c8('0x1d')]({'where':_0x311593[_0xc4c8('0x3d')]})[_0xc4c8('0x23')](function(_0x36ccf4){_0x345e01['count']=_0x36ccf4;if(_0x4e5d79[_0xc4c8('0x31')][_0xc4c8('0x53')]){_0x311593[_0xc4c8('0x47')]=[{'all':!![]}];}return db['JscriptySessionReport'][_0xc4c8('0x42')](_0x311593);})[_0xc4c8('0x23')](function(_0x4e57ac){_0x345e01[_0xc4c8('0x43')]=_0x4e57ac;return _0x345e01;});}})['then'](respondWithFilteredResult(_0x184487,_0x311593))[_0xc4c8('0x44')](handleError(_0x184487,null));};exports[_0xc4c8('0x5b')]=function(_0x24251b,_0x55b29a,_0x5063da){var _0x57ff26={'raw':!![],'where':{}};var _0x32a8de={};var _0x3d8263={'count':0x0,'rows':[]};return db[_0xc4c8('0x41')]['findOne']({'where':{'id':_0x24251b[_0xc4c8('0x46')]['id']}})[_0xc4c8('0x23')](handleEntityNotFound(_0x55b29a,null))[_0xc4c8('0x23')](function(_0xba9f90){if(_0xba9f90){_0x32a8de[_0xc4c8('0x30')]=_[_0xc4c8('0x32')](db['JscriptyAnswerReport'][_0xc4c8('0x2c')]);_0x32a8de[_0xc4c8('0x31')]=_[_0xc4c8('0x32')](_0x24251b['query']);_0x32a8de[_0xc4c8('0x3b')]=_['intersection'](_0x32a8de[_0xc4c8('0x30')],_0x32a8de[_0xc4c8('0x31')]);_0x57ff26[_0xc4c8('0x34')]=_[_0xc4c8('0x33')](_0x32a8de[_0xc4c8('0x30')],qs[_0xc4c8('0x35')](_0x24251b['query'][_0xc4c8('0x35')]));_0x57ff26[_0xc4c8('0x34')]=_0x57ff26[_0xc4c8('0x34')][_0xc4c8('0x36')]?_0x57ff26[_0xc4c8('0x34')]:_0x32a8de[_0xc4c8('0x30')];if(!_0x24251b[_0xc4c8('0x31')][_0xc4c8('0x37')](_0xc4c8('0x38'))){_0x57ff26[_0xc4c8('0x1c')]=qs[_0xc4c8('0x1c')](_0x24251b['query'][_0xc4c8('0x1c')]);_0x57ff26[_0xc4c8('0x1e')]=qs[_0xc4c8('0x1e')](_0x24251b[_0xc4c8('0x31')][_0xc4c8('0x1e')]);}_0x57ff26['order']=qs['sort'](_0x24251b[_0xc4c8('0x31')][_0xc4c8('0x39')]);_0x57ff26['where']=qs[_0xc4c8('0x3b')](_[_0xc4c8('0x3a')](_0x24251b[_0xc4c8('0x31')],_0x32a8de[_0xc4c8('0x3b')]));_0x57ff26[_0xc4c8('0x3d')]['ProjectId']=_0xba9f90['id'];if(_0x24251b[_0xc4c8('0x31')]['filter']){_0x57ff26[_0xc4c8('0x3d')]=_[_0xc4c8('0x3f')](_0x57ff26['where'],{'$or':_[_0xc4c8('0x2b')](_0x57ff26[_0xc4c8('0x34')],function(_0x3ffe26){var _0x53cd5f={};_0x53cd5f[_0x3ffe26]={'$like':'%'+_0x24251b[_0xc4c8('0x31')]['filter']+'%'};return _0x53cd5f;})});}_0x57ff26=_[_0xc4c8('0x3f')]({},_0x57ff26,_0x24251b[_0xc4c8('0x40')]);return db[_0xc4c8('0x5c')][_0xc4c8('0x1d')]({'where':_0x57ff26[_0xc4c8('0x3d')]})['then'](function(_0x389c1e){_0x3d8263[_0xc4c8('0x1d')]=_0x389c1e;if(_0x24251b[_0xc4c8('0x31')][_0xc4c8('0x53')]){_0x57ff26['include']=[{'all':!![]}];}return db[_0xc4c8('0x5c')][_0xc4c8('0x42')](_0x57ff26);})[_0xc4c8('0x23')](function(_0x415b60){_0x3d8263[_0xc4c8('0x43')]=_0x415b60;return _0x3d8263;});}})[_0xc4c8('0x23')](respondWithFilteredResult(_0x55b29a,_0x57ff26))[_0xc4c8('0x44')](handleError(_0x55b29a,null));};function char(_0x2c02d9){return'number'===typeof _0x2c02d9?String[_0xc4c8('0x5d')][_0xc4c8('0x5e')](null,arguments):_0x2c02d9;}function needsEncapsulation(_0x392b98){return!!_0x392b98&&(_0x392b98['toString']()[_0xc4c8('0x5f')](char(0xd))>=0x0||_0x392b98[_0xc4c8('0x60')]()[_0xc4c8('0x5f')](char(0xa))>=0x0||_0x392b98['toString']()[_0xc4c8('0x5f')](char(0x2c))>=0x0||_0x392b98['toString']()[_0xc4c8('0x5f')](char(0x22))>=0x0);}function encapsulate(_0x3938bd){var _0x3f9304=char(0x22),_0x3be27c='\x5c'+char(0x22),_0x3bdfd2=_0x3938bd[_0xc4c8('0x60')]()[_0xc4c8('0x61')](new RegExp(_0x3f9304,'g'),_0x3be27c);return _0x3f9304+_0x3bdfd2+_0x3f9304;}exports[_0xc4c8('0x62')]=function(_0x3fb076,_0x1769e5,_0x41817a){var _0x391e73,_0x3cb387;var _0x18ebbe={'where':{'ProjectId':_0x3fb076[_0xc4c8('0x46')]['id']}};if(_0x3fb076[_0xc4c8('0x31')][_0xc4c8('0x63')]){_0x18ebbe['where']['starttime']=JSON[_0xc4c8('0x64')](_0x3fb076[_0xc4c8('0x31')][_0xc4c8('0x63')]);}return db[_0xc4c8('0x58')][_0xc4c8('0x42')](_0x18ebbe)[_0xc4c8('0x23')](handleEntityNotFound(_0x1769e5,null))['then'](function(_0x25ec5b){if(_0x25ec5b){_0x391e73=_0x25ec5b;return db[_0xc4c8('0x65')]['findAll']({'where':{'SessionId':{'$in':_[_0xc4c8('0x2b')](_0x391e73,'id')},'ProjectId':_0x3fb076[_0xc4c8('0x46')]['id']},'order':_0xc4c8('0x66')});}})[_0xc4c8('0x23')](handleEntityNotFound(_0x1769e5,null))['then'](function(_0x462804){if(_0x462804){_0x3cb387=_0x462804;var _0x194fdd={};for(var _0x58a3d8=0x0,_0x16c477=_0x3cb387[_0xc4c8('0x36')];_0x58a3d8<_0x16c477;_0x58a3d8++){if(!_0x194fdd[_0xc4c8('0x37')](_0x3cb387[_0x58a3d8]['questionId'])){_0x194fdd[_0x3cb387[_0x58a3d8][_0xc4c8('0x67')]]=needsEncapsulation(_0x3cb387[_0x58a3d8][_0xc4c8('0x68')])?encapsulate(_0x3cb387[_0x58a3d8][_0xc4c8('0x68')]):_0x3cb387[_0x58a3d8]['question'];}}var _0x2b1d37=[],_0x51af20={};for(var _0x175d71=0x0,_0x453a1f=_0x391e73[_0xc4c8('0x36')];_0x175d71<_0x453a1f;_0x175d71++){_0x51af20={'ProjectId':_0x3fb076[_0xc4c8('0x46')]['id'],'SessionId':_0x391e73[_0x175d71]['id'],'StartTime':moment(_0x391e73[_0x175d71][_0xc4c8('0x69')])[_0xc4c8('0x6a')]('YYYY-MM-DD\x20HH:mm:ss')};for(var _0x482c98=0x0,_0x1ecd36=_0x3cb387[_0xc4c8('0x36')];_0x482c98<_0x1ecd36;_0x482c98++){if(_0x3cb387[_0x482c98][_0xc4c8('0x6b')]==_0x391e73[_0x175d71]['id']&&_0x194fdd[_0xc4c8('0x37')](_0x3cb387[_0x482c98][_0xc4c8('0x67')])){_0x51af20[_0x194fdd[_0x3cb387[_0x482c98]['questionId']]]=_0x3cb387[_0x482c98]['answer'];}}for(var _0x511344 in _0x194fdd){if(!_0x51af20[_0xc4c8('0x37')](_0x194fdd[_0x511344])){_0x51af20[_0x194fdd[_0x511344]]=null;}}_0x2b1d37[_0xc4c8('0x6c')](_0x51af20);}return _0x2b1d37;}})[_0xc4c8('0x23')](function(_0x5e63ca){if(!_[_0xc4c8('0x6d')](_0x5e63ca)){var _0x17e60a=toCsv(_0x5e63ca);var _0x2318e5=Date[_0xc4c8('0x6e')]();fs[_0xc4c8('0x6f')](util[_0xc4c8('0x6a')](_0xc4c8('0x70'),_0x3fb076['params']['id'],_0x2318e5),_0x17e60a);_0x1769e5['setHeader']('Content-disposition','attachment;\x20filename='+util['format']('Jscripty_Project_%d_Summary_%s.csv',_0x3fb076['params']['id'],_0x2318e5));_0x1769e5[_0xc4c8('0x71')](_0xc4c8('0x72'),_0xc4c8('0x73'));return _0x1769e5[_0xc4c8('0x74')](util[_0xc4c8('0x6a')](_0xc4c8('0x70'),_0x3fb076[_0xc4c8('0x46')]['id'],_0x2318e5));}else{return _0x1769e5[_0xc4c8('0x18')](0xcc);}})[_0xc4c8('0x44')](handleError(_0x1769e5,null));}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.model.js b/server/api/jscriptyProject/jscriptyProject.model.js index c66ca95..a42c06b 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 _0xac0a=['bluebird','request-promise','path','rimraf','../../config/environment','./jscriptyProject.attributes','exports','define','JscriptyProject','jscripty_projects','../../config/logger','api'];(function(_0x4fd71c,_0x5f4771){var _0x36d0b7=function(_0x522922){while(--_0x522922){_0x4fd71c['push'](_0x4fd71c['shift']());}};_0x36d0b7(++_0x5f4771);}(_0xac0a,0x11e));var _0xaac0=function(_0x54dbb4,_0x5060b4){_0x54dbb4=_0x54dbb4-0x0;var _0x27f2a8=_0xac0a[_0x54dbb4];return _0x27f2a8;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xaac0('0x0'))(_0xaac0('0x1'));var moment=require('moment');var BPromise=require(_0xaac0('0x2'));var rp=require(_0xaac0('0x3'));var fs=require('fs');var path=require(_0xaac0('0x4'));var rimraf=require(_0xaac0('0x5'));var config=require(_0xaac0('0x6'));var attributes=require(_0xaac0('0x7'));module[_0xaac0('0x8')]=function(_0x1c92d1,_0x2cefc3){return _0x1c92d1[_0xaac0('0x9')](_0xaac0('0xa'),attributes,{'tableName':_0xaac0('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x615a=['path','../../config/environment','./jscriptyProject.attributes','define','JscriptyProject','jscripty_projects','lodash','../../config/logger','moment','bluebird','request-promise'];(function(_0x3fa7d3,_0x37f83c){var _0x4c51bd=function(_0x59e85b){while(--_0x59e85b){_0x3fa7d3['push'](_0x3fa7d3['shift']());}};_0x4c51bd(++_0x37f83c);}(_0x615a,0x119));var _0xa615=function(_0x4e82ff,_0x3cbf4b){_0x4e82ff=_0x4e82ff-0x0;var _0x495205=_0x615a[_0x4e82ff];return _0x495205;};'use strict';var _=require(_0xa615('0x0'));var util=require('util');var logger=require(_0xa615('0x1'))('api');var moment=require(_0xa615('0x2'));var BPromise=require(_0xa615('0x3'));var rp=require(_0xa615('0x4'));var fs=require('fs');var path=require(_0xa615('0x5'));var rimraf=require('rimraf');var config=require(_0xa615('0x6'));var attributes=require(_0xa615('0x7'));module['exports']=function(_0x320680,_0x5d04bd){return _0x320680[_0xa615('0x8')](_0xa615('0x9'),attributes,{'tableName':_0xa615('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.rpc.js b/server/api/jscriptyProject/jscriptyProject.rpc.js index 50f4410..7b6d5a0 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 _0xe706=['http','request','then','info','JscriptyProject,\x20%s,\x20%s','request\x20sent','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x5da266,_0x4a7810){var _0xfee066=function(_0x197eea){while(--_0x197eea){_0x5da266['push'](_0x5da266['shift']());}};_0xfee066(++_0x4a7810);}(_0xe706,0xa3));var _0x6e70=function(_0x48b5e0,_0xb3826){_0x48b5e0=_0x48b5e0-0x0;var _0x4287ea=_0xe706[_0x48b5e0];return _0x4287ea;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var moment=require(_0x6e70('0x2'));var BPromise=require('bluebird');var rs=require(_0x6e70('0x3'));var fs=require('fs');var Redis=require(_0x6e70('0x4'));var db=require(_0x6e70('0x5'))['db'];var utils=require(_0x6e70('0x6'));var logger=require(_0x6e70('0x7'))(_0x6e70('0x8'));var config=require(_0x6e70('0x9'));var jayson=require(_0x6e70('0xa'));var client=jayson[_0x6e70('0xb')][_0x6e70('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x36357b,_0x293ce7,_0x45a2d4){return new BPromise(function(_0x188ed3,_0x3c4843){return client[_0x6e70('0xd')](_0x36357b,_0x45a2d4)[_0x6e70('0xe')](function(_0x25e61c){logger[_0x6e70('0xf')](_0x6e70('0x10'),_0x293ce7,_0x6e70('0x11'));logger[_0x6e70('0x12')](_0x6e70('0x13'),_0x293ce7,_0x6e70('0x11'),JSON['stringify'](_0x25e61c));if(_0x25e61c['error']){if(_0x25e61c[_0x6e70('0x14')][_0x6e70('0x15')]===0x1f4){logger[_0x6e70('0x14')](_0x6e70('0x10'),_0x293ce7,_0x25e61c[_0x6e70('0x14')][_0x6e70('0x16')]);return _0x3c4843(_0x25e61c[_0x6e70('0x14')][_0x6e70('0x16')]);}logger['error']('JscriptyProject,\x20%s,\x20%s',_0x293ce7,_0x25e61c['error'][_0x6e70('0x16')]);return _0x188ed3(_0x25e61c['error']['message']);}else{logger[_0x6e70('0xf')](_0x6e70('0x10'),_0x293ce7,'request\x20sent');_0x188ed3(_0x25e61c[_0x6e70('0x17')]['message']);}})[_0x6e70('0x18')](function(_0x161f23){logger['error']('JscriptyProject,\x20%s,\x20%s',_0x293ce7,_0x161f23);_0x3c4843(_0x161f23);});});} \ No newline at end of file +var _0x54ef=['result','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','JscriptyProject,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message'];(function(_0x29fb12,_0x4dbcc2){var _0x331591=function(_0x48fcd4){while(--_0x48fcd4){_0x29fb12['push'](_0x29fb12['shift']());}};_0x331591(++_0x4dbcc2);}(_0x54ef,0x112));var _0xf54e=function(_0x34417e,_0x1427c6){_0x34417e=_0x34417e-0x0;var _0xaaa17e=_0x54ef[_0x34417e];return _0xaaa17e;};'use strict';var _=require(_0xf54e('0x0'));var util=require(_0xf54e('0x1'));var moment=require(_0xf54e('0x2'));var BPromise=require('bluebird');var rs=require(_0xf54e('0x3'));var fs=require('fs');var Redis=require(_0xf54e('0x4'));var db=require(_0xf54e('0x5'))['db'];var utils=require(_0xf54e('0x6'));var logger=require(_0xf54e('0x7'))(_0xf54e('0x8'));var config=require(_0xf54e('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0xf54e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x99cf9,_0x2464ae,_0x561870){return new BPromise(function(_0x27e69b,_0x57a1ce){return client[_0xf54e('0xb')](_0x99cf9,_0x561870)[_0xf54e('0xc')](function(_0x47c5e1){logger[_0xf54e('0xd')](_0xf54e('0xe'),_0x2464ae,_0xf54e('0xf'));logger[_0xf54e('0x10')]('JscriptyProject,\x20%s,\x20%s,\x20%s',_0x2464ae,_0xf54e('0xf'),JSON[_0xf54e('0x11')](_0x47c5e1));if(_0x47c5e1[_0xf54e('0x12')]){if(_0x47c5e1[_0xf54e('0x12')]['code']===0x1f4){logger[_0xf54e('0x12')]('JscriptyProject,\x20%s,\x20%s',_0x2464ae,_0x47c5e1['error'][_0xf54e('0x13')]);return _0x57a1ce(_0x47c5e1[_0xf54e('0x12')][_0xf54e('0x13')]);}logger[_0xf54e('0x12')]('JscriptyProject,\x20%s,\x20%s',_0x2464ae,_0x47c5e1[_0xf54e('0x12')][_0xf54e('0x13')]);return _0x27e69b(_0x47c5e1[_0xf54e('0x12')][_0xf54e('0x13')]);}else{logger['info'](_0xf54e('0xe'),_0x2464ae,_0xf54e('0xf'));_0x27e69b(_0x47c5e1[_0xf54e('0x14')]['message']);}})['catch'](function(_0xd87020){logger[_0xf54e('0x12')](_0xf54e('0xe'),_0x2464ae,_0xd87020);_0x57a1ce(_0xd87020);});});} \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/index.js b/server/api/jscriptyQuestionReport/index.js index 77c97ae..1f276b6 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 _0xa44b=['show','post','put','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./jscriptyQuestionReport.controller','get','isAuthenticated','index','/describe','describe','/:id'];(function(_0x421165,_0x1e9fa8){var _0x48e4dc=function(_0x3cf2a3){while(--_0x3cf2a3){_0x421165['push'](_0x421165['shift']());}};_0x48e4dc(++_0x1e9fa8);}(_0xa44b,0xc3));var _0xba44=function(_0xf5c66c,_0x2b59be){_0xf5c66c=_0xf5c66c-0x0;var _0x4cf978=_0xa44b[_0xf5c66c];return _0x4cf978;};'use strict';var multer=require('multer');var util=require(_0xba44('0x0'));var path=require(_0xba44('0x1'));var timeout=require(_0xba44('0x2'));var express=require(_0xba44('0x3'));var router=express[_0xba44('0x4')]();var fs_extra=require(_0xba44('0x5'));var auth=require(_0xba44('0x6'));var interaction=require(_0xba44('0x7'));var config=require('../../config/environment');var controller=require(_0xba44('0x8'));router[_0xba44('0x9')]('/',auth[_0xba44('0xa')](),controller[_0xba44('0xb')]);router[_0xba44('0x9')](_0xba44('0xc'),auth['isAuthenticated'](),controller[_0xba44('0xd')]);router['get'](_0xba44('0xe'),auth[_0xba44('0xa')](),controller[_0xba44('0xf')]);router[_0xba44('0x10')]('/',auth['isAuthenticated'](),controller['create']);router[_0xba44('0x11')]('/:id',auth[_0xba44('0xa')](),controller['update']);router[_0xba44('0x12')](_0xba44('0xe'),auth[_0xba44('0xa')](),controller[_0xba44('0x13')]);module[_0xba44('0x14')]=router; \ No newline at end of file +var _0xb359=['get','/:id','show','post','create','put','update','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyQuestionReport.controller','isAuthenticated','describe'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xb359,0x9b));var _0x9b35=function(_0xf6b3a,_0xde2ce1){_0xf6b3a=_0xf6b3a-0x0;var _0x566c16=_0xb359[_0xf6b3a];return _0x566c16;};'use strict';var multer=require(_0x9b35('0x0'));var util=require(_0x9b35('0x1'));var path=require(_0x9b35('0x2'));var timeout=require(_0x9b35('0x3'));var express=require(_0x9b35('0x4'));var router=express[_0x9b35('0x5')]();var fs_extra=require(_0x9b35('0x6'));var auth=require(_0x9b35('0x7'));var interaction=require(_0x9b35('0x8'));var config=require(_0x9b35('0x9'));var controller=require(_0x9b35('0xa'));router['get']('/',auth[_0x9b35('0xb')](),controller['index']);router['get']('/describe',auth['isAuthenticated'](),controller[_0x9b35('0xc')]);router[_0x9b35('0xd')](_0x9b35('0xe'),auth[_0x9b35('0xb')](),controller[_0x9b35('0xf')]);router[_0x9b35('0x10')]('/',auth[_0x9b35('0xb')](),controller[_0x9b35('0x11')]);router[_0x9b35('0x12')](_0x9b35('0xe'),auth['isAuthenticated'](),controller[_0x9b35('0x13')]);router['delete'](_0x9b35('0xe'),auth[_0x9b35('0xb')](),controller['destroy']);module[_0x9b35('0x14')]=router; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js index 893737b..5f64f18 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(_0x36c5b0,_0x5001da){var _0xf19333=function(_0x1e880a){while(--_0x1e880a){_0x36c5b0['push'](_0x36c5b0['shift']());}};_0xf19333(++_0x5001da);}(_0x7a54,0x106));var _0x47a5=function(_0x186ef1,_0x3fae0f){_0x186ef1=_0x186ef1-0x0;var _0x5095af=_0x7a54[_0x186ef1];return _0x5095af;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'question':{'type':Sequelize[_0x47a5('0x2')]},'answer':{'type':Sequelize['TEXT'](_0x47a5('0x3'))},'membername':{'type':Sequelize[_0x47a5('0x4')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x47a5('0x4')]},'uniqueid':{'type':Sequelize[_0x47a5('0x4')]},'calleridname':{'type':Sequelize[_0x47a5('0x4')]},'calleridnum':{'type':Sequelize[_0x47a5('0x4')]},'questionId':{'type':Sequelize[_0x47a5('0x4')]}}; \ No newline at end of file +var _0x7a54=['long','STRING','sequelize','exports','TEXT'];(function(_0x3d42d8,_0x4cffaa){var _0x27fc41=function(_0x3a363b){while(--_0x3a363b){_0x3d42d8['push'](_0x3d42d8['shift']());}};_0x27fc41(++_0x4cffaa);}(_0x7a54,0x106));var _0x47a5=function(_0x527a0a,_0x268b8d){_0x527a0a=_0x527a0a-0x0;var _0x396df2=_0x7a54[_0x527a0a];return _0x396df2;};'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 971c6e4..c8596e6 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 _0xd43f=['hasOwnProperty','nolimit','order','sort','where','filter','merge','JscriptyQuestionReport','includeAll','include','findAll','rows','catch','show','params','options','create','body','find','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','count','set','Content-Range','apply','reject','update','then','destroy','end','error','stack','name','send','index','rawAttributes','fieldName','type','model','map','query','keys','filters','intersection','fields','attributes','length'];(function(_0x41537a,_0x849b1){var _0x2af07e=function(_0x5bd971){while(--_0x5bd971){_0x41537a['push'](_0x41537a['shift']());}};_0x2af07e(++_0x849b1);}(_0xd43f,0xf8));var _0xfd43=function(_0x226494,_0xc4b645){_0x226494=_0x226494-0x0;var _0x27b950=_0xd43f[_0x226494];return _0x27b950;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xfd43('0x0'));var zipdir=require(_0xfd43('0x1'));var jsonpatch=require(_0xfd43('0x2'));var rp=require(_0xfd43('0x3'));var moment=require(_0xfd43('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xfd43('0x5'));var util=require(_0xfd43('0x6'));var path=require(_0xfd43('0x7'));var sox=require(_0xfd43('0x8'));var csv=require('to-csv');var ejs=require(_0xfd43('0x9'));var fs=require('fs');var fs_extra=require(_0xfd43('0xa'));var _=require(_0xfd43('0xb'));var squel=require(_0xfd43('0xc'));var crypto=require('crypto');var jsforce=require(_0xfd43('0xd'));var deskjs=require(_0xfd43('0xe'));var toCsv=require(_0xfd43('0xf'));var querystring=require(_0xfd43('0x10'));var Papa=require(_0xfd43('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xfd43('0x12'));var as=require(_0xfd43('0x13'));var hardwareService=require(_0xfd43('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0xfd43('0x15'));var config=require(_0xfd43('0x16'));var licenseUtil=require(_0xfd43('0x17'));var db=require(_0xfd43('0x18'))['db'];function respondWithStatusCode(_0xfcac35,_0x505194){_0x505194=_0x505194||0xcc;return function(_0x190e42){if(_0x190e42){return _0xfcac35[_0xfd43('0x19')](_0x505194);}return _0xfcac35[_0xfd43('0x1a')](_0x505194)['end']();};}function respondWithResult(_0x5f4abe,_0x2f29f7){_0x2f29f7=_0x2f29f7||0xc8;return function(_0x1adabc){if(_0x1adabc){return _0x5f4abe[_0xfd43('0x1a')](_0x2f29f7)[_0xfd43('0x1b')](_0x1adabc);}};}function respondWithFilteredResult(_0x325c7f,_0x5a3a64){return function(_0x2047c0){if(_0x2047c0){var _0x12eaab=typeof _0x5a3a64[_0xfd43('0x1c')]==='undefined'&&typeof _0x5a3a64[_0xfd43('0x1d')]==='undefined';var _0x4031b7=_0x2047c0[_0xfd43('0x1e')];var _0x26bbe8=_0x12eaab?0x0:_0x5a3a64[_0xfd43('0x1c')];var _0x48310b=_0x12eaab?_0x2047c0['count']:_0x5a3a64[_0xfd43('0x1c')]+_0x5a3a64[_0xfd43('0x1d')];var _0x3c6031;if(_0x48310b>=_0x4031b7){_0x48310b=_0x4031b7;_0x3c6031=0xc8;}else{_0x3c6031=0xce;}_0x325c7f[_0xfd43('0x1a')](_0x3c6031);return _0x325c7f[_0xfd43('0x1f')](_0xfd43('0x20'),_0x26bbe8+'-'+_0x48310b+'/'+_0x4031b7)['json'](_0x2047c0);}return null;};}function patchUpdates(_0x4fbe10){return function(_0x56e9c5){try{jsonpatch[_0xfd43('0x21')](_0x56e9c5,_0x4fbe10,!![]);}catch(_0x559605){return BPromise[_0xfd43('0x22')](_0x559605);}return _0x56e9c5['save']();};}function saveUpdates(_0x52e60f,_0x1b0aba){return function(_0xcafd9b){if(_0xcafd9b){return _0xcafd9b[_0xfd43('0x23')](_0x52e60f)[_0xfd43('0x24')](function(_0x1e4534){return _0x1e4534;});}return null;};}function removeEntity(_0x546502,_0x357a86){return function(_0x4614a1){if(_0x4614a1){return _0x4614a1[_0xfd43('0x25')]()[_0xfd43('0x24')](function(){_0x546502[_0xfd43('0x1a')](0xcc)[_0xfd43('0x26')]();});}};}function handleEntityNotFound(_0x351825,_0x36e9c7){return function(_0x898ac6){if(!_0x898ac6){_0x351825[_0xfd43('0x19')](0x194);}return _0x898ac6;};}function handleError(_0x5bba8d,_0x35bf18){_0x35bf18=_0x35bf18||0x1f4;return function(_0x4ee67a){logger[_0xfd43('0x27')](_0x4ee67a[_0xfd43('0x28')]);if(_0x4ee67a[_0xfd43('0x29')]){delete _0x4ee67a[_0xfd43('0x29')];}_0x5bba8d[_0xfd43('0x1a')](_0x35bf18)[_0xfd43('0x2a')](_0x4ee67a);};}exports[_0xfd43('0x2b')]=function(_0x9bb699,_0x23f19a){var _0x38a53={},_0x5f6d3={},_0x4e1add={'count':0x0,'rows':[]};var _0x15500b=_['map'](db['JscriptyQuestionReport'][_0xfd43('0x2c')],function(_0x406b34){return{'name':_0x406b34[_0xfd43('0x2d')],'type':_0x406b34[_0xfd43('0x2e')]['key']};});_0x5f6d3[_0xfd43('0x2f')]=_[_0xfd43('0x30')](_0x15500b,'name');_0x5f6d3[_0xfd43('0x31')]=_[_0xfd43('0x32')](_0x9bb699[_0xfd43('0x31')]);_0x5f6d3[_0xfd43('0x33')]=_[_0xfd43('0x34')](_0x5f6d3[_0xfd43('0x2f')],_0x5f6d3['query']);_0x38a53['attributes']=_[_0xfd43('0x34')](_0x5f6d3[_0xfd43('0x2f')],qs[_0xfd43('0x35')](_0x9bb699[_0xfd43('0x31')][_0xfd43('0x35')]));_0x38a53[_0xfd43('0x36')]=_0x38a53[_0xfd43('0x36')][_0xfd43('0x37')]?_0x38a53[_0xfd43('0x36')]:_0x5f6d3[_0xfd43('0x2f')];if(!_0x9bb699[_0xfd43('0x31')][_0xfd43('0x38')](_0xfd43('0x39'))){_0x38a53[_0xfd43('0x1d')]=qs[_0xfd43('0x1d')](_0x9bb699[_0xfd43('0x31')][_0xfd43('0x1d')]);_0x38a53[_0xfd43('0x1c')]=qs[_0xfd43('0x1c')](_0x9bb699[_0xfd43('0x31')][_0xfd43('0x1c')]);}_0x38a53[_0xfd43('0x3a')]=qs[_0xfd43('0x3b')](_0x9bb699['query'][_0xfd43('0x3b')]);_0x38a53[_0xfd43('0x3c')]=qs['filters'](_['pick'](_0x9bb699['query'],_0x5f6d3[_0xfd43('0x33')]),_0x15500b);if(_0x9bb699['query'][_0xfd43('0x3d')]){_0x38a53[_0xfd43('0x3c')]=_['merge'](_0x38a53[_0xfd43('0x3c')],{'$or':_[_0xfd43('0x30')](_0x15500b,function(_0x2c61e7){if(_0x2c61e7[_0xfd43('0x2e')]!=='VIRTUAL'){var _0x37d725={};_0x37d725[_0x2c61e7[_0xfd43('0x29')]]={'$like':'%'+_0x9bb699[_0xfd43('0x31')][_0xfd43('0x3d')]+'%'};return _0x37d725;}})});}_0x38a53=_[_0xfd43('0x3e')]({},_0x38a53,_0x9bb699['options']);var _0x9ca59a={'where':_0x38a53[_0xfd43('0x3c')]};return db[_0xfd43('0x3f')][_0xfd43('0x1e')](_0x9ca59a)['then'](function(_0x3438ba){_0x4e1add[_0xfd43('0x1e')]=_0x3438ba;if(_0x9bb699[_0xfd43('0x31')][_0xfd43('0x40')]){_0x38a53[_0xfd43('0x41')]=[{'all':!![]}];}return db[_0xfd43('0x3f')][_0xfd43('0x42')](_0x38a53);})[_0xfd43('0x24')](function(_0x52fdd1){_0x4e1add[_0xfd43('0x43')]=_0x52fdd1;return _0x4e1add;})[_0xfd43('0x24')](respondWithFilteredResult(_0x23f19a,_0x38a53))[_0xfd43('0x44')](handleError(_0x23f19a,null));};exports[_0xfd43('0x45')]=function(_0x5cdfb8,_0xdc6b0f){var _0x2f4979={'raw':!![],'where':{'id':_0x5cdfb8[_0xfd43('0x46')]['id']}},_0x1624a5={};_0x1624a5[_0xfd43('0x2f')]=_[_0xfd43('0x32')](db[_0xfd43('0x3f')][_0xfd43('0x2c')]);_0x1624a5[_0xfd43('0x31')]=_[_0xfd43('0x32')](_0x5cdfb8[_0xfd43('0x31')]);_0x1624a5[_0xfd43('0x33')]=_['intersection'](_0x1624a5[_0xfd43('0x2f')],_0x1624a5[_0xfd43('0x31')]);_0x2f4979[_0xfd43('0x36')]=_[_0xfd43('0x34')](_0x1624a5[_0xfd43('0x2f')],qs['fields'](_0x5cdfb8[_0xfd43('0x31')][_0xfd43('0x35')]));_0x2f4979[_0xfd43('0x36')]=_0x2f4979[_0xfd43('0x36')][_0xfd43('0x37')]?_0x2f4979['attributes']:_0x1624a5[_0xfd43('0x2f')];if(_0x5cdfb8[_0xfd43('0x31')][_0xfd43('0x40')]){_0x2f4979[_0xfd43('0x41')]=[{'all':!![]}];}_0x2f4979=_['merge']({},_0x2f4979,_0x5cdfb8[_0xfd43('0x47')]);return db[_0xfd43('0x3f')]['find'](_0x2f4979)['then'](handleEntityNotFound(_0xdc6b0f,null))[_0xfd43('0x24')](respondWithResult(_0xdc6b0f,null))['catch'](handleError(_0xdc6b0f,null));};exports[_0xfd43('0x48')]=function(_0x183b63,_0x13f072){return db[_0xfd43('0x3f')][_0xfd43('0x48')](_0x183b63[_0xfd43('0x49')],{})[_0xfd43('0x24')](respondWithResult(_0x13f072,0xc9))[_0xfd43('0x44')](handleError(_0x13f072,null));};exports[_0xfd43('0x23')]=function(_0x591a94,_0x56fecc){if(_0x591a94[_0xfd43('0x49')]['id']){delete _0x591a94[_0xfd43('0x49')]['id'];}return db['JscriptyQuestionReport'][_0xfd43('0x4a')]({'where':{'id':_0x591a94['params']['id']}})['then'](handleEntityNotFound(_0x56fecc,null))[_0xfd43('0x24')](saveUpdates(_0x591a94[_0xfd43('0x49')],null))[_0xfd43('0x24')](respondWithResult(_0x56fecc,null))[_0xfd43('0x44')](handleError(_0x56fecc,null));};exports[_0xfd43('0x25')]=function(_0x4d3ef9,_0x4fd35b){return db[_0xfd43('0x3f')][_0xfd43('0x4a')]({'where':{'id':_0x4d3ef9[_0xfd43('0x46')]['id']}})[_0xfd43('0x24')](handleEntityNotFound(_0x4fd35b,null))['then'](removeEntity(_0x4fd35b,null))['catch'](handleError(_0x4fd35b,null));};exports[_0xfd43('0x4b')]=function(_0x3c51c2,_0x5b6d75){return db[_0xfd43('0x3f')][_0xfd43('0x4b')]()[_0xfd43('0x24')](respondWithResult(_0x5b6d75,null))['catch'](handleError(_0x5b6d75,null));}; \ No newline at end of file +var _0xff00=['fs-extra','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','undefined','count','offset','limit','apply','save','update','then','destroy','sendStatus','name','send','map','fieldName','type','key','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','JscriptyQuestionReport','includeAll','include','findAll','catch','params','rawAttributes','keys','find','create','body','describe','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','ejs'];(function(_0x26cc16,_0x4c174f){var _0x345e3e=function(_0x14b4f8){while(--_0x14b4f8){_0x26cc16['push'](_0x26cc16['shift']());}};_0x345e3e(++_0x4c174f);}(_0xff00,0x114));var _0x0ff0=function(_0x5ca6f8,_0x2a0365){_0x5ca6f8=_0x5ca6f8-0x0;var _0x1d7ef5=_0xff00[_0x5ca6f8];return _0x1d7ef5;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x0ff0('0x0'));var jsonpatch=require(_0x0ff0('0x1'));var rp=require('request-promise');var moment=require(_0x0ff0('0x2'));var BPromise=require(_0x0ff0('0x3'));var Mustache=require(_0x0ff0('0x4'));var util=require(_0x0ff0('0x5'));var path=require('path');var sox=require(_0x0ff0('0x6'));var csv=require('to-csv');var ejs=require(_0x0ff0('0x7'));var fs=require('fs');var fs_extra=require(_0x0ff0('0x8'));var _=require('lodash');var squel=require(_0x0ff0('0x9'));var crypto=require(_0x0ff0('0xa'));var jsforce=require(_0x0ff0('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x0ff0('0xc'));var querystring=require(_0x0ff0('0xd'));var Papa=require(_0x0ff0('0xe'));var Redis=require(_0x0ff0('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x0ff0('0x10'));var as=require(_0x0ff0('0x11'));var hardwareService=require(_0x0ff0('0x12'));var logger=require('../../config/logger')(_0x0ff0('0x13'));var utils=require(_0x0ff0('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x0ff0('0x15'));var db=require(_0x0ff0('0x16'))['db'];function respondWithStatusCode(_0x3c0469,_0x57053e){_0x57053e=_0x57053e||0xcc;return function(_0x86fe65){if(_0x86fe65){return _0x3c0469['sendStatus'](_0x57053e);}return _0x3c0469[_0x0ff0('0x17')](_0x57053e)[_0x0ff0('0x18')]();};}function respondWithResult(_0x382c51,_0x3b86e8){_0x3b86e8=_0x3b86e8||0xc8;return function(_0x3ce5d4){if(_0x3ce5d4){return _0x382c51['status'](_0x3b86e8)[_0x0ff0('0x19')](_0x3ce5d4);}};}function respondWithFilteredResult(_0x291b23,_0x53245c){return function(_0x5308a0){if(_0x5308a0){var _0x455f66=typeof _0x53245c['offset']===_0x0ff0('0x1a')&&typeof _0x53245c['limit']===_0x0ff0('0x1a');var _0x1688f4=_0x5308a0[_0x0ff0('0x1b')];var _0x490af4=_0x455f66?0x0:_0x53245c[_0x0ff0('0x1c')];var _0x4d858b=_0x455f66?_0x5308a0[_0x0ff0('0x1b')]:_0x53245c['offset']+_0x53245c[_0x0ff0('0x1d')];var _0x2e9907;if(_0x4d858b>=_0x1688f4){_0x4d858b=_0x1688f4;_0x2e9907=0xc8;}else{_0x2e9907=0xce;}_0x291b23[_0x0ff0('0x17')](_0x2e9907);return _0x291b23['set']('Content-Range',_0x490af4+'-'+_0x4d858b+'/'+_0x1688f4)['json'](_0x5308a0);}return null;};}function patchUpdates(_0x583c79){return function(_0x4377bf){try{jsonpatch[_0x0ff0('0x1e')](_0x4377bf,_0x583c79,!![]);}catch(_0x5c959b){return BPromise['reject'](_0x5c959b);}return _0x4377bf[_0x0ff0('0x1f')]();};}function saveUpdates(_0x369dee,_0x585fd4){return function(_0x3692a6){if(_0x3692a6){return _0x3692a6[_0x0ff0('0x20')](_0x369dee)[_0x0ff0('0x21')](function(_0x12070d){return _0x12070d;});}return null;};}function removeEntity(_0x406480,_0x1b0418){return function(_0x1f6fe0){if(_0x1f6fe0){return _0x1f6fe0[_0x0ff0('0x22')]()[_0x0ff0('0x21')](function(){_0x406480[_0x0ff0('0x17')](0xcc)[_0x0ff0('0x18')]();});}};}function handleEntityNotFound(_0x49f3db,_0x191acc){return function(_0x553b03){if(!_0x553b03){_0x49f3db[_0x0ff0('0x23')](0x194);}return _0x553b03;};}function handleError(_0x466884,_0x32f1a0){_0x32f1a0=_0x32f1a0||0x1f4;return function(_0x79e773){logger['error'](_0x79e773['stack']);if(_0x79e773[_0x0ff0('0x24')]){delete _0x79e773[_0x0ff0('0x24')];}_0x466884[_0x0ff0('0x17')](_0x32f1a0)[_0x0ff0('0x25')](_0x79e773);};}exports['index']=function(_0x53e4ac,_0x397256){var _0x3abeb8={},_0x56e6f2={},_0x4c1589={'count':0x0,'rows':[]};var _0x855754=_[_0x0ff0('0x26')](db['JscriptyQuestionReport']['rawAttributes'],function(_0x2f44c7){return{'name':_0x2f44c7[_0x0ff0('0x27')],'type':_0x2f44c7[_0x0ff0('0x28')][_0x0ff0('0x29')]};});_0x56e6f2['model']=_[_0x0ff0('0x26')](_0x855754,_0x0ff0('0x24'));_0x56e6f2[_0x0ff0('0x2a')]=_['keys'](_0x53e4ac['query']);_0x56e6f2[_0x0ff0('0x2b')]=_[_0x0ff0('0x2c')](_0x56e6f2['model'],_0x56e6f2[_0x0ff0('0x2a')]);_0x3abeb8['attributes']=_[_0x0ff0('0x2c')](_0x56e6f2[_0x0ff0('0x2d')],qs['fields'](_0x53e4ac['query'][_0x0ff0('0x2e')]));_0x3abeb8[_0x0ff0('0x2f')]=_0x3abeb8['attributes'][_0x0ff0('0x30')]?_0x3abeb8[_0x0ff0('0x2f')]:_0x56e6f2['model'];if(!_0x53e4ac[_0x0ff0('0x2a')][_0x0ff0('0x31')](_0x0ff0('0x32'))){_0x3abeb8['limit']=qs[_0x0ff0('0x1d')](_0x53e4ac[_0x0ff0('0x2a')][_0x0ff0('0x1d')]);_0x3abeb8[_0x0ff0('0x1c')]=qs[_0x0ff0('0x1c')](_0x53e4ac[_0x0ff0('0x2a')]['offset']);}_0x3abeb8[_0x0ff0('0x33')]=qs[_0x0ff0('0x34')](_0x53e4ac[_0x0ff0('0x2a')][_0x0ff0('0x34')]);_0x3abeb8[_0x0ff0('0x35')]=qs[_0x0ff0('0x2b')](_[_0x0ff0('0x36')](_0x53e4ac['query'],_0x56e6f2[_0x0ff0('0x2b')]),_0x855754);if(_0x53e4ac[_0x0ff0('0x2a')]['filter']){_0x3abeb8['where']=_[_0x0ff0('0x37')](_0x3abeb8[_0x0ff0('0x35')],{'$or':_['map'](_0x855754,function(_0x39a30e){if(_0x39a30e['type']!==_0x0ff0('0x38')){var _0x331b56={};_0x331b56[_0x39a30e[_0x0ff0('0x24')]]={'$like':'%'+_0x53e4ac[_0x0ff0('0x2a')][_0x0ff0('0x39')]+'%'};return _0x331b56;}})});}_0x3abeb8=_[_0x0ff0('0x37')]({},_0x3abeb8,_0x53e4ac[_0x0ff0('0x3a')]);var _0x56ad50={'where':_0x3abeb8['where']};return db[_0x0ff0('0x3b')][_0x0ff0('0x1b')](_0x56ad50)[_0x0ff0('0x21')](function(_0xb01ee){_0x4c1589[_0x0ff0('0x1b')]=_0xb01ee;if(_0x53e4ac[_0x0ff0('0x2a')][_0x0ff0('0x3c')]){_0x3abeb8[_0x0ff0('0x3d')]=[{'all':!![]}];}return db[_0x0ff0('0x3b')][_0x0ff0('0x3e')](_0x3abeb8);})[_0x0ff0('0x21')](function(_0xdfe9da){_0x4c1589['rows']=_0xdfe9da;return _0x4c1589;})[_0x0ff0('0x21')](respondWithFilteredResult(_0x397256,_0x3abeb8))[_0x0ff0('0x3f')](handleError(_0x397256,null));};exports['show']=function(_0x43b14f,_0x9a5980){var _0x251a33={'raw':!![],'where':{'id':_0x43b14f[_0x0ff0('0x40')]['id']}},_0x5ae671={};_0x5ae671['model']=_['keys'](db[_0x0ff0('0x3b')][_0x0ff0('0x41')]);_0x5ae671[_0x0ff0('0x2a')]=_[_0x0ff0('0x42')](_0x43b14f[_0x0ff0('0x2a')]);_0x5ae671[_0x0ff0('0x2b')]=_[_0x0ff0('0x2c')](_0x5ae671[_0x0ff0('0x2d')],_0x5ae671[_0x0ff0('0x2a')]);_0x251a33[_0x0ff0('0x2f')]=_[_0x0ff0('0x2c')](_0x5ae671[_0x0ff0('0x2d')],qs[_0x0ff0('0x2e')](_0x43b14f[_0x0ff0('0x2a')]['fields']));_0x251a33['attributes']=_0x251a33[_0x0ff0('0x2f')][_0x0ff0('0x30')]?_0x251a33['attributes']:_0x5ae671[_0x0ff0('0x2d')];if(_0x43b14f['query'][_0x0ff0('0x3c')]){_0x251a33[_0x0ff0('0x3d')]=[{'all':!![]}];}_0x251a33=_[_0x0ff0('0x37')]({},_0x251a33,_0x43b14f[_0x0ff0('0x3a')]);return db[_0x0ff0('0x3b')][_0x0ff0('0x43')](_0x251a33)[_0x0ff0('0x21')](handleEntityNotFound(_0x9a5980,null))[_0x0ff0('0x21')](respondWithResult(_0x9a5980,null))['catch'](handleError(_0x9a5980,null));};exports['create']=function(_0x4344af,_0x1c7410){return db['JscriptyQuestionReport'][_0x0ff0('0x44')](_0x4344af['body'],{})[_0x0ff0('0x21')](respondWithResult(_0x1c7410,0xc9))[_0x0ff0('0x3f')](handleError(_0x1c7410,null));};exports[_0x0ff0('0x20')]=function(_0x5e8695,_0x1be349){if(_0x5e8695[_0x0ff0('0x45')]['id']){delete _0x5e8695['body']['id'];}return db[_0x0ff0('0x3b')][_0x0ff0('0x43')]({'where':{'id':_0x5e8695[_0x0ff0('0x40')]['id']}})['then'](handleEntityNotFound(_0x1be349,null))[_0x0ff0('0x21')](saveUpdates(_0x5e8695[_0x0ff0('0x45')],null))[_0x0ff0('0x21')](respondWithResult(_0x1be349,null))[_0x0ff0('0x3f')](handleError(_0x1be349,null));};exports[_0x0ff0('0x22')]=function(_0x49d774,_0x38f8bc){return db[_0x0ff0('0x3b')]['find']({'where':{'id':_0x49d774['params']['id']}})['then'](handleEntityNotFound(_0x38f8bc,null))[_0x0ff0('0x21')](removeEntity(_0x38f8bc,null))['catch'](handleError(_0x38f8bc,null));};exports[_0x0ff0('0x46')]=function(_0xbfbb66,_0x3f9fc2){return db[_0x0ff0('0x3b')][_0x0ff0('0x46')]()['then'](respondWithResult(_0x3f9fc2,null))[_0x0ff0('0x3f')](handleError(_0x3f9fc2,null));}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js index 3a37a95..0c05f60 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 _0x78f4=['JscriptyQuestionReport','lodash','util','../../config/logger','bluebird','request-promise','rimraf','../../config/environment','./jscriptyQuestionReport.attributes','exports','define'];(function(_0x416967,_0x129538){var _0x309c5a=function(_0x2b5c50){while(--_0x2b5c50){_0x416967['push'](_0x416967['shift']());}};_0x309c5a(++_0x129538);}(_0x78f4,0xc7));var _0x478f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x78f4[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x478f('0x0'));var util=require(_0x478f('0x1'));var logger=require(_0x478f('0x2'))('api');var moment=require('moment');var BPromise=require(_0x478f('0x3'));var rp=require(_0x478f('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x478f('0x5'));var config=require(_0x478f('0x6'));var attributes=require(_0x478f('0x7'));module[_0x478f('0x8')]=function(_0x9220ee,_0x31f13c){return _0x9220ee[_0x478f('0x9')](_0x478f('0xa'),attributes,{'tableName':'report_jscripty_questions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3d4e=['exports','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./jscriptyQuestionReport.attributes'];(function(_0x5381e0,_0x4c0772){var _0x2a03ac=function(_0x359912){while(--_0x359912){_0x5381e0['push'](_0x5381e0['shift']());}};_0x2a03ac(++_0x4c0772);}(_0x3d4e,0x12d));var _0xe3d4=function(_0x1eba7e,_0x45255b){_0x1eba7e=_0x1eba7e-0x0;var _0x20c97f=_0x3d4e[_0x1eba7e];return _0x20c97f;};'use strict';var _=require('lodash');var util=require(_0xe3d4('0x0'));var logger=require(_0xe3d4('0x1'))(_0xe3d4('0x2'));var moment=require(_0xe3d4('0x3'));var BPromise=require(_0xe3d4('0x4'));var rp=require(_0xe3d4('0x5'));var fs=require('fs');var path=require(_0xe3d4('0x6'));var rimraf=require('rimraf');var config=require(_0xe3d4('0x7'));var attributes=require(_0xe3d4('0x8'));module[_0xe3d4('0x9')]=function(_0x385f90,_0x5b55c7){return _0x385f90['define']('JscriptyQuestionReport',attributes,{'tableName':'report_jscripty_questions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.rpc.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.rpc.js index 5fa5625..f380862 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 _0x815b=['message','result','catch','lodash','moment','bluebird','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x52e08b,_0x501dad){var _0x4e82a1=function(_0xcd24dc){while(--_0xcd24dc){_0x52e08b['push'](_0x52e08b['shift']());}};_0x4e82a1(++_0x501dad);}(_0x815b,0x1e3));var _0xb815=function(_0x4fa3a4,_0x38f368){_0x4fa3a4=_0x4fa3a4-0x0;var _0x423fe3=_0x815b[_0x4fa3a4];return _0x423fe3;};'use strict';var _=require(_0xb815('0x0'));var util=require('util');var moment=require(_0xb815('0x1'));var BPromise=require(_0xb815('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xb815('0x3'));var logger=require(_0xb815('0x4'))('rpc');var config=require(_0xb815('0x5'));var jayson=require(_0xb815('0x6'));var client=jayson['client'][_0xb815('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x19b4f7,_0x803fa,_0x4ee5de){return new BPromise(function(_0x416c18,_0x4872b8){return client[_0xb815('0x8')](_0x19b4f7,_0x4ee5de)[_0xb815('0x9')](function(_0x351893){logger[_0xb815('0xa')](_0xb815('0xb'),_0x803fa,_0xb815('0xc'));logger[_0xb815('0xd')](_0xb815('0xe'),_0x803fa,_0xb815('0xc'),JSON['stringify'](_0x351893));if(_0x351893['error']){if(_0x351893[_0xb815('0xf')][_0xb815('0x10')]===0x1f4){logger[_0xb815('0xf')](_0xb815('0xb'),_0x803fa,_0x351893[_0xb815('0xf')][_0xb815('0x11')]);return _0x4872b8(_0x351893['error'][_0xb815('0x11')]);}logger[_0xb815('0xf')](_0xb815('0xb'),_0x803fa,_0x351893[_0xb815('0xf')]['message']);return _0x416c18(_0x351893[_0xb815('0xf')][_0xb815('0x11')]);}else{logger[_0xb815('0xa')](_0xb815('0xb'),_0x803fa,'request\x20sent');_0x416c18(_0x351893[_0xb815('0x12')][_0xb815('0x11')]);}})[_0xb815('0x13')](function(_0x590e7d){logger[_0xb815('0xf')](_0xb815('0xb'),_0x803fa,_0x590e7d);_0x4872b8(_0x590e7d);});});} \ No newline at end of file +var _0xca83=['result','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','JscriptyQuestionReport,\x20%s,\x20%s','debug','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message'];(function(_0x48ac40,_0x1e3beb){var _0x55df02=function(_0x5e27d6){while(--_0x5e27d6){_0x48ac40['push'](_0x48ac40['shift']());}};_0x55df02(++_0x1e3beb);}(_0xca83,0x14b));var _0x3ca8=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xca83[_0x57b54c];return _0x59cc19;};'use strict';var _=require(_0x3ca8('0x0'));var util=require(_0x3ca8('0x1'));var moment=require(_0x3ca8('0x2'));var BPromise=require(_0x3ca8('0x3'));var rs=require(_0x3ca8('0x4'));var fs=require('fs');var Redis=require(_0x3ca8('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x3ca8('0x6'))(_0x3ca8('0x7'));var config=require(_0x3ca8('0x8'));var jayson=require(_0x3ca8('0x9'));var client=jayson['client'][_0x3ca8('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x20758b,_0x5cce22,_0x38c5ff){return new BPromise(function(_0x11d0f2,_0x3af221){return client[_0x3ca8('0xb')](_0x20758b,_0x38c5ff)['then'](function(_0x45fc69){logger[_0x3ca8('0xc')](_0x3ca8('0xd'),_0x5cce22,'request\x20sent');logger[_0x3ca8('0xe')](_0x3ca8('0xf'),_0x5cce22,_0x3ca8('0x10'),JSON[_0x3ca8('0x11')](_0x45fc69));if(_0x45fc69[_0x3ca8('0x12')]){if(_0x45fc69[_0x3ca8('0x12')][_0x3ca8('0x13')]===0x1f4){logger[_0x3ca8('0x12')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x5cce22,_0x45fc69[_0x3ca8('0x12')][_0x3ca8('0x14')]);return _0x3af221(_0x45fc69['error'][_0x3ca8('0x14')]);}logger['error'](_0x3ca8('0xd'),_0x5cce22,_0x45fc69['error'][_0x3ca8('0x14')]);return _0x11d0f2(_0x45fc69[_0x3ca8('0x12')]['message']);}else{logger[_0x3ca8('0xc')](_0x3ca8('0xd'),_0x5cce22,'request\x20sent');_0x11d0f2(_0x45fc69[_0x3ca8('0x15')]['message']);}})['catch'](function(_0xccdaa9){logger['error'](_0x3ca8('0xd'),_0x5cce22,_0xccdaa9);_0x3af221(_0xccdaa9);});});} \ No newline at end of file diff --git a/server/api/jscriptySessionReport/index.js b/server/api/jscriptySessionReport/index.js index 075e027..9b38fb3 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 _0xda98=['../../components/auth/service','../../config/environment','./jscriptySessionReport.controller','get','/describe','describe','/:id','isAuthenticated','show','/:id/questions','getQuestions','create','put','update','delete','destroy','exports','multer','util','path','express','fs-extra'];(function(_0x1c5012,_0x25ab90){var _0x3d465b=function(_0x4f4cda){while(--_0x4f4cda){_0x1c5012['push'](_0x1c5012['shift']());}};_0x3d465b(++_0x25ab90);}(_0xda98,0x12f));var _0x8da9=function(_0x2077be,_0x26136a){_0x2077be=_0x2077be-0x0;var _0x198bbf=_0xda98[_0x2077be];return _0x198bbf;};'use strict';var multer=require(_0x8da9('0x0'));var util=require(_0x8da9('0x1'));var path=require(_0x8da9('0x2'));var timeout=require('connect-timeout');var express=require(_0x8da9('0x3'));var router=express['Router']();var fs_extra=require(_0x8da9('0x4'));var auth=require(_0x8da9('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x8da9('0x6'));var controller=require(_0x8da9('0x7'));router[_0x8da9('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x8da9('0x8')](_0x8da9('0x9'),auth['isAuthenticated'](),controller[_0x8da9('0xa')]);router[_0x8da9('0x8')](_0x8da9('0xb'),auth[_0x8da9('0xc')](),controller[_0x8da9('0xd')]);router[_0x8da9('0x8')](_0x8da9('0xe'),auth['isAuthenticated'](),controller[_0x8da9('0xf')]);router['post']('/',auth[_0x8da9('0xc')](),controller[_0x8da9('0x10')]);router[_0x8da9('0x11')](_0x8da9('0xb'),auth['isAuthenticated'](),controller[_0x8da9('0x12')]);router[_0x8da9('0x13')](_0x8da9('0xb'),auth['isAuthenticated'](),controller[_0x8da9('0x14')]);module[_0x8da9('0x15')]=router; \ No newline at end of file +var _0xda63=['describe','show','/:id/questions','getQuestions','post','/:id','update','delete','exports','util','path','fs-extra','../../components/auth/service','./jscriptySessionReport.controller','get','index','/describe','isAuthenticated'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xda63,0x14d));var _0x3da6=function(_0x18ab2a,_0x4debcd){_0x18ab2a=_0x18ab2a-0x0;var _0x16dcee=_0xda63[_0x18ab2a];return _0x16dcee;};'use strict';var multer=require('multer');var util=require(_0x3da6('0x0'));var path=require(_0x3da6('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x3da6('0x2'));var auth=require(_0x3da6('0x3'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x3da6('0x4'));router[_0x3da6('0x5')]('/',auth['isAuthenticated'](),controller[_0x3da6('0x6')]);router[_0x3da6('0x5')](_0x3da6('0x7'),auth[_0x3da6('0x8')](),controller[_0x3da6('0x9')]);router[_0x3da6('0x5')]('/:id',auth['isAuthenticated'](),controller[_0x3da6('0xa')]);router[_0x3da6('0x5')](_0x3da6('0xb'),auth[_0x3da6('0x8')](),controller[_0x3da6('0xc')]);router[_0x3da6('0xd')]('/',auth[_0x3da6('0x8')](),controller['create']);router['put'](_0x3da6('0xe'),auth[_0x3da6('0x8')](),controller[_0x3da6('0xf')]);router[_0x3da6('0x10')](_0x3da6('0xe'),auth[_0x3da6('0x8')](),controller['destroy']);module[_0x3da6('0x11')]=router; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js b/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js index 6ed467d..003ff9e 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 _0x3589=['endtime','format','STRING','BOOLEAN','moment','exports','setDataValue','starttime'];(function(_0x412bc7,_0x3897f2){var _0x4c32ad=function(_0x5de463){while(--_0x5de463){_0x412bc7['push'](_0x412bc7['shift']());}};_0x4c32ad(++_0x3897f2);}(_0x3589,0x94));var _0x9358=function(_0x37b498,_0x40f94d){_0x37b498=_0x37b498-0x0;var _0x2c7228=_0x3589[_0x37b498];return _0x2c7228;};'use strict';var moment=require(_0x9358('0x0'));var Sequelize=require('sequelize');module[_0x9358('0x1')]={'starttime':{'type':Sequelize['DATE'],'set':function(_0x418dba){this[_0x9358('0x2')](_0x9358('0x3'),_0x418dba);this['setDataValue'](_0x9358('0x4'),moment()[_0x9358('0x5')]('YYYY-MM-DD\x20HH:mm:ss'));}},'endtime':{'type':Sequelize['DATE']},'membername':{'type':Sequelize[_0x9358('0x6')]},'projectname':{'type':Sequelize[_0x9358('0x6')]},'queue':{'type':Sequelize[_0x9358('0x6')]},'uniqueid':{'type':Sequelize[_0x9358('0x6')]},'calleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x9358('0x6')]},'completed':{'type':Sequelize[_0x9358('0x7')],'defaultValue':![]}}; \ No newline at end of file +var _0xd54c=['sequelize','exports','DATE','setDataValue','starttime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','STRING','BOOLEAN','moment'];(function(_0xf26d40,_0x2f4f46){var _0x50b68c=function(_0x10aa58){while(--_0x10aa58){_0xf26d40['push'](_0xf26d40['shift']());}};_0x50b68c(++_0x2f4f46);}(_0xd54c,0x1c2));var _0xcd54=function(_0xd7805e,_0x57ad1d){_0xd7805e=_0xd7805e-0x0;var _0xfcfa2f=_0xd54c[_0xd7805e];return _0xfcfa2f;};'use strict';var moment=require(_0xcd54('0x0'));var Sequelize=require(_0xcd54('0x1'));module[_0xcd54('0x2')]={'starttime':{'type':Sequelize[_0xcd54('0x3')],'set':function(_0xa31b9c){this[_0xcd54('0x4')](_0xcd54('0x5'),_0xa31b9c);this[_0xcd54('0x4')](_0xcd54('0x6'),moment()[_0xcd54('0x7')](_0xcd54('0x8')));}},'endtime':{'type':Sequelize[_0xcd54('0x3')]},'membername':{'type':Sequelize[_0xcd54('0x9')]},'projectname':{'type':Sequelize[_0xcd54('0x9')]},'queue':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0xcd54('0x9')]},'calleridname':{'type':Sequelize[_0xcd54('0x9')]},'calleridnum':{'type':Sequelize['STRING']},'completed':{'type':Sequelize[_0xcd54('0xa')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.controller.js b/server/api/jscriptySessionReport/jscriptySessionReport.controller.js index 91e7ca8..fd7f196 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 _0x173f=['../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','limit','undefined','count','set','json','apply','save','update','destroy','then','error','stack','name','send','index','JscriptySessionReport','rawAttributes','type','key','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','map','VIRTUAL','options','findAll','catch','show','includeAll','include','find','body','params','describe','getQuestions','findOne','pick','SessionId','JscriptyQuestionReport','rows','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils'];(function(_0x242c74,_0x4c935d){var _0x8f6c8f=function(_0x239aad){while(--_0x239aad){_0x242c74['push'](_0x242c74['shift']());}};_0x8f6c8f(++_0x4c935d);}(_0x173f,0xdf));var _0xf173=function(_0x119d5a,_0x19b457){_0x119d5a=_0x119d5a-0x0;var _0x15bff4=_0x173f[_0x119d5a];return _0x15bff4;};'use strict';var emlformat=require(_0xf173('0x0'));var rimraf=require(_0xf173('0x1'));var zipdir=require(_0xf173('0x2'));var jsonpatch=require(_0xf173('0x3'));var rp=require(_0xf173('0x4'));var moment=require('moment');var BPromise=require(_0xf173('0x5'));var Mustache=require('mustache');var util=require(_0xf173('0x6'));var path=require(_0xf173('0x7'));var sox=require(_0xf173('0x8'));var csv=require(_0xf173('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf173('0xa'));var squel=require(_0xf173('0xb'));var crypto=require('crypto');var jsforce=require(_0xf173('0xc'));var deskjs=require(_0xf173('0xd'));var toCsv=require(_0xf173('0x9'));var querystring=require(_0xf173('0xe'));var Papa=require(_0xf173('0xf'));var Redis=require(_0xf173('0x10'));var authService=require(_0xf173('0x11'));var qs=require(_0xf173('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf173('0x13'));var logger=require(_0xf173('0x14'))(_0xf173('0x15'));var utils=require(_0xf173('0x16'));var config=require(_0xf173('0x17'));var licenseUtil=require(_0xf173('0x18'));var db=require(_0xf173('0x19'))['db'];function respondWithStatusCode(_0x51a141,_0x1e3a9c){_0x1e3a9c=_0x1e3a9c||0xcc;return function(_0x4cdc9b){if(_0x4cdc9b){return _0x51a141[_0xf173('0x1a')](_0x1e3a9c);}return _0x51a141[_0xf173('0x1b')](_0x1e3a9c)[_0xf173('0x1c')]();};}function respondWithResult(_0x3bfe6f,_0x255d72){_0x255d72=_0x255d72||0xc8;return function(_0x3573c5){if(_0x3573c5){return _0x3bfe6f[_0xf173('0x1b')](_0x255d72)['json'](_0x3573c5);}};}function respondWithFilteredResult(_0x320773,_0x432bc4){return function(_0x387af7){if(_0x387af7){var _0x178c5d=typeof _0x432bc4[_0xf173('0x1d')]==='undefined'&&typeof _0x432bc4[_0xf173('0x1e')]===_0xf173('0x1f');var _0x28d906=_0x387af7[_0xf173('0x20')];var _0x1c70d4=_0x178c5d?0x0:_0x432bc4[_0xf173('0x1d')];var _0x1a1607=_0x178c5d?_0x387af7[_0xf173('0x20')]:_0x432bc4['offset']+_0x432bc4[_0xf173('0x1e')];var _0x30aeae;if(_0x1a1607>=_0x28d906){_0x1a1607=_0x28d906;_0x30aeae=0xc8;}else{_0x30aeae=0xce;}_0x320773[_0xf173('0x1b')](_0x30aeae);return _0x320773[_0xf173('0x21')]('Content-Range',_0x1c70d4+'-'+_0x1a1607+'/'+_0x28d906)[_0xf173('0x22')](_0x387af7);}return null;};}function patchUpdates(_0x56ab86){return function(_0xd5dbf9){try{jsonpatch[_0xf173('0x23')](_0xd5dbf9,_0x56ab86,!![]);}catch(_0x11d4bc){return BPromise['reject'](_0x11d4bc);}return _0xd5dbf9[_0xf173('0x24')]();};}function saveUpdates(_0x259903,_0x3de11e){return function(_0x2cb34f){if(_0x2cb34f){return _0x2cb34f[_0xf173('0x25')](_0x259903)['then'](function(_0x32172b){return _0x32172b;});}return null;};}function removeEntity(_0x15680d,_0xd12445){return function(_0x426981){if(_0x426981){return _0x426981[_0xf173('0x26')]()[_0xf173('0x27')](function(){_0x15680d['status'](0xcc)[_0xf173('0x1c')]();});}};}function handleEntityNotFound(_0x4e2ac3,_0x5f4aa4){return function(_0xfd2c65){if(!_0xfd2c65){_0x4e2ac3[_0xf173('0x1a')](0x194);}return _0xfd2c65;};}function handleError(_0x28ce4d,_0x18db2b){_0x18db2b=_0x18db2b||0x1f4;return function(_0x2f25fc){logger[_0xf173('0x28')](_0x2f25fc[_0xf173('0x29')]);if(_0x2f25fc[_0xf173('0x2a')]){delete _0x2f25fc[_0xf173('0x2a')];}_0x28ce4d[_0xf173('0x1b')](_0x18db2b)[_0xf173('0x2b')](_0x2f25fc);};}exports[_0xf173('0x2c')]=function(_0x2a1749,_0x380d7b){var _0x16671b={},_0x4190ad={},_0x3b2439={'count':0x0,'rows':[]};var _0x174428=_['map'](db[_0xf173('0x2d')][_0xf173('0x2e')],function(_0x52ef1b){return{'name':_0x52ef1b['fieldName'],'type':_0x52ef1b[_0xf173('0x2f')][_0xf173('0x30')]};});_0x4190ad['model']=_['map'](_0x174428,_0xf173('0x2a'));_0x4190ad['query']=_[_0xf173('0x31')](_0x2a1749[_0xf173('0x32')]);_0x4190ad[_0xf173('0x33')]=_[_0xf173('0x34')](_0x4190ad[_0xf173('0x35')],_0x4190ad['query']);_0x16671b[_0xf173('0x36')]=_['intersection'](_0x4190ad[_0xf173('0x35')],qs[_0xf173('0x37')](_0x2a1749[_0xf173('0x32')]['fields']));_0x16671b[_0xf173('0x36')]=_0x16671b[_0xf173('0x36')][_0xf173('0x38')]?_0x16671b[_0xf173('0x36')]:_0x4190ad[_0xf173('0x35')];if(!_0x2a1749[_0xf173('0x32')][_0xf173('0x39')](_0xf173('0x3a'))){_0x16671b[_0xf173('0x1e')]=qs[_0xf173('0x1e')](_0x2a1749[_0xf173('0x32')][_0xf173('0x1e')]);_0x16671b[_0xf173('0x1d')]=qs[_0xf173('0x1d')](_0x2a1749[_0xf173('0x32')][_0xf173('0x1d')]);}_0x16671b[_0xf173('0x3b')]=qs[_0xf173('0x3c')](_0x2a1749[_0xf173('0x32')][_0xf173('0x3c')]);_0x16671b[_0xf173('0x3d')]=qs[_0xf173('0x33')](_['pick'](_0x2a1749[_0xf173('0x32')],_0x4190ad[_0xf173('0x33')]),_0x174428);if(_0x2a1749['query'][_0xf173('0x3e')]){_0x16671b['where']=_[_0xf173('0x3f')](_0x16671b['where'],{'$or':_[_0xf173('0x40')](_0x174428,function(_0x5bb94f){if(_0x5bb94f[_0xf173('0x2f')]!==_0xf173('0x41')){var _0x405acc={};_0x405acc[_0x5bb94f['name']]={'$like':'%'+_0x2a1749[_0xf173('0x32')][_0xf173('0x3e')]+'%'};return _0x405acc;}})});}_0x16671b=_['merge']({},_0x16671b,_0x2a1749[_0xf173('0x42')]);var _0x41aabb={'where':_0x16671b['where']};return db[_0xf173('0x2d')][_0xf173('0x20')](_0x41aabb)[_0xf173('0x27')](function(_0x5a773a){_0x3b2439['count']=_0x5a773a;if(_0x2a1749['query']['includeAll']){_0x16671b['include']=[{'all':!![]}];}return db[_0xf173('0x2d')][_0xf173('0x43')](_0x16671b);})[_0xf173('0x27')](function(_0x171c2){_0x3b2439['rows']=_0x171c2;return _0x3b2439;})[_0xf173('0x27')](respondWithFilteredResult(_0x380d7b,_0x16671b))[_0xf173('0x44')](handleError(_0x380d7b,null));};exports[_0xf173('0x45')]=function(_0x3e8939,_0x2d62b7){var _0x18fdfa={'raw':!![],'where':{'id':_0x3e8939['params']['id']}},_0x171035={};_0x171035['model']=_[_0xf173('0x31')](db[_0xf173('0x2d')][_0xf173('0x2e')]);_0x171035[_0xf173('0x32')]=_[_0xf173('0x31')](_0x3e8939[_0xf173('0x32')]);_0x171035[_0xf173('0x33')]=_['intersection'](_0x171035[_0xf173('0x35')],_0x171035['query']);_0x18fdfa[_0xf173('0x36')]=_['intersection'](_0x171035[_0xf173('0x35')],qs[_0xf173('0x37')](_0x3e8939[_0xf173('0x32')][_0xf173('0x37')]));_0x18fdfa[_0xf173('0x36')]=_0x18fdfa[_0xf173('0x36')][_0xf173('0x38')]?_0x18fdfa['attributes']:_0x171035[_0xf173('0x35')];if(_0x3e8939[_0xf173('0x32')][_0xf173('0x46')]){_0x18fdfa[_0xf173('0x47')]=[{'all':!![]}];}_0x18fdfa=_[_0xf173('0x3f')]({},_0x18fdfa,_0x3e8939['options']);return db[_0xf173('0x2d')][_0xf173('0x48')](_0x18fdfa)['then'](handleEntityNotFound(_0x2d62b7,null))[_0xf173('0x27')](respondWithResult(_0x2d62b7,null))[_0xf173('0x44')](handleError(_0x2d62b7,null));};exports['create']=function(_0x3086da,_0x494ae5){return db[_0xf173('0x2d')]['create'](_0x3086da[_0xf173('0x49')],{})[_0xf173('0x27')](respondWithResult(_0x494ae5,0xc9))[_0xf173('0x44')](handleError(_0x494ae5,null));};exports[_0xf173('0x25')]=function(_0x1d816b,_0x4f48ad){if(_0x1d816b['body']['id']){delete _0x1d816b[_0xf173('0x49')]['id'];}return db[_0xf173('0x2d')][_0xf173('0x48')]({'where':{'id':_0x1d816b[_0xf173('0x4a')]['id']}})[_0xf173('0x27')](handleEntityNotFound(_0x4f48ad,null))[_0xf173('0x27')](saveUpdates(_0x1d816b[_0xf173('0x49')],null))[_0xf173('0x27')](respondWithResult(_0x4f48ad,null))[_0xf173('0x44')](handleError(_0x4f48ad,null));};exports[_0xf173('0x26')]=function(_0x286ebe,_0x1d29c8){return db[_0xf173('0x2d')][_0xf173('0x48')]({'where':{'id':_0x286ebe[_0xf173('0x4a')]['id']}})[_0xf173('0x27')](handleEntityNotFound(_0x1d29c8,null))['then'](removeEntity(_0x1d29c8,null))['catch'](handleError(_0x1d29c8,null));};exports[_0xf173('0x4b')]=function(_0x5a54e0,_0x4c3290){return db[_0xf173('0x2d')][_0xf173('0x4b')]()['then'](respondWithResult(_0x4c3290,null))['catch'](handleError(_0x4c3290,null));};exports[_0xf173('0x4c')]=function(_0x1f497a,_0x4e26f9,_0x16909e){var _0x1d9b55={'raw':!![],'where':{}};var _0x4fd2f0={};var _0x3fbf8f={'count':0x0,'rows':[]};return db[_0xf173('0x2d')][_0xf173('0x4d')]({'where':{'id':_0x1f497a[_0xf173('0x4a')]['id']}})[_0xf173('0x27')](handleEntityNotFound(_0x4e26f9,null))[_0xf173('0x27')](function(_0x1a7cec){if(_0x1a7cec){_0x4fd2f0[_0xf173('0x35')]=_[_0xf173('0x31')](db['JscriptyQuestionReport']['rawAttributes']);_0x4fd2f0[_0xf173('0x32')]=_[_0xf173('0x31')](_0x1f497a[_0xf173('0x32')]);_0x4fd2f0['filters']=_[_0xf173('0x34')](_0x4fd2f0[_0xf173('0x35')],_0x4fd2f0[_0xf173('0x32')]);_0x1d9b55['attributes']=_[_0xf173('0x34')](_0x4fd2f0[_0xf173('0x35')],qs['fields'](_0x1f497a[_0xf173('0x32')][_0xf173('0x37')]));_0x1d9b55[_0xf173('0x36')]=_0x1d9b55[_0xf173('0x36')][_0xf173('0x38')]?_0x1d9b55[_0xf173('0x36')]:_0x4fd2f0[_0xf173('0x35')];if(!_0x1f497a[_0xf173('0x32')][_0xf173('0x39')](_0xf173('0x3a'))){_0x1d9b55[_0xf173('0x1e')]=qs[_0xf173('0x1e')](_0x1f497a[_0xf173('0x32')][_0xf173('0x1e')]);_0x1d9b55[_0xf173('0x1d')]=qs[_0xf173('0x1d')](_0x1f497a[_0xf173('0x32')][_0xf173('0x1d')]);}_0x1d9b55['order']=qs[_0xf173('0x3c')](_0x1f497a[_0xf173('0x32')]['sort']);_0x1d9b55[_0xf173('0x3d')]=qs['filters'](_[_0xf173('0x4e')](_0x1f497a[_0xf173('0x32')],_0x4fd2f0['filters']));_0x1d9b55[_0xf173('0x3d')][_0xf173('0x4f')]=_0x1a7cec['id'];if(_0x1f497a[_0xf173('0x32')][_0xf173('0x3e')]){_0x1d9b55['where']=_[_0xf173('0x3f')](_0x1d9b55['where'],{'$or':_[_0xf173('0x40')](_0x1d9b55[_0xf173('0x36')],function(_0x1ca217){var _0x3a85f0={};_0x3a85f0[_0x1ca217]={'$like':'%'+_0x1f497a['query'][_0xf173('0x3e')]+'%'};return _0x3a85f0;})});}_0x1d9b55=_['merge']({},_0x1d9b55,_0x1f497a[_0xf173('0x42')]);return db[_0xf173('0x50')][_0xf173('0x20')]({'where':_0x1d9b55[_0xf173('0x3d')]})[_0xf173('0x27')](function(_0x418e63){_0x3fbf8f[_0xf173('0x20')]=_0x418e63;if(_0x1f497a['query'][_0xf173('0x46')]){_0x1d9b55[_0xf173('0x47')]=[{'all':!![]}];}return db[_0xf173('0x50')][_0xf173('0x43')](_0x1d9b55);})[_0xf173('0x27')](function(_0x52d8f8){_0x3fbf8f[_0xf173('0x51')]=_0x52d8f8;return _0x3fbf8f;});}})[_0xf173('0x27')](respondWithFilteredResult(_0x4e26f9,_0x1d9b55))['catch'](handleError(_0x4e26f9,null));}; \ No newline at end of file +var _0x0d7d=['jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','status','end','json','offset','limit','undefined','set','apply','reject','save','update','then','destroy','error','name','send','index','map','JscriptySessionReport','rawAttributes','fieldName','type','key','keys','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','count','includeAll','include','rows','show','find','catch','create','body','params','describe','getQuestions','findOne','JscriptyQuestionReport','SessionId','findAll','eml-format','rimraf','fast-json-patch','request-promise','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0x0d7d,0xe7));var _0xd0d7=function(_0x88cd7b,_0x4c884c){_0x88cd7b=_0x88cd7b-0x0;var _0x56fcc8=_0x0d7d[_0x88cd7b];return _0x56fcc8;};'use strict';var emlformat=require(_0xd0d7('0x0'));var rimraf=require(_0xd0d7('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd0d7('0x2'));var rp=require(_0xd0d7('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xd0d7('0x4'));var util=require(_0xd0d7('0x5'));var path=require(_0xd0d7('0x6'));var sox=require('sox');var csv=require(_0xd0d7('0x7'));var ejs=require(_0xd0d7('0x8'));var fs=require('fs');var fs_extra=require(_0xd0d7('0x9'));var _=require(_0xd0d7('0xa'));var squel=require('squel');var crypto=require(_0xd0d7('0xb'));var jsforce=require(_0xd0d7('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xd0d7('0x7'));var querystring=require(_0xd0d7('0xd'));var Papa=require(_0xd0d7('0xe'));var Redis=require(_0xd0d7('0xf'));var authService=require(_0xd0d7('0x10'));var qs=require(_0xd0d7('0x11'));var as=require(_0xd0d7('0x12'));var hardwareService=require(_0xd0d7('0x13'));var logger=require(_0xd0d7('0x14'))(_0xd0d7('0x15'));var utils=require(_0xd0d7('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xd0d7('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x49bd14,_0x4ee855){_0x4ee855=_0x4ee855||0xcc;return function(_0x64bfa2){if(_0x64bfa2){return _0x49bd14['sendStatus'](_0x4ee855);}return _0x49bd14[_0xd0d7('0x18')](_0x4ee855)[_0xd0d7('0x19')]();};}function respondWithResult(_0x221d0e,_0x45fc4f){_0x45fc4f=_0x45fc4f||0xc8;return function(_0x35c5ed){if(_0x35c5ed){return _0x221d0e[_0xd0d7('0x18')](_0x45fc4f)[_0xd0d7('0x1a')](_0x35c5ed);}};}function respondWithFilteredResult(_0x3caf0d,_0x50680c){return function(_0x9c87b3){if(_0x9c87b3){var _0x5a604c=typeof _0x50680c[_0xd0d7('0x1b')]==='undefined'&&typeof _0x50680c[_0xd0d7('0x1c')]===_0xd0d7('0x1d');var _0x2732b5=_0x9c87b3['count'];var _0xe27256=_0x5a604c?0x0:_0x50680c[_0xd0d7('0x1b')];var _0x3a1021=_0x5a604c?_0x9c87b3['count']:_0x50680c[_0xd0d7('0x1b')]+_0x50680c[_0xd0d7('0x1c')];var _0x2da601;if(_0x3a1021>=_0x2732b5){_0x3a1021=_0x2732b5;_0x2da601=0xc8;}else{_0x2da601=0xce;}_0x3caf0d[_0xd0d7('0x18')](_0x2da601);return _0x3caf0d[_0xd0d7('0x1e')]('Content-Range',_0xe27256+'-'+_0x3a1021+'/'+_0x2732b5)[_0xd0d7('0x1a')](_0x9c87b3);}return null;};}function patchUpdates(_0x28c5f2){return function(_0x193c0f){try{jsonpatch[_0xd0d7('0x1f')](_0x193c0f,_0x28c5f2,!![]);}catch(_0x4c6747){return BPromise[_0xd0d7('0x20')](_0x4c6747);}return _0x193c0f[_0xd0d7('0x21')]();};}function saveUpdates(_0x348226,_0x5d3926){return function(_0x3d861f){if(_0x3d861f){return _0x3d861f[_0xd0d7('0x22')](_0x348226)[_0xd0d7('0x23')](function(_0x462b4f){return _0x462b4f;});}return null;};}function removeEntity(_0x18aaa5,_0x258ff6){return function(_0x220626){if(_0x220626){return _0x220626[_0xd0d7('0x24')]()['then'](function(){_0x18aaa5[_0xd0d7('0x18')](0xcc)[_0xd0d7('0x19')]();});}};}function handleEntityNotFound(_0x5c5607,_0x33fdde){return function(_0x2e4737){if(!_0x2e4737){_0x5c5607['sendStatus'](0x194);}return _0x2e4737;};}function handleError(_0x43f0ed,_0x1ba7c9){_0x1ba7c9=_0x1ba7c9||0x1f4;return function(_0x452d3b){logger[_0xd0d7('0x25')](_0x452d3b['stack']);if(_0x452d3b['name']){delete _0x452d3b[_0xd0d7('0x26')];}_0x43f0ed[_0xd0d7('0x18')](_0x1ba7c9)[_0xd0d7('0x27')](_0x452d3b);};}exports[_0xd0d7('0x28')]=function(_0x1fcc15,_0x3264eb){var _0x3071d9={},_0x578e72={},_0x25adfb={'count':0x0,'rows':[]};var _0x337453=_[_0xd0d7('0x29')](db[_0xd0d7('0x2a')][_0xd0d7('0x2b')],function(_0x1ba14f){return{'name':_0x1ba14f[_0xd0d7('0x2c')],'type':_0x1ba14f[_0xd0d7('0x2d')][_0xd0d7('0x2e')]};});_0x578e72['model']=_[_0xd0d7('0x29')](_0x337453,_0xd0d7('0x26'));_0x578e72['query']=_[_0xd0d7('0x2f')](_0x1fcc15[_0xd0d7('0x30')]);_0x578e72[_0xd0d7('0x31')]=_[_0xd0d7('0x32')](_0x578e72['model'],_0x578e72[_0xd0d7('0x30')]);_0x3071d9['attributes']=_[_0xd0d7('0x32')](_0x578e72[_0xd0d7('0x33')],qs[_0xd0d7('0x34')](_0x1fcc15[_0xd0d7('0x30')][_0xd0d7('0x34')]));_0x3071d9[_0xd0d7('0x35')]=_0x3071d9['attributes'][_0xd0d7('0x36')]?_0x3071d9[_0xd0d7('0x35')]:_0x578e72[_0xd0d7('0x33')];if(!_0x1fcc15['query'][_0xd0d7('0x37')](_0xd0d7('0x38'))){_0x3071d9[_0xd0d7('0x1c')]=qs[_0xd0d7('0x1c')](_0x1fcc15[_0xd0d7('0x30')]['limit']);_0x3071d9[_0xd0d7('0x1b')]=qs[_0xd0d7('0x1b')](_0x1fcc15[_0xd0d7('0x30')][_0xd0d7('0x1b')]);}_0x3071d9[_0xd0d7('0x39')]=qs[_0xd0d7('0x3a')](_0x1fcc15[_0xd0d7('0x30')][_0xd0d7('0x3a')]);_0x3071d9[_0xd0d7('0x3b')]=qs[_0xd0d7('0x31')](_[_0xd0d7('0x3c')](_0x1fcc15['query'],_0x578e72[_0xd0d7('0x31')]),_0x337453);if(_0x1fcc15[_0xd0d7('0x30')]['filter']){_0x3071d9['where']=_[_0xd0d7('0x3d')](_0x3071d9[_0xd0d7('0x3b')],{'$or':_[_0xd0d7('0x29')](_0x337453,function(_0x20358c){if(_0x20358c[_0xd0d7('0x2d')]!==_0xd0d7('0x3e')){var _0x4cb884={};_0x4cb884[_0x20358c[_0xd0d7('0x26')]]={'$like':'%'+_0x1fcc15[_0xd0d7('0x30')][_0xd0d7('0x3f')]+'%'};return _0x4cb884;}})});}_0x3071d9=_[_0xd0d7('0x3d')]({},_0x3071d9,_0x1fcc15[_0xd0d7('0x40')]);var _0x422087={'where':_0x3071d9['where']};return db[_0xd0d7('0x2a')][_0xd0d7('0x41')](_0x422087)[_0xd0d7('0x23')](function(_0x1c0aca){_0x25adfb[_0xd0d7('0x41')]=_0x1c0aca;if(_0x1fcc15[_0xd0d7('0x30')][_0xd0d7('0x42')]){_0x3071d9[_0xd0d7('0x43')]=[{'all':!![]}];}return db[_0xd0d7('0x2a')]['findAll'](_0x3071d9);})[_0xd0d7('0x23')](function(_0x17cb22){_0x25adfb[_0xd0d7('0x44')]=_0x17cb22;return _0x25adfb;})[_0xd0d7('0x23')](respondWithFilteredResult(_0x3264eb,_0x3071d9))['catch'](handleError(_0x3264eb,null));};exports[_0xd0d7('0x45')]=function(_0x4e0e0f,_0x16f2bd){var _0x224208={'raw':!![],'where':{'id':_0x4e0e0f['params']['id']}},_0x239155={};_0x239155[_0xd0d7('0x33')]=_['keys'](db['JscriptySessionReport']['rawAttributes']);_0x239155[_0xd0d7('0x30')]=_[_0xd0d7('0x2f')](_0x4e0e0f[_0xd0d7('0x30')]);_0x239155[_0xd0d7('0x31')]=_[_0xd0d7('0x32')](_0x239155[_0xd0d7('0x33')],_0x239155[_0xd0d7('0x30')]);_0x224208[_0xd0d7('0x35')]=_['intersection'](_0x239155[_0xd0d7('0x33')],qs[_0xd0d7('0x34')](_0x4e0e0f['query'][_0xd0d7('0x34')]));_0x224208[_0xd0d7('0x35')]=_0x224208[_0xd0d7('0x35')][_0xd0d7('0x36')]?_0x224208[_0xd0d7('0x35')]:_0x239155[_0xd0d7('0x33')];if(_0x4e0e0f[_0xd0d7('0x30')][_0xd0d7('0x42')]){_0x224208[_0xd0d7('0x43')]=[{'all':!![]}];}_0x224208=_[_0xd0d7('0x3d')]({},_0x224208,_0x4e0e0f[_0xd0d7('0x40')]);return db[_0xd0d7('0x2a')][_0xd0d7('0x46')](_0x224208)[_0xd0d7('0x23')](handleEntityNotFound(_0x16f2bd,null))[_0xd0d7('0x23')](respondWithResult(_0x16f2bd,null))[_0xd0d7('0x47')](handleError(_0x16f2bd,null));};exports[_0xd0d7('0x48')]=function(_0x55d9b9,_0x703171){return db[_0xd0d7('0x2a')]['create'](_0x55d9b9[_0xd0d7('0x49')],{})[_0xd0d7('0x23')](respondWithResult(_0x703171,0xc9))[_0xd0d7('0x47')](handleError(_0x703171,null));};exports[_0xd0d7('0x22')]=function(_0x6e04ea,_0x1c1ec9){if(_0x6e04ea['body']['id']){delete _0x6e04ea['body']['id'];}return db['JscriptySessionReport'][_0xd0d7('0x46')]({'where':{'id':_0x6e04ea[_0xd0d7('0x4a')]['id']}})['then'](handleEntityNotFound(_0x1c1ec9,null))['then'](saveUpdates(_0x6e04ea[_0xd0d7('0x49')],null))['then'](respondWithResult(_0x1c1ec9,null))['catch'](handleError(_0x1c1ec9,null));};exports['destroy']=function(_0x382ef7,_0xf79b71){return db['JscriptySessionReport']['find']({'where':{'id':_0x382ef7['params']['id']}})[_0xd0d7('0x23')](handleEntityNotFound(_0xf79b71,null))[_0xd0d7('0x23')](removeEntity(_0xf79b71,null))[_0xd0d7('0x47')](handleError(_0xf79b71,null));};exports[_0xd0d7('0x4b')]=function(_0x272cb6,_0x3b52a1){return db[_0xd0d7('0x2a')][_0xd0d7('0x4b')]()[_0xd0d7('0x23')](respondWithResult(_0x3b52a1,null))['catch'](handleError(_0x3b52a1,null));};exports[_0xd0d7('0x4c')]=function(_0x59f9cf,_0x52be25,_0x40278f){var _0x1ffe62={'raw':!![],'where':{}};var _0xe8500e={};var _0x1b5a39={'count':0x0,'rows':[]};return db[_0xd0d7('0x2a')][_0xd0d7('0x4d')]({'where':{'id':_0x59f9cf['params']['id']}})['then'](handleEntityNotFound(_0x52be25,null))[_0xd0d7('0x23')](function(_0x1f23bd){if(_0x1f23bd){_0xe8500e[_0xd0d7('0x33')]=_[_0xd0d7('0x2f')](db[_0xd0d7('0x4e')][_0xd0d7('0x2b')]);_0xe8500e[_0xd0d7('0x30')]=_['keys'](_0x59f9cf[_0xd0d7('0x30')]);_0xe8500e['filters']=_[_0xd0d7('0x32')](_0xe8500e[_0xd0d7('0x33')],_0xe8500e['query']);_0x1ffe62[_0xd0d7('0x35')]=_[_0xd0d7('0x32')](_0xe8500e[_0xd0d7('0x33')],qs['fields'](_0x59f9cf[_0xd0d7('0x30')][_0xd0d7('0x34')]));_0x1ffe62[_0xd0d7('0x35')]=_0x1ffe62[_0xd0d7('0x35')][_0xd0d7('0x36')]?_0x1ffe62[_0xd0d7('0x35')]:_0xe8500e[_0xd0d7('0x33')];if(!_0x59f9cf[_0xd0d7('0x30')][_0xd0d7('0x37')](_0xd0d7('0x38'))){_0x1ffe62[_0xd0d7('0x1c')]=qs[_0xd0d7('0x1c')](_0x59f9cf['query']['limit']);_0x1ffe62[_0xd0d7('0x1b')]=qs['offset'](_0x59f9cf[_0xd0d7('0x30')][_0xd0d7('0x1b')]);}_0x1ffe62[_0xd0d7('0x39')]=qs[_0xd0d7('0x3a')](_0x59f9cf['query']['sort']);_0x1ffe62[_0xd0d7('0x3b')]=qs[_0xd0d7('0x31')](_[_0xd0d7('0x3c')](_0x59f9cf[_0xd0d7('0x30')],_0xe8500e[_0xd0d7('0x31')]));_0x1ffe62[_0xd0d7('0x3b')][_0xd0d7('0x4f')]=_0x1f23bd['id'];if(_0x59f9cf[_0xd0d7('0x30')][_0xd0d7('0x3f')]){_0x1ffe62[_0xd0d7('0x3b')]=_[_0xd0d7('0x3d')](_0x1ffe62[_0xd0d7('0x3b')],{'$or':_[_0xd0d7('0x29')](_0x1ffe62[_0xd0d7('0x35')],function(_0x3f76dc){var _0x2afb17={};_0x2afb17[_0x3f76dc]={'$like':'%'+_0x59f9cf[_0xd0d7('0x30')][_0xd0d7('0x3f')]+'%'};return _0x2afb17;})});}_0x1ffe62=_[_0xd0d7('0x3d')]({},_0x1ffe62,_0x59f9cf[_0xd0d7('0x40')]);return db[_0xd0d7('0x4e')][_0xd0d7('0x41')]({'where':_0x1ffe62[_0xd0d7('0x3b')]})[_0xd0d7('0x23')](function(_0x18f855){_0x1b5a39[_0xd0d7('0x41')]=_0x18f855;if(_0x59f9cf[_0xd0d7('0x30')][_0xd0d7('0x42')]){_0x1ffe62[_0xd0d7('0x43')]=[{'all':!![]}];}return db[_0xd0d7('0x4e')][_0xd0d7('0x50')](_0x1ffe62);})[_0xd0d7('0x23')](function(_0x21ddfb){_0x1b5a39[_0xd0d7('0x44')]=_0x21ddfb;return _0x1b5a39;});}})[_0xd0d7('0x23')](respondWithFilteredResult(_0x52be25,_0x1ffe62))[_0xd0d7('0x47')](handleError(_0x52be25,null));}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.model.js b/server/api/jscriptySessionReport/jscriptySessionReport.model.js index d0606b0..060f349 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 _0x0a6b=['request-promise','path','rimraf','./jscriptySessionReport.attributes','JscriptySessionReport','report_jscripty_sessions','lodash','moment'];(function(_0x143c7b,_0xbaaa92){var _0x177554=function(_0x2e15b3){while(--_0x2e15b3){_0x143c7b['push'](_0x143c7b['shift']());}};_0x177554(++_0xbaaa92);}(_0x0a6b,0x18e));var _0xb0a6=function(_0x367577,_0x3c0484){_0x367577=_0x367577-0x0;var _0x1865c6=_0x0a6b[_0x367577];return _0x1865c6;};'use strict';var _=require(_0xb0a6('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xb0a6('0x1'));var BPromise=require('bluebird');var rp=require(_0xb0a6('0x2'));var fs=require('fs');var path=require(_0xb0a6('0x3'));var rimraf=require(_0xb0a6('0x4'));var config=require('../../config/environment');var attributes=require(_0xb0a6('0x5'));module['exports']=function(_0xbbdf89,_0x415e9e){return _0xbbdf89['define'](_0xb0a6('0x6'),attributes,{'tableName':_0xb0a6('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x46ed=['lodash','util','api','moment','bluebird','path','rimraf','./jscriptySessionReport.attributes','exports','define','JscriptySessionReport','report_jscripty_sessions'];(function(_0x870b62,_0x2143f9){var _0x2dcb39=function(_0x2fb63d){while(--_0x2fb63d){_0x870b62['push'](_0x870b62['shift']());}};_0x2dcb39(++_0x2143f9);}(_0x46ed,0x168));var _0xd46e=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x46ed[_0x4a9fb1];return _0x348672;};'use strict';var _=require(_0xd46e('0x0'));var util=require(_0xd46e('0x1'));var logger=require('../../config/logger')(_0xd46e('0x2'));var moment=require(_0xd46e('0x3'));var BPromise=require(_0xd46e('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd46e('0x5'));var rimraf=require(_0xd46e('0x6'));var config=require('../../config/environment');var attributes=require(_0xd46e('0x7'));module[_0xd46e('0x8')]=function(_0x160bcf,_0x25cf78){return _0x160bcf[_0xd46e('0x9')](_0xd46e('0xa'),attributes,{'tableName':_0xd46e('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.rpc.js b/server/api/jscriptySessionReport/jscriptySessionReport.rpc.js index 41934f8..035edc9 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 _0xd046=['ioredis','../../config/logger','../../config/environment','http','JscriptySessionReport,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','catch','util','moment','bluebird'];(function(_0x2261ce,_0x9ed8b6){var _0x524640=function(_0x3cbb90){while(--_0x3cbb90){_0x2261ce['push'](_0x2261ce['shift']());}};_0x524640(++_0x9ed8b6);}(_0xd046,0x129));var _0x6d04=function(_0x43e87c,_0x497841){_0x43e87c=_0x43e87c-0x0;var _0x36b3ef=_0xd046[_0x43e87c];return _0x36b3ef;};'use strict';var _=require('lodash');var util=require(_0x6d04('0x0'));var moment=require(_0x6d04('0x1'));var BPromise=require(_0x6d04('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6d04('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x6d04('0x4'))('rpc');var config=require(_0x6d04('0x5'));var jayson=require('jayson/promise');var client=jayson['client'][_0x6d04('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x1968c4,_0x4f83bc,_0x569c7b){return new BPromise(function(_0x2e2c01,_0x42aa22){return client['request'](_0x1968c4,_0x569c7b)['then'](function(_0x27a3d6){logger['info'](_0x6d04('0x7'),_0x4f83bc,'request\x20sent');logger['debug']('JscriptySessionReport,\x20%s,\x20%s,\x20%s',_0x4f83bc,_0x6d04('0x8'),JSON[_0x6d04('0x9')](_0x27a3d6));if(_0x27a3d6[_0x6d04('0xa')]){if(_0x27a3d6[_0x6d04('0xa')]['code']===0x1f4){logger[_0x6d04('0xa')](_0x6d04('0x7'),_0x4f83bc,_0x27a3d6[_0x6d04('0xa')][_0x6d04('0xb')]);return _0x42aa22(_0x27a3d6[_0x6d04('0xa')][_0x6d04('0xb')]);}logger[_0x6d04('0xa')](_0x6d04('0x7'),_0x4f83bc,_0x27a3d6[_0x6d04('0xa')][_0x6d04('0xb')]);return _0x2e2c01(_0x27a3d6[_0x6d04('0xa')][_0x6d04('0xb')]);}else{logger[_0x6d04('0xc')](_0x6d04('0x7'),_0x4f83bc,_0x6d04('0x8'));_0x2e2c01(_0x27a3d6[_0x6d04('0xd')][_0x6d04('0xb')]);}})[_0x6d04('0xe')](function(_0xed5538){logger[_0x6d04('0xa')](_0x6d04('0x7'),_0x4f83bc,_0xed5538);_0x42aa22(_0xed5538);});});} \ No newline at end of file +var _0x958a=['randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','then','info','JscriptySessionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptySessionReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','bluebird'];(function(_0x5b4903,_0x1e544f){var _0x2206cf=function(_0x37557f){while(--_0x37557f){_0x5b4903['push'](_0x5b4903['shift']());}};_0x2206cf(++_0x1e544f);}(_0x958a,0x128));var _0xa958=function(_0x3e5868,_0x26f1c6){_0x3e5868=_0x3e5868-0x0;var _0x1adfc6=_0x958a[_0x3e5868];return _0x1adfc6;};'use strict';var _=require(_0xa958('0x0'));var util=require(_0xa958('0x1'));var moment=require('moment');var BPromise=require(_0xa958('0x2'));var rs=require(_0xa958('0x3'));var fs=require('fs');var Redis=require(_0xa958('0x4'));var db=require(_0xa958('0x5'))['db'];var utils=require(_0xa958('0x6'));var logger=require('../../config/logger')(_0xa958('0x7'));var config=require('../../config/environment');var jayson=require(_0xa958('0x8'));var client=jayson[_0xa958('0x9')][_0xa958('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3ddaa9,_0x3ca01f,_0x3b2693){return new BPromise(function(_0x1895da,_0x54c0e0){return client['request'](_0x3ddaa9,_0x3b2693)[_0xa958('0xb')](function(_0x249764){logger[_0xa958('0xc')](_0xa958('0xd'),_0x3ca01f,_0xa958('0xe'));logger[_0xa958('0xf')](_0xa958('0x10'),_0x3ca01f,_0xa958('0xe'),JSON[_0xa958('0x11')](_0x249764));if(_0x249764[_0xa958('0x12')]){if(_0x249764[_0xa958('0x12')][_0xa958('0x13')]===0x1f4){logger[_0xa958('0x12')]('JscriptySessionReport,\x20%s,\x20%s',_0x3ca01f,_0x249764['error']['message']);return _0x54c0e0(_0x249764[_0xa958('0x12')][_0xa958('0x14')]);}logger[_0xa958('0x12')]('JscriptySessionReport,\x20%s,\x20%s',_0x3ca01f,_0x249764[_0xa958('0x12')]['message']);return _0x1895da(_0x249764['error']['message']);}else{logger[_0xa958('0xc')](_0xa958('0xd'),_0x3ca01f,_0xa958('0xe'));_0x1895da(_0x249764[_0xa958('0x15')][_0xa958('0x14')]);}})[_0xa958('0x16')](function(_0x23736f){logger[_0xa958('0x12')]('JscriptySessionReport,\x20%s,\x20%s',_0x3ca01f,_0x23736f);_0x54c0e0(_0x23736f);});});} \ No newline at end of file diff --git a/server/api/license/index.js b/server/api/license/index.js index b229949..ed570c2 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 _0x63d1=['path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./license.controller','get','put','/:id','isAuthenticated','update','/download_log_file','downloadLogFile','multer','util'];(function(_0x64c793,_0x482ecc){var _0x572b6a=function(_0x2ee57a){while(--_0x2ee57a){_0x64c793['push'](_0x64c793['shift']());}};_0x572b6a(++_0x482ecc);}(_0x63d1,0xa8));var _0x163d=function(_0x216fad,_0x5a11e6){_0x216fad=_0x216fad-0x0;var _0x256143=_0x63d1[_0x216fad];return _0x256143;};'use strict';var multer=require(_0x163d('0x0'));var util=require(_0x163d('0x1'));var path=require(_0x163d('0x2'));var timeout=require(_0x163d('0x3'));var express=require(_0x163d('0x4'));var router=express[_0x163d('0x5')]();var fs_extra=require(_0x163d('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x163d('0x7'));var config=require(_0x163d('0x8'));var controller=require(_0x163d('0x9'));router[_0x163d('0xa')]('/',controller['index']);router[_0x163d('0xb')](_0x163d('0xc'),auth[_0x163d('0xd')](),controller[_0x163d('0xe')]);router[_0x163d('0xa')](_0x163d('0xf'),auth['isAuthenticated'](),controller[_0x163d('0x10')]);module['exports']=router; \ No newline at end of file +var _0xc083=['put','isAuthenticated','update','exports','util','connect-timeout','express','Router','fs-extra','../../config/environment','get','index'];(function(_0x25270c,_0x51652e){var _0x4db07=function(_0x2b5e91){while(--_0x2b5e91){_0x25270c['push'](_0x25270c['shift']());}};_0x4db07(++_0x51652e);}(_0xc083,0x160));var _0x3c08=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0xc083[_0x5d6456];return _0x4d66c1;};'use strict';var multer=require('multer');var util=require(_0x3c08('0x0'));var path=require('path');var timeout=require(_0x3c08('0x1'));var express=require(_0x3c08('0x2'));var router=express[_0x3c08('0x3')]();var fs_extra=require(_0x3c08('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x3c08('0x5'));var controller=require('./license.controller');router[_0x3c08('0x6')]('/',controller[_0x3c08('0x7')]);router[_0x3c08('0x8')]('/:id',auth[_0x3c08('0x9')](),controller[_0x3c08('0xa')]);router['get']('/download_log_file',auth[_0x3c08('0x9')](),controller['downloadLogFile']);module[_0x3c08('0xb')]=router; \ No newline at end of file diff --git a/server/api/license/license.attributes.js b/server/api/license/license.attributes.js index 4617418..93a2e33 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 _0x26dc=['TEXT','STRING','INTEGER','sequelize','exports'];(function(_0x764874,_0x3ed544){var _0x29f9d5=function(_0x152dad){while(--_0x152dad){_0x764874['push'](_0x764874['shift']());}};_0x29f9d5(++_0x3ed544);}(_0x26dc,0x14d));var _0xc26d=function(_0x4ed4df,_0x6ab2ed){_0x4ed4df=_0x4ed4df-0x0;var _0x54496b=_0x26dc[_0x4ed4df];return _0x54496b;};'use strict';var Sequelize=require(_0xc26d('0x0'));module[_0xc26d('0x1')]={'license':{'type':Sequelize[_0xc26d('0x2')]},'data1':{'type':Sequelize[_0xc26d('0x3')]},'data2':{'type':Sequelize[_0xc26d('0x3')]},'chatLicenseExceeded':{'type':Sequelize[_0xc26d('0x4')],'defaultValue':0x0}}; \ No newline at end of file +var _0xcc4d=['TEXT','STRING','INTEGER','sequelize','exports'];(function(_0x9a75e5,_0x280bfb){var _0x3f5b06=function(_0x268533){while(--_0x268533){_0x9a75e5['push'](_0x9a75e5['shift']());}};_0x3f5b06(++_0x280bfb);}(_0xcc4d,0x1bb));var _0xdcc4=function(_0x4baae2,_0x487ab6){_0x4baae2=_0x4baae2-0x0;var _0x1a2285=_0xcc4d[_0x4baae2];return _0x1a2285;};'use strict';var Sequelize=require(_0xdcc4('0x0'));module[_0xdcc4('0x1')]={'license':{'type':Sequelize[_0xdcc4('0x2')]},'data1':{'type':Sequelize[_0xdcc4('0x3')]},'data2':{'type':Sequelize[_0xdcc4('0x3')]},'chatLicenseExceeded':{'type':Sequelize[_0xdcc4('0x4')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/license/license.controller.js b/server/api/license/license.controller.js index 1eca5f3..86f1045 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 _0x76e1=['sendStatus','status','end','json','offset','undefined','count','limit','set','apply','reject','save','update','destroy','then','name','index','model','keys','rawAttributes','query','attributes','intersection','fields','merge','getLicense','catch','body','License','get','checkLicense','demo','downloadLogFile','license-info.log','join','xcally','setHeader','Content-disposition','Content-Type','text/plain','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util'];(function(_0x3800a4,_0xcba569){var _0x31f156=function(_0x544b89){while(--_0x544b89){_0x3800a4['push'](_0x3800a4['shift']());}};_0x31f156(++_0xcba569);}(_0x76e1,0x1e8));var _0x176e=function(_0x5ef863,_0x3e880d){_0x5ef863=_0x5ef863-0x0;var _0x507ec2=_0x76e1[_0x5ef863];return _0x507ec2;};'use strict';var emlformat=require(_0x176e('0x0'));var rimraf=require(_0x176e('0x1'));var zipdir=require(_0x176e('0x2'));var jsonpatch=require(_0x176e('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x176e('0x4'));var Mustache=require(_0x176e('0x5'));var util=require(_0x176e('0x6'));var path=require(_0x176e('0x7'));var sox=require(_0x176e('0x8'));var csv=require(_0x176e('0x9'));var ejs=require(_0x176e('0xa'));var fs=require('fs');var fs_extra=require(_0x176e('0xb'));var _=require(_0x176e('0xc'));var squel=require(_0x176e('0xd'));var crypto=require(_0x176e('0xe'));var jsforce=require(_0x176e('0xf'));var deskjs=require(_0x176e('0x10'));var toCsv=require(_0x176e('0x9'));var querystring=require(_0x176e('0x11'));var Papa=require('papaparse');var Redis=require(_0x176e('0x12'));var authService=require(_0x176e('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x176e('0x14'));var logger=require(_0x176e('0x15'))('api');var utils=require(_0x176e('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x176e('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xf9ac4a,_0x5452a7){_0x5452a7=_0x5452a7||0xcc;return function(_0xddbf09){if(_0xddbf09){return _0xf9ac4a[_0x176e('0x18')](_0x5452a7);}return _0xf9ac4a[_0x176e('0x19')](_0x5452a7)[_0x176e('0x1a')]();};}function respondWithResult(_0x22dfc8,_0x552e00){_0x552e00=_0x552e00||0xc8;return function(_0x320b54){if(_0x320b54){return _0x22dfc8[_0x176e('0x19')](_0x552e00)[_0x176e('0x1b')](_0x320b54);}};}function respondWithFilteredResult(_0x14bad6,_0x18ee7f){return function(_0x2890a0){if(_0x2890a0){var _0xf9544=typeof _0x18ee7f[_0x176e('0x1c')]===_0x176e('0x1d')&&typeof _0x18ee7f['limit']===_0x176e('0x1d');var _0x2d4a12=_0x2890a0['count'];var _0x21469d=_0xf9544?0x0:_0x18ee7f['offset'];var _0x197e69=_0xf9544?_0x2890a0[_0x176e('0x1e')]:_0x18ee7f[_0x176e('0x1c')]+_0x18ee7f[_0x176e('0x1f')];var _0x45627a;if(_0x197e69>=_0x2d4a12){_0x197e69=_0x2d4a12;_0x45627a=0xc8;}else{_0x45627a=0xce;}_0x14bad6['status'](_0x45627a);return _0x14bad6[_0x176e('0x20')]('Content-Range',_0x21469d+'-'+_0x197e69+'/'+_0x2d4a12)['json'](_0x2890a0);}return null;};}function patchUpdates(_0x2b7a14){return function(_0x3f24f8){try{jsonpatch[_0x176e('0x21')](_0x3f24f8,_0x2b7a14,!![]);}catch(_0x4aed18){return BPromise[_0x176e('0x22')](_0x4aed18);}return _0x3f24f8[_0x176e('0x23')]();};}function saveUpdates(_0x28c338,_0x2ae798){return function(_0x1088b4){if(_0x1088b4){return _0x1088b4[_0x176e('0x24')](_0x28c338)['then'](function(_0x19d9a2){return _0x19d9a2;});}return null;};}function removeEntity(_0x5dede7,_0x42d099){return function(_0x2398d){if(_0x2398d){return _0x2398d[_0x176e('0x25')]()[_0x176e('0x26')](function(){_0x5dede7[_0x176e('0x19')](0xcc)[_0x176e('0x1a')]();});}};}function handleEntityNotFound(_0x2df41a,_0x5ac3d7){return function(_0x30417c){if(!_0x30417c){_0x2df41a['sendStatus'](0x194);}return _0x30417c;};}function handleError(_0x30d2e8,_0x3398a0){_0x3398a0=_0x3398a0||0x1f4;return function(_0x2e0725){logger['error'](_0x2e0725['stack']);if(_0x2e0725['name']){delete _0x2e0725[_0x176e('0x27')];}_0x30d2e8['status'](_0x3398a0)['send'](_0x2e0725);};}var utilLicense=require(_0x176e('0x17'));exports[_0x176e('0x28')]=function(_0x34f5a2,_0x2fb2dd){var _0x297ac9={'raw':!![],'where':{'id':0x1}},_0x198682={};_0x198682[_0x176e('0x29')]=_[_0x176e('0x2a')](db['License'][_0x176e('0x2b')]);_0x198682['query']=_[_0x176e('0x2a')](_0x34f5a2[_0x176e('0x2c')]);_0x198682['filters']=_['intersection'](_0x198682[_0x176e('0x29')],_0x198682[_0x176e('0x2c')]);_0x297ac9[_0x176e('0x2d')]=_[_0x176e('0x2e')](_0x198682[_0x176e('0x29')],qs[_0x176e('0x2f')](_0x34f5a2[_0x176e('0x2c')]['fields']));_0x297ac9[_0x176e('0x2d')]=_0x297ac9['attributes']['length']?_0x297ac9['attributes']:_0x198682[_0x176e('0x29')];_0x297ac9=_[_0x176e('0x30')]({},_0x297ac9,_0x34f5a2['options']);return utilLicense[_0x176e('0x31')](_0x297ac9)[_0x176e('0x26')](respondWithResult(_0x2fb2dd,null))[_0x176e('0x32')](handleError(_0x2fb2dd,null));};exports[_0x176e('0x24')]=function(_0x38f1c3,_0x32f4e9){if(_0x38f1c3[_0x176e('0x33')]['id']){delete _0x38f1c3['body']['id'];}return db[_0x176e('0x34')]['find']({'where':{'id':_0x38f1c3['params']['id']}})[_0x176e('0x26')](handleEntityNotFound(_0x32f4e9,null))[_0x176e('0x26')](function(_0xb9b24d){var _0x3948c4=_0xb9b24d[_0x176e('0x35')]({'plain':!![]});return utilLicense[_0x176e('0x36')](_0x3948c4,_0x38f1c3[_0x176e('0x33')]['key']);})[_0x176e('0x26')](function(_0x527572){if(!_0x527572[_0x176e('0x37')]){return saveUpdates(_0x38f1c3[_0x176e('0x33')],null);}return _0x527572;})[_0x176e('0x26')](respondWithResult(_0x32f4e9,null))[_0x176e('0x32')](handleError(_0x32f4e9,null));};exports[_0x176e('0x38')]=function(_0x2eb846,_0xcac49d){var _0x4f1fa0=_0x176e('0x39');var _0x25f6e1=path[_0x176e('0x3a')]('/var','log',_0x176e('0x3b'),_0x4f1fa0);_0xcac49d[_0x176e('0x3c')](_0x176e('0x3d'),'attachment;\x20filename='+_0x4f1fa0);_0xcac49d[_0x176e('0x20')](_0x176e('0x3e'),_0x176e('0x3f'));_0xcac49d['download'](_0x25f6e1);}; \ No newline at end of file +var _0x884d=['xcally','setHeader','Content-disposition','text/plain','download','eml-format','zip-dir','fast-json-patch','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','../../config/license/util','status','json','offset','limit','undefined','count','Content-Range','reject','update','then','destroy','end','stack','send','index','model','keys','License','rawAttributes','query','filters','fields','attributes','length','merge','getLicense','catch','body','params','checkLicense','key','downloadLogFile','license-info.log','join','log'];(function(_0x19a4f1,_0x4b88d4){var _0x407ddb=function(_0x417999){while(--_0x417999){_0x19a4f1['push'](_0x19a4f1['shift']());}};_0x407ddb(++_0x4b88d4);}(_0x884d,0x1d3));var _0xd884=function(_0x429769,_0x5904a4){_0x429769=_0x429769-0x0;var _0x215a17=_0x884d[_0x429769];return _0x215a17;};'use strict';var emlformat=require(_0xd884('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd884('0x1'));var jsonpatch=require(_0xd884('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xd884('0x3'));var Mustache=require(_0xd884('0x4'));var util=require(_0xd884('0x5'));var path=require('path');var sox=require(_0xd884('0x6'));var csv=require(_0xd884('0x7'));var ejs=require(_0xd884('0x8'));var fs=require('fs');var fs_extra=require(_0xd884('0x9'));var _=require(_0xd884('0xa'));var squel=require(_0xd884('0xb'));var crypto=require(_0xd884('0xc'));var jsforce=require(_0xd884('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xd884('0x7'));var querystring=require(_0xd884('0xe'));var Papa=require(_0xd884('0xf'));var Redis=require(_0xd884('0x10'));var authService=require(_0xd884('0x11'));var qs=require(_0xd884('0x12'));var as=require(_0xd884('0x13'));var hardwareService=require(_0xd884('0x14'));var logger=require(_0xd884('0x15'))(_0xd884('0x16'));var utils=require(_0xd884('0x17'));var config=require(_0xd884('0x18'));var licenseUtil=require(_0xd884('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3297f9,_0x60ce4c){_0x60ce4c=_0x60ce4c||0xcc;return function(_0x43df79){if(_0x43df79){return _0x3297f9['sendStatus'](_0x60ce4c);}return _0x3297f9[_0xd884('0x1a')](_0x60ce4c)['end']();};}function respondWithResult(_0x39a116,_0x32f1eb){_0x32f1eb=_0x32f1eb||0xc8;return function(_0x28c493){if(_0x28c493){return _0x39a116[_0xd884('0x1a')](_0x32f1eb)[_0xd884('0x1b')](_0x28c493);}};}function respondWithFilteredResult(_0x37233b,_0x34d2){return function(_0x24f235){if(_0x24f235){var _0x50fb10=typeof _0x34d2[_0xd884('0x1c')]==='undefined'&&typeof _0x34d2[_0xd884('0x1d')]===_0xd884('0x1e');var _0x1bc134=_0x24f235['count'];var _0x228c53=_0x50fb10?0x0:_0x34d2[_0xd884('0x1c')];var _0x4b9d36=_0x50fb10?_0x24f235[_0xd884('0x1f')]:_0x34d2[_0xd884('0x1c')]+_0x34d2['limit'];var _0x59e10a;if(_0x4b9d36>=_0x1bc134){_0x4b9d36=_0x1bc134;_0x59e10a=0xc8;}else{_0x59e10a=0xce;}_0x37233b[_0xd884('0x1a')](_0x59e10a);return _0x37233b['set'](_0xd884('0x20'),_0x228c53+'-'+_0x4b9d36+'/'+_0x1bc134)[_0xd884('0x1b')](_0x24f235);}return null;};}function patchUpdates(_0x223793){return function(_0x4459c1){try{jsonpatch['apply'](_0x4459c1,_0x223793,!![]);}catch(_0x2e9c1a){return BPromise[_0xd884('0x21')](_0x2e9c1a);}return _0x4459c1['save']();};}function saveUpdates(_0x4bc241,_0x279879){return function(_0x5e8ea8){if(_0x5e8ea8){return _0x5e8ea8[_0xd884('0x22')](_0x4bc241)[_0xd884('0x23')](function(_0x214443){return _0x214443;});}return null;};}function removeEntity(_0xe74466,_0x3ee07f){return function(_0x93f2c8){if(_0x93f2c8){return _0x93f2c8[_0xd884('0x24')]()[_0xd884('0x23')](function(){_0xe74466[_0xd884('0x1a')](0xcc)[_0xd884('0x25')]();});}};}function handleEntityNotFound(_0xf72f30,_0x5517e6){return function(_0x4ad722){if(!_0x4ad722){_0xf72f30['sendStatus'](0x194);}return _0x4ad722;};}function handleError(_0x295d81,_0x9d388c){_0x9d388c=_0x9d388c||0x1f4;return function(_0x220089){logger['error'](_0x220089[_0xd884('0x26')]);if(_0x220089['name']){delete _0x220089['name'];}_0x295d81[_0xd884('0x1a')](_0x9d388c)[_0xd884('0x27')](_0x220089);};}var utilLicense=require(_0xd884('0x19'));exports[_0xd884('0x28')]=function(_0x862fdc,_0x1f9f0d){var _0x431ace={'raw':!![],'where':{'id':0x1}},_0x230229={};_0x230229[_0xd884('0x29')]=_[_0xd884('0x2a')](db[_0xd884('0x2b')][_0xd884('0x2c')]);_0x230229[_0xd884('0x2d')]=_['keys'](_0x862fdc[_0xd884('0x2d')]);_0x230229[_0xd884('0x2e')]=_['intersection'](_0x230229[_0xd884('0x29')],_0x230229['query']);_0x431ace['attributes']=_['intersection'](_0x230229['model'],qs['fields'](_0x862fdc[_0xd884('0x2d')][_0xd884('0x2f')]));_0x431ace[_0xd884('0x30')]=_0x431ace[_0xd884('0x30')][_0xd884('0x31')]?_0x431ace['attributes']:_0x230229[_0xd884('0x29')];_0x431ace=_[_0xd884('0x32')]({},_0x431ace,_0x862fdc['options']);return utilLicense[_0xd884('0x33')](_0x431ace)['then'](respondWithResult(_0x1f9f0d,null))[_0xd884('0x34')](handleError(_0x1f9f0d,null));};exports[_0xd884('0x22')]=function(_0x38f6a3,_0x1e7a81){if(_0x38f6a3[_0xd884('0x35')]['id']){delete _0x38f6a3[_0xd884('0x35')]['id'];}return db[_0xd884('0x2b')]['find']({'where':{'id':_0x38f6a3[_0xd884('0x36')]['id']}})['then'](handleEntityNotFound(_0x1e7a81,null))[_0xd884('0x23')](function(_0x44c45a){var _0x30e57c=_0x44c45a['get']({'plain':!![]});return utilLicense[_0xd884('0x37')](_0x30e57c,_0x38f6a3['body'][_0xd884('0x38')]);})['then'](function(_0x340ccd){if(!_0x340ccd['demo']){return saveUpdates(_0x38f6a3[_0xd884('0x35')],null);}return _0x340ccd;})['then'](respondWithResult(_0x1e7a81,null))[_0xd884('0x34')](handleError(_0x1e7a81,null));};exports[_0xd884('0x39')]=function(_0x54ecc7,_0xa762ee){var _0x8662c8=_0xd884('0x3a');var _0x348b20=path[_0xd884('0x3b')]('/var',_0xd884('0x3c'),_0xd884('0x3d'),_0x8662c8);_0xa762ee[_0xd884('0x3e')](_0xd884('0x3f'),'attachment;\x20filename='+_0x8662c8);_0xa762ee['set']('Content-Type',_0xd884('0x40'));_0xa762ee[_0xd884('0x41')](_0x348b20);}; \ No newline at end of file diff --git a/server/api/license/license.model.js b/server/api/license/license.model.js index 5b7f3a7..53de84d 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 _0xdf8d=['moment','request-promise','rimraf','../../config/environment','./license.attributes','exports','define','License','license','lodash','api'];(function(_0x381b84,_0x55d045){var _0x5b11dc=function(_0x262e92){while(--_0x262e92){_0x381b84['push'](_0x381b84['shift']());}};_0x5b11dc(++_0x55d045);}(_0xdf8d,0xf0));var _0xddf8=function(_0x1a0daa,_0x2a4634){_0x1a0daa=_0x1a0daa-0x0;var _0x1dbe15=_0xdf8d[_0x1a0daa];return _0x1dbe15;};'use strict';var _=require(_0xddf8('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xddf8('0x1'));var moment=require(_0xddf8('0x2'));var BPromise=require('bluebird');var rp=require(_0xddf8('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xddf8('0x4'));var config=require(_0xddf8('0x5'));var attributes=require(_0xddf8('0x6'));module[_0xddf8('0x7')]=function(_0x59b164,_0x20919e){return _0x59b164[_0xddf8('0x8')](_0xddf8('0x9'),attributes,{'tableName':_0xddf8('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6442=['define','License','license','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./license.attributes'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x6442,0xb9));var _0x2644=function(_0x2064e5,_0x4f6fa2){_0x2064e5=_0x2064e5-0x0;var _0x21a233=_0x6442[_0x2064e5];return _0x21a233;};'use strict';var _=require(_0x2644('0x0'));var util=require(_0x2644('0x1'));var logger=require(_0x2644('0x2'))(_0x2644('0x3'));var moment=require(_0x2644('0x4'));var BPromise=require(_0x2644('0x5'));var rp=require(_0x2644('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2644('0x7'));var config=require(_0x2644('0x8'));var attributes=require(_0x2644('0x9'));module['exports']=function(_0x62809f,_0x26be30){return _0x62809f[_0x2644('0xa')](_0x2644('0xb'),attributes,{'tableName':_0x2644('0xc'),'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 53c80e9..36dc37b 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 _0xf652=['../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug','License,\x20%s,\x20%s,\x20%s','stringify','code','error','License,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x35c993,_0x5e8fe1){var _0x3824dd=function(_0x568725){while(--_0x568725){_0x35c993['push'](_0x35c993['shift']());}};_0x3824dd(++_0x5e8fe1);}(_0xf652,0x163));var _0x2f65=function(_0x381b56,_0x3aef75){_0x381b56=_0x381b56-0x0;var _0xa8f18a=_0xf652[_0x381b56];return _0xa8f18a;};'use strict';var _=require(_0x2f65('0x0'));var util=require(_0x2f65('0x1'));var moment=require(_0x2f65('0x2'));var BPromise=require(_0x2f65('0x3'));var rs=require(_0x2f65('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2f65('0x5'))['db'];var utils=require(_0x2f65('0x6'));var logger=require('../../config/logger')(_0x2f65('0x7'));var config=require(_0x2f65('0x8'));var jayson=require(_0x2f65('0x9'));var client=jayson[_0x2f65('0xa')][_0x2f65('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1e943e,_0x161e8a,_0x1253ae){return new BPromise(function(_0x57664e,_0x5cad73){return client[_0x2f65('0xc')](_0x1e943e,_0x1253ae)['then'](function(_0x263393){logger[_0x2f65('0xd')]('License,\x20%s,\x20%s',_0x161e8a,_0x2f65('0xe'));logger[_0x2f65('0xf')](_0x2f65('0x10'),_0x161e8a,_0x2f65('0xe'),JSON[_0x2f65('0x11')](_0x263393));if(_0x263393['error']){if(_0x263393['error'][_0x2f65('0x12')]===0x1f4){logger[_0x2f65('0x13')](_0x2f65('0x14'),_0x161e8a,_0x263393[_0x2f65('0x13')][_0x2f65('0x15')]);return _0x5cad73(_0x263393[_0x2f65('0x13')][_0x2f65('0x15')]);}logger[_0x2f65('0x13')]('License,\x20%s,\x20%s',_0x161e8a,_0x263393[_0x2f65('0x13')][_0x2f65('0x15')]);return _0x57664e(_0x263393[_0x2f65('0x13')]['message']);}else{logger['info'](_0x2f65('0x14'),_0x161e8a,'request\x20sent');_0x57664e(_0x263393[_0x2f65('0x16')][_0x2f65('0x15')]);}})[_0x2f65('0x17')](function(_0x3ac1b7){logger[_0x2f65('0x13')](_0x2f65('0x14'),_0x161e8a,_0x3ac1b7);_0x5cad73(_0x3ac1b7);});});} \ No newline at end of file +var _0xafd2=['info','License,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request'];(function(_0x5c862b,_0xc9e398){var _0x4f286e=function(_0x1dc738){while(--_0x1dc738){_0x5c862b['push'](_0x5c862b['shift']());}};_0x4f286e(++_0xc9e398);}(_0xafd2,0x127));var _0x2afd=function(_0x53a605,_0x259bee){_0x53a605=_0x53a605-0x0;var _0x1f93e5=_0xafd2[_0x53a605];return _0x1f93e5;};'use strict';var _=require(_0x2afd('0x0'));var util=require(_0x2afd('0x1'));var moment=require(_0x2afd('0x2'));var BPromise=require(_0x2afd('0x3'));var rs=require(_0x2afd('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2afd('0x5'))['db'];var utils=require(_0x2afd('0x6'));var logger=require(_0x2afd('0x7'))(_0x2afd('0x8'));var config=require(_0x2afd('0x9'));var jayson=require(_0x2afd('0xa'));var client=jayson['client'][_0x2afd('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x140b66,_0xd77b23,_0x5445f9){return new BPromise(function(_0xe13a9,_0x205a7d){return client[_0x2afd('0xc')](_0x140b66,_0x5445f9)['then'](function(_0x5bc6cb){logger[_0x2afd('0xd')](_0x2afd('0xe'),_0xd77b23,_0x2afd('0xf'));logger[_0x2afd('0x10')]('License,\x20%s,\x20%s,\x20%s',_0xd77b23,_0x2afd('0xf'),JSON[_0x2afd('0x11')](_0x5bc6cb));if(_0x5bc6cb[_0x2afd('0x12')]){if(_0x5bc6cb[_0x2afd('0x12')][_0x2afd('0x13')]===0x1f4){logger[_0x2afd('0x12')](_0x2afd('0xe'),_0xd77b23,_0x5bc6cb[_0x2afd('0x12')][_0x2afd('0x14')]);return _0x205a7d(_0x5bc6cb[_0x2afd('0x12')][_0x2afd('0x14')]);}logger[_0x2afd('0x12')](_0x2afd('0xe'),_0xd77b23,_0x5bc6cb[_0x2afd('0x12')][_0x2afd('0x14')]);return _0xe13a9(_0x5bc6cb[_0x2afd('0x12')][_0x2afd('0x14')]);}else{logger[_0x2afd('0xd')](_0x2afd('0xe'),_0xd77b23,_0x2afd('0xf'));_0xe13a9(_0x5bc6cb['result'][_0x2afd('0x14')]);}})[_0x2afd('0x15')](function(_0x55a77c){logger[_0x2afd('0x12')](_0x2afd('0xe'),_0xd77b23,_0x55a77c);_0x205a7d(_0x55a77c);});});} \ No newline at end of file diff --git a/server/api/mailAccount/index.js b/server/api/mailAccount/index.js index 60c93ba..ac19c07 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 _0xb829=['removeDispositions','removeSmtp','removeAgents','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../config/environment','./mailAccount.controller','get','index','isAuthenticated','describe','/:id','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','getImap','/:id/out_servers','getSmtp','/:id/interactions','getInteractions','/:id/applications','getApplications','/:id/messages','getMessages','verifySmtp','/:id/users','addAnswer','post','/:id/in_servers','addSmtp','addApplications','/:id/send','send','addAgents','put','update','delete'];(function(_0x29d6e6,_0x264220){var _0xc75ff0=function(_0x214f6b){while(--_0x214f6b){_0x29d6e6['push'](_0x29d6e6['shift']());}};_0xc75ff0(++_0x264220);}(_0xb829,0x106));var _0x9b82=function(_0x230cc0,_0x316542){_0x230cc0=_0x230cc0-0x0;var _0x2ecaf9=_0xb829[_0x230cc0];return _0x2ecaf9;};'use strict';var multer=require(_0x9b82('0x0'));var util=require(_0x9b82('0x1'));var path=require(_0x9b82('0x2'));var timeout=require('connect-timeout');var express=require(_0x9b82('0x3'));var router=express['Router']();var fs_extra=require(_0x9b82('0x4'));var auth=require(_0x9b82('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x9b82('0x6'));var controller=require(_0x9b82('0x7'));router[_0x9b82('0x8')]('/',auth['isAuthenticated'](),controller[_0x9b82('0x9')]);router[_0x9b82('0x8')]('/describe',auth[_0x9b82('0xa')](),controller[_0x9b82('0xb')]);router[_0x9b82('0x8')](_0x9b82('0xc'),auth[_0x9b82('0xa')](),controller['show']);router[_0x9b82('0x8')](_0x9b82('0xd'),auth[_0x9b82('0xa')](),controller[_0x9b82('0xe')]);router[_0x9b82('0x8')](_0x9b82('0xf'),auth[_0x9b82('0xa')](),controller[_0x9b82('0x10')]);router[_0x9b82('0x8')]('/:id/in_servers',auth[_0x9b82('0xa')](),controller[_0x9b82('0x11')]);router[_0x9b82('0x8')](_0x9b82('0x12'),auth[_0x9b82('0xa')](),controller[_0x9b82('0x13')]);router[_0x9b82('0x8')](_0x9b82('0x14'),auth[_0x9b82('0xa')](),controller[_0x9b82('0x15')]);router['get'](_0x9b82('0x16'),auth[_0x9b82('0xa')](),controller[_0x9b82('0x17')]);router[_0x9b82('0x8')](_0x9b82('0x18'),auth['isAuthenticated'](),controller[_0x9b82('0x19')]);router['get']('/:id/verify',auth[_0x9b82('0xa')](),controller[_0x9b82('0x1a')]);router['get'](_0x9b82('0x1b'),auth[_0x9b82('0xa')](),controller['getAgents']);router['post'](_0x9b82('0xd'),auth[_0x9b82('0xa')](),controller['addDisposition']);router['post'](_0x9b82('0xf'),auth[_0x9b82('0xa')](),controller[_0x9b82('0x1c')]);router[_0x9b82('0x1d')]('/',auth[_0x9b82('0xa')](),controller['create']);router[_0x9b82('0x1d')](_0x9b82('0x1e'),auth[_0x9b82('0xa')](),controller['addImap']);router[_0x9b82('0x1d')]('/:id/out_servers',auth[_0x9b82('0xa')](),controller[_0x9b82('0x1f')]);router['post']('/:id/interactions',auth[_0x9b82('0xa')](),controller['addInteraction']);router['post'](_0x9b82('0x16'),auth['isAuthenticated'](),controller[_0x9b82('0x20')]);router[_0x9b82('0x1d')](_0x9b82('0x21'),auth['isAuthenticated'](),controller[_0x9b82('0x22')]);router['post'](_0x9b82('0x1b'),auth['isAuthenticated'](),controller[_0x9b82('0x23')]);router[_0x9b82('0x24')](_0x9b82('0xc'),auth[_0x9b82('0xa')](),controller[_0x9b82('0x25')]);router[_0x9b82('0x26')]('/:id/dispositions',auth[_0x9b82('0xa')](),controller[_0x9b82('0x27')]);router[_0x9b82('0x26')]('/:id/canned_answers',auth[_0x9b82('0xa')](),controller['removeAnswers']);router[_0x9b82('0x26')](_0x9b82('0x1e'),auth[_0x9b82('0xa')](),controller['removeImap']);router['delete'](_0x9b82('0x12'),auth['isAuthenticated'](),controller[_0x9b82('0x28')]);router['delete'](_0x9b82('0xc'),auth[_0x9b82('0xa')](),controller['destroy']);router[_0x9b82('0x26')](_0x9b82('0x1b'),auth[_0x9b82('0xa')](),controller[_0x9b82('0x29')]);module[_0x9b82('0x2a')]=router; \ No newline at end of file +var _0xbd55=['put','update','delete','removeImap','removeSmtp','destroy','removeAgents','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./mailAccount.controller','get','isAuthenticated','index','/describe','describe','/:id','show','getDispositions','/:id/canned_answers','getImap','getSmtp','/:id/interactions','/:id/applications','getApplications','verifySmtp','/:id/users','post','/:id/dispositions','addDisposition','addAnswer','create','/:id/in_servers','addImap','/:id/out_servers','addInteraction','/:id/send','send','addAgents'];(function(_0x5033dd,_0x461567){var _0x203173=function(_0x2400ab){while(--_0x2400ab){_0x5033dd['push'](_0x5033dd['shift']());}};_0x203173(++_0x461567);}(_0xbd55,0x15f));var _0x5bd5=function(_0x50af79,_0x26774e){_0x50af79=_0x50af79-0x0;var _0xebf22a=_0xbd55[_0x50af79];return _0xebf22a;};'use strict';var multer=require(_0x5bd5('0x0'));var util=require(_0x5bd5('0x1'));var path=require(_0x5bd5('0x2'));var timeout=require(_0x5bd5('0x3'));var express=require(_0x5bd5('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x5bd5('0x5'));var interaction=require(_0x5bd5('0x6'));var config=require('../../config/environment');var controller=require(_0x5bd5('0x7'));router[_0x5bd5('0x8')]('/',auth[_0x5bd5('0x9')](),controller[_0x5bd5('0xa')]);router[_0x5bd5('0x8')](_0x5bd5('0xb'),auth['isAuthenticated'](),controller[_0x5bd5('0xc')]);router[_0x5bd5('0x8')](_0x5bd5('0xd'),auth[_0x5bd5('0x9')](),controller[_0x5bd5('0xe')]);router[_0x5bd5('0x8')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0x5bd5('0xf')]);router[_0x5bd5('0x8')](_0x5bd5('0x10'),auth[_0x5bd5('0x9')](),controller['getAnswers']);router['get']('/:id/in_servers',auth[_0x5bd5('0x9')](),controller[_0x5bd5('0x11')]);router[_0x5bd5('0x8')]('/:id/out_servers',auth['isAuthenticated'](),controller[_0x5bd5('0x12')]);router[_0x5bd5('0x8')](_0x5bd5('0x13'),auth[_0x5bd5('0x9')](),controller['getInteractions']);router[_0x5bd5('0x8')](_0x5bd5('0x14'),auth[_0x5bd5('0x9')](),controller[_0x5bd5('0x15')]);router[_0x5bd5('0x8')]('/:id/messages',auth[_0x5bd5('0x9')](),controller['getMessages']);router['get']('/:id/verify',auth[_0x5bd5('0x9')](),controller[_0x5bd5('0x16')]);router[_0x5bd5('0x8')](_0x5bd5('0x17'),auth[_0x5bd5('0x9')](),controller['getAgents']);router[_0x5bd5('0x18')](_0x5bd5('0x19'),auth[_0x5bd5('0x9')](),controller[_0x5bd5('0x1a')]);router[_0x5bd5('0x18')](_0x5bd5('0x10'),auth[_0x5bd5('0x9')](),controller[_0x5bd5('0x1b')]);router[_0x5bd5('0x18')]('/',auth['isAuthenticated'](),controller[_0x5bd5('0x1c')]);router[_0x5bd5('0x18')](_0x5bd5('0x1d'),auth[_0x5bd5('0x9')](),controller[_0x5bd5('0x1e')]);router[_0x5bd5('0x18')](_0x5bd5('0x1f'),auth[_0x5bd5('0x9')](),controller['addSmtp']);router[_0x5bd5('0x18')](_0x5bd5('0x13'),auth[_0x5bd5('0x9')](),controller[_0x5bd5('0x20')]);router[_0x5bd5('0x18')](_0x5bd5('0x14'),auth[_0x5bd5('0x9')](),controller['addApplications']);router['post'](_0x5bd5('0x21'),auth['isAuthenticated'](),controller[_0x5bd5('0x22')]);router[_0x5bd5('0x18')](_0x5bd5('0x17'),auth[_0x5bd5('0x9')](),controller[_0x5bd5('0x23')]);router[_0x5bd5('0x24')]('/:id',auth[_0x5bd5('0x9')](),controller[_0x5bd5('0x25')]);router[_0x5bd5('0x26')]('/:id/dispositions',auth[_0x5bd5('0x9')](),controller['removeDispositions']);router[_0x5bd5('0x26')](_0x5bd5('0x10'),auth[_0x5bd5('0x9')](),controller['removeAnswers']);router[_0x5bd5('0x26')](_0x5bd5('0x1d'),auth['isAuthenticated'](),controller[_0x5bd5('0x27')]);router[_0x5bd5('0x26')](_0x5bd5('0x1f'),auth[_0x5bd5('0x9')](),controller[_0x5bd5('0x28')]);router[_0x5bd5('0x26')](_0x5bd5('0xd'),auth[_0x5bd5('0x9')](),controller[_0x5bd5('0x29')]);router[_0x5bd5('0x26')]('/:id/users',auth[_0x5bd5('0x9')](),controller[_0x5bd5('0x2a')]);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 3175912..711607b 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 _0x27ab=['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','setDataValue','mandatoryDispositionPauseId','ENUM','gmail','hotmail','yahoo','getDataValue','provider','custom','sequelize','STRING','BOOLEAN','TEXT','INTEGER','UNSIGNED'];(function(_0x476bf4,_0x2a3755){var _0x788ffe=function(_0x13fa11){while(--_0x13fa11){_0x476bf4['push'](_0x476bf4['shift']());}};_0x788ffe(++_0x2a3755);}(_0x27ab,0x1c5));var _0xb27a=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x27ab[_0x19e35c];return _0x3e1fe8;};'use strict';var Sequelize=require(_0xb27a('0x0'));module['exports']={'description':{'type':Sequelize[_0xb27a('0x1')]},'name':{'type':Sequelize[_0xb27a('0x1')],'allowNull':![]},'service':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0xb27a('0x2')],'defaultValue':!![]},'key':{'type':Sequelize[_0xb27a('0x1')],'allowNull':![]},'template':{'type':Sequelize[_0xb27a('0x3')]},'markAsUnread':{'type':Sequelize[_0xb27a('0x2')],'defaultValue':![]},'fontFamily':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'Arial,Helvetica,sans-serif'},'fontSize':{'type':Sequelize[_0xb27a('0x4')](0x2)[_0xb27a('0x5')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0xb27a('0x3')],'defaultValue':function(){return _0xb27a('0x6');}},'notificationSound':{'type':Sequelize[_0xb27a('0x2')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xb27a('0x2')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0xb27a('0x4')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xb27a('0x4')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xb27a('0x2')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xb27a('0x4')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':_0xb27a('0x7')},'mandatoryDisposition':{'type':Sequelize[_0xb27a('0x2')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0xfaf983){if(!_0xfaf983)this[_0xb27a('0x8')](_0xb27a('0x9'),null);this[_0xb27a('0x8')]('mandatoryDisposition',_0xfaf983);}},'provider':{'type':Sequelize[_0xb27a('0xa')](_0xb27a('0xb'),_0xb27a('0xc'),_0xb27a('0xd'),'outlook365'),'defaultValue':null,'get':function(){if(!this[_0xb27a('0xe')](_0xb27a('0xf')))return'custom';return this[_0xb27a('0xe')](_0xb27a('0xf'));},'set':function(_0x1c8305){if(_0x1c8305===_0xb27a('0x10'))_0x1c8305=null;return this[_0xb27a('0x8')](_0xb27a('0xf'),_0x1c8305);}}}; \ No newline at end of file +var _0x8f73=['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','mandatoryDispositionPauseId','setDataValue','mandatoryDisposition','hotmail','yahoo','provider','custom','getDataValue','sequelize','STRING','BOOLEAN','TEXT','INTEGER','UNSIGNED'];(function(_0x245afe,_0x319cde){var _0x4eefde=function(_0x15a1fa){while(--_0x15a1fa){_0x245afe['push'](_0x245afe['shift']());}};_0x4eefde(++_0x319cde);}(_0x8f73,0x13a));var _0x38f7=function(_0x15bc81,_0x4d4f77){_0x15bc81=_0x15bc81-0x0;var _0x59440e=_0x8f73[_0x15bc81];return _0x59440e;};'use strict';var Sequelize=require(_0x38f7('0x0'));module['exports']={'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize[_0x38f7('0x1')],'allowNull':![]},'service':{'type':Sequelize[_0x38f7('0x2')],'defaultValue':![]},'email':{'type':Sequelize[_0x38f7('0x1')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'key':{'type':Sequelize[_0x38f7('0x1')],'allowNull':![]},'template':{'type':Sequelize[_0x38f7('0x3')]},'markAsUnread':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fontFamily':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'Arial,Helvetica,sans-serif'},'fontSize':{'type':Sequelize[_0x38f7('0x4')](0x2)[_0x38f7('0x5')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0x38f7('0x3')],'defaultValue':function(){return _0x38f7('0x6');}},'notificationSound':{'type':Sequelize[_0x38f7('0x2')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x38f7('0x2')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x38f7('0x4')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x38f7('0x2')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x38f7('0x2')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x38f7('0x4')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x38f7('0x4')],'allowNull':!![],'defaultValue':null,'comment':_0x38f7('0x7')},'mandatoryDisposition':{'type':Sequelize[_0x38f7('0x2')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x3015df){if(!_0x3015df)this['setDataValue'](_0x38f7('0x8'),null);this[_0x38f7('0x9')](_0x38f7('0xa'),_0x3015df);}},'provider':{'type':Sequelize['ENUM']('gmail',_0x38f7('0xb'),_0x38f7('0xc'),'outlook365'),'defaultValue':null,'get':function(){if(!this['getDataValue'](_0x38f7('0xd')))return _0x38f7('0xe');return this[_0x38f7('0xf')]('provider');},'set':function(_0x56c7aa){if(_0x56c7aa===_0x38f7('0xe'))_0x56c7aa=null;return this['setDataValue'](_0x38f7('0xd'),_0x56c7aa);}}}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.controller.js b/server/api/mailAccount/mailAccount.controller.js index 7245ace..48ecc3b 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 _0x0fc4=['path','lodash','juice','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','defaults','redis','localhost','./mailAccount.socket','register','jayson/promise','client','http','request','then','MailAccount,\x20%s,\x20%s','debug','MailAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','catch','status','end','json','undefined','count','offset','limit','Content-Range','update','destroy','MailAccounts','UserProfileResource','stack','name','send','gmail','yahoo','hotmail','imap-mail.outlook.com','outlook.office365.com','Unknown\x20email\x20service\x20provider','smtp.gmail.com','outlook365','smtp.office365.com','user','username','password','pass','modernAuthentication','CloudProviderId','host','port','secure','service','authentication','Imap','Smtp','index','MailServerIn','MailServerOut','Pause','mandatoryDispositionPause','map','MailAccount','rawAttributes','fieldName','key','query','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','type','VIRTUAL','merge','options','include','findAll','rows','params','keys','length','includeAll','body','custom','provider','find','Mail\x20Account\x20not\x20found','describe','addDisposition','MailAccountId','Disposition','create','getDispositions','findOne','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','email','ListId','isNil','active','description','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','addImap','removeImap','getSmtp','addSmtp','removeSmtp','setSmtp','addInteraction','MailInteraction','omit','getInteractions','Contact','User','Owner','fullname','internal','Tag','Tags','color','tag','addApplications','transaction','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','MailApplication','priority','finally','sendStatus','getApplications','MailMessage','$gte','split','YYYY-MM-DD\x20HH:mm:ss','true','List','CmContact','CloudProvider','Smtp\x20configuration\x20not\x20found','from','format','attachments','root','server/files/attachments','basename','getSmtpOptions','SendMail','List\x20not\x20found','Contacts','messageId','subject','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','moment','util'];(function(_0x15b399,_0x59db1a){var _0x199f2d=function(_0x3bd31c){while(--_0x3bd31c){_0x15b399['push'](_0x15b399['shift']());}};_0x199f2d(++_0x59db1a);}(_0x0fc4,0xc2));var _0x40fc=function(_0x4eec9b,_0x4aea09){_0x4eec9b=_0x4eec9b-0x0;var _0x2e3849=_0x0fc4[_0x4eec9b];return _0x2e3849;};'use strict';var moment=require(_0x40fc('0x0'));var BPromise=require('bluebird');var util=require(_0x40fc('0x1'));var path=require(_0x40fc('0x2'));var _=require(_0x40fc('0x3'));var juice=require(_0x40fc('0x4'));var Redis=require(_0x40fc('0x5'));var qs=require(_0x40fc('0x6'));var logger=require(_0x40fc('0x7'))(_0x40fc('0x8'));var config=require(_0x40fc('0x9'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x40fc('0xa')](config[_0x40fc('0xb')],{'host':_0x40fc('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x40fc('0xb')]));require(_0x40fc('0xd'))[_0x40fc('0xe')](socket);var jayson=require(_0x40fc('0xf'));var client=jayson[_0x40fc('0x10')][_0x40fc('0x11')]({'port':0x232b});function respondWithRpcPromise(_0x555310,_0x29f2ec,_0x17c07b,_0xa3a6a2){return new BPromise(function(_0x59f2b5,_0x15c5a9){var _0x367dd2=_0xa3a6a2||client;return _0x367dd2[_0x40fc('0x12')](_0x555310,_0x17c07b)[_0x40fc('0x13')](function(_0x340209){logger['info'](_0x40fc('0x14'),_0x29f2ec,'request\x20sent');logger[_0x40fc('0x15')](_0x40fc('0x16'),_0x29f2ec,_0x40fc('0x17'),JSON[_0x40fc('0x18')](_0x340209));if(_0x340209['error']){if(_0x340209[_0x40fc('0x19')][_0x40fc('0x1a')]===0x1f4){logger['error'](_0x40fc('0x14'),_0x29f2ec,_0x340209[_0x40fc('0x19')]['message']);return _0x15c5a9(_0x340209[_0x40fc('0x19')][_0x40fc('0x1b')]);}logger[_0x40fc('0x19')](_0x40fc('0x14'),_0x29f2ec,_0x340209[_0x40fc('0x19')][_0x40fc('0x1b')]);return _0x59f2b5(_0x340209[_0x40fc('0x19')][_0x40fc('0x1b')]);}else{logger[_0x40fc('0x1c')](_0x40fc('0x14'),_0x29f2ec,'request\x20sent');_0x59f2b5(_0x340209['result'][_0x40fc('0x1b')]);}})[_0x40fc('0x1d')](function(_0x44243f){logger[_0x40fc('0x19')](_0x40fc('0x14'),_0x29f2ec,_0x44243f);_0x15c5a9(_0x44243f);});});}function respondWithStatusCode(_0x587c7e,_0x8a2632){_0x8a2632=_0x8a2632||0xcc;return function(_0x50bae0){if(_0x50bae0){return _0x587c7e['sendStatus'](_0x8a2632);}return _0x587c7e[_0x40fc('0x1e')](_0x8a2632)[_0x40fc('0x1f')]();};}function respondWithResult(_0x5059c2,_0x155578){_0x155578=_0x155578||0xc8;return function(_0xb4f5ff){if(_0xb4f5ff){return _0x5059c2[_0x40fc('0x1e')](_0x155578)[_0x40fc('0x20')](_0xb4f5ff);}};}function respondWithFilteredResult(_0xee5349,_0x375ddf){return function(_0x3f424e){if(_0x3f424e){var _0x52b56d=typeof _0x375ddf['offset']===_0x40fc('0x21')&&typeof _0x375ddf['limit']==='undefined';var _0x567664=_0x3f424e[_0x40fc('0x22')];var _0x10ac1e=_0x52b56d?0x0:_0x375ddf[_0x40fc('0x23')];var _0x1608aa=_0x52b56d?_0x3f424e[_0x40fc('0x22')]:_0x375ddf[_0x40fc('0x23')]+_0x375ddf[_0x40fc('0x24')];var _0x474325;if(_0x1608aa>=_0x567664){_0x1608aa=_0x567664;_0x474325=0xc8;}else{_0x474325=0xce;}_0xee5349[_0x40fc('0x1e')](_0x474325);return _0xee5349['set'](_0x40fc('0x25'),_0x10ac1e+'-'+_0x1608aa+'/'+_0x567664)['json'](_0x3f424e);}return null;};}function saveUpdates(_0x320240){return function(_0x164ec8){if(_0x164ec8){return _0x164ec8[_0x40fc('0x26')](_0x320240)[_0x40fc('0x13')](function(_0x494119){return _0x494119;});}return null;};}function removeEntity(_0x199794){return function(_0x2b1849){if(_0x2b1849){return _0x2b1849[_0x40fc('0x27')]()[_0x40fc('0x13')](function(){var _0x4cf469=_0x2b1849['get']({'plain':!![]});var _0x2bc472=_0x40fc('0x28');return db[_0x40fc('0x29')][_0x40fc('0x27')]({'where':{'type':_0x2bc472,'resourceId':_0x4cf469['id']}})[_0x40fc('0x13')](function(){return _0x2b1849;});})[_0x40fc('0x13')](function(){_0x199794[_0x40fc('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3a7c42){return function(_0x4a3b57){if(!_0x4a3b57){_0x3a7c42['sendStatus'](0x194);}return _0x4a3b57;};}function handleError(_0x226486,_0x17e442){_0x17e442=_0x17e442||0x1f4;return function(_0x67fbf9){logger['error'](_0x67fbf9[_0x40fc('0x2a')]);if(_0x67fbf9[_0x40fc('0x2b')]){delete _0x67fbf9[_0x40fc('0x2b')];}_0x226486[_0x40fc('0x1e')](_0x17e442)[_0x40fc('0x2c')](_0x67fbf9);};}function getImapHost(_0x383660){switch(_0x383660){case _0x40fc('0x2d'):return'imap.gmail.com';case _0x40fc('0x2e'):return'imap.mail.yahoo.com';case _0x40fc('0x2f'):return _0x40fc('0x30');case'outlook365':return _0x40fc('0x31');}throw new Error(_0x40fc('0x32'),_0x383660);}function getSmtpHost(_0x2e4bc3){switch(_0x2e4bc3){case _0x40fc('0x2d'):return _0x40fc('0x33');case _0x40fc('0x2e'):return'smtp.mail.yahoo.com';case _0x40fc('0x2f'):return'smtp-mail.outlook.com';case _0x40fc('0x34'):return _0x40fc('0x35');}throw new Error(_0x40fc('0x32'),_0x2e4bc3);}function getAuthenticationOptions(_0x1098e4,_0x6f0dd9){var _0x299391={};var _0x4b1d51={};if(_0x1098e4){_0x299391[_0x40fc('0x36')]=_0x4b1d51[_0x40fc('0x36')]=_0x6f0dd9[_0x40fc('0x37')];_0x299391[_0x40fc('0x38')]=_0x4b1d51[_0x40fc('0x39')]=_0x6f0dd9[_0x40fc('0x38')];if(_0x6f0dd9[_0x40fc('0x3a')]){_0x299391[_0x40fc('0x3a')]=_0x4b1d51[_0x40fc('0x3a')]=!![];_0x299391[_0x40fc('0x3b')]=_0x4b1d51[_0x40fc('0x3b')]=_0x6f0dd9[_0x40fc('0x3b')];_0x299391[_0x40fc('0x38')]=_0x4b1d51['pass']=null;}else{_0x299391['CloudProviderId']=_0x4b1d51['CloudProviderId']=null;}_0x299391[_0x40fc('0x3c')]=getImapHost(_0x1098e4);_0x299391[_0x40fc('0x3d')]=0x3e1;_0x4b1d51['host']=getSmtpHost(_0x1098e4);_0x4b1d51[_0x40fc('0x3d')]=0x24b;_0x4b1d51[_0x40fc('0x3e')]=![];_0x299391['service']=_0x4b1d51[_0x40fc('0x3f')]=null;}else{if(_0x6f0dd9[_0x40fc('0x40')]){_0x299391['user']=_0x4b1d51['user']=_0x6f0dd9[_0x40fc('0x37')];_0x299391['password']=_0x4b1d51[_0x40fc('0x39')]=_0x6f0dd9['password'];}else{_0x299391['authentication']=_0x4b1d51[_0x40fc('0x40')]=![];_0x299391[_0x40fc('0x36')]=_0x4b1d51[_0x40fc('0x36')]=null;_0x299391['password']=_0x4b1d51[_0x40fc('0x39')]=null;}_0x299391[_0x40fc('0x3c')]=_0x6f0dd9[_0x40fc('0x41')][_0x40fc('0x3c')];_0x299391[_0x40fc('0x3d')]=_0x6f0dd9[_0x40fc('0x41')][_0x40fc('0x3d')];_0x4b1d51['host']=_0x6f0dd9[_0x40fc('0x42')][_0x40fc('0x3c')];_0x4b1d51[_0x40fc('0x3d')]=_0x6f0dd9[_0x40fc('0x42')]['port'];}return{'Imap':_0x299391,'Smtp':_0x4b1d51};}exports[_0x40fc('0x43')]=function(_0x5a038b,_0x480590){var _0x495d7d={'include':[{'model':db[_0x40fc('0x44')],'as':_0x40fc('0x41')},{'model':db[_0x40fc('0x45')],'as':_0x40fc('0x42')},{'model':db[_0x40fc('0x46')],'as':_0x40fc('0x47')}]},_0x1b61e4={},_0x16baca={'count':0x0,'rows':[]};var _0x125b76=_[_0x40fc('0x48')](db[_0x40fc('0x49')][_0x40fc('0x4a')],function(_0x3fb6d0){return{'name':_0x3fb6d0[_0x40fc('0x4b')],'type':_0x3fb6d0['type'][_0x40fc('0x4c')]};});_0x1b61e4['model']=_[_0x40fc('0x48')](_0x125b76,'name');_0x1b61e4[_0x40fc('0x4d')]=_['keys'](_0x5a038b[_0x40fc('0x4d')]);_0x1b61e4['filters']=_[_0x40fc('0x4e')](_0x1b61e4[_0x40fc('0x4f')],_0x1b61e4[_0x40fc('0x4d')]);_0x495d7d[_0x40fc('0x50')]=_[_0x40fc('0x4e')](_0x1b61e4[_0x40fc('0x4f')],qs[_0x40fc('0x51')](_0x5a038b['query'][_0x40fc('0x51')]));_0x495d7d[_0x40fc('0x50')]=_0x495d7d[_0x40fc('0x50')]['length']?_0x495d7d[_0x40fc('0x50')]:_0x1b61e4['model'];if(!_0x5a038b[_0x40fc('0x4d')][_0x40fc('0x52')](_0x40fc('0x53'))){_0x495d7d[_0x40fc('0x24')]=qs[_0x40fc('0x24')](_0x5a038b[_0x40fc('0x4d')]['limit']);_0x495d7d[_0x40fc('0x23')]=qs[_0x40fc('0x23')](_0x5a038b[_0x40fc('0x4d')][_0x40fc('0x23')]);}_0x495d7d[_0x40fc('0x54')]=qs[_0x40fc('0x55')](_0x5a038b['query'][_0x40fc('0x55')]);_0x495d7d[_0x40fc('0x56')]=qs[_0x40fc('0x57')](_[_0x40fc('0x58')](_0x5a038b['query'],_0x1b61e4[_0x40fc('0x57')]),_0x125b76);if(_0x5a038b[_0x40fc('0x4d')][_0x40fc('0x59')]){_0x495d7d['where']=_['merge'](_0x495d7d['where'],{'$or':_[_0x40fc('0x48')](_0x125b76,function(_0x2a82ac){if(_0x2a82ac[_0x40fc('0x5a')]!==_0x40fc('0x5b')){var _0xb8aa9e={};_0xb8aa9e[_0x2a82ac['name']]={'$like':'%'+_0x5a038b[_0x40fc('0x4d')][_0x40fc('0x59')]+'%'};return _0xb8aa9e;}})});}_0x495d7d=_[_0x40fc('0x5c')]({},_0x495d7d,_0x5a038b[_0x40fc('0x5d')]);var _0x1adb4e={'where':_0x495d7d['where']};return db[_0x40fc('0x49')][_0x40fc('0x22')](_0x1adb4e)[_0x40fc('0x13')](function(_0x25ce0c){_0x16baca[_0x40fc('0x22')]=_0x25ce0c;if(_0x5a038b[_0x40fc('0x4d')]['includeAll']){_0x495d7d[_0x40fc('0x5e')]=[{'all':!![]}];}return db[_0x40fc('0x49')][_0x40fc('0x5f')](_0x495d7d);})['then'](function(_0x32bd68){_0x16baca[_0x40fc('0x60')]=_0x32bd68;return _0x16baca;})[_0x40fc('0x13')](respondWithFilteredResult(_0x480590,_0x495d7d))[_0x40fc('0x1d')](handleError(_0x480590,null));};exports['show']=function(_0x4066d3,_0x48d503){var _0x2197c1={'raw':![],'where':{'id':_0x4066d3[_0x40fc('0x61')]['id']},'include':[{'model':db['MailServerIn'],'as':_0x40fc('0x41')},{'model':db[_0x40fc('0x45')],'as':_0x40fc('0x42')},{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x40bd2a={};_0x40bd2a[_0x40fc('0x4f')]=_[_0x40fc('0x62')](db[_0x40fc('0x49')][_0x40fc('0x4a')]);_0x40bd2a['query']=_['keys'](_0x4066d3[_0x40fc('0x4d')]);_0x40bd2a['filters']=_[_0x40fc('0x4e')](_0x40bd2a[_0x40fc('0x4f')],_0x40bd2a['query']);_0x2197c1[_0x40fc('0x50')]=_[_0x40fc('0x4e')](_0x40bd2a[_0x40fc('0x4f')],qs[_0x40fc('0x51')](_0x4066d3[_0x40fc('0x4d')][_0x40fc('0x51')]));_0x2197c1['attributes']=_0x2197c1[_0x40fc('0x50')][_0x40fc('0x63')]?_0x2197c1['attributes']:_0x40bd2a[_0x40fc('0x4f')];if(_0x4066d3[_0x40fc('0x4d')][_0x40fc('0x64')]){_0x2197c1['include']=[{'all':!![]}];}_0x2197c1=_[_0x40fc('0x5c')]({},_0x2197c1,_0x4066d3[_0x40fc('0x5d')]);return db[_0x40fc('0x49')]['find'](_0x2197c1)['then'](handleEntityNotFound(_0x48d503,null))[_0x40fc('0x13')](respondWithResult(_0x48d503,null))['catch'](handleError(_0x48d503,null));};exports[_0x40fc('0x26')]=function(_0x260978,_0x1ecb79){if(_0x260978[_0x40fc('0x65')]['id']){delete _0x260978['body']['id'];}var _0xc41f35=_0x260978[_0x40fc('0x65')]['provider']===_0x40fc('0x66')?null:_0x260978[_0x40fc('0x65')][_0x40fc('0x67')];var _0xa16270=_0x260978[_0x40fc('0x65')][_0x40fc('0x41')]||{};var _0x2c3ba2=_0x260978[_0x40fc('0x65')][_0x40fc('0x42')]||{};if(_0xc41f35){_0xa16270[_0x40fc('0x3c')]=getImapHost(_0xc41f35);_0xa16270[_0x40fc('0x3d')]=0x3e1;_0x2c3ba2['host']=getSmtpHost(_0xc41f35);_0x2c3ba2[_0x40fc('0x3d')]=0x24b;_0x2c3ba2[_0x40fc('0x3e')]=![];}if(_0x2c3ba2[_0x40fc('0x3a')]){_0x2c3ba2['secure']=![];}else{_0x2c3ba2[_0x40fc('0x3b')]=null;}if(!_0xa16270['modernAuthentication'])_0xa16270['CloudProviderId']=null;_0x260978[_0x40fc('0x65')][_0x40fc('0x41')]=_0xa16270;_0x260978[_0x40fc('0x65')]['Smtp']=_0x2c3ba2;return db[_0x40fc('0x49')][_0x40fc('0x68')]({'where':{'id':_0x260978['params']['id']},'include':[{'model':db[_0x40fc('0x44')],'as':_0x40fc('0x41')},{'model':db[_0x40fc('0x45')],'as':_0x40fc('0x42')},{'model':db[_0x40fc('0x46')],'as':_0x40fc('0x47')}]})[_0x40fc('0x13')](handleEntityNotFound(_0x1ecb79,null))['then'](function(_0x240cdb){if(!_0x240cdb)throw new Error(_0x40fc('0x69'));if(_0x240cdb[_0x40fc('0x3f')])delete _0x260978[_0x40fc('0x65')][_0x40fc('0x41')];return _0x240cdb;})[_0x40fc('0x13')](saveUpdates(_0x260978[_0x40fc('0x65')],null))['then'](function(_0x3ad2b7){if(!_0x260978['body'][_0x40fc('0x41')])return _0x3ad2b7;return db[_0x40fc('0x44')][_0x40fc('0x26')](_0x260978[_0x40fc('0x65')]['Imap'],{'where':{'MailAccountId':_0x3ad2b7['id']}})[_0x40fc('0x13')](function(){return _0x3ad2b7;});})[_0x40fc('0x13')](function(_0x12354a){if(!_0x260978[_0x40fc('0x65')]['Smtp'])return _0x12354a;return db[_0x40fc('0x45')]['update'](_0x260978['body'][_0x40fc('0x42')],{'where':{'MailAccountId':_0x12354a['id']}})[_0x40fc('0x13')](function(){return _0x12354a;});})[_0x40fc('0x13')](respondWithResult(_0x1ecb79,null))[_0x40fc('0x1d')](handleError(_0x1ecb79,null));};exports[_0x40fc('0x6a')]=function(_0x1d9af2,_0x2d056e){return db[_0x40fc('0x49')][_0x40fc('0x6a')]()[_0x40fc('0x13')](respondWithResult(_0x2d056e,null))['catch'](handleError(_0x2d056e,null));};exports[_0x40fc('0x6b')]=function(_0x40e7e9,_0x56819c){if(_0x40e7e9[_0x40fc('0x65')]['id']){delete _0x40e7e9[_0x40fc('0x65')]['id'];}return db['MailAccount'][_0x40fc('0x68')]({'where':{'id':_0x40e7e9[_0x40fc('0x61')]['id']}})[_0x40fc('0x13')](handleEntityNotFound(_0x56819c,null))[_0x40fc('0x13')](function(_0x310546){if(_0x310546){_0x40e7e9[_0x40fc('0x65')][_0x40fc('0x6c')]=_0x310546['id'];return db[_0x40fc('0x6d')][_0x40fc('0x6e')](_0x40e7e9[_0x40fc('0x65')]);}})[_0x40fc('0x13')](respondWithResult(_0x56819c,null))[_0x40fc('0x1d')](handleError(_0x56819c,null));};exports[_0x40fc('0x6f')]=function(_0x10c480,_0x1b90af){var _0x4e3c95={'raw':![],'where':{}};var _0x5221a0={};var _0x701b9f={'count':0x0,'rows':[]};return db[_0x40fc('0x49')][_0x40fc('0x70')]({'where':{'id':_0x10c480[_0x40fc('0x61')]['id']}})[_0x40fc('0x13')](handleEntityNotFound(_0x1b90af,null))[_0x40fc('0x13')](function(_0x1ff8de){if(_0x1ff8de){_0x5221a0[_0x40fc('0x4f')]=_[_0x40fc('0x62')](db[_0x40fc('0x6d')][_0x40fc('0x4a')]);_0x5221a0['query']=_['keys'](_0x10c480[_0x40fc('0x4d')]);_0x5221a0[_0x40fc('0x57')]=_[_0x40fc('0x4e')](_0x5221a0[_0x40fc('0x4f')],_0x5221a0[_0x40fc('0x4d')]);_0x4e3c95['attributes']=_[_0x40fc('0x4e')](_0x5221a0['model'],qs['fields'](_0x10c480[_0x40fc('0x4d')]['fields']));_0x4e3c95[_0x40fc('0x50')]=_0x4e3c95[_0x40fc('0x50')][_0x40fc('0x63')]?_0x4e3c95['attributes']:_0x5221a0[_0x40fc('0x4f')];if(!_0x10c480['query'][_0x40fc('0x52')](_0x40fc('0x53'))){_0x4e3c95['limit']=qs['limit'](_0x10c480[_0x40fc('0x4d')][_0x40fc('0x24')]);_0x4e3c95['offset']=qs[_0x40fc('0x23')](_0x10c480[_0x40fc('0x4d')][_0x40fc('0x23')]);}_0x4e3c95['order']=qs[_0x40fc('0x55')](_0x10c480[_0x40fc('0x4d')][_0x40fc('0x55')]);_0x4e3c95['where']=qs[_0x40fc('0x57')](_['pick'](_0x10c480['query'],_0x5221a0[_0x40fc('0x57')]));_0x4e3c95[_0x40fc('0x56')][_0x40fc('0x6c')]=_0x1ff8de['id'];if(_0x10c480[_0x40fc('0x4d')][_0x40fc('0x59')]){_0x4e3c95[_0x40fc('0x56')]=_[_0x40fc('0x5c')](_0x4e3c95['where'],{'$or':_[_0x40fc('0x48')](_0x4e3c95[_0x40fc('0x50')],function(_0x58f9b6){var _0xf9fd16={};_0xf9fd16[_0x58f9b6]={'$like':'%'+_0x10c480['query']['filter']+'%'};return _0xf9fd16;})});}_0x4e3c95=_['merge']({},_0x4e3c95,_0x10c480[_0x40fc('0x5d')]);return db[_0x40fc('0x6d')][_0x40fc('0x22')]({'where':_0x4e3c95[_0x40fc('0x56')]})[_0x40fc('0x13')](function(_0x23a4b7){_0x701b9f[_0x40fc('0x22')]=_0x23a4b7;if(_0x10c480[_0x40fc('0x4d')]['includeAll']){_0x4e3c95[_0x40fc('0x5e')]=[{'all':!![]}];}return db[_0x40fc('0x6d')][_0x40fc('0x5f')](_0x4e3c95);})['then'](function(_0x254261){_0x701b9f[_0x40fc('0x60')]=_0x254261;return _0x701b9f;});}})[_0x40fc('0x13')](respondWithFilteredResult(_0x1b90af,_0x4e3c95))[_0x40fc('0x1d')](handleError(_0x1b90af,null));};exports['removeDispositions']=function(_0x3dce1c,_0x4ee5cd){return db[_0x40fc('0x49')][_0x40fc('0x68')]({'where':{'id':_0x3dce1c[_0x40fc('0x61')]['id']}})[_0x40fc('0x13')](handleEntityNotFound(_0x4ee5cd,null))[_0x40fc('0x13')](function(_0x586013){if(_0x586013){return _0x586013['removeDispositions'](_0x3dce1c[_0x40fc('0x4d')][_0x40fc('0x71')]);}})['then'](respondWithStatusCode(_0x4ee5cd,null))[_0x40fc('0x1d')](handleError(_0x4ee5cd,null));};exports[_0x40fc('0x72')]=function(_0x1972fd,_0x11ece4){if(_0x1972fd[_0x40fc('0x65')]['id']){delete _0x1972fd[_0x40fc('0x65')]['id'];}return db['MailAccount'][_0x40fc('0x68')]({'where':{'id':_0x1972fd[_0x40fc('0x61')]['id']}})[_0x40fc('0x13')](handleEntityNotFound(_0x11ece4,null))[_0x40fc('0x13')](function(_0x39c579){if(_0x39c579){_0x1972fd[_0x40fc('0x65')]['MailAccountId']=_0x39c579['id'];return db[_0x40fc('0x73')]['create'](_0x1972fd[_0x40fc('0x65')]);}})[_0x40fc('0x13')](respondWithResult(_0x11ece4,null))[_0x40fc('0x1d')](handleError(_0x11ece4,null));};exports[_0x40fc('0x74')]=function(_0x109603,_0x1626b4){var _0x14d451={'raw':![],'where':{}};var _0x37b95b={};var _0x337d4c={'count':0x0,'rows':[]};return db[_0x40fc('0x49')][_0x40fc('0x70')]({'where':{'id':_0x109603[_0x40fc('0x61')]['id']}})[_0x40fc('0x13')](handleEntityNotFound(_0x1626b4,null))[_0x40fc('0x13')](function(_0x317cef){if(_0x317cef){_0x37b95b[_0x40fc('0x4f')]=_[_0x40fc('0x62')](db[_0x40fc('0x73')][_0x40fc('0x4a')]);_0x37b95b['query']=_[_0x40fc('0x62')](_0x109603[_0x40fc('0x4d')]);_0x37b95b[_0x40fc('0x57')]=_[_0x40fc('0x4e')](_0x37b95b['model'],_0x37b95b[_0x40fc('0x4d')]);_0x14d451[_0x40fc('0x50')]=_[_0x40fc('0x4e')](_0x37b95b[_0x40fc('0x4f')],qs['fields'](_0x109603['query'][_0x40fc('0x51')]));_0x14d451[_0x40fc('0x50')]=_0x14d451[_0x40fc('0x50')][_0x40fc('0x63')]?_0x14d451[_0x40fc('0x50')]:_0x37b95b[_0x40fc('0x4f')];if(!_0x109603[_0x40fc('0x4d')][_0x40fc('0x52')](_0x40fc('0x53'))){_0x14d451[_0x40fc('0x24')]=qs['limit'](_0x109603[_0x40fc('0x4d')][_0x40fc('0x24')]);_0x14d451['offset']=qs[_0x40fc('0x23')](_0x109603[_0x40fc('0x4d')]['offset']);}_0x14d451[_0x40fc('0x54')]=qs[_0x40fc('0x55')](_0x109603[_0x40fc('0x4d')][_0x40fc('0x55')]);_0x14d451['where']=qs[_0x40fc('0x57')](_[_0x40fc('0x58')](_0x109603['query'],_0x37b95b['filters']));_0x14d451[_0x40fc('0x56')][_0x40fc('0x6c')]=_0x317cef['id'];if(_0x109603[_0x40fc('0x4d')][_0x40fc('0x59')]){_0x14d451[_0x40fc('0x56')]=_[_0x40fc('0x5c')](_0x14d451[_0x40fc('0x56')],{'$or':_[_0x40fc('0x48')](_0x14d451[_0x40fc('0x50')],function(_0x104fd1){var _0x4e778a={};_0x4e778a[_0x104fd1]={'$like':'%'+_0x109603[_0x40fc('0x4d')]['filter']+'%'};return _0x4e778a;})});}_0x14d451=_[_0x40fc('0x5c')]({},_0x14d451,_0x109603[_0x40fc('0x5d')]);return db[_0x40fc('0x73')][_0x40fc('0x22')]({'where':_0x14d451[_0x40fc('0x56')]})['then'](function(_0x35b985){_0x337d4c[_0x40fc('0x22')]=_0x35b985;if(_0x109603[_0x40fc('0x4d')][_0x40fc('0x64')]){_0x14d451[_0x40fc('0x5e')]=[{'all':!![]}];}return db[_0x40fc('0x73')][_0x40fc('0x5f')](_0x14d451);})[_0x40fc('0x13')](function(_0x39435f){_0x337d4c[_0x40fc('0x60')]=_0x39435f;return _0x337d4c;});}})[_0x40fc('0x13')](respondWithFilteredResult(_0x1626b4,_0x14d451))['catch'](handleError(_0x1626b4,null));};exports['removeAnswers']=function(_0x1a63e9,_0x688476){return db[_0x40fc('0x49')][_0x40fc('0x68')]({'where':{'id':_0x1a63e9[_0x40fc('0x61')]['id']}})[_0x40fc('0x13')](handleEntityNotFound(_0x688476,null))[_0x40fc('0x13')](function(_0x125f96){if(_0x125f96){return _0x125f96[_0x40fc('0x75')](_0x1a63e9[_0x40fc('0x4d')][_0x40fc('0x71')]);}})[_0x40fc('0x13')](respondWithStatusCode(_0x688476,null))['catch'](handleError(_0x688476,null));};exports['create']=function(_0x2aa33f,_0x475c97){var _0x15b7a6={'name':_0x2aa33f[_0x40fc('0x65')][_0x40fc('0x2b')],'key':_0x2aa33f[_0x40fc('0x65')][_0x40fc('0x4c')],'provider':_0x2aa33f['body']['provider']===_0x40fc('0x66')?null:_0x2aa33f['body'][_0x40fc('0x67')],'email':_0x2aa33f[_0x40fc('0x65')][_0x40fc('0x76')],'ListId':_0x2aa33f['body'][_0x40fc('0x77')],'active':!_[_0x40fc('0x78')](_0x2aa33f['body'][_0x40fc('0x79')])?_0x2aa33f[_0x40fc('0x65')][_0x40fc('0x79')]:!![],'description':_0x2aa33f[_0x40fc('0x65')][_0x40fc('0x7a')]||null};var _0x30cc98=getAuthenticationOptions(_0x15b7a6[_0x40fc('0x67')],_0x2aa33f[_0x40fc('0x65')]);_0x15b7a6['Imap']=_0x30cc98[_0x40fc('0x41')];_0x15b7a6[_0x40fc('0x42')]=_0x30cc98[_0x40fc('0x42')];return db['MailAccount'][_0x40fc('0x6e')](_0x15b7a6,{'include':[{'model':db[_0x40fc('0x45')],'as':'Smtp'},{'model':db[_0x40fc('0x44')],'as':_0x40fc('0x41')}]})[_0x40fc('0x13')](function(_0x1f4140){var _0xff2818=_0x2aa33f[_0x40fc('0x36')][_0x40fc('0x7b')]({'plain':!![]});if(!_0xff2818)throw new Error(_0x40fc('0x7c'));if(_0xff2818['role']===_0x40fc('0x36')){var _0x111162=_0x1f4140[_0x40fc('0x7b')]({'plain':!![]});return db['UserProfileSection']['find']({'where':{'name':'MailAccounts','userProfileId':_0xff2818[_0x40fc('0x7d')]},'raw':!![]})[_0x40fc('0x13')](function(_0xe0df9d){if(_0xe0df9d&&_0xe0df9d[_0x40fc('0x7e')]===0x0){return db[_0x40fc('0x29')]['create']({'name':_0x111162[_0x40fc('0x2b')],'resourceId':_0x111162['id'],'type':_0xe0df9d[_0x40fc('0x2b')],'sectionId':_0xe0df9d['id']},{})[_0x40fc('0x13')](function(){return _0x1f4140;});}else{return _0x1f4140;}})['catch'](function(_0x29ff4f){logger[_0x40fc('0x19')](_0x40fc('0x7f'),_0x29ff4f);throw _0x29ff4f;});}return _0x1f4140;})[_0x40fc('0x13')](respondWithResult(_0x475c97,0xc9))[_0x40fc('0x1d')](handleError(_0x475c97,null));};exports[_0x40fc('0x80')]=function(_0x5a5871,_0x5e4239){return db[_0x40fc('0x49')][_0x40fc('0x70')]({'where':{'id':_0x5a5871['params']['id']}})[_0x40fc('0x13')](handleEntityNotFound(_0x5e4239,null))[_0x40fc('0x13')](function(_0x4730ac){if(_0x4730ac){return _0x4730ac['getImap']();}return null;})[_0x40fc('0x13')](respondWithResult(_0x5e4239,null))[_0x40fc('0x1d')](handleError(_0x5e4239,null));};exports[_0x40fc('0x81')]=function(_0x5d9367,_0x311b4b){if(_0x5d9367[_0x40fc('0x65')]['id']){delete _0x5d9367[_0x40fc('0x65')]['id'];}return db[_0x40fc('0x49')][_0x40fc('0x68')]({'where':{'id':_0x5d9367[_0x40fc('0x61')]['id']}})[_0x40fc('0x13')](handleEntityNotFound(_0x311b4b,null))[_0x40fc('0x13')](function(_0x5bd646){if(_0x5bd646){_0x5d9367['body'][_0x40fc('0x6c')]=_0x5bd646['id'];return db[_0x40fc('0x44')]['create'](_0x5d9367[_0x40fc('0x65')]);}})[_0x40fc('0x13')](respondWithResult(_0x311b4b,null))['catch'](handleError(_0x311b4b,null));};exports[_0x40fc('0x82')]=function(_0x3bce97,_0x516a02){return db[_0x40fc('0x49')][_0x40fc('0x70')]({'where':{'id':_0x3bce97['params']['id']}})[_0x40fc('0x13')](handleEntityNotFound(_0x516a02,null))[_0x40fc('0x13')](function(_0x372274){if(_0x372274){return _0x372274['setImap'](null);}return null;})[_0x40fc('0x13')](respondWithStatusCode(_0x516a02,null))[_0x40fc('0x1d')](handleError(_0x516a02,null));};exports[_0x40fc('0x83')]=function(_0x42840e,_0x4178f1){return db[_0x40fc('0x49')][_0x40fc('0x70')]({'where':{'id':_0x42840e[_0x40fc('0x61')]['id']}})[_0x40fc('0x13')](handleEntityNotFound(_0x4178f1,null))[_0x40fc('0x13')](function(_0x527180){if(_0x527180){return _0x527180['getSmtp']();}return null;})['then'](respondWithResult(_0x4178f1,null))[_0x40fc('0x1d')](handleError(_0x4178f1,null));};exports[_0x40fc('0x84')]=function(_0x5d4f26,_0x2b09a2){if(_0x5d4f26[_0x40fc('0x65')]['id']){delete _0x5d4f26[_0x40fc('0x65')]['id'];}return db[_0x40fc('0x49')][_0x40fc('0x68')]({'where':{'id':_0x5d4f26['params']['id']}})['then'](handleEntityNotFound(_0x2b09a2,null))[_0x40fc('0x13')](function(_0x29e0bd){if(_0x29e0bd){_0x5d4f26[_0x40fc('0x65')][_0x40fc('0x6c')]=_0x29e0bd['id'];return db['MailServerOut'][_0x40fc('0x6e')](_0x5d4f26[_0x40fc('0x65')]);}})[_0x40fc('0x13')](respondWithResult(_0x2b09a2,null))[_0x40fc('0x1d')](handleError(_0x2b09a2,null));};exports[_0x40fc('0x85')]=function(_0x1b1bbd,_0x2923db){return db[_0x40fc('0x49')]['findOne']({'where':{'id':_0x1b1bbd['params']['id']}})[_0x40fc('0x13')](handleEntityNotFound(_0x2923db,null))[_0x40fc('0x13')](function(_0x28c012){if(_0x28c012){return _0x28c012[_0x40fc('0x86')](null);}return null;})['then'](respondWithStatusCode(_0x2923db,null))['catch'](handleError(_0x2923db,null));};exports[_0x40fc('0x87')]=function(_0xb2a169,_0x5b50e3){return db[_0x40fc('0x88')][_0x40fc('0x68')]({'where':{'id':_0xb2a169['params']['id']}})[_0x40fc('0x13')](handleEntityNotFound(_0x5b50e3,null))[_0x40fc('0x13')](function(_0x2d6e0b){if(_0x2d6e0b){return _0x2d6e0b['addInteraction'](_0xb2a169[_0x40fc('0x65')][_0x40fc('0x71')],_[_0x40fc('0x89')](_0xb2a169[_0x40fc('0x65')],[_0x40fc('0x71'),'id'])||{});}})[_0x40fc('0x13')](respondWithResult(_0x5b50e3,null))['catch'](handleError(_0x5b50e3,null));};exports[_0x40fc('0x8a')]=function(_0x48da46,_0x32367f){var _0x5dbbef={'raw':![],'where':{}};var _0xd55697={};var _0x2143f3={'count':0x0,'rows':[]};return db[_0x40fc('0x49')][_0x40fc('0x70')]({'where':{'id':_0x48da46[_0x40fc('0x61')]['id']}})['then'](handleEntityNotFound(_0x32367f,null))[_0x40fc('0x13')](function(_0x3e4e17){if(_0x3e4e17){_0xd55697[_0x40fc('0x4f')]=_['keys'](db[_0x40fc('0x88')][_0x40fc('0x4a')]);_0xd55697[_0x40fc('0x4d')]=_[_0x40fc('0x62')](_0x48da46[_0x40fc('0x4d')]);_0xd55697[_0x40fc('0x57')]=_[_0x40fc('0x4e')](_0xd55697[_0x40fc('0x4f')],_0xd55697[_0x40fc('0x4d')]);_0x5dbbef[_0x40fc('0x50')]=_[_0x40fc('0x4e')](_0xd55697[_0x40fc('0x4f')],qs[_0x40fc('0x51')](_0x48da46[_0x40fc('0x4d')]['fields']));_0x5dbbef[_0x40fc('0x50')]=_0x5dbbef[_0x40fc('0x50')][_0x40fc('0x63')]?_0x5dbbef['attributes']:_0xd55697['model'];if(!_0x48da46[_0x40fc('0x4d')][_0x40fc('0x52')]('nolimit')){_0x5dbbef[_0x40fc('0x24')]=qs[_0x40fc('0x24')](_0x48da46[_0x40fc('0x4d')]['limit']);_0x5dbbef[_0x40fc('0x23')]=qs[_0x40fc('0x23')](_0x48da46[_0x40fc('0x4d')][_0x40fc('0x23')]);}_0x5dbbef[_0x40fc('0x54')]=qs['sort'](_0x48da46[_0x40fc('0x4d')][_0x40fc('0x55')]);_0x5dbbef['where']=qs['filters'](_[_0x40fc('0x58')](_0x48da46['query'],_0xd55697[_0x40fc('0x57')]));_0x5dbbef['where'][_0x40fc('0x6c')]=_0x3e4e17['id'];if(_0x48da46[_0x40fc('0x4d')][_0x40fc('0x59')]){_0x5dbbef[_0x40fc('0x56')]=_[_0x40fc('0x5c')](_0x5dbbef[_0x40fc('0x56')],{'$or':_[_0x40fc('0x48')](_0x5dbbef[_0x40fc('0x50')],function(_0x4ba9e9){var _0x36d52e={};_0x36d52e[_0x4ba9e9]={'$like':'%'+_0x48da46['query'][_0x40fc('0x59')]+'%'};return _0x36d52e;})});}_0x5dbbef=_['merge']({},_0x5dbbef,_0x48da46[_0x40fc('0x5d')]);return db[_0x40fc('0x88')][_0x40fc('0x22')]({'where':_0x5dbbef['where']})[_0x40fc('0x13')](function(_0x10f966){_0x2143f3[_0x40fc('0x22')]=_0x10f966;if(_0x48da46[_0x40fc('0x4d')][_0x40fc('0x64')]){_0x5dbbef[_0x40fc('0x5e')]=[{'model':db['CmContact'],'as':_0x40fc('0x8b'),'required':![]},{'model':db[_0x40fc('0x8c')],'as':_0x40fc('0x8d'),'attributes':[_0x40fc('0x2b'),_0x40fc('0x8e'),_0x40fc('0x8f')],'required':![]},{'model':db[_0x40fc('0x90')],'as':_0x40fc('0x91'),'attributes':['id',_0x40fc('0x2b'),_0x40fc('0x92')],'where':_0x48da46['query'][_0x40fc('0x93')]?{'id':_0x48da46['query']['tag']}:undefined,'required':_0x48da46[_0x40fc('0x4d')][_0x40fc('0x93')]?!![]:![]}];}return db[_0x40fc('0x88')]['findAll'](_0x5dbbef);})[_0x40fc('0x13')](function(_0x5df1bd){_0x2143f3['rows']=_0x5df1bd;return _0x2143f3;});}})[_0x40fc('0x13')](respondWithFilteredResult(_0x32367f,_0x5dbbef))[_0x40fc('0x1d')](handleError(_0x32367f,null));};exports[_0x40fc('0x94')]=function addApplications(_0x22ed1a,_0x1e4b4a){var _0x28e48e=_0x22ed1a[_0x40fc('0x61')]['id'];var _0x19d59b=_0x22ed1a[_0x40fc('0x65')];var _0x58b8f1=0xc8;var _0x35c12d=null;return db['sequelize'][_0x40fc('0x95')]({'isolationLevel':db[_0x40fc('0x96')][_0x40fc('0x97')][_0x40fc('0x98')][_0x40fc('0x99')]},function(_0xeb4d85){return db[_0x40fc('0x49')][_0x40fc('0x70')]({'where':{'id':_0x28e48e},'transaction':_0xeb4d85})[_0x40fc('0x13')](function(_0x47bcb3){if(_0x47bcb3){return db[_0x40fc('0x9a')]['destroy']({'where':{'MailAccountId':_0x28e48e},'transaction':_0xeb4d85})['then'](function(){var _0x36bd14=_['map'](_0x19d59b,function(_0x14c12a){_0x14c12a[_0x40fc('0x6c')]=_0x28e48e;return _0x14c12a;});return db['MailApplication']['bulkCreate'](_0x36bd14,{'transaction':_0xeb4d85});});}else{_0x58b8f1=0x194;_0x35c12d=[];}});})[_0x40fc('0x13')](function(){if(_0x58b8f1!==0x194){return db[_0x40fc('0x9a')]['findAndCountAll']({'where':{'MailAccountId':_0x28e48e},'order':_0x40fc('0x9b')})[_0x40fc('0x13')](function(_0x41e5cd){_0x35c12d=_0x41e5cd;});}})[_0x40fc('0x1d')](function(_0x6c7286){_0x58b8f1=0x1f4;logger[_0x40fc('0x19')](_0x6c7286[_0x40fc('0x2a')]);if(_0x6c7286['name']){delete _0x6c7286['name'];}_0x35c12d=_0x6c7286;})[_0x40fc('0x9c')](function(){if(_0x35c12d===null){_0x1e4b4a[_0x40fc('0x9d')](_0x58b8f1);}else{if(_0x58b8f1===0x1f4){_0x1e4b4a[_0x40fc('0x1e')](_0x58b8f1)[_0x40fc('0x2c')](_0x35c12d);}else{_0x1e4b4a[_0x40fc('0x1e')](_0x58b8f1)[_0x40fc('0x20')](_0x35c12d);}}});};exports[_0x40fc('0x9e')]=function(_0x246e06,_0xf4df3b){var _0x5f7777={};var _0x438b0f={};var _0x22ff05;var _0x548a5a;return db[_0x40fc('0x49')][_0x40fc('0x70')]({'where':{'id':_0x246e06[_0x40fc('0x61')]['id']}})['then'](handleEntityNotFound(_0xf4df3b,null))[_0x40fc('0x13')](function(_0x2d0d22){if(_0x2d0d22){_0x22ff05=_0x2d0d22;_0x438b0f['model']=_[_0x40fc('0x62')](db['MailApplication'][_0x40fc('0x4a')]);_0x438b0f[_0x40fc('0x4d')]=_[_0x40fc('0x62')](_0x246e06[_0x40fc('0x4d')]);_0x438b0f[_0x40fc('0x57')]=_[_0x40fc('0x4e')](_0x438b0f[_0x40fc('0x4f')],_0x438b0f[_0x40fc('0x4d')]);_0x5f7777[_0x40fc('0x50')]=_[_0x40fc('0x4e')](_0x438b0f[_0x40fc('0x4f')],qs[_0x40fc('0x51')](_0x246e06[_0x40fc('0x4d')]['fields']));_0x5f7777[_0x40fc('0x50')]=_0x5f7777['attributes']['length']?_0x5f7777[_0x40fc('0x50')]:_0x438b0f[_0x40fc('0x4f')];_0x5f7777[_0x40fc('0x54')]=qs[_0x40fc('0x55')](_0x246e06[_0x40fc('0x4d')][_0x40fc('0x55')]);_0x5f7777['where']=qs[_0x40fc('0x57')](_[_0x40fc('0x58')](_0x246e06[_0x40fc('0x4d')],_0x438b0f['filters']));if(_0x246e06['query'][_0x40fc('0x59')]){_0x5f7777[_0x40fc('0x56')]=_['merge'](_0x5f7777[_0x40fc('0x56')],{'$or':_['map'](_0x5f7777[_0x40fc('0x50')],function(_0x4fc084){var _0x38e9fc={};_0x38e9fc[_0x4fc084]={'$like':'%'+_0x246e06[_0x40fc('0x4d')][_0x40fc('0x59')]+'%'};return _0x38e9fc;})});}_0x5f7777=_[_0x40fc('0x5c')]({},_0x5f7777,_0x246e06['options']);return _0x22ff05[_0x40fc('0x9e')](_0x5f7777);}})['then'](function(_0x274cd9){if(_0x274cd9){_0x548a5a=_0x274cd9[_0x40fc('0x63')];if(!_0x246e06[_0x40fc('0x4d')]['hasOwnProperty']('nolimit')){_0x5f7777[_0x40fc('0x24')]=qs[_0x40fc('0x24')](_0x246e06[_0x40fc('0x4d')]['limit']);_0x5f7777['offset']=qs['offset'](_0x246e06[_0x40fc('0x4d')][_0x40fc('0x23')]);}return _0x22ff05[_0x40fc('0x9e')](_0x5f7777);}})['then'](function(_0x3e4b5b){if(_0x3e4b5b){return _0x3e4b5b?{'count':_0x548a5a,'rows':_0x3e4b5b}:null;}})[_0x40fc('0x13')](respondWithResult(_0xf4df3b,null))['catch'](handleError(_0xf4df3b,null));};exports['getMessages']=function(_0x4a737f,_0x2bb73f){var _0x5d9b80={'raw':!![],'where':{}};var _0x10a06d={};var _0x2c1f27={'count':0x0,'rows':[]};return db['MailAccount'][_0x40fc('0x70')]({'where':{'id':_0x4a737f[_0x40fc('0x61')]['id']}})[_0x40fc('0x13')](handleEntityNotFound(_0x2bb73f,null))['then'](function(_0x12b610){if(_0x12b610){_0x10a06d[_0x40fc('0x4f')]=_[_0x40fc('0x62')](db[_0x40fc('0x9f')][_0x40fc('0x4a')]);_0x10a06d['query']=_[_0x40fc('0x62')](_0x4a737f[_0x40fc('0x4d')]);_0x10a06d[_0x40fc('0x57')]=_[_0x40fc('0x4e')](_0x10a06d['model'],_0x10a06d[_0x40fc('0x4d')]);_0x5d9b80[_0x40fc('0x50')]=_[_0x40fc('0x4e')](_0x10a06d[_0x40fc('0x4f')],qs[_0x40fc('0x51')](_0x4a737f[_0x40fc('0x4d')]['fields']));_0x5d9b80[_0x40fc('0x50')]=_0x5d9b80[_0x40fc('0x50')][_0x40fc('0x63')]?_0x5d9b80['attributes']:_0x10a06d[_0x40fc('0x4f')];if(!_0x4a737f[_0x40fc('0x4d')][_0x40fc('0x52')](_0x40fc('0x53'))){_0x5d9b80[_0x40fc('0x24')]=qs['limit'](_0x4a737f[_0x40fc('0x4d')][_0x40fc('0x24')]);_0x5d9b80[_0x40fc('0x23')]=qs[_0x40fc('0x23')](_0x4a737f[_0x40fc('0x4d')]['offset']);}_0x5d9b80[_0x40fc('0x54')]=qs[_0x40fc('0x55')](_0x4a737f[_0x40fc('0x4d')][_0x40fc('0x55')]);_0x5d9b80[_0x40fc('0x56')]=qs[_0x40fc('0x57')](_[_0x40fc('0x58')](_0x4a737f[_0x40fc('0x4d')],_0x10a06d[_0x40fc('0x57')]));_0x5d9b80['where']['MailAccountId']=_0x12b610['id'];if(_0x4a737f[_0x40fc('0x4d')]['filter']){_0x5d9b80[_0x40fc('0x56')]=_[_0x40fc('0x5c')](_0x5d9b80[_0x40fc('0x56')],{'$or':_['map'](_0x5d9b80['attributes'],function(_0x1afb19){var _0x513c69={};_0x513c69[_0x1afb19]={'$like':'%'+_0x4a737f[_0x40fc('0x4d')]['filter']+'%'};return _0x513c69;})});}if(_0x4a737f[_0x40fc('0x4d')][_0x40fc('0xa0')]){var _0x51b73d=_0x4a737f[_0x40fc('0x4d')][_0x40fc('0xa0')][_0x40fc('0xa1')](',');var _0x140a8d={};_0x140a8d[_0x51b73d[0x0]]={'$gte':moment(_0x51b73d[0x1])['format'](_0x40fc('0xa2'))};_0x5d9b80[_0x40fc('0x56')]=_['merge'](_0x5d9b80[_0x40fc('0x56')],_0x140a8d);}_0x5d9b80=_[_0x40fc('0x5c')]({},_0x5d9b80,_0x4a737f[_0x40fc('0x5d')]);return db[_0x40fc('0x9f')][_0x40fc('0x22')]({'where':_0x5d9b80[_0x40fc('0x56')]})['then'](function(_0x83088e){_0x2c1f27['count']=_0x83088e;if(_0x4a737f[_0x40fc('0x4d')][_0x40fc('0x64')]){_0x5d9b80[_0x40fc('0x5e')]=[{'all':!![]}];}return db['MailMessage'][_0x40fc('0x5f')](_0x5d9b80);})['then'](function(_0x4f9230){if(_0x4a737f[_0x40fc('0x4d')]['inlineCss']===_0x40fc('0xa3')){for(var _0x2c355d=0x0;_0x2c355d<_0x4f9230[_0x40fc('0x63')];_0x2c355d++){_0x4f9230[_0x2c355d][_0x40fc('0x65')]=juice(_0x4f9230[_0x2c355d]['body']);}}_0x2c1f27[_0x40fc('0x60')]=_0x4f9230;return _0x2c1f27;});}})[_0x40fc('0x13')](respondWithFilteredResult(_0x2bb73f,_0x5d9b80))[_0x40fc('0x1d')](handleError(_0x2bb73f,null));};exports[_0x40fc('0x2c')]=function(_0x189351,_0xc4342a){var _0x23e146,_0x4e24df={},_0x3e4372;if(_0x189351[_0x40fc('0x65')]['to']){_0x3e4372=_0x189351['body']['to'][_0x40fc('0xa1')](',')[0x0];}return db[_0x40fc('0x49')][_0x40fc('0x68')]({'where':{'id':_0x189351[_0x40fc('0x61')]['id']},'include':[{'model':db['CmList'],'as':_0x40fc('0xa4'),'include':[{'model':db[_0x40fc('0xa5')],'as':'Contacts','where':{'email':_0x3e4372},'limit':0x1,'order':[['updatedAt','DESC']]}]},{'model':db[_0x40fc('0x45')],'as':'Smtp','raw':!![],'include':[{'model':db[_0x40fc('0xa6')],'as':_0x40fc('0xa6'),'raw':!![]}]}]})[_0x40fc('0x13')](handleEntityNotFound(_0xc4342a,null))[_0x40fc('0x13')](function(_0x386c84){if(!_0x386c84)return;_0x23e146=_0x386c84;if(!_0x386c84['Smtp'])throw new Error(_0x40fc('0xa7'));if(_[_0x40fc('0x78')](_0x189351[_0x40fc('0x65')][_0x40fc('0xa8')])){_0x189351[_0x40fc('0x65')][_0x40fc('0xa8')]=util[_0x40fc('0xa9')]('%s\x20<%s>',_0x386c84['name'],_0x386c84['email']||_0x386c84['Smtp'][_0x40fc('0x36')]);}if(_0x189351[_0x40fc('0x65')]['attachments']&&_0x189351[_0x40fc('0x65')][_0x40fc('0xaa')][_0x40fc('0x63')]){for(var _0x3d9abc=0x0;_0x3d9abc<_0x189351['body'][_0x40fc('0xaa')]['length'];_0x3d9abc+=0x1){_0x189351['body'][_0x40fc('0xaa')][_0x3d9abc]={'filename':_0x189351[_0x40fc('0x65')][_0x40fc('0xaa')][_0x3d9abc][_0x40fc('0x2b')],'path':path['join'](config[_0x40fc('0xab')],_0x40fc('0xac'),_0x189351[_0x40fc('0x65')][_0x40fc('0xaa')][_0x3d9abc][_0x40fc('0xad')])};}}var _0x5d1b14=_0x386c84[_0x40fc('0xae')]();return respondWithRpcPromise(_0x40fc('0xaf'),'sendMail',{'account':_0x5d1b14,'message':_0x189351['body']});})['then'](function(_0x46dfdd){if(!_0x46dfdd)return;_0x4e24df=_0x46dfdd;if(!_0x23e146[_0x40fc('0xa4')])throw new Error(_0x40fc('0xb0'));if(_0x23e146['List'][_0x40fc('0xb1')]['length'])return _0x23e146[_0x40fc('0xa4')][_0x40fc('0xb1')][0x0];return db[_0x40fc('0xa5')][_0x40fc('0x6e')](_['defaults'](_0x189351['body'],{'firstName':_0x189351[_0x40fc('0x65')]['to'],'email':_0x189351[_0x40fc('0x65')]['to'],'phone':_0x189351[_0x40fc('0x65')]['to'],'ListId':_0x23e146[_0x40fc('0x77')]}));})[_0x40fc('0x13')](function(_0x24ebec){if(!_0x24ebec)return;var _0x1160a8={'UserId':_0x189351[_0x40fc('0x36')]['id'],'ContactId':_0x24ebec['id'],'MailAccountId':_0x23e146['id'],'inReplyTo':_0x4e24df[_0x40fc('0xb2')],'to':_0x189351[_0x40fc('0x65')][_0x40fc('0xa8')],'cc':_0x189351['body']['cc'],'subject':_0x189351[_0x40fc('0x65')][_0x40fc('0xb3')],'attach':_0x189351['body']['attach'],'firstMsgDirection':_0x40fc('0xb4'),'lastMsgAt':moment()[_0x40fc('0xa9')](_0x40fc('0xa2')),'lastMsgDirection':_0x40fc('0xb4'),'Messages':[_[_0x40fc('0x5c')](_0x189351['body'],{'messageId':_0x4e24df[_0x40fc('0xb2')],'sentAt':moment()['format'](_0x40fc('0xa2')),'read':!![],'MailAccountId':_0x23e146['id'],'UserId':_0x189351[_0x40fc('0x36')]['id'],'ContactId':_0x24ebec['id']})]};if(_0x189351[_0x40fc('0x65')]['Interaction']){_0x1160a8=_['merge'](_0x1160a8,_0x189351[_0x40fc('0x65')][_0x40fc('0xb5')]);}return db[_0x40fc('0x88')]['create'](_0x1160a8,{'include':[{'model':db[_0x40fc('0x9f')],'as':_0x40fc('0xb6')}]});})['then'](respondWithResult(_0xc4342a,null))[_0x40fc('0x1d')](handleError(_0xc4342a,null));};exports[_0x40fc('0xb7')]=function(_0x544ebe,_0x264839){return db[_0x40fc('0x49')][_0x40fc('0x68')]({'where':{'id':_0x544ebe[_0x40fc('0x61')]['id']},'include':[{'model':db['MailServerOut'],'as':_0x40fc('0x42'),'raw':!![],'include':[{'model':db[_0x40fc('0xa6')],'as':'CloudProvider','raw':!![]}]}]})[_0x40fc('0x13')](handleEntityNotFound(_0x264839,null))[_0x40fc('0x13')](function(_0x10af21){if(!_0x10af21['Smtp'])return;var _0x4b7ee1=_0x10af21['getSmtpOptions']();return respondWithRpcPromise(_0x40fc('0xb8'),_0x40fc('0xb7'),{'account':_0x4b7ee1});})[_0x40fc('0x13')](respondWithResult(_0x264839,null))[_0x40fc('0x1d')](handleError(_0x264839,null));};exports[_0x40fc('0x27')]=function(_0x309b3d,_0x264dc2){return db[_0x40fc('0x49')][_0x40fc('0x68')]({'where':{'id':_0x309b3d[_0x40fc('0x61')]['id']}})[_0x40fc('0x13')](handleEntityNotFound(_0x264dc2,null))[_0x40fc('0x13')](function(_0x5a0be1){if(_0x5a0be1&&_0x5a0be1[_0x40fc('0x3f')]){throw new db[(_0x40fc('0xb9'))][(_0x40fc('0xba'))](_0x40fc('0xbb'));}return _0x5a0be1;})[_0x40fc('0x13')](removeEntity(_0x264dc2,null))[_0x40fc('0x1d')](handleError(_0x264dc2,null));};exports[_0x40fc('0xbc')]=function(_0x1a71a8,_0x80d050){return db[_0x40fc('0x49')]['find']({'where':{'id':_0x1a71a8[_0x40fc('0x61')]['id']}})[_0x40fc('0x13')](handleEntityNotFound(_0x80d050,null))[_0x40fc('0x13')](function(_0x480480){if(_0x480480){return _0x480480['addAgents'](_0x1a71a8[_0x40fc('0x65')]['ids'],_[_0x40fc('0x89')](_0x1a71a8[_0x40fc('0x65')],[_0x40fc('0x71'),'id'])||{})[_0x40fc('0xbd')](function(_0x271479){for(var _0x2959b2=0x0;_0x2959b2<_0x1a71a8['body'][_0x40fc('0x71')][_0x40fc('0x63')];_0x2959b2+=0x1){socket[_0x40fc('0xbe')](_0x40fc('0xbf'),{'UserId':Number(_0x1a71a8[_0x40fc('0x65')][_0x40fc('0x71')][_0x2959b2]),'MailAccountId':Number(_0x1a71a8[_0x40fc('0x61')]['id'])});}return _0x271479;});}})[_0x40fc('0x13')](respondWithResult(_0x80d050,null))[_0x40fc('0x1d')](handleError(_0x80d050,null));};exports[_0x40fc('0xc0')]=function(_0x5bc0e9,_0x4a19b8){return db[_0x40fc('0x49')][_0x40fc('0x68')]({'where':{'id':_0x5bc0e9[_0x40fc('0x61')]['id']}})[_0x40fc('0x13')](handleEntityNotFound(_0x4a19b8,null))['then'](function(_0x5c50e0){if(_0x5c50e0){return _0x5c50e0['removeAgents'](_0x5bc0e9['query'][_0x40fc('0x71')])[_0x40fc('0x13')](function(){if(_[_0x40fc('0xc1')](_0x5bc0e9[_0x40fc('0x4d')][_0x40fc('0x71')])){for(var _0x18cb10=0x0;_0x18cb10<_0x5bc0e9[_0x40fc('0x4d')]['ids']['length'];_0x18cb10+=0x1){socket['emit'](_0x40fc('0xc2'),{'UserId':Number(_0x5bc0e9[_0x40fc('0x4d')][_0x40fc('0x71')][_0x18cb10]),'MailAccountId':Number(_0x5bc0e9[_0x40fc('0x61')]['id'])});}}else{socket[_0x40fc('0xbe')](_0x40fc('0xc2'),{'UserId':Number(_0x5bc0e9[_0x40fc('0x4d')][_0x40fc('0x71')]),'MailAccountId':Number(_0x5bc0e9[_0x40fc('0x61')]['id'])});}});}})[_0x40fc('0x13')](respondWithStatusCode(_0x4a19b8,null))[_0x40fc('0x1d')](handleError(_0x4a19b8,null));};exports[_0x40fc('0xc3')]=function(_0x31b510,_0x2a4760){var _0x29bc9f={};var _0x2958d0={};var _0x559dbf;var _0x4b7dc4;return db['MailAccount']['findOne']({'where':{'id':_0x31b510[_0x40fc('0x61')]['id']}})[_0x40fc('0x13')](handleEntityNotFound(_0x2a4760,null))[_0x40fc('0x13')](function(_0x50fa01){if(_0x50fa01){_0x559dbf=_0x50fa01;_0x2958d0[_0x40fc('0x4f')]=_[_0x40fc('0x62')](db['User'][_0x40fc('0x4a')]);_0x2958d0[_0x40fc('0x4d')]=_[_0x40fc('0x62')](_0x31b510['query']);_0x2958d0['filters']=_[_0x40fc('0x4e')](_0x2958d0['model'],_0x2958d0['query']);_0x29bc9f[_0x40fc('0x50')]=_[_0x40fc('0x4e')](_0x2958d0['model'],qs[_0x40fc('0x51')](_0x31b510[_0x40fc('0x4d')][_0x40fc('0x51')]));_0x29bc9f['attributes']=_0x29bc9f[_0x40fc('0x50')]['length']?_0x29bc9f['attributes']:_0x2958d0[_0x40fc('0x4f')];_0x29bc9f[_0x40fc('0x54')]=qs[_0x40fc('0x55')](_0x31b510['query']['sort']);_0x29bc9f[_0x40fc('0x56')]=qs[_0x40fc('0x57')](_[_0x40fc('0x58')](_0x31b510['query'],_0x2958d0[_0x40fc('0x57')]));if(_0x31b510[_0x40fc('0x4d')][_0x40fc('0x59')]){_0x29bc9f[_0x40fc('0x56')]=_[_0x40fc('0x5c')](_0x29bc9f[_0x40fc('0x56')],{'$or':_[_0x40fc('0x48')](_0x29bc9f[_0x40fc('0x50')],function(_0x414fbe){var _0x43b5e6={};_0x43b5e6[_0x414fbe]={'$like':'%'+_0x31b510['query'][_0x40fc('0x59')]+'%'};return _0x43b5e6;})});}_0x29bc9f=_[_0x40fc('0x5c')]({},_0x29bc9f,_0x31b510['options']);return _0x559dbf[_0x40fc('0xc3')](_0x29bc9f);}})[_0x40fc('0x13')](function(_0x520341){if(_0x520341){_0x4b7dc4=_0x520341[_0x40fc('0x63')];if(!_0x31b510[_0x40fc('0x4d')]['hasOwnProperty'](_0x40fc('0x53'))){_0x29bc9f[_0x40fc('0x24')]=qs[_0x40fc('0x24')](_0x31b510['query'][_0x40fc('0x24')]);_0x29bc9f[_0x40fc('0x23')]=qs[_0x40fc('0x23')](_0x31b510[_0x40fc('0x4d')]['offset']);}return _0x559dbf[_0x40fc('0xc3')](_0x29bc9f);}})[_0x40fc('0x13')](function(_0x131440){if(_0x131440){return _0x131440?{'count':_0x4b7dc4,'rows':_0x131440}:null;}})[_0x40fc('0x13')](respondWithResult(_0x2a4760,null))[_0x40fc('0x1d')](handleError(_0x2a4760,null));}; \ No newline at end of file +var _0xa960=['getSmtpOptions','sendMail','List\x20not\x20found','messageId','subject','attach','out','Interaction','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','spread','emit','userMailAccount:save','removeAgents','isArray','userMailAccount:remove','User','getAgents','moment','bluebird','util','lodash','juice','ioredis','../../config/logger','../../config/environment','redis','defaults','localhost','socket.io-emitter','./mailAccount.socket','register','jayson/promise','client','http','then','info','MailAccount,\x20%s,\x20%s','debug','MailAccount,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','result','catch','sendStatus','end','status','json','offset','limit','undefined','set','update','destroy','get','MailAccounts','UserProfileResource','stack','name','gmail','imap.gmail.com','yahoo','imap.mail.yahoo.com','hotmail','imap-mail.outlook.com','outlook.office365.com','smtp.mail.yahoo.com','smtp-mail.outlook.com','outlook365','Unknown\x20email\x20service\x20provider','user','username','modernAuthentication','CloudProviderId','pass','host','port','secure','service','authentication','password','Imap','Smtp','index','MailServerIn','Pause','MailAccount','rawAttributes','fieldName','type','key','model','map','keys','query','intersection','attributes','fields','length','hasOwnProperty','sort','pick','where','merge','VIRTUAL','filter','count','includeAll','include','findAll','rows','show','params','filters','options','body','provider','custom','find','Mail\x20Account\x20not\x20found','MailServerOut','describe','addDisposition','MailAccountId','Disposition','findOne','nolimit','order','removeDispositions','addAnswer','CannedAnswer','create','removeAnswers','ids','email','ListId','isNil','active','description','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','addImap','setImap','getSmtp','addSmtp','removeSmtp','addInteraction','MailInteraction','omit','getInteractions','CmContact','Owner','fullname','internal','Tag','color','tag','addApplications','sequelize','transaction','ISOLATION_LEVELS','READ_COMMITTED','MailApplication','bulkCreate','findAndCountAll','priority','finally','send','getApplications','getMessages','MailMessage','$gte','split','YYYY-MM-DD\x20HH:mm:ss','true','List','Contacts','updatedAt','DESC','CloudProvider','Smtp\x20configuration\x20not\x20found','from','format','%s\x20<%s>','attachments','join','root','basename'];(function(_0x501932,_0x432837){var _0x1fe5eb=function(_0x5927cb){while(--_0x5927cb){_0x501932['push'](_0x501932['shift']());}};_0x1fe5eb(++_0x432837);}(_0xa960,0xd3));var _0x0a96=function(_0x298b37,_0x1c99ca){_0x298b37=_0x298b37-0x0;var _0x288ae3=_0xa960[_0x298b37];return _0x288ae3;};'use strict';var moment=require(_0x0a96('0x0'));var BPromise=require(_0x0a96('0x1'));var util=require(_0x0a96('0x2'));var path=require('path');var _=require(_0x0a96('0x3'));var juice=require(_0x0a96('0x4'));var Redis=require(_0x0a96('0x5'));var qs=require('../../components/parsers/qs');var logger=require(_0x0a96('0x6'))('api');var config=require(_0x0a96('0x7'));var db=require('../../mysqldb')['db'];config[_0x0a96('0x8')]=_[_0x0a96('0x9')](config[_0x0a96('0x8')],{'host':_0x0a96('0xa'),'port':0x18eb});var socket=require(_0x0a96('0xb'))(new Redis(config[_0x0a96('0x8')]));require(_0x0a96('0xc'))[_0x0a96('0xd')](socket);var jayson=require(_0x0a96('0xe'));var client=jayson[_0x0a96('0xf')][_0x0a96('0x10')]({'port':0x232b});function respondWithRpcPromise(_0x2c2c6b,_0x5f0d49,_0x918fb0,_0x224058){return new BPromise(function(_0x3d9453,_0x126626){var _0x1949fc=_0x224058||client;return _0x1949fc['request'](_0x2c2c6b,_0x918fb0)[_0x0a96('0x11')](function(_0x2c8b5c){logger[_0x0a96('0x12')](_0x0a96('0x13'),_0x5f0d49,'request\x20sent');logger[_0x0a96('0x14')](_0x0a96('0x15'),_0x5f0d49,'request\x20sent',JSON['stringify'](_0x2c8b5c));if(_0x2c8b5c[_0x0a96('0x16')]){if(_0x2c8b5c[_0x0a96('0x16')][_0x0a96('0x17')]===0x1f4){logger[_0x0a96('0x16')](_0x0a96('0x13'),_0x5f0d49,_0x2c8b5c[_0x0a96('0x16')][_0x0a96('0x18')]);return _0x126626(_0x2c8b5c[_0x0a96('0x16')][_0x0a96('0x18')]);}logger[_0x0a96('0x16')](_0x0a96('0x13'),_0x5f0d49,_0x2c8b5c[_0x0a96('0x16')][_0x0a96('0x18')]);return _0x3d9453(_0x2c8b5c[_0x0a96('0x16')][_0x0a96('0x18')]);}else{logger[_0x0a96('0x12')](_0x0a96('0x13'),_0x5f0d49,_0x0a96('0x19'));_0x3d9453(_0x2c8b5c[_0x0a96('0x1a')][_0x0a96('0x18')]);}})[_0x0a96('0x1b')](function(_0x5b44dd){logger[_0x0a96('0x16')](_0x0a96('0x13'),_0x5f0d49,_0x5b44dd);_0x126626(_0x5b44dd);});});}function respondWithStatusCode(_0x56276f,_0x4ceaa6){_0x4ceaa6=_0x4ceaa6||0xcc;return function(_0x223579){if(_0x223579){return _0x56276f[_0x0a96('0x1c')](_0x4ceaa6);}return _0x56276f['status'](_0x4ceaa6)[_0x0a96('0x1d')]();};}function respondWithResult(_0x150b3c,_0x163100){_0x163100=_0x163100||0xc8;return function(_0x33b2e9){if(_0x33b2e9){return _0x150b3c[_0x0a96('0x1e')](_0x163100)[_0x0a96('0x1f')](_0x33b2e9);}};}function respondWithFilteredResult(_0x2ce69e,_0x2a6ac2){return function(_0x37bbba){if(_0x37bbba){var _0x20cc8f=typeof _0x2a6ac2[_0x0a96('0x20')]==='undefined'&&typeof _0x2a6ac2[_0x0a96('0x21')]===_0x0a96('0x22');var _0x3986be=_0x37bbba['count'];var _0x4e92e6=_0x20cc8f?0x0:_0x2a6ac2[_0x0a96('0x20')];var _0x106564=_0x20cc8f?_0x37bbba['count']:_0x2a6ac2[_0x0a96('0x20')]+_0x2a6ac2['limit'];var _0x67bd5f;if(_0x106564>=_0x3986be){_0x106564=_0x3986be;_0x67bd5f=0xc8;}else{_0x67bd5f=0xce;}_0x2ce69e[_0x0a96('0x1e')](_0x67bd5f);return _0x2ce69e[_0x0a96('0x23')]('Content-Range',_0x4e92e6+'-'+_0x106564+'/'+_0x3986be)[_0x0a96('0x1f')](_0x37bbba);}return null;};}function saveUpdates(_0x3b1062){return function(_0x3aff28){if(_0x3aff28){return _0x3aff28[_0x0a96('0x24')](_0x3b1062)[_0x0a96('0x11')](function(_0x1ee69b){return _0x1ee69b;});}return null;};}function removeEntity(_0x4fcc7a){return function(_0x51932f){if(_0x51932f){return _0x51932f[_0x0a96('0x25')]()[_0x0a96('0x11')](function(){var _0x56f0ce=_0x51932f[_0x0a96('0x26')]({'plain':!![]});var _0x148572=_0x0a96('0x27');return db[_0x0a96('0x28')][_0x0a96('0x25')]({'where':{'type':_0x148572,'resourceId':_0x56f0ce['id']}})['then'](function(){return _0x51932f;});})[_0x0a96('0x11')](function(){_0x4fcc7a['status'](0xcc)[_0x0a96('0x1d')]();});}};}function handleEntityNotFound(_0x4244f3){return function(_0x4962a1){if(!_0x4962a1){_0x4244f3['sendStatus'](0x194);}return _0x4962a1;};}function handleError(_0x520756,_0x449900){_0x449900=_0x449900||0x1f4;return function(_0xf0e40a){logger['error'](_0xf0e40a[_0x0a96('0x29')]);if(_0xf0e40a[_0x0a96('0x2a')]){delete _0xf0e40a[_0x0a96('0x2a')];}_0x520756[_0x0a96('0x1e')](_0x449900)['send'](_0xf0e40a);};}function getImapHost(_0x47c1ab){switch(_0x47c1ab){case _0x0a96('0x2b'):return _0x0a96('0x2c');case _0x0a96('0x2d'):return _0x0a96('0x2e');case _0x0a96('0x2f'):return _0x0a96('0x30');case'outlook365':return _0x0a96('0x31');}throw new Error('Unknown\x20email\x20service\x20provider',_0x47c1ab);}function getSmtpHost(_0x5d9f0d){switch(_0x5d9f0d){case'gmail':return'smtp.gmail.com';case _0x0a96('0x2d'):return _0x0a96('0x32');case _0x0a96('0x2f'):return _0x0a96('0x33');case _0x0a96('0x34'):return'smtp.office365.com';}throw new Error(_0x0a96('0x35'),_0x5d9f0d);}function getAuthenticationOptions(_0x548d45,_0x34eea5){var _0x228ead={};var _0x45435a={};if(_0x548d45){_0x228ead[_0x0a96('0x36')]=_0x45435a[_0x0a96('0x36')]=_0x34eea5[_0x0a96('0x37')];_0x228ead['password']=_0x45435a['pass']=_0x34eea5['password'];if(_0x34eea5[_0x0a96('0x38')]){_0x228ead['modernAuthentication']=_0x45435a[_0x0a96('0x38')]=!![];_0x228ead[_0x0a96('0x39')]=_0x45435a[_0x0a96('0x39')]=_0x34eea5['CloudProviderId'];_0x228ead['password']=_0x45435a[_0x0a96('0x3a')]=null;}else{_0x228ead[_0x0a96('0x39')]=_0x45435a[_0x0a96('0x39')]=null;}_0x228ead[_0x0a96('0x3b')]=getImapHost(_0x548d45);_0x228ead['port']=0x3e1;_0x45435a[_0x0a96('0x3b')]=getSmtpHost(_0x548d45);_0x45435a[_0x0a96('0x3c')]=0x24b;_0x45435a[_0x0a96('0x3d')]=![];_0x228ead[_0x0a96('0x3e')]=_0x45435a[_0x0a96('0x3e')]=null;}else{if(_0x34eea5[_0x0a96('0x3f')]){_0x228ead[_0x0a96('0x36')]=_0x45435a['user']=_0x34eea5[_0x0a96('0x37')];_0x228ead[_0x0a96('0x40')]=_0x45435a[_0x0a96('0x3a')]=_0x34eea5[_0x0a96('0x40')];}else{_0x228ead['authentication']=_0x45435a['authentication']=![];_0x228ead[_0x0a96('0x36')]=_0x45435a[_0x0a96('0x36')]=null;_0x228ead[_0x0a96('0x40')]=_0x45435a['pass']=null;}_0x228ead[_0x0a96('0x3b')]=_0x34eea5['Imap']['host'];_0x228ead['port']=_0x34eea5[_0x0a96('0x41')]['port'];_0x45435a['host']=_0x34eea5[_0x0a96('0x42')][_0x0a96('0x3b')];_0x45435a[_0x0a96('0x3c')]=_0x34eea5[_0x0a96('0x42')][_0x0a96('0x3c')];}return{'Imap':_0x228ead,'Smtp':_0x45435a};}exports[_0x0a96('0x43')]=function(_0x488c06,_0x4bc9b3){var _0x417902={'include':[{'model':db[_0x0a96('0x44')],'as':'Imap'},{'model':db['MailServerOut'],'as':_0x0a96('0x42')},{'model':db[_0x0a96('0x45')],'as':'mandatoryDispositionPause'}]},_0x4f21f8={},_0x1c0226={'count':0x0,'rows':[]};var _0x30b3e1=_['map'](db[_0x0a96('0x46')][_0x0a96('0x47')],function(_0x6a5c74){return{'name':_0x6a5c74[_0x0a96('0x48')],'type':_0x6a5c74[_0x0a96('0x49')][_0x0a96('0x4a')]};});_0x4f21f8[_0x0a96('0x4b')]=_[_0x0a96('0x4c')](_0x30b3e1,'name');_0x4f21f8['query']=_[_0x0a96('0x4d')](_0x488c06[_0x0a96('0x4e')]);_0x4f21f8['filters']=_[_0x0a96('0x4f')](_0x4f21f8[_0x0a96('0x4b')],_0x4f21f8[_0x0a96('0x4e')]);_0x417902[_0x0a96('0x50')]=_[_0x0a96('0x4f')](_0x4f21f8[_0x0a96('0x4b')],qs[_0x0a96('0x51')](_0x488c06['query'][_0x0a96('0x51')]));_0x417902[_0x0a96('0x50')]=_0x417902[_0x0a96('0x50')][_0x0a96('0x52')]?_0x417902[_0x0a96('0x50')]:_0x4f21f8[_0x0a96('0x4b')];if(!_0x488c06[_0x0a96('0x4e')][_0x0a96('0x53')]('nolimit')){_0x417902[_0x0a96('0x21')]=qs[_0x0a96('0x21')](_0x488c06[_0x0a96('0x4e')][_0x0a96('0x21')]);_0x417902['offset']=qs[_0x0a96('0x20')](_0x488c06[_0x0a96('0x4e')]['offset']);}_0x417902['order']=qs[_0x0a96('0x54')](_0x488c06['query'][_0x0a96('0x54')]);_0x417902['where']=qs['filters'](_[_0x0a96('0x55')](_0x488c06[_0x0a96('0x4e')],_0x4f21f8['filters']),_0x30b3e1);if(_0x488c06[_0x0a96('0x4e')]['filter']){_0x417902[_0x0a96('0x56')]=_[_0x0a96('0x57')](_0x417902[_0x0a96('0x56')],{'$or':_[_0x0a96('0x4c')](_0x30b3e1,function(_0x4a62e8){if(_0x4a62e8['type']!==_0x0a96('0x58')){var _0x2df7c6={};_0x2df7c6[_0x4a62e8[_0x0a96('0x2a')]]={'$like':'%'+_0x488c06['query'][_0x0a96('0x59')]+'%'};return _0x2df7c6;}})});}_0x417902=_[_0x0a96('0x57')]({},_0x417902,_0x488c06['options']);var _0x258b48={'where':_0x417902[_0x0a96('0x56')]};return db[_0x0a96('0x46')][_0x0a96('0x5a')](_0x258b48)[_0x0a96('0x11')](function(_0x260a32){_0x1c0226[_0x0a96('0x5a')]=_0x260a32;if(_0x488c06[_0x0a96('0x4e')][_0x0a96('0x5b')]){_0x417902[_0x0a96('0x5c')]=[{'all':!![]}];}return db[_0x0a96('0x46')][_0x0a96('0x5d')](_0x417902);})['then'](function(_0x5e1215){_0x1c0226[_0x0a96('0x5e')]=_0x5e1215;return _0x1c0226;})[_0x0a96('0x11')](respondWithFilteredResult(_0x4bc9b3,_0x417902))[_0x0a96('0x1b')](handleError(_0x4bc9b3,null));};exports[_0x0a96('0x5f')]=function(_0x2de02d,_0x1cff69){var _0x31011d={'raw':![],'where':{'id':_0x2de02d[_0x0a96('0x60')]['id']},'include':[{'model':db[_0x0a96('0x44')],'as':_0x0a96('0x41')},{'model':db['MailServerOut'],'as':'Smtp'},{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x2625f6={};_0x2625f6[_0x0a96('0x4b')]=_[_0x0a96('0x4d')](db[_0x0a96('0x46')][_0x0a96('0x47')]);_0x2625f6['query']=_[_0x0a96('0x4d')](_0x2de02d[_0x0a96('0x4e')]);_0x2625f6[_0x0a96('0x61')]=_[_0x0a96('0x4f')](_0x2625f6['model'],_0x2625f6[_0x0a96('0x4e')]);_0x31011d['attributes']=_[_0x0a96('0x4f')](_0x2625f6[_0x0a96('0x4b')],qs[_0x0a96('0x51')](_0x2de02d[_0x0a96('0x4e')][_0x0a96('0x51')]));_0x31011d['attributes']=_0x31011d['attributes']['length']?_0x31011d[_0x0a96('0x50')]:_0x2625f6[_0x0a96('0x4b')];if(_0x2de02d[_0x0a96('0x4e')]['includeAll']){_0x31011d[_0x0a96('0x5c')]=[{'all':!![]}];}_0x31011d=_[_0x0a96('0x57')]({},_0x31011d,_0x2de02d[_0x0a96('0x62')]);return db['MailAccount']['find'](_0x31011d)[_0x0a96('0x11')](handleEntityNotFound(_0x1cff69,null))['then'](respondWithResult(_0x1cff69,null))['catch'](handleError(_0x1cff69,null));};exports[_0x0a96('0x24')]=function(_0x51dcc0,_0x456cd1){if(_0x51dcc0[_0x0a96('0x63')]['id']){delete _0x51dcc0[_0x0a96('0x63')]['id'];}var _0x36d632=_0x51dcc0[_0x0a96('0x63')][_0x0a96('0x64')]===_0x0a96('0x65')?null:_0x51dcc0[_0x0a96('0x63')][_0x0a96('0x64')];var _0x355eb3=_0x51dcc0[_0x0a96('0x63')][_0x0a96('0x41')]||{};var _0x1624e5=_0x51dcc0['body'][_0x0a96('0x42')]||{};if(_0x36d632){_0x355eb3[_0x0a96('0x3b')]=getImapHost(_0x36d632);_0x355eb3[_0x0a96('0x3c')]=0x3e1;_0x1624e5['host']=getSmtpHost(_0x36d632);_0x1624e5['port']=0x24b;_0x1624e5[_0x0a96('0x3d')]=![];}if(_0x1624e5['modernAuthentication']){_0x1624e5['secure']=![];}else{_0x1624e5['CloudProviderId']=null;}if(!_0x355eb3['modernAuthentication'])_0x355eb3[_0x0a96('0x39')]=null;_0x51dcc0['body']['Imap']=_0x355eb3;_0x51dcc0[_0x0a96('0x63')][_0x0a96('0x42')]=_0x1624e5;return db[_0x0a96('0x46')][_0x0a96('0x66')]({'where':{'id':_0x51dcc0[_0x0a96('0x60')]['id']},'include':[{'model':db[_0x0a96('0x44')],'as':'Imap'},{'model':db['MailServerOut'],'as':'Smtp'},{'model':db[_0x0a96('0x45')],'as':'mandatoryDispositionPause'}]})[_0x0a96('0x11')](handleEntityNotFound(_0x456cd1,null))[_0x0a96('0x11')](function(_0x5b5f51){if(!_0x5b5f51)throw new Error(_0x0a96('0x67'));if(_0x5b5f51[_0x0a96('0x3e')])delete _0x51dcc0[_0x0a96('0x63')][_0x0a96('0x41')];return _0x5b5f51;})[_0x0a96('0x11')](saveUpdates(_0x51dcc0[_0x0a96('0x63')],null))[_0x0a96('0x11')](function(_0x36d225){if(!_0x51dcc0[_0x0a96('0x63')][_0x0a96('0x41')])return _0x36d225;return db['MailServerIn']['update'](_0x51dcc0[_0x0a96('0x63')]['Imap'],{'where':{'MailAccountId':_0x36d225['id']}})[_0x0a96('0x11')](function(){return _0x36d225;});})[_0x0a96('0x11')](function(_0x3b8610){if(!_0x51dcc0['body']['Smtp'])return _0x3b8610;return db[_0x0a96('0x68')][_0x0a96('0x24')](_0x51dcc0['body'][_0x0a96('0x42')],{'where':{'MailAccountId':_0x3b8610['id']}})['then'](function(){return _0x3b8610;});})[_0x0a96('0x11')](respondWithResult(_0x456cd1,null))['catch'](handleError(_0x456cd1,null));};exports[_0x0a96('0x69')]=function(_0x288b20,_0x40b2e4){return db[_0x0a96('0x46')]['describe']()[_0x0a96('0x11')](respondWithResult(_0x40b2e4,null))[_0x0a96('0x1b')](handleError(_0x40b2e4,null));};exports[_0x0a96('0x6a')]=function(_0x439f8c,_0x51c021){if(_0x439f8c[_0x0a96('0x63')]['id']){delete _0x439f8c[_0x0a96('0x63')]['id'];}return db[_0x0a96('0x46')][_0x0a96('0x66')]({'where':{'id':_0x439f8c[_0x0a96('0x60')]['id']}})[_0x0a96('0x11')](handleEntityNotFound(_0x51c021,null))[_0x0a96('0x11')](function(_0x264a46){if(_0x264a46){_0x439f8c[_0x0a96('0x63')][_0x0a96('0x6b')]=_0x264a46['id'];return db[_0x0a96('0x6c')]['create'](_0x439f8c[_0x0a96('0x63')]);}})[_0x0a96('0x11')](respondWithResult(_0x51c021,null))[_0x0a96('0x1b')](handleError(_0x51c021,null));};exports['getDispositions']=function(_0x2da5ce,_0x5b784a){var _0x288dc6={'raw':![],'where':{}};var _0x878248={};var _0x264d54={'count':0x0,'rows':[]};return db['MailAccount'][_0x0a96('0x6d')]({'where':{'id':_0x2da5ce[_0x0a96('0x60')]['id']}})[_0x0a96('0x11')](handleEntityNotFound(_0x5b784a,null))[_0x0a96('0x11')](function(_0xac04dc){if(_0xac04dc){_0x878248['model']=_[_0x0a96('0x4d')](db['Disposition'][_0x0a96('0x47')]);_0x878248['query']=_['keys'](_0x2da5ce[_0x0a96('0x4e')]);_0x878248[_0x0a96('0x61')]=_[_0x0a96('0x4f')](_0x878248[_0x0a96('0x4b')],_0x878248[_0x0a96('0x4e')]);_0x288dc6[_0x0a96('0x50')]=_[_0x0a96('0x4f')](_0x878248[_0x0a96('0x4b')],qs[_0x0a96('0x51')](_0x2da5ce[_0x0a96('0x4e')][_0x0a96('0x51')]));_0x288dc6['attributes']=_0x288dc6[_0x0a96('0x50')]['length']?_0x288dc6[_0x0a96('0x50')]:_0x878248[_0x0a96('0x4b')];if(!_0x2da5ce['query'][_0x0a96('0x53')](_0x0a96('0x6e'))){_0x288dc6[_0x0a96('0x21')]=qs[_0x0a96('0x21')](_0x2da5ce[_0x0a96('0x4e')][_0x0a96('0x21')]);_0x288dc6[_0x0a96('0x20')]=qs[_0x0a96('0x20')](_0x2da5ce[_0x0a96('0x4e')][_0x0a96('0x20')]);}_0x288dc6[_0x0a96('0x6f')]=qs[_0x0a96('0x54')](_0x2da5ce['query']['sort']);_0x288dc6[_0x0a96('0x56')]=qs['filters'](_[_0x0a96('0x55')](_0x2da5ce[_0x0a96('0x4e')],_0x878248[_0x0a96('0x61')]));_0x288dc6[_0x0a96('0x56')][_0x0a96('0x6b')]=_0xac04dc['id'];if(_0x2da5ce['query'][_0x0a96('0x59')]){_0x288dc6[_0x0a96('0x56')]=_[_0x0a96('0x57')](_0x288dc6[_0x0a96('0x56')],{'$or':_[_0x0a96('0x4c')](_0x288dc6[_0x0a96('0x50')],function(_0x411f22){var _0x2ec23f={};_0x2ec23f[_0x411f22]={'$like':'%'+_0x2da5ce['query'][_0x0a96('0x59')]+'%'};return _0x2ec23f;})});}_0x288dc6=_[_0x0a96('0x57')]({},_0x288dc6,_0x2da5ce[_0x0a96('0x62')]);return db['Disposition'][_0x0a96('0x5a')]({'where':_0x288dc6[_0x0a96('0x56')]})[_0x0a96('0x11')](function(_0x169162){_0x264d54[_0x0a96('0x5a')]=_0x169162;if(_0x2da5ce[_0x0a96('0x4e')]['includeAll']){_0x288dc6[_0x0a96('0x5c')]=[{'all':!![]}];}return db[_0x0a96('0x6c')][_0x0a96('0x5d')](_0x288dc6);})[_0x0a96('0x11')](function(_0x5db215){_0x264d54['rows']=_0x5db215;return _0x264d54;});}})[_0x0a96('0x11')](respondWithFilteredResult(_0x5b784a,_0x288dc6))[_0x0a96('0x1b')](handleError(_0x5b784a,null));};exports['removeDispositions']=function(_0x5ee0c9,_0x413616){return db[_0x0a96('0x46')][_0x0a96('0x66')]({'where':{'id':_0x5ee0c9[_0x0a96('0x60')]['id']}})[_0x0a96('0x11')](handleEntityNotFound(_0x413616,null))[_0x0a96('0x11')](function(_0x3d1e78){if(_0x3d1e78){return _0x3d1e78[_0x0a96('0x70')](_0x5ee0c9[_0x0a96('0x4e')]['ids']);}})[_0x0a96('0x11')](respondWithStatusCode(_0x413616,null))[_0x0a96('0x1b')](handleError(_0x413616,null));};exports[_0x0a96('0x71')]=function(_0x355beb,_0x214a69){if(_0x355beb[_0x0a96('0x63')]['id']){delete _0x355beb[_0x0a96('0x63')]['id'];}return db[_0x0a96('0x46')][_0x0a96('0x66')]({'where':{'id':_0x355beb[_0x0a96('0x60')]['id']}})[_0x0a96('0x11')](handleEntityNotFound(_0x214a69,null))['then'](function(_0x22c0ee){if(_0x22c0ee){_0x355beb[_0x0a96('0x63')][_0x0a96('0x6b')]=_0x22c0ee['id'];return db[_0x0a96('0x72')][_0x0a96('0x73')](_0x355beb[_0x0a96('0x63')]);}})[_0x0a96('0x11')](respondWithResult(_0x214a69,null))[_0x0a96('0x1b')](handleError(_0x214a69,null));};exports['getAnswers']=function(_0x1cd061,_0x481b60){var _0x22477d={'raw':![],'where':{}};var _0x3e43e3={};var _0x37424d={'count':0x0,'rows':[]};return db[_0x0a96('0x46')][_0x0a96('0x6d')]({'where':{'id':_0x1cd061[_0x0a96('0x60')]['id']}})[_0x0a96('0x11')](handleEntityNotFound(_0x481b60,null))['then'](function(_0x12d16f){if(_0x12d16f){_0x3e43e3[_0x0a96('0x4b')]=_['keys'](db[_0x0a96('0x72')][_0x0a96('0x47')]);_0x3e43e3[_0x0a96('0x4e')]=_[_0x0a96('0x4d')](_0x1cd061[_0x0a96('0x4e')]);_0x3e43e3['filters']=_[_0x0a96('0x4f')](_0x3e43e3[_0x0a96('0x4b')],_0x3e43e3[_0x0a96('0x4e')]);_0x22477d[_0x0a96('0x50')]=_['intersection'](_0x3e43e3[_0x0a96('0x4b')],qs[_0x0a96('0x51')](_0x1cd061[_0x0a96('0x4e')][_0x0a96('0x51')]));_0x22477d[_0x0a96('0x50')]=_0x22477d[_0x0a96('0x50')][_0x0a96('0x52')]?_0x22477d[_0x0a96('0x50')]:_0x3e43e3[_0x0a96('0x4b')];if(!_0x1cd061[_0x0a96('0x4e')]['hasOwnProperty'](_0x0a96('0x6e'))){_0x22477d[_0x0a96('0x21')]=qs[_0x0a96('0x21')](_0x1cd061['query'][_0x0a96('0x21')]);_0x22477d['offset']=qs['offset'](_0x1cd061[_0x0a96('0x4e')][_0x0a96('0x20')]);}_0x22477d[_0x0a96('0x6f')]=qs['sort'](_0x1cd061[_0x0a96('0x4e')][_0x0a96('0x54')]);_0x22477d['where']=qs[_0x0a96('0x61')](_[_0x0a96('0x55')](_0x1cd061[_0x0a96('0x4e')],_0x3e43e3[_0x0a96('0x61')]));_0x22477d[_0x0a96('0x56')][_0x0a96('0x6b')]=_0x12d16f['id'];if(_0x1cd061['query']['filter']){_0x22477d[_0x0a96('0x56')]=_[_0x0a96('0x57')](_0x22477d[_0x0a96('0x56')],{'$or':_[_0x0a96('0x4c')](_0x22477d['attributes'],function(_0x6da707){var _0x58cfc7={};_0x58cfc7[_0x6da707]={'$like':'%'+_0x1cd061[_0x0a96('0x4e')]['filter']+'%'};return _0x58cfc7;})});}_0x22477d=_[_0x0a96('0x57')]({},_0x22477d,_0x1cd061[_0x0a96('0x62')]);return db[_0x0a96('0x72')]['count']({'where':_0x22477d['where']})[_0x0a96('0x11')](function(_0x1cfbd0){_0x37424d[_0x0a96('0x5a')]=_0x1cfbd0;if(_0x1cd061[_0x0a96('0x4e')][_0x0a96('0x5b')]){_0x22477d['include']=[{'all':!![]}];}return db['CannedAnswer'][_0x0a96('0x5d')](_0x22477d);})[_0x0a96('0x11')](function(_0x30ede2){_0x37424d[_0x0a96('0x5e')]=_0x30ede2;return _0x37424d;});}})[_0x0a96('0x11')](respondWithFilteredResult(_0x481b60,_0x22477d))[_0x0a96('0x1b')](handleError(_0x481b60,null));};exports[_0x0a96('0x74')]=function(_0x55c0bd,_0x2bdbbd){return db['MailAccount'][_0x0a96('0x66')]({'where':{'id':_0x55c0bd[_0x0a96('0x60')]['id']}})[_0x0a96('0x11')](handleEntityNotFound(_0x2bdbbd,null))[_0x0a96('0x11')](function(_0x5be68c){if(_0x5be68c){return _0x5be68c[_0x0a96('0x74')](_0x55c0bd['query'][_0x0a96('0x75')]);}})[_0x0a96('0x11')](respondWithStatusCode(_0x2bdbbd,null))[_0x0a96('0x1b')](handleError(_0x2bdbbd,null));};exports[_0x0a96('0x73')]=function(_0x3031a1,_0x1d2e2d){var _0x5d80fe={'name':_0x3031a1[_0x0a96('0x63')][_0x0a96('0x2a')],'key':_0x3031a1[_0x0a96('0x63')][_0x0a96('0x4a')],'provider':_0x3031a1[_0x0a96('0x63')][_0x0a96('0x64')]==='custom'?null:_0x3031a1[_0x0a96('0x63')][_0x0a96('0x64')],'email':_0x3031a1[_0x0a96('0x63')][_0x0a96('0x76')],'ListId':_0x3031a1['body'][_0x0a96('0x77')],'active':!_[_0x0a96('0x78')](_0x3031a1[_0x0a96('0x63')][_0x0a96('0x79')])?_0x3031a1[_0x0a96('0x63')][_0x0a96('0x79')]:!![],'description':_0x3031a1['body'][_0x0a96('0x7a')]||null};var _0x269e78=getAuthenticationOptions(_0x5d80fe[_0x0a96('0x64')],_0x3031a1[_0x0a96('0x63')]);_0x5d80fe[_0x0a96('0x41')]=_0x269e78[_0x0a96('0x41')];_0x5d80fe[_0x0a96('0x42')]=_0x269e78['Smtp'];return db[_0x0a96('0x46')]['create'](_0x5d80fe,{'include':[{'model':db[_0x0a96('0x68')],'as':_0x0a96('0x42')},{'model':db['MailServerIn'],'as':'Imap'}]})[_0x0a96('0x11')](function(_0x1dd3f6){var _0x548165=_0x3031a1[_0x0a96('0x36')][_0x0a96('0x26')]({'plain':!![]});if(!_0x548165)throw new Error(_0x0a96('0x7b'));if(_0x548165[_0x0a96('0x7c')]===_0x0a96('0x36')){var _0x4c5c55=_0x1dd3f6[_0x0a96('0x26')]({'plain':!![]});return db['UserProfileSection'][_0x0a96('0x66')]({'where':{'name':_0x0a96('0x27'),'userProfileId':_0x548165['userProfileId']},'raw':!![]})[_0x0a96('0x11')](function(_0x58a0a9){if(_0x58a0a9&&_0x58a0a9[_0x0a96('0x7d')]===0x0){return db[_0x0a96('0x28')][_0x0a96('0x73')]({'name':_0x4c5c55[_0x0a96('0x2a')],'resourceId':_0x4c5c55['id'],'type':_0x58a0a9[_0x0a96('0x2a')],'sectionId':_0x58a0a9['id']},{})[_0x0a96('0x11')](function(){return _0x1dd3f6;});}else{return _0x1dd3f6;}})[_0x0a96('0x1b')](function(_0x2e0d18){logger[_0x0a96('0x16')](_0x0a96('0x7e'),_0x2e0d18);throw _0x2e0d18;});}return _0x1dd3f6;})[_0x0a96('0x11')](respondWithResult(_0x1d2e2d,0xc9))[_0x0a96('0x1b')](handleError(_0x1d2e2d,null));};exports[_0x0a96('0x7f')]=function(_0x1c16d6,_0x289aed){return db['MailAccount'][_0x0a96('0x6d')]({'where':{'id':_0x1c16d6[_0x0a96('0x60')]['id']}})['then'](handleEntityNotFound(_0x289aed,null))[_0x0a96('0x11')](function(_0x559d83){if(_0x559d83){return _0x559d83[_0x0a96('0x7f')]();}return null;})[_0x0a96('0x11')](respondWithResult(_0x289aed,null))[_0x0a96('0x1b')](handleError(_0x289aed,null));};exports[_0x0a96('0x80')]=function(_0x3a2d5f,_0x143553){if(_0x3a2d5f[_0x0a96('0x63')]['id']){delete _0x3a2d5f[_0x0a96('0x63')]['id'];}return db[_0x0a96('0x46')][_0x0a96('0x66')]({'where':{'id':_0x3a2d5f[_0x0a96('0x60')]['id']}})[_0x0a96('0x11')](handleEntityNotFound(_0x143553,null))[_0x0a96('0x11')](function(_0x1ac77d){if(_0x1ac77d){_0x3a2d5f[_0x0a96('0x63')][_0x0a96('0x6b')]=_0x1ac77d['id'];return db['MailServerIn'][_0x0a96('0x73')](_0x3a2d5f[_0x0a96('0x63')]);}})['then'](respondWithResult(_0x143553,null))[_0x0a96('0x1b')](handleError(_0x143553,null));};exports['removeImap']=function(_0x56fe2c,_0x26e5c1){return db[_0x0a96('0x46')]['findOne']({'where':{'id':_0x56fe2c[_0x0a96('0x60')]['id']}})[_0x0a96('0x11')](handleEntityNotFound(_0x26e5c1,null))[_0x0a96('0x11')](function(_0x2a693d){if(_0x2a693d){return _0x2a693d[_0x0a96('0x81')](null);}return null;})[_0x0a96('0x11')](respondWithStatusCode(_0x26e5c1,null))[_0x0a96('0x1b')](handleError(_0x26e5c1,null));};exports[_0x0a96('0x82')]=function(_0x4ecbce,_0x3e28f8){return db['MailAccount'][_0x0a96('0x6d')]({'where':{'id':_0x4ecbce['params']['id']}})[_0x0a96('0x11')](handleEntityNotFound(_0x3e28f8,null))[_0x0a96('0x11')](function(_0x47819b){if(_0x47819b){return _0x47819b[_0x0a96('0x82')]();}return null;})['then'](respondWithResult(_0x3e28f8,null))[_0x0a96('0x1b')](handleError(_0x3e28f8,null));};exports[_0x0a96('0x83')]=function(_0x158e58,_0x30a8e9){if(_0x158e58[_0x0a96('0x63')]['id']){delete _0x158e58['body']['id'];}return db[_0x0a96('0x46')][_0x0a96('0x66')]({'where':{'id':_0x158e58[_0x0a96('0x60')]['id']}})[_0x0a96('0x11')](handleEntityNotFound(_0x30a8e9,null))[_0x0a96('0x11')](function(_0x2c0707){if(_0x2c0707){_0x158e58[_0x0a96('0x63')][_0x0a96('0x6b')]=_0x2c0707['id'];return db[_0x0a96('0x68')]['create'](_0x158e58[_0x0a96('0x63')]);}})[_0x0a96('0x11')](respondWithResult(_0x30a8e9,null))[_0x0a96('0x1b')](handleError(_0x30a8e9,null));};exports[_0x0a96('0x84')]=function(_0x2160d1,_0x4e43f6){return db[_0x0a96('0x46')]['findOne']({'where':{'id':_0x2160d1[_0x0a96('0x60')]['id']}})[_0x0a96('0x11')](handleEntityNotFound(_0x4e43f6,null))[_0x0a96('0x11')](function(_0x36f2c9){if(_0x36f2c9){return _0x36f2c9['setSmtp'](null);}return null;})[_0x0a96('0x11')](respondWithStatusCode(_0x4e43f6,null))[_0x0a96('0x1b')](handleError(_0x4e43f6,null));};exports[_0x0a96('0x85')]=function(_0x446963,_0x1b5f36){return db[_0x0a96('0x86')][_0x0a96('0x66')]({'where':{'id':_0x446963[_0x0a96('0x60')]['id']}})[_0x0a96('0x11')](handleEntityNotFound(_0x1b5f36,null))[_0x0a96('0x11')](function(_0x33f068){if(_0x33f068){return _0x33f068['addInteraction'](_0x446963['body']['ids'],_[_0x0a96('0x87')](_0x446963[_0x0a96('0x63')],['ids','id'])||{});}})['then'](respondWithResult(_0x1b5f36,null))['catch'](handleError(_0x1b5f36,null));};exports[_0x0a96('0x88')]=function(_0x2dbac2,_0x2775c3){var _0x189e53={'raw':![],'where':{}};var _0x59cb25={};var _0x543459={'count':0x0,'rows':[]};return db[_0x0a96('0x46')][_0x0a96('0x6d')]({'where':{'id':_0x2dbac2[_0x0a96('0x60')]['id']}})[_0x0a96('0x11')](handleEntityNotFound(_0x2775c3,null))[_0x0a96('0x11')](function(_0x49eb0d){if(_0x49eb0d){_0x59cb25[_0x0a96('0x4b')]=_[_0x0a96('0x4d')](db[_0x0a96('0x86')][_0x0a96('0x47')]);_0x59cb25['query']=_[_0x0a96('0x4d')](_0x2dbac2[_0x0a96('0x4e')]);_0x59cb25['filters']=_[_0x0a96('0x4f')](_0x59cb25[_0x0a96('0x4b')],_0x59cb25['query']);_0x189e53[_0x0a96('0x50')]=_['intersection'](_0x59cb25[_0x0a96('0x4b')],qs['fields'](_0x2dbac2[_0x0a96('0x4e')]['fields']));_0x189e53[_0x0a96('0x50')]=_0x189e53['attributes'][_0x0a96('0x52')]?_0x189e53[_0x0a96('0x50')]:_0x59cb25[_0x0a96('0x4b')];if(!_0x2dbac2['query']['hasOwnProperty'](_0x0a96('0x6e'))){_0x189e53['limit']=qs[_0x0a96('0x21')](_0x2dbac2[_0x0a96('0x4e')][_0x0a96('0x21')]);_0x189e53['offset']=qs[_0x0a96('0x20')](_0x2dbac2[_0x0a96('0x4e')][_0x0a96('0x20')]);}_0x189e53[_0x0a96('0x6f')]=qs[_0x0a96('0x54')](_0x2dbac2['query'][_0x0a96('0x54')]);_0x189e53['where']=qs[_0x0a96('0x61')](_[_0x0a96('0x55')](_0x2dbac2[_0x0a96('0x4e')],_0x59cb25[_0x0a96('0x61')]));_0x189e53[_0x0a96('0x56')][_0x0a96('0x6b')]=_0x49eb0d['id'];if(_0x2dbac2[_0x0a96('0x4e')]['filter']){_0x189e53['where']=_[_0x0a96('0x57')](_0x189e53[_0x0a96('0x56')],{'$or':_[_0x0a96('0x4c')](_0x189e53[_0x0a96('0x50')],function(_0x2c8b8a){var _0x1310b5={};_0x1310b5[_0x2c8b8a]={'$like':'%'+_0x2dbac2[_0x0a96('0x4e')][_0x0a96('0x59')]+'%'};return _0x1310b5;})});}_0x189e53=_['merge']({},_0x189e53,_0x2dbac2[_0x0a96('0x62')]);return db[_0x0a96('0x86')]['count']({'where':_0x189e53[_0x0a96('0x56')]})['then'](function(_0x556c03){_0x543459[_0x0a96('0x5a')]=_0x556c03;if(_0x2dbac2[_0x0a96('0x4e')][_0x0a96('0x5b')]){_0x189e53['include']=[{'model':db[_0x0a96('0x89')],'as':'Contact','required':![]},{'model':db['User'],'as':_0x0a96('0x8a'),'attributes':[_0x0a96('0x2a'),_0x0a96('0x8b'),_0x0a96('0x8c')],'required':![]},{'model':db[_0x0a96('0x8d')],'as':'Tags','attributes':['id',_0x0a96('0x2a'),_0x0a96('0x8e')],'where':_0x2dbac2[_0x0a96('0x4e')][_0x0a96('0x8f')]?{'id':_0x2dbac2[_0x0a96('0x4e')]['tag']}:undefined,'required':_0x2dbac2[_0x0a96('0x4e')][_0x0a96('0x8f')]?!![]:![]}];}return db[_0x0a96('0x86')][_0x0a96('0x5d')](_0x189e53);})[_0x0a96('0x11')](function(_0xd96761){_0x543459[_0x0a96('0x5e')]=_0xd96761;return _0x543459;});}})[_0x0a96('0x11')](respondWithFilteredResult(_0x2775c3,_0x189e53))[_0x0a96('0x1b')](handleError(_0x2775c3,null));};exports[_0x0a96('0x90')]=function addApplications(_0x3e8fbd,_0x4e219a){var _0x4b2bf1=_0x3e8fbd[_0x0a96('0x60')]['id'];var _0x2ca880=_0x3e8fbd[_0x0a96('0x63')];var _0xca14b8=0xc8;var _0x30196b=null;return db[_0x0a96('0x91')][_0x0a96('0x92')]({'isolationLevel':db['sequelize']['Transaction'][_0x0a96('0x93')][_0x0a96('0x94')]},function(_0x47bf07){return db[_0x0a96('0x46')][_0x0a96('0x6d')]({'where':{'id':_0x4b2bf1},'transaction':_0x47bf07})[_0x0a96('0x11')](function(_0x18444c){if(_0x18444c){return db[_0x0a96('0x95')][_0x0a96('0x25')]({'where':{'MailAccountId':_0x4b2bf1},'transaction':_0x47bf07})[_0x0a96('0x11')](function(){var _0x1eb5b9=_[_0x0a96('0x4c')](_0x2ca880,function(_0x2dff4d){_0x2dff4d[_0x0a96('0x6b')]=_0x4b2bf1;return _0x2dff4d;});return db['MailApplication'][_0x0a96('0x96')](_0x1eb5b9,{'transaction':_0x47bf07});});}else{_0xca14b8=0x194;_0x30196b=[];}});})['then'](function(){if(_0xca14b8!==0x194){return db[_0x0a96('0x95')][_0x0a96('0x97')]({'where':{'MailAccountId':_0x4b2bf1},'order':_0x0a96('0x98')})['then'](function(_0x4787ee){_0x30196b=_0x4787ee;});}})['catch'](function(_0x331d04){_0xca14b8=0x1f4;logger['error'](_0x331d04[_0x0a96('0x29')]);if(_0x331d04['name']){delete _0x331d04[_0x0a96('0x2a')];}_0x30196b=_0x331d04;})[_0x0a96('0x99')](function(){if(_0x30196b===null){_0x4e219a[_0x0a96('0x1c')](_0xca14b8);}else{if(_0xca14b8===0x1f4){_0x4e219a[_0x0a96('0x1e')](_0xca14b8)[_0x0a96('0x9a')](_0x30196b);}else{_0x4e219a[_0x0a96('0x1e')](_0xca14b8)['json'](_0x30196b);}}});};exports[_0x0a96('0x9b')]=function(_0x35e4be,_0x141683){var _0x3bfef7={};var _0x3d5c39={};var _0x173d7a;var _0x228112;return db['MailAccount'][_0x0a96('0x6d')]({'where':{'id':_0x35e4be[_0x0a96('0x60')]['id']}})[_0x0a96('0x11')](handleEntityNotFound(_0x141683,null))[_0x0a96('0x11')](function(_0x59425b){if(_0x59425b){_0x173d7a=_0x59425b;_0x3d5c39[_0x0a96('0x4b')]=_[_0x0a96('0x4d')](db[_0x0a96('0x95')][_0x0a96('0x47')]);_0x3d5c39[_0x0a96('0x4e')]=_['keys'](_0x35e4be['query']);_0x3d5c39[_0x0a96('0x61')]=_[_0x0a96('0x4f')](_0x3d5c39[_0x0a96('0x4b')],_0x3d5c39[_0x0a96('0x4e')]);_0x3bfef7[_0x0a96('0x50')]=_['intersection'](_0x3d5c39[_0x0a96('0x4b')],qs['fields'](_0x35e4be[_0x0a96('0x4e')]['fields']));_0x3bfef7['attributes']=_0x3bfef7[_0x0a96('0x50')][_0x0a96('0x52')]?_0x3bfef7[_0x0a96('0x50')]:_0x3d5c39[_0x0a96('0x4b')];_0x3bfef7[_0x0a96('0x6f')]=qs[_0x0a96('0x54')](_0x35e4be[_0x0a96('0x4e')][_0x0a96('0x54')]);_0x3bfef7[_0x0a96('0x56')]=qs[_0x0a96('0x61')](_[_0x0a96('0x55')](_0x35e4be[_0x0a96('0x4e')],_0x3d5c39[_0x0a96('0x61')]));if(_0x35e4be['query'][_0x0a96('0x59')]){_0x3bfef7[_0x0a96('0x56')]=_[_0x0a96('0x57')](_0x3bfef7['where'],{'$or':_[_0x0a96('0x4c')](_0x3bfef7[_0x0a96('0x50')],function(_0x44b95e){var _0x29d927={};_0x29d927[_0x44b95e]={'$like':'%'+_0x35e4be[_0x0a96('0x4e')]['filter']+'%'};return _0x29d927;})});}_0x3bfef7=_[_0x0a96('0x57')]({},_0x3bfef7,_0x35e4be[_0x0a96('0x62')]);return _0x173d7a[_0x0a96('0x9b')](_0x3bfef7);}})[_0x0a96('0x11')](function(_0x3ab896){if(_0x3ab896){_0x228112=_0x3ab896['length'];if(!_0x35e4be[_0x0a96('0x4e')][_0x0a96('0x53')]('nolimit')){_0x3bfef7[_0x0a96('0x21')]=qs['limit'](_0x35e4be['query']['limit']);_0x3bfef7['offset']=qs[_0x0a96('0x20')](_0x35e4be[_0x0a96('0x4e')][_0x0a96('0x20')]);}return _0x173d7a[_0x0a96('0x9b')](_0x3bfef7);}})[_0x0a96('0x11')](function(_0x2312a8){if(_0x2312a8){return _0x2312a8?{'count':_0x228112,'rows':_0x2312a8}:null;}})[_0x0a96('0x11')](respondWithResult(_0x141683,null))[_0x0a96('0x1b')](handleError(_0x141683,null));};exports[_0x0a96('0x9c')]=function(_0x204ba6,_0x22de73){var _0xdb9246={'raw':!![],'where':{}};var _0x2c00ed={};var _0x22c237={'count':0x0,'rows':[]};return db[_0x0a96('0x46')]['findOne']({'where':{'id':_0x204ba6['params']['id']}})[_0x0a96('0x11')](handleEntityNotFound(_0x22de73,null))['then'](function(_0x4eb93b){if(_0x4eb93b){_0x2c00ed['model']=_[_0x0a96('0x4d')](db[_0x0a96('0x9d')][_0x0a96('0x47')]);_0x2c00ed['query']=_[_0x0a96('0x4d')](_0x204ba6[_0x0a96('0x4e')]);_0x2c00ed[_0x0a96('0x61')]=_[_0x0a96('0x4f')](_0x2c00ed[_0x0a96('0x4b')],_0x2c00ed['query']);_0xdb9246['attributes']=_[_0x0a96('0x4f')](_0x2c00ed[_0x0a96('0x4b')],qs['fields'](_0x204ba6[_0x0a96('0x4e')]['fields']));_0xdb9246[_0x0a96('0x50')]=_0xdb9246[_0x0a96('0x50')][_0x0a96('0x52')]?_0xdb9246[_0x0a96('0x50')]:_0x2c00ed[_0x0a96('0x4b')];if(!_0x204ba6[_0x0a96('0x4e')][_0x0a96('0x53')](_0x0a96('0x6e'))){_0xdb9246[_0x0a96('0x21')]=qs[_0x0a96('0x21')](_0x204ba6[_0x0a96('0x4e')][_0x0a96('0x21')]);_0xdb9246[_0x0a96('0x20')]=qs['offset'](_0x204ba6['query'][_0x0a96('0x20')]);}_0xdb9246[_0x0a96('0x6f')]=qs['sort'](_0x204ba6[_0x0a96('0x4e')][_0x0a96('0x54')]);_0xdb9246['where']=qs[_0x0a96('0x61')](_[_0x0a96('0x55')](_0x204ba6[_0x0a96('0x4e')],_0x2c00ed[_0x0a96('0x61')]));_0xdb9246['where'][_0x0a96('0x6b')]=_0x4eb93b['id'];if(_0x204ba6[_0x0a96('0x4e')][_0x0a96('0x59')]){_0xdb9246[_0x0a96('0x56')]=_[_0x0a96('0x57')](_0xdb9246[_0x0a96('0x56')],{'$or':_[_0x0a96('0x4c')](_0xdb9246[_0x0a96('0x50')],function(_0x3bf62d){var _0x5778c1={};_0x5778c1[_0x3bf62d]={'$like':'%'+_0x204ba6[_0x0a96('0x4e')]['filter']+'%'};return _0x5778c1;})});}if(_0x204ba6[_0x0a96('0x4e')][_0x0a96('0x9e')]){var _0xe27bb3=_0x204ba6['query'][_0x0a96('0x9e')][_0x0a96('0x9f')](',');var _0x558d2a={};_0x558d2a[_0xe27bb3[0x0]]={'$gte':moment(_0xe27bb3[0x1])['format'](_0x0a96('0xa0'))};_0xdb9246[_0x0a96('0x56')]=_[_0x0a96('0x57')](_0xdb9246[_0x0a96('0x56')],_0x558d2a);}_0xdb9246=_[_0x0a96('0x57')]({},_0xdb9246,_0x204ba6[_0x0a96('0x62')]);return db['MailMessage']['count']({'where':_0xdb9246[_0x0a96('0x56')]})[_0x0a96('0x11')](function(_0x97551e){_0x22c237['count']=_0x97551e;if(_0x204ba6[_0x0a96('0x4e')]['includeAll']){_0xdb9246[_0x0a96('0x5c')]=[{'all':!![]}];}return db[_0x0a96('0x9d')][_0x0a96('0x5d')](_0xdb9246);})['then'](function(_0x466433){if(_0x204ba6[_0x0a96('0x4e')]['inlineCss']===_0x0a96('0xa1')){for(var _0x437f70=0x0;_0x437f70<_0x466433['length'];_0x437f70++){_0x466433[_0x437f70]['body']=juice(_0x466433[_0x437f70][_0x0a96('0x63')]);}}_0x22c237[_0x0a96('0x5e')]=_0x466433;return _0x22c237;});}})['then'](respondWithFilteredResult(_0x22de73,_0xdb9246))[_0x0a96('0x1b')](handleError(_0x22de73,null));};exports[_0x0a96('0x9a')]=function(_0x27c5e5,_0x4a2c56){var _0x49f2a4,_0x1fb242={},_0x360078;if(_0x27c5e5[_0x0a96('0x63')]['to']){_0x360078=_0x27c5e5[_0x0a96('0x63')]['to']['split'](',')[0x0];}return db[_0x0a96('0x46')][_0x0a96('0x66')]({'where':{'id':_0x27c5e5[_0x0a96('0x60')]['id']},'include':[{'model':db['CmList'],'as':_0x0a96('0xa2'),'include':[{'model':db[_0x0a96('0x89')],'as':_0x0a96('0xa3'),'where':{'email':_0x360078},'limit':0x1,'order':[[_0x0a96('0xa4'),_0x0a96('0xa5')]]}]},{'model':db[_0x0a96('0x68')],'as':'Smtp','raw':!![],'include':[{'model':db[_0x0a96('0xa6')],'as':'CloudProvider','raw':!![]}]}]})['then'](handleEntityNotFound(_0x4a2c56,null))[_0x0a96('0x11')](function(_0x148954){if(!_0x148954)return;_0x49f2a4=_0x148954;if(!_0x148954[_0x0a96('0x42')])throw new Error(_0x0a96('0xa7'));if(_[_0x0a96('0x78')](_0x27c5e5['body'][_0x0a96('0xa8')])){_0x27c5e5[_0x0a96('0x63')]['from']=util[_0x0a96('0xa9')](_0x0a96('0xaa'),_0x148954[_0x0a96('0x2a')],_0x148954[_0x0a96('0x76')]||_0x148954[_0x0a96('0x42')][_0x0a96('0x36')]);}if(_0x27c5e5[_0x0a96('0x63')][_0x0a96('0xab')]&&_0x27c5e5[_0x0a96('0x63')][_0x0a96('0xab')][_0x0a96('0x52')]){for(var _0x93c91d=0x0;_0x93c91d<_0x27c5e5[_0x0a96('0x63')]['attachments'][_0x0a96('0x52')];_0x93c91d+=0x1){_0x27c5e5['body'][_0x0a96('0xab')][_0x93c91d]={'filename':_0x27c5e5[_0x0a96('0x63')][_0x0a96('0xab')][_0x93c91d][_0x0a96('0x2a')],'path':path[_0x0a96('0xac')](config[_0x0a96('0xad')],'server/files/attachments',_0x27c5e5[_0x0a96('0x63')][_0x0a96('0xab')][_0x93c91d][_0x0a96('0xae')])};}}var _0x35cdd1=_0x148954[_0x0a96('0xaf')]();return respondWithRpcPromise('SendMail',_0x0a96('0xb0'),{'account':_0x35cdd1,'message':_0x27c5e5[_0x0a96('0x63')]});})['then'](function(_0x1106b1){if(!_0x1106b1)return;_0x1fb242=_0x1106b1;if(!_0x49f2a4[_0x0a96('0xa2')])throw new Error(_0x0a96('0xb1'));if(_0x49f2a4[_0x0a96('0xa2')]['Contacts'][_0x0a96('0x52')])return _0x49f2a4[_0x0a96('0xa2')][_0x0a96('0xa3')][0x0];return db[_0x0a96('0x89')]['create'](_[_0x0a96('0x9')](_0x27c5e5['body'],{'firstName':_0x27c5e5[_0x0a96('0x63')]['to'],'email':_0x27c5e5[_0x0a96('0x63')]['to'],'phone':_0x27c5e5[_0x0a96('0x63')]['to'],'ListId':_0x49f2a4['ListId']}));})[_0x0a96('0x11')](function(_0x3f6d2a){if(!_0x3f6d2a)return;var _0x110664={'UserId':_0x27c5e5[_0x0a96('0x36')]['id'],'ContactId':_0x3f6d2a['id'],'MailAccountId':_0x49f2a4['id'],'inReplyTo':_0x1fb242[_0x0a96('0xb2')],'to':_0x27c5e5[_0x0a96('0x63')][_0x0a96('0xa8')],'cc':_0x27c5e5[_0x0a96('0x63')]['cc'],'subject':_0x27c5e5['body'][_0x0a96('0xb3')],'attach':_0x27c5e5[_0x0a96('0x63')][_0x0a96('0xb4')],'firstMsgDirection':_0x0a96('0xb5'),'lastMsgAt':moment()[_0x0a96('0xa9')](_0x0a96('0xa0')),'lastMsgDirection':_0x0a96('0xb5'),'Messages':[_[_0x0a96('0x57')](_0x27c5e5[_0x0a96('0x63')],{'messageId':_0x1fb242['messageId'],'sentAt':moment()['format'](_0x0a96('0xa0')),'read':!![],'MailAccountId':_0x49f2a4['id'],'UserId':_0x27c5e5[_0x0a96('0x36')]['id'],'ContactId':_0x3f6d2a['id']})]};if(_0x27c5e5['body'][_0x0a96('0xb6')]){_0x110664=_[_0x0a96('0x57')](_0x110664,_0x27c5e5[_0x0a96('0x63')]['Interaction']);}return db[_0x0a96('0x86')][_0x0a96('0x73')](_0x110664,{'include':[{'model':db[_0x0a96('0x9d')],'as':'Messages'}]});})[_0x0a96('0x11')](respondWithResult(_0x4a2c56,null))[_0x0a96('0x1b')](handleError(_0x4a2c56,null));};exports['verifySmtp']=function(_0x169d67,_0xdfdd3c){return db[_0x0a96('0x46')][_0x0a96('0x66')]({'where':{'id':_0x169d67[_0x0a96('0x60')]['id']},'include':[{'model':db[_0x0a96('0x68')],'as':'Smtp','raw':!![],'include':[{'model':db[_0x0a96('0xa6')],'as':'CloudProvider','raw':!![]}]}]})[_0x0a96('0x11')](handleEntityNotFound(_0xdfdd3c,null))[_0x0a96('0x11')](function(_0x220b97){if(!_0x220b97[_0x0a96('0x42')])return;var _0x9b81f6=_0x220b97['getSmtpOptions']();return respondWithRpcPromise('VerifySmtp','verifySmtp',{'account':_0x9b81f6});})[_0x0a96('0x11')](respondWithResult(_0xdfdd3c,null))[_0x0a96('0x1b')](handleError(_0xdfdd3c,null));};exports[_0x0a96('0x25')]=function(_0x41ec87,_0x17b030){return db[_0x0a96('0x46')]['find']({'where':{'id':_0x41ec87['params']['id']}})[_0x0a96('0x11')](handleEntityNotFound(_0x17b030,null))['then'](function(_0x3b14ba){if(_0x3b14ba&&_0x3b14ba['service']){throw new db['Sequelize']['ValidationError'](_0x0a96('0xb7'));}return _0x3b14ba;})[_0x0a96('0x11')](removeEntity(_0x17b030,null))[_0x0a96('0x1b')](handleError(_0x17b030,null));};exports[_0x0a96('0xb8')]=function(_0xf64682,_0x4304fe){return db[_0x0a96('0x46')]['find']({'where':{'id':_0xf64682[_0x0a96('0x60')]['id']}})['then'](handleEntityNotFound(_0x4304fe,null))[_0x0a96('0x11')](function(_0x38c005){if(_0x38c005){return _0x38c005['addAgents'](_0xf64682['body'][_0x0a96('0x75')],_[_0x0a96('0x87')](_0xf64682[_0x0a96('0x63')],[_0x0a96('0x75'),'id'])||{})[_0x0a96('0xb9')](function(_0x43901b){for(var _0x43e7d9=0x0;_0x43e7d9<_0xf64682[_0x0a96('0x63')][_0x0a96('0x75')][_0x0a96('0x52')];_0x43e7d9+=0x1){socket[_0x0a96('0xba')](_0x0a96('0xbb'),{'UserId':Number(_0xf64682[_0x0a96('0x63')][_0x0a96('0x75')][_0x43e7d9]),'MailAccountId':Number(_0xf64682[_0x0a96('0x60')]['id'])});}return _0x43901b;});}})['then'](respondWithResult(_0x4304fe,null))[_0x0a96('0x1b')](handleError(_0x4304fe,null));};exports[_0x0a96('0xbc')]=function(_0xcb6982,_0x3516b3){return db['MailAccount'][_0x0a96('0x66')]({'where':{'id':_0xcb6982[_0x0a96('0x60')]['id']}})[_0x0a96('0x11')](handleEntityNotFound(_0x3516b3,null))[_0x0a96('0x11')](function(_0x2c523d){if(_0x2c523d){return _0x2c523d[_0x0a96('0xbc')](_0xcb6982[_0x0a96('0x4e')][_0x0a96('0x75')])[_0x0a96('0x11')](function(){if(_[_0x0a96('0xbd')](_0xcb6982[_0x0a96('0x4e')][_0x0a96('0x75')])){for(var _0xfc1d40=0x0;_0xfc1d40<_0xcb6982[_0x0a96('0x4e')][_0x0a96('0x75')][_0x0a96('0x52')];_0xfc1d40+=0x1){socket[_0x0a96('0xba')]('userMailAccount:remove',{'UserId':Number(_0xcb6982[_0x0a96('0x4e')][_0x0a96('0x75')][_0xfc1d40]),'MailAccountId':Number(_0xcb6982['params']['id'])});}}else{socket[_0x0a96('0xba')](_0x0a96('0xbe'),{'UserId':Number(_0xcb6982[_0x0a96('0x4e')][_0x0a96('0x75')]),'MailAccountId':Number(_0xcb6982[_0x0a96('0x60')]['id'])});}});}})[_0x0a96('0x11')](respondWithStatusCode(_0x3516b3,null))[_0x0a96('0x1b')](handleError(_0x3516b3,null));};exports['getAgents']=function(_0xd96c82,_0x57014b){var _0x30d9be={};var _0x4088fa={};var _0x1b8972;var _0x3b758b;return db['MailAccount']['findOne']({'where':{'id':_0xd96c82[_0x0a96('0x60')]['id']}})['then'](handleEntityNotFound(_0x57014b,null))[_0x0a96('0x11')](function(_0x357e81){if(_0x357e81){_0x1b8972=_0x357e81;_0x4088fa[_0x0a96('0x4b')]=_[_0x0a96('0x4d')](db[_0x0a96('0xbf')][_0x0a96('0x47')]);_0x4088fa[_0x0a96('0x4e')]=_['keys'](_0xd96c82[_0x0a96('0x4e')]);_0x4088fa['filters']=_['intersection'](_0x4088fa[_0x0a96('0x4b')],_0x4088fa[_0x0a96('0x4e')]);_0x30d9be[_0x0a96('0x50')]=_[_0x0a96('0x4f')](_0x4088fa[_0x0a96('0x4b')],qs['fields'](_0xd96c82[_0x0a96('0x4e')][_0x0a96('0x51')]));_0x30d9be['attributes']=_0x30d9be[_0x0a96('0x50')][_0x0a96('0x52')]?_0x30d9be[_0x0a96('0x50')]:_0x4088fa[_0x0a96('0x4b')];_0x30d9be[_0x0a96('0x6f')]=qs[_0x0a96('0x54')](_0xd96c82[_0x0a96('0x4e')][_0x0a96('0x54')]);_0x30d9be[_0x0a96('0x56')]=qs[_0x0a96('0x61')](_[_0x0a96('0x55')](_0xd96c82['query'],_0x4088fa['filters']));if(_0xd96c82[_0x0a96('0x4e')]['filter']){_0x30d9be[_0x0a96('0x56')]=_[_0x0a96('0x57')](_0x30d9be[_0x0a96('0x56')],{'$or':_[_0x0a96('0x4c')](_0x30d9be[_0x0a96('0x50')],function(_0x23efe5){var _0x9e7131={};_0x9e7131[_0x23efe5]={'$like':'%'+_0xd96c82[_0x0a96('0x4e')][_0x0a96('0x59')]+'%'};return _0x9e7131;})});}_0x30d9be=_['merge']({},_0x30d9be,_0xd96c82['options']);return _0x1b8972['getAgents'](_0x30d9be);}})[_0x0a96('0x11')](function(_0x76ad03){if(_0x76ad03){_0x3b758b=_0x76ad03[_0x0a96('0x52')];if(!_0xd96c82[_0x0a96('0x4e')][_0x0a96('0x53')](_0x0a96('0x6e'))){_0x30d9be[_0x0a96('0x21')]=qs[_0x0a96('0x21')](_0xd96c82['query'][_0x0a96('0x21')]);_0x30d9be['offset']=qs[_0x0a96('0x20')](_0xd96c82[_0x0a96('0x4e')][_0x0a96('0x20')]);}return _0x1b8972[_0x0a96('0xc0')](_0x30d9be);}})[_0x0a96('0x11')](function(_0x169a3f){if(_0x169a3f){return _0x169a3f?{'count':_0x3b758b,'rows':_0x169a3f}:null;}})[_0x0a96('0x11')](respondWithResult(_0x57014b,null))[_0x0a96('0x1b')](handleError(_0x57014b,null));}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.events.js b/server/api/mailAccount/mailAccount.events.js index 3bc6a7d..ddd37bb 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 _0x3e4d=['MailAccount','remove','hasOwnProperty','hook','exports','events'];(function(_0x31c693,_0x1c8ebb){var _0x59af52=function(_0x2167d8){while(--_0x2167d8){_0x31c693['push'](_0x31c693['shift']());}};_0x59af52(++_0x1c8ebb);}(_0x3e4d,0x16d));var _0xd3e4=function(_0x4c44fd,_0x290876){_0x4c44fd=_0x4c44fd-0x0;var _0x315093=_0x3e4d[_0x4c44fd];return _0x315093;};'use strict';var EventEmitter=require(_0xd3e4('0x0'));var MailAccount=require('../../mysqldb')['db'][_0xd3e4('0x1')];var MailAccountEvents=new EventEmitter();MailAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xd3e4('0x2')};function emitEvent(_0x177ec7){return function(_0x2c7be8,_0x5ea48b,_0xc5abea){MailAccountEvents['emit'](_0x177ec7+':'+_0x2c7be8['id'],_0x2c7be8);MailAccountEvents['emit'](_0x177ec7,_0x2c7be8);_0xc5abea(null);};}for(var e in events){if(events[_0xd3e4('0x3')](e)){var event=events[e];MailAccount[_0xd3e4('0x4')](e,emitEvent(event));}}module[_0xd3e4('0x5')]=MailAccountEvents; \ No newline at end of file +var _0x565e=['MailAccount','setMaxListeners','save','emit','hasOwnProperty','hook','exports','events'];(function(_0x29fd3b,_0x30f5a0){var _0x52ac68=function(_0x14a087){while(--_0x14a087){_0x29fd3b['push'](_0x29fd3b['shift']());}};_0x52ac68(++_0x30f5a0);}(_0x565e,0x7f));var _0xe565=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x565e[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0xe565('0x0'));var MailAccount=require('../../mysqldb')['db'][_0xe565('0x1')];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0xe565('0x2')](0x0);var events={'afterCreate':_0xe565('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x42e589){return function(_0x33fd83,_0x14f472,_0x1b6e64){MailAccountEvents[_0xe565('0x4')](_0x42e589+':'+_0x33fd83['id'],_0x33fd83);MailAccountEvents[_0xe565('0x4')](_0x42e589,_0x33fd83);_0x1b6e64(null);};}for(var e in events){if(events[_0xe565('0x5')](e)){var event=events[e];MailAccount[_0xe565('0x6')](e,emitEvent(event));}}module[_0xe565('0x7')]=MailAccountEvents; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.model.js b/server/api/mailAccount/mailAccount.model.js index 4a14334..4fc1227 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 _0x93ec=['mail_accounts','custom','service','provider','host','Smtp','port','secure','CloudProvider','Cloud\x20Provider\x20configuration\x20not\x20found','auth','OAuth2','pass','exports'];(function(_0x5d7d38,_0x46af18){var _0x39b884=function(_0x399caf){while(--_0x399caf){_0x5d7d38['push'](_0x5d7d38['shift']());}};_0x39b884(++_0x46af18);}(_0x93ec,0xfb));var _0xc93e=function(_0x9234eb,_0x114d75){_0x9234eb=_0x9234eb-0x0;var _0x214240=_0x93ec[_0x9234eb];return _0x214240;};'use strict';var attributes=require('./mailAccount.attributes');module[_0xc93e('0x0')]=function(_0x4d5b8f){return _0x4d5b8f['define']('MailAccount',attributes,{'tableName':_0xc93e('0x1'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getSmtpOptions':function(){var _0x193ada=this;var _0x3a4a5e={'id':_0x193ada['id'],'tls':{'rejectUnauthorized':![]}};if(_0x193ada['provider']!==_0xc93e('0x2')){_0x3a4a5e[_0xc93e('0x3')]=_0x193ada[_0xc93e('0x4')];}else{_0x3a4a5e[_0xc93e('0x5')]=_0x193ada[_0xc93e('0x6')][_0xc93e('0x5')];_0x3a4a5e['port']=_0x193ada[_0xc93e('0x6')][_0xc93e('0x7')];_0x3a4a5e[_0xc93e('0x8')]=_0x193ada[_0xc93e('0x6')]['secure'];}if(_0x193ada[_0xc93e('0x6')]['authentication']){if(_0x193ada['Smtp']['modernAuthentication']){if(!_0x193ada[_0xc93e('0x6')][_0xc93e('0x9')])throw new Error(_0xc93e('0xa'));_0x3a4a5e[_0xc93e('0xb')]={'type':_0xc93e('0xc'),'user':_0x193ada[_0xc93e('0x6')]['user'],'accessToken':_0x193ada[_0xc93e('0x6')][_0xc93e('0x9')]['data5']};}else{_0x3a4a5e[_0xc93e('0xb')]={'user':_0x193ada[_0xc93e('0x6')]['user'],'pass':_0x193ada[_0xc93e('0x6')][_0xc93e('0xd')]};}}return _0x3a4a5e;}}});}; \ No newline at end of file +var _0x5792=['mail_accounts','custom','service','provider','Smtp','host','port','secure','authentication','modernAuthentication','CloudProvider','Cloud\x20Provider\x20configuration\x20not\x20found','auth','OAuth2','user','data5','pass','./mailAccount.attributes','define','MailAccount'];(function(_0x4499f4,_0x17853b){var _0x2cf531=function(_0x323266){while(--_0x323266){_0x4499f4['push'](_0x4499f4['shift']());}};_0x2cf531(++_0x17853b);}(_0x5792,0xed));var _0x2579=function(_0x25c9c6,_0x3eda23){_0x25c9c6=_0x25c9c6-0x0;var _0x520218=_0x5792[_0x25c9c6];return _0x520218;};'use strict';var attributes=require(_0x2579('0x0'));module['exports']=function(_0x12b100){return _0x12b100[_0x2579('0x1')](_0x2579('0x2'),attributes,{'tableName':_0x2579('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getSmtpOptions':function(){var _0x422aa0=this;var _0xb37eb5={'id':_0x422aa0['id'],'tls':{'rejectUnauthorized':![]}};if(_0x422aa0['provider']!==_0x2579('0x4')){_0xb37eb5[_0x2579('0x5')]=_0x422aa0[_0x2579('0x6')];}else{_0xb37eb5['host']=_0x422aa0[_0x2579('0x7')][_0x2579('0x8')];_0xb37eb5[_0x2579('0x9')]=_0x422aa0[_0x2579('0x7')][_0x2579('0x9')];_0xb37eb5[_0x2579('0xa')]=_0x422aa0['Smtp'][_0x2579('0xa')];}if(_0x422aa0[_0x2579('0x7')][_0x2579('0xb')]){if(_0x422aa0[_0x2579('0x7')][_0x2579('0xc')]){if(!_0x422aa0[_0x2579('0x7')][_0x2579('0xd')])throw new Error(_0x2579('0xe'));_0xb37eb5[_0x2579('0xf')]={'type':_0x2579('0x10'),'user':_0x422aa0[_0x2579('0x7')][_0x2579('0x11')],'accessToken':_0x422aa0[_0x2579('0x7')][_0x2579('0xd')][_0x2579('0x12')]};}else{_0xb37eb5['auth']={'user':_0x422aa0[_0x2579('0x7')][_0x2579('0x11')],'pass':_0x422aa0[_0x2579('0x7')][_0x2579('0x13')]};}}return _0xb37eb5;}}});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.rpc.js b/server/api/mailAccount/mailAccount.rpc.js index 34db8a0..381f59c 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 _0x31af=['rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','./mailAccount.socket','register','request','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','GetMailAccount','MailAccount','options','attributes','limit','include','model','map','ShowMailAccount','find','raw','where','smtp','smtpOptions','getSmtpOptions','NotifyMailAccount','body','mail','difference','CmContact','rawAttributes','createdAt','updatedAt','ListId','isNil','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','CmList','List','Contacts','DESC','Applications','MailServerOut','Smtp','CloudProvider','get','omit','account','applications','list','orderBy','priority','asc','push','length','close','autoclose','*,*,*,*','create','contact','messageId','subject','attach','format','YYYY-MM-DD\x20HH:mm:ss','MailInteraction','Messages','inReplyTo','Contact\x20not\x20found','spread','update','interaction','created','MailMessage','attachments','originTo','originCc','bcc','ChatWebsiteId','Email','ChatOfflineMessageId','Attachment','Attachments','UserId','User','unshift','agent','name','waitForTheAssignedAgent','queueId','MailQueue','queue','Start','startRouting','lodash','moment','bluebird','../../mysqldb'];(function(_0x36d279,_0x4425cb){var _0x57faa0=function(_0x1bb0c5){while(--_0x1bb0c5){_0x36d279['push'](_0x36d279['shift']());}};_0x57faa0(++_0x4425cb);}(_0x31af,0xde));var _0xf31a=function(_0x266ca4,_0x152c86){_0x266ca4=_0x266ca4-0x0;var _0x21a03a=_0x31af[_0x266ca4];return _0x21a03a;};'use strict';var _=require(_0xf31a('0x0'));var moment=require(_0xf31a('0x1'));var BPromise=require(_0xf31a('0x2'));var rs=require('randomstring');var Redis=require('ioredis');var db=require(_0xf31a('0x3'))['db'];var logger=require('../../config/logger')(_0xf31a('0x4'));var config=require(_0xf31a('0x5'));var jayson=require(_0xf31a('0x6'));var client=jayson[_0xf31a('0x7')]['http']({'port':0x232c});config[_0xf31a('0x8')]=_[_0xf31a('0x9')](config[_0xf31a('0x8')],{'host':_0xf31a('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf31a('0x8')]));require(_0xf31a('0xb'))[_0xf31a('0xc')](socket);function respondWithRpcPromise(_0xee6b4a,_0x48cc46,_0x1c56e9){return new BPromise(function(_0x138d52,_0xcff55c){return client[_0xf31a('0xd')](_0xee6b4a,_0x1c56e9)[_0xf31a('0xe')](function(_0x5165aa){logger[_0xf31a('0xf')](_0xf31a('0x10'),_0x48cc46,_0xf31a('0x11'));logger[_0xf31a('0x12')]('MailAccount,\x20%s,\x20%s,\x20%s',_0x48cc46,_0xf31a('0x11'),JSON[_0xf31a('0x13')](_0x5165aa));if(_0x5165aa['error']){if(_0x5165aa[_0xf31a('0x14')][_0xf31a('0x15')]===0x1f4){logger[_0xf31a('0x14')](_0xf31a('0x10'),_0x48cc46,_0x5165aa[_0xf31a('0x14')][_0xf31a('0x16')]);return _0xcff55c(_0x5165aa[_0xf31a('0x14')][_0xf31a('0x16')]);}logger[_0xf31a('0x14')](_0xf31a('0x10'),_0x48cc46,_0x5165aa[_0xf31a('0x14')][_0xf31a('0x16')]);return _0x138d52(_0x5165aa[_0xf31a('0x14')][_0xf31a('0x16')]);}else{logger[_0xf31a('0xf')]('MailAccount,\x20%s,\x20%s',_0x48cc46,_0xf31a('0x11'));_0x138d52(_0x5165aa[_0xf31a('0x17')][_0xf31a('0x16')]);}})[_0xf31a('0x18')](function(_0x4c3589){logger[_0xf31a('0x14')](_0xf31a('0x10'),_0x48cc46,_0x4c3589);_0xcff55c(_0x4c3589);});});}exports[_0xf31a('0x19')]=function(_0x208da3){var _0x18a97c=this;return new Promise(function(_0x516672,_0xcd2148){return db[_0xf31a('0x1a')]['findAll']({'raw':_0x208da3[_0xf31a('0x1b')]?_0x208da3[_0xf31a('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x208da3[_0xf31a('0x1b')]?_0x208da3[_0xf31a('0x1b')]['where']||null:null,'attributes':_0x208da3['options']?_0x208da3['options'][_0xf31a('0x1c')]||null:null,'limit':_0x208da3[_0xf31a('0x1b')]?_0x208da3['options'][_0xf31a('0x1d')]||null:null,'include':_0x208da3[_0xf31a('0x1b')]?_0x208da3[_0xf31a('0x1b')][_0xf31a('0x1e')]?_['map'](_0x208da3['options'][_0xf31a('0x1e')],function(_0x714292){return{'model':db[_0x714292['model']],'as':_0x714292['as'],'attributes':_0x714292['attributes'],'include':_0x714292['include']?_['map'](_0x714292[_0xf31a('0x1e')],function(_0x45df36){return{'model':db[_0x45df36[_0xf31a('0x1f')]],'as':_0x45df36['as'],'attributes':_0x45df36['attributes'],'include':_0x45df36[_0xf31a('0x1e')]?_[_0xf31a('0x20')](_0x45df36[_0xf31a('0x1e')],function(_0x2aa749){return{'model':db[_0x2aa749[_0xf31a('0x1f')]],'as':_0x2aa749['as'],'attributes':_0x2aa749['attributes']};}):[]};}):[]};}):[]:[]})[_0xf31a('0xe')](function(_0x2ebc27){logger['info']('GetMailAccount',_0x208da3);logger[_0xf31a('0x12')](_0xf31a('0x19'),_0x208da3,JSON['stringify'](_0x2ebc27));_0x516672(_0x2ebc27);})[_0xf31a('0x18')](function(_0x221048){logger[_0xf31a('0x14')]('GetMailAccount',_0x221048[_0xf31a('0x16')],_0x208da3);_0xcd2148(_0x18a97c[_0xf31a('0x14')](0x1f4,_0x221048[_0xf31a('0x16')]));});});};exports[_0xf31a('0x21')]=function(_0xbddc3b){var _0x19807c=this;return new Promise(function(_0x53ffb6,_0xcdf92){return db[_0xf31a('0x1a')][_0xf31a('0x22')]({'raw':_0xbddc3b[_0xf31a('0x1b')]?_0xbddc3b[_0xf31a('0x1b')][_0xf31a('0x23')]===undefined?!![]:![]:!![],'where':_0xbddc3b[_0xf31a('0x1b')]?_0xbddc3b[_0xf31a('0x1b')][_0xf31a('0x24')]||null:null,'attributes':_0xbddc3b[_0xf31a('0x1b')]?_0xbddc3b[_0xf31a('0x1b')][_0xf31a('0x1c')]||null:null,'include':_0xbddc3b[_0xf31a('0x1b')]?_0xbddc3b[_0xf31a('0x1b')][_0xf31a('0x1e')]?_[_0xf31a('0x20')](_0xbddc3b[_0xf31a('0x1b')][_0xf31a('0x1e')],function(_0x1d4807){return{'model':db[_0x1d4807['model']],'as':_0x1d4807['as'],'attributes':_0x1d4807[_0xf31a('0x1c')],'include':_0x1d4807[_0xf31a('0x1e')]?_[_0xf31a('0x20')](_0x1d4807[_0xf31a('0x1e')],function(_0x17afb5){return{'model':db[_0x17afb5['model']],'as':_0x17afb5['as'],'attributes':_0x17afb5[_0xf31a('0x1c')],'include':_0x17afb5[_0xf31a('0x1e')]?_[_0xf31a('0x20')](_0x17afb5['include'],function(_0x474cfc){return{'model':db[_0x474cfc[_0xf31a('0x1f')]],'as':_0x474cfc['as'],'attributes':_0x474cfc[_0xf31a('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xf31a('0xe')](function(_0x11b3af){if(_0xbddc3b['options'][_0xf31a('0x25')]===!![])_0x11b3af['setDataValue'](_0xf31a('0x26'),_0x11b3af[_0xf31a('0x27')]());logger['info'](_0xf31a('0x21'),_0xbddc3b);logger[_0xf31a('0x12')](_0xf31a('0x21'),_0xbddc3b,JSON['stringify'](_0x11b3af));_0x53ffb6(_0x11b3af);})[_0xf31a('0x18')](function(_0x2010f8){logger[_0xf31a('0x14')](_0xf31a('0x21'),_0x2010f8[_0xf31a('0x16')],_0xbddc3b);_0xcdf92(_0x19807c[_0xf31a('0x14')](0x1f4,_0x2010f8[_0xf31a('0x16')]));});});};exports[_0xf31a('0x28')]=function(_0x108f71){var _0x5ae1f2=this;return new Promise(function(_0x3b4aef,_0x1d001c){var _0x4ac009={'body':_0x108f71[_0xf31a('0x29')],'channel':_0xf31a('0x2a')};var _0x1085c2=_[_0xf31a('0x2b')](_['keys'](db[_0xf31a('0x2c')][_0xf31a('0x2d')]),[_0xf31a('0x2e'),_0xf31a('0x2f'),'CompanyId',_0xf31a('0x30')]);var _0x58163c=![];if(_0x108f71[_0xf31a('0x29')]['id']){delete _0x108f71[_0xf31a('0x29')]['id'];}if(_[_0xf31a('0x31')](_0x108f71['body'][_0xf31a('0x32')])){return _0x1d001c(_0x5ae1f2['error'](0x1f4,_0xf31a('0x33')));}if(_[_0xf31a('0x31')](_0x108f71[_0xf31a('0x29')][_0xf31a('0x29')])||_0x108f71[_0xf31a('0x29')][_0xf31a('0x29')]===''){return _0x1d001c(_0x5ae1f2[_0xf31a('0x14')](0x1f4,_0xf31a('0x34')));}if(_[_0xf31a('0x31')](_0x108f71['body'][_0xf31a('0x35')])){return _0x1d001c(_0x5ae1f2[_0xf31a('0x14')](0x1f4,_0xf31a('0x36')+_0x1085c2));}if(!_[_0xf31a('0x37')](_0x1085c2,_0x108f71[_0xf31a('0x29')][_0xf31a('0x35')])){return _0x1d001c(_0x5ae1f2[_0xf31a('0x14')](0x1f4,'mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x1085c2));}var _0x4fe107={};_0x4fe107[_0x108f71[_0xf31a('0x29')][_0xf31a('0x35')]]=_0x108f71[_0xf31a('0x29')][_0xf31a('0x32')];return db[_0xf31a('0x1a')][_0xf31a('0x22')]({'where':{'id':_0x108f71['account']['id']},'include':[{'model':db[_0xf31a('0x38')],'as':_0xf31a('0x39'),'include':[{'model':db[_0xf31a('0x2c')],'as':_0xf31a('0x3a'),'where':_0x4fe107,'limit':0x1,'order':[[_0xf31a('0x2f'),_0xf31a('0x3b')]]}]},{'model':db['MailApplication'],'as':_0xf31a('0x3c')},{'model':db[_0xf31a('0x3d')],'as':_0xf31a('0x3e'),'include':[{'model':db[_0xf31a('0x3f')],'as':_0xf31a('0x3f')}]}]})[_0xf31a('0xe')](function(_0x20bd0c){if(_0x20bd0c&&_0x20bd0c[_0xf31a('0x39')]){var _0x1f8161=_0x20bd0c[_0xf31a('0x40')]({'plain':!![]});_0x4ac009['account']=_[_0xf31a('0x41')](_0x1f8161,['Applications',_0xf31a('0x39')]);_0x4ac009[_0xf31a('0x42')][_0xf31a('0x26')]=_0x20bd0c[_0xf31a('0x27')]();_0x4ac009[_0xf31a('0x43')]=_0x1f8161[_0xf31a('0x3c')];_0x4ac009[_0xf31a('0x44')]=_0x1f8161[_0xf31a('0x39')];_0x4ac009['applications']=_[_0xf31a('0x45')](_0x4ac009[_0xf31a('0x43')],[_0xf31a('0x46')],[_0xf31a('0x47')]);if(_0x4ac009[_0xf31a('0x42')]&&_0x4ac009[_0xf31a('0x42')]['autoclose']){_0x4ac009[_0xf31a('0x43')][_0xf31a('0x48')]({'id':0x0,'priority':_0x4ac009[_0xf31a('0x43')][_0xf31a('0x49')]+0x1,'app':_0xf31a('0x4a'),'appdata':_0xf31a('0x4b'),'interval':_0xf31a('0x4c')});}if(_0x4ac009[_0xf31a('0x42')][_0xf31a('0x3c')]){delete _0x4ac009[_0xf31a('0x42')][_0xf31a('0x3c')];}if(_0x4ac009[_0xf31a('0x42')]['List']){delete _0x4ac009[_0xf31a('0x42')][_0xf31a('0x39')];}if(_0x1f8161[_0xf31a('0x39')]['Contacts'][_0xf31a('0x49')]){return _0x1f8161['List'][_0xf31a('0x3a')][0x0];}var _0x1167cc=_[_0xf31a('0x9')](_0x108f71[_0xf31a('0x29')],{'firstName':_0x108f71['body'][_0xf31a('0x32')],'ListId':_0x1f8161[_0xf31a('0x30')]});_0x1167cc[_0x108f71[_0xf31a('0x29')][_0xf31a('0x35')]]=_0x108f71[_0xf31a('0x29')][_0xf31a('0x32')];return db['CmContact'][_0xf31a('0x4d')](_0x1167cc);}else{throw new Error('List\x20not\x20found');}})['then'](function(_0x5d2700){_0x4ac009[_0xf31a('0x4e')]=_0x5d2700;if(_0x5d2700){if(!_0x108f71[_0xf31a('0x29')][_0xf31a('0x16')]['messageId']){_0x108f71[_0xf31a('0x29')][_0xf31a('0x16')][_0xf31a('0x4f')]=rs['generate']()+'\x20'+_0x108f71['body'][_0xf31a('0x16')][_0xf31a('0x32')];}var _0x37c6cd={'ContactId':_0x5d2700['id'],'MailAccountId':_0x108f71[_0xf31a('0x42')]['id'],'inReplyTo':_0x108f71[_0xf31a('0x29')][_0xf31a('0x16')]['messageId'],'to':_0x108f71[_0xf31a('0x29')]['message'][_0xf31a('0x32')],'cc':_0x108f71[_0xf31a('0x29')][_0xf31a('0x16')]['cc'],'subject':_0x108f71['body'][_0xf31a('0x16')][_0xf31a('0x50')],'attach':_0x108f71[_0xf31a('0x29')][_0xf31a('0x16')][_0xf31a('0x51')],'lastMsgAt':moment()[_0xf31a('0x52')](_0xf31a('0x53')),'lastMsgDirection':'in'};return db[_0xf31a('0x54')]['find']({'where':{'closed':![],'MailAccountId':_0x108f71[_0xf31a('0x42')]['id']},'include':[{'model':db['MailMessage'],'as':_0xf31a('0x55'),'attributes':['messageId'],'where':{'messageId':_0x108f71[_0xf31a('0x29')][_0xf31a('0x16')][_0xf31a('0x56')]}}]})[_0xf31a('0xe')](function(_0x53849c){if(_0x53849c){return[_0x53849c,![]];}return db[_0xf31a('0x54')][_0xf31a('0x4d')](_0x37c6cd)[_0xf31a('0xe')](function(_0x16a215){return[_0x16a215,!![]];});});}else{throw new Error(_0xf31a('0x57'));}})[_0xf31a('0x58')](function(_0x360ff0,_0x4167b0){if(_0x360ff0){_0x58163c=_0x4167b0;if(!_0x4167b0){return _0x360ff0[_0xf31a('0x59')]({'inReplyTo':_0x108f71[_0xf31a('0x29')][_0xf31a('0x16')][_0xf31a('0x4f')],'to':_0x108f71[_0xf31a('0x29')]['message'][_0xf31a('0x32')],'cc':_0x108f71[_0xf31a('0x29')]['message']['cc'],'subject':_0x108f71[_0xf31a('0x29')][_0xf31a('0x16')]['subject'],'attach':_0x360ff0[_0xf31a('0x51')]?_0x360ff0[_0xf31a('0x51')]:_0x108f71['body']['message']['attach'],'substatus':null,'substatusAt':moment()['format'](_0xf31a('0x53')),'lastMsgAt':moment()[_0xf31a('0x52')](_0xf31a('0x53')),'lastMsgDirection':'in'});}else{return _0x360ff0;}}})[_0xf31a('0xe')](function(_0x5e4b8b){_0x4ac009[_0xf31a('0x5a')]=_0x5e4b8b['get']({'plain':!![]});_0x4ac009[_0xf31a('0x5a')][_0xf31a('0x5b')]=_0x58163c;return db[_0xf31a('0x5c')][_0xf31a('0x4d')]({'body':_0x108f71[_0xf31a('0x29')][_0xf31a('0x29')],'MailAccountId':_0x108f71[_0xf31a('0x42')]['id'],'MailInteractionId':_0x5e4b8b['id'],'direction':'in','ContactId':_0x4ac009[_0xf31a('0x4e')]['id'],'messageId':_0x108f71[_0xf31a('0x29')]['message'][_0xf31a('0x4f')],'from':_0x108f71['body'][_0xf31a('0x16')][_0xf31a('0x32')],'to':_0x108f71['body']['message']['to'],'cc':_0x108f71['body'][_0xf31a('0x16')]['cc'],'subject':_0x108f71['body'][_0xf31a('0x16')][_0xf31a('0x50')],'attach':_0x108f71['body'][_0xf31a('0x16')][_0xf31a('0x51')],'Attachments':_0x108f71['body']['message'][_0xf31a('0x5d')],'originTo':_0x108f71['body'][_0xf31a('0x16')][_0xf31a('0x5e')],'originCc':_0x108f71['body']['message'][_0xf31a('0x5f')],'bcc':_0x108f71[_0xf31a('0x29')][_0xf31a('0x16')][_0xf31a('0x60')],'ChatWebsiteId':_0x108f71['body']['message'][_0xf31a('0x61')]||null,'originChannel':_0x108f71['body']['message']['originChannel']||_0xf31a('0x62'),'ChatOfflineMessageId':_0x108f71['body'][_0xf31a('0x16')][_0xf31a('0x63')]||null},{'include':[{'model':db[_0xf31a('0x64')],'as':_0xf31a('0x65')}]});})[_0xf31a('0xe')](function(_0x2dccdd){_0x4ac009[_0xf31a('0x16')]=_0x2dccdd;if(!_0x4ac009[_0xf31a('0x5a')][_0xf31a('0x66')]){return;}return db[_0xf31a('0x67')][_0xf31a('0x22')]({'attributes':['id','name'],'where':{'id':_0x4ac009[_0xf31a('0x5a')]['UserId']}});})['then'](function(_0x271368){if(_0x271368){_0x4ac009[_0xf31a('0x43')][_0xf31a('0x68')]({'id':0x0,'priority':0x0,'app':_0xf31a('0x69'),'appdata':_0x271368[_0xf31a('0x6a')]+','+(_0x4ac009[_0xf31a('0x42')][_0xf31a('0x6b')]||0xa),'interval':_0xf31a('0x4c')});}if(!_0x4ac009['interaction'][_0xf31a('0x6c')]){return;}return db[_0xf31a('0x6d')][_0xf31a('0x22')]({'attributes':['id','name'],'where':{'id':_0x4ac009[_0xf31a('0x5a')][_0xf31a('0x6c')]}});})['then'](function(_0x31b51a){if(_0x31b51a){_0x4ac009[_0xf31a('0x43')][_0xf31a('0x68')]({'id':0x0,'priority':0x1,'app':_0xf31a('0x6e'),'appdata':_0x31b51a[_0xf31a('0x6a')]+','+(_0x4ac009[_0xf31a('0x42')]['waitForTheAssignedQueue']||0x12c),'interval':_0xf31a('0x4c')});}return respondWithRpcPromise(_0xf31a('0x6f'),_0xf31a('0x70'),_0x4ac009);})[_0xf31a('0xe')](function(_0x5eb6e9){_0x3b4aef(_0x5eb6e9);})['catch'](function(_0x1e0912){_0x1d001c(_0x5ae1f2[_0xf31a('0x14')](0x1f4,_0x1e0912[_0xf31a('0x16')]));});});}; \ No newline at end of file +var _0x86f4=['updatedAt','CompanyId','ListId','isNil','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','account','CmList','List','Contacts','DESC','Applications','Smtp','CloudProvider','get','omit','applications','list','priority','asc','autoclose','push','close','*,*,*,*','length','create','List\x20not\x20found','contact','messageId','generate','subject','attach','format','YYYY-MM-DD\x20HH:mm:ss','MailInteraction','Messages','Contact\x20not\x20found','spread','update','interaction','created','MailMessage','attachments','ChatWebsiteId','originChannel','Email','Attachment','User','unshift','agent','name','waitForTheAssignedAgent','queueId','queue','waitForTheAssignedQueue','Start','startRouting','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./mailAccount.socket','register','request','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','GetMailAccount','MailAccount','findAll','options','raw','where','attributes','limit','include','map','model','find','setDataValue','smtpOptions','getSmtpOptions','ShowMailAccount','catch','NotifyMailAccount','body','mail','difference','keys','CmContact'];(function(_0x1a9390,_0x3339e6){var _0x2b4514=function(_0x1c07d5){while(--_0x1c07d5){_0x1a9390['push'](_0x1a9390['shift']());}};_0x2b4514(++_0x3339e6);}(_0x86f4,0x18a));var _0x486f=function(_0x5aecd7,_0x4afd0f){_0x5aecd7=_0x5aecd7-0x0;var _0x485cc4=_0x86f4[_0x5aecd7];return _0x485cc4;};'use strict';var _=require(_0x486f('0x0'));var moment=require(_0x486f('0x1'));var BPromise=require(_0x486f('0x2'));var rs=require(_0x486f('0x3'));var Redis=require(_0x486f('0x4'));var db=require(_0x486f('0x5'))['db'];var logger=require(_0x486f('0x6'))('rpc');var config=require(_0x486f('0x7'));var jayson=require(_0x486f('0x8'));var client=jayson['client'][_0x486f('0x9')]({'port':0x232c});config[_0x486f('0xa')]=_[_0x486f('0xb')](config[_0x486f('0xa')],{'host':_0x486f('0xc'),'port':0x18eb});var socket=require(_0x486f('0xd'))(new Redis(config['redis']));require(_0x486f('0xe'))[_0x486f('0xf')](socket);function respondWithRpcPromise(_0x37975a,_0x468a82,_0x377d09){return new BPromise(function(_0x362036,_0x19ccdd){return client[_0x486f('0x10')](_0x37975a,_0x377d09)[_0x486f('0x11')](function(_0x1f7930){logger[_0x486f('0x12')](_0x486f('0x13'),_0x468a82,_0x486f('0x14'));logger[_0x486f('0x15')](_0x486f('0x16'),_0x468a82,_0x486f('0x14'),JSON[_0x486f('0x17')](_0x1f7930));if(_0x1f7930['error']){if(_0x1f7930[_0x486f('0x18')]['code']===0x1f4){logger[_0x486f('0x18')](_0x486f('0x13'),_0x468a82,_0x1f7930[_0x486f('0x18')]['message']);return _0x19ccdd(_0x1f7930['error'][_0x486f('0x19')]);}logger[_0x486f('0x18')]('MailAccount,\x20%s,\x20%s',_0x468a82,_0x1f7930[_0x486f('0x18')][_0x486f('0x19')]);return _0x362036(_0x1f7930[_0x486f('0x18')]['message']);}else{logger['info'](_0x486f('0x13'),_0x468a82,_0x486f('0x14'));_0x362036(_0x1f7930[_0x486f('0x1a')][_0x486f('0x19')]);}})['catch'](function(_0x59deb8){logger[_0x486f('0x18')](_0x486f('0x13'),_0x468a82,_0x59deb8);_0x19ccdd(_0x59deb8);});});}exports[_0x486f('0x1b')]=function(_0x20a1f7){var _0x10f507=this;return new Promise(function(_0x243dbf,_0x1c3887){return db[_0x486f('0x1c')][_0x486f('0x1d')]({'raw':_0x20a1f7[_0x486f('0x1e')]?_0x20a1f7[_0x486f('0x1e')][_0x486f('0x1f')]===undefined?!![]:![]:!![],'where':_0x20a1f7[_0x486f('0x1e')]?_0x20a1f7[_0x486f('0x1e')][_0x486f('0x20')]||null:null,'attributes':_0x20a1f7[_0x486f('0x1e')]?_0x20a1f7['options'][_0x486f('0x21')]||null:null,'limit':_0x20a1f7[_0x486f('0x1e')]?_0x20a1f7[_0x486f('0x1e')][_0x486f('0x22')]||null:null,'include':_0x20a1f7[_0x486f('0x1e')]?_0x20a1f7[_0x486f('0x1e')][_0x486f('0x23')]?_[_0x486f('0x24')](_0x20a1f7[_0x486f('0x1e')][_0x486f('0x23')],function(_0x2e983b){return{'model':db[_0x2e983b[_0x486f('0x25')]],'as':_0x2e983b['as'],'attributes':_0x2e983b[_0x486f('0x21')],'include':_0x2e983b[_0x486f('0x23')]?_[_0x486f('0x24')](_0x2e983b[_0x486f('0x23')],function(_0x6f1e8e){return{'model':db[_0x6f1e8e[_0x486f('0x25')]],'as':_0x6f1e8e['as'],'attributes':_0x6f1e8e[_0x486f('0x21')],'include':_0x6f1e8e[_0x486f('0x23')]?_[_0x486f('0x24')](_0x6f1e8e[_0x486f('0x23')],function(_0x5105ee){return{'model':db[_0x5105ee['model']],'as':_0x5105ee['as'],'attributes':_0x5105ee['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x173512){logger['info'](_0x486f('0x1b'),_0x20a1f7);logger[_0x486f('0x15')]('GetMailAccount',_0x20a1f7,JSON[_0x486f('0x17')](_0x173512));_0x243dbf(_0x173512);})['catch'](function(_0x1f9dee){logger[_0x486f('0x18')](_0x486f('0x1b'),_0x1f9dee[_0x486f('0x19')],_0x20a1f7);_0x1c3887(_0x10f507[_0x486f('0x18')](0x1f4,_0x1f9dee[_0x486f('0x19')]));});});};exports['ShowMailAccount']=function(_0x1f320e){var _0x323892=this;return new Promise(function(_0xdd39fe,_0x429b8d){return db[_0x486f('0x1c')][_0x486f('0x26')]({'raw':_0x1f320e[_0x486f('0x1e')]?_0x1f320e[_0x486f('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0x1f320e[_0x486f('0x1e')]?_0x1f320e[_0x486f('0x1e')]['where']||null:null,'attributes':_0x1f320e[_0x486f('0x1e')]?_0x1f320e[_0x486f('0x1e')][_0x486f('0x21')]||null:null,'include':_0x1f320e[_0x486f('0x1e')]?_0x1f320e[_0x486f('0x1e')]['include']?_[_0x486f('0x24')](_0x1f320e[_0x486f('0x1e')][_0x486f('0x23')],function(_0x202ea8){return{'model':db[_0x202ea8[_0x486f('0x25')]],'as':_0x202ea8['as'],'attributes':_0x202ea8[_0x486f('0x21')],'include':_0x202ea8[_0x486f('0x23')]?_['map'](_0x202ea8[_0x486f('0x23')],function(_0x219e8a){return{'model':db[_0x219e8a[_0x486f('0x25')]],'as':_0x219e8a['as'],'attributes':_0x219e8a['attributes'],'include':_0x219e8a['include']?_[_0x486f('0x24')](_0x219e8a[_0x486f('0x23')],function(_0x4b80f8){return{'model':db[_0x4b80f8[_0x486f('0x25')]],'as':_0x4b80f8['as'],'attributes':_0x4b80f8['attributes']};}):[]};}):[]};}):[]:[]})[_0x486f('0x11')](function(_0x87a417){if(_0x1f320e['options']['smtp']===!![])_0x87a417[_0x486f('0x27')](_0x486f('0x28'),_0x87a417[_0x486f('0x29')]());logger[_0x486f('0x12')](_0x486f('0x2a'),_0x1f320e);logger[_0x486f('0x15')](_0x486f('0x2a'),_0x1f320e,JSON[_0x486f('0x17')](_0x87a417));_0xdd39fe(_0x87a417);})[_0x486f('0x2b')](function(_0x11174f){logger[_0x486f('0x18')](_0x486f('0x2a'),_0x11174f[_0x486f('0x19')],_0x1f320e);_0x429b8d(_0x323892[_0x486f('0x18')](0x1f4,_0x11174f['message']));});});};exports[_0x486f('0x2c')]=function(_0x3e30a8){var _0x4e6208=this;return new Promise(function(_0x12f7dc,_0x332be9){var _0x2c4dbf={'body':_0x3e30a8[_0x486f('0x2d')],'channel':_0x486f('0x2e')};var _0x383f42=_[_0x486f('0x2f')](_[_0x486f('0x30')](db[_0x486f('0x31')]['rawAttributes']),['createdAt',_0x486f('0x32'),_0x486f('0x33'),_0x486f('0x34')]);var _0x42ef68=![];if(_0x3e30a8[_0x486f('0x2d')]['id']){delete _0x3e30a8[_0x486f('0x2d')]['id'];}if(_[_0x486f('0x35')](_0x3e30a8[_0x486f('0x2d')][_0x486f('0x36')])){return _0x332be9(_0x4e6208['error'](0x1f4,_0x486f('0x37')));}if(_[_0x486f('0x35')](_0x3e30a8[_0x486f('0x2d')][_0x486f('0x2d')])||_0x3e30a8['body'][_0x486f('0x2d')]===''){return _0x332be9(_0x4e6208['error'](0x1f4,_0x486f('0x38')));}if(_[_0x486f('0x35')](_0x3e30a8[_0x486f('0x2d')][_0x486f('0x39')])){return _0x332be9(_0x4e6208[_0x486f('0x18')](0x1f4,_0x486f('0x3a')+_0x383f42));}if(!_['includes'](_0x383f42,_0x3e30a8['body'][_0x486f('0x39')])){return _0x332be9(_0x4e6208[_0x486f('0x18')](0x1f4,_0x486f('0x3b')+_0x383f42));}var _0xefe4e4={};_0xefe4e4[_0x3e30a8['body'][_0x486f('0x39')]]=_0x3e30a8[_0x486f('0x2d')][_0x486f('0x36')];return db['MailAccount'][_0x486f('0x26')]({'where':{'id':_0x3e30a8[_0x486f('0x3c')]['id']},'include':[{'model':db[_0x486f('0x3d')],'as':_0x486f('0x3e'),'include':[{'model':db[_0x486f('0x31')],'as':_0x486f('0x3f'),'where':_0xefe4e4,'limit':0x1,'order':[[_0x486f('0x32'),_0x486f('0x40')]]}]},{'model':db['MailApplication'],'as':_0x486f('0x41')},{'model':db['MailServerOut'],'as':_0x486f('0x42'),'include':[{'model':db[_0x486f('0x43')],'as':_0x486f('0x43')}]}]})[_0x486f('0x11')](function(_0x34033e){if(_0x34033e&&_0x34033e[_0x486f('0x3e')]){var _0x4d2902=_0x34033e[_0x486f('0x44')]({'plain':!![]});_0x2c4dbf[_0x486f('0x3c')]=_[_0x486f('0x45')](_0x4d2902,[_0x486f('0x41'),_0x486f('0x3e')]);_0x2c4dbf[_0x486f('0x3c')][_0x486f('0x28')]=_0x34033e[_0x486f('0x29')]();_0x2c4dbf[_0x486f('0x46')]=_0x4d2902['Applications'];_0x2c4dbf[_0x486f('0x47')]=_0x4d2902[_0x486f('0x3e')];_0x2c4dbf[_0x486f('0x46')]=_['orderBy'](_0x2c4dbf[_0x486f('0x46')],[_0x486f('0x48')],[_0x486f('0x49')]);if(_0x2c4dbf['account']&&_0x2c4dbf[_0x486f('0x3c')][_0x486f('0x4a')]){_0x2c4dbf[_0x486f('0x46')][_0x486f('0x4b')]({'id':0x0,'priority':_0x2c4dbf['applications']['length']+0x1,'app':_0x486f('0x4c'),'appdata':_0x486f('0x4a'),'interval':_0x486f('0x4d')});}if(_0x2c4dbf[_0x486f('0x3c')][_0x486f('0x41')]){delete _0x2c4dbf[_0x486f('0x3c')][_0x486f('0x41')];}if(_0x2c4dbf[_0x486f('0x3c')]['List']){delete _0x2c4dbf[_0x486f('0x3c')]['List'];}if(_0x4d2902[_0x486f('0x3e')][_0x486f('0x3f')][_0x486f('0x4e')]){return _0x4d2902[_0x486f('0x3e')]['Contacts'][0x0];}var _0x1759ff=_[_0x486f('0xb')](_0x3e30a8[_0x486f('0x2d')],{'firstName':_0x3e30a8[_0x486f('0x2d')]['from'],'ListId':_0x4d2902[_0x486f('0x34')]});_0x1759ff[_0x3e30a8[_0x486f('0x2d')][_0x486f('0x39')]]=_0x3e30a8[_0x486f('0x2d')][_0x486f('0x36')];return db[_0x486f('0x31')][_0x486f('0x4f')](_0x1759ff);}else{throw new Error(_0x486f('0x50'));}})['then'](function(_0x42778e){_0x2c4dbf[_0x486f('0x51')]=_0x42778e;if(_0x42778e){if(!_0x3e30a8[_0x486f('0x2d')][_0x486f('0x19')]['messageId']){_0x3e30a8[_0x486f('0x2d')]['message'][_0x486f('0x52')]=rs[_0x486f('0x53')]()+'\x20'+_0x3e30a8[_0x486f('0x2d')][_0x486f('0x19')]['from'];}var _0x455b85={'ContactId':_0x42778e['id'],'MailAccountId':_0x3e30a8[_0x486f('0x3c')]['id'],'inReplyTo':_0x3e30a8[_0x486f('0x2d')][_0x486f('0x19')]['messageId'],'to':_0x3e30a8[_0x486f('0x2d')][_0x486f('0x19')][_0x486f('0x36')],'cc':_0x3e30a8[_0x486f('0x2d')][_0x486f('0x19')]['cc'],'subject':_0x3e30a8[_0x486f('0x2d')][_0x486f('0x19')][_0x486f('0x54')],'attach':_0x3e30a8[_0x486f('0x2d')][_0x486f('0x19')][_0x486f('0x55')],'lastMsgAt':moment()[_0x486f('0x56')](_0x486f('0x57')),'lastMsgDirection':'in'};return db[_0x486f('0x58')]['find']({'where':{'closed':![],'MailAccountId':_0x3e30a8[_0x486f('0x3c')]['id']},'include':[{'model':db['MailMessage'],'as':_0x486f('0x59'),'attributes':['messageId'],'where':{'messageId':_0x3e30a8[_0x486f('0x2d')][_0x486f('0x19')]['inReplyTo']}}]})['then'](function(_0x14e697){if(_0x14e697){return[_0x14e697,![]];}return db['MailInteraction'][_0x486f('0x4f')](_0x455b85)[_0x486f('0x11')](function(_0x587fb1){return[_0x587fb1,!![]];});});}else{throw new Error(_0x486f('0x5a'));}})[_0x486f('0x5b')](function(_0x310249,_0x3e0dc1){if(_0x310249){_0x42ef68=_0x3e0dc1;if(!_0x3e0dc1){return _0x310249[_0x486f('0x5c')]({'inReplyTo':_0x3e30a8[_0x486f('0x2d')]['message'][_0x486f('0x52')],'to':_0x3e30a8[_0x486f('0x2d')][_0x486f('0x19')]['from'],'cc':_0x3e30a8[_0x486f('0x2d')]['message']['cc'],'subject':_0x3e30a8[_0x486f('0x2d')]['message'][_0x486f('0x54')],'attach':_0x310249[_0x486f('0x55')]?_0x310249[_0x486f('0x55')]:_0x3e30a8[_0x486f('0x2d')]['message'][_0x486f('0x55')],'substatus':null,'substatusAt':moment()[_0x486f('0x56')](_0x486f('0x57')),'lastMsgAt':moment()['format'](_0x486f('0x57')),'lastMsgDirection':'in'});}else{return _0x310249;}}})[_0x486f('0x11')](function(_0x43202e){_0x2c4dbf[_0x486f('0x5d')]=_0x43202e['get']({'plain':!![]});_0x2c4dbf[_0x486f('0x5d')][_0x486f('0x5e')]=_0x42ef68;return db[_0x486f('0x5f')]['create']({'body':_0x3e30a8[_0x486f('0x2d')][_0x486f('0x2d')],'MailAccountId':_0x3e30a8[_0x486f('0x3c')]['id'],'MailInteractionId':_0x43202e['id'],'direction':'in','ContactId':_0x2c4dbf['contact']['id'],'messageId':_0x3e30a8[_0x486f('0x2d')][_0x486f('0x19')]['messageId'],'from':_0x3e30a8['body']['message']['from'],'to':_0x3e30a8[_0x486f('0x2d')][_0x486f('0x19')]['to'],'cc':_0x3e30a8[_0x486f('0x2d')][_0x486f('0x19')]['cc'],'subject':_0x3e30a8[_0x486f('0x2d')][_0x486f('0x19')][_0x486f('0x54')],'attach':_0x3e30a8[_0x486f('0x2d')]['message'][_0x486f('0x55')],'Attachments':_0x3e30a8[_0x486f('0x2d')][_0x486f('0x19')][_0x486f('0x60')],'originTo':_0x3e30a8[_0x486f('0x2d')]['message']['originTo'],'originCc':_0x3e30a8[_0x486f('0x2d')][_0x486f('0x19')]['originCc'],'bcc':_0x3e30a8[_0x486f('0x2d')][_0x486f('0x19')]['bcc'],'ChatWebsiteId':_0x3e30a8['body'][_0x486f('0x19')][_0x486f('0x61')]||null,'originChannel':_0x3e30a8[_0x486f('0x2d')][_0x486f('0x19')][_0x486f('0x62')]||_0x486f('0x63'),'ChatOfflineMessageId':_0x3e30a8[_0x486f('0x2d')]['message']['ChatOfflineMessageId']||null},{'include':[{'model':db[_0x486f('0x64')],'as':'Attachments'}]});})[_0x486f('0x11')](function(_0x4896c8){_0x2c4dbf[_0x486f('0x19')]=_0x4896c8;if(!_0x2c4dbf['interaction']['UserId']){return;}return db[_0x486f('0x65')]['find']({'attributes':['id','name'],'where':{'id':_0x2c4dbf[_0x486f('0x5d')]['UserId']}});})[_0x486f('0x11')](function(_0x5961c3){if(_0x5961c3){_0x2c4dbf[_0x486f('0x46')][_0x486f('0x66')]({'id':0x0,'priority':0x0,'app':_0x486f('0x67'),'appdata':_0x5961c3[_0x486f('0x68')]+','+(_0x2c4dbf['account'][_0x486f('0x69')]||0xa),'interval':_0x486f('0x4d')});}if(!_0x2c4dbf['interaction'][_0x486f('0x6a')]){return;}return db['MailQueue'][_0x486f('0x26')]({'attributes':['id','name'],'where':{'id':_0x2c4dbf[_0x486f('0x5d')]['queueId']}});})['then'](function(_0x596629){if(_0x596629){_0x2c4dbf[_0x486f('0x46')][_0x486f('0x66')]({'id':0x0,'priority':0x1,'app':_0x486f('0x6b'),'appdata':_0x596629[_0x486f('0x68')]+','+(_0x2c4dbf[_0x486f('0x3c')][_0x486f('0x6c')]||0x12c),'interval':_0x486f('0x4d')});}return respondWithRpcPromise(_0x486f('0x6d'),_0x486f('0x6e'),_0x2c4dbf);})[_0x486f('0x11')](function(_0x4f2213){_0x12f7dc(_0x4f2213);})[_0x486f('0x2b')](function(_0x2cc51b){_0x332be9(_0x4e6208[_0x486f('0x18')](0x1f4,_0x2cc51b[_0x486f('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.socket.js b/server/api/mailAccount/mailAccount.socket.js index d7d7408..2e7b91b 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 _0x7f26=['./mailAccount.events','save','remove','update','emit','register','mailAccount:'];(function(_0x2aecd7,_0x4e6ed1){var _0x42bb51=function(_0x3523cb){while(--_0x3523cb){_0x2aecd7['push'](_0x2aecd7['shift']());}};_0x42bb51(++_0x4e6ed1);}(_0x7f26,0x13b));var _0x67f2=function(_0x297f3d,_0xfaa33f){_0x297f3d=_0x297f3d-0x0;var _0x5947ef=_0x7f26[_0x297f3d];return _0x5947ef;};'use strict';var MailAccountEvents=require(_0x67f2('0x0'));var events=[_0x67f2('0x1'),_0x67f2('0x2'),_0x67f2('0x3')];function createListener(_0x404870,_0x19c401){return function(_0x40a8b0){_0x19c401[_0x67f2('0x4')](_0x404870,_0x40a8b0);};}function removeListener(_0x1e08ad,_0x1b3be4){return function(){MailAccountEvents['removeListener'](_0x1e08ad,_0x1b3be4);};}exports[_0x67f2('0x5')]=function(_0xc208cb){for(var _0x416d3d=0x0,_0x26370c=events['length'];_0x416d3d<_0x26370c;_0x416d3d++){var _0x5a3601=events[_0x416d3d];var _0x4a3380=createListener(_0x67f2('0x6')+_0x5a3601,_0xc208cb);MailAccountEvents['on'](_0x5a3601,_0x4a3380);}}; \ No newline at end of file +var _0x5ae9=['register','length','mailAccount:','./mailAccount.events','update','emit'];(function(_0xc3c928,_0x37d65e){var _0x483fdd=function(_0x2e48c1){while(--_0x2e48c1){_0xc3c928['push'](_0xc3c928['shift']());}};_0x483fdd(++_0x37d65e);}(_0x5ae9,0x19b));var _0x95ae=function(_0x2b0d88,_0x5b5ef2){_0x2b0d88=_0x2b0d88-0x0;var _0x1c9256=_0x5ae9[_0x2b0d88];return _0x1c9256;};'use strict';var MailAccountEvents=require(_0x95ae('0x0'));var events=['save','remove',_0x95ae('0x1')];function createListener(_0x39dedc,_0x4e8950){return function(_0x23690b){_0x4e8950[_0x95ae('0x2')](_0x39dedc,_0x23690b);};}function removeListener(_0x559cb2,_0x22469d){return function(){MailAccountEvents['removeListener'](_0x559cb2,_0x22469d);};}exports[_0x95ae('0x3')]=function(_0x3c4464){for(var _0xa51307=0x0,_0xec2c41=events[_0x95ae('0x4')];_0xa51307<_0xec2c41;_0xa51307++){var _0x4df142=events[_0xa51307];var _0x588bab=createListener(_0x95ae('0x5')+_0x4df142,_0x3c4464);MailAccountEvents['on'](_0x4df142,_0x588bab);}}; \ No newline at end of file diff --git a/server/api/mailApplication/index.js b/server/api/mailApplication/index.js index af0bbb1..83f6f2d 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 _0x3c1c=['multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./mailApplication.controller','get','/:id','isAuthenticated','show','put','update','delete','destroy'];(function(_0x31e2b3,_0x117d4c){var _0x5d28f8=function(_0x2b6c58){while(--_0x2b6c58){_0x31e2b3['push'](_0x31e2b3['shift']());}};_0x5d28f8(++_0x117d4c);}(_0x3c1c,0x1ed));var _0xc3c1=function(_0x4ac424,_0x554b5d){_0x4ac424=_0x4ac424-0x0;var _0xe1b890=_0x3c1c[_0x4ac424];return _0xe1b890;};'use strict';var multer=require(_0xc3c1('0x0'));var util=require(_0xc3c1('0x1'));var path=require(_0xc3c1('0x2'));var timeout=require('connect-timeout');var express=require(_0xc3c1('0x3'));var router=express[_0xc3c1('0x4')]();var fs_extra=require(_0xc3c1('0x5'));var auth=require(_0xc3c1('0x6'));var interaction=require(_0xc3c1('0x7'));var config=require('../../config/environment');var controller=require(_0xc3c1('0x8'));router[_0xc3c1('0x9')](_0xc3c1('0xa'),auth[_0xc3c1('0xb')](),controller[_0xc3c1('0xc')]);router[_0xc3c1('0xd')](_0xc3c1('0xa'),auth[_0xc3c1('0xb')](),controller[_0xc3c1('0xe')]);router[_0xc3c1('0xf')](_0xc3c1('0xa'),auth[_0xc3c1('0xb')](),controller[_0xc3c1('0x10')]);module['exports']=router; \ No newline at end of file +var _0x0637=['destroy','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','./mailApplication.controller','/:id','isAuthenticated','put','update','delete'];(function(_0x2e0375,_0x383a98){var _0x2e4b42=function(_0x4f8ffa){while(--_0x4f8ffa){_0x2e0375['push'](_0x2e0375['shift']());}};_0x2e4b42(++_0x383a98);}(_0x0637,0x1bb));var _0x7063=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0637[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x7063('0x0'));var util=require(_0x7063('0x1'));var path=require('path');var timeout=require(_0x7063('0x2'));var express=require('express');var router=express[_0x7063('0x3')]();var fs_extra=require(_0x7063('0x4'));var auth=require(_0x7063('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x7063('0x6'));router['get'](_0x7063('0x7'),auth[_0x7063('0x8')](),controller['show']);router[_0x7063('0x9')](_0x7063('0x7'),auth[_0x7063('0x8')](),controller[_0x7063('0xa')]);router[_0x7063('0xb')](_0x7063('0x7'),auth['isAuthenticated'](),controller[_0x7063('0xc')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.attributes.js b/server/api/mailApplication/mailApplication.attributes.js index 12e509f..ee18d0c 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 _0x2a1b=['sequelize','exports','INTEGER','STRING','noop','TEXT'];(function(_0x20c512,_0x36c198){var _0x25236e=function(_0x418ec3){while(--_0x418ec3){_0x20c512['push'](_0x20c512['shift']());}};_0x25236e(++_0x36c198);}(_0x2a1b,0x8a));var _0xb2a1=function(_0x3b3ce6,_0x1054a8){_0x3b3ce6=_0x3b3ce6-0x0;var _0x418398=_0x2a1b[_0x3b3ce6];return _0x418398;};'use strict';var Sequelize=require(_0xb2a1('0x0'));module[_0xb2a1('0x1')]={'priority':{'type':Sequelize[_0xb2a1('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xb2a1('0x3')],'allowNull':![],'defaultValue':_0xb2a1('0x4')},'appdata':{'type':Sequelize[_0xb2a1('0x5')]()},'description':{'type':Sequelize[_0xb2a1('0x3')]},'interval':{'type':Sequelize[_0xb2a1('0x3')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file +var _0x804f=['*,*,*,*','sequelize','STRING','noop','TEXT'];(function(_0x59befa,_0x4af99b){var _0x1dd63d=function(_0x4c1df4){while(--_0x4c1df4){_0x59befa['push'](_0x59befa['shift']());}};_0x1dd63d(++_0x4af99b);}(_0x804f,0x150));var _0xf804=function(_0xb9fa42,_0x16f6b8){_0xb9fa42=_0xb9fa42-0x0;var _0x31b21a=_0x804f[_0xb9fa42];return _0x31b21a;};'use strict';var Sequelize=require(_0xf804('0x0'));module['exports']={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0xf804('0x1')],'allowNull':![],'defaultValue':_0xf804('0x2')},'appdata':{'type':Sequelize[_0xf804('0x3')]()},'description':{'type':Sequelize[_0xf804('0x1')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0xf804('0x4')}}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.controller.js b/server/api/mailApplication/mailApplication.controller.js index 39f362c..53e6229 100644 --- a/server/api/mailApplication/mailApplication.controller.js +++ b/server/api/mailApplication/mailApplication.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcb91=['send','show','params','keys','rawAttributes','query','intersection','attributes','fields','length','model','includeAll','include','merge','options','MailApplication','find','catch','body','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','fs-extra','lodash','crypto','jsforce','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','update','then','destroy','error','stack','name'];(function(_0x2a168e,_0x1b80b9){var _0x17de75=function(_0x1e4b11){while(--_0x1e4b11){_0x2a168e['push'](_0x2a168e['shift']());}};_0x17de75(++_0x1b80b9);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x4bcf38,_0x3c12be){_0x4bcf38=_0x4bcf38-0x0;var _0x4a89be=_0xcb91[_0x4bcf38];return _0x4a89be;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x1cb9('0x0'));var jsonpatch=require(_0x1cb9('0x1'));var rp=require(_0x1cb9('0x2'));var moment=require(_0x1cb9('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x1cb9('0x4'));var util=require(_0x1cb9('0x5'));var path=require('path');var sox=require(_0x1cb9('0x6'));var csv=require(_0x1cb9('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1cb9('0x8'));var _=require(_0x1cb9('0x9'));var squel=require('squel');var crypto=require(_0x1cb9('0xa'));var jsforce=require(_0x1cb9('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x1cb9('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x1cb9('0xc'));var authService=require(_0x1cb9('0xd'));var qs=require(_0x1cb9('0xe'));var as=require(_0x1cb9('0xf'));var hardwareService=require(_0x1cb9('0x10'));var logger=require('../../config/logger')(_0x1cb9('0x11'));var utils=require(_0x1cb9('0x12'));var config=require(_0x1cb9('0x13'));var licenseUtil=require(_0x1cb9('0x14'));var db=require(_0x1cb9('0x15'))['db'];function respondWithStatusCode(_0x5445e1,_0x5e3c19){_0x5e3c19=_0x5e3c19||0xcc;return function(_0x59dec3){if(_0x59dec3){return _0x5445e1[_0x1cb9('0x16')](_0x5e3c19);}return _0x5445e1[_0x1cb9('0x17')](_0x5e3c19)[_0x1cb9('0x18')]();};}function respondWithResult(_0x1c714f,_0x56884d){_0x56884d=_0x56884d||0xc8;return function(_0x397727){if(_0x397727){return _0x1c714f[_0x1cb9('0x17')](_0x56884d)[_0x1cb9('0x19')](_0x397727);}};}function respondWithFilteredResult(_0x8dfa55,_0x3e2d11){return function(_0x5806d8){if(_0x5806d8){var _0x5572cb=typeof _0x3e2d11[_0x1cb9('0x1a')]===_0x1cb9('0x1b')&&typeof _0x3e2d11[_0x1cb9('0x1c')]===_0x1cb9('0x1b');var _0x3e21e0=_0x5806d8[_0x1cb9('0x1d')];var _0x23d3a9=_0x5572cb?0x0:_0x3e2d11['offset'];var _0x479d43=_0x5572cb?_0x5806d8[_0x1cb9('0x1d')]:_0x3e2d11[_0x1cb9('0x1a')]+_0x3e2d11[_0x1cb9('0x1c')];var _0x31481a;if(_0x479d43>=_0x3e21e0){_0x479d43=_0x3e21e0;_0x31481a=0xc8;}else{_0x31481a=0xce;}_0x8dfa55[_0x1cb9('0x17')](_0x31481a);return _0x8dfa55[_0x1cb9('0x1e')](_0x1cb9('0x1f'),_0x23d3a9+'-'+_0x479d43+'/'+_0x3e21e0)['json'](_0x5806d8);}return null;};}function patchUpdates(_0x559bcc){return function(_0x1a5a72){try{jsonpatch['apply'](_0x1a5a72,_0x559bcc,!![]);}catch(_0x4750b1){return BPromise[_0x1cb9('0x20')](_0x4750b1);}return _0x1a5a72['save']();};}function saveUpdates(_0x599275,_0x2e3854){return function(_0x325637){if(_0x325637){return _0x325637[_0x1cb9('0x21')](_0x599275)[_0x1cb9('0x22')](function(_0x45b8d3){return _0x45b8d3;});}return null;};}function removeEntity(_0x27db16,_0x59ebea){return function(_0x55b232){if(_0x55b232){return _0x55b232[_0x1cb9('0x23')]()['then'](function(){_0x27db16[_0x1cb9('0x17')](0xcc)[_0x1cb9('0x18')]();});}};}function handleEntityNotFound(_0x69b4c8,_0x44d3c4){return function(_0x43a100){if(!_0x43a100){_0x69b4c8['sendStatus'](0x194);}return _0x43a100;};}function handleError(_0x195f16,_0x9df250){_0x9df250=_0x9df250||0x1f4;return function(_0x4c8d76){logger[_0x1cb9('0x24')](_0x4c8d76[_0x1cb9('0x25')]);if(_0x4c8d76[_0x1cb9('0x26')]){delete _0x4c8d76[_0x1cb9('0x26')];}_0x195f16[_0x1cb9('0x17')](_0x9df250)[_0x1cb9('0x27')](_0x4c8d76);};}exports[_0x1cb9('0x28')]=function(_0xb644b3,_0x41e5c2){var _0x9de64b={'raw':!![],'where':{'id':_0xb644b3[_0x1cb9('0x29')]['id']}},_0x48888d={};_0x48888d['model']=_[_0x1cb9('0x2a')](db['MailApplication'][_0x1cb9('0x2b')]);_0x48888d[_0x1cb9('0x2c')]=_[_0x1cb9('0x2a')](_0xb644b3[_0x1cb9('0x2c')]);_0x48888d['filters']=_[_0x1cb9('0x2d')](_0x48888d['model'],_0x48888d[_0x1cb9('0x2c')]);_0x9de64b[_0x1cb9('0x2e')]=_[_0x1cb9('0x2d')](_0x48888d['model'],qs[_0x1cb9('0x2f')](_0xb644b3['query'][_0x1cb9('0x2f')]));_0x9de64b['attributes']=_0x9de64b[_0x1cb9('0x2e')][_0x1cb9('0x30')]?_0x9de64b[_0x1cb9('0x2e')]:_0x48888d[_0x1cb9('0x31')];if(_0xb644b3['query'][_0x1cb9('0x32')]){_0x9de64b[_0x1cb9('0x33')]=[{'all':!![]}];}_0x9de64b=_[_0x1cb9('0x34')]({},_0x9de64b,_0xb644b3[_0x1cb9('0x35')]);return db[_0x1cb9('0x36')][_0x1cb9('0x37')](_0x9de64b)[_0x1cb9('0x22')](handleEntityNotFound(_0x41e5c2,null))[_0x1cb9('0x22')](respondWithResult(_0x41e5c2,null))[_0x1cb9('0x38')](handleError(_0x41e5c2,null));};exports[_0x1cb9('0x21')]=function(_0x294eec,_0x26b950){if(_0x294eec[_0x1cb9('0x39')]['id']){delete _0x294eec['body']['id'];}return db['MailApplication'][_0x1cb9('0x37')]({'where':{'id':_0x294eec[_0x1cb9('0x29')]['id']}})[_0x1cb9('0x22')](handleEntityNotFound(_0x26b950,null))[_0x1cb9('0x22')](saveUpdates(_0x294eec[_0x1cb9('0x39')],null))[_0x1cb9('0x22')](respondWithResult(_0x26b950,null))[_0x1cb9('0x38')](handleError(_0x26b950,null));};exports[_0x1cb9('0x23')]=function(_0x4d3e39,_0x2aa59b){return db[_0x1cb9('0x36')][_0x1cb9('0x37')]({'where':{'id':_0x4d3e39['params']['id']}})[_0x1cb9('0x22')](handleEntityNotFound(_0x2aa59b,null))['then'](removeEntity(_0x2aa59b,null))[_0x1cb9('0x38')](handleError(_0x2aa59b,null));}; \ No newline at end of file +var _0x54ef=['api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','limit','undefined','count','offset','Content-Range','apply','reject','save','update','then','destroy','error','name','show','params','model','rawAttributes','query','keys','filters','intersection','attributes','fields','length','merge','options','MailApplication','find','body','catch','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','jsforce','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger'];(function(_0x1a7431,_0x3ee90){var _0xf745d0=function(_0x328260){while(--_0x328260){_0x1a7431['push'](_0x1a7431['shift']());}};_0xf745d0(++_0x3ee90);}(_0x54ef,0x112));var _0xf54e=function(_0x568360,_0x323fd0){_0x568360=_0x568360-0x0;var _0x228071=_0x54ef[_0x568360];return _0x228071;};'use strict';var emlformat=require(_0xf54e('0x0'));var rimraf=require(_0xf54e('0x1'));var zipdir=require(_0xf54e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf54e('0x3'));var moment=require(_0xf54e('0x4'));var BPromise=require(_0xf54e('0x5'));var Mustache=require(_0xf54e('0x6'));var util=require(_0xf54e('0x7'));var path=require(_0xf54e('0x8'));var sox=require(_0xf54e('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf54e('0xa'));var _=require(_0xf54e('0xb'));var squel=require(_0xf54e('0xc'));var crypto=require('crypto');var jsforce=require(_0xf54e('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xf54e('0xe'));var querystring=require(_0xf54e('0xf'));var Papa=require('papaparse');var Redis=require(_0xf54e('0x10'));var authService=require(_0xf54e('0x11'));var qs=require(_0xf54e('0x12'));var as=require(_0xf54e('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf54e('0x14'))(_0xf54e('0x15'));var utils=require(_0xf54e('0x16'));var config=require(_0xf54e('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xf54e('0x18'))['db'];function respondWithStatusCode(_0x4b0ee1,_0x4bd828){_0x4bd828=_0x4bd828||0xcc;return function(_0x15a9d4){if(_0x15a9d4){return _0x4b0ee1[_0xf54e('0x19')](_0x4bd828);}return _0x4b0ee1[_0xf54e('0x1a')](_0x4bd828)[_0xf54e('0x1b')]();};}function respondWithResult(_0x5644aa,_0x331732){_0x331732=_0x331732||0xc8;return function(_0x1bbeaa){if(_0x1bbeaa){return _0x5644aa[_0xf54e('0x1a')](_0x331732)[_0xf54e('0x1c')](_0x1bbeaa);}};}function respondWithFilteredResult(_0x56828e,_0x2366ee){return function(_0x389abc){if(_0x389abc){var _0x3eb415=typeof _0x2366ee['offset']==='undefined'&&typeof _0x2366ee[_0xf54e('0x1d')]===_0xf54e('0x1e');var _0x1c02e7=_0x389abc[_0xf54e('0x1f')];var _0x15cc48=_0x3eb415?0x0:_0x2366ee[_0xf54e('0x20')];var _0x2e27b6=_0x3eb415?_0x389abc[_0xf54e('0x1f')]:_0x2366ee[_0xf54e('0x20')]+_0x2366ee[_0xf54e('0x1d')];var _0x226c96;if(_0x2e27b6>=_0x1c02e7){_0x2e27b6=_0x1c02e7;_0x226c96=0xc8;}else{_0x226c96=0xce;}_0x56828e['status'](_0x226c96);return _0x56828e['set'](_0xf54e('0x21'),_0x15cc48+'-'+_0x2e27b6+'/'+_0x1c02e7)['json'](_0x389abc);}return null;};}function patchUpdates(_0x3e1556){return function(_0x1bfe99){try{jsonpatch[_0xf54e('0x22')](_0x1bfe99,_0x3e1556,!![]);}catch(_0x9903fc){return BPromise[_0xf54e('0x23')](_0x9903fc);}return _0x1bfe99[_0xf54e('0x24')]();};}function saveUpdates(_0x388aa0,_0x11985e){return function(_0x3c0169){if(_0x3c0169){return _0x3c0169[_0xf54e('0x25')](_0x388aa0)[_0xf54e('0x26')](function(_0x5b83df){return _0x5b83df;});}return null;};}function removeEntity(_0x6f6d29,_0x54f914){return function(_0x264a8f){if(_0x264a8f){return _0x264a8f[_0xf54e('0x27')]()[_0xf54e('0x26')](function(){_0x6f6d29[_0xf54e('0x1a')](0xcc)[_0xf54e('0x1b')]();});}};}function handleEntityNotFound(_0x160160,_0x1e08d1){return function(_0x43488d){if(!_0x43488d){_0x160160[_0xf54e('0x19')](0x194);}return _0x43488d;};}function handleError(_0x33457f,_0xf6cdd7){_0xf6cdd7=_0xf6cdd7||0x1f4;return function(_0x39c0ae){logger[_0xf54e('0x28')](_0x39c0ae['stack']);if(_0x39c0ae[_0xf54e('0x29')]){delete _0x39c0ae['name'];}_0x33457f[_0xf54e('0x1a')](_0xf6cdd7)['send'](_0x39c0ae);};}exports[_0xf54e('0x2a')]=function(_0x269f47,_0x21ba00){var _0xa13cd0={'raw':!![],'where':{'id':_0x269f47[_0xf54e('0x2b')]['id']}},_0x25b643={};_0x25b643[_0xf54e('0x2c')]=_['keys'](db['MailApplication'][_0xf54e('0x2d')]);_0x25b643[_0xf54e('0x2e')]=_[_0xf54e('0x2f')](_0x269f47[_0xf54e('0x2e')]);_0x25b643[_0xf54e('0x30')]=_[_0xf54e('0x31')](_0x25b643[_0xf54e('0x2c')],_0x25b643[_0xf54e('0x2e')]);_0xa13cd0[_0xf54e('0x32')]=_[_0xf54e('0x31')](_0x25b643['model'],qs['fields'](_0x269f47[_0xf54e('0x2e')][_0xf54e('0x33')]));_0xa13cd0['attributes']=_0xa13cd0[_0xf54e('0x32')][_0xf54e('0x34')]?_0xa13cd0[_0xf54e('0x32')]:_0x25b643[_0xf54e('0x2c')];if(_0x269f47['query']['includeAll']){_0xa13cd0['include']=[{'all':!![]}];}_0xa13cd0=_[_0xf54e('0x35')]({},_0xa13cd0,_0x269f47[_0xf54e('0x36')]);return db[_0xf54e('0x37')][_0xf54e('0x38')](_0xa13cd0)[_0xf54e('0x26')](handleEntityNotFound(_0x21ba00,null))[_0xf54e('0x26')](respondWithResult(_0x21ba00,null))['catch'](handleError(_0x21ba00,null));};exports['update']=function(_0x530cee,_0xc04e04){if(_0x530cee[_0xf54e('0x39')]['id']){delete _0x530cee['body']['id'];}return db['MailApplication'][_0xf54e('0x38')]({'where':{'id':_0x530cee[_0xf54e('0x2b')]['id']}})[_0xf54e('0x26')](handleEntityNotFound(_0xc04e04,null))['then'](saveUpdates(_0x530cee[_0xf54e('0x39')],null))[_0xf54e('0x26')](respondWithResult(_0xc04e04,null))['catch'](handleError(_0xc04e04,null));};exports[_0xf54e('0x27')]=function(_0x6e5bdf,_0x5af03){return db[_0xf54e('0x37')][_0xf54e('0x38')]({'where':{'id':_0x6e5bdf[_0xf54e('0x2b')]['id']}})['then'](handleEntityNotFound(_0x5af03,null))['then'](removeEntity(_0x5af03,null))[_0xf54e('0x3a')](handleError(_0x5af03,null));}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.model.js b/server/api/mailApplication/mailApplication.model.js index 355337a..0dffef1 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 _0xc02a=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailApplication.attributes','mail_applications','utf8mb4_unicode_ci','lodash','util','api'];(function(_0x13b21e,_0x4afa71){var _0x2bbedb=function(_0x10ee27){while(--_0x10ee27){_0x13b21e['push'](_0x13b21e['shift']());}};_0x2bbedb(++_0x4afa71);}(_0xc02a,0x159));var _0xac02=function(_0x2d4421,_0x15a84f){_0x2d4421=_0x2d4421-0x0;var _0x2d3b01=_0xc02a[_0x2d4421];return _0x2d3b01;};'use strict';var _=require(_0xac02('0x0'));var util=require(_0xac02('0x1'));var logger=require('../../config/logger')(_0xac02('0x2'));var moment=require(_0xac02('0x3'));var BPromise=require(_0xac02('0x4'));var rp=require(_0xac02('0x5'));var fs=require('fs');var path=require(_0xac02('0x6'));var rimraf=require(_0xac02('0x7'));var config=require(_0xac02('0x8'));var attributes=require(_0xac02('0x9'));module['exports']=function(_0x2c74e9,_0x4e6f1e){return _0x2c74e9['define']('MailApplication',attributes,{'tableName':_0xac02('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xac02('0xb')});}; \ No newline at end of file +var _0x8ac4=['./mailApplication.attributes','exports','MailApplication','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x2984c1,_0x2541e3){var _0x44d7a7=function(_0x3b04f3){while(--_0x3b04f3){_0x2984c1['push'](_0x2984c1['shift']());}};_0x44d7a7(++_0x2541e3);}(_0x8ac4,0x108));var _0x48ac=function(_0x2143be,_0x389f5c){_0x2143be=_0x2143be-0x0;var _0x342154=_0x8ac4[_0x2143be];return _0x342154;};'use strict';var _=require(_0x48ac('0x0'));var util=require(_0x48ac('0x1'));var logger=require(_0x48ac('0x2'))('api');var moment=require(_0x48ac('0x3'));var BPromise=require(_0x48ac('0x4'));var rp=require(_0x48ac('0x5'));var fs=require('fs');var path=require(_0x48ac('0x6'));var rimraf=require(_0x48ac('0x7'));var config=require(_0x48ac('0x8'));var attributes=require(_0x48ac('0x9'));module[_0x48ac('0xa')]=function(_0x2cc517,_0x2c69c5){return _0x2cc517['define'](_0x48ac('0xb'),attributes,{'tableName':'mail_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x48ac('0xc')});}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.rpc.js b/server/api/mailApplication/mailApplication.rpc.js index d917ab3..538f593 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 _0xfe3c=['debug','MailApplication,\x20%s,\x20%s,\x20%s','stringify','error','MailApplication,\x20%s,\x20%s','message','result','catch','MailApplication','update','body','options','attributes','then','UpdateMailApplication','lodash','util','moment','../../config/utils','../../config/logger','jayson/promise','client','http','request','info','request\x20sent'];(function(_0x27943f,_0x5e7869){var _0xb8b984=function(_0x2a2690){while(--_0x2a2690){_0x27943f['push'](_0x27943f['shift']());}};_0xb8b984(++_0x5e7869);}(_0xfe3c,0x1af));var _0xcfe3=function(_0x44892b,_0x5735e0){_0x44892b=_0x44892b-0x0;var _0x350190=_0xfe3c[_0x44892b];return _0x350190;};'use strict';var _=require(_0xcfe3('0x0'));var util=require(_0xcfe3('0x1'));var moment=require(_0xcfe3('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xcfe3('0x3'));var logger=require(_0xcfe3('0x4'))('rpc');var config=require('../../config/environment');var jayson=require(_0xcfe3('0x5'));var client=jayson[_0xcfe3('0x6')][_0xcfe3('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x2da5d5,_0x24b78f,_0x52eb85){return new BPromise(function(_0x4d0463,_0x5cd0fc){return client[_0xcfe3('0x8')](_0x2da5d5,_0x52eb85)['then'](function(_0x493e42){logger[_0xcfe3('0x9')]('MailApplication,\x20%s,\x20%s',_0x24b78f,_0xcfe3('0xa'));logger[_0xcfe3('0xb')](_0xcfe3('0xc'),_0x24b78f,'request\x20sent',JSON[_0xcfe3('0xd')](_0x493e42));if(_0x493e42[_0xcfe3('0xe')]){if(_0x493e42[_0xcfe3('0xe')]['code']===0x1f4){logger[_0xcfe3('0xe')](_0xcfe3('0xf'),_0x24b78f,_0x493e42['error'][_0xcfe3('0x10')]);return _0x5cd0fc(_0x493e42[_0xcfe3('0xe')]['message']);}logger['error'](_0xcfe3('0xf'),_0x24b78f,_0x493e42['error'][_0xcfe3('0x10')]);return _0x4d0463(_0x493e42[_0xcfe3('0xe')][_0xcfe3('0x10')]);}else{logger[_0xcfe3('0x9')]('MailApplication,\x20%s,\x20%s',_0x24b78f,_0xcfe3('0xa'));_0x4d0463(_0x493e42[_0xcfe3('0x11')]['message']);}})[_0xcfe3('0x12')](function(_0x457c62){logger['error'](_0xcfe3('0xf'),_0x24b78f,_0x457c62);_0x5cd0fc(_0x457c62);});});}exports['UpdateMailApplication']=function(_0x4f41a8){var _0xaa7ca0=this;return new Promise(function(_0x4ea258,_0x2ff99a){return db[_0xcfe3('0x13')][_0xcfe3('0x14')](_0x4f41a8[_0xcfe3('0x15')],{'raw':_0x4f41a8[_0xcfe3('0x16')]?_0x4f41a8['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4f41a8[_0xcfe3('0x16')]?_0x4f41a8[_0xcfe3('0x16')]['where']||null:null,'attributes':_0x4f41a8[_0xcfe3('0x16')]?_0x4f41a8[_0xcfe3('0x16')][_0xcfe3('0x17')]||null:null,'limit':_0x4f41a8[_0xcfe3('0x16')]?_0x4f41a8[_0xcfe3('0x16')]['limit']||null:null})[_0xcfe3('0x18')](function(_0x4ac4df){logger[_0xcfe3('0x9')](_0xcfe3('0x19'),_0x4f41a8);logger[_0xcfe3('0xb')](_0xcfe3('0x19'),_0x4f41a8,JSON[_0xcfe3('0xd')](_0x4ac4df));_0x4ea258(_0x4ac4df);})[_0xcfe3('0x12')](function(_0x398742){logger[_0xcfe3('0xe')](_0xcfe3('0x19'),_0x398742[_0xcfe3('0x10')],_0x4f41a8);_0x2ff99a(_0xaa7ca0[_0xcfe3('0xe')](0x1f4,_0x398742[_0xcfe3('0x10')]));});});}; \ No newline at end of file +var _0x4abc=['raw','attributes','limit','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','MailApplication,\x20%s,\x20%s','debug','MailApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','UpdateMailApplication','MailApplication','body','options'];(function(_0x36d2fd,_0x396682){var _0x27709a=function(_0x2ab76e){while(--_0x2ab76e){_0x36d2fd['push'](_0x36d2fd['shift']());}};_0x27709a(++_0x396682);}(_0x4abc,0x1d3));var _0xc4ab=function(_0x616290,_0x280b7f){_0x616290=_0x616290-0x0;var _0x453879=_0x4abc[_0x616290];return _0x453879;};'use strict';var _=require(_0xc4ab('0x0'));var util=require(_0xc4ab('0x1'));var moment=require(_0xc4ab('0x2'));var BPromise=require('bluebird');var rs=require(_0xc4ab('0x3'));var fs=require('fs');var Redis=require(_0xc4ab('0x4'));var db=require(_0xc4ab('0x5'))['db'];var utils=require(_0xc4ab('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xc4ab('0x7'));var jayson=require(_0xc4ab('0x8'));var client=jayson[_0xc4ab('0x9')][_0xc4ab('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x280c6d,_0x18248c,_0xe86321){return new BPromise(function(_0x43350c,_0x5dbedc){return client[_0xc4ab('0xb')](_0x280c6d,_0xe86321)[_0xc4ab('0xc')](function(_0x9ade5c){logger[_0xc4ab('0xd')](_0xc4ab('0xe'),_0x18248c,'request\x20sent');logger[_0xc4ab('0xf')](_0xc4ab('0x10'),_0x18248c,_0xc4ab('0x11'),JSON[_0xc4ab('0x12')](_0x9ade5c));if(_0x9ade5c[_0xc4ab('0x13')]){if(_0x9ade5c['error']['code']===0x1f4){logger[_0xc4ab('0x13')]('MailApplication,\x20%s,\x20%s',_0x18248c,_0x9ade5c[_0xc4ab('0x13')][_0xc4ab('0x14')]);return _0x5dbedc(_0x9ade5c[_0xc4ab('0x13')]['message']);}logger['error'](_0xc4ab('0xe'),_0x18248c,_0x9ade5c[_0xc4ab('0x13')][_0xc4ab('0x14')]);return _0x43350c(_0x9ade5c[_0xc4ab('0x13')]['message']);}else{logger[_0xc4ab('0xd')]('MailApplication,\x20%s,\x20%s',_0x18248c,_0xc4ab('0x11'));_0x43350c(_0x9ade5c['result'][_0xc4ab('0x14')]);}})[_0xc4ab('0x15')](function(_0x56832d){logger[_0xc4ab('0x13')](_0xc4ab('0xe'),_0x18248c,_0x56832d);_0x5dbedc(_0x56832d);});});}exports[_0xc4ab('0x16')]=function(_0x340996){var _0xd29e98=this;return new Promise(function(_0x5113eb,_0x50ac58){return db[_0xc4ab('0x17')]['update'](_0x340996[_0xc4ab('0x18')],{'raw':_0x340996[_0xc4ab('0x19')]?_0x340996['options'][_0xc4ab('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x340996[_0xc4ab('0x19')]?_0x340996[_0xc4ab('0x19')]['where']||null:null,'attributes':_0x340996[_0xc4ab('0x19')]?_0x340996['options'][_0xc4ab('0x1b')]||null:null,'limit':_0x340996['options']?_0x340996[_0xc4ab('0x19')][_0xc4ab('0x1c')]||null:null})['then'](function(_0xb5ea3d){logger[_0xc4ab('0xd')]('UpdateMailApplication',_0x340996);logger[_0xc4ab('0xf')](_0xc4ab('0x16'),_0x340996,JSON[_0xc4ab('0x12')](_0xb5ea3d));_0x5113eb(_0xb5ea3d);})[_0xc4ab('0x15')](function(_0x1e5eb6){logger[_0xc4ab('0x13')](_0xc4ab('0x16'),_0x1e5eb6[_0xc4ab('0x14')],_0x340996);_0x50ac58(_0xd29e98['error'](0x1f4,_0x1e5eb6[_0xc4ab('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/index.js b/server/api/mailInteraction/index.js index d26c319..4892664 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 _0xaab0=['/:id','show','/:id/messages','/:id/download','download','post','create','/:id/tags','tracked','mail','mailinteraction:addtags','put','mailinteraction:update','delete','mailinteraction:destroy','destroy','removeTags','express','Router','../../components/interaction/service','get','isAuthenticated','/describe','describe'];(function(_0x4a81a0,_0x432dcf){var _0x1016b5=function(_0x12f7fb){while(--_0x12f7fb){_0x4a81a0['push'](_0x4a81a0['shift']());}};_0x1016b5(++_0x432dcf);}(_0xaab0,0x1c1));var _0x0aab=function(_0x590a38,_0x2bc65c){_0x590a38=_0x590a38-0x0;var _0xf36626=_0xaab0[_0x590a38];return _0xf36626;};'use strict';var express=require(_0x0aab('0x0'));var router=express[_0x0aab('0x1')]();var auth=require('../../components/auth/service');var interaction=require(_0x0aab('0x2'));var controller=require('./mailInteraction.controller');router[_0x0aab('0x3')]('/',auth[_0x0aab('0x4')](),controller['index']);router[_0x0aab('0x3')](_0x0aab('0x5'),auth[_0x0aab('0x4')](),controller[_0x0aab('0x6')]);router[_0x0aab('0x3')](_0x0aab('0x7'),auth[_0x0aab('0x4')](),controller[_0x0aab('0x8')]);router[_0x0aab('0x3')](_0x0aab('0x9'),auth[_0x0aab('0x4')](),controller['getMessages']);router[_0x0aab('0x3')](_0x0aab('0xa'),auth[_0x0aab('0x4')](),controller[_0x0aab('0xb')]);router[_0x0aab('0xc')]('/',auth['isAuthenticated'](),controller[_0x0aab('0xd')]);router['post']('/:id/messages',auth[_0x0aab('0x4')](),controller['addMessage']);router[_0x0aab('0xc')](_0x0aab('0xe'),auth[_0x0aab('0x4')](),interaction[_0x0aab('0xf')](_0x0aab('0x10'),_0x0aab('0x11')),controller['addTags']);router[_0x0aab('0x12')](_0x0aab('0x7'),auth[_0x0aab('0x4')](),interaction['tracked'](_0x0aab('0x10'),_0x0aab('0x13')),controller['update']);router[_0x0aab('0x14')](_0x0aab('0x7'),auth[_0x0aab('0x4')](),interaction[_0x0aab('0xf')](_0x0aab('0x10'),_0x0aab('0x15')),controller[_0x0aab('0x16')]);router['delete'](_0x0aab('0xe'),auth[_0x0aab('0x4')](),controller[_0x0aab('0x17')]);module['exports']=router; \ No newline at end of file +var _0x53d1=['./mailInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/messages','getMessages','/:id/download','download','post','create','addMessage','tracked','mail','mailinteraction:addtags','addTags','put','update','delete','mailinteraction:destroy','destroy','/:id/tags','removeTags','exports','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x46ea03,_0x2d8bba){var _0x2dcb30=function(_0x3b724d){while(--_0x3b724d){_0x46ea03['push'](_0x46ea03['shift']());}};_0x2dcb30(++_0x2d8bba);}(_0x53d1,0x1cd));var _0x153d=function(_0x2ccfdc,_0xbcdd9c){_0x2ccfdc=_0x2ccfdc-0x0;var _0x98bdb=_0x53d1[_0x2ccfdc];return _0x98bdb;};'use strict';var express=require(_0x153d('0x0'));var router=express[_0x153d('0x1')]();var auth=require(_0x153d('0x2'));var interaction=require(_0x153d('0x3'));var controller=require(_0x153d('0x4'));router[_0x153d('0x5')]('/',auth[_0x153d('0x6')](),controller[_0x153d('0x7')]);router[_0x153d('0x5')](_0x153d('0x8'),auth['isAuthenticated'](),controller[_0x153d('0x9')]);router['get'](_0x153d('0xa'),auth['isAuthenticated'](),controller[_0x153d('0xb')]);router[_0x153d('0x5')](_0x153d('0xc'),auth[_0x153d('0x6')](),controller[_0x153d('0xd')]);router[_0x153d('0x5')](_0x153d('0xe'),auth[_0x153d('0x6')](),controller[_0x153d('0xf')]);router[_0x153d('0x10')]('/',auth['isAuthenticated'](),controller[_0x153d('0x11')]);router['post'](_0x153d('0xc'),auth['isAuthenticated'](),controller[_0x153d('0x12')]);router['post']('/:id/tags',auth[_0x153d('0x6')](),interaction[_0x153d('0x13')](_0x153d('0x14'),_0x153d('0x15')),controller[_0x153d('0x16')]);router[_0x153d('0x17')](_0x153d('0xa'),auth[_0x153d('0x6')](),interaction[_0x153d('0x13')]('mail','mailinteraction:update'),controller[_0x153d('0x18')]);router[_0x153d('0x19')]('/:id',auth['isAuthenticated'](),interaction['tracked'](_0x153d('0x14'),_0x153d('0x1a')),controller[_0x153d('0x1b')]);router[_0x153d('0x19')](_0x153d('0x1c'),auth[_0x153d('0x6')](),controller[_0x153d('0x1d')]);module[_0x153d('0x1e')]=router; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.attributes.js b/server/api/mailInteraction/mailInteraction.attributes.js index f70cfc5..020763c 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 _0xf725=['iconv','exports','BOOLEAN','DATE','STRING','TEXT','long','ENUM','out'];(function(_0x5000e2,_0x4f932f){var _0x3e5e23=function(_0x54dca4){while(--_0x54dca4){_0x5000e2['push'](_0x5000e2['shift']());}};_0x3e5e23(++_0x4f932f);}(_0xf725,0x1cb));var _0x5f72=function(_0x264737,_0x3181bd){_0x264737=_0x264737-0x0;var _0x11ea14=_0xf725[_0x264737];return _0x11ea14;};'use strict';var Sequelize=require('sequelize');var iconv=require(_0x5f72('0x0'));module[_0x5f72('0x1')]={'closed':{'type':Sequelize[_0x5f72('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x5f72('0x3')]},'disposition':{'type':Sequelize[_0x5f72('0x4')]},'secondDisposition':{'type':Sequelize[_0x5f72('0x4')]},'thirdDisposition':{'type':Sequelize[_0x5f72('0x4')]},'note':{'type':Sequelize[_0x5f72('0x4')]},'inReplyTo':{'type':Sequelize[_0x5f72('0x4')](0x1fe)},'to':{'type':Sequelize[_0x5f72('0x4')]},'cc':{'type':Sequelize[_0x5f72('0x5')](_0x5f72('0x6'))},'subject':{'type':Sequelize[_0x5f72('0x5')]()},'attach':{'type':Sequelize[_0x5f72('0x2')],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0x5f72('0x3')]},'substatus':{'type':Sequelize[_0x5f72('0x4')](0x3c)},'substatusAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize[_0x5f72('0x7')]('in',_0x5f72('0x8')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x5f72('0x3')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x5f72('0x8')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x5f72('0x2')],'defaultValue':![]},'queueId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0xa1bb=['STRING','TEXT','DATE','ENUM','out','INTEGER','sequelize','iconv','exports','BOOLEAN'];(function(_0x19367c,_0x3171eb){var _0x38e585=function(_0x5b90bb){while(--_0x5b90bb){_0x19367c['push'](_0x19367c['shift']());}};_0x38e585(++_0x3171eb);}(_0xa1bb,0x7e));var _0xba1b=function(_0x51aa49,_0x15456c){_0x51aa49=_0x51aa49-0x0;var _0x4fbe2c=_0xa1bb[_0x51aa49];return _0x4fbe2c;};'use strict';var Sequelize=require(_0xba1b('0x0'));var iconv=require(_0xba1b('0x1'));module[_0xba1b('0x2')]={'closed':{'type':Sequelize[_0xba1b('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0xba1b('0x4')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0xba1b('0x4')]},'note':{'type':Sequelize[_0xba1b('0x4')]},'inReplyTo':{'type':Sequelize[_0xba1b('0x4')](0x1fe)},'to':{'type':Sequelize[_0xba1b('0x4')]},'cc':{'type':Sequelize[_0xba1b('0x5')]('long')},'subject':{'type':Sequelize[_0xba1b('0x5')]()},'attach':{'type':Sequelize[_0xba1b('0x3')],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0xba1b('0x6')]},'substatus':{'type':Sequelize['STRING'](0x3c)},'substatusAt':{'type':Sequelize[_0xba1b('0x6')]},'firstMsgDirection':{'type':Sequelize[_0xba1b('0x7')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xba1b('0x6')]},'lastMsgDirection':{'type':Sequelize[_0xba1b('0x7')]('in',_0xba1b('0x8')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xba1b('0x3')],'defaultValue':![]},'queueId':{'type':Sequelize[_0xba1b('0x9')]}}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.controller.js b/server/api/mailInteraction/mailInteraction.controller.js index e68a4db..27fda6e 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 _0x5fc9=['Messages','from','bcc','createdAt','get','each','missing.recipient@your.company.com','subject','decode','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','basename','existsSync','build','writeFileSync','unlinkSync','eml-format','zip-dir','moment','util','lodash','juice','ioredis','../../components/interaction/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','html-entities','redis','defaults','localhost','socket.io-emitter','sendStatus','end','json','offset','undefined','limit','count','status','set','Content-Range','destroy','then','error','stack','name','send','map','MailInteraction','fieldName','type','getOptions','mail','user','catch','show','params','model','rawAttributes','keys','query','filters','intersection','attributes','fields','length','include','merge','create','body','update','find','describe','addMessage','MailMessage','omit','getMessages','findOne','hasOwnProperty','nolimit','order','sort','where','MailInteractionId','filter','$gte','format','options','findAll','inlineCss','true','rows','addTags','setTags','ids','spread','Tag','color','mailInteractionTags:save','removeTags','download','root','files','tmp','join','server','transcript-%d-%s.zip','attachments','push','Attachments'];(function(_0x1a25c9,_0x474716){var _0x39aced=function(_0x55566d){while(--_0x55566d){_0x1a25c9['push'](_0x1a25c9['shift']());}};_0x39aced(++_0x474716);}(_0x5fc9,0x83));var _0x95fc=function(_0x38751b,_0x358c4c){_0x38751b=_0x38751b-0x0;var _0x368506=_0x5fc9[_0x38751b];return _0x368506;};'use strict';var emlformat=require(_0x95fc('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x95fc('0x1'));var moment=require(_0x95fc('0x2'));var BPromise=require('bluebird');var util=require(_0x95fc('0x3'));var path=require('path');var fs=require('fs');var _=require(_0x95fc('0x4'));var juice=require(_0x95fc('0x5'));var Redis=require(_0x95fc('0x6'));var interaction=require(_0x95fc('0x7'));var qs=require(_0x95fc('0x8'));var logger=require(_0x95fc('0x9'))(_0x95fc('0xa'));var config=require(_0x95fc('0xb'));var db=require(_0x95fc('0xc'))['db'];var htmlEntities=require(_0x95fc('0xd'));config[_0x95fc('0xe')]=_[_0x95fc('0xf')](config[_0x95fc('0xe')],{'host':_0x95fc('0x10'),'port':0x18eb});var socket=require(_0x95fc('0x11'))(new Redis(config['redis']));require('./mailInteraction.socket')['register'](socket);function respondWithStatusCode(_0x2fe4b1,_0xce0999){_0xce0999=_0xce0999||0xcc;return function(_0x2ec0e4){if(_0x2ec0e4){return _0x2fe4b1[_0x95fc('0x12')](_0xce0999);}return _0x2fe4b1['status'](_0xce0999)[_0x95fc('0x13')]();};}function respondWithResult(_0x15a13b,_0x5206fe){_0x5206fe=_0x5206fe||0xc8;return function(_0xfce20f){if(_0xfce20f){return _0x15a13b['status'](_0x5206fe)[_0x95fc('0x14')](_0xfce20f);}};}function respondWithFilteredResult(_0x3d9a27,_0x33abca){return function(_0x3ec2df){if(_0x3ec2df){var _0x4d6ec8=typeof _0x33abca[_0x95fc('0x15')]===_0x95fc('0x16')&&typeof _0x33abca[_0x95fc('0x17')]===_0x95fc('0x16');var _0x4ace72=_0x3ec2df['count'];var _0x4b1286=_0x4d6ec8?0x0:_0x33abca[_0x95fc('0x15')];var _0x39e87e=_0x4d6ec8?_0x3ec2df[_0x95fc('0x18')]:_0x33abca[_0x95fc('0x15')]+_0x33abca['limit'];var _0x2791df;if(_0x39e87e>=_0x4ace72){_0x39e87e=_0x4ace72;_0x2791df=0xc8;}else{_0x2791df=0xce;}_0x3d9a27[_0x95fc('0x19')](_0x2791df);return _0x3d9a27[_0x95fc('0x1a')](_0x95fc('0x1b'),_0x4b1286+'-'+_0x39e87e+'/'+_0x4ace72)[_0x95fc('0x14')](_0x3ec2df);}return null;};}function saveUpdates(_0x5e3599){return function(_0x34bd13){if(_0x34bd13){return _0x34bd13['update'](_0x5e3599)['then'](function(_0x12c57a){return _0x12c57a;});}return null;};}function removeEntity(_0x248a11){return function(_0x8731ed){if(_0x8731ed){return _0x8731ed[_0x95fc('0x1c')]()[_0x95fc('0x1d')](function(){_0x248a11[_0x95fc('0x19')](0xcc)[_0x95fc('0x13')]();});}};}function handleEntityNotFound(_0x23aea3){return function(_0x353279){if(!_0x353279){_0x23aea3[_0x95fc('0x12')](0x194);}return _0x353279;};}function handleError(_0x1e081d,_0x18c4d9){_0x18c4d9=_0x18c4d9||0x1f4;return function(_0x2c08b9){logger[_0x95fc('0x1e')](_0x2c08b9[_0x95fc('0x1f')]);if(_0x2c08b9[_0x95fc('0x20')]){delete _0x2c08b9[_0x95fc('0x20')];}_0x1e081d[_0x95fc('0x19')](_0x18c4d9)[_0x95fc('0x21')](_0x2c08b9);};}exports['index']=function(_0x1d0b33,_0x5da635){var _0x3ff0d6={};var _0x1f3c92=_[_0x95fc('0x22')](db[_0x95fc('0x23')]['rawAttributes'],function(_0x2af273){return{'name':_0x2af273[_0x95fc('0x24')],'type':_0x2af273[_0x95fc('0x25')]['key']};});_0x3ff0d6=qs[_0x95fc('0x26')](_0x1f3c92,_0x1d0b33);return interaction['findAll'](_0x95fc('0x27'),_0x1d0b33['query'],_0x1d0b33[_0x95fc('0x28')],_0x3ff0d6,_0x1f3c92)['then'](respondWithFilteredResult(_0x5da635,_0x3ff0d6))[_0x95fc('0x29')](handleError(_0x5da635,null));};exports[_0x95fc('0x2a')]=function(_0x122b82,_0x439f82){var _0x5dab5a={'raw':![],'where':{'id':_0x122b82[_0x95fc('0x2b')]['id']}},_0x188ec4={};_0x188ec4[_0x95fc('0x2c')]=_['keys'](db[_0x95fc('0x23')][_0x95fc('0x2d')]);_0x188ec4['query']=_[_0x95fc('0x2e')](_0x122b82[_0x95fc('0x2f')]);_0x188ec4[_0x95fc('0x30')]=_[_0x95fc('0x31')](_0x188ec4['model'],_0x188ec4[_0x95fc('0x2f')]);_0x5dab5a[_0x95fc('0x32')]=_[_0x95fc('0x31')](_0x188ec4[_0x95fc('0x2c')],qs[_0x95fc('0x33')](_0x122b82['query'][_0x95fc('0x33')]));_0x5dab5a['attributes']=_0x5dab5a['attributes'][_0x95fc('0x34')]?_0x5dab5a[_0x95fc('0x32')]:_0x188ec4[_0x95fc('0x2c')];if(_0x122b82[_0x95fc('0x2f')]['includeAll']){_0x5dab5a[_0x95fc('0x35')]=[{'all':!![]}];}_0x5dab5a=_[_0x95fc('0x36')]({},_0x5dab5a,_0x122b82['options']);return db[_0x95fc('0x23')]['find'](_0x5dab5a)[_0x95fc('0x1d')](handleEntityNotFound(_0x439f82,null))[_0x95fc('0x1d')](respondWithResult(_0x439f82,null))['catch'](handleError(_0x439f82,null));};exports[_0x95fc('0x37')]=function(_0x231854,_0x2db781){return db['MailInteraction'][_0x95fc('0x37')](_0x231854[_0x95fc('0x38')],{})[_0x95fc('0x1d')](respondWithResult(_0x2db781,0xc9))[_0x95fc('0x29')](handleError(_0x2db781,null));};exports[_0x95fc('0x39')]=function(_0x46a652,_0x10f0b4){if(_0x46a652[_0x95fc('0x38')]['id']){delete _0x46a652[_0x95fc('0x38')]['id'];}return db[_0x95fc('0x23')]['find']({'where':{'id':_0x46a652['params']['id']}})[_0x95fc('0x1d')](handleEntityNotFound(_0x10f0b4,null))['then'](saveUpdates(_0x46a652[_0x95fc('0x38')],null))[_0x95fc('0x1d')](respondWithResult(_0x10f0b4,null))[_0x95fc('0x29')](handleError(_0x10f0b4,null));};exports['destroy']=function(_0xe1f8aa,_0x4e59ad){return db[_0x95fc('0x23')][_0x95fc('0x3a')]({'where':{'id':_0xe1f8aa['params']['id']}})['then'](handleEntityNotFound(_0x4e59ad,null))[_0x95fc('0x1d')](removeEntity(_0x4e59ad,null))[_0x95fc('0x29')](handleError(_0x4e59ad,null));};exports[_0x95fc('0x3b')]=function(_0x3de9d2,_0x1a22f4){return db['MailInteraction'][_0x95fc('0x3b')]()['then'](respondWithResult(_0x1a22f4,null))[_0x95fc('0x29')](handleError(_0x1a22f4,null));};exports[_0x95fc('0x3c')]=function(_0x189b17,_0x2ca001){return db[_0x95fc('0x3d')][_0x95fc('0x3a')]({'where':{'id':_0x189b17['params']['id']}})[_0x95fc('0x1d')](handleEntityNotFound(_0x2ca001,null))[_0x95fc('0x1d')](function(_0xfcd156){if(_0xfcd156){return _0xfcd156[_0x95fc('0x3c')](_0x189b17[_0x95fc('0x38')]['ids'],_[_0x95fc('0x3e')](_0x189b17[_0x95fc('0x38')],['ids','id'])||{});}})[_0x95fc('0x1d')](respondWithResult(_0x2ca001,null))[_0x95fc('0x29')](handleError(_0x2ca001,null));};exports[_0x95fc('0x3f')]=function(_0x29838e,_0x5a94e4){var _0x32f333={'raw':![],'where':{}};var _0x38163c={};var _0x47c78f={'count':0x0,'rows':[]};return db['MailInteraction'][_0x95fc('0x40')]({'where':{'id':_0x29838e['params']['id']}})['then'](handleEntityNotFound(_0x5a94e4,null))[_0x95fc('0x1d')](function(_0x2a5228){if(_0x2a5228){_0x38163c[_0x95fc('0x2c')]=_[_0x95fc('0x2e')](db[_0x95fc('0x3d')][_0x95fc('0x2d')]);_0x38163c['query']=_['keys'](_0x29838e[_0x95fc('0x2f')]);_0x38163c[_0x95fc('0x30')]=_[_0x95fc('0x31')](_0x38163c[_0x95fc('0x2c')],_0x38163c[_0x95fc('0x2f')]);_0x32f333[_0x95fc('0x32')]=_[_0x95fc('0x31')](_0x38163c[_0x95fc('0x2c')],qs[_0x95fc('0x33')](_0x29838e[_0x95fc('0x2f')][_0x95fc('0x33')]));_0x32f333[_0x95fc('0x32')]=_0x32f333[_0x95fc('0x32')][_0x95fc('0x34')]?_0x32f333[_0x95fc('0x32')]:_0x38163c[_0x95fc('0x2c')];if(!_0x29838e[_0x95fc('0x2f')][_0x95fc('0x41')](_0x95fc('0x42'))){_0x32f333[_0x95fc('0x17')]=qs['limit'](_0x29838e['query'][_0x95fc('0x17')]);_0x32f333['offset']=qs[_0x95fc('0x15')](_0x29838e[_0x95fc('0x2f')][_0x95fc('0x15')]);}_0x32f333[_0x95fc('0x43')]=qs['sort'](_0x29838e[_0x95fc('0x2f')][_0x95fc('0x44')]);_0x32f333[_0x95fc('0x45')]=qs['filters'](_['pick'](_0x29838e[_0x95fc('0x2f')],_0x38163c[_0x95fc('0x30')]));_0x32f333[_0x95fc('0x45')][_0x95fc('0x46')]=_0x2a5228['id'];if(_0x29838e[_0x95fc('0x2f')][_0x95fc('0x47')]){_0x32f333[_0x95fc('0x45')]=_['merge'](_0x32f333['where'],{'$or':_[_0x95fc('0x22')](_0x32f333[_0x95fc('0x32')],function(_0x3a24bc){var _0x42dc35={};_0x42dc35[_0x3a24bc]={'$like':'%'+_0x29838e['query'][_0x95fc('0x47')]+'%'};return _0x42dc35;})});}if(_0x29838e[_0x95fc('0x2f')][_0x95fc('0x48')]){var _0x3e4b83=_0x29838e['query'][_0x95fc('0x48')]['split'](',');var _0x499c28={};_0x499c28[_0x3e4b83[0x0]]={'$gte':moment(_0x3e4b83[0x1])[_0x95fc('0x49')]('YYYY-MM-DD\x20HH:mm:ss')};_0x32f333[_0x95fc('0x45')]=_[_0x95fc('0x36')](_0x32f333[_0x95fc('0x45')],_0x499c28);}_0x32f333=_[_0x95fc('0x36')]({},_0x32f333,_0x29838e[_0x95fc('0x4a')]);return db['MailMessage'][_0x95fc('0x18')]({'where':_0x32f333['where']})[_0x95fc('0x1d')](function(_0x30951f){_0x47c78f[_0x95fc('0x18')]=_0x30951f;if(_0x29838e[_0x95fc('0x2f')]['includeAll']){_0x32f333[_0x95fc('0x35')]=[{'all':!![]}];}return db[_0x95fc('0x3d')][_0x95fc('0x4b')](_0x32f333);})['then'](function(_0x4ac29c){if(_0x29838e[_0x95fc('0x2f')][_0x95fc('0x4c')]===_0x95fc('0x4d')){for(var _0x3f09e6=0x0;_0x3f09e6<_0x4ac29c['length'];_0x3f09e6++){_0x4ac29c[_0x3f09e6][_0x95fc('0x38')]=juice(_0x4ac29c[_0x3f09e6][_0x95fc('0x38')]);}}_0x47c78f[_0x95fc('0x4e')]=_0x4ac29c;return _0x47c78f;});}})[_0x95fc('0x1d')](respondWithFilteredResult(_0x5a94e4,_0x32f333))[_0x95fc('0x29')](handleError(_0x5a94e4,null));};exports[_0x95fc('0x4f')]=function(_0x1184b6,_0x4583f6){return db[_0x95fc('0x23')]['find']({'where':{'id':_0x1184b6['params']['id']}})[_0x95fc('0x1d')](handleEntityNotFound(_0x4583f6,null))[_0x95fc('0x1d')](function(_0x32f4a9){if(_0x32f4a9){return _0x32f4a9[_0x95fc('0x50')](_0x1184b6[_0x95fc('0x38')][_0x95fc('0x51')],_[_0x95fc('0x3e')](_0x1184b6[_0x95fc('0x38')],['ids','id'])||{})[_0x95fc('0x52')](function(){return db[_0x95fc('0x53')]['findAll']({'attributes':['id',_0x95fc('0x20'),_0x95fc('0x54')],'where':{'id':_0x1184b6['body']['ids']}});})[_0x95fc('0x1d')](function(_0x45e1ef){socket['emit'](_0x95fc('0x55'),{'id':Number(_0x1184b6[_0x95fc('0x2b')]['id']),'tags':_0x45e1ef||[]});return{'id':Number(_0x1184b6[_0x95fc('0x2b')]['id']),'tags':_0x45e1ef||[]};});}})[_0x95fc('0x1d')](respondWithResult(_0x4583f6,null))[_0x95fc('0x29')](handleError(_0x4583f6,null));};exports['removeTags']=function(_0x2b8eb6,_0x226774){return db[_0x95fc('0x23')]['find']({'where':{'id':_0x2b8eb6[_0x95fc('0x2b')]['id']}})[_0x95fc('0x1d')](handleEntityNotFound(_0x226774,null))['then'](function(_0x39df78){if(_0x39df78){return _0x39df78[_0x95fc('0x56')](_0x2b8eb6['query'][_0x95fc('0x51')]);}})[_0x95fc('0x1d')](respondWithStatusCode(_0x226774,null))[_0x95fc('0x29')](handleError(_0x226774,null));};exports[_0x95fc('0x57')]=function(_0xc44c27,_0xe2fe18){var _0x20ec4f=moment()['unix']()['toString']();var _0x41a6d6=path['join'](config[_0x95fc('0x58')],'server',_0x95fc('0x59'),_0x95fc('0x5a'));var _0x38fbd7=path[_0x95fc('0x5b')](config[_0x95fc('0x58')],_0x95fc('0x5c'),_0x95fc('0x59'),'attachments');var _0xf4470f=path[_0x95fc('0x5b')](_0x41a6d6,_0x20ec4f);var _0x3055e9=util['format'](_0x95fc('0x5d'),_0xc44c27[_0x95fc('0x2b')]['id'],_0x20ec4f);var _0xdee701=path['join'](_0x41a6d6,_0x3055e9);var _0xb0bf00=[];if(_0xc44c27['query'][_0x95fc('0x5e')]){_0xb0bf00[_0x95fc('0x5f')]({'model':db['Attachment'],'as':_0x95fc('0x60'),'raw':!![]});}var _0x1a68fb=[{'model':db[_0x95fc('0x3d')],'as':_0x95fc('0x61'),'attributes':['id','body',_0x95fc('0x62'),'to','cc',_0x95fc('0x63'),'subject',_0x95fc('0x64')],'where':{'secret':![]},'order':qs[_0x95fc('0x44')]('id'),'include':_0xb0bf00}];return db[_0x95fc('0x23')]['find']({'where':{'id':_0xc44c27['params']['id']},'include':_0x1a68fb})[_0x95fc('0x1d')](handleEntityNotFound(_0xe2fe18,null))[_0x95fc('0x1d')](function(_0xfd304c){if(_0xfd304c&&_0xfd304c['Messages']){var _0x20b53a=_0xfd304c[_0x95fc('0x65')]({'plain':!![]});fs['mkdirSync'](_0xf4470f);return BPromise[_0x95fc('0x66')](_0x20b53a[_0x95fc('0x61')],function(_0x5117d5,_0x35bfc2){var _0x8ab3ee={'from':_0x5117d5['from'],'to':_0x5117d5['to']||_0x95fc('0x67'),'subject':_0x5117d5[_0x95fc('0x68')],'html':htmlEntities[_0x95fc('0x69')](_0x5117d5[_0x95fc('0x38')]),'headers':{'Date':moment(_0x5117d5['createdAt'])[_0x95fc('0x49')](_0x95fc('0x6a'))},'attachments':[]};if(_0x5117d5['cc']){_0x8ab3ee[_0x95fc('0x6b')]['Cc']=_0x5117d5['cc'];}if(_0x5117d5[_0x95fc('0x63')]){_0x8ab3ee['headers'][_0x95fc('0x6c')]=_0x5117d5['bcc'];}return new BPromise(function(_0x1d5443,_0x213aea){if(_0x5117d5[_0x95fc('0x60')]){for(var _0x358b2f=0x0;_0x358b2f<_0x5117d5['Attachments']['length'];_0x358b2f++){var _0xb3359c=_0x5117d5['Attachments'][_0x358b2f];var _0x1361d1=path[_0x95fc('0x5b')](_0x38fbd7,_0xb3359c[_0x95fc('0x6d')]);if(fs[_0x95fc('0x6e')](_0x1361d1)){_0x8ab3ee[_0x95fc('0x5e')][_0x95fc('0x5f')]({'name':_0xb3359c[_0x95fc('0x20')],'contentType':_0xb3359c[_0x95fc('0x25')],'data':fs['readFileSync'](_0x1361d1)});}}}emlformat[_0x95fc('0x6f')](_0x8ab3ee,function(_0x3666b2,_0xd465f7){if(_0x3666b2)return _0x213aea(_0x3666b2);fs[_0x95fc('0x70')](path[_0x95fc('0x5b')](_0xf4470f,util[_0x95fc('0x49')]('message%d.eml',_0x35bfc2)),_0xd465f7);return _0x1d5443(_0xd465f7);});});})['then'](function(){return new BPromise(function(_0x51d08c,_0x5c408c){zipdir(_0xf4470f,{'saveTo':_0xdee701},function(_0x5b2559,_0x4bd717){if(_0x5b2559)return _0x5c408c(_0x5b2559);return _0x51d08c(_0x4bd717);});})['then'](function(){return new BPromise(function(_0x5af82a,_0x157df9){rimraf(_0xf4470f,function(_0x497f19){if(_0x497f19)_0x157df9(_0x497f19);return _0x5af82a();});});})[_0x95fc('0x1d')](function(){return _0xe2fe18[_0x95fc('0x57')](_0xdee701,_0x3055e9,function(_0x44eb26){if(!_0x44eb26)fs[_0x95fc('0x71')](_0xdee701);});});});}else{return _0xe2fe18[_0x95fc('0x12')](0xc8);}})[_0x95fc('0x29')](handleError(_0xe2fe18,null));}; \ No newline at end of file +var _0x71e0=['Attachments','Messages','from','subject','get','mkdirSync','each','missing.recipient@your.company.com','decode','createdAt','bcc','Bcc','existsSync','attachments','build','writeFileSync','message%d.eml','unlinkSync','eml-format','rimraf','bluebird','util','path','lodash','ioredis','../../components/interaction/service','../../config/environment','../../mysqldb','html-entities','defaults','localhost','socket.io-emitter','redis','./mailInteraction.socket','register','sendStatus','status','end','offset','undefined','count','limit','Content-Range','destroy','then','error','stack','name','send','map','MailInteraction','rawAttributes','fieldName','type','getOptions','query','user','catch','show','params','model','keys','filters','intersection','attributes','fields','length','includeAll','merge','options','create','update','body','find','describe','addMessage','MailMessage','ids','getMessages','findOne','nolimit','sort','where','pick','MailInteractionId','filter','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','include','findAll','inlineCss','true','setTags','omit','emit','mailInteractionTags:save','download','unix','toString','join','root','server','files','tmp','transcript-%d-%s.zip','push','Attachment'];(function(_0x4d5721,_0x51a33d){var _0x88a224=function(_0x2b2609){while(--_0x2b2609){_0x4d5721['push'](_0x4d5721['shift']());}};_0x88a224(++_0x51a33d);}(_0x71e0,0x159));var _0x071e=function(_0x2b9a8e,_0x4244a2){_0x2b9a8e=_0x2b9a8e-0x0;var _0x5b3edf=_0x71e0[_0x2b9a8e];return _0x5b3edf;};'use strict';var emlformat=require(_0x071e('0x0'));var rimraf=require(_0x071e('0x1'));var zipdir=require('zip-dir');var moment=require('moment');var BPromise=require(_0x071e('0x2'));var util=require(_0x071e('0x3'));var path=require(_0x071e('0x4'));var fs=require('fs');var _=require(_0x071e('0x5'));var juice=require('juice');var Redis=require(_0x071e('0x6'));var interaction=require(_0x071e('0x7'));var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')('api');var config=require(_0x071e('0x8'));var db=require(_0x071e('0x9'))['db'];var htmlEntities=require(_0x071e('0xa'));config['redis']=_[_0x071e('0xb')](config['redis'],{'host':_0x071e('0xc'),'port':0x18eb});var socket=require(_0x071e('0xd'))(new Redis(config[_0x071e('0xe')]));require(_0x071e('0xf'))[_0x071e('0x10')](socket);function respondWithStatusCode(_0x40d44f,_0x19b7fc){_0x19b7fc=_0x19b7fc||0xcc;return function(_0x2bdc24){if(_0x2bdc24){return _0x40d44f[_0x071e('0x11')](_0x19b7fc);}return _0x40d44f[_0x071e('0x12')](_0x19b7fc)[_0x071e('0x13')]();};}function respondWithResult(_0x30dddd,_0x2c29a2){_0x2c29a2=_0x2c29a2||0xc8;return function(_0x305764){if(_0x305764){return _0x30dddd[_0x071e('0x12')](_0x2c29a2)['json'](_0x305764);}};}function respondWithFilteredResult(_0x5939b9,_0x25236f){return function(_0x4eb1f8){if(_0x4eb1f8){var _0x1eb612=typeof _0x25236f[_0x071e('0x14')]===_0x071e('0x15')&&typeof _0x25236f['limit']===_0x071e('0x15');var _0xb13b9d=_0x4eb1f8[_0x071e('0x16')];var _0x5b8e5a=_0x1eb612?0x0:_0x25236f[_0x071e('0x14')];var _0x12a35d=_0x1eb612?_0x4eb1f8[_0x071e('0x16')]:_0x25236f[_0x071e('0x14')]+_0x25236f[_0x071e('0x17')];var _0x57431d;if(_0x12a35d>=_0xb13b9d){_0x12a35d=_0xb13b9d;_0x57431d=0xc8;}else{_0x57431d=0xce;}_0x5939b9[_0x071e('0x12')](_0x57431d);return _0x5939b9['set'](_0x071e('0x18'),_0x5b8e5a+'-'+_0x12a35d+'/'+_0xb13b9d)['json'](_0x4eb1f8);}return null;};}function saveUpdates(_0x28ed18){return function(_0x38ce3a){if(_0x38ce3a){return _0x38ce3a['update'](_0x28ed18)['then'](function(_0x502f5b){return _0x502f5b;});}return null;};}function removeEntity(_0x3cb67a){return function(_0x5071e4){if(_0x5071e4){return _0x5071e4[_0x071e('0x19')]()[_0x071e('0x1a')](function(){_0x3cb67a[_0x071e('0x12')](0xcc)[_0x071e('0x13')]();});}};}function handleEntityNotFound(_0x41d6f3){return function(_0x10cb09){if(!_0x10cb09){_0x41d6f3[_0x071e('0x11')](0x194);}return _0x10cb09;};}function handleError(_0x1997e6,_0x2e7258){_0x2e7258=_0x2e7258||0x1f4;return function(_0x1a0001){logger[_0x071e('0x1b')](_0x1a0001[_0x071e('0x1c')]);if(_0x1a0001[_0x071e('0x1d')]){delete _0x1a0001[_0x071e('0x1d')];}_0x1997e6[_0x071e('0x12')](_0x2e7258)[_0x071e('0x1e')](_0x1a0001);};}exports['index']=function(_0x35b7c3,_0x154af1){var _0x38bbef={};var _0x46bbd6=_[_0x071e('0x1f')](db[_0x071e('0x20')][_0x071e('0x21')],function(_0xbb07e2){return{'name':_0xbb07e2[_0x071e('0x22')],'type':_0xbb07e2[_0x071e('0x23')]['key']};});_0x38bbef=qs[_0x071e('0x24')](_0x46bbd6,_0x35b7c3);return interaction['findAll']('mail',_0x35b7c3[_0x071e('0x25')],_0x35b7c3[_0x071e('0x26')],_0x38bbef,_0x46bbd6)[_0x071e('0x1a')](respondWithFilteredResult(_0x154af1,_0x38bbef))[_0x071e('0x27')](handleError(_0x154af1,null));};exports[_0x071e('0x28')]=function(_0x11adce,_0x50c774){var _0x5f2ce5={'raw':![],'where':{'id':_0x11adce[_0x071e('0x29')]['id']}},_0x282347={};_0x282347[_0x071e('0x2a')]=_[_0x071e('0x2b')](db[_0x071e('0x20')][_0x071e('0x21')]);_0x282347[_0x071e('0x25')]=_[_0x071e('0x2b')](_0x11adce['query']);_0x282347[_0x071e('0x2c')]=_[_0x071e('0x2d')](_0x282347[_0x071e('0x2a')],_0x282347['query']);_0x5f2ce5[_0x071e('0x2e')]=_['intersection'](_0x282347[_0x071e('0x2a')],qs[_0x071e('0x2f')](_0x11adce[_0x071e('0x25')][_0x071e('0x2f')]));_0x5f2ce5['attributes']=_0x5f2ce5[_0x071e('0x2e')][_0x071e('0x30')]?_0x5f2ce5[_0x071e('0x2e')]:_0x282347[_0x071e('0x2a')];if(_0x11adce[_0x071e('0x25')][_0x071e('0x31')]){_0x5f2ce5['include']=[{'all':!![]}];}_0x5f2ce5=_[_0x071e('0x32')]({},_0x5f2ce5,_0x11adce[_0x071e('0x33')]);return db[_0x071e('0x20')]['find'](_0x5f2ce5)['then'](handleEntityNotFound(_0x50c774,null))['then'](respondWithResult(_0x50c774,null))[_0x071e('0x27')](handleError(_0x50c774,null));};exports[_0x071e('0x34')]=function(_0x47b438,_0x1f9e04){return db[_0x071e('0x20')]['create'](_0x47b438['body'],{})[_0x071e('0x1a')](respondWithResult(_0x1f9e04,0xc9))[_0x071e('0x27')](handleError(_0x1f9e04,null));};exports[_0x071e('0x35')]=function(_0xe1365e,_0x3569c7){if(_0xe1365e['body']['id']){delete _0xe1365e[_0x071e('0x36')]['id'];}return db[_0x071e('0x20')][_0x071e('0x37')]({'where':{'id':_0xe1365e[_0x071e('0x29')]['id']}})[_0x071e('0x1a')](handleEntityNotFound(_0x3569c7,null))['then'](saveUpdates(_0xe1365e[_0x071e('0x36')],null))[_0x071e('0x1a')](respondWithResult(_0x3569c7,null))[_0x071e('0x27')](handleError(_0x3569c7,null));};exports['destroy']=function(_0x1f7d7d,_0x280709){return db[_0x071e('0x20')][_0x071e('0x37')]({'where':{'id':_0x1f7d7d[_0x071e('0x29')]['id']}})[_0x071e('0x1a')](handleEntityNotFound(_0x280709,null))[_0x071e('0x1a')](removeEntity(_0x280709,null))[_0x071e('0x27')](handleError(_0x280709,null));};exports[_0x071e('0x38')]=function(_0xf0367f,_0x33efeb){return db['MailInteraction'][_0x071e('0x38')]()[_0x071e('0x1a')](respondWithResult(_0x33efeb,null))['catch'](handleError(_0x33efeb,null));};exports[_0x071e('0x39')]=function(_0x1a786c,_0x95787a){return db[_0x071e('0x3a')][_0x071e('0x37')]({'where':{'id':_0x1a786c['params']['id']}})[_0x071e('0x1a')](handleEntityNotFound(_0x95787a,null))[_0x071e('0x1a')](function(_0x3f24e3){if(_0x3f24e3){return _0x3f24e3[_0x071e('0x39')](_0x1a786c['body']['ids'],_['omit'](_0x1a786c[_0x071e('0x36')],[_0x071e('0x3b'),'id'])||{});}})['then'](respondWithResult(_0x95787a,null))['catch'](handleError(_0x95787a,null));};exports[_0x071e('0x3c')]=function(_0xd2333f,_0x34ec32){var _0x25e0ea={'raw':![],'where':{}};var _0x1c1180={};var _0x5057ce={'count':0x0,'rows':[]};return db[_0x071e('0x20')][_0x071e('0x3d')]({'where':{'id':_0xd2333f[_0x071e('0x29')]['id']}})[_0x071e('0x1a')](handleEntityNotFound(_0x34ec32,null))[_0x071e('0x1a')](function(_0x496dd6){if(_0x496dd6){_0x1c1180['model']=_[_0x071e('0x2b')](db[_0x071e('0x3a')][_0x071e('0x21')]);_0x1c1180['query']=_['keys'](_0xd2333f['query']);_0x1c1180['filters']=_[_0x071e('0x2d')](_0x1c1180[_0x071e('0x2a')],_0x1c1180[_0x071e('0x25')]);_0x25e0ea[_0x071e('0x2e')]=_[_0x071e('0x2d')](_0x1c1180['model'],qs[_0x071e('0x2f')](_0xd2333f['query'][_0x071e('0x2f')]));_0x25e0ea[_0x071e('0x2e')]=_0x25e0ea['attributes'][_0x071e('0x30')]?_0x25e0ea['attributes']:_0x1c1180['model'];if(!_0xd2333f[_0x071e('0x25')]['hasOwnProperty'](_0x071e('0x3e'))){_0x25e0ea[_0x071e('0x17')]=qs[_0x071e('0x17')](_0xd2333f[_0x071e('0x25')][_0x071e('0x17')]);_0x25e0ea[_0x071e('0x14')]=qs[_0x071e('0x14')](_0xd2333f['query'][_0x071e('0x14')]);}_0x25e0ea['order']=qs[_0x071e('0x3f')](_0xd2333f[_0x071e('0x25')][_0x071e('0x3f')]);_0x25e0ea[_0x071e('0x40')]=qs[_0x071e('0x2c')](_[_0x071e('0x41')](_0xd2333f[_0x071e('0x25')],_0x1c1180[_0x071e('0x2c')]));_0x25e0ea[_0x071e('0x40')][_0x071e('0x42')]=_0x496dd6['id'];if(_0xd2333f[_0x071e('0x25')][_0x071e('0x43')]){_0x25e0ea[_0x071e('0x40')]=_['merge'](_0x25e0ea[_0x071e('0x40')],{'$or':_[_0x071e('0x1f')](_0x25e0ea[_0x071e('0x2e')],function(_0x55e29e){var _0x363719={};_0x363719[_0x55e29e]={'$like':'%'+_0xd2333f[_0x071e('0x25')][_0x071e('0x43')]+'%'};return _0x363719;})});}if(_0xd2333f[_0x071e('0x25')][_0x071e('0x44')]){var _0x4bfb18=_0xd2333f[_0x071e('0x25')]['$gte'][_0x071e('0x45')](',');var _0x2991be={};_0x2991be[_0x4bfb18[0x0]]={'$gte':moment(_0x4bfb18[0x1])[_0x071e('0x46')](_0x071e('0x47'))};_0x25e0ea['where']=_[_0x071e('0x32')](_0x25e0ea['where'],_0x2991be);}_0x25e0ea=_[_0x071e('0x32')]({},_0x25e0ea,_0xd2333f[_0x071e('0x33')]);return db[_0x071e('0x3a')][_0x071e('0x16')]({'where':_0x25e0ea['where']})[_0x071e('0x1a')](function(_0x246178){_0x5057ce[_0x071e('0x16')]=_0x246178;if(_0xd2333f[_0x071e('0x25')][_0x071e('0x31')]){_0x25e0ea[_0x071e('0x48')]=[{'all':!![]}];}return db[_0x071e('0x3a')][_0x071e('0x49')](_0x25e0ea);})[_0x071e('0x1a')](function(_0xbe183f){if(_0xd2333f[_0x071e('0x25')][_0x071e('0x4a')]===_0x071e('0x4b')){for(var _0x53d4be=0x0;_0x53d4be<_0xbe183f[_0x071e('0x30')];_0x53d4be++){_0xbe183f[_0x53d4be][_0x071e('0x36')]=juice(_0xbe183f[_0x53d4be][_0x071e('0x36')]);}}_0x5057ce['rows']=_0xbe183f;return _0x5057ce;});}})['then'](respondWithFilteredResult(_0x34ec32,_0x25e0ea))[_0x071e('0x27')](handleError(_0x34ec32,null));};exports['addTags']=function(_0x151a89,_0x1b0640){return db['MailInteraction'][_0x071e('0x37')]({'where':{'id':_0x151a89[_0x071e('0x29')]['id']}})[_0x071e('0x1a')](handleEntityNotFound(_0x1b0640,null))[_0x071e('0x1a')](function(_0x262709){if(_0x262709){return _0x262709[_0x071e('0x4c')](_0x151a89[_0x071e('0x36')][_0x071e('0x3b')],_[_0x071e('0x4d')](_0x151a89[_0x071e('0x36')],[_0x071e('0x3b'),'id'])||{})['spread'](function(){return db['Tag'][_0x071e('0x49')]({'attributes':['id',_0x071e('0x1d'),'color'],'where':{'id':_0x151a89[_0x071e('0x36')][_0x071e('0x3b')]}});})['then'](function(_0x38bf8b){socket[_0x071e('0x4e')](_0x071e('0x4f'),{'id':Number(_0x151a89[_0x071e('0x29')]['id']),'tags':_0x38bf8b||[]});return{'id':Number(_0x151a89['params']['id']),'tags':_0x38bf8b||[]};});}})[_0x071e('0x1a')](respondWithResult(_0x1b0640,null))['catch'](handleError(_0x1b0640,null));};exports['removeTags']=function(_0x47b376,_0x5307ab){return db['MailInteraction'][_0x071e('0x37')]({'where':{'id':_0x47b376[_0x071e('0x29')]['id']}})[_0x071e('0x1a')](handleEntityNotFound(_0x5307ab,null))['then'](function(_0x40d916){if(_0x40d916){return _0x40d916['removeTags'](_0x47b376['query'][_0x071e('0x3b')]);}})[_0x071e('0x1a')](respondWithStatusCode(_0x5307ab,null))['catch'](handleError(_0x5307ab,null));};exports[_0x071e('0x50')]=function(_0x22db6e,_0x1e770d){var _0x425a8f=moment()[_0x071e('0x51')]()[_0x071e('0x52')]();var _0x3db203=path[_0x071e('0x53')](config[_0x071e('0x54')],_0x071e('0x55'),_0x071e('0x56'),_0x071e('0x57'));var _0x1c146b=path[_0x071e('0x53')](config[_0x071e('0x54')],_0x071e('0x55'),_0x071e('0x56'),'attachments');var _0x4dda8b=path[_0x071e('0x53')](_0x3db203,_0x425a8f);var _0x3ef82a=util['format'](_0x071e('0x58'),_0x22db6e[_0x071e('0x29')]['id'],_0x425a8f);var _0x3151bc=path['join'](_0x3db203,_0x3ef82a);var _0x4a21bb=[];if(_0x22db6e[_0x071e('0x25')]['attachments']){_0x4a21bb[_0x071e('0x59')]({'model':db[_0x071e('0x5a')],'as':_0x071e('0x5b'),'raw':!![]});}var _0x3a78d6=[{'model':db[_0x071e('0x3a')],'as':_0x071e('0x5c'),'attributes':['id',_0x071e('0x36'),_0x071e('0x5d'),'to','cc','bcc',_0x071e('0x5e'),'createdAt'],'where':{'secret':![]},'order':qs[_0x071e('0x3f')]('id'),'include':_0x4a21bb}];return db[_0x071e('0x20')][_0x071e('0x37')]({'where':{'id':_0x22db6e[_0x071e('0x29')]['id']},'include':_0x3a78d6})[_0x071e('0x1a')](handleEntityNotFound(_0x1e770d,null))['then'](function(_0x38995a){if(_0x38995a&&_0x38995a[_0x071e('0x5c')]){var _0x400c46=_0x38995a[_0x071e('0x5f')]({'plain':!![]});fs[_0x071e('0x60')](_0x4dda8b);return BPromise[_0x071e('0x61')](_0x400c46[_0x071e('0x5c')],function(_0x4719f7,_0x11bef2){var _0x559969={'from':_0x4719f7[_0x071e('0x5d')],'to':_0x4719f7['to']||_0x071e('0x62'),'subject':_0x4719f7[_0x071e('0x5e')],'html':htmlEntities[_0x071e('0x63')](_0x4719f7['body']),'headers':{'Date':moment(_0x4719f7[_0x071e('0x64')])[_0x071e('0x46')]('ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ')},'attachments':[]};if(_0x4719f7['cc']){_0x559969['headers']['Cc']=_0x4719f7['cc'];}if(_0x4719f7[_0x071e('0x65')]){_0x559969['headers'][_0x071e('0x66')]=_0x4719f7[_0x071e('0x65')];}return new BPromise(function(_0x4b9ce3,_0xe90570){if(_0x4719f7[_0x071e('0x5b')]){for(var _0x4461=0x0;_0x4461<_0x4719f7[_0x071e('0x5b')][_0x071e('0x30')];_0x4461++){var _0x364cd7=_0x4719f7['Attachments'][_0x4461];var _0x47497e=path[_0x071e('0x53')](_0x1c146b,_0x364cd7['basename']);if(fs[_0x071e('0x67')](_0x47497e)){_0x559969[_0x071e('0x68')]['push']({'name':_0x364cd7[_0x071e('0x1d')],'contentType':_0x364cd7[_0x071e('0x23')],'data':fs['readFileSync'](_0x47497e)});}}}emlformat[_0x071e('0x69')](_0x559969,function(_0x395e6b,_0x1d3539){if(_0x395e6b)return _0xe90570(_0x395e6b);fs[_0x071e('0x6a')](path['join'](_0x4dda8b,util[_0x071e('0x46')](_0x071e('0x6b'),_0x11bef2)),_0x1d3539);return _0x4b9ce3(_0x1d3539);});});})['then'](function(){return new BPromise(function(_0x28d495,_0x33d96f){zipdir(_0x4dda8b,{'saveTo':_0x3151bc},function(_0x195785,_0x296fad){if(_0x195785)return _0x33d96f(_0x195785);return _0x28d495(_0x296fad);});})[_0x071e('0x1a')](function(){return new BPromise(function(_0x40c49f,_0x29c27e){rimraf(_0x4dda8b,function(_0x1999bb){if(_0x1999bb)_0x29c27e(_0x1999bb);return _0x40c49f();});});})[_0x071e('0x1a')](function(){return _0x1e770d[_0x071e('0x50')](_0x3151bc,_0x3ef82a,function(_0x22e6bf){if(!_0x22e6bf)fs[_0x071e('0x6c')](_0x3151bc);});});});}else{return _0x1e770d[_0x071e('0x11')](0xc8);}})[_0x071e('0x27')](handleError(_0x1e770d,null));}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.events.js b/server/api/mailInteraction/mailInteraction.events.js index 894e710..6174372 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 _0xbef7=['catch','hook','exports','MailInteraction','../../mysqldb','MailMessage','setMaxListeners','update','remove','then','setDataValue','map','findAll','unreadMessages','length','emit'];(function(_0x58a73e,_0x25648f){var _0x2ba651=function(_0x183c40){while(--_0x183c40){_0x58a73e['push'](_0x58a73e['shift']());}};_0x2ba651(++_0x25648f);}(_0xbef7,0x153));var _0x7bef=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xbef7[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require('events');var MailInteraction=require('../../mysqldb')['db'][_0x7bef('0x0')];var MailMessage=require(_0x7bef('0x1'))['db'][_0x7bef('0x2')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0x7bef('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x7bef('0x4'),'afterDestroy':_0x7bef('0x5')};function emitEvent(_0x209085){return function(_0x4b7631,_0x2b7673,_0x3ded00){_0x4b7631['getUsers']({'attributes':['id'],'raw':!![]})[_0x7bef('0x6')](function(_0x45c005){_0x4b7631[_0x7bef('0x7')]('Users',_0x45c005[_0x7bef('0x8')](function(_0x36760d){return{'id':_0x36760d['id']};}));return MailMessage[_0x7bef('0x9')]({'where':{'MailInteractionId':_0x4b7631['id'],'direction':'in','read':![]},'raw':!![]});})[_0x7bef('0x6')](function(_0x2f627d){_0x4b7631[_0x7bef('0x7')](_0x7bef('0xa'),_0x2f627d[_0x7bef('0xb')]);MailInteractionEvents[_0x7bef('0xc')](_0x209085+':'+_0x4b7631['id'],_0x4b7631);MailInteractionEvents[_0x7bef('0xc')](_0x209085,_0x4b7631);_0x3ded00(null);})[_0x7bef('0xd')](_0x3ded00(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailInteraction[_0x7bef('0xe')](e,emitEvent(event));}}module[_0x7bef('0xf')]=MailInteractionEvents; \ No newline at end of file +var _0x3c16=['Users','map','setDataValue','unreadMessages','length','emit','hasOwnProperty','hook','exports','events','../../mysqldb','MailInteraction','MailMessage','setMaxListeners','save','update','remove','getUsers'];(function(_0x48014f,_0x1823be){var _0x5895bd=function(_0x5ae89a){while(--_0x5ae89a){_0x48014f['push'](_0x48014f['shift']());}};_0x5895bd(++_0x1823be);}(_0x3c16,0x1dd));var _0x63c1=function(_0x213953,_0x35d879){_0x213953=_0x213953-0x0;var _0x430419=_0x3c16[_0x213953];return _0x430419;};'use strict';var EventEmitter=require(_0x63c1('0x0'));var MailInteraction=require(_0x63c1('0x1'))['db'][_0x63c1('0x2')];var MailMessage=require('../../mysqldb')['db'][_0x63c1('0x3')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0x63c1('0x4')](0x0);var events={'afterCreate':_0x63c1('0x5'),'afterUpdate':_0x63c1('0x6'),'afterDestroy':_0x63c1('0x7')};function emitEvent(_0x5ef976){return function(_0x58f7ba,_0x4976bd,_0x22cd2c){_0x58f7ba[_0x63c1('0x8')]({'attributes':['id'],'raw':!![]})['then'](function(_0x371fad){_0x58f7ba['setDataValue'](_0x63c1('0x9'),_0x371fad[_0x63c1('0xa')](function(_0x2ac3ae){return{'id':_0x2ac3ae['id']};}));return MailMessage['findAll']({'where':{'MailInteractionId':_0x58f7ba['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x8edb40){_0x58f7ba[_0x63c1('0xb')](_0x63c1('0xc'),_0x8edb40[_0x63c1('0xd')]);MailInteractionEvents[_0x63c1('0xe')](_0x5ef976+':'+_0x58f7ba['id'],_0x58f7ba);MailInteractionEvents[_0x63c1('0xe')](_0x5ef976,_0x58f7ba);_0x22cd2c(null);})['catch'](_0x22cd2c(null));};}for(var e in events){if(events[_0x63c1('0xf')](e)){var event=events[e];MailInteraction[_0x63c1('0x10')](e,emitEvent(event));}}module[_0x63c1('0x11')]=MailInteractionEvents; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.model.js b/server/api/mailInteraction/mailInteraction.model.js index b67178f..e9ba90d 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 _0xa7b1=['changed','substatusAt','models','MailMessage','then','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','define','mail_interactions','fti_mail_interactions','subject','FULLTEXT','substatus','format','closed','closedAt','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x32ead4,_0x5c54c1){var _0x3d66dd=function(_0x293556){while(--_0x293556){_0x32ead4['push'](_0x32ead4['shift']());}};_0x3d66dd(++_0x5c54c1);}(_0xa7b1,0x14b));var _0x1a7b=function(_0x5073ca,_0x5557ac){_0x5073ca=_0x5073ca-0x0;var _0xe7cd53=_0xa7b1[_0x5073ca];return _0xe7cd53;};'use strict';var _=require(_0x1a7b('0x0'));var util=require(_0x1a7b('0x1'));var logger=require(_0x1a7b('0x2'))(_0x1a7b('0x3'));var moment=require(_0x1a7b('0x4'));var BPromise=require(_0x1a7b('0x5'));var rp=require(_0x1a7b('0x6'));var fs=require('fs');var path=require(_0x1a7b('0x7'));var rimraf=require(_0x1a7b('0x8'));var config=require(_0x1a7b('0x9'));var attributes=require('./mailInteraction.attributes');module['exports']=function(_0xf73ba,_0x466b13){return _0xf73ba[_0x1a7b('0xa')]('MailInteraction',attributes,{'tableName':_0x1a7b('0xb'),'paranoid':![],'indexes':[{'name':_0x1a7b('0xc'),'fields':[_0x1a7b('0xd'),'to'],'type':_0x1a7b('0xe')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x2c53ce,_0x478f1a,_0x18b2e1){if(_0x2c53ce[_0x1a7b('0xf')]){_0x2c53ce['substatusAt']=moment()[_0x1a7b('0x10')]('YYYY-MM-DD\x20HH:mm:ss');}if(_0x2c53ce[_0x1a7b('0x11')]){_0x2c53ce[_0x1a7b('0x12')]=moment()[_0x1a7b('0x10')](_0x1a7b('0x13'));}_0x18b2e1(null,_0x478f1a);},'beforeUpdate':function(_0x3a376e,_0x3aeda7,_0x3cd872){if(_0x3a376e[_0x1a7b('0x14')](_0x1a7b('0xf'))){_0x3a376e[_0x1a7b('0x15')]=_0x3a376e[_0x1a7b('0xf')]?moment()[_0x1a7b('0x10')]('YYYY-MM-DD\x20HH:mm:ss'):null;}if(_0x3a376e[_0x1a7b('0x14')](_0x1a7b('0x11'))){_0x3a376e[_0x1a7b('0x12')]=moment()[_0x1a7b('0x10')]('YYYY-MM-DD\x20HH:mm:ss');_0x3a376e[_0x1a7b('0xf')]=null;_0x3a376e['substatusAt']=null;}_0x3cd872(null,_0x3a376e);},'afterUpdate':function(_0x4e1f8c,_0x7b87f9,_0xb2be96){var _0x24e5ce=_0xf73ba[_0x1a7b('0x16')];var _0xcd427=_0x4e1f8c['get']({'plain':!![]});if(_0xcd427[_0x1a7b('0x11')]){return _0x24e5ce[_0x1a7b('0x17')]['update']({'read':!![]},{'where':{'MailInteractionId':_0xcd427['id']}})[_0x1a7b('0x18')](function(){_0xb2be96();})['catch'](function(_0x11b8d){_0xb2be96(_0x11b8d);});}else{_0xb2be96();}}},'charset':_0x1a7b('0x19'),'collate':_0x1a7b('0x1a')});}; \ No newline at end of file +var _0xdb03=['./mailInteraction.attributes','exports','define','MailInteraction','mail_interactions','fti_mail_interactions','subject','FULLTEXT','format','YYYY-MM-DD\x20HH:mm:ss','changed','substatus','closed','closedAt','substatusAt','update','then','catch','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x2dadb9,_0x42cfe6){var _0x2f0097=function(_0x21163f){while(--_0x21163f){_0x2dadb9['push'](_0x2dadb9['shift']());}};_0x2f0097(++_0x42cfe6);}(_0xdb03,0xf4));var _0x3db0=function(_0x3fbda9,_0x511811){_0x3fbda9=_0x3fbda9-0x0;var _0x41da30=_0xdb03[_0x3fbda9];return _0x41da30;};'use strict';var _=require(_0x3db0('0x0'));var util=require('util');var logger=require(_0x3db0('0x1'))(_0x3db0('0x2'));var moment=require('moment');var BPromise=require(_0x3db0('0x3'));var rp=require(_0x3db0('0x4'));var fs=require('fs');var path=require(_0x3db0('0x5'));var rimraf=require(_0x3db0('0x6'));var config=require(_0x3db0('0x7'));var attributes=require(_0x3db0('0x8'));module[_0x3db0('0x9')]=function(_0x5a6d14,_0x270bf9){return _0x5a6d14[_0x3db0('0xa')](_0x3db0('0xb'),attributes,{'tableName':_0x3db0('0xc'),'paranoid':![],'indexes':[{'name':_0x3db0('0xd'),'fields':[_0x3db0('0xe'),'to'],'type':_0x3db0('0xf')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x8eeac7,_0x5dc899,_0x2db279){if(_0x8eeac7['substatus']){_0x8eeac7['substatusAt']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}if(_0x8eeac7['closed']){_0x8eeac7['closedAt']=moment()[_0x3db0('0x10')](_0x3db0('0x11'));}_0x2db279(null,_0x5dc899);},'beforeUpdate':function(_0x21d449,_0x2c23e7,_0xb061b9){if(_0x21d449[_0x3db0('0x12')](_0x3db0('0x13'))){_0x21d449['substatusAt']=_0x21d449[_0x3db0('0x13')]?moment()['format'](_0x3db0('0x11')):null;}if(_0x21d449[_0x3db0('0x12')](_0x3db0('0x14'))){_0x21d449[_0x3db0('0x15')]=moment()['format'](_0x3db0('0x11'));_0x21d449['substatus']=null;_0x21d449[_0x3db0('0x16')]=null;}_0xb061b9(null,_0x21d449);},'afterUpdate':function(_0x3c5f7c,_0x3b3d23,_0x22a133){var _0x5d20d2=_0x5a6d14['models'];var _0x5be70b=_0x3c5f7c['get']({'plain':!![]});if(_0x5be70b[_0x3db0('0x14')]){return _0x5d20d2['MailMessage'][_0x3db0('0x17')]({'read':!![]},{'where':{'MailInteractionId':_0x5be70b['id']}})[_0x3db0('0x18')](function(){_0x22a133();})[_0x3db0('0x19')](function(_0x3914ae){_0x22a133(_0x3914ae);});}else{_0x22a133();}}},'charset':_0x3db0('0x1a'),'collate':_0x3db0('0x1b')});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.rpc.js b/server/api/mailInteraction/mailInteraction.rpc.js index cc46279..ec4d7b2 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 _0x38ed=['addTags','ids','omit','spread','AddTags','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./mailInteraction.socket','register','request','info','MailInteraction,\x20%s,\x20%s','debug','MailInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','code','error','message','result','catch','MailInteraction','update','body','options','raw','where','attributes','then','UpdateMailInteraction','stringify','AddTagsToMailInteraction','find'];(function(_0x5f39ef,_0x1507ba){var _0x4af925=function(_0x236a1b){while(--_0x236a1b){_0x5f39ef['push'](_0x5f39ef['shift']());}};_0x4af925(++_0x1507ba);}(_0x38ed,0xbd));var _0xd38e=function(_0x5d2803,_0xf375bd){_0x5d2803=_0x5d2803-0x0;var _0xdcad2c=_0x38ed[_0x5d2803];return _0xdcad2c;};'use strict';var _=require(_0xd38e('0x0'));var util=require('util');var moment=require(_0xd38e('0x1'));var BPromise=require(_0xd38e('0x2'));var rs=require(_0xd38e('0x3'));var fs=require('fs');var Redis=require(_0xd38e('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xd38e('0x5'));var logger=require(_0xd38e('0x6'))(_0xd38e('0x7'));var config=require(_0xd38e('0x8'));var jayson=require(_0xd38e('0x9'));var client=jayson[_0xd38e('0xa')][_0xd38e('0xb')]({'port':0x232a});config[_0xd38e('0xc')]=_[_0xd38e('0xd')](config[_0xd38e('0xc')],{'host':_0xd38e('0xe'),'port':0x18eb});var socket=require(_0xd38e('0xf'))(new Redis(config[_0xd38e('0xc')]));require(_0xd38e('0x10'))[_0xd38e('0x11')](socket);function respondWithRpcPromise(_0x348b05,_0x452ef0,_0x1af479){return new BPromise(function(_0x3592b7,_0xae5b1a){return client[_0xd38e('0x12')](_0x348b05,_0x1af479)['then'](function(_0xb131d5){logger[_0xd38e('0x13')](_0xd38e('0x14'),_0x452ef0,'request\x20sent');logger[_0xd38e('0x15')](_0xd38e('0x16'),_0x452ef0,_0xd38e('0x17'),JSON['stringify'](_0xb131d5));if(_0xb131d5['error']){if(_0xb131d5['error'][_0xd38e('0x18')]===0x1f4){logger[_0xd38e('0x19')]('MailInteraction,\x20%s,\x20%s',_0x452ef0,_0xb131d5['error'][_0xd38e('0x1a')]);return _0xae5b1a(_0xb131d5[_0xd38e('0x19')][_0xd38e('0x1a')]);}logger['error']('MailInteraction,\x20%s,\x20%s',_0x452ef0,_0xb131d5['error'][_0xd38e('0x1a')]);return _0x3592b7(_0xb131d5[_0xd38e('0x19')][_0xd38e('0x1a')]);}else{logger['info'](_0xd38e('0x14'),_0x452ef0,_0xd38e('0x17'));_0x3592b7(_0xb131d5[_0xd38e('0x1b')][_0xd38e('0x1a')]);}})[_0xd38e('0x1c')](function(_0x265c38){logger[_0xd38e('0x19')]('MailInteraction,\x20%s,\x20%s',_0x452ef0,_0x265c38);_0xae5b1a(_0x265c38);});});}exports['UpdateMailInteraction']=function(_0x459933){var _0x23749f=this;return new Promise(function(_0x58bf6f,_0x22542b){return db[_0xd38e('0x1d')][_0xd38e('0x1e')](_0x459933[_0xd38e('0x1f')],{'raw':_0x459933[_0xd38e('0x20')]?_0x459933[_0xd38e('0x20')][_0xd38e('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x459933[_0xd38e('0x20')]?_0x459933[_0xd38e('0x20')][_0xd38e('0x22')]||null:null,'attributes':_0x459933[_0xd38e('0x20')]?_0x459933[_0xd38e('0x20')][_0xd38e('0x23')]||null:null,'limit':_0x459933[_0xd38e('0x20')]?_0x459933[_0xd38e('0x20')]['limit']||null:null})[_0xd38e('0x24')](function(_0x36b640){logger[_0xd38e('0x13')](_0xd38e('0x25'),_0x459933);logger['debug'](_0xd38e('0x25'),_0x459933,JSON[_0xd38e('0x26')](_0x36b640));_0x58bf6f(_0x36b640);})['catch'](function(_0x3bcf7f){logger[_0xd38e('0x19')](_0xd38e('0x25'),_0x3bcf7f[_0xd38e('0x1a')],_0x459933);_0x22542b(_0x23749f['error'](0x1f4,_0x3bcf7f[_0xd38e('0x1a')]));});});};exports[_0xd38e('0x27')]=function(_0x4c5ccf){return new Promise(function(_0x1b9474,_0x26c296){return db[_0xd38e('0x1d')][_0xd38e('0x28')]({'where':_0x4c5ccf['options']?_0x4c5ccf[_0xd38e('0x20')][_0xd38e('0x22')]||null:null})[_0xd38e('0x24')](function(_0x5e80df){if(_0x5e80df){return _0x5e80df[_0xd38e('0x29')](_0x4c5ccf[_0xd38e('0x1f')][_0xd38e('0x2a')],_[_0xd38e('0x2b')](_0x4c5ccf[_0xd38e('0x1f')],['ids','id'])||{});}})[_0xd38e('0x2c')](function(_0x17aa3e){logger[_0xd38e('0x13')](_0xd38e('0x2d'),_0x4c5ccf);logger['debug'](_0xd38e('0x2d'),_0x4c5ccf,JSON[_0xd38e('0x26')](_0x17aa3e));_0x1b9474(_0x17aa3e);})['catch'](function(_0x5b8f0b){logger['error'](_0xd38e('0x2d'),_0x5b8f0b[_0xd38e('0x1a')],_0x4c5ccf);_0x26c296(_this[_0xd38e('0x19')](0x1f4,_0x5b8f0b[_0xd38e('0x1a')]));});});}; \ No newline at end of file +var _0xbaee=['omit','spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','jayson/promise','http','redis','defaults','localhost','./mailInteraction.socket','register','request','MailInteraction,\x20%s,\x20%s','request\x20sent','debug','MailInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','UpdateMailInteraction','MailInteraction','update','body','options','attributes','limit','then','AddTagsToMailInteraction','find','where','addTags','ids'];(function(_0x28a8ce,_0x1abfa0){var _0x25a5a1=function(_0x129782){while(--_0x129782){_0x28a8ce['push'](_0x28a8ce['shift']());}};_0x25a5a1(++_0x1abfa0);}(_0xbaee,0x186));var _0xebae=function(_0x208888,_0x7f96ee){_0x208888=_0x208888-0x0;var _0x13bdc6=_0xbaee[_0x208888];return _0x13bdc6;};'use strict';var _=require(_0xebae('0x0'));var util=require(_0xebae('0x1'));var moment=require(_0xebae('0x2'));var BPromise=require(_0xebae('0x3'));var rs=require(_0xebae('0x4'));var fs=require('fs');var Redis=require(_0xebae('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xebae('0x6'));var logger=require(_0xebae('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xebae('0x8'));var client=jayson['client'][_0xebae('0x9')]({'port':0x232a});config[_0xebae('0xa')]=_[_0xebae('0xb')](config['redis'],{'host':_0xebae('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xebae('0xd'))[_0xebae('0xe')](socket);function respondWithRpcPromise(_0x55bd84,_0x265ee4,_0x24a76a){return new BPromise(function(_0xc65748,_0x538bf0){return client[_0xebae('0xf')](_0x55bd84,_0x24a76a)['then'](function(_0x1d783b){logger['info'](_0xebae('0x10'),_0x265ee4,_0xebae('0x11'));logger[_0xebae('0x12')](_0xebae('0x13'),_0x265ee4,_0xebae('0x11'),JSON[_0xebae('0x14')](_0x1d783b));if(_0x1d783b[_0xebae('0x15')]){if(_0x1d783b[_0xebae('0x15')][_0xebae('0x16')]===0x1f4){logger['error'](_0xebae('0x10'),_0x265ee4,_0x1d783b['error'][_0xebae('0x17')]);return _0x538bf0(_0x1d783b['error']['message']);}logger[_0xebae('0x15')](_0xebae('0x10'),_0x265ee4,_0x1d783b['error']['message']);return _0xc65748(_0x1d783b[_0xebae('0x15')][_0xebae('0x17')]);}else{logger[_0xebae('0x18')](_0xebae('0x10'),_0x265ee4,_0xebae('0x11'));_0xc65748(_0x1d783b[_0xebae('0x19')][_0xebae('0x17')]);}})[_0xebae('0x1a')](function(_0x73cbb2){logger[_0xebae('0x15')](_0xebae('0x10'),_0x265ee4,_0x73cbb2);_0x538bf0(_0x73cbb2);});});}exports[_0xebae('0x1b')]=function(_0x27af4b){var _0x11afdb=this;return new Promise(function(_0x18db4c,_0x5a710c){return db[_0xebae('0x1c')][_0xebae('0x1d')](_0x27af4b[_0xebae('0x1e')],{'raw':_0x27af4b[_0xebae('0x1f')]?_0x27af4b['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x27af4b[_0xebae('0x1f')]?_0x27af4b[_0xebae('0x1f')]['where']||null:null,'attributes':_0x27af4b['options']?_0x27af4b[_0xebae('0x1f')][_0xebae('0x20')]||null:null,'limit':_0x27af4b['options']?_0x27af4b[_0xebae('0x1f')][_0xebae('0x21')]||null:null})[_0xebae('0x22')](function(_0x249def){logger[_0xebae('0x18')](_0xebae('0x1b'),_0x27af4b);logger[_0xebae('0x12')]('UpdateMailInteraction',_0x27af4b,JSON[_0xebae('0x14')](_0x249def));_0x18db4c(_0x249def);})[_0xebae('0x1a')](function(_0x3572fa){logger[_0xebae('0x15')](_0xebae('0x1b'),_0x3572fa[_0xebae('0x17')],_0x27af4b);_0x5a710c(_0x11afdb[_0xebae('0x15')](0x1f4,_0x3572fa[_0xebae('0x17')]));});});};exports[_0xebae('0x23')]=function(_0x57887c){return new Promise(function(_0x9d4fcc,_0x55b386){return db['MailInteraction'][_0xebae('0x24')]({'where':_0x57887c['options']?_0x57887c['options'][_0xebae('0x25')]||null:null})['then'](function(_0x469e18){if(_0x469e18){return _0x469e18[_0xebae('0x26')](_0x57887c['body'][_0xebae('0x27')],_[_0xebae('0x28')](_0x57887c[_0xebae('0x1e')],[_0xebae('0x27'),'id'])||{});}})[_0xebae('0x29')](function(_0x2fbf8b){logger[_0xebae('0x18')](_0xebae('0x2a'),_0x57887c);logger[_0xebae('0x12')](_0xebae('0x2a'),_0x57887c,JSON[_0xebae('0x14')](_0x2fbf8b));_0x9d4fcc(_0x2fbf8b);})[_0xebae('0x1a')](function(_0x4a75c8){logger[_0xebae('0x15')](_0xebae('0x2a'),_0x4a75c8['message'],_0x57887c);_0x55b386(_this[_0xebae('0x15')](0x1f4,_0x4a75c8[_0xebae('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.socket.js b/server/api/mailInteraction/mailInteraction.socket.js index a797cea..ea5eb0e 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 _0xaa7b=['mailInteraction:','./mailInteraction.events','save','update','removeListener','length'];(function(_0x4848cd,_0x3d9895){var _0x261a1d=function(_0xc825c0){while(--_0xc825c0){_0x4848cd['push'](_0x4848cd['shift']());}};_0x261a1d(++_0x3d9895);}(_0xaa7b,0x1b1));var _0xbaa7=function(_0xfee9b2,_0x31d1ad){_0xfee9b2=_0xfee9b2-0x0;var _0x108707=_0xaa7b[_0xfee9b2];return _0x108707;};'use strict';var MailInteractionEvents=require(_0xbaa7('0x0'));var events=[_0xbaa7('0x1'),'remove',_0xbaa7('0x2')];function createListener(_0x56a0a4,_0x37b75d){return function(_0x288e97){_0x37b75d['emit'](_0x56a0a4,_0x288e97);};}function removeListener(_0x211486,_0x328c60){return function(){MailInteractionEvents[_0xbaa7('0x3')](_0x211486,_0x328c60);};}exports['register']=function(_0xb3df1b){for(var _0xbe1f3c=0x0,_0x4dcd95=events[_0xbaa7('0x4')];_0xbe1f3c<_0x4dcd95;_0xbe1f3c++){var _0x7b4481=events[_0xbe1f3c];var _0x370a62=createListener(_0xbaa7('0x5')+_0x7b4481,_0xb3df1b);MailInteractionEvents['on'](_0x7b4481,_0x370a62);}}; \ No newline at end of file +var _0x7515=['./mailInteraction.events','save','remove','update','emit','removeListener','register','mailInteraction:'];(function(_0x410343,_0x55488f){var _0x201247=function(_0x58ef8d){while(--_0x58ef8d){_0x410343['push'](_0x410343['shift']());}};_0x201247(++_0x55488f);}(_0x7515,0x1f0));var _0x5751=function(_0x3c7426,_0x53d4a6){_0x3c7426=_0x3c7426-0x0;var _0xdde032=_0x7515[_0x3c7426];return _0xdde032;};'use strict';var MailInteractionEvents=require(_0x5751('0x0'));var events=[_0x5751('0x1'),_0x5751('0x2'),_0x5751('0x3')];function createListener(_0xd58cdc,_0x4939f7){return function(_0x1e6b10){_0x4939f7[_0x5751('0x4')](_0xd58cdc,_0x1e6b10);};}function removeListener(_0x359c0f,_0x4499c6){return function(){MailInteractionEvents[_0x5751('0x5')](_0x359c0f,_0x4499c6);};}exports[_0x5751('0x6')]=function(_0xc08e38){for(var _0xde3ea5=0x0,_0x33dcbf=events['length'];_0xde3ea5<_0x33dcbf;_0xde3ea5++){var _0x49a667=events[_0xde3ea5];var _0x3019e6=createListener(_0x5751('0x7')+_0x49a667,_0xc08e38);MailInteractionEvents['on'](_0x49a667,_0x3019e6);}}; \ No newline at end of file diff --git a/server/api/mailMessage/index.js b/server/api/mailMessage/index.js index d32d1d4..82ace90 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 _0x1b32=['post','mail','mailmessage:create','create','put','/:id','update','/:id/accept','accept','/:id/reject','reject','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailMessage.controller','get','isAuthenticated','index','/describe','describe','show','download'];(function(_0x25c180,_0x56abcb){var _0x4363c2=function(_0x46510b){while(--_0x46510b){_0x25c180['push'](_0x25c180['shift']());}};_0x4363c2(++_0x56abcb);}(_0x1b32,0x85));var _0x21b3=function(_0xac151d,_0x4ea1d2){_0xac151d=_0xac151d-0x0;var _0x111dba=_0x1b32[_0xac151d];return _0x111dba;};'use strict';var multer=require('multer');var util=require(_0x21b3('0x0'));var path=require(_0x21b3('0x1'));var timeout=require(_0x21b3('0x2'));var express=require(_0x21b3('0x3'));var router=express[_0x21b3('0x4')]();var fs_extra=require(_0x21b3('0x5'));var auth=require(_0x21b3('0x6'));var interaction=require(_0x21b3('0x7'));var config=require(_0x21b3('0x8'));var controller=require(_0x21b3('0x9'));router[_0x21b3('0xa')]('/',auth[_0x21b3('0xb')](),controller[_0x21b3('0xc')]);router[_0x21b3('0xa')](_0x21b3('0xd'),auth['isAuthenticated'](),controller[_0x21b3('0xe')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x21b3('0xf')]);router[_0x21b3('0xa')]('/:id/download',auth['isAuthenticated'](),controller[_0x21b3('0x10')]);router[_0x21b3('0x11')]('/',auth[_0x21b3('0xb')](),interaction['tracked'](_0x21b3('0x12'),_0x21b3('0x13')),controller[_0x21b3('0x14')]);router[_0x21b3('0x15')](_0x21b3('0x16'),auth[_0x21b3('0xb')](),controller[_0x21b3('0x17')]);router[_0x21b3('0x15')](_0x21b3('0x18'),auth['isAuthenticated'](),controller[_0x21b3('0x19')]);router[_0x21b3('0x15')](_0x21b3('0x1a'),auth['isAuthenticated'](),controller[_0x21b3('0x1b')]);router['delete'](_0x21b3('0x16'),auth['isAuthenticated'](),controller[_0x21b3('0x1c')]);module[_0x21b3('0x1d')]=router; \ No newline at end of file +var _0xdc9b=['download','post','tracked','mail','mailmessage:create','create','put','update','/:id/reject','delete','destroy','exports','multer','util','path','express','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','describe','/:id','show','/:id/download'];(function(_0x59979d,_0x252972){var _0x14c29d=function(_0x57a533){while(--_0x57a533){_0x59979d['push'](_0x59979d['shift']());}};_0x14c29d(++_0x252972);}(_0xdc9b,0x70));var _0xbdc9=function(_0x43cbc4,_0x22ad4c){_0x43cbc4=_0x43cbc4-0x0;var _0x4619b1=_0xdc9b[_0x43cbc4];return _0x4619b1;};'use strict';var multer=require(_0xbdc9('0x0'));var util=require(_0xbdc9('0x1'));var path=require(_0xbdc9('0x2'));var timeout=require('connect-timeout');var express=require(_0xbdc9('0x3'));var router=express[_0xbdc9('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xbdc9('0x5'));var config=require(_0xbdc9('0x6'));var controller=require('./mailMessage.controller');router[_0xbdc9('0x7')]('/',auth[_0xbdc9('0x8')](),controller['index']);router[_0xbdc9('0x7')]('/describe',auth[_0xbdc9('0x8')](),controller[_0xbdc9('0x9')]);router[_0xbdc9('0x7')](_0xbdc9('0xa'),auth[_0xbdc9('0x8')](),controller[_0xbdc9('0xb')]);router[_0xbdc9('0x7')](_0xbdc9('0xc'),auth[_0xbdc9('0x8')](),controller[_0xbdc9('0xd')]);router[_0xbdc9('0xe')]('/',auth[_0xbdc9('0x8')](),interaction[_0xbdc9('0xf')](_0xbdc9('0x10'),_0xbdc9('0x11')),controller[_0xbdc9('0x12')]);router[_0xbdc9('0x13')](_0xbdc9('0xa'),auth[_0xbdc9('0x8')](),controller[_0xbdc9('0x14')]);router[_0xbdc9('0x13')]('/:id/accept',auth[_0xbdc9('0x8')](),controller['accept']);router['put'](_0xbdc9('0x15'),auth[_0xbdc9('0x8')](),controller['reject']);router[_0xbdc9('0x16')](_0xbdc9('0xa'),auth[_0xbdc9('0x8')](),controller[_0xbdc9('0x17')]);module[_0xbdc9('0x18')]=router; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.attributes.js b/server/api/mailMessage/mailMessage.attributes.js index c2251f4..54430a3 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 _0xfb14=['BOOLEAN','ENUM','out','STRING','DATE','INTEGER','sequelize','lodash','exports','TEXT','long','medium'];(function(_0x30f91f,_0x5d56b6){var _0x3cf524=function(_0x90a96c){while(--_0x90a96c){_0x30f91f['push'](_0x30f91f['shift']());}};_0x3cf524(++_0x5d56b6);}(_0xfb14,0xc6));var _0x4fb1=function(_0x3ab345,_0x228fe1){_0x3ab345=_0x3ab345-0x0;var _0x2116f5=_0xfb14[_0x3ab345];return _0x2116f5;};'use strict';var Sequelize=require(_0x4fb1('0x0'));var _=require(_0x4fb1('0x1'));module[_0x4fb1('0x2')]={'body':{'type':Sequelize[_0x4fb1('0x3')](_0x4fb1('0x4')),'allowNull':![]},'plainBody':{'type':Sequelize[_0x4fb1('0x3')](_0x4fb1('0x5'))},'read':{'type':Sequelize[_0x4fb1('0x6')],'defaultValue':![]},'direction':{'type':Sequelize[_0x4fb1('0x7')]('in','out'),'defaultValue':_0x4fb1('0x8'),'allowNull':![]},'messageId':{'type':Sequelize[_0x4fb1('0x9')](0x1fe)},'from':{'type':Sequelize[_0x4fb1('0x9')]},'to':{'type':Sequelize[_0x4fb1('0x3')](_0x4fb1('0x4'))},'cc':{'type':Sequelize[_0x4fb1('0x3')]('long')},'bcc':{'type':Sequelize[_0x4fb1('0x3')](_0x4fb1('0x4'))},'subject':{'type':Sequelize[_0x4fb1('0x3')]},'sentAt':{'type':Sequelize[_0x4fb1('0xa')]},'attach':{'type':Sequelize[_0x4fb1('0xb')],'defaultValue':0x0},'secret':{'type':Sequelize[_0x4fb1('0x6')],'defaultValue':![]},'readAt':{'type':Sequelize[_0x4fb1('0xa')]},'originTo':{'type':Sequelize[_0x4fb1('0x3')]('long')},'originCc':{'type':Sequelize[_0x4fb1('0x3')]('long')},'originChannel':{'type':Sequelize[_0x4fb1('0x7')]('Email','Chat'),'defaultValue':'Email','allowNull':![]}}; \ No newline at end of file +var _0xd5c1=['Chat','exports','TEXT','medium','BOOLEAN','out','STRING','long','INTEGER','DATE','ENUM','Email'];(function(_0x504444,_0x5e136d){var _0x22f68a=function(_0x3ddfb2){while(--_0x3ddfb2){_0x504444['push'](_0x504444['shift']());}};_0x22f68a(++_0x5e136d);}(_0xd5c1,0xc1));var _0x1d5c=function(_0x44ee67,_0x391c43){_0x44ee67=_0x44ee67-0x0;var _0x1630a3=_0xd5c1[_0x44ee67];return _0x1630a3;};'use strict';var Sequelize=require('sequelize');var _=require('lodash');module[_0x1d5c('0x0')]={'body':{'type':Sequelize[_0x1d5c('0x1')]('long'),'allowNull':![]},'plainBody':{'type':Sequelize[_0x1d5c('0x1')](_0x1d5c('0x2'))},'read':{'type':Sequelize[_0x1d5c('0x3')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x1d5c('0x4')),'defaultValue':_0x1d5c('0x4'),'allowNull':![]},'messageId':{'type':Sequelize['STRING'](0x1fe)},'from':{'type':Sequelize[_0x1d5c('0x5')]},'to':{'type':Sequelize['TEXT']('long')},'cc':{'type':Sequelize['TEXT']('long')},'bcc':{'type':Sequelize[_0x1d5c('0x1')](_0x1d5c('0x6'))},'subject':{'type':Sequelize[_0x1d5c('0x1')]},'sentAt':{'type':Sequelize['DATE']},'attach':{'type':Sequelize[_0x1d5c('0x7')],'defaultValue':0x0},'secret':{'type':Sequelize[_0x1d5c('0x3')],'defaultValue':![]},'readAt':{'type':Sequelize[_0x1d5c('0x8')]},'originTo':{'type':Sequelize[_0x1d5c('0x1')](_0x1d5c('0x6'))},'originCc':{'type':Sequelize[_0x1d5c('0x1')]('long')},'originChannel':{'type':Sequelize[_0x1d5c('0x9')](_0x1d5c('0xa'),_0x1d5c('0xb')),'defaultValue':_0x1d5c('0xa'),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.controller.js b/server/api/mailMessage/mailMessage.controller.js index 78343d2..86f60be 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 _0xc6f6=['MailServerOut','Smtp','CloudProvider','attachments','join','root','server/files/attachments','basename','Contacts','CmContact','SendMail','sendMail','messageId','format','YYYY-MM-DD\x20HH:mm:ss','accept','read','readAt','UserId','agent','MailInteractionId','isNil','read1stAt','interaction','get','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','null','AcceptMessage','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','User','fullname','email','internal','manual','interface','SIP/%s','channel','motionChannel','event','fromString','EventManager','acceptmessage','reject','mail','MailInteraction','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectmessage','download','unix','toString','server','files','tmp','message-%s.eml','from','subject','createdAt','Attachments','decode','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','bcc','existsSync','readFileSync','build','unlinkSync','bluebird','lodash','ioredis','../../components/parsers/qs','api','../../config/logger','mail-interactions','../../config/environment','../../mysqldb','defaults','redis','socket.io-emitter','./mailMessage.socket','jayson/promise','client','http','then','info','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','MailMessage,\x20%s,\x20%s','message','result','catch','status','json','undefined','limit','count','offset','set','update','destroy','end','sendStatus','stack','name','send','index','map','MailMessage','fieldName','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','where','filters','pick','filter','merge','VIRTUAL','include','findAll','rows','show','params','rawAttributes','options','find','body','describe','create','direction','MailAccount','findOne','CmList','List','updatedAt','DESC'];(function(_0x50595c,_0x2045b7){var _0x23b792=function(_0x17451b){while(--_0x17451b){_0x50595c['push'](_0x50595c['shift']());}};_0x23b792(++_0x2045b7);}(_0xc6f6,0xe6));var _0x6c6f=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xc6f6[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require('eml-format');var moment=require('moment');var BPromise=require(_0x6c6f('0x0'));var util=require('util');var path=require('path');var fs=require('fs');var _=require(_0x6c6f('0x1'));var Redis=require(_0x6c6f('0x2'));var htmlToText=require('html-to-text');var qs=require(_0x6c6f('0x3'));var logger=require('../../config/logger')(_0x6c6f('0x4'));var interaction_log=require(_0x6c6f('0x5'))(_0x6c6f('0x6'));var config=require(_0x6c6f('0x7'));var db=require(_0x6c6f('0x8'))['db'];config['redis']=_[_0x6c6f('0x9')](config[_0x6c6f('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x6c6f('0xb'))(new Redis(config[_0x6c6f('0xa')]));var htmlEntities=require('html-entities');require(_0x6c6f('0xc'))['register'](socket);var jayson=require(_0x6c6f('0xd'));var client=jayson[_0x6c6f('0xe')][_0x6c6f('0xf')]({'port':0x232c});var client9003=jayson[_0x6c6f('0xe')]['http']({'port':0x232b});var client9002=jayson['client'][_0x6c6f('0xf')]({'port':0x232a});function respondWithRpcPromise(_0x5e7a24,_0x5c6fe5,_0x19793a,_0x1a0a08){return new BPromise(function(_0xe7fb40,_0x575eeb){var _0x33e394=_0x1a0a08||client;return _0x33e394['request'](_0x5e7a24,_0x19793a)[_0x6c6f('0x10')](function(_0x1aee05){logger[_0x6c6f('0x11')]('MailMessage,\x20%s,\x20%s',_0x5c6fe5,_0x6c6f('0x12'));logger[_0x6c6f('0x13')](_0x6c6f('0x14'),_0x5c6fe5,_0x6c6f('0x12'),JSON[_0x6c6f('0x15')](_0x1aee05));if(_0x1aee05[_0x6c6f('0x16')]){if(_0x1aee05[_0x6c6f('0x16')][_0x6c6f('0x17')]===0x1f4){logger[_0x6c6f('0x16')](_0x6c6f('0x18'),_0x5c6fe5,_0x1aee05['error'][_0x6c6f('0x19')]);return _0x575eeb(_0x1aee05[_0x6c6f('0x16')]['message']);}logger['error'](_0x6c6f('0x18'),_0x5c6fe5,_0x1aee05['error'][_0x6c6f('0x19')]);return _0xe7fb40(_0x1aee05[_0x6c6f('0x16')][_0x6c6f('0x19')]);}else{logger[_0x6c6f('0x11')](_0x6c6f('0x18'),_0x5c6fe5,_0x6c6f('0x12'));_0xe7fb40(_0x1aee05[_0x6c6f('0x1a')][_0x6c6f('0x19')]);}})[_0x6c6f('0x1b')](function(_0x26562e){logger[_0x6c6f('0x16')](_0x6c6f('0x18'),_0x5c6fe5,_0x26562e);_0x575eeb(_0x26562e);});});}function respondWithResult(_0x34d5aa,_0x395a46){_0x395a46=_0x395a46||0xc8;return function(_0x1624bf){if(_0x1624bf){return _0x34d5aa[_0x6c6f('0x1c')](_0x395a46)[_0x6c6f('0x1d')](_0x1624bf);}};}function respondWithFilteredResult(_0x42d619,_0x22590d){return function(_0x33ce40){if(_0x33ce40){var _0xec454f=typeof _0x22590d['offset']===_0x6c6f('0x1e')&&typeof _0x22590d[_0x6c6f('0x1f')]===_0x6c6f('0x1e');var _0x417da4=_0x33ce40[_0x6c6f('0x20')];var _0x51f995=_0xec454f?0x0:_0x22590d[_0x6c6f('0x21')];var _0x48bdc7=_0xec454f?_0x33ce40[_0x6c6f('0x20')]:_0x22590d[_0x6c6f('0x21')]+_0x22590d[_0x6c6f('0x1f')];var _0x5743dc;if(_0x48bdc7>=_0x417da4){_0x48bdc7=_0x417da4;_0x5743dc=0xc8;}else{_0x5743dc=0xce;}_0x42d619['status'](_0x5743dc);return _0x42d619[_0x6c6f('0x22')]('Content-Range',_0x51f995+'-'+_0x48bdc7+'/'+_0x417da4)[_0x6c6f('0x1d')](_0x33ce40);}return null;};}function saveUpdates(_0x4c7daa){return function(_0x214764){if(_0x214764){return _0x214764[_0x6c6f('0x23')](_0x4c7daa)['then'](function(_0x1146e4){return _0x1146e4;});}return null;};}function removeEntity(_0x10ceb0){return function(_0x4f06c7){if(_0x4f06c7){return _0x4f06c7[_0x6c6f('0x24')]()[_0x6c6f('0x10')](function(){_0x10ceb0[_0x6c6f('0x1c')](0xcc)[_0x6c6f('0x25')]();});}};}function handleEntityNotFound(_0x14dc34){return function(_0x5567ca){if(!_0x5567ca){_0x14dc34[_0x6c6f('0x26')](0x194);}return _0x5567ca;};}function handleError(_0x7501f1,_0x348034){_0x348034=_0x348034||0x1f4;return function(_0x5f5d92){logger[_0x6c6f('0x16')](_0x5f5d92[_0x6c6f('0x27')]);if(_0x5f5d92[_0x6c6f('0x28')]){delete _0x5f5d92[_0x6c6f('0x28')];}_0x7501f1['status'](_0x348034)[_0x6c6f('0x29')](_0x5f5d92);};}exports[_0x6c6f('0x2a')]=function(_0x412cda,_0x2c6141){var _0x5569e0={},_0xfed703={},_0x399fb5={'count':0x0,'rows':[]};var _0x26070c=_[_0x6c6f('0x2b')](db[_0x6c6f('0x2c')]['rawAttributes'],function(_0x5aa93b){return{'name':_0x5aa93b[_0x6c6f('0x2d')],'type':_0x5aa93b[_0x6c6f('0x2e')]['key']};});_0xfed703[_0x6c6f('0x2f')]=_[_0x6c6f('0x2b')](_0x26070c,_0x6c6f('0x28'));_0xfed703[_0x6c6f('0x30')]=_[_0x6c6f('0x31')](_0x412cda['query']);_0xfed703['filters']=_[_0x6c6f('0x32')](_0xfed703[_0x6c6f('0x2f')],_0xfed703[_0x6c6f('0x30')]);_0x5569e0[_0x6c6f('0x33')]=_[_0x6c6f('0x32')](_0xfed703[_0x6c6f('0x2f')],qs[_0x6c6f('0x34')](_0x412cda['query']['fields']));_0x5569e0[_0x6c6f('0x33')]=_0x5569e0[_0x6c6f('0x33')][_0x6c6f('0x35')]?_0x5569e0['attributes']:_0xfed703['model'];if(!_0x412cda[_0x6c6f('0x30')][_0x6c6f('0x36')]('nolimit')){_0x5569e0[_0x6c6f('0x1f')]=qs['limit'](_0x412cda['query'][_0x6c6f('0x1f')]);_0x5569e0['offset']=qs[_0x6c6f('0x21')](_0x412cda[_0x6c6f('0x30')]['offset']);}_0x5569e0[_0x6c6f('0x37')]=qs['sort'](_0x412cda['query']['sort']);_0x5569e0[_0x6c6f('0x38')]=qs[_0x6c6f('0x39')](_[_0x6c6f('0x3a')](_0x412cda[_0x6c6f('0x30')],_0xfed703[_0x6c6f('0x39')]),_0x26070c);if(_0x412cda[_0x6c6f('0x30')][_0x6c6f('0x3b')]){_0x5569e0['where']=_[_0x6c6f('0x3c')](_0x5569e0[_0x6c6f('0x38')],{'$or':_['map'](_0x26070c,function(_0x554cc6){if(_0x554cc6[_0x6c6f('0x2e')]!==_0x6c6f('0x3d')){var _0x289aab={};_0x289aab[_0x554cc6[_0x6c6f('0x28')]]={'$like':'%'+_0x412cda[_0x6c6f('0x30')]['filter']+'%'};return _0x289aab;}})});}_0x5569e0=_[_0x6c6f('0x3c')]({},_0x5569e0,_0x412cda['options']);var _0x31d135={'where':_0x5569e0[_0x6c6f('0x38')]};return db[_0x6c6f('0x2c')][_0x6c6f('0x20')](_0x31d135)['then'](function(_0x41db96){_0x399fb5[_0x6c6f('0x20')]=_0x41db96;if(_0x412cda['query']['includeAll']){_0x5569e0[_0x6c6f('0x3e')]=[{'all':!![]}];}return db[_0x6c6f('0x2c')][_0x6c6f('0x3f')](_0x5569e0);})['then'](function(_0xc5ceba){_0x399fb5[_0x6c6f('0x40')]=_0xc5ceba;return _0x399fb5;})['then'](respondWithFilteredResult(_0x2c6141,_0x5569e0))['catch'](handleError(_0x2c6141,null));};exports[_0x6c6f('0x41')]=function(_0x4519f5,_0xfcc67a){var _0x4c8fee={'raw':!![],'where':{'id':_0x4519f5[_0x6c6f('0x42')]['id']}},_0x422f31={};_0x422f31[_0x6c6f('0x2f')]=_[_0x6c6f('0x31')](db[_0x6c6f('0x2c')][_0x6c6f('0x43')]);_0x422f31[_0x6c6f('0x30')]=_[_0x6c6f('0x31')](_0x4519f5[_0x6c6f('0x30')]);_0x422f31[_0x6c6f('0x39')]=_['intersection'](_0x422f31['model'],_0x422f31['query']);_0x4c8fee[_0x6c6f('0x33')]=_['intersection'](_0x422f31['model'],qs[_0x6c6f('0x34')](_0x4519f5[_0x6c6f('0x30')][_0x6c6f('0x34')]));_0x4c8fee[_0x6c6f('0x33')]=_0x4c8fee['attributes'][_0x6c6f('0x35')]?_0x4c8fee['attributes']:_0x422f31['model'];if(_0x4519f5['query']['includeAll']){_0x4c8fee[_0x6c6f('0x3e')]=[{'all':!![]}];}_0x4c8fee=_[_0x6c6f('0x3c')]({},_0x4c8fee,_0x4519f5[_0x6c6f('0x44')]);return db['MailMessage'][_0x6c6f('0x45')](_0x4c8fee)[_0x6c6f('0x10')](handleEntityNotFound(_0xfcc67a,null))[_0x6c6f('0x10')](respondWithResult(_0xfcc67a,null))[_0x6c6f('0x1b')](handleError(_0xfcc67a,null));};exports[_0x6c6f('0x23')]=function(_0x9c10d9,_0x7bd001){if(_0x9c10d9[_0x6c6f('0x46')]['id']){delete _0x9c10d9['body']['id'];}return db[_0x6c6f('0x2c')][_0x6c6f('0x45')]({'where':{'id':_0x9c10d9[_0x6c6f('0x42')]['id']}})['then'](handleEntityNotFound(_0x7bd001,null))['then'](saveUpdates(_0x9c10d9[_0x6c6f('0x46')],null))[_0x6c6f('0x10')](respondWithResult(_0x7bd001,null))['catch'](handleError(_0x7bd001,null));};exports[_0x6c6f('0x24')]=function(_0x48e3e5,_0x236a21){return db[_0x6c6f('0x2c')][_0x6c6f('0x45')]({'where':{'id':_0x48e3e5[_0x6c6f('0x42')]['id']}})[_0x6c6f('0x10')](handleEntityNotFound(_0x236a21,null))[_0x6c6f('0x10')](removeEntity(_0x236a21,null))['catch'](handleError(_0x236a21,null));};exports[_0x6c6f('0x47')]=function(_0x484b14,_0x359c5c){return db[_0x6c6f('0x2c')][_0x6c6f('0x47')]()[_0x6c6f('0x10')](respondWithResult(_0x359c5c,null))[_0x6c6f('0x1b')](handleError(_0x359c5c,null));};exports[_0x6c6f('0x48')]=function(_0x1d8f02,_0xf9f119){return db[_0x6c6f('0x2c')][_0x6c6f('0x48')](_0x1d8f02['body'])[_0x6c6f('0x10')](function(_0x422de7){if(_0x422de7){if(_0x422de7[_0x6c6f('0x49')]==='out'&&!_0x422de7['secret']){var _0x1d462e,_0x1af3f8,_0x311a8c;if(_0x1d8f02[_0x6c6f('0x46')]['to']){_0x1af3f8=_0x1d8f02[_0x6c6f('0x46')]['to']['split'](',')[0x0];}return db[_0x6c6f('0x4a')][_0x6c6f('0x4b')]({'where':{'id':_0x422de7['MailAccountId']},'include':[{'model':db[_0x6c6f('0x4c')],'as':_0x6c6f('0x4d'),'include':[{'model':db['CmContact'],'as':'Contacts','where':{'email':_0x1af3f8},'limit':0x1,'order':[[_0x6c6f('0x4e'),_0x6c6f('0x4f')]]}]},{'model':db[_0x6c6f('0x50')],'as':_0x6c6f('0x51'),'raw':!![],'include':[{'model':db[_0x6c6f('0x52')],'as':_0x6c6f('0x52'),'raw':!![]}]}]})[_0x6c6f('0x10')](function(_0x39aed0){_0x1d462e=_0x39aed0;if(!_0x1d462e||!_0x1d462e[_0x6c6f('0x51')])return;var _0x5e1476=_0x1d462e['getSmtpOptions']();if(_0x1d8f02[_0x6c6f('0x46')][_0x6c6f('0x53')]&&_0x1d8f02[_0x6c6f('0x46')][_0x6c6f('0x53')][_0x6c6f('0x35')]){for(var _0x2927c1=0x0;_0x2927c1<_0x1d8f02[_0x6c6f('0x46')][_0x6c6f('0x53')][_0x6c6f('0x35')];_0x2927c1+=0x1){_0x1d8f02['body']['attachments'][_0x2927c1]={'filename':_0x1d8f02['body']['attachments'][_0x2927c1][_0x6c6f('0x28')],'path':path[_0x6c6f('0x54')](config[_0x6c6f('0x55')],_0x6c6f('0x56'),_0x1d8f02['body'][_0x6c6f('0x53')][_0x2927c1][_0x6c6f('0x57')])};}}_0x311a8c={'account':_0x5e1476,'message':_0x1d8f02[_0x6c6f('0x46')]};return;})[_0x6c6f('0x10')](function(){if(_0x1d462e[_0x6c6f('0x4d')]){if(_0x1d462e[_0x6c6f('0x4d')][_0x6c6f('0x58')][_0x6c6f('0x35')]){return _0x1d462e[_0x6c6f('0x4d')][_0x6c6f('0x58')][0x0];}else{return db[_0x6c6f('0x59')]['create'](_[_0x6c6f('0x9')](_0x1d8f02[_0x6c6f('0x46')],{'firstName':_0x1d8f02[_0x6c6f('0x46')]['to'],'email':_0x1d8f02[_0x6c6f('0x46')]['to'],'phone':_0x1d8f02['body']['to'],'ListId':_0x1d462e['ListId']}));}}else{throw new Error('List\x20not\x20found');}})[_0x6c6f('0x10')](function(){if(_0x311a8c){return respondWithRpcPromise(_0x6c6f('0x5a'),_0x6c6f('0x5b'),_0x311a8c,client9003)[_0x6c6f('0x10')](function(_0x1b366e){return _0x422de7[_0x6c6f('0x23')]({'read':!![],'messageId':_0x1b366e[_0x6c6f('0x5c')],'sentAt':moment()[_0x6c6f('0x5d')](_0x6c6f('0x5e'))});})['catch'](function(_0x1aa577){logger['error']('%s',JSON[_0x6c6f('0x15')](_0x1aa577));return _0x422de7;});}return _0x422de7;});}return _0x422de7;}})[_0x6c6f('0x10')](respondWithResult(_0xf9f119,0xc9))[_0x6c6f('0x1b')](handleError(_0xf9f119,null));};exports[_0x6c6f('0x5f')]=function(_0x964a56,_0x44bc32){var _0x5ab982={'agent':{},'channel':'mail'};if(_0x964a56[_0x6c6f('0x46')]['id']){delete _0x964a56[_0x6c6f('0x46')]['id'];}_0x964a56[_0x6c6f('0x46')][_0x6c6f('0x60')]=!![];_0x964a56[_0x6c6f('0x46')][_0x6c6f('0x61')]=moment()['format'](_0x6c6f('0x5e'));_0x964a56[_0x6c6f('0x46')][_0x6c6f('0x62')]=_0x964a56['body']['UserId']||_0x964a56['user']['id'];_0x5ab982[_0x6c6f('0x63')]['id']=_0x964a56['body'][_0x6c6f('0x62')];return db[_0x6c6f('0x2c')]['find']({'where':{'id':_0x964a56[_0x6c6f('0x42')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x44bc32,null))[_0x6c6f('0x10')](saveUpdates(_0x964a56[_0x6c6f('0x46')],null))[_0x6c6f('0x10')](function(_0x1b2fc8){if(_0x1b2fc8){_0x5ab982[_0x6c6f('0x19')]=_0x1b2fc8['get']({'plain':!![]});return db['MailInteraction'][_0x6c6f('0x45')]({'where':{'id':_0x1b2fc8[_0x6c6f('0x64')]}});}return null;})['then'](handleEntityNotFound(_0x44bc32,null))[_0x6c6f('0x10')](function(_0x1e950f){if(_0x1e950f){return _0x1e950f[_0x6c6f('0x23')]({'UserId':_0x964a56[_0x6c6f('0x46')]['UserId'],'read1stAt':_[_0x6c6f('0x65')](_0x1e950f[_0x6c6f('0x66')])?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x6c6f('0x10')](function(_0x476464){if(_0x476464){_0x5ab982[_0x6c6f('0x67')]=_0x476464[_0x6c6f('0x68')]({'plain':!![]});interaction_log['info'](_0x6c6f('0x69'),_0x964a56[_0x6c6f('0x6a')]['id'],_0x964a56[_0x6c6f('0x6a')][_0x6c6f('0x28')],_0x964a56[_0x6c6f('0x6a')][_0x6c6f('0x6b')],_0x5ab982[_0x6c6f('0x67')]['id'],_0x964a56['body']?JSON['stringify'](_0x964a56[_0x6c6f('0x46')]):_0x6c6f('0x6c'));return respondWithRpcPromise(_0x6c6f('0x6d'),'acceptMessage',_0x5ab982);}return null;})[_0x6c6f('0x10')](function(_0x3e0dd5){var _0x15b38d='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x3e0dd5['message'][_0x6c6f('0x6e')];return db[_0x6c6f('0x6f')][_0x6c6f('0x30')](_0x15b38d,{'type':db[_0x6c6f('0x70')][_0x6c6f('0x71')][_0x6c6f('0x72')],'raw':!![]})['then'](function(_0x42b2d7){return _0x42b2d7;});})[_0x6c6f('0x10')](function(_0x2da720){if(_0x2da720){_0x5ab982[_0x6c6f('0x19')][_0x6c6f('0x73')]=_0x2da720[0x0];if(!_0x964a56[_0x6c6f('0x46')][_0x6c6f('0x62')])return;return db[_0x6c6f('0x74')][_0x6c6f('0x45')]({'where':{'id':_0x964a56[_0x6c6f('0x46')]['UserId'],'role':_0x6c6f('0x63')},'attributes':['id',_0x6c6f('0x28'),_0x6c6f('0x75'),_0x6c6f('0x76'),_0x6c6f('0x77')],'raw':!![]});}return null;})['then'](function(_0x542697){if(!_0x542697)return null;_0x5ab982[_0x6c6f('0x19')][_0x6c6f('0x63')]=_0x542697;return _0x5ab982;})[_0x6c6f('0x10')](function(_0x16decc){if(_0x16decc){if(_0x964a56[_0x6c6f('0x46')][_0x6c6f('0x78')]){_0x5ab982[_0x6c6f('0x19')][_0x6c6f('0x79')]=util['format'](_0x6c6f('0x7a'),_0x964a56[_0x6c6f('0x6a')]['name']);_0x5ab982[_0x6c6f('0x19')][_0x6c6f('0x7b')]=_0x5ab982[_0x6c6f('0x7b')];_0x5ab982[_0x6c6f('0x19')][_0x6c6f('0x7c')]=_0x5ab982[_0x6c6f('0x7b')];_0x5ab982[_0x6c6f('0x19')][_0x6c6f('0x7d')]='accept';_0x5ab982[_0x6c6f('0x19')]['body']=htmlToText[_0x6c6f('0x7e')](_0x5ab982[_0x6c6f('0x19')][_0x6c6f('0x46')]);return respondWithRpcPromise(_0x6c6f('0x7f'),_0x6c6f('0x7f'),{'event':_0x6c6f('0x80'),'message':_0x5ab982[_0x6c6f('0x19')]},client9002)[_0x6c6f('0x10')](function(){return _0x5ab982;});}return _0x5ab982;}return null;})[_0x6c6f('0x10')](respondWithResult(_0x44bc32,null))[_0x6c6f('0x1b')](handleError(_0x44bc32,null));};exports[_0x6c6f('0x81')]=function(_0x3c30e8,_0x2ec2e8){var _0x8da6dd={'agent':{},'channel':_0x6c6f('0x82')};if(_0x3c30e8[_0x6c6f('0x46')]['id']){delete _0x3c30e8[_0x6c6f('0x46')]['id'];}_0x3c30e8[_0x6c6f('0x46')][_0x6c6f('0x62')]=_0x3c30e8['body']['UserId']||_0x3c30e8[_0x6c6f('0x6a')]['id'];_0x8da6dd[_0x6c6f('0x63')]['id']=_0x3c30e8[_0x6c6f('0x46')][_0x6c6f('0x62')];return db[_0x6c6f('0x2c')][_0x6c6f('0x45')]({'where':{'id':_0x3c30e8[_0x6c6f('0x42')]['id'],'UserId':null}})[_0x6c6f('0x10')](handleEntityNotFound(_0x2ec2e8,null))[_0x6c6f('0x10')](function(_0x3ce01e){if(_0x3ce01e){_0x8da6dd[_0x6c6f('0x19')]=_0x3ce01e[_0x6c6f('0x68')]({'plain':!![]});return db[_0x6c6f('0x83')][_0x6c6f('0x45')]({'where':{'id':_0x3ce01e[_0x6c6f('0x64')]}});}return null;})[_0x6c6f('0x10')](handleEntityNotFound(_0x2ec2e8,null))[_0x6c6f('0x10')](function(_0x1382f4){if(_0x1382f4){_0x8da6dd['interaction']=_0x1382f4['get']({'plain':!![]});interaction_log[_0x6c6f('0x11')](_0x6c6f('0x84'),_0x3c30e8[_0x6c6f('0x6a')]['id'],_0x3c30e8[_0x6c6f('0x6a')][_0x6c6f('0x28')],_0x3c30e8['user']['role'],_0x8da6dd[_0x6c6f('0x67')]['id'],_0x3c30e8[_0x6c6f('0x46')]?JSON[_0x6c6f('0x15')](_0x3c30e8['body']):_0x6c6f('0x6c'));return respondWithRpcPromise(_0x6c6f('0x85'),'rejectMessage',_0x8da6dd);}return null;})['then'](function(_0x2a7c88){var _0x4e5f2b='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x2a7c88[_0x6c6f('0x19')][_0x6c6f('0x6e')];return db[_0x6c6f('0x6f')][_0x6c6f('0x30')](_0x4e5f2b,{'type':db['Sequelize']['QueryTypes'][_0x6c6f('0x72')],'raw':!![]})[_0x6c6f('0x10')](function(_0x42459d){return _0x42459d;});})['then'](function(_0x3383a2){if(_0x3383a2){_0x8da6dd['message'][_0x6c6f('0x73')]=_0x3383a2[0x0];if(!_0x3c30e8['body'][_0x6c6f('0x62')])return;return db['User'][_0x6c6f('0x45')]({'where':{'id':_0x3c30e8['body'][_0x6c6f('0x62')],'role':_0x6c6f('0x63')},'attributes':['id','name',_0x6c6f('0x75'),_0x6c6f('0x76'),_0x6c6f('0x77')],'raw':!![]});}return null;})[_0x6c6f('0x10')](function(_0x206ccf){if(!_0x206ccf)return null;_0x8da6dd['message']['agent']=_0x206ccf;return _0x8da6dd;})['then'](function(_0x37e75b){if(_0x37e75b){_0x37e75b[_0x6c6f('0x19')][_0x6c6f('0x79')]=util[_0x6c6f('0x5d')](_0x6c6f('0x7a'),_0x3c30e8['user']['name']);_0x37e75b[_0x6c6f('0x19')]['channel']=_0x8da6dd[_0x6c6f('0x7b')];_0x37e75b[_0x6c6f('0x19')]['motionChannel']=_0x8da6dd[_0x6c6f('0x7b')];_0x37e75b['message'][_0x6c6f('0x7d')]=_0x6c6f('0x81');_0x37e75b[_0x6c6f('0x19')][_0x6c6f('0x46')]=htmlToText[_0x6c6f('0x7e')](_0x8da6dd[_0x6c6f('0x19')]['body']);respondWithRpcPromise('EventManager','EventManager',{'event':_0x6c6f('0x86'),'message':_0x37e75b['message']},client9002);return _0x8da6dd;}return null;})[_0x6c6f('0x10')](respondWithResult(_0x2ec2e8,null))[_0x6c6f('0x1b')](handleError(_0x2ec2e8,null));};exports[_0x6c6f('0x87')]=function(_0xc0f6c8,_0x1fda3b){var _0x30d7f9=moment()[_0x6c6f('0x88')]()[_0x6c6f('0x89')]();var _0x18ffd3=path[_0x6c6f('0x54')](config[_0x6c6f('0x55')],_0x6c6f('0x8a'),_0x6c6f('0x8b'),_0x6c6f('0x8c'));var _0x86f21b=path['join'](config[_0x6c6f('0x55')],_0x6c6f('0x8a'),_0x6c6f('0x8b'),_0x6c6f('0x53'));var _0x54cb8b=util[_0x6c6f('0x5d')](_0x6c6f('0x8d'),_0x30d7f9);return db[_0x6c6f('0x2c')][_0x6c6f('0x45')]({'where':{'id':_0xc0f6c8[_0x6c6f('0x42')]['id']},'attributes':['id',_0x6c6f('0x46'),_0x6c6f('0x8e'),'to','cc','bcc',_0x6c6f('0x8f'),_0x6c6f('0x90')],'include':_0xc0f6c8[_0x6c6f('0x30')][_0x6c6f('0x53')]?[{'model':db['Attachment'],'as':_0x6c6f('0x91')}]:undefined})[_0x6c6f('0x10')](handleEntityNotFound(_0x1fda3b,null))[_0x6c6f('0x10')](function(_0x246c7b){if(_0x246c7b){var _0xfe24cb=_0x246c7b;var _0x3b364e={'from':_0xfe24cb['from'],'to':_0xfe24cb['to'],'subject':_0xfe24cb[_0x6c6f('0x8f')],'html':htmlEntities[_0x6c6f('0x92')](_0xfe24cb[_0x6c6f('0x46')]),'headers':{'Date':moment(_0xfe24cb[_0x6c6f('0x90')])[_0x6c6f('0x5d')](_0x6c6f('0x93'))},'attachments':[]};if(_0x246c7b['cc']){_0x3b364e[_0x6c6f('0x94')]['Cc']=_0x246c7b['cc'];}if(_0x246c7b['bcc']){_0x3b364e[_0x6c6f('0x94')][_0x6c6f('0x95')]=_0x246c7b[_0x6c6f('0x96')];}return new BPromise(function(_0x2cd000,_0x1af843){if(_0x246c7b[_0x6c6f('0x91')]){for(var _0x584111=0x0;_0x584111<_0x246c7b['Attachments'][_0x6c6f('0x35')];_0x584111++){var _0x365dd5=_0x246c7b[_0x6c6f('0x91')][_0x584111];var _0x478dd3=path[_0x6c6f('0x54')](_0x86f21b,_0x365dd5['basename']);if(fs[_0x6c6f('0x97')](_0x478dd3)){_0x3b364e[_0x6c6f('0x53')]['push']({'name':_0x365dd5[_0x6c6f('0x28')],'contentType':_0x365dd5[_0x6c6f('0x2e')],'data':fs[_0x6c6f('0x98')](_0x478dd3)});}}}emlformat[_0x6c6f('0x99')](_0x3b364e,function(_0x187f51,_0x3e7970){if(_0x187f51)return _0x1af843(_0x187f51);fs['writeFileSync'](path[_0x6c6f('0x54')](_0x18ffd3,_0x54cb8b),_0x3e7970);return _0x2cd000(_0x3e7970);});});}})['then'](function(_0x348db2){if(_0x348db2){return _0x1fda3b['download'](path[_0x6c6f('0x54')](_0x18ffd3,_0x54cb8b),_0x54cb8b,function(_0x577779){if(!_0x577779)fs[_0x6c6f('0x9a')](path[_0x6c6f('0x54')](_0x18ffd3,_0x54cb8b));});}})[_0x6c6f('0x1b')](handleError(_0x1fda3b,null));}; \ No newline at end of file +var _0x2454=['localhost','socket.io-emitter','html-entities','jayson/promise','client','http','request','then','info','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','error','code','MailMessage,\x20%s,\x20%s','message','status','json','offset','undefined','set','Content-Range','update','destroy','sendStatus','stack','name','send','index','map','MailMessage','rawAttributes','fieldName','type','key','query','keys','model','attributes','fields','length','limit','order','sort','filters','pick','filter','where','VIRTUAL','merge','options','count','include','rows','catch','show','params','intersection','includeAll','find','body','describe','create','direction','secret','split','MailAccount','findOne','CmList','List','Contacts','updatedAt','DESC','MailServerOut','Smtp','CloudProvider','attachments','join','root','server/files/attachments','basename','CmContact','ListId','SendMail','sendMail','messageId','format','accept','mail','read','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','MailInteractionId','read1stAt','interaction','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','stringify','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','Sequelize','QueryTypes','SELECT','contact','fullname','internal','interface','SIP/%s','channel','event','fromString','EventManager','reject','MailInteraction','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','ContactId','sequelize','User','email','motionChannel','rejectmessage','download','unix','server','files','tmp','message-%s.eml','from','bcc','subject','createdAt','Attachment','Attachments','decode','headers','readFileSync','build','writeFileSync','eml-format','moment','util','path','ioredis','html-to-text','../../components/parsers/qs','../../config/logger','mail-interactions','../../config/environment','../../mysqldb','defaults','redis'];(function(_0x5b0782,_0x6f44a6){var _0x37f25a=function(_0x52fc15){while(--_0x52fc15){_0x5b0782['push'](_0x5b0782['shift']());}};_0x37f25a(++_0x6f44a6);}(_0x2454,0x8f));var _0x4245=function(_0x2c922d,_0x130279){_0x2c922d=_0x2c922d-0x0;var _0x55a601=_0x2454[_0x2c922d];return _0x55a601;};'use strict';var emlformat=require(_0x4245('0x0'));var moment=require(_0x4245('0x1'));var BPromise=require('bluebird');var util=require(_0x4245('0x2'));var path=require(_0x4245('0x3'));var fs=require('fs');var _=require('lodash');var Redis=require(_0x4245('0x4'));var htmlToText=require(_0x4245('0x5'));var qs=require(_0x4245('0x6'));var logger=require(_0x4245('0x7'))('api');var interaction_log=require(_0x4245('0x7'))(_0x4245('0x8'));var config=require(_0x4245('0x9'));var db=require(_0x4245('0xa'))['db'];config['redis']=_[_0x4245('0xb')](config[_0x4245('0xc')],{'host':_0x4245('0xd'),'port':0x18eb});var socket=require(_0x4245('0xe'))(new Redis(config['redis']));var htmlEntities=require(_0x4245('0xf'));require('./mailMessage.socket')['register'](socket);var jayson=require(_0x4245('0x10'));var client=jayson[_0x4245('0x11')][_0x4245('0x12')]({'port':0x232c});var client9003=jayson[_0x4245('0x11')][_0x4245('0x12')]({'port':0x232b});var client9002=jayson[_0x4245('0x11')][_0x4245('0x12')]({'port':0x232a});function respondWithRpcPromise(_0x2e4bca,_0xafe94,_0xa693e8,_0x359798){return new BPromise(function(_0x4b91ef,_0x1c25cc){var _0x36051a=_0x359798||client;return _0x36051a[_0x4245('0x13')](_0x2e4bca,_0xa693e8)[_0x4245('0x14')](function(_0x4b26cc){logger[_0x4245('0x15')]('MailMessage,\x20%s,\x20%s',_0xafe94,_0x4245('0x16'));logger[_0x4245('0x17')](_0x4245('0x18'),_0xafe94,_0x4245('0x16'),JSON['stringify'](_0x4b26cc));if(_0x4b26cc[_0x4245('0x19')]){if(_0x4b26cc[_0x4245('0x19')][_0x4245('0x1a')]===0x1f4){logger[_0x4245('0x19')](_0x4245('0x1b'),_0xafe94,_0x4b26cc[_0x4245('0x19')]['message']);return _0x1c25cc(_0x4b26cc['error'][_0x4245('0x1c')]);}logger[_0x4245('0x19')](_0x4245('0x1b'),_0xafe94,_0x4b26cc[_0x4245('0x19')][_0x4245('0x1c')]);return _0x4b91ef(_0x4b26cc[_0x4245('0x19')][_0x4245('0x1c')]);}else{logger['info'](_0x4245('0x1b'),_0xafe94,_0x4245('0x16'));_0x4b91ef(_0x4b26cc['result'][_0x4245('0x1c')]);}})['catch'](function(_0xaa6fe3){logger['error'](_0x4245('0x1b'),_0xafe94,_0xaa6fe3);_0x1c25cc(_0xaa6fe3);});});}function respondWithResult(_0x26bd86,_0x4cccf3){_0x4cccf3=_0x4cccf3||0xc8;return function(_0x14b857){if(_0x14b857){return _0x26bd86[_0x4245('0x1d')](_0x4cccf3)[_0x4245('0x1e')](_0x14b857);}};}function respondWithFilteredResult(_0x1d2d76,_0x42bf35){return function(_0x3d1d6f){if(_0x3d1d6f){var _0x1ca48f=typeof _0x42bf35[_0x4245('0x1f')]===_0x4245('0x20')&&typeof _0x42bf35['limit']==='undefined';var _0x5f495b=_0x3d1d6f['count'];var _0x2c66d8=_0x1ca48f?0x0:_0x42bf35[_0x4245('0x1f')];var _0x461e3c=_0x1ca48f?_0x3d1d6f['count']:_0x42bf35['offset']+_0x42bf35['limit'];var _0x4f9282;if(_0x461e3c>=_0x5f495b){_0x461e3c=_0x5f495b;_0x4f9282=0xc8;}else{_0x4f9282=0xce;}_0x1d2d76[_0x4245('0x1d')](_0x4f9282);return _0x1d2d76[_0x4245('0x21')](_0x4245('0x22'),_0x2c66d8+'-'+_0x461e3c+'/'+_0x5f495b)['json'](_0x3d1d6f);}return null;};}function saveUpdates(_0x5cd65f){return function(_0x27cae9){if(_0x27cae9){return _0x27cae9[_0x4245('0x23')](_0x5cd65f)['then'](function(_0x4bbeb9){return _0x4bbeb9;});}return null;};}function removeEntity(_0x592002){return function(_0x38fc7b){if(_0x38fc7b){return _0x38fc7b[_0x4245('0x24')]()['then'](function(){_0x592002[_0x4245('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x368691){return function(_0x424095){if(!_0x424095){_0x368691[_0x4245('0x25')](0x194);}return _0x424095;};}function handleError(_0x531a29,_0x2473f3){_0x2473f3=_0x2473f3||0x1f4;return function(_0x4a4dd6){logger['error'](_0x4a4dd6[_0x4245('0x26')]);if(_0x4a4dd6[_0x4245('0x27')]){delete _0x4a4dd6['name'];}_0x531a29['status'](_0x2473f3)[_0x4245('0x28')](_0x4a4dd6);};}exports[_0x4245('0x29')]=function(_0x4e806c,_0x560900){var _0x10f4a6={},_0x579c4b={},_0x3196c4={'count':0x0,'rows':[]};var _0x3597bc=_[_0x4245('0x2a')](db[_0x4245('0x2b')][_0x4245('0x2c')],function(_0x29dff5){return{'name':_0x29dff5[_0x4245('0x2d')],'type':_0x29dff5[_0x4245('0x2e')][_0x4245('0x2f')]};});_0x579c4b['model']=_[_0x4245('0x2a')](_0x3597bc,'name');_0x579c4b[_0x4245('0x30')]=_[_0x4245('0x31')](_0x4e806c[_0x4245('0x30')]);_0x579c4b['filters']=_['intersection'](_0x579c4b[_0x4245('0x32')],_0x579c4b[_0x4245('0x30')]);_0x10f4a6[_0x4245('0x33')]=_['intersection'](_0x579c4b[_0x4245('0x32')],qs['fields'](_0x4e806c[_0x4245('0x30')][_0x4245('0x34')]));_0x10f4a6[_0x4245('0x33')]=_0x10f4a6['attributes'][_0x4245('0x35')]?_0x10f4a6[_0x4245('0x33')]:_0x579c4b[_0x4245('0x32')];if(!_0x4e806c[_0x4245('0x30')]['hasOwnProperty']('nolimit')){_0x10f4a6[_0x4245('0x36')]=qs['limit'](_0x4e806c[_0x4245('0x30')]['limit']);_0x10f4a6[_0x4245('0x1f')]=qs[_0x4245('0x1f')](_0x4e806c[_0x4245('0x30')]['offset']);}_0x10f4a6[_0x4245('0x37')]=qs[_0x4245('0x38')](_0x4e806c[_0x4245('0x30')][_0x4245('0x38')]);_0x10f4a6['where']=qs[_0x4245('0x39')](_[_0x4245('0x3a')](_0x4e806c[_0x4245('0x30')],_0x579c4b[_0x4245('0x39')]),_0x3597bc);if(_0x4e806c[_0x4245('0x30')][_0x4245('0x3b')]){_0x10f4a6['where']=_['merge'](_0x10f4a6[_0x4245('0x3c')],{'$or':_['map'](_0x3597bc,function(_0x29458b){if(_0x29458b[_0x4245('0x2e')]!==_0x4245('0x3d')){var _0x710715={};_0x710715[_0x29458b[_0x4245('0x27')]]={'$like':'%'+_0x4e806c[_0x4245('0x30')][_0x4245('0x3b')]+'%'};return _0x710715;}})});}_0x10f4a6=_[_0x4245('0x3e')]({},_0x10f4a6,_0x4e806c[_0x4245('0x3f')]);var _0x3fd0e7={'where':_0x10f4a6[_0x4245('0x3c')]};return db[_0x4245('0x2b')][_0x4245('0x40')](_0x3fd0e7)['then'](function(_0x5c67c8){_0x3196c4[_0x4245('0x40')]=_0x5c67c8;if(_0x4e806c['query']['includeAll']){_0x10f4a6[_0x4245('0x41')]=[{'all':!![]}];}return db[_0x4245('0x2b')]['findAll'](_0x10f4a6);})[_0x4245('0x14')](function(_0x2629a3){_0x3196c4[_0x4245('0x42')]=_0x2629a3;return _0x3196c4;})['then'](respondWithFilteredResult(_0x560900,_0x10f4a6))[_0x4245('0x43')](handleError(_0x560900,null));};exports[_0x4245('0x44')]=function(_0x2e13e3,_0x10a1ed){var _0x2981fd={'raw':!![],'where':{'id':_0x2e13e3[_0x4245('0x45')]['id']}},_0x420a9e={};_0x420a9e[_0x4245('0x32')]=_['keys'](db[_0x4245('0x2b')][_0x4245('0x2c')]);_0x420a9e[_0x4245('0x30')]=_[_0x4245('0x31')](_0x2e13e3[_0x4245('0x30')]);_0x420a9e['filters']=_[_0x4245('0x46')](_0x420a9e[_0x4245('0x32')],_0x420a9e['query']);_0x2981fd[_0x4245('0x33')]=_[_0x4245('0x46')](_0x420a9e['model'],qs[_0x4245('0x34')](_0x2e13e3['query'][_0x4245('0x34')]));_0x2981fd[_0x4245('0x33')]=_0x2981fd[_0x4245('0x33')]['length']?_0x2981fd[_0x4245('0x33')]:_0x420a9e[_0x4245('0x32')];if(_0x2e13e3[_0x4245('0x30')][_0x4245('0x47')]){_0x2981fd[_0x4245('0x41')]=[{'all':!![]}];}_0x2981fd=_[_0x4245('0x3e')]({},_0x2981fd,_0x2e13e3[_0x4245('0x3f')]);return db['MailMessage'][_0x4245('0x48')](_0x2981fd)[_0x4245('0x14')](handleEntityNotFound(_0x10a1ed,null))['then'](respondWithResult(_0x10a1ed,null))[_0x4245('0x43')](handleError(_0x10a1ed,null));};exports['update']=function(_0xe03782,_0x2e2c01){if(_0xe03782[_0x4245('0x49')]['id']){delete _0xe03782[_0x4245('0x49')]['id'];}return db[_0x4245('0x2b')][_0x4245('0x48')]({'where':{'id':_0xe03782[_0x4245('0x45')]['id']}})[_0x4245('0x14')](handleEntityNotFound(_0x2e2c01,null))[_0x4245('0x14')](saveUpdates(_0xe03782[_0x4245('0x49')],null))[_0x4245('0x14')](respondWithResult(_0x2e2c01,null))[_0x4245('0x43')](handleError(_0x2e2c01,null));};exports[_0x4245('0x24')]=function(_0x4d3f9f,_0x11af3a){return db[_0x4245('0x2b')]['find']({'where':{'id':_0x4d3f9f[_0x4245('0x45')]['id']}})[_0x4245('0x14')](handleEntityNotFound(_0x11af3a,null))['then'](removeEntity(_0x11af3a,null))[_0x4245('0x43')](handleError(_0x11af3a,null));};exports[_0x4245('0x4a')]=function(_0x51bfaf,_0x15a05e){return db['MailMessage'][_0x4245('0x4a')]()[_0x4245('0x14')](respondWithResult(_0x15a05e,null))[_0x4245('0x43')](handleError(_0x15a05e,null));};exports[_0x4245('0x4b')]=function(_0x5f4233,_0x1b6726){return db[_0x4245('0x2b')][_0x4245('0x4b')](_0x5f4233[_0x4245('0x49')])[_0x4245('0x14')](function(_0x46d192){if(_0x46d192){if(_0x46d192[_0x4245('0x4c')]==='out'&&!_0x46d192[_0x4245('0x4d')]){var _0x2e6b08,_0x2e397a,_0x1b2eab;if(_0x5f4233[_0x4245('0x49')]['to']){_0x2e397a=_0x5f4233[_0x4245('0x49')]['to'][_0x4245('0x4e')](',')[0x0];}return db[_0x4245('0x4f')][_0x4245('0x50')]({'where':{'id':_0x46d192['MailAccountId']},'include':[{'model':db[_0x4245('0x51')],'as':_0x4245('0x52'),'include':[{'model':db['CmContact'],'as':_0x4245('0x53'),'where':{'email':_0x2e397a},'limit':0x1,'order':[[_0x4245('0x54'),_0x4245('0x55')]]}]},{'model':db[_0x4245('0x56')],'as':_0x4245('0x57'),'raw':!![],'include':[{'model':db[_0x4245('0x58')],'as':_0x4245('0x58'),'raw':!![]}]}]})[_0x4245('0x14')](function(_0x5a0294){_0x2e6b08=_0x5a0294;if(!_0x2e6b08||!_0x2e6b08[_0x4245('0x57')])return;var _0x44c025=_0x2e6b08['getSmtpOptions']();if(_0x5f4233[_0x4245('0x49')][_0x4245('0x59')]&&_0x5f4233[_0x4245('0x49')][_0x4245('0x59')][_0x4245('0x35')]){for(var _0xf28612=0x0;_0xf28612<_0x5f4233['body']['attachments'][_0x4245('0x35')];_0xf28612+=0x1){_0x5f4233[_0x4245('0x49')][_0x4245('0x59')][_0xf28612]={'filename':_0x5f4233['body']['attachments'][_0xf28612][_0x4245('0x27')],'path':path[_0x4245('0x5a')](config[_0x4245('0x5b')],_0x4245('0x5c'),_0x5f4233[_0x4245('0x49')][_0x4245('0x59')][_0xf28612][_0x4245('0x5d')])};}}_0x1b2eab={'account':_0x44c025,'message':_0x5f4233[_0x4245('0x49')]};return;})[_0x4245('0x14')](function(){if(_0x2e6b08[_0x4245('0x52')]){if(_0x2e6b08[_0x4245('0x52')][_0x4245('0x53')][_0x4245('0x35')]){return _0x2e6b08[_0x4245('0x52')][_0x4245('0x53')][0x0];}else{return db[_0x4245('0x5e')][_0x4245('0x4b')](_[_0x4245('0xb')](_0x5f4233['body'],{'firstName':_0x5f4233[_0x4245('0x49')]['to'],'email':_0x5f4233[_0x4245('0x49')]['to'],'phone':_0x5f4233[_0x4245('0x49')]['to'],'ListId':_0x2e6b08[_0x4245('0x5f')]}));}}else{throw new Error('List\x20not\x20found');}})[_0x4245('0x14')](function(){if(_0x1b2eab){return respondWithRpcPromise(_0x4245('0x60'),_0x4245('0x61'),_0x1b2eab,client9003)['then'](function(_0xbbd650){return _0x46d192['update']({'read':!![],'messageId':_0xbbd650[_0x4245('0x62')],'sentAt':moment()[_0x4245('0x63')]('YYYY-MM-DD\x20HH:mm:ss')});})['catch'](function(_0x11d108){logger[_0x4245('0x19')]('%s',JSON['stringify'](_0x11d108));return _0x46d192;});}return _0x46d192;});}return _0x46d192;}})[_0x4245('0x14')](respondWithResult(_0x1b6726,0xc9))[_0x4245('0x43')](handleError(_0x1b6726,null));};exports[_0x4245('0x64')]=function(_0x51e2a3,_0x233762){var _0x293f69={'agent':{},'channel':_0x4245('0x65')};if(_0x51e2a3[_0x4245('0x49')]['id']){delete _0x51e2a3['body']['id'];}_0x51e2a3[_0x4245('0x49')][_0x4245('0x66')]=!![];_0x51e2a3[_0x4245('0x49')]['readAt']=moment()['format'](_0x4245('0x67'));_0x51e2a3[_0x4245('0x49')][_0x4245('0x68')]=_0x51e2a3[_0x4245('0x49')][_0x4245('0x68')]||_0x51e2a3[_0x4245('0x69')]['id'];_0x293f69[_0x4245('0x6a')]['id']=_0x51e2a3[_0x4245('0x49')][_0x4245('0x68')];return db['MailMessage'][_0x4245('0x48')]({'where':{'id':_0x51e2a3[_0x4245('0x45')]['id'],'UserId':null}})[_0x4245('0x14')](handleEntityNotFound(_0x233762,null))['then'](saveUpdates(_0x51e2a3[_0x4245('0x49')],null))[_0x4245('0x14')](function(_0x516e81){if(_0x516e81){_0x293f69[_0x4245('0x1c')]=_0x516e81[_0x4245('0x6b')]({'plain':!![]});return db['MailInteraction']['find']({'where':{'id':_0x516e81[_0x4245('0x6c')]}});}return null;})[_0x4245('0x14')](handleEntityNotFound(_0x233762,null))['then'](function(_0x4f69b0){if(_0x4f69b0){return _0x4f69b0['update']({'UserId':_0x51e2a3['body'][_0x4245('0x68')],'read1stAt':_['isNil'](_0x4f69b0[_0x4245('0x6d')])?moment()[_0x4245('0x63')](_0x4245('0x67')):undefined});}return null;})[_0x4245('0x14')](function(_0x1d7f19){if(_0x1d7f19){_0x293f69[_0x4245('0x6e')]=_0x1d7f19[_0x4245('0x6b')]({'plain':!![]});interaction_log[_0x4245('0x15')](_0x4245('0x6f'),_0x51e2a3[_0x4245('0x69')]['id'],_0x51e2a3[_0x4245('0x69')]['name'],_0x51e2a3['user'][_0x4245('0x70')],_0x293f69[_0x4245('0x6e')]['id'],_0x51e2a3['body']?JSON[_0x4245('0x71')](_0x51e2a3[_0x4245('0x49')]):'null');return respondWithRpcPromise(_0x4245('0x72'),_0x4245('0x73'),_0x293f69);}return null;})['then'](function(_0x16932c){var _0x4ffe81=_0x4245('0x74')+_0x16932c[_0x4245('0x1c')]['ContactId'];return db['sequelize']['query'](_0x4ffe81,{'type':db[_0x4245('0x75')][_0x4245('0x76')][_0x4245('0x77')],'raw':!![]})[_0x4245('0x14')](function(_0x3a65ec){return _0x3a65ec;});})[_0x4245('0x14')](function(_0x10f819){if(_0x10f819){_0x293f69[_0x4245('0x1c')][_0x4245('0x78')]=_0x10f819[0x0];if(!_0x51e2a3[_0x4245('0x49')][_0x4245('0x68')])return;return db['User'][_0x4245('0x48')]({'where':{'id':_0x51e2a3[_0x4245('0x49')][_0x4245('0x68')],'role':'agent'},'attributes':['id',_0x4245('0x27'),_0x4245('0x79'),'email',_0x4245('0x7a')],'raw':!![]});}return null;})['then'](function(_0x430784){if(!_0x430784)return null;_0x293f69['message'][_0x4245('0x6a')]=_0x430784;return _0x293f69;})[_0x4245('0x14')](function(_0x28ae3e){if(_0x28ae3e){if(_0x51e2a3[_0x4245('0x49')]['manual']){_0x293f69[_0x4245('0x1c')][_0x4245('0x7b')]=util[_0x4245('0x63')](_0x4245('0x7c'),_0x51e2a3[_0x4245('0x69')][_0x4245('0x27')]);_0x293f69['message']['channel']=_0x293f69[_0x4245('0x7d')];_0x293f69[_0x4245('0x1c')]['motionChannel']=_0x293f69[_0x4245('0x7d')];_0x293f69[_0x4245('0x1c')][_0x4245('0x7e')]=_0x4245('0x64');_0x293f69[_0x4245('0x1c')]['body']=htmlToText[_0x4245('0x7f')](_0x293f69[_0x4245('0x1c')][_0x4245('0x49')]);return respondWithRpcPromise(_0x4245('0x80'),_0x4245('0x80'),{'event':'acceptmessage','message':_0x293f69[_0x4245('0x1c')]},client9002)[_0x4245('0x14')](function(){return _0x293f69;});}return _0x293f69;}return null;})[_0x4245('0x14')](respondWithResult(_0x233762,null))[_0x4245('0x43')](handleError(_0x233762,null));};exports[_0x4245('0x81')]=function(_0x18b2f8,_0x262ed0){var _0x4ff128={'agent':{},'channel':_0x4245('0x65')};if(_0x18b2f8[_0x4245('0x49')]['id']){delete _0x18b2f8[_0x4245('0x49')]['id'];}_0x18b2f8[_0x4245('0x49')][_0x4245('0x68')]=_0x18b2f8[_0x4245('0x49')][_0x4245('0x68')]||_0x18b2f8['user']['id'];_0x4ff128[_0x4245('0x6a')]['id']=_0x18b2f8[_0x4245('0x49')][_0x4245('0x68')];return db[_0x4245('0x2b')][_0x4245('0x48')]({'where':{'id':_0x18b2f8[_0x4245('0x45')]['id'],'UserId':null}})[_0x4245('0x14')](handleEntityNotFound(_0x262ed0,null))[_0x4245('0x14')](function(_0x3d3ab5){if(_0x3d3ab5){_0x4ff128[_0x4245('0x1c')]=_0x3d3ab5[_0x4245('0x6b')]({'plain':!![]});return db[_0x4245('0x82')][_0x4245('0x48')]({'where':{'id':_0x3d3ab5[_0x4245('0x6c')]}});}return null;})[_0x4245('0x14')](handleEntityNotFound(_0x262ed0,null))[_0x4245('0x14')](function(_0x5dfdb6){if(_0x5dfdb6){_0x4ff128[_0x4245('0x6e')]=_0x5dfdb6[_0x4245('0x6b')]({'plain':!![]});interaction_log[_0x4245('0x15')](_0x4245('0x83'),_0x18b2f8[_0x4245('0x69')]['id'],_0x18b2f8[_0x4245('0x69')][_0x4245('0x27')],_0x18b2f8[_0x4245('0x69')]['role'],_0x4ff128[_0x4245('0x6e')]['id'],_0x18b2f8[_0x4245('0x49')]?JSON[_0x4245('0x71')](_0x18b2f8[_0x4245('0x49')]):'null');return respondWithRpcPromise(_0x4245('0x84'),'rejectMessage',_0x4ff128);}return null;})[_0x4245('0x14')](function(_0x551eff){var _0x1d2e81='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x551eff['message'][_0x4245('0x85')];return db[_0x4245('0x86')][_0x4245('0x30')](_0x1d2e81,{'type':db[_0x4245('0x75')][_0x4245('0x76')][_0x4245('0x77')],'raw':!![]})[_0x4245('0x14')](function(_0x1f401c){return _0x1f401c;});})[_0x4245('0x14')](function(_0x48b9b2){if(_0x48b9b2){_0x4ff128[_0x4245('0x1c')][_0x4245('0x78')]=_0x48b9b2[0x0];if(!_0x18b2f8[_0x4245('0x49')][_0x4245('0x68')])return;return db[_0x4245('0x87')][_0x4245('0x48')]({'where':{'id':_0x18b2f8[_0x4245('0x49')][_0x4245('0x68')],'role':_0x4245('0x6a')},'attributes':['id',_0x4245('0x27'),_0x4245('0x79'),_0x4245('0x88'),_0x4245('0x7a')],'raw':!![]});}return null;})[_0x4245('0x14')](function(_0x5321d5){if(!_0x5321d5)return null;_0x4ff128[_0x4245('0x1c')][_0x4245('0x6a')]=_0x5321d5;return _0x4ff128;})[_0x4245('0x14')](function(_0x517cfd){if(_0x517cfd){_0x517cfd[_0x4245('0x1c')][_0x4245('0x7b')]=util[_0x4245('0x63')](_0x4245('0x7c'),_0x18b2f8[_0x4245('0x69')][_0x4245('0x27')]);_0x517cfd[_0x4245('0x1c')]['channel']=_0x4ff128[_0x4245('0x7d')];_0x517cfd[_0x4245('0x1c')][_0x4245('0x89')]=_0x4ff128[_0x4245('0x7d')];_0x517cfd[_0x4245('0x1c')][_0x4245('0x7e')]=_0x4245('0x81');_0x517cfd['message'][_0x4245('0x49')]=htmlToText[_0x4245('0x7f')](_0x4ff128[_0x4245('0x1c')]['body']);respondWithRpcPromise(_0x4245('0x80'),_0x4245('0x80'),{'event':_0x4245('0x8a'),'message':_0x517cfd['message']},client9002);return _0x4ff128;}return null;})['then'](respondWithResult(_0x262ed0,null))[_0x4245('0x43')](handleError(_0x262ed0,null));};exports[_0x4245('0x8b')]=function(_0x5c852e,_0x25c071){var _0x37024a=moment()[_0x4245('0x8c')]()['toString']();var _0x38d970=path[_0x4245('0x5a')](config[_0x4245('0x5b')],_0x4245('0x8d'),_0x4245('0x8e'),_0x4245('0x8f'));var _0x59a729=path[_0x4245('0x5a')](config[_0x4245('0x5b')],_0x4245('0x8d'),_0x4245('0x8e'),_0x4245('0x59'));var _0xc89797=util[_0x4245('0x63')](_0x4245('0x90'),_0x37024a);return db[_0x4245('0x2b')]['find']({'where':{'id':_0x5c852e[_0x4245('0x45')]['id']},'attributes':['id',_0x4245('0x49'),_0x4245('0x91'),'to','cc',_0x4245('0x92'),_0x4245('0x93'),_0x4245('0x94')],'include':_0x5c852e[_0x4245('0x30')]['attachments']?[{'model':db[_0x4245('0x95')],'as':_0x4245('0x96')}]:undefined})[_0x4245('0x14')](handleEntityNotFound(_0x25c071,null))['then'](function(_0x5d505c){if(_0x5d505c){var _0x42ccdb=_0x5d505c;var _0x584bf9={'from':_0x42ccdb['from'],'to':_0x42ccdb['to'],'subject':_0x42ccdb['subject'],'html':htmlEntities[_0x4245('0x97')](_0x42ccdb[_0x4245('0x49')]),'headers':{'Date':moment(_0x42ccdb['createdAt'])[_0x4245('0x63')]('ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ')},'attachments':[]};if(_0x5d505c['cc']){_0x584bf9[_0x4245('0x98')]['Cc']=_0x5d505c['cc'];}if(_0x5d505c[_0x4245('0x92')]){_0x584bf9['headers']['Bcc']=_0x5d505c['bcc'];}return new BPromise(function(_0x16d225,_0x17bae6){if(_0x5d505c[_0x4245('0x96')]){for(var _0x2c8b60=0x0;_0x2c8b60<_0x5d505c['Attachments']['length'];_0x2c8b60++){var _0x8baa9d=_0x5d505c[_0x4245('0x96')][_0x2c8b60];var _0x286d1a=path[_0x4245('0x5a')](_0x59a729,_0x8baa9d['basename']);if(fs['existsSync'](_0x286d1a)){_0x584bf9[_0x4245('0x59')]['push']({'name':_0x8baa9d[_0x4245('0x27')],'contentType':_0x8baa9d['type'],'data':fs[_0x4245('0x99')](_0x286d1a)});}}}emlformat[_0x4245('0x9a')](_0x584bf9,function(_0x55d1f1,_0x5cdf7e){if(_0x55d1f1)return _0x17bae6(_0x55d1f1);fs[_0x4245('0x9b')](path[_0x4245('0x5a')](_0x38d970,_0xc89797),_0x5cdf7e);return _0x16d225(_0x5cdf7e);});});}})['then'](function(_0x111fe6){if(_0x111fe6){return _0x25c071[_0x4245('0x8b')](path['join'](_0x38d970,_0xc89797),_0xc89797,function(_0x122288){if(!_0x122288)fs['unlinkSync'](path[_0x4245('0x5a')](_0x38d970,_0xc89797));});}})[_0x4245('0x43')](handleError(_0x25c071,null));}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.events.js b/server/api/mailMessage/mailMessage.events.js index adbf3b6..07b2429 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 _0xbb8e=['../../mysqldb','MailMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty','exports','events'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xbb8e,0x1a3));var _0xebb8=function(_0x334292,_0x4b363f){_0x334292=_0x334292-0x0;var _0x3ecafb=_0xbb8e[_0x334292];return _0x3ecafb;};'use strict';var EventEmitter=require(_0xebb8('0x0'));var MailMessage=require(_0xebb8('0x1'))['db'][_0xebb8('0x2')];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0xebb8('0x3')](0x0);var events={'afterCreate':_0xebb8('0x4'),'afterUpdate':_0xebb8('0x5'),'afterDestroy':_0xebb8('0x6')};function emitEvent(_0x56d0b4){return function(_0x3bfa44,_0x12b109,_0x2e4fe7){MailMessageEvents['emit'](_0x56d0b4+':'+_0x3bfa44['id'],_0x3bfa44);MailMessageEvents[_0xebb8('0x7')](_0x56d0b4,_0x3bfa44);_0x2e4fe7(null);};}for(var e in events){if(events[_0xebb8('0x8')](e)){var event=events[e];MailMessage['hook'](e,emitEvent(event));}}module[_0xebb8('0x9')]=MailMessageEvents; \ No newline at end of file +var _0x07db=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','MailMessage','setMaxListeners','save','update','remove'];(function(_0x4c0622,_0x5dacaf){var _0x1799d8=function(_0x2ba801){while(--_0x2ba801){_0x4c0622['push'](_0x4c0622['shift']());}};_0x1799d8(++_0x5dacaf);}(_0x07db,0xbf));var _0xb07d=function(_0x337800,_0x1e986e){_0x337800=_0x337800-0x0;var _0x2caa1d=_0x07db[_0x337800];return _0x2caa1d;};'use strict';var EventEmitter=require(_0xb07d('0x0'));var MailMessage=require(_0xb07d('0x1'))['db'][_0xb07d('0x2')];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0xb07d('0x3')](0x0);var events={'afterCreate':_0xb07d('0x4'),'afterUpdate':_0xb07d('0x5'),'afterDestroy':_0xb07d('0x6')};function emitEvent(_0x54db57){return function(_0x34cdfd,_0x26a46a,_0xc8d712){MailMessageEvents[_0xb07d('0x7')](_0x54db57+':'+_0x34cdfd['id'],_0x34cdfd);MailMessageEvents[_0xb07d('0x7')](_0x54db57,_0x34cdfd);_0xc8d712(null);};}for(var e in events){if(events[_0xb07d('0x8')](e)){var event=events[e];MailMessage[_0xb07d('0x9')](e,emitEvent(event));}}module[_0xb07d('0xa')]=MailMessageEvents; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.model.js b/server/api/mailMessage/mailMessage.model.js index 19c199d..2ddb842 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 _0xb5af=['path','../../config/environment','./mailMessage.attributes','exports','MailMessage','mail_messages','fti_mail_messages','plainBody','subject','FULLTEXT','fromString','body','models','get','toLowerCase','out','secret','isNil','UserId','MailInteraction','findOne','MailInteractionId','then','update','createdAt','direction','error','utf8mb4_unicode_ci','util','api','bluebird','request-promise','html-to-text'];(function(_0x48d861,_0x5747b6){var _0xdea746=function(_0x1bd079){while(--_0x1bd079){_0x48d861['push'](_0x48d861['shift']());}};_0xdea746(++_0x5747b6);}(_0xb5af,0x1c9));var _0xfb5a=function(_0x122a16,_0x2d0003){_0x122a16=_0x122a16-0x0;var _0x288372=_0xb5af[_0x122a16];return _0x288372;};'use strict';var _=require('lodash');var util=require(_0xfb5a('0x0'));var logger=require('../../config/logger')(_0xfb5a('0x1'));var moment=require('moment');var BPromise=require(_0xfb5a('0x2'));var rp=require(_0xfb5a('0x3'));var htmlToText=require(_0xfb5a('0x4'));var fs=require('fs');var path=require(_0xfb5a('0x5'));var rimraf=require('rimraf');var config=require(_0xfb5a('0x6'));var attributes=require(_0xfb5a('0x7'));module[_0xfb5a('0x8')]=function(_0x38912a,_0x262597){return _0x38912a['define'](_0xfb5a('0x9'),attributes,{'tableName':_0xfb5a('0xa'),'paranoid':![],'indexes':[{'name':'messageId','fields':['messageId']},{'name':_0xfb5a('0xb'),'fields':[_0xfb5a('0xc'),_0xfb5a('0xd')],'type':_0xfb5a('0xe')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x71d72b,_0x19a7cb,_0x467cf2){if(_0x71d72b['body']){_0x71d72b[_0xfb5a('0xc')]=htmlToText[_0xfb5a('0xf')](_0x71d72b[_0xfb5a('0x10')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x467cf2(null,_0x19a7cb);},'afterCreate':function(_0x2f1035,_0x4ff4c6,_0x3c8894){var _0x53cbeb=_0x38912a[_0xfb5a('0x11')];var _0x56dd60=_0x2f1035[_0xfb5a('0x12')]({'plain':!![]});if(_0x56dd60['direction']['toLowerCase']()==='in'||_0x56dd60['direction'][_0xfb5a('0x13')]()===_0xfb5a('0x14')&&!_0x56dd60[_0xfb5a('0x15')]&&!_[_0xfb5a('0x16')](_0x56dd60[_0xfb5a('0x17')])){_0x53cbeb[_0xfb5a('0x18')][_0xfb5a('0x19')]({'where':{'id':_0x56dd60[_0xfb5a('0x1a')]}})[_0xfb5a('0x1b')](function(_0x1e7085){if(_0x1e7085){_0x1e7085[_0xfb5a('0x1c')]({'lastMsgAt':_0x56dd60[_0xfb5a('0x1d')],'lastMsgDirection':_0x56dd60[_0xfb5a('0x1e')][_0xfb5a('0x13')]()});}})['catch'](function(_0x1b8e9f){console[_0xfb5a('0x1f')](_0x1b8e9f);});}_0x3c8894();}},'charset':'utf8mb4','collate':_0xfb5a('0x20')});}; \ No newline at end of file +var _0x46b7=['rimraf','../../config/environment','define','MailMessage','messageId','fti_mail_messages','plainBody','subject','FULLTEXT','body','fromString','models','get','direction','toLowerCase','out','secret','isNil','findOne','MailInteractionId','then','update','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','api','bluebird','request-promise','html-to-text','path'];(function(_0x23fab5,_0x36e4ff){var _0x49c7b8=function(_0x4e86e1){while(--_0x4e86e1){_0x23fab5['push'](_0x23fab5['shift']());}};_0x49c7b8(++_0x36e4ff);}(_0x46b7,0x1c8));var _0x746b=function(_0x582a04,_0x54c6c4){_0x582a04=_0x582a04-0x0;var _0x5e3a27=_0x46b7[_0x582a04];return _0x5e3a27;};'use strict';var _=require(_0x746b('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x746b('0x1'));var moment=require('moment');var BPromise=require(_0x746b('0x2'));var rp=require(_0x746b('0x3'));var htmlToText=require(_0x746b('0x4'));var fs=require('fs');var path=require(_0x746b('0x5'));var rimraf=require(_0x746b('0x6'));var config=require(_0x746b('0x7'));var attributes=require('./mailMessage.attributes');module['exports']=function(_0x12ceb8,_0x481aa7){return _0x12ceb8[_0x746b('0x8')](_0x746b('0x9'),attributes,{'tableName':'mail_messages','paranoid':![],'indexes':[{'name':_0x746b('0xa'),'fields':[_0x746b('0xa')]},{'name':_0x746b('0xb'),'fields':[_0x746b('0xc'),_0x746b('0xd')],'type':_0x746b('0xe')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x53b281,_0x1a2b9c,_0xa80bf6){if(_0x53b281[_0x746b('0xf')]){_0x53b281[_0x746b('0xc')]=htmlToText[_0x746b('0x10')](_0x53b281[_0x746b('0xf')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0xa80bf6(null,_0x1a2b9c);},'afterCreate':function(_0x5a1a8f,_0x9e2b47,_0xb2c625){var _0x1e7659=_0x12ceb8[_0x746b('0x11')];var _0xe3d602=_0x5a1a8f[_0x746b('0x12')]({'plain':!![]});if(_0xe3d602[_0x746b('0x13')]['toLowerCase']()==='in'||_0xe3d602[_0x746b('0x13')][_0x746b('0x14')]()===_0x746b('0x15')&&!_0xe3d602[_0x746b('0x16')]&&!_[_0x746b('0x17')](_0xe3d602['UserId'])){_0x1e7659['MailInteraction'][_0x746b('0x18')]({'where':{'id':_0xe3d602[_0x746b('0x19')]}})[_0x746b('0x1a')](function(_0x2356a5){if(_0x2356a5){_0x2356a5[_0x746b('0x1b')]({'lastMsgAt':_0xe3d602[_0x746b('0x1c')],'lastMsgDirection':_0xe3d602[_0x746b('0x13')][_0x746b('0x14')]()});}})[_0x746b('0x1d')](function(_0x3dfc31){console[_0x746b('0x1e')](_0x3dfc31);});}_0xb2c625();}},'charset':_0x746b('0x1f'),'collate':_0x746b('0x20')});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.rpc.js b/server/api/mailMessage/mailMessage.rpc.js index 96f9d68..a128ac2 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 _0x4cf8=['./mailMessage.socket','request','then','MailMessage,\x20%s,\x20%s','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','CreateMailMessage','MailMessage','create','body','options','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','redis','localhost'];(function(_0x2f271d,_0x498da5){var _0xf387ea=function(_0x3ff16e){while(--_0x3ff16e){_0x2f271d['push'](_0x2f271d['shift']());}};_0xf387ea(++_0x498da5);}(_0x4cf8,0x1e1));var _0x84cf=function(_0x4734d8,_0x479950){_0x4734d8=_0x4734d8-0x0;var _0x3b1120=_0x4cf8[_0x4734d8];return _0x3b1120;};'use strict';var _=require(_0x84cf('0x0'));var util=require(_0x84cf('0x1'));var moment=require(_0x84cf('0x2'));var BPromise=require(_0x84cf('0x3'));var rs=require(_0x84cf('0x4'));var fs=require('fs');var Redis=require(_0x84cf('0x5'));var db=require(_0x84cf('0x6'))['db'];var utils=require(_0x84cf('0x7'));var logger=require(_0x84cf('0x8'))(_0x84cf('0x9'));var config=require(_0x84cf('0xa'));var jayson=require(_0x84cf('0xb'));var client=jayson['client']['http']({'port':0x232a});config[_0x84cf('0xc')]=_['defaults'](config[_0x84cf('0xc')],{'host':_0x84cf('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x84cf('0xc')]));require(_0x84cf('0xe'))['register'](socket);function respondWithRpcPromise(_0xfb5398,_0x1b223d,_0x390ce9){return new BPromise(function(_0x369ce6,_0x50d667){return client[_0x84cf('0xf')](_0xfb5398,_0x390ce9)[_0x84cf('0x10')](function(_0x4db0a7){logger['info'](_0x84cf('0x11'),_0x1b223d,_0x84cf('0x12'));logger[_0x84cf('0x13')](_0x84cf('0x14'),_0x1b223d,_0x84cf('0x12'),JSON[_0x84cf('0x15')](_0x4db0a7));if(_0x4db0a7[_0x84cf('0x16')]){if(_0x4db0a7[_0x84cf('0x16')][_0x84cf('0x17')]===0x1f4){logger[_0x84cf('0x16')](_0x84cf('0x11'),_0x1b223d,_0x4db0a7[_0x84cf('0x16')][_0x84cf('0x18')]);return _0x50d667(_0x4db0a7[_0x84cf('0x16')][_0x84cf('0x18')]);}logger[_0x84cf('0x16')](_0x84cf('0x11'),_0x1b223d,_0x4db0a7[_0x84cf('0x16')][_0x84cf('0x18')]);return _0x369ce6(_0x4db0a7['error'][_0x84cf('0x18')]);}else{logger[_0x84cf('0x19')](_0x84cf('0x11'),_0x1b223d,_0x84cf('0x12'));_0x369ce6(_0x4db0a7[_0x84cf('0x1a')][_0x84cf('0x18')]);}})[_0x84cf('0x1b')](function(_0x5d5650){logger['error'](_0x84cf('0x11'),_0x1b223d,_0x5d5650);_0x50d667(_0x5d5650);});});}exports[_0x84cf('0x1c')]=function(_0x346b43){var _0x3e65e3=this;return new Promise(function(_0x219afa,_0x5dda3f){return db[_0x84cf('0x1d')][_0x84cf('0x1e')](_0x346b43[_0x84cf('0x1f')],{'raw':_0x346b43[_0x84cf('0x20')]?_0x346b43[_0x84cf('0x20')]['raw']===undefined?!![]:![]:!![]})[_0x84cf('0x10')](function(_0x160f86){logger[_0x84cf('0x19')](_0x84cf('0x1c'),_0x346b43);logger[_0x84cf('0x13')](_0x84cf('0x1c'),_0x346b43,JSON[_0x84cf('0x15')](_0x160f86));_0x219afa(_0x160f86);})['catch'](function(_0x2b2c90){logger[_0x84cf('0x16')](_0x84cf('0x1c'),_0x2b2c90[_0x84cf('0x18')],_0x346b43);_0x5dda3f(_0x3e65e3[_0x84cf('0x16')](0x1f4,_0x2b2c90[_0x84cf('0x18')]));});});}; \ No newline at end of file +var _0x6d11=['options','raw','CreateMailMessage','debug','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','redis','defaults','./mailMessage.socket','register','request','then','info','MailMessage,\x20%s,\x20%s','request\x20sent','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','MailMessage','create','body'];(function(_0x3eb30d,_0x3a10aa){var _0x496384=function(_0x47c16b){while(--_0x47c16b){_0x3eb30d['push'](_0x3eb30d['shift']());}};_0x496384(++_0x3a10aa);}(_0x6d11,0xbf));var _0x16d1=function(_0x195223,_0x121404){_0x195223=_0x195223-0x0;var _0x3a62dd=_0x6d11[_0x195223];return _0x3a62dd;};'use strict';var _=require(_0x16d1('0x0'));var util=require(_0x16d1('0x1'));var moment=require(_0x16d1('0x2'));var BPromise=require('bluebird');var rs=require(_0x16d1('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x16d1('0x4'))['db'];var utils=require(_0x16d1('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x16d1('0x6'));var jayson=require(_0x16d1('0x7'));var client=jayson[_0x16d1('0x8')][_0x16d1('0x9')]({'port':0x232a});config[_0x16d1('0xa')]=_[_0x16d1('0xb')](config[_0x16d1('0xa')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x16d1('0xc'))[_0x16d1('0xd')](socket);function respondWithRpcPromise(_0xe67758,_0x5a6abb,_0x4b7d4f){return new BPromise(function(_0x265a84,_0x2c360f){return client[_0x16d1('0xe')](_0xe67758,_0x4b7d4f)[_0x16d1('0xf')](function(_0x28188f){logger[_0x16d1('0x10')](_0x16d1('0x11'),_0x5a6abb,_0x16d1('0x12'));logger['debug'](_0x16d1('0x13'),_0x5a6abb,_0x16d1('0x12'),JSON[_0x16d1('0x14')](_0x28188f));if(_0x28188f[_0x16d1('0x15')]){if(_0x28188f[_0x16d1('0x15')]['code']===0x1f4){logger[_0x16d1('0x15')](_0x16d1('0x11'),_0x5a6abb,_0x28188f[_0x16d1('0x15')][_0x16d1('0x16')]);return _0x2c360f(_0x28188f[_0x16d1('0x15')][_0x16d1('0x16')]);}logger[_0x16d1('0x15')]('MailMessage,\x20%s,\x20%s',_0x5a6abb,_0x28188f[_0x16d1('0x15')][_0x16d1('0x16')]);return _0x265a84(_0x28188f['error']['message']);}else{logger[_0x16d1('0x10')]('MailMessage,\x20%s,\x20%s',_0x5a6abb,_0x16d1('0x12'));_0x265a84(_0x28188f['result'][_0x16d1('0x16')]);}})['catch'](function(_0x30f694){logger[_0x16d1('0x15')]('MailMessage,\x20%s,\x20%s',_0x5a6abb,_0x30f694);_0x2c360f(_0x30f694);});});}exports['CreateMailMessage']=function(_0x52a0f2){var _0x5b9599=this;return new Promise(function(_0x348425,_0x55a0e0){return db[_0x16d1('0x17')][_0x16d1('0x18')](_0x52a0f2[_0x16d1('0x19')],{'raw':_0x52a0f2[_0x16d1('0x1a')]?_0x52a0f2['options'][_0x16d1('0x1b')]===undefined?!![]:![]:!![]})[_0x16d1('0xf')](function(_0x2a897d){logger['info'](_0x16d1('0x1c'),_0x52a0f2);logger[_0x16d1('0x1d')](_0x16d1('0x1c'),_0x52a0f2,JSON[_0x16d1('0x14')](_0x2a897d));_0x348425(_0x2a897d);})[_0x16d1('0x1e')](function(_0x1448b7){logger[_0x16d1('0x15')](_0x16d1('0x1c'),_0x1448b7[_0x16d1('0x16')],_0x52a0f2);_0x55a0e0(_0x5b9599[_0x16d1('0x15')](0x1f4,_0x1448b7[_0x16d1('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.socket.js b/server/api/mailMessage/mailMessage.socket.js index 5c54f70..6ef546b 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 _0x3c7b=['remove','update','removeListener','length','mailMessage:','./mailMessage.events','save'];(function(_0x580576,_0x2f107d){var _0x3f55a0=function(_0x2e180b){while(--_0x2e180b){_0x580576['push'](_0x580576['shift']());}};_0x3f55a0(++_0x2f107d);}(_0x3c7b,0x11d));var _0xb3c7=function(_0x114ab3,_0x2866e8){_0x114ab3=_0x114ab3-0x0;var _0x59e808=_0x3c7b[_0x114ab3];return _0x59e808;};'use strict';var MailMessageEvents=require(_0xb3c7('0x0'));var events=[_0xb3c7('0x1'),_0xb3c7('0x2'),_0xb3c7('0x3')];function createListener(_0x22a73c,_0x4e4405){return function(_0x4a83a4){_0x4e4405['emit'](_0x22a73c,_0x4a83a4);};}function removeListener(_0x5b34ef,_0x234fe5){return function(){MailMessageEvents[_0xb3c7('0x4')](_0x5b34ef,_0x234fe5);};}exports['register']=function(_0x396a46){for(var _0x5b810b=0x0,_0x255f3d=events[_0xb3c7('0x5')];_0x5b810b<_0x255f3d;_0x5b810b++){var _0x341a27=events[_0x5b810b];var _0x1851a5=createListener(_0xb3c7('0x6')+_0x341a27,_0x396a46);MailMessageEvents['on'](_0x341a27,_0x1851a5);}}; \ No newline at end of file +var _0x48d5=['removeListener','register','mailMessage:','./mailMessage.events','update'];(function(_0x58ed67,_0x43fb50){var _0x67e41b=function(_0x5f3911){while(--_0x5f3911){_0x58ed67['push'](_0x58ed67['shift']());}};_0x67e41b(++_0x43fb50);}(_0x48d5,0xa8));var _0x548d=function(_0x2e1d5c,_0x337970){_0x2e1d5c=_0x2e1d5c-0x0;var _0x1c44c1=_0x48d5[_0x2e1d5c];return _0x1c44c1;};'use strict';var MailMessageEvents=require(_0x548d('0x0'));var events=['save','remove',_0x548d('0x1')];function createListener(_0x4c5423,_0x2f1e17){return function(_0x55737e){_0x2f1e17['emit'](_0x4c5423,_0x55737e);};}function removeListener(_0x4afe09,_0x43bccf){return function(){MailMessageEvents[_0x548d('0x2')](_0x4afe09,_0x43bccf);};}exports[_0x548d('0x3')]=function(_0x230d89){for(var _0x340cc5=0x0,_0x46ea18=events['length'];_0x340cc5<_0x46ea18;_0x340cc5++){var _0x22f21e=events[_0x340cc5];var _0x163062=createListener(_0x548d('0x4')+_0x22f21e,_0x230d89);MailMessageEvents['on'](_0x22f21e,_0x163062);}}; \ No newline at end of file diff --git a/server/api/mailQueue/index.js b/server/api/mailQueue/index.js index 4fdb068..2437341 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 _0x9355=['post','put','delete','destroy','removeAgents','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailQueue.controller','get','isAuthenticated','describe','/:id','/:id/members','/:id/teams','getTeams','/:id/users','getAgents','create'];(function(_0x475502,_0x36d0fe){var _0x2c2019=function(_0x498069){while(--_0x498069){_0x475502['push'](_0x475502['shift']());}};_0x2c2019(++_0x36d0fe);}(_0x9355,0x1e1));var _0x5935=function(_0x526d17,_0x157972){_0x526d17=_0x526d17-0x0;var _0x533931=_0x9355[_0x526d17];return _0x533931;};'use strict';var multer=require(_0x5935('0x0'));var util=require(_0x5935('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x5935('0x2'));var router=express[_0x5935('0x3')]();var fs_extra=require(_0x5935('0x4'));var auth=require(_0x5935('0x5'));var interaction=require(_0x5935('0x6'));var config=require(_0x5935('0x7'));var controller=require(_0x5935('0x8'));router[_0x5935('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x5935('0x9')]('/describe',auth[_0x5935('0xa')](),controller[_0x5935('0xb')]);router[_0x5935('0x9')](_0x5935('0xc'),auth[_0x5935('0xa')](),controller['show']);router[_0x5935('0x9')](_0x5935('0xd'),auth['isAuthenticated'](),controller['getMembers']);router['get'](_0x5935('0xe'),auth['isAuthenticated'](),controller[_0x5935('0xf')]);router[_0x5935('0x9')](_0x5935('0x10'),auth[_0x5935('0xa')](),controller[_0x5935('0x11')]);router['post']('/',auth[_0x5935('0xa')](),controller[_0x5935('0x12')]);router[_0x5935('0x13')](_0x5935('0xe'),auth[_0x5935('0xa')](),controller['addTeams']);router[_0x5935('0x13')]('/:id/users',auth[_0x5935('0xa')](),controller['addAgents']);router[_0x5935('0x14')]('/:id',auth[_0x5935('0xa')](),controller['update']);router[_0x5935('0x15')](_0x5935('0xc'),auth[_0x5935('0xa')](),controller[_0x5935('0x16')]);router['delete'](_0x5935('0xe'),auth[_0x5935('0xa')](),controller['removeTeams']);router[_0x5935('0x15')](_0x5935('0x10'),auth[_0x5935('0xa')](),controller[_0x5935('0x17')]);module[_0x5935('0x18')]=router; \ No newline at end of file +var _0x17a0=['../../components/interaction/service','../../config/environment','./mailQueue.controller','isAuthenticated','get','/describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','put','destroy','delete','removeAgents','exports','multer','util','connect-timeout','express','fs-extra'];(function(_0x60998,_0x7606ad){var _0x2f2786=function(_0x2242b1){while(--_0x2242b1){_0x60998['push'](_0x60998['shift']());}};_0x2f2786(++_0x7606ad);}(_0x17a0,0x67));var _0x017a=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x17a0[_0x2dafbe];return _0x58a45a;};'use strict';var multer=require(_0x017a('0x0'));var util=require(_0x017a('0x1'));var path=require('path');var timeout=require(_0x017a('0x2'));var express=require(_0x017a('0x3'));var router=express['Router']();var fs_extra=require(_0x017a('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x017a('0x5'));var config=require(_0x017a('0x6'));var controller=require(_0x017a('0x7'));router['get']('/',auth[_0x017a('0x8')](),controller['index']);router[_0x017a('0x9')](_0x017a('0xa'),auth[_0x017a('0x8')](),controller['describe']);router[_0x017a('0x9')](_0x017a('0xb'),auth[_0x017a('0x8')](),controller[_0x017a('0xc')]);router[_0x017a('0x9')](_0x017a('0xd'),auth['isAuthenticated'](),controller[_0x017a('0xe')]);router[_0x017a('0x9')](_0x017a('0xf'),auth[_0x017a('0x8')](),controller[_0x017a('0x10')]);router['get'](_0x017a('0x11'),auth[_0x017a('0x8')](),controller[_0x017a('0x12')]);router[_0x017a('0x13')]('/',auth[_0x017a('0x8')](),controller[_0x017a('0x14')]);router[_0x017a('0x13')]('/:id/teams',auth[_0x017a('0x8')](),controller[_0x017a('0x15')]);router['post'](_0x017a('0x11'),auth['isAuthenticated'](),controller['addAgents']);router[_0x017a('0x16')](_0x017a('0xb'),auth[_0x017a('0x8')](),controller['update']);router['delete'](_0x017a('0xb'),auth[_0x017a('0x8')](),controller[_0x017a('0x17')]);router['delete']('/:id/teams',auth[_0x017a('0x8')](),controller['removeTeams']);router[_0x017a('0x18')](_0x017a('0x11'),auth[_0x017a('0x8')](),controller[_0x017a('0x19')]);module[_0x017a('0x1a')]=router; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.attributes.js b/server/api/mailQueue/mailQueue.attributes.js index 1e40810..ffc8184 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 _0x0e4f=['rrmemory','beepall','roundrobin','name'];(function(_0x556bb1,_0x34830d){var _0x45455f=function(_0x13c6ba){while(--_0x13c6ba){_0x556bb1['push'](_0x556bb1['shift']());}};_0x45455f(++_0x34830d);}(_0x0e4f,0x1e7));var _0xf0e4=function(_0x1cb5df,_0x575312){_0x1cb5df=_0x1cb5df-0x0;var _0x4045a9=_0x0e4f[_0x1cb5df];return _0x4045a9;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0xf0e4('0x0'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0xf0e4('0x1'),_0xf0e4('0x2'),_0xf0e4('0x3'))}}; \ No newline at end of file +var _0x9fbc=['STRING','rrmemory','roundrobin','sequelize','exports'];(function(_0x1e6e4e,_0x2b1b09){var _0x3d746b=function(_0x4483dd){while(--_0x4483dd){_0x1e6e4e['push'](_0x1e6e4e['shift']());}};_0x3d746b(++_0x2b1b09);}(_0x9fbc,0x8f));var _0xc9fb=function(_0x5bc27a,_0x32e2d1){_0x5bc27a=_0x5bc27a-0x0;var _0x2c8a4d=_0x9fbc[_0x5bc27a];return _0x2c8a4d;};'use strict';var Sequelize=require(_0xc9fb('0x0'));module[_0xc9fb('0x1')]={'name':{'type':Sequelize[_0xc9fb('0x2')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xc9fb('0x2')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0xc9fb('0x3'),'beepall',_0xc9fb('0x4'))}}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.controller.js b/server/api/mailQueue/mailQueue.controller.js index d2468c6..7a1e16b 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 _0xa870=['voicePause','interface','transaction','each','findOrCreate','userMailQueue:save','select','field','tq.TeamId','from','team_has_mail_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','MailQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','sequelize','toString','QueryTypes','every','includes','all','compact','value','isEmpty','removeAgents','forEach','emit','userMailQueue:remove','addAgents','ids','omit','getAgents','hasOwnProperty','bluebird','util','lodash','squel','ioredis','../../components/parsers/qs','api','../../config/environment','../../mysqldb','defaults','redis','./mailQueue.socket','register','status','end','json','offset','limit','undefined','count','Content-Range','update','then','get','MailQueues','destroy','sendStatus','stack','name','index','map','fieldName','type','key','getOptions','MailQueue','include','findAll','rows','catch','show','params','rawAttributes','query','keys','filters','attributes','intersection','fields','length','model','merge','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getMembers','findOne','UserMailQueue','order','sort','pick','MailQueueId','where','User','findAndCountAll','agent','mailPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','Team','filter','nolimit','addTeams','Agents','online'];(function(_0x1589dd,_0x2b9d22){var _0x1bddd1=function(_0x3687f8){while(--_0x3687f8){_0x1589dd['push'](_0x1589dd['shift']());}};_0x1bddd1(++_0x2b9d22);}(_0xa870,0x198));var _0x0a87=function(_0x2ba886,_0x318c61){_0x2ba886=_0x2ba886-0x0;var _0x6d193e=_0xa870[_0x2ba886];return _0x6d193e;};'use strict';var BPromise=require(_0x0a87('0x0'));var util=require(_0x0a87('0x1'));var _=require(_0x0a87('0x2'));var squel=require(_0x0a87('0x3'));var Redis=require(_0x0a87('0x4'));var qs=require(_0x0a87('0x5'));var logger=require('../../config/logger')(_0x0a87('0x6'));var config=require(_0x0a87('0x7'));var db=require(_0x0a87('0x8'))['db'];config['redis']=_[_0x0a87('0x9')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0a87('0xa')]));require(_0x0a87('0xb'))[_0x0a87('0xc')](socket);function respondWithStatusCode(_0x2ae2f1,_0x416b99){_0x416b99=_0x416b99||0xcc;return function(_0x1e2f52){if(_0x1e2f52){return _0x2ae2f1['sendStatus'](_0x416b99);}return _0x2ae2f1[_0x0a87('0xd')](_0x416b99)[_0x0a87('0xe')]();};}function respondWithResult(_0x436254,_0x39f5c9){_0x39f5c9=_0x39f5c9||0xc8;return function(_0xd0eaa0){if(_0xd0eaa0){return _0x436254[_0x0a87('0xd')](_0x39f5c9)[_0x0a87('0xf')](_0xd0eaa0);}};}function respondWithFilteredResult(_0x1420e0,_0x16f849){return function(_0x10bc5b){if(_0x10bc5b){var _0x750f78=typeof _0x16f849[_0x0a87('0x10')]==='undefined'&&typeof _0x16f849[_0x0a87('0x11')]===_0x0a87('0x12');var _0x7e047a=_0x10bc5b[_0x0a87('0x13')];var _0x4de4db=_0x750f78?0x0:_0x16f849[_0x0a87('0x10')];var _0x5cfd17=_0x750f78?_0x10bc5b['count']:_0x16f849[_0x0a87('0x10')]+_0x16f849['limit'];var _0x1d2cef;if(_0x5cfd17>=_0x7e047a){_0x5cfd17=_0x7e047a;_0x1d2cef=0xc8;}else{_0x1d2cef=0xce;}_0x1420e0[_0x0a87('0xd')](_0x1d2cef);return _0x1420e0['set'](_0x0a87('0x14'),_0x4de4db+'-'+_0x5cfd17+'/'+_0x7e047a)[_0x0a87('0xf')](_0x10bc5b);}return null;};}function saveUpdates(_0x32fee1){return function(_0x7ef949){if(_0x7ef949){return _0x7ef949[_0x0a87('0x15')](_0x32fee1)[_0x0a87('0x16')](function(_0x11e5c7){return _0x11e5c7;});}return null;};}function removeEntity(_0x22147d){return function(_0x47712b){if(_0x47712b){return _0x47712b['destroy']()['then'](function(){var _0x34e183=_0x47712b[_0x0a87('0x17')]({'plain':!![]});var _0x412c2c=_0x0a87('0x18');return db['UserProfileResource'][_0x0a87('0x19')]({'where':{'type':_0x412c2c,'resourceId':_0x34e183['id']}})[_0x0a87('0x16')](function(){return _0x47712b;});})[_0x0a87('0x16')](function(){_0x22147d[_0x0a87('0xd')](0xcc)[_0x0a87('0xe')]();});}};}function handleEntityNotFound(_0x7ba120){return function(_0xe2b58f){if(!_0xe2b58f){_0x7ba120[_0x0a87('0x1a')](0x194);}return _0xe2b58f;};}function handleError(_0x5b92f7,_0x4fa707){_0x4fa707=_0x4fa707||0x1f4;return function(_0x483bd5){logger['error'](_0x483bd5[_0x0a87('0x1b')]);if(_0x483bd5['name']){delete _0x483bd5[_0x0a87('0x1c')];}_0x5b92f7[_0x0a87('0xd')](_0x4fa707)['send'](_0x483bd5);};}exports[_0x0a87('0x1d')]=function(_0x542580,_0x2e7aa6){var _0x32ba82={};var _0x40f633={'count':0x0,'rows':[]};var _0x27e098=_[_0x0a87('0x1e')](db['MailQueue']['rawAttributes'],function(_0x5e75c4){return{'name':_0x5e75c4[_0x0a87('0x1f')],'type':_0x5e75c4[_0x0a87('0x20')][_0x0a87('0x21')]};});_0x32ba82=qs[_0x0a87('0x22')](_0x27e098,_0x542580);var _0x5b67a2={'where':_0x32ba82['where']};return db[_0x0a87('0x23')]['count'](_0x5b67a2)['then'](function(_0x1feff4){_0x40f633[_0x0a87('0x13')]=_0x1feff4;_0x32ba82[_0x0a87('0x24')]=qs[_0x0a87('0x24')](_0x542580['query']);return db[_0x0a87('0x23')][_0x0a87('0x25')](_0x32ba82);})['then'](function(_0x4c8822){_0x40f633[_0x0a87('0x26')]=_0x4c8822;return _0x40f633;})[_0x0a87('0x16')](respondWithFilteredResult(_0x2e7aa6,_0x32ba82))[_0x0a87('0x27')](handleError(_0x2e7aa6,null));};exports[_0x0a87('0x28')]=function(_0x1c1269,_0x428312){var _0x575b14={'raw':!![],'where':{'id':_0x1c1269[_0x0a87('0x29')]['id']}},_0x2c2621={};_0x2c2621['model']=_['keys'](db[_0x0a87('0x23')][_0x0a87('0x2a')]);_0x2c2621[_0x0a87('0x2b')]=_[_0x0a87('0x2c')](_0x1c1269[_0x0a87('0x2b')]);_0x2c2621[_0x0a87('0x2d')]=_['intersection'](_0x2c2621['model'],_0x2c2621[_0x0a87('0x2b')]);_0x575b14[_0x0a87('0x2e')]=_[_0x0a87('0x2f')](_0x2c2621['model'],qs[_0x0a87('0x30')](_0x1c1269['query'][_0x0a87('0x30')]));_0x575b14[_0x0a87('0x2e')]=_0x575b14[_0x0a87('0x2e')][_0x0a87('0x31')]?_0x575b14[_0x0a87('0x2e')]:_0x2c2621[_0x0a87('0x32')];if(_0x1c1269[_0x0a87('0x2b')]['includeAll']){_0x575b14['include']=[{'all':!![]}];}_0x575b14=_[_0x0a87('0x33')]({},_0x575b14,_0x1c1269[_0x0a87('0x34')]);return db[_0x0a87('0x23')][_0x0a87('0x35')](_0x575b14)['then'](handleEntityNotFound(_0x428312,null))['then'](respondWithResult(_0x428312,null))[_0x0a87('0x27')](handleError(_0x428312,null));};exports[_0x0a87('0x36')]=function(_0x27e598,_0x486262){return db[_0x0a87('0x23')][_0x0a87('0x36')](_0x27e598[_0x0a87('0x37')],{})[_0x0a87('0x16')](function(_0x90db14){var _0x4b017a=_0x27e598[_0x0a87('0x38')]['get']({'plain':!![]});if(!_0x4b017a)throw new Error(_0x0a87('0x39'));if(_0x4b017a[_0x0a87('0x3a')]===_0x0a87('0x38')){var _0x1abe99=_0x90db14['get']({'plain':!![]});var _0x5e2b4d=_0x0a87('0x18');return db[_0x0a87('0x3b')][_0x0a87('0x35')]({'where':{'name':_0x5e2b4d,'userProfileId':_0x4b017a[_0x0a87('0x3c')]},'raw':!![]})[_0x0a87('0x16')](function(_0x59af0f){if(_0x59af0f&&_0x59af0f[_0x0a87('0x3d')]===0x0){return db['UserProfileResource'][_0x0a87('0x36')]({'name':_0x1abe99[_0x0a87('0x1c')],'resourceId':_0x1abe99['id'],'type':_0x59af0f[_0x0a87('0x1c')],'sectionId':_0x59af0f['id']},{})[_0x0a87('0x16')](function(){return _0x90db14;});}else{return _0x90db14;}})[_0x0a87('0x27')](function(_0x4e1995){logger[_0x0a87('0x3e')](_0x0a87('0x3f'),_0x4e1995);throw _0x4e1995;});}return _0x90db14;})[_0x0a87('0x16')](respondWithResult(_0x486262,0xc9))['catch'](handleError(_0x486262,null));};exports['update']=function(_0x10c4f7,_0x327610){if(_0x10c4f7[_0x0a87('0x37')]['id']){delete _0x10c4f7[_0x0a87('0x37')]['id'];}return db[_0x0a87('0x23')]['find']({'where':{'id':_0x10c4f7['params']['id']}})[_0x0a87('0x16')](handleEntityNotFound(_0x327610,null))[_0x0a87('0x16')](saveUpdates(_0x10c4f7[_0x0a87('0x37')],null))[_0x0a87('0x16')](respondWithResult(_0x327610,null))[_0x0a87('0x27')](handleError(_0x327610,null));};exports[_0x0a87('0x19')]=function(_0x228e4a,_0x55137c){return db[_0x0a87('0x23')][_0x0a87('0x35')]({'where':{'id':_0x228e4a[_0x0a87('0x29')]['id']}})['then'](handleEntityNotFound(_0x55137c,null))[_0x0a87('0x16')](removeEntity(_0x55137c,null))['catch'](handleError(_0x55137c,null));};exports['describe']=function(_0x403d32,_0x6373d2){return db['MailQueue']['describe']()[_0x0a87('0x16')](respondWithResult(_0x6373d2,null))[_0x0a87('0x27')](handleError(_0x6373d2,null));};exports[_0x0a87('0x40')]=function(_0x1cb128,_0x2bc26d){var _0x4866bd={'raw':!![],'where':{}},_0x3e5f5d={},_0x46471a;return db['MailQueue'][_0x0a87('0x41')]({'where':{'id':_0x1cb128[_0x0a87('0x29')]['id']}})[_0x0a87('0x16')](handleEntityNotFound(_0x2bc26d,null))['then'](function(_0x1546fe){if(_0x1546fe){_0x46471a=_0x1546fe[_0x0a87('0x17')]({'plain':!![]});_0x3e5f5d['model']=_[_0x0a87('0x2c')](db[_0x0a87('0x42')]['rawAttributes']);_0x3e5f5d[_0x0a87('0x2b')]=_['keys'](_0x1cb128[_0x0a87('0x2b')]);_0x3e5f5d[_0x0a87('0x2d')]=_[_0x0a87('0x2f')](_0x3e5f5d[_0x0a87('0x32')],_0x3e5f5d[_0x0a87('0x2b')]);_0x4866bd[_0x0a87('0x2e')]=_[_0x0a87('0x2f')](_0x3e5f5d[_0x0a87('0x32')],qs[_0x0a87('0x30')](_0x1cb128[_0x0a87('0x2b')][_0x0a87('0x30')]));_0x4866bd['attributes']=_0x4866bd[_0x0a87('0x2e')][_0x0a87('0x31')]?_0x4866bd[_0x0a87('0x2e')]:_0x3e5f5d[_0x0a87('0x32')];if(!_0x1cb128[_0x0a87('0x2b')]['hasOwnProperty']('nolimit')){_0x4866bd['limit']=qs[_0x0a87('0x11')](_0x1cb128['query'][_0x0a87('0x11')]);_0x4866bd[_0x0a87('0x10')]=qs[_0x0a87('0x10')](_0x1cb128[_0x0a87('0x2b')][_0x0a87('0x10')]);}_0x4866bd[_0x0a87('0x43')]=qs[_0x0a87('0x44')](_0x1cb128[_0x0a87('0x2b')][_0x0a87('0x44')]);_0x4866bd['where']=qs[_0x0a87('0x2d')](_[_0x0a87('0x45')](_0x1cb128[_0x0a87('0x2b')],_0x3e5f5d[_0x0a87('0x2d')]));_0x4866bd['where'][_0x0a87('0x46')]=_0x1546fe['id'];if(_0x1cb128[_0x0a87('0x2b')]['filter']){_0x4866bd['where']=_[_0x0a87('0x33')](_0x4866bd[_0x0a87('0x47')],{'$or':_[_0x0a87('0x1e')](_0x4866bd['attributes'],function(_0x270f45){var _0x55edd5={};_0x55edd5[_0x270f45]={'$like':'%'+_0x1cb128[_0x0a87('0x2b')]['filter']+'%'};return _0x55edd5;})});}_0x4866bd=_[_0x0a87('0x33')]({},_0x4866bd,_0x1cb128[_0x0a87('0x34')]);return db[_0x0a87('0x42')][_0x0a87('0x25')](_0x4866bd);}})[_0x0a87('0x16')](function(_0x51cd5b){if(_0x51cd5b){return db[_0x0a87('0x48')][_0x0a87('0x49')]({'where':{'id':_[_0x0a87('0x1e')](_0x51cd5b,'UserId'),'role':_0x0a87('0x4a')},'attributes':['id',_0x0a87('0x1c'),_0x0a87('0x4b'),_0x0a87('0x4c'),_0x0a87('0x4d')]});}})['then'](function(_0x1a3f7e){if(_0x1a3f7e){return{'count':_0x1a3f7e[_0x0a87('0x13')],'rows':_[_0x0a87('0x1e')](_0x1a3f7e[_0x0a87('0x26')],function(_0x223d14){return{'membername':_0x223d14[_0x0a87('0x1c')],'UserId':_0x223d14['id'],'queue_name':_0x46471a[_0x0a87('0x1c')],'MailQueueId':_0x46471a['id'],'interface':util[_0x0a87('0x4e')](_0x0a87('0x4f'),_0x0a87('0x50'),_0x223d14[_0x0a87('0x1c')]),'penalty':0x0,'paused':_0x223d14[_0x0a87('0x4b')],'createdAt':_0x223d14['createdAt'],'updatedAt':_0x223d14[_0x0a87('0x4c')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x0a87('0x16')](respondWithFilteredResult(_0x2bc26d,_0x4866bd))[_0x0a87('0x27')](handleError(_0x2bc26d,null));};exports[_0x0a87('0x51')]=function(_0xf6077d,_0x57e5dc){var _0x125716={};var _0x217578={};var _0x54ff20;var _0x42d04b;return db[_0x0a87('0x23')][_0x0a87('0x41')]({'where':{'id':_0xf6077d['params']['id']}})[_0x0a87('0x16')](handleEntityNotFound(_0x57e5dc,null))[_0x0a87('0x16')](function(_0x1c82ab){if(_0x1c82ab){_0x54ff20=_0x1c82ab;_0x217578[_0x0a87('0x32')]=_[_0x0a87('0x2c')](db[_0x0a87('0x52')][_0x0a87('0x2a')]);_0x217578['query']=_[_0x0a87('0x2c')](_0xf6077d[_0x0a87('0x2b')]);_0x217578['filters']=_[_0x0a87('0x2f')](_0x217578[_0x0a87('0x32')],_0x217578[_0x0a87('0x2b')]);_0x125716[_0x0a87('0x2e')]=_[_0x0a87('0x2f')](_0x217578[_0x0a87('0x32')],qs[_0x0a87('0x30')](_0xf6077d[_0x0a87('0x2b')][_0x0a87('0x30')]));_0x125716[_0x0a87('0x2e')]=_0x125716[_0x0a87('0x2e')][_0x0a87('0x31')]?_0x125716[_0x0a87('0x2e')]:_0x217578[_0x0a87('0x32')];_0x125716['order']=qs[_0x0a87('0x44')](_0xf6077d[_0x0a87('0x2b')][_0x0a87('0x44')]);_0x125716[_0x0a87('0x47')]=qs[_0x0a87('0x2d')](_[_0x0a87('0x45')](_0xf6077d[_0x0a87('0x2b')],_0x217578[_0x0a87('0x2d')]));if(_0xf6077d[_0x0a87('0x2b')]['filter']){_0x125716[_0x0a87('0x47')]=_[_0x0a87('0x33')](_0x125716[_0x0a87('0x47')],{'$or':_[_0x0a87('0x1e')](_0x125716[_0x0a87('0x2e')],function(_0x4bb8be){var _0x3c2def={};_0x3c2def[_0x4bb8be]={'$like':'%'+_0xf6077d['query'][_0x0a87('0x53')]+'%'};return _0x3c2def;})});}_0x125716=_[_0x0a87('0x33')]({},_0x125716,_0xf6077d['options']);return _0x54ff20['getTeams'](_0x125716);}})[_0x0a87('0x16')](function(_0x1de80b){if(_0x1de80b){_0x42d04b=_0x1de80b['length'];if(!_0xf6077d['query']['hasOwnProperty'](_0x0a87('0x54'))){_0x125716['limit']=qs['limit'](_0xf6077d[_0x0a87('0x2b')][_0x0a87('0x11')]);_0x125716[_0x0a87('0x10')]=qs[_0x0a87('0x10')](_0xf6077d['query'][_0x0a87('0x10')]);}return _0x54ff20[_0x0a87('0x51')](_0x125716);}})[_0x0a87('0x16')](function(_0x1d7b96){if(_0x1d7b96){return _0x1d7b96?{'count':_0x42d04b,'rows':_0x1d7b96}:null;}})['then'](respondWithResult(_0x57e5dc,null))[_0x0a87('0x27')](handleError(_0x57e5dc,null));};exports[_0x0a87('0x55')]=function(_0x544b70,_0x4f3ddc){var _0x86aa94=_0x544b70[_0x0a87('0x37')]['ids'];return db[_0x0a87('0x52')]['findAll']({'where':{'id':_0x86aa94},'attributes':['id'],'include':[{'model':db[_0x0a87('0x48')],'as':_0x0a87('0x56'),'attributes':['id','name',_0x0a87('0x57'),_0x0a87('0x58'),_0x0a87('0x59')],'raw':!![]}]})['then'](function(_0x4d854e){if(_0x4d854e){var _0xad464=_['flatMap'](_0x4d854e,function(_0x3647b3){var _0x1d75e5=_0x3647b3['get']({'plain':!![]});return _0x1d75e5[_0x0a87('0x56')];});return db[_0x0a87('0x23')][_0x0a87('0x35')]({'where':{'id':_0x544b70[_0x0a87('0x29')]['id']}})['then'](function(_0x5487a5){return db['sequelize'][_0x0a87('0x5a')](function(_0x409b9d){return _0x5487a5['addTeams'](_0x86aa94,{'transaction':_0x409b9d})[_0x0a87('0x16')](function(){return BPromise[_0x0a87('0x5b')](_0xad464,function(_0x4a1ac3){return db[_0x0a87('0x42')][_0x0a87('0x5c')]({'where':{'UserId':_0x4a1ac3['id'],'MailQueueId':_0x544b70['params']['id']},'transaction':_0x409b9d});});})[_0x0a87('0x16')](function(){_0xad464['forEach'](function(_0x2faf19){socket['emit'](_0x0a87('0x5d'),{'UserId':_0x2faf19['id'],'MailQueueId':_0x5487a5['id']});});});});});}})[_0x0a87('0x16')](respondWithStatusCode(_0x4f3ddc,null))['catch'](handleError(_0x4f3ddc,null));};exports['removeTeams']=function(_0x156302,_0x22e343){return db['Team'][_0x0a87('0x25')]({'where':{'id':_0x156302[_0x0a87('0x2b')]['ids']},'attributes':['id'],'include':[{'model':db[_0x0a87('0x48')],'as':_0x0a87('0x56'),'attributes':['id'],'raw':!![]}]})[_0x0a87('0x16')](handleEntityNotFound(_0x22e343,null))[_0x0a87('0x16')](function(_0x10f32c){var _0x4655a2=_[_0x0a87('0x1e')](_0x10f32c,'id');var _0x4dfc7e=[];var _0x271fac=[];var _0x5b9dcb=squel[_0x0a87('0x5e')]();_0x5b9dcb[_0x0a87('0x5f')](_0x0a87('0x60'))[_0x0a87('0x61')](_0x0a87('0x62'),'tq')[_0x0a87('0x63')](_0x0a87('0x64'),'ut',_0x0a87('0x65'))[_0x0a87('0x47')](_0x0a87('0x66'),_0x156302['params']['id']);for(var _0x59ad71=0x0;_0x59ad71<_0x10f32c['length'];_0x59ad71+=0x1){let _0x26e60f=_0x10f32c[_0x59ad71];for(var _0x5e4020=0x0;_0x5e4020<_0x26e60f[_0x0a87('0x56')][_0x0a87('0x31')];_0x5e4020+=0x1){let _0x4308c1=_0x26e60f[_0x0a87('0x56')][_0x5e4020];var _0x2133ee=_0x5b9dcb[_0x0a87('0x67')]();_0x2133ee['where'](_0x0a87('0x68'),_0x4308c1['id']);_0x271fac[_0x0a87('0x69')](db[_0x0a87('0x6a')][_0x0a87('0x2b')](_0x2133ee[_0x0a87('0x6b')](),{'type':db[_0x0a87('0x6a')][_0x0a87('0x6c')]['SELECT']})[_0x0a87('0x16')](function(_0x25961f){if(_0x25961f[_0x0a87('0x31')]===0x1){return _0x4308c1['id'];}else{var _0x136c52=_[_0x0a87('0x6d')](_[_0x0a87('0x1e')](_0x25961f,'TeamId'),function(_0x5b6585){return _[_0x0a87('0x6e')](_0x4655a2,_0x5b6585);});if(_0x136c52){return _0x4308c1['id'];}}}));}}return BPromise[_0x0a87('0x6f')](_0x271fac)['then'](function(_0x468117){_0x4dfc7e=_(_0x4dfc7e)['union'](_0x468117)[_0x0a87('0x70')]()[_0x0a87('0x71')]();return db[_0x0a87('0x23')][_0x0a87('0x35')]({'where':{'id':_0x156302['params']['id']}})[_0x0a87('0x16')](function(_0x39a115){return db[_0x0a87('0x6a')]['transaction'](function(_0x39ae4d){return _0x39a115['removeTeams'](_0x156302['query']['ids'],{'transaction':_0x39ae4d})['then'](function(){if(!_[_0x0a87('0x72')](_0x4dfc7e)){return _0x39a115[_0x0a87('0x73')](_0x4dfc7e,{'transaction':_0x39ae4d});}})[_0x0a87('0x16')](function(){_0x4dfc7e[_0x0a87('0x74')](function(_0x2c0f6f){socket[_0x0a87('0x75')](_0x0a87('0x76'),{'UserId':_0x2c0f6f,'MailQueueId':_0x39a115['id']});});});});});});})['then'](respondWithStatusCode(_0x22e343,null))[_0x0a87('0x27')](handleError(_0x22e343,null));};exports[_0x0a87('0x77')]=function(_0x78a6da,_0x4da1ef){return db[_0x0a87('0x23')][_0x0a87('0x35')]({'where':{'id':_0x78a6da[_0x0a87('0x29')]['id']}})[_0x0a87('0x16')](handleEntityNotFound(_0x4da1ef,null))[_0x0a87('0x16')](function(_0x42949a){if(_0x42949a){return _0x42949a['addAgents'](_0x78a6da[_0x0a87('0x37')][_0x0a87('0x78')],_[_0x0a87('0x79')](_0x78a6da[_0x0a87('0x37')],['ids','id'])||{})['spread'](function(_0x26163b){for(var _0x2a0eee=0x0;_0x2a0eee<_0x78a6da[_0x0a87('0x37')][_0x0a87('0x78')][_0x0a87('0x31')];_0x2a0eee+=0x1){socket[_0x0a87('0x75')](_0x0a87('0x5d'),{'UserId':Number(_0x78a6da[_0x0a87('0x37')]['ids'][_0x2a0eee]),'MailQueueId':Number(_0x78a6da[_0x0a87('0x29')]['id'])});}return _0x26163b;});}})[_0x0a87('0x16')](respondWithResult(_0x4da1ef,null))[_0x0a87('0x27')](handleError(_0x4da1ef,null));};exports[_0x0a87('0x73')]=function(_0x324d74,_0x108424){return db[_0x0a87('0x23')]['find']({'where':{'id':_0x324d74[_0x0a87('0x29')]['id']}})['then'](handleEntityNotFound(_0x108424,null))['then'](function(_0x2a6a95){if(_0x2a6a95){return _0x2a6a95[_0x0a87('0x73')](_0x324d74[_0x0a87('0x2b')][_0x0a87('0x78')])[_0x0a87('0x16')](function(){if(_['isArray'](_0x324d74[_0x0a87('0x2b')][_0x0a87('0x78')])){for(var _0x5820d6=0x0;_0x5820d6<_0x324d74[_0x0a87('0x2b')][_0x0a87('0x78')]['length'];_0x5820d6+=0x1){socket['emit'](_0x0a87('0x76'),{'UserId':Number(_0x324d74[_0x0a87('0x2b')][_0x0a87('0x78')][_0x5820d6]),'MailQueueId':Number(_0x324d74[_0x0a87('0x29')]['id'])});}}else{socket[_0x0a87('0x75')](_0x0a87('0x76'),{'UserId':Number(_0x324d74[_0x0a87('0x2b')][_0x0a87('0x78')]),'MailQueueId':Number(_0x324d74[_0x0a87('0x29')]['id'])});}});}})[_0x0a87('0x16')](respondWithStatusCode(_0x108424,null))[_0x0a87('0x27')](handleError(_0x108424,null));};exports['getAgents']=function(_0x240e13,_0x1ea8a1){var _0x1a4797={};var _0xec68f={};var _0x4c3ca1;var _0x365e58;return db[_0x0a87('0x23')][_0x0a87('0x41')]({'where':{'id':_0x240e13[_0x0a87('0x29')]['id']}})[_0x0a87('0x16')](handleEntityNotFound(_0x1ea8a1,null))[_0x0a87('0x16')](function(_0x82ec7f){if(_0x82ec7f){_0x4c3ca1=_0x82ec7f;_0xec68f[_0x0a87('0x32')]=_[_0x0a87('0x2c')](db['User'][_0x0a87('0x2a')]);_0xec68f[_0x0a87('0x2b')]=_[_0x0a87('0x2c')](_0x240e13[_0x0a87('0x2b')]);_0xec68f[_0x0a87('0x2d')]=_[_0x0a87('0x2f')](_0xec68f['model'],_0xec68f[_0x0a87('0x2b')]);_0x1a4797['attributes']=_[_0x0a87('0x2f')](_0xec68f['model'],qs[_0x0a87('0x30')](_0x240e13[_0x0a87('0x2b')][_0x0a87('0x30')]));_0x1a4797[_0x0a87('0x2e')]=_0x1a4797[_0x0a87('0x2e')]['length']?_0x1a4797[_0x0a87('0x2e')]:_0xec68f[_0x0a87('0x32')];_0x1a4797[_0x0a87('0x43')]=qs['sort'](_0x240e13[_0x0a87('0x2b')]['sort']);_0x1a4797[_0x0a87('0x47')]=qs['filters'](_[_0x0a87('0x45')](_0x240e13[_0x0a87('0x2b')],_0xec68f[_0x0a87('0x2d')]));if(_0x240e13[_0x0a87('0x2b')][_0x0a87('0x53')]){_0x1a4797[_0x0a87('0x47')]=_[_0x0a87('0x33')](_0x1a4797[_0x0a87('0x47')],{'$or':_[_0x0a87('0x1e')](_0x1a4797['attributes'],function(_0x1af961){var _0xae0451={};_0xae0451[_0x1af961]={'$like':'%'+_0x240e13[_0x0a87('0x2b')][_0x0a87('0x53')]+'%'};return _0xae0451;})});}_0x1a4797=_['merge']({},_0x1a4797,_0x240e13['options']);return _0x4c3ca1[_0x0a87('0x7a')](_0x1a4797);}})[_0x0a87('0x16')](function(_0xb6d410){if(_0xb6d410){_0x365e58=_0xb6d410['length'];if(!_0x240e13['query'][_0x0a87('0x7b')](_0x0a87('0x54'))){_0x1a4797[_0x0a87('0x11')]=qs['limit'](_0x240e13['query'][_0x0a87('0x11')]);_0x1a4797[_0x0a87('0x10')]=qs[_0x0a87('0x10')](_0x240e13['query'][_0x0a87('0x10')]);}return _0x4c3ca1[_0x0a87('0x7a')](_0x1a4797);}})[_0x0a87('0x16')](function(_0x2952c9){if(_0x2952c9){return _0x2952c9?{'count':_0x365e58,'rows':_0x2952c9}:null;}})['then'](respondWithResult(_0x1ea8a1,null))[_0x0a87('0x27')](handleError(_0x1ea8a1,null));}; \ No newline at end of file +var _0xe757=['name','send','index','map','MailQueue','rawAttributes','fieldName','type','key','getOptions','where','include','findAll','show','params','model','keys','query','filters','intersection','attributes','fields','length','includeAll','merge','options','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','userProfileId','autoAssociation','UserProfileResource','catch','error','describe','getMembers','findOne','UserMailQueue','hasOwnProperty','sort','pick','MailQueueId','filter','User','findAndCountAll','UserId','agent','mailPause','createdAt','rows','format','SIP','updatedAt','Team','order','getTeams','nolimit','addTeams','ids','Agents','online','interface','sequelize','transaction','each','forEach','userMailQueue:save','removeTeams','select','field','tq.TeamId','team_has_mail_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','MailQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','every','TeamId','includes','all','compact','value','isEmpty','removeAgents','emit','addAgents','omit','spread','isArray','userMailQueue:remove','getAgents','bluebird','util','lodash','squel','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','redis','defaults','localhost','socket.io-emitter','./mailQueue.socket','register','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','update','then','destroy','stack'];(function(_0x192720,_0x550d4f){var _0x4538d9=function(_0x2fd6e7){while(--_0x2fd6e7){_0x192720['push'](_0x192720['shift']());}};_0x4538d9(++_0x550d4f);}(_0xe757,0x1e7));var _0x7e75=function(_0x10dfdf,_0xd11233){_0x10dfdf=_0x10dfdf-0x0;var _0x2ff0c7=_0xe757[_0x10dfdf];return _0x2ff0c7;};'use strict';var BPromise=require(_0x7e75('0x0'));var util=require(_0x7e75('0x1'));var _=require(_0x7e75('0x2'));var squel=require(_0x7e75('0x3'));var Redis=require(_0x7e75('0x4'));var qs=require(_0x7e75('0x5'));var logger=require(_0x7e75('0x6'))(_0x7e75('0x7'));var config=require(_0x7e75('0x8'));var db=require('../../mysqldb')['db'];config[_0x7e75('0x9')]=_[_0x7e75('0xa')](config[_0x7e75('0x9')],{'host':_0x7e75('0xb'),'port':0x18eb});var socket=require(_0x7e75('0xc'))(new Redis(config['redis']));require(_0x7e75('0xd'))[_0x7e75('0xe')](socket);function respondWithStatusCode(_0x46da8f,_0xd8af42){_0xd8af42=_0xd8af42||0xcc;return function(_0x162ab6){if(_0x162ab6){return _0x46da8f[_0x7e75('0xf')](_0xd8af42);}return _0x46da8f[_0x7e75('0x10')](_0xd8af42)[_0x7e75('0x11')]();};}function respondWithResult(_0x54531d,_0x11a5ba){_0x11a5ba=_0x11a5ba||0xc8;return function(_0x2995f0){if(_0x2995f0){return _0x54531d[_0x7e75('0x10')](_0x11a5ba)[_0x7e75('0x12')](_0x2995f0);}};}function respondWithFilteredResult(_0x3eab93,_0x5d965d){return function(_0x5640c4){if(_0x5640c4){var _0x2b8c04=typeof _0x5d965d[_0x7e75('0x13')]===_0x7e75('0x14')&&typeof _0x5d965d['limit']===_0x7e75('0x14');var _0x9dd37c=_0x5640c4[_0x7e75('0x15')];var _0x388a4d=_0x2b8c04?0x0:_0x5d965d[_0x7e75('0x13')];var _0x433b3f=_0x2b8c04?_0x5640c4['count']:_0x5d965d[_0x7e75('0x13')]+_0x5d965d[_0x7e75('0x16')];var _0x5939f6;if(_0x433b3f>=_0x9dd37c){_0x433b3f=_0x9dd37c;_0x5939f6=0xc8;}else{_0x5939f6=0xce;}_0x3eab93[_0x7e75('0x10')](_0x5939f6);return _0x3eab93[_0x7e75('0x17')](_0x7e75('0x18'),_0x388a4d+'-'+_0x433b3f+'/'+_0x9dd37c)[_0x7e75('0x12')](_0x5640c4);}return null;};}function saveUpdates(_0x2b676e){return function(_0x250dc9){if(_0x250dc9){return _0x250dc9[_0x7e75('0x19')](_0x2b676e)[_0x7e75('0x1a')](function(_0x348471){return _0x348471;});}return null;};}function removeEntity(_0x2a4df5){return function(_0x5ab1f8){if(_0x5ab1f8){return _0x5ab1f8[_0x7e75('0x1b')]()[_0x7e75('0x1a')](function(){var _0x819d5e=_0x5ab1f8['get']({'plain':!![]});var _0x511f6a='MailQueues';return db['UserProfileResource']['destroy']({'where':{'type':_0x511f6a,'resourceId':_0x819d5e['id']}})[_0x7e75('0x1a')](function(){return _0x5ab1f8;});})[_0x7e75('0x1a')](function(){_0x2a4df5['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x387f15){return function(_0x59310e){if(!_0x59310e){_0x387f15[_0x7e75('0xf')](0x194);}return _0x59310e;};}function handleError(_0x478689,_0x1d6d32){_0x1d6d32=_0x1d6d32||0x1f4;return function(_0xbbee67){logger['error'](_0xbbee67[_0x7e75('0x1c')]);if(_0xbbee67['name']){delete _0xbbee67[_0x7e75('0x1d')];}_0x478689[_0x7e75('0x10')](_0x1d6d32)[_0x7e75('0x1e')](_0xbbee67);};}exports[_0x7e75('0x1f')]=function(_0x6cf99,_0x4defa7){var _0x21bb74={};var _0x5b47dc={'count':0x0,'rows':[]};var _0x3dc75c=_[_0x7e75('0x20')](db[_0x7e75('0x21')][_0x7e75('0x22')],function(_0x3451ad){return{'name':_0x3451ad[_0x7e75('0x23')],'type':_0x3451ad[_0x7e75('0x24')][_0x7e75('0x25')]};});_0x21bb74=qs[_0x7e75('0x26')](_0x3dc75c,_0x6cf99);var _0x57ff02={'where':_0x21bb74[_0x7e75('0x27')]};return db[_0x7e75('0x21')][_0x7e75('0x15')](_0x57ff02)['then'](function(_0xa3eed8){_0x5b47dc[_0x7e75('0x15')]=_0xa3eed8;_0x21bb74[_0x7e75('0x28')]=qs[_0x7e75('0x28')](_0x6cf99['query']);return db[_0x7e75('0x21')][_0x7e75('0x29')](_0x21bb74);})[_0x7e75('0x1a')](function(_0x394996){_0x5b47dc['rows']=_0x394996;return _0x5b47dc;})[_0x7e75('0x1a')](respondWithFilteredResult(_0x4defa7,_0x21bb74))['catch'](handleError(_0x4defa7,null));};exports[_0x7e75('0x2a')]=function(_0x3a3d05,_0x216ffe){var _0x4fe56c={'raw':!![],'where':{'id':_0x3a3d05[_0x7e75('0x2b')]['id']}},_0x209096={};_0x209096[_0x7e75('0x2c')]=_[_0x7e75('0x2d')](db['MailQueue'][_0x7e75('0x22')]);_0x209096[_0x7e75('0x2e')]=_[_0x7e75('0x2d')](_0x3a3d05[_0x7e75('0x2e')]);_0x209096[_0x7e75('0x2f')]=_[_0x7e75('0x30')](_0x209096[_0x7e75('0x2c')],_0x209096['query']);_0x4fe56c[_0x7e75('0x31')]=_[_0x7e75('0x30')](_0x209096['model'],qs[_0x7e75('0x32')](_0x3a3d05['query'][_0x7e75('0x32')]));_0x4fe56c[_0x7e75('0x31')]=_0x4fe56c[_0x7e75('0x31')][_0x7e75('0x33')]?_0x4fe56c['attributes']:_0x209096[_0x7e75('0x2c')];if(_0x3a3d05[_0x7e75('0x2e')][_0x7e75('0x34')]){_0x4fe56c[_0x7e75('0x28')]=[{'all':!![]}];}_0x4fe56c=_[_0x7e75('0x35')]({},_0x4fe56c,_0x3a3d05[_0x7e75('0x36')]);return db['MailQueue'][_0x7e75('0x37')](_0x4fe56c)['then'](handleEntityNotFound(_0x216ffe,null))['then'](respondWithResult(_0x216ffe,null))['catch'](handleError(_0x216ffe,null));};exports[_0x7e75('0x38')]=function(_0x4b1c72,_0x3608af){return db['MailQueue']['create'](_0x4b1c72[_0x7e75('0x39')],{})[_0x7e75('0x1a')](function(_0x82e28){var _0x2a0477=_0x4b1c72['user'][_0x7e75('0x3a')]({'plain':!![]});if(!_0x2a0477)throw new Error(_0x7e75('0x3b'));if(_0x2a0477[_0x7e75('0x3c')]===_0x7e75('0x3d')){var _0x10efee=_0x82e28[_0x7e75('0x3a')]({'plain':!![]});var _0x46a84a='MailQueues';return db['UserProfileSection']['find']({'where':{'name':_0x46a84a,'userProfileId':_0x2a0477[_0x7e75('0x3e')]},'raw':!![]})[_0x7e75('0x1a')](function(_0x52f049){if(_0x52f049&&_0x52f049[_0x7e75('0x3f')]===0x0){return db[_0x7e75('0x40')][_0x7e75('0x38')]({'name':_0x10efee[_0x7e75('0x1d')],'resourceId':_0x10efee['id'],'type':_0x52f049['name'],'sectionId':_0x52f049['id']},{})[_0x7e75('0x1a')](function(){return _0x82e28;});}else{return _0x82e28;}})[_0x7e75('0x41')](function(_0x1c4718){logger[_0x7e75('0x42')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1c4718);throw _0x1c4718;});}return _0x82e28;})[_0x7e75('0x1a')](respondWithResult(_0x3608af,0xc9))[_0x7e75('0x41')](handleError(_0x3608af,null));};exports[_0x7e75('0x19')]=function(_0x38b49d,_0xecd8a4){if(_0x38b49d['body']['id']){delete _0x38b49d[_0x7e75('0x39')]['id'];}return db[_0x7e75('0x21')]['find']({'where':{'id':_0x38b49d[_0x7e75('0x2b')]['id']}})[_0x7e75('0x1a')](handleEntityNotFound(_0xecd8a4,null))['then'](saveUpdates(_0x38b49d[_0x7e75('0x39')],null))[_0x7e75('0x1a')](respondWithResult(_0xecd8a4,null))[_0x7e75('0x41')](handleError(_0xecd8a4,null));};exports[_0x7e75('0x1b')]=function(_0x5abec4,_0x48a911){return db[_0x7e75('0x21')]['find']({'where':{'id':_0x5abec4[_0x7e75('0x2b')]['id']}})[_0x7e75('0x1a')](handleEntityNotFound(_0x48a911,null))[_0x7e75('0x1a')](removeEntity(_0x48a911,null))[_0x7e75('0x41')](handleError(_0x48a911,null));};exports[_0x7e75('0x43')]=function(_0x44e024,_0x3bcb36){return db[_0x7e75('0x21')]['describe']()['then'](respondWithResult(_0x3bcb36,null))[_0x7e75('0x41')](handleError(_0x3bcb36,null));};exports[_0x7e75('0x44')]=function(_0x306426,_0x4000a4){var _0x56ee61={'raw':!![],'where':{}},_0x15fedf={},_0xe0e092;return db['MailQueue'][_0x7e75('0x45')]({'where':{'id':_0x306426['params']['id']}})[_0x7e75('0x1a')](handleEntityNotFound(_0x4000a4,null))[_0x7e75('0x1a')](function(_0x220cc1){if(_0x220cc1){_0xe0e092=_0x220cc1[_0x7e75('0x3a')]({'plain':!![]});_0x15fedf[_0x7e75('0x2c')]=_[_0x7e75('0x2d')](db[_0x7e75('0x46')][_0x7e75('0x22')]);_0x15fedf[_0x7e75('0x2e')]=_[_0x7e75('0x2d')](_0x306426[_0x7e75('0x2e')]);_0x15fedf[_0x7e75('0x2f')]=_['intersection'](_0x15fedf[_0x7e75('0x2c')],_0x15fedf['query']);_0x56ee61[_0x7e75('0x31')]=_['intersection'](_0x15fedf[_0x7e75('0x2c')],qs[_0x7e75('0x32')](_0x306426[_0x7e75('0x2e')][_0x7e75('0x32')]));_0x56ee61[_0x7e75('0x31')]=_0x56ee61[_0x7e75('0x31')][_0x7e75('0x33')]?_0x56ee61[_0x7e75('0x31')]:_0x15fedf['model'];if(!_0x306426[_0x7e75('0x2e')][_0x7e75('0x47')]('nolimit')){_0x56ee61['limit']=qs[_0x7e75('0x16')](_0x306426[_0x7e75('0x2e')][_0x7e75('0x16')]);_0x56ee61[_0x7e75('0x13')]=qs[_0x7e75('0x13')](_0x306426[_0x7e75('0x2e')][_0x7e75('0x13')]);}_0x56ee61['order']=qs[_0x7e75('0x48')](_0x306426['query'][_0x7e75('0x48')]);_0x56ee61['where']=qs[_0x7e75('0x2f')](_[_0x7e75('0x49')](_0x306426[_0x7e75('0x2e')],_0x15fedf[_0x7e75('0x2f')]));_0x56ee61[_0x7e75('0x27')][_0x7e75('0x4a')]=_0x220cc1['id'];if(_0x306426[_0x7e75('0x2e')][_0x7e75('0x4b')]){_0x56ee61[_0x7e75('0x27')]=_['merge'](_0x56ee61[_0x7e75('0x27')],{'$or':_['map'](_0x56ee61['attributes'],function(_0x10f1a5){var _0xebe73a={};_0xebe73a[_0x10f1a5]={'$like':'%'+_0x306426[_0x7e75('0x2e')][_0x7e75('0x4b')]+'%'};return _0xebe73a;})});}_0x56ee61=_[_0x7e75('0x35')]({},_0x56ee61,_0x306426[_0x7e75('0x36')]);return db[_0x7e75('0x46')][_0x7e75('0x29')](_0x56ee61);}})[_0x7e75('0x1a')](function(_0x3e659a){if(_0x3e659a){return db[_0x7e75('0x4c')][_0x7e75('0x4d')]({'where':{'id':_['map'](_0x3e659a,_0x7e75('0x4e')),'role':_0x7e75('0x4f')},'attributes':['id',_0x7e75('0x1d'),_0x7e75('0x50'),'updatedAt',_0x7e75('0x51')]});}})[_0x7e75('0x1a')](function(_0x1f4eb2){if(_0x1f4eb2){return{'count':_0x1f4eb2[_0x7e75('0x15')],'rows':_[_0x7e75('0x20')](_0x1f4eb2[_0x7e75('0x52')],function(_0x14fac5){return{'membername':_0x14fac5['name'],'UserId':_0x14fac5['id'],'queue_name':_0xe0e092[_0x7e75('0x1d')],'MailQueueId':_0xe0e092['id'],'interface':util[_0x7e75('0x53')]('%s/%s',_0x7e75('0x54'),_0x14fac5[_0x7e75('0x1d')]),'penalty':0x0,'paused':_0x14fac5[_0x7e75('0x50')],'createdAt':_0x14fac5[_0x7e75('0x51')],'updatedAt':_0x14fac5[_0x7e75('0x55')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x7e75('0x1a')](respondWithFilteredResult(_0x4000a4,_0x56ee61))[_0x7e75('0x41')](handleError(_0x4000a4,null));};exports['getTeams']=function(_0x48563d,_0x3b0cd8){var _0x472d91={};var _0x572782={};var _0x382976;var _0x2a7465;return db[_0x7e75('0x21')][_0x7e75('0x45')]({'where':{'id':_0x48563d[_0x7e75('0x2b')]['id']}})[_0x7e75('0x1a')](handleEntityNotFound(_0x3b0cd8,null))[_0x7e75('0x1a')](function(_0x2a6572){if(_0x2a6572){_0x382976=_0x2a6572;_0x572782['model']=_[_0x7e75('0x2d')](db[_0x7e75('0x56')][_0x7e75('0x22')]);_0x572782[_0x7e75('0x2e')]=_[_0x7e75('0x2d')](_0x48563d[_0x7e75('0x2e')]);_0x572782['filters']=_['intersection'](_0x572782['model'],_0x572782['query']);_0x472d91['attributes']=_[_0x7e75('0x30')](_0x572782[_0x7e75('0x2c')],qs[_0x7e75('0x32')](_0x48563d['query'][_0x7e75('0x32')]));_0x472d91['attributes']=_0x472d91[_0x7e75('0x31')][_0x7e75('0x33')]?_0x472d91[_0x7e75('0x31')]:_0x572782[_0x7e75('0x2c')];_0x472d91[_0x7e75('0x57')]=qs[_0x7e75('0x48')](_0x48563d[_0x7e75('0x2e')][_0x7e75('0x48')]);_0x472d91['where']=qs[_0x7e75('0x2f')](_[_0x7e75('0x49')](_0x48563d[_0x7e75('0x2e')],_0x572782[_0x7e75('0x2f')]));if(_0x48563d[_0x7e75('0x2e')][_0x7e75('0x4b')]){_0x472d91['where']=_[_0x7e75('0x35')](_0x472d91[_0x7e75('0x27')],{'$or':_[_0x7e75('0x20')](_0x472d91[_0x7e75('0x31')],function(_0x2df2c2){var _0x4ad306={};_0x4ad306[_0x2df2c2]={'$like':'%'+_0x48563d['query']['filter']+'%'};return _0x4ad306;})});}_0x472d91=_[_0x7e75('0x35')]({},_0x472d91,_0x48563d['options']);return _0x382976[_0x7e75('0x58')](_0x472d91);}})[_0x7e75('0x1a')](function(_0x207bd1){if(_0x207bd1){_0x2a7465=_0x207bd1[_0x7e75('0x33')];if(!_0x48563d[_0x7e75('0x2e')][_0x7e75('0x47')](_0x7e75('0x59'))){_0x472d91['limit']=qs[_0x7e75('0x16')](_0x48563d[_0x7e75('0x2e')]['limit']);_0x472d91['offset']=qs[_0x7e75('0x13')](_0x48563d[_0x7e75('0x2e')][_0x7e75('0x13')]);}return _0x382976[_0x7e75('0x58')](_0x472d91);}})[_0x7e75('0x1a')](function(_0x5f51ea){if(_0x5f51ea){return _0x5f51ea?{'count':_0x2a7465,'rows':_0x5f51ea}:null;}})[_0x7e75('0x1a')](respondWithResult(_0x3b0cd8,null))[_0x7e75('0x41')](handleError(_0x3b0cd8,null));};exports[_0x7e75('0x5a')]=function(_0x1e81a3,_0x421c73){var _0xf8dc72=_0x1e81a3['body'][_0x7e75('0x5b')];return db[_0x7e75('0x56')]['findAll']({'where':{'id':_0xf8dc72},'attributes':['id'],'include':[{'model':db[_0x7e75('0x4c')],'as':_0x7e75('0x5c'),'attributes':['id',_0x7e75('0x1d'),_0x7e75('0x5d'),'voicePause',_0x7e75('0x5e')],'raw':!![]}]})[_0x7e75('0x1a')](function(_0x3dbdb2){if(_0x3dbdb2){var _0x524fd4=_['flatMap'](_0x3dbdb2,function(_0x17d9b3){var _0x559095=_0x17d9b3[_0x7e75('0x3a')]({'plain':!![]});return _0x559095[_0x7e75('0x5c')];});return db[_0x7e75('0x21')][_0x7e75('0x37')]({'where':{'id':_0x1e81a3[_0x7e75('0x2b')]['id']}})[_0x7e75('0x1a')](function(_0x3e0324){return db[_0x7e75('0x5f')][_0x7e75('0x60')](function(_0x91e510){return _0x3e0324[_0x7e75('0x5a')](_0xf8dc72,{'transaction':_0x91e510})[_0x7e75('0x1a')](function(){return BPromise[_0x7e75('0x61')](_0x524fd4,function(_0x220980){return db[_0x7e75('0x46')]['findOrCreate']({'where':{'UserId':_0x220980['id'],'MailQueueId':_0x1e81a3[_0x7e75('0x2b')]['id']},'transaction':_0x91e510});});})[_0x7e75('0x1a')](function(){_0x524fd4[_0x7e75('0x62')](function(_0x16a030){socket['emit'](_0x7e75('0x63'),{'UserId':_0x16a030['id'],'MailQueueId':_0x3e0324['id']});});});});});}})[_0x7e75('0x1a')](respondWithStatusCode(_0x421c73,null))[_0x7e75('0x41')](handleError(_0x421c73,null));};exports[_0x7e75('0x64')]=function(_0xc53f3b,_0x1a39e5){return db[_0x7e75('0x56')][_0x7e75('0x29')]({'where':{'id':_0xc53f3b['query']['ids']},'attributes':['id'],'include':[{'model':db[_0x7e75('0x4c')],'as':_0x7e75('0x5c'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x1a39e5,null))[_0x7e75('0x1a')](function(_0x14783c){var _0x39bd4d=_[_0x7e75('0x20')](_0x14783c,'id');var _0x1c777f=[];var _0x23f221=[];var _0x5d3a46=squel[_0x7e75('0x65')]();_0x5d3a46[_0x7e75('0x66')](_0x7e75('0x67'))['from'](_0x7e75('0x68'),'tq')[_0x7e75('0x69')](_0x7e75('0x6a'),'ut',_0x7e75('0x6b'))[_0x7e75('0x27')](_0x7e75('0x6c'),_0xc53f3b['params']['id']);for(var _0x417f04=0x0;_0x417f04<_0x14783c[_0x7e75('0x33')];_0x417f04+=0x1){let _0x25e573=_0x14783c[_0x417f04];for(var _0xa6fca8=0x0;_0xa6fca8<_0x25e573[_0x7e75('0x5c')]['length'];_0xa6fca8+=0x1){let _0x3784f0=_0x25e573[_0x7e75('0x5c')][_0xa6fca8];var _0x159c63=_0x5d3a46[_0x7e75('0x6d')]();_0x159c63[_0x7e75('0x27')](_0x7e75('0x6e'),_0x3784f0['id']);_0x23f221['push'](db[_0x7e75('0x5f')][_0x7e75('0x2e')](_0x159c63[_0x7e75('0x6f')](),{'type':db[_0x7e75('0x5f')][_0x7e75('0x70')][_0x7e75('0x71')]})[_0x7e75('0x1a')](function(_0x1fc0d0){if(_0x1fc0d0[_0x7e75('0x33')]===0x1){return _0x3784f0['id'];}else{var _0x591cda=_[_0x7e75('0x72')](_[_0x7e75('0x20')](_0x1fc0d0,_0x7e75('0x73')),function(_0x37372a){return _[_0x7e75('0x74')](_0x39bd4d,_0x37372a);});if(_0x591cda){return _0x3784f0['id'];}}}));}}return BPromise[_0x7e75('0x75')](_0x23f221)['then'](function(_0x5d1676){_0x1c777f=_(_0x1c777f)['union'](_0x5d1676)[_0x7e75('0x76')]()[_0x7e75('0x77')]();return db[_0x7e75('0x21')][_0x7e75('0x37')]({'where':{'id':_0xc53f3b[_0x7e75('0x2b')]['id']}})[_0x7e75('0x1a')](function(_0x25fb72){return db[_0x7e75('0x5f')][_0x7e75('0x60')](function(_0x44b278){return _0x25fb72[_0x7e75('0x64')](_0xc53f3b[_0x7e75('0x2e')][_0x7e75('0x5b')],{'transaction':_0x44b278})['then'](function(){if(!_[_0x7e75('0x78')](_0x1c777f)){return _0x25fb72[_0x7e75('0x79')](_0x1c777f,{'transaction':_0x44b278});}})['then'](function(){_0x1c777f['forEach'](function(_0x5bf201){socket[_0x7e75('0x7a')]('userMailQueue:remove',{'UserId':_0x5bf201,'MailQueueId':_0x25fb72['id']});});});});});});})['then'](respondWithStatusCode(_0x1a39e5,null))[_0x7e75('0x41')](handleError(_0x1a39e5,null));};exports[_0x7e75('0x7b')]=function(_0x14566c,_0x3667e8){return db[_0x7e75('0x21')]['find']({'where':{'id':_0x14566c[_0x7e75('0x2b')]['id']}})[_0x7e75('0x1a')](handleEntityNotFound(_0x3667e8,null))[_0x7e75('0x1a')](function(_0x44e039){if(_0x44e039){return _0x44e039['addAgents'](_0x14566c[_0x7e75('0x39')][_0x7e75('0x5b')],_[_0x7e75('0x7c')](_0x14566c[_0x7e75('0x39')],[_0x7e75('0x5b'),'id'])||{})[_0x7e75('0x7d')](function(_0x3d4491){for(var _0x4c631d=0x0;_0x4c631d<_0x14566c[_0x7e75('0x39')][_0x7e75('0x5b')][_0x7e75('0x33')];_0x4c631d+=0x1){socket['emit']('userMailQueue:save',{'UserId':Number(_0x14566c['body'][_0x7e75('0x5b')][_0x4c631d]),'MailQueueId':Number(_0x14566c[_0x7e75('0x2b')]['id'])});}return _0x3d4491;});}})[_0x7e75('0x1a')](respondWithResult(_0x3667e8,null))['catch'](handleError(_0x3667e8,null));};exports[_0x7e75('0x79')]=function(_0x46435f,_0x5cb324){return db[_0x7e75('0x21')][_0x7e75('0x37')]({'where':{'id':_0x46435f['params']['id']}})[_0x7e75('0x1a')](handleEntityNotFound(_0x5cb324,null))[_0x7e75('0x1a')](function(_0xf9211f){if(_0xf9211f){return _0xf9211f[_0x7e75('0x79')](_0x46435f[_0x7e75('0x2e')][_0x7e75('0x5b')])[_0x7e75('0x1a')](function(){if(_[_0x7e75('0x7e')](_0x46435f[_0x7e75('0x2e')][_0x7e75('0x5b')])){for(var _0x501ac8=0x0;_0x501ac8<_0x46435f[_0x7e75('0x2e')][_0x7e75('0x5b')][_0x7e75('0x33')];_0x501ac8+=0x1){socket[_0x7e75('0x7a')](_0x7e75('0x7f'),{'UserId':Number(_0x46435f[_0x7e75('0x2e')][_0x7e75('0x5b')][_0x501ac8]),'MailQueueId':Number(_0x46435f[_0x7e75('0x2b')]['id'])});}}else{socket['emit'](_0x7e75('0x7f'),{'UserId':Number(_0x46435f[_0x7e75('0x2e')][_0x7e75('0x5b')]),'MailQueueId':Number(_0x46435f['params']['id'])});}});}})[_0x7e75('0x1a')](respondWithStatusCode(_0x5cb324,null))[_0x7e75('0x41')](handleError(_0x5cb324,null));};exports[_0x7e75('0x80')]=function(_0xb05c3d,_0x1701f3){var _0x593f70={};var _0x635002={};var _0x21c46f;var _0x97cd6b;return db[_0x7e75('0x21')][_0x7e75('0x45')]({'where':{'id':_0xb05c3d[_0x7e75('0x2b')]['id']}})[_0x7e75('0x1a')](handleEntityNotFound(_0x1701f3,null))['then'](function(_0x5ad6e2){if(_0x5ad6e2){_0x21c46f=_0x5ad6e2;_0x635002[_0x7e75('0x2c')]=_[_0x7e75('0x2d')](db[_0x7e75('0x4c')]['rawAttributes']);_0x635002[_0x7e75('0x2e')]=_[_0x7e75('0x2d')](_0xb05c3d[_0x7e75('0x2e')]);_0x635002[_0x7e75('0x2f')]=_[_0x7e75('0x30')](_0x635002[_0x7e75('0x2c')],_0x635002['query']);_0x593f70['attributes']=_['intersection'](_0x635002[_0x7e75('0x2c')],qs['fields'](_0xb05c3d[_0x7e75('0x2e')]['fields']));_0x593f70[_0x7e75('0x31')]=_0x593f70['attributes'][_0x7e75('0x33')]?_0x593f70['attributes']:_0x635002['model'];_0x593f70[_0x7e75('0x57')]=qs[_0x7e75('0x48')](_0xb05c3d[_0x7e75('0x2e')][_0x7e75('0x48')]);_0x593f70[_0x7e75('0x27')]=qs[_0x7e75('0x2f')](_[_0x7e75('0x49')](_0xb05c3d[_0x7e75('0x2e')],_0x635002[_0x7e75('0x2f')]));if(_0xb05c3d[_0x7e75('0x2e')]['filter']){_0x593f70['where']=_[_0x7e75('0x35')](_0x593f70[_0x7e75('0x27')],{'$or':_[_0x7e75('0x20')](_0x593f70[_0x7e75('0x31')],function(_0x250068){var _0x529b23={};_0x529b23[_0x250068]={'$like':'%'+_0xb05c3d[_0x7e75('0x2e')]['filter']+'%'};return _0x529b23;})});}_0x593f70=_[_0x7e75('0x35')]({},_0x593f70,_0xb05c3d[_0x7e75('0x36')]);return _0x21c46f[_0x7e75('0x80')](_0x593f70);}})[_0x7e75('0x1a')](function(_0x9c3c1d){if(_0x9c3c1d){_0x97cd6b=_0x9c3c1d[_0x7e75('0x33')];if(!_0xb05c3d['query'][_0x7e75('0x47')](_0x7e75('0x59'))){_0x593f70[_0x7e75('0x16')]=qs[_0x7e75('0x16')](_0xb05c3d['query'][_0x7e75('0x16')]);_0x593f70[_0x7e75('0x13')]=qs[_0x7e75('0x13')](_0xb05c3d[_0x7e75('0x2e')]['offset']);}return _0x21c46f[_0x7e75('0x80')](_0x593f70);}})[_0x7e75('0x1a')](function(_0x3afed5){if(_0x3afed5){return _0x3afed5?{'count':_0x97cd6b,'rows':_0x3afed5}:null;}})[_0x7e75('0x1a')](respondWithResult(_0x1701f3,null))[_0x7e75('0x41')](handleError(_0x1701f3,null));}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.events.js b/server/api/mailQueue/mailQueue.events.js index 747d613..4b031b8 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 _0x6e29=['emit','hasOwnProperty','hook','events','MailQueue','setMaxListeners','update','remove'];(function(_0x52092a,_0x540d49){var _0x5f26c7=function(_0x5cbd3d){while(--_0x5cbd3d){_0x52092a['push'](_0x52092a['shift']());}};_0x5f26c7(++_0x540d49);}(_0x6e29,0x1b3));var _0x96e2=function(_0x4d20c9,_0x40a06b){_0x4d20c9=_0x4d20c9-0x0;var _0x54ccba=_0x6e29[_0x4d20c9];return _0x54ccba;};'use strict';var EventEmitter=require(_0x96e2('0x0'));var MailQueue=require('../../mysqldb')['db'][_0x96e2('0x1')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0x96e2('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x96e2('0x3'),'afterDestroy':_0x96e2('0x4')};function emitEvent(_0x249ff7){return function(_0x16d738,_0x3cce2b,_0x306107){MailQueueEvents[_0x96e2('0x5')](_0x249ff7+':'+_0x16d738['id'],_0x16d738);MailQueueEvents[_0x96e2('0x5')](_0x249ff7,_0x16d738);_0x306107(null);};}for(var e in events){if(events[_0x96e2('0x6')](e)){var event=events[e];MailQueue[_0x96e2('0x7')](e,emitEvent(event));}}module['exports']=MailQueueEvents; \ No newline at end of file +var _0x9538=['MailQueue','setMaxListeners','save','emit','hook','events','../../mysqldb'];(function(_0x35ac19,_0x2a5a6a){var _0x3d0302=function(_0xaa1341){while(--_0xaa1341){_0x35ac19['push'](_0x35ac19['shift']());}};_0x3d0302(++_0x2a5a6a);}(_0x9538,0x1cc));var _0x8953=function(_0x51fd2f,_0x187163){_0x51fd2f=_0x51fd2f-0x0;var _0x446e0e=_0x9538[_0x51fd2f];return _0x446e0e;};'use strict';var EventEmitter=require(_0x8953('0x0'));var MailQueue=require(_0x8953('0x1'))['db'][_0x8953('0x2')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0x8953('0x3')](0x0);var events={'afterCreate':_0x8953('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x23fd57){return function(_0x297133,_0x585d21,_0x37189e){MailQueueEvents[_0x8953('0x5')](_0x23fd57+':'+_0x297133['id'],_0x297133);MailQueueEvents[_0x8953('0x5')](_0x23fd57,_0x297133);_0x37189e(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailQueue[_0x8953('0x6')](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 4a08be9..1e9d439 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 _0x80aa=['MailQueue','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0x80aa,0x1a3));var _0xa80a=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x80aa[_0x20a584];return _0x4b41a8;};'use strict';var _=require('lodash');var util=require(_0xa80a('0x0'));var logger=require('../../config/logger')(_0xa80a('0x1'));var moment=require(_0xa80a('0x2'));var BPromise=require(_0xa80a('0x3'));var rp=require(_0xa80a('0x4'));var fs=require('fs');var path=require(_0xa80a('0x5'));var rimraf=require(_0xa80a('0x6'));var config=require(_0xa80a('0x7'));var attributes=require('./mailQueue.attributes');module[_0xa80a('0x8')]=function(_0x43c33b,_0x486ea5){return _0x43c33b[_0xa80a('0x9')](_0xa80a('0xa'),attributes,{'tableName':'mail_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdf4a=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','./mailQueue.attributes','exports','define','mail_queues'];(function(_0x35ce45,_0x57c22a){var _0x5cd865=function(_0x1100fd){while(--_0x1100fd){_0x35ce45['push'](_0x35ce45['shift']());}};_0x5cd865(++_0x57c22a);}(_0xdf4a,0x18c));var _0xadf4=function(_0x32af89,_0xfb95bc){_0x32af89=_0x32af89-0x0;var _0x1a0bca=_0xdf4a[_0x32af89];return _0x1a0bca;};'use strict';var _=require(_0xadf4('0x0'));var util=require(_0xadf4('0x1'));var logger=require(_0xadf4('0x2'))(_0xadf4('0x3'));var moment=require(_0xadf4('0x4'));var BPromise=require(_0xadf4('0x5'));var rp=require(_0xadf4('0x6'));var fs=require('fs');var path=require(_0xadf4('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xadf4('0x8'));module[_0xadf4('0x9')]=function(_0x550998,_0x34b108){return _0x550998[_0xadf4('0xa')]('MailQueue',attributes,{'tableName':_0xadf4('0xb'),'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 df4914e..2e83c4e 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 _0x6d4a=['catch','GetMailQueue','MailQueue','findAll','options','where','attributes','limit','include','map','model','then','ShowMailQueue','find','raw','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./mailQueue.socket','register','request','info','MailQueue,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result'];(function(_0x48c612,_0x432076){var _0x5f0583=function(_0x2ebc92){while(--_0x2ebc92){_0x48c612['push'](_0x48c612['shift']());}};_0x5f0583(++_0x432076);}(_0x6d4a,0x117));var _0xa6d4=function(_0x5e3c77,_0x156aa2){_0x5e3c77=_0x5e3c77-0x0;var _0x37dfad=_0x6d4a[_0x5e3c77];return _0x37dfad;};'use strict';var _=require(_0xa6d4('0x0'));var util=require('util');var moment=require(_0xa6d4('0x1'));var BPromise=require(_0xa6d4('0x2'));var rs=require(_0xa6d4('0x3'));var fs=require('fs');var Redis=require(_0xa6d4('0x4'));var db=require(_0xa6d4('0x5'))['db'];var utils=require(_0xa6d4('0x6'));var logger=require(_0xa6d4('0x7'))(_0xa6d4('0x8'));var config=require(_0xa6d4('0x9'));var jayson=require(_0xa6d4('0xa'));var client=jayson[_0xa6d4('0xb')][_0xa6d4('0xc')]({'port':0x232a});config[_0xa6d4('0xd')]=_[_0xa6d4('0xe')](config['redis'],{'host':_0xa6d4('0xf'),'port':0x18eb});var socket=require(_0xa6d4('0x10'))(new Redis(config['redis']));require(_0xa6d4('0x11'))[_0xa6d4('0x12')](socket);function respondWithRpcPromise(_0x2bea15,_0xb76050,_0x2320cc){return new BPromise(function(_0x54edec,_0x340d84){return client[_0xa6d4('0x13')](_0x2bea15,_0x2320cc)['then'](function(_0x2c7f14){logger[_0xa6d4('0x14')](_0xa6d4('0x15'),_0xb76050,'request\x20sent');logger[_0xa6d4('0x16')]('MailQueue,\x20%s,\x20%s,\x20%s',_0xb76050,_0xa6d4('0x17'),JSON[_0xa6d4('0x18')](_0x2c7f14));if(_0x2c7f14['error']){if(_0x2c7f14[_0xa6d4('0x19')][_0xa6d4('0x1a')]===0x1f4){logger[_0xa6d4('0x19')](_0xa6d4('0x15'),_0xb76050,_0x2c7f14[_0xa6d4('0x19')][_0xa6d4('0x1b')]);return _0x340d84(_0x2c7f14[_0xa6d4('0x19')][_0xa6d4('0x1b')]);}logger[_0xa6d4('0x19')](_0xa6d4('0x15'),_0xb76050,_0x2c7f14[_0xa6d4('0x19')][_0xa6d4('0x1b')]);return _0x54edec(_0x2c7f14['error'][_0xa6d4('0x1b')]);}else{logger['info'](_0xa6d4('0x15'),_0xb76050,_0xa6d4('0x17'));_0x54edec(_0x2c7f14[_0xa6d4('0x1c')]['message']);}})[_0xa6d4('0x1d')](function(_0x442466){logger['error'](_0xa6d4('0x15'),_0xb76050,_0x442466);_0x340d84(_0x442466);});});}exports[_0xa6d4('0x1e')]=function(_0x12c040){var _0x39315a=this;return new Promise(function(_0x702c88,_0x5c40f5){return db[_0xa6d4('0x1f')][_0xa6d4('0x20')]({'raw':_0x12c040[_0xa6d4('0x21')]?_0x12c040['options']['raw']===undefined?!![]:![]:!![],'where':_0x12c040[_0xa6d4('0x21')]?_0x12c040[_0xa6d4('0x21')][_0xa6d4('0x22')]||null:null,'attributes':_0x12c040[_0xa6d4('0x21')]?_0x12c040[_0xa6d4('0x21')][_0xa6d4('0x23')]||null:null,'limit':_0x12c040['options']?_0x12c040[_0xa6d4('0x21')][_0xa6d4('0x24')]||null:null,'include':_0x12c040[_0xa6d4('0x21')]?_0x12c040[_0xa6d4('0x21')][_0xa6d4('0x25')]?_[_0xa6d4('0x26')](_0x12c040['options'][_0xa6d4('0x25')],function(_0x5589c5){return{'model':db[_0x5589c5[_0xa6d4('0x27')]],'as':_0x5589c5['as'],'attributes':_0x5589c5['attributes'],'include':_0x5589c5[_0xa6d4('0x25')]?_[_0xa6d4('0x26')](_0x5589c5[_0xa6d4('0x25')],function(_0x5d0104){return{'model':db[_0x5d0104[_0xa6d4('0x27')]],'as':_0x5d0104['as'],'attributes':_0x5d0104[_0xa6d4('0x23')],'include':_0x5d0104['include']?_[_0xa6d4('0x26')](_0x5d0104[_0xa6d4('0x25')],function(_0x501bd1){return{'model':db[_0x501bd1['model']],'as':_0x501bd1['as'],'attributes':_0x501bd1[_0xa6d4('0x23')]};}):[]};}):[]};}):[]:[]})[_0xa6d4('0x28')](function(_0x1da3e2){logger['info'](_0xa6d4('0x1e'),_0x12c040);logger[_0xa6d4('0x16')](_0xa6d4('0x1e'),_0x12c040,JSON[_0xa6d4('0x18')](_0x1da3e2));_0x702c88(_0x1da3e2);})['catch'](function(_0x582de5){logger['error'](_0xa6d4('0x1e'),_0x582de5[_0xa6d4('0x1b')],_0x12c040);_0x5c40f5(_0x39315a[_0xa6d4('0x19')](0x1f4,_0x582de5[_0xa6d4('0x1b')]));});});};exports[_0xa6d4('0x29')]=function(_0x1072f7){var _0x116490=this;return new Promise(function(_0x5ca02a,_0x56ff24){return db[_0xa6d4('0x1f')][_0xa6d4('0x2a')]({'raw':_0x1072f7[_0xa6d4('0x21')]?_0x1072f7[_0xa6d4('0x21')][_0xa6d4('0x2b')]===undefined?!![]:![]:!![],'where':_0x1072f7[_0xa6d4('0x21')]?_0x1072f7[_0xa6d4('0x21')][_0xa6d4('0x22')]||null:null,'attributes':_0x1072f7[_0xa6d4('0x21')]?_0x1072f7['options'][_0xa6d4('0x23')]||null:null,'include':_0x1072f7['options']?_0x1072f7[_0xa6d4('0x21')][_0xa6d4('0x25')]?_[_0xa6d4('0x26')](_0x1072f7[_0xa6d4('0x21')][_0xa6d4('0x25')],function(_0x3f3742){return{'model':db[_0x3f3742[_0xa6d4('0x27')]],'as':_0x3f3742['as'],'attributes':_0x3f3742['attributes'],'include':_0x3f3742['include']?_[_0xa6d4('0x26')](_0x3f3742[_0xa6d4('0x25')],function(_0x590bc3){return{'model':db[_0x590bc3[_0xa6d4('0x27')]],'as':_0x590bc3['as'],'attributes':_0x590bc3['attributes'],'include':_0x590bc3[_0xa6d4('0x25')]?_[_0xa6d4('0x26')](_0x590bc3['include'],function(_0x5f0f00){return{'model':db[_0x5f0f00[_0xa6d4('0x27')]],'as':_0x5f0f00['as'],'attributes':_0x5f0f00[_0xa6d4('0x23')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x44d507){logger[_0xa6d4('0x14')](_0xa6d4('0x29'),_0x1072f7);logger[_0xa6d4('0x16')](_0xa6d4('0x29'),_0x1072f7,JSON[_0xa6d4('0x18')](_0x44d507));_0x5ca02a(_0x44d507);})[_0xa6d4('0x1d')](function(_0x584e33){logger[_0xa6d4('0x19')](_0xa6d4('0x29'),_0x584e33['message'],_0x1072f7);_0x56ff24(_0x116490[_0xa6d4('0x19')](0x1f4,_0x584e33[_0xa6d4('0x1b')]));});});}; \ No newline at end of file +var _0x6c6f=['rpc','../../config/environment','client','defaults','localhost','socket.io-emitter','redis','./mailQueue.socket','register','request','then','info','MailQueue,\x20%s,\x20%s','request\x20sent','debug','MailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','options','raw','where','attributes','limit','include','map','model','GetMailQueue','ShowMailQueue','MailQueue','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x21f88f,_0x48cfba){var _0x3b9ff5=function(_0x292aee){while(--_0x292aee){_0x21f88f['push'](_0x21f88f['shift']());}};_0x3b9ff5(++_0x48cfba);}(_0x6c6f,0x17a));var _0xf6c6=function(_0x268c71,_0x21b22){_0x268c71=_0x268c71-0x0;var _0x1b4450=_0x6c6f[_0x268c71];return _0x1b4450;};'use strict';var _=require(_0xf6c6('0x0'));var util=require(_0xf6c6('0x1'));var moment=require(_0xf6c6('0x2'));var BPromise=require(_0xf6c6('0x3'));var rs=require(_0xf6c6('0x4'));var fs=require('fs');var Redis=require(_0xf6c6('0x5'));var db=require(_0xf6c6('0x6'))['db'];var utils=require(_0xf6c6('0x7'));var logger=require(_0xf6c6('0x8'))(_0xf6c6('0x9'));var config=require(_0xf6c6('0xa'));var jayson=require('jayson/promise');var client=jayson[_0xf6c6('0xb')]['http']({'port':0x232a});config['redis']=_[_0xf6c6('0xc')](config['redis'],{'host':_0xf6c6('0xd'),'port':0x18eb});var socket=require(_0xf6c6('0xe'))(new Redis(config[_0xf6c6('0xf')]));require(_0xf6c6('0x10'))[_0xf6c6('0x11')](socket);function respondWithRpcPromise(_0x4d2413,_0x19a91f,_0x2ff1c1){return new BPromise(function(_0x4a9b19,_0x5a5556){return client[_0xf6c6('0x12')](_0x4d2413,_0x2ff1c1)[_0xf6c6('0x13')](function(_0x4e34e5){logger[_0xf6c6('0x14')](_0xf6c6('0x15'),_0x19a91f,_0xf6c6('0x16'));logger[_0xf6c6('0x17')](_0xf6c6('0x18'),_0x19a91f,_0xf6c6('0x16'),JSON[_0xf6c6('0x19')](_0x4e34e5));if(_0x4e34e5[_0xf6c6('0x1a')]){if(_0x4e34e5[_0xf6c6('0x1a')][_0xf6c6('0x1b')]===0x1f4){logger['error'](_0xf6c6('0x15'),_0x19a91f,_0x4e34e5[_0xf6c6('0x1a')][_0xf6c6('0x1c')]);return _0x5a5556(_0x4e34e5[_0xf6c6('0x1a')]['message']);}logger['error'](_0xf6c6('0x15'),_0x19a91f,_0x4e34e5[_0xf6c6('0x1a')]['message']);return _0x4a9b19(_0x4e34e5[_0xf6c6('0x1a')][_0xf6c6('0x1c')]);}else{logger[_0xf6c6('0x14')]('MailQueue,\x20%s,\x20%s',_0x19a91f,_0xf6c6('0x16'));_0x4a9b19(_0x4e34e5[_0xf6c6('0x1d')]['message']);}})[_0xf6c6('0x1e')](function(_0x517ac0){logger[_0xf6c6('0x1a')](_0xf6c6('0x15'),_0x19a91f,_0x517ac0);_0x5a5556(_0x517ac0);});});}exports['GetMailQueue']=function(_0x3b85d5){var _0x344969=this;return new Promise(function(_0x4643b2,_0x24ecdb){return db['MailQueue']['findAll']({'raw':_0x3b85d5[_0xf6c6('0x1f')]?_0x3b85d5[_0xf6c6('0x1f')][_0xf6c6('0x20')]===undefined?!![]:![]:!![],'where':_0x3b85d5['options']?_0x3b85d5[_0xf6c6('0x1f')][_0xf6c6('0x21')]||null:null,'attributes':_0x3b85d5[_0xf6c6('0x1f')]?_0x3b85d5[_0xf6c6('0x1f')][_0xf6c6('0x22')]||null:null,'limit':_0x3b85d5[_0xf6c6('0x1f')]?_0x3b85d5[_0xf6c6('0x1f')][_0xf6c6('0x23')]||null:null,'include':_0x3b85d5['options']?_0x3b85d5[_0xf6c6('0x1f')][_0xf6c6('0x24')]?_[_0xf6c6('0x25')](_0x3b85d5[_0xf6c6('0x1f')]['include'],function(_0x37f12f){return{'model':db[_0x37f12f[_0xf6c6('0x26')]],'as':_0x37f12f['as'],'attributes':_0x37f12f[_0xf6c6('0x22')],'include':_0x37f12f[_0xf6c6('0x24')]?_[_0xf6c6('0x25')](_0x37f12f[_0xf6c6('0x24')],function(_0x474e33){return{'model':db[_0x474e33[_0xf6c6('0x26')]],'as':_0x474e33['as'],'attributes':_0x474e33[_0xf6c6('0x22')],'include':_0x474e33[_0xf6c6('0x24')]?_[_0xf6c6('0x25')](_0x474e33[_0xf6c6('0x24')],function(_0x167e46){return{'model':db[_0x167e46[_0xf6c6('0x26')]],'as':_0x167e46['as'],'attributes':_0x167e46[_0xf6c6('0x22')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x331056){logger[_0xf6c6('0x14')](_0xf6c6('0x27'),_0x3b85d5);logger[_0xf6c6('0x17')](_0xf6c6('0x27'),_0x3b85d5,JSON[_0xf6c6('0x19')](_0x331056));_0x4643b2(_0x331056);})[_0xf6c6('0x1e')](function(_0x1be663){logger[_0xf6c6('0x1a')](_0xf6c6('0x27'),_0x1be663[_0xf6c6('0x1c')],_0x3b85d5);_0x24ecdb(_0x344969[_0xf6c6('0x1a')](0x1f4,_0x1be663[_0xf6c6('0x1c')]));});});};exports[_0xf6c6('0x28')]=function(_0x201478){var _0x51e6d5=this;return new Promise(function(_0x345c2b,_0x554048){return db[_0xf6c6('0x29')][_0xf6c6('0x2a')]({'raw':_0x201478[_0xf6c6('0x1f')]?_0x201478[_0xf6c6('0x1f')][_0xf6c6('0x20')]===undefined?!![]:![]:!![],'where':_0x201478[_0xf6c6('0x1f')]?_0x201478[_0xf6c6('0x1f')][_0xf6c6('0x21')]||null:null,'attributes':_0x201478['options']?_0x201478[_0xf6c6('0x1f')][_0xf6c6('0x22')]||null:null,'include':_0x201478[_0xf6c6('0x1f')]?_0x201478['options'][_0xf6c6('0x24')]?_['map'](_0x201478[_0xf6c6('0x1f')][_0xf6c6('0x24')],function(_0x19a32b){return{'model':db[_0x19a32b[_0xf6c6('0x26')]],'as':_0x19a32b['as'],'attributes':_0x19a32b[_0xf6c6('0x22')],'include':_0x19a32b[_0xf6c6('0x24')]?_[_0xf6c6('0x25')](_0x19a32b[_0xf6c6('0x24')],function(_0x4c3ed0){return{'model':db[_0x4c3ed0[_0xf6c6('0x26')]],'as':_0x4c3ed0['as'],'attributes':_0x4c3ed0[_0xf6c6('0x22')],'include':_0x4c3ed0[_0xf6c6('0x24')]?_[_0xf6c6('0x25')](_0x4c3ed0['include'],function(_0x1c9f92){return{'model':db[_0x1c9f92['model']],'as':_0x1c9f92['as'],'attributes':_0x1c9f92[_0xf6c6('0x22')]};}):[]};}):[]};}):[]:[]})[_0xf6c6('0x13')](function(_0x922aee){logger['info']('ShowMailQueue',_0x201478);logger[_0xf6c6('0x17')](_0xf6c6('0x28'),_0x201478,JSON[_0xf6c6('0x19')](_0x922aee));_0x345c2b(_0x922aee);})[_0xf6c6('0x1e')](function(_0x523773){logger[_0xf6c6('0x1a')]('ShowMailQueue',_0x523773['message'],_0x201478);_0x554048(_0x51e6d5[_0xf6c6('0x1a')](0x1f4,_0x523773[_0xf6c6('0x1c')]));});});}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.socket.js b/server/api/mailQueue/mailQueue.socket.js index deec10d..a050810 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 _0xb396=['remove','update','emit','removeListener','mailQueue:','./mailQueue.events','save'];(function(_0x22923b,_0x5ba868){var _0x340564=function(_0x2310d6){while(--_0x2310d6){_0x22923b['push'](_0x22923b['shift']());}};_0x340564(++_0x5ba868);}(_0xb396,0x1e8));var _0x6b39=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xb396[_0xa464c9];return _0x3d73c4;};'use strict';var MailQueueEvents=require(_0x6b39('0x0'));var events=[_0x6b39('0x1'),_0x6b39('0x2'),_0x6b39('0x3')];function createListener(_0x583ce5,_0x1dd64c){return function(_0x17a631){_0x1dd64c[_0x6b39('0x4')](_0x583ce5,_0x17a631);};}function removeListener(_0x3da3b4,_0x35b9b1){return function(){MailQueueEvents[_0x6b39('0x5')](_0x3da3b4,_0x35b9b1);};}exports['register']=function(_0x474aa8){for(var _0x48fbca=0x0,_0x3d5572=events['length'];_0x48fbca<_0x3d5572;_0x48fbca++){var _0x4b5ef5=events[_0x48fbca];var _0xa5a6e0=createListener(_0x6b39('0x6')+_0x4b5ef5,_0x474aa8);MailQueueEvents['on'](_0x4b5ef5,_0xa5a6e0);}}; \ No newline at end of file +var _0x7dab=['update','emit','removeListener','register','length','./mailQueue.events','save','remove'];(function(_0x580718,_0x4ca778){var _0x5f353f=function(_0x2cde3b){while(--_0x2cde3b){_0x580718['push'](_0x580718['shift']());}};_0x5f353f(++_0x4ca778);}(_0x7dab,0xe5));var _0xb7da=function(_0x24d586,_0x47d142){_0x24d586=_0x24d586-0x0;var _0x2b72f4=_0x7dab[_0x24d586];return _0x2b72f4;};'use strict';var MailQueueEvents=require(_0xb7da('0x0'));var events=[_0xb7da('0x1'),_0xb7da('0x2'),_0xb7da('0x3')];function createListener(_0x1e6b3e,_0x4eb83b){return function(_0x46e21c){_0x4eb83b[_0xb7da('0x4')](_0x1e6b3e,_0x46e21c);};}function removeListener(_0xf5b0c3,_0x35a473){return function(){MailQueueEvents[_0xb7da('0x5')](_0xf5b0c3,_0x35a473);};}exports[_0xb7da('0x6')]=function(_0x453be8){for(var _0x2601db=0x0,_0x4c980f=events[_0xb7da('0x7')];_0x2601db<_0x4c980f;_0x2601db++){var _0x16dd2e=events[_0x2601db];var _0x35b6c4=createListener('mailQueue:'+_0x16dd2e,_0x453be8);MailQueueEvents['on'](_0x16dd2e,_0x35b6c4);}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/index.js b/server/api/mailQueueReport/index.js index b26045b..9e5da9d 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 _0xcc2e=['isAuthenticated','/describe','describe','/:id','update','delete','destroy','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get'];(function(_0x59be95,_0x49b245){var _0x3f75a7=function(_0x551132){while(--_0x551132){_0x59be95['push'](_0x59be95['shift']());}};_0x3f75a7(++_0x49b245);}(_0xcc2e,0x148));var _0xecc2=function(_0x546d45,_0x33f698){_0x546d45=_0x546d45-0x0;var _0xffd2e8=_0xcc2e[_0x546d45];return _0xffd2e8;};'use strict';var multer=require(_0xecc2('0x0'));var util=require('util');var path=require(_0xecc2('0x1'));var timeout=require('connect-timeout');var express=require(_0xecc2('0x2'));var router=express[_0xecc2('0x3')]();var fs_extra=require(_0xecc2('0x4'));var auth=require(_0xecc2('0x5'));var interaction=require(_0xecc2('0x6'));var config=require('../../config/environment');var controller=require('./mailQueueReport.controller');router[_0xecc2('0x7')]('/',auth[_0xecc2('0x8')](),controller['index']);router[_0xecc2('0x7')](_0xecc2('0x9'),auth[_0xecc2('0x8')](),controller[_0xecc2('0xa')]);router[_0xecc2('0x7')](_0xecc2('0xb'),auth[_0xecc2('0x8')](),controller['show']);router['post']('/',auth[_0xecc2('0x8')](),controller['create']);router['put']('/:id',auth['isAuthenticated'](),controller[_0xecc2('0xc')]);router[_0xecc2('0xd')](_0xecc2('0xb'),auth[_0xecc2('0x8')](),controller[_0xecc2('0xe')]);module[_0xecc2('0xf')]=router; \ No newline at end of file +var _0xebd4=['isAuthenticated','index','describe','/:id','show','post','put','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailQueueReport.controller','get'];(function(_0x4ade89,_0x33f831){var _0x5edb02=function(_0x3c9f66){while(--_0x3c9f66){_0x4ade89['push'](_0x4ade89['shift']());}};_0x5edb02(++_0x33f831);}(_0xebd4,0x183));var _0x4ebd=function(_0x5675a8,_0x1f01e4){_0x5675a8=_0x5675a8-0x0;var _0x30a971=_0xebd4[_0x5675a8];return _0x30a971;};'use strict';var multer=require(_0x4ebd('0x0'));var util=require(_0x4ebd('0x1'));var path=require(_0x4ebd('0x2'));var timeout=require(_0x4ebd('0x3'));var express=require(_0x4ebd('0x4'));var router=express[_0x4ebd('0x5')]();var fs_extra=require(_0x4ebd('0x6'));var auth=require(_0x4ebd('0x7'));var interaction=require(_0x4ebd('0x8'));var config=require(_0x4ebd('0x9'));var controller=require(_0x4ebd('0xa'));router[_0x4ebd('0xb')]('/',auth[_0x4ebd('0xc')](),controller[_0x4ebd('0xd')]);router[_0x4ebd('0xb')]('/describe',auth[_0x4ebd('0xc')](),controller[_0x4ebd('0xe')]);router[_0x4ebd('0xb')](_0x4ebd('0xf'),auth[_0x4ebd('0xc')](),controller[_0x4ebd('0x10')]);router[_0x4ebd('0x11')]('/',auth[_0x4ebd('0xc')](),controller['create']);router[_0x4ebd('0x12')]('/:id',auth[_0x4ebd('0xc')](),controller['update']);router['delete'](_0x4ebd('0xf'),auth[_0x4ebd('0xc')](),controller[_0x4ebd('0x13')]);module[_0x4ebd('0x14')]=router; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.attributes.js b/server/api/mailQueueReport/mailQueueReport.attributes.js index 3b2b047..0b71b5e 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 _0x4a77=['sequelize','exports','STRING','DATE','moment'];(function(_0x5acea6,_0x37207e){var _0x119e86=function(_0x2567f1){while(--_0x2567f1){_0x5acea6['push'](_0x5acea6['shift']());}};_0x119e86(++_0x37207e);}(_0x4a77,0x1ee));var _0x74a7=function(_0x1e87e9,_0xedebe9){_0x1e87e9=_0x1e87e9-0x0;var _0x3e96de=_0x4a77[_0x1e87e9];return _0x3e96de;};'use strict';var moment=require(_0x74a7('0x0'));var Sequelize=require(_0x74a7('0x1'));module[_0x74a7('0x2')]={'uniqueid':{'type':Sequelize[_0x74a7('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x74a7('0x3')]},'joinAt':{'type':Sequelize[_0x74a7('0x4')]},'leaveAt':{'type':Sequelize[_0x74a7('0x4')]},'acceptAt':{'type':Sequelize[_0x74a7('0x4')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0x74a7('0x3')]}}; \ No newline at end of file +var _0x6347=['DATE','moment','sequelize','STRING'];(function(_0x1c6bda,_0x37533b){var _0x2be907=function(_0x5cc2d3){while(--_0x5cc2d3){_0x1c6bda['push'](_0x1c6bda['shift']());}};_0x2be907(++_0x37533b);}(_0x6347,0x1c9));var _0x7634=function(_0xc4cc7c,_0x403f4e){_0xc4cc7c=_0xc4cc7c-0x0;var _0x38fdc2=_0x6347[_0xc4cc7c];return _0x38fdc2;};'use strict';var moment=require(_0x7634('0x0'));var Sequelize=require(_0x7634('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0x7634('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x7634('0x2')]},'joinAt':{'type':Sequelize[_0x7634('0x3')]},'leaveAt':{'type':Sequelize[_0x7634('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x7634('0x3')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.controller.js b/server/api/mailQueueReport/mailQueueReport.controller.js index 06869ef..17601bd 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 _0xffd6=['rimraf','zip-dir','moment','bluebird','mustache','path','sox','to-csv','ejs','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/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','end','name','map','MailQueueReport','rawAttributes','fieldName','type','key','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','params','find','catch','create','body','describe','eml-format'];(function(_0x46800d,_0x588500){var _0x3824cd=function(_0x14b132){while(--_0x14b132){_0x46800d['push'](_0x46800d['shift']());}};_0x3824cd(++_0x588500);}(_0xffd6,0x97));var _0x6ffd=function(_0x2faddb,_0xc18b78){_0x2faddb=_0x2faddb-0x0;var _0x273c05=_0xffd6[_0x2faddb];return _0x273c05;};'use strict';var emlformat=require(_0x6ffd('0x0'));var rimraf=require(_0x6ffd('0x1'));var zipdir=require(_0x6ffd('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x6ffd('0x3'));var BPromise=require(_0x6ffd('0x4'));var Mustache=require(_0x6ffd('0x5'));var util=require('util');var path=require(_0x6ffd('0x6'));var sox=require(_0x6ffd('0x7'));var csv=require(_0x6ffd('0x8'));var ejs=require(_0x6ffd('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6ffd('0xa'));var squel=require(_0x6ffd('0xb'));var crypto=require(_0x6ffd('0xc'));var jsforce=require(_0x6ffd('0xd'));var deskjs=require(_0x6ffd('0xe'));var toCsv=require('to-csv');var querystring=require(_0x6ffd('0xf'));var Papa=require(_0x6ffd('0x10'));var Redis=require('ioredis');var authService=require(_0x6ffd('0x11'));var qs=require(_0x6ffd('0x12'));var as=require(_0x6ffd('0x13'));var hardwareService=require(_0x6ffd('0x14'));var logger=require(_0x6ffd('0x15'))(_0x6ffd('0x16'));var utils=require(_0x6ffd('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x6ffd('0x18'));var db=require(_0x6ffd('0x19'))['db'];function respondWithStatusCode(_0x5e8d6d,_0x2d0b63){_0x2d0b63=_0x2d0b63||0xcc;return function(_0x2ec8a5){if(_0x2ec8a5){return _0x5e8d6d[_0x6ffd('0x1a')](_0x2d0b63);}return _0x5e8d6d[_0x6ffd('0x1b')](_0x2d0b63)['end']();};}function respondWithResult(_0x259235,_0x594cb3){_0x594cb3=_0x594cb3||0xc8;return function(_0x468ecc){if(_0x468ecc){return _0x259235['status'](_0x594cb3)[_0x6ffd('0x1c')](_0x468ecc);}};}function respondWithFilteredResult(_0x261ed7,_0x45db49){return function(_0x5d8aff){if(_0x5d8aff){var _0x15fca6=typeof _0x45db49[_0x6ffd('0x1d')]===_0x6ffd('0x1e')&&typeof _0x45db49[_0x6ffd('0x1f')]===_0x6ffd('0x1e');var _0x19a772=_0x5d8aff[_0x6ffd('0x20')];var _0x889a4b=_0x15fca6?0x0:_0x45db49['offset'];var _0x11a609=_0x15fca6?_0x5d8aff['count']:_0x45db49['offset']+_0x45db49[_0x6ffd('0x1f')];var _0x359d09;if(_0x11a609>=_0x19a772){_0x11a609=_0x19a772;_0x359d09=0xc8;}else{_0x359d09=0xce;}_0x261ed7['status'](_0x359d09);return _0x261ed7[_0x6ffd('0x21')](_0x6ffd('0x22'),_0x889a4b+'-'+_0x11a609+'/'+_0x19a772)['json'](_0x5d8aff);}return null;};}function patchUpdates(_0x564a11){return function(_0x465971){try{jsonpatch[_0x6ffd('0x23')](_0x465971,_0x564a11,!![]);}catch(_0x4dcc50){return BPromise[_0x6ffd('0x24')](_0x4dcc50);}return _0x465971[_0x6ffd('0x25')]();};}function saveUpdates(_0x327fee,_0x53128a){return function(_0x3ba429){if(_0x3ba429){return _0x3ba429[_0x6ffd('0x26')](_0x327fee)['then'](function(_0x356c9c){return _0x356c9c;});}return null;};}function removeEntity(_0x438d1a,_0x50c19a){return function(_0x31fb22){if(_0x31fb22){return _0x31fb22[_0x6ffd('0x27')]()[_0x6ffd('0x28')](function(){_0x438d1a['status'](0xcc)[_0x6ffd('0x29')]();});}};}function handleEntityNotFound(_0x3e5726,_0x46b03f){return function(_0x4ae7ac){if(!_0x4ae7ac){_0x3e5726[_0x6ffd('0x1a')](0x194);}return _0x4ae7ac;};}function handleError(_0x5a55e2,_0x41ab4a){_0x41ab4a=_0x41ab4a||0x1f4;return function(_0x43269c){logger['error'](_0x43269c['stack']);if(_0x43269c[_0x6ffd('0x2a')]){delete _0x43269c[_0x6ffd('0x2a')];}_0x5a55e2[_0x6ffd('0x1b')](_0x41ab4a)['send'](_0x43269c);};}exports['index']=function(_0x32c399,_0x48feb4){var _0x470021={},_0x20c007={},_0x51fdb6={'count':0x0,'rows':[]};var _0x6b5aba=_[_0x6ffd('0x2b')](db[_0x6ffd('0x2c')][_0x6ffd('0x2d')],function(_0x235735){return{'name':_0x235735[_0x6ffd('0x2e')],'type':_0x235735[_0x6ffd('0x2f')][_0x6ffd('0x30')]};});_0x20c007[_0x6ffd('0x31')]=_[_0x6ffd('0x2b')](_0x6b5aba,_0x6ffd('0x2a'));_0x20c007[_0x6ffd('0x32')]=_[_0x6ffd('0x33')](_0x32c399['query']);_0x20c007['filters']=_['intersection'](_0x20c007[_0x6ffd('0x31')],_0x20c007[_0x6ffd('0x32')]);_0x470021[_0x6ffd('0x34')]=_[_0x6ffd('0x35')](_0x20c007[_0x6ffd('0x31')],qs[_0x6ffd('0x36')](_0x32c399[_0x6ffd('0x32')][_0x6ffd('0x36')]));_0x470021[_0x6ffd('0x34')]=_0x470021[_0x6ffd('0x34')][_0x6ffd('0x37')]?_0x470021[_0x6ffd('0x34')]:_0x20c007[_0x6ffd('0x31')];if(!_0x32c399['query'][_0x6ffd('0x38')](_0x6ffd('0x39'))){_0x470021[_0x6ffd('0x1f')]=qs[_0x6ffd('0x1f')](_0x32c399['query'][_0x6ffd('0x1f')]);_0x470021['offset']=qs['offset'](_0x32c399[_0x6ffd('0x32')][_0x6ffd('0x1d')]);}_0x470021[_0x6ffd('0x3a')]=qs[_0x6ffd('0x3b')](_0x32c399['query'][_0x6ffd('0x3b')]);_0x470021['where']=qs[_0x6ffd('0x3c')](_[_0x6ffd('0x3d')](_0x32c399[_0x6ffd('0x32')],_0x20c007[_0x6ffd('0x3c')]),_0x6b5aba);if(_0x32c399[_0x6ffd('0x32')]['filter']){_0x470021['where']=_[_0x6ffd('0x3e')](_0x470021['where'],{'$or':_[_0x6ffd('0x2b')](_0x6b5aba,function(_0x98bf46){if(_0x98bf46[_0x6ffd('0x2f')]!==_0x6ffd('0x3f')){var _0x6ee6f0={};_0x6ee6f0[_0x98bf46[_0x6ffd('0x2a')]]={'$like':'%'+_0x32c399['query'][_0x6ffd('0x40')]+'%'};return _0x6ee6f0;}})});}_0x470021=_[_0x6ffd('0x3e')]({},_0x470021,_0x32c399[_0x6ffd('0x41')]);var _0x3ad5ef={'where':_0x470021['where']};return db[_0x6ffd('0x2c')]['count'](_0x3ad5ef)[_0x6ffd('0x28')](function(_0x13b409){_0x51fdb6[_0x6ffd('0x20')]=_0x13b409;if(_0x32c399['query'][_0x6ffd('0x42')]){_0x470021[_0x6ffd('0x43')]=[{'all':!![]}];}return db[_0x6ffd('0x2c')][_0x6ffd('0x44')](_0x470021);})[_0x6ffd('0x28')](function(_0x2894f5){_0x51fdb6[_0x6ffd('0x45')]=_0x2894f5;return _0x51fdb6;})['then'](respondWithFilteredResult(_0x48feb4,_0x470021))['catch'](handleError(_0x48feb4,null));};exports['show']=function(_0x3bcac8,_0x162259){var _0x51ae8d={'raw':!![],'where':{'id':_0x3bcac8[_0x6ffd('0x46')]['id']}},_0x3d5193={};_0x3d5193[_0x6ffd('0x31')]=_[_0x6ffd('0x33')](db['MailQueueReport'][_0x6ffd('0x2d')]);_0x3d5193[_0x6ffd('0x32')]=_[_0x6ffd('0x33')](_0x3bcac8[_0x6ffd('0x32')]);_0x3d5193[_0x6ffd('0x3c')]=_[_0x6ffd('0x35')](_0x3d5193[_0x6ffd('0x31')],_0x3d5193[_0x6ffd('0x32')]);_0x51ae8d[_0x6ffd('0x34')]=_[_0x6ffd('0x35')](_0x3d5193[_0x6ffd('0x31')],qs['fields'](_0x3bcac8['query']['fields']));_0x51ae8d[_0x6ffd('0x34')]=_0x51ae8d[_0x6ffd('0x34')]['length']?_0x51ae8d[_0x6ffd('0x34')]:_0x3d5193[_0x6ffd('0x31')];if(_0x3bcac8[_0x6ffd('0x32')][_0x6ffd('0x42')]){_0x51ae8d[_0x6ffd('0x43')]=[{'all':!![]}];}_0x51ae8d=_['merge']({},_0x51ae8d,_0x3bcac8[_0x6ffd('0x41')]);return db[_0x6ffd('0x2c')][_0x6ffd('0x47')](_0x51ae8d)['then'](handleEntityNotFound(_0x162259,null))[_0x6ffd('0x28')](respondWithResult(_0x162259,null))[_0x6ffd('0x48')](handleError(_0x162259,null));};exports[_0x6ffd('0x49')]=function(_0xc513d4,_0x4184fe){return db[_0x6ffd('0x2c')]['create'](_0xc513d4[_0x6ffd('0x4a')],{})[_0x6ffd('0x28')](respondWithResult(_0x4184fe,0xc9))[_0x6ffd('0x48')](handleError(_0x4184fe,null));};exports[_0x6ffd('0x26')]=function(_0x43399c,_0x3d6221){if(_0x43399c[_0x6ffd('0x4a')]['id']){delete _0x43399c['body']['id'];}return db[_0x6ffd('0x2c')][_0x6ffd('0x47')]({'where':{'id':_0x43399c['params']['id']}})['then'](handleEntityNotFound(_0x3d6221,null))['then'](saveUpdates(_0x43399c[_0x6ffd('0x4a')],null))['then'](respondWithResult(_0x3d6221,null))[_0x6ffd('0x48')](handleError(_0x3d6221,null));};exports[_0x6ffd('0x27')]=function(_0x212578,_0x1fe3a4){return db['MailQueueReport'][_0x6ffd('0x47')]({'where':{'id':_0x212578[_0x6ffd('0x46')]['id']}})[_0x6ffd('0x28')](handleEntityNotFound(_0x1fe3a4,null))['then'](removeEntity(_0x1fe3a4,null))[_0x6ffd('0x48')](handleError(_0x1fe3a4,null));};exports[_0x6ffd('0x4b')]=function(_0x4aa024,_0x528284){return db[_0x6ffd('0x2c')][_0x6ffd('0x4b')]()[_0x6ffd('0x28')](respondWithResult(_0x528284,null))[_0x6ffd('0x48')](handleError(_0x528284,null));}; \ No newline at end of file +var _0xeb3b=['destroy','error','stack','name','send','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','MailQueueReport','rawAttributes','include','create','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','count','offset','limit','Content-Range','reject','save','then'];(function(_0x24552b,_0x111121){var _0x27b047=function(_0x4115bd){while(--_0x4115bd){_0x24552b['push'](_0x24552b['shift']());}};_0x27b047(++_0x111121);}(_0xeb3b,0x19e));var _0xbeb3=function(_0x3ba566,_0x5e009d){_0x3ba566=_0x3ba566-0x0;var _0x480317=_0xeb3b[_0x3ba566];return _0x480317;};'use strict';var emlformat=require(_0xbeb3('0x0'));var rimraf=require(_0xbeb3('0x1'));var zipdir=require(_0xbeb3('0x2'));var jsonpatch=require(_0xbeb3('0x3'));var rp=require(_0xbeb3('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xbeb3('0x5'));var util=require('util');var path=require(_0xbeb3('0x6'));var sox=require('sox');var csv=require(_0xbeb3('0x7'));var ejs=require(_0xbeb3('0x8'));var fs=require('fs');var fs_extra=require(_0xbeb3('0x9'));var _=require(_0xbeb3('0xa'));var squel=require(_0xbeb3('0xb'));var crypto=require(_0xbeb3('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xbeb3('0xd'));var toCsv=require(_0xbeb3('0x7'));var querystring=require(_0xbeb3('0xe'));var Papa=require(_0xbeb3('0xf'));var Redis=require(_0xbeb3('0x10'));var authService=require(_0xbeb3('0x11'));var qs=require(_0xbeb3('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbeb3('0x13'));var logger=require(_0xbeb3('0x14'))('api');var utils=require(_0xbeb3('0x15'));var config=require(_0xbeb3('0x16'));var licenseUtil=require(_0xbeb3('0x17'));var db=require(_0xbeb3('0x18'))['db'];function respondWithStatusCode(_0x19868e,_0x313296){_0x313296=_0x313296||0xcc;return function(_0x5b9ace){if(_0x5b9ace){return _0x19868e['sendStatus'](_0x313296);}return _0x19868e[_0xbeb3('0x19')](_0x313296)[_0xbeb3('0x1a')]();};}function respondWithResult(_0x5f521b,_0x4dfb28){_0x4dfb28=_0x4dfb28||0xc8;return function(_0xed9879){if(_0xed9879){return _0x5f521b[_0xbeb3('0x19')](_0x4dfb28)[_0xbeb3('0x1b')](_0xed9879);}};}function respondWithFilteredResult(_0x43d58a,_0x26daf2){return function(_0x535836){if(_0x535836){var _0x1aeaee=typeof _0x26daf2['offset']===_0xbeb3('0x1c')&&typeof _0x26daf2['limit']==='undefined';var _0x4f8481=_0x535836[_0xbeb3('0x1d')];var _0x44a4bb=_0x1aeaee?0x0:_0x26daf2[_0xbeb3('0x1e')];var _0x10b15d=_0x1aeaee?_0x535836['count']:_0x26daf2[_0xbeb3('0x1e')]+_0x26daf2[_0xbeb3('0x1f')];var _0xe2cc47;if(_0x10b15d>=_0x4f8481){_0x10b15d=_0x4f8481;_0xe2cc47=0xc8;}else{_0xe2cc47=0xce;}_0x43d58a['status'](_0xe2cc47);return _0x43d58a['set'](_0xbeb3('0x20'),_0x44a4bb+'-'+_0x10b15d+'/'+_0x4f8481)['json'](_0x535836);}return null;};}function patchUpdates(_0x1d917b){return function(_0x50b005){try{jsonpatch['apply'](_0x50b005,_0x1d917b,!![]);}catch(_0xfa2736){return BPromise[_0xbeb3('0x21')](_0xfa2736);}return _0x50b005[_0xbeb3('0x22')]();};}function saveUpdates(_0x4bd89e,_0x301899){return function(_0x18ea0f){if(_0x18ea0f){return _0x18ea0f['update'](_0x4bd89e)[_0xbeb3('0x23')](function(_0x366bdb){return _0x366bdb;});}return null;};}function removeEntity(_0x55a59d,_0xfc384a){return function(_0x278fe4){if(_0x278fe4){return _0x278fe4[_0xbeb3('0x24')]()[_0xbeb3('0x23')](function(){_0x55a59d[_0xbeb3('0x19')](0xcc)[_0xbeb3('0x1a')]();});}};}function handleEntityNotFound(_0x84921a,_0x340581){return function(_0x46fe17){if(!_0x46fe17){_0x84921a['sendStatus'](0x194);}return _0x46fe17;};}function handleError(_0x4e695e,_0x1f36b9){_0x1f36b9=_0x1f36b9||0x1f4;return function(_0x520116){logger[_0xbeb3('0x25')](_0x520116[_0xbeb3('0x26')]);if(_0x520116[_0xbeb3('0x27')]){delete _0x520116[_0xbeb3('0x27')];}_0x4e695e['status'](_0x1f36b9)[_0xbeb3('0x28')](_0x520116);};}exports['index']=function(_0x26cd8f,_0xab301c){var _0x5bd93d={},_0x483198={},_0x9b8f13={'count':0x0,'rows':[]};var _0x585c6f=_['map'](db['MailQueueReport']['rawAttributes'],function(_0xf5dbaf){return{'name':_0xf5dbaf['fieldName'],'type':_0xf5dbaf[_0xbeb3('0x29')][_0xbeb3('0x2a')]};});_0x483198[_0xbeb3('0x2b')]=_[_0xbeb3('0x2c')](_0x585c6f,_0xbeb3('0x27'));_0x483198[_0xbeb3('0x2d')]=_[_0xbeb3('0x2e')](_0x26cd8f[_0xbeb3('0x2d')]);_0x483198[_0xbeb3('0x2f')]=_[_0xbeb3('0x30')](_0x483198['model'],_0x483198[_0xbeb3('0x2d')]);_0x5bd93d[_0xbeb3('0x31')]=_['intersection'](_0x483198[_0xbeb3('0x2b')],qs[_0xbeb3('0x32')](_0x26cd8f[_0xbeb3('0x2d')][_0xbeb3('0x32')]));_0x5bd93d['attributes']=_0x5bd93d[_0xbeb3('0x31')][_0xbeb3('0x33')]?_0x5bd93d[_0xbeb3('0x31')]:_0x483198[_0xbeb3('0x2b')];if(!_0x26cd8f[_0xbeb3('0x2d')][_0xbeb3('0x34')](_0xbeb3('0x35'))){_0x5bd93d[_0xbeb3('0x1f')]=qs[_0xbeb3('0x1f')](_0x26cd8f['query'][_0xbeb3('0x1f')]);_0x5bd93d['offset']=qs[_0xbeb3('0x1e')](_0x26cd8f[_0xbeb3('0x2d')][_0xbeb3('0x1e')]);}_0x5bd93d[_0xbeb3('0x36')]=qs[_0xbeb3('0x37')](_0x26cd8f[_0xbeb3('0x2d')][_0xbeb3('0x37')]);_0x5bd93d[_0xbeb3('0x38')]=qs['filters'](_[_0xbeb3('0x39')](_0x26cd8f['query'],_0x483198['filters']),_0x585c6f);if(_0x26cd8f['query'][_0xbeb3('0x3a')]){_0x5bd93d[_0xbeb3('0x38')]=_[_0xbeb3('0x3b')](_0x5bd93d[_0xbeb3('0x38')],{'$or':_[_0xbeb3('0x2c')](_0x585c6f,function(_0x40f166){if(_0x40f166['type']!==_0xbeb3('0x3c')){var _0x40de8d={};_0x40de8d[_0x40f166[_0xbeb3('0x27')]]={'$like':'%'+_0x26cd8f['query']['filter']+'%'};return _0x40de8d;}})});}_0x5bd93d=_['merge']({},_0x5bd93d,_0x26cd8f[_0xbeb3('0x3d')]);var _0x2a8860={'where':_0x5bd93d[_0xbeb3('0x38')]};return db['MailQueueReport'][_0xbeb3('0x1d')](_0x2a8860)['then'](function(_0x1b6700){_0x9b8f13[_0xbeb3('0x1d')]=_0x1b6700;if(_0x26cd8f[_0xbeb3('0x2d')][_0xbeb3('0x3e')]){_0x5bd93d['include']=[{'all':!![]}];}return db['MailQueueReport'][_0xbeb3('0x3f')](_0x5bd93d);})[_0xbeb3('0x23')](function(_0x3d4262){_0x9b8f13[_0xbeb3('0x40')]=_0x3d4262;return _0x9b8f13;})[_0xbeb3('0x23')](respondWithFilteredResult(_0xab301c,_0x5bd93d))[_0xbeb3('0x41')](handleError(_0xab301c,null));};exports[_0xbeb3('0x42')]=function(_0x4606a6,_0x5758c6){var _0xfcb57f={'raw':!![],'where':{'id':_0x4606a6[_0xbeb3('0x43')]['id']}},_0x39f2d2={};_0x39f2d2[_0xbeb3('0x2b')]=_[_0xbeb3('0x2e')](db[_0xbeb3('0x44')][_0xbeb3('0x45')]);_0x39f2d2['query']=_[_0xbeb3('0x2e')](_0x4606a6[_0xbeb3('0x2d')]);_0x39f2d2[_0xbeb3('0x2f')]=_[_0xbeb3('0x30')](_0x39f2d2[_0xbeb3('0x2b')],_0x39f2d2[_0xbeb3('0x2d')]);_0xfcb57f[_0xbeb3('0x31')]=_[_0xbeb3('0x30')](_0x39f2d2[_0xbeb3('0x2b')],qs[_0xbeb3('0x32')](_0x4606a6[_0xbeb3('0x2d')][_0xbeb3('0x32')]));_0xfcb57f[_0xbeb3('0x31')]=_0xfcb57f['attributes'][_0xbeb3('0x33')]?_0xfcb57f[_0xbeb3('0x31')]:_0x39f2d2[_0xbeb3('0x2b')];if(_0x4606a6['query']['includeAll']){_0xfcb57f[_0xbeb3('0x46')]=[{'all':!![]}];}_0xfcb57f=_[_0xbeb3('0x3b')]({},_0xfcb57f,_0x4606a6[_0xbeb3('0x3d')]);return db[_0xbeb3('0x44')]['find'](_0xfcb57f)[_0xbeb3('0x23')](handleEntityNotFound(_0x5758c6,null))['then'](respondWithResult(_0x5758c6,null))['catch'](handleError(_0x5758c6,null));};exports[_0xbeb3('0x47')]=function(_0x393e60,_0x1ff297){return db[_0xbeb3('0x44')]['create'](_0x393e60[_0xbeb3('0x48')],{})[_0xbeb3('0x23')](respondWithResult(_0x1ff297,0xc9))[_0xbeb3('0x41')](handleError(_0x1ff297,null));};exports['update']=function(_0x3f93ab,_0x58c49f){if(_0x3f93ab['body']['id']){delete _0x3f93ab[_0xbeb3('0x48')]['id'];}return db[_0xbeb3('0x44')][_0xbeb3('0x49')]({'where':{'id':_0x3f93ab['params']['id']}})[_0xbeb3('0x23')](handleEntityNotFound(_0x58c49f,null))[_0xbeb3('0x23')](saveUpdates(_0x3f93ab[_0xbeb3('0x48')],null))['then'](respondWithResult(_0x58c49f,null))[_0xbeb3('0x41')](handleError(_0x58c49f,null));};exports['destroy']=function(_0x39605b,_0x4d8e21){return db[_0xbeb3('0x44')][_0xbeb3('0x49')]({'where':{'id':_0x39605b[_0xbeb3('0x43')]['id']}})[_0xbeb3('0x23')](handleEntityNotFound(_0x4d8e21,null))[_0xbeb3('0x23')](removeEntity(_0x4d8e21,null))[_0xbeb3('0x41')](handleError(_0x4d8e21,null));};exports[_0xbeb3('0x4a')]=function(_0x168434,_0x49fded){return db[_0xbeb3('0x44')][_0xbeb3('0x4a')]()[_0xbeb3('0x23')](respondWithResult(_0x49fded,null))[_0xbeb3('0x41')](handleError(_0x49fded,null));}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.model.js b/server/api/mailQueueReport/mailQueueReport.model.js index ac1e245..e4542f0 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 _0x3b57=['path','rimraf','../../config/environment','MailQueueReport','report_mail_queue','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x45bb45,_0xa342f2){var _0x423467=function(_0xc2e746){while(--_0xc2e746){_0x45bb45['push'](_0x45bb45['shift']());}};_0x423467(++_0xa342f2);}(_0x3b57,0x199));var _0x73b5=function(_0xc0d9bc,_0x2bd6be){_0xc0d9bc=_0xc0d9bc-0x0;var _0x32ff73=_0x3b57[_0xc0d9bc];return _0x32ff73;};'use strict';var _=require(_0x73b5('0x0'));var util=require(_0x73b5('0x1'));var logger=require(_0x73b5('0x2'))(_0x73b5('0x3'));var moment=require(_0x73b5('0x4'));var BPromise=require(_0x73b5('0x5'));var rp=require(_0x73b5('0x6'));var fs=require('fs');var path=require(_0x73b5('0x7'));var rimraf=require(_0x73b5('0x8'));var config=require(_0x73b5('0x9'));var attributes=require('./mailQueueReport.attributes');module['exports']=function(_0x5b8d80,_0x3452b5){return _0x5b8d80['define'](_0x73b5('0xa'),attributes,{'tableName':_0x73b5('0xb'),'paranoid':![],'indexes':[{'name':_0x73b5('0xc'),'fields':[_0x73b5('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xa42e=['moment','bluebird','../../config/environment','./mailQueueReport.attributes','exports','MailQueueReport','report_mail_queue','uniqueid','lodash','util','../../config/logger','api'];(function(_0x3b0c9d,_0x3ddeb5){var _0xcfc8d7=function(_0x320dc6){while(--_0x320dc6){_0x3b0c9d['push'](_0x3b0c9d['shift']());}};_0xcfc8d7(++_0x3ddeb5);}(_0xa42e,0xec));var _0xea42=function(_0x56aa2f,_0x2f393c){_0x56aa2f=_0x56aa2f-0x0;var _0xed420e=_0xa42e[_0x56aa2f];return _0xed420e;};'use strict';var _=require(_0xea42('0x0'));var util=require(_0xea42('0x1'));var logger=require(_0xea42('0x2'))(_0xea42('0x3'));var moment=require(_0xea42('0x4'));var BPromise=require(_0xea42('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xea42('0x6'));var attributes=require(_0xea42('0x7'));module[_0xea42('0x8')]=function(_0x83ff00,_0x327b04){return _0x83ff00['define'](_0xea42('0x9'),attributes,{'tableName':_0xea42('0xa'),'paranoid':![],'indexes':[{'name':_0xea42('0xb'),'fields':[_0xea42('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.rpc.js b/server/api/mailQueueReport/mailQueueReport.rpc.js index f6cab3e..9a21c7f 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 _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(_0x29e204,_0xab8ddb){var _0x34a786=function(_0x14aaf2){while(--_0x14aaf2){_0x29e204['push'](_0x29e204['shift']());}};_0x34a786(++_0xab8ddb);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x422905,_0x3bce3a){_0x422905=_0x422905-0x0;var _0x33dc6c=_0xc4aa[_0x422905];return _0x33dc6c;};'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 +var _0xdb28=['UpdateMailQueueReport','MailQueueReport','update','raw','where','limit','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','MailQueueReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','CreateMailQueueReport','create','body','options'];(function(_0x4f66,_0x4c4a2e){var _0x4e3d42=function(_0xcbd4b0){while(--_0xcbd4b0){_0x4f66['push'](_0x4f66['shift']());}};_0x4e3d42(++_0x4c4a2e);}(_0xdb28,0x106));var _0x8db2=function(_0x120913,_0xc94fe9){_0x120913=_0x120913-0x0;var _0x488f97=_0xdb28[_0x120913];return _0x488f97;};'use strict';var _=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var moment=require(_0x8db2('0x2'));var BPromise=require(_0x8db2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8db2('0x4'));var db=require(_0x8db2('0x5'))['db'];var utils=require(_0x8db2('0x6'));var logger=require(_0x8db2('0x7'))(_0x8db2('0x8'));var config=require('../../config/environment');var jayson=require(_0x8db2('0x9'));var client=jayson[_0x8db2('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x494b40,_0x477f50,_0x46932f){return new BPromise(function(_0x131537,_0x29f698){return client[_0x8db2('0xb')](_0x494b40,_0x46932f)[_0x8db2('0xc')](function(_0x126c78){logger['info'](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));logger[_0x8db2('0xf')]('MailQueueReport,\x20%s,\x20%s,\x20%s',_0x477f50,_0x8db2('0xe'),JSON[_0x8db2('0x10')](_0x126c78));if(_0x126c78['error']){if(_0x126c78[_0x8db2('0x11')][_0x8db2('0x12')]===0x1f4){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')]['message']);return _0x29f698(_0x126c78['error'][_0x8db2('0x13')]);}logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);return _0x131537(_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);}else{logger[_0x8db2('0x14')](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));_0x131537(_0x126c78['result'][_0x8db2('0x13')]);}})[_0x8db2('0x15')](function(_0x48101e){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x48101e);_0x29f698(_0x48101e);});});}exports[_0x8db2('0x16')]=function(_0x3fddc2){var _0x2efd06=this;return new Promise(function(_0x46ce14,_0x51d60d){return db['MailQueueReport'][_0x8db2('0x17')](_0x3fddc2[_0x8db2('0x18')],{'raw':_0x3fddc2[_0x8db2('0x19')]?_0x3fddc2[_0x8db2('0x19')]['raw']===undefined?!![]:![]:!![]})[_0x8db2('0xc')](function(_0x36a9ff){logger[_0x8db2('0x14')](_0x8db2('0x16'),_0x3fddc2);logger[_0x8db2('0xf')]('CreateMailQueueReport',_0x3fddc2,JSON[_0x8db2('0x10')](_0x36a9ff));_0x46ce14(_0x36a9ff);})[_0x8db2('0x15')](function(_0x18f69c){logger[_0x8db2('0x11')](_0x8db2('0x16'),_0x18f69c[_0x8db2('0x13')],_0x3fddc2);_0x51d60d(_0x2efd06[_0x8db2('0x11')](0x1f4,_0x18f69c['message']));});});};exports[_0x8db2('0x1a')]=function(_0x4f6516){var _0x5725f0=this;return new Promise(function(_0x52a9ca,_0x4d923c){return db[_0x8db2('0x1b')][_0x8db2('0x1c')](_0x4f6516[_0x8db2('0x18')],{'raw':_0x4f6516[_0x8db2('0x19')]?_0x4f6516[_0x8db2('0x19')][_0x8db2('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4f6516['options']?_0x4f6516[_0x8db2('0x19')][_0x8db2('0x1e')]||null:null,'attributes':_0x4f6516[_0x8db2('0x19')]?_0x4f6516[_0x8db2('0x19')]['attributes']||null:null,'limit':_0x4f6516[_0x8db2('0x19')]?_0x4f6516[_0x8db2('0x19')][_0x8db2('0x1f')]||null:null})[_0x8db2('0xc')](function(_0xbe5ece){logger[_0x8db2('0x14')](_0x8db2('0x1a'),_0x4f6516);logger[_0x8db2('0xf')](_0x8db2('0x1a'),_0x4f6516,JSON['stringify'](_0xbe5ece));_0x52a9ca(_0xbe5ece);})[_0x8db2('0x15')](function(_0x50b28d){logger['error'](_0x8db2('0x1a'),_0x50b28d[_0x8db2('0x13')],_0x4f6516);_0x4d923c(_0x5725f0[_0x8db2('0x11')](0x1f4,_0x50b28d['message']));});});}; \ No newline at end of file diff --git a/server/api/mailServerIn/index.js b/server/api/mailServerIn/index.js index 9eeb6b2..c3349f7 100644 --- a/server/api/mailServerIn/index.js +++ b/server/api/mailServerIn/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x274a7e,_0x410deb){var _0x4aba98=function(_0x4d32f1){while(--_0x4d32f1){_0x274a7e['push'](_0x274a7e['shift']());}};_0x4aba98(++_0x410deb);}(_0x70e0,0x17b));var _0x070e=function(_0x339a97,_0x353a8c){_0x339a97=_0x339a97-0x0;var _0x3fcd34=_0x70e0[_0x339a97];return _0x3fcd34;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file +var _0xedd9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','exports'];(function(_0x19a065,_0x57bf4f){var _0x5623db=function(_0x1058eb){while(--_0x1058eb){_0x19a065['push'](_0x19a065['shift']());}};_0x5623db(++_0x57bf4f);}(_0xedd9,0xfc));var _0x9edd=function(_0x1fd511,_0x19f6e7){_0x1fd511=_0x1fd511-0x0;var _0x157b48=_0xedd9[_0x1fd511];return _0x157b48;};'use strict';var multer=require('multer');var util=require(_0x9edd('0x0'));var path=require(_0x9edd('0x1'));var timeout=require(_0x9edd('0x2'));var express=require(_0x9edd('0x3'));var router=express[_0x9edd('0x4')]();var fs_extra=require(_0x9edd('0x5'));var auth=require(_0x9edd('0x6'));var interaction=require(_0x9edd('0x7'));var config=require('../../config/environment');module[_0x9edd('0x8')]=router; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.attributes.js b/server/api/mailServerIn/mailServerIn.attributes.js index aa04983..e0009e1 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 _0x0cbb=['exports','STRING','BOOLEAN','INBOX','INTEGER','sequelize'];(function(_0x4f84f7,_0x21a8ba){var _0x46060c=function(_0x2d9479){while(--_0x2d9479){_0x4f84f7['push'](_0x4f84f7['shift']());}};_0x46060c(++_0x21a8ba);}(_0x0cbb,0x1c7));var _0xb0cb=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0cbb[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xb0cb('0x0'));module[_0xb0cb('0x1')]={'description':{'type':Sequelize[_0xb0cb('0x2')]},'host':{'type':Sequelize['STRING']},'authentication':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'user':{'type':Sequelize[_0xb0cb('0x2')]},'password':{'type':Sequelize[_0xb0cb('0x2')]},'port':{'type':Sequelize['INTEGER']},'tls':{'type':Sequelize[_0xb0cb('0x3')],'defaultValue':!![]},'mailbox':{'type':Sequelize['STRING'],'defaultValue':_0xb0cb('0x4')},'connTimeout':{'type':Sequelize[_0xb0cb('0x5')],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0xb0cb('0x5')],'defaultValue':0x5},'service':{'type':Sequelize[_0xb0cb('0x2')]},'modernAuthentication':{'type':Sequelize[_0xb0cb('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0x5467=['BOOLEAN','INBOX','exports','STRING','INTEGER'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x5467,0x1ab));var _0x7546=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x5467[_0x3b380d];return _0x54502b;};'use strict';var Sequelize=require('sequelize');module[_0x7546('0x0')]={'description':{'type':Sequelize[_0x7546('0x1')]},'host':{'type':Sequelize[_0x7546('0x1')]},'authentication':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'user':{'type':Sequelize[_0x7546('0x1')]},'password':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0x7546('0x2')]},'tls':{'type':Sequelize[_0x7546('0x3')],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0x7546('0x1')],'defaultValue':_0x7546('0x4')},'connTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0xa},'authTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'service':{'type':Sequelize[_0x7546('0x1')]},'modernAuthentication':{'type':Sequelize[_0x7546('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 a12bdf6..ce9b034 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 _0x6ff0=['util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','exports','MailServerIn','mail_servers_in','lodash'];(function(_0x334cf7,_0x36dfc0){var _0x1aa671=function(_0xdf10ad){while(--_0xdf10ad){_0x334cf7['push'](_0x334cf7['shift']());}};_0x1aa671(++_0x36dfc0);}(_0x6ff0,0xfb));var _0x06ff=function(_0x3bc329,_0x51de4e){_0x3bc329=_0x3bc329-0x0;var _0x372a3a=_0x6ff0[_0x3bc329];return _0x372a3a;};'use strict';var _=require(_0x06ff('0x0'));var util=require(_0x06ff('0x1'));var logger=require(_0x06ff('0x2'))(_0x06ff('0x3'));var moment=require(_0x06ff('0x4'));var BPromise=require(_0x06ff('0x5'));var rp=require(_0x06ff('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x06ff('0x7'));var config=require(_0x06ff('0x8'));var attributes=require('./mailServerIn.attributes');module[_0x06ff('0x9')]=function(_0x5d0f04,_0x3cbaef){return _0x5d0f04['define'](_0x06ff('0xa'),attributes,{'tableName':_0x06ff('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5fcc=['util','../../config/logger','moment','bluebird','path','./mailServerIn.attributes','exports','define','MailServerIn'];(function(_0x451681,_0x5136f9){var _0x5d08c0=function(_0x34653e){while(--_0x34653e){_0x451681['push'](_0x451681['shift']());}};_0x5d08c0(++_0x5136f9);}(_0x5fcc,0x144));var _0xc5fc=function(_0x38bd4b,_0x144508){_0x38bd4b=_0x38bd4b-0x0;var _0x27e5c3=_0x5fcc[_0x38bd4b];return _0x27e5c3;};'use strict';var _=require('lodash');var util=require(_0xc5fc('0x0'));var logger=require(_0xc5fc('0x1'))('api');var moment=require(_0xc5fc('0x2'));var BPromise=require(_0xc5fc('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc5fc('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xc5fc('0x5'));module[_0xc5fc('0x6')]=function(_0x4d418f,_0x495d0a){return _0x4d418f[_0xc5fc('0x7')](_0xc5fc('0x8'),attributes,{'tableName':'mail_servers_in','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.rpc.js b/server/api/mailServerIn/mailServerIn.rpc.js index f0a806c..deb57c3 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 _0xb406=['include','map','model','then','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','info','MailServerIn,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','catch','GetMailServerIn','findAll','options','raw','where','attributes','limit'];(function(_0x2dff3a,_0x2eb66b){var _0xa8c71=function(_0x2adff1){while(--_0x2adff1){_0x2dff3a['push'](_0x2dff3a['shift']());}};_0xa8c71(++_0x2eb66b);}(_0xb406,0x10c));var _0x6b40=function(_0x2283fc,_0xa206f9){_0x2283fc=_0x2283fc-0x0;var _0x4e6f2c=_0xb406[_0x2283fc];return _0x4e6f2c;};'use strict';var _=require(_0x6b40('0x0'));var util=require(_0x6b40('0x1'));var moment=require(_0x6b40('0x2'));var BPromise=require(_0x6b40('0x3'));var rs=require(_0x6b40('0x4'));var fs=require('fs');var Redis=require(_0x6b40('0x5'));var db=require(_0x6b40('0x6'))['db'];var utils=require(_0x6b40('0x7'));var logger=require(_0x6b40('0x8'))(_0x6b40('0x9'));var config=require('../../config/environment');var jayson=require(_0x6b40('0xa'));var client=jayson[_0x6b40('0xb')][_0x6b40('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1f623a,_0x5d6040,_0x5c6df7){return new BPromise(function(_0xdbc4bc,_0x152bb0){return client[_0x6b40('0xd')](_0x1f623a,_0x5c6df7)['then'](function(_0x15fdca){logger[_0x6b40('0xe')](_0x6b40('0xf'),_0x5d6040,_0x6b40('0x10'));logger[_0x6b40('0x11')]('MailServerIn,\x20%s,\x20%s,\x20%s',_0x5d6040,_0x6b40('0x10'),JSON[_0x6b40('0x12')](_0x15fdca));if(_0x15fdca[_0x6b40('0x13')]){if(_0x15fdca[_0x6b40('0x13')]['code']===0x1f4){logger[_0x6b40('0x13')](_0x6b40('0xf'),_0x5d6040,_0x15fdca[_0x6b40('0x13')][_0x6b40('0x14')]);return _0x152bb0(_0x15fdca[_0x6b40('0x13')][_0x6b40('0x14')]);}logger[_0x6b40('0x13')]('MailServerIn,\x20%s,\x20%s',_0x5d6040,_0x15fdca[_0x6b40('0x13')]['message']);return _0xdbc4bc(_0x15fdca[_0x6b40('0x13')][_0x6b40('0x14')]);}else{logger['info'](_0x6b40('0xf'),_0x5d6040,_0x6b40('0x10'));_0xdbc4bc(_0x15fdca['result']['message']);}})[_0x6b40('0x15')](function(_0xfa7c56){logger[_0x6b40('0x13')](_0x6b40('0xf'),_0x5d6040,_0xfa7c56);_0x152bb0(_0xfa7c56);});});}exports[_0x6b40('0x16')]=function(_0x1b7c3d){var _0x131803=this;return new Promise(function(_0x147f8d,_0x1a4e74){return db['MailServerIn'][_0x6b40('0x17')]({'raw':_0x1b7c3d[_0x6b40('0x18')]?_0x1b7c3d[_0x6b40('0x18')][_0x6b40('0x19')]===undefined?!![]:![]:!![],'where':_0x1b7c3d[_0x6b40('0x18')]?_0x1b7c3d[_0x6b40('0x18')][_0x6b40('0x1a')]||null:null,'attributes':_0x1b7c3d[_0x6b40('0x18')]?_0x1b7c3d[_0x6b40('0x18')][_0x6b40('0x1b')]||null:null,'limit':_0x1b7c3d[_0x6b40('0x18')]?_0x1b7c3d[_0x6b40('0x18')][_0x6b40('0x1c')]||null:null,'include':_0x1b7c3d[_0x6b40('0x18')]?_0x1b7c3d[_0x6b40('0x18')][_0x6b40('0x1d')]?_[_0x6b40('0x1e')](_0x1b7c3d[_0x6b40('0x18')][_0x6b40('0x1d')],function(_0x179f60){return{'model':db[_0x179f60[_0x6b40('0x1f')]],'as':_0x179f60['as'],'attributes':_0x179f60[_0x6b40('0x1b')],'include':_0x179f60['include']?_[_0x6b40('0x1e')](_0x179f60[_0x6b40('0x1d')],function(_0xb30dc4){return{'model':db[_0xb30dc4[_0x6b40('0x1f')]],'as':_0xb30dc4['as'],'attributes':_0xb30dc4[_0x6b40('0x1b')],'include':_0xb30dc4[_0x6b40('0x1d')]?_[_0x6b40('0x1e')](_0xb30dc4['include'],function(_0x2d762b){return{'model':db[_0x2d762b[_0x6b40('0x1f')]],'as':_0x2d762b['as'],'attributes':_0x2d762b['attributes']};}):[]};}):[]};}):[]:[]})[_0x6b40('0x20')](function(_0x2cde19){logger[_0x6b40('0xe')](_0x6b40('0x16'),_0x1b7c3d);logger[_0x6b40('0x11')](_0x6b40('0x16'),_0x1b7c3d,JSON[_0x6b40('0x12')](_0x2cde19));_0x147f8d(_0x2cde19);})[_0x6b40('0x15')](function(_0x147d4b){logger[_0x6b40('0x13')](_0x6b40('0x16'),_0x147d4b[_0x6b40('0x14')],_0x1b7c3d);_0x1a4e74(_0x131803[_0x6b40('0x13')](0x1f4,_0x147d4b[_0x6b40('0x14')]));});});}; \ No newline at end of file +var _0x0079=['request','info','MailServerIn,\x20%s,\x20%s','request\x20sent','MailServerIn,\x20%s,\x20%s,\x20%s','error','code','message','result','GetMailServerIn','MailServerIn','findAll','options','raw','attributes','include','map','then','debug','stringify','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x1b4b23,_0x5dd6d6){var _0x2a325b=function(_0x175462){while(--_0x175462){_0x1b4b23['push'](_0x1b4b23['shift']());}};_0x2a325b(++_0x5dd6d6);}(_0x0079,0x74));var _0x9007=function(_0xa3c92a,_0x579557){_0xa3c92a=_0xa3c92a-0x0;var _0x52ee92=_0x0079[_0xa3c92a];return _0x52ee92;};'use strict';var _=require('lodash');var util=require(_0x9007('0x0'));var moment=require(_0x9007('0x1'));var BPromise=require(_0x9007('0x2'));var rs=require(_0x9007('0x3'));var fs=require('fs');var Redis=require(_0x9007('0x4'));var db=require(_0x9007('0x5'))['db'];var utils=require(_0x9007('0x6'));var logger=require(_0x9007('0x7'))(_0x9007('0x8'));var config=require(_0x9007('0x9'));var jayson=require(_0x9007('0xa'));var client=jayson[_0x9007('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5eb1cd,_0x3151d7,_0x4c6a73){return new BPromise(function(_0x414fea,_0x3afd38){return client[_0x9007('0xc')](_0x5eb1cd,_0x4c6a73)['then'](function(_0x556a35){logger[_0x9007('0xd')](_0x9007('0xe'),_0x3151d7,_0x9007('0xf'));logger['debug'](_0x9007('0x10'),_0x3151d7,'request\x20sent',JSON['stringify'](_0x556a35));if(_0x556a35[_0x9007('0x11')]){if(_0x556a35[_0x9007('0x11')][_0x9007('0x12')]===0x1f4){logger[_0x9007('0x11')](_0x9007('0xe'),_0x3151d7,_0x556a35[_0x9007('0x11')][_0x9007('0x13')]);return _0x3afd38(_0x556a35[_0x9007('0x11')][_0x9007('0x13')]);}logger[_0x9007('0x11')]('MailServerIn,\x20%s,\x20%s',_0x3151d7,_0x556a35[_0x9007('0x11')][_0x9007('0x13')]);return _0x414fea(_0x556a35[_0x9007('0x11')][_0x9007('0x13')]);}else{logger['info']('MailServerIn,\x20%s,\x20%s',_0x3151d7,_0x9007('0xf'));_0x414fea(_0x556a35[_0x9007('0x14')][_0x9007('0x13')]);}})['catch'](function(_0x32d632){logger[_0x9007('0x11')](_0x9007('0xe'),_0x3151d7,_0x32d632);_0x3afd38(_0x32d632);});});}exports[_0x9007('0x15')]=function(_0x522a8f){var _0x1e2458=this;return new Promise(function(_0x12366f,_0x2eaea3){return db[_0x9007('0x16')][_0x9007('0x17')]({'raw':_0x522a8f[_0x9007('0x18')]?_0x522a8f[_0x9007('0x18')][_0x9007('0x19')]===undefined?!![]:![]:!![],'where':_0x522a8f[_0x9007('0x18')]?_0x522a8f[_0x9007('0x18')]['where']||null:null,'attributes':_0x522a8f['options']?_0x522a8f[_0x9007('0x18')][_0x9007('0x1a')]||null:null,'limit':_0x522a8f[_0x9007('0x18')]?_0x522a8f[_0x9007('0x18')]['limit']||null:null,'include':_0x522a8f['options']?_0x522a8f[_0x9007('0x18')][_0x9007('0x1b')]?_[_0x9007('0x1c')](_0x522a8f[_0x9007('0x18')][_0x9007('0x1b')],function(_0x10acca){return{'model':db[_0x10acca['model']],'as':_0x10acca['as'],'attributes':_0x10acca[_0x9007('0x1a')],'include':_0x10acca['include']?_[_0x9007('0x1c')](_0x10acca['include'],function(_0x236cb3){return{'model':db[_0x236cb3['model']],'as':_0x236cb3['as'],'attributes':_0x236cb3[_0x9007('0x1a')],'include':_0x236cb3[_0x9007('0x1b')]?_[_0x9007('0x1c')](_0x236cb3['include'],function(_0xac44fa){return{'model':db[_0xac44fa['model']],'as':_0xac44fa['as'],'attributes':_0xac44fa[_0x9007('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x9007('0x1d')](function(_0x546726){logger[_0x9007('0xd')](_0x9007('0x15'),_0x522a8f);logger[_0x9007('0x1e')](_0x9007('0x15'),_0x522a8f,JSON[_0x9007('0x1f')](_0x546726));_0x12366f(_0x546726);})['catch'](function(_0x46e474){logger[_0x9007('0x11')](_0x9007('0x15'),_0x46e474[_0x9007('0x13')],_0x522a8f);_0x2eaea3(_0x1e2458[_0x9007('0x11')](0x1f4,_0x46e474[_0x9007('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/mailServerOut/index.js b/server/api/mailServerOut/index.js index 7a33a0e..b300dff 100644 --- a/server/api/mailServerOut/index.js +++ b/server/api/mailServerOut/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./mailServerOut.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports'];(function(_0xc6be3a,_0x540e05){var _0x56a310=function(_0x50a144){while(--_0x50a144){_0xc6be3a['push'](_0xc6be3a['shift']());}};_0x56a310(++_0x540e05);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0xe')]('/',auth['isAuthenticated'](),controller[_0x7995('0xf')]);router[_0x7995('0x10')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router[_0x7995('0x12')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0x13')]);module[_0x7995('0x14')]=router; \ No newline at end of file +var _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(_0x40ac5e,_0x2de228){var _0x2839d6=function(_0x123d47){while(--_0x123d47){_0x40ac5e['push'](_0x40ac5e['shift']());}};_0x2839d6(++_0x2de228);}(_0x7a54,0x106));var _0x47a5=function(_0x3f6d05,_0x338373){_0x3f6d05=_0x3f6d05-0x0;var _0x2eaa1a=_0x7a54[_0x3f6d05];return _0x2eaa1a;};'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 495a484..094fde5 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 _0x0713=['BOOLEAN','STRING','INTEGER'];(function(_0x5a2370,_0x4893c6){var _0x4123d9=function(_0x173b0e){while(--_0x173b0e){_0x5a2370['push'](_0x5a2370['shift']());}};_0x4123d9(++_0x4893c6);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module['exports']={'description':{'type':Sequelize[_0x3071('0x0')]},'host':{'type':Sequelize[_0x3071('0x0')]},'user':{'type':Sequelize[_0x3071('0x0')]},'pass':{'type':Sequelize[_0x3071('0x0')]},'port':{'type':Sequelize[_0x3071('0x1')]},'secure':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'service':{'type':Sequelize[_0x3071('0x0')]},'authentication':{'type':Sequelize[_0x3071('0x2')],'defaultValue':!![]},'modernAuthentication':{'type':Sequelize[_0x3071('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0xae60=['sequelize','exports','STRING','INTEGER','BOOLEAN'];(function(_0x3a0473,_0x3a13c2){var _0x1fecab=function(_0x43eec9){while(--_0x43eec9){_0x3a0473['push'](_0x3a0473['shift']());}};_0x1fecab(++_0x3a13c2);}(_0xae60,0x1c7));var _0x0ae6=function(_0x4fbfd9,_0x3ab91a){_0x4fbfd9=_0x4fbfd9-0x0;var _0x31dc94=_0xae60[_0x4fbfd9];return _0x31dc94;};'use strict';var Sequelize=require(_0x0ae6('0x0'));module[_0x0ae6('0x1')]={'description':{'type':Sequelize[_0x0ae6('0x2')]},'host':{'type':Sequelize['STRING']},'user':{'type':Sequelize[_0x0ae6('0x2')]},'pass':{'type':Sequelize[_0x0ae6('0x2')]},'port':{'type':Sequelize[_0x0ae6('0x3')]},'secure':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'service':{'type':Sequelize[_0x0ae6('0x2')]},'authentication':{'type':Sequelize[_0x0ae6('0x4')],'defaultValue':!![]},'modernAuthentication':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.controller.js b/server/api/mailServerOut/mailServerOut.controller.js index c644e10..d3e3d79 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 _0xd5c8=['moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/utils','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','end','error','name','send','index','map','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','order','sort','where','pick','merge','type','VIRTUAL','filter','options','includeAll','include','catch','MailServerOut','find','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise'];(function(_0x26cfe0,_0x200ce5){var _0x2cbf0c=function(_0x4501eb){while(--_0x4501eb){_0x26cfe0['push'](_0x26cfe0['shift']());}};_0x2cbf0c(++_0x200ce5);}(_0xd5c8,0xd6));var _0x8d5c=function(_0x190ff6,_0x515cfd){_0x190ff6=_0x190ff6-0x0;var _0x5356d2=_0xd5c8[_0x190ff6];return _0x5356d2;};'use strict';var emlformat=require(_0x8d5c('0x0'));var rimraf=require(_0x8d5c('0x1'));var zipdir=require(_0x8d5c('0x2'));var jsonpatch=require(_0x8d5c('0x3'));var rp=require(_0x8d5c('0x4'));var moment=require(_0x8d5c('0x5'));var BPromise=require(_0x8d5c('0x6'));var Mustache=require(_0x8d5c('0x7'));var util=require(_0x8d5c('0x8'));var path=require('path');var sox=require(_0x8d5c('0x9'));var csv=require(_0x8d5c('0xa'));var ejs=require(_0x8d5c('0xb'));var fs=require('fs');var fs_extra=require(_0x8d5c('0xc'));var _=require(_0x8d5c('0xd'));var squel=require(_0x8d5c('0xe'));var crypto=require(_0x8d5c('0xf'));var jsforce=require(_0x8d5c('0x10'));var deskjs=require(_0x8d5c('0x11'));var toCsv=require('to-csv');var querystring=require(_0x8d5c('0x12'));var Papa=require(_0x8d5c('0x13'));var Redis=require(_0x8d5c('0x14'));var authService=require(_0x8d5c('0x15'));var qs=require('../../components/parsers/qs');var as=require(_0x8d5c('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x8d5c('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x8d5c('0x18'))['db'];function respondWithStatusCode(_0x51befe,_0x1a48d7){_0x1a48d7=_0x1a48d7||0xcc;return function(_0x1aebc2){if(_0x1aebc2){return _0x51befe[_0x8d5c('0x19')](_0x1a48d7);}return _0x51befe['status'](_0x1a48d7)['end']();};}function respondWithResult(_0x44894a,_0xc250d7){_0xc250d7=_0xc250d7||0xc8;return function(_0x4f7f38){if(_0x4f7f38){return _0x44894a[_0x8d5c('0x1a')](_0xc250d7)[_0x8d5c('0x1b')](_0x4f7f38);}};}function respondWithFilteredResult(_0x3dbbc8,_0x4d5d1e){return function(_0x302327){if(_0x302327){var _0xb5c3f9=typeof _0x4d5d1e[_0x8d5c('0x1c')]===_0x8d5c('0x1d')&&typeof _0x4d5d1e[_0x8d5c('0x1e')]===_0x8d5c('0x1d');var _0x37ebdb=_0x302327[_0x8d5c('0x1f')];var _0x1476b3=_0xb5c3f9?0x0:_0x4d5d1e[_0x8d5c('0x1c')];var _0x53b981=_0xb5c3f9?_0x302327[_0x8d5c('0x1f')]:_0x4d5d1e[_0x8d5c('0x1c')]+_0x4d5d1e[_0x8d5c('0x1e')];var _0x299b01;if(_0x53b981>=_0x37ebdb){_0x53b981=_0x37ebdb;_0x299b01=0xc8;}else{_0x299b01=0xce;}_0x3dbbc8[_0x8d5c('0x1a')](_0x299b01);return _0x3dbbc8[_0x8d5c('0x20')](_0x8d5c('0x21'),_0x1476b3+'-'+_0x53b981+'/'+_0x37ebdb)[_0x8d5c('0x1b')](_0x302327);}return null;};}function patchUpdates(_0x1c2198){return function(_0x25d9d9){try{jsonpatch[_0x8d5c('0x22')](_0x25d9d9,_0x1c2198,!![]);}catch(_0x1e9288){return BPromise[_0x8d5c('0x23')](_0x1e9288);}return _0x25d9d9['save']();};}function saveUpdates(_0x38ed35,_0x573dee){return function(_0x4b08ab){if(_0x4b08ab){return _0x4b08ab[_0x8d5c('0x24')](_0x38ed35)[_0x8d5c('0x25')](function(_0x204b17){return _0x204b17;});}return null;};}function removeEntity(_0x1ae0d8,_0xc6df63){return function(_0x247457){if(_0x247457){return _0x247457[_0x8d5c('0x26')]()[_0x8d5c('0x25')](function(){_0x1ae0d8[_0x8d5c('0x1a')](0xcc)[_0x8d5c('0x27')]();});}};}function handleEntityNotFound(_0x71785d,_0x7abed3){return function(_0x5d51a3){if(!_0x5d51a3){_0x71785d[_0x8d5c('0x19')](0x194);}return _0x5d51a3;};}function handleError(_0x225ec8,_0x16830d){_0x16830d=_0x16830d||0x1f4;return function(_0x5671c0){logger[_0x8d5c('0x28')](_0x5671c0['stack']);if(_0x5671c0[_0x8d5c('0x29')]){delete _0x5671c0[_0x8d5c('0x29')];}_0x225ec8['status'](_0x16830d)[_0x8d5c('0x2a')](_0x5671c0);};}exports[_0x8d5c('0x2b')]=function(_0x436e49,_0x223d5c){var _0x1ceba2={},_0x4bf868={},_0x54970e={'count':0x0,'rows':[]};var _0x1b726f=_[_0x8d5c('0x2c')](db['MailServerOut'][_0x8d5c('0x2d')],function(_0x1902c7){return{'name':_0x1902c7[_0x8d5c('0x2e')],'type':_0x1902c7['type'][_0x8d5c('0x2f')]};});_0x4bf868[_0x8d5c('0x30')]=_[_0x8d5c('0x2c')](_0x1b726f,_0x8d5c('0x29'));_0x4bf868[_0x8d5c('0x31')]=_[_0x8d5c('0x32')](_0x436e49[_0x8d5c('0x31')]);_0x4bf868[_0x8d5c('0x33')]=_[_0x8d5c('0x34')](_0x4bf868[_0x8d5c('0x30')],_0x4bf868[_0x8d5c('0x31')]);_0x1ceba2[_0x8d5c('0x35')]=_[_0x8d5c('0x34')](_0x4bf868[_0x8d5c('0x30')],qs[_0x8d5c('0x36')](_0x436e49[_0x8d5c('0x31')][_0x8d5c('0x36')]));_0x1ceba2[_0x8d5c('0x35')]=_0x1ceba2['attributes'][_0x8d5c('0x37')]?_0x1ceba2[_0x8d5c('0x35')]:_0x4bf868[_0x8d5c('0x30')];if(!_0x436e49[_0x8d5c('0x31')]['hasOwnProperty']('nolimit')){_0x1ceba2['limit']=qs[_0x8d5c('0x1e')](_0x436e49[_0x8d5c('0x31')]['limit']);_0x1ceba2['offset']=qs[_0x8d5c('0x1c')](_0x436e49[_0x8d5c('0x31')]['offset']);}_0x1ceba2[_0x8d5c('0x38')]=qs[_0x8d5c('0x39')](_0x436e49[_0x8d5c('0x31')]['sort']);_0x1ceba2[_0x8d5c('0x3a')]=qs[_0x8d5c('0x33')](_[_0x8d5c('0x3b')](_0x436e49[_0x8d5c('0x31')],_0x4bf868[_0x8d5c('0x33')]),_0x1b726f);if(_0x436e49['query']['filter']){_0x1ceba2['where']=_[_0x8d5c('0x3c')](_0x1ceba2[_0x8d5c('0x3a')],{'$or':_[_0x8d5c('0x2c')](_0x1b726f,function(_0x2ab36c){if(_0x2ab36c[_0x8d5c('0x3d')]!==_0x8d5c('0x3e')){var _0x5d5e4e={};_0x5d5e4e[_0x2ab36c[_0x8d5c('0x29')]]={'$like':'%'+_0x436e49['query'][_0x8d5c('0x3f')]+'%'};return _0x5d5e4e;}})});}_0x1ceba2=_[_0x8d5c('0x3c')]({},_0x1ceba2,_0x436e49[_0x8d5c('0x40')]);var _0x1d5e96={'where':_0x1ceba2[_0x8d5c('0x3a')]};return db['MailServerOut'][_0x8d5c('0x1f')](_0x1d5e96)[_0x8d5c('0x25')](function(_0x68240d){_0x54970e[_0x8d5c('0x1f')]=_0x68240d;if(_0x436e49[_0x8d5c('0x31')][_0x8d5c('0x41')]){_0x1ceba2[_0x8d5c('0x42')]=[{'all':!![]}];}return db['MailServerOut']['findAll'](_0x1ceba2);})[_0x8d5c('0x25')](function(_0x451839){_0x54970e['rows']=_0x451839;return _0x54970e;})[_0x8d5c('0x25')](respondWithFilteredResult(_0x223d5c,_0x1ceba2))[_0x8d5c('0x43')](handleError(_0x223d5c,null));};exports['show']=function(_0x1cc503,_0x469b46){var _0x120a83={'raw':!![],'where':{'id':_0x1cc503['params']['id']}},_0x33d892={};_0x33d892[_0x8d5c('0x30')]=_[_0x8d5c('0x32')](db[_0x8d5c('0x44')][_0x8d5c('0x2d')]);_0x33d892[_0x8d5c('0x31')]=_['keys'](_0x1cc503[_0x8d5c('0x31')]);_0x33d892['filters']=_[_0x8d5c('0x34')](_0x33d892['model'],_0x33d892[_0x8d5c('0x31')]);_0x120a83[_0x8d5c('0x35')]=_[_0x8d5c('0x34')](_0x33d892['model'],qs[_0x8d5c('0x36')](_0x1cc503[_0x8d5c('0x31')][_0x8d5c('0x36')]));_0x120a83[_0x8d5c('0x35')]=_0x120a83[_0x8d5c('0x35')][_0x8d5c('0x37')]?_0x120a83[_0x8d5c('0x35')]:_0x33d892[_0x8d5c('0x30')];if(_0x1cc503['query']['includeAll']){_0x120a83[_0x8d5c('0x42')]=[{'all':!![]}];}_0x120a83=_[_0x8d5c('0x3c')]({},_0x120a83,_0x1cc503[_0x8d5c('0x40')]);return db[_0x8d5c('0x44')][_0x8d5c('0x45')](_0x120a83)[_0x8d5c('0x25')](handleEntityNotFound(_0x469b46,null))[_0x8d5c('0x25')](respondWithResult(_0x469b46,null))[_0x8d5c('0x43')](handleError(_0x469b46,null));};exports[_0x8d5c('0x46')]=function(_0x2f8d82,_0x4966bc){return db[_0x8d5c('0x44')][_0x8d5c('0x46')](_0x2f8d82[_0x8d5c('0x47')],{})[_0x8d5c('0x25')](respondWithResult(_0x4966bc,0xc9))[_0x8d5c('0x43')](handleError(_0x4966bc,null));};exports[_0x8d5c('0x24')]=function(_0x2af308,_0x3fc434){if(_0x2af308[_0x8d5c('0x47')]['id']){delete _0x2af308['body']['id'];}return db[_0x8d5c('0x44')]['find']({'where':{'id':_0x2af308['params']['id']}})[_0x8d5c('0x25')](handleEntityNotFound(_0x3fc434,null))['then'](saveUpdates(_0x2af308[_0x8d5c('0x47')],null))[_0x8d5c('0x25')](respondWithResult(_0x3fc434,null))['catch'](handleError(_0x3fc434,null));};exports['destroy']=function(_0xe8a59a,_0x219227){return db['MailServerOut']['find']({'where':{'id':_0xe8a59a[_0x8d5c('0x48')]['id']}})[_0x8d5c('0x25')](handleEntityNotFound(_0x219227,null))['then'](removeEntity(_0x219227,null))['catch'](handleError(_0x219227,null));}; \ No newline at end of file +var _0x440e=['MailServerOut','key','model','query','filters','attributes','intersection','fields','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','catch','params','keys','rawAttributes','find','create','body','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','save','update','then','destroy','error','stack','name','index','map'];(function(_0x20589d,_0x55d5bf){var _0x422de9=function(_0x44cbbb){while(--_0x44cbbb){_0x20589d['push'](_0x20589d['shift']());}};_0x422de9(++_0x55d5bf);}(_0x440e,0x189));var _0xe440=function(_0x2044ba,_0x1ebab8){_0x2044ba=_0x2044ba-0x0;var _0x2fa276=_0x440e[_0x2044ba];return _0x2fa276;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xe440('0x0'));var rp=require(_0xe440('0x1'));var moment=require(_0xe440('0x2'));var BPromise=require(_0xe440('0x3'));var Mustache=require(_0xe440('0x4'));var util=require(_0xe440('0x5'));var path=require(_0xe440('0x6'));var sox=require(_0xe440('0x7'));var csv=require(_0xe440('0x8'));var ejs=require(_0xe440('0x9'));var fs=require('fs');var fs_extra=require(_0xe440('0xa'));var _=require(_0xe440('0xb'));var squel=require('squel');var crypto=require(_0xe440('0xc'));var jsforce=require(_0xe440('0xd'));var deskjs=require(_0xe440('0xe'));var toCsv=require(_0xe440('0x8'));var querystring=require(_0xe440('0xf'));var Papa=require('papaparse');var Redis=require(_0xe440('0x10'));var authService=require(_0xe440('0x11'));var qs=require(_0xe440('0x12'));var as=require(_0xe440('0x13'));var hardwareService=require(_0xe440('0x14'));var logger=require(_0xe440('0x15'))('api');var utils=require(_0xe440('0x16'));var config=require(_0xe440('0x17'));var licenseUtil=require(_0xe440('0x18'));var db=require(_0xe440('0x19'))['db'];function respondWithStatusCode(_0x29df2d,_0x2b30d4){_0x2b30d4=_0x2b30d4||0xcc;return function(_0x329b38){if(_0x329b38){return _0x29df2d[_0xe440('0x1a')](_0x2b30d4);}return _0x29df2d[_0xe440('0x1b')](_0x2b30d4)[_0xe440('0x1c')]();};}function respondWithResult(_0x3291c9,_0x47ef3a){_0x47ef3a=_0x47ef3a||0xc8;return function(_0xb471c0){if(_0xb471c0){return _0x3291c9[_0xe440('0x1b')](_0x47ef3a)[_0xe440('0x1d')](_0xb471c0);}};}function respondWithFilteredResult(_0x48f24a,_0x441c0b){return function(_0x102ae7){if(_0x102ae7){var _0x5e8407=typeof _0x441c0b[_0xe440('0x1e')]===_0xe440('0x1f')&&typeof _0x441c0b[_0xe440('0x20')]==='undefined';var _0x447319=_0x102ae7[_0xe440('0x21')];var _0xe4fc12=_0x5e8407?0x0:_0x441c0b['offset'];var _0x2c1c7e=_0x5e8407?_0x102ae7[_0xe440('0x21')]:_0x441c0b[_0xe440('0x1e')]+_0x441c0b[_0xe440('0x20')];var _0x521fa0;if(_0x2c1c7e>=_0x447319){_0x2c1c7e=_0x447319;_0x521fa0=0xc8;}else{_0x521fa0=0xce;}_0x48f24a[_0xe440('0x1b')](_0x521fa0);return _0x48f24a['set'](_0xe440('0x22'),_0xe4fc12+'-'+_0x2c1c7e+'/'+_0x447319)[_0xe440('0x1d')](_0x102ae7);}return null;};}function patchUpdates(_0x4549dc){return function(_0x29345a){try{jsonpatch[_0xe440('0x23')](_0x29345a,_0x4549dc,!![]);}catch(_0x336e7c){return BPromise['reject'](_0x336e7c);}return _0x29345a[_0xe440('0x24')]();};}function saveUpdates(_0x5a09a3,_0x241e03){return function(_0xa0ab11){if(_0xa0ab11){return _0xa0ab11[_0xe440('0x25')](_0x5a09a3)[_0xe440('0x26')](function(_0x403101){return _0x403101;});}return null;};}function removeEntity(_0x37e340,_0x2df78f){return function(_0x3f13a6){if(_0x3f13a6){return _0x3f13a6[_0xe440('0x27')]()[_0xe440('0x26')](function(){_0x37e340[_0xe440('0x1b')](0xcc)[_0xe440('0x1c')]();});}};}function handleEntityNotFound(_0x1ede2e,_0x26a918){return function(_0x33151d){if(!_0x33151d){_0x1ede2e[_0xe440('0x1a')](0x194);}return _0x33151d;};}function handleError(_0x99d0a0,_0x32d663){_0x32d663=_0x32d663||0x1f4;return function(_0x561a14){logger[_0xe440('0x28')](_0x561a14[_0xe440('0x29')]);if(_0x561a14[_0xe440('0x2a')]){delete _0x561a14['name'];}_0x99d0a0[_0xe440('0x1b')](_0x32d663)['send'](_0x561a14);};}exports[_0xe440('0x2b')]=function(_0x5df0ec,_0x4a1838){var _0x5d1119={},_0x2d1a24={},_0x58c8a3={'count':0x0,'rows':[]};var _0x53a46f=_[_0xe440('0x2c')](db[_0xe440('0x2d')]['rawAttributes'],function(_0x4c043b){return{'name':_0x4c043b['fieldName'],'type':_0x4c043b['type'][_0xe440('0x2e')]};});_0x2d1a24[_0xe440('0x2f')]=_['map'](_0x53a46f,_0xe440('0x2a'));_0x2d1a24[_0xe440('0x30')]=_['keys'](_0x5df0ec['query']);_0x2d1a24[_0xe440('0x31')]=_['intersection'](_0x2d1a24[_0xe440('0x2f')],_0x2d1a24[_0xe440('0x30')]);_0x5d1119[_0xe440('0x32')]=_[_0xe440('0x33')](_0x2d1a24['model'],qs[_0xe440('0x34')](_0x5df0ec[_0xe440('0x30')]['fields']));_0x5d1119['attributes']=_0x5d1119['attributes']['length']?_0x5d1119[_0xe440('0x32')]:_0x2d1a24['model'];if(!_0x5df0ec[_0xe440('0x30')]['hasOwnProperty'](_0xe440('0x35'))){_0x5d1119[_0xe440('0x20')]=qs['limit'](_0x5df0ec[_0xe440('0x30')][_0xe440('0x20')]);_0x5d1119[_0xe440('0x1e')]=qs[_0xe440('0x1e')](_0x5df0ec[_0xe440('0x30')][_0xe440('0x1e')]);}_0x5d1119[_0xe440('0x36')]=qs[_0xe440('0x37')](_0x5df0ec[_0xe440('0x30')][_0xe440('0x37')]);_0x5d1119[_0xe440('0x38')]=qs[_0xe440('0x31')](_[_0xe440('0x39')](_0x5df0ec[_0xe440('0x30')],_0x2d1a24[_0xe440('0x31')]),_0x53a46f);if(_0x5df0ec[_0xe440('0x30')][_0xe440('0x3a')]){_0x5d1119[_0xe440('0x38')]=_[_0xe440('0x3b')](_0x5d1119['where'],{'$or':_[_0xe440('0x2c')](_0x53a46f,function(_0xbcb135){if(_0xbcb135[_0xe440('0x3c')]!==_0xe440('0x3d')){var _0x18e780={};_0x18e780[_0xbcb135['name']]={'$like':'%'+_0x5df0ec[_0xe440('0x30')][_0xe440('0x3a')]+'%'};return _0x18e780;}})});}_0x5d1119=_[_0xe440('0x3b')]({},_0x5d1119,_0x5df0ec[_0xe440('0x3e')]);var _0x262649={'where':_0x5d1119[_0xe440('0x38')]};return db[_0xe440('0x2d')][_0xe440('0x21')](_0x262649)[_0xe440('0x26')](function(_0x312b92){_0x58c8a3['count']=_0x312b92;if(_0x5df0ec[_0xe440('0x30')][_0xe440('0x3f')]){_0x5d1119[_0xe440('0x40')]=[{'all':!![]}];}return db[_0xe440('0x2d')][_0xe440('0x41')](_0x5d1119);})[_0xe440('0x26')](function(_0xf99184){_0x58c8a3['rows']=_0xf99184;return _0x58c8a3;})[_0xe440('0x26')](respondWithFilteredResult(_0x4a1838,_0x5d1119))[_0xe440('0x42')](handleError(_0x4a1838,null));};exports['show']=function(_0x3a438f,_0xd92e56){var _0x3e8695={'raw':!![],'where':{'id':_0x3a438f[_0xe440('0x43')]['id']}},_0x2182b2={};_0x2182b2['model']=_[_0xe440('0x44')](db['MailServerOut'][_0xe440('0x45')]);_0x2182b2[_0xe440('0x30')]=_[_0xe440('0x44')](_0x3a438f['query']);_0x2182b2['filters']=_[_0xe440('0x33')](_0x2182b2[_0xe440('0x2f')],_0x2182b2[_0xe440('0x30')]);_0x3e8695['attributes']=_[_0xe440('0x33')](_0x2182b2[_0xe440('0x2f')],qs[_0xe440('0x34')](_0x3a438f[_0xe440('0x30')][_0xe440('0x34')]));_0x3e8695[_0xe440('0x32')]=_0x3e8695[_0xe440('0x32')]['length']?_0x3e8695[_0xe440('0x32')]:_0x2182b2[_0xe440('0x2f')];if(_0x3a438f[_0xe440('0x30')][_0xe440('0x3f')]){_0x3e8695[_0xe440('0x40')]=[{'all':!![]}];}_0x3e8695=_[_0xe440('0x3b')]({},_0x3e8695,_0x3a438f['options']);return db[_0xe440('0x2d')][_0xe440('0x46')](_0x3e8695)[_0xe440('0x26')](handleEntityNotFound(_0xd92e56,null))[_0xe440('0x26')](respondWithResult(_0xd92e56,null))[_0xe440('0x42')](handleError(_0xd92e56,null));};exports[_0xe440('0x47')]=function(_0x1a42c2,_0x34536c){return db[_0xe440('0x2d')]['create'](_0x1a42c2[_0xe440('0x48')],{})[_0xe440('0x26')](respondWithResult(_0x34536c,0xc9))[_0xe440('0x42')](handleError(_0x34536c,null));};exports[_0xe440('0x25')]=function(_0x1ff0b4,_0x3c5651){if(_0x1ff0b4[_0xe440('0x48')]['id']){delete _0x1ff0b4[_0xe440('0x48')]['id'];}return db['MailServerOut']['find']({'where':{'id':_0x1ff0b4[_0xe440('0x43')]['id']}})[_0xe440('0x26')](handleEntityNotFound(_0x3c5651,null))[_0xe440('0x26')](saveUpdates(_0x1ff0b4[_0xe440('0x48')],null))['then'](respondWithResult(_0x3c5651,null))[_0xe440('0x42')](handleError(_0x3c5651,null));};exports['destroy']=function(_0x31bd6a,_0x2ba8fe){return db['MailServerOut'][_0xe440('0x46')]({'where':{'id':_0x31bd6a[_0xe440('0x43')]['id']}})['then'](handleEntityNotFound(_0x2ba8fe,null))[_0xe440('0x26')](removeEntity(_0x2ba8fe,null))[_0xe440('0x42')](handleError(_0x2ba8fe,null));}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.model.js b/server/api/mailServerOut/mailServerOut.model.js index 9774291..a8e66a4 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 _0x26d0=['moment','bluebird','request-promise','path','rimraf','./mailServerOut.attributes','define','MailServerOut','mail_servers_out','lodash','../../config/logger'];(function(_0x41e47a,_0xd8d57d){var _0x4463d4=function(_0x4debdd){while(--_0x4debdd){_0x41e47a['push'](_0x41e47a['shift']());}};_0x4463d4(++_0xd8d57d);}(_0x26d0,0x169));var _0x026d=function(_0x528dcf,_0x154f32){_0x528dcf=_0x528dcf-0x0;var _0x10cd44=_0x26d0[_0x528dcf];return _0x10cd44;};'use strict';var _=require(_0x026d('0x0'));var util=require('util');var logger=require(_0x026d('0x1'))('api');var moment=require(_0x026d('0x2'));var BPromise=require(_0x026d('0x3'));var rp=require(_0x026d('0x4'));var fs=require('fs');var path=require(_0x026d('0x5'));var rimraf=require(_0x026d('0x6'));var config=require('../../config/environment');var attributes=require(_0x026d('0x7'));module['exports']=function(_0x48b244,_0x3cb9aa){return _0x48b244[_0x026d('0x8')](_0x026d('0x9'),attributes,{'tableName':_0x026d('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfde8=['./mailServerOut.attributes','exports','MailServerOut','mail_servers_out','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x5b5b46,_0x5d3359){var _0x18c135=function(_0x9ec44c){while(--_0x9ec44c){_0x5b5b46['push'](_0x5b5b46['shift']());}};_0x18c135(++_0x5d3359);}(_0xfde8,0x143));var _0x8fde=function(_0x27322d,_0x7cfe0){_0x27322d=_0x27322d-0x0;var _0x2bf1e7=_0xfde8[_0x27322d];return _0x2bf1e7;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x8fde('0x0'))(_0x8fde('0x1'));var moment=require(_0x8fde('0x2'));var BPromise=require(_0x8fde('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8fde('0x4'));var rimraf=require(_0x8fde('0x5'));var config=require(_0x8fde('0x6'));var attributes=require(_0x8fde('0x7'));module[_0x8fde('0x8')]=function(_0x345978,_0x48c790){return _0x345978['define'](_0x8fde('0x9'),attributes,{'tableName':_0x8fde('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.rpc.js b/server/api/mailServerOut/mailServerOut.rpc.js index 3a84c27..7e613f4 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 _0xc4aa=['moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','MailServerOut,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','catch','lodash','util'];(function(_0x3f3d42,_0x1d414c){var _0x4702b1=function(_0x12a1c2){while(--_0x12a1c2){_0x3f3d42['push'](_0x3f3d42['shift']());}};_0x4702b1(++_0x1d414c);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x2d2c16,_0x4e88b6){_0x2d2c16=_0x2d2c16-0x0;var _0x53f2fb=_0xc4aa[_0x2d2c16];return _0x53f2fb;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var moment=require(_0xac4a('0x2'));var BPromise=require(_0xac4a('0x3'));var rs=require(_0xac4a('0x4'));var fs=require('fs');var Redis=require(_0xac4a('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xac4a('0x6'));var config=require(_0xac4a('0x7'));var jayson=require(_0xac4a('0x8'));var client=jayson[_0xac4a('0x9')][_0xac4a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x15cd34,_0x3ef77c,_0x10525b){return new BPromise(function(_0x5c6179,_0x5b8339){return client[_0xac4a('0xb')](_0x15cd34,_0x10525b)[_0xac4a('0xc')](function(_0x26ec84){logger['info'](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));logger[_0xac4a('0xf')]('MailServerOut,\x20%s,\x20%s,\x20%s',_0x3ef77c,_0xac4a('0xe'),JSON['stringify'](_0x26ec84));if(_0x26ec84[_0xac4a('0x10')]){if(_0x26ec84['error'][_0xac4a('0x11')]===0x1f4){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84['error'][_0xac4a('0x12')]);return _0x5b8339(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);return _0x5c6179(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}else{logger[_0xac4a('0x13')](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));_0x5c6179(_0x26ec84['result'][_0xac4a('0x12')]);}})[_0xac4a('0x14')](function(_0x23eb66){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x23eb66);_0x5b8339(_0x23eb66);});});} \ No newline at end of file +var _0xdb28=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','MailServerOut,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','lodash','util'];(function(_0xfe1ce4,_0x21caee){var _0xc13876=function(_0x489e76){while(--_0x489e76){_0xfe1ce4['push'](_0xfe1ce4['shift']());}};_0xc13876(++_0x21caee);}(_0xdb28,0x106));var _0x8db2=function(_0x4b3a2c,_0x5968d9){_0x4b3a2c=_0x4b3a2c-0x0;var _0x1ebe34=_0xdb28[_0x4b3a2c];return _0x1ebe34;};'use strict';var _=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var moment=require(_0x8db2('0x2'));var BPromise=require(_0x8db2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8db2('0x4'));var db=require(_0x8db2('0x5'))['db'];var utils=require(_0x8db2('0x6'));var logger=require(_0x8db2('0x7'))(_0x8db2('0x8'));var config=require('../../config/environment');var jayson=require(_0x8db2('0x9'));var client=jayson[_0x8db2('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x494b40,_0x477f50,_0x46932f){return new BPromise(function(_0x131537,_0x29f698){return client[_0x8db2('0xb')](_0x494b40,_0x46932f)[_0x8db2('0xc')](function(_0x126c78){logger['info'](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));logger[_0x8db2('0xf')]('MailServerOut,\x20%s,\x20%s,\x20%s',_0x477f50,_0x8db2('0xe'),JSON[_0x8db2('0x10')](_0x126c78));if(_0x126c78['error']){if(_0x126c78[_0x8db2('0x11')][_0x8db2('0x12')]===0x1f4){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')]['message']);return _0x29f698(_0x126c78['error'][_0x8db2('0x13')]);}logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);return _0x131537(_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);}else{logger[_0x8db2('0x14')](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));_0x131537(_0x126c78['result'][_0x8db2('0x13')]);}})[_0x8db2('0x15')](function(_0x48101e){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x48101e);_0x29f698(_0x48101e);});});} \ No newline at end of file diff --git a/server/api/mailSubstatus/index.js b/server/api/mailSubstatus/index.js index f6581dc..39c27db 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 _0x8678=['update','delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailSubstatus.controller','get','isAuthenticated','/describe','describe','/:id','show','post'];(function(_0x3ce3c,_0x319337){var _0x55a2c9=function(_0x1568d0){while(--_0x1568d0){_0x3ce3c['push'](_0x3ce3c['shift']());}};_0x55a2c9(++_0x319337);}(_0x8678,0x1d0));var _0x8867=function(_0x13a4fc,_0x3c793a){_0x13a4fc=_0x13a4fc-0x0;var _0x4bee70=_0x8678[_0x13a4fc];return _0x4bee70;};'use strict';var multer=require('multer');var util=require(_0x8867('0x0'));var path=require(_0x8867('0x1'));var timeout=require(_0x8867('0x2'));var express=require(_0x8867('0x3'));var router=express[_0x8867('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x8867('0x5'));var interaction=require(_0x8867('0x6'));var config=require(_0x8867('0x7'));var controller=require(_0x8867('0x8'));router[_0x8867('0x9')]('/',auth[_0x8867('0xa')](),controller['index']);router[_0x8867('0x9')](_0x8867('0xb'),auth[_0x8867('0xa')](),controller[_0x8867('0xc')]);router[_0x8867('0x9')](_0x8867('0xd'),auth[_0x8867('0xa')](),controller[_0x8867('0xe')]);router[_0x8867('0xf')]('/',auth[_0x8867('0xa')](),controller['create']);router['put'](_0x8867('0xd'),auth['isAuthenticated'](),controller[_0x8867('0x10')]);router[_0x8867('0x11')](_0x8867('0xd'),auth['isAuthenticated'](),controller[_0x8867('0x12')]);module[_0x8867('0x13')]=router; \ No newline at end of file +var _0xdc39=['destroy','exports','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','create','put'];(function(_0x29d915,_0x54a040){var _0x160f86=function(_0x237dfa){while(--_0x237dfa){_0x29d915['push'](_0x29d915['shift']());}};_0x160f86(++_0x54a040);}(_0xdc39,0xf0));var _0x9dc3=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xdc39[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x9dc3('0x0'));var timeout=require('connect-timeout');var express=require(_0x9dc3('0x1'));var router=express[_0x9dc3('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x9dc3('0x3'));var interaction=require(_0x9dc3('0x4'));var config=require(_0x9dc3('0x5'));var controller=require('./mailSubstatus.controller');router[_0x9dc3('0x6')]('/',auth[_0x9dc3('0x7')](),controller[_0x9dc3('0x8')]);router[_0x9dc3('0x6')](_0x9dc3('0x9'),auth[_0x9dc3('0x7')](),controller[_0x9dc3('0xa')]);router[_0x9dc3('0x6')](_0x9dc3('0xb'),auth[_0x9dc3('0x7')](),controller[_0x9dc3('0xc')]);router['post']('/',auth['isAuthenticated'](),controller[_0x9dc3('0xd')]);router[_0x9dc3('0xe')]('/:id',auth[_0x9dc3('0x7')](),controller['update']);router['delete']('/:id',auth[_0x9dc3('0x7')](),controller[_0x9dc3('0xf')]);module[_0x9dc3('0x10')]=router; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.attributes.js b/server/api/mailSubstatus/mailSubstatus.attributes.js index 2f07a22..827ab43 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 _0x81c6=['exports'];(function(_0x47e7cb,_0x4c1b8d){var _0x2a8874=function(_0x36498f){while(--_0x36498f){_0x47e7cb['push'](_0x47e7cb['shift']());}};_0x2a8874(++_0x4c1b8d);}(_0x81c6,0x1d5));var _0x681c=function(_0xbaf699,_0x4aa945){_0xbaf699=_0xbaf699-0x0;var _0x55a131=_0x81c6[_0xbaf699];return _0x55a131;};'use strict';var Sequelize=require('sequelize');module[_0x681c('0x0')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x49c1=['STRING','name','sequelize'];(function(_0x25408e,_0x457e2d){var _0xd3099d=function(_0x44fe35){while(--_0x44fe35){_0x25408e['push'](_0x25408e['shift']());}};_0xd3099d(++_0x457e2d);}(_0x49c1,0xef));var _0x149c=function(_0x3a5dd3,_0x19b042){_0x3a5dd3=_0x3a5dd3-0x0;var _0x557206=_0x49c1[_0x3a5dd3];return _0x557206;};'use strict';var Sequelize=require(_0x149c('0x0'));module['exports']={'name':{'type':Sequelize[_0x149c('0x1')],'unique':_0x149c('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x149c('0x1')]}}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.controller.js b/server/api/mailSubstatus/mailSubstatus.controller.js index da8e42b..6cfe24c 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 _0xd6ce=['findAll','rows','catch','params','includeAll','create','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','update','then','error','stack','name','status','MailSubstatus','rawAttributes','fieldName','type','key','model','map','query','keys','filters','attributes','intersection','fields','length','nolimit','order','sort','where','pick','VIRTUAL','filter','merge','options'];(function(_0x57d1c8,_0xa86256){var _0x9343e6=function(_0xe385c8){while(--_0xe385c8){_0x57d1c8['push'](_0x57d1c8['shift']());}};_0x9343e6(++_0xa86256);}(_0xd6ce,0xf9));var _0xed6c=function(_0x1751c9,_0x267daa){_0x1751c9=_0x1751c9-0x0;var _0x3587e6=_0xd6ce[_0x1751c9];return _0x3587e6;};'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(_0xed6c('0x8'));var path=require(_0xed6c('0x9'));var sox=require(_0xed6c('0xa'));var csv=require('to-csv');var ejs=require(_0xed6c('0xb'));var fs=require('fs');var fs_extra=require(_0xed6c('0xc'));var _=require(_0xed6c('0xd'));var squel=require('squel');var crypto=require(_0xed6c('0xe'));var jsforce=require(_0xed6c('0xf'));var deskjs=require(_0xed6c('0x10'));var toCsv=require(_0xed6c('0x11'));var querystring=require(_0xed6c('0x12'));var Papa=require(_0xed6c('0x13'));var Redis=require(_0xed6c('0x14'));var authService=require(_0xed6c('0x15'));var qs=require(_0xed6c('0x16'));var as=require(_0xed6c('0x17'));var hardwareService=require(_0xed6c('0x18'));var logger=require(_0xed6c('0x19'))(_0xed6c('0x1a'));var utils=require(_0xed6c('0x1b'));var config=require(_0xed6c('0x1c'));var licenseUtil=require(_0xed6c('0x1d'));var db=require(_0xed6c('0x1e'))['db'];function respondWithStatusCode(_0x1ea4b8,_0x3acce8){_0x3acce8=_0x3acce8||0xcc;return function(_0x582544){if(_0x582544){return _0x1ea4b8[_0xed6c('0x1f')](_0x3acce8);}return _0x1ea4b8['status'](_0x3acce8)[_0xed6c('0x20')]();};}function respondWithResult(_0x4bed22,_0x478b44){_0x478b44=_0x478b44||0xc8;return function(_0x3040a2){if(_0x3040a2){return _0x4bed22['status'](_0x478b44)[_0xed6c('0x21')](_0x3040a2);}};}function respondWithFilteredResult(_0x3d493e,_0x373364){return function(_0x3dad99){if(_0x3dad99){var _0x3c079f=typeof _0x373364[_0xed6c('0x22')]===_0xed6c('0x23')&&typeof _0x373364['limit']===_0xed6c('0x23');var _0x41d935=_0x3dad99[_0xed6c('0x24')];var _0x2d2a42=_0x3c079f?0x0:_0x373364[_0xed6c('0x22')];var _0x3ad76c=_0x3c079f?_0x3dad99[_0xed6c('0x24')]:_0x373364[_0xed6c('0x22')]+_0x373364[_0xed6c('0x25')];var _0x3197df;if(_0x3ad76c>=_0x41d935){_0x3ad76c=_0x41d935;_0x3197df=0xc8;}else{_0x3197df=0xce;}_0x3d493e['status'](_0x3197df);return _0x3d493e[_0xed6c('0x26')](_0xed6c('0x27'),_0x2d2a42+'-'+_0x3ad76c+'/'+_0x41d935)[_0xed6c('0x21')](_0x3dad99);}return null;};}function patchUpdates(_0x506e27){return function(_0x10d79f){try{jsonpatch[_0xed6c('0x28')](_0x10d79f,_0x506e27,!![]);}catch(_0x1dac3f){return BPromise[_0xed6c('0x29')](_0x1dac3f);}return _0x10d79f['save']();};}function saveUpdates(_0x4f1d9a,_0x5d5e22){return function(_0x528d17){if(_0x528d17){return _0x528d17[_0xed6c('0x2a')](_0x4f1d9a)[_0xed6c('0x2b')](function(_0x12579e){return _0x12579e;});}return null;};}function removeEntity(_0x13db68,_0x2947cf){return function(_0x548ab0){if(_0x548ab0){return _0x548ab0['destroy']()[_0xed6c('0x2b')](function(){_0x13db68['status'](0xcc)[_0xed6c('0x20')]();});}};}function handleEntityNotFound(_0x237eb7,_0x1761ce){return function(_0x354f9d){if(!_0x354f9d){_0x237eb7[_0xed6c('0x1f')](0x194);}return _0x354f9d;};}function handleError(_0x2f1ce5,_0x4ce5ce){_0x4ce5ce=_0x4ce5ce||0x1f4;return function(_0x18428a){logger[_0xed6c('0x2c')](_0x18428a[_0xed6c('0x2d')]);if(_0x18428a[_0xed6c('0x2e')]){delete _0x18428a[_0xed6c('0x2e')];}_0x2f1ce5[_0xed6c('0x2f')](_0x4ce5ce)['send'](_0x18428a);};}exports['index']=function(_0x5a4529,_0x28bc01){var _0x253ff6={},_0x1cbf2e={},_0x41e549={'count':0x0,'rows':[]};var _0x2d52ba=_['map'](db[_0xed6c('0x30')][_0xed6c('0x31')],function(_0x53672d){return{'name':_0x53672d[_0xed6c('0x32')],'type':_0x53672d[_0xed6c('0x33')][_0xed6c('0x34')]};});_0x1cbf2e[_0xed6c('0x35')]=_[_0xed6c('0x36')](_0x2d52ba,'name');_0x1cbf2e[_0xed6c('0x37')]=_[_0xed6c('0x38')](_0x5a4529[_0xed6c('0x37')]);_0x1cbf2e[_0xed6c('0x39')]=_['intersection'](_0x1cbf2e[_0xed6c('0x35')],_0x1cbf2e[_0xed6c('0x37')]);_0x253ff6[_0xed6c('0x3a')]=_[_0xed6c('0x3b')](_0x1cbf2e['model'],qs[_0xed6c('0x3c')](_0x5a4529['query'][_0xed6c('0x3c')]));_0x253ff6[_0xed6c('0x3a')]=_0x253ff6[_0xed6c('0x3a')][_0xed6c('0x3d')]?_0x253ff6[_0xed6c('0x3a')]:_0x1cbf2e['model'];if(!_0x5a4529[_0xed6c('0x37')]['hasOwnProperty'](_0xed6c('0x3e'))){_0x253ff6['limit']=qs[_0xed6c('0x25')](_0x5a4529[_0xed6c('0x37')][_0xed6c('0x25')]);_0x253ff6['offset']=qs[_0xed6c('0x22')](_0x5a4529[_0xed6c('0x37')][_0xed6c('0x22')]);}_0x253ff6[_0xed6c('0x3f')]=qs[_0xed6c('0x40')](_0x5a4529[_0xed6c('0x37')][_0xed6c('0x40')]);_0x253ff6[_0xed6c('0x41')]=qs[_0xed6c('0x39')](_[_0xed6c('0x42')](_0x5a4529[_0xed6c('0x37')],_0x1cbf2e[_0xed6c('0x39')]),_0x2d52ba);if(_0x5a4529['query']['filter']){_0x253ff6[_0xed6c('0x41')]=_['merge'](_0x253ff6['where'],{'$or':_[_0xed6c('0x36')](_0x2d52ba,function(_0x41865f){if(_0x41865f[_0xed6c('0x33')]!==_0xed6c('0x43')){var _0x584111={};_0x584111[_0x41865f[_0xed6c('0x2e')]]={'$like':'%'+_0x5a4529[_0xed6c('0x37')][_0xed6c('0x44')]+'%'};return _0x584111;}})});}_0x253ff6=_[_0xed6c('0x45')]({},_0x253ff6,_0x5a4529[_0xed6c('0x46')]);var _0x44eacc={'where':_0x253ff6[_0xed6c('0x41')]};return db[_0xed6c('0x30')][_0xed6c('0x24')](_0x44eacc)['then'](function(_0x41d77e){_0x41e549[_0xed6c('0x24')]=_0x41d77e;if(_0x5a4529[_0xed6c('0x37')]['includeAll']){_0x253ff6['include']=[{'all':!![]}];}return db['MailSubstatus'][_0xed6c('0x47')](_0x253ff6);})[_0xed6c('0x2b')](function(_0x49f735){_0x41e549[_0xed6c('0x48')]=_0x49f735;return _0x41e549;})['then'](respondWithFilteredResult(_0x28bc01,_0x253ff6))[_0xed6c('0x49')](handleError(_0x28bc01,null));};exports['show']=function(_0x28a0ff,_0x38ca12){var _0xe034f2={'raw':!![],'where':{'id':_0x28a0ff[_0xed6c('0x4a')]['id']}},_0x48ac6a={};_0x48ac6a[_0xed6c('0x35')]=_['keys'](db['MailSubstatus'][_0xed6c('0x31')]);_0x48ac6a[_0xed6c('0x37')]=_[_0xed6c('0x38')](_0x28a0ff['query']);_0x48ac6a[_0xed6c('0x39')]=_[_0xed6c('0x3b')](_0x48ac6a[_0xed6c('0x35')],_0x48ac6a[_0xed6c('0x37')]);_0xe034f2[_0xed6c('0x3a')]=_[_0xed6c('0x3b')](_0x48ac6a[_0xed6c('0x35')],qs[_0xed6c('0x3c')](_0x28a0ff[_0xed6c('0x37')][_0xed6c('0x3c')]));_0xe034f2[_0xed6c('0x3a')]=_0xe034f2[_0xed6c('0x3a')]['length']?_0xe034f2[_0xed6c('0x3a')]:_0x48ac6a[_0xed6c('0x35')];if(_0x28a0ff[_0xed6c('0x37')][_0xed6c('0x4b')]){_0xe034f2['include']=[{'all':!![]}];}_0xe034f2=_['merge']({},_0xe034f2,_0x28a0ff[_0xed6c('0x46')]);return db[_0xed6c('0x30')]['find'](_0xe034f2)[_0xed6c('0x2b')](handleEntityNotFound(_0x38ca12,null))[_0xed6c('0x2b')](respondWithResult(_0x38ca12,null))['catch'](handleError(_0x38ca12,null));};exports[_0xed6c('0x4c')]=function(_0x1f2890,_0x4ab8f9){return db[_0xed6c('0x30')][_0xed6c('0x4c')](_0x1f2890[_0xed6c('0x4d')],{})[_0xed6c('0x2b')](respondWithResult(_0x4ab8f9,0xc9))['catch'](handleError(_0x4ab8f9,null));};exports['update']=function(_0x19041c,_0x4cfc02){if(_0x19041c['body']['id']){delete _0x19041c[_0xed6c('0x4d')]['id'];}return db[_0xed6c('0x30')][_0xed6c('0x4e')]({'where':{'id':_0x19041c[_0xed6c('0x4a')]['id']}})[_0xed6c('0x2b')](handleEntityNotFound(_0x4cfc02,null))[_0xed6c('0x2b')](saveUpdates(_0x19041c[_0xed6c('0x4d')],null))[_0xed6c('0x2b')](respondWithResult(_0x4cfc02,null))[_0xed6c('0x49')](handleError(_0x4cfc02,null));};exports['destroy']=function(_0x4bab50,_0x30b36a){return db[_0xed6c('0x30')][_0xed6c('0x4e')]({'where':{'id':_0x4bab50[_0xed6c('0x4a')]['id']}})[_0xed6c('0x2b')](handleEntityNotFound(_0x30b36a,null))[_0xed6c('0x2b')](removeEntity(_0x30b36a,null))[_0xed6c('0x49')](handleError(_0x30b36a,null));};exports[_0xed6c('0x4f')]=function(_0x40a91c,_0x4c38ce){return db['MailSubstatus'][_0xed6c('0x4f')]()[_0xed6c('0x2b')](respondWithResult(_0x4c38ce,null))[_0xed6c('0x49')](handleError(_0x4c38ce,null));}; \ No newline at end of file +var _0x2128=['key','model','query','keys','filters','attributes','intersection','fields','length','nolimit','order','pick','where','merge','type','VIRTUAL','filter','options','includeAll','include','rows','catch','find','create','body','params','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','to-csv','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','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','update','then','destroy','error','stack','send','index','map','MailSubstatus','rawAttributes','fieldName'];(function(_0x2ef8c1,_0x2f72f4){var _0x288305=function(_0x56244b){while(--_0x56244b){_0x2ef8c1['push'](_0x2ef8c1['shift']());}};_0x288305(++_0x2f72f4);}(_0x2128,0xad));var _0x8212=function(_0xb6d20d,_0xf04094){_0xb6d20d=_0xb6d20d-0x0;var _0x3662b2=_0x2128[_0xb6d20d];return _0x3662b2;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8212('0x0'));var zipdir=require(_0x8212('0x1'));var jsonpatch=require(_0x8212('0x2'));var rp=require(_0x8212('0x3'));var moment=require(_0x8212('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x8212('0x5'));var util=require('util');var path=require(_0x8212('0x6'));var sox=require('sox');var csv=require(_0x8212('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8212('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x8212('0x9'));var jsforce=require(_0x8212('0xa'));var deskjs=require(_0x8212('0xb'));var toCsv=require('to-csv');var querystring=require(_0x8212('0xc'));var Papa=require(_0x8212('0xd'));var Redis=require(_0x8212('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x8212('0xf'));var as=require(_0x8212('0x10'));var hardwareService=require(_0x8212('0x11'));var logger=require(_0x8212('0x12'))(_0x8212('0x13'));var utils=require(_0x8212('0x14'));var config=require(_0x8212('0x15'));var licenseUtil=require(_0x8212('0x16'));var db=require(_0x8212('0x17'))['db'];function respondWithStatusCode(_0x1b225a,_0x3e43e5){_0x3e43e5=_0x3e43e5||0xcc;return function(_0x1a21f6){if(_0x1a21f6){return _0x1b225a[_0x8212('0x18')](_0x3e43e5);}return _0x1b225a[_0x8212('0x19')](_0x3e43e5)[_0x8212('0x1a')]();};}function respondWithResult(_0xa136ef,_0x3234fc){_0x3234fc=_0x3234fc||0xc8;return function(_0x3249c9){if(_0x3249c9){return _0xa136ef[_0x8212('0x19')](_0x3234fc)[_0x8212('0x1b')](_0x3249c9);}};}function respondWithFilteredResult(_0x9bffa5,_0x329b73){return function(_0x1d3e6d){if(_0x1d3e6d){var _0xa3772c=typeof _0x329b73[_0x8212('0x1c')]===_0x8212('0x1d')&&typeof _0x329b73[_0x8212('0x1e')]===_0x8212('0x1d');var _0x53176e=_0x1d3e6d[_0x8212('0x1f')];var _0x4f4beb=_0xa3772c?0x0:_0x329b73[_0x8212('0x1c')];var _0x57ccf5=_0xa3772c?_0x1d3e6d[_0x8212('0x1f')]:_0x329b73[_0x8212('0x1c')]+_0x329b73[_0x8212('0x1e')];var _0x3e18fb;if(_0x57ccf5>=_0x53176e){_0x57ccf5=_0x53176e;_0x3e18fb=0xc8;}else{_0x3e18fb=0xce;}_0x9bffa5[_0x8212('0x19')](_0x3e18fb);return _0x9bffa5[_0x8212('0x20')](_0x8212('0x21'),_0x4f4beb+'-'+_0x57ccf5+'/'+_0x53176e)[_0x8212('0x1b')](_0x1d3e6d);}return null;};}function patchUpdates(_0xbbf0d1){return function(_0x101ec3){try{jsonpatch['apply'](_0x101ec3,_0xbbf0d1,!![]);}catch(_0x1d65aa){return BPromise[_0x8212('0x22')](_0x1d65aa);}return _0x101ec3['save']();};}function saveUpdates(_0x9bf9cc,_0x521451){return function(_0x553f06){if(_0x553f06){return _0x553f06[_0x8212('0x23')](_0x9bf9cc)[_0x8212('0x24')](function(_0x4a8da0){return _0x4a8da0;});}return null;};}function removeEntity(_0x42814e,_0x2ed774){return function(_0x49b428){if(_0x49b428){return _0x49b428[_0x8212('0x25')]()[_0x8212('0x24')](function(){_0x42814e[_0x8212('0x19')](0xcc)[_0x8212('0x1a')]();});}};}function handleEntityNotFound(_0x1182a,_0x4e3e4c){return function(_0x44bfb3){if(!_0x44bfb3){_0x1182a[_0x8212('0x18')](0x194);}return _0x44bfb3;};}function handleError(_0x218974,_0x20c890){_0x20c890=_0x20c890||0x1f4;return function(_0x2c8025){logger[_0x8212('0x26')](_0x2c8025[_0x8212('0x27')]);if(_0x2c8025['name']){delete _0x2c8025['name'];}_0x218974['status'](_0x20c890)[_0x8212('0x28')](_0x2c8025);};}exports[_0x8212('0x29')]=function(_0x1d1f2d,_0x21e141){var _0x493e25={},_0xec849c={},_0x13f5e5={'count':0x0,'rows':[]};var _0x1ef76c=_[_0x8212('0x2a')](db[_0x8212('0x2b')][_0x8212('0x2c')],function(_0x343087){return{'name':_0x343087[_0x8212('0x2d')],'type':_0x343087['type'][_0x8212('0x2e')]};});_0xec849c[_0x8212('0x2f')]=_[_0x8212('0x2a')](_0x1ef76c,'name');_0xec849c[_0x8212('0x30')]=_[_0x8212('0x31')](_0x1d1f2d[_0x8212('0x30')]);_0xec849c[_0x8212('0x32')]=_['intersection'](_0xec849c['model'],_0xec849c[_0x8212('0x30')]);_0x493e25[_0x8212('0x33')]=_[_0x8212('0x34')](_0xec849c[_0x8212('0x2f')],qs[_0x8212('0x35')](_0x1d1f2d[_0x8212('0x30')][_0x8212('0x35')]));_0x493e25[_0x8212('0x33')]=_0x493e25['attributes'][_0x8212('0x36')]?_0x493e25[_0x8212('0x33')]:_0xec849c[_0x8212('0x2f')];if(!_0x1d1f2d['query']['hasOwnProperty'](_0x8212('0x37'))){_0x493e25[_0x8212('0x1e')]=qs[_0x8212('0x1e')](_0x1d1f2d[_0x8212('0x30')]['limit']);_0x493e25['offset']=qs[_0x8212('0x1c')](_0x1d1f2d[_0x8212('0x30')][_0x8212('0x1c')]);}_0x493e25[_0x8212('0x38')]=qs['sort'](_0x1d1f2d['query']['sort']);_0x493e25['where']=qs[_0x8212('0x32')](_[_0x8212('0x39')](_0x1d1f2d[_0x8212('0x30')],_0xec849c[_0x8212('0x32')]),_0x1ef76c);if(_0x1d1f2d[_0x8212('0x30')]['filter']){_0x493e25[_0x8212('0x3a')]=_[_0x8212('0x3b')](_0x493e25[_0x8212('0x3a')],{'$or':_[_0x8212('0x2a')](_0x1ef76c,function(_0x8794cb){if(_0x8794cb[_0x8212('0x3c')]!==_0x8212('0x3d')){var _0x259ed2={};_0x259ed2[_0x8794cb['name']]={'$like':'%'+_0x1d1f2d[_0x8212('0x30')][_0x8212('0x3e')]+'%'};return _0x259ed2;}})});}_0x493e25=_[_0x8212('0x3b')]({},_0x493e25,_0x1d1f2d[_0x8212('0x3f')]);var _0x19709d={'where':_0x493e25[_0x8212('0x3a')]};return db['MailSubstatus'][_0x8212('0x1f')](_0x19709d)[_0x8212('0x24')](function(_0x43d611){_0x13f5e5['count']=_0x43d611;if(_0x1d1f2d[_0x8212('0x30')][_0x8212('0x40')]){_0x493e25[_0x8212('0x41')]=[{'all':!![]}];}return db['MailSubstatus']['findAll'](_0x493e25);})['then'](function(_0x48ad7a){_0x13f5e5[_0x8212('0x42')]=_0x48ad7a;return _0x13f5e5;})['then'](respondWithFilteredResult(_0x21e141,_0x493e25))[_0x8212('0x43')](handleError(_0x21e141,null));};exports['show']=function(_0x4381c2,_0x4a2ab9){var _0x7c2efd={'raw':!![],'where':{'id':_0x4381c2['params']['id']}},_0x5c9cab={};_0x5c9cab[_0x8212('0x2f')]=_[_0x8212('0x31')](db[_0x8212('0x2b')][_0x8212('0x2c')]);_0x5c9cab['query']=_[_0x8212('0x31')](_0x4381c2[_0x8212('0x30')]);_0x5c9cab[_0x8212('0x32')]=_[_0x8212('0x34')](_0x5c9cab['model'],_0x5c9cab['query']);_0x7c2efd[_0x8212('0x33')]=_['intersection'](_0x5c9cab[_0x8212('0x2f')],qs['fields'](_0x4381c2[_0x8212('0x30')]['fields']));_0x7c2efd['attributes']=_0x7c2efd['attributes'][_0x8212('0x36')]?_0x7c2efd[_0x8212('0x33')]:_0x5c9cab['model'];if(_0x4381c2['query'][_0x8212('0x40')]){_0x7c2efd['include']=[{'all':!![]}];}_0x7c2efd=_[_0x8212('0x3b')]({},_0x7c2efd,_0x4381c2[_0x8212('0x3f')]);return db[_0x8212('0x2b')][_0x8212('0x44')](_0x7c2efd)['then'](handleEntityNotFound(_0x4a2ab9,null))[_0x8212('0x24')](respondWithResult(_0x4a2ab9,null))['catch'](handleError(_0x4a2ab9,null));};exports[_0x8212('0x45')]=function(_0x586f74,_0x5a011b){return db['MailSubstatus'][_0x8212('0x45')](_0x586f74['body'],{})[_0x8212('0x24')](respondWithResult(_0x5a011b,0xc9))[_0x8212('0x43')](handleError(_0x5a011b,null));};exports['update']=function(_0x371a22,_0x1ceaa7){if(_0x371a22[_0x8212('0x46')]['id']){delete _0x371a22['body']['id'];}return db[_0x8212('0x2b')][_0x8212('0x44')]({'where':{'id':_0x371a22[_0x8212('0x47')]['id']}})[_0x8212('0x24')](handleEntityNotFound(_0x1ceaa7,null))[_0x8212('0x24')](saveUpdates(_0x371a22[_0x8212('0x46')],null))['then'](respondWithResult(_0x1ceaa7,null))[_0x8212('0x43')](handleError(_0x1ceaa7,null));};exports['destroy']=function(_0x2a36ad,_0x42e6e3){return db['MailSubstatus'][_0x8212('0x44')]({'where':{'id':_0x2a36ad['params']['id']}})['then'](handleEntityNotFound(_0x42e6e3,null))[_0x8212('0x24')](removeEntity(_0x42e6e3,null))[_0x8212('0x43')](handleError(_0x42e6e3,null));};exports[_0x8212('0x48')]=function(_0x527892,_0x42b934){return db['MailSubstatus'][_0x8212('0x48')]()[_0x8212('0x24')](respondWithResult(_0x42b934,null))[_0x8212('0x43')](handleError(_0x42b934,null));}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.events.js b/server/api/mailSubstatus/mailSubstatus.events.js index 5720ea1..6d69dc6 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 _0x3e55=['emit','hook','exports','events','MailSubstatus','setMaxListeners','update'];(function(_0x1967a3,_0x2e5525){var _0x4647fc=function(_0x3227c8){while(--_0x3227c8){_0x1967a3['push'](_0x1967a3['shift']());}};_0x4647fc(++_0x2e5525);}(_0x3e55,0x7a));var _0x53e5=function(_0x165d7f,_0x399b40){_0x165d7f=_0x165d7f-0x0;var _0xbd821b=_0x3e55[_0x165d7f];return _0xbd821b;};'use strict';var EventEmitter=require(_0x53e5('0x0'));var MailSubstatus=require('../../mysqldb')['db'][_0x53e5('0x1')];var MailSubstatusEvents=new EventEmitter();MailSubstatusEvents[_0x53e5('0x2')](0x0);var events={'afterUpdate':_0x53e5('0x3')};function emitEvent(_0x319a4d){return function(_0x298aab,_0xb5d9ec,_0x286e35){MailSubstatusEvents[_0x53e5('0x4')](_0x319a4d+':'+_0x298aab['id'],_0x298aab);MailSubstatusEvents['emit'](_0x319a4d,_0x298aab);_0x286e35(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailSubstatus[_0x53e5('0x5')](e,emitEvent(event));}}module[_0x53e5('0x6')]=MailSubstatusEvents; \ No newline at end of file +var _0x4f48=['emit','hasOwnProperty','hook','exports','setMaxListeners'];(function(_0x3fd531,_0x26abc4){var _0x3aaa48=function(_0x2cee1e){while(--_0x2cee1e){_0x3fd531['push'](_0x3fd531['shift']());}};_0x3aaa48(++_0x26abc4);}(_0x4f48,0x1b2));var _0x84f4=function(_0xae3af7,_0x55341b){_0xae3af7=_0xae3af7-0x0;var _0x2426d1=_0x4f48[_0xae3af7];return _0x2426d1;};'use strict';var EventEmitter=require('events');var MailSubstatus=require('../../mysqldb')['db']['MailSubstatus'];var MailSubstatusEvents=new EventEmitter();MailSubstatusEvents[_0x84f4('0x0')](0x0);var events={'afterUpdate':'update'};function emitEvent(_0x287996){return function(_0x79eb3c,_0x5d18b1,_0x4292d1){MailSubstatusEvents[_0x84f4('0x1')](_0x287996+':'+_0x79eb3c['id'],_0x79eb3c);MailSubstatusEvents[_0x84f4('0x1')](_0x287996,_0x79eb3c);_0x4292d1(null);};}for(var e in events){if(events[_0x84f4('0x2')](e)){var event=events[e];MailSubstatus[_0x84f4('0x3')](e,emitEvent(event));}}module[_0x84f4('0x4')]=MailSubstatusEvents; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.model.js b/server/api/mailSubstatus/mailSubstatus.model.js index 4492ca8..714f14e 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 _0xd5b8=['Condition','update','mailSubstatus','_previousDataValues','name','catch','./mailSubstatus.attributes','exports','define','mail_substatuses'];(function(_0x52bbdf,_0xdb78e0){var _0x78f6e5=function(_0x285861){while(--_0x285861){_0x52bbdf['push'](_0x52bbdf['shift']());}};_0x78f6e5(++_0xdb78e0);}(_0xd5b8,0x74));var _0x8d5b=function(_0x572597,_0x34915e){_0x572597=_0x572597-0x0;var _0x229f7f=_0xd5b8[_0x572597];return _0x229f7f;};'use strict';var attributes=require(_0x8d5b('0x0'));module[_0x8d5b('0x1')]=function(_0x1e4b92){var _0x8c00a=_0x1e4b92['models'];return _0x1e4b92[_0x8d5b('0x2')]('MailSubstatus',attributes,{'tableName':_0x8d5b('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0x1f14c3,_0x5c12e8,_0x52f9cf){return _0x8c00a[_0x8d5b('0x4')][_0x8d5b('0x5')]({'value':_0x1f14c3['name']},{'where':{'field':_0x8d5b('0x6'),'value':_0x1f14c3[_0x8d5b('0x7')][_0x8d5b('0x8')]}})['then'](function(){_0x52f9cf();})[_0x8d5b('0x9')](function(_0x2e5fff){_0x52f9cf(_0x2e5fff);});}}});}; \ No newline at end of file +var _0xa2a4=['exports','define','MailSubstatus','update','name','mailSubstatus','then','catch','./mailSubstatus.attributes'];(function(_0x1d4d22,_0x5d1558){var _0xa3f65a=function(_0x2ff5e1){while(--_0x2ff5e1){_0x1d4d22['push'](_0x1d4d22['shift']());}};_0xa3f65a(++_0x5d1558);}(_0xa2a4,0xd7));var _0x4a2a=function(_0x2da064,_0x477cc0){_0x2da064=_0x2da064-0x0;var _0x33c0c6=_0xa2a4[_0x2da064];return _0x33c0c6;};'use strict';var attributes=require(_0x4a2a('0x0'));module[_0x4a2a('0x1')]=function(_0x16a9f6){var _0xcf0cf4=_0x16a9f6['models'];return _0x16a9f6[_0x4a2a('0x2')](_0x4a2a('0x3'),attributes,{'tableName':'mail_substatuses','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0x3ded9e,_0x1943fa,_0x3332ef){return _0xcf0cf4['Condition'][_0x4a2a('0x4')]({'value':_0x3ded9e[_0x4a2a('0x5')]},{'where':{'field':_0x4a2a('0x6'),'value':_0x3ded9e['_previousDataValues']['name']}})[_0x4a2a('0x7')](function(){_0x3332ef();})[_0x4a2a('0x8')](function(_0x5c624c){_0x3332ef(_0x5c624c);});}}});}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.rpc.js b/server/api/mailSubstatus/mailSubstatus.rpc.js index ef9e588..00d8419 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 _0x4fdb=['http','info','MailSubstatus,\x20%s,\x20%s','request\x20sent','debug','MailSubstatus,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x55b275,_0x43ad67){var _0xcf16f1=function(_0x36185e){while(--_0x36185e){_0x55b275['push'](_0x55b275['shift']());}};_0xcf16f1(++_0x43ad67);}(_0x4fdb,0x1ef));var _0xb4fd=function(_0x79dbb6,_0x55d954){_0x79dbb6=_0x79dbb6-0x0;var _0x5a1437=_0x4fdb[_0x79dbb6];return _0x5a1437;};'use strict';var _=require('lodash');var util=require(_0xb4fd('0x0'));var moment=require(_0xb4fd('0x1'));var BPromise=require('bluebird');var rs=require(_0xb4fd('0x2'));var fs=require('fs');var Redis=require(_0xb4fd('0x3'));var db=require(_0xb4fd('0x4'))['db'];var utils=require(_0xb4fd('0x5'));var logger=require(_0xb4fd('0x6'))(_0xb4fd('0x7'));var config=require(_0xb4fd('0x8'));var jayson=require(_0xb4fd('0x9'));var client=jayson[_0xb4fd('0xa')][_0xb4fd('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1065f8,_0x41bcc9,_0x39312b){return new BPromise(function(_0x407738,_0x26705b){return client['request'](_0x1065f8,_0x39312b)['then'](function(_0x5cbd32){logger[_0xb4fd('0xc')](_0xb4fd('0xd'),_0x41bcc9,_0xb4fd('0xe'));logger[_0xb4fd('0xf')](_0xb4fd('0x10'),_0x41bcc9,'request\x20sent',JSON[_0xb4fd('0x11')](_0x5cbd32));if(_0x5cbd32[_0xb4fd('0x12')]){if(_0x5cbd32['error'][_0xb4fd('0x13')]===0x1f4){logger[_0xb4fd('0x12')]('MailSubstatus,\x20%s,\x20%s',_0x41bcc9,_0x5cbd32[_0xb4fd('0x12')][_0xb4fd('0x14')]);return _0x26705b(_0x5cbd32[_0xb4fd('0x12')][_0xb4fd('0x14')]);}logger[_0xb4fd('0x12')](_0xb4fd('0xd'),_0x41bcc9,_0x5cbd32[_0xb4fd('0x12')]['message']);return _0x407738(_0x5cbd32['error']['message']);}else{logger[_0xb4fd('0xc')](_0xb4fd('0xd'),_0x41bcc9,_0xb4fd('0xe'));_0x407738(_0x5cbd32[_0xb4fd('0x15')][_0xb4fd('0x14')]);}})[_0xb4fd('0x16')](function(_0x4712af){logger[_0xb4fd('0x12')](_0xb4fd('0xd'),_0x41bcc9,_0x4712af);_0x26705b(_0x4712af);});});} \ No newline at end of file +var _0x9a5a=['info','request\x20sent','debug','MailSubstatus,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','MailSubstatus,\x20%s,\x20%s','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','http','request'];(function(_0x1fbe30,_0x39504e){var _0x1c48c0=function(_0x51e030){while(--_0x51e030){_0x1fbe30['push'](_0x1fbe30['shift']());}};_0x1c48c0(++_0x39504e);}(_0x9a5a,0x186));var _0xa9a5=function(_0x333766,_0x494e48){_0x333766=_0x333766-0x0;var _0x5f76f3=_0x9a5a[_0x333766];return _0x5f76f3;};'use strict';var _=require(_0xa9a5('0x0'));var util=require(_0xa9a5('0x1'));var moment=require(_0xa9a5('0x2'));var BPromise=require(_0xa9a5('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa9a5('0x4'));var db=require(_0xa9a5('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xa9a5('0x6'))(_0xa9a5('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xa9a5('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2660a5,_0x5ef9f2,_0x574508){return new BPromise(function(_0x68e8a1,_0x5dec42){return client[_0xa9a5('0x9')](_0x2660a5,_0x574508)['then'](function(_0x299178){logger[_0xa9a5('0xa')]('MailSubstatus,\x20%s,\x20%s',_0x5ef9f2,_0xa9a5('0xb'));logger[_0xa9a5('0xc')](_0xa9a5('0xd'),_0x5ef9f2,_0xa9a5('0xb'),JSON[_0xa9a5('0xe')](_0x299178));if(_0x299178['error']){if(_0x299178[_0xa9a5('0xf')][_0xa9a5('0x10')]===0x1f4){logger[_0xa9a5('0xf')]('MailSubstatus,\x20%s,\x20%s',_0x5ef9f2,_0x299178[_0xa9a5('0xf')][_0xa9a5('0x11')]);return _0x5dec42(_0x299178[_0xa9a5('0xf')]['message']);}logger[_0xa9a5('0xf')]('MailSubstatus,\x20%s,\x20%s',_0x5ef9f2,_0x299178[_0xa9a5('0xf')][_0xa9a5('0x11')]);return _0x68e8a1(_0x299178[_0xa9a5('0xf')][_0xa9a5('0x11')]);}else{logger['info']('MailSubstatus,\x20%s,\x20%s',_0x5ef9f2,_0xa9a5('0xb'));_0x68e8a1(_0x299178['result']['message']);}})[_0xa9a5('0x12')](function(_0x4f3196){logger[_0xa9a5('0xf')](_0xa9a5('0x13'),_0x5ef9f2,_0x4f3196);_0x5dec42(_0x4f3196);});});} \ No newline at end of file diff --git a/server/api/mailTransferReport/index.js b/server/api/mailTransferReport/index.js index 7ce09cf..6a13ea4 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 _0xefcc=['put','delete','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailTransferReport.controller','get','isAuthenticated','/describe','describe','/:id','show','post','create'];(function(_0x3e7bc2,_0x2b5d1b){var _0x2e8816=function(_0xc57483){while(--_0xc57483){_0x3e7bc2['push'](_0x3e7bc2['shift']());}};_0x2e8816(++_0x2b5d1b);}(_0xefcc,0x1e6));var _0xcefc=function(_0xb61d88,_0x388bba){_0xb61d88=_0xb61d88-0x0;var _0x196a0d=_0xefcc[_0xb61d88];return _0x196a0d;};'use strict';var multer=require('multer');var util=require(_0xcefc('0x0'));var path=require(_0xcefc('0x1'));var timeout=require(_0xcefc('0x2'));var express=require(_0xcefc('0x3'));var router=express[_0xcefc('0x4')]();var fs_extra=require(_0xcefc('0x5'));var auth=require(_0xcefc('0x6'));var interaction=require(_0xcefc('0x7'));var config=require(_0xcefc('0x8'));var controller=require(_0xcefc('0x9'));router[_0xcefc('0xa')]('/',auth[_0xcefc('0xb')](),controller['index']);router[_0xcefc('0xa')](_0xcefc('0xc'),auth[_0xcefc('0xb')](),controller[_0xcefc('0xd')]);router[_0xcefc('0xa')](_0xcefc('0xe'),auth[_0xcefc('0xb')](),controller[_0xcefc('0xf')]);router[_0xcefc('0x10')]('/',auth[_0xcefc('0xb')](),controller[_0xcefc('0x11')]);router[_0xcefc('0x12')](_0xcefc('0xe'),auth[_0xcefc('0xb')](),controller['update']);router[_0xcefc('0x13')](_0xcefc('0xe'),auth[_0xcefc('0xb')](),controller[_0xcefc('0x14')]);module['exports']=router; \ No newline at end of file +var _0xbab8=['destroy','path','express','Router','../../components/interaction/service','isAuthenticated','index','get','/describe','describe','/:id','show','post','create','put','update','delete'];(function(_0x295630,_0x46393e){var _0x404ddf=function(_0x1edf84){while(--_0x1edf84){_0x295630['push'](_0x295630['shift']());}};_0x404ddf(++_0x46393e);}(_0xbab8,0x177));var _0x8bab=function(_0x2fef36,_0x2d9657){_0x2fef36=_0x2fef36-0x0;var _0x36cb38=_0xbab8[_0x2fef36];return _0x36cb38;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x8bab('0x0'));var timeout=require('connect-timeout');var express=require(_0x8bab('0x1'));var router=express[_0x8bab('0x2')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x8bab('0x3'));var config=require('../../config/environment');var controller=require('./mailTransferReport.controller');router['get']('/',auth[_0x8bab('0x4')](),controller[_0x8bab('0x5')]);router[_0x8bab('0x6')](_0x8bab('0x7'),auth[_0x8bab('0x4')](),controller[_0x8bab('0x8')]);router['get'](_0x8bab('0x9'),auth[_0x8bab('0x4')](),controller[_0x8bab('0xa')]);router[_0x8bab('0xb')]('/',auth[_0x8bab('0x4')](),controller[_0x8bab('0xc')]);router[_0x8bab('0xd')](_0x8bab('0x9'),auth['isAuthenticated'](),controller[_0x8bab('0xe')]);router[_0x8bab('0xf')](_0x8bab('0x9'),auth[_0x8bab('0x4')](),controller[_0x8bab('0x10')]);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 ff83234..7af1828 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 _0xf4eb=['NOW','moment','account','queue','DATE'];(function(_0x4bb984,_0x23e2c0){var _0x5428eb=function(_0x1639f0){while(--_0x1639f0){_0x4bb984['push'](_0x4bb984['shift']());}};_0x5428eb(++_0x23e2c0);}(_0xf4eb,0xec));var _0xbf4e=function(_0x136342,_0x173bbc){_0x136342=_0x136342-0x0;var _0x35ec18=_0xf4eb[_0x136342];return _0x35ec18;};'use strict';var moment=require(_0xbf4e('0x0'));var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xbf4e('0x1'),'agent','queue'),'allowNull':![],'defaultValue':_0xbf4e('0x2')},'transferredAt':{'type':Sequelize[_0xbf4e('0x3')],'allowNull':![],'defaultValue':Sequelize[_0xbf4e('0x4')]}}; \ No newline at end of file +var _0xf4eb=['NOW','moment','account','queue','DATE'];(function(_0x4c66a0,_0x2cc69d){var _0x440323=function(_0x2bba3e){while(--_0x2bba3e){_0x4c66a0['push'](_0x4c66a0['shift']());}};_0x440323(++_0x2cc69d);}(_0xf4eb,0xec));var _0xbf4e=function(_0x23c9e6,_0x1575e8){_0x23c9e6=_0x23c9e6-0x0;var _0x44a0f9=_0xf4eb[_0x23c9e6];return _0x44a0f9;};'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/mailTransferReport/mailTransferReport.controller.js b/server/api/mailTransferReport/mailTransferReport.controller.js index 184da02..e3683e9 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 _0xac77=['path','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','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','apply','reject','save','then','destroy','stack','name','send','index','MailTransferReport','rawAttributes','fieldName','key','map','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','merge','options','includeAll','include','findAll','rows','show','params','find','catch','create','update','body','describe','eml-format','fast-json-patch','moment'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xac77,0x1b9));var _0x7ac7=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xac77[_0x3ab51d];return _0x29a04e;};'use strict';var emlformat=require(_0x7ac7('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x7ac7('0x1'));var rp=require('request-promise');var moment=require(_0x7ac7('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x7ac7('0x3'));var sox=require(_0x7ac7('0x4'));var csv=require(_0x7ac7('0x5'));var ejs=require(_0x7ac7('0x6'));var fs=require('fs');var fs_extra=require(_0x7ac7('0x7'));var _=require('lodash');var squel=require(_0x7ac7('0x8'));var crypto=require(_0x7ac7('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x7ac7('0xa'));var toCsv=require(_0x7ac7('0x5'));var querystring=require(_0x7ac7('0xb'));var Papa=require(_0x7ac7('0xc'));var Redis=require(_0x7ac7('0xd'));var authService=require(_0x7ac7('0xe'));var qs=require(_0x7ac7('0xf'));var as=require(_0x7ac7('0x10'));var hardwareService=require(_0x7ac7('0x11'));var logger=require('../../config/logger')(_0x7ac7('0x12'));var utils=require(_0x7ac7('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x7ac7('0x14'))['db'];function respondWithStatusCode(_0x46c692,_0x1e8c4a){_0x1e8c4a=_0x1e8c4a||0xcc;return function(_0x1e9399){if(_0x1e9399){return _0x46c692[_0x7ac7('0x15')](_0x1e8c4a);}return _0x46c692[_0x7ac7('0x16')](_0x1e8c4a)[_0x7ac7('0x17')]();};}function respondWithResult(_0x57f4e9,_0x158da4){_0x158da4=_0x158da4||0xc8;return function(_0x5caaa1){if(_0x5caaa1){return _0x57f4e9['status'](_0x158da4)[_0x7ac7('0x18')](_0x5caaa1);}};}function respondWithFilteredResult(_0x51a69d,_0x31c061){return function(_0x532736){if(_0x532736){var _0x5a685c=typeof _0x31c061[_0x7ac7('0x19')]===_0x7ac7('0x1a')&&typeof _0x31c061['limit']===_0x7ac7('0x1a');var _0x4fdfbc=_0x532736[_0x7ac7('0x1b')];var _0x32bd8e=_0x5a685c?0x0:_0x31c061[_0x7ac7('0x19')];var _0x317883=_0x5a685c?_0x532736[_0x7ac7('0x1b')]:_0x31c061[_0x7ac7('0x19')]+_0x31c061[_0x7ac7('0x1c')];var _0x3ca858;if(_0x317883>=_0x4fdfbc){_0x317883=_0x4fdfbc;_0x3ca858=0xc8;}else{_0x3ca858=0xce;}_0x51a69d[_0x7ac7('0x16')](_0x3ca858);return _0x51a69d['set'](_0x7ac7('0x1d'),_0x32bd8e+'-'+_0x317883+'/'+_0x4fdfbc)['json'](_0x532736);}return null;};}function patchUpdates(_0x556285){return function(_0x211f2b){try{jsonpatch[_0x7ac7('0x1e')](_0x211f2b,_0x556285,!![]);}catch(_0x107606){return BPromise[_0x7ac7('0x1f')](_0x107606);}return _0x211f2b[_0x7ac7('0x20')]();};}function saveUpdates(_0x1bcef2,_0x45e755){return function(_0x4c567e){if(_0x4c567e){return _0x4c567e['update'](_0x1bcef2)[_0x7ac7('0x21')](function(_0x38869b){return _0x38869b;});}return null;};}function removeEntity(_0x16dd19,_0x5262b4){return function(_0x21776e){if(_0x21776e){return _0x21776e[_0x7ac7('0x22')]()['then'](function(){_0x16dd19['status'](0xcc)[_0x7ac7('0x17')]();});}};}function handleEntityNotFound(_0x1365dd,_0x397137){return function(_0x148d03){if(!_0x148d03){_0x1365dd[_0x7ac7('0x15')](0x194);}return _0x148d03;};}function handleError(_0x47269e,_0x42b47e){_0x42b47e=_0x42b47e||0x1f4;return function(_0x2d57cb){logger['error'](_0x2d57cb[_0x7ac7('0x23')]);if(_0x2d57cb[_0x7ac7('0x24')]){delete _0x2d57cb['name'];}_0x47269e[_0x7ac7('0x16')](_0x42b47e)[_0x7ac7('0x25')](_0x2d57cb);};}exports[_0x7ac7('0x26')]=function(_0x231cc8,_0x215c40){var _0x202320={},_0x50a11a={},_0x5dbbee={'count':0x0,'rows':[]};var _0x2b5f11=_['map'](db[_0x7ac7('0x27')][_0x7ac7('0x28')],function(_0x5f29dc){return{'name':_0x5f29dc[_0x7ac7('0x29')],'type':_0x5f29dc['type'][_0x7ac7('0x2a')]};});_0x50a11a['model']=_[_0x7ac7('0x2b')](_0x2b5f11,_0x7ac7('0x24'));_0x50a11a[_0x7ac7('0x2c')]=_[_0x7ac7('0x2d')](_0x231cc8[_0x7ac7('0x2c')]);_0x50a11a[_0x7ac7('0x2e')]=_[_0x7ac7('0x2f')](_0x50a11a[_0x7ac7('0x30')],_0x50a11a[_0x7ac7('0x2c')]);_0x202320['attributes']=_['intersection'](_0x50a11a['model'],qs['fields'](_0x231cc8['query'][_0x7ac7('0x31')]));_0x202320['attributes']=_0x202320[_0x7ac7('0x32')][_0x7ac7('0x33')]?_0x202320['attributes']:_0x50a11a['model'];if(!_0x231cc8[_0x7ac7('0x2c')][_0x7ac7('0x34')](_0x7ac7('0x35'))){_0x202320[_0x7ac7('0x1c')]=qs[_0x7ac7('0x1c')](_0x231cc8['query']['limit']);_0x202320[_0x7ac7('0x19')]=qs[_0x7ac7('0x19')](_0x231cc8[_0x7ac7('0x2c')][_0x7ac7('0x19')]);}_0x202320[_0x7ac7('0x36')]=qs[_0x7ac7('0x37')](_0x231cc8[_0x7ac7('0x2c')]['sort']);_0x202320[_0x7ac7('0x38')]=qs[_0x7ac7('0x2e')](_[_0x7ac7('0x39')](_0x231cc8[_0x7ac7('0x2c')],_0x50a11a[_0x7ac7('0x2e')]),_0x2b5f11);if(_0x231cc8['query'][_0x7ac7('0x3a')]){_0x202320[_0x7ac7('0x38')]=_['merge'](_0x202320[_0x7ac7('0x38')],{'$or':_['map'](_0x2b5f11,function(_0x749ff2){if(_0x749ff2[_0x7ac7('0x3b')]!=='VIRTUAL'){var _0x433854={};_0x433854[_0x749ff2[_0x7ac7('0x24')]]={'$like':'%'+_0x231cc8[_0x7ac7('0x2c')][_0x7ac7('0x3a')]+'%'};return _0x433854;}})});}_0x202320=_[_0x7ac7('0x3c')]({},_0x202320,_0x231cc8[_0x7ac7('0x3d')]);var _0x31d012={'where':_0x202320[_0x7ac7('0x38')]};return db[_0x7ac7('0x27')][_0x7ac7('0x1b')](_0x31d012)[_0x7ac7('0x21')](function(_0x359537){_0x5dbbee[_0x7ac7('0x1b')]=_0x359537;if(_0x231cc8['query'][_0x7ac7('0x3e')]){_0x202320[_0x7ac7('0x3f')]=[{'all':!![]}];}return db[_0x7ac7('0x27')][_0x7ac7('0x40')](_0x202320);})[_0x7ac7('0x21')](function(_0x54f214){_0x5dbbee[_0x7ac7('0x41')]=_0x54f214;return _0x5dbbee;})[_0x7ac7('0x21')](respondWithFilteredResult(_0x215c40,_0x202320))['catch'](handleError(_0x215c40,null));};exports[_0x7ac7('0x42')]=function(_0x1f338c,_0x27840d){var _0x2dbd5f={'raw':!![],'where':{'id':_0x1f338c[_0x7ac7('0x43')]['id']}},_0x36b260={};_0x36b260['model']=_[_0x7ac7('0x2d')](db['MailTransferReport'][_0x7ac7('0x28')]);_0x36b260[_0x7ac7('0x2c')]=_[_0x7ac7('0x2d')](_0x1f338c[_0x7ac7('0x2c')]);_0x36b260['filters']=_[_0x7ac7('0x2f')](_0x36b260['model'],_0x36b260[_0x7ac7('0x2c')]);_0x2dbd5f[_0x7ac7('0x32')]=_['intersection'](_0x36b260['model'],qs[_0x7ac7('0x31')](_0x1f338c[_0x7ac7('0x2c')][_0x7ac7('0x31')]));_0x2dbd5f[_0x7ac7('0x32')]=_0x2dbd5f[_0x7ac7('0x32')]['length']?_0x2dbd5f[_0x7ac7('0x32')]:_0x36b260[_0x7ac7('0x30')];if(_0x1f338c[_0x7ac7('0x2c')][_0x7ac7('0x3e')]){_0x2dbd5f[_0x7ac7('0x3f')]=[{'all':!![]}];}_0x2dbd5f=_[_0x7ac7('0x3c')]({},_0x2dbd5f,_0x1f338c[_0x7ac7('0x3d')]);return db[_0x7ac7('0x27')][_0x7ac7('0x44')](_0x2dbd5f)[_0x7ac7('0x21')](handleEntityNotFound(_0x27840d,null))[_0x7ac7('0x21')](respondWithResult(_0x27840d,null))[_0x7ac7('0x45')](handleError(_0x27840d,null));};exports[_0x7ac7('0x46')]=function(_0x1401f1,_0x2e67be){return db[_0x7ac7('0x27')][_0x7ac7('0x46')](_0x1401f1['body'],{})[_0x7ac7('0x21')](respondWithResult(_0x2e67be,0xc9))[_0x7ac7('0x45')](handleError(_0x2e67be,null));};exports[_0x7ac7('0x47')]=function(_0x54bb89,_0x4c8f77){if(_0x54bb89['body']['id']){delete _0x54bb89[_0x7ac7('0x48')]['id'];}return db[_0x7ac7('0x27')][_0x7ac7('0x44')]({'where':{'id':_0x54bb89[_0x7ac7('0x43')]['id']}})['then'](handleEntityNotFound(_0x4c8f77,null))[_0x7ac7('0x21')](saveUpdates(_0x54bb89['body'],null))['then'](respondWithResult(_0x4c8f77,null))[_0x7ac7('0x45')](handleError(_0x4c8f77,null));};exports[_0x7ac7('0x22')]=function(_0x4595d6,_0x29f67d){return db[_0x7ac7('0x27')][_0x7ac7('0x44')]({'where':{'id':_0x4595d6[_0x7ac7('0x43')]['id']}})[_0x7ac7('0x21')](handleEntityNotFound(_0x29f67d,null))[_0x7ac7('0x21')](removeEntity(_0x29f67d,null))['catch'](handleError(_0x29f67d,null));};exports[_0x7ac7('0x49')]=function(_0x5d3208,_0x53fb8a){return db[_0x7ac7('0x27')][_0x7ac7('0x49')]()[_0x7ac7('0x21')](respondWithResult(_0x53fb8a,null))[_0x7ac7('0x45')](handleError(_0x53fb8a,null));}; \ No newline at end of file +var _0xbf19=['Content-Range','json','apply','reject','then','destroy','error','stack','name','send','index','map','MailTransferReport','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','show','params','rawAttributes','length','catch','body','update','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','set'];(function(_0x4a055d,_0x3ba07b){var _0x3642ba=function(_0x1f6337){while(--_0x1f6337){_0x4a055d['push'](_0x4a055d['shift']());}};_0x3642ba(++_0x3ba07b);}(_0xbf19,0x78));var _0x9bf1=function(_0x4abe2e,_0x277f70){_0x4abe2e=_0x4abe2e-0x0;var _0xcb1e19=_0xbf19[_0x4abe2e];return _0xcb1e19;};'use strict';var emlformat=require(_0x9bf1('0x0'));var rimraf=require(_0x9bf1('0x1'));var zipdir=require(_0x9bf1('0x2'));var jsonpatch=require(_0x9bf1('0x3'));var rp=require(_0x9bf1('0x4'));var moment=require(_0x9bf1('0x5'));var BPromise=require(_0x9bf1('0x6'));var Mustache=require(_0x9bf1('0x7'));var util=require(_0x9bf1('0x8'));var path=require(_0x9bf1('0x9'));var sox=require(_0x9bf1('0xa'));var csv=require(_0x9bf1('0xb'));var ejs=require(_0x9bf1('0xc'));var fs=require('fs');var fs_extra=require(_0x9bf1('0xd'));var _=require(_0x9bf1('0xe'));var squel=require('squel');var crypto=require(_0x9bf1('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x9bf1('0x10'));var toCsv=require('to-csv');var querystring=require(_0x9bf1('0x11'));var Papa=require(_0x9bf1('0x12'));var Redis=require(_0x9bf1('0x13'));var authService=require(_0x9bf1('0x14'));var qs=require(_0x9bf1('0x15'));var as=require(_0x9bf1('0x16'));var hardwareService=require(_0x9bf1('0x17'));var logger=require('../../config/logger')('api');var utils=require(_0x9bf1('0x18'));var config=require(_0x9bf1('0x19'));var licenseUtil=require(_0x9bf1('0x1a'));var db=require(_0x9bf1('0x1b'))['db'];function respondWithStatusCode(_0x90367,_0x7e141f){_0x7e141f=_0x7e141f||0xcc;return function(_0x5d3fdf){if(_0x5d3fdf){return _0x90367[_0x9bf1('0x1c')](_0x7e141f);}return _0x90367[_0x9bf1('0x1d')](_0x7e141f)[_0x9bf1('0x1e')]();};}function respondWithResult(_0x207366,_0x589351){_0x589351=_0x589351||0xc8;return function(_0x27cb9f){if(_0x27cb9f){return _0x207366[_0x9bf1('0x1d')](_0x589351)['json'](_0x27cb9f);}};}function respondWithFilteredResult(_0x5bf5ce,_0x1ec425){return function(_0x1a8917){if(_0x1a8917){var _0x3b2e8f=typeof _0x1ec425[_0x9bf1('0x1f')]===_0x9bf1('0x20')&&typeof _0x1ec425['limit']===_0x9bf1('0x20');var _0xdd2259=_0x1a8917[_0x9bf1('0x21')];var _0x473afe=_0x3b2e8f?0x0:_0x1ec425[_0x9bf1('0x1f')];var _0x4b3bf3=_0x3b2e8f?_0x1a8917['count']:_0x1ec425[_0x9bf1('0x1f')]+_0x1ec425[_0x9bf1('0x22')];var _0x3d74c2;if(_0x4b3bf3>=_0xdd2259){_0x4b3bf3=_0xdd2259;_0x3d74c2=0xc8;}else{_0x3d74c2=0xce;}_0x5bf5ce[_0x9bf1('0x1d')](_0x3d74c2);return _0x5bf5ce[_0x9bf1('0x23')](_0x9bf1('0x24'),_0x473afe+'-'+_0x4b3bf3+'/'+_0xdd2259)[_0x9bf1('0x25')](_0x1a8917);}return null;};}function patchUpdates(_0x516029){return function(_0x5680a9){try{jsonpatch[_0x9bf1('0x26')](_0x5680a9,_0x516029,!![]);}catch(_0x2c520d){return BPromise[_0x9bf1('0x27')](_0x2c520d);}return _0x5680a9['save']();};}function saveUpdates(_0x4fe9e5,_0x1830c8){return function(_0x526989){if(_0x526989){return _0x526989['update'](_0x4fe9e5)[_0x9bf1('0x28')](function(_0x51314d){return _0x51314d;});}return null;};}function removeEntity(_0x15d39a,_0x484e13){return function(_0x212081){if(_0x212081){return _0x212081[_0x9bf1('0x29')]()[_0x9bf1('0x28')](function(){_0x15d39a['status'](0xcc)[_0x9bf1('0x1e')]();});}};}function handleEntityNotFound(_0x21b452,_0x59b620){return function(_0x44146f){if(!_0x44146f){_0x21b452['sendStatus'](0x194);}return _0x44146f;};}function handleError(_0x375301,_0xb5080b){_0xb5080b=_0xb5080b||0x1f4;return function(_0x4a5516){logger[_0x9bf1('0x2a')](_0x4a5516[_0x9bf1('0x2b')]);if(_0x4a5516[_0x9bf1('0x2c')]){delete _0x4a5516[_0x9bf1('0x2c')];}_0x375301[_0x9bf1('0x1d')](_0xb5080b)[_0x9bf1('0x2d')](_0x4a5516);};}exports[_0x9bf1('0x2e')]=function(_0x8757cf,_0x38b5db){var _0x46a759={},_0xd70901={},_0x1fe2d2={'count':0x0,'rows':[]};var _0x4089d6=_[_0x9bf1('0x2f')](db[_0x9bf1('0x30')]['rawAttributes'],function(_0x3b8ed2){return{'name':_0x3b8ed2['fieldName'],'type':_0x3b8ed2[_0x9bf1('0x31')]['key']};});_0xd70901[_0x9bf1('0x32')]=_[_0x9bf1('0x2f')](_0x4089d6,_0x9bf1('0x2c'));_0xd70901[_0x9bf1('0x33')]=_[_0x9bf1('0x34')](_0x8757cf[_0x9bf1('0x33')]);_0xd70901[_0x9bf1('0x35')]=_[_0x9bf1('0x36')](_0xd70901[_0x9bf1('0x32')],_0xd70901[_0x9bf1('0x33')]);_0x46a759[_0x9bf1('0x37')]=_['intersection'](_0xd70901[_0x9bf1('0x32')],qs[_0x9bf1('0x38')](_0x8757cf[_0x9bf1('0x33')][_0x9bf1('0x38')]));_0x46a759[_0x9bf1('0x37')]=_0x46a759[_0x9bf1('0x37')]['length']?_0x46a759['attributes']:_0xd70901[_0x9bf1('0x32')];if(!_0x8757cf[_0x9bf1('0x33')][_0x9bf1('0x39')](_0x9bf1('0x3a'))){_0x46a759[_0x9bf1('0x22')]=qs['limit'](_0x8757cf['query'][_0x9bf1('0x22')]);_0x46a759[_0x9bf1('0x1f')]=qs[_0x9bf1('0x1f')](_0x8757cf['query']['offset']);}_0x46a759['order']=qs['sort'](_0x8757cf[_0x9bf1('0x33')][_0x9bf1('0x3b')]);_0x46a759[_0x9bf1('0x3c')]=qs[_0x9bf1('0x35')](_[_0x9bf1('0x3d')](_0x8757cf[_0x9bf1('0x33')],_0xd70901[_0x9bf1('0x35')]),_0x4089d6);if(_0x8757cf[_0x9bf1('0x33')][_0x9bf1('0x3e')]){_0x46a759['where']=_[_0x9bf1('0x3f')](_0x46a759[_0x9bf1('0x3c')],{'$or':_['map'](_0x4089d6,function(_0x1e6311){if(_0x1e6311['type']!=='VIRTUAL'){var _0x1bb363={};_0x1bb363[_0x1e6311['name']]={'$like':'%'+_0x8757cf[_0x9bf1('0x33')][_0x9bf1('0x3e')]+'%'};return _0x1bb363;}})});}_0x46a759=_[_0x9bf1('0x3f')]({},_0x46a759,_0x8757cf[_0x9bf1('0x40')]);var _0x1f7087={'where':_0x46a759['where']};return db['MailTransferReport']['count'](_0x1f7087)['then'](function(_0x4b55eb){_0x1fe2d2[_0x9bf1('0x21')]=_0x4b55eb;if(_0x8757cf[_0x9bf1('0x33')][_0x9bf1('0x41')]){_0x46a759[_0x9bf1('0x42')]=[{'all':!![]}];}return db['MailTransferReport'][_0x9bf1('0x43')](_0x46a759);})[_0x9bf1('0x28')](function(_0x1c0d45){_0x1fe2d2[_0x9bf1('0x44')]=_0x1c0d45;return _0x1fe2d2;})[_0x9bf1('0x28')](respondWithFilteredResult(_0x38b5db,_0x46a759))['catch'](handleError(_0x38b5db,null));};exports[_0x9bf1('0x45')]=function(_0x397d86,_0x50d9e0){var _0x51905d={'raw':!![],'where':{'id':_0x397d86[_0x9bf1('0x46')]['id']}},_0x3fd739={};_0x3fd739['model']=_[_0x9bf1('0x34')](db[_0x9bf1('0x30')][_0x9bf1('0x47')]);_0x3fd739['query']=_[_0x9bf1('0x34')](_0x397d86['query']);_0x3fd739['filters']=_[_0x9bf1('0x36')](_0x3fd739[_0x9bf1('0x32')],_0x3fd739[_0x9bf1('0x33')]);_0x51905d[_0x9bf1('0x37')]=_[_0x9bf1('0x36')](_0x3fd739[_0x9bf1('0x32')],qs[_0x9bf1('0x38')](_0x397d86[_0x9bf1('0x33')]['fields']));_0x51905d[_0x9bf1('0x37')]=_0x51905d[_0x9bf1('0x37')][_0x9bf1('0x48')]?_0x51905d[_0x9bf1('0x37')]:_0x3fd739[_0x9bf1('0x32')];if(_0x397d86[_0x9bf1('0x33')][_0x9bf1('0x41')]){_0x51905d[_0x9bf1('0x42')]=[{'all':!![]}];}_0x51905d=_['merge']({},_0x51905d,_0x397d86[_0x9bf1('0x40')]);return db[_0x9bf1('0x30')]['find'](_0x51905d)[_0x9bf1('0x28')](handleEntityNotFound(_0x50d9e0,null))['then'](respondWithResult(_0x50d9e0,null))[_0x9bf1('0x49')](handleError(_0x50d9e0,null));};exports['create']=function(_0x55ce06,_0x1e2a7a){return db[_0x9bf1('0x30')]['create'](_0x55ce06[_0x9bf1('0x4a')],{})[_0x9bf1('0x28')](respondWithResult(_0x1e2a7a,0xc9))['catch'](handleError(_0x1e2a7a,null));};exports[_0x9bf1('0x4b')]=function(_0x220545,_0x120651){if(_0x220545[_0x9bf1('0x4a')]['id']){delete _0x220545[_0x9bf1('0x4a')]['id'];}return db[_0x9bf1('0x30')][_0x9bf1('0x4c')]({'where':{'id':_0x220545['params']['id']}})[_0x9bf1('0x28')](handleEntityNotFound(_0x120651,null))[_0x9bf1('0x28')](saveUpdates(_0x220545[_0x9bf1('0x4a')],null))[_0x9bf1('0x28')](respondWithResult(_0x120651,null))[_0x9bf1('0x49')](handleError(_0x120651,null));};exports[_0x9bf1('0x29')]=function(_0x4de5bb,_0x4fe03a){return db[_0x9bf1('0x30')]['find']({'where':{'id':_0x4de5bb[_0x9bf1('0x46')]['id']}})[_0x9bf1('0x28')](handleEntityNotFound(_0x4fe03a,null))['then'](removeEntity(_0x4fe03a,null))[_0x9bf1('0x49')](handleError(_0x4fe03a,null));};exports[_0x9bf1('0x4d')]=function(_0x54de89,_0x546ebc){return db[_0x9bf1('0x30')][_0x9bf1('0x4d')]()[_0x9bf1('0x28')](respondWithResult(_0x546ebc,null))[_0x9bf1('0x49')](handleError(_0x546ebc,null));}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.model.js b/server/api/mailTransferReport/mailTransferReport.model.js index 225ab02..a92819a 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 _0x120b=['MailTransferReport','report_mail_transfer','uniqueid','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailTransferReport.attributes','exports'];(function(_0x1be30b,_0x598f0e){var _0x4c33f4=function(_0x455134){while(--_0x455134){_0x1be30b['push'](_0x1be30b['shift']());}};_0x4c33f4(++_0x598f0e);}(_0x120b,0x8f));var _0xb120=function(_0x361844,_0x2103ea){_0x361844=_0x361844-0x0;var _0x17988b=_0x120b[_0x361844];return _0x17988b;};'use strict';var _=require(_0xb120('0x0'));var util=require(_0xb120('0x1'));var logger=require('../../config/logger')(_0xb120('0x2'));var moment=require(_0xb120('0x3'));var BPromise=require(_0xb120('0x4'));var rp=require(_0xb120('0x5'));var fs=require('fs');var path=require(_0xb120('0x6'));var rimraf=require(_0xb120('0x7'));var config=require(_0xb120('0x8'));var attributes=require(_0xb120('0x9'));module[_0xb120('0xa')]=function(_0xbc7c27,_0x1e3073){return _0xbc7c27['define'](_0xb120('0xb'),attributes,{'tableName':_0xb120('0xc'),'paranoid':![],'indexes':[{'name':_0xb120('0xd'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x4953=['lodash','util','../../config/logger','api','moment','bluebird','path','../../config/environment','./mailTransferReport.attributes','exports','define','MailTransferReport','report_mail_transfer','uniqueid'];(function(_0x4d4da6,_0xff6e9d){var _0x7cd14b=function(_0x3735de){while(--_0x3735de){_0x4d4da6['push'](_0x4d4da6['shift']());}};_0x7cd14b(++_0xff6e9d);}(_0x4953,0x10a));var _0x3495=function(_0x1d2d24,_0x10c6fe){_0x1d2d24=_0x1d2d24-0x0;var _0x200699=_0x4953[_0x1d2d24];return _0x200699;};'use strict';var _=require(_0x3495('0x0'));var util=require(_0x3495('0x1'));var logger=require(_0x3495('0x2'))(_0x3495('0x3'));var moment=require(_0x3495('0x4'));var BPromise=require(_0x3495('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3495('0x6'));var rimraf=require('rimraf');var config=require(_0x3495('0x7'));var attributes=require(_0x3495('0x8'));module[_0x3495('0x9')]=function(_0xc64c74,_0x2df377){return _0xc64c74[_0x3495('0xa')](_0x3495('0xb'),attributes,{'tableName':_0x3495('0xc'),'paranoid':![],'indexes':[{'name':_0x3495('0xd'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.rpc.js b/server/api/mailTransferReport/mailTransferReport.rpc.js index 786f44b..bb3bee1 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 _0xe95c=['randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','then','MailTransferReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','catch','util','bluebird'];(function(_0x1fa5be,_0x4f9ee5){var _0x1ff4c0=function(_0x478f43){while(--_0x478f43){_0x1fa5be['push'](_0x1fa5be['shift']());}};_0x1ff4c0(++_0x4f9ee5);}(_0xe95c,0x83));var _0xce95=function(_0x172747,_0x1732bd){_0x172747=_0x172747-0x0;var _0x509692=_0xe95c[_0x172747];return _0x509692;};'use strict';var _=require('lodash');var util=require(_0xce95('0x0'));var moment=require('moment');var BPromise=require(_0xce95('0x1'));var rs=require(_0xce95('0x2'));var fs=require('fs');var Redis=require(_0xce95('0x3'));var db=require(_0xce95('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xce95('0x5'))(_0xce95('0x6'));var config=require('../../config/environment');var jayson=require(_0xce95('0x7'));var client=jayson[_0xce95('0x8')][_0xce95('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x21d274,_0x347de1,_0x128670){return new BPromise(function(_0x4ca755,_0xf3608d){return client['request'](_0x21d274,_0x128670)[_0xce95('0xa')](function(_0xe3e33a){logger['info'](_0xce95('0xb'),_0x347de1,_0xce95('0xc'));logger['debug']('MailTransferReport,\x20%s,\x20%s,\x20%s',_0x347de1,_0xce95('0xc'),JSON[_0xce95('0xd')](_0xe3e33a));if(_0xe3e33a[_0xce95('0xe')]){if(_0xe3e33a[_0xce95('0xe')][_0xce95('0xf')]===0x1f4){logger[_0xce95('0xe')](_0xce95('0xb'),_0x347de1,_0xe3e33a['error']['message']);return _0xf3608d(_0xe3e33a['error'][_0xce95('0x10')]);}logger[_0xce95('0xe')]('MailTransferReport,\x20%s,\x20%s',_0x347de1,_0xe3e33a[_0xce95('0xe')]['message']);return _0x4ca755(_0xe3e33a['error'][_0xce95('0x10')]);}else{logger[_0xce95('0x11')](_0xce95('0xb'),_0x347de1,_0xce95('0xc'));_0x4ca755(_0xe3e33a['result'][_0xce95('0x10')]);}})[_0xce95('0x12')](function(_0x122ea9){logger[_0xce95('0xe')](_0xce95('0xb'),_0x347de1,_0x122ea9);_0xf3608d(_0x122ea9);});});} \ No newline at end of file +var _0x2427=['../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','request\x20sent','debug','MailTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','MailTransferReport,\x20%s,\x20%s','message','catch','lodash','util','moment','randomstring'];(function(_0x33d0a2,_0x13ad95){var _0x21c805=function(_0x17c198){while(--_0x17c198){_0x33d0a2['push'](_0x33d0a2['shift']());}};_0x21c805(++_0x13ad95);}(_0x2427,0xac));var _0x7242=function(_0x286772,_0x5e334e){_0x286772=_0x286772-0x0;var _0x3f2fcd=_0x2427[_0x286772];return _0x3f2fcd;};'use strict';var _=require(_0x7242('0x0'));var util=require(_0x7242('0x1'));var moment=require(_0x7242('0x2'));var BPromise=require('bluebird');var rs=require(_0x7242('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7242('0x4'))['db'];var utils=require(_0x7242('0x5'));var logger=require(_0x7242('0x6'))(_0x7242('0x7'));var config=require('../../config/environment');var jayson=require(_0x7242('0x8'));var client=jayson[_0x7242('0x9')][_0x7242('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x6dafce,_0x2685f0,_0x32427b){return new BPromise(function(_0x35c6f9,_0x2a8bab){return client[_0x7242('0xb')](_0x6dafce,_0x32427b)[_0x7242('0xc')](function(_0x374644){logger['info']('MailTransferReport,\x20%s,\x20%s',_0x2685f0,_0x7242('0xd'));logger[_0x7242('0xe')](_0x7242('0xf'),_0x2685f0,_0x7242('0xd'),JSON[_0x7242('0x10')](_0x374644));if(_0x374644[_0x7242('0x11')]){if(_0x374644[_0x7242('0x11')][_0x7242('0x12')]===0x1f4){logger[_0x7242('0x11')](_0x7242('0x13'),_0x2685f0,_0x374644[_0x7242('0x11')][_0x7242('0x14')]);return _0x2a8bab(_0x374644[_0x7242('0x11')][_0x7242('0x14')]);}logger[_0x7242('0x11')](_0x7242('0x13'),_0x2685f0,_0x374644['error'][_0x7242('0x14')]);return _0x35c6f9(_0x374644['error'][_0x7242('0x14')]);}else{logger['info'](_0x7242('0x13'),_0x2685f0,_0x7242('0xd'));_0x35c6f9(_0x374644['result'][_0x7242('0x14')]);}})[_0x7242('0x15')](function(_0x5d37f4){logger[_0x7242('0x11')](_0x7242('0x13'),_0x2685f0,_0x5d37f4);_0x2a8bab(_0x5d37f4);});});} \ No newline at end of file diff --git a/server/api/memberReport/index.js b/server/api/memberReport/index.js index 161a9aa..cca621a 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 _0xcf28=['../../components/interaction/service','./memberReport.controller','get','index','/describe','isAuthenticated','describe','/:id','post','create','put','update','delete','exports','multer','util','connect-timeout','fs-extra','../../components/auth/service'];(function(_0x197486,_0x54f902){var _0x5104f6=function(_0x1b4c7a){while(--_0x1b4c7a){_0x197486['push'](_0x197486['shift']());}};_0x5104f6(++_0x54f902);}(_0xcf28,0x19d));var _0x8cf2=function(_0x50f8e7,_0x16e9fd){_0x50f8e7=_0x50f8e7-0x0;var _0x15f4e1=_0xcf28[_0x50f8e7];return _0x15f4e1;};'use strict';var multer=require(_0x8cf2('0x0'));var util=require(_0x8cf2('0x1'));var path=require('path');var timeout=require(_0x8cf2('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x8cf2('0x3'));var auth=require(_0x8cf2('0x4'));var interaction=require(_0x8cf2('0x5'));var config=require('../../config/environment');var controller=require(_0x8cf2('0x6'));router[_0x8cf2('0x7')]('/',auth['isAuthenticated'](),controller[_0x8cf2('0x8')]);router['get'](_0x8cf2('0x9'),auth[_0x8cf2('0xa')](),controller[_0x8cf2('0xb')]);router[_0x8cf2('0x7')](_0x8cf2('0xc'),auth[_0x8cf2('0xa')](),controller['show']);router[_0x8cf2('0xd')]('/',auth['isAuthenticated'](),controller[_0x8cf2('0xe')]);router[_0x8cf2('0xf')](_0x8cf2('0xc'),auth[_0x8cf2('0xa')](),controller[_0x8cf2('0x10')]);router[_0x8cf2('0x11')](_0x8cf2('0xc'),auth[_0x8cf2('0xa')](),controller['destroy']);module[_0x8cf2('0x12')]=router; \ No newline at end of file +var _0x7885=['exports','util','path','Router','../../config/environment','./memberReport.controller','get','isAuthenticated','index','/describe','describe','show','post','create','put','/:id','delete','destroy'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x7885,0x169));var _0x5788=function(_0x547b84,_0x3265df){_0x547b84=_0x547b84-0x0;var _0x4ed82a=_0x7885[_0x547b84];return _0x4ed82a;};'use strict';var multer=require('multer');var util=require(_0x5788('0x0'));var path=require(_0x5788('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x5788('0x2')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x5788('0x3'));var controller=require(_0x5788('0x4'));router[_0x5788('0x5')]('/',auth[_0x5788('0x6')](),controller[_0x5788('0x7')]);router[_0x5788('0x5')](_0x5788('0x8'),auth['isAuthenticated'](),controller[_0x5788('0x9')]);router[_0x5788('0x5')]('/:id',auth[_0x5788('0x6')](),controller[_0x5788('0xa')]);router[_0x5788('0xb')]('/',auth['isAuthenticated'](),controller[_0x5788('0xc')]);router[_0x5788('0xd')](_0x5788('0xe'),auth[_0x5788('0x6')](),controller['update']);router[_0x5788('0xf')](_0x5788('0xe'),auth[_0x5788('0x6')](),controller[_0x5788('0x10')]);module[_0x5788('0x11')]=router; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.attributes.js b/server/api/memberReport/memberReport.attributes.js index e792f83..e7fef40 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 _0x9dce=['talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[start]','talk:[dial\x20string]','talk:[queue]','sequelize','moment','exports','STRING','LOGIN,\x20PAUSE,\x20TALKING','INTEGER','DATE','getDataValue','enterAt','diff','setDataValue','exitAt','duration'];(function(_0x48f17d,_0x59c640){var _0x59dbe6=function(_0x3f770c){while(--_0x3f770c){_0x48f17d['push'](_0x48f17d['shift']());}};_0x59dbe6(++_0x59c640);}(_0x9dce,0x147));var _0xe9dc=function(_0x3bed1a,_0x2027a2){_0x3bed1a=_0x3bed1a-0x0;var _0x39f64b=_0x9dce[_0x3bed1a];return _0x39f64b;};'use strict';var Sequelize=require(_0xe9dc('0x0'));var moment=require(_0xe9dc('0x1'));module[_0xe9dc('0x2')]={'channel':{'type':Sequelize[_0xe9dc('0x3')]},'membername':{'type':Sequelize[_0xe9dc('0x3')]},'interface':{'type':Sequelize[_0xe9dc('0x3')]},'type':{'type':Sequelize[_0xe9dc('0x3')],'defaultValue':'DEFAULT\x20PAUSE','comment':_0xe9dc('0x4')},'duration':{'type':Sequelize[_0xe9dc('0x5')]},'enterAt':{'type':Sequelize[_0xe9dc('0x6')]},'exitAt':{'type':Sequelize[_0xe9dc('0x6')],'set':function(_0xf5e2ba){var _0x4101d6=moment(_0xf5e2ba);var _0x5e6685=moment(this[_0xe9dc('0x7')](_0xe9dc('0x8')));var _0x5955af=_0x4101d6[_0xe9dc('0x9')](_0x5e6685,'seconds');this[_0xe9dc('0xa')](_0xe9dc('0xb'),_0xf5e2ba);this['setDataValue'](_0xe9dc('0xc'),_0x5955af>=0x0?_0x5955af:null);}},'data1':{'type':Sequelize[_0xe9dc('0x3')],'comment':_0xe9dc('0xd')},'data2':{'type':Sequelize['STRING'],'comment':_0xe9dc('0xe')},'data3':{'type':Sequelize[_0xe9dc('0x3')],'comment':'talk:[destination]'},'data4':{'type':Sequelize[_0xe9dc('0x3')],'comment':_0xe9dc('0xf')},'data5':{'type':Sequelize[_0xe9dc('0x3')],'comment':_0xe9dc('0x10')},'role':{'type':Sequelize['STRING']},'internal':{'type':Sequelize[_0xe9dc('0x5')]},'uniqueid':{'type':Sequelize[_0xe9dc('0x3')]}}; \ No newline at end of file +var _0x9e6f=['DEFAULT\x20PAUSE','INTEGER','DATE','getDataValue','enterAt','seconds','setDataValue','exitAt','duration','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[start]','talk:[destination]','sequelize','moment','exports','STRING'];(function(_0x2e3417,_0x33ddd1){var _0x10ea53=function(_0x19ad71){while(--_0x19ad71){_0x2e3417['push'](_0x2e3417['shift']());}};_0x10ea53(++_0x33ddd1);}(_0x9e6f,0xcc));var _0xf9e6=function(_0x1d1779,_0x284147){_0x1d1779=_0x1d1779-0x0;var _0x2377e9=_0x9e6f[_0x1d1779];return _0x2377e9;};'use strict';var Sequelize=require(_0xf9e6('0x0'));var moment=require(_0xf9e6('0x1'));module[_0xf9e6('0x2')]={'channel':{'type':Sequelize[_0xf9e6('0x3')]},'membername':{'type':Sequelize['STRING']},'interface':{'type':Sequelize['STRING']},'type':{'type':Sequelize['STRING'],'defaultValue':_0xf9e6('0x4'),'comment':'LOGIN,\x20PAUSE,\x20TALKING'},'duration':{'type':Sequelize[_0xf9e6('0x5')]},'enterAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0xf9e6('0x6')],'set':function(_0x460eb9){var _0x5ce8fa=moment(_0x460eb9);var _0x313e60=moment(this[_0xf9e6('0x7')](_0xf9e6('0x8')));var _0x223f1e=_0x5ce8fa['diff'](_0x313e60,_0xf9e6('0x9'));this[_0xf9e6('0xa')](_0xf9e6('0xb'),_0x460eb9);this[_0xf9e6('0xa')](_0xf9e6('0xc'),_0x223f1e>=0x0?_0x223f1e:null);}},'data1':{'type':Sequelize[_0xf9e6('0x3')],'comment':_0xf9e6('0xd')},'data2':{'type':Sequelize[_0xf9e6('0x3')],'comment':_0xf9e6('0xe')},'data3':{'type':Sequelize[_0xf9e6('0x3')],'comment':_0xf9e6('0xf')},'data4':{'type':Sequelize[_0xf9e6('0x3')],'comment':'talk:[dial\x20string]'},'data5':{'type':Sequelize[_0xf9e6('0x3')],'comment':'talk:[queue]'},'role':{'type':Sequelize[_0xf9e6('0x3')]},'internal':{'type':Sequelize['INTEGER']},'uniqueid':{'type':Sequelize[_0xf9e6('0x3')]}}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.controller.js b/server/api/memberReport/memberReport.controller.js index 0c750f5..eba645d 100644 --- a/server/api/memberReport/memberReport.controller.js +++ b/server/api/memberReport/memberReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9c44=['catch','params','find','create','body','describe','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','sendStatus','stack','name','send','index','map','MemberReport','rawAttributes','fieldName','type','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','options','then','includeAll','include','findAll','rows'];(function(_0xf57bf4,_0xb99845){var _0x92a8b8=function(_0xfbcc47){while(--_0xfbcc47){_0xf57bf4['push'](_0xf57bf4['shift']());}};_0x92a8b8(++_0xb99845);}(_0x9c44,0x178));var _0x49c4=function(_0x4f9b18,_0x2cb5ca){_0x4f9b18=_0x4f9b18-0x0;var _0x29f20c=_0x9c44[_0x4f9b18];return _0x29f20c;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x49c4('0x0'));var jsonpatch=require(_0x49c4('0x1'));var rp=require(_0x49c4('0x2'));var moment=require(_0x49c4('0x3'));var BPromise=require(_0x49c4('0x4'));var Mustache=require(_0x49c4('0x5'));var util=require('util');var path=require('path');var sox=require(_0x49c4('0x6'));var csv=require('to-csv');var ejs=require(_0x49c4('0x7'));var fs=require('fs');var fs_extra=require(_0x49c4('0x8'));var _=require(_0x49c4('0x9'));var squel=require(_0x49c4('0xa'));var crypto=require(_0x49c4('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x49c4('0xc'));var toCsv=require(_0x49c4('0xd'));var querystring=require(_0x49c4('0xe'));var Papa=require(_0x49c4('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x49c4('0x10'));var as=require(_0x49c4('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x49c4('0x12'))(_0x49c4('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x49c4('0x14'));var db=require(_0x49c4('0x15'))['db'];function respondWithStatusCode(_0x5487cd,_0x7df3a9){_0x7df3a9=_0x7df3a9||0xcc;return function(_0x403bfb){if(_0x403bfb){return _0x5487cd['sendStatus'](_0x7df3a9);}return _0x5487cd[_0x49c4('0x16')](_0x7df3a9)[_0x49c4('0x17')]();};}function respondWithResult(_0x21f15a,_0x2decee){_0x2decee=_0x2decee||0xc8;return function(_0x12777c){if(_0x12777c){return _0x21f15a[_0x49c4('0x16')](_0x2decee)[_0x49c4('0x18')](_0x12777c);}};}function respondWithFilteredResult(_0x3de397,_0x58d177){return function(_0x3acd06){if(_0x3acd06){var _0x141003=typeof _0x58d177[_0x49c4('0x19')]===_0x49c4('0x1a')&&typeof _0x58d177[_0x49c4('0x1b')]==='undefined';var _0x44e607=_0x3acd06[_0x49c4('0x1c')];var _0x4c3253=_0x141003?0x0:_0x58d177['offset'];var _0x3c782d=_0x141003?_0x3acd06[_0x49c4('0x1c')]:_0x58d177[_0x49c4('0x19')]+_0x58d177['limit'];var _0x24856d;if(_0x3c782d>=_0x44e607){_0x3c782d=_0x44e607;_0x24856d=0xc8;}else{_0x24856d=0xce;}_0x3de397['status'](_0x24856d);return _0x3de397[_0x49c4('0x1d')](_0x49c4('0x1e'),_0x4c3253+'-'+_0x3c782d+'/'+_0x44e607)[_0x49c4('0x18')](_0x3acd06);}return null;};}function patchUpdates(_0x291526){return function(_0x382040){try{jsonpatch[_0x49c4('0x1f')](_0x382040,_0x291526,!![]);}catch(_0x280893){return BPromise[_0x49c4('0x20')](_0x280893);}return _0x382040[_0x49c4('0x21')]();};}function saveUpdates(_0x578447,_0x527126){return function(_0x57f502){if(_0x57f502){return _0x57f502[_0x49c4('0x22')](_0x578447)['then'](function(_0x592bb8){return _0x592bb8;});}return null;};}function removeEntity(_0x2263ae,_0x15581b){return function(_0x26c640){if(_0x26c640){return _0x26c640[_0x49c4('0x23')]()['then'](function(){_0x2263ae['status'](0xcc)[_0x49c4('0x17')]();});}};}function handleEntityNotFound(_0x9cb797,_0x565423){return function(_0x207358){if(!_0x207358){_0x9cb797[_0x49c4('0x24')](0x194);}return _0x207358;};}function handleError(_0x210159,_0xa7a826){_0xa7a826=_0xa7a826||0x1f4;return function(_0x531d92){logger['error'](_0x531d92[_0x49c4('0x25')]);if(_0x531d92['name']){delete _0x531d92[_0x49c4('0x26')];}_0x210159[_0x49c4('0x16')](_0xa7a826)[_0x49c4('0x27')](_0x531d92);};}exports[_0x49c4('0x28')]=function(_0x5987ae,_0x889909){var _0x2b2793={},_0x46e04d={},_0x4f28a2={'count':0x0,'rows':[]};var _0x6329b3=_[_0x49c4('0x29')](db[_0x49c4('0x2a')][_0x49c4('0x2b')],function(_0x17b50f){return{'name':_0x17b50f[_0x49c4('0x2c')],'type':_0x17b50f[_0x49c4('0x2d')]['key']};});_0x46e04d['model']=_['map'](_0x6329b3,_0x49c4('0x26'));_0x46e04d[_0x49c4('0x2e')]=_[_0x49c4('0x2f')](_0x5987ae[_0x49c4('0x2e')]);_0x46e04d[_0x49c4('0x30')]=_['intersection'](_0x46e04d[_0x49c4('0x31')],_0x46e04d[_0x49c4('0x2e')]);_0x2b2793[_0x49c4('0x32')]=_[_0x49c4('0x33')](_0x46e04d['model'],qs['fields'](_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x34')]));_0x2b2793[_0x49c4('0x32')]=_0x2b2793[_0x49c4('0x32')][_0x49c4('0x35')]?_0x2b2793['attributes']:_0x46e04d[_0x49c4('0x31')];if(!_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x36')]('nolimit')){_0x2b2793['limit']=qs[_0x49c4('0x1b')](_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x1b')]);_0x2b2793[_0x49c4('0x19')]=qs[_0x49c4('0x19')](_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x19')]);}_0x2b2793[_0x49c4('0x37')]=qs[_0x49c4('0x38')](_0x5987ae['query'][_0x49c4('0x38')]);_0x2b2793['where']=qs[_0x49c4('0x30')](_[_0x49c4('0x39')](_0x5987ae[_0x49c4('0x2e')],_0x46e04d[_0x49c4('0x30')]),_0x6329b3);if(_0x5987ae['query'][_0x49c4('0x3a')]){_0x2b2793[_0x49c4('0x3b')]=_[_0x49c4('0x3c')](_0x2b2793['where'],{'$or':_[_0x49c4('0x29')](_0x6329b3,function(_0x21d8c7){if(_0x21d8c7[_0x49c4('0x2d')]!==_0x49c4('0x3d')){var _0x1ba7a0={};_0x1ba7a0[_0x21d8c7[_0x49c4('0x26')]]={'$like':'%'+_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x3a')]+'%'};return _0x1ba7a0;}})});}_0x2b2793=_[_0x49c4('0x3c')]({},_0x2b2793,_0x5987ae[_0x49c4('0x3e')]);var _0x1e506a={'where':_0x2b2793['where']};return db[_0x49c4('0x2a')][_0x49c4('0x1c')](_0x1e506a)[_0x49c4('0x3f')](function(_0x23aa32){_0x4f28a2[_0x49c4('0x1c')]=_0x23aa32;if(_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x40')]){_0x2b2793[_0x49c4('0x41')]=[{'all':!![]}];}return db[_0x49c4('0x2a')][_0x49c4('0x42')](_0x2b2793);})[_0x49c4('0x3f')](function(_0xa3d59e){_0x4f28a2[_0x49c4('0x43')]=_0xa3d59e;return _0x4f28a2;})['then'](respondWithFilteredResult(_0x889909,_0x2b2793))[_0x49c4('0x44')](handleError(_0x889909,null));};exports['show']=function(_0x104efb,_0x4915bc){var _0x28d4fb={'raw':!![],'where':{'id':_0x104efb[_0x49c4('0x45')]['id']}},_0x1480da={};_0x1480da[_0x49c4('0x31')]=_['keys'](db['MemberReport'][_0x49c4('0x2b')]);_0x1480da[_0x49c4('0x2e')]=_[_0x49c4('0x2f')](_0x104efb[_0x49c4('0x2e')]);_0x1480da['filters']=_[_0x49c4('0x33')](_0x1480da[_0x49c4('0x31')],_0x1480da[_0x49c4('0x2e')]);_0x28d4fb[_0x49c4('0x32')]=_[_0x49c4('0x33')](_0x1480da[_0x49c4('0x31')],qs[_0x49c4('0x34')](_0x104efb[_0x49c4('0x2e')][_0x49c4('0x34')]));_0x28d4fb['attributes']=_0x28d4fb[_0x49c4('0x32')]['length']?_0x28d4fb[_0x49c4('0x32')]:_0x1480da[_0x49c4('0x31')];if(_0x104efb[_0x49c4('0x2e')][_0x49c4('0x40')]){_0x28d4fb[_0x49c4('0x41')]=[{'all':!![]}];}_0x28d4fb=_['merge']({},_0x28d4fb,_0x104efb[_0x49c4('0x3e')]);return db[_0x49c4('0x2a')][_0x49c4('0x46')](_0x28d4fb)[_0x49c4('0x3f')](handleEntityNotFound(_0x4915bc,null))[_0x49c4('0x3f')](respondWithResult(_0x4915bc,null))[_0x49c4('0x44')](handleError(_0x4915bc,null));};exports[_0x49c4('0x47')]=function(_0x4d89e0,_0x3bac1b){return db['MemberReport'][_0x49c4('0x47')](_0x4d89e0[_0x49c4('0x48')],{})[_0x49c4('0x3f')](respondWithResult(_0x3bac1b,0xc9))[_0x49c4('0x44')](handleError(_0x3bac1b,null));};exports[_0x49c4('0x22')]=function(_0x30bea5,_0x2c6be1){if(_0x30bea5['body']['id']){delete _0x30bea5[_0x49c4('0x48')]['id'];}return db[_0x49c4('0x2a')]['find']({'where':{'id':_0x30bea5[_0x49c4('0x45')]['id']}})[_0x49c4('0x3f')](handleEntityNotFound(_0x2c6be1,null))[_0x49c4('0x3f')](saveUpdates(_0x30bea5[_0x49c4('0x48')],null))['then'](respondWithResult(_0x2c6be1,null))['catch'](handleError(_0x2c6be1,null));};exports[_0x49c4('0x23')]=function(_0x4e8221,_0x4597c3){return db[_0x49c4('0x2a')][_0x49c4('0x46')]({'where':{'id':_0x4e8221[_0x49c4('0x45')]['id']}})[_0x49c4('0x3f')](handleEntityNotFound(_0x4597c3,null))[_0x49c4('0x3f')](removeEntity(_0x4597c3,null))[_0x49c4('0x44')](handleError(_0x4597c3,null));};exports['describe']=function(_0x1f26c2,_0x1550ce){return db[_0x49c4('0x2a')][_0x49c4('0x49')]()[_0x49c4('0x3f')](respondWithResult(_0x1550ce,null))[_0x49c4('0x44')](handleError(_0x1550ce,null));}; \ No newline at end of file +var _0x9c44=['catch','params','find','create','body','describe','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','sendStatus','stack','name','send','index','map','MemberReport','rawAttributes','fieldName','type','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','options','then','includeAll','include','findAll','rows'];(function(_0x2f03e3,_0x50ecb8){var _0xc5d632=function(_0x5e3cb9){while(--_0x5e3cb9){_0x2f03e3['push'](_0x2f03e3['shift']());}};_0xc5d632(++_0x50ecb8);}(_0x9c44,0x178));var _0x49c4=function(_0x5608a3,_0x5b33c5){_0x5608a3=_0x5608a3-0x0;var _0x1ed50a=_0x9c44[_0x5608a3];return _0x1ed50a;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x49c4('0x0'));var jsonpatch=require(_0x49c4('0x1'));var rp=require(_0x49c4('0x2'));var moment=require(_0x49c4('0x3'));var BPromise=require(_0x49c4('0x4'));var Mustache=require(_0x49c4('0x5'));var util=require('util');var path=require('path');var sox=require(_0x49c4('0x6'));var csv=require('to-csv');var ejs=require(_0x49c4('0x7'));var fs=require('fs');var fs_extra=require(_0x49c4('0x8'));var _=require(_0x49c4('0x9'));var squel=require(_0x49c4('0xa'));var crypto=require(_0x49c4('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x49c4('0xc'));var toCsv=require(_0x49c4('0xd'));var querystring=require(_0x49c4('0xe'));var Papa=require(_0x49c4('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x49c4('0x10'));var as=require(_0x49c4('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x49c4('0x12'))(_0x49c4('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x49c4('0x14'));var db=require(_0x49c4('0x15'))['db'];function respondWithStatusCode(_0x5487cd,_0x7df3a9){_0x7df3a9=_0x7df3a9||0xcc;return function(_0x403bfb){if(_0x403bfb){return _0x5487cd['sendStatus'](_0x7df3a9);}return _0x5487cd[_0x49c4('0x16')](_0x7df3a9)[_0x49c4('0x17')]();};}function respondWithResult(_0x21f15a,_0x2decee){_0x2decee=_0x2decee||0xc8;return function(_0x12777c){if(_0x12777c){return _0x21f15a[_0x49c4('0x16')](_0x2decee)[_0x49c4('0x18')](_0x12777c);}};}function respondWithFilteredResult(_0x3de397,_0x58d177){return function(_0x3acd06){if(_0x3acd06){var _0x141003=typeof _0x58d177[_0x49c4('0x19')]===_0x49c4('0x1a')&&typeof _0x58d177[_0x49c4('0x1b')]==='undefined';var _0x44e607=_0x3acd06[_0x49c4('0x1c')];var _0x4c3253=_0x141003?0x0:_0x58d177['offset'];var _0x3c782d=_0x141003?_0x3acd06[_0x49c4('0x1c')]:_0x58d177[_0x49c4('0x19')]+_0x58d177['limit'];var _0x24856d;if(_0x3c782d>=_0x44e607){_0x3c782d=_0x44e607;_0x24856d=0xc8;}else{_0x24856d=0xce;}_0x3de397['status'](_0x24856d);return _0x3de397[_0x49c4('0x1d')](_0x49c4('0x1e'),_0x4c3253+'-'+_0x3c782d+'/'+_0x44e607)[_0x49c4('0x18')](_0x3acd06);}return null;};}function patchUpdates(_0x291526){return function(_0x382040){try{jsonpatch[_0x49c4('0x1f')](_0x382040,_0x291526,!![]);}catch(_0x280893){return BPromise[_0x49c4('0x20')](_0x280893);}return _0x382040[_0x49c4('0x21')]();};}function saveUpdates(_0x578447,_0x527126){return function(_0x57f502){if(_0x57f502){return _0x57f502[_0x49c4('0x22')](_0x578447)['then'](function(_0x592bb8){return _0x592bb8;});}return null;};}function removeEntity(_0x2263ae,_0x15581b){return function(_0x26c640){if(_0x26c640){return _0x26c640[_0x49c4('0x23')]()['then'](function(){_0x2263ae['status'](0xcc)[_0x49c4('0x17')]();});}};}function handleEntityNotFound(_0x9cb797,_0x565423){return function(_0x207358){if(!_0x207358){_0x9cb797[_0x49c4('0x24')](0x194);}return _0x207358;};}function handleError(_0x210159,_0xa7a826){_0xa7a826=_0xa7a826||0x1f4;return function(_0x531d92){logger['error'](_0x531d92[_0x49c4('0x25')]);if(_0x531d92['name']){delete _0x531d92[_0x49c4('0x26')];}_0x210159[_0x49c4('0x16')](_0xa7a826)[_0x49c4('0x27')](_0x531d92);};}exports[_0x49c4('0x28')]=function(_0x5987ae,_0x889909){var _0x2b2793={},_0x46e04d={},_0x4f28a2={'count':0x0,'rows':[]};var _0x6329b3=_[_0x49c4('0x29')](db[_0x49c4('0x2a')][_0x49c4('0x2b')],function(_0x17b50f){return{'name':_0x17b50f[_0x49c4('0x2c')],'type':_0x17b50f[_0x49c4('0x2d')]['key']};});_0x46e04d['model']=_['map'](_0x6329b3,_0x49c4('0x26'));_0x46e04d[_0x49c4('0x2e')]=_[_0x49c4('0x2f')](_0x5987ae[_0x49c4('0x2e')]);_0x46e04d[_0x49c4('0x30')]=_['intersection'](_0x46e04d[_0x49c4('0x31')],_0x46e04d[_0x49c4('0x2e')]);_0x2b2793[_0x49c4('0x32')]=_[_0x49c4('0x33')](_0x46e04d['model'],qs['fields'](_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x34')]));_0x2b2793[_0x49c4('0x32')]=_0x2b2793[_0x49c4('0x32')][_0x49c4('0x35')]?_0x2b2793['attributes']:_0x46e04d[_0x49c4('0x31')];if(!_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x36')]('nolimit')){_0x2b2793['limit']=qs[_0x49c4('0x1b')](_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x1b')]);_0x2b2793[_0x49c4('0x19')]=qs[_0x49c4('0x19')](_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x19')]);}_0x2b2793[_0x49c4('0x37')]=qs[_0x49c4('0x38')](_0x5987ae['query'][_0x49c4('0x38')]);_0x2b2793['where']=qs[_0x49c4('0x30')](_[_0x49c4('0x39')](_0x5987ae[_0x49c4('0x2e')],_0x46e04d[_0x49c4('0x30')]),_0x6329b3);if(_0x5987ae['query'][_0x49c4('0x3a')]){_0x2b2793[_0x49c4('0x3b')]=_[_0x49c4('0x3c')](_0x2b2793['where'],{'$or':_[_0x49c4('0x29')](_0x6329b3,function(_0x21d8c7){if(_0x21d8c7[_0x49c4('0x2d')]!==_0x49c4('0x3d')){var _0x1ba7a0={};_0x1ba7a0[_0x21d8c7[_0x49c4('0x26')]]={'$like':'%'+_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x3a')]+'%'};return _0x1ba7a0;}})});}_0x2b2793=_[_0x49c4('0x3c')]({},_0x2b2793,_0x5987ae[_0x49c4('0x3e')]);var _0x1e506a={'where':_0x2b2793['where']};return db[_0x49c4('0x2a')][_0x49c4('0x1c')](_0x1e506a)[_0x49c4('0x3f')](function(_0x23aa32){_0x4f28a2[_0x49c4('0x1c')]=_0x23aa32;if(_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x40')]){_0x2b2793[_0x49c4('0x41')]=[{'all':!![]}];}return db[_0x49c4('0x2a')][_0x49c4('0x42')](_0x2b2793);})[_0x49c4('0x3f')](function(_0xa3d59e){_0x4f28a2[_0x49c4('0x43')]=_0xa3d59e;return _0x4f28a2;})['then'](respondWithFilteredResult(_0x889909,_0x2b2793))[_0x49c4('0x44')](handleError(_0x889909,null));};exports['show']=function(_0x104efb,_0x4915bc){var _0x28d4fb={'raw':!![],'where':{'id':_0x104efb[_0x49c4('0x45')]['id']}},_0x1480da={};_0x1480da[_0x49c4('0x31')]=_['keys'](db['MemberReport'][_0x49c4('0x2b')]);_0x1480da[_0x49c4('0x2e')]=_[_0x49c4('0x2f')](_0x104efb[_0x49c4('0x2e')]);_0x1480da['filters']=_[_0x49c4('0x33')](_0x1480da[_0x49c4('0x31')],_0x1480da[_0x49c4('0x2e')]);_0x28d4fb[_0x49c4('0x32')]=_[_0x49c4('0x33')](_0x1480da[_0x49c4('0x31')],qs[_0x49c4('0x34')](_0x104efb[_0x49c4('0x2e')][_0x49c4('0x34')]));_0x28d4fb['attributes']=_0x28d4fb[_0x49c4('0x32')]['length']?_0x28d4fb[_0x49c4('0x32')]:_0x1480da[_0x49c4('0x31')];if(_0x104efb[_0x49c4('0x2e')][_0x49c4('0x40')]){_0x28d4fb[_0x49c4('0x41')]=[{'all':!![]}];}_0x28d4fb=_['merge']({},_0x28d4fb,_0x104efb[_0x49c4('0x3e')]);return db[_0x49c4('0x2a')][_0x49c4('0x46')](_0x28d4fb)[_0x49c4('0x3f')](handleEntityNotFound(_0x4915bc,null))[_0x49c4('0x3f')](respondWithResult(_0x4915bc,null))[_0x49c4('0x44')](handleError(_0x4915bc,null));};exports[_0x49c4('0x47')]=function(_0x4d89e0,_0x3bac1b){return db['MemberReport'][_0x49c4('0x47')](_0x4d89e0[_0x49c4('0x48')],{})[_0x49c4('0x3f')](respondWithResult(_0x3bac1b,0xc9))[_0x49c4('0x44')](handleError(_0x3bac1b,null));};exports[_0x49c4('0x22')]=function(_0x30bea5,_0x2c6be1){if(_0x30bea5['body']['id']){delete _0x30bea5[_0x49c4('0x48')]['id'];}return db[_0x49c4('0x2a')]['find']({'where':{'id':_0x30bea5[_0x49c4('0x45')]['id']}})[_0x49c4('0x3f')](handleEntityNotFound(_0x2c6be1,null))[_0x49c4('0x3f')](saveUpdates(_0x30bea5[_0x49c4('0x48')],null))['then'](respondWithResult(_0x2c6be1,null))['catch'](handleError(_0x2c6be1,null));};exports[_0x49c4('0x23')]=function(_0x4e8221,_0x4597c3){return db[_0x49c4('0x2a')][_0x49c4('0x46')]({'where':{'id':_0x4e8221[_0x49c4('0x45')]['id']}})[_0x49c4('0x3f')](handleEntityNotFound(_0x4597c3,null))[_0x49c4('0x3f')](removeEntity(_0x4597c3,null))[_0x49c4('0x44')](handleError(_0x4597c3,null));};exports['describe']=function(_0x1f26c2,_0x1550ce){return db[_0x49c4('0x2a')][_0x49c4('0x49')]()[_0x49c4('0x3f')](respondWithResult(_0x1550ce,null))[_0x49c4('0x44')](handleError(_0x1550ce,null));}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.model.js b/server/api/memberReport/memberReport.model.js index 91c5d57..019738f 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 _0x5a0f=['lodash','../../config/logger','api','path','rimraf','./memberReport.attributes','exports','define','MemberReport','report_member','membername'];(function(_0x10004e,_0xd701e6){var _0x5af990=function(_0x4bab6a){while(--_0x4bab6a){_0x10004e['push'](_0x10004e['shift']());}};_0x5af990(++_0xd701e6);}(_0x5a0f,0x1e4));var _0xf5a0=function(_0x1b725f,_0x2f13f4){_0x1b725f=_0x1b725f-0x0;var _0x241e71=_0x5a0f[_0x1b725f];return _0x241e71;};'use strict';var _=require(_0xf5a0('0x0'));var util=require('util');var logger=require(_0xf5a0('0x1'))(_0xf5a0('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xf5a0('0x3'));var rimraf=require(_0xf5a0('0x4'));var config=require('../../config/environment');var attributes=require(_0xf5a0('0x5'));module[_0xf5a0('0x6')]=function(_0x11a078,_0x202f8a){return _0x11a078[_0xf5a0('0x7')](_0xf5a0('0x8'),attributes,{'tableName':_0xf5a0('0x9'),'paranoid':![],'indexes':[{'name':'membername_interface','fields':[_0xf5a0('0xa'),'interface']}],'timestamps':!![]});}; \ No newline at end of file +var _0xc259=['membername_interface','membername','interface','lodash','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./memberReport.attributes','exports','define','MemberReport','report_member'];(function(_0x44724c,_0xf4ac37){var _0x20fef1=function(_0x2c4c14){while(--_0x2c4c14){_0x44724c['push'](_0x44724c['shift']());}};_0x20fef1(++_0xf4ac37);}(_0xc259,0x193));var _0x9c25=function(_0x27aa41,_0x21dd19){_0x27aa41=_0x27aa41-0x0;var _0x4cc828=_0xc259[_0x27aa41];return _0x4cc828;};'use strict';var _=require(_0x9c25('0x0'));var util=require('util');var logger=require(_0x9c25('0x1'))(_0x9c25('0x2'));var moment=require(_0x9c25('0x3'));var BPromise=require('bluebird');var rp=require(_0x9c25('0x4'));var fs=require('fs');var path=require(_0x9c25('0x5'));var rimraf=require(_0x9c25('0x6'));var config=require(_0x9c25('0x7'));var attributes=require(_0x9c25('0x8'));module[_0x9c25('0x9')]=function(_0x45677d,_0x5528ce){return _0x45677d[_0x9c25('0xa')](_0x9c25('0xb'),attributes,{'tableName':_0x9c25('0xc'),'paranoid':![],'indexes':[{'name':_0x9c25('0xd'),'fields':[_0x9c25('0xe'),_0x9c25('0xf')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.rpc.js b/server/api/memberReport/memberReport.rpc.js index 01d3311..baab1f9 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 _0xc9b0=['result','GetMemberReport','findAll','options','raw','where','attributes','include','map','model','catch','CreateMemberReport','create','body','then','UpdateMemberReport','MemberReport','limit','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','info','MemberReport,\x20%s,\x20%s','request\x20sent','debug','MemberReport,\x20%s,\x20%s,\x20%s','error','message'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xc9b0,0x143));var _0x0c9b=function(_0x170f67,_0x33fee7){_0x170f67=_0x170f67-0x0;var _0x5cb118=_0xc9b0[_0x170f67];return _0x5cb118;};'use strict';var _=require(_0x0c9b('0x0'));var util=require(_0x0c9b('0x1'));var moment=require(_0x0c9b('0x2'));var BPromise=require(_0x0c9b('0x3'));var rs=require(_0x0c9b('0x4'));var fs=require('fs');var Redis=require(_0x0c9b('0x5'));var db=require(_0x0c9b('0x6'))['db'];var utils=require(_0x0c9b('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0x0c9b('0x8'));var jayson=require(_0x0c9b('0x9'));var client=jayson[_0x0c9b('0xa')][_0x0c9b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1bd53c,_0x16779e,_0x363958){return new BPromise(function(_0x44bcd5,_0x170820){return client['request'](_0x1bd53c,_0x363958)['then'](function(_0x4e4a0d){logger[_0x0c9b('0xc')](_0x0c9b('0xd'),_0x16779e,_0x0c9b('0xe'));logger[_0x0c9b('0xf')](_0x0c9b('0x10'),_0x16779e,_0x0c9b('0xe'),JSON['stringify'](_0x4e4a0d));if(_0x4e4a0d[_0x0c9b('0x11')]){if(_0x4e4a0d[_0x0c9b('0x11')]['code']===0x1f4){logger[_0x0c9b('0x11')]('MemberReport,\x20%s,\x20%s',_0x16779e,_0x4e4a0d[_0x0c9b('0x11')][_0x0c9b('0x12')]);return _0x170820(_0x4e4a0d[_0x0c9b('0x11')][_0x0c9b('0x12')]);}logger[_0x0c9b('0x11')](_0x0c9b('0xd'),_0x16779e,_0x4e4a0d[_0x0c9b('0x11')][_0x0c9b('0x12')]);return _0x44bcd5(_0x4e4a0d[_0x0c9b('0x11')][_0x0c9b('0x12')]);}else{logger['info']('MemberReport,\x20%s,\x20%s',_0x16779e,'request\x20sent');_0x44bcd5(_0x4e4a0d[_0x0c9b('0x13')][_0x0c9b('0x12')]);}})['catch'](function(_0xa7bda1){logger[_0x0c9b('0x11')](_0x0c9b('0xd'),_0x16779e,_0xa7bda1);_0x170820(_0xa7bda1);});});}exports[_0x0c9b('0x14')]=function(_0x2b2f65){var _0x4619b3=this;return new Promise(function(_0x39218d,_0x4bd2d8){return db['MemberReport'][_0x0c9b('0x15')]({'raw':_0x2b2f65['options']?_0x2b2f65[_0x0c9b('0x16')][_0x0c9b('0x17')]===undefined?!![]:![]:!![],'where':_0x2b2f65[_0x0c9b('0x16')]?_0x2b2f65[_0x0c9b('0x16')][_0x0c9b('0x18')]||null:null,'attributes':_0x2b2f65[_0x0c9b('0x16')]?_0x2b2f65[_0x0c9b('0x16')][_0x0c9b('0x19')]||null:null,'limit':_0x2b2f65[_0x0c9b('0x16')]?_0x2b2f65[_0x0c9b('0x16')]['limit']||null:null,'include':_0x2b2f65[_0x0c9b('0x16')]?_0x2b2f65[_0x0c9b('0x16')][_0x0c9b('0x1a')]?_['map'](_0x2b2f65[_0x0c9b('0x16')][_0x0c9b('0x1a')],function(_0x2409c6){return{'model':db[_0x2409c6['model']],'as':_0x2409c6['as'],'attributes':_0x2409c6[_0x0c9b('0x19')],'include':_0x2409c6['include']?_[_0x0c9b('0x1b')](_0x2409c6[_0x0c9b('0x1a')],function(_0x2d1ce5){return{'model':db[_0x2d1ce5[_0x0c9b('0x1c')]],'as':_0x2d1ce5['as'],'attributes':_0x2d1ce5[_0x0c9b('0x19')],'include':_0x2d1ce5[_0x0c9b('0x1a')]?_[_0x0c9b('0x1b')](_0x2d1ce5[_0x0c9b('0x1a')],function(_0x476c59){return{'model':db[_0x476c59[_0x0c9b('0x1c')]],'as':_0x476c59['as'],'attributes':_0x476c59[_0x0c9b('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x594710){logger[_0x0c9b('0xc')](_0x0c9b('0x14'),_0x2b2f65);logger[_0x0c9b('0xf')](_0x0c9b('0x14'),_0x2b2f65,JSON['stringify'](_0x594710));_0x39218d(_0x594710);})[_0x0c9b('0x1d')](function(_0x1391d1){logger['error'](_0x0c9b('0x14'),_0x1391d1[_0x0c9b('0x12')],_0x2b2f65);_0x4bd2d8(_0x4619b3[_0x0c9b('0x11')](0x1f4,_0x1391d1[_0x0c9b('0x12')]));});});};exports[_0x0c9b('0x1e')]=function(_0x30027c){var _0x523fad=this;return new Promise(function(_0x2eeea7,_0x125c55){return db['MemberReport'][_0x0c9b('0x1f')](_0x30027c[_0x0c9b('0x20')],{'raw':_0x30027c[_0x0c9b('0x16')]?_0x30027c[_0x0c9b('0x16')][_0x0c9b('0x17')]===undefined?!![]:![]:!![]})[_0x0c9b('0x21')](function(_0x21a348){logger[_0x0c9b('0xc')](_0x0c9b('0x1e'),_0x30027c);logger[_0x0c9b('0xf')](_0x0c9b('0x1e'),_0x30027c,JSON['stringify'](_0x21a348));_0x2eeea7(_0x21a348);})['catch'](function(_0x9629be){logger[_0x0c9b('0x11')](_0x0c9b('0x1e'),_0x9629be[_0x0c9b('0x12')],_0x30027c);_0x125c55(_0x523fad[_0x0c9b('0x11')](0x1f4,_0x9629be[_0x0c9b('0x12')]));});});};exports[_0x0c9b('0x22')]=function(_0x265fae){var _0x414fda=this;return new Promise(function(_0xe8e702,_0x535ab7){return db[_0x0c9b('0x23')]['update'](_0x265fae[_0x0c9b('0x20')],{'raw':_0x265fae[_0x0c9b('0x16')]?_0x265fae[_0x0c9b('0x16')][_0x0c9b('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x265fae[_0x0c9b('0x16')]?_0x265fae['options'][_0x0c9b('0x18')]||null:null,'attributes':_0x265fae['options']?_0x265fae['options'][_0x0c9b('0x19')]||null:null,'limit':_0x265fae['options']?_0x265fae[_0x0c9b('0x16')][_0x0c9b('0x24')]||null:null})[_0x0c9b('0x21')](function(_0x3df8b5){logger[_0x0c9b('0xc')](_0x0c9b('0x22'),_0x265fae);logger[_0x0c9b('0xf')](_0x0c9b('0x22'),_0x265fae,JSON[_0x0c9b('0x25')](_0x3df8b5));_0xe8e702(_0x3df8b5);})[_0x0c9b('0x1d')](function(_0x2514f6){logger[_0x0c9b('0x11')]('UpdateMemberReport',_0x2514f6[_0x0c9b('0x12')],_0x265fae);_0x535ab7(_0x414fda[_0x0c9b('0x11')](0x1f4,_0x2514f6[_0x0c9b('0x12')]));});});}; \ No newline at end of file +var _0x68f5=['UpdateMemberReport','update','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','MemberReport,\x20%s,\x20%s','debug','MemberReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetMemberReport','MemberReport','findAll','options','raw','where','attributes','limit','include','map','model','create','body','CreateMemberReport'];(function(_0xee3338,_0x49aa57){var _0x4479ce=function(_0x1adc03){while(--_0x1adc03){_0xee3338['push'](_0xee3338['shift']());}};_0x4479ce(++_0x49aa57);}(_0x68f5,0x11a));var _0x568f=function(_0x113450,_0x9e8af0){_0x113450=_0x113450-0x0;var _0x47cf15=_0x68f5[_0x113450];return _0x47cf15;};'use strict';var _=require(_0x568f('0x0'));var util=require(_0x568f('0x1'));var moment=require(_0x568f('0x2'));var BPromise=require('bluebird');var rs=require(_0x568f('0x3'));var fs=require('fs');var Redis=require(_0x568f('0x4'));var db=require(_0x568f('0x5'))['db'];var utils=require(_0x568f('0x6'));var logger=require(_0x568f('0x7'))('rpc');var config=require(_0x568f('0x8'));var jayson=require(_0x568f('0x9'));var client=jayson[_0x568f('0xa')][_0x568f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4ca62c,_0x541fd2,_0x953f02){return new BPromise(function(_0x3568a0,_0x2492fc){return client['request'](_0x4ca62c,_0x953f02)[_0x568f('0xc')](function(_0x48fe85){logger[_0x568f('0xd')](_0x568f('0xe'),_0x541fd2,'request\x20sent');logger[_0x568f('0xf')](_0x568f('0x10'),_0x541fd2,_0x568f('0x11'),JSON[_0x568f('0x12')](_0x48fe85));if(_0x48fe85[_0x568f('0x13')]){if(_0x48fe85[_0x568f('0x13')][_0x568f('0x14')]===0x1f4){logger[_0x568f('0x13')](_0x568f('0xe'),_0x541fd2,_0x48fe85['error'][_0x568f('0x15')]);return _0x2492fc(_0x48fe85[_0x568f('0x13')][_0x568f('0x15')]);}logger[_0x568f('0x13')]('MemberReport,\x20%s,\x20%s',_0x541fd2,_0x48fe85[_0x568f('0x13')]['message']);return _0x3568a0(_0x48fe85['error'][_0x568f('0x15')]);}else{logger[_0x568f('0xd')](_0x568f('0xe'),_0x541fd2,_0x568f('0x11'));_0x3568a0(_0x48fe85[_0x568f('0x16')][_0x568f('0x15')]);}})[_0x568f('0x17')](function(_0x1060cb){logger[_0x568f('0x13')](_0x568f('0xe'),_0x541fd2,_0x1060cb);_0x2492fc(_0x1060cb);});});}exports[_0x568f('0x18')]=function(_0x49b64e){var _0x372490=this;return new Promise(function(_0x5cc7e2,_0x258dc4){return db[_0x568f('0x19')][_0x568f('0x1a')]({'raw':_0x49b64e[_0x568f('0x1b')]?_0x49b64e[_0x568f('0x1b')][_0x568f('0x1c')]===undefined?!![]:![]:!![],'where':_0x49b64e[_0x568f('0x1b')]?_0x49b64e[_0x568f('0x1b')][_0x568f('0x1d')]||null:null,'attributes':_0x49b64e[_0x568f('0x1b')]?_0x49b64e[_0x568f('0x1b')][_0x568f('0x1e')]||null:null,'limit':_0x49b64e[_0x568f('0x1b')]?_0x49b64e[_0x568f('0x1b')][_0x568f('0x1f')]||null:null,'include':_0x49b64e[_0x568f('0x1b')]?_0x49b64e[_0x568f('0x1b')][_0x568f('0x20')]?_[_0x568f('0x21')](_0x49b64e[_0x568f('0x1b')][_0x568f('0x20')],function(_0x4590a8){return{'model':db[_0x4590a8[_0x568f('0x22')]],'as':_0x4590a8['as'],'attributes':_0x4590a8[_0x568f('0x1e')],'include':_0x4590a8['include']?_['map'](_0x4590a8[_0x568f('0x20')],function(_0x45826b){return{'model':db[_0x45826b[_0x568f('0x22')]],'as':_0x45826b['as'],'attributes':_0x45826b[_0x568f('0x1e')],'include':_0x45826b['include']?_['map'](_0x45826b[_0x568f('0x20')],function(_0x577ca6){return{'model':db[_0x577ca6['model']],'as':_0x577ca6['as'],'attributes':_0x577ca6['attributes']};}):[]};}):[]};}):[]:[]})[_0x568f('0xc')](function(_0x4e7854){logger[_0x568f('0xd')]('GetMemberReport',_0x49b64e);logger[_0x568f('0xf')](_0x568f('0x18'),_0x49b64e,JSON[_0x568f('0x12')](_0x4e7854));_0x5cc7e2(_0x4e7854);})['catch'](function(_0x209db2){logger[_0x568f('0x13')]('GetMemberReport',_0x209db2[_0x568f('0x15')],_0x49b64e);_0x258dc4(_0x372490['error'](0x1f4,_0x209db2[_0x568f('0x15')]));});});};exports['CreateMemberReport']=function(_0x495b09){var _0x7ea930=this;return new Promise(function(_0x27acd1,_0x1f6215){return db[_0x568f('0x19')][_0x568f('0x23')](_0x495b09[_0x568f('0x24')],{'raw':_0x495b09[_0x568f('0x1b')]?_0x495b09[_0x568f('0x1b')]['raw']===undefined?!![]:![]:!![]})[_0x568f('0xc')](function(_0x15e641){logger[_0x568f('0xd')](_0x568f('0x25'),_0x495b09);logger['debug'](_0x568f('0x25'),_0x495b09,JSON[_0x568f('0x12')](_0x15e641));_0x27acd1(_0x15e641);})[_0x568f('0x17')](function(_0xb4824b){logger[_0x568f('0x13')](_0x568f('0x25'),_0xb4824b[_0x568f('0x15')],_0x495b09);_0x1f6215(_0x7ea930['error'](0x1f4,_0xb4824b[_0x568f('0x15')]));});});};exports[_0x568f('0x26')]=function(_0x3f1294){var _0x394c3c=this;return new Promise(function(_0x20b4df,_0x4b6608){return db['MemberReport'][_0x568f('0x27')](_0x3f1294[_0x568f('0x24')],{'raw':_0x3f1294[_0x568f('0x1b')]?_0x3f1294[_0x568f('0x1b')][_0x568f('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3f1294['options']?_0x3f1294[_0x568f('0x1b')][_0x568f('0x1d')]||null:null,'attributes':_0x3f1294[_0x568f('0x1b')]?_0x3f1294[_0x568f('0x1b')][_0x568f('0x1e')]||null:null,'limit':_0x3f1294[_0x568f('0x1b')]?_0x3f1294[_0x568f('0x1b')][_0x568f('0x1f')]||null:null})[_0x568f('0xc')](function(_0x4373ea){logger[_0x568f('0xd')](_0x568f('0x26'),_0x3f1294);logger[_0x568f('0xf')](_0x568f('0x26'),_0x3f1294,JSON[_0x568f('0x12')](_0x4373ea));_0x20b4df(_0x4373ea);})['catch'](function(_0x1856a3){logger['error']('UpdateMemberReport',_0x1856a3[_0x568f('0x15')],_0x3f1294);_0x4b6608(_0x394c3c['error'](0x1f4,_0x1856a3[_0x568f('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/migration/index.js b/server/api/migration/index.js index 6f62d92..94d1b4f 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 _0xb50f=['express','Router','./migration.controller','get','index','exports','path','connect-timeout'];(function(_0x346736,_0x173d71){var _0x5761e1=function(_0x6400f0){while(--_0x6400f0){_0x346736['push'](_0x346736['shift']());}};_0x5761e1(++_0x173d71);}(_0xb50f,0x66));var _0xfb50=function(_0x2f1908,_0x5d837d){_0x2f1908=_0x2f1908-0x0;var _0x357795=_0xb50f[_0x2f1908];return _0x357795;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xfb50('0x0'));var timeout=require(_0xfb50('0x1'));var express=require(_0xfb50('0x2'));var router=express[_0xfb50('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(_0xfb50('0x4'));router[_0xfb50('0x5')]('/',controller[_0xfb50('0x6')]);module[_0xfb50('0x7')]=router; \ No newline at end of file +var _0x0a16=['../../components/interaction/service','./migration.controller','get','exports','path','connect-timeout','Router','fs-extra','../../components/auth/service'];(function(_0x1d5fb9,_0x43aa73){var _0xd72009=function(_0x44052e){while(--_0x44052e){_0x1d5fb9['push'](_0x1d5fb9['shift']());}};_0xd72009(++_0x43aa73);}(_0x0a16,0x17e));var _0x60a1=function(_0x46d3e5,_0x2cc6c0){_0x46d3e5=_0x46d3e5-0x0;var _0x30d237=_0x0a16[_0x46d3e5];return _0x30d237;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x60a1('0x0'));var timeout=require(_0x60a1('0x1'));var express=require('express');var router=express[_0x60a1('0x2')]();var fs_extra=require(_0x60a1('0x3'));var auth=require(_0x60a1('0x4'));var interaction=require(_0x60a1('0x5'));var config=require('../../config/environment');var controller=require(_0x60a1('0x6'));router[_0x60a1('0x7')]('/',controller['index']);module[_0x60a1('0x8')]=router; \ No newline at end of file diff --git a/server/api/migration/migration.attributes.js b/server/api/migration/migration.attributes.js index cb77005..57fc27e 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 _0x394c=['exports','STRING','version'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x394c,0x105));var _0xc394=function(_0x5222d9,_0x12496d){_0x5222d9=_0x5222d9-0x0;var _0x16b0d5=_0x394c[_0x5222d9];return _0x16b0d5;};'use strict';var Sequelize=require('sequelize');module[_0xc394('0x0')]={'version':{'type':Sequelize[_0xc394('0x1')],'unique':_0xc394('0x2')}}; \ No newline at end of file +var _0x179e=['STRING','version','sequelize','exports'];(function(_0x1892f9,_0x2cb4ab){var _0x5a765f=function(_0x258a23){while(--_0x258a23){_0x1892f9['push'](_0x1892f9['shift']());}};_0x5a765f(++_0x2cb4ab);}(_0x179e,0x12e));var _0xe179=function(_0x52fba9,_0x2252b7){_0x52fba9=_0x52fba9-0x0;var _0x2428fb=_0x179e[_0x52fba9];return _0x2428fb;};'use strict';var Sequelize=require(_0xe179('0x0'));module[_0xe179('0x1')]={'version':{'type':Sequelize[_0xe179('0x2')],'unique':_0xe179('0x3')}}; \ No newline at end of file diff --git a/server/api/migration/migration.controller.js b/server/api/migration/migration.controller.js index c958bb4..ce10023 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 _0x29d0=['moment','bluebird','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','count','set','reject','update','then','destroy','end','stack','name','index','map','Migration','rawAttributes','fieldName','type','query','filters','model','attributes','intersection','fields','length','hasOwnProperty','order','sort','pick','where','merge','VIRTUAL','options','includeAll','include','rows','catch','eml-format','rimraf','zip-dir','fast-json-patch','request-promise'];(function(_0x18860c,_0x4af1bb){var _0x51f126=function(_0x504407){while(--_0x504407){_0x18860c['push'](_0x18860c['shift']());}};_0x51f126(++_0x4af1bb);}(_0x29d0,0x1c2));var _0x029d=function(_0x45469a,_0x8d90b0){_0x45469a=_0x45469a-0x0;var _0x16e2d5=_0x29d0[_0x45469a];return _0x16e2d5;};'use strict';var emlformat=require(_0x029d('0x0'));var rimraf=require(_0x029d('0x1'));var zipdir=require(_0x029d('0x2'));var jsonpatch=require(_0x029d('0x3'));var rp=require(_0x029d('0x4'));var moment=require(_0x029d('0x5'));var BPromise=require(_0x029d('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x029d('0x7'));var sox=require(_0x029d('0x8'));var csv=require(_0x029d('0x9'));var ejs=require(_0x029d('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x029d('0xb'));var squel=require(_0x029d('0xc'));var crypto=require('crypto');var jsforce=require(_0x029d('0xd'));var deskjs=require(_0x029d('0xe'));var toCsv=require(_0x029d('0x9'));var querystring=require(_0x029d('0xf'));var Papa=require('papaparse');var Redis=require(_0x029d('0x10'));var authService=require(_0x029d('0x11'));var qs=require(_0x029d('0x12'));var as=require(_0x029d('0x13'));var hardwareService=require(_0x029d('0x14'));var logger=require(_0x029d('0x15'))(_0x029d('0x16'));var utils=require('../../config/utils');var config=require(_0x029d('0x17'));var licenseUtil=require(_0x029d('0x18'));var db=require(_0x029d('0x19'))['db'];function respondWithStatusCode(_0x20ae18,_0x415a45){_0x415a45=_0x415a45||0xcc;return function(_0x5a5151){if(_0x5a5151){return _0x20ae18[_0x029d('0x1a')](_0x415a45);}return _0x20ae18[_0x029d('0x1b')](_0x415a45)['end']();};}function respondWithResult(_0x33c571,_0xe2cfa){_0xe2cfa=_0xe2cfa||0xc8;return function(_0x13e3dc){if(_0x13e3dc){return _0x33c571[_0x029d('0x1b')](_0xe2cfa)[_0x029d('0x1c')](_0x13e3dc);}};}function respondWithFilteredResult(_0x5ebfd3,_0x2a92b2){return function(_0x31e34a){if(_0x31e34a){var _0x5dc704=typeof _0x2a92b2[_0x029d('0x1d')]==='undefined'&&typeof _0x2a92b2[_0x029d('0x1e')]==='undefined';var _0x595b40=_0x31e34a[_0x029d('0x1f')];var _0x5951b9=_0x5dc704?0x0:_0x2a92b2[_0x029d('0x1d')];var _0x2793ce=_0x5dc704?_0x31e34a['count']:_0x2a92b2[_0x029d('0x1d')]+_0x2a92b2[_0x029d('0x1e')];var _0x4f664d;if(_0x2793ce>=_0x595b40){_0x2793ce=_0x595b40;_0x4f664d=0xc8;}else{_0x4f664d=0xce;}_0x5ebfd3[_0x029d('0x1b')](_0x4f664d);return _0x5ebfd3[_0x029d('0x20')]('Content-Range',_0x5951b9+'-'+_0x2793ce+'/'+_0x595b40)[_0x029d('0x1c')](_0x31e34a);}return null;};}function patchUpdates(_0x20273d){return function(_0x3827e8){try{jsonpatch['apply'](_0x3827e8,_0x20273d,!![]);}catch(_0x56f140){return BPromise[_0x029d('0x21')](_0x56f140);}return _0x3827e8['save']();};}function saveUpdates(_0x388b51,_0x16c713){return function(_0x5cedea){if(_0x5cedea){return _0x5cedea[_0x029d('0x22')](_0x388b51)[_0x029d('0x23')](function(_0x2cc62f){return _0x2cc62f;});}return null;};}function removeEntity(_0x4d0aaf,_0x19e2e7){return function(_0x532805){if(_0x532805){return _0x532805[_0x029d('0x24')]()[_0x029d('0x23')](function(){_0x4d0aaf[_0x029d('0x1b')](0xcc)[_0x029d('0x25')]();});}};}function handleEntityNotFound(_0x51bf12,_0x5909d3){return function(_0x3c6053){if(!_0x3c6053){_0x51bf12['sendStatus'](0x194);}return _0x3c6053;};}function handleError(_0x3b496c,_0x39fae7){_0x39fae7=_0x39fae7||0x1f4;return function(_0x34d576){logger['error'](_0x34d576[_0x029d('0x26')]);if(_0x34d576[_0x029d('0x27')]){delete _0x34d576['name'];}_0x3b496c[_0x029d('0x1b')](_0x39fae7)['send'](_0x34d576);};}exports[_0x029d('0x28')]=function(_0x2ea3c9,_0x445f6c){var _0xe95f5e={},_0x4cbedd={},_0x84fe34={'count':0x0,'rows':[]};var _0x45c1c9=_[_0x029d('0x29')](db[_0x029d('0x2a')][_0x029d('0x2b')],function(_0x485899){return{'name':_0x485899[_0x029d('0x2c')],'type':_0x485899[_0x029d('0x2d')]['key']};});_0x4cbedd['model']=_[_0x029d('0x29')](_0x45c1c9,_0x029d('0x27'));_0x4cbedd[_0x029d('0x2e')]=_['keys'](_0x2ea3c9[_0x029d('0x2e')]);_0x4cbedd[_0x029d('0x2f')]=_['intersection'](_0x4cbedd[_0x029d('0x30')],_0x4cbedd[_0x029d('0x2e')]);_0xe95f5e[_0x029d('0x31')]=_[_0x029d('0x32')](_0x4cbedd['model'],qs[_0x029d('0x33')](_0x2ea3c9[_0x029d('0x2e')][_0x029d('0x33')]));_0xe95f5e[_0x029d('0x31')]=_0xe95f5e[_0x029d('0x31')][_0x029d('0x34')]?_0xe95f5e[_0x029d('0x31')]:_0x4cbedd[_0x029d('0x30')];if(!_0x2ea3c9[_0x029d('0x2e')][_0x029d('0x35')]('nolimit')){_0xe95f5e['limit']=qs[_0x029d('0x1e')](_0x2ea3c9[_0x029d('0x2e')][_0x029d('0x1e')]);_0xe95f5e[_0x029d('0x1d')]=qs['offset'](_0x2ea3c9['query'][_0x029d('0x1d')]);}_0xe95f5e[_0x029d('0x36')]=qs[_0x029d('0x37')](_0x2ea3c9['query'][_0x029d('0x37')]);_0xe95f5e['where']=qs[_0x029d('0x2f')](_[_0x029d('0x38')](_0x2ea3c9['query'],_0x4cbedd['filters']),_0x45c1c9);if(_0x2ea3c9[_0x029d('0x2e')]['filter']){_0xe95f5e[_0x029d('0x39')]=_[_0x029d('0x3a')](_0xe95f5e[_0x029d('0x39')],{'$or':_[_0x029d('0x29')](_0x45c1c9,function(_0x2b840d){if(_0x2b840d['type']!==_0x029d('0x3b')){var _0x58ea57={};_0x58ea57[_0x2b840d[_0x029d('0x27')]]={'$like':'%'+_0x2ea3c9[_0x029d('0x2e')]['filter']+'%'};return _0x58ea57;}})});}_0xe95f5e=_[_0x029d('0x3a')]({},_0xe95f5e,_0x2ea3c9[_0x029d('0x3c')]);var _0x3225c1={'where':_0xe95f5e['where']};return db[_0x029d('0x2a')][_0x029d('0x1f')](_0x3225c1)[_0x029d('0x23')](function(_0xf5a8a2){_0x84fe34[_0x029d('0x1f')]=_0xf5a8a2;if(_0x2ea3c9[_0x029d('0x2e')][_0x029d('0x3d')]){_0xe95f5e[_0x029d('0x3e')]=[{'all':!![]}];}return db[_0x029d('0x2a')]['findAll'](_0xe95f5e);})[_0x029d('0x23')](function(_0x38fcf6){_0x84fe34[_0x029d('0x3f')]=_0x38fcf6;return _0x84fe34;})['then'](respondWithFilteredResult(_0x445f6c,_0xe95f5e))[_0x029d('0x40')](handleError(_0x445f6c,null));}; \ No newline at end of file +var _0xc8ae=['attributes','intersection','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','Migration','includeAll','findAll','rows','catch','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','reject','save','update','then','destroy','stack','name','index','map','rawAttributes','fieldName','type','model','query','keys'];(function(_0x22868f,_0x450f48){var _0x97bc75=function(_0x447cb4){while(--_0x447cb4){_0x22868f['push'](_0x22868f['shift']());}};_0x97bc75(++_0x450f48);}(_0xc8ae,0x1d1));var _0xec8a=function(_0x3604d9,_0x24e062){_0x3604d9=_0x3604d9-0x0;var _0x31172f=_0xc8ae[_0x3604d9];return _0x31172f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xec8a('0x0'));var zipdir=require(_0xec8a('0x1'));var jsonpatch=require(_0xec8a('0x2'));var rp=require(_0xec8a('0x3'));var moment=require(_0xec8a('0x4'));var BPromise=require(_0xec8a('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xec8a('0x6'));var sox=require(_0xec8a('0x7'));var csv=require(_0xec8a('0x8'));var ejs=require(_0xec8a('0x9'));var fs=require('fs');var fs_extra=require(_0xec8a('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xec8a('0xb'));var deskjs=require(_0xec8a('0xc'));var toCsv=require(_0xec8a('0x8'));var querystring=require(_0xec8a('0xd'));var Papa=require(_0xec8a('0xe'));var Redis=require(_0xec8a('0xf'));var authService=require(_0xec8a('0x10'));var qs=require(_0xec8a('0x11'));var as=require(_0xec8a('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xec8a('0x13'));var utils=require(_0xec8a('0x14'));var config=require(_0xec8a('0x15'));var licenseUtil=require(_0xec8a('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x318407,_0x340f91){_0x340f91=_0x340f91||0xcc;return function(_0x249d3c){if(_0x249d3c){return _0x318407[_0xec8a('0x17')](_0x340f91);}return _0x318407[_0xec8a('0x18')](_0x340f91)[_0xec8a('0x19')]();};}function respondWithResult(_0x3fa0ee,_0x1a7792){_0x1a7792=_0x1a7792||0xc8;return function(_0x1c44d4){if(_0x1c44d4){return _0x3fa0ee['status'](_0x1a7792)[_0xec8a('0x1a')](_0x1c44d4);}};}function respondWithFilteredResult(_0xe57a8d,_0x2bddfc){return function(_0x41fcec){if(_0x41fcec){var _0x35d653=typeof _0x2bddfc[_0xec8a('0x1b')]===_0xec8a('0x1c')&&typeof _0x2bddfc[_0xec8a('0x1d')]===_0xec8a('0x1c');var _0x167f38=_0x41fcec[_0xec8a('0x1e')];var _0x5bdfbc=_0x35d653?0x0:_0x2bddfc[_0xec8a('0x1b')];var _0x539534=_0x35d653?_0x41fcec[_0xec8a('0x1e')]:_0x2bddfc[_0xec8a('0x1b')]+_0x2bddfc[_0xec8a('0x1d')];var _0x5e04c5;if(_0x539534>=_0x167f38){_0x539534=_0x167f38;_0x5e04c5=0xc8;}else{_0x5e04c5=0xce;}_0xe57a8d[_0xec8a('0x18')](_0x5e04c5);return _0xe57a8d[_0xec8a('0x1f')]('Content-Range',_0x5bdfbc+'-'+_0x539534+'/'+_0x167f38)[_0xec8a('0x1a')](_0x41fcec);}return null;};}function patchUpdates(_0x32c073){return function(_0x408952){try{jsonpatch['apply'](_0x408952,_0x32c073,!![]);}catch(_0x2d6296){return BPromise[_0xec8a('0x20')](_0x2d6296);}return _0x408952[_0xec8a('0x21')]();};}function saveUpdates(_0x4beda2,_0x39cd65){return function(_0x3ebdd7){if(_0x3ebdd7){return _0x3ebdd7[_0xec8a('0x22')](_0x4beda2)[_0xec8a('0x23')](function(_0x25c941){return _0x25c941;});}return null;};}function removeEntity(_0x196b93,_0x42e30a){return function(_0x2280dd){if(_0x2280dd){return _0x2280dd[_0xec8a('0x24')]()[_0xec8a('0x23')](function(){_0x196b93[_0xec8a('0x18')](0xcc)[_0xec8a('0x19')]();});}};}function handleEntityNotFound(_0x142e43,_0x511964){return function(_0x493e6e){if(!_0x493e6e){_0x142e43[_0xec8a('0x17')](0x194);}return _0x493e6e;};}function handleError(_0x32e58a,_0x32b32c){_0x32b32c=_0x32b32c||0x1f4;return function(_0x4bd7fb){logger['error'](_0x4bd7fb[_0xec8a('0x25')]);if(_0x4bd7fb[_0xec8a('0x26')]){delete _0x4bd7fb[_0xec8a('0x26')];}_0x32e58a[_0xec8a('0x18')](_0x32b32c)['send'](_0x4bd7fb);};}exports[_0xec8a('0x27')]=function(_0xa0bcf9,_0x54d20a){var _0xf96d72={},_0x18e54d={},_0xfc3f49={'count':0x0,'rows':[]};var _0x1fdf1c=_[_0xec8a('0x28')](db['Migration'][_0xec8a('0x29')],function(_0x3bcb9a){return{'name':_0x3bcb9a[_0xec8a('0x2a')],'type':_0x3bcb9a[_0xec8a('0x2b')]['key']};});_0x18e54d[_0xec8a('0x2c')]=_[_0xec8a('0x28')](_0x1fdf1c,'name');_0x18e54d[_0xec8a('0x2d')]=_[_0xec8a('0x2e')](_0xa0bcf9[_0xec8a('0x2d')]);_0x18e54d['filters']=_['intersection'](_0x18e54d[_0xec8a('0x2c')],_0x18e54d['query']);_0xf96d72[_0xec8a('0x2f')]=_[_0xec8a('0x30')](_0x18e54d[_0xec8a('0x2c')],qs['fields'](_0xa0bcf9['query']['fields']));_0xf96d72['attributes']=_0xf96d72['attributes']['length']?_0xf96d72[_0xec8a('0x2f')]:_0x18e54d[_0xec8a('0x2c')];if(!_0xa0bcf9[_0xec8a('0x2d')][_0xec8a('0x31')](_0xec8a('0x32'))){_0xf96d72[_0xec8a('0x1d')]=qs[_0xec8a('0x1d')](_0xa0bcf9[_0xec8a('0x2d')][_0xec8a('0x1d')]);_0xf96d72[_0xec8a('0x1b')]=qs[_0xec8a('0x1b')](_0xa0bcf9[_0xec8a('0x2d')][_0xec8a('0x1b')]);}_0xf96d72[_0xec8a('0x33')]=qs[_0xec8a('0x34')](_0xa0bcf9['query'][_0xec8a('0x34')]);_0xf96d72[_0xec8a('0x35')]=qs[_0xec8a('0x36')](_[_0xec8a('0x37')](_0xa0bcf9[_0xec8a('0x2d')],_0x18e54d[_0xec8a('0x36')]),_0x1fdf1c);if(_0xa0bcf9[_0xec8a('0x2d')][_0xec8a('0x38')]){_0xf96d72['where']=_[_0xec8a('0x39')](_0xf96d72[_0xec8a('0x35')],{'$or':_['map'](_0x1fdf1c,function(_0x1f91db){if(_0x1f91db[_0xec8a('0x2b')]!==_0xec8a('0x3a')){var _0x257636={};_0x257636[_0x1f91db[_0xec8a('0x26')]]={'$like':'%'+_0xa0bcf9[_0xec8a('0x2d')][_0xec8a('0x38')]+'%'};return _0x257636;}})});}_0xf96d72=_[_0xec8a('0x39')]({},_0xf96d72,_0xa0bcf9['options']);var _0x20eea3={'where':_0xf96d72['where']};return db[_0xec8a('0x3b')][_0xec8a('0x1e')](_0x20eea3)[_0xec8a('0x23')](function(_0xebed95){_0xfc3f49[_0xec8a('0x1e')]=_0xebed95;if(_0xa0bcf9['query'][_0xec8a('0x3c')]){_0xf96d72['include']=[{'all':!![]}];}return db[_0xec8a('0x3b')][_0xec8a('0x3d')](_0xf96d72);})[_0xec8a('0x23')](function(_0x25fa86){_0xfc3f49[_0xec8a('0x3e')]=_0x25fa86;return _0xfc3f49;})[_0xec8a('0x23')](respondWithFilteredResult(_0x54d20a,_0xf96d72))[_0xec8a('0x3f')](handleError(_0x54d20a,null));}; \ No newline at end of file diff --git a/server/api/migration/migration.model.js b/server/api/migration/migration.model.js index e2370a7..62d510f 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 _0x8f37=['util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','Migration','migrations','lodash'];(function(_0xd11b8c,_0x4ab818){var _0x3cb394=function(_0x42b513){while(--_0x42b513){_0xd11b8c['push'](_0xd11b8c['shift']());}};_0x3cb394(++_0x4ab818);}(_0x8f37,0x1f3));var _0x78f3=function(_0x1f84ea,_0x1c4b55){_0x1f84ea=_0x1f84ea-0x0;var _0x475b97=_0x8f37[_0x1f84ea];return _0x475b97;};'use strict';var _=require(_0x78f3('0x0'));var util=require(_0x78f3('0x1'));var logger=require(_0x78f3('0x2'))(_0x78f3('0x3'));var moment=require(_0x78f3('0x4'));var BPromise=require('bluebird');var rp=require(_0x78f3('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x78f3('0x6'));var config=require(_0x78f3('0x7'));var attributes=require('./migration.attributes');module['exports']=function(_0x1ec5f0,_0x34c65b){return _0x1ec5f0['define'](_0x78f3('0x8'),attributes,{'tableName':_0x78f3('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x98af=['rimraf','exports','define','Migration','migrations','lodash','util','../../config/logger','api','moment','bluebird','path'];(function(_0x4099ee,_0x38495a){var _0x1b7bfc=function(_0x5f5388){while(--_0x5f5388){_0x4099ee['push'](_0x4099ee['shift']());}};_0x1b7bfc(++_0x38495a);}(_0x98af,0xc5));var _0xf98a=function(_0x3c7e51,_0x38d61d){_0x3c7e51=_0x3c7e51-0x0;var _0xd681e0=_0x98af[_0x3c7e51];return _0xd681e0;};'use strict';var _=require(_0xf98a('0x0'));var util=require(_0xf98a('0x1'));var logger=require(_0xf98a('0x2'))(_0xf98a('0x3'));var moment=require(_0xf98a('0x4'));var BPromise=require(_0xf98a('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf98a('0x6'));var rimraf=require(_0xf98a('0x7'));var config=require('../../config/environment');var attributes=require('./migration.attributes');module[_0xf98a('0x8')]=function(_0x4a8984,_0x3ba78a){return _0x4a8984[_0xf98a('0x9')](_0xf98a('0xa'),attributes,{'tableName':_0xf98a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/migration/migration.rpc.js b/server/api/migration/migration.rpc.js index 745865d..1da196d 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 _0x138d=['Migration,\x20%s,\x20%s','Migration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then'];(function(_0x595976,_0x31bca6){var _0x4c9de4=function(_0x1266a8){while(--_0x1266a8){_0x595976['push'](_0x595976['shift']());}};_0x4c9de4(++_0x31bca6);}(_0x138d,0x1ab));var _0xd138=function(_0x39f097,_0x17116b){_0x39f097=_0x39f097-0x0;var _0x544f6a=_0x138d[_0x39f097];return _0x544f6a;};'use strict';var _=require(_0xd138('0x0'));var util=require(_0xd138('0x1'));var moment=require('moment');var BPromise=require(_0xd138('0x2'));var rs=require(_0xd138('0x3'));var fs=require('fs');var Redis=require(_0xd138('0x4'));var db=require(_0xd138('0x5'))['db'];var utils=require(_0xd138('0x6'));var logger=require(_0xd138('0x7'))('rpc');var config=require(_0xd138('0x8'));var jayson=require(_0xd138('0x9'));var client=jayson[_0xd138('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x19869d,_0x1edfa7,_0x117c23){return new BPromise(function(_0x5790ff,_0x54e1f2){return client[_0xd138('0xb')](_0x19869d,_0x117c23)[_0xd138('0xc')](function(_0x121cce){logger['info'](_0xd138('0xd'),_0x1edfa7,'request\x20sent');logger['debug'](_0xd138('0xe'),_0x1edfa7,_0xd138('0xf'),JSON[_0xd138('0x10')](_0x121cce));if(_0x121cce[_0xd138('0x11')]){if(_0x121cce['error'][_0xd138('0x12')]===0x1f4){logger['error'](_0xd138('0xd'),_0x1edfa7,_0x121cce[_0xd138('0x11')][_0xd138('0x13')]);return _0x54e1f2(_0x121cce[_0xd138('0x11')][_0xd138('0x13')]);}logger[_0xd138('0x11')](_0xd138('0xd'),_0x1edfa7,_0x121cce[_0xd138('0x11')][_0xd138('0x13')]);return _0x5790ff(_0x121cce[_0xd138('0x11')][_0xd138('0x13')]);}else{logger[_0xd138('0x14')]('Migration,\x20%s,\x20%s',_0x1edfa7,_0xd138('0xf'));_0x5790ff(_0x121cce[_0xd138('0x15')]['message']);}})['catch'](function(_0x502d3b){logger[_0xd138('0x11')](_0xd138('0xd'),_0x1edfa7,_0x502d3b);_0x54e1f2(_0x502d3b);});});} \ No newline at end of file +var _0x0884=['then','info','Migration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request'];(function(_0x1c546f,_0xff308f){var _0x125723=function(_0x155fba){while(--_0x155fba){_0x1c546f['push'](_0x1c546f['shift']());}};_0x125723(++_0xff308f);}(_0x0884,0xb3));var _0x4088=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0884[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x4088('0x0'));var util=require(_0x4088('0x1'));var moment=require(_0x4088('0x2'));var BPromise=require(_0x4088('0x3'));var rs=require(_0x4088('0x4'));var fs=require('fs');var Redis=require(_0x4088('0x5'));var db=require(_0x4088('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x4088('0x7'))(_0x4088('0x8'));var config=require(_0x4088('0x9'));var jayson=require(_0x4088('0xa'));var client=jayson[_0x4088('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4d68aa,_0x42b2c3,_0x52baff){return new BPromise(function(_0x680227,_0x8f007c){return client[_0x4088('0xc')](_0x4d68aa,_0x52baff)[_0x4088('0xd')](function(_0x32fbb6){logger[_0x4088('0xe')](_0x4088('0xf'),_0x42b2c3,_0x4088('0x10'));logger[_0x4088('0x11')]('Migration,\x20%s,\x20%s,\x20%s',_0x42b2c3,_0x4088('0x10'),JSON[_0x4088('0x12')](_0x32fbb6));if(_0x32fbb6[_0x4088('0x13')]){if(_0x32fbb6['error'][_0x4088('0x14')]===0x1f4){logger[_0x4088('0x13')]('Migration,\x20%s,\x20%s',_0x42b2c3,_0x32fbb6[_0x4088('0x13')][_0x4088('0x15')]);return _0x8f007c(_0x32fbb6[_0x4088('0x13')][_0x4088('0x15')]);}logger[_0x4088('0x13')](_0x4088('0xf'),_0x42b2c3,_0x32fbb6[_0x4088('0x13')][_0x4088('0x15')]);return _0x680227(_0x32fbb6[_0x4088('0x13')][_0x4088('0x15')]);}else{logger[_0x4088('0xe')](_0x4088('0xf'),_0x42b2c3,_0x4088('0x10'));_0x680227(_0x32fbb6[_0x4088('0x16')][_0x4088('0x15')]);}})[_0x4088('0x17')](function(_0x38c6d6){logger[_0x4088('0x13')]('Migration,\x20%s,\x20%s',_0x42b2c3,_0x38c6d6);_0x8f007c(_0x38c6d6);});});} \ No newline at end of file diff --git a/server/api/network/index.js b/server/api/network/index.js index 9778168..530c6e6 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 _0x5cb4=['/:id','post','create','put','update','delete','destroy','exports','multer','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./network.controller','get','isAuthenticated','index'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5cb4,0xc6));var _0x45cb=function(_0x427e91,_0x42a122){_0x427e91=_0x427e91-0x0;var _0x4ef44e=_0x5cb4[_0x427e91];return _0x4ef44e;};'use strict';var multer=require(_0x45cb('0x0'));var util=require('util');var path=require(_0x45cb('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x45cb('0x2')]();var fs_extra=require(_0x45cb('0x3'));var auth=require(_0x45cb('0x4'));var interaction=require(_0x45cb('0x5'));var config=require(_0x45cb('0x6'));var controller=require(_0x45cb('0x7'));router[_0x45cb('0x8')]('/',auth[_0x45cb('0x9')](),controller[_0x45cb('0xa')]);router[_0x45cb('0x8')](_0x45cb('0xb'),auth[_0x45cb('0x9')](),controller['show']);router[_0x45cb('0xc')]('/',auth[_0x45cb('0x9')](),controller[_0x45cb('0xd')]);router[_0x45cb('0xe')](_0x45cb('0xb'),auth['isAuthenticated'](),controller[_0x45cb('0xf')]);router[_0x45cb('0x10')](_0x45cb('0xb'),auth[_0x45cb('0x9')](),controller[_0x45cb('0x11')]);module[_0x45cb('0x12')]=router; \ No newline at end of file +var _0x8fd4=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./network.controller','isAuthenticated','index','get','/:id','show','post','create','put','update','delete','destroy','exports','util','path'];(function(_0x550d12,_0x5384bd){var _0x12103d=function(_0x2a9834){while(--_0x2a9834){_0x550d12['push'](_0x550d12['shift']());}};_0x12103d(++_0x5384bd);}(_0x8fd4,0x178));var _0x48fd=function(_0x263a74,_0xc31414){_0x263a74=_0x263a74-0x0;var _0x2aa86c=_0x8fd4[_0x263a74];return _0x2aa86c;};'use strict';var multer=require('multer');var util=require(_0x48fd('0x0'));var path=require(_0x48fd('0x1'));var timeout=require(_0x48fd('0x2'));var express=require(_0x48fd('0x3'));var router=express[_0x48fd('0x4')]();var fs_extra=require(_0x48fd('0x5'));var auth=require(_0x48fd('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x48fd('0x7'));var controller=require(_0x48fd('0x8'));router['get']('/',auth[_0x48fd('0x9')](),controller[_0x48fd('0xa')]);router[_0x48fd('0xb')](_0x48fd('0xc'),auth[_0x48fd('0x9')](),controller[_0x48fd('0xd')]);router[_0x48fd('0xe')]('/',auth[_0x48fd('0x9')](),controller[_0x48fd('0xf')]);router[_0x48fd('0x10')](_0x48fd('0xc'),auth['isAuthenticated'](),controller[_0x48fd('0x11')]);router[_0x48fd('0x12')](_0x48fd('0xc'),auth[_0x48fd('0x9')](),controller[_0x48fd('0x13')]);module[_0x48fd('0x14')]=router; \ No newline at end of file diff --git a/server/api/network/network.attributes.js b/server/api/network/network.attributes.js index 723ad04..190da6f 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 _0xeead=['STRING','sequelize','ENUM','localnet','externip','stun','turn'];(function(_0xcaf67c,_0x149303){var _0x1245f2=function(_0x2f1d95){while(--_0x2f1d95){_0xcaf67c['push'](_0xcaf67c['shift']());}};_0x1245f2(++_0x149303);}(_0xeead,0x190));var _0xdeea=function(_0x26e466,_0x2d94ef){_0x26e466=_0x26e466-0x0;var _0x52a302=_0xeead[_0x26e466];return _0x52a302;};'use strict';var Sequelize=require(_0xdeea('0x0'));module['exports']={'type':{'type':Sequelize[_0xdeea('0x1')](_0xdeea('0x2'),_0xdeea('0x3'),_0xdeea('0x4'),_0xdeea('0x5'))},'value':{'type':Sequelize[_0xdeea('0x6')]},'username':{'type':Sequelize[_0xdeea('0x6')]},'password':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x8426=['localnet','externip','stun','turn','STRING','sequelize'];(function(_0x147d42,_0x25e693){var _0x4755b0=function(_0x56b0ef){while(--_0x56b0ef){_0x147d42['push'](_0x147d42['shift']());}};_0x4755b0(++_0x25e693);}(_0x8426,0x149));var _0x6842=function(_0x4b2863,_0x494899){_0x4b2863=_0x4b2863-0x0;var _0x567d67=_0x8426[_0x4b2863];return _0x567d67;};'use strict';var Sequelize=require(_0x6842('0x0'));module['exports']={'type':{'type':Sequelize['ENUM'](_0x6842('0x1'),_0x6842('0x2'),_0x6842('0x3'),_0x6842('0x4'))},'value':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x6842('0x5')]},'password':{'type':Sequelize[_0x6842('0x5')]}}; \ No newline at end of file diff --git a/server/api/network/network.controller.js b/server/api/network/network.controller.js index 3b2abe7..1f43ea2 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 _0x393f=['/etc/asterisk/stun_xcally.conf','Reload','res_stun_monitor.so','TURN','server/files/templates/turn_multiple.ejs','/etc/asterisk/turn_xcally.conf','readFileSync','server/files/templates/network.ejs','toLowerCase','chan_sip.so','update','STUN','format','/etc/asterisk/sip_xcally_%s.conf','util','path','lodash','../../components/parsers/qs','../../config/logger','../../config/environment','../../mysqldb','jayson/promise','client','http','request','then','info','Network,\x20%s,\x20%s','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','status','json','offset','undefined','limit','count','set','destroy','end','sendStatus','name','send','index','map','rawAttributes','type','key','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','Network','includeAll','include','findAll','rows','catch','show','params','length','options','find','create','body','toUpperCase','join','root','server/files/templates/stun_multiple.ejs','utf8','render','writeFileSync'];(function(_0x354a8e,_0x23f6ea){var _0x30f96e=function(_0xac6a76){while(--_0xac6a76){_0x354a8e['push'](_0x354a8e['shift']());}};_0x30f96e(++_0x23f6ea);}(_0x393f,0x16e));var _0xf393=function(_0x1bc144,_0x52f6af){_0x1bc144=_0x1bc144-0x0;var _0x3f6924=_0x393f[_0x1bc144];return _0x3f6924;};'use strict';var util=require(_0xf393('0x0'));var path=require(_0xf393('0x1'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xf393('0x2'));var qs=require(_0xf393('0x3'));var logger=require(_0xf393('0x4'))('api');var config=require(_0xf393('0x5'));var db=require(_0xf393('0x6'))['db'];var jayson=require(_0xf393('0x7'));var client=jayson[_0xf393('0x8')][_0xf393('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x11b726,_0x4dbcdf,_0x374b0a,_0x50b6e7){return new Promise(function(_0x2a071c,_0x37fa6b){var _0x2f7c28=_0x50b6e7||client;return _0x2f7c28[_0xf393('0xa')](_0x11b726,_0x374b0a)[_0xf393('0xb')](function(_0x13ff66){logger[_0xf393('0xc')](_0xf393('0xd'),_0x4dbcdf,_0xf393('0xe'));logger[_0xf393('0xf')](_0xf393('0x10'),_0x4dbcdf,'request\x20sent',JSON[_0xf393('0x11')](_0x13ff66));if(_0x13ff66[_0xf393('0x12')]){if(_0x13ff66[_0xf393('0x12')][_0xf393('0x13')]===0x1f4){logger['error']('Network,\x20%s,\x20%s',_0x4dbcdf,_0x13ff66[_0xf393('0x12')]['message']);return _0x37fa6b(_0x13ff66[_0xf393('0x12')][_0xf393('0x14')]);}logger['error'](_0xf393('0xd'),_0x4dbcdf,_0x13ff66['error'][_0xf393('0x14')]);return _0x2a071c(_0x13ff66[_0xf393('0x12')][_0xf393('0x14')]);}else{logger['info']('Network,\x20%s,\x20%s',_0x4dbcdf,_0xf393('0xe'));_0x2a071c(_0x13ff66[_0xf393('0x15')][_0xf393('0x14')]);}})['catch'](function(_0x5cf58e){logger['error'](_0xf393('0xd'),_0x4dbcdf,_0x5cf58e);_0x37fa6b(_0x5cf58e);});});}function respondWithResult(_0x512679,_0x175bd4){_0x175bd4=_0x175bd4||0xc8;return function(_0x975a6b){if(_0x975a6b){return _0x512679[_0xf393('0x16')](_0x175bd4)[_0xf393('0x17')](_0x975a6b);}};}function respondWithFilteredResult(_0x1886b9,_0x2c292c){return function(_0xeae462){if(_0xeae462){var _0x49000b=typeof _0x2c292c[_0xf393('0x18')]===_0xf393('0x19')&&typeof _0x2c292c[_0xf393('0x1a')]===_0xf393('0x19');var _0x142fa5=_0xeae462[_0xf393('0x1b')];var _0x42b853=_0x49000b?0x0:_0x2c292c[_0xf393('0x18')];var _0x228300=_0x49000b?_0xeae462[_0xf393('0x1b')]:_0x2c292c['offset']+_0x2c292c[_0xf393('0x1a')];var _0x418bfa;if(_0x228300>=_0x142fa5){_0x228300=_0x142fa5;_0x418bfa=0xc8;}else{_0x418bfa=0xce;}_0x1886b9[_0xf393('0x16')](_0x418bfa);return _0x1886b9[_0xf393('0x1c')]('Content-Range',_0x42b853+'-'+_0x228300+'/'+_0x142fa5)[_0xf393('0x17')](_0xeae462);}return null;};}function saveUpdates(_0x1bd0b4){return function(_0x5a1ec1){if(_0x5a1ec1){return _0x5a1ec1['update'](_0x1bd0b4)[_0xf393('0xb')](function(_0x2f2dd7){return _0x2f2dd7;});}return null;};}function removeEntity(_0x440c22){return function(_0x5070e8){if(_0x5070e8){return _0x5070e8[_0xf393('0x1d')]()['then'](function(){_0x440c22[_0xf393('0x16')](0xcc)[_0xf393('0x1e')]();});}};}function handleEntityNotFound(_0x535ae5){return function(_0x44fa0){if(!_0x44fa0){_0x535ae5[_0xf393('0x1f')](0x194);}return _0x44fa0;};}function handleError(_0x4af577,_0xce745a){_0xce745a=_0xce745a||0x1f4;return function(_0x4821b2){logger[_0xf393('0x12')](_0x4821b2['stack']);if(_0x4821b2[_0xf393('0x20')]){delete _0x4821b2[_0xf393('0x20')];}_0x4af577[_0xf393('0x16')](_0xce745a)[_0xf393('0x21')](_0x4821b2);};}exports[_0xf393('0x22')]=function(_0x283626,_0x2bdb33){var _0x2f5de5={},_0x3d20c4={},_0x2e98ad={'count':0x0,'rows':[]};var _0x513d45=_[_0xf393('0x23')](db['Network'][_0xf393('0x24')],function(_0x6048fa){return{'name':_0x6048fa['fieldName'],'type':_0x6048fa[_0xf393('0x25')][_0xf393('0x26')]};});_0x3d20c4[_0xf393('0x27')]=_[_0xf393('0x23')](_0x513d45,_0xf393('0x20'));_0x3d20c4[_0xf393('0x28')]=_[_0xf393('0x29')](_0x283626[_0xf393('0x28')]);_0x3d20c4[_0xf393('0x2a')]=_['intersection'](_0x3d20c4[_0xf393('0x27')],_0x3d20c4[_0xf393('0x28')]);_0x2f5de5[_0xf393('0x2b')]=_[_0xf393('0x2c')](_0x3d20c4[_0xf393('0x27')],qs[_0xf393('0x2d')](_0x283626['query'][_0xf393('0x2d')]));_0x2f5de5[_0xf393('0x2b')]=_0x2f5de5[_0xf393('0x2b')]['length']?_0x2f5de5[_0xf393('0x2b')]:_0x3d20c4[_0xf393('0x27')];if(!_0x283626[_0xf393('0x28')][_0xf393('0x2e')](_0xf393('0x2f'))){_0x2f5de5[_0xf393('0x1a')]=qs[_0xf393('0x1a')](_0x283626[_0xf393('0x28')][_0xf393('0x1a')]);_0x2f5de5[_0xf393('0x18')]=qs[_0xf393('0x18')](_0x283626['query'][_0xf393('0x18')]);}_0x2f5de5[_0xf393('0x30')]=qs[_0xf393('0x31')](_0x283626[_0xf393('0x28')][_0xf393('0x31')]);_0x2f5de5[_0xf393('0x32')]=qs[_0xf393('0x2a')](_['pick'](_0x283626[_0xf393('0x28')],_0x3d20c4[_0xf393('0x2a')]),_0x513d45);if(_0x283626[_0xf393('0x28')][_0xf393('0x33')]){_0x2f5de5['where']=_[_0xf393('0x34')](_0x2f5de5['where'],{'$or':_[_0xf393('0x23')](_0x513d45,function(_0x3165a1){if(_0x3165a1[_0xf393('0x25')]!==_0xf393('0x35')){var _0x40660e={};_0x40660e[_0x3165a1[_0xf393('0x20')]]={'$like':'%'+_0x283626[_0xf393('0x28')][_0xf393('0x33')]+'%'};return _0x40660e;}})});}_0x2f5de5=_['merge']({},_0x2f5de5,_0x283626['options']);var _0x137ca1={'where':_0x2f5de5[_0xf393('0x32')]};return db[_0xf393('0x36')]['count'](_0x137ca1)['then'](function(_0x430b0e){_0x2e98ad[_0xf393('0x1b')]=_0x430b0e;if(_0x283626[_0xf393('0x28')][_0xf393('0x37')]){_0x2f5de5[_0xf393('0x38')]=[{'all':!![]}];}return db['Network'][_0xf393('0x39')](_0x2f5de5);})['then'](function(_0x1f84e7){_0x2e98ad[_0xf393('0x3a')]=_0x1f84e7;return _0x2e98ad;})[_0xf393('0xb')](respondWithFilteredResult(_0x2bdb33,_0x2f5de5))[_0xf393('0x3b')](handleError(_0x2bdb33,null));};exports[_0xf393('0x3c')]=function(_0x79c84a,_0x444e66){var _0x164c35={'raw':!![],'where':{'id':_0x79c84a[_0xf393('0x3d')]['id']}},_0x512780={};_0x512780[_0xf393('0x27')]=_[_0xf393('0x29')](db[_0xf393('0x36')][_0xf393('0x24')]);_0x512780[_0xf393('0x28')]=_[_0xf393('0x29')](_0x79c84a['query']);_0x512780[_0xf393('0x2a')]=_['intersection'](_0x512780[_0xf393('0x27')],_0x512780[_0xf393('0x28')]);_0x164c35[_0xf393('0x2b')]=_[_0xf393('0x2c')](_0x512780[_0xf393('0x27')],qs[_0xf393('0x2d')](_0x79c84a['query']['fields']));_0x164c35['attributes']=_0x164c35[_0xf393('0x2b')][_0xf393('0x3e')]?_0x164c35[_0xf393('0x2b')]:_0x512780[_0xf393('0x27')];if(_0x79c84a[_0xf393('0x28')][_0xf393('0x37')]){_0x164c35['include']=[{'all':!![]}];}_0x164c35=_[_0xf393('0x34')]({},_0x164c35,_0x79c84a[_0xf393('0x3f')]);return db[_0xf393('0x36')][_0xf393('0x40')](_0x164c35)[_0xf393('0xb')](handleEntityNotFound(_0x444e66,null))[_0xf393('0xb')](respondWithResult(_0x444e66,null))[_0xf393('0x3b')](handleError(_0x444e66,null));};exports[_0xf393('0x41')]=function(_0x5c7a28,_0x9445b8){var _0x3fb84c;return db[_0xf393('0x36')][_0xf393('0x41')](_0x5c7a28[_0xf393('0x42')],{'raw':!![]})[_0xf393('0xb')](function(_0x3aaa79){_0x3fb84c=_0x3aaa79;return db['Network'][_0xf393('0x39')]({'where':{'type':_0x5c7a28[_0xf393('0x42')]['type']},'raw':!![]});})['then'](function(_0x4ffffc){if(_0x3fb84c[_0xf393('0x25')][_0xf393('0x43')]()=='STUN'){var _0x56e19f=fs['readFileSync'](path[_0xf393('0x44')](config[_0xf393('0x45')],_0xf393('0x46')),_0xf393('0x47'));var _0x164414=ejs[_0xf393('0x48')](_0x56e19f,{'networks':_0x4ffffc||[]});fs[_0xf393('0x49')](_0xf393('0x4a'),_0x164414);return respondWithRpcPromise(_0xf393('0x4b'),'create',{'module':_0xf393('0x4c')});}else if(_0x3fb84c[_0xf393('0x25')]['toUpperCase']()==_0xf393('0x4d')){var _0x7e5939=fs['readFileSync'](path[_0xf393('0x44')](config['root'],_0xf393('0x4e')),_0xf393('0x47'));var _0x312e73=ejs[_0xf393('0x48')](_0x7e5939,{'networks':_0x4ffffc||[]});fs[_0xf393('0x49')](_0xf393('0x4f'),_0x312e73);return respondWithRpcPromise('Reload',_0xf393('0x41'),{'module':_0xf393('0x4c')});}else{var _0x480b38=fs[_0xf393('0x50')](path[_0xf393('0x44')](config[_0xf393('0x45')],_0xf393('0x51')),_0xf393('0x47'));var _0x2ab25f=ejs[_0xf393('0x48')](_0x480b38,{'networks':_0x4ffffc||[]});fs['writeFileSync'](util['format']('/etc/asterisk/sip_xcally_%s.conf',_0x5c7a28[_0xf393('0x42')][_0xf393('0x25')][_0xf393('0x52')]()),_0x2ab25f);return respondWithRpcPromise('Reload',_0xf393('0x41'),{'module':_0xf393('0x53')});}})[_0xf393('0xb')](function(){return _0x3fb84c;})[_0xf393('0xb')](respondWithResult(_0x9445b8,0xc9))[_0xf393('0x3b')](handleError(_0x9445b8,null));};exports[_0xf393('0x54')]=function(_0xe085c9,_0x2265eb){var _0x217a0f;return db[_0xf393('0x36')][_0xf393('0x40')]({'where':{'id':_0xe085c9[_0xf393('0x3d')]['id']}})[_0xf393('0xb')](handleEntityNotFound(_0x2265eb,null))[_0xf393('0xb')](saveUpdates(_0xe085c9[_0xf393('0x42')],null))['then'](function(_0x213806){if(_0x213806){_0x217a0f=_0x213806;return db['Network'][_0xf393('0x39')]({'where':{'type':_0x217a0f['type']},'raw':!![]});}return null;})[_0xf393('0xb')](function(_0x1ede00){if(_0x217a0f[_0xf393('0x25')][_0xf393('0x43')]()==_0xf393('0x55')){var _0x11f8bd=fs[_0xf393('0x50')](path[_0xf393('0x44')](config[_0xf393('0x45')],_0xf393('0x46')),'utf8');var _0x1608da=ejs[_0xf393('0x48')](_0x11f8bd,{'networks':_0x1ede00||[]});fs[_0xf393('0x49')](_0xf393('0x4a'),_0x1608da);return respondWithRpcPromise(_0xf393('0x4b'),_0xf393('0x54'),{'module':_0xf393('0x4c')});}else if(_0x217a0f[_0xf393('0x25')]['toUpperCase']()=='TURN'){var _0x3eeb9c=fs[_0xf393('0x50')](path[_0xf393('0x44')](config[_0xf393('0x45')],'server/files/templates/turn_multiple.ejs'),_0xf393('0x47'));var _0x221ff8=ejs[_0xf393('0x48')](_0x3eeb9c,{'networks':_0x1ede00||[]});fs[_0xf393('0x49')](_0xf393('0x4f'),_0x221ff8);return respondWithRpcPromise(_0xf393('0x4b'),_0xf393('0x54'),{'module':_0xf393('0x4c')});}else{var _0x27c50f=fs[_0xf393('0x50')](path['join'](config[_0xf393('0x45')],_0xf393('0x51')),_0xf393('0x47'));var _0x5977cb=ejs['render'](_0x27c50f,{'networks':_0x1ede00||[]});fs[_0xf393('0x49')](util[_0xf393('0x56')](_0xf393('0x57'),_0xe085c9[_0xf393('0x42')][_0xf393('0x25')][_0xf393('0x52')]()),_0x5977cb);return respondWithRpcPromise(_0xf393('0x4b'),_0xf393('0x54'),{'module':_0xf393('0x53')});}})[_0xf393('0xb')](function(_0x175647){if(_0x175647){return _0x217a0f;}return null;})[_0xf393('0xb')](respondWithResult(_0x2265eb,null))[_0xf393('0x3b')](handleError(_0x2265eb,null));};exports[_0xf393('0x1d')]=function(_0x3c17a8,_0x140cd7){var _0x35e9ce;return db['Network']['find']({'where':{'id':_0x3c17a8[_0xf393('0x3d')]['id']}})[_0xf393('0xb')](function(_0x4dadc0){_0x35e9ce=_0x4dadc0;return _0x4dadc0;})['then'](handleEntityNotFound(_0x140cd7,null))[_0xf393('0xb')](removeEntity(_0x140cd7,null))['then'](function(){if(_0x35e9ce){return db[_0xf393('0x36')]['findAll']({'where':{'type':_0x35e9ce[_0xf393('0x25')]},'raw':!![]});}})[_0xf393('0xb')](function(_0x584b70){if(_0x35e9ce[_0xf393('0x25')][_0xf393('0x43')]()=='STUN'){var _0x163ae0=fs[_0xf393('0x50')](path['join'](config[_0xf393('0x45')],_0xf393('0x46')),'utf8');var _0xeccd24=ejs['render'](_0x163ae0,{'networks':_0x584b70||[]});fs[_0xf393('0x49')]('/etc/asterisk/stun_xcally.conf',_0xeccd24);return respondWithRpcPromise('Reload',_0xf393('0x1d'),{'module':_0xf393('0x4c')});}else if(_0x35e9ce[_0xf393('0x25')][_0xf393('0x43')]()==_0xf393('0x4d')){var _0x3c9465=fs[_0xf393('0x50')](path[_0xf393('0x44')](config['root'],_0xf393('0x4e')),_0xf393('0x47'));var _0x2f8d7b=ejs['render'](_0x3c9465,{'networks':_0x584b70||[]});fs[_0xf393('0x49')](_0xf393('0x4f'),_0x2f8d7b);return respondWithRpcPromise(_0xf393('0x4b'),_0xf393('0x1d'),{'module':_0xf393('0x4c')});}else{var _0xef188=fs[_0xf393('0x50')](path[_0xf393('0x44')](config[_0xf393('0x45')],'server/files/templates/network.ejs'),_0xf393('0x47'));var _0x29e6d1=ejs[_0xf393('0x48')](_0xef188,{'networks':_0x584b70||[]});fs[_0xf393('0x49')](util[_0xf393('0x56')](_0xf393('0x57'),_0x35e9ce[_0xf393('0x25')][_0xf393('0x52')]()),_0x29e6d1);return respondWithRpcPromise(_0xf393('0x4b'),_0xf393('0x1d'),{'module':_0xf393('0x53')});}})[_0xf393('0x3b')](handleError(_0x140cd7,null));}; \ No newline at end of file +var _0x79c7=['params','find','create','findAll','body','toUpperCase','STUN','readFileSync','join','root','server/files/templates/stun_multiple.ejs','utf8','render','writeFileSync','/etc/asterisk/stun_xcally.conf','res_stun_monitor.so','TURN','server/files/templates/turn_multiple.ejs','/etc/asterisk/turn_xcally.conf','server/files/templates/network.ejs','format','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','Reload','chan_sip.so','util','path','lodash','../../components/parsers/qs','api','../../config/environment','../../mysqldb','jayson/promise','http','request','Network,\x20%s,\x20%s','Network,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','request\x20sent','result','catch','status','json','offset','undefined','limit','count','set','update','then','destroy','end','sendStatus','stack','name','send','index','Network','rawAttributes','fieldName','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','filter','map','type','merge','options','include','rows','show'];(function(_0x261cac,_0xc8585){var _0x1edaa1=function(_0x32a27f){while(--_0x32a27f){_0x261cac['push'](_0x261cac['shift']());}};_0x1edaa1(++_0xc8585);}(_0x79c7,0x1c2));var _0x779c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x79c7[_0x3dd15e];return _0x231fd0;};'use strict';var util=require(_0x779c('0x0'));var path=require(_0x779c('0x1'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x779c('0x2'));var qs=require(_0x779c('0x3'));var logger=require('../../config/logger')(_0x779c('0x4'));var config=require(_0x779c('0x5'));var db=require(_0x779c('0x6'))['db'];var jayson=require(_0x779c('0x7'));var client=jayson['client'][_0x779c('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x42cfb9,_0x125f5f,_0x358d40,_0x2b5999){return new Promise(function(_0x38da6c,_0x559f6c){var _0x476004=_0x2b5999||client;return _0x476004[_0x779c('0x9')](_0x42cfb9,_0x358d40)['then'](function(_0xab48bc){logger['info'](_0x779c('0xa'),_0x125f5f,'request\x20sent');logger['debug'](_0x779c('0xb'),_0x125f5f,'request\x20sent',JSON[_0x779c('0xc')](_0xab48bc));if(_0xab48bc[_0x779c('0xd')]){if(_0xab48bc['error'][_0x779c('0xe')]===0x1f4){logger['error'](_0x779c('0xa'),_0x125f5f,_0xab48bc['error']['message']);return _0x559f6c(_0xab48bc[_0x779c('0xd')][_0x779c('0xf')]);}logger[_0x779c('0xd')](_0x779c('0xa'),_0x125f5f,_0xab48bc[_0x779c('0xd')]['message']);return _0x38da6c(_0xab48bc[_0x779c('0xd')][_0x779c('0xf')]);}else{logger[_0x779c('0x10')](_0x779c('0xa'),_0x125f5f,_0x779c('0x11'));_0x38da6c(_0xab48bc[_0x779c('0x12')]['message']);}})[_0x779c('0x13')](function(_0x283a4f){logger[_0x779c('0xd')]('Network,\x20%s,\x20%s',_0x125f5f,_0x283a4f);_0x559f6c(_0x283a4f);});});}function respondWithResult(_0x9b03c0,_0x44ad5f){_0x44ad5f=_0x44ad5f||0xc8;return function(_0x53ec92){if(_0x53ec92){return _0x9b03c0[_0x779c('0x14')](_0x44ad5f)[_0x779c('0x15')](_0x53ec92);}};}function respondWithFilteredResult(_0x595004,_0x163b25){return function(_0x21223e){if(_0x21223e){var _0x414d30=typeof _0x163b25[_0x779c('0x16')]===_0x779c('0x17')&&typeof _0x163b25[_0x779c('0x18')]==='undefined';var _0x11cbaf=_0x21223e[_0x779c('0x19')];var _0x24fd6a=_0x414d30?0x0:_0x163b25[_0x779c('0x16')];var _0x4c9473=_0x414d30?_0x21223e[_0x779c('0x19')]:_0x163b25[_0x779c('0x16')]+_0x163b25[_0x779c('0x18')];var _0x62ae1b;if(_0x4c9473>=_0x11cbaf){_0x4c9473=_0x11cbaf;_0x62ae1b=0xc8;}else{_0x62ae1b=0xce;}_0x595004[_0x779c('0x14')](_0x62ae1b);return _0x595004[_0x779c('0x1a')]('Content-Range',_0x24fd6a+'-'+_0x4c9473+'/'+_0x11cbaf)[_0x779c('0x15')](_0x21223e);}return null;};}function saveUpdates(_0x41081a){return function(_0x35a882){if(_0x35a882){return _0x35a882[_0x779c('0x1b')](_0x41081a)[_0x779c('0x1c')](function(_0x359d4d){return _0x359d4d;});}return null;};}function removeEntity(_0x74bc5b){return function(_0x143580){if(_0x143580){return _0x143580[_0x779c('0x1d')]()[_0x779c('0x1c')](function(){_0x74bc5b[_0x779c('0x14')](0xcc)[_0x779c('0x1e')]();});}};}function handleEntityNotFound(_0x1a0ea4){return function(_0x208ccb){if(!_0x208ccb){_0x1a0ea4[_0x779c('0x1f')](0x194);}return _0x208ccb;};}function handleError(_0x540762,_0x4beda7){_0x4beda7=_0x4beda7||0x1f4;return function(_0x2b6e5c){logger['error'](_0x2b6e5c[_0x779c('0x20')]);if(_0x2b6e5c[_0x779c('0x21')]){delete _0x2b6e5c[_0x779c('0x21')];}_0x540762[_0x779c('0x14')](_0x4beda7)[_0x779c('0x22')](_0x2b6e5c);};}exports[_0x779c('0x23')]=function(_0x2a64cd,_0x5620d0){var _0x48c13b={},_0x1b24b5={},_0x37605e={'count':0x0,'rows':[]};var _0x17fca1=_['map'](db[_0x779c('0x24')][_0x779c('0x25')],function(_0x13823d){return{'name':_0x13823d[_0x779c('0x26')],'type':_0x13823d['type']['key']};});_0x1b24b5[_0x779c('0x27')]=_['map'](_0x17fca1,_0x779c('0x21'));_0x1b24b5['query']=_[_0x779c('0x28')](_0x2a64cd[_0x779c('0x29')]);_0x1b24b5[_0x779c('0x2a')]=_['intersection'](_0x1b24b5[_0x779c('0x27')],_0x1b24b5[_0x779c('0x29')]);_0x48c13b[_0x779c('0x2b')]=_[_0x779c('0x2c')](_0x1b24b5[_0x779c('0x27')],qs[_0x779c('0x2d')](_0x2a64cd[_0x779c('0x29')][_0x779c('0x2d')]));_0x48c13b[_0x779c('0x2b')]=_0x48c13b[_0x779c('0x2b')][_0x779c('0x2e')]?_0x48c13b[_0x779c('0x2b')]:_0x1b24b5[_0x779c('0x27')];if(!_0x2a64cd[_0x779c('0x29')][_0x779c('0x2f')]('nolimit')){_0x48c13b['limit']=qs[_0x779c('0x18')](_0x2a64cd[_0x779c('0x29')][_0x779c('0x18')]);_0x48c13b[_0x779c('0x16')]=qs[_0x779c('0x16')](_0x2a64cd[_0x779c('0x29')]['offset']);}_0x48c13b[_0x779c('0x30')]=qs[_0x779c('0x31')](_0x2a64cd[_0x779c('0x29')][_0x779c('0x31')]);_0x48c13b[_0x779c('0x32')]=qs['filters'](_[_0x779c('0x33')](_0x2a64cd[_0x779c('0x29')],_0x1b24b5[_0x779c('0x2a')]),_0x17fca1);if(_0x2a64cd[_0x779c('0x29')][_0x779c('0x34')]){_0x48c13b[_0x779c('0x32')]=_['merge'](_0x48c13b[_0x779c('0x32')],{'$or':_[_0x779c('0x35')](_0x17fca1,function(_0x1af8b6){if(_0x1af8b6[_0x779c('0x36')]!=='VIRTUAL'){var _0x3d375f={};_0x3d375f[_0x1af8b6[_0x779c('0x21')]]={'$like':'%'+_0x2a64cd['query'][_0x779c('0x34')]+'%'};return _0x3d375f;}})});}_0x48c13b=_[_0x779c('0x37')]({},_0x48c13b,_0x2a64cd[_0x779c('0x38')]);var _0x232e2d={'where':_0x48c13b['where']};return db[_0x779c('0x24')][_0x779c('0x19')](_0x232e2d)[_0x779c('0x1c')](function(_0x1a7c18){_0x37605e['count']=_0x1a7c18;if(_0x2a64cd[_0x779c('0x29')]['includeAll']){_0x48c13b[_0x779c('0x39')]=[{'all':!![]}];}return db['Network']['findAll'](_0x48c13b);})[_0x779c('0x1c')](function(_0x3ee42){_0x37605e[_0x779c('0x3a')]=_0x3ee42;return _0x37605e;})[_0x779c('0x1c')](respondWithFilteredResult(_0x5620d0,_0x48c13b))[_0x779c('0x13')](handleError(_0x5620d0,null));};exports[_0x779c('0x3b')]=function(_0x456953,_0x4cad9e){var _0x2a6a47={'raw':!![],'where':{'id':_0x456953[_0x779c('0x3c')]['id']}},_0x1735b0={};_0x1735b0['model']=_[_0x779c('0x28')](db[_0x779c('0x24')][_0x779c('0x25')]);_0x1735b0[_0x779c('0x29')]=_[_0x779c('0x28')](_0x456953[_0x779c('0x29')]);_0x1735b0[_0x779c('0x2a')]=_['intersection'](_0x1735b0['model'],_0x1735b0[_0x779c('0x29')]);_0x2a6a47[_0x779c('0x2b')]=_[_0x779c('0x2c')](_0x1735b0[_0x779c('0x27')],qs[_0x779c('0x2d')](_0x456953['query'][_0x779c('0x2d')]));_0x2a6a47[_0x779c('0x2b')]=_0x2a6a47['attributes'][_0x779c('0x2e')]?_0x2a6a47[_0x779c('0x2b')]:_0x1735b0[_0x779c('0x27')];if(_0x456953[_0x779c('0x29')]['includeAll']){_0x2a6a47[_0x779c('0x39')]=[{'all':!![]}];}_0x2a6a47=_['merge']({},_0x2a6a47,_0x456953[_0x779c('0x38')]);return db[_0x779c('0x24')][_0x779c('0x3d')](_0x2a6a47)[_0x779c('0x1c')](handleEntityNotFound(_0x4cad9e,null))[_0x779c('0x1c')](respondWithResult(_0x4cad9e,null))[_0x779c('0x13')](handleError(_0x4cad9e,null));};exports['create']=function(_0x433fd2,_0x1b0c55){var _0x5bd4b5;return db['Network'][_0x779c('0x3e')](_0x433fd2['body'],{'raw':!![]})['then'](function(_0x5d3174){_0x5bd4b5=_0x5d3174;return db[_0x779c('0x24')][_0x779c('0x3f')]({'where':{'type':_0x433fd2[_0x779c('0x40')][_0x779c('0x36')]},'raw':!![]});})[_0x779c('0x1c')](function(_0x26f311){if(_0x5bd4b5[_0x779c('0x36')][_0x779c('0x41')]()==_0x779c('0x42')){var _0x3e555f=fs[_0x779c('0x43')](path[_0x779c('0x44')](config[_0x779c('0x45')],_0x779c('0x46')),_0x779c('0x47'));var _0x5f308f=ejs[_0x779c('0x48')](_0x3e555f,{'networks':_0x26f311||[]});fs[_0x779c('0x49')](_0x779c('0x4a'),_0x5f308f);return respondWithRpcPromise('Reload','create',{'module':_0x779c('0x4b')});}else if(_0x5bd4b5[_0x779c('0x36')][_0x779c('0x41')]()==_0x779c('0x4c')){var _0x47d408=fs['readFileSync'](path[_0x779c('0x44')](config['root'],_0x779c('0x4d')),'utf8');var _0x1158c5=ejs[_0x779c('0x48')](_0x47d408,{'networks':_0x26f311||[]});fs[_0x779c('0x49')](_0x779c('0x4e'),_0x1158c5);return respondWithRpcPromise('Reload',_0x779c('0x3e'),{'module':_0x779c('0x4b')});}else{var _0x49307e=fs[_0x779c('0x43')](path[_0x779c('0x44')](config[_0x779c('0x45')],_0x779c('0x4f')),_0x779c('0x47'));var _0x2c1c95=ejs[_0x779c('0x48')](_0x49307e,{'networks':_0x26f311||[]});fs['writeFileSync'](util[_0x779c('0x50')](_0x779c('0x51'),_0x433fd2[_0x779c('0x40')][_0x779c('0x36')][_0x779c('0x52')]()),_0x2c1c95);return respondWithRpcPromise(_0x779c('0x53'),_0x779c('0x3e'),{'module':_0x779c('0x54')});}})[_0x779c('0x1c')](function(){return _0x5bd4b5;})[_0x779c('0x1c')](respondWithResult(_0x1b0c55,0xc9))[_0x779c('0x13')](handleError(_0x1b0c55,null));};exports[_0x779c('0x1b')]=function(_0x2b2130,_0x3a1dc9){var _0x8a7690;return db['Network'][_0x779c('0x3d')]({'where':{'id':_0x2b2130[_0x779c('0x3c')]['id']}})[_0x779c('0x1c')](handleEntityNotFound(_0x3a1dc9,null))[_0x779c('0x1c')](saveUpdates(_0x2b2130[_0x779c('0x40')],null))[_0x779c('0x1c')](function(_0xef5c15){if(_0xef5c15){_0x8a7690=_0xef5c15;return db[_0x779c('0x24')][_0x779c('0x3f')]({'where':{'type':_0x8a7690[_0x779c('0x36')]},'raw':!![]});}return null;})[_0x779c('0x1c')](function(_0x5e4e38){if(_0x8a7690['type'][_0x779c('0x41')]()==_0x779c('0x42')){var _0x2893c9=fs['readFileSync'](path[_0x779c('0x44')](config['root'],_0x779c('0x46')),_0x779c('0x47'));var _0x15edc0=ejs[_0x779c('0x48')](_0x2893c9,{'networks':_0x5e4e38||[]});fs[_0x779c('0x49')]('/etc/asterisk/stun_xcally.conf',_0x15edc0);return respondWithRpcPromise(_0x779c('0x53'),_0x779c('0x1b'),{'module':_0x779c('0x4b')});}else if(_0x8a7690[_0x779c('0x36')][_0x779c('0x41')]()=='TURN'){var _0x10e411=fs[_0x779c('0x43')](path[_0x779c('0x44')](config[_0x779c('0x45')],_0x779c('0x4d')),_0x779c('0x47'));var _0x541c2b=ejs[_0x779c('0x48')](_0x10e411,{'networks':_0x5e4e38||[]});fs[_0x779c('0x49')](_0x779c('0x4e'),_0x541c2b);return respondWithRpcPromise(_0x779c('0x53'),_0x779c('0x1b'),{'module':_0x779c('0x4b')});}else{var _0xc01a32=fs['readFileSync'](path[_0x779c('0x44')](config[_0x779c('0x45')],_0x779c('0x4f')),_0x779c('0x47'));var _0x3e804e=ejs['render'](_0xc01a32,{'networks':_0x5e4e38||[]});fs[_0x779c('0x49')](util['format'](_0x779c('0x51'),_0x2b2130[_0x779c('0x40')][_0x779c('0x36')][_0x779c('0x52')]()),_0x3e804e);return respondWithRpcPromise(_0x779c('0x53'),'update',{'module':_0x779c('0x54')});}})[_0x779c('0x1c')](function(_0x47e278){if(_0x47e278){return _0x8a7690;}return null;})['then'](respondWithResult(_0x3a1dc9,null))[_0x779c('0x13')](handleError(_0x3a1dc9,null));};exports['destroy']=function(_0x3d3df3,_0x3ee0bc){var _0x3a63e5;return db[_0x779c('0x24')]['find']({'where':{'id':_0x3d3df3[_0x779c('0x3c')]['id']}})[_0x779c('0x1c')](function(_0x29bd7c){_0x3a63e5=_0x29bd7c;return _0x29bd7c;})[_0x779c('0x1c')](handleEntityNotFound(_0x3ee0bc,null))['then'](removeEntity(_0x3ee0bc,null))['then'](function(){if(_0x3a63e5){return db['Network'][_0x779c('0x3f')]({'where':{'type':_0x3a63e5[_0x779c('0x36')]},'raw':!![]});}})[_0x779c('0x1c')](function(_0x4a5b2d){if(_0x3a63e5[_0x779c('0x36')][_0x779c('0x41')]()=='STUN'){var _0x200671=fs[_0x779c('0x43')](path[_0x779c('0x44')](config[_0x779c('0x45')],_0x779c('0x46')),_0x779c('0x47'));var _0x5513d2=ejs[_0x779c('0x48')](_0x200671,{'networks':_0x4a5b2d||[]});fs[_0x779c('0x49')]('/etc/asterisk/stun_xcally.conf',_0x5513d2);return respondWithRpcPromise(_0x779c('0x53'),_0x779c('0x1d'),{'module':_0x779c('0x4b')});}else if(_0x3a63e5[_0x779c('0x36')]['toUpperCase']()==_0x779c('0x4c')){var _0x164193=fs[_0x779c('0x43')](path[_0x779c('0x44')](config[_0x779c('0x45')],_0x779c('0x4d')),_0x779c('0x47'));var _0x3204ed=ejs[_0x779c('0x48')](_0x164193,{'networks':_0x4a5b2d||[]});fs[_0x779c('0x49')](_0x779c('0x4e'),_0x3204ed);return respondWithRpcPromise('Reload',_0x779c('0x1d'),{'module':_0x779c('0x4b')});}else{var _0x4abfa2=fs[_0x779c('0x43')](path[_0x779c('0x44')](config[_0x779c('0x45')],_0x779c('0x4f')),_0x779c('0x47'));var _0x2fbb72=ejs[_0x779c('0x48')](_0x4abfa2,{'networks':_0x4a5b2d||[]});fs['writeFileSync'](util[_0x779c('0x50')](_0x779c('0x51'),_0x3a63e5[_0x779c('0x36')][_0x779c('0x52')]()),_0x2fbb72);return respondWithRpcPromise(_0x779c('0x53'),_0x779c('0x1d'),{'module':_0x779c('0x54')});}})['catch'](handleError(_0x3ee0bc,null));}; \ No newline at end of file diff --git a/server/api/network/network.model.js b/server/api/network/network.model.js index a713e38..53fe4d1 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 _0x6ae2=['define','Network','network','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./network.attributes','exports'];(function(_0x12d033,_0x25fa2f){var _0x3b4e80=function(_0x46c1f4){while(--_0x46c1f4){_0x12d033['push'](_0x12d033['shift']());}};_0x3b4e80(++_0x25fa2f);}(_0x6ae2,0x1ed));var _0x26ae=function(_0x3c1ff0,_0x105a2e){_0x3c1ff0=_0x3c1ff0-0x0;var _0x588d6f=_0x6ae2[_0x3c1ff0];return _0x588d6f;};'use strict';var _=require(_0x26ae('0x0'));var util=require(_0x26ae('0x1'));var logger=require(_0x26ae('0x2'))(_0x26ae('0x3'));var moment=require(_0x26ae('0x4'));var BPromise=require(_0x26ae('0x5'));var rp=require(_0x26ae('0x6'));var fs=require('fs');var path=require(_0x26ae('0x7'));var rimraf=require(_0x26ae('0x8'));var config=require('../../config/environment');var attributes=require(_0x26ae('0x9'));module[_0x26ae('0xa')]=function(_0x595da8,_0x5609b0){return _0x595da8[_0x26ae('0xb')](_0x26ae('0xc'),attributes,{'tableName':_0x26ae('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0624=['moment','bluebird','request-promise','path','rimraf','../../config/environment','define','Network','network'];(function(_0x8a22fd,_0x3f6c4e){var _0x3e12fe=function(_0x23f52e){while(--_0x23f52e){_0x8a22fd['push'](_0x8a22fd['shift']());}};_0x3e12fe(++_0x3f6c4e);}(_0x0624,0x132));var _0x4062=function(_0x3c7f91,_0x3df019){_0x3c7f91=_0x3c7f91-0x0;var _0x1a5f4e=_0x0624[_0x3c7f91];return _0x1a5f4e;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x4062('0x0'));var BPromise=require(_0x4062('0x1'));var rp=require(_0x4062('0x2'));var fs=require('fs');var path=require(_0x4062('0x3'));var rimraf=require(_0x4062('0x4'));var config=require(_0x4062('0x5'));var attributes=require('./network.attributes');module['exports']=function(_0x353a85,_0x2ec6dd){return _0x353a85[_0x4062('0x6')](_0x4062('0x7'),attributes,{'tableName':_0x4062('0x8'),'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 cbf3f4d..6fe00fe 100644 --- a/server/api/network/network.rpc.js +++ b/server/api/network/network.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['info','Network,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x7a54,0x106));var _0x47a5=function(_0x219b48,_0x308dea){_0x219b48=_0x219b48-0x0;var _0x2bd4fa=_0x7a54[_0x219b48];return _0x2bd4fa;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('Network,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});} \ No newline at end of file +var _0x7a54=['info','Network,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x7a54,0x106));var _0x47a5=function(_0x27c3f9,_0xfcee6a){_0x27c3f9=_0x27c3f9-0x0;var _0x307da7=_0x7a54[_0x27c3f9];return _0x307da7;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('Network,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/index.js b/server/api/openchannelAccount/index.js index 6bb62c9..13843c5 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 _0x2872=['/:id','show','getDispositions','getAnswers','/:id/applications','getApplications','/:id/interactions','/:id/users','getAgents','post','create','addDisposition','/:id/canned_answers','addAnswer','/:id/notify','notify','addAgents','send','update','delete','destroy','/:id/dispositions','removeAnswers','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/describe','describe'];(function(_0x5d396c,_0x52ce0a){var _0x4e9542=function(_0x49122c){while(--_0x49122c){_0x5d396c['push'](_0x5d396c['shift']());}};_0x4e9542(++_0x52ce0a);}(_0x2872,0xd1));var _0x2287=function(_0x36ea21,_0x14f5f1){_0x36ea21=_0x36ea21-0x0;var _0x5e2ec3=_0x2872[_0x36ea21];return _0x5e2ec3;};'use strict';var multer=require(_0x2287('0x0'));var util=require(_0x2287('0x1'));var path=require(_0x2287('0x2'));var timeout=require(_0x2287('0x3'));var express=require(_0x2287('0x4'));var router=express['Router']();var fs_extra=require(_0x2287('0x5'));var auth=require(_0x2287('0x6'));var interaction=require(_0x2287('0x7'));var config=require('../../config/environment');var controller=require('./openchannelAccount.controller');router[_0x2287('0x8')]('/',auth[_0x2287('0x9')](),controller[_0x2287('0xa')]);router[_0x2287('0x8')](_0x2287('0xb'),auth[_0x2287('0x9')](),controller[_0x2287('0xc')]);router['get'](_0x2287('0xd'),auth[_0x2287('0x9')](),controller[_0x2287('0xe')]);router[_0x2287('0x8')]('/:id/dispositions',auth[_0x2287('0x9')](),controller[_0x2287('0xf')]);router['get']('/:id/canned_answers',auth[_0x2287('0x9')](),controller[_0x2287('0x10')]);router[_0x2287('0x8')](_0x2287('0x11'),auth[_0x2287('0x9')](),controller[_0x2287('0x12')]);router['get'](_0x2287('0x13'),auth[_0x2287('0x9')](),controller['getInteractions']);router[_0x2287('0x8')](_0x2287('0x14'),auth[_0x2287('0x9')](),controller[_0x2287('0x15')]);router[_0x2287('0x16')]('/',auth[_0x2287('0x9')](),controller[_0x2287('0x17')]);router[_0x2287('0x16')]('/:id/dispositions',auth[_0x2287('0x9')](),controller[_0x2287('0x18')]);router[_0x2287('0x16')](_0x2287('0x19'),auth['isAuthenticated'](),controller[_0x2287('0x1a')]);router['post'](_0x2287('0x1b'),controller[_0x2287('0x1c')]);router[_0x2287('0x16')](_0x2287('0x11'),auth[_0x2287('0x9')](),controller['addApplications']);router[_0x2287('0x16')]('/:id/users',auth[_0x2287('0x9')](),controller[_0x2287('0x1d')]);router[_0x2287('0x16')]('/:id/send',auth[_0x2287('0x9')](),controller[_0x2287('0x1e')]);router['put'](_0x2287('0xd'),auth['isAuthenticated'](),controller[_0x2287('0x1f')]);router[_0x2287('0x20')](_0x2287('0xd'),auth[_0x2287('0x9')](),controller[_0x2287('0x21')]);router[_0x2287('0x20')](_0x2287('0x22'),auth[_0x2287('0x9')](),controller['removeDispositions']);router[_0x2287('0x20')]('/:id/canned_answers',auth[_0x2287('0x9')](),controller[_0x2287('0x23')]);router[_0x2287('0x20')](_0x2287('0x14'),auth[_0x2287('0x9')](),controller['removeAgents']);module[_0x2287('0x24')]=router; \ No newline at end of file +var _0x2e7a=['express','Router','../../components/interaction/service','../../config/environment','./openchannelAccount.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','/:id/canned_answers','/:id/applications','getApplications','getInteractions','/:id/users','getAgents','create','post','addDisposition','addAnswer','/:id/notify','addAgents','/:id/send','send','delete','destroy','removeAnswers','removeAgents','exports','util','path','connect-timeout'];(function(_0x2917ee,_0x40a32){var _0xf7121c=function(_0x35a28b){while(--_0x35a28b){_0x2917ee['push'](_0x2917ee['shift']());}};_0xf7121c(++_0x40a32);}(_0x2e7a,0xcf));var _0xa2e7=function(_0x47c62a,_0x735014){_0x47c62a=_0x47c62a-0x0;var _0x587ef1=_0x2e7a[_0x47c62a];return _0x587ef1;};'use strict';var multer=require('multer');var util=require(_0xa2e7('0x0'));var path=require(_0xa2e7('0x1'));var timeout=require(_0xa2e7('0x2'));var express=require(_0xa2e7('0x3'));var router=express[_0xa2e7('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xa2e7('0x5'));var config=require(_0xa2e7('0x6'));var controller=require(_0xa2e7('0x7'));router[_0xa2e7('0x8')]('/',auth[_0xa2e7('0x9')](),controller[_0xa2e7('0xa')]);router[_0xa2e7('0x8')](_0xa2e7('0xb'),auth[_0xa2e7('0x9')](),controller[_0xa2e7('0xc')]);router['get'](_0xa2e7('0xd'),auth[_0xa2e7('0x9')](),controller[_0xa2e7('0xe')]);router['get'](_0xa2e7('0xf'),auth['isAuthenticated'](),controller['getDispositions']);router[_0xa2e7('0x8')](_0xa2e7('0x10'),auth['isAuthenticated'](),controller['getAnswers']);router[_0xa2e7('0x8')](_0xa2e7('0x11'),auth[_0xa2e7('0x9')](),controller[_0xa2e7('0x12')]);router[_0xa2e7('0x8')]('/:id/interactions',auth[_0xa2e7('0x9')](),controller[_0xa2e7('0x13')]);router[_0xa2e7('0x8')](_0xa2e7('0x14'),auth[_0xa2e7('0x9')](),controller[_0xa2e7('0x15')]);router['post']('/',auth['isAuthenticated'](),controller[_0xa2e7('0x16')]);router[_0xa2e7('0x17')](_0xa2e7('0xf'),auth[_0xa2e7('0x9')](),controller[_0xa2e7('0x18')]);router[_0xa2e7('0x17')](_0xa2e7('0x10'),auth[_0xa2e7('0x9')](),controller[_0xa2e7('0x19')]);router[_0xa2e7('0x17')](_0xa2e7('0x1a'),controller['notify']);router[_0xa2e7('0x17')](_0xa2e7('0x11'),auth[_0xa2e7('0x9')](),controller['addApplications']);router[_0xa2e7('0x17')](_0xa2e7('0x14'),auth[_0xa2e7('0x9')](),controller[_0xa2e7('0x1b')]);router[_0xa2e7('0x17')](_0xa2e7('0x1c'),auth['isAuthenticated'](),controller[_0xa2e7('0x1d')]);router['put'](_0xa2e7('0xd'),auth[_0xa2e7('0x9')](),controller['update']);router[_0xa2e7('0x1e')]('/:id',auth[_0xa2e7('0x9')](),controller[_0xa2e7('0x1f')]);router[_0xa2e7('0x1e')]('/:id/dispositions',auth['isAuthenticated'](),controller['removeDispositions']);router[_0xa2e7('0x1e')]('/:id/canned_answers',auth[_0xa2e7('0x9')](),controller[_0xa2e7('0x20')]);router[_0xa2e7('0x1e')]('/:id/users',auth[_0xa2e7('0x9')](),controller[_0xa2e7('0x21')]);module[_0xa2e7('0x22')]=router; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.attributes.js b/server/api/openchannelAccount/openchannelAccount.attributes.js index 90e2153..92de5c8 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 _0x9194=['mandatoryDispositionPauseId','mandatoryDisposition','randomstring','exports','STRING','name','generate','TEXT','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue'];(function(_0x247992,_0x2b97f8){var _0x5b2564=function(_0x45661e){while(--_0x45661e){_0x247992['push'](_0x247992['shift']());}};_0x5b2564(++_0x2b97f8);}(_0x9194,0x161));var _0x4919=function(_0x31446f,_0x401240){_0x31446f=_0x31446f-0x0;var _0x363914=_0x9194[_0x31446f];return _0x363914;};'use strict';var Sequelize=require('sequelize');var rs=require(_0x4919('0x0'));module[_0x4919('0x1')]={'name':{'type':Sequelize[_0x4919('0x2')],'unique':_0x4919('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0x4919('0x2')]},'token':{'type':Sequelize[_0x4919('0x2')],'defaultValue':function(){return rs[_0x4919('0x4')]();}},'replyUri':{'type':Sequelize['STRING'],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0x4919('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x4919('0x5')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x4919('0x6')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x4919('0x6')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x4919('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0x4919('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0x4919('0x2')]},'queueTransfer':{'type':Sequelize[_0x4919('0x6')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x4919('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x4919('0x6')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x4919('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':_0x4919('0x8')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x4919('0x9'),'set':function(_0x266f8a){if(!_0x266f8a)this[_0x4919('0xa')](_0x4919('0xb'),null);this['setDataValue'](_0x4919('0xc'),_0x266f8a);}}}; \ No newline at end of file +var _0xa55f=['setDataValue','sequelize','randomstring','STRING','generate','TEXT','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa55f,0x14b));var _0xfa55=function(_0x140325,_0x53234c){_0x140325=_0x140325-0x0;var _0x318d4d=_0xa55f[_0x140325];return _0x318d4d;};'use strict';var Sequelize=require(_0xfa55('0x0'));var rs=require(_0xfa55('0x1'));module['exports']={'name':{'type':Sequelize[_0xfa55('0x2')],'unique':'name','allowNull':![]},'description':{'type':Sequelize[_0xfa55('0x2')]},'token':{'type':Sequelize[_0xfa55('0x2')],'defaultValue':function(){return rs[_0xfa55('0x3')]();}},'replyUri':{'type':Sequelize['STRING'],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0xfa55('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0xfa55('0x4')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0xfa55('0x5')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xfa55('0x5')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xfa55('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0xfa55('0x2')]},'queueTransfer':{'type':Sequelize[_0xfa55('0x5')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xfa55('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xfa55('0x5')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xfa55('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xfa55('0x6')],'allowNull':!![],'defaultValue':null,'comment':_0xfa55('0x7')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0xfa55('0x8'),'set':function(_0x77db9d){if(!_0x77db9d)this[_0xfa55('0x9')]('mandatoryDispositionPauseId',null);this['setDataValue']('mandatoryDisposition',_0x77db9d);}}}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.controller.js b/server/api/openchannelAccount/openchannelAccount.controller.js index 219e600..24e786a 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 _0xcfef=['addDisposition','Disposition','getDispositions','findOne','pick','OpenchannelAccountId','removeDispositions','ids','CannedAnswer','getAnswers','rows','removeAnswers','notify','openchannel','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','from\x20is\x20mandatory','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','from','CmList','List','DESC','OpenchannelApplication','Applications','account','applications','list','priority','Contacts','defaults','mapKey','contact','firstName','lastName','threadId','OpenchannelInteraction','externalUrl','ContactId','messageId','interaction','created','*,*,*,*','OpenchannelMessage','User','UserId','unshift','agent','waitForTheAssignedAgent','queueId','OpenchannelQueue','Start','EventManager','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','findAndCountAll','finally','send','getApplications','options','getInteractions','Contact','Tag','color','tag','addAgents','omit','spread','emit','userOpenchannelAccount:save','removeAgents','userOpenchannelAccount:remove','getAgents','out','Messages','dataValues','push','rimraf','zip-dir','fast-json-patch','util','path','sox','to-csv','lodash','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','socket.io-emitter','./openchannelAccount.socket','register','jayson/promise','client','http','request','then','info','request\x20sent','debug','error','code','OpenchannelAccount,\x20%s,\x20%s','message','result','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','destroy','OpenchannelAccounts','UserProfileResource','stack','name','index','mandatoryDispositionPause','map','rawAttributes','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','VIRTUAL','OpenchannelAccount','includeAll','include','findAll','catch','show','params','Pause','keys','find','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','create','describe'];(function(_0x4585d2,_0x30154f){var _0x241594=function(_0x27b7dd){while(--_0x27b7dd){_0x4585d2['push'](_0x4585d2['shift']());}};_0x241594(++_0x30154f);}(_0xcfef,0x1cc));var _0xfcfe=function(_0x38bade,_0x592e24){_0x38bade=_0x38bade-0x0;var _0x113a0b=_0xcfef[_0x38bade];return _0x113a0b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xfcfe('0x0'));var zipdir=require(_0xfcfe('0x1'));var jsonpatch=require(_0xfcfe('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xfcfe('0x3'));var path=require(_0xfcfe('0x4'));var sox=require(_0xfcfe('0x5'));var csv=require(_0xfcfe('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xfcfe('0x7'));var squel=require('squel');var crypto=require(_0xfcfe('0x8'));var jsforce=require(_0xfcfe('0x9'));var deskjs=require(_0xfcfe('0xa'));var toCsv=require('to-csv');var querystring=require(_0xfcfe('0xb'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xfcfe('0xc'));var qs=require('../../components/parsers/qs');var as=require(_0xfcfe('0xd'));var hardwareService=require(_0xfcfe('0xe'));var logger=require(_0xfcfe('0xf'))(_0xfcfe('0x10'));var utils=require(_0xfcfe('0x11'));var config=require(_0xfcfe('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0xfcfe('0x13'))['db'];config['redis']=_['defaults'](config[_0xfcfe('0x14')],{'host':'localhost','port':0x18eb});var socket=require(_0xfcfe('0x15'))(new Redis(config[_0xfcfe('0x14')]));require(_0xfcfe('0x16'))[_0xfcfe('0x17')](socket);var jayson=require(_0xfcfe('0x18'));var client=jayson[_0xfcfe('0x19')][_0xfcfe('0x1a')]({'port':0x232c});var client9002=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0xc4afc4,_0x17305a,_0x181629,_0x443900){return new BPromise(function(_0x5414b1,_0x52a82d){var _0x2f71fa=_0x443900||client;return _0x2f71fa[_0xfcfe('0x1b')](_0xc4afc4,_0x181629)[_0xfcfe('0x1c')](function(_0x58dc99){logger[_0xfcfe('0x1d')]('OpenchannelAccount,\x20%s,\x20%s',_0x17305a,_0xfcfe('0x1e'));logger[_0xfcfe('0x1f')]('OpenchannelAccount,\x20%s,\x20%s,\x20%s',_0x17305a,_0xfcfe('0x1e'),JSON['stringify'](_0x58dc99));if(_0x58dc99[_0xfcfe('0x20')]){if(_0x58dc99[_0xfcfe('0x20')][_0xfcfe('0x21')]===0x1f4){logger[_0xfcfe('0x20')](_0xfcfe('0x22'),_0x17305a,_0x58dc99['error'][_0xfcfe('0x23')]);return _0x52a82d(_0x58dc99['error']['message']);}logger[_0xfcfe('0x20')](_0xfcfe('0x22'),_0x17305a,_0x58dc99[_0xfcfe('0x20')][_0xfcfe('0x23')]);return _0x5414b1(_0x58dc99[_0xfcfe('0x20')]['message']);}else{logger[_0xfcfe('0x1d')]('OpenchannelAccount,\x20%s,\x20%s',_0x17305a,_0xfcfe('0x1e'));_0x5414b1(_0x58dc99[_0xfcfe('0x24')][_0xfcfe('0x23')]);}})['catch'](function(_0x3ebd99){logger[_0xfcfe('0x20')](_0xfcfe('0x22'),_0x17305a,_0x3ebd99);_0x52a82d(_0x3ebd99);});});}function respondWithStatusCode(_0x3b5fbb,_0x53fed5){_0x53fed5=_0x53fed5||0xcc;return function(_0x28bc46){if(_0x28bc46){return _0x3b5fbb[_0xfcfe('0x25')](_0x53fed5);}return _0x3b5fbb[_0xfcfe('0x26')](_0x53fed5)[_0xfcfe('0x27')]();};}function respondWithResult(_0x3518f3,_0x41e60d){_0x41e60d=_0x41e60d||0xc8;return function(_0x4579da){if(_0x4579da){return _0x3518f3[_0xfcfe('0x26')](_0x41e60d)[_0xfcfe('0x28')](_0x4579da);}};}function respondWithFilteredResult(_0x1db844,_0x3e683c){return function(_0x2a0702){if(_0x2a0702){var _0x12a91b=typeof _0x3e683c[_0xfcfe('0x29')]===_0xfcfe('0x2a')&&typeof _0x3e683c[_0xfcfe('0x2b')]==='undefined';var _0x5c6f0c=_0x2a0702[_0xfcfe('0x2c')];var _0x2c0998=_0x12a91b?0x0:_0x3e683c[_0xfcfe('0x29')];var _0x1a7f54=_0x12a91b?_0x2a0702[_0xfcfe('0x2c')]:_0x3e683c[_0xfcfe('0x29')]+_0x3e683c[_0xfcfe('0x2b')];var _0x45053c;if(_0x1a7f54>=_0x5c6f0c){_0x1a7f54=_0x5c6f0c;_0x45053c=0xc8;}else{_0x45053c=0xce;}_0x1db844[_0xfcfe('0x26')](_0x45053c);return _0x1db844['set'](_0xfcfe('0x2d'),_0x2c0998+'-'+_0x1a7f54+'/'+_0x5c6f0c)[_0xfcfe('0x28')](_0x2a0702);}return null;};}function patchUpdates(_0x58e2e5){return function(_0x176402){try{jsonpatch[_0xfcfe('0x2e')](_0x176402,_0x58e2e5,!![]);}catch(_0x1cf1e1){return BPromise[_0xfcfe('0x2f')](_0x1cf1e1);}return _0x176402[_0xfcfe('0x30')]();};}function saveUpdates(_0x47a98e,_0x2ebb88){return function(_0x4f76ba){if(_0x4f76ba){return _0x4f76ba[_0xfcfe('0x31')](_0x47a98e)[_0xfcfe('0x1c')](function(_0xf6658e){return _0xf6658e;});}return null;};}function removeEntity(_0x270da6,_0x44d074){return function(_0x415996){if(_0x415996){return _0x415996[_0xfcfe('0x32')]()['then'](function(){var _0x200109=_0x415996['get']({'plain':!![]});var _0x5d13b5=_0xfcfe('0x33');return db[_0xfcfe('0x34')][_0xfcfe('0x32')]({'where':{'type':_0x5d13b5,'resourceId':_0x200109['id']}})[_0xfcfe('0x1c')](function(){return _0x415996;});})[_0xfcfe('0x1c')](function(){_0x270da6[_0xfcfe('0x26')](0xcc)[_0xfcfe('0x27')]();});}};}function handleEntityNotFound(_0x3f1e69,_0x37ca27){return function(_0x31a554){if(!_0x31a554){_0x3f1e69[_0xfcfe('0x25')](0x194);}return _0x31a554;};}function handleError(_0x43ddd1,_0x5300ba){_0x5300ba=_0x5300ba||0x1f4;return function(_0x123e53){logger[_0xfcfe('0x20')](_0x123e53[_0xfcfe('0x35')]);if(_0x123e53[_0xfcfe('0x36')]){delete _0x123e53[_0xfcfe('0x36')];}_0x43ddd1[_0xfcfe('0x26')](_0x5300ba)['send'](_0x123e53);};}exports[_0xfcfe('0x37')]=function(_0x33b884,_0x3a6618){var _0x405ece={'include':[{'model':db['Pause'],'as':_0xfcfe('0x38')}]},_0x2a733d={},_0x44ab0d={'count':0x0,'rows':[]};var _0x560c61=_[_0xfcfe('0x39')](db['OpenchannelAccount'][_0xfcfe('0x3a')],function(_0x40ece0){return{'name':_0x40ece0['fieldName'],'type':_0x40ece0['type'][_0xfcfe('0x3b')]};});_0x2a733d[_0xfcfe('0x3c')]=_[_0xfcfe('0x39')](_0x560c61,'name');_0x2a733d[_0xfcfe('0x3d')]=_['keys'](_0x33b884[_0xfcfe('0x3d')]);_0x2a733d[_0xfcfe('0x3e')]=_[_0xfcfe('0x3f')](_0x2a733d[_0xfcfe('0x3c')],_0x2a733d[_0xfcfe('0x3d')]);_0x405ece[_0xfcfe('0x40')]=_['intersection'](_0x2a733d['model'],qs[_0xfcfe('0x41')](_0x33b884[_0xfcfe('0x3d')][_0xfcfe('0x41')]));_0x405ece[_0xfcfe('0x40')]=_0x405ece[_0xfcfe('0x40')][_0xfcfe('0x42')]?_0x405ece['attributes']:_0x2a733d[_0xfcfe('0x3c')];if(!_0x33b884[_0xfcfe('0x3d')][_0xfcfe('0x43')](_0xfcfe('0x44'))){_0x405ece[_0xfcfe('0x2b')]=qs[_0xfcfe('0x2b')](_0x33b884[_0xfcfe('0x3d')][_0xfcfe('0x2b')]);_0x405ece[_0xfcfe('0x29')]=qs['offset'](_0x33b884['query'][_0xfcfe('0x29')]);}_0x405ece[_0xfcfe('0x45')]=qs[_0xfcfe('0x46')](_0x33b884[_0xfcfe('0x3d')][_0xfcfe('0x46')]);_0x405ece[_0xfcfe('0x47')]=qs['filters'](_['pick'](_0x33b884['query'],_0x2a733d['filters']),_0x560c61);if(_0x33b884[_0xfcfe('0x3d')][_0xfcfe('0x48')]){_0x405ece[_0xfcfe('0x47')]=_[_0xfcfe('0x49')](_0x405ece[_0xfcfe('0x47')],{'$or':_['map'](_0x560c61,function(_0x3caacd){if(_0x3caacd[_0xfcfe('0x4a')]!==_0xfcfe('0x4b')){var _0x110252={};_0x110252[_0x3caacd[_0xfcfe('0x36')]]={'$like':'%'+_0x33b884['query'][_0xfcfe('0x48')]+'%'};return _0x110252;}})});}_0x405ece=_[_0xfcfe('0x49')]({},_0x405ece,_0x33b884['options']);var _0x357a61={'where':_0x405ece['where']};return db[_0xfcfe('0x4c')][_0xfcfe('0x2c')](_0x357a61)[_0xfcfe('0x1c')](function(_0x459d6f){_0x44ab0d[_0xfcfe('0x2c')]=_0x459d6f;if(_0x33b884[_0xfcfe('0x3d')][_0xfcfe('0x4d')]){_0x405ece[_0xfcfe('0x4e')]=[{'all':!![]}];}return db[_0xfcfe('0x4c')][_0xfcfe('0x4f')](_0x405ece);})[_0xfcfe('0x1c')](function(_0x356236){_0x44ab0d['rows']=_0x356236;return _0x44ab0d;})['then'](respondWithFilteredResult(_0x3a6618,_0x405ece))[_0xfcfe('0x50')](handleError(_0x3a6618,null));};exports[_0xfcfe('0x51')]=function(_0x55944e,_0x31aceb){var _0x5b63aa={'raw':![],'where':{'id':_0x55944e[_0xfcfe('0x52')]['id']},'include':[{'model':db[_0xfcfe('0x53')],'as':_0xfcfe('0x38')}]},_0x242046={};_0x242046[_0xfcfe('0x3c')]=_[_0xfcfe('0x54')](db['OpenchannelAccount'][_0xfcfe('0x3a')]);_0x242046['query']=_['keys'](_0x55944e['query']);_0x242046[_0xfcfe('0x3e')]=_[_0xfcfe('0x3f')](_0x242046[_0xfcfe('0x3c')],_0x242046[_0xfcfe('0x3d')]);_0x5b63aa['attributes']=_['intersection'](_0x242046['model'],qs[_0xfcfe('0x41')](_0x55944e[_0xfcfe('0x3d')]['fields']));_0x5b63aa['attributes']=_0x5b63aa['attributes'][_0xfcfe('0x42')]?_0x5b63aa[_0xfcfe('0x40')]:_0x242046[_0xfcfe('0x3c')];if(_0x55944e[_0xfcfe('0x3d')][_0xfcfe('0x4d')]){_0x5b63aa[_0xfcfe('0x4e')]=[{'all':!![]}];}_0x5b63aa=_[_0xfcfe('0x49')]({},_0x5b63aa,_0x55944e['options']);return db[_0xfcfe('0x4c')][_0xfcfe('0x55')](_0x5b63aa)[_0xfcfe('0x1c')](handleEntityNotFound(_0x31aceb,null))['then'](respondWithResult(_0x31aceb,null))['catch'](handleError(_0x31aceb,null));};exports['create']=function(_0x57126d,_0x159bc5){return db[_0xfcfe('0x4c')]['create'](_0x57126d[_0xfcfe('0x56')],{})[_0xfcfe('0x1c')](function(_0x4837ee){var _0x49404e=_0x57126d[_0xfcfe('0x57')][_0xfcfe('0x58')]({'plain':!![]});if(!_0x49404e)throw new Error(_0xfcfe('0x59'));if(_0x49404e[_0xfcfe('0x5a')]===_0xfcfe('0x57')){var _0xfe45a6=_0x4837ee[_0xfcfe('0x58')]({'plain':!![]});var _0x416db2=_0xfcfe('0x33');return db[_0xfcfe('0x5b')][_0xfcfe('0x55')]({'where':{'name':_0x416db2,'userProfileId':_0x49404e['userProfileId']},'raw':!![]})['then'](function(_0x4b2843){if(_0x4b2843&&_0x4b2843[_0xfcfe('0x5c')]===0x0){return db['UserProfileResource'][_0xfcfe('0x5d')]({'name':_0xfe45a6[_0xfcfe('0x36')],'resourceId':_0xfe45a6['id'],'type':_0x4b2843[_0xfcfe('0x36')],'sectionId':_0x4b2843['id']},{})[_0xfcfe('0x1c')](function(){return _0x4837ee;});}else{return _0x4837ee;}})[_0xfcfe('0x50')](function(_0x476212){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x476212);throw _0x476212;});}return _0x4837ee;})[_0xfcfe('0x1c')](respondWithResult(_0x159bc5,0xc9))[_0xfcfe('0x50')](handleError(_0x159bc5,null));};exports[_0xfcfe('0x31')]=function(_0x40d0b1,_0x2dd13e){if(_0x40d0b1[_0xfcfe('0x56')]['id']){delete _0x40d0b1[_0xfcfe('0x56')]['id'];}return db['OpenchannelAccount'][_0xfcfe('0x55')]({'where':{'id':_0x40d0b1[_0xfcfe('0x52')]['id']},'include':[{'model':db[_0xfcfe('0x53')],'as':'mandatoryDispositionPause'}]})[_0xfcfe('0x1c')](handleEntityNotFound(_0x2dd13e,null))[_0xfcfe('0x1c')](saveUpdates(_0x40d0b1['body'],null))[_0xfcfe('0x1c')](respondWithResult(_0x2dd13e,null))[_0xfcfe('0x50')](handleError(_0x2dd13e,null));};exports[_0xfcfe('0x32')]=function(_0x57b09e,_0x2b9db0){return db[_0xfcfe('0x4c')][_0xfcfe('0x55')]({'where':{'id':_0x57b09e[_0xfcfe('0x52')]['id']}})['then'](handleEntityNotFound(_0x2b9db0,null))[_0xfcfe('0x1c')](removeEntity(_0x2b9db0,null))[_0xfcfe('0x50')](handleError(_0x2b9db0,null));};exports['describe']=function(_0x5b231a,_0x21da86){return db['OpenchannelAccount'][_0xfcfe('0x5e')]()['then'](respondWithResult(_0x21da86,null))['catch'](handleError(_0x21da86,null));};exports[_0xfcfe('0x5f')]=function(_0x3830e8,_0x27af69,_0x377880){if(_0x3830e8[_0xfcfe('0x56')]['id']){delete _0x3830e8[_0xfcfe('0x56')]['id'];}return db[_0xfcfe('0x4c')][_0xfcfe('0x55')]({'where':{'id':_0x3830e8[_0xfcfe('0x52')]['id']}})[_0xfcfe('0x1c')](handleEntityNotFound(_0x27af69,null))[_0xfcfe('0x1c')](function(_0x200d61){if(_0x200d61){_0x3830e8[_0xfcfe('0x56')]['OpenchannelAccountId']=_0x200d61['id'];return db[_0xfcfe('0x60')][_0xfcfe('0x5d')](_0x3830e8[_0xfcfe('0x56')]);}})[_0xfcfe('0x1c')](respondWithResult(_0x27af69,null))[_0xfcfe('0x50')](handleError(_0x27af69,null));};exports[_0xfcfe('0x61')]=function(_0x2772db,_0x458779,_0x983cfd){var _0x45abe6={'raw':![],'where':{}};var _0x524253={};var _0x2b014f={'count':0x0,'rows':[]};return db[_0xfcfe('0x4c')][_0xfcfe('0x62')]({'where':{'id':_0x2772db[_0xfcfe('0x52')]['id']}})[_0xfcfe('0x1c')](handleEntityNotFound(_0x458779,null))['then'](function(_0x35f1ba){if(_0x35f1ba){_0x524253[_0xfcfe('0x3c')]=_[_0xfcfe('0x54')](db['Disposition'][_0xfcfe('0x3a')]);_0x524253[_0xfcfe('0x3d')]=_[_0xfcfe('0x54')](_0x2772db['query']);_0x524253[_0xfcfe('0x3e')]=_['intersection'](_0x524253[_0xfcfe('0x3c')],_0x524253['query']);_0x45abe6['attributes']=_[_0xfcfe('0x3f')](_0x524253[_0xfcfe('0x3c')],qs[_0xfcfe('0x41')](_0x2772db[_0xfcfe('0x3d')][_0xfcfe('0x41')]));_0x45abe6[_0xfcfe('0x40')]=_0x45abe6[_0xfcfe('0x40')][_0xfcfe('0x42')]?_0x45abe6[_0xfcfe('0x40')]:_0x524253[_0xfcfe('0x3c')];if(!_0x2772db[_0xfcfe('0x3d')][_0xfcfe('0x43')](_0xfcfe('0x44'))){_0x45abe6[_0xfcfe('0x2b')]=qs[_0xfcfe('0x2b')](_0x2772db[_0xfcfe('0x3d')][_0xfcfe('0x2b')]);_0x45abe6[_0xfcfe('0x29')]=qs[_0xfcfe('0x29')](_0x2772db['query'][_0xfcfe('0x29')]);}_0x45abe6[_0xfcfe('0x45')]=qs['sort'](_0x2772db['query']['sort']);_0x45abe6[_0xfcfe('0x47')]=qs[_0xfcfe('0x3e')](_[_0xfcfe('0x63')](_0x2772db[_0xfcfe('0x3d')],_0x524253[_0xfcfe('0x3e')]));_0x45abe6[_0xfcfe('0x47')][_0xfcfe('0x64')]=_0x35f1ba['id'];if(_0x2772db['query'][_0xfcfe('0x48')]){_0x45abe6[_0xfcfe('0x47')]=_['merge'](_0x45abe6[_0xfcfe('0x47')],{'$or':_[_0xfcfe('0x39')](_0x45abe6[_0xfcfe('0x40')],function(_0x3d9c96){var _0x34eefc={};_0x34eefc[_0x3d9c96]={'$like':'%'+_0x2772db[_0xfcfe('0x3d')][_0xfcfe('0x48')]+'%'};return _0x34eefc;})});}_0x45abe6=_[_0xfcfe('0x49')]({},_0x45abe6,_0x2772db['options']);return db[_0xfcfe('0x60')][_0xfcfe('0x2c')]({'where':_0x45abe6[_0xfcfe('0x47')]})[_0xfcfe('0x1c')](function(_0x42b781){_0x2b014f[_0xfcfe('0x2c')]=_0x42b781;if(_0x2772db[_0xfcfe('0x3d')]['includeAll']){_0x45abe6['include']=[{'all':!![]}];}return db[_0xfcfe('0x60')][_0xfcfe('0x4f')](_0x45abe6);})['then'](function(_0x15dc6b){_0x2b014f['rows']=_0x15dc6b;return _0x2b014f;});}})['then'](respondWithFilteredResult(_0x458779,_0x45abe6))['catch'](handleError(_0x458779,null));};exports[_0xfcfe('0x65')]=function(_0x57ea67,_0x310f4d,_0x5a3cc9){return db[_0xfcfe('0x4c')][_0xfcfe('0x55')]({'where':{'id':_0x57ea67['params']['id']}})[_0xfcfe('0x1c')](handleEntityNotFound(_0x310f4d,null))[_0xfcfe('0x1c')](function(_0x465625){if(_0x465625){return _0x465625[_0xfcfe('0x65')](_0x57ea67[_0xfcfe('0x3d')][_0xfcfe('0x66')]);}})[_0xfcfe('0x1c')](respondWithStatusCode(_0x310f4d,null))[_0xfcfe('0x50')](handleError(_0x310f4d,null));};exports['addAnswer']=function(_0x2627ce,_0x35182e,_0xf79167){if(_0x2627ce['body']['id']){delete _0x2627ce[_0xfcfe('0x56')]['id'];}return db[_0xfcfe('0x4c')]['find']({'where':{'id':_0x2627ce[_0xfcfe('0x52')]['id']}})[_0xfcfe('0x1c')](handleEntityNotFound(_0x35182e,null))[_0xfcfe('0x1c')](function(_0x50aefa){if(_0x50aefa){_0x2627ce[_0xfcfe('0x56')]['OpenchannelAccountId']=_0x50aefa['id'];return db[_0xfcfe('0x67')]['create'](_0x2627ce[_0xfcfe('0x56')]);}})[_0xfcfe('0x1c')](respondWithResult(_0x35182e,null))['catch'](handleError(_0x35182e,null));};exports[_0xfcfe('0x68')]=function(_0x155a69,_0x5c8436,_0x21cfaa){var _0x3a33d5={'raw':![],'where':{}};var _0x3126e5={};var _0x4e6428={'count':0x0,'rows':[]};return db[_0xfcfe('0x4c')][_0xfcfe('0x62')]({'where':{'id':_0x155a69[_0xfcfe('0x52')]['id']}})[_0xfcfe('0x1c')](handleEntityNotFound(_0x5c8436,null))[_0xfcfe('0x1c')](function(_0x5e85ba){if(_0x5e85ba){_0x3126e5[_0xfcfe('0x3c')]=_[_0xfcfe('0x54')](db[_0xfcfe('0x67')][_0xfcfe('0x3a')]);_0x3126e5[_0xfcfe('0x3d')]=_[_0xfcfe('0x54')](_0x155a69['query']);_0x3126e5[_0xfcfe('0x3e')]=_[_0xfcfe('0x3f')](_0x3126e5['model'],_0x3126e5[_0xfcfe('0x3d')]);_0x3a33d5['attributes']=_[_0xfcfe('0x3f')](_0x3126e5[_0xfcfe('0x3c')],qs['fields'](_0x155a69['query']['fields']));_0x3a33d5['attributes']=_0x3a33d5[_0xfcfe('0x40')][_0xfcfe('0x42')]?_0x3a33d5[_0xfcfe('0x40')]:_0x3126e5['model'];if(!_0x155a69[_0xfcfe('0x3d')]['hasOwnProperty'](_0xfcfe('0x44'))){_0x3a33d5[_0xfcfe('0x2b')]=qs[_0xfcfe('0x2b')](_0x155a69[_0xfcfe('0x3d')][_0xfcfe('0x2b')]);_0x3a33d5[_0xfcfe('0x29')]=qs[_0xfcfe('0x29')](_0x155a69[_0xfcfe('0x3d')]['offset']);}_0x3a33d5['order']=qs['sort'](_0x155a69[_0xfcfe('0x3d')][_0xfcfe('0x46')]);_0x3a33d5[_0xfcfe('0x47')]=qs[_0xfcfe('0x3e')](_[_0xfcfe('0x63')](_0x155a69[_0xfcfe('0x3d')],_0x3126e5[_0xfcfe('0x3e')]));_0x3a33d5['where'][_0xfcfe('0x64')]=_0x5e85ba['id'];if(_0x155a69['query'][_0xfcfe('0x48')]){_0x3a33d5['where']=_['merge'](_0x3a33d5[_0xfcfe('0x47')],{'$or':_[_0xfcfe('0x39')](_0x3a33d5[_0xfcfe('0x40')],function(_0x5cac2e){var _0x360f05={};_0x360f05[_0x5cac2e]={'$like':'%'+_0x155a69[_0xfcfe('0x3d')]['filter']+'%'};return _0x360f05;})});}_0x3a33d5=_['merge']({},_0x3a33d5,_0x155a69['options']);return db[_0xfcfe('0x67')][_0xfcfe('0x2c')]({'where':_0x3a33d5[_0xfcfe('0x47')]})[_0xfcfe('0x1c')](function(_0x59e5c8){_0x4e6428[_0xfcfe('0x2c')]=_0x59e5c8;if(_0x155a69[_0xfcfe('0x3d')][_0xfcfe('0x4d')]){_0x3a33d5[_0xfcfe('0x4e')]=[{'all':!![]}];}return db[_0xfcfe('0x67')][_0xfcfe('0x4f')](_0x3a33d5);})['then'](function(_0x473d74){_0x4e6428[_0xfcfe('0x69')]=_0x473d74;return _0x4e6428;});}})[_0xfcfe('0x1c')](respondWithFilteredResult(_0x5c8436,_0x3a33d5))[_0xfcfe('0x50')](handleError(_0x5c8436,null));};exports[_0xfcfe('0x6a')]=function(_0xed8e85,_0x3a7d02,_0x1ececf){return db[_0xfcfe('0x4c')][_0xfcfe('0x55')]({'where':{'id':_0xed8e85['params']['id']}})[_0xfcfe('0x1c')](handleEntityNotFound(_0x3a7d02,null))['then'](function(_0x32533d){if(_0x32533d){return _0x32533d[_0xfcfe('0x6a')](_0xed8e85[_0xfcfe('0x3d')][_0xfcfe('0x66')]);}})[_0xfcfe('0x1c')](respondWithStatusCode(_0x3a7d02,null))[_0xfcfe('0x50')](handleError(_0x3a7d02,null));};exports[_0xfcfe('0x6b')]=function(_0x3c8c0b,_0x245600,_0x326060){var _0x20a580={'body':_0x3c8c0b[_0xfcfe('0x56')],'channel':_0xfcfe('0x6c')};var _0x5007f3=[];var _0x2a2091=[];var _0x55e56a={};var _0x3f7900=![];return db[_0xfcfe('0x6d')]['describe']()['then'](function(_0x254b48){if(!_0x254b48){throw new db[(_0xfcfe('0x6e'))][(_0xfcfe('0x6f'))](_0xfcfe('0x70'));}_0x5007f3=_[_0xfcfe('0x71')](_[_0xfcfe('0x54')](_0x254b48),['createdAt','updatedAt']);_0x2a2091=_[_0xfcfe('0x71')](_[_0xfcfe('0x54')](_0x254b48),[_0xfcfe('0x72'),_0xfcfe('0x73'),_0xfcfe('0x74'),_0xfcfe('0x75')]);if(_0x3c8c0b['body']['id']){delete _0x3c8c0b['body']['id'];}if(_['isNil'](_0x3c8c0b[_0xfcfe('0x56')]['from'])){throw new db[(_0xfcfe('0x6e'))][(_0xfcfe('0x6f'))](_0xfcfe('0x76'));}if(_[_0xfcfe('0x77')](_0x3c8c0b['body']['body'])||_0x3c8c0b['body']['body']===''){throw new db['Sequelize'][(_0xfcfe('0x6f'))](_0xfcfe('0x78'));}if(_['isNil'](_0x3c8c0b[_0xfcfe('0x56')]['mapKey'])){throw new db[(_0xfcfe('0x6e'))][(_0xfcfe('0x6f'))](_0xfcfe('0x79')+_0x2a2091);}if(!_['includes'](_0x2a2091,_0x3c8c0b[_0xfcfe('0x56')]['mapKey'])){throw new db['Sequelize']['ValidationError'](_0xfcfe('0x7a')+_0x2a2091);}_0x55e56a[_0x3c8c0b[_0xfcfe('0x56')]['mapKey']]=_0x3c8c0b[_0xfcfe('0x56')][_0xfcfe('0x7b')];})[_0xfcfe('0x1c')](function(){return db[_0xfcfe('0x4c')][_0xfcfe('0x55')]({'where':{'id':_0x3c8c0b[_0xfcfe('0x52')]['id']},'include':[{'model':db[_0xfcfe('0x7c')],'as':_0xfcfe('0x7d'),'include':[{'model':db['CmContact'],'as':'Contacts','where':_0x55e56a,'limit':0x1,'order':[[_0xfcfe('0x73'),_0xfcfe('0x7e')]]}]},{'model':db[_0xfcfe('0x7f')],'as':_0xfcfe('0x80')}]});})[_0xfcfe('0x1c')](handleEntityNotFound(_0x245600,null))[_0xfcfe('0x1c')](function(_0x4612af){if(_0x4612af&&_0x4612af['List']){_0x20a580[_0xfcfe('0x81')]=_0x4612af;_0x20a580[_0xfcfe('0x82')]=_0x4612af[_0xfcfe('0x80')];_0x20a580[_0xfcfe('0x83')]=_0x4612af[_0xfcfe('0x7d')];_0x20a580[_0xfcfe('0x82')]=_['orderBy'](_0x20a580['applications'],[_0xfcfe('0x84')],['asc']);if(_0x20a580[_0xfcfe('0x81')][_0xfcfe('0x80')]){delete _0x20a580['account'][_0xfcfe('0x80')];}if(_0x20a580[_0xfcfe('0x81')][_0xfcfe('0x7d')]&&_0x20a580[_0xfcfe('0x81')][_0xfcfe('0x7d')][_0xfcfe('0x85')]['length']){return _0x20a580[_0xfcfe('0x81')][_0xfcfe('0x7d')][_0xfcfe('0x85')][0x0];}var _0x3e1295=_[_0xfcfe('0x86')](_0x3c8c0b[_0xfcfe('0x56')],{'firstName':_0x3c8c0b[_0xfcfe('0x56')][_0xfcfe('0x7b')],'ListId':_0x4612af['ListId']});_0x3e1295[_0x3c8c0b[_0xfcfe('0x56')][_0xfcfe('0x87')]]=_0x3c8c0b['body'][_0xfcfe('0x7b')];return db['CmContact'][_0xfcfe('0x5d')](_0x3e1295,{'fields':_0x5007f3,'raw':!![]});}})[_0xfcfe('0x1c')](handleEntityNotFound(_0x245600,null))[_0xfcfe('0x1c')](function(_0xb4d679){_0x20a580[_0xfcfe('0x88')]=_0xb4d679;if(_0xb4d679){var _0x53d8d7={'ContactId':_0xb4d679['id'],'OpenchannelAccountId':_0x3c8c0b[_0xfcfe('0x52')]['id'],'from':(_0xb4d679[_0xfcfe('0x89')]||'')+'\x20'+(_0xb4d679[_0xfcfe('0x8a')]||'')};var _0x575368={'OpenchannelAccountId':_0x3c8c0b[_0xfcfe('0x52')]['id'],'closed':![]};if(_0x3c8c0b[_0xfcfe('0x56')][_0xfcfe('0x8b')]){_0x575368[_0xfcfe('0x8b')]=_0x3c8c0b['body'][_0xfcfe('0x8b')];return db[_0xfcfe('0x8c')][_0xfcfe('0x55')]({'where':_0x575368})[_0xfcfe('0x1c')](function(_0x2288b0){if(_0x2288b0){return[_0x2288b0,![]];}_0x53d8d7[_0xfcfe('0x8b')]=_0x3c8c0b[_0xfcfe('0x56')][_0xfcfe('0x8b')];_0x53d8d7[_0xfcfe('0x8d')]=_0x3c8c0b[_0xfcfe('0x56')][_0xfcfe('0x8d')];return db[_0xfcfe('0x8c')]['create'](_0x53d8d7)[_0xfcfe('0x1c')](function(_0x4a5e12){return[_0x4a5e12,!![]];});});}else{_0x575368[_0xfcfe('0x8b')]=null;}_0x575368[_0xfcfe('0x8e')]=_0xb4d679['id'];return db['OpenchannelInteraction'][_0xfcfe('0x55')]({'where':_0x575368})[_0xfcfe('0x1c')](function(_0x142f2c){if(_0x142f2c){return[_0x142f2c,![]];}return db[_0xfcfe('0x8c')]['create'](_0x53d8d7)[_0xfcfe('0x1c')](function(_0x2aae92){return[_0x2aae92,!![]];});});}})['spread'](function(_0x502d31,_0x1098c8){if(_0x502d31){_0x3f7900=_0x1098c8;if(!_0x1098c8){var _0x656d2c={'from':(_0x20a580[_0xfcfe('0x88')][_0xfcfe('0x89')]||'')+'\x20'+(_0x20a580['contact'][_0xfcfe('0x8a')]||'')};if(_0x3c8c0b[_0xfcfe('0x56')][_0xfcfe('0x8b')]&&_0x3c8c0b['body']['messageId']&&_0x3c8c0b[_0xfcfe('0x56')][_0xfcfe('0x8b')]!=_0x3c8c0b[_0xfcfe('0x56')][_0xfcfe('0x8f')]){_0x656d2c[_0xfcfe('0x8b')]=_0x3c8c0b[_0xfcfe('0x56')]['messageId'];}return _0x502d31['update'](_0x656d2c);}else{return _0x502d31;}}})[_0xfcfe('0x1c')](function(_0x125e82){_0x20a580[_0xfcfe('0x90')]=_0x125e82[_0xfcfe('0x58')]({'plain':!![]});_0x20a580[_0xfcfe('0x90')][_0xfcfe('0x91')]=_0x3f7900;if(_0x20a580[_0xfcfe('0x90')]['created']){if(_0x20a580[_0xfcfe('0x81')]['autoclose']){_0x20a580['applications']['push']({'id':0x0,'priority':_0x20a580[_0xfcfe('0x82')][_0xfcfe('0x42')]+0x1,'app':'close','appdata':'unmanaged','interval':_0xfcfe('0x92')});}}return db[_0xfcfe('0x93')][_0xfcfe('0x5d')]({'body':_0x3c8c0b[_0xfcfe('0x56')][_0xfcfe('0x56')],'OpenchannelAccountId':_0x3c8c0b[_0xfcfe('0x52')]['id'],'OpenchannelInteractionId':_0x125e82['id'],'direction':'in','ContactId':_0x20a580['contact']['id'],'AttachmentId':_0x3c8c0b['body']['AttachmentId']});})['then'](function(_0x7470e){_0x20a580[_0xfcfe('0x23')]=_0x7470e;if(!_0x20a580['interaction']['UserId'])return;return db[_0xfcfe('0x94')][_0xfcfe('0x55')]({'attributes':['id',_0xfcfe('0x36')],'where':{'id':_0x20a580[_0xfcfe('0x90')][_0xfcfe('0x95')]}});})[_0xfcfe('0x1c')](function(_0x145cd6){if(_0x145cd6){_0x20a580['applications'][_0xfcfe('0x96')]({'id':0x0,'priority':0x0,'app':_0xfcfe('0x97'),'appdata':_0x145cd6[_0xfcfe('0x36')]+','+(_0x20a580[_0xfcfe('0x81')][_0xfcfe('0x98')]||0xa),'interval':_0xfcfe('0x92')});}if(!_0x20a580[_0xfcfe('0x90')][_0xfcfe('0x99')])return;return db[_0xfcfe('0x9a')][_0xfcfe('0x55')]({'attributes':['id',_0xfcfe('0x36')],'where':{'id':_0x20a580[_0xfcfe('0x90')][_0xfcfe('0x99')]}});})[_0xfcfe('0x1c')](function(_0x94482c){if(_0x94482c){_0x20a580['applications'][_0xfcfe('0x96')]({'id':0x0,'priority':0x1,'app':'queue','appdata':_0x94482c[_0xfcfe('0x36')]+','+(_0x20a580[_0xfcfe('0x81')]['waitForTheAssignedQueue']||0x12c),'interval':_0xfcfe('0x92')});}return respondWithRpcPromise(_0xfcfe('0x9b'),'startRouting',_0x20a580);})[_0xfcfe('0x1c')](function(_0x36f191){respondWithRpcPromise('EventManager',_0xfcfe('0x9c'),{'event':_0xfcfe('0x6b'),'message':_0x36f191},client9002);return _0x36f191;})['then'](respondWithResult(_0x245600,null))[_0xfcfe('0x50')](handleError(_0x245600,null));};exports[_0xfcfe('0x9d')]=function(_0x54cbbb,_0x849bb2){var _0x5960b8=_0x54cbbb[_0xfcfe('0x52')]['id'];var _0x2c94de=_0x54cbbb[_0xfcfe('0x56')];var _0x4928d8=0xc8;var _0x11542c=null;return db[_0xfcfe('0x9e')][_0xfcfe('0x9f')]({'isolationLevel':db[_0xfcfe('0x9e')][_0xfcfe('0xa0')][_0xfcfe('0xa1')][_0xfcfe('0xa2')]},function(_0x5fa8da){return db[_0xfcfe('0x4c')][_0xfcfe('0x62')]({'where':{'id':_0x5960b8},'transaction':_0x5fa8da})[_0xfcfe('0x1c')](function(_0x2360f1){if(_0x2360f1){return db[_0xfcfe('0x7f')][_0xfcfe('0x32')]({'where':{'OpenchannelAccountId':_0x5960b8},'transaction':_0x5fa8da})[_0xfcfe('0x1c')](function(){var _0x484aca=_[_0xfcfe('0x39')](_0x2c94de,function(_0x390a85){_0x390a85[_0xfcfe('0x64')]=_0x5960b8;return _0x390a85;});return db['OpenchannelApplication']['bulkCreate'](_0x484aca,{'transaction':_0x5fa8da});});}else{_0x4928d8=0x194;_0x11542c=[];}});})[_0xfcfe('0x1c')](function(){if(_0x4928d8!==0x194){return db[_0xfcfe('0x7f')][_0xfcfe('0xa3')]({'where':{'OpenchannelAccountId':_0x5960b8},'order':_0xfcfe('0x84')})[_0xfcfe('0x1c')](function(_0x58387f){_0x11542c=_0x58387f;});}})[_0xfcfe('0x50')](function(_0x2908a9){_0x4928d8=0x1f4;logger[_0xfcfe('0x20')](_0x2908a9[_0xfcfe('0x35')]);if(_0x2908a9[_0xfcfe('0x36')]){delete _0x2908a9[_0xfcfe('0x36')];}_0x11542c=_0x2908a9;})[_0xfcfe('0xa4')](function(){if(_0x11542c===null){_0x849bb2[_0xfcfe('0x25')](_0x4928d8);}else{if(_0x4928d8===0x1f4){_0x849bb2[_0xfcfe('0x26')](_0x4928d8)[_0xfcfe('0xa5')](_0x11542c);}else{_0x849bb2[_0xfcfe('0x26')](_0x4928d8)[_0xfcfe('0x28')](_0x11542c);}}});};exports[_0xfcfe('0xa6')]=function(_0x35b7d7,_0x39adcb,_0x1e1af6){var _0x462c97={};var _0x39ac3f={};var _0xefea6d;var _0x5bb02a;return db[_0xfcfe('0x4c')][_0xfcfe('0x62')]({'where':{'id':_0x35b7d7[_0xfcfe('0x52')]['id']}})[_0xfcfe('0x1c')](handleEntityNotFound(_0x39adcb,null))[_0xfcfe('0x1c')](function(_0x4aea05){if(_0x4aea05){_0xefea6d=_0x4aea05;_0x39ac3f[_0xfcfe('0x3c')]=_[_0xfcfe('0x54')](db['OpenchannelApplication']['rawAttributes']);_0x39ac3f['query']=_[_0xfcfe('0x54')](_0x35b7d7[_0xfcfe('0x3d')]);_0x39ac3f['filters']=_['intersection'](_0x39ac3f[_0xfcfe('0x3c')],_0x39ac3f[_0xfcfe('0x3d')]);_0x462c97['attributes']=_[_0xfcfe('0x3f')](_0x39ac3f[_0xfcfe('0x3c')],qs[_0xfcfe('0x41')](_0x35b7d7[_0xfcfe('0x3d')][_0xfcfe('0x41')]));_0x462c97[_0xfcfe('0x40')]=_0x462c97[_0xfcfe('0x40')]['length']?_0x462c97['attributes']:_0x39ac3f['model'];_0x462c97[_0xfcfe('0x45')]=qs[_0xfcfe('0x46')](_0x35b7d7['query'][_0xfcfe('0x46')]);_0x462c97[_0xfcfe('0x47')]=qs['filters'](_[_0xfcfe('0x63')](_0x35b7d7[_0xfcfe('0x3d')],_0x39ac3f[_0xfcfe('0x3e')]));if(_0x35b7d7['query'][_0xfcfe('0x48')]){_0x462c97[_0xfcfe('0x47')]=_[_0xfcfe('0x49')](_0x462c97[_0xfcfe('0x47')],{'$or':_[_0xfcfe('0x39')](_0x462c97[_0xfcfe('0x40')],function(_0x1000e1){var _0x2cdf07={};_0x2cdf07[_0x1000e1]={'$like':'%'+_0x35b7d7[_0xfcfe('0x3d')][_0xfcfe('0x48')]+'%'};return _0x2cdf07;})});}_0x462c97=_[_0xfcfe('0x49')]({},_0x462c97,_0x35b7d7[_0xfcfe('0xa7')]);return _0xefea6d[_0xfcfe('0xa6')](_0x462c97);}})[_0xfcfe('0x1c')](function(_0x3db21b){if(_0x3db21b){_0x5bb02a=_0x3db21b[_0xfcfe('0x42')];if(!_0x35b7d7[_0xfcfe('0x3d')][_0xfcfe('0x43')](_0xfcfe('0x44'))){_0x462c97['limit']=qs['limit'](_0x35b7d7['query'][_0xfcfe('0x2b')]);_0x462c97[_0xfcfe('0x29')]=qs[_0xfcfe('0x29')](_0x35b7d7[_0xfcfe('0x3d')][_0xfcfe('0x29')]);}return _0xefea6d['getApplications'](_0x462c97);}})['then'](function(_0x42b8d5){if(_0x42b8d5){return _0x42b8d5?{'count':_0x5bb02a,'rows':_0x42b8d5}:null;}})['then'](respondWithResult(_0x39adcb,null))['catch'](handleError(_0x39adcb,null));};exports[_0xfcfe('0xa8')]=function(_0x10a160,_0x28e74b,_0xc006c4){var _0xafddc7={'raw':![],'where':{}};var _0x189bd8={};var _0x3eba8d={'count':0x0,'rows':[]};return db[_0xfcfe('0x4c')][_0xfcfe('0x62')]({'where':{'id':_0x10a160['params']['id']}})['then'](handleEntityNotFound(_0x28e74b,null))[_0xfcfe('0x1c')](function(_0x2e2690){if(_0x2e2690){_0x189bd8[_0xfcfe('0x3c')]=_['keys'](db[_0xfcfe('0x8c')][_0xfcfe('0x3a')]);_0x189bd8['query']=_[_0xfcfe('0x54')](_0x10a160['query']);_0x189bd8['filters']=_[_0xfcfe('0x3f')](_0x189bd8[_0xfcfe('0x3c')],_0x189bd8[_0xfcfe('0x3d')]);_0xafddc7['attributes']=_[_0xfcfe('0x3f')](_0x189bd8[_0xfcfe('0x3c')],qs[_0xfcfe('0x41')](_0x10a160[_0xfcfe('0x3d')]['fields']));_0xafddc7[_0xfcfe('0x40')]=_0xafddc7[_0xfcfe('0x40')]['length']?_0xafddc7[_0xfcfe('0x40')]:_0x189bd8[_0xfcfe('0x3c')];if(!_0x10a160[_0xfcfe('0x3d')]['hasOwnProperty'](_0xfcfe('0x44'))){_0xafddc7[_0xfcfe('0x2b')]=qs[_0xfcfe('0x2b')](_0x10a160[_0xfcfe('0x3d')][_0xfcfe('0x2b')]);_0xafddc7[_0xfcfe('0x29')]=qs[_0xfcfe('0x29')](_0x10a160[_0xfcfe('0x3d')][_0xfcfe('0x29')]);}_0xafddc7['order']=qs[_0xfcfe('0x46')](_0x10a160[_0xfcfe('0x3d')][_0xfcfe('0x46')]);_0xafddc7[_0xfcfe('0x47')]=qs[_0xfcfe('0x3e')](_['pick'](_0x10a160[_0xfcfe('0x3d')],_0x189bd8[_0xfcfe('0x3e')]));_0xafddc7[_0xfcfe('0x47')]['OpenchannelAccountId']=_0x2e2690['id'];if(_0x10a160[_0xfcfe('0x3d')][_0xfcfe('0x48')]){_0xafddc7['where']=_[_0xfcfe('0x49')](_0xafddc7['where'],{'$or':_['map'](_0xafddc7[_0xfcfe('0x40')],function(_0x6fe670){var _0x4a793b={};_0x4a793b[_0x6fe670]={'$like':'%'+_0x10a160['query']['filter']+'%'};return _0x4a793b;})});}_0xafddc7=_[_0xfcfe('0x49')]({},_0xafddc7,_0x10a160[_0xfcfe('0xa7')]);return db[_0xfcfe('0x8c')][_0xfcfe('0x2c')]({'where':_0xafddc7[_0xfcfe('0x47')]})[_0xfcfe('0x1c')](function(_0x379d71){_0x3eba8d[_0xfcfe('0x2c')]=_0x379d71;if(_0x10a160[_0xfcfe('0x3d')]['includeAll']){_0xafddc7['include']=[{'model':db[_0xfcfe('0x6d')],'as':_0xfcfe('0xa9'),'required':![]},{'model':db[_0xfcfe('0x94')],'as':'Owner','attributes':[_0xfcfe('0x36'),'fullname','internal'],'required':![]},{'model':db[_0xfcfe('0xaa')],'as':'Tags','attributes':['id',_0xfcfe('0x36'),_0xfcfe('0xab')],'where':_0x10a160[_0xfcfe('0x3d')][_0xfcfe('0xac')]?{'id':_0x10a160[_0xfcfe('0x3d')][_0xfcfe('0xac')]}:undefined,'required':_0x10a160[_0xfcfe('0x3d')][_0xfcfe('0xac')]?!![]:![]}];}return db['OpenchannelInteraction']['findAll'](_0xafddc7);})[_0xfcfe('0x1c')](function(_0x2eb202){_0x3eba8d[_0xfcfe('0x69')]=_0x2eb202;return _0x3eba8d;});}})[_0xfcfe('0x1c')](respondWithFilteredResult(_0x28e74b,_0xafddc7))[_0xfcfe('0x50')](handleError(_0x28e74b,null));};exports[_0xfcfe('0xad')]=function(_0x279fa3,_0x3e310f,_0x4b9dfc){return db[_0xfcfe('0x4c')][_0xfcfe('0x55')]({'where':{'id':_0x279fa3[_0xfcfe('0x52')]['id']}})['then'](handleEntityNotFound(_0x3e310f,null))[_0xfcfe('0x1c')](function(_0x471291){if(_0x471291){return _0x471291[_0xfcfe('0xad')](_0x279fa3[_0xfcfe('0x56')][_0xfcfe('0x66')],_[_0xfcfe('0xae')](_0x279fa3[_0xfcfe('0x56')],[_0xfcfe('0x66'),'id'])||{})[_0xfcfe('0xaf')](function(_0x429f2e){for(var _0x24edee=0x0;_0x24edee<_0x279fa3[_0xfcfe('0x56')][_0xfcfe('0x66')][_0xfcfe('0x42')];_0x24edee+=0x1){socket[_0xfcfe('0xb0')](_0xfcfe('0xb1'),{'UserId':Number(_0x279fa3[_0xfcfe('0x56')][_0xfcfe('0x66')][_0x24edee]),'OpenchannelAccountId':Number(_0x279fa3[_0xfcfe('0x52')]['id'])});}return _0x429f2e;});}})[_0xfcfe('0x1c')](respondWithResult(_0x3e310f,null))[_0xfcfe('0x50')](handleError(_0x3e310f,null));};exports[_0xfcfe('0xb2')]=function(_0x3572f1,_0x758981,_0x499ef1){return db[_0xfcfe('0x4c')][_0xfcfe('0x55')]({'where':{'id':_0x3572f1[_0xfcfe('0x52')]['id']}})['then'](handleEntityNotFound(_0x758981,null))['then'](function(_0x1169f6){if(_0x1169f6){return _0x1169f6['removeAgents'](_0x3572f1[_0xfcfe('0x3d')][_0xfcfe('0x66')])[_0xfcfe('0x1c')](function(){if(_['isArray'](_0x3572f1[_0xfcfe('0x3d')]['ids'])){for(var _0x9dba3a=0x0;_0x9dba3a<_0x3572f1[_0xfcfe('0x3d')][_0xfcfe('0x66')]['length'];_0x9dba3a+=0x1){socket[_0xfcfe('0xb0')]('userOpenchannelAccount:remove',{'UserId':Number(_0x3572f1[_0xfcfe('0x3d')][_0xfcfe('0x66')][_0x9dba3a]),'OpenchannelAccountId':Number(_0x3572f1[_0xfcfe('0x52')]['id'])});}}else{socket[_0xfcfe('0xb0')](_0xfcfe('0xb3'),{'UserId':Number(_0x3572f1['query']['ids']),'OpenchannelAccountId':Number(_0x3572f1['params']['id'])});}});}})['then'](respondWithStatusCode(_0x758981,null))[_0xfcfe('0x50')](handleError(_0x758981,null));};exports[_0xfcfe('0xb4')]=function(_0xcb3639,_0x5a07e3,_0x55ecd4){var _0x355129={};var _0x2c1bdb={};var _0x15d462;var _0x2ed38f;return db[_0xfcfe('0x4c')]['findOne']({'where':{'id':_0xcb3639[_0xfcfe('0x52')]['id']}})[_0xfcfe('0x1c')](handleEntityNotFound(_0x5a07e3,null))[_0xfcfe('0x1c')](function(_0x3f36ad){if(_0x3f36ad){_0x15d462=_0x3f36ad;_0x2c1bdb[_0xfcfe('0x3c')]=_[_0xfcfe('0x54')](db[_0xfcfe('0x94')][_0xfcfe('0x3a')]);_0x2c1bdb[_0xfcfe('0x3d')]=_[_0xfcfe('0x54')](_0xcb3639['query']);_0x2c1bdb['filters']=_[_0xfcfe('0x3f')](_0x2c1bdb['model'],_0x2c1bdb[_0xfcfe('0x3d')]);_0x355129[_0xfcfe('0x40')]=_[_0xfcfe('0x3f')](_0x2c1bdb['model'],qs[_0xfcfe('0x41')](_0xcb3639[_0xfcfe('0x3d')][_0xfcfe('0x41')]));_0x355129[_0xfcfe('0x40')]=_0x355129[_0xfcfe('0x40')][_0xfcfe('0x42')]?_0x355129[_0xfcfe('0x40')]:_0x2c1bdb[_0xfcfe('0x3c')];_0x355129['order']=qs[_0xfcfe('0x46')](_0xcb3639[_0xfcfe('0x3d')][_0xfcfe('0x46')]);_0x355129['where']=qs[_0xfcfe('0x3e')](_['pick'](_0xcb3639[_0xfcfe('0x3d')],_0x2c1bdb[_0xfcfe('0x3e')]));if(_0xcb3639[_0xfcfe('0x3d')]['filter']){_0x355129[_0xfcfe('0x47')]=_[_0xfcfe('0x49')](_0x355129[_0xfcfe('0x47')],{'$or':_[_0xfcfe('0x39')](_0x355129[_0xfcfe('0x40')],function(_0x327e31){var _0x277a77={};_0x277a77[_0x327e31]={'$like':'%'+_0xcb3639[_0xfcfe('0x3d')][_0xfcfe('0x48')]+'%'};return _0x277a77;})});}_0x355129=_[_0xfcfe('0x49')]({},_0x355129,_0xcb3639[_0xfcfe('0xa7')]);return _0x15d462['getAgents'](_0x355129);}})[_0xfcfe('0x1c')](function(_0x1c7fb6){if(_0x1c7fb6){_0x2ed38f=_0x1c7fb6['length'];if(!_0xcb3639[_0xfcfe('0x3d')][_0xfcfe('0x43')]('nolimit')){_0x355129[_0xfcfe('0x2b')]=qs[_0xfcfe('0x2b')](_0xcb3639[_0xfcfe('0x3d')][_0xfcfe('0x2b')]);_0x355129[_0xfcfe('0x29')]=qs[_0xfcfe('0x29')](_0xcb3639[_0xfcfe('0x3d')][_0xfcfe('0x29')]);}return _0x15d462[_0xfcfe('0xb4')](_0x355129);}})[_0xfcfe('0x1c')](function(_0xdef99b){if(_0xdef99b){return _0xdef99b?{'count':_0x2ed38f,'rows':_0xdef99b}:null;}})[_0xfcfe('0x1c')](respondWithResult(_0x5a07e3,null))['catch'](handleError(_0x5a07e3,null));};exports[_0xfcfe('0xa5')]=function(_0x5d67a6,_0x1f5356,_0x978374){var _0x3d5035,_0x5afef0,_0x5d8272;if(_[_0xfcfe('0x77')](_0x5d67a6[_0xfcfe('0x56')][_0xfcfe('0x56')])||_0x5d67a6[_0xfcfe('0x56')][_0xfcfe('0x56')]===''){throw new db[(_0xfcfe('0x6e'))][(_0xfcfe('0x6f'))](_0xfcfe('0x78'));}if(_['isNil'](_0x5d67a6[_0xfcfe('0x56')]['to'])){}_0x3d5035=_0x5d67a6[_0xfcfe('0x56')]['to'];return db[_0xfcfe('0x4c')]['findOne']({'where':{'id':_0x5d67a6[_0xfcfe('0x52')]['id']}})[_0xfcfe('0x1c')](handleEntityNotFound(_0x1f5356,null))[_0xfcfe('0x1c')](function(_0x42b193){if(_0x42b193){return db[_0xfcfe('0x4c')][_0xfcfe('0x55')]({'where':{'id':_0x42b193['id']},'include':[{'model':db[_0xfcfe('0x7c')],'as':_0xfcfe('0x7d'),'include':[{'model':db[_0xfcfe('0x6d')],'as':_0xfcfe('0x85'),'where':{[_0x42b193['mapKey']]:_0x3d5035},'limit':0x1,'order':[[_0xfcfe('0x73'),'DESC']]}]}]})[_0xfcfe('0x1c')](handleEntityNotFound(_0x1f5356,null))[_0xfcfe('0x1c')](function(_0x371fce){if(_0x371fce&&_0x371fce[_0xfcfe('0x7d')]){_0x5afef0=_0x371fce['get']({'plain':!![]});if(_0x5afef0[_0xfcfe('0x7d')]&&_0x5afef0[_0xfcfe('0x7d')][_0xfcfe('0x85')][_0xfcfe('0x42')]){return _0x5afef0['List'][_0xfcfe('0x85')][0x0];}return db[_0xfcfe('0x6d')][_0xfcfe('0x5d')](_[_0xfcfe('0x86')](_0x5d67a6[_0xfcfe('0x56')],{'firstName':_0x3d5035,[_0x371fce[_0xfcfe('0x87')]]:_0x3d5035,'phone':_0x3d5035,'ListId':_0x5afef0['ListId']}));}})[_0xfcfe('0x1c')](handleEntityNotFound(_0x1f5356,null))[_0xfcfe('0x1c')](function(_0x26cdbc){if(_0x26cdbc){_0x5d8272=_0x26cdbc;return db[_0xfcfe('0x8c')][_0xfcfe('0x55')]({'where':{'ContactId':_0x5d8272['id'],'closed':![],'OpenchannelAccountId':_0x5afef0['id']}})[_0xfcfe('0x1c')](function(_0x2225dd){if(_0x2225dd){return[_0x2225dd,![]];}return db[_0xfcfe('0x8c')][_0xfcfe('0x5d')]({'UserId':_0x5d67a6[_0xfcfe('0x57')]['id'],'ContactId':_0x5d8272['id'],'OpenchannelAccountId':_0x5afef0['id'],'lastMsgDirection':_0xfcfe('0xb5'),'firstMsgDirection':_0xfcfe('0xb5'),'Messages':[_['merge'](_0x5d67a6[_0xfcfe('0x56')],{'read':![],'body':_0x5d67a6[_0xfcfe('0x56')][_0xfcfe('0x56')],'OpenchannelAccountId':_0x5afef0['id'],'UserId':_0x5d67a6[_0xfcfe('0x57')]['id'],'ContactId':_0x5d8272['id']})]},{'include':[{'model':db['OpenchannelMessage'],'as':_0xfcfe('0xb6')}]})[_0xfcfe('0x1c')](function(_0x2f1050){return[_0x2f1050,!![]];});});}})[_0xfcfe('0xaf')](function(_0x11f5aa,_0x4becc7){if(_0x4becc7){return _0x11f5aa;}return db[_0xfcfe('0x93')][_0xfcfe('0x5d')](_[_0xfcfe('0x49')](_0x5d67a6[_0xfcfe('0x56')],{'read':![],'body':_0x5d67a6[_0xfcfe('0x56')][_0xfcfe('0x56')],'OpenchannelAccountId':_0x5afef0['id'],'OpenchannelInteractionId':_0x11f5aa['id'],'UserId':_0x5d67a6[_0xfcfe('0x57')]['id'],'ContactId':_0x5d8272['id']}))[_0xfcfe('0x1c')](function(_0x3f6678){_0x11f5aa[_0xfcfe('0xb7')]['Messages']=[];_0x11f5aa[_0xfcfe('0xb7')]['Messages'][_0xfcfe('0xb8')](_0x3f6678[_0xfcfe('0xb7')]);return _0x11f5aa;});});}})[_0xfcfe('0x1c')](respondWithResult(_0x1f5356,null))['catch'](handleError(_0x1f5356,null));}; \ No newline at end of file +var _0xeff8=['isArray','userOpenchannelAccount:remove','getAgents','out','Messages','dataValues','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','defaults','redis','localhost','socket.io-emitter','register','jayson/promise','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','end','status','json','offset','limit','undefined','count','Content-Range','reject','get','OpenchannelAccounts','UserProfileResource','name','send','index','mandatoryDispositionPause','map','OpenchannelAccount','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','type','VIRTUAL','filter','merge','options','includeAll','include','findAll','rows','show','params','Pause','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','destroy','describe','addDisposition','OpenchannelAccountId','Disposition','getDispositions','findOne','removeDispositions','ids','CannedAnswer','removeAnswers','CmContact','Sequelize','no\x20available\x20attributes','difference','updatedAt','createdAt','CompanyId','ListId','from','ValidationError','isNil','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','CmList','List','Contacts','OpenchannelApplication','Applications','account','applications','list','orderBy','priority','asc','firstName','lastName','threadId','externalUrl','ContactId','spread','contact','messageId','created','interaction','autoclose','close','unmanaged','*,*,*,*','OpenchannelMessage','UserId','User','waitForTheAssignedAgent','queueId','OpenchannelQueue','unshift','queue','waitForTheAssignedQueue','Start','startRouting','EventManager','notify','addApplications','sequelize','transaction','ISOLATION_LEVELS','READ_COMMITTED','findAndCountAll','stack','finally','getInteractions','OpenchannelInteraction','Contact','Owner','internal','tag','addAgents','omit','emit','userOpenchannelAccount:save','removeAgents'];(function(_0x29c38b,_0x46a22a){var _0x1a6596=function(_0x3b8d31){while(--_0x3b8d31){_0x29c38b['push'](_0x29c38b['shift']());}};_0x1a6596(++_0x46a22a);}(_0xeff8,0x186));var _0x8eff=function(_0x310504,_0x26ad95){_0x310504=_0x310504-0x0;var _0x5b36d0=_0xeff8[_0x310504];return _0x5b36d0;};'use strict';var emlformat=require(_0x8eff('0x0'));var rimraf=require(_0x8eff('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8eff('0x2'));var rp=require(_0x8eff('0x3'));var moment=require(_0x8eff('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x8eff('0x5'));var util=require(_0x8eff('0x6'));var path=require(_0x8eff('0x7'));var sox=require(_0x8eff('0x8'));var csv=require('to-csv');var ejs=require(_0x8eff('0x9'));var fs=require('fs');var fs_extra=require(_0x8eff('0xa'));var _=require(_0x8eff('0xb'));var squel=require(_0x8eff('0xc'));var crypto=require('crypto');var jsforce=require(_0x8eff('0xd'));var deskjs=require(_0x8eff('0xe'));var toCsv=require(_0x8eff('0xf'));var querystring=require(_0x8eff('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x8eff('0x11'));var qs=require(_0x8eff('0x12'));var as=require(_0x8eff('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8eff('0x14'))(_0x8eff('0x15'));var utils=require('../../config/utils');var config=require(_0x8eff('0x16'));var licenseUtil=require(_0x8eff('0x17'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x8eff('0x18')](config[_0x8eff('0x19')],{'host':_0x8eff('0x1a'),'port':0x18eb});var socket=require(_0x8eff('0x1b'))(new Redis(config[_0x8eff('0x19')]));require('./openchannelAccount.socket')[_0x8eff('0x1c')](socket);var jayson=require(_0x8eff('0x1d'));var client=jayson[_0x8eff('0x1e')][_0x8eff('0x1f')]({'port':0x232c});var client9002=jayson[_0x8eff('0x1e')][_0x8eff('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x16202e,_0xdbb753,_0x16a4eb,_0x427902){return new BPromise(function(_0x137344,_0x4ad743){var _0x32b791=_0x427902||client;return _0x32b791[_0x8eff('0x20')](_0x16202e,_0x16a4eb)[_0x8eff('0x21')](function(_0x20ec2a){logger[_0x8eff('0x22')](_0x8eff('0x23'),_0xdbb753,_0x8eff('0x24'));logger[_0x8eff('0x25')](_0x8eff('0x26'),_0xdbb753,_0x8eff('0x24'),JSON[_0x8eff('0x27')](_0x20ec2a));if(_0x20ec2a[_0x8eff('0x28')]){if(_0x20ec2a[_0x8eff('0x28')][_0x8eff('0x29')]===0x1f4){logger[_0x8eff('0x28')](_0x8eff('0x23'),_0xdbb753,_0x20ec2a['error'][_0x8eff('0x2a')]);return _0x4ad743(_0x20ec2a[_0x8eff('0x28')]['message']);}logger[_0x8eff('0x28')]('OpenchannelAccount,\x20%s,\x20%s',_0xdbb753,_0x20ec2a[_0x8eff('0x28')][_0x8eff('0x2a')]);return _0x137344(_0x20ec2a[_0x8eff('0x28')][_0x8eff('0x2a')]);}else{logger[_0x8eff('0x22')]('OpenchannelAccount,\x20%s,\x20%s',_0xdbb753,_0x8eff('0x24'));_0x137344(_0x20ec2a[_0x8eff('0x2b')]['message']);}})[_0x8eff('0x2c')](function(_0x5ec3d7){logger[_0x8eff('0x28')](_0x8eff('0x23'),_0xdbb753,_0x5ec3d7);_0x4ad743(_0x5ec3d7);});});}function respondWithStatusCode(_0xd60d94,_0x41324b){_0x41324b=_0x41324b||0xcc;return function(_0x6359df){if(_0x6359df){return _0xd60d94[_0x8eff('0x2d')](_0x41324b);}return _0xd60d94['status'](_0x41324b)[_0x8eff('0x2e')]();};}function respondWithResult(_0x323ffa,_0x15083c){_0x15083c=_0x15083c||0xc8;return function(_0xb88ce9){if(_0xb88ce9){return _0x323ffa[_0x8eff('0x2f')](_0x15083c)[_0x8eff('0x30')](_0xb88ce9);}};}function respondWithFilteredResult(_0x4cc146,_0x4ed3b8){return function(_0x44dcdb){if(_0x44dcdb){var _0x472b19=typeof _0x4ed3b8[_0x8eff('0x31')]==='undefined'&&typeof _0x4ed3b8[_0x8eff('0x32')]===_0x8eff('0x33');var _0x229e0d=_0x44dcdb[_0x8eff('0x34')];var _0x25b98e=_0x472b19?0x0:_0x4ed3b8[_0x8eff('0x31')];var _0x141bd7=_0x472b19?_0x44dcdb[_0x8eff('0x34')]:_0x4ed3b8[_0x8eff('0x31')]+_0x4ed3b8[_0x8eff('0x32')];var _0xf3ee6;if(_0x141bd7>=_0x229e0d){_0x141bd7=_0x229e0d;_0xf3ee6=0xc8;}else{_0xf3ee6=0xce;}_0x4cc146[_0x8eff('0x2f')](_0xf3ee6);return _0x4cc146['set'](_0x8eff('0x35'),_0x25b98e+'-'+_0x141bd7+'/'+_0x229e0d)[_0x8eff('0x30')](_0x44dcdb);}return null;};}function patchUpdates(_0x115fa4){return function(_0x7da1fb){try{jsonpatch['apply'](_0x7da1fb,_0x115fa4,!![]);}catch(_0x1f2240){return BPromise[_0x8eff('0x36')](_0x1f2240);}return _0x7da1fb['save']();};}function saveUpdates(_0x4e1256,_0x40ed09){return function(_0x271d64){if(_0x271d64){return _0x271d64['update'](_0x4e1256)['then'](function(_0x51ec38){return _0x51ec38;});}return null;};}function removeEntity(_0x315691,_0x5f5b79){return function(_0x45d9d4){if(_0x45d9d4){return _0x45d9d4['destroy']()[_0x8eff('0x21')](function(){var _0x3f7002=_0x45d9d4[_0x8eff('0x37')]({'plain':!![]});var _0x1dcab3=_0x8eff('0x38');return db[_0x8eff('0x39')]['destroy']({'where':{'type':_0x1dcab3,'resourceId':_0x3f7002['id']}})[_0x8eff('0x21')](function(){return _0x45d9d4;});})['then'](function(){_0x315691[_0x8eff('0x2f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2fe45d,_0x4460cf){return function(_0x3080a6){if(!_0x3080a6){_0x2fe45d[_0x8eff('0x2d')](0x194);}return _0x3080a6;};}function handleError(_0x4bd807,_0x2eb4bb){_0x2eb4bb=_0x2eb4bb||0x1f4;return function(_0x170a33){logger[_0x8eff('0x28')](_0x170a33['stack']);if(_0x170a33[_0x8eff('0x3a')]){delete _0x170a33[_0x8eff('0x3a')];}_0x4bd807[_0x8eff('0x2f')](_0x2eb4bb)[_0x8eff('0x3b')](_0x170a33);};}exports[_0x8eff('0x3c')]=function(_0xd2a915,_0x29f68e){var _0x26da7a={'include':[{'model':db['Pause'],'as':_0x8eff('0x3d')}]},_0x661c36={},_0x5c1277={'count':0x0,'rows':[]};var _0x114f8e=_[_0x8eff('0x3e')](db[_0x8eff('0x3f')][_0x8eff('0x40')],function(_0x1ba78a){return{'name':_0x1ba78a[_0x8eff('0x41')],'type':_0x1ba78a['type'][_0x8eff('0x42')]};});_0x661c36[_0x8eff('0x43')]=_['map'](_0x114f8e,_0x8eff('0x3a'));_0x661c36[_0x8eff('0x44')]=_[_0x8eff('0x45')](_0xd2a915[_0x8eff('0x44')]);_0x661c36[_0x8eff('0x46')]=_[_0x8eff('0x47')](_0x661c36[_0x8eff('0x43')],_0x661c36[_0x8eff('0x44')]);_0x26da7a[_0x8eff('0x48')]=_['intersection'](_0x661c36[_0x8eff('0x43')],qs[_0x8eff('0x49')](_0xd2a915[_0x8eff('0x44')][_0x8eff('0x49')]));_0x26da7a[_0x8eff('0x48')]=_0x26da7a['attributes'][_0x8eff('0x4a')]?_0x26da7a['attributes']:_0x661c36[_0x8eff('0x43')];if(!_0xd2a915[_0x8eff('0x44')][_0x8eff('0x4b')](_0x8eff('0x4c'))){_0x26da7a['limit']=qs[_0x8eff('0x32')](_0xd2a915[_0x8eff('0x44')][_0x8eff('0x32')]);_0x26da7a['offset']=qs['offset'](_0xd2a915[_0x8eff('0x44')][_0x8eff('0x31')]);}_0x26da7a[_0x8eff('0x4d')]=qs[_0x8eff('0x4e')](_0xd2a915[_0x8eff('0x44')]['sort']);_0x26da7a[_0x8eff('0x4f')]=qs['filters'](_[_0x8eff('0x50')](_0xd2a915[_0x8eff('0x44')],_0x661c36['filters']),_0x114f8e);if(_0xd2a915['query']['filter']){_0x26da7a['where']=_['merge'](_0x26da7a['where'],{'$or':_[_0x8eff('0x3e')](_0x114f8e,function(_0x44cda1){if(_0x44cda1[_0x8eff('0x51')]!==_0x8eff('0x52')){var _0x1aa204={};_0x1aa204[_0x44cda1[_0x8eff('0x3a')]]={'$like':'%'+_0xd2a915[_0x8eff('0x44')][_0x8eff('0x53')]+'%'};return _0x1aa204;}})});}_0x26da7a=_[_0x8eff('0x54')]({},_0x26da7a,_0xd2a915[_0x8eff('0x55')]);var _0x4c7013={'where':_0x26da7a[_0x8eff('0x4f')]};return db['OpenchannelAccount'][_0x8eff('0x34')](_0x4c7013)[_0x8eff('0x21')](function(_0x254d6a){_0x5c1277[_0x8eff('0x34')]=_0x254d6a;if(_0xd2a915[_0x8eff('0x44')][_0x8eff('0x56')]){_0x26da7a[_0x8eff('0x57')]=[{'all':!![]}];}return db[_0x8eff('0x3f')][_0x8eff('0x58')](_0x26da7a);})[_0x8eff('0x21')](function(_0x2a4dbb){_0x5c1277[_0x8eff('0x59')]=_0x2a4dbb;return _0x5c1277;})['then'](respondWithFilteredResult(_0x29f68e,_0x26da7a))[_0x8eff('0x2c')](handleError(_0x29f68e,null));};exports[_0x8eff('0x5a')]=function(_0x40209d,_0xe703af){var _0x3de247={'raw':![],'where':{'id':_0x40209d[_0x8eff('0x5b')]['id']},'include':[{'model':db[_0x8eff('0x5c')],'as':_0x8eff('0x3d')}]},_0x2de7fd={};_0x2de7fd['model']=_['keys'](db[_0x8eff('0x3f')][_0x8eff('0x40')]);_0x2de7fd[_0x8eff('0x44')]=_[_0x8eff('0x45')](_0x40209d[_0x8eff('0x44')]);_0x2de7fd[_0x8eff('0x46')]=_['intersection'](_0x2de7fd[_0x8eff('0x43')],_0x2de7fd[_0x8eff('0x44')]);_0x3de247[_0x8eff('0x48')]=_['intersection'](_0x2de7fd[_0x8eff('0x43')],qs[_0x8eff('0x49')](_0x40209d[_0x8eff('0x44')][_0x8eff('0x49')]));_0x3de247['attributes']=_0x3de247[_0x8eff('0x48')][_0x8eff('0x4a')]?_0x3de247[_0x8eff('0x48')]:_0x2de7fd[_0x8eff('0x43')];if(_0x40209d[_0x8eff('0x44')][_0x8eff('0x56')]){_0x3de247[_0x8eff('0x57')]=[{'all':!![]}];}_0x3de247=_['merge']({},_0x3de247,_0x40209d[_0x8eff('0x55')]);return db[_0x8eff('0x3f')][_0x8eff('0x5d')](_0x3de247)[_0x8eff('0x21')](handleEntityNotFound(_0xe703af,null))[_0x8eff('0x21')](respondWithResult(_0xe703af,null))['catch'](handleError(_0xe703af,null));};exports[_0x8eff('0x5e')]=function(_0x16b968,_0x5d79b){return db['OpenchannelAccount'][_0x8eff('0x5e')](_0x16b968['body'],{})[_0x8eff('0x21')](function(_0x172c6c){var _0x23ed92=_0x16b968[_0x8eff('0x5f')][_0x8eff('0x37')]({'plain':!![]});if(!_0x23ed92)throw new Error(_0x8eff('0x60'));if(_0x23ed92[_0x8eff('0x61')]==='user'){var _0x48a414=_0x172c6c[_0x8eff('0x37')]({'plain':!![]});var _0x4cf5db=_0x8eff('0x38');return db[_0x8eff('0x62')][_0x8eff('0x5d')]({'where':{'name':_0x4cf5db,'userProfileId':_0x23ed92[_0x8eff('0x63')]},'raw':!![]})[_0x8eff('0x21')](function(_0x574678){if(_0x574678&&_0x574678[_0x8eff('0x64')]===0x0){return db[_0x8eff('0x39')][_0x8eff('0x5e')]({'name':_0x48a414[_0x8eff('0x3a')],'resourceId':_0x48a414['id'],'type':_0x574678[_0x8eff('0x3a')],'sectionId':_0x574678['id']},{})[_0x8eff('0x21')](function(){return _0x172c6c;});}else{return _0x172c6c;}})['catch'](function(_0x1147a8){logger['error'](_0x8eff('0x65'),_0x1147a8);throw _0x1147a8;});}return _0x172c6c;})[_0x8eff('0x21')](respondWithResult(_0x5d79b,0xc9))['catch'](handleError(_0x5d79b,null));};exports[_0x8eff('0x66')]=function(_0x2d3998,_0x469cdc){if(_0x2d3998[_0x8eff('0x67')]['id']){delete _0x2d3998[_0x8eff('0x67')]['id'];}return db[_0x8eff('0x3f')][_0x8eff('0x5d')]({'where':{'id':_0x2d3998[_0x8eff('0x5b')]['id']},'include':[{'model':db['Pause'],'as':_0x8eff('0x3d')}]})['then'](handleEntityNotFound(_0x469cdc,null))['then'](saveUpdates(_0x2d3998[_0x8eff('0x67')],null))[_0x8eff('0x21')](respondWithResult(_0x469cdc,null))['catch'](handleError(_0x469cdc,null));};exports[_0x8eff('0x68')]=function(_0x4238d7,_0x4aedcd){return db[_0x8eff('0x3f')][_0x8eff('0x5d')]({'where':{'id':_0x4238d7['params']['id']}})[_0x8eff('0x21')](handleEntityNotFound(_0x4aedcd,null))[_0x8eff('0x21')](removeEntity(_0x4aedcd,null))[_0x8eff('0x2c')](handleError(_0x4aedcd,null));};exports[_0x8eff('0x69')]=function(_0x26b4f0,_0x41e395){return db[_0x8eff('0x3f')]['describe']()['then'](respondWithResult(_0x41e395,null))[_0x8eff('0x2c')](handleError(_0x41e395,null));};exports[_0x8eff('0x6a')]=function(_0x62ec49,_0x2bf5ca,_0x244846){if(_0x62ec49[_0x8eff('0x67')]['id']){delete _0x62ec49[_0x8eff('0x67')]['id'];}return db['OpenchannelAccount']['find']({'where':{'id':_0x62ec49[_0x8eff('0x5b')]['id']}})['then'](handleEntityNotFound(_0x2bf5ca,null))['then'](function(_0x4946a9){if(_0x4946a9){_0x62ec49[_0x8eff('0x67')][_0x8eff('0x6b')]=_0x4946a9['id'];return db[_0x8eff('0x6c')][_0x8eff('0x5e')](_0x62ec49[_0x8eff('0x67')]);}})[_0x8eff('0x21')](respondWithResult(_0x2bf5ca,null))[_0x8eff('0x2c')](handleError(_0x2bf5ca,null));};exports[_0x8eff('0x6d')]=function(_0x531452,_0x227469,_0x5492df){var _0x42efc6={'raw':![],'where':{}};var _0x35a221={};var _0x12ebd1={'count':0x0,'rows':[]};return db[_0x8eff('0x3f')][_0x8eff('0x6e')]({'where':{'id':_0x531452[_0x8eff('0x5b')]['id']}})['then'](handleEntityNotFound(_0x227469,null))[_0x8eff('0x21')](function(_0x545fcf){if(_0x545fcf){_0x35a221[_0x8eff('0x43')]=_[_0x8eff('0x45')](db[_0x8eff('0x6c')][_0x8eff('0x40')]);_0x35a221[_0x8eff('0x44')]=_[_0x8eff('0x45')](_0x531452[_0x8eff('0x44')]);_0x35a221[_0x8eff('0x46')]=_[_0x8eff('0x47')](_0x35a221['model'],_0x35a221[_0x8eff('0x44')]);_0x42efc6[_0x8eff('0x48')]=_[_0x8eff('0x47')](_0x35a221[_0x8eff('0x43')],qs[_0x8eff('0x49')](_0x531452[_0x8eff('0x44')][_0x8eff('0x49')]));_0x42efc6[_0x8eff('0x48')]=_0x42efc6[_0x8eff('0x48')][_0x8eff('0x4a')]?_0x42efc6['attributes']:_0x35a221['model'];if(!_0x531452['query']['hasOwnProperty'](_0x8eff('0x4c'))){_0x42efc6[_0x8eff('0x32')]=qs[_0x8eff('0x32')](_0x531452[_0x8eff('0x44')][_0x8eff('0x32')]);_0x42efc6[_0x8eff('0x31')]=qs[_0x8eff('0x31')](_0x531452['query'][_0x8eff('0x31')]);}_0x42efc6[_0x8eff('0x4d')]=qs[_0x8eff('0x4e')](_0x531452[_0x8eff('0x44')]['sort']);_0x42efc6[_0x8eff('0x4f')]=qs[_0x8eff('0x46')](_['pick'](_0x531452[_0x8eff('0x44')],_0x35a221[_0x8eff('0x46')]));_0x42efc6[_0x8eff('0x4f')]['OpenchannelAccountId']=_0x545fcf['id'];if(_0x531452['query']['filter']){_0x42efc6[_0x8eff('0x4f')]=_[_0x8eff('0x54')](_0x42efc6[_0x8eff('0x4f')],{'$or':_[_0x8eff('0x3e')](_0x42efc6[_0x8eff('0x48')],function(_0x10d22d){var _0x283f26={};_0x283f26[_0x10d22d]={'$like':'%'+_0x531452[_0x8eff('0x44')][_0x8eff('0x53')]+'%'};return _0x283f26;})});}_0x42efc6=_[_0x8eff('0x54')]({},_0x42efc6,_0x531452[_0x8eff('0x55')]);return db['Disposition'][_0x8eff('0x34')]({'where':_0x42efc6['where']})[_0x8eff('0x21')](function(_0x3410bd){_0x12ebd1['count']=_0x3410bd;if(_0x531452[_0x8eff('0x44')]['includeAll']){_0x42efc6[_0x8eff('0x57')]=[{'all':!![]}];}return db[_0x8eff('0x6c')][_0x8eff('0x58')](_0x42efc6);})[_0x8eff('0x21')](function(_0x29e358){_0x12ebd1['rows']=_0x29e358;return _0x12ebd1;});}})[_0x8eff('0x21')](respondWithFilteredResult(_0x227469,_0x42efc6))[_0x8eff('0x2c')](handleError(_0x227469,null));};exports[_0x8eff('0x6f')]=function(_0x19768b,_0x30c321,_0x7a4bfd){return db[_0x8eff('0x3f')][_0x8eff('0x5d')]({'where':{'id':_0x19768b[_0x8eff('0x5b')]['id']}})[_0x8eff('0x21')](handleEntityNotFound(_0x30c321,null))[_0x8eff('0x21')](function(_0x52383c){if(_0x52383c){return _0x52383c[_0x8eff('0x6f')](_0x19768b[_0x8eff('0x44')][_0x8eff('0x70')]);}})[_0x8eff('0x21')](respondWithStatusCode(_0x30c321,null))[_0x8eff('0x2c')](handleError(_0x30c321,null));};exports['addAnswer']=function(_0x2fb3a4,_0x2c231c,_0x5c7e6e){if(_0x2fb3a4['body']['id']){delete _0x2fb3a4[_0x8eff('0x67')]['id'];}return db[_0x8eff('0x3f')][_0x8eff('0x5d')]({'where':{'id':_0x2fb3a4[_0x8eff('0x5b')]['id']}})[_0x8eff('0x21')](handleEntityNotFound(_0x2c231c,null))[_0x8eff('0x21')](function(_0x5f258c){if(_0x5f258c){_0x2fb3a4[_0x8eff('0x67')]['OpenchannelAccountId']=_0x5f258c['id'];return db[_0x8eff('0x71')][_0x8eff('0x5e')](_0x2fb3a4['body']);}})[_0x8eff('0x21')](respondWithResult(_0x2c231c,null))['catch'](handleError(_0x2c231c,null));};exports['getAnswers']=function(_0x4522b,_0x525779,_0x1875fb){var _0x113559={'raw':![],'where':{}};var _0x4e0128={};var _0x63754={'count':0x0,'rows':[]};return db[_0x8eff('0x3f')]['findOne']({'where':{'id':_0x4522b[_0x8eff('0x5b')]['id']}})[_0x8eff('0x21')](handleEntityNotFound(_0x525779,null))[_0x8eff('0x21')](function(_0x33c21a){if(_0x33c21a){_0x4e0128[_0x8eff('0x43')]=_[_0x8eff('0x45')](db[_0x8eff('0x71')][_0x8eff('0x40')]);_0x4e0128[_0x8eff('0x44')]=_['keys'](_0x4522b['query']);_0x4e0128['filters']=_[_0x8eff('0x47')](_0x4e0128[_0x8eff('0x43')],_0x4e0128[_0x8eff('0x44')]);_0x113559['attributes']=_[_0x8eff('0x47')](_0x4e0128[_0x8eff('0x43')],qs[_0x8eff('0x49')](_0x4522b[_0x8eff('0x44')][_0x8eff('0x49')]));_0x113559[_0x8eff('0x48')]=_0x113559['attributes'][_0x8eff('0x4a')]?_0x113559['attributes']:_0x4e0128[_0x8eff('0x43')];if(!_0x4522b[_0x8eff('0x44')][_0x8eff('0x4b')](_0x8eff('0x4c'))){_0x113559[_0x8eff('0x32')]=qs[_0x8eff('0x32')](_0x4522b[_0x8eff('0x44')]['limit']);_0x113559[_0x8eff('0x31')]=qs[_0x8eff('0x31')](_0x4522b[_0x8eff('0x44')][_0x8eff('0x31')]);}_0x113559[_0x8eff('0x4d')]=qs['sort'](_0x4522b[_0x8eff('0x44')][_0x8eff('0x4e')]);_0x113559[_0x8eff('0x4f')]=qs['filters'](_['pick'](_0x4522b[_0x8eff('0x44')],_0x4e0128[_0x8eff('0x46')]));_0x113559[_0x8eff('0x4f')]['OpenchannelAccountId']=_0x33c21a['id'];if(_0x4522b[_0x8eff('0x44')]['filter']){_0x113559['where']=_[_0x8eff('0x54')](_0x113559[_0x8eff('0x4f')],{'$or':_[_0x8eff('0x3e')](_0x113559[_0x8eff('0x48')],function(_0x354068){var _0x42e9b7={};_0x42e9b7[_0x354068]={'$like':'%'+_0x4522b[_0x8eff('0x44')][_0x8eff('0x53')]+'%'};return _0x42e9b7;})});}_0x113559=_[_0x8eff('0x54')]({},_0x113559,_0x4522b[_0x8eff('0x55')]);return db[_0x8eff('0x71')][_0x8eff('0x34')]({'where':_0x113559['where']})[_0x8eff('0x21')](function(_0x291043){_0x63754[_0x8eff('0x34')]=_0x291043;if(_0x4522b[_0x8eff('0x44')][_0x8eff('0x56')]){_0x113559['include']=[{'all':!![]}];}return db[_0x8eff('0x71')][_0x8eff('0x58')](_0x113559);})[_0x8eff('0x21')](function(_0x1278f2){_0x63754['rows']=_0x1278f2;return _0x63754;});}})['then'](respondWithFilteredResult(_0x525779,_0x113559))[_0x8eff('0x2c')](handleError(_0x525779,null));};exports[_0x8eff('0x72')]=function(_0x38eff3,_0x32d427,_0x4944af){return db[_0x8eff('0x3f')][_0x8eff('0x5d')]({'where':{'id':_0x38eff3[_0x8eff('0x5b')]['id']}})[_0x8eff('0x21')](handleEntityNotFound(_0x32d427,null))[_0x8eff('0x21')](function(_0x44e68a){if(_0x44e68a){return _0x44e68a[_0x8eff('0x72')](_0x38eff3[_0x8eff('0x44')][_0x8eff('0x70')]);}})['then'](respondWithStatusCode(_0x32d427,null))[_0x8eff('0x2c')](handleError(_0x32d427,null));};exports['notify']=function(_0x22051e,_0x16367d,_0x42492d){var _0x50f9bf={'body':_0x22051e[_0x8eff('0x67')],'channel':'openchannel'};var _0x1dba3f=[];var _0x22452b=[];var _0x5c3222={};var _0x2c753a=![];return db[_0x8eff('0x73')][_0x8eff('0x69')]()[_0x8eff('0x21')](function(_0x181171){if(!_0x181171){throw new db[(_0x8eff('0x74'))]['ValidationError'](_0x8eff('0x75'));}_0x1dba3f=_[_0x8eff('0x76')](_[_0x8eff('0x45')](_0x181171),['createdAt',_0x8eff('0x77')]);_0x22452b=_[_0x8eff('0x76')](_['keys'](_0x181171),[_0x8eff('0x78'),_0x8eff('0x77'),_0x8eff('0x79'),_0x8eff('0x7a')]);if(_0x22051e['body']['id']){delete _0x22051e[_0x8eff('0x67')]['id'];}if(_['isNil'](_0x22051e[_0x8eff('0x67')][_0x8eff('0x7b')])){throw new db[(_0x8eff('0x74'))][(_0x8eff('0x7c'))]('from\x20is\x20mandatory');}if(_[_0x8eff('0x7d')](_0x22051e['body'][_0x8eff('0x67')])||_0x22051e[_0x8eff('0x67')][_0x8eff('0x67')]===''){throw new db[(_0x8eff('0x74'))][(_0x8eff('0x7c'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x8eff('0x7d')](_0x22051e[_0x8eff('0x67')][_0x8eff('0x7e')])){throw new db[(_0x8eff('0x74'))][(_0x8eff('0x7c'))](_0x8eff('0x7f')+_0x22452b);}if(!_[_0x8eff('0x80')](_0x22452b,_0x22051e[_0x8eff('0x67')]['mapKey'])){throw new db[(_0x8eff('0x74'))][(_0x8eff('0x7c'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x22452b);}_0x5c3222[_0x22051e['body'][_0x8eff('0x7e')]]=_0x22051e['body']['from'];})[_0x8eff('0x21')](function(){return db[_0x8eff('0x3f')]['find']({'where':{'id':_0x22051e[_0x8eff('0x5b')]['id']},'include':[{'model':db[_0x8eff('0x81')],'as':_0x8eff('0x82'),'include':[{'model':db['CmContact'],'as':_0x8eff('0x83'),'where':_0x5c3222,'limit':0x1,'order':[[_0x8eff('0x77'),'DESC']]}]},{'model':db[_0x8eff('0x84')],'as':_0x8eff('0x85')}]});})[_0x8eff('0x21')](handleEntityNotFound(_0x16367d,null))['then'](function(_0x5477c0){if(_0x5477c0&&_0x5477c0['List']){_0x50f9bf[_0x8eff('0x86')]=_0x5477c0;_0x50f9bf[_0x8eff('0x87')]=_0x5477c0[_0x8eff('0x85')];_0x50f9bf[_0x8eff('0x88')]=_0x5477c0[_0x8eff('0x82')];_0x50f9bf[_0x8eff('0x87')]=_[_0x8eff('0x89')](_0x50f9bf[_0x8eff('0x87')],[_0x8eff('0x8a')],[_0x8eff('0x8b')]);if(_0x50f9bf[_0x8eff('0x86')]['Applications']){delete _0x50f9bf['account'][_0x8eff('0x85')];}if(_0x50f9bf[_0x8eff('0x86')][_0x8eff('0x82')]&&_0x50f9bf[_0x8eff('0x86')][_0x8eff('0x82')][_0x8eff('0x83')][_0x8eff('0x4a')]){return _0x50f9bf[_0x8eff('0x86')][_0x8eff('0x82')]['Contacts'][0x0];}var _0x3eceb3=_[_0x8eff('0x18')](_0x22051e[_0x8eff('0x67')],{'firstName':_0x22051e[_0x8eff('0x67')][_0x8eff('0x7b')],'ListId':_0x5477c0[_0x8eff('0x7a')]});_0x3eceb3[_0x22051e['body']['mapKey']]=_0x22051e[_0x8eff('0x67')][_0x8eff('0x7b')];return db[_0x8eff('0x73')][_0x8eff('0x5e')](_0x3eceb3,{'fields':_0x1dba3f,'raw':!![]});}})[_0x8eff('0x21')](handleEntityNotFound(_0x16367d,null))['then'](function(_0x16854a){_0x50f9bf['contact']=_0x16854a;if(_0x16854a){var _0x50e56b={'ContactId':_0x16854a['id'],'OpenchannelAccountId':_0x22051e[_0x8eff('0x5b')]['id'],'from':(_0x16854a[_0x8eff('0x8c')]||'')+'\x20'+(_0x16854a[_0x8eff('0x8d')]||'')};var _0x594c8c={'OpenchannelAccountId':_0x22051e[_0x8eff('0x5b')]['id'],'closed':![]};if(_0x22051e[_0x8eff('0x67')][_0x8eff('0x8e')]){_0x594c8c[_0x8eff('0x8e')]=_0x22051e[_0x8eff('0x67')][_0x8eff('0x8e')];return db['OpenchannelInteraction'][_0x8eff('0x5d')]({'where':_0x594c8c})['then'](function(_0x156e33){if(_0x156e33){return[_0x156e33,![]];}_0x50e56b[_0x8eff('0x8e')]=_0x22051e[_0x8eff('0x67')][_0x8eff('0x8e')];_0x50e56b[_0x8eff('0x8f')]=_0x22051e[_0x8eff('0x67')]['externalUrl'];return db['OpenchannelInteraction'][_0x8eff('0x5e')](_0x50e56b)[_0x8eff('0x21')](function(_0x30e8ab){return[_0x30e8ab,!![]];});});}else{_0x594c8c[_0x8eff('0x8e')]=null;}_0x594c8c[_0x8eff('0x90')]=_0x16854a['id'];return db['OpenchannelInteraction'][_0x8eff('0x5d')]({'where':_0x594c8c})[_0x8eff('0x21')](function(_0x3414c1){if(_0x3414c1){return[_0x3414c1,![]];}return db['OpenchannelInteraction']['create'](_0x50e56b)[_0x8eff('0x21')](function(_0x1a09cb){return[_0x1a09cb,!![]];});});}})[_0x8eff('0x91')](function(_0x3cf038,_0x210ae8){if(_0x3cf038){_0x2c753a=_0x210ae8;if(!_0x210ae8){var _0xfcb9e3={'from':(_0x50f9bf[_0x8eff('0x92')][_0x8eff('0x8c')]||'')+'\x20'+(_0x50f9bf['contact']['lastName']||'')};if(_0x22051e[_0x8eff('0x67')][_0x8eff('0x8e')]&&_0x22051e[_0x8eff('0x67')][_0x8eff('0x93')]&&_0x22051e[_0x8eff('0x67')][_0x8eff('0x8e')]!=_0x22051e[_0x8eff('0x67')]['messageId']){_0xfcb9e3[_0x8eff('0x8e')]=_0x22051e[_0x8eff('0x67')][_0x8eff('0x93')];}return _0x3cf038[_0x8eff('0x66')](_0xfcb9e3);}else{return _0x3cf038;}}})[_0x8eff('0x21')](function(_0x2ed342){_0x50f9bf['interaction']=_0x2ed342['get']({'plain':!![]});_0x50f9bf['interaction'][_0x8eff('0x94')]=_0x2c753a;if(_0x50f9bf[_0x8eff('0x95')][_0x8eff('0x94')]){if(_0x50f9bf[_0x8eff('0x86')][_0x8eff('0x96')]){_0x50f9bf[_0x8eff('0x87')]['push']({'id':0x0,'priority':_0x50f9bf[_0x8eff('0x87')][_0x8eff('0x4a')]+0x1,'app':_0x8eff('0x97'),'appdata':_0x8eff('0x98'),'interval':_0x8eff('0x99')});}}return db[_0x8eff('0x9a')][_0x8eff('0x5e')]({'body':_0x22051e[_0x8eff('0x67')][_0x8eff('0x67')],'OpenchannelAccountId':_0x22051e[_0x8eff('0x5b')]['id'],'OpenchannelInteractionId':_0x2ed342['id'],'direction':'in','ContactId':_0x50f9bf[_0x8eff('0x92')]['id'],'AttachmentId':_0x22051e[_0x8eff('0x67')]['AttachmentId']});})[_0x8eff('0x21')](function(_0x15c803){_0x50f9bf[_0x8eff('0x2a')]=_0x15c803;if(!_0x50f9bf[_0x8eff('0x95')][_0x8eff('0x9b')])return;return db[_0x8eff('0x9c')]['find']({'attributes':['id',_0x8eff('0x3a')],'where':{'id':_0x50f9bf[_0x8eff('0x95')][_0x8eff('0x9b')]}});})['then'](function(_0x491901){if(_0x491901){_0x50f9bf[_0x8eff('0x87')]['unshift']({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x491901[_0x8eff('0x3a')]+','+(_0x50f9bf[_0x8eff('0x86')][_0x8eff('0x9d')]||0xa),'interval':_0x8eff('0x99')});}if(!_0x50f9bf[_0x8eff('0x95')][_0x8eff('0x9e')])return;return db[_0x8eff('0x9f')][_0x8eff('0x5d')]({'attributes':['id','name'],'where':{'id':_0x50f9bf[_0x8eff('0x95')][_0x8eff('0x9e')]}});})[_0x8eff('0x21')](function(_0x13572d){if(_0x13572d){_0x50f9bf['applications'][_0x8eff('0xa0')]({'id':0x0,'priority':0x1,'app':_0x8eff('0xa1'),'appdata':_0x13572d[_0x8eff('0x3a')]+','+(_0x50f9bf[_0x8eff('0x86')][_0x8eff('0xa2')]||0x12c),'interval':_0x8eff('0x99')});}return respondWithRpcPromise(_0x8eff('0xa3'),_0x8eff('0xa4'),_0x50f9bf);})[_0x8eff('0x21')](function(_0x33dfd6){respondWithRpcPromise(_0x8eff('0xa5'),_0x8eff('0xa5'),{'event':_0x8eff('0xa6'),'message':_0x33dfd6},client9002);return _0x33dfd6;})[_0x8eff('0x21')](respondWithResult(_0x16367d,null))[_0x8eff('0x2c')](handleError(_0x16367d,null));};exports[_0x8eff('0xa7')]=function(_0x41b934,_0x137ebd){var _0x36f1f4=_0x41b934[_0x8eff('0x5b')]['id'];var _0x547502=_0x41b934['body'];var _0x4ad88c=0xc8;var _0x2b89c1=null;return db[_0x8eff('0xa8')][_0x8eff('0xa9')]({'isolationLevel':db[_0x8eff('0xa8')]['Transaction'][_0x8eff('0xaa')][_0x8eff('0xab')]},function(_0x23790f){return db[_0x8eff('0x3f')][_0x8eff('0x6e')]({'where':{'id':_0x36f1f4},'transaction':_0x23790f})[_0x8eff('0x21')](function(_0xbf2647){if(_0xbf2647){return db['OpenchannelApplication'][_0x8eff('0x68')]({'where':{'OpenchannelAccountId':_0x36f1f4},'transaction':_0x23790f})[_0x8eff('0x21')](function(){var _0x43d33a=_[_0x8eff('0x3e')](_0x547502,function(_0x22fd2d){_0x22fd2d[_0x8eff('0x6b')]=_0x36f1f4;return _0x22fd2d;});return db[_0x8eff('0x84')]['bulkCreate'](_0x43d33a,{'transaction':_0x23790f});});}else{_0x4ad88c=0x194;_0x2b89c1=[];}});})[_0x8eff('0x21')](function(){if(_0x4ad88c!==0x194){return db['OpenchannelApplication'][_0x8eff('0xac')]({'where':{'OpenchannelAccountId':_0x36f1f4},'order':_0x8eff('0x8a')})['then'](function(_0x305413){_0x2b89c1=_0x305413;});}})['catch'](function(_0x13f4ad){_0x4ad88c=0x1f4;logger[_0x8eff('0x28')](_0x13f4ad[_0x8eff('0xad')]);if(_0x13f4ad[_0x8eff('0x3a')]){delete _0x13f4ad['name'];}_0x2b89c1=_0x13f4ad;})[_0x8eff('0xae')](function(){if(_0x2b89c1===null){_0x137ebd[_0x8eff('0x2d')](_0x4ad88c);}else{if(_0x4ad88c===0x1f4){_0x137ebd['status'](_0x4ad88c)[_0x8eff('0x3b')](_0x2b89c1);}else{_0x137ebd[_0x8eff('0x2f')](_0x4ad88c)[_0x8eff('0x30')](_0x2b89c1);}}});};exports['getApplications']=function(_0x49045e,_0x1eb977,_0x2e6b8e){var _0x50d7d3={};var _0x504138={};var _0x3d6e57;var _0x7a7432;return db[_0x8eff('0x3f')]['findOne']({'where':{'id':_0x49045e[_0x8eff('0x5b')]['id']}})[_0x8eff('0x21')](handleEntityNotFound(_0x1eb977,null))[_0x8eff('0x21')](function(_0x1cc384){if(_0x1cc384){_0x3d6e57=_0x1cc384;_0x504138[_0x8eff('0x43')]=_['keys'](db[_0x8eff('0x84')][_0x8eff('0x40')]);_0x504138[_0x8eff('0x44')]=_['keys'](_0x49045e[_0x8eff('0x44')]);_0x504138[_0x8eff('0x46')]=_[_0x8eff('0x47')](_0x504138[_0x8eff('0x43')],_0x504138[_0x8eff('0x44')]);_0x50d7d3[_0x8eff('0x48')]=_[_0x8eff('0x47')](_0x504138['model'],qs[_0x8eff('0x49')](_0x49045e['query'][_0x8eff('0x49')]));_0x50d7d3[_0x8eff('0x48')]=_0x50d7d3[_0x8eff('0x48')][_0x8eff('0x4a')]?_0x50d7d3[_0x8eff('0x48')]:_0x504138[_0x8eff('0x43')];_0x50d7d3[_0x8eff('0x4d')]=qs[_0x8eff('0x4e')](_0x49045e[_0x8eff('0x44')][_0x8eff('0x4e')]);_0x50d7d3[_0x8eff('0x4f')]=qs[_0x8eff('0x46')](_[_0x8eff('0x50')](_0x49045e[_0x8eff('0x44')],_0x504138[_0x8eff('0x46')]));if(_0x49045e[_0x8eff('0x44')]['filter']){_0x50d7d3[_0x8eff('0x4f')]=_[_0x8eff('0x54')](_0x50d7d3['where'],{'$or':_[_0x8eff('0x3e')](_0x50d7d3['attributes'],function(_0x27da0a){var _0x4cd219={};_0x4cd219[_0x27da0a]={'$like':'%'+_0x49045e[_0x8eff('0x44')][_0x8eff('0x53')]+'%'};return _0x4cd219;})});}_0x50d7d3=_['merge']({},_0x50d7d3,_0x49045e[_0x8eff('0x55')]);return _0x3d6e57['getApplications'](_0x50d7d3);}})[_0x8eff('0x21')](function(_0x4245ca){if(_0x4245ca){_0x7a7432=_0x4245ca[_0x8eff('0x4a')];if(!_0x49045e[_0x8eff('0x44')][_0x8eff('0x4b')](_0x8eff('0x4c'))){_0x50d7d3[_0x8eff('0x32')]=qs[_0x8eff('0x32')](_0x49045e[_0x8eff('0x44')][_0x8eff('0x32')]);_0x50d7d3[_0x8eff('0x31')]=qs['offset'](_0x49045e[_0x8eff('0x44')]['offset']);}return _0x3d6e57['getApplications'](_0x50d7d3);}})['then'](function(_0x23b120){if(_0x23b120){return _0x23b120?{'count':_0x7a7432,'rows':_0x23b120}:null;}})[_0x8eff('0x21')](respondWithResult(_0x1eb977,null))[_0x8eff('0x2c')](handleError(_0x1eb977,null));};exports[_0x8eff('0xaf')]=function(_0x170413,_0x18cce9,_0x32aaaa){var _0x5a897d={'raw':![],'where':{}};var _0x571ffb={};var _0x52fc16={'count':0x0,'rows':[]};return db[_0x8eff('0x3f')][_0x8eff('0x6e')]({'where':{'id':_0x170413[_0x8eff('0x5b')]['id']}})[_0x8eff('0x21')](handleEntityNotFound(_0x18cce9,null))['then'](function(_0x2486e9){if(_0x2486e9){_0x571ffb[_0x8eff('0x43')]=_[_0x8eff('0x45')](db[_0x8eff('0xb0')]['rawAttributes']);_0x571ffb[_0x8eff('0x44')]=_['keys'](_0x170413[_0x8eff('0x44')]);_0x571ffb[_0x8eff('0x46')]=_[_0x8eff('0x47')](_0x571ffb[_0x8eff('0x43')],_0x571ffb['query']);_0x5a897d[_0x8eff('0x48')]=_[_0x8eff('0x47')](_0x571ffb[_0x8eff('0x43')],qs[_0x8eff('0x49')](_0x170413['query'][_0x8eff('0x49')]));_0x5a897d[_0x8eff('0x48')]=_0x5a897d['attributes'][_0x8eff('0x4a')]?_0x5a897d[_0x8eff('0x48')]:_0x571ffb['model'];if(!_0x170413[_0x8eff('0x44')][_0x8eff('0x4b')](_0x8eff('0x4c'))){_0x5a897d[_0x8eff('0x32')]=qs[_0x8eff('0x32')](_0x170413[_0x8eff('0x44')][_0x8eff('0x32')]);_0x5a897d[_0x8eff('0x31')]=qs[_0x8eff('0x31')](_0x170413['query'][_0x8eff('0x31')]);}_0x5a897d[_0x8eff('0x4d')]=qs['sort'](_0x170413[_0x8eff('0x44')][_0x8eff('0x4e')]);_0x5a897d['where']=qs[_0x8eff('0x46')](_[_0x8eff('0x50')](_0x170413[_0x8eff('0x44')],_0x571ffb[_0x8eff('0x46')]));_0x5a897d[_0x8eff('0x4f')][_0x8eff('0x6b')]=_0x2486e9['id'];if(_0x170413[_0x8eff('0x44')][_0x8eff('0x53')]){_0x5a897d[_0x8eff('0x4f')]=_[_0x8eff('0x54')](_0x5a897d['where'],{'$or':_['map'](_0x5a897d[_0x8eff('0x48')],function(_0x5c3b98){var _0x44e1eb={};_0x44e1eb[_0x5c3b98]={'$like':'%'+_0x170413['query'][_0x8eff('0x53')]+'%'};return _0x44e1eb;})});}_0x5a897d=_['merge']({},_0x5a897d,_0x170413[_0x8eff('0x55')]);return db[_0x8eff('0xb0')][_0x8eff('0x34')]({'where':_0x5a897d['where']})['then'](function(_0x1d5567){_0x52fc16[_0x8eff('0x34')]=_0x1d5567;if(_0x170413['query'][_0x8eff('0x56')]){_0x5a897d[_0x8eff('0x57')]=[{'model':db[_0x8eff('0x73')],'as':_0x8eff('0xb1'),'required':![]},{'model':db[_0x8eff('0x9c')],'as':_0x8eff('0xb2'),'attributes':[_0x8eff('0x3a'),'fullname',_0x8eff('0xb3')],'required':![]},{'model':db['Tag'],'as':'Tags','attributes':['id',_0x8eff('0x3a'),'color'],'where':_0x170413[_0x8eff('0x44')][_0x8eff('0xb4')]?{'id':_0x170413[_0x8eff('0x44')]['tag']}:undefined,'required':_0x170413[_0x8eff('0x44')][_0x8eff('0xb4')]?!![]:![]}];}return db[_0x8eff('0xb0')][_0x8eff('0x58')](_0x5a897d);})['then'](function(_0x2b9ab8){_0x52fc16[_0x8eff('0x59')]=_0x2b9ab8;return _0x52fc16;});}})[_0x8eff('0x21')](respondWithFilteredResult(_0x18cce9,_0x5a897d))[_0x8eff('0x2c')](handleError(_0x18cce9,null));};exports[_0x8eff('0xb5')]=function(_0x5e2c3e,_0x5c485f,_0x81bba8){return db[_0x8eff('0x3f')][_0x8eff('0x5d')]({'where':{'id':_0x5e2c3e[_0x8eff('0x5b')]['id']}})[_0x8eff('0x21')](handleEntityNotFound(_0x5c485f,null))[_0x8eff('0x21')](function(_0x12c673){if(_0x12c673){return _0x12c673['addAgents'](_0x5e2c3e[_0x8eff('0x67')][_0x8eff('0x70')],_[_0x8eff('0xb6')](_0x5e2c3e[_0x8eff('0x67')],[_0x8eff('0x70'),'id'])||{})[_0x8eff('0x91')](function(_0x336db9){for(var _0x53d460=0x0;_0x53d460<_0x5e2c3e[_0x8eff('0x67')][_0x8eff('0x70')][_0x8eff('0x4a')];_0x53d460+=0x1){socket[_0x8eff('0xb7')](_0x8eff('0xb8'),{'UserId':Number(_0x5e2c3e[_0x8eff('0x67')][_0x8eff('0x70')][_0x53d460]),'OpenchannelAccountId':Number(_0x5e2c3e['params']['id'])});}return _0x336db9;});}})[_0x8eff('0x21')](respondWithResult(_0x5c485f,null))['catch'](handleError(_0x5c485f,null));};exports['removeAgents']=function(_0x1502d2,_0x35d931,_0x43f820){return db['OpenchannelAccount']['find']({'where':{'id':_0x1502d2['params']['id']}})[_0x8eff('0x21')](handleEntityNotFound(_0x35d931,null))[_0x8eff('0x21')](function(_0x42165b){if(_0x42165b){return _0x42165b[_0x8eff('0xb9')](_0x1502d2[_0x8eff('0x44')][_0x8eff('0x70')])[_0x8eff('0x21')](function(){if(_[_0x8eff('0xba')](_0x1502d2['query'][_0x8eff('0x70')])){for(var _0x2daf41=0x0;_0x2daf41<_0x1502d2[_0x8eff('0x44')][_0x8eff('0x70')][_0x8eff('0x4a')];_0x2daf41+=0x1){socket[_0x8eff('0xb7')](_0x8eff('0xbb'),{'UserId':Number(_0x1502d2['query'][_0x8eff('0x70')][_0x2daf41]),'OpenchannelAccountId':Number(_0x1502d2[_0x8eff('0x5b')]['id'])});}}else{socket[_0x8eff('0xb7')](_0x8eff('0xbb'),{'UserId':Number(_0x1502d2[_0x8eff('0x44')][_0x8eff('0x70')]),'OpenchannelAccountId':Number(_0x1502d2['params']['id'])});}});}})['then'](respondWithStatusCode(_0x35d931,null))['catch'](handleError(_0x35d931,null));};exports[_0x8eff('0xbc')]=function(_0x4e861c,_0x11c736,_0x111cc0){var _0x4c1ea5={};var _0x57b56a={};var _0x52ef48;var _0x418c9e;return db[_0x8eff('0x3f')][_0x8eff('0x6e')]({'where':{'id':_0x4e861c[_0x8eff('0x5b')]['id']}})[_0x8eff('0x21')](handleEntityNotFound(_0x11c736,null))[_0x8eff('0x21')](function(_0x2ed550){if(_0x2ed550){_0x52ef48=_0x2ed550;_0x57b56a['model']=_[_0x8eff('0x45')](db[_0x8eff('0x9c')][_0x8eff('0x40')]);_0x57b56a[_0x8eff('0x44')]=_[_0x8eff('0x45')](_0x4e861c[_0x8eff('0x44')]);_0x57b56a[_0x8eff('0x46')]=_[_0x8eff('0x47')](_0x57b56a[_0x8eff('0x43')],_0x57b56a[_0x8eff('0x44')]);_0x4c1ea5[_0x8eff('0x48')]=_[_0x8eff('0x47')](_0x57b56a[_0x8eff('0x43')],qs[_0x8eff('0x49')](_0x4e861c[_0x8eff('0x44')][_0x8eff('0x49')]));_0x4c1ea5[_0x8eff('0x48')]=_0x4c1ea5['attributes'][_0x8eff('0x4a')]?_0x4c1ea5[_0x8eff('0x48')]:_0x57b56a[_0x8eff('0x43')];_0x4c1ea5['order']=qs['sort'](_0x4e861c[_0x8eff('0x44')][_0x8eff('0x4e')]);_0x4c1ea5['where']=qs[_0x8eff('0x46')](_[_0x8eff('0x50')](_0x4e861c[_0x8eff('0x44')],_0x57b56a[_0x8eff('0x46')]));if(_0x4e861c[_0x8eff('0x44')][_0x8eff('0x53')]){_0x4c1ea5[_0x8eff('0x4f')]=_['merge'](_0x4c1ea5['where'],{'$or':_[_0x8eff('0x3e')](_0x4c1ea5[_0x8eff('0x48')],function(_0x17767c){var _0x29419b={};_0x29419b[_0x17767c]={'$like':'%'+_0x4e861c['query'][_0x8eff('0x53')]+'%'};return _0x29419b;})});}_0x4c1ea5=_['merge']({},_0x4c1ea5,_0x4e861c[_0x8eff('0x55')]);return _0x52ef48['getAgents'](_0x4c1ea5);}})[_0x8eff('0x21')](function(_0x5d1e09){if(_0x5d1e09){_0x418c9e=_0x5d1e09[_0x8eff('0x4a')];if(!_0x4e861c[_0x8eff('0x44')]['hasOwnProperty'](_0x8eff('0x4c'))){_0x4c1ea5[_0x8eff('0x32')]=qs[_0x8eff('0x32')](_0x4e861c[_0x8eff('0x44')][_0x8eff('0x32')]);_0x4c1ea5[_0x8eff('0x31')]=qs[_0x8eff('0x31')](_0x4e861c[_0x8eff('0x44')][_0x8eff('0x31')]);}return _0x52ef48['getAgents'](_0x4c1ea5);}})[_0x8eff('0x21')](function(_0x558339){if(_0x558339){return _0x558339?{'count':_0x418c9e,'rows':_0x558339}:null;}})[_0x8eff('0x21')](respondWithResult(_0x11c736,null))[_0x8eff('0x2c')](handleError(_0x11c736,null));};exports['send']=function(_0x3b93c8,_0x498f75,_0x44f409){var _0x9664f9,_0x36cef3,_0x337215;if(_[_0x8eff('0x7d')](_0x3b93c8['body']['body'])||_0x3b93c8[_0x8eff('0x67')]['body']===''){throw new db['Sequelize'][(_0x8eff('0x7c'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x8eff('0x7d')](_0x3b93c8[_0x8eff('0x67')]['to'])){}_0x9664f9=_0x3b93c8['body']['to'];return db[_0x8eff('0x3f')][_0x8eff('0x6e')]({'where':{'id':_0x3b93c8[_0x8eff('0x5b')]['id']}})['then'](handleEntityNotFound(_0x498f75,null))[_0x8eff('0x21')](function(_0x52f73f){if(_0x52f73f){return db[_0x8eff('0x3f')][_0x8eff('0x5d')]({'where':{'id':_0x52f73f['id']},'include':[{'model':db['CmList'],'as':_0x8eff('0x82'),'include':[{'model':db[_0x8eff('0x73')],'as':_0x8eff('0x83'),'where':{[_0x52f73f['mapKey']]:_0x9664f9},'limit':0x1,'order':[[_0x8eff('0x77'),'DESC']]}]}]})[_0x8eff('0x21')](handleEntityNotFound(_0x498f75,null))[_0x8eff('0x21')](function(_0x395581){if(_0x395581&&_0x395581[_0x8eff('0x82')]){_0x36cef3=_0x395581[_0x8eff('0x37')]({'plain':!![]});if(_0x36cef3[_0x8eff('0x82')]&&_0x36cef3['List'][_0x8eff('0x83')]['length']){return _0x36cef3[_0x8eff('0x82')][_0x8eff('0x83')][0x0];}return db[_0x8eff('0x73')][_0x8eff('0x5e')](_[_0x8eff('0x18')](_0x3b93c8[_0x8eff('0x67')],{'firstName':_0x9664f9,[_0x395581[_0x8eff('0x7e')]]:_0x9664f9,'phone':_0x9664f9,'ListId':_0x36cef3[_0x8eff('0x7a')]}));}})[_0x8eff('0x21')](handleEntityNotFound(_0x498f75,null))['then'](function(_0x31d103){if(_0x31d103){_0x337215=_0x31d103;return db['OpenchannelInteraction'][_0x8eff('0x5d')]({'where':{'ContactId':_0x337215['id'],'closed':![],'OpenchannelAccountId':_0x36cef3['id']}})['then'](function(_0x336241){if(_0x336241){return[_0x336241,![]];}return db['OpenchannelInteraction'][_0x8eff('0x5e')]({'UserId':_0x3b93c8[_0x8eff('0x5f')]['id'],'ContactId':_0x337215['id'],'OpenchannelAccountId':_0x36cef3['id'],'lastMsgDirection':_0x8eff('0xbd'),'firstMsgDirection':_0x8eff('0xbd'),'Messages':[_[_0x8eff('0x54')](_0x3b93c8[_0x8eff('0x67')],{'read':![],'body':_0x3b93c8['body'][_0x8eff('0x67')],'OpenchannelAccountId':_0x36cef3['id'],'UserId':_0x3b93c8['user']['id'],'ContactId':_0x337215['id']})]},{'include':[{'model':db[_0x8eff('0x9a')],'as':_0x8eff('0xbe')}]})['then'](function(_0x158ffe){return[_0x158ffe,!![]];});});}})[_0x8eff('0x91')](function(_0x3d6d8b,_0x4841ad){if(_0x4841ad){return _0x3d6d8b;}return db[_0x8eff('0x9a')][_0x8eff('0x5e')](_[_0x8eff('0x54')](_0x3b93c8[_0x8eff('0x67')],{'read':![],'body':_0x3b93c8[_0x8eff('0x67')][_0x8eff('0x67')],'OpenchannelAccountId':_0x36cef3['id'],'OpenchannelInteractionId':_0x3d6d8b['id'],'UserId':_0x3b93c8['user']['id'],'ContactId':_0x337215['id']}))[_0x8eff('0x21')](function(_0x99f3dd){_0x3d6d8b[_0x8eff('0xbf')][_0x8eff('0xbe')]=[];_0x3d6d8b[_0x8eff('0xbf')][_0x8eff('0xbe')]['push'](_0x99f3dd[_0x8eff('0xbf')]);return _0x3d6d8b;});});}})[_0x8eff('0x21')](respondWithResult(_0x498f75,null))[_0x8eff('0x2c')](handleError(_0x498f75,null));}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.events.js b/server/api/openchannelAccount/openchannelAccount.events.js index ddf9b13..440d7cb 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 _0xaa88=['../../mysqldb','OpenchannelAccount','setMaxListeners','update','remove','hasOwnProperty','exports','events'];(function(_0x157634,_0x2b2b9c){var _0x298559=function(_0x14f119){while(--_0x14f119){_0x157634['push'](_0x157634['shift']());}};_0x298559(++_0x2b2b9c);}(_0xaa88,0x137));var _0x8aa8=function(_0x51d71a,_0x596fda){_0x51d71a=_0x51d71a-0x0;var _0xff01f1=_0xaa88[_0x51d71a];return _0xff01f1;};'use strict';var EventEmitter=require(_0x8aa8('0x0'));var OpenchannelAccount=require(_0x8aa8('0x1'))['db'][_0x8aa8('0x2')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0x8aa8('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x8aa8('0x4'),'afterDestroy':_0x8aa8('0x5')};function emitEvent(_0x43f7e4){return function(_0x3b2c88,_0x3e3b70,_0x350e8b){OpenchannelAccountEvents['emit'](_0x43f7e4+':'+_0x3b2c88['id'],_0x3b2c88);OpenchannelAccountEvents['emit'](_0x43f7e4,_0x3b2c88);_0x350e8b(null);};}for(var e in events){if(events[_0x8aa8('0x6')](e)){var event=events[e];OpenchannelAccount['hook'](e,emitEvent(event));}}module[_0x8aa8('0x7')]=OpenchannelAccountEvents; \ No newline at end of file +var _0x4522=['OpenchannelAccount','setMaxListeners','save','remove','emit','hasOwnProperty','hook','exports'];(function(_0x4ac946,_0x30a3df){var _0x4cd743=function(_0x433dfd){while(--_0x433dfd){_0x4ac946['push'](_0x4ac946['shift']());}};_0x4cd743(++_0x30a3df);}(_0x4522,0x1a0));var _0x2452=function(_0x36c438,_0x3af9cb){_0x36c438=_0x36c438-0x0;var _0x1883a6=_0x4522[_0x36c438];return _0x1883a6;};'use strict';var EventEmitter=require('events');var OpenchannelAccount=require('../../mysqldb')['db'][_0x2452('0x0')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0x2452('0x1')](0x0);var events={'afterCreate':_0x2452('0x2'),'afterUpdate':'update','afterDestroy':_0x2452('0x3')};function emitEvent(_0x1fdf5b){return function(_0x35e30a,_0x2f21dc,_0x34ff44){OpenchannelAccountEvents[_0x2452('0x4')](_0x1fdf5b+':'+_0x35e30a['id'],_0x35e30a);OpenchannelAccountEvents[_0x2452('0x4')](_0x1fdf5b,_0x35e30a);_0x34ff44(null);};}for(var e in events){if(events[_0x2452('0x5')](e)){var event=events[e];OpenchannelAccount[_0x2452('0x6')](e,emitEvent(event));}}module[_0x2452('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 abc9446..0fd12a0 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(_0x4dffba,_0x3df8ea){var _0x5c81e1=function(_0x19b5f3){while(--_0x19b5f3){_0x4dffba['push'](_0x4dffba['shift']());}};_0x5c81e1(++_0x3df8ea);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3054be,_0x1bdc8b){_0x3054be=_0x3054be-0x0;var _0x3df150=_0xa9e0[_0x3054be];return _0x3df150;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var 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(_0x2ede82,_0x2d5627){var _0x309136=function(_0x17b0fb){while(--_0x17b0fb){_0x2ede82['push'](_0x2ede82['shift']());}};_0x309136(++_0x2d5627);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4bfac3,_0x58324d){_0x4bfac3=_0x4bfac3-0x0;var _0x15f0f2=_0xa9e0[_0x4bfac3];return _0x15f0f2;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var 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 595246d..83253c8 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 _0xda3f=['OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','util','moment','../../mysqldb','../../config/logger','rpc','jayson/promise','client','defaults','redis','localhost','socket.io-emitter','./openchannelAccount.socket','register','then','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent'];(function(_0x476bf4,_0x2a3755){var _0x788ffe=function(_0x13fa11){while(--_0x13fa11){_0x476bf4['push'](_0x476bf4['shift']());}};_0x788ffe(++_0x2a3755);}(_0xda3f,0xec));var _0xfda3=function(_0x47cc1c,_0x5b826b){_0x47cc1c=_0x47cc1c-0x0;var _0x170bd8=_0xda3f[_0x47cc1c];return _0x170bd8;};'use strict';var _=require('lodash');var util=require(_0xfda3('0x0'));var moment=require(_0xfda3('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfda3('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0xfda3('0x3'))(_0xfda3('0x4'));var config=require('../../config/environment');var jayson=require(_0xfda3('0x5'));var client=jayson[_0xfda3('0x6')]['http']({'port':0x232a});config['redis']=_[_0xfda3('0x7')](config[_0xfda3('0x8')],{'host':_0xfda3('0x9'),'port':0x18eb});var socket=require(_0xfda3('0xa'))(new Redis(config[_0xfda3('0x8')]));require(_0xfda3('0xb'))[_0xfda3('0xc')](socket);function respondWithRpcPromise(_0x1b1ea6,_0xdc5b45,_0x14d549){return new BPromise(function(_0x102643,_0x4713ba){return client['request'](_0x1b1ea6,_0x14d549)[_0xfda3('0xd')](function(_0x14936b){logger[_0xfda3('0xe')](_0xfda3('0xf'),_0xdc5b45,_0xfda3('0x10'));logger['debug'](_0xfda3('0x11'),_0xdc5b45,'request\x20sent',JSON[_0xfda3('0x12')](_0x14936b));if(_0x14936b[_0xfda3('0x13')]){if(_0x14936b['error']['code']===0x1f4){logger['error'](_0xfda3('0xf'),_0xdc5b45,_0x14936b[_0xfda3('0x13')]['message']);return _0x4713ba(_0x14936b['error']['message']);}logger[_0xfda3('0x13')](_0xfda3('0xf'),_0xdc5b45,_0x14936b[_0xfda3('0x13')][_0xfda3('0x14')]);return _0x102643(_0x14936b[_0xfda3('0x13')][_0xfda3('0x14')]);}else{logger[_0xfda3('0xe')](_0xfda3('0xf'),_0xdc5b45,_0xfda3('0x10'));_0x102643(_0x14936b[_0xfda3('0x15')]['message']);}})[_0xfda3('0x16')](function(_0x1bbdda){logger[_0xfda3('0x13')](_0xfda3('0xf'),_0xdc5b45,_0x1bbdda);_0x4713ba(_0x1bbdda);});});} \ No newline at end of file +var _0x7980=['OpenchannelAccount,\x20%s,\x20%s','OpenchannelAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','redis','defaults','./openchannelAccount.socket','register','request','then','info'];(function(_0x36847c,_0x33921b){var _0x36ba6d=function(_0x4541b9){while(--_0x4541b9){_0x36847c['push'](_0x36847c['shift']());}};_0x36ba6d(++_0x33921b);}(_0x7980,0xab));var _0x0798=function(_0xc753fe,_0x21130b){_0xc753fe=_0xc753fe-0x0;var _0x2c633a=_0x7980[_0xc753fe];return _0x2c633a;};'use strict';var _=require(_0x0798('0x0'));var util=require(_0x0798('0x1'));var moment=require(_0x0798('0x2'));var BPromise=require(_0x0798('0x3'));var rs=require(_0x0798('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0798('0x5'))['db'];var utils=require(_0x0798('0x6'));var logger=require(_0x0798('0x7'))(_0x0798('0x8'));var config=require(_0x0798('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x0798('0xa')]['http']({'port':0x232a});config[_0x0798('0xb')]=_[_0x0798('0xc')](config[_0x0798('0xb')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0798('0xb')]));require(_0x0798('0xd'))[_0x0798('0xe')](socket);function respondWithRpcPromise(_0x1601f2,_0x53e9a1,_0x181c33){return new BPromise(function(_0x44e8df,_0xc9b741){return client[_0x0798('0xf')](_0x1601f2,_0x181c33)[_0x0798('0x10')](function(_0x597e45){logger[_0x0798('0x11')](_0x0798('0x12'),_0x53e9a1,'request\x20sent');logger['debug'](_0x0798('0x13'),_0x53e9a1,_0x0798('0x14'),JSON[_0x0798('0x15')](_0x597e45));if(_0x597e45[_0x0798('0x16')]){if(_0x597e45[_0x0798('0x16')][_0x0798('0x17')]===0x1f4){logger[_0x0798('0x16')]('OpenchannelAccount,\x20%s,\x20%s',_0x53e9a1,_0x597e45['error'][_0x0798('0x18')]);return _0xc9b741(_0x597e45[_0x0798('0x16')]['message']);}logger['error'](_0x0798('0x12'),_0x53e9a1,_0x597e45[_0x0798('0x16')][_0x0798('0x18')]);return _0x44e8df(_0x597e45['error']['message']);}else{logger[_0x0798('0x11')]('OpenchannelAccount,\x20%s,\x20%s',_0x53e9a1,_0x0798('0x14'));_0x44e8df(_0x597e45[_0x0798('0x19')][_0x0798('0x18')]);}})[_0x0798('0x1a')](function(_0x4d1545){logger[_0x0798('0x16')](_0x0798('0x12'),_0x53e9a1,_0x4d1545);_0xc9b741(_0x4d1545);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.socket.js b/server/api/openchannelAccount/openchannelAccount.socket.js index e7dc2f1..acf6fa3 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 _0x3b75=['removeListener','register','openchannelAccount:','./openchannelAccount.events','save','remove','update'];(function(_0x26d016,_0x14d83d){var _0x14bdbb=function(_0x80f52e){while(--_0x80f52e){_0x26d016['push'](_0x26d016['shift']());}};_0x14bdbb(++_0x14d83d);}(_0x3b75,0xdc));var _0x53b7=function(_0x351509,_0x54725c){_0x351509=_0x351509-0x0;var _0x4e9861=_0x3b75[_0x351509];return _0x4e9861;};'use strict';var OpenchannelAccountEvents=require(_0x53b7('0x0'));var events=[_0x53b7('0x1'),_0x53b7('0x2'),_0x53b7('0x3')];function createListener(_0x2eaf0c,_0x5dc9c7){return function(_0x2702db){_0x5dc9c7['emit'](_0x2eaf0c,_0x2702db);};}function removeListener(_0xa7b997,_0x4c9b8f){return function(){OpenchannelAccountEvents[_0x53b7('0x4')](_0xa7b997,_0x4c9b8f);};}exports[_0x53b7('0x5')]=function(_0x331d88){for(var _0x287704=0x0,_0x7e5139=events['length'];_0x287704<_0x7e5139;_0x287704++){var _0x1f89b7=events[_0x287704];var _0x233482=createListener(_0x53b7('0x6')+_0x1f89b7,_0x331d88);OpenchannelAccountEvents['on'](_0x1f89b7,_0x233482);}}; \ No newline at end of file +var _0x4711=['register','openchannelAccount:','./openchannelAccount.events','save','remove','update','removeListener'];(function(_0xef4cf0,_0x16c9c3){var _0x497ad2=function(_0xce63d4){while(--_0xce63d4){_0xef4cf0['push'](_0xef4cf0['shift']());}};_0x497ad2(++_0x16c9c3);}(_0x4711,0x10c));var _0x1471=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4711[_0x3dd15e];return _0x231fd0;};'use strict';var OpenchannelAccountEvents=require(_0x1471('0x0'));var events=[_0x1471('0x1'),_0x1471('0x2'),_0x1471('0x3')];function createListener(_0x1a8977,_0x462a25){return function(_0x38a12b){_0x462a25['emit'](_0x1a8977,_0x38a12b);};}function removeListener(_0x39bce4,_0x517e03){return function(){OpenchannelAccountEvents[_0x1471('0x4')](_0x39bce4,_0x517e03);};}exports[_0x1471('0x5')]=function(_0x1ec524){for(var _0x40d4f3=0x0,_0x1be347=events['length'];_0x40d4f3<_0x1be347;_0x40d4f3++){var _0x1cf7db=events[_0x40d4f3];var _0x853506=createListener(_0x1471('0x6')+_0x1cf7db,_0x1ec524);OpenchannelAccountEvents['on'](_0x1cf7db,_0x853506);}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/index.js b/server/api/openchannelApplication/index.js index a5bc3b3..ded26f1 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 _0x1230=['post','create','put','update','delete','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./openchannelApplication.controller','get','isAuthenticated','index','/:id','show'];(function(_0xe2c55,_0x2f9b77){var _0x2a4f82=function(_0x58654b){while(--_0x58654b){_0xe2c55['push'](_0xe2c55['shift']());}};_0x2a4f82(++_0x2f9b77);}(_0x1230,0x1a8));var _0x0123=function(_0x565bc1,_0x4cdbc0){_0x565bc1=_0x565bc1-0x0;var _0x33d5ba=_0x1230[_0x565bc1];return _0x33d5ba;};'use strict';var multer=require(_0x0123('0x0'));var util=require(_0x0123('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x0123('0x2'));var router=express[_0x0123('0x3')]();var fs_extra=require(_0x0123('0x4'));var auth=require(_0x0123('0x5'));var interaction=require(_0x0123('0x6'));var config=require('../../config/environment');var controller=require(_0x0123('0x7'));router[_0x0123('0x8')]('/',auth[_0x0123('0x9')](),controller[_0x0123('0xa')]);router[_0x0123('0x8')](_0x0123('0xb'),auth[_0x0123('0x9')](),controller[_0x0123('0xc')]);router[_0x0123('0xd')]('/',auth[_0x0123('0x9')](),controller[_0x0123('0xe')]);router[_0x0123('0xf')]('/:id',auth[_0x0123('0x9')](),controller[_0x0123('0x10')]);router[_0x0123('0x11')]('/:id',auth[_0x0123('0x9')](),controller['destroy']);module[_0x0123('0x12')]=router; \ No newline at end of file +var _0x873d=['path','express','Router','fs-extra','../../config/environment','./openchannelApplication.controller','get','isAuthenticated','index','/:id','create','update','destroy','exports','util'];(function(_0x52dffb,_0x511c7a){var _0x5c6e94=function(_0x4ab11e){while(--_0x4ab11e){_0x52dffb['push'](_0x52dffb['shift']());}};_0x5c6e94(++_0x511c7a);}(_0x873d,0x1a3));var _0xd873=function(_0x4c12ec,_0x2e9103){_0x4c12ec=_0x4c12ec-0x0;var _0x3ae42c=_0x873d[_0x4c12ec];return _0x3ae42c;};'use strict';var multer=require('multer');var util=require(_0xd873('0x0'));var path=require(_0xd873('0x1'));var timeout=require('connect-timeout');var express=require(_0xd873('0x2'));var router=express[_0xd873('0x3')]();var fs_extra=require(_0xd873('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xd873('0x5'));var controller=require(_0xd873('0x6'));router[_0xd873('0x7')]('/',auth[_0xd873('0x8')](),controller[_0xd873('0x9')]);router[_0xd873('0x7')](_0xd873('0xa'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0xd873('0x8')](),controller[_0xd873('0xb')]);router['put'](_0xd873('0xa'),auth[_0xd873('0x8')](),controller[_0xd873('0xc')]);router['delete'](_0xd873('0xa'),auth[_0xd873('0x8')](),controller[_0xd873('0xd')]);module[_0xd873('0xe')]=router; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.attributes.js b/server/api/openchannelApplication/openchannelApplication.attributes.js index 3f00f50..9aaa2db 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 _0x1018=['exports','INTEGER','STRING','noop','TEXT','*,*,*,*','sequelize'];(function(_0x131ed1,_0x48c3a1){var _0x2421b1=function(_0x33a803){while(--_0x33a803){_0x131ed1['push'](_0x131ed1['shift']());}};_0x2421b1(++_0x48c3a1);}(_0x1018,0x148));var _0x8101=function(_0x221743,_0x3db860){_0x221743=_0x221743-0x0;var _0x73a707=_0x1018[_0x221743];return _0x73a707;};'use strict';var Sequelize=require(_0x8101('0x0'));module[_0x8101('0x1')]={'priority':{'type':Sequelize[_0x8101('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x8101('0x3')],'allowNull':![],'defaultValue':_0x8101('0x4')},'appdata':{'type':Sequelize[_0x8101('0x5')]()},'description':{'type':Sequelize[_0x8101('0x3')]},'interval':{'type':Sequelize[_0x8101('0x3')],'defaultValue':_0x8101('0x6')}}; \ No newline at end of file +var _0x2887=['exports','noop','STRING','*,*,*,*','sequelize'];(function(_0x224b05,_0x5b2dca){var _0x4ce6e4=function(_0x437c80){while(--_0x437c80){_0x224b05['push'](_0x224b05['shift']());}};_0x4ce6e4(++_0x5b2dca);}(_0x2887,0xef));var _0x7288=function(_0x364cf8,_0x146b9b){_0x364cf8=_0x364cf8-0x0;var _0x6a59ee=_0x2887[_0x364cf8];return _0x6a59ee;};'use strict';var Sequelize=require(_0x7288('0x0'));module[_0x7288('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x7288('0x2')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x7288('0x3')]},'interval':{'type':Sequelize[_0x7288('0x3')],'defaultValue':_0x7288('0x4')}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.controller.js b/server/api/openchannelApplication/openchannelApplication.controller.js index dcd479f..3875581 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 _0xbb88=['squel','crypto','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','json','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','end','error','stack','name','index','map','OpenchannelApplication','rawAttributes','fieldName','type','key','keys','query','intersection','attributes','model','length','hasOwnProperty','nolimit','offset','order','sort','where','filters','pick','filter','merge','options','includeAll','include','rows','catch','show','params','fields','find','create','body','update','eml-format','zip-dir','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','lodash'];(function(_0x4f04f3,_0xd2272e){var _0x2a8d3a=function(_0x381513){while(--_0x381513){_0x4f04f3['push'](_0x4f04f3['shift']());}};_0x2a8d3a(++_0xd2272e);}(_0xbb88,0x1bd));var _0x8bb8=function(_0xa19a26,_0x5d6683){_0xa19a26=_0xa19a26-0x0;var _0x4ed874=_0xbb88[_0xa19a26];return _0x4ed874;};'use strict';var emlformat=require(_0x8bb8('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8bb8('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8bb8('0x2'));var moment=require(_0x8bb8('0x3'));var BPromise=require(_0x8bb8('0x4'));var Mustache=require('mustache');var util=require(_0x8bb8('0x5'));var path=require(_0x8bb8('0x6'));var sox=require(_0x8bb8('0x7'));var csv=require('to-csv');var ejs=require(_0x8bb8('0x8'));var fs=require('fs');var fs_extra=require(_0x8bb8('0x9'));var _=require(_0x8bb8('0xa'));var squel=require(_0x8bb8('0xb'));var crypto=require(_0x8bb8('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x8bb8('0xd'));var querystring=require(_0x8bb8('0xe'));var Papa=require(_0x8bb8('0xf'));var Redis=require(_0x8bb8('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x8bb8('0x11'));var as=require(_0x8bb8('0x12'));var hardwareService=require(_0x8bb8('0x13'));var logger=require(_0x8bb8('0x14'))(_0x8bb8('0x15'));var utils=require('../../config/utils');var config=require(_0x8bb8('0x16'));var licenseUtil=require(_0x8bb8('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3eccf7,_0x54c305){_0x54c305=_0x54c305||0xcc;return function(_0x4f3d1c){if(_0x4f3d1c){return _0x3eccf7[_0x8bb8('0x18')](_0x54c305);}return _0x3eccf7[_0x8bb8('0x19')](_0x54c305)['end']();};}function respondWithResult(_0xed4841,_0x5274b3){_0x5274b3=_0x5274b3||0xc8;return function(_0x33a219){if(_0x33a219){return _0xed4841[_0x8bb8('0x19')](_0x5274b3)[_0x8bb8('0x1a')](_0x33a219);}};}function respondWithFilteredResult(_0x521b0a,_0x25067d){return function(_0x5949a4){if(_0x5949a4){var _0x617266=typeof _0x25067d['offset']===_0x8bb8('0x1b')&&typeof _0x25067d[_0x8bb8('0x1c')]==='undefined';var _0x429736=_0x5949a4['count'];var _0x3bdd68=_0x617266?0x0:_0x25067d['offset'];var _0x25c782=_0x617266?_0x5949a4[_0x8bb8('0x1d')]:_0x25067d['offset']+_0x25067d[_0x8bb8('0x1c')];var _0x2218df;if(_0x25c782>=_0x429736){_0x25c782=_0x429736;_0x2218df=0xc8;}else{_0x2218df=0xce;}_0x521b0a[_0x8bb8('0x19')](_0x2218df);return _0x521b0a[_0x8bb8('0x1e')](_0x8bb8('0x1f'),_0x3bdd68+'-'+_0x25c782+'/'+_0x429736)[_0x8bb8('0x1a')](_0x5949a4);}return null;};}function patchUpdates(_0x498f66){return function(_0x498236){try{jsonpatch[_0x8bb8('0x20')](_0x498236,_0x498f66,!![]);}catch(_0x5d3d38){return BPromise[_0x8bb8('0x21')](_0x5d3d38);}return _0x498236[_0x8bb8('0x22')]();};}function saveUpdates(_0x5b57c5,_0x51393b){return function(_0xb8d3f2){if(_0xb8d3f2){return _0xb8d3f2['update'](_0x5b57c5)[_0x8bb8('0x23')](function(_0x2b979d){return _0x2b979d;});}return null;};}function removeEntity(_0x5d9baa,_0x2625ef){return function(_0x3fca5a){if(_0x3fca5a){return _0x3fca5a[_0x8bb8('0x24')]()[_0x8bb8('0x23')](function(){_0x5d9baa[_0x8bb8('0x19')](0xcc)[_0x8bb8('0x25')]();});}};}function handleEntityNotFound(_0x5d51c5,_0xb29c08){return function(_0x48b911){if(!_0x48b911){_0x5d51c5[_0x8bb8('0x18')](0x194);}return _0x48b911;};}function handleError(_0x36a013,_0x5393e9){_0x5393e9=_0x5393e9||0x1f4;return function(_0x1f4da4){logger[_0x8bb8('0x26')](_0x1f4da4[_0x8bb8('0x27')]);if(_0x1f4da4[_0x8bb8('0x28')]){delete _0x1f4da4[_0x8bb8('0x28')];}_0x36a013['status'](_0x5393e9)['send'](_0x1f4da4);};}exports[_0x8bb8('0x29')]=function(_0x49b159,_0x14bd89){var _0x4bd252={},_0x16a318={},_0x276bbf={'count':0x0,'rows':[]};var _0xe0177c=_[_0x8bb8('0x2a')](db[_0x8bb8('0x2b')][_0x8bb8('0x2c')],function(_0xf8938){return{'name':_0xf8938[_0x8bb8('0x2d')],'type':_0xf8938[_0x8bb8('0x2e')][_0x8bb8('0x2f')]};});_0x16a318['model']=_[_0x8bb8('0x2a')](_0xe0177c,'name');_0x16a318['query']=_[_0x8bb8('0x30')](_0x49b159[_0x8bb8('0x31')]);_0x16a318['filters']=_[_0x8bb8('0x32')](_0x16a318['model'],_0x16a318[_0x8bb8('0x31')]);_0x4bd252[_0x8bb8('0x33')]=_[_0x8bb8('0x32')](_0x16a318[_0x8bb8('0x34')],qs['fields'](_0x49b159[_0x8bb8('0x31')]['fields']));_0x4bd252[_0x8bb8('0x33')]=_0x4bd252[_0x8bb8('0x33')][_0x8bb8('0x35')]?_0x4bd252[_0x8bb8('0x33')]:_0x16a318['model'];if(!_0x49b159[_0x8bb8('0x31')][_0x8bb8('0x36')](_0x8bb8('0x37'))){_0x4bd252['limit']=qs[_0x8bb8('0x1c')](_0x49b159[_0x8bb8('0x31')][_0x8bb8('0x1c')]);_0x4bd252[_0x8bb8('0x38')]=qs['offset'](_0x49b159[_0x8bb8('0x31')][_0x8bb8('0x38')]);}_0x4bd252[_0x8bb8('0x39')]=qs[_0x8bb8('0x3a')](_0x49b159[_0x8bb8('0x31')]['sort']);_0x4bd252[_0x8bb8('0x3b')]=qs[_0x8bb8('0x3c')](_[_0x8bb8('0x3d')](_0x49b159['query'],_0x16a318[_0x8bb8('0x3c')]),_0xe0177c);if(_0x49b159[_0x8bb8('0x31')][_0x8bb8('0x3e')]){_0x4bd252['where']=_[_0x8bb8('0x3f')](_0x4bd252['where'],{'$or':_['map'](_0xe0177c,function(_0x11726e){if(_0x11726e[_0x8bb8('0x2e')]!=='VIRTUAL'){var _0x1947ee={};_0x1947ee[_0x11726e[_0x8bb8('0x28')]]={'$like':'%'+_0x49b159[_0x8bb8('0x31')][_0x8bb8('0x3e')]+'%'};return _0x1947ee;}})});}_0x4bd252=_['merge']({},_0x4bd252,_0x49b159[_0x8bb8('0x40')]);var _0x2361e0={'where':_0x4bd252[_0x8bb8('0x3b')]};return db[_0x8bb8('0x2b')][_0x8bb8('0x1d')](_0x2361e0)['then'](function(_0x4e467d){_0x276bbf[_0x8bb8('0x1d')]=_0x4e467d;if(_0x49b159['query'][_0x8bb8('0x41')]){_0x4bd252[_0x8bb8('0x42')]=[{'all':!![]}];}return db[_0x8bb8('0x2b')]['findAll'](_0x4bd252);})[_0x8bb8('0x23')](function(_0x227fcf){_0x276bbf[_0x8bb8('0x43')]=_0x227fcf;return _0x276bbf;})[_0x8bb8('0x23')](respondWithFilteredResult(_0x14bd89,_0x4bd252))[_0x8bb8('0x44')](handleError(_0x14bd89,null));};exports[_0x8bb8('0x45')]=function(_0xbfcc6e,_0x238038){var _0x467714={'raw':!![],'where':{'id':_0xbfcc6e[_0x8bb8('0x46')]['id']}},_0x3ec261={};_0x3ec261['model']=_[_0x8bb8('0x30')](db[_0x8bb8('0x2b')][_0x8bb8('0x2c')]);_0x3ec261['query']=_[_0x8bb8('0x30')](_0xbfcc6e[_0x8bb8('0x31')]);_0x3ec261[_0x8bb8('0x3c')]=_[_0x8bb8('0x32')](_0x3ec261[_0x8bb8('0x34')],_0x3ec261[_0x8bb8('0x31')]);_0x467714[_0x8bb8('0x33')]=_[_0x8bb8('0x32')](_0x3ec261['model'],qs[_0x8bb8('0x47')](_0xbfcc6e[_0x8bb8('0x31')][_0x8bb8('0x47')]));_0x467714[_0x8bb8('0x33')]=_0x467714['attributes'][_0x8bb8('0x35')]?_0x467714[_0x8bb8('0x33')]:_0x3ec261[_0x8bb8('0x34')];if(_0xbfcc6e[_0x8bb8('0x31')][_0x8bb8('0x41')]){_0x467714[_0x8bb8('0x42')]=[{'all':!![]}];}_0x467714=_[_0x8bb8('0x3f')]({},_0x467714,_0xbfcc6e['options']);return db['OpenchannelApplication'][_0x8bb8('0x48')](_0x467714)[_0x8bb8('0x23')](handleEntityNotFound(_0x238038,null))['then'](respondWithResult(_0x238038,null))[_0x8bb8('0x44')](handleError(_0x238038,null));};exports[_0x8bb8('0x49')]=function(_0x2c7afc,_0xdd1261){return db[_0x8bb8('0x2b')][_0x8bb8('0x49')](_0x2c7afc[_0x8bb8('0x4a')],{})[_0x8bb8('0x23')](respondWithResult(_0xdd1261,0xc9))[_0x8bb8('0x44')](handleError(_0xdd1261,null));};exports[_0x8bb8('0x4b')]=function(_0x324bb6,_0x5a6720){if(_0x324bb6[_0x8bb8('0x4a')]['id']){delete _0x324bb6[_0x8bb8('0x4a')]['id'];}return db['OpenchannelApplication'][_0x8bb8('0x48')]({'where':{'id':_0x324bb6['params']['id']}})[_0x8bb8('0x23')](handleEntityNotFound(_0x5a6720,null))[_0x8bb8('0x23')](saveUpdates(_0x324bb6[_0x8bb8('0x4a')],null))['then'](respondWithResult(_0x5a6720,null))[_0x8bb8('0x44')](handleError(_0x5a6720,null));};exports[_0x8bb8('0x24')]=function(_0x14a314,_0x5b9ee0){return db['OpenchannelApplication']['find']({'where':{'id':_0x14a314[_0x8bb8('0x46')]['id']}})['then'](handleEntityNotFound(_0x5b9ee0,null))[_0x8bb8('0x23')](removeEntity(_0x5b9ee0,null))[_0x8bb8('0x44')](handleError(_0x5b9ee0,null));}; \ No newline at end of file +var _0x011f=['../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','undefined','limit','count','offset','set','save','update','then','stack','name','send','OpenchannelApplication','rawAttributes','fieldName','key','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','map','type','filter','options','includeAll','include','rows','show','params','find','body','catch','eml-format','rimraf','request-promise','bluebird','util','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis'];(function(_0x3c2c1f,_0x4d93d3){var _0x5adf10=function(_0x3702bf){while(--_0x3702bf){_0x3c2c1f['push'](_0x3c2c1f['shift']());}};_0x5adf10(++_0x4d93d3);}(_0x011f,0x77));var _0xf011=function(_0x208d75,_0x92d742){_0x208d75=_0x208d75-0x0;var _0x382d27=_0x011f[_0x208d75];return _0x382d27;};'use strict';var emlformat=require(_0xf011('0x0'));var rimraf=require(_0xf011('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xf011('0x2'));var moment=require('moment');var BPromise=require(_0xf011('0x3'));var Mustache=require('mustache');var util=require(_0xf011('0x4'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xf011('0x5'));var fs=require('fs');var fs_extra=require(_0xf011('0x6'));var _=require(_0xf011('0x7'));var squel=require(_0xf011('0x8'));var crypto=require(_0xf011('0x9'));var jsforce=require(_0xf011('0xa'));var deskjs=require('desk.js');var toCsv=require(_0xf011('0xb'));var querystring=require(_0xf011('0xc'));var Papa=require(_0xf011('0xd'));var Redis=require(_0xf011('0xe'));var authService=require(_0xf011('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xf011('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xf011('0x11'));var utils=require(_0xf011('0x12'));var config=require(_0xf011('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0xf011('0x14'))['db'];function respondWithStatusCode(_0x21617b,_0x68b65e){_0x68b65e=_0x68b65e||0xcc;return function(_0x5043ed){if(_0x5043ed){return _0x21617b[_0xf011('0x15')](_0x68b65e);}return _0x21617b['status'](_0x68b65e)[_0xf011('0x16')]();};}function respondWithResult(_0x50b9ca,_0x5121d0){_0x5121d0=_0x5121d0||0xc8;return function(_0x4b889b){if(_0x4b889b){return _0x50b9ca[_0xf011('0x17')](_0x5121d0)[_0xf011('0x18')](_0x4b889b);}};}function respondWithFilteredResult(_0xa6a043,_0x5544ab){return function(_0x5028ec){if(_0x5028ec){var _0x68a06d=typeof _0x5544ab['offset']===_0xf011('0x19')&&typeof _0x5544ab[_0xf011('0x1a')]===_0xf011('0x19');var _0x48382b=_0x5028ec[_0xf011('0x1b')];var _0x277224=_0x68a06d?0x0:_0x5544ab[_0xf011('0x1c')];var _0x5e9819=_0x68a06d?_0x5028ec[_0xf011('0x1b')]:_0x5544ab[_0xf011('0x1c')]+_0x5544ab[_0xf011('0x1a')];var _0x5477ef;if(_0x5e9819>=_0x48382b){_0x5e9819=_0x48382b;_0x5477ef=0xc8;}else{_0x5477ef=0xce;}_0xa6a043[_0xf011('0x17')](_0x5477ef);return _0xa6a043[_0xf011('0x1d')]('Content-Range',_0x277224+'-'+_0x5e9819+'/'+_0x48382b)['json'](_0x5028ec);}return null;};}function patchUpdates(_0x29733e){return function(_0x48c0b0){try{jsonpatch['apply'](_0x48c0b0,_0x29733e,!![]);}catch(_0x5e14db){return BPromise['reject'](_0x5e14db);}return _0x48c0b0[_0xf011('0x1e')]();};}function saveUpdates(_0x3ef292,_0x597911){return function(_0x3b920a){if(_0x3b920a){return _0x3b920a[_0xf011('0x1f')](_0x3ef292)[_0xf011('0x20')](function(_0x21eb82){return _0x21eb82;});}return null;};}function removeEntity(_0x40d6ff,_0x1c1187){return function(_0x445113){if(_0x445113){return _0x445113['destroy']()['then'](function(){_0x40d6ff[_0xf011('0x17')](0xcc)[_0xf011('0x16')]();});}};}function handleEntityNotFound(_0x5cd62d,_0x85e859){return function(_0x344b72){if(!_0x344b72){_0x5cd62d[_0xf011('0x15')](0x194);}return _0x344b72;};}function handleError(_0x327ce2,_0x4afea6){_0x4afea6=_0x4afea6||0x1f4;return function(_0x1ce4ed){logger['error'](_0x1ce4ed[_0xf011('0x21')]);if(_0x1ce4ed[_0xf011('0x22')]){delete _0x1ce4ed[_0xf011('0x22')];}_0x327ce2[_0xf011('0x17')](_0x4afea6)[_0xf011('0x23')](_0x1ce4ed);};}exports['index']=function(_0x5d0f0e,_0x5333b9){var _0x4299d0={},_0x4e20aa={},_0x136dc4={'count':0x0,'rows':[]};var _0x1fb5c0=_['map'](db[_0xf011('0x24')][_0xf011('0x25')],function(_0x56766f){return{'name':_0x56766f[_0xf011('0x26')],'type':_0x56766f['type'][_0xf011('0x27')]};});_0x4e20aa[_0xf011('0x28')]=_['map'](_0x1fb5c0,_0xf011('0x22'));_0x4e20aa['query']=_[_0xf011('0x29')](_0x5d0f0e[_0xf011('0x2a')]);_0x4e20aa[_0xf011('0x2b')]=_[_0xf011('0x2c')](_0x4e20aa['model'],_0x4e20aa[_0xf011('0x2a')]);_0x4299d0['attributes']=_[_0xf011('0x2c')](_0x4e20aa[_0xf011('0x28')],qs[_0xf011('0x2d')](_0x5d0f0e[_0xf011('0x2a')][_0xf011('0x2d')]));_0x4299d0[_0xf011('0x2e')]=_0x4299d0[_0xf011('0x2e')][_0xf011('0x2f')]?_0x4299d0['attributes']:_0x4e20aa[_0xf011('0x28')];if(!_0x5d0f0e[_0xf011('0x2a')][_0xf011('0x30')](_0xf011('0x31'))){_0x4299d0['limit']=qs[_0xf011('0x1a')](_0x5d0f0e['query']['limit']);_0x4299d0['offset']=qs[_0xf011('0x1c')](_0x5d0f0e['query'][_0xf011('0x1c')]);}_0x4299d0[_0xf011('0x32')]=qs[_0xf011('0x33')](_0x5d0f0e[_0xf011('0x2a')][_0xf011('0x33')]);_0x4299d0[_0xf011('0x34')]=qs['filters'](_[_0xf011('0x35')](_0x5d0f0e[_0xf011('0x2a')],_0x4e20aa[_0xf011('0x2b')]),_0x1fb5c0);if(_0x5d0f0e[_0xf011('0x2a')]['filter']){_0x4299d0[_0xf011('0x34')]=_[_0xf011('0x36')](_0x4299d0[_0xf011('0x34')],{'$or':_[_0xf011('0x37')](_0x1fb5c0,function(_0x2316df){if(_0x2316df[_0xf011('0x38')]!=='VIRTUAL'){var _0x37ea69={};_0x37ea69[_0x2316df[_0xf011('0x22')]]={'$like':'%'+_0x5d0f0e[_0xf011('0x2a')][_0xf011('0x39')]+'%'};return _0x37ea69;}})});}_0x4299d0=_[_0xf011('0x36')]({},_0x4299d0,_0x5d0f0e[_0xf011('0x3a')]);var _0x453d06={'where':_0x4299d0['where']};return db['OpenchannelApplication'][_0xf011('0x1b')](_0x453d06)[_0xf011('0x20')](function(_0x3816f8){_0x136dc4[_0xf011('0x1b')]=_0x3816f8;if(_0x5d0f0e[_0xf011('0x2a')][_0xf011('0x3b')]){_0x4299d0[_0xf011('0x3c')]=[{'all':!![]}];}return db[_0xf011('0x24')]['findAll'](_0x4299d0);})[_0xf011('0x20')](function(_0x3f6069){_0x136dc4[_0xf011('0x3d')]=_0x3f6069;return _0x136dc4;})[_0xf011('0x20')](respondWithFilteredResult(_0x5333b9,_0x4299d0))['catch'](handleError(_0x5333b9,null));};exports[_0xf011('0x3e')]=function(_0x511a3d,_0x4be8e1){var _0x190e82={'raw':!![],'where':{'id':_0x511a3d[_0xf011('0x3f')]['id']}},_0x4f2019={};_0x4f2019['model']=_[_0xf011('0x29')](db[_0xf011('0x24')]['rawAttributes']);_0x4f2019[_0xf011('0x2a')]=_[_0xf011('0x29')](_0x511a3d[_0xf011('0x2a')]);_0x4f2019['filters']=_['intersection'](_0x4f2019[_0xf011('0x28')],_0x4f2019['query']);_0x190e82[_0xf011('0x2e')]=_[_0xf011('0x2c')](_0x4f2019[_0xf011('0x28')],qs[_0xf011('0x2d')](_0x511a3d[_0xf011('0x2a')][_0xf011('0x2d')]));_0x190e82[_0xf011('0x2e')]=_0x190e82[_0xf011('0x2e')][_0xf011('0x2f')]?_0x190e82[_0xf011('0x2e')]:_0x4f2019[_0xf011('0x28')];if(_0x511a3d[_0xf011('0x2a')][_0xf011('0x3b')]){_0x190e82[_0xf011('0x3c')]=[{'all':!![]}];}_0x190e82=_[_0xf011('0x36')]({},_0x190e82,_0x511a3d['options']);return db[_0xf011('0x24')][_0xf011('0x40')](_0x190e82)[_0xf011('0x20')](handleEntityNotFound(_0x4be8e1,null))[_0xf011('0x20')](respondWithResult(_0x4be8e1,null))['catch'](handleError(_0x4be8e1,null));};exports['create']=function(_0x35bd19,_0x4f9c60){return db['OpenchannelApplication']['create'](_0x35bd19[_0xf011('0x41')],{})[_0xf011('0x20')](respondWithResult(_0x4f9c60,0xc9))[_0xf011('0x42')](handleError(_0x4f9c60,null));};exports[_0xf011('0x1f')]=function(_0x36f4ac,_0xb92b1f){if(_0x36f4ac[_0xf011('0x41')]['id']){delete _0x36f4ac[_0xf011('0x41')]['id'];}return db['OpenchannelApplication']['find']({'where':{'id':_0x36f4ac[_0xf011('0x3f')]['id']}})[_0xf011('0x20')](handleEntityNotFound(_0xb92b1f,null))[_0xf011('0x20')](saveUpdates(_0x36f4ac[_0xf011('0x41')],null))[_0xf011('0x20')](respondWithResult(_0xb92b1f,null))[_0xf011('0x42')](handleError(_0xb92b1f,null));};exports['destroy']=function(_0x3d10d9,_0x5bc4b8){return db[_0xf011('0x24')]['find']({'where':{'id':_0x3d10d9[_0xf011('0x3f')]['id']}})['then'](handleEntityNotFound(_0x5bc4b8,null))['then'](removeEntity(_0x5bc4b8,null))['catch'](handleError(_0x5bc4b8,null));}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.model.js b/server/api/openchannelApplication/openchannelApplication.model.js index 3a917e5..c1013c7 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 _0xb8ca=['api','moment','bluebird','request-promise','path','./openchannelApplication.attributes','exports','OpenchannelApplication','openchannel_applications','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger'];(function(_0x56332f,_0x5ec3c7){var _0x25c693=function(_0x327d6e){while(--_0x327d6e){_0x56332f['push'](_0x56332f['shift']());}};_0x25c693(++_0x5ec3c7);}(_0xb8ca,0x136));var _0xab8c=function(_0x7d343d,_0x34f0d8){_0x7d343d=_0x7d343d-0x0;var _0x2557bc=_0xb8ca[_0x7d343d];return _0x2557bc;};'use strict';var _=require(_0xab8c('0x0'));var util=require('util');var logger=require(_0xab8c('0x1'))(_0xab8c('0x2'));var moment=require(_0xab8c('0x3'));var BPromise=require(_0xab8c('0x4'));var rp=require(_0xab8c('0x5'));var fs=require('fs');var path=require(_0xab8c('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xab8c('0x7'));module[_0xab8c('0x8')]=function(_0x5af363,_0x5c72ff){return _0x5af363['define'](_0xab8c('0x9'),attributes,{'tableName':_0xab8c('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xab8c('0xb'),'collate':_0xab8c('0xc')});}; \ No newline at end of file +var _0x8cb3=['util','../../config/logger','moment','request-promise','path','../../config/environment','./openchannelApplication.attributes','define','utf8mb4','utf8mb4_unicode_ci','lodash'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x8cb3,0x16a));var _0x38cb=function(_0x48fdc9,_0x3612b5){_0x48fdc9=_0x48fdc9-0x0;var _0x2bfc64=_0x8cb3[_0x48fdc9];return _0x2bfc64;};'use strict';var _=require(_0x38cb('0x0'));var util=require(_0x38cb('0x1'));var logger=require(_0x38cb('0x2'))('api');var moment=require(_0x38cb('0x3'));var BPromise=require('bluebird');var rp=require(_0x38cb('0x4'));var fs=require('fs');var path=require(_0x38cb('0x5'));var rimraf=require('rimraf');var config=require(_0x38cb('0x6'));var attributes=require(_0x38cb('0x7'));module['exports']=function(_0x3fd8b2,_0x542fc9){return _0x3fd8b2[_0x38cb('0x8')]('OpenchannelApplication',attributes,{'tableName':'openchannel_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x38cb('0x9'),'collate':_0x38cb('0xa')});}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.rpc.js b/server/api/openchannelApplication/openchannelApplication.rpc.js index 255b2f7..3429be7 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 _0x3b77=['randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','then','info','request\x20sent','debug','OpenchannelApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','OpenchannelApplication,\x20%s,\x20%s','message','result','UpdateOpenchannelApplication','OpenchannelApplication','update','options','raw','where','attributes','catch','lodash'];(function(_0x115077,_0x5e408c){var _0x54c285=function(_0xcdb92){while(--_0xcdb92){_0x115077['push'](_0x115077['shift']());}};_0x54c285(++_0x5e408c);}(_0x3b77,0x194));var _0x73b7=function(_0xfd86ca,_0x9b17fa){_0xfd86ca=_0xfd86ca-0x0;var _0x1e2f56=_0x3b77[_0xfd86ca];return _0x1e2f56;};'use strict';var _=require(_0x73b7('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x73b7('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x73b7('0x2'))['db'];var utils=require(_0x73b7('0x3'));var logger=require(_0x73b7('0x4'))(_0x73b7('0x5'));var config=require(_0x73b7('0x6'));var jayson=require(_0x73b7('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5db330,_0xf4b39e,_0x7fdd1c){return new BPromise(function(_0x4a91b7,_0x42b5d0){return client['request'](_0x5db330,_0x7fdd1c)[_0x73b7('0x8')](function(_0x1b0135){logger[_0x73b7('0x9')]('OpenchannelApplication,\x20%s,\x20%s',_0xf4b39e,_0x73b7('0xa'));logger[_0x73b7('0xb')](_0x73b7('0xc'),_0xf4b39e,'request\x20sent',JSON[_0x73b7('0xd')](_0x1b0135));if(_0x1b0135[_0x73b7('0xe')]){if(_0x1b0135[_0x73b7('0xe')][_0x73b7('0xf')]===0x1f4){logger[_0x73b7('0xe')](_0x73b7('0x10'),_0xf4b39e,_0x1b0135[_0x73b7('0xe')][_0x73b7('0x11')]);return _0x42b5d0(_0x1b0135['error'][_0x73b7('0x11')]);}logger['error']('OpenchannelApplication,\x20%s,\x20%s',_0xf4b39e,_0x1b0135['error'][_0x73b7('0x11')]);return _0x4a91b7(_0x1b0135[_0x73b7('0xe')][_0x73b7('0x11')]);}else{logger[_0x73b7('0x9')](_0x73b7('0x10'),_0xf4b39e,_0x73b7('0xa'));_0x4a91b7(_0x1b0135[_0x73b7('0x12')][_0x73b7('0x11')]);}})['catch'](function(_0x1304b2){logger[_0x73b7('0xe')]('OpenchannelApplication,\x20%s,\x20%s',_0xf4b39e,_0x1304b2);_0x42b5d0(_0x1304b2);});});}exports[_0x73b7('0x13')]=function(_0x3c5d5a){var _0x3e0181=this;return new Promise(function(_0x97658f,_0x3bc768){return db[_0x73b7('0x14')][_0x73b7('0x15')](_0x3c5d5a['body'],{'raw':_0x3c5d5a[_0x73b7('0x16')]?_0x3c5d5a[_0x73b7('0x16')][_0x73b7('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3c5d5a[_0x73b7('0x16')]?_0x3c5d5a['options'][_0x73b7('0x18')]||null:null,'attributes':_0x3c5d5a[_0x73b7('0x16')]?_0x3c5d5a[_0x73b7('0x16')][_0x73b7('0x19')]||null:null,'limit':_0x3c5d5a[_0x73b7('0x16')]?_0x3c5d5a['options']['limit']||null:null})[_0x73b7('0x8')](function(_0xdfb106){logger[_0x73b7('0x9')](_0x73b7('0x13'),_0x3c5d5a);logger['debug'](_0x73b7('0x13'),_0x3c5d5a,JSON[_0x73b7('0xd')](_0xdfb106));_0x97658f(_0xdfb106);})[_0x73b7('0x1a')](function(_0xae228){logger[_0x73b7('0xe')]('UpdateOpenchannelApplication',_0xae228[_0x73b7('0x11')],_0x3c5d5a);_0x3bc768(_0x3e0181[_0x73b7('0xe')](0x1f4,_0xae228[_0x73b7('0x11')]));});});}; \ No newline at end of file +var _0x66c4=['then','info','OpenchannelApplication,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','UpdateOpenchannelApplication','OpenchannelApplication','update','body','options','raw','where','attributes','limit','debug','util','moment','bluebird','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise','client','request'];(function(_0x10cee2,_0x34ae8a){var _0x54ace4=function(_0x4c0d6f){while(--_0x4c0d6f){_0x10cee2['push'](_0x10cee2['shift']());}};_0x54ace4(++_0x34ae8a);}(_0x66c4,0x1d2));var _0x466c=function(_0x1c21f0,_0x7d5ed9){_0x1c21f0=_0x1c21f0-0x0;var _0x13c1ad=_0x66c4[_0x1c21f0];return _0x13c1ad;};'use strict';var _=require('lodash');var util=require(_0x466c('0x0'));var moment=require(_0x466c('0x1'));var BPromise=require(_0x466c('0x2'));var rs=require(_0x466c('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x466c('0x4'));var logger=require('../../config/logger')(_0x466c('0x5'));var config=require(_0x466c('0x6'));var jayson=require(_0x466c('0x7'));var client=jayson[_0x466c('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1f29cb,_0x7822f0,_0x2d6624){return new BPromise(function(_0x28388f,_0x28d61c){return client[_0x466c('0x9')](_0x1f29cb,_0x2d6624)[_0x466c('0xa')](function(_0x11b9db){logger[_0x466c('0xb')](_0x466c('0xc'),_0x7822f0,_0x466c('0xd'));logger['debug']('OpenchannelApplication,\x20%s,\x20%s,\x20%s',_0x7822f0,_0x466c('0xd'),JSON[_0x466c('0xe')](_0x11b9db));if(_0x11b9db['error']){if(_0x11b9db['error']['code']===0x1f4){logger[_0x466c('0xf')]('OpenchannelApplication,\x20%s,\x20%s',_0x7822f0,_0x11b9db['error'][_0x466c('0x10')]);return _0x28d61c(_0x11b9db[_0x466c('0xf')]['message']);}logger[_0x466c('0xf')](_0x466c('0xc'),_0x7822f0,_0x11b9db['error']['message']);return _0x28388f(_0x11b9db[_0x466c('0xf')][_0x466c('0x10')]);}else{logger['info'](_0x466c('0xc'),_0x7822f0,_0x466c('0xd'));_0x28388f(_0x11b9db['result']['message']);}})[_0x466c('0x11')](function(_0xb0354a){logger[_0x466c('0xf')](_0x466c('0xc'),_0x7822f0,_0xb0354a);_0x28d61c(_0xb0354a);});});}exports[_0x466c('0x12')]=function(_0x2834d7){var _0x382265=this;return new Promise(function(_0x36f3b0,_0x22ff5c){return db[_0x466c('0x13')][_0x466c('0x14')](_0x2834d7[_0x466c('0x15')],{'raw':_0x2834d7[_0x466c('0x16')]?_0x2834d7[_0x466c('0x16')][_0x466c('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2834d7[_0x466c('0x16')]?_0x2834d7[_0x466c('0x16')][_0x466c('0x18')]||null:null,'attributes':_0x2834d7[_0x466c('0x16')]?_0x2834d7[_0x466c('0x16')][_0x466c('0x19')]||null:null,'limit':_0x2834d7[_0x466c('0x16')]?_0x2834d7[_0x466c('0x16')][_0x466c('0x1a')]||null:null})['then'](function(_0x1190f0){logger[_0x466c('0xb')](_0x466c('0x12'),_0x2834d7);logger[_0x466c('0x1b')](_0x466c('0x12'),_0x2834d7,JSON[_0x466c('0xe')](_0x1190f0));_0x36f3b0(_0x1190f0);})[_0x466c('0x11')](function(_0x360f72){logger[_0x466c('0xf')](_0x466c('0x12'),_0x360f72[_0x466c('0x10')],_0x2834d7);_0x22ff5c(_0x382265[_0x466c('0xf')](0x1f4,_0x360f72[_0x466c('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/index.js b/server/api/openchannelInteraction/index.js index 76cd6cc..a91068f 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 _0x5f2a=['download','post','create','/:id/messages','/:id/tags','tracked','openchannel','openchannelinteraction:addtags','addTags','update','destroy','removeTags','exports','path','connect-timeout','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','getMessages'];(function(_0x1a530e,_0x23f3a3){var _0xbdb738=function(_0x4b8789){while(--_0x4b8789){_0x1a530e['push'](_0x1a530e['shift']());}};_0xbdb738(++_0x23f3a3);}(_0x5f2a,0xc3));var _0xa5f2=function(_0x1df489,_0x34be5f){_0x1df489=_0x1df489-0x0;var _0x49578c=_0x5f2a[_0x1df489];return _0x49578c;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xa5f2('0x0'));var timeout=require(_0xa5f2('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xa5f2('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0xa5f2('0x3'));var config=require(_0xa5f2('0x4'));var controller=require('./openchannelInteraction.controller');router[_0xa5f2('0x5')]('/',auth[_0xa5f2('0x6')](),controller[_0xa5f2('0x7')]);router[_0xa5f2('0x5')](_0xa5f2('0x8'),auth[_0xa5f2('0x6')](),controller[_0xa5f2('0x9')]);router['get'](_0xa5f2('0xa'),auth[_0xa5f2('0x6')](),controller[_0xa5f2('0xb')]);router[_0xa5f2('0x5')]('/:id/messages',auth[_0xa5f2('0x6')](),controller[_0xa5f2('0xc')]);router[_0xa5f2('0x5')]('/:id/download',auth[_0xa5f2('0x6')](),controller[_0xa5f2('0xd')]);router[_0xa5f2('0xe')]('/',auth[_0xa5f2('0x6')](),controller[_0xa5f2('0xf')]);router[_0xa5f2('0xe')](_0xa5f2('0x10'),auth[_0xa5f2('0x6')](),controller['addMessage']);router[_0xa5f2('0xe')](_0xa5f2('0x11'),auth[_0xa5f2('0x6')](),interaction[_0xa5f2('0x12')](_0xa5f2('0x13'),_0xa5f2('0x14')),controller[_0xa5f2('0x15')]);router['put']('/:id',auth[_0xa5f2('0x6')](),interaction['tracked'](_0xa5f2('0x13'),'openchannelinteraction:update'),controller[_0xa5f2('0x16')]);router['delete'](_0xa5f2('0xa'),auth[_0xa5f2('0x6')](),interaction['tracked'](_0xa5f2('0x13'),'openchannelinteraction:destroy'),controller[_0xa5f2('0x17')]);router['delete'](_0xa5f2('0x11'),auth[_0xa5f2('0x6')](),controller[_0xa5f2('0x18')]);module[_0xa5f2('0x19')]=router; \ No newline at end of file +var _0xc875=['/:id','tracked','openchannel','openchannelinteraction:update','delete','openchannelinteraction:destroy','destroy','/:id/tags','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelInteraction.controller','get','isAuthenticated','index','/describe','describe','show','getMessages','/:id/download','post','create','/:id/messages','openchannelinteraction:addtags','addTags','put'];(function(_0x2eb717,_0x1c72af){var _0x5a82f2=function(_0x247bda){while(--_0x247bda){_0x2eb717['push'](_0x2eb717['shift']());}};_0x5a82f2(++_0x1c72af);}(_0xc875,0x1a9));var _0x5c87=function(_0x1098e4,_0x158273){_0x1098e4=_0x1098e4-0x0;var _0x5401e7=_0xc875[_0x1098e4];return _0x5401e7;};'use strict';var multer=require(_0x5c87('0x0'));var util=require('util');var path=require(_0x5c87('0x1'));var timeout=require(_0x5c87('0x2'));var express=require('express');var router=express[_0x5c87('0x3')]();var fs_extra=require(_0x5c87('0x4'));var auth=require(_0x5c87('0x5'));var interaction=require(_0x5c87('0x6'));var config=require(_0x5c87('0x7'));var controller=require(_0x5c87('0x8'));router[_0x5c87('0x9')]('/',auth[_0x5c87('0xa')](),controller[_0x5c87('0xb')]);router[_0x5c87('0x9')](_0x5c87('0xc'),auth[_0x5c87('0xa')](),controller[_0x5c87('0xd')]);router[_0x5c87('0x9')]('/:id',auth[_0x5c87('0xa')](),controller[_0x5c87('0xe')]);router['get']('/:id/messages',auth[_0x5c87('0xa')](),controller[_0x5c87('0xf')]);router['get'](_0x5c87('0x10'),auth[_0x5c87('0xa')](),controller['download']);router[_0x5c87('0x11')]('/',auth[_0x5c87('0xa')](),controller[_0x5c87('0x12')]);router['post'](_0x5c87('0x13'),auth[_0x5c87('0xa')](),controller['addMessage']);router[_0x5c87('0x11')]('/:id/tags',auth[_0x5c87('0xa')](),interaction['tracked']('openchannel',_0x5c87('0x14')),controller[_0x5c87('0x15')]);router[_0x5c87('0x16')](_0x5c87('0x17'),auth[_0x5c87('0xa')](),interaction[_0x5c87('0x18')](_0x5c87('0x19'),_0x5c87('0x1a')),controller['update']);router[_0x5c87('0x1b')](_0x5c87('0x17'),auth['isAuthenticated'](),interaction[_0x5c87('0x18')](_0x5c87('0x19'),_0x5c87('0x1c')),controller[_0x5c87('0x1d')]);router[_0x5c87('0x1b')](_0x5c87('0x1e'),auth['isAuthenticated'](),controller['removeTags']);module[_0x5c87('0x1f')]=router; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.attributes.js b/server/api/openchannelInteraction/openchannelInteraction.attributes.js index 77f1cc7..4528f4f 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 _0x0caf=['out','BOOLEAN','INTEGER','DATE','STRING','ENUM'];(function(_0x3eb8a2,_0x212a08){var _0x1ffdca=function(_0x3e4cff){while(--_0x3e4cff){_0x3eb8a2['push'](_0x3eb8a2['shift']());}};_0x1ffdca(++_0x212a08);}(_0x0caf,0x9f));var _0xf0ca=function(_0x12f3a2,_0x9b6efc){_0x12f3a2=_0x12f3a2-0x0;var _0x4f06a2=_0x0caf[_0x12f3a2];return _0x4f06a2;};'use strict';var Sequelize=require('sequelize');module['exports']={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xf0ca('0x0')]},'disposition':{'type':Sequelize[_0xf0ca('0x1')]},'secondDisposition':{'type':Sequelize[_0xf0ca('0x1')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0xf0ca('0x0')]},'threadId':{'type':Sequelize[_0xf0ca('0x1')]},'externalUrl':{'type':Sequelize['STRING']},'lastMsgAt':{'type':Sequelize[_0xf0ca('0x0')]},'firstMsgDirection':{'type':Sequelize[_0xf0ca('0x2')]('in',_0xf0ca('0x3')),'defaultValue':'in','allowNull':![]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0xf0ca('0x3')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0xf0ca('0x1')]},'autoreplyExecuted':{'type':Sequelize[_0xf0ca('0x4')],'defaultValue':![]},'queueId':{'type':Sequelize[_0xf0ca('0x5')]}}; \ No newline at end of file +var _0x9153=['sequelize','exports','BOOLEAN','DATE','STRING','ENUM','out','INTEGER'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0x9153,0xd8));var _0x3915=function(_0x53febe,_0x436ff6){_0x53febe=_0x53febe-0x0;var _0x2251ce=_0x9153[_0x53febe];return _0x2251ce;};'use strict';var Sequelize=require(_0x3915('0x0'));module[_0x3915('0x1')]={'closed':{'type':Sequelize[_0x3915('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x3915('0x3')]},'disposition':{'type':Sequelize[_0x3915('0x4')]},'secondDisposition':{'type':Sequelize[_0x3915('0x4')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x3915('0x4')]},'read1stAt':{'type':Sequelize[_0x3915('0x3')]},'threadId':{'type':Sequelize[_0x3915('0x4')]},'externalUrl':{'type':Sequelize[_0x3915('0x4')]},'lastMsgAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize[_0x3915('0x5')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x3915('0x6')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0x3915('0x4')]},'autoreplyExecuted':{'type':Sequelize[_0x3915('0x2')],'defaultValue':![]},'queueId':{'type':Sequelize[_0x3915('0x7')]}}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.controller.js b/server/api/openchannelInteraction/openchannelInteraction.controller.js index a673dee..02416ae 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 _0xb7a9=['$gte','split','format','count','omit','spread','removeTags','download','unix','toString','join','root','server','tmp','files','attachments','transcript-%d-%s.zip','push','fullname','CmContact','Contact','firstName','lastName','Attachment','createdAt','direction','read','OpenchannelAccount','User','Owner','get','mkdirSync','N.A.','YYYY-MM-DD\x20HH:mm:ss','closed','closedAt','disposition','threadId','Public','Private','basename','existsSync','createReadStream','createWriteStream','System','secret','value','renderFile','downloadInteraction.ejs','transcript-','.pdf','Openchannel','createPdfFromHTML','error','Unable\x20to\x20delete\x20zip\x20file','unlinkSync','rimraf','zip-dir','moment','util','ejs','lodash','ioredis','../../components/interaction/service','../../components/export/pdf','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelInteraction.socket','register','sendStatus','end','status','json','offset','undefined','limit','set','Content-Range','update','then','destroy','stack','name','send','index','map','OpenchannelInteraction','key','getOptions','findAll','openchannel','query','user','type','from','params','model','rawAttributes','keys','filters','fields','attributes','length','includeAll','include','merge','options','find','create','body','catch','describe','OpenchannelMessage','addMessage','ids','hasOwnProperty','nolimit','sort','where','pick','OpenchannelInteractionId','filter'];(function(_0x340431,_0x3756e7){var _0x427941=function(_0x3c7037){while(--_0x3c7037){_0x340431['push'](_0x340431['shift']());}};_0x427941(++_0x3756e7);}(_0xb7a9,0xb7));var _0x9b7a=function(_0x556ee7,_0x23ceba){_0x556ee7=_0x556ee7-0x0;var _0x135721=_0xb7a9[_0x556ee7];return _0x135721;};'use strict';var rimraf=require(_0x9b7a('0x0'));var zipdir=require(_0x9b7a('0x1'));var moment=require(_0x9b7a('0x2'));var util=require(_0x9b7a('0x3'));var path=require('path');var ejs=require(_0x9b7a('0x4'));var fs=require('fs');var _=require(_0x9b7a('0x5'));var Redis=require(_0x9b7a('0x6'));var interaction=require(_0x9b7a('0x7'));var qs=require('../../components/parsers/qs');var pdf=require(_0x9b7a('0x8'));var logger=require('../../config/logger')(_0x9b7a('0x9'));var config=require(_0x9b7a('0xa'));var db=require(_0x9b7a('0xb'))['db'];config[_0x9b7a('0xc')]=_[_0x9b7a('0xd')](config['redis'],{'host':_0x9b7a('0xe'),'port':0x18eb});var socket=require(_0x9b7a('0xf'))(new Redis(config[_0x9b7a('0xc')]));require(_0x9b7a('0x10'))[_0x9b7a('0x11')](socket);function respondWithStatusCode(_0x25a50a,_0x3a2ecb){_0x3a2ecb=_0x3a2ecb||0xcc;return function(_0x4739b){if(_0x4739b){return _0x25a50a[_0x9b7a('0x12')](_0x3a2ecb);}return _0x25a50a['status'](_0x3a2ecb)[_0x9b7a('0x13')]();};}function respondWithResult(_0x22c1fe,_0x207824){_0x207824=_0x207824||0xc8;return function(_0x11bf97){if(_0x11bf97){return _0x22c1fe[_0x9b7a('0x14')](_0x207824)[_0x9b7a('0x15')](_0x11bf97);}};}function respondWithFilteredResult(_0x5974dd,_0x25435f){return function(_0x24e2ea){if(_0x24e2ea){var _0x2f1ef7=typeof _0x25435f[_0x9b7a('0x16')]===_0x9b7a('0x17')&&typeof _0x25435f[_0x9b7a('0x18')]===_0x9b7a('0x17');var _0x41c272=_0x24e2ea['count'];var _0x4aecfe=_0x2f1ef7?0x0:_0x25435f['offset'];var _0x1bb02c=_0x2f1ef7?_0x24e2ea['count']:_0x25435f[_0x9b7a('0x16')]+_0x25435f['limit'];var _0x47f1c9;if(_0x1bb02c>=_0x41c272){_0x1bb02c=_0x41c272;_0x47f1c9=0xc8;}else{_0x47f1c9=0xce;}_0x5974dd[_0x9b7a('0x14')](_0x47f1c9);return _0x5974dd[_0x9b7a('0x19')](_0x9b7a('0x1a'),_0x4aecfe+'-'+_0x1bb02c+'/'+_0x41c272)[_0x9b7a('0x15')](_0x24e2ea);}return null;};}function saveUpdates(_0xf2a189){return function(_0x3c3726){if(_0x3c3726){return _0x3c3726[_0x9b7a('0x1b')](_0xf2a189)[_0x9b7a('0x1c')](function(_0x175f14){return _0x175f14;});}return null;};}function removeEntity(_0x5522ea){return function(_0x41c764){if(_0x41c764){return _0x41c764[_0x9b7a('0x1d')]()['then'](function(){_0x5522ea[_0x9b7a('0x14')](0xcc)[_0x9b7a('0x13')]();});}};}function handleEntityNotFound(_0x539ce3){return function(_0x535ba2){if(!_0x535ba2){_0x539ce3[_0x9b7a('0x12')](0x194);}return _0x535ba2;};}function handleError(_0x29aeaa,_0x4373ef){_0x4373ef=_0x4373ef||0x1f4;return function(_0x112100){logger['error'](_0x112100[_0x9b7a('0x1e')]);if(_0x112100[_0x9b7a('0x1f')]){delete _0x112100['name'];}_0x29aeaa[_0x9b7a('0x14')](_0x4373ef)[_0x9b7a('0x20')](_0x112100);};}exports[_0x9b7a('0x21')]=function(_0x2e47e0,_0x134997){var _0xdd6702={};var _0xd4d381=_[_0x9b7a('0x22')](db[_0x9b7a('0x23')]['rawAttributes'],function(_0x1014ad){return{'name':_0x1014ad['fieldName'],'type':_0x1014ad['type'][_0x9b7a('0x24')]};});_0xdd6702=qs[_0x9b7a('0x25')](_0xd4d381,_0x2e47e0);return interaction[_0x9b7a('0x26')](_0x9b7a('0x27'),_0x2e47e0[_0x9b7a('0x28')],_0x2e47e0[_0x9b7a('0x29')],_0xdd6702,_0xd4d381)[_0x9b7a('0x1c')](respondWithFilteredResult(_0x134997,_0xdd6702))['catch'](handleError(_0x134997,null));};exports['show']=function(_0x543aa3,_0x5adc23){var _0xbd0169={};if(_0x543aa3['query'][_0x9b7a('0x2a')]&&_0x543aa3['query'][_0x9b7a('0x2a')]===_0x9b7a('0x2b')){_0xbd0169['from']=_0x543aa3[_0x9b7a('0x2c')]['id'];}else{_0xbd0169['id']=_0x543aa3[_0x9b7a('0x2c')]['id'];}var _0x109372={'raw':![],'where':_0xbd0169},_0x1af10b={};_0x1af10b[_0x9b7a('0x2d')]=_['keys'](db['OpenchannelInteraction'][_0x9b7a('0x2e')]);_0x1af10b[_0x9b7a('0x28')]=_[_0x9b7a('0x2f')](_0x543aa3[_0x9b7a('0x28')]);_0x1af10b[_0x9b7a('0x30')]=_['intersection'](_0x1af10b[_0x9b7a('0x2d')],_0x1af10b[_0x9b7a('0x28')]);_0x109372['attributes']=_['intersection'](_0x1af10b['model'],qs['fields'](_0x543aa3['query'][_0x9b7a('0x31')]));_0x109372[_0x9b7a('0x32')]=_0x109372['attributes'][_0x9b7a('0x33')]?_0x109372[_0x9b7a('0x32')]:_0x1af10b[_0x9b7a('0x2d')];if(_0x543aa3[_0x9b7a('0x28')][_0x9b7a('0x34')]){_0x109372[_0x9b7a('0x35')]=[{'all':!![]}];}_0x109372=_[_0x9b7a('0x36')]({},_0x109372,_0x543aa3[_0x9b7a('0x37')]);return db[_0x9b7a('0x23')][_0x9b7a('0x38')](_0x109372)[_0x9b7a('0x1c')](handleEntityNotFound(_0x5adc23,null))[_0x9b7a('0x1c')](respondWithResult(_0x5adc23,null))['catch'](handleError(_0x5adc23,null));};exports[_0x9b7a('0x39')]=function(_0x145db,_0x4229dc){return db['OpenchannelInteraction'][_0x9b7a('0x39')](_0x145db[_0x9b7a('0x3a')],{})['then'](respondWithResult(_0x4229dc,0xc9))[_0x9b7a('0x3b')](handleError(_0x4229dc,null));};exports['update']=function(_0x2f1f19,_0x4afd2a){if(_0x2f1f19[_0x9b7a('0x3a')]['id']){delete _0x2f1f19[_0x9b7a('0x3a')]['id'];}return db[_0x9b7a('0x23')][_0x9b7a('0x38')]({'where':{'id':_0x2f1f19['params']['id']}})[_0x9b7a('0x1c')](handleEntityNotFound(_0x4afd2a,null))[_0x9b7a('0x1c')](saveUpdates(_0x2f1f19[_0x9b7a('0x3a')],null))[_0x9b7a('0x1c')](respondWithResult(_0x4afd2a,null))[_0x9b7a('0x3b')](handleError(_0x4afd2a,null));};exports['destroy']=function(_0x9c6a43,_0x53a624){return db[_0x9b7a('0x23')][_0x9b7a('0x38')]({'where':{'id':_0x9c6a43['params']['id']}})[_0x9b7a('0x1c')](handleEntityNotFound(_0x53a624,null))[_0x9b7a('0x1c')](removeEntity(_0x53a624,null))['catch'](handleError(_0x53a624,null));};exports['describe']=function(_0x5f3319,_0x33065a){return db[_0x9b7a('0x23')][_0x9b7a('0x3c')]()['then'](respondWithResult(_0x33065a,null))['catch'](handleError(_0x33065a,null));};exports['addMessage']=function(_0x6a76ce,_0x59ca7e){return db[_0x9b7a('0x3d')][_0x9b7a('0x38')]({'where':{'id':_0x6a76ce[_0x9b7a('0x2c')]['id']}})[_0x9b7a('0x1c')](handleEntityNotFound(_0x59ca7e,null))[_0x9b7a('0x1c')](function(_0x3c54d2){if(_0x3c54d2){return _0x3c54d2[_0x9b7a('0x3e')](_0x6a76ce[_0x9b7a('0x3a')][_0x9b7a('0x3f')],_['omit'](_0x6a76ce['body'],[_0x9b7a('0x3f'),'id'])||{});}})[_0x9b7a('0x1c')](respondWithResult(_0x59ca7e,null))['catch'](handleError(_0x59ca7e,null));};exports['getMessages']=function(_0x32faf7,_0x3c4466){var _0x2eb860={'raw':![],'where':{}};var _0x52c4cb={};var _0x5c92b1={'count':0x0,'rows':[]};return db[_0x9b7a('0x23')]['findOne']({'where':{'id':_0x32faf7['params']['id']}})[_0x9b7a('0x1c')](handleEntityNotFound(_0x3c4466,null))[_0x9b7a('0x1c')](function(_0x1534c3){if(_0x1534c3){_0x52c4cb['model']=_['keys'](db[_0x9b7a('0x3d')]['rawAttributes']);_0x52c4cb['query']=_[_0x9b7a('0x2f')](_0x32faf7[_0x9b7a('0x28')]);_0x52c4cb['filters']=_['intersection'](_0x52c4cb[_0x9b7a('0x2d')],_0x52c4cb[_0x9b7a('0x28')]);_0x2eb860[_0x9b7a('0x32')]=_['intersection'](_0x52c4cb[_0x9b7a('0x2d')],qs[_0x9b7a('0x31')](_0x32faf7[_0x9b7a('0x28')][_0x9b7a('0x31')]));_0x2eb860['attributes']=_0x2eb860[_0x9b7a('0x32')][_0x9b7a('0x33')]?_0x2eb860[_0x9b7a('0x32')]:_0x52c4cb[_0x9b7a('0x2d')];if(!_0x32faf7[_0x9b7a('0x28')][_0x9b7a('0x40')](_0x9b7a('0x41'))){_0x2eb860[_0x9b7a('0x18')]=qs['limit'](_0x32faf7['query'][_0x9b7a('0x18')]);_0x2eb860[_0x9b7a('0x16')]=qs[_0x9b7a('0x16')](_0x32faf7['query'][_0x9b7a('0x16')]);}_0x2eb860['order']=qs[_0x9b7a('0x42')](_0x32faf7[_0x9b7a('0x28')][_0x9b7a('0x42')]);_0x2eb860[_0x9b7a('0x43')]=qs[_0x9b7a('0x30')](_[_0x9b7a('0x44')](_0x32faf7[_0x9b7a('0x28')],_0x52c4cb[_0x9b7a('0x30')]));_0x2eb860[_0x9b7a('0x43')][_0x9b7a('0x45')]=_0x1534c3['id'];if(_0x32faf7[_0x9b7a('0x28')]['filter']){_0x2eb860[_0x9b7a('0x43')]=_['merge'](_0x2eb860[_0x9b7a('0x43')],{'$or':_['map'](_0x2eb860[_0x9b7a('0x32')],function(_0x2e7a38){var _0x249d54={};_0x249d54[_0x2e7a38]={'$like':'%'+_0x32faf7[_0x9b7a('0x28')][_0x9b7a('0x46')]+'%'};return _0x249d54;})});}if(_0x32faf7[_0x9b7a('0x28')][_0x9b7a('0x47')]){var _0x2acc6a=_0x32faf7[_0x9b7a('0x28')][_0x9b7a('0x47')][_0x9b7a('0x48')](',');var _0x32c7ae={};_0x32c7ae[_0x2acc6a[0x0]]={'$gte':moment(_0x2acc6a[0x1])[_0x9b7a('0x49')]('YYYY-MM-DD\x20HH:mm:ss')};_0x2eb860['where']=_[_0x9b7a('0x36')](_0x2eb860[_0x9b7a('0x43')],_0x32c7ae);}_0x2eb860=_[_0x9b7a('0x36')]({},_0x2eb860,_0x32faf7['options']);return db['OpenchannelMessage'][_0x9b7a('0x4a')]({'where':_0x2eb860[_0x9b7a('0x43')]})[_0x9b7a('0x1c')](function(_0x46dd7b){_0x5c92b1[_0x9b7a('0x4a')]=_0x46dd7b;if(_0x32faf7[_0x9b7a('0x28')][_0x9b7a('0x34')]){_0x2eb860[_0x9b7a('0x35')]=[{'all':!![]}];}return db[_0x9b7a('0x3d')][_0x9b7a('0x26')](_0x2eb860);})[_0x9b7a('0x1c')](function(_0x55a1d2){_0x5c92b1['rows']=_0x55a1d2;return _0x5c92b1;});}})[_0x9b7a('0x1c')](respondWithFilteredResult(_0x3c4466,_0x2eb860))['catch'](handleError(_0x3c4466,null));};exports['addTags']=function(_0x105665,_0x389198){return db[_0x9b7a('0x23')]['find']({'where':{'id':_0x105665['params']['id']}})['then'](handleEntityNotFound(_0x389198,null))['then'](function(_0x315388){if(_0x315388){return _0x315388['setTags'](_0x105665['body'][_0x9b7a('0x3f')],_[_0x9b7a('0x4b')](_0x105665[_0x9b7a('0x3a')],[_0x9b7a('0x3f'),'id'])||{})[_0x9b7a('0x4c')](function(){return db['Tag']['findAll']({'attributes':['id',_0x9b7a('0x1f'),'color'],'where':{'id':_0x105665[_0x9b7a('0x3a')][_0x9b7a('0x3f')]}});})[_0x9b7a('0x1c')](function(_0x1ede8d){socket['emit']('openchannelInteractionTags:save',{'id':Number(_0x105665['params']['id']),'tags':_0x1ede8d||[]});return{'id':Number(_0x105665[_0x9b7a('0x2c')]['id']),'tags':_0x1ede8d||[]};});}})['then'](respondWithResult(_0x389198,null))[_0x9b7a('0x3b')](handleError(_0x389198,null));};exports[_0x9b7a('0x4d')]=function(_0xef9f86,_0x394381){return db[_0x9b7a('0x23')][_0x9b7a('0x38')]({'where':{'id':_0xef9f86['params']['id']}})[_0x9b7a('0x1c')](handleEntityNotFound(_0x394381,null))['then'](function(_0x23c571){if(_0x23c571){return _0x23c571[_0x9b7a('0x4d')](_0xef9f86[_0x9b7a('0x28')][_0x9b7a('0x3f')]);}})['then'](respondWithStatusCode(_0x394381,null))[_0x9b7a('0x3b')](handleError(_0x394381,null));};exports[_0x9b7a('0x4e')]=function(_0x3362d8,_0x5d9057){var _0x94cf82=moment()[_0x9b7a('0x4f')]()[_0x9b7a('0x50')]();var _0x1aa63d=path[_0x9b7a('0x51')](config[_0x9b7a('0x52')],_0x9b7a('0x53'),'files',_0x9b7a('0x54'));var _0x263c69=path['join'](config[_0x9b7a('0x52')],'server',_0x9b7a('0x55'),_0x9b7a('0x56'));var _0x248aa3=path[_0x9b7a('0x51')](_0x1aa63d,_0x94cf82);var _0x24ae75=util[_0x9b7a('0x49')](_0x9b7a('0x57'),_0x3362d8[_0x9b7a('0x2c')]['id'],_0x94cf82);var _0x46a525=path[_0x9b7a('0x51')](_0x1aa63d,_0x24ae75);var _0x374edd=[];_0x374edd[_0x9b7a('0x58')]({'model':db['User'],'as':'User','attributes':['id',_0x9b7a('0x59')],'raw':!![]});_0x374edd[_0x9b7a('0x58')]({'model':db[_0x9b7a('0x5a')],'as':_0x9b7a('0x5b'),'attributes':['id',_0x9b7a('0x5c'),_0x9b7a('0x5d')],'raw':!![]});if(_0x3362d8[_0x9b7a('0x28')][_0x9b7a('0x56')]){_0x374edd[_0x9b7a('0x58')]({'model':db[_0x9b7a('0x5e')],'as':_0x9b7a('0x5e'),'raw':!![]});}var _0x434025=[{'model':db['OpenchannelMessage'],'as':'Messages','attributes':['id',_0x9b7a('0x3a'),_0x9b7a('0x5f'),_0x9b7a('0x60'),'secret',_0x9b7a('0x61')],'include':_0x374edd}];_0x434025[_0x9b7a('0x58')]({'model':db[_0x9b7a('0x62')],'as':'Account','attributes':['id','name']});_0x434025[_0x9b7a('0x58')]({'model':db[_0x9b7a('0x63')],'as':_0x9b7a('0x64'),'attributes':['id','fullname']});return db[_0x9b7a('0x23')]['find']({'where':{'id':_0x3362d8[_0x9b7a('0x2c')]['id']},'include':_0x434025})['then'](handleEntityNotFound(_0x5d9057,null))['then'](function(_0x5a314c){if(_0x5a314c){var _0x244020=_0x5a314c[_0x9b7a('0x65')]({'plain':!![]});fs[_0x9b7a('0x66')](_0x248aa3);var _0x1fb57e={'channel':'Openchannel','account':_0x244020['Account'][_0x9b7a('0x1f')],'agent':_0x244020['Owner']?_0x244020[_0x9b7a('0x64')][_0x9b7a('0x59')]:_0x9b7a('0x67'),'createdAt':moment(_0x244020[_0x9b7a('0x5f')])[_0x9b7a('0x49')](_0x9b7a('0x68'))[_0x9b7a('0x50')](),'closedAt':_0x244020[_0x9b7a('0x69')]?moment(_0x244020[_0x9b7a('0x6a')])[_0x9b7a('0x49')](_0x9b7a('0x68'))['toString']():'','disposition':_0x244020[_0x9b7a('0x6b')],'visibility':_0x244020[_0x9b7a('0x6c')]?_0x9b7a('0x6d'):_0x9b7a('0x6e'),'messages':_(_0x244020['Messages'])[_0x9b7a('0x46')]({'secret':![]})[_0x9b7a('0x22')](function(_0x3bd272){if(_0x3bd272[_0x9b7a('0x5e')]){var _0x24bc0d=path[_0x9b7a('0x51')](_0x263c69,_0x3bd272[_0x9b7a('0x5e')][_0x9b7a('0x6f')]);if(fs[_0x9b7a('0x70')](_0x24bc0d)){fs[_0x9b7a('0x71')](_0x24bc0d)['pipe'](fs[_0x9b7a('0x72')](path[_0x9b7a('0x51')](_0x248aa3,_0x3bd272[_0x9b7a('0x5e')][_0x9b7a('0x6f')])));}}return{'date':moment(_0x3bd272[_0x9b7a('0x5f')])[_0x9b7a('0x49')]('YYYY-MM-DD\x20HH:mm:ss')[_0x9b7a('0x50')](),'sender':_0x3bd272[_0x9b7a('0x60')]==='out'?_0x3bd272[_0x9b7a('0x63')]?_0x3bd272['User'][_0x9b7a('0x59')]:_0x9b7a('0x73'):_0x3bd272[_0x9b7a('0x5b')][_0x9b7a('0x5c')]+(_0x3bd272[_0x9b7a('0x5b')]['lastName']?'\x20'+_0x3bd272[_0x9b7a('0x5b')][_0x9b7a('0x5d')]:''),'body':_0x3bd272[_0x9b7a('0x5e')]?_0x3bd272[_0x9b7a('0x5e')][_0x9b7a('0x6f')]:_0x3bd272['body'],'direction':_0x3bd272['direction']==='out'?'A':'C','secret':_0x3bd272[_0x9b7a('0x74')],'read':_0x3bd272[_0x9b7a('0x61')],'attachment':_0x3bd272[_0x9b7a('0x5e')]};})[_0x9b7a('0x75')]()};return ejs[_0x9b7a('0x76')](path[_0x9b7a('0x51')](config[_0x9b7a('0x52')],_0x9b7a('0x53'),'views',_0x9b7a('0x77')),{'interaction':_0x1fb57e})['then'](function(_0x2d4456){var _0x2b7f25=path[_0x9b7a('0x51')](_0x248aa3,_0x9b7a('0x78')+_0x244020['id']+'-'+_0x94cf82+_0x9b7a('0x79'));var _0x25316c={'path':_0x2b7f25,'channel':_0x9b7a('0x7a'),'interactionId':_0x244020['id']};return pdf[_0x9b7a('0x7b')](_0x2d4456,_0x25316c);})['then'](function(){return new Promise(function(_0x43439b,_0x2e6887){zipdir(_0x248aa3,{'saveTo':_0x46a525},function(_0x44c5c7,_0x12d527){if(_0x44c5c7)return _0x2e6887(_0x44c5c7);return _0x43439b(_0x12d527);});})[_0x9b7a('0x1c')](function(){return new Promise(function(_0x42ee46,_0x2cd37c){rimraf(_0x248aa3,function(_0x3a23b5){if(_0x3a23b5)_0x2cd37c(_0x3a23b5);return _0x42ee46();});});})[_0x9b7a('0x1c')](function(){return _0x5d9057[_0x9b7a('0x4e')](_0x46a525,_0x24ae75,function(_0xc58a2d){if(_0xc58a2d){logger[_0x9b7a('0x7c')](_0x9b7a('0x7d'),_0xc58a2d);}else{fs[_0x9b7a('0x7e')](_0x46a525);}});});});}else{return _0x5d9057[_0x9b7a('0x12')](0xc8);}})[_0x9b7a('0x3b')](handleError(_0x5d9057,null));}; \ No newline at end of file +var _0x8b9f=['Owner','N.A.','closed','closedAt','disposition','threadId','Public','basename','existsSync','createReadStream','pipe','createWriteStream','out','System','firstName','value','renderFile','views','downloadInteraction.ejs','transcript-','Openchannel','createPdfFromHTML','error','Unable\x20to\x20delete\x20zip\x20file','unlinkSync','rimraf','moment','util','path','ejs','lodash','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','../../config/environment','redis','./openchannelInteraction.socket','register','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','stack','name','send','index','OpenchannelInteraction','rawAttributes','fieldName','type','key','getOptions','openchannel','user','catch','show','query','from','params','keys','filters','intersection','model','attributes','fields','length','includeAll','include','merge','options','find','create','body','describe','OpenchannelMessage','addMessage','ids','omit','getMessages','hasOwnProperty','order','sort','where','pick','filter','map','$gte','split','YYYY-MM-DD\x20HH:mm:ss','findAll','rows','addTags','Tag','openchannelInteractionTags:save','removeTags','download','unix','toString','root','server','files','tmp','join','format','push','User','fullname','CmContact','Contact','lastName','attachments','Attachment','Messages','createdAt','direction','secret','read','OpenchannelAccount','Account','get','mkdirSync'];(function(_0x2f6233,_0x90172){var _0x1c9c36=function(_0x3ac680){while(--_0x3ac680){_0x2f6233['push'](_0x2f6233['shift']());}};_0x1c9c36(++_0x90172);}(_0x8b9f,0x9c));var _0xf8b9=function(_0x11b3f4,_0x371c17){_0x11b3f4=_0x11b3f4-0x0;var _0x47af1d=_0x8b9f[_0x11b3f4];return _0x47af1d;};'use strict';var rimraf=require(_0xf8b9('0x0'));var zipdir=require('zip-dir');var moment=require(_0xf8b9('0x1'));var util=require(_0xf8b9('0x2'));var path=require(_0xf8b9('0x3'));var ejs=require(_0xf8b9('0x4'));var fs=require('fs');var _=require(_0xf8b9('0x5'));var Redis=require('ioredis');var interaction=require(_0xf8b9('0x6'));var qs=require(_0xf8b9('0x7'));var pdf=require(_0xf8b9('0x8'));var logger=require(_0xf8b9('0x9'))(_0xf8b9('0xa'));var config=require(_0xf8b9('0xb'));var db=require('../../mysqldb')['db'];config[_0xf8b9('0xc')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf8b9('0xc')]));require(_0xf8b9('0xd'))[_0xf8b9('0xe')](socket);function respondWithStatusCode(_0x2e48e9,_0xad3d1c){_0xad3d1c=_0xad3d1c||0xcc;return function(_0x41100e){if(_0x41100e){return _0x2e48e9[_0xf8b9('0xf')](_0xad3d1c);}return _0x2e48e9[_0xf8b9('0x10')](_0xad3d1c)['end']();};}function respondWithResult(_0x225054,_0x141b7b){_0x141b7b=_0x141b7b||0xc8;return function(_0x51fa67){if(_0x51fa67){return _0x225054[_0xf8b9('0x10')](_0x141b7b)[_0xf8b9('0x11')](_0x51fa67);}};}function respondWithFilteredResult(_0x71575f,_0x2f965e){return function(_0x3b7944){if(_0x3b7944){var _0x381bfe=typeof _0x2f965e[_0xf8b9('0x12')]===_0xf8b9('0x13')&&typeof _0x2f965e[_0xf8b9('0x14')]===_0xf8b9('0x13');var _0x57bf2f=_0x3b7944[_0xf8b9('0x15')];var _0x3dfb75=_0x381bfe?0x0:_0x2f965e[_0xf8b9('0x12')];var _0x4b4047=_0x381bfe?_0x3b7944[_0xf8b9('0x15')]:_0x2f965e[_0xf8b9('0x12')]+_0x2f965e[_0xf8b9('0x14')];var _0x72f5cc;if(_0x4b4047>=_0x57bf2f){_0x4b4047=_0x57bf2f;_0x72f5cc=0xc8;}else{_0x72f5cc=0xce;}_0x71575f['status'](_0x72f5cc);return _0x71575f[_0xf8b9('0x16')](_0xf8b9('0x17'),_0x3dfb75+'-'+_0x4b4047+'/'+_0x57bf2f)[_0xf8b9('0x11')](_0x3b7944);}return null;};}function saveUpdates(_0x5d01fe){return function(_0x242730){if(_0x242730){return _0x242730[_0xf8b9('0x18')](_0x5d01fe)[_0xf8b9('0x19')](function(_0x599085){return _0x599085;});}return null;};}function removeEntity(_0xfb74f3){return function(_0x264ded){if(_0x264ded){return _0x264ded[_0xf8b9('0x1a')]()[_0xf8b9('0x19')](function(){_0xfb74f3[_0xf8b9('0x10')](0xcc)['end']();});}};}function handleEntityNotFound(_0x119790){return function(_0x5c7c22){if(!_0x5c7c22){_0x119790[_0xf8b9('0xf')](0x194);}return _0x5c7c22;};}function handleError(_0x3018a0,_0x15cc00){_0x15cc00=_0x15cc00||0x1f4;return function(_0x590364){logger['error'](_0x590364[_0xf8b9('0x1b')]);if(_0x590364['name']){delete _0x590364[_0xf8b9('0x1c')];}_0x3018a0[_0xf8b9('0x10')](_0x15cc00)[_0xf8b9('0x1d')](_0x590364);};}exports[_0xf8b9('0x1e')]=function(_0x33f16f,_0x484293){var _0x378e77={};var _0x3ab3bf=_['map'](db[_0xf8b9('0x1f')][_0xf8b9('0x20')],function(_0x54d74e){return{'name':_0x54d74e[_0xf8b9('0x21')],'type':_0x54d74e[_0xf8b9('0x22')][_0xf8b9('0x23')]};});_0x378e77=qs[_0xf8b9('0x24')](_0x3ab3bf,_0x33f16f);return interaction['findAll'](_0xf8b9('0x25'),_0x33f16f['query'],_0x33f16f[_0xf8b9('0x26')],_0x378e77,_0x3ab3bf)[_0xf8b9('0x19')](respondWithFilteredResult(_0x484293,_0x378e77))[_0xf8b9('0x27')](handleError(_0x484293,null));};exports[_0xf8b9('0x28')]=function(_0x45040a,_0x3c1eb4){var _0x14c55e={};if(_0x45040a['query'][_0xf8b9('0x22')]&&_0x45040a[_0xf8b9('0x29')][_0xf8b9('0x22')]===_0xf8b9('0x2a')){_0x14c55e[_0xf8b9('0x2a')]=_0x45040a[_0xf8b9('0x2b')]['id'];}else{_0x14c55e['id']=_0x45040a[_0xf8b9('0x2b')]['id'];}var _0x4e992a={'raw':![],'where':_0x14c55e},_0x4509e4={};_0x4509e4['model']=_[_0xf8b9('0x2c')](db['OpenchannelInteraction'][_0xf8b9('0x20')]);_0x4509e4[_0xf8b9('0x29')]=_[_0xf8b9('0x2c')](_0x45040a[_0xf8b9('0x29')]);_0x4509e4[_0xf8b9('0x2d')]=_[_0xf8b9('0x2e')](_0x4509e4[_0xf8b9('0x2f')],_0x4509e4[_0xf8b9('0x29')]);_0x4e992a[_0xf8b9('0x30')]=_[_0xf8b9('0x2e')](_0x4509e4[_0xf8b9('0x2f')],qs[_0xf8b9('0x31')](_0x45040a[_0xf8b9('0x29')]['fields']));_0x4e992a[_0xf8b9('0x30')]=_0x4e992a[_0xf8b9('0x30')][_0xf8b9('0x32')]?_0x4e992a[_0xf8b9('0x30')]:_0x4509e4[_0xf8b9('0x2f')];if(_0x45040a[_0xf8b9('0x29')][_0xf8b9('0x33')]){_0x4e992a[_0xf8b9('0x34')]=[{'all':!![]}];}_0x4e992a=_[_0xf8b9('0x35')]({},_0x4e992a,_0x45040a[_0xf8b9('0x36')]);return db[_0xf8b9('0x1f')][_0xf8b9('0x37')](_0x4e992a)[_0xf8b9('0x19')](handleEntityNotFound(_0x3c1eb4,null))[_0xf8b9('0x19')](respondWithResult(_0x3c1eb4,null))['catch'](handleError(_0x3c1eb4,null));};exports['create']=function(_0x37742d,_0xa97d43){return db['OpenchannelInteraction'][_0xf8b9('0x38')](_0x37742d[_0xf8b9('0x39')],{})[_0xf8b9('0x19')](respondWithResult(_0xa97d43,0xc9))[_0xf8b9('0x27')](handleError(_0xa97d43,null));};exports['update']=function(_0x16024e,_0xec5ecc){if(_0x16024e['body']['id']){delete _0x16024e[_0xf8b9('0x39')]['id'];}return db[_0xf8b9('0x1f')][_0xf8b9('0x37')]({'where':{'id':_0x16024e[_0xf8b9('0x2b')]['id']}})[_0xf8b9('0x19')](handleEntityNotFound(_0xec5ecc,null))[_0xf8b9('0x19')](saveUpdates(_0x16024e[_0xf8b9('0x39')],null))['then'](respondWithResult(_0xec5ecc,null))[_0xf8b9('0x27')](handleError(_0xec5ecc,null));};exports[_0xf8b9('0x1a')]=function(_0x5e5322,_0x191845){return db[_0xf8b9('0x1f')][_0xf8b9('0x37')]({'where':{'id':_0x5e5322[_0xf8b9('0x2b')]['id']}})['then'](handleEntityNotFound(_0x191845,null))[_0xf8b9('0x19')](removeEntity(_0x191845,null))[_0xf8b9('0x27')](handleError(_0x191845,null));};exports['describe']=function(_0x537f65,_0x37459b){return db['OpenchannelInteraction'][_0xf8b9('0x3a')]()[_0xf8b9('0x19')](respondWithResult(_0x37459b,null))[_0xf8b9('0x27')](handleError(_0x37459b,null));};exports['addMessage']=function(_0x5754ac,_0x574339){return db[_0xf8b9('0x3b')][_0xf8b9('0x37')]({'where':{'id':_0x5754ac['params']['id']}})[_0xf8b9('0x19')](handleEntityNotFound(_0x574339,null))['then'](function(_0x46ee52){if(_0x46ee52){return _0x46ee52[_0xf8b9('0x3c')](_0x5754ac['body'][_0xf8b9('0x3d')],_[_0xf8b9('0x3e')](_0x5754ac[_0xf8b9('0x39')],[_0xf8b9('0x3d'),'id'])||{});}})['then'](respondWithResult(_0x574339,null))['catch'](handleError(_0x574339,null));};exports[_0xf8b9('0x3f')]=function(_0x153524,_0x93cc93){var _0x1391a6={'raw':![],'where':{}};var _0x1531a9={};var _0x460cf7={'count':0x0,'rows':[]};return db[_0xf8b9('0x1f')]['findOne']({'where':{'id':_0x153524[_0xf8b9('0x2b')]['id']}})['then'](handleEntityNotFound(_0x93cc93,null))[_0xf8b9('0x19')](function(_0x51d60f){if(_0x51d60f){_0x1531a9[_0xf8b9('0x2f')]=_[_0xf8b9('0x2c')](db[_0xf8b9('0x3b')][_0xf8b9('0x20')]);_0x1531a9['query']=_[_0xf8b9('0x2c')](_0x153524[_0xf8b9('0x29')]);_0x1531a9[_0xf8b9('0x2d')]=_['intersection'](_0x1531a9[_0xf8b9('0x2f')],_0x1531a9[_0xf8b9('0x29')]);_0x1391a6[_0xf8b9('0x30')]=_[_0xf8b9('0x2e')](_0x1531a9['model'],qs[_0xf8b9('0x31')](_0x153524[_0xf8b9('0x29')][_0xf8b9('0x31')]));_0x1391a6[_0xf8b9('0x30')]=_0x1391a6[_0xf8b9('0x30')]['length']?_0x1391a6[_0xf8b9('0x30')]:_0x1531a9[_0xf8b9('0x2f')];if(!_0x153524[_0xf8b9('0x29')][_0xf8b9('0x40')]('nolimit')){_0x1391a6[_0xf8b9('0x14')]=qs['limit'](_0x153524[_0xf8b9('0x29')]['limit']);_0x1391a6[_0xf8b9('0x12')]=qs[_0xf8b9('0x12')](_0x153524[_0xf8b9('0x29')]['offset']);}_0x1391a6[_0xf8b9('0x41')]=qs[_0xf8b9('0x42')](_0x153524[_0xf8b9('0x29')][_0xf8b9('0x42')]);_0x1391a6[_0xf8b9('0x43')]=qs['filters'](_[_0xf8b9('0x44')](_0x153524[_0xf8b9('0x29')],_0x1531a9['filters']));_0x1391a6[_0xf8b9('0x43')]['OpenchannelInteractionId']=_0x51d60f['id'];if(_0x153524[_0xf8b9('0x29')][_0xf8b9('0x45')]){_0x1391a6[_0xf8b9('0x43')]=_['merge'](_0x1391a6['where'],{'$or':_[_0xf8b9('0x46')](_0x1391a6[_0xf8b9('0x30')],function(_0x58489b){var _0x5b4d06={};_0x5b4d06[_0x58489b]={'$like':'%'+_0x153524[_0xf8b9('0x29')][_0xf8b9('0x45')]+'%'};return _0x5b4d06;})});}if(_0x153524['query'][_0xf8b9('0x47')]){var _0x457aa4=_0x153524[_0xf8b9('0x29')][_0xf8b9('0x47')][_0xf8b9('0x48')](',');var _0x12eb32={};_0x12eb32[_0x457aa4[0x0]]={'$gte':moment(_0x457aa4[0x1])['format'](_0xf8b9('0x49'))};_0x1391a6[_0xf8b9('0x43')]=_[_0xf8b9('0x35')](_0x1391a6[_0xf8b9('0x43')],_0x12eb32);}_0x1391a6=_[_0xf8b9('0x35')]({},_0x1391a6,_0x153524[_0xf8b9('0x36')]);return db['OpenchannelMessage'][_0xf8b9('0x15')]({'where':_0x1391a6['where']})['then'](function(_0xf21d1a){_0x460cf7[_0xf8b9('0x15')]=_0xf21d1a;if(_0x153524['query'][_0xf8b9('0x33')]){_0x1391a6[_0xf8b9('0x34')]=[{'all':!![]}];}return db[_0xf8b9('0x3b')][_0xf8b9('0x4a')](_0x1391a6);})['then'](function(_0x39c268){_0x460cf7[_0xf8b9('0x4b')]=_0x39c268;return _0x460cf7;});}})[_0xf8b9('0x19')](respondWithFilteredResult(_0x93cc93,_0x1391a6))[_0xf8b9('0x27')](handleError(_0x93cc93,null));};exports[_0xf8b9('0x4c')]=function(_0x19056b,_0x4bddee){return db[_0xf8b9('0x1f')][_0xf8b9('0x37')]({'where':{'id':_0x19056b[_0xf8b9('0x2b')]['id']}})['then'](handleEntityNotFound(_0x4bddee,null))[_0xf8b9('0x19')](function(_0x5a55ab){if(_0x5a55ab){return _0x5a55ab['setTags'](_0x19056b[_0xf8b9('0x39')]['ids'],_[_0xf8b9('0x3e')](_0x19056b[_0xf8b9('0x39')],[_0xf8b9('0x3d'),'id'])||{})['spread'](function(){return db[_0xf8b9('0x4d')]['findAll']({'attributes':['id',_0xf8b9('0x1c'),'color'],'where':{'id':_0x19056b['body'][_0xf8b9('0x3d')]}});})[_0xf8b9('0x19')](function(_0x1d5c93){socket['emit'](_0xf8b9('0x4e'),{'id':Number(_0x19056b['params']['id']),'tags':_0x1d5c93||[]});return{'id':Number(_0x19056b['params']['id']),'tags':_0x1d5c93||[]};});}})[_0xf8b9('0x19')](respondWithResult(_0x4bddee,null))['catch'](handleError(_0x4bddee,null));};exports[_0xf8b9('0x4f')]=function(_0x2db546,_0x1de626){return db[_0xf8b9('0x1f')][_0xf8b9('0x37')]({'where':{'id':_0x2db546[_0xf8b9('0x2b')]['id']}})[_0xf8b9('0x19')](handleEntityNotFound(_0x1de626,null))[_0xf8b9('0x19')](function(_0x2c3032){if(_0x2c3032){return _0x2c3032[_0xf8b9('0x4f')](_0x2db546['query'][_0xf8b9('0x3d')]);}})[_0xf8b9('0x19')](respondWithStatusCode(_0x1de626,null))[_0xf8b9('0x27')](handleError(_0x1de626,null));};exports[_0xf8b9('0x50')]=function(_0x51c15d,_0x3b9a1b){var _0x2f2af4=moment()[_0xf8b9('0x51')]()[_0xf8b9('0x52')]();var _0x2e7964=path['join'](config[_0xf8b9('0x53')],_0xf8b9('0x54'),_0xf8b9('0x55'),_0xf8b9('0x56'));var _0x386286=path['join'](config[_0xf8b9('0x53')],_0xf8b9('0x54'),_0xf8b9('0x55'),'attachments');var _0x45716e=path[_0xf8b9('0x57')](_0x2e7964,_0x2f2af4);var _0x26c0ea=util[_0xf8b9('0x58')]('transcript-%d-%s.zip',_0x51c15d[_0xf8b9('0x2b')]['id'],_0x2f2af4);var _0x7d5ec6=path[_0xf8b9('0x57')](_0x2e7964,_0x26c0ea);var _0x55cb98=[];_0x55cb98[_0xf8b9('0x59')]({'model':db['User'],'as':_0xf8b9('0x5a'),'attributes':['id',_0xf8b9('0x5b')],'raw':!![]});_0x55cb98[_0xf8b9('0x59')]({'model':db[_0xf8b9('0x5c')],'as':_0xf8b9('0x5d'),'attributes':['id','firstName',_0xf8b9('0x5e')],'raw':!![]});if(_0x51c15d[_0xf8b9('0x29')][_0xf8b9('0x5f')]){_0x55cb98[_0xf8b9('0x59')]({'model':db['Attachment'],'as':_0xf8b9('0x60'),'raw':!![]});}var _0x19cbd8=[{'model':db['OpenchannelMessage'],'as':_0xf8b9('0x61'),'attributes':['id',_0xf8b9('0x39'),_0xf8b9('0x62'),_0xf8b9('0x63'),_0xf8b9('0x64'),_0xf8b9('0x65')],'include':_0x55cb98}];_0x19cbd8[_0xf8b9('0x59')]({'model':db[_0xf8b9('0x66')],'as':_0xf8b9('0x67'),'attributes':['id',_0xf8b9('0x1c')]});_0x19cbd8[_0xf8b9('0x59')]({'model':db[_0xf8b9('0x5a')],'as':'Owner','attributes':['id',_0xf8b9('0x5b')]});return db[_0xf8b9('0x1f')][_0xf8b9('0x37')]({'where':{'id':_0x51c15d[_0xf8b9('0x2b')]['id']},'include':_0x19cbd8})[_0xf8b9('0x19')](handleEntityNotFound(_0x3b9a1b,null))[_0xf8b9('0x19')](function(_0x4e5622){if(_0x4e5622){var _0xe73e54=_0x4e5622[_0xf8b9('0x68')]({'plain':!![]});fs[_0xf8b9('0x69')](_0x45716e);var _0x741b33={'channel':'Openchannel','account':_0xe73e54[_0xf8b9('0x67')][_0xf8b9('0x1c')],'agent':_0xe73e54[_0xf8b9('0x6a')]?_0xe73e54[_0xf8b9('0x6a')]['fullname']:_0xf8b9('0x6b'),'createdAt':moment(_0xe73e54['createdAt'])[_0xf8b9('0x58')](_0xf8b9('0x49'))['toString'](),'closedAt':_0xe73e54[_0xf8b9('0x6c')]?moment(_0xe73e54[_0xf8b9('0x6d')])[_0xf8b9('0x58')](_0xf8b9('0x49'))['toString']():'','disposition':_0xe73e54[_0xf8b9('0x6e')],'visibility':_0xe73e54[_0xf8b9('0x6f')]?_0xf8b9('0x70'):'Private','messages':_(_0xe73e54[_0xf8b9('0x61')])['filter']({'secret':![]})[_0xf8b9('0x46')](function(_0x3fd269){if(_0x3fd269['Attachment']){var _0x2b1f04=path[_0xf8b9('0x57')](_0x386286,_0x3fd269['Attachment'][_0xf8b9('0x71')]);if(fs[_0xf8b9('0x72')](_0x2b1f04)){fs[_0xf8b9('0x73')](_0x2b1f04)[_0xf8b9('0x74')](fs[_0xf8b9('0x75')](path[_0xf8b9('0x57')](_0x45716e,_0x3fd269[_0xf8b9('0x60')][_0xf8b9('0x71')])));}}return{'date':moment(_0x3fd269[_0xf8b9('0x62')])[_0xf8b9('0x58')](_0xf8b9('0x49'))[_0xf8b9('0x52')](),'sender':_0x3fd269[_0xf8b9('0x63')]===_0xf8b9('0x76')?_0x3fd269[_0xf8b9('0x5a')]?_0x3fd269[_0xf8b9('0x5a')][_0xf8b9('0x5b')]:_0xf8b9('0x77'):_0x3fd269[_0xf8b9('0x5d')][_0xf8b9('0x78')]+(_0x3fd269['Contact'][_0xf8b9('0x5e')]?'\x20'+_0x3fd269[_0xf8b9('0x5d')]['lastName']:''),'body':_0x3fd269[_0xf8b9('0x60')]?_0x3fd269[_0xf8b9('0x60')][_0xf8b9('0x71')]:_0x3fd269[_0xf8b9('0x39')],'direction':_0x3fd269[_0xf8b9('0x63')]===_0xf8b9('0x76')?'A':'C','secret':_0x3fd269[_0xf8b9('0x64')],'read':_0x3fd269[_0xf8b9('0x65')],'attachment':_0x3fd269[_0xf8b9('0x60')]};})[_0xf8b9('0x79')]()};return ejs[_0xf8b9('0x7a')](path[_0xf8b9('0x57')](config['root'],_0xf8b9('0x54'),_0xf8b9('0x7b'),_0xf8b9('0x7c')),{'interaction':_0x741b33})['then'](function(_0x30c8dc){var _0x2ea10c=path[_0xf8b9('0x57')](_0x45716e,_0xf8b9('0x7d')+_0xe73e54['id']+'-'+_0x2f2af4+'.pdf');var _0xb50483={'path':_0x2ea10c,'channel':_0xf8b9('0x7e'),'interactionId':_0xe73e54['id']};return pdf[_0xf8b9('0x7f')](_0x30c8dc,_0xb50483);})[_0xf8b9('0x19')](function(){return new Promise(function(_0x6e57b1,_0x12580e){zipdir(_0x45716e,{'saveTo':_0x7d5ec6},function(_0x49af40,_0x161a4a){if(_0x49af40)return _0x12580e(_0x49af40);return _0x6e57b1(_0x161a4a);});})[_0xf8b9('0x19')](function(){return new Promise(function(_0x3ee4f2,_0x12d095){rimraf(_0x45716e,function(_0x36ea98){if(_0x36ea98)_0x12d095(_0x36ea98);return _0x3ee4f2();});});})[_0xf8b9('0x19')](function(){return _0x3b9a1b['download'](_0x7d5ec6,_0x26c0ea,function(_0x589c56){if(_0x589c56){logger[_0xf8b9('0x80')](_0xf8b9('0x81'),_0x589c56);}else{fs[_0xf8b9('0x82')](_0x7d5ec6);}});});});}else{return _0x3b9a1b['sendStatus'](0xc8);}})[_0xf8b9('0x27')](handleError(_0x3b9a1b,null));}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.events.js b/server/api/openchannelInteraction/openchannelInteraction.events.js index 1ba9cb8..b9f4b0a 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 _0x792a=['map','findAll','unreadMessages','length','emit','catch','hook','../../mysqldb','OpenchannelInteraction','OpenchannelMessage','save','update','then','setDataValue'];(function(_0x4d8ab4,_0x5b7621){var _0x400a78=function(_0x3dff03){while(--_0x3dff03){_0x4d8ab4['push'](_0x4d8ab4['shift']());}};_0x400a78(++_0x5b7621);}(_0x792a,0x77));var _0xa792=function(_0x530c97,_0x59f3ba){_0x530c97=_0x530c97-0x0;var _0x29be8b=_0x792a[_0x530c97];return _0x29be8b;};'use strict';var EventEmitter=require('events');var OpenchannelInteraction=require(_0xa792('0x0'))['db'][_0xa792('0x1')];var OpenchannelMessage=require('../../mysqldb')['db'][_0xa792('0x2')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xa792('0x3'),'afterUpdate':_0xa792('0x4'),'afterDestroy':'remove'};function emitEvent(_0x447b93){return function(_0x5638ed,_0x162a54,_0x29f748){_0x5638ed['getUsers']({'attributes':['id'],'raw':!![]})[_0xa792('0x5')](function(_0x22698e){_0x5638ed[_0xa792('0x6')]('Users',_0x22698e[_0xa792('0x7')](function(_0x1e7ede){return{'id':_0x1e7ede['id']};}));return OpenchannelMessage[_0xa792('0x8')]({'where':{'OpenchannelInteractionId':_0x5638ed['id'],'direction':'in','read':![]},'raw':!![]});})[_0xa792('0x5')](function(_0x1d9f3a){_0x5638ed[_0xa792('0x6')](_0xa792('0x9'),_0x1d9f3a[_0xa792('0xa')]);OpenchannelInteractionEvents[_0xa792('0xb')](_0x447b93+':'+_0x5638ed['id'],_0x5638ed);OpenchannelInteractionEvents[_0xa792('0xb')](_0x447b93,_0x5638ed);_0x29f748(null);})[_0xa792('0xc')](_0x29f748(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelInteraction[_0xa792('0xd')](e,emitEvent(event));}}module['exports']=OpenchannelInteractionEvents; \ No newline at end of file +var _0x12c8=['OpenchannelInteraction','../../mysqldb','save','update','remove','setDataValue','map','findAll','then','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports'];(function(_0xb42a38,_0x18c10e){var _0x121cd2=function(_0x132167){while(--_0x132167){_0xb42a38['push'](_0xb42a38['shift']());}};_0x121cd2(++_0x18c10e);}(_0x12c8,0x1d0));var _0x812c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x12c8[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require('events');var OpenchannelInteraction=require('../../mysqldb')['db'][_0x812c('0x0')];var OpenchannelMessage=require(_0x812c('0x1'))['db']['OpenchannelMessage'];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x812c('0x2'),'afterUpdate':_0x812c('0x3'),'afterDestroy':_0x812c('0x4')};function emitEvent(_0x40926f){return function(_0x256d83,_0x360d2e,_0x4187b8){_0x256d83['getUsers']({'attributes':['id'],'raw':!![]})['then'](function(_0xb3c99b){_0x256d83[_0x812c('0x5')]('Users',_0xb3c99b[_0x812c('0x6')](function(_0x5d21f9){return{'id':_0x5d21f9['id']};}));return OpenchannelMessage[_0x812c('0x7')]({'where':{'OpenchannelInteractionId':_0x256d83['id'],'direction':'in','read':![]},'raw':!![]});})[_0x812c('0x8')](function(_0x34abbe){_0x256d83[_0x812c('0x5')](_0x812c('0x9'),_0x34abbe[_0x812c('0xa')]);OpenchannelInteractionEvents[_0x812c('0xb')](_0x40926f+':'+_0x256d83['id'],_0x256d83);OpenchannelInteractionEvents[_0x812c('0xb')](_0x40926f,_0x256d83);_0x4187b8(null);})[_0x812c('0xc')](_0x4187b8(null));};}for(var e in events){if(events[_0x812c('0xd')](e)){var event=events[e];OpenchannelInteraction[_0x812c('0xe')](e,emitEvent(event));}}module[_0x812c('0xf')]=OpenchannelInteractionEvents; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.model.js b/server/api/openchannelInteraction/openchannelInteraction.model.js index 1c50a12..69a4313 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 _0x4615=['openchannel_interactions','utf8mb4','utf8mb4_unicode_ci','changed','closed','format','YYYY-MM-DD\x20HH:mm:ss','util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./openchannelInteraction.attributes','exports','define'];(function(_0x1e8461,_0x5e1500){var _0x528f4d=function(_0x217227){while(--_0x217227){_0x1e8461['push'](_0x1e8461['shift']());}};_0x528f4d(++_0x5e1500);}(_0x4615,0x139));var _0x5461=function(_0x583bfe,_0x360c15){_0x583bfe=_0x583bfe-0x0;var _0x225d58=_0x4615[_0x583bfe];return _0x225d58;};'use strict';var _=require('lodash');var util=require(_0x5461('0x0'));var logger=require(_0x5461('0x1'))(_0x5461('0x2'));var moment=require(_0x5461('0x3'));var BPromise=require(_0x5461('0x4'));var rp=require(_0x5461('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x5461('0x6'));var attributes=require(_0x5461('0x7'));module[_0x5461('0x8')]=function(_0x11be2b,_0x3bf0cc){return _0x11be2b[_0x5461('0x9')]('OpenchannelInteraction',attributes,{'tableName':_0x5461('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x5461('0xb'),'collate':_0x5461('0xc'),'hooks':{'beforeUpdate':function(_0x23212c,_0x41df43,_0x437326){if(_0x23212c[_0x5461('0xd')](_0x5461('0xe'))){_0x23212c['closedAt']=moment()[_0x5461('0xf')](_0x5461('0x10'));}_0x437326(null,_0x23212c);}}});}; \ No newline at end of file +var _0xdc50=['closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','moment','request-promise','path','../../config/environment','./openchannelInteraction.attributes','exports','define','OpenchannelInteraction','openchannel_interactions','closed'];(function(_0x3fb63b,_0x376d67){var _0x22c858=function(_0x40b4f7){while(--_0x40b4f7){_0x3fb63b['push'](_0x3fb63b['shift']());}};_0x22c858(++_0x376d67);}(_0xdc50,0x143));var _0x0dc5=function(_0x42e891,_0x2fbfe2){_0x42e891=_0x42e891-0x0;var _0x2fb8ef=_0xdc50[_0x42e891];return _0x2fb8ef;};'use strict';var _=require(_0x0dc5('0x0'));var util=require(_0x0dc5('0x1'));var logger=require(_0x0dc5('0x2'))('api');var moment=require(_0x0dc5('0x3'));var BPromise=require('bluebird');var rp=require(_0x0dc5('0x4'));var fs=require('fs');var path=require(_0x0dc5('0x5'));var rimraf=require('rimraf');var config=require(_0x0dc5('0x6'));var attributes=require(_0x0dc5('0x7'));module[_0x0dc5('0x8')]=function(_0x647336,_0x54e87c){return _0x647336[_0x0dc5('0x9')](_0x0dc5('0xa'),attributes,{'tableName':_0x0dc5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci','hooks':{'beforeUpdate':function(_0x33ef66,_0x3f0fab,_0x2d234c){if(_0x33ef66['changed'](_0x0dc5('0xc'))){_0x33ef66[_0x0dc5('0xd')]=moment()[_0x0dc5('0xe')](_0x0dc5('0xf'));}_0x2d234c(null,_0x33ef66);}}});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.rpc.js b/server/api/openchannelInteraction/openchannelInteraction.rpc.js index f1ca6d9..5c4d248 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 _0x1e80=['../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','register','request','info','OpenchannelInteraction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','update','options','raw','attributes','limit','then','UpdateOpenchannelInteraction','AddTagsToOpenchannelInteraction','OpenchannelInteraction','find','body','ids','spread','AddTags','lodash','util','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x3f0be2,_0x3c51da){var _0xa0888b=function(_0x553996){while(--_0x553996){_0x3f0be2['push'](_0x3f0be2['shift']());}};_0xa0888b(++_0x3c51da);}(_0x1e80,0x72));var _0x01e8=function(_0x52dea9,_0x55a1f2){_0x52dea9=_0x52dea9-0x0;var _0x508a7c=_0x1e80[_0x52dea9];return _0x508a7c;};'use strict';var _=require(_0x01e8('0x0'));var util=require(_0x01e8('0x1'));var moment=require('moment');var BPromise=require(_0x01e8('0x2'));var rs=require(_0x01e8('0x3'));var fs=require('fs');var Redis=require(_0x01e8('0x4'));var db=require(_0x01e8('0x5'))['db'];var utils=require(_0x01e8('0x6'));var logger=require('../../config/logger')(_0x01e8('0x7'));var config=require(_0x01e8('0x8'));var jayson=require(_0x01e8('0x9'));var client=jayson[_0x01e8('0xa')][_0x01e8('0xb')]({'port':0x232a});config[_0x01e8('0xc')]=_[_0x01e8('0xd')](config[_0x01e8('0xc')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./openchannelInteraction.socket')[_0x01e8('0xe')](socket);function respondWithRpcPromise(_0x2501a5,_0x162c5f,_0x49b845){return new BPromise(function(_0x2115da,_0x240608){return client[_0x01e8('0xf')](_0x2501a5,_0x49b845)['then'](function(_0x4df161){logger[_0x01e8('0x10')](_0x01e8('0x11'),_0x162c5f,_0x01e8('0x12'));logger[_0x01e8('0x13')]('OpenchannelInteraction,\x20%s,\x20%s,\x20%s',_0x162c5f,'request\x20sent',JSON[_0x01e8('0x14')](_0x4df161));if(_0x4df161[_0x01e8('0x15')]){if(_0x4df161[_0x01e8('0x15')][_0x01e8('0x16')]===0x1f4){logger[_0x01e8('0x15')](_0x01e8('0x11'),_0x162c5f,_0x4df161['error'][_0x01e8('0x17')]);return _0x240608(_0x4df161[_0x01e8('0x15')][_0x01e8('0x17')]);}logger[_0x01e8('0x15')](_0x01e8('0x11'),_0x162c5f,_0x4df161[_0x01e8('0x15')][_0x01e8('0x17')]);return _0x2115da(_0x4df161[_0x01e8('0x15')][_0x01e8('0x17')]);}else{logger[_0x01e8('0x10')](_0x01e8('0x11'),_0x162c5f,_0x01e8('0x12'));_0x2115da(_0x4df161[_0x01e8('0x18')]['message']);}})[_0x01e8('0x19')](function(_0x5c5a49){logger[_0x01e8('0x15')](_0x01e8('0x11'),_0x162c5f,_0x5c5a49);_0x240608(_0x5c5a49);});});}exports['UpdateOpenchannelInteraction']=function(_0x29b82b){var _0x30dc1b=this;return new Promise(function(_0x1bb838,_0x39fb81){return db['OpenchannelInteraction'][_0x01e8('0x1a')](_0x29b82b['body'],{'raw':_0x29b82b[_0x01e8('0x1b')]?_0x29b82b[_0x01e8('0x1b')][_0x01e8('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x29b82b[_0x01e8('0x1b')]?_0x29b82b[_0x01e8('0x1b')]['where']||null:null,'attributes':_0x29b82b[_0x01e8('0x1b')]?_0x29b82b[_0x01e8('0x1b')][_0x01e8('0x1d')]||null:null,'limit':_0x29b82b[_0x01e8('0x1b')]?_0x29b82b[_0x01e8('0x1b')][_0x01e8('0x1e')]||null:null})[_0x01e8('0x1f')](function(_0x350190){logger['info'](_0x01e8('0x20'),_0x29b82b);logger['debug'](_0x01e8('0x20'),_0x29b82b,JSON[_0x01e8('0x14')](_0x350190));_0x1bb838(_0x350190);})[_0x01e8('0x19')](function(_0x252507){logger[_0x01e8('0x15')]('UpdateOpenchannelInteraction',_0x252507[_0x01e8('0x17')],_0x29b82b);_0x39fb81(_0x30dc1b['error'](0x1f4,_0x252507[_0x01e8('0x17')]));});});};exports[_0x01e8('0x21')]=function(_0xd4ce23){return new Promise(function(_0x33338b,_0x2d509e){return db[_0x01e8('0x22')][_0x01e8('0x23')]({'where':_0xd4ce23['options']?_0xd4ce23[_0x01e8('0x1b')]['where']||null:null})[_0x01e8('0x1f')](function(_0x562101){if(_0x562101){return _0x562101['addTags'](_0xd4ce23[_0x01e8('0x24')][_0x01e8('0x25')],_['omit'](_0xd4ce23[_0x01e8('0x24')],[_0x01e8('0x25'),'id'])||{});}})[_0x01e8('0x26')](function(_0x1c7a80){logger[_0x01e8('0x10')]('AddTags',_0xd4ce23);logger[_0x01e8('0x13')]('AddTags',_0xd4ce23,JSON['stringify'](_0x1c7a80));_0x33338b(_0x1c7a80);})[_0x01e8('0x19')](function(_0x4f9544){logger[_0x01e8('0x15')](_0x01e8('0x27'),_0x4f9544[_0x01e8('0x17')],_0xd4ce23);_0x2d509e(_this[_0x01e8('0x15')](0x1f4,_0x4f9544['message']));});});}; \ No newline at end of file +var _0xc64b=['update','body','options','raw','attributes','limit','AddTagsToOpenchannelInteraction','find','where','addTags','omit','ids','spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./openchannelInteraction.socket','register','then','OpenchannelInteraction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','UpdateOpenchannelInteraction','OpenchannelInteraction'];(function(_0x4a6932,_0x333e34){var _0x39db74=function(_0x2c28f0){while(--_0x2c28f0){_0x4a6932['push'](_0x4a6932['shift']());}};_0x39db74(++_0x333e34);}(_0xc64b,0x19a));var _0xbc64=function(_0x6c8b9b,_0xc36fb5){_0x6c8b9b=_0x6c8b9b-0x0;var _0x3c9b08=_0xc64b[_0x6c8b9b];return _0x3c9b08;};'use strict';var _=require(_0xbc64('0x0'));var util=require(_0xbc64('0x1'));var moment=require(_0xbc64('0x2'));var BPromise=require(_0xbc64('0x3'));var rs=require(_0xbc64('0x4'));var fs=require('fs');var Redis=require(_0xbc64('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xbc64('0x6'));var logger=require('../../config/logger')(_0xbc64('0x7'));var config=require(_0xbc64('0x8'));var jayson=require(_0xbc64('0x9'));var client=jayson[_0xbc64('0xa')][_0xbc64('0xb')]({'port':0x232a});config[_0xbc64('0xc')]=_[_0xbc64('0xd')](config[_0xbc64('0xc')],{'host':_0xbc64('0xe'),'port':0x18eb});var socket=require(_0xbc64('0xf'))(new Redis(config[_0xbc64('0xc')]));require(_0xbc64('0x10'))[_0xbc64('0x11')](socket);function respondWithRpcPromise(_0x228092,_0x42586c,_0x417062){return new BPromise(function(_0x3117ca,_0x46f7d9){return client['request'](_0x228092,_0x417062)[_0xbc64('0x12')](function(_0x320f97){logger['info'](_0xbc64('0x13'),_0x42586c,_0xbc64('0x14'));logger[_0xbc64('0x15')]('OpenchannelInteraction,\x20%s,\x20%s,\x20%s',_0x42586c,'request\x20sent',JSON[_0xbc64('0x16')](_0x320f97));if(_0x320f97[_0xbc64('0x17')]){if(_0x320f97[_0xbc64('0x17')][_0xbc64('0x18')]===0x1f4){logger[_0xbc64('0x17')](_0xbc64('0x13'),_0x42586c,_0x320f97[_0xbc64('0x17')][_0xbc64('0x19')]);return _0x46f7d9(_0x320f97['error'][_0xbc64('0x19')]);}logger['error'](_0xbc64('0x13'),_0x42586c,_0x320f97['error'][_0xbc64('0x19')]);return _0x3117ca(_0x320f97[_0xbc64('0x17')][_0xbc64('0x19')]);}else{logger[_0xbc64('0x1a')](_0xbc64('0x13'),_0x42586c,_0xbc64('0x14'));_0x3117ca(_0x320f97['result']['message']);}})[_0xbc64('0x1b')](function(_0x434459){logger[_0xbc64('0x17')]('OpenchannelInteraction,\x20%s,\x20%s',_0x42586c,_0x434459);_0x46f7d9(_0x434459);});});}exports[_0xbc64('0x1c')]=function(_0x17bb52){var _0x48c0df=this;return new Promise(function(_0x1958f0,_0x80ae97){return db[_0xbc64('0x1d')][_0xbc64('0x1e')](_0x17bb52[_0xbc64('0x1f')],{'raw':_0x17bb52[_0xbc64('0x20')]?_0x17bb52[_0xbc64('0x20')][_0xbc64('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x17bb52[_0xbc64('0x20')]?_0x17bb52[_0xbc64('0x20')]['where']||null:null,'attributes':_0x17bb52[_0xbc64('0x20')]?_0x17bb52[_0xbc64('0x20')][_0xbc64('0x22')]||null:null,'limit':_0x17bb52[_0xbc64('0x20')]?_0x17bb52[_0xbc64('0x20')][_0xbc64('0x23')]||null:null})['then'](function(_0x49dd69){logger[_0xbc64('0x1a')](_0xbc64('0x1c'),_0x17bb52);logger[_0xbc64('0x15')]('UpdateOpenchannelInteraction',_0x17bb52,JSON[_0xbc64('0x16')](_0x49dd69));_0x1958f0(_0x49dd69);})[_0xbc64('0x1b')](function(_0x5341bd){logger[_0xbc64('0x17')](_0xbc64('0x1c'),_0x5341bd[_0xbc64('0x19')],_0x17bb52);_0x80ae97(_0x48c0df[_0xbc64('0x17')](0x1f4,_0x5341bd[_0xbc64('0x19')]));});});};exports[_0xbc64('0x24')]=function(_0x137cc7){return new Promise(function(_0x26ff49,_0x3a2104){return db['OpenchannelInteraction'][_0xbc64('0x25')]({'where':_0x137cc7[_0xbc64('0x20')]?_0x137cc7[_0xbc64('0x20')][_0xbc64('0x26')]||null:null})[_0xbc64('0x12')](function(_0x2d703f){if(_0x2d703f){return _0x2d703f[_0xbc64('0x27')](_0x137cc7['body']['ids'],_[_0xbc64('0x28')](_0x137cc7['body'],[_0xbc64('0x29'),'id'])||{});}})[_0xbc64('0x2a')](function(_0xc82172){logger[_0xbc64('0x1a')](_0xbc64('0x2b'),_0x137cc7);logger[_0xbc64('0x15')](_0xbc64('0x2b'),_0x137cc7,JSON[_0xbc64('0x16')](_0xc82172));_0x26ff49(_0xc82172);})['catch'](function(_0x89350d){logger[_0xbc64('0x17')]('AddTags',_0x89350d['message'],_0x137cc7);_0x3a2104(_this[_0xbc64('0x17')](0x1f4,_0x89350d[_0xbc64('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.socket.js b/server/api/openchannelInteraction/openchannelInteraction.socket.js index c8c6033..44be86b 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 _0x1e38=['remove','update','emit','removeListener','register','length','openchannelInteraction:','save'];(function(_0x27faff,_0x4b92c0){var _0x24555d=function(_0x4986f2){while(--_0x4986f2){_0x27faff['push'](_0x27faff['shift']());}};_0x24555d(++_0x4b92c0);}(_0x1e38,0x1bf));var _0x81e3=function(_0x336ca2,_0x1a813a){_0x336ca2=_0x336ca2-0x0;var _0xda59a6=_0x1e38[_0x336ca2];return _0xda59a6;};'use strict';var OpenchannelInteractionEvents=require('./openchannelInteraction.events');var events=[_0x81e3('0x0'),_0x81e3('0x1'),_0x81e3('0x2')];function createListener(_0x561bac,_0x555c90){return function(_0x244c14){_0x555c90[_0x81e3('0x3')](_0x561bac,_0x244c14);};}function removeListener(_0x41d05a,_0x247c31){return function(){OpenchannelInteractionEvents[_0x81e3('0x4')](_0x41d05a,_0x247c31);};}exports[_0x81e3('0x5')]=function(_0x3baff7){for(var _0x77bb19=0x0,_0x473db3=events[_0x81e3('0x6')];_0x77bb19<_0x473db3;_0x77bb19++){var _0x3bf265=events[_0x77bb19];var _0x350891=createListener(_0x81e3('0x7')+_0x3bf265,_0x3baff7);OpenchannelInteractionEvents['on'](_0x3bf265,_0x350891);}}; \ No newline at end of file +var _0xd1d9=['save','remove','update','emit','removeListener','register','length','./openchannelInteraction.events'];(function(_0x26dc85,_0x125f6c){var _0x1b7ff7=function(_0x1f1d05){while(--_0x1f1d05){_0x26dc85['push'](_0x26dc85['shift']());}};_0x1b7ff7(++_0x125f6c);}(_0xd1d9,0x1cf));var _0x9d1d=function(_0x322522,_0x4db288){_0x322522=_0x322522-0x0;var _0x293bcf=_0xd1d9[_0x322522];return _0x293bcf;};'use strict';var OpenchannelInteractionEvents=require(_0x9d1d('0x0'));var events=[_0x9d1d('0x1'),_0x9d1d('0x2'),_0x9d1d('0x3')];function createListener(_0x2ed90a,_0x3a0d81){return function(_0x4d8adf){_0x3a0d81[_0x9d1d('0x4')](_0x2ed90a,_0x4d8adf);};}function removeListener(_0x53f973,_0x5f3461){return function(){OpenchannelInteractionEvents[_0x9d1d('0x5')](_0x53f973,_0x5f3461);};}exports[_0x9d1d('0x6')]=function(_0xf0e583){for(var _0x536b4f=0x0,_0x113722=events[_0x9d1d('0x7')];_0x536b4f<_0x113722;_0x536b4f++){var _0x5a5a1c=events[_0x536b4f];var _0x3a9c39=createListener('openchannelInteraction:'+_0x5a5a1c,_0xf0e583);OpenchannelInteractionEvents['on'](_0x5a5a1c,_0x3a9c39);}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/index.js b/server/api/openchannelMessage/index.js index 66cc938..828decd 100644 --- a/server/api/openchannelMessage/index.js +++ b/server/api/openchannelMessage/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x70e0=['put','update','/:id/accept','accept','destroy','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./openchannelMessage.controller','isAuthenticated','describe','get','/:id','show','post','openchannel','openchannelmessage:create','create'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x70e0,0x17b));var _0x070e=function(_0x46917b,_0x108fd3){_0x46917b=_0x46917b-0x0;var _0x25d835=_0x70e0[_0x46917b];return _0x25d835;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');var controller=require(_0x070e('0x7'));router['get']('/',auth[_0x070e('0x8')](),controller['index']);router['get']('/describe',auth[_0x070e('0x8')](),controller[_0x070e('0x9')]);router[_0x070e('0xa')](_0x070e('0xb'),auth[_0x070e('0x8')](),controller[_0x070e('0xc')]);router[_0x070e('0xd')]('/',auth['isAuthenticated'](),interaction['tracked'](_0x070e('0xe'),_0x070e('0xf')),controller[_0x070e('0x10')]);router[_0x070e('0x11')](_0x070e('0xb'),auth[_0x070e('0x8')](),controller[_0x070e('0x12')]);router[_0x070e('0x11')](_0x070e('0x13'),auth[_0x070e('0x8')](),controller[_0x070e('0x14')]);router['put']('/:id/reject',auth[_0x070e('0x8')](),controller['reject']);router['delete']('/:id',auth[_0x070e('0x8')](),controller[_0x070e('0x15')]);module['exports']=router; \ No newline at end of file +var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','tracked','openchannel','openchannelmessage:create','put','update','/:id/accept','accept','/:id/reject','reject','delete','destroy','multer','util'];(function(_0xa4d072,_0x2f957f){var _0x460a79=function(_0x25fddd){while(--_0x25fddd){_0xa4d072['push'](_0xa4d072['shift']());}};_0x460a79(++_0x2f957f);}(_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('./openchannelMessage.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')](),interaction[_0x0d8b('0xe')](_0x0d8b('0xf'),_0x0d8b('0x10')),controller['create']);router[_0x0d8b('0x11')]('/:id',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x12')]);router[_0x0d8b('0x11')](_0x0d8b('0x13'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x14')]);router[_0x0d8b('0x11')](_0x0d8b('0x15'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x16')]);router[_0x0d8b('0x17')](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x18')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.attributes.js b/server/api/openchannelMessage/openchannelMessage.attributes.js index 28afe74..fe0b9c2 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 _0xe820=['sequelize','TEXT','BOOLEAN','ENUM','out','DATE'];(function(_0x3ec4e3,_0x15aab4){var _0x38ee8c=function(_0x439303){while(--_0x439303){_0x3ec4e3['push'](_0x3ec4e3['shift']());}};_0x38ee8c(++_0x15aab4);}(_0xe820,0xd2));var _0x0e82=function(_0x155b9e,_0x1bf03a){_0x155b9e=_0x155b9e-0x0;var _0x11e236=_0xe820[_0x155b9e];return _0x11e236;};'use strict';var Sequelize=require(_0x0e82('0x0'));module['exports']={'body':{'type':Sequelize[_0x0e82('0x1')]('medium'),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize[_0x0e82('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0x0e82('0x3')]('in',_0x0e82('0x4')),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize[_0x0e82('0x5')]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0x0e82('0x1')]}}; \ No newline at end of file +var _0x6215=['out','DATE','sequelize','exports','TEXT','BOOLEAN','ENUM'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x6215,0x198));var _0x5621=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6215[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x5621('0x0'));module[_0x5621('0x1')]={'body':{'type':Sequelize[_0x5621('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x5621('0x3')],'defaultValue':![]},'secret':{'type':Sequelize[_0x5621('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x5621('0x4')]('in',_0x5621('0x5')),'defaultValue':_0x5621('0x5'),'allowNull':![]},'readAt':{'type':Sequelize[_0x5621('0x6')]},'providerName':{'type':Sequelize['STRING']},'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 bbe12df..e199ef8 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 _0xfa62=['event','accept','OpenchannelInteraction','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','contact','User','SIP/%s','motionChannel','EventManager','rejectmessage','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./openchannelMessage.socket','register','jayson/promise','client','http','request','then','info','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','OpenchannelMessage,\x20%s,\x20%s','message','result','catch','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','end','stack','name','send','map','OpenchannelMessage','rawAttributes','fieldName','type','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','merge','options','includeAll','include','rows','show','keys','find','create','body','params','destroy','describe','openchannel-interactions','openchannel','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','get','OpenchannelInteractionId','read1stAt','interaction','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','stringify','null','AcceptMessage','acceptMessage','ContactId','sequelize','Sequelize','QueryTypes','SELECT','fullname','email','internal','interface','channel'];(function(_0x5f1391,_0x19c132){var _0x50ebe3=function(_0x3d00a3){while(--_0x3d00a3){_0x5f1391['push'](_0x5f1391['shift']());}};_0x50ebe3(++_0x19c132);}(_0xfa62,0x120));var _0x2fa6=function(_0x585aa5,_0x200ab7){_0x585aa5=_0x585aa5-0x0;var _0x530b50=_0xfa62[_0x585aa5];return _0x530b50;};'use strict';var emlformat=require(_0x2fa6('0x0'));var rimraf=require(_0x2fa6('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2fa6('0x2'));var rp=require(_0x2fa6('0x3'));var moment=require(_0x2fa6('0x4'));var BPromise=require(_0x2fa6('0x5'));var Mustache=require(_0x2fa6('0x6'));var util=require(_0x2fa6('0x7'));var path=require(_0x2fa6('0x8'));var sox=require('sox');var csv=require(_0x2fa6('0x9'));var ejs=require(_0x2fa6('0xa'));var fs=require('fs');var fs_extra=require(_0x2fa6('0xb'));var _=require(_0x2fa6('0xc'));var squel=require(_0x2fa6('0xd'));var crypto=require(_0x2fa6('0xe'));var jsforce=require(_0x2fa6('0xf'));var deskjs=require(_0x2fa6('0x10'));var toCsv=require('to-csv');var querystring=require(_0x2fa6('0x11'));var Papa=require(_0x2fa6('0x12'));var Redis=require(_0x2fa6('0x13'));var authService=require(_0x2fa6('0x14'));var qs=require(_0x2fa6('0x15'));var as=require(_0x2fa6('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2fa6('0x17'))(_0x2fa6('0x18'));var utils=require(_0x2fa6('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0x2fa6('0x1a'));var db=require(_0x2fa6('0x1b'))['db'];config[_0x2fa6('0x1c')]=_[_0x2fa6('0x1d')](config[_0x2fa6('0x1c')],{'host':'localhost','port':0x18eb});var socket=require(_0x2fa6('0x1e'))(new Redis(config[_0x2fa6('0x1c')]));require(_0x2fa6('0x1f'))[_0x2fa6('0x20')](socket);var jayson=require(_0x2fa6('0x21'));var client=jayson[_0x2fa6('0x22')][_0x2fa6('0x23')]({'port':0x232c});var client9002=jayson[_0x2fa6('0x22')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2db44e,_0x31993d,_0x80dc16,_0x379736){return new BPromise(function(_0x497f2c,_0x51096f){var _0x2c115e=_0x379736||client;return _0x2c115e[_0x2fa6('0x24')](_0x2db44e,_0x80dc16)[_0x2fa6('0x25')](function(_0x105492){logger[_0x2fa6('0x26')]('OpenchannelMessage,\x20%s,\x20%s',_0x31993d,'request\x20sent');logger[_0x2fa6('0x27')](_0x2fa6('0x28'),_0x31993d,_0x2fa6('0x29'),JSON['stringify'](_0x105492));if(_0x105492[_0x2fa6('0x2a')]){if(_0x105492['error'][_0x2fa6('0x2b')]===0x1f4){logger['error'](_0x2fa6('0x2c'),_0x31993d,_0x105492['error'][_0x2fa6('0x2d')]);return _0x51096f(_0x105492[_0x2fa6('0x2a')][_0x2fa6('0x2d')]);}logger[_0x2fa6('0x2a')](_0x2fa6('0x2c'),_0x31993d,_0x105492[_0x2fa6('0x2a')][_0x2fa6('0x2d')]);return _0x497f2c(_0x105492[_0x2fa6('0x2a')][_0x2fa6('0x2d')]);}else{logger[_0x2fa6('0x26')](_0x2fa6('0x2c'),_0x31993d,_0x2fa6('0x29'));_0x497f2c(_0x105492[_0x2fa6('0x2e')][_0x2fa6('0x2d')]);}})[_0x2fa6('0x2f')](function(_0x52e1a5){logger[_0x2fa6('0x2a')](_0x2fa6('0x2c'),_0x31993d,_0x52e1a5);_0x51096f(_0x52e1a5);});});}function respondWithStatusCode(_0x16199d,_0x2631e7){_0x2631e7=_0x2631e7||0xcc;return function(_0x4693f5){if(_0x4693f5){return _0x16199d[_0x2fa6('0x30')](_0x2631e7);}return _0x16199d[_0x2fa6('0x31')](_0x2631e7)['end']();};}function respondWithResult(_0x2269ca,_0x516d8d){_0x516d8d=_0x516d8d||0xc8;return function(_0x204fab){if(_0x204fab){return _0x2269ca[_0x2fa6('0x31')](_0x516d8d)[_0x2fa6('0x32')](_0x204fab);}};}function respondWithFilteredResult(_0x59180a,_0xaff105){return function(_0x17d4e5){if(_0x17d4e5){var _0x10f10c=typeof _0xaff105[_0x2fa6('0x33')]===_0x2fa6('0x34')&&typeof _0xaff105['limit']===_0x2fa6('0x34');var _0x1f2ab3=_0x17d4e5[_0x2fa6('0x35')];var _0x34833d=_0x10f10c?0x0:_0xaff105[_0x2fa6('0x33')];var _0x4c4f4b=_0x10f10c?_0x17d4e5[_0x2fa6('0x35')]:_0xaff105[_0x2fa6('0x33')]+_0xaff105[_0x2fa6('0x36')];var _0xd93c84;if(_0x4c4f4b>=_0x1f2ab3){_0x4c4f4b=_0x1f2ab3;_0xd93c84=0xc8;}else{_0xd93c84=0xce;}_0x59180a[_0x2fa6('0x31')](_0xd93c84);return _0x59180a[_0x2fa6('0x37')](_0x2fa6('0x38'),_0x34833d+'-'+_0x4c4f4b+'/'+_0x1f2ab3)[_0x2fa6('0x32')](_0x17d4e5);}return null;};}function patchUpdates(_0x1481b9){return function(_0x40acb7){try{jsonpatch[_0x2fa6('0x39')](_0x40acb7,_0x1481b9,!![]);}catch(_0x3a7174){return BPromise[_0x2fa6('0x3a')](_0x3a7174);}return _0x40acb7[_0x2fa6('0x3b')]();};}function saveUpdates(_0x1e80cb,_0x509a6c){return function(_0x37d22f){if(_0x37d22f){return _0x37d22f[_0x2fa6('0x3c')](_0x1e80cb)[_0x2fa6('0x25')](function(_0x123359){return _0x123359;});}return null;};}function removeEntity(_0x13e5e1,_0x169ecd){return function(_0x7d0c2c){if(_0x7d0c2c){return _0x7d0c2c['destroy']()[_0x2fa6('0x25')](function(){_0x13e5e1[_0x2fa6('0x31')](0xcc)[_0x2fa6('0x3d')]();});}};}function handleEntityNotFound(_0x5eeb3b,_0x2432ab){return function(_0x417c94){if(!_0x417c94){_0x5eeb3b[_0x2fa6('0x30')](0x194);}return _0x417c94;};}function handleError(_0x509f5a,_0x5a5485){_0x5a5485=_0x5a5485||0x1f4;return function(_0x1ad7f2){logger[_0x2fa6('0x2a')](_0x1ad7f2[_0x2fa6('0x3e')]);if(_0x1ad7f2[_0x2fa6('0x3f')]){delete _0x1ad7f2['name'];}_0x509f5a[_0x2fa6('0x31')](_0x5a5485)[_0x2fa6('0x40')](_0x1ad7f2);};}exports['index']=function(_0x57716c,_0x23d561){var _0x1df315={},_0x175378={},_0x447fb5={'count':0x0,'rows':[]};var _0x31c00f=_[_0x2fa6('0x41')](db[_0x2fa6('0x42')][_0x2fa6('0x43')],function(_0x2e1e46){return{'name':_0x2e1e46[_0x2fa6('0x44')],'type':_0x2e1e46[_0x2fa6('0x45')]['key']};});_0x175378['model']=_[_0x2fa6('0x41')](_0x31c00f,_0x2fa6('0x3f'));_0x175378[_0x2fa6('0x46')]=_['keys'](_0x57716c[_0x2fa6('0x46')]);_0x175378[_0x2fa6('0x47')]=_[_0x2fa6('0x48')](_0x175378[_0x2fa6('0x49')],_0x175378['query']);_0x1df315[_0x2fa6('0x4a')]=_[_0x2fa6('0x48')](_0x175378[_0x2fa6('0x49')],qs['fields'](_0x57716c[_0x2fa6('0x46')][_0x2fa6('0x4b')]));_0x1df315[_0x2fa6('0x4a')]=_0x1df315[_0x2fa6('0x4a')][_0x2fa6('0x4c')]?_0x1df315[_0x2fa6('0x4a')]:_0x175378[_0x2fa6('0x49')];if(!_0x57716c['query'][_0x2fa6('0x4d')](_0x2fa6('0x4e'))){_0x1df315['limit']=qs[_0x2fa6('0x36')](_0x57716c[_0x2fa6('0x46')]['limit']);_0x1df315[_0x2fa6('0x33')]=qs[_0x2fa6('0x33')](_0x57716c[_0x2fa6('0x46')][_0x2fa6('0x33')]);}_0x1df315[_0x2fa6('0x4f')]=qs[_0x2fa6('0x50')](_0x57716c['query'][_0x2fa6('0x50')]);_0x1df315[_0x2fa6('0x51')]=qs[_0x2fa6('0x47')](_[_0x2fa6('0x52')](_0x57716c[_0x2fa6('0x46')],_0x175378[_0x2fa6('0x47')]),_0x31c00f);if(_0x57716c[_0x2fa6('0x46')]['filter']){_0x1df315[_0x2fa6('0x51')]=_['merge'](_0x1df315[_0x2fa6('0x51')],{'$or':_[_0x2fa6('0x41')](_0x31c00f,function(_0x2089b0){if(_0x2089b0[_0x2fa6('0x45')]!==_0x2fa6('0x53')){var _0xf2989e={};_0xf2989e[_0x2089b0[_0x2fa6('0x3f')]]={'$like':'%'+_0x57716c[_0x2fa6('0x46')]['filter']+'%'};return _0xf2989e;}})});}_0x1df315=_[_0x2fa6('0x54')]({},_0x1df315,_0x57716c[_0x2fa6('0x55')]);var _0x4832c9={'where':_0x1df315[_0x2fa6('0x51')]};return db[_0x2fa6('0x42')][_0x2fa6('0x35')](_0x4832c9)['then'](function(_0x3531ec){_0x447fb5[_0x2fa6('0x35')]=_0x3531ec;if(_0x57716c['query'][_0x2fa6('0x56')]){_0x1df315[_0x2fa6('0x57')]=[{'all':!![]}];}return db[_0x2fa6('0x42')]['findAll'](_0x1df315);})[_0x2fa6('0x25')](function(_0x315657){_0x447fb5[_0x2fa6('0x58')]=_0x315657;return _0x447fb5;})['then'](respondWithFilteredResult(_0x23d561,_0x1df315))[_0x2fa6('0x2f')](handleError(_0x23d561,null));};exports[_0x2fa6('0x59')]=function(_0x224fd5,_0x421a50){var _0x1b2ba5={'raw':!![],'where':{'id':_0x224fd5['params']['id']}},_0x23af8c={};_0x23af8c[_0x2fa6('0x49')]=_['keys'](db[_0x2fa6('0x42')][_0x2fa6('0x43')]);_0x23af8c['query']=_[_0x2fa6('0x5a')](_0x224fd5[_0x2fa6('0x46')]);_0x23af8c[_0x2fa6('0x47')]=_[_0x2fa6('0x48')](_0x23af8c[_0x2fa6('0x49')],_0x23af8c['query']);_0x1b2ba5[_0x2fa6('0x4a')]=_[_0x2fa6('0x48')](_0x23af8c[_0x2fa6('0x49')],qs[_0x2fa6('0x4b')](_0x224fd5[_0x2fa6('0x46')][_0x2fa6('0x4b')]));_0x1b2ba5[_0x2fa6('0x4a')]=_0x1b2ba5[_0x2fa6('0x4a')][_0x2fa6('0x4c')]?_0x1b2ba5[_0x2fa6('0x4a')]:_0x23af8c[_0x2fa6('0x49')];if(_0x224fd5['query'][_0x2fa6('0x56')]){_0x1b2ba5[_0x2fa6('0x57')]=[{'all':!![]}];}_0x1b2ba5=_['merge']({},_0x1b2ba5,_0x224fd5['options']);return db[_0x2fa6('0x42')][_0x2fa6('0x5b')](_0x1b2ba5)[_0x2fa6('0x25')](handleEntityNotFound(_0x421a50,null))[_0x2fa6('0x25')](respondWithResult(_0x421a50,null))[_0x2fa6('0x2f')](handleError(_0x421a50,null));};exports[_0x2fa6('0x5c')]=function(_0xab2fe8,_0x45ebd2){return db['OpenchannelMessage'][_0x2fa6('0x5c')](_0xab2fe8['body'],{})[_0x2fa6('0x25')](respondWithResult(_0x45ebd2,0xc9))[_0x2fa6('0x2f')](handleError(_0x45ebd2,null));};exports[_0x2fa6('0x3c')]=function(_0xb6865,_0x2cfc07){if(_0xb6865['body']['id']){delete _0xb6865[_0x2fa6('0x5d')]['id'];}return db[_0x2fa6('0x42')][_0x2fa6('0x5b')]({'where':{'id':_0xb6865[_0x2fa6('0x5e')]['id']}})[_0x2fa6('0x25')](handleEntityNotFound(_0x2cfc07,null))[_0x2fa6('0x25')](saveUpdates(_0xb6865['body'],null))[_0x2fa6('0x25')](respondWithResult(_0x2cfc07,null))[_0x2fa6('0x2f')](handleError(_0x2cfc07,null));};exports[_0x2fa6('0x5f')]=function(_0x48df69,_0x4a2d24){return db[_0x2fa6('0x42')][_0x2fa6('0x5b')]({'where':{'id':_0x48df69[_0x2fa6('0x5e')]['id']}})[_0x2fa6('0x25')](handleEntityNotFound(_0x4a2d24,null))[_0x2fa6('0x25')](removeEntity(_0x4a2d24,null))[_0x2fa6('0x2f')](handleError(_0x4a2d24,null));};exports[_0x2fa6('0x60')]=function(_0xa5447d,_0xb506a){return db[_0x2fa6('0x42')][_0x2fa6('0x60')]()[_0x2fa6('0x25')](respondWithResult(_0xb506a,null))[_0x2fa6('0x2f')](handleError(_0xb506a,null));};var interaction_log=require(_0x2fa6('0x17'))(_0x2fa6('0x61'));exports['accept']=function(_0x5edf70,_0x4e410d,_0x1e3705){var _0x2ae2de={'agent':{},'channel':_0x2fa6('0x62')};if(_0x5edf70['body']['id']){delete _0x5edf70['body']['id'];}_0x5edf70[_0x2fa6('0x5d')][_0x2fa6('0x63')]=!![];_0x5edf70[_0x2fa6('0x5d')][_0x2fa6('0x64')]=moment()[_0x2fa6('0x65')](_0x2fa6('0x66'));_0x5edf70[_0x2fa6('0x5d')]['UserId']=_0x5edf70[_0x2fa6('0x5d')][_0x2fa6('0x67')]||_0x5edf70['user']['id'];_0x2ae2de[_0x2fa6('0x68')]['id']=_0x5edf70[_0x2fa6('0x5d')]['UserId'];return db[_0x2fa6('0x42')][_0x2fa6('0x5b')]({'where':{'id':_0x5edf70[_0x2fa6('0x5e')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x4e410d,null))[_0x2fa6('0x25')](saveUpdates(_0x5edf70[_0x2fa6('0x5d')],null))[_0x2fa6('0x25')](function(_0x3150b9){if(_0x3150b9){_0x2ae2de[_0x2fa6('0x2d')]=_0x3150b9[_0x2fa6('0x69')]({'plain':!![]});return db['OpenchannelInteraction'][_0x2fa6('0x5b')]({'where':{'id':_0x3150b9[_0x2fa6('0x6a')]}});}return null;})[_0x2fa6('0x25')](handleEntityNotFound(_0x4e410d,null))['then'](function(_0xf3025b){if(_0xf3025b){return _0xf3025b[_0x2fa6('0x3c')]({'UserId':_0x5edf70[_0x2fa6('0x5d')][_0x2fa6('0x67')],'read1stAt':_['isNil'](_0xf3025b[_0x2fa6('0x6b')])?moment()[_0x2fa6('0x65')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})['then'](function(_0x1d05ca){if(_0x1d05ca){_0x2ae2de[_0x2fa6('0x6c')]=_0x1d05ca[_0x2fa6('0x69')]({'plain':!![]});interaction_log[_0x2fa6('0x26')](_0x2fa6('0x6d'),_0x5edf70[_0x2fa6('0x6e')]['id'],_0x5edf70['user'][_0x2fa6('0x3f')],_0x5edf70[_0x2fa6('0x6e')][_0x2fa6('0x6f')],_0x2ae2de['interaction']['id'],_0x5edf70['body']?JSON[_0x2fa6('0x70')](_0x5edf70[_0x2fa6('0x5d')]):_0x2fa6('0x71'));return respondWithRpcPromise(_0x2fa6('0x72'),_0x2fa6('0x73'),_0x2ae2de);}return null;})[_0x2fa6('0x25')](function(_0x17c4b2){var _0x573680='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x17c4b2[_0x2fa6('0x2d')][_0x2fa6('0x74')];return db[_0x2fa6('0x75')]['query'](_0x573680,{'type':db[_0x2fa6('0x76')][_0x2fa6('0x77')][_0x2fa6('0x78')],'raw':!![]})[_0x2fa6('0x25')](function(_0x281f53){return _0x281f53;});})[_0x2fa6('0x25')](function(_0x34ac04){if(_0x34ac04){_0x2ae2de[_0x2fa6('0x2d')]['contact']=_0x34ac04[0x0];if(!_0x5edf70[_0x2fa6('0x5d')][_0x2fa6('0x67')])return;return db['User'][_0x2fa6('0x5b')]({'where':{'id':_0x5edf70[_0x2fa6('0x5d')][_0x2fa6('0x67')],'role':_0x2fa6('0x68')},'attributes':['id','name',_0x2fa6('0x79'),_0x2fa6('0x7a'),_0x2fa6('0x7b')],'raw':!![]});}return null;})[_0x2fa6('0x25')](function(_0x55a69a){if(!_0x55a69a)return null;_0x2ae2de[_0x2fa6('0x2d')][_0x2fa6('0x68')]=_0x55a69a;return _0x2ae2de;})[_0x2fa6('0x25')](function(_0x5bc84a){if(_0x5bc84a){if(_0x5edf70[_0x2fa6('0x5d')]['manual']){_0x2ae2de[_0x2fa6('0x2d')][_0x2fa6('0x7c')]=util[_0x2fa6('0x65')]('SIP/%s',_0x5edf70[_0x2fa6('0x6e')]['name']);_0x2ae2de['message'][_0x2fa6('0x7d')]=_0x2ae2de['channel'];_0x2ae2de[_0x2fa6('0x2d')]['motionChannel']=_0x2ae2de[_0x2fa6('0x7d')];_0x2ae2de[_0x2fa6('0x2d')][_0x2fa6('0x7e')]=_0x2fa6('0x7f');return respondWithRpcPromise('EventManager','EventManager',{'event':'acceptmessage','message':_0x2ae2de['message']},client9002)[_0x2fa6('0x25')](function(){return _0x2ae2de;});}return _0x2ae2de;}return null;})[_0x2fa6('0x25')](respondWithResult(_0x4e410d,null))['catch'](handleError(_0x4e410d,null));};var interaction_log=require(_0x2fa6('0x17'))(_0x2fa6('0x61'));exports[_0x2fa6('0x3a')]=function(_0x5e4d2b,_0x4f76be,_0x5abe66){var _0x3c71c8={'agent':{},'channel':'openchannel'};if(_0x5e4d2b[_0x2fa6('0x5d')]['id']){delete _0x5e4d2b[_0x2fa6('0x5d')]['id'];}_0x5e4d2b['body'][_0x2fa6('0x67')]=_0x5e4d2b['body'][_0x2fa6('0x67')]||_0x5e4d2b['user']['id'];_0x3c71c8['agent']['id']=_0x5e4d2b[_0x2fa6('0x5d')][_0x2fa6('0x67')];return db[_0x2fa6('0x42')][_0x2fa6('0x5b')]({'where':{'id':_0x5e4d2b[_0x2fa6('0x5e')]['id'],'UserId':null}})[_0x2fa6('0x25')](handleEntityNotFound(_0x4f76be,null))[_0x2fa6('0x25')](function(_0x311343){if(_0x311343){_0x3c71c8[_0x2fa6('0x2d')]=_0x311343[_0x2fa6('0x69')]({'plain':!![]});return db[_0x2fa6('0x80')]['find']({'where':{'id':_0x311343[_0x2fa6('0x6a')]}});}return null;})[_0x2fa6('0x25')](handleEntityNotFound(_0x4f76be,null))[_0x2fa6('0x25')](function(_0x5ea47d){if(_0x5ea47d){_0x3c71c8[_0x2fa6('0x6c')]=_0x5ea47d[_0x2fa6('0x69')]({'plain':!![]});interaction_log[_0x2fa6('0x26')]('[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x5e4d2b[_0x2fa6('0x6e')]['id'],_0x5e4d2b[_0x2fa6('0x6e')][_0x2fa6('0x3f')],_0x5e4d2b[_0x2fa6('0x6e')][_0x2fa6('0x6f')],_0x3c71c8[_0x2fa6('0x6c')]['id'],_0x5e4d2b['body']?JSON[_0x2fa6('0x70')](_0x5e4d2b[_0x2fa6('0x5d')]):'null');return respondWithRpcPromise(_0x2fa6('0x81'),_0x2fa6('0x82'),_0x3c71c8);}return null;})['then'](function(_0x4a9963){var _0xf0e367=_0x2fa6('0x83')+_0x4a9963['message'][_0x2fa6('0x74')];return db[_0x2fa6('0x75')]['query'](_0xf0e367,{'type':db[_0x2fa6('0x76')][_0x2fa6('0x77')][_0x2fa6('0x78')],'raw':!![]})[_0x2fa6('0x25')](function(_0x1114b2){return _0x1114b2;});})[_0x2fa6('0x25')](function(_0x463c4e){if(_0x463c4e){_0x3c71c8['message'][_0x2fa6('0x84')]=_0x463c4e[0x0];if(!_0x5e4d2b['body'][_0x2fa6('0x67')])return;return db[_0x2fa6('0x85')][_0x2fa6('0x5b')]({'where':{'id':_0x5e4d2b[_0x2fa6('0x5d')]['UserId'],'role':'agent'},'attributes':['id',_0x2fa6('0x3f'),_0x2fa6('0x79'),'email',_0x2fa6('0x7b')],'raw':!![]});}return null;})[_0x2fa6('0x25')](function(_0x32e9f8){if(!_0x32e9f8)return null;_0x3c71c8['message']['agent']=_0x32e9f8;return _0x3c71c8;})[_0x2fa6('0x25')](function(_0x17c5b0){if(_0x17c5b0){_0x17c5b0[_0x2fa6('0x2d')]['interface']=util[_0x2fa6('0x65')](_0x2fa6('0x86'),_0x5e4d2b[_0x2fa6('0x6e')][_0x2fa6('0x3f')]);_0x17c5b0['message'][_0x2fa6('0x7d')]=_0x3c71c8[_0x2fa6('0x7d')];_0x17c5b0['message'][_0x2fa6('0x87')]=_0x3c71c8[_0x2fa6('0x7d')];_0x17c5b0['message'][_0x2fa6('0x7e')]=_0x2fa6('0x3a');respondWithRpcPromise(_0x2fa6('0x88'),'EventManager',{'event':_0x2fa6('0x89'),'message':_0x17c5b0[_0x2fa6('0x2d')]},client9002);return _0x3c71c8;}return null;})[_0x2fa6('0x25')](respondWithResult(_0x4f76be,null))['catch'](handleError(_0x4f76be,null));}; \ No newline at end of file +var _0xc00c=['EventManager','acceptmessage','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','RejectMessage','rejectMessage','SELECT','internal','format','motionChannel','rejectmessage','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./openchannelMessage.socket','register','jayson/promise','client','http','request','then','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','destroy','stack','name','send','index','map','OpenchannelMessage','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','rows','show','params','keys','include','create','body','find','openchannel-interactions','accept','openchannel','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','OpenchannelInteraction','OpenchannelInteractionId','read1stAt','interaction','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','contact','User','fullname','email','interface','SIP/%s','channel','event'];(function(_0x23716e,_0x495e34){var _0x13d400=function(_0x265cec){while(--_0x265cec){_0x23716e['push'](_0x23716e['shift']());}};_0x13d400(++_0x495e34);}(_0xc00c,0x92));var _0xcc00=function(_0x1b7368,_0x3286ed){_0x1b7368=_0x1b7368-0x0;var _0x25d54c=_0xc00c[_0x1b7368];return _0x25d54c;};'use strict';var emlformat=require(_0xcc00('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xcc00('0x1'));var jsonpatch=require(_0xcc00('0x2'));var rp=require(_0xcc00('0x3'));var moment=require(_0xcc00('0x4'));var BPromise=require(_0xcc00('0x5'));var Mustache=require(_0xcc00('0x6'));var util=require(_0xcc00('0x7'));var path=require('path');var sox=require(_0xcc00('0x8'));var csv=require(_0xcc00('0x9'));var ejs=require(_0xcc00('0xa'));var fs=require('fs');var fs_extra=require(_0xcc00('0xb'));var _=require('lodash');var squel=require(_0xcc00('0xc'));var crypto=require(_0xcc00('0xd'));var jsforce=require(_0xcc00('0xe'));var deskjs=require(_0xcc00('0xf'));var toCsv=require('to-csv');var querystring=require(_0xcc00('0x10'));var Papa=require(_0xcc00('0x11'));var Redis=require(_0xcc00('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xcc00('0x13'));var as=require(_0xcc00('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xcc00('0x15'))('api');var utils=require(_0xcc00('0x16'));var config=require(_0xcc00('0x17'));var licenseUtil=require(_0xcc00('0x18'));var db=require(_0xcc00('0x19'))['db'];config[_0xcc00('0x1a')]=_[_0xcc00('0x1b')](config['redis'],{'host':_0xcc00('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xcc00('0x1a')]));require(_0xcc00('0x1d'))[_0xcc00('0x1e')](socket);var jayson=require(_0xcc00('0x1f'));var client=jayson[_0xcc00('0x20')][_0xcc00('0x21')]({'port':0x232c});var client9002=jayson[_0xcc00('0x20')]['http']({'port':0x232a});function respondWithRpcPromise(_0x26dd58,_0x8f3cab,_0x5b1640,_0xebd4bb){return new BPromise(function(_0x3b8529,_0xc6ba8c){var _0x2e5475=_0xebd4bb||client;return _0x2e5475[_0xcc00('0x22')](_0x26dd58,_0x5b1640)[_0xcc00('0x23')](function(_0x44d566){logger[_0xcc00('0x24')](_0xcc00('0x25'),_0x8f3cab,_0xcc00('0x26'));logger['debug']('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x8f3cab,_0xcc00('0x26'),JSON[_0xcc00('0x27')](_0x44d566));if(_0x44d566[_0xcc00('0x28')]){if(_0x44d566[_0xcc00('0x28')][_0xcc00('0x29')]===0x1f4){logger[_0xcc00('0x28')]('OpenchannelMessage,\x20%s,\x20%s',_0x8f3cab,_0x44d566[_0xcc00('0x28')][_0xcc00('0x2a')]);return _0xc6ba8c(_0x44d566[_0xcc00('0x28')][_0xcc00('0x2a')]);}logger[_0xcc00('0x28')](_0xcc00('0x25'),_0x8f3cab,_0x44d566[_0xcc00('0x28')][_0xcc00('0x2a')]);return _0x3b8529(_0x44d566['error'][_0xcc00('0x2a')]);}else{logger[_0xcc00('0x24')](_0xcc00('0x25'),_0x8f3cab,_0xcc00('0x26'));_0x3b8529(_0x44d566[_0xcc00('0x2b')][_0xcc00('0x2a')]);}})[_0xcc00('0x2c')](function(_0x2fbbbf){logger[_0xcc00('0x28')](_0xcc00('0x25'),_0x8f3cab,_0x2fbbbf);_0xc6ba8c(_0x2fbbbf);});});}function respondWithStatusCode(_0x37c00b,_0x24edb8){_0x24edb8=_0x24edb8||0xcc;return function(_0x4d824f){if(_0x4d824f){return _0x37c00b[_0xcc00('0x2d')](_0x24edb8);}return _0x37c00b[_0xcc00('0x2e')](_0x24edb8)[_0xcc00('0x2f')]();};}function respondWithResult(_0x159d47,_0x534b1e){_0x534b1e=_0x534b1e||0xc8;return function(_0x39f069){if(_0x39f069){return _0x159d47[_0xcc00('0x2e')](_0x534b1e)[_0xcc00('0x30')](_0x39f069);}};}function respondWithFilteredResult(_0x1ba470,_0x3b7be4){return function(_0x2e0026){if(_0x2e0026){var _0x4f2ca4=typeof _0x3b7be4[_0xcc00('0x31')]===_0xcc00('0x32')&&typeof _0x3b7be4[_0xcc00('0x33')]===_0xcc00('0x32');var _0x1d1a12=_0x2e0026[_0xcc00('0x34')];var _0x34a84e=_0x4f2ca4?0x0:_0x3b7be4[_0xcc00('0x31')];var _0x342ad1=_0x4f2ca4?_0x2e0026[_0xcc00('0x34')]:_0x3b7be4[_0xcc00('0x31')]+_0x3b7be4[_0xcc00('0x33')];var _0x41d4dd;if(_0x342ad1>=_0x1d1a12){_0x342ad1=_0x1d1a12;_0x41d4dd=0xc8;}else{_0x41d4dd=0xce;}_0x1ba470['status'](_0x41d4dd);return _0x1ba470['set'](_0xcc00('0x35'),_0x34a84e+'-'+_0x342ad1+'/'+_0x1d1a12)['json'](_0x2e0026);}return null;};}function patchUpdates(_0x146332){return function(_0x514bcd){try{jsonpatch[_0xcc00('0x36')](_0x514bcd,_0x146332,!![]);}catch(_0x14ce5b){return BPromise[_0xcc00('0x37')](_0x14ce5b);}return _0x514bcd[_0xcc00('0x38')]();};}function saveUpdates(_0x62743e,_0x4c687c){return function(_0x2b42bb){if(_0x2b42bb){return _0x2b42bb[_0xcc00('0x39')](_0x62743e)[_0xcc00('0x23')](function(_0xc3a925){return _0xc3a925;});}return null;};}function removeEntity(_0x1236b8,_0x3274f6){return function(_0x4c20f8){if(_0x4c20f8){return _0x4c20f8[_0xcc00('0x3a')]()[_0xcc00('0x23')](function(){_0x1236b8[_0xcc00('0x2e')](0xcc)[_0xcc00('0x2f')]();});}};}function handleEntityNotFound(_0x284fec,_0x4929a3){return function(_0x55de70){if(!_0x55de70){_0x284fec[_0xcc00('0x2d')](0x194);}return _0x55de70;};}function handleError(_0x2a79ef,_0x378872){_0x378872=_0x378872||0x1f4;return function(_0x369f1a){logger[_0xcc00('0x28')](_0x369f1a[_0xcc00('0x3b')]);if(_0x369f1a[_0xcc00('0x3c')]){delete _0x369f1a[_0xcc00('0x3c')];}_0x2a79ef[_0xcc00('0x2e')](_0x378872)[_0xcc00('0x3d')](_0x369f1a);};}exports[_0xcc00('0x3e')]=function(_0x597016,_0x5ecf00){var _0x3a1f43={},_0x271d29={},_0x1f8169={'count':0x0,'rows':[]};var _0x34cb77=_[_0xcc00('0x3f')](db[_0xcc00('0x40')][_0xcc00('0x41')],function(_0x17906f){return{'name':_0x17906f[_0xcc00('0x42')],'type':_0x17906f[_0xcc00('0x43')][_0xcc00('0x44')]};});_0x271d29[_0xcc00('0x45')]=_['map'](_0x34cb77,_0xcc00('0x3c'));_0x271d29[_0xcc00('0x46')]=_['keys'](_0x597016[_0xcc00('0x46')]);_0x271d29[_0xcc00('0x47')]=_['intersection'](_0x271d29[_0xcc00('0x45')],_0x271d29[_0xcc00('0x46')]);_0x3a1f43['attributes']=_[_0xcc00('0x48')](_0x271d29[_0xcc00('0x45')],qs[_0xcc00('0x49')](_0x597016[_0xcc00('0x46')][_0xcc00('0x49')]));_0x3a1f43[_0xcc00('0x4a')]=_0x3a1f43[_0xcc00('0x4a')][_0xcc00('0x4b')]?_0x3a1f43[_0xcc00('0x4a')]:_0x271d29[_0xcc00('0x45')];if(!_0x597016['query'][_0xcc00('0x4c')](_0xcc00('0x4d'))){_0x3a1f43[_0xcc00('0x33')]=qs[_0xcc00('0x33')](_0x597016[_0xcc00('0x46')][_0xcc00('0x33')]);_0x3a1f43[_0xcc00('0x31')]=qs[_0xcc00('0x31')](_0x597016[_0xcc00('0x46')][_0xcc00('0x31')]);}_0x3a1f43['order']=qs[_0xcc00('0x4e')](_0x597016[_0xcc00('0x46')][_0xcc00('0x4e')]);_0x3a1f43[_0xcc00('0x4f')]=qs[_0xcc00('0x47')](_[_0xcc00('0x50')](_0x597016[_0xcc00('0x46')],_0x271d29['filters']),_0x34cb77);if(_0x597016['query'][_0xcc00('0x51')]){_0x3a1f43[_0xcc00('0x4f')]=_['merge'](_0x3a1f43[_0xcc00('0x4f')],{'$or':_[_0xcc00('0x3f')](_0x34cb77,function(_0x1b05c3){if(_0x1b05c3[_0xcc00('0x43')]!==_0xcc00('0x52')){var _0x402322={};_0x402322[_0x1b05c3[_0xcc00('0x3c')]]={'$like':'%'+_0x597016[_0xcc00('0x46')][_0xcc00('0x51')]+'%'};return _0x402322;}})});}_0x3a1f43=_[_0xcc00('0x53')]({},_0x3a1f43,_0x597016[_0xcc00('0x54')]);var _0x22ab3e={'where':_0x3a1f43['where']};return db[_0xcc00('0x40')][_0xcc00('0x34')](_0x22ab3e)[_0xcc00('0x23')](function(_0x4c7508){_0x1f8169[_0xcc00('0x34')]=_0x4c7508;if(_0x597016[_0xcc00('0x46')][_0xcc00('0x55')]){_0x3a1f43['include']=[{'all':!![]}];}return db['OpenchannelMessage']['findAll'](_0x3a1f43);})['then'](function(_0x44bc3a){_0x1f8169[_0xcc00('0x56')]=_0x44bc3a;return _0x1f8169;})[_0xcc00('0x23')](respondWithFilteredResult(_0x5ecf00,_0x3a1f43))['catch'](handleError(_0x5ecf00,null));};exports[_0xcc00('0x57')]=function(_0x23cfae,_0x1ed458){var _0x3fb2c1={'raw':!![],'where':{'id':_0x23cfae[_0xcc00('0x58')]['id']}},_0x115705={};_0x115705[_0xcc00('0x45')]=_['keys'](db[_0xcc00('0x40')][_0xcc00('0x41')]);_0x115705[_0xcc00('0x46')]=_[_0xcc00('0x59')](_0x23cfae['query']);_0x115705[_0xcc00('0x47')]=_[_0xcc00('0x48')](_0x115705[_0xcc00('0x45')],_0x115705[_0xcc00('0x46')]);_0x3fb2c1[_0xcc00('0x4a')]=_[_0xcc00('0x48')](_0x115705[_0xcc00('0x45')],qs['fields'](_0x23cfae[_0xcc00('0x46')]['fields']));_0x3fb2c1[_0xcc00('0x4a')]=_0x3fb2c1[_0xcc00('0x4a')][_0xcc00('0x4b')]?_0x3fb2c1['attributes']:_0x115705[_0xcc00('0x45')];if(_0x23cfae[_0xcc00('0x46')]['includeAll']){_0x3fb2c1[_0xcc00('0x5a')]=[{'all':!![]}];}_0x3fb2c1=_['merge']({},_0x3fb2c1,_0x23cfae[_0xcc00('0x54')]);return db[_0xcc00('0x40')]['find'](_0x3fb2c1)['then'](handleEntityNotFound(_0x1ed458,null))[_0xcc00('0x23')](respondWithResult(_0x1ed458,null))['catch'](handleError(_0x1ed458,null));};exports[_0xcc00('0x5b')]=function(_0x355fc6,_0x5b3893){return db[_0xcc00('0x40')][_0xcc00('0x5b')](_0x355fc6['body'],{})['then'](respondWithResult(_0x5b3893,0xc9))[_0xcc00('0x2c')](handleError(_0x5b3893,null));};exports[_0xcc00('0x39')]=function(_0x3f6523,_0x10b237){if(_0x3f6523['body']['id']){delete _0x3f6523[_0xcc00('0x5c')]['id'];}return db[_0xcc00('0x40')][_0xcc00('0x5d')]({'where':{'id':_0x3f6523['params']['id']}})[_0xcc00('0x23')](handleEntityNotFound(_0x10b237,null))[_0xcc00('0x23')](saveUpdates(_0x3f6523['body'],null))[_0xcc00('0x23')](respondWithResult(_0x10b237,null))['catch'](handleError(_0x10b237,null));};exports[_0xcc00('0x3a')]=function(_0x5ca5cf,_0x4ca917){return db[_0xcc00('0x40')][_0xcc00('0x5d')]({'where':{'id':_0x5ca5cf[_0xcc00('0x58')]['id']}})[_0xcc00('0x23')](handleEntityNotFound(_0x4ca917,null))[_0xcc00('0x23')](removeEntity(_0x4ca917,null))['catch'](handleError(_0x4ca917,null));};exports['describe']=function(_0x4fb374,_0x20d512){return db[_0xcc00('0x40')]['describe']()['then'](respondWithResult(_0x20d512,null))[_0xcc00('0x2c')](handleError(_0x20d512,null));};var interaction_log=require(_0xcc00('0x15'))(_0xcc00('0x5e'));exports[_0xcc00('0x5f')]=function(_0x30a7c5,_0x456491,_0xbb2148){var _0x2e5c05={'agent':{},'channel':_0xcc00('0x60')};if(_0x30a7c5['body']['id']){delete _0x30a7c5['body']['id'];}_0x30a7c5['body'][_0xcc00('0x61')]=!![];_0x30a7c5['body'][_0xcc00('0x62')]=moment()['format'](_0xcc00('0x63'));_0x30a7c5['body'][_0xcc00('0x64')]=_0x30a7c5[_0xcc00('0x5c')]['UserId']||_0x30a7c5[_0xcc00('0x65')]['id'];_0x2e5c05[_0xcc00('0x66')]['id']=_0x30a7c5[_0xcc00('0x5c')][_0xcc00('0x64')];return db[_0xcc00('0x40')][_0xcc00('0x5d')]({'where':{'id':_0x30a7c5[_0xcc00('0x58')]['id'],'UserId':null}})[_0xcc00('0x23')](handleEntityNotFound(_0x456491,null))['then'](saveUpdates(_0x30a7c5['body'],null))[_0xcc00('0x23')](function(_0x175955){if(_0x175955){_0x2e5c05[_0xcc00('0x2a')]=_0x175955[_0xcc00('0x67')]({'plain':!![]});return db[_0xcc00('0x68')]['find']({'where':{'id':_0x175955[_0xcc00('0x69')]}});}return null;})['then'](handleEntityNotFound(_0x456491,null))['then'](function(_0x5b0aeb){if(_0x5b0aeb){return _0x5b0aeb[_0xcc00('0x39')]({'UserId':_0x30a7c5[_0xcc00('0x5c')]['UserId'],'read1stAt':_['isNil'](_0x5b0aeb[_0xcc00('0x6a')])?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0xcc00('0x23')](function(_0x5f07db){if(_0x5f07db){_0x2e5c05[_0xcc00('0x6b')]=_0x5f07db['get']({'plain':!![]});interaction_log['info'](_0xcc00('0x6c'),_0x30a7c5[_0xcc00('0x65')]['id'],_0x30a7c5['user'][_0xcc00('0x3c')],_0x30a7c5[_0xcc00('0x65')][_0xcc00('0x6d')],_0x2e5c05[_0xcc00('0x6b')]['id'],_0x30a7c5[_0xcc00('0x5c')]?JSON[_0xcc00('0x27')](_0x30a7c5[_0xcc00('0x5c')]):'null');return respondWithRpcPromise('AcceptMessage',_0xcc00('0x6e'),_0x2e5c05);}return null;})[_0xcc00('0x23')](function(_0x51c082){var _0x18e478=_0xcc00('0x6f')+_0x51c082[_0xcc00('0x2a')][_0xcc00('0x70')];return db[_0xcc00('0x71')]['query'](_0x18e478,{'type':db[_0xcc00('0x72')][_0xcc00('0x73')]['SELECT'],'raw':!![]})[_0xcc00('0x23')](function(_0x11a23d){return _0x11a23d;});})['then'](function(_0x156782){if(_0x156782){_0x2e5c05[_0xcc00('0x2a')][_0xcc00('0x74')]=_0x156782[0x0];if(!_0x30a7c5[_0xcc00('0x5c')]['UserId'])return;return db[_0xcc00('0x75')][_0xcc00('0x5d')]({'where':{'id':_0x30a7c5['body'][_0xcc00('0x64')],'role':_0xcc00('0x66')},'attributes':['id','name',_0xcc00('0x76'),_0xcc00('0x77'),'internal'],'raw':!![]});}return null;})['then'](function(_0x205bd5){if(!_0x205bd5)return null;_0x2e5c05['message'][_0xcc00('0x66')]=_0x205bd5;return _0x2e5c05;})['then'](function(_0x487dff){if(_0x487dff){if(_0x30a7c5[_0xcc00('0x5c')]['manual']){_0x2e5c05[_0xcc00('0x2a')][_0xcc00('0x78')]=util['format'](_0xcc00('0x79'),_0x30a7c5[_0xcc00('0x65')][_0xcc00('0x3c')]);_0x2e5c05['message'][_0xcc00('0x7a')]=_0x2e5c05[_0xcc00('0x7a')];_0x2e5c05['message']['motionChannel']=_0x2e5c05[_0xcc00('0x7a')];_0x2e5c05[_0xcc00('0x2a')][_0xcc00('0x7b')]=_0xcc00('0x5f');return respondWithRpcPromise(_0xcc00('0x7c'),_0xcc00('0x7c'),{'event':_0xcc00('0x7d'),'message':_0x2e5c05['message']},client9002)['then'](function(){return _0x2e5c05;});}return _0x2e5c05;}return null;})[_0xcc00('0x23')](respondWithResult(_0x456491,null))[_0xcc00('0x2c')](handleError(_0x456491,null));};var interaction_log=require(_0xcc00('0x15'))('openchannel-interactions');exports[_0xcc00('0x37')]=function(_0x3299e0,_0x3a2e7f,_0x2cd2b8){var _0x486afa={'agent':{},'channel':_0xcc00('0x60')};if(_0x3299e0['body']['id']){delete _0x3299e0[_0xcc00('0x5c')]['id'];}_0x3299e0[_0xcc00('0x5c')][_0xcc00('0x64')]=_0x3299e0['body']['UserId']||_0x3299e0[_0xcc00('0x65')]['id'];_0x486afa[_0xcc00('0x66')]['id']=_0x3299e0['body']['UserId'];return db[_0xcc00('0x40')][_0xcc00('0x5d')]({'where':{'id':_0x3299e0[_0xcc00('0x58')]['id'],'UserId':null}})[_0xcc00('0x23')](handleEntityNotFound(_0x3a2e7f,null))[_0xcc00('0x23')](function(_0x9247a0){if(_0x9247a0){_0x486afa[_0xcc00('0x2a')]=_0x9247a0[_0xcc00('0x67')]({'plain':!![]});return db[_0xcc00('0x68')]['find']({'where':{'id':_0x9247a0[_0xcc00('0x69')]}});}return null;})['then'](handleEntityNotFound(_0x3a2e7f,null))[_0xcc00('0x23')](function(_0x20b5e4){if(_0x20b5e4){_0x486afa[_0xcc00('0x6b')]=_0x20b5e4[_0xcc00('0x67')]({'plain':!![]});interaction_log['info'](_0xcc00('0x7e'),_0x3299e0[_0xcc00('0x65')]['id'],_0x3299e0['user'][_0xcc00('0x3c')],_0x3299e0[_0xcc00('0x65')][_0xcc00('0x6d')],_0x486afa[_0xcc00('0x6b')]['id'],_0x3299e0[_0xcc00('0x5c')]?JSON[_0xcc00('0x27')](_0x3299e0[_0xcc00('0x5c')]):_0xcc00('0x7f'));return respondWithRpcPromise(_0xcc00('0x80'),_0xcc00('0x81'),_0x486afa);}return null;})[_0xcc00('0x23')](function(_0x55e965){var _0x4f6694=_0xcc00('0x6f')+_0x55e965[_0xcc00('0x2a')][_0xcc00('0x70')];return db[_0xcc00('0x71')][_0xcc00('0x46')](_0x4f6694,{'type':db[_0xcc00('0x72')]['QueryTypes'][_0xcc00('0x82')],'raw':!![]})[_0xcc00('0x23')](function(_0x4e5b13){return _0x4e5b13;});})[_0xcc00('0x23')](function(_0x5709a2){if(_0x5709a2){_0x486afa[_0xcc00('0x2a')][_0xcc00('0x74')]=_0x5709a2[0x0];if(!_0x3299e0['body'][_0xcc00('0x64')])return;return db[_0xcc00('0x75')][_0xcc00('0x5d')]({'where':{'id':_0x3299e0[_0xcc00('0x5c')][_0xcc00('0x64')],'role':_0xcc00('0x66')},'attributes':['id',_0xcc00('0x3c'),_0xcc00('0x76'),_0xcc00('0x77'),_0xcc00('0x83')],'raw':!![]});}return null;})[_0xcc00('0x23')](function(_0x1947cb){if(!_0x1947cb)return null;_0x486afa[_0xcc00('0x2a')][_0xcc00('0x66')]=_0x1947cb;return _0x486afa;})['then'](function(_0x44f1f9){if(_0x44f1f9){_0x44f1f9[_0xcc00('0x2a')]['interface']=util[_0xcc00('0x84')](_0xcc00('0x79'),_0x3299e0[_0xcc00('0x65')][_0xcc00('0x3c')]);_0x44f1f9['message'][_0xcc00('0x7a')]=_0x486afa[_0xcc00('0x7a')];_0x44f1f9['message'][_0xcc00('0x85')]=_0x486afa[_0xcc00('0x7a')];_0x44f1f9[_0xcc00('0x2a')][_0xcc00('0x7b')]=_0xcc00('0x37');respondWithRpcPromise(_0xcc00('0x7c'),_0xcc00('0x7c'),{'event':_0xcc00('0x86'),'message':_0x44f1f9['message']},client9002);return _0x486afa;}return null;})[_0xcc00('0x23')](respondWithResult(_0x3a2e7f,null))[_0xcc00('0x2c')](handleError(_0x3a2e7f,null));}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.events.js b/server/api/openchannelMessage/openchannelMessage.events.js index 8f183f9..cb717cc 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 _0x5e4f=['../../mysqldb','OpenchannelMessage','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x1b3c99,_0x382a4c){var _0xe13221=function(_0x587029){while(--_0x587029){_0x1b3c99['push'](_0x1b3c99['shift']());}};_0xe13221(++_0x382a4c);}(_0x5e4f,0x105));var _0xf5e4=function(_0x156696,_0x3a9a2e){_0x156696=_0x156696-0x0;var _0x5ab7c4=_0x5e4f[_0x156696];return _0x5ab7c4;};'use strict';var EventEmitter=require('events');var OpenchannelMessage=require(_0xf5e4('0x0'))['db'][_0xf5e4('0x1')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xf5e4('0x2'),'afterUpdate':_0xf5e4('0x3'),'afterDestroy':_0xf5e4('0x4')};function emitEvent(_0x522d89){return function(_0x420d28,_0x2d5299,_0xec3ef1){OpenchannelMessageEvents['emit'](_0x522d89+':'+_0x420d28['id'],_0x420d28);OpenchannelMessageEvents[_0xf5e4('0x5')](_0x522d89,_0x420d28);_0xec3ef1(null);};}for(var e in events){if(events[_0xf5e4('0x6')](e)){var event=events[e];OpenchannelMessage[_0xf5e4('0x7')](e,emitEvent(event));}}module[_0xf5e4('0x8')]=OpenchannelMessageEvents; \ No newline at end of file +var _0x4376=['save','update','remove','emit','hasOwnProperty','hook','exports','events','OpenchannelMessage','setMaxListeners'];(function(_0x65d2d9,_0x6b9a93){var _0x3a3b0d=function(_0x56b9d5){while(--_0x56b9d5){_0x65d2d9['push'](_0x65d2d9['shift']());}};_0x3a3b0d(++_0x6b9a93);}(_0x4376,0x115));var _0x6437=function(_0xd8b4f,_0x3fe442){_0xd8b4f=_0xd8b4f-0x0;var _0x172698=_0x4376[_0xd8b4f];return _0x172698;};'use strict';var EventEmitter=require(_0x6437('0x0'));var OpenchannelMessage=require('../../mysqldb')['db'][_0x6437('0x1')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0x6437('0x2')](0x0);var events={'afterCreate':_0x6437('0x3'),'afterUpdate':_0x6437('0x4'),'afterDestroy':_0x6437('0x5')};function emitEvent(_0x3b3ffd){return function(_0x1c41ab,_0x25e7cb,_0x5d1d13){OpenchannelMessageEvents['emit'](_0x3b3ffd+':'+_0x1c41ab['id'],_0x1c41ab);OpenchannelMessageEvents[_0x6437('0x6')](_0x3b3ffd,_0x1c41ab);_0x5d1d13(null);};}for(var e in events){if(events[_0x6437('0x7')](e)){var event=events[e];OpenchannelMessage[_0x6437('0x8')](e,emitEvent(event));}}module[_0x6437('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 146642c..f9f6a3d 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 _0x95fb=['info','afterCreate','Forwarding\x20message\x20%d\x20to\x20%s','Interactions','length','omit','Contact','POST','method','GET','OpenchannelMessage,\x20%s,\x20%s','threadId','Interaction','body','inspect','finally','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./openchannelMessage.attributes','exports','fti_openchannel_messages','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil','UserId','OpenchannelInteraction','findOne','OpenchannelInteractionId','then','update','createdAt','error','CmContact','describe','OpenchannelAccount','OpenchannelAccountId','replyUri'];(function(_0x5999c4,_0x100053){var _0x314a0c=function(_0x6c3543){while(--_0x6c3543){_0x5999c4['push'](_0x5999c4['shift']());}};_0x314a0c(++_0x100053);}(_0x95fb,0xab));var _0xb95f=function(_0x139f23,_0x41c360){_0x139f23=_0x139f23-0x0;var _0x53aa36=_0x95fb[_0x139f23];return _0x53aa36;};'use strict';var _=require(_0xb95f('0x0'));var util=require(_0xb95f('0x1'));var logger=require(_0xb95f('0x2'))(_0xb95f('0x3'));var moment=require(_0xb95f('0x4'));var BPromise=require(_0xb95f('0x5'));var rp=require(_0xb95f('0x6'));var fs=require('fs');var path=require(_0xb95f('0x7'));var rimraf=require('rimraf');var config=require(_0xb95f('0x8'));var attributes=require(_0xb95f('0x9'));module[_0xb95f('0xa')]=function(_0x3275aa,_0x56c70e){return _0x3275aa['define']('OpenchannelMessage',attributes,{'tableName':'openchannel_messages','paranoid':![],'indexes':[{'name':_0xb95f('0xb'),'fields':['body'],'type':_0xb95f('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x48a4b1,_0x383a69,_0x45f6e6){var _0x4ae45d=_0x3275aa[_0xb95f('0xd')];var _0xf45574=_0x48a4b1[_0xb95f('0xe')]({'plain':!![]});if(_0xf45574[_0xb95f('0xf')][_0xb95f('0x10')]()==='in'||_0xf45574[_0xb95f('0xf')]['toLowerCase']()===_0xb95f('0x11')&&!_0xf45574[_0xb95f('0x12')]&&!_[_0xb95f('0x13')](_0xf45574[_0xb95f('0x14')])){_0x4ae45d[_0xb95f('0x15')][_0xb95f('0x16')]({'where':{'id':_0xf45574[_0xb95f('0x17')]}})[_0xb95f('0x18')](function(_0x5d1a49){if(_0x5d1a49){_0x5d1a49[_0xb95f('0x19')]({'lastMsgAt':_0xf45574[_0xb95f('0x1a')],'lastMsgDirection':_0xf45574[_0xb95f('0xf')][_0xb95f('0x10')]()});}})['catch'](function(_0xad6502){console[_0xb95f('0x1b')](_0xad6502);});}if(_0xf45574['direction']===_0xb95f('0x11')&&!_0xf45574['secret']){var _0x470542;_0x4ae45d[_0xb95f('0x1c')][_0xb95f('0x1d')]()[_0xb95f('0x18')](function(_0x5dbf22){return _0x4ae45d[_0xb95f('0x1e')]['find']({'where':{'id':_0xf45574[_0xb95f('0x1f')]},'include':[{'model':_0x4ae45d[_0xb95f('0x15')],'as':'Interactions','where':{'id':_0xf45574[_0xb95f('0x17')]},'limit':0x1,'include':[{'model':_0x4ae45d[_0xb95f('0x1c')],'as':'Contact','attributes':_['keys'](_0x5dbf22)}]}]});})['then'](function(_0x39b89a){_0x470542=_0x39b89a[_0xb95f('0xe')]({'plain':!![]});if(_0x470542&&_0x470542[_0xb95f('0x20')]){logger[_0xb95f('0x21')]('OpenchannelMessage,\x20%s,\x20%s',_0xb95f('0x22'),util['format'](_0xb95f('0x23'),_0xf45574['id'],_0x470542[_0xb95f('0x20')]));if(_0x470542['Interactions']&&_0x470542[_0xb95f('0x24')][_0xb95f('0x25')]){_0xf45574['Interaction']=_[_0xb95f('0x26')](_0x470542[_0xb95f('0x24')][0x0],_0xb95f('0x27'));_0xf45574['Contact']=_0x470542[_0xb95f('0x24')][0x0][_0xb95f('0x27')];}var _0x383a69={'method':_0xb95f('0x28'),'uri':encodeURI(_0x470542['replyUri']),'json':!![],'resolveWithFullResponse':!![]};switch(_0x383a69[_0xb95f('0x29')]){case _0xb95f('0x2a'):_0x383a69['qs']=_0xf45574;break;case _0xb95f('0x28'):_0x383a69['body']=_0xf45574;break;}return rp(_0x383a69)[_0xb95f('0x18')](function(_0x1e284c){logger[_0xb95f('0x21')](_0xb95f('0x2b'),_0xb95f('0x22'),util['format']('Message\x20%d\x20forwarded\x20to\x20%s',_0xf45574['id'],_0x470542[_0xb95f('0x20')]));if(_0x1e284c['body'][_0xb95f('0x2c')]&&_0x1e284c['body'][_0xb95f('0x2c')]!=_0xf45574[_0xb95f('0x2d')][_0xb95f('0x2c')]){return _0x4ae45d['OpenchannelInteraction'][_0xb95f('0x19')]({'threadId':_0x1e284c[_0xb95f('0x2e')][_0xb95f('0x2c')]},{'where':{'id':_0xf45574['Interaction']['id']}});}else{return;}})['then'](function(){return _0x48a4b1[_0xb95f('0x19')]({'read':!![]});})['catch'](function(_0x47c8ed){logger['error'](_0xb95f('0x2b'),_0xb95f('0x22'),util[_0xb95f('0x2f')](_0x47c8ed,{'showHidden':![],'depth':null}));_0x45f6e6();});}else{_0x45f6e6();}})[_0xb95f('0x30')](function(){_0x45f6e6();});}else{_0x45f6e6();}}},'charset':_0xb95f('0x31'),'collate':_0xb95f('0x32')});}; \ No newline at end of file +var _0x80c1=['OpenchannelAccount','find','Interactions','OpenchannelInteractionId','CmContact','Contact','keys','replyUri','info','OpenchannelMessage,\x20%s,\x20%s','afterCreate','format','Forwarding\x20message\x20%d\x20to\x20%s','Interaction','omit','method','POST','Message\x20%d\x20forwarded\x20to\x20%s','threadId','finally','utf8mb4_unicode_ci','util','api','moment','bluebird','path','./openchannelMessage.attributes','define','OpenchannelMessage','openchannel_messages','fti_openchannel_messages','body','FULLTEXT','get','direction','toLowerCase','out','UserId','OpenchannelInteraction','findOne','then','update','catch','error','secret','describe'];(function(_0x1fe43d,_0x1e0d61){var _0x506a37=function(_0x5acc60){while(--_0x5acc60){_0x1fe43d['push'](_0x1fe43d['shift']());}};_0x506a37(++_0x1e0d61);}(_0x80c1,0x9f));var _0x180c=function(_0x25e974,_0x3a6b0e){_0x25e974=_0x25e974-0x0;var _0x43a4f2=_0x80c1[_0x25e974];return _0x43a4f2;};'use strict';var _=require('lodash');var util=require(_0x180c('0x0'));var logger=require('../../config/logger')(_0x180c('0x1'));var moment=require(_0x180c('0x2'));var BPromise=require(_0x180c('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x180c('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x180c('0x5'));module['exports']=function(_0x140ddf,_0x81d2f8){return _0x140ddf[_0x180c('0x6')](_0x180c('0x7'),attributes,{'tableName':_0x180c('0x8'),'paranoid':![],'indexes':[{'name':_0x180c('0x9'),'fields':[_0x180c('0xa')],'type':_0x180c('0xb')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x60d409,_0x5876e7,_0x52dcc4){var _0x1d9bcf=_0x140ddf['models'];var _0x3dcdc8=_0x60d409[_0x180c('0xc')]({'plain':!![]});if(_0x3dcdc8[_0x180c('0xd')][_0x180c('0xe')]()==='in'||_0x3dcdc8[_0x180c('0xd')][_0x180c('0xe')]()===_0x180c('0xf')&&!_0x3dcdc8['secret']&&!_['isNil'](_0x3dcdc8[_0x180c('0x10')])){_0x1d9bcf[_0x180c('0x11')][_0x180c('0x12')]({'where':{'id':_0x3dcdc8['OpenchannelInteractionId']}})[_0x180c('0x13')](function(_0x23927f){if(_0x23927f){_0x23927f[_0x180c('0x14')]({'lastMsgAt':_0x3dcdc8['createdAt'],'lastMsgDirection':_0x3dcdc8[_0x180c('0xd')][_0x180c('0xe')]()});}})[_0x180c('0x15')](function(_0x165794){console[_0x180c('0x16')](_0x165794);});}if(_0x3dcdc8[_0x180c('0xd')]===_0x180c('0xf')&&!_0x3dcdc8[_0x180c('0x17')]){var _0x3d31a9;_0x1d9bcf['CmContact'][_0x180c('0x18')]()[_0x180c('0x13')](function(_0x1d94b2){return _0x1d9bcf[_0x180c('0x19')][_0x180c('0x1a')]({'where':{'id':_0x3dcdc8['OpenchannelAccountId']},'include':[{'model':_0x1d9bcf[_0x180c('0x11')],'as':_0x180c('0x1b'),'where':{'id':_0x3dcdc8[_0x180c('0x1c')]},'limit':0x1,'include':[{'model':_0x1d9bcf[_0x180c('0x1d')],'as':_0x180c('0x1e'),'attributes':_[_0x180c('0x1f')](_0x1d94b2)}]}]});})['then'](function(_0x27c708){_0x3d31a9=_0x27c708[_0x180c('0xc')]({'plain':!![]});if(_0x3d31a9&&_0x3d31a9[_0x180c('0x20')]){logger[_0x180c('0x21')](_0x180c('0x22'),_0x180c('0x23'),util[_0x180c('0x24')](_0x180c('0x25'),_0x3dcdc8['id'],_0x3d31a9['replyUri']));if(_0x3d31a9[_0x180c('0x1b')]&&_0x3d31a9[_0x180c('0x1b')]['length']){_0x3dcdc8[_0x180c('0x26')]=_[_0x180c('0x27')](_0x3d31a9[_0x180c('0x1b')][0x0],_0x180c('0x1e'));_0x3dcdc8['Contact']=_0x3d31a9[_0x180c('0x1b')][0x0][_0x180c('0x1e')];}var _0x5876e7={'method':'POST','uri':encodeURI(_0x3d31a9[_0x180c('0x20')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x5876e7[_0x180c('0x28')]){case'GET':_0x5876e7['qs']=_0x3dcdc8;break;case _0x180c('0x29'):_0x5876e7[_0x180c('0xa')]=_0x3dcdc8;break;}return rp(_0x5876e7)[_0x180c('0x13')](function(_0x520ce5){logger[_0x180c('0x21')]('OpenchannelMessage,\x20%s,\x20%s',_0x180c('0x23'),util[_0x180c('0x24')](_0x180c('0x2a'),_0x3dcdc8['id'],_0x3d31a9[_0x180c('0x20')]));if(_0x520ce5[_0x180c('0xa')]['threadId']&&_0x520ce5['body'][_0x180c('0x2b')]!=_0x3dcdc8[_0x180c('0x26')][_0x180c('0x2b')]){return _0x1d9bcf['OpenchannelInteraction']['update']({'threadId':_0x520ce5[_0x180c('0xa')][_0x180c('0x2b')]},{'where':{'id':_0x3dcdc8[_0x180c('0x26')]['id']}});}else{return;}})[_0x180c('0x13')](function(){return _0x60d409[_0x180c('0x14')]({'read':!![]});})[_0x180c('0x15')](function(_0x42d39f){logger[_0x180c('0x16')](_0x180c('0x22'),_0x180c('0x23'),util['inspect'](_0x42d39f,{'showHidden':![],'depth':null}));_0x52dcc4();});}else{_0x52dcc4();}})[_0x180c('0x2c')](function(){_0x52dcc4();});}else{_0x52dcc4();}}},'charset':'utf8mb4','collate':_0x180c('0x2d')});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.rpc.js b/server/api/openchannelMessage/openchannelMessage.rpc.js index 1914771..3d88134 100644 --- a/server/api/openchannelMessage/openchannelMessage.rpc.js +++ b/server/api/openchannelMessage/openchannelMessage.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2ef3=['lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','redis','defaults','localhost','socket.io-emitter','./openchannelMessage.socket','register','request','then','OpenchannelMessage,\x20%s,\x20%s','debug','request\x20sent','stringify','code','error','message','result','catch','CreateOpenchannelMessage','create','options','info'];(function(_0xbe1b2d,_0xcae67c){var _0x1e38a3=function(_0x1726d7){while(--_0x1726d7){_0xbe1b2d['push'](_0xbe1b2d['shift']());}};_0x1e38a3(++_0xcae67c);}(_0x2ef3,0xba));var _0x32ef=function(_0x3dca9b,_0x1ec48d){_0x3dca9b=_0x3dca9b-0x0;var _0x475e1d=_0x2ef3[_0x3dca9b];return _0x475e1d;};'use strict';var _=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var moment=require(_0x32ef('0x2'));var BPromise=require(_0x32ef('0x3'));var rs=require(_0x32ef('0x4'));var fs=require('fs');var Redis=require(_0x32ef('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x32ef('0x6'));var logger=require(_0x32ef('0x7'))('rpc');var config=require(_0x32ef('0x8'));var jayson=require(_0x32ef('0x9'));var client=jayson['client']['http']({'port':0x232a});config[_0x32ef('0xa')]=_[_0x32ef('0xb')](config[_0x32ef('0xa')],{'host':_0x32ef('0xc'),'port':0x18eb});var socket=require(_0x32ef('0xd'))(new Redis(config[_0x32ef('0xa')]));require(_0x32ef('0xe'))[_0x32ef('0xf')](socket);function respondWithRpcPromise(_0x28275c,_0x77df79,_0x56eb42){return new BPromise(function(_0x5780e9,_0x401d0b){return client[_0x32ef('0x10')](_0x28275c,_0x56eb42)[_0x32ef('0x11')](function(_0x1499c2){logger['info'](_0x32ef('0x12'),_0x77df79,'request\x20sent');logger[_0x32ef('0x13')]('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x77df79,_0x32ef('0x14'),JSON[_0x32ef('0x15')](_0x1499c2));if(_0x1499c2['error']){if(_0x1499c2['error'][_0x32ef('0x16')]===0x1f4){logger['error'](_0x32ef('0x12'),_0x77df79,_0x1499c2[_0x32ef('0x17')][_0x32ef('0x18')]);return _0x401d0b(_0x1499c2[_0x32ef('0x17')]['message']);}logger['error']('OpenchannelMessage,\x20%s,\x20%s',_0x77df79,_0x1499c2[_0x32ef('0x17')][_0x32ef('0x18')]);return _0x5780e9(_0x1499c2[_0x32ef('0x17')]['message']);}else{logger['info'](_0x32ef('0x12'),_0x77df79,_0x32ef('0x14'));_0x5780e9(_0x1499c2[_0x32ef('0x19')]['message']);}})[_0x32ef('0x1a')](function(_0x33e230){logger['error'](_0x32ef('0x12'),_0x77df79,_0x33e230);_0x401d0b(_0x33e230);});});}exports[_0x32ef('0x1b')]=function(_0x26aff3){var _0x251084=this;return new Promise(function(_0x445cda,_0x3aec05){return db['OpenchannelMessage'][_0x32ef('0x1c')](_0x26aff3['body'],{'raw':_0x26aff3[_0x32ef('0x1d')]?_0x26aff3[_0x32ef('0x1d')]['raw']===undefined?!![]:![]:!![]})[_0x32ef('0x11')](function(_0x97780){logger[_0x32ef('0x1e')]('CreateOpenchannelMessage',_0x26aff3);logger['debug'](_0x32ef('0x1b'),_0x26aff3,JSON[_0x32ef('0x15')](_0x97780));_0x445cda(_0x97780);})[_0x32ef('0x1a')](function(_0x478bef){logger['error'](_0x32ef('0x1b'),_0x478bef['message'],_0x26aff3);_0x3aec05(_0x251084['error'](0x1f4,_0x478bef[_0x32ef('0x18')]));});});}; \ No newline at end of file +var _0x7a54=['../../config/environment','jayson/promise','http','defaults','redis','socket.io-emitter','then','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateOpenchannelMessage','OpenchannelMessage','body','options','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x518947,_0x102d06){var _0x38f5a8=function(_0x4d7c73){while(--_0x4d7c73){_0x518947['push'](_0x518947['shift']());}};_0x38f5a8(++_0x102d06);}(_0x7a54,0x106));var _0x47a5=function(_0x231c2a,_0x553a05){_0x231c2a=_0x231c2a-0x0;var _0x5e6dcd=_0x7a54[_0x231c2a];return _0x5e6dcd;};'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});config['redis']=_[_0x47a5('0xb')](config[_0x47a5('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x47a5('0xd'))(new Redis(config['redis']));require('./openchannelMessage.socket')['register'](socket);function respondWithRpcPromise(_0x2a0e98,_0x2baee7,_0x5e31dd){return new BPromise(function(_0x2eb0dd,_0x49e844){return client['request'](_0x2a0e98,_0x5e31dd)[_0x47a5('0xe')](function(_0x69e4d4){logger[_0x47a5('0xf')](_0x47a5('0x10'),_0x2baee7,_0x47a5('0x11'));logger[_0x47a5('0x12')](_0x47a5('0x13'),_0x2baee7,'request\x20sent',JSON[_0x47a5('0x14')](_0x69e4d4));if(_0x69e4d4[_0x47a5('0x15')]){if(_0x69e4d4[_0x47a5('0x15')][_0x47a5('0x16')]===0x1f4){logger[_0x47a5('0x15')](_0x47a5('0x10'),_0x2baee7,_0x69e4d4[_0x47a5('0x15')][_0x47a5('0x17')]);return _0x49e844(_0x69e4d4['error'][_0x47a5('0x17')]);}logger[_0x47a5('0x15')](_0x47a5('0x10'),_0x2baee7,_0x69e4d4[_0x47a5('0x15')][_0x47a5('0x17')]);return _0x2eb0dd(_0x69e4d4['error']['message']);}else{logger[_0x47a5('0xf')]('OpenchannelMessage,\x20%s,\x20%s',_0x2baee7,'request\x20sent');_0x2eb0dd(_0x69e4d4[_0x47a5('0x18')][_0x47a5('0x17')]);}})[_0x47a5('0x19')](function(_0x1ef371){logger[_0x47a5('0x15')](_0x47a5('0x10'),_0x2baee7,_0x1ef371);_0x49e844(_0x1ef371);});});}exports[_0x47a5('0x1a')]=function(_0xe3c618){var _0x3aed38=this;return new Promise(function(_0x4a9fcb,_0x1570bc){return db[_0x47a5('0x1b')]['create'](_0xe3c618[_0x47a5('0x1c')],{'raw':_0xe3c618[_0x47a5('0x1d')]?_0xe3c618[_0x47a5('0x1d')]['raw']===undefined?!![]:![]:!![]})[_0x47a5('0xe')](function(_0x2f142b){logger[_0x47a5('0xf')](_0x47a5('0x1a'),_0xe3c618);logger['debug'](_0x47a5('0x1a'),_0xe3c618,JSON[_0x47a5('0x14')](_0x2f142b));_0x4a9fcb(_0x2f142b);})['catch'](function(_0x28747d){logger[_0x47a5('0x15')](_0x47a5('0x1a'),_0x28747d[_0x47a5('0x17')],_0xe3c618);_0x1570bc(_0x3aed38[_0x47a5('0x15')](0x1f4,_0x28747d['message']));});});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.socket.js b/server/api/openchannelMessage/openchannelMessage.socket.js index 3e7fae4..10b245c 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 _0xd94e=['update','emit','removeListener','length','save','remove'];(function(_0x247409,_0x2d37f8){var _0x1a88d3=function(_0x4ea850){while(--_0x4ea850){_0x247409['push'](_0x247409['shift']());}};_0x1a88d3(++_0x2d37f8);}(_0xd94e,0xd6));var _0xed94=function(_0x189b1d,_0x1df005){_0x189b1d=_0x189b1d-0x0;var _0x3d8ab0=_0xd94e[_0x189b1d];return _0x3d8ab0;};'use strict';var OpenchannelMessageEvents=require('./openchannelMessage.events');var events=[_0xed94('0x0'),_0xed94('0x1'),_0xed94('0x2')];function createListener(_0x3bd15b,_0x209b54){return function(_0x25e056){_0x209b54[_0xed94('0x3')](_0x3bd15b,_0x25e056);};}function removeListener(_0x1be75d,_0x24bbfe){return function(){OpenchannelMessageEvents[_0xed94('0x4')](_0x1be75d,_0x24bbfe);};}exports['register']=function(_0x220eb2){for(var _0x13f80e=0x0,_0x242575=events[_0xed94('0x5')];_0x13f80e<_0x242575;_0x13f80e++){var _0xd2716e=events[_0x13f80e];var _0x4b1832=createListener('openchannelMessage:'+_0xd2716e,_0x220eb2);OpenchannelMessageEvents['on'](_0xd2716e,_0x4b1832);}}; \ No newline at end of file +var _0x74f3=['save','remove','emit','removeListener','length','openchannelMessage:','./openchannelMessage.events'];(function(_0x47d0ed,_0x211b07){var _0x50929d=function(_0x3c9685){while(--_0x3c9685){_0x47d0ed['push'](_0x47d0ed['shift']());}};_0x50929d(++_0x211b07);}(_0x74f3,0x164));var _0x374f=function(_0x33685c,_0x2b4fe8){_0x33685c=_0x33685c-0x0;var _0xed3c71=_0x74f3[_0x33685c];return _0xed3c71;};'use strict';var OpenchannelMessageEvents=require(_0x374f('0x0'));var events=[_0x374f('0x1'),_0x374f('0x2'),'update'];function createListener(_0x407670,_0x29c056){return function(_0x3dee9d){_0x29c056[_0x374f('0x3')](_0x407670,_0x3dee9d);};}function removeListener(_0x4a3be7,_0x3db0a){return function(){OpenchannelMessageEvents[_0x374f('0x4')](_0x4a3be7,_0x3db0a);};}exports['register']=function(_0x1292f2){for(var _0x1eb333=0x0,_0x405e93=events[_0x374f('0x5')];_0x1eb333<_0x405e93;_0x1eb333++){var _0x3bcc86=events[_0x1eb333];var _0x394073=createListener(_0x374f('0x6')+_0x3bcc86,_0x1292f2);OpenchannelMessageEvents['on'](_0x3bcc86,_0x394073);}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/index.js b/server/api/openchannelQueue/index.js index ee0b4f0..e977732 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 _0xe6d0=['addTeams','/:id/users','addAgents','update','delete','removeTeams','removeAgents','exports','multer','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','/:id','show','/:id/members','getMembers','/:id/teams','getAgents','post'];(function(_0x120ead,_0x4a78f2){var _0x20315e=function(_0x6b9027){while(--_0x6b9027){_0x120ead['push'](_0x120ead['shift']());}};_0x20315e(++_0x4a78f2);}(_0xe6d0,0x131));var _0x0e6d=function(_0x19cb1a,_0x4ce1b2){_0x19cb1a=_0x19cb1a-0x0;var _0x399650=_0xe6d0[_0x19cb1a];return _0x399650;};'use strict';var multer=require(_0x0e6d('0x0'));var util=require(_0x0e6d('0x1'));var path=require(_0x0e6d('0x2'));var timeout=require('connect-timeout');var express=require(_0x0e6d('0x3'));var router=express[_0x0e6d('0x4')]();var fs_extra=require(_0x0e6d('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x0e6d('0x6'));var config=require(_0x0e6d('0x7'));var controller=require('./openchannelQueue.controller');router[_0x0e6d('0x8')]('/',auth[_0x0e6d('0x9')](),controller['index']);router[_0x0e6d('0x8')](_0x0e6d('0xa'),auth['isAuthenticated'](),controller[_0x0e6d('0xb')]);router[_0x0e6d('0x8')](_0x0e6d('0xc'),auth[_0x0e6d('0x9')](),controller[_0x0e6d('0xd')]);router[_0x0e6d('0x8')](_0x0e6d('0xe'),auth[_0x0e6d('0x9')](),controller[_0x0e6d('0xf')]);router[_0x0e6d('0x8')](_0x0e6d('0x10'),auth[_0x0e6d('0x9')](),controller['getTeams']);router['get']('/:id/users',auth['isAuthenticated'](),controller[_0x0e6d('0x11')]);router['post']('/',auth[_0x0e6d('0x9')](),controller['create']);router[_0x0e6d('0x12')]('/:id/teams',auth[_0x0e6d('0x9')](),controller[_0x0e6d('0x13')]);router['post'](_0x0e6d('0x14'),auth['isAuthenticated'](),controller[_0x0e6d('0x15')]);router['put'](_0x0e6d('0xc'),auth[_0x0e6d('0x9')](),controller[_0x0e6d('0x16')]);router[_0x0e6d('0x17')]('/:id',auth[_0x0e6d('0x9')](),controller['destroy']);router[_0x0e6d('0x17')](_0x0e6d('0x10'),auth[_0x0e6d('0x9')](),controller[_0x0e6d('0x18')]);router['delete'](_0x0e6d('0x14'),auth[_0x0e6d('0x9')](),controller[_0x0e6d('0x19')]);module[_0x0e6d('0x1a')]=router; \ No newline at end of file +var _0xa2af=['/:id/teams','getTeams','/:id/users','getAgents','create','post','addTeams','addAgents','put','update','delete','destroy','removeTeams','removeAgents','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelQueue.controller','isAuthenticated','get','/describe','/:id','/:id/members','getMembers'];(function(_0x5434b2,_0x1165e4){var _0x529056=function(_0x3a8c9b){while(--_0x3a8c9b){_0x5434b2['push'](_0x5434b2['shift']());}};_0x529056(++_0x1165e4);}(_0xa2af,0xe0));var _0xfa2a=function(_0x246bd4,_0x58ae16){_0x246bd4=_0x246bd4-0x0;var _0x739c67=_0xa2af[_0x246bd4];return _0x739c67;};'use strict';var multer=require('multer');var util=require(_0xfa2a('0x0'));var path=require(_0xfa2a('0x1'));var timeout=require(_0xfa2a('0x2'));var express=require(_0xfa2a('0x3'));var router=express[_0xfa2a('0x4')]();var fs_extra=require(_0xfa2a('0x5'));var auth=require(_0xfa2a('0x6'));var interaction=require(_0xfa2a('0x7'));var config=require(_0xfa2a('0x8'));var controller=require(_0xfa2a('0x9'));router['get']('/',auth[_0xfa2a('0xa')](),controller['index']);router[_0xfa2a('0xb')](_0xfa2a('0xc'),auth[_0xfa2a('0xa')](),controller['describe']);router['get'](_0xfa2a('0xd'),auth[_0xfa2a('0xa')](),controller['show']);router[_0xfa2a('0xb')](_0xfa2a('0xe'),auth['isAuthenticated'](),controller[_0xfa2a('0xf')]);router['get'](_0xfa2a('0x10'),auth[_0xfa2a('0xa')](),controller[_0xfa2a('0x11')]);router[_0xfa2a('0xb')](_0xfa2a('0x12'),auth[_0xfa2a('0xa')](),controller[_0xfa2a('0x13')]);router['post']('/',auth[_0xfa2a('0xa')](),controller[_0xfa2a('0x14')]);router[_0xfa2a('0x15')](_0xfa2a('0x10'),auth['isAuthenticated'](),controller[_0xfa2a('0x16')]);router[_0xfa2a('0x15')]('/:id/users',auth['isAuthenticated'](),controller[_0xfa2a('0x17')]);router[_0xfa2a('0x18')](_0xfa2a('0xd'),auth[_0xfa2a('0xa')](),controller[_0xfa2a('0x19')]);router[_0xfa2a('0x1a')](_0xfa2a('0xd'),auth['isAuthenticated'](),controller[_0xfa2a('0x1b')]);router[_0xfa2a('0x1a')](_0xfa2a('0x10'),auth['isAuthenticated'](),controller[_0xfa2a('0x1c')]);router[_0xfa2a('0x1a')]('/:id/users',auth['isAuthenticated'](),controller[_0xfa2a('0x1d')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.attributes.js b/server/api/openchannelQueue/openchannelQueue.attributes.js index 2603813..0937e55 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 _0xa0bd=['sequelize','exports','name','ENUM','rrmemory','beepall','roundrobin'];(function(_0x122266,_0x2e52b1){var _0x19aee9=function(_0x8c9cd7){while(--_0x8c9cd7){_0x122266['push'](_0x122266['shift']());}};_0x19aee9(++_0x2e52b1);}(_0xa0bd,0x19d));var _0xda0b=function(_0x19b01b,_0x10ce58){_0x19b01b=_0x19b01b-0x0;var _0x262462=_0xa0bd[_0x19b01b];return _0x262462;};'use strict';var Sequelize=require(_0xda0b('0x0'));module[_0xda0b('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xda0b('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xda0b('0x3')](_0xda0b('0x4'),_0xda0b('0x5'),_0xda0b('0x6'))}}; \ No newline at end of file +var _0x439c=['rrmemory','beepall','roundrobin','sequelize','STRING','INTEGER'];(function(_0x1a4ced,_0x166f65){var _0x4f93d0=function(_0x4d43bb){while(--_0x4d43bb){_0x1a4ced['push'](_0x1a4ced['shift']());}};_0x4f93d0(++_0x166f65);}(_0x439c,0xff));var _0xc439=function(_0x433f47,_0x26fe3a){_0x433f47=_0x433f47-0x0;var _0x4b5ff2=_0x439c[_0x433f47];return _0x4b5ff2;};'use strict';var Sequelize=require(_0xc439('0x0'));module['exports']={'name':{'type':Sequelize[_0xc439('0x1')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xc439('0x1')]},'timeout':{'type':Sequelize[_0xc439('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0xc439('0x3'),_0xc439('0x4'),_0xc439('0x5'))}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.controller.js b/server/api/openchannelQueue/openchannelQueue.controller.js index 3b784e6..15f0d31 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 _0x8234=['stack','name','send','index','map','rawAttributes','fieldName','type','key','getOptions','where','OpenchannelQueue','include','query','findAll','rows','catch','show','params','model','keys','filters','intersection','attributes','fields','includeAll','merge','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','OpenchannelQueues','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserOpenchannelQueue','hasOwnProperty','order','sort','pick','filter','User','agent','openchannelPause','format','%s/%s','SIP','updatedAt','getTeams','Team','length','addTeams','ids','Agents','online','voicePause','interface','transaction','each','forEach','emit','select','field','tq.TeamId','team_has_openchannel_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','OpenchannelQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','sequelize','toString','QueryTypes','SELECT','TeamId','includes','all','union','compact','value','removeTeams','isEmpty','removeAgents','addAgents','omit','spread','userOpenchannelQueue:save','isArray','userOpenchannelQueue:remove','getAgents','nolimit','bluebird','util','squel','ioredis','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelQueue.socket','register','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','update','destroy','then','get','end'];(function(_0x1b4bf6,_0x24ffa8){var _0x7c8dca=function(_0x38f806){while(--_0x38f806){_0x1b4bf6['push'](_0x1b4bf6['shift']());}};_0x7c8dca(++_0x24ffa8);}(_0x8234,0xe6));var _0x4823=function(_0x1e660a,_0x5bb483){_0x1e660a=_0x1e660a-0x0;var _0x11507b=_0x8234[_0x1e660a];return _0x11507b;};'use strict';var BPromise=require(_0x4823('0x0'));var util=require(_0x4823('0x1'));var _=require('lodash');var squel=require(_0x4823('0x2'));var Redis=require(_0x4823('0x3'));var qs=require('../../components/parsers/qs');var logger=require(_0x4823('0x4'))(_0x4823('0x5'));var config=require(_0x4823('0x6'));var db=require(_0x4823('0x7'))['db'];config[_0x4823('0x8')]=_[_0x4823('0x9')](config[_0x4823('0x8')],{'host':_0x4823('0xa'),'port':0x18eb});var socket=require(_0x4823('0xb'))(new Redis(config['redis']));require(_0x4823('0xc'))[_0x4823('0xd')](socket);function respondWithStatusCode(_0x476573,_0x42a976){_0x42a976=_0x42a976||0xcc;return function(_0x303713){if(_0x303713){return _0x476573[_0x4823('0xe')](_0x42a976);}return _0x476573[_0x4823('0xf')](_0x42a976)['end']();};}function respondWithResult(_0x1d8a23,_0x4ddd46){_0x4ddd46=_0x4ddd46||0xc8;return function(_0x105578){if(_0x105578){return _0x1d8a23[_0x4823('0xf')](_0x4ddd46)['json'](_0x105578);}};}function respondWithFilteredResult(_0x5bb013,_0x4c78bd){return function(_0x5e5fa1){if(_0x5e5fa1){var _0x2b7a44=typeof _0x4c78bd[_0x4823('0x10')]===_0x4823('0x11')&&typeof _0x4c78bd[_0x4823('0x12')]==='undefined';var _0x3f1094=_0x5e5fa1[_0x4823('0x13')];var _0x2dfad3=_0x2b7a44?0x0:_0x4c78bd[_0x4823('0x10')];var _0x5deeaf=_0x2b7a44?_0x5e5fa1[_0x4823('0x13')]:_0x4c78bd[_0x4823('0x10')]+_0x4c78bd[_0x4823('0x12')];var _0x2f5e6f;if(_0x5deeaf>=_0x3f1094){_0x5deeaf=_0x3f1094;_0x2f5e6f=0xc8;}else{_0x2f5e6f=0xce;}_0x5bb013[_0x4823('0xf')](_0x2f5e6f);return _0x5bb013[_0x4823('0x14')](_0x4823('0x15'),_0x2dfad3+'-'+_0x5deeaf+'/'+_0x3f1094)[_0x4823('0x16')](_0x5e5fa1);}return null;};}function saveUpdates(_0x24262f){return function(_0xb75dc8){if(_0xb75dc8){return _0xb75dc8[_0x4823('0x17')](_0x24262f)['then'](function(_0x32cc41){return _0x32cc41;});}return null;};}function removeEntity(_0x2b49df){return function(_0x4d15de){if(_0x4d15de){return _0x4d15de[_0x4823('0x18')]()[_0x4823('0x19')](function(){var _0x2b14b0=_0x4d15de[_0x4823('0x1a')]({'plain':!![]});var _0x1ae2f3='OpenchannelQueues';return db['UserProfileResource']['destroy']({'where':{'type':_0x1ae2f3,'resourceId':_0x2b14b0['id']}})['then'](function(){return _0x4d15de;});})[_0x4823('0x19')](function(){_0x2b49df['status'](0xcc)[_0x4823('0x1b')]();});}};}function handleEntityNotFound(_0xa36f7b){return function(_0x493b48){if(!_0x493b48){_0xa36f7b[_0x4823('0xe')](0x194);}return _0x493b48;};}function handleError(_0x44bacf,_0x4dad35){_0x4dad35=_0x4dad35||0x1f4;return function(_0x190430){logger['error'](_0x190430[_0x4823('0x1c')]);if(_0x190430['name']){delete _0x190430[_0x4823('0x1d')];}_0x44bacf[_0x4823('0xf')](_0x4dad35)[_0x4823('0x1e')](_0x190430);};}exports[_0x4823('0x1f')]=function(_0x32ff5e,_0x21fabc){var _0x502194={};var _0x53c4f6={'count':0x0,'rows':[]};var _0x289c43=_[_0x4823('0x20')](db['OpenchannelQueue'][_0x4823('0x21')],function(_0x4a0c06){return{'name':_0x4a0c06[_0x4823('0x22')],'type':_0x4a0c06[_0x4823('0x23')][_0x4823('0x24')]};});_0x502194=qs[_0x4823('0x25')](_0x289c43,_0x32ff5e);var _0x3ab9e4={'where':_0x502194[_0x4823('0x26')]};return db[_0x4823('0x27')]['count'](_0x3ab9e4)[_0x4823('0x19')](function(_0x4d9e3c){_0x53c4f6['count']=_0x4d9e3c;_0x502194[_0x4823('0x28')]=qs['include'](_0x32ff5e[_0x4823('0x29')]);return db[_0x4823('0x27')][_0x4823('0x2a')](_0x502194);})[_0x4823('0x19')](function(_0x5ed616){_0x53c4f6[_0x4823('0x2b')]=_0x5ed616;return _0x53c4f6;})[_0x4823('0x19')](respondWithFilteredResult(_0x21fabc,_0x502194))[_0x4823('0x2c')](handleError(_0x21fabc,null));};exports[_0x4823('0x2d')]=function(_0x38616c,_0x42bd0e){var _0x691f8e={'raw':!![],'where':{'id':_0x38616c[_0x4823('0x2e')]['id']}},_0x7fdf3a={};_0x7fdf3a[_0x4823('0x2f')]=_[_0x4823('0x30')](db[_0x4823('0x27')][_0x4823('0x21')]);_0x7fdf3a[_0x4823('0x29')]=_['keys'](_0x38616c[_0x4823('0x29')]);_0x7fdf3a[_0x4823('0x31')]=_[_0x4823('0x32')](_0x7fdf3a['model'],_0x7fdf3a[_0x4823('0x29')]);_0x691f8e[_0x4823('0x33')]=_[_0x4823('0x32')](_0x7fdf3a[_0x4823('0x2f')],qs[_0x4823('0x34')](_0x38616c[_0x4823('0x29')]['fields']));_0x691f8e[_0x4823('0x33')]=_0x691f8e[_0x4823('0x33')]['length']?_0x691f8e['attributes']:_0x7fdf3a[_0x4823('0x2f')];if(_0x38616c[_0x4823('0x29')][_0x4823('0x35')]){_0x691f8e[_0x4823('0x28')]=[{'all':!![]}];}_0x691f8e=_[_0x4823('0x36')]({},_0x691f8e,_0x38616c[_0x4823('0x37')]);return db['OpenchannelQueue'][_0x4823('0x38')](_0x691f8e)[_0x4823('0x19')](handleEntityNotFound(_0x42bd0e,null))[_0x4823('0x19')](respondWithResult(_0x42bd0e,null))[_0x4823('0x2c')](handleError(_0x42bd0e,null));};exports[_0x4823('0x39')]=function(_0x3d34ce,_0x22c97f){return db[_0x4823('0x27')]['create'](_0x3d34ce[_0x4823('0x3a')],{})[_0x4823('0x19')](function(_0xc11d8e){var _0xfff282=_0x3d34ce[_0x4823('0x3b')][_0x4823('0x1a')]({'plain':!![]});if(!_0xfff282)throw new Error(_0x4823('0x3c'));if(_0xfff282[_0x4823('0x3d')]===_0x4823('0x3b')){var _0x1c4405=_0xc11d8e['get']({'plain':!![]});var _0xb8cbf9=_0x4823('0x3e');return db[_0x4823('0x3f')][_0x4823('0x38')]({'where':{'name':_0xb8cbf9,'userProfileId':_0xfff282[_0x4823('0x40')]},'raw':!![]})[_0x4823('0x19')](function(_0x2034db){if(_0x2034db&&_0x2034db[_0x4823('0x41')]===0x0){return db[_0x4823('0x42')][_0x4823('0x39')]({'name':_0x1c4405[_0x4823('0x1d')],'resourceId':_0x1c4405['id'],'type':_0x2034db[_0x4823('0x1d')],'sectionId':_0x2034db['id']},{})['then'](function(){return _0xc11d8e;});}else{return _0xc11d8e;}})[_0x4823('0x2c')](function(_0x3c0710){logger['error'](_0x4823('0x43'),_0x3c0710);throw _0x3c0710;});}return _0xc11d8e;})[_0x4823('0x19')](respondWithResult(_0x22c97f,0xc9))[_0x4823('0x2c')](handleError(_0x22c97f,null));};exports[_0x4823('0x17')]=function(_0x160dde,_0x190c28){if(_0x160dde['body']['id']){delete _0x160dde[_0x4823('0x3a')]['id'];}return db[_0x4823('0x27')][_0x4823('0x38')]({'where':{'id':_0x160dde[_0x4823('0x2e')]['id']}})[_0x4823('0x19')](handleEntityNotFound(_0x190c28,null))['then'](saveUpdates(_0x160dde[_0x4823('0x3a')],null))[_0x4823('0x19')](respondWithResult(_0x190c28,null))[_0x4823('0x2c')](handleError(_0x190c28,null));};exports[_0x4823('0x18')]=function(_0x28547c,_0x25ace2){return db[_0x4823('0x27')]['find']({'where':{'id':_0x28547c['params']['id']}})['then'](handleEntityNotFound(_0x25ace2,null))[_0x4823('0x19')](removeEntity(_0x25ace2,null))[_0x4823('0x2c')](handleError(_0x25ace2,null));};exports[_0x4823('0x44')]=function(_0x2845c9,_0x55c0da){return db[_0x4823('0x27')][_0x4823('0x44')]()['then'](respondWithResult(_0x55c0da,null))['catch'](handleError(_0x55c0da,null));};exports[_0x4823('0x45')]=function(_0x1e6939,_0x5c4810){var _0xef4e87={'raw':!![],'where':{}},_0x1871d7={},_0x4bb710;return db['OpenchannelQueue'][_0x4823('0x46')]({'where':{'id':_0x1e6939[_0x4823('0x2e')]['id']}})['then'](handleEntityNotFound(_0x5c4810,null))[_0x4823('0x19')](function(_0x442b1d){if(_0x442b1d){_0x4bb710=_0x442b1d[_0x4823('0x1a')]({'plain':!![]});_0x1871d7['model']=_[_0x4823('0x30')](db[_0x4823('0x47')][_0x4823('0x21')]);_0x1871d7[_0x4823('0x29')]=_[_0x4823('0x30')](_0x1e6939[_0x4823('0x29')]);_0x1871d7[_0x4823('0x31')]=_['intersection'](_0x1871d7[_0x4823('0x2f')],_0x1871d7[_0x4823('0x29')]);_0xef4e87['attributes']=_[_0x4823('0x32')](_0x1871d7['model'],qs['fields'](_0x1e6939[_0x4823('0x29')][_0x4823('0x34')]));_0xef4e87[_0x4823('0x33')]=_0xef4e87[_0x4823('0x33')]['length']?_0xef4e87[_0x4823('0x33')]:_0x1871d7[_0x4823('0x2f')];if(!_0x1e6939['query'][_0x4823('0x48')]('nolimit')){_0xef4e87[_0x4823('0x12')]=qs[_0x4823('0x12')](_0x1e6939['query'][_0x4823('0x12')]);_0xef4e87[_0x4823('0x10')]=qs[_0x4823('0x10')](_0x1e6939[_0x4823('0x29')][_0x4823('0x10')]);}_0xef4e87[_0x4823('0x49')]=qs['sort'](_0x1e6939['query'][_0x4823('0x4a')]);_0xef4e87[_0x4823('0x26')]=qs[_0x4823('0x31')](_[_0x4823('0x4b')](_0x1e6939[_0x4823('0x29')],_0x1871d7[_0x4823('0x31')]));_0xef4e87['where']['OpenchannelQueueId']=_0x442b1d['id'];if(_0x1e6939['query'][_0x4823('0x4c')]){_0xef4e87[_0x4823('0x26')]=_['merge'](_0xef4e87['where'],{'$or':_['map'](_0xef4e87[_0x4823('0x33')],function(_0x855b2d){var _0x444d21={};_0x444d21[_0x855b2d]={'$like':'%'+_0x1e6939[_0x4823('0x29')][_0x4823('0x4c')]+'%'};return _0x444d21;})});}_0xef4e87=_[_0x4823('0x36')]({},_0xef4e87,_0x1e6939[_0x4823('0x37')]);return db[_0x4823('0x47')][_0x4823('0x2a')](_0xef4e87);}})[_0x4823('0x19')](function(_0x2cfcb1){if(_0x2cfcb1){return db[_0x4823('0x4d')]['findAndCountAll']({'where':{'id':_['map'](_0x2cfcb1,'UserId'),'role':_0x4823('0x4e')},'attributes':['id',_0x4823('0x1d'),_0x4823('0x4f'),'updatedAt','createdAt']});}})[_0x4823('0x19')](function(_0x2c1a5e){if(_0x2c1a5e){return{'count':_0x2c1a5e[_0x4823('0x13')],'rows':_[_0x4823('0x20')](_0x2c1a5e[_0x4823('0x2b')],function(_0x2bc2c0){return{'membername':_0x2bc2c0[_0x4823('0x1d')],'UserId':_0x2bc2c0['id'],'queue_name':_0x4bb710[_0x4823('0x1d')],'OpenchannelQueueId':_0x4bb710['id'],'interface':util[_0x4823('0x50')](_0x4823('0x51'),_0x4823('0x52'),_0x2bc2c0['name']),'penalty':0x0,'paused':_0x2bc2c0[_0x4823('0x4f')],'createdAt':_0x2bc2c0['createdAt'],'updatedAt':_0x2bc2c0[_0x4823('0x53')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x4823('0x19')](respondWithFilteredResult(_0x5c4810,_0xef4e87))[_0x4823('0x2c')](handleError(_0x5c4810,null));};exports[_0x4823('0x54')]=function(_0x54b931,_0x1cec58){var _0x55bd72={};var _0x29daf1={};var _0x562add;var _0x255daf;return db[_0x4823('0x27')][_0x4823('0x46')]({'where':{'id':_0x54b931['params']['id']}})[_0x4823('0x19')](handleEntityNotFound(_0x1cec58,null))[_0x4823('0x19')](function(_0x274280){if(_0x274280){_0x562add=_0x274280;_0x29daf1[_0x4823('0x2f')]=_[_0x4823('0x30')](db[_0x4823('0x55')]['rawAttributes']);_0x29daf1['query']=_[_0x4823('0x30')](_0x54b931[_0x4823('0x29')]);_0x29daf1[_0x4823('0x31')]=_['intersection'](_0x29daf1[_0x4823('0x2f')],_0x29daf1['query']);_0x55bd72['attributes']=_[_0x4823('0x32')](_0x29daf1[_0x4823('0x2f')],qs[_0x4823('0x34')](_0x54b931[_0x4823('0x29')][_0x4823('0x34')]));_0x55bd72[_0x4823('0x33')]=_0x55bd72[_0x4823('0x33')][_0x4823('0x56')]?_0x55bd72[_0x4823('0x33')]:_0x29daf1['model'];_0x55bd72[_0x4823('0x49')]=qs[_0x4823('0x4a')](_0x54b931[_0x4823('0x29')]['sort']);_0x55bd72[_0x4823('0x26')]=qs['filters'](_[_0x4823('0x4b')](_0x54b931[_0x4823('0x29')],_0x29daf1[_0x4823('0x31')]));if(_0x54b931[_0x4823('0x29')][_0x4823('0x4c')]){_0x55bd72[_0x4823('0x26')]=_[_0x4823('0x36')](_0x55bd72[_0x4823('0x26')],{'$or':_['map'](_0x55bd72[_0x4823('0x33')],function(_0x1def41){var _0x3470da={};_0x3470da[_0x1def41]={'$like':'%'+_0x54b931['query'][_0x4823('0x4c')]+'%'};return _0x3470da;})});}_0x55bd72=_['merge']({},_0x55bd72,_0x54b931[_0x4823('0x37')]);return _0x562add[_0x4823('0x54')](_0x55bd72);}})['then'](function(_0x19af9f){if(_0x19af9f){_0x255daf=_0x19af9f[_0x4823('0x56')];if(!_0x54b931[_0x4823('0x29')][_0x4823('0x48')]('nolimit')){_0x55bd72[_0x4823('0x12')]=qs[_0x4823('0x12')](_0x54b931[_0x4823('0x29')]['limit']);_0x55bd72[_0x4823('0x10')]=qs[_0x4823('0x10')](_0x54b931['query'][_0x4823('0x10')]);}return _0x562add[_0x4823('0x54')](_0x55bd72);}})['then'](function(_0x5b6e59){if(_0x5b6e59){return _0x5b6e59?{'count':_0x255daf,'rows':_0x5b6e59}:null;}})[_0x4823('0x19')](respondWithResult(_0x1cec58,null))[_0x4823('0x2c')](handleError(_0x1cec58,null));};exports[_0x4823('0x57')]=function(_0x1cfefb,_0x357d90){var _0x3f535f=_0x1cfefb['body'][_0x4823('0x58')];return db[_0x4823('0x55')][_0x4823('0x2a')]({'where':{'id':_0x3f535f},'attributes':['id'],'include':[{'model':db[_0x4823('0x4d')],'as':_0x4823('0x59'),'attributes':['id',_0x4823('0x1d'),_0x4823('0x5a'),_0x4823('0x5b'),_0x4823('0x5c')],'raw':!![]}]})['then'](function(_0x4454fd){if(_0x4454fd){var _0x136b62=_['flatMap'](_0x4454fd,function(_0xa4ff0f){var _0x437143=_0xa4ff0f['get']({'plain':!![]});return _0x437143[_0x4823('0x59')];});return db['OpenchannelQueue'][_0x4823('0x38')]({'where':{'id':_0x1cfefb['params']['id']}})[_0x4823('0x19')](function(_0x546881){return db['sequelize'][_0x4823('0x5d')](function(_0x12f928){return _0x546881[_0x4823('0x57')](_0x3f535f,{'transaction':_0x12f928})[_0x4823('0x19')](function(){return BPromise[_0x4823('0x5e')](_0x136b62,function(_0x35dab1){return db[_0x4823('0x47')]['findOrCreate']({'where':{'UserId':_0x35dab1['id'],'OpenchannelQueueId':_0x1cfefb[_0x4823('0x2e')]['id']},'transaction':_0x12f928});});})['then'](function(){_0x136b62[_0x4823('0x5f')](function(_0x355cd3){socket[_0x4823('0x60')]('userOpenchannelQueue:save',{'UserId':_0x355cd3['id'],'OpenchannelQueueId':_0x546881['id']});});});});});}})[_0x4823('0x19')](respondWithStatusCode(_0x357d90,null))['catch'](handleError(_0x357d90,null));};exports['removeTeams']=function(_0x5ecbd5,_0x13a65a){return db[_0x4823('0x55')][_0x4823('0x2a')]({'where':{'id':_0x5ecbd5[_0x4823('0x29')]['ids']},'attributes':['id'],'include':[{'model':db[_0x4823('0x4d')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x4823('0x19')](handleEntityNotFound(_0x13a65a,null))[_0x4823('0x19')](function(_0x273942){var _0x3d8e34=_[_0x4823('0x20')](_0x273942,'id');var _0x43fd78=[];var _0x1a9edb=[];var _0x1928eb=squel[_0x4823('0x61')]();_0x1928eb[_0x4823('0x62')](_0x4823('0x63'))['from'](_0x4823('0x64'),'tq')[_0x4823('0x65')](_0x4823('0x66'),'ut',_0x4823('0x67'))[_0x4823('0x26')](_0x4823('0x68'),_0x5ecbd5[_0x4823('0x2e')]['id']);for(var _0x3be159=0x0;_0x3be159<_0x273942[_0x4823('0x56')];_0x3be159+=0x1){let _0x54892d=_0x273942[_0x3be159];for(var _0x549a81=0x0;_0x549a81<_0x54892d[_0x4823('0x59')]['length'];_0x549a81+=0x1){let _0x3d8223=_0x54892d[_0x4823('0x59')][_0x549a81];var _0x3e41fb=_0x1928eb[_0x4823('0x69')]();_0x3e41fb['where'](_0x4823('0x6a'),_0x3d8223['id']);_0x1a9edb[_0x4823('0x6b')](db[_0x4823('0x6c')][_0x4823('0x29')](_0x3e41fb[_0x4823('0x6d')](),{'type':db[_0x4823('0x6c')][_0x4823('0x6e')][_0x4823('0x6f')]})[_0x4823('0x19')](function(_0x1489b4){if(_0x1489b4[_0x4823('0x56')]===0x1){return _0x3d8223['id'];}else{var _0x2d1063=_['every'](_[_0x4823('0x20')](_0x1489b4,_0x4823('0x70')),function(_0x2562ef){return _[_0x4823('0x71')](_0x3d8e34,_0x2562ef);});if(_0x2d1063){return _0x3d8223['id'];}}}));}}return BPromise[_0x4823('0x72')](_0x1a9edb)[_0x4823('0x19')](function(_0x2099d0){_0x43fd78=_(_0x43fd78)[_0x4823('0x73')](_0x2099d0)[_0x4823('0x74')]()[_0x4823('0x75')]();return db['OpenchannelQueue'][_0x4823('0x38')]({'where':{'id':_0x5ecbd5['params']['id']}})['then'](function(_0x2fad67){return db[_0x4823('0x6c')][_0x4823('0x5d')](function(_0x2e564){return _0x2fad67[_0x4823('0x76')](_0x5ecbd5[_0x4823('0x29')][_0x4823('0x58')],{'transaction':_0x2e564})[_0x4823('0x19')](function(){if(!_[_0x4823('0x77')](_0x43fd78)){return _0x2fad67[_0x4823('0x78')](_0x43fd78,{'transaction':_0x2e564});}})[_0x4823('0x19')](function(){_0x43fd78['forEach'](function(_0x55a17d){socket[_0x4823('0x60')]('userOpenchannelQueue:remove',{'UserId':_0x55a17d,'OpenchannelQueueId':_0x2fad67['id']});});});});});});})[_0x4823('0x19')](respondWithStatusCode(_0x13a65a,null))[_0x4823('0x2c')](handleError(_0x13a65a,null));};exports['addAgents']=function(_0x1f6781,_0x338d85){return db[_0x4823('0x27')][_0x4823('0x38')]({'where':{'id':_0x1f6781[_0x4823('0x2e')]['id']}})[_0x4823('0x19')](handleEntityNotFound(_0x338d85,null))[_0x4823('0x19')](function(_0xb5c570){if(_0xb5c570){return _0xb5c570[_0x4823('0x79')](_0x1f6781[_0x4823('0x3a')]['ids'],_[_0x4823('0x7a')](_0x1f6781['body'],[_0x4823('0x58'),'id'])||{})[_0x4823('0x7b')](function(_0x273f96){for(var _0x4f2a5a=0x0;_0x4f2a5a<_0x1f6781[_0x4823('0x3a')][_0x4823('0x58')][_0x4823('0x56')];_0x4f2a5a+=0x1){socket[_0x4823('0x60')](_0x4823('0x7c'),{'UserId':Number(_0x1f6781[_0x4823('0x3a')][_0x4823('0x58')][_0x4f2a5a]),'OpenchannelQueueId':Number(_0x1f6781[_0x4823('0x2e')]['id'])});}return _0x273f96;});}})[_0x4823('0x19')](respondWithResult(_0x338d85,null))[_0x4823('0x2c')](handleError(_0x338d85,null));};exports['removeAgents']=function(_0x9f5e1a,_0x3d1c46){return db[_0x4823('0x27')]['find']({'where':{'id':_0x9f5e1a[_0x4823('0x2e')]['id']}})[_0x4823('0x19')](handleEntityNotFound(_0x3d1c46,null))['then'](function(_0x48b0c0){if(_0x48b0c0){return _0x48b0c0[_0x4823('0x78')](_0x9f5e1a[_0x4823('0x29')][_0x4823('0x58')])[_0x4823('0x19')](function(){if(_[_0x4823('0x7d')](_0x9f5e1a['query'][_0x4823('0x58')])){for(var _0x4f4243=0x0;_0x4f4243<_0x9f5e1a[_0x4823('0x29')][_0x4823('0x58')][_0x4823('0x56')];_0x4f4243+=0x1){socket[_0x4823('0x60')](_0x4823('0x7e'),{'UserId':Number(_0x9f5e1a[_0x4823('0x29')][_0x4823('0x58')][_0x4f4243]),'OpenchannelQueueId':Number(_0x9f5e1a[_0x4823('0x2e')]['id'])});}}else{socket[_0x4823('0x60')](_0x4823('0x7e'),{'UserId':Number(_0x9f5e1a[_0x4823('0x29')][_0x4823('0x58')]),'OpenchannelQueueId':Number(_0x9f5e1a[_0x4823('0x2e')]['id'])});}});}})['then'](respondWithStatusCode(_0x3d1c46,null))[_0x4823('0x2c')](handleError(_0x3d1c46,null));};exports[_0x4823('0x7f')]=function(_0x4ee40b,_0x25e299){var _0x3e5f2e={};var _0x147d90={};var _0x50464d;var _0x45de0;return db[_0x4823('0x27')][_0x4823('0x46')]({'where':{'id':_0x4ee40b[_0x4823('0x2e')]['id']}})[_0x4823('0x19')](handleEntityNotFound(_0x25e299,null))[_0x4823('0x19')](function(_0x302d5d){if(_0x302d5d){_0x50464d=_0x302d5d;_0x147d90[_0x4823('0x2f')]=_[_0x4823('0x30')](db[_0x4823('0x4d')][_0x4823('0x21')]);_0x147d90[_0x4823('0x29')]=_['keys'](_0x4ee40b['query']);_0x147d90[_0x4823('0x31')]=_[_0x4823('0x32')](_0x147d90['model'],_0x147d90[_0x4823('0x29')]);_0x3e5f2e[_0x4823('0x33')]=_[_0x4823('0x32')](_0x147d90[_0x4823('0x2f')],qs['fields'](_0x4ee40b[_0x4823('0x29')]['fields']));_0x3e5f2e[_0x4823('0x33')]=_0x3e5f2e[_0x4823('0x33')]['length']?_0x3e5f2e[_0x4823('0x33')]:_0x147d90[_0x4823('0x2f')];_0x3e5f2e[_0x4823('0x49')]=qs[_0x4823('0x4a')](_0x4ee40b['query'][_0x4823('0x4a')]);_0x3e5f2e[_0x4823('0x26')]=qs[_0x4823('0x31')](_[_0x4823('0x4b')](_0x4ee40b[_0x4823('0x29')],_0x147d90[_0x4823('0x31')]));if(_0x4ee40b['query']['filter']){_0x3e5f2e[_0x4823('0x26')]=_['merge'](_0x3e5f2e[_0x4823('0x26')],{'$or':_[_0x4823('0x20')](_0x3e5f2e[_0x4823('0x33')],function(_0x3ce7f2){var _0x240592={};_0x240592[_0x3ce7f2]={'$like':'%'+_0x4ee40b[_0x4823('0x29')][_0x4823('0x4c')]+'%'};return _0x240592;})});}_0x3e5f2e=_[_0x4823('0x36')]({},_0x3e5f2e,_0x4ee40b['options']);return _0x50464d[_0x4823('0x7f')](_0x3e5f2e);}})[_0x4823('0x19')](function(_0x12c05a){if(_0x12c05a){_0x45de0=_0x12c05a[_0x4823('0x56')];if(!_0x4ee40b['query']['hasOwnProperty'](_0x4823('0x80'))){_0x3e5f2e[_0x4823('0x12')]=qs[_0x4823('0x12')](_0x4ee40b['query'][_0x4823('0x12')]);_0x3e5f2e['offset']=qs[_0x4823('0x10')](_0x4ee40b[_0x4823('0x29')][_0x4823('0x10')]);}return _0x50464d[_0x4823('0x7f')](_0x3e5f2e);}})[_0x4823('0x19')](function(_0x5d6965){if(_0x5d6965){return _0x5d6965?{'count':_0x45de0,'rows':_0x5d6965}:null;}})[_0x4823('0x19')](respondWithResult(_0x25e299,null))[_0x4823('0x2c')](handleError(_0x25e299,null));}; \ No newline at end of file +var _0xf3fb=['isEmpty','removeAgents','userOpenchannelQueue:remove','addAgents','spread','userOpenchannelQueue:save','isArray','getAgents','bluebird','squel','ioredis','../../components/parsers/qs','../../config/logger','../../config/environment','../../mysqldb','defaults','redis','localhost','./openchannelQueue.socket','register','sendStatus','status','end','json','offset','limit','undefined','count','set','update','then','destroy','get','OpenchannelQueues','UserProfileResource','error','name','send','index','map','OpenchannelQueue','rawAttributes','type','key','where','include','query','findAll','rows','catch','show','model','keys','filters','intersection','attributes','fields','length','merge','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','findOne','UserOpenchannelQueue','hasOwnProperty','nolimit','order','sort','OpenchannelQueueId','filter','User','findAndCountAll','UserId','agent','openchannelPause','updatedAt','createdAt','%s/%s','SIP','pick','options','getTeams','addTeams','ids','Team','Agents','voicePause','flatMap','sequelize','transaction','each','findOrCreate','forEach','emit','removeTeams','select','tq.TeamId','from','join','OpenchannelQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','SELECT','TeamId','includes','all','union','compact'];(function(_0x48db7b,_0x25a0b2){var _0x3fa727=function(_0x3f9881){while(--_0x3f9881){_0x48db7b['push'](_0x48db7b['shift']());}};_0x3fa727(++_0x25a0b2);}(_0xf3fb,0x7d));var _0xbf3f=function(_0x468398,_0x456db3){_0x468398=_0x468398-0x0;var _0x9afbea=_0xf3fb[_0x468398];return _0x9afbea;};'use strict';var BPromise=require(_0xbf3f('0x0'));var util=require('util');var _=require('lodash');var squel=require(_0xbf3f('0x1'));var Redis=require(_0xbf3f('0x2'));var qs=require(_0xbf3f('0x3'));var logger=require(_0xbf3f('0x4'))('api');var config=require(_0xbf3f('0x5'));var db=require(_0xbf3f('0x6'))['db'];config['redis']=_[_0xbf3f('0x7')](config[_0xbf3f('0x8')],{'host':_0xbf3f('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xbf3f('0x8')]));require(_0xbf3f('0xa'))[_0xbf3f('0xb')](socket);function respondWithStatusCode(_0x258185,_0x204d76){_0x204d76=_0x204d76||0xcc;return function(_0x47f388){if(_0x47f388){return _0x258185[_0xbf3f('0xc')](_0x204d76);}return _0x258185[_0xbf3f('0xd')](_0x204d76)[_0xbf3f('0xe')]();};}function respondWithResult(_0x430fa9,_0xbd917f){_0xbd917f=_0xbd917f||0xc8;return function(_0x4c5d66){if(_0x4c5d66){return _0x430fa9[_0xbf3f('0xd')](_0xbd917f)[_0xbf3f('0xf')](_0x4c5d66);}};}function respondWithFilteredResult(_0x2061f2,_0x508ddc){return function(_0x271594){if(_0x271594){var _0x4a85e4=typeof _0x508ddc[_0xbf3f('0x10')]==='undefined'&&typeof _0x508ddc[_0xbf3f('0x11')]===_0xbf3f('0x12');var _0x55dd88=_0x271594['count'];var _0x2c419d=_0x4a85e4?0x0:_0x508ddc[_0xbf3f('0x10')];var _0x454983=_0x4a85e4?_0x271594[_0xbf3f('0x13')]:_0x508ddc[_0xbf3f('0x10')]+_0x508ddc[_0xbf3f('0x11')];var _0x4211df;if(_0x454983>=_0x55dd88){_0x454983=_0x55dd88;_0x4211df=0xc8;}else{_0x4211df=0xce;}_0x2061f2[_0xbf3f('0xd')](_0x4211df);return _0x2061f2[_0xbf3f('0x14')]('Content-Range',_0x2c419d+'-'+_0x454983+'/'+_0x55dd88)['json'](_0x271594);}return null;};}function saveUpdates(_0x55ff02){return function(_0x440ab0){if(_0x440ab0){return _0x440ab0[_0xbf3f('0x15')](_0x55ff02)[_0xbf3f('0x16')](function(_0x52252c){return _0x52252c;});}return null;};}function removeEntity(_0x34417d){return function(_0x1db892){if(_0x1db892){return _0x1db892[_0xbf3f('0x17')]()['then'](function(){var _0x1ce0c1=_0x1db892[_0xbf3f('0x18')]({'plain':!![]});var _0x4e8e51=_0xbf3f('0x19');return db[_0xbf3f('0x1a')][_0xbf3f('0x17')]({'where':{'type':_0x4e8e51,'resourceId':_0x1ce0c1['id']}})[_0xbf3f('0x16')](function(){return _0x1db892;});})[_0xbf3f('0x16')](function(){_0x34417d[_0xbf3f('0xd')](0xcc)[_0xbf3f('0xe')]();});}};}function handleEntityNotFound(_0x4fe3a7){return function(_0x4c3e38){if(!_0x4c3e38){_0x4fe3a7['sendStatus'](0x194);}return _0x4c3e38;};}function handleError(_0x45d8b2,_0x39c585){_0x39c585=_0x39c585||0x1f4;return function(_0x27f697){logger[_0xbf3f('0x1b')](_0x27f697['stack']);if(_0x27f697[_0xbf3f('0x1c')]){delete _0x27f697['name'];}_0x45d8b2[_0xbf3f('0xd')](_0x39c585)[_0xbf3f('0x1d')](_0x27f697);};}exports[_0xbf3f('0x1e')]=function(_0x57d5d,_0x1ff085){var _0x42c04a={};var _0x54ea76={'count':0x0,'rows':[]};var _0xf673b=_[_0xbf3f('0x1f')](db[_0xbf3f('0x20')][_0xbf3f('0x21')],function(_0x229197){return{'name':_0x229197['fieldName'],'type':_0x229197[_0xbf3f('0x22')][_0xbf3f('0x23')]};});_0x42c04a=qs['getOptions'](_0xf673b,_0x57d5d);var _0x4f290f={'where':_0x42c04a[_0xbf3f('0x24')]};return db['OpenchannelQueue']['count'](_0x4f290f)[_0xbf3f('0x16')](function(_0x5c858c){_0x54ea76[_0xbf3f('0x13')]=_0x5c858c;_0x42c04a[_0xbf3f('0x25')]=qs[_0xbf3f('0x25')](_0x57d5d[_0xbf3f('0x26')]);return db[_0xbf3f('0x20')][_0xbf3f('0x27')](_0x42c04a);})[_0xbf3f('0x16')](function(_0x44d04d){_0x54ea76[_0xbf3f('0x28')]=_0x44d04d;return _0x54ea76;})[_0xbf3f('0x16')](respondWithFilteredResult(_0x1ff085,_0x42c04a))[_0xbf3f('0x29')](handleError(_0x1ff085,null));};exports[_0xbf3f('0x2a')]=function(_0x23d369,_0x2c18c1){var _0x2cd819={'raw':!![],'where':{'id':_0x23d369['params']['id']}},_0x1ca43b={};_0x1ca43b[_0xbf3f('0x2b')]=_[_0xbf3f('0x2c')](db['OpenchannelQueue'][_0xbf3f('0x21')]);_0x1ca43b[_0xbf3f('0x26')]=_[_0xbf3f('0x2c')](_0x23d369[_0xbf3f('0x26')]);_0x1ca43b[_0xbf3f('0x2d')]=_[_0xbf3f('0x2e')](_0x1ca43b[_0xbf3f('0x2b')],_0x1ca43b[_0xbf3f('0x26')]);_0x2cd819[_0xbf3f('0x2f')]=_['intersection'](_0x1ca43b[_0xbf3f('0x2b')],qs['fields'](_0x23d369[_0xbf3f('0x26')][_0xbf3f('0x30')]));_0x2cd819['attributes']=_0x2cd819['attributes'][_0xbf3f('0x31')]?_0x2cd819[_0xbf3f('0x2f')]:_0x1ca43b[_0xbf3f('0x2b')];if(_0x23d369[_0xbf3f('0x26')]['includeAll']){_0x2cd819[_0xbf3f('0x25')]=[{'all':!![]}];}_0x2cd819=_[_0xbf3f('0x32')]({},_0x2cd819,_0x23d369['options']);return db[_0xbf3f('0x20')][_0xbf3f('0x33')](_0x2cd819)[_0xbf3f('0x16')](handleEntityNotFound(_0x2c18c1,null))[_0xbf3f('0x16')](respondWithResult(_0x2c18c1,null))[_0xbf3f('0x29')](handleError(_0x2c18c1,null));};exports[_0xbf3f('0x34')]=function(_0xf897f7,_0x30b60e){return db[_0xbf3f('0x20')][_0xbf3f('0x34')](_0xf897f7[_0xbf3f('0x35')],{})[_0xbf3f('0x16')](function(_0x989832){var _0x2014e7=_0xf897f7['user'][_0xbf3f('0x18')]({'plain':!![]});if(!_0x2014e7)throw new Error(_0xbf3f('0x36'));if(_0x2014e7[_0xbf3f('0x37')]==='user'){var _0x2ca464=_0x989832[_0xbf3f('0x18')]({'plain':!![]});var _0x36332c=_0xbf3f('0x19');return db[_0xbf3f('0x38')]['find']({'where':{'name':_0x36332c,'userProfileId':_0x2014e7[_0xbf3f('0x39')]},'raw':!![]})[_0xbf3f('0x16')](function(_0x13cf17){if(_0x13cf17&&_0x13cf17[_0xbf3f('0x3a')]===0x0){return db['UserProfileResource'][_0xbf3f('0x34')]({'name':_0x2ca464[_0xbf3f('0x1c')],'resourceId':_0x2ca464['id'],'type':_0x13cf17[_0xbf3f('0x1c')],'sectionId':_0x13cf17['id']},{})[_0xbf3f('0x16')](function(){return _0x989832;});}else{return _0x989832;}})[_0xbf3f('0x29')](function(_0x473ccf){logger[_0xbf3f('0x1b')](_0xbf3f('0x3b'),_0x473ccf);throw _0x473ccf;});}return _0x989832;})[_0xbf3f('0x16')](respondWithResult(_0x30b60e,0xc9))[_0xbf3f('0x29')](handleError(_0x30b60e,null));};exports['update']=function(_0x216bec,_0x4e92e6){if(_0x216bec[_0xbf3f('0x35')]['id']){delete _0x216bec[_0xbf3f('0x35')]['id'];}return db[_0xbf3f('0x20')][_0xbf3f('0x33')]({'where':{'id':_0x216bec[_0xbf3f('0x3c')]['id']}})['then'](handleEntityNotFound(_0x4e92e6,null))[_0xbf3f('0x16')](saveUpdates(_0x216bec[_0xbf3f('0x35')],null))[_0xbf3f('0x16')](respondWithResult(_0x4e92e6,null))[_0xbf3f('0x29')](handleError(_0x4e92e6,null));};exports[_0xbf3f('0x17')]=function(_0x13ba44,_0x187dff){return db[_0xbf3f('0x20')][_0xbf3f('0x33')]({'where':{'id':_0x13ba44[_0xbf3f('0x3c')]['id']}})[_0xbf3f('0x16')](handleEntityNotFound(_0x187dff,null))[_0xbf3f('0x16')](removeEntity(_0x187dff,null))[_0xbf3f('0x29')](handleError(_0x187dff,null));};exports['describe']=function(_0x1ec7b2,_0x359936){return db[_0xbf3f('0x20')]['describe']()['then'](respondWithResult(_0x359936,null))[_0xbf3f('0x29')](handleError(_0x359936,null));};exports['getMembers']=function(_0x3ce340,_0x226a3a){var _0xe05c7={'raw':!![],'where':{}},_0x1116a2={},_0x43f4e4;return db['OpenchannelQueue'][_0xbf3f('0x3d')]({'where':{'id':_0x3ce340[_0xbf3f('0x3c')]['id']}})[_0xbf3f('0x16')](handleEntityNotFound(_0x226a3a,null))[_0xbf3f('0x16')](function(_0x17f3d4){if(_0x17f3d4){_0x43f4e4=_0x17f3d4[_0xbf3f('0x18')]({'plain':!![]});_0x1116a2['model']=_[_0xbf3f('0x2c')](db[_0xbf3f('0x3e')][_0xbf3f('0x21')]);_0x1116a2[_0xbf3f('0x26')]=_[_0xbf3f('0x2c')](_0x3ce340[_0xbf3f('0x26')]);_0x1116a2['filters']=_[_0xbf3f('0x2e')](_0x1116a2[_0xbf3f('0x2b')],_0x1116a2[_0xbf3f('0x26')]);_0xe05c7['attributes']=_['intersection'](_0x1116a2[_0xbf3f('0x2b')],qs[_0xbf3f('0x30')](_0x3ce340[_0xbf3f('0x26')]['fields']));_0xe05c7['attributes']=_0xe05c7['attributes'][_0xbf3f('0x31')]?_0xe05c7[_0xbf3f('0x2f')]:_0x1116a2[_0xbf3f('0x2b')];if(!_0x3ce340[_0xbf3f('0x26')][_0xbf3f('0x3f')](_0xbf3f('0x40'))){_0xe05c7[_0xbf3f('0x11')]=qs[_0xbf3f('0x11')](_0x3ce340[_0xbf3f('0x26')]['limit']);_0xe05c7[_0xbf3f('0x10')]=qs['offset'](_0x3ce340['query'][_0xbf3f('0x10')]);}_0xe05c7[_0xbf3f('0x41')]=qs[_0xbf3f('0x42')](_0x3ce340['query'][_0xbf3f('0x42')]);_0xe05c7[_0xbf3f('0x24')]=qs['filters'](_['pick'](_0x3ce340[_0xbf3f('0x26')],_0x1116a2[_0xbf3f('0x2d')]));_0xe05c7[_0xbf3f('0x24')][_0xbf3f('0x43')]=_0x17f3d4['id'];if(_0x3ce340[_0xbf3f('0x26')][_0xbf3f('0x44')]){_0xe05c7[_0xbf3f('0x24')]=_['merge'](_0xe05c7[_0xbf3f('0x24')],{'$or':_[_0xbf3f('0x1f')](_0xe05c7[_0xbf3f('0x2f')],function(_0x592b4c){var _0x2776ed={};_0x2776ed[_0x592b4c]={'$like':'%'+_0x3ce340[_0xbf3f('0x26')][_0xbf3f('0x44')]+'%'};return _0x2776ed;})});}_0xe05c7=_[_0xbf3f('0x32')]({},_0xe05c7,_0x3ce340['options']);return db[_0xbf3f('0x3e')][_0xbf3f('0x27')](_0xe05c7);}})[_0xbf3f('0x16')](function(_0x34e998){if(_0x34e998){return db[_0xbf3f('0x45')][_0xbf3f('0x46')]({'where':{'id':_[_0xbf3f('0x1f')](_0x34e998,_0xbf3f('0x47')),'role':_0xbf3f('0x48')},'attributes':['id','name',_0xbf3f('0x49'),_0xbf3f('0x4a'),_0xbf3f('0x4b')]});}})[_0xbf3f('0x16')](function(_0x5ac890){if(_0x5ac890){return{'count':_0x5ac890[_0xbf3f('0x13')],'rows':_[_0xbf3f('0x1f')](_0x5ac890[_0xbf3f('0x28')],function(_0x4b1fcd){return{'membername':_0x4b1fcd[_0xbf3f('0x1c')],'UserId':_0x4b1fcd['id'],'queue_name':_0x43f4e4['name'],'OpenchannelQueueId':_0x43f4e4['id'],'interface':util['format'](_0xbf3f('0x4c'),_0xbf3f('0x4d'),_0x4b1fcd['name']),'penalty':0x0,'paused':_0x4b1fcd[_0xbf3f('0x49')],'createdAt':_0x4b1fcd['createdAt'],'updatedAt':_0x4b1fcd[_0xbf3f('0x4a')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xbf3f('0x16')](respondWithFilteredResult(_0x226a3a,_0xe05c7))[_0xbf3f('0x29')](handleError(_0x226a3a,null));};exports['getTeams']=function(_0x3df4b1,_0x59a898){var _0x8a1702={};var _0x8bfebb={};var _0x3e2762;var _0x4ba4fa;return db[_0xbf3f('0x20')][_0xbf3f('0x3d')]({'where':{'id':_0x3df4b1[_0xbf3f('0x3c')]['id']}})[_0xbf3f('0x16')](handleEntityNotFound(_0x59a898,null))['then'](function(_0x1f3b5e){if(_0x1f3b5e){_0x3e2762=_0x1f3b5e;_0x8bfebb[_0xbf3f('0x2b')]=_[_0xbf3f('0x2c')](db['Team'][_0xbf3f('0x21')]);_0x8bfebb[_0xbf3f('0x26')]=_[_0xbf3f('0x2c')](_0x3df4b1[_0xbf3f('0x26')]);_0x8bfebb[_0xbf3f('0x2d')]=_[_0xbf3f('0x2e')](_0x8bfebb['model'],_0x8bfebb[_0xbf3f('0x26')]);_0x8a1702[_0xbf3f('0x2f')]=_[_0xbf3f('0x2e')](_0x8bfebb['model'],qs[_0xbf3f('0x30')](_0x3df4b1[_0xbf3f('0x26')][_0xbf3f('0x30')]));_0x8a1702[_0xbf3f('0x2f')]=_0x8a1702[_0xbf3f('0x2f')]['length']?_0x8a1702['attributes']:_0x8bfebb[_0xbf3f('0x2b')];_0x8a1702[_0xbf3f('0x41')]=qs[_0xbf3f('0x42')](_0x3df4b1[_0xbf3f('0x26')][_0xbf3f('0x42')]);_0x8a1702[_0xbf3f('0x24')]=qs[_0xbf3f('0x2d')](_[_0xbf3f('0x4e')](_0x3df4b1[_0xbf3f('0x26')],_0x8bfebb['filters']));if(_0x3df4b1['query']['filter']){_0x8a1702[_0xbf3f('0x24')]=_[_0xbf3f('0x32')](_0x8a1702['where'],{'$or':_[_0xbf3f('0x1f')](_0x8a1702[_0xbf3f('0x2f')],function(_0xe90868){var _0x41ea25={};_0x41ea25[_0xe90868]={'$like':'%'+_0x3df4b1[_0xbf3f('0x26')][_0xbf3f('0x44')]+'%'};return _0x41ea25;})});}_0x8a1702=_[_0xbf3f('0x32')]({},_0x8a1702,_0x3df4b1[_0xbf3f('0x4f')]);return _0x3e2762[_0xbf3f('0x50')](_0x8a1702);}})['then'](function(_0x369702){if(_0x369702){_0x4ba4fa=_0x369702[_0xbf3f('0x31')];if(!_0x3df4b1[_0xbf3f('0x26')][_0xbf3f('0x3f')]('nolimit')){_0x8a1702[_0xbf3f('0x11')]=qs[_0xbf3f('0x11')](_0x3df4b1[_0xbf3f('0x26')]['limit']);_0x8a1702[_0xbf3f('0x10')]=qs[_0xbf3f('0x10')](_0x3df4b1['query']['offset']);}return _0x3e2762[_0xbf3f('0x50')](_0x8a1702);}})[_0xbf3f('0x16')](function(_0x50274b){if(_0x50274b){return _0x50274b?{'count':_0x4ba4fa,'rows':_0x50274b}:null;}})[_0xbf3f('0x16')](respondWithResult(_0x59a898,null))[_0xbf3f('0x29')](handleError(_0x59a898,null));};exports[_0xbf3f('0x51')]=function(_0x250772,_0x28dfc3){var _0x5b8e46=_0x250772['body'][_0xbf3f('0x52')];return db[_0xbf3f('0x53')]['findAll']({'where':{'id':_0x5b8e46},'attributes':['id'],'include':[{'model':db[_0xbf3f('0x45')],'as':_0xbf3f('0x54'),'attributes':['id','name','online',_0xbf3f('0x55'),'interface'],'raw':!![]}]})[_0xbf3f('0x16')](function(_0x21701f){if(_0x21701f){var _0x2bbec9=_[_0xbf3f('0x56')](_0x21701f,function(_0x59c3d5){var _0x5b1dc4=_0x59c3d5['get']({'plain':!![]});return _0x5b1dc4['Agents'];});return db['OpenchannelQueue'][_0xbf3f('0x33')]({'where':{'id':_0x250772['params']['id']}})[_0xbf3f('0x16')](function(_0x2ef06c){return db[_0xbf3f('0x57')][_0xbf3f('0x58')](function(_0x2b681e){return _0x2ef06c['addTeams'](_0x5b8e46,{'transaction':_0x2b681e})['then'](function(){return BPromise[_0xbf3f('0x59')](_0x2bbec9,function(_0xc5d096){return db['UserOpenchannelQueue'][_0xbf3f('0x5a')]({'where':{'UserId':_0xc5d096['id'],'OpenchannelQueueId':_0x250772['params']['id']},'transaction':_0x2b681e});});})[_0xbf3f('0x16')](function(){_0x2bbec9[_0xbf3f('0x5b')](function(_0x5e371b){socket[_0xbf3f('0x5c')]('userOpenchannelQueue:save',{'UserId':_0x5e371b['id'],'OpenchannelQueueId':_0x2ef06c['id']});});});});});}})[_0xbf3f('0x16')](respondWithStatusCode(_0x28dfc3,null))[_0xbf3f('0x29')](handleError(_0x28dfc3,null));};exports[_0xbf3f('0x5d')]=function(_0x45e5c2,_0x1efc88){return db['Team'][_0xbf3f('0x27')]({'where':{'id':_0x45e5c2[_0xbf3f('0x26')][_0xbf3f('0x52')]},'attributes':['id'],'include':[{'model':db[_0xbf3f('0x45')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xbf3f('0x16')](handleEntityNotFound(_0x1efc88,null))[_0xbf3f('0x16')](function(_0x2cf12e){var _0xd9937=_['map'](_0x2cf12e,'id');var _0x24204b=[];var _0x20e345=[];var _0x6ee364=squel[_0xbf3f('0x5e')]();_0x6ee364['field'](_0xbf3f('0x5f'))[_0xbf3f('0x60')]('team_has_openchannel_queues','tq')[_0xbf3f('0x61')]('user_has_teams','ut','ut.TeamId\x20=\x20tq.TeamId')['where'](_0xbf3f('0x62'),_0x45e5c2[_0xbf3f('0x3c')]['id']);for(var _0x1dd95f=0x0;_0x1dd95f<_0x2cf12e[_0xbf3f('0x31')];_0x1dd95f+=0x1){let _0x23059a=_0x2cf12e[_0x1dd95f];for(var _0x1ee17c=0x0;_0x1ee17c<_0x23059a['Agents']['length'];_0x1ee17c+=0x1){let _0x14e1b1=_0x23059a['Agents'][_0x1ee17c];var _0x5bcda0=_0x6ee364[_0xbf3f('0x63')]();_0x5bcda0[_0xbf3f('0x24')](_0xbf3f('0x64'),_0x14e1b1['id']);_0x20e345[_0xbf3f('0x65')](db[_0xbf3f('0x57')][_0xbf3f('0x26')](_0x5bcda0[_0xbf3f('0x66')](),{'type':db['sequelize']['QueryTypes'][_0xbf3f('0x67')]})[_0xbf3f('0x16')](function(_0x1f9e53){if(_0x1f9e53[_0xbf3f('0x31')]===0x1){return _0x14e1b1['id'];}else{var _0x3c4a70=_['every'](_[_0xbf3f('0x1f')](_0x1f9e53,_0xbf3f('0x68')),function(_0x10e9a7){return _[_0xbf3f('0x69')](_0xd9937,_0x10e9a7);});if(_0x3c4a70){return _0x14e1b1['id'];}}}));}}return BPromise[_0xbf3f('0x6a')](_0x20e345)[_0xbf3f('0x16')](function(_0x56518d){_0x24204b=_(_0x24204b)[_0xbf3f('0x6b')](_0x56518d)[_0xbf3f('0x6c')]()['value']();return db['OpenchannelQueue'][_0xbf3f('0x33')]({'where':{'id':_0x45e5c2[_0xbf3f('0x3c')]['id']}})['then'](function(_0x4a5775){return db[_0xbf3f('0x57')][_0xbf3f('0x58')](function(_0x1a29d6){return _0x4a5775[_0xbf3f('0x5d')](_0x45e5c2[_0xbf3f('0x26')][_0xbf3f('0x52')],{'transaction':_0x1a29d6})[_0xbf3f('0x16')](function(){if(!_[_0xbf3f('0x6d')](_0x24204b)){return _0x4a5775[_0xbf3f('0x6e')](_0x24204b,{'transaction':_0x1a29d6});}})['then'](function(){_0x24204b[_0xbf3f('0x5b')](function(_0x207442){socket[_0xbf3f('0x5c')](_0xbf3f('0x6f'),{'UserId':_0x207442,'OpenchannelQueueId':_0x4a5775['id']});});});});});});})[_0xbf3f('0x16')](respondWithStatusCode(_0x1efc88,null))[_0xbf3f('0x29')](handleError(_0x1efc88,null));};exports[_0xbf3f('0x70')]=function(_0x356606,_0x13941a){return db[_0xbf3f('0x20')][_0xbf3f('0x33')]({'where':{'id':_0x356606[_0xbf3f('0x3c')]['id']}})[_0xbf3f('0x16')](handleEntityNotFound(_0x13941a,null))[_0xbf3f('0x16')](function(_0x34792b){if(_0x34792b){return _0x34792b[_0xbf3f('0x70')](_0x356606[_0xbf3f('0x35')][_0xbf3f('0x52')],_['omit'](_0x356606['body'],['ids','id'])||{})[_0xbf3f('0x71')](function(_0x7ce5b1){for(var _0x1af5d6=0x0;_0x1af5d6<_0x356606[_0xbf3f('0x35')][_0xbf3f('0x52')][_0xbf3f('0x31')];_0x1af5d6+=0x1){socket[_0xbf3f('0x5c')](_0xbf3f('0x72'),{'UserId':Number(_0x356606['body'][_0xbf3f('0x52')][_0x1af5d6]),'OpenchannelQueueId':Number(_0x356606[_0xbf3f('0x3c')]['id'])});}return _0x7ce5b1;});}})[_0xbf3f('0x16')](respondWithResult(_0x13941a,null))[_0xbf3f('0x29')](handleError(_0x13941a,null));};exports[_0xbf3f('0x6e')]=function(_0x2f27c0,_0x51e3ce){return db[_0xbf3f('0x20')][_0xbf3f('0x33')]({'where':{'id':_0x2f27c0['params']['id']}})[_0xbf3f('0x16')](handleEntityNotFound(_0x51e3ce,null))[_0xbf3f('0x16')](function(_0x3529ca){if(_0x3529ca){return _0x3529ca[_0xbf3f('0x6e')](_0x2f27c0[_0xbf3f('0x26')][_0xbf3f('0x52')])[_0xbf3f('0x16')](function(){if(_[_0xbf3f('0x73')](_0x2f27c0[_0xbf3f('0x26')][_0xbf3f('0x52')])){for(var _0x457914=0x0;_0x457914<_0x2f27c0[_0xbf3f('0x26')][_0xbf3f('0x52')]['length'];_0x457914+=0x1){socket[_0xbf3f('0x5c')]('userOpenchannelQueue:remove',{'UserId':Number(_0x2f27c0['query'][_0xbf3f('0x52')][_0x457914]),'OpenchannelQueueId':Number(_0x2f27c0['params']['id'])});}}else{socket[_0xbf3f('0x5c')](_0xbf3f('0x6f'),{'UserId':Number(_0x2f27c0[_0xbf3f('0x26')][_0xbf3f('0x52')]),'OpenchannelQueueId':Number(_0x2f27c0[_0xbf3f('0x3c')]['id'])});}});}})[_0xbf3f('0x16')](respondWithStatusCode(_0x51e3ce,null))[_0xbf3f('0x29')](handleError(_0x51e3ce,null));};exports[_0xbf3f('0x74')]=function(_0x2676cc,_0x3bdf68){var _0x176d76={};var _0x2d5f23={};var _0x177656;var _0x961349;return db['OpenchannelQueue'][_0xbf3f('0x3d')]({'where':{'id':_0x2676cc[_0xbf3f('0x3c')]['id']}})[_0xbf3f('0x16')](handleEntityNotFound(_0x3bdf68,null))[_0xbf3f('0x16')](function(_0x333cec){if(_0x333cec){_0x177656=_0x333cec;_0x2d5f23[_0xbf3f('0x2b')]=_['keys'](db[_0xbf3f('0x45')][_0xbf3f('0x21')]);_0x2d5f23[_0xbf3f('0x26')]=_[_0xbf3f('0x2c')](_0x2676cc[_0xbf3f('0x26')]);_0x2d5f23[_0xbf3f('0x2d')]=_['intersection'](_0x2d5f23[_0xbf3f('0x2b')],_0x2d5f23[_0xbf3f('0x26')]);_0x176d76['attributes']=_[_0xbf3f('0x2e')](_0x2d5f23[_0xbf3f('0x2b')],qs[_0xbf3f('0x30')](_0x2676cc[_0xbf3f('0x26')][_0xbf3f('0x30')]));_0x176d76[_0xbf3f('0x2f')]=_0x176d76[_0xbf3f('0x2f')][_0xbf3f('0x31')]?_0x176d76[_0xbf3f('0x2f')]:_0x2d5f23[_0xbf3f('0x2b')];_0x176d76[_0xbf3f('0x41')]=qs['sort'](_0x2676cc[_0xbf3f('0x26')]['sort']);_0x176d76[_0xbf3f('0x24')]=qs[_0xbf3f('0x2d')](_[_0xbf3f('0x4e')](_0x2676cc[_0xbf3f('0x26')],_0x2d5f23[_0xbf3f('0x2d')]));if(_0x2676cc['query']['filter']){_0x176d76[_0xbf3f('0x24')]=_[_0xbf3f('0x32')](_0x176d76[_0xbf3f('0x24')],{'$or':_[_0xbf3f('0x1f')](_0x176d76[_0xbf3f('0x2f')],function(_0x1a7472){var _0x257765={};_0x257765[_0x1a7472]={'$like':'%'+_0x2676cc[_0xbf3f('0x26')]['filter']+'%'};return _0x257765;})});}_0x176d76=_[_0xbf3f('0x32')]({},_0x176d76,_0x2676cc[_0xbf3f('0x4f')]);return _0x177656['getAgents'](_0x176d76);}})[_0xbf3f('0x16')](function(_0x3c7d11){if(_0x3c7d11){_0x961349=_0x3c7d11[_0xbf3f('0x31')];if(!_0x2676cc[_0xbf3f('0x26')][_0xbf3f('0x3f')]('nolimit')){_0x176d76[_0xbf3f('0x11')]=qs[_0xbf3f('0x11')](_0x2676cc[_0xbf3f('0x26')]['limit']);_0x176d76['offset']=qs['offset'](_0x2676cc[_0xbf3f('0x26')][_0xbf3f('0x10')]);}return _0x177656[_0xbf3f('0x74')](_0x176d76);}})[_0xbf3f('0x16')](function(_0x3ddd04){if(_0x3ddd04){return _0x3ddd04?{'count':_0x961349,'rows':_0x3ddd04}:null;}})[_0xbf3f('0x16')](respondWithResult(_0x3bdf68,null))[_0xbf3f('0x29')](handleError(_0x3bdf68,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.events.js b/server/api/openchannelQueue/openchannelQueue.events.js index 77edec9..aebbccd 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 _0x55b1=['save','update','emit','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners'];(function(_0x507dac,_0x5be284){var _0x568876=function(_0x46515f){while(--_0x46515f){_0x507dac['push'](_0x507dac['shift']());}};_0x568876(++_0x5be284);}(_0x55b1,0xa8));var _0x155b=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0x55b1[_0x199572];return _0x13cfa3;};'use strict';var EventEmitter=require(_0x155b('0x0'));var OpenchannelQueue=require(_0x155b('0x1'))['db']['OpenchannelQueue'];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0x155b('0x2')](0x0);var events={'afterCreate':_0x155b('0x3'),'afterUpdate':_0x155b('0x4'),'afterDestroy':'remove'};function emitEvent(_0x157eba){return function(_0x71058e,_0x3614e8,_0x130c22){OpenchannelQueueEvents[_0x155b('0x5')](_0x157eba+':'+_0x71058e['id'],_0x71058e);OpenchannelQueueEvents['emit'](_0x157eba,_0x71058e);_0x130c22(null);};}for(var e in events){if(events[_0x155b('0x6')](e)){var event=events[e];OpenchannelQueue[_0x155b('0x7')](e,emitEvent(event));}}module[_0x155b('0x8')]=OpenchannelQueueEvents; \ No newline at end of file +var _0x13dd=['exports','../../mysqldb','OpenchannelQueue','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x43d0dd,_0x1bd3d2){var _0x233879=function(_0x4461ef){while(--_0x4461ef){_0x43d0dd['push'](_0x43d0dd['shift']());}};_0x233879(++_0x1bd3d2);}(_0x13dd,0x137));var _0xd13d=function(_0x2ff98a,_0x2ca3ab){_0x2ff98a=_0x2ff98a-0x0;var _0x2bcf36=_0x13dd[_0x2ff98a];return _0x2bcf36;};'use strict';var EventEmitter=require('events');var OpenchannelQueue=require(_0xd13d('0x0'))['db'][_0xd13d('0x1')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0xd13d('0x2')](0x0);var events={'afterCreate':_0xd13d('0x3'),'afterUpdate':_0xd13d('0x4'),'afterDestroy':_0xd13d('0x5')};function emitEvent(_0x30ed71){return function(_0x58311f,_0x54ed4d,_0x15dbf5){OpenchannelQueueEvents[_0xd13d('0x6')](_0x30ed71+':'+_0x58311f['id'],_0x58311f);OpenchannelQueueEvents[_0xd13d('0x6')](_0x30ed71,_0x58311f);_0x15dbf5(null);};}for(var e in events){if(events[_0xd13d('0x7')](e)){var event=events[e];OpenchannelQueue[_0xd13d('0x8')](e,emitEvent(event));}}module[_0xd13d('0x9')]=OpenchannelQueueEvents; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.model.js b/server/api/openchannelQueue/openchannelQueue.model.js index a55de1b..3bbaf9d 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 _0x6534=['./openchannelQueue.attributes','exports','define','openchannel_queues','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x431184,_0x33efe4){var _0x49463a=function(_0x36a0bf){while(--_0x36a0bf){_0x431184['push'](_0x431184['shift']());}};_0x49463a(++_0x33efe4);}(_0x6534,0x79));var _0x4653=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x6534[_0x40a045];return _0x1a687c;};'use strict';var _=require(_0x4653('0x0'));var util=require(_0x4653('0x1'));var logger=require('../../config/logger')(_0x4653('0x2'));var moment=require(_0x4653('0x3'));var BPromise=require(_0x4653('0x4'));var rp=require(_0x4653('0x5'));var fs=require('fs');var path=require(_0x4653('0x6'));var rimraf=require(_0x4653('0x7'));var config=require(_0x4653('0x8'));var attributes=require(_0x4653('0x9'));module[_0x4653('0xa')]=function(_0x38df2f,_0x393667){return _0x38df2f[_0x4653('0xb')]('OpenchannelQueue',attributes,{'tableName':_0x4653('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x415c=['define','OpenchannelQueue','util','../../config/logger','moment','request-promise','rimraf','../../config/environment','./openchannelQueue.attributes','exports'];(function(_0x13d0fc,_0x391eba){var _0x124453=function(_0x956eba){while(--_0x956eba){_0x13d0fc['push'](_0x13d0fc['shift']());}};_0x124453(++_0x391eba);}(_0x415c,0x11a));var _0xc415=function(_0x38b634,_0x4948a4){_0x38b634=_0x38b634-0x0;var _0x3b43dc=_0x415c[_0x38b634];return _0x3b43dc;};'use strict';var _=require('lodash');var util=require(_0xc415('0x0'));var logger=require(_0xc415('0x1'))('api');var moment=require(_0xc415('0x2'));var BPromise=require('bluebird');var rp=require(_0xc415('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc415('0x4'));var config=require(_0xc415('0x5'));var attributes=require(_0xc415('0x6'));module[_0xc415('0x7')]=function(_0x527f9e,_0x30a985){return _0x527f9e[_0xc415('0x8')](_0xc415('0x9'),attributes,{'tableName':'openchannel_queues','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 473ad96..803cf6a 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 _0x771c=['request\x20sent','debug','stringify','error','code','message','info','result','GetOpenchannelQueue','OpenchannelQueue','findAll','options','attributes','limit','include','map','model','catch','ShowOpenchannelQueue','find','raw','where','lodash','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./openchannelQueue.socket','register','then','OpenchannelQueue,\x20%s,\x20%s'];(function(_0x5f5df5,_0x2f41c8){var _0x511d12=function(_0x33bbd6){while(--_0x33bbd6){_0x5f5df5['push'](_0x5f5df5['shift']());}};_0x511d12(++_0x2f41c8);}(_0x771c,0x12e));var _0xc771=function(_0x71782,_0x33b77b){_0x71782=_0x71782-0x0;var _0x15d5b0=_0x771c[_0x71782];return _0x15d5b0;};'use strict';var _=require(_0xc771('0x0'));var util=require('util');var moment=require(_0xc771('0x1'));var BPromise=require(_0xc771('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc771('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xc771('0x4'));var logger=require(_0xc771('0x5'))(_0xc771('0x6'));var config=require(_0xc771('0x7'));var jayson=require(_0xc771('0x8'));var client=jayson[_0xc771('0x9')]['http']({'port':0x232a});config[_0xc771('0xa')]=_[_0xc771('0xb')](config[_0xc771('0xa')],{'host':_0xc771('0xc'),'port':0x18eb});var socket=require(_0xc771('0xd'))(new Redis(config['redis']));require(_0xc771('0xe'))[_0xc771('0xf')](socket);function respondWithRpcPromise(_0x4efd27,_0x2e139d,_0x2f58b6){return new BPromise(function(_0x3a2716,_0x243e2a){return client['request'](_0x4efd27,_0x2f58b6)[_0xc771('0x10')](function(_0x54a598){logger['info'](_0xc771('0x11'),_0x2e139d,_0xc771('0x12'));logger[_0xc771('0x13')]('OpenchannelQueue,\x20%s,\x20%s,\x20%s',_0x2e139d,_0xc771('0x12'),JSON[_0xc771('0x14')](_0x54a598));if(_0x54a598[_0xc771('0x15')]){if(_0x54a598['error'][_0xc771('0x16')]===0x1f4){logger['error'](_0xc771('0x11'),_0x2e139d,_0x54a598[_0xc771('0x15')][_0xc771('0x17')]);return _0x243e2a(_0x54a598['error'][_0xc771('0x17')]);}logger[_0xc771('0x15')](_0xc771('0x11'),_0x2e139d,_0x54a598['error']['message']);return _0x3a2716(_0x54a598[_0xc771('0x15')][_0xc771('0x17')]);}else{logger[_0xc771('0x18')](_0xc771('0x11'),_0x2e139d,'request\x20sent');_0x3a2716(_0x54a598[_0xc771('0x19')][_0xc771('0x17')]);}})['catch'](function(_0x455694){logger[_0xc771('0x15')](_0xc771('0x11'),_0x2e139d,_0x455694);_0x243e2a(_0x455694);});});}exports[_0xc771('0x1a')]=function(_0x3a1674){var _0x145202=this;return new Promise(function(_0x34c6e0,_0x2169df){return db[_0xc771('0x1b')][_0xc771('0x1c')]({'raw':_0x3a1674[_0xc771('0x1d')]?_0x3a1674['options']['raw']===undefined?!![]:![]:!![],'where':_0x3a1674[_0xc771('0x1d')]?_0x3a1674[_0xc771('0x1d')]['where']||null:null,'attributes':_0x3a1674[_0xc771('0x1d')]?_0x3a1674[_0xc771('0x1d')][_0xc771('0x1e')]||null:null,'limit':_0x3a1674[_0xc771('0x1d')]?_0x3a1674[_0xc771('0x1d')][_0xc771('0x1f')]||null:null,'include':_0x3a1674[_0xc771('0x1d')]?_0x3a1674[_0xc771('0x1d')][_0xc771('0x20')]?_[_0xc771('0x21')](_0x3a1674[_0xc771('0x1d')]['include'],function(_0x2146c6){return{'model':db[_0x2146c6[_0xc771('0x22')]],'as':_0x2146c6['as'],'attributes':_0x2146c6[_0xc771('0x1e')],'include':_0x2146c6[_0xc771('0x20')]?_[_0xc771('0x21')](_0x2146c6['include'],function(_0xd48a0b){return{'model':db[_0xd48a0b['model']],'as':_0xd48a0b['as'],'attributes':_0xd48a0b['attributes'],'include':_0xd48a0b[_0xc771('0x20')]?_[_0xc771('0x21')](_0xd48a0b[_0xc771('0x20')],function(_0x427d7f){return{'model':db[_0x427d7f[_0xc771('0x22')]],'as':_0x427d7f['as'],'attributes':_0x427d7f['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x439a8a){logger['info'](_0xc771('0x1a'),_0x3a1674);logger['debug'](_0xc771('0x1a'),_0x3a1674,JSON['stringify'](_0x439a8a));_0x34c6e0(_0x439a8a);})[_0xc771('0x23')](function(_0x4167fc){logger[_0xc771('0x15')](_0xc771('0x1a'),_0x4167fc[_0xc771('0x17')],_0x3a1674);_0x2169df(_0x145202[_0xc771('0x15')](0x1f4,_0x4167fc[_0xc771('0x17')]));});});};exports[_0xc771('0x24')]=function(_0x62d6df){var _0x49556a=this;return new Promise(function(_0x4fd14,_0x31a154){return db['OpenchannelQueue'][_0xc771('0x25')]({'raw':_0x62d6df[_0xc771('0x1d')]?_0x62d6df['options'][_0xc771('0x26')]===undefined?!![]:![]:!![],'where':_0x62d6df[_0xc771('0x1d')]?_0x62d6df[_0xc771('0x1d')][_0xc771('0x27')]||null:null,'attributes':_0x62d6df[_0xc771('0x1d')]?_0x62d6df[_0xc771('0x1d')]['attributes']||null:null,'include':_0x62d6df['options']?_0x62d6df[_0xc771('0x1d')]['include']?_[_0xc771('0x21')](_0x62d6df[_0xc771('0x1d')]['include'],function(_0x4f609a){return{'model':db[_0x4f609a[_0xc771('0x22')]],'as':_0x4f609a['as'],'attributes':_0x4f609a[_0xc771('0x1e')],'include':_0x4f609a[_0xc771('0x20')]?_['map'](_0x4f609a[_0xc771('0x20')],function(_0x51f1fa){return{'model':db[_0x51f1fa[_0xc771('0x22')]],'as':_0x51f1fa['as'],'attributes':_0x51f1fa['attributes'],'include':_0x51f1fa[_0xc771('0x20')]?_[_0xc771('0x21')](_0x51f1fa['include'],function(_0x12d9f7){return{'model':db[_0x12d9f7[_0xc771('0x22')]],'as':_0x12d9f7['as'],'attributes':_0x12d9f7['attributes']};}):[]};}):[]};}):[]:[]})[_0xc771('0x10')](function(_0x4cb8b1){logger[_0xc771('0x18')](_0xc771('0x24'),_0x62d6df);logger[_0xc771('0x13')](_0xc771('0x24'),_0x62d6df,JSON[_0xc771('0x14')](_0x4cb8b1));_0x4fd14(_0x4cb8b1);})[_0xc771('0x23')](function(_0x4adca2){logger['error'](_0xc771('0x24'),_0x4adca2[_0xc771('0x17')],_0x62d6df);_0x31a154(_0x49556a[_0xc771('0x15')](0x1f4,_0x4adca2[_0xc771('0x17')]));});});}; \ No newline at end of file +var _0x9e47=['socket.io-emitter','./openchannelQueue.socket','info','request\x20sent','OpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','OpenchannelQueue,\x20%s,\x20%s','message','result','catch','GetOpenchannelQueue','OpenchannelQueue','findAll','options','raw','where','attributes','include','model','map','debug','ShowOpenchannelQueue','then','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/environment','client','redis','defaults'];(function(_0x512738,_0x52ef6b){var _0x1bdb2b=function(_0x24d1ff){while(--_0x24d1ff){_0x512738['push'](_0x512738['shift']());}};_0x1bdb2b(++_0x52ef6b);}(_0x9e47,0x1e0));var _0x79e4=function(_0x4688f9,_0x31c8e4){_0x4688f9=_0x4688f9-0x0;var _0x394f85=_0x9e47[_0x4688f9];return _0x394f85;};'use strict';var _=require(_0x79e4('0x0'));var util=require(_0x79e4('0x1'));var moment=require(_0x79e4('0x2'));var BPromise=require('bluebird');var rs=require(_0x79e4('0x3'));var fs=require('fs');var Redis=require(_0x79e4('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x79e4('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x79e4('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x79e4('0x7')]['http']({'port':0x232a});config[_0x79e4('0x8')]=_[_0x79e4('0x9')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x79e4('0xa'))(new Redis(config[_0x79e4('0x8')]));require(_0x79e4('0xb'))['register'](socket);function respondWithRpcPromise(_0x509c05,_0x148bc8,_0x5396dd){return new BPromise(function(_0x10430d,_0x2b97de){return client['request'](_0x509c05,_0x5396dd)['then'](function(_0x95f5f9){logger[_0x79e4('0xc')]('OpenchannelQueue,\x20%s,\x20%s',_0x148bc8,_0x79e4('0xd'));logger['debug'](_0x79e4('0xe'),_0x148bc8,_0x79e4('0xd'),JSON[_0x79e4('0xf')](_0x95f5f9));if(_0x95f5f9[_0x79e4('0x10')]){if(_0x95f5f9[_0x79e4('0x10')][_0x79e4('0x11')]===0x1f4){logger[_0x79e4('0x10')](_0x79e4('0x12'),_0x148bc8,_0x95f5f9['error'][_0x79e4('0x13')]);return _0x2b97de(_0x95f5f9[_0x79e4('0x10')][_0x79e4('0x13')]);}logger[_0x79e4('0x10')](_0x79e4('0x12'),_0x148bc8,_0x95f5f9['error']['message']);return _0x10430d(_0x95f5f9[_0x79e4('0x10')][_0x79e4('0x13')]);}else{logger['info'](_0x79e4('0x12'),_0x148bc8,_0x79e4('0xd'));_0x10430d(_0x95f5f9[_0x79e4('0x14')]['message']);}})[_0x79e4('0x15')](function(_0x5a700d){logger[_0x79e4('0x10')](_0x79e4('0x12'),_0x148bc8,_0x5a700d);_0x2b97de(_0x5a700d);});});}exports[_0x79e4('0x16')]=function(_0x4b58ca){var _0x1ce2f4=this;return new Promise(function(_0x5d5193,_0x461bc0){return db[_0x79e4('0x17')][_0x79e4('0x18')]({'raw':_0x4b58ca[_0x79e4('0x19')]?_0x4b58ca[_0x79e4('0x19')][_0x79e4('0x1a')]===undefined?!![]:![]:!![],'where':_0x4b58ca['options']?_0x4b58ca[_0x79e4('0x19')][_0x79e4('0x1b')]||null:null,'attributes':_0x4b58ca[_0x79e4('0x19')]?_0x4b58ca['options'][_0x79e4('0x1c')]||null:null,'limit':_0x4b58ca['options']?_0x4b58ca[_0x79e4('0x19')]['limit']||null:null,'include':_0x4b58ca[_0x79e4('0x19')]?_0x4b58ca[_0x79e4('0x19')]['include']?_['map'](_0x4b58ca[_0x79e4('0x19')][_0x79e4('0x1d')],function(_0x3ebc03){return{'model':db[_0x3ebc03[_0x79e4('0x1e')]],'as':_0x3ebc03['as'],'attributes':_0x3ebc03[_0x79e4('0x1c')],'include':_0x3ebc03[_0x79e4('0x1d')]?_['map'](_0x3ebc03[_0x79e4('0x1d')],function(_0xc84b68){return{'model':db[_0xc84b68[_0x79e4('0x1e')]],'as':_0xc84b68['as'],'attributes':_0xc84b68[_0x79e4('0x1c')],'include':_0xc84b68[_0x79e4('0x1d')]?_[_0x79e4('0x1f')](_0xc84b68[_0x79e4('0x1d')],function(_0x4e46c7){return{'model':db[_0x4e46c7[_0x79e4('0x1e')]],'as':_0x4e46c7['as'],'attributes':_0x4e46c7[_0x79e4('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2687d7){logger[_0x79e4('0xc')]('GetOpenchannelQueue',_0x4b58ca);logger[_0x79e4('0x20')]('GetOpenchannelQueue',_0x4b58ca,JSON[_0x79e4('0xf')](_0x2687d7));_0x5d5193(_0x2687d7);})[_0x79e4('0x15')](function(_0x172eb8){logger[_0x79e4('0x10')](_0x79e4('0x16'),_0x172eb8['message'],_0x4b58ca);_0x461bc0(_0x1ce2f4['error'](0x1f4,_0x172eb8['message']));});});};exports[_0x79e4('0x21')]=function(_0x1cdcbc){var _0x5eb01a=this;return new Promise(function(_0x3b3346,_0x58f1f9){return db[_0x79e4('0x17')]['find']({'raw':_0x1cdcbc['options']?_0x1cdcbc[_0x79e4('0x19')][_0x79e4('0x1a')]===undefined?!![]:![]:!![],'where':_0x1cdcbc['options']?_0x1cdcbc[_0x79e4('0x19')][_0x79e4('0x1b')]||null:null,'attributes':_0x1cdcbc['options']?_0x1cdcbc['options']['attributes']||null:null,'include':_0x1cdcbc[_0x79e4('0x19')]?_0x1cdcbc[_0x79e4('0x19')][_0x79e4('0x1d')]?_[_0x79e4('0x1f')](_0x1cdcbc[_0x79e4('0x19')][_0x79e4('0x1d')],function(_0x3f0c16){return{'model':db[_0x3f0c16[_0x79e4('0x1e')]],'as':_0x3f0c16['as'],'attributes':_0x3f0c16[_0x79e4('0x1c')],'include':_0x3f0c16['include']?_[_0x79e4('0x1f')](_0x3f0c16[_0x79e4('0x1d')],function(_0x59d73d){return{'model':db[_0x59d73d[_0x79e4('0x1e')]],'as':_0x59d73d['as'],'attributes':_0x59d73d[_0x79e4('0x1c')],'include':_0x59d73d[_0x79e4('0x1d')]?_[_0x79e4('0x1f')](_0x59d73d[_0x79e4('0x1d')],function(_0x456637){return{'model':db[_0x456637[_0x79e4('0x1e')]],'as':_0x456637['as'],'attributes':_0x456637['attributes']};}):[]};}):[]};}):[]:[]})[_0x79e4('0x22')](function(_0x41135e){logger[_0x79e4('0xc')](_0x79e4('0x21'),_0x1cdcbc);logger[_0x79e4('0x20')](_0x79e4('0x21'),_0x1cdcbc,JSON[_0x79e4('0xf')](_0x41135e));_0x3b3346(_0x41135e);})[_0x79e4('0x15')](function(_0x174891){logger[_0x79e4('0x10')](_0x79e4('0x21'),_0x174891[_0x79e4('0x13')],_0x1cdcbc);_0x58f1f9(_0x5eb01a['error'](0x1f4,_0x174891[_0x79e4('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.socket.js b/server/api/openchannelQueue/openchannelQueue.socket.js index 10549ac..996ea1d 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 _0x5713=['./openchannelQueue.events','save','update','emit','register','length','openchannelQueue:'];(function(_0x5aaf95,_0x5e8f9b){var _0x1eb0c5=function(_0x593d43){while(--_0x593d43){_0x5aaf95['push'](_0x5aaf95['shift']());}};_0x1eb0c5(++_0x5e8f9b);}(_0x5713,0x1c7));var _0x3571=function(_0x3b7b9b,_0x1bf3c3){_0x3b7b9b=_0x3b7b9b-0x0;var _0x2b6730=_0x5713[_0x3b7b9b];return _0x2b6730;};'use strict';var OpenchannelQueueEvents=require(_0x3571('0x0'));var events=[_0x3571('0x1'),'remove',_0x3571('0x2')];function createListener(_0x4b2dab,_0x40ac99){return function(_0x14a8fc){_0x40ac99[_0x3571('0x3')](_0x4b2dab,_0x14a8fc);};}function removeListener(_0x3ee837,_0x577a08){return function(){OpenchannelQueueEvents['removeListener'](_0x3ee837,_0x577a08);};}exports[_0x3571('0x4')]=function(_0x415378){for(var _0x3e114a=0x0,_0x432a48=events[_0x3571('0x5')];_0x3e114a<_0x432a48;_0x3e114a++){var _0x1f8f0f=events[_0x3e114a];var _0x48b06d=createListener(_0x3571('0x6')+_0x1f8f0f,_0x415378);OpenchannelQueueEvents['on'](_0x1f8f0f,_0x48b06d);}}; \ No newline at end of file +var _0x2d3f=['remove','update','removeListener','register','length','./openchannelQueue.events','save'];(function(_0x471273,_0x1587f1){var _0x56c63e=function(_0x4464f0){while(--_0x4464f0){_0x471273['push'](_0x471273['shift']());}};_0x56c63e(++_0x1587f1);}(_0x2d3f,0x98));var _0xf2d3=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2d3f[_0x3dd15e];return _0x231fd0;};'use strict';var OpenchannelQueueEvents=require(_0xf2d3('0x0'));var events=[_0xf2d3('0x1'),_0xf2d3('0x2'),_0xf2d3('0x3')];function createListener(_0x14b2f5,_0x25cac9){return function(_0x52414b){_0x25cac9['emit'](_0x14b2f5,_0x52414b);};}function removeListener(_0x4ccf7e,_0x186fd6){return function(){OpenchannelQueueEvents[_0xf2d3('0x4')](_0x4ccf7e,_0x186fd6);};}exports[_0xf2d3('0x5')]=function(_0x11ae19){for(var _0x4229ee=0x0,_0x290919=events[_0xf2d3('0x6')];_0x4229ee<_0x290919;_0x4229ee++){var _0x56e181=events[_0x4229ee];var _0x24387c=createListener('openchannelQueue:'+_0x56e181,_0x11ae19);OpenchannelQueueEvents['on'](_0x56e181,_0x24387c);}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/index.js b/server/api/openchannelQueueReport/index.js index 031c8ca..6137dd9 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 _0x2263=['post','create','/:id','update','delete','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe'];(function(_0x12a06f,_0x189b0d){var _0x24c7dc=function(_0x32e84e){while(--_0x32e84e){_0x12a06f['push'](_0x12a06f['shift']());}};_0x24c7dc(++_0x189b0d);}(_0x2263,0x191));var _0x3226=function(_0x4828b1,_0x5c8cf3){_0x4828b1=_0x4828b1-0x0;var _0x1fec1b=_0x2263[_0x4828b1];return _0x1fec1b;};'use strict';var multer=require(_0x3226('0x0'));var util=require(_0x3226('0x1'));var path=require(_0x3226('0x2'));var timeout=require(_0x3226('0x3'));var express=require('express');var router=express[_0x3226('0x4')]();var fs_extra=require(_0x3226('0x5'));var auth=require(_0x3226('0x6'));var interaction=require(_0x3226('0x7'));var config=require(_0x3226('0x8'));var controller=require('./openchannelQueueReport.controller');router[_0x3226('0x9')]('/',auth[_0x3226('0xa')](),controller[_0x3226('0xb')]);router[_0x3226('0x9')](_0x3226('0xc'),auth[_0x3226('0xa')](),controller['describe']);router[_0x3226('0x9')]('/:id',auth[_0x3226('0xa')](),controller['show']);router[_0x3226('0xd')]('/',auth[_0x3226('0xa')](),controller[_0x3226('0xe')]);router['put'](_0x3226('0xf'),auth[_0x3226('0xa')](),controller[_0x3226('0x10')]);router[_0x3226('0x11')]('/:id',auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x1072=['../../components/interaction/service','../../config/environment','./openchannelQueueReport.controller','isAuthenticated','index','get','/describe','describe','post','create','put','/:id','update','destroy','util','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x475598,_0x3e9d95){var _0x2cf2e0=function(_0x1742eb){while(--_0x1742eb){_0x475598['push'](_0x475598['shift']());}};_0x2cf2e0(++_0x3e9d95);}(_0x1072,0x1c3));var _0x2107=function(_0x1f9f37,_0x18776e){_0x1f9f37=_0x1f9f37-0x0;var _0x21c080=_0x1072[_0x1f9f37];return _0x21c080;};'use strict';var multer=require('multer');var util=require(_0x2107('0x0'));var path=require('path');var timeout=require(_0x2107('0x1'));var express=require(_0x2107('0x2'));var router=express['Router']();var fs_extra=require(_0x2107('0x3'));var auth=require(_0x2107('0x4'));var interaction=require(_0x2107('0x5'));var config=require(_0x2107('0x6'));var controller=require(_0x2107('0x7'));router['get']('/',auth[_0x2107('0x8')](),controller[_0x2107('0x9')]);router[_0x2107('0xa')](_0x2107('0xb'),auth[_0x2107('0x8')](),controller[_0x2107('0xc')]);router[_0x2107('0xa')]('/:id',auth[_0x2107('0x8')](),controller['show']);router[_0x2107('0xd')]('/',auth[_0x2107('0x8')](),controller[_0x2107('0xe')]);router[_0x2107('0xf')](_0x2107('0x10'),auth[_0x2107('0x8')](),controller[_0x2107('0x11')]);router['delete'](_0x2107('0x10'),auth[_0x2107('0x8')](),controller[_0x2107('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js b/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js index 2495492..c40b384 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 _0x616d=['exports','STRING','DATE','sequelize'];(function(_0x3e618a,_0x135251){var _0x1f3d61=function(_0x12131b){while(--_0x12131b){_0x3e618a['push'](_0x3e618a['shift']());}};_0x1f3d61(++_0x135251);}(_0x616d,0x1c3));var _0xd616=function(_0x255260,_0x2e0d23){_0x255260=_0x255260-0x0;var _0x318344=_0x616d[_0x255260];return _0x318344;};'use strict';var moment=require('moment');var Sequelize=require(_0xd616('0x0'));module[_0xd616('0x1')]={'uniqueid':{'type':Sequelize[_0xd616('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0xd616('0x2')]},'joinAt':{'type':Sequelize[_0xd616('0x3')]},'leaveAt':{'type':Sequelize[_0xd616('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0xd616('0x3')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xe3e3=['exports','STRING','DATE'];(function(_0x50b519,_0x5db847){var _0x531b88=function(_0x54348a){while(--_0x54348a){_0x50b519['push'](_0x50b519['shift']());}};_0x531b88(++_0x5db847);}(_0xe3e3,0x9c));var _0x3e3e=function(_0x334841,_0x2bbc4c){_0x334841=_0x334841-0x0;var _0x5beb4b=_0xe3e3[_0x334841];return _0x5beb4b;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x3e3e('0x0')]={'uniqueid':{'type':Sequelize[_0x3e3e('0x1')],'allowNull':![]},'from':{'type':Sequelize[_0x3e3e('0x1')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x3e3e('0x2')]},'acceptAt':{'type':Sequelize[_0x3e3e('0x2')]},'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 3ff1fb8..5d76d3d 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 _0x7642=['query','keys','filters','attributes','intersection','fields','length','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','OpenchannelQueueReport','findAll','then','rows','show','params','model','rawAttributes','catch','create','body','find','describe','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','set','json','apply','reject','save','update','destroy','stack','name','send','index','type','key','map'];(function(_0x556f38,_0x20e0e4){var _0x1e3c63=function(_0x5881f3){while(--_0x5881f3){_0x556f38['push'](_0x556f38['shift']());}};_0x1e3c63(++_0x20e0e4);}(_0x7642,0x152));var _0x2764=function(_0x771024,_0x251496){_0x771024=_0x771024-0x0;var _0x1b6892=_0x7642[_0x771024];return _0x1b6892;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2764('0x0'));var zipdir=require(_0x2764('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2764('0x2'));var moment=require(_0x2764('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x2764('0x4'));var util=require(_0x2764('0x5'));var path=require(_0x2764('0x6'));var sox=require(_0x2764('0x7'));var csv=require(_0x2764('0x8'));var ejs=require(_0x2764('0x9'));var fs=require('fs');var fs_extra=require(_0x2764('0xa'));var _=require(_0x2764('0xb'));var squel=require(_0x2764('0xc'));var crypto=require(_0x2764('0xd'));var jsforce=require(_0x2764('0xe'));var deskjs=require(_0x2764('0xf'));var toCsv=require(_0x2764('0x8'));var querystring=require(_0x2764('0x10'));var Papa=require('papaparse');var Redis=require(_0x2764('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x2764('0x12'));var as=require(_0x2764('0x13'));var hardwareService=require(_0x2764('0x14'));var logger=require(_0x2764('0x15'))(_0x2764('0x16'));var utils=require(_0x2764('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x2764('0x18'));var db=require(_0x2764('0x19'))['db'];function respondWithStatusCode(_0xb800ba,_0x292b9a){_0x292b9a=_0x292b9a||0xcc;return function(_0x4f18b0){if(_0x4f18b0){return _0xb800ba[_0x2764('0x1a')](_0x292b9a);}return _0xb800ba[_0x2764('0x1b')](_0x292b9a)[_0x2764('0x1c')]();};}function respondWithResult(_0x36e337,_0x50753d){_0x50753d=_0x50753d||0xc8;return function(_0x12b2f6){if(_0x12b2f6){return _0x36e337['status'](_0x50753d)['json'](_0x12b2f6);}};}function respondWithFilteredResult(_0x1cb72a,_0x57247a){return function(_0x1a516e){if(_0x1a516e){var _0x3fb233=typeof _0x57247a[_0x2764('0x1d')]==='undefined'&&typeof _0x57247a['limit']===_0x2764('0x1e');var _0x4b0e59=_0x1a516e[_0x2764('0x1f')];var _0x3d9fb6=_0x3fb233?0x0:_0x57247a[_0x2764('0x1d')];var _0x505447=_0x3fb233?_0x1a516e['count']:_0x57247a[_0x2764('0x1d')]+_0x57247a[_0x2764('0x20')];var _0x438cd9;if(_0x505447>=_0x4b0e59){_0x505447=_0x4b0e59;_0x438cd9=0xc8;}else{_0x438cd9=0xce;}_0x1cb72a[_0x2764('0x1b')](_0x438cd9);return _0x1cb72a[_0x2764('0x21')]('Content-Range',_0x3d9fb6+'-'+_0x505447+'/'+_0x4b0e59)[_0x2764('0x22')](_0x1a516e);}return null;};}function patchUpdates(_0x5bd309){return function(_0x4576d5){try{jsonpatch[_0x2764('0x23')](_0x4576d5,_0x5bd309,!![]);}catch(_0xbd5e4c){return BPromise[_0x2764('0x24')](_0xbd5e4c);}return _0x4576d5[_0x2764('0x25')]();};}function saveUpdates(_0x1af3ed,_0xc6233f){return function(_0x5a88e6){if(_0x5a88e6){return _0x5a88e6[_0x2764('0x26')](_0x1af3ed)['then'](function(_0x50cd3c){return _0x50cd3c;});}return null;};}function removeEntity(_0x31b1e3,_0x1034db){return function(_0x44c22d){if(_0x44c22d){return _0x44c22d[_0x2764('0x27')]()['then'](function(){_0x31b1e3[_0x2764('0x1b')](0xcc)[_0x2764('0x1c')]();});}};}function handleEntityNotFound(_0x1e3374,_0x22e15a){return function(_0x12c442){if(!_0x12c442){_0x1e3374['sendStatus'](0x194);}return _0x12c442;};}function handleError(_0x5506d4,_0x5b7748){_0x5b7748=_0x5b7748||0x1f4;return function(_0x5285da){logger['error'](_0x5285da[_0x2764('0x28')]);if(_0x5285da['name']){delete _0x5285da[_0x2764('0x29')];}_0x5506d4[_0x2764('0x1b')](_0x5b7748)[_0x2764('0x2a')](_0x5285da);};}exports[_0x2764('0x2b')]=function(_0x3ba6aa,_0x176f57){var _0x1480ca={},_0x21687e={},_0x364fc8={'count':0x0,'rows':[]};var _0x681190=_['map'](db['OpenchannelQueueReport']['rawAttributes'],function(_0x3b2437){return{'name':_0x3b2437['fieldName'],'type':_0x3b2437[_0x2764('0x2c')][_0x2764('0x2d')]};});_0x21687e['model']=_[_0x2764('0x2e')](_0x681190,'name');_0x21687e[_0x2764('0x2f')]=_[_0x2764('0x30')](_0x3ba6aa[_0x2764('0x2f')]);_0x21687e[_0x2764('0x31')]=_['intersection'](_0x21687e['model'],_0x21687e['query']);_0x1480ca[_0x2764('0x32')]=_[_0x2764('0x33')](_0x21687e['model'],qs[_0x2764('0x34')](_0x3ba6aa[_0x2764('0x2f')][_0x2764('0x34')]));_0x1480ca[_0x2764('0x32')]=_0x1480ca[_0x2764('0x32')][_0x2764('0x35')]?_0x1480ca['attributes']:_0x21687e['model'];if(!_0x3ba6aa[_0x2764('0x2f')]['hasOwnProperty']('nolimit')){_0x1480ca['limit']=qs[_0x2764('0x20')](_0x3ba6aa[_0x2764('0x2f')][_0x2764('0x20')]);_0x1480ca[_0x2764('0x1d')]=qs[_0x2764('0x1d')](_0x3ba6aa[_0x2764('0x2f')][_0x2764('0x1d')]);}_0x1480ca[_0x2764('0x36')]=qs['sort'](_0x3ba6aa[_0x2764('0x2f')][_0x2764('0x37')]);_0x1480ca[_0x2764('0x38')]=qs[_0x2764('0x31')](_[_0x2764('0x39')](_0x3ba6aa['query'],_0x21687e['filters']),_0x681190);if(_0x3ba6aa[_0x2764('0x2f')][_0x2764('0x3a')]){_0x1480ca[_0x2764('0x38')]=_[_0x2764('0x3b')](_0x1480ca[_0x2764('0x38')],{'$or':_['map'](_0x681190,function(_0x1cbede){if(_0x1cbede[_0x2764('0x2c')]!==_0x2764('0x3c')){var _0x435cdb={};_0x435cdb[_0x1cbede[_0x2764('0x29')]]={'$like':'%'+_0x3ba6aa[_0x2764('0x2f')][_0x2764('0x3a')]+'%'};return _0x435cdb;}})});}_0x1480ca=_['merge']({},_0x1480ca,_0x3ba6aa[_0x2764('0x3d')]);var _0x453fca={'where':_0x1480ca[_0x2764('0x38')]};return db['OpenchannelQueueReport'][_0x2764('0x1f')](_0x453fca)['then'](function(_0x2d99a8){_0x364fc8[_0x2764('0x1f')]=_0x2d99a8;if(_0x3ba6aa[_0x2764('0x2f')][_0x2764('0x3e')]){_0x1480ca[_0x2764('0x3f')]=[{'all':!![]}];}return db[_0x2764('0x40')][_0x2764('0x41')](_0x1480ca);})[_0x2764('0x42')](function(_0x7f8ca4){_0x364fc8[_0x2764('0x43')]=_0x7f8ca4;return _0x364fc8;})[_0x2764('0x42')](respondWithFilteredResult(_0x176f57,_0x1480ca))['catch'](handleError(_0x176f57,null));};exports[_0x2764('0x44')]=function(_0x369b79,_0x53bb8e){var _0x3a87a5={'raw':!![],'where':{'id':_0x369b79[_0x2764('0x45')]['id']}},_0x4f0571={};_0x4f0571[_0x2764('0x46')]=_[_0x2764('0x30')](db[_0x2764('0x40')][_0x2764('0x47')]);_0x4f0571[_0x2764('0x2f')]=_[_0x2764('0x30')](_0x369b79['query']);_0x4f0571[_0x2764('0x31')]=_['intersection'](_0x4f0571[_0x2764('0x46')],_0x4f0571[_0x2764('0x2f')]);_0x3a87a5[_0x2764('0x32')]=_[_0x2764('0x33')](_0x4f0571['model'],qs['fields'](_0x369b79['query'][_0x2764('0x34')]));_0x3a87a5[_0x2764('0x32')]=_0x3a87a5['attributes'][_0x2764('0x35')]?_0x3a87a5[_0x2764('0x32')]:_0x4f0571[_0x2764('0x46')];if(_0x369b79[_0x2764('0x2f')][_0x2764('0x3e')]){_0x3a87a5['include']=[{'all':!![]}];}_0x3a87a5=_[_0x2764('0x3b')]({},_0x3a87a5,_0x369b79[_0x2764('0x3d')]);return db[_0x2764('0x40')]['find'](_0x3a87a5)[_0x2764('0x42')](handleEntityNotFound(_0x53bb8e,null))[_0x2764('0x42')](respondWithResult(_0x53bb8e,null))[_0x2764('0x48')](handleError(_0x53bb8e,null));};exports['create']=function(_0x335923,_0x37572b){return db[_0x2764('0x40')][_0x2764('0x49')](_0x335923[_0x2764('0x4a')],{})[_0x2764('0x42')](respondWithResult(_0x37572b,0xc9))['catch'](handleError(_0x37572b,null));};exports['update']=function(_0x93d48c,_0x18c530){if(_0x93d48c[_0x2764('0x4a')]['id']){delete _0x93d48c[_0x2764('0x4a')]['id'];}return db[_0x2764('0x40')][_0x2764('0x4b')]({'where':{'id':_0x93d48c['params']['id']}})[_0x2764('0x42')](handleEntityNotFound(_0x18c530,null))[_0x2764('0x42')](saveUpdates(_0x93d48c[_0x2764('0x4a')],null))[_0x2764('0x42')](respondWithResult(_0x18c530,null))['catch'](handleError(_0x18c530,null));};exports[_0x2764('0x27')]=function(_0x508043,_0x3aa5d0){return db['OpenchannelQueueReport'][_0x2764('0x4b')]({'where':{'id':_0x508043['params']['id']}})['then'](handleEntityNotFound(_0x3aa5d0,null))[_0x2764('0x42')](removeEntity(_0x3aa5d0,null))[_0x2764('0x48')](handleError(_0x3aa5d0,null));};exports[_0x2764('0x4c')]=function(_0x233dba,_0x566994){return db[_0x2764('0x40')][_0x2764('0x4c')]()['then'](respondWithResult(_0x566994,null))[_0x2764('0x48')](handleError(_0x566994,null));}; \ No newline at end of file +var _0x34a2=['Content-Range','apply','reject','save','update','then','error','name','send','index','map','OpenchannelQueueReport','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','filter','merge','VIRTUAL','options','findAll','rows','catch','show','params','includeAll','include','find','create','body','destroy','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit'];(function(_0x56dbbd,_0x53a898){var _0x26012c=function(_0x558b27){while(--_0x558b27){_0x56dbbd['push'](_0x56dbbd['shift']());}};_0x26012c(++_0x53a898);}(_0x34a2,0x1ab));var _0x234a=function(_0xb9359b,_0x5406c1){_0xb9359b=_0xb9359b-0x0;var _0x56e889=_0x34a2[_0xb9359b];return _0x56e889;};'use strict';var emlformat=require(_0x234a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x234a('0x1'));var jsonpatch=require(_0x234a('0x2'));var rp=require(_0x234a('0x3'));var moment=require(_0x234a('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x234a('0x5'));var path=require(_0x234a('0x6'));var sox=require('sox');var csv=require(_0x234a('0x7'));var ejs=require(_0x234a('0x8'));var fs=require('fs');var fs_extra=require(_0x234a('0x9'));var _=require(_0x234a('0xa'));var squel=require(_0x234a('0xb'));var crypto=require(_0x234a('0xc'));var jsforce=require(_0x234a('0xd'));var deskjs=require(_0x234a('0xe'));var toCsv=require(_0x234a('0x7'));var querystring=require(_0x234a('0xf'));var Papa=require(_0x234a('0x10'));var Redis=require(_0x234a('0x11'));var authService=require(_0x234a('0x12'));var qs=require(_0x234a('0x13'));var as=require(_0x234a('0x14'));var hardwareService=require(_0x234a('0x15'));var logger=require(_0x234a('0x16'))('api');var utils=require(_0x234a('0x17'));var config=require(_0x234a('0x18'));var licenseUtil=require(_0x234a('0x19'));var db=require(_0x234a('0x1a'))['db'];function respondWithStatusCode(_0x97bfef,_0x3b68fd){_0x3b68fd=_0x3b68fd||0xcc;return function(_0x16a7d7){if(_0x16a7d7){return _0x97bfef[_0x234a('0x1b')](_0x3b68fd);}return _0x97bfef[_0x234a('0x1c')](_0x3b68fd)[_0x234a('0x1d')]();};}function respondWithResult(_0x495be8,_0x5eb820){_0x5eb820=_0x5eb820||0xc8;return function(_0x3a1141){if(_0x3a1141){return _0x495be8[_0x234a('0x1c')](_0x5eb820)[_0x234a('0x1e')](_0x3a1141);}};}function respondWithFilteredResult(_0x1762b3,_0x4a3a14){return function(_0x5d7462){if(_0x5d7462){var _0x56d2dc=typeof _0x4a3a14[_0x234a('0x1f')]==='undefined'&&typeof _0x4a3a14['limit']===_0x234a('0x20');var _0x2264de=_0x5d7462['count'];var _0x479381=_0x56d2dc?0x0:_0x4a3a14[_0x234a('0x1f')];var _0x5790ec=_0x56d2dc?_0x5d7462[_0x234a('0x21')]:_0x4a3a14[_0x234a('0x1f')]+_0x4a3a14[_0x234a('0x22')];var _0xa0248c;if(_0x5790ec>=_0x2264de){_0x5790ec=_0x2264de;_0xa0248c=0xc8;}else{_0xa0248c=0xce;}_0x1762b3['status'](_0xa0248c);return _0x1762b3['set'](_0x234a('0x23'),_0x479381+'-'+_0x5790ec+'/'+_0x2264de)['json'](_0x5d7462);}return null;};}function patchUpdates(_0x5001f1){return function(_0xafaefc){try{jsonpatch[_0x234a('0x24')](_0xafaefc,_0x5001f1,!![]);}catch(_0x3b5fff){return BPromise[_0x234a('0x25')](_0x3b5fff);}return _0xafaefc[_0x234a('0x26')]();};}function saveUpdates(_0x26501a,_0x24e71a){return function(_0x402d55){if(_0x402d55){return _0x402d55[_0x234a('0x27')](_0x26501a)['then'](function(_0x57033b){return _0x57033b;});}return null;};}function removeEntity(_0x2df8af,_0x1c12b2){return function(_0x5bdaee){if(_0x5bdaee){return _0x5bdaee['destroy']()[_0x234a('0x28')](function(){_0x2df8af[_0x234a('0x1c')](0xcc)[_0x234a('0x1d')]();});}};}function handleEntityNotFound(_0x18a178,_0x56c5c3){return function(_0x51f321){if(!_0x51f321){_0x18a178[_0x234a('0x1b')](0x194);}return _0x51f321;};}function handleError(_0x157561,_0x21693e){_0x21693e=_0x21693e||0x1f4;return function(_0x43343a){logger[_0x234a('0x29')](_0x43343a['stack']);if(_0x43343a[_0x234a('0x2a')]){delete _0x43343a[_0x234a('0x2a')];}_0x157561['status'](_0x21693e)[_0x234a('0x2b')](_0x43343a);};}exports[_0x234a('0x2c')]=function(_0x211836,_0x100a8e){var _0x484898={},_0x4e3330={},_0x1f1fbe={'count':0x0,'rows':[]};var _0x21fb87=_[_0x234a('0x2d')](db[_0x234a('0x2e')][_0x234a('0x2f')],function(_0x519f82){return{'name':_0x519f82['fieldName'],'type':_0x519f82[_0x234a('0x30')]['key']};});_0x4e3330[_0x234a('0x31')]=_[_0x234a('0x2d')](_0x21fb87,'name');_0x4e3330[_0x234a('0x32')]=_[_0x234a('0x33')](_0x211836[_0x234a('0x32')]);_0x4e3330[_0x234a('0x34')]=_[_0x234a('0x35')](_0x4e3330[_0x234a('0x31')],_0x4e3330[_0x234a('0x32')]);_0x484898[_0x234a('0x36')]=_['intersection'](_0x4e3330[_0x234a('0x31')],qs[_0x234a('0x37')](_0x211836[_0x234a('0x32')]['fields']));_0x484898[_0x234a('0x36')]=_0x484898[_0x234a('0x36')][_0x234a('0x38')]?_0x484898[_0x234a('0x36')]:_0x4e3330[_0x234a('0x31')];if(!_0x211836[_0x234a('0x32')]['hasOwnProperty'](_0x234a('0x39'))){_0x484898['limit']=qs[_0x234a('0x22')](_0x211836[_0x234a('0x32')][_0x234a('0x22')]);_0x484898[_0x234a('0x1f')]=qs[_0x234a('0x1f')](_0x211836[_0x234a('0x32')][_0x234a('0x1f')]);}_0x484898[_0x234a('0x3a')]=qs[_0x234a('0x3b')](_0x211836[_0x234a('0x32')][_0x234a('0x3b')]);_0x484898[_0x234a('0x3c')]=qs['filters'](_['pick'](_0x211836[_0x234a('0x32')],_0x4e3330[_0x234a('0x34')]),_0x21fb87);if(_0x211836[_0x234a('0x32')][_0x234a('0x3d')]){_0x484898['where']=_[_0x234a('0x3e')](_0x484898['where'],{'$or':_['map'](_0x21fb87,function(_0x37f24e){if(_0x37f24e[_0x234a('0x30')]!==_0x234a('0x3f')){var _0x3ae2e1={};_0x3ae2e1[_0x37f24e[_0x234a('0x2a')]]={'$like':'%'+_0x211836[_0x234a('0x32')][_0x234a('0x3d')]+'%'};return _0x3ae2e1;}})});}_0x484898=_['merge']({},_0x484898,_0x211836[_0x234a('0x40')]);var _0x1834ed={'where':_0x484898[_0x234a('0x3c')]};return db['OpenchannelQueueReport']['count'](_0x1834ed)[_0x234a('0x28')](function(_0x3bcc47){_0x1f1fbe[_0x234a('0x21')]=_0x3bcc47;if(_0x211836[_0x234a('0x32')]['includeAll']){_0x484898['include']=[{'all':!![]}];}return db[_0x234a('0x2e')][_0x234a('0x41')](_0x484898);})[_0x234a('0x28')](function(_0x2e2309){_0x1f1fbe[_0x234a('0x42')]=_0x2e2309;return _0x1f1fbe;})[_0x234a('0x28')](respondWithFilteredResult(_0x100a8e,_0x484898))[_0x234a('0x43')](handleError(_0x100a8e,null));};exports[_0x234a('0x44')]=function(_0x1ca559,_0x45cb06){var _0x15d84f={'raw':!![],'where':{'id':_0x1ca559[_0x234a('0x45')]['id']}},_0x53818a={};_0x53818a[_0x234a('0x31')]=_[_0x234a('0x33')](db[_0x234a('0x2e')][_0x234a('0x2f')]);_0x53818a['query']=_[_0x234a('0x33')](_0x1ca559[_0x234a('0x32')]);_0x53818a['filters']=_['intersection'](_0x53818a[_0x234a('0x31')],_0x53818a[_0x234a('0x32')]);_0x15d84f[_0x234a('0x36')]=_[_0x234a('0x35')](_0x53818a[_0x234a('0x31')],qs[_0x234a('0x37')](_0x1ca559[_0x234a('0x32')][_0x234a('0x37')]));_0x15d84f[_0x234a('0x36')]=_0x15d84f['attributes'][_0x234a('0x38')]?_0x15d84f[_0x234a('0x36')]:_0x53818a[_0x234a('0x31')];if(_0x1ca559[_0x234a('0x32')][_0x234a('0x46')]){_0x15d84f[_0x234a('0x47')]=[{'all':!![]}];}_0x15d84f=_[_0x234a('0x3e')]({},_0x15d84f,_0x1ca559[_0x234a('0x40')]);return db[_0x234a('0x2e')][_0x234a('0x48')](_0x15d84f)['then'](handleEntityNotFound(_0x45cb06,null))['then'](respondWithResult(_0x45cb06,null))[_0x234a('0x43')](handleError(_0x45cb06,null));};exports[_0x234a('0x49')]=function(_0x4fdf6a,_0x49126c){return db[_0x234a('0x2e')]['create'](_0x4fdf6a[_0x234a('0x4a')],{})[_0x234a('0x28')](respondWithResult(_0x49126c,0xc9))[_0x234a('0x43')](handleError(_0x49126c,null));};exports[_0x234a('0x27')]=function(_0x18c1fb,_0x531a1e){if(_0x18c1fb['body']['id']){delete _0x18c1fb['body']['id'];}return db[_0x234a('0x2e')]['find']({'where':{'id':_0x18c1fb['params']['id']}})[_0x234a('0x28')](handleEntityNotFound(_0x531a1e,null))['then'](saveUpdates(_0x18c1fb[_0x234a('0x4a')],null))['then'](respondWithResult(_0x531a1e,null))[_0x234a('0x43')](handleError(_0x531a1e,null));};exports[_0x234a('0x4b')]=function(_0x4d841e,_0x3041f1){return db['OpenchannelQueueReport'][_0x234a('0x48')]({'where':{'id':_0x4d841e['params']['id']}})[_0x234a('0x28')](handleEntityNotFound(_0x3041f1,null))[_0x234a('0x28')](removeEntity(_0x3041f1,null))[_0x234a('0x43')](handleError(_0x3041f1,null));};exports[_0x234a('0x4c')]=function(_0x2275ba,_0xa19210){return db[_0x234a('0x2e')]['describe']()[_0x234a('0x28')](respondWithResult(_0xa19210,null))[_0x234a('0x43')](handleError(_0xa19210,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.model.js b/server/api/openchannelQueueReport/openchannelQueueReport.model.js index c4eed62..bd31b06 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 _0xe14b=['bluebird','path','./openchannelQueueReport.attributes','exports','define','OpenchannelQueueReport','report_openchannel_queue','lodash','util','moment'];(function(_0x2d9d48,_0x334119){var _0xb5812d=function(_0x14081a){while(--_0x14081a){_0x2d9d48['push'](_0x2d9d48['shift']());}};_0xb5812d(++_0x334119);}(_0xe14b,0x93));var _0xbe14=function(_0x1232a7,_0x29338f){_0x1232a7=_0x1232a7-0x0;var _0xba69a3=_0xe14b[_0x1232a7];return _0xba69a3;};'use strict';var _=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xbe14('0x2'));var BPromise=require(_0xbe14('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbe14('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xbe14('0x5'));module[_0xbe14('0x6')]=function(_0x1fe204,_0x1ff100){return _0x1fe204[_0xbe14('0x7')](_0xbe14('0x8'),attributes,{'tableName':_0xbe14('0x9'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x326f=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelQueueReport.attributes','exports','define','OpenchannelQueueReport','report_openchannel_queue','uniqueid','lodash'];(function(_0x5a9542,_0x308bf3){var _0x90616d=function(_0xa730ae){while(--_0xa730ae){_0x5a9542['push'](_0x5a9542['shift']());}};_0x90616d(++_0x308bf3);}(_0x326f,0xd1));var _0xf326=function(_0x5df4b9,_0x576f65){_0x5df4b9=_0x5df4b9-0x0;var _0x586f95=_0x326f[_0x5df4b9];return _0x586f95;};'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 f589ec9..9ffbb84 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 _0xb6fa=['attributes','limit','lodash','bluebird','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','OpenchannelQueueReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','CreateOpenchannelQueueReport','OpenchannelQueueReport','create','options','raw','debug','UpdateOpenchannelQueueReport','update','body','where'];(function(_0xd12328,_0x31a737){var _0x5a3614=function(_0x1b35ad){while(--_0x1b35ad){_0xd12328['push'](_0xd12328['shift']());}};_0x5a3614(++_0x31a737);}(_0xb6fa,0x1c2));var _0xab6f=function(_0x4af01e,_0x543f5c){_0x4af01e=_0x4af01e-0x0;var _0x178c11=_0xb6fa[_0x4af01e];return _0x178c11;};'use strict';var _=require(_0xab6f('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xab6f('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xab6f('0x2'))['db'];var utils=require(_0xab6f('0x3'));var logger=require('../../config/logger')(_0xab6f('0x4'));var config=require(_0xab6f('0x5'));var jayson=require(_0xab6f('0x6'));var client=jayson[_0xab6f('0x7')][_0xab6f('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x895acc,_0x16b84e,_0x1b4da9){return new BPromise(function(_0x46b0f6,_0x85cb19){return client[_0xab6f('0x9')](_0x895acc,_0x1b4da9)[_0xab6f('0xa')](function(_0x199f2d){logger[_0xab6f('0xb')](_0xab6f('0xc'),_0x16b84e,_0xab6f('0xd'));logger['debug']('OpenchannelQueueReport,\x20%s,\x20%s,\x20%s',_0x16b84e,_0xab6f('0xd'),JSON[_0xab6f('0xe')](_0x199f2d));if(_0x199f2d['error']){if(_0x199f2d[_0xab6f('0xf')][_0xab6f('0x10')]===0x1f4){logger[_0xab6f('0xf')](_0xab6f('0xc'),_0x16b84e,_0x199f2d[_0xab6f('0xf')][_0xab6f('0x11')]);return _0x85cb19(_0x199f2d[_0xab6f('0xf')]['message']);}logger[_0xab6f('0xf')](_0xab6f('0xc'),_0x16b84e,_0x199f2d[_0xab6f('0xf')]['message']);return _0x46b0f6(_0x199f2d[_0xab6f('0xf')]['message']);}else{logger['info'](_0xab6f('0xc'),_0x16b84e,'request\x20sent');_0x46b0f6(_0x199f2d[_0xab6f('0x12')][_0xab6f('0x11')]);}})[_0xab6f('0x13')](function(_0x59b934){logger[_0xab6f('0xf')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x16b84e,_0x59b934);_0x85cb19(_0x59b934);});});}exports[_0xab6f('0x14')]=function(_0x439b73){var _0x3e616c=this;return new Promise(function(_0x2f75c1,_0xbb7af){return db[_0xab6f('0x15')][_0xab6f('0x16')](_0x439b73['body'],{'raw':_0x439b73[_0xab6f('0x17')]?_0x439b73[_0xab6f('0x17')][_0xab6f('0x18')]===undefined?!![]:![]:!![]})['then'](function(_0x43eda0){logger[_0xab6f('0xb')](_0xab6f('0x14'),_0x439b73);logger[_0xab6f('0x19')](_0xab6f('0x14'),_0x439b73,JSON[_0xab6f('0xe')](_0x43eda0));_0x2f75c1(_0x43eda0);})['catch'](function(_0x4dc7c1){logger[_0xab6f('0xf')](_0xab6f('0x14'),_0x4dc7c1[_0xab6f('0x11')],_0x439b73);_0xbb7af(_0x3e616c[_0xab6f('0xf')](0x1f4,_0x4dc7c1[_0xab6f('0x11')]));});});};exports[_0xab6f('0x1a')]=function(_0xb1ef77){var _0x5634c5=this;return new Promise(function(_0x1294d3,_0xf849b5){return db['OpenchannelQueueReport'][_0xab6f('0x1b')](_0xb1ef77[_0xab6f('0x1c')],{'raw':_0xb1ef77[_0xab6f('0x17')]?_0xb1ef77[_0xab6f('0x17')][_0xab6f('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xb1ef77['options']?_0xb1ef77[_0xab6f('0x17')][_0xab6f('0x1d')]||null:null,'attributes':_0xb1ef77['options']?_0xb1ef77[_0xab6f('0x17')][_0xab6f('0x1e')]||null:null,'limit':_0xb1ef77[_0xab6f('0x17')]?_0xb1ef77[_0xab6f('0x17')][_0xab6f('0x1f')]||null:null})[_0xab6f('0xa')](function(_0x4952f9){logger[_0xab6f('0xb')]('UpdateOpenchannelQueueReport',_0xb1ef77);logger['debug']('UpdateOpenchannelQueueReport',_0xb1ef77,JSON['stringify'](_0x4952f9));_0x1294d3(_0x4952f9);})['catch'](function(_0x14af68){logger[_0xab6f('0xf')](_0xab6f('0x1a'),_0x14af68[_0xab6f('0x11')],_0xb1ef77);_0xf849b5(_0x5634c5[_0xab6f('0xf')](0x1f4,_0x14af68['message']));});});}; \ No newline at end of file +var _0x5464=['info','OpenchannelQueueReport,\x20%s,\x20%s','debug','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','catch','CreateOpenchannelQueueReport','OpenchannelQueueReport','create','body','options','raw','UpdateOpenchannelQueueReport','update','attributes','limit','lodash','util','moment','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','request','then'];(function(_0x2ab83c,_0x4327f1){var _0x138280=function(_0x5c1c03){while(--_0x5c1c03){_0x2ab83c['push'](_0x2ab83c['shift']());}};_0x138280(++_0x4327f1);}(_0x5464,0x15d));var _0x4546=function(_0x42db84,_0x5aeec2){_0x42db84=_0x42db84-0x0;var _0x3e32b6=_0x5464[_0x42db84];return _0x3e32b6;};'use strict';var _=require(_0x4546('0x0'));var util=require(_0x4546('0x1'));var moment=require(_0x4546('0x2'));var BPromise=require('bluebird');var rs=require(_0x4546('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4546('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x4546('0x5'))(_0x4546('0x6'));var config=require(_0x4546('0x7'));var jayson=require(_0x4546('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5c5e09,_0x224c7c,_0x36c875){return new BPromise(function(_0x1a76c1,_0x2e860a){return client[_0x4546('0x9')](_0x5c5e09,_0x36c875)[_0x4546('0xa')](function(_0x11d63e){logger[_0x4546('0xb')](_0x4546('0xc'),_0x224c7c,'request\x20sent');logger[_0x4546('0xd')](_0x4546('0xe'),_0x224c7c,_0x4546('0xf'),JSON['stringify'](_0x11d63e));if(_0x11d63e[_0x4546('0x10')]){if(_0x11d63e[_0x4546('0x10')][_0x4546('0x11')]===0x1f4){logger[_0x4546('0x10')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x224c7c,_0x11d63e['error'][_0x4546('0x12')]);return _0x2e860a(_0x11d63e['error']['message']);}logger['error']('OpenchannelQueueReport,\x20%s,\x20%s',_0x224c7c,_0x11d63e['error']['message']);return _0x1a76c1(_0x11d63e[_0x4546('0x10')]['message']);}else{logger[_0x4546('0xb')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x224c7c,_0x4546('0xf'));_0x1a76c1(_0x11d63e['result'][_0x4546('0x12')]);}})[_0x4546('0x13')](function(_0x24b32a){logger[_0x4546('0x10')](_0x4546('0xc'),_0x224c7c,_0x24b32a);_0x2e860a(_0x24b32a);});});}exports[_0x4546('0x14')]=function(_0x57d8de){var _0x4ffd6b=this;return new Promise(function(_0x5780a7,_0x330235){return db[_0x4546('0x15')][_0x4546('0x16')](_0x57d8de[_0x4546('0x17')],{'raw':_0x57d8de[_0x4546('0x18')]?_0x57d8de[_0x4546('0x18')][_0x4546('0x19')]===undefined?!![]:![]:!![]})[_0x4546('0xa')](function(_0x4034a5){logger[_0x4546('0xb')]('CreateOpenchannelQueueReport',_0x57d8de);logger[_0x4546('0xd')](_0x4546('0x14'),_0x57d8de,JSON['stringify'](_0x4034a5));_0x5780a7(_0x4034a5);})[_0x4546('0x13')](function(_0x437f55){logger[_0x4546('0x10')](_0x4546('0x14'),_0x437f55[_0x4546('0x12')],_0x57d8de);_0x330235(_0x4ffd6b[_0x4546('0x10')](0x1f4,_0x437f55['message']));});});};exports[_0x4546('0x1a')]=function(_0x2cca8b){var _0x4f9fcf=this;return new Promise(function(_0x824698,_0x4618a6){return db[_0x4546('0x15')][_0x4546('0x1b')](_0x2cca8b[_0x4546('0x17')],{'raw':_0x2cca8b['options']?_0x2cca8b[_0x4546('0x18')][_0x4546('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2cca8b[_0x4546('0x18')]?_0x2cca8b['options']['where']||null:null,'attributes':_0x2cca8b[_0x4546('0x18')]?_0x2cca8b[_0x4546('0x18')][_0x4546('0x1c')]||null:null,'limit':_0x2cca8b[_0x4546('0x18')]?_0x2cca8b[_0x4546('0x18')][_0x4546('0x1d')]||null:null})[_0x4546('0xa')](function(_0x586ff1){logger[_0x4546('0xb')]('UpdateOpenchannelQueueReport',_0x2cca8b);logger[_0x4546('0xd')](_0x4546('0x1a'),_0x2cca8b,JSON['stringify'](_0x586ff1));_0x824698(_0x586ff1);})['catch'](function(_0xf7a95b){logger['error'](_0x4546('0x1a'),_0xf7a95b[_0x4546('0x12')],_0x2cca8b);_0x4618a6(_0x4f9fcf['error'](0x1f4,_0xf7a95b['message']));});});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/index.js b/server/api/openchannelTransferReport/index.js index b7808b7..9ab266a 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 _0xd86d=['./openchannelTransferReport.controller','get','isAuthenticated','index','/describe','/:id','show','post','put','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment'];(function(_0x1b25c1,_0x2c6ce6){var _0x1e4447=function(_0xaaafca){while(--_0xaaafca){_0x1b25c1['push'](_0x1b25c1['shift']());}};_0x1e4447(++_0x2c6ce6);}(_0xd86d,0x19b));var _0xdd86=function(_0x55ccc5,_0x181e90){_0x55ccc5=_0x55ccc5-0x0;var _0xcda59c=_0xd86d[_0x55ccc5];return _0xcda59c;};'use strict';var multer=require(_0xdd86('0x0'));var util=require(_0xdd86('0x1'));var path=require(_0xdd86('0x2'));var timeout=require(_0xdd86('0x3'));var express=require(_0xdd86('0x4'));var router=express[_0xdd86('0x5')]();var fs_extra=require(_0xdd86('0x6'));var auth=require(_0xdd86('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xdd86('0x8'));var controller=require(_0xdd86('0x9'));router[_0xdd86('0xa')]('/',auth[_0xdd86('0xb')](),controller[_0xdd86('0xc')]);router[_0xdd86('0xa')](_0xdd86('0xd'),auth[_0xdd86('0xb')](),controller['describe']);router[_0xdd86('0xa')](_0xdd86('0xe'),auth[_0xdd86('0xb')](),controller[_0xdd86('0xf')]);router[_0xdd86('0x10')]('/',auth[_0xdd86('0xb')](),controller['create']);router[_0xdd86('0x11')](_0xdd86('0xe'),auth[_0xdd86('0xb')](),controller['update']);router['delete'](_0xdd86('0xe'),auth[_0xdd86('0xb')](),controller[_0xdd86('0x12')]);module[_0xdd86('0x13')]=router; \ No newline at end of file +var _0xa4d4=['create','update','delete','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./openchannelTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','post'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0xa4d4,0x7b));var _0x4a4d=function(_0x4f2d77,_0x280cbf){_0x4f2d77=_0x4f2d77-0x0;var _0x2d8f87=_0xa4d4[_0x4f2d77];return _0x2d8f87;};'use strict';var multer=require(_0x4a4d('0x0'));var util=require(_0x4a4d('0x1'));var path=require(_0x4a4d('0x2'));var timeout=require(_0x4a4d('0x3'));var express=require(_0x4a4d('0x4'));var router=express[_0x4a4d('0x5')]();var fs_extra=require(_0x4a4d('0x6'));var auth=require(_0x4a4d('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x4a4d('0x8'));var controller=require(_0x4a4d('0x9'));router[_0x4a4d('0xa')]('/',auth[_0x4a4d('0xb')](),controller[_0x4a4d('0xc')]);router[_0x4a4d('0xa')](_0x4a4d('0xd'),auth[_0x4a4d('0xb')](),controller[_0x4a4d('0xe')]);router[_0x4a4d('0xa')](_0x4a4d('0xf'),auth[_0x4a4d('0xb')](),controller['show']);router[_0x4a4d('0x10')]('/',auth[_0x4a4d('0xb')](),controller[_0x4a4d('0x11')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x4a4d('0x12')]);router[_0x4a4d('0x13')](_0x4a4d('0xf'),auth[_0x4a4d('0xb')](),controller['destroy']);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 085a483..8584f6f 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 _0xedd9=['account','agent','queue','NOW','sequelize','exports','STRING','ENUM'];(function(_0xa4e5d2,_0x4e011c){var _0x208f80=function(_0x443e50){while(--_0x443e50){_0xa4e5d2['push'](_0xa4e5d2['shift']());}};_0x208f80(++_0x4e011c);}(_0xedd9,0xfc));var _0x9edd=function(_0x392f15,_0x6500d2){_0x392f15=_0x392f15-0x0;var _0x4389a5=_0xedd9[_0x392f15];return _0x4389a5;};'use strict';var moment=require('moment');var Sequelize=require(_0x9edd('0x0'));module[_0x9edd('0x1')]={'uniqueid':{'type':Sequelize[_0x9edd('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x9edd('0x3')](_0x9edd('0x4'),_0x9edd('0x5'),_0x9edd('0x6')),'allowNull':![],'defaultValue':_0x9edd('0x6')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x9edd('0x7')]}}; \ No newline at end of file +var _0xaa88=['account','agent','queue','DATE','NOW','moment','sequelize','exports','STRING'];(function(_0x45c46a,_0x4cc49e){var _0x3aa60f=function(_0x7180fd){while(--_0x7180fd){_0x45c46a['push'](_0x45c46a['shift']());}};_0x3aa60f(++_0x4cc49e);}(_0xaa88,0x137));var _0x8aa8=function(_0x5be795,_0x1cb1b8){_0x5be795=_0x5be795-0x0;var _0x4e8a3b=_0xaa88[_0x5be795];return _0x4e8a3b;};'use strict';var moment=require(_0x8aa8('0x0'));var Sequelize=require(_0x8aa8('0x1'));module[_0x8aa8('0x2')]={'uniqueid':{'type':Sequelize[_0x8aa8('0x3')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x8aa8('0x4'),_0x8aa8('0x5'),_0x8aa8('0x6')),'allowNull':![],'defaultValue':_0x8aa8('0x6')},'transferredAt':{'type':Sequelize[_0x8aa8('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x8aa8('0x8')]}}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.controller.js b/server/api/openchannelTransferReport/openchannelTransferReport.controller.js index c272ed1..34ac12a 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 _0xb0c7=['offset','set','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','send','index','OpenchannelTransferReport','rawAttributes','fieldName','type','key','model','map','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','merge','VIRTUAL','filter','options','includeAll','findAll','catch','show','length','include','find','create','body','params','describe','eml-format','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','undefined','limit','count'];(function(_0x326e79,_0x33dc91){var _0x37eb89=function(_0xbaef25){while(--_0xbaef25){_0x326e79['push'](_0x326e79['shift']());}};_0x37eb89(++_0x33dc91);}(_0xb0c7,0x1bb));var _0x7b0c=function(_0x1c4c1e,_0x37ae2c){_0x1c4c1e=_0x1c4c1e-0x0;var _0x308b62=_0xb0c7[_0x1c4c1e];return _0x308b62;};'use strict';var emlformat=require(_0x7b0c('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x7b0c('0x1'));var rp=require(_0x7b0c('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x7b0c('0x3'));var util=require(_0x7b0c('0x4'));var path=require(_0x7b0c('0x5'));var sox=require(_0x7b0c('0x6'));var csv=require(_0x7b0c('0x7'));var ejs=require(_0x7b0c('0x8'));var fs=require('fs');var fs_extra=require(_0x7b0c('0x9'));var _=require(_0x7b0c('0xa'));var squel=require(_0x7b0c('0xb'));var crypto=require(_0x7b0c('0xc'));var jsforce=require(_0x7b0c('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x7b0c('0x7'));var querystring=require('querystring');var Papa=require(_0x7b0c('0xe'));var Redis=require(_0x7b0c('0xf'));var authService=require(_0x7b0c('0x10'));var qs=require(_0x7b0c('0x11'));var as=require(_0x7b0c('0x12'));var hardwareService=require(_0x7b0c('0x13'));var logger=require('../../config/logger')(_0x7b0c('0x14'));var utils=require(_0x7b0c('0x15'));var config=require(_0x7b0c('0x16'));var licenseUtil=require(_0x7b0c('0x17'));var db=require(_0x7b0c('0x18'))['db'];function respondWithStatusCode(_0x50c10d,_0x2323e0){_0x2323e0=_0x2323e0||0xcc;return function(_0x4fdbcd){if(_0x4fdbcd){return _0x50c10d[_0x7b0c('0x19')](_0x2323e0);}return _0x50c10d['status'](_0x2323e0)[_0x7b0c('0x1a')]();};}function respondWithResult(_0x2d4a4b,_0x1a286a){_0x1a286a=_0x1a286a||0xc8;return function(_0x484f2b){if(_0x484f2b){return _0x2d4a4b[_0x7b0c('0x1b')](_0x1a286a)['json'](_0x484f2b);}};}function respondWithFilteredResult(_0x433ff3,_0x111a50){return function(_0x57d897){if(_0x57d897){var _0x556219=typeof _0x111a50['offset']===_0x7b0c('0x1c')&&typeof _0x111a50[_0x7b0c('0x1d')]===_0x7b0c('0x1c');var _0x34fe0e=_0x57d897[_0x7b0c('0x1e')];var _0x1c9bbf=_0x556219?0x0:_0x111a50[_0x7b0c('0x1f')];var _0x34bdc1=_0x556219?_0x57d897['count']:_0x111a50[_0x7b0c('0x1f')]+_0x111a50['limit'];var _0x297b7c;if(_0x34bdc1>=_0x34fe0e){_0x34bdc1=_0x34fe0e;_0x297b7c=0xc8;}else{_0x297b7c=0xce;}_0x433ff3[_0x7b0c('0x1b')](_0x297b7c);return _0x433ff3[_0x7b0c('0x20')](_0x7b0c('0x21'),_0x1c9bbf+'-'+_0x34bdc1+'/'+_0x34fe0e)[_0x7b0c('0x22')](_0x57d897);}return null;};}function patchUpdates(_0x513c7a){return function(_0x22e386){try{jsonpatch[_0x7b0c('0x23')](_0x22e386,_0x513c7a,!![]);}catch(_0x42b915){return BPromise[_0x7b0c('0x24')](_0x42b915);}return _0x22e386[_0x7b0c('0x25')]();};}function saveUpdates(_0x3dda42,_0x345f59){return function(_0x312fd9){if(_0x312fd9){return _0x312fd9[_0x7b0c('0x26')](_0x3dda42)[_0x7b0c('0x27')](function(_0x4130f5){return _0x4130f5;});}return null;};}function removeEntity(_0x2a86f4,_0x19b504){return function(_0x1f2dab){if(_0x1f2dab){return _0x1f2dab[_0x7b0c('0x28')]()['then'](function(){_0x2a86f4[_0x7b0c('0x1b')](0xcc)[_0x7b0c('0x1a')]();});}};}function handleEntityNotFound(_0x3716d7,_0x434830){return function(_0x506bde){if(!_0x506bde){_0x3716d7['sendStatus'](0x194);}return _0x506bde;};}function handleError(_0x1302ff,_0x55da0e){_0x55da0e=_0x55da0e||0x1f4;return function(_0x399682){logger[_0x7b0c('0x29')](_0x399682[_0x7b0c('0x2a')]);if(_0x399682['name']){delete _0x399682[_0x7b0c('0x2b')];}_0x1302ff['status'](_0x55da0e)[_0x7b0c('0x2c')](_0x399682);};}exports[_0x7b0c('0x2d')]=function(_0x58e2d3,_0x44e2a6){var _0x2bccaf={},_0xb1ea0e={},_0x3bd12e={'count':0x0,'rows':[]};var _0x4fe3dd=_['map'](db[_0x7b0c('0x2e')][_0x7b0c('0x2f')],function(_0x549f26){return{'name':_0x549f26[_0x7b0c('0x30')],'type':_0x549f26[_0x7b0c('0x31')][_0x7b0c('0x32')]};});_0xb1ea0e[_0x7b0c('0x33')]=_[_0x7b0c('0x34')](_0x4fe3dd,_0x7b0c('0x2b'));_0xb1ea0e[_0x7b0c('0x35')]=_[_0x7b0c('0x36')](_0x58e2d3['query']);_0xb1ea0e['filters']=_[_0x7b0c('0x37')](_0xb1ea0e[_0x7b0c('0x33')],_0xb1ea0e['query']);_0x2bccaf[_0x7b0c('0x38')]=_['intersection'](_0xb1ea0e[_0x7b0c('0x33')],qs['fields'](_0x58e2d3[_0x7b0c('0x35')][_0x7b0c('0x39')]));_0x2bccaf['attributes']=_0x2bccaf[_0x7b0c('0x38')]['length']?_0x2bccaf['attributes']:_0xb1ea0e[_0x7b0c('0x33')];if(!_0x58e2d3['query'][_0x7b0c('0x3a')](_0x7b0c('0x3b'))){_0x2bccaf[_0x7b0c('0x1d')]=qs[_0x7b0c('0x1d')](_0x58e2d3[_0x7b0c('0x35')]['limit']);_0x2bccaf['offset']=qs[_0x7b0c('0x1f')](_0x58e2d3[_0x7b0c('0x35')]['offset']);}_0x2bccaf[_0x7b0c('0x3c')]=qs[_0x7b0c('0x3d')](_0x58e2d3[_0x7b0c('0x35')]['sort']);_0x2bccaf[_0x7b0c('0x3e')]=qs[_0x7b0c('0x3f')](_['pick'](_0x58e2d3['query'],_0xb1ea0e[_0x7b0c('0x3f')]),_0x4fe3dd);if(_0x58e2d3['query']['filter']){_0x2bccaf[_0x7b0c('0x3e')]=_[_0x7b0c('0x40')](_0x2bccaf[_0x7b0c('0x3e')],{'$or':_[_0x7b0c('0x34')](_0x4fe3dd,function(_0x1e7f53){if(_0x1e7f53[_0x7b0c('0x31')]!==_0x7b0c('0x41')){var _0x17a8bf={};_0x17a8bf[_0x1e7f53[_0x7b0c('0x2b')]]={'$like':'%'+_0x58e2d3[_0x7b0c('0x35')][_0x7b0c('0x42')]+'%'};return _0x17a8bf;}})});}_0x2bccaf=_[_0x7b0c('0x40')]({},_0x2bccaf,_0x58e2d3[_0x7b0c('0x43')]);var _0xd55814={'where':_0x2bccaf[_0x7b0c('0x3e')]};return db[_0x7b0c('0x2e')][_0x7b0c('0x1e')](_0xd55814)[_0x7b0c('0x27')](function(_0x59f4d8){_0x3bd12e['count']=_0x59f4d8;if(_0x58e2d3[_0x7b0c('0x35')][_0x7b0c('0x44')]){_0x2bccaf['include']=[{'all':!![]}];}return db['OpenchannelTransferReport'][_0x7b0c('0x45')](_0x2bccaf);})['then'](function(_0x122288){_0x3bd12e['rows']=_0x122288;return _0x3bd12e;})['then'](respondWithFilteredResult(_0x44e2a6,_0x2bccaf))[_0x7b0c('0x46')](handleError(_0x44e2a6,null));};exports[_0x7b0c('0x47')]=function(_0x58bbeb,_0x595b4d){var _0x34306e={'raw':!![],'where':{'id':_0x58bbeb['params']['id']}},_0x506805={};_0x506805['model']=_[_0x7b0c('0x36')](db['OpenchannelTransferReport'][_0x7b0c('0x2f')]);_0x506805[_0x7b0c('0x35')]=_[_0x7b0c('0x36')](_0x58bbeb[_0x7b0c('0x35')]);_0x506805['filters']=_['intersection'](_0x506805[_0x7b0c('0x33')],_0x506805[_0x7b0c('0x35')]);_0x34306e['attributes']=_[_0x7b0c('0x37')](_0x506805[_0x7b0c('0x33')],qs[_0x7b0c('0x39')](_0x58bbeb[_0x7b0c('0x35')][_0x7b0c('0x39')]));_0x34306e[_0x7b0c('0x38')]=_0x34306e[_0x7b0c('0x38')][_0x7b0c('0x48')]?_0x34306e[_0x7b0c('0x38')]:_0x506805[_0x7b0c('0x33')];if(_0x58bbeb[_0x7b0c('0x35')]['includeAll']){_0x34306e[_0x7b0c('0x49')]=[{'all':!![]}];}_0x34306e=_[_0x7b0c('0x40')]({},_0x34306e,_0x58bbeb[_0x7b0c('0x43')]);return db[_0x7b0c('0x2e')][_0x7b0c('0x4a')](_0x34306e)[_0x7b0c('0x27')](handleEntityNotFound(_0x595b4d,null))[_0x7b0c('0x27')](respondWithResult(_0x595b4d,null))['catch'](handleError(_0x595b4d,null));};exports[_0x7b0c('0x4b')]=function(_0x56c5a7,_0x481d05){return db[_0x7b0c('0x2e')][_0x7b0c('0x4b')](_0x56c5a7[_0x7b0c('0x4c')],{})[_0x7b0c('0x27')](respondWithResult(_0x481d05,0xc9))[_0x7b0c('0x46')](handleError(_0x481d05,null));};exports[_0x7b0c('0x26')]=function(_0x3d81f3,_0x3eac6c){if(_0x3d81f3['body']['id']){delete _0x3d81f3[_0x7b0c('0x4c')]['id'];}return db[_0x7b0c('0x2e')][_0x7b0c('0x4a')]({'where':{'id':_0x3d81f3[_0x7b0c('0x4d')]['id']}})[_0x7b0c('0x27')](handleEntityNotFound(_0x3eac6c,null))[_0x7b0c('0x27')](saveUpdates(_0x3d81f3[_0x7b0c('0x4c')],null))[_0x7b0c('0x27')](respondWithResult(_0x3eac6c,null))[_0x7b0c('0x46')](handleError(_0x3eac6c,null));};exports[_0x7b0c('0x28')]=function(_0x8137e7,_0x2178ff){return db[_0x7b0c('0x2e')][_0x7b0c('0x4a')]({'where':{'id':_0x8137e7[_0x7b0c('0x4d')]['id']}})[_0x7b0c('0x27')](handleEntityNotFound(_0x2178ff,null))[_0x7b0c('0x27')](removeEntity(_0x2178ff,null))['catch'](handleError(_0x2178ff,null));};exports[_0x7b0c('0x4e')]=function(_0x2a17a3,_0x3f1355){return db['OpenchannelTransferReport'][_0x7b0c('0x4e')]()[_0x7b0c('0x27')](respondWithResult(_0x3f1355,null))['catch'](handleError(_0x3f1355,null));}; \ No newline at end of file +var _0xaa8c=['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','limit','count','Content-Range','json','apply','reject','save','update','then','error','stack','name','index','OpenchannelTransferReport','rawAttributes','type','query','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','map','VIRTUAL','includeAll','include','rows','catch','show','keys','find','create','body','params','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js'];(function(_0x4d613c,_0x55f220){var _0x301fe3=function(_0x5eec0b){while(--_0x5eec0b){_0x4d613c['push'](_0x4d613c['shift']());}};_0x301fe3(++_0x55f220);}(_0xaa8c,0x118));var _0xcaa8=function(_0x268e0c,_0x1ef7d1){_0x268e0c=_0x268e0c-0x0;var _0x97a5fb=_0xaa8c[_0x268e0c];return _0x97a5fb;};'use strict';var emlformat=require(_0xcaa8('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xcaa8('0x1'));var jsonpatch=require(_0xcaa8('0x2'));var rp=require(_0xcaa8('0x3'));var moment=require(_0xcaa8('0x4'));var BPromise=require(_0xcaa8('0x5'));var Mustache=require(_0xcaa8('0x6'));var util=require(_0xcaa8('0x7'));var path=require(_0xcaa8('0x8'));var sox=require('sox');var csv=require(_0xcaa8('0x9'));var ejs=require(_0xcaa8('0xa'));var fs=require('fs');var fs_extra=require(_0xcaa8('0xb'));var _=require('lodash');var squel=require(_0xcaa8('0xc'));var crypto=require(_0xcaa8('0xd'));var jsforce=require(_0xcaa8('0xe'));var deskjs=require(_0xcaa8('0xf'));var toCsv=require(_0xcaa8('0x9'));var querystring=require(_0xcaa8('0x10'));var Papa=require(_0xcaa8('0x11'));var Redis=require('ioredis');var authService=require(_0xcaa8('0x12'));var qs=require(_0xcaa8('0x13'));var as=require(_0xcaa8('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xcaa8('0x15'))(_0xcaa8('0x16'));var utils=require(_0xcaa8('0x17'));var config=require(_0xcaa8('0x18'));var licenseUtil=require(_0xcaa8('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2c12e8,_0x2519d3){_0x2519d3=_0x2519d3||0xcc;return function(_0x342443){if(_0x342443){return _0x2c12e8[_0xcaa8('0x1a')](_0x2519d3);}return _0x2c12e8[_0xcaa8('0x1b')](_0x2519d3)[_0xcaa8('0x1c')]();};}function respondWithResult(_0x4fdfe6,_0x27eef4){_0x27eef4=_0x27eef4||0xc8;return function(_0x59eb35){if(_0x59eb35){return _0x4fdfe6[_0xcaa8('0x1b')](_0x27eef4)['json'](_0x59eb35);}};}function respondWithFilteredResult(_0x2d3eef,_0x5b9c7a){return function(_0x26d0f8){if(_0x26d0f8){var _0x56708=typeof _0x5b9c7a[_0xcaa8('0x1d')]===_0xcaa8('0x1e')&&typeof _0x5b9c7a[_0xcaa8('0x1f')]===_0xcaa8('0x1e');var _0x7ab70c=_0x26d0f8[_0xcaa8('0x20')];var _0x4b188d=_0x56708?0x0:_0x5b9c7a[_0xcaa8('0x1d')];var _0x1cdab5=_0x56708?_0x26d0f8[_0xcaa8('0x20')]:_0x5b9c7a[_0xcaa8('0x1d')]+_0x5b9c7a[_0xcaa8('0x1f')];var _0x3386f3;if(_0x1cdab5>=_0x7ab70c){_0x1cdab5=_0x7ab70c;_0x3386f3=0xc8;}else{_0x3386f3=0xce;}_0x2d3eef['status'](_0x3386f3);return _0x2d3eef['set'](_0xcaa8('0x21'),_0x4b188d+'-'+_0x1cdab5+'/'+_0x7ab70c)[_0xcaa8('0x22')](_0x26d0f8);}return null;};}function patchUpdates(_0x128892){return function(_0x36a801){try{jsonpatch[_0xcaa8('0x23')](_0x36a801,_0x128892,!![]);}catch(_0x559959){return BPromise[_0xcaa8('0x24')](_0x559959);}return _0x36a801[_0xcaa8('0x25')]();};}function saveUpdates(_0x2bb8da,_0x211169){return function(_0x285e24){if(_0x285e24){return _0x285e24[_0xcaa8('0x26')](_0x2bb8da)[_0xcaa8('0x27')](function(_0x352d78){return _0x352d78;});}return null;};}function removeEntity(_0x3c8613,_0xb7e61d){return function(_0x47c68c){if(_0x47c68c){return _0x47c68c['destroy']()[_0xcaa8('0x27')](function(){_0x3c8613[_0xcaa8('0x1b')](0xcc)[_0xcaa8('0x1c')]();});}};}function handleEntityNotFound(_0x1d6565,_0x1af4f6){return function(_0xa73529){if(!_0xa73529){_0x1d6565[_0xcaa8('0x1a')](0x194);}return _0xa73529;};}function handleError(_0x41e19a,_0xceec29){_0xceec29=_0xceec29||0x1f4;return function(_0x21e84a){logger[_0xcaa8('0x28')](_0x21e84a[_0xcaa8('0x29')]);if(_0x21e84a[_0xcaa8('0x2a')]){delete _0x21e84a[_0xcaa8('0x2a')];}_0x41e19a['status'](_0xceec29)['send'](_0x21e84a);};}exports[_0xcaa8('0x2b')]=function(_0x445d79,_0x31e21a){var _0x366b6a={},_0x6f5349={},_0x44aaec={'count':0x0,'rows':[]};var _0x2a135a=_['map'](db[_0xcaa8('0x2c')][_0xcaa8('0x2d')],function(_0x5426e6){return{'name':_0x5426e6['fieldName'],'type':_0x5426e6[_0xcaa8('0x2e')]['key']};});_0x6f5349['model']=_['map'](_0x2a135a,'name');_0x6f5349[_0xcaa8('0x2f')]=_['keys'](_0x445d79[_0xcaa8('0x2f')]);_0x6f5349['filters']=_[_0xcaa8('0x30')](_0x6f5349[_0xcaa8('0x31')],_0x6f5349['query']);_0x366b6a['attributes']=_[_0xcaa8('0x30')](_0x6f5349['model'],qs['fields'](_0x445d79[_0xcaa8('0x2f')][_0xcaa8('0x32')]));_0x366b6a[_0xcaa8('0x33')]=_0x366b6a['attributes'][_0xcaa8('0x34')]?_0x366b6a[_0xcaa8('0x33')]:_0x6f5349[_0xcaa8('0x31')];if(!_0x445d79['query'][_0xcaa8('0x35')](_0xcaa8('0x36'))){_0x366b6a['limit']=qs[_0xcaa8('0x1f')](_0x445d79[_0xcaa8('0x2f')][_0xcaa8('0x1f')]);_0x366b6a[_0xcaa8('0x1d')]=qs['offset'](_0x445d79['query'][_0xcaa8('0x1d')]);}_0x366b6a[_0xcaa8('0x37')]=qs[_0xcaa8('0x38')](_0x445d79['query'][_0xcaa8('0x38')]);_0x366b6a[_0xcaa8('0x39')]=qs[_0xcaa8('0x3a')](_['pick'](_0x445d79[_0xcaa8('0x2f')],_0x6f5349[_0xcaa8('0x3a')]),_0x2a135a);if(_0x445d79[_0xcaa8('0x2f')][_0xcaa8('0x3b')]){_0x366b6a[_0xcaa8('0x39')]=_[_0xcaa8('0x3c')](_0x366b6a[_0xcaa8('0x39')],{'$or':_[_0xcaa8('0x3d')](_0x2a135a,function(_0x4deb20){if(_0x4deb20[_0xcaa8('0x2e')]!==_0xcaa8('0x3e')){var _0x19af40={};_0x19af40[_0x4deb20[_0xcaa8('0x2a')]]={'$like':'%'+_0x445d79[_0xcaa8('0x2f')][_0xcaa8('0x3b')]+'%'};return _0x19af40;}})});}_0x366b6a=_['merge']({},_0x366b6a,_0x445d79['options']);var _0xb83b54={'where':_0x366b6a['where']};return db[_0xcaa8('0x2c')][_0xcaa8('0x20')](_0xb83b54)[_0xcaa8('0x27')](function(_0x54d10e){_0x44aaec[_0xcaa8('0x20')]=_0x54d10e;if(_0x445d79[_0xcaa8('0x2f')][_0xcaa8('0x3f')]){_0x366b6a[_0xcaa8('0x40')]=[{'all':!![]}];}return db[_0xcaa8('0x2c')]['findAll'](_0x366b6a);})[_0xcaa8('0x27')](function(_0x5e8724){_0x44aaec[_0xcaa8('0x41')]=_0x5e8724;return _0x44aaec;})[_0xcaa8('0x27')](respondWithFilteredResult(_0x31e21a,_0x366b6a))[_0xcaa8('0x42')](handleError(_0x31e21a,null));};exports[_0xcaa8('0x43')]=function(_0x420273,_0x3000ae){var _0xb81a5c={'raw':!![],'where':{'id':_0x420273['params']['id']}},_0x4f7078={};_0x4f7078['model']=_[_0xcaa8('0x44')](db[_0xcaa8('0x2c')][_0xcaa8('0x2d')]);_0x4f7078[_0xcaa8('0x2f')]=_['keys'](_0x420273[_0xcaa8('0x2f')]);_0x4f7078[_0xcaa8('0x3a')]=_[_0xcaa8('0x30')](_0x4f7078[_0xcaa8('0x31')],_0x4f7078[_0xcaa8('0x2f')]);_0xb81a5c[_0xcaa8('0x33')]=_[_0xcaa8('0x30')](_0x4f7078['model'],qs[_0xcaa8('0x32')](_0x420273['query']['fields']));_0xb81a5c[_0xcaa8('0x33')]=_0xb81a5c[_0xcaa8('0x33')][_0xcaa8('0x34')]?_0xb81a5c[_0xcaa8('0x33')]:_0x4f7078[_0xcaa8('0x31')];if(_0x420273[_0xcaa8('0x2f')][_0xcaa8('0x3f')]){_0xb81a5c[_0xcaa8('0x40')]=[{'all':!![]}];}_0xb81a5c=_[_0xcaa8('0x3c')]({},_0xb81a5c,_0x420273['options']);return db[_0xcaa8('0x2c')][_0xcaa8('0x45')](_0xb81a5c)['then'](handleEntityNotFound(_0x3000ae,null))[_0xcaa8('0x27')](respondWithResult(_0x3000ae,null))[_0xcaa8('0x42')](handleError(_0x3000ae,null));};exports[_0xcaa8('0x46')]=function(_0x49b9fe,_0x251122){return db[_0xcaa8('0x2c')][_0xcaa8('0x46')](_0x49b9fe[_0xcaa8('0x47')],{})[_0xcaa8('0x27')](respondWithResult(_0x251122,0xc9))[_0xcaa8('0x42')](handleError(_0x251122,null));};exports[_0xcaa8('0x26')]=function(_0x44ac6d,_0x46b9ae){if(_0x44ac6d[_0xcaa8('0x47')]['id']){delete _0x44ac6d['body']['id'];}return db['OpenchannelTransferReport'][_0xcaa8('0x45')]({'where':{'id':_0x44ac6d[_0xcaa8('0x48')]['id']}})[_0xcaa8('0x27')](handleEntityNotFound(_0x46b9ae,null))[_0xcaa8('0x27')](saveUpdates(_0x44ac6d['body'],null))[_0xcaa8('0x27')](respondWithResult(_0x46b9ae,null))[_0xcaa8('0x42')](handleError(_0x46b9ae,null));};exports['destroy']=function(_0x4e4d1f,_0x530492){return db[_0xcaa8('0x2c')][_0xcaa8('0x45')]({'where':{'id':_0x4e4d1f['params']['id']}})[_0xcaa8('0x27')](handleEntityNotFound(_0x530492,null))[_0xcaa8('0x27')](removeEntity(_0x530492,null))[_0xcaa8('0x42')](handleError(_0x530492,null));};exports[_0xcaa8('0x49')]=function(_0x3b8fb0,_0x1ef1c1){return db[_0xcaa8('0x2c')][_0xcaa8('0x49')]()[_0xcaa8('0x27')](respondWithResult(_0x1ef1c1,null))[_0xcaa8('0x42')](handleError(_0x1ef1c1,null));}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.model.js b/server/api/openchannelTransferReport/openchannelTransferReport.model.js index 2481c39..0913fe6 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 _0xe31c=['report_openchannel_transfer','uniqueid','lodash','util','../../config/logger','moment','path','../../config/environment','./openchannelTransferReport.attributes','exports','define'];(function(_0x471ac2,_0x3f459e){var _0x46eb4c=function(_0x3465c1){while(--_0x3465c1){_0x471ac2['push'](_0x471ac2['shift']());}};_0x46eb4c(++_0x3f459e);}(_0xe31c,0x1f1));var _0xce31=function(_0x56b8ad,_0x172806){_0x56b8ad=_0x56b8ad-0x0;var _0x5bae45=_0xe31c[_0x56b8ad];return _0x5bae45;};'use strict';var _=require(_0xce31('0x0'));var util=require(_0xce31('0x1'));var logger=require(_0xce31('0x2'))('api');var moment=require(_0xce31('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xce31('0x4'));var rimraf=require('rimraf');var config=require(_0xce31('0x5'));var attributes=require(_0xce31('0x6'));module[_0xce31('0x7')]=function(_0x9ad24c,_0x6c90cc){return _0x9ad24c[_0xce31('0x8')]('OpenchannelTransferReport',attributes,{'tableName':_0xce31('0x9'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xce31('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xc03c=['exports','define','OpenchannelTransferReport','report_openchannel_transfer','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./openchannelTransferReport.attributes'];(function(_0x192196,_0x52cc92){var _0xa59a6d=function(_0x1b4745){while(--_0x1b4745){_0x192196['push'](_0x192196['shift']());}};_0xa59a6d(++_0x52cc92);}(_0xc03c,0x1f4));var _0xcc03=function(_0x53fe97,_0x544271){_0x53fe97=_0x53fe97-0x0;var _0x5c49a2=_0xc03c[_0x53fe97];return _0x5c49a2;};'use strict';var _=require(_0xcc03('0x0'));var util=require(_0xcc03('0x1'));var logger=require(_0xcc03('0x2'))(_0xcc03('0x3'));var moment=require(_0xcc03('0x4'));var BPromise=require(_0xcc03('0x5'));var rp=require(_0xcc03('0x6'));var fs=require('fs');var path=require(_0xcc03('0x7'));var rimraf=require(_0xcc03('0x8'));var config=require('../../config/environment');var attributes=require(_0xcc03('0x9'));module[_0xcc03('0xa')]=function(_0x14a07c,_0x54d185){return _0x14a07c[_0xcc03('0xb')](_0xcc03('0xc'),attributes,{'tableName':_0xcc03('0xd'),'paranoid':![],'indexes':[{'name':_0xcc03('0xe'),'fields':[_0xcc03('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js b/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js index 2633b3c..9ccd53f 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 _0x50d0=['code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x144d02,_0x88bc97){var _0x4c6167=function(_0x569c9e){while(--_0x569c9e){_0x144d02['push'](_0x144d02['shift']());}};_0x4c6167(++_0x88bc97);}(_0x50d0,0x101));var _0x050d=function(_0x43378e,_0xc31e2c){_0x43378e=_0x43378e-0x0;var _0x5b020c=_0x50d0[_0x43378e];return _0x5b020c;};'use strict';var _=require(_0x050d('0x0'));var util=require('util');var moment=require(_0x050d('0x1'));var BPromise=require(_0x050d('0x2'));var rs=require(_0x050d('0x3'));var fs=require('fs');var Redis=require(_0x050d('0x4'));var db=require(_0x050d('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x050d('0x6'))(_0x050d('0x7'));var config=require(_0x050d('0x8'));var jayson=require(_0x050d('0x9'));var client=jayson[_0x050d('0xa')][_0x050d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x348909,_0x5535d6,_0x2b2faa){return new BPromise(function(_0x516f5d,_0x1d3dd6){return client[_0x050d('0xc')](_0x348909,_0x2b2faa)[_0x050d('0xd')](function(_0x4f2e84){logger[_0x050d('0xe')](_0x050d('0xf'),_0x5535d6,_0x050d('0x10'));logger['debug']('OpenchannelTransferReport,\x20%s,\x20%s,\x20%s',_0x5535d6,_0x050d('0x10'),JSON[_0x050d('0x11')](_0x4f2e84));if(_0x4f2e84[_0x050d('0x12')]){if(_0x4f2e84[_0x050d('0x12')][_0x050d('0x13')]===0x1f4){logger[_0x050d('0x12')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x5535d6,_0x4f2e84['error'][_0x050d('0x14')]);return _0x1d3dd6(_0x4f2e84[_0x050d('0x12')][_0x050d('0x14')]);}logger[_0x050d('0x12')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x5535d6,_0x4f2e84['error']['message']);return _0x516f5d(_0x4f2e84['error']['message']);}else{logger['info']('OpenchannelTransferReport,\x20%s,\x20%s',_0x5535d6,'request\x20sent');_0x516f5d(_0x4f2e84[_0x050d('0x15')][_0x050d('0x14')]);}})[_0x050d('0x16')](function(_0x2001c6){logger[_0x050d('0x12')](_0x050d('0xf'),_0x5535d6,_0x2001c6);_0x1d3dd6(_0x2001c6);});});} \ No newline at end of file +var _0xaa19=['OpenchannelTransferReport,\x20%s,\x20%s','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','lodash','util','moment','bluebird','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','http','then','info'];(function(_0x41fe3e,_0xbad8eb){var _0x5b4219=function(_0x117014){while(--_0x117014){_0x41fe3e['push'](_0x41fe3e['shift']());}};_0x5b4219(++_0xbad8eb);}(_0xaa19,0x79));var _0x9aa1=function(_0x3d27b0,_0x3e76bf){_0x3d27b0=_0x3d27b0-0x0;var _0x32c2ac=_0xaa19[_0x3d27b0];return _0x32c2ac;};'use strict';var _=require(_0x9aa1('0x0'));var util=require(_0x9aa1('0x1'));var moment=require(_0x9aa1('0x2'));var BPromise=require(_0x9aa1('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9aa1('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x9aa1('0x5'));var logger=require('../../config/logger')(_0x9aa1('0x6'));var config=require(_0x9aa1('0x7'));var jayson=require(_0x9aa1('0x8'));var client=jayson['client'][_0x9aa1('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x473aa0,_0xc2ac6a,_0x5363e3){return new BPromise(function(_0x302408,_0x55ba17){return client['request'](_0x473aa0,_0x5363e3)[_0x9aa1('0xa')](function(_0x234b36){logger[_0x9aa1('0xb')](_0x9aa1('0xc'),_0xc2ac6a,'request\x20sent');logger['debug'](_0x9aa1('0xd'),_0xc2ac6a,'request\x20sent',JSON[_0x9aa1('0xe')](_0x234b36));if(_0x234b36['error']){if(_0x234b36['error']['code']===0x1f4){logger[_0x9aa1('0xf')](_0x9aa1('0xc'),_0xc2ac6a,_0x234b36['error'][_0x9aa1('0x10')]);return _0x55ba17(_0x234b36[_0x9aa1('0xf')][_0x9aa1('0x10')]);}logger['error']('OpenchannelTransferReport,\x20%s,\x20%s',_0xc2ac6a,_0x234b36[_0x9aa1('0xf')]['message']);return _0x302408(_0x234b36[_0x9aa1('0xf')]['message']);}else{logger[_0x9aa1('0xb')](_0x9aa1('0xc'),_0xc2ac6a,_0x9aa1('0x11'));_0x302408(_0x234b36[_0x9aa1('0x12')]['message']);}})['catch'](function(_0x9c0a4f){logger[_0x9aa1('0xf')](_0x9aa1('0xc'),_0xc2ac6a,_0x9c0a4f);_0x55ba17(_0x9c0a4f);});});} \ No newline at end of file diff --git a/server/api/pause/index.js b/server/api/pause/index.js index db7fbab..9f895dd 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 _0x41f5=['util','path','express','fs-extra','../../components/auth/service','../../config/environment','isAuthenticated','get','/:id','show','create','put','delete','destroy','exports'];(function(_0x4ca857,_0x4db245){var _0x16f2b9=function(_0x1a98ed){while(--_0x1a98ed){_0x4ca857['push'](_0x4ca857['shift']());}};_0x16f2b9(++_0x4db245);}(_0x41f5,0x96));var _0x541f=function(_0x5f4902,_0x1198fb){_0x5f4902=_0x5f4902-0x0;var _0x743933=_0x41f5[_0x5f4902];return _0x743933;};'use strict';var multer=require('multer');var util=require(_0x541f('0x0'));var path=require(_0x541f('0x1'));var timeout=require('connect-timeout');var express=require(_0x541f('0x2'));var router=express['Router']();var fs_extra=require(_0x541f('0x3'));var auth=require(_0x541f('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x541f('0x5'));var controller=require('./pause.controller');router['get']('/',auth[_0x541f('0x6')](),controller['index']);router[_0x541f('0x7')](_0x541f('0x8'),auth[_0x541f('0x6')](),controller[_0x541f('0x9')]);router['post']('/',auth[_0x541f('0x6')](),controller[_0x541f('0xa')]);router[_0x541f('0xb')](_0x541f('0x8'),auth[_0x541f('0x6')](),controller['update']);router[_0x541f('0xc')](_0x541f('0x8'),auth[_0x541f('0x6')](),controller[_0x541f('0xd')]);module[_0x541f('0xe')]=router; \ No newline at end of file +var _0x817f=['util','path','connect-timeout','express','fs-extra','../../components/interaction/service','./pause.controller','get','isAuthenticated','index','/:id','post','create','put','destroy','exports','multer'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x817f,0xfe));var _0xf817=function(_0x68fd87,_0x17f037){_0x68fd87=_0x68fd87-0x0;var _0x559470=_0x817f[_0x68fd87];return _0x559470;};'use strict';var multer=require(_0xf817('0x0'));var util=require(_0xf817('0x1'));var path=require(_0xf817('0x2'));var timeout=require(_0xf817('0x3'));var express=require(_0xf817('0x4'));var router=express['Router']();var fs_extra=require(_0xf817('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xf817('0x6'));var config=require('../../config/environment');var controller=require(_0xf817('0x7'));router[_0xf817('0x8')]('/',auth[_0xf817('0x9')](),controller[_0xf817('0xa')]);router[_0xf817('0x8')](_0xf817('0xb'),auth['isAuthenticated'](),controller['show']);router[_0xf817('0xc')]('/',auth[_0xf817('0x9')](),controller[_0xf817('0xd')]);router[_0xf817('0xe')]('/:id',auth[_0xf817('0x9')](),controller['update']);router['delete'](_0xf817('0xb'),auth[_0xf817('0x9')](),controller[_0xf817('0xf')]);module[_0xf817('0x10')]=router; \ No newline at end of file diff --git a/server/api/pause/pause.attributes.js b/server/api/pause/pause.attributes.js index a75b009..7752418 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 _0x300d=['STRING','name'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x300d,0x1e0));var _0xd300=function(_0x59edcf,_0x4c9ac9){_0x59edcf=_0x59edcf-0x0;var _0x11795a=_0x300d[_0x59edcf];return _0x11795a;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xd300('0x0')],'unique':_0xd300('0x1'),'allowNull':![]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xe60f=['sequelize','exports','STRING'];(function(_0xb0f88b,_0x2aa6b9){var _0x202124=function(_0x518fd9){while(--_0x518fd9){_0xb0f88b['push'](_0xb0f88b['shift']());}};_0x202124(++_0x2aa6b9);}(_0xe60f,0x165));var _0xfe60=function(_0x458db3,_0x3f5503){_0x458db3=_0x458db3-0x0;var _0x56b803=_0xe60f[_0x458db3];return _0x56b803;};'use strict';var Sequelize=require(_0xfe60('0x0'));module[_0xfe60('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![]},'description':{'type':Sequelize[_0xfe60('0x2')]}}; \ No newline at end of file diff --git a/server/api/pause/pause.controller.js b/server/api/pause/pause.controller.js index 7a952c6..a1cbc9c 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 _0x2dad=['sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','show','params','intersection','include','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','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/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','save','update','then','destroy','get','Pauses','UserProfileResource','error','name','index','map','Pause','rawAttributes','type','key','model','query','keys','attributes','fields','length','hasOwnProperty','nolimit','order'];(function(_0x5a1400,_0x1b3f48){var _0x98360c=function(_0x1c1c6d){while(--_0x1c1c6d){_0x5a1400['push'](_0x5a1400['shift']());}};_0x98360c(++_0x1b3f48);}(_0x2dad,0x114));var _0xd2da=function(_0x539295,_0x24693e){_0x539295=_0x539295-0x0;var _0x1ac195=_0x2dad[_0x539295];return _0x1ac195;};'use strict';var emlformat=require(_0xd2da('0x0'));var rimraf=require(_0xd2da('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd2da('0x2'));var rp=require(_0xd2da('0x3'));var moment=require(_0xd2da('0x4'));var BPromise=require(_0xd2da('0x5'));var Mustache=require('mustache');var util=require(_0xd2da('0x6'));var path=require(_0xd2da('0x7'));var sox=require(_0xd2da('0x8'));var csv=require(_0xd2da('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd2da('0xa'));var _=require(_0xd2da('0xb'));var squel=require(_0xd2da('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xd2da('0xd'));var toCsv=require(_0xd2da('0x9'));var querystring=require('querystring');var Papa=require(_0xd2da('0xe'));var Redis=require(_0xd2da('0xf'));var authService=require(_0xd2da('0x10'));var qs=require(_0xd2da('0x11'));var as=require(_0xd2da('0x12'));var hardwareService=require(_0xd2da('0x13'));var logger=require(_0xd2da('0x14'))(_0xd2da('0x15'));var utils=require(_0xd2da('0x16'));var config=require(_0xd2da('0x17'));var licenseUtil=require(_0xd2da('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x428447,_0x3b72d1){_0x3b72d1=_0x3b72d1||0xcc;return function(_0x53cc25){if(_0x53cc25){return _0x428447[_0xd2da('0x19')](_0x3b72d1);}return _0x428447[_0xd2da('0x1a')](_0x3b72d1)[_0xd2da('0x1b')]();};}function respondWithResult(_0x395f07,_0xa59f5a){_0xa59f5a=_0xa59f5a||0xc8;return function(_0xcc03da){if(_0xcc03da){return _0x395f07['status'](_0xa59f5a)[_0xd2da('0x1c')](_0xcc03da);}};}function respondWithFilteredResult(_0x3cf468,_0x38ba25){return function(_0x2b0b06){if(_0x2b0b06){var _0x38639f=typeof _0x38ba25[_0xd2da('0x1d')]===_0xd2da('0x1e')&&typeof _0x38ba25['limit']===_0xd2da('0x1e');var _0x57c6d6=_0x2b0b06[_0xd2da('0x1f')];var _0x4c4c32=_0x38639f?0x0:_0x38ba25[_0xd2da('0x1d')];var _0x140b09=_0x38639f?_0x2b0b06[_0xd2da('0x1f')]:_0x38ba25[_0xd2da('0x1d')]+_0x38ba25[_0xd2da('0x20')];var _0xf57d66;if(_0x140b09>=_0x57c6d6){_0x140b09=_0x57c6d6;_0xf57d66=0xc8;}else{_0xf57d66=0xce;}_0x3cf468[_0xd2da('0x1a')](_0xf57d66);return _0x3cf468[_0xd2da('0x21')](_0xd2da('0x22'),_0x4c4c32+'-'+_0x140b09+'/'+_0x57c6d6)['json'](_0x2b0b06);}return null;};}function patchUpdates(_0x330480){return function(_0x57334e){try{jsonpatch[_0xd2da('0x23')](_0x57334e,_0x330480,!![]);}catch(_0x3366cf){return BPromise['reject'](_0x3366cf);}return _0x57334e[_0xd2da('0x24')]();};}function saveUpdates(_0x2266d2,_0x587355){return function(_0x57c092){if(_0x57c092){return _0x57c092[_0xd2da('0x25')](_0x2266d2)[_0xd2da('0x26')](function(_0xb70608){return _0xb70608;});}return null;};}function removeEntity(_0x47abdb,_0x33a0f6){return function(_0x42a716){if(_0x42a716){return _0x42a716[_0xd2da('0x27')]()[_0xd2da('0x26')](function(){var _0x14afbc=_0x42a716[_0xd2da('0x28')]({'plain':!![]});var _0x9d41fc=_0xd2da('0x29');return db[_0xd2da('0x2a')][_0xd2da('0x27')]({'where':{'type':_0x9d41fc,'resourceId':_0x14afbc['id']}})[_0xd2da('0x26')](function(){return _0x42a716;});})[_0xd2da('0x26')](function(){_0x47abdb[_0xd2da('0x1a')](0xcc)[_0xd2da('0x1b')]();});}};}function handleEntityNotFound(_0x51f5d1,_0x8c5817){return function(_0x2e5acb){if(!_0x2e5acb){_0x51f5d1[_0xd2da('0x19')](0x194);}return _0x2e5acb;};}function handleError(_0x4a3d19,_0x1e336e){_0x1e336e=_0x1e336e||0x1f4;return function(_0x3552da){logger[_0xd2da('0x2b')](_0x3552da['stack']);if(_0x3552da[_0xd2da('0x2c')]){delete _0x3552da['name'];}_0x4a3d19['status'](_0x1e336e)['send'](_0x3552da);};}exports[_0xd2da('0x2d')]=function(_0x2c5b9e,_0x2eb41a){var _0x19f63e={},_0x53e777={},_0x5d21ae={'count':0x0,'rows':[]};var _0x5ef20b=_[_0xd2da('0x2e')](db[_0xd2da('0x2f')][_0xd2da('0x30')],function(_0x4e3a16){return{'name':_0x4e3a16['fieldName'],'type':_0x4e3a16[_0xd2da('0x31')][_0xd2da('0x32')]};});_0x53e777[_0xd2da('0x33')]=_[_0xd2da('0x2e')](_0x5ef20b,'name');_0x53e777[_0xd2da('0x34')]=_[_0xd2da('0x35')](_0x2c5b9e[_0xd2da('0x34')]);_0x53e777['filters']=_['intersection'](_0x53e777['model'],_0x53e777[_0xd2da('0x34')]);_0x19f63e[_0xd2da('0x36')]=_['intersection'](_0x53e777[_0xd2da('0x33')],qs['fields'](_0x2c5b9e[_0xd2da('0x34')][_0xd2da('0x37')]));_0x19f63e[_0xd2da('0x36')]=_0x19f63e[_0xd2da('0x36')][_0xd2da('0x38')]?_0x19f63e['attributes']:_0x53e777[_0xd2da('0x33')];if(!_0x2c5b9e[_0xd2da('0x34')][_0xd2da('0x39')](_0xd2da('0x3a'))){_0x19f63e[_0xd2da('0x20')]=qs['limit'](_0x2c5b9e[_0xd2da('0x34')][_0xd2da('0x20')]);_0x19f63e[_0xd2da('0x1d')]=qs[_0xd2da('0x1d')](_0x2c5b9e[_0xd2da('0x34')][_0xd2da('0x1d')]);}_0x19f63e[_0xd2da('0x3b')]=qs['sort'](_0x2c5b9e[_0xd2da('0x34')][_0xd2da('0x3c')]);_0x19f63e[_0xd2da('0x3d')]=qs[_0xd2da('0x3e')](_[_0xd2da('0x3f')](_0x2c5b9e['query'],_0x53e777[_0xd2da('0x3e')]),_0x5ef20b);if(_0x2c5b9e[_0xd2da('0x34')][_0xd2da('0x40')]){_0x19f63e[_0xd2da('0x3d')]=_[_0xd2da('0x41')](_0x19f63e[_0xd2da('0x3d')],{'$or':_[_0xd2da('0x2e')](_0x5ef20b,function(_0x1ad4d6){if(_0x1ad4d6[_0xd2da('0x31')]!==_0xd2da('0x42')){var _0x130b4a={};_0x130b4a[_0x1ad4d6[_0xd2da('0x2c')]]={'$like':'%'+_0x2c5b9e[_0xd2da('0x34')]['filter']+'%'};return _0x130b4a;}})});}_0x19f63e=_[_0xd2da('0x41')]({},_0x19f63e,_0x2c5b9e[_0xd2da('0x43')]);var _0x1720e9={'where':_0x19f63e[_0xd2da('0x3d')]};return db[_0xd2da('0x2f')][_0xd2da('0x1f')](_0x1720e9)[_0xd2da('0x26')](function(_0x1fae10){_0x5d21ae[_0xd2da('0x1f')]=_0x1fae10;if(_0x2c5b9e[_0xd2da('0x34')][_0xd2da('0x44')]){_0x19f63e['include']=[{'all':!![]}];}return db[_0xd2da('0x2f')][_0xd2da('0x45')](_0x19f63e);})[_0xd2da('0x26')](function(_0xf8d71f){_0x5d21ae[_0xd2da('0x46')]=_0xf8d71f;return _0x5d21ae;})['then'](respondWithFilteredResult(_0x2eb41a,_0x19f63e))['catch'](handleError(_0x2eb41a,null));};exports[_0xd2da('0x47')]=function(_0x50b9e3,_0x612679){var _0x30d126={'raw':!![],'where':{'id':_0x50b9e3[_0xd2da('0x48')]['id']}},_0x555b3e={};_0x555b3e[_0xd2da('0x33')]=_['keys'](db['Pause'][_0xd2da('0x30')]);_0x555b3e[_0xd2da('0x34')]=_['keys'](_0x50b9e3['query']);_0x555b3e[_0xd2da('0x3e')]=_[_0xd2da('0x49')](_0x555b3e[_0xd2da('0x33')],_0x555b3e['query']);_0x30d126['attributes']=_[_0xd2da('0x49')](_0x555b3e[_0xd2da('0x33')],qs['fields'](_0x50b9e3[_0xd2da('0x34')]['fields']));_0x30d126['attributes']=_0x30d126['attributes'][_0xd2da('0x38')]?_0x30d126[_0xd2da('0x36')]:_0x555b3e[_0xd2da('0x33')];if(_0x50b9e3['query'][_0xd2da('0x44')]){_0x30d126[_0xd2da('0x4a')]=[{'all':!![]}];}_0x30d126=_[_0xd2da('0x41')]({},_0x30d126,_0x50b9e3[_0xd2da('0x43')]);return db['Pause'][_0xd2da('0x4b')](_0x30d126)[_0xd2da('0x26')](handleEntityNotFound(_0x612679,null))[_0xd2da('0x26')](respondWithResult(_0x612679,null))[_0xd2da('0x4c')](handleError(_0x612679,null));};exports[_0xd2da('0x4d')]=function(_0x13cfa5,_0x5345a5){return db[_0xd2da('0x2f')]['create'](_0x13cfa5[_0xd2da('0x4e')],{})['then'](function(_0x3d12c7){var _0x4f8b6b=_0x13cfa5[_0xd2da('0x4f')][_0xd2da('0x28')]({'plain':!![]});if(!_0x4f8b6b)throw new Error(_0xd2da('0x50'));if(_0x4f8b6b[_0xd2da('0x51')]===_0xd2da('0x4f')){var _0x2a592c=_0x3d12c7[_0xd2da('0x28')]({'plain':!![]});var _0x365b80=_0xd2da('0x29');return db[_0xd2da('0x52')][_0xd2da('0x4b')]({'where':{'name':_0x365b80,'userProfileId':_0x4f8b6b[_0xd2da('0x53')]},'raw':!![]})['then'](function(_0x454746){if(_0x454746&&_0x454746['autoAssociation']===0x0){return db['UserProfileResource'][_0xd2da('0x4d')]({'name':_0x2a592c[_0xd2da('0x2c')],'resourceId':_0x2a592c['id'],'type':_0x454746['name'],'sectionId':_0x454746['id']},{})[_0xd2da('0x26')](function(){return _0x3d12c7;});}else{return _0x3d12c7;}})[_0xd2da('0x4c')](function(_0x34879b){logger[_0xd2da('0x2b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x34879b);throw _0x34879b;});}return _0x3d12c7;})[_0xd2da('0x26')](respondWithResult(_0x5345a5,0xc9))[_0xd2da('0x4c')](handleError(_0x5345a5,null));};exports[_0xd2da('0x25')]=function(_0xb6b62e,_0x38071a){if(_0xb6b62e[_0xd2da('0x4e')]['id']){delete _0xb6b62e['body']['id'];}return db[_0xd2da('0x2f')][_0xd2da('0x4b')]({'where':{'id':_0xb6b62e[_0xd2da('0x48')]['id']}})['then'](handleEntityNotFound(_0x38071a,null))[_0xd2da('0x26')](saveUpdates(_0xb6b62e[_0xd2da('0x4e')],null))[_0xd2da('0x26')](respondWithResult(_0x38071a,null))[_0xd2da('0x4c')](handleError(_0x38071a,null));};exports[_0xd2da('0x27')]=function(_0x4d6076,_0x1a0f5d){return db['Pause'][_0xd2da('0x4b')]({'where':{'id':_0x4d6076['params']['id']}})[_0xd2da('0x26')](handleEntityNotFound(_0x1a0f5d,null))[_0xd2da('0x26')](removeEntity(_0x1a0f5d,null))[_0xd2da('0x4c')](handleError(_0x1a0f5d,null));}; \ No newline at end of file +var _0x9505=['Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','undefined','count','offset','Content-Range','json','apply','reject','save','update','then','destroy','get','Pauses','UserProfileResource','error','name','send','index','Pause','rawAttributes','fieldName','type','key','map','query','keys','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','pick','filters','filter','merge','where','includeAll','findAll','rows','catch','show','params','include','options','create','body','user','role','UserProfileSection','userProfileId','autoAssociation'];(function(_0x32f47e,_0x5acd97){var _0x1f1e6e=function(_0xd794f6){while(--_0xd794f6){_0x32f47e['push'](_0x32f47e['shift']());}};_0x1f1e6e(++_0x5acd97);}(_0x9505,0xae));var _0x5950=function(_0x3956af,_0x2fd133){_0x3956af=_0x3956af-0x0;var _0x2ea9f1=_0x9505[_0x3956af];return _0x2ea9f1;};'use strict';var emlformat=require(_0x5950('0x0'));var rimraf=require(_0x5950('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5950('0x2'));var rp=require(_0x5950('0x3'));var moment=require(_0x5950('0x4'));var BPromise=require(_0x5950('0x5'));var Mustache=require(_0x5950('0x6'));var util=require('util');var path=require(_0x5950('0x7'));var sox=require('sox');var csv=require(_0x5950('0x8'));var ejs=require(_0x5950('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5950('0xa'));var squel=require(_0x5950('0xb'));var crypto=require(_0x5950('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x5950('0xd'));var toCsv=require(_0x5950('0x8'));var querystring=require(_0x5950('0xe'));var Papa=require(_0x5950('0xf'));var Redis=require(_0x5950('0x10'));var authService=require(_0x5950('0x11'));var qs=require(_0x5950('0x12'));var as=require(_0x5950('0x13'));var hardwareService=require(_0x5950('0x14'));var logger=require('../../config/logger')(_0x5950('0x15'));var utils=require(_0x5950('0x16'));var config=require(_0x5950('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x5950('0x18'))['db'];function respondWithStatusCode(_0x3e8c9c,_0x1cc296){_0x1cc296=_0x1cc296||0xcc;return function(_0x1addea){if(_0x1addea){return _0x3e8c9c[_0x5950('0x19')](_0x1cc296);}return _0x3e8c9c[_0x5950('0x1a')](_0x1cc296)[_0x5950('0x1b')]();};}function respondWithResult(_0x55dab2,_0x439b5f){_0x439b5f=_0x439b5f||0xc8;return function(_0x56c583){if(_0x56c583){return _0x55dab2['status'](_0x439b5f)['json'](_0x56c583);}};}function respondWithFilteredResult(_0x273b33,_0x4c96b9){return function(_0xa0f9e5){if(_0xa0f9e5){var _0x4f5826=typeof _0x4c96b9['offset']===_0x5950('0x1c')&&typeof _0x4c96b9['limit']==='undefined';var _0x3906d7=_0xa0f9e5[_0x5950('0x1d')];var _0x30962f=_0x4f5826?0x0:_0x4c96b9['offset'];var _0x25252d=_0x4f5826?_0xa0f9e5[_0x5950('0x1d')]:_0x4c96b9[_0x5950('0x1e')]+_0x4c96b9['limit'];var _0x225f6b;if(_0x25252d>=_0x3906d7){_0x25252d=_0x3906d7;_0x225f6b=0xc8;}else{_0x225f6b=0xce;}_0x273b33[_0x5950('0x1a')](_0x225f6b);return _0x273b33['set'](_0x5950('0x1f'),_0x30962f+'-'+_0x25252d+'/'+_0x3906d7)[_0x5950('0x20')](_0xa0f9e5);}return null;};}function patchUpdates(_0x21da7a){return function(_0x5086c5){try{jsonpatch[_0x5950('0x21')](_0x5086c5,_0x21da7a,!![]);}catch(_0x33bcac){return BPromise[_0x5950('0x22')](_0x33bcac);}return _0x5086c5[_0x5950('0x23')]();};}function saveUpdates(_0x14e52d,_0x224040){return function(_0x48e422){if(_0x48e422){return _0x48e422[_0x5950('0x24')](_0x14e52d)[_0x5950('0x25')](function(_0x3895e8){return _0x3895e8;});}return null;};}function removeEntity(_0x55e7f4,_0x12921f){return function(_0x19ed84){if(_0x19ed84){return _0x19ed84[_0x5950('0x26')]()[_0x5950('0x25')](function(){var _0x5c1472=_0x19ed84[_0x5950('0x27')]({'plain':!![]});var _0x23ebe6=_0x5950('0x28');return db[_0x5950('0x29')][_0x5950('0x26')]({'where':{'type':_0x23ebe6,'resourceId':_0x5c1472['id']}})[_0x5950('0x25')](function(){return _0x19ed84;});})[_0x5950('0x25')](function(){_0x55e7f4[_0x5950('0x1a')](0xcc)[_0x5950('0x1b')]();});}};}function handleEntityNotFound(_0x3b67a0,_0x4108b1){return function(_0x410f8d){if(!_0x410f8d){_0x3b67a0[_0x5950('0x19')](0x194);}return _0x410f8d;};}function handleError(_0x58dfc4,_0x23e5dc){_0x23e5dc=_0x23e5dc||0x1f4;return function(_0x323b98){logger[_0x5950('0x2a')](_0x323b98['stack']);if(_0x323b98['name']){delete _0x323b98[_0x5950('0x2b')];}_0x58dfc4['status'](_0x23e5dc)[_0x5950('0x2c')](_0x323b98);};}exports[_0x5950('0x2d')]=function(_0x1e7454,_0x7efc0e){var _0x2fa9e6={},_0x1bc971={},_0x30d2b1={'count':0x0,'rows':[]};var _0x226750=_['map'](db[_0x5950('0x2e')][_0x5950('0x2f')],function(_0x789b17){return{'name':_0x789b17[_0x5950('0x30')],'type':_0x789b17[_0x5950('0x31')][_0x5950('0x32')]};});_0x1bc971['model']=_[_0x5950('0x33')](_0x226750,_0x5950('0x2b'));_0x1bc971[_0x5950('0x34')]=_[_0x5950('0x35')](_0x1e7454['query']);_0x1bc971['filters']=_[_0x5950('0x36')](_0x1bc971['model'],_0x1bc971[_0x5950('0x34')]);_0x2fa9e6['attributes']=_[_0x5950('0x36')](_0x1bc971[_0x5950('0x37')],qs[_0x5950('0x38')](_0x1e7454[_0x5950('0x34')][_0x5950('0x38')]));_0x2fa9e6[_0x5950('0x39')]=_0x2fa9e6['attributes'][_0x5950('0x3a')]?_0x2fa9e6[_0x5950('0x39')]:_0x1bc971[_0x5950('0x37')];if(!_0x1e7454[_0x5950('0x34')][_0x5950('0x3b')](_0x5950('0x3c'))){_0x2fa9e6[_0x5950('0x3d')]=qs[_0x5950('0x3d')](_0x1e7454[_0x5950('0x34')]['limit']);_0x2fa9e6[_0x5950('0x1e')]=qs['offset'](_0x1e7454[_0x5950('0x34')]['offset']);}_0x2fa9e6[_0x5950('0x3e')]=qs[_0x5950('0x3f')](_0x1e7454[_0x5950('0x34')][_0x5950('0x3f')]);_0x2fa9e6['where']=qs['filters'](_[_0x5950('0x40')](_0x1e7454[_0x5950('0x34')],_0x1bc971[_0x5950('0x41')]),_0x226750);if(_0x1e7454[_0x5950('0x34')][_0x5950('0x42')]){_0x2fa9e6['where']=_[_0x5950('0x43')](_0x2fa9e6[_0x5950('0x44')],{'$or':_[_0x5950('0x33')](_0x226750,function(_0x30a9b6){if(_0x30a9b6[_0x5950('0x31')]!=='VIRTUAL'){var _0x438d1f={};_0x438d1f[_0x30a9b6[_0x5950('0x2b')]]={'$like':'%'+_0x1e7454[_0x5950('0x34')][_0x5950('0x42')]+'%'};return _0x438d1f;}})});}_0x2fa9e6=_['merge']({},_0x2fa9e6,_0x1e7454['options']);var _0x50df74={'where':_0x2fa9e6[_0x5950('0x44')]};return db[_0x5950('0x2e')]['count'](_0x50df74)['then'](function(_0x2c954f){_0x30d2b1[_0x5950('0x1d')]=_0x2c954f;if(_0x1e7454[_0x5950('0x34')][_0x5950('0x45')]){_0x2fa9e6['include']=[{'all':!![]}];}return db[_0x5950('0x2e')][_0x5950('0x46')](_0x2fa9e6);})[_0x5950('0x25')](function(_0x59674e){_0x30d2b1[_0x5950('0x47')]=_0x59674e;return _0x30d2b1;})[_0x5950('0x25')](respondWithFilteredResult(_0x7efc0e,_0x2fa9e6))[_0x5950('0x48')](handleError(_0x7efc0e,null));};exports[_0x5950('0x49')]=function(_0x473110,_0x2dc9dd){var _0xc1d31b={'raw':!![],'where':{'id':_0x473110[_0x5950('0x4a')]['id']}},_0x230f18={};_0x230f18[_0x5950('0x37')]=_[_0x5950('0x35')](db[_0x5950('0x2e')][_0x5950('0x2f')]);_0x230f18[_0x5950('0x34')]=_['keys'](_0x473110[_0x5950('0x34')]);_0x230f18[_0x5950('0x41')]=_[_0x5950('0x36')](_0x230f18['model'],_0x230f18[_0x5950('0x34')]);_0xc1d31b['attributes']=_[_0x5950('0x36')](_0x230f18[_0x5950('0x37')],qs[_0x5950('0x38')](_0x473110[_0x5950('0x34')][_0x5950('0x38')]));_0xc1d31b[_0x5950('0x39')]=_0xc1d31b[_0x5950('0x39')][_0x5950('0x3a')]?_0xc1d31b[_0x5950('0x39')]:_0x230f18[_0x5950('0x37')];if(_0x473110[_0x5950('0x34')][_0x5950('0x45')]){_0xc1d31b[_0x5950('0x4b')]=[{'all':!![]}];}_0xc1d31b=_[_0x5950('0x43')]({},_0xc1d31b,_0x473110[_0x5950('0x4c')]);return db['Pause']['find'](_0xc1d31b)[_0x5950('0x25')](handleEntityNotFound(_0x2dc9dd,null))[_0x5950('0x25')](respondWithResult(_0x2dc9dd,null))[_0x5950('0x48')](handleError(_0x2dc9dd,null));};exports['create']=function(_0x17306c,_0x17e563){return db[_0x5950('0x2e')][_0x5950('0x4d')](_0x17306c[_0x5950('0x4e')],{})[_0x5950('0x25')](function(_0x45fa06){var _0x32daa0=_0x17306c[_0x5950('0x4f')][_0x5950('0x27')]({'plain':!![]});if(!_0x32daa0)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x32daa0[_0x5950('0x50')]==='user'){var _0x22e769=_0x45fa06[_0x5950('0x27')]({'plain':!![]});var _0x103f8b=_0x5950('0x28');return db[_0x5950('0x51')]['find']({'where':{'name':_0x103f8b,'userProfileId':_0x32daa0[_0x5950('0x52')]},'raw':!![]})['then'](function(_0x193ee0){if(_0x193ee0&&_0x193ee0[_0x5950('0x53')]===0x0){return db[_0x5950('0x29')][_0x5950('0x4d')]({'name':_0x22e769[_0x5950('0x2b')],'resourceId':_0x22e769['id'],'type':_0x193ee0['name'],'sectionId':_0x193ee0['id']},{})[_0x5950('0x25')](function(){return _0x45fa06;});}else{return _0x45fa06;}})[_0x5950('0x48')](function(_0xa435e){logger[_0x5950('0x2a')](_0x5950('0x54'),_0xa435e);throw _0xa435e;});}return _0x45fa06;})['then'](respondWithResult(_0x17e563,0xc9))[_0x5950('0x48')](handleError(_0x17e563,null));};exports[_0x5950('0x24')]=function(_0x451684,_0x328c22){if(_0x451684['body']['id']){delete _0x451684[_0x5950('0x4e')]['id'];}return db[_0x5950('0x2e')][_0x5950('0x55')]({'where':{'id':_0x451684[_0x5950('0x4a')]['id']}})[_0x5950('0x25')](handleEntityNotFound(_0x328c22,null))['then'](saveUpdates(_0x451684[_0x5950('0x4e')],null))[_0x5950('0x25')](respondWithResult(_0x328c22,null))[_0x5950('0x48')](handleError(_0x328c22,null));};exports['destroy']=function(_0x7f3fd,_0xedd24){return db[_0x5950('0x2e')]['find']({'where':{'id':_0x7f3fd[_0x5950('0x4a')]['id']}})[_0x5950('0x25')](handleEntityNotFound(_0xedd24,null))[_0x5950('0x25')](removeEntity(_0xedd24,null))[_0x5950('0x48')](handleError(_0xedd24,null));}; \ No newline at end of file diff --git a/server/api/pause/pause.model.js b/server/api/pause/pause.model.js index 8591841..541f1da 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(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x565ed7,_0x398228){_0x565ed7=_0x565ed7-0x0;var _0x183ad7=_0xc4aa[_0x565ed7];return _0x183ad7;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var 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 _0x1cb9=['./pause.attributes','exports','define','Pause','lodash','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x5cc0f6,_0x51e98f){var _0x5b67b7=function(_0x13b963){while(--_0x13b963){_0x5cc0f6['push'](_0x5cc0f6['shift']());}};_0x5b67b7(++_0x51e98f);}(_0x1cb9,0x14e));var _0x91cb=function(_0x365035,_0xa6f269){_0x365035=_0x365035-0x0;var _0xe0b9cb=_0x1cb9[_0x365035];return _0xe0b9cb;};'use strict';var _=require(_0x91cb('0x0'));var util=require('util');var logger=require(_0x91cb('0x1'))(_0x91cb('0x2'));var moment=require(_0x91cb('0x3'));var BPromise=require(_0x91cb('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x91cb('0x5'));var rimraf=require(_0x91cb('0x6'));var config=require('../../config/environment');var attributes=require(_0x91cb('0x7'));module[_0x91cb('0x8')]=function(_0x186dc3,_0x28543e){return _0x186dc3[_0x91cb('0x9')](_0x91cb('0xa'),attributes,{'tableName':'tools_pauses','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/pause/pause.rpc.js b/server/api/pause/pause.rpc.js index 6b979de..b9596fc 100644 --- a/server/api/pause/pause.rpc.js +++ b/server/api/pause/pause.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Pause,\x20%s,\x20%s','Pause,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','ShowPause','Pause','find','options','raw','where','attributes','map','include','model','debug'];(function(_0xbc4e7b,_0x22d067){var _0x24fa33=function(_0x16ee4a){while(--_0x16ee4a){_0xbc4e7b['push'](_0xbc4e7b['shift']());}};_0x24fa33(++_0x22d067);}(_0xb10b,0x12a));var _0xbb10=function(_0x1d128e,_0x2c87de){_0x1d128e=_0x1d128e-0x0;var _0x3d5236=_0xb10b[_0x1d128e];return _0x3d5236;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});}exports[_0xbb10('0x15')]=function(_0x378da8){var _0x1682a4=this;return new Promise(function(_0x575cca,_0x30efc6){return db[_0xbb10('0x16')][_0xbb10('0x17')]({'raw':_0x378da8['options']?_0x378da8[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![],'where':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x1a')]||null:null,'attributes':_0x378da8[_0xbb10('0x18')]?_0x378da8['options'][_0xbb10('0x1b')]||null:null,'include':_0x378da8[_0xbb10('0x18')]?_0x378da8['options']['include']?_[_0xbb10('0x1c')](_0x378da8[_0xbb10('0x18')][_0xbb10('0x1d')],function(_0x317da4){return{'model':db[_0x317da4[_0xbb10('0x1e')]],'as':_0x317da4['as'],'attributes':_0x317da4[_0xbb10('0x1b')],'include':_0x317da4[_0xbb10('0x1d')]?_[_0xbb10('0x1c')](_0x317da4[_0xbb10('0x1d')],function(_0x395404){return{'model':db[_0x395404[_0xbb10('0x1e')]],'as':_0x395404['as'],'attributes':_0x395404[_0xbb10('0x1b')],'include':_0x395404['include']?_['map'](_0x395404['include'],function(_0xc93a04){return{'model':db[_0xc93a04[_0xbb10('0x1e')]],'as':_0xc93a04['as'],'attributes':_0xc93a04[_0xbb10('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2fdde9){logger[_0xbb10('0xd')](_0xbb10('0x15'),_0x378da8);logger[_0xbb10('0x1f')](_0xbb10('0x15'),_0x378da8,JSON[_0xbb10('0x11')](_0x2fdde9));_0x575cca(_0x2fdde9);})[_0xbb10('0x20')](function(_0x4aabb9){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0x4aabb9[_0xbb10('0x13')],_0x378da8);_0x30efc6(_0x1682a4[_0xbb10('0x12')](0x1f4,_0x4aabb9[_0xbb10('0x13')]));});});}; \ No newline at end of file +var _0xb10b=['catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Pause,\x20%s,\x20%s','Pause,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','ShowPause','Pause','find','options','raw','where','attributes','map','include','model','debug'];(function(_0x194e9a,_0x44a89c){var _0x463642=function(_0x182d21){while(--_0x182d21){_0x194e9a['push'](_0x194e9a['shift']());}};_0x463642(++_0x44a89c);}(_0xb10b,0x12a));var _0xbb10=function(_0x57a430,_0x281e18){_0x57a430=_0x57a430-0x0;var _0x533e30=_0xb10b[_0x57a430];return _0x533e30;};'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 c4ca3b9..f7f4e80 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 _0xbec5=['get','index','/webhook','webhookGet','/:id','isAuthenticated','show','/:id/download','download','diskStorage','join','root','originalname','replace','format','%s-%s%s','basename','extname','now','post','upload','webhookPost','update','delete','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./plugin.controller'];(function(_0x3a5857,_0x46a266){var _0x483491=function(_0x256eb7){while(--_0x256eb7){_0x3a5857['push'](_0x3a5857['shift']());}};_0x483491(++_0x46a266);}(_0xbec5,0xe5));var _0x5bec=function(_0x6e1239,_0x3562ac){_0x6e1239=_0x6e1239-0x0;var _0x418150=_0xbec5[_0x6e1239];return _0x418150;};'use strict';var multer=require(_0x5bec('0x0'));var util=require(_0x5bec('0x1'));var path=require('path');var timeout=require(_0x5bec('0x2'));var express=require(_0x5bec('0x3'));var router=express[_0x5bec('0x4')]();var fs_extra=require(_0x5bec('0x5'));var auth=require(_0x5bec('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x5bec('0x7'));var controller=require(_0x5bec('0x8'));router[_0x5bec('0x9')]('/',auth['isAuthenticated'](),controller[_0x5bec('0xa')]);router[_0x5bec('0x9')](_0x5bec('0xb'),controller[_0x5bec('0xc')]);router[_0x5bec('0x9')](_0x5bec('0xd'),auth[_0x5bec('0xe')](),controller[_0x5bec('0xf')]);router['get'](_0x5bec('0x10'),auth['isAuthenticated'](),controller[_0x5bec('0x11')]);var upload=multer({'storage':multer[_0x5bec('0x12')]({'destination':function(_0x117162,_0x4a5482,_0x288d1b){_0x288d1b(null,path[_0x5bec('0x13')](config[_0x5bec('0x14')],'server/files/plugins'));},'filename':function(_0x6bee21,_0x1c888f,_0x589d14){_0x1c888f[_0x5bec('0x15')]=_0x1c888f[_0x5bec('0x15')][_0x5bec('0x16')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x589d14(null,util[_0x5bec('0x17')](_0x5bec('0x18'),path[_0x5bec('0x19')](_0x1c888f[_0x5bec('0x15')],path[_0x5bec('0x1a')](_0x1c888f[_0x5bec('0x15')])),Date[_0x5bec('0x1b')](),path[_0x5bec('0x1a')](_0x1c888f[_0x5bec('0x15')])));}})});router[_0x5bec('0x1c')]('/',upload['single']('file'),controller[_0x5bec('0x1d')]);router[_0x5bec('0x1c')](_0x5bec('0xb'),controller[_0x5bec('0x1e')]);router['put']('/:id',auth[_0x5bec('0xe')](),controller[_0x5bec('0x1f')]);router['delete'](_0x5bec('0xd'),auth[_0x5bec('0xe')](),controller[_0x5bec('0x20')]);module[_0x5bec('0x21')]=router; \ No newline at end of file +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(_0x449cbe,_0x5b13e2){var _0x2c0853=function(_0x392246){while(--_0x392246){_0x449cbe['push'](_0x449cbe['shift']());}};_0x2c0853(++_0x5b13e2);}(_0xe13a,0x178));var _0xae13=function(_0x1f69c1,_0x460268){_0x1f69c1=_0x1f69c1-0x0;var _0x310343=_0xe13a[_0x1f69c1];return _0x310343;};'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 diff --git a/server/api/plugin/plugin.attributes.js b/server/api/plugin/plugin.attributes.js index 7426381..4287cd9 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 _0xf928=['script','TEXT','STRING','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','BOOLEAN','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','agentOnly','always','never','exports','ENUM','html'];(function(_0x1afcec,_0x2e37ec){var _0x3d0553=function(_0x547ef7){while(--_0x547ef7){_0x1afcec['push'](_0x1afcec['shift']());}};_0x3d0553(++_0x2e37ec);}(_0xf928,0xb1));var _0x8f92=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xf928[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require('sequelize');module[_0x8f92('0x0')]={'name':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x8f92('0x1')](_0x8f92('0x2'),_0x8f92('0x3'))},'description':{'type':Sequelize[_0x8f92('0x4')]},'version':{'type':Sequelize[_0x8f92('0x4')]},'path':{'type':Sequelize[_0x8f92('0x5')],'comment':_0x8f92('0x6')},'active':{'type':Sequelize[_0x8f92('0x7')],'defaultValue':0x0,'comment':_0x8f92('0x8')},'sidebar':{'type':Sequelize[_0x8f92('0x1')]('adminOnly',_0x8f92('0x9'),_0x8f92('0xa'),_0x8f92('0xb')),'defaultValue':_0x8f92('0xa'),'comment':'Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.'},'icon':{'type':Sequelize[_0x8f92('0x5')]},'adminUrl':{'type':Sequelize[_0x8f92('0x5')]},'agentUrl':{'type':Sequelize[_0x8f92('0x5')]},'scriptName':{'type':Sequelize[_0x8f92('0x5')]},'scriptPath':{'type':Sequelize[_0x8f92('0x5')]}}; \ No newline at end of file +var _0xa70a=['ENUM','html','script','TEXT','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','BOOLEAN','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','adminOnly','agentOnly','always','never','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','sequelize','exports','STRING'];(function(_0xc8a931,_0x260690){var _0x28bd27=function(_0x591b9f){while(--_0x591b9f){_0xc8a931['push'](_0xc8a931['shift']());}};_0x28bd27(++_0x260690);}(_0xa70a,0x1bf));var _0xaa70=function(_0x32b9f6,_0x421946){_0x32b9f6=_0x32b9f6-0x0;var _0x52c7dd=_0xa70a[_0x32b9f6];return _0x52c7dd;};'use strict';var Sequelize=require(_0xaa70('0x0'));module[_0xaa70('0x1')]={'name':{'type':Sequelize[_0xaa70('0x2')]},'type':{'type':Sequelize[_0xaa70('0x3')](_0xaa70('0x4'),_0xaa70('0x5'))},'description':{'type':Sequelize[_0xaa70('0x6')]},'version':{'type':Sequelize[_0xaa70('0x6')]},'path':{'type':Sequelize[_0xaa70('0x2')],'comment':_0xaa70('0x7')},'active':{'type':Sequelize[_0xaa70('0x8')],'defaultValue':0x0,'comment':_0xaa70('0x9')},'sidebar':{'type':Sequelize[_0xaa70('0x3')](_0xaa70('0xa'),_0xaa70('0xb'),_0xaa70('0xc'),_0xaa70('0xd')),'defaultValue':'always','comment':_0xaa70('0xe')},'icon':{'type':Sequelize[_0xaa70('0x2')]},'adminUrl':{'type':Sequelize[_0xaa70('0x2')]},'agentUrl':{'type':Sequelize[_0xaa70('0x2')]},'scriptName':{'type':Sequelize[_0xaa70('0x2')]},'scriptPath':{'type':Sequelize[_0xaa70('0x2')]}}; \ No newline at end of file diff --git a/server/api/plugin/plugin.controller.js b/server/api/plugin/plugin.controller.js index a77b417..11c4fbd 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 _0x1129=['query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','filter','merge','where','options','includeAll','catch','params','include','find','download','join','root','format','%s.zip','createWriteStream','zip','warning','code','error','Sequelize','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','pipe','glob','server/files/plugins','dirname','basename','node_modules/**/*','attachments/**/*','finalize','close','existsSync','Plugin\x20not\x20found','Error\x20while\x20downloading\x20the\x20plugin','unlinkSync','info','Download\x20completed','Temporary\x20file\x20removed','upload','file','extname','filename','Plugin\x20upload\x20filepath:\x20%s','chmodSync','0777','readdirSync','Invalid\x20plugin\x20structure','lstatSync','isFile','isDirectory','some','manifest.json','Plugin\x20manifest\x20missing','parse','Invalid\x20manifest:\x20name\x20missing','Invalid\x20manifest:\x20type\x20missing','version','Invalid\x20manifest:\x20version\x20not\x20specified','parameters','Invalid\x20manifest:\x20parameters\x20missing','html','views','Invalid\x20manifest:\x20no\x20view\x20specified','script','scriptName','Invalid\x20manifest:\x20script\x20name\x20missing','scriptPath','Invalid\x20manifest:\x20invalid\x20type','sidebar','always','icon','admin','test','agent','plugins','Warning:\x20agent\x20view\x20not\x20specified','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','userProfileId','UserProfileResource','Extracted\x20folder\x20removed','webhookGet','resolve','hostname','port','http://localhost:','encoding','method','headers','content-length','content-type','statusCode','\x27PATH\x27\x20parameter\x20not\x20specified','\x27PORT\x27\x20parameter\x20not\x20specified','%s%s','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','extract-zip','archiver','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','json','reject','save','update','then','get','Plugins','destroy','name','send','map','Plugin','rawAttributes','fieldName','type','model'];(function(_0x583cef,_0x55656e){var _0x3d1abf=function(_0x2e0853){while(--_0x2e0853){_0x583cef['push'](_0x583cef['shift']());}};_0x3d1abf(++_0x55656e);}(_0x1129,0x112));var _0x9112=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x1129[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9112('0x0'));var zipdir=require(_0x9112('0x1'));var jsonpatch=require(_0x9112('0x2'));var rp=require(_0x9112('0x3'));var moment=require(_0x9112('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x9112('0x5'));var util=require(_0x9112('0x6'));var path=require(_0x9112('0x7'));var sox=require(_0x9112('0x8'));var csv=require(_0x9112('0x9'));var ejs=require(_0x9112('0xa'));var fs=require('fs');var fs_extra=require(_0x9112('0xb'));var _=require('lodash');var squel=require(_0x9112('0xc'));var crypto=require('crypto');var jsforce=require(_0x9112('0xd'));var deskjs=require(_0x9112('0xe'));var toCsv=require(_0x9112('0x9'));var querystring=require(_0x9112('0xf'));var Papa=require(_0x9112('0x10'));var extract=require(_0x9112('0x11'));var rimraf=require(_0x9112('0x0'));var archiver=require(_0x9112('0x12'));var Redis=require('ioredis');var authService=require(_0x9112('0x13'));var qs=require(_0x9112('0x14'));var as=require(_0x9112('0x15'));var hardwareService=require(_0x9112('0x16'));var logger=require(_0x9112('0x17'))('api');var utils=require(_0x9112('0x18'));var config=require(_0x9112('0x19'));var licenseUtil=require(_0x9112('0x1a'));var db=require(_0x9112('0x1b'))['db'];config[_0x9112('0x1c')]=_[_0x9112('0x1d')](config[_0x9112('0x1c')],{'host':_0x9112('0x1e'),'port':0x18eb});var socket=require(_0x9112('0x1f'))(new Redis(config[_0x9112('0x1c')]));require('./plugin.socket')[_0x9112('0x20')](socket);function respondWithStatusCode(_0x511543,_0x2afd84){_0x2afd84=_0x2afd84||0xcc;return function(_0x531cc6){if(_0x531cc6){return _0x511543[_0x9112('0x21')](_0x2afd84);}return _0x511543[_0x9112('0x22')](_0x2afd84)[_0x9112('0x23')]();};}function respondWithResult(_0x412a5b,_0x414596){_0x414596=_0x414596||0xc8;return function(_0x18857d){if(_0x18857d){return _0x412a5b[_0x9112('0x22')](_0x414596)['json'](_0x18857d);}};}function respondWithFilteredResult(_0x4443c5,_0xed6c6d){return function(_0xfbf915){if(_0xfbf915){var _0x1ae346=typeof _0xed6c6d['offset']===_0x9112('0x24')&&typeof _0xed6c6d[_0x9112('0x25')]===_0x9112('0x24');var _0x20432c=_0xfbf915[_0x9112('0x26')];var _0x1ad10d=_0x1ae346?0x0:_0xed6c6d['offset'];var _0x42a4f9=_0x1ae346?_0xfbf915[_0x9112('0x26')]:_0xed6c6d[_0x9112('0x27')]+_0xed6c6d[_0x9112('0x25')];var _0x5d535f;if(_0x42a4f9>=_0x20432c){_0x42a4f9=_0x20432c;_0x5d535f=0xc8;}else{_0x5d535f=0xce;}_0x4443c5[_0x9112('0x22')](_0x5d535f);return _0x4443c5[_0x9112('0x28')](_0x9112('0x29'),_0x1ad10d+'-'+_0x42a4f9+'/'+_0x20432c)[_0x9112('0x2a')](_0xfbf915);}return null;};}function patchUpdates(_0x563192){return function(_0x1ce34b){try{jsonpatch['apply'](_0x1ce34b,_0x563192,!![]);}catch(_0x3828ad){return BPromise[_0x9112('0x2b')](_0x3828ad);}return _0x1ce34b[_0x9112('0x2c')]();};}function saveUpdates(_0x1dcfd8,_0x2c99c3){return function(_0x312354){if(_0x312354){return _0x312354[_0x9112('0x2d')](_0x1dcfd8)['then'](function(_0x329fa2){return _0x329fa2;});}return null;};}function removeEntity(_0x4817f6,_0x87b352){return function(_0x163bcc){if(_0x163bcc){return _0x163bcc['destroy']()[_0x9112('0x2e')](function(){var _0x2d8a36=_0x163bcc[_0x9112('0x2f')]({'plain':!![]});var _0x23dee0=_0x9112('0x30');return db['UserProfileResource'][_0x9112('0x31')]({'where':{'type':_0x23dee0,'resourceId':_0x2d8a36['id']}})[_0x9112('0x2e')](function(){return _0x163bcc;});})[_0x9112('0x2e')](function(){_0x4817f6[_0x9112('0x22')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2e297d,_0x20a186){return function(_0x4a3f49){if(!_0x4a3f49){_0x2e297d['sendStatus'](0x194);}return _0x4a3f49;};}function handleError(_0x4845d4,_0x53e9bc){_0x53e9bc=_0x53e9bc||0x1f4;return function(_0xcd59de){logger['error'](_0xcd59de['stack']);if(_0xcd59de[_0x9112('0x32')]){delete _0xcd59de[_0x9112('0x32')];}_0x4845d4['status'](_0x53e9bc)[_0x9112('0x33')](_0xcd59de);};}exports['index']=function(_0xc2514e,_0x2af708){var _0x308c08={},_0x455921={},_0xf12a25={'count':0x0,'rows':[]};var _0x2d2eeb=_[_0x9112('0x34')](db[_0x9112('0x35')][_0x9112('0x36')],function(_0x12cdb7){return{'name':_0x12cdb7[_0x9112('0x37')],'type':_0x12cdb7[_0x9112('0x38')]['key']};});_0x455921[_0x9112('0x39')]=_[_0x9112('0x34')](_0x2d2eeb,_0x9112('0x32'));_0x455921[_0x9112('0x3a')]=_[_0x9112('0x3b')](_0xc2514e[_0x9112('0x3a')]);_0x455921[_0x9112('0x3c')]=_[_0x9112('0x3d')](_0x455921[_0x9112('0x39')],_0x455921[_0x9112('0x3a')]);_0x308c08[_0x9112('0x3e')]=_[_0x9112('0x3d')](_0x455921[_0x9112('0x39')],qs['fields'](_0xc2514e[_0x9112('0x3a')][_0x9112('0x3f')]));_0x308c08[_0x9112('0x3e')]=_0x308c08[_0x9112('0x3e')][_0x9112('0x40')]?_0x308c08['attributes']:_0x455921['model'];if(!_0xc2514e[_0x9112('0x3a')]['hasOwnProperty'](_0x9112('0x41'))){_0x308c08[_0x9112('0x25')]=qs['limit'](_0xc2514e[_0x9112('0x3a')][_0x9112('0x25')]);_0x308c08[_0x9112('0x27')]=qs[_0x9112('0x27')](_0xc2514e[_0x9112('0x3a')][_0x9112('0x27')]);}_0x308c08[_0x9112('0x42')]=qs[_0x9112('0x43')](_0xc2514e[_0x9112('0x3a')][_0x9112('0x43')]);_0x308c08['where']=qs[_0x9112('0x3c')](_[_0x9112('0x44')](_0xc2514e[_0x9112('0x3a')],_0x455921[_0x9112('0x3c')]),_0x2d2eeb);if(_0xc2514e[_0x9112('0x3a')][_0x9112('0x45')]){_0x308c08['where']=_[_0x9112('0x46')](_0x308c08[_0x9112('0x47')],{'$or':_[_0x9112('0x34')](_0x2d2eeb,function(_0x4a8583){if(_0x4a8583['type']!=='VIRTUAL'){var _0x2bdf7e={};_0x2bdf7e[_0x4a8583[_0x9112('0x32')]]={'$like':'%'+_0xc2514e[_0x9112('0x3a')][_0x9112('0x45')]+'%'};return _0x2bdf7e;}})});}_0x308c08=_[_0x9112('0x46')]({},_0x308c08,_0xc2514e[_0x9112('0x48')]);var _0x643bdf={'where':_0x308c08['where']};return db[_0x9112('0x35')][_0x9112('0x26')](_0x643bdf)['then'](function(_0x38663f){_0xf12a25[_0x9112('0x26')]=_0x38663f;if(_0xc2514e['query'][_0x9112('0x49')]){_0x308c08['include']=[{'all':!![]}];}return db[_0x9112('0x35')]['findAll'](_0x308c08);})['then'](function(_0x59a39f){_0xf12a25['rows']=_0x59a39f;return _0xf12a25;})[_0x9112('0x2e')](respondWithFilteredResult(_0x2af708,_0x308c08))[_0x9112('0x4a')](handleError(_0x2af708,null));};exports['show']=function(_0x1010cd,_0x1e0521){var _0x56a0db={'raw':!![],'where':{'id':_0x1010cd[_0x9112('0x4b')]['id']}},_0x140a17={};_0x140a17['model']=_[_0x9112('0x3b')](db['Plugin'][_0x9112('0x36')]);_0x140a17[_0x9112('0x3a')]=_[_0x9112('0x3b')](_0x1010cd[_0x9112('0x3a')]);_0x140a17[_0x9112('0x3c')]=_[_0x9112('0x3d')](_0x140a17[_0x9112('0x39')],_0x140a17[_0x9112('0x3a')]);_0x56a0db['attributes']=_[_0x9112('0x3d')](_0x140a17[_0x9112('0x39')],qs['fields'](_0x1010cd['query'][_0x9112('0x3f')]));_0x56a0db[_0x9112('0x3e')]=_0x56a0db[_0x9112('0x3e')][_0x9112('0x40')]?_0x56a0db[_0x9112('0x3e')]:_0x140a17[_0x9112('0x39')];if(_0x1010cd[_0x9112('0x3a')][_0x9112('0x49')]){_0x56a0db[_0x9112('0x4c')]=[{'all':!![]}];}_0x56a0db=_['merge']({},_0x56a0db,_0x1010cd[_0x9112('0x48')]);return db[_0x9112('0x35')][_0x9112('0x4d')](_0x56a0db)[_0x9112('0x2e')](handleEntityNotFound(_0x1e0521,null))[_0x9112('0x2e')](respondWithResult(_0x1e0521,null))[_0x9112('0x4a')](handleError(_0x1e0521,null));};exports[_0x9112('0x4e')]=function(_0x2d6a12,_0x5ceffd,_0x11eef){return db[_0x9112('0x35')][_0x9112('0x4d')]({'where':{'id':_0x2d6a12[_0x9112('0x4b')]['id']},'attributes':['name',_0x9112('0x7')],'raw':!![]})[_0x9112('0x2e')](handleEntityNotFound(_0x5ceffd,null))[_0x9112('0x2e')](function(_0x489a73){if(_0x489a73){var _0xce778=path[_0x9112('0x4f')](config[_0x9112('0x50')],'server/files/plugins',util[_0x9112('0x51')](_0x9112('0x52'),path['basename'](_0x489a73[_0x9112('0x7')])));var _0x4b0b2b=fs[_0x9112('0x53')](_0xce778);var _0x69d20b=archiver(_0x9112('0x54'),{'zlib':{'level':0x9}});_0x69d20b['on'](_0x9112('0x55'),function(_0x3c80b8){if(_0x3c80b8[_0x9112('0x56')]==='ENOENT'){logger[_0x9112('0x57')](_0x3c80b8);}else{throw new db[(_0x9112('0x58'))][(_0x9112('0x59'))](_0x9112('0x5a'));}});_0x69d20b['on'](_0x9112('0x57'),function(_0x16bfcb){throw new db[(_0x9112('0x58'))][(_0x9112('0x59'))]('Error\x20while\x20generating\x20the\x20zip\x20archive');});_0x69d20b[_0x9112('0x5b')](_0x4b0b2b);_0x69d20b[_0x9112('0x5c')]('**/*',{'cwd':path[_0x9112('0x4f')](config['root'],_0x9112('0x5d'),path[_0x9112('0x5e')](_0x489a73[_0x9112('0x7')])),'ignore':[path[_0x9112('0x4f')](path[_0x9112('0x5f')](_0x489a73['path']),_0x9112('0x60')),path['join'](path[_0x9112('0x5f')](_0x489a73[_0x9112('0x7')]),_0x9112('0x61'))],'nodir':!![]})[_0x9112('0x62')]();_0x4b0b2b['on'](_0x9112('0x63'),function(){if(!fs[_0x9112('0x64')](_0xce778)){throw new db['Sequelize']['Error'](_0x9112('0x65'));}return _0x5ceffd[_0x9112('0x4e')](_0xce778,util[_0x9112('0x51')](_0x9112('0x52'),path['basename'](_0x489a73[_0x9112('0x7')])),function(_0x52ab20){if(_0x52ab20){throw new db[(_0x9112('0x58'))][(_0x9112('0x59'))](_0x9112('0x66'));}fs[_0x9112('0x67')](_0xce778);logger[_0x9112('0x68')](_0x9112('0x69'));logger[_0x9112('0x68')](_0x9112('0x6a'));});});}return null;})['catch'](handleError(_0x5ceffd,null));};exports[_0x9112('0x6b')]=function(_0x5c3dff,_0x3b3501,_0x2fc093){var _0x92f9f2=path[_0x9112('0x5f')](_0x5c3dff[_0x9112('0x6c')]['filename'],path[_0x9112('0x6d')](_0x5c3dff['file'][_0x9112('0x6e')]));var _0x5973df=path[_0x9112('0x4f')](config['root'],_0x9112('0x5d'),_0x5c3dff[_0x9112('0x6c')][_0x9112('0x6e')]);var _0x24dd9a=path[_0x9112('0x4f')](config['root'],_0x9112('0x5d'),_0x92f9f2);logger[_0x9112('0x68')](_0x9112('0x6f'),_0x5973df);logger[_0x9112('0x68')]('Plugin\x20upload\x20destination:\x20%s',_0x24dd9a);try{fs[_0x9112('0x70')](_0x5973df,parseInt(_0x9112('0x71'),0x8));extract(_0x5973df,{'dir':_0x24dd9a},function(_0x383c04){if(_0x383c04){logger[_0x9112('0x57')](_0x383c04);handleError(_0x383c04,!![]);};var _0x2aeef8=fs[_0x9112('0x72')](_0x24dd9a);if(_0x2aeef8[_0x9112('0x40')]>0x1){removeReferences(_0x5973df,_0x24dd9a);logger[_0x9112('0x57')]('Invalid\x20plugin\x20structure');return _0x2fc093(new Error(_0x9112('0x73')));}var _0x422a35=fs[_0x9112('0x74')](path['join'](_0x24dd9a,_0x2aeef8[0x0]));if(_0x422a35[_0x9112('0x75')]()){removeReferences(_0x5973df,_0x24dd9a);logger[_0x9112('0x57')](_0x9112('0x73'));return _0x2fc093(new Error(_0x9112('0x73')));}if(_0x422a35[_0x9112('0x76')]()){var _0x25879b=fs[_0x9112('0x72')](path[_0x9112('0x4f')](_0x24dd9a,_0x2aeef8[0x0]));if(_0x25879b['length']===0x0){removeReferences(_0x5973df,_0x24dd9a);logger[_0x9112('0x57')]('Invalid\x20plugin\x20structure');return _0x2fc093(new Error('Invalid\x20plugin\x20structure'));}var _0x1c08b4=_0x25879b[_0x9112('0x77')](function(_0x91ac7f){return _0x91ac7f===_0x9112('0x78');});if(!_0x1c08b4){return _0x2fc093(new Error(_0x9112('0x79')));}var _0x4448b5=fs['readFileSync'](path[_0x9112('0x4f')](_0x24dd9a,_0x2aeef8[0x0],_0x9112('0x78')));var _0x117f4c=JSON[_0x9112('0x7a')](_0x4448b5);if(_0x9112('0x24')==typeof _0x117f4c[_0x9112('0x32')]){return _0x2fc093(new Error(_0x9112('0x7b')));}if(_0x9112('0x24')==typeof _0x117f4c['type']){return _0x2fc093(new Error(_0x9112('0x7c')));}if(_0x9112('0x24')==typeof _0x117f4c[_0x9112('0x7d')]){return _0x2fc093(new Error(_0x9112('0x7e')));}if('undefined'==typeof _0x117f4c[_0x9112('0x7f')]){return _0x2fc093(new Error(_0x9112('0x80')));}if(_0x117f4c[_0x9112('0x38')]===_0x9112('0x81')){if(_0x9112('0x24')==typeof _0x117f4c[_0x9112('0x7f')][_0x9112('0x82')]){return _0x2fc093(new Error('Invalid\x20manifest:\x20views\x20missing'));}if('undefined'==typeof _0x117f4c['parameters'][_0x9112('0x82')]['admin']&&_0x9112('0x24')==typeof _0x117f4c[_0x9112('0x7f')][_0x9112('0x82')]['agent']){return _0x2fc093(new Error(_0x9112('0x83')));}}else if(_0x117f4c['type']===_0x9112('0x84')){if(_0x9112('0x24')==typeof _0x117f4c[_0x9112('0x7f')][_0x9112('0x85')]){return _0x2fc093(new Error(_0x9112('0x86')));}if(_0x9112('0x24')==typeof _0x117f4c['parameters'][_0x9112('0x87')]){return _0x2fc093(new Error('Invalid\x20manifest:\x20script\x20path\x20missing'));}}else{return _0x2fc093(new Error(_0x9112('0x88')));}var _0x4244c2=_0x117f4c['name'];var _0x293fa5=_0x117f4c['description'];var _0x110408=_0x117f4c['type'];var _0x475b7b=_0x117f4c[_0x9112('0x89')]?_0x117f4c['sidebar']:_0x9112('0x8a');var _0x2ff77f=_0x117f4c['icon']?_0x117f4c[_0x9112('0x8b')]:'icon-apps';var _0x5d1d7d='';var _0x3ee044='';var _0xc72a9='';var _0x19275d='';var _0x405a89=_0x117f4c[_0x9112('0x7d')];if(_0x110408===_0x9112('0x81')){if(_0x9112('0x24')!=typeof _0x117f4c[_0x9112('0x7f')][_0x9112('0x82')][_0x9112('0x8c')]){var _0x4e7d9e=_0x117f4c['parameters']['views']['admin'];if(!/^(f|ht)tps?:\/\//i[_0x9112('0x8d')](_0x4e7d9e)){_0x5d1d7d=path[_0x9112('0x4f')]('plugins',_0x92f9f2,_0x2aeef8[0x0],_0x4e7d9e);}else{_0x5d1d7d=_0x4e7d9e;}}else{logger['info']('Warning:\x20admin\x20view\x20not\x20specified');}if(_0x9112('0x24')!=typeof _0x117f4c[_0x9112('0x7f')][_0x9112('0x82')][_0x9112('0x8e')]){var _0x36003c=_0x117f4c[_0x9112('0x7f')][_0x9112('0x82')][_0x9112('0x8e')];if(!/^(f|ht)tps?:\/\//i[_0x9112('0x8d')](_0x36003c)){_0x3ee044=path[_0x9112('0x4f')](_0x9112('0x8f'),_0x92f9f2,_0x2aeef8[0x0],_0x36003c);}else{_0x3ee044=_0x36003c;}}else{logger[_0x9112('0x68')](_0x9112('0x90'));}}else if(_0x110408===_0x9112('0x84')){_0xc72a9=_0x117f4c[_0x9112('0x7f')]['scriptName'];_0x19275d=_0x117f4c[_0x9112('0x7f')][_0x9112('0x87')];if('undefined'!=typeof _0x117f4c[_0x9112('0x7f')][_0x9112('0x82')]){if(_0x9112('0x24')!=typeof _0x117f4c[_0x9112('0x7f')][_0x9112('0x82')][_0x9112('0x8c')]){var _0x4e7d9e=_0x117f4c['parameters'][_0x9112('0x82')][_0x9112('0x8c')];if(!/^(f|ht)tps?:\/\//i[_0x9112('0x8d')](_0x4e7d9e)){_0x5d1d7d=path[_0x9112('0x4f')](_0x9112('0x8f'),_0x92f9f2,_0x2aeef8[0x0],_0x4e7d9e);}else{_0x5d1d7d=_0x4e7d9e;}}if('undefined'!=typeof _0x117f4c[_0x9112('0x7f')][_0x9112('0x82')][_0x9112('0x8e')]){var _0x36003c=_0x117f4c[_0x9112('0x7f')][_0x9112('0x82')]['agent'];if(!/^(f|ht)tps?:\/\//i['test'](_0x36003c)){_0x3ee044=path[_0x9112('0x4f')](_0x9112('0x8f'),_0x92f9f2,_0x2aeef8[0x0],_0x36003c);}else{_0x3ee044=_0x36003c;}}}}var _0xb035a6={'name':_0x4244c2,'description':_0x293fa5,'path':path[_0x9112('0x4f')](_0x92f9f2,_0x2aeef8[0x0]),'type':_0x110408,'sidebar':_0x475b7b,'icon':_0x2ff77f,'adminUrl':_0x5d1d7d,'agentUrl':_0x3ee044,'scriptName':_0xc72a9,'scriptPath':_0x19275d,'version':_0x405a89};removeReferences(_0x5973df,null);return db[_0x9112('0x35')][_0x9112('0x91')](_0xb035a6)[_0x9112('0x2e')](function(_0x5abfb7){var _0x4fc4d7={'role':_0x5c3dff['body']['role'],'userProfileId':_0x5c3dff[_0x9112('0x92')]['userProfileId']};if(!_0x4fc4d7)throw new Error(_0x9112('0x93'));if(_0x4fc4d7['role']===_0x9112('0x94')){var _0x6e353=_0x5abfb7['get']({'plain':!![]});return db['UserProfileSection']['find']({'where':{'name':_0x9112('0x30'),'userProfileId':_0x4fc4d7[_0x9112('0x95')]},'raw':!![]})[_0x9112('0x2e')](function(_0x2a8931){if(_0x2a8931&&_0x2a8931['autoAssociation']===0x0){return db[_0x9112('0x96')][_0x9112('0x91')]({'name':_0x6e353[_0x9112('0x32')],'resourceId':_0x6e353['id'],'type':_0x2a8931[_0x9112('0x32')],'sectionId':_0x2a8931['id']},{})[_0x9112('0x2e')](function(){return _0x5abfb7;});}else{return _0x5abfb7;}})[_0x9112('0x4a')](function(_0x2aff83){logger[_0x9112('0x57')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2aff83);throw _0x2aff83;});}return _0x5abfb7;})[_0x9112('0x2e')](respondWithResult(_0x3b3501,null))['catch'](handleError(_0x3b3501,null));}});}catch(_0xea20a){_0x3b3501[_0x9112('0x22')](0x1f4)['send'](_0xea20a);}};function removeReferences(_0x56bb59,_0x7f1f4f){try{if(_0x56bb59){fs['unlinkSync'](_0x56bb59);logger[_0x9112('0x68')]('Zip\x20archive\x20removed');}if(_0x7f1f4f){rimraf(_0x7f1f4f,function(){});logger[_0x9112('0x68')](_0x9112('0x97'));}}catch(_0x220deb){logger[_0x9112('0x57')](_0x220deb);}}exports[_0x9112('0x2d')]=function(_0x364167,_0x341367,_0x279f14){return db[_0x9112('0x35')][_0x9112('0x4d')]({'where':{'id':_0x364167['params']['id']}})[_0x9112('0x2e')](handleEntityNotFound(_0x341367,null))[_0x9112('0x2e')](saveUpdates(_0x364167[_0x9112('0x92')],null))[_0x9112('0x2e')](respondWithResult(_0x341367,null))['catch'](handleError(_0x341367,null));};exports['delete']=function(_0x563c22,_0x249930,_0x24c02f){return db[_0x9112('0x35')][_0x9112('0x4d')]({'where':{'id':_0x563c22[_0x9112('0x4b')]['id']}})['then'](function(_0x364798){if(_0x364798){return _0x364798[_0x9112('0x31')]();}})['then'](function(_0x293fa2){rimraf(path[_0x9112('0x4f')](config[_0x9112('0x50')],_0x9112('0x5d'),path[_0x9112('0x5e')](_0x293fa2[_0x9112('0x7')])),function(){});return _0x293fa2;})['then'](handleEntityNotFound(_0x249930,null))[_0x9112('0x2e')](respondWithStatusCode(_0x249930,null))[_0x9112('0x4a')](handleError(_0x249930,null));};exports[_0x9112('0x98')]=function(_0x468dc9,_0x2f143f,_0x1c8e28){return BPromise[_0x9112('0x99')]()[_0x9112('0x2e')](function(){if(!_0x468dc9[_0x9112('0x3a')][_0x9112('0x7')]){throw new Error('\x27PATH\x27\x20parameter\x20not\x20specified');}if(!_0x468dc9['query']['port']){throw new Error('\x27PORT\x27\x20parameter\x20not\x20specified');}var _0x5ee97b=_0x468dc9['query']['hostname']?_0x468dc9[_0x9112('0x3a')][_0x9112('0x9a')]+':'+_0x468dc9[_0x9112('0x3a')][_0x9112('0x9b')]:_0x9112('0x9c')+_0x468dc9[_0x9112('0x3a')][_0x9112('0x9b')];var _0x457233=_0x468dc9[_0x9112('0x3a')]['json']?_0x468dc9[_0x9112('0x3a')][_0x9112('0x2a')]:!![];var _0x4392fe=_0x468dc9['query'][_0x9112('0x9d')]?_0x468dc9['query']['encoding']:null;var _0x6b8d1b={'method':_0x468dc9[_0x9112('0x9e')],'uri':util['format']('%s%s',_0x5ee97b,_0x468dc9[_0x9112('0x3a')][_0x9112('0x7')]),'json':_0x457233,'resolveWithFullResponse':!![],'encoding':_0x4392fe,'qs':_0x468dc9['query']};if(_0x468dc9[_0x9112('0x9f')]){_0x6b8d1b[_0x9112('0x9f')]=_0x468dc9[_0x9112('0x9f')];if(_0x6b8d1b[_0x9112('0x9f')][_0x9112('0xa0')]){delete _0x6b8d1b[_0x9112('0x9f')][_0x9112('0xa0')];}}if(_0x6b8d1b['headers'][_0x9112('0xa1')]){delete _0x6b8d1b['headers'][_0x9112('0xa1')];}return rp(_0x6b8d1b);})[_0x9112('0x2e')](function(_0x362004){if(_0x362004){_0x2f143f[_0x9112('0x28')](_0x362004[_0x9112('0x9f')]);logger[_0x9112('0x68')](_0x362004[_0x9112('0x92')]);if(_['endsWith'](_0x468dc9[_0x9112('0x3a')][_0x9112('0x7')],'download')&&_0x362004[_0x9112('0xa2')]==0x1f4){return _0x2f143f[_0x9112('0x21')](_0x362004[_0x9112('0xa2')]);}else{return _0x2f143f[_0x9112('0x22')](_0x362004[_0x9112('0xa2')])[_0x9112('0x33')](_0x362004[_0x9112('0x92')]);}}else{return _0x2f143f[_0x9112('0x21')](0xc8);}})[_0x9112('0x4a')](handleError(_0x2f143f,null));};exports['webhookPost']=function(_0xfcbc99,_0x5ac59e,_0x384cfb){return BPromise[_0x9112('0x99')]()[_0x9112('0x2e')](function(){if(!_0xfcbc99[_0x9112('0x3a')][_0x9112('0x7')]){throw new Error(_0x9112('0xa3'));}if(!_0xfcbc99[_0x9112('0x3a')][_0x9112('0x9b')]){throw new Error(_0x9112('0xa4'));}var _0x53a423=_0xfcbc99[_0x9112('0x3a')][_0x9112('0x9a')]?_0xfcbc99[_0x9112('0x3a')]['hostname']+':'+_0xfcbc99[_0x9112('0x3a')]['port']:_0x9112('0x9c')+_0xfcbc99['query'][_0x9112('0x9b')];var _0x40b326=_0xfcbc99[_0x9112('0x3a')][_0x9112('0x2a')]?_0xfcbc99['query'][_0x9112('0x2a')]:!![];var _0xac3ef5=_0xfcbc99[_0x9112('0x3a')][_0x9112('0x9d')]?_0xfcbc99[_0x9112('0x3a')][_0x9112('0x9d')]:null;var _0x59449a={'method':_0xfcbc99[_0x9112('0x9e')],'uri':util[_0x9112('0x51')](_0x9112('0xa5'),_0x53a423,_0xfcbc99['query']['path']),'json':_0x40b326,'resolveWithFullResponse':!![],'encoding':_0xac3ef5,'body':_0xfcbc99[_0x9112('0x92')]};if(_0xfcbc99[_0x9112('0x9f')]){_0x59449a['headers']=_0xfcbc99[_0x9112('0x9f')];if(_0x59449a[_0x9112('0x9f')][_0x9112('0xa0')]){delete _0x59449a[_0x9112('0x9f')]['content-length'];}}if(_0x59449a[_0x9112('0x9f')]['content-type']){delete _0x59449a[_0x9112('0x9f')][_0x9112('0xa1')];}return rp(_0x59449a);})['then'](function(_0x5944d8){if(_0x5944d8){_0x5ac59e[_0x9112('0x28')](_0x5944d8[_0x9112('0x9f')]);logger[_0x9112('0x68')](_0x5944d8[_0x9112('0x92')]);return _0x5ac59e[_0x9112('0x22')](_0x5944d8[_0x9112('0xa2')])[_0x9112('0x33')](_0x5944d8['body']);}else{return _0x5ac59e[_0x9112('0x21')](0xc8);}})[_0x9112('0x4a')](handleError(_0x5ac59e,null));}; \ No newline at end of file +var _0x2e08=['info','Download\x20completed','Temporary\x20file\x20removed','upload','file','filename','Plugin\x20upload\x20filepath:\x20%s','Plugin\x20upload\x20destination:\x20%s','0777','Invalid\x20plugin\x20structure','isDirectory','readdirSync','parse','Invalid\x20manifest:\x20name\x20missing','version','Invalid\x20manifest:\x20version\x20not\x20specified','html','parameters','Invalid\x20manifest:\x20views\x20missing','views','admin','agent','script','scriptName','Invalid\x20manifest:\x20script\x20name\x20missing','scriptPath','Invalid\x20manifest:\x20script\x20path\x20missing','Invalid\x20manifest:\x20invalid\x20type','sidebar','always','icon','icon-apps','test','Warning:\x20admin\x20view\x20not\x20specified','plugins','Warning:\x20agent\x20view\x20not\x20specified','create','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','send','Zip\x20archive\x20removed','delete','resolve','\x27PATH\x27\x20parameter\x20not\x20specified','port','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','http://localhost:','encoding','method','%s%s','headers','content-length','content-type','endsWith','statusCode','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','socket.io-emitter','./plugin.socket','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','save','update','then','get','Plugins','UserProfileResource','destroy','sendStatus','error','stack','name','index','map','Plugin','type','key','model','query','filters','intersection','attributes','fields','length','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','rawAttributes','download','find','params','join','basename','createWriteStream','zip','warning','code','ENOENT','Sequelize','Error\x20while\x20generating\x20the\x20zip\x20archive','pipe','root','server/files/plugins','dirname','node_modules/**/*','finalize','close','Error','Plugin\x20not\x20found','format','%s.zip','Error\x20while\x20downloading\x20the\x20plugin','unlinkSync'];(function(_0x523c85,_0x347b7c){var _0x4c8375=function(_0x1e9cb5){while(--_0x1e9cb5){_0x523c85['push'](_0x523c85['shift']());}};_0x4c8375(++_0x347b7c);}(_0x2e08,0xe4));var _0x82e0=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x2e08[_0x57b54c];return _0x59cc19;};'use strict';var emlformat=require(_0x82e0('0x0'));var rimraf=require(_0x82e0('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x82e0('0x2'));var rp=require(_0x82e0('0x3'));var moment=require(_0x82e0('0x4'));var BPromise=require(_0x82e0('0x5'));var Mustache=require(_0x82e0('0x6'));var util=require(_0x82e0('0x7'));var path=require(_0x82e0('0x8'));var sox=require(_0x82e0('0x9'));var csv=require(_0x82e0('0xa'));var ejs=require(_0x82e0('0xb'));var fs=require('fs');var fs_extra=require(_0x82e0('0xc'));var _=require('lodash');var squel=require(_0x82e0('0xd'));var crypto=require(_0x82e0('0xe'));var jsforce=require(_0x82e0('0xf'));var deskjs=require(_0x82e0('0x10'));var toCsv=require(_0x82e0('0xa'));var querystring=require(_0x82e0('0x11'));var Papa=require(_0x82e0('0x12'));var extract=require('extract-zip');var rimraf=require(_0x82e0('0x1'));var archiver=require('archiver');var Redis=require(_0x82e0('0x13'));var authService=require(_0x82e0('0x14'));var qs=require(_0x82e0('0x15'));var as=require(_0x82e0('0x16'));var hardwareService=require(_0x82e0('0x17'));var logger=require(_0x82e0('0x18'))(_0x82e0('0x19'));var utils=require(_0x82e0('0x1a'));var config=require(_0x82e0('0x1b'));var licenseUtil=require(_0x82e0('0x1c'));var db=require('../../mysqldb')['db'];config[_0x82e0('0x1d')]=_[_0x82e0('0x1e')](config[_0x82e0('0x1d')],{'host':'localhost','port':0x18eb});var socket=require(_0x82e0('0x1f'))(new Redis(config['redis']));require(_0x82e0('0x20'))['register'](socket);function respondWithStatusCode(_0x2f7322,_0x5e51db){_0x5e51db=_0x5e51db||0xcc;return function(_0x2a214d){if(_0x2a214d){return _0x2f7322['sendStatus'](_0x5e51db);}return _0x2f7322[_0x82e0('0x21')](_0x5e51db)[_0x82e0('0x22')]();};}function respondWithResult(_0x31e79d,_0x5220aa){_0x5220aa=_0x5220aa||0xc8;return function(_0x52ed35){if(_0x52ed35){return _0x31e79d[_0x82e0('0x21')](_0x5220aa)[_0x82e0('0x23')](_0x52ed35);}};}function respondWithFilteredResult(_0x1c9c2a,_0x40ca28){return function(_0x31ecb1){if(_0x31ecb1){var _0x885b79=typeof _0x40ca28['offset']==='undefined'&&typeof _0x40ca28['limit']===_0x82e0('0x24');var _0x265993=_0x31ecb1[_0x82e0('0x25')];var _0x4ad47d=_0x885b79?0x0:_0x40ca28[_0x82e0('0x26')];var _0x1c394f=_0x885b79?_0x31ecb1[_0x82e0('0x25')]:_0x40ca28[_0x82e0('0x26')]+_0x40ca28[_0x82e0('0x27')];var _0xf5fcdd;if(_0x1c394f>=_0x265993){_0x1c394f=_0x265993;_0xf5fcdd=0xc8;}else{_0xf5fcdd=0xce;}_0x1c9c2a['status'](_0xf5fcdd);return _0x1c9c2a[_0x82e0('0x28')](_0x82e0('0x29'),_0x4ad47d+'-'+_0x1c394f+'/'+_0x265993)[_0x82e0('0x23')](_0x31ecb1);}return null;};}function patchUpdates(_0xca1d40){return function(_0x18daaf){try{jsonpatch[_0x82e0('0x2a')](_0x18daaf,_0xca1d40,!![]);}catch(_0x56aaed){return BPromise['reject'](_0x56aaed);}return _0x18daaf[_0x82e0('0x2b')]();};}function saveUpdates(_0x467926,_0x5ae390){return function(_0x9c3aea){if(_0x9c3aea){return _0x9c3aea[_0x82e0('0x2c')](_0x467926)['then'](function(_0x4dae41){return _0x4dae41;});}return null;};}function removeEntity(_0x44ac0b,_0x346c4c){return function(_0x43befc){if(_0x43befc){return _0x43befc['destroy']()[_0x82e0('0x2d')](function(){var _0x327245=_0x43befc[_0x82e0('0x2e')]({'plain':!![]});var _0x1dc16a=_0x82e0('0x2f');return db[_0x82e0('0x30')][_0x82e0('0x31')]({'where':{'type':_0x1dc16a,'resourceId':_0x327245['id']}})[_0x82e0('0x2d')](function(){return _0x43befc;});})[_0x82e0('0x2d')](function(){_0x44ac0b[_0x82e0('0x21')](0xcc)[_0x82e0('0x22')]();});}};}function handleEntityNotFound(_0x2cc4df,_0x113b81){return function(_0x33908a){if(!_0x33908a){_0x2cc4df[_0x82e0('0x32')](0x194);}return _0x33908a;};}function handleError(_0x1f2516,_0x5c5a60){_0x5c5a60=_0x5c5a60||0x1f4;return function(_0x589f95){logger[_0x82e0('0x33')](_0x589f95[_0x82e0('0x34')]);if(_0x589f95[_0x82e0('0x35')]){delete _0x589f95[_0x82e0('0x35')];}_0x1f2516[_0x82e0('0x21')](_0x5c5a60)['send'](_0x589f95);};}exports[_0x82e0('0x36')]=function(_0x2d785d,_0x387e7c){var _0x83e24e={},_0x17b8de={},_0x7ef967={'count':0x0,'rows':[]};var _0x35d91b=_[_0x82e0('0x37')](db[_0x82e0('0x38')]['rawAttributes'],function(_0x24896b){return{'name':_0x24896b['fieldName'],'type':_0x24896b[_0x82e0('0x39')][_0x82e0('0x3a')]};});_0x17b8de[_0x82e0('0x3b')]=_['map'](_0x35d91b,_0x82e0('0x35'));_0x17b8de[_0x82e0('0x3c')]=_['keys'](_0x2d785d[_0x82e0('0x3c')]);_0x17b8de[_0x82e0('0x3d')]=_[_0x82e0('0x3e')](_0x17b8de[_0x82e0('0x3b')],_0x17b8de[_0x82e0('0x3c')]);_0x83e24e[_0x82e0('0x3f')]=_[_0x82e0('0x3e')](_0x17b8de[_0x82e0('0x3b')],qs[_0x82e0('0x40')](_0x2d785d[_0x82e0('0x3c')][_0x82e0('0x40')]));_0x83e24e[_0x82e0('0x3f')]=_0x83e24e[_0x82e0('0x3f')][_0x82e0('0x41')]?_0x83e24e[_0x82e0('0x3f')]:_0x17b8de[_0x82e0('0x3b')];if(!_0x2d785d[_0x82e0('0x3c')]['hasOwnProperty']('nolimit')){_0x83e24e['limit']=qs[_0x82e0('0x27')](_0x2d785d['query']['limit']);_0x83e24e[_0x82e0('0x26')]=qs[_0x82e0('0x26')](_0x2d785d['query'][_0x82e0('0x26')]);}_0x83e24e['order']=qs[_0x82e0('0x42')](_0x2d785d[_0x82e0('0x3c')][_0x82e0('0x42')]);_0x83e24e[_0x82e0('0x43')]=qs[_0x82e0('0x3d')](_[_0x82e0('0x44')](_0x2d785d['query'],_0x17b8de['filters']),_0x35d91b);if(_0x2d785d[_0x82e0('0x3c')][_0x82e0('0x45')]){_0x83e24e[_0x82e0('0x43')]=_[_0x82e0('0x46')](_0x83e24e[_0x82e0('0x43')],{'$or':_[_0x82e0('0x37')](_0x35d91b,function(_0x5888c4){if(_0x5888c4[_0x82e0('0x39')]!==_0x82e0('0x47')){var _0x36ef43={};_0x36ef43[_0x5888c4[_0x82e0('0x35')]]={'$like':'%'+_0x2d785d[_0x82e0('0x3c')]['filter']+'%'};return _0x36ef43;}})});}_0x83e24e=_[_0x82e0('0x46')]({},_0x83e24e,_0x2d785d[_0x82e0('0x48')]);var _0x320714={'where':_0x83e24e[_0x82e0('0x43')]};return db[_0x82e0('0x38')][_0x82e0('0x25')](_0x320714)[_0x82e0('0x2d')](function(_0x4b136c){_0x7ef967[_0x82e0('0x25')]=_0x4b136c;if(_0x2d785d[_0x82e0('0x3c')][_0x82e0('0x49')]){_0x83e24e[_0x82e0('0x4a')]=[{'all':!![]}];}return db['Plugin'][_0x82e0('0x4b')](_0x83e24e);})[_0x82e0('0x2d')](function(_0x25850b){_0x7ef967['rows']=_0x25850b;return _0x7ef967;})[_0x82e0('0x2d')](respondWithFilteredResult(_0x387e7c,_0x83e24e))[_0x82e0('0x4c')](handleError(_0x387e7c,null));};exports[_0x82e0('0x4d')]=function(_0x3afcaa,_0x23cff8){var _0xa2f5a0={'raw':!![],'where':{'id':_0x3afcaa['params']['id']}},_0x2597b3={};_0x2597b3[_0x82e0('0x3b')]=_['keys'](db['Plugin'][_0x82e0('0x4e')]);_0x2597b3['query']=_['keys'](_0x3afcaa['query']);_0x2597b3['filters']=_[_0x82e0('0x3e')](_0x2597b3[_0x82e0('0x3b')],_0x2597b3[_0x82e0('0x3c')]);_0xa2f5a0['attributes']=_[_0x82e0('0x3e')](_0x2597b3[_0x82e0('0x3b')],qs[_0x82e0('0x40')](_0x3afcaa[_0x82e0('0x3c')][_0x82e0('0x40')]));_0xa2f5a0['attributes']=_0xa2f5a0[_0x82e0('0x3f')][_0x82e0('0x41')]?_0xa2f5a0[_0x82e0('0x3f')]:_0x2597b3[_0x82e0('0x3b')];if(_0x3afcaa[_0x82e0('0x3c')]['includeAll']){_0xa2f5a0[_0x82e0('0x4a')]=[{'all':!![]}];}_0xa2f5a0=_[_0x82e0('0x46')]({},_0xa2f5a0,_0x3afcaa['options']);return db[_0x82e0('0x38')]['find'](_0xa2f5a0)['then'](handleEntityNotFound(_0x23cff8,null))[_0x82e0('0x2d')](respondWithResult(_0x23cff8,null))[_0x82e0('0x4c')](handleError(_0x23cff8,null));};exports[_0x82e0('0x4f')]=function(_0x532436,_0x5f0f33,_0x32a147){return db[_0x82e0('0x38')][_0x82e0('0x50')]({'where':{'id':_0x532436[_0x82e0('0x51')]['id']},'attributes':[_0x82e0('0x35'),_0x82e0('0x8')],'raw':!![]})[_0x82e0('0x2d')](handleEntityNotFound(_0x5f0f33,null))[_0x82e0('0x2d')](function(_0x2c816a){if(_0x2c816a){var _0x116eef=path[_0x82e0('0x52')](config['root'],'server/files/plugins',util['format']('%s.zip',path[_0x82e0('0x53')](_0x2c816a[_0x82e0('0x8')])));var _0x31c820=fs[_0x82e0('0x54')](_0x116eef);var _0x5a7098=archiver(_0x82e0('0x55'),{'zlib':{'level':0x9}});_0x5a7098['on'](_0x82e0('0x56'),function(_0x1c9460){if(_0x1c9460[_0x82e0('0x57')]===_0x82e0('0x58')){logger['error'](_0x1c9460);}else{throw new db[(_0x82e0('0x59'))]['Error'](_0x82e0('0x5a'));}});_0x5a7098['on'](_0x82e0('0x33'),function(_0xe5542b){throw new db[(_0x82e0('0x59'))]['Error']('Error\x20while\x20generating\x20the\x20zip\x20archive');});_0x5a7098[_0x82e0('0x5b')](_0x31c820);_0x5a7098['glob']('**/*',{'cwd':path[_0x82e0('0x52')](config[_0x82e0('0x5c')],_0x82e0('0x5d'),path[_0x82e0('0x5e')](_0x2c816a[_0x82e0('0x8')])),'ignore':[path[_0x82e0('0x52')](path[_0x82e0('0x53')](_0x2c816a['path']),_0x82e0('0x5f')),path[_0x82e0('0x52')](path[_0x82e0('0x53')](_0x2c816a[_0x82e0('0x8')]),'attachments/**/*')],'nodir':!![]})[_0x82e0('0x60')]();_0x31c820['on'](_0x82e0('0x61'),function(){if(!fs['existsSync'](_0x116eef)){throw new db[(_0x82e0('0x59'))][(_0x82e0('0x62'))](_0x82e0('0x63'));}return _0x5f0f33[_0x82e0('0x4f')](_0x116eef,util[_0x82e0('0x64')](_0x82e0('0x65'),path[_0x82e0('0x53')](_0x2c816a[_0x82e0('0x8')])),function(_0x4718ae){if(_0x4718ae){throw new db[(_0x82e0('0x59'))]['Error'](_0x82e0('0x66'));}fs[_0x82e0('0x67')](_0x116eef);logger[_0x82e0('0x68')](_0x82e0('0x69'));logger[_0x82e0('0x68')](_0x82e0('0x6a'));});});}return null;})[_0x82e0('0x4c')](handleError(_0x5f0f33,null));};exports[_0x82e0('0x6b')]=function(_0x1dbc38,_0x48cf36,_0x1a7626){var _0x295324=path['basename'](_0x1dbc38[_0x82e0('0x6c')]['filename'],path['extname'](_0x1dbc38[_0x82e0('0x6c')][_0x82e0('0x6d')]));var _0x306b10=path[_0x82e0('0x52')](config[_0x82e0('0x5c')],_0x82e0('0x5d'),_0x1dbc38[_0x82e0('0x6c')]['filename']);var _0x16ae08=path[_0x82e0('0x52')](config[_0x82e0('0x5c')],'server/files/plugins',_0x295324);logger[_0x82e0('0x68')](_0x82e0('0x6e'),_0x306b10);logger[_0x82e0('0x68')](_0x82e0('0x6f'),_0x16ae08);try{fs['chmodSync'](_0x306b10,parseInt(_0x82e0('0x70'),0x8));extract(_0x306b10,{'dir':_0x16ae08},function(_0x1c90cd){if(_0x1c90cd){logger[_0x82e0('0x33')](_0x1c90cd);handleError(_0x1c90cd,!![]);};var _0x497906=fs['readdirSync'](_0x16ae08);if(_0x497906[_0x82e0('0x41')]>0x1){removeReferences(_0x306b10,_0x16ae08);logger[_0x82e0('0x33')](_0x82e0('0x71'));return _0x1a7626(new Error('Invalid\x20plugin\x20structure'));}var _0x42c001=fs['lstatSync'](path['join'](_0x16ae08,_0x497906[0x0]));if(_0x42c001['isFile']()){removeReferences(_0x306b10,_0x16ae08);logger[_0x82e0('0x33')](_0x82e0('0x71'));return _0x1a7626(new Error(_0x82e0('0x71')));}if(_0x42c001[_0x82e0('0x72')]()){var _0x4e3368=fs[_0x82e0('0x73')](path['join'](_0x16ae08,_0x497906[0x0]));if(_0x4e3368[_0x82e0('0x41')]===0x0){removeReferences(_0x306b10,_0x16ae08);logger[_0x82e0('0x33')]('Invalid\x20plugin\x20structure');return _0x1a7626(new Error('Invalid\x20plugin\x20structure'));}var _0x39414a=_0x4e3368['some'](function(_0x569118){return _0x569118==='manifest.json';});if(!_0x39414a){return _0x1a7626(new Error('Plugin\x20manifest\x20missing'));}var _0x42a58d=fs['readFileSync'](path[_0x82e0('0x52')](_0x16ae08,_0x497906[0x0],'manifest.json'));var _0x4b1e68=JSON[_0x82e0('0x74')](_0x42a58d);if(_0x82e0('0x24')==typeof _0x4b1e68[_0x82e0('0x35')]){return _0x1a7626(new Error(_0x82e0('0x75')));}if(_0x82e0('0x24')==typeof _0x4b1e68[_0x82e0('0x39')]){return _0x1a7626(new Error('Invalid\x20manifest:\x20type\x20missing'));}if(_0x82e0('0x24')==typeof _0x4b1e68[_0x82e0('0x76')]){return _0x1a7626(new Error(_0x82e0('0x77')));}if(_0x82e0('0x24')==typeof _0x4b1e68['parameters']){return _0x1a7626(new Error('Invalid\x20manifest:\x20parameters\x20missing'));}if(_0x4b1e68[_0x82e0('0x39')]===_0x82e0('0x78')){if(_0x82e0('0x24')==typeof _0x4b1e68[_0x82e0('0x79')]['views']){return _0x1a7626(new Error(_0x82e0('0x7a')));}if('undefined'==typeof _0x4b1e68[_0x82e0('0x79')][_0x82e0('0x7b')][_0x82e0('0x7c')]&&'undefined'==typeof _0x4b1e68[_0x82e0('0x79')][_0x82e0('0x7b')][_0x82e0('0x7d')]){return _0x1a7626(new Error('Invalid\x20manifest:\x20no\x20view\x20specified'));}}else if(_0x4b1e68[_0x82e0('0x39')]===_0x82e0('0x7e')){if(_0x82e0('0x24')==typeof _0x4b1e68[_0x82e0('0x79')][_0x82e0('0x7f')]){return _0x1a7626(new Error(_0x82e0('0x80')));}if('undefined'==typeof _0x4b1e68[_0x82e0('0x79')][_0x82e0('0x81')]){return _0x1a7626(new Error(_0x82e0('0x82')));}}else{return _0x1a7626(new Error(_0x82e0('0x83')));}var _0x5705c4=_0x4b1e68[_0x82e0('0x35')];var _0x522f7e=_0x4b1e68['description'];var _0xb5bf67=_0x4b1e68[_0x82e0('0x39')];var _0x193c2b=_0x4b1e68[_0x82e0('0x84')]?_0x4b1e68[_0x82e0('0x84')]:_0x82e0('0x85');var _0x368dde=_0x4b1e68[_0x82e0('0x86')]?_0x4b1e68[_0x82e0('0x86')]:_0x82e0('0x87');var _0x6aeac9='';var _0x26f554='';var _0x3456d5='';var _0x9e2752='';var _0xd864fc=_0x4b1e68[_0x82e0('0x76')];if(_0xb5bf67==='html'){if(_0x82e0('0x24')!=typeof _0x4b1e68['parameters'][_0x82e0('0x7b')][_0x82e0('0x7c')]){var _0x582832=_0x4b1e68[_0x82e0('0x79')]['views'][_0x82e0('0x7c')];if(!/^(f|ht)tps?:\/\//i[_0x82e0('0x88')](_0x582832)){_0x6aeac9=path[_0x82e0('0x52')]('plugins',_0x295324,_0x497906[0x0],_0x582832);}else{_0x6aeac9=_0x582832;}}else{logger[_0x82e0('0x68')](_0x82e0('0x89'));}if(_0x82e0('0x24')!=typeof _0x4b1e68[_0x82e0('0x79')][_0x82e0('0x7b')]['agent']){var _0x23e0f3=_0x4b1e68['parameters']['views'][_0x82e0('0x7d')];if(!/^(f|ht)tps?:\/\//i[_0x82e0('0x88')](_0x23e0f3)){_0x26f554=path[_0x82e0('0x52')](_0x82e0('0x8a'),_0x295324,_0x497906[0x0],_0x23e0f3);}else{_0x26f554=_0x23e0f3;}}else{logger['info'](_0x82e0('0x8b'));}}else if(_0xb5bf67===_0x82e0('0x7e')){_0x3456d5=_0x4b1e68[_0x82e0('0x79')][_0x82e0('0x7f')];_0x9e2752=_0x4b1e68[_0x82e0('0x79')][_0x82e0('0x81')];if(_0x82e0('0x24')!=typeof _0x4b1e68['parameters']['views']){if('undefined'!=typeof _0x4b1e68['parameters'][_0x82e0('0x7b')][_0x82e0('0x7c')]){var _0x582832=_0x4b1e68[_0x82e0('0x79')][_0x82e0('0x7b')][_0x82e0('0x7c')];if(!/^(f|ht)tps?:\/\//i[_0x82e0('0x88')](_0x582832)){_0x6aeac9=path[_0x82e0('0x52')](_0x82e0('0x8a'),_0x295324,_0x497906[0x0],_0x582832);}else{_0x6aeac9=_0x582832;}}if(_0x82e0('0x24')!=typeof _0x4b1e68[_0x82e0('0x79')][_0x82e0('0x7b')][_0x82e0('0x7d')]){var _0x23e0f3=_0x4b1e68[_0x82e0('0x79')][_0x82e0('0x7b')]['agent'];if(!/^(f|ht)tps?:\/\//i[_0x82e0('0x88')](_0x23e0f3)){_0x26f554=path['join'](_0x82e0('0x8a'),_0x295324,_0x497906[0x0],_0x23e0f3);}else{_0x26f554=_0x23e0f3;}}}}var _0x260529={'name':_0x5705c4,'description':_0x522f7e,'path':path['join'](_0x295324,_0x497906[0x0]),'type':_0xb5bf67,'sidebar':_0x193c2b,'icon':_0x368dde,'adminUrl':_0x6aeac9,'agentUrl':_0x26f554,'scriptName':_0x3456d5,'scriptPath':_0x9e2752,'version':_0xd864fc};removeReferences(_0x306b10,null);return db[_0x82e0('0x38')][_0x82e0('0x8c')](_0x260529)[_0x82e0('0x2d')](function(_0x5ea870){var _0x312f40={'role':_0x1dbc38[_0x82e0('0x8d')][_0x82e0('0x8e')],'userProfileId':_0x1dbc38[_0x82e0('0x8d')][_0x82e0('0x8f')]};if(!_0x312f40)throw new Error(_0x82e0('0x90'));if(_0x312f40[_0x82e0('0x8e')]===_0x82e0('0x91')){var _0x214668=_0x5ea870[_0x82e0('0x2e')]({'plain':!![]});return db[_0x82e0('0x92')][_0x82e0('0x50')]({'where':{'name':_0x82e0('0x2f'),'userProfileId':_0x312f40[_0x82e0('0x8f')]},'raw':!![]})['then'](function(_0x3347a4){if(_0x3347a4&&_0x3347a4[_0x82e0('0x93')]===0x0){return db[_0x82e0('0x30')][_0x82e0('0x8c')]({'name':_0x214668[_0x82e0('0x35')],'resourceId':_0x214668['id'],'type':_0x3347a4['name'],'sectionId':_0x3347a4['id']},{})[_0x82e0('0x2d')](function(){return _0x5ea870;});}else{return _0x5ea870;}})[_0x82e0('0x4c')](function(_0x471990){logger[_0x82e0('0x33')](_0x82e0('0x94'),_0x471990);throw _0x471990;});}return _0x5ea870;})['then'](respondWithResult(_0x48cf36,null))[_0x82e0('0x4c')](handleError(_0x48cf36,null));}});}catch(_0x31f62b){_0x48cf36['status'](0x1f4)[_0x82e0('0x95')](_0x31f62b);}};function removeReferences(_0x24ec71,_0x3f8fa0){try{if(_0x24ec71){fs[_0x82e0('0x67')](_0x24ec71);logger['info'](_0x82e0('0x96'));}if(_0x3f8fa0){rimraf(_0x3f8fa0,function(){});logger[_0x82e0('0x68')]('Extracted\x20folder\x20removed');}}catch(_0x36e597){logger['error'](_0x36e597);}}exports[_0x82e0('0x2c')]=function(_0x575fde,_0x4c30de,_0x102eb2){return db[_0x82e0('0x38')]['find']({'where':{'id':_0x575fde[_0x82e0('0x51')]['id']}})[_0x82e0('0x2d')](handleEntityNotFound(_0x4c30de,null))[_0x82e0('0x2d')](saveUpdates(_0x575fde[_0x82e0('0x8d')],null))[_0x82e0('0x2d')](respondWithResult(_0x4c30de,null))[_0x82e0('0x4c')](handleError(_0x4c30de,null));};exports[_0x82e0('0x97')]=function(_0x5ee5a1,_0x2cb46c,_0x1bad1f){return db[_0x82e0('0x38')][_0x82e0('0x50')]({'where':{'id':_0x5ee5a1['params']['id']}})[_0x82e0('0x2d')](function(_0x1ad832){if(_0x1ad832){return _0x1ad832[_0x82e0('0x31')]();}})['then'](function(_0x1baf27){rimraf(path[_0x82e0('0x52')](config['root'],_0x82e0('0x5d'),path['dirname'](_0x1baf27[_0x82e0('0x8')])),function(){});return _0x1baf27;})['then'](handleEntityNotFound(_0x2cb46c,null))['then'](respondWithStatusCode(_0x2cb46c,null))[_0x82e0('0x4c')](handleError(_0x2cb46c,null));};exports['webhookGet']=function(_0x2e4836,_0x7af9df,_0x3cd131){return BPromise[_0x82e0('0x98')]()[_0x82e0('0x2d')](function(){if(!_0x2e4836[_0x82e0('0x3c')][_0x82e0('0x8')]){throw new Error(_0x82e0('0x99'));}if(!_0x2e4836[_0x82e0('0x3c')][_0x82e0('0x9a')]){throw new Error(_0x82e0('0x9b'));}var _0x38686d=_0x2e4836[_0x82e0('0x3c')][_0x82e0('0x9c')]?_0x2e4836[_0x82e0('0x3c')]['hostname']+':'+_0x2e4836['query'][_0x82e0('0x9a')]:_0x82e0('0x9d')+_0x2e4836['query']['port'];var _0x44508b=_0x2e4836['query'][_0x82e0('0x23')]?_0x2e4836[_0x82e0('0x3c')][_0x82e0('0x23')]:!![];var _0x15c9e5=_0x2e4836[_0x82e0('0x3c')][_0x82e0('0x9e')]?_0x2e4836['query'][_0x82e0('0x9e')]:null;var _0x514bf6={'method':_0x2e4836[_0x82e0('0x9f')],'uri':util[_0x82e0('0x64')](_0x82e0('0xa0'),_0x38686d,_0x2e4836[_0x82e0('0x3c')]['path']),'json':_0x44508b,'resolveWithFullResponse':!![],'encoding':_0x15c9e5,'qs':_0x2e4836['query']};if(_0x2e4836[_0x82e0('0xa1')]){_0x514bf6[_0x82e0('0xa1')]=_0x2e4836[_0x82e0('0xa1')];if(_0x514bf6[_0x82e0('0xa1')][_0x82e0('0xa2')]){delete _0x514bf6[_0x82e0('0xa1')][_0x82e0('0xa2')];}}if(_0x514bf6[_0x82e0('0xa1')][_0x82e0('0xa3')]){delete _0x514bf6[_0x82e0('0xa1')][_0x82e0('0xa3')];}return rp(_0x514bf6);})[_0x82e0('0x2d')](function(_0x23e7d5){if(_0x23e7d5){_0x7af9df[_0x82e0('0x28')](_0x23e7d5['headers']);logger[_0x82e0('0x68')](_0x23e7d5['body']);if(_[_0x82e0('0xa4')](_0x2e4836[_0x82e0('0x3c')]['path'],'download')&&_0x23e7d5[_0x82e0('0xa5')]==0x1f4){return _0x7af9df['sendStatus'](_0x23e7d5[_0x82e0('0xa5')]);}else{return _0x7af9df[_0x82e0('0x21')](_0x23e7d5[_0x82e0('0xa5')])[_0x82e0('0x95')](_0x23e7d5['body']);}}else{return _0x7af9df['sendStatus'](0xc8);}})[_0x82e0('0x4c')](handleError(_0x7af9df,null));};exports['webhookPost']=function(_0x3eca4e,_0x1803d6,_0x34d232){return BPromise[_0x82e0('0x98')]()[_0x82e0('0x2d')](function(){if(!_0x3eca4e[_0x82e0('0x3c')][_0x82e0('0x8')]){throw new Error(_0x82e0('0x99'));}if(!_0x3eca4e['query'][_0x82e0('0x9a')]){throw new Error(_0x82e0('0x9b'));}var _0x37beeb=_0x3eca4e[_0x82e0('0x3c')][_0x82e0('0x9c')]?_0x3eca4e['query'][_0x82e0('0x9c')]+':'+_0x3eca4e[_0x82e0('0x3c')][_0x82e0('0x9a')]:_0x82e0('0x9d')+_0x3eca4e[_0x82e0('0x3c')][_0x82e0('0x9a')];var _0xb6571d=_0x3eca4e[_0x82e0('0x3c')][_0x82e0('0x23')]?_0x3eca4e[_0x82e0('0x3c')][_0x82e0('0x23')]:!![];var _0x51aba5=_0x3eca4e[_0x82e0('0x3c')][_0x82e0('0x9e')]?_0x3eca4e[_0x82e0('0x3c')][_0x82e0('0x9e')]:null;var _0x4583eb={'method':_0x3eca4e['method'],'uri':util[_0x82e0('0x64')](_0x82e0('0xa0'),_0x37beeb,_0x3eca4e[_0x82e0('0x3c')][_0x82e0('0x8')]),'json':_0xb6571d,'resolveWithFullResponse':!![],'encoding':_0x51aba5,'body':_0x3eca4e['body']};if(_0x3eca4e[_0x82e0('0xa1')]){_0x4583eb[_0x82e0('0xa1')]=_0x3eca4e[_0x82e0('0xa1')];if(_0x4583eb['headers']['content-length']){delete _0x4583eb[_0x82e0('0xa1')][_0x82e0('0xa2')];}}if(_0x4583eb[_0x82e0('0xa1')][_0x82e0('0xa3')]){delete _0x4583eb['headers'][_0x82e0('0xa3')];}return rp(_0x4583eb);})[_0x82e0('0x2d')](function(_0x1ad61c){if(_0x1ad61c){_0x1803d6['set'](_0x1ad61c[_0x82e0('0xa1')]);logger['info'](_0x1ad61c[_0x82e0('0x8d')]);return _0x1803d6['status'](_0x1ad61c[_0x82e0('0xa5')])['send'](_0x1ad61c[_0x82e0('0x8d')]);}else{return _0x1803d6['sendStatus'](0xc8);}})[_0x82e0('0x4c')](handleError(_0x1803d6,null));}; \ No newline at end of file diff --git a/server/api/plugin/plugin.events.js b/server/api/plugin/plugin.events.js index 81fa7d5..65b3a08 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 _0x9ade=['hook','exports','events','../../mysqldb','Plugin','setMaxListeners','save','update','remove','emit'];(function(_0x1aaf7e,_0x1b2ee3){var _0x1045d9=function(_0xcf7473){while(--_0xcf7473){_0x1aaf7e['push'](_0x1aaf7e['shift']());}};_0x1045d9(++_0x1b2ee3);}(_0x9ade,0x8e));var _0xe9ad=function(_0x10fd98,_0x5209db){_0x10fd98=_0x10fd98-0x0;var _0x5347d5=_0x9ade[_0x10fd98];return _0x5347d5;};'use strict';var EventEmitter=require(_0xe9ad('0x0'));var Plugin=require(_0xe9ad('0x1'))['db'][_0xe9ad('0x2')];var PluginEvents=new EventEmitter();PluginEvents[_0xe9ad('0x3')](0x0);var events={'afterCreate':_0xe9ad('0x4'),'afterUpdate':_0xe9ad('0x5'),'afterDestroy':_0xe9ad('0x6')};function emitEvent(_0x157ca1){return function(_0x468a5b,_0x441278,_0x5ed31d){PluginEvents[_0xe9ad('0x7')](_0x157ca1+':'+_0x468a5b['id'],_0x468a5b);PluginEvents['emit'](_0x157ca1,_0x468a5b);_0x5ed31d(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Plugin[_0xe9ad('0x8')](e,emitEvent(event));}}module[_0xe9ad('0x9')]=PluginEvents; \ No newline at end of file +var _0x8f6b=['save','update','emit','hook','events','../../mysqldb','Plugin'];(function(_0x3821b4,_0x36f59d){var _0x104bc3=function(_0x14290e){while(--_0x14290e){_0x3821b4['push'](_0x3821b4['shift']());}};_0x104bc3(++_0x36f59d);}(_0x8f6b,0x146));var _0xb8f6=function(_0x47a7d0,_0x4e182d){_0x47a7d0=_0x47a7d0-0x0;var _0xb9bd08=_0x8f6b[_0x47a7d0];return _0xb9bd08;};'use strict';var EventEmitter=require(_0xb8f6('0x0'));var Plugin=require(_0xb8f6('0x1'))['db'][_0xb8f6('0x2')];var PluginEvents=new EventEmitter();PluginEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xb8f6('0x3'),'afterUpdate':_0xb8f6('0x4'),'afterDestroy':'remove'};function emitEvent(_0x36b78d){return function(_0x456df3,_0x49693f,_0x333054){PluginEvents['emit'](_0x36b78d+':'+_0x456df3['id'],_0x456df3);PluginEvents[_0xb8f6('0x5')](_0x36b78d,_0x456df3);_0x333054(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Plugin[_0xb8f6('0x6')](e,emitEvent(event));}}module['exports']=PluginEvents; \ No newline at end of file diff --git a/server/api/plugin/plugin.model.js b/server/api/plugin/plugin.model.js index 93f0b9f..904d628 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 _0x2649=['Plugin','plugins','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./plugin.attributes','exports'];(function(_0x138adb,_0x193fee){var _0x1b27f2=function(_0x5e97a2){while(--_0x5e97a2){_0x138adb['push'](_0x138adb['shift']());}};_0x1b27f2(++_0x193fee);}(_0x2649,0x16a));var _0x9264=function(_0x119280,_0x439c3e){_0x119280=_0x119280-0x0;var _0x481797=_0x2649[_0x119280];return _0x481797;};'use strict';var _=require('lodash');var util=require(_0x9264('0x0'));var logger=require(_0x9264('0x1'))(_0x9264('0x2'));var moment=require(_0x9264('0x3'));var BPromise=require('bluebird');var rp=require(_0x9264('0x4'));var fs=require('fs');var path=require(_0x9264('0x5'));var rimraf=require(_0x9264('0x6'));var config=require(_0x9264('0x7'));var attributes=require(_0x9264('0x8'));module[_0x9264('0x9')]=function(_0x45b4c4,_0x1f79e2){return _0x45b4c4['define'](_0x9264('0xa'),attributes,{'tableName':_0x9264('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfa44=['rimraf','./plugin.attributes','exports','define','Plugin','plugins','lodash','util','../../config/logger','api','moment','request-promise','path'];(function(_0x2600fc,_0x51522f){var _0x5ade65=function(_0x5065d8){while(--_0x5065d8){_0x2600fc['push'](_0x2600fc['shift']());}};_0x5ade65(++_0x51522f);}(_0xfa44,0xd6));var _0x4fa4=function(_0x241eb9,_0x5ccc3f){_0x241eb9=_0x241eb9-0x0;var _0x4f916b=_0xfa44[_0x241eb9];return _0x4f916b;};'use strict';var _=require(_0x4fa4('0x0'));var util=require(_0x4fa4('0x1'));var logger=require(_0x4fa4('0x2'))(_0x4fa4('0x3'));var moment=require(_0x4fa4('0x4'));var BPromise=require('bluebird');var rp=require(_0x4fa4('0x5'));var fs=require('fs');var path=require(_0x4fa4('0x6'));var rimraf=require(_0x4fa4('0x7'));var config=require('../../config/environment');var attributes=require(_0x4fa4('0x8'));module[_0x4fa4('0x9')]=function(_0x2f7794,_0x31cf0e){return _0x2f7794[_0x4fa4('0xa')](_0x4fa4('0xb'),attributes,{'tableName':_0x4fa4('0xc'),'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 a8a015e..0f9e4e0 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 _0x2bc2=['info','result','CreatePlugin','Plugin','create','options','raw','catch','lodash','bluebird','../../mysqldb','../../config/logger','../../config/environment','client','http','redis','defaults','socket.io-emitter','./plugin.socket','register','request','then','Plugin,\x20%s,\x20%s','request\x20sent','debug','Plugin,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x5ebc04,_0x14a363){var _0x17845c=function(_0x360850){while(--_0x360850){_0x5ebc04['push'](_0x5ebc04['shift']());}};_0x17845c(++_0x14a363);}(_0x2bc2,0x1ac));var _0x22bc=function(_0x270c5e,_0x1a0a8d){_0x270c5e=_0x270c5e-0x0;var _0x23585b=_0x2bc2[_0x270c5e];return _0x23585b;};'use strict';var _=require(_0x22bc('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x22bc('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x22bc('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0x22bc('0x3'))('rpc');var config=require(_0x22bc('0x4'));var jayson=require('jayson/promise');var client=jayson[_0x22bc('0x5')][_0x22bc('0x6')]({'port':0x232a});config[_0x22bc('0x7')]=_[_0x22bc('0x8')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x22bc('0x9'))(new Redis(config[_0x22bc('0x7')]));require(_0x22bc('0xa'))[_0x22bc('0xb')](socket);function respondWithRpcPromise(_0x835637,_0x288e21,_0x38b053){return new BPromise(function(_0x573574,_0x1ad7d0){return client[_0x22bc('0xc')](_0x835637,_0x38b053)[_0x22bc('0xd')](function(_0x13f31d){logger['info'](_0x22bc('0xe'),_0x288e21,_0x22bc('0xf'));logger[_0x22bc('0x10')](_0x22bc('0x11'),_0x288e21,_0x22bc('0xf'),JSON[_0x22bc('0x12')](_0x13f31d));if(_0x13f31d[_0x22bc('0x13')]){if(_0x13f31d['error'][_0x22bc('0x14')]===0x1f4){logger[_0x22bc('0x13')]('Plugin,\x20%s,\x20%s',_0x288e21,_0x13f31d[_0x22bc('0x13')][_0x22bc('0x15')]);return _0x1ad7d0(_0x13f31d[_0x22bc('0x13')]['message']);}logger[_0x22bc('0x13')](_0x22bc('0xe'),_0x288e21,_0x13f31d[_0x22bc('0x13')][_0x22bc('0x15')]);return _0x573574(_0x13f31d[_0x22bc('0x13')][_0x22bc('0x15')]);}else{logger[_0x22bc('0x16')](_0x22bc('0xe'),_0x288e21,_0x22bc('0xf'));_0x573574(_0x13f31d[_0x22bc('0x17')][_0x22bc('0x15')]);}})['catch'](function(_0x1c0e24){logger['error'](_0x22bc('0xe'),_0x288e21,_0x1c0e24);_0x1ad7d0(_0x1c0e24);});});}exports[_0x22bc('0x18')]=function(_0x52af9d){var _0x11ecca=this;return new Promise(function(_0xbf1943,_0x2f5a8c){return db[_0x22bc('0x19')][_0x22bc('0x1a')](_0x52af9d['body'],{'raw':_0x52af9d[_0x22bc('0x1b')]?_0x52af9d['options'][_0x22bc('0x1c')]===undefined?!![]:![]:!![]})[_0x22bc('0xd')](function(_0x1543e4){logger[_0x22bc('0x16')](_0x22bc('0x18'),_0x52af9d);logger[_0x22bc('0x10')]('CreatePlugin',_0x52af9d,JSON[_0x22bc('0x12')](_0x1543e4));_0xbf1943(_0x1543e4);})[_0x22bc('0x1d')](function(_0xe9852c){logger[_0x22bc('0x13')](_0x22bc('0x18'),_0xe9852c['message'],_0x52af9d);_0x2f5a8c(_0x11ecca['error'](0x1f4,_0xe9852c[_0x22bc('0x15')]));});});}; \ No newline at end of file +var _0x4190=['info','request\x20sent','debug','Plugin,\x20%s,\x20%s,\x20%s','stringify','error','Plugin,\x20%s,\x20%s','message','result','catch','CreatePlugin','Plugin','body','options','raw','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','defaults','redis','./plugin.socket','register','then'];(function(_0x1024e4,_0x67a93c){var _0x145c57=function(_0x4d7c20){while(--_0x4d7c20){_0x1024e4['push'](_0x1024e4['shift']());}};_0x145c57(++_0x67a93c);}(_0x4190,0x13b));var _0x0419=function(_0x5b6cf1,_0x32fdcd){_0x5b6cf1=_0x5b6cf1-0x0;var _0x46278c=_0x4190[_0x5b6cf1];return _0x46278c;};'use strict';var _=require(_0x0419('0x0'));var util=require(_0x0419('0x1'));var moment=require('moment');var BPromise=require(_0x0419('0x2'));var rs=require(_0x0419('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0419('0x4'))['db'];var utils=require(_0x0419('0x5'));var logger=require('../../config/logger')(_0x0419('0x6'));var config=require(_0x0419('0x7'));var jayson=require(_0x0419('0x8'));var client=jayson['client'][_0x0419('0x9')]({'port':0x232a});config['redis']=_[_0x0419('0xa')](config[_0x0419('0xb')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x0419('0xc'))[_0x0419('0xd')](socket);function respondWithRpcPromise(_0x5bdb09,_0xf4b2a1,_0x2dc11b){return new BPromise(function(_0x5b1e44,_0x497c19){return client['request'](_0x5bdb09,_0x2dc11b)[_0x0419('0xe')](function(_0x379dc6){logger[_0x0419('0xf')]('Plugin,\x20%s,\x20%s',_0xf4b2a1,_0x0419('0x10'));logger[_0x0419('0x11')](_0x0419('0x12'),_0xf4b2a1,_0x0419('0x10'),JSON[_0x0419('0x13')](_0x379dc6));if(_0x379dc6[_0x0419('0x14')]){if(_0x379dc6['error']['code']===0x1f4){logger[_0x0419('0x14')](_0x0419('0x15'),_0xf4b2a1,_0x379dc6[_0x0419('0x14')][_0x0419('0x16')]);return _0x497c19(_0x379dc6[_0x0419('0x14')][_0x0419('0x16')]);}logger[_0x0419('0x14')](_0x0419('0x15'),_0xf4b2a1,_0x379dc6['error'][_0x0419('0x16')]);return _0x5b1e44(_0x379dc6[_0x0419('0x14')][_0x0419('0x16')]);}else{logger['info'](_0x0419('0x15'),_0xf4b2a1,_0x0419('0x10'));_0x5b1e44(_0x379dc6[_0x0419('0x17')]['message']);}})[_0x0419('0x18')](function(_0x39e58e){logger[_0x0419('0x14')](_0x0419('0x15'),_0xf4b2a1,_0x39e58e);_0x497c19(_0x39e58e);});});}exports[_0x0419('0x19')]=function(_0x318ae1){var _0x16164a=this;return new Promise(function(_0x1a2ed0,_0x1ae6f){return db[_0x0419('0x1a')]['create'](_0x318ae1[_0x0419('0x1b')],{'raw':_0x318ae1[_0x0419('0x1c')]?_0x318ae1[_0x0419('0x1c')][_0x0419('0x1d')]===undefined?!![]:![]:!![]})[_0x0419('0xe')](function(_0x491e8c){logger[_0x0419('0xf')](_0x0419('0x19'),_0x318ae1);logger[_0x0419('0x11')]('CreatePlugin',_0x318ae1,JSON[_0x0419('0x13')](_0x491e8c));_0x1a2ed0(_0x491e8c);})[_0x0419('0x18')](function(_0x42ffc1){logger[_0x0419('0x14')](_0x0419('0x19'),_0x42ffc1[_0x0419('0x16')],_0x318ae1);_0x1ae6f(_0x16164a[_0x0419('0x14')](0x1f4,_0x42ffc1[_0x0419('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.socket.js b/server/api/plugin/plugin.socket.js index ac16311..401f76d 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 _0x088d=['length','plugin:','./plugin.events','update','emit','removeListener'];(function(_0x1d5bc2,_0x551da0){var _0x1df121=function(_0x237197){while(--_0x237197){_0x1d5bc2['push'](_0x1d5bc2['shift']());}};_0x1df121(++_0x551da0);}(_0x088d,0x116));var _0xd088=function(_0x3c7165,_0x5d8020){_0x3c7165=_0x3c7165-0x0;var _0x1c518d=_0x088d[_0x3c7165];return _0x1c518d;};'use strict';var PluginEvents=require(_0xd088('0x0'));var events=['save','remove',_0xd088('0x1')];function createListener(_0x2adae5,_0x5c1b08){return function(_0x208520){_0x5c1b08[_0xd088('0x2')](_0x2adae5,_0x208520);};}function removeListener(_0x4a4ae1,_0x4517dc){return function(){PluginEvents[_0xd088('0x3')](_0x4a4ae1,_0x4517dc);};}exports['register']=function(_0x51d987){for(var _0x5aca0b=0x0,_0x1ba087=events[_0xd088('0x4')];_0x5aca0b<_0x1ba087;_0x5aca0b++){var _0x54f6e7=events[_0x5aca0b];var _0x23dbaa=createListener(_0xd088('0x5')+_0x54f6e7,_0x51d987);PluginEvents['on'](_0x54f6e7,_0x23dbaa);}}; \ No newline at end of file +var _0xb5c7=['emit','removeListener','register','plugin:','./plugin.events','save','update'];(function(_0x288f5e,_0x205edd){var _0x476cc9=function(_0x796f53){while(--_0x796f53){_0x288f5e['push'](_0x288f5e['shift']());}};_0x476cc9(++_0x205edd);}(_0xb5c7,0x1c4));var _0x7b5c=function(_0x45fda9,_0x466f1d){_0x45fda9=_0x45fda9-0x0;var _0xcee40a=_0xb5c7[_0x45fda9];return _0xcee40a;};'use strict';var PluginEvents=require(_0x7b5c('0x0'));var events=[_0x7b5c('0x1'),'remove',_0x7b5c('0x2')];function createListener(_0x47aa29,_0x1b4b18){return function(_0x51b03){_0x1b4b18[_0x7b5c('0x3')](_0x47aa29,_0x51b03);};}function removeListener(_0x5b68cc,_0x5c0480){return function(){PluginEvents[_0x7b5c('0x4')](_0x5b68cc,_0x5c0480);};}exports[_0x7b5c('0x5')]=function(_0xc5a0da){for(var _0xa79d97=0x0,_0x481740=events['length'];_0xa79d97<_0x481740;_0xa79d97++){var _0x589258=events[_0xa79d97];var _0x3457e4=createListener(_0x7b5c('0x6')+_0x589258,_0xc5a0da);PluginEvents['on'](_0x589258,_0x3457e4);}}; \ No newline at end of file diff --git a/server/api/pm2/index.js b/server/api/pm2/index.js index a4b808b..4f78e35 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(_0x4a3c9f,_0x23266b){var _0x303737=function(_0x32b3ed){while(--_0x32b3ed){_0x4a3c9f['push'](_0x4a3c9f['shift']());}};_0x303737(++_0x23266b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x37c22c,_0x28a70d){_0x37c22c=_0x37c22c-0x0;var _0x119d79=_0xa9e0[_0x37c22c];return _0x119d79;};'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(_0x34cdd7,_0x2a6120){var _0x20870e=function(_0xf3c920){while(--_0xf3c920){_0x34cdd7['push'](_0x34cdd7['shift']());}};_0x20870e(++_0x2a6120);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1c546c,_0x5c57cb){_0x1c546c=_0x1c546c-0x0;var _0x2cc384=_0xa9e0[_0x1c546c];return _0x2cc384;};'use strict';var express=require(_0x0a9e('0x0'));var router=express[_0x0a9e('0x1')]();var auth=require(_0x0a9e('0x2'));var controller=require('./pm2.controller');router['get']('/',auth[_0x0a9e('0x3')](),controller['index']);router[_0x0a9e('0x4')](_0x0a9e('0x5'),auth[_0x0a9e('0x3')](),controller[_0x0a9e('0x6')]);router[_0x0a9e('0x7')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x8')]);router[_0x0a9e('0x9')](_0x0a9e('0x5'),auth['isAuthenticated'](),controller['update']);router[_0x0a9e('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);module[_0x0a9e('0xc')]=router; \ No newline at end of file diff --git a/server/api/pm2/pm2.controller.js b/server/api/pm2/pm2.controller.js index 324afea..9337a7b 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 _0x1d2d=['reject','express','motion2','length','catch','show','describe','create','body','script','join','../../files/plugins','cwd','chdir','start','dump','Missing\x20name\x20and/or\x20path','update','stop','hasOwnProperty','params','Unknown\x20status','destroy','delete','Unknown\x20id','lodash','../../config/pm2','../../config/logger','api','path','exec','sendStatus','json','error','stack','name','status','send','npm\x20install','info','index','list','then'];(function(_0x33f284,_0x3de900){var _0x5a4b7e=function(_0x41d6c8){while(--_0x41d6c8){_0x33f284['push'](_0x33f284['shift']());}};_0x5a4b7e(++_0x3de900);}(_0x1d2d,0xf0));var _0xd1d2=function(_0x183fe8,_0x5e62fc){_0x183fe8=_0x183fe8-0x0;var _0x4804b5=_0x1d2d[_0x183fe8];return _0x4804b5;};'use strict';var _=require(_0xd1d2('0x0'));var pm2=require(_0xd1d2('0x1'));var logger=require(_0xd1d2('0x2'))(_0xd1d2('0x3'));var path=require(_0xd1d2('0x4'));var exec=require('child_process')[_0xd1d2('0x5')];var BPromise=require('bluebird');function handleEntityNotFound(_0x5d3fac,_0x3caa72){return function(_0x2bfabc){if(!_0x2bfabc){_0x5d3fac[_0xd1d2('0x6')](0x194);;}return _0x2bfabc;};}function respondWithResult(_0x269613,_0x2f930d){_0x2f930d=_0x2f930d||0xc8;return function(_0x353dbd){if(_0x353dbd){return _0x269613['status'](_0x2f930d)[_0xd1d2('0x7')](_0x353dbd);}return null;};}function handleError(_0x21bc28,_0x35735f){_0x35735f=_0x35735f||0x1f4;return function(_0x37ff2a){logger[_0xd1d2('0x8')](_0x37ff2a[_0xd1d2('0x9')]);if(_0x37ff2a[_0xd1d2('0xa')]){delete _0x37ff2a[_0xd1d2('0xa')];}_0x21bc28[_0xd1d2('0xb')](_0x35735f)[_0xd1d2('0xc')](_0x37ff2a);};}function execChildProcess(){return new BPromise(function(_0x900ec,_0x227d7f){exec(_0xd1d2('0xd'),function(_0x5b21f4,_0x41fcb5,_0x1f49ed){logger[_0xd1d2('0xe')](_0x41fcb5);logger[_0xd1d2('0xe')](_0x1f49ed);if(_0x5b21f4){logger[_0xd1d2('0x8')](_0x5b21f4);return _0x227d7f(_0x5b21f4);}return _0x900ec(_0x41fcb5);});});}exports[_0xd1d2('0xf')]=function(_0x2df8a5,_0x31dc84){return pm2[_0xd1d2('0x10')]()[_0xd1d2('0x11')](function(_0x4cf702){if(_0x4cf702){var _0x2e7fec=_[_0xd1d2('0x12')](_0x4cf702,function(_0x3476f8){return _0x3476f8['name']===_0xd1d2('0x13')||_0x3476f8[_0xd1d2('0xa')]===_0xd1d2('0x14');});return{'rows':_0x2e7fec,'count':_0x2e7fec[_0xd1d2('0x15')]};}return null;})[_0xd1d2('0x11')](respondWithResult(_0x31dc84,null))[_0xd1d2('0x16')](handleError(_0x31dc84,null));};exports[_0xd1d2('0x17')]=function(_0x57f2f9,_0x539d5a){return pm2[_0xd1d2('0x18')](_0x57f2f9['params']['id'])[_0xd1d2('0x11')](respondWithResult(_0x539d5a,null))[_0xd1d2('0x11')](handleEntityNotFound(_0x539d5a,null))[_0xd1d2('0x16')](handleError(_0x539d5a,null));};exports[_0xd1d2('0x19')]=function(_0x4ab386,_0x4f1201){if(_0x4ab386[_0xd1d2('0x1a')]['name']&&_0x4ab386['body'][_0xd1d2('0x1b')]){var _0x27e26b=path[_0xd1d2('0x1c')](__dirname,_0xd1d2('0x1d'),_0x4ab386['body'][_0xd1d2('0x1b')]);var _0xbb4d27=process[_0xd1d2('0x1e')]();process['chdir'](path['dirname'](_0x27e26b));return execChildProcess()[_0xd1d2('0x11')](function(_0x3a1078){process[_0xd1d2('0x1f')](_0xbb4d27);return pm2[_0xd1d2('0x20')]({'name':_0x4ab386[_0xd1d2('0x1a')][_0xd1d2('0xa')],'script':_0x27e26b});})[_0xd1d2('0x11')](function(_0x5df4af){pm2[_0xd1d2('0x21')]();return _0x5df4af[0x0];})[_0xd1d2('0x11')](respondWithResult(_0x4f1201,0xc9))[_0xd1d2('0x16')](handleError(_0x4f1201,null));}else{return _0x4f1201[_0xd1d2('0xb')](0x1f4)[_0xd1d2('0xc')]({'message':_0xd1d2('0x22')});}};exports[_0xd1d2('0x23')]=function(_0x34faf7,_0xe6ef3c){if(_0x34faf7[_0xd1d2('0x1a')]['id']){delete _0x34faf7[_0xd1d2('0x1a')]['id'];}var _0x4e1bc2={'online':'restart','stopped':_0xd1d2('0x24')};if(_0x4e1bc2[_0xd1d2('0x25')](_0x34faf7[_0xd1d2('0x1a')][_0xd1d2('0xb')])){return pm2[_0x4e1bc2[_0x34faf7[_0xd1d2('0x1a')]['status']]](_0x34faf7[_0xd1d2('0x26')]['id'])[_0xd1d2('0x11')](respondWithResult(_0xe6ef3c,0xc8))[_0xd1d2('0x16')](handleError(_0xe6ef3c,null));}else{return _0xe6ef3c['status'](0x1f4)[_0xd1d2('0xc')]({'message':_0xd1d2('0x27')});}};exports[_0xd1d2('0x28')]=function(_0x56557d,_0x419db7){if(_0x56557d[_0xd1d2('0x1a')]['id']){delete _0x56557d[_0xd1d2('0x1a')]['id'];}if(_0x56557d[_0xd1d2('0x26')]['id']){return pm2[_0xd1d2('0x29')](_0x56557d[_0xd1d2('0x26')]['id'])[_0xd1d2('0x11')](function(_0x322f50){pm2[_0xd1d2('0x21')]();return _0x322f50[0x0];})[_0xd1d2('0x11')](respondWithResult(_0x419db7,null))[_0xd1d2('0x16')](handleError(_0x419db7,null));}else{return _0x419db7[_0xd1d2('0xb')](0x1f4)[_0xd1d2('0xc')]({'message':_0xd1d2('0x2a')});}}; \ No newline at end of file +var _0xc788=['body','script','join','../../files/plugins','chdir','dirname','start','dump','send','update','stop','hasOwnProperty','Unknown\x20status','params','delete','Unknown\x20id','lodash','../../config/pm2','../../config/logger','child_process','exec','bluebird','sendStatus','status','error','stack','name','info','index','list','then','reject','motion2','catch','show','describe'];(function(_0x5d85ec,_0x4f6f1c){var _0xa01f0d=function(_0x2686fd){while(--_0x2686fd){_0x5d85ec['push'](_0x5d85ec['shift']());}};_0xa01f0d(++_0x4f6f1c);}(_0xc788,0xc4));var _0x8c78=function(_0x1e003b,_0x3e4ded){_0x1e003b=_0x1e003b-0x0;var _0x268789=_0xc788[_0x1e003b];return _0x268789;};'use strict';var _=require(_0x8c78('0x0'));var pm2=require(_0x8c78('0x1'));var logger=require(_0x8c78('0x2'))('api');var path=require('path');var exec=require(_0x8c78('0x3'))[_0x8c78('0x4')];var BPromise=require(_0x8c78('0x5'));function handleEntityNotFound(_0x1d0670,_0x386f0a){return function(_0x5498f9){if(!_0x5498f9){_0x1d0670[_0x8c78('0x6')](0x194);;}return _0x5498f9;};}function respondWithResult(_0x4555da,_0x329152){_0x329152=_0x329152||0xc8;return function(_0x1ac27f){if(_0x1ac27f){return _0x4555da[_0x8c78('0x7')](_0x329152)['json'](_0x1ac27f);}return null;};}function handleError(_0x247188,_0x299d9d){_0x299d9d=_0x299d9d||0x1f4;return function(_0x9bc075){logger[_0x8c78('0x8')](_0x9bc075[_0x8c78('0x9')]);if(_0x9bc075[_0x8c78('0xa')]){delete _0x9bc075['name'];}_0x247188[_0x8c78('0x7')](_0x299d9d)['send'](_0x9bc075);};}function execChildProcess(){return new BPromise(function(_0x3d55f0,_0x45935a){exec('npm\x20install',function(_0x1a05a7,_0x95e78e,_0x5ee642){logger[_0x8c78('0xb')](_0x95e78e);logger['info'](_0x5ee642);if(_0x1a05a7){logger['error'](_0x1a05a7);return _0x45935a(_0x1a05a7);}return _0x3d55f0(_0x95e78e);});});}exports[_0x8c78('0xc')]=function(_0x1b1d0e,_0x26178c){return pm2[_0x8c78('0xd')]()[_0x8c78('0xe')](function(_0x3d1306){if(_0x3d1306){var _0xe5f8ae=_[_0x8c78('0xf')](_0x3d1306,function(_0x2f44af){return _0x2f44af[_0x8c78('0xa')]==='express'||_0x2f44af[_0x8c78('0xa')]===_0x8c78('0x10');});return{'rows':_0xe5f8ae,'count':_0xe5f8ae['length']};}return null;})[_0x8c78('0xe')](respondWithResult(_0x26178c,null))[_0x8c78('0x11')](handleError(_0x26178c,null));};exports[_0x8c78('0x12')]=function(_0x23824e,_0x2a982c){return pm2[_0x8c78('0x13')](_0x23824e['params']['id'])['then'](respondWithResult(_0x2a982c,null))[_0x8c78('0xe')](handleEntityNotFound(_0x2a982c,null))['catch'](handleError(_0x2a982c,null));};exports['create']=function(_0xece4f0,_0x56c191){if(_0xece4f0[_0x8c78('0x14')][_0x8c78('0xa')]&&_0xece4f0['body'][_0x8c78('0x15')]){var _0x5b111b=path[_0x8c78('0x16')](__dirname,_0x8c78('0x17'),_0xece4f0['body'][_0x8c78('0x15')]);var _0x188cc3=process['cwd']();process[_0x8c78('0x18')](path[_0x8c78('0x19')](_0x5b111b));return execChildProcess()[_0x8c78('0xe')](function(_0x9581c6){process[_0x8c78('0x18')](_0x188cc3);return pm2[_0x8c78('0x1a')]({'name':_0xece4f0[_0x8c78('0x14')][_0x8c78('0xa')],'script':_0x5b111b});})[_0x8c78('0xe')](function(_0x4a7d20){pm2[_0x8c78('0x1b')]();return _0x4a7d20[0x0];})[_0x8c78('0xe')](respondWithResult(_0x56c191,0xc9))[_0x8c78('0x11')](handleError(_0x56c191,null));}else{return _0x56c191['status'](0x1f4)[_0x8c78('0x1c')]({'message':'Missing\x20name\x20and/or\x20path'});}};exports[_0x8c78('0x1d')]=function(_0x24f9a7,_0x8d9ff9){if(_0x24f9a7['body']['id']){delete _0x24f9a7[_0x8c78('0x14')]['id'];}var _0x2568d5={'online':'restart','stopped':_0x8c78('0x1e')};if(_0x2568d5[_0x8c78('0x1f')](_0x24f9a7[_0x8c78('0x14')][_0x8c78('0x7')])){return pm2[_0x2568d5[_0x24f9a7[_0x8c78('0x14')][_0x8c78('0x7')]]](_0x24f9a7['params']['id'])[_0x8c78('0xe')](respondWithResult(_0x8d9ff9,0xc8))['catch'](handleError(_0x8d9ff9,null));}else{return _0x8d9ff9[_0x8c78('0x7')](0x1f4)[_0x8c78('0x1c')]({'message':_0x8c78('0x20')});}};exports['destroy']=function(_0x1f1a0c,_0x3816d2){if(_0x1f1a0c['body']['id']){delete _0x1f1a0c[_0x8c78('0x14')]['id'];}if(_0x1f1a0c[_0x8c78('0x21')]['id']){return pm2[_0x8c78('0x22')](_0x1f1a0c['params']['id'])[_0x8c78('0xe')](function(_0x63307e){pm2[_0x8c78('0x1b')]();return _0x63307e[0x0];})['then'](respondWithResult(_0x3816d2,null))[_0x8c78('0x11')](handleError(_0x3816d2,null));}else{return _0x3816d2[_0x8c78('0x7')](0x1f4)['send']({'message':_0x8c78('0x23')});}}; \ No newline at end of file diff --git a/server/api/realtime/index.js b/server/api/realtime/index.js index 64d4bfc..303aa04 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 _0xa2e9=['isAuthenticated','getAgents','/queues','exports','express','Router','../../components/auth/service','./realtime.controller','get'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xa2e9,0x16c));var _0x9a2e=function(_0x1030ce,_0xbe3f74){_0x1030ce=_0x1030ce-0x0;var _0x3367fd=_0xa2e9[_0x1030ce];return _0x3367fd;};'use strict';var express=require(_0x9a2e('0x0'));var router=express[_0x9a2e('0x1')]();var auth=require(_0x9a2e('0x2'));var controller=require(_0x9a2e('0x3'));router[_0x9a2e('0x4')]('/agents',auth[_0x9a2e('0x5')](),controller[_0x9a2e('0x6')]);router[_0x9a2e('0x4')](_0x9a2e('0x7'),auth['isAuthenticated'](),controller['getQueues']);module[_0x9a2e('0x8')]=router; \ No newline at end of file +var _0x26a4=['get','/agents','isAuthenticated','/queues','getQueues','exports','express','Router','../../components/auth/service','./realtime.controller'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x26a4,0x1be));var _0x426a=function(_0x3b87cc,_0x278e70){_0x3b87cc=_0x3b87cc-0x0;var _0x389012=_0x26a4[_0x3b87cc];return _0x389012;};'use strict';var express=require(_0x426a('0x0'));var router=express[_0x426a('0x1')]();var auth=require(_0x426a('0x2'));var controller=require(_0x426a('0x3'));router[_0x426a('0x4')](_0x426a('0x5'),auth[_0x426a('0x6')](),controller['getAgents']);router[_0x426a('0x4')](_0x426a('0x7'),auth['isAuthenticated'](),controller[_0x426a('0x8')]);module[_0x426a('0x9')]=router; \ No newline at end of file diff --git a/server/api/realtime/realtime.controller.js b/server/api/realtime/realtime.controller.js index f72d0a5..2540048 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 _0xa776=['Agents','online','extraQueryConditions','assign','UserProfile','getResources','findAndCountAll','find','getAgentStatus','voice','voiceStatus','Status','sortAgentsByStatus','getRealtimeAgentsQueryFields','getQueues','startCase','Queue','fieldName','fields','name','outbound','dialActive','dialMethod','join','getOptions','Queues','filter','getRealtimeQueues','initializeQueues','catch','lodash','util','../../components/realtime/agents','../../components/realtime/queues','../../components/parsers/qs','../../mysqldb','APIBadRequestError','../../errors/api','offset','limit','count','status','set','getAgents','getChannels','query','globalQueueFilter','globalStatusFilter','pauseTypeFilter','pause','*pause','resolve','then','isValidChannel','format','Channel\x20parameter\x20%s\x20is\x20invalid','channel','toLowerCase','sort','includes','globalStatus','validateSortParameter','getUpdatedSortOptions','getAgentIdsByQueues','getRealtimeAgents','rows','getSortedAgentsIdsByStatus','getAgentIdsByStatus','length','map','rawAttributes','type','key','role','agent','raw','push','sequelize','literal','FIELD(id,','order','forEach','Pause','where','merge','user','userProfileId'];(function(_0x52f041,_0x29bf29){var _0x410d04=function(_0x136599){while(--_0x136599){_0x52f041['push'](_0x52f041['shift']());}};_0x410d04(++_0x29bf29);}(_0xa776,0x1d1));var _0x6a77=function(_0x2e3906,_0x39d09b){_0x2e3906=_0x2e3906-0x0;var _0x2b8e1d=_0xa776[_0x2e3906];return _0x2b8e1d;};'use strict';var _=require(_0x6a77('0x0'));var util=require(_0x6a77('0x1'));var rta=require(_0x6a77('0x2'));var rtq=require(_0x6a77('0x3'));var qs=require(_0x6a77('0x4'));var utils=require('../../config/utils');var db=require(_0x6a77('0x5'))['db'];var APIBadRequestError=require('../../errors/api')[_0x6a77('0x6')];var APIHandleError=require(_0x6a77('0x7'))['handleError'];function respondWithFilteredResult(_0x4e7102,_0x19536f){return function(_0x44a6ee){if(_0x44a6ee){var _0x476f59=typeof _0x19536f[_0x6a77('0x8')]==='undefined'&&typeof _0x19536f[_0x6a77('0x9')]==='undefined';var _0x49e23d=_0x44a6ee[_0x6a77('0xa')];var _0x163c1e=_0x476f59?0x0:_0x19536f[_0x6a77('0x8')];var _0xcf61b0=_0x476f59?_0x44a6ee[_0x6a77('0xa')]:_0x19536f[_0x6a77('0x8')]+_0x19536f[_0x6a77('0x9')];var _0x3ba803;if(_0xcf61b0>=_0x49e23d){_0xcf61b0=_0x49e23d;_0x3ba803=0xc8;}else{_0x3ba803=0xce;}_0x4e7102[_0x6a77('0xb')](_0x3ba803);return _0x4e7102[_0x6a77('0xc')]('Content-Range',_0x163c1e+'-'+_0xcf61b0+'/'+_0x49e23d)['json'](_0x44a6ee);}return null;};}exports[_0x6a77('0xd')]=function(_0x339d9c,_0x5acf38){var _0x4de37d={'count':0x0,'rows':[]};var _0x137c4b={};var _0x23a018;var _0x2afe12=utils[_0x6a77('0xe')]();var _0x542e59;var _0x193390;var _0x1409c7=_0x339d9c[_0x6a77('0xf')][_0x6a77('0x10')];var _0x45aab4=_0x339d9c[_0x6a77('0xf')][_0x6a77('0x11')];var _0x1ec511=_0x339d9c[_0x6a77('0xf')][_0x6a77('0x12')];var _0x47eddd=_0x45aab4===_0x6a77('0x13')||_0x45aab4===_0x6a77('0x14')?!![]:![];var _0x52e2e4=[];var _0x3fc36a;var _0x2b7f0f;Promise[_0x6a77('0x15')]()[_0x6a77('0x16')](function(){if(_0x339d9c[_0x6a77('0xf')]['channel']){if(!utils[_0x6a77('0x17')](_0x339d9c[_0x6a77('0xf')]['channel'])){throw new APIBadRequestError(util[_0x6a77('0x18')](_0x6a77('0x19'),_0x339d9c[_0x6a77('0xf')][_0x6a77('0x1a')]));}_0x23a018=_0x339d9c[_0x6a77('0xf')][_0x6a77('0x1a')][_0x6a77('0x1b')]();}if(!_0x339d9c[_0x6a77('0xf')][_0x6a77('0x1c')]||!_0x339d9c['query'][_0x6a77('0x1c')][_0x6a77('0x1d')](_0x6a77('0x1e'))){_0x339d9c[_0x6a77('0xf')][_0x6a77('0x1c')]=rta[_0x6a77('0x1f')](_0x339d9c['query'][_0x6a77('0x1c')]);return;}var _0x139e80=rta[_0x6a77('0x20')](_0x339d9c['query'][_0x6a77('0x1c')]);_0x339d9c[_0x6a77('0xf')][_0x6a77('0x1c')]=_0x139e80['fields']['join'](',');_0x3fc36a=_0x139e80['order'];})[_0x6a77('0x16')](function(){if(!_0x1409c7){return[];}return rta[_0x6a77('0x21')](_0x1409c7,_0x23a018);})[_0x6a77('0x16')](function(_0x165068){_0x52e2e4=_0x165068;return rta[_0x6a77('0x22')]();})[_0x6a77('0x16')](function(_0x748f22){_0x193390=_0x748f22[_0x6a77('0x23')];if((!_0x45aab4||_0x47eddd)&&!_0x3fc36a){return _0x52e2e4;}if(_0x3fc36a&&!_0x45aab4){return rta[_0x6a77('0x24')](_0x193390,_0x52e2e4,_0x3fc36a);}else{return rta[_0x6a77('0x25')](_0x193390,_0x52e2e4,_0x45aab4);}})[_0x6a77('0x16')](function(_0x1a42bf){_0x52e2e4=_0x1a42bf;var _0x4b8b5f=![];if(_0x52e2e4[_0x6a77('0x26')]===0x0){if(_0x1409c7||_0x45aab4){_0x4b8b5f=!![];}if(_0x47eddd){_0x4b8b5f=![];}}if(_0x4b8b5f){return _0x4de37d;}var _0x31991b=_[_0x6a77('0x27')](db['User'][_0x6a77('0x28')],function(_0x5c86df){return{'name':_0x5c86df['fieldName'],'type':_0x5c86df[_0x6a77('0x29')][_0x6a77('0x2a')]};});_0x339d9c[_0x6a77('0xf')][_0x6a77('0x2b')]=_0x6a77('0x2c');_0x137c4b=qs['getOptions'](_0x31991b,_0x339d9c);_0x137c4b[_0x6a77('0x2d')]=!![];var _0x48981d=[];if(_0x52e2e4['length']>0x0){_0x48981d[_0x6a77('0x2e')]({'id':{'$in':_0x52e2e4}});if(_0x3fc36a&&!_0x45aab4){_0x2b7f0f=[db[_0x6a77('0x2f')][_0x6a77('0x30')](_0x6a77('0x31')+_0x52e2e4+')')];_0x137c4b[_0x6a77('0x32')]=_0x2b7f0f;}}if(_0x47eddd){_0x2afe12[_0x6a77('0x33')](function(_0x3b5bb9){var _0x1272de=!![];if(_0x45aab4==='*pause'&&_0x23a018!==_0x3b5bb9){_0x1272de=![];}_0x48981d[_0x6a77('0x2e')]({[_0x3b5bb9+_0x6a77('0x34')]:_0x1272de});});if(_0x1ec511){_0x48981d['push']({'pauseType':_0x1ec511});}}else if(_0x45aab4){_0x2afe12[_0x6a77('0x33')](function(_0x4c9228){_0x48981d['push']({[_0x4c9228+_0x6a77('0x34')]:![]});});}_0x137c4b[_0x6a77('0x35')]=_[_0x6a77('0x36')](_0x137c4b[_0x6a77('0x35')],{'$and':_0x48981d});if(_0x339d9c[_0x6a77('0x37')]['role']==='user'){var _0x5b3486={'params':{'id':_0x339d9c[_0x6a77('0x37')][_0x6a77('0x38')]},'query':{'section':_0x6a77('0x39'),'role':_0x6a77('0x2c'),'raw':!![],'ids':_0x52e2e4,'customSorting':_0x2b7f0f}};if(_0x339d9c['query'][_0x6a77('0x3a')]){_0x5b3486[_0x6a77('0xf')]['online']=!![];}if(_0x47eddd){_0x5b3486[_0x6a77('0xf')][_0x6a77('0x3b')]=_0x48981d;}_0x5b3486[_0x6a77('0xf')]=Object[_0x6a77('0x3c')](_0x5b3486[_0x6a77('0xf')],_0x339d9c[_0x6a77('0xf')]);return db[_0x6a77('0x3d')][_0x6a77('0x3e')](_0x5b3486);}return db['User'][_0x6a77('0x3f')](_0x137c4b);})[_0x6a77('0x16')](function(_0xd6e80b){_0x4de37d['count']=_0xd6e80b[_0x6a77('0xa')];_0x542e59=_0xd6e80b[_0x6a77('0x23')];return _0x542e59['map'](function(_0x1c22e7){var _0x4a0c5b=_[_0x6a77('0x40')](_0x193390,['id',_0x1c22e7['id']]);if(_0x4a0c5b){var _0x554517=rta['filterAgentAttributes'](_0x4a0c5b);_[_0x6a77('0x36')](_0x1c22e7,_0x554517);}_0x1c22e7[_0x6a77('0x1e')]=rta[_0x6a77('0x41')](_0x1c22e7);if(_0x1c22e7['globalStatus'][_0x6a77('0x1d')](_0x6a77('0x13'))){_0x2afe12[_0x6a77('0x33')](function(_0x1c2096){if(_0x1c22e7[_0x1c2096+_0x6a77('0x34')]){if(_0x1c2096===_0x6a77('0x42')){if(_0x1c22e7['voiceStatus']!=='talking'){_0x1c22e7[_0x6a77('0x43')]=_0x6a77('0x13');}}else{_0x1c22e7[_0x1c2096+_0x6a77('0x44')]=_0x6a77('0x13');}}});}return _0x1c22e7;});})['then'](function(_0x37661d){if(!_0x3fc36a||_0x2b7f0f){return _0x37661d;}return rta[_0x6a77('0x45')](_0x37661d,_0x3fc36a);})[_0x6a77('0x16')](function(_0x6de881){var _0x479a6e=rta[_0x6a77('0x46')]();_0x4de37d[_0x6a77('0x23')]=_0x6de881[_0x6a77('0x27')](function(_0x24434f){return _['pick'](_0x24434f,_0x479a6e);});return _0x4de37d;})['then'](respondWithFilteredResult(_0x5acf38,_0x137c4b))['catch'](APIHandleError(_0x5acf38));};exports[_0x6a77('0x47')]=function(_0x1137ce,_0x1484d1){var _0x4a3bee={'count':0x0,'rows':[]};var _0x5c7a61={};var _0x3b1ceb;var _0x24a494;var _0x1eb455;Promise['resolve']()[_0x6a77('0x16')](function(){if(_0x1137ce[_0x6a77('0xf')][_0x6a77('0x1a')]){if(!utils['isValidChannel'](_0x1137ce['query'][_0x6a77('0x1a')])){throw new APIBadRequestError(util[_0x6a77('0x18')]('Channel\x20parameter\x20%s\x20is\x20invalid',_0x1137ce[_0x6a77('0xf')][_0x6a77('0x1a')]));}_0x3b1ceb=_0x1137ce[_0x6a77('0xf')]['channel'][_0x6a77('0x1b')]();}var _0x59b828=_[_0x6a77('0x48')](_0x3b1ceb)+_0x6a77('0x49');var _0x17dfe4=_[_0x6a77('0x27')](db[_0x59b828][_0x6a77('0x28')],function(_0x43f927){return{'name':_0x43f927[_0x6a77('0x4a')],'type':_0x43f927[_0x6a77('0x29')][_0x6a77('0x2a')]};});if(!_0x1137ce['query'][_0x6a77('0x4b')]){var _0x3b2c15=['id',_0x6a77('0x4c')];if(_0x3b1ceb==='voice'){_0x3b2c15[_0x6a77('0x2e')]('type');if(_0x1137ce[_0x6a77('0xf')][_0x6a77('0x29')]===_0x6a77('0x4d')){_0x3b2c15[_0x6a77('0x2e')]([_0x6a77('0x4e'),_0x6a77('0x4f')]);}}_0x1137ce[_0x6a77('0xf')]['fields']=_0x3b2c15[_0x6a77('0x50')](',');}_0x5c7a61=qs[_0x6a77('0x51')](_0x17dfe4,_0x1137ce);if(_0x1137ce['user'][_0x6a77('0x2b')]===_0x6a77('0x37')){var _0x3d7895={'params':{'id':_0x1137ce[_0x6a77('0x37')][_0x6a77('0x38')]},'query':{'section':_0x3b1ceb==='voice'&&_0x1137ce[_0x6a77('0xf')]['type']==='outbound'?'QueueCampaigns':_[_0x6a77('0x48')](_0x3b1ceb)+_0x6a77('0x52'),'type':_0x1137ce[_0x6a77('0xf')][_0x6a77('0x29')],'nolimit':!![],'sort':'name','filter':_0x1137ce[_0x6a77('0xf')][_0x6a77('0x53')]}};_0x3d7895[_0x6a77('0xf')]=Object['assign'](_0x3d7895[_0x6a77('0xf')],_0x1137ce[_0x6a77('0xf')]);delete _0x3d7895[_0x6a77('0xf')]['id'];return db[_0x6a77('0x3d')]['getResources'](_0x3d7895);}return db[_0x59b828][_0x6a77('0x3f')](_0x5c7a61);})[_0x6a77('0x16')](function(_0x4c41d8){_0x4a3bee['count']=_0x4c41d8[_0x6a77('0xa')];_0x24a494=_0x4c41d8[_0x6a77('0x23')];return rtq[_0x6a77('0x54')](_0x1137ce,_0x3b1ceb);})['then'](function(_0x5c3e31){_0x1eb455=_0x5c3e31['rows'];return rtq[_0x6a77('0x55')](_0x24a494,_0x1eb455,_0x3b1ceb,_0x1137ce[_0x6a77('0xf')][_0x6a77('0x29')]);})[_0x6a77('0x16')](function(_0x4a90e4){_0x4a3bee['rows']=_0x4a90e4;return _0x4a3bee;})[_0x6a77('0x16')](respondWithFilteredResult(_0x1484d1,_0x5c7a61))[_0x6a77('0x56')](APIHandleError(_0x1484d1));}; \ No newline at end of file +var _0x20a5=['assign','UserProfile','User','rows','globalStatus','getAgentStatus','talking','voiceStatus','Status','getRealtimeAgentsQueryFields','pick','catch','getQueues','isValidChannel','toLowerCase','startCase','name','voice','dialActive','dialMethod','join','getOptions','outbound','QueueCampaigns','Queues','filter','getResources','findAndCountAll','getRealtimeQueues','initializeQueues','util','../../components/realtime/agents','../../components/realtime/queues','../../components/parsers/qs','../../config/utils','../../mysqldb','../../errors/api','handleError','offset','undefined','limit','count','status','set','Content-Range','json','getAgents','getChannels','query','globalQueueFilter','globalStatusFilter','pause','resolve','then','channel','format','Channel\x20parameter\x20%s\x20is\x20invalid','sort','includes','getUpdatedSortOptions','fields','order','getRealtimeAgents','getAgentIdsByStatus','length','map','rawAttributes','fieldName','type','role','agent','raw','push','sequelize','literal','forEach','*pause','Pause','where','merge','user','userProfileId','Agents','online'];(function(_0x14090e,_0x30c2f7){var _0x554da7=function(_0x165d16){while(--_0x165d16){_0x14090e['push'](_0x14090e['shift']());}};_0x554da7(++_0x30c2f7);}(_0x20a5,0x1c2));var _0x520a=function(_0x5bbe1f,_0xe1e455){_0x5bbe1f=_0x5bbe1f-0x0;var _0x222c8b=_0x20a5[_0x5bbe1f];return _0x222c8b;};'use strict';var _=require('lodash');var util=require(_0x520a('0x0'));var rta=require(_0x520a('0x1'));var rtq=require(_0x520a('0x2'));var qs=require(_0x520a('0x3'));var utils=require(_0x520a('0x4'));var db=require(_0x520a('0x5'))['db'];var APIBadRequestError=require(_0x520a('0x6'))['APIBadRequestError'];var APIHandleError=require('../../errors/api')[_0x520a('0x7')];function respondWithFilteredResult(_0x23278e,_0x13af3e){return function(_0x53b817){if(_0x53b817){var _0x3d7785=typeof _0x13af3e[_0x520a('0x8')]===_0x520a('0x9')&&typeof _0x13af3e[_0x520a('0xa')]==='undefined';var _0x55ad93=_0x53b817['count'];var _0x411e8d=_0x3d7785?0x0:_0x13af3e[_0x520a('0x8')];var _0x4543c5=_0x3d7785?_0x53b817[_0x520a('0xb')]:_0x13af3e[_0x520a('0x8')]+_0x13af3e[_0x520a('0xa')];var _0xd6a948;if(_0x4543c5>=_0x55ad93){_0x4543c5=_0x55ad93;_0xd6a948=0xc8;}else{_0xd6a948=0xce;}_0x23278e[_0x520a('0xc')](_0xd6a948);return _0x23278e[_0x520a('0xd')](_0x520a('0xe'),_0x411e8d+'-'+_0x4543c5+'/'+_0x55ad93)[_0x520a('0xf')](_0x53b817);}return null;};}exports[_0x520a('0x10')]=function(_0x11e362,_0xb70837){var _0x37cc84={'count':0x0,'rows':[]};var _0x3c4aa6={};var _0x48d2cd;var _0x168c69=utils[_0x520a('0x11')]();var _0x3ed0a1;var _0x6f1d45;var _0x3f74a2=_0x11e362[_0x520a('0x12')][_0x520a('0x13')];var _0x215a86=_0x11e362[_0x520a('0x12')][_0x520a('0x14')];var _0x10fcc6=_0x11e362[_0x520a('0x12')]['pauseTypeFilter'];var _0x3c7195=_0x215a86===_0x520a('0x15')||_0x215a86==='*pause'?!![]:![];var _0x330412=[];var _0x162ecd;var _0x4e32df;Promise[_0x520a('0x16')]()[_0x520a('0x17')](function(){if(_0x11e362['query'][_0x520a('0x18')]){if(!utils['isValidChannel'](_0x11e362[_0x520a('0x12')]['channel'])){throw new APIBadRequestError(util[_0x520a('0x19')](_0x520a('0x1a'),_0x11e362[_0x520a('0x12')][_0x520a('0x18')]));}_0x48d2cd=_0x11e362[_0x520a('0x12')][_0x520a('0x18')]['toLowerCase']();}if(!_0x11e362[_0x520a('0x12')][_0x520a('0x1b')]||!_0x11e362[_0x520a('0x12')][_0x520a('0x1b')][_0x520a('0x1c')]('globalStatus')){_0x11e362[_0x520a('0x12')][_0x520a('0x1b')]=rta['validateSortParameter'](_0x11e362[_0x520a('0x12')][_0x520a('0x1b')]);return;}var _0x383337=rta[_0x520a('0x1d')](_0x11e362['query']['sort']);_0x11e362[_0x520a('0x12')]['sort']=_0x383337[_0x520a('0x1e')]['join'](',');_0x162ecd=_0x383337[_0x520a('0x1f')];})[_0x520a('0x17')](function(){if(!_0x3f74a2){return[];}return rta['getAgentIdsByQueues'](_0x3f74a2,_0x48d2cd);})['then'](function(_0x1d4966){_0x330412=_0x1d4966;return rta[_0x520a('0x20')]();})[_0x520a('0x17')](function(_0xce7a9a){_0x6f1d45=_0xce7a9a['rows'];if((!_0x215a86||_0x3c7195)&&!_0x162ecd){return _0x330412;}if(_0x162ecd&&!_0x215a86){return rta['getSortedAgentsIdsByStatus'](_0x6f1d45,_0x330412,_0x162ecd);}else{return rta[_0x520a('0x21')](_0x6f1d45,_0x330412,_0x215a86);}})[_0x520a('0x17')](function(_0x3f9164){_0x330412=_0x3f9164;var _0x114063=![];if(_0x330412[_0x520a('0x22')]===0x0){if(_0x3f74a2||_0x215a86){_0x114063=!![];}if(_0x3c7195){_0x114063=![];}}if(_0x114063){return _0x37cc84;}var _0x1d77ef=_[_0x520a('0x23')](db['User'][_0x520a('0x24')],function(_0x2ed252){return{'name':_0x2ed252[_0x520a('0x25')],'type':_0x2ed252[_0x520a('0x26')]['key']};});_0x11e362[_0x520a('0x12')][_0x520a('0x27')]=_0x520a('0x28');_0x3c4aa6=qs['getOptions'](_0x1d77ef,_0x11e362);_0x3c4aa6[_0x520a('0x29')]=!![];var _0x171605=[];if(_0x330412[_0x520a('0x22')]>0x0){_0x171605[_0x520a('0x2a')]({'id':{'$in':_0x330412}});if(_0x162ecd&&!_0x215a86){_0x4e32df=[db[_0x520a('0x2b')][_0x520a('0x2c')]('FIELD(id,'+_0x330412+')')];_0x3c4aa6[_0x520a('0x1f')]=_0x4e32df;}}if(_0x3c7195){_0x168c69[_0x520a('0x2d')](function(_0x140c75){var _0x37a390=!![];if(_0x215a86===_0x520a('0x2e')&&_0x48d2cd!==_0x140c75){_0x37a390=![];}_0x171605['push']({[_0x140c75+_0x520a('0x2f')]:_0x37a390});});if(_0x10fcc6){_0x171605['push']({'pauseType':_0x10fcc6});}}else if(_0x215a86){_0x168c69[_0x520a('0x2d')](function(_0x20c22f){_0x171605['push']({[_0x20c22f+_0x520a('0x2f')]:![]});});}_0x3c4aa6[_0x520a('0x30')]=_[_0x520a('0x31')](_0x3c4aa6['where'],{'$and':_0x171605});if(_0x11e362[_0x520a('0x32')][_0x520a('0x27')]===_0x520a('0x32')){var _0x45d8a9={'params':{'id':_0x11e362[_0x520a('0x32')][_0x520a('0x33')]},'query':{'section':_0x520a('0x34'),'role':_0x520a('0x28'),'raw':!![],'ids':_0x330412,'customSorting':_0x4e32df}};if(_0x11e362[_0x520a('0x12')][_0x520a('0x35')]){_0x45d8a9[_0x520a('0x12')]['online']=!![];}if(_0x3c7195){_0x45d8a9[_0x520a('0x12')]['extraQueryConditions']=_0x171605;}_0x45d8a9['query']=Object[_0x520a('0x36')](_0x45d8a9[_0x520a('0x12')],_0x11e362[_0x520a('0x12')]);return db[_0x520a('0x37')]['getResources'](_0x45d8a9);}return db[_0x520a('0x38')]['findAndCountAll'](_0x3c4aa6);})[_0x520a('0x17')](function(_0xf6f205){_0x37cc84[_0x520a('0xb')]=_0xf6f205[_0x520a('0xb')];_0x3ed0a1=_0xf6f205[_0x520a('0x39')];return _0x3ed0a1[_0x520a('0x23')](function(_0x9c54c4){var _0xfef864=_['find'](_0x6f1d45,['id',_0x9c54c4['id']]);if(_0xfef864){var _0x2c8483=rta['filterAgentAttributes'](_0xfef864);_[_0x520a('0x31')](_0x9c54c4,_0x2c8483);}_0x9c54c4[_0x520a('0x3a')]=rta[_0x520a('0x3b')](_0x9c54c4);if(_0x9c54c4[_0x520a('0x3a')][_0x520a('0x1c')](_0x520a('0x15'))){_0x168c69[_0x520a('0x2d')](function(_0xaeb743){if(_0x9c54c4[_0xaeb743+_0x520a('0x2f')]){if(_0xaeb743==='voice'){if(_0x9c54c4['voiceStatus']!==_0x520a('0x3c')){_0x9c54c4[_0x520a('0x3d')]='pause';}}else{_0x9c54c4[_0xaeb743+_0x520a('0x3e')]=_0x520a('0x15');}}});}return _0x9c54c4;});})['then'](function(_0x2885fd){if(!_0x162ecd||_0x4e32df){return _0x2885fd;}return rta['sortAgentsByStatus'](_0x2885fd,_0x162ecd);})[_0x520a('0x17')](function(_0x2717f0){var _0x19d16d=rta[_0x520a('0x3f')]();_0x37cc84[_0x520a('0x39')]=_0x2717f0['map'](function(_0x143554){return _[_0x520a('0x40')](_0x143554,_0x19d16d);});return _0x37cc84;})[_0x520a('0x17')](respondWithFilteredResult(_0xb70837,_0x3c4aa6))[_0x520a('0x41')](APIHandleError(_0xb70837));};exports[_0x520a('0x42')]=function(_0x25ae7d,_0x1039ab){var _0x210d7e={'count':0x0,'rows':[]};var _0x31a541={};var _0xbcecab;var _0x8f34fb;var _0x146c0c;Promise['resolve']()[_0x520a('0x17')](function(){if(_0x25ae7d[_0x520a('0x12')][_0x520a('0x18')]){if(!utils[_0x520a('0x43')](_0x25ae7d[_0x520a('0x12')][_0x520a('0x18')])){throw new APIBadRequestError(util[_0x520a('0x19')]('Channel\x20parameter\x20%s\x20is\x20invalid',_0x25ae7d['query'][_0x520a('0x18')]));}_0xbcecab=_0x25ae7d[_0x520a('0x12')][_0x520a('0x18')][_0x520a('0x44')]();}var _0x5719d2=_[_0x520a('0x45')](_0xbcecab)+'Queue';var _0x439e3a=_[_0x520a('0x23')](db[_0x5719d2][_0x520a('0x24')],function(_0x29b216){return{'name':_0x29b216[_0x520a('0x25')],'type':_0x29b216['type']['key']};});if(!_0x25ae7d[_0x520a('0x12')][_0x520a('0x1e')]){var _0x3fd75b=['id',_0x520a('0x46')];if(_0xbcecab===_0x520a('0x47')){_0x3fd75b[_0x520a('0x2a')](_0x520a('0x26'));if(_0x25ae7d[_0x520a('0x12')]['type']==='outbound'){_0x3fd75b[_0x520a('0x2a')]([_0x520a('0x48'),_0x520a('0x49')]);}}_0x25ae7d['query'][_0x520a('0x1e')]=_0x3fd75b[_0x520a('0x4a')](',');}_0x31a541=qs[_0x520a('0x4b')](_0x439e3a,_0x25ae7d);if(_0x25ae7d['user']['role']===_0x520a('0x32')){var _0x3a997a={'params':{'id':_0x25ae7d[_0x520a('0x32')][_0x520a('0x33')]},'query':{'section':_0xbcecab===_0x520a('0x47')&&_0x25ae7d[_0x520a('0x12')][_0x520a('0x26')]===_0x520a('0x4c')?_0x520a('0x4d'):_[_0x520a('0x45')](_0xbcecab)+_0x520a('0x4e'),'type':_0x25ae7d['query'][_0x520a('0x26')],'nolimit':!![],'sort':_0x520a('0x46'),'filter':_0x25ae7d[_0x520a('0x12')][_0x520a('0x4f')]}};_0x3a997a[_0x520a('0x12')]=Object[_0x520a('0x36')](_0x3a997a[_0x520a('0x12')],_0x25ae7d[_0x520a('0x12')]);delete _0x3a997a['query']['id'];return db['UserProfile'][_0x520a('0x50')](_0x3a997a);}return db[_0x5719d2][_0x520a('0x51')](_0x31a541);})[_0x520a('0x17')](function(_0x1668db){_0x210d7e['count']=_0x1668db[_0x520a('0xb')];_0x8f34fb=_0x1668db[_0x520a('0x39')];return rtq[_0x520a('0x52')](_0x25ae7d,_0xbcecab);})[_0x520a('0x17')](function(_0xc0820e){_0x146c0c=_0xc0820e[_0x520a('0x39')];return rtq[_0x520a('0x53')](_0x8f34fb,_0x146c0c,_0xbcecab,_0x25ae7d['query'][_0x520a('0x26')]);})[_0x520a('0x17')](function(_0x3fab15){_0x210d7e[_0x520a('0x39')]=_0x3fab15;return _0x210d7e;})[_0x520a('0x17')](respondWithFilteredResult(_0x1039ab,_0x31a541))[_0x520a('0x41')](APIHandleError(_0x1039ab));}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/index.js b/server/api/reportAgentPreview/index.js index cc54bbd..4c28be5 100644 --- a/server/api/reportAgentPreview/index.js +++ b/server/api/reportAgentPreview/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x58d9c0,_0x4f2a1a){var _0x2bae6c=function(_0x218e7a){while(--_0x218e7a){_0x58d9c0['push'](_0x58d9c0['shift']());}};_0x2bae6c(++_0x4f2a1a);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x258b93,_0x188ccc){_0x258b93=_0x258b93-0x0;var _0x35484b=_0xcb91[_0x258b93];return _0x35484b;};'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(_0x56dfdb,_0xbef4c0){var _0xf3f640=function(_0x3d6b25){while(--_0x3d6b25){_0x56dfdb['push'](_0x56dfdb['shift']());}};_0xf3f640(++_0xbef4c0);}(_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/reportAgentPreview/reportAgentPreview.attributes.js b/server/api/reportAgentPreview/reportAgentPreview.attributes.js index 87a2a4a..bfbc950 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 _0x0dd6=['DATE','INTEGER','STRING'];(function(_0x329437,_0x1de73a){var _0x3789d9=function(_0x37832e){while(--_0x37832e){_0x329437['push'](_0x329437['shift']());}};_0x3789d9(++_0x1de73a);}(_0x0dd6,0xca));var _0x60dd=function(_0x1d533b,_0x5d5961){_0x1d533b=_0x1d533b-0x0;var _0x2eac2a=_0x0dd6[_0x1d533b];return _0x2eac2a;};'use strict';var Sequelize=require('sequelize');module['exports']={'state':{'type':Sequelize[_0x60dd('0x0')](0x2)},'statedesc':{'type':Sequelize[_0x60dd('0x1')]},'scheduledat':{'type':Sequelize[_0x60dd('0x2')]},'uniqueid':{'type':Sequelize[_0x60dd('0x1')]},'starttime':{'type':Sequelize[_0x60dd('0x2')]},'responsetime':{'type':Sequelize[_0x60dd('0x2')]},'ringtime':{'type':Sequelize[_0x60dd('0x0')],'defaultValue':0x0},'campaign':{'type':Sequelize[_0x60dd('0x1')]},'campaigntype':{'type':Sequelize[_0x60dd('0x1')]},'membername':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x5a2a=['DATE','sequelize','exports','INTEGER','STRING'];(function(_0x55754e,_0x286388){var _0x2e9948=function(_0x1eaeff){while(--_0x1eaeff){_0x55754e['push'](_0x55754e['shift']());}};_0x2e9948(++_0x286388);}(_0x5a2a,0x1c3));var _0xa5a2=function(_0x1593fb,_0x32f620){_0x1593fb=_0x1593fb-0x0;var _0x45de68=_0x5a2a[_0x1593fb];return _0x45de68;};'use strict';var Sequelize=require(_0xa5a2('0x0'));module[_0xa5a2('0x1')]={'state':{'type':Sequelize[_0xa5a2('0x2')](0x2)},'statedesc':{'type':Sequelize[_0xa5a2('0x3')]},'scheduledat':{'type':Sequelize['DATE']},'uniqueid':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize[_0xa5a2('0x4')]},'ringtime':{'type':Sequelize[_0xa5a2('0x2')],'defaultValue':0x0},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize[_0xa5a2('0x3')]},'membername':{'type':Sequelize[_0xa5a2('0x3')]}}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.model.js b/server/api/reportAgentPreview/reportAgentPreview.model.js index 0d27498..05c5201 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 _0x4644=['path','../../config/environment','./reportAgentPreview.attributes','exports','define','report_agent_preview','util','../../config/logger','moment','bluebird','request-promise'];(function(_0x108c0c,_0x34a7d4){var _0x2da545=function(_0x4fc0ea){while(--_0x4fc0ea){_0x108c0c['push'](_0x108c0c['shift']());}};_0x2da545(++_0x34a7d4);}(_0x4644,0x13a));var _0x4464=function(_0x48aee7,_0x4c6296){_0x48aee7=_0x48aee7-0x0;var _0x47de11=_0x4644[_0x48aee7];return _0x47de11;};'use strict';var _=require('lodash');var util=require(_0x4464('0x0'));var logger=require(_0x4464('0x1'))('api');var moment=require(_0x4464('0x2'));var BPromise=require(_0x4464('0x3'));var rp=require(_0x4464('0x4'));var fs=require('fs');var path=require(_0x4464('0x5'));var rimraf=require('rimraf');var config=require(_0x4464('0x6'));var attributes=require(_0x4464('0x7'));module[_0x4464('0x8')]=function(_0x126884,_0x16f1e9){return _0x126884[_0x4464('0x9')]('ReportAgentPreview',attributes,{'tableName':_0x4464('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb676=['../../config/logger','moment','bluebird','request-promise','./reportAgentPreview.attributes','exports','ReportAgentPreview','report_agent_preview','lodash','util'];(function(_0x578ed5,_0x502073){var _0x195c85=function(_0x323e5c){while(--_0x323e5c){_0x578ed5['push'](_0x578ed5['shift']());}};_0x195c85(++_0x502073);}(_0xb676,0x1b6));var _0x6b67=function(_0x53abe5,_0x33a9e5){_0x53abe5=_0x53abe5-0x0;var _0xc1c37e=_0xb676[_0x53abe5];return _0xc1c37e;};'use strict';var _=require(_0x6b67('0x0'));var util=require(_0x6b67('0x1'));var logger=require(_0x6b67('0x2'))('api');var moment=require(_0x6b67('0x3'));var BPromise=require(_0x6b67('0x4'));var rp=require(_0x6b67('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x6b67('0x6'));module[_0x6b67('0x7')]=function(_0x43f8a0,_0x968c11){return _0x43f8a0['define'](_0x6b67('0x8'),attributes,{'tableName':_0x6b67('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.rpc.js b/server/api/reportAgentPreview/reportAgentPreview.rpc.js index 31a3a0c..cd6fc5b 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 _0x8820=['randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','info','request\x20sent','error','ReportAgentPreview,\x20%s,\x20%s','message','catch','ReportAgentPreview','create','body','options','CreateReportAgentPreview','debug','stringify','lodash','util','moment'];(function(_0x17406a,_0x1e2320){var _0x1501ff=function(_0x4b075a){while(--_0x4b075a){_0x17406a['push'](_0x17406a['shift']());}};_0x1501ff(++_0x1e2320);}(_0x8820,0x18d));var _0x0882=function(_0x2baea6,_0x17e57f){_0x2baea6=_0x2baea6-0x0;var _0x5f0913=_0x8820[_0x2baea6];return _0x5f0913;};'use strict';var _=require(_0x0882('0x0'));var util=require(_0x0882('0x1'));var moment=require(_0x0882('0x2'));var BPromise=require('bluebird');var rs=require(_0x0882('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0882('0x4'))['db'];var utils=require(_0x0882('0x5'));var logger=require(_0x0882('0x6'))(_0x0882('0x7'));var config=require(_0x0882('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x0882('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x30692b,_0x556ea6,_0x13eb85){return new BPromise(function(_0x27c797,_0x1c68a5){return client[_0x0882('0xa')](_0x30692b,_0x13eb85)[_0x0882('0xb')](function(_0x1b4bc0){logger[_0x0882('0xc')]('ReportAgentPreview,\x20%s,\x20%s',_0x556ea6,_0x0882('0xd'));logger['debug']('ReportAgentPreview,\x20%s,\x20%s,\x20%s',_0x556ea6,_0x0882('0xd'),JSON['stringify'](_0x1b4bc0));if(_0x1b4bc0[_0x0882('0xe')]){if(_0x1b4bc0['error']['code']===0x1f4){logger['error'](_0x0882('0xf'),_0x556ea6,_0x1b4bc0[_0x0882('0xe')]['message']);return _0x1c68a5(_0x1b4bc0['error'][_0x0882('0x10')]);}logger[_0x0882('0xe')](_0x0882('0xf'),_0x556ea6,_0x1b4bc0['error']['message']);return _0x27c797(_0x1b4bc0[_0x0882('0xe')][_0x0882('0x10')]);}else{logger[_0x0882('0xc')](_0x0882('0xf'),_0x556ea6,_0x0882('0xd'));_0x27c797(_0x1b4bc0['result'][_0x0882('0x10')]);}})[_0x0882('0x11')](function(_0x4f4596){logger[_0x0882('0xe')]('ReportAgentPreview,\x20%s,\x20%s',_0x556ea6,_0x4f4596);_0x1c68a5(_0x4f4596);});});}exports['CreateReportAgentPreview']=function(_0x489eb1){var _0x1e16af=this;return new Promise(function(_0x18181b,_0x2a8e61){return db[_0x0882('0x12')][_0x0882('0x13')](_0x489eb1[_0x0882('0x14')],{'raw':_0x489eb1[_0x0882('0x15')]?_0x489eb1[_0x0882('0x15')]['raw']===undefined?!![]:![]:!![]})[_0x0882('0xb')](function(_0xe3e809){logger['info'](_0x0882('0x16'),_0x489eb1);logger[_0x0882('0x17')](_0x0882('0x16'),_0x489eb1,JSON[_0x0882('0x18')](_0xe3e809));_0x18181b(_0xe3e809);})[_0x0882('0x11')](function(_0x2ba60e){logger['error'](_0x0882('0x16'),_0x2ba60e[_0x0882('0x10')],_0x489eb1);_0x2a8e61(_0x1e16af['error'](0x1f4,_0x2ba60e[_0x0882('0x10')]));});});}; \ No newline at end of file +var _0xe35a=['options','raw','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','ReportAgentPreview,\x20%s,\x20%s','request\x20sent','debug','ReportAgentPreview,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','CreateReportAgentPreview','create','body'];(function(_0x293b13,_0x2112aa){var _0x33f1ca=function(_0x15b021){while(--_0x15b021){_0x293b13['push'](_0x293b13['shift']());}};_0x33f1ca(++_0x2112aa);}(_0xe35a,0x1a6));var _0xae35=function(_0x40c849,_0xbc22a1){_0x40c849=_0x40c849-0x0;var _0x7d3bef=_0xe35a[_0x40c849];return _0x7d3bef;};'use strict';var _=require(_0xae35('0x0'));var util=require(_0xae35('0x1'));var moment=require(_0xae35('0x2'));var BPromise=require(_0xae35('0x3'));var rs=require(_0xae35('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xae35('0x5'))['db'];var utils=require(_0xae35('0x6'));var logger=require(_0xae35('0x7'))(_0xae35('0x8'));var config=require('../../config/environment');var jayson=require(_0xae35('0x9'));var client=jayson[_0xae35('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1927a4,_0x29f9b6,_0x4fc4d2){return new BPromise(function(_0x2b4a3d,_0x161f1c){return client[_0xae35('0xb')](_0x1927a4,_0x4fc4d2)[_0xae35('0xc')](function(_0x43593a){logger['info'](_0xae35('0xd'),_0x29f9b6,_0xae35('0xe'));logger[_0xae35('0xf')](_0xae35('0x10'),_0x29f9b6,_0xae35('0xe'),JSON[_0xae35('0x11')](_0x43593a));if(_0x43593a[_0xae35('0x12')]){if(_0x43593a['error'][_0xae35('0x13')]===0x1f4){logger[_0xae35('0x12')](_0xae35('0xd'),_0x29f9b6,_0x43593a[_0xae35('0x12')][_0xae35('0x14')]);return _0x161f1c(_0x43593a['error'][_0xae35('0x14')]);}logger[_0xae35('0x12')](_0xae35('0xd'),_0x29f9b6,_0x43593a['error'][_0xae35('0x14')]);return _0x2b4a3d(_0x43593a[_0xae35('0x12')][_0xae35('0x14')]);}else{logger[_0xae35('0x15')]('ReportAgentPreview,\x20%s,\x20%s',_0x29f9b6,_0xae35('0xe'));_0x2b4a3d(_0x43593a['result'][_0xae35('0x14')]);}})[_0xae35('0x16')](function(_0x33b544){logger[_0xae35('0x12')](_0xae35('0xd'),_0x29f9b6,_0x33b544);_0x161f1c(_0x33b544);});});}exports[_0xae35('0x17')]=function(_0x353777){var _0x19736d=this;return new Promise(function(_0x297794,_0x5ccc4b){return db['ReportAgentPreview'][_0xae35('0x18')](_0x353777[_0xae35('0x19')],{'raw':_0x353777[_0xae35('0x1a')]?_0x353777[_0xae35('0x1a')][_0xae35('0x1b')]===undefined?!![]:![]:!![]})['then'](function(_0x569c9a){logger[_0xae35('0x15')](_0xae35('0x17'),_0x353777);logger['debug'](_0xae35('0x17'),_0x353777,JSON[_0xae35('0x11')](_0x569c9a));_0x297794(_0x569c9a);})[_0xae35('0x16')](function(_0x25a76f){logger[_0xae35('0x12')]('CreateReportAgentPreview',_0x25a76f[_0xae35('0x14')],_0x353777);_0x5ccc4b(_0x19736d['error'](0x1f4,_0x25a76f[_0xae35('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/rpc/index.js b/server/api/rpc/index.js index 147703c..380c5a0 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 _0x991a=['/campaigns','campaigns','/fax/accounts','faxAccounts','/mail/queues/waitinginteractions','mailQueuesWaitingInteractions','/openchannel/queues/waitinginteractions','openchannelQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','/sms/queues/waitinginteractions','smsQueuesWaitingInteractions','/whatsapp/queues/waitinginteractions','whatsappQueuesWaitingInteractions','/fax/queues/waitinginteractions','faxQueuesWaitingInteractions','post','mail','queueNotify','chat','/chat/queues/:id','showChatQueues','/fax/queues/:id/notify','/fax/queues/:id','showFaxQueues','/openchannel/queues/:id/notify','openchannel','/openchannel/queues/:id','showOpenchannelQueues','/sms/queues/:id/notify','sms','whatsapp','/sms/queues/:id','/whatsapp/queues/:id','showWhatsappQueues','agentNotify','exports','multer','util','express','Router','../../components/auth/service','./rpc.controller','/voice/channels','voiceChannels','isAuthenticated','get','/voice/channels/:uniqueid/stopmixmonitor','voiceChannelStopMixMonitor','/chat/queues','chatQueues','mailQueues','/mail/accounts','/openchannel/queues','openchannelQueues','/sms/queues','/whatsapp/queues','whatsappQueues','/fax/queues','faxQueues','/voice/queues/preview/:id','voiceQueuesPreview','/voice/queues/channels','voiceQueuesChannels','/voice/queues/channels/:uniqueid','/voice/queues/channels/:uniqueid/hangup','/voice/queues/channels/:uniqueid/redirect/:exten','showVoiceQueues','put','/outbound','/outbound/channels','/agents','agents','/telephones','telephones','/trunks','trunks'];(function(_0x25e7cb,_0x3579b7){var _0x375d92=function(_0xe8cf3b){while(--_0xe8cf3b){_0x25e7cb['push'](_0x25e7cb['shift']());}};_0x375d92(++_0x3579b7);}(_0x991a,0x1ec));var _0xa991=function(_0x479793,_0x465d54){_0x479793=_0x479793-0x0;var _0x3c3487=_0x991a[_0x479793];return _0x3c3487;};'use strict';var multer=require(_0xa991('0x0'));var util=require(_0xa991('0x1'));var path=require('path');var express=require(_0xa991('0x2'));var router=express[_0xa991('0x3')]();var auth=require(_0xa991('0x4'));var controller=require(_0xa991('0x5'));router['get'](_0xa991('0x6'),auth['isAuthenticated'](),controller[_0xa991('0x7')]);router['get']('/voice/channels/:uniqueid/mixmonitor',auth[_0xa991('0x8')](),controller['voiceChannelMixMonitor']);router[_0xa991('0x9')](_0xa991('0xa'),auth[_0xa991('0x8')](),controller[_0xa991('0xb')]);router[_0xa991('0x9')]('/voice/queues',auth[_0xa991('0x8')](),controller['voiceQueues']);router['get'](_0xa991('0xc'),auth[_0xa991('0x8')](),controller[_0xa991('0xd')]);router[_0xa991('0x9')]('/mail/queues',auth[_0xa991('0x8')](),controller[_0xa991('0xe')]);router[_0xa991('0x9')](_0xa991('0xf'),auth[_0xa991('0x8')](),controller['mailAccounts']);router['get'](_0xa991('0x10'),auth[_0xa991('0x8')](),controller[_0xa991('0x11')]);router['get'](_0xa991('0x12'),auth[_0xa991('0x8')](),controller['smsQueues']);router[_0xa991('0x9')](_0xa991('0x13'),auth[_0xa991('0x8')](),controller[_0xa991('0x14')]);router[_0xa991('0x9')](_0xa991('0x15'),auth['isAuthenticated'](),controller[_0xa991('0x16')]);router[_0xa991('0x9')](_0xa991('0x17'),auth[_0xa991('0x8')](),controller[_0xa991('0x18')]);router[_0xa991('0x9')](_0xa991('0x19'),auth[_0xa991('0x8')](),controller[_0xa991('0x1a')]);router['get'](_0xa991('0x1b'),auth[_0xa991('0x8')](),controller['voiceQueuesChannel']);router[_0xa991('0x9')](_0xa991('0x1c'),auth[_0xa991('0x8')](),controller['voiceQueuesChannelHangup']);router[_0xa991('0x9')](_0xa991('0x1d'),auth['isAuthenticated'](),controller['voiceQueuesChannelRedirect']);router['get']('/voice/queues/:id',auth['isAuthenticated'](),controller[_0xa991('0x1e')]);router[_0xa991('0x1f')]('/voice/queues/:id',auth[_0xa991('0x8')](),controller['updateVoiceQueue']);router['get'](_0xa991('0x20'),auth['isAuthenticated'](),controller['outbound']);router['get'](_0xa991('0x21'),auth[_0xa991('0x8')](),controller['outboundChannels']);router[_0xa991('0x9')](_0xa991('0x22'),auth[_0xa991('0x8')](),controller[_0xa991('0x23')]);router['put']('/agents/:id/capacity',auth[_0xa991('0x8')](),controller['agentCapacity']);router[_0xa991('0x9')](_0xa991('0x24'),auth[_0xa991('0x8')](),controller[_0xa991('0x25')]);router[_0xa991('0x9')](_0xa991('0x26'),auth[_0xa991('0x8')](),controller[_0xa991('0x27')]);router[_0xa991('0x9')](_0xa991('0x28'),auth[_0xa991('0x8')](),controller[_0xa991('0x29')]);router[_0xa991('0x9')](_0xa991('0x2a'),auth['isAuthenticated'](),controller[_0xa991('0x2b')]);router['get']('/chat/queues/waitinginteractions',auth[_0xa991('0x8')](),controller['chatQueuesWaitingInteractions']);router[_0xa991('0x9')](_0xa991('0x2c'),auth[_0xa991('0x8')](),controller[_0xa991('0x2d')]);router[_0xa991('0x9')](_0xa991('0x2e'),auth['isAuthenticated'](),controller[_0xa991('0x2f')]);router[_0xa991('0x9')]('/openchannel/queues/:id/waitinginteractions',auth['isAuthenticated'](),controller[_0xa991('0x30')]);router[_0xa991('0x9')](_0xa991('0x31'),auth[_0xa991('0x8')](),controller[_0xa991('0x32')]);router[_0xa991('0x9')](_0xa991('0x33'),auth[_0xa991('0x8')](),controller[_0xa991('0x34')]);router[_0xa991('0x9')](_0xa991('0x35'),auth['isAuthenticated'](),controller[_0xa991('0x36')]);router[_0xa991('0x37')]('/mail/queues/:id/notify',auth[_0xa991('0x8')](),controller['queueNotify'](_0xa991('0x38')));router[_0xa991('0x9')]('/mail/queues/:id',auth['isAuthenticated'](),controller['showMailQueues']);router[_0xa991('0x37')]('/chat/queues/:id/notify',auth[_0xa991('0x8')](),controller[_0xa991('0x39')](_0xa991('0x3a')));router[_0xa991('0x9')](_0xa991('0x3b'),auth[_0xa991('0x8')](),controller[_0xa991('0x3c')]);router[_0xa991('0x37')](_0xa991('0x3d'),auth['isAuthenticated'](),controller['queueNotify']('fax'));router['get'](_0xa991('0x3e'),auth[_0xa991('0x8')](),controller[_0xa991('0x3f')]);router['post'](_0xa991('0x40'),auth[_0xa991('0x8')](),controller['queueNotify'](_0xa991('0x41')));router['get'](_0xa991('0x42'),auth[_0xa991('0x8')](),controller[_0xa991('0x43')]);router['post'](_0xa991('0x44'),auth[_0xa991('0x8')](),controller[_0xa991('0x39')](_0xa991('0x45')));router[_0xa991('0x37')]('/whatsapp/queues/:id/notify',auth[_0xa991('0x8')](),controller['queueNotify'](_0xa991('0x46')));router[_0xa991('0x9')](_0xa991('0x47'),auth[_0xa991('0x8')](),controller['showSmsQueues']);router[_0xa991('0x9')](_0xa991('0x48'),auth[_0xa991('0x8')](),controller[_0xa991('0x49')]);router[_0xa991('0x37')]('/agents/:id/notify',auth[_0xa991('0x8')](),controller[_0xa991('0x4a')]);module[_0xa991('0x4b')]=router; \ No newline at end of file +var _0xa647=['/sms/queues','smsQueues','/whatsapp/queues','whatsappQueues','/fax/queues','faxQueues','/voice/queues/preview/:id','/voice/queues/channels','voiceQueuesChannels','/voice/queues/channels/:uniqueid','voiceQueuesChannel','/voice/queues/channels/:uniqueid/hangup','voiceQueuesChannelHangup','/voice/queues/channels/:uniqueid/redirect/:exten','showVoiceQueues','put','/voice/queues/:id','/outbound','outbound','/outbound/channels','outboundChannels','/agents/:id/capacity','agentCapacity','telephones','/trunks','trunks','/campaigns','campaigns','/fax/accounts','faxAccounts','/mail/queues/waitinginteractions','mailQueuesWaitingInteractions','/openchannel/queues/waitinginteractions','openchannelQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','smsQueuesWaitingInteractions','/whatsapp/queues/waitinginteractions','/fax/queues/waitinginteractions','faxQueuesWaitingInteractions','post','/mail/queues/:id/notify','queueNotify','mail','showMailQueues','/chat/queues/:id/notify','chat','/chat/queues/:id','showChatQueues','/fax/queues/:id/notify','fax','/fax/queues/:id','showFaxQueues','/openchannel/queues/:id/notify','openchannel','/openchannel/queues/:id','showOpenchannelQueues','/sms/queues/:id/notify','sms','/whatsapp/queues/:id/notify','/sms/queues/:id','showSmsQueues','/whatsapp/queues/:id','showWhatsappQueues','/agents/:id/notify','agentNotify','exports','util','path','../../components/auth/service','./rpc.controller','voiceChannels','get','/voice/channels/:uniqueid/mixmonitor','voiceChannelMixMonitor','/voice/channels/:uniqueid/stopmixmonitor','isAuthenticated','voiceQueues','chatQueues','/mail/queues','mailQueues','/openchannel/queues','openchannelQueues'];(function(_0x388868,_0x520a06){var _0x41a3a4=function(_0xddf288){while(--_0xddf288){_0x388868['push'](_0x388868['shift']());}};_0x41a3a4(++_0x520a06);}(_0xa647,0x18a));var _0x7a64=function(_0x5817f0,_0x164806){_0x5817f0=_0x5817f0-0x0;var _0x2285cb=_0xa647[_0x5817f0];return _0x2285cb;};'use strict';var multer=require('multer');var util=require(_0x7a64('0x0'));var path=require(_0x7a64('0x1'));var express=require('express');var router=express['Router']();var auth=require(_0x7a64('0x2'));var controller=require(_0x7a64('0x3'));router['get']('/voice/channels',auth['isAuthenticated'](),controller[_0x7a64('0x4')]);router[_0x7a64('0x5')](_0x7a64('0x6'),auth['isAuthenticated'](),controller[_0x7a64('0x7')]);router[_0x7a64('0x5')](_0x7a64('0x8'),auth[_0x7a64('0x9')](),controller['voiceChannelStopMixMonitor']);router[_0x7a64('0x5')]('/voice/queues',auth[_0x7a64('0x9')](),controller[_0x7a64('0xa')]);router[_0x7a64('0x5')]('/chat/queues',auth[_0x7a64('0x9')](),controller[_0x7a64('0xb')]);router[_0x7a64('0x5')](_0x7a64('0xc'),auth[_0x7a64('0x9')](),controller[_0x7a64('0xd')]);router[_0x7a64('0x5')]('/mail/accounts',auth['isAuthenticated'](),controller['mailAccounts']);router[_0x7a64('0x5')](_0x7a64('0xe'),auth[_0x7a64('0x9')](),controller[_0x7a64('0xf')]);router[_0x7a64('0x5')](_0x7a64('0x10'),auth[_0x7a64('0x9')](),controller[_0x7a64('0x11')]);router[_0x7a64('0x5')](_0x7a64('0x12'),auth['isAuthenticated'](),controller[_0x7a64('0x13')]);router[_0x7a64('0x5')](_0x7a64('0x14'),auth[_0x7a64('0x9')](),controller[_0x7a64('0x15')]);router['get'](_0x7a64('0x16'),auth[_0x7a64('0x9')](),controller['voiceQueuesPreview']);router[_0x7a64('0x5')](_0x7a64('0x17'),auth[_0x7a64('0x9')](),controller[_0x7a64('0x18')]);router[_0x7a64('0x5')](_0x7a64('0x19'),auth[_0x7a64('0x9')](),controller[_0x7a64('0x1a')]);router[_0x7a64('0x5')](_0x7a64('0x1b'),auth['isAuthenticated'](),controller[_0x7a64('0x1c')]);router[_0x7a64('0x5')](_0x7a64('0x1d'),auth[_0x7a64('0x9')](),controller['voiceQueuesChannelRedirect']);router[_0x7a64('0x5')]('/voice/queues/:id',auth[_0x7a64('0x9')](),controller[_0x7a64('0x1e')]);router[_0x7a64('0x1f')](_0x7a64('0x20'),auth[_0x7a64('0x9')](),controller['updateVoiceQueue']);router['get'](_0x7a64('0x21'),auth[_0x7a64('0x9')](),controller[_0x7a64('0x22')]);router[_0x7a64('0x5')](_0x7a64('0x23'),auth[_0x7a64('0x9')](),controller[_0x7a64('0x24')]);router['get']('/agents',auth[_0x7a64('0x9')](),controller['agents']);router[_0x7a64('0x1f')](_0x7a64('0x25'),auth[_0x7a64('0x9')](),controller[_0x7a64('0x26')]);router['get']('/telephones',auth[_0x7a64('0x9')](),controller[_0x7a64('0x27')]);router[_0x7a64('0x5')](_0x7a64('0x28'),auth[_0x7a64('0x9')](),controller[_0x7a64('0x29')]);router['get'](_0x7a64('0x2a'),auth['isAuthenticated'](),controller[_0x7a64('0x2b')]);router[_0x7a64('0x5')](_0x7a64('0x2c'),auth[_0x7a64('0x9')](),controller[_0x7a64('0x2d')]);router[_0x7a64('0x5')]('/chat/queues/waitinginteractions',auth[_0x7a64('0x9')](),controller['chatQueuesWaitingInteractions']);router[_0x7a64('0x5')](_0x7a64('0x2e'),auth[_0x7a64('0x9')](),controller[_0x7a64('0x2f')]);router[_0x7a64('0x5')](_0x7a64('0x30'),auth[_0x7a64('0x9')](),controller[_0x7a64('0x31')]);router['get']('/openchannel/queues/:id/waitinginteractions',auth[_0x7a64('0x9')](),controller[_0x7a64('0x32')]);router[_0x7a64('0x5')]('/sms/queues/waitinginteractions',auth[_0x7a64('0x9')](),controller[_0x7a64('0x33')]);router[_0x7a64('0x5')](_0x7a64('0x34'),auth[_0x7a64('0x9')](),controller['whatsappQueuesWaitingInteractions']);router[_0x7a64('0x5')](_0x7a64('0x35'),auth['isAuthenticated'](),controller[_0x7a64('0x36')]);router[_0x7a64('0x37')](_0x7a64('0x38'),auth[_0x7a64('0x9')](),controller[_0x7a64('0x39')](_0x7a64('0x3a')));router[_0x7a64('0x5')]('/mail/queues/:id',auth[_0x7a64('0x9')](),controller[_0x7a64('0x3b')]);router[_0x7a64('0x37')](_0x7a64('0x3c'),auth[_0x7a64('0x9')](),controller[_0x7a64('0x39')](_0x7a64('0x3d')));router[_0x7a64('0x5')](_0x7a64('0x3e'),auth[_0x7a64('0x9')](),controller[_0x7a64('0x3f')]);router[_0x7a64('0x37')](_0x7a64('0x40'),auth[_0x7a64('0x9')](),controller[_0x7a64('0x39')](_0x7a64('0x41')));router[_0x7a64('0x5')](_0x7a64('0x42'),auth['isAuthenticated'](),controller[_0x7a64('0x43')]);router['post'](_0x7a64('0x44'),auth['isAuthenticated'](),controller[_0x7a64('0x39')](_0x7a64('0x45')));router[_0x7a64('0x5')](_0x7a64('0x46'),auth[_0x7a64('0x9')](),controller[_0x7a64('0x47')]);router[_0x7a64('0x37')](_0x7a64('0x48'),auth[_0x7a64('0x9')](),controller['queueNotify'](_0x7a64('0x49')));router[_0x7a64('0x37')](_0x7a64('0x4a'),auth[_0x7a64('0x9')](),controller[_0x7a64('0x39')]('whatsapp'));router[_0x7a64('0x5')](_0x7a64('0x4b'),auth[_0x7a64('0x9')](),controller[_0x7a64('0x4c')]);router['get'](_0x7a64('0x4d'),auth[_0x7a64('0x9')](),controller[_0x7a64('0x4e')]);router[_0x7a64('0x37')](_0x7a64('0x4f'),auth[_0x7a64('0x9')](),controller[_0x7a64('0x50')]);module[_0x7a64('0x51')]=router; \ No newline at end of file diff --git a/server/api/rpc/rpc.controller.js b/server/api/rpc/rpc.controller.js index 058cea6..d1fe352 100644 --- a/server/api/rpc/rpc.controller.js +++ b/server/api/rpc/rpc.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe706=['indexOf','queue_id','smsQueuesWaitingInteractions','SmsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','FaxQueuesWaitingInteractions','queueNotify','capitalize','Website','Queue','\x20Queue\x20not\x20found','Message','findOne','Interaction','Account','update','queue','MessageId','InteractionId','TransferReport','*,*,*,*','agentNotify','channel','Channel\x20field\x20is\x20mandatory','chat','User','Agent\x20not\x20found','messageId','\x20Message\x20not\x20found','From','create','Start','agentTransferTimeout','bluebird','moment','lodash','../../mysqldb','../../config/logger','api','jayson/promise','client','http','request','then','error','code','message','result','catch','status','json','name','send','isNil','rows','VoiceChannels','query','voiceChannelMixMonitor','VoiceChannelMixMonitor','merge','params','VoiceChannelStopMixMonitor','voiceQueues','VoiceQueues','showVoiceQueues','UpdateVoiceQueue','body','voiceQueuesPreview','VoiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannels','VoiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','voiceQueuesChannelRedirect','VoiceQueuesChannelRedirect','Outbound','outboundChannels','OutboundChannels','agents','Agents','agentCapacity','user','hasOwnProperty','MemberReport','findAll','INTERACTION','interaction','length','format','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','SIP/%s','interface','agent','internal','capacity','Telephones','trunks','Trunks','campaigns','Campaigns','chatQueues','ChatQueues','showChatQueues','mailQueues','MailQueues','showMailQueues','OpenchannelQueues','showOpenchannelQueues','showSmsQueues','SmsQueues','whatsappQueues','WhatsappQueues','faxQueues','showFaxQueues','faxAccounts','FaxAccounts','chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','type','filter','uniq'];(function(_0x1c7d78,_0x2da8fc){var _0x35b263=function(_0x471d64){while(--_0x471d64){_0x1c7d78['push'](_0x1c7d78['shift']());}};_0x35b263(++_0x2da8fc);}(_0xe706,0xa3));var _0x6e70=function(_0x5f5497,_0x50803a){_0x5f5497=_0x5f5497-0x0;var _0x10e943=_0xe706[_0x5f5497];return _0x10e943;};'use strict';var BPromise=require(_0x6e70('0x0'));var moment=require(_0x6e70('0x1'));var _=require(_0x6e70('0x2'));var util=require('util');var db=require(_0x6e70('0x3'))['db'];var logger=require(_0x6e70('0x4'))(_0x6e70('0x5'));var jayson=require(_0x6e70('0x6'));var amiClient=jayson[_0x6e70('0x7')][_0x6e70('0x8')]({'port':0x232a});var mailClient=jayson[_0x6e70('0x7')][_0x6e70('0x8')]({'port':0x232b});var routingClient=jayson[_0x6e70('0x7')][_0x6e70('0x8')]({'port':0x232c});function respondWithRpcPromise(_0x36357b,_0x293ce7,_0x45a2d4){return new BPromise(function(_0x188ed3,_0x3c4843){var _0x449b48=_0x45a2d4?_0x45a2d4:amiClient;return _0x449b48[_0x6e70('0x9')](_0x36357b,_0x293ce7)[_0x6e70('0xa')](function(_0x100eb7){if(_0x100eb7[_0x6e70('0xb')]){if(_0x100eb7[_0x6e70('0xb')][_0x6e70('0xc')]===0x1f4){return _0x3c4843(_0x100eb7[_0x6e70('0xb')][_0x6e70('0xd')]);}return _0x188ed3(_0x100eb7['error']['message']);}else{_0x188ed3(_0x100eb7[_0x6e70('0xe')]);}})[_0x6e70('0xf')](function(_0x18cf27){_0x3c4843(_0x18cf27);});});}function respondWithResult(_0x27dd9b,_0x3b38f3){_0x3b38f3=_0x3b38f3||0xc8;return function(_0x310eb7){if(_0x310eb7){return _0x27dd9b[_0x6e70('0x10')](_0x3b38f3)[_0x6e70('0x11')](_0x310eb7);}return _0x27dd9b['sendStatus'](0x194);};}function handleError(_0x52737e,_0x48bc72){_0x48bc72=_0x48bc72||0x1f4;return function(_0x257e81){logger['error'](_0x257e81['stack']);if(_0x257e81[_0x6e70('0x12')]){delete _0x257e81[_0x6e70('0x12')];}_0x52737e['status'](_0x48bc72)[_0x6e70('0x13')](_0x257e81);};}function findById(_0x5c3fe7){return function(_0x2efc0f){if(!_[_0x6e70('0x14')](_0x5c3fe7)&&!_['isNil'](_0x2efc0f)&&!_['isNil'](_0x2efc0f[_0x6e70('0x15')])){return _['find'](_0x2efc0f[_0x6e70('0x15')],function(_0x173afe){return _0x173afe['id']==_0x5c3fe7;});}return null;};}exports['voiceChannels']=function(_0x497d61,_0xc238ba){return respondWithRpcPromise(_0x6e70('0x16'),_0x497d61[_0x6e70('0x17')])[_0x6e70('0xa')](respondWithResult(_0xc238ba,null))[_0x6e70('0xf')](handleError(_0xc238ba,null));};exports[_0x6e70('0x18')]=function(_0x1b2453,_0x44a49f){return respondWithRpcPromise(_0x6e70('0x19'),_[_0x6e70('0x1a')](_0x1b2453['query'],_0x1b2453[_0x6e70('0x1b')]))[_0x6e70('0xa')](respondWithResult(_0x44a49f,null))[_0x6e70('0xf')](handleError(_0x44a49f,null));};exports['voiceChannelStopMixMonitor']=function(_0x3ccd87,_0xa5d49){return respondWithRpcPromise(_0x6e70('0x1c'),_['merge'](_0x3ccd87[_0x6e70('0x17')],_0x3ccd87['params']))['then'](respondWithResult(_0xa5d49,null))['catch'](handleError(_0xa5d49,null));};exports[_0x6e70('0x1d')]=function(_0x19c5ae,_0x51d292){return respondWithRpcPromise(_0x6e70('0x1e'),_0x19c5ae[_0x6e70('0x17')])['then'](respondWithResult(_0x51d292,null))[_0x6e70('0xf')](handleError(_0x51d292,null));};exports[_0x6e70('0x1f')]=function(_0x2bb231,_0x4a67ac){return respondWithRpcPromise('VoiceQueues',_0x2bb231[_0x6e70('0x17')])[_0x6e70('0xa')](findById(_0x2bb231[_0x6e70('0x1b')]['id']))[_0x6e70('0xa')](respondWithResult(_0x4a67ac,null))[_0x6e70('0xf')](handleError(_0x4a67ac,null));};exports['updateVoiceQueue']=function(_0x1952ea,_0x406f29){return respondWithRpcPromise(_0x6e70('0x20'),_[_0x6e70('0x1a')](_0x1952ea[_0x6e70('0x21')],_0x1952ea[_0x6e70('0x1b')]))[_0x6e70('0xa')](respondWithResult(_0x406f29,null))[_0x6e70('0xf')](handleError(_0x406f29,null));};exports[_0x6e70('0x22')]=function(_0x3a5d30,_0x4b1229){return respondWithRpcPromise(_0x6e70('0x23'),_['merge'](_0x3a5d30[_0x6e70('0x17')],_0x3a5d30['params']))[_0x6e70('0xa')](respondWithResult(_0x4b1229,null))[_0x6e70('0xf')](handleError(_0x4b1229,null));};exports[_0x6e70('0x24')]=function(_0x56f6f7,_0x38c40d){return respondWithRpcPromise(_0x6e70('0x25'),_0x56f6f7['query'])[_0x6e70('0xa')](respondWithResult(_0x38c40d,null))[_0x6e70('0xf')](handleError(_0x38c40d,null));};exports['voiceQueuesChannel']=function(_0x10d8f6,_0x3665a1){return respondWithRpcPromise(_0x6e70('0x26'),_[_0x6e70('0x1a')](_0x10d8f6[_0x6e70('0x17')],_0x10d8f6[_0x6e70('0x1b')]))[_0x6e70('0xa')](respondWithResult(_0x3665a1,null))[_0x6e70('0xf')](handleError(_0x3665a1,null));};exports[_0x6e70('0x27')]=function(_0x419a41,_0x4d32d8){return respondWithRpcPromise(_0x6e70('0x28'),_['merge'](_0x419a41[_0x6e70('0x17')],_0x419a41[_0x6e70('0x1b')]))[_0x6e70('0xa')](respondWithResult(_0x4d32d8,null))[_0x6e70('0xf')](handleError(_0x4d32d8,null));};exports[_0x6e70('0x29')]=function(_0x989b80,_0x2440be){return respondWithRpcPromise(_0x6e70('0x2a'),_[_0x6e70('0x1a')](_0x989b80[_0x6e70('0x17')],_0x989b80[_0x6e70('0x1b')]))[_0x6e70('0xa')](respondWithResult(_0x2440be,null))[_0x6e70('0xf')](handleError(_0x2440be,null));};exports['outbound']=function(_0x5446a2,_0x5424eb){return respondWithRpcPromise(_0x6e70('0x2b'),_0x5446a2[_0x6e70('0x17')])[_0x6e70('0xa')](respondWithResult(_0x5424eb,null))[_0x6e70('0xf')](handleError(_0x5424eb,null));};exports[_0x6e70('0x2c')]=function(_0x3bdd87,_0x572a71){return respondWithRpcPromise(_0x6e70('0x2d'),_0x3bdd87[_0x6e70('0x17')])[_0x6e70('0xa')](respondWithResult(_0x572a71,null))[_0x6e70('0xf')](handleError(_0x572a71,null));};exports[_0x6e70('0x2e')]=function(_0x37bf46,_0x246e61){var _0x16fc7d;return respondWithRpcPromise('Agents',_0x37bf46[_0x6e70('0x17')])[_0x6e70('0xa')](function(_0x22fce9){_0x16fc7d=_0x22fce9;return respondWithRpcPromise(_0x6e70('0x2f'),_0x37bf46[_0x6e70('0x17')],routingClient);})[_0x6e70('0xa')](function(_0x21b0e7){return _['merge']({},_0x21b0e7,_0x16fc7d);})['then'](respondWithResult(_0x246e61,null))['catch'](handleError(_0x246e61,null));};exports[_0x6e70('0x30')]=function(_0x2b63cc,_0x83847b){if(_0x2b63cc[_0x6e70('0x21')]&&_0x2b63cc[_0x6e70('0x21')]['interaction']&&_0x2b63cc[_0x6e70('0x31')]&&_0x2b63cc[_0x6e70('0x31')][_0x6e70('0x12')]){for(var _0x52b197 in _0x2b63cc['body']['interaction']){if(_0x2b63cc[_0x6e70('0x21')]['interaction'][_0x6e70('0x32')](_0x52b197)){db[_0x6e70('0x33')][_0x6e70('0x34')]({'where':{'channel':_0x52b197,'membername':_0x2b63cc[_0x6e70('0x31')]['name'],'type':_0x6e70('0x35'),'exitAt':null,'uniqueid':_0x2b63cc['body'][_0x6e70('0x36')][_0x52b197]&&_0x2b63cc[_0x6e70('0x21')][_0x6e70('0x36')][_0x52b197][_0x6e70('0x37')]?{'$notIn':_0x2b63cc['body'][_0x6e70('0x36')][_0x52b197]}:{'$ne':null}}})[_0x6e70('0xa')](function(_0x3d39c3){var _0xac87d6=moment()[_0x6e70('0x38')](_0x6e70('0x39'));for(var _0x3d9c5=0x0,_0x552e7e=_0x3d39c3[_0x6e70('0x37')];_0x3d9c5<_0x552e7e;_0x3d9c5+=0x1){_0x3d39c3[_0x3d9c5][_0x6e70('0x3a')]({'exitAt':_0xac87d6});}});for(var _0x10de2a=0x0;_0x10de2a<_0x2b63cc[_0x6e70('0x21')][_0x6e70('0x36')][_0x52b197][_0x6e70('0x37')];_0x10de2a+=0x1){db[_0x6e70('0x33')]['findOrCreate']({'where':{'channel':_0x52b197,'membername':_0x2b63cc[_0x6e70('0x31')]['name'],'type':_0x6e70('0x35'),'uniqueid':_0x2b63cc[_0x6e70('0x21')]['interaction'][_0x52b197][_0x10de2a],'exitAt':null},'defaults':{'channel':_0x52b197,'membername':_0x2b63cc['user'][_0x6e70('0x12')],'interface':_[_0x6e70('0x14')](_0x2b63cc[_0x6e70('0x31')]['interface'])?util['format'](_0x6e70('0x3b'),_0x2b63cc[_0x6e70('0x31')][_0x6e70('0x12')]):_0x2b63cc[_0x6e70('0x31')][_0x6e70('0x3c')],'type':_0x6e70('0x35'),'enterAt':moment()['format'](_0x6e70('0x39')),'role':_0x6e70('0x3d'),'internal':_0x2b63cc[_0x6e70('0x31')][_0x6e70('0x3e')],'uniqueid':_0x2b63cc[_0x6e70('0x21')]['interaction'][_0x52b197][_0x10de2a]}});}}}}return respondWithRpcPromise('AgentCapacity',{'id':_0x2b63cc[_0x6e70('0x1b')]['id'],'capacity':_0x2b63cc[_0x6e70('0x21')][_0x6e70('0x3f')]},routingClient)[_0x6e70('0xa')](respondWithResult(_0x83847b,null))[_0x6e70('0xf')](handleError(_0x83847b,null));};exports['telephones']=function(_0x41bd0b,_0x232366){return respondWithRpcPromise(_0x6e70('0x40'),_0x41bd0b[_0x6e70('0x17')])[_0x6e70('0xa')](respondWithResult(_0x232366,null))['catch'](handleError(_0x232366,null));};exports[_0x6e70('0x41')]=function(_0x1dd242,_0x2c20d3){return respondWithRpcPromise(_0x6e70('0x42'),_0x1dd242[_0x6e70('0x17')])[_0x6e70('0xa')](respondWithResult(_0x2c20d3,null))['catch'](handleError(_0x2c20d3,null));};exports[_0x6e70('0x43')]=function(_0x8d425d,_0x5c2396){return respondWithRpcPromise(_0x6e70('0x44'),_0x8d425d[_0x6e70('0x17')])['then'](respondWithResult(_0x5c2396,null))[_0x6e70('0xf')](handleError(_0x5c2396,null));};exports[_0x6e70('0x45')]=function(_0x2134c4,_0x46d536){return respondWithRpcPromise(_0x6e70('0x46'),_0x2134c4['query'],routingClient)[_0x6e70('0xa')](respondWithResult(_0x46d536,null))[_0x6e70('0xf')](handleError(_0x46d536,null));};exports[_0x6e70('0x47')]=function(_0x13be81,_0x1c02d7){return respondWithRpcPromise(_0x6e70('0x46'),_0x13be81[_0x6e70('0x17')],routingClient)[_0x6e70('0xa')](findById(_0x13be81[_0x6e70('0x1b')]['id']))[_0x6e70('0xa')](respondWithResult(_0x1c02d7,null))[_0x6e70('0xf')](handleError(_0x1c02d7,null));};exports[_0x6e70('0x48')]=function(_0xb8f78,_0x1fd9a6){return respondWithRpcPromise(_0x6e70('0x49'),_0xb8f78[_0x6e70('0x17')],routingClient)[_0x6e70('0xa')](respondWithResult(_0x1fd9a6,null))[_0x6e70('0xf')](handleError(_0x1fd9a6,null));};exports[_0x6e70('0x4a')]=function(_0x1c7dca,_0x4c6aab){return respondWithRpcPromise(_0x6e70('0x49'),_0x1c7dca[_0x6e70('0x17')],routingClient)[_0x6e70('0xa')](findById(_0x1c7dca[_0x6e70('0x1b')]['id']))[_0x6e70('0xa')](respondWithResult(_0x4c6aab,null))[_0x6e70('0xf')](handleError(_0x4c6aab,null));};exports['mailAccounts']=function(_0x42bd85,_0x6cabf0){return respondWithRpcPromise('MailAccounts',_0x42bd85[_0x6e70('0x17')],mailClient)[_0x6e70('0xa')](respondWithResult(_0x6cabf0,null))[_0x6e70('0xf')](handleError(_0x6cabf0,null));};exports['openchannelQueues']=function(_0x51f268,_0x2f9be4){return respondWithRpcPromise(_0x6e70('0x4b'),_0x51f268[_0x6e70('0x17')],routingClient)[_0x6e70('0xa')](respondWithResult(_0x2f9be4,null))[_0x6e70('0xf')](handleError(_0x2f9be4,null));};exports[_0x6e70('0x4c')]=function(_0x30cd88,_0x57bfe5){return respondWithRpcPromise('OpenchannelQueues',_0x30cd88[_0x6e70('0x17')],routingClient)[_0x6e70('0xa')](findById(_0x30cd88[_0x6e70('0x1b')]['id']))[_0x6e70('0xa')](respondWithResult(_0x57bfe5,null))['catch'](handleError(_0x57bfe5,null));};exports['smsQueues']=function(_0x2e972b,_0x4e5545){return respondWithRpcPromise('SmsQueues',_0x2e972b['query'],routingClient)[_0x6e70('0xa')](respondWithResult(_0x4e5545,null))['catch'](handleError(_0x4e5545,null));};exports[_0x6e70('0x4d')]=function(_0x23900b,_0x3b4da0){return respondWithRpcPromise(_0x6e70('0x4e'),_0x23900b[_0x6e70('0x17')],routingClient)[_0x6e70('0xa')](findById(_0x23900b[_0x6e70('0x1b')]['id']))[_0x6e70('0xa')](respondWithResult(_0x3b4da0,null))['catch'](handleError(_0x3b4da0,null));};exports[_0x6e70('0x4f')]=function(_0x6a560f,_0x22c836){return respondWithRpcPromise(_0x6e70('0x50'),_0x6a560f[_0x6e70('0x17')],routingClient)['then'](respondWithResult(_0x22c836,null))['catch'](handleError(_0x22c836,null));};exports['showWhatsappQueues']=function(_0x1bb338,_0xd91b9){return respondWithRpcPromise(_0x6e70('0x50'),_0x1bb338['query'],routingClient)['then'](findById(_0x1bb338[_0x6e70('0x1b')]['id']))[_0x6e70('0xa')](respondWithResult(_0xd91b9,null))[_0x6e70('0xf')](handleError(_0xd91b9,null));};exports[_0x6e70('0x51')]=function(_0x2285f1,_0x32b884){return respondWithRpcPromise('FaxQueues',_0x2285f1[_0x6e70('0x17')],routingClient)[_0x6e70('0xa')](respondWithResult(_0x32b884,null))[_0x6e70('0xf')](handleError(_0x32b884,null));};exports[_0x6e70('0x52')]=function(_0x515c0c,_0xce964b){return respondWithRpcPromise('FaxQueues',_0x515c0c['query'],routingClient)[_0x6e70('0xa')](findById(_0x515c0c[_0x6e70('0x1b')]['id']))[_0x6e70('0xa')](respondWithResult(_0xce964b,null))[_0x6e70('0xf')](handleError(_0xce964b,null));};exports[_0x6e70('0x53')]=function(_0x2be0fc,_0x4b5b19){return respondWithRpcPromise(_0x6e70('0x54'),_0x2be0fc[_0x6e70('0x17')])[_0x6e70('0xa')](respondWithResult(_0x4b5b19,null))[_0x6e70('0xf')](handleError(_0x4b5b19,null));};exports[_0x6e70('0x55')]=function(_0x13c092,_0x363722){return respondWithRpcPromise(_0x6e70('0x56'),_0x13c092[_0x6e70('0x17')],routingClient)[_0x6e70('0xa')](respondWithResult(_0x363722,null))['catch'](handleError(_0x363722,null));};exports[_0x6e70('0x57')]=function(_0x303c5a,_0x577c3b){return respondWithRpcPromise('MailQueuesWaitingInteractions',_0x303c5a['query'],routingClient)[_0x6e70('0xa')](respondWithResult(_0x577c3b,null))[_0x6e70('0xf')](handleError(_0x577c3b,null));};exports[_0x6e70('0x58')]=function(_0x14bb74,_0x5a3dcb){return respondWithRpcPromise('OpenchannelQueuesWaitingInteractions',_0x14bb74['query'],routingClient)[_0x6e70('0xa')](respondWithResult(_0x5a3dcb,null))[_0x6e70('0xf')](handleError(_0x5a3dcb,null));};exports['openchannelQueuesIdWaitingInteractions']=function(_0x58666a,_0x1c7c5f){return respondWithRpcPromise(_0x6e70('0x59'),_0x58666a[_0x6e70('0x17')],routingClient)[_0x6e70('0xa')](function(_0x44bf96){if(_0x58666a[_0x6e70('0x17')][_0x6e70('0x5a')]!==undefined){var _0x3650e9=_(_0x44bf96[_0x6e70('0x15')])[_0x6e70('0x5b')]([_0x58666a[_0x6e70('0x17')][_0x6e70('0x5a')],_0x58666a[_0x6e70('0x1b')]['id']])['map']('queue_id')[_0x6e70('0x5c')]()['value']();return _0x44bf96[_0x6e70('0x15')]['filter'](function(_0x5b5471){return _0x3650e9[_0x6e70('0x5d')](_0x5b5471['queue_id'])>-0x1;});}else{return _0x44bf96['rows'][_0x6e70('0x5b')](function(_0x21e4c2){return _0x21e4c2[_0x6e70('0x5e')]===parseInt(_0x58666a['params']['id']);});}})['then'](respondWithResult(_0x1c7c5f,null))['catch'](handleError(_0x1c7c5f,null));};exports[_0x6e70('0x5f')]=function(_0x512b0a,_0x2e8ed3){return respondWithRpcPromise(_0x6e70('0x60'),_0x512b0a[_0x6e70('0x17')],routingClient)[_0x6e70('0xa')](respondWithResult(_0x2e8ed3,null))[_0x6e70('0xf')](handleError(_0x2e8ed3,null));};exports[_0x6e70('0x61')]=function(_0x214a8f,_0x50046a){return respondWithRpcPromise(_0x6e70('0x62'),_0x214a8f[_0x6e70('0x17')],routingClient)[_0x6e70('0xa')](respondWithResult(_0x50046a,null))['catch'](handleError(_0x50046a,null));};exports[_0x6e70('0x63')]=function(_0x227d94,_0x11a615){return respondWithRpcPromise(_0x6e70('0x64'),_0x227d94[_0x6e70('0x17')],routingClient)[_0x6e70('0xa')](respondWithResult(_0x11a615,null))[_0x6e70('0xf')](handleError(_0x11a615,null));};exports[_0x6e70('0x65')]=function(_0x461ec0){return function(_0x48f6fd,_0x463eed){var _0x39e6db,_0x53acc8;var _0x252f07=_[_0x6e70('0x66')](_0x461ec0);var _0x51be27=_0x461ec0==='chat'?_0x6e70('0x67'):'Account';return db[_0x252f07+_0x6e70('0x68')]['findOne']({'raw':!![],'where':{'id':_0x48f6fd[_0x6e70('0x1b')]['id']}})[_0x6e70('0xa')](function(_0x106f32){if(_[_0x6e70('0x14')](_0x106f32)){throw new Error(_0x252f07+_0x6e70('0x69'));}_0x39e6db=_0x106f32;return db[_0x252f07+_0x6e70('0x6a')][_0x6e70('0x6b')]({'where':{'id':_0x48f6fd['body']['messageId']},'include':[{'model':db[_0x252f07+_0x6e70('0x6c')],'as':'Interaction'},{'model':db[_0x252f07+_0x51be27],'as':_0x6e70('0x6d')}]});})[_0x6e70('0xa')](function(_0x28e5b1){if(_[_0x6e70('0x14')](_0x28e5b1)){throw new Error(_0x252f07+'\x20Message\x20not\x20found');}_0x53acc8=_0x28e5b1;return _0x28e5b1[_0x6e70('0x6e')]({'read':0x0,'readAt':null,'UserId':null});})['then'](function(){var _0x260dfa={'uniqueid':_0x461ec0+'.'+_0x53acc8['id']+'.'+_0x53acc8[_0x6e70('0x6c')]['id'],'FromUserId':_0x48f6fd[_0x6e70('0x31')]['id'],'type':_0x6e70('0x6f')};_0x260dfa[_0x252f07+_0x6e70('0x70')]=_0x53acc8['id'];_0x260dfa[_0x252f07+_0x6e70('0x71')]=_0x53acc8[_0x6e70('0x6c')]['id'];_0x260dfa['From'+_0x252f07+_0x51be27+'Id']=_0x53acc8[_0x6e70('0x6d')]['id'];_0x260dfa['To'+_0x252f07+'QueueId']=_0x39e6db['id'];return db[_0x252f07+_0x6e70('0x72')]['create'](_0x260dfa);})['then'](function(){return respondWithRpcPromise('Start',{'channel':_0x461ec0,'interaction':_0x53acc8[_0x6e70('0x6c')],'message':_0x53acc8,'account':_0x53acc8[_0x6e70('0x6d')],'applications':[{'id':0x0,'priority':0x1,'app':_0x6e70('0x6f'),'appdata':_0x39e6db[_0x6e70('0x12')]+','+(_0x53acc8[_0x6e70('0x6d')]['queueTransferTimeout']||0x12c),'interval':_0x6e70('0x73')}],'transfer':!![]},routingClient);})[_0x6e70('0xa')](respondWithResult(_0x463eed,null))['catch'](handleError(_0x463eed,null));};};exports[_0x6e70('0x74')]=function(_0x50e494,_0x17d3a4){var _0x5d0585,_0x4a87e2;if(_[_0x6e70('0x14')](_0x50e494[_0x6e70('0x21')][_0x6e70('0x75')])){throw new Error(_0x6e70('0x76'));}var _0x3e6661=_0x50e494[_0x6e70('0x21')][_0x6e70('0x75')];var _0x5c0276=_[_0x6e70('0x66')](_0x3e6661);var _0x4f4a16=_0x3e6661===_0x6e70('0x77')?_0x6e70('0x67'):_0x6e70('0x6d');return db[_0x6e70('0x78')][_0x6e70('0x6b')]({'raw':!![],'where':{'id':_0x50e494[_0x6e70('0x1b')]['id'],'role':_0x6e70('0x3d')}})['then'](function(_0x4466f0){if(_['isNil'](_0x4466f0)){throw new Error(_0x6e70('0x79'));}_0x5d0585=_0x4466f0;return db[_0x5c0276+_0x6e70('0x6a')][_0x6e70('0x6b')]({'where':{'id':_0x50e494[_0x6e70('0x21')][_0x6e70('0x7a')]},'include':[{'model':db[_0x5c0276+_0x6e70('0x6c')],'as':_0x6e70('0x6c')},{'model':db[_0x5c0276+_0x4f4a16],'as':_0x6e70('0x6d')}]});})[_0x6e70('0xa')](function(_0x162bc3){if(_['isNil'](_0x162bc3)){throw new Error(_0x5c0276+_0x6e70('0x7b'));}_0x4a87e2=_0x162bc3;return _0x162bc3[_0x6e70('0x6e')]({'read':0x0,'readAt':null,'UserId':null});})[_0x6e70('0xa')](function(){var _0x181802={'uniqueid':_0x3e6661+'.'+_0x4a87e2['id']+'.'+_0x4a87e2[_0x6e70('0x6c')]['id'],'FromUserId':_0x50e494['user']['id'],'type':'agent','ToUserId':_0x5d0585['id']};_0x181802[_0x5c0276+'MessageId']=_0x4a87e2['id'];_0x181802[_0x5c0276+_0x6e70('0x71')]=_0x4a87e2[_0x6e70('0x6c')]['id'];_0x181802[_0x6e70('0x7c')+_0x5c0276+_0x4f4a16+'Id']=_0x4a87e2[_0x6e70('0x6d')]['id'];return db[_0x5c0276+_0x6e70('0x72')][_0x6e70('0x7d')](_0x181802);})[_0x6e70('0xa')](function(){return respondWithRpcPromise(_0x6e70('0x7e'),{'channel':_0x3e6661,'interaction':_0x4a87e2[_0x6e70('0x6c')],'message':_0x4a87e2,'account':_0x4a87e2[_0x6e70('0x6d')],'applications':[{'id':0x0,'priority':0x1,'app':_0x6e70('0x3d'),'appdata':_0x5d0585[_0x6e70('0x12')]+','+(_0x4a87e2[_0x6e70('0x6d')][_0x6e70('0x7f')]||0x12c),'interval':_0x6e70('0x73')}],'transfer':!![]},routingClient);})['then'](respondWithResult(_0x17d3a4,null))[_0x6e70('0xf')](handleError(_0x17d3a4,null));}; \ No newline at end of file +var _0xbaf0=['MailQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','OpenchannelQueuesWaitingInteractions','type','filter','map','queue_id','value','indexOf','smsQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','FaxQueuesWaitingInteractions','queueNotify','capitalize','chat','Queue','findOne','\x20Queue\x20not\x20found','Message','messageId','Interaction','Account','\x20Message\x20not\x20found','update','queue','From','QueueId','TransferReport','create','Start','queueTransferTimeout','*,*,*,*','agentNotify','channel','Channel\x20field\x20is\x20mandatory','Website','Agent\x20not\x20found','InteractionId','agentTransferTimeout','moment','lodash','util','../../mysqldb','../../config/logger','api','client','http','request','then','error','code','message','result','status','sendStatus','stack','name','isNil','rows','voiceChannels','VoiceChannels','catch','voiceChannelMixMonitor','VoiceChannelMixMonitor','merge','query','params','VoiceChannelStopMixMonitor','voiceQueues','VoiceQueues','showVoiceQueues','updateVoiceQueue','UpdateVoiceQueue','voiceQueuesPreview','VoiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannels','voiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','voiceQueuesChannelRedirect','VoiceQueuesChannelRedirect','Outbound','outboundChannels','OutboundChannels','agents','Agents','agentCapacity','body','interaction','user','hasOwnProperty','MemberReport','findAll','INTERACTION','length','format','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','findOrCreate','interface','SIP/%s','agent','internal','AgentCapacity','capacity','telephones','Telephones','trunks','Campaigns','chatQueues','ChatQueues','showChatQueues','MailQueues','showMailQueues','mailAccounts','openchannelQueues','OpenchannelQueues','smsQueues','showSmsQueues','WhatsappQueues','showWhatsappQueues','faxQueues','showFaxQueues','FaxQueues','faxAccounts','FaxAccounts','mailQueuesWaitingInteractions'];(function(_0x166db2,_0x49a9ce){var _0x16d6b7=function(_0x46ce31){while(--_0x46ce31){_0x166db2['push'](_0x166db2['shift']());}};_0x16d6b7(++_0x49a9ce);}(_0xbaf0,0x12a));var _0x0baf=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0xbaf0[_0x6c993a];return _0x27f547;};'use strict';var BPromise=require('bluebird');var moment=require(_0x0baf('0x0'));var _=require(_0x0baf('0x1'));var util=require(_0x0baf('0x2'));var db=require(_0x0baf('0x3'))['db'];var logger=require(_0x0baf('0x4'))(_0x0baf('0x5'));var jayson=require('jayson/promise');var amiClient=jayson[_0x0baf('0x6')][_0x0baf('0x7')]({'port':0x232a});var mailClient=jayson[_0x0baf('0x6')][_0x0baf('0x7')]({'port':0x232b});var routingClient=jayson[_0x0baf('0x6')][_0x0baf('0x7')]({'port':0x232c});function respondWithRpcPromise(_0x1a10b1,_0x2dcaac,_0x1d0a0d){return new BPromise(function(_0x5f5030,_0x11b947){var _0x5f20aa=_0x1d0a0d?_0x1d0a0d:amiClient;return _0x5f20aa[_0x0baf('0x8')](_0x1a10b1,_0x2dcaac)[_0x0baf('0x9')](function(_0x465528){if(_0x465528[_0x0baf('0xa')]){if(_0x465528[_0x0baf('0xa')][_0x0baf('0xb')]===0x1f4){return _0x11b947(_0x465528[_0x0baf('0xa')][_0x0baf('0xc')]);}return _0x5f5030(_0x465528[_0x0baf('0xa')][_0x0baf('0xc')]);}else{_0x5f5030(_0x465528[_0x0baf('0xd')]);}})['catch'](function(_0x5a53e2){_0x11b947(_0x5a53e2);});});}function respondWithResult(_0x465dd7,_0xe4378c){_0xe4378c=_0xe4378c||0xc8;return function(_0x5db689){if(_0x5db689){return _0x465dd7[_0x0baf('0xe')](_0xe4378c)['json'](_0x5db689);}return _0x465dd7[_0x0baf('0xf')](0x194);};}function handleError(_0x49e44b,_0x1c76a8){_0x1c76a8=_0x1c76a8||0x1f4;return function(_0x1f50c3){logger[_0x0baf('0xa')](_0x1f50c3[_0x0baf('0x10')]);if(_0x1f50c3[_0x0baf('0x11')]){delete _0x1f50c3[_0x0baf('0x11')];}_0x49e44b['status'](_0x1c76a8)['send'](_0x1f50c3);};}function findById(_0x2312c7){return function(_0x38395b){if(!_[_0x0baf('0x12')](_0x2312c7)&&!_[_0x0baf('0x12')](_0x38395b)&&!_[_0x0baf('0x12')](_0x38395b[_0x0baf('0x13')])){return _['find'](_0x38395b[_0x0baf('0x13')],function(_0xfbecec){return _0xfbecec['id']==_0x2312c7;});}return null;};}exports[_0x0baf('0x14')]=function(_0x3e9cb4,_0x47070d){return respondWithRpcPromise(_0x0baf('0x15'),_0x3e9cb4['query'])['then'](respondWithResult(_0x47070d,null))[_0x0baf('0x16')](handleError(_0x47070d,null));};exports[_0x0baf('0x17')]=function(_0x32e839,_0x1848e8){return respondWithRpcPromise(_0x0baf('0x18'),_[_0x0baf('0x19')](_0x32e839[_0x0baf('0x1a')],_0x32e839[_0x0baf('0x1b')]))[_0x0baf('0x9')](respondWithResult(_0x1848e8,null))[_0x0baf('0x16')](handleError(_0x1848e8,null));};exports['voiceChannelStopMixMonitor']=function(_0x334bd6,_0x482522){return respondWithRpcPromise(_0x0baf('0x1c'),_['merge'](_0x334bd6['query'],_0x334bd6[_0x0baf('0x1b')]))['then'](respondWithResult(_0x482522,null))['catch'](handleError(_0x482522,null));};exports[_0x0baf('0x1d')]=function(_0x27b59c,_0x34e264){return respondWithRpcPromise(_0x0baf('0x1e'),_0x27b59c[_0x0baf('0x1a')])['then'](respondWithResult(_0x34e264,null))[_0x0baf('0x16')](handleError(_0x34e264,null));};exports[_0x0baf('0x1f')]=function(_0x1ca35a,_0x366e71){return respondWithRpcPromise(_0x0baf('0x1e'),_0x1ca35a[_0x0baf('0x1a')])[_0x0baf('0x9')](findById(_0x1ca35a['params']['id']))[_0x0baf('0x9')](respondWithResult(_0x366e71,null))[_0x0baf('0x16')](handleError(_0x366e71,null));};exports[_0x0baf('0x20')]=function(_0x265915,_0x55c715){return respondWithRpcPromise(_0x0baf('0x21'),_[_0x0baf('0x19')](_0x265915['body'],_0x265915[_0x0baf('0x1b')]))[_0x0baf('0x9')](respondWithResult(_0x55c715,null))[_0x0baf('0x16')](handleError(_0x55c715,null));};exports[_0x0baf('0x22')]=function(_0xd14f0f,_0x366924){return respondWithRpcPromise(_0x0baf('0x23'),_['merge'](_0xd14f0f[_0x0baf('0x1a')],_0xd14f0f[_0x0baf('0x1b')]))[_0x0baf('0x9')](respondWithResult(_0x366924,null))[_0x0baf('0x16')](handleError(_0x366924,null));};exports[_0x0baf('0x24')]=function(_0x275ea1,_0x2fc983){return respondWithRpcPromise(_0x0baf('0x25'),_0x275ea1[_0x0baf('0x1a')])[_0x0baf('0x9')](respondWithResult(_0x2fc983,null))[_0x0baf('0x16')](handleError(_0x2fc983,null));};exports[_0x0baf('0x26')]=function(_0x45294a,_0x3a3353){return respondWithRpcPromise('VoiceQueuesChannel',_[_0x0baf('0x19')](_0x45294a['query'],_0x45294a[_0x0baf('0x1b')]))[_0x0baf('0x9')](respondWithResult(_0x3a3353,null))[_0x0baf('0x16')](handleError(_0x3a3353,null));};exports[_0x0baf('0x27')]=function(_0x5300a5,_0x1a2b03){return respondWithRpcPromise(_0x0baf('0x28'),_['merge'](_0x5300a5[_0x0baf('0x1a')],_0x5300a5[_0x0baf('0x1b')]))[_0x0baf('0x9')](respondWithResult(_0x1a2b03,null))[_0x0baf('0x16')](handleError(_0x1a2b03,null));};exports[_0x0baf('0x29')]=function(_0x1b0991,_0xe03d82){return respondWithRpcPromise(_0x0baf('0x2a'),_['merge'](_0x1b0991[_0x0baf('0x1a')],_0x1b0991[_0x0baf('0x1b')]))['then'](respondWithResult(_0xe03d82,null))[_0x0baf('0x16')](handleError(_0xe03d82,null));};exports['outbound']=function(_0x5c545f,_0x11bc49){return respondWithRpcPromise(_0x0baf('0x2b'),_0x5c545f['query'])['then'](respondWithResult(_0x11bc49,null))[_0x0baf('0x16')](handleError(_0x11bc49,null));};exports[_0x0baf('0x2c')]=function(_0x3412bc,_0xb2d9ab){return respondWithRpcPromise(_0x0baf('0x2d'),_0x3412bc[_0x0baf('0x1a')])[_0x0baf('0x9')](respondWithResult(_0xb2d9ab,null))[_0x0baf('0x16')](handleError(_0xb2d9ab,null));};exports[_0x0baf('0x2e')]=function(_0x36c6d2,_0x200864){var _0x148540;return respondWithRpcPromise(_0x0baf('0x2f'),_0x36c6d2[_0x0baf('0x1a')])['then'](function(_0x3573ce){_0x148540=_0x3573ce;return respondWithRpcPromise(_0x0baf('0x2f'),_0x36c6d2['query'],routingClient);})[_0x0baf('0x9')](function(_0x324369){return _[_0x0baf('0x19')]({},_0x324369,_0x148540);})[_0x0baf('0x9')](respondWithResult(_0x200864,null))[_0x0baf('0x16')](handleError(_0x200864,null));};exports[_0x0baf('0x30')]=function(_0x57b581,_0x23ad34){if(_0x57b581[_0x0baf('0x31')]&&_0x57b581['body'][_0x0baf('0x32')]&&_0x57b581[_0x0baf('0x33')]&&_0x57b581[_0x0baf('0x33')][_0x0baf('0x11')]){for(var _0x504031 in _0x57b581[_0x0baf('0x31')][_0x0baf('0x32')]){if(_0x57b581[_0x0baf('0x31')][_0x0baf('0x32')][_0x0baf('0x34')](_0x504031)){db[_0x0baf('0x35')][_0x0baf('0x36')]({'where':{'channel':_0x504031,'membername':_0x57b581[_0x0baf('0x33')][_0x0baf('0x11')],'type':_0x0baf('0x37'),'exitAt':null,'uniqueid':_0x57b581['body'][_0x0baf('0x32')][_0x504031]&&_0x57b581[_0x0baf('0x31')][_0x0baf('0x32')][_0x504031][_0x0baf('0x38')]?{'$notIn':_0x57b581[_0x0baf('0x31')]['interaction'][_0x504031]}:{'$ne':null}}})[_0x0baf('0x9')](function(_0x310240){var _0x27c3ee=moment()[_0x0baf('0x39')](_0x0baf('0x3a'));for(var _0x54ed41=0x0,_0x2a0924=_0x310240[_0x0baf('0x38')];_0x54ed41<_0x2a0924;_0x54ed41+=0x1){_0x310240[_0x54ed41][_0x0baf('0x3b')]({'exitAt':_0x27c3ee});}});for(var _0x1522b0=0x0;_0x1522b0<_0x57b581[_0x0baf('0x31')][_0x0baf('0x32')][_0x504031][_0x0baf('0x38')];_0x1522b0+=0x1){db['MemberReport'][_0x0baf('0x3c')]({'where':{'channel':_0x504031,'membername':_0x57b581[_0x0baf('0x33')][_0x0baf('0x11')],'type':'INTERACTION','uniqueid':_0x57b581[_0x0baf('0x31')][_0x0baf('0x32')][_0x504031][_0x1522b0],'exitAt':null},'defaults':{'channel':_0x504031,'membername':_0x57b581[_0x0baf('0x33')][_0x0baf('0x11')],'interface':_[_0x0baf('0x12')](_0x57b581[_0x0baf('0x33')][_0x0baf('0x3d')])?util['format'](_0x0baf('0x3e'),_0x57b581[_0x0baf('0x33')][_0x0baf('0x11')]):_0x57b581[_0x0baf('0x33')][_0x0baf('0x3d')],'type':_0x0baf('0x37'),'enterAt':moment()[_0x0baf('0x39')](_0x0baf('0x3a')),'role':_0x0baf('0x3f'),'internal':_0x57b581[_0x0baf('0x33')][_0x0baf('0x40')],'uniqueid':_0x57b581['body']['interaction'][_0x504031][_0x1522b0]}});}}}}return respondWithRpcPromise(_0x0baf('0x41'),{'id':_0x57b581[_0x0baf('0x1b')]['id'],'capacity':_0x57b581[_0x0baf('0x31')][_0x0baf('0x42')]},routingClient)[_0x0baf('0x9')](respondWithResult(_0x23ad34,null))[_0x0baf('0x16')](handleError(_0x23ad34,null));};exports[_0x0baf('0x43')]=function(_0x4b492c,_0x3fe534){return respondWithRpcPromise(_0x0baf('0x44'),_0x4b492c[_0x0baf('0x1a')])[_0x0baf('0x9')](respondWithResult(_0x3fe534,null))[_0x0baf('0x16')](handleError(_0x3fe534,null));};exports[_0x0baf('0x45')]=function(_0x5e1849,_0x3eebe5){return respondWithRpcPromise('Trunks',_0x5e1849[_0x0baf('0x1a')])['then'](respondWithResult(_0x3eebe5,null))[_0x0baf('0x16')](handleError(_0x3eebe5,null));};exports['campaigns']=function(_0x35b1a5,_0x4c035b){return respondWithRpcPromise(_0x0baf('0x46'),_0x35b1a5[_0x0baf('0x1a')])[_0x0baf('0x9')](respondWithResult(_0x4c035b,null))[_0x0baf('0x16')](handleError(_0x4c035b,null));};exports[_0x0baf('0x47')]=function(_0x576475,_0x21f179){return respondWithRpcPromise(_0x0baf('0x48'),_0x576475[_0x0baf('0x1a')],routingClient)[_0x0baf('0x9')](respondWithResult(_0x21f179,null))[_0x0baf('0x16')](handleError(_0x21f179,null));};exports[_0x0baf('0x49')]=function(_0x480834,_0x402f4d){return respondWithRpcPromise(_0x0baf('0x48'),_0x480834[_0x0baf('0x1a')],routingClient)[_0x0baf('0x9')](findById(_0x480834[_0x0baf('0x1b')]['id']))[_0x0baf('0x9')](respondWithResult(_0x402f4d,null))[_0x0baf('0x16')](handleError(_0x402f4d,null));};exports['mailQueues']=function(_0x48e855,_0x23f6ea){return respondWithRpcPromise(_0x0baf('0x4a'),_0x48e855[_0x0baf('0x1a')],routingClient)[_0x0baf('0x9')](respondWithResult(_0x23f6ea,null))[_0x0baf('0x16')](handleError(_0x23f6ea,null));};exports[_0x0baf('0x4b')]=function(_0xaa4293,_0x14a667){return respondWithRpcPromise(_0x0baf('0x4a'),_0xaa4293['query'],routingClient)[_0x0baf('0x9')](findById(_0xaa4293[_0x0baf('0x1b')]['id']))[_0x0baf('0x9')](respondWithResult(_0x14a667,null))[_0x0baf('0x16')](handleError(_0x14a667,null));};exports[_0x0baf('0x4c')]=function(_0xebfc0c,_0x26f5c9){return respondWithRpcPromise('MailAccounts',_0xebfc0c[_0x0baf('0x1a')],mailClient)[_0x0baf('0x9')](respondWithResult(_0x26f5c9,null))[_0x0baf('0x16')](handleError(_0x26f5c9,null));};exports[_0x0baf('0x4d')]=function(_0x1c7d88,_0x1a6d22){return respondWithRpcPromise(_0x0baf('0x4e'),_0x1c7d88[_0x0baf('0x1a')],routingClient)['then'](respondWithResult(_0x1a6d22,null))[_0x0baf('0x16')](handleError(_0x1a6d22,null));};exports['showOpenchannelQueues']=function(_0x3c00e7,_0x5f2fbe){return respondWithRpcPromise('OpenchannelQueues',_0x3c00e7[_0x0baf('0x1a')],routingClient)['then'](findById(_0x3c00e7[_0x0baf('0x1b')]['id']))[_0x0baf('0x9')](respondWithResult(_0x5f2fbe,null))['catch'](handleError(_0x5f2fbe,null));};exports[_0x0baf('0x4f')]=function(_0xfb6708,_0x156572){return respondWithRpcPromise('SmsQueues',_0xfb6708['query'],routingClient)[_0x0baf('0x9')](respondWithResult(_0x156572,null))[_0x0baf('0x16')](handleError(_0x156572,null));};exports[_0x0baf('0x50')]=function(_0x7f49e,_0x784e1a){return respondWithRpcPromise('SmsQueues',_0x7f49e[_0x0baf('0x1a')],routingClient)['then'](findById(_0x7f49e['params']['id']))['then'](respondWithResult(_0x784e1a,null))[_0x0baf('0x16')](handleError(_0x784e1a,null));};exports['whatsappQueues']=function(_0x4946d4,_0x11a81e){return respondWithRpcPromise(_0x0baf('0x51'),_0x4946d4[_0x0baf('0x1a')],routingClient)[_0x0baf('0x9')](respondWithResult(_0x11a81e,null))[_0x0baf('0x16')](handleError(_0x11a81e,null));};exports[_0x0baf('0x52')]=function(_0x4c05d6,_0xec3b32){return respondWithRpcPromise(_0x0baf('0x51'),_0x4c05d6[_0x0baf('0x1a')],routingClient)[_0x0baf('0x9')](findById(_0x4c05d6[_0x0baf('0x1b')]['id']))[_0x0baf('0x9')](respondWithResult(_0xec3b32,null))['catch'](handleError(_0xec3b32,null));};exports[_0x0baf('0x53')]=function(_0x468363,_0x29fd46){return respondWithRpcPromise('FaxQueues',_0x468363[_0x0baf('0x1a')],routingClient)[_0x0baf('0x9')](respondWithResult(_0x29fd46,null))[_0x0baf('0x16')](handleError(_0x29fd46,null));};exports[_0x0baf('0x54')]=function(_0x125906,_0x27a959){return respondWithRpcPromise(_0x0baf('0x55'),_0x125906['query'],routingClient)['then'](findById(_0x125906['params']['id']))[_0x0baf('0x9')](respondWithResult(_0x27a959,null))[_0x0baf('0x16')](handleError(_0x27a959,null));};exports[_0x0baf('0x56')]=function(_0x12b9b5,_0x3e65d4){return respondWithRpcPromise(_0x0baf('0x57'),_0x12b9b5['query'])['then'](respondWithResult(_0x3e65d4,null))[_0x0baf('0x16')](handleError(_0x3e65d4,null));};exports['chatQueuesWaitingInteractions']=function(_0x22cd07,_0x3e9b79){return respondWithRpcPromise('ChatQueuesWaitingInteractions',_0x22cd07[_0x0baf('0x1a')],routingClient)[_0x0baf('0x9')](respondWithResult(_0x3e9b79,null))[_0x0baf('0x16')](handleError(_0x3e9b79,null));};exports[_0x0baf('0x58')]=function(_0x115ff5,_0x33a5af){return respondWithRpcPromise(_0x0baf('0x59'),_0x115ff5[_0x0baf('0x1a')],routingClient)[_0x0baf('0x9')](respondWithResult(_0x33a5af,null))['catch'](handleError(_0x33a5af,null));};exports['openchannelQueuesWaitingInteractions']=function(_0x58a079,_0x493784){return respondWithRpcPromise('OpenchannelQueuesWaitingInteractions',_0x58a079[_0x0baf('0x1a')],routingClient)[_0x0baf('0x9')](respondWithResult(_0x493784,null))[_0x0baf('0x16')](handleError(_0x493784,null));};exports[_0x0baf('0x5a')]=function(_0x5093f5,_0x1be7f2){return respondWithRpcPromise(_0x0baf('0x5b'),_0x5093f5['query'],routingClient)['then'](function(_0x43aecd){if(_0x5093f5[_0x0baf('0x1a')][_0x0baf('0x5c')]!==undefined){var _0x442e5f=_(_0x43aecd[_0x0baf('0x13')])[_0x0baf('0x5d')]([_0x5093f5[_0x0baf('0x1a')][_0x0baf('0x5c')],_0x5093f5['params']['id']])[_0x0baf('0x5e')](_0x0baf('0x5f'))['uniq']()[_0x0baf('0x60')]();return _0x43aecd[_0x0baf('0x13')]['filter'](function(_0x97d385){return _0x442e5f[_0x0baf('0x61')](_0x97d385[_0x0baf('0x5f')])>-0x1;});}else{return _0x43aecd[_0x0baf('0x13')][_0x0baf('0x5d')](function(_0x4fc5af){return _0x4fc5af['queue_id']===parseInt(_0x5093f5[_0x0baf('0x1b')]['id']);});}})[_0x0baf('0x9')](respondWithResult(_0x1be7f2,null))['catch'](handleError(_0x1be7f2,null));};exports[_0x0baf('0x62')]=function(_0x59dad5,_0x21ad25){return respondWithRpcPromise('SmsQueuesWaitingInteractions',_0x59dad5[_0x0baf('0x1a')],routingClient)[_0x0baf('0x9')](respondWithResult(_0x21ad25,null))[_0x0baf('0x16')](handleError(_0x21ad25,null));};exports['whatsappQueuesWaitingInteractions']=function(_0x3c2bc1,_0x5008c5){return respondWithRpcPromise(_0x0baf('0x63'),_0x3c2bc1[_0x0baf('0x1a')],routingClient)[_0x0baf('0x9')](respondWithResult(_0x5008c5,null))[_0x0baf('0x16')](handleError(_0x5008c5,null));};exports[_0x0baf('0x64')]=function(_0x52e845,_0x866e6e){return respondWithRpcPromise(_0x0baf('0x65'),_0x52e845['query'],routingClient)[_0x0baf('0x9')](respondWithResult(_0x866e6e,null))[_0x0baf('0x16')](handleError(_0x866e6e,null));};exports[_0x0baf('0x66')]=function(_0x379c54){return function(_0x1cbbcc,_0x250df2){var _0xa4fd1b,_0x1cda78;var _0x44ef57=_[_0x0baf('0x67')](_0x379c54);var _0x3b7abf=_0x379c54===_0x0baf('0x68')?'Website':'Account';return db[_0x44ef57+_0x0baf('0x69')][_0x0baf('0x6a')]({'raw':!![],'where':{'id':_0x1cbbcc[_0x0baf('0x1b')]['id']}})['then'](function(_0x507783){if(_[_0x0baf('0x12')](_0x507783)){throw new Error(_0x44ef57+_0x0baf('0x6b'));}_0xa4fd1b=_0x507783;return db[_0x44ef57+_0x0baf('0x6c')][_0x0baf('0x6a')]({'where':{'id':_0x1cbbcc[_0x0baf('0x31')][_0x0baf('0x6d')]},'include':[{'model':db[_0x44ef57+_0x0baf('0x6e')],'as':_0x0baf('0x6e')},{'model':db[_0x44ef57+_0x3b7abf],'as':_0x0baf('0x6f')}]});})['then'](function(_0x1590a5){if(_[_0x0baf('0x12')](_0x1590a5)){throw new Error(_0x44ef57+_0x0baf('0x70'));}_0x1cda78=_0x1590a5;return _0x1590a5[_0x0baf('0x71')]({'read':0x0,'readAt':null,'UserId':null});})['then'](function(){var _0x5d26e6={'uniqueid':_0x379c54+'.'+_0x1cda78['id']+'.'+_0x1cda78['Interaction']['id'],'FromUserId':_0x1cbbcc[_0x0baf('0x33')]['id'],'type':_0x0baf('0x72')};_0x5d26e6[_0x44ef57+'MessageId']=_0x1cda78['id'];_0x5d26e6[_0x44ef57+'InteractionId']=_0x1cda78[_0x0baf('0x6e')]['id'];_0x5d26e6[_0x0baf('0x73')+_0x44ef57+_0x3b7abf+'Id']=_0x1cda78['Account']['id'];_0x5d26e6['To'+_0x44ef57+_0x0baf('0x74')]=_0xa4fd1b['id'];return db[_0x44ef57+_0x0baf('0x75')][_0x0baf('0x76')](_0x5d26e6);})[_0x0baf('0x9')](function(){return respondWithRpcPromise(_0x0baf('0x77'),{'channel':_0x379c54,'interaction':_0x1cda78[_0x0baf('0x6e')],'message':_0x1cda78,'account':_0x1cda78[_0x0baf('0x6f')],'applications':[{'id':0x0,'priority':0x1,'app':_0x0baf('0x72'),'appdata':_0xa4fd1b[_0x0baf('0x11')]+','+(_0x1cda78[_0x0baf('0x6f')][_0x0baf('0x78')]||0x12c),'interval':_0x0baf('0x79')}],'transfer':!![]},routingClient);})['then'](respondWithResult(_0x250df2,null))[_0x0baf('0x16')](handleError(_0x250df2,null));};};exports[_0x0baf('0x7a')]=function(_0x1e1adb,_0x3bd15b){var _0x3c37b4,_0x195303;if(_['isNil'](_0x1e1adb[_0x0baf('0x31')][_0x0baf('0x7b')])){throw new Error(_0x0baf('0x7c'));}var _0x457ae8=_0x1e1adb[_0x0baf('0x31')]['channel'];var _0x3761b5=_[_0x0baf('0x67')](_0x457ae8);var _0x2eae1b=_0x457ae8===_0x0baf('0x68')?_0x0baf('0x7d'):'Account';return db['User'][_0x0baf('0x6a')]({'raw':!![],'where':{'id':_0x1e1adb['params']['id'],'role':_0x0baf('0x3f')}})['then'](function(_0x32d8b6){if(_[_0x0baf('0x12')](_0x32d8b6)){throw new Error(_0x0baf('0x7e'));}_0x3c37b4=_0x32d8b6;return db[_0x3761b5+_0x0baf('0x6c')]['findOne']({'where':{'id':_0x1e1adb[_0x0baf('0x31')][_0x0baf('0x6d')]},'include':[{'model':db[_0x3761b5+_0x0baf('0x6e')],'as':'Interaction'},{'model':db[_0x3761b5+_0x2eae1b],'as':'Account'}]});})['then'](function(_0x4d4884){if(_[_0x0baf('0x12')](_0x4d4884)){throw new Error(_0x3761b5+_0x0baf('0x70'));}_0x195303=_0x4d4884;return _0x4d4884[_0x0baf('0x71')]({'read':0x0,'readAt':null,'UserId':null});})[_0x0baf('0x9')](function(){var _0x597830={'uniqueid':_0x457ae8+'.'+_0x195303['id']+'.'+_0x195303[_0x0baf('0x6e')]['id'],'FromUserId':_0x1e1adb[_0x0baf('0x33')]['id'],'type':_0x0baf('0x3f'),'ToUserId':_0x3c37b4['id']};_0x597830[_0x3761b5+'MessageId']=_0x195303['id'];_0x597830[_0x3761b5+_0x0baf('0x7f')]=_0x195303[_0x0baf('0x6e')]['id'];_0x597830['From'+_0x3761b5+_0x2eae1b+'Id']=_0x195303[_0x0baf('0x6f')]['id'];return db[_0x3761b5+'TransferReport'][_0x0baf('0x76')](_0x597830);})[_0x0baf('0x9')](function(){return respondWithRpcPromise(_0x0baf('0x77'),{'channel':_0x457ae8,'interaction':_0x195303[_0x0baf('0x6e')],'message':_0x195303,'account':_0x195303['Account'],'applications':[{'id':0x0,'priority':0x1,'app':'agent','appdata':_0x3c37b4[_0x0baf('0x11')]+','+(_0x195303['Account'][_0x0baf('0x80')]||0x12c),'interval':_0x0baf('0x79')}],'transfer':!![]},routingClient);})[_0x0baf('0x9')](respondWithResult(_0x3bd15b,null))[_0x0baf('0x16')](handleError(_0x3bd15b,null));}; \ No newline at end of file diff --git a/server/api/schedule/index.js b/server/api/schedule/index.js index 7af54e4..766fb0d 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 _0x69ce=['get','index','isAuthenticated','show','/:id/run','run','create','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./schedule.controller'];(function(_0x2356cc,_0x5309f5){var _0x520e77=function(_0x3617db){while(--_0x3617db){_0x2356cc['push'](_0x2356cc['shift']());}};_0x520e77(++_0x5309f5);}(_0x69ce,0x18d));var _0xe69c=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0x69ce[_0x4b055c];return _0x4b62bb;};'use strict';var multer=require(_0xe69c('0x0'));var util=require(_0xe69c('0x1'));var path=require(_0xe69c('0x2'));var timeout=require(_0xe69c('0x3'));var express=require(_0xe69c('0x4'));var router=express[_0xe69c('0x5')]();var fs_extra=require(_0xe69c('0x6'));var auth=require(_0xe69c('0x7'));var interaction=require(_0xe69c('0x8'));var config=require(_0xe69c('0x9'));var controller=require(_0xe69c('0xa'));router[_0xe69c('0xb')]('/',auth['isAuthenticated'](),controller[_0xe69c('0xc')]);router[_0xe69c('0xb')]('/:id',auth[_0xe69c('0xd')](),controller[_0xe69c('0xe')]);router[_0xe69c('0xb')](_0xe69c('0xf'),auth[_0xe69c('0xd')](),controller[_0xe69c('0x10')]);router['post']('/',auth[_0xe69c('0xd')](),controller[_0xe69c('0x11')]);router[_0xe69c('0x12')](_0xe69c('0x13'),auth[_0xe69c('0xd')](),controller[_0xe69c('0x14')]);router[_0xe69c('0x15')](_0xe69c('0x13'),auth['isAuthenticated'](),controller[_0xe69c('0x16')]);module[_0xe69c('0x17')]=router; \ No newline at end of file +var _0xf7d1=['./schedule.controller','get','index','/:id','isAuthenticated','run','post','put','update','destroy','exports','multer','path','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x130621,_0x2867eb){var _0x48e043=function(_0x2e96dd){while(--_0x2e96dd){_0x130621['push'](_0x130621['shift']());}};_0x48e043(++_0x2867eb);}(_0xf7d1,0x1d6));var _0x1f7d=function(_0x402b44,_0x25d4f3){_0x402b44=_0x402b44-0x0;var _0x4dd69d=_0xf7d1[_0x402b44];return _0x4dd69d;};'use strict';var multer=require(_0x1f7d('0x0'));var util=require('util');var path=require(_0x1f7d('0x1'));var timeout=require('connect-timeout');var express=require(_0x1f7d('0x2'));var router=express[_0x1f7d('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1f7d('0x4'));var interaction=require(_0x1f7d('0x5'));var config=require('../../config/environment');var controller=require(_0x1f7d('0x6'));router[_0x1f7d('0x7')]('/',auth['isAuthenticated'](),controller[_0x1f7d('0x8')]);router[_0x1f7d('0x7')](_0x1f7d('0x9'),auth[_0x1f7d('0xa')](),controller['show']);router[_0x1f7d('0x7')]('/:id/run',auth[_0x1f7d('0xa')](),controller[_0x1f7d('0xb')]);router[_0x1f7d('0xc')]('/',auth[_0x1f7d('0xa')](),controller['create']);router[_0x1f7d('0xd')](_0x1f7d('0x9'),auth[_0x1f7d('0xa')](),controller[_0x1f7d('0xe')]);router['delete'](_0x1f7d('0x9'),auth[_0x1f7d('0xa')](),controller[_0x1f7d('0xf')]);module[_0x1f7d('0x10')]=router; \ No newline at end of file diff --git a/server/api/schedule/schedule.attributes.js b/server/api/schedule/schedule.attributes.js index 76f961a..fa85665 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 _0x9f5f=['INTEGER','quarters','months','hours','csv','pdf','xlsx','custom','TEXT','sequelize','STRING','BOOLEAN','0\x200\x20*\x20*\x20*','DATE'];(function(_0xda63d3,_0x546748){var _0x298e0b=function(_0x3b010e){while(--_0x3b010e){_0xda63d3['push'](_0xda63d3['shift']());}};_0x298e0b(++_0x546748);}(_0x9f5f,0xbf));var _0xf9f5=function(_0x5a776b,_0x46f785){_0x5a776b=_0x5a776b-0x0;var _0xbbef59=_0x9f5f[_0x5a776b];return _0xbbef59;};'use strict';var Sequelize=require(_0xf9f5('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xf9f5('0x1')]},'active':{'type':Sequelize[_0xf9f5('0x2')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0xf9f5('0x1')],'allowNull':![],'defaultValue':_0xf9f5('0x3')},'startAt':{'type':Sequelize['DATE'],'allowNull':![]},'endAt':{'type':Sequelize[_0xf9f5('0x4')],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0xf9f5('0x5')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize['ENUM']('years',_0xf9f5('0x6'),_0xf9f5('0x7'),'weeks','days',_0xf9f5('0x8'),'minutes'),'allowNull':![],'defaultValue':'days'},'output':{'type':Sequelize['ENUM'](_0xf9f5('0x9'),_0xf9f5('0xa'),_0xf9f5('0xb')),'allowNull':![],'defaultValue':_0xf9f5('0x9')},'type':{'type':Sequelize['ENUM'](_0xf9f5('0xc'),'default'),'allowNull':![],'defaultValue':'custom'},'sendMail':{'type':Sequelize[_0xf9f5('0x2')],'defaultValue':![]},'email':{'type':Sequelize[_0xf9f5('0x1')]},'cc':{'type':Sequelize['TEXT']},'bcc':{'type':Sequelize[_0xf9f5('0xd')]},'sendIfEmpty':{'type':Sequelize[_0xf9f5('0x2')],'defaultValue':!![]}}; \ No newline at end of file +var _0x3ee1=['BOOLEAN','DATE','INTEGER','ENUM','quarters','months','days','hours','minutes','csv','pdf','custom','default','STRING','TEXT','exports'];(function(_0x17a971,_0x12a7a1){var _0x3ff075=function(_0x29603d){while(--_0x29603d){_0x17a971['push'](_0x17a971['shift']());}};_0x3ff075(++_0x12a7a1);}(_0x3ee1,0x14f));var _0x13ee=function(_0x2e4bab,_0x5822b9){_0x2e4bab=_0x2e4bab-0x0;var _0x57aab0=_0x3ee1[_0x2e4bab];return _0x57aab0;};'use strict';var Sequelize=require('sequelize');module[_0x13ee('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0x13ee('0x1')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'0\x200\x20*\x20*\x20*'},'startAt':{'type':Sequelize[_0x13ee('0x2')],'allowNull':![]},'endAt':{'type':Sequelize[_0x13ee('0x2')],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0x13ee('0x3')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0x13ee('0x4')]('years',_0x13ee('0x5'),_0x13ee('0x6'),'weeks',_0x13ee('0x7'),_0x13ee('0x8'),_0x13ee('0x9')),'allowNull':![],'defaultValue':_0x13ee('0x7')},'output':{'type':Sequelize[_0x13ee('0x4')](_0x13ee('0xa'),_0x13ee('0xb'),'xlsx'),'allowNull':![],'defaultValue':_0x13ee('0xa')},'type':{'type':Sequelize['ENUM'](_0x13ee('0xc'),_0x13ee('0xd')),'allowNull':![],'defaultValue':_0x13ee('0xc')},'sendMail':{'type':Sequelize[_0x13ee('0x1')],'defaultValue':![]},'email':{'type':Sequelize[_0x13ee('0xe')]},'cc':{'type':Sequelize[_0x13ee('0xf')]},'bcc':{'type':Sequelize[_0x13ee('0xf')]},'sendIfEmpty':{'type':Sequelize[_0x13ee('0x1')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/schedule/schedule.controller.js b/server/api/schedule/schedule.controller.js index 3bd2ef0..02b1c11 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 _0x583c=['include','rows','show','params','keys','find','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','body','run','eml-format','zip-dir','fast-json-patch','bluebird','mustache','path','to-csv','ejs','lodash','squel','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','get','Scheduler','UserProfileResource','destroy','error','stack','name','send','index','map','Schedule','rawAttributes','key','model','filters','query','attributes','intersection','fields','length','hasOwnProperty','sort','where','pick','merge','VIRTUAL','filter','includeAll'];(function(_0x5e7eaf,_0x5d95c4){var _0x37a142=function(_0x34f43d){while(--_0x34f43d){_0x5e7eaf['push'](_0x5e7eaf['shift']());}};_0x37a142(++_0x5d95c4);}(_0x583c,0x1de));var _0xc583=function(_0x5c3ae9,_0x450f9a){_0x5c3ae9=_0x5c3ae9-0x0;var _0x3f5950=_0x583c[_0x5c3ae9];return _0x3f5950;};'use strict';var emlformat=require(_0xc583('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc583('0x1'));var jsonpatch=require(_0xc583('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xc583('0x3'));var Mustache=require(_0xc583('0x4'));var util=require('util');var path=require(_0xc583('0x5'));var sox=require('sox');var csv=require(_0xc583('0x6'));var ejs=require(_0xc583('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc583('0x8'));var squel=require(_0xc583('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xc583('0xa'));var Papa=require(_0xc583('0xb'));var Redis=require(_0xc583('0xc'));var authService=require(_0xc583('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0xc583('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc583('0xf'))(_0xc583('0x10'));var utils=require(_0xc583('0x11'));var config=require(_0xc583('0x12'));var licenseUtil=require(_0xc583('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5d45f5,_0x15ddb8){_0x15ddb8=_0x15ddb8||0xcc;return function(_0x50fce0){if(_0x50fce0){return _0x5d45f5[_0xc583('0x14')](_0x15ddb8);}return _0x5d45f5['status'](_0x15ddb8)[_0xc583('0x15')]();};}function respondWithResult(_0x1e224d,_0x245ae1){_0x245ae1=_0x245ae1||0xc8;return function(_0x161461){if(_0x161461){return _0x1e224d[_0xc583('0x16')](_0x245ae1)['json'](_0x161461);}};}function respondWithFilteredResult(_0x4fa4e6,_0x5bce1a){return function(_0x38956d){if(_0x38956d){var _0xdbeb9c=typeof _0x5bce1a[_0xc583('0x17')]===_0xc583('0x18')&&typeof _0x5bce1a[_0xc583('0x19')]===_0xc583('0x18');var _0x52a8a4=_0x38956d[_0xc583('0x1a')];var _0x35148b=_0xdbeb9c?0x0:_0x5bce1a['offset'];var _0x38ce9b=_0xdbeb9c?_0x38956d[_0xc583('0x1a')]:_0x5bce1a[_0xc583('0x17')]+_0x5bce1a['limit'];var _0x1bef42;if(_0x38ce9b>=_0x52a8a4){_0x38ce9b=_0x52a8a4;_0x1bef42=0xc8;}else{_0x1bef42=0xce;}_0x4fa4e6['status'](_0x1bef42);return _0x4fa4e6[_0xc583('0x1b')](_0xc583('0x1c'),_0x35148b+'-'+_0x38ce9b+'/'+_0x52a8a4)['json'](_0x38956d);}return null;};}function patchUpdates(_0x39aa96){return function(_0x1c3428){try{jsonpatch[_0xc583('0x1d')](_0x1c3428,_0x39aa96,!![]);}catch(_0x3e6235){return BPromise[_0xc583('0x1e')](_0x3e6235);}return _0x1c3428['save']();};}function saveUpdates(_0x41a504,_0xa8bf9a){return function(_0x486ffb){if(_0x486ffb){return _0x486ffb[_0xc583('0x1f')](_0x41a504)[_0xc583('0x20')](function(_0x9ef750){return _0x9ef750;});}return null;};}function removeEntity(_0x131609,_0x22b3aa){return function(_0x5dfbb6){if(_0x5dfbb6){return _0x5dfbb6['destroy']()[_0xc583('0x20')](function(){var _0x5e3f67=_0x5dfbb6[_0xc583('0x21')]({'plain':!![]});var _0x1e760d=_0xc583('0x22');return db[_0xc583('0x23')][_0xc583('0x24')]({'where':{'type':_0x1e760d,'resourceId':_0x5e3f67['id']}})[_0xc583('0x20')](function(){return _0x5dfbb6;});})[_0xc583('0x20')](function(){_0x131609[_0xc583('0x16')](0xcc)[_0xc583('0x15')]();});}};}function handleEntityNotFound(_0x18251a,_0xac1355){return function(_0x1ce708){if(!_0x1ce708){_0x18251a['sendStatus'](0x194);}return _0x1ce708;};}function handleError(_0x473cce,_0x5f00ad){_0x5f00ad=_0x5f00ad||0x1f4;return function(_0x5eb02d){logger[_0xc583('0x25')](_0x5eb02d[_0xc583('0x26')]);if(_0x5eb02d[_0xc583('0x27')]){delete _0x5eb02d['name'];}_0x473cce[_0xc583('0x16')](_0x5f00ad)[_0xc583('0x28')](_0x5eb02d);};}exports[_0xc583('0x29')]=function(_0x240309,_0x184261){var _0x405ae9={},_0x2f0c22={},_0x2d3b0a={'count':0x0,'rows':[]};var _0x5ea3cf=_[_0xc583('0x2a')](db[_0xc583('0x2b')][_0xc583('0x2c')],function(_0x3abe62){return{'name':_0x3abe62['fieldName'],'type':_0x3abe62['type'][_0xc583('0x2d')]};});_0x2f0c22[_0xc583('0x2e')]=_['map'](_0x5ea3cf,_0xc583('0x27'));_0x2f0c22['query']=_['keys'](_0x240309['query']);_0x2f0c22[_0xc583('0x2f')]=_['intersection'](_0x2f0c22['model'],_0x2f0c22[_0xc583('0x30')]);_0x405ae9[_0xc583('0x31')]=_[_0xc583('0x32')](_0x2f0c22[_0xc583('0x2e')],qs['fields'](_0x240309[_0xc583('0x30')][_0xc583('0x33')]));_0x405ae9[_0xc583('0x31')]=_0x405ae9[_0xc583('0x31')][_0xc583('0x34')]?_0x405ae9[_0xc583('0x31')]:_0x2f0c22[_0xc583('0x2e')];if(!_0x240309[_0xc583('0x30')][_0xc583('0x35')]('nolimit')){_0x405ae9[_0xc583('0x19')]=qs[_0xc583('0x19')](_0x240309[_0xc583('0x30')]['limit']);_0x405ae9[_0xc583('0x17')]=qs['offset'](_0x240309[_0xc583('0x30')]['offset']);}_0x405ae9['order']=qs[_0xc583('0x36')](_0x240309[_0xc583('0x30')][_0xc583('0x36')]);_0x405ae9[_0xc583('0x37')]=qs[_0xc583('0x2f')](_[_0xc583('0x38')](_0x240309['query'],_0x2f0c22[_0xc583('0x2f')]),_0x5ea3cf);if(_0x240309[_0xc583('0x30')]['filter']){_0x405ae9[_0xc583('0x37')]=_[_0xc583('0x39')](_0x405ae9['where'],{'$or':_['map'](_0x5ea3cf,function(_0x33e38a){if(_0x33e38a['type']!==_0xc583('0x3a')){var _0x1e0661={};_0x1e0661[_0x33e38a['name']]={'$like':'%'+_0x240309[_0xc583('0x30')][_0xc583('0x3b')]+'%'};return _0x1e0661;}})});}_0x405ae9=_[_0xc583('0x39')]({},_0x405ae9,_0x240309['options']);var _0x300a40={'where':_0x405ae9[_0xc583('0x37')]};return db['Schedule'][_0xc583('0x1a')](_0x300a40)[_0xc583('0x20')](function(_0x18ddd7){_0x2d3b0a[_0xc583('0x1a')]=_0x18ddd7;if(_0x240309[_0xc583('0x30')][_0xc583('0x3c')]){_0x405ae9[_0xc583('0x3d')]=[{'all':!![]}];}return db[_0xc583('0x2b')]['findAll'](_0x405ae9);})[_0xc583('0x20')](function(_0x1ad712){_0x2d3b0a[_0xc583('0x3e')]=_0x1ad712;return _0x2d3b0a;})['then'](respondWithFilteredResult(_0x184261,_0x405ae9))['catch'](handleError(_0x184261,null));};exports[_0xc583('0x3f')]=function(_0x327af8,_0x46e3bd){var _0xec6cc0={'raw':![],'where':{'id':_0x327af8[_0xc583('0x40')]['id']}},_0x43e1cb={};_0x43e1cb[_0xc583('0x2e')]=_['keys'](db[_0xc583('0x2b')][_0xc583('0x2c')]);_0x43e1cb['query']=_[_0xc583('0x41')](_0x327af8[_0xc583('0x30')]);_0x43e1cb[_0xc583('0x2f')]=_[_0xc583('0x32')](_0x43e1cb[_0xc583('0x2e')],_0x43e1cb['query']);_0xec6cc0[_0xc583('0x31')]=_[_0xc583('0x32')](_0x43e1cb[_0xc583('0x2e')],qs['fields'](_0x327af8[_0xc583('0x30')][_0xc583('0x33')]));_0xec6cc0[_0xc583('0x31')]=_0xec6cc0['attributes'][_0xc583('0x34')]?_0xec6cc0[_0xc583('0x31')]:_0x43e1cb[_0xc583('0x2e')];if(_0x327af8[_0xc583('0x30')][_0xc583('0x3c')]){_0xec6cc0['include']=[{'all':!![]}];}_0xec6cc0=_[_0xc583('0x39')]({},_0xec6cc0,_0x327af8['options']);return db['Schedule'][_0xc583('0x42')](_0xec6cc0)[_0xc583('0x20')](handleEntityNotFound(_0x46e3bd,null))[_0xc583('0x20')](respondWithResult(_0x46e3bd,null))[_0xc583('0x43')](handleError(_0x46e3bd,null));};exports['create']=function(_0x5efd74,_0x52926c){return db[_0xc583('0x2b')][_0xc583('0x44')](_0x5efd74['body'],{})['then'](function(_0x291aff){var _0x3f661a=_0x5efd74[_0xc583('0x45')][_0xc583('0x21')]({'plain':!![]});if(!_0x3f661a)throw new Error(_0xc583('0x46'));if(_0x3f661a[_0xc583('0x47')]===_0xc583('0x45')){var _0x47e3b7=_0x291aff[_0xc583('0x21')]({'plain':!![]});var _0x251b88=_0xc583('0x22');return db[_0xc583('0x48')][_0xc583('0x42')]({'where':{'name':_0x251b88,'userProfileId':_0x3f661a[_0xc583('0x49')]},'raw':!![]})[_0xc583('0x20')](function(_0x123059){if(_0x123059&&_0x123059[_0xc583('0x4a')]===0x0){return db[_0xc583('0x23')]['create']({'name':_0x47e3b7[_0xc583('0x27')],'resourceId':_0x47e3b7['id'],'type':_0x123059[_0xc583('0x27')],'sectionId':_0x123059['id']},{})['then'](function(){return _0x291aff;});}else{return _0x291aff;}})[_0xc583('0x43')](function(_0x54e040){logger[_0xc583('0x25')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x54e040);throw _0x54e040;});}return _0x291aff;})['then'](respondWithResult(_0x52926c,0xc9))['catch'](handleError(_0x52926c,null));};exports['update']=function(_0x46751d,_0x353848){if(_0x46751d[_0xc583('0x4b')]['id']){delete _0x46751d['body']['id'];}return db[_0xc583('0x2b')][_0xc583('0x42')]({'where':{'id':_0x46751d[_0xc583('0x40')]['id']}})[_0xc583('0x20')](handleEntityNotFound(_0x353848,null))['then'](saveUpdates(_0x46751d[_0xc583('0x4b')],null))[_0xc583('0x20')](respondWithResult(_0x353848,null))['catch'](handleError(_0x353848,null));};exports[_0xc583('0x24')]=function(_0x52e016,_0x4bec02){return db[_0xc583('0x2b')][_0xc583('0x42')]({'where':{'id':_0x52e016['params']['id']}})[_0xc583('0x20')](handleEntityNotFound(_0x4bec02,null))[_0xc583('0x20')](removeEntity(_0x4bec02,null))[_0xc583('0x43')](handleError(_0x4bec02,null));};exports[_0xc583('0x4c')]=function(_0x492f6f,_0x3c4ce8,_0x29d40e){var _0x1f22f6=require('../../config/schedule');return db[_0xc583('0x2b')][_0xc583('0x42')]({'where':{'id':_0x492f6f[_0xc583('0x40')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x3c4ce8,null))[_0xc583('0x20')](function(){_0x1f22f6['run'](_0x492f6f[_0xc583('0x40')]['id']);})[_0xc583('0x20')](respondWithStatusCode(_0x3c4ce8,null))[_0xc583('0x43')](handleError(_0x3c4ce8,null));}; \ No newline at end of file +var _0xca80=['api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count','set','json','apply','reject','then','get','Scheduler','UserProfileResource','destroy','stack','index','map','Schedule','rawAttributes','type','model','name','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','options','includeAll','include','catch','length','merge','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','error','update','body','params','../../config/schedule','run','zip-dir','fast-json-patch','moment','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','../../config/logger'];(function(_0xf315e7,_0x587658){var _0x44492a=function(_0x3e2580){while(--_0x3e2580){_0xf315e7['push'](_0xf315e7['shift']());}};_0x44492a(++_0x587658);}(_0xca80,0x87));var _0x0ca8=function(_0x49f03e,_0x2a8d84){_0x49f03e=_0x49f03e-0x0;var _0x3c89db=_0xca80[_0x49f03e];return _0x3c89db;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x0ca8('0x0'));var jsonpatch=require(_0x0ca8('0x1'));var rp=require('request-promise');var moment=require(_0x0ca8('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x0ca8('0x3'));var path=require(_0x0ca8('0x4'));var sox=require(_0x0ca8('0x5'));var csv=require('to-csv');var ejs=require(_0x0ca8('0x6'));var fs=require('fs');var fs_extra=require(_0x0ca8('0x7'));var _=require(_0x0ca8('0x8'));var squel=require(_0x0ca8('0x9'));var crypto=require(_0x0ca8('0xa'));var jsforce=require(_0x0ca8('0xb'));var deskjs=require(_0x0ca8('0xc'));var toCsv=require(_0x0ca8('0xd'));var querystring=require(_0x0ca8('0xe'));var Papa=require(_0x0ca8('0xf'));var Redis=require('ioredis');var authService=require(_0x0ca8('0x10'));var qs=require(_0x0ca8('0x11'));var as=require(_0x0ca8('0x12'));var hardwareService=require(_0x0ca8('0x13'));var logger=require(_0x0ca8('0x14'))(_0x0ca8('0x15'));var utils=require(_0x0ca8('0x16'));var config=require(_0x0ca8('0x17'));var licenseUtil=require(_0x0ca8('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x455e72,_0x40849c){_0x40849c=_0x40849c||0xcc;return function(_0x4f49d7){if(_0x4f49d7){return _0x455e72[_0x0ca8('0x19')](_0x40849c);}return _0x455e72[_0x0ca8('0x1a')](_0x40849c)[_0x0ca8('0x1b')]();};}function respondWithResult(_0x30eb6a,_0x5bd4a4){_0x5bd4a4=_0x5bd4a4||0xc8;return function(_0x20e7ae){if(_0x20e7ae){return _0x30eb6a[_0x0ca8('0x1a')](_0x5bd4a4)['json'](_0x20e7ae);}};}function respondWithFilteredResult(_0x51eb1b,_0x14e3f3){return function(_0x406fbb){if(_0x406fbb){var _0x47f696=typeof _0x14e3f3[_0x0ca8('0x1c')]===_0x0ca8('0x1d')&&typeof _0x14e3f3[_0x0ca8('0x1e')]===_0x0ca8('0x1d');var _0x46cf4c=_0x406fbb[_0x0ca8('0x1f')];var _0x18ee04=_0x47f696?0x0:_0x14e3f3[_0x0ca8('0x1c')];var _0x2d7fd3=_0x47f696?_0x406fbb[_0x0ca8('0x1f')]:_0x14e3f3[_0x0ca8('0x1c')]+_0x14e3f3[_0x0ca8('0x1e')];var _0xf1f276;if(_0x2d7fd3>=_0x46cf4c){_0x2d7fd3=_0x46cf4c;_0xf1f276=0xc8;}else{_0xf1f276=0xce;}_0x51eb1b[_0x0ca8('0x1a')](_0xf1f276);return _0x51eb1b[_0x0ca8('0x20')]('Content-Range',_0x18ee04+'-'+_0x2d7fd3+'/'+_0x46cf4c)[_0x0ca8('0x21')](_0x406fbb);}return null;};}function patchUpdates(_0x19c728){return function(_0x5ee9ca){try{jsonpatch[_0x0ca8('0x22')](_0x5ee9ca,_0x19c728,!![]);}catch(_0x3e7665){return BPromise[_0x0ca8('0x23')](_0x3e7665);}return _0x5ee9ca['save']();};}function saveUpdates(_0x2cf3aa,_0x5cd3b5){return function(_0x336c98){if(_0x336c98){return _0x336c98['update'](_0x2cf3aa)[_0x0ca8('0x24')](function(_0xf74da2){return _0xf74da2;});}return null;};}function removeEntity(_0x10c2b6,_0xf6c833){return function(_0x36682c){if(_0x36682c){return _0x36682c['destroy']()[_0x0ca8('0x24')](function(){var _0x267363=_0x36682c[_0x0ca8('0x25')]({'plain':!![]});var _0x4d9c91=_0x0ca8('0x26');return db[_0x0ca8('0x27')][_0x0ca8('0x28')]({'where':{'type':_0x4d9c91,'resourceId':_0x267363['id']}})[_0x0ca8('0x24')](function(){return _0x36682c;});})[_0x0ca8('0x24')](function(){_0x10c2b6[_0x0ca8('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x588294,_0x2a336b){return function(_0x3059c6){if(!_0x3059c6){_0x588294['sendStatus'](0x194);}return _0x3059c6;};}function handleError(_0x173191,_0x298f4a){_0x298f4a=_0x298f4a||0x1f4;return function(_0x13e11f){logger['error'](_0x13e11f[_0x0ca8('0x29')]);if(_0x13e11f['name']){delete _0x13e11f['name'];}_0x173191[_0x0ca8('0x1a')](_0x298f4a)['send'](_0x13e11f);};}exports[_0x0ca8('0x2a')]=function(_0x1f9ca4,_0x269819){var _0x37af16={},_0x30d2f6={},_0x1b34c9={'count':0x0,'rows':[]};var _0x203a10=_[_0x0ca8('0x2b')](db[_0x0ca8('0x2c')][_0x0ca8('0x2d')],function(_0x52a77a){return{'name':_0x52a77a['fieldName'],'type':_0x52a77a[_0x0ca8('0x2e')]['key']};});_0x30d2f6[_0x0ca8('0x2f')]=_[_0x0ca8('0x2b')](_0x203a10,_0x0ca8('0x30'));_0x30d2f6[_0x0ca8('0x31')]=_[_0x0ca8('0x32')](_0x1f9ca4['query']);_0x30d2f6[_0x0ca8('0x33')]=_[_0x0ca8('0x34')](_0x30d2f6[_0x0ca8('0x2f')],_0x30d2f6[_0x0ca8('0x31')]);_0x37af16[_0x0ca8('0x35')]=_[_0x0ca8('0x34')](_0x30d2f6[_0x0ca8('0x2f')],qs['fields'](_0x1f9ca4[_0x0ca8('0x31')][_0x0ca8('0x36')]));_0x37af16['attributes']=_0x37af16[_0x0ca8('0x35')]['length']?_0x37af16[_0x0ca8('0x35')]:_0x30d2f6[_0x0ca8('0x2f')];if(!_0x1f9ca4[_0x0ca8('0x31')][_0x0ca8('0x37')](_0x0ca8('0x38'))){_0x37af16[_0x0ca8('0x1e')]=qs[_0x0ca8('0x1e')](_0x1f9ca4[_0x0ca8('0x31')]['limit']);_0x37af16[_0x0ca8('0x1c')]=qs[_0x0ca8('0x1c')](_0x1f9ca4[_0x0ca8('0x31')][_0x0ca8('0x1c')]);}_0x37af16['order']=qs[_0x0ca8('0x39')](_0x1f9ca4[_0x0ca8('0x31')][_0x0ca8('0x39')]);_0x37af16[_0x0ca8('0x3a')]=qs[_0x0ca8('0x33')](_[_0x0ca8('0x3b')](_0x1f9ca4[_0x0ca8('0x31')],_0x30d2f6['filters']),_0x203a10);if(_0x1f9ca4[_0x0ca8('0x31')][_0x0ca8('0x3c')]){_0x37af16[_0x0ca8('0x3a')]=_['merge'](_0x37af16[_0x0ca8('0x3a')],{'$or':_[_0x0ca8('0x2b')](_0x203a10,function(_0x1078b8){if(_0x1078b8[_0x0ca8('0x2e')]!=='VIRTUAL'){var _0x35c1fe={};_0x35c1fe[_0x1078b8[_0x0ca8('0x30')]]={'$like':'%'+_0x1f9ca4['query'][_0x0ca8('0x3c')]+'%'};return _0x35c1fe;}})});}_0x37af16=_['merge']({},_0x37af16,_0x1f9ca4[_0x0ca8('0x3d')]);var _0x513e96={'where':_0x37af16[_0x0ca8('0x3a')]};return db[_0x0ca8('0x2c')][_0x0ca8('0x1f')](_0x513e96)[_0x0ca8('0x24')](function(_0x5860da){_0x1b34c9[_0x0ca8('0x1f')]=_0x5860da;if(_0x1f9ca4[_0x0ca8('0x31')][_0x0ca8('0x3e')]){_0x37af16[_0x0ca8('0x3f')]=[{'all':!![]}];}return db[_0x0ca8('0x2c')]['findAll'](_0x37af16);})['then'](function(_0x58e029){_0x1b34c9['rows']=_0x58e029;return _0x1b34c9;})[_0x0ca8('0x24')](respondWithFilteredResult(_0x269819,_0x37af16))[_0x0ca8('0x40')](handleError(_0x269819,null));};exports['show']=function(_0x5dcab8,_0x56fe1e){var _0xfd6919={'raw':![],'where':{'id':_0x5dcab8['params']['id']}},_0x14efc4={};_0x14efc4['model']=_['keys'](db[_0x0ca8('0x2c')]['rawAttributes']);_0x14efc4[_0x0ca8('0x31')]=_[_0x0ca8('0x32')](_0x5dcab8[_0x0ca8('0x31')]);_0x14efc4[_0x0ca8('0x33')]=_[_0x0ca8('0x34')](_0x14efc4[_0x0ca8('0x2f')],_0x14efc4[_0x0ca8('0x31')]);_0xfd6919[_0x0ca8('0x35')]=_[_0x0ca8('0x34')](_0x14efc4[_0x0ca8('0x2f')],qs[_0x0ca8('0x36')](_0x5dcab8[_0x0ca8('0x31')]['fields']));_0xfd6919[_0x0ca8('0x35')]=_0xfd6919['attributes'][_0x0ca8('0x41')]?_0xfd6919[_0x0ca8('0x35')]:_0x14efc4[_0x0ca8('0x2f')];if(_0x5dcab8[_0x0ca8('0x31')]['includeAll']){_0xfd6919[_0x0ca8('0x3f')]=[{'all':!![]}];}_0xfd6919=_[_0x0ca8('0x42')]({},_0xfd6919,_0x5dcab8[_0x0ca8('0x3d')]);return db['Schedule'][_0x0ca8('0x43')](_0xfd6919)[_0x0ca8('0x24')](handleEntityNotFound(_0x56fe1e,null))[_0x0ca8('0x24')](respondWithResult(_0x56fe1e,null))['catch'](handleError(_0x56fe1e,null));};exports[_0x0ca8('0x44')]=function(_0xe1094c,_0x4fd392){return db['Schedule'][_0x0ca8('0x44')](_0xe1094c['body'],{})['then'](function(_0x1a060e){var _0x36dc81=_0xe1094c[_0x0ca8('0x45')][_0x0ca8('0x25')]({'plain':!![]});if(!_0x36dc81)throw new Error(_0x0ca8('0x46'));if(_0x36dc81['role']===_0x0ca8('0x45')){var _0x555b9e=_0x1a060e[_0x0ca8('0x25')]({'plain':!![]});var _0x2596b0=_0x0ca8('0x26');return db['UserProfileSection'][_0x0ca8('0x43')]({'where':{'name':_0x2596b0,'userProfileId':_0x36dc81[_0x0ca8('0x47')]},'raw':!![]})[_0x0ca8('0x24')](function(_0x36bc76){if(_0x36bc76&&_0x36bc76['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x555b9e[_0x0ca8('0x30')],'resourceId':_0x555b9e['id'],'type':_0x36bc76['name'],'sectionId':_0x36bc76['id']},{})[_0x0ca8('0x24')](function(){return _0x1a060e;});}else{return _0x1a060e;}})['catch'](function(_0x3b8ec0){logger[_0x0ca8('0x48')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3b8ec0);throw _0x3b8ec0;});}return _0x1a060e;})[_0x0ca8('0x24')](respondWithResult(_0x4fd392,0xc9))[_0x0ca8('0x40')](handleError(_0x4fd392,null));};exports[_0x0ca8('0x49')]=function(_0x5dccc6,_0x5e9634){if(_0x5dccc6[_0x0ca8('0x4a')]['id']){delete _0x5dccc6[_0x0ca8('0x4a')]['id'];}return db[_0x0ca8('0x2c')]['find']({'where':{'id':_0x5dccc6['params']['id']}})[_0x0ca8('0x24')](handleEntityNotFound(_0x5e9634,null))[_0x0ca8('0x24')](saveUpdates(_0x5dccc6[_0x0ca8('0x4a')],null))[_0x0ca8('0x24')](respondWithResult(_0x5e9634,null))[_0x0ca8('0x40')](handleError(_0x5e9634,null));};exports['destroy']=function(_0x21b651,_0x207210){return db[_0x0ca8('0x2c')][_0x0ca8('0x43')]({'where':{'id':_0x21b651[_0x0ca8('0x4b')]['id']}})[_0x0ca8('0x24')](handleEntityNotFound(_0x207210,null))[_0x0ca8('0x24')](removeEntity(_0x207210,null))[_0x0ca8('0x40')](handleError(_0x207210,null));};exports['run']=function(_0x572928,_0x3ee8d5,_0x163bff){var _0x117c14=require(_0x0ca8('0x4c'));return db[_0x0ca8('0x2c')][_0x0ca8('0x43')]({'where':{'id':_0x572928[_0x0ca8('0x4b')]['id']},'raw':!![]})[_0x0ca8('0x24')](handleEntityNotFound(_0x3ee8d5,null))[_0x0ca8('0x24')](function(){_0x117c14[_0x0ca8('0x4d')](_0x572928[_0x0ca8('0x4b')]['id']);})[_0x0ca8('0x24')](respondWithStatusCode(_0x3ee8d5,null))[_0x0ca8('0x40')](handleError(_0x3ee8d5,null));}; \ No newline at end of file diff --git a/server/api/schedule/schedule.model.js b/server/api/schedule/schedule.model.js index e935fde..6de8f76 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 _0xaa8e=['path','rimraf','../../config/environment','./schedule.attributes','exports','define','Schedule','lodash','util','api','request-promise'];(function(_0x5547e7,_0x3418cc){var _0x11c487=function(_0x23d324){while(--_0x23d324){_0x5547e7['push'](_0x5547e7['shift']());}};_0x11c487(++_0x3418cc);}(_0xaa8e,0xf9));var _0xeaa8=function(_0x2d4e41,_0x3e2c0d){_0x2d4e41=_0x2d4e41-0x0;var _0x4a0b09=_0xaa8e[_0x2d4e41];return _0x4a0b09;};'use strict';var _=require(_0xeaa8('0x0'));var util=require(_0xeaa8('0x1'));var logger=require('../../config/logger')(_0xeaa8('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xeaa8('0x3'));var fs=require('fs');var path=require(_0xeaa8('0x4'));var rimraf=require(_0xeaa8('0x5'));var config=require(_0xeaa8('0x6'));var attributes=require(_0xeaa8('0x7'));module[_0xeaa8('0x8')]=function(_0xead98,_0x3e3d11){return _0xead98[_0xeaa8('0x9')](_0xeaa8('0xa'),attributes,{'tableName':'tools_schedules','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2440=['tools_schedules','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','Schedule'];(function(_0x25801b,_0xc5493){var _0x58558d=function(_0x14bfc6){while(--_0x14bfc6){_0x25801b['push'](_0x25801b['shift']());}};_0x58558d(++_0xc5493);}(_0x2440,0x1e1));var _0x0244=function(_0xd2bb60,_0xc3c327){_0xd2bb60=_0xd2bb60-0x0;var _0x50e6bd=_0x2440[_0xd2bb60];return _0x50e6bd;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x0244('0x0'))(_0x0244('0x1'));var moment=require(_0x0244('0x2'));var BPromise=require(_0x0244('0x3'));var rp=require(_0x0244('0x4'));var fs=require('fs');var path=require(_0x0244('0x5'));var rimraf=require(_0x0244('0x6'));var config=require(_0x0244('0x7'));var attributes=require('./schedule.attributes');module[_0x0244('0x8')]=function(_0x383c73,_0x253d4f){return _0x383c73[_0x0244('0x9')](_0x0244('0xa'),attributes,{'tableName':_0x0244('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/schedule/schedule.rpc.js b/server/api/schedule/schedule.rpc.js index 7f82c2b..c9941e2 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 _0x3ac9=['result','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','Schedule,\x20%s,\x20%s','request\x20sent','debug','Schedule,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x48be61,_0x204c04){var _0x55fcd9=function(_0x5a9c6b){while(--_0x5a9c6b){_0x48be61['push'](_0x48be61['shift']());}};_0x55fcd9(++_0x204c04);}(_0x3ac9,0x1cf));var _0x93ac=function(_0x7c5834,_0xa96cfb){_0x7c5834=_0x7c5834-0x0;var _0x40becf=_0x3ac9[_0x7c5834];return _0x40becf;};'use strict';var _=require(_0x93ac('0x0'));var util=require(_0x93ac('0x1'));var moment=require(_0x93ac('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x93ac('0x3'));var db=require(_0x93ac('0x4'))['db'];var utils=require(_0x93ac('0x5'));var logger=require(_0x93ac('0x6'))('rpc');var config=require(_0x93ac('0x7'));var jayson=require(_0x93ac('0x8'));var client=jayson[_0x93ac('0x9')][_0x93ac('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2f91e3,_0x2c9b9c,_0x69c60){return new BPromise(function(_0x579891,_0x5b1658){return client['request'](_0x2f91e3,_0x69c60)[_0x93ac('0xb')](function(_0x8e2697){logger[_0x93ac('0xc')](_0x93ac('0xd'),_0x2c9b9c,_0x93ac('0xe'));logger[_0x93ac('0xf')](_0x93ac('0x10'),_0x2c9b9c,_0x93ac('0xe'),JSON[_0x93ac('0x11')](_0x8e2697));if(_0x8e2697[_0x93ac('0x12')]){if(_0x8e2697[_0x93ac('0x12')][_0x93ac('0x13')]===0x1f4){logger['error']('Schedule,\x20%s,\x20%s',_0x2c9b9c,_0x8e2697[_0x93ac('0x12')][_0x93ac('0x14')]);return _0x5b1658(_0x8e2697[_0x93ac('0x12')][_0x93ac('0x14')]);}logger['error'](_0x93ac('0xd'),_0x2c9b9c,_0x8e2697[_0x93ac('0x12')]['message']);return _0x579891(_0x8e2697[_0x93ac('0x12')][_0x93ac('0x14')]);}else{logger[_0x93ac('0xc')](_0x93ac('0xd'),_0x2c9b9c,_0x93ac('0xe'));_0x579891(_0x8e2697[_0x93ac('0x15')][_0x93ac('0x14')]);}})['catch'](function(_0x19305e){logger[_0x93ac('0x12')]('Schedule,\x20%s,\x20%s',_0x2c9b9c,_0x19305e);_0x5b1658(_0x19305e);});});} \ No newline at end of file +var _0x3d9d=['rpc','../../config/environment','jayson/promise','client','request','Schedule,\x20%s,\x20%s','Schedule,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger'];(function(_0x339d49,_0x27850b){var _0x2e24fa=function(_0xe24d37){while(--_0xe24d37){_0x339d49['push'](_0x339d49['shift']());}};_0x2e24fa(++_0x27850b);}(_0x3d9d,0x15e));var _0xd3d9=function(_0x450de1,_0x5b94bb){_0x450de1=_0x450de1-0x0;var _0x53849e=_0x3d9d[_0x450de1];return _0x53849e;};'use strict';var _=require(_0xd3d9('0x0'));var util=require(_0xd3d9('0x1'));var moment=require(_0xd3d9('0x2'));var BPromise=require(_0xd3d9('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd3d9('0x4'));var db=require(_0xd3d9('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xd3d9('0x6'))(_0xd3d9('0x7'));var config=require(_0xd3d9('0x8'));var jayson=require(_0xd3d9('0x9'));var client=jayson[_0xd3d9('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x574993,_0x4fb895,_0x163f0e){return new BPromise(function(_0x3dbdbd,_0x95453a){return client[_0xd3d9('0xb')](_0x574993,_0x163f0e)['then'](function(_0x147620){logger['info'](_0xd3d9('0xc'),_0x4fb895,'request\x20sent');logger['debug'](_0xd3d9('0xd'),_0x4fb895,_0xd3d9('0xe'),JSON[_0xd3d9('0xf')](_0x147620));if(_0x147620[_0xd3d9('0x10')]){if(_0x147620[_0xd3d9('0x10')][_0xd3d9('0x11')]===0x1f4){logger[_0xd3d9('0x10')]('Schedule,\x20%s,\x20%s',_0x4fb895,_0x147620[_0xd3d9('0x10')]['message']);return _0x95453a(_0x147620[_0xd3d9('0x10')][_0xd3d9('0x12')]);}logger['error'](_0xd3d9('0xc'),_0x4fb895,_0x147620['error'][_0xd3d9('0x12')]);return _0x3dbdbd(_0x147620[_0xd3d9('0x10')][_0xd3d9('0x12')]);}else{logger[_0xd3d9('0x13')](_0xd3d9('0xc'),_0x4fb895,_0xd3d9('0xe'));_0x3dbdbd(_0x147620['result'][_0xd3d9('0x12')]);}})[_0xd3d9('0x14')](function(_0x966e4c){logger[_0xd3d9('0x10')](_0xd3d9('0xc'),_0x4fb895,_0x966e4c);_0x95453a(_0x966e4c);});});} \ No newline at end of file diff --git a/server/api/screenRecording/index.js b/server/api/screenRecording/index.js index f12ab5a..cf925d6 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 _0xf30d=['update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./screenRecording.controller','isAuthenticated','index','get','/describe','describe','/:id','download','post','put'];(function(_0x4d7116,_0xdb8175){var _0x4593dc=function(_0x51d44e){while(--_0x51d44e){_0x4d7116['push'](_0x4d7116['shift']());}};_0x4593dc(++_0xdb8175);}(_0xf30d,0x19c));var _0xdf30=function(_0x3df991,_0x41371f){_0x3df991=_0x3df991-0x0;var _0x4cf98=_0xf30d[_0x3df991];return _0x4cf98;};'use strict';var multer=require(_0xdf30('0x0'));var util=require(_0xdf30('0x1'));var path=require(_0xdf30('0x2'));var timeout=require(_0xdf30('0x3'));var express=require(_0xdf30('0x4'));var router=express[_0xdf30('0x5')]();var fs_extra=require(_0xdf30('0x6'));var auth=require(_0xdf30('0x7'));var interaction=require(_0xdf30('0x8'));var config=require(_0xdf30('0x9'));var controller=require(_0xdf30('0xa'));router['get']('/',auth[_0xdf30('0xb')](),controller[_0xdf30('0xc')]);router[_0xdf30('0xd')](_0xdf30('0xe'),auth[_0xdf30('0xb')](),controller[_0xdf30('0xf')]);router[_0xdf30('0xd')](_0xdf30('0x10'),auth[_0xdf30('0xb')](),controller['show']);router[_0xdf30('0xd')]('/:id/download',auth[_0xdf30('0xb')](),controller[_0xdf30('0x11')]);router[_0xdf30('0x12')]('/',auth['isAuthenticated'](),controller['create']);router[_0xdf30('0x13')](_0xdf30('0x10'),auth['isAuthenticated'](),controller[_0xdf30('0x14')]);router[_0xdf30('0x15')](_0xdf30('0x10'),auth[_0xdf30('0xb')](),controller[_0xdf30('0x16')]);module[_0xdf30('0x17')]=router; \ No newline at end of file +var _0xff67=['util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./screenRecording.controller','get','isAuthenticated','index','/describe','/:id','show','/:id/download','download','post','put','update','exports','multer'];(function(_0x38cd20,_0x2d712a){var _0x5956b6=function(_0x407a7c){while(--_0x407a7c){_0x38cd20['push'](_0x38cd20['shift']());}};_0x5956b6(++_0x2d712a);}(_0xff67,0x1b8));var _0x7ff6=function(_0x3d7821,_0x18836b){_0x3d7821=_0x3d7821-0x0;var _0xf50bd9=_0xff67[_0x3d7821];return _0xf50bd9;};'use strict';var multer=require(_0x7ff6('0x0'));var util=require(_0x7ff6('0x1'));var path=require(_0x7ff6('0x2'));var timeout=require(_0x7ff6('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x7ff6('0x4'));var auth=require(_0x7ff6('0x5'));var interaction=require(_0x7ff6('0x6'));var config=require(_0x7ff6('0x7'));var controller=require(_0x7ff6('0x8'));router[_0x7ff6('0x9')]('/',auth[_0x7ff6('0xa')](),controller[_0x7ff6('0xb')]);router['get'](_0x7ff6('0xc'),auth[_0x7ff6('0xa')](),controller['describe']);router['get'](_0x7ff6('0xd'),auth[_0x7ff6('0xa')](),controller[_0x7ff6('0xe')]);router['get'](_0x7ff6('0xf'),auth['isAuthenticated'](),controller[_0x7ff6('0x10')]);router[_0x7ff6('0x11')]('/',auth['isAuthenticated'](),controller['create']);router[_0x7ff6('0x12')](_0x7ff6('0xd'),auth[_0x7ff6('0xa')](),controller[_0x7ff6('0x13')]);router['delete'](_0x7ff6('0xd'),auth[_0x7ff6('0xa')](),controller['destroy']);module[_0x7ff6('0x14')]=router; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.attributes.js b/server/api/screenRecording/screenRecording.attributes.js index ad4c623..7e4eab6 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 _0x9563=['MM-DD-YYYY\x20HH:mm','toString','createdAt','updatedAt','sequelize','moment','../../config/environment','exports','VIRTUAL','getDataValue','STRING','replace','setDataValue','value','INTEGER','startedAt','subtract','closedAt','duration','DATE','format'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0x9563,0x1e7));var _0x3956=function(_0x4a7c5c,_0xc7584e){_0x4a7c5c=_0x4a7c5c-0x0;var _0x1f2361=_0x9563[_0x4a7c5c];return _0x1f2361;};'use strict';var Sequelize=require(_0x3956('0x0'));var moment=require(_0x3956('0x1'));var path=require('path');var config=require(_0x3956('0x2'));module[_0x3956('0x3')]={'format':{'type':Sequelize[_0x3956('0x4')],'get':function(){return this[_0x3956('0x5')]('value')?path['extname'](this[_0x3956('0x5')]('value')):undefined;}},'interactionid':{'type':Sequelize[_0x3956('0x6')]},'channel':{'type':Sequelize[_0x3956('0x6')]},'value':{'type':Sequelize[_0x3956('0x6')],'set':function(_0xba3e4b){var _0x47bdbc=_0xba3e4b[_0x3956('0x7')](/\\/g,'/');this[_0x3956('0x8')](_0x3956('0x9'),_0x47bdbc);}},'rating':{'type':Sequelize[_0x3956('0xa')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0x3956('0xa')],'set':function(_0x4dd27f){this['setDataValue'](_0x3956('0xb'),moment()[_0x3956('0xc')](_0x4dd27f,'ms'));this[_0x3956('0x8')](_0x3956('0xd'),moment());this['setDataValue'](_0x3956('0xe'),_0x4dd27f);}},'startedAt':{'type':Sequelize[_0x3956('0xf')],'get':function(){return moment(this[_0x3956('0x5')](_0x3956('0xb')))[_0x3956('0x10')](_0x3956('0x11'))[_0x3956('0x12')]();}},'closedAt':{'type':Sequelize[_0x3956('0xf')],'get':function(){return moment(this[_0x3956('0x5')]('closedAt'))['format']('MM-DD-YYYY\x20HH:mm')[_0x3956('0x12')]();}},'createdAt':{'type':Sequelize[_0x3956('0xf')],'get':function(){return moment(this['getDataValue'](_0x3956('0x13')))[_0x3956('0x10')](_0x3956('0x11'))[_0x3956('0x12')]();}},'updatedAt':{'type':Sequelize[_0x3956('0xf')],'get':function(){return moment(this[_0x3956('0x5')](_0x3956('0x14')))[_0x3956('0x10')](_0x3956('0x11'))[_0x3956('0x12')]();}}}; \ No newline at end of file +var _0x0a6b=['closedAt','setDataValue','duration','DATE','format','MM-DD-YYYY\x20HH:mm','updatedAt','toString','sequelize','path','../../config/environment','exports','VIRTUAL','getDataValue','value','extname','STRING','INTEGER','startedAt','subtract'];(function(_0xf90f20,_0x3e78cf){var _0x5affcd=function(_0x53341e){while(--_0x53341e){_0xf90f20['push'](_0xf90f20['shift']());}};_0x5affcd(++_0x3e78cf);}(_0x0a6b,0x120));var _0xb0a6=function(_0x2eb1ef,_0x3135d3){_0x2eb1ef=_0x2eb1ef-0x0;var _0x3d4cc4=_0x0a6b[_0x2eb1ef];return _0x3d4cc4;};'use strict';var Sequelize=require(_0xb0a6('0x0'));var moment=require('moment');var path=require(_0xb0a6('0x1'));var config=require(_0xb0a6('0x2'));module[_0xb0a6('0x3')]={'format':{'type':Sequelize[_0xb0a6('0x4')],'get':function(){return this[_0xb0a6('0x5')](_0xb0a6('0x6'))?path[_0xb0a6('0x7')](this[_0xb0a6('0x5')](_0xb0a6('0x6'))):undefined;}},'interactionid':{'type':Sequelize[_0xb0a6('0x8')]},'channel':{'type':Sequelize['STRING']},'value':{'type':Sequelize[_0xb0a6('0x8')],'set':function(_0x504a45){var _0x23e004=_0x504a45['replace'](/\\/g,'/');this['setDataValue'](_0xb0a6('0x6'),_0x23e004);}},'rating':{'type':Sequelize['INTEGER'],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0xb0a6('0x9')],'set':function(_0x423683){this['setDataValue'](_0xb0a6('0xa'),moment()[_0xb0a6('0xb')](_0x423683,'ms'));this['setDataValue'](_0xb0a6('0xc'),moment());this[_0xb0a6('0xd')](_0xb0a6('0xe'),_0x423683);}},'startedAt':{'type':Sequelize[_0xb0a6('0xf')],'get':function(){return moment(this[_0xb0a6('0x5')](_0xb0a6('0xa')))[_0xb0a6('0x10')](_0xb0a6('0x11'))['toString']();}},'closedAt':{'type':Sequelize[_0xb0a6('0xf')],'get':function(){return moment(this[_0xb0a6('0x5')](_0xb0a6('0xc')))[_0xb0a6('0x10')](_0xb0a6('0x11'))['toString']();}},'createdAt':{'type':Sequelize[_0xb0a6('0xf')],'get':function(){return moment(this[_0xb0a6('0x5')]('createdAt'))[_0xb0a6('0x10')]('MM-DD-YYYY\x20HH:mm')['toString']();}},'updatedAt':{'type':Sequelize[_0xb0a6('0xf')],'get':function(){return moment(this[_0xb0a6('0x5')](_0xb0a6('0x12')))[_0xb0a6('0x10')](_0xb0a6('0x11'))[_0xb0a6('0x13')]();}}}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.controller.js b/server/api/screenRecording/screenRecording.controller.js index 9d50bf3..b54edf1 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 _0xb4c7=['rawAttributes','fieldName','type','format','query','filters','model','attributes','intersection','fields','length','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','findAll','rows','catch','show','keys','include','find','create','body','duration','createdAt','closedAt','value','describe','../../components/encryptor','uniqueid','params','join','server/files/screen_recordings','%s.cypher','existsSync','decryptFile','secrets','recording','root','ValidationError','download','filename','extname','unlink','message','Not\x20found','isNil','info','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','crypto','jsforce','to-csv','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','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','ScreenRecording'];(function(_0x5cc8,_0x1faa02){var _0x450661=function(_0x237b05){while(--_0x237b05){_0x5cc8['push'](_0x5cc8['shift']());}};_0x450661(++_0x1faa02);}(_0xb4c7,0x1ea));var _0x7b4c=function(_0x33161c,_0x63b738){_0x33161c=_0x33161c-0x0;var _0x2ff10f=_0xb4c7[_0x33161c];return _0x2ff10f;};'use strict';var emlformat=require(_0x7b4c('0x0'));var rimraf=require(_0x7b4c('0x1'));var zipdir=require(_0x7b4c('0x2'));var jsonpatch=require(_0x7b4c('0x3'));var rp=require(_0x7b4c('0x4'));var moment=require('moment');var BPromise=require(_0x7b4c('0x5'));var Mustache=require(_0x7b4c('0x6'));var util=require(_0x7b4c('0x7'));var path=require(_0x7b4c('0x8'));var sox=require(_0x7b4c('0x9'));var csv=require('to-csv');var ejs=require(_0x7b4c('0xa'));var fs=require('fs');var fs_extra=require(_0x7b4c('0xb'));var _=require(_0x7b4c('0xc'));var squel=require('squel');var crypto=require(_0x7b4c('0xd'));var jsforce=require(_0x7b4c('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x7b4c('0xf'));var querystring=require(_0x7b4c('0x10'));var Papa=require(_0x7b4c('0x11'));var Redis=require(_0x7b4c('0x12'));var authService=require(_0x7b4c('0x13'));var qs=require(_0x7b4c('0x14'));var as=require(_0x7b4c('0x15'));var hardwareService=require(_0x7b4c('0x16'));var logger=require(_0x7b4c('0x17'))(_0x7b4c('0x18'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x7b4c('0x19'));var db=require(_0x7b4c('0x1a'))['db'];function respondWithStatusCode(_0x38656b,_0x1722ad){_0x1722ad=_0x1722ad||0xcc;return function(_0x3e1558){if(_0x3e1558){return _0x38656b[_0x7b4c('0x1b')](_0x1722ad);}return _0x38656b[_0x7b4c('0x1c')](_0x1722ad)[_0x7b4c('0x1d')]();};}function respondWithResult(_0x25b90b,_0x387488){_0x387488=_0x387488||0xc8;return function(_0x593a19){if(_0x593a19){return _0x25b90b[_0x7b4c('0x1c')](_0x387488)[_0x7b4c('0x1e')](_0x593a19);}};}function respondWithFilteredResult(_0xdc71cd,_0x2a0e2f){return function(_0xa0a812){if(_0xa0a812){var _0x2471b3=typeof _0x2a0e2f[_0x7b4c('0x1f')]===_0x7b4c('0x20')&&typeof _0x2a0e2f['limit']===_0x7b4c('0x20');var _0xe71d88=_0xa0a812[_0x7b4c('0x21')];var _0x36c02a=_0x2471b3?0x0:_0x2a0e2f['offset'];var _0x3ce10c=_0x2471b3?_0xa0a812[_0x7b4c('0x21')]:_0x2a0e2f[_0x7b4c('0x1f')]+_0x2a0e2f[_0x7b4c('0x22')];var _0x2d4c72;if(_0x3ce10c>=_0xe71d88){_0x3ce10c=_0xe71d88;_0x2d4c72=0xc8;}else{_0x2d4c72=0xce;}_0xdc71cd[_0x7b4c('0x1c')](_0x2d4c72);return _0xdc71cd[_0x7b4c('0x23')](_0x7b4c('0x24'),_0x36c02a+'-'+_0x3ce10c+'/'+_0xe71d88)[_0x7b4c('0x1e')](_0xa0a812);}return null;};}function patchUpdates(_0x55e3df){return function(_0x1f06ec){try{jsonpatch[_0x7b4c('0x25')](_0x1f06ec,_0x55e3df,!![]);}catch(_0x11996d){return BPromise[_0x7b4c('0x26')](_0x11996d);}return _0x1f06ec[_0x7b4c('0x27')]();};}function saveUpdates(_0x168ac9,_0x176704){return function(_0x3d4826){if(_0x3d4826){return _0x3d4826[_0x7b4c('0x28')](_0x168ac9)[_0x7b4c('0x29')](function(_0x5eec1e){return _0x5eec1e;});}return null;};}function removeEntity(_0x45438c,_0x4350c9){return function(_0x276271){if(_0x276271){return _0x276271[_0x7b4c('0x2a')]()[_0x7b4c('0x29')](function(){_0x45438c[_0x7b4c('0x1c')](0xcc)[_0x7b4c('0x1d')]();});}};}function handleEntityNotFound(_0x459eb4,_0x1f311e){return function(_0x1a69db){if(!_0x1a69db){_0x459eb4[_0x7b4c('0x1b')](0x194);}return _0x1a69db;};}function handleError(_0x257da2,_0x316e5f){_0x316e5f=_0x316e5f||0x1f4;return function(_0x501f75){logger[_0x7b4c('0x2b')](_0x501f75[_0x7b4c('0x2c')]);if(_0x501f75[_0x7b4c('0x2d')]){delete _0x501f75[_0x7b4c('0x2d')];}_0x257da2[_0x7b4c('0x1c')](_0x316e5f)[_0x7b4c('0x2e')](_0x501f75);};}exports[_0x7b4c('0x2f')]=function(_0x2552f9,_0x3e4a46){var _0x9a799b={},_0x3585cd={},_0x130ace={'count':0x0,'rows':[]};var _0x3544bc=_[_0x7b4c('0x30')](db[_0x7b4c('0x31')][_0x7b4c('0x32')],function(_0x1d0724){return{'name':_0x1d0724[_0x7b4c('0x33')],'type':_0x1d0724[_0x7b4c('0x34')]['key']};});_0x3585cd['model']=_['differenceBy'](_[_0x7b4c('0x30')](_0x3544bc,_0x7b4c('0x2d')),[_0x7b4c('0x35')]);_0x3585cd[_0x7b4c('0x36')]=_['keys'](_0x2552f9[_0x7b4c('0x36')]);_0x3585cd[_0x7b4c('0x37')]=_['intersection'](_0x3585cd[_0x7b4c('0x38')],_0x3585cd['query']);_0x9a799b[_0x7b4c('0x39')]=_[_0x7b4c('0x3a')](_0x3585cd[_0x7b4c('0x38')],qs['fields'](_0x2552f9[_0x7b4c('0x36')][_0x7b4c('0x3b')]));_0x9a799b['attributes']=_0x9a799b[_0x7b4c('0x39')][_0x7b4c('0x3c')]?_0x9a799b[_0x7b4c('0x39')]:_0x3585cd[_0x7b4c('0x38')];if(!_0x2552f9['query']['hasOwnProperty'](_0x7b4c('0x3d'))){_0x9a799b[_0x7b4c('0x22')]=qs['limit'](_0x2552f9[_0x7b4c('0x36')]['limit']);_0x9a799b['offset']=qs[_0x7b4c('0x1f')](_0x2552f9[_0x7b4c('0x36')][_0x7b4c('0x1f')]);}_0x9a799b[_0x7b4c('0x3e')]=qs['sort'](_0x2552f9[_0x7b4c('0x36')][_0x7b4c('0x3f')]);_0x9a799b[_0x7b4c('0x40')]=qs[_0x7b4c('0x37')](_[_0x7b4c('0x41')](_0x2552f9[_0x7b4c('0x36')],_0x3585cd[_0x7b4c('0x37')]),_0x3544bc);if(_0x2552f9['query']['filter']){_0x9a799b[_0x7b4c('0x40')]=_[_0x7b4c('0x42')](_0x9a799b[_0x7b4c('0x40')],{'$or':_[_0x7b4c('0x30')](_0x3544bc,function(_0xb8486d){if(_0xb8486d['type']!==_0x7b4c('0x43')){var _0x902367={};_0x902367[_0xb8486d[_0x7b4c('0x2d')]]={'$like':'%'+_0x2552f9[_0x7b4c('0x36')][_0x7b4c('0x44')]+'%'};return _0x902367;}})});}_0x9a799b=_[_0x7b4c('0x42')]({},_0x9a799b,_0x2552f9[_0x7b4c('0x45')]);var _0x1080fc={'where':_0x9a799b[_0x7b4c('0x40')]};return db['ScreenRecording'][_0x7b4c('0x21')](_0x1080fc)['then'](function(_0x2a3a74){_0x130ace['count']=_0x2a3a74;if(_0x2552f9[_0x7b4c('0x36')][_0x7b4c('0x46')]){_0x9a799b['include']=[{'all':!![]}];}return db['ScreenRecording'][_0x7b4c('0x47')](_0x9a799b);})[_0x7b4c('0x29')](function(_0x1def44){_0x130ace[_0x7b4c('0x48')]=_0x1def44;return _0x130ace;})['then'](respondWithFilteredResult(_0x3e4a46,_0x9a799b))[_0x7b4c('0x49')](handleError(_0x3e4a46,null));};exports[_0x7b4c('0x4a')]=function(_0x100774,_0x5d4ed8){var _0x45ad59={'raw':![],'where':{'id':_0x100774['params']['id']}},_0x4b4757={};_0x4b4757[_0x7b4c('0x38')]=_['keys'](db[_0x7b4c('0x31')][_0x7b4c('0x32')]);_0x4b4757[_0x7b4c('0x36')]=_[_0x7b4c('0x4b')](_0x100774[_0x7b4c('0x36')]);_0x4b4757[_0x7b4c('0x37')]=_[_0x7b4c('0x3a')](_0x4b4757[_0x7b4c('0x38')],_0x4b4757[_0x7b4c('0x36')]);_0x45ad59['attributes']=_[_0x7b4c('0x3a')](_0x4b4757['model'],qs['fields'](_0x100774[_0x7b4c('0x36')][_0x7b4c('0x3b')]));_0x45ad59['attributes']=_0x45ad59['attributes'][_0x7b4c('0x3c')]?_0x45ad59[_0x7b4c('0x39')]:_0x4b4757[_0x7b4c('0x38')];if(_0x100774[_0x7b4c('0x36')][_0x7b4c('0x46')]){_0x45ad59[_0x7b4c('0x4c')]=[{'all':!![]}];}_0x45ad59=_[_0x7b4c('0x42')]({},_0x45ad59,_0x100774[_0x7b4c('0x45')]);return db['ScreenRecording'][_0x7b4c('0x4d')](_0x45ad59)[_0x7b4c('0x29')](handleEntityNotFound(_0x5d4ed8,null))[_0x7b4c('0x29')](respondWithResult(_0x5d4ed8,null))[_0x7b4c('0x49')](handleError(_0x5d4ed8,null));};exports[_0x7b4c('0x4e')]=function(_0x379f15,_0x11a6f9){return db[_0x7b4c('0x31')][_0x7b4c('0x4e')](_0x379f15['body'],{})['then'](respondWithResult(_0x11a6f9,0xc9))[_0x7b4c('0x49')](handleError(_0x11a6f9,null));};exports[_0x7b4c('0x28')]=function(_0x97eadf,_0x5d4192){if(_0x97eadf[_0x7b4c('0x4f')]['id']){delete _0x97eadf[_0x7b4c('0x4f')]['id'];}delete _0x97eadf['body'][_0x7b4c('0x50')];delete _0x97eadf['body'][_0x7b4c('0x51')];delete _0x97eadf['body'][_0x7b4c('0x52')];delete _0x97eadf['body'][_0x7b4c('0x53')];return db[_0x7b4c('0x31')]['find']({'where':{'id':_0x97eadf['params']['id']}})[_0x7b4c('0x29')](handleEntityNotFound(_0x5d4192,null))[_0x7b4c('0x29')](saveUpdates(_0x97eadf[_0x7b4c('0x4f')],null))['then'](respondWithResult(_0x5d4192,null))['catch'](handleError(_0x5d4192,null));};exports[_0x7b4c('0x54')]=function(_0x1c118a,_0x4cbf1b){return db['ScreenRecording'][_0x7b4c('0x54')]()[_0x7b4c('0x29')](respondWithResult(_0x4cbf1b,null))[_0x7b4c('0x49')](handleError(_0x4cbf1b,null));};exports['download']=function(_0x1d017d,_0x2f009a,_0x4aaf57){var _0x484e80=require(_0x7b4c('0x55'));var _0x4d8491=![];var _0x59db20={};if(_0x1d017d[_0x7b4c('0x36')]['type']&&_0x1d017d['query'][_0x7b4c('0x34')]===_0x7b4c('0x56')){_0x59db20[_0x7b4c('0x56')]=_0x1d017d[_0x7b4c('0x57')]['id'];}else{_0x59db20['id']=_0x1d017d['params']['id'];}return db['ScreenRecording'][_0x7b4c('0x4d')]({'where':_0x59db20,'attributes':['id',_0x7b4c('0x53')],'raw':!![]})[_0x7b4c('0x29')](handleEntityNotFound(_0x2f009a,null))['then'](function(_0x255262){if(_0x255262){var _0x3d81fb=path[_0x7b4c('0x58')](config['root'],_0x7b4c('0x59'),_0x255262[_0x7b4c('0x53')]);var _0x529803=util[_0x7b4c('0x35')](_0x7b4c('0x5a'),_0x3d81fb);if(fs[_0x7b4c('0x5b')](_0x529803)){_0x4d8491=!![];return _0x484e80[_0x7b4c('0x5c')](_0x529803,_0x3d81fb,config[_0x7b4c('0x5d')][_0x7b4c('0x5e')])[_0x7b4c('0x29')](function(){return _0x255262;});}return _0x255262;}})['then'](function(_0x4443d0){if(_0x4443d0){var _0x2dc79a=path['join'](config[_0x7b4c('0x5f')],_0x7b4c('0x59'),_0x4443d0[_0x7b4c('0x53')]);if(!fs[_0x7b4c('0x5b')](_0x2dc79a)){throw new db['Sequelize'][(_0x7b4c('0x60'))]('ScreenRecording\x20not\x20found');}if(_0x4443d0['filename']){return _0x2f009a[_0x7b4c('0x61')](_0x2dc79a,_0x4443d0[_0x7b4c('0x62')]+path[_0x7b4c('0x63')](_0x2dc79a),function(){if(_0x4d8491){fs[_0x7b4c('0x64')](_0x2dc79a);}});}else{return _0x2f009a[_0x7b4c('0x61')](_0x2dc79a,function(_0x5b24f6){if(_0x4d8491){fs['unlink'](_0x2dc79a);}});}}})[_0x7b4c('0x49')](function(_0x3c84af){if(_0x3c84af[_0x7b4c('0x65')]==='ScreenRecording\x20not\x20found'){_0x2f009a[_0x7b4c('0x1c')](0x194)[_0x7b4c('0x2e')](_0x7b4c('0x66'));}else{return handleError(_0x2f009a,null);}});};exports['destroy']=function(_0x222b47,_0x3b2144){return db[_0x7b4c('0x31')]['find']({'where':{'id':_0x222b47[_0x7b4c('0x57')]['id']}})[_0x7b4c('0x29')](function(_0x4ac03e){if(_[_0x7b4c('0x67')](_0x4ac03e)){throw new ReferenceError('Entity\x20not\x20found');}return _0x4ac03e;})[_0x7b4c('0x29')](function(_0x11ae6e){var _0x3a3713=path['join'](config['root'],_0x7b4c('0x59'),_0x11ae6e[_0x7b4c('0x53')]);logger[_0x7b4c('0x68')]('cancellazione\x20fisica\x20documento\x20%s',_0x3a3713);if(!_[_0x7b4c('0x67')](_0x11ae6e['value'])&&fs[_0x7b4c('0x5b')](_0x3a3713)){logger[_0x7b4c('0x68')](_0x7b4c('0x69')+_0x3a3713+_0x7b4c('0x6a'));fs[_0x7b4c('0x6b')](_0x3a3713);}_0x3a3713=_0x3a3713+'.cypher';if(!_[_0x7b4c('0x67')](_0x11ae6e[_0x7b4c('0x53')])&&fs['existsSync'](_0x3a3713)){logger[_0x7b4c('0x68')](_0x7b4c('0x69')+_0x3a3713+_0x7b4c('0x6a'));fs[_0x7b4c('0x6b')](_0x3a3713);}return _0x11ae6e;})[_0x7b4c('0x29')](function(_0x2befd7){if(!_0x2befd7)throw new InternalError();return _0x2befd7[_0x7b4c('0x2a')]();})[_0x7b4c('0x29')](function(){_0x3b2144['status'](0xcc)[_0x7b4c('0x1d')]();})[_0x7b4c('0x49')](handleError(_0x3b2144,null));}; \ No newline at end of file +var _0x7dfd=['../../components/encryptor','uniqueid','join','%s.cypher','existsSync','decryptFile','secrets','root','server/files/screen_recordings','Sequelize','ValidationError','ScreenRecording\x20not\x20found','filename','extname','unlink','message','isNil','info','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','File:\x20\x22','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','apply','reject','update','then','stack','name','send','index','ScreenRecording','fieldName','key','model','map','format','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','type','VIRTUAL','options','includeAll','include','rows','show','params','rawAttributes','length','catch','create','body','duration','createdAt','closedAt','value','find','describe','download'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x7dfd,0x1c2));var _0xd7df=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7dfd[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xd7df('0x0'));var rimraf=require(_0xd7df('0x1'));var zipdir=require(_0xd7df('0x2'));var jsonpatch=require(_0xd7df('0x3'));var rp=require(_0xd7df('0x4'));var moment=require(_0xd7df('0x5'));var BPromise=require(_0xd7df('0x6'));var Mustache=require(_0xd7df('0x7'));var util=require(_0xd7df('0x8'));var path=require(_0xd7df('0x9'));var sox=require(_0xd7df('0xa'));var csv=require(_0xd7df('0xb'));var ejs=require(_0xd7df('0xc'));var fs=require('fs');var fs_extra=require(_0xd7df('0xd'));var _=require(_0xd7df('0xe'));var squel=require(_0xd7df('0xf'));var crypto=require(_0xd7df('0x10'));var jsforce=require('jsforce');var deskjs=require(_0xd7df('0x11'));var toCsv=require(_0xd7df('0xb'));var querystring=require(_0xd7df('0x12'));var Papa=require(_0xd7df('0x13'));var Redis=require('ioredis');var authService=require(_0xd7df('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0xd7df('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd7df('0x16'))(_0xd7df('0x17'));var utils=require(_0xd7df('0x18'));var config=require(_0xd7df('0x19'));var licenseUtil=require(_0xd7df('0x1a'));var db=require(_0xd7df('0x1b'))['db'];function respondWithStatusCode(_0x2e8187,_0x3da618){_0x3da618=_0x3da618||0xcc;return function(_0x7ba3c){if(_0x7ba3c){return _0x2e8187[_0xd7df('0x1c')](_0x3da618);}return _0x2e8187[_0xd7df('0x1d')](_0x3da618)[_0xd7df('0x1e')]();};}function respondWithResult(_0xe1595f,_0x196632){_0x196632=_0x196632||0xc8;return function(_0x3b2559){if(_0x3b2559){return _0xe1595f[_0xd7df('0x1d')](_0x196632)[_0xd7df('0x1f')](_0x3b2559);}};}function respondWithFilteredResult(_0x57b8be,_0x4c5cf){return function(_0x23cdbc){if(_0x23cdbc){var _0x513b13=typeof _0x4c5cf[_0xd7df('0x20')]===_0xd7df('0x21')&&typeof _0x4c5cf['limit']===_0xd7df('0x21');var _0x30ee65=_0x23cdbc[_0xd7df('0x22')];var _0x5210e5=_0x513b13?0x0:_0x4c5cf[_0xd7df('0x20')];var _0x471621=_0x513b13?_0x23cdbc[_0xd7df('0x22')]:_0x4c5cf['offset']+_0x4c5cf[_0xd7df('0x23')];var _0x20dc3e;if(_0x471621>=_0x30ee65){_0x471621=_0x30ee65;_0x20dc3e=0xc8;}else{_0x20dc3e=0xce;}_0x57b8be[_0xd7df('0x1d')](_0x20dc3e);return _0x57b8be['set'](_0xd7df('0x24'),_0x5210e5+'-'+_0x471621+'/'+_0x30ee65)['json'](_0x23cdbc);}return null;};}function patchUpdates(_0x225e33){return function(_0x5ab737){try{jsonpatch[_0xd7df('0x25')](_0x5ab737,_0x225e33,!![]);}catch(_0x342b54){return BPromise[_0xd7df('0x26')](_0x342b54);}return _0x5ab737['save']();};}function saveUpdates(_0xc50077,_0x502ae8){return function(_0x44079b){if(_0x44079b){return _0x44079b[_0xd7df('0x27')](_0xc50077)[_0xd7df('0x28')](function(_0x29f354){return _0x29f354;});}return null;};}function removeEntity(_0x1c774b,_0xa80cbf){return function(_0x1e3bf3){if(_0x1e3bf3){return _0x1e3bf3['destroy']()['then'](function(){_0x1c774b[_0xd7df('0x1d')](0xcc)[_0xd7df('0x1e')]();});}};}function handleEntityNotFound(_0x26047f,_0x459f11){return function(_0x13f190){if(!_0x13f190){_0x26047f[_0xd7df('0x1c')](0x194);}return _0x13f190;};}function handleError(_0x373359,_0x2b6fde){_0x2b6fde=_0x2b6fde||0x1f4;return function(_0x163904){logger['error'](_0x163904[_0xd7df('0x29')]);if(_0x163904[_0xd7df('0x2a')]){delete _0x163904[_0xd7df('0x2a')];}_0x373359[_0xd7df('0x1d')](_0x2b6fde)[_0xd7df('0x2b')](_0x163904);};}exports[_0xd7df('0x2c')]=function(_0x3f78fa,_0x36de76){var _0x5195cf={},_0x4ba779={},_0x52b56a={'count':0x0,'rows':[]};var _0x58584d=_['map'](db[_0xd7df('0x2d')]['rawAttributes'],function(_0xd366b){return{'name':_0xd366b[_0xd7df('0x2e')],'type':_0xd366b['type'][_0xd7df('0x2f')]};});_0x4ba779[_0xd7df('0x30')]=_['differenceBy'](_[_0xd7df('0x31')](_0x58584d,_0xd7df('0x2a')),[_0xd7df('0x32')]);_0x4ba779[_0xd7df('0x33')]=_[_0xd7df('0x34')](_0x3f78fa[_0xd7df('0x33')]);_0x4ba779['filters']=_[_0xd7df('0x35')](_0x4ba779[_0xd7df('0x30')],_0x4ba779[_0xd7df('0x33')]);_0x5195cf[_0xd7df('0x36')]=_[_0xd7df('0x35')](_0x4ba779[_0xd7df('0x30')],qs[_0xd7df('0x37')](_0x3f78fa[_0xd7df('0x33')][_0xd7df('0x37')]));_0x5195cf[_0xd7df('0x36')]=_0x5195cf[_0xd7df('0x36')]['length']?_0x5195cf['attributes']:_0x4ba779[_0xd7df('0x30')];if(!_0x3f78fa['query'][_0xd7df('0x38')](_0xd7df('0x39'))){_0x5195cf[_0xd7df('0x23')]=qs[_0xd7df('0x23')](_0x3f78fa['query']['limit']);_0x5195cf['offset']=qs[_0xd7df('0x20')](_0x3f78fa[_0xd7df('0x33')]['offset']);}_0x5195cf[_0xd7df('0x3a')]=qs[_0xd7df('0x3b')](_0x3f78fa[_0xd7df('0x33')][_0xd7df('0x3b')]);_0x5195cf['where']=qs[_0xd7df('0x3c')](_[_0xd7df('0x3d')](_0x3f78fa['query'],_0x4ba779[_0xd7df('0x3c')]),_0x58584d);if(_0x3f78fa['query'][_0xd7df('0x3e')]){_0x5195cf[_0xd7df('0x3f')]=_[_0xd7df('0x40')](_0x5195cf['where'],{'$or':_[_0xd7df('0x31')](_0x58584d,function(_0x2a7252){if(_0x2a7252[_0xd7df('0x41')]!==_0xd7df('0x42')){var _0x54ea42={};_0x54ea42[_0x2a7252[_0xd7df('0x2a')]]={'$like':'%'+_0x3f78fa[_0xd7df('0x33')][_0xd7df('0x3e')]+'%'};return _0x54ea42;}})});}_0x5195cf=_['merge']({},_0x5195cf,_0x3f78fa[_0xd7df('0x43')]);var _0x207852={'where':_0x5195cf[_0xd7df('0x3f')]};return db['ScreenRecording'][_0xd7df('0x22')](_0x207852)[_0xd7df('0x28')](function(_0x4910cb){_0x52b56a['count']=_0x4910cb;if(_0x3f78fa[_0xd7df('0x33')][_0xd7df('0x44')]){_0x5195cf[_0xd7df('0x45')]=[{'all':!![]}];}return db['ScreenRecording']['findAll'](_0x5195cf);})[_0xd7df('0x28')](function(_0x4ebdbe){_0x52b56a[_0xd7df('0x46')]=_0x4ebdbe;return _0x52b56a;})['then'](respondWithFilteredResult(_0x36de76,_0x5195cf))['catch'](handleError(_0x36de76,null));};exports[_0xd7df('0x47')]=function(_0x579d0f,_0x18ef10){var _0x5302f4={'raw':![],'where':{'id':_0x579d0f[_0xd7df('0x48')]['id']}},_0xad2d69={};_0xad2d69[_0xd7df('0x30')]=_[_0xd7df('0x34')](db[_0xd7df('0x2d')][_0xd7df('0x49')]);_0xad2d69[_0xd7df('0x33')]=_['keys'](_0x579d0f[_0xd7df('0x33')]);_0xad2d69['filters']=_[_0xd7df('0x35')](_0xad2d69[_0xd7df('0x30')],_0xad2d69[_0xd7df('0x33')]);_0x5302f4[_0xd7df('0x36')]=_[_0xd7df('0x35')](_0xad2d69[_0xd7df('0x30')],qs[_0xd7df('0x37')](_0x579d0f[_0xd7df('0x33')][_0xd7df('0x37')]));_0x5302f4['attributes']=_0x5302f4[_0xd7df('0x36')][_0xd7df('0x4a')]?_0x5302f4['attributes']:_0xad2d69['model'];if(_0x579d0f[_0xd7df('0x33')][_0xd7df('0x44')]){_0x5302f4[_0xd7df('0x45')]=[{'all':!![]}];}_0x5302f4=_['merge']({},_0x5302f4,_0x579d0f['options']);return db[_0xd7df('0x2d')]['find'](_0x5302f4)[_0xd7df('0x28')](handleEntityNotFound(_0x18ef10,null))[_0xd7df('0x28')](respondWithResult(_0x18ef10,null))[_0xd7df('0x4b')](handleError(_0x18ef10,null));};exports[_0xd7df('0x4c')]=function(_0x1838aa,_0x28c13f){return db[_0xd7df('0x2d')][_0xd7df('0x4c')](_0x1838aa[_0xd7df('0x4d')],{})[_0xd7df('0x28')](respondWithResult(_0x28c13f,0xc9))[_0xd7df('0x4b')](handleError(_0x28c13f,null));};exports[_0xd7df('0x27')]=function(_0x54222c,_0x1f2f99){if(_0x54222c[_0xd7df('0x4d')]['id']){delete _0x54222c[_0xd7df('0x4d')]['id'];}delete _0x54222c[_0xd7df('0x4d')][_0xd7df('0x4e')];delete _0x54222c['body'][_0xd7df('0x4f')];delete _0x54222c[_0xd7df('0x4d')][_0xd7df('0x50')];delete _0x54222c['body'][_0xd7df('0x51')];return db['ScreenRecording'][_0xd7df('0x52')]({'where':{'id':_0x54222c[_0xd7df('0x48')]['id']}})[_0xd7df('0x28')](handleEntityNotFound(_0x1f2f99,null))[_0xd7df('0x28')](saveUpdates(_0x54222c[_0xd7df('0x4d')],null))['then'](respondWithResult(_0x1f2f99,null))['catch'](handleError(_0x1f2f99,null));};exports['describe']=function(_0xe4b221,_0x4a6cf5){return db[_0xd7df('0x2d')][_0xd7df('0x53')]()[_0xd7df('0x28')](respondWithResult(_0x4a6cf5,null))[_0xd7df('0x4b')](handleError(_0x4a6cf5,null));};exports[_0xd7df('0x54')]=function(_0x418da,_0xf72803,_0xb054d7){var _0x453876=require(_0xd7df('0x55'));var _0x382d11=![];var _0x327365={};if(_0x418da[_0xd7df('0x33')][_0xd7df('0x41')]&&_0x418da[_0xd7df('0x33')][_0xd7df('0x41')]==='uniqueid'){_0x327365[_0xd7df('0x56')]=_0x418da[_0xd7df('0x48')]['id'];}else{_0x327365['id']=_0x418da['params']['id'];}return db['ScreenRecording'][_0xd7df('0x52')]({'where':_0x327365,'attributes':['id','value'],'raw':!![]})[_0xd7df('0x28')](handleEntityNotFound(_0xf72803,null))['then'](function(_0x1f34c2){if(_0x1f34c2){var _0x28151a=path[_0xd7df('0x57')](config['root'],'server/files/screen_recordings',_0x1f34c2['value']);var _0x3666ba=util[_0xd7df('0x32')](_0xd7df('0x58'),_0x28151a);if(fs[_0xd7df('0x59')](_0x3666ba)){_0x382d11=!![];return _0x453876[_0xd7df('0x5a')](_0x3666ba,_0x28151a,config[_0xd7df('0x5b')]['recording'])[_0xd7df('0x28')](function(){return _0x1f34c2;});}return _0x1f34c2;}})[_0xd7df('0x28')](function(_0x35204f){if(_0x35204f){var _0x25d187=path[_0xd7df('0x57')](config[_0xd7df('0x5c')],_0xd7df('0x5d'),_0x35204f[_0xd7df('0x51')]);if(!fs[_0xd7df('0x59')](_0x25d187)){throw new db[(_0xd7df('0x5e'))][(_0xd7df('0x5f'))](_0xd7df('0x60'));}if(_0x35204f[_0xd7df('0x61')]){return _0xf72803[_0xd7df('0x54')](_0x25d187,_0x35204f[_0xd7df('0x61')]+path[_0xd7df('0x62')](_0x25d187),function(){if(_0x382d11){fs[_0xd7df('0x63')](_0x25d187);}});}else{return _0xf72803[_0xd7df('0x54')](_0x25d187,function(_0x3f2775){if(_0x382d11){fs[_0xd7df('0x63')](_0x25d187);}});}}})[_0xd7df('0x4b')](function(_0x393a3a){if(_0x393a3a[_0xd7df('0x64')]===_0xd7df('0x60')){_0xf72803[_0xd7df('0x1d')](0x194)[_0xd7df('0x2b')]('Not\x20found');}else{return handleError(_0xf72803,null);}});};exports['destroy']=function(_0x327402,_0x28f550){return db[_0xd7df('0x2d')]['find']({'where':{'id':_0x327402[_0xd7df('0x48')]['id']}})[_0xd7df('0x28')](function(_0x1e87aa){if(_[_0xd7df('0x65')](_0x1e87aa)){throw new ReferenceError('Entity\x20not\x20found');}return _0x1e87aa;})[_0xd7df('0x28')](function(_0x20ad50){var _0xb06a56=path[_0xd7df('0x57')](config[_0xd7df('0x5c')],_0xd7df('0x5d'),_0x20ad50[_0xd7df('0x51')]);logger[_0xd7df('0x66')]('cancellazione\x20fisica\x20documento\x20%s',_0xb06a56);if(!_[_0xd7df('0x65')](_0x20ad50[_0xd7df('0x51')])&&fs['existsSync'](_0xb06a56)){logger['info']('File:\x20\x22'+_0xb06a56+_0xd7df('0x67'));fs[_0xd7df('0x68')](_0xb06a56);}_0xb06a56=_0xb06a56+_0xd7df('0x69');if(!_[_0xd7df('0x65')](_0x20ad50['value'])&&fs[_0xd7df('0x59')](_0xb06a56)){logger[_0xd7df('0x66')](_0xd7df('0x6a')+_0xb06a56+_0xd7df('0x67'));fs[_0xd7df('0x68')](_0xb06a56);}return _0x20ad50;})[_0xd7df('0x28')](function(_0x4124b8){if(!_0x4124b8)throw new InternalError();return _0x4124b8['destroy']();})['then'](function(){_0x28f550[_0xd7df('0x1d')](0xcc)['end']();})[_0xd7df('0x4b')](handleError(_0x28f550,null));}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.model.js b/server/api/screenRecording/screenRecording.model.js index 8fbca43..633e9f6 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 _0xffc7=['interactionid','lodash','util','api','moment','path','rimraf','../../config/environment','ScreenRecording','screen_recordings'];(function(_0x1a512b,_0x54508c){var _0x3054ab=function(_0x50dd63){while(--_0x50dd63){_0x1a512b['push'](_0x1a512b['shift']());}};_0x3054ab(++_0x54508c);}(_0xffc7,0xd3));var _0x7ffc=function(_0x3f400d,_0xde29a0){_0x3f400d=_0x3f400d-0x0;var _0x512907=_0xffc7[_0x3f400d];return _0x512907;};'use strict';var _=require(_0x7ffc('0x0'));var util=require(_0x7ffc('0x1'));var logger=require('../../config/logger')(_0x7ffc('0x2'));var moment=require(_0x7ffc('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x7ffc('0x4'));var rimraf=require(_0x7ffc('0x5'));var config=require(_0x7ffc('0x6'));var attributes=require('./screenRecording.attributes');module['exports']=function(_0x1761ec,_0x972a25){return _0x1761ec['define'](_0x7ffc('0x7'),attributes,{'tableName':_0x7ffc('0x8'),'paranoid':![],'indexes':[{'name':_0x7ffc('0x9'),'fields':[_0x7ffc('0x9')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xff33=['bluebird','request-promise','path','rimraf','./screenRecording.attributes','exports','define','ScreenRecording','screen_recordings','lodash','../../config/logger','moment'];(function(_0x155c64,_0x26ff95){var _0x1f154a=function(_0xbc46e4){while(--_0xbc46e4){_0x155c64['push'](_0x155c64['shift']());}};_0x1f154a(++_0x26ff95);}(_0xff33,0x171));var _0x3ff3=function(_0x292f93,_0x2c6e8e){_0x292f93=_0x292f93-0x0;var _0x5a94b1=_0xff33[_0x292f93];return _0x5a94b1;};'use strict';var _=require(_0x3ff3('0x0'));var util=require('util');var logger=require(_0x3ff3('0x1'))('api');var moment=require(_0x3ff3('0x2'));var BPromise=require(_0x3ff3('0x3'));var rp=require(_0x3ff3('0x4'));var fs=require('fs');var path=require(_0x3ff3('0x5'));var rimraf=require(_0x3ff3('0x6'));var config=require('../../config/environment');var attributes=require(_0x3ff3('0x7'));module[_0x3ff3('0x8')]=function(_0x2d09e4,_0x2384b1){return _0x2d09e4[_0x3ff3('0x9')](_0x3ff3('0xa'),attributes,{'tableName':_0x3ff3('0xb'),'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 165796c..d80540d 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 _0x9f7c=['then','info','ScreenRecording,\x20%s,\x20%s','request\x20sent','ScreenRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request'];(function(_0x238830,_0x545f75){var _0x5917f0=function(_0x12f821){while(--_0x12f821){_0x238830['push'](_0x238830['shift']());}};_0x5917f0(++_0x545f75);}(_0x9f7c,0x12a));var _0xc9f7=function(_0x314b24,_0xecbde1){_0x314b24=_0x314b24-0x0;var _0x36a559=_0x9f7c[_0x314b24];return _0x36a559;};'use strict';var _=require(_0xc9f7('0x0'));var util=require(_0xc9f7('0x1'));var moment=require(_0xc9f7('0x2'));var BPromise=require(_0xc9f7('0x3'));var rs=require(_0xc9f7('0x4'));var fs=require('fs');var Redis=require(_0xc9f7('0x5'));var db=require(_0xc9f7('0x6'))['db'];var utils=require(_0xc9f7('0x7'));var logger=require(_0xc9f7('0x8'))(_0xc9f7('0x9'));var config=require(_0xc9f7('0xa'));var jayson=require(_0xc9f7('0xb'));var client=jayson['client'][_0xc9f7('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x534b48,_0x469b83,_0x436fa2){return new BPromise(function(_0x3e44f6,_0x4e03d5){return client[_0xc9f7('0xd')](_0x534b48,_0x436fa2)[_0xc9f7('0xe')](function(_0xa2b817){logger[_0xc9f7('0xf')](_0xc9f7('0x10'),_0x469b83,_0xc9f7('0x11'));logger['debug'](_0xc9f7('0x12'),_0x469b83,_0xc9f7('0x11'),JSON[_0xc9f7('0x13')](_0xa2b817));if(_0xa2b817[_0xc9f7('0x14')]){if(_0xa2b817[_0xc9f7('0x14')][_0xc9f7('0x15')]===0x1f4){logger[_0xc9f7('0x14')](_0xc9f7('0x10'),_0x469b83,_0xa2b817['error'][_0xc9f7('0x16')]);return _0x4e03d5(_0xa2b817['error'][_0xc9f7('0x16')]);}logger[_0xc9f7('0x14')]('ScreenRecording,\x20%s,\x20%s',_0x469b83,_0xa2b817[_0xc9f7('0x14')][_0xc9f7('0x16')]);return _0x3e44f6(_0xa2b817[_0xc9f7('0x14')][_0xc9f7('0x16')]);}else{logger[_0xc9f7('0xf')](_0xc9f7('0x10'),_0x469b83,_0xc9f7('0x11'));_0x3e44f6(_0xa2b817['result'][_0xc9f7('0x16')]);}})[_0xc9f7('0x17')](function(_0x23e935){logger[_0xc9f7('0x14')](_0xc9f7('0x10'),_0x469b83,_0x23e935);_0x4e03d5(_0x23e935);});});} \ No newline at end of file +var _0x28af=['error','code','message','info','request\x20sent','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','ScreenRecording,\x20%s,\x20%s','debug','ScreenRecording,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x5abd75,_0x240b60){var _0x3aabb2=function(_0x5b576d){while(--_0x5b576d){_0x5abd75['push'](_0x5abd75['shift']());}};_0x3aabb2(++_0x240b60);}(_0x28af,0x16e));var _0xf28a=function(_0x514260,_0x1891e1){_0x514260=_0x514260-0x0;var _0x4ac81b=_0x28af[_0x514260];return _0x4ac81b;};'use strict';var _=require('lodash');var util=require(_0xf28a('0x0'));var moment=require(_0xf28a('0x1'));var BPromise=require(_0xf28a('0x2'));var rs=require(_0xf28a('0x3'));var fs=require('fs');var Redis=require(_0xf28a('0x4'));var db=require(_0xf28a('0x5'))['db'];var utils=require(_0xf28a('0x6'));var logger=require(_0xf28a('0x7'))(_0xf28a('0x8'));var config=require(_0xf28a('0x9'));var jayson=require(_0xf28a('0xa'));var client=jayson[_0xf28a('0xb')][_0xf28a('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x436de1,_0x5424c3,_0x9c4615){return new BPromise(function(_0x238920,_0x3bbc3c){return client['request'](_0x436de1,_0x9c4615)[_0xf28a('0xd')](function(_0x4c1f4d){logger['info'](_0xf28a('0xe'),_0x5424c3,'request\x20sent');logger[_0xf28a('0xf')](_0xf28a('0x10'),_0x5424c3,'request\x20sent',JSON[_0xf28a('0x11')](_0x4c1f4d));if(_0x4c1f4d[_0xf28a('0x12')]){if(_0x4c1f4d['error'][_0xf28a('0x13')]===0x1f4){logger['error']('ScreenRecording,\x20%s,\x20%s',_0x5424c3,_0x4c1f4d[_0xf28a('0x12')][_0xf28a('0x14')]);return _0x3bbc3c(_0x4c1f4d[_0xf28a('0x12')][_0xf28a('0x14')]);}logger[_0xf28a('0x12')](_0xf28a('0xe'),_0x5424c3,_0x4c1f4d[_0xf28a('0x12')][_0xf28a('0x14')]);return _0x238920(_0x4c1f4d[_0xf28a('0x12')]['message']);}else{logger[_0xf28a('0x15')](_0xf28a('0xe'),_0x5424c3,_0xf28a('0x16'));_0x238920(_0x4c1f4d['result'][_0xf28a('0x14')]);}})[_0xf28a('0x17')](function(_0x5d0619){logger[_0xf28a('0x12')](_0xf28a('0xe'),_0x5424c3,_0x5d0619);_0x3bbc3c(_0x5d0619);});});} \ No newline at end of file diff --git a/server/api/setting/index.js b/server/api/setting/index.js index dea7d28..28eee1c 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 _0x61ae=['root','format','%s%s','logo','extname','originalname','post','file','addLogo','server/files/images/logos/','logologin','single','addLogoLogin','preferred','favicon','/:id/favicon','addFavicon','put','/:id','update','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./setting.controller','get','isAuthenticated','index','/now','getDate','show','/:id/logo','getLogo','/:id/logo_login','getLogoLogin','/:id/gdpr','/:id/preferred','getPreferred','diskStorage','join'];(function(_0x1a24c2,_0x191216){var _0x4ea7cf=function(_0x10807b){while(--_0x10807b){_0x1a24c2['push'](_0x1a24c2['shift']());}};_0x4ea7cf(++_0x191216);}(_0x61ae,0x175));var _0xe61a=function(_0x5be7aa,_0x511ed0){_0x5be7aa=_0x5be7aa-0x0;var _0xcb1d4c=_0x61ae[_0x5be7aa];return _0xcb1d4c;};'use strict';var multer=require(_0xe61a('0x0'));var util=require('util');var path=require(_0xe61a('0x1'));var timeout=require(_0xe61a('0x2'));var express=require('express');var router=express[_0xe61a('0x3')]();var fs_extra=require(_0xe61a('0x4'));var auth=require(_0xe61a('0x5'));var interaction=require(_0xe61a('0x6'));var config=require('../../config/environment');var controller=require(_0xe61a('0x7'));router[_0xe61a('0x8')]('/',auth[_0xe61a('0x9')](),controller[_0xe61a('0xa')]);router[_0xe61a('0x8')](_0xe61a('0xb'),controller[_0xe61a('0xc')]);router['get']('/:id',controller[_0xe61a('0xd')]);router['get'](_0xe61a('0xe'),controller[_0xe61a('0xf')]);router[_0xe61a('0x8')](_0xe61a('0x10'),controller[_0xe61a('0x11')]);router['get'](_0xe61a('0x12'),controller['gdpr']);router[_0xe61a('0x8')](_0xe61a('0x13'),controller[_0xe61a('0x14')]);router[_0xe61a('0x8')]('/:id/favicon',controller['getFavicon']);var upload=multer({'storage':multer[_0xe61a('0x15')]({'destination':function(_0xef0506,_0x1be82b,_0x2b1a39){_0x2b1a39(null,path[_0xe61a('0x16')](config[_0xe61a('0x17')],'server/files/images/logos/'));},'filename':function(_0x816093,_0x49a970,_0x330a2a){_0x330a2a(null,util[_0xe61a('0x18')](_0xe61a('0x19'),_0xe61a('0x1a'),path[_0xe61a('0x1b')](_0x49a970[_0xe61a('0x1c')])));}})});router[_0xe61a('0x1d')](_0xe61a('0xe'),upload['single'](_0xe61a('0x1e')),controller[_0xe61a('0x1f')]);var upload=multer({'storage':multer[_0xe61a('0x15')]({'destination':function(_0x3d72b9,_0x2dd6e0,_0x53abc1){_0x53abc1(null,path['join'](config[_0xe61a('0x17')],_0xe61a('0x20')));},'filename':function(_0x323bad,_0xefe031,_0x1ca863){_0x1ca863(null,util['format']('%s%s',_0xe61a('0x21'),path[_0xe61a('0x1b')](_0xefe031[_0xe61a('0x1c')])));}})});router[_0xe61a('0x1d')](_0xe61a('0x10'),upload[_0xe61a('0x22')](_0xe61a('0x1e')),controller[_0xe61a('0x23')]);var upload=multer({'storage':multer[_0xe61a('0x15')]({'destination':function(_0x55c10a,_0x2fb922,_0x5d6906){_0x5d6906(null,path[_0xe61a('0x16')](config[_0xe61a('0x17')],_0xe61a('0x20')));},'filename':function(_0x224f93,_0x272a51,_0x2ac1e2){_0x2ac1e2(null,util[_0xe61a('0x18')](_0xe61a('0x19'),_0xe61a('0x24'),path[_0xe61a('0x1b')](_0x272a51[_0xe61a('0x1c')])));}})});router[_0xe61a('0x1d')](_0xe61a('0x13'),upload['single']('file'),controller['addPreferred']);var upload=multer({'storage':multer[_0xe61a('0x15')]({'destination':function(_0x41a1fe,_0x9b563a,_0x19327e){_0x19327e(null,path[_0xe61a('0x16')](config[_0xe61a('0x17')],_0xe61a('0x20')));},'filename':function(_0x474fd3,_0x320c55,_0x12704a){_0x12704a(null,util[_0xe61a('0x18')](_0xe61a('0x19'),_0xe61a('0x25'),path['extname'](_0x320c55[_0xe61a('0x1c')])));}})});router['post'](_0xe61a('0x26'),upload[_0xe61a('0x22')](_0xe61a('0x1e')),controller[_0xe61a('0x27')]);router[_0xe61a('0x28')](_0xe61a('0x29'),auth['isAuthenticated'](),controller[_0xe61a('0x2a')]);module[_0xe61a('0x2b')]=router; \ No newline at end of file +var _0x41ef=['format','%s%s','logo','extname','originalname','post','single','addLogo','logologin','file','addLogoLogin','preferred','addPreferred','favicon','/:id','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/now','getDate','show','/:id/logo','getLogo','/:id/logo_login','getLogoLogin','/:id/gdpr','gdpr','/:id/preferred','/:id/favicon','getFavicon','diskStorage','join','root','server/files/images/logos/'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x41ef,0x66));var _0xf41e=function(_0x5c2293,_0x4e18a9){_0x5c2293=_0x5c2293-0x0;var _0x9712d8=_0x41ef[_0x5c2293];return _0x9712d8;};'use strict';var multer=require('multer');var util=require(_0xf41e('0x0'));var path=require(_0xf41e('0x1'));var timeout=require(_0xf41e('0x2'));var express=require(_0xf41e('0x3'));var router=express[_0xf41e('0x4')]();var fs_extra=require(_0xf41e('0x5'));var auth=require(_0xf41e('0x6'));var interaction=require(_0xf41e('0x7'));var config=require(_0xf41e('0x8'));var controller=require('./setting.controller');router[_0xf41e('0x9')]('/',auth[_0xf41e('0xa')](),controller['index']);router[_0xf41e('0x9')](_0xf41e('0xb'),controller[_0xf41e('0xc')]);router[_0xf41e('0x9')]('/:id',controller[_0xf41e('0xd')]);router[_0xf41e('0x9')](_0xf41e('0xe'),controller[_0xf41e('0xf')]);router['get'](_0xf41e('0x10'),controller[_0xf41e('0x11')]);router[_0xf41e('0x9')](_0xf41e('0x12'),controller[_0xf41e('0x13')]);router[_0xf41e('0x9')](_0xf41e('0x14'),controller['getPreferred']);router[_0xf41e('0x9')](_0xf41e('0x15'),controller[_0xf41e('0x16')]);var upload=multer({'storage':multer[_0xf41e('0x17')]({'destination':function(_0x1cec2f,_0x441758,_0x200019){_0x200019(null,path[_0xf41e('0x18')](config[_0xf41e('0x19')],_0xf41e('0x1a')));},'filename':function(_0x13a083,_0x6c2732,_0x328a8d){_0x328a8d(null,util[_0xf41e('0x1b')](_0xf41e('0x1c'),_0xf41e('0x1d'),path[_0xf41e('0x1e')](_0x6c2732[_0xf41e('0x1f')])));}})});router[_0xf41e('0x20')](_0xf41e('0xe'),upload[_0xf41e('0x21')]('file'),controller[_0xf41e('0x22')]);var upload=multer({'storage':multer[_0xf41e('0x17')]({'destination':function(_0x2e44d5,_0x33f868,_0x263eec){_0x263eec(null,path[_0xf41e('0x18')](config[_0xf41e('0x19')],_0xf41e('0x1a')));},'filename':function(_0x31ad3f,_0x32ee41,_0x1370b3){_0x1370b3(null,util[_0xf41e('0x1b')]('%s%s',_0xf41e('0x23'),path[_0xf41e('0x1e')](_0x32ee41['originalname'])));}})});router[_0xf41e('0x20')](_0xf41e('0x10'),upload[_0xf41e('0x21')](_0xf41e('0x24')),controller[_0xf41e('0x25')]);var upload=multer({'storage':multer[_0xf41e('0x17')]({'destination':function(_0x1948a4,_0xa3f90a,_0x1b2526){_0x1b2526(null,path[_0xf41e('0x18')](config[_0xf41e('0x19')],_0xf41e('0x1a')));},'filename':function(_0x20c7bd,_0x152b66,_0x5b28f0){_0x5b28f0(null,util['format']('%s%s',_0xf41e('0x26'),path[_0xf41e('0x1e')](_0x152b66['originalname'])));}})});router[_0xf41e('0x20')](_0xf41e('0x14'),upload[_0xf41e('0x21')]('file'),controller[_0xf41e('0x27')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x58ef6b,_0x1268ff,_0x532436){_0x532436(null,path[_0xf41e('0x18')](config[_0xf41e('0x19')],_0xf41e('0x1a')));},'filename':function(_0x11d2ae,_0x5aa1b7,_0xe57deb){_0xe57deb(null,util[_0xf41e('0x1b')]('%s%s',_0xf41e('0x28'),path[_0xf41e('0x1e')](_0x5aa1b7['originalname'])));}})});router[_0xf41e('0x20')](_0xf41e('0x15'),upload[_0xf41e('0x21')](_0xf41e('0x24')),controller['addFavicon']);router['put'](_0xf41e('0x29'),auth[_0xf41e('0xa')](),controller['update']);module[_0xf41e('0x2a')]=router; \ No newline at end of file diff --git a/server/api/setting/setting.attributes.js b/server/api/setting/setting.attributes.js index 9b97372..50f65d7 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(_0x2fa637,_0x112feb){var _0x47203d=function(_0x2fb3f5){while(--_0x2fb3f5){_0x2fa637['push'](_0x2fa637['shift']());}};_0x47203d(++_0x112feb);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbb091,_0x3fe7ee){_0xbb091=_0xbb091-0x0;var _0x467a04=_0xa9e0[_0xbb091];return _0x467a04;};'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(_0xa47024,_0x3ee917){var _0x586ec6=function(_0xacc2d2){while(--_0xacc2d2){_0xa47024['push'](_0xa47024['shift']());}};_0x586ec6(++_0x3ee917);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2d8fc2,_0x1c461d){_0x2d8fc2=_0x2d8fc2-0x0;var _0x3a9e53=_0xa9e0[_0x2d8fc2];return _0x3a9e53;};'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 61a325f..cee7bb4 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 _0x8dd9=['utcOffset','now','YYYY-MM-DD\x20HH:mm:ss:SSS','eml-format','rimraf','zip-dir','request-promise','moment','util','path','sox','ejs','fs-extra','lodash','crypto','to-csv','querystring','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','http','request','then','info','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','Setting,\x20%s,\x20%s','message','result','sendStatus','status','end','json','offset','limit','undefined','count','apply','reject','save','update','destroy','stack','name','send','index','Setting','rawAttributes','fieldName','type','model','map','query','keys','filters','attributes','intersection','fields','length','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','params','body','file','filename','find','catch','addLogoLogin','loginLogo','server/files/images/logos','logo','preferred','favicon','defaultLogo','defaultLoginLogo','defaultPreferred','existsSync','join','root','toLower','default_logo.svg','default','custom','Sequelize','upperFirst','\x20not\x20found','download','getLogoLogin','getLicense','defaultFavicon','default_loginLogo.svg','ValidationError','gdpr','securePassword','addPreferred','getPreferred','default_preferred.png','addFavicon','getFavicon','default_favicon.ico','getDate'];(function(_0x57fa7e,_0xd0b5ce){var _0x320671=function(_0x3392cc){while(--_0x3392cc){_0x57fa7e['push'](_0x57fa7e['shift']());}};_0x320671(++_0xd0b5ce);}(_0x8dd9,0x16b));var _0x98dd=function(_0x1e53ca,_0x2692ed){_0x1e53ca=_0x1e53ca-0x0;var _0x55e658=_0x8dd9[_0x1e53ca];return _0x55e658;};'use strict';var emlformat=require(_0x98dd('0x0'));var rimraf=require(_0x98dd('0x1'));var zipdir=require(_0x98dd('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x98dd('0x3'));var moment=require(_0x98dd('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x98dd('0x5'));var path=require(_0x98dd('0x6'));var sox=require(_0x98dd('0x7'));var csv=require('to-csv');var ejs=require(_0x98dd('0x8'));var fs=require('fs');var fs_extra=require(_0x98dd('0x9'));var _=require(_0x98dd('0xa'));var squel=require('squel');var crypto=require(_0x98dd('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x98dd('0xc'));var querystring=require(_0x98dd('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x98dd('0xe'));var hardwareService=require(_0x98dd('0xf'));var logger=require(_0x98dd('0x10'))(_0x98dd('0x11'));var utils=require(_0x98dd('0x12'));var config=require(_0x98dd('0x13'));var licenseUtil=require(_0x98dd('0x14'));var db=require(_0x98dd('0x15'))['db'];var jayson=require(_0x98dd('0x16'));var client=jayson[_0x98dd('0x17')][_0x98dd('0x18')]({'port':0x232a});function respondWithRpcPromise(_0x281c1a,_0x1b6d63,_0xe38c22,_0x1f76a6){return new BPromise(function(_0x566841,_0x206c98){var _0x40a711=_0x1f76a6||client;return _0x40a711[_0x98dd('0x19')](_0x281c1a,_0xe38c22)[_0x98dd('0x1a')](function(_0x574a1c){logger[_0x98dd('0x1b')]('Setting,\x20%s,\x20%s',_0x1b6d63,_0x98dd('0x1c'));logger[_0x98dd('0x1d')](_0x98dd('0x1e'),_0x1b6d63,'request\x20sent',JSON[_0x98dd('0x1f')](_0x574a1c));if(_0x574a1c[_0x98dd('0x20')]){if(_0x574a1c[_0x98dd('0x20')][_0x98dd('0x21')]===0x1f4){logger[_0x98dd('0x20')](_0x98dd('0x22'),_0x1b6d63,_0x574a1c[_0x98dd('0x20')][_0x98dd('0x23')]);return _0x206c98(_0x574a1c['error']['message']);}logger[_0x98dd('0x20')](_0x98dd('0x22'),_0x1b6d63,_0x574a1c[_0x98dd('0x20')][_0x98dd('0x23')]);return _0x566841(_0x574a1c[_0x98dd('0x20')][_0x98dd('0x23')]);}else{logger[_0x98dd('0x1b')](_0x98dd('0x22'),_0x1b6d63,_0x98dd('0x1c'));_0x566841(_0x574a1c[_0x98dd('0x24')][_0x98dd('0x23')]);}})['catch'](function(_0xf2c262){logger['error'](_0x98dd('0x22'),_0x1b6d63,_0xf2c262);_0x206c98(_0xf2c262);});});}function respondWithStatusCode(_0x4486c1,_0x4c52e3){_0x4c52e3=_0x4c52e3||0xcc;return function(_0x42e65c){if(_0x42e65c){return _0x4486c1[_0x98dd('0x25')](_0x4c52e3);}return _0x4486c1[_0x98dd('0x26')](_0x4c52e3)[_0x98dd('0x27')]();};}function respondWithResult(_0x2a8ca9,_0x1a49f9){_0x1a49f9=_0x1a49f9||0xc8;return function(_0x2cd131){if(_0x2cd131){return _0x2a8ca9['status'](_0x1a49f9)[_0x98dd('0x28')](_0x2cd131);}};}function respondWithFilteredResult(_0x2958d2,_0x214e79){return function(_0x50ad0e){if(_0x50ad0e){var _0x5086fe=typeof _0x214e79[_0x98dd('0x29')]==='undefined'&&typeof _0x214e79[_0x98dd('0x2a')]===_0x98dd('0x2b');var _0x44ecac=_0x50ad0e[_0x98dd('0x2c')];var _0x2c806e=_0x5086fe?0x0:_0x214e79[_0x98dd('0x29')];var _0x2c2dc3=_0x5086fe?_0x50ad0e['count']:_0x214e79[_0x98dd('0x29')]+_0x214e79[_0x98dd('0x2a')];var _0x52ae51;if(_0x2c2dc3>=_0x44ecac){_0x2c2dc3=_0x44ecac;_0x52ae51=0xc8;}else{_0x52ae51=0xce;}_0x2958d2['status'](_0x52ae51);return _0x2958d2['set']('Content-Range',_0x2c806e+'-'+_0x2c2dc3+'/'+_0x44ecac)[_0x98dd('0x28')](_0x50ad0e);}return null;};}function patchUpdates(_0x5e9ecd){return function(_0x182fb0){try{jsonpatch[_0x98dd('0x2d')](_0x182fb0,_0x5e9ecd,!![]);}catch(_0x561397){return BPromise[_0x98dd('0x2e')](_0x561397);}return _0x182fb0[_0x98dd('0x2f')]();};}function saveUpdates(_0x2e1562,_0x45fd4c){return function(_0x2cd412){if(_0x2cd412){return _0x2cd412[_0x98dd('0x30')](_0x2e1562)[_0x98dd('0x1a')](function(_0x8ad166){return _0x8ad166;});}return null;};}function removeEntity(_0x11dec3,_0x42e99c){return function(_0x562b88){if(_0x562b88){return _0x562b88[_0x98dd('0x31')]()[_0x98dd('0x1a')](function(){_0x11dec3[_0x98dd('0x26')](0xcc)[_0x98dd('0x27')]();});}};}function handleEntityNotFound(_0x525653,_0x1d6c0e){return function(_0x492dbd){if(!_0x492dbd){_0x525653['sendStatus'](0x194);}return _0x492dbd;};}function handleError(_0x2499a3,_0x170d34){_0x170d34=_0x170d34||0x1f4;return function(_0x4162ce){logger[_0x98dd('0x20')](_0x4162ce[_0x98dd('0x32')]);if(_0x4162ce[_0x98dd('0x33')]){delete _0x4162ce[_0x98dd('0x33')];}_0x2499a3[_0x98dd('0x26')](_0x170d34)[_0x98dd('0x34')](_0x4162ce);};}exports[_0x98dd('0x35')]=function(_0x545efe,_0x478e25){var _0x48476a={},_0x38f07b={},_0xd92c0c={'count':0x0,'rows':[]};var _0x520956=_['map'](db[_0x98dd('0x36')][_0x98dd('0x37')],function(_0x1f9a4b){return{'name':_0x1f9a4b[_0x98dd('0x38')],'type':_0x1f9a4b[_0x98dd('0x39')]['key']};});_0x38f07b[_0x98dd('0x3a')]=_[_0x98dd('0x3b')](_0x520956,_0x98dd('0x33'));_0x38f07b[_0x98dd('0x3c')]=_[_0x98dd('0x3d')](_0x545efe[_0x98dd('0x3c')]);_0x38f07b[_0x98dd('0x3e')]=_['intersection'](_0x38f07b[_0x98dd('0x3a')],_0x38f07b[_0x98dd('0x3c')]);_0x48476a[_0x98dd('0x3f')]=_[_0x98dd('0x40')](_0x38f07b[_0x98dd('0x3a')],qs[_0x98dd('0x41')](_0x545efe['query'][_0x98dd('0x41')]));_0x48476a['attributes']=_0x48476a[_0x98dd('0x3f')][_0x98dd('0x42')]?_0x48476a[_0x98dd('0x3f')]:_0x38f07b[_0x98dd('0x3a')];if(!_0x545efe[_0x98dd('0x3c')]['hasOwnProperty'](_0x98dd('0x43'))){_0x48476a[_0x98dd('0x2a')]=qs[_0x98dd('0x2a')](_0x545efe['query'][_0x98dd('0x2a')]);_0x48476a[_0x98dd('0x29')]=qs[_0x98dd('0x29')](_0x545efe[_0x98dd('0x3c')]['offset']);}_0x48476a[_0x98dd('0x44')]=qs[_0x98dd('0x45')](_0x545efe['query'][_0x98dd('0x45')]);_0x48476a[_0x98dd('0x46')]=qs[_0x98dd('0x3e')](_[_0x98dd('0x47')](_0x545efe[_0x98dd('0x3c')],_0x38f07b['filters']),_0x520956);if(_0x545efe[_0x98dd('0x3c')][_0x98dd('0x48')]){_0x48476a[_0x98dd('0x46')]=_[_0x98dd('0x49')](_0x48476a[_0x98dd('0x46')],{'$or':_[_0x98dd('0x3b')](_0x520956,function(_0x3d6e62){if(_0x3d6e62[_0x98dd('0x39')]!=='VIRTUAL'){var _0x2765d9={};_0x2765d9[_0x3d6e62[_0x98dd('0x33')]]={'$like':'%'+_0x545efe['query'][_0x98dd('0x48')]+'%'};return _0x2765d9;}})});}_0x48476a=_[_0x98dd('0x49')]({},_0x48476a,_0x545efe[_0x98dd('0x4a')]);var _0x1957ac={'where':_0x48476a[_0x98dd('0x46')]};return db[_0x98dd('0x36')][_0x98dd('0x2c')](_0x1957ac)[_0x98dd('0x1a')](function(_0x26aa2e){_0xd92c0c[_0x98dd('0x2c')]=_0x26aa2e;if(_0x545efe['query'][_0x98dd('0x4b')]){_0x48476a[_0x98dd('0x4c')]=[{'all':!![]}];}return db[_0x98dd('0x36')]['findAll'](_0x48476a);})[_0x98dd('0x1a')](function(_0x3de6f2){_0xd92c0c['rows']=_0x3de6f2;return _0xd92c0c;})[_0x98dd('0x1a')](respondWithFilteredResult(_0x478e25,_0x48476a))['catch'](handleError(_0x478e25,null));};exports['show']=function(_0x1b31e6,_0xe0ad9c){var _0x27a14b={'raw':![],'where':{'id':_0x1b31e6[_0x98dd('0x4d')]['id']}},_0xa1d2af={};_0xa1d2af[_0x98dd('0x3a')]=_['keys'](db[_0x98dd('0x36')][_0x98dd('0x37')]);_0xa1d2af[_0x98dd('0x3c')]=_[_0x98dd('0x3d')](_0x1b31e6[_0x98dd('0x3c')]);_0xa1d2af[_0x98dd('0x3e')]=_[_0x98dd('0x40')](_0xa1d2af[_0x98dd('0x3a')],_0xa1d2af['query']);_0x27a14b[_0x98dd('0x3f')]=_[_0x98dd('0x40')](_0xa1d2af[_0x98dd('0x3a')],qs[_0x98dd('0x41')](_0x1b31e6[_0x98dd('0x3c')][_0x98dd('0x41')]));_0x27a14b[_0x98dd('0x3f')]=_0x27a14b['attributes'][_0x98dd('0x42')]?_0x27a14b[_0x98dd('0x3f')]:_0xa1d2af[_0x98dd('0x3a')];if(_0x1b31e6['query'][_0x98dd('0x4b')]){_0x27a14b[_0x98dd('0x4c')]=[{'all':!![]}];}_0x27a14b=_['merge']({},_0x27a14b,_0x1b31e6['options']);return db[_0x98dd('0x36')]['find'](_0x27a14b)[_0x98dd('0x1a')](handleEntityNotFound(_0xe0ad9c,null))[_0x98dd('0x1a')](respondWithResult(_0xe0ad9c,null))['catch'](handleError(_0xe0ad9c,null));};exports[_0x98dd('0x30')]=function(_0x431a6b,_0x585127){if(_0x431a6b[_0x98dd('0x4e')]['id']){delete _0x431a6b[_0x98dd('0x4e')]['id'];}return db[_0x98dd('0x36')]['find']({'where':{'id':_0x431a6b[_0x98dd('0x4d')]['id']}})[_0x98dd('0x1a')](handleEntityNotFound(_0x585127,null))[_0x98dd('0x1a')](saveUpdates(_0x431a6b[_0x98dd('0x4e')],null))[_0x98dd('0x1a')](respondWithResult(_0x585127,null))['catch'](handleError(_0x585127,null));};exports['addLogo']=function(_0x37c726,_0x3a64ae,_0x104b2e){if(_0x37c726[_0x98dd('0x4f')]&&_0x37c726['file'][_0x98dd('0x50')]){_0x37c726[_0x98dd('0x4e')]['logo']=_0x37c726[_0x98dd('0x4f')][_0x98dd('0x50')];}return db['Setting'][_0x98dd('0x51')]({'where':{'id':_0x37c726[_0x98dd('0x4d')]['id']}})[_0x98dd('0x1a')](handleEntityNotFound(_0x3a64ae,null))[_0x98dd('0x1a')](saveUpdates(_0x37c726[_0x98dd('0x4e')],null))[_0x98dd('0x1a')](respondWithResult(_0x3a64ae,null))[_0x98dd('0x52')](handleError(_0x3a64ae,null));};exports[_0x98dd('0x53')]=function(_0x4522fb,_0x2f37e5,_0x17d213){if(_0x4522fb[_0x98dd('0x4f')]&&_0x4522fb[_0x98dd('0x4f')][_0x98dd('0x50')]){_0x4522fb[_0x98dd('0x4e')][_0x98dd('0x54')]=_0x4522fb[_0x98dd('0x4f')][_0x98dd('0x50')];}return db['Setting']['find']({'where':{'id':_0x4522fb['params']['id']}})[_0x98dd('0x1a')](handleEntityNotFound(_0x2f37e5,null))[_0x98dd('0x1a')](saveUpdates(_0x4522fb[_0x98dd('0x4e')],null))[_0x98dd('0x1a')](respondWithResult(_0x2f37e5,null))[_0x98dd('0x52')](handleError(_0x2f37e5,null));};var utilLicense=require('../../config/license/util');exports['getLogo']=function(_0x3a5c2e,_0x50ab23,_0x3c8dfa){var _0x405b3b=_0x98dd('0x55');var _0x11c4ef={'custom':![]};return utilLicense['getLicense']()[_0x98dd('0x1a')](function(_0x1a9f20){if(_0x1a9f20){_0x11c4ef=_0x1a9f20;}return db[_0x98dd('0x36')][_0x98dd('0x51')]({'where':{'id':_0x3a5c2e[_0x98dd('0x4d')]['id']},'attributes':[_0x98dd('0x56'),_0x98dd('0x54'),_0x98dd('0x57'),_0x98dd('0x58'),_0x98dd('0x59'),_0x98dd('0x5a'),_0x98dd('0x5b'),'defaultFavicon'],'raw':!![]});})[_0x98dd('0x1a')](handleEntityNotFound(_0x50ab23,null))[_0x98dd('0x1a')](function(_0x507b4f){if(_0x507b4f){var _0x45d490=_0x507b4f[_0x98dd('0x56')]&&fs[_0x98dd('0x5c')](path[_0x98dd('0x5d')](config[_0x98dd('0x5e')],_0x405b3b,_[_0x98dd('0x5f')](_0x507b4f[_0x98dd('0x56')])))?path['join'](config[_0x98dd('0x5e')],_0x405b3b,_[_0x98dd('0x5f')](_0x507b4f[_0x98dd('0x56')])):path[_0x98dd('0x5d')](config[_0x98dd('0x5e')],_0x405b3b,_[_0x98dd('0x5f')](_0x98dd('0x60')));var _0x14369e=_0x98dd('0x61')+_['upperFirst'](_0x98dd('0x56'));if(_0x507b4f[_0x14369e]||!_0x11c4ef[_0x98dd('0x62')]){_0x45d490=path[_0x98dd('0x5d')](config[_0x98dd('0x5e')],_0x405b3b,_[_0x98dd('0x5f')]('default_logo.svg'));}if(!fs['existsSync'](_0x45d490)){throw new db[(_0x98dd('0x63'))]['ValidationError'](_[_0x98dd('0x64')](_0x98dd('0x56'))+_0x98dd('0x65'));}return _0x50ab23[_0x98dd('0x66')](_0x45d490);}})[_0x98dd('0x52')](handleError(_0x50ab23,null));};var utilLicense=require(_0x98dd('0x14'));exports[_0x98dd('0x67')]=function(_0x3fdee2,_0x1f5159,_0x18348f){var _0x51d3d3='server/files/images/logos';var _0x2e1120={'custom':![]};return utilLicense[_0x98dd('0x68')]()[_0x98dd('0x1a')](function(_0x2567f1){if(_0x2567f1){_0x2e1120=_0x2567f1;}return db[_0x98dd('0x36')][_0x98dd('0x51')]({'where':{'id':_0x3fdee2[_0x98dd('0x4d')]['id']},'attributes':[_0x98dd('0x56'),_0x98dd('0x54'),_0x98dd('0x57'),_0x98dd('0x58'),_0x98dd('0x59'),_0x98dd('0x5a'),_0x98dd('0x5b'),_0x98dd('0x69')],'raw':!![]});})['then'](handleEntityNotFound(_0x1f5159,null))[_0x98dd('0x1a')](function(_0x45591e){if(_0x45591e){var _0x1cf984=_0x45591e['loginLogo']&&fs['existsSync'](path['join'](config[_0x98dd('0x5e')],_0x51d3d3,_[_0x98dd('0x5f')](_0x45591e['loginLogo'])))?path['join'](config[_0x98dd('0x5e')],_0x51d3d3,_['toLower'](_0x45591e[_0x98dd('0x54')])):path[_0x98dd('0x5d')](config['root'],_0x51d3d3,_[_0x98dd('0x5f')](_0x98dd('0x6a')));var _0x510477=_0x98dd('0x61')+_[_0x98dd('0x64')](_0x98dd('0x54'));if(_0x45591e[_0x510477]||!_0x2e1120['custom']){_0x1cf984=path[_0x98dd('0x5d')](config[_0x98dd('0x5e')],_0x51d3d3,_['toLower'](_0x98dd('0x6a')));}if(!fs[_0x98dd('0x5c')](_0x1cf984)){throw new db[(_0x98dd('0x63'))][(_0x98dd('0x6b'))](_[_0x98dd('0x64')](_0x98dd('0x54'))+_0x98dd('0x65'));}return _0x1f5159[_0x98dd('0x66')](_0x1cf984);}})[_0x98dd('0x52')](handleError(_0x1f5159,null));};exports[_0x98dd('0x6c')]=function(_0x1ef6d2,_0x948230){return db[_0x98dd('0x36')][_0x98dd('0x51')]({'where':{'id':_0x1ef6d2['params']['id']},'attributes':[_0x98dd('0x6d')]})[_0x98dd('0x1a')](respondWithResult(_0x948230,null))['catch'](handleError(_0x948230,null));};exports[_0x98dd('0x6e')]=function(_0x45469b,_0x577660,_0x57b444){if(_0x45469b[_0x98dd('0x4f')]&&_0x45469b[_0x98dd('0x4f')][_0x98dd('0x50')]){_0x45469b[_0x98dd('0x4e')][_0x98dd('0x57')]=_0x45469b['file'][_0x98dd('0x50')];}return db['Setting'][_0x98dd('0x51')]({'where':{'id':_0x45469b[_0x98dd('0x4d')]['id']}})['then'](handleEntityNotFound(_0x577660,null))[_0x98dd('0x1a')](saveUpdates(_0x45469b['body'],null))[_0x98dd('0x1a')](respondWithResult(_0x577660,null))[_0x98dd('0x52')](handleError(_0x577660,null));};var utilLicense=require('../../config/license/util');exports[_0x98dd('0x6f')]=function(_0x199be3,_0x3051fc,_0x17e7c9){var _0x57a412='server/files/images/logos';var _0x50c63d={'custom':![]};return utilLicense[_0x98dd('0x68')]()[_0x98dd('0x1a')](function(_0x14598a){if(_0x14598a){_0x50c63d=_0x14598a;}return db[_0x98dd('0x36')][_0x98dd('0x51')]({'where':{'id':_0x199be3['params']['id']},'attributes':[_0x98dd('0x56'),_0x98dd('0x54'),_0x98dd('0x57'),'favicon','defaultLogo','defaultLoginLogo','defaultPreferred',_0x98dd('0x69')],'raw':!![]});})[_0x98dd('0x1a')](handleEntityNotFound(_0x3051fc,null))['then'](function(_0x5daebd){if(_0x5daebd){var _0x14efb6=_0x5daebd[_0x98dd('0x57')]&&fs['existsSync'](path[_0x98dd('0x5d')](config['root'],_0x57a412,_[_0x98dd('0x5f')](_0x5daebd[_0x98dd('0x57')])))?path[_0x98dd('0x5d')](config[_0x98dd('0x5e')],_0x57a412,_[_0x98dd('0x5f')](_0x5daebd[_0x98dd('0x57')])):path[_0x98dd('0x5d')](config[_0x98dd('0x5e')],_0x57a412,_[_0x98dd('0x5f')](_0x98dd('0x70')));var _0x53fe9d=_0x98dd('0x61')+_[_0x98dd('0x64')]('preferred');if(_0x5daebd[_0x53fe9d]||!_0x50c63d['custom']||!_0x50c63d[_0x98dd('0x57')]){_0x14efb6=path[_0x98dd('0x5d')](config[_0x98dd('0x5e')],_0x57a412,_[_0x98dd('0x5f')](_0x98dd('0x70')));}if(!fs[_0x98dd('0x5c')](_0x14efb6)){throw new db[(_0x98dd('0x63'))]['ValidationError'](_['upperFirst'](_0x98dd('0x57'))+_0x98dd('0x65'));}return _0x3051fc[_0x98dd('0x66')](_0x14efb6);}})[_0x98dd('0x52')](handleError(_0x3051fc,null));};exports[_0x98dd('0x71')]=function(_0xb8bfe8,_0x48f890,_0xe241df){if(_0xb8bfe8[_0x98dd('0x4f')]&&_0xb8bfe8[_0x98dd('0x4f')][_0x98dd('0x50')]){_0xb8bfe8[_0x98dd('0x4e')][_0x98dd('0x58')]=_0xb8bfe8[_0x98dd('0x4f')][_0x98dd('0x50')];}return db[_0x98dd('0x36')][_0x98dd('0x51')]({'where':{'id':_0xb8bfe8['params']['id']}})[_0x98dd('0x1a')](handleEntityNotFound(_0x48f890,null))[_0x98dd('0x1a')](saveUpdates(_0xb8bfe8[_0x98dd('0x4e')],null))[_0x98dd('0x1a')](respondWithResult(_0x48f890,null))['catch'](handleError(_0x48f890,null));};var utilLicense=require(_0x98dd('0x14'));exports[_0x98dd('0x72')]=function(_0x2085ae,_0x20124c,_0x48fa75){var _0x3a745f='server/files/images/logos';var _0x25fc69={'custom':![]};return utilLicense[_0x98dd('0x68')]()[_0x98dd('0x1a')](function(_0x135a1e){if(_0x135a1e){_0x25fc69=_0x135a1e;}return db[_0x98dd('0x36')][_0x98dd('0x51')]({'where':{'id':_0x2085ae[_0x98dd('0x4d')]['id']},'attributes':[_0x98dd('0x56'),_0x98dd('0x54'),'preferred',_0x98dd('0x58'),_0x98dd('0x59'),_0x98dd('0x5a'),_0x98dd('0x5b'),_0x98dd('0x69')],'raw':!![]});})[_0x98dd('0x1a')](handleEntityNotFound(_0x20124c,null))[_0x98dd('0x1a')](function(_0x163b48){if(_0x163b48){var _0xce97bd=_0x163b48[_0x98dd('0x58')]&&fs[_0x98dd('0x5c')](path[_0x98dd('0x5d')](config[_0x98dd('0x5e')],_0x3a745f,_[_0x98dd('0x5f')](_0x163b48[_0x98dd('0x58')])))?path[_0x98dd('0x5d')](config[_0x98dd('0x5e')],_0x3a745f,_[_0x98dd('0x5f')](_0x163b48['favicon'])):path['join'](config[_0x98dd('0x5e')],_0x3a745f,_[_0x98dd('0x5f')](_0x98dd('0x73')));var _0x4c4eeb='default'+_[_0x98dd('0x64')](_0x98dd('0x58'));if(_0x163b48[_0x4c4eeb]||!_0x25fc69['custom']){_0xce97bd=path[_0x98dd('0x5d')](config[_0x98dd('0x5e')],_0x3a745f,_['toLower'](_0x98dd('0x73')));}if(!fs[_0x98dd('0x5c')](_0xce97bd)){throw new db[(_0x98dd('0x63'))][(_0x98dd('0x6b'))](_['upperFirst'](_0x98dd('0x58'))+_0x98dd('0x65'));}return _0x20124c[_0x98dd('0x66')](_0xce97bd);}})['catch'](handleError(_0x20124c,null));};exports[_0x98dd('0x74')]=function(_0x4b4540,_0x4b17f2){var _0x38e6d3={'offset':moment()[_0x98dd('0x75')]()};_0x38e6d3[_0x98dd('0x76')]=moment()[_0x98dd('0x75')](_0x38e6d3[_0x98dd('0x29')])['format'](_0x98dd('0x77'));return _0x4b17f2[_0x98dd('0x26')](0xc8)[_0x98dd('0x34')](_0x38e6d3);}; \ No newline at end of file +var _0x78cc=['includeAll','include','findAll','rows','show','params','find','update','body','addLogo','file','filename','logo','addLogoLogin','loginLogo','preferred','favicon','defaultLoginLogo','defaultPreferred','defaultFavicon','existsSync','join','root','toLower','custom','Sequelize','ValidationError','upperFirst','\x20not\x20found','download','getLogoLogin','server/files/images/logos','getLicense','defaultLogo','default_loginLogo.svg','default','gdpr','securePassword','addPreferred','getPreferred','default_preferred.png','getFavicon','default_favicon.ico','getDate','utcOffset','now','format','YYYY-MM-DD\x20HH:mm:ss:SSS','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','fs-extra','squel','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','jayson/promise','http','request','then','info','Setting,\x20%s,\x20%s','request\x20sent','debug','error','code','message','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','stack','name','send','index','Setting','rawAttributes','fieldName','type','key','model','keys','query','filters','attributes','intersection','fields','length','nolimit','order','sort','where','filter','map','merge','options'];(function(_0x206250,_0x12539f){var _0x10e8bc=function(_0x118b28){while(--_0x118b28){_0x206250['push'](_0x206250['shift']());}};_0x10e8bc(++_0x12539f);}(_0x78cc,0x11c));var _0xc78c=function(_0x17954e,_0x44ab51){_0x17954e=_0x17954e-0x0;var _0x1fbb79=_0x78cc[_0x17954e];return _0x1fbb79;};'use strict';var emlformat=require(_0xc78c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc78c('0x1'));var jsonpatch=require(_0xc78c('0x2'));var rp=require(_0xc78c('0x3'));var moment=require(_0xc78c('0x4'));var BPromise=require(_0xc78c('0x5'));var Mustache=require(_0xc78c('0x6'));var util=require(_0xc78c('0x7'));var path=require(_0xc78c('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc78c('0x9'));var _=require('lodash');var squel=require(_0xc78c('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xc78c('0xb'));var Papa=require(_0xc78c('0xc'));var Redis=require(_0xc78c('0xd'));var authService=require('../../components/auth/service');var qs=require(_0xc78c('0xe'));var as=require(_0xc78c('0xf'));var hardwareService=require(_0xc78c('0x10'));var logger=require(_0xc78c('0x11'))('api');var utils=require(_0xc78c('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0xc78c('0x13'));var db=require('../../mysqldb')['db'];var jayson=require(_0xc78c('0x14'));var client=jayson['client'][_0xc78c('0x15')]({'port':0x232a});function respondWithRpcPromise(_0x57628a,_0x493217,_0x14cd54,_0x1b5255){return new BPromise(function(_0x5c4a60,_0x4cf381){var _0x4d5ac0=_0x1b5255||client;return _0x4d5ac0[_0xc78c('0x16')](_0x57628a,_0x14cd54)[_0xc78c('0x17')](function(_0x40fdbb){logger[_0xc78c('0x18')](_0xc78c('0x19'),_0x493217,_0xc78c('0x1a'));logger[_0xc78c('0x1b')]('Setting,\x20%s,\x20%s,\x20%s',_0x493217,_0xc78c('0x1a'),JSON['stringify'](_0x40fdbb));if(_0x40fdbb['error']){if(_0x40fdbb[_0xc78c('0x1c')][_0xc78c('0x1d')]===0x1f4){logger[_0xc78c('0x1c')](_0xc78c('0x19'),_0x493217,_0x40fdbb[_0xc78c('0x1c')][_0xc78c('0x1e')]);return _0x4cf381(_0x40fdbb['error']['message']);}logger[_0xc78c('0x1c')](_0xc78c('0x19'),_0x493217,_0x40fdbb[_0xc78c('0x1c')][_0xc78c('0x1e')]);return _0x5c4a60(_0x40fdbb[_0xc78c('0x1c')]['message']);}else{logger[_0xc78c('0x18')]('Setting,\x20%s,\x20%s',_0x493217,_0xc78c('0x1a'));_0x5c4a60(_0x40fdbb['result'][_0xc78c('0x1e')]);}})[_0xc78c('0x1f')](function(_0x6cb6e2){logger[_0xc78c('0x1c')](_0xc78c('0x19'),_0x493217,_0x6cb6e2);_0x4cf381(_0x6cb6e2);});});}function respondWithStatusCode(_0x5dcce8,_0x1b73b5){_0x1b73b5=_0x1b73b5||0xcc;return function(_0x42a4d5){if(_0x42a4d5){return _0x5dcce8[_0xc78c('0x20')](_0x1b73b5);}return _0x5dcce8[_0xc78c('0x21')](_0x1b73b5)[_0xc78c('0x22')]();};}function respondWithResult(_0x387d63,_0x3fc15c){_0x3fc15c=_0x3fc15c||0xc8;return function(_0x1372fe){if(_0x1372fe){return _0x387d63[_0xc78c('0x21')](_0x3fc15c)[_0xc78c('0x23')](_0x1372fe);}};}function respondWithFilteredResult(_0x5bc9e1,_0x3b1b6c){return function(_0x2d7692){if(_0x2d7692){var _0x4c08af=typeof _0x3b1b6c[_0xc78c('0x24')]===_0xc78c('0x25')&&typeof _0x3b1b6c[_0xc78c('0x26')]===_0xc78c('0x25');var _0xd3a6a6=_0x2d7692[_0xc78c('0x27')];var _0x1bbf32=_0x4c08af?0x0:_0x3b1b6c[_0xc78c('0x24')];var _0xb6ad4c=_0x4c08af?_0x2d7692[_0xc78c('0x27')]:_0x3b1b6c[_0xc78c('0x24')]+_0x3b1b6c[_0xc78c('0x26')];var _0x15caac;if(_0xb6ad4c>=_0xd3a6a6){_0xb6ad4c=_0xd3a6a6;_0x15caac=0xc8;}else{_0x15caac=0xce;}_0x5bc9e1[_0xc78c('0x21')](_0x15caac);return _0x5bc9e1[_0xc78c('0x28')](_0xc78c('0x29'),_0x1bbf32+'-'+_0xb6ad4c+'/'+_0xd3a6a6)[_0xc78c('0x23')](_0x2d7692);}return null;};}function patchUpdates(_0x34edf9){return function(_0x9df562){try{jsonpatch[_0xc78c('0x2a')](_0x9df562,_0x34edf9,!![]);}catch(_0x4e4647){return BPromise[_0xc78c('0x2b')](_0x4e4647);}return _0x9df562[_0xc78c('0x2c')]();};}function saveUpdates(_0x20c58c,_0x1d6959){return function(_0x2173d4){if(_0x2173d4){return _0x2173d4['update'](_0x20c58c)[_0xc78c('0x17')](function(_0x105278){return _0x105278;});}return null;};}function removeEntity(_0x18d2d6,_0xfb747c){return function(_0x4a08b2){if(_0x4a08b2){return _0x4a08b2['destroy']()['then'](function(){_0x18d2d6[_0xc78c('0x21')](0xcc)[_0xc78c('0x22')]();});}};}function handleEntityNotFound(_0x2061bd,_0x29154d){return function(_0x3cba7c){if(!_0x3cba7c){_0x2061bd[_0xc78c('0x20')](0x194);}return _0x3cba7c;};}function handleError(_0x43a5e9,_0x40043c){_0x40043c=_0x40043c||0x1f4;return function(_0x2b8590){logger[_0xc78c('0x1c')](_0x2b8590[_0xc78c('0x2d')]);if(_0x2b8590[_0xc78c('0x2e')]){delete _0x2b8590[_0xc78c('0x2e')];}_0x43a5e9[_0xc78c('0x21')](_0x40043c)[_0xc78c('0x2f')](_0x2b8590);};}exports[_0xc78c('0x30')]=function(_0x39b4d1,_0x5d6be7){var _0x4a6b57={},_0x3cba83={},_0x58b42a={'count':0x0,'rows':[]};var _0x508bed=_['map'](db[_0xc78c('0x31')][_0xc78c('0x32')],function(_0x5d82b9){return{'name':_0x5d82b9[_0xc78c('0x33')],'type':_0x5d82b9[_0xc78c('0x34')][_0xc78c('0x35')]};});_0x3cba83[_0xc78c('0x36')]=_['map'](_0x508bed,'name');_0x3cba83['query']=_[_0xc78c('0x37')](_0x39b4d1[_0xc78c('0x38')]);_0x3cba83[_0xc78c('0x39')]=_['intersection'](_0x3cba83['model'],_0x3cba83['query']);_0x4a6b57[_0xc78c('0x3a')]=_[_0xc78c('0x3b')](_0x3cba83['model'],qs['fields'](_0x39b4d1[_0xc78c('0x38')][_0xc78c('0x3c')]));_0x4a6b57[_0xc78c('0x3a')]=_0x4a6b57[_0xc78c('0x3a')][_0xc78c('0x3d')]?_0x4a6b57[_0xc78c('0x3a')]:_0x3cba83['model'];if(!_0x39b4d1[_0xc78c('0x38')]['hasOwnProperty'](_0xc78c('0x3e'))){_0x4a6b57[_0xc78c('0x26')]=qs['limit'](_0x39b4d1[_0xc78c('0x38')][_0xc78c('0x26')]);_0x4a6b57[_0xc78c('0x24')]=qs[_0xc78c('0x24')](_0x39b4d1[_0xc78c('0x38')][_0xc78c('0x24')]);}_0x4a6b57[_0xc78c('0x3f')]=qs[_0xc78c('0x40')](_0x39b4d1[_0xc78c('0x38')][_0xc78c('0x40')]);_0x4a6b57[_0xc78c('0x41')]=qs['filters'](_['pick'](_0x39b4d1[_0xc78c('0x38')],_0x3cba83[_0xc78c('0x39')]),_0x508bed);if(_0x39b4d1['query'][_0xc78c('0x42')]){_0x4a6b57[_0xc78c('0x41')]=_['merge'](_0x4a6b57['where'],{'$or':_[_0xc78c('0x43')](_0x508bed,function(_0x8d2d80){if(_0x8d2d80[_0xc78c('0x34')]!=='VIRTUAL'){var _0x413565={};_0x413565[_0x8d2d80[_0xc78c('0x2e')]]={'$like':'%'+_0x39b4d1[_0xc78c('0x38')][_0xc78c('0x42')]+'%'};return _0x413565;}})});}_0x4a6b57=_[_0xc78c('0x44')]({},_0x4a6b57,_0x39b4d1[_0xc78c('0x45')]);var _0x5a3826={'where':_0x4a6b57[_0xc78c('0x41')]};return db[_0xc78c('0x31')]['count'](_0x5a3826)['then'](function(_0x52008c){_0x58b42a[_0xc78c('0x27')]=_0x52008c;if(_0x39b4d1[_0xc78c('0x38')][_0xc78c('0x46')]){_0x4a6b57[_0xc78c('0x47')]=[{'all':!![]}];}return db['Setting'][_0xc78c('0x48')](_0x4a6b57);})[_0xc78c('0x17')](function(_0x502be1){_0x58b42a[_0xc78c('0x49')]=_0x502be1;return _0x58b42a;})['then'](respondWithFilteredResult(_0x5d6be7,_0x4a6b57))[_0xc78c('0x1f')](handleError(_0x5d6be7,null));};exports[_0xc78c('0x4a')]=function(_0x55588c,_0x517bb0){var _0x16bb78={'raw':![],'where':{'id':_0x55588c[_0xc78c('0x4b')]['id']}},_0x4a7016={};_0x4a7016['model']=_[_0xc78c('0x37')](db[_0xc78c('0x31')][_0xc78c('0x32')]);_0x4a7016[_0xc78c('0x38')]=_[_0xc78c('0x37')](_0x55588c[_0xc78c('0x38')]);_0x4a7016[_0xc78c('0x39')]=_[_0xc78c('0x3b')](_0x4a7016[_0xc78c('0x36')],_0x4a7016[_0xc78c('0x38')]);_0x16bb78[_0xc78c('0x3a')]=_[_0xc78c('0x3b')](_0x4a7016[_0xc78c('0x36')],qs[_0xc78c('0x3c')](_0x55588c[_0xc78c('0x38')][_0xc78c('0x3c')]));_0x16bb78[_0xc78c('0x3a')]=_0x16bb78[_0xc78c('0x3a')][_0xc78c('0x3d')]?_0x16bb78['attributes']:_0x4a7016[_0xc78c('0x36')];if(_0x55588c['query'][_0xc78c('0x46')]){_0x16bb78[_0xc78c('0x47')]=[{'all':!![]}];}_0x16bb78=_['merge']({},_0x16bb78,_0x55588c['options']);return db[_0xc78c('0x31')][_0xc78c('0x4c')](_0x16bb78)[_0xc78c('0x17')](handleEntityNotFound(_0x517bb0,null))[_0xc78c('0x17')](respondWithResult(_0x517bb0,null))[_0xc78c('0x1f')](handleError(_0x517bb0,null));};exports[_0xc78c('0x4d')]=function(_0x15e899,_0xa96dbc){if(_0x15e899[_0xc78c('0x4e')]['id']){delete _0x15e899[_0xc78c('0x4e')]['id'];}return db[_0xc78c('0x31')][_0xc78c('0x4c')]({'where':{'id':_0x15e899['params']['id']}})[_0xc78c('0x17')](handleEntityNotFound(_0xa96dbc,null))[_0xc78c('0x17')](saveUpdates(_0x15e899[_0xc78c('0x4e')],null))[_0xc78c('0x17')](respondWithResult(_0xa96dbc,null))[_0xc78c('0x1f')](handleError(_0xa96dbc,null));};exports[_0xc78c('0x4f')]=function(_0x4c147b,_0x1ef1dc,_0x1a08c3){if(_0x4c147b['file']&&_0x4c147b[_0xc78c('0x50')][_0xc78c('0x51')]){_0x4c147b[_0xc78c('0x4e')][_0xc78c('0x52')]=_0x4c147b[_0xc78c('0x50')][_0xc78c('0x51')];}return db[_0xc78c('0x31')]['find']({'where':{'id':_0x4c147b[_0xc78c('0x4b')]['id']}})[_0xc78c('0x17')](handleEntityNotFound(_0x1ef1dc,null))[_0xc78c('0x17')](saveUpdates(_0x4c147b[_0xc78c('0x4e')],null))[_0xc78c('0x17')](respondWithResult(_0x1ef1dc,null))[_0xc78c('0x1f')](handleError(_0x1ef1dc,null));};exports[_0xc78c('0x53')]=function(_0x277e80,_0x1bbe21,_0x18a65f){if(_0x277e80[_0xc78c('0x50')]&&_0x277e80[_0xc78c('0x50')]['filename']){_0x277e80['body'][_0xc78c('0x54')]=_0x277e80['file'][_0xc78c('0x51')];}return db[_0xc78c('0x31')][_0xc78c('0x4c')]({'where':{'id':_0x277e80['params']['id']}})[_0xc78c('0x17')](handleEntityNotFound(_0x1bbe21,null))[_0xc78c('0x17')](saveUpdates(_0x277e80[_0xc78c('0x4e')],null))[_0xc78c('0x17')](respondWithResult(_0x1bbe21,null))['catch'](handleError(_0x1bbe21,null));};var utilLicense=require(_0xc78c('0x13'));exports['getLogo']=function(_0x3bbc39,_0x28ee13,_0xb6a2a7){var _0x1129fa='server/files/images/logos';var _0xafe16a={'custom':![]};return utilLicense['getLicense']()['then'](function(_0x1b8474){if(_0x1b8474){_0xafe16a=_0x1b8474;}return db[_0xc78c('0x31')][_0xc78c('0x4c')]({'where':{'id':_0x3bbc39[_0xc78c('0x4b')]['id']},'attributes':[_0xc78c('0x52'),_0xc78c('0x54'),_0xc78c('0x55'),_0xc78c('0x56'),'defaultLogo',_0xc78c('0x57'),_0xc78c('0x58'),_0xc78c('0x59')],'raw':!![]});})[_0xc78c('0x17')](handleEntityNotFound(_0x28ee13,null))[_0xc78c('0x17')](function(_0xf8996e){if(_0xf8996e){var _0x39a445=_0xf8996e[_0xc78c('0x52')]&&fs[_0xc78c('0x5a')](path[_0xc78c('0x5b')](config[_0xc78c('0x5c')],_0x1129fa,_[_0xc78c('0x5d')](_0xf8996e[_0xc78c('0x52')])))?path[_0xc78c('0x5b')](config[_0xc78c('0x5c')],_0x1129fa,_['toLower'](_0xf8996e[_0xc78c('0x52')])):path[_0xc78c('0x5b')](config[_0xc78c('0x5c')],_0x1129fa,_[_0xc78c('0x5d')]('default_logo.svg'));var _0x423245='default'+_['upperFirst'](_0xc78c('0x52'));if(_0xf8996e[_0x423245]||!_0xafe16a[_0xc78c('0x5e')]){_0x39a445=path[_0xc78c('0x5b')](config[_0xc78c('0x5c')],_0x1129fa,_[_0xc78c('0x5d')]('default_logo.svg'));}if(!fs[_0xc78c('0x5a')](_0x39a445)){throw new db[(_0xc78c('0x5f'))][(_0xc78c('0x60'))](_[_0xc78c('0x61')](_0xc78c('0x52'))+_0xc78c('0x62'));}return _0x28ee13[_0xc78c('0x63')](_0x39a445);}})['catch'](handleError(_0x28ee13,null));};var utilLicense=require(_0xc78c('0x13'));exports[_0xc78c('0x64')]=function(_0x3df0be,_0x47a2bf,_0x5eb43c){var _0x2a7417=_0xc78c('0x65');var _0x5d4dbf={'custom':![]};return utilLicense[_0xc78c('0x66')]()[_0xc78c('0x17')](function(_0x13bd38){if(_0x13bd38){_0x5d4dbf=_0x13bd38;}return db[_0xc78c('0x31')]['find']({'where':{'id':_0x3df0be[_0xc78c('0x4b')]['id']},'attributes':['logo',_0xc78c('0x54'),_0xc78c('0x55'),_0xc78c('0x56'),_0xc78c('0x67'),_0xc78c('0x57'),_0xc78c('0x58'),'defaultFavicon'],'raw':!![]});})[_0xc78c('0x17')](handleEntityNotFound(_0x47a2bf,null))[_0xc78c('0x17')](function(_0x48fcc5){if(_0x48fcc5){var _0x27ea70=_0x48fcc5[_0xc78c('0x54')]&&fs[_0xc78c('0x5a')](path[_0xc78c('0x5b')](config[_0xc78c('0x5c')],_0x2a7417,_['toLower'](_0x48fcc5['loginLogo'])))?path[_0xc78c('0x5b')](config[_0xc78c('0x5c')],_0x2a7417,_[_0xc78c('0x5d')](_0x48fcc5[_0xc78c('0x54')])):path['join'](config[_0xc78c('0x5c')],_0x2a7417,_[_0xc78c('0x5d')](_0xc78c('0x68')));var _0x27e9c5=_0xc78c('0x69')+_[_0xc78c('0x61')](_0xc78c('0x54'));if(_0x48fcc5[_0x27e9c5]||!_0x5d4dbf[_0xc78c('0x5e')]){_0x27ea70=path[_0xc78c('0x5b')](config[_0xc78c('0x5c')],_0x2a7417,_[_0xc78c('0x5d')]('default_loginLogo.svg'));}if(!fs[_0xc78c('0x5a')](_0x27ea70)){throw new db[(_0xc78c('0x5f'))]['ValidationError'](_[_0xc78c('0x61')](_0xc78c('0x54'))+_0xc78c('0x62'));}return _0x47a2bf[_0xc78c('0x63')](_0x27ea70);}})[_0xc78c('0x1f')](handleError(_0x47a2bf,null));};exports[_0xc78c('0x6a')]=function(_0x4ec92b,_0x57901b){return db[_0xc78c('0x31')][_0xc78c('0x4c')]({'where':{'id':_0x4ec92b[_0xc78c('0x4b')]['id']},'attributes':[_0xc78c('0x6b')]})['then'](respondWithResult(_0x57901b,null))[_0xc78c('0x1f')](handleError(_0x57901b,null));};exports[_0xc78c('0x6c')]=function(_0x88a089,_0x35f3f9,_0x14c729){if(_0x88a089[_0xc78c('0x50')]&&_0x88a089[_0xc78c('0x50')][_0xc78c('0x51')]){_0x88a089['body']['preferred']=_0x88a089['file'][_0xc78c('0x51')];}return db[_0xc78c('0x31')][_0xc78c('0x4c')]({'where':{'id':_0x88a089[_0xc78c('0x4b')]['id']}})[_0xc78c('0x17')](handleEntityNotFound(_0x35f3f9,null))[_0xc78c('0x17')](saveUpdates(_0x88a089['body'],null))[_0xc78c('0x17')](respondWithResult(_0x35f3f9,null))[_0xc78c('0x1f')](handleError(_0x35f3f9,null));};var utilLicense=require(_0xc78c('0x13'));exports[_0xc78c('0x6d')]=function(_0x5a4abe,_0x3a15d1,_0x588457){var _0x4b11b2=_0xc78c('0x65');var _0x4c9a04={'custom':![]};return utilLicense[_0xc78c('0x66')]()[_0xc78c('0x17')](function(_0x15d018){if(_0x15d018){_0x4c9a04=_0x15d018;}return db[_0xc78c('0x31')][_0xc78c('0x4c')]({'where':{'id':_0x5a4abe['params']['id']},'attributes':[_0xc78c('0x52'),_0xc78c('0x54'),_0xc78c('0x55'),_0xc78c('0x56'),_0xc78c('0x67'),_0xc78c('0x57'),_0xc78c('0x58'),_0xc78c('0x59')],'raw':!![]});})['then'](handleEntityNotFound(_0x3a15d1,null))[_0xc78c('0x17')](function(_0x16b49f){if(_0x16b49f){var _0x5b1f60=_0x16b49f[_0xc78c('0x55')]&&fs[_0xc78c('0x5a')](path['join'](config[_0xc78c('0x5c')],_0x4b11b2,_[_0xc78c('0x5d')](_0x16b49f[_0xc78c('0x55')])))?path[_0xc78c('0x5b')](config[_0xc78c('0x5c')],_0x4b11b2,_[_0xc78c('0x5d')](_0x16b49f[_0xc78c('0x55')])):path[_0xc78c('0x5b')](config[_0xc78c('0x5c')],_0x4b11b2,_[_0xc78c('0x5d')](_0xc78c('0x6e')));var _0x3be14d=_0xc78c('0x69')+_['upperFirst'](_0xc78c('0x55'));if(_0x16b49f[_0x3be14d]||!_0x4c9a04['custom']||!_0x4c9a04[_0xc78c('0x55')]){_0x5b1f60=path[_0xc78c('0x5b')](config[_0xc78c('0x5c')],_0x4b11b2,_[_0xc78c('0x5d')](_0xc78c('0x6e')));}if(!fs[_0xc78c('0x5a')](_0x5b1f60)){throw new db[(_0xc78c('0x5f'))]['ValidationError'](_[_0xc78c('0x61')]('preferred')+_0xc78c('0x62'));}return _0x3a15d1[_0xc78c('0x63')](_0x5b1f60);}})[_0xc78c('0x1f')](handleError(_0x3a15d1,null));};exports['addFavicon']=function(_0x4132ac,_0x289fb2,_0x387429){if(_0x4132ac[_0xc78c('0x50')]&&_0x4132ac[_0xc78c('0x50')][_0xc78c('0x51')]){_0x4132ac[_0xc78c('0x4e')][_0xc78c('0x56')]=_0x4132ac[_0xc78c('0x50')][_0xc78c('0x51')];}return db[_0xc78c('0x31')][_0xc78c('0x4c')]({'where':{'id':_0x4132ac[_0xc78c('0x4b')]['id']}})[_0xc78c('0x17')](handleEntityNotFound(_0x289fb2,null))[_0xc78c('0x17')](saveUpdates(_0x4132ac[_0xc78c('0x4e')],null))[_0xc78c('0x17')](respondWithResult(_0x289fb2,null))[_0xc78c('0x1f')](handleError(_0x289fb2,null));};var utilLicense=require('../../config/license/util');exports[_0xc78c('0x6f')]=function(_0x487d47,_0xd158ee,_0x132b9f){var _0x330cc3=_0xc78c('0x65');var _0x2c0de9={'custom':![]};return utilLicense[_0xc78c('0x66')]()['then'](function(_0x34fe1c){if(_0x34fe1c){_0x2c0de9=_0x34fe1c;}return db[_0xc78c('0x31')][_0xc78c('0x4c')]({'where':{'id':_0x487d47['params']['id']},'attributes':[_0xc78c('0x52'),_0xc78c('0x54'),_0xc78c('0x55'),_0xc78c('0x56'),_0xc78c('0x67'),_0xc78c('0x57'),_0xc78c('0x58'),'defaultFavicon'],'raw':!![]});})[_0xc78c('0x17')](handleEntityNotFound(_0xd158ee,null))[_0xc78c('0x17')](function(_0x569bfa){if(_0x569bfa){var _0x50948b=_0x569bfa[_0xc78c('0x56')]&&fs[_0xc78c('0x5a')](path[_0xc78c('0x5b')](config['root'],_0x330cc3,_[_0xc78c('0x5d')](_0x569bfa[_0xc78c('0x56')])))?path[_0xc78c('0x5b')](config['root'],_0x330cc3,_[_0xc78c('0x5d')](_0x569bfa['favicon'])):path[_0xc78c('0x5b')](config[_0xc78c('0x5c')],_0x330cc3,_[_0xc78c('0x5d')](_0xc78c('0x70')));var _0xd63718=_0xc78c('0x69')+_[_0xc78c('0x61')]('favicon');if(_0x569bfa[_0xd63718]||!_0x2c0de9[_0xc78c('0x5e')]){_0x50948b=path[_0xc78c('0x5b')](config[_0xc78c('0x5c')],_0x330cc3,_['toLower'](_0xc78c('0x70')));}if(!fs['existsSync'](_0x50948b)){throw new db[(_0xc78c('0x5f'))]['ValidationError'](_[_0xc78c('0x61')](_0xc78c('0x56'))+_0xc78c('0x62'));}return _0xd158ee[_0xc78c('0x63')](_0x50948b);}})[_0xc78c('0x1f')](handleError(_0xd158ee,null));};exports[_0xc78c('0x71')]=function(_0x340f02,_0x26876b){var _0x224b9c={'offset':moment()[_0xc78c('0x72')]()};_0x224b9c[_0xc78c('0x73')]=moment()[_0xc78c('0x72')](_0x224b9c['offset'])[_0xc78c('0x74')](_0xc78c('0x75'));return _0x26876b[_0xc78c('0x21')](0xc8)[_0xc78c('0x2f')](_0x224b9c);}; \ No newline at end of file diff --git a/server/api/setting/setting.model.js b/server/api/setting/setting.model.js index c0918a4..c099cd5 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(_0x446208,_0xb483fb){var _0xe49563=function(_0x1d3a21){while(--_0x1d3a21){_0x446208['push'](_0x446208['shift']());}};_0xe49563(++_0xb483fb);}(_0x7217,0x19e));var _0x7721=function(_0x139a3c,_0x4fc883){_0x139a3c=_0x139a3c-0x0;var _0x2b375b=_0x7217[_0x139a3c];return _0x2b375b;};'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(_0x1497b5,_0x4c72df){var _0x3080af=function(_0x2fdf75){while(--_0x2fdf75){_0x1497b5['push'](_0x1497b5['shift']());}};_0x3080af(++_0x4c72df);}(_0x008c,0x188));var _0xc008=function(_0x4d183d,_0x123de0){_0x4d183d=_0x4d183d-0x0;var _0x431236=_0x008c[_0x4d183d];return _0x431236;};'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 b3a9705..fb9d513 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 _0x959f=['ShowSetting','find','options','attributes','include','map','model','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','then','info','Setting,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','Setting,\x20%s,\x20%s','message','result'];(function(_0x80f51a,_0x32e95e){var _0x327148=function(_0x16f788){while(--_0x16f788){_0x80f51a['push'](_0x80f51a['shift']());}};_0x327148(++_0x32e95e);}(_0x959f,0x1b8));var _0xf959=function(_0x219676,_0x5f2a4a){_0x219676=_0x219676-0x0;var _0x427c01=_0x959f[_0x219676];return _0x427c01;};'use strict';var _=require(_0xf959('0x0'));var util=require('util');var moment=require(_0xf959('0x1'));var BPromise=require(_0xf959('0x2'));var rs=require(_0xf959('0x3'));var fs=require('fs');var Redis=require(_0xf959('0x4'));var db=require(_0xf959('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xf959('0x6'))(_0xf959('0x7'));var config=require(_0xf959('0x8'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3da704,_0x417cb9,_0x55f065){return new BPromise(function(_0x26d10b,_0x536d34){return client['request'](_0x3da704,_0x55f065)[_0xf959('0x9')](function(_0x3e7a5b){logger[_0xf959('0xa')]('Setting,\x20%s,\x20%s',_0x417cb9,'request\x20sent');logger['debug'](_0xf959('0xb'),_0x417cb9,_0xf959('0xc'),JSON[_0xf959('0xd')](_0x3e7a5b));if(_0x3e7a5b[_0xf959('0xe')]){if(_0x3e7a5b[_0xf959('0xe')][_0xf959('0xf')]===0x1f4){logger[_0xf959('0xe')](_0xf959('0x10'),_0x417cb9,_0x3e7a5b[_0xf959('0xe')][_0xf959('0x11')]);return _0x536d34(_0x3e7a5b[_0xf959('0xe')]['message']);}logger[_0xf959('0xe')]('Setting,\x20%s,\x20%s',_0x417cb9,_0x3e7a5b['error']['message']);return _0x26d10b(_0x3e7a5b[_0xf959('0xe')][_0xf959('0x11')]);}else{logger[_0xf959('0xa')](_0xf959('0x10'),_0x417cb9,_0xf959('0xc'));_0x26d10b(_0x3e7a5b[_0xf959('0x12')][_0xf959('0x11')]);}})['catch'](function(_0x108dea){logger[_0xf959('0xe')](_0xf959('0x10'),_0x417cb9,_0x108dea);_0x536d34(_0x108dea);});});}exports[_0xf959('0x13')]=function(_0x44946d){var _0x3d9211=this;return new Promise(function(_0x3df4c9,_0x49b251){return db['Setting'][_0xf959('0x14')]({'raw':_0x44946d['options']?_0x44946d[_0xf959('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x44946d[_0xf959('0x15')]?_0x44946d[_0xf959('0x15')]['where']||null:null,'attributes':_0x44946d[_0xf959('0x15')]?_0x44946d[_0xf959('0x15')][_0xf959('0x16')]||null:null,'include':_0x44946d['options']?_0x44946d[_0xf959('0x15')][_0xf959('0x17')]?_[_0xf959('0x18')](_0x44946d[_0xf959('0x15')]['include'],function(_0x8475a2){return{'model':db[_0x8475a2[_0xf959('0x19')]],'as':_0x8475a2['as'],'attributes':_0x8475a2[_0xf959('0x16')],'include':_0x8475a2[_0xf959('0x17')]?_[_0xf959('0x18')](_0x8475a2[_0xf959('0x17')],function(_0xec422e){return{'model':db[_0xec422e['model']],'as':_0xec422e['as'],'attributes':_0xec422e['attributes'],'include':_0xec422e['include']?_['map'](_0xec422e[_0xf959('0x17')],function(_0x5343db){return{'model':db[_0x5343db[_0xf959('0x19')]],'as':_0x5343db['as'],'attributes':_0x5343db[_0xf959('0x16')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x41288f){logger['info'](_0xf959('0x13'),_0x44946d);logger['debug'](_0xf959('0x13'),_0x44946d,JSON['stringify'](_0x41288f));_0x3df4c9(_0x41288f);})[_0xf959('0x1a')](function(_0x3294b6){logger[_0xf959('0xe')](_0xf959('0x13'),_0x3294b6[_0xf959('0x11')],_0x44946d);_0x49b251(_0x3d9211[_0xf959('0xe')](0x1f4,_0x3294b6[_0xf959('0x11')]));});});}; \ No newline at end of file +var _0xf6f2=['result','catch','find','options','raw','where','attributes','include','map','model','ShowSetting','debug','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','client','http','request','then','Setting,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','info','Setting,\x20%s,\x20%s'];(function(_0x1ef946,_0x422b3e){var _0x25acef=function(_0x11b79a){while(--_0x11b79a){_0x1ef946['push'](_0x1ef946['shift']());}};_0x25acef(++_0x422b3e);}(_0xf6f2,0x6c));var _0x2f6f=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0xf6f2[_0x167cc1];return _0x10bc4b;};'use strict';var _=require(_0x2f6f('0x0'));var util=require(_0x2f6f('0x1'));var moment=require(_0x2f6f('0x2'));var BPromise=require(_0x2f6f('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2f6f('0x4'));var db=require(_0x2f6f('0x5'))['db'];var utils=require(_0x2f6f('0x6'));var logger=require(_0x2f6f('0x7'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x2f6f('0x8')][_0x2f6f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x28dbe7,_0x1e945b,_0x173a75){return new BPromise(function(_0x4a8510,_0x167c00){return client[_0x2f6f('0xa')](_0x28dbe7,_0x173a75)[_0x2f6f('0xb')](function(_0x30d07){logger['info']('Setting,\x20%s,\x20%s',_0x1e945b,'request\x20sent');logger['debug'](_0x2f6f('0xc'),_0x1e945b,_0x2f6f('0xd'),JSON[_0x2f6f('0xe')](_0x30d07));if(_0x30d07['error']){if(_0x30d07['error'][_0x2f6f('0xf')]===0x1f4){logger[_0x2f6f('0x10')]('Setting,\x20%s,\x20%s',_0x1e945b,_0x30d07['error'][_0x2f6f('0x11')]);return _0x167c00(_0x30d07[_0x2f6f('0x10')][_0x2f6f('0x11')]);}logger[_0x2f6f('0x10')]('Setting,\x20%s,\x20%s',_0x1e945b,_0x30d07[_0x2f6f('0x10')][_0x2f6f('0x11')]);return _0x4a8510(_0x30d07[_0x2f6f('0x10')]['message']);}else{logger[_0x2f6f('0x12')](_0x2f6f('0x13'),_0x1e945b,'request\x20sent');_0x4a8510(_0x30d07[_0x2f6f('0x14')][_0x2f6f('0x11')]);}})[_0x2f6f('0x15')](function(_0x5c1d11){logger[_0x2f6f('0x10')](_0x2f6f('0x13'),_0x1e945b,_0x5c1d11);_0x167c00(_0x5c1d11);});});}exports['ShowSetting']=function(_0x4be421){var _0x50dcd3=this;return new Promise(function(_0x474ea6,_0x57a8fc){return db['Setting'][_0x2f6f('0x16')]({'raw':_0x4be421[_0x2f6f('0x17')]?_0x4be421[_0x2f6f('0x17')][_0x2f6f('0x18')]===undefined?!![]:![]:!![],'where':_0x4be421[_0x2f6f('0x17')]?_0x4be421[_0x2f6f('0x17')][_0x2f6f('0x19')]||null:null,'attributes':_0x4be421[_0x2f6f('0x17')]?_0x4be421[_0x2f6f('0x17')][_0x2f6f('0x1a')]||null:null,'include':_0x4be421[_0x2f6f('0x17')]?_0x4be421[_0x2f6f('0x17')][_0x2f6f('0x1b')]?_[_0x2f6f('0x1c')](_0x4be421[_0x2f6f('0x17')][_0x2f6f('0x1b')],function(_0x1b50c2){return{'model':db[_0x1b50c2['model']],'as':_0x1b50c2['as'],'attributes':_0x1b50c2['attributes'],'include':_0x1b50c2['include']?_[_0x2f6f('0x1c')](_0x1b50c2['include'],function(_0x47ec56){return{'model':db[_0x47ec56[_0x2f6f('0x1d')]],'as':_0x47ec56['as'],'attributes':_0x47ec56[_0x2f6f('0x1a')],'include':_0x47ec56['include']?_[_0x2f6f('0x1c')](_0x47ec56[_0x2f6f('0x1b')],function(_0x5dd426){return{'model':db[_0x5dd426[_0x2f6f('0x1d')]],'as':_0x5dd426['as'],'attributes':_0x5dd426[_0x2f6f('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4090eb){logger[_0x2f6f('0x12')](_0x2f6f('0x1e'),_0x4be421);logger[_0x2f6f('0x1f')](_0x2f6f('0x1e'),_0x4be421,JSON[_0x2f6f('0xe')](_0x4090eb));_0x474ea6(_0x4090eb);})[_0x2f6f('0x15')](function(_0x153361){logger[_0x2f6f('0x10')](_0x2f6f('0x1e'),_0x153361[_0x2f6f('0x11')],_0x4be421);_0x57a8fc(_0x50dcd3[_0x2f6f('0x10')](0x1f4,_0x153361[_0x2f6f('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/index.js b/server/api/smsAccount/index.js index b4b00e0..8e8615b 100644 --- a/server/api/smsAccount/index.js +++ b/server/api/smsAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['getInteractions','/:id/status','statusGet','/:id/users','post','create','addAnswer','/:id/notify','notify','addApplications','send','status','addAgents','put','/:id','update','delete','destroy','/:id/canned_answers','removeAnswers','removeAgents','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsAccount.controller','get','index','/describe','isAuthenticated','/:id/dispositions','getDispositions','getAnswers','/:id/applications','getApplications'];(function(_0x3651d9,_0x15a660){var _0x38c7b7=function(_0x16d647){while(--_0x16d647){_0x3651d9['push'](_0x3651d9['shift']());}};_0x38c7b7(++_0x15a660);}(_0x7a54,0x106));var _0x47a5=function(_0x5d7de1,_0x34b471){_0x5d7de1=_0x5d7de1-0x0;var _0x302a13=_0x7a54[_0x5d7de1];return _0x302a13;};'use strict';var multer=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var path=require(_0x47a5('0x2'));var timeout=require('connect-timeout');var express=require(_0x47a5('0x3'));var router=express[_0x47a5('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x47a5('0x5'));var interaction=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var controller=require(_0x47a5('0x8'));router[_0x47a5('0x9')]('/',auth['isAuthenticated'](),controller[_0x47a5('0xa')]);router['get'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['describe']);router[_0x47a5('0x9')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x47a5('0x9')](_0x47a5('0xd'),auth['isAuthenticated'](),controller[_0x47a5('0xe')]);router['get']('/:id/canned_answers',auth[_0x47a5('0xc')](),controller[_0x47a5('0xf')]);router[_0x47a5('0x9')](_0x47a5('0x10'),auth[_0x47a5('0xc')](),controller[_0x47a5('0x11')]);router[_0x47a5('0x9')]('/:id/interactions',auth[_0x47a5('0xc')](),controller[_0x47a5('0x12')]);router[_0x47a5('0x9')](_0x47a5('0x13'),controller[_0x47a5('0x14')]);router[_0x47a5('0x9')](_0x47a5('0x15'),auth[_0x47a5('0xc')](),controller['getAgents']);router[_0x47a5('0x16')]('/',auth[_0x47a5('0xc')](),controller[_0x47a5('0x17')]);router[_0x47a5('0x16')](_0x47a5('0xd'),auth['isAuthenticated'](),controller['addDisposition']);router[_0x47a5('0x16')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0x47a5('0x18')]);router[_0x47a5('0x16')](_0x47a5('0x19'),controller[_0x47a5('0x1a')]);router[_0x47a5('0x16')](_0x47a5('0x10'),auth[_0x47a5('0xc')](),controller[_0x47a5('0x1b')]);router[_0x47a5('0x16')]('/:id/send',auth[_0x47a5('0xc')](),controller[_0x47a5('0x1c')]);router['post'](_0x47a5('0x13'),controller[_0x47a5('0x1d')]);router[_0x47a5('0x16')]('/:id/users',auth[_0x47a5('0xc')](),controller[_0x47a5('0x1e')]);router[_0x47a5('0x1f')](_0x47a5('0x20'),auth['isAuthenticated'](),controller[_0x47a5('0x21')]);router[_0x47a5('0x22')]('/:id',auth[_0x47a5('0xc')](),controller[_0x47a5('0x23')]);router[_0x47a5('0x22')](_0x47a5('0xd'),auth[_0x47a5('0xc')](),controller['removeDispositions']);router['delete'](_0x47a5('0x24'),auth['isAuthenticated'](),controller[_0x47a5('0x25')]);router['delete'](_0x47a5('0x15'),auth[_0x47a5('0xc')](),controller[_0x47a5('0x26')]);module[_0x47a5('0x27')]=router; \ No newline at end of file +var _0x7a54=['getInteractions','/:id/status','statusGet','/:id/users','post','create','addAnswer','/:id/notify','notify','addApplications','send','status','addAgents','put','/:id','update','delete','destroy','/:id/canned_answers','removeAnswers','removeAgents','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsAccount.controller','get','index','/describe','isAuthenticated','/:id/dispositions','getDispositions','getAnswers','/:id/applications','getApplications'];(function(_0x108bc3,_0x2b03d6){var _0x58dc86=function(_0x5ecc9b){while(--_0x5ecc9b){_0x108bc3['push'](_0x108bc3['shift']());}};_0x58dc86(++_0x2b03d6);}(_0x7a54,0x106));var _0x47a5=function(_0x35ae83,_0x3f2b8b){_0x35ae83=_0x35ae83-0x0;var _0x5aaf18=_0x7a54[_0x35ae83];return _0x5aaf18;};'use strict';var multer=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var path=require(_0x47a5('0x2'));var timeout=require('connect-timeout');var express=require(_0x47a5('0x3'));var router=express[_0x47a5('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x47a5('0x5'));var interaction=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var controller=require(_0x47a5('0x8'));router[_0x47a5('0x9')]('/',auth['isAuthenticated'](),controller[_0x47a5('0xa')]);router['get'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['describe']);router[_0x47a5('0x9')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x47a5('0x9')](_0x47a5('0xd'),auth['isAuthenticated'](),controller[_0x47a5('0xe')]);router['get']('/:id/canned_answers',auth[_0x47a5('0xc')](),controller[_0x47a5('0xf')]);router[_0x47a5('0x9')](_0x47a5('0x10'),auth[_0x47a5('0xc')](),controller[_0x47a5('0x11')]);router[_0x47a5('0x9')]('/:id/interactions',auth[_0x47a5('0xc')](),controller[_0x47a5('0x12')]);router[_0x47a5('0x9')](_0x47a5('0x13'),controller[_0x47a5('0x14')]);router[_0x47a5('0x9')](_0x47a5('0x15'),auth[_0x47a5('0xc')](),controller['getAgents']);router[_0x47a5('0x16')]('/',auth[_0x47a5('0xc')](),controller[_0x47a5('0x17')]);router[_0x47a5('0x16')](_0x47a5('0xd'),auth['isAuthenticated'](),controller['addDisposition']);router[_0x47a5('0x16')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0x47a5('0x18')]);router[_0x47a5('0x16')](_0x47a5('0x19'),controller[_0x47a5('0x1a')]);router[_0x47a5('0x16')](_0x47a5('0x10'),auth[_0x47a5('0xc')](),controller[_0x47a5('0x1b')]);router[_0x47a5('0x16')]('/:id/send',auth[_0x47a5('0xc')](),controller[_0x47a5('0x1c')]);router['post'](_0x47a5('0x13'),controller[_0x47a5('0x1d')]);router[_0x47a5('0x16')]('/:id/users',auth[_0x47a5('0xc')](),controller[_0x47a5('0x1e')]);router[_0x47a5('0x1f')](_0x47a5('0x20'),auth['isAuthenticated'](),controller[_0x47a5('0x21')]);router[_0x47a5('0x22')]('/:id',auth[_0x47a5('0xc')](),controller[_0x47a5('0x23')]);router[_0x47a5('0x22')](_0x47a5('0xd'),auth[_0x47a5('0xc')](),controller['removeDispositions']);router['delete'](_0x47a5('0x24'),auth['isAuthenticated'](),controller[_0x47a5('0x25')]);router['delete'](_0x47a5('0x15'),auth[_0x47a5('0xc')](),controller[_0x47a5('0x26')]);module[_0x47a5('0x27')]=router; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.attributes.js b/server/api/smsAccount/smsAccount.attributes.js index f9833aa..be99306 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 _0x6715=['twilio','connectel','clicksend','plivo','clickatell','bandwidth','csc','intelepeer','ENUM','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDisposition','sequelize','randomstring','STRING','name','generate'];(function(_0x3f560e,_0x289aa8){var _0x5bf213=function(_0xcc2f71){while(--_0xcc2f71){_0x3f560e['push'](_0x3f560e['shift']());}};_0x5bf213(++_0x289aa8);}(_0x6715,0x121));var _0x5671=function(_0x2a37b6,_0x334335){_0x2a37b6=_0x2a37b6-0x0;var _0x48d994=_0x6715[_0x2a37b6];return _0x48d994;};'use strict';var Sequelize=require(_0x5671('0x0'));var rs=require(_0x5671('0x1'));module['exports']={'name':{'type':Sequelize[_0x5671('0x2')],'unique':_0x5671('0x3'),'allowNull':![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'remote':{'type':Sequelize['STRING'],'allowNull':![]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0x5671('0x4')]();}},'phone':{'type':Sequelize['STRING']},'type':{'type':Sequelize['ENUM'](_0x5671('0x5'),'skebby',_0x5671('0x6'),_0x5671('0x7'),_0x5671('0x8'),_0x5671('0x9'),_0x5671('0xa'),_0x5671('0xb'),'infobip',_0x5671('0xc'))},'accountSid':{'type':Sequelize['STRING']},'authId':{'type':Sequelize[_0x5671('0x2')]},'authToken':{'type':Sequelize[_0x5671('0x2')]},'smsMethod':{'type':Sequelize[_0x5671('0xd')]('SI','TI','GP')},'username':{'type':Sequelize[_0x5671('0x2')]},'password':{'type':Sequelize[_0x5671('0x2')]},'apiKey':{'type':Sequelize[_0x5671('0x2')]},'applicationId':{'type':Sequelize['STRING']},'accountId':{'type':Sequelize[_0x5671('0x2')]},'senderString':{'type':Sequelize[_0x5671('0x2')]},'deliveryReport':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'description':{'type':Sequelize[_0x5671('0x2')]},'notificationTemplate':{'type':Sequelize[_0x5671('0xe')],'defaultValue':function(){return _0x5671('0xf');}},'notificationSound':{'type':Sequelize[_0x5671('0x10')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x5671('0x10')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x5671('0x11')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0x5671('0x11')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x5671('0x10')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x5671('0x11')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x5671('0x10')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x5671('0x11')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0x5671('0x2')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x5671('0x11')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x5671('0x10')],'defaultValue':![],'comment':_0x5671('0x12'),'set':function(_0x1dcd6e){if(!_0x1dcd6e)this[_0x5671('0x13')]('mandatoryDispositionPauseId',null);this['setDataValue'](_0x5671('0x14'),_0x1dcd6e);}}}; \ No newline at end of file +var _0xb0f9=['connectel','plivo','clickatell','csc','infobip','intelepeer','BOOLEAN','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','exports','STRING','name','generate','ENUM','twilio','skebby'];(function(_0x2b5eae,_0x55010d){var _0x5f3ac9=function(_0x397bfc){while(--_0x397bfc){_0x2b5eae['push'](_0x2b5eae['shift']());}};_0x5f3ac9(++_0x55010d);}(_0xb0f9,0xe7));var _0x9b0f=function(_0x3effd3,_0x2d09de){_0x3effd3=_0x3effd3-0x0;var _0x461404=_0xb0f9[_0x3effd3];return _0x461404;};'use strict';var Sequelize=require(_0x9b0f('0x0'));var rs=require(_0x9b0f('0x1'));module[_0x9b0f('0x2')]={'name':{'type':Sequelize[_0x9b0f('0x3')],'unique':_0x9b0f('0x4'),'allowNull':![]},'key':{'type':Sequelize[_0x9b0f('0x3')],'allowNull':![]},'remote':{'type':Sequelize[_0x9b0f('0x3')],'allowNull':![]},'token':{'type':Sequelize[_0x9b0f('0x3')],'defaultValue':function(){return rs[_0x9b0f('0x5')]();}},'phone':{'type':Sequelize[_0x9b0f('0x3')]},'type':{'type':Sequelize[_0x9b0f('0x6')](_0x9b0f('0x7'),_0x9b0f('0x8'),_0x9b0f('0x9'),'clicksend',_0x9b0f('0xa'),_0x9b0f('0xb'),'bandwidth',_0x9b0f('0xc'),_0x9b0f('0xd'),_0x9b0f('0xe'))},'accountSid':{'type':Sequelize[_0x9b0f('0x3')]},'authId':{'type':Sequelize[_0x9b0f('0x3')]},'authToken':{'type':Sequelize[_0x9b0f('0x3')]},'smsMethod':{'type':Sequelize['ENUM']('SI','TI','GP')},'username':{'type':Sequelize[_0x9b0f('0x3')]},'password':{'type':Sequelize['STRING']},'apiKey':{'type':Sequelize[_0x9b0f('0x3')]},'applicationId':{'type':Sequelize['STRING']},'accountId':{'type':Sequelize[_0x9b0f('0x3')]},'senderString':{'type':Sequelize[_0x9b0f('0x3')]},'deliveryReport':{'type':Sequelize[_0x9b0f('0xf')],'defaultValue':![]},'description':{'type':Sequelize[_0x9b0f('0x3')]},'notificationTemplate':{'type':Sequelize[_0x9b0f('0x10')],'defaultValue':function(){return _0x9b0f('0x11');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x9b0f('0x12')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0x9b0f('0x12')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x9b0f('0xf')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x9b0f('0x12')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x9b0f('0xf')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x9b0f('0x12')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize['STRING']},'mandatoryDispositionPauseId':{'type':Sequelize[_0x9b0f('0x12')],'comment':_0x9b0f('0x13')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x9b0f('0x14'),'set':function(_0x4df44f){if(!_0x4df44f)this[_0x9b0f('0x15')](_0x9b0f('0x16'),null);this[_0x9b0f('0x15')](_0x9b0f('0x17'),_0x4df44f);}}}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.controller.js b/server/api/smsAccount/smsAccount.controller.js index 1cec56a..99457db 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 _0x97cf=['order','SmsAccountId','include','findAll','removeDispositions','addAnswer','getAnswers','CannedAnswer','removeAnswers','ids','notify','sms','SmsApplication','Applications','applications','orderBy','priority','asc','account','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','mobile','twilio','from','From','Body','messageId','MessageSid','skebby','sender','text','connectel','clicksend','message_id','plivo','Text','MessageUUID','infobip','results','csc','originatingAddress','segmentedMessage','clickatell','fromNumber','replyMessageId','bandwidth','refid','isNil','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','ListId','Contacts','list','contact','SmsInteraction','interaction','created','autoclose','push','close','unmanaged','*,*,*,*','SmsMessage','ContactId','UserId','unshift','agent','waitForTheAssignedAgent','queueId','SmsQueue','queue','waitForTheAssignedQueue','receiveMessage','entity\x20found','debug','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','stringify','Content-Type','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','bulkCreate','findAndCountAll','finally','getApplications','getInteractions','nolimit','Contact','User','internal','Tags','tag','List','DESC','out','Messages','dataValues','skebby_dispatch_id','requestid','statusInt','status_code','groupName','DELIVERED','redif','inspect','error_code','message-delivered','intelepeer','ACCEPTD','statusGet','received\x20delivery\x20report\x20from','state','message-id','addAgents','spread','emit','userSmsAccount:save','removeAgents','isArray','userSmsAccount:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./smsAccount.socket','register','client','request','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','SmsAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','status','end','offset','undefined','limit','count','set','Content-Range','json','reject','save','update','get','SmsAccounts','UserProfileResource','sendStatus','stack','name','send','index','Pause','mandatoryDispositionPause','map','type','model','query','filters','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','options','includeAll','SmsAccount','rows','params','keys','rawAttributes','intersection','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','destroy','describe','Disposition','findOne'];(function(_0x21eaa3,_0x518246){var _0x5c740a=function(_0x3fb345){while(--_0x3fb345){_0x21eaa3['push'](_0x21eaa3['shift']());}};_0x5c740a(++_0x518246);}(_0x97cf,0x173));var _0xf97c=function(_0xfe2120,_0x57e7e1){_0xfe2120=_0xfe2120-0x0;var _0x41c0ad=_0x97cf[_0xfe2120];return _0x41c0ad;};'use strict';var emlformat=require(_0xf97c('0x0'));var rimraf=require(_0xf97c('0x1'));var zipdir=require(_0xf97c('0x2'));var jsonpatch=require(_0xf97c('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xf97c('0x4'));var Mustache=require(_0xf97c('0x5'));var util=require(_0xf97c('0x6'));var path=require(_0xf97c('0x7'));var sox=require(_0xf97c('0x8'));var csv=require(_0xf97c('0x9'));var ejs=require(_0xf97c('0xa'));var fs=require('fs');var fs_extra=require(_0xf97c('0xb'));var _=require(_0xf97c('0xc'));var squel=require(_0xf97c('0xd'));var crypto=require(_0xf97c('0xe'));var jsforce=require(_0xf97c('0xf'));var deskjs=require(_0xf97c('0x10'));var toCsv=require(_0xf97c('0x9'));var querystring=require('querystring');var Papa=require(_0xf97c('0x11'));var Redis=require(_0xf97c('0x12'));var authService=require(_0xf97c('0x13'));var qs=require(_0xf97c('0x14'));var as=require(_0xf97c('0x15'));var hardwareService=require(_0xf97c('0x16'));var logger=require('../../config/logger')('api');var utils=require(_0xf97c('0x17'));var config=require(_0xf97c('0x18'));var licenseUtil=require(_0xf97c('0x19'));var db=require(_0xf97c('0x1a'))['db'];config['redis']=_[_0xf97c('0x1b')](config[_0xf97c('0x1c')],{'host':_0xf97c('0x1d'),'port':0x18eb});var socket=require(_0xf97c('0x1e'))(new Redis(config[_0xf97c('0x1c')]));require(_0xf97c('0x1f'))[_0xf97c('0x20')](socket);var jayson=require('jayson/promise');var client=jayson[_0xf97c('0x21')]['http']({'port':0x232c});function respondWithRpcPromise(_0x413211,_0x3e22b1,_0x258234,_0x4cb32c){return new BPromise(function(_0x11daba,_0x1c3ad8){var _0x453109=_0x4cb32c||client;return _0x453109[_0xf97c('0x22')](_0x413211,_0x258234)[_0xf97c('0x23')](function(_0x105c33){logger[_0xf97c('0x24')](_0xf97c('0x25'),_0x3e22b1,_0xf97c('0x26'));logger['debug'](_0xf97c('0x27'),_0x3e22b1,'request\x20sent',JSON['stringify'](_0x105c33));if(_0x105c33[_0xf97c('0x28')]){if(_0x105c33[_0xf97c('0x28')][_0xf97c('0x29')]===0x1f4){logger[_0xf97c('0x28')](_0xf97c('0x25'),_0x3e22b1,_0x105c33['error']['message']);return _0x1c3ad8(_0x105c33[_0xf97c('0x28')][_0xf97c('0x2a')]);}logger[_0xf97c('0x28')](_0xf97c('0x25'),_0x3e22b1,_0x105c33[_0xf97c('0x28')][_0xf97c('0x2a')]);return _0x11daba(_0x105c33['error'][_0xf97c('0x2a')]);}else{logger['info']('SmsAccount,\x20%s,\x20%s',_0x3e22b1,_0xf97c('0x26'));_0x11daba(_0x105c33[_0xf97c('0x2b')][_0xf97c('0x2a')]);}})[_0xf97c('0x2c')](function(_0x3472cc){logger[_0xf97c('0x28')](_0xf97c('0x25'),_0x3e22b1,_0x3472cc);_0x1c3ad8(_0x3472cc);});});}function respondWithStatusCode(_0x379a3c,_0x27371b){_0x27371b=_0x27371b||0xcc;return function(_0x2818d9){if(_0x2818d9){return _0x379a3c['sendStatus'](_0x27371b);}return _0x379a3c[_0xf97c('0x2d')](_0x27371b)[_0xf97c('0x2e')]();};}function respondWithResult(_0x2ddd3f,_0x7bfd2a){_0x7bfd2a=_0x7bfd2a||0xc8;return function(_0x4de432){if(_0x4de432){return _0x2ddd3f[_0xf97c('0x2d')](_0x7bfd2a)['json'](_0x4de432);}};}function respondWithFilteredResult(_0x3962a2,_0x3f2c2b){return function(_0x37158e){if(_0x37158e){var _0x11a0be=typeof _0x3f2c2b[_0xf97c('0x2f')]===_0xf97c('0x30')&&typeof _0x3f2c2b[_0xf97c('0x31')]===_0xf97c('0x30');var _0x2a7d1d=_0x37158e[_0xf97c('0x32')];var _0x266966=_0x11a0be?0x0:_0x3f2c2b[_0xf97c('0x2f')];var _0xe1f3bf=_0x11a0be?_0x37158e[_0xf97c('0x32')]:_0x3f2c2b[_0xf97c('0x2f')]+_0x3f2c2b[_0xf97c('0x31')];var _0x3954ac;if(_0xe1f3bf>=_0x2a7d1d){_0xe1f3bf=_0x2a7d1d;_0x3954ac=0xc8;}else{_0x3954ac=0xce;}_0x3962a2[_0xf97c('0x2d')](_0x3954ac);return _0x3962a2[_0xf97c('0x33')](_0xf97c('0x34'),_0x266966+'-'+_0xe1f3bf+'/'+_0x2a7d1d)[_0xf97c('0x35')](_0x37158e);}return null;};}function patchUpdates(_0x20f6a1){return function(_0xaa428f){try{jsonpatch['apply'](_0xaa428f,_0x20f6a1,!![]);}catch(_0x1c2efc){return BPromise[_0xf97c('0x36')](_0x1c2efc);}return _0xaa428f[_0xf97c('0x37')]();};}function saveUpdates(_0x54b2d2,_0x302d10){return function(_0x39a858){if(_0x39a858){return _0x39a858[_0xf97c('0x38')](_0x54b2d2)['then'](function(_0x57f263){return _0x57f263;});}return null;};}function removeEntity(_0x18020f,_0x92cd01){return function(_0x2bef85){if(_0x2bef85){return _0x2bef85['destroy']()[_0xf97c('0x23')](function(){var _0x5a8c64=_0x2bef85[_0xf97c('0x39')]({'plain':!![]});var _0x4aaebe=_0xf97c('0x3a');return db[_0xf97c('0x3b')]['destroy']({'where':{'type':_0x4aaebe,'resourceId':_0x5a8c64['id']}})[_0xf97c('0x23')](function(){return _0x2bef85;});})[_0xf97c('0x23')](function(){_0x18020f[_0xf97c('0x2d')](0xcc)[_0xf97c('0x2e')]();});}};}function handleEntityNotFound(_0x48a37b,_0xc03a35){return function(_0x4f1d9d){if(!_0x4f1d9d){_0x48a37b[_0xf97c('0x3c')](0x194);}return _0x4f1d9d;};}function handleError(_0x232999,_0x59771a){_0x59771a=_0x59771a||0x1f4;return function(_0x4c9267){logger['error'](_0x4c9267[_0xf97c('0x3d')]);if(_0x4c9267[_0xf97c('0x3e')]){delete _0x4c9267[_0xf97c('0x3e')];}_0x232999[_0xf97c('0x2d')](_0x59771a)[_0xf97c('0x3f')](_0x4c9267);};}exports[_0xf97c('0x40')]=function(_0xc59b72,_0x12476f){var _0x186c49={'include':[{'model':db[_0xf97c('0x41')],'as':_0xf97c('0x42')}]},_0x11ca61={},_0x4e48c0={'count':0x0,'rows':[]};var _0x4d789c=_[_0xf97c('0x43')](db['SmsAccount']['rawAttributes'],function(_0x581a8f){return{'name':_0x581a8f['fieldName'],'type':_0x581a8f[_0xf97c('0x44')]['key']};});_0x11ca61[_0xf97c('0x45')]=_[_0xf97c('0x43')](_0x4d789c,_0xf97c('0x3e'));_0x11ca61[_0xf97c('0x46')]=_['keys'](_0xc59b72['query']);_0x11ca61[_0xf97c('0x47')]=_['intersection'](_0x11ca61[_0xf97c('0x45')],_0x11ca61[_0xf97c('0x46')]);_0x186c49[_0xf97c('0x48')]=_['intersection'](_0x11ca61['model'],qs['fields'](_0xc59b72[_0xf97c('0x46')][_0xf97c('0x49')]));_0x186c49[_0xf97c('0x48')]=_0x186c49[_0xf97c('0x48')][_0xf97c('0x4a')]?_0x186c49[_0xf97c('0x48')]:_0x11ca61[_0xf97c('0x45')];if(!_0xc59b72['query'][_0xf97c('0x4b')]('nolimit')){_0x186c49[_0xf97c('0x31')]=qs['limit'](_0xc59b72[_0xf97c('0x46')][_0xf97c('0x31')]);_0x186c49[_0xf97c('0x2f')]=qs['offset'](_0xc59b72['query'][_0xf97c('0x2f')]);}_0x186c49['order']=qs[_0xf97c('0x4c')](_0xc59b72['query'][_0xf97c('0x4c')]);_0x186c49[_0xf97c('0x4d')]=qs[_0xf97c('0x47')](_[_0xf97c('0x4e')](_0xc59b72[_0xf97c('0x46')],_0x11ca61[_0xf97c('0x47')]),_0x4d789c);if(_0xc59b72[_0xf97c('0x46')][_0xf97c('0x4f')]){_0x186c49['where']=_['merge'](_0x186c49[_0xf97c('0x4d')],{'$or':_[_0xf97c('0x43')](_0x4d789c,function(_0x2c02db){if(_0x2c02db[_0xf97c('0x44')]!=='VIRTUAL'){var _0x3b99c1={};_0x3b99c1[_0x2c02db['name']]={'$like':'%'+_0xc59b72[_0xf97c('0x46')]['filter']+'%'};return _0x3b99c1;}})});}_0x186c49=_[_0xf97c('0x50')]({},_0x186c49,_0xc59b72[_0xf97c('0x51')]);var _0x51ca97={'where':_0x186c49[_0xf97c('0x4d')]};return db['SmsAccount']['count'](_0x51ca97)[_0xf97c('0x23')](function(_0x149ac9){_0x4e48c0[_0xf97c('0x32')]=_0x149ac9;if(_0xc59b72[_0xf97c('0x46')][_0xf97c('0x52')]){_0x186c49['include']=[{'all':!![]}];}return db[_0xf97c('0x53')]['findAll'](_0x186c49);})[_0xf97c('0x23')](function(_0x1e8752){_0x4e48c0[_0xf97c('0x54')]=_0x1e8752;return _0x4e48c0;})['then'](respondWithFilteredResult(_0x12476f,_0x186c49))[_0xf97c('0x2c')](handleError(_0x12476f,null));};exports['show']=function(_0x5ae96e,_0x119d49){var _0x2975d3={'raw':![],'where':{'id':_0x5ae96e[_0xf97c('0x55')]['id']},'include':[{'model':db[_0xf97c('0x41')],'as':_0xf97c('0x42')}]},_0x8e0a2b={};_0x8e0a2b[_0xf97c('0x45')]=_[_0xf97c('0x56')](db['SmsAccount'][_0xf97c('0x57')]);_0x8e0a2b[_0xf97c('0x46')]=_['keys'](_0x5ae96e[_0xf97c('0x46')]);_0x8e0a2b[_0xf97c('0x47')]=_[_0xf97c('0x58')](_0x8e0a2b[_0xf97c('0x45')],_0x8e0a2b[_0xf97c('0x46')]);_0x2975d3[_0xf97c('0x48')]=_[_0xf97c('0x58')](_0x8e0a2b[_0xf97c('0x45')],qs[_0xf97c('0x49')](_0x5ae96e[_0xf97c('0x46')][_0xf97c('0x49')]));_0x2975d3[_0xf97c('0x48')]=_0x2975d3[_0xf97c('0x48')][_0xf97c('0x4a')]?_0x2975d3[_0xf97c('0x48')]:_0x8e0a2b[_0xf97c('0x45')];if(_0x5ae96e['query'][_0xf97c('0x52')]){_0x2975d3['include']=[{'all':!![]}];}_0x2975d3=_[_0xf97c('0x50')]({},_0x2975d3,_0x5ae96e[_0xf97c('0x51')]);return db[_0xf97c('0x53')]['find'](_0x2975d3)[_0xf97c('0x23')](handleEntityNotFound(_0x119d49,null))[_0xf97c('0x23')](respondWithResult(_0x119d49,null))[_0xf97c('0x2c')](handleError(_0x119d49,null));};exports[_0xf97c('0x59')]=function(_0x47f429,_0x40d132){return db[_0xf97c('0x53')][_0xf97c('0x59')](_0x47f429[_0xf97c('0x5a')],{})[_0xf97c('0x23')](function(_0x1f37e0){var _0x3681f2=_0x47f429[_0xf97c('0x5b')][_0xf97c('0x39')]({'plain':!![]});if(!_0x3681f2)throw new Error(_0xf97c('0x5c'));if(_0x3681f2[_0xf97c('0x5d')]===_0xf97c('0x5b')){var _0x36e869=_0x1f37e0[_0xf97c('0x39')]({'plain':!![]});var _0x30a410='SmsAccounts';return db[_0xf97c('0x5e')]['find']({'where':{'name':_0x30a410,'userProfileId':_0x3681f2[_0xf97c('0x5f')]},'raw':!![]})[_0xf97c('0x23')](function(_0x2026cc){if(_0x2026cc&&_0x2026cc[_0xf97c('0x60')]===0x0){return db['UserProfileResource']['create']({'name':_0x36e869[_0xf97c('0x3e')],'resourceId':_0x36e869['id'],'type':_0x2026cc[_0xf97c('0x3e')],'sectionId':_0x2026cc['id']},{})['then'](function(){return _0x1f37e0;});}else{return _0x1f37e0;}})[_0xf97c('0x2c')](function(_0x4d1738){logger[_0xf97c('0x28')](_0xf97c('0x61'),_0x4d1738);throw _0x4d1738;});}return _0x1f37e0;})[_0xf97c('0x23')](respondWithResult(_0x40d132,0xc9))[_0xf97c('0x2c')](handleError(_0x40d132,null));};exports[_0xf97c('0x38')]=function(_0xbfe7b8,_0x2e1ba5){if(_0xbfe7b8[_0xf97c('0x5a')]['id']){delete _0xbfe7b8[_0xf97c('0x5a')]['id'];}return db['SmsAccount'][_0xf97c('0x62')]({'where':{'id':_0xbfe7b8[_0xf97c('0x55')]['id']},'include':[{'model':db[_0xf97c('0x41')],'as':_0xf97c('0x42')}]})[_0xf97c('0x23')](handleEntityNotFound(_0x2e1ba5,null))['then'](saveUpdates(_0xbfe7b8[_0xf97c('0x5a')],null))[_0xf97c('0x23')](respondWithResult(_0x2e1ba5,null))['catch'](handleError(_0x2e1ba5,null));};exports[_0xf97c('0x63')]=function(_0x43c09e,_0x22417d){return db[_0xf97c('0x53')][_0xf97c('0x62')]({'where':{'id':_0x43c09e[_0xf97c('0x55')]['id']}})['then'](handleEntityNotFound(_0x22417d,null))['then'](removeEntity(_0x22417d,null))['catch'](handleError(_0x22417d,null));};exports[_0xf97c('0x64')]=function(_0x1eba8a,_0x23b55e){return db[_0xf97c('0x53')][_0xf97c('0x64')]()['then'](respondWithResult(_0x23b55e,null))[_0xf97c('0x2c')](handleError(_0x23b55e,null));};exports['addDisposition']=function(_0x1fa7d5,_0x37ebf5,_0x2a78c6){if(_0x1fa7d5[_0xf97c('0x5a')]['id']){delete _0x1fa7d5[_0xf97c('0x5a')]['id'];}return db['SmsAccount'][_0xf97c('0x62')]({'where':{'id':_0x1fa7d5[_0xf97c('0x55')]['id']}})[_0xf97c('0x23')](handleEntityNotFound(_0x37ebf5,null))[_0xf97c('0x23')](function(_0x4ee4b2){if(_0x4ee4b2){_0x1fa7d5[_0xf97c('0x5a')]['SmsAccountId']=_0x4ee4b2['id'];return db[_0xf97c('0x65')][_0xf97c('0x59')](_0x1fa7d5[_0xf97c('0x5a')]);}})[_0xf97c('0x23')](respondWithResult(_0x37ebf5,null))[_0xf97c('0x2c')](handleError(_0x37ebf5,null));};exports['getDispositions']=function(_0x3f8fe9,_0x31691a,_0x3caeac){var _0x1bfa24={'raw':![],'where':{}};var _0x54d430={};var _0x47a2bb={'count':0x0,'rows':[]};return db[_0xf97c('0x53')][_0xf97c('0x66')]({'where':{'id':_0x3f8fe9['params']['id']}})[_0xf97c('0x23')](handleEntityNotFound(_0x31691a,null))[_0xf97c('0x23')](function(_0x57a7c5){if(_0x57a7c5){_0x54d430[_0xf97c('0x45')]=_['keys'](db[_0xf97c('0x65')]['rawAttributes']);_0x54d430[_0xf97c('0x46')]=_[_0xf97c('0x56')](_0x3f8fe9['query']);_0x54d430[_0xf97c('0x47')]=_[_0xf97c('0x58')](_0x54d430[_0xf97c('0x45')],_0x54d430['query']);_0x1bfa24[_0xf97c('0x48')]=_[_0xf97c('0x58')](_0x54d430[_0xf97c('0x45')],qs[_0xf97c('0x49')](_0x3f8fe9[_0xf97c('0x46')][_0xf97c('0x49')]));_0x1bfa24[_0xf97c('0x48')]=_0x1bfa24[_0xf97c('0x48')][_0xf97c('0x4a')]?_0x1bfa24[_0xf97c('0x48')]:_0x54d430[_0xf97c('0x45')];if(!_0x3f8fe9['query'][_0xf97c('0x4b')]('nolimit')){_0x1bfa24['limit']=qs[_0xf97c('0x31')](_0x3f8fe9[_0xf97c('0x46')][_0xf97c('0x31')]);_0x1bfa24[_0xf97c('0x2f')]=qs[_0xf97c('0x2f')](_0x3f8fe9['query'][_0xf97c('0x2f')]);}_0x1bfa24[_0xf97c('0x67')]=qs[_0xf97c('0x4c')](_0x3f8fe9['query']['sort']);_0x1bfa24[_0xf97c('0x4d')]=qs[_0xf97c('0x47')](_[_0xf97c('0x4e')](_0x3f8fe9['query'],_0x54d430[_0xf97c('0x47')]));_0x1bfa24[_0xf97c('0x4d')][_0xf97c('0x68')]=_0x57a7c5['id'];if(_0x3f8fe9[_0xf97c('0x46')][_0xf97c('0x4f')]){_0x1bfa24['where']=_[_0xf97c('0x50')](_0x1bfa24[_0xf97c('0x4d')],{'$or':_[_0xf97c('0x43')](_0x1bfa24['attributes'],function(_0xcba510){var _0xeffff5={};_0xeffff5[_0xcba510]={'$like':'%'+_0x3f8fe9['query']['filter']+'%'};return _0xeffff5;})});}_0x1bfa24=_[_0xf97c('0x50')]({},_0x1bfa24,_0x3f8fe9['options']);return db[_0xf97c('0x65')][_0xf97c('0x32')]({'where':_0x1bfa24[_0xf97c('0x4d')]})[_0xf97c('0x23')](function(_0x4a9ba1){_0x47a2bb[_0xf97c('0x32')]=_0x4a9ba1;if(_0x3f8fe9[_0xf97c('0x46')][_0xf97c('0x52')]){_0x1bfa24[_0xf97c('0x69')]=[{'all':!![]}];}return db[_0xf97c('0x65')][_0xf97c('0x6a')](_0x1bfa24);})['then'](function(_0x307a43){_0x47a2bb[_0xf97c('0x54')]=_0x307a43;return _0x47a2bb;});}})[_0xf97c('0x23')](respondWithFilteredResult(_0x31691a,_0x1bfa24))[_0xf97c('0x2c')](handleError(_0x31691a,null));};exports[_0xf97c('0x6b')]=function(_0x113c75,_0x5b7232,_0x231b33){return db[_0xf97c('0x53')][_0xf97c('0x62')]({'where':{'id':_0x113c75['params']['id']}})[_0xf97c('0x23')](handleEntityNotFound(_0x5b7232,null))[_0xf97c('0x23')](function(_0x1ac36c){if(_0x1ac36c){return _0x1ac36c[_0xf97c('0x6b')](_0x113c75[_0xf97c('0x46')]['ids']);}})[_0xf97c('0x23')](respondWithStatusCode(_0x5b7232,null))[_0xf97c('0x2c')](handleError(_0x5b7232,null));};exports[_0xf97c('0x6c')]=function(_0x4b6152,_0x5109ae,_0x1109f9){if(_0x4b6152['body']['id']){delete _0x4b6152[_0xf97c('0x5a')]['id'];}return db[_0xf97c('0x53')]['find']({'where':{'id':_0x4b6152['params']['id']}})[_0xf97c('0x23')](handleEntityNotFound(_0x5109ae,null))[_0xf97c('0x23')](function(_0x305acd){if(_0x305acd){_0x4b6152[_0xf97c('0x5a')][_0xf97c('0x68')]=_0x305acd['id'];return db['CannedAnswer']['create'](_0x4b6152[_0xf97c('0x5a')]);}})['then'](respondWithResult(_0x5109ae,null))[_0xf97c('0x2c')](handleError(_0x5109ae,null));};exports[_0xf97c('0x6d')]=function(_0x5bf903,_0x3fea87,_0x2fcda5){var _0x4a3265={'raw':![],'where':{}};var _0x516c01={};var _0x275055={'count':0x0,'rows':[]};return db['SmsAccount'][_0xf97c('0x66')]({'where':{'id':_0x5bf903[_0xf97c('0x55')]['id']}})['then'](handleEntityNotFound(_0x3fea87,null))['then'](function(_0x91569a){if(_0x91569a){_0x516c01[_0xf97c('0x45')]=_[_0xf97c('0x56')](db[_0xf97c('0x6e')]['rawAttributes']);_0x516c01[_0xf97c('0x46')]=_['keys'](_0x5bf903[_0xf97c('0x46')]);_0x516c01[_0xf97c('0x47')]=_[_0xf97c('0x58')](_0x516c01['model'],_0x516c01[_0xf97c('0x46')]);_0x4a3265['attributes']=_[_0xf97c('0x58')](_0x516c01[_0xf97c('0x45')],qs['fields'](_0x5bf903[_0xf97c('0x46')][_0xf97c('0x49')]));_0x4a3265[_0xf97c('0x48')]=_0x4a3265['attributes'][_0xf97c('0x4a')]?_0x4a3265[_0xf97c('0x48')]:_0x516c01[_0xf97c('0x45')];if(!_0x5bf903[_0xf97c('0x46')][_0xf97c('0x4b')]('nolimit')){_0x4a3265[_0xf97c('0x31')]=qs[_0xf97c('0x31')](_0x5bf903[_0xf97c('0x46')][_0xf97c('0x31')]);_0x4a3265[_0xf97c('0x2f')]=qs['offset'](_0x5bf903[_0xf97c('0x46')][_0xf97c('0x2f')]);}_0x4a3265[_0xf97c('0x67')]=qs['sort'](_0x5bf903[_0xf97c('0x46')]['sort']);_0x4a3265[_0xf97c('0x4d')]=qs[_0xf97c('0x47')](_['pick'](_0x5bf903[_0xf97c('0x46')],_0x516c01['filters']));_0x4a3265[_0xf97c('0x4d')]['SmsAccountId']=_0x91569a['id'];if(_0x5bf903[_0xf97c('0x46')][_0xf97c('0x4f')]){_0x4a3265[_0xf97c('0x4d')]=_['merge'](_0x4a3265['where'],{'$or':_[_0xf97c('0x43')](_0x4a3265[_0xf97c('0x48')],function(_0x4e017e){var _0x5e146a={};_0x5e146a[_0x4e017e]={'$like':'%'+_0x5bf903['query'][_0xf97c('0x4f')]+'%'};return _0x5e146a;})});}_0x4a3265=_['merge']({},_0x4a3265,_0x5bf903[_0xf97c('0x51')]);return db[_0xf97c('0x6e')]['count']({'where':_0x4a3265[_0xf97c('0x4d')]})['then'](function(_0x36d0d3){_0x275055['count']=_0x36d0d3;if(_0x5bf903['query'][_0xf97c('0x52')]){_0x4a3265[_0xf97c('0x69')]=[{'all':!![]}];}return db[_0xf97c('0x6e')]['findAll'](_0x4a3265);})[_0xf97c('0x23')](function(_0x47fafb){_0x275055[_0xf97c('0x54')]=_0x47fafb;return _0x275055;});}})[_0xf97c('0x23')](respondWithFilteredResult(_0x3fea87,_0x4a3265))[_0xf97c('0x2c')](handleError(_0x3fea87,null));};exports[_0xf97c('0x6f')]=function(_0x188135,_0x1cf808,_0x133970){return db[_0xf97c('0x53')][_0xf97c('0x62')]({'where':{'id':_0x188135['params']['id']}})['then'](handleEntityNotFound(_0x1cf808,null))[_0xf97c('0x23')](function(_0x45902f){if(_0x45902f){return _0x45902f['removeAnswers'](_0x188135[_0xf97c('0x46')][_0xf97c('0x70')]);}})[_0xf97c('0x23')](respondWithStatusCode(_0x1cf808,null))[_0xf97c('0x2c')](handleError(_0x1cf808,null));};exports[_0xf97c('0x71')]=function(_0x438345,_0x5ca9a0,_0xde23f7){var _0x38e9b4={'channel':_0xf97c('0x72')};var _0x458599=[];var _0x1e6819=[];var _0x11a8e7={};return db[_0xf97c('0x53')][_0xf97c('0x62')]({'where':{'id':_0x438345['params']['id']},'include':[{'model':db[_0xf97c('0x73')],'as':_0xf97c('0x74')}]})[_0xf97c('0x23')](handleEntityNotFound(_0x5ca9a0,null))['then'](function(_0x5ece32){_0x38e9b4['account']=_0x5ece32;_0x38e9b4[_0xf97c('0x75')]=_[_0xf97c('0x76')](_0x5ece32[_0xf97c('0x74')],[_0xf97c('0x77')],[_0xf97c('0x78')]);if(_0x38e9b4['account'][_0xf97c('0x74')]){delete _0x38e9b4[_0xf97c('0x79')][_0xf97c('0x74')];}return db[_0xf97c('0x7a')][_0xf97c('0x64')]();})['then'](function(_0x1b6eae){if(!_0x1b6eae){throw new db[(_0xf97c('0x7b'))][(_0xf97c('0x7c'))](_0xf97c('0x7d'));}_0x458599=_[_0xf97c('0x7e')](_[_0xf97c('0x56')](_0x1b6eae),[_0xf97c('0x7f'),_0xf97c('0x80')]);_0x1e6819=_[_0xf97c('0x7e')](_['keys'](_0x1b6eae),[_0xf97c('0x7f'),_0xf97c('0x80'),_0xf97c('0x81'),'ListId']);_0x38e9b4[_0xf97c('0x5a')]={'mapKey':_0xf97c('0x82')};if(_0x38e9b4[_0xf97c('0x79')][_0xf97c('0x44')]){switch(_0x38e9b4[_0xf97c('0x79')][_0xf97c('0x44')]){case _0xf97c('0x83'):_0x38e9b4[_0xf97c('0x5a')][_0xf97c('0x84')]=_0x438345[_0xf97c('0x5a')][_0xf97c('0x85')];_0x38e9b4[_0xf97c('0x5a')]['body']=_0x438345[_0xf97c('0x5a')][_0xf97c('0x86')];_0x38e9b4[_0xf97c('0x5a')][_0xf97c('0x87')]=_0x438345['body'][_0xf97c('0x88')];break;case _0xf97c('0x89'):_0x38e9b4[_0xf97c('0x5a')]['from']='+'+_0x438345[_0xf97c('0x5a')][_0xf97c('0x8a')];_0x38e9b4['body'][_0xf97c('0x5a')]=_0x438345[_0xf97c('0x5a')][_0xf97c('0x8b')];break;case _0xf97c('0x8c'):_0x38e9b4['body']['from']=_0x438345[_0xf97c('0x5a')][_0xf97c('0x84')];_0x38e9b4[_0xf97c('0x5a')]['body']=_0x438345[_0xf97c('0x5a')][_0xf97c('0x2a')];break;case _0xf97c('0x8d'):_0x38e9b4[_0xf97c('0x5a')][_0xf97c('0x84')]=_0x438345[_0xf97c('0x5a')][_0xf97c('0x84')];_0x38e9b4[_0xf97c('0x5a')][_0xf97c('0x5a')]=_0x438345[_0xf97c('0x5a')][_0xf97c('0x5a')];_0x38e9b4[_0xf97c('0x5a')][_0xf97c('0x87')]=_0x438345[_0xf97c('0x5a')][_0xf97c('0x8e')];break;case _0xf97c('0x8f'):_0x38e9b4[_0xf97c('0x5a')]['from']=_0x438345[_0xf97c('0x5a')][_0xf97c('0x85')];_0x38e9b4[_0xf97c('0x5a')][_0xf97c('0x5a')]=_0x438345[_0xf97c('0x5a')][_0xf97c('0x90')];_0x38e9b4['body']['messageId']=_0x438345[_0xf97c('0x5a')][_0xf97c('0x91')];break;case _0xf97c('0x92'):_0x38e9b4[_0xf97c('0x5a')][_0xf97c('0x84')]='+'+_0x438345[_0xf97c('0x5a')][_0xf97c('0x93')][0x0][_0xf97c('0x84')];_0x38e9b4['body'][_0xf97c('0x5a')]=_0x438345[_0xf97c('0x5a')][_0xf97c('0x93')][0x0]['text'];_0x38e9b4[_0xf97c('0x5a')][_0xf97c('0x87')]=_0x438345[_0xf97c('0x5a')][_0xf97c('0x93')][0x0][_0xf97c('0x87')];break;case _0xf97c('0x94'):_0x38e9b4[_0xf97c('0x5a')][_0xf97c('0x84')]=_0x438345[_0xf97c('0x5a')][_0xf97c('0x95')];_0x38e9b4[_0xf97c('0x5a')]['body']=_0x438345[_0xf97c('0x5a')][_0xf97c('0x96')][_0xf97c('0x2a')];break;case _0xf97c('0x97'):_0x38e9b4[_0xf97c('0x5a')]['from']=_0x438345[_0xf97c('0x5a')][_0xf97c('0x98')];_0x38e9b4[_0xf97c('0x5a')]['body']=_0x438345[_0xf97c('0x5a')][_0xf97c('0x8b')];_0x38e9b4[_0xf97c('0x5a')]['messageId']=_0x438345[_0xf97c('0x5a')][_0xf97c('0x99')];break;case _0xf97c('0x9a'):_0x38e9b4[_0xf97c('0x5a')][_0xf97c('0x87')]=_0x438345[_0xf97c('0x5a')][0x0][_0xf97c('0x2a')]['id'];_0x38e9b4[_0xf97c('0x5a')][_0xf97c('0x84')]=_0x438345[_0xf97c('0x5a')][0x0]['message'][_0xf97c('0x84')];_0x38e9b4[_0xf97c('0x5a')][_0xf97c('0x5a')]=_0x438345['body'][0x0]['message'][_0xf97c('0x8b')];break;case'intelepeer':_0x38e9b4[_0xf97c('0x5a')][_0xf97c('0x84')]=_0x438345[_0xf97c('0x5a')][_0xf97c('0x84')];_0x38e9b4['body'][_0xf97c('0x5a')]=_0x438345[_0xf97c('0x5a')][_0xf97c('0x2a')];_0x38e9b4['body'][_0xf97c('0x87')]=_0x438345[_0xf97c('0x5a')][_0xf97c('0x9b')];break;}}if(_0x38e9b4['body']['id']){delete _0x38e9b4[_0xf97c('0x5a')]['id'];}if(_[_0xf97c('0x9c')](_0x38e9b4[_0xf97c('0x5a')]['from'])){throw new db[(_0xf97c('0x7b'))][(_0xf97c('0x7c'))](_0xf97c('0x9d'));}if(_['isNil'](_0x38e9b4['body'][_0xf97c('0x5a')])||_0x38e9b4[_0xf97c('0x5a')][_0xf97c('0x5a')]===''){throw new db[(_0xf97c('0x7b'))]['ValidationError'](_0xf97c('0x9e'));}if(_[_0xf97c('0x9c')](_0x38e9b4['body']['mapKey'])){throw new db['Sequelize'][(_0xf97c('0x7c'))](_0xf97c('0x9f')+_0x1e6819);}if(!_['includes'](_0x1e6819,_0x38e9b4['body'][_0xf97c('0xa0')])){throw new db['Sequelize']['ValidationError'](_0xf97c('0xa1')+_0x1e6819);}_0x11a8e7[_0x38e9b4[_0xf97c('0x5a')][_0xf97c('0xa0')]]=_0x38e9b4[_0xf97c('0x5a')][_0xf97c('0x84')];return db[_0xf97c('0xa2')][_0xf97c('0x62')]({'where':{'id':_0x38e9b4[_0xf97c('0x79')][_0xf97c('0xa3')]},'include':[{'model':db[_0xf97c('0x7a')],'as':_0xf97c('0xa4'),'where':_0x11a8e7,'limit':0x1,'order':[[_0xf97c('0x80'),'DESC']]}]});})[_0xf97c('0x23')](handleEntityNotFound(_0x5ca9a0,null))['then'](function(_0x20ea53){if(_0x20ea53){_0x38e9b4[_0xf97c('0xa5')]=_['omit'](_0x20ea53,[_0xf97c('0xa4')]);if(_0x20ea53[_0xf97c('0xa4')]['length']){return _0x20ea53[_0xf97c('0xa4')][0x0];}var _0x148408=_[_0xf97c('0x1b')](_0x38e9b4[_0xf97c('0x5a')],{'firstName':_0x38e9b4[_0xf97c('0x5a')][_0xf97c('0x84')],'ListId':_0x20ea53['id']});_0x148408[_0x38e9b4[_0xf97c('0x5a')]['mapKey']]=_0x38e9b4['body']['from'];return db[_0xf97c('0x7a')][_0xf97c('0x59')](_0x148408,{'fields':_0x458599,'raw':!![]});}})[_0xf97c('0x23')](handleEntityNotFound(_0x5ca9a0,null))[_0xf97c('0x23')](function(_0x3fd98d){if(_0x3fd98d){_0x38e9b4[_0xf97c('0xa6')]=_0x3fd98d;var _0x3744dd={'ContactId':_0x3fd98d['id'],'phone':_0x38e9b4[_0xf97c('0x5a')][_0xf97c('0x84')],'SmsAccountId':_0x438345[_0xf97c('0x55')]['id']};var _0x5e3297={'ContactId':_0x3fd98d['id'],'SmsAccountId':_0x438345[_0xf97c('0x55')]['id'],'closed':![]};return db[_0xf97c('0xa7')][_0xf97c('0x62')]({'where':_0x5e3297})[_0xf97c('0x23')](function(_0xfbb974){if(_0xfbb974){return[_0xfbb974,![]];}return db[_0xf97c('0xa7')][_0xf97c('0x59')](_0x3744dd)[_0xf97c('0x23')](function(_0xe32f1f){return[_0xe32f1f,!![]];});});}})['spread'](function(_0x2aadda,_0x3cdae3){_0x38e9b4[_0xf97c('0xa8')]=_0x2aadda[_0xf97c('0x39')]({'plain':!![]});_0x38e9b4[_0xf97c('0xa8')][_0xf97c('0xa9')]=![];if(_0x3cdae3){if(_0x38e9b4[_0xf97c('0x79')][_0xf97c('0xaa')]){_0x38e9b4[_0xf97c('0x75')][_0xf97c('0xab')]({'id':0x0,'priority':_0x38e9b4[_0xf97c('0x75')][_0xf97c('0x4a')]+0x1,'app':_0xf97c('0xac'),'appdata':_0xf97c('0xad'),'interval':_0xf97c('0xae')});}_0x38e9b4[_0xf97c('0xa8')][_0xf97c('0xa9')]=!![];}return db[_0xf97c('0xaf')][_0xf97c('0x59')]({'phone':_0x38e9b4['body'][_0xf97c('0x84')],'messageId':_0x38e9b4[_0xf97c('0x5a')][_0xf97c('0x87')],'body':_0x38e9b4[_0xf97c('0x5a')][_0xf97c('0x5a')],'SmsAccountId':_0x438345['params']['id'],'SmsInteractionId':_0x2aadda['id'],'direction':'in','ContactId':_0x2aadda[_0xf97c('0xb0')],'AttachmentId':_0x38e9b4[_0xf97c('0x5a')]['AttachmentId']});})['then'](function(_0x2bff6d){_0x38e9b4[_0xf97c('0x2a')]=_0x2bff6d;if(!_0x38e9b4[_0xf97c('0xa8')][_0xf97c('0xb1')])return;return db['User'][_0xf97c('0x62')]({'attributes':['id',_0xf97c('0x3e')],'where':{'id':_0x38e9b4[_0xf97c('0xa8')][_0xf97c('0xb1')]}});})[_0xf97c('0x23')](function(_0x49c379){if(_0x49c379){_0x38e9b4['applications'][_0xf97c('0xb2')]({'id':0x0,'priority':0x0,'app':_0xf97c('0xb3'),'appdata':_0x49c379['name']+','+(_0x38e9b4[_0xf97c('0x79')][_0xf97c('0xb4')]||0xa),'interval':_0xf97c('0xae')});}if(!_0x38e9b4[_0xf97c('0xa8')][_0xf97c('0xb5')])return;return db[_0xf97c('0xb6')]['find']({'attributes':['id','name'],'where':{'id':_0x38e9b4['interaction'][_0xf97c('0xb5')]}});})[_0xf97c('0x23')](function(_0x2de490){if(_0x2de490){_0x38e9b4[_0xf97c('0x75')][_0xf97c('0xb2')]({'id':0x0,'priority':0x1,'app':_0xf97c('0xb7'),'appdata':_0x2de490[_0xf97c('0x3e')]+','+(_0x38e9b4['account'][_0xf97c('0xb8')]||0x12c),'interval':_0xf97c('0xae')});}return respondWithRpcPromise('Start','startRouting',_0x38e9b4);})[_0xf97c('0x23')](function(_0x2926ac){if(_0x2926ac){var _0x1ff831=0xc8;var _0x3e2522=_0xf97c('0xb9');logger[_0xf97c('0x24')](_0xf97c('0x27'),_0x3e2522,_0x1ff831,_0xf97c('0xba'));logger[_0xf97c('0xbb')](_0xf97c('0xbc'),_0x3e2522,_0x1ff831,_0xf97c('0xba'),JSON[_0xf97c('0xbd')](_0x2926ac));if(_0x38e9b4[_0xf97c('0x79')]['type']===_0xf97c('0x83')){return _0x5ca9a0['status'](_0x1ff831)[_0xf97c('0x33')](_0xf97c('0xbe'),'text/xml')[_0xf97c('0x3f')]('\x0a');}else{return _0x5ca9a0['status'](_0x1ff831)['json'](_0x2926ac);}}})[_0xf97c('0x2c')](handleError(_0x5ca9a0,null));};exports[_0xf97c('0xbf')]=function(_0x672b14,_0x178a8f){var _0x80e4e4=_0x672b14[_0xf97c('0x55')]['id'];var _0x5f05f7=_0x672b14[_0xf97c('0x5a')];var _0x4a5e08=0xc8;var _0x31e2c4=null;return db[_0xf97c('0xc0')][_0xf97c('0xc1')]({'isolationLevel':db[_0xf97c('0xc0')][_0xf97c('0xc2')][_0xf97c('0xc3')][_0xf97c('0xc4')]},function(_0x4fa910){return db[_0xf97c('0x53')]['findOne']({'where':{'id':_0x80e4e4},'transaction':_0x4fa910})[_0xf97c('0x23')](function(_0x1110dd){if(_0x1110dd){return db[_0xf97c('0x73')]['destroy']({'where':{'SmsAccountId':_0x80e4e4},'transaction':_0x4fa910})[_0xf97c('0x23')](function(){var _0x46864c=_[_0xf97c('0x43')](_0x5f05f7,function(_0x5f59bb){_0x5f59bb[_0xf97c('0x68')]=_0x80e4e4;return _0x5f59bb;});return db[_0xf97c('0x73')][_0xf97c('0xc5')](_0x46864c,{'transaction':_0x4fa910});});}else{_0x4a5e08=0x194;_0x31e2c4=[];}});})['then'](function(){if(_0x4a5e08!==0x194){return db['SmsApplication'][_0xf97c('0xc6')]({'where':{'SmsAccountId':_0x80e4e4},'order':_0xf97c('0x77')})['then'](function(_0x4de450){_0x31e2c4=_0x4de450;});}})[_0xf97c('0x2c')](function(_0x34d823){_0x4a5e08=0x1f4;logger[_0xf97c('0x28')](_0x34d823[_0xf97c('0x3d')]);if(_0x34d823['name']){delete _0x34d823[_0xf97c('0x3e')];}_0x31e2c4=_0x34d823;})[_0xf97c('0xc7')](function(){if(_0x31e2c4===null){_0x178a8f[_0xf97c('0x3c')](_0x4a5e08);}else{if(_0x4a5e08===0x1f4){_0x178a8f['status'](_0x4a5e08)[_0xf97c('0x3f')](_0x31e2c4);}else{_0x178a8f['status'](_0x4a5e08)[_0xf97c('0x35')](_0x31e2c4);}}});};exports[_0xf97c('0xc8')]=function(_0x497544,_0x97c9b2,_0x347e2e){var _0x3ee01d={};var _0x471bb9={};var _0x25ed07;var _0x434975;return db[_0xf97c('0x53')][_0xf97c('0x66')]({'where':{'id':_0x497544[_0xf97c('0x55')]['id']}})['then'](handleEntityNotFound(_0x97c9b2,null))['then'](function(_0x23a62e){if(_0x23a62e){_0x25ed07=_0x23a62e;_0x471bb9['model']=_[_0xf97c('0x56')](db[_0xf97c('0x73')][_0xf97c('0x57')]);_0x471bb9[_0xf97c('0x46')]=_[_0xf97c('0x56')](_0x497544[_0xf97c('0x46')]);_0x471bb9['filters']=_[_0xf97c('0x58')](_0x471bb9['model'],_0x471bb9['query']);_0x3ee01d['attributes']=_[_0xf97c('0x58')](_0x471bb9[_0xf97c('0x45')],qs[_0xf97c('0x49')](_0x497544[_0xf97c('0x46')][_0xf97c('0x49')]));_0x3ee01d[_0xf97c('0x48')]=_0x3ee01d[_0xf97c('0x48')]['length']?_0x3ee01d[_0xf97c('0x48')]:_0x471bb9['model'];_0x3ee01d[_0xf97c('0x67')]=qs[_0xf97c('0x4c')](_0x497544[_0xf97c('0x46')]['sort']);_0x3ee01d[_0xf97c('0x4d')]=qs[_0xf97c('0x47')](_[_0xf97c('0x4e')](_0x497544[_0xf97c('0x46')],_0x471bb9[_0xf97c('0x47')]));if(_0x497544[_0xf97c('0x46')][_0xf97c('0x4f')]){_0x3ee01d[_0xf97c('0x4d')]=_['merge'](_0x3ee01d[_0xf97c('0x4d')],{'$or':_['map'](_0x3ee01d['attributes'],function(_0x3716ef){var _0x203ca0={};_0x203ca0[_0x3716ef]={'$like':'%'+_0x497544[_0xf97c('0x46')][_0xf97c('0x4f')]+'%'};return _0x203ca0;})});}_0x3ee01d=_[_0xf97c('0x50')]({},_0x3ee01d,_0x497544[_0xf97c('0x51')]);return _0x25ed07[_0xf97c('0xc8')](_0x3ee01d);}})['then'](function(_0x54f1a3){if(_0x54f1a3){_0x434975=_0x54f1a3[_0xf97c('0x4a')];if(!_0x497544[_0xf97c('0x46')][_0xf97c('0x4b')]('nolimit')){_0x3ee01d['limit']=qs[_0xf97c('0x31')](_0x497544[_0xf97c('0x46')][_0xf97c('0x31')]);_0x3ee01d['offset']=qs[_0xf97c('0x2f')](_0x497544['query']['offset']);}return _0x25ed07[_0xf97c('0xc8')](_0x3ee01d);}})[_0xf97c('0x23')](function(_0x1197d2){if(_0x1197d2){return _0x1197d2?{'count':_0x434975,'rows':_0x1197d2}:null;}})['then'](respondWithResult(_0x97c9b2,null))[_0xf97c('0x2c')](handleError(_0x97c9b2,null));};exports[_0xf97c('0xc9')]=function(_0x273d4c,_0x55da88,_0x54c38d){var _0x1f1c99={'raw':![],'where':{}};var _0x282226={};var _0x4a87cf={'count':0x0,'rows':[]};return db['SmsAccount'][_0xf97c('0x66')]({'where':{'id':_0x273d4c[_0xf97c('0x55')]['id']}})[_0xf97c('0x23')](handleEntityNotFound(_0x55da88,null))[_0xf97c('0x23')](function(_0x451a27){if(_0x451a27){_0x282226[_0xf97c('0x45')]=_[_0xf97c('0x56')](db[_0xf97c('0xa7')][_0xf97c('0x57')]);_0x282226[_0xf97c('0x46')]=_[_0xf97c('0x56')](_0x273d4c[_0xf97c('0x46')]);_0x282226[_0xf97c('0x47')]=_['intersection'](_0x282226[_0xf97c('0x45')],_0x282226[_0xf97c('0x46')]);_0x1f1c99['attributes']=_[_0xf97c('0x58')](_0x282226['model'],qs[_0xf97c('0x49')](_0x273d4c[_0xf97c('0x46')][_0xf97c('0x49')]));_0x1f1c99[_0xf97c('0x48')]=_0x1f1c99[_0xf97c('0x48')][_0xf97c('0x4a')]?_0x1f1c99[_0xf97c('0x48')]:_0x282226['model'];if(!_0x273d4c['query']['hasOwnProperty'](_0xf97c('0xca'))){_0x1f1c99[_0xf97c('0x31')]=qs['limit'](_0x273d4c[_0xf97c('0x46')][_0xf97c('0x31')]);_0x1f1c99[_0xf97c('0x2f')]=qs[_0xf97c('0x2f')](_0x273d4c[_0xf97c('0x46')]['offset']);}_0x1f1c99[_0xf97c('0x67')]=qs[_0xf97c('0x4c')](_0x273d4c[_0xf97c('0x46')][_0xf97c('0x4c')]);_0x1f1c99[_0xf97c('0x4d')]=qs['filters'](_['pick'](_0x273d4c[_0xf97c('0x46')],_0x282226[_0xf97c('0x47')]));_0x1f1c99[_0xf97c('0x4d')]['SmsAccountId']=_0x451a27['id'];if(_0x273d4c[_0xf97c('0x46')][_0xf97c('0x4f')]){_0x1f1c99[_0xf97c('0x4d')]=_[_0xf97c('0x50')](_0x1f1c99[_0xf97c('0x4d')],{'$or':_[_0xf97c('0x43')](_0x1f1c99[_0xf97c('0x48')],function(_0x5a93fd){var _0x8ef534={};_0x8ef534[_0x5a93fd]={'$like':'%'+_0x273d4c['query'][_0xf97c('0x4f')]+'%'};return _0x8ef534;})});}_0x1f1c99=_[_0xf97c('0x50')]({},_0x1f1c99,_0x273d4c[_0xf97c('0x51')]);return db[_0xf97c('0xa7')][_0xf97c('0x32')]({'where':_0x1f1c99['where']})[_0xf97c('0x23')](function(_0x412229){_0x4a87cf['count']=_0x412229;if(_0x273d4c['query'][_0xf97c('0x52')]){_0x1f1c99[_0xf97c('0x69')]=[{'model':db[_0xf97c('0x7a')],'as':_0xf97c('0xcb'),'required':![]},{'model':db[_0xf97c('0xcc')],'as':'Owner','attributes':[_0xf97c('0x3e'),'fullname',_0xf97c('0xcd')],'required':![]},{'model':db['Tag'],'as':_0xf97c('0xce'),'attributes':['id','name','color'],'where':_0x273d4c[_0xf97c('0x46')][_0xf97c('0xcf')]?{'id':_0x273d4c[_0xf97c('0x46')][_0xf97c('0xcf')]}:undefined,'required':_0x273d4c[_0xf97c('0x46')][_0xf97c('0xcf')]?!![]:![]}];}return db[_0xf97c('0xa7')]['findAll'](_0x1f1c99);})['then'](function(_0x2062c8){_0x4a87cf[_0xf97c('0x54')]=_0x2062c8;return _0x4a87cf;});}})['then'](respondWithFilteredResult(_0x55da88,_0x1f1c99))['catch'](handleError(_0x55da88,null));};exports[_0xf97c('0x3f')]=function(_0x5764e8,_0x42b4d0,_0x315bb4){var _0x3ae353,_0x52cde5,_0x6df147;if(_[_0xf97c('0x9c')](_0x5764e8['body']['body'])||_0x5764e8[_0xf97c('0x5a')][_0xf97c('0x5a')]===''){throw new db['Sequelize'][(_0xf97c('0x7c'))](_0xf97c('0x9e'));}if(_[_0xf97c('0x9c')](_0x5764e8[_0xf97c('0x5a')]['to'])){throw new db[(_0xf97c('0x7b'))][(_0xf97c('0x7c'))]('to\x20is\x20mandatory');}_0x3ae353=_0x5764e8[_0xf97c('0x5a')]['to'];return db['SmsAccount'][_0xf97c('0x62')]({'where':{'id':_0x5764e8['params']['id']},'include':[{'model':db[_0xf97c('0xa2')],'as':_0xf97c('0xd0'),'include':[{'model':db[_0xf97c('0x7a')],'as':_0xf97c('0xa4'),'where':{'mobile':_0x3ae353},'limit':0x1,'order':[['updatedAt',_0xf97c('0xd1')]]}]}]})[_0xf97c('0x23')](handleEntityNotFound(_0x42b4d0,null))['then'](function(_0x2a3cdf){if(_0x2a3cdf&&_0x2a3cdf['List']){_0x52cde5=_0x2a3cdf['get']({'plain':!![]});if(_0x52cde5[_0xf97c('0xd0')]&&_0x52cde5['List']['Contacts'][_0xf97c('0x4a')]){return _0x52cde5[_0xf97c('0xd0')][_0xf97c('0xa4')][0x0];}return db[_0xf97c('0x7a')][_0xf97c('0x59')](_['defaults'](_0x5764e8[_0xf97c('0x5a')],{'firstName':_0x3ae353,'mobile':_0x3ae353,'phone':_0x3ae353,'ListId':_0x52cde5['ListId']}));}})[_0xf97c('0x23')](handleEntityNotFound(_0x42b4d0,null))[_0xf97c('0x23')](function(_0x41efe2){if(_0x41efe2){_0x6df147=_0x41efe2;return db[_0xf97c('0xa7')]['find']({'where':{'ContactId':_0x6df147['id'],'closed':![],'SmsAccountId':_0x52cde5['id']}})[_0xf97c('0x23')](function(_0x568761){if(_0x568761){return[_0x568761,![]];}return db[_0xf97c('0xa7')][_0xf97c('0x59')]({'UserId':_0x5764e8[_0xf97c('0x5b')]['id'],'ContactId':_0x6df147['id'],'SmsAccountId':_0x52cde5['id'],'phone':_0x3ae353,'firstMsgDirection':_0xf97c('0xd2'),'Messages':[_[_0xf97c('0x50')](_0x5764e8[_0xf97c('0x5a')],{'read':![],'body':_0x5764e8['body'][_0xf97c('0x5a')],'phone':_0x3ae353,'SmsAccountId':_0x52cde5['id'],'UserId':_0x5764e8['user']['id'],'ContactId':_0x6df147['id']})]},{'include':[{'model':db[_0xf97c('0xaf')],'as':_0xf97c('0xd3')}]})[_0xf97c('0x23')](function(_0x7a8f37){return[_0x7a8f37,!![]];});});}})['spread'](function(_0x5bb420,_0x511896){if(_0x511896){return _0x5bb420;}return db[_0xf97c('0xaf')]['create'](_[_0xf97c('0x50')](_0x5764e8[_0xf97c('0x5a')],{'read':![],'body':_0x5764e8[_0xf97c('0x5a')][_0xf97c('0x5a')],'phone':_0x3ae353,'SmsAccountId':_0x52cde5['id'],'SmsInteractionId':_0x5bb420['id'],'UserId':_0x5764e8[_0xf97c('0x5b')]['id'],'ContactId':_0x6df147['id']}))[_0xf97c('0x23')](function(_0x26d218){_0x5bb420['dataValues'][_0xf97c('0xd3')]=[];_0x5bb420['dataValues'][_0xf97c('0xd3')][_0xf97c('0xab')](_0x26d218[_0xf97c('0xd4')]);return _0x5bb420;});})[_0xf97c('0x23')](respondWithResult(_0x42b4d0,null))[_0xf97c('0x2c')](handleError(_0x42b4d0,null));};exports['status']=function(_0x272148,_0x481a19,_0x10672c){if(_0x272148[_0xf97c('0x5a')]['id']){delete _0x272148[_0xf97c('0x5a')]['id'];}var _0x38b940,_0x58493b,_0x314b15;return db[_0xf97c('0x53')][_0xf97c('0x62')]({'where':{'id':_0x272148[_0xf97c('0x55')]['id']}})['then'](handleEntityNotFound(_0x481a19,null))[_0xf97c('0x23')](function(_0x28f7ac){if(_0x28f7ac){_0x314b15=_0x28f7ac;logger[_0xf97c('0xbb')](_0xf97c('0x27'),'status','received\x20delivery\x20report\x20from',_0x28f7ac['type'],util['inspect'](_0x272148[_0xf97c('0x5a')],{'showHidden':![],'depth':null}));switch(_0x28f7ac[_0xf97c('0x44')]){case _0xf97c('0x89'):if(_0x272148[_0xf97c('0x5a')][_0xf97c('0xd5')]&&_0x272148[_0xf97c('0x5a')]['status']){_0x58493b=_0x272148[_0xf97c('0x5a')][_0xf97c('0x2d')];return db[_0xf97c('0xaf')][_0xf97c('0x62')]({'where':{'messageId':_0x272148[_0xf97c('0x5a')][_0xf97c('0xd5')]}});}break;case _0xf97c('0x8c'):if(_0x272148[_0xf97c('0x5a')][_0xf97c('0xd6')]&&_0x272148[_0xf97c('0x5a')][_0xf97c('0xd7')]){_0x58493b=_0x272148[_0xf97c('0x5a')][_0xf97c('0xd7')];return db[_0xf97c('0xaf')]['find']({'where':{'messageId':_0x272148[_0xf97c('0x5a')][_0xf97c('0xd6')]}});}break;case'clicksend':if(_0x272148[_0xf97c('0x5a')][_0xf97c('0x8e')]&&_0x272148[_0xf97c('0x5a')]['status_code']){_0x58493b=_0x272148[_0xf97c('0x5a')][_0xf97c('0xd8')];return db[_0xf97c('0xaf')][_0xf97c('0x62')]({'where':{'messageId':_0x272148[_0xf97c('0x5a')]['message_id']}});}break;case'infobip':var _0x1f0542=_0x272148[_0xf97c('0x5a')]['results'][0x0];if(_0x1f0542[_0xf97c('0x87')]&&_0x1f0542['status'][_0xf97c('0xd9')]===_0xf97c('0xda')){_0x58493b=_0x1f0542['status'][_0xf97c('0xd9')];return db[_0xf97c('0xaf')][_0xf97c('0x62')]({'where':{'messageId':_0x1f0542[_0xf97c('0x87')]}});}break;case _0xf97c('0x97'):if(_0x272148[_0xf97c('0x5a')][_0xf97c('0x87')]&&_0x272148[_0xf97c('0x5a')]['status']){_0x58493b=_0x272148[_0xf97c('0x5a')]['status'];return db[_0xf97c('0xaf')][_0xf97c('0x62')]({'where':{'messageId':_0x272148[_0xf97c('0x5a')][_0xf97c('0x87')]}});}break;case _0xf97c('0x9a'):if(_0x272148[_0xf97c('0x5a')][0x0][_0xf97c('0x2a')]['id']){_0x58493b=_0x272148[_0xf97c('0x5a')][0x0][_0xf97c('0x44')];return db[_0xf97c('0xaf')][_0xf97c('0x62')]({'where':{'messageId':_0x272148['body'][0x0][_0xf97c('0x2a')]['id']}});}break;case'intelepeer':if(_0x272148['body'][_0xf97c('0xdb')]&&_0x272148[_0xf97c('0x5a')][_0xf97c('0x2d')]){_0x58493b=_0x272148[_0xf97c('0x5a')]['status'];return db[_0xf97c('0xaf')][_0xf97c('0x62')]({'where':{'messageId':_0x272148[_0xf97c('0x5a')]['redif']}});}break;}}})['then'](handleEntityNotFound(_0x481a19,null))[_0xf97c('0x23')](function(_0x177da1){if(_0x177da1){_0x38b940=_0x177da1;switch(_0x314b15[_0xf97c('0x44')]){case _0xf97c('0x89'):if(_0x58493b===_0xf97c('0xda')){return _0x38b940[_0xf97c('0x38')]({'read':!![]});}else{logger[_0xf97c('0x28')](_0xf97c('0x27'),_0xf97c('0x2d'),'skebby',util[_0xf97c('0xdc')](_0x272148['body'],{'showHidden':![],'depth':null}));}break;case'connectel':if(_0x58493b==='1'){return _0x38b940['update']({'read':!![]});}else{logger[_0xf97c('0x28')](_0xf97c('0x27'),_0xf97c('0x2d'),_0xf97c('0x89'),util[_0xf97c('0xdc')](_0x272148[_0xf97c('0x5a')],{'showHidden':![],'depth':null}));}break;case _0xf97c('0x8d'):if(!_0x272148[_0xf97c('0x5a')][_0xf97c('0xdd')]&&_0x58493b>=0xc8&&_0x58493b<=0xce){return _0x38b940[_0xf97c('0x38')]({'read':!![]});}else{logger[_0xf97c('0x28')](_0xf97c('0x27'),_0xf97c('0x2d'),_0xf97c('0x8d'),util[_0xf97c('0xdc')](_0x272148['body'],{'showHidden':![],'depth':null}));}break;case _0xf97c('0x92'):var _0x2cc214=_0x272148[_0xf97c('0x5a')][_0xf97c('0x93')][0x0];if(_0x2cc214[_0xf97c('0x2d')]['groupName']==='DELIVERED'){return _0x38b940['update']({'read':!![]});}else{logger[_0xf97c('0x28')](_0xf97c('0x27'),_0xf97c('0x2d'),'infobip',util[_0xf97c('0xdc')](_0x272148[_0xf97c('0x5a')],{'showHidden':![],'depth':null}));}break;case'clickatell':if(_0x58493b=='DELIVERED_TO_GATEWAY'||_0x58493b=='RECEIVED_BY_RECIPIENT'){return _0x38b940[_0xf97c('0x38')]({'read':!![]});}else{logger[_0xf97c('0x28')](_0xf97c('0x27'),_0xf97c('0x2d'),'clickatell',util[_0xf97c('0xdc')](_0x272148[_0xf97c('0x5a')],{'showHidden':![],'depth':null}));}break;case _0xf97c('0x9a'):if(_0x58493b==_0xf97c('0xde')){return _0x38b940[_0xf97c('0x38')]({'read':!![]});}else{logger['error'](_0xf97c('0x27'),_0xf97c('0x2d'),_0xf97c('0x9a'),util['inspect'](_0x272148[_0xf97c('0x5a')],{'showHidden':![],'depth':null}));}break;case _0xf97c('0xdf'):if(_0x58493b==='DELIVRD'||_0x58493b===_0xf97c('0xe0')){return _0x38b940[_0xf97c('0x38')]({'read':!![]});}else{logger['error'](_0xf97c('0x27'),_0xf97c('0x2d'),_0xf97c('0xdf'),util[_0xf97c('0xdc')](_0x272148[_0xf97c('0x5a')],{'showHidden':![],'depth':null}));}break;}return _0x38b940;}})[_0xf97c('0x23')](respondWithResult(_0x481a19,null))[_0xf97c('0x2c')](handleError(_0x481a19,null));};exports[_0xf97c('0xe1')]=function(_0x12aecf,_0x2bdd8c,_0x33151b){var _0x3d8e69,_0x41dbbc,_0x1297ee;return db[_0xf97c('0x53')][_0xf97c('0x62')]({'where':{'id':_0x12aecf[_0xf97c('0x55')]['id']}})[_0xf97c('0x23')](handleEntityNotFound(_0x2bdd8c,null))['then'](function(_0x32b979){if(_0x32b979){_0x1297ee=_0x32b979;logger['debug']('SmsAccount,\x20%s,\x20%s,\x20%s',_0xf97c('0x2d'),_0xf97c('0xe2'),_0x32b979[_0xf97c('0x44')],util[_0xf97c('0xdc')](_0x12aecf[_0xf97c('0x46')],{'showHidden':![],'depth':null}));switch(_0x32b979['type']){case _0xf97c('0x94'):if(_0x12aecf[_0xf97c('0x46')]['message-id']&&_0x12aecf[_0xf97c('0x46')][_0xf97c('0xe3')]){_0x41dbbc=_0x12aecf[_0xf97c('0x46')][_0xf97c('0xe3')];return db['SmsMessage'][_0xf97c('0x62')]({'where':{'messageId':_0x12aecf[_0xf97c('0x46')][_0xf97c('0xe4')]}});}break;}}})[_0xf97c('0x23')](handleEntityNotFound(_0x2bdd8c,null))[_0xf97c('0x23')](function(_0xdb62b6){if(_0xdb62b6){_0x3d8e69=_0xdb62b6;switch(_0x1297ee['type']){case'csc':if(_0x41dbbc==='2'||_0x41dbbc==='6'){return _0x3d8e69[_0xf97c('0x38')]({'read':!![]});}else{logger[_0xf97c('0x28')](_0xf97c('0x27'),_0xf97c('0x2d'),_0xf97c('0x94'),util[_0xf97c('0xdc')](_0x12aecf[_0xf97c('0x46')],{'showHidden':![],'depth':null}));};break;}return _0x3d8e69;}})[_0xf97c('0x23')](respondWithResult(_0x2bdd8c,null))[_0xf97c('0x2c')](handleError(_0x2bdd8c,null));};exports[_0xf97c('0xe5')]=function(_0x574e89,_0x20516b,_0x4b8ac3){return db[_0xf97c('0x53')][_0xf97c('0x62')]({'where':{'id':_0x574e89[_0xf97c('0x55')]['id']}})[_0xf97c('0x23')](handleEntityNotFound(_0x20516b,null))['then'](function(_0x488a91){if(_0x488a91){return _0x488a91[_0xf97c('0xe5')](_0x574e89[_0xf97c('0x5a')]['ids'],_['omit'](_0x574e89[_0xf97c('0x5a')],[_0xf97c('0x70'),'id'])||{})[_0xf97c('0xe6')](function(_0x35f349){for(var _0x53bac0=0x0;_0x53bac0<_0x574e89['body'][_0xf97c('0x70')]['length'];_0x53bac0+=0x1){socket[_0xf97c('0xe7')](_0xf97c('0xe8'),{'UserId':Number(_0x574e89[_0xf97c('0x5a')][_0xf97c('0x70')][_0x53bac0]),'SmsAccountId':Number(_0x574e89['params']['id'])});}return _0x35f349;});}})[_0xf97c('0x23')](respondWithResult(_0x20516b,null))[_0xf97c('0x2c')](handleError(_0x20516b,null));};exports['removeAgents']=function(_0x2b69bb,_0x3888a0,_0x564501){return db[_0xf97c('0x53')][_0xf97c('0x62')]({'where':{'id':_0x2b69bb['params']['id']}})[_0xf97c('0x23')](handleEntityNotFound(_0x3888a0,null))[_0xf97c('0x23')](function(_0x43cf1d){if(_0x43cf1d){return _0x43cf1d[_0xf97c('0xe9')](_0x2b69bb[_0xf97c('0x46')]['ids'])[_0xf97c('0x23')](function(){if(_[_0xf97c('0xea')](_0x2b69bb[_0xf97c('0x46')]['ids'])){for(var _0x59047a=0x0;_0x59047a<_0x2b69bb[_0xf97c('0x46')]['ids']['length'];_0x59047a+=0x1){socket[_0xf97c('0xe7')](_0xf97c('0xeb'),{'UserId':Number(_0x2b69bb[_0xf97c('0x46')][_0xf97c('0x70')][_0x59047a]),'SmsAccountId':Number(_0x2b69bb[_0xf97c('0x55')]['id'])});}}else{socket[_0xf97c('0xe7')](_0xf97c('0xeb'),{'UserId':Number(_0x2b69bb['query']['ids']),'SmsAccountId':Number(_0x2b69bb[_0xf97c('0x55')]['id'])});}});}})[_0xf97c('0x23')](respondWithStatusCode(_0x3888a0,null))[_0xf97c('0x2c')](handleError(_0x3888a0,null));};exports['getAgents']=function(_0x3ee66d,_0x444680,_0x8a7d75){var _0x2c4026={};var _0xe26a65={};var _0x9e4f36;var _0x26f8d4;return db[_0xf97c('0x53')][_0xf97c('0x66')]({'where':{'id':_0x3ee66d[_0xf97c('0x55')]['id']}})['then'](handleEntityNotFound(_0x444680,null))['then'](function(_0xaab25d){if(_0xaab25d){_0x9e4f36=_0xaab25d;_0xe26a65['model']=_['keys'](db[_0xf97c('0xcc')][_0xf97c('0x57')]);_0xe26a65[_0xf97c('0x46')]=_['keys'](_0x3ee66d[_0xf97c('0x46')]);_0xe26a65[_0xf97c('0x47')]=_[_0xf97c('0x58')](_0xe26a65[_0xf97c('0x45')],_0xe26a65['query']);_0x2c4026[_0xf97c('0x48')]=_['intersection'](_0xe26a65[_0xf97c('0x45')],qs[_0xf97c('0x49')](_0x3ee66d[_0xf97c('0x46')][_0xf97c('0x49')]));_0x2c4026[_0xf97c('0x48')]=_0x2c4026[_0xf97c('0x48')][_0xf97c('0x4a')]?_0x2c4026[_0xf97c('0x48')]:_0xe26a65[_0xf97c('0x45')];_0x2c4026[_0xf97c('0x67')]=qs['sort'](_0x3ee66d[_0xf97c('0x46')][_0xf97c('0x4c')]);_0x2c4026['where']=qs[_0xf97c('0x47')](_[_0xf97c('0x4e')](_0x3ee66d[_0xf97c('0x46')],_0xe26a65[_0xf97c('0x47')]));if(_0x3ee66d['query'][_0xf97c('0x4f')]){_0x2c4026[_0xf97c('0x4d')]=_[_0xf97c('0x50')](_0x2c4026[_0xf97c('0x4d')],{'$or':_[_0xf97c('0x43')](_0x2c4026['attributes'],function(_0x2d8e1e){var _0x19b257={};_0x19b257[_0x2d8e1e]={'$like':'%'+_0x3ee66d[_0xf97c('0x46')][_0xf97c('0x4f')]+'%'};return _0x19b257;})});}_0x2c4026=_['merge']({},_0x2c4026,_0x3ee66d[_0xf97c('0x51')]);return _0x9e4f36[_0xf97c('0xec')](_0x2c4026);}})[_0xf97c('0x23')](function(_0xe5f032){if(_0xe5f032){_0x26f8d4=_0xe5f032[_0xf97c('0x4a')];if(!_0x3ee66d[_0xf97c('0x46')][_0xf97c('0x4b')](_0xf97c('0xca'))){_0x2c4026[_0xf97c('0x31')]=qs[_0xf97c('0x31')](_0x3ee66d[_0xf97c('0x46')][_0xf97c('0x31')]);_0x2c4026[_0xf97c('0x2f')]=qs[_0xf97c('0x2f')](_0x3ee66d[_0xf97c('0x46')][_0xf97c('0x2f')]);}return _0x9e4f36[_0xf97c('0xec')](_0x2c4026);}})['then'](function(_0xd7be4f){if(_0xd7be4f){return _0xd7be4f?{'count':_0x26f8d4,'rows':_0xd7be4f}:null;}})[_0xf97c('0x23')](respondWithResult(_0x444680,null))[_0xf97c('0x2c')](handleError(_0x444680,null));}; \ No newline at end of file +var _0xd681=['push','close','unmanaged','*,*,*,*','created','SmsMessage','ContactId','unshift','queueId','SmsQueue','queue','Start','startRouting','receiveMessage','SmsAccount,\x20%s,\x20%s,\x20%s','entity\x20found','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','Content-Type','send','\x0a','addApplications','transaction','sequelize','ISOLATION_LEVELS','READ_COMMITTED','finally','getApplications','getInteractions','User','internal','Tag','Tags','color','tag','to\x20is\x20mandatory','List','spread','dataValues','Messages','inspect','skebby_dispatch_id','requestid','statusInt','clicksend','status_code','groupName','DELIVERED','redif','connectel','error_code','DELIVERED_TO_GATEWAY','RECEIVED_BY_RECIPIENT','message-delivered','DELIVRD','ACCEPTD','received\x20delivery\x20report\x20from','message-id','addAgents','omit','emit','userSmsAccount:save','removeAgents','isArray','userSmsAccount:remove','getAgents','rimraf','zip-dir','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./smsAccount.socket','register','client','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','get','name','index','Pause','mandatoryDispositionPause','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','options','SmsAccount','includeAll','findAll','rows','show','include','create','body','user','role','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','describe','addDisposition','params','getDispositions','findOne','Disposition','nolimit','removeDispositions','ids','CannedAnswer','getAnswers','order','SmsAccountId','removeAnswers','notify','SmsApplication','Applications','account','applications','orderBy','ValidationError','no\x20available\x20attributes','difference','updatedAt','createdAt','CompanyId','ListId','mobile','twilio','from','From','messageId','MessageSid','skebby','sender','text','plivo','Text','MessageUUID','infobip','results','csc','originatingAddress','segmentedMessage','clickatell','fromNumber','replyMessageId','bandwidth','intelepeer','refid','isNil','Sequelize','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes','CmList','Contacts','list','CmContact','SmsInteraction','interaction','autoclose'];(function(_0x2d61ac,_0x18ff36){var _0x3f7d3c=function(_0x2ba7e5){while(--_0x2ba7e5){_0x2d61ac['push'](_0x2d61ac['shift']());}};_0x3f7d3c(++_0x18ff36);}(_0xd681,0x124));var _0x1d68=function(_0x437d91,_0x309983){_0x437d91=_0x437d91-0x0;var _0x176b38=_0xd681[_0x437d91];return _0x176b38;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1d68('0x0'));var zipdir=require(_0x1d68('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x1d68('0x2'));var BPromise=require(_0x1d68('0x3'));var Mustache=require(_0x1d68('0x4'));var util=require(_0x1d68('0x5'));var path=require('path');var sox=require(_0x1d68('0x6'));var csv=require(_0x1d68('0x7'));var ejs=require(_0x1d68('0x8'));var fs=require('fs');var fs_extra=require(_0x1d68('0x9'));var _=require(_0x1d68('0xa'));var squel=require(_0x1d68('0xb'));var crypto=require(_0x1d68('0xc'));var jsforce=require(_0x1d68('0xd'));var deskjs=require(_0x1d68('0xe'));var toCsv=require(_0x1d68('0x7'));var querystring=require('querystring');var Papa=require(_0x1d68('0xf'));var Redis=require(_0x1d68('0x10'));var authService=require(_0x1d68('0x11'));var qs=require(_0x1d68('0x12'));var as=require(_0x1d68('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x1d68('0x14'));var utils=require(_0x1d68('0x15'));var config=require(_0x1d68('0x16'));var licenseUtil=require(_0x1d68('0x17'));var db=require(_0x1d68('0x18'))['db'];config[_0x1d68('0x19')]=_[_0x1d68('0x1a')](config[_0x1d68('0x19')],{'host':_0x1d68('0x1b'),'port':0x18eb});var socket=require(_0x1d68('0x1c'))(new Redis(config['redis']));require(_0x1d68('0x1d'))[_0x1d68('0x1e')](socket);var jayson=require('jayson/promise');var client=jayson[_0x1d68('0x1f')]['http']({'port':0x232c});function respondWithRpcPromise(_0x28c3de,_0x403ede,_0x4b6f39,_0x22f0cb){return new BPromise(function(_0x5d8a13,_0x309a46){var _0x27e324=_0x22f0cb||client;return _0x27e324['request'](_0x28c3de,_0x4b6f39)[_0x1d68('0x20')](function(_0x544845){logger[_0x1d68('0x21')](_0x1d68('0x22'),_0x403ede,_0x1d68('0x23'));logger[_0x1d68('0x24')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x403ede,_0x1d68('0x23'),JSON[_0x1d68('0x25')](_0x544845));if(_0x544845[_0x1d68('0x26')]){if(_0x544845[_0x1d68('0x26')][_0x1d68('0x27')]===0x1f4){logger[_0x1d68('0x26')](_0x1d68('0x22'),_0x403ede,_0x544845['error']['message']);return _0x309a46(_0x544845[_0x1d68('0x26')][_0x1d68('0x28')]);}logger[_0x1d68('0x26')](_0x1d68('0x22'),_0x403ede,_0x544845[_0x1d68('0x26')]['message']);return _0x5d8a13(_0x544845[_0x1d68('0x26')]['message']);}else{logger[_0x1d68('0x21')](_0x1d68('0x22'),_0x403ede,_0x1d68('0x23'));_0x5d8a13(_0x544845['result']['message']);}})[_0x1d68('0x29')](function(_0x222f6f){logger[_0x1d68('0x26')](_0x1d68('0x22'),_0x403ede,_0x222f6f);_0x309a46(_0x222f6f);});});}function respondWithStatusCode(_0x3efaa6,_0x5c002e){_0x5c002e=_0x5c002e||0xcc;return function(_0x3f56de){if(_0x3f56de){return _0x3efaa6[_0x1d68('0x2a')](_0x5c002e);}return _0x3efaa6[_0x1d68('0x2b')](_0x5c002e)[_0x1d68('0x2c')]();};}function respondWithResult(_0x2a972a,_0x15a72d){_0x15a72d=_0x15a72d||0xc8;return function(_0x5f457d){if(_0x5f457d){return _0x2a972a[_0x1d68('0x2b')](_0x15a72d)[_0x1d68('0x2d')](_0x5f457d);}};}function respondWithFilteredResult(_0x10ee5c,_0x2447fa){return function(_0x31cd35){if(_0x31cd35){var _0x394ec2=typeof _0x2447fa[_0x1d68('0x2e')]===_0x1d68('0x2f')&&typeof _0x2447fa[_0x1d68('0x30')]==='undefined';var _0xa6713e=_0x31cd35[_0x1d68('0x31')];var _0x4c1914=_0x394ec2?0x0:_0x2447fa['offset'];var _0x3542c0=_0x394ec2?_0x31cd35['count']:_0x2447fa[_0x1d68('0x2e')]+_0x2447fa[_0x1d68('0x30')];var _0x2d153a;if(_0x3542c0>=_0xa6713e){_0x3542c0=_0xa6713e;_0x2d153a=0xc8;}else{_0x2d153a=0xce;}_0x10ee5c['status'](_0x2d153a);return _0x10ee5c[_0x1d68('0x32')](_0x1d68('0x33'),_0x4c1914+'-'+_0x3542c0+'/'+_0xa6713e)['json'](_0x31cd35);}return null;};}function patchUpdates(_0x305b1b){return function(_0x4e4eb0){try{jsonpatch[_0x1d68('0x34')](_0x4e4eb0,_0x305b1b,!![]);}catch(_0x318c66){return BPromise[_0x1d68('0x35')](_0x318c66);}return _0x4e4eb0[_0x1d68('0x36')]();};}function saveUpdates(_0x5dbd27,_0x542b43){return function(_0x28676f){if(_0x28676f){return _0x28676f[_0x1d68('0x37')](_0x5dbd27)[_0x1d68('0x20')](function(_0x51a951){return _0x51a951;});}return null;};}function removeEntity(_0x51c626,_0x477dcd){return function(_0x5cb825){if(_0x5cb825){return _0x5cb825['destroy']()[_0x1d68('0x20')](function(){var _0x4a30fa=_0x5cb825[_0x1d68('0x38')]({'plain':!![]});var _0x5837c6='SmsAccounts';return db['UserProfileResource']['destroy']({'where':{'type':_0x5837c6,'resourceId':_0x4a30fa['id']}})[_0x1d68('0x20')](function(){return _0x5cb825;});})[_0x1d68('0x20')](function(){_0x51c626['status'](0xcc)[_0x1d68('0x2c')]();});}};}function handleEntityNotFound(_0x78b032,_0x40d098){return function(_0x3fb535){if(!_0x3fb535){_0x78b032[_0x1d68('0x2a')](0x194);}return _0x3fb535;};}function handleError(_0x388b66,_0xb08785){_0xb08785=_0xb08785||0x1f4;return function(_0x17a995){logger[_0x1d68('0x26')](_0x17a995['stack']);if(_0x17a995['name']){delete _0x17a995[_0x1d68('0x39')];}_0x388b66[_0x1d68('0x2b')](_0xb08785)['send'](_0x17a995);};}exports[_0x1d68('0x3a')]=function(_0x42cf94,_0x11509f){var _0x24e144={'include':[{'model':db[_0x1d68('0x3b')],'as':_0x1d68('0x3c')}]},_0x3db7c8={},_0x4e1f51={'count':0x0,'rows':[]};var _0x4affb5=_[_0x1d68('0x3d')](db['SmsAccount'][_0x1d68('0x3e')],function(_0x873dd9){return{'name':_0x873dd9[_0x1d68('0x3f')],'type':_0x873dd9[_0x1d68('0x40')][_0x1d68('0x41')]};});_0x3db7c8[_0x1d68('0x42')]=_[_0x1d68('0x3d')](_0x4affb5,'name');_0x3db7c8[_0x1d68('0x43')]=_[_0x1d68('0x44')](_0x42cf94[_0x1d68('0x43')]);_0x3db7c8[_0x1d68('0x45')]=_[_0x1d68('0x46')](_0x3db7c8['model'],_0x3db7c8[_0x1d68('0x43')]);_0x24e144['attributes']=_[_0x1d68('0x46')](_0x3db7c8['model'],qs[_0x1d68('0x47')](_0x42cf94[_0x1d68('0x43')][_0x1d68('0x47')]));_0x24e144[_0x1d68('0x48')]=_0x24e144[_0x1d68('0x48')][_0x1d68('0x49')]?_0x24e144[_0x1d68('0x48')]:_0x3db7c8[_0x1d68('0x42')];if(!_0x42cf94[_0x1d68('0x43')][_0x1d68('0x4a')]('nolimit')){_0x24e144[_0x1d68('0x30')]=qs['limit'](_0x42cf94[_0x1d68('0x43')][_0x1d68('0x30')]);_0x24e144[_0x1d68('0x2e')]=qs['offset'](_0x42cf94[_0x1d68('0x43')]['offset']);}_0x24e144['order']=qs['sort'](_0x42cf94['query'][_0x1d68('0x4b')]);_0x24e144[_0x1d68('0x4c')]=qs[_0x1d68('0x45')](_[_0x1d68('0x4d')](_0x42cf94[_0x1d68('0x43')],_0x3db7c8[_0x1d68('0x45')]),_0x4affb5);if(_0x42cf94[_0x1d68('0x43')][_0x1d68('0x4e')]){_0x24e144[_0x1d68('0x4c')]=_[_0x1d68('0x4f')](_0x24e144[_0x1d68('0x4c')],{'$or':_[_0x1d68('0x3d')](_0x4affb5,function(_0x1a13ea){if(_0x1a13ea[_0x1d68('0x40')]!==_0x1d68('0x50')){var _0x292bc0={};_0x292bc0[_0x1a13ea[_0x1d68('0x39')]]={'$like':'%'+_0x42cf94[_0x1d68('0x43')][_0x1d68('0x4e')]+'%'};return _0x292bc0;}})});}_0x24e144=_[_0x1d68('0x4f')]({},_0x24e144,_0x42cf94[_0x1d68('0x51')]);var _0x473427={'where':_0x24e144[_0x1d68('0x4c')]};return db[_0x1d68('0x52')][_0x1d68('0x31')](_0x473427)[_0x1d68('0x20')](function(_0x5f1401){_0x4e1f51[_0x1d68('0x31')]=_0x5f1401;if(_0x42cf94['query'][_0x1d68('0x53')]){_0x24e144['include']=[{'all':!![]}];}return db[_0x1d68('0x52')][_0x1d68('0x54')](_0x24e144);})['then'](function(_0x5ccf2a){_0x4e1f51[_0x1d68('0x55')]=_0x5ccf2a;return _0x4e1f51;})[_0x1d68('0x20')](respondWithFilteredResult(_0x11509f,_0x24e144))[_0x1d68('0x29')](handleError(_0x11509f,null));};exports[_0x1d68('0x56')]=function(_0xd0b1ac,_0x36e055){var _0x4aac73={'raw':![],'where':{'id':_0xd0b1ac['params']['id']},'include':[{'model':db[_0x1d68('0x3b')],'as':'mandatoryDispositionPause'}]},_0x13ec7f={};_0x13ec7f[_0x1d68('0x42')]=_['keys'](db['SmsAccount'][_0x1d68('0x3e')]);_0x13ec7f[_0x1d68('0x43')]=_[_0x1d68('0x44')](_0xd0b1ac[_0x1d68('0x43')]);_0x13ec7f[_0x1d68('0x45')]=_[_0x1d68('0x46')](_0x13ec7f[_0x1d68('0x42')],_0x13ec7f['query']);_0x4aac73['attributes']=_[_0x1d68('0x46')](_0x13ec7f[_0x1d68('0x42')],qs[_0x1d68('0x47')](_0xd0b1ac[_0x1d68('0x43')][_0x1d68('0x47')]));_0x4aac73['attributes']=_0x4aac73[_0x1d68('0x48')][_0x1d68('0x49')]?_0x4aac73[_0x1d68('0x48')]:_0x13ec7f[_0x1d68('0x42')];if(_0xd0b1ac[_0x1d68('0x43')][_0x1d68('0x53')]){_0x4aac73[_0x1d68('0x57')]=[{'all':!![]}];}_0x4aac73=_[_0x1d68('0x4f')]({},_0x4aac73,_0xd0b1ac[_0x1d68('0x51')]);return db[_0x1d68('0x52')]['find'](_0x4aac73)[_0x1d68('0x20')](handleEntityNotFound(_0x36e055,null))['then'](respondWithResult(_0x36e055,null))[_0x1d68('0x29')](handleError(_0x36e055,null));};exports['create']=function(_0x188c94,_0x534e74){return db[_0x1d68('0x52')][_0x1d68('0x58')](_0x188c94[_0x1d68('0x59')],{})[_0x1d68('0x20')](function(_0x54ac1a){var _0x523fbd=_0x188c94[_0x1d68('0x5a')][_0x1d68('0x38')]({'plain':!![]});if(!_0x523fbd)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x523fbd[_0x1d68('0x5b')]==='user'){var _0x4c5aa2=_0x54ac1a[_0x1d68('0x38')]({'plain':!![]});var _0x17417c='SmsAccounts';return db[_0x1d68('0x5c')][_0x1d68('0x5d')]({'where':{'name':_0x17417c,'userProfileId':_0x523fbd[_0x1d68('0x5e')]},'raw':!![]})[_0x1d68('0x20')](function(_0x57479a){if(_0x57479a&&_0x57479a[_0x1d68('0x5f')]===0x0){return db[_0x1d68('0x60')]['create']({'name':_0x4c5aa2[_0x1d68('0x39')],'resourceId':_0x4c5aa2['id'],'type':_0x57479a[_0x1d68('0x39')],'sectionId':_0x57479a['id']},{})[_0x1d68('0x20')](function(){return _0x54ac1a;});}else{return _0x54ac1a;}})['catch'](function(_0x3c26df){logger[_0x1d68('0x26')](_0x1d68('0x61'),_0x3c26df);throw _0x3c26df;});}return _0x54ac1a;})[_0x1d68('0x20')](respondWithResult(_0x534e74,0xc9))[_0x1d68('0x29')](handleError(_0x534e74,null));};exports[_0x1d68('0x37')]=function(_0x2be669,_0x5d9bb5){if(_0x2be669[_0x1d68('0x59')]['id']){delete _0x2be669[_0x1d68('0x59')]['id'];}return db[_0x1d68('0x52')][_0x1d68('0x5d')]({'where':{'id':_0x2be669['params']['id']},'include':[{'model':db[_0x1d68('0x3b')],'as':'mandatoryDispositionPause'}]})['then'](handleEntityNotFound(_0x5d9bb5,null))[_0x1d68('0x20')](saveUpdates(_0x2be669[_0x1d68('0x59')],null))[_0x1d68('0x20')](respondWithResult(_0x5d9bb5,null))[_0x1d68('0x29')](handleError(_0x5d9bb5,null));};exports[_0x1d68('0x62')]=function(_0x5c362b,_0x245798){return db[_0x1d68('0x52')][_0x1d68('0x5d')]({'where':{'id':_0x5c362b['params']['id']}})['then'](handleEntityNotFound(_0x245798,null))[_0x1d68('0x20')](removeEntity(_0x245798,null))['catch'](handleError(_0x245798,null));};exports[_0x1d68('0x63')]=function(_0x22f55e,_0x5d9469){return db['SmsAccount'][_0x1d68('0x63')]()['then'](respondWithResult(_0x5d9469,null))['catch'](handleError(_0x5d9469,null));};exports[_0x1d68('0x64')]=function(_0x485b87,_0x20099e,_0xe305cb){if(_0x485b87[_0x1d68('0x59')]['id']){delete _0x485b87[_0x1d68('0x59')]['id'];}return db[_0x1d68('0x52')]['find']({'where':{'id':_0x485b87[_0x1d68('0x65')]['id']}})[_0x1d68('0x20')](handleEntityNotFound(_0x20099e,null))[_0x1d68('0x20')](function(_0x164716){if(_0x164716){_0x485b87[_0x1d68('0x59')]['SmsAccountId']=_0x164716['id'];return db['Disposition'][_0x1d68('0x58')](_0x485b87[_0x1d68('0x59')]);}})['then'](respondWithResult(_0x20099e,null))[_0x1d68('0x29')](handleError(_0x20099e,null));};exports[_0x1d68('0x66')]=function(_0x7ff867,_0x3f3527,_0x1439d1){var _0x30aa6c={'raw':![],'where':{}};var _0x4afa8e={};var _0xe47fed={'count':0x0,'rows':[]};return db[_0x1d68('0x52')][_0x1d68('0x67')]({'where':{'id':_0x7ff867['params']['id']}})[_0x1d68('0x20')](handleEntityNotFound(_0x3f3527,null))[_0x1d68('0x20')](function(_0x29cb74){if(_0x29cb74){_0x4afa8e[_0x1d68('0x42')]=_[_0x1d68('0x44')](db[_0x1d68('0x68')][_0x1d68('0x3e')]);_0x4afa8e[_0x1d68('0x43')]=_['keys'](_0x7ff867[_0x1d68('0x43')]);_0x4afa8e[_0x1d68('0x45')]=_[_0x1d68('0x46')](_0x4afa8e[_0x1d68('0x42')],_0x4afa8e[_0x1d68('0x43')]);_0x30aa6c['attributes']=_[_0x1d68('0x46')](_0x4afa8e[_0x1d68('0x42')],qs['fields'](_0x7ff867[_0x1d68('0x43')][_0x1d68('0x47')]));_0x30aa6c[_0x1d68('0x48')]=_0x30aa6c[_0x1d68('0x48')][_0x1d68('0x49')]?_0x30aa6c[_0x1d68('0x48')]:_0x4afa8e[_0x1d68('0x42')];if(!_0x7ff867['query'][_0x1d68('0x4a')](_0x1d68('0x69'))){_0x30aa6c['limit']=qs['limit'](_0x7ff867[_0x1d68('0x43')][_0x1d68('0x30')]);_0x30aa6c[_0x1d68('0x2e')]=qs[_0x1d68('0x2e')](_0x7ff867[_0x1d68('0x43')][_0x1d68('0x2e')]);}_0x30aa6c['order']=qs[_0x1d68('0x4b')](_0x7ff867[_0x1d68('0x43')]['sort']);_0x30aa6c[_0x1d68('0x4c')]=qs[_0x1d68('0x45')](_[_0x1d68('0x4d')](_0x7ff867[_0x1d68('0x43')],_0x4afa8e[_0x1d68('0x45')]));_0x30aa6c[_0x1d68('0x4c')]['SmsAccountId']=_0x29cb74['id'];if(_0x7ff867['query'][_0x1d68('0x4e')]){_0x30aa6c[_0x1d68('0x4c')]=_[_0x1d68('0x4f')](_0x30aa6c[_0x1d68('0x4c')],{'$or':_['map'](_0x30aa6c['attributes'],function(_0x4a8c15){var _0x8543e1={};_0x8543e1[_0x4a8c15]={'$like':'%'+_0x7ff867[_0x1d68('0x43')][_0x1d68('0x4e')]+'%'};return _0x8543e1;})});}_0x30aa6c=_['merge']({},_0x30aa6c,_0x7ff867[_0x1d68('0x51')]);return db[_0x1d68('0x68')][_0x1d68('0x31')]({'where':_0x30aa6c[_0x1d68('0x4c')]})[_0x1d68('0x20')](function(_0x377b47){_0xe47fed['count']=_0x377b47;if(_0x7ff867[_0x1d68('0x43')][_0x1d68('0x53')]){_0x30aa6c[_0x1d68('0x57')]=[{'all':!![]}];}return db[_0x1d68('0x68')]['findAll'](_0x30aa6c);})[_0x1d68('0x20')](function(_0x1ee8b5){_0xe47fed[_0x1d68('0x55')]=_0x1ee8b5;return _0xe47fed;});}})[_0x1d68('0x20')](respondWithFilteredResult(_0x3f3527,_0x30aa6c))[_0x1d68('0x29')](handleError(_0x3f3527,null));};exports['removeDispositions']=function(_0x1930d7,_0x4fbf29,_0x29b68e){return db['SmsAccount'][_0x1d68('0x5d')]({'where':{'id':_0x1930d7[_0x1d68('0x65')]['id']}})[_0x1d68('0x20')](handleEntityNotFound(_0x4fbf29,null))[_0x1d68('0x20')](function(_0x2b6f2e){if(_0x2b6f2e){return _0x2b6f2e[_0x1d68('0x6a')](_0x1930d7['query'][_0x1d68('0x6b')]);}})['then'](respondWithStatusCode(_0x4fbf29,null))[_0x1d68('0x29')](handleError(_0x4fbf29,null));};exports['addAnswer']=function(_0x271acb,_0x2ee236,_0x459999){if(_0x271acb[_0x1d68('0x59')]['id']){delete _0x271acb[_0x1d68('0x59')]['id'];}return db[_0x1d68('0x52')][_0x1d68('0x5d')]({'where':{'id':_0x271acb[_0x1d68('0x65')]['id']}})[_0x1d68('0x20')](handleEntityNotFound(_0x2ee236,null))[_0x1d68('0x20')](function(_0x336bf5){if(_0x336bf5){_0x271acb['body']['SmsAccountId']=_0x336bf5['id'];return db[_0x1d68('0x6c')]['create'](_0x271acb[_0x1d68('0x59')]);}})[_0x1d68('0x20')](respondWithResult(_0x2ee236,null))[_0x1d68('0x29')](handleError(_0x2ee236,null));};exports[_0x1d68('0x6d')]=function(_0xe945a3,_0x1c973f,_0x1fa478){var _0x473641={'raw':![],'where':{}};var _0x562506={};var _0x3b20e8={'count':0x0,'rows':[]};return db[_0x1d68('0x52')][_0x1d68('0x67')]({'where':{'id':_0xe945a3[_0x1d68('0x65')]['id']}})['then'](handleEntityNotFound(_0x1c973f,null))[_0x1d68('0x20')](function(_0x188a88){if(_0x188a88){_0x562506[_0x1d68('0x42')]=_['keys'](db[_0x1d68('0x6c')][_0x1d68('0x3e')]);_0x562506[_0x1d68('0x43')]=_[_0x1d68('0x44')](_0xe945a3['query']);_0x562506[_0x1d68('0x45')]=_[_0x1d68('0x46')](_0x562506[_0x1d68('0x42')],_0x562506[_0x1d68('0x43')]);_0x473641[_0x1d68('0x48')]=_[_0x1d68('0x46')](_0x562506['model'],qs['fields'](_0xe945a3[_0x1d68('0x43')][_0x1d68('0x47')]));_0x473641[_0x1d68('0x48')]=_0x473641[_0x1d68('0x48')][_0x1d68('0x49')]?_0x473641[_0x1d68('0x48')]:_0x562506[_0x1d68('0x42')];if(!_0xe945a3['query'][_0x1d68('0x4a')](_0x1d68('0x69'))){_0x473641['limit']=qs['limit'](_0xe945a3['query']['limit']);_0x473641[_0x1d68('0x2e')]=qs[_0x1d68('0x2e')](_0xe945a3['query'][_0x1d68('0x2e')]);}_0x473641[_0x1d68('0x6e')]=qs[_0x1d68('0x4b')](_0xe945a3[_0x1d68('0x43')][_0x1d68('0x4b')]);_0x473641[_0x1d68('0x4c')]=qs[_0x1d68('0x45')](_[_0x1d68('0x4d')](_0xe945a3[_0x1d68('0x43')],_0x562506[_0x1d68('0x45')]));_0x473641[_0x1d68('0x4c')][_0x1d68('0x6f')]=_0x188a88['id'];if(_0xe945a3[_0x1d68('0x43')][_0x1d68('0x4e')]){_0x473641[_0x1d68('0x4c')]=_[_0x1d68('0x4f')](_0x473641[_0x1d68('0x4c')],{'$or':_[_0x1d68('0x3d')](_0x473641[_0x1d68('0x48')],function(_0x538dfb){var _0x4b31a3={};_0x4b31a3[_0x538dfb]={'$like':'%'+_0xe945a3['query'][_0x1d68('0x4e')]+'%'};return _0x4b31a3;})});}_0x473641=_['merge']({},_0x473641,_0xe945a3[_0x1d68('0x51')]);return db['CannedAnswer'][_0x1d68('0x31')]({'where':_0x473641[_0x1d68('0x4c')]})['then'](function(_0x5d1a27){_0x3b20e8[_0x1d68('0x31')]=_0x5d1a27;if(_0xe945a3[_0x1d68('0x43')]['includeAll']){_0x473641['include']=[{'all':!![]}];}return db[_0x1d68('0x6c')][_0x1d68('0x54')](_0x473641);})[_0x1d68('0x20')](function(_0x46fa89){_0x3b20e8[_0x1d68('0x55')]=_0x46fa89;return _0x3b20e8;});}})[_0x1d68('0x20')](respondWithFilteredResult(_0x1c973f,_0x473641))[_0x1d68('0x29')](handleError(_0x1c973f,null));};exports['removeAnswers']=function(_0x1f06a7,_0x438285,_0x176e9e){return db[_0x1d68('0x52')][_0x1d68('0x5d')]({'where':{'id':_0x1f06a7[_0x1d68('0x65')]['id']}})[_0x1d68('0x20')](handleEntityNotFound(_0x438285,null))[_0x1d68('0x20')](function(_0x1fbce9){if(_0x1fbce9){return _0x1fbce9[_0x1d68('0x70')](_0x1f06a7[_0x1d68('0x43')][_0x1d68('0x6b')]);}})['then'](respondWithStatusCode(_0x438285,null))[_0x1d68('0x29')](handleError(_0x438285,null));};exports[_0x1d68('0x71')]=function(_0x527eab,_0x310bbb,_0x1df18d){var _0x22448d={'channel':'sms'};var _0x1c1f31=[];var _0x35490b=[];var _0x3ec949={};return db[_0x1d68('0x52')][_0x1d68('0x5d')]({'where':{'id':_0x527eab[_0x1d68('0x65')]['id']},'include':[{'model':db[_0x1d68('0x72')],'as':_0x1d68('0x73')}]})[_0x1d68('0x20')](handleEntityNotFound(_0x310bbb,null))[_0x1d68('0x20')](function(_0x2375d3){_0x22448d[_0x1d68('0x74')]=_0x2375d3;_0x22448d[_0x1d68('0x75')]=_[_0x1d68('0x76')](_0x2375d3['Applications'],['priority'],['asc']);if(_0x22448d[_0x1d68('0x74')]['Applications']){delete _0x22448d[_0x1d68('0x74')][_0x1d68('0x73')];}return db['CmContact'][_0x1d68('0x63')]();})[_0x1d68('0x20')](function(_0x32f8dd){if(!_0x32f8dd){throw new db['Sequelize'][(_0x1d68('0x77'))](_0x1d68('0x78'));}_0x1c1f31=_[_0x1d68('0x79')](_['keys'](_0x32f8dd),['createdAt',_0x1d68('0x7a')]);_0x35490b=_['difference'](_[_0x1d68('0x44')](_0x32f8dd),[_0x1d68('0x7b'),_0x1d68('0x7a'),_0x1d68('0x7c'),_0x1d68('0x7d')]);_0x22448d[_0x1d68('0x59')]={'mapKey':_0x1d68('0x7e')};if(_0x22448d[_0x1d68('0x74')][_0x1d68('0x40')]){switch(_0x22448d['account'][_0x1d68('0x40')]){case _0x1d68('0x7f'):_0x22448d[_0x1d68('0x59')][_0x1d68('0x80')]=_0x527eab[_0x1d68('0x59')][_0x1d68('0x81')];_0x22448d[_0x1d68('0x59')][_0x1d68('0x59')]=_0x527eab[_0x1d68('0x59')]['Body'];_0x22448d['body'][_0x1d68('0x82')]=_0x527eab[_0x1d68('0x59')][_0x1d68('0x83')];break;case _0x1d68('0x84'):_0x22448d[_0x1d68('0x59')]['from']='+'+_0x527eab['body'][_0x1d68('0x85')];_0x22448d[_0x1d68('0x59')][_0x1d68('0x59')]=_0x527eab[_0x1d68('0x59')][_0x1d68('0x86')];break;case'connectel':_0x22448d['body'][_0x1d68('0x80')]=_0x527eab[_0x1d68('0x59')][_0x1d68('0x80')];_0x22448d[_0x1d68('0x59')][_0x1d68('0x59')]=_0x527eab['body']['message'];break;case'clicksend':_0x22448d['body']['from']=_0x527eab['body']['from'];_0x22448d['body'][_0x1d68('0x59')]=_0x527eab[_0x1d68('0x59')]['body'];_0x22448d[_0x1d68('0x59')][_0x1d68('0x82')]=_0x527eab[_0x1d68('0x59')]['message_id'];break;case _0x1d68('0x87'):_0x22448d[_0x1d68('0x59')]['from']=_0x527eab[_0x1d68('0x59')][_0x1d68('0x81')];_0x22448d[_0x1d68('0x59')][_0x1d68('0x59')]=_0x527eab[_0x1d68('0x59')][_0x1d68('0x88')];_0x22448d[_0x1d68('0x59')][_0x1d68('0x82')]=_0x527eab[_0x1d68('0x59')][_0x1d68('0x89')];break;case _0x1d68('0x8a'):_0x22448d[_0x1d68('0x59')][_0x1d68('0x80')]='+'+_0x527eab['body'][_0x1d68('0x8b')][0x0]['from'];_0x22448d[_0x1d68('0x59')][_0x1d68('0x59')]=_0x527eab[_0x1d68('0x59')][_0x1d68('0x8b')][0x0][_0x1d68('0x86')];_0x22448d[_0x1d68('0x59')][_0x1d68('0x82')]=_0x527eab[_0x1d68('0x59')][_0x1d68('0x8b')][0x0]['messageId'];break;case _0x1d68('0x8c'):_0x22448d[_0x1d68('0x59')]['from']=_0x527eab[_0x1d68('0x59')][_0x1d68('0x8d')];_0x22448d[_0x1d68('0x59')][_0x1d68('0x59')]=_0x527eab[_0x1d68('0x59')][_0x1d68('0x8e')][_0x1d68('0x28')];break;case _0x1d68('0x8f'):_0x22448d[_0x1d68('0x59')]['from']=_0x527eab[_0x1d68('0x59')][_0x1d68('0x90')];_0x22448d[_0x1d68('0x59')][_0x1d68('0x59')]=_0x527eab['body'][_0x1d68('0x86')];_0x22448d['body'][_0x1d68('0x82')]=_0x527eab[_0x1d68('0x59')][_0x1d68('0x91')];break;case _0x1d68('0x92'):_0x22448d['body'][_0x1d68('0x82')]=_0x527eab[_0x1d68('0x59')][0x0][_0x1d68('0x28')]['id'];_0x22448d[_0x1d68('0x59')][_0x1d68('0x80')]=_0x527eab[_0x1d68('0x59')][0x0]['message'][_0x1d68('0x80')];_0x22448d['body'][_0x1d68('0x59')]=_0x527eab[_0x1d68('0x59')][0x0]['message'][_0x1d68('0x86')];break;case _0x1d68('0x93'):_0x22448d[_0x1d68('0x59')][_0x1d68('0x80')]=_0x527eab[_0x1d68('0x59')][_0x1d68('0x80')];_0x22448d[_0x1d68('0x59')][_0x1d68('0x59')]=_0x527eab[_0x1d68('0x59')][_0x1d68('0x28')];_0x22448d[_0x1d68('0x59')]['messageId']=_0x527eab[_0x1d68('0x59')][_0x1d68('0x94')];break;}}if(_0x22448d['body']['id']){delete _0x22448d[_0x1d68('0x59')]['id'];}if(_[_0x1d68('0x95')](_0x22448d[_0x1d68('0x59')][_0x1d68('0x80')])){throw new db[(_0x1d68('0x96'))][(_0x1d68('0x77'))](_0x1d68('0x97'));}if(_[_0x1d68('0x95')](_0x22448d[_0x1d68('0x59')][_0x1d68('0x59')])||_0x22448d['body'][_0x1d68('0x59')]===''){throw new db[(_0x1d68('0x96'))]['ValidationError'](_0x1d68('0x98'));}if(_['isNil'](_0x22448d[_0x1d68('0x59')][_0x1d68('0x99')])){throw new db[(_0x1d68('0x96'))][(_0x1d68('0x77'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x35490b);}if(!_[_0x1d68('0x9a')](_0x35490b,_0x22448d[_0x1d68('0x59')][_0x1d68('0x99')])){throw new db[(_0x1d68('0x96'))][(_0x1d68('0x77'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x35490b);}_0x3ec949[_0x22448d[_0x1d68('0x59')][_0x1d68('0x99')]]=_0x22448d[_0x1d68('0x59')][_0x1d68('0x80')];return db[_0x1d68('0x9b')][_0x1d68('0x5d')]({'where':{'id':_0x22448d['account']['ListId']},'include':[{'model':db['CmContact'],'as':_0x1d68('0x9c'),'where':_0x3ec949,'limit':0x1,'order':[[_0x1d68('0x7a'),'DESC']]}]});})[_0x1d68('0x20')](handleEntityNotFound(_0x310bbb,null))[_0x1d68('0x20')](function(_0x48ee02){if(_0x48ee02){_0x22448d[_0x1d68('0x9d')]=_['omit'](_0x48ee02,[_0x1d68('0x9c')]);if(_0x48ee02[_0x1d68('0x9c')][_0x1d68('0x49')]){return _0x48ee02[_0x1d68('0x9c')][0x0];}var _0x1fbdf3=_[_0x1d68('0x1a')](_0x22448d[_0x1d68('0x59')],{'firstName':_0x22448d[_0x1d68('0x59')][_0x1d68('0x80')],'ListId':_0x48ee02['id']});_0x1fbdf3[_0x22448d[_0x1d68('0x59')][_0x1d68('0x99')]]=_0x22448d[_0x1d68('0x59')][_0x1d68('0x80')];return db[_0x1d68('0x9e')][_0x1d68('0x58')](_0x1fbdf3,{'fields':_0x1c1f31,'raw':!![]});}})[_0x1d68('0x20')](handleEntityNotFound(_0x310bbb,null))[_0x1d68('0x20')](function(_0x41f6cf){if(_0x41f6cf){_0x22448d['contact']=_0x41f6cf;var _0x40afd5={'ContactId':_0x41f6cf['id'],'phone':_0x22448d[_0x1d68('0x59')][_0x1d68('0x80')],'SmsAccountId':_0x527eab[_0x1d68('0x65')]['id']};var _0x44400a={'ContactId':_0x41f6cf['id'],'SmsAccountId':_0x527eab[_0x1d68('0x65')]['id'],'closed':![]};return db[_0x1d68('0x9f')][_0x1d68('0x5d')]({'where':_0x44400a})['then'](function(_0x375872){if(_0x375872){return[_0x375872,![]];}return db['SmsInteraction']['create'](_0x40afd5)['then'](function(_0x240eef){return[_0x240eef,!![]];});});}})['spread'](function(_0x425023,_0x48f566){_0x22448d[_0x1d68('0xa0')]=_0x425023[_0x1d68('0x38')]({'plain':!![]});_0x22448d[_0x1d68('0xa0')]['created']=![];if(_0x48f566){if(_0x22448d[_0x1d68('0x74')][_0x1d68('0xa1')]){_0x22448d['applications'][_0x1d68('0xa2')]({'id':0x0,'priority':_0x22448d[_0x1d68('0x75')]['length']+0x1,'app':_0x1d68('0xa3'),'appdata':_0x1d68('0xa4'),'interval':_0x1d68('0xa5')});}_0x22448d['interaction'][_0x1d68('0xa6')]=!![];}return db[_0x1d68('0xa7')][_0x1d68('0x58')]({'phone':_0x22448d[_0x1d68('0x59')][_0x1d68('0x80')],'messageId':_0x22448d[_0x1d68('0x59')][_0x1d68('0x82')],'body':_0x22448d['body']['body'],'SmsAccountId':_0x527eab[_0x1d68('0x65')]['id'],'SmsInteractionId':_0x425023['id'],'direction':'in','ContactId':_0x425023[_0x1d68('0xa8')],'AttachmentId':_0x22448d[_0x1d68('0x59')]['AttachmentId']});})[_0x1d68('0x20')](function(_0x498569){_0x22448d[_0x1d68('0x28')]=_0x498569;if(!_0x22448d[_0x1d68('0xa0')]['UserId'])return;return db['User'][_0x1d68('0x5d')]({'attributes':['id','name'],'where':{'id':_0x22448d[_0x1d68('0xa0')]['UserId']}});})[_0x1d68('0x20')](function(_0x4e659a){if(_0x4e659a){_0x22448d['applications'][_0x1d68('0xa9')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x4e659a[_0x1d68('0x39')]+','+(_0x22448d['account']['waitForTheAssignedAgent']||0xa),'interval':_0x1d68('0xa5')});}if(!_0x22448d[_0x1d68('0xa0')][_0x1d68('0xaa')])return;return db[_0x1d68('0xab')][_0x1d68('0x5d')]({'attributes':['id',_0x1d68('0x39')],'where':{'id':_0x22448d[_0x1d68('0xa0')][_0x1d68('0xaa')]}});})[_0x1d68('0x20')](function(_0x4438c){if(_0x4438c){_0x22448d[_0x1d68('0x75')][_0x1d68('0xa9')]({'id':0x0,'priority':0x1,'app':_0x1d68('0xac'),'appdata':_0x4438c[_0x1d68('0x39')]+','+(_0x22448d[_0x1d68('0x74')]['waitForTheAssignedQueue']||0x12c),'interval':_0x1d68('0xa5')});}return respondWithRpcPromise(_0x1d68('0xad'),_0x1d68('0xae'),_0x22448d);})[_0x1d68('0x20')](function(_0xd3ac41){if(_0xd3ac41){var _0x3cc932=0xc8;var _0x4c95b9=_0x1d68('0xaf');logger[_0x1d68('0x21')](_0x1d68('0xb0'),_0x4c95b9,_0x3cc932,_0x1d68('0xb1'));logger[_0x1d68('0x24')](_0x1d68('0xb2'),_0x4c95b9,_0x3cc932,_0x1d68('0xb1'),JSON[_0x1d68('0x25')](_0xd3ac41));if(_0x22448d['account']['type']===_0x1d68('0x7f')){return _0x310bbb[_0x1d68('0x2b')](_0x3cc932)[_0x1d68('0x32')](_0x1d68('0xb3'),'text/xml')[_0x1d68('0xb4')](_0x1d68('0xb5'));}else{return _0x310bbb['status'](_0x3cc932)[_0x1d68('0x2d')](_0xd3ac41);}}})[_0x1d68('0x29')](handleError(_0x310bbb,null));};exports[_0x1d68('0xb6')]=function(_0x5cea1d,_0x34e32c){var _0x485fd7=_0x5cea1d[_0x1d68('0x65')]['id'];var _0x5dda3c=_0x5cea1d['body'];var _0x1d9fde=0xc8;var _0x10fcd2=null;return db['sequelize'][_0x1d68('0xb7')]({'isolationLevel':db[_0x1d68('0xb8')]['Transaction'][_0x1d68('0xb9')][_0x1d68('0xba')]},function(_0x56ede5){return db[_0x1d68('0x52')][_0x1d68('0x67')]({'where':{'id':_0x485fd7},'transaction':_0x56ede5})[_0x1d68('0x20')](function(_0x4056fd){if(_0x4056fd){return db[_0x1d68('0x72')][_0x1d68('0x62')]({'where':{'SmsAccountId':_0x485fd7},'transaction':_0x56ede5})[_0x1d68('0x20')](function(){var _0xcc06f9=_['map'](_0x5dda3c,function(_0xc0bdee){_0xc0bdee['SmsAccountId']=_0x485fd7;return _0xc0bdee;});return db[_0x1d68('0x72')]['bulkCreate'](_0xcc06f9,{'transaction':_0x56ede5});});}else{_0x1d9fde=0x194;_0x10fcd2=[];}});})[_0x1d68('0x20')](function(){if(_0x1d9fde!==0x194){return db[_0x1d68('0x72')]['findAndCountAll']({'where':{'SmsAccountId':_0x485fd7},'order':'priority'})[_0x1d68('0x20')](function(_0x4e258f){_0x10fcd2=_0x4e258f;});}})['catch'](function(_0x4efbf0){_0x1d9fde=0x1f4;logger[_0x1d68('0x26')](_0x4efbf0['stack']);if(_0x4efbf0[_0x1d68('0x39')]){delete _0x4efbf0[_0x1d68('0x39')];}_0x10fcd2=_0x4efbf0;})[_0x1d68('0xbb')](function(){if(_0x10fcd2===null){_0x34e32c[_0x1d68('0x2a')](_0x1d9fde);}else{if(_0x1d9fde===0x1f4){_0x34e32c['status'](_0x1d9fde)[_0x1d68('0xb4')](_0x10fcd2);}else{_0x34e32c['status'](_0x1d9fde)[_0x1d68('0x2d')](_0x10fcd2);}}});};exports[_0x1d68('0xbc')]=function(_0xbe0bbb,_0x1d54aa,_0x2c57a7){var _0x54782a={};var _0x5cd218={};var _0x11ed9b;var _0x3c2886;return db['SmsAccount'][_0x1d68('0x67')]({'where':{'id':_0xbe0bbb[_0x1d68('0x65')]['id']}})['then'](handleEntityNotFound(_0x1d54aa,null))[_0x1d68('0x20')](function(_0x28c931){if(_0x28c931){_0x11ed9b=_0x28c931;_0x5cd218[_0x1d68('0x42')]=_[_0x1d68('0x44')](db[_0x1d68('0x72')]['rawAttributes']);_0x5cd218['query']=_['keys'](_0xbe0bbb[_0x1d68('0x43')]);_0x5cd218[_0x1d68('0x45')]=_['intersection'](_0x5cd218[_0x1d68('0x42')],_0x5cd218[_0x1d68('0x43')]);_0x54782a[_0x1d68('0x48')]=_['intersection'](_0x5cd218[_0x1d68('0x42')],qs[_0x1d68('0x47')](_0xbe0bbb[_0x1d68('0x43')]['fields']));_0x54782a['attributes']=_0x54782a[_0x1d68('0x48')]['length']?_0x54782a[_0x1d68('0x48')]:_0x5cd218[_0x1d68('0x42')];_0x54782a[_0x1d68('0x6e')]=qs[_0x1d68('0x4b')](_0xbe0bbb[_0x1d68('0x43')][_0x1d68('0x4b')]);_0x54782a[_0x1d68('0x4c')]=qs[_0x1d68('0x45')](_[_0x1d68('0x4d')](_0xbe0bbb[_0x1d68('0x43')],_0x5cd218[_0x1d68('0x45')]));if(_0xbe0bbb[_0x1d68('0x43')]['filter']){_0x54782a[_0x1d68('0x4c')]=_[_0x1d68('0x4f')](_0x54782a[_0x1d68('0x4c')],{'$or':_[_0x1d68('0x3d')](_0x54782a[_0x1d68('0x48')],function(_0x5dc5c8){var _0x22b5f1={};_0x22b5f1[_0x5dc5c8]={'$like':'%'+_0xbe0bbb[_0x1d68('0x43')][_0x1d68('0x4e')]+'%'};return _0x22b5f1;})});}_0x54782a=_[_0x1d68('0x4f')]({},_0x54782a,_0xbe0bbb['options']);return _0x11ed9b[_0x1d68('0xbc')](_0x54782a);}})[_0x1d68('0x20')](function(_0x3a139f){if(_0x3a139f){_0x3c2886=_0x3a139f[_0x1d68('0x49')];if(!_0xbe0bbb[_0x1d68('0x43')][_0x1d68('0x4a')](_0x1d68('0x69'))){_0x54782a['limit']=qs[_0x1d68('0x30')](_0xbe0bbb[_0x1d68('0x43')][_0x1d68('0x30')]);_0x54782a[_0x1d68('0x2e')]=qs[_0x1d68('0x2e')](_0xbe0bbb[_0x1d68('0x43')][_0x1d68('0x2e')]);}return _0x11ed9b[_0x1d68('0xbc')](_0x54782a);}})[_0x1d68('0x20')](function(_0x2bc637){if(_0x2bc637){return _0x2bc637?{'count':_0x3c2886,'rows':_0x2bc637}:null;}})[_0x1d68('0x20')](respondWithResult(_0x1d54aa,null))['catch'](handleError(_0x1d54aa,null));};exports[_0x1d68('0xbd')]=function(_0x45bb0d,_0x376aaf,_0x4593d5){var _0xaece4a={'raw':![],'where':{}};var _0x4a6233={};var _0x3abc10={'count':0x0,'rows':[]};return db[_0x1d68('0x52')][_0x1d68('0x67')]({'where':{'id':_0x45bb0d[_0x1d68('0x65')]['id']}})[_0x1d68('0x20')](handleEntityNotFound(_0x376aaf,null))[_0x1d68('0x20')](function(_0x2084d3){if(_0x2084d3){_0x4a6233[_0x1d68('0x42')]=_[_0x1d68('0x44')](db[_0x1d68('0x9f')][_0x1d68('0x3e')]);_0x4a6233['query']=_['keys'](_0x45bb0d[_0x1d68('0x43')]);_0x4a6233[_0x1d68('0x45')]=_[_0x1d68('0x46')](_0x4a6233[_0x1d68('0x42')],_0x4a6233[_0x1d68('0x43')]);_0xaece4a[_0x1d68('0x48')]=_[_0x1d68('0x46')](_0x4a6233[_0x1d68('0x42')],qs[_0x1d68('0x47')](_0x45bb0d['query'][_0x1d68('0x47')]));_0xaece4a['attributes']=_0xaece4a['attributes']['length']?_0xaece4a[_0x1d68('0x48')]:_0x4a6233[_0x1d68('0x42')];if(!_0x45bb0d[_0x1d68('0x43')][_0x1d68('0x4a')]('nolimit')){_0xaece4a[_0x1d68('0x30')]=qs['limit'](_0x45bb0d[_0x1d68('0x43')][_0x1d68('0x30')]);_0xaece4a[_0x1d68('0x2e')]=qs['offset'](_0x45bb0d[_0x1d68('0x43')][_0x1d68('0x2e')]);}_0xaece4a[_0x1d68('0x6e')]=qs[_0x1d68('0x4b')](_0x45bb0d[_0x1d68('0x43')][_0x1d68('0x4b')]);_0xaece4a[_0x1d68('0x4c')]=qs[_0x1d68('0x45')](_[_0x1d68('0x4d')](_0x45bb0d[_0x1d68('0x43')],_0x4a6233[_0x1d68('0x45')]));_0xaece4a[_0x1d68('0x4c')][_0x1d68('0x6f')]=_0x2084d3['id'];if(_0x45bb0d[_0x1d68('0x43')][_0x1d68('0x4e')]){_0xaece4a['where']=_[_0x1d68('0x4f')](_0xaece4a[_0x1d68('0x4c')],{'$or':_[_0x1d68('0x3d')](_0xaece4a[_0x1d68('0x48')],function(_0x4bb95f){var _0x237f00={};_0x237f00[_0x4bb95f]={'$like':'%'+_0x45bb0d[_0x1d68('0x43')][_0x1d68('0x4e')]+'%'};return _0x237f00;})});}_0xaece4a=_[_0x1d68('0x4f')]({},_0xaece4a,_0x45bb0d['options']);return db[_0x1d68('0x9f')][_0x1d68('0x31')]({'where':_0xaece4a['where']})[_0x1d68('0x20')](function(_0x547e87){_0x3abc10[_0x1d68('0x31')]=_0x547e87;if(_0x45bb0d[_0x1d68('0x43')]['includeAll']){_0xaece4a[_0x1d68('0x57')]=[{'model':db[_0x1d68('0x9e')],'as':'Contact','required':![]},{'model':db[_0x1d68('0xbe')],'as':'Owner','attributes':['name','fullname',_0x1d68('0xbf')],'required':![]},{'model':db[_0x1d68('0xc0')],'as':_0x1d68('0xc1'),'attributes':['id',_0x1d68('0x39'),_0x1d68('0xc2')],'where':_0x45bb0d['query'][_0x1d68('0xc3')]?{'id':_0x45bb0d[_0x1d68('0x43')]['tag']}:undefined,'required':_0x45bb0d[_0x1d68('0x43')][_0x1d68('0xc3')]?!![]:![]}];}return db[_0x1d68('0x9f')][_0x1d68('0x54')](_0xaece4a);})[_0x1d68('0x20')](function(_0x4f0496){_0x3abc10[_0x1d68('0x55')]=_0x4f0496;return _0x3abc10;});}})[_0x1d68('0x20')](respondWithFilteredResult(_0x376aaf,_0xaece4a))[_0x1d68('0x29')](handleError(_0x376aaf,null));};exports[_0x1d68('0xb4')]=function(_0x25d770,_0x199927,_0x1ba797){var _0x1cfab1,_0x18d10d,_0x364377;if(_['isNil'](_0x25d770[_0x1d68('0x59')][_0x1d68('0x59')])||_0x25d770[_0x1d68('0x59')][_0x1d68('0x59')]===''){throw new db['Sequelize'][(_0x1d68('0x77'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x1d68('0x95')](_0x25d770[_0x1d68('0x59')]['to'])){throw new db['Sequelize'][(_0x1d68('0x77'))](_0x1d68('0xc4'));}_0x1cfab1=_0x25d770[_0x1d68('0x59')]['to'];return db['SmsAccount'][_0x1d68('0x5d')]({'where':{'id':_0x25d770['params']['id']},'include':[{'model':db[_0x1d68('0x9b')],'as':_0x1d68('0xc5'),'include':[{'model':db['CmContact'],'as':_0x1d68('0x9c'),'where':{'mobile':_0x1cfab1},'limit':0x1,'order':[[_0x1d68('0x7a'),'DESC']]}]}]})[_0x1d68('0x20')](handleEntityNotFound(_0x199927,null))[_0x1d68('0x20')](function(_0x12e381){if(_0x12e381&&_0x12e381['List']){_0x18d10d=_0x12e381['get']({'plain':!![]});if(_0x18d10d[_0x1d68('0xc5')]&&_0x18d10d[_0x1d68('0xc5')][_0x1d68('0x9c')][_0x1d68('0x49')]){return _0x18d10d['List']['Contacts'][0x0];}return db[_0x1d68('0x9e')]['create'](_[_0x1d68('0x1a')](_0x25d770[_0x1d68('0x59')],{'firstName':_0x1cfab1,'mobile':_0x1cfab1,'phone':_0x1cfab1,'ListId':_0x18d10d[_0x1d68('0x7d')]}));}})[_0x1d68('0x20')](handleEntityNotFound(_0x199927,null))['then'](function(_0x2157a6){if(_0x2157a6){_0x364377=_0x2157a6;return db[_0x1d68('0x9f')][_0x1d68('0x5d')]({'where':{'ContactId':_0x364377['id'],'closed':![],'SmsAccountId':_0x18d10d['id']}})[_0x1d68('0x20')](function(_0x2d7404){if(_0x2d7404){return[_0x2d7404,![]];}return db[_0x1d68('0x9f')][_0x1d68('0x58')]({'UserId':_0x25d770['user']['id'],'ContactId':_0x364377['id'],'SmsAccountId':_0x18d10d['id'],'phone':_0x1cfab1,'firstMsgDirection':'out','Messages':[_[_0x1d68('0x4f')](_0x25d770[_0x1d68('0x59')],{'read':![],'body':_0x25d770['body'][_0x1d68('0x59')],'phone':_0x1cfab1,'SmsAccountId':_0x18d10d['id'],'UserId':_0x25d770['user']['id'],'ContactId':_0x364377['id']})]},{'include':[{'model':db[_0x1d68('0xa7')],'as':'Messages'}]})[_0x1d68('0x20')](function(_0x2cfca8){return[_0x2cfca8,!![]];});});}})[_0x1d68('0xc6')](function(_0x360a2e,_0x314d34){if(_0x314d34){return _0x360a2e;}return db[_0x1d68('0xa7')]['create'](_[_0x1d68('0x4f')](_0x25d770['body'],{'read':![],'body':_0x25d770[_0x1d68('0x59')][_0x1d68('0x59')],'phone':_0x1cfab1,'SmsAccountId':_0x18d10d['id'],'SmsInteractionId':_0x360a2e['id'],'UserId':_0x25d770[_0x1d68('0x5a')]['id'],'ContactId':_0x364377['id']}))[_0x1d68('0x20')](function(_0x1233ab){_0x360a2e[_0x1d68('0xc7')][_0x1d68('0xc8')]=[];_0x360a2e[_0x1d68('0xc7')][_0x1d68('0xc8')][_0x1d68('0xa2')](_0x1233ab[_0x1d68('0xc7')]);return _0x360a2e;});})[_0x1d68('0x20')](respondWithResult(_0x199927,null))[_0x1d68('0x29')](handleError(_0x199927,null));};exports[_0x1d68('0x2b')]=function(_0x439930,_0x5ba62b,_0x6d2e07){if(_0x439930[_0x1d68('0x59')]['id']){delete _0x439930[_0x1d68('0x59')]['id'];}var _0x33d7f0,_0x18ec0f,_0x5cbe9a;return db[_0x1d68('0x52')]['find']({'where':{'id':_0x439930[_0x1d68('0x65')]['id']}})[_0x1d68('0x20')](handleEntityNotFound(_0x5ba62b,null))[_0x1d68('0x20')](function(_0x28e086){if(_0x28e086){_0x5cbe9a=_0x28e086;logger[_0x1d68('0x24')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x1d68('0x2b'),'received\x20delivery\x20report\x20from',_0x28e086[_0x1d68('0x40')],util[_0x1d68('0xc9')](_0x439930[_0x1d68('0x59')],{'showHidden':![],'depth':null}));switch(_0x28e086['type']){case'skebby':if(_0x439930[_0x1d68('0x59')][_0x1d68('0xca')]&&_0x439930[_0x1d68('0x59')][_0x1d68('0x2b')]){_0x18ec0f=_0x439930['body'][_0x1d68('0x2b')];return db['SmsMessage'][_0x1d68('0x5d')]({'where':{'messageId':_0x439930[_0x1d68('0x59')]['skebby_dispatch_id']}});}break;case'connectel':if(_0x439930[_0x1d68('0x59')][_0x1d68('0xcb')]&&_0x439930['body']['statusInt']){_0x18ec0f=_0x439930[_0x1d68('0x59')][_0x1d68('0xcc')];return db[_0x1d68('0xa7')][_0x1d68('0x5d')]({'where':{'messageId':_0x439930[_0x1d68('0x59')]['requestid']}});}break;case _0x1d68('0xcd'):if(_0x439930['body']['message_id']&&_0x439930['body'][_0x1d68('0xce')]){_0x18ec0f=_0x439930[_0x1d68('0x59')][_0x1d68('0xce')];return db['SmsMessage'][_0x1d68('0x5d')]({'where':{'messageId':_0x439930[_0x1d68('0x59')]['message_id']}});}break;case _0x1d68('0x8a'):var _0x180f07=_0x439930['body'][_0x1d68('0x8b')][0x0];if(_0x180f07[_0x1d68('0x82')]&&_0x180f07[_0x1d68('0x2b')][_0x1d68('0xcf')]===_0x1d68('0xd0')){_0x18ec0f=_0x180f07[_0x1d68('0x2b')][_0x1d68('0xcf')];return db['SmsMessage'][_0x1d68('0x5d')]({'where':{'messageId':_0x180f07[_0x1d68('0x82')]}});}break;case _0x1d68('0x8f'):if(_0x439930[_0x1d68('0x59')][_0x1d68('0x82')]&&_0x439930[_0x1d68('0x59')][_0x1d68('0x2b')]){_0x18ec0f=_0x439930[_0x1d68('0x59')][_0x1d68('0x2b')];return db[_0x1d68('0xa7')]['find']({'where':{'messageId':_0x439930[_0x1d68('0x59')]['messageId']}});}break;case _0x1d68('0x92'):if(_0x439930[_0x1d68('0x59')][0x0][_0x1d68('0x28')]['id']){_0x18ec0f=_0x439930['body'][0x0][_0x1d68('0x40')];return db[_0x1d68('0xa7')][_0x1d68('0x5d')]({'where':{'messageId':_0x439930[_0x1d68('0x59')][0x0][_0x1d68('0x28')]['id']}});}break;case'intelepeer':if(_0x439930['body'][_0x1d68('0xd1')]&&_0x439930[_0x1d68('0x59')][_0x1d68('0x2b')]){_0x18ec0f=_0x439930['body'][_0x1d68('0x2b')];return db[_0x1d68('0xa7')][_0x1d68('0x5d')]({'where':{'messageId':_0x439930[_0x1d68('0x59')][_0x1d68('0xd1')]}});}break;}}})[_0x1d68('0x20')](handleEntityNotFound(_0x5ba62b,null))[_0x1d68('0x20')](function(_0x43bc7f){if(_0x43bc7f){_0x33d7f0=_0x43bc7f;switch(_0x5cbe9a['type']){case _0x1d68('0x84'):if(_0x18ec0f==='DELIVERED'){return _0x33d7f0['update']({'read':!![]});}else{logger[_0x1d68('0x26')]('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0x1d68('0x84'),util['inspect'](_0x439930[_0x1d68('0x59')],{'showHidden':![],'depth':null}));}break;case _0x1d68('0xd2'):if(_0x18ec0f==='1'){return _0x33d7f0[_0x1d68('0x37')]({'read':!![]});}else{logger['error'](_0x1d68('0xb0'),'status',_0x1d68('0x84'),util[_0x1d68('0xc9')](_0x439930['body'],{'showHidden':![],'depth':null}));}break;case _0x1d68('0xcd'):if(!_0x439930[_0x1d68('0x59')][_0x1d68('0xd3')]&&_0x18ec0f>=0xc8&&_0x18ec0f<=0xce){return _0x33d7f0[_0x1d68('0x37')]({'read':!![]});}else{logger[_0x1d68('0x26')](_0x1d68('0xb0'),_0x1d68('0x2b'),_0x1d68('0xcd'),util[_0x1d68('0xc9')](_0x439930[_0x1d68('0x59')],{'showHidden':![],'depth':null}));}break;case _0x1d68('0x8a'):var _0x33e19c=_0x439930[_0x1d68('0x59')][_0x1d68('0x8b')][0x0];if(_0x33e19c['status'][_0x1d68('0xcf')]===_0x1d68('0xd0')){return _0x33d7f0[_0x1d68('0x37')]({'read':!![]});}else{logger[_0x1d68('0x26')]('SmsAccount,\x20%s,\x20%s,\x20%s','status','infobip',util[_0x1d68('0xc9')](_0x439930[_0x1d68('0x59')],{'showHidden':![],'depth':null}));}break;case _0x1d68('0x8f'):if(_0x18ec0f==_0x1d68('0xd4')||_0x18ec0f==_0x1d68('0xd5')){return _0x33d7f0[_0x1d68('0x37')]({'read':!![]});}else{logger[_0x1d68('0x26')](_0x1d68('0xb0'),'status','clickatell',util['inspect'](_0x439930[_0x1d68('0x59')],{'showHidden':![],'depth':null}));}break;case'bandwidth':if(_0x18ec0f==_0x1d68('0xd6')){return _0x33d7f0[_0x1d68('0x37')]({'read':!![]});}else{logger[_0x1d68('0x26')](_0x1d68('0xb0'),_0x1d68('0x2b'),_0x1d68('0x92'),util[_0x1d68('0xc9')](_0x439930[_0x1d68('0x59')],{'showHidden':![],'depth':null}));}break;case _0x1d68('0x93'):if(_0x18ec0f===_0x1d68('0xd7')||_0x18ec0f===_0x1d68('0xd8')){return _0x33d7f0[_0x1d68('0x37')]({'read':!![]});}else{logger[_0x1d68('0x26')](_0x1d68('0xb0'),_0x1d68('0x2b'),_0x1d68('0x93'),util[_0x1d68('0xc9')](_0x439930['body'],{'showHidden':![],'depth':null}));}break;}return _0x33d7f0;}})['then'](respondWithResult(_0x5ba62b,null))[_0x1d68('0x29')](handleError(_0x5ba62b,null));};exports['statusGet']=function(_0x327372,_0x2e53e1,_0x4c5dd3){var _0x460d72,_0xb4c10f,_0x16a5e0;return db[_0x1d68('0x52')]['find']({'where':{'id':_0x327372[_0x1d68('0x65')]['id']}})[_0x1d68('0x20')](handleEntityNotFound(_0x2e53e1,null))['then'](function(_0x9912ca){if(_0x9912ca){_0x16a5e0=_0x9912ca;logger[_0x1d68('0x24')](_0x1d68('0xb0'),_0x1d68('0x2b'),_0x1d68('0xd9'),_0x9912ca[_0x1d68('0x40')],util[_0x1d68('0xc9')](_0x327372[_0x1d68('0x43')],{'showHidden':![],'depth':null}));switch(_0x9912ca[_0x1d68('0x40')]){case _0x1d68('0x8c'):if(_0x327372[_0x1d68('0x43')][_0x1d68('0xda')]&&_0x327372['query']['state']){_0xb4c10f=_0x327372[_0x1d68('0x43')]['state'];return db[_0x1d68('0xa7')][_0x1d68('0x5d')]({'where':{'messageId':_0x327372['query'][_0x1d68('0xda')]}});}break;}}})[_0x1d68('0x20')](handleEntityNotFound(_0x2e53e1,null))['then'](function(_0x5f3299){if(_0x5f3299){_0x460d72=_0x5f3299;switch(_0x16a5e0[_0x1d68('0x40')]){case _0x1d68('0x8c'):if(_0xb4c10f==='2'||_0xb4c10f==='6'){return _0x460d72[_0x1d68('0x37')]({'read':!![]});}else{logger['error'](_0x1d68('0xb0'),_0x1d68('0x2b'),_0x1d68('0x8c'),util['inspect'](_0x327372[_0x1d68('0x43')],{'showHidden':![],'depth':null}));};break;}return _0x460d72;}})[_0x1d68('0x20')](respondWithResult(_0x2e53e1,null))[_0x1d68('0x29')](handleError(_0x2e53e1,null));};exports[_0x1d68('0xdb')]=function(_0xa4f714,_0x2e0133,_0x390914){return db[_0x1d68('0x52')]['find']({'where':{'id':_0xa4f714['params']['id']}})[_0x1d68('0x20')](handleEntityNotFound(_0x2e0133,null))['then'](function(_0x3f9e89){if(_0x3f9e89){return _0x3f9e89[_0x1d68('0xdb')](_0xa4f714[_0x1d68('0x59')][_0x1d68('0x6b')],_[_0x1d68('0xdc')](_0xa4f714['body'],[_0x1d68('0x6b'),'id'])||{})['spread'](function(_0x5e1c9d){for(var _0x37d43b=0x0;_0x37d43b<_0xa4f714[_0x1d68('0x59')]['ids'][_0x1d68('0x49')];_0x37d43b+=0x1){socket[_0x1d68('0xdd')](_0x1d68('0xde'),{'UserId':Number(_0xa4f714[_0x1d68('0x59')][_0x1d68('0x6b')][_0x37d43b]),'SmsAccountId':Number(_0xa4f714[_0x1d68('0x65')]['id'])});}return _0x5e1c9d;});}})['then'](respondWithResult(_0x2e0133,null))[_0x1d68('0x29')](handleError(_0x2e0133,null));};exports[_0x1d68('0xdf')]=function(_0x34b6d5,_0x4f663c,_0x29e78e){return db[_0x1d68('0x52')][_0x1d68('0x5d')]({'where':{'id':_0x34b6d5['params']['id']}})[_0x1d68('0x20')](handleEntityNotFound(_0x4f663c,null))[_0x1d68('0x20')](function(_0xbc4b41){if(_0xbc4b41){return _0xbc4b41[_0x1d68('0xdf')](_0x34b6d5[_0x1d68('0x43')]['ids'])[_0x1d68('0x20')](function(){if(_[_0x1d68('0xe0')](_0x34b6d5[_0x1d68('0x43')][_0x1d68('0x6b')])){for(var _0x38e736=0x0;_0x38e736<_0x34b6d5['query']['ids'][_0x1d68('0x49')];_0x38e736+=0x1){socket[_0x1d68('0xdd')](_0x1d68('0xe1'),{'UserId':Number(_0x34b6d5[_0x1d68('0x43')]['ids'][_0x38e736]),'SmsAccountId':Number(_0x34b6d5[_0x1d68('0x65')]['id'])});}}else{socket['emit']('userSmsAccount:remove',{'UserId':Number(_0x34b6d5[_0x1d68('0x43')][_0x1d68('0x6b')]),'SmsAccountId':Number(_0x34b6d5[_0x1d68('0x65')]['id'])});}});}})[_0x1d68('0x20')](respondWithStatusCode(_0x4f663c,null))['catch'](handleError(_0x4f663c,null));};exports['getAgents']=function(_0x4e6ccc,_0x250ead,_0x5dbac6){var _0x58b5a8={};var _0x2e1902={};var _0x17fea2;var _0x5124d1;return db[_0x1d68('0x52')][_0x1d68('0x67')]({'where':{'id':_0x4e6ccc['params']['id']}})[_0x1d68('0x20')](handleEntityNotFound(_0x250ead,null))[_0x1d68('0x20')](function(_0x53637a){if(_0x53637a){_0x17fea2=_0x53637a;_0x2e1902['model']=_[_0x1d68('0x44')](db[_0x1d68('0xbe')][_0x1d68('0x3e')]);_0x2e1902[_0x1d68('0x43')]=_[_0x1d68('0x44')](_0x4e6ccc['query']);_0x2e1902[_0x1d68('0x45')]=_[_0x1d68('0x46')](_0x2e1902['model'],_0x2e1902[_0x1d68('0x43')]);_0x58b5a8[_0x1d68('0x48')]=_[_0x1d68('0x46')](_0x2e1902[_0x1d68('0x42')],qs[_0x1d68('0x47')](_0x4e6ccc[_0x1d68('0x43')][_0x1d68('0x47')]));_0x58b5a8[_0x1d68('0x48')]=_0x58b5a8[_0x1d68('0x48')]['length']?_0x58b5a8['attributes']:_0x2e1902['model'];_0x58b5a8[_0x1d68('0x6e')]=qs[_0x1d68('0x4b')](_0x4e6ccc[_0x1d68('0x43')][_0x1d68('0x4b')]);_0x58b5a8[_0x1d68('0x4c')]=qs['filters'](_[_0x1d68('0x4d')](_0x4e6ccc[_0x1d68('0x43')],_0x2e1902[_0x1d68('0x45')]));if(_0x4e6ccc['query'][_0x1d68('0x4e')]){_0x58b5a8['where']=_['merge'](_0x58b5a8[_0x1d68('0x4c')],{'$or':_[_0x1d68('0x3d')](_0x58b5a8[_0x1d68('0x48')],function(_0x504013){var _0x4f39e0={};_0x4f39e0[_0x504013]={'$like':'%'+_0x4e6ccc['query'][_0x1d68('0x4e')]+'%'};return _0x4f39e0;})});}_0x58b5a8=_['merge']({},_0x58b5a8,_0x4e6ccc[_0x1d68('0x51')]);return _0x17fea2[_0x1d68('0xe2')](_0x58b5a8);}})['then'](function(_0x57c61d){if(_0x57c61d){_0x5124d1=_0x57c61d[_0x1d68('0x49')];if(!_0x4e6ccc[_0x1d68('0x43')][_0x1d68('0x4a')]('nolimit')){_0x58b5a8[_0x1d68('0x30')]=qs[_0x1d68('0x30')](_0x4e6ccc[_0x1d68('0x43')][_0x1d68('0x30')]);_0x58b5a8[_0x1d68('0x2e')]=qs[_0x1d68('0x2e')](_0x4e6ccc[_0x1d68('0x43')]['offset']);}return _0x17fea2[_0x1d68('0xe2')](_0x58b5a8);}})[_0x1d68('0x20')](function(_0x5878db){if(_0x5878db){return _0x5878db?{'count':_0x5124d1,'rows':_0x5878db}:null;}})[_0x1d68('0x20')](respondWithResult(_0x250ead,null))['catch'](handleError(_0x250ead,null));}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.events.js b/server/api/smsAccount/smsAccount.events.js index fdd6e19..ed38f56 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 _0xfb22=['setMaxListeners','save','update','remove','emit','hasOwnProperty','exports'];(function(_0x104e21,_0x2ea86f){var _0x605b37=function(_0x580fce){while(--_0x580fce){_0x104e21['push'](_0x104e21['shift']());}};_0x605b37(++_0x2ea86f);}(_0xfb22,0x157));var _0x2fb2=function(_0x380c7f,_0x234003){_0x380c7f=_0x380c7f-0x0;var _0x57f3c2=_0xfb22[_0x380c7f];return _0x57f3c2;};'use strict';var EventEmitter=require('events');var SmsAccount=require('../../mysqldb')['db']['SmsAccount'];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0x2fb2('0x0')](0x0);var events={'afterCreate':_0x2fb2('0x1'),'afterUpdate':_0x2fb2('0x2'),'afterDestroy':_0x2fb2('0x3')};function emitEvent(_0x209f91){return function(_0x50cdc2,_0x235c05,_0x5655f7){SmsAccountEvents[_0x2fb2('0x4')](_0x209f91+':'+_0x50cdc2['id'],_0x50cdc2);SmsAccountEvents[_0x2fb2('0x4')](_0x209f91,_0x50cdc2);_0x5655f7(null);};}for(var e in events){if(events[_0x2fb2('0x5')](e)){var event=events[e];SmsAccount['hook'](e,emitEvent(event));}}module[_0x2fb2('0x6')]=SmsAccountEvents; \ No newline at end of file +var _0x38fa=['hook','events','../../mysqldb','SmsAccount','save','update','remove','emit'];(function(_0x355f95,_0x369c0b){var _0x5e5db5=function(_0x59ef48){while(--_0x59ef48){_0x355f95['push'](_0x355f95['shift']());}};_0x5e5db5(++_0x369c0b);}(_0x38fa,0x131));var _0xa38f=function(_0x65058d,_0x45620f){_0x65058d=_0x65058d-0x0;var _0x2b7877=_0x38fa[_0x65058d];return _0x2b7877;};'use strict';var EventEmitter=require(_0xa38f('0x0'));var SmsAccount=require(_0xa38f('0x1'))['db'][_0xa38f('0x2')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xa38f('0x3'),'afterUpdate':_0xa38f('0x4'),'afterDestroy':_0xa38f('0x5')};function emitEvent(_0x582465){return function(_0x1f0906,_0x23c18a,_0xb426bf){SmsAccountEvents[_0xa38f('0x6')](_0x582465+':'+_0x1f0906['id'],_0x1f0906);SmsAccountEvents[_0xa38f('0x6')](_0x582465,_0x1f0906);_0xb426bf(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsAccount[_0xa38f('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 0380a28..6dd6ecc 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 _0x8f59=['bluebird','request-promise','path','rimraf','../../config/environment','./smsAccount.attributes','exports','define','SmsAccount','sms_accounts','lodash','util','../../config/logger','api','moment'];(function(_0x1eae26,_0x11d8d7){var _0x459670=function(_0x5ea642){while(--_0x5ea642){_0x1eae26['push'](_0x1eae26['shift']());}};_0x459670(++_0x11d8d7);}(_0x8f59,0x73));var _0x98f5=function(_0x29206f,_0x390f1b){_0x29206f=_0x29206f-0x0;var _0x1de118=_0x8f59[_0x29206f];return _0x1de118;};'use strict';var _=require(_0x98f5('0x0'));var util=require(_0x98f5('0x1'));var logger=require(_0x98f5('0x2'))(_0x98f5('0x3'));var moment=require(_0x98f5('0x4'));var BPromise=require(_0x98f5('0x5'));var rp=require(_0x98f5('0x6'));var fs=require('fs');var path=require(_0x98f5('0x7'));var rimraf=require(_0x98f5('0x8'));var config=require(_0x98f5('0x9'));var attributes=require(_0x98f5('0xa'));module[_0x98f5('0xb')]=function(_0x346701,_0x4e2e44){return _0x346701[_0x98f5('0xc')](_0x98f5('0xd'),attributes,{'tableName':_0x98f5('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4665=['SmsAccount','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define'];(function(_0x19a774,_0x5012cc){var _0xedc704=function(_0x150f5f){while(--_0x150f5f){_0x19a774['push'](_0x19a774['shift']());}};_0xedc704(++_0x5012cc);}(_0x4665,0xe5));var _0x5466=function(_0x593d2b,_0x4e2e76){_0x593d2b=_0x593d2b-0x0;var _0x4dc08e=_0x4665[_0x593d2b];return _0x4dc08e;};'use strict';var _=require('lodash');var util=require(_0x5466('0x0'));var logger=require(_0x5466('0x1'))(_0x5466('0x2'));var moment=require(_0x5466('0x3'));var BPromise=require(_0x5466('0x4'));var rp=require(_0x5466('0x5'));var fs=require('fs');var path=require(_0x5466('0x6'));var rimraf=require(_0x5466('0x7'));var config=require(_0x5466('0x8'));var attributes=require('./smsAccount.attributes');module[_0x5466('0x9')]=function(_0x10c0c7,_0x4819fd){return _0x10c0c7[_0x5466('0xa')](_0x5466('0xb'),attributes,{'tableName':'sms_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.rpc.js b/server/api/smsAccount/smsAccount.rpc.js index 5f4b2bd..042acac 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 _0x6871=['register','request','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ShowSmsAccount','SmsAccount','options','raw','attributes','include','map','model','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./smsAccount.socket'];(function(_0x291ecc,_0x16d8c6){var _0x5a4823=function(_0x42ae8a){while(--_0x42ae8a){_0x291ecc['push'](_0x291ecc['shift']());}};_0x5a4823(++_0x16d8c6);}(_0x6871,0xae));var _0x1687=function(_0x17b6ab,_0x3cd71f){_0x17b6ab=_0x17b6ab-0x0;var _0x2d2ea2=_0x6871[_0x17b6ab];return _0x2d2ea2;};'use strict';var _=require(_0x1687('0x0'));var util=require(_0x1687('0x1'));var moment=require(_0x1687('0x2'));var BPromise=require(_0x1687('0x3'));var rs=require(_0x1687('0x4'));var fs=require('fs');var Redis=require(_0x1687('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x1687('0x6'));var logger=require(_0x1687('0x7'))('rpc');var config=require(_0x1687('0x8'));var jayson=require(_0x1687('0x9'));var client=jayson[_0x1687('0xa')][_0x1687('0xb')]({'port':0x232a});config[_0x1687('0xc')]=_[_0x1687('0xd')](config['redis'],{'host':_0x1687('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1687('0xc')]));require(_0x1687('0xf'))[_0x1687('0x10')](socket);function respondWithRpcPromise(_0xe2eed8,_0x4cf3a3,_0x4d325e){return new BPromise(function(_0x106c0a,_0x1c37d3){return client[_0x1687('0x11')](_0xe2eed8,_0x4d325e)[_0x1687('0x12')](function(_0x377caf){logger[_0x1687('0x13')](_0x1687('0x14'),_0x4cf3a3,_0x1687('0x15'));logger['debug'](_0x1687('0x16'),_0x4cf3a3,_0x1687('0x15'),JSON[_0x1687('0x17')](_0x377caf));if(_0x377caf['error']){if(_0x377caf[_0x1687('0x18')][_0x1687('0x19')]===0x1f4){logger[_0x1687('0x18')](_0x1687('0x14'),_0x4cf3a3,_0x377caf[_0x1687('0x18')][_0x1687('0x1a')]);return _0x1c37d3(_0x377caf['error']['message']);}logger['error'](_0x1687('0x14'),_0x4cf3a3,_0x377caf[_0x1687('0x18')][_0x1687('0x1a')]);return _0x106c0a(_0x377caf[_0x1687('0x18')]['message']);}else{logger['info'](_0x1687('0x14'),_0x4cf3a3,_0x1687('0x15'));_0x106c0a(_0x377caf[_0x1687('0x1b')]['message']);}})[_0x1687('0x1c')](function(_0x39cb29){logger['error']('SmsAccount,\x20%s,\x20%s',_0x4cf3a3,_0x39cb29);_0x1c37d3(_0x39cb29);});});}exports[_0x1687('0x1d')]=function(_0x27c2f2){var _0x276988=this;return new Promise(function(_0x115cb4,_0x547775){return db[_0x1687('0x1e')]['find']({'raw':_0x27c2f2[_0x1687('0x1f')]?_0x27c2f2[_0x1687('0x1f')][_0x1687('0x20')]===undefined?!![]:![]:!![],'where':_0x27c2f2[_0x1687('0x1f')]?_0x27c2f2[_0x1687('0x1f')]['where']||null:null,'attributes':_0x27c2f2['options']?_0x27c2f2[_0x1687('0x1f')][_0x1687('0x21')]||null:null,'include':_0x27c2f2[_0x1687('0x1f')]?_0x27c2f2[_0x1687('0x1f')][_0x1687('0x22')]?_[_0x1687('0x23')](_0x27c2f2[_0x1687('0x1f')][_0x1687('0x22')],function(_0x86f4af){return{'model':db[_0x86f4af['model']],'as':_0x86f4af['as'],'attributes':_0x86f4af[_0x1687('0x21')],'include':_0x86f4af[_0x1687('0x22')]?_[_0x1687('0x23')](_0x86f4af['include'],function(_0x2ab590){return{'model':db[_0x2ab590[_0x1687('0x24')]],'as':_0x2ab590['as'],'attributes':_0x2ab590[_0x1687('0x21')],'include':_0x2ab590[_0x1687('0x22')]?_['map'](_0x2ab590[_0x1687('0x22')],function(_0x5a61f3){return{'model':db[_0x5a61f3['model']],'as':_0x5a61f3['as'],'attributes':_0x5a61f3[_0x1687('0x21')]};}):[]};}):[]};}):[]:[]})[_0x1687('0x12')](function(_0x12b4f3){logger[_0x1687('0x13')](_0x1687('0x1d'),_0x27c2f2);logger[_0x1687('0x25')]('ShowSmsAccount',_0x27c2f2,JSON['stringify'](_0x12b4f3));_0x115cb4(_0x12b4f3);})[_0x1687('0x1c')](function(_0x3eb358){logger[_0x1687('0x18')](_0x1687('0x1d'),_0x3eb358[_0x1687('0x1a')],_0x27c2f2);_0x547775(_0x276988[_0x1687('0x18')](0x1f4,_0x3eb358[_0x1687('0x1a')]));});});}; \ No newline at end of file +var _0x34d1=['code','message','info','result','SmsAccount','find','options','where','attributes','include','map','model','then','ShowSmsAccount','debug','catch','lodash','util','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./smsAccount.socket','register','request','SmsAccount,\x20%s,\x20%s','request\x20sent','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x20c2c1,_0x2fbc34){var _0x39791d=function(_0x2e413b){while(--_0x2e413b){_0x20c2c1['push'](_0x20c2c1['shift']());}};_0x39791d(++_0x2fbc34);}(_0x34d1,0xf4));var _0x134d=function(_0x5bbcbf,_0xd6b06e){_0x5bbcbf=_0x5bbcbf-0x0;var _0x344837=_0x34d1[_0x5bbcbf];return _0x344837;};'use strict';var _=require(_0x134d('0x0'));var util=require(_0x134d('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x134d('0x2'));var fs=require('fs');var Redis=require(_0x134d('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x134d('0x4'))(_0x134d('0x5'));var config=require(_0x134d('0x6'));var jayson=require(_0x134d('0x7'));var client=jayson[_0x134d('0x8')][_0x134d('0x9')]({'port':0x232a});config[_0x134d('0xa')]=_[_0x134d('0xb')](config[_0x134d('0xa')],{'host':_0x134d('0xc'),'port':0x18eb});var socket=require(_0x134d('0xd'))(new Redis(config[_0x134d('0xa')]));require(_0x134d('0xe'))[_0x134d('0xf')](socket);function respondWithRpcPromise(_0x238922,_0x15f3ad,_0xccb794){return new BPromise(function(_0x48682b,_0x13734a){return client[_0x134d('0x10')](_0x238922,_0xccb794)['then'](function(_0x537f3e){logger['info'](_0x134d('0x11'),_0x15f3ad,_0x134d('0x12'));logger['debug'](_0x134d('0x13'),_0x15f3ad,_0x134d('0x12'),JSON[_0x134d('0x14')](_0x537f3e));if(_0x537f3e['error']){if(_0x537f3e[_0x134d('0x15')][_0x134d('0x16')]===0x1f4){logger[_0x134d('0x15')]('SmsAccount,\x20%s,\x20%s',_0x15f3ad,_0x537f3e['error'][_0x134d('0x17')]);return _0x13734a(_0x537f3e[_0x134d('0x15')]['message']);}logger['error'](_0x134d('0x11'),_0x15f3ad,_0x537f3e[_0x134d('0x15')][_0x134d('0x17')]);return _0x48682b(_0x537f3e['error'][_0x134d('0x17')]);}else{logger[_0x134d('0x18')](_0x134d('0x11'),_0x15f3ad,_0x134d('0x12'));_0x48682b(_0x537f3e[_0x134d('0x19')][_0x134d('0x17')]);}})['catch'](function(_0x6b2c01){logger[_0x134d('0x15')](_0x134d('0x11'),_0x15f3ad,_0x6b2c01);_0x13734a(_0x6b2c01);});});}exports['ShowSmsAccount']=function(_0x1c0e28){var _0x5919a7=this;return new Promise(function(_0x4aeb0f,_0x2ed3c7){return db[_0x134d('0x1a')][_0x134d('0x1b')]({'raw':_0x1c0e28['options']?_0x1c0e28[_0x134d('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x1c0e28['options']?_0x1c0e28[_0x134d('0x1c')][_0x134d('0x1d')]||null:null,'attributes':_0x1c0e28['options']?_0x1c0e28[_0x134d('0x1c')][_0x134d('0x1e')]||null:null,'include':_0x1c0e28[_0x134d('0x1c')]?_0x1c0e28['options'][_0x134d('0x1f')]?_[_0x134d('0x20')](_0x1c0e28[_0x134d('0x1c')][_0x134d('0x1f')],function(_0x25796c){return{'model':db[_0x25796c[_0x134d('0x21')]],'as':_0x25796c['as'],'attributes':_0x25796c[_0x134d('0x1e')],'include':_0x25796c[_0x134d('0x1f')]?_[_0x134d('0x20')](_0x25796c['include'],function(_0x5386a6){return{'model':db[_0x5386a6[_0x134d('0x21')]],'as':_0x5386a6['as'],'attributes':_0x5386a6[_0x134d('0x1e')],'include':_0x5386a6[_0x134d('0x1f')]?_['map'](_0x5386a6[_0x134d('0x1f')],function(_0x175562){return{'model':db[_0x175562[_0x134d('0x21')]],'as':_0x175562['as'],'attributes':_0x175562[_0x134d('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x134d('0x22')](function(_0xd63c44){logger[_0x134d('0x18')](_0x134d('0x23'),_0x1c0e28);logger[_0x134d('0x24')](_0x134d('0x23'),_0x1c0e28,JSON[_0x134d('0x14')](_0xd63c44));_0x4aeb0f(_0xd63c44);})[_0x134d('0x25')](function(_0x82564b){logger[_0x134d('0x15')](_0x134d('0x23'),_0x82564b['message'],_0x1c0e28);_0x2ed3c7(_0x5919a7[_0x134d('0x15')](0x1f4,_0x82564b[_0x134d('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.socket.js b/server/api/smsAccount/smsAccount.socket.js index 658f7c7..d51f491 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(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0xa9e0[_0x5ddb1c];return _0x354adc;};'use strict';var SmsAccountEvents=require(_0x0a9e('0x0'));var events=[_0x0a9e('0x1'),_0x0a9e('0x2'),'update'];function createListener(_0x550fbc,_0x18d5c9){return function(_0x4ce2f1){_0x18d5c9[_0x0a9e('0x3')](_0x550fbc,_0x4ce2f1);};}function removeListener(_0x432180,_0x2ab90b){return function(){SmsAccountEvents[_0x0a9e('0x4')](_0x432180,_0x2ab90b);};}exports[_0x0a9e('0x5')]=function(_0x57b080){for(var _0x219af0=0x0,_0x441e3a=events[_0x0a9e('0x6')];_0x219af0<_0x441e3a;_0x219af0++){var _0x5f41ea=events[_0x219af0];var _0x503809=createListener(_0x0a9e('0x7')+_0x5f41ea,_0x57b080);SmsAccountEvents['on'](_0x5f41ea,_0x503809);}}; \ No newline at end of file +var _0xa9e0=['register','length','smsAccount:','./smsAccount.events','save','remove','emit','removeListener'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x484e36,_0x4482d8){_0x484e36=_0x484e36-0x0;var _0xafc85d=_0xa9e0[_0x484e36];return _0xafc85d;};'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 14f2656..b66ce02 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(_0x4cb819,_0x382986){var _0x33fb18=function(_0x211d5e){while(--_0x211d5e){_0x4cb819['push'](_0x4cb819['shift']());}};_0x33fb18(++_0x382986);}(_0x34e8,0x12c));var _0x834e=function(_0x245ca2,_0x512cc5){_0x245ca2=_0x245ca2-0x0;var _0x544612=_0x34e8[_0x245ca2];return _0x544612;};'use strict';var multer=require(_0x834e('0x0'));var util=require(_0x834e('0x1'));var path=require(_0x834e('0x2'));var timeout=require(_0x834e('0x3'));var express=require('express');var router=express[_0x834e('0x4')]();var fs_extra=require(_0x834e('0x5'));var auth=require(_0x834e('0x6'));var interaction=require(_0x834e('0x7'));var config=require(_0x834e('0x8'));var controller=require(_0x834e('0x9'));router[_0x834e('0xa')]('/',auth['isAuthenticated'](),controller[_0x834e('0xb')]);router['get'](_0x834e('0xc'),auth[_0x834e('0xd')](),controller[_0x834e('0xe')]);router[_0x834e('0xf')]('/',auth[_0x834e('0xd')](),controller[_0x834e('0x10')]);router[_0x834e('0x11')](_0x834e('0xc'),auth[_0x834e('0xd')](),controller[_0x834e('0x12')]);router[_0x834e('0x13')](_0x834e('0xc'),auth[_0x834e('0xd')](),controller[_0x834e('0x14')]);module[_0x834e('0x15')]=router; \ No newline at end of file +var _0x9957=['multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./smsApplication.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports'];(function(_0x2763f2,_0x416af8){var _0x3ef471=function(_0x288aa2){while(--_0x288aa2){_0x2763f2['push'](_0x2763f2['shift']());}};_0x3ef471(++_0x416af8);}(_0x9957,0x93));var _0x7995=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x9957[_0x6c993a];return _0x27f547;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0xe')]('/',auth['isAuthenticated'](),controller[_0x7995('0xf')]);router[_0x7995('0x10')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router[_0x7995('0x12')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0x13')]);module[_0x7995('0x14')]=router; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.attributes.js b/server/api/smsApplication/smsApplication.attributes.js index 1a7f03a..b938abf 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 _0x2681=['exports','INTEGER','STRING','noop','sequelize'];(function(_0x1e4966,_0x8d7dc8){var _0x4ff971=function(_0x4ef3cf){while(--_0x4ef3cf){_0x1e4966['push'](_0x1e4966['shift']());}};_0x4ff971(++_0x8d7dc8);}(_0x2681,0x18f));var _0x1268=function(_0x6b005b,_0x4e3afa){_0x6b005b=_0x6b005b-0x0;var _0x1f12b4=_0x2681[_0x6b005b];return _0x1f12b4;};'use strict';var Sequelize=require(_0x1268('0x0'));module[_0x1268('0x1')]={'priority':{'type':Sequelize[_0x1268('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x1268('0x3')],'allowNull':![],'defaultValue':_0x1268('0x4')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x1268('0x3')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file +var _0x6bfb=['INTEGER','STRING','TEXT','*,*,*,*','sequelize','exports'];(function(_0x1ccd81,_0x5b5389){var _0x4521d4=function(_0x481e2c){while(--_0x481e2c){_0x1ccd81['push'](_0x1ccd81['shift']());}};_0x4521d4(++_0x5b5389);}(_0x6bfb,0x13c));var _0xb6bf=function(_0x45c54d,_0x246717){_0x45c54d=_0x45c54d-0x0;var _0x110dbb=_0x6bfb[_0x45c54d];return _0x110dbb;};'use strict';var Sequelize=require(_0xb6bf('0x0'));module[_0xb6bf('0x1')]={'priority':{'type':Sequelize[_0xb6bf('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xb6bf('0x3')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0xb6bf('0x4')]()},'description':{'type':Sequelize[_0xb6bf('0x3')]},'interval':{'type':Sequelize[_0xb6bf('0x3')],'defaultValue':_0xb6bf('0x5')}}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.controller.js b/server/api/smsApplication/smsApplication.controller.js index 0f4f6e1..22617bc 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 _0x6207=['limit','count','Content-Range','apply','reject','update','then','destroy','end','sendStatus','error','stack','name','send','map','SmsApplication','type','key','model','keys','filters','attributes','fields','query','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','intersection','options','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','status','json','offset','undefined'];(function(_0x2c492c,_0x50e279){var _0x51c7f6=function(_0x24d1ec){while(--_0x24d1ec){_0x2c492c['push'](_0x2c492c['shift']());}};_0x51c7f6(++_0x50e279);}(_0x6207,0xc2));var _0x7620=function(_0x1049e7,_0x2c8a7f){_0x1049e7=_0x1049e7-0x0;var _0x453340=_0x6207[_0x1049e7];return _0x453340;};'use strict';var emlformat=require(_0x7620('0x0'));var rimraf=require(_0x7620('0x1'));var zipdir=require(_0x7620('0x2'));var jsonpatch=require(_0x7620('0x3'));var rp=require(_0x7620('0x4'));var moment=require(_0x7620('0x5'));var BPromise=require(_0x7620('0x6'));var Mustache=require(_0x7620('0x7'));var util=require('util');var path=require(_0x7620('0x8'));var sox=require(_0x7620('0x9'));var csv=require(_0x7620('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7620('0xb'));var _=require('lodash');var squel=require(_0x7620('0xc'));var crypto=require(_0x7620('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x7620('0xe'));var toCsv=require(_0x7620('0xa'));var querystring=require(_0x7620('0xf'));var Papa=require(_0x7620('0x10'));var Redis=require(_0x7620('0x11'));var authService=require(_0x7620('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x7620('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x7620('0x14'));var utils=require(_0x7620('0x15'));var config=require(_0x7620('0x16'));var licenseUtil=require(_0x7620('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5039e4,_0x18ffad){_0x18ffad=_0x18ffad||0xcc;return function(_0x5ce5bf){if(_0x5ce5bf){return _0x5039e4['sendStatus'](_0x18ffad);}return _0x5039e4[_0x7620('0x18')](_0x18ffad)['end']();};}function respondWithResult(_0x369364,_0x205c61){_0x205c61=_0x205c61||0xc8;return function(_0x104c29){if(_0x104c29){return _0x369364[_0x7620('0x18')](_0x205c61)[_0x7620('0x19')](_0x104c29);}};}function respondWithFilteredResult(_0x3ec30b,_0x4ecf45){return function(_0x50d569){if(_0x50d569){var _0x153a35=typeof _0x4ecf45[_0x7620('0x1a')]===_0x7620('0x1b')&&typeof _0x4ecf45[_0x7620('0x1c')]===_0x7620('0x1b');var _0x8cf35e=_0x50d569[_0x7620('0x1d')];var _0x21328a=_0x153a35?0x0:_0x4ecf45[_0x7620('0x1a')];var _0xfdbc3e=_0x153a35?_0x50d569['count']:_0x4ecf45[_0x7620('0x1a')]+_0x4ecf45[_0x7620('0x1c')];var _0x3af06b;if(_0xfdbc3e>=_0x8cf35e){_0xfdbc3e=_0x8cf35e;_0x3af06b=0xc8;}else{_0x3af06b=0xce;}_0x3ec30b[_0x7620('0x18')](_0x3af06b);return _0x3ec30b['set'](_0x7620('0x1e'),_0x21328a+'-'+_0xfdbc3e+'/'+_0x8cf35e)[_0x7620('0x19')](_0x50d569);}return null;};}function patchUpdates(_0x1f0666){return function(_0x30403b){try{jsonpatch[_0x7620('0x1f')](_0x30403b,_0x1f0666,!![]);}catch(_0x305825){return BPromise[_0x7620('0x20')](_0x305825);}return _0x30403b['save']();};}function saveUpdates(_0x466a1a,_0xa7f68){return function(_0x4612ad){if(_0x4612ad){return _0x4612ad[_0x7620('0x21')](_0x466a1a)[_0x7620('0x22')](function(_0x24ef67){return _0x24ef67;});}return null;};}function removeEntity(_0x3df377,_0x2bdda6){return function(_0x2dff0c){if(_0x2dff0c){return _0x2dff0c[_0x7620('0x23')]()[_0x7620('0x22')](function(){_0x3df377['status'](0xcc)[_0x7620('0x24')]();});}};}function handleEntityNotFound(_0x9072ef,_0xbbfb27){return function(_0xcf9560){if(!_0xcf9560){_0x9072ef[_0x7620('0x25')](0x194);}return _0xcf9560;};}function handleError(_0x41e274,_0x1092a7){_0x1092a7=_0x1092a7||0x1f4;return function(_0x1b54c7){logger[_0x7620('0x26')](_0x1b54c7[_0x7620('0x27')]);if(_0x1b54c7[_0x7620('0x28')]){delete _0x1b54c7[_0x7620('0x28')];}_0x41e274[_0x7620('0x18')](_0x1092a7)[_0x7620('0x29')](_0x1b54c7);};}exports['index']=function(_0x1943f8,_0x498ffd){var _0x2cbafd={},_0x25bddb={},_0x2cf252={'count':0x0,'rows':[]};var _0x341470=_[_0x7620('0x2a')](db[_0x7620('0x2b')]['rawAttributes'],function(_0x14b39f){return{'name':_0x14b39f['fieldName'],'type':_0x14b39f[_0x7620('0x2c')][_0x7620('0x2d')]};});_0x25bddb[_0x7620('0x2e')]=_['map'](_0x341470,_0x7620('0x28'));_0x25bddb['query']=_[_0x7620('0x2f')](_0x1943f8['query']);_0x25bddb[_0x7620('0x30')]=_['intersection'](_0x25bddb[_0x7620('0x2e')],_0x25bddb['query']);_0x2cbafd[_0x7620('0x31')]=_['intersection'](_0x25bddb[_0x7620('0x2e')],qs[_0x7620('0x32')](_0x1943f8[_0x7620('0x33')][_0x7620('0x32')]));_0x2cbafd[_0x7620('0x31')]=_0x2cbafd['attributes'][_0x7620('0x34')]?_0x2cbafd['attributes']:_0x25bddb[_0x7620('0x2e')];if(!_0x1943f8[_0x7620('0x33')][_0x7620('0x35')](_0x7620('0x36'))){_0x2cbafd[_0x7620('0x1c')]=qs['limit'](_0x1943f8[_0x7620('0x33')][_0x7620('0x1c')]);_0x2cbafd[_0x7620('0x1a')]=qs[_0x7620('0x1a')](_0x1943f8['query'][_0x7620('0x1a')]);}_0x2cbafd[_0x7620('0x37')]=qs[_0x7620('0x38')](_0x1943f8[_0x7620('0x33')][_0x7620('0x38')]);_0x2cbafd[_0x7620('0x39')]=qs[_0x7620('0x30')](_[_0x7620('0x3a')](_0x1943f8[_0x7620('0x33')],_0x25bddb[_0x7620('0x30')]),_0x341470);if(_0x1943f8[_0x7620('0x33')][_0x7620('0x3b')]){_0x2cbafd[_0x7620('0x39')]=_[_0x7620('0x3c')](_0x2cbafd[_0x7620('0x39')],{'$or':_[_0x7620('0x2a')](_0x341470,function(_0x5b898a){if(_0x5b898a['type']!==_0x7620('0x3d')){var _0x40210b={};_0x40210b[_0x5b898a[_0x7620('0x28')]]={'$like':'%'+_0x1943f8['query']['filter']+'%'};return _0x40210b;}})});}_0x2cbafd=_['merge']({},_0x2cbafd,_0x1943f8['options']);var _0x514530={'where':_0x2cbafd[_0x7620('0x39')]};return db[_0x7620('0x2b')][_0x7620('0x1d')](_0x514530)[_0x7620('0x22')](function(_0x1225f2){_0x2cf252[_0x7620('0x1d')]=_0x1225f2;if(_0x1943f8[_0x7620('0x33')][_0x7620('0x3e')]){_0x2cbafd[_0x7620('0x3f')]=[{'all':!![]}];}return db['SmsApplication'][_0x7620('0x40')](_0x2cbafd);})[_0x7620('0x22')](function(_0x126f09){_0x2cf252[_0x7620('0x41')]=_0x126f09;return _0x2cf252;})[_0x7620('0x22')](respondWithFilteredResult(_0x498ffd,_0x2cbafd))[_0x7620('0x42')](handleError(_0x498ffd,null));};exports[_0x7620('0x43')]=function(_0x435c00,_0x4be4e9){var _0xc2ad5c={'raw':!![],'where':{'id':_0x435c00[_0x7620('0x44')]['id']}},_0x1c1a17={};_0x1c1a17['model']=_['keys'](db[_0x7620('0x2b')]['rawAttributes']);_0x1c1a17[_0x7620('0x33')]=_[_0x7620('0x2f')](_0x435c00[_0x7620('0x33')]);_0x1c1a17[_0x7620('0x30')]=_[_0x7620('0x45')](_0x1c1a17['model'],_0x1c1a17['query']);_0xc2ad5c[_0x7620('0x31')]=_[_0x7620('0x45')](_0x1c1a17[_0x7620('0x2e')],qs[_0x7620('0x32')](_0x435c00['query'][_0x7620('0x32')]));_0xc2ad5c[_0x7620('0x31')]=_0xc2ad5c[_0x7620('0x31')][_0x7620('0x34')]?_0xc2ad5c['attributes']:_0x1c1a17['model'];if(_0x435c00[_0x7620('0x33')][_0x7620('0x3e')]){_0xc2ad5c[_0x7620('0x3f')]=[{'all':!![]}];}_0xc2ad5c=_['merge']({},_0xc2ad5c,_0x435c00[_0x7620('0x46')]);return db[_0x7620('0x2b')][_0x7620('0x47')](_0xc2ad5c)[_0x7620('0x22')](handleEntityNotFound(_0x4be4e9,null))['then'](respondWithResult(_0x4be4e9,null))['catch'](handleError(_0x4be4e9,null));};exports[_0x7620('0x48')]=function(_0x52a6ca,_0x390a5d){return db['SmsApplication'][_0x7620('0x48')](_0x52a6ca[_0x7620('0x49')],{})[_0x7620('0x22')](respondWithResult(_0x390a5d,0xc9))['catch'](handleError(_0x390a5d,null));};exports['update']=function(_0x137bd4,_0x223732){if(_0x137bd4[_0x7620('0x49')]['id']){delete _0x137bd4[_0x7620('0x49')]['id'];}return db[_0x7620('0x2b')][_0x7620('0x47')]({'where':{'id':_0x137bd4[_0x7620('0x44')]['id']}})[_0x7620('0x22')](handleEntityNotFound(_0x223732,null))[_0x7620('0x22')](saveUpdates(_0x137bd4['body'],null))[_0x7620('0x22')](respondWithResult(_0x223732,null))[_0x7620('0x42')](handleError(_0x223732,null));};exports['destroy']=function(_0x1e80ef,_0x5e30c6){return db[_0x7620('0x2b')][_0x7620('0x47')]({'where':{'id':_0x1e80ef[_0x7620('0x44')]['id']}})['then'](handleEntityNotFound(_0x5e30c6,null))[_0x7620('0x22')](removeEntity(_0x5e30c6,null))['catch'](handleError(_0x5e30c6,null));}; \ No newline at end of file +var _0x5ce9=['type','key','name','keys','query','filters','intersection','model','attributes','fields','nolimit','limit','sort','filter','merge','where','VIRTUAL','includeAll','include','findAll','catch','show','params','length','options','find','create','body','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','offset','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','send','index','map','SmsApplication','rawAttributes','fieldName'];(function(_0x27bca8,_0x191f63){var _0x370163=function(_0x1329f8){while(--_0x1329f8){_0x27bca8['push'](_0x27bca8['shift']());}};_0x370163(++_0x191f63);}(_0x5ce9,0x68));var _0x95ce=function(_0x4997a7,_0x4f19dd){_0x4997a7=_0x4997a7-0x0;var _0x336691=_0x5ce9[_0x4997a7];return _0x336691;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x95ce('0x0'));var zipdir=require(_0x95ce('0x1'));var jsonpatch=require(_0x95ce('0x2'));var rp=require(_0x95ce('0x3'));var moment=require(_0x95ce('0x4'));var BPromise=require(_0x95ce('0x5'));var Mustache=require(_0x95ce('0x6'));var util=require('util');var path=require('path');var sox=require(_0x95ce('0x7'));var csv=require('to-csv');var ejs=require(_0x95ce('0x8'));var fs=require('fs');var fs_extra=require(_0x95ce('0x9'));var _=require(_0x95ce('0xa'));var squel=require(_0x95ce('0xb'));var crypto=require(_0x95ce('0xc'));var jsforce=require(_0x95ce('0xd'));var deskjs=require(_0x95ce('0xe'));var toCsv=require(_0x95ce('0xf'));var querystring=require(_0x95ce('0x10'));var Papa=require(_0x95ce('0x11'));var Redis=require(_0x95ce('0x12'));var authService=require(_0x95ce('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x95ce('0x14'));var hardwareService=require(_0x95ce('0x15'));var logger=require(_0x95ce('0x16'))('api');var utils=require(_0x95ce('0x17'));var config=require(_0x95ce('0x18'));var licenseUtil=require(_0x95ce('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3a2ec9,_0x4058cd){_0x4058cd=_0x4058cd||0xcc;return function(_0x11fb92){if(_0x11fb92){return _0x3a2ec9[_0x95ce('0x1a')](_0x4058cd);}return _0x3a2ec9[_0x95ce('0x1b')](_0x4058cd)['end']();};}function respondWithResult(_0x376f2b,_0xf6445a){_0xf6445a=_0xf6445a||0xc8;return function(_0x12bc85){if(_0x12bc85){return _0x376f2b[_0x95ce('0x1b')](_0xf6445a)['json'](_0x12bc85);}};}function respondWithFilteredResult(_0x3dfeb5,_0x9931d6){return function(_0x557e99){if(_0x557e99){var _0x172bcf=typeof _0x9931d6[_0x95ce('0x1c')]===_0x95ce('0x1d')&&typeof _0x9931d6['limit']===_0x95ce('0x1d');var _0x38cfe2=_0x557e99[_0x95ce('0x1e')];var _0x41f6b4=_0x172bcf?0x0:_0x9931d6[_0x95ce('0x1c')];var _0x1b8aa5=_0x172bcf?_0x557e99['count']:_0x9931d6[_0x95ce('0x1c')]+_0x9931d6['limit'];var _0x2cf542;if(_0x1b8aa5>=_0x38cfe2){_0x1b8aa5=_0x38cfe2;_0x2cf542=0xc8;}else{_0x2cf542=0xce;}_0x3dfeb5[_0x95ce('0x1b')](_0x2cf542);return _0x3dfeb5[_0x95ce('0x1f')](_0x95ce('0x20'),_0x41f6b4+'-'+_0x1b8aa5+'/'+_0x38cfe2)['json'](_0x557e99);}return null;};}function patchUpdates(_0x5c15f2){return function(_0x1147d4){try{jsonpatch[_0x95ce('0x21')](_0x1147d4,_0x5c15f2,!![]);}catch(_0x210606){return BPromise[_0x95ce('0x22')](_0x210606);}return _0x1147d4[_0x95ce('0x23')]();};}function saveUpdates(_0x57d839,_0x38475b){return function(_0x3fbe14){if(_0x3fbe14){return _0x3fbe14[_0x95ce('0x24')](_0x57d839)[_0x95ce('0x25')](function(_0x12e742){return _0x12e742;});}return null;};}function removeEntity(_0x36cea6,_0xe49725){return function(_0x128632){if(_0x128632){return _0x128632[_0x95ce('0x26')]()['then'](function(){_0x36cea6[_0x95ce('0x1b')](0xcc)[_0x95ce('0x27')]();});}};}function handleEntityNotFound(_0x49e16a,_0x241a54){return function(_0x19a3ca){if(!_0x19a3ca){_0x49e16a[_0x95ce('0x1a')](0x194);}return _0x19a3ca;};}function handleError(_0x283be5,_0x1db060){_0x1db060=_0x1db060||0x1f4;return function(_0x2c04fe){logger[_0x95ce('0x28')](_0x2c04fe[_0x95ce('0x29')]);if(_0x2c04fe['name']){delete _0x2c04fe['name'];}_0x283be5['status'](_0x1db060)[_0x95ce('0x2a')](_0x2c04fe);};}exports[_0x95ce('0x2b')]=function(_0x28b906,_0x4b50f4){var _0x5ddda1={},_0x1a2c42={},_0x44e5f5={'count':0x0,'rows':[]};var _0x49a308=_[_0x95ce('0x2c')](db[_0x95ce('0x2d')][_0x95ce('0x2e')],function(_0xf2250c){return{'name':_0xf2250c[_0x95ce('0x2f')],'type':_0xf2250c[_0x95ce('0x30')][_0x95ce('0x31')]};});_0x1a2c42['model']=_['map'](_0x49a308,_0x95ce('0x32'));_0x1a2c42['query']=_[_0x95ce('0x33')](_0x28b906[_0x95ce('0x34')]);_0x1a2c42[_0x95ce('0x35')]=_[_0x95ce('0x36')](_0x1a2c42[_0x95ce('0x37')],_0x1a2c42[_0x95ce('0x34')]);_0x5ddda1[_0x95ce('0x38')]=_[_0x95ce('0x36')](_0x1a2c42[_0x95ce('0x37')],qs['fields'](_0x28b906[_0x95ce('0x34')][_0x95ce('0x39')]));_0x5ddda1[_0x95ce('0x38')]=_0x5ddda1[_0x95ce('0x38')]['length']?_0x5ddda1['attributes']:_0x1a2c42[_0x95ce('0x37')];if(!_0x28b906[_0x95ce('0x34')]['hasOwnProperty'](_0x95ce('0x3a'))){_0x5ddda1[_0x95ce('0x3b')]=qs['limit'](_0x28b906[_0x95ce('0x34')][_0x95ce('0x3b')]);_0x5ddda1[_0x95ce('0x1c')]=qs[_0x95ce('0x1c')](_0x28b906['query'][_0x95ce('0x1c')]);}_0x5ddda1['order']=qs['sort'](_0x28b906[_0x95ce('0x34')][_0x95ce('0x3c')]);_0x5ddda1['where']=qs[_0x95ce('0x35')](_['pick'](_0x28b906['query'],_0x1a2c42[_0x95ce('0x35')]),_0x49a308);if(_0x28b906[_0x95ce('0x34')][_0x95ce('0x3d')]){_0x5ddda1['where']=_[_0x95ce('0x3e')](_0x5ddda1[_0x95ce('0x3f')],{'$or':_['map'](_0x49a308,function(_0x283917){if(_0x283917['type']!==_0x95ce('0x40')){var _0xd8fc1d={};_0xd8fc1d[_0x283917[_0x95ce('0x32')]]={'$like':'%'+_0x28b906[_0x95ce('0x34')][_0x95ce('0x3d')]+'%'};return _0xd8fc1d;}})});}_0x5ddda1=_['merge']({},_0x5ddda1,_0x28b906['options']);var _0x39f780={'where':_0x5ddda1[_0x95ce('0x3f')]};return db[_0x95ce('0x2d')][_0x95ce('0x1e')](_0x39f780)['then'](function(_0x56fa3d){_0x44e5f5['count']=_0x56fa3d;if(_0x28b906['query'][_0x95ce('0x41')]){_0x5ddda1[_0x95ce('0x42')]=[{'all':!![]}];}return db[_0x95ce('0x2d')][_0x95ce('0x43')](_0x5ddda1);})[_0x95ce('0x25')](function(_0x4077e1){_0x44e5f5['rows']=_0x4077e1;return _0x44e5f5;})[_0x95ce('0x25')](respondWithFilteredResult(_0x4b50f4,_0x5ddda1))[_0x95ce('0x44')](handleError(_0x4b50f4,null));};exports[_0x95ce('0x45')]=function(_0x44b0d5,_0x1f9718){var _0x30b161={'raw':!![],'where':{'id':_0x44b0d5[_0x95ce('0x46')]['id']}},_0x27ee44={};_0x27ee44[_0x95ce('0x37')]=_[_0x95ce('0x33')](db['SmsApplication'][_0x95ce('0x2e')]);_0x27ee44[_0x95ce('0x34')]=_[_0x95ce('0x33')](_0x44b0d5[_0x95ce('0x34')]);_0x27ee44[_0x95ce('0x35')]=_[_0x95ce('0x36')](_0x27ee44['model'],_0x27ee44[_0x95ce('0x34')]);_0x30b161[_0x95ce('0x38')]=_[_0x95ce('0x36')](_0x27ee44[_0x95ce('0x37')],qs[_0x95ce('0x39')](_0x44b0d5[_0x95ce('0x34')][_0x95ce('0x39')]));_0x30b161[_0x95ce('0x38')]=_0x30b161[_0x95ce('0x38')][_0x95ce('0x47')]?_0x30b161[_0x95ce('0x38')]:_0x27ee44[_0x95ce('0x37')];if(_0x44b0d5['query']['includeAll']){_0x30b161[_0x95ce('0x42')]=[{'all':!![]}];}_0x30b161=_[_0x95ce('0x3e')]({},_0x30b161,_0x44b0d5[_0x95ce('0x48')]);return db[_0x95ce('0x2d')][_0x95ce('0x49')](_0x30b161)['then'](handleEntityNotFound(_0x1f9718,null))['then'](respondWithResult(_0x1f9718,null))[_0x95ce('0x44')](handleError(_0x1f9718,null));};exports[_0x95ce('0x4a')]=function(_0x317ae0,_0xea4db){return db[_0x95ce('0x2d')]['create'](_0x317ae0[_0x95ce('0x4b')],{})[_0x95ce('0x25')](respondWithResult(_0xea4db,0xc9))[_0x95ce('0x44')](handleError(_0xea4db,null));};exports[_0x95ce('0x24')]=function(_0x2cf75b,_0x1510be){if(_0x2cf75b[_0x95ce('0x4b')]['id']){delete _0x2cf75b[_0x95ce('0x4b')]['id'];}return db[_0x95ce('0x2d')][_0x95ce('0x49')]({'where':{'id':_0x2cf75b[_0x95ce('0x46')]['id']}})[_0x95ce('0x25')](handleEntityNotFound(_0x1510be,null))[_0x95ce('0x25')](saveUpdates(_0x2cf75b['body'],null))[_0x95ce('0x25')](respondWithResult(_0x1510be,null))[_0x95ce('0x44')](handleError(_0x1510be,null));};exports[_0x95ce('0x26')]=function(_0x120304,_0x189b62){return db[_0x95ce('0x2d')][_0x95ce('0x49')]({'where':{'id':_0x120304[_0x95ce('0x46')]['id']}})[_0x95ce('0x25')](handleEntityNotFound(_0x189b62,null))[_0x95ce('0x25')](removeEntity(_0x189b62,null))[_0x95ce('0x44')](handleError(_0x189b62,null));}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.model.js b/server/api/smsApplication/smsApplication.model.js index 3532059..cbc7170 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 _0xd913=['exports','sms_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','path','rimraf','../../config/environment','./smsApplication.attributes'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd913,0xee));var _0x3d91=function(_0xcae655,_0x237427){_0xcae655=_0xcae655-0x0;var _0x3d6112=_0xd913[_0xcae655];return _0x3d6112;};'use strict';var _=require(_0x3d91('0x0'));var util=require(_0x3d91('0x1'));var logger=require(_0x3d91('0x2'))(_0x3d91('0x3'));var moment=require(_0x3d91('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x3d91('0x5'));var rimraf=require(_0x3d91('0x6'));var config=require(_0x3d91('0x7'));var attributes=require(_0x3d91('0x8'));module[_0x3d91('0x9')]=function(_0xea7afa,_0xb41ac5){return _0xea7afa['define']('SmsApplication',attributes,{'tableName':_0x3d91('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x3d91('0xb'),'collate':_0x3d91('0xc')});}; \ No newline at end of file +var _0xb1ac=['path','rimraf','../../config/environment','./smsApplication.attributes','exports','define','SmsApplication','sms_applications','utf8mb4','util','../../config/logger','bluebird','request-promise'];(function(_0x1943bc,_0x367d4e){var _0x141417=function(_0xcbb58e){while(--_0xcbb58e){_0x1943bc['push'](_0x1943bc['shift']());}};_0x141417(++_0x367d4e);}(_0xb1ac,0x134));var _0xcb1a=function(_0x2b7149,_0x11b2d7){_0x2b7149=_0x2b7149-0x0;var _0x36ae2d=_0xb1ac[_0x2b7149];return _0x36ae2d;};'use strict';var _=require('lodash');var util=require(_0xcb1a('0x0'));var logger=require(_0xcb1a('0x1'))('api');var moment=require('moment');var BPromise=require(_0xcb1a('0x2'));var rp=require(_0xcb1a('0x3'));var fs=require('fs');var path=require(_0xcb1a('0x4'));var rimraf=require(_0xcb1a('0x5'));var config=require(_0xcb1a('0x6'));var attributes=require(_0xcb1a('0x7'));module[_0xcb1a('0x8')]=function(_0x149889,_0x57810d){return _0x149889[_0xcb1a('0x9')](_0xcb1a('0xa'),attributes,{'tableName':_0xcb1a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xcb1a('0xc'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.rpc.js b/server/api/smsApplication/smsApplication.rpc.js index 0e839fe..3bc2c84 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 _0x202a=['then','SmsApplication,\x20%s,\x20%s','request\x20sent','debug','SmsApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','util','moment','bluebird','ioredis','rpc','../../config/environment','http','request'];(function(_0x309ca4,_0x9f070e){var _0x21101b=function(_0x4ddeca){while(--_0x4ddeca){_0x309ca4['push'](_0x309ca4['shift']());}};_0x21101b(++_0x9f070e);}(_0x202a,0xc0));var _0xa202=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x202a[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0xa202('0x0'));var moment=require(_0xa202('0x1'));var BPromise=require(_0xa202('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa202('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xa202('0x4'));var config=require(_0xa202('0x5'));var jayson=require('jayson/promise');var client=jayson['client'][_0xa202('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x4cb469,_0x4f0a59,_0x4d8dcc){return new BPromise(function(_0x216b4c,_0xcd59fb){return client[_0xa202('0x7')](_0x4cb469,_0x4d8dcc)[_0xa202('0x8')](function(_0x572036){logger['info'](_0xa202('0x9'),_0x4f0a59,_0xa202('0xa'));logger[_0xa202('0xb')](_0xa202('0xc'),_0x4f0a59,'request\x20sent',JSON[_0xa202('0xd')](_0x572036));if(_0x572036['error']){if(_0x572036[_0xa202('0xe')][_0xa202('0xf')]===0x1f4){logger[_0xa202('0xe')]('SmsApplication,\x20%s,\x20%s',_0x4f0a59,_0x572036[_0xa202('0xe')][_0xa202('0x10')]);return _0xcd59fb(_0x572036[_0xa202('0xe')][_0xa202('0x10')]);}logger[_0xa202('0xe')](_0xa202('0x9'),_0x4f0a59,_0x572036['error'][_0xa202('0x10')]);return _0x216b4c(_0x572036[_0xa202('0xe')][_0xa202('0x10')]);}else{logger[_0xa202('0x11')](_0xa202('0x9'),_0x4f0a59,'request\x20sent');_0x216b4c(_0x572036[_0xa202('0x12')][_0xa202('0x10')]);}})[_0xa202('0x13')](function(_0x3fcc66){logger[_0xa202('0xe')](_0xa202('0x9'),_0x4f0a59,_0x3fcc66);_0xcd59fb(_0x3fcc66);});});} \ No newline at end of file +var _0xc04a=['randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','SmsApplication,\x20%s,\x20%s','request\x20sent','SmsApplication,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','moment'];(function(_0x5d7643,_0x7f9745){var _0x16544b=function(_0x247c5a){while(--_0x247c5a){_0x5d7643['push'](_0x5d7643['shift']());}};_0x16544b(++_0x7f9745);}(_0xc04a,0x12e));var _0xac04=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc04a[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xac04('0x0'));var util=require('util');var moment=require(_0xac04('0x1'));var BPromise=require('bluebird');var rs=require(_0xac04('0x2'));var fs=require('fs');var Redis=require(_0xac04('0x3'));var db=require(_0xac04('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xac04('0x5'))(_0xac04('0x6'));var config=require(_0xac04('0x7'));var jayson=require(_0xac04('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4f51d2,_0x4dab26,_0x2a6b1f){return new BPromise(function(_0x2f0311,_0xf1aed7){return client[_0xac04('0x9')](_0x4f51d2,_0x2a6b1f)[_0xac04('0xa')](function(_0x196ad0){logger[_0xac04('0xb')](_0xac04('0xc'),_0x4dab26,_0xac04('0xd'));logger['debug'](_0xac04('0xe'),_0x4dab26,'request\x20sent',JSON[_0xac04('0xf')](_0x196ad0));if(_0x196ad0[_0xac04('0x10')]){if(_0x196ad0[_0xac04('0x10')]['code']===0x1f4){logger['error']('SmsApplication,\x20%s,\x20%s',_0x4dab26,_0x196ad0['error'][_0xac04('0x11')]);return _0xf1aed7(_0x196ad0[_0xac04('0x10')][_0xac04('0x11')]);}logger['error'](_0xac04('0xc'),_0x4dab26,_0x196ad0[_0xac04('0x10')]['message']);return _0x2f0311(_0x196ad0[_0xac04('0x10')][_0xac04('0x11')]);}else{logger['info'](_0xac04('0xc'),_0x4dab26,_0xac04('0xd'));_0x2f0311(_0x196ad0['result']['message']);}})[_0xac04('0x12')](function(_0x592da0){logger[_0xac04('0x10')]('SmsApplication,\x20%s,\x20%s',_0x4dab26,_0x592da0);_0xf1aed7(_0x592da0);});});} \ No newline at end of file diff --git a/server/api/smsInteraction/index.js b/server/api/smsInteraction/index.js index a345a9a..71aecee 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 _0x7708=['removeTags','exports','multer','util','connect-timeout','../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','describe','/:id','show','/:id/messages','getMessages','/:id/download','post','create','addMessage','/:id/tags','tracked','sms','addTags','put','delete'];(function(_0x18a794,_0x335c63){var _0x4fadaa=function(_0x49b618){while(--_0x49b618){_0x18a794['push'](_0x18a794['shift']());}};_0x4fadaa(++_0x335c63);}(_0x7708,0x188));var _0x8770=function(_0x1d94d1,_0x347bb8){_0x1d94d1=_0x1d94d1-0x0;var _0x23c397=_0x7708[_0x1d94d1];return _0x23c397;};'use strict';var multer=require(_0x8770('0x0'));var util=require(_0x8770('0x1'));var path=require('path');var timeout=require(_0x8770('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x8770('0x3'));var config=require(_0x8770('0x4'));var controller=require('./smsInteraction.controller');router[_0x8770('0x5')]('/',auth['isAuthenticated'](),controller[_0x8770('0x6')]);router[_0x8770('0x5')](_0x8770('0x7'),auth[_0x8770('0x8')](),controller[_0x8770('0x9')]);router[_0x8770('0x5')](_0x8770('0xa'),auth['isAuthenticated'](),controller[_0x8770('0xb')]);router[_0x8770('0x5')](_0x8770('0xc'),auth['isAuthenticated'](),controller[_0x8770('0xd')]);router[_0x8770('0x5')](_0x8770('0xe'),auth[_0x8770('0x8')](),controller['download']);router[_0x8770('0xf')]('/',auth[_0x8770('0x8')](),controller[_0x8770('0x10')]);router['post'](_0x8770('0xc'),auth[_0x8770('0x8')](),controller[_0x8770('0x11')]);router[_0x8770('0xf')](_0x8770('0x12'),auth[_0x8770('0x8')](),interaction[_0x8770('0x13')](_0x8770('0x14'),'smsinteraction:addtags'),controller[_0x8770('0x15')]);router[_0x8770('0x16')]('/:id',auth[_0x8770('0x8')](),interaction['tracked'](_0x8770('0x14'),'smsinteraction:update'),controller['update']);router['delete'](_0x8770('0xa'),auth[_0x8770('0x8')](),interaction[_0x8770('0x13')](_0x8770('0x14'),'smsinteraction:destroy'),controller['destroy']);router[_0x8770('0x17')](_0x8770('0x12'),auth[_0x8770('0x8')](),controller[_0x8770('0x18')]);module[_0x8770('0x19')]=router; \ No newline at end of file +var _0x0abf=['create','addMessage','/:id/tags','tracked','sms','smsinteraction:addtags','addTags','put','smsinteraction:update','update','smsinteraction:destroy','destroy','delete','removeTags','exports','multer','path','connect-timeout','fs-extra','../../components/interaction/service','../../config/environment','./smsInteraction.controller','get','isAuthenticated','index','describe','/:id','show','/:id/messages','download','post'];(function(_0x3e3550,_0x3bdbb3){var _0x2f792f=function(_0x59fc12){while(--_0x59fc12){_0x3e3550['push'](_0x3e3550['shift']());}};_0x2f792f(++_0x3bdbb3);}(_0x0abf,0xe8));var _0xf0ab=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x0abf[_0xbca1b1];return _0x4e1686;};'use strict';var multer=require(_0xf0ab('0x0'));var util=require('util');var path=require(_0xf0ab('0x1'));var timeout=require(_0xf0ab('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xf0ab('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xf0ab('0x4'));var config=require(_0xf0ab('0x5'));var controller=require(_0xf0ab('0x6'));router[_0xf0ab('0x7')]('/',auth[_0xf0ab('0x8')](),controller[_0xf0ab('0x9')]);router[_0xf0ab('0x7')]('/describe',auth[_0xf0ab('0x8')](),controller[_0xf0ab('0xa')]);router[_0xf0ab('0x7')](_0xf0ab('0xb'),auth['isAuthenticated'](),controller[_0xf0ab('0xc')]);router[_0xf0ab('0x7')](_0xf0ab('0xd'),auth['isAuthenticated'](),controller['getMessages']);router[_0xf0ab('0x7')]('/:id/download',auth[_0xf0ab('0x8')](),controller[_0xf0ab('0xe')]);router[_0xf0ab('0xf')]('/',auth[_0xf0ab('0x8')](),controller[_0xf0ab('0x10')]);router[_0xf0ab('0xf')](_0xf0ab('0xd'),auth['isAuthenticated'](),controller[_0xf0ab('0x11')]);router[_0xf0ab('0xf')](_0xf0ab('0x12'),auth[_0xf0ab('0x8')](),interaction[_0xf0ab('0x13')](_0xf0ab('0x14'),_0xf0ab('0x15')),controller[_0xf0ab('0x16')]);router[_0xf0ab('0x17')](_0xf0ab('0xb'),auth[_0xf0ab('0x8')](),interaction[_0xf0ab('0x13')](_0xf0ab('0x14'),_0xf0ab('0x18')),controller[_0xf0ab('0x19')]);router['delete'](_0xf0ab('0xb'),auth[_0xf0ab('0x8')](),interaction[_0xf0ab('0x13')](_0xf0ab('0x14'),_0xf0ab('0x1a')),controller[_0xf0ab('0x1b')]);router[_0xf0ab('0x1c')](_0xf0ab('0x12'),auth[_0xf0ab('0x8')](),controller[_0xf0ab('0x1d')]);module[_0xf0ab('0x1e')]=router; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.attributes.js b/server/api/smsInteraction/smsInteraction.attributes.js index b380bba..6ebab92 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 _0xa329=['STRING','DATE','ENUM','out','sequelize','moment','BOOLEAN'];(function(_0x1a8192,_0x3453f2){var _0x131de2=function(_0x50ab1c){while(--_0x50ab1c){_0x1a8192['push'](_0x1a8192['shift']());}};_0x131de2(++_0x3453f2);}(_0xa329,0x162));var _0x9a32=function(_0x5d0fc9,_0x133191){_0x5d0fc9=_0x5d0fc9-0x0;var _0x20c15a=_0xa329[_0x5d0fc9];return _0x20c15a;};'use strict';var Sequelize=require(_0x9a32('0x0'));var moment=require(_0x9a32('0x1'));module['exports']={'closed':{'type':Sequelize[_0x9a32('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x9a32('0x3')]},'secondDisposition':{'type':Sequelize[_0x9a32('0x3')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0x9a32('0x3')]},'read1stAt':{'type':Sequelize[_0x9a32('0x4')]},'firstMsgDirection':{'type':Sequelize[_0x9a32('0x5')]('in',_0x9a32('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x9a32('0x4')]},'lastMsgDirection':{'type':Sequelize[_0x9a32('0x5')]('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0xbb59=['BOOLEAN','INTEGER','sequelize','moment','exports','STRING','ENUM','out','DATE'];(function(_0x5a14dd,_0x868dbc){var _0x3b5aeb=function(_0x4cebc8){while(--_0x4cebc8){_0x5a14dd['push'](_0x5a14dd['shift']());}};_0x3b5aeb(++_0x868dbc);}(_0xbb59,0xec));var _0x9bb5=function(_0xfda67d,_0x4e77eb){_0xfda67d=_0xfda67d-0x0;var _0x32cc6e=_0xbb59[_0xfda67d];return _0x32cc6e;};'use strict';var Sequelize=require(_0x9bb5('0x0'));var moment=require(_0x9bb5('0x1'));module[_0x9bb5('0x2')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x9bb5('0x3')]},'secondDisposition':{'type':Sequelize[_0x9bb5('0x3')]},'thirdDisposition':{'type':Sequelize[_0x9bb5('0x3')]},'note':{'type':Sequelize[_0x9bb5('0x3')]},'phone':{'type':Sequelize[_0x9bb5('0x3')]},'read1stAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize[_0x9bb5('0x4')]('in',_0x9bb5('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x9bb5('0x6')]},'lastMsgDirection':{'type':Sequelize[_0x9bb5('0x4')]('in',_0x9bb5('0x5')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x9bb5('0x7')],'defaultValue':![]},'queueId':{'type':Sequelize[_0x9bb5('0x8')]}}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.controller.js b/server/api/smsInteraction/smsInteraction.controller.js index c981e1a..a4e1082 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 _0x20e2=['Sms','N.A.','closed','closedAt','toString','disposition','out','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','err','unlinkSync','rimraf','zip-dir','moment','bluebird','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','../../config/environment','redis','defaults','localhost','socket.io-emitter','./smsInteraction.socket','sendStatus','status','end','json','limit','undefined','count','offset','set','Content-Range','then','destroy','error','name','send','index','SmsInteraction','type','key','getOptions','findAll','sms','query','user','catch','show','model','keys','rawAttributes','attributes','intersection','fields','length','includeAll','include','merge','options','find','create','update','body','params','describe','addMessage','SmsMessage','ids','omit','getMessages','findOne','filters','hasOwnProperty','nolimit','order','sort','where','SmsInteractionId','filter','map','format','YYYY-MM-DD\x20HH:mm:ss','rows','addTags','setTags','Tag','emit','smsInteractionTags:save','removeTags','download','unix','join','root','server','files','tmp','transcript-%d-%s.zip','User','fullname','CmContact','Contact','firstName','lastName','Messages','createdAt','direction','secret','read','push','SmsAccount','Account','Owner','get','mkdirSync'];(function(_0xb275c8,_0x302b37){var _0x9b8a25=function(_0x4c123b){while(--_0x4c123b){_0xb275c8['push'](_0xb275c8['shift']());}};_0x9b8a25(++_0x302b37);}(_0x20e2,0x8b));var _0x220e=function(_0x223436,_0x2f58e0){_0x223436=_0x223436-0x0;var _0x45092f=_0x20e2[_0x223436];return _0x45092f;};'use strict';var rimraf=require(_0x220e('0x0'));var zipdir=require(_0x220e('0x1'));var moment=require(_0x220e('0x2'));var BPromise=require(_0x220e('0x3'));var util=require('util');var path=require('path');var ejs=require('ejs');var fs=require('fs');var _=require(_0x220e('0x4'));var Redis=require(_0x220e('0x5'));var interaction=require(_0x220e('0x6'));var qs=require(_0x220e('0x7'));var pdf=require(_0x220e('0x8'));var logger=require(_0x220e('0x9'))(_0x220e('0xa'));var config=require(_0x220e('0xb'));var db=require('../../mysqldb')['db'];config[_0x220e('0xc')]=_[_0x220e('0xd')](config[_0x220e('0xc')],{'host':_0x220e('0xe'),'port':0x18eb});var socket=require(_0x220e('0xf'))(new Redis(config[_0x220e('0xc')]));require(_0x220e('0x10'))['register'](socket);function respondWithStatusCode(_0x4ec22d,_0x13d102){_0x13d102=_0x13d102||0xcc;return function(_0x379a51){if(_0x379a51){return _0x4ec22d[_0x220e('0x11')](_0x13d102);}return _0x4ec22d[_0x220e('0x12')](_0x13d102)[_0x220e('0x13')]();};}function respondWithResult(_0x1af378,_0xb36a39){_0xb36a39=_0xb36a39||0xc8;return function(_0x58a5d9){if(_0x58a5d9){return _0x1af378[_0x220e('0x12')](_0xb36a39)[_0x220e('0x14')](_0x58a5d9);}};}function respondWithFilteredResult(_0x4b6a40,_0x3e484a){return function(_0xc32fa8){if(_0xc32fa8){var _0x107b26=typeof _0x3e484a['offset']==='undefined'&&typeof _0x3e484a[_0x220e('0x15')]===_0x220e('0x16');var _0xd67fb2=_0xc32fa8[_0x220e('0x17')];var _0x4e06c5=_0x107b26?0x0:_0x3e484a['offset'];var _0x3fe59d=_0x107b26?_0xc32fa8[_0x220e('0x17')]:_0x3e484a[_0x220e('0x18')]+_0x3e484a[_0x220e('0x15')];var _0xade26c;if(_0x3fe59d>=_0xd67fb2){_0x3fe59d=_0xd67fb2;_0xade26c=0xc8;}else{_0xade26c=0xce;}_0x4b6a40[_0x220e('0x12')](_0xade26c);return _0x4b6a40[_0x220e('0x19')](_0x220e('0x1a'),_0x4e06c5+'-'+_0x3fe59d+'/'+_0xd67fb2)[_0x220e('0x14')](_0xc32fa8);}return null;};}function saveUpdates(_0x12347f){return function(_0x3b38bf){if(_0x3b38bf){return _0x3b38bf['update'](_0x12347f)[_0x220e('0x1b')](function(_0x1e056e){return _0x1e056e;});}return null;};}function removeEntity(_0xd9a157){return function(_0x3cc8ee){if(_0x3cc8ee){return _0x3cc8ee[_0x220e('0x1c')]()[_0x220e('0x1b')](function(){_0xd9a157[_0x220e('0x12')](0xcc)[_0x220e('0x13')]();});}};}function handleEntityNotFound(_0x55a42c){return function(_0x3af5be){if(!_0x3af5be){_0x55a42c[_0x220e('0x11')](0x194);}return _0x3af5be;};}function handleError(_0x1bdd34,_0x3efa71){_0x3efa71=_0x3efa71||0x1f4;return function(_0x394a22){logger[_0x220e('0x1d')](_0x394a22['stack']);if(_0x394a22[_0x220e('0x1e')]){delete _0x394a22[_0x220e('0x1e')];}_0x1bdd34[_0x220e('0x12')](_0x3efa71)[_0x220e('0x1f')](_0x394a22);};}exports[_0x220e('0x20')]=function(_0x510cd1,_0x554c50){var _0x22ac0f={};var _0x8317da=_['map'](db[_0x220e('0x21')]['rawAttributes'],function(_0x524931){return{'name':_0x524931['fieldName'],'type':_0x524931[_0x220e('0x22')][_0x220e('0x23')]};});_0x22ac0f=qs[_0x220e('0x24')](_0x8317da,_0x510cd1);return interaction[_0x220e('0x25')](_0x220e('0x26'),_0x510cd1[_0x220e('0x27')],_0x510cd1[_0x220e('0x28')],_0x22ac0f,_0x8317da)[_0x220e('0x1b')](respondWithFilteredResult(_0x554c50,_0x22ac0f))[_0x220e('0x29')](handleError(_0x554c50,null));};exports[_0x220e('0x2a')]=function(_0x3d36d7,_0x269c56){var _0x32b90d={'raw':![],'where':{'id':_0x3d36d7['params']['id']}},_0x16cf96={};_0x16cf96[_0x220e('0x2b')]=_[_0x220e('0x2c')](db[_0x220e('0x21')][_0x220e('0x2d')]);_0x16cf96[_0x220e('0x27')]=_[_0x220e('0x2c')](_0x3d36d7[_0x220e('0x27')]);_0x16cf96['filters']=_['intersection'](_0x16cf96['model'],_0x16cf96['query']);_0x32b90d[_0x220e('0x2e')]=_[_0x220e('0x2f')](_0x16cf96[_0x220e('0x2b')],qs['fields'](_0x3d36d7[_0x220e('0x27')][_0x220e('0x30')]));_0x32b90d['attributes']=_0x32b90d['attributes'][_0x220e('0x31')]?_0x32b90d[_0x220e('0x2e')]:_0x16cf96[_0x220e('0x2b')];if(_0x3d36d7[_0x220e('0x27')][_0x220e('0x32')]){_0x32b90d[_0x220e('0x33')]=[{'all':!![]}];}_0x32b90d=_[_0x220e('0x34')]({},_0x32b90d,_0x3d36d7[_0x220e('0x35')]);return db[_0x220e('0x21')][_0x220e('0x36')](_0x32b90d)[_0x220e('0x1b')](handleEntityNotFound(_0x269c56,null))[_0x220e('0x1b')](respondWithResult(_0x269c56,null))['catch'](handleError(_0x269c56,null));};exports[_0x220e('0x37')]=function(_0x231ffb,_0x207be1){return db[_0x220e('0x21')][_0x220e('0x37')](_0x231ffb['body'],{})[_0x220e('0x1b')](respondWithResult(_0x207be1,0xc9))[_0x220e('0x29')](handleError(_0x207be1,null));};exports[_0x220e('0x38')]=function(_0xcd41,_0x4fac55){if(_0xcd41['body']['id']){delete _0xcd41[_0x220e('0x39')]['id'];}return db[_0x220e('0x21')][_0x220e('0x36')]({'where':{'id':_0xcd41[_0x220e('0x3a')]['id']}})[_0x220e('0x1b')](handleEntityNotFound(_0x4fac55,null))[_0x220e('0x1b')](saveUpdates(_0xcd41[_0x220e('0x39')],null))[_0x220e('0x1b')](respondWithResult(_0x4fac55,null))[_0x220e('0x29')](handleError(_0x4fac55,null));};exports['destroy']=function(_0x247e23,_0x3c035d){return db['SmsInteraction'][_0x220e('0x36')]({'where':{'id':_0x247e23['params']['id']}})[_0x220e('0x1b')](handleEntityNotFound(_0x3c035d,null))['then'](removeEntity(_0x3c035d,null))[_0x220e('0x29')](handleError(_0x3c035d,null));};exports[_0x220e('0x3b')]=function(_0x13cfb5,_0x41eb80){return db['SmsInteraction'][_0x220e('0x3b')]()[_0x220e('0x1b')](respondWithResult(_0x41eb80,null))['catch'](handleError(_0x41eb80,null));};exports[_0x220e('0x3c')]=function(_0x1dd99c,_0x3eba08){return db[_0x220e('0x3d')][_0x220e('0x36')]({'where':{'id':_0x1dd99c[_0x220e('0x3a')]['id']}})['then'](handleEntityNotFound(_0x3eba08,null))[_0x220e('0x1b')](function(_0x122612){if(_0x122612){return _0x122612[_0x220e('0x3c')](_0x1dd99c[_0x220e('0x39')][_0x220e('0x3e')],_[_0x220e('0x3f')](_0x1dd99c[_0x220e('0x39')],[_0x220e('0x3e'),'id'])||{});}})[_0x220e('0x1b')](respondWithResult(_0x3eba08,null))[_0x220e('0x29')](handleError(_0x3eba08,null));};exports[_0x220e('0x40')]=function(_0x52e181,_0x3f326d){var _0x316c66={'raw':![],'where':{}};var _0x5db692={};var _0x39af4d={'count':0x0,'rows':[]};return db[_0x220e('0x21')][_0x220e('0x41')]({'where':{'id':_0x52e181[_0x220e('0x3a')]['id']}})[_0x220e('0x1b')](handleEntityNotFound(_0x3f326d,null))[_0x220e('0x1b')](function(_0x550bed){if(_0x550bed){_0x5db692[_0x220e('0x2b')]=_[_0x220e('0x2c')](db['SmsMessage'][_0x220e('0x2d')]);_0x5db692[_0x220e('0x27')]=_[_0x220e('0x2c')](_0x52e181[_0x220e('0x27')]);_0x5db692[_0x220e('0x42')]=_[_0x220e('0x2f')](_0x5db692[_0x220e('0x2b')],_0x5db692[_0x220e('0x27')]);_0x316c66[_0x220e('0x2e')]=_[_0x220e('0x2f')](_0x5db692[_0x220e('0x2b')],qs['fields'](_0x52e181[_0x220e('0x27')][_0x220e('0x30')]));_0x316c66[_0x220e('0x2e')]=_0x316c66[_0x220e('0x2e')]['length']?_0x316c66[_0x220e('0x2e')]:_0x5db692[_0x220e('0x2b')];if(!_0x52e181['query'][_0x220e('0x43')](_0x220e('0x44'))){_0x316c66[_0x220e('0x15')]=qs[_0x220e('0x15')](_0x52e181['query'][_0x220e('0x15')]);_0x316c66[_0x220e('0x18')]=qs['offset'](_0x52e181[_0x220e('0x27')][_0x220e('0x18')]);}_0x316c66[_0x220e('0x45')]=qs[_0x220e('0x46')](_0x52e181[_0x220e('0x27')][_0x220e('0x46')]);_0x316c66[_0x220e('0x47')]=qs[_0x220e('0x42')](_['pick'](_0x52e181[_0x220e('0x27')],_0x5db692[_0x220e('0x42')]));_0x316c66['where'][_0x220e('0x48')]=_0x550bed['id'];if(_0x52e181[_0x220e('0x27')][_0x220e('0x49')]){_0x316c66[_0x220e('0x47')]=_['merge'](_0x316c66['where'],{'$or':_[_0x220e('0x4a')](_0x316c66['attributes'],function(_0x3077f5){var _0x30e073={};_0x30e073[_0x3077f5]={'$like':'%'+_0x52e181[_0x220e('0x27')][_0x220e('0x49')]+'%'};return _0x30e073;})});}if(_0x52e181[_0x220e('0x27')]['$gte']){var _0x168d20=_0x52e181[_0x220e('0x27')]['$gte']['split'](',');var _0x6e4223={};_0x6e4223[_0x168d20[0x0]]={'$gte':moment(_0x168d20[0x1])[_0x220e('0x4b')](_0x220e('0x4c'))};_0x316c66[_0x220e('0x47')]=_[_0x220e('0x34')](_0x316c66[_0x220e('0x47')],_0x6e4223);}_0x316c66=_[_0x220e('0x34')]({},_0x316c66,_0x52e181[_0x220e('0x35')]);return db[_0x220e('0x3d')][_0x220e('0x17')]({'where':_0x316c66[_0x220e('0x47')]})[_0x220e('0x1b')](function(_0x2d7c72){_0x39af4d[_0x220e('0x17')]=_0x2d7c72;if(_0x52e181[_0x220e('0x27')][_0x220e('0x32')]){_0x316c66[_0x220e('0x33')]=[{'all':!![]}];}return db[_0x220e('0x3d')]['findAll'](_0x316c66);})[_0x220e('0x1b')](function(_0x1a0801){_0x39af4d[_0x220e('0x4d')]=_0x1a0801;return _0x39af4d;});}})[_0x220e('0x1b')](respondWithFilteredResult(_0x3f326d,_0x316c66))[_0x220e('0x29')](handleError(_0x3f326d,null));};exports[_0x220e('0x4e')]=function(_0x525cee,_0x1ad64f){return db['SmsInteraction'][_0x220e('0x36')]({'where':{'id':_0x525cee[_0x220e('0x3a')]['id']}})[_0x220e('0x1b')](handleEntityNotFound(_0x1ad64f,null))[_0x220e('0x1b')](function(_0x288349){if(_0x288349){return _0x288349[_0x220e('0x4f')](_0x525cee[_0x220e('0x39')][_0x220e('0x3e')],_[_0x220e('0x3f')](_0x525cee[_0x220e('0x39')],['ids','id'])||{})['spread'](function(){return db[_0x220e('0x50')][_0x220e('0x25')]({'attributes':['id',_0x220e('0x1e'),'color'],'where':{'id':_0x525cee[_0x220e('0x39')][_0x220e('0x3e')]}});})[_0x220e('0x1b')](function(_0x44e70b){socket[_0x220e('0x51')](_0x220e('0x52'),{'id':Number(_0x525cee[_0x220e('0x3a')]['id']),'tags':_0x44e70b||[]});return{'id':Number(_0x525cee[_0x220e('0x3a')]['id']),'tags':_0x44e70b||[]};});}})[_0x220e('0x1b')](respondWithResult(_0x1ad64f,null))['catch'](handleError(_0x1ad64f,null));};exports[_0x220e('0x53')]=function(_0x1ca82a,_0x27fe46){return db[_0x220e('0x21')][_0x220e('0x36')]({'where':{'id':_0x1ca82a[_0x220e('0x3a')]['id']}})[_0x220e('0x1b')](handleEntityNotFound(_0x27fe46,null))['then'](function(_0x124432){if(_0x124432){return _0x124432[_0x220e('0x53')](_0x1ca82a['query'][_0x220e('0x3e')]);}})[_0x220e('0x1b')](respondWithStatusCode(_0x27fe46,null))[_0x220e('0x29')](handleError(_0x27fe46,null));};exports[_0x220e('0x54')]=function(_0xf6a15b,_0x55f690){var _0x2a0f21=moment()[_0x220e('0x55')]()['toString']();var _0x453432=path[_0x220e('0x56')](config[_0x220e('0x57')],_0x220e('0x58'),_0x220e('0x59'),_0x220e('0x5a'));var _0x4aa274=path[_0x220e('0x56')](_0x453432,_0x2a0f21);var _0x32ef96=util[_0x220e('0x4b')](_0x220e('0x5b'),_0xf6a15b[_0x220e('0x3a')]['id'],_0x2a0f21);var _0x2001cd=path[_0x220e('0x56')](_0x453432,_0x32ef96);var _0x3818de=[];_0x3818de['push']({'model':db['User'],'as':_0x220e('0x5c'),'attributes':['id',_0x220e('0x5d')],'raw':!![]});_0x3818de['push']({'model':db[_0x220e('0x5e')],'as':_0x220e('0x5f'),'attributes':['id',_0x220e('0x60'),_0x220e('0x61')],'raw':!![]});var _0x581283=[{'model':db[_0x220e('0x3d')],'as':_0x220e('0x62'),'attributes':['id',_0x220e('0x39'),_0x220e('0x63'),_0x220e('0x64'),_0x220e('0x65'),_0x220e('0x66')],'include':_0x3818de}];_0x581283[_0x220e('0x67')]({'model':db[_0x220e('0x68')],'as':_0x220e('0x69'),'attributes':['id',_0x220e('0x1e')]});_0x581283[_0x220e('0x67')]({'model':db[_0x220e('0x5c')],'as':_0x220e('0x6a'),'attributes':['id',_0x220e('0x5d')]});return db[_0x220e('0x21')][_0x220e('0x36')]({'where':{'id':_0xf6a15b[_0x220e('0x3a')]['id']},'include':_0x581283})['then'](handleEntityNotFound(_0x55f690,null))[_0x220e('0x1b')](function(_0x497d08){if(_0x497d08){var _0x4f799b=_0x497d08[_0x220e('0x6b')]({'plain':!![]});fs[_0x220e('0x6c')](_0x4aa274);var _0x548a97={'channel':_0x220e('0x6d'),'account':_0x4f799b[_0x220e('0x69')][_0x220e('0x1e')],'agent':_0x4f799b['Owner']?_0x4f799b['Owner'][_0x220e('0x5d')]:_0x220e('0x6e'),'createdAt':moment(_0x4f799b[_0x220e('0x63')])[_0x220e('0x4b')]('YYYY-MM-DD\x20HH:mm:ss')['toString'](),'closedAt':_0x4f799b[_0x220e('0x6f')]?moment(_0x4f799b[_0x220e('0x70')])['format'](_0x220e('0x4c'))[_0x220e('0x71')]():'','disposition':_0x4f799b[_0x220e('0x72')],'messages':_(_0x4f799b[_0x220e('0x62')])['filter']({'secret':![]})[_0x220e('0x4a')](function(_0x311e97){return{'date':moment(_0x311e97[_0x220e('0x63')])[_0x220e('0x4b')](_0x220e('0x4c'))[_0x220e('0x71')](),'sender':_0x311e97[_0x220e('0x64')]===_0x220e('0x73')?_0x311e97[_0x220e('0x5c')]?_0x311e97[_0x220e('0x5c')]['fullname']:'System':_0x311e97['Contact'][_0x220e('0x60')]+(_0x311e97[_0x220e('0x5f')][_0x220e('0x61')]?'\x20'+_0x311e97[_0x220e('0x5f')][_0x220e('0x61')]:''),'body':_0x311e97[_0x220e('0x39')],'direction':_0x311e97[_0x220e('0x64')]==='out'?'A':'C','secret':_0x311e97[_0x220e('0x65')],'read':_0x311e97[_0x220e('0x66')]};})['value']()};return ejs[_0x220e('0x74')](path[_0x220e('0x56')](config[_0x220e('0x57')],_0x220e('0x58'),_0x220e('0x75'),_0x220e('0x76')),{'interaction':_0x548a97})[_0x220e('0x1b')](function(_0x58e29d){var _0x43ade1=path['join'](_0x4aa274,_0x220e('0x77')+_0x4f799b['id']+'-'+_0x2a0f21+_0x220e('0x78'));var _0x49a760={'path':_0x43ade1,'channel':_0x220e('0x6d'),'interactionId':_0x4f799b['id']};return pdf[_0x220e('0x79')](_0x58e29d,_0x49a760);})[_0x220e('0x1b')](function(){return new BPromise(function(_0x3d5517,_0x517cf4){zipdir(_0x4aa274,{'saveTo':_0x2001cd},function(_0x3d5f36,_0x5b808f){if(_0x3d5f36)return _0x517cf4(_0x3d5f36);return _0x3d5517(_0x5b808f);});})[_0x220e('0x1b')](function(){return new BPromise(function(_0x565026,_0x3fec44){rimraf(_0x4aa274,function(_0x3b4700){if(_0x3b4700)_0x3fec44(_0x3b4700);return _0x565026();});});})['then'](function(){return _0x55f690['download'](_0x2001cd,_0x32ef96,function(_0x2e90b2){if(_0x2e90b2){console['log'](_0x220e('0x7a'),_0x2e90b2);}else{fs[_0x220e('0x7b')](_0x2001cd);}});});});}else{return _0x55f690['sendStatus'](0xc8);}})[_0x220e('0x29')](handleError(_0x55f690,null));}; \ No newline at end of file +var _0x6df0=['YYYY-MM-DD\x20HH:mm:ss','options','rows','setTags','omit','spread','Tag','findAll','color','emit','removeTags','download','unix','toString','join','root','server','files','transcript-%d-%s.zip','push','User','CmContact','Contact','firstName','lastName','Messages','direction','secret','read','SmsAccount','Account','Owner','get','mkdirSync','Sms','fullname','createdAt','closed','closedAt','map','out','System','value','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','log','err','unlinkSync','zip-dir','bluebird','util','path','lodash','ioredis','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','sendStatus','end','status','offset','limit','count','set','json','update','then','destroy','error','stack','name','SmsInteraction','rawAttributes','key','getOptions','catch','keys','query','filters','model','attributes','fields','includeAll','include','find','create','body','params','describe','addMessage','SmsMessage','ids','getMessages','findOne','intersection','length','hasOwnProperty','nolimit','order','sort','where','pick','SmsInteractionId','filter','merge','split','format'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0x6df0,0xaa));var _0x06df=function(_0x45fc6a,_0x166adb){_0x45fc6a=_0x45fc6a-0x0;var _0x14bcfd=_0x6df0[_0x45fc6a];return _0x14bcfd;};'use strict';var rimraf=require('rimraf');var zipdir=require(_0x06df('0x0'));var moment=require('moment');var BPromise=require(_0x06df('0x1'));var util=require(_0x06df('0x2'));var path=require(_0x06df('0x3'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x06df('0x4'));var Redis=require(_0x06df('0x5'));var interaction=require('../../components/interaction/service');var qs=require(_0x06df('0x6'));var pdf=require(_0x06df('0x7'));var logger=require(_0x06df('0x8'))(_0x06df('0x9'));var config=require(_0x06df('0xa'));var db=require(_0x06df('0xb'))['db'];config[_0x06df('0xc')]=_[_0x06df('0xd')](config[_0x06df('0xc')],{'host':_0x06df('0xe'),'port':0x18eb});var socket=require(_0x06df('0xf'))(new Redis(config[_0x06df('0xc')]));require('./smsInteraction.socket')['register'](socket);function respondWithStatusCode(_0x19af86,_0x38e0ac){_0x38e0ac=_0x38e0ac||0xcc;return function(_0x16fe2f){if(_0x16fe2f){return _0x19af86[_0x06df('0x10')](_0x38e0ac);}return _0x19af86['status'](_0x38e0ac)[_0x06df('0x11')]();};}function respondWithResult(_0x267d50,_0x16b2df){_0x16b2df=_0x16b2df||0xc8;return function(_0x158a81){if(_0x158a81){return _0x267d50[_0x06df('0x12')](_0x16b2df)['json'](_0x158a81);}};}function respondWithFilteredResult(_0x2a5f48,_0x34bcf4){return function(_0x5f45f8){if(_0x5f45f8){var _0x4556eb=typeof _0x34bcf4[_0x06df('0x13')]==='undefined'&&typeof _0x34bcf4[_0x06df('0x14')]==='undefined';var _0x2456d4=_0x5f45f8[_0x06df('0x15')];var _0x361738=_0x4556eb?0x0:_0x34bcf4[_0x06df('0x13')];var _0x284a2f=_0x4556eb?_0x5f45f8['count']:_0x34bcf4['offset']+_0x34bcf4[_0x06df('0x14')];var _0x54e1fb;if(_0x284a2f>=_0x2456d4){_0x284a2f=_0x2456d4;_0x54e1fb=0xc8;}else{_0x54e1fb=0xce;}_0x2a5f48['status'](_0x54e1fb);return _0x2a5f48[_0x06df('0x16')]('Content-Range',_0x361738+'-'+_0x284a2f+'/'+_0x2456d4)[_0x06df('0x17')](_0x5f45f8);}return null;};}function saveUpdates(_0x143625){return function(_0x10b78f){if(_0x10b78f){return _0x10b78f[_0x06df('0x18')](_0x143625)[_0x06df('0x19')](function(_0xe9e3d3){return _0xe9e3d3;});}return null;};}function removeEntity(_0x919fe4){return function(_0x5a6c79){if(_0x5a6c79){return _0x5a6c79[_0x06df('0x1a')]()['then'](function(){_0x919fe4[_0x06df('0x12')](0xcc)[_0x06df('0x11')]();});}};}function handleEntityNotFound(_0x1b4939){return function(_0x2dac96){if(!_0x2dac96){_0x1b4939[_0x06df('0x10')](0x194);}return _0x2dac96;};}function handleError(_0xe9a5a2,_0x30567f){_0x30567f=_0x30567f||0x1f4;return function(_0x583a4d){logger[_0x06df('0x1b')](_0x583a4d[_0x06df('0x1c')]);if(_0x583a4d[_0x06df('0x1d')]){delete _0x583a4d[_0x06df('0x1d')];}_0xe9a5a2[_0x06df('0x12')](_0x30567f)['send'](_0x583a4d);};}exports['index']=function(_0x4f0c85,_0x47dde1){var _0x129c11={};var _0x5ac149=_['map'](db[_0x06df('0x1e')][_0x06df('0x1f')],function(_0x116aa8){return{'name':_0x116aa8['fieldName'],'type':_0x116aa8['type'][_0x06df('0x20')]};});_0x129c11=qs[_0x06df('0x21')](_0x5ac149,_0x4f0c85);return interaction['findAll']('sms',_0x4f0c85['query'],_0x4f0c85['user'],_0x129c11,_0x5ac149)[_0x06df('0x19')](respondWithFilteredResult(_0x47dde1,_0x129c11))[_0x06df('0x22')](handleError(_0x47dde1,null));};exports['show']=function(_0x3b7ce4,_0x5d9a1b){var _0x8f89d5={'raw':![],'where':{'id':_0x3b7ce4['params']['id']}},_0x28e2ee={};_0x28e2ee['model']=_[_0x06df('0x23')](db[_0x06df('0x1e')][_0x06df('0x1f')]);_0x28e2ee[_0x06df('0x24')]=_[_0x06df('0x23')](_0x3b7ce4[_0x06df('0x24')]);_0x28e2ee[_0x06df('0x25')]=_['intersection'](_0x28e2ee[_0x06df('0x26')],_0x28e2ee[_0x06df('0x24')]);_0x8f89d5[_0x06df('0x27')]=_['intersection'](_0x28e2ee[_0x06df('0x26')],qs[_0x06df('0x28')](_0x3b7ce4['query']['fields']));_0x8f89d5['attributes']=_0x8f89d5[_0x06df('0x27')]['length']?_0x8f89d5[_0x06df('0x27')]:_0x28e2ee[_0x06df('0x26')];if(_0x3b7ce4[_0x06df('0x24')][_0x06df('0x29')]){_0x8f89d5[_0x06df('0x2a')]=[{'all':!![]}];}_0x8f89d5=_['merge']({},_0x8f89d5,_0x3b7ce4['options']);return db[_0x06df('0x1e')][_0x06df('0x2b')](_0x8f89d5)[_0x06df('0x19')](handleEntityNotFound(_0x5d9a1b,null))[_0x06df('0x19')](respondWithResult(_0x5d9a1b,null))['catch'](handleError(_0x5d9a1b,null));};exports[_0x06df('0x2c')]=function(_0x136120,_0x5fb461){return db[_0x06df('0x1e')][_0x06df('0x2c')](_0x136120[_0x06df('0x2d')],{})['then'](respondWithResult(_0x5fb461,0xc9))[_0x06df('0x22')](handleError(_0x5fb461,null));};exports[_0x06df('0x18')]=function(_0x38c88e,_0x349086){if(_0x38c88e[_0x06df('0x2d')]['id']){delete _0x38c88e[_0x06df('0x2d')]['id'];}return db[_0x06df('0x1e')][_0x06df('0x2b')]({'where':{'id':_0x38c88e['params']['id']}})[_0x06df('0x19')](handleEntityNotFound(_0x349086,null))[_0x06df('0x19')](saveUpdates(_0x38c88e[_0x06df('0x2d')],null))[_0x06df('0x19')](respondWithResult(_0x349086,null))['catch'](handleError(_0x349086,null));};exports[_0x06df('0x1a')]=function(_0x59822b,_0x1436cc){return db[_0x06df('0x1e')][_0x06df('0x2b')]({'where':{'id':_0x59822b[_0x06df('0x2e')]['id']}})['then'](handleEntityNotFound(_0x1436cc,null))[_0x06df('0x19')](removeEntity(_0x1436cc,null))['catch'](handleError(_0x1436cc,null));};exports[_0x06df('0x2f')]=function(_0x1273ca,_0x312980){return db['SmsInteraction']['describe']()['then'](respondWithResult(_0x312980,null))[_0x06df('0x22')](handleError(_0x312980,null));};exports[_0x06df('0x30')]=function(_0x1049af,_0x5b3e56){return db[_0x06df('0x31')][_0x06df('0x2b')]({'where':{'id':_0x1049af[_0x06df('0x2e')]['id']}})[_0x06df('0x19')](handleEntityNotFound(_0x5b3e56,null))['then'](function(_0x589f95){if(_0x589f95){return _0x589f95[_0x06df('0x30')](_0x1049af[_0x06df('0x2d')][_0x06df('0x32')],_['omit'](_0x1049af['body'],[_0x06df('0x32'),'id'])||{});}})[_0x06df('0x19')](respondWithResult(_0x5b3e56,null))[_0x06df('0x22')](handleError(_0x5b3e56,null));};exports[_0x06df('0x33')]=function(_0xd61603,_0x26257b){var _0x4891d4={'raw':![],'where':{}};var _0x22149a={};var _0x4cfa57={'count':0x0,'rows':[]};return db['SmsInteraction'][_0x06df('0x34')]({'where':{'id':_0xd61603[_0x06df('0x2e')]['id']}})[_0x06df('0x19')](handleEntityNotFound(_0x26257b,null))[_0x06df('0x19')](function(_0x549c89){if(_0x549c89){_0x22149a[_0x06df('0x26')]=_['keys'](db[_0x06df('0x31')][_0x06df('0x1f')]);_0x22149a['query']=_[_0x06df('0x23')](_0xd61603[_0x06df('0x24')]);_0x22149a[_0x06df('0x25')]=_[_0x06df('0x35')](_0x22149a[_0x06df('0x26')],_0x22149a['query']);_0x4891d4['attributes']=_[_0x06df('0x35')](_0x22149a['model'],qs[_0x06df('0x28')](_0xd61603['query']['fields']));_0x4891d4['attributes']=_0x4891d4[_0x06df('0x27')][_0x06df('0x36')]?_0x4891d4['attributes']:_0x22149a['model'];if(!_0xd61603[_0x06df('0x24')][_0x06df('0x37')](_0x06df('0x38'))){_0x4891d4[_0x06df('0x14')]=qs[_0x06df('0x14')](_0xd61603[_0x06df('0x24')][_0x06df('0x14')]);_0x4891d4[_0x06df('0x13')]=qs[_0x06df('0x13')](_0xd61603[_0x06df('0x24')]['offset']);}_0x4891d4[_0x06df('0x39')]=qs[_0x06df('0x3a')](_0xd61603[_0x06df('0x24')][_0x06df('0x3a')]);_0x4891d4[_0x06df('0x3b')]=qs[_0x06df('0x25')](_[_0x06df('0x3c')](_0xd61603[_0x06df('0x24')],_0x22149a[_0x06df('0x25')]));_0x4891d4[_0x06df('0x3b')][_0x06df('0x3d')]=_0x549c89['id'];if(_0xd61603['query'][_0x06df('0x3e')]){_0x4891d4['where']=_[_0x06df('0x3f')](_0x4891d4[_0x06df('0x3b')],{'$or':_['map'](_0x4891d4[_0x06df('0x27')],function(_0x4d1f84){var _0x5ba6db={};_0x5ba6db[_0x4d1f84]={'$like':'%'+_0xd61603[_0x06df('0x24')][_0x06df('0x3e')]+'%'};return _0x5ba6db;})});}if(_0xd61603[_0x06df('0x24')]['$gte']){var _0x31333b=_0xd61603[_0x06df('0x24')]['$gte'][_0x06df('0x40')](',');var _0x216cbb={};_0x216cbb[_0x31333b[0x0]]={'$gte':moment(_0x31333b[0x1])[_0x06df('0x41')](_0x06df('0x42'))};_0x4891d4[_0x06df('0x3b')]=_[_0x06df('0x3f')](_0x4891d4[_0x06df('0x3b')],_0x216cbb);}_0x4891d4=_[_0x06df('0x3f')]({},_0x4891d4,_0xd61603[_0x06df('0x43')]);return db[_0x06df('0x31')][_0x06df('0x15')]({'where':_0x4891d4[_0x06df('0x3b')]})[_0x06df('0x19')](function(_0x2d4e72){_0x4cfa57[_0x06df('0x15')]=_0x2d4e72;if(_0xd61603['query'][_0x06df('0x29')]){_0x4891d4[_0x06df('0x2a')]=[{'all':!![]}];}return db['SmsMessage']['findAll'](_0x4891d4);})[_0x06df('0x19')](function(_0x296ba5){_0x4cfa57[_0x06df('0x44')]=_0x296ba5;return _0x4cfa57;});}})['then'](respondWithFilteredResult(_0x26257b,_0x4891d4))[_0x06df('0x22')](handleError(_0x26257b,null));};exports['addTags']=function(_0x3c3af1,_0x4eddd1){return db[_0x06df('0x1e')][_0x06df('0x2b')]({'where':{'id':_0x3c3af1['params']['id']}})[_0x06df('0x19')](handleEntityNotFound(_0x4eddd1,null))[_0x06df('0x19')](function(_0x3ba06e){if(_0x3ba06e){return _0x3ba06e[_0x06df('0x45')](_0x3c3af1['body'][_0x06df('0x32')],_[_0x06df('0x46')](_0x3c3af1[_0x06df('0x2d')],[_0x06df('0x32'),'id'])||{})[_0x06df('0x47')](function(){return db[_0x06df('0x48')][_0x06df('0x49')]({'attributes':['id',_0x06df('0x1d'),_0x06df('0x4a')],'where':{'id':_0x3c3af1['body']['ids']}});})[_0x06df('0x19')](function(_0x470ccf){socket[_0x06df('0x4b')]('smsInteractionTags:save',{'id':Number(_0x3c3af1[_0x06df('0x2e')]['id']),'tags':_0x470ccf||[]});return{'id':Number(_0x3c3af1[_0x06df('0x2e')]['id']),'tags':_0x470ccf||[]};});}})['then'](respondWithResult(_0x4eddd1,null))[_0x06df('0x22')](handleError(_0x4eddd1,null));};exports[_0x06df('0x4c')]=function(_0x85f936,_0x3a5edc){return db[_0x06df('0x1e')]['find']({'where':{'id':_0x85f936['params']['id']}})[_0x06df('0x19')](handleEntityNotFound(_0x3a5edc,null))[_0x06df('0x19')](function(_0x52fc50){if(_0x52fc50){return _0x52fc50['removeTags'](_0x85f936[_0x06df('0x24')]['ids']);}})[_0x06df('0x19')](respondWithStatusCode(_0x3a5edc,null))[_0x06df('0x22')](handleError(_0x3a5edc,null));};exports[_0x06df('0x4d')]=function(_0x12703d,_0x50b0d6){var _0x1ff7d3=moment()[_0x06df('0x4e')]()[_0x06df('0x4f')]();var _0x26fb0d=path[_0x06df('0x50')](config[_0x06df('0x51')],_0x06df('0x52'),_0x06df('0x53'),'tmp');var _0x3cd6a9=path[_0x06df('0x50')](_0x26fb0d,_0x1ff7d3);var _0x537de7=util[_0x06df('0x41')](_0x06df('0x54'),_0x12703d['params']['id'],_0x1ff7d3);var _0x4a2155=path[_0x06df('0x50')](_0x26fb0d,_0x537de7);var _0x270a84=[];_0x270a84[_0x06df('0x55')]({'model':db[_0x06df('0x56')],'as':_0x06df('0x56'),'attributes':['id','fullname'],'raw':!![]});_0x270a84[_0x06df('0x55')]({'model':db[_0x06df('0x57')],'as':_0x06df('0x58'),'attributes':['id',_0x06df('0x59'),_0x06df('0x5a')],'raw':!![]});var _0x4ec7e2=[{'model':db[_0x06df('0x31')],'as':_0x06df('0x5b'),'attributes':['id',_0x06df('0x2d'),'createdAt',_0x06df('0x5c'),_0x06df('0x5d'),_0x06df('0x5e')],'include':_0x270a84}];_0x4ec7e2[_0x06df('0x55')]({'model':db[_0x06df('0x5f')],'as':_0x06df('0x60'),'attributes':['id',_0x06df('0x1d')]});_0x4ec7e2[_0x06df('0x55')]({'model':db['User'],'as':_0x06df('0x61'),'attributes':['id','fullname']});return db[_0x06df('0x1e')][_0x06df('0x2b')]({'where':{'id':_0x12703d[_0x06df('0x2e')]['id']},'include':_0x4ec7e2})[_0x06df('0x19')](handleEntityNotFound(_0x50b0d6,null))[_0x06df('0x19')](function(_0x372cf0){if(_0x372cf0){var _0x45aeaa=_0x372cf0[_0x06df('0x62')]({'plain':!![]});fs[_0x06df('0x63')](_0x3cd6a9);var _0x72cb7e={'channel':_0x06df('0x64'),'account':_0x45aeaa[_0x06df('0x60')]['name'],'agent':_0x45aeaa[_0x06df('0x61')]?_0x45aeaa[_0x06df('0x61')][_0x06df('0x65')]:'N.A.','createdAt':moment(_0x45aeaa[_0x06df('0x66')])[_0x06df('0x41')](_0x06df('0x42'))[_0x06df('0x4f')](),'closedAt':_0x45aeaa[_0x06df('0x67')]?moment(_0x45aeaa[_0x06df('0x68')])['format'](_0x06df('0x42'))[_0x06df('0x4f')]():'','disposition':_0x45aeaa['disposition'],'messages':_(_0x45aeaa[_0x06df('0x5b')])['filter']({'secret':![]})[_0x06df('0x69')](function(_0x58483f){return{'date':moment(_0x58483f[_0x06df('0x66')])[_0x06df('0x41')]('YYYY-MM-DD\x20HH:mm:ss')[_0x06df('0x4f')](),'sender':_0x58483f[_0x06df('0x5c')]===_0x06df('0x6a')?_0x58483f[_0x06df('0x56')]?_0x58483f[_0x06df('0x56')][_0x06df('0x65')]:_0x06df('0x6b'):_0x58483f[_0x06df('0x58')][_0x06df('0x59')]+(_0x58483f[_0x06df('0x58')][_0x06df('0x5a')]?'\x20'+_0x58483f[_0x06df('0x58')][_0x06df('0x5a')]:''),'body':_0x58483f[_0x06df('0x2d')],'direction':_0x58483f[_0x06df('0x5c')]===_0x06df('0x6a')?'A':'C','secret':_0x58483f[_0x06df('0x5d')],'read':_0x58483f[_0x06df('0x5e')]};})[_0x06df('0x6c')]()};return ejs[_0x06df('0x6d')](path[_0x06df('0x50')](config['root'],_0x06df('0x52'),_0x06df('0x6e'),_0x06df('0x6f')),{'interaction':_0x72cb7e})[_0x06df('0x19')](function(_0x2da795){var _0x7ddef9=path[_0x06df('0x50')](_0x3cd6a9,_0x06df('0x70')+_0x45aeaa['id']+'-'+_0x1ff7d3+_0x06df('0x71'));var _0x468331={'path':_0x7ddef9,'channel':_0x06df('0x64'),'interactionId':_0x45aeaa['id']};return pdf[_0x06df('0x72')](_0x2da795,_0x468331);})['then'](function(){return new BPromise(function(_0x4bbba6,_0xa0cbc4){zipdir(_0x3cd6a9,{'saveTo':_0x4a2155},function(_0x566513,_0x5665dc){if(_0x566513)return _0xa0cbc4(_0x566513);return _0x4bbba6(_0x5665dc);});})[_0x06df('0x19')](function(){return new BPromise(function(_0x28ee20,_0x382e9d){rimraf(_0x3cd6a9,function(_0x42cea6){if(_0x42cea6)_0x382e9d(_0x42cea6);return _0x28ee20();});});})[_0x06df('0x19')](function(){return _0x50b0d6[_0x06df('0x4d')](_0x4a2155,_0x537de7,function(_0x413f9c){if(_0x413f9c){console[_0x06df('0x73')](_0x06df('0x74'),_0x413f9c);}else{fs[_0x06df('0x75')](_0x4a2155);}});});});}else{return _0x50b0d6[_0x06df('0x10')](0xc8);}})[_0x06df('0x22')](handleError(_0x50b0d6,null));}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.events.js b/server/api/smsInteraction/smsInteraction.events.js index 850ff29..070d20b 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 _0x0598=['catch','hasOwnProperty','events','../../mysqldb','save','update','setDataValue','Users','map','then','unreadMessages','length'];(function(_0x368445,_0x4ea524){var _0x3d8efb=function(_0x48ab8a){while(--_0x48ab8a){_0x368445['push'](_0x368445['shift']());}};_0x3d8efb(++_0x4ea524);}(_0x0598,0x92));var _0x8059=function(_0x3ca2ea,_0x27bd68){_0x3ca2ea=_0x3ca2ea-0x0;var _0x535e3f=_0x0598[_0x3ca2ea];return _0x535e3f;};'use strict';var EventEmitter=require(_0x8059('0x0'));var SmsInteraction=require(_0x8059('0x1'))['db']['SmsInteraction'];var SmsMessage=require(_0x8059('0x1'))['db']['SmsMessage'];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x8059('0x2'),'afterUpdate':_0x8059('0x3'),'afterDestroy':'remove'};function emitEvent(_0x54f42f){return function(_0x555fb5,_0x467206,_0xa7d7c1){_0x555fb5['getUsers']({'attributes':['id'],'raw':!![]})['then'](function(_0x248273){_0x555fb5[_0x8059('0x4')](_0x8059('0x5'),_0x248273[_0x8059('0x6')](function(_0x5df268){return{'id':_0x5df268['id']};}));return SmsMessage['findAll']({'where':{'SmsInteractionId':_0x555fb5['id'],'direction':'in','read':![]},'raw':!![]});})[_0x8059('0x7')](function(_0x1bf5fd){_0x555fb5[_0x8059('0x4')](_0x8059('0x8'),_0x1bf5fd[_0x8059('0x9')]);SmsInteractionEvents['emit'](_0x54f42f+':'+_0x555fb5['id'],_0x555fb5);SmsInteractionEvents['emit'](_0x54f42f,_0x555fb5);_0xa7d7c1(null);})[_0x8059('0xa')](_0xa7d7c1(null));};}for(var e in events){if(events[_0x8059('0xb')](e)){var event=events[e];SmsInteraction['hook'](e,emitEvent(event));}}module['exports']=SmsInteractionEvents; \ No newline at end of file +var _0xd943=['setMaxListeners','save','update','remove','setDataValue','Users','findAll','then','unreadMessages','emit','hasOwnProperty','hook','exports','events','../../mysqldb','SmsInteraction'];(function(_0x5aff3a,_0x3b95b5){var _0x21d809=function(_0x2c47a0){while(--_0x2c47a0){_0x5aff3a['push'](_0x5aff3a['shift']());}};_0x21d809(++_0x3b95b5);}(_0xd943,0x15d));var _0x3d94=function(_0x25c5d3,_0x6bf22f){_0x25c5d3=_0x25c5d3-0x0;var _0x82668b=_0xd943[_0x25c5d3];return _0x82668b;};'use strict';var EventEmitter=require(_0x3d94('0x0'));var SmsInteraction=require(_0x3d94('0x1'))['db'][_0x3d94('0x2')];var SmsMessage=require(_0x3d94('0x1'))['db']['SmsMessage'];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0x3d94('0x3')](0x0);var events={'afterCreate':_0x3d94('0x4'),'afterUpdate':_0x3d94('0x5'),'afterDestroy':_0x3d94('0x6')};function emitEvent(_0xaf8962){return function(_0x5751f6,_0x54e692,_0x34c9c3){_0x5751f6['getUsers']({'attributes':['id'],'raw':!![]})['then'](function(_0x4d29e7){_0x5751f6[_0x3d94('0x7')](_0x3d94('0x8'),_0x4d29e7['map'](function(_0x512766){return{'id':_0x512766['id']};}));return SmsMessage[_0x3d94('0x9')]({'where':{'SmsInteractionId':_0x5751f6['id'],'direction':'in','read':![]},'raw':!![]});})[_0x3d94('0xa')](function(_0x1cc58c){_0x5751f6['setDataValue'](_0x3d94('0xb'),_0x1cc58c['length']);SmsInteractionEvents[_0x3d94('0xc')](_0xaf8962+':'+_0x5751f6['id'],_0x5751f6);SmsInteractionEvents[_0x3d94('0xc')](_0xaf8962,_0x5751f6);_0x34c9c3(null);})['catch'](_0x34c9c3(null));};}for(var e in events){if(events[_0x3d94('0xd')](e)){var event=events[e];SmsInteraction[_0x3d94('0xe')](e,emitEvent(event));}}module[_0x3d94('0xf')]=SmsInteractionEvents; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.model.js b/server/api/smsInteraction/smsInteraction.model.js index a719e05..fc69100 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 _0xd16e=['util','../../config/logger','bluebird','request-promise','path','../../config/environment','exports','define','SmsInteraction','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x1aa96a,_0x515c7f){var _0x2882d4=function(_0x4b85fe){while(--_0x4b85fe){_0x1aa96a['push'](_0x1aa96a['shift']());}};_0x2882d4(++_0x515c7f);}(_0xd16e,0x186));var _0xed16=function(_0x340e6e,_0x291158){_0x340e6e=_0x340e6e-0x0;var _0x582481=_0xd16e[_0x340e6e];return _0x582481;};'use strict';var _=require('lodash');var util=require(_0xed16('0x0'));var logger=require(_0xed16('0x1'))('api');var moment=require('moment');var BPromise=require(_0xed16('0x2'));var rp=require(_0xed16('0x3'));var fs=require('fs');var path=require(_0xed16('0x4'));var rimraf=require('rimraf');var config=require(_0xed16('0x5'));var attributes=require('./smsInteraction.attributes');module[_0xed16('0x6')]=function(_0x4be82d,_0x44002d){return _0x4be82d[_0xed16('0x7')](_0xed16('0x8'),attributes,{'tableName':'sms_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2bc1bb,_0x422e9a,_0x52182d){if(_0x2bc1bb['changed'](_0xed16('0x9'))){_0x2bc1bb[_0xed16('0xa')]=moment()[_0xed16('0xb')](_0xed16('0xc'));}_0x52182d(null,_0x2bc1bb);}}});}; \ No newline at end of file +var _0xc49e=['api','bluebird','request-promise','path','../../config/environment','./smsInteraction.attributes','define','SmsInteraction','sms_interactions','changed','closed','closedAt','format','lodash','util','../../config/logger'];(function(_0xabfec4,_0x35076e){var _0x7bafa2=function(_0x52d551){while(--_0x52d551){_0xabfec4['push'](_0xabfec4['shift']());}};_0x7bafa2(++_0x35076e);}(_0xc49e,0xcd));var _0xec49=function(_0x2faddb,_0xc18b78){_0x2faddb=_0x2faddb-0x0;var _0x273c05=_0xc49e[_0x2faddb];return _0x273c05;};'use strict';var _=require(_0xec49('0x0'));var util=require(_0xec49('0x1'));var logger=require(_0xec49('0x2'))(_0xec49('0x3'));var moment=require('moment');var BPromise=require(_0xec49('0x4'));var rp=require(_0xec49('0x5'));var fs=require('fs');var path=require(_0xec49('0x6'));var rimraf=require('rimraf');var config=require(_0xec49('0x7'));var attributes=require(_0xec49('0x8'));module['exports']=function(_0x2824ff,_0x3ed8f9){return _0x2824ff[_0xec49('0x9')](_0xec49('0xa'),attributes,{'tableName':_0xec49('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x3fbc7e,_0x976c6f,_0x3c80d8){if(_0x3fbc7e[_0xec49('0xc')](_0xec49('0xd'))){_0x3fbc7e[_0xec49('0xe')]=moment()[_0xec49('0xf')]('YYYY-MM-DD\x20HH:mm:ss');}_0x3c80d8(null,_0x3fbc7e);}}});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.rpc.js b/server/api/smsInteraction/smsInteraction.rpc.js index f4df47a..bc0d12a 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 _0x9f0d=['rpc','jayson/promise','client','http','defaults','socket.io-emitter','redis','register','then','info','SmsInteraction,\x20%s,\x20%s','request\x20sent','SmsInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','SmsInteraction','update','body','options','limit','UpdateSmsInteraction','catch','AddTagsToSmsInteraction','find','addTags','ids','spread','AddTags','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x5c1ddc,_0x587040){var _0x542a11=function(_0x532a5d){while(--_0x532a5d){_0x5c1ddc['push'](_0x5c1ddc['shift']());}};_0x542a11(++_0x587040);}(_0x9f0d,0x19a));var _0xd9f0=function(_0x5305da,_0x5c92b5){_0x5305da=_0x5305da-0x0;var _0x7d1443=_0x9f0d[_0x5305da];return _0x7d1443;};'use strict';var _=require('lodash');var util=require(_0xd9f0('0x0'));var moment=require(_0xd9f0('0x1'));var BPromise=require(_0xd9f0('0x2'));var rs=require(_0xd9f0('0x3'));var fs=require('fs');var Redis=require(_0xd9f0('0x4'));var db=require(_0xd9f0('0x5'))['db'];var utils=require(_0xd9f0('0x6'));var logger=require(_0xd9f0('0x7'))(_0xd9f0('0x8'));var config=require('../../config/environment');var jayson=require(_0xd9f0('0x9'));var client=jayson[_0xd9f0('0xa')][_0xd9f0('0xb')]({'port':0x232a});config['redis']=_[_0xd9f0('0xc')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xd9f0('0xd'))(new Redis(config[_0xd9f0('0xe')]));require('./smsInteraction.socket')[_0xd9f0('0xf')](socket);function respondWithRpcPromise(_0x385cee,_0x2b25c3,_0x10197e){return new BPromise(function(_0x3738a6,_0xf1637a){return client['request'](_0x385cee,_0x10197e)[_0xd9f0('0x10')](function(_0x4d332f){logger[_0xd9f0('0x11')](_0xd9f0('0x12'),_0x2b25c3,_0xd9f0('0x13'));logger['debug'](_0xd9f0('0x14'),_0x2b25c3,_0xd9f0('0x13'),JSON[_0xd9f0('0x15')](_0x4d332f));if(_0x4d332f[_0xd9f0('0x16')]){if(_0x4d332f[_0xd9f0('0x16')][_0xd9f0('0x17')]===0x1f4){logger['error'](_0xd9f0('0x12'),_0x2b25c3,_0x4d332f[_0xd9f0('0x16')][_0xd9f0('0x18')]);return _0xf1637a(_0x4d332f[_0xd9f0('0x16')][_0xd9f0('0x18')]);}logger[_0xd9f0('0x16')](_0xd9f0('0x12'),_0x2b25c3,_0x4d332f[_0xd9f0('0x16')][_0xd9f0('0x18')]);return _0x3738a6(_0x4d332f[_0xd9f0('0x16')][_0xd9f0('0x18')]);}else{logger[_0xd9f0('0x11')](_0xd9f0('0x12'),_0x2b25c3,_0xd9f0('0x13'));_0x3738a6(_0x4d332f['result'][_0xd9f0('0x18')]);}})['catch'](function(_0xabc7ad){logger[_0xd9f0('0x16')](_0xd9f0('0x12'),_0x2b25c3,_0xabc7ad);_0xf1637a(_0xabc7ad);});});}exports['UpdateSmsInteraction']=function(_0x299e9e){var _0x2b03e8=this;return new Promise(function(_0x221f44,_0x16b9e9){return db[_0xd9f0('0x19')][_0xd9f0('0x1a')](_0x299e9e[_0xd9f0('0x1b')],{'raw':_0x299e9e['options']?_0x299e9e[_0xd9f0('0x1c')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x299e9e[_0xd9f0('0x1c')]?_0x299e9e[_0xd9f0('0x1c')]['where']||null:null,'attributes':_0x299e9e[_0xd9f0('0x1c')]?_0x299e9e[_0xd9f0('0x1c')]['attributes']||null:null,'limit':_0x299e9e[_0xd9f0('0x1c')]?_0x299e9e[_0xd9f0('0x1c')][_0xd9f0('0x1d')]||null:null})[_0xd9f0('0x10')](function(_0x3ea123){logger[_0xd9f0('0x11')](_0xd9f0('0x1e'),_0x299e9e);logger['debug'](_0xd9f0('0x1e'),_0x299e9e,JSON['stringify'](_0x3ea123));_0x221f44(_0x3ea123);})[_0xd9f0('0x1f')](function(_0x355ea5){logger['error'](_0xd9f0('0x1e'),_0x355ea5[_0xd9f0('0x18')],_0x299e9e);_0x16b9e9(_0x2b03e8['error'](0x1f4,_0x355ea5[_0xd9f0('0x18')]));});});};exports[_0xd9f0('0x20')]=function(_0x3bb699){return new Promise(function(_0x344086,_0x32f6c1){return db['SmsInteraction'][_0xd9f0('0x21')]({'where':_0x3bb699[_0xd9f0('0x1c')]?_0x3bb699[_0xd9f0('0x1c')]['where']||null:null})[_0xd9f0('0x10')](function(_0x539f07){if(_0x539f07){return _0x539f07[_0xd9f0('0x22')](_0x3bb699[_0xd9f0('0x1b')][_0xd9f0('0x23')],_['omit'](_0x3bb699['body'],[_0xd9f0('0x23'),'id'])||{});}})[_0xd9f0('0x24')](function(_0x4a66bf){logger[_0xd9f0('0x11')]('AddTags',_0x3bb699);logger['debug'](_0xd9f0('0x25'),_0x3bb699,JSON[_0xd9f0('0x15')](_0x4a66bf));_0x344086(_0x4a66bf);})[_0xd9f0('0x1f')](function(_0x4cd81e){logger['error'](_0xd9f0('0x25'),_0x4cd81e['message'],_0x3bb699);_0x32f6c1(_this[_0xd9f0('0x16')](0x1f4,_0x4cd81e[_0xd9f0('0x18')]));});});}; \ No newline at end of file +var _0x3478=['attributes','find','addTags','ids','omit','spread','AddTags','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','./smsInteraction.socket','request','then','info','SmsInteraction,\x20%s,\x20%s','debug','SmsInteraction,\x20%s,\x20%s,\x20%s','stringify','code','error','message','request\x20sent','catch','UpdateSmsInteraction','SmsInteraction','body','options','where'];(function(_0x58a50e,_0x12a952){var _0x3b1e57=function(_0x47a31a){while(--_0x47a31a){_0x58a50e['push'](_0x58a50e['shift']());}};_0x3b1e57(++_0x12a952);}(_0x3478,0x1db));var _0x8347=function(_0x55dfca,_0x4bdb29){_0x55dfca=_0x55dfca-0x0;var _0x21fa48=_0x3478[_0x55dfca];return _0x21fa48;};'use strict';var _=require(_0x8347('0x0'));var util=require(_0x8347('0x1'));var moment=require(_0x8347('0x2'));var BPromise=require('bluebird');var rs=require(_0x8347('0x3'));var fs=require('fs');var Redis=require(_0x8347('0x4'));var db=require(_0x8347('0x5'))['db'];var utils=require(_0x8347('0x6'));var logger=require(_0x8347('0x7'))(_0x8347('0x8'));var config=require(_0x8347('0x9'));var jayson=require(_0x8347('0xa'));var client=jayson['client'][_0x8347('0xb')]({'port':0x232a});config[_0x8347('0xc')]=_[_0x8347('0xd')](config[_0x8347('0xc')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x8347('0xc')]));require(_0x8347('0xe'))['register'](socket);function respondWithRpcPromise(_0x3c1789,_0x4effdd,_0x373a96){return new BPromise(function(_0x31b2f6,_0x2eb62a){return client[_0x8347('0xf')](_0x3c1789,_0x373a96)[_0x8347('0x10')](function(_0xa5bfd2){logger[_0x8347('0x11')](_0x8347('0x12'),_0x4effdd,'request\x20sent');logger[_0x8347('0x13')](_0x8347('0x14'),_0x4effdd,'request\x20sent',JSON[_0x8347('0x15')](_0xa5bfd2));if(_0xa5bfd2['error']){if(_0xa5bfd2['error'][_0x8347('0x16')]===0x1f4){logger[_0x8347('0x17')](_0x8347('0x12'),_0x4effdd,_0xa5bfd2[_0x8347('0x17')][_0x8347('0x18')]);return _0x2eb62a(_0xa5bfd2[_0x8347('0x17')]['message']);}logger[_0x8347('0x17')](_0x8347('0x12'),_0x4effdd,_0xa5bfd2[_0x8347('0x17')][_0x8347('0x18')]);return _0x31b2f6(_0xa5bfd2[_0x8347('0x17')][_0x8347('0x18')]);}else{logger[_0x8347('0x11')]('SmsInteraction,\x20%s,\x20%s',_0x4effdd,_0x8347('0x19'));_0x31b2f6(_0xa5bfd2['result'][_0x8347('0x18')]);}})[_0x8347('0x1a')](function(_0x19acc4){logger[_0x8347('0x17')](_0x8347('0x12'),_0x4effdd,_0x19acc4);_0x2eb62a(_0x19acc4);});});}exports[_0x8347('0x1b')]=function(_0x89dba5){var _0x1413e0=this;return new Promise(function(_0x345441,_0x4bd50b){return db[_0x8347('0x1c')]['update'](_0x89dba5[_0x8347('0x1d')],{'raw':_0x89dba5['options']?_0x89dba5['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x89dba5[_0x8347('0x1e')]?_0x89dba5[_0x8347('0x1e')][_0x8347('0x1f')]||null:null,'attributes':_0x89dba5[_0x8347('0x1e')]?_0x89dba5[_0x8347('0x1e')][_0x8347('0x20')]||null:null,'limit':_0x89dba5[_0x8347('0x1e')]?_0x89dba5[_0x8347('0x1e')]['limit']||null:null})[_0x8347('0x10')](function(_0x17cd5d){logger[_0x8347('0x11')](_0x8347('0x1b'),_0x89dba5);logger[_0x8347('0x13')](_0x8347('0x1b'),_0x89dba5,JSON[_0x8347('0x15')](_0x17cd5d));_0x345441(_0x17cd5d);})[_0x8347('0x1a')](function(_0x132903){logger['error'](_0x8347('0x1b'),_0x132903[_0x8347('0x18')],_0x89dba5);_0x4bd50b(_0x1413e0[_0x8347('0x17')](0x1f4,_0x132903['message']));});});};exports['AddTagsToSmsInteraction']=function(_0x2810ca){return new Promise(function(_0x58cc74,_0x183db5){return db[_0x8347('0x1c')][_0x8347('0x21')]({'where':_0x2810ca[_0x8347('0x1e')]?_0x2810ca[_0x8347('0x1e')][_0x8347('0x1f')]||null:null})[_0x8347('0x10')](function(_0xc71346){if(_0xc71346){return _0xc71346[_0x8347('0x22')](_0x2810ca[_0x8347('0x1d')][_0x8347('0x23')],_[_0x8347('0x24')](_0x2810ca[_0x8347('0x1d')],[_0x8347('0x23'),'id'])||{});}})[_0x8347('0x25')](function(_0x3137ee){logger[_0x8347('0x11')](_0x8347('0x26'),_0x2810ca);logger[_0x8347('0x13')](_0x8347('0x26'),_0x2810ca,JSON['stringify'](_0x3137ee));_0x58cc74(_0x3137ee);})[_0x8347('0x1a')](function(_0x4e0e73){logger[_0x8347('0x17')](_0x8347('0x26'),_0x4e0e73[_0x8347('0x18')],_0x2810ca);_0x183db5(_this[_0x8347('0x17')](0x1f4,_0x4e0e73[_0x8347('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.socket.js b/server/api/smsInteraction/smsInteraction.socket.js index d0799ff..97607b9 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 _0x0baf=['update','removeListener','register','length','smsInteraction:','./smsInteraction.events','save'];(function(_0x12bd97,_0x2c8dd2){var _0x365a3c=function(_0x1dff26){while(--_0x1dff26){_0x12bd97['push'](_0x12bd97['shift']());}};_0x365a3c(++_0x2c8dd2);}(_0x0baf,0x155));var _0xf0ba=function(_0x1057a3,_0x28d9b7){_0x1057a3=_0x1057a3-0x0;var _0x131cdb=_0x0baf[_0x1057a3];return _0x131cdb;};'use strict';var SmsInteractionEvents=require(_0xf0ba('0x0'));var events=[_0xf0ba('0x1'),'remove',_0xf0ba('0x2')];function createListener(_0x129d91,_0x24f732){return function(_0x2758f1){_0x24f732['emit'](_0x129d91,_0x2758f1);};}function removeListener(_0x5e1a2e,_0x36017f){return function(){SmsInteractionEvents[_0xf0ba('0x3')](_0x5e1a2e,_0x36017f);};}exports[_0xf0ba('0x4')]=function(_0x23c8d7){for(var _0xb579a5=0x0,_0x57dfd5=events[_0xf0ba('0x5')];_0xb579a5<_0x57dfd5;_0xb579a5++){var _0x32b8fa=events[_0xb579a5];var _0x4a46ea=createListener(_0xf0ba('0x6')+_0x32b8fa,_0x23c8d7);SmsInteractionEvents['on'](_0x32b8fa,_0x4a46ea);}}; \ No newline at end of file +var _0x6e54=['length','smsInteraction:','./smsInteraction.events','save','remove','update','emit','register'];(function(_0x3193c8,_0x556edb){var _0x37dc84=function(_0x2175e4){while(--_0x2175e4){_0x3193c8['push'](_0x3193c8['shift']());}};_0x37dc84(++_0x556edb);}(_0x6e54,0xc2));var _0x46e5=function(_0x2f6233,_0x90172){_0x2f6233=_0x2f6233-0x0;var _0x1c9c36=_0x6e54[_0x2f6233];return _0x1c9c36;};'use strict';var SmsInteractionEvents=require(_0x46e5('0x0'));var events=[_0x46e5('0x1'),_0x46e5('0x2'),_0x46e5('0x3')];function createListener(_0x4b4ac7,_0x3026d0){return function(_0x5964d3){_0x3026d0[_0x46e5('0x4')](_0x4b4ac7,_0x5964d3);};}function removeListener(_0x578b84,_0x36dd57){return function(){SmsInteractionEvents['removeListener'](_0x578b84,_0x36dd57);};}exports[_0x46e5('0x5')]=function(_0x5ddf04){for(var _0x4f0d3c=0x0,_0x197172=events[_0x46e5('0x6')];_0x4f0d3c<_0x197172;_0x4f0d3c++){var _0x1ead7c=events[_0x4f0d3c];var _0x272a97=createListener(_0x46e5('0x7')+_0x1ead7c,_0x5ddf04);SmsInteractionEvents['on'](_0x1ead7c,_0x272a97);}}; \ No newline at end of file diff --git a/server/api/smsMessage/index.js b/server/api/smsMessage/index.js index f0a70dd..cbe68da 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 _0xeb3b=['/:id','show','post','tracked','smsmessage:create','create','/:id/status','status','put','update','accept','reject','delete','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/describe'];(function(_0x3a13cf,_0x478c62){var _0x4817c=function(_0x3a2e75){while(--_0x3a2e75){_0x3a13cf['push'](_0x3a13cf['shift']());}};_0x4817c(++_0x478c62);}(_0xeb3b,0x19e));var _0xbeb3=function(_0x361078,_0x283dcb){_0x361078=_0x361078-0x0;var _0x22d9e8=_0xeb3b[_0x361078];return _0x22d9e8;};'use strict';var multer=require(_0xbeb3('0x0'));var util=require(_0xbeb3('0x1'));var path=require(_0xbeb3('0x2'));var timeout=require(_0xbeb3('0x3'));var express=require(_0xbeb3('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xbeb3('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xbeb3('0x6'));var controller=require('./smsMessage.controller');router[_0xbeb3('0x7')]('/',auth[_0xbeb3('0x8')](),controller[_0xbeb3('0x9')]);router[_0xbeb3('0x7')](_0xbeb3('0xa'),auth[_0xbeb3('0x8')](),controller['describe']);router[_0xbeb3('0x7')](_0xbeb3('0xb'),auth[_0xbeb3('0x8')](),controller[_0xbeb3('0xc')]);router[_0xbeb3('0xd')]('/',auth[_0xbeb3('0x8')](),interaction[_0xbeb3('0xe')]('sms',_0xbeb3('0xf')),controller[_0xbeb3('0x10')]);router['post'](_0xbeb3('0x11'),controller[_0xbeb3('0x12')]);router[_0xbeb3('0x13')](_0xbeb3('0xb'),auth[_0xbeb3('0x8')](),controller[_0xbeb3('0x14')]);router['put']('/:id/accept',auth[_0xbeb3('0x8')](),controller[_0xbeb3('0x15')]);router['put']('/:id/reject',auth[_0xbeb3('0x8')](),controller[_0xbeb3('0x16')]);router[_0xbeb3('0x17')](_0xbeb3('0xb'),auth[_0xbeb3('0x8')](),controller['destroy']);module[_0xbeb3('0x18')]=router; \ No newline at end of file +var _0x15ad=['show','post','tracked','sms','smsmessage:create','status','put','/:id','update','/:id/accept','accept','/:id/reject','reject','delete','destroy','exports','multer','express','Router','fs-extra','../../components/auth/service','../../config/environment','./smsMessage.controller','get','isAuthenticated','index','/describe'];(function(_0x299fb9,_0x5d948f){var _0x5a181c=function(_0xa96742){while(--_0xa96742){_0x299fb9['push'](_0x299fb9['shift']());}};_0x5a181c(++_0x5d948f);}(_0x15ad,0xb2));var _0xd15a=function(_0x1d1358,_0x4e487a){_0x1d1358=_0x1d1358-0x0;var _0x171a0e=_0x15ad[_0x1d1358];return _0x171a0e;};'use strict';var multer=require(_0xd15a('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xd15a('0x1'));var router=express[_0xd15a('0x2')]();var fs_extra=require(_0xd15a('0x3'));var auth=require(_0xd15a('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xd15a('0x5'));var controller=require(_0xd15a('0x6'));router[_0xd15a('0x7')]('/',auth[_0xd15a('0x8')](),controller[_0xd15a('0x9')]);router['get'](_0xd15a('0xa'),auth[_0xd15a('0x8')](),controller['describe']);router['get']('/:id',auth[_0xd15a('0x8')](),controller[_0xd15a('0xb')]);router[_0xd15a('0xc')]('/',auth[_0xd15a('0x8')](),interaction[_0xd15a('0xd')](_0xd15a('0xe'),_0xd15a('0xf')),controller['create']);router[_0xd15a('0xc')]('/:id/status',controller[_0xd15a('0x10')]);router[_0xd15a('0x11')](_0xd15a('0x12'),auth[_0xd15a('0x8')](),controller[_0xd15a('0x13')]);router[_0xd15a('0x11')](_0xd15a('0x14'),auth[_0xd15a('0x8')](),controller[_0xd15a('0x15')]);router[_0xd15a('0x11')](_0xd15a('0x16'),auth[_0xd15a('0x8')](),controller[_0xd15a('0x17')]);router[_0xd15a('0x18')]('/:id',auth[_0xd15a('0x8')](),controller[_0xd15a('0x19')]);module[_0xd15a('0x1a')]=router; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.attributes.js b/server/api/smsMessage/smsMessage.attributes.js index 7da6f48..c44cb44 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 _0xdbf7=['medium','BOOLEAN','ENUM','out','STRING','sequelize','exports','TEXT'];(function(_0x8ba19a,_0x1d2b2b){var _0x2bd8b4=function(_0xee823f){while(--_0xee823f){_0x8ba19a['push'](_0x8ba19a['shift']());}};_0x2bd8b4(++_0x1d2b2b);}(_0xdbf7,0x8d));var _0x7dbf=function(_0x346a1c,_0x166ab8){_0x346a1c=_0x346a1c-0x0;var _0x128d33=_0xdbf7[_0x346a1c];return _0x128d33;};'use strict';var Sequelize=require(_0x7dbf('0x0'));module[_0x7dbf('0x1')]={'body':{'type':Sequelize[_0x7dbf('0x2')](_0x7dbf('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x7dbf('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x7dbf('0x5')]('in',_0x7dbf('0x6')),'defaultValue':_0x7dbf('0x6'),'allowNull':![]},'messageId':{'type':Sequelize['STRING'](0xbe)},'phone':{'type':Sequelize[_0x7dbf('0x7')]},'readAt':{'type':Sequelize['DATE']},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'providerName':{'type':Sequelize[_0x7dbf('0x7')]},'providerResponse':{'type':Sequelize[_0x7dbf('0x2')]}}; \ No newline at end of file +var _0x9ee6=['out','STRING','DATE','TEXT','exports','BOOLEAN'];(function(_0x222d81,_0x179c63){var _0x1d3d37=function(_0x39fb82){while(--_0x39fb82){_0x222d81['push'](_0x222d81['shift']());}};_0x1d3d37(++_0x179c63);}(_0x9ee6,0x94));var _0x69ee=function(_0xb301d4,_0x27ed18){_0xb301d4=_0xb301d4-0x0;var _0x3b5bde=_0x9ee6[_0xb301d4];return _0x3b5bde;};'use strict';var Sequelize=require('sequelize');module[_0x69ee('0x0')]={'body':{'type':Sequelize['TEXT']('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x69ee('0x1')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x69ee('0x2')),'defaultValue':_0x69ee('0x2'),'allowNull':![]},'messageId':{'type':Sequelize[_0x69ee('0x3')](0xbe)},'phone':{'type':Sequelize[_0x69ee('0x3')]},'readAt':{'type':Sequelize[_0x69ee('0x4')]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'providerName':{'type':Sequelize[_0x69ee('0x3')]},'providerResponse':{'type':Sequelize[_0x69ee('0x5')]}}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.controller.js b/server/api/smsMessage/smsMessage.controller.js index 38d2ee6..855f6d9 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 _0xd065=['null','acceptMessage','ContactId','sequelize','Sequelize','SELECT','contact','User','fullname','email','internal','manual','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','rejectmessage','SmsAccount','SmsMessage,\x20%s,\x20%s,\x20%s','twilio','MessageSid','messageId','SmsAccount,\x20%s,\x20%s,\x20%s','inspect','MessageUUID','sent','delivered','Status','results','groupName','DELIVERED','infobip','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./smsMessage.socket','client','request','then','info','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','stack','name','send','index','map','SmsMessage','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','include','findAll','rows','catch','show','params','keys','includeAll','find','create','body','destroy','describe','sms-interactions','accept','sms','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','SmsInteraction','SmsInteractionId','isNil','interaction','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s'];(function(_0x687c0a,_0x5cdad8){var _0x24038f=function(_0x582f18){while(--_0x582f18){_0x687c0a['push'](_0x687c0a['shift']());}};_0x24038f(++_0x5cdad8);}(_0xd065,0xba));var _0x5d06=function(_0x3410cf,_0x33cb7a){_0x3410cf=_0x3410cf-0x0;var _0x58dee3=_0xd065[_0x3410cf];return _0x58dee3;};'use strict';var emlformat=require(_0x5d06('0x0'));var rimraf=require(_0x5d06('0x1'));var zipdir=require(_0x5d06('0x2'));var jsonpatch=require(_0x5d06('0x3'));var rp=require(_0x5d06('0x4'));var moment=require(_0x5d06('0x5'));var BPromise=require(_0x5d06('0x6'));var Mustache=require(_0x5d06('0x7'));var util=require('util');var path=require('path');var sox=require(_0x5d06('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5d06('0x9'));var _=require(_0x5d06('0xa'));var squel=require(_0x5d06('0xb'));var crypto=require(_0x5d06('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x5d06('0xd'));var Papa=require(_0x5d06('0xe'));var Redis=require(_0x5d06('0xf'));var authService=require(_0x5d06('0x10'));var qs=require(_0x5d06('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5d06('0x12'));var logger=require(_0x5d06('0x13'))(_0x5d06('0x14'));var utils=require(_0x5d06('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x5d06('0x16'));var db=require('../../mysqldb')['db'];config[_0x5d06('0x17')]=_[_0x5d06('0x18')](config['redis'],{'host':_0x5d06('0x19'),'port':0x18eb});var socket=require(_0x5d06('0x1a'))(new Redis(config['redis']));require(_0x5d06('0x1b'))['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0x5d06('0x1c')]['http']({'port':0x232c});var client9002=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x130eb5,_0x285219,_0x28ffaf,_0x564788){return new BPromise(function(_0xe1f710,_0x28eb03){var _0x4fea18=_0x564788||client;return _0x4fea18[_0x5d06('0x1d')](_0x130eb5,_0x28ffaf)[_0x5d06('0x1e')](function(_0x58f695){logger[_0x5d06('0x1f')](_0x5d06('0x20'),_0x285219,_0x5d06('0x21'));logger[_0x5d06('0x22')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x285219,_0x5d06('0x21'),JSON[_0x5d06('0x23')](_0x58f695));if(_0x58f695[_0x5d06('0x24')]){if(_0x58f695['error']['code']===0x1f4){logger['error'](_0x5d06('0x20'),_0x285219,_0x58f695[_0x5d06('0x24')][_0x5d06('0x25')]);return _0x28eb03(_0x58f695['error'][_0x5d06('0x25')]);}logger[_0x5d06('0x24')]('SmsMessage,\x20%s,\x20%s',_0x285219,_0x58f695[_0x5d06('0x24')]['message']);return _0xe1f710(_0x58f695[_0x5d06('0x24')]['message']);}else{logger[_0x5d06('0x1f')](_0x5d06('0x20'),_0x285219,_0x5d06('0x21'));_0xe1f710(_0x58f695['result'][_0x5d06('0x25')]);}})['catch'](function(_0x1762c0){logger[_0x5d06('0x24')](_0x5d06('0x20'),_0x285219,_0x1762c0);_0x28eb03(_0x1762c0);});});}function respondWithStatusCode(_0x1d1778,_0x7ebe5c){_0x7ebe5c=_0x7ebe5c||0xcc;return function(_0x3f9f48){if(_0x3f9f48){return _0x1d1778[_0x5d06('0x26')](_0x7ebe5c);}return _0x1d1778[_0x5d06('0x27')](_0x7ebe5c)[_0x5d06('0x28')]();};}function respondWithResult(_0x54880d,_0xeb3022){_0xeb3022=_0xeb3022||0xc8;return function(_0x2301b6){if(_0x2301b6){return _0x54880d[_0x5d06('0x27')](_0xeb3022)[_0x5d06('0x29')](_0x2301b6);}};}function respondWithFilteredResult(_0x5c8969,_0x5515a6){return function(_0x33b9cb){if(_0x33b9cb){var _0x2b86a8=typeof _0x5515a6['offset']===_0x5d06('0x2a')&&typeof _0x5515a6[_0x5d06('0x2b')]===_0x5d06('0x2a');var _0x5b750b=_0x33b9cb[_0x5d06('0x2c')];var _0x206465=_0x2b86a8?0x0:_0x5515a6['offset'];var _0x354ec5=_0x2b86a8?_0x33b9cb[_0x5d06('0x2c')]:_0x5515a6[_0x5d06('0x2d')]+_0x5515a6['limit'];var _0x382e2e;if(_0x354ec5>=_0x5b750b){_0x354ec5=_0x5b750b;_0x382e2e=0xc8;}else{_0x382e2e=0xce;}_0x5c8969[_0x5d06('0x27')](_0x382e2e);return _0x5c8969[_0x5d06('0x2e')](_0x5d06('0x2f'),_0x206465+'-'+_0x354ec5+'/'+_0x5b750b)[_0x5d06('0x29')](_0x33b9cb);}return null;};}function patchUpdates(_0x3d4b6c){return function(_0x192f6f){try{jsonpatch[_0x5d06('0x30')](_0x192f6f,_0x3d4b6c,!![]);}catch(_0x5778e6){return BPromise[_0x5d06('0x31')](_0x5778e6);}return _0x192f6f[_0x5d06('0x32')]();};}function saveUpdates(_0x4d32c4,_0x3a3ca7){return function(_0x145f60){if(_0x145f60){return _0x145f60[_0x5d06('0x33')](_0x4d32c4)[_0x5d06('0x1e')](function(_0x1fb78b){return _0x1fb78b;});}return null;};}function removeEntity(_0x47ba15,_0xf79a14){return function(_0x47bf34){if(_0x47bf34){return _0x47bf34['destroy']()[_0x5d06('0x1e')](function(){_0x47ba15[_0x5d06('0x27')](0xcc)[_0x5d06('0x28')]();});}};}function handleEntityNotFound(_0x22c73f,_0x42dc43){return function(_0x12892b){if(!_0x12892b){_0x22c73f['sendStatus'](0x194);}return _0x12892b;};}function handleError(_0x5b7b68,_0x2dd36e){_0x2dd36e=_0x2dd36e||0x1f4;return function(_0x354a52){logger['error'](_0x354a52[_0x5d06('0x34')]);if(_0x354a52['name']){delete _0x354a52[_0x5d06('0x35')];}_0x5b7b68['status'](_0x2dd36e)[_0x5d06('0x36')](_0x354a52);};}exports[_0x5d06('0x37')]=function(_0x10c0b9,_0x25a375){var _0x1f4898={},_0x138a33={},_0x27b20c={'count':0x0,'rows':[]};var _0x1c9592=_[_0x5d06('0x38')](db[_0x5d06('0x39')][_0x5d06('0x3a')],function(_0x4d17c4){return{'name':_0x4d17c4[_0x5d06('0x3b')],'type':_0x4d17c4['type'][_0x5d06('0x3c')]};});_0x138a33[_0x5d06('0x3d')]=_[_0x5d06('0x38')](_0x1c9592,_0x5d06('0x35'));_0x138a33['query']=_['keys'](_0x10c0b9[_0x5d06('0x3e')]);_0x138a33[_0x5d06('0x3f')]=_[_0x5d06('0x40')](_0x138a33[_0x5d06('0x3d')],_0x138a33['query']);_0x1f4898[_0x5d06('0x41')]=_[_0x5d06('0x40')](_0x138a33[_0x5d06('0x3d')],qs['fields'](_0x10c0b9[_0x5d06('0x3e')][_0x5d06('0x42')]));_0x1f4898['attributes']=_0x1f4898[_0x5d06('0x41')][_0x5d06('0x43')]?_0x1f4898[_0x5d06('0x41')]:_0x138a33[_0x5d06('0x3d')];if(!_0x10c0b9[_0x5d06('0x3e')][_0x5d06('0x44')](_0x5d06('0x45'))){_0x1f4898[_0x5d06('0x2b')]=qs['limit'](_0x10c0b9[_0x5d06('0x3e')][_0x5d06('0x2b')]);_0x1f4898[_0x5d06('0x2d')]=qs['offset'](_0x10c0b9[_0x5d06('0x3e')][_0x5d06('0x2d')]);}_0x1f4898[_0x5d06('0x46')]=qs[_0x5d06('0x47')](_0x10c0b9[_0x5d06('0x3e')][_0x5d06('0x47')]);_0x1f4898[_0x5d06('0x48')]=qs[_0x5d06('0x3f')](_[_0x5d06('0x49')](_0x10c0b9[_0x5d06('0x3e')],_0x138a33[_0x5d06('0x3f')]),_0x1c9592);if(_0x10c0b9['query'][_0x5d06('0x4a')]){_0x1f4898['where']=_[_0x5d06('0x4b')](_0x1f4898[_0x5d06('0x48')],{'$or':_[_0x5d06('0x38')](_0x1c9592,function(_0x8601ce){if(_0x8601ce[_0x5d06('0x4c')]!==_0x5d06('0x4d')){var _0x5691ef={};_0x5691ef[_0x8601ce[_0x5d06('0x35')]]={'$like':'%'+_0x10c0b9[_0x5d06('0x3e')][_0x5d06('0x4a')]+'%'};return _0x5691ef;}})});}_0x1f4898=_[_0x5d06('0x4b')]({},_0x1f4898,_0x10c0b9[_0x5d06('0x4e')]);var _0x19a40b={'where':_0x1f4898['where']};return db[_0x5d06('0x39')][_0x5d06('0x2c')](_0x19a40b)[_0x5d06('0x1e')](function(_0x36f08a){_0x27b20c[_0x5d06('0x2c')]=_0x36f08a;if(_0x10c0b9['query']['includeAll']){_0x1f4898[_0x5d06('0x4f')]=[{'all':!![]}];}return db[_0x5d06('0x39')][_0x5d06('0x50')](_0x1f4898);})[_0x5d06('0x1e')](function(_0x32bcc9){_0x27b20c[_0x5d06('0x51')]=_0x32bcc9;return _0x27b20c;})['then'](respondWithFilteredResult(_0x25a375,_0x1f4898))[_0x5d06('0x52')](handleError(_0x25a375,null));};exports[_0x5d06('0x53')]=function(_0x8e7432,_0x440c43){var _0x6b524a={'raw':!![],'where':{'id':_0x8e7432[_0x5d06('0x54')]['id']}},_0x4ab5eb={};_0x4ab5eb['model']=_[_0x5d06('0x55')](db[_0x5d06('0x39')]['rawAttributes']);_0x4ab5eb[_0x5d06('0x3e')]=_[_0x5d06('0x55')](_0x8e7432['query']);_0x4ab5eb['filters']=_[_0x5d06('0x40')](_0x4ab5eb['model'],_0x4ab5eb[_0x5d06('0x3e')]);_0x6b524a[_0x5d06('0x41')]=_[_0x5d06('0x40')](_0x4ab5eb[_0x5d06('0x3d')],qs[_0x5d06('0x42')](_0x8e7432[_0x5d06('0x3e')][_0x5d06('0x42')]));_0x6b524a[_0x5d06('0x41')]=_0x6b524a[_0x5d06('0x41')][_0x5d06('0x43')]?_0x6b524a[_0x5d06('0x41')]:_0x4ab5eb[_0x5d06('0x3d')];if(_0x8e7432[_0x5d06('0x3e')][_0x5d06('0x56')]){_0x6b524a[_0x5d06('0x4f')]=[{'all':!![]}];}_0x6b524a=_[_0x5d06('0x4b')]({},_0x6b524a,_0x8e7432[_0x5d06('0x4e')]);return db[_0x5d06('0x39')][_0x5d06('0x57')](_0x6b524a)['then'](handleEntityNotFound(_0x440c43,null))['then'](respondWithResult(_0x440c43,null))[_0x5d06('0x52')](handleError(_0x440c43,null));};exports[_0x5d06('0x58')]=function(_0x30e1af,_0x342f3e){return db[_0x5d06('0x39')][_0x5d06('0x58')](_0x30e1af[_0x5d06('0x59')],{})[_0x5d06('0x1e')](respondWithResult(_0x342f3e,0xc9))[_0x5d06('0x52')](handleError(_0x342f3e,null));};exports[_0x5d06('0x33')]=function(_0x9cbe16,_0x5c59b0){if(_0x9cbe16[_0x5d06('0x59')]['id']){delete _0x9cbe16[_0x5d06('0x59')]['id'];}return db['SmsMessage'][_0x5d06('0x57')]({'where':{'id':_0x9cbe16[_0x5d06('0x54')]['id']}})['then'](handleEntityNotFound(_0x5c59b0,null))[_0x5d06('0x1e')](saveUpdates(_0x9cbe16[_0x5d06('0x59')],null))[_0x5d06('0x1e')](respondWithResult(_0x5c59b0,null))['catch'](handleError(_0x5c59b0,null));};exports[_0x5d06('0x5a')]=function(_0x5265fe,_0x123a52){return db['SmsMessage'][_0x5d06('0x57')]({'where':{'id':_0x5265fe['params']['id']}})[_0x5d06('0x1e')](handleEntityNotFound(_0x123a52,null))[_0x5d06('0x1e')](removeEntity(_0x123a52,null))[_0x5d06('0x52')](handleError(_0x123a52,null));};exports[_0x5d06('0x5b')]=function(_0x15fc56,_0x5613d9){return db[_0x5d06('0x39')][_0x5d06('0x5b')]()[_0x5d06('0x1e')](respondWithResult(_0x5613d9,null))[_0x5d06('0x52')](handleError(_0x5613d9,null));};var interaction_log=require(_0x5d06('0x13'))(_0x5d06('0x5c'));exports[_0x5d06('0x5d')]=function(_0xe77e01,_0x299cd9,_0x2dc585){var _0x266c6c={'agent':{},'channel':_0x5d06('0x5e')};if(_0xe77e01[_0x5d06('0x59')]['id']){delete _0xe77e01[_0x5d06('0x59')]['id'];}_0xe77e01['body'][_0x5d06('0x5f')]=!![];_0xe77e01[_0x5d06('0x59')][_0x5d06('0x60')]=moment()[_0x5d06('0x61')](_0x5d06('0x62'));_0xe77e01['body'][_0x5d06('0x63')]=_0xe77e01[_0x5d06('0x59')][_0x5d06('0x63')]||_0xe77e01[_0x5d06('0x64')]['id'];_0x266c6c[_0x5d06('0x65')]['id']=_0xe77e01[_0x5d06('0x59')][_0x5d06('0x63')];return db[_0x5d06('0x39')][_0x5d06('0x57')]({'where':{'id':_0xe77e01[_0x5d06('0x54')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x299cd9,null))[_0x5d06('0x1e')](saveUpdates(_0xe77e01[_0x5d06('0x59')],null))[_0x5d06('0x1e')](function(_0x311489){if(_0x311489){_0x266c6c['message']=_0x311489[_0x5d06('0x66')]({'plain':!![]});return db[_0x5d06('0x67')][_0x5d06('0x57')]({'where':{'id':_0x311489[_0x5d06('0x68')]}});}return null;})[_0x5d06('0x1e')](handleEntityNotFound(_0x299cd9,null))[_0x5d06('0x1e')](function(_0x222220){if(_0x222220){return _0x222220['update']({'UserId':_0xe77e01['body'][_0x5d06('0x63')],'read1stAt':_[_0x5d06('0x69')](_0x222220['read1stAt'])?moment()[_0x5d06('0x61')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x5d06('0x1e')](function(_0x236203){if(_0x236203){_0x266c6c[_0x5d06('0x6a')]=_0x236203['get']({'plain':!![]});interaction_log[_0x5d06('0x1f')](_0x5d06('0x6b'),_0xe77e01['user']['id'],_0xe77e01['user'][_0x5d06('0x35')],_0xe77e01[_0x5d06('0x64')]['role'],_0x266c6c[_0x5d06('0x6a')]['id'],_0xe77e01[_0x5d06('0x59')]?JSON['stringify'](_0xe77e01['body']):_0x5d06('0x6c'));return respondWithRpcPromise('AcceptMessage',_0x5d06('0x6d'),_0x266c6c);}return null;})[_0x5d06('0x1e')](function(_0x181ed4){var _0x573f04='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x181ed4[_0x5d06('0x25')][_0x5d06('0x6e')];return db[_0x5d06('0x6f')][_0x5d06('0x3e')](_0x573f04,{'type':db[_0x5d06('0x70')]['QueryTypes'][_0x5d06('0x71')],'raw':!![]})[_0x5d06('0x1e')](function(_0xcca3a4){return _0xcca3a4;});})[_0x5d06('0x1e')](function(_0x368d15){if(_0x368d15){_0x266c6c['message'][_0x5d06('0x72')]=_0x368d15[0x0];if(!_0xe77e01[_0x5d06('0x59')]['UserId'])return;return db[_0x5d06('0x73')]['find']({'where':{'id':_0xe77e01[_0x5d06('0x59')][_0x5d06('0x63')],'role':_0x5d06('0x65')},'attributes':['id',_0x5d06('0x35'),_0x5d06('0x74'),_0x5d06('0x75'),_0x5d06('0x76')],'raw':!![]});}return null;})[_0x5d06('0x1e')](function(_0x3fc765){if(!_0x3fc765)return null;_0x266c6c[_0x5d06('0x25')][_0x5d06('0x65')]=_0x3fc765;return _0x266c6c;})['then'](function(_0x55fa43){if(_0x55fa43){if(_0xe77e01['body'][_0x5d06('0x77')]){_0x266c6c[_0x5d06('0x25')]['interface']=util[_0x5d06('0x61')](_0x5d06('0x78'),_0xe77e01[_0x5d06('0x64')]['name']);_0x266c6c['message']['channel']=_0x266c6c[_0x5d06('0x79')];_0x266c6c['message'][_0x5d06('0x7a')]=_0x266c6c[_0x5d06('0x79')];_0x266c6c[_0x5d06('0x25')][_0x5d06('0x7b')]='accept';return respondWithRpcPromise(_0x5d06('0x7c'),'EventManager',{'event':_0x5d06('0x7d'),'message':_0x266c6c[_0x5d06('0x25')]},client9002)[_0x5d06('0x1e')](function(){return _0x266c6c;});}return _0x266c6c;}return null;})[_0x5d06('0x1e')](respondWithResult(_0x299cd9,null))[_0x5d06('0x52')](handleError(_0x299cd9,null));};var interaction_log=require('../../config/logger')(_0x5d06('0x5c'));exports[_0x5d06('0x31')]=function(_0x1790ef,_0x35c050,_0x791eff){var _0x877083={'agent':{},'channel':_0x5d06('0x5e')};if(_0x1790ef[_0x5d06('0x59')]['id']){delete _0x1790ef['body']['id'];}_0x1790ef['body'][_0x5d06('0x63')]=_0x1790ef[_0x5d06('0x59')][_0x5d06('0x63')]||_0x1790ef[_0x5d06('0x64')]['id'];_0x877083[_0x5d06('0x65')]['id']=_0x1790ef['body']['UserId'];return db['SmsMessage'][_0x5d06('0x57')]({'where':{'id':_0x1790ef[_0x5d06('0x54')]['id'],'UserId':null}})[_0x5d06('0x1e')](handleEntityNotFound(_0x35c050,null))[_0x5d06('0x1e')](function(_0x1e25c1){if(_0x1e25c1){_0x877083[_0x5d06('0x25')]=_0x1e25c1[_0x5d06('0x66')]({'plain':!![]});return db[_0x5d06('0x67')][_0x5d06('0x57')]({'where':{'id':_0x1e25c1[_0x5d06('0x68')]}});}return null;})[_0x5d06('0x1e')](handleEntityNotFound(_0x35c050,null))[_0x5d06('0x1e')](function(_0x3b9945){if(_0x3b9945){_0x877083[_0x5d06('0x6a')]=_0x3b9945[_0x5d06('0x66')]({'plain':!![]});interaction_log[_0x5d06('0x1f')](_0x5d06('0x7e'),_0x1790ef['user']['id'],_0x1790ef[_0x5d06('0x64')][_0x5d06('0x35')],_0x1790ef[_0x5d06('0x64')][_0x5d06('0x7f')],_0x877083[_0x5d06('0x6a')]['id'],_0x1790ef['body']?JSON[_0x5d06('0x23')](_0x1790ef[_0x5d06('0x59')]):_0x5d06('0x6c'));return respondWithRpcPromise(_0x5d06('0x80'),_0x5d06('0x81'),_0x877083);}return null;})[_0x5d06('0x1e')](function(_0x592093){var _0x450469=_0x5d06('0x82')+_0x592093[_0x5d06('0x25')][_0x5d06('0x6e')];return db[_0x5d06('0x6f')][_0x5d06('0x3e')](_0x450469,{'type':db[_0x5d06('0x70')]['QueryTypes']['SELECT'],'raw':!![]})[_0x5d06('0x1e')](function(_0x4f72d2){return _0x4f72d2;});})['then'](function(_0x884ae2){if(_0x884ae2){_0x877083['message']['contact']=_0x884ae2[0x0];if(!_0x1790ef[_0x5d06('0x59')][_0x5d06('0x63')])return;return db[_0x5d06('0x73')][_0x5d06('0x57')]({'where':{'id':_0x1790ef[_0x5d06('0x59')]['UserId'],'role':_0x5d06('0x65')},'attributes':['id','name',_0x5d06('0x74'),_0x5d06('0x75'),'internal'],'raw':!![]});}return null;})['then'](function(_0x6f49a9){if(!_0x6f49a9)return null;_0x877083[_0x5d06('0x25')][_0x5d06('0x65')]=_0x6f49a9;return _0x877083;})[_0x5d06('0x1e')](function(_0x268be9){if(_0x268be9){_0x268be9[_0x5d06('0x25')]['interface']=util[_0x5d06('0x61')](_0x5d06('0x78'),_0x1790ef[_0x5d06('0x64')][_0x5d06('0x35')]);_0x268be9[_0x5d06('0x25')]['channel']=_0x877083[_0x5d06('0x79')];_0x268be9[_0x5d06('0x25')][_0x5d06('0x7a')]=_0x877083[_0x5d06('0x79')];_0x268be9[_0x5d06('0x25')][_0x5d06('0x7b')]=_0x5d06('0x31');respondWithRpcPromise(_0x5d06('0x7c'),_0x5d06('0x7c'),{'event':_0x5d06('0x83'),'message':_0x268be9['message']},client9002);return _0x877083;}return null;})['then'](respondWithResult(_0x35c050,null))[_0x5d06('0x52')](handleError(_0x35c050,null));};exports[_0x5d06('0x27')]=function(_0x851770,_0x5d5d62,_0x5f46ab){if(_0x851770[_0x5d06('0x59')]['id']){delete _0x851770['body']['id'];}var _0x19b31e;return db[_0x5d06('0x39')][_0x5d06('0x57')]({'where':{'id':_0x851770[_0x5d06('0x54')]['id']}})['then'](handleEntityNotFound(_0x5d5d62,null))[_0x5d06('0x1e')](function(_0x18b619){if(_0x18b619){_0x19b31e=_0x18b619;return db[_0x5d06('0x84')][_0x5d06('0x57')]({'where':{'id':_0x18b619['SmsAccountId']}});}})[_0x5d06('0x1e')](handleEntityNotFound(_0x5d5d62,null))['then'](function(_0x43f164){if(_0x43f164){logger[_0x5d06('0x22')](_0x5d06('0x85'),'status','received\x20delivery\x20report\x20from',_0x43f164[_0x5d06('0x4c')],util['inspect'](_0x851770[_0x5d06('0x59')],{'showHidden':![],'depth':null}));switch(_0x43f164['type']){case _0x5d06('0x86'):if(_0x851770[_0x5d06('0x59')][_0x5d06('0x87')]&&_0x851770[_0x5d06('0x59')]['MessageSid']===_0x19b31e[_0x5d06('0x88')]){return _0x19b31e[_0x5d06('0x33')]({'read':!![]});}else{logger[_0x5d06('0x24')](_0x5d06('0x89'),_0x5d06('0x27'),_0x5d06('0x86'),util[_0x5d06('0x8a')](_0x851770[_0x5d06('0x59')],{'showHidden':![],'depth':null}));}break;case'plivo':if(_0x851770[_0x5d06('0x59')][_0x5d06('0x8b')]&&_0x851770['body'][_0x5d06('0x8b')]===_0x19b31e[_0x5d06('0x88')]&&_['indexOf']([_0x5d06('0x8c'),_0x5d06('0x8d')],_0x851770['body'][_0x5d06('0x8e')])>=0x0){return _0x19b31e['update']({'read':!![]});}else{logger[_0x5d06('0x24')](_0x5d06('0x89'),_0x5d06('0x27'),'plivio',util[_0x5d06('0x8a')](_0x851770['body'],{'showHidden':![],'depth':null}));}break;case'infobip':var _0x4f7adf=_0x851770[_0x5d06('0x59')][_0x5d06('0x8f')][0x0];if(_0x4f7adf['status'][_0x5d06('0x90')]===_0x5d06('0x91')){return _0x19b31e[_0x5d06('0x33')]({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0x5d06('0x92'),util[_0x5d06('0x8a')](_0x851770['body'],{'showHidden':![],'depth':null}));}break;}return _0x19b31e;}})['then'](respondWithResult(_0x5d5d62,null))[_0x5d06('0x52')](handleError(_0x5d5d62,null));}; \ No newline at end of file +var _0xa7c8=['../../config/logger','api','../../config/utils','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./smsMessage.socket','register','jayson/promise','client','http','request','then','info','SmsMessage,\x20%s,\x20%s','debug','SmsMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','sendStatus','status','json','undefined','limit','offset','count','set','Content-Range','apply','reject','save','update','end','stack','name','send','index','map','rawAttributes','fieldName','type','key','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','SmsMessage','include','rows','show','model','length','find','create','body','params','destroy','describe','sms-interactions','accept','sms','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','SmsInteractionId','isNil','read1stAt','get','interaction','AcceptMessage','acceptMessage','sequelize','QueryTypes','contact','User','internal','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','SmsInteraction','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','RejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize','SELECT','email','SmsAccount','SmsAccountId','inspect','MessageSid','SmsAccount,\x20%s,\x20%s,\x20%s','plivo','MessageUUID','messageId','sent','delivered','Status','infobip','results','groupName','DELIVERED','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xa7c8,0x82));var _0x8a7c=function(_0x4054f0,_0x374174){_0x4054f0=_0x4054f0-0x0;var _0x3b3af6=_0xa7c8[_0x4054f0];return _0x3b3af6;};'use strict';var emlformat=require(_0x8a7c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8a7c('0x1'));var jsonpatch=require(_0x8a7c('0x2'));var rp=require(_0x8a7c('0x3'));var moment=require('moment');var BPromise=require(_0x8a7c('0x4'));var Mustache=require('mustache');var util=require(_0x8a7c('0x5'));var path=require(_0x8a7c('0x6'));var sox=require(_0x8a7c('0x7'));var csv=require(_0x8a7c('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8a7c('0x9'));var _=require('lodash');var squel=require(_0x8a7c('0xa'));var crypto=require(_0x8a7c('0xb'));var jsforce=require(_0x8a7c('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x8a7c('0xd'));var Papa=require(_0x8a7c('0xe'));var Redis=require(_0x8a7c('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x8a7c('0x10'));var hardwareService=require(_0x8a7c('0x11'));var logger=require(_0x8a7c('0x12'))(_0x8a7c('0x13'));var utils=require(_0x8a7c('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x8a7c('0x15'));var db=require('../../mysqldb')['db'];config[_0x8a7c('0x16')]=_[_0x8a7c('0x17')](config[_0x8a7c('0x16')],{'host':_0x8a7c('0x18'),'port':0x18eb});var socket=require(_0x8a7c('0x19'))(new Redis(config[_0x8a7c('0x16')]));require(_0x8a7c('0x1a'))[_0x8a7c('0x1b')](socket);var jayson=require(_0x8a7c('0x1c'));var client=jayson[_0x8a7c('0x1d')][_0x8a7c('0x1e')]({'port':0x232c});var client9002=jayson[_0x8a7c('0x1d')][_0x8a7c('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x3ad57b,_0x509eb5,_0x3fcba5,_0x345711){return new BPromise(function(_0x599ce4,_0x1c6b38){var _0xcb241b=_0x345711||client;return _0xcb241b[_0x8a7c('0x1f')](_0x3ad57b,_0x3fcba5)[_0x8a7c('0x20')](function(_0x4d125b){logger[_0x8a7c('0x21')](_0x8a7c('0x22'),_0x509eb5,'request\x20sent');logger[_0x8a7c('0x23')](_0x8a7c('0x24'),_0x509eb5,_0x8a7c('0x25'),JSON[_0x8a7c('0x26')](_0x4d125b));if(_0x4d125b[_0x8a7c('0x27')]){if(_0x4d125b[_0x8a7c('0x27')][_0x8a7c('0x28')]===0x1f4){logger['error'](_0x8a7c('0x22'),_0x509eb5,_0x4d125b[_0x8a7c('0x27')]['message']);return _0x1c6b38(_0x4d125b['error'][_0x8a7c('0x29')]);}logger[_0x8a7c('0x27')](_0x8a7c('0x22'),_0x509eb5,_0x4d125b[_0x8a7c('0x27')][_0x8a7c('0x29')]);return _0x599ce4(_0x4d125b['error'][_0x8a7c('0x29')]);}else{logger[_0x8a7c('0x21')](_0x8a7c('0x22'),_0x509eb5,_0x8a7c('0x25'));_0x599ce4(_0x4d125b['result'][_0x8a7c('0x29')]);}})[_0x8a7c('0x2a')](function(_0x1d1c6b){logger[_0x8a7c('0x27')]('SmsMessage,\x20%s,\x20%s',_0x509eb5,_0x1d1c6b);_0x1c6b38(_0x1d1c6b);});});}function respondWithStatusCode(_0x10a3a9,_0x2c061d){_0x2c061d=_0x2c061d||0xcc;return function(_0x3384c6){if(_0x3384c6){return _0x10a3a9[_0x8a7c('0x2b')](_0x2c061d);}return _0x10a3a9[_0x8a7c('0x2c')](_0x2c061d)['end']();};}function respondWithResult(_0x3f4312,_0x5bd8b5){_0x5bd8b5=_0x5bd8b5||0xc8;return function(_0x49546c){if(_0x49546c){return _0x3f4312[_0x8a7c('0x2c')](_0x5bd8b5)[_0x8a7c('0x2d')](_0x49546c);}};}function respondWithFilteredResult(_0x2e0e07,_0x35acdd){return function(_0x5d1cb0){if(_0x5d1cb0){var _0x398305=typeof _0x35acdd['offset']===_0x8a7c('0x2e')&&typeof _0x35acdd[_0x8a7c('0x2f')]===_0x8a7c('0x2e');var _0x59e624=_0x5d1cb0['count'];var _0x21e672=_0x398305?0x0:_0x35acdd[_0x8a7c('0x30')];var _0x46d5e5=_0x398305?_0x5d1cb0[_0x8a7c('0x31')]:_0x35acdd[_0x8a7c('0x30')]+_0x35acdd[_0x8a7c('0x2f')];var _0x22443d;if(_0x46d5e5>=_0x59e624){_0x46d5e5=_0x59e624;_0x22443d=0xc8;}else{_0x22443d=0xce;}_0x2e0e07['status'](_0x22443d);return _0x2e0e07[_0x8a7c('0x32')](_0x8a7c('0x33'),_0x21e672+'-'+_0x46d5e5+'/'+_0x59e624)[_0x8a7c('0x2d')](_0x5d1cb0);}return null;};}function patchUpdates(_0x1112d8){return function(_0x6e26a9){try{jsonpatch[_0x8a7c('0x34')](_0x6e26a9,_0x1112d8,!![]);}catch(_0x53d3fb){return BPromise[_0x8a7c('0x35')](_0x53d3fb);}return _0x6e26a9[_0x8a7c('0x36')]();};}function saveUpdates(_0xcb7104,_0x1c03c5){return function(_0x1882f4){if(_0x1882f4){return _0x1882f4[_0x8a7c('0x37')](_0xcb7104)[_0x8a7c('0x20')](function(_0x180cbf){return _0x180cbf;});}return null;};}function removeEntity(_0x19c850,_0xad35a4){return function(_0x3b2ce3){if(_0x3b2ce3){return _0x3b2ce3['destroy']()[_0x8a7c('0x20')](function(){_0x19c850['status'](0xcc)[_0x8a7c('0x38')]();});}};}function handleEntityNotFound(_0x1c7d2b,_0x47535a){return function(_0x89fe38){if(!_0x89fe38){_0x1c7d2b[_0x8a7c('0x2b')](0x194);}return _0x89fe38;};}function handleError(_0x5e85b6,_0x37275c){_0x37275c=_0x37275c||0x1f4;return function(_0x23270c){logger[_0x8a7c('0x27')](_0x23270c[_0x8a7c('0x39')]);if(_0x23270c[_0x8a7c('0x3a')]){delete _0x23270c['name'];}_0x5e85b6[_0x8a7c('0x2c')](_0x37275c)[_0x8a7c('0x3b')](_0x23270c);};}exports[_0x8a7c('0x3c')]=function(_0x29f2e9,_0xc2def0){var _0x1cefe5={},_0x56c247={},_0x29fd={'count':0x0,'rows':[]};var _0x5989aa=_[_0x8a7c('0x3d')](db['SmsMessage'][_0x8a7c('0x3e')],function(_0x3e904e){return{'name':_0x3e904e[_0x8a7c('0x3f')],'type':_0x3e904e[_0x8a7c('0x40')][_0x8a7c('0x41')]};});_0x56c247['model']=_['map'](_0x5989aa,_0x8a7c('0x3a'));_0x56c247[_0x8a7c('0x42')]=_[_0x8a7c('0x43')](_0x29f2e9['query']);_0x56c247[_0x8a7c('0x44')]=_['intersection'](_0x56c247['model'],_0x56c247['query']);_0x1cefe5[_0x8a7c('0x45')]=_[_0x8a7c('0x46')](_0x56c247['model'],qs['fields'](_0x29f2e9[_0x8a7c('0x42')][_0x8a7c('0x47')]));_0x1cefe5[_0x8a7c('0x45')]=_0x1cefe5['attributes']['length']?_0x1cefe5[_0x8a7c('0x45')]:_0x56c247['model'];if(!_0x29f2e9[_0x8a7c('0x42')][_0x8a7c('0x48')](_0x8a7c('0x49'))){_0x1cefe5['limit']=qs[_0x8a7c('0x2f')](_0x29f2e9[_0x8a7c('0x42')][_0x8a7c('0x2f')]);_0x1cefe5['offset']=qs[_0x8a7c('0x30')](_0x29f2e9[_0x8a7c('0x42')]['offset']);}_0x1cefe5[_0x8a7c('0x4a')]=qs['sort'](_0x29f2e9['query'][_0x8a7c('0x4b')]);_0x1cefe5[_0x8a7c('0x4c')]=qs[_0x8a7c('0x44')](_['pick'](_0x29f2e9[_0x8a7c('0x42')],_0x56c247['filters']),_0x5989aa);if(_0x29f2e9[_0x8a7c('0x42')][_0x8a7c('0x4d')]){_0x1cefe5['where']=_[_0x8a7c('0x4e')](_0x1cefe5[_0x8a7c('0x4c')],{'$or':_[_0x8a7c('0x3d')](_0x5989aa,function(_0x2acf6f){if(_0x2acf6f[_0x8a7c('0x40')]!==_0x8a7c('0x4f')){var _0x4ee31a={};_0x4ee31a[_0x2acf6f['name']]={'$like':'%'+_0x29f2e9[_0x8a7c('0x42')][_0x8a7c('0x4d')]+'%'};return _0x4ee31a;}})});}_0x1cefe5=_['merge']({},_0x1cefe5,_0x29f2e9[_0x8a7c('0x50')]);var _0x5c55ae={'where':_0x1cefe5[_0x8a7c('0x4c')]};return db[_0x8a7c('0x51')][_0x8a7c('0x31')](_0x5c55ae)['then'](function(_0x1e139f){_0x29fd[_0x8a7c('0x31')]=_0x1e139f;if(_0x29f2e9[_0x8a7c('0x42')]['includeAll']){_0x1cefe5[_0x8a7c('0x52')]=[{'all':!![]}];}return db[_0x8a7c('0x51')]['findAll'](_0x1cefe5);})[_0x8a7c('0x20')](function(_0x8c3c8f){_0x29fd[_0x8a7c('0x53')]=_0x8c3c8f;return _0x29fd;})[_0x8a7c('0x20')](respondWithFilteredResult(_0xc2def0,_0x1cefe5))[_0x8a7c('0x2a')](handleError(_0xc2def0,null));};exports[_0x8a7c('0x54')]=function(_0x29f90e,_0x30cff6){var _0x129aee={'raw':!![],'where':{'id':_0x29f90e['params']['id']}},_0x206b59={};_0x206b59['model']=_[_0x8a7c('0x43')](db[_0x8a7c('0x51')][_0x8a7c('0x3e')]);_0x206b59['query']=_['keys'](_0x29f90e[_0x8a7c('0x42')]);_0x206b59[_0x8a7c('0x44')]=_[_0x8a7c('0x46')](_0x206b59['model'],_0x206b59[_0x8a7c('0x42')]);_0x129aee[_0x8a7c('0x45')]=_[_0x8a7c('0x46')](_0x206b59[_0x8a7c('0x55')],qs['fields'](_0x29f90e[_0x8a7c('0x42')][_0x8a7c('0x47')]));_0x129aee[_0x8a7c('0x45')]=_0x129aee['attributes'][_0x8a7c('0x56')]?_0x129aee['attributes']:_0x206b59[_0x8a7c('0x55')];if(_0x29f90e[_0x8a7c('0x42')]['includeAll']){_0x129aee['include']=[{'all':!![]}];}_0x129aee=_[_0x8a7c('0x4e')]({},_0x129aee,_0x29f90e[_0x8a7c('0x50')]);return db[_0x8a7c('0x51')][_0x8a7c('0x57')](_0x129aee)['then'](handleEntityNotFound(_0x30cff6,null))[_0x8a7c('0x20')](respondWithResult(_0x30cff6,null))[_0x8a7c('0x2a')](handleError(_0x30cff6,null));};exports[_0x8a7c('0x58')]=function(_0x4622ac,_0x202765){return db[_0x8a7c('0x51')][_0x8a7c('0x58')](_0x4622ac['body'],{})[_0x8a7c('0x20')](respondWithResult(_0x202765,0xc9))[_0x8a7c('0x2a')](handleError(_0x202765,null));};exports[_0x8a7c('0x37')]=function(_0x494d63,_0x4a82c0){if(_0x494d63[_0x8a7c('0x59')]['id']){delete _0x494d63[_0x8a7c('0x59')]['id'];}return db[_0x8a7c('0x51')][_0x8a7c('0x57')]({'where':{'id':_0x494d63[_0x8a7c('0x5a')]['id']}})['then'](handleEntityNotFound(_0x4a82c0,null))[_0x8a7c('0x20')](saveUpdates(_0x494d63['body'],null))['then'](respondWithResult(_0x4a82c0,null))[_0x8a7c('0x2a')](handleError(_0x4a82c0,null));};exports[_0x8a7c('0x5b')]=function(_0x1a45c9,_0x9c921b){return db[_0x8a7c('0x51')][_0x8a7c('0x57')]({'where':{'id':_0x1a45c9[_0x8a7c('0x5a')]['id']}})['then'](handleEntityNotFound(_0x9c921b,null))[_0x8a7c('0x20')](removeEntity(_0x9c921b,null))[_0x8a7c('0x2a')](handleError(_0x9c921b,null));};exports[_0x8a7c('0x5c')]=function(_0x556eeb,_0x3d3849){return db[_0x8a7c('0x51')][_0x8a7c('0x5c')]()[_0x8a7c('0x20')](respondWithResult(_0x3d3849,null))[_0x8a7c('0x2a')](handleError(_0x3d3849,null));};var interaction_log=require(_0x8a7c('0x12'))(_0x8a7c('0x5d'));exports[_0x8a7c('0x5e')]=function(_0x14af38,_0x1b877f,_0x3a5982){var _0x4a8eeb={'agent':{},'channel':_0x8a7c('0x5f')};if(_0x14af38[_0x8a7c('0x59')]['id']){delete _0x14af38[_0x8a7c('0x59')]['id'];}_0x14af38['body'][_0x8a7c('0x60')]=!![];_0x14af38[_0x8a7c('0x59')][_0x8a7c('0x61')]=moment()[_0x8a7c('0x62')](_0x8a7c('0x63'));_0x14af38[_0x8a7c('0x59')][_0x8a7c('0x64')]=_0x14af38['body'][_0x8a7c('0x64')]||_0x14af38[_0x8a7c('0x65')]['id'];_0x4a8eeb[_0x8a7c('0x66')]['id']=_0x14af38['body'][_0x8a7c('0x64')];return db['SmsMessage'][_0x8a7c('0x57')]({'where':{'id':_0x14af38[_0x8a7c('0x5a')]['id'],'UserId':null}})[_0x8a7c('0x20')](handleEntityNotFound(_0x1b877f,null))['then'](saveUpdates(_0x14af38[_0x8a7c('0x59')],null))['then'](function(_0x38114c){if(_0x38114c){_0x4a8eeb[_0x8a7c('0x29')]=_0x38114c['get']({'plain':!![]});return db['SmsInteraction']['find']({'where':{'id':_0x38114c[_0x8a7c('0x67')]}});}return null;})[_0x8a7c('0x20')](handleEntityNotFound(_0x1b877f,null))[_0x8a7c('0x20')](function(_0x3e6984){if(_0x3e6984){return _0x3e6984[_0x8a7c('0x37')]({'UserId':_0x14af38['body'][_0x8a7c('0x64')],'read1stAt':_[_0x8a7c('0x68')](_0x3e6984[_0x8a7c('0x69')])?moment()['format'](_0x8a7c('0x63')):undefined});}return null;})[_0x8a7c('0x20')](function(_0x2ec387){if(_0x2ec387){_0x4a8eeb['interaction']=_0x2ec387[_0x8a7c('0x6a')]({'plain':!![]});interaction_log[_0x8a7c('0x21')]('[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x14af38['user']['id'],_0x14af38[_0x8a7c('0x65')]['name'],_0x14af38[_0x8a7c('0x65')]['role'],_0x4a8eeb[_0x8a7c('0x6b')]['id'],_0x14af38[_0x8a7c('0x59')]?JSON['stringify'](_0x14af38[_0x8a7c('0x59')]):'null');return respondWithRpcPromise(_0x8a7c('0x6c'),_0x8a7c('0x6d'),_0x4a8eeb);}return null;})['then'](function(_0x1017ef){var _0x2a4f24='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x1017ef[_0x8a7c('0x29')]['ContactId'];return db[_0x8a7c('0x6e')][_0x8a7c('0x42')](_0x2a4f24,{'type':db['Sequelize'][_0x8a7c('0x6f')]['SELECT'],'raw':!![]})[_0x8a7c('0x20')](function(_0x3fffab){return _0x3fffab;});})[_0x8a7c('0x20')](function(_0x4b4774){if(_0x4b4774){_0x4a8eeb[_0x8a7c('0x29')][_0x8a7c('0x70')]=_0x4b4774[0x0];if(!_0x14af38['body'][_0x8a7c('0x64')])return;return db[_0x8a7c('0x71')][_0x8a7c('0x57')]({'where':{'id':_0x14af38[_0x8a7c('0x59')]['UserId'],'role':'agent'},'attributes':['id',_0x8a7c('0x3a'),'fullname','email',_0x8a7c('0x72')],'raw':!![]});}return null;})[_0x8a7c('0x20')](function(_0x4cf063){if(!_0x4cf063)return null;_0x4a8eeb[_0x8a7c('0x29')][_0x8a7c('0x66')]=_0x4cf063;return _0x4a8eeb;})[_0x8a7c('0x20')](function(_0x4601c3){if(_0x4601c3){if(_0x14af38[_0x8a7c('0x59')][_0x8a7c('0x73')]){_0x4a8eeb[_0x8a7c('0x29')][_0x8a7c('0x74')]=util[_0x8a7c('0x62')](_0x8a7c('0x75'),_0x14af38[_0x8a7c('0x65')][_0x8a7c('0x3a')]);_0x4a8eeb['message']['channel']=_0x4a8eeb[_0x8a7c('0x76')];_0x4a8eeb[_0x8a7c('0x29')][_0x8a7c('0x77')]=_0x4a8eeb[_0x8a7c('0x76')];_0x4a8eeb[_0x8a7c('0x29')][_0x8a7c('0x78')]=_0x8a7c('0x5e');return respondWithRpcPromise(_0x8a7c('0x79'),_0x8a7c('0x79'),{'event':_0x8a7c('0x7a'),'message':_0x4a8eeb[_0x8a7c('0x29')]},client9002)[_0x8a7c('0x20')](function(){return _0x4a8eeb;});}return _0x4a8eeb;}return null;})[_0x8a7c('0x20')](respondWithResult(_0x1b877f,null))[_0x8a7c('0x2a')](handleError(_0x1b877f,null));};var interaction_log=require(_0x8a7c('0x12'))(_0x8a7c('0x5d'));exports[_0x8a7c('0x35')]=function(_0x378f83,_0x3f5ab7,_0x4c618b){var _0x3c4cde={'agent':{},'channel':'sms'};if(_0x378f83[_0x8a7c('0x59')]['id']){delete _0x378f83[_0x8a7c('0x59')]['id'];}_0x378f83['body'][_0x8a7c('0x64')]=_0x378f83[_0x8a7c('0x59')][_0x8a7c('0x64')]||_0x378f83[_0x8a7c('0x65')]['id'];_0x3c4cde[_0x8a7c('0x66')]['id']=_0x378f83['body'][_0x8a7c('0x64')];return db['SmsMessage'][_0x8a7c('0x57')]({'where':{'id':_0x378f83[_0x8a7c('0x5a')]['id'],'UserId':null}})[_0x8a7c('0x20')](handleEntityNotFound(_0x3f5ab7,null))[_0x8a7c('0x20')](function(_0x562a39){if(_0x562a39){_0x3c4cde[_0x8a7c('0x29')]=_0x562a39[_0x8a7c('0x6a')]({'plain':!![]});return db[_0x8a7c('0x7b')]['find']({'where':{'id':_0x562a39[_0x8a7c('0x67')]}});}return null;})[_0x8a7c('0x20')](handleEntityNotFound(_0x3f5ab7,null))[_0x8a7c('0x20')](function(_0x592201){if(_0x592201){_0x3c4cde['interaction']=_0x592201[_0x8a7c('0x6a')]({'plain':!![]});interaction_log['info'](_0x8a7c('0x7c'),_0x378f83[_0x8a7c('0x65')]['id'],_0x378f83['user'][_0x8a7c('0x3a')],_0x378f83[_0x8a7c('0x65')][_0x8a7c('0x7d')],_0x3c4cde[_0x8a7c('0x6b')]['id'],_0x378f83[_0x8a7c('0x59')]?JSON[_0x8a7c('0x26')](_0x378f83[_0x8a7c('0x59')]):_0x8a7c('0x7e'));return respondWithRpcPromise(_0x8a7c('0x7f'),'rejectMessage',_0x3c4cde);}return null;})[_0x8a7c('0x20')](function(_0xaa497e){var _0x4e1452=_0x8a7c('0x80')+_0xaa497e['message'][_0x8a7c('0x81')];return db['sequelize'][_0x8a7c('0x42')](_0x4e1452,{'type':db[_0x8a7c('0x82')][_0x8a7c('0x6f')][_0x8a7c('0x83')],'raw':!![]})[_0x8a7c('0x20')](function(_0xecd552){return _0xecd552;});})['then'](function(_0x4a0cbe){if(_0x4a0cbe){_0x3c4cde[_0x8a7c('0x29')][_0x8a7c('0x70')]=_0x4a0cbe[0x0];if(!_0x378f83['body'][_0x8a7c('0x64')])return;return db[_0x8a7c('0x71')][_0x8a7c('0x57')]({'where':{'id':_0x378f83[_0x8a7c('0x59')]['UserId'],'role':'agent'},'attributes':['id',_0x8a7c('0x3a'),'fullname',_0x8a7c('0x84'),'internal'],'raw':!![]});}return null;})['then'](function(_0x3a5f3f){if(!_0x3a5f3f)return null;_0x3c4cde[_0x8a7c('0x29')][_0x8a7c('0x66')]=_0x3a5f3f;return _0x3c4cde;})[_0x8a7c('0x20')](function(_0x3d1327){if(_0x3d1327){_0x3d1327['message'][_0x8a7c('0x74')]=util[_0x8a7c('0x62')](_0x8a7c('0x75'),_0x378f83['user'][_0x8a7c('0x3a')]);_0x3d1327['message']['channel']=_0x3c4cde[_0x8a7c('0x76')];_0x3d1327[_0x8a7c('0x29')]['motionChannel']=_0x3c4cde[_0x8a7c('0x76')];_0x3d1327['message']['event']=_0x8a7c('0x35');respondWithRpcPromise(_0x8a7c('0x79'),_0x8a7c('0x79'),{'event':'rejectmessage','message':_0x3d1327[_0x8a7c('0x29')]},client9002);return _0x3c4cde;}return null;})['then'](respondWithResult(_0x3f5ab7,null))[_0x8a7c('0x2a')](handleError(_0x3f5ab7,null));};exports[_0x8a7c('0x2c')]=function(_0x3b25e3,_0x68a853,_0x1778ca){if(_0x3b25e3[_0x8a7c('0x59')]['id']){delete _0x3b25e3[_0x8a7c('0x59')]['id'];}var _0x383d72;return db['SmsMessage'][_0x8a7c('0x57')]({'where':{'id':_0x3b25e3['params']['id']}})[_0x8a7c('0x20')](handleEntityNotFound(_0x68a853,null))[_0x8a7c('0x20')](function(_0x329b72){if(_0x329b72){_0x383d72=_0x329b72;return db[_0x8a7c('0x85')][_0x8a7c('0x57')]({'where':{'id':_0x329b72[_0x8a7c('0x86')]}});}})[_0x8a7c('0x20')](handleEntityNotFound(_0x68a853,null))['then'](function(_0x135b78){if(_0x135b78){logger['debug'](_0x8a7c('0x24'),_0x8a7c('0x2c'),'received\x20delivery\x20report\x20from',_0x135b78[_0x8a7c('0x40')],util[_0x8a7c('0x87')](_0x3b25e3['body'],{'showHidden':![],'depth':null}));switch(_0x135b78['type']){case'twilio':if(_0x3b25e3[_0x8a7c('0x59')]['MessageSid']&&_0x3b25e3['body'][_0x8a7c('0x88')]===_0x383d72['messageId']){return _0x383d72[_0x8a7c('0x37')]({'read':!![]});}else{logger[_0x8a7c('0x27')](_0x8a7c('0x89'),_0x8a7c('0x2c'),'twilio',util[_0x8a7c('0x87')](_0x3b25e3[_0x8a7c('0x59')],{'showHidden':![],'depth':null}));}break;case _0x8a7c('0x8a'):if(_0x3b25e3[_0x8a7c('0x59')][_0x8a7c('0x8b')]&&_0x3b25e3[_0x8a7c('0x59')][_0x8a7c('0x8b')]===_0x383d72[_0x8a7c('0x8c')]&&_['indexOf']([_0x8a7c('0x8d'),_0x8a7c('0x8e')],_0x3b25e3['body'][_0x8a7c('0x8f')])>=0x0){return _0x383d72[_0x8a7c('0x37')]({'read':!![]});}else{logger[_0x8a7c('0x27')](_0x8a7c('0x89'),'status','plivio',util['inspect'](_0x3b25e3['body'],{'showHidden':![],'depth':null}));}break;case _0x8a7c('0x90'):var _0x45f884=_0x3b25e3[_0x8a7c('0x59')][_0x8a7c('0x91')][0x0];if(_0x45f884[_0x8a7c('0x2c')][_0x8a7c('0x92')]===_0x8a7c('0x93')){return _0x383d72[_0x8a7c('0x37')]({'read':!![]});}else{logger[_0x8a7c('0x27')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x8a7c('0x2c'),_0x8a7c('0x90'),util[_0x8a7c('0x87')](_0x3b25e3[_0x8a7c('0x59')],{'showHidden':![],'depth':null}));}break;}return _0x383d72;}})[_0x8a7c('0x20')](respondWithResult(_0x68a853,null))[_0x8a7c('0x2a')](handleError(_0x68a853,null));}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.events.js b/server/api/smsMessage/smsMessage.events.js index ae3a90a..c1352b0 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 _0x5b92=['remove','emit','hook','exports','events','../../mysqldb','SmsMessage','setMaxListeners','save'];(function(_0x55d67c,_0x2ae961){var _0x407d48=function(_0x3cf05c){while(--_0x3cf05c){_0x55d67c['push'](_0x55d67c['shift']());}};_0x407d48(++_0x2ae961);}(_0x5b92,0xd3));var _0x25b9=function(_0x5c351c,_0x2046d8){_0x5c351c=_0x5c351c-0x0;var _0x26f3b3=_0x5b92[_0x5c351c];return _0x26f3b3;};'use strict';var EventEmitter=require(_0x25b9('0x0'));var SmsMessage=require(_0x25b9('0x1'))['db'][_0x25b9('0x2')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0x25b9('0x3')](0x0);var events={'afterCreate':_0x25b9('0x4'),'afterUpdate':'update','afterDestroy':_0x25b9('0x5')};function emitEvent(_0x24ee63){return function(_0xf4def7,_0x1a4a71,_0xbbd2ad){SmsMessageEvents['emit'](_0x24ee63+':'+_0xf4def7['id'],_0xf4def7);SmsMessageEvents[_0x25b9('0x6')](_0x24ee63,_0xf4def7);_0xbbd2ad(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsMessage[_0x25b9('0x7')](e,emitEvent(event));}}module[_0x25b9('0x8')]=SmsMessageEvents; \ No newline at end of file +var _0x1af1=['hasOwnProperty','exports','events','../../mysqldb','SmsMessage','setMaxListeners','update','remove','emit'];(function(_0x4ad1d3,_0x2aecb9){var _0x495878=function(_0x3f81a1){while(--_0x3f81a1){_0x4ad1d3['push'](_0x4ad1d3['shift']());}};_0x495878(++_0x2aecb9);}(_0x1af1,0x107));var _0x11af=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1af1[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0x11af('0x0'));var SmsMessage=require(_0x11af('0x1'))['db'][_0x11af('0x2')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0x11af('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x11af('0x4'),'afterDestroy':_0x11af('0x5')};function emitEvent(_0x3c44f0){return function(_0x59dcfe,_0x465670,_0x14290b){SmsMessageEvents[_0x11af('0x6')](_0x3c44f0+':'+_0x59dcfe['id'],_0x59dcfe);SmsMessageEvents[_0x11af('0x6')](_0x3c44f0,_0x59dcfe);_0x14290b(null);};}for(var e in events){if(events[_0x11af('0x7')](e)){var event=events[e];SmsMessage['hook'](e,emitEvent(event));}}module[_0x11af('0x8')]=SmsMessageEvents; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.model.js b/server/api/smsMessage/smsMessage.model.js index 6069f12..65a5607 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 _0x559b=['/messages','applicationId','intelepeer','https://api.intelepeer.com/_rest/v4/app/sms/send','Bearer\x20','code','message','https://api.intelepeer.com/_rest/v4/app/sms/mdr','application/json','refid','status','Token\x20not\x20received','finally','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsMessage.attributes','exports','define','SmsMessage','sms_messages','messageId','fti_sms_messages','body','FULLTEXT','models','get','toLowerCase','out','secret','isNil','UserId','findOne','then','update','createdAt','direction','catch','error','SmsAccount','find','SmsAccountId','type','twilio','phone','authToken','remote','token','sid','afterCreate','SmsMessage,\x20%s,\x20%s,\x20%s','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','skebby','username','password','smsMethod','sender','login?username=','&password=','total_sent','internal_order_id','deliveryReport','read','inspect','Missing\x20parameters:\x20username,\x20password','connectel','senderString','https://smsapi.connectel.se/api/v2/send/','requestid','Missing\x20parameters:\x20authToken','clicksend','xCALLY\x20Motion','%s:%s','POST','https://rest.clicksend.com/v3/sms/send','Basic\x20%s','toString','base64','http_code','data','queued_count','head','messages','message_id','clickSend','authId','/api/sms/messages/','format','https://api.plivo.com/v1/Account/%s/Message/','plivo','infobip','baseUrl','/auth/1/session','IBSSO\x20','Missing\x20parameters:\x20base_url','csc','apiKey','login','timestamp','keys','sort','length','md5','digest','GET','/external/get/send.php?','id_sms','https://platform.clickatell.com/messages','uuid','UTF-8','apiMessageId','clickatell','Missing\x20parameters:\x20apiKey','bandwidth','https://messaging.bandwidth.com/api/v2/users/','accountId'];(function(_0x49588f,_0x3e56ea){var _0x41b293=function(_0x71668d){while(--_0x71668d){_0x49588f['push'](_0x49588f['shift']());}};_0x41b293(++_0x3e56ea);}(_0x559b,0x103));var _0xb559=function(_0x5beb7b,_0x447378){_0x5beb7b=_0x5beb7b-0x0;var _0x330407=_0x559b[_0x5beb7b];return _0x330407;};'use strict';var _=require(_0xb559('0x0'));var util=require(_0xb559('0x1'));var logger=require(_0xb559('0x2'))(_0xb559('0x3'));var moment=require(_0xb559('0x4'));var BPromise=require(_0xb559('0x5'));var rp=require(_0xb559('0x6'));var fs=require('fs');var path=require(_0xb559('0x7'));var rimraf=require(_0xb559('0x8'));var config=require(_0xb559('0x9'));var attributes=require(_0xb559('0xa'));module[_0xb559('0xb')]=function(_0x3c9511,_0x1ab77f){return _0x3c9511[_0xb559('0xc')](_0xb559('0xd'),attributes,{'tableName':_0xb559('0xe'),'paranoid':![],'indexes':[{'name':_0xb559('0xf'),'fields':['messageId']},{'name':_0xb559('0x10'),'fields':[_0xb559('0x11')],'type':_0xb559('0x12')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x28c34a,_0x2c9951,_0x50851f){var _0xb78125=_0x3c9511[_0xb559('0x13')];var _0x1ad0b8=_0x28c34a[_0xb559('0x14')]({'plain':!![]});if(_0x1ad0b8['direction'][_0xb559('0x15')]()==='in'||_0x1ad0b8['direction']['toLowerCase']()===_0xb559('0x16')&&!_0x1ad0b8[_0xb559('0x17')]&&!_[_0xb559('0x18')](_0x1ad0b8[_0xb559('0x19')])&&!_[_0xb559('0x18')](_0x1ad0b8['SmsInteractionId'])){_0xb78125['SmsInteraction'][_0xb559('0x1a')]({'where':{'id':_0x1ad0b8['SmsInteractionId']}})[_0xb559('0x1b')](function(_0x5781c0){if(_0x5781c0){_0x5781c0[_0xb559('0x1c')]({'lastMsgAt':_0x1ad0b8[_0xb559('0x1d')],'lastMsgDirection':_0x1ad0b8[_0xb559('0x1e')][_0xb559('0x15')]()});}})[_0xb559('0x1f')](function(_0x4e032b){console[_0xb559('0x20')](_0x4e032b);});}if(_0x1ad0b8[_0xb559('0x1e')]===_0xb559('0x16')&&!_0x1ad0b8[_0xb559('0x17')]){var _0x1e93c4;_0xb78125[_0xb559('0x21')][_0xb559('0x22')]({'where':{'id':_0x1ad0b8[_0xb559('0x23')]},'raw':!![]})[_0xb559('0x1b')](function(_0x70fa03){_0x1e93c4=_0x70fa03;if(_0x1e93c4&&_0x1e93c4[_0xb559('0x24')]){switch(_0x1e93c4[_0xb559('0x24')]){case _0xb559('0x25'):var _0x392bdf=require(_0xb559('0x25'));if(_0x1e93c4['accountSid']&&_0x1e93c4['authToken']&&_0x1e93c4[_0xb559('0x26')]){var _0x323bcd=new _0x392bdf(_0x1e93c4['accountSid'],_0x1e93c4[_0xb559('0x27')]);_0x323bcd['messages']['create']({'body':_0x1ad0b8[_0xb559('0x11')],'to':_0x1ad0b8[_0xb559('0x26')],'from':_0x1e93c4[_0xb559('0x26')],'statusCallback':_0x1e93c4[_0xb559('0x28')]+'/api/sms/messages/'+_0x1ad0b8['id']+'/status?token='+_0x1e93c4[_0xb559('0x29')]})[_0xb559('0x1b')](function(_0x4d8eb7){if(_0x4d8eb7[_0xb559('0x2a')]){return _0x28c34a[_0xb559('0x1c')]({'messageId':_0x4d8eb7[_0xb559('0x2a')]});}})[_0xb559('0x1f')](function(_0x4d00fa){logger[_0xb559('0x20')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xb559('0x2b'),'twilio',util['inspect'](_0x4d00fa,{'showHidden':![],'depth':null}));});}else{logger[_0xb559('0x20')](_0xb559('0x2c'),_0xb559('0x2b'),'twilio',_0xb559('0x2d'));}break;case _0xb559('0x2e'):var _0x26cf0b='https://api.skebby.it/API/v1.0/REST/';if(_0x1e93c4[_0xb559('0x2f')]&&_0x1e93c4[_0xb559('0x30')]){var _0x2d5588={'recipient':[_0x1ad0b8[_0xb559('0x26')]],'message':_0x1ad0b8[_0xb559('0x11')],'message_type':_0x1e93c4[_0xb559('0x31')]};if(_0x1e93c4[_0xb559('0x31')]&&_0x1e93c4[_0xb559('0x31')]!=='SI'){_0x2d5588[_0xb559('0x32')]=_0x1e93c4['phone'];}var _0x4b5a5e={'url':_0x26cf0b+_0xb559('0x33')+_0x1e93c4[_0xb559('0x2f')]+_0xb559('0x34')+_0x1e93c4[_0xb559('0x30')],'method':'GET'};rp(_0x4b5a5e)['then'](function(_0x3add98){var _0x539ea6=_0x3add98['split'](';');var _0x44953a={'user_key':_0x539ea6[0x0],'session_key':_0x539ea6[0x1]};_0x4b5a5e={'url':_0x26cf0b+'sms','method':'POST','headers':{'user_key':_0x44953a['user_key'],'Session_key':_0x44953a['session_key']},'json':!![],'body':_0x2d5588};return rp(_0x4b5a5e);})[_0xb559('0x1b')](function(_0x16aaa8){if(_0x16aaa8[_0xb559('0x35')]>=0x1){var _0x46e6ee={'messageId':_0x16aaa8[_0xb559('0x36')]};if(_0x1e93c4['smsMethod']!=='GP'||!_0x1e93c4[_0xb559('0x37')]){_0x46e6ee[_0xb559('0x38')]=!![];}return _0x28c34a['update'](_0x46e6ee);}else{return logger[_0xb559('0x20')](_0xb559('0x2c'),_0xb559('0x2b'),'skebby',util[_0xb559('0x39')](_0x16aaa8,{'showHidden':![],'depth':null}));}})[_0xb559('0x1f')](function(_0x40bbe1){return logger[_0xb559('0x20')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xb559('0x2b'),_0xb559('0x2e'),util['inspect'](_0x40bbe1,{'showHidden':![],'depth':null}));});}else{logger[_0xb559('0x20')](_0xb559('0x2c'),_0xb559('0x2b'),_0xb559('0x2e'),_0xb559('0x3a'));}break;case _0xb559('0x3b'):if(_0x1e93c4[_0xb559('0x27')]){var _0x1aefee={'recipient':_0x1ad0b8[_0xb559('0x26')],'message':_0x1ad0b8['body'],'sender':_0x1e93c4[_0xb559('0x3c')]||_0x1e93c4[_0xb559('0x26')],'authorization':_0x1e93c4[_0xb559('0x27')]};var _0x2c9951={'method':'POST','uri':_0xb559('0x3d'),'body':_0x1aefee,'json':!![]};rp(_0x2c9951)[_0xb559('0x1b')](function(_0x14133c){var _0x2ed71f={'messageId':_0x14133c[_0xb559('0x3e')]};if(!_0x1e93c4[_0xb559('0x37')]){_0x2ed71f[_0xb559('0x38')]=!![];}return _0x28c34a[_0xb559('0x1c')](_0x2ed71f);})[_0xb559('0x1f')](function(_0x19f01c){logger['error'](_0xb559('0x2c'),'afterCreate','connectel',util[_0xb559('0x39')](_0x19f01c,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xb559('0x2c'),_0xb559('0x2b'),_0xb559('0x3b'),_0xb559('0x3f'));}break;case _0xb559('0x40'):if(_0x1e93c4[_0xb559('0x2f')]&&_0x1e93c4[_0xb559('0x30')]){var _0x1aefee={'messages':[{'source':_0xb559('0x41'),'to':_0x1ad0b8['phone'],'body':_0x1ad0b8[_0xb559('0x11')],'from':_0x1e93c4[_0xb559('0x3c')]||_0x1e93c4[_0xb559('0x26')]}]};var _0x16f119=util['format'](_0xb559('0x42'),_0x1e93c4[_0xb559('0x2f')],_0x1e93c4[_0xb559('0x30')]);var _0x2c9951={'method':_0xb559('0x43'),'uri':_0xb559('0x44'),'body':_0x1aefee,'headers':{'Authorization':util['format'](_0xb559('0x45'),new Buffer(_0x16f119)[_0xb559('0x46')](_0xb559('0x47')))},'json':!![]};rp(_0x2c9951)[_0xb559('0x1b')](function(_0x47647f){if(_0x47647f[_0xb559('0x48')]>=0xc8&&_0x47647f['http_code']<=0xce){if(_0x47647f[_0xb559('0x49')]&&_0x47647f[_0xb559('0x49')][_0xb559('0x4a')]>0x0){var _0x22f663=_[_0xb559('0x4b')](_0x47647f[_0xb559('0x49')][_0xb559('0x4c')]);var _0x276289={'messageId':_0x22f663[_0xb559('0x4d')]};if(!_0x1e93c4[_0xb559('0x37')]){_0x276289[_0xb559('0x38')]=!![];}return _0x28c34a['update'](_0x276289);}else{logger[_0xb559('0x20')](_0xb559('0x2c'),_0xb559('0x2b'),_0xb559('0x4e'),util[_0xb559('0x39')](_0x47647f,{'showHidden':![],'depth':null}));}}else{logger[_0xb559('0x20')](_0xb559('0x2c'),_0xb559('0x2b'),_0xb559('0x4e'),util[_0xb559('0x39')](_0x47647f,{'showHidden':![],'depth':null}));}})[_0xb559('0x1f')](function(_0x1b0b7c){logger[_0xb559('0x20')](_0xb559('0x2c'),'afterCreate',_0xb559('0x4e'),util['inspect'](_0x1b0b7c,{'showHidden':![],'depth':null}));});}else{logger[_0xb559('0x20')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xb559('0x2b'),'clickSend','Missing\x20parameters:\x20username,\x20password');}break;case'plivo':if(_0x1e93c4[_0xb559('0x4f')]&&_0x1e93c4[_0xb559('0x27')]){var _0x1aefee={'dst':_0x1ad0b8[_0xb559('0x26')],'text':_0x1ad0b8[_0xb559('0x11')],'src':_0x1e93c4[_0xb559('0x3c')]||_0x1e93c4['phone'],'url':_0x1e93c4[_0xb559('0x28')]+_0xb559('0x50')+_0x1ad0b8['id']+'/status?token='+_0x1e93c4[_0xb559('0x29')]};var _0x16f119=util[_0xb559('0x51')](_0xb559('0x42'),_0x1e93c4[_0xb559('0x4f')],_0x1e93c4['authToken']);var _0x2c9951={'method':_0xb559('0x43'),'uri':util['format'](_0xb559('0x52'),_0x1e93c4[_0xb559('0x4f')]),'body':_0x1aefee,'headers':{'Authorization':util[_0xb559('0x51')](_0xb559('0x45'),new Buffer(_0x16f119)['toString'](_0xb559('0x47')))},'json':!![]};rp(_0x2c9951)['then'](function(_0x176652){var _0x2f1d4d={'messageId':_0x176652['message_uuid'][0x0]};return _0x28c34a[_0xb559('0x1c')](_0x2f1d4d);})[_0xb559('0x1f')](function(_0x2fba9d){logger['error'](_0xb559('0x2c'),'afterCreate',_0xb559('0x53'),util[_0xb559('0x39')](_0x2fba9d,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xb559('0x2c'),'afterCreate',_0xb559('0x53'),'Missing\x20parameters:\x20authId,\x20authToken');}break;case _0xb559('0x54'):if(_0x1e93c4['username']&&_0x1e93c4[_0xb559('0x30')]){if(_0x1e93c4[_0xb559('0x55')]){var _0x41f0ed={'method':_0xb559('0x43'),'uri':_0x1e93c4['baseUrl']+_0xb559('0x56'),'body':{'username':_0x1e93c4[_0xb559('0x2f')],'password':_0x1e93c4[_0xb559('0x30')]},'json':!![]};return rp(_0x41f0ed)[_0xb559('0x1b')](function(_0x42218d){var _0xcb4812={'method':_0xb559('0x43'),'uri':_0x1e93c4[_0xb559('0x55')]+'/sms/2/text/advanced','body':{'messages':[{'from':_0x1e93c4[_0xb559('0x26')],'destinations':[{'to':_0x1ad0b8[_0xb559('0x26')]}],'text':_0x1ad0b8[_0xb559('0x11')],'notifyUrl':_0x1e93c4[_0xb559('0x28')]+'/api/sms/messages/'+_0x1ad0b8['id']+'/status?token='+_0x1e93c4[_0xb559('0x29')],'notifyContentType':'application/json','callbackData':_0x1e93c4[_0xb559('0x26')]+';'+_0x1ad0b8[_0xb559('0x11')]}]},'headers':{'Authorization':_0xb559('0x57')+_0x42218d[_0xb559('0x29')]},'json':!![]};return rp(_0xcb4812)[_0xb559('0x1b')](function(_0x10c318){if(_0x10c318[_0xb559('0x4c')]){var _0x428c29={'messageId':_0x10c318['messages'][0x0]['messageId']};if(!_0x1e93c4[_0xb559('0x37')]){_0x428c29[_0xb559('0x38')]=!![];}return _0x28c34a[_0xb559('0x1c')](_0x428c29);}else{return logger['error'](_0xb559('0x2c'),'afterCreate',_0xb559('0x54'),util[_0xb559('0x39')](_0x10c318,{'showHidden':![],'depth':null}));}});})[_0xb559('0x1f')](function(_0x315c64){return logger['error'](_0xb559('0x2c'),'afterCreate',_0xb559('0x54'),util[_0xb559('0x39')](_0x315c64,{'showHidden':![],'depth':null}));});}else{logger[_0xb559('0x20')](_0xb559('0x2c'),_0xb559('0x2b'),_0xb559('0x54'),_0xb559('0x58'));}}else{logger[_0xb559('0x20')](_0xb559('0x2c'),_0xb559('0x2b'),_0xb559('0x54'),_0xb559('0x3a'));}break;case _0xb559('0x59'):var _0x4ee746=require('crypto');if(_0x1e93c4[_0xb559('0x5a')]){var _0x2c8417={};_0x2c8417[_0xb559('0x5b')]=_0x1e93c4['username'];_0x2c8417[_0xb559('0x26')]=_0x1ad0b8[_0xb559('0x26')];_0x2c8417[_0xb559('0x32')]=_0x1e93c4['phone'];_0x2c8417['text']=_0x1ad0b8['body'];_0x2c8417[_0xb559('0x5c')]=+new Date();var _0x4c754b='';var _0x3a46db='';var _0x324e01=Object[_0xb559('0x5d')](_0x2c8417);_0x324e01[_0xb559('0x5e')]();for(var _0x592b6f=0x0;_0x592b6f<_0x324e01[_0xb559('0x5f')];_0x592b6f++){if(_0x4c754b!=''){_0x4c754b+='&';}_0x4c754b+=_0x324e01[_0x592b6f]+'='+encodeURIComponent(_0x2c8417[_0x324e01[_0x592b6f]]);_0x3a46db+=_0x2c8417[_0x324e01[_0x592b6f]];}_0x3a46db+=_0x1e93c4[_0xb559('0x5a')];_0x3a46db=_0x4ee746['createHash'](_0xb559('0x60'))[_0xb559('0x1c')](_0x3a46db)[_0xb559('0x61')]('hex');if(_0x4c754b!==''){_0x4c754b+='&';}_0x4c754b+='signature='+_0x3a46db;var _0x4b5a5e={'method':_0xb559('0x62'),'uri':_0x1e93c4[_0xb559('0x55')]+_0xb559('0x63')+_0x4c754b,'json':!![]};return rp(_0x4b5a5e)['then'](function(_0x41d67c){var _0x134969=Object[_0xb559('0x5d')](_0x41d67c);if(_0x41d67c[_0x134969[0x0]][_0xb559('0x20')]&&parseInt(_0x41d67c[_0x134969[0x0]][_0xb559('0x20')])===0x0){var _0x5f25d8={'messageId':_0x41d67c[_0x134969[0x0]][_0xb559('0x64')]};if(!_0x1e93c4[_0xb559('0x37')]){_0x5f25d8[_0xb559('0x38')]=!![];}return _0x28c34a['update'](_0x5f25d8);}else{return logger[_0xb559('0x20')](_0xb559('0x2c'),_0xb559('0x2b'),_0xb559('0x59'),util['inspect'](_0x41d67c[_0xb559('0x20')],{'showHidden':![],'depth':null}));}})['catch'](function(_0x25eecd){return logger[_0xb559('0x20')](_0xb559('0x2c'),'afterCreate','csc',util[_0xb559('0x39')](_0x25eecd,{'showHidden':![],'depth':null}));});}else{logger[_0xb559('0x20')](_0xb559('0x2c'),'afterCreate',_0xb559('0x59'),'Missing\x20parameters:\x20apiKey');}break;case'clickatell':if(_0x1e93c4[_0xb559('0x5a')]){var _0x23d67b={'method':'POST','uri':_0xb559('0x65'),'headers':{'Authorization':_0x1e93c4[_0xb559('0x5a')]},'body':{'content':_0x1ad0b8[_0xb559('0x11')],'to':[_0x1ad0b8[_0xb559('0x26')]],'from':_0x1e93c4[_0xb559('0x26')],'binary':![],'clientMessageId':_0xb559('0x66'),'charset':_0xb559('0x67')},'json':!![]};rp(_0x23d67b)['then'](function(_0xfd9e7a){if(!_0xfd9e7a[_0xb559('0x20')]){var _0x2e9a11={'messageId':_0xfd9e7a[_0xb559('0x4c')][0x0][_0xb559('0x68')]};if(!_0x1e93c4['deliveryReport']){_0x2e9a11[_0xb559('0x38')]=!![];}return _0x28c34a[_0xb559('0x1c')](_0x2e9a11);}else{return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0xb559('0x69'),util['inspect'](_0xfd9e7a[_0xb559('0x20')],{'showHidden':![],'depth':null}));}})[_0xb559('0x1f')](function(_0x27496e){return logger[_0xb559('0x20')](_0xb559('0x2c'),'afterCreate',_0xb559('0x69'),util[_0xb559('0x39')](_0x27496e,{'showHidden':![],'depth':null}));});}else{logger[_0xb559('0x20')](_0xb559('0x2c'),_0xb559('0x2b'),_0xb559('0x69'),_0xb559('0x6a'));}break;case _0xb559('0x6b'):if(_0x1e93c4[_0xb559('0x2f')]&&_0x1e93c4[_0xb559('0x30')]){var _0x16f119=util[_0xb559('0x51')]('%s:%s',_0x1e93c4['username'],_0x1e93c4['password']);var _0x2c9951={'method':_0xb559('0x43'),'uri':_0xb559('0x6c')+_0x1e93c4[_0xb559('0x6d')]+_0xb559('0x6e'),'body':{'to':[_0x1ad0b8[_0xb559('0x26')]],'text':_0x1ad0b8[_0xb559('0x11')],'from':_0x1e93c4[_0xb559('0x26')],'applicationId':_0x1e93c4[_0xb559('0x6f')]},'headers':{'Authorization':util[_0xb559('0x51')](_0xb559('0x45'),new Buffer(_0x16f119)['toString'](_0xb559('0x47')))},'json':!![]};rp(_0x2c9951)[_0xb559('0x1b')](function(_0x370c92){if(_0x370c92['id']){var _0xd3605b={'messageId':_0x370c92['id']};return _0x28c34a[_0xb559('0x1c')](_0xd3605b);}else{logger['error'](_0xb559('0x2c'),_0xb559('0x2b'),'bandwidth',util[_0xb559('0x39')](_0x370c92,{'showHidden':![],'depth':null}));}})[_0xb559('0x1f')](function(_0x572dd8){logger['error'](_0xb559('0x2c'),'afterCreate','bandwidth',util[_0xb559('0x39')](_0x572dd8,{'showHidden':![],'depth':null}));});}else{logger[_0xb559('0x20')](_0xb559('0x2c'),'afterCreate',_0xb559('0x6b'),_0xb559('0x3a'));}break;case _0xb559('0x70'):if(_0x1e93c4[_0xb559('0x5a')]){var _0x2a7938={};var _0x4b5a5e={'method':'POST','uri':_0xb559('0x71'),'headers':{'Authorization':_0xb559('0x72')+_0x1e93c4[_0xb559('0x5a')],'Content-Type':'application/json'},'body':{'from':_0x1e93c4[_0xb559('0x26')],'to':_0x1ad0b8['phone'],'text':_0x1ad0b8[_0xb559('0x11')]},'json':!![]};return rp(_0x4b5a5e)['then'](function(_0x689f6f){if(_0x689f6f[_0xb559('0x73')]==0xca){_0x2a7938[_0xb559('0x74')]=_0x689f6f;var _0x25ed1a={'method':_0xb559('0x43'),'uri':_0xb559('0x75'),'headers':{'Authorization':_0xb559('0x72')+_0x1e93c4[_0xb559('0x5a')],'Content-Type':_0xb559('0x76')},'body':{'refid':_0x2a7938[_0xb559('0x74')][_0xb559('0x77')]},'json':!![]};return rp(_0x25ed1a)[_0xb559('0x1b')](function(_0x5b4057){_0x2a7938[_0xb559('0x78')]=_0x5b4057;var _0x4efb26={'messageId':_0x2a7938[_0xb559('0x74')][_0xb559('0x77')],'read':!![]};return _0x28c34a['update'](_0x4efb26);});}else{return logger['error'](_0xb559('0x2c'),_0xb559('0x2b'),_0xb559('0x70'),util[_0xb559('0x39')](_0x689f6f,{'showHidden':![],'depth':null}));}})[_0xb559('0x1f')](function(_0x5224c2){return logger['error'](_0xb559('0x2c'),'afterCreate',_0xb559('0x70'),util['inspect'](_0x5224c2,{'showHidden':![],'depth':null}));});}else{return logger[_0xb559('0x20')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','intelepeer',_0xb559('0x79'));}break;}}})[_0xb559('0x7a')](function(){_0x50851f();});}else{_0x50851f();}}},'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x233d=['bandwidth','%s:%s','https://messaging.bandwidth.com/api/v2/users/','accountId','applicationId','intelepeer','Bearer\x20','application/json','code','message','https://api.intelepeer.com/_rest/v4/app/sms/mdr','refid','finally','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','SmsMessage','sms_messages','messageId','fti_sms_messages','FULLTEXT','models','get','toLowerCase','out','isNil','UserId','SmsInteractionId','SmsInteraction','findOne','then','createdAt','direction','error','secret','find','type','twilio','accountSid','authToken','create','body','phone','/api/sms/messages/','/status?token=','sid','catch','afterCreate','inspect','SmsMessage,\x20%s,\x20%s,\x20%s','skebby','https://api.skebby.it/API/v1.0/REST/','smsMethod','login?username=','username','password','GET','split','sms','POST','user_key','session_key','total_sent','internal_order_id','deliveryReport','update','Missing\x20parameters:\x20username,\x20password','senderString','requestid','read','connectel','Missing\x20parameters:\x20authToken','format','https://rest.clicksend.com/v3/sms/send','Basic\x20%s','base64','http_code','data','queued_count','head','messages','message_id','clickSend','plivo','remote','token','https://api.plivo.com/v1/Account/%s/Message/','authId','toString','message_uuid','Missing\x20parameters:\x20authId,\x20authToken','infobip','baseUrl','/auth/1/session','/sms/2/text/advanced','Missing\x20parameters:\x20base_url','csc','crypto','login','sender','text','timestamp','length','apiKey','md5','digest','hex','/external/get/send.php?','keys','id_sms','Missing\x20parameters:\x20apiKey','clickatell','apiMessageId'];(function(_0x1db159,_0x552aea){var _0x4aa131=function(_0x1318b5){while(--_0x1318b5){_0x1db159['push'](_0x1db159['shift']());}};_0x4aa131(++_0x552aea);}(_0x233d,0x8a));var _0xd233=function(_0x2338fa,_0x80579a){_0x2338fa=_0x2338fa-0x0;var _0x42df9b=_0x233d[_0x2338fa];return _0x42df9b;};'use strict';var _=require(_0xd233('0x0'));var util=require(_0xd233('0x1'));var logger=require(_0xd233('0x2'))('api');var moment=require(_0xd233('0x3'));var BPromise=require(_0xd233('0x4'));var rp=require(_0xd233('0x5'));var fs=require('fs');var path=require(_0xd233('0x6'));var rimraf=require(_0xd233('0x7'));var config=require(_0xd233('0x8'));var attributes=require('./smsMessage.attributes');module[_0xd233('0x9')]=function(_0xafb21f,_0x231679){return _0xafb21f[_0xd233('0xa')](_0xd233('0xb'),attributes,{'tableName':_0xd233('0xc'),'paranoid':![],'indexes':[{'name':_0xd233('0xd'),'fields':[_0xd233('0xd')]},{'name':_0xd233('0xe'),'fields':['body'],'type':_0xd233('0xf')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x2cfc21,_0x42f1b9,_0x332459){var _0x153873=_0xafb21f[_0xd233('0x10')];var _0x5d6215=_0x2cfc21[_0xd233('0x11')]({'plain':!![]});if(_0x5d6215['direction'][_0xd233('0x12')]()==='in'||_0x5d6215['direction'][_0xd233('0x12')]()===_0xd233('0x13')&&!_0x5d6215['secret']&&!_[_0xd233('0x14')](_0x5d6215[_0xd233('0x15')])&&!_['isNil'](_0x5d6215[_0xd233('0x16')])){_0x153873[_0xd233('0x17')][_0xd233('0x18')]({'where':{'id':_0x5d6215[_0xd233('0x16')]}})[_0xd233('0x19')](function(_0x52e96c){if(_0x52e96c){_0x52e96c['update']({'lastMsgAt':_0x5d6215[_0xd233('0x1a')],'lastMsgDirection':_0x5d6215[_0xd233('0x1b')]['toLowerCase']()});}})['catch'](function(_0x5d6580){console[_0xd233('0x1c')](_0x5d6580);});}if(_0x5d6215[_0xd233('0x1b')]===_0xd233('0x13')&&!_0x5d6215[_0xd233('0x1d')]){var _0x51d786;_0x153873['SmsAccount'][_0xd233('0x1e')]({'where':{'id':_0x5d6215['SmsAccountId']},'raw':!![]})['then'](function(_0x45b889){_0x51d786=_0x45b889;if(_0x51d786&&_0x51d786[_0xd233('0x1f')]){switch(_0x51d786[_0xd233('0x1f')]){case _0xd233('0x20'):var _0x50c36c=require('twilio');if(_0x51d786[_0xd233('0x21')]&&_0x51d786[_0xd233('0x22')]&&_0x51d786['phone']){var _0x5303b2=new _0x50c36c(_0x51d786[_0xd233('0x21')],_0x51d786[_0xd233('0x22')]);_0x5303b2['messages'][_0xd233('0x23')]({'body':_0x5d6215[_0xd233('0x24')],'to':_0x5d6215[_0xd233('0x25')],'from':_0x51d786[_0xd233('0x25')],'statusCallback':_0x51d786['remote']+_0xd233('0x26')+_0x5d6215['id']+_0xd233('0x27')+_0x51d786['token']})[_0xd233('0x19')](function(_0x36b4cc){if(_0x36b4cc[_0xd233('0x28')]){return _0x2cfc21['update']({'messageId':_0x36b4cc[_0xd233('0x28')]});}})[_0xd233('0x29')](function(_0x6ff4b5){logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0xd233('0x2a'),_0xd233('0x20'),util[_0xd233('0x2b')](_0x6ff4b5,{'showHidden':![],'depth':null}));});}else{logger[_0xd233('0x1c')](_0xd233('0x2c'),'afterCreate','twilio','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken');}break;case _0xd233('0x2d'):var _0x53602a=_0xd233('0x2e');if(_0x51d786['username']&&_0x51d786['password']){var _0x44051f={'recipient':[_0x5d6215[_0xd233('0x25')]],'message':_0x5d6215[_0xd233('0x24')],'message_type':_0x51d786[_0xd233('0x2f')]};if(_0x51d786[_0xd233('0x2f')]&&_0x51d786[_0xd233('0x2f')]!=='SI'){_0x44051f['sender']=_0x51d786[_0xd233('0x25')];}var _0x575888={'url':_0x53602a+_0xd233('0x30')+_0x51d786[_0xd233('0x31')]+'&password='+_0x51d786[_0xd233('0x32')],'method':_0xd233('0x33')};rp(_0x575888)[_0xd233('0x19')](function(_0x2859e7){var _0x1cd7fd=_0x2859e7[_0xd233('0x34')](';');var _0x2ead0b={'user_key':_0x1cd7fd[0x0],'session_key':_0x1cd7fd[0x1]};_0x575888={'url':_0x53602a+_0xd233('0x35'),'method':_0xd233('0x36'),'headers':{'user_key':_0x2ead0b[_0xd233('0x37')],'Session_key':_0x2ead0b[_0xd233('0x38')]},'json':!![],'body':_0x44051f};return rp(_0x575888);})['then'](function(_0x1af744){if(_0x1af744[_0xd233('0x39')]>=0x1){var _0x401ac5={'messageId':_0x1af744[_0xd233('0x3a')]};if(_0x51d786['smsMethod']!=='GP'||!_0x51d786[_0xd233('0x3b')]){_0x401ac5['read']=!![];}return _0x2cfc21[_0xd233('0x3c')](_0x401ac5);}else{return logger['error'](_0xd233('0x2c'),_0xd233('0x2a'),'skebby',util['inspect'](_0x1af744,{'showHidden':![],'depth':null}));}})['catch'](function(_0x3bed25){return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0xd233('0x2d'),util[_0xd233('0x2b')](_0x3bed25,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xd233('0x2c'),_0xd233('0x2a'),_0xd233('0x2d'),_0xd233('0x3d'));}break;case'connectel':if(_0x51d786[_0xd233('0x22')]){var _0x12dd5f={'recipient':_0x5d6215[_0xd233('0x25')],'message':_0x5d6215[_0xd233('0x24')],'sender':_0x51d786[_0xd233('0x3e')]||_0x51d786['phone'],'authorization':_0x51d786['authToken']};var _0x42f1b9={'method':_0xd233('0x36'),'uri':'https://smsapi.connectel.se/api/v2/send/','body':_0x12dd5f,'json':!![]};rp(_0x42f1b9)[_0xd233('0x19')](function(_0x2b27dd){var _0x4061c2={'messageId':_0x2b27dd[_0xd233('0x3f')]};if(!_0x51d786[_0xd233('0x3b')]){_0x4061c2[_0xd233('0x40')]=!![];}return _0x2cfc21[_0xd233('0x3c')](_0x4061c2);})[_0xd233('0x29')](function(_0x4135f9){logger[_0xd233('0x1c')](_0xd233('0x2c'),_0xd233('0x2a'),_0xd233('0x41'),util['inspect'](_0x4135f9,{'showHidden':![],'depth':null}));});}else{logger[_0xd233('0x1c')](_0xd233('0x2c'),_0xd233('0x2a'),_0xd233('0x41'),_0xd233('0x42'));}break;case'clicksend':if(_0x51d786['username']&&_0x51d786[_0xd233('0x32')]){var _0x12dd5f={'messages':[{'source':'xCALLY\x20Motion','to':_0x5d6215[_0xd233('0x25')],'body':_0x5d6215[_0xd233('0x24')],'from':_0x51d786[_0xd233('0x3e')]||_0x51d786[_0xd233('0x25')]}]};var _0x14405b=util[_0xd233('0x43')]('%s:%s',_0x51d786[_0xd233('0x31')],_0x51d786['password']);var _0x42f1b9={'method':_0xd233('0x36'),'uri':_0xd233('0x44'),'body':_0x12dd5f,'headers':{'Authorization':util['format'](_0xd233('0x45'),new Buffer(_0x14405b)['toString'](_0xd233('0x46')))},'json':!![]};rp(_0x42f1b9)[_0xd233('0x19')](function(_0x313196){if(_0x313196[_0xd233('0x47')]>=0xc8&&_0x313196[_0xd233('0x47')]<=0xce){if(_0x313196[_0xd233('0x48')]&&_0x313196[_0xd233('0x48')][_0xd233('0x49')]>0x0){var _0x550058=_[_0xd233('0x4a')](_0x313196[_0xd233('0x48')][_0xd233('0x4b')]);var _0x50449e={'messageId':_0x550058[_0xd233('0x4c')]};if(!_0x51d786[_0xd233('0x3b')]){_0x50449e[_0xd233('0x40')]=!![];}return _0x2cfc21[_0xd233('0x3c')](_0x50449e);}else{logger[_0xd233('0x1c')](_0xd233('0x2c'),_0xd233('0x2a'),_0xd233('0x4d'),util[_0xd233('0x2b')](_0x313196,{'showHidden':![],'depth':null}));}}else{logger[_0xd233('0x1c')](_0xd233('0x2c'),_0xd233('0x2a'),_0xd233('0x4d'),util[_0xd233('0x2b')](_0x313196,{'showHidden':![],'depth':null}));}})[_0xd233('0x29')](function(_0x2efb84){logger[_0xd233('0x1c')](_0xd233('0x2c'),_0xd233('0x2a'),_0xd233('0x4d'),util[_0xd233('0x2b')](_0x2efb84,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xd233('0x2c'),_0xd233('0x2a'),'clickSend',_0xd233('0x3d'));}break;case _0xd233('0x4e'):if(_0x51d786['authId']&&_0x51d786[_0xd233('0x22')]){var _0x12dd5f={'dst':_0x5d6215['phone'],'text':_0x5d6215[_0xd233('0x24')],'src':_0x51d786[_0xd233('0x3e')]||_0x51d786[_0xd233('0x25')],'url':_0x51d786[_0xd233('0x4f')]+_0xd233('0x26')+_0x5d6215['id']+_0xd233('0x27')+_0x51d786[_0xd233('0x50')]};var _0x14405b=util[_0xd233('0x43')]('%s:%s',_0x51d786['authId'],_0x51d786[_0xd233('0x22')]);var _0x42f1b9={'method':_0xd233('0x36'),'uri':util[_0xd233('0x43')](_0xd233('0x51'),_0x51d786[_0xd233('0x52')]),'body':_0x12dd5f,'headers':{'Authorization':util[_0xd233('0x43')]('Basic\x20%s',new Buffer(_0x14405b)[_0xd233('0x53')](_0xd233('0x46')))},'json':!![]};rp(_0x42f1b9)[_0xd233('0x19')](function(_0xa91782){var _0x17ac90={'messageId':_0xa91782[_0xd233('0x54')][0x0]};return _0x2cfc21[_0xd233('0x3c')](_0x17ac90);})[_0xd233('0x29')](function(_0x199aff){logger[_0xd233('0x1c')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xd233('0x2a'),_0xd233('0x4e'),util[_0xd233('0x2b')](_0x199aff,{'showHidden':![],'depth':null}));});}else{logger[_0xd233('0x1c')](_0xd233('0x2c'),_0xd233('0x2a'),'plivo',_0xd233('0x55'));}break;case _0xd233('0x56'):if(_0x51d786[_0xd233('0x31')]&&_0x51d786[_0xd233('0x32')]){if(_0x51d786['baseUrl']){var _0x99e0a0={'method':'POST','uri':_0x51d786[_0xd233('0x57')]+_0xd233('0x58'),'body':{'username':_0x51d786[_0xd233('0x31')],'password':_0x51d786['password']},'json':!![]};return rp(_0x99e0a0)[_0xd233('0x19')](function(_0xfc3264){var _0x291414={'method':'POST','uri':_0x51d786[_0xd233('0x57')]+_0xd233('0x59'),'body':{'messages':[{'from':_0x51d786[_0xd233('0x25')],'destinations':[{'to':_0x5d6215['phone']}],'text':_0x5d6215[_0xd233('0x24')],'notifyUrl':_0x51d786[_0xd233('0x4f')]+'/api/sms/messages/'+_0x5d6215['id']+_0xd233('0x27')+_0x51d786['token'],'notifyContentType':'application/json','callbackData':_0x51d786[_0xd233('0x25')]+';'+_0x5d6215[_0xd233('0x24')]}]},'headers':{'Authorization':'IBSSO\x20'+_0xfc3264[_0xd233('0x50')]},'json':!![]};return rp(_0x291414)['then'](function(_0x3bac2a){if(_0x3bac2a[_0xd233('0x4b')]){var _0x1fa3ab={'messageId':_0x3bac2a[_0xd233('0x4b')][0x0][_0xd233('0xd')]};if(!_0x51d786['deliveryReport']){_0x1fa3ab['read']=!![];}return _0x2cfc21[_0xd233('0x3c')](_0x1fa3ab);}else{return logger[_0xd233('0x1c')](_0xd233('0x2c'),_0xd233('0x2a'),_0xd233('0x56'),util[_0xd233('0x2b')](_0x3bac2a,{'showHidden':![],'depth':null}));}});})[_0xd233('0x29')](function(_0x3cb8cc){return logger['error'](_0xd233('0x2c'),_0xd233('0x2a'),_0xd233('0x56'),util[_0xd233('0x2b')](_0x3cb8cc,{'showHidden':![],'depth':null}));});}else{logger[_0xd233('0x1c')](_0xd233('0x2c'),_0xd233('0x2a'),_0xd233('0x56'),_0xd233('0x5a'));}}else{logger['error'](_0xd233('0x2c'),'afterCreate',_0xd233('0x56'),_0xd233('0x3d'));}break;case _0xd233('0x5b'):var _0x2d94a9=require(_0xd233('0x5c'));if(_0x51d786['apiKey']){var _0x137869={};_0x137869[_0xd233('0x5d')]=_0x51d786[_0xd233('0x31')];_0x137869[_0xd233('0x25')]=_0x5d6215[_0xd233('0x25')];_0x137869[_0xd233('0x5e')]=_0x51d786[_0xd233('0x25')];_0x137869[_0xd233('0x5f')]=_0x5d6215[_0xd233('0x24')];_0x137869[_0xd233('0x60')]=+new Date();var _0x3d6a7d='';var _0x37051e='';var _0xef9549=Object['keys'](_0x137869);_0xef9549['sort']();for(var _0x78b16e=0x0;_0x78b16e<_0xef9549[_0xd233('0x61')];_0x78b16e++){if(_0x3d6a7d!=''){_0x3d6a7d+='&';}_0x3d6a7d+=_0xef9549[_0x78b16e]+'='+encodeURIComponent(_0x137869[_0xef9549[_0x78b16e]]);_0x37051e+=_0x137869[_0xef9549[_0x78b16e]];}_0x37051e+=_0x51d786[_0xd233('0x62')];_0x37051e=_0x2d94a9['createHash'](_0xd233('0x63'))[_0xd233('0x3c')](_0x37051e)[_0xd233('0x64')](_0xd233('0x65'));if(_0x3d6a7d!==''){_0x3d6a7d+='&';}_0x3d6a7d+='signature='+_0x37051e;var _0x575888={'method':'GET','uri':_0x51d786[_0xd233('0x57')]+_0xd233('0x66')+_0x3d6a7d,'json':!![]};return rp(_0x575888)[_0xd233('0x19')](function(_0x3f4bf1){var _0x21919e=Object[_0xd233('0x67')](_0x3f4bf1);if(_0x3f4bf1[_0x21919e[0x0]]['error']&&parseInt(_0x3f4bf1[_0x21919e[0x0]]['error'])===0x0){var _0x4da887={'messageId':_0x3f4bf1[_0x21919e[0x0]][_0xd233('0x68')]};if(!_0x51d786[_0xd233('0x3b')]){_0x4da887[_0xd233('0x40')]=!![];}return _0x2cfc21['update'](_0x4da887);}else{return logger[_0xd233('0x1c')](_0xd233('0x2c'),'afterCreate',_0xd233('0x5b'),util[_0xd233('0x2b')](_0x3f4bf1['error'],{'showHidden':![],'depth':null}));}})[_0xd233('0x29')](function(_0x5a7927){return logger[_0xd233('0x1c')](_0xd233('0x2c'),_0xd233('0x2a'),_0xd233('0x5b'),util[_0xd233('0x2b')](_0x5a7927,{'showHidden':![],'depth':null}));});}else{logger[_0xd233('0x1c')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0xd233('0x5b'),_0xd233('0x69'));}break;case _0xd233('0x6a'):if(_0x51d786[_0xd233('0x62')]){var _0x24f23f={'method':'POST','uri':'https://platform.clickatell.com/messages','headers':{'Authorization':_0x51d786[_0xd233('0x62')]},'body':{'content':_0x5d6215['body'],'to':[_0x5d6215[_0xd233('0x25')]],'from':_0x51d786[_0xd233('0x25')],'binary':![],'clientMessageId':'uuid','charset':'UTF-8'},'json':!![]};rp(_0x24f23f)[_0xd233('0x19')](function(_0x26b026){if(!_0x26b026[_0xd233('0x1c')]){var _0x46b378={'messageId':_0x26b026[_0xd233('0x4b')][0x0][_0xd233('0x6b')]};if(!_0x51d786[_0xd233('0x3b')]){_0x46b378['read']=!![];}return _0x2cfc21[_0xd233('0x3c')](_0x46b378);}else{return logger[_0xd233('0x1c')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xd233('0x2a'),_0xd233('0x6a'),util[_0xd233('0x2b')](_0x26b026[_0xd233('0x1c')],{'showHidden':![],'depth':null}));}})[_0xd233('0x29')](function(_0x42cc60){return logger[_0xd233('0x1c')](_0xd233('0x2c'),'afterCreate','clickatell',util[_0xd233('0x2b')](_0x42cc60,{'showHidden':![],'depth':null}));});}else{logger[_0xd233('0x1c')](_0xd233('0x2c'),_0xd233('0x2a'),_0xd233('0x6a'),_0xd233('0x69'));}break;case _0xd233('0x6c'):if(_0x51d786[_0xd233('0x31')]&&_0x51d786[_0xd233('0x32')]){var _0x14405b=util[_0xd233('0x43')](_0xd233('0x6d'),_0x51d786[_0xd233('0x31')],_0x51d786[_0xd233('0x32')]);var _0x42f1b9={'method':'POST','uri':_0xd233('0x6e')+_0x51d786[_0xd233('0x6f')]+'/messages','body':{'to':[_0x5d6215[_0xd233('0x25')]],'text':_0x5d6215[_0xd233('0x24')],'from':_0x51d786['phone'],'applicationId':_0x51d786[_0xd233('0x70')]},'headers':{'Authorization':util[_0xd233('0x43')]('Basic\x20%s',new Buffer(_0x14405b)[_0xd233('0x53')](_0xd233('0x46')))},'json':!![]};rp(_0x42f1b9)[_0xd233('0x19')](function(_0x18597b){if(_0x18597b['id']){var _0x1cf7e9={'messageId':_0x18597b['id']};return _0x2cfc21[_0xd233('0x3c')](_0x1cf7e9);}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','bandwidth',util['inspect'](_0x18597b,{'showHidden':![],'depth':null}));}})['catch'](function(_0x9a034b){logger[_0xd233('0x1c')](_0xd233('0x2c'),_0xd233('0x2a'),'bandwidth',util[_0xd233('0x2b')](_0x9a034b,{'showHidden':![],'depth':null}));});}else{logger[_0xd233('0x1c')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xd233('0x2a'),'bandwidth','Missing\x20parameters:\x20username,\x20password');}break;case _0xd233('0x71'):if(_0x51d786[_0xd233('0x62')]){var _0x1ab393={};var _0x575888={'method':_0xd233('0x36'),'uri':'https://api.intelepeer.com/_rest/v4/app/sms/send','headers':{'Authorization':_0xd233('0x72')+_0x51d786['apiKey'],'Content-Type':_0xd233('0x73')},'body':{'from':_0x51d786[_0xd233('0x25')],'to':_0x5d6215['phone'],'text':_0x5d6215['body']},'json':!![]};return rp(_0x575888)[_0xd233('0x19')](function(_0x288c7c){if(_0x288c7c[_0xd233('0x74')]==0xca){_0x1ab393[_0xd233('0x75')]=_0x288c7c;var _0x3795d6={'method':_0xd233('0x36'),'uri':_0xd233('0x76'),'headers':{'Authorization':_0xd233('0x72')+_0x51d786[_0xd233('0x62')],'Content-Type':_0xd233('0x73')},'body':{'refid':_0x1ab393[_0xd233('0x75')][_0xd233('0x77')]},'json':!![]};return rp(_0x3795d6)[_0xd233('0x19')](function(_0x2c9f8e){_0x1ab393['status']=_0x2c9f8e;var _0x4ba7ef={'messageId':_0x1ab393[_0xd233('0x75')]['refid'],'read':!![]};return _0x2cfc21[_0xd233('0x3c')](_0x4ba7ef);});}else{return logger[_0xd233('0x1c')](_0xd233('0x2c'),'afterCreate','intelepeer',util[_0xd233('0x2b')](_0x288c7c,{'showHidden':![],'depth':null}));}})['catch'](function(_0x402bbe){return logger[_0xd233('0x1c')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xd233('0x2a'),'intelepeer',util[_0xd233('0x2b')](_0x402bbe,{'showHidden':![],'depth':null}));});}else{return logger[_0xd233('0x1c')](_0xd233('0x2c'),_0xd233('0x2a'),_0xd233('0x71'),'Token\x20not\x20received');}break;}}})[_0xd233('0x78')](function(){_0x332459();});}else{_0x332459();}}},'charset':_0xd233('0x79'),'collate':_0xd233('0x7a')});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.rpc.js b/server/api/smsMessage/smsMessage.rpc.js index ea2ba2a..7adbb0b 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 _0x940f=['request\x20sent','debug','error','code','SmsMessage,\x20%s,\x20%s','message','info','result','catch','CreateSmsMessage','SmsMessage','body','options','raw','util','moment','randomstring','ioredis','../../config/logger','client','http','redis','defaults','localhost','register','request','then'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x940f,0x7a));var _0xf940=function(_0x141e04,_0x26e5a8){_0x141e04=_0x141e04-0x0;var _0x315fb8=_0x940f[_0x141e04];return _0x315fb8;};'use strict';var _=require('lodash');var util=require(_0xf940('0x0'));var moment=require(_0xf940('0x1'));var BPromise=require('bluebird');var rs=require(_0xf940('0x2'));var fs=require('fs');var Redis=require(_0xf940('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xf940('0x4'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xf940('0x5')][_0xf940('0x6')]({'port':0x232a});config[_0xf940('0x7')]=_[_0xf940('0x8')](config['redis'],{'host':_0xf940('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./smsMessage.socket')[_0xf940('0xa')](socket);function respondWithRpcPromise(_0x593972,_0x16983e,_0x2caf8b){return new BPromise(function(_0x2ea2c4,_0x1c19bc){return client[_0xf940('0xb')](_0x593972,_0x2caf8b)[_0xf940('0xc')](function(_0x26aa22){logger['info']('SmsMessage,\x20%s,\x20%s',_0x16983e,_0xf940('0xd'));logger[_0xf940('0xe')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x16983e,_0xf940('0xd'),JSON['stringify'](_0x26aa22));if(_0x26aa22[_0xf940('0xf')]){if(_0x26aa22[_0xf940('0xf')][_0xf940('0x10')]===0x1f4){logger[_0xf940('0xf')](_0xf940('0x11'),_0x16983e,_0x26aa22[_0xf940('0xf')][_0xf940('0x12')]);return _0x1c19bc(_0x26aa22[_0xf940('0xf')][_0xf940('0x12')]);}logger[_0xf940('0xf')](_0xf940('0x11'),_0x16983e,_0x26aa22['error'][_0xf940('0x12')]);return _0x2ea2c4(_0x26aa22['error']['message']);}else{logger[_0xf940('0x13')](_0xf940('0x11'),_0x16983e,_0xf940('0xd'));_0x2ea2c4(_0x26aa22[_0xf940('0x14')][_0xf940('0x12')]);}})[_0xf940('0x15')](function(_0x23326a){logger[_0xf940('0xf')](_0xf940('0x11'),_0x16983e,_0x23326a);_0x1c19bc(_0x23326a);});});}exports[_0xf940('0x16')]=function(_0x10f73e){var _0x5912b7=this;return new Promise(function(_0x128049,_0x42067f){return db[_0xf940('0x17')]['create'](_0x10f73e[_0xf940('0x18')],{'raw':_0x10f73e[_0xf940('0x19')]?_0x10f73e[_0xf940('0x19')][_0xf940('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x2ce4fe){logger[_0xf940('0x13')]('CreateSmsMessage',_0x10f73e);logger[_0xf940('0xe')](_0xf940('0x16'),_0x10f73e,JSON['stringify'](_0x2ce4fe));_0x128049(_0x2ce4fe);})[_0xf940('0x15')](function(_0x22ef75){logger[_0xf940('0xf')](_0xf940('0x16'),_0x22ef75[_0xf940('0x12')],_0x10f73e);_0x42067f(_0x5912b7[_0xf940('0xf')](0x1f4,_0x22ef75['message']));});});}; \ No newline at end of file +var _0x98ed=['body','options','raw','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','defaults','redis','localhost','./smsMessage.socket','then','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','SmsMessage,\x20%s,\x20%s','message','info','result','catch','CreateSmsMessage','SmsMessage'];(function(_0x3a0a99,_0x56f866){var _0x532554=function(_0x52fdae){while(--_0x52fdae){_0x3a0a99['push'](_0x3a0a99['shift']());}};_0x532554(++_0x56f866);}(_0x98ed,0x12c));var _0xd98e=function(_0x3e5bc8,_0x457d89){_0x3e5bc8=_0x3e5bc8-0x0;var _0xfd84bc=_0x98ed[_0x3e5bc8];return _0xfd84bc;};'use strict';var _=require('lodash');var util=require(_0xd98e('0x0'));var moment=require(_0xd98e('0x1'));var BPromise=require(_0xd98e('0x2'));var rs=require(_0xd98e('0x3'));var fs=require('fs');var Redis=require(_0xd98e('0x4'));var db=require(_0xd98e('0x5'))['db'];var utils=require(_0xd98e('0x6'));var logger=require(_0xd98e('0x7'))(_0xd98e('0x8'));var config=require('../../config/environment');var jayson=require(_0xd98e('0x9'));var client=jayson[_0xd98e('0xa')][_0xd98e('0xb')]({'port':0x232a});config['redis']=_[_0xd98e('0xc')](config[_0xd98e('0xd')],{'host':_0xd98e('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xd98e('0xf'))['register'](socket);function respondWithRpcPromise(_0x111707,_0x11607d,_0x410cef){return new BPromise(function(_0x56f186,_0x5686e5){return client['request'](_0x111707,_0x410cef)[_0xd98e('0x10')](function(_0x573bb5){logger['info']('SmsMessage,\x20%s,\x20%s',_0x11607d,_0xd98e('0x11'));logger[_0xd98e('0x12')](_0xd98e('0x13'),_0x11607d,_0xd98e('0x11'),JSON[_0xd98e('0x14')](_0x573bb5));if(_0x573bb5[_0xd98e('0x15')]){if(_0x573bb5[_0xd98e('0x15')][_0xd98e('0x16')]===0x1f4){logger['error'](_0xd98e('0x17'),_0x11607d,_0x573bb5[_0xd98e('0x15')][_0xd98e('0x18')]);return _0x5686e5(_0x573bb5['error'][_0xd98e('0x18')]);}logger[_0xd98e('0x15')]('SmsMessage,\x20%s,\x20%s',_0x11607d,_0x573bb5['error'][_0xd98e('0x18')]);return _0x56f186(_0x573bb5[_0xd98e('0x15')][_0xd98e('0x18')]);}else{logger[_0xd98e('0x19')]('SmsMessage,\x20%s,\x20%s',_0x11607d,'request\x20sent');_0x56f186(_0x573bb5[_0xd98e('0x1a')][_0xd98e('0x18')]);}})[_0xd98e('0x1b')](function(_0x14933b){logger[_0xd98e('0x15')](_0xd98e('0x17'),_0x11607d,_0x14933b);_0x5686e5(_0x14933b);});});}exports[_0xd98e('0x1c')]=function(_0x3aee46){var _0x46d78d=this;return new Promise(function(_0x1ad1d4,_0x3d931b){return db[_0xd98e('0x1d')]['create'](_0x3aee46[_0xd98e('0x1e')],{'raw':_0x3aee46[_0xd98e('0x1f')]?_0x3aee46['options'][_0xd98e('0x20')]===undefined?!![]:![]:!![]})[_0xd98e('0x10')](function(_0x35803a){logger[_0xd98e('0x19')](_0xd98e('0x1c'),_0x3aee46);logger[_0xd98e('0x12')](_0xd98e('0x1c'),_0x3aee46,JSON[_0xd98e('0x14')](_0x35803a));_0x1ad1d4(_0x35803a);})['catch'](function(_0x179aa7){logger['error'](_0xd98e('0x1c'),_0x179aa7['message'],_0x3aee46);_0x3d931b(_0x46d78d[_0xd98e('0x15')](0x1f4,_0x179aa7['message']));});});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.socket.js b/server/api/smsMessage/smsMessage.socket.js index 0fadc41..88f274a 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 _0x93d3=['emit','removeListener','register','length','remove','update'];(function(_0x55d923,_0x26ca2b){var _0x2b4308=function(_0x1aead1){while(--_0x1aead1){_0x55d923['push'](_0x55d923['shift']());}};_0x2b4308(++_0x26ca2b);}(_0x93d3,0x11e));var _0x393d=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0x93d3[_0x8c43de];return _0xa6591b;};'use strict';var SmsMessageEvents=require('./smsMessage.events');var events=['save',_0x393d('0x0'),_0x393d('0x1')];function createListener(_0x66f4a7,_0xc40a3e){return function(_0x1746b6){_0xc40a3e[_0x393d('0x2')](_0x66f4a7,_0x1746b6);};}function removeListener(_0x4c7af7,_0x1895ca){return function(){SmsMessageEvents[_0x393d('0x3')](_0x4c7af7,_0x1895ca);};}exports[_0x393d('0x4')]=function(_0x41c911){for(var _0x1bd216=0x0,_0x6a0a18=events[_0x393d('0x5')];_0x1bd216<_0x6a0a18;_0x1bd216++){var _0x104b27=events[_0x1bd216];var _0x20610e=createListener('smsMessage:'+_0x104b27,_0x41c911);SmsMessageEvents['on'](_0x104b27,_0x20610e);}}; \ No newline at end of file +var _0x3f9f=['register','length','smsMessage:','./smsMessage.events','save','update','emit'];(function(_0x4f5aa2,_0x23dff9){var _0x112763=function(_0x58e217){while(--_0x58e217){_0x4f5aa2['push'](_0x4f5aa2['shift']());}};_0x112763(++_0x23dff9);}(_0x3f9f,0x184));var _0xf3f9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3f9f[_0x3dd15e];return _0x231fd0;};'use strict';var SmsMessageEvents=require(_0xf3f9('0x0'));var events=[_0xf3f9('0x1'),'remove',_0xf3f9('0x2')];function createListener(_0x2b1f49,_0x1cd593){return function(_0x2280cf){_0x1cd593[_0xf3f9('0x3')](_0x2b1f49,_0x2280cf);};}function removeListener(_0x20c600,_0x43852f){return function(){SmsMessageEvents['removeListener'](_0x20c600,_0x43852f);};}exports[_0xf3f9('0x4')]=function(_0x67ddd5){for(var _0x50ecc2=0x0,_0x2a8a47=events[_0xf3f9('0x5')];_0x50ecc2<_0x2a8a47;_0x50ecc2++){var _0x3a1e1f=events[_0x50ecc2];var _0x5a1620=createListener(_0xf3f9('0x6')+_0x3a1e1f,_0x67ddd5);SmsMessageEvents['on'](_0x3a1e1f,_0x5a1620);}}; \ No newline at end of file diff --git a/server/api/smsQueue/index.js b/server/api/smsQueue/index.js index 827b86b..391c7f5 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 _0x85dd=['./smsQueue.controller','get','isAuthenticated','index','/describe','describe','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','addTeams','put','update','destroy','removeTeams','delete','removeAgents','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x85dd,0x180));var _0xd85d=function(_0x2bf141,_0x31eac7){_0x2bf141=_0x2bf141-0x0;var _0x48277b=_0x85dd[_0x2bf141];return _0x48277b;};'use strict';var multer=require(_0xd85d('0x0'));var util=require(_0xd85d('0x1'));var path=require(_0xd85d('0x2'));var timeout=require('connect-timeout');var express=require(_0xd85d('0x3'));var router=express[_0xd85d('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xd85d('0x5'));var interaction=require(_0xd85d('0x6'));var config=require(_0xd85d('0x7'));var controller=require(_0xd85d('0x8'));router[_0xd85d('0x9')]('/',auth[_0xd85d('0xa')](),controller[_0xd85d('0xb')]);router[_0xd85d('0x9')](_0xd85d('0xc'),auth[_0xd85d('0xa')](),controller[_0xd85d('0xd')]);router['get']('/:id',auth[_0xd85d('0xa')](),controller['show']);router[_0xd85d('0x9')](_0xd85d('0xe'),auth[_0xd85d('0xa')](),controller[_0xd85d('0xf')]);router[_0xd85d('0x9')](_0xd85d('0x10'),auth[_0xd85d('0xa')](),controller[_0xd85d('0x11')]);router[_0xd85d('0x9')](_0xd85d('0x12'),auth[_0xd85d('0xa')](),controller[_0xd85d('0x13')]);router[_0xd85d('0x14')]('/',auth[_0xd85d('0xa')](),controller['create']);router[_0xd85d('0x14')](_0xd85d('0x10'),auth[_0xd85d('0xa')](),controller[_0xd85d('0x15')]);router[_0xd85d('0x14')](_0xd85d('0x12'),auth['isAuthenticated'](),controller['addAgents']);router[_0xd85d('0x16')]('/:id',auth[_0xd85d('0xa')](),controller[_0xd85d('0x17')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xd85d('0x18')]);router['delete'](_0xd85d('0x10'),auth['isAuthenticated'](),controller[_0xd85d('0x19')]);router[_0xd85d('0x1a')]('/:id/users',auth[_0xd85d('0xa')](),controller[_0xd85d('0x1b')]);module['exports']=router; \ No newline at end of file +var _0xbfaf=['../../components/interaction/service','../../config/environment','./smsQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','getMembers','/:id/teams','/:id/users','getAgents','post','create','addTeams','addAgents','put','delete','removeTeams','exports','multer','path','express','Router','../../components/auth/service'];(function(_0x15f603,_0x19466a){var _0x26fd2e=function(_0x57f840){while(--_0x57f840){_0x15f603['push'](_0x15f603['shift']());}};_0x26fd2e(++_0x19466a);}(_0xbfaf,0xcb));var _0xfbfa=function(_0x44bcb0,_0x235aa9){_0x44bcb0=_0x44bcb0-0x0;var _0xfaf881=_0xbfaf[_0x44bcb0];return _0xfaf881;};'use strict';var multer=require(_0xfbfa('0x0'));var util=require('util');var path=require(_0xfbfa('0x1'));var timeout=require('connect-timeout');var express=require(_0xfbfa('0x2'));var router=express[_0xfbfa('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xfbfa('0x4'));var interaction=require(_0xfbfa('0x5'));var config=require(_0xfbfa('0x6'));var controller=require(_0xfbfa('0x7'));router[_0xfbfa('0x8')]('/',auth[_0xfbfa('0x9')](),controller[_0xfbfa('0xa')]);router[_0xfbfa('0x8')](_0xfbfa('0xb'),auth['isAuthenticated'](),controller[_0xfbfa('0xc')]);router['get'](_0xfbfa('0xd'),auth['isAuthenticated'](),controller['show']);router['get']('/:id/members',auth['isAuthenticated'](),controller[_0xfbfa('0xe')]);router['get'](_0xfbfa('0xf'),auth[_0xfbfa('0x9')](),controller['getTeams']);router[_0xfbfa('0x8')](_0xfbfa('0x10'),auth[_0xfbfa('0x9')](),controller[_0xfbfa('0x11')]);router[_0xfbfa('0x12')]('/',auth['isAuthenticated'](),controller[_0xfbfa('0x13')]);router[_0xfbfa('0x12')](_0xfbfa('0xf'),auth[_0xfbfa('0x9')](),controller[_0xfbfa('0x14')]);router[_0xfbfa('0x12')](_0xfbfa('0x10'),auth[_0xfbfa('0x9')](),controller[_0xfbfa('0x15')]);router[_0xfbfa('0x16')](_0xfbfa('0xd'),auth[_0xfbfa('0x9')](),controller['update']);router[_0xfbfa('0x17')](_0xfbfa('0xd'),auth[_0xfbfa('0x9')](),controller['destroy']);router[_0xfbfa('0x17')]('/:id/teams',auth[_0xfbfa('0x9')](),controller[_0xfbfa('0x18')]);router[_0xfbfa('0x17')]('/:id/users',auth[_0xfbfa('0x9')](),controller['removeAgents']);module[_0xfbfa('0x19')]=router; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.attributes.js b/server/api/smsQueue/smsQueue.attributes.js index 7f94cac..4057147 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 _0x992e=['beepall','roundrobin','exports','STRING','name','ENUM','rrmemory'];(function(_0x469e5b,_0x1f3592){var _0x4d5963=function(_0x1c24b5){while(--_0x1c24b5){_0x469e5b['push'](_0x469e5b['shift']());}};_0x4d5963(++_0x1f3592);}(_0x992e,0x12f));var _0xe992=function(_0x5e709a,_0x1d7975){_0x5e709a=_0x5e709a-0x0;var _0x57401a=_0x992e[_0x5e709a];return _0x57401a;};'use strict';var Sequelize=require('sequelize');module[_0xe992('0x0')]={'name':{'type':Sequelize[_0xe992('0x1')],'unique':_0xe992('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xe992('0x1')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xe992('0x3')](_0xe992('0x4'),_0xe992('0x5'),_0xe992('0x6'))}}; \ No newline at end of file +var _0xaee6=['STRING','name','rrmemory','beepall','roundrobin'];(function(_0x289c08,_0x4ab5fc){var _0x54c5c8=function(_0x324663){while(--_0x324663){_0x289c08['push'](_0x289c08['shift']());}};_0x54c5c8(++_0x4ab5fc);}(_0xaee6,0x13b));var _0x6aee=function(_0x37391d,_0x2c737b){_0x37391d=_0x37391d-0x0;var _0x19e1b8=_0xaee6[_0x37391d];return _0x19e1b8;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x6aee('0x0')],'unique':_0x6aee('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x6aee('0x0')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x6aee('0x2'),_0x6aee('0x3'),_0x6aee('0x4'))}}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.controller.js b/server/api/smsQueue/smsQueue.controller.js index 4c4b9b1..f6f822a 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 _0x5f66=['show','params','model','keys','intersection','attributes','fields','includeAll','merge','options','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','SmsQueues','find','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','rawAttributes','filters','hasOwnProperty','order','sort','pick','map','UserSmsQueue','User','findAndCountAll','UserId','agent','smsPause','updatedAt','createdAt','%s/%s','SIP','getTeams','length','filter','nolimit','ids','Team','Agents','interface','flatMap','sequelize','transaction','addTeams','forEach','emit','userSmsQueue:save','removeTeams','select','tq.TeamId','team_has_sms_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','includes','all','compact','value','isEmpty','removeAgents','userSmsQueue:remove','addAgents','spread','isArray','findOne','getAgents','util','squel','ioredis','../../components/parsers/qs','../../config/logger','api','../../mysqldb','defaults','redis','./smsQueue.socket','register','end','json','offset','limit','undefined','count','status','update','then','UserProfileResource','destroy','sendStatus','stack','name','send','index','fieldName','key','getOptions','where','SmsQueue','include','query','findAll','catch'];(function(_0x540c49,_0x3e88d9){var _0x390f69=function(_0x4cdf60){while(--_0x4cdf60){_0x540c49['push'](_0x540c49['shift']());}};_0x390f69(++_0x3e88d9);}(_0x5f66,0x1a0));var _0x65f6=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x5f66[_0x21a9d9];return _0x46adce;};'use strict';var BPromise=require('bluebird');var util=require(_0x65f6('0x0'));var _=require('lodash');var squel=require(_0x65f6('0x1'));var Redis=require(_0x65f6('0x2'));var qs=require(_0x65f6('0x3'));var logger=require(_0x65f6('0x4'))(_0x65f6('0x5'));var config=require('../../config/environment');var db=require(_0x65f6('0x6'))['db'];config['redis']=_[_0x65f6('0x7')](config[_0x65f6('0x8')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x65f6('0x8')]));require(_0x65f6('0x9'))[_0x65f6('0xa')](socket);function respondWithStatusCode(_0x8f6451,_0xc44c70){_0xc44c70=_0xc44c70||0xcc;return function(_0x14f4c7){if(_0x14f4c7){return _0x8f6451['sendStatus'](_0xc44c70);}return _0x8f6451['status'](_0xc44c70)[_0x65f6('0xb')]();};}function respondWithResult(_0x2f6d5b,_0x264647){_0x264647=_0x264647||0xc8;return function(_0x25c416){if(_0x25c416){return _0x2f6d5b['status'](_0x264647)[_0x65f6('0xc')](_0x25c416);}};}function respondWithFilteredResult(_0x571436,_0x497cf3){return function(_0x2d2dfa){if(_0x2d2dfa){var _0x576875=typeof _0x497cf3[_0x65f6('0xd')]==='undefined'&&typeof _0x497cf3[_0x65f6('0xe')]===_0x65f6('0xf');var _0x2c4ee5=_0x2d2dfa[_0x65f6('0x10')];var _0x369f96=_0x576875?0x0:_0x497cf3[_0x65f6('0xd')];var _0x44144b=_0x576875?_0x2d2dfa[_0x65f6('0x10')]:_0x497cf3[_0x65f6('0xd')]+_0x497cf3[_0x65f6('0xe')];var _0x59154e;if(_0x44144b>=_0x2c4ee5){_0x44144b=_0x2c4ee5;_0x59154e=0xc8;}else{_0x59154e=0xce;}_0x571436[_0x65f6('0x11')](_0x59154e);return _0x571436['set']('Content-Range',_0x369f96+'-'+_0x44144b+'/'+_0x2c4ee5)[_0x65f6('0xc')](_0x2d2dfa);}return null;};}function saveUpdates(_0x5c69f8){return function(_0x37330d){if(_0x37330d){return _0x37330d[_0x65f6('0x12')](_0x5c69f8)[_0x65f6('0x13')](function(_0x1f974c){return _0x1f974c;});}return null;};}function removeEntity(_0xc8660c){return function(_0x18380e){if(_0x18380e){return _0x18380e['destroy']()['then'](function(){var _0x2d538c=_0x18380e['get']({'plain':!![]});var _0x4c81f3='SmsQueues';return db[_0x65f6('0x14')][_0x65f6('0x15')]({'where':{'type':_0x4c81f3,'resourceId':_0x2d538c['id']}})['then'](function(){return _0x18380e;});})[_0x65f6('0x13')](function(){_0xc8660c[_0x65f6('0x11')](0xcc)[_0x65f6('0xb')]();});}};}function handleEntityNotFound(_0x3876ed){return function(_0x219ab2){if(!_0x219ab2){_0x3876ed[_0x65f6('0x16')](0x194);}return _0x219ab2;};}function handleError(_0x581374,_0x197a49){_0x197a49=_0x197a49||0x1f4;return function(_0x4bb39e){logger['error'](_0x4bb39e[_0x65f6('0x17')]);if(_0x4bb39e[_0x65f6('0x18')]){delete _0x4bb39e['name'];}_0x581374[_0x65f6('0x11')](_0x197a49)[_0x65f6('0x19')](_0x4bb39e);};}exports[_0x65f6('0x1a')]=function(_0x2774a1,_0x4f5a69){var _0x9d7bb0={};var _0x59ea32={'count':0x0,'rows':[]};var _0x20a161=_['map'](db['SmsQueue']['rawAttributes'],function(_0x29abdb){return{'name':_0x29abdb[_0x65f6('0x1b')],'type':_0x29abdb['type'][_0x65f6('0x1c')]};});_0x9d7bb0=qs[_0x65f6('0x1d')](_0x20a161,_0x2774a1);var _0x52277c={'where':_0x9d7bb0[_0x65f6('0x1e')]};return db[_0x65f6('0x1f')][_0x65f6('0x10')](_0x52277c)['then'](function(_0x4ac04b){_0x59ea32['count']=_0x4ac04b;_0x9d7bb0[_0x65f6('0x20')]=qs[_0x65f6('0x20')](_0x2774a1[_0x65f6('0x21')]);return db[_0x65f6('0x1f')][_0x65f6('0x22')](_0x9d7bb0);})[_0x65f6('0x13')](function(_0x144e55){_0x59ea32['rows']=_0x144e55;return _0x59ea32;})['then'](respondWithFilteredResult(_0x4f5a69,_0x9d7bb0))[_0x65f6('0x23')](handleError(_0x4f5a69,null));};exports[_0x65f6('0x24')]=function(_0x5878bc,_0x4e50c0){var _0x10b368={'raw':!![],'where':{'id':_0x5878bc[_0x65f6('0x25')]['id']}},_0x1ce43c={};_0x1ce43c[_0x65f6('0x26')]=_[_0x65f6('0x27')](db[_0x65f6('0x1f')]['rawAttributes']);_0x1ce43c[_0x65f6('0x21')]=_[_0x65f6('0x27')](_0x5878bc[_0x65f6('0x21')]);_0x1ce43c['filters']=_[_0x65f6('0x28')](_0x1ce43c[_0x65f6('0x26')],_0x1ce43c[_0x65f6('0x21')]);_0x10b368[_0x65f6('0x29')]=_[_0x65f6('0x28')](_0x1ce43c[_0x65f6('0x26')],qs['fields'](_0x5878bc[_0x65f6('0x21')][_0x65f6('0x2a')]));_0x10b368['attributes']=_0x10b368[_0x65f6('0x29')]['length']?_0x10b368[_0x65f6('0x29')]:_0x1ce43c['model'];if(_0x5878bc[_0x65f6('0x21')][_0x65f6('0x2b')]){_0x10b368['include']=[{'all':!![]}];}_0x10b368=_[_0x65f6('0x2c')]({},_0x10b368,_0x5878bc[_0x65f6('0x2d')]);return db[_0x65f6('0x1f')]['find'](_0x10b368)['then'](handleEntityNotFound(_0x4e50c0,null))[_0x65f6('0x13')](respondWithResult(_0x4e50c0,null))['catch'](handleError(_0x4e50c0,null));};exports[_0x65f6('0x2e')]=function(_0x4e6653,_0x22d760){return db[_0x65f6('0x1f')]['create'](_0x4e6653[_0x65f6('0x2f')],{})['then'](function(_0x5edd04){var _0x71b16b=_0x4e6653[_0x65f6('0x30')][_0x65f6('0x31')]({'plain':!![]});if(!_0x71b16b)throw new Error(_0x65f6('0x32'));if(_0x71b16b[_0x65f6('0x33')]===_0x65f6('0x30')){var _0x1a55da=_0x5edd04[_0x65f6('0x31')]({'plain':!![]});var _0x4f933b=_0x65f6('0x34');return db['UserProfileSection'][_0x65f6('0x35')]({'where':{'name':_0x4f933b,'userProfileId':_0x71b16b[_0x65f6('0x36')]},'raw':!![]})[_0x65f6('0x13')](function(_0x2ea7f7){if(_0x2ea7f7&&_0x2ea7f7['autoAssociation']===0x0){return db[_0x65f6('0x14')][_0x65f6('0x2e')]({'name':_0x1a55da[_0x65f6('0x18')],'resourceId':_0x1a55da['id'],'type':_0x2ea7f7[_0x65f6('0x18')],'sectionId':_0x2ea7f7['id']},{})[_0x65f6('0x13')](function(){return _0x5edd04;});}else{return _0x5edd04;}})[_0x65f6('0x23')](function(_0xed4c96){logger[_0x65f6('0x37')](_0x65f6('0x38'),_0xed4c96);throw _0xed4c96;});}return _0x5edd04;})['then'](respondWithResult(_0x22d760,0xc9))[_0x65f6('0x23')](handleError(_0x22d760,null));};exports[_0x65f6('0x12')]=function(_0x377ae5,_0x181798){if(_0x377ae5[_0x65f6('0x2f')]['id']){delete _0x377ae5[_0x65f6('0x2f')]['id'];}return db[_0x65f6('0x1f')][_0x65f6('0x35')]({'where':{'id':_0x377ae5[_0x65f6('0x25')]['id']}})[_0x65f6('0x13')](handleEntityNotFound(_0x181798,null))[_0x65f6('0x13')](saveUpdates(_0x377ae5[_0x65f6('0x2f')],null))[_0x65f6('0x13')](respondWithResult(_0x181798,null))[_0x65f6('0x23')](handleError(_0x181798,null));};exports[_0x65f6('0x15')]=function(_0x2cb38d,_0x5119ee){return db[_0x65f6('0x1f')][_0x65f6('0x35')]({'where':{'id':_0x2cb38d[_0x65f6('0x25')]['id']}})[_0x65f6('0x13')](handleEntityNotFound(_0x5119ee,null))['then'](removeEntity(_0x5119ee,null))[_0x65f6('0x23')](handleError(_0x5119ee,null));};exports[_0x65f6('0x39')]=function(_0x2b01eb,_0x5e69b4){return db[_0x65f6('0x1f')][_0x65f6('0x39')]()[_0x65f6('0x13')](respondWithResult(_0x5e69b4,null))[_0x65f6('0x23')](handleError(_0x5e69b4,null));};exports['getMembers']=function(_0x2ec114,_0x512527){var _0x3f1baa={'raw':!![],'where':{}},_0x6968b={},_0x577c93;return db[_0x65f6('0x1f')]['findOne']({'where':{'id':_0x2ec114[_0x65f6('0x25')]['id']}})[_0x65f6('0x13')](handleEntityNotFound(_0x512527,null))[_0x65f6('0x13')](function(_0xc0db01){if(_0xc0db01){_0x577c93=_0xc0db01[_0x65f6('0x31')]({'plain':!![]});_0x6968b[_0x65f6('0x26')]=_['keys'](db['UserSmsQueue'][_0x65f6('0x3a')]);_0x6968b[_0x65f6('0x21')]=_[_0x65f6('0x27')](_0x2ec114[_0x65f6('0x21')]);_0x6968b[_0x65f6('0x3b')]=_[_0x65f6('0x28')](_0x6968b[_0x65f6('0x26')],_0x6968b[_0x65f6('0x21')]);_0x3f1baa[_0x65f6('0x29')]=_['intersection'](_0x6968b[_0x65f6('0x26')],qs[_0x65f6('0x2a')](_0x2ec114[_0x65f6('0x21')]['fields']));_0x3f1baa[_0x65f6('0x29')]=_0x3f1baa[_0x65f6('0x29')]['length']?_0x3f1baa[_0x65f6('0x29')]:_0x6968b[_0x65f6('0x26')];if(!_0x2ec114['query'][_0x65f6('0x3c')]('nolimit')){_0x3f1baa[_0x65f6('0xe')]=qs[_0x65f6('0xe')](_0x2ec114[_0x65f6('0x21')]['limit']);_0x3f1baa[_0x65f6('0xd')]=qs[_0x65f6('0xd')](_0x2ec114['query'][_0x65f6('0xd')]);}_0x3f1baa[_0x65f6('0x3d')]=qs['sort'](_0x2ec114[_0x65f6('0x21')][_0x65f6('0x3e')]);_0x3f1baa[_0x65f6('0x1e')]=qs[_0x65f6('0x3b')](_[_0x65f6('0x3f')](_0x2ec114[_0x65f6('0x21')],_0x6968b[_0x65f6('0x3b')]));_0x3f1baa[_0x65f6('0x1e')]['SmsQueueId']=_0xc0db01['id'];if(_0x2ec114['query']['filter']){_0x3f1baa[_0x65f6('0x1e')]=_[_0x65f6('0x2c')](_0x3f1baa[_0x65f6('0x1e')],{'$or':_[_0x65f6('0x40')](_0x3f1baa['attributes'],function(_0x183c08){var _0x2032b9={};_0x2032b9[_0x183c08]={'$like':'%'+_0x2ec114[_0x65f6('0x21')]['filter']+'%'};return _0x2032b9;})});}_0x3f1baa=_[_0x65f6('0x2c')]({},_0x3f1baa,_0x2ec114[_0x65f6('0x2d')]);return db[_0x65f6('0x41')]['findAll'](_0x3f1baa);}})['then'](function(_0x1d337d){if(_0x1d337d){return db[_0x65f6('0x42')][_0x65f6('0x43')]({'where':{'id':_[_0x65f6('0x40')](_0x1d337d,_0x65f6('0x44')),'role':_0x65f6('0x45')},'attributes':['id',_0x65f6('0x18'),_0x65f6('0x46'),_0x65f6('0x47'),_0x65f6('0x48')]});}})[_0x65f6('0x13')](function(_0x141fcc){if(_0x141fcc){return{'count':_0x141fcc[_0x65f6('0x10')],'rows':_[_0x65f6('0x40')](_0x141fcc['rows'],function(_0x47610a){return{'membername':_0x47610a[_0x65f6('0x18')],'UserId':_0x47610a['id'],'queue_name':_0x577c93[_0x65f6('0x18')],'SmsQueueId':_0x577c93['id'],'interface':util['format'](_0x65f6('0x49'),_0x65f6('0x4a'),_0x47610a[_0x65f6('0x18')]),'penalty':0x0,'paused':_0x47610a[_0x65f6('0x46')],'createdAt':_0x47610a['createdAt'],'updatedAt':_0x47610a[_0x65f6('0x47')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x65f6('0x13')](respondWithFilteredResult(_0x512527,_0x3f1baa))[_0x65f6('0x23')](handleError(_0x512527,null));};exports[_0x65f6('0x4b')]=function(_0x553ff0,_0x2923ff){var _0x2fc20f={};var _0x5c55e4={};var _0x28682b;var _0x26481e;return db[_0x65f6('0x1f')]['findOne']({'where':{'id':_0x553ff0[_0x65f6('0x25')]['id']}})[_0x65f6('0x13')](handleEntityNotFound(_0x2923ff,null))[_0x65f6('0x13')](function(_0x3c23e3){if(_0x3c23e3){_0x28682b=_0x3c23e3;_0x5c55e4[_0x65f6('0x26')]=_[_0x65f6('0x27')](db['Team']['rawAttributes']);_0x5c55e4['query']=_[_0x65f6('0x27')](_0x553ff0[_0x65f6('0x21')]);_0x5c55e4[_0x65f6('0x3b')]=_[_0x65f6('0x28')](_0x5c55e4[_0x65f6('0x26')],_0x5c55e4[_0x65f6('0x21')]);_0x2fc20f['attributes']=_[_0x65f6('0x28')](_0x5c55e4[_0x65f6('0x26')],qs['fields'](_0x553ff0[_0x65f6('0x21')][_0x65f6('0x2a')]));_0x2fc20f[_0x65f6('0x29')]=_0x2fc20f['attributes'][_0x65f6('0x4c')]?_0x2fc20f[_0x65f6('0x29')]:_0x5c55e4['model'];_0x2fc20f[_0x65f6('0x3d')]=qs[_0x65f6('0x3e')](_0x553ff0[_0x65f6('0x21')][_0x65f6('0x3e')]);_0x2fc20f[_0x65f6('0x1e')]=qs[_0x65f6('0x3b')](_[_0x65f6('0x3f')](_0x553ff0['query'],_0x5c55e4['filters']));if(_0x553ff0[_0x65f6('0x21')][_0x65f6('0x4d')]){_0x2fc20f['where']=_[_0x65f6('0x2c')](_0x2fc20f['where'],{'$or':_[_0x65f6('0x40')](_0x2fc20f['attributes'],function(_0x440df1){var _0xdc8989={};_0xdc8989[_0x440df1]={'$like':'%'+_0x553ff0[_0x65f6('0x21')][_0x65f6('0x4d')]+'%'};return _0xdc8989;})});}_0x2fc20f=_[_0x65f6('0x2c')]({},_0x2fc20f,_0x553ff0[_0x65f6('0x2d')]);return _0x28682b[_0x65f6('0x4b')](_0x2fc20f);}})[_0x65f6('0x13')](function(_0x2405a7){if(_0x2405a7){_0x26481e=_0x2405a7['length'];if(!_0x553ff0['query'][_0x65f6('0x3c')](_0x65f6('0x4e'))){_0x2fc20f[_0x65f6('0xe')]=qs['limit'](_0x553ff0['query'][_0x65f6('0xe')]);_0x2fc20f[_0x65f6('0xd')]=qs[_0x65f6('0xd')](_0x553ff0[_0x65f6('0x21')][_0x65f6('0xd')]);}return _0x28682b[_0x65f6('0x4b')](_0x2fc20f);}})['then'](function(_0x4f42ae){if(_0x4f42ae){return _0x4f42ae?{'count':_0x26481e,'rows':_0x4f42ae}:null;}})[_0x65f6('0x13')](respondWithResult(_0x2923ff,null))[_0x65f6('0x23')](handleError(_0x2923ff,null));};exports['addTeams']=function(_0x219bf8,_0x4a8b60){var _0x254e9f=_0x219bf8[_0x65f6('0x2f')][_0x65f6('0x4f')];return db[_0x65f6('0x50')]['findAll']({'where':{'id':_0x254e9f},'attributes':['id'],'include':[{'model':db[_0x65f6('0x42')],'as':_0x65f6('0x51'),'attributes':['id',_0x65f6('0x18'),'online','voicePause',_0x65f6('0x52')],'raw':!![]}]})['then'](function(_0x305967){if(_0x305967){var _0xf6de=_[_0x65f6('0x53')](_0x305967,function(_0x354b90){var _0x512776=_0x354b90['get']({'plain':!![]});return _0x512776['Agents'];});return db[_0x65f6('0x1f')][_0x65f6('0x35')]({'where':{'id':_0x219bf8[_0x65f6('0x25')]['id']}})['then'](function(_0x46cbde){return db[_0x65f6('0x54')][_0x65f6('0x55')](function(_0x49cee2){return _0x46cbde[_0x65f6('0x56')](_0x254e9f,{'transaction':_0x49cee2})[_0x65f6('0x13')](function(){return BPromise['each'](_0xf6de,function(_0x758e80){return db[_0x65f6('0x41')]['findOrCreate']({'where':{'UserId':_0x758e80['id'],'SmsQueueId':_0x219bf8[_0x65f6('0x25')]['id']},'transaction':_0x49cee2});});})['then'](function(){_0xf6de[_0x65f6('0x57')](function(_0x55ea91){socket[_0x65f6('0x58')](_0x65f6('0x59'),{'UserId':_0x55ea91['id'],'SmsQueueId':_0x46cbde['id']});});});});});}})['then'](respondWithStatusCode(_0x4a8b60,null))[_0x65f6('0x23')](handleError(_0x4a8b60,null));};exports[_0x65f6('0x5a')]=function(_0x2a700b,_0x299b85){return db[_0x65f6('0x50')][_0x65f6('0x22')]({'where':{'id':_0x2a700b[_0x65f6('0x21')][_0x65f6('0x4f')]},'attributes':['id'],'include':[{'model':db[_0x65f6('0x42')],'as':_0x65f6('0x51'),'attributes':['id'],'raw':!![]}]})[_0x65f6('0x13')](handleEntityNotFound(_0x299b85,null))['then'](function(_0x10a661){var _0x1cf1bd=_[_0x65f6('0x40')](_0x10a661,'id');var _0x219e42=[];var _0x5694f9=[];var _0x453080=squel[_0x65f6('0x5b')]();_0x453080['field'](_0x65f6('0x5c'))['from'](_0x65f6('0x5d'),'tq')['join'](_0x65f6('0x5e'),'ut',_0x65f6('0x5f'))['where']('SmsQueueId\x20=\x20?',_0x2a700b[_0x65f6('0x25')]['id']);for(var _0x413c21=0x0;_0x413c21<_0x10a661['length'];_0x413c21+=0x1){let _0x2d86c8=_0x10a661[_0x413c21];for(var _0x3b3bd5=0x0;_0x3b3bd5<_0x2d86c8[_0x65f6('0x51')]['length'];_0x3b3bd5+=0x1){let _0x1348ec=_0x2d86c8[_0x65f6('0x51')][_0x3b3bd5];var _0x5889dc=_0x453080[_0x65f6('0x60')]();_0x5889dc['where'](_0x65f6('0x61'),_0x1348ec['id']);_0x5694f9['push'](db['sequelize'][_0x65f6('0x21')](_0x5889dc[_0x65f6('0x62')](),{'type':db[_0x65f6('0x54')][_0x65f6('0x63')][_0x65f6('0x64')]})[_0x65f6('0x13')](function(_0x1ac46f){if(_0x1ac46f[_0x65f6('0x4c')]===0x1){return _0x1348ec['id'];}else{var _0x4d66fe=_['every'](_[_0x65f6('0x40')](_0x1ac46f,'TeamId'),function(_0x1ee28a){return _[_0x65f6('0x65')](_0x1cf1bd,_0x1ee28a);});if(_0x4d66fe){return _0x1348ec['id'];}}}));}}return BPromise[_0x65f6('0x66')](_0x5694f9)[_0x65f6('0x13')](function(_0x43127b){_0x219e42=_(_0x219e42)['union'](_0x43127b)[_0x65f6('0x67')]()[_0x65f6('0x68')]();return db[_0x65f6('0x1f')]['find']({'where':{'id':_0x2a700b[_0x65f6('0x25')]['id']}})[_0x65f6('0x13')](function(_0x4254c2){return db[_0x65f6('0x54')][_0x65f6('0x55')](function(_0x16bf93){return _0x4254c2['removeTeams'](_0x2a700b['query'][_0x65f6('0x4f')],{'transaction':_0x16bf93})[_0x65f6('0x13')](function(){if(!_[_0x65f6('0x69')](_0x219e42)){return _0x4254c2[_0x65f6('0x6a')](_0x219e42,{'transaction':_0x16bf93});}})['then'](function(){_0x219e42['forEach'](function(_0x336076){socket[_0x65f6('0x58')](_0x65f6('0x6b'),{'UserId':_0x336076,'SmsQueueId':_0x4254c2['id']});});});});});});})[_0x65f6('0x13')](respondWithStatusCode(_0x299b85,null))[_0x65f6('0x23')](handleError(_0x299b85,null));};exports[_0x65f6('0x6c')]=function(_0x5daaf4,_0x4d607a){return db['SmsQueue'][_0x65f6('0x35')]({'where':{'id':_0x5daaf4[_0x65f6('0x25')]['id']}})[_0x65f6('0x13')](handleEntityNotFound(_0x4d607a,null))[_0x65f6('0x13')](function(_0x53b11c){if(_0x53b11c){return _0x53b11c['addAgents'](_0x5daaf4[_0x65f6('0x2f')][_0x65f6('0x4f')],_['omit'](_0x5daaf4[_0x65f6('0x2f')],['ids','id'])||{})[_0x65f6('0x6d')](function(_0x4f3ef8){for(var _0x3a30ed=0x0;_0x3a30ed<_0x5daaf4[_0x65f6('0x2f')]['ids'][_0x65f6('0x4c')];_0x3a30ed+=0x1){socket[_0x65f6('0x58')](_0x65f6('0x59'),{'UserId':Number(_0x5daaf4[_0x65f6('0x2f')][_0x65f6('0x4f')][_0x3a30ed]),'SmsQueueId':Number(_0x5daaf4[_0x65f6('0x25')]['id'])});}return _0x4f3ef8;});}})['then'](respondWithResult(_0x4d607a,null))[_0x65f6('0x23')](handleError(_0x4d607a,null));};exports['removeAgents']=function(_0x24495c,_0x56336a){return db[_0x65f6('0x1f')][_0x65f6('0x35')]({'where':{'id':_0x24495c[_0x65f6('0x25')]['id']}})[_0x65f6('0x13')](handleEntityNotFound(_0x56336a,null))['then'](function(_0x2b6f98){if(_0x2b6f98){return _0x2b6f98[_0x65f6('0x6a')](_0x24495c[_0x65f6('0x21')]['ids'])['then'](function(){if(_[_0x65f6('0x6e')](_0x24495c[_0x65f6('0x21')]['ids'])){for(var _0x180cde=0x0;_0x180cde<_0x24495c[_0x65f6('0x21')][_0x65f6('0x4f')]['length'];_0x180cde+=0x1){socket[_0x65f6('0x58')](_0x65f6('0x6b'),{'UserId':Number(_0x24495c['query'][_0x65f6('0x4f')][_0x180cde]),'SmsQueueId':Number(_0x24495c[_0x65f6('0x25')]['id'])});}}else{socket[_0x65f6('0x58')]('userSmsQueue:remove',{'UserId':Number(_0x24495c[_0x65f6('0x21')][_0x65f6('0x4f')]),'SmsQueueId':Number(_0x24495c[_0x65f6('0x25')]['id'])});}});}})['then'](respondWithStatusCode(_0x56336a,null))[_0x65f6('0x23')](handleError(_0x56336a,null));};exports['getAgents']=function(_0x1beaa7,_0x87a9e4){var _0x31ec61={};var _0x22be6e={};var _0x29b2de;var _0x430fb8;return db['SmsQueue'][_0x65f6('0x6f')]({'where':{'id':_0x1beaa7[_0x65f6('0x25')]['id']}})[_0x65f6('0x13')](handleEntityNotFound(_0x87a9e4,null))[_0x65f6('0x13')](function(_0x207d15){if(_0x207d15){_0x29b2de=_0x207d15;_0x22be6e['model']=_['keys'](db['User'][_0x65f6('0x3a')]);_0x22be6e[_0x65f6('0x21')]=_[_0x65f6('0x27')](_0x1beaa7['query']);_0x22be6e[_0x65f6('0x3b')]=_['intersection'](_0x22be6e['model'],_0x22be6e[_0x65f6('0x21')]);_0x31ec61[_0x65f6('0x29')]=_['intersection'](_0x22be6e[_0x65f6('0x26')],qs[_0x65f6('0x2a')](_0x1beaa7[_0x65f6('0x21')][_0x65f6('0x2a')]));_0x31ec61[_0x65f6('0x29')]=_0x31ec61[_0x65f6('0x29')][_0x65f6('0x4c')]?_0x31ec61[_0x65f6('0x29')]:_0x22be6e[_0x65f6('0x26')];_0x31ec61[_0x65f6('0x3d')]=qs[_0x65f6('0x3e')](_0x1beaa7[_0x65f6('0x21')]['sort']);_0x31ec61[_0x65f6('0x1e')]=qs['filters'](_['pick'](_0x1beaa7[_0x65f6('0x21')],_0x22be6e[_0x65f6('0x3b')]));if(_0x1beaa7[_0x65f6('0x21')][_0x65f6('0x4d')]){_0x31ec61['where']=_[_0x65f6('0x2c')](_0x31ec61['where'],{'$or':_['map'](_0x31ec61[_0x65f6('0x29')],function(_0x99fe6e){var _0x1a7e52={};_0x1a7e52[_0x99fe6e]={'$like':'%'+_0x1beaa7[_0x65f6('0x21')][_0x65f6('0x4d')]+'%'};return _0x1a7e52;})});}_0x31ec61=_[_0x65f6('0x2c')]({},_0x31ec61,_0x1beaa7['options']);return _0x29b2de[_0x65f6('0x70')](_0x31ec61);}})['then'](function(_0x1ef2a0){if(_0x1ef2a0){_0x430fb8=_0x1ef2a0[_0x65f6('0x4c')];if(!_0x1beaa7[_0x65f6('0x21')]['hasOwnProperty'](_0x65f6('0x4e'))){_0x31ec61['limit']=qs['limit'](_0x1beaa7[_0x65f6('0x21')][_0x65f6('0xe')]);_0x31ec61[_0x65f6('0xd')]=qs[_0x65f6('0xd')](_0x1beaa7[_0x65f6('0x21')]['offset']);}return _0x29b2de[_0x65f6('0x70')](_0x31ec61);}})[_0x65f6('0x13')](function(_0x3bebe3){if(_0x3bebe3){return _0x3bebe3?{'count':_0x430fb8,'rows':_0x3bebe3}:null;}})[_0x65f6('0x13')](respondWithResult(_0x87a9e4,null))['catch'](handleError(_0x87a9e4,null));}; \ No newline at end of file +var _0xadb5=['%s/%s','pick','filter','getTeams','addTeams','ids','findAll','online','voicePause','interface','flatMap','Agents','sequelize','transaction','each','forEach','userSmsQueue:save','removeTeams','Team','field','tq.TeamId','from','team_has_sms_queues','join','ut.TeamId\x20=\x20tq.TeamId','SmsQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','all','union','compact','value','find','isEmpty','removeAgents','emit','userSmsQueue:remove','addAgents','omit','spread','isArray','getAgents','util','squel','ioredis','../../components/parsers/qs','api','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./smsQueue.socket','register','sendStatus','status','end','json','offset','limit','undefined','set','Content-Range','update','then','destroy','SmsQueues','UserProfileResource','error','stack','name','send','index','SmsQueue','rawAttributes','type','key','getOptions','where','count','include','query','rows','catch','show','model','keys','filters','fields','attributes','length','includeAll','options','create','user','get','role','autoAssociation','body','params','describe','getMembers','findOne','intersection','hasOwnProperty','nolimit','order','sort','SmsQueueId','merge','UserSmsQueue','User','findAndCountAll','map','UserId','agent','smsPause','updatedAt','createdAt','format'];(function(_0x5b3b9b,_0x1c71b0){var _0x47c1d7=function(_0x34c20b){while(--_0x34c20b){_0x5b3b9b['push'](_0x5b3b9b['shift']());}};_0x47c1d7(++_0x1c71b0);}(_0xadb5,0xad));var _0x5adb=function(_0x1a3966,_0x370703){_0x1a3966=_0x1a3966-0x0;var _0x9e5934=_0xadb5[_0x1a3966];return _0x9e5934;};'use strict';var BPromise=require('bluebird');var util=require(_0x5adb('0x0'));var _=require('lodash');var squel=require(_0x5adb('0x1'));var Redis=require(_0x5adb('0x2'));var qs=require(_0x5adb('0x3'));var logger=require('../../config/logger')(_0x5adb('0x4'));var config=require(_0x5adb('0x5'));var db=require(_0x5adb('0x6'))['db'];config['redis']=_[_0x5adb('0x7')](config[_0x5adb('0x8')],{'host':_0x5adb('0x9'),'port':0x18eb});var socket=require(_0x5adb('0xa'))(new Redis(config[_0x5adb('0x8')]));require(_0x5adb('0xb'))[_0x5adb('0xc')](socket);function respondWithStatusCode(_0x6d1b45,_0x41261c){_0x41261c=_0x41261c||0xcc;return function(_0x7293ab){if(_0x7293ab){return _0x6d1b45[_0x5adb('0xd')](_0x41261c);}return _0x6d1b45[_0x5adb('0xe')](_0x41261c)[_0x5adb('0xf')]();};}function respondWithResult(_0x275428,_0x563d86){_0x563d86=_0x563d86||0xc8;return function(_0x4c268d){if(_0x4c268d){return _0x275428[_0x5adb('0xe')](_0x563d86)[_0x5adb('0x10')](_0x4c268d);}};}function respondWithFilteredResult(_0x82e67e,_0x53b772){return function(_0x29f0d5){if(_0x29f0d5){var _0x56012f=typeof _0x53b772[_0x5adb('0x11')]==='undefined'&&typeof _0x53b772[_0x5adb('0x12')]===_0x5adb('0x13');var _0x44abe3=_0x29f0d5['count'];var _0x2a545b=_0x56012f?0x0:_0x53b772[_0x5adb('0x11')];var _0xf82f72=_0x56012f?_0x29f0d5['count']:_0x53b772[_0x5adb('0x11')]+_0x53b772['limit'];var _0x367d82;if(_0xf82f72>=_0x44abe3){_0xf82f72=_0x44abe3;_0x367d82=0xc8;}else{_0x367d82=0xce;}_0x82e67e[_0x5adb('0xe')](_0x367d82);return _0x82e67e[_0x5adb('0x14')](_0x5adb('0x15'),_0x2a545b+'-'+_0xf82f72+'/'+_0x44abe3)[_0x5adb('0x10')](_0x29f0d5);}return null;};}function saveUpdates(_0x39d24d){return function(_0xa29dc){if(_0xa29dc){return _0xa29dc[_0x5adb('0x16')](_0x39d24d)[_0x5adb('0x17')](function(_0x529b65){return _0x529b65;});}return null;};}function removeEntity(_0x3fff62){return function(_0x5de028){if(_0x5de028){return _0x5de028[_0x5adb('0x18')]()['then'](function(){var _0x3ef465=_0x5de028['get']({'plain':!![]});var _0x5e218c=_0x5adb('0x19');return db[_0x5adb('0x1a')][_0x5adb('0x18')]({'where':{'type':_0x5e218c,'resourceId':_0x3ef465['id']}})[_0x5adb('0x17')](function(){return _0x5de028;});})[_0x5adb('0x17')](function(){_0x3fff62['status'](0xcc)[_0x5adb('0xf')]();});}};}function handleEntityNotFound(_0x5c296e){return function(_0x4e9f16){if(!_0x4e9f16){_0x5c296e[_0x5adb('0xd')](0x194);}return _0x4e9f16;};}function handleError(_0x379b33,_0x1a38d3){_0x1a38d3=_0x1a38d3||0x1f4;return function(_0x1a8014){logger[_0x5adb('0x1b')](_0x1a8014[_0x5adb('0x1c')]);if(_0x1a8014[_0x5adb('0x1d')]){delete _0x1a8014['name'];}_0x379b33[_0x5adb('0xe')](_0x1a38d3)[_0x5adb('0x1e')](_0x1a8014);};}exports[_0x5adb('0x1f')]=function(_0x3839fb,_0xeb556c){var _0x49f203={};var _0x2fee18={'count':0x0,'rows':[]};var _0x2e1e63=_['map'](db[_0x5adb('0x20')][_0x5adb('0x21')],function(_0x1a0acd){return{'name':_0x1a0acd['fieldName'],'type':_0x1a0acd[_0x5adb('0x22')][_0x5adb('0x23')]};});_0x49f203=qs[_0x5adb('0x24')](_0x2e1e63,_0x3839fb);var _0x2c64a3={'where':_0x49f203[_0x5adb('0x25')]};return db[_0x5adb('0x20')]['count'](_0x2c64a3)['then'](function(_0x5d457e){_0x2fee18[_0x5adb('0x26')]=_0x5d457e;_0x49f203[_0x5adb('0x27')]=qs[_0x5adb('0x27')](_0x3839fb[_0x5adb('0x28')]);return db[_0x5adb('0x20')]['findAll'](_0x49f203);})[_0x5adb('0x17')](function(_0x34b793){_0x2fee18[_0x5adb('0x29')]=_0x34b793;return _0x2fee18;})[_0x5adb('0x17')](respondWithFilteredResult(_0xeb556c,_0x49f203))[_0x5adb('0x2a')](handleError(_0xeb556c,null));};exports[_0x5adb('0x2b')]=function(_0x28190d,_0x28bf1f){var _0x138bf6={'raw':!![],'where':{'id':_0x28190d['params']['id']}},_0x260295={};_0x260295[_0x5adb('0x2c')]=_['keys'](db[_0x5adb('0x20')][_0x5adb('0x21')]);_0x260295['query']=_[_0x5adb('0x2d')](_0x28190d[_0x5adb('0x28')]);_0x260295[_0x5adb('0x2e')]=_['intersection'](_0x260295[_0x5adb('0x2c')],_0x260295[_0x5adb('0x28')]);_0x138bf6['attributes']=_['intersection'](_0x260295[_0x5adb('0x2c')],qs['fields'](_0x28190d[_0x5adb('0x28')][_0x5adb('0x2f')]));_0x138bf6[_0x5adb('0x30')]=_0x138bf6[_0x5adb('0x30')][_0x5adb('0x31')]?_0x138bf6['attributes']:_0x260295[_0x5adb('0x2c')];if(_0x28190d[_0x5adb('0x28')][_0x5adb('0x32')]){_0x138bf6['include']=[{'all':!![]}];}_0x138bf6=_['merge']({},_0x138bf6,_0x28190d[_0x5adb('0x33')]);return db[_0x5adb('0x20')]['find'](_0x138bf6)[_0x5adb('0x17')](handleEntityNotFound(_0x28bf1f,null))['then'](respondWithResult(_0x28bf1f,null))[_0x5adb('0x2a')](handleError(_0x28bf1f,null));};exports['create']=function(_0x11cb37,_0x4d052f){return db[_0x5adb('0x20')][_0x5adb('0x34')](_0x11cb37['body'],{})[_0x5adb('0x17')](function(_0x5a6a79){var _0xadbe37=_0x11cb37[_0x5adb('0x35')][_0x5adb('0x36')]({'plain':!![]});if(!_0xadbe37)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xadbe37[_0x5adb('0x37')]===_0x5adb('0x35')){var _0xcdaf8e=_0x5a6a79[_0x5adb('0x36')]({'plain':!![]});var _0x22aa95='SmsQueues';return db['UserProfileSection']['find']({'where':{'name':_0x22aa95,'userProfileId':_0xadbe37['userProfileId']},'raw':!![]})[_0x5adb('0x17')](function(_0x2fbe14){if(_0x2fbe14&&_0x2fbe14[_0x5adb('0x38')]===0x0){return db[_0x5adb('0x1a')][_0x5adb('0x34')]({'name':_0xcdaf8e[_0x5adb('0x1d')],'resourceId':_0xcdaf8e['id'],'type':_0x2fbe14[_0x5adb('0x1d')],'sectionId':_0x2fbe14['id']},{})[_0x5adb('0x17')](function(){return _0x5a6a79;});}else{return _0x5a6a79;}})['catch'](function(_0x53f2c6){logger[_0x5adb('0x1b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x53f2c6);throw _0x53f2c6;});}return _0x5a6a79;})[_0x5adb('0x17')](respondWithResult(_0x4d052f,0xc9))[_0x5adb('0x2a')](handleError(_0x4d052f,null));};exports[_0x5adb('0x16')]=function(_0x121714,_0xdfecfd){if(_0x121714['body']['id']){delete _0x121714[_0x5adb('0x39')]['id'];}return db[_0x5adb('0x20')]['find']({'where':{'id':_0x121714[_0x5adb('0x3a')]['id']}})[_0x5adb('0x17')](handleEntityNotFound(_0xdfecfd,null))['then'](saveUpdates(_0x121714[_0x5adb('0x39')],null))[_0x5adb('0x17')](respondWithResult(_0xdfecfd,null))[_0x5adb('0x2a')](handleError(_0xdfecfd,null));};exports[_0x5adb('0x18')]=function(_0xea3307,_0x4362ec){return db[_0x5adb('0x20')]['find']({'where':{'id':_0xea3307['params']['id']}})[_0x5adb('0x17')](handleEntityNotFound(_0x4362ec,null))[_0x5adb('0x17')](removeEntity(_0x4362ec,null))[_0x5adb('0x2a')](handleError(_0x4362ec,null));};exports[_0x5adb('0x3b')]=function(_0x57b8af,_0x507e48){return db[_0x5adb('0x20')][_0x5adb('0x3b')]()[_0x5adb('0x17')](respondWithResult(_0x507e48,null))[_0x5adb('0x2a')](handleError(_0x507e48,null));};exports[_0x5adb('0x3c')]=function(_0x5358c0,_0x182cbc){var _0x437f52={'raw':!![],'where':{}},_0x5b574c={},_0x7786c4;return db[_0x5adb('0x20')][_0x5adb('0x3d')]({'where':{'id':_0x5358c0[_0x5adb('0x3a')]['id']}})[_0x5adb('0x17')](handleEntityNotFound(_0x182cbc,null))[_0x5adb('0x17')](function(_0x39840e){if(_0x39840e){_0x7786c4=_0x39840e[_0x5adb('0x36')]({'plain':!![]});_0x5b574c['model']=_[_0x5adb('0x2d')](db['UserSmsQueue']['rawAttributes']);_0x5b574c['query']=_[_0x5adb('0x2d')](_0x5358c0[_0x5adb('0x28')]);_0x5b574c[_0x5adb('0x2e')]=_['intersection'](_0x5b574c[_0x5adb('0x2c')],_0x5b574c['query']);_0x437f52[_0x5adb('0x30')]=_[_0x5adb('0x3e')](_0x5b574c[_0x5adb('0x2c')],qs['fields'](_0x5358c0[_0x5adb('0x28')]['fields']));_0x437f52[_0x5adb('0x30')]=_0x437f52[_0x5adb('0x30')]['length']?_0x437f52[_0x5adb('0x30')]:_0x5b574c[_0x5adb('0x2c')];if(!_0x5358c0[_0x5adb('0x28')][_0x5adb('0x3f')](_0x5adb('0x40'))){_0x437f52['limit']=qs[_0x5adb('0x12')](_0x5358c0[_0x5adb('0x28')][_0x5adb('0x12')]);_0x437f52[_0x5adb('0x11')]=qs['offset'](_0x5358c0[_0x5adb('0x28')][_0x5adb('0x11')]);}_0x437f52[_0x5adb('0x41')]=qs['sort'](_0x5358c0[_0x5adb('0x28')][_0x5adb('0x42')]);_0x437f52[_0x5adb('0x25')]=qs[_0x5adb('0x2e')](_['pick'](_0x5358c0[_0x5adb('0x28')],_0x5b574c[_0x5adb('0x2e')]));_0x437f52[_0x5adb('0x25')][_0x5adb('0x43')]=_0x39840e['id'];if(_0x5358c0[_0x5adb('0x28')]['filter']){_0x437f52[_0x5adb('0x25')]=_['merge'](_0x437f52[_0x5adb('0x25')],{'$or':_['map'](_0x437f52[_0x5adb('0x30')],function(_0x35df22){var _0x1a9358={};_0x1a9358[_0x35df22]={'$like':'%'+_0x5358c0[_0x5adb('0x28')]['filter']+'%'};return _0x1a9358;})});}_0x437f52=_[_0x5adb('0x44')]({},_0x437f52,_0x5358c0[_0x5adb('0x33')]);return db[_0x5adb('0x45')]['findAll'](_0x437f52);}})['then'](function(_0x4ddfdf){if(_0x4ddfdf){return db[_0x5adb('0x46')][_0x5adb('0x47')]({'where':{'id':_[_0x5adb('0x48')](_0x4ddfdf,_0x5adb('0x49')),'role':_0x5adb('0x4a')},'attributes':['id',_0x5adb('0x1d'),_0x5adb('0x4b'),_0x5adb('0x4c'),_0x5adb('0x4d')]});}})[_0x5adb('0x17')](function(_0x452767){if(_0x452767){return{'count':_0x452767[_0x5adb('0x26')],'rows':_[_0x5adb('0x48')](_0x452767['rows'],function(_0x49f4c8){return{'membername':_0x49f4c8[_0x5adb('0x1d')],'UserId':_0x49f4c8['id'],'queue_name':_0x7786c4[_0x5adb('0x1d')],'SmsQueueId':_0x7786c4['id'],'interface':util[_0x5adb('0x4e')](_0x5adb('0x4f'),'SIP',_0x49f4c8[_0x5adb('0x1d')]),'penalty':0x0,'paused':_0x49f4c8[_0x5adb('0x4b')],'createdAt':_0x49f4c8['createdAt'],'updatedAt':_0x49f4c8[_0x5adb('0x4c')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x5adb('0x17')](respondWithFilteredResult(_0x182cbc,_0x437f52))[_0x5adb('0x2a')](handleError(_0x182cbc,null));};exports['getTeams']=function(_0x30d185,_0x409357){var _0x19df2f={};var _0x30c92c={};var _0x330290;var _0x428019;return db['SmsQueue'][_0x5adb('0x3d')]({'where':{'id':_0x30d185[_0x5adb('0x3a')]['id']}})[_0x5adb('0x17')](handleEntityNotFound(_0x409357,null))['then'](function(_0xcd71d2){if(_0xcd71d2){_0x330290=_0xcd71d2;_0x30c92c[_0x5adb('0x2c')]=_[_0x5adb('0x2d')](db['Team'][_0x5adb('0x21')]);_0x30c92c['query']=_[_0x5adb('0x2d')](_0x30d185[_0x5adb('0x28')]);_0x30c92c[_0x5adb('0x2e')]=_['intersection'](_0x30c92c[_0x5adb('0x2c')],_0x30c92c[_0x5adb('0x28')]);_0x19df2f['attributes']=_[_0x5adb('0x3e')](_0x30c92c[_0x5adb('0x2c')],qs[_0x5adb('0x2f')](_0x30d185[_0x5adb('0x28')]['fields']));_0x19df2f[_0x5adb('0x30')]=_0x19df2f[_0x5adb('0x30')][_0x5adb('0x31')]?_0x19df2f[_0x5adb('0x30')]:_0x30c92c['model'];_0x19df2f['order']=qs[_0x5adb('0x42')](_0x30d185['query']['sort']);_0x19df2f['where']=qs[_0x5adb('0x2e')](_[_0x5adb('0x50')](_0x30d185['query'],_0x30c92c[_0x5adb('0x2e')]));if(_0x30d185[_0x5adb('0x28')][_0x5adb('0x51')]){_0x19df2f[_0x5adb('0x25')]=_[_0x5adb('0x44')](_0x19df2f[_0x5adb('0x25')],{'$or':_[_0x5adb('0x48')](_0x19df2f[_0x5adb('0x30')],function(_0x5240c1){var _0x4b9e80={};_0x4b9e80[_0x5240c1]={'$like':'%'+_0x30d185['query'][_0x5adb('0x51')]+'%'};return _0x4b9e80;})});}_0x19df2f=_[_0x5adb('0x44')]({},_0x19df2f,_0x30d185[_0x5adb('0x33')]);return _0x330290[_0x5adb('0x52')](_0x19df2f);}})[_0x5adb('0x17')](function(_0x2f6ef7){if(_0x2f6ef7){_0x428019=_0x2f6ef7[_0x5adb('0x31')];if(!_0x30d185[_0x5adb('0x28')]['hasOwnProperty']('nolimit')){_0x19df2f[_0x5adb('0x12')]=qs[_0x5adb('0x12')](_0x30d185[_0x5adb('0x28')][_0x5adb('0x12')]);_0x19df2f[_0x5adb('0x11')]=qs[_0x5adb('0x11')](_0x30d185[_0x5adb('0x28')][_0x5adb('0x11')]);}return _0x330290[_0x5adb('0x52')](_0x19df2f);}})[_0x5adb('0x17')](function(_0x484f3d){if(_0x484f3d){return _0x484f3d?{'count':_0x428019,'rows':_0x484f3d}:null;}})[_0x5adb('0x17')](respondWithResult(_0x409357,null))[_0x5adb('0x2a')](handleError(_0x409357,null));};exports[_0x5adb('0x53')]=function(_0x5d3aa4,_0x31f041){var _0xa1bd33=_0x5d3aa4['body'][_0x5adb('0x54')];return db['Team'][_0x5adb('0x55')]({'where':{'id':_0xa1bd33},'attributes':['id'],'include':[{'model':db[_0x5adb('0x46')],'as':'Agents','attributes':['id',_0x5adb('0x1d'),_0x5adb('0x56'),_0x5adb('0x57'),_0x5adb('0x58')],'raw':!![]}]})[_0x5adb('0x17')](function(_0x10f54a){if(_0x10f54a){var _0x3cee6c=_[_0x5adb('0x59')](_0x10f54a,function(_0x49a8a6){var _0x3786b4=_0x49a8a6[_0x5adb('0x36')]({'plain':!![]});return _0x3786b4[_0x5adb('0x5a')];});return db['SmsQueue']['find']({'where':{'id':_0x5d3aa4[_0x5adb('0x3a')]['id']}})['then'](function(_0x27d3d8){return db[_0x5adb('0x5b')][_0x5adb('0x5c')](function(_0x50600f){return _0x27d3d8[_0x5adb('0x53')](_0xa1bd33,{'transaction':_0x50600f})[_0x5adb('0x17')](function(){return BPromise[_0x5adb('0x5d')](_0x3cee6c,function(_0x3ecc56){return db[_0x5adb('0x45')]['findOrCreate']({'where':{'UserId':_0x3ecc56['id'],'SmsQueueId':_0x5d3aa4[_0x5adb('0x3a')]['id']},'transaction':_0x50600f});});})[_0x5adb('0x17')](function(){_0x3cee6c[_0x5adb('0x5e')](function(_0xe3d12d){socket['emit'](_0x5adb('0x5f'),{'UserId':_0xe3d12d['id'],'SmsQueueId':_0x27d3d8['id']});});});});});}})[_0x5adb('0x17')](respondWithStatusCode(_0x31f041,null))[_0x5adb('0x2a')](handleError(_0x31f041,null));};exports[_0x5adb('0x60')]=function(_0x15d4f1,_0x20faf6){return db[_0x5adb('0x61')]['findAll']({'where':{'id':_0x15d4f1[_0x5adb('0x28')][_0x5adb('0x54')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x5adb('0x5a'),'attributes':['id'],'raw':!![]}]})[_0x5adb('0x17')](handleEntityNotFound(_0x20faf6,null))['then'](function(_0x462fa0){var _0x50f8ed=_[_0x5adb('0x48')](_0x462fa0,'id');var _0x268df2=[];var _0x4a2ebc=[];var _0x167432=squel['select']();_0x167432[_0x5adb('0x62')](_0x5adb('0x63'))[_0x5adb('0x64')](_0x5adb('0x65'),'tq')[_0x5adb('0x66')]('user_has_teams','ut',_0x5adb('0x67'))[_0x5adb('0x25')](_0x5adb('0x68'),_0x15d4f1[_0x5adb('0x3a')]['id']);for(var _0x47c631=0x0;_0x47c631<_0x462fa0['length'];_0x47c631+=0x1){let _0x3f3db9=_0x462fa0[_0x47c631];for(var _0x461a07=0x0;_0x461a07<_0x3f3db9[_0x5adb('0x5a')][_0x5adb('0x31')];_0x461a07+=0x1){let _0x277668=_0x3f3db9[_0x5adb('0x5a')][_0x461a07];var _0x31f5b2=_0x167432['clone']();_0x31f5b2[_0x5adb('0x25')](_0x5adb('0x69'),_0x277668['id']);_0x4a2ebc[_0x5adb('0x6a')](db[_0x5adb('0x5b')]['query'](_0x31f5b2[_0x5adb('0x6b')](),{'type':db[_0x5adb('0x5b')][_0x5adb('0x6c')][_0x5adb('0x6d')]})[_0x5adb('0x17')](function(_0x188cbd){if(_0x188cbd[_0x5adb('0x31')]===0x1){return _0x277668['id'];}else{var _0x2d1b65=_[_0x5adb('0x6e')](_['map'](_0x188cbd,_0x5adb('0x6f')),function(_0x456799){return _['includes'](_0x50f8ed,_0x456799);});if(_0x2d1b65){return _0x277668['id'];}}}));}}return BPromise[_0x5adb('0x70')](_0x4a2ebc)[_0x5adb('0x17')](function(_0x2b8915){_0x268df2=_(_0x268df2)[_0x5adb('0x71')](_0x2b8915)[_0x5adb('0x72')]()[_0x5adb('0x73')]();return db[_0x5adb('0x20')][_0x5adb('0x74')]({'where':{'id':_0x15d4f1['params']['id']}})[_0x5adb('0x17')](function(_0x2386c0){return db['sequelize'][_0x5adb('0x5c')](function(_0x58a26f){return _0x2386c0[_0x5adb('0x60')](_0x15d4f1['query']['ids'],{'transaction':_0x58a26f})[_0x5adb('0x17')](function(){if(!_[_0x5adb('0x75')](_0x268df2)){return _0x2386c0[_0x5adb('0x76')](_0x268df2,{'transaction':_0x58a26f});}})['then'](function(){_0x268df2[_0x5adb('0x5e')](function(_0x321c3a){socket[_0x5adb('0x77')](_0x5adb('0x78'),{'UserId':_0x321c3a,'SmsQueueId':_0x2386c0['id']});});});});});});})[_0x5adb('0x17')](respondWithStatusCode(_0x20faf6,null))[_0x5adb('0x2a')](handleError(_0x20faf6,null));};exports[_0x5adb('0x79')]=function(_0x463e84,_0x28bd33){return db[_0x5adb('0x20')][_0x5adb('0x74')]({'where':{'id':_0x463e84[_0x5adb('0x3a')]['id']}})['then'](handleEntityNotFound(_0x28bd33,null))['then'](function(_0x312463){if(_0x312463){return _0x312463[_0x5adb('0x79')](_0x463e84['body'][_0x5adb('0x54')],_[_0x5adb('0x7a')](_0x463e84[_0x5adb('0x39')],[_0x5adb('0x54'),'id'])||{})[_0x5adb('0x7b')](function(_0x24cd3b){for(var _0x15626b=0x0;_0x15626b<_0x463e84[_0x5adb('0x39')][_0x5adb('0x54')]['length'];_0x15626b+=0x1){socket[_0x5adb('0x77')](_0x5adb('0x5f'),{'UserId':Number(_0x463e84[_0x5adb('0x39')]['ids'][_0x15626b]),'SmsQueueId':Number(_0x463e84[_0x5adb('0x3a')]['id'])});}return _0x24cd3b;});}})[_0x5adb('0x17')](respondWithResult(_0x28bd33,null))[_0x5adb('0x2a')](handleError(_0x28bd33,null));};exports[_0x5adb('0x76')]=function(_0x64475f,_0x2a78f9){return db['SmsQueue'][_0x5adb('0x74')]({'where':{'id':_0x64475f[_0x5adb('0x3a')]['id']}})[_0x5adb('0x17')](handleEntityNotFound(_0x2a78f9,null))[_0x5adb('0x17')](function(_0x2c3af8){if(_0x2c3af8){return _0x2c3af8[_0x5adb('0x76')](_0x64475f[_0x5adb('0x28')][_0x5adb('0x54')])[_0x5adb('0x17')](function(){if(_[_0x5adb('0x7c')](_0x64475f['query'][_0x5adb('0x54')])){for(var _0x5b9565=0x0;_0x5b9565<_0x64475f[_0x5adb('0x28')][_0x5adb('0x54')][_0x5adb('0x31')];_0x5b9565+=0x1){socket[_0x5adb('0x77')](_0x5adb('0x78'),{'UserId':Number(_0x64475f['query']['ids'][_0x5b9565]),'SmsQueueId':Number(_0x64475f[_0x5adb('0x3a')]['id'])});}}else{socket[_0x5adb('0x77')](_0x5adb('0x78'),{'UserId':Number(_0x64475f[_0x5adb('0x28')][_0x5adb('0x54')]),'SmsQueueId':Number(_0x64475f[_0x5adb('0x3a')]['id'])});}});}})['then'](respondWithStatusCode(_0x2a78f9,null))['catch'](handleError(_0x2a78f9,null));};exports[_0x5adb('0x7d')]=function(_0xd5b95d,_0x9d80fd){var _0x4f5721={};var _0x542626={};var _0x227c17;var _0x5982a5;return db[_0x5adb('0x20')][_0x5adb('0x3d')]({'where':{'id':_0xd5b95d['params']['id']}})['then'](handleEntityNotFound(_0x9d80fd,null))[_0x5adb('0x17')](function(_0x4bb198){if(_0x4bb198){_0x227c17=_0x4bb198;_0x542626['model']=_[_0x5adb('0x2d')](db[_0x5adb('0x46')][_0x5adb('0x21')]);_0x542626[_0x5adb('0x28')]=_[_0x5adb('0x2d')](_0xd5b95d[_0x5adb('0x28')]);_0x542626[_0x5adb('0x2e')]=_[_0x5adb('0x3e')](_0x542626[_0x5adb('0x2c')],_0x542626[_0x5adb('0x28')]);_0x4f5721[_0x5adb('0x30')]=_[_0x5adb('0x3e')](_0x542626[_0x5adb('0x2c')],qs['fields'](_0xd5b95d[_0x5adb('0x28')]['fields']));_0x4f5721[_0x5adb('0x30')]=_0x4f5721[_0x5adb('0x30')][_0x5adb('0x31')]?_0x4f5721[_0x5adb('0x30')]:_0x542626[_0x5adb('0x2c')];_0x4f5721[_0x5adb('0x41')]=qs[_0x5adb('0x42')](_0xd5b95d[_0x5adb('0x28')][_0x5adb('0x42')]);_0x4f5721[_0x5adb('0x25')]=qs[_0x5adb('0x2e')](_[_0x5adb('0x50')](_0xd5b95d['query'],_0x542626[_0x5adb('0x2e')]));if(_0xd5b95d[_0x5adb('0x28')][_0x5adb('0x51')]){_0x4f5721[_0x5adb('0x25')]=_[_0x5adb('0x44')](_0x4f5721[_0x5adb('0x25')],{'$or':_[_0x5adb('0x48')](_0x4f5721[_0x5adb('0x30')],function(_0x57c160){var _0xe7ddc4={};_0xe7ddc4[_0x57c160]={'$like':'%'+_0xd5b95d[_0x5adb('0x28')][_0x5adb('0x51')]+'%'};return _0xe7ddc4;})});}_0x4f5721=_['merge']({},_0x4f5721,_0xd5b95d[_0x5adb('0x33')]);return _0x227c17['getAgents'](_0x4f5721);}})[_0x5adb('0x17')](function(_0x50c3a3){if(_0x50c3a3){_0x5982a5=_0x50c3a3['length'];if(!_0xd5b95d[_0x5adb('0x28')][_0x5adb('0x3f')](_0x5adb('0x40'))){_0x4f5721[_0x5adb('0x12')]=qs[_0x5adb('0x12')](_0xd5b95d[_0x5adb('0x28')][_0x5adb('0x12')]);_0x4f5721[_0x5adb('0x11')]=qs[_0x5adb('0x11')](_0xd5b95d[_0x5adb('0x28')][_0x5adb('0x11')]);}return _0x227c17[_0x5adb('0x7d')](_0x4f5721);}})['then'](function(_0x364da7){if(_0x364da7){return _0x364da7?{'count':_0x5982a5,'rows':_0x364da7}:null;}})['then'](respondWithResult(_0x9d80fd,null))[_0x5adb('0x2a')](handleError(_0x9d80fd,null));}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.events.js b/server/api/smsQueue/smsQueue.events.js index dc766d8..ffdd406 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 _0x795e=['save','emit','hasOwnProperty','hook','exports','events','SmsQueue'];(function(_0x1ca29f,_0x318ac5){var _0x576c3b=function(_0x40caab){while(--_0x40caab){_0x1ca29f['push'](_0x1ca29f['shift']());}};_0x576c3b(++_0x318ac5);}(_0x795e,0x17f));var _0xe795=function(_0x57f751,_0x462c52){_0x57f751=_0x57f751-0x0;var _0x4d49a4=_0x795e[_0x57f751];return _0x4d49a4;};'use strict';var EventEmitter=require(_0xe795('0x0'));var SmsQueue=require('../../mysqldb')['db'][_0xe795('0x1')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xe795('0x2'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x8904e7){return function(_0x480c7d,_0x1a46e3,_0x157f45){SmsQueueEvents[_0xe795('0x3')](_0x8904e7+':'+_0x480c7d['id'],_0x480c7d);SmsQueueEvents[_0xe795('0x3')](_0x8904e7,_0x480c7d);_0x157f45(null);};}for(var e in events){if(events[_0xe795('0x4')](e)){var event=events[e];SmsQueue[_0xe795('0x5')](e,emitEvent(event));}}module[_0xe795('0x6')]=SmsQueueEvents; \ No newline at end of file +var _0x6baf=['save','update','remove','emit','hasOwnProperty','hook','events','../../mysqldb','SmsQueue','setMaxListeners'];(function(_0x37fcf0,_0x1ddfd5){var _0x951067=function(_0x9eb8c5){while(--_0x9eb8c5){_0x37fcf0['push'](_0x37fcf0['shift']());}};_0x951067(++_0x1ddfd5);}(_0x6baf,0x18c));var _0xf6ba=function(_0x28783c,_0x3ab93d){_0x28783c=_0x28783c-0x0;var _0x485651=_0x6baf[_0x28783c];return _0x485651;};'use strict';var EventEmitter=require(_0xf6ba('0x0'));var SmsQueue=require(_0xf6ba('0x1'))['db'][_0xf6ba('0x2')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0xf6ba('0x3')](0x0);var events={'afterCreate':_0xf6ba('0x4'),'afterUpdate':_0xf6ba('0x5'),'afterDestroy':_0xf6ba('0x6')};function emitEvent(_0x1006a5){return function(_0x43c408,_0x46de91,_0x1360d5){SmsQueueEvents[_0xf6ba('0x7')](_0x1006a5+':'+_0x43c408['id'],_0x43c408);SmsQueueEvents[_0xf6ba('0x7')](_0x1006a5,_0x43c408);_0x1360d5(null);};}for(var e in events){if(events[_0xf6ba('0x8')](e)){var event=events[e];SmsQueue[_0xf6ba('0x9')](e,emitEvent(event));}}module['exports']=SmsQueueEvents; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.model.js b/server/api/smsQueue/smsQueue.model.js index 0e77c2c..1f6b04f 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 _0x84da=['rimraf','../../config/environment','SmsQueue','lodash','util','../../config/logger','api','bluebird','request-promise','path'];(function(_0x3e2611,_0x6edf59){var _0x1c0f09=function(_0x38eb5e){while(--_0x38eb5e){_0x3e2611['push'](_0x3e2611['shift']());}};_0x1c0f09(++_0x6edf59);}(_0x84da,0xad));var _0xa84d=function(_0x1860c8,_0x201951){_0x1860c8=_0x1860c8-0x0;var _0x5914bf=_0x84da[_0x1860c8];return _0x5914bf;};'use strict';var _=require(_0xa84d('0x0'));var util=require(_0xa84d('0x1'));var logger=require(_0xa84d('0x2'))(_0xa84d('0x3'));var moment=require('moment');var BPromise=require(_0xa84d('0x4'));var rp=require(_0xa84d('0x5'));var fs=require('fs');var path=require(_0xa84d('0x6'));var rimraf=require(_0xa84d('0x7'));var config=require(_0xa84d('0x8'));var attributes=require('./smsQueue.attributes');module['exports']=function(_0x9ec75d,_0x57c92d){return _0x9ec75d['define'](_0xa84d('0x9'),attributes,{'tableName':'sms_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3f12=['sms_queues','lodash','../../config/logger','api','moment','bluebird','../../config/environment','exports','define'];(function(_0x1fc122,_0x5e2c17){var _0xa2cb13=function(_0x263b13){while(--_0x263b13){_0x1fc122['push'](_0x1fc122['shift']());}};_0xa2cb13(++_0x5e2c17);}(_0x3f12,0x121));var _0x23f1=function(_0x5095eb,_0x200c19){_0x5095eb=_0x5095eb-0x0;var _0x470780=_0x3f12[_0x5095eb];return _0x470780;};'use strict';var _=require(_0x23f1('0x0'));var util=require('util');var logger=require(_0x23f1('0x1'))(_0x23f1('0x2'));var moment=require(_0x23f1('0x3'));var BPromise=require(_0x23f1('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x23f1('0x5'));var attributes=require('./smsQueue.attributes');module[_0x23f1('0x6')]=function(_0x5bd86f,_0x4934bf){return _0x5bd86f[_0x23f1('0x7')]('SmsQueue',attributes,{'tableName':_0x23f1('0x8'),'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 5364a66..3e8a645 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 _0xcc9c=['code','message','result','catch','GetSmsQueue','SmsQueue','findAll','options','raw','where','limit','include','map','attributes','model','stringify','find','then','debug','ShowSmsQueue','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','redis','defaults','./smsQueue.socket','register','request','info','SmsQueue,\x20%s,\x20%s','request\x20sent','SmsQueue,\x20%s,\x20%s,\x20%s','error'];(function(_0x4f5e7a,_0x569bfd){var _0x2a9e22=function(_0x4e1da7){while(--_0x4e1da7){_0x4f5e7a['push'](_0x4f5e7a['shift']());}};_0x2a9e22(++_0x569bfd);}(_0xcc9c,0xb8));var _0xccc9=function(_0x1ccc3d,_0x248e34){_0x1ccc3d=_0x1ccc3d-0x0;var _0x242316=_0xcc9c[_0x1ccc3d];return _0x242316;};'use strict';var _=require(_0xccc9('0x0'));var util=require(_0xccc9('0x1'));var moment=require('moment');var BPromise=require(_0xccc9('0x2'));var rs=require(_0xccc9('0x3'));var fs=require('fs');var Redis=require(_0xccc9('0x4'));var db=require(_0xccc9('0x5'))['db'];var utils=require(_0xccc9('0x6'));var logger=require('../../config/logger')(_0xccc9('0x7'));var config=require(_0xccc9('0x8'));var jayson=require(_0xccc9('0x9'));var client=jayson['client'][_0xccc9('0xa')]({'port':0x232a});config[_0xccc9('0xb')]=_[_0xccc9('0xc')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xccc9('0xd'))[_0xccc9('0xe')](socket);function respondWithRpcPromise(_0x365244,_0x46e014,_0xc32faa){return new BPromise(function(_0x4017fa,_0x2c066d){return client[_0xccc9('0xf')](_0x365244,_0xc32faa)['then'](function(_0x10f397){logger[_0xccc9('0x10')](_0xccc9('0x11'),_0x46e014,_0xccc9('0x12'));logger['debug'](_0xccc9('0x13'),_0x46e014,'request\x20sent',JSON['stringify'](_0x10f397));if(_0x10f397[_0xccc9('0x14')]){if(_0x10f397['error'][_0xccc9('0x15')]===0x1f4){logger[_0xccc9('0x14')](_0xccc9('0x11'),_0x46e014,_0x10f397[_0xccc9('0x14')]['message']);return _0x2c066d(_0x10f397[_0xccc9('0x14')][_0xccc9('0x16')]);}logger['error']('SmsQueue,\x20%s,\x20%s',_0x46e014,_0x10f397['error'][_0xccc9('0x16')]);return _0x4017fa(_0x10f397[_0xccc9('0x14')][_0xccc9('0x16')]);}else{logger[_0xccc9('0x10')](_0xccc9('0x11'),_0x46e014,_0xccc9('0x12'));_0x4017fa(_0x10f397[_0xccc9('0x17')][_0xccc9('0x16')]);}})[_0xccc9('0x18')](function(_0x1ce0e5){logger[_0xccc9('0x14')]('SmsQueue,\x20%s,\x20%s',_0x46e014,_0x1ce0e5);_0x2c066d(_0x1ce0e5);});});}exports[_0xccc9('0x19')]=function(_0x465445){var _0x35cd4c=this;return new Promise(function(_0x39f8b4,_0x3c8f2b){return db[_0xccc9('0x1a')][_0xccc9('0x1b')]({'raw':_0x465445[_0xccc9('0x1c')]?_0x465445[_0xccc9('0x1c')][_0xccc9('0x1d')]===undefined?!![]:![]:!![],'where':_0x465445['options']?_0x465445[_0xccc9('0x1c')][_0xccc9('0x1e')]||null:null,'attributes':_0x465445[_0xccc9('0x1c')]?_0x465445[_0xccc9('0x1c')]['attributes']||null:null,'limit':_0x465445['options']?_0x465445[_0xccc9('0x1c')][_0xccc9('0x1f')]||null:null,'include':_0x465445[_0xccc9('0x1c')]?_0x465445[_0xccc9('0x1c')][_0xccc9('0x20')]?_[_0xccc9('0x21')](_0x465445['options']['include'],function(_0x44b32a){return{'model':db[_0x44b32a['model']],'as':_0x44b32a['as'],'attributes':_0x44b32a[_0xccc9('0x22')],'include':_0x44b32a['include']?_['map'](_0x44b32a[_0xccc9('0x20')],function(_0x1b54b0){return{'model':db[_0x1b54b0[_0xccc9('0x23')]],'as':_0x1b54b0['as'],'attributes':_0x1b54b0[_0xccc9('0x22')],'include':_0x1b54b0[_0xccc9('0x20')]?_[_0xccc9('0x21')](_0x1b54b0[_0xccc9('0x20')],function(_0x1bd6be){return{'model':db[_0x1bd6be[_0xccc9('0x23')]],'as':_0x1bd6be['as'],'attributes':_0x1bd6be[_0xccc9('0x22')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4c51ea){logger[_0xccc9('0x10')](_0xccc9('0x19'),_0x465445);logger['debug'](_0xccc9('0x19'),_0x465445,JSON[_0xccc9('0x24')](_0x4c51ea));_0x39f8b4(_0x4c51ea);})[_0xccc9('0x18')](function(_0x137f1f){logger[_0xccc9('0x14')]('GetSmsQueue',_0x137f1f[_0xccc9('0x16')],_0x465445);_0x3c8f2b(_0x35cd4c['error'](0x1f4,_0x137f1f['message']));});});};exports['ShowSmsQueue']=function(_0x46493c){var _0x2ad863=this;return new Promise(function(_0x34a4e3,_0x4e82f7){return db['SmsQueue'][_0xccc9('0x25')]({'raw':_0x46493c['options']?_0x46493c['options']['raw']===undefined?!![]:![]:!![],'where':_0x46493c['options']?_0x46493c[_0xccc9('0x1c')]['where']||null:null,'attributes':_0x46493c[_0xccc9('0x1c')]?_0x46493c[_0xccc9('0x1c')][_0xccc9('0x22')]||null:null,'include':_0x46493c['options']?_0x46493c[_0xccc9('0x1c')][_0xccc9('0x20')]?_[_0xccc9('0x21')](_0x46493c[_0xccc9('0x1c')][_0xccc9('0x20')],function(_0x5e0573){return{'model':db[_0x5e0573[_0xccc9('0x23')]],'as':_0x5e0573['as'],'attributes':_0x5e0573['attributes'],'include':_0x5e0573[_0xccc9('0x20')]?_['map'](_0x5e0573[_0xccc9('0x20')],function(_0x5829c2){return{'model':db[_0x5829c2[_0xccc9('0x23')]],'as':_0x5829c2['as'],'attributes':_0x5829c2[_0xccc9('0x22')],'include':_0x5829c2[_0xccc9('0x20')]?_[_0xccc9('0x21')](_0x5829c2['include'],function(_0x259a6a){return{'model':db[_0x259a6a['model']],'as':_0x259a6a['as'],'attributes':_0x259a6a[_0xccc9('0x22')]};}):[]};}):[]};}):[]:[]})[_0xccc9('0x26')](function(_0x5a4b6e){logger['info']('ShowSmsQueue',_0x46493c);logger[_0xccc9('0x27')]('ShowSmsQueue',_0x46493c,JSON[_0xccc9('0x24')](_0x5a4b6e));_0x34a4e3(_0x5a4b6e);})[_0xccc9('0x18')](function(_0x1f89a8){logger['error'](_0xccc9('0x28'),_0x1f89a8[_0xccc9('0x16')],_0x46493c);_0x4e82f7(_0x2ad863[_0xccc9('0x14')](0x1f4,_0x1f89a8[_0xccc9('0x16')]));});});}; \ No newline at end of file +var _0xba5c=['include','map','attributes','model','info','catch','ShowSmsQueue','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','localhost','socket.io-emitter','./smsQueue.socket','register','request','then','request\x20sent','debug','SmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','SmsQueue,\x20%s,\x20%s','message','result','GetSmsQueue','SmsQueue','findAll','options','raw','where','limit'];(function(_0x274b7d,_0x33957d){var _0x44d7b9=function(_0x1bc8cf){while(--_0x1bc8cf){_0x274b7d['push'](_0x274b7d['shift']());}};_0x44d7b9(++_0x33957d);}(_0xba5c,0x11f));var _0xcba5=function(_0x17e54d,_0x3de15b){_0x17e54d=_0x17e54d-0x0;var _0x3ebc87=_0xba5c[_0x17e54d];return _0x3ebc87;};'use strict';var _=require(_0xcba5('0x0'));var util=require('util');var moment=require(_0xcba5('0x1'));var BPromise=require(_0xcba5('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xcba5('0x3'));var db=require(_0xcba5('0x4'))['db'];var utils=require(_0xcba5('0x5'));var logger=require(_0xcba5('0x6'))(_0xcba5('0x7'));var config=require(_0xcba5('0x8'));var jayson=require(_0xcba5('0x9'));var client=jayson[_0xcba5('0xa')]['http']({'port':0x232a});config[_0xcba5('0xb')]=_['defaults'](config[_0xcba5('0xb')],{'host':_0xcba5('0xc'),'port':0x18eb});var socket=require(_0xcba5('0xd'))(new Redis(config[_0xcba5('0xb')]));require(_0xcba5('0xe'))[_0xcba5('0xf')](socket);function respondWithRpcPromise(_0x5b235a,_0xcea7cb,_0x55f8e3){return new BPromise(function(_0xc11267,_0x1230d5){return client[_0xcba5('0x10')](_0x5b235a,_0x55f8e3)[_0xcba5('0x11')](function(_0x35772a){logger['info']('SmsQueue,\x20%s,\x20%s',_0xcea7cb,_0xcba5('0x12'));logger[_0xcba5('0x13')](_0xcba5('0x14'),_0xcea7cb,_0xcba5('0x12'),JSON[_0xcba5('0x15')](_0x35772a));if(_0x35772a[_0xcba5('0x16')]){if(_0x35772a[_0xcba5('0x16')]['code']===0x1f4){logger['error'](_0xcba5('0x17'),_0xcea7cb,_0x35772a['error'][_0xcba5('0x18')]);return _0x1230d5(_0x35772a[_0xcba5('0x16')][_0xcba5('0x18')]);}logger[_0xcba5('0x16')]('SmsQueue,\x20%s,\x20%s',_0xcea7cb,_0x35772a['error'][_0xcba5('0x18')]);return _0xc11267(_0x35772a[_0xcba5('0x16')]['message']);}else{logger['info'](_0xcba5('0x17'),_0xcea7cb,_0xcba5('0x12'));_0xc11267(_0x35772a[_0xcba5('0x19')][_0xcba5('0x18')]);}})['catch'](function(_0x2a1a56){logger['error'](_0xcba5('0x17'),_0xcea7cb,_0x2a1a56);_0x1230d5(_0x2a1a56);});});}exports[_0xcba5('0x1a')]=function(_0x6feeb6){var _0x1c78a7=this;return new Promise(function(_0xb4dee6,_0x2835fd){return db[_0xcba5('0x1b')][_0xcba5('0x1c')]({'raw':_0x6feeb6[_0xcba5('0x1d')]?_0x6feeb6[_0xcba5('0x1d')][_0xcba5('0x1e')]===undefined?!![]:![]:!![],'where':_0x6feeb6['options']?_0x6feeb6[_0xcba5('0x1d')][_0xcba5('0x1f')]||null:null,'attributes':_0x6feeb6['options']?_0x6feeb6[_0xcba5('0x1d')]['attributes']||null:null,'limit':_0x6feeb6['options']?_0x6feeb6[_0xcba5('0x1d')][_0xcba5('0x20')]||null:null,'include':_0x6feeb6[_0xcba5('0x1d')]?_0x6feeb6[_0xcba5('0x1d')][_0xcba5('0x21')]?_[_0xcba5('0x22')](_0x6feeb6[_0xcba5('0x1d')][_0xcba5('0x21')],function(_0x44fe10){return{'model':db[_0x44fe10['model']],'as':_0x44fe10['as'],'attributes':_0x44fe10[_0xcba5('0x23')],'include':_0x44fe10[_0xcba5('0x21')]?_['map'](_0x44fe10[_0xcba5('0x21')],function(_0x4216a9){return{'model':db[_0x4216a9[_0xcba5('0x24')]],'as':_0x4216a9['as'],'attributes':_0x4216a9[_0xcba5('0x23')],'include':_0x4216a9['include']?_[_0xcba5('0x22')](_0x4216a9[_0xcba5('0x21')],function(_0x251e0b){return{'model':db[_0x251e0b[_0xcba5('0x24')]],'as':_0x251e0b['as'],'attributes':_0x251e0b['attributes']};}):[]};}):[]};}):[]:[]})[_0xcba5('0x11')](function(_0x3d233a){logger[_0xcba5('0x25')](_0xcba5('0x1a'),_0x6feeb6);logger[_0xcba5('0x13')](_0xcba5('0x1a'),_0x6feeb6,JSON[_0xcba5('0x15')](_0x3d233a));_0xb4dee6(_0x3d233a);})[_0xcba5('0x26')](function(_0x120e1b){logger[_0xcba5('0x16')](_0xcba5('0x1a'),_0x120e1b[_0xcba5('0x18')],_0x6feeb6);_0x2835fd(_0x1c78a7[_0xcba5('0x16')](0x1f4,_0x120e1b[_0xcba5('0x18')]));});});};exports[_0xcba5('0x27')]=function(_0x5960b5){var _0x556dcd=this;return new Promise(function(_0xb95a38,_0x535308){return db[_0xcba5('0x1b')]['find']({'raw':_0x5960b5['options']?_0x5960b5[_0xcba5('0x1d')][_0xcba5('0x1e')]===undefined?!![]:![]:!![],'where':_0x5960b5['options']?_0x5960b5[_0xcba5('0x1d')]['where']||null:null,'attributes':_0x5960b5[_0xcba5('0x1d')]?_0x5960b5[_0xcba5('0x1d')][_0xcba5('0x23')]||null:null,'include':_0x5960b5[_0xcba5('0x1d')]?_0x5960b5[_0xcba5('0x1d')][_0xcba5('0x21')]?_[_0xcba5('0x22')](_0x5960b5[_0xcba5('0x1d')][_0xcba5('0x21')],function(_0x1849ab){return{'model':db[_0x1849ab[_0xcba5('0x24')]],'as':_0x1849ab['as'],'attributes':_0x1849ab[_0xcba5('0x23')],'include':_0x1849ab[_0xcba5('0x21')]?_['map'](_0x1849ab[_0xcba5('0x21')],function(_0x3afc15){return{'model':db[_0x3afc15[_0xcba5('0x24')]],'as':_0x3afc15['as'],'attributes':_0x3afc15[_0xcba5('0x23')],'include':_0x3afc15[_0xcba5('0x21')]?_[_0xcba5('0x22')](_0x3afc15['include'],function(_0x51506d){return{'model':db[_0x51506d[_0xcba5('0x24')]],'as':_0x51506d['as'],'attributes':_0x51506d['attributes']};}):[]};}):[]};}):[]:[]})[_0xcba5('0x11')](function(_0x959f79){logger['info']('ShowSmsQueue',_0x5960b5);logger[_0xcba5('0x13')](_0xcba5('0x27'),_0x5960b5,JSON[_0xcba5('0x15')](_0x959f79));_0xb95a38(_0x959f79);})[_0xcba5('0x26')](function(_0x9ae967){logger['error'](_0xcba5('0x27'),_0x9ae967[_0xcba5('0x18')],_0x5960b5);_0x535308(_0x556dcd[_0xcba5('0x16')](0x1f4,_0x9ae967['message']));});});}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.socket.js b/server/api/smsQueue/smsQueue.socket.js index a492c6c..2b3ca39 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 _0x0414=['update','removeListener','register','length','smsQueue:','./smsQueue.events','save','remove'];(function(_0x369289,_0xb779d8){var _0x1c8ba4=function(_0x28cc27){while(--_0x28cc27){_0x369289['push'](_0x369289['shift']());}};_0x1c8ba4(++_0xb779d8);}(_0x0414,0x9d));var _0x4041=function(_0x2a276d,_0x482b0c){_0x2a276d=_0x2a276d-0x0;var _0x2914cd=_0x0414[_0x2a276d];return _0x2914cd;};'use strict';var SmsQueueEvents=require(_0x4041('0x0'));var events=[_0x4041('0x1'),_0x4041('0x2'),_0x4041('0x3')];function createListener(_0x598666,_0x3b5c2f){return function(_0x2541cd){_0x3b5c2f['emit'](_0x598666,_0x2541cd);};}function removeListener(_0x5dbbd5,_0x173908){return function(){SmsQueueEvents[_0x4041('0x4')](_0x5dbbd5,_0x173908);};}exports[_0x4041('0x5')]=function(_0x2e23c4){for(var _0x2884c7=0x0,_0x47c27d=events[_0x4041('0x6')];_0x2884c7<_0x47c27d;_0x2884c7++){var _0x2296a7=events[_0x2884c7];var _0x15645c=createListener(_0x4041('0x7')+_0x2296a7,_0x2e23c4);SmsQueueEvents['on'](_0x2296a7,_0x15645c);}}; \ No newline at end of file +var _0xdecf=['./smsQueue.events','remove','update','emit','register','length'];(function(_0x4004f6,_0x465910){var _0x9e0ee8=function(_0x4e47d2){while(--_0x4e47d2){_0x4004f6['push'](_0x4004f6['shift']());}};_0x9e0ee8(++_0x465910);}(_0xdecf,0x198));var _0xfdec=function(_0x303d98,_0x39ffb2){_0x303d98=_0x303d98-0x0;var _0x3ac40e=_0xdecf[_0x303d98];return _0x3ac40e;};'use strict';var SmsQueueEvents=require(_0xfdec('0x0'));var events=['save',_0xfdec('0x1'),_0xfdec('0x2')];function createListener(_0x35584d,_0x11388c){return function(_0x40c64d){_0x11388c[_0xfdec('0x3')](_0x35584d,_0x40c64d);};}function removeListener(_0x2f3e8a,_0x21c031){return function(){SmsQueueEvents['removeListener'](_0x2f3e8a,_0x21c031);};}exports[_0xfdec('0x4')]=function(_0x4defc0){for(var _0x388198=0x0,_0x483889=events[_0xfdec('0x5')];_0x388198<_0x483889;_0x388198++){var _0x1e4a63=events[_0x388198];var _0x31762e=createListener('smsQueue:'+_0x1e4a63,_0x4defc0);SmsQueueEvents['on'](_0x1e4a63,_0x31762e);}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/index.js b/server/api/smsQueueReport/index.js index e2c01c9..5c9d8ed 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 _0xdba3=['util','path','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','post','create','put','destroy','multer'];(function(_0xd158dc,_0x128608){var _0x12d25f=function(_0x2e9d2b){while(--_0x2e9d2b){_0xd158dc['push'](_0xd158dc['shift']());}};_0x12d25f(++_0x128608);}(_0xdba3,0xbf));var _0x3dba=function(_0xea8262,_0x43101b){_0xea8262=_0xea8262-0x0;var _0xf53136=_0xdba3[_0xea8262];return _0xf53136;};'use strict';var multer=require(_0x3dba('0x0'));var util=require(_0x3dba('0x1'));var path=require(_0x3dba('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x3dba('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x3dba('0x4'));var config=require(_0x3dba('0x5'));var controller=require('./smsQueueReport.controller');router[_0x3dba('0x6')]('/',auth[_0x3dba('0x7')](),controller[_0x3dba('0x8')]);router[_0x3dba('0x6')](_0x3dba('0x9'),auth[_0x3dba('0x7')](),controller[_0x3dba('0xa')]);router[_0x3dba('0x6')](_0x3dba('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x3dba('0xc')]('/',auth['isAuthenticated'](),controller[_0x3dba('0xd')]);router[_0x3dba('0xe')](_0x3dba('0xb'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x3dba('0xb'),auth['isAuthenticated'](),controller[_0x3dba('0xf')]);module['exports']=router; \ No newline at end of file +var _0x1ee8=['get','/:id','show','put','destroy','util','express','Router','fs-extra','../../config/environment','./smsQueueReport.controller','isAuthenticated','index'];(function(_0x216f34,_0x52578e){var _0x4128af=function(_0xd6d744){while(--_0xd6d744){_0x216f34['push'](_0x216f34['shift']());}};_0x4128af(++_0x52578e);}(_0x1ee8,0x6d));var _0x81ee=function(_0x4288a6,_0x2d8b09){_0x4288a6=_0x4288a6-0x0;var _0x3cae9e=_0x1ee8[_0x4288a6];return _0x3cae9e;};'use strict';var multer=require('multer');var util=require(_0x81ee('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x81ee('0x1'));var router=express[_0x81ee('0x2')]();var fs_extra=require(_0x81ee('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x81ee('0x4'));var controller=require(_0x81ee('0x5'));router['get']('/',auth[_0x81ee('0x6')](),controller[_0x81ee('0x7')]);router[_0x81ee('0x8')]('/describe',auth[_0x81ee('0x6')](),controller['describe']);router[_0x81ee('0x8')](_0x81ee('0x9'),auth[_0x81ee('0x6')](),controller[_0x81ee('0xa')]);router['post']('/',auth[_0x81ee('0x6')](),controller['create']);router[_0x81ee('0xb')](_0x81ee('0x9'),auth[_0x81ee('0x6')](),controller['update']);router['delete'](_0x81ee('0x9'),auth['isAuthenticated'](),controller[_0x81ee('0xc')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.attributes.js b/server/api/smsQueueReport/smsQueueReport.attributes.js index 4e940e6..2299bb1 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 _0x12a2=['sequelize','exports','STRING','DATE','moment'];(function(_0x4064a3,_0x21ec33){var _0x3c68af=function(_0x3fe047){while(--_0x3fe047){_0x4064a3['push'](_0x4064a3['shift']());}};_0x3c68af(++_0x21ec33);}(_0x12a2,0xf4));var _0x212a=function(_0x29bb95,_0x2989d4){_0x29bb95=_0x29bb95-0x0;var _0x413a1d=_0x12a2[_0x29bb95];return _0x413a1d;};'use strict';var moment=require(_0x212a('0x0'));var Sequelize=require(_0x212a('0x1'));module[_0x212a('0x2')]={'uniqueid':{'type':Sequelize[_0x212a('0x3')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x212a('0x4')]},'leaveAt':{'type':Sequelize[_0x212a('0x4')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x212a('0x4')]},'reason':{'type':Sequelize[_0x212a('0x3')]}}; \ No newline at end of file +var _0xd803=['DATE','moment','sequelize','exports','STRING'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0xd803,0x114));var _0x3d80=function(_0x1e4513,_0x4b67b7){_0x1e4513=_0x1e4513-0x0;var _0x4eebe9=_0xd803[_0x1e4513];return _0x4eebe9;};'use strict';var moment=require(_0x3d80('0x0'));var Sequelize=require(_0x3d80('0x1'));module[_0x3d80('0x2')]={'uniqueid':{'type':Sequelize[_0x3d80('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x3d80('0x3')]},'joinAt':{'type':Sequelize[_0x3d80('0x4')]},'leaveAt':{'type':Sequelize[_0x3d80('0x4')]},'acceptAt':{'type':Sequelize[_0x3d80('0x4')]},'exitAt':{'type':Sequelize[_0x3d80('0x4')]},'reason':{'type':Sequelize[_0x3d80('0x3')]}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.controller.js b/server/api/smsQueueReport/smsQueueReport.controller.js index 6389d85..feffeb0 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 _0x1ae6=['sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','count','offset','set','Content-Range','json','apply','reject','save','then','error','stack','name','send','index','SmsQueueReport','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','nolimit','limit','sort','where','filters','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','options','find','create','body','update','destroy','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util'];(function(_0x38a241,_0x483224){var _0x384ee4=function(_0x1b741b){while(--_0x1b741b){_0x38a241['push'](_0x38a241['shift']());}};_0x384ee4(++_0x483224);}(_0x1ae6,0x94));var _0x61ae=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0x1ae6[_0x1035c1];return _0x308d67;};'use strict';var emlformat=require(_0x61ae('0x0'));var rimraf=require(_0x61ae('0x1'));var zipdir=require(_0x61ae('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x61ae('0x3'));var moment=require(_0x61ae('0x4'));var BPromise=require(_0x61ae('0x5'));var Mustache=require(_0x61ae('0x6'));var util=require(_0x61ae('0x7'));var path=require('path');var sox=require(_0x61ae('0x8'));var csv=require(_0x61ae('0x9'));var ejs=require(_0x61ae('0xa'));var fs=require('fs');var fs_extra=require(_0x61ae('0xb'));var _=require(_0x61ae('0xc'));var squel=require(_0x61ae('0xd'));var crypto=require(_0x61ae('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x61ae('0xf'));var toCsv=require(_0x61ae('0x9'));var querystring=require(_0x61ae('0x10'));var Papa=require('papaparse');var Redis=require(_0x61ae('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x61ae('0x12'));var as=require(_0x61ae('0x13'));var hardwareService=require(_0x61ae('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x61ae('0x15'));var config=require(_0x61ae('0x16'));var licenseUtil=require(_0x61ae('0x17'));var db=require(_0x61ae('0x18'))['db'];function respondWithStatusCode(_0x31e4ce,_0x42f5ad){_0x42f5ad=_0x42f5ad||0xcc;return function(_0x46d0e0){if(_0x46d0e0){return _0x31e4ce[_0x61ae('0x19')](_0x42f5ad);}return _0x31e4ce[_0x61ae('0x1a')](_0x42f5ad)[_0x61ae('0x1b')]();};}function respondWithResult(_0x1c1650,_0x378681){_0x378681=_0x378681||0xc8;return function(_0x528b2e){if(_0x528b2e){return _0x1c1650[_0x61ae('0x1a')](_0x378681)['json'](_0x528b2e);}};}function respondWithFilteredResult(_0x2ffacb,_0x596f23){return function(_0x48ad7d){if(_0x48ad7d){var _0x3dfb89=typeof _0x596f23['offset']===_0x61ae('0x1c')&&typeof _0x596f23['limit']===_0x61ae('0x1c');var _0x51db50=_0x48ad7d[_0x61ae('0x1d')];var _0x37d037=_0x3dfb89?0x0:_0x596f23['offset'];var _0x41be9f=_0x3dfb89?_0x48ad7d[_0x61ae('0x1d')]:_0x596f23[_0x61ae('0x1e')]+_0x596f23['limit'];var _0x4918f3;if(_0x41be9f>=_0x51db50){_0x41be9f=_0x51db50;_0x4918f3=0xc8;}else{_0x4918f3=0xce;}_0x2ffacb[_0x61ae('0x1a')](_0x4918f3);return _0x2ffacb[_0x61ae('0x1f')](_0x61ae('0x20'),_0x37d037+'-'+_0x41be9f+'/'+_0x51db50)[_0x61ae('0x21')](_0x48ad7d);}return null;};}function patchUpdates(_0x4d63a1){return function(_0x2dc9b1){try{jsonpatch[_0x61ae('0x22')](_0x2dc9b1,_0x4d63a1,!![]);}catch(_0x68c0e1){return BPromise[_0x61ae('0x23')](_0x68c0e1);}return _0x2dc9b1[_0x61ae('0x24')]();};}function saveUpdates(_0x395515,_0x1102f9){return function(_0x4a9ade){if(_0x4a9ade){return _0x4a9ade['update'](_0x395515)[_0x61ae('0x25')](function(_0x4aa170){return _0x4aa170;});}return null;};}function removeEntity(_0x4b9105,_0x4fa09c){return function(_0x54d798){if(_0x54d798){return _0x54d798['destroy']()[_0x61ae('0x25')](function(){_0x4b9105['status'](0xcc)[_0x61ae('0x1b')]();});}};}function handleEntityNotFound(_0x99f829,_0xf477e3){return function(_0x103765){if(!_0x103765){_0x99f829[_0x61ae('0x19')](0x194);}return _0x103765;};}function handleError(_0x742ef4,_0x194ca0){_0x194ca0=_0x194ca0||0x1f4;return function(_0x266008){logger[_0x61ae('0x26')](_0x266008[_0x61ae('0x27')]);if(_0x266008['name']){delete _0x266008[_0x61ae('0x28')];}_0x742ef4['status'](_0x194ca0)[_0x61ae('0x29')](_0x266008);};}exports[_0x61ae('0x2a')]=function(_0x482483,_0x5f0b82){var _0x575630={},_0x1a7c4a={},_0x273568={'count':0x0,'rows':[]};var _0x283212=_['map'](db[_0x61ae('0x2b')][_0x61ae('0x2c')],function(_0x4db724){return{'name':_0x4db724[_0x61ae('0x2d')],'type':_0x4db724[_0x61ae('0x2e')][_0x61ae('0x2f')]};});_0x1a7c4a[_0x61ae('0x30')]=_['map'](_0x283212,_0x61ae('0x28'));_0x1a7c4a[_0x61ae('0x31')]=_[_0x61ae('0x32')](_0x482483['query']);_0x1a7c4a['filters']=_['intersection'](_0x1a7c4a['model'],_0x1a7c4a[_0x61ae('0x31')]);_0x575630['attributes']=_[_0x61ae('0x33')](_0x1a7c4a['model'],qs[_0x61ae('0x34')](_0x482483[_0x61ae('0x31')][_0x61ae('0x34')]));_0x575630[_0x61ae('0x35')]=_0x575630[_0x61ae('0x35')][_0x61ae('0x36')]?_0x575630['attributes']:_0x1a7c4a['model'];if(!_0x482483[_0x61ae('0x31')]['hasOwnProperty'](_0x61ae('0x37'))){_0x575630[_0x61ae('0x38')]=qs[_0x61ae('0x38')](_0x482483['query'][_0x61ae('0x38')]);_0x575630[_0x61ae('0x1e')]=qs[_0x61ae('0x1e')](_0x482483['query'][_0x61ae('0x1e')]);}_0x575630['order']=qs[_0x61ae('0x39')](_0x482483['query'][_0x61ae('0x39')]);_0x575630[_0x61ae('0x3a')]=qs[_0x61ae('0x3b')](_[_0x61ae('0x3c')](_0x482483['query'],_0x1a7c4a['filters']),_0x283212);if(_0x482483[_0x61ae('0x31')][_0x61ae('0x3d')]){_0x575630[_0x61ae('0x3a')]=_[_0x61ae('0x3e')](_0x575630[_0x61ae('0x3a')],{'$or':_['map'](_0x283212,function(_0x26f032){if(_0x26f032[_0x61ae('0x2e')]!==_0x61ae('0x3f')){var _0xc0ba47={};_0xc0ba47[_0x26f032[_0x61ae('0x28')]]={'$like':'%'+_0x482483['query'][_0x61ae('0x3d')]+'%'};return _0xc0ba47;}})});}_0x575630=_[_0x61ae('0x3e')]({},_0x575630,_0x482483['options']);var _0x53136d={'where':_0x575630[_0x61ae('0x3a')]};return db[_0x61ae('0x2b')][_0x61ae('0x1d')](_0x53136d)[_0x61ae('0x25')](function(_0x3685f5){_0x273568['count']=_0x3685f5;if(_0x482483['query'][_0x61ae('0x40')]){_0x575630[_0x61ae('0x41')]=[{'all':!![]}];}return db['SmsQueueReport'][_0x61ae('0x42')](_0x575630);})['then'](function(_0x100083){_0x273568[_0x61ae('0x43')]=_0x100083;return _0x273568;})[_0x61ae('0x25')](respondWithFilteredResult(_0x5f0b82,_0x575630))[_0x61ae('0x44')](handleError(_0x5f0b82,null));};exports[_0x61ae('0x45')]=function(_0x36d18c,_0xc64bd4){var _0x2bf453={'raw':!![],'where':{'id':_0x36d18c[_0x61ae('0x46')]['id']}},_0x27b9b4={};_0x27b9b4['model']=_[_0x61ae('0x32')](db[_0x61ae('0x2b')][_0x61ae('0x2c')]);_0x27b9b4[_0x61ae('0x31')]=_[_0x61ae('0x32')](_0x36d18c[_0x61ae('0x31')]);_0x27b9b4['filters']=_[_0x61ae('0x33')](_0x27b9b4[_0x61ae('0x30')],_0x27b9b4[_0x61ae('0x31')]);_0x2bf453[_0x61ae('0x35')]=_[_0x61ae('0x33')](_0x27b9b4[_0x61ae('0x30')],qs[_0x61ae('0x34')](_0x36d18c[_0x61ae('0x31')][_0x61ae('0x34')]));_0x2bf453[_0x61ae('0x35')]=_0x2bf453['attributes']['length']?_0x2bf453[_0x61ae('0x35')]:_0x27b9b4[_0x61ae('0x30')];if(_0x36d18c[_0x61ae('0x31')][_0x61ae('0x40')]){_0x2bf453[_0x61ae('0x41')]=[{'all':!![]}];}_0x2bf453=_[_0x61ae('0x3e')]({},_0x2bf453,_0x36d18c[_0x61ae('0x47')]);return db[_0x61ae('0x2b')][_0x61ae('0x48')](_0x2bf453)['then'](handleEntityNotFound(_0xc64bd4,null))['then'](respondWithResult(_0xc64bd4,null))['catch'](handleError(_0xc64bd4,null));};exports['create']=function(_0x234bb9,_0x258991){return db[_0x61ae('0x2b')][_0x61ae('0x49')](_0x234bb9[_0x61ae('0x4a')],{})[_0x61ae('0x25')](respondWithResult(_0x258991,0xc9))[_0x61ae('0x44')](handleError(_0x258991,null));};exports[_0x61ae('0x4b')]=function(_0x4c1db8,_0x29bc0d){if(_0x4c1db8[_0x61ae('0x4a')]['id']){delete _0x4c1db8[_0x61ae('0x4a')]['id'];}return db['SmsQueueReport'][_0x61ae('0x48')]({'where':{'id':_0x4c1db8[_0x61ae('0x46')]['id']}})[_0x61ae('0x25')](handleEntityNotFound(_0x29bc0d,null))[_0x61ae('0x25')](saveUpdates(_0x4c1db8[_0x61ae('0x4a')],null))[_0x61ae('0x25')](respondWithResult(_0x29bc0d,null))['catch'](handleError(_0x29bc0d,null));};exports[_0x61ae('0x4c')]=function(_0x377f2d,_0x3f1e32){return db[_0x61ae('0x2b')]['find']({'where':{'id':_0x377f2d[_0x61ae('0x46')]['id']}})[_0x61ae('0x25')](handleEntityNotFound(_0x3f1e32,null))[_0x61ae('0x25')](removeEntity(_0x3f1e32,null))[_0x61ae('0x44')](handleError(_0x3f1e32,null));};exports[_0x61ae('0x4d')]=function(_0x48d595,_0x4673d7){return db[_0x61ae('0x2b')]['describe']()[_0x61ae('0x25')](respondWithResult(_0x4673d7,null))[_0x61ae('0x44')](handleError(_0x4673d7,null));}; \ No newline at end of file +var _0x1592=['jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','save','destroy','then','error','stack','name','send','index','map','SmsQueueReport','rawAttributes','query','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','options','includeAll','include','rows','params','keys','find','catch','create','body','update','describe','zip-dir','request-promise','bluebird','util','path','sox','to-csv','fs-extra','lodash'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x1592,0x150));var _0x2159=function(_0x2c1e41,_0x45ce7){_0x2c1e41=_0x2c1e41-0x0;var _0x96cca2=_0x1592[_0x2c1e41];return _0x96cca2;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x2159('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2159('0x1'));var moment=require('moment');var BPromise=require(_0x2159('0x2'));var Mustache=require('mustache');var util=require(_0x2159('0x3'));var path=require(_0x2159('0x4'));var sox=require(_0x2159('0x5'));var csv=require(_0x2159('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2159('0x7'));var _=require(_0x2159('0x8'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x2159('0x9'));var deskjs=require('desk.js');var toCsv=require(_0x2159('0x6'));var querystring=require('querystring');var Papa=require(_0x2159('0xa'));var Redis=require(_0x2159('0xb'));var authService=require(_0x2159('0xc'));var qs=require(_0x2159('0xd'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2159('0xe'));var logger=require('../../config/logger')('api');var utils=require(_0x2159('0xf'));var config=require(_0x2159('0x10'));var licenseUtil=require(_0x2159('0x11'));var db=require(_0x2159('0x12'))['db'];function respondWithStatusCode(_0x1ae02d,_0x2c8482){_0x2c8482=_0x2c8482||0xcc;return function(_0x59bde4){if(_0x59bde4){return _0x1ae02d[_0x2159('0x13')](_0x2c8482);}return _0x1ae02d[_0x2159('0x14')](_0x2c8482)[_0x2159('0x15')]();};}function respondWithResult(_0x178157,_0x517831){_0x517831=_0x517831||0xc8;return function(_0x5595b6){if(_0x5595b6){return _0x178157[_0x2159('0x14')](_0x517831)[_0x2159('0x16')](_0x5595b6);}};}function respondWithFilteredResult(_0x535eff,_0x3c244d){return function(_0x460b80){if(_0x460b80){var _0x229731=typeof _0x3c244d[_0x2159('0x17')]==='undefined'&&typeof _0x3c244d[_0x2159('0x18')]===_0x2159('0x19');var _0x34cec1=_0x460b80['count'];var _0x22bf37=_0x229731?0x0:_0x3c244d['offset'];var _0x574e3=_0x229731?_0x460b80[_0x2159('0x1a')]:_0x3c244d['offset']+_0x3c244d[_0x2159('0x18')];var _0x343764;if(_0x574e3>=_0x34cec1){_0x574e3=_0x34cec1;_0x343764=0xc8;}else{_0x343764=0xce;}_0x535eff[_0x2159('0x14')](_0x343764);return _0x535eff[_0x2159('0x1b')](_0x2159('0x1c'),_0x22bf37+'-'+_0x574e3+'/'+_0x34cec1)[_0x2159('0x16')](_0x460b80);}return null;};}function patchUpdates(_0x4114cb){return function(_0x3685b0){try{jsonpatch[_0x2159('0x1d')](_0x3685b0,_0x4114cb,!![]);}catch(_0x1cc71a){return BPromise['reject'](_0x1cc71a);}return _0x3685b0[_0x2159('0x1e')]();};}function saveUpdates(_0x7dffa7,_0x3f2ec5){return function(_0x5d3193){if(_0x5d3193){return _0x5d3193['update'](_0x7dffa7)['then'](function(_0x11ea39){return _0x11ea39;});}return null;};}function removeEntity(_0x4acf15,_0xebb201){return function(_0xd9f772){if(_0xd9f772){return _0xd9f772[_0x2159('0x1f')]()[_0x2159('0x20')](function(){_0x4acf15[_0x2159('0x14')](0xcc)[_0x2159('0x15')]();});}};}function handleEntityNotFound(_0x473226,_0x4da226){return function(_0x5b61ec){if(!_0x5b61ec){_0x473226[_0x2159('0x13')](0x194);}return _0x5b61ec;};}function handleError(_0x2de475,_0x218331){_0x218331=_0x218331||0x1f4;return function(_0x4b24e7){logger[_0x2159('0x21')](_0x4b24e7[_0x2159('0x22')]);if(_0x4b24e7[_0x2159('0x23')]){delete _0x4b24e7[_0x2159('0x23')];}_0x2de475[_0x2159('0x14')](_0x218331)[_0x2159('0x24')](_0x4b24e7);};}exports[_0x2159('0x25')]=function(_0x110a3f,_0x11b948){var _0x41b790={},_0x175d3a={},_0x36d32a={'count':0x0,'rows':[]};var _0x11745f=_[_0x2159('0x26')](db[_0x2159('0x27')][_0x2159('0x28')],function(_0x487f6b){return{'name':_0x487f6b['fieldName'],'type':_0x487f6b['type']['key']};});_0x175d3a['model']=_['map'](_0x11745f,'name');_0x175d3a[_0x2159('0x29')]=_['keys'](_0x110a3f[_0x2159('0x29')]);_0x175d3a[_0x2159('0x2a')]=_['intersection'](_0x175d3a[_0x2159('0x2b')],_0x175d3a[_0x2159('0x29')]);_0x41b790[_0x2159('0x2c')]=_[_0x2159('0x2d')](_0x175d3a[_0x2159('0x2b')],qs[_0x2159('0x2e')](_0x110a3f['query'][_0x2159('0x2e')]));_0x41b790[_0x2159('0x2c')]=_0x41b790[_0x2159('0x2c')][_0x2159('0x2f')]?_0x41b790[_0x2159('0x2c')]:_0x175d3a['model'];if(!_0x110a3f[_0x2159('0x29')][_0x2159('0x30')](_0x2159('0x31'))){_0x41b790['limit']=qs[_0x2159('0x18')](_0x110a3f[_0x2159('0x29')][_0x2159('0x18')]);_0x41b790[_0x2159('0x17')]=qs[_0x2159('0x17')](_0x110a3f[_0x2159('0x29')]['offset']);}_0x41b790[_0x2159('0x32')]=qs[_0x2159('0x33')](_0x110a3f[_0x2159('0x29')][_0x2159('0x33')]);_0x41b790[_0x2159('0x34')]=qs['filters'](_[_0x2159('0x35')](_0x110a3f['query'],_0x175d3a[_0x2159('0x2a')]),_0x11745f);if(_0x110a3f[_0x2159('0x29')][_0x2159('0x36')]){_0x41b790[_0x2159('0x34')]=_[_0x2159('0x37')](_0x41b790[_0x2159('0x34')],{'$or':_[_0x2159('0x26')](_0x11745f,function(_0x1f971a){if(_0x1f971a[_0x2159('0x38')]!=='VIRTUAL'){var _0x28c588={};_0x28c588[_0x1f971a[_0x2159('0x23')]]={'$like':'%'+_0x110a3f[_0x2159('0x29')][_0x2159('0x36')]+'%'};return _0x28c588;}})});}_0x41b790=_[_0x2159('0x37')]({},_0x41b790,_0x110a3f[_0x2159('0x39')]);var _0x411ca0={'where':_0x41b790[_0x2159('0x34')]};return db[_0x2159('0x27')]['count'](_0x411ca0)[_0x2159('0x20')](function(_0x2760ec){_0x36d32a[_0x2159('0x1a')]=_0x2760ec;if(_0x110a3f[_0x2159('0x29')][_0x2159('0x3a')]){_0x41b790[_0x2159('0x3b')]=[{'all':!![]}];}return db[_0x2159('0x27')]['findAll'](_0x41b790);})[_0x2159('0x20')](function(_0x30fef0){_0x36d32a[_0x2159('0x3c')]=_0x30fef0;return _0x36d32a;})['then'](respondWithFilteredResult(_0x11b948,_0x41b790))['catch'](handleError(_0x11b948,null));};exports['show']=function(_0xf901aa,_0x1ca519){var _0x5bf24c={'raw':!![],'where':{'id':_0xf901aa[_0x2159('0x3d')]['id']}},_0x35e35a={};_0x35e35a[_0x2159('0x2b')]=_[_0x2159('0x3e')](db['SmsQueueReport'][_0x2159('0x28')]);_0x35e35a[_0x2159('0x29')]=_[_0x2159('0x3e')](_0xf901aa[_0x2159('0x29')]);_0x35e35a['filters']=_['intersection'](_0x35e35a[_0x2159('0x2b')],_0x35e35a[_0x2159('0x29')]);_0x5bf24c[_0x2159('0x2c')]=_[_0x2159('0x2d')](_0x35e35a[_0x2159('0x2b')],qs['fields'](_0xf901aa[_0x2159('0x29')][_0x2159('0x2e')]));_0x5bf24c[_0x2159('0x2c')]=_0x5bf24c[_0x2159('0x2c')][_0x2159('0x2f')]?_0x5bf24c[_0x2159('0x2c')]:_0x35e35a['model'];if(_0xf901aa['query'][_0x2159('0x3a')]){_0x5bf24c[_0x2159('0x3b')]=[{'all':!![]}];}_0x5bf24c=_['merge']({},_0x5bf24c,_0xf901aa[_0x2159('0x39')]);return db['SmsQueueReport'][_0x2159('0x3f')](_0x5bf24c)[_0x2159('0x20')](handleEntityNotFound(_0x1ca519,null))[_0x2159('0x20')](respondWithResult(_0x1ca519,null))[_0x2159('0x40')](handleError(_0x1ca519,null));};exports[_0x2159('0x41')]=function(_0x526664,_0x3e1c55){return db[_0x2159('0x27')][_0x2159('0x41')](_0x526664[_0x2159('0x42')],{})[_0x2159('0x20')](respondWithResult(_0x3e1c55,0xc9))['catch'](handleError(_0x3e1c55,null));};exports[_0x2159('0x43')]=function(_0xb184a8,_0x2039a3){if(_0xb184a8[_0x2159('0x42')]['id']){delete _0xb184a8[_0x2159('0x42')]['id'];}return db['SmsQueueReport'][_0x2159('0x3f')]({'where':{'id':_0xb184a8[_0x2159('0x3d')]['id']}})[_0x2159('0x20')](handleEntityNotFound(_0x2039a3,null))[_0x2159('0x20')](saveUpdates(_0xb184a8[_0x2159('0x42')],null))['then'](respondWithResult(_0x2039a3,null))[_0x2159('0x40')](handleError(_0x2039a3,null));};exports[_0x2159('0x1f')]=function(_0x5e7b6c,_0x581bdf){return db[_0x2159('0x27')]['find']({'where':{'id':_0x5e7b6c[_0x2159('0x3d')]['id']}})[_0x2159('0x20')](handleEntityNotFound(_0x581bdf,null))[_0x2159('0x20')](removeEntity(_0x581bdf,null))[_0x2159('0x40')](handleError(_0x581bdf,null));};exports[_0x2159('0x44')]=function(_0x57e4ef,_0x5c0bdb){return db[_0x2159('0x27')]['describe']()[_0x2159('0x20')](respondWithResult(_0x5c0bdb,null))[_0x2159('0x40')](handleError(_0x5c0bdb,null));}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.model.js b/server/api/smsQueueReport/smsQueueReport.model.js index a676ea8..aa2c0e6 100644 --- a/server/api/smsQueueReport/smsQueueReport.model.js +++ b/server/api/smsQueueReport/smsQueueReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd8b0=['define','report_sms_queue','uniqueid','lodash','util','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x34cce5,_0x461723){var _0x157691=function(_0x334290){while(--_0x334290){_0x34cce5['push'](_0x34cce5['shift']());}};_0x157691(++_0x461723);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x0d8b('0x2'));var rp=require(_0x0d8b('0x3'));var fs=require('fs');var path=require(_0x0d8b('0x4'));var rimraf=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var attributes=require('./smsQueueReport.attributes');module['exports']=function(_0x3f8b6f,_0x227c63){return _0x3f8b6f[_0x0d8b('0x7')]('SmsQueueReport',attributes,{'tableName':_0x0d8b('0x8'),'paranoid':![],'indexes':[{'name':_0x0d8b('0x9'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xb7e7=['../../config/logger','moment','request-promise','rimraf','../../config/environment','./smsQueueReport.attributes','define','SmsQueueReport','uniqueid','lodash'];(function(_0x1c4317,_0x5a2d4f){var _0x22df22=function(_0x248944){while(--_0x248944){_0x1c4317['push'](_0x1c4317['shift']());}};_0x22df22(++_0x5a2d4f);}(_0xb7e7,0x121));var _0x7b7e=function(_0x36eaaa,_0x326732){_0x36eaaa=_0x36eaaa-0x0;var _0x461349=_0xb7e7[_0x36eaaa];return _0x461349;};'use strict';var _=require(_0x7b7e('0x0'));var util=require('util');var logger=require(_0x7b7e('0x1'))('api');var moment=require(_0x7b7e('0x2'));var BPromise=require('bluebird');var rp=require(_0x7b7e('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7b7e('0x4'));var config=require(_0x7b7e('0x5'));var attributes=require(_0x7b7e('0x6'));module['exports']=function(_0x53ed64,_0x333fa4){return _0x53ed64[_0x7b7e('0x7')](_0x7b7e('0x8'),attributes,{'tableName':'report_sms_queue','paranoid':![],'indexes':[{'name':_0x7b7e('0x9'),'fields':[_0x7b7e('0x9')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.rpc.js b/server/api/smsQueueReport/smsQueueReport.rpc.js index a0b8c2c..5e469e4 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 _0x4014=['stringify','error','message','result','catch','SmsQueueReport','body','options','raw','CreateSmsQueueReport','UpdateSmsQueueReport','attributes','limit','then','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','info','SmsQueueReport,\x20%s,\x20%s','request\x20sent','debug','SmsQueueReport,\x20%s,\x20%s,\x20%s'];(function(_0x1cd65a,_0x29fa8f){var _0xf93849=function(_0x29fbe1){while(--_0x29fbe1){_0x1cd65a['push'](_0x1cd65a['shift']());}};_0xf93849(++_0x29fa8f);}(_0x4014,0x65));var _0x4401=function(_0x42bdad,_0x12836c){_0x42bdad=_0x42bdad-0x0;var _0x122626=_0x4014[_0x42bdad];return _0x122626;};'use strict';var _=require(_0x4401('0x0'));var util=require(_0x4401('0x1'));var moment=require(_0x4401('0x2'));var BPromise=require(_0x4401('0x3'));var rs=require(_0x4401('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4401('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x4401('0x6'))('rpc');var config=require(_0x4401('0x7'));var jayson=require(_0x4401('0x8'));var client=jayson[_0x4401('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x38d2a3,_0x26b985,_0x572a5c){return new BPromise(function(_0x3822a0,_0x2d503a){return client['request'](_0x38d2a3,_0x572a5c)['then'](function(_0x18236b){logger[_0x4401('0xa')](_0x4401('0xb'),_0x26b985,_0x4401('0xc'));logger[_0x4401('0xd')](_0x4401('0xe'),_0x26b985,'request\x20sent',JSON[_0x4401('0xf')](_0x18236b));if(_0x18236b[_0x4401('0x10')]){if(_0x18236b[_0x4401('0x10')]['code']===0x1f4){logger['error'](_0x4401('0xb'),_0x26b985,_0x18236b[_0x4401('0x10')][_0x4401('0x11')]);return _0x2d503a(_0x18236b[_0x4401('0x10')][_0x4401('0x11')]);}logger[_0x4401('0x10')](_0x4401('0xb'),_0x26b985,_0x18236b[_0x4401('0x10')]['message']);return _0x3822a0(_0x18236b[_0x4401('0x10')][_0x4401('0x11')]);}else{logger['info'](_0x4401('0xb'),_0x26b985,'request\x20sent');_0x3822a0(_0x18236b[_0x4401('0x12')][_0x4401('0x11')]);}})[_0x4401('0x13')](function(_0x196714){logger[_0x4401('0x10')](_0x4401('0xb'),_0x26b985,_0x196714);_0x2d503a(_0x196714);});});}exports['CreateSmsQueueReport']=function(_0xa8791a){var _0x15a893=this;return new Promise(function(_0x296c41,_0x1a393a){return db[_0x4401('0x14')]['create'](_0xa8791a[_0x4401('0x15')],{'raw':_0xa8791a[_0x4401('0x16')]?_0xa8791a[_0x4401('0x16')][_0x4401('0x17')]===undefined?!![]:![]:!![]})['then'](function(_0x371610){logger[_0x4401('0xa')]('CreateSmsQueueReport',_0xa8791a);logger[_0x4401('0xd')](_0x4401('0x18'),_0xa8791a,JSON[_0x4401('0xf')](_0x371610));_0x296c41(_0x371610);})['catch'](function(_0x164144){logger[_0x4401('0x10')](_0x4401('0x18'),_0x164144['message'],_0xa8791a);_0x1a393a(_0x15a893[_0x4401('0x10')](0x1f4,_0x164144['message']));});});};exports[_0x4401('0x19')]=function(_0x27871c){var _0x51df3c=this;return new Promise(function(_0x152ef8,_0x5e4f8b){return db[_0x4401('0x14')]['update'](_0x27871c['body'],{'raw':_0x27871c[_0x4401('0x16')]?_0x27871c[_0x4401('0x16')][_0x4401('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x27871c[_0x4401('0x16')]?_0x27871c[_0x4401('0x16')]['where']||null:null,'attributes':_0x27871c['options']?_0x27871c[_0x4401('0x16')][_0x4401('0x1a')]||null:null,'limit':_0x27871c['options']?_0x27871c[_0x4401('0x16')][_0x4401('0x1b')]||null:null})[_0x4401('0x1c')](function(_0x599650){logger[_0x4401('0xa')]('UpdateSmsQueueReport',_0x27871c);logger[_0x4401('0xd')](_0x4401('0x19'),_0x27871c,JSON['stringify'](_0x599650));_0x152ef8(_0x599650);})[_0x4401('0x13')](function(_0x277917){logger[_0x4401('0x10')](_0x4401('0x19'),_0x277917['message'],_0x27871c);_0x5e4f8b(_0x51df3c[_0x4401('0x10')](0x1f4,_0x277917[_0x4401('0x11')]));});});}; \ No newline at end of file +var _0x79c3=['limit','UpdateSmsQueueReport','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','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','raw','update','where'];(function(_0x2edf17,_0x5c731d){var _0x3c028a=function(_0x1c5909){while(--_0x1c5909){_0x2edf17['push'](_0x2edf17['shift']());}};_0x3c028a(++_0x5c731d);}(_0x79c3,0x156));var _0x379c=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x79c3[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require(_0x379c('0x0'));var util=require(_0x379c('0x1'));var moment=require('moment');var BPromise=require(_0x379c('0x2'));var rs=require(_0x379c('0x3'));var fs=require('fs');var Redis=require(_0x379c('0x4'));var db=require(_0x379c('0x5'))['db'];var utils=require(_0x379c('0x6'));var logger=require(_0x379c('0x7'))(_0x379c('0x8'));var config=require('../../config/environment');var jayson=require(_0x379c('0x9'));var client=jayson[_0x379c('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x30ae5c,_0x4b4c5d,_0x48bac9){return new BPromise(function(_0x41d24c,_0x482c23){return client[_0x379c('0xb')](_0x30ae5c,_0x48bac9)[_0x379c('0xc')](function(_0x11bb2c){logger[_0x379c('0xd')](_0x379c('0xe'),_0x4b4c5d,_0x379c('0xf'));logger[_0x379c('0x10')](_0x379c('0x11'),_0x4b4c5d,_0x379c('0xf'),JSON[_0x379c('0x12')](_0x11bb2c));if(_0x11bb2c[_0x379c('0x13')]){if(_0x11bb2c[_0x379c('0x13')][_0x379c('0x14')]===0x1f4){logger['error']('SmsQueueReport,\x20%s,\x20%s',_0x4b4c5d,_0x11bb2c[_0x379c('0x13')]['message']);return _0x482c23(_0x11bb2c[_0x379c('0x13')][_0x379c('0x15')]);}logger[_0x379c('0x13')](_0x379c('0xe'),_0x4b4c5d,_0x11bb2c['error'][_0x379c('0x15')]);return _0x41d24c(_0x11bb2c['error']['message']);}else{logger['info']('SmsQueueReport,\x20%s,\x20%s',_0x4b4c5d,_0x379c('0xf'));_0x41d24c(_0x11bb2c[_0x379c('0x16')][_0x379c('0x15')]);}})[_0x379c('0x17')](function(_0x3250aa){logger[_0x379c('0x13')]('SmsQueueReport,\x20%s,\x20%s',_0x4b4c5d,_0x3250aa);_0x482c23(_0x3250aa);});});}exports[_0x379c('0x18')]=function(_0x46dee8){var _0x39e5d8=this;return new Promise(function(_0x2b64ac,_0x425dde){return db[_0x379c('0x19')][_0x379c('0x1a')](_0x46dee8[_0x379c('0x1b')],{'raw':_0x46dee8[_0x379c('0x1c')]?_0x46dee8[_0x379c('0x1c')][_0x379c('0x1d')]===undefined?!![]:![]:!![]})[_0x379c('0xc')](function(_0x16f6f9){logger['info'](_0x379c('0x18'),_0x46dee8);logger[_0x379c('0x10')](_0x379c('0x18'),_0x46dee8,JSON[_0x379c('0x12')](_0x16f6f9));_0x2b64ac(_0x16f6f9);})['catch'](function(_0x4eaf8e){logger[_0x379c('0x13')]('CreateSmsQueueReport',_0x4eaf8e[_0x379c('0x15')],_0x46dee8);_0x425dde(_0x39e5d8[_0x379c('0x13')](0x1f4,_0x4eaf8e[_0x379c('0x15')]));});});};exports['UpdateSmsQueueReport']=function(_0x33f292){var _0x572f6e=this;return new Promise(function(_0x39e409,_0x26f555){return db[_0x379c('0x19')][_0x379c('0x1e')](_0x33f292[_0x379c('0x1b')],{'raw':_0x33f292['options']?_0x33f292['options'][_0x379c('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x33f292[_0x379c('0x1c')]?_0x33f292[_0x379c('0x1c')][_0x379c('0x1f')]||null:null,'attributes':_0x33f292['options']?_0x33f292[_0x379c('0x1c')]['attributes']||null:null,'limit':_0x33f292[_0x379c('0x1c')]?_0x33f292[_0x379c('0x1c')][_0x379c('0x20')]||null:null})[_0x379c('0xc')](function(_0x3e095a){logger[_0x379c('0xd')]('UpdateSmsQueueReport',_0x33f292);logger['debug'](_0x379c('0x21'),_0x33f292,JSON[_0x379c('0x12')](_0x3e095a));_0x39e409(_0x3e095a);})['catch'](function(_0x11ef53){logger['error'](_0x379c('0x21'),_0x11ef53['message'],_0x33f292);_0x26f555(_0x572f6e[_0x379c('0x13')](0x1f4,_0x11ef53[_0x379c('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/index.js b/server/api/smsTransferReport/index.js index 61c292d..5dbf765 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 _0xe132=['express','Router','fs-extra','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/describe','describe','/:id','show','create','put','update','delete','destroy','exports','multer','path','connect-timeout'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xe132,0x162));var _0x2e13=function(_0xae4a50,_0x14831f){_0xae4a50=_0xae4a50-0x0;var _0x1e1918=_0xe132[_0xae4a50];return _0x1e1918;};'use strict';var multer=require(_0x2e13('0x0'));var util=require('util');var path=require(_0x2e13('0x1'));var timeout=require(_0x2e13('0x2'));var express=require(_0x2e13('0x3'));var router=express[_0x2e13('0x4')]();var fs_extra=require(_0x2e13('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x2e13('0x6'));var config=require(_0x2e13('0x7'));var controller=require('./smsTransferReport.controller');router['get']('/',auth[_0x2e13('0x8')](),controller[_0x2e13('0x9')]);router[_0x2e13('0xa')](_0x2e13('0xb'),auth[_0x2e13('0x8')](),controller[_0x2e13('0xc')]);router[_0x2e13('0xa')](_0x2e13('0xd'),auth[_0x2e13('0x8')](),controller[_0x2e13('0xe')]);router['post']('/',auth[_0x2e13('0x8')](),controller[_0x2e13('0xf')]);router[_0x2e13('0x10')](_0x2e13('0xd'),auth[_0x2e13('0x8')](),controller[_0x2e13('0x11')]);router[_0x2e13('0x12')]('/:id',auth[_0x2e13('0x8')](),controller[_0x2e13('0x13')]);module[_0x2e13('0x14')]=router; \ No newline at end of file +var _0xd8b1=['exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','index','/describe','isAuthenticated','describe','get','show','create','/:id','update','delete','destroy'];(function(_0xee2e7a,_0x58354d){var _0x319dd3=function(_0xa99240){while(--_0xa99240){_0xee2e7a['push'](_0xee2e7a['shift']());}};_0x319dd3(++_0x58354d);}(_0xd8b1,0x105));var _0x1d8b=function(_0x2e7ba0,_0x310dc0){_0x2e7ba0=_0x2e7ba0-0x0;var _0x14f9a1=_0xd8b1[_0x2e7ba0];return _0x14f9a1;};'use strict';var multer=require(_0x1d8b('0x0'));var util=require(_0x1d8b('0x1'));var path=require(_0x1d8b('0x2'));var timeout=require(_0x1d8b('0x3'));var express=require(_0x1d8b('0x4'));var router=express['Router']();var fs_extra=require(_0x1d8b('0x5'));var auth=require(_0x1d8b('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x1d8b('0x7'));var controller=require('./smsTransferReport.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x1d8b('0x8')]);router['get'](_0x1d8b('0x9'),auth[_0x1d8b('0xa')](),controller[_0x1d8b('0xb')]);router[_0x1d8b('0xc')]('/:id',auth['isAuthenticated'](),controller[_0x1d8b('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0x1d8b('0xe')]);router['put'](_0x1d8b('0xf'),auth['isAuthenticated'](),controller[_0x1d8b('0x10')]);router[_0x1d8b('0x11')](_0x1d8b('0xf'),auth[_0x1d8b('0xa')](),controller[_0x1d8b('0x12')]);module[_0x1d8b('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 d0c9a13..0190892 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 _0x54ef=['agent','queue','DATE','NOW','moment','sequelize','exports','ENUM','account'];(function(_0x5eeadc,_0x17f42c){var _0x19781b=function(_0x188ed3){while(--_0x188ed3){_0x5eeadc['push'](_0x5eeadc['shift']());}};_0x19781b(++_0x17f42c);}(_0x54ef,0x112));var _0xf54e=function(_0x21c4ca,_0x40def6){_0x21c4ca=_0x21c4ca-0x0;var _0x495d25=_0x54ef[_0x21c4ca];return _0x495d25;};'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 +var _0x34e8=['queue','DATE','NOW','moment','sequelize','exports','STRING','account','agent'];(function(_0x31aa4b,_0x468550){var _0x49f208=function(_0x53468e){while(--_0x53468e){_0x31aa4b['push'](_0x31aa4b['shift']());}};_0x49f208(++_0x468550);}(_0x34e8,0x12c));var _0x834e=function(_0x339137,_0x41b1df){_0x339137=_0x339137-0x0;var _0x278c90=_0x34e8[_0x339137];return _0x278c90;};'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 diff --git a/server/api/smsTransferReport/smsTransferReport.controller.js b/server/api/smsTransferReport/smsTransferReport.controller.js index ef892b9..f093cec 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 _0x481b=['save','update','then','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','VIRTUAL','options','SmsTransferReport','includeAll','include','rows','catch','params','merge','find','create','body','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','apply','reject'];(function(_0x1ddedd,_0x485606){var _0xa3e1ac=function(_0x580444){while(--_0x580444){_0x1ddedd['push'](_0x1ddedd['shift']());}};_0xa3e1ac(++_0x485606);}(_0x481b,0x1dd));var _0xb481=function(_0x68c979,_0x431cff){_0x68c979=_0x68c979-0x0;var _0x4f0001=_0x481b[_0x68c979];return _0x4f0001;};'use strict';var emlformat=require(_0xb481('0x0'));var rimraf=require(_0xb481('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb481('0x2'));var rp=require(_0xb481('0x3'));var moment=require(_0xb481('0x4'));var BPromise=require(_0xb481('0x5'));var Mustache=require(_0xb481('0x6'));var util=require(_0xb481('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0xb481('0x8'));var ejs=require(_0xb481('0x9'));var fs=require('fs');var fs_extra=require(_0xb481('0xa'));var _=require(_0xb481('0xb'));var squel=require(_0xb481('0xc'));var crypto=require('crypto');var jsforce=require(_0xb481('0xd'));var deskjs=require(_0xb481('0xe'));var toCsv=require(_0xb481('0x8'));var querystring=require(_0xb481('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xb481('0x10'));var as=require(_0xb481('0x11'));var hardwareService=require(_0xb481('0x12'));var logger=require('../../config/logger')(_0xb481('0x13'));var utils=require(_0xb481('0x14'));var config=require(_0xb481('0x15'));var licenseUtil=require(_0xb481('0x16'));var db=require(_0xb481('0x17'))['db'];function respondWithStatusCode(_0x5aace4,_0x537416){_0x537416=_0x537416||0xcc;return function(_0x2ee952){if(_0x2ee952){return _0x5aace4[_0xb481('0x18')](_0x537416);}return _0x5aace4[_0xb481('0x19')](_0x537416)[_0xb481('0x1a')]();};}function respondWithResult(_0x53b57d,_0x2f9231){_0x2f9231=_0x2f9231||0xc8;return function(_0x16700e){if(_0x16700e){return _0x53b57d['status'](_0x2f9231)[_0xb481('0x1b')](_0x16700e);}};}function respondWithFilteredResult(_0x15605b,_0x4c3f70){return function(_0x2deb5f){if(_0x2deb5f){var _0x44dd42=typeof _0x4c3f70[_0xb481('0x1c')]===_0xb481('0x1d')&&typeof _0x4c3f70[_0xb481('0x1e')]===_0xb481('0x1d');var _0x1408e8=_0x2deb5f[_0xb481('0x1f')];var _0x5dd9f1=_0x44dd42?0x0:_0x4c3f70[_0xb481('0x1c')];var _0x314ed8=_0x44dd42?_0x2deb5f[_0xb481('0x1f')]:_0x4c3f70[_0xb481('0x1c')]+_0x4c3f70[_0xb481('0x1e')];var _0x28a342;if(_0x314ed8>=_0x1408e8){_0x314ed8=_0x1408e8;_0x28a342=0xc8;}else{_0x28a342=0xce;}_0x15605b[_0xb481('0x19')](_0x28a342);return _0x15605b['set']('Content-Range',_0x5dd9f1+'-'+_0x314ed8+'/'+_0x1408e8)['json'](_0x2deb5f);}return null;};}function patchUpdates(_0x7d0a29){return function(_0x506efc){try{jsonpatch[_0xb481('0x20')](_0x506efc,_0x7d0a29,!![]);}catch(_0x1070e0){return BPromise[_0xb481('0x21')](_0x1070e0);}return _0x506efc[_0xb481('0x22')]();};}function saveUpdates(_0xaef7e,_0x44d8dd){return function(_0x270f10){if(_0x270f10){return _0x270f10[_0xb481('0x23')](_0xaef7e)['then'](function(_0x146b31){return _0x146b31;});}return null;};}function removeEntity(_0x16235f,_0x22066a){return function(_0xc4aa04){if(_0xc4aa04){return _0xc4aa04['destroy']()[_0xb481('0x24')](function(){_0x16235f[_0xb481('0x19')](0xcc)[_0xb481('0x1a')]();});}};}function handleEntityNotFound(_0xfee2e9,_0x15c567){return function(_0x499e9a){if(!_0x499e9a){_0xfee2e9[_0xb481('0x18')](0x194);}return _0x499e9a;};}function handleError(_0x2f49dc,_0x59332c){_0x59332c=_0x59332c||0x1f4;return function(_0x11ce91){logger[_0xb481('0x25')](_0x11ce91[_0xb481('0x26')]);if(_0x11ce91[_0xb481('0x27')]){delete _0x11ce91['name'];}_0x2f49dc['status'](_0x59332c)[_0xb481('0x28')](_0x11ce91);};}exports['index']=function(_0x5a71a7,_0xa9d4ce){var _0x453024={},_0x1cb4d3={},_0x3a0490={'count':0x0,'rows':[]};var _0x3336cc=_[_0xb481('0x29')](db['SmsTransferReport'][_0xb481('0x2a')],function(_0xc60b7b){return{'name':_0xc60b7b[_0xb481('0x2b')],'type':_0xc60b7b[_0xb481('0x2c')][_0xb481('0x2d')]};});_0x1cb4d3[_0xb481('0x2e')]=_[_0xb481('0x29')](_0x3336cc,_0xb481('0x27'));_0x1cb4d3[_0xb481('0x2f')]=_[_0xb481('0x30')](_0x5a71a7[_0xb481('0x2f')]);_0x1cb4d3[_0xb481('0x31')]=_[_0xb481('0x32')](_0x1cb4d3['model'],_0x1cb4d3[_0xb481('0x2f')]);_0x453024[_0xb481('0x33')]=_['intersection'](_0x1cb4d3[_0xb481('0x2e')],qs[_0xb481('0x34')](_0x5a71a7['query']['fields']));_0x453024[_0xb481('0x33')]=_0x453024['attributes'][_0xb481('0x35')]?_0x453024['attributes']:_0x1cb4d3[_0xb481('0x2e')];if(!_0x5a71a7[_0xb481('0x2f')]['hasOwnProperty'](_0xb481('0x36'))){_0x453024['limit']=qs[_0xb481('0x1e')](_0x5a71a7[_0xb481('0x2f')][_0xb481('0x1e')]);_0x453024[_0xb481('0x1c')]=qs['offset'](_0x5a71a7[_0xb481('0x2f')][_0xb481('0x1c')]);}_0x453024[_0xb481('0x37')]=qs[_0xb481('0x38')](_0x5a71a7[_0xb481('0x2f')][_0xb481('0x38')]);_0x453024[_0xb481('0x39')]=qs['filters'](_[_0xb481('0x3a')](_0x5a71a7[_0xb481('0x2f')],_0x1cb4d3['filters']),_0x3336cc);if(_0x5a71a7[_0xb481('0x2f')][_0xb481('0x3b')]){_0x453024['where']=_['merge'](_0x453024[_0xb481('0x39')],{'$or':_['map'](_0x3336cc,function(_0x3800fb){if(_0x3800fb[_0xb481('0x2c')]!==_0xb481('0x3c')){var _0x39339e={};_0x39339e[_0x3800fb[_0xb481('0x27')]]={'$like':'%'+_0x5a71a7[_0xb481('0x2f')]['filter']+'%'};return _0x39339e;}})});}_0x453024=_['merge']({},_0x453024,_0x5a71a7[_0xb481('0x3d')]);var _0x1c68b1={'where':_0x453024[_0xb481('0x39')]};return db[_0xb481('0x3e')]['count'](_0x1c68b1)[_0xb481('0x24')](function(_0x4c9821){_0x3a0490[_0xb481('0x1f')]=_0x4c9821;if(_0x5a71a7['query'][_0xb481('0x3f')]){_0x453024[_0xb481('0x40')]=[{'all':!![]}];}return db[_0xb481('0x3e')]['findAll'](_0x453024);})[_0xb481('0x24')](function(_0x3d26a1){_0x3a0490[_0xb481('0x41')]=_0x3d26a1;return _0x3a0490;})[_0xb481('0x24')](respondWithFilteredResult(_0xa9d4ce,_0x453024))[_0xb481('0x42')](handleError(_0xa9d4ce,null));};exports['show']=function(_0x1a719b,_0x464708){var _0x2a282f={'raw':!![],'where':{'id':_0x1a719b[_0xb481('0x43')]['id']}},_0x27a7f8={};_0x27a7f8[_0xb481('0x2e')]=_['keys'](db['SmsTransferReport'][_0xb481('0x2a')]);_0x27a7f8[_0xb481('0x2f')]=_[_0xb481('0x30')](_0x1a719b[_0xb481('0x2f')]);_0x27a7f8['filters']=_[_0xb481('0x32')](_0x27a7f8['model'],_0x27a7f8[_0xb481('0x2f')]);_0x2a282f[_0xb481('0x33')]=_[_0xb481('0x32')](_0x27a7f8[_0xb481('0x2e')],qs['fields'](_0x1a719b[_0xb481('0x2f')][_0xb481('0x34')]));_0x2a282f[_0xb481('0x33')]=_0x2a282f[_0xb481('0x33')][_0xb481('0x35')]?_0x2a282f[_0xb481('0x33')]:_0x27a7f8['model'];if(_0x1a719b['query'][_0xb481('0x3f')]){_0x2a282f[_0xb481('0x40')]=[{'all':!![]}];}_0x2a282f=_[_0xb481('0x44')]({},_0x2a282f,_0x1a719b[_0xb481('0x3d')]);return db[_0xb481('0x3e')][_0xb481('0x45')](_0x2a282f)['then'](handleEntityNotFound(_0x464708,null))['then'](respondWithResult(_0x464708,null))[_0xb481('0x42')](handleError(_0x464708,null));};exports[_0xb481('0x46')]=function(_0x370663,_0x449a80){return db[_0xb481('0x3e')]['create'](_0x370663[_0xb481('0x47')],{})[_0xb481('0x24')](respondWithResult(_0x449a80,0xc9))[_0xb481('0x42')](handleError(_0x449a80,null));};exports[_0xb481('0x23')]=function(_0x5c6b15,_0x3a6d1e){if(_0x5c6b15[_0xb481('0x47')]['id']){delete _0x5c6b15[_0xb481('0x47')]['id'];}return db[_0xb481('0x3e')]['find']({'where':{'id':_0x5c6b15[_0xb481('0x43')]['id']}})['then'](handleEntityNotFound(_0x3a6d1e,null))[_0xb481('0x24')](saveUpdates(_0x5c6b15[_0xb481('0x47')],null))['then'](respondWithResult(_0x3a6d1e,null))[_0xb481('0x42')](handleError(_0x3a6d1e,null));};exports['destroy']=function(_0x1263fd,_0x396f44){return db[_0xb481('0x3e')][_0xb481('0x45')]({'where':{'id':_0x1263fd[_0xb481('0x43')]['id']}})[_0xb481('0x24')](handleEntityNotFound(_0x396f44,null))['then'](removeEntity(_0x396f44,null))[_0xb481('0x42')](handleError(_0x396f44,null));};exports['describe']=function(_0x49c821,_0x2a771b){return db['SmsTransferReport'][_0xb481('0x48')]()[_0xb481('0x24')](respondWithResult(_0x2a771b,null))[_0xb481('0x42')](handleError(_0x2a771b,null));}; \ No newline at end of file +var _0xc887=['update','then','error','stack','name','send','index','map','SmsTransferReport','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','where','filters','filter','merge','VIRTUAL','options','rows','catch','params','includeAll','include','find','create','body','destroy','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','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','save'];(function(_0x6131cd,_0x4c26a1){var _0x47e916=function(_0x1f2bce){while(--_0x1f2bce){_0x6131cd['push'](_0x6131cd['shift']());}};_0x47e916(++_0x4c26a1);}(_0xc887,0x192));var _0x7c88=function(_0x38fd2b,_0x431bba){_0x38fd2b=_0x38fd2b-0x0;var _0x2ad732=_0xc887[_0x38fd2b];return _0x2ad732;};'use strict';var emlformat=require(_0x7c88('0x0'));var rimraf=require(_0x7c88('0x1'));var zipdir=require(_0x7c88('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7c88('0x3'));var moment=require(_0x7c88('0x4'));var BPromise=require(_0x7c88('0x5'));var Mustache=require('mustache');var util=require(_0x7c88('0x6'));var path=require('path');var sox=require(_0x7c88('0x7'));var csv=require('to-csv');var ejs=require(_0x7c88('0x8'));var fs=require('fs');var fs_extra=require(_0x7c88('0x9'));var _=require(_0x7c88('0xa'));var squel=require(_0x7c88('0xb'));var crypto=require('crypto');var jsforce=require(_0x7c88('0xc'));var deskjs=require(_0x7c88('0xd'));var toCsv=require(_0x7c88('0xe'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x7c88('0xf'));var authService=require(_0x7c88('0x10'));var qs=require(_0x7c88('0x11'));var as=require(_0x7c88('0x12'));var hardwareService=require(_0x7c88('0x13'));var logger=require(_0x7c88('0x14'))('api');var utils=require(_0x7c88('0x15'));var config=require(_0x7c88('0x16'));var licenseUtil=require(_0x7c88('0x17'));var db=require(_0x7c88('0x18'))['db'];function respondWithStatusCode(_0x3b1e64,_0x1aa6a5){_0x1aa6a5=_0x1aa6a5||0xcc;return function(_0xa88915){if(_0xa88915){return _0x3b1e64[_0x7c88('0x19')](_0x1aa6a5);}return _0x3b1e64[_0x7c88('0x1a')](_0x1aa6a5)[_0x7c88('0x1b')]();};}function respondWithResult(_0x4ff367,_0x4822cf){_0x4822cf=_0x4822cf||0xc8;return function(_0x30762f){if(_0x30762f){return _0x4ff367[_0x7c88('0x1a')](_0x4822cf)[_0x7c88('0x1c')](_0x30762f);}};}function respondWithFilteredResult(_0x1d7a9f,_0x2197bb){return function(_0x3899d7){if(_0x3899d7){var _0x3fdafd=typeof _0x2197bb[_0x7c88('0x1d')]===_0x7c88('0x1e')&&typeof _0x2197bb['limit']==='undefined';var _0x21d36d=_0x3899d7['count'];var _0x2cd6fe=_0x3fdafd?0x0:_0x2197bb[_0x7c88('0x1d')];var _0x301457=_0x3fdafd?_0x3899d7[_0x7c88('0x1f')]:_0x2197bb[_0x7c88('0x1d')]+_0x2197bb[_0x7c88('0x20')];var _0x5addb1;if(_0x301457>=_0x21d36d){_0x301457=_0x21d36d;_0x5addb1=0xc8;}else{_0x5addb1=0xce;}_0x1d7a9f[_0x7c88('0x1a')](_0x5addb1);return _0x1d7a9f[_0x7c88('0x21')](_0x7c88('0x22'),_0x2cd6fe+'-'+_0x301457+'/'+_0x21d36d)[_0x7c88('0x1c')](_0x3899d7);}return null;};}function patchUpdates(_0x4794b7){return function(_0x4023c3){try{jsonpatch['apply'](_0x4023c3,_0x4794b7,!![]);}catch(_0x5167e2){return BPromise['reject'](_0x5167e2);}return _0x4023c3[_0x7c88('0x23')]();};}function saveUpdates(_0x40eb3d,_0x535311){return function(_0x478d33){if(_0x478d33){return _0x478d33[_0x7c88('0x24')](_0x40eb3d)[_0x7c88('0x25')](function(_0x9290b4){return _0x9290b4;});}return null;};}function removeEntity(_0xf2d2de,_0x444854){return function(_0x20cf36){if(_0x20cf36){return _0x20cf36['destroy']()['then'](function(){_0xf2d2de[_0x7c88('0x1a')](0xcc)[_0x7c88('0x1b')]();});}};}function handleEntityNotFound(_0x2c6318,_0x4ac771){return function(_0x47fc99){if(!_0x47fc99){_0x2c6318[_0x7c88('0x19')](0x194);}return _0x47fc99;};}function handleError(_0xf3233f,_0x2dac80){_0x2dac80=_0x2dac80||0x1f4;return function(_0x510eb9){logger[_0x7c88('0x26')](_0x510eb9[_0x7c88('0x27')]);if(_0x510eb9[_0x7c88('0x28')]){delete _0x510eb9[_0x7c88('0x28')];}_0xf3233f[_0x7c88('0x1a')](_0x2dac80)[_0x7c88('0x29')](_0x510eb9);};}exports[_0x7c88('0x2a')]=function(_0x4252bb,_0x1271d5){var _0x4a60c9={},_0x4416c2={},_0x4b9fe7={'count':0x0,'rows':[]};var _0x52b8e4=_[_0x7c88('0x2b')](db[_0x7c88('0x2c')][_0x7c88('0x2d')],function(_0x426b5e){return{'name':_0x426b5e[_0x7c88('0x2e')],'type':_0x426b5e['type'][_0x7c88('0x2f')]};});_0x4416c2[_0x7c88('0x30')]=_[_0x7c88('0x2b')](_0x52b8e4,_0x7c88('0x28'));_0x4416c2[_0x7c88('0x31')]=_[_0x7c88('0x32')](_0x4252bb[_0x7c88('0x31')]);_0x4416c2['filters']=_[_0x7c88('0x33')](_0x4416c2['model'],_0x4416c2['query']);_0x4a60c9[_0x7c88('0x34')]=_[_0x7c88('0x33')](_0x4416c2[_0x7c88('0x30')],qs[_0x7c88('0x35')](_0x4252bb[_0x7c88('0x31')][_0x7c88('0x35')]));_0x4a60c9[_0x7c88('0x34')]=_0x4a60c9['attributes'][_0x7c88('0x36')]?_0x4a60c9[_0x7c88('0x34')]:_0x4416c2[_0x7c88('0x30')];if(!_0x4252bb['query'][_0x7c88('0x37')]('nolimit')){_0x4a60c9[_0x7c88('0x20')]=qs[_0x7c88('0x20')](_0x4252bb[_0x7c88('0x31')]['limit']);_0x4a60c9[_0x7c88('0x1d')]=qs[_0x7c88('0x1d')](_0x4252bb[_0x7c88('0x31')]['offset']);}_0x4a60c9[_0x7c88('0x38')]=qs['sort'](_0x4252bb['query']['sort']);_0x4a60c9[_0x7c88('0x39')]=qs[_0x7c88('0x3a')](_['pick'](_0x4252bb['query'],_0x4416c2[_0x7c88('0x3a')]),_0x52b8e4);if(_0x4252bb[_0x7c88('0x31')][_0x7c88('0x3b')]){_0x4a60c9[_0x7c88('0x39')]=_[_0x7c88('0x3c')](_0x4a60c9[_0x7c88('0x39')],{'$or':_['map'](_0x52b8e4,function(_0x169765){if(_0x169765['type']!==_0x7c88('0x3d')){var _0xf7464a={};_0xf7464a[_0x169765[_0x7c88('0x28')]]={'$like':'%'+_0x4252bb[_0x7c88('0x31')]['filter']+'%'};return _0xf7464a;}})});}_0x4a60c9=_['merge']({},_0x4a60c9,_0x4252bb[_0x7c88('0x3e')]);var _0x45df89={'where':_0x4a60c9['where']};return db[_0x7c88('0x2c')][_0x7c88('0x1f')](_0x45df89)['then'](function(_0x16283d){_0x4b9fe7[_0x7c88('0x1f')]=_0x16283d;if(_0x4252bb[_0x7c88('0x31')]['includeAll']){_0x4a60c9['include']=[{'all':!![]}];}return db[_0x7c88('0x2c')]['findAll'](_0x4a60c9);})[_0x7c88('0x25')](function(_0x241e6c){_0x4b9fe7[_0x7c88('0x3f')]=_0x241e6c;return _0x4b9fe7;})['then'](respondWithFilteredResult(_0x1271d5,_0x4a60c9))[_0x7c88('0x40')](handleError(_0x1271d5,null));};exports['show']=function(_0x34c3a2,_0x261b8a){var _0x332779={'raw':!![],'where':{'id':_0x34c3a2[_0x7c88('0x41')]['id']}},_0x19a043={};_0x19a043[_0x7c88('0x30')]=_[_0x7c88('0x32')](db[_0x7c88('0x2c')]['rawAttributes']);_0x19a043[_0x7c88('0x31')]=_[_0x7c88('0x32')](_0x34c3a2[_0x7c88('0x31')]);_0x19a043['filters']=_[_0x7c88('0x33')](_0x19a043[_0x7c88('0x30')],_0x19a043['query']);_0x332779[_0x7c88('0x34')]=_[_0x7c88('0x33')](_0x19a043[_0x7c88('0x30')],qs[_0x7c88('0x35')](_0x34c3a2[_0x7c88('0x31')][_0x7c88('0x35')]));_0x332779['attributes']=_0x332779['attributes'][_0x7c88('0x36')]?_0x332779[_0x7c88('0x34')]:_0x19a043[_0x7c88('0x30')];if(_0x34c3a2['query'][_0x7c88('0x42')]){_0x332779[_0x7c88('0x43')]=[{'all':!![]}];}_0x332779=_[_0x7c88('0x3c')]({},_0x332779,_0x34c3a2[_0x7c88('0x3e')]);return db[_0x7c88('0x2c')][_0x7c88('0x44')](_0x332779)[_0x7c88('0x25')](handleEntityNotFound(_0x261b8a,null))['then'](respondWithResult(_0x261b8a,null))['catch'](handleError(_0x261b8a,null));};exports[_0x7c88('0x45')]=function(_0x370403,_0x529726){return db['SmsTransferReport'][_0x7c88('0x45')](_0x370403['body'],{})[_0x7c88('0x25')](respondWithResult(_0x529726,0xc9))[_0x7c88('0x40')](handleError(_0x529726,null));};exports[_0x7c88('0x24')]=function(_0x172641,_0x24900e){if(_0x172641[_0x7c88('0x46')]['id']){delete _0x172641['body']['id'];}return db['SmsTransferReport']['find']({'where':{'id':_0x172641[_0x7c88('0x41')]['id']}})[_0x7c88('0x25')](handleEntityNotFound(_0x24900e,null))[_0x7c88('0x25')](saveUpdates(_0x172641[_0x7c88('0x46')],null))[_0x7c88('0x25')](respondWithResult(_0x24900e,null))[_0x7c88('0x40')](handleError(_0x24900e,null));};exports[_0x7c88('0x47')]=function(_0x23f1aa,_0x320fa1){return db[_0x7c88('0x2c')][_0x7c88('0x44')]({'where':{'id':_0x23f1aa['params']['id']}})[_0x7c88('0x25')](handleEntityNotFound(_0x320fa1,null))['then'](removeEntity(_0x320fa1,null))[_0x7c88('0x40')](handleError(_0x320fa1,null));};exports[_0x7c88('0x48')]=function(_0x21e3fc,_0x24e60d){return db[_0x7c88('0x2c')]['describe']()[_0x7c88('0x25')](respondWithResult(_0x24e60d,null))[_0x7c88('0x40')](handleError(_0x24e60d,null));}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.model.js b/server/api/smsTransferReport/smsTransferReport.model.js index f9d138b..fa0e740 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 _0xb721=['uniqueid','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsTransferReport.attributes','exports','SmsTransferReport','report_sms_transfer'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xb721,0x169));var _0x1b72=function(_0x82129b,_0x484ae9){_0x82129b=_0x82129b-0x0;var _0x2ae5dc=_0xb721[_0x82129b];return _0x2ae5dc;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x1b72('0x0'));var moment=require(_0x1b72('0x1'));var BPromise=require(_0x1b72('0x2'));var rp=require(_0x1b72('0x3'));var fs=require('fs');var path=require(_0x1b72('0x4'));var rimraf=require(_0x1b72('0x5'));var config=require(_0x1b72('0x6'));var attributes=require(_0x1b72('0x7'));module[_0x1b72('0x8')]=function(_0x2b3f8e,_0x48204d){return _0x2b3f8e['define'](_0x1b72('0x9'),attributes,{'tableName':_0x1b72('0xa'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x1b72('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x01e7=['request-promise','path','rimraf','./smsTransferReport.attributes','exports','SmsTransferReport','report_sms_transfer','uniqueid','lodash','api'];(function(_0x268ae4,_0x4280bf){var _0x432e21=function(_0x51ce74){while(--_0x51ce74){_0x268ae4['push'](_0x268ae4['shift']());}};_0x432e21(++_0x4280bf);}(_0x01e7,0x134));var _0x701e=function(_0x4840c5,_0x162b17){_0x4840c5=_0x4840c5-0x0;var _0x4c0673=_0x01e7[_0x4840c5];return _0x4c0673;};'use strict';var _=require(_0x701e('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x701e('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x701e('0x2'));var fs=require('fs');var path=require(_0x701e('0x3'));var rimraf=require(_0x701e('0x4'));var config=require('../../config/environment');var attributes=require(_0x701e('0x5'));module[_0x701e('0x6')]=function(_0x415875,_0x16235b){return _0x415875['define'](_0x701e('0x7'),attributes,{'tableName':_0x701e('0x8'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x701e('0x9')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.rpc.js b/server/api/smsTransferReport/smsTransferReport.rpc.js index 3f451e6..885fb78 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 _0x10af=['error','SmsTransferReport,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','then','info','request\x20sent'];(function(_0x12c775,_0x1e6381){var _0x154ed7=function(_0x58d4a2){while(--_0x58d4a2){_0x12c775['push'](_0x12c775['shift']());}};_0x154ed7(++_0x1e6381);}(_0x10af,0xfc));var _0xf10a=function(_0x3fba9f,_0x3b7b9b){_0x3fba9f=_0x3fba9f-0x0;var _0x192cf1=_0x10af[_0x3fba9f];return _0x192cf1;};'use strict';var _=require(_0xf10a('0x0'));var util=require('util');var moment=require(_0xf10a('0x1'));var BPromise=require(_0xf10a('0x2'));var rs=require(_0xf10a('0x3'));var fs=require('fs');var Redis=require(_0xf10a('0x4'));var db=require(_0xf10a('0x5'))['db'];var utils=require(_0xf10a('0x6'));var logger=require(_0xf10a('0x7'))(_0xf10a('0x8'));var config=require('../../config/environment');var jayson=require(_0xf10a('0x9'));var client=jayson[_0xf10a('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4cd7e4,_0x8c9add,_0x1563fb){return new BPromise(function(_0x2ade36,_0x110583){return client['request'](_0x4cd7e4,_0x1563fb)[_0xf10a('0xb')](function(_0x52502e){logger[_0xf10a('0xc')]('SmsTransferReport,\x20%s,\x20%s',_0x8c9add,_0xf10a('0xd'));logger['debug']('SmsTransferReport,\x20%s,\x20%s,\x20%s',_0x8c9add,_0xf10a('0xd'),JSON['stringify'](_0x52502e));if(_0x52502e[_0xf10a('0xe')]){if(_0x52502e[_0xf10a('0xe')]['code']===0x1f4){logger[_0xf10a('0xe')](_0xf10a('0xf'),_0x8c9add,_0x52502e[_0xf10a('0xe')][_0xf10a('0x10')]);return _0x110583(_0x52502e[_0xf10a('0xe')][_0xf10a('0x10')]);}logger[_0xf10a('0xe')](_0xf10a('0xf'),_0x8c9add,_0x52502e[_0xf10a('0xe')]['message']);return _0x2ade36(_0x52502e[_0xf10a('0xe')]['message']);}else{logger['info'](_0xf10a('0xf'),_0x8c9add,_0xf10a('0xd'));_0x2ade36(_0x52502e[_0xf10a('0x11')][_0xf10a('0x10')]);}})[_0xf10a('0x12')](function(_0x549d50){logger[_0xf10a('0xe')](_0xf10a('0xf'),_0x8c9add,_0x549d50);_0x110583(_0x549d50);});});} \ No newline at end of file +var _0x7dfd=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','SmsTransferReport,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x19e206,_0x3e945d){var _0x531b21=function(_0x30ff2e){while(--_0x30ff2e){_0x19e206['push'](_0x19e206['shift']());}};_0x531b21(++_0x3e945d);}(_0x7dfd,0x1c2));var _0xd7df=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7dfd[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xd7df('0x0'));var util=require(_0xd7df('0x1'));var moment=require(_0xd7df('0x2'));var BPromise=require(_0xd7df('0x3'));var rs=require(_0xd7df('0x4'));var fs=require('fs');var Redis=require(_0xd7df('0x5'));var db=require(_0xd7df('0x6'))['db'];var utils=require(_0xd7df('0x7'));var logger=require(_0xd7df('0x8'))(_0xd7df('0x9'));var config=require(_0xd7df('0xa'));var jayson=require(_0xd7df('0xb'));var client=jayson[_0xd7df('0xc')][_0xd7df('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x354ea7,_0x16e50,_0x2c48a4){return new BPromise(function(_0x5c220a,_0xab6742){return client[_0xd7df('0xe')](_0x354ea7,_0x2c48a4)[_0xd7df('0xf')](function(_0x3dee59){logger['info'](_0xd7df('0x10'),_0x16e50,'request\x20sent');logger[_0xd7df('0x11')]('SmsTransferReport,\x20%s,\x20%s,\x20%s',_0x16e50,_0xd7df('0x12'),JSON[_0xd7df('0x13')](_0x3dee59));if(_0x3dee59[_0xd7df('0x14')]){if(_0x3dee59[_0xd7df('0x14')][_0xd7df('0x15')]===0x1f4){logger[_0xd7df('0x14')](_0xd7df('0x10'),_0x16e50,_0x3dee59[_0xd7df('0x14')][_0xd7df('0x16')]);return _0xab6742(_0x3dee59[_0xd7df('0x14')][_0xd7df('0x16')]);}logger[_0xd7df('0x14')](_0xd7df('0x10'),_0x16e50,_0x3dee59[_0xd7df('0x14')][_0xd7df('0x16')]);return _0x5c220a(_0x3dee59[_0xd7df('0x14')][_0xd7df('0x16')]);}else{logger['info'](_0xd7df('0x10'),_0x16e50,_0xd7df('0x12'));_0x5c220a(_0x3dee59['result'][_0xd7df('0x16')]);}})[_0xd7df('0x17')](function(_0x5d3beb){logger[_0xd7df('0x14')](_0xd7df('0x10'),_0x16e50,_0x5d3beb);_0xab6742(_0x5d3beb);});});} \ No newline at end of file diff --git a/server/api/sound/index.js b/server/api/sound/index.js index 8162e86..f6817f0 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 _0xd242=['basename','now','single','create','put','update','delete','exports','path','connect-timeout','fs-extra','../../components/auth/service','./sound.controller','get','isAuthenticated','index','/:id','show','/:id/download','download','diskStorage','join','root','server/files/sounds/original/','originalname','replace','%s-%s%s'];(function(_0x173624,_0x20c455){var _0x4e3ceb=function(_0x195f31){while(--_0x195f31){_0x173624['push'](_0x173624['shift']());}};_0x4e3ceb(++_0x20c455);}(_0xd242,0xc5));var _0x2d24=function(_0x937379,_0x4688a0){_0x937379=_0x937379-0x0;var _0x465709=_0xd242[_0x937379];return _0x465709;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x2d24('0x0'));var timeout=require(_0x2d24('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x2d24('0x2'));var auth=require(_0x2d24('0x3'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x2d24('0x4'));router[_0x2d24('0x5')]('/',auth[_0x2d24('0x6')](),controller[_0x2d24('0x7')]);router[_0x2d24('0x5')](_0x2d24('0x8'),auth[_0x2d24('0x6')](),controller[_0x2d24('0x9')]);router['get'](_0x2d24('0xa'),auth[_0x2d24('0x6')](),controller[_0x2d24('0xb')]);var upload=multer({'storage':multer[_0x2d24('0xc')]({'destination':function(_0x4aa622,_0x1ac5e5,_0x20d2b5){_0x20d2b5(null,path[_0x2d24('0xd')](config[_0x2d24('0xe')],_0x2d24('0xf')));},'filename':function(_0x361d02,_0xbf4635,_0x40ffd5){_0xbf4635['originalname']=_0xbf4635[_0x2d24('0x10')][_0x2d24('0x11')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x40ffd5(null,util['format'](_0x2d24('0x12'),path[_0x2d24('0x13')](_0xbf4635[_0x2d24('0x10')],path['extname'](_0xbf4635[_0x2d24('0x10')])),Date[_0x2d24('0x14')](),path['extname'](_0xbf4635['originalname'])));}})});router['post']('/',upload[_0x2d24('0x15')]('file'),controller[_0x2d24('0x16')]);router[_0x2d24('0x17')]('/:id',auth[_0x2d24('0x6')](),controller[_0x2d24('0x18')]);router[_0x2d24('0x19')](_0x2d24('0x8'),auth[_0x2d24('0x6')](),controller[_0x2d24('0x19')]);module[_0x2d24('0x1a')]=router; \ No newline at end of file +var _0x4a33=['isAuthenticated','download','join','root','server/files/sounds/original/','originalname','replace','extname','now','post','file','create','put','/:id','update','delete','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./sound.controller','get','index','show'];(function(_0x26ee2a,_0x5ea2e2){var _0x46e8e2=function(_0x56713e){while(--_0x56713e){_0x26ee2a['push'](_0x26ee2a['shift']());}};_0x46e8e2(++_0x5ea2e2);}(_0x4a33,0x199));var _0x34a3=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0x4a33[_0x2b4411];return _0x8e41ef;};'use strict';var multer=require('multer');var util=require(_0x34a3('0x0'));var path=require(_0x34a3('0x1'));var timeout=require('connect-timeout');var express=require(_0x34a3('0x2'));var router=express[_0x34a3('0x3')]();var fs_extra=require(_0x34a3('0x4'));var auth=require(_0x34a3('0x5'));var interaction=require(_0x34a3('0x6'));var config=require('../../config/environment');var controller=require(_0x34a3('0x7'));router[_0x34a3('0x8')]('/',auth['isAuthenticated'](),controller[_0x34a3('0x9')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x34a3('0xa')]);router[_0x34a3('0x8')]('/:id/download',auth[_0x34a3('0xb')](),controller[_0x34a3('0xc')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x179588,_0x30327e,_0x4a00fe){_0x4a00fe(null,path[_0x34a3('0xd')](config[_0x34a3('0xe')],_0x34a3('0xf')));},'filename':function(_0x4762ef,_0x2340b8,_0x22f107){_0x2340b8[_0x34a3('0x10')]=_0x2340b8[_0x34a3('0x10')][_0x34a3('0x11')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x22f107(null,util['format']('%s-%s%s',path['basename'](_0x2340b8[_0x34a3('0x10')],path[_0x34a3('0x12')](_0x2340b8['originalname'])),Date[_0x34a3('0x13')](),path['extname'](_0x2340b8['originalname'])));}})});router[_0x34a3('0x14')]('/',upload['single'](_0x34a3('0x15')),controller[_0x34a3('0x16')]);router[_0x34a3('0x17')](_0x34a3('0x18'),auth['isAuthenticated'](),controller[_0x34a3('0x19')]);router['delete'](_0x34a3('0x18'),auth[_0x34a3('0xb')](),controller[_0x34a3('0x1a')]);module[_0x34a3('0x1b')]=router; \ No newline at end of file diff --git a/server/api/sound/sound.attributes.js b/server/api/sound/sound.attributes.js index ca91cf9..a5cc07c 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 _0x55a1=['name','FLOAT','BIGINT','INTEGER','sequelize','STRING'];(function(_0x5ecde7,_0x411905){var _0x4c037e=function(_0x2f0cfc){while(--_0x2f0cfc){_0x5ecde7['push'](_0x5ecde7['shift']());}};_0x4c037e(++_0x411905);}(_0x55a1,0x118));var _0x155a=function(_0x83a5a2,_0x18d473){_0x83a5a2=_0x83a5a2-0x0;var _0x1eceb6=_0x55a1[_0x83a5a2];return _0x1eceb6;};'use strict';var Sequelize=require(_0x155a('0x0'));module['exports']={'name':{'type':Sequelize[_0x155a('0x1')],'unique':_0x155a('0x2'),'allowNull':![]},'save_name':{'type':Sequelize[_0x155a('0x1')]},'display_name':{'type':Sequelize['STRING'],'defaultValue':''},'description':{'type':Sequelize[_0x155a('0x1')]},'original_format':{'type':Sequelize[_0x155a('0x1')]},'original_duration':{'type':Sequelize[_0x155a('0x3')]},'original_sampleCount':{'type':Sequelize[_0x155a('0x4')]},'original_channelCount':{'type':Sequelize['INTEGER']},'original_bitRate':{'type':Sequelize[_0x155a('0x4')]},'original_sampleRate':{'type':Sequelize['INTEGER']},'converted_format':{'type':Sequelize['STRING']},'converted_duration':{'type':Sequelize['FLOAT']},'converted_sampleCount':{'type':Sequelize[_0x155a('0x4')]},'converted_channelCount':{'type':Sequelize[_0x155a('0x5')]},'converted_bitRate':{'type':Sequelize['BIGINT']},'converted_sampleRate':{'type':Sequelize[_0x155a('0x5')]}}; \ No newline at end of file +var _0x905a=['STRING','FLOAT','BIGINT','INTEGER','exports'];(function(_0xe10cb3,_0x157569){var _0xb18cfb=function(_0x48633f){while(--_0x48633f){_0xe10cb3['push'](_0xe10cb3['shift']());}};_0xb18cfb(++_0x157569);}(_0x905a,0x103));var _0xa905=function(_0x57786e,_0x5b3209){_0x57786e=_0x57786e-0x0;var _0x16068b=_0x905a[_0x57786e];return _0x16068b;};'use strict';var Sequelize=require('sequelize');module[_0xa905('0x0')]={'name':{'type':Sequelize[_0xa905('0x1')],'unique':'name','allowNull':![]},'save_name':{'type':Sequelize[_0xa905('0x1')]},'display_name':{'type':Sequelize[_0xa905('0x1')],'defaultValue':''},'description':{'type':Sequelize['STRING']},'original_format':{'type':Sequelize[_0xa905('0x1')]},'original_duration':{'type':Sequelize[_0xa905('0x2')]},'original_sampleCount':{'type':Sequelize[_0xa905('0x3')]},'original_channelCount':{'type':Sequelize[_0xa905('0x4')]},'original_bitRate':{'type':Sequelize['BIGINT']},'original_sampleRate':{'type':Sequelize[_0xa905('0x4')]},'converted_format':{'type':Sequelize[_0xa905('0x1')]},'converted_duration':{'type':Sequelize['FLOAT']},'converted_sampleCount':{'type':Sequelize[_0xa905('0x3')]},'converted_channelCount':{'type':Sequelize[_0xa905('0x4')]},'converted_bitRate':{'type':Sequelize[_0xa905('0x3')]},'converted_sampleRate':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/sound/sound.controller.js b/server/api/sound/sound.controller.js index ed18f84..7da9d2d 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 _0x81db=['originalname','filename','substring','wav','server/files/sounds/original','info','Sound\x20upload\x20filepath:\x20%s','Sound\x20upload\x20destination:\x20%s','chmodSync','0777','transcode','unlinkSync','src','original_duration','duration','original_sampleCount','sampleCount','channelCount','original_bitRate','bitRate','original_sampleRate','sampleRate','dest','converted_duration','converted_bitRate','body','role','user','UserProfileSection','Sounds','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','start','description','original_format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','get','UserProfileResource','destroy','error','stack','name','send','map','Sound','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','rows','catch','show','params','find','download','existsSync','join','server/files/sounds/converted','save_name','Sequelize','ValidationError','Sound\x20not\x20found','root','format','%s.%s','converted_format','create','basename','file','extname'];(function(_0x5d7f57,_0x48eda0){var _0x3d0515=function(_0x408dc1){while(--_0x408dc1){_0x5d7f57['push'](_0x5d7f57['shift']());}};_0x3d0515(++_0x48eda0);}(_0x81db,0x195));var _0xb81d=function(_0x25e8fd,_0x409eaa){_0x25e8fd=_0x25e8fd-0x0;var _0xa9ccab=_0x81db[_0x25e8fd];return _0xa9ccab;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb81d('0x0'));var zipdir=require(_0xb81d('0x1'));var jsonpatch=require(_0xb81d('0x2'));var rp=require(_0xb81d('0x3'));var moment=require(_0xb81d('0x4'));var BPromise=require(_0xb81d('0x5'));var Mustache=require(_0xb81d('0x6'));var util=require(_0xb81d('0x7'));var path=require('path');var sox=require(_0xb81d('0x8'));var csv=require(_0xb81d('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb81d('0xa'));var squel=require(_0xb81d('0xb'));var crypto=require(_0xb81d('0xc'));var jsforce=require(_0xb81d('0xd'));var deskjs=require(_0xb81d('0xe'));var toCsv=require(_0xb81d('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xb81d('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xb81d('0x10'));var hardwareService=require(_0xb81d('0x11'));var logger=require(_0xb81d('0x12'))(_0xb81d('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x36d873,_0x133c6b){_0x133c6b=_0x133c6b||0xcc;return function(_0x58bdb0){if(_0x58bdb0){return _0x36d873[_0xb81d('0x14')](_0x133c6b);}return _0x36d873[_0xb81d('0x15')](_0x133c6b)[_0xb81d('0x16')]();};}function respondWithResult(_0x2925ee,_0x56060d){_0x56060d=_0x56060d||0xc8;return function(_0x20f5ee){if(_0x20f5ee){return _0x2925ee[_0xb81d('0x15')](_0x56060d)[_0xb81d('0x17')](_0x20f5ee);}};}function respondWithFilteredResult(_0x139cc3,_0x454ff8){return function(_0x1cc8c3){if(_0x1cc8c3){var _0x1af317=typeof _0x454ff8[_0xb81d('0x18')]===_0xb81d('0x19')&&typeof _0x454ff8[_0xb81d('0x1a')]==='undefined';var _0x469520=_0x1cc8c3[_0xb81d('0x1b')];var _0x4dd62d=_0x1af317?0x0:_0x454ff8[_0xb81d('0x18')];var _0x5e6f79=_0x1af317?_0x1cc8c3[_0xb81d('0x1b')]:_0x454ff8['offset']+_0x454ff8['limit'];var _0xfe3f82;if(_0x5e6f79>=_0x469520){_0x5e6f79=_0x469520;_0xfe3f82=0xc8;}else{_0xfe3f82=0xce;}_0x139cc3[_0xb81d('0x15')](_0xfe3f82);return _0x139cc3[_0xb81d('0x1c')](_0xb81d('0x1d'),_0x4dd62d+'-'+_0x5e6f79+'/'+_0x469520)[_0xb81d('0x17')](_0x1cc8c3);}return null;};}function patchUpdates(_0x3503e4){return function(_0x212478){try{jsonpatch[_0xb81d('0x1e')](_0x212478,_0x3503e4,!![]);}catch(_0x1f33f8){return BPromise[_0xb81d('0x1f')](_0x1f33f8);}return _0x212478[_0xb81d('0x20')]();};}function saveUpdates(_0x37f325,_0x55a332){return function(_0x3c1124){if(_0x3c1124){return _0x3c1124[_0xb81d('0x21')](_0x37f325)[_0xb81d('0x22')](function(_0x58617e){return _0x58617e;});}return null;};}function removeEntity(_0x40726c,_0x44bceb){return function(_0x14c1f4){if(_0x14c1f4){return _0x14c1f4['destroy']()[_0xb81d('0x22')](function(){var _0x1b3d2c=_0x14c1f4[_0xb81d('0x23')]({'plain':!![]});var _0x2ec639='Sounds';return db[_0xb81d('0x24')][_0xb81d('0x25')]({'where':{'type':_0x2ec639,'resourceId':_0x1b3d2c['id']}})[_0xb81d('0x22')](function(){return _0x14c1f4;});})[_0xb81d('0x22')](function(){_0x40726c[_0xb81d('0x15')](0xcc)[_0xb81d('0x16')]();});}};}function handleEntityNotFound(_0x21f3a2,_0x5251d1){return function(_0x4bdf30){if(!_0x4bdf30){_0x21f3a2[_0xb81d('0x14')](0x194);}return _0x4bdf30;};}function handleError(_0x24198a,_0x53ce48){_0x53ce48=_0x53ce48||0x1f4;return function(_0x26e9cb){logger[_0xb81d('0x26')](_0x26e9cb[_0xb81d('0x27')]);if(_0x26e9cb['name']){delete _0x26e9cb[_0xb81d('0x28')];}_0x24198a[_0xb81d('0x15')](_0x53ce48)[_0xb81d('0x29')](_0x26e9cb);};}exports['index']=function(_0x14219c,_0x43f7f4){var _0x206624={},_0x2b5623={},_0x51b485={'count':0x0,'rows':[]};var _0x2b5706=_[_0xb81d('0x2a')](db[_0xb81d('0x2b')][_0xb81d('0x2c')],function(_0x359c93){return{'name':_0x359c93[_0xb81d('0x2d')],'type':_0x359c93[_0xb81d('0x2e')]['key']};});_0x2b5623[_0xb81d('0x2f')]=_[_0xb81d('0x2a')](_0x2b5706,_0xb81d('0x28'));_0x2b5623[_0xb81d('0x30')]=_[_0xb81d('0x31')](_0x14219c[_0xb81d('0x30')]);_0x2b5623[_0xb81d('0x32')]=_[_0xb81d('0x33')](_0x2b5623[_0xb81d('0x2f')],_0x2b5623[_0xb81d('0x30')]);_0x206624['attributes']=_[_0xb81d('0x33')](_0x2b5623[_0xb81d('0x2f')],qs[_0xb81d('0x34')](_0x14219c[_0xb81d('0x30')][_0xb81d('0x34')]));_0x206624[_0xb81d('0x35')]=_0x206624[_0xb81d('0x35')][_0xb81d('0x36')]?_0x206624[_0xb81d('0x35')]:_0x2b5623[_0xb81d('0x2f')];if(!_0x14219c[_0xb81d('0x30')][_0xb81d('0x37')](_0xb81d('0x38'))){_0x206624[_0xb81d('0x1a')]=qs['limit'](_0x14219c[_0xb81d('0x30')]['limit']);_0x206624[_0xb81d('0x18')]=qs[_0xb81d('0x18')](_0x14219c[_0xb81d('0x30')][_0xb81d('0x18')]);}_0x206624[_0xb81d('0x39')]=qs['sort'](_0x14219c[_0xb81d('0x30')][_0xb81d('0x3a')]);_0x206624[_0xb81d('0x3b')]=qs[_0xb81d('0x32')](_[_0xb81d('0x3c')](_0x14219c[_0xb81d('0x30')],_0x2b5623[_0xb81d('0x32')]),_0x2b5706);if(_0x14219c[_0xb81d('0x30')][_0xb81d('0x3d')]){_0x206624[_0xb81d('0x3b')]=_[_0xb81d('0x3e')](_0x206624[_0xb81d('0x3b')],{'$or':_[_0xb81d('0x2a')](_0x2b5706,function(_0x2e87bf){if(_0x2e87bf[_0xb81d('0x2e')]!==_0xb81d('0x3f')){var _0x5a639a={};_0x5a639a[_0x2e87bf[_0xb81d('0x28')]]={'$like':'%'+_0x14219c[_0xb81d('0x30')][_0xb81d('0x3d')]+'%'};return _0x5a639a;}})});}_0x206624=_[_0xb81d('0x3e')]({},_0x206624,_0x14219c['options']);var _0x17ae13={'where':_0x206624[_0xb81d('0x3b')]};return db[_0xb81d('0x2b')][_0xb81d('0x1b')](_0x17ae13)['then'](function(_0x99ecf6){_0x51b485[_0xb81d('0x1b')]=_0x99ecf6;if(_0x14219c['query'][_0xb81d('0x40')]){_0x206624[_0xb81d('0x41')]=[{'all':!![]}];}return db['Sound']['findAll'](_0x206624);})[_0xb81d('0x22')](function(_0x9ec8ff){_0x51b485[_0xb81d('0x42')]=_0x9ec8ff;return _0x51b485;})[_0xb81d('0x22')](respondWithFilteredResult(_0x43f7f4,_0x206624))[_0xb81d('0x43')](handleError(_0x43f7f4,null));};exports[_0xb81d('0x44')]=function(_0x4d9e48,_0x4ae550){var _0x2b9fda={'raw':!![],'where':{'id':_0x4d9e48[_0xb81d('0x45')]['id']}},_0x5b4787={};_0x5b4787[_0xb81d('0x2f')]=_[_0xb81d('0x31')](db[_0xb81d('0x2b')][_0xb81d('0x2c')]);_0x5b4787[_0xb81d('0x30')]=_[_0xb81d('0x31')](_0x4d9e48['query']);_0x5b4787['filters']=_[_0xb81d('0x33')](_0x5b4787[_0xb81d('0x2f')],_0x5b4787['query']);_0x2b9fda[_0xb81d('0x35')]=_['intersection'](_0x5b4787[_0xb81d('0x2f')],qs[_0xb81d('0x34')](_0x4d9e48['query']['fields']));_0x2b9fda[_0xb81d('0x35')]=_0x2b9fda[_0xb81d('0x35')][_0xb81d('0x36')]?_0x2b9fda[_0xb81d('0x35')]:_0x5b4787[_0xb81d('0x2f')];if(_0x4d9e48[_0xb81d('0x30')]['includeAll']){_0x2b9fda[_0xb81d('0x41')]=[{'all':!![]}];}_0x2b9fda=_['merge']({},_0x2b9fda,_0x4d9e48['options']);return db['Sound'][_0xb81d('0x46')](_0x2b9fda)['then'](handleEntityNotFound(_0x4ae550,null))[_0xb81d('0x22')](respondWithResult(_0x4ae550,null))[_0xb81d('0x43')](handleError(_0x4ae550,null));};exports[_0xb81d('0x47')]=function(_0x5c7c8e,_0x4b4d0c,_0x32fdff){return db[_0xb81d('0x2b')]['find']({'where':{'id':_0x5c7c8e['params']['id']},'attributes':['name','save_name','converted_format'],'raw':!![]})['then'](handleEntityNotFound(_0x4b4d0c,null))[_0xb81d('0x22')](function(_0x3687bd){if(_0x3687bd){if(!fs[_0xb81d('0x48')](path[_0xb81d('0x49')](config['root'],_0xb81d('0x4a'),_0x3687bd[_0xb81d('0x4b')]+'.'+_0x3687bd['converted_format']))){throw new db[(_0xb81d('0x4c'))][(_0xb81d('0x4d'))](_0xb81d('0x4e'));}return _0x4b4d0c[_0xb81d('0x47')](path['join'](config[_0xb81d('0x4f')],_0xb81d('0x4a'),util[_0xb81d('0x50')](_0xb81d('0x51'),_0x3687bd[_0xb81d('0x4b')],_0x3687bd['converted_format'])),util['format'](_0xb81d('0x51'),_0x3687bd['name'],_0x3687bd[_0xb81d('0x52')]));}return null;})['catch'](handleError(_0x4b4d0c,null));};exports[_0xb81d('0x53')]=function(_0x5e8550,_0x42d883,_0xcd29d3){var _0x1318e7={'name':path[_0xb81d('0x54')](_0x5e8550[_0xb81d('0x55')]['originalname'],path[_0xb81d('0x56')](_0x5e8550[_0xb81d('0x55')][_0xb81d('0x57')])),'save_name':path['basename'](_0x5e8550[_0xb81d('0x55')][_0xb81d('0x58')],path[_0xb81d('0x56')](_0x5e8550['file'][_0xb81d('0x58')])),'original_format':path[_0xb81d('0x56')](_0x5e8550[_0xb81d('0x55')]['originalname'])[_0xb81d('0x59')](0x1),'converted_format':_0xb81d('0x5a')};var _0x28da4e=path[_0xb81d('0x49')](config[_0xb81d('0x4f')],_0xb81d('0x5b'),_0x5e8550[_0xb81d('0x55')][_0xb81d('0x58')]);var _0x2f908a=path[_0xb81d('0x49')](config[_0xb81d('0x4f')],_0xb81d('0x4a'),util['format'](_0xb81d('0x51'),path[_0xb81d('0x54')](_0x5e8550[_0xb81d('0x55')][_0xb81d('0x58')],path[_0xb81d('0x56')](_0x5e8550[_0xb81d('0x55')][_0xb81d('0x58')])),_0x1318e7['converted_format']));logger[_0xb81d('0x5c')](_0xb81d('0x5d'),_0x28da4e);logger[_0xb81d('0x5c')](_0xb81d('0x5e'),_0x2f908a);try{fs[_0xb81d('0x5f')](_0x28da4e,parseInt(_0xb81d('0x60'),0x8));var _0x281111=sox[_0xb81d('0x61')](_0x28da4e,_0x2f908a,{'sampleRate':0x1f40,'format':_0xb81d('0x5a'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x281111['on'](_0xb81d('0x26'),function(_0x33e995){fs[_0xb81d('0x62')](_0x28da4e);_0x42d883[_0xb81d('0x15')](0x1f4)[_0xb81d('0x29')](_0x33e995);});_0x281111['on'](_0xb81d('0x63'),function(_0x33aabb){_0x1318e7[_0xb81d('0x64')]=isNaN(_0x33aabb[_0xb81d('0x65')])?null:_0x33aabb[_0xb81d('0x65')]*0x3e8;_0x1318e7[_0xb81d('0x66')]=isNaN(_0x33aabb[_0xb81d('0x67')])?null:_0x33aabb['sampleCount'];_0x1318e7['original_channelCount']=isNaN(_0x33aabb['channelCount'])?null:_0x33aabb[_0xb81d('0x68')];_0x1318e7[_0xb81d('0x69')]=isNaN(_0x33aabb[_0xb81d('0x6a')])?null:_0x33aabb[_0xb81d('0x6a')];_0x1318e7[_0xb81d('0x6b')]=isNaN(_0x33aabb[_0xb81d('0x6c')])?null:_0x33aabb['sampleRate'];});_0x281111['on'](_0xb81d('0x6d'),function(_0x5af362){_0x1318e7[_0xb81d('0x6e')]=isNaN(_0x5af362[_0xb81d('0x65')])?null:_0x5af362[_0xb81d('0x65')]*0x3e8;_0x1318e7['converted_sampleCount']=isNaN(_0x5af362[_0xb81d('0x67')])?null:_0x5af362['sampleCount'];_0x1318e7['converted_channelCount']=isNaN(_0x5af362['channelCount'])?null:_0x5af362[_0xb81d('0x68')];_0x1318e7[_0xb81d('0x6f')]=isNaN(_0x5af362['bitRate'])?null:_0x5af362['bitRate'];_0x1318e7['converted_sampleRate']=isNaN(_0x5af362[_0xb81d('0x6c')])?null:_0x5af362[_0xb81d('0x6c')];});_0x281111['on'](_0xb81d('0x16'),function(){fs[_0xb81d('0x5f')](_0x2f908a,parseInt(_0xb81d('0x60'),0x8));return db[_0xb81d('0x2b')][_0xb81d('0x53')](_0x1318e7)[_0xb81d('0x22')](function(_0x2fc91c){var _0xeef433={'role':_0x5e8550[_0xb81d('0x70')][_0xb81d('0x71')],'userProfileId':_0x5e8550[_0xb81d('0x70')]['userProfileId']};if(!_0xeef433)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xeef433[_0xb81d('0x71')]===_0xb81d('0x72')){var _0x27ded9=_0x2fc91c[_0xb81d('0x23')]({'plain':!![]});return db[_0xb81d('0x73')]['find']({'where':{'name':_0xb81d('0x74'),'userProfileId':_0xeef433[_0xb81d('0x75')]},'raw':!![]})[_0xb81d('0x22')](function(_0xb7c1a3){if(_0xb7c1a3&&_0xb7c1a3[_0xb81d('0x76')]===0x0){return db['UserProfileResource'][_0xb81d('0x53')]({'name':_0x27ded9[_0xb81d('0x28')],'resourceId':_0x27ded9['id'],'type':_0xb7c1a3[_0xb81d('0x28')],'sectionId':_0xb7c1a3['id']},{})[_0xb81d('0x22')](function(){return _0x2fc91c;});}else{return _0x2fc91c;}})[_0xb81d('0x43')](function(_0x2334ac){logger[_0xb81d('0x26')](_0xb81d('0x77'),_0x2334ac);throw _0x2334ac;});}return _0x2fc91c;})[_0xb81d('0x22')](respondWithResult(_0x42d883,null))[_0xb81d('0x43')](handleError(_0x42d883,null));});_0x281111[_0xb81d('0x78')]();}catch(_0x4a2de7){_0x42d883[_0xb81d('0x15')](0x1f4)[_0xb81d('0x29')](_0x4a2de7);}};exports[_0xb81d('0x21')]=function(_0x47c3ff,_0x22d73e,_0xd14206){return db[_0xb81d('0x2b')]['find']({'where':{'id':_0x47c3ff[_0xb81d('0x45')]['id']}})[_0xb81d('0x22')](handleEntityNotFound(_0x22d73e,null))[_0xb81d('0x22')](saveUpdates(_[_0xb81d('0x3c')](_0x47c3ff[_0xb81d('0x70')],[_0xb81d('0x28'),_0xb81d('0x79')]),null))['then'](respondWithResult(_0x22d73e,null))[_0xb81d('0x43')](handleError(_0x22d73e,null));};exports['delete']=function(_0x13c62e,_0x15e847,_0x269a37){return db[_0xb81d('0x2b')][_0xb81d('0x46')]({'where':{'id':_0x13c62e[_0xb81d('0x45')]['id']}})[_0xb81d('0x22')](function(_0xd08e1c){if(_0xd08e1c){return _0xd08e1c[_0xb81d('0x25')]();}})[_0xb81d('0x22')](function(_0x492708){var _0x42612f=path[_0xb81d('0x49')](config[_0xb81d('0x4f')],'server/files/sounds/original',util[_0xb81d('0x50')](_0xb81d('0x51'),_0x492708[_0xb81d('0x4b')],_0x492708[_0xb81d('0x7a')]));var _0x41a4f0=path['join'](config[_0xb81d('0x4f')],_0xb81d('0x4a'),util[_0xb81d('0x50')](_0xb81d('0x51'),_0x492708[_0xb81d('0x4b')],_0x492708[_0xb81d('0x52')]));fs['unlinkSync'](_0x42612f);fs['unlinkSync'](_0x41a4f0);return _0x492708;})['then'](function(_0xb3dbb1){if(_0xb3dbb1){return _0x15e847['status'](0xcc)[_0xb81d('0x16')]();}})[_0xb81d('0x22')](handleEntityNotFound(_0x15e847,null))[_0xb81d('0x43')](handleError(_0x15e847,null));}; \ No newline at end of file +var _0x6767=['sox','to-csv','fs-extra','squel','crypto','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','apply','reject','save','update','then','destroy','get','Sounds','UserProfileResource','error','name','send','map','Sound','fieldName','type','model','keys','intersection','query','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','options','includeAll','include','findAll','rows','catch','show','rawAttributes','length','find','params','save_name','converted_format','existsSync','join','root','server/files/sounds/converted','ValidationError','Sound\x20not\x20found','download','format','%s.%s','basename','file','originalname','extname','filename','server/files/sounds/original','info','0777','transcode','wav','unlinkSync','original_duration','duration','original_sampleCount','sampleCount','original_channelCount','channelCount','original_bitRate','bitRate','sampleRate','dest','converted_duration','converted_sampleCount','converted_bitRate','chmodSync','create','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','description','original_format','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util'];(function(_0x17aaf5,_0x342c3b){var _0x120f8b=function(_0x3a5c31){while(--_0x3a5c31){_0x17aaf5['push'](_0x17aaf5['shift']());}};_0x120f8b(++_0x342c3b);}(_0x6767,0x1d0));var _0x7676=function(_0x320708,_0x4ed02f){_0x320708=_0x320708-0x0;var _0xd2bfe9=_0x6767[_0x320708];return _0xd2bfe9;};'use strict';var emlformat=require(_0x7676('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7676('0x1'));var jsonpatch=require(_0x7676('0x2'));var rp=require(_0x7676('0x3'));var moment=require(_0x7676('0x4'));var BPromise=require(_0x7676('0x5'));var Mustache=require(_0x7676('0x6'));var util=require(_0x7676('0x7'));var path=require('path');var sox=require(_0x7676('0x8'));var csv=require(_0x7676('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7676('0xa'));var _=require('lodash');var squel=require(_0x7676('0xb'));var crypto=require(_0x7676('0xc'));var jsforce=require(_0x7676('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x7676('0x9'));var querystring=require('querystring');var Papa=require(_0x7676('0xe'));var Redis=require('ioredis');var authService=require(_0x7676('0xf'));var qs=require(_0x7676('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x7676('0x11'));var utils=require(_0x7676('0x12'));var config=require(_0x7676('0x13'));var licenseUtil=require(_0x7676('0x14'));var db=require(_0x7676('0x15'))['db'];function respondWithStatusCode(_0x1cbeba,_0x475845){_0x475845=_0x475845||0xcc;return function(_0x38c271){if(_0x38c271){return _0x1cbeba[_0x7676('0x16')](_0x475845);}return _0x1cbeba[_0x7676('0x17')](_0x475845)[_0x7676('0x18')]();};}function respondWithResult(_0x456f0b,_0x57cbd0){_0x57cbd0=_0x57cbd0||0xc8;return function(_0x170e9a){if(_0x170e9a){return _0x456f0b[_0x7676('0x17')](_0x57cbd0)[_0x7676('0x19')](_0x170e9a);}};}function respondWithFilteredResult(_0x233899,_0xfb5ae4){return function(_0x210a6c){if(_0x210a6c){var _0x22b18=typeof _0xfb5ae4[_0x7676('0x1a')]===_0x7676('0x1b')&&typeof _0xfb5ae4['limit']==='undefined';var _0x39df7d=_0x210a6c[_0x7676('0x1c')];var _0x9d6e5a=_0x22b18?0x0:_0xfb5ae4[_0x7676('0x1a')];var _0x3e765d=_0x22b18?_0x210a6c[_0x7676('0x1c')]:_0xfb5ae4[_0x7676('0x1a')]+_0xfb5ae4[_0x7676('0x1d')];var _0x507ed9;if(_0x3e765d>=_0x39df7d){_0x3e765d=_0x39df7d;_0x507ed9=0xc8;}else{_0x507ed9=0xce;}_0x233899[_0x7676('0x17')](_0x507ed9);return _0x233899['set']('Content-Range',_0x9d6e5a+'-'+_0x3e765d+'/'+_0x39df7d)[_0x7676('0x19')](_0x210a6c);}return null;};}function patchUpdates(_0x36cd1c){return function(_0x15579b){try{jsonpatch[_0x7676('0x1e')](_0x15579b,_0x36cd1c,!![]);}catch(_0x849ca7){return BPromise[_0x7676('0x1f')](_0x849ca7);}return _0x15579b[_0x7676('0x20')]();};}function saveUpdates(_0x5f0c32,_0x580585){return function(_0x1e5eb6){if(_0x1e5eb6){return _0x1e5eb6[_0x7676('0x21')](_0x5f0c32)[_0x7676('0x22')](function(_0x4937c2){return _0x4937c2;});}return null;};}function removeEntity(_0x22c8fd,_0x376a1c){return function(_0x10155a){if(_0x10155a){return _0x10155a[_0x7676('0x23')]()[_0x7676('0x22')](function(){var _0x4ebf5f=_0x10155a[_0x7676('0x24')]({'plain':!![]});var _0x470234=_0x7676('0x25');return db[_0x7676('0x26')]['destroy']({'where':{'type':_0x470234,'resourceId':_0x4ebf5f['id']}})[_0x7676('0x22')](function(){return _0x10155a;});})['then'](function(){_0x22c8fd[_0x7676('0x17')](0xcc)[_0x7676('0x18')]();});}};}function handleEntityNotFound(_0x153e92,_0x2454e9){return function(_0x44c9c5){if(!_0x44c9c5){_0x153e92[_0x7676('0x16')](0x194);}return _0x44c9c5;};}function handleError(_0x57df0d,_0x2d6392){_0x2d6392=_0x2d6392||0x1f4;return function(_0x29a45e){logger[_0x7676('0x27')](_0x29a45e['stack']);if(_0x29a45e['name']){delete _0x29a45e[_0x7676('0x28')];}_0x57df0d[_0x7676('0x17')](_0x2d6392)[_0x7676('0x29')](_0x29a45e);};}exports['index']=function(_0x4cd4fa,_0x23ae47){var _0xba89c1={},_0x150117={},_0x238f77={'count':0x0,'rows':[]};var _0x3019e5=_[_0x7676('0x2a')](db[_0x7676('0x2b')]['rawAttributes'],function(_0x43f749){return{'name':_0x43f749[_0x7676('0x2c')],'type':_0x43f749[_0x7676('0x2d')]['key']};});_0x150117[_0x7676('0x2e')]=_[_0x7676('0x2a')](_0x3019e5,_0x7676('0x28'));_0x150117['query']=_[_0x7676('0x2f')](_0x4cd4fa['query']);_0x150117['filters']=_[_0x7676('0x30')](_0x150117[_0x7676('0x2e')],_0x150117[_0x7676('0x31')]);_0xba89c1[_0x7676('0x32')]=_[_0x7676('0x30')](_0x150117[_0x7676('0x2e')],qs[_0x7676('0x33')](_0x4cd4fa['query']['fields']));_0xba89c1[_0x7676('0x32')]=_0xba89c1[_0x7676('0x32')]['length']?_0xba89c1['attributes']:_0x150117['model'];if(!_0x4cd4fa[_0x7676('0x31')][_0x7676('0x34')](_0x7676('0x35'))){_0xba89c1[_0x7676('0x1d')]=qs[_0x7676('0x1d')](_0x4cd4fa[_0x7676('0x31')][_0x7676('0x1d')]);_0xba89c1[_0x7676('0x1a')]=qs['offset'](_0x4cd4fa[_0x7676('0x31')][_0x7676('0x1a')]);}_0xba89c1[_0x7676('0x36')]=qs[_0x7676('0x37')](_0x4cd4fa[_0x7676('0x31')][_0x7676('0x37')]);_0xba89c1[_0x7676('0x38')]=qs[_0x7676('0x39')](_['pick'](_0x4cd4fa['query'],_0x150117[_0x7676('0x39')]),_0x3019e5);if(_0x4cd4fa['query'][_0x7676('0x3a')]){_0xba89c1['where']=_[_0x7676('0x3b')](_0xba89c1[_0x7676('0x38')],{'$or':_[_0x7676('0x2a')](_0x3019e5,function(_0x15c7d5){if(_0x15c7d5[_0x7676('0x2d')]!=='VIRTUAL'){var _0x202123={};_0x202123[_0x15c7d5[_0x7676('0x28')]]={'$like':'%'+_0x4cd4fa[_0x7676('0x31')]['filter']+'%'};return _0x202123;}})});}_0xba89c1=_['merge']({},_0xba89c1,_0x4cd4fa[_0x7676('0x3c')]);var _0x2128ec={'where':_0xba89c1[_0x7676('0x38')]};return db[_0x7676('0x2b')][_0x7676('0x1c')](_0x2128ec)[_0x7676('0x22')](function(_0x26d20b){_0x238f77['count']=_0x26d20b;if(_0x4cd4fa['query'][_0x7676('0x3d')]){_0xba89c1[_0x7676('0x3e')]=[{'all':!![]}];}return db['Sound'][_0x7676('0x3f')](_0xba89c1);})[_0x7676('0x22')](function(_0xb74e09){_0x238f77[_0x7676('0x40')]=_0xb74e09;return _0x238f77;})[_0x7676('0x22')](respondWithFilteredResult(_0x23ae47,_0xba89c1))[_0x7676('0x41')](handleError(_0x23ae47,null));};exports[_0x7676('0x42')]=function(_0x2c1c30,_0x3df72a){var _0x8b1f66={'raw':!![],'where':{'id':_0x2c1c30['params']['id']}},_0x248811={};_0x248811[_0x7676('0x2e')]=_[_0x7676('0x2f')](db[_0x7676('0x2b')][_0x7676('0x43')]);_0x248811[_0x7676('0x31')]=_[_0x7676('0x2f')](_0x2c1c30['query']);_0x248811[_0x7676('0x39')]=_[_0x7676('0x30')](_0x248811[_0x7676('0x2e')],_0x248811[_0x7676('0x31')]);_0x8b1f66['attributes']=_['intersection'](_0x248811['model'],qs[_0x7676('0x33')](_0x2c1c30[_0x7676('0x31')][_0x7676('0x33')]));_0x8b1f66['attributes']=_0x8b1f66[_0x7676('0x32')][_0x7676('0x44')]?_0x8b1f66[_0x7676('0x32')]:_0x248811[_0x7676('0x2e')];if(_0x2c1c30['query'][_0x7676('0x3d')]){_0x8b1f66[_0x7676('0x3e')]=[{'all':!![]}];}_0x8b1f66=_[_0x7676('0x3b')]({},_0x8b1f66,_0x2c1c30[_0x7676('0x3c')]);return db[_0x7676('0x2b')][_0x7676('0x45')](_0x8b1f66)[_0x7676('0x22')](handleEntityNotFound(_0x3df72a,null))[_0x7676('0x22')](respondWithResult(_0x3df72a,null))[_0x7676('0x41')](handleError(_0x3df72a,null));};exports['download']=function(_0xf9be24,_0x5685fb,_0x53123d){return db[_0x7676('0x2b')][_0x7676('0x45')]({'where':{'id':_0xf9be24[_0x7676('0x46')]['id']},'attributes':[_0x7676('0x28'),_0x7676('0x47'),_0x7676('0x48')],'raw':!![]})['then'](handleEntityNotFound(_0x5685fb,null))[_0x7676('0x22')](function(_0x28e347){if(_0x28e347){if(!fs[_0x7676('0x49')](path[_0x7676('0x4a')](config[_0x7676('0x4b')],_0x7676('0x4c'),_0x28e347[_0x7676('0x47')]+'.'+_0x28e347[_0x7676('0x48')]))){throw new db['Sequelize'][(_0x7676('0x4d'))](_0x7676('0x4e'));}return _0x5685fb[_0x7676('0x4f')](path[_0x7676('0x4a')](config[_0x7676('0x4b')],_0x7676('0x4c'),util[_0x7676('0x50')](_0x7676('0x51'),_0x28e347[_0x7676('0x47')],_0x28e347[_0x7676('0x48')])),util['format'](_0x7676('0x51'),_0x28e347[_0x7676('0x28')],_0x28e347[_0x7676('0x48')]));}return null;})['catch'](handleError(_0x5685fb,null));};exports['create']=function(_0x203ecd,_0x46d4d5,_0x52da23){var _0x6aad3a={'name':path[_0x7676('0x52')](_0x203ecd[_0x7676('0x53')][_0x7676('0x54')],path[_0x7676('0x55')](_0x203ecd[_0x7676('0x53')][_0x7676('0x54')])),'save_name':path['basename'](_0x203ecd['file'][_0x7676('0x56')],path[_0x7676('0x55')](_0x203ecd[_0x7676('0x53')][_0x7676('0x56')])),'original_format':path['extname'](_0x203ecd[_0x7676('0x53')][_0x7676('0x54')])['substring'](0x1),'converted_format':'wav'};var _0x1307db=path[_0x7676('0x4a')](config['root'],_0x7676('0x57'),_0x203ecd[_0x7676('0x53')]['filename']);var _0x47dc9f=path[_0x7676('0x4a')](config[_0x7676('0x4b')],_0x7676('0x4c'),util['format']('%s.%s',path['basename'](_0x203ecd[_0x7676('0x53')]['filename'],path[_0x7676('0x55')](_0x203ecd[_0x7676('0x53')][_0x7676('0x56')])),_0x6aad3a[_0x7676('0x48')]));logger[_0x7676('0x58')]('Sound\x20upload\x20filepath:\x20%s',_0x1307db);logger[_0x7676('0x58')]('Sound\x20upload\x20destination:\x20%s',_0x47dc9f);try{fs['chmodSync'](_0x1307db,parseInt(_0x7676('0x59'),0x8));var _0x3ee52f=sox[_0x7676('0x5a')](_0x1307db,_0x47dc9f,{'sampleRate':0x1f40,'format':_0x7676('0x5b'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x3ee52f['on'](_0x7676('0x27'),function(_0x2c68c5){fs[_0x7676('0x5c')](_0x1307db);_0x46d4d5['status'](0x1f4)[_0x7676('0x29')](_0x2c68c5);});_0x3ee52f['on']('src',function(_0x56a8c1){_0x6aad3a[_0x7676('0x5d')]=isNaN(_0x56a8c1[_0x7676('0x5e')])?null:_0x56a8c1[_0x7676('0x5e')]*0x3e8;_0x6aad3a[_0x7676('0x5f')]=isNaN(_0x56a8c1[_0x7676('0x60')])?null:_0x56a8c1[_0x7676('0x60')];_0x6aad3a[_0x7676('0x61')]=isNaN(_0x56a8c1['channelCount'])?null:_0x56a8c1[_0x7676('0x62')];_0x6aad3a[_0x7676('0x63')]=isNaN(_0x56a8c1['bitRate'])?null:_0x56a8c1[_0x7676('0x64')];_0x6aad3a['original_sampleRate']=isNaN(_0x56a8c1[_0x7676('0x65')])?null:_0x56a8c1[_0x7676('0x65')];});_0x3ee52f['on'](_0x7676('0x66'),function(_0xdf709b){_0x6aad3a[_0x7676('0x67')]=isNaN(_0xdf709b[_0x7676('0x5e')])?null:_0xdf709b[_0x7676('0x5e')]*0x3e8;_0x6aad3a[_0x7676('0x68')]=isNaN(_0xdf709b[_0x7676('0x60')])?null:_0xdf709b[_0x7676('0x60')];_0x6aad3a['converted_channelCount']=isNaN(_0xdf709b[_0x7676('0x62')])?null:_0xdf709b['channelCount'];_0x6aad3a[_0x7676('0x69')]=isNaN(_0xdf709b['bitRate'])?null:_0xdf709b[_0x7676('0x64')];_0x6aad3a['converted_sampleRate']=isNaN(_0xdf709b[_0x7676('0x65')])?null:_0xdf709b['sampleRate'];});_0x3ee52f['on'](_0x7676('0x18'),function(){fs[_0x7676('0x6a')](_0x47dc9f,parseInt(_0x7676('0x59'),0x8));return db[_0x7676('0x2b')][_0x7676('0x6b')](_0x6aad3a)[_0x7676('0x22')](function(_0x5eddf1){var _0x1c8485={'role':_0x203ecd[_0x7676('0x6c')][_0x7676('0x6d')],'userProfileId':_0x203ecd[_0x7676('0x6c')][_0x7676('0x6e')]};if(!_0x1c8485)throw new Error(_0x7676('0x6f'));if(_0x1c8485[_0x7676('0x6d')]===_0x7676('0x70')){var _0x48c10d=_0x5eddf1[_0x7676('0x24')]({'plain':!![]});return db[_0x7676('0x71')][_0x7676('0x45')]({'where':{'name':_0x7676('0x25'),'userProfileId':_0x1c8485[_0x7676('0x6e')]},'raw':!![]})[_0x7676('0x22')](function(_0x446394){if(_0x446394&&_0x446394[_0x7676('0x72')]===0x0){return db[_0x7676('0x26')][_0x7676('0x6b')]({'name':_0x48c10d[_0x7676('0x28')],'resourceId':_0x48c10d['id'],'type':_0x446394['name'],'sectionId':_0x446394['id']},{})[_0x7676('0x22')](function(){return _0x5eddf1;});}else{return _0x5eddf1;}})['catch'](function(_0x5ab2d3){logger[_0x7676('0x27')](_0x7676('0x73'),_0x5ab2d3);throw _0x5ab2d3;});}return _0x5eddf1;})[_0x7676('0x22')](respondWithResult(_0x46d4d5,null))[_0x7676('0x41')](handleError(_0x46d4d5,null));});_0x3ee52f['start']();}catch(_0x3003fe){_0x46d4d5[_0x7676('0x17')](0x1f4)[_0x7676('0x29')](_0x3003fe);}};exports['update']=function(_0x39c20c,_0x672716,_0x45ac72){return db[_0x7676('0x2b')]['find']({'where':{'id':_0x39c20c['params']['id']}})[_0x7676('0x22')](handleEntityNotFound(_0x672716,null))['then'](saveUpdates(_['pick'](_0x39c20c[_0x7676('0x6c')],[_0x7676('0x28'),_0x7676('0x74')]),null))[_0x7676('0x22')](respondWithResult(_0x672716,null))['catch'](handleError(_0x672716,null));};exports['delete']=function(_0x338482,_0x3108e0,_0x5eaaa4){return db[_0x7676('0x2b')][_0x7676('0x45')]({'where':{'id':_0x338482['params']['id']}})[_0x7676('0x22')](function(_0x4379c9){if(_0x4379c9){return _0x4379c9[_0x7676('0x23')]();}})[_0x7676('0x22')](function(_0x54434c){var _0x10f5fd=path[_0x7676('0x4a')](config[_0x7676('0x4b')],'server/files/sounds/original',util[_0x7676('0x50')](_0x7676('0x51'),_0x54434c['save_name'],_0x54434c[_0x7676('0x75')]));var _0x5c1c53=path[_0x7676('0x4a')](config[_0x7676('0x4b')],'server/files/sounds/converted',util[_0x7676('0x50')](_0x7676('0x51'),_0x54434c[_0x7676('0x47')],_0x54434c[_0x7676('0x48')]));fs['unlinkSync'](_0x10f5fd);fs['unlinkSync'](_0x5c1c53);return _0x54434c;})['then'](function(_0x12b104){if(_0x12b104){return _0x3108e0[_0x7676('0x17')](0xcc)[_0x7676('0x18')]();}})['then'](handleEntityNotFound(_0x3108e0,null))['catch'](handleError(_0x3108e0,null));}; \ No newline at end of file diff --git a/server/api/sound/sound.model.js b/server/api/sound/sound.model.js index 155ec3b..36115b5 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 _0x8986=['rimraf','./sound.attributes','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x8986,0x1c4));var _0x6898=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x8986[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0x6898('0x0'));var util=require(_0x6898('0x1'));var logger=require(_0x6898('0x2'))(_0x6898('0x3'));var moment=require(_0x6898('0x4'));var BPromise=require(_0x6898('0x5'));var rp=require(_0x6898('0x6'));var fs=require('fs');var path=require(_0x6898('0x7'));var rimraf=require(_0x6898('0x8'));var config=require('../../config/environment');var attributes=require(_0x6898('0x9'));module['exports']=function(_0x933fb1,_0x1e79f6){return _0x933fb1['define']('Sound',attributes,{'tableName':'tools_sounds','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf8ff=['./sound.attributes','exports','Sound','tools_sounds','util','../../config/logger','bluebird','request-promise','path','../../config/environment'];(function(_0x20a558,_0x160e0e){var _0x53d3f7=function(_0x259bd8){while(--_0x259bd8){_0x20a558['push'](_0x20a558['shift']());}};_0x53d3f7(++_0x160e0e);}(_0xf8ff,0xea));var _0xff8f=function(_0x4a9beb,_0x159482){_0x4a9beb=_0x4a9beb-0x0;var _0x2d4c58=_0xf8ff[_0x4a9beb];return _0x2d4c58;};'use strict';var _=require('lodash');var util=require(_0xff8f('0x0'));var logger=require(_0xff8f('0x1'))('api');var moment=require('moment');var BPromise=require(_0xff8f('0x2'));var rp=require(_0xff8f('0x3'));var fs=require('fs');var path=require(_0xff8f('0x4'));var rimraf=require('rimraf');var config=require(_0xff8f('0x5'));var attributes=require(_0xff8f('0x6'));module[_0xff8f('0x7')]=function(_0xbd69e8,_0x2f6b2a){return _0xbd69e8['define'](_0xff8f('0x8'),attributes,{'tableName':_0xff8f('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/sound/sound.rpc.js b/server/api/sound/sound.rpc.js index 17de407..62a590d 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 _0x9a56=['find','options','raw','where','map','include','model','attributes','lodash','moment','bluebird','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','Sound,\x20%s,\x20%s','debug','Sound,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','ShowSound','Sound'];(function(_0x57fa33,_0x2b8222){var _0x12e724=function(_0x481a33){while(--_0x481a33){_0x57fa33['push'](_0x57fa33['shift']());}};_0x12e724(++_0x2b8222);}(_0x9a56,0x11f));var _0x69a5=function(_0x232c7a,_0x3fa4fa){_0x232c7a=_0x232c7a-0x0;var _0x37d42d=_0x9a56[_0x232c7a];return _0x37d42d;};'use strict';var _=require(_0x69a5('0x0'));var util=require('util');var moment=require(_0x69a5('0x1'));var BPromise=require(_0x69a5('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x69a5('0x3'));var logger=require(_0x69a5('0x4'))(_0x69a5('0x5'));var config=require(_0x69a5('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x69a5('0x7')]({'port':0x232a});function respondWithRpcPromise(_0xfa9f58,_0x3b7e70,_0x4d9708){return new BPromise(function(_0x2410b1,_0x493b79){return client[_0x69a5('0x8')](_0xfa9f58,_0x4d9708)[_0x69a5('0x9')](function(_0x46d0ba){logger[_0x69a5('0xa')](_0x69a5('0xb'),_0x3b7e70,'request\x20sent');logger[_0x69a5('0xc')](_0x69a5('0xd'),_0x3b7e70,_0x69a5('0xe'),JSON[_0x69a5('0xf')](_0x46d0ba));if(_0x46d0ba[_0x69a5('0x10')]){if(_0x46d0ba[_0x69a5('0x10')][_0x69a5('0x11')]===0x1f4){logger[_0x69a5('0x10')](_0x69a5('0xb'),_0x3b7e70,_0x46d0ba[_0x69a5('0x10')][_0x69a5('0x12')]);return _0x493b79(_0x46d0ba[_0x69a5('0x10')][_0x69a5('0x12')]);}logger[_0x69a5('0x10')]('Sound,\x20%s,\x20%s',_0x3b7e70,_0x46d0ba[_0x69a5('0x10')][_0x69a5('0x12')]);return _0x2410b1(_0x46d0ba[_0x69a5('0x10')][_0x69a5('0x12')]);}else{logger['info'](_0x69a5('0xb'),_0x3b7e70,_0x69a5('0xe'));_0x2410b1(_0x46d0ba[_0x69a5('0x13')][_0x69a5('0x12')]);}})[_0x69a5('0x14')](function(_0x21af03){logger[_0x69a5('0x10')]('Sound,\x20%s,\x20%s',_0x3b7e70,_0x21af03);_0x493b79(_0x21af03);});});}exports[_0x69a5('0x15')]=function(_0x2f9d82){var _0x20cae5=this;return new Promise(function(_0x15196c,_0x36b3ea){return db[_0x69a5('0x16')][_0x69a5('0x17')]({'raw':_0x2f9d82['options']?_0x2f9d82[_0x69a5('0x18')][_0x69a5('0x19')]===undefined?!![]:![]:!![],'where':_0x2f9d82[_0x69a5('0x18')]?_0x2f9d82['options'][_0x69a5('0x1a')]||null:null,'attributes':_0x2f9d82['options']?_0x2f9d82[_0x69a5('0x18')]['attributes']||null:null,'include':_0x2f9d82['options']?_0x2f9d82[_0x69a5('0x18')]['include']?_[_0x69a5('0x1b')](_0x2f9d82[_0x69a5('0x18')][_0x69a5('0x1c')],function(_0x22b237){return{'model':db[_0x22b237[_0x69a5('0x1d')]],'as':_0x22b237['as'],'attributes':_0x22b237[_0x69a5('0x1e')],'include':_0x22b237[_0x69a5('0x1c')]?_[_0x69a5('0x1b')](_0x22b237[_0x69a5('0x1c')],function(_0x271143){return{'model':db[_0x271143[_0x69a5('0x1d')]],'as':_0x271143['as'],'attributes':_0x271143['attributes'],'include':_0x271143[_0x69a5('0x1c')]?_[_0x69a5('0x1b')](_0x271143[_0x69a5('0x1c')],function(_0x3ffe28){return{'model':db[_0x3ffe28[_0x69a5('0x1d')]],'as':_0x3ffe28['as'],'attributes':_0x3ffe28[_0x69a5('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x69a5('0x9')](function(_0x8a25e4){logger['info']('ShowSound',_0x2f9d82);logger[_0x69a5('0xc')](_0x69a5('0x15'),_0x2f9d82,JSON[_0x69a5('0xf')](_0x8a25e4));_0x15196c(_0x8a25e4);})[_0x69a5('0x14')](function(_0x5b9cb8){logger['error'](_0x69a5('0x15'),_0x5b9cb8[_0x69a5('0x12')],_0x2f9d82);_0x36b3ea(_0x20cae5[_0x69a5('0x10')](0x1f4,_0x5b9cb8[_0x69a5('0x12')]));});});}; \ No newline at end of file +var _0xf3ce=['where','include','map','attributes','model','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','Sound,\x20%s,\x20%s','debug','Sound,\x20%s,\x20%s,\x20%s','stringify','error','message','info','catch','ShowSound','find','options','raw'];(function(_0x3b3224,_0x1c1138){var _0x3a71fa=function(_0x2acda7){while(--_0x2acda7){_0x3b3224['push'](_0x3b3224['shift']());}};_0x3a71fa(++_0x1c1138);}(_0xf3ce,0x145));var _0xef3c=function(_0x2e0854,_0x52544a){_0x2e0854=_0x2e0854-0x0;var _0x4d0ff9=_0xf3ce[_0x2e0854];return _0x4d0ff9;};'use strict';var _=require(_0xef3c('0x0'));var util=require(_0xef3c('0x1'));var moment=require(_0xef3c('0x2'));var BPromise=require(_0xef3c('0x3'));var rs=require(_0xef3c('0x4'));var fs=require('fs');var Redis=require(_0xef3c('0x5'));var db=require(_0xef3c('0x6'))['db'];var utils=require(_0xef3c('0x7'));var logger=require(_0xef3c('0x8'))(_0xef3c('0x9'));var config=require('../../config/environment');var jayson=require(_0xef3c('0xa'));var client=jayson[_0xef3c('0xb')][_0xef3c('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1632bf,_0x3da5dd,_0x447c76){return new BPromise(function(_0x332cfa,_0x4af6bb){return client[_0xef3c('0xd')](_0x1632bf,_0x447c76)[_0xef3c('0xe')](function(_0x274a0f){logger['info'](_0xef3c('0xf'),_0x3da5dd,'request\x20sent');logger[_0xef3c('0x10')](_0xef3c('0x11'),_0x3da5dd,'request\x20sent',JSON[_0xef3c('0x12')](_0x274a0f));if(_0x274a0f[_0xef3c('0x13')]){if(_0x274a0f[_0xef3c('0x13')]['code']===0x1f4){logger[_0xef3c('0x13')](_0xef3c('0xf'),_0x3da5dd,_0x274a0f[_0xef3c('0x13')]['message']);return _0x4af6bb(_0x274a0f['error'][_0xef3c('0x14')]);}logger[_0xef3c('0x13')](_0xef3c('0xf'),_0x3da5dd,_0x274a0f[_0xef3c('0x13')][_0xef3c('0x14')]);return _0x332cfa(_0x274a0f[_0xef3c('0x13')][_0xef3c('0x14')]);}else{logger[_0xef3c('0x15')](_0xef3c('0xf'),_0x3da5dd,'request\x20sent');_0x332cfa(_0x274a0f['result'][_0xef3c('0x14')]);}})[_0xef3c('0x16')](function(_0x6f9ba3){logger[_0xef3c('0x13')](_0xef3c('0xf'),_0x3da5dd,_0x6f9ba3);_0x4af6bb(_0x6f9ba3);});});}exports[_0xef3c('0x17')]=function(_0xdde87c){var _0x3096fb=this;return new Promise(function(_0x371bb0,_0x42389b){return db['Sound'][_0xef3c('0x18')]({'raw':_0xdde87c[_0xef3c('0x19')]?_0xdde87c[_0xef3c('0x19')][_0xef3c('0x1a')]===undefined?!![]:![]:!![],'where':_0xdde87c[_0xef3c('0x19')]?_0xdde87c[_0xef3c('0x19')][_0xef3c('0x1b')]||null:null,'attributes':_0xdde87c[_0xef3c('0x19')]?_0xdde87c[_0xef3c('0x19')]['attributes']||null:null,'include':_0xdde87c[_0xef3c('0x19')]?_0xdde87c[_0xef3c('0x19')][_0xef3c('0x1c')]?_[_0xef3c('0x1d')](_0xdde87c[_0xef3c('0x19')][_0xef3c('0x1c')],function(_0x3e801a){return{'model':db[_0x3e801a['model']],'as':_0x3e801a['as'],'attributes':_0x3e801a[_0xef3c('0x1e')],'include':_0x3e801a['include']?_[_0xef3c('0x1d')](_0x3e801a['include'],function(_0x4572e2){return{'model':db[_0x4572e2[_0xef3c('0x1f')]],'as':_0x4572e2['as'],'attributes':_0x4572e2[_0xef3c('0x1e')],'include':_0x4572e2[_0xef3c('0x1c')]?_[_0xef3c('0x1d')](_0x4572e2['include'],function(_0x1613a6){return{'model':db[_0x1613a6[_0xef3c('0x1f')]],'as':_0x1613a6['as'],'attributes':_0x1613a6[_0xef3c('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xef3c('0xe')](function(_0x4f1e9b){logger[_0xef3c('0x15')](_0xef3c('0x17'),_0xdde87c);logger[_0xef3c('0x10')]('ShowSound',_0xdde87c,JSON[_0xef3c('0x12')](_0x4f1e9b));_0x371bb0(_0x4f1e9b);})[_0xef3c('0x16')](function(_0x2b9a07){logger['error'](_0xef3c('0x17'),_0x2b9a07[_0xef3c('0x14')],_0xdde87c);_0x42389b(_0x3096fb[_0xef3c('0x13')](0x1f4,_0x2b9a07[_0xef3c('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/squareMessage/index.js b/server/api/squareMessage/index.js index 735c7d5..1bcbf5c 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 _0xd8b0=['update','delete','destroy','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','show','create','put','/:id'];(function(_0x37d2f5,_0x34a99b){var _0x5071f8=function(_0x4edeaa){while(--_0x4edeaa){_0x37d2f5['push'](_0x37d2f5['shift']());}};_0x5071f8(++_0x34a99b);}(_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('./squareMessage.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/:id',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['post']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xb')]);router[_0x0d8b('0xc')](_0x0d8b('0xd'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xd'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);module['exports']=router; \ No newline at end of file +var _0x4fc2=['show','post','create','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./squareMessage.controller','isAuthenticated','index','/:id'];(function(_0x8b1a5e,_0x2744eb){var _0x1146b1=function(_0x5a9f50){while(--_0x5a9f50){_0x8b1a5e['push'](_0x8b1a5e['shift']());}};_0x1146b1(++_0x2744eb);}(_0x4fc2,0x111));var _0x24fc=function(_0x12a57d,_0x738bd1){_0x12a57d=_0x12a57d-0x0;var _0x4b26f6=_0x4fc2[_0x12a57d];return _0x4b26f6;};'use strict';var multer=require(_0x24fc('0x0'));var util=require(_0x24fc('0x1'));var path=require(_0x24fc('0x2'));var timeout=require(_0x24fc('0x3'));var express=require('express');var router=express[_0x24fc('0x4')]();var fs_extra=require(_0x24fc('0x5'));var auth=require(_0x24fc('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x24fc('0x7'));var controller=require(_0x24fc('0x8'));router['get']('/',auth[_0x24fc('0x9')](),controller[_0x24fc('0xa')]);router['get'](_0x24fc('0xb'),auth[_0x24fc('0x9')](),controller[_0x24fc('0xc')]);router[_0x24fc('0xd')]('/',auth[_0x24fc('0x9')](),controller[_0x24fc('0xe')]);router['put'](_0x24fc('0xb'),auth[_0x24fc('0x9')](),controller[_0x24fc('0xf')]);router[_0x24fc('0x10')](_0x24fc('0xb'),auth[_0x24fc('0x9')](),controller[_0x24fc('0x11')]);module[_0x24fc('0x12')]=router; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.attributes.js b/server/api/squareMessage/squareMessage.attributes.js index e4eb547..f13e05b 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 _0x0b3a=['TEXT','exports','STRING','ENUM','out'];(function(_0x5e24ad,_0x23e7b2){var _0x5fd086=function(_0x360147){while(--_0x360147){_0x5e24ad['push'](_0x5e24ad['shift']());}};_0x5fd086(++_0x23e7b2);}(_0x0b3a,0x178));var _0xa0b3=function(_0x4cba56,_0x5b2c44){_0x4cba56=_0x4cba56-0x0;var _0x3cc9f3=_0x0b3a[_0x4cba56];return _0x3cc9f3;};'use strict';var Sequelize=require('sequelize');module[_0xa0b3('0x0')]={'uniqueid':{'type':Sequelize[_0xa0b3('0x1')]},'body':{'type':Sequelize['TEXT']('medium'),'allowNull':![]},'direction':{'type':Sequelize[_0xa0b3('0x2')]('in',_0xa0b3('0x3')),'defaultValue':'out','allowNull':![]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0xa0b3('0x4')]}}; \ No newline at end of file +var _0x1380=['ENUM','out','TEXT','sequelize','STRING'];(function(_0xd8a5c,_0x43858a){var _0x5b9b54=function(_0xb2f8c3){while(--_0xb2f8c3){_0xd8a5c['push'](_0xd8a5c['shift']());}};_0x5b9b54(++_0x43858a);}(_0x1380,0x1d9));var _0x0138=function(_0x360267,_0x27076f){_0x360267=_0x360267-0x0;var _0x93ac5=_0x1380[_0x360267];return _0x93ac5;};'use strict';var Sequelize=require(_0x0138('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x0138('0x1')]},'body':{'type':Sequelize['TEXT']('medium'),'allowNull':![]},'direction':{'type':Sequelize[_0x0138('0x2')]('in',_0x0138('0x3')),'defaultValue':_0x0138('0x3'),'allowNull':![]},'providerName':{'type':Sequelize[_0x0138('0x1')]},'providerResponse':{'type':Sequelize[_0x0138('0x4')]}}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.controller.js b/server/api/squareMessage/squareMessage.controller.js index d26ca30..311bc29 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 _0x568f=['map','SquareMessage','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','options','find','create','body','eml-format','rimraf','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','stack','name','index'];(function(_0x49a1a0,_0x48f776){var _0x518a4f=function(_0x313633){while(--_0x313633){_0x49a1a0['push'](_0x49a1a0['shift']());}};_0x518a4f(++_0x48f776);}(_0x568f,0xf7));var _0xf568=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x568f[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xf568('0x0'));var rimraf=require(_0xf568('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xf568('0x2'));var moment=require(_0xf568('0x3'));var BPromise=require(_0xf568('0x4'));var Mustache=require(_0xf568('0x5'));var util=require('util');var path=require(_0xf568('0x6'));var sox=require(_0xf568('0x7'));var csv=require('to-csv');var ejs=require(_0xf568('0x8'));var fs=require('fs');var fs_extra=require(_0xf568('0x9'));var _=require(_0xf568('0xa'));var squel=require(_0xf568('0xb'));var crypto=require(_0xf568('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xf568('0xd'));var toCsv=require('to-csv');var querystring=require(_0xf568('0xe'));var Papa=require(_0xf568('0xf'));var Redis=require(_0xf568('0x10'));var authService=require(_0xf568('0x11'));var qs=require(_0xf568('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf568('0x13'));var logger=require(_0xf568('0x14'))('api');var utils=require(_0xf568('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xf568('0x16'));var db=require(_0xf568('0x17'))['db'];function respondWithStatusCode(_0x48deaa,_0x645ca){_0x645ca=_0x645ca||0xcc;return function(_0xd41398){if(_0xd41398){return _0x48deaa[_0xf568('0x18')](_0x645ca);}return _0x48deaa[_0xf568('0x19')](_0x645ca)[_0xf568('0x1a')]();};}function respondWithResult(_0x341c9b,_0x51c4ed){_0x51c4ed=_0x51c4ed||0xc8;return function(_0x46ef4c){if(_0x46ef4c){return _0x341c9b['status'](_0x51c4ed)[_0xf568('0x1b')](_0x46ef4c);}};}function respondWithFilteredResult(_0x1fba8c,_0x5a2a67){return function(_0x363582){if(_0x363582){var _0x13bfe4=typeof _0x5a2a67[_0xf568('0x1c')]===_0xf568('0x1d')&&typeof _0x5a2a67[_0xf568('0x1e')]===_0xf568('0x1d');var _0x3a447b=_0x363582['count'];var _0x4b8d15=_0x13bfe4?0x0:_0x5a2a67[_0xf568('0x1c')];var _0x275987=_0x13bfe4?_0x363582[_0xf568('0x1f')]:_0x5a2a67[_0xf568('0x1c')]+_0x5a2a67[_0xf568('0x1e')];var _0x4e0d0f;if(_0x275987>=_0x3a447b){_0x275987=_0x3a447b;_0x4e0d0f=0xc8;}else{_0x4e0d0f=0xce;}_0x1fba8c['status'](_0x4e0d0f);return _0x1fba8c[_0xf568('0x20')](_0xf568('0x21'),_0x4b8d15+'-'+_0x275987+'/'+_0x3a447b)[_0xf568('0x1b')](_0x363582);}return null;};}function patchUpdates(_0x246c74){return function(_0x5a3fc6){try{jsonpatch['apply'](_0x5a3fc6,_0x246c74,!![]);}catch(_0x572dba){return BPromise[_0xf568('0x22')](_0x572dba);}return _0x5a3fc6[_0xf568('0x23')]();};}function saveUpdates(_0x5cdd79,_0x371631){return function(_0x1e29de){if(_0x1e29de){return _0x1e29de[_0xf568('0x24')](_0x5cdd79)[_0xf568('0x25')](function(_0x249143){return _0x249143;});}return null;};}function removeEntity(_0x43a38f,_0x4633ad){return function(_0x578d47){if(_0x578d47){return _0x578d47['destroy']()['then'](function(){_0x43a38f['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1d47de,_0x246ba3){return function(_0x3f72b1){if(!_0x3f72b1){_0x1d47de['sendStatus'](0x194);}return _0x3f72b1;};}function handleError(_0x1e65ae,_0x2216d6){_0x2216d6=_0x2216d6||0x1f4;return function(_0x2c1232){logger['error'](_0x2c1232[_0xf568('0x26')]);if(_0x2c1232['name']){delete _0x2c1232[_0xf568('0x27')];}_0x1e65ae[_0xf568('0x19')](_0x2216d6)['send'](_0x2c1232);};}exports[_0xf568('0x28')]=function(_0x30caab,_0x2d18e5){var _0x42afbf={},_0x16f6c2={},_0x408922={'count':0x0,'rows':[]};var _0xcff408=_[_0xf568('0x29')](db[_0xf568('0x2a')][_0xf568('0x2b')],function(_0x52c810){return{'name':_0x52c810[_0xf568('0x2c')],'type':_0x52c810['type'][_0xf568('0x2d')]};});_0x16f6c2[_0xf568('0x2e')]=_[_0xf568('0x29')](_0xcff408,'name');_0x16f6c2[_0xf568('0x2f')]=_[_0xf568('0x30')](_0x30caab['query']);_0x16f6c2[_0xf568('0x31')]=_['intersection'](_0x16f6c2[_0xf568('0x2e')],_0x16f6c2[_0xf568('0x2f')]);_0x42afbf['attributes']=_[_0xf568('0x32')](_0x16f6c2[_0xf568('0x2e')],qs[_0xf568('0x33')](_0x30caab[_0xf568('0x2f')][_0xf568('0x33')]));_0x42afbf[_0xf568('0x34')]=_0x42afbf['attributes'][_0xf568('0x35')]?_0x42afbf[_0xf568('0x34')]:_0x16f6c2['model'];if(!_0x30caab[_0xf568('0x2f')][_0xf568('0x36')]('nolimit')){_0x42afbf[_0xf568('0x1e')]=qs['limit'](_0x30caab['query'][_0xf568('0x1e')]);_0x42afbf[_0xf568('0x1c')]=qs[_0xf568('0x1c')](_0x30caab[_0xf568('0x2f')]['offset']);}_0x42afbf[_0xf568('0x37')]=qs['sort'](_0x30caab[_0xf568('0x2f')][_0xf568('0x38')]);_0x42afbf[_0xf568('0x39')]=qs[_0xf568('0x31')](_['pick'](_0x30caab[_0xf568('0x2f')],_0x16f6c2['filters']),_0xcff408);if(_0x30caab[_0xf568('0x2f')][_0xf568('0x3a')]){_0x42afbf[_0xf568('0x39')]=_[_0xf568('0x3b')](_0x42afbf[_0xf568('0x39')],{'$or':_[_0xf568('0x29')](_0xcff408,function(_0x4d82f3){if(_0x4d82f3['type']!==_0xf568('0x3c')){var _0xc97a0f={};_0xc97a0f[_0x4d82f3[_0xf568('0x27')]]={'$like':'%'+_0x30caab[_0xf568('0x2f')][_0xf568('0x3a')]+'%'};return _0xc97a0f;}})});}_0x42afbf=_[_0xf568('0x3b')]({},_0x42afbf,_0x30caab['options']);var _0x31fb5f={'where':_0x42afbf[_0xf568('0x39')]};return db[_0xf568('0x2a')][_0xf568('0x1f')](_0x31fb5f)[_0xf568('0x25')](function(_0x135162){_0x408922[_0xf568('0x1f')]=_0x135162;if(_0x30caab['query'][_0xf568('0x3d')]){_0x42afbf[_0xf568('0x3e')]=[{'all':!![]}];}return db[_0xf568('0x2a')][_0xf568('0x3f')](_0x42afbf);})[_0xf568('0x25')](function(_0x21618c){_0x408922[_0xf568('0x40')]=_0x21618c;return _0x408922;})[_0xf568('0x25')](respondWithFilteredResult(_0x2d18e5,_0x42afbf))[_0xf568('0x41')](handleError(_0x2d18e5,null));};exports[_0xf568('0x42')]=function(_0x451845,_0x4aaab2){var _0x521cec={'raw':!![],'where':{'id':_0x451845[_0xf568('0x43')]['id']}},_0x5d9ced={};_0x5d9ced[_0xf568('0x2e')]=_[_0xf568('0x30')](db[_0xf568('0x2a')][_0xf568('0x2b')]);_0x5d9ced[_0xf568('0x2f')]=_[_0xf568('0x30')](_0x451845[_0xf568('0x2f')]);_0x5d9ced[_0xf568('0x31')]=_[_0xf568('0x32')](_0x5d9ced[_0xf568('0x2e')],_0x5d9ced[_0xf568('0x2f')]);_0x521cec[_0xf568('0x34')]=_['intersection'](_0x5d9ced[_0xf568('0x2e')],qs[_0xf568('0x33')](_0x451845[_0xf568('0x2f')][_0xf568('0x33')]));_0x521cec['attributes']=_0x521cec['attributes'][_0xf568('0x35')]?_0x521cec[_0xf568('0x34')]:_0x5d9ced[_0xf568('0x2e')];if(_0x451845[_0xf568('0x2f')][_0xf568('0x3d')]){_0x521cec[_0xf568('0x3e')]=[{'all':!![]}];}_0x521cec=_[_0xf568('0x3b')]({},_0x521cec,_0x451845[_0xf568('0x44')]);return db[_0xf568('0x2a')][_0xf568('0x45')](_0x521cec)[_0xf568('0x25')](handleEntityNotFound(_0x4aaab2,null))[_0xf568('0x25')](respondWithResult(_0x4aaab2,null))[_0xf568('0x41')](handleError(_0x4aaab2,null));};exports['create']=function(_0x3d65fe,_0x351dc2){return db[_0xf568('0x2a')][_0xf568('0x46')](_0x3d65fe[_0xf568('0x47')],{})[_0xf568('0x25')](respondWithResult(_0x351dc2,0xc9))[_0xf568('0x41')](handleError(_0x351dc2,null));};exports[_0xf568('0x24')]=function(_0x2965ee,_0x4ab6cd){if(_0x2965ee['body']['id']){delete _0x2965ee[_0xf568('0x47')]['id'];}return db['SquareMessage'][_0xf568('0x45')]({'where':{'id':_0x2965ee[_0xf568('0x43')]['id']}})[_0xf568('0x25')](handleEntityNotFound(_0x4ab6cd,null))['then'](saveUpdates(_0x2965ee[_0xf568('0x47')],null))['then'](respondWithResult(_0x4ab6cd,null))[_0xf568('0x41')](handleError(_0x4ab6cd,null));};exports['destroy']=function(_0x3eb86a,_0x459094){return db['SquareMessage'][_0xf568('0x45')]({'where':{'id':_0x3eb86a['params']['id']}})[_0xf568('0x25')](handleEntityNotFound(_0x459094,null))[_0xf568('0x25')](removeEntity(_0x459094,null))[_0xf568('0x41')](handleError(_0x459094,null));}; \ No newline at end of file +var _0x957a=['findAll','rows','then','show','params','length','options','find','catch','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','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','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','save','update','destroy','name','send','index','SquareMessage','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','include'];(function(_0x2f443e,_0x423c28){var _0x1def60=function(_0x11f64f){while(--_0x11f64f){_0x2f443e['push'](_0x2f443e['shift']());}};_0x1def60(++_0x423c28);}(_0x957a,0x137));var _0xa957=function(_0x4d451c,_0x176bd0){_0x4d451c=_0x4d451c-0x0;var _0x1001ff=_0x957a[_0x4d451c];return _0x1001ff;};'use strict';var emlformat=require(_0xa957('0x0'));var rimraf=require(_0xa957('0x1'));var zipdir=require(_0xa957('0x2'));var jsonpatch=require(_0xa957('0x3'));var rp=require(_0xa957('0x4'));var moment=require('moment');var BPromise=require(_0xa957('0x5'));var Mustache=require(_0xa957('0x6'));var util=require(_0xa957('0x7'));var path=require(_0xa957('0x8'));var sox=require(_0xa957('0x9'));var csv=require(_0xa957('0xa'));var ejs=require(_0xa957('0xb'));var fs=require('fs');var fs_extra=require(_0xa957('0xc'));var _=require(_0xa957('0xd'));var squel=require(_0xa957('0xe'));var crypto=require(_0xa957('0xf'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xa957('0xa'));var querystring=require(_0xa957('0x10'));var Papa=require(_0xa957('0x11'));var Redis=require(_0xa957('0x12'));var authService=require(_0xa957('0x13'));var qs=require(_0xa957('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xa957('0x15'))(_0xa957('0x16'));var utils=require(_0xa957('0x17'));var config=require(_0xa957('0x18'));var licenseUtil=require(_0xa957('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x30b4cd,_0x513552){_0x513552=_0x513552||0xcc;return function(_0x299f33){if(_0x299f33){return _0x30b4cd[_0xa957('0x1a')](_0x513552);}return _0x30b4cd[_0xa957('0x1b')](_0x513552)[_0xa957('0x1c')]();};}function respondWithResult(_0x5cff71,_0x4e2fec){_0x4e2fec=_0x4e2fec||0xc8;return function(_0x4d1042){if(_0x4d1042){return _0x5cff71[_0xa957('0x1b')](_0x4e2fec)[_0xa957('0x1d')](_0x4d1042);}};}function respondWithFilteredResult(_0x2efa9e,_0x23757d){return function(_0x129ace){if(_0x129ace){var _0x4580ab=typeof _0x23757d[_0xa957('0x1e')]===_0xa957('0x1f')&&typeof _0x23757d[_0xa957('0x20')]===_0xa957('0x1f');var _0x28b9e3=_0x129ace[_0xa957('0x21')];var _0xa8e5d6=_0x4580ab?0x0:_0x23757d[_0xa957('0x1e')];var _0x1a028b=_0x4580ab?_0x129ace[_0xa957('0x21')]:_0x23757d[_0xa957('0x1e')]+_0x23757d['limit'];var _0x41232d;if(_0x1a028b>=_0x28b9e3){_0x1a028b=_0x28b9e3;_0x41232d=0xc8;}else{_0x41232d=0xce;}_0x2efa9e[_0xa957('0x1b')](_0x41232d);return _0x2efa9e['set'](_0xa957('0x22'),_0xa8e5d6+'-'+_0x1a028b+'/'+_0x28b9e3)[_0xa957('0x1d')](_0x129ace);}return null;};}function patchUpdates(_0x170bc3){return function(_0x27473b){try{jsonpatch[_0xa957('0x23')](_0x27473b,_0x170bc3,!![]);}catch(_0x5eb13e){return BPromise['reject'](_0x5eb13e);}return _0x27473b[_0xa957('0x24')]();};}function saveUpdates(_0x28b7f3,_0x35f045){return function(_0x46e9f2){if(_0x46e9f2){return _0x46e9f2[_0xa957('0x25')](_0x28b7f3)['then'](function(_0xe74440){return _0xe74440;});}return null;};}function removeEntity(_0x438ef3,_0x215a79){return function(_0x4f9596){if(_0x4f9596){return _0x4f9596[_0xa957('0x26')]()['then'](function(){_0x438ef3['status'](0xcc)[_0xa957('0x1c')]();});}};}function handleEntityNotFound(_0xfb2028,_0x19fd9c){return function(_0x42846b){if(!_0x42846b){_0xfb2028[_0xa957('0x1a')](0x194);}return _0x42846b;};}function handleError(_0x11737f,_0xdad014){_0xdad014=_0xdad014||0x1f4;return function(_0x22d67b){logger['error'](_0x22d67b['stack']);if(_0x22d67b['name']){delete _0x22d67b[_0xa957('0x27')];}_0x11737f['status'](_0xdad014)[_0xa957('0x28')](_0x22d67b);};}exports[_0xa957('0x29')]=function(_0x568351,_0xb5bb7c){var _0x75d44b={},_0x4f256d={},_0x5b5795={'count':0x0,'rows':[]};var _0x232616=_['map'](db[_0xa957('0x2a')][_0xa957('0x2b')],function(_0x58b334){return{'name':_0x58b334[_0xa957('0x2c')],'type':_0x58b334[_0xa957('0x2d')][_0xa957('0x2e')]};});_0x4f256d[_0xa957('0x2f')]=_['map'](_0x232616,_0xa957('0x27'));_0x4f256d[_0xa957('0x30')]=_[_0xa957('0x31')](_0x568351['query']);_0x4f256d['filters']=_[_0xa957('0x32')](_0x4f256d[_0xa957('0x2f')],_0x4f256d[_0xa957('0x30')]);_0x75d44b['attributes']=_['intersection'](_0x4f256d[_0xa957('0x2f')],qs[_0xa957('0x33')](_0x568351[_0xa957('0x30')][_0xa957('0x33')]));_0x75d44b['attributes']=_0x75d44b[_0xa957('0x34')]['length']?_0x75d44b[_0xa957('0x34')]:_0x4f256d[_0xa957('0x2f')];if(!_0x568351[_0xa957('0x30')][_0xa957('0x35')](_0xa957('0x36'))){_0x75d44b[_0xa957('0x20')]=qs[_0xa957('0x20')](_0x568351[_0xa957('0x30')][_0xa957('0x20')]);_0x75d44b['offset']=qs[_0xa957('0x1e')](_0x568351[_0xa957('0x30')]['offset']);}_0x75d44b[_0xa957('0x37')]=qs[_0xa957('0x38')](_0x568351[_0xa957('0x30')][_0xa957('0x38')]);_0x75d44b[_0xa957('0x39')]=qs[_0xa957('0x3a')](_[_0xa957('0x3b')](_0x568351[_0xa957('0x30')],_0x4f256d['filters']),_0x232616);if(_0x568351[_0xa957('0x30')][_0xa957('0x3c')]){_0x75d44b[_0xa957('0x39')]=_[_0xa957('0x3d')](_0x75d44b['where'],{'$or':_['map'](_0x232616,function(_0x5f2a9d){if(_0x5f2a9d['type']!==_0xa957('0x3e')){var _0x2d26b8={};_0x2d26b8[_0x5f2a9d[_0xa957('0x27')]]={'$like':'%'+_0x568351['query']['filter']+'%'};return _0x2d26b8;}})});}_0x75d44b=_[_0xa957('0x3d')]({},_0x75d44b,_0x568351['options']);var _0x2a17dc={'where':_0x75d44b[_0xa957('0x39')]};return db['SquareMessage'][_0xa957('0x21')](_0x2a17dc)['then'](function(_0x4c474e){_0x5b5795[_0xa957('0x21')]=_0x4c474e;if(_0x568351[_0xa957('0x30')]['includeAll']){_0x75d44b[_0xa957('0x3f')]=[{'all':!![]}];}return db[_0xa957('0x2a')][_0xa957('0x40')](_0x75d44b);})['then'](function(_0x38a707){_0x5b5795[_0xa957('0x41')]=_0x38a707;return _0x5b5795;})[_0xa957('0x42')](respondWithFilteredResult(_0xb5bb7c,_0x75d44b))['catch'](handleError(_0xb5bb7c,null));};exports[_0xa957('0x43')]=function(_0x2879a5,_0x127af8){var _0x24ffcb={'raw':!![],'where':{'id':_0x2879a5[_0xa957('0x44')]['id']}},_0xcbcee3={};_0xcbcee3['model']=_[_0xa957('0x31')](db[_0xa957('0x2a')]['rawAttributes']);_0xcbcee3['query']=_[_0xa957('0x31')](_0x2879a5[_0xa957('0x30')]);_0xcbcee3['filters']=_[_0xa957('0x32')](_0xcbcee3['model'],_0xcbcee3[_0xa957('0x30')]);_0x24ffcb['attributes']=_['intersection'](_0xcbcee3[_0xa957('0x2f')],qs[_0xa957('0x33')](_0x2879a5['query'][_0xa957('0x33')]));_0x24ffcb[_0xa957('0x34')]=_0x24ffcb[_0xa957('0x34')][_0xa957('0x45')]?_0x24ffcb[_0xa957('0x34')]:_0xcbcee3[_0xa957('0x2f')];if(_0x2879a5[_0xa957('0x30')]['includeAll']){_0x24ffcb[_0xa957('0x3f')]=[{'all':!![]}];}_0x24ffcb=_['merge']({},_0x24ffcb,_0x2879a5[_0xa957('0x46')]);return db['SquareMessage'][_0xa957('0x47')](_0x24ffcb)[_0xa957('0x42')](handleEntityNotFound(_0x127af8,null))[_0xa957('0x42')](respondWithResult(_0x127af8,null))[_0xa957('0x48')](handleError(_0x127af8,null));};exports[_0xa957('0x49')]=function(_0x2222ed,_0x32fe1c){return db[_0xa957('0x2a')][_0xa957('0x49')](_0x2222ed[_0xa957('0x4a')],{})[_0xa957('0x42')](respondWithResult(_0x32fe1c,0xc9))['catch'](handleError(_0x32fe1c,null));};exports[_0xa957('0x25')]=function(_0x298c65,_0x11626b){if(_0x298c65[_0xa957('0x4a')]['id']){delete _0x298c65[_0xa957('0x4a')]['id'];}return db[_0xa957('0x2a')][_0xa957('0x47')]({'where':{'id':_0x298c65[_0xa957('0x44')]['id']}})[_0xa957('0x42')](handleEntityNotFound(_0x11626b,null))[_0xa957('0x42')](saveUpdates(_0x298c65['body'],null))[_0xa957('0x42')](respondWithResult(_0x11626b,null))[_0xa957('0x48')](handleError(_0x11626b,null));};exports[_0xa957('0x26')]=function(_0x6f709c,_0xb3f87a){return db[_0xa957('0x2a')][_0xa957('0x47')]({'where':{'id':_0x6f709c['params']['id']}})['then'](handleEntityNotFound(_0xb3f87a,null))['then'](removeEntity(_0xb3f87a,null))['catch'](handleError(_0xb3f87a,null));}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.model.js b/server/api/squareMessage/squareMessage.model.js index 2fa4da6..cfc2d8e 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 _0x908d=['moment','bluebird','path','rimraf','../../config/environment','./squareMessage.attributes','exports','define','SquareMessage','lodash','../../config/logger','api'];(function(_0x350bb3,_0x855400){var _0x184791=function(_0xf7196e){while(--_0xf7196e){_0x350bb3['push'](_0x350bb3['shift']());}};_0x184791(++_0x855400);}(_0x908d,0x99));var _0xd908=function(_0x17d15d,_0xab01f5){_0x17d15d=_0x17d15d-0x0;var _0x4b4c58=_0x908d[_0x17d15d];return _0x4b4c58;};'use strict';var _=require(_0xd908('0x0'));var util=require('util');var logger=require(_0xd908('0x1'))(_0xd908('0x2'));var moment=require(_0xd908('0x3'));var BPromise=require(_0xd908('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd908('0x5'));var rimraf=require(_0xd908('0x6'));var config=require(_0xd908('0x7'));var attributes=require(_0xd908('0x8'));module[_0xd908('0x9')]=function(_0x15ca1b,_0xf0aef7){return _0x15ca1b[_0xd908('0xa')](_0xd908('0xb'),attributes,{'tableName':'square_messages','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9146=['square_messages','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x391724,_0x31542e){var _0x3447a9=function(_0x1d73dd){while(--_0x1d73dd){_0x391724['push'](_0x391724['shift']());}};_0x3447a9(++_0x31542e);}(_0x9146,0x131));var _0x6914=function(_0x35bd6c,_0x585087){_0x35bd6c=_0x35bd6c-0x0;var _0x2f421d=_0x9146[_0x35bd6c];return _0x2f421d;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x6914('0x0'))('api');var moment=require(_0x6914('0x1'));var BPromise=require(_0x6914('0x2'));var rp=require(_0x6914('0x3'));var fs=require('fs');var path=require(_0x6914('0x4'));var rimraf=require(_0x6914('0x5'));var config=require(_0x6914('0x6'));var attributes=require('./squareMessage.attributes');module['exports']=function(_0xb1c196,_0x47c512){return _0xb1c196['define']('SquareMessage',attributes,{'tableName':_0x6914('0x7'),'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 dfd9248..679e29e 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 _0xbfe8=['options','raw','stringify','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','SquareMessage,\x20%s,\x20%s','debug','SquareMessage,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','CreateSquareMessage','SquareMessage'];(function(_0x4e184a,_0x496480){var _0x5ebdeb=function(_0x261f8f){while(--_0x261f8f){_0x4e184a['push'](_0x4e184a['shift']());}};_0x5ebdeb(++_0x496480);}(_0xbfe8,0x153));var _0x8bfe=function(_0x3148bc,_0x364664){_0x3148bc=_0x3148bc-0x0;var _0x3262a8=_0xbfe8[_0x3148bc];return _0x3262a8;};'use strict';var _=require(_0x8bfe('0x0'));var util=require(_0x8bfe('0x1'));var moment=require(_0x8bfe('0x2'));var BPromise=require(_0x8bfe('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8bfe('0x4'))['db'];var utils=require(_0x8bfe('0x5'));var logger=require(_0x8bfe('0x6'))(_0x8bfe('0x7'));var config=require(_0x8bfe('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x8bfe('0x9')][_0x8bfe('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x41d6a9,_0x487da8,_0x4eeca6){return new BPromise(function(_0x4b671d,_0x3a75ec){return client[_0x8bfe('0xb')](_0x41d6a9,_0x4eeca6)[_0x8bfe('0xc')](function(_0x3adfdd){logger[_0x8bfe('0xd')](_0x8bfe('0xe'),_0x487da8,'request\x20sent');logger[_0x8bfe('0xf')](_0x8bfe('0x10'),_0x487da8,_0x8bfe('0x11'),JSON['stringify'](_0x3adfdd));if(_0x3adfdd['error']){if(_0x3adfdd[_0x8bfe('0x12')][_0x8bfe('0x13')]===0x1f4){logger['error']('SquareMessage,\x20%s,\x20%s',_0x487da8,_0x3adfdd['error'][_0x8bfe('0x14')]);return _0x3a75ec(_0x3adfdd[_0x8bfe('0x12')]['message']);}logger[_0x8bfe('0x12')]('SquareMessage,\x20%s,\x20%s',_0x487da8,_0x3adfdd['error'][_0x8bfe('0x14')]);return _0x4b671d(_0x3adfdd['error'][_0x8bfe('0x14')]);}else{logger[_0x8bfe('0xd')](_0x8bfe('0xe'),_0x487da8,_0x8bfe('0x11'));_0x4b671d(_0x3adfdd[_0x8bfe('0x15')][_0x8bfe('0x14')]);}})[_0x8bfe('0x16')](function(_0x51b122){logger[_0x8bfe('0x12')]('SquareMessage,\x20%s,\x20%s',_0x487da8,_0x51b122);_0x3a75ec(_0x51b122);});});}exports[_0x8bfe('0x17')]=function(_0x4a5b5c){var _0x508efe=this;return new Promise(function(_0x5ebd01,_0x3d7304){return db[_0x8bfe('0x18')]['create'](_0x4a5b5c['body'],{'raw':_0x4a5b5c['options']?_0x4a5b5c[_0x8bfe('0x19')][_0x8bfe('0x1a')]===undefined?!![]:![]:!![]})[_0x8bfe('0xc')](function(_0x34701d){logger[_0x8bfe('0xd')](_0x8bfe('0x17'),_0x4a5b5c);logger[_0x8bfe('0xf')](_0x8bfe('0x17'),_0x4a5b5c,JSON[_0x8bfe('0x1b')](_0x34701d));_0x5ebd01(_0x34701d);})['catch'](function(_0x43d4aa){logger[_0x8bfe('0x12')](_0x8bfe('0x17'),_0x43d4aa[_0x8bfe('0x14')],_0x4a5b5c);_0x3d7304(_0x508efe[_0x8bfe('0x12')](0x1f4,_0x43d4aa[_0x8bfe('0x14')]));});});}; \ No newline at end of file +var _0x19cb=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','SquareMessage,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','CreateSquareMessage','create','body','options','raw','then','util','moment','randomstring','ioredis'];(function(_0x5442b5,_0x38a53a){var _0xbc05d1=function(_0x4344f5){while(--_0x4344f5){_0x5442b5['push'](_0x5442b5['shift']());}};_0xbc05d1(++_0x38a53a);}(_0x19cb,0x64));var _0xb19c=function(_0x5ced14,_0x1beafc){_0x5ced14=_0x5ced14-0x0;var _0x2235db=_0x19cb[_0x5ced14];return _0x2235db;};'use strict';var _=require('lodash');var util=require(_0xb19c('0x0'));var moment=require(_0xb19c('0x1'));var BPromise=require('bluebird');var rs=require(_0xb19c('0x2'));var fs=require('fs');var Redis=require(_0xb19c('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xb19c('0x4'));var logger=require(_0xb19c('0x5'))(_0xb19c('0x6'));var config=require(_0xb19c('0x7'));var jayson=require(_0xb19c('0x8'));var client=jayson['client'][_0xb19c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x18a50d,_0x5981cd,_0x35e064){return new BPromise(function(_0x1bbd8c,_0x4ca231){return client[_0xb19c('0xa')](_0x18a50d,_0x35e064)['then'](function(_0x273a7a){logger[_0xb19c('0xb')](_0xb19c('0xc'),_0x5981cd,_0xb19c('0xd'));logger[_0xb19c('0xe')]('SquareMessage,\x20%s,\x20%s,\x20%s',_0x5981cd,_0xb19c('0xd'),JSON['stringify'](_0x273a7a));if(_0x273a7a[_0xb19c('0xf')]){if(_0x273a7a[_0xb19c('0xf')][_0xb19c('0x10')]===0x1f4){logger['error'](_0xb19c('0xc'),_0x5981cd,_0x273a7a['error']['message']);return _0x4ca231(_0x273a7a[_0xb19c('0xf')]['message']);}logger[_0xb19c('0xf')](_0xb19c('0xc'),_0x5981cd,_0x273a7a[_0xb19c('0xf')][_0xb19c('0x11')]);return _0x1bbd8c(_0x273a7a[_0xb19c('0xf')][_0xb19c('0x11')]);}else{logger[_0xb19c('0xb')](_0xb19c('0xc'),_0x5981cd,_0xb19c('0xd'));_0x1bbd8c(_0x273a7a[_0xb19c('0x12')][_0xb19c('0x11')]);}})[_0xb19c('0x13')](function(_0x486b35){logger[_0xb19c('0xf')](_0xb19c('0xc'),_0x5981cd,_0x486b35);_0x4ca231(_0x486b35);});});}exports[_0xb19c('0x14')]=function(_0x5c51d4){var _0x274231=this;return new Promise(function(_0x291de4,_0x5c514c){return db['SquareMessage'][_0xb19c('0x15')](_0x5c51d4[_0xb19c('0x16')],{'raw':_0x5c51d4['options']?_0x5c51d4[_0xb19c('0x17')][_0xb19c('0x18')]===undefined?!![]:![]:!![]})[_0xb19c('0x19')](function(_0x21d828){logger[_0xb19c('0xb')](_0xb19c('0x14'),_0x5c51d4);logger[_0xb19c('0xe')](_0xb19c('0x14'),_0x5c51d4,JSON['stringify'](_0x21d828));_0x291de4(_0x21d828);})['catch'](function(_0x275439){logger[_0xb19c('0xf')](_0xb19c('0x14'),_0x275439[_0xb19c('0x11')],_0x5c51d4);_0x5c514c(_0x274231['error'](0x1f4,_0x275439[_0xb19c('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/squareOdbc/index.js b/server/api/squareOdbc/index.js index 21e0b57..edcce66 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 _0x8a6e=['create','put','/:id','destroy','exports','multer','util','connect-timeout','Router','fs-extra','./squareOdbc.controller','index','get','isAuthenticated','post'];(function(_0x1793de,_0x4d7233){var _0x4f0309=function(_0x229ee7){while(--_0x229ee7){_0x1793de['push'](_0x1793de['shift']());}};_0x4f0309(++_0x4d7233);}(_0x8a6e,0x1b8));var _0xe8a6=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x8a6e[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0xe8a6('0x0'));var util=require(_0xe8a6('0x1'));var path=require('path');var timeout=require(_0xe8a6('0x2'));var express=require('express');var router=express[_0xe8a6('0x3')]();var fs_extra=require(_0xe8a6('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xe8a6('0x5'));router['get']('/',auth['isAuthenticated'](),controller[_0xe8a6('0x6')]);router[_0xe8a6('0x7')]('/:id',auth[_0xe8a6('0x8')](),controller['show']);router[_0xe8a6('0x7')]('/:id/test',auth[_0xe8a6('0x8')](),timeout('15s'),controller['test']);router[_0xe8a6('0x9')]('/',auth[_0xe8a6('0x8')](),controller[_0xe8a6('0xa')]);router[_0xe8a6('0xb')](_0xe8a6('0xc'),auth[_0xe8a6('0x8')](),controller['update']);router['delete'](_0xe8a6('0xc'),auth[_0xe8a6('0x8')](),controller[_0xe8a6('0xd')]);module[_0xe8a6('0xe')]=router; \ No newline at end of file +var _0x8692=['post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareOdbc.controller','get','index','/:id','isAuthenticated','/:id/test','15s','test'];(function(_0x446f6c,_0x59acec){var _0x28f552=function(_0x4e925d){while(--_0x4e925d){_0x446f6c['push'](_0x446f6c['shift']());}};_0x28f552(++_0x59acec);}(_0x8692,0x1b0));var _0x2869=function(_0x4fd90e,_0x57236c){_0x4fd90e=_0x4fd90e-0x0;var _0x350a7b=_0x8692[_0x4fd90e];return _0x350a7b;};'use strict';var multer=require(_0x2869('0x0'));var util=require(_0x2869('0x1'));var path=require(_0x2869('0x2'));var timeout=require(_0x2869('0x3'));var express=require(_0x2869('0x4'));var router=express[_0x2869('0x5')]();var fs_extra=require(_0x2869('0x6'));var auth=require(_0x2869('0x7'));var interaction=require(_0x2869('0x8'));var config=require(_0x2869('0x9'));var controller=require(_0x2869('0xa'));router[_0x2869('0xb')]('/',auth['isAuthenticated'](),controller[_0x2869('0xc')]);router[_0x2869('0xb')](_0x2869('0xd'),auth[_0x2869('0xe')](),controller['show']);router['get'](_0x2869('0xf'),auth['isAuthenticated'](),timeout(_0x2869('0x10')),controller[_0x2869('0x11')]);router[_0x2869('0x12')]('/',auth[_0x2869('0xe')](),controller[_0x2869('0x13')]);router[_0x2869('0x14')](_0x2869('0xd'),auth['isAuthenticated'](),controller[_0x2869('0x15')]);router[_0x2869('0x16')](_0x2869('0xd'),auth[_0x2869('0xe')](),controller[_0x2869('0x17')]);module[_0x2869('0x18')]=router; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.attributes.js b/server/api/squareOdbc/squareOdbc.attributes.js index 8d4bc2c..1ebd285 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 _0x9785=['STRING','name','sequelize','exports'];(function(_0x5f3720,_0x2670bb){var _0x4557a4=function(_0x5432c0){while(--_0x5432c0){_0x5f3720['push'](_0x5f3720['shift']());}};_0x4557a4(++_0x2670bb);}(_0x9785,0x1da));var _0x5978=function(_0xd39959,_0x302d09){_0xd39959=_0xd39959-0x0;var _0x1ff69c=_0x9785[_0xd39959];return _0x1ff69c;};'use strict';var Sequelize=require(_0x5978('0x0'));module[_0x5978('0x1')]={'name':{'type':Sequelize[_0x5978('0x2')],'unique':_0x5978('0x3'),'allowNull':![]},'dsn':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x5978('0x2')]}}; \ No newline at end of file +var _0xea87=['name','sequelize','exports','STRING'];(function(_0x17adfb,_0x33ae3a){var _0x111ce9=function(_0x2d9a15){while(--_0x2d9a15){_0x17adfb['push'](_0x17adfb['shift']());}};_0x111ce9(++_0x33ae3a);}(_0xea87,0xf9));var _0x7ea8=function(_0x9c42b6,_0x1c3984){_0x9c42b6=_0x9c42b6-0x0;var _0x599101=_0xea87[_0x9c42b6];return _0x599101;};'use strict';var Sequelize=require(_0x7ea8('0x0'));module[_0x7ea8('0x1')]={'name':{'type':Sequelize[_0x7ea8('0x2')],'unique':_0x7ea8('0x3'),'allowNull':![]},'dsn':{'type':Sequelize[_0x7ea8('0x2')]},'description':{'type':Sequelize[_0x7ea8('0x2')]}}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.controller.js b/server/api/squareOdbc/squareOdbc.controller.js index 112f0d1..13c44f3 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 _0xba5f=['show','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','ODBC','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','test','odbc','openSync','dsn','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','sox','ejs','fs-extra','crypto','jsforce','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','end','status','json','undefined','limit','offset','count','set','Content-Range','reject','save','update','get','then','error','name','index','map','SquareOdbc','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','type','VIRTUAL','options','include','findAll','rows','catch'];(function(_0x20e55b,_0x5ac5af){var _0x3a216e=function(_0x256cfb){while(--_0x256cfb){_0x20e55b['push'](_0x20e55b['shift']());}};_0x3a216e(++_0x5ac5af);}(_0xba5f,0x66));var _0xfba5=function(_0x1fbe33,_0x55fba0){_0x1fbe33=_0x1fbe33-0x0;var _0x1effea=_0xba5f[_0x1fbe33];return _0x1effea;};'use strict';var emlformat=require(_0xfba5('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xfba5('0x1'));var jsonpatch=require(_0xfba5('0x2'));var rp=require('request-promise');var moment=require(_0xfba5('0x3'));var BPromise=require(_0xfba5('0x4'));var Mustache=require(_0xfba5('0x5'));var util=require('util');var path=require('path');var sox=require(_0xfba5('0x6'));var csv=require('to-csv');var ejs=require(_0xfba5('0x7'));var fs=require('fs');var fs_extra=require(_0xfba5('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xfba5('0x9'));var jsforce=require(_0xfba5('0xa'));var deskjs=require('desk.js');var toCsv=require(_0xfba5('0xb'));var querystring=require(_0xfba5('0xc'));var Papa=require(_0xfba5('0xd'));var Redis=require('ioredis');var authService=require(_0xfba5('0xe'));var qs=require(_0xfba5('0xf'));var as=require(_0xfba5('0x10'));var hardwareService=require(_0xfba5('0x11'));var logger=require(_0xfba5('0x12'))(_0xfba5('0x13'));var utils=require('../../config/utils');var config=require(_0xfba5('0x14'));var licenseUtil=require(_0xfba5('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x54c28a,_0x569b99){_0x569b99=_0x569b99||0xcc;return function(_0x306c0c){if(_0x306c0c){return _0x54c28a[_0xfba5('0x16')](_0x569b99);}return _0x54c28a['status'](_0x569b99)[_0xfba5('0x17')]();};}function respondWithResult(_0x4736bc,_0x2d1bc8){_0x2d1bc8=_0x2d1bc8||0xc8;return function(_0xbde073){if(_0xbde073){return _0x4736bc[_0xfba5('0x18')](_0x2d1bc8)[_0xfba5('0x19')](_0xbde073);}};}function respondWithFilteredResult(_0x525b59,_0x532e40){return function(_0x48c80f){if(_0x48c80f){var _0x24fc02=typeof _0x532e40['offset']===_0xfba5('0x1a')&&typeof _0x532e40[_0xfba5('0x1b')]===_0xfba5('0x1a');var _0x54fac3=_0x48c80f['count'];var _0x18a88f=_0x24fc02?0x0:_0x532e40[_0xfba5('0x1c')];var _0x2e0737=_0x24fc02?_0x48c80f[_0xfba5('0x1d')]:_0x532e40[_0xfba5('0x1c')]+_0x532e40['limit'];var _0x349cf9;if(_0x2e0737>=_0x54fac3){_0x2e0737=_0x54fac3;_0x349cf9=0xc8;}else{_0x349cf9=0xce;}_0x525b59[_0xfba5('0x18')](_0x349cf9);return _0x525b59[_0xfba5('0x1e')](_0xfba5('0x1f'),_0x18a88f+'-'+_0x2e0737+'/'+_0x54fac3)[_0xfba5('0x19')](_0x48c80f);}return null;};}function patchUpdates(_0xee6ef8){return function(_0x15050e){try{jsonpatch['apply'](_0x15050e,_0xee6ef8,!![]);}catch(_0x520ebc){return BPromise[_0xfba5('0x20')](_0x520ebc);}return _0x15050e[_0xfba5('0x21')]();};}function saveUpdates(_0x1557c9,_0xbc1132){return function(_0x1fa85){if(_0x1fa85){return _0x1fa85[_0xfba5('0x22')](_0x1557c9)['then'](function(_0x2c7dc4){return _0x2c7dc4;});}return null;};}function removeEntity(_0x1be45f,_0x19f704){return function(_0x321380){if(_0x321380){return _0x321380['destroy']()['then'](function(){var _0x2dcef4=_0x321380[_0xfba5('0x23')]({'plain':!![]});var _0x28a6db='ODBC';return db['UserProfileResource']['destroy']({'where':{'type':_0x28a6db,'resourceId':_0x2dcef4['id']}})[_0xfba5('0x24')](function(){return _0x321380;});})['then'](function(){_0x1be45f[_0xfba5('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x33c917,_0x1ed1fe){return function(_0x8420b0){if(!_0x8420b0){_0x33c917[_0xfba5('0x16')](0x194);}return _0x8420b0;};}function handleError(_0x4acc51,_0x377be4){_0x377be4=_0x377be4||0x1f4;return function(_0x357ee1){logger[_0xfba5('0x25')](_0x357ee1['stack']);if(_0x357ee1[_0xfba5('0x26')]){delete _0x357ee1[_0xfba5('0x26')];}_0x4acc51[_0xfba5('0x18')](_0x377be4)['send'](_0x357ee1);};}exports[_0xfba5('0x27')]=function(_0x3be561,_0x244692){var _0x5a0798={},_0x568679={},_0x46c2e0={'count':0x0,'rows':[]};var _0x50834d=_[_0xfba5('0x28')](db[_0xfba5('0x29')][_0xfba5('0x2a')],function(_0x33a37c){return{'name':_0x33a37c[_0xfba5('0x2b')],'type':_0x33a37c['type'][_0xfba5('0x2c')]};});_0x568679[_0xfba5('0x2d')]=_[_0xfba5('0x28')](_0x50834d,_0xfba5('0x26'));_0x568679[_0xfba5('0x2e')]=_[_0xfba5('0x2f')](_0x3be561[_0xfba5('0x2e')]);_0x568679['filters']=_[_0xfba5('0x30')](_0x568679['model'],_0x568679[_0xfba5('0x2e')]);_0x5a0798[_0xfba5('0x31')]=_[_0xfba5('0x30')](_0x568679[_0xfba5('0x2d')],qs[_0xfba5('0x32')](_0x3be561[_0xfba5('0x2e')][_0xfba5('0x32')]));_0x5a0798[_0xfba5('0x31')]=_0x5a0798['attributes'][_0xfba5('0x33')]?_0x5a0798[_0xfba5('0x31')]:_0x568679[_0xfba5('0x2d')];if(!_0x3be561[_0xfba5('0x2e')][_0xfba5('0x34')](_0xfba5('0x35'))){_0x5a0798[_0xfba5('0x1b')]=qs[_0xfba5('0x1b')](_0x3be561[_0xfba5('0x2e')][_0xfba5('0x1b')]);_0x5a0798[_0xfba5('0x1c')]=qs[_0xfba5('0x1c')](_0x3be561[_0xfba5('0x2e')][_0xfba5('0x1c')]);}_0x5a0798[_0xfba5('0x36')]=qs[_0xfba5('0x37')](_0x3be561['query'][_0xfba5('0x37')]);_0x5a0798[_0xfba5('0x38')]=qs['filters'](_[_0xfba5('0x39')](_0x3be561[_0xfba5('0x2e')],_0x568679[_0xfba5('0x3a')]),_0x50834d);if(_0x3be561[_0xfba5('0x2e')][_0xfba5('0x3b')]){_0x5a0798[_0xfba5('0x38')]=_[_0xfba5('0x3c')](_0x5a0798[_0xfba5('0x38')],{'$or':_['map'](_0x50834d,function(_0x2f1469){if(_0x2f1469[_0xfba5('0x3d')]!==_0xfba5('0x3e')){var _0x5d4e2b={};_0x5d4e2b[_0x2f1469[_0xfba5('0x26')]]={'$like':'%'+_0x3be561[_0xfba5('0x2e')][_0xfba5('0x3b')]+'%'};return _0x5d4e2b;}})});}_0x5a0798=_[_0xfba5('0x3c')]({},_0x5a0798,_0x3be561[_0xfba5('0x3f')]);var _0x53f6d6={'where':_0x5a0798[_0xfba5('0x38')]};return db['SquareOdbc'][_0xfba5('0x1d')](_0x53f6d6)[_0xfba5('0x24')](function(_0x502447){_0x46c2e0[_0xfba5('0x1d')]=_0x502447;if(_0x3be561[_0xfba5('0x2e')]['includeAll']){_0x5a0798[_0xfba5('0x40')]=[{'all':!![]}];}return db[_0xfba5('0x29')][_0xfba5('0x41')](_0x5a0798);})[_0xfba5('0x24')](function(_0x4cec6d){_0x46c2e0[_0xfba5('0x42')]=_0x4cec6d;return _0x46c2e0;})['then'](respondWithFilteredResult(_0x244692,_0x5a0798))[_0xfba5('0x43')](handleError(_0x244692,null));};exports[_0xfba5('0x44')]=function(_0x4662e4,_0x4e7294){var _0x5f3d38={'raw':!![],'where':{'id':_0x4662e4['params']['id']}},_0x57d650={};_0x57d650['model']=_[_0xfba5('0x2f')](db[_0xfba5('0x29')]['rawAttributes']);_0x57d650[_0xfba5('0x2e')]=_[_0xfba5('0x2f')](_0x4662e4[_0xfba5('0x2e')]);_0x57d650[_0xfba5('0x3a')]=_['intersection'](_0x57d650['model'],_0x57d650['query']);_0x5f3d38['attributes']=_['intersection'](_0x57d650[_0xfba5('0x2d')],qs[_0xfba5('0x32')](_0x4662e4[_0xfba5('0x2e')][_0xfba5('0x32')]));_0x5f3d38[_0xfba5('0x31')]=_0x5f3d38[_0xfba5('0x31')][_0xfba5('0x33')]?_0x5f3d38[_0xfba5('0x31')]:_0x57d650[_0xfba5('0x2d')];if(_0x4662e4[_0xfba5('0x2e')]['includeAll']){_0x5f3d38[_0xfba5('0x40')]=[{'all':!![]}];}_0x5f3d38=_[_0xfba5('0x3c')]({},_0x5f3d38,_0x4662e4[_0xfba5('0x3f')]);return db[_0xfba5('0x29')]['find'](_0x5f3d38)[_0xfba5('0x24')](handleEntityNotFound(_0x4e7294,null))[_0xfba5('0x24')](respondWithResult(_0x4e7294,null))[_0xfba5('0x43')](handleError(_0x4e7294,null));};exports['create']=function(_0x5d8f2b,_0x34e041){return db[_0xfba5('0x29')][_0xfba5('0x45')](_0x5d8f2b[_0xfba5('0x46')],{})['then'](function(_0x57feb5){var _0x14b31d=_0x5d8f2b[_0xfba5('0x47')][_0xfba5('0x23')]({'plain':!![]});if(!_0x14b31d)throw new Error(_0xfba5('0x48'));if(_0x14b31d['role']===_0xfba5('0x47')){var _0x1f37ea=_0x57feb5[_0xfba5('0x23')]({'plain':!![]});var _0x172627=_0xfba5('0x49');return db[_0xfba5('0x4a')][_0xfba5('0x4b')]({'where':{'name':_0x172627,'userProfileId':_0x14b31d[_0xfba5('0x4c')]},'raw':!![]})[_0xfba5('0x24')](function(_0x1a8011){if(_0x1a8011&&_0x1a8011[_0xfba5('0x4d')]===0x0){return db[_0xfba5('0x4e')][_0xfba5('0x45')]({'name':_0x1f37ea[_0xfba5('0x26')],'resourceId':_0x1f37ea['id'],'type':_0x1a8011['name'],'sectionId':_0x1a8011['id']},{})[_0xfba5('0x24')](function(){return _0x57feb5;});}else{return _0x57feb5;}})[_0xfba5('0x43')](function(_0x23f461){logger[_0xfba5('0x25')](_0xfba5('0x4f'),_0x23f461);throw _0x23f461;});}return _0x57feb5;})['then'](respondWithResult(_0x34e041,0xc9))['catch'](handleError(_0x34e041,null));};exports[_0xfba5('0x22')]=function(_0xaed257,_0x7e34b2){if(_0xaed257[_0xfba5('0x46')]['id']){delete _0xaed257[_0xfba5('0x46')]['id'];}return db['SquareOdbc'][_0xfba5('0x4b')]({'where':{'id':_0xaed257[_0xfba5('0x50')]['id']}})['then'](handleEntityNotFound(_0x7e34b2,null))[_0xfba5('0x24')](saveUpdates(_0xaed257['body'],null))[_0xfba5('0x24')](respondWithResult(_0x7e34b2,null))[_0xfba5('0x43')](handleError(_0x7e34b2,null));};exports['destroy']=function(_0xc3470f,_0x2fade2){return db[_0xfba5('0x29')][_0xfba5('0x4b')]({'where':{'id':_0xc3470f[_0xfba5('0x50')]['id']}})['then'](handleEntityNotFound(_0x2fade2,null))[_0xfba5('0x24')](removeEntity(_0x2fade2,null))[_0xfba5('0x43')](handleError(_0x2fade2,null));};exports[_0xfba5('0x51')]=function(_0x11c39a,_0x25a6a2,_0x501900){var _0x18688b;return db[_0xfba5('0x29')][_0xfba5('0x4b')]({'where':{'id':_0x11c39a[_0xfba5('0x50')]['id']},'attributes':['id','dsn']})['then'](handleEntityNotFound(_0x25a6a2,null))[_0xfba5('0x24')](function(_0x3486d3){if(_0x3486d3){var _0x19e5c2=require(_0xfba5('0x52'))();_0x19e5c2[_0xfba5('0x53')](_0x3486d3[_0xfba5('0x54')]);_0x19e5c2['closeSync']();return _0x3486d3;}})[_0xfba5('0x24')](respondWithResult(_0x25a6a2,null))[_0xfba5('0x43')](handleError(_0x25a6a2,null));}; \ No newline at end of file +var _0x9ef9=['sort','where','pick','filter','merge','VIRTUAL','options','count','includeAll','include','findAll','rows','show','params','length','find','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','test','dsn','odbc','closeSync','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','save','destroy','then','get','ODBC','UserProfileResource','error','stack','name','send','index','map','SquareOdbc','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order'];(function(_0x25f35f,_0x327376){var _0x20e051=function(_0x142c33){while(--_0x142c33){_0x25f35f['push'](_0x25f35f['shift']());}};_0x20e051(++_0x327376);}(_0x9ef9,0xd3));var _0x99ef=function(_0x5ac8da,_0x109a23){_0x5ac8da=_0x5ac8da-0x0;var _0x17b4c4=_0x9ef9[_0x5ac8da];return _0x17b4c4;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x99ef('0x0'));var jsonpatch=require(_0x99ef('0x1'));var rp=require(_0x99ef('0x2'));var moment=require(_0x99ef('0x3'));var BPromise=require(_0x99ef('0x4'));var Mustache=require(_0x99ef('0x5'));var util=require(_0x99ef('0x6'));var path=require(_0x99ef('0x7'));var sox=require(_0x99ef('0x8'));var csv=require(_0x99ef('0x9'));var ejs=require(_0x99ef('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x99ef('0xb'));var crypto=require(_0x99ef('0xc'));var jsforce=require(_0x99ef('0xd'));var deskjs=require(_0x99ef('0xe'));var toCsv=require(_0x99ef('0x9'));var querystring=require(_0x99ef('0xf'));var Papa=require(_0x99ef('0x10'));var Redis=require(_0x99ef('0x11'));var authService=require(_0x99ef('0x12'));var qs=require(_0x99ef('0x13'));var as=require(_0x99ef('0x14'));var hardwareService=require(_0x99ef('0x15'));var logger=require(_0x99ef('0x16'))(_0x99ef('0x17'));var utils=require(_0x99ef('0x18'));var config=require(_0x99ef('0x19'));var licenseUtil=require(_0x99ef('0x1a'));var db=require(_0x99ef('0x1b'))['db'];function respondWithStatusCode(_0x2d3aea,_0x412ab0){_0x412ab0=_0x412ab0||0xcc;return function(_0x2af0d8){if(_0x2af0d8){return _0x2d3aea[_0x99ef('0x1c')](_0x412ab0);}return _0x2d3aea[_0x99ef('0x1d')](_0x412ab0)[_0x99ef('0x1e')]();};}function respondWithResult(_0x3015ed,_0x3e8b43){_0x3e8b43=_0x3e8b43||0xc8;return function(_0x39c27b){if(_0x39c27b){return _0x3015ed[_0x99ef('0x1d')](_0x3e8b43)[_0x99ef('0x1f')](_0x39c27b);}};}function respondWithFilteredResult(_0x12ee42,_0x299722){return function(_0x1566b2){if(_0x1566b2){var _0x4696c2=typeof _0x299722[_0x99ef('0x20')]===_0x99ef('0x21')&&typeof _0x299722[_0x99ef('0x22')]===_0x99ef('0x21');var _0x5e47e6=_0x1566b2['count'];var _0x23fe0a=_0x4696c2?0x0:_0x299722[_0x99ef('0x20')];var _0x516f65=_0x4696c2?_0x1566b2['count']:_0x299722[_0x99ef('0x20')]+_0x299722[_0x99ef('0x22')];var _0x4758f9;if(_0x516f65>=_0x5e47e6){_0x516f65=_0x5e47e6;_0x4758f9=0xc8;}else{_0x4758f9=0xce;}_0x12ee42[_0x99ef('0x1d')](_0x4758f9);return _0x12ee42[_0x99ef('0x23')](_0x99ef('0x24'),_0x23fe0a+'-'+_0x516f65+'/'+_0x5e47e6)[_0x99ef('0x1f')](_0x1566b2);}return null;};}function patchUpdates(_0x3ec85a){return function(_0x50473d){try{jsonpatch['apply'](_0x50473d,_0x3ec85a,!![]);}catch(_0x40b662){return BPromise['reject'](_0x40b662);}return _0x50473d[_0x99ef('0x25')]();};}function saveUpdates(_0x4522f4,_0x1759a6){return function(_0x167370){if(_0x167370){return _0x167370['update'](_0x4522f4)['then'](function(_0x3a12ba){return _0x3a12ba;});}return null;};}function removeEntity(_0x37fbcf,_0x4a271c){return function(_0x202bdb){if(_0x202bdb){return _0x202bdb[_0x99ef('0x26')]()[_0x99ef('0x27')](function(){var _0x5bdd55=_0x202bdb[_0x99ef('0x28')]({'plain':!![]});var _0x30d4d1=_0x99ef('0x29');return db[_0x99ef('0x2a')][_0x99ef('0x26')]({'where':{'type':_0x30d4d1,'resourceId':_0x5bdd55['id']}})[_0x99ef('0x27')](function(){return _0x202bdb;});})[_0x99ef('0x27')](function(){_0x37fbcf[_0x99ef('0x1d')](0xcc)[_0x99ef('0x1e')]();});}};}function handleEntityNotFound(_0x13d5d9,_0xa9acd9){return function(_0x28b089){if(!_0x28b089){_0x13d5d9[_0x99ef('0x1c')](0x194);}return _0x28b089;};}function handleError(_0x518988,_0x328711){_0x328711=_0x328711||0x1f4;return function(_0x5222b0){logger[_0x99ef('0x2b')](_0x5222b0[_0x99ef('0x2c')]);if(_0x5222b0[_0x99ef('0x2d')]){delete _0x5222b0[_0x99ef('0x2d')];}_0x518988[_0x99ef('0x1d')](_0x328711)[_0x99ef('0x2e')](_0x5222b0);};}exports[_0x99ef('0x2f')]=function(_0x50e636,_0x425900){var _0x3761d5={},_0x5f007e={},_0x27d044={'count':0x0,'rows':[]};var _0x2f6fde=_[_0x99ef('0x30')](db[_0x99ef('0x31')]['rawAttributes'],function(_0x530606){return{'name':_0x530606['fieldName'],'type':_0x530606[_0x99ef('0x32')][_0x99ef('0x33')]};});_0x5f007e[_0x99ef('0x34')]=_['map'](_0x2f6fde,_0x99ef('0x2d'));_0x5f007e[_0x99ef('0x35')]=_[_0x99ef('0x36')](_0x50e636[_0x99ef('0x35')]);_0x5f007e[_0x99ef('0x37')]=_[_0x99ef('0x38')](_0x5f007e['model'],_0x5f007e[_0x99ef('0x35')]);_0x3761d5[_0x99ef('0x39')]=_[_0x99ef('0x38')](_0x5f007e[_0x99ef('0x34')],qs[_0x99ef('0x3a')](_0x50e636[_0x99ef('0x35')][_0x99ef('0x3a')]));_0x3761d5['attributes']=_0x3761d5[_0x99ef('0x39')]['length']?_0x3761d5['attributes']:_0x5f007e[_0x99ef('0x34')];if(!_0x50e636[_0x99ef('0x35')][_0x99ef('0x3b')](_0x99ef('0x3c'))){_0x3761d5[_0x99ef('0x22')]=qs[_0x99ef('0x22')](_0x50e636['query'][_0x99ef('0x22')]);_0x3761d5['offset']=qs['offset'](_0x50e636['query'][_0x99ef('0x20')]);}_0x3761d5[_0x99ef('0x3d')]=qs[_0x99ef('0x3e')](_0x50e636[_0x99ef('0x35')]['sort']);_0x3761d5[_0x99ef('0x3f')]=qs['filters'](_[_0x99ef('0x40')](_0x50e636['query'],_0x5f007e[_0x99ef('0x37')]),_0x2f6fde);if(_0x50e636[_0x99ef('0x35')][_0x99ef('0x41')]){_0x3761d5[_0x99ef('0x3f')]=_[_0x99ef('0x42')](_0x3761d5[_0x99ef('0x3f')],{'$or':_['map'](_0x2f6fde,function(_0x437663){if(_0x437663[_0x99ef('0x32')]!==_0x99ef('0x43')){var _0x1b5992={};_0x1b5992[_0x437663[_0x99ef('0x2d')]]={'$like':'%'+_0x50e636[_0x99ef('0x35')]['filter']+'%'};return _0x1b5992;}})});}_0x3761d5=_['merge']({},_0x3761d5,_0x50e636[_0x99ef('0x44')]);var _0x37cf82={'where':_0x3761d5[_0x99ef('0x3f')]};return db['SquareOdbc'][_0x99ef('0x45')](_0x37cf82)[_0x99ef('0x27')](function(_0x51c705){_0x27d044[_0x99ef('0x45')]=_0x51c705;if(_0x50e636['query'][_0x99ef('0x46')]){_0x3761d5[_0x99ef('0x47')]=[{'all':!![]}];}return db[_0x99ef('0x31')][_0x99ef('0x48')](_0x3761d5);})[_0x99ef('0x27')](function(_0x338c8a){_0x27d044[_0x99ef('0x49')]=_0x338c8a;return _0x27d044;})[_0x99ef('0x27')](respondWithFilteredResult(_0x425900,_0x3761d5))['catch'](handleError(_0x425900,null));};exports[_0x99ef('0x4a')]=function(_0xdcb9c6,_0x496fb3){var _0x6073ba={'raw':!![],'where':{'id':_0xdcb9c6[_0x99ef('0x4b')]['id']}},_0x105e66={};_0x105e66[_0x99ef('0x34')]=_['keys'](db[_0x99ef('0x31')]['rawAttributes']);_0x105e66['query']=_[_0x99ef('0x36')](_0xdcb9c6[_0x99ef('0x35')]);_0x105e66[_0x99ef('0x37')]=_['intersection'](_0x105e66[_0x99ef('0x34')],_0x105e66[_0x99ef('0x35')]);_0x6073ba['attributes']=_[_0x99ef('0x38')](_0x105e66['model'],qs[_0x99ef('0x3a')](_0xdcb9c6[_0x99ef('0x35')]['fields']));_0x6073ba[_0x99ef('0x39')]=_0x6073ba['attributes'][_0x99ef('0x4c')]?_0x6073ba[_0x99ef('0x39')]:_0x105e66[_0x99ef('0x34')];if(_0xdcb9c6['query'][_0x99ef('0x46')]){_0x6073ba[_0x99ef('0x47')]=[{'all':!![]}];}_0x6073ba=_[_0x99ef('0x42')]({},_0x6073ba,_0xdcb9c6[_0x99ef('0x44')]);return db[_0x99ef('0x31')][_0x99ef('0x4d')](_0x6073ba)[_0x99ef('0x27')](handleEntityNotFound(_0x496fb3,null))[_0x99ef('0x27')](respondWithResult(_0x496fb3,null))[_0x99ef('0x4e')](handleError(_0x496fb3,null));};exports[_0x99ef('0x4f')]=function(_0xf20b4,_0x5edb0a){return db[_0x99ef('0x31')][_0x99ef('0x4f')](_0xf20b4['body'],{})[_0x99ef('0x27')](function(_0x13d97f){var _0x4328ef=_0xf20b4[_0x99ef('0x50')][_0x99ef('0x28')]({'plain':!![]});if(!_0x4328ef)throw new Error(_0x99ef('0x51'));if(_0x4328ef[_0x99ef('0x52')]===_0x99ef('0x50')){var _0x405829=_0x13d97f[_0x99ef('0x28')]({'plain':!![]});var _0x33c0da=_0x99ef('0x29');return db['UserProfileSection'][_0x99ef('0x4d')]({'where':{'name':_0x33c0da,'userProfileId':_0x4328ef[_0x99ef('0x53')]},'raw':!![]})[_0x99ef('0x27')](function(_0x4c34fb){if(_0x4c34fb&&_0x4c34fb[_0x99ef('0x54')]===0x0){return db[_0x99ef('0x2a')]['create']({'name':_0x405829[_0x99ef('0x2d')],'resourceId':_0x405829['id'],'type':_0x4c34fb[_0x99ef('0x2d')],'sectionId':_0x4c34fb['id']},{})[_0x99ef('0x27')](function(){return _0x13d97f;});}else{return _0x13d97f;}})['catch'](function(_0x1c524b){logger[_0x99ef('0x2b')](_0x99ef('0x55'),_0x1c524b);throw _0x1c524b;});}return _0x13d97f;})['then'](respondWithResult(_0x5edb0a,0xc9))[_0x99ef('0x4e')](handleError(_0x5edb0a,null));};exports[_0x99ef('0x56')]=function(_0x431d34,_0x13ea08){if(_0x431d34['body']['id']){delete _0x431d34['body']['id'];}return db['SquareOdbc'][_0x99ef('0x4d')]({'where':{'id':_0x431d34[_0x99ef('0x4b')]['id']}})[_0x99ef('0x27')](handleEntityNotFound(_0x13ea08,null))['then'](saveUpdates(_0x431d34['body'],null))[_0x99ef('0x27')](respondWithResult(_0x13ea08,null))[_0x99ef('0x4e')](handleError(_0x13ea08,null));};exports[_0x99ef('0x26')]=function(_0x47fac8,_0x369526){return db[_0x99ef('0x31')]['find']({'where':{'id':_0x47fac8[_0x99ef('0x4b')]['id']}})[_0x99ef('0x27')](handleEntityNotFound(_0x369526,null))[_0x99ef('0x27')](removeEntity(_0x369526,null))[_0x99ef('0x4e')](handleError(_0x369526,null));};exports[_0x99ef('0x57')]=function(_0xb70f71,_0x3acdb7,_0x210c45){var _0x29f88d;return db['SquareOdbc']['find']({'where':{'id':_0xb70f71[_0x99ef('0x4b')]['id']},'attributes':['id',_0x99ef('0x58')]})[_0x99ef('0x27')](handleEntityNotFound(_0x3acdb7,null))['then'](function(_0x49d9ae){if(_0x49d9ae){var _0x1210b=require(_0x99ef('0x59'))();_0x1210b['openSync'](_0x49d9ae[_0x99ef('0x58')]);_0x1210b[_0x99ef('0x5a')]();return _0x49d9ae;}})[_0x99ef('0x27')](respondWithResult(_0x3acdb7,null))[_0x99ef('0x4e')](handleError(_0x3acdb7,null));}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.model.js b/server/api/squareOdbc/squareOdbc.model.js index 24cbf4e..2d4e940 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 _0x4358=['lodash','util','../../config/logger','api','path','rimraf','exports','define','square_odbc'];(function(_0x59e2a2,_0x278395){var _0x3e4db2=function(_0x40cd2e){while(--_0x40cd2e){_0x59e2a2['push'](_0x59e2a2['shift']());}};_0x3e4db2(++_0x278395);}(_0x4358,0x90));var _0x8435=function(_0x595604,_0x2cc998){_0x595604=_0x595604-0x0;var _0x1466f3=_0x4358[_0x595604];return _0x1466f3;};'use strict';var _=require(_0x8435('0x0'));var util=require(_0x8435('0x1'));var logger=require(_0x8435('0x2'))(_0x8435('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x8435('0x4'));var rimraf=require(_0x8435('0x5'));var config=require('../../config/environment');var attributes=require('./squareOdbc.attributes');module[_0x8435('0x6')]=function(_0x142daf,_0x375716){return _0x142daf[_0x8435('0x7')]('SquareOdbc',attributes,{'tableName':_0x8435('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4019=['define','SquareOdbc','square_odbc','lodash','../../config/logger','api','moment','request-promise','path','rimraf','./squareOdbc.attributes','exports'];(function(_0x4a4e94,_0x2a92ca){var _0x2c0dd9=function(_0x2ab9c7){while(--_0x2ab9c7){_0x4a4e94['push'](_0x4a4e94['shift']());}};_0x2c0dd9(++_0x2a92ca);}(_0x4019,0x1a7));var _0x9401=function(_0x1385ce,_0x3c756e){_0x1385ce=_0x1385ce-0x0;var _0x330e91=_0x4019[_0x1385ce];return _0x330e91;};'use strict';var _=require(_0x9401('0x0'));var util=require('util');var logger=require(_0x9401('0x1'))(_0x9401('0x2'));var moment=require(_0x9401('0x3'));var BPromise=require('bluebird');var rp=require(_0x9401('0x4'));var fs=require('fs');var path=require(_0x9401('0x5'));var rimraf=require(_0x9401('0x6'));var config=require('../../config/environment');var attributes=require(_0x9401('0x7'));module[_0x9401('0x8')]=function(_0x55bf44,_0x9f8701){return _0x55bf44[_0x9401('0x9')](_0x9401('0xa'),attributes,{'tableName':_0x9401('0xb'),'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 e802bc0..c26c2c0 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 _0x1e47=['rpc','jayson/promise','client','http','then','info','request\x20sent','debug','SquareOdbc,\x20%s,\x20%s,\x20%s','stringify','error','code','SquareOdbc,\x20%s,\x20%s','message','result','catch','ShowSquareOdbc','find','options','where','include','map','model','attributes','util','moment','randomstring','../../mysqldb','../../config/logger'];(function(_0x27367b,_0x289054){var _0x5b2a53=function(_0x2887f6){while(--_0x2887f6){_0x27367b['push'](_0x27367b['shift']());}};_0x5b2a53(++_0x289054);}(_0x1e47,0x174));var _0x71e4=function(_0x2176b3,_0x4dedde){_0x2176b3=_0x2176b3-0x0;var _0x1eae82=_0x1e47[_0x2176b3];return _0x1eae82;};'use strict';var _=require('lodash');var util=require(_0x71e4('0x0'));var moment=require(_0x71e4('0x1'));var BPromise=require('bluebird');var rs=require(_0x71e4('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x71e4('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x71e4('0x4'))(_0x71e4('0x5'));var config=require('../../config/environment');var jayson=require(_0x71e4('0x6'));var client=jayson[_0x71e4('0x7')][_0x71e4('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1e38da,_0x5fb1a1,_0x32f61d){return new BPromise(function(_0x545a11,_0x50fb58){return client['request'](_0x1e38da,_0x32f61d)[_0x71e4('0x9')](function(_0x2ea8e3){logger[_0x71e4('0xa')]('SquareOdbc,\x20%s,\x20%s',_0x5fb1a1,_0x71e4('0xb'));logger[_0x71e4('0xc')](_0x71e4('0xd'),_0x5fb1a1,_0x71e4('0xb'),JSON[_0x71e4('0xe')](_0x2ea8e3));if(_0x2ea8e3[_0x71e4('0xf')]){if(_0x2ea8e3['error'][_0x71e4('0x10')]===0x1f4){logger['error'](_0x71e4('0x11'),_0x5fb1a1,_0x2ea8e3[_0x71e4('0xf')]['message']);return _0x50fb58(_0x2ea8e3[_0x71e4('0xf')][_0x71e4('0x12')]);}logger[_0x71e4('0xf')](_0x71e4('0x11'),_0x5fb1a1,_0x2ea8e3[_0x71e4('0xf')][_0x71e4('0x12')]);return _0x545a11(_0x2ea8e3[_0x71e4('0xf')][_0x71e4('0x12')]);}else{logger[_0x71e4('0xa')](_0x71e4('0x11'),_0x5fb1a1,_0x71e4('0xb'));_0x545a11(_0x2ea8e3[_0x71e4('0x13')][_0x71e4('0x12')]);}})[_0x71e4('0x14')](function(_0x1c9ceb){logger[_0x71e4('0xf')](_0x71e4('0x11'),_0x5fb1a1,_0x1c9ceb);_0x50fb58(_0x1c9ceb);});});}exports[_0x71e4('0x15')]=function(_0xa8a37a){var _0x5e7443=this;return new Promise(function(_0x4fde21,_0x52f6f0){return db['SquareOdbc'][_0x71e4('0x16')]({'raw':_0xa8a37a[_0x71e4('0x17')]?_0xa8a37a['options']['raw']===undefined?!![]:![]:!![],'where':_0xa8a37a[_0x71e4('0x17')]?_0xa8a37a[_0x71e4('0x17')][_0x71e4('0x18')]||null:null,'attributes':_0xa8a37a[_0x71e4('0x17')]?_0xa8a37a['options']['attributes']||null:null,'include':_0xa8a37a[_0x71e4('0x17')]?_0xa8a37a[_0x71e4('0x17')][_0x71e4('0x19')]?_[_0x71e4('0x1a')](_0xa8a37a[_0x71e4('0x17')][_0x71e4('0x19')],function(_0x596be2){return{'model':db[_0x596be2[_0x71e4('0x1b')]],'as':_0x596be2['as'],'attributes':_0x596be2[_0x71e4('0x1c')],'include':_0x596be2['include']?_[_0x71e4('0x1a')](_0x596be2[_0x71e4('0x19')],function(_0x26f188){return{'model':db[_0x26f188['model']],'as':_0x26f188['as'],'attributes':_0x26f188[_0x71e4('0x1c')],'include':_0x26f188[_0x71e4('0x19')]?_[_0x71e4('0x1a')](_0x26f188[_0x71e4('0x19')],function(_0x25b192){return{'model':db[_0x25b192['model']],'as':_0x25b192['as'],'attributes':_0x25b192['attributes']};}):[]};}):[]};}):[]:[]})[_0x71e4('0x9')](function(_0x1b745e){logger[_0x71e4('0xa')](_0x71e4('0x15'),_0xa8a37a);logger['debug'](_0x71e4('0x15'),_0xa8a37a,JSON[_0x71e4('0xe')](_0x1b745e));_0x4fde21(_0x1b745e);})[_0x71e4('0x14')](function(_0x2222bb){logger[_0x71e4('0xf')](_0x71e4('0x15'),_0x2222bb[_0x71e4('0x12')],_0xa8a37a);_0x52f6f0(_0x5e7443[_0x71e4('0xf')](0x1f4,_0x2222bb[_0x71e4('0x12')]));});});}; \ No newline at end of file +var _0xdeb4=['client','http','request','then','SquareOdbc,\x20%s,\x20%s','request\x20sent','debug','SquareOdbc,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','SquareOdbc','options','raw','where','attributes','include','map','model','ShowSquareOdbc','lodash','util','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x20cc29,_0x30a46d){var _0x28d513=function(_0x179b06){while(--_0x179b06){_0x20cc29['push'](_0x20cc29['shift']());}};_0x28d513(++_0x30a46d);}(_0xdeb4,0x1a9));var _0x4deb=function(_0x5ef2bb,_0x40d065){_0x5ef2bb=_0x5ef2bb-0x0;var _0x12ad06=_0xdeb4[_0x5ef2bb];return _0x12ad06;};'use strict';var _=require(_0x4deb('0x0'));var util=require(_0x4deb('0x1'));var moment=require('moment');var BPromise=require(_0x4deb('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4deb('0x3'))['db'];var utils=require(_0x4deb('0x4'));var logger=require(_0x4deb('0x5'))(_0x4deb('0x6'));var config=require(_0x4deb('0x7'));var jayson=require(_0x4deb('0x8'));var client=jayson[_0x4deb('0x9')][_0x4deb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xaf4915,_0x358622,_0x41153d){return new BPromise(function(_0x3051de,_0x15e8d8){return client[_0x4deb('0xb')](_0xaf4915,_0x41153d)[_0x4deb('0xc')](function(_0x5d1181){logger['info'](_0x4deb('0xd'),_0x358622,_0x4deb('0xe'));logger[_0x4deb('0xf')](_0x4deb('0x10'),_0x358622,'request\x20sent',JSON[_0x4deb('0x11')](_0x5d1181));if(_0x5d1181['error']){if(_0x5d1181[_0x4deb('0x12')][_0x4deb('0x13')]===0x1f4){logger[_0x4deb('0x12')]('SquareOdbc,\x20%s,\x20%s',_0x358622,_0x5d1181['error'][_0x4deb('0x14')]);return _0x15e8d8(_0x5d1181[_0x4deb('0x12')][_0x4deb('0x14')]);}logger['error'](_0x4deb('0xd'),_0x358622,_0x5d1181[_0x4deb('0x12')][_0x4deb('0x14')]);return _0x3051de(_0x5d1181[_0x4deb('0x12')][_0x4deb('0x14')]);}else{logger['info'](_0x4deb('0xd'),_0x358622,_0x4deb('0xe'));_0x3051de(_0x5d1181['result']['message']);}})[_0x4deb('0x15')](function(_0x5256ca){logger[_0x4deb('0x12')](_0x4deb('0xd'),_0x358622,_0x5256ca);_0x15e8d8(_0x5256ca);});});}exports['ShowSquareOdbc']=function(_0x5b7ebe){var _0x814eb1=this;return new Promise(function(_0x4b1dd8,_0x2e3ee5){return db[_0x4deb('0x16')]['find']({'raw':_0x5b7ebe[_0x4deb('0x17')]?_0x5b7ebe[_0x4deb('0x17')][_0x4deb('0x18')]===undefined?!![]:![]:!![],'where':_0x5b7ebe[_0x4deb('0x17')]?_0x5b7ebe[_0x4deb('0x17')][_0x4deb('0x19')]||null:null,'attributes':_0x5b7ebe[_0x4deb('0x17')]?_0x5b7ebe[_0x4deb('0x17')][_0x4deb('0x1a')]||null:null,'include':_0x5b7ebe['options']?_0x5b7ebe['options'][_0x4deb('0x1b')]?_[_0x4deb('0x1c')](_0x5b7ebe['options'][_0x4deb('0x1b')],function(_0x36efe1){return{'model':db[_0x36efe1[_0x4deb('0x1d')]],'as':_0x36efe1['as'],'attributes':_0x36efe1['attributes'],'include':_0x36efe1['include']?_['map'](_0x36efe1[_0x4deb('0x1b')],function(_0x16f6e3){return{'model':db[_0x16f6e3[_0x4deb('0x1d')]],'as':_0x16f6e3['as'],'attributes':_0x16f6e3[_0x4deb('0x1a')],'include':_0x16f6e3[_0x4deb('0x1b')]?_[_0x4deb('0x1c')](_0x16f6e3[_0x4deb('0x1b')],function(_0x5900d1){return{'model':db[_0x5900d1[_0x4deb('0x1d')]],'as':_0x5900d1['as'],'attributes':_0x5900d1[_0x4deb('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x4deb('0xc')](function(_0x3bde33){logger['info']('ShowSquareOdbc',_0x5b7ebe);logger[_0x4deb('0xf')](_0x4deb('0x1e'),_0x5b7ebe,JSON[_0x4deb('0x11')](_0x3bde33));_0x4b1dd8(_0x3bde33);})[_0x4deb('0x15')](function(_0x1dbdf8){logger[_0x4deb('0x12')]('ShowSquareOdbc',_0x1dbdf8[_0x4deb('0x14')],_0x5b7ebe);_0x2e3ee5(_0x814eb1[_0x4deb('0x12')](0x1f4,_0x1dbdf8[_0x4deb('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/index.js b/server/api/squareProject/index.js index 61e4e9f..1fdd034 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 _0x5d49=['isAuthenticated','/:id','post','create','put','update','delete','destroy','exports','multer','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareProject.controller','get'];(function(_0x565fed,_0xb85768){var _0x3e018f=function(_0x104d8e){while(--_0x104d8e){_0x565fed['push'](_0x565fed['shift']());}};_0x3e018f(++_0xb85768);}(_0x5d49,0x195));var _0x95d4=function(_0x415bcf,_0x121c9a){_0x415bcf=_0x415bcf-0x0;var _0x3a3a61=_0x5d49[_0x415bcf];return _0x3a3a61;};'use strict';var multer=require(_0x95d4('0x0'));var util=require('util');var path=require(_0x95d4('0x1'));var timeout=require('connect-timeout');var express=require(_0x95d4('0x2'));var router=express[_0x95d4('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x95d4('0x4'));var interaction=require(_0x95d4('0x5'));var config=require(_0x95d4('0x6'));var controller=require(_0x95d4('0x7'));router[_0x95d4('0x8')]('/',auth[_0x95d4('0x9')](),controller['index']);router[_0x95d4('0x8')](_0x95d4('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x95d4('0xb')]('/',auth[_0x95d4('0x9')](),controller[_0x95d4('0xc')]);router[_0x95d4('0xd')](_0x95d4('0xa'),auth[_0x95d4('0x9')](),controller[_0x95d4('0xe')]);router[_0x95d4('0xf')](_0x95d4('0xa'),auth[_0x95d4('0x9')](),controller[_0x95d4('0x10')]);module[_0x95d4('0x11')]=router; \ No newline at end of file +var _0xbed4=['show','post','isAuthenticated','create','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/:id'];(function(_0x656984,_0x49f1f6){var _0xee0f31=function(_0x5434c3){while(--_0x5434c3){_0x656984['push'](_0x656984['shift']());}};_0xee0f31(++_0x49f1f6);}(_0xbed4,0x66));var _0x4bed=function(_0x5f4b38,_0x390015){_0x5f4b38=_0x5f4b38-0x0;var _0x16018a=_0xbed4[_0x5f4b38];return _0x16018a;};'use strict';var multer=require('multer');var util=require(_0x4bed('0x0'));var path=require(_0x4bed('0x1'));var timeout=require(_0x4bed('0x2'));var express=require('express');var router=express[_0x4bed('0x3')]();var fs_extra=require(_0x4bed('0x4'));var auth=require(_0x4bed('0x5'));var interaction=require(_0x4bed('0x6'));var config=require(_0x4bed('0x7'));var controller=require('./squareProject.controller');router[_0x4bed('0x8')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x4bed('0x9'),auth['isAuthenticated'](),controller[_0x4bed('0xa')]);router[_0x4bed('0xb')]('/',auth[_0x4bed('0xc')](),controller[_0x4bed('0xd')]);router['put']('/:id',auth[_0x4bed('0xc')](),controller['update']);router['delete'](_0x4bed('0x9'),auth[_0x4bed('0xc')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.attributes.js b/server/api/squareProject/squareProject.attributes.js index cda3577..2417b53 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 _0x9b25=['production','DATE','sequelize','exports','STRING','TEXT','BLOB','long','getDataValue','preproduction','toString','utf8'];(function(_0x38b38b,_0x532e33){var _0x107df7=function(_0x5da793){while(--_0x5da793){_0x38b38b['push'](_0x38b38b['shift']());}};_0x107df7(++_0x532e33);}(_0x9b25,0x1be));var _0x59b2=function(_0x1e1454,_0x55ec94){_0x1e1454=_0x1e1454-0x0;var _0x43c201=_0x9b25[_0x1e1454];return _0x43c201;};'use strict';var Sequelize=require(_0x59b2('0x0'));module[_0x59b2('0x1')]={'name':{'type':Sequelize[_0x59b2('0x2')],'unique':'name','allowNull':![]},'description':{'type':Sequelize[_0x59b2('0x2')]},'notes':{'type':Sequelize[_0x59b2('0x3')]},'preproduction':{'type':Sequelize[_0x59b2('0x4')](_0x59b2('0x5')),'get':function(){if(this[_0x59b2('0x6')]('preproduction')){return this['getDataValue'](_0x59b2('0x7'))[_0x59b2('0x8')](_0x59b2('0x9'));}}},'production':{'type':Sequelize[_0x59b2('0x4')]('long'),'get':function(){if(this[_0x59b2('0x6')](_0x59b2('0xa'))){return this['getDataValue']('production')[_0x59b2('0x8')](_0x59b2('0x9'));}}},'savedAt':{'type':Sequelize[_0x59b2('0xb')]},'publishedAt':{'type':Sequelize['DATE']}}; \ No newline at end of file +var _0x2a58=['preproduction','toString','utf8','long','production','DATE','sequelize','name','STRING','TEXT','BLOB','getDataValue'];(function(_0x4a325a,_0x72ae77){var _0x2e545a=function(_0x53bdb1){while(--_0x53bdb1){_0x4a325a['push'](_0x4a325a['shift']());}};_0x2e545a(++_0x72ae77);}(_0x2a58,0x102));var _0x82a5=function(_0x14040b,_0x5758a3){_0x14040b=_0x14040b-0x0;var _0x4d721a=_0x2a58[_0x14040b];return _0x4d721a;};'use strict';var Sequelize=require(_0x82a5('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x82a5('0x1'),'allowNull':![]},'description':{'type':Sequelize[_0x82a5('0x2')]},'notes':{'type':Sequelize[_0x82a5('0x3')]},'preproduction':{'type':Sequelize[_0x82a5('0x4')]('long'),'get':function(){if(this[_0x82a5('0x5')](_0x82a5('0x6'))){return this[_0x82a5('0x5')](_0x82a5('0x6'))[_0x82a5('0x7')](_0x82a5('0x8'));}}},'production':{'type':Sequelize['BLOB'](_0x82a5('0x9')),'get':function(){if(this[_0x82a5('0x5')](_0x82a5('0xa'))){return this['getDataValue']('production')[_0x82a5('0x7')]('utf8');}}},'savedAt':{'type':Sequelize[_0x82a5('0xb')]},'publishedAt':{'type':Sequelize['DATE']}}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.controller.js b/server/api/squareProject/squareProject.controller.js index db4762a..c01841d 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 _0x68b4=['attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','includeAll','include','rows','catch','params','rawAttributes','keys','options','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','agi','production','lodash','ioredis','../../components/parsers/qs','api','../../config/environment','../../mysqldb','redis','localhost','./squareProject.socket','register','status','json','offset','limit','undefined','count','set','Content-Range','update','destroy','get','SquareProjects','then','publish','stringify','sendStatus','error','stack','name','send','index','map','SquareProject','fieldName','key','model','query','filters'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x68b4,0x66));var _0x468b=function(_0x482a41,_0x4dc5b2){_0x482a41=_0x482a41-0x0;var _0x47e41a=_0x68b4[_0x482a41];return _0x47e41a;};'use strict';var _=require(_0x468b('0x0'));var Redis=require(_0x468b('0x1'));var qs=require(_0x468b('0x2'));var logger=require('../../config/logger')(_0x468b('0x3'));var config=require(_0x468b('0x4'));var db=require(_0x468b('0x5'))['db'];config[_0x468b('0x6')]=_['defaults'](config['redis'],{'host':_0x468b('0x7'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x468b('0x6')]));require(_0x468b('0x8'))[_0x468b('0x9')](socket);function respondWithResult(_0x36fdd7,_0x57e3a0){_0x57e3a0=_0x57e3a0||0xc8;return function(_0x2e075a){if(_0x2e075a){return _0x36fdd7[_0x468b('0xa')](_0x57e3a0)[_0x468b('0xb')](_0x2e075a);}};}function respondWithFilteredResult(_0x10fc3b,_0xdcd4c6){return function(_0x325eab){if(_0x325eab){var _0x7cfe0f=typeof _0xdcd4c6[_0x468b('0xc')]==='undefined'&&typeof _0xdcd4c6[_0x468b('0xd')]===_0x468b('0xe');var _0x5ad0ed=_0x325eab['count'];var _0x20ef60=_0x7cfe0f?0x0:_0xdcd4c6[_0x468b('0xc')];var _0x6a9cf1=_0x7cfe0f?_0x325eab[_0x468b('0xf')]:_0xdcd4c6[_0x468b('0xc')]+_0xdcd4c6['limit'];var _0xd3b027;if(_0x6a9cf1>=_0x5ad0ed){_0x6a9cf1=_0x5ad0ed;_0xd3b027=0xc8;}else{_0xd3b027=0xce;}_0x10fc3b[_0x468b('0xa')](_0xd3b027);return _0x10fc3b[_0x468b('0x10')](_0x468b('0x11'),_0x20ef60+'-'+_0x6a9cf1+'/'+_0x5ad0ed)[_0x468b('0xb')](_0x325eab);}return null;};}function saveUpdates(_0x555889){return function(_0x4c45e1){if(_0x4c45e1){return _0x4c45e1[_0x468b('0x12')](_0x555889)['then'](function(_0xfd9e52){return _0xfd9e52;});}return null;};}function removeEntity(_0x470d19){return function(_0x4d49e8){if(_0x4d49e8){return _0x4d49e8[_0x468b('0x13')]()['then'](function(){var _0x1d4676=_0x4d49e8[_0x468b('0x14')]({'plain':!![]});var _0x5c38c6=_0x468b('0x15');return db['UserProfileResource'][_0x468b('0x13')]({'where':{'type':_0x5c38c6,'resourceId':_0x1d4676['id']}})[_0x468b('0x16')](function(){return _0x4d49e8;});})[_0x468b('0x16')](function(){var _0x3010f8=new Redis(config[_0x468b('0x6')]);_0x3010f8[_0x468b('0x17')]('agi',JSON[_0x468b('0x18')]({'id':_0x4d49e8['id'],'deleted':!![]}));})[_0x468b('0x16')](function(){_0x470d19[_0x468b('0xa')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3adbb0){return function(_0x251127){if(!_0x251127){_0x3adbb0[_0x468b('0x19')](0x194);}return _0x251127;};}function handleError(_0x5025f1,_0x1287a9){_0x1287a9=_0x1287a9||0x1f4;return function(_0x5804a2){logger[_0x468b('0x1a')](_0x5804a2[_0x468b('0x1b')]);if(_0x5804a2[_0x468b('0x1c')]){delete _0x5804a2['name'];}_0x5025f1[_0x468b('0xa')](_0x1287a9)[_0x468b('0x1d')](_0x5804a2);};}exports[_0x468b('0x1e')]=function(_0x4d06ec,_0x1e25e0){var _0xa86a6={},_0x36ebf8={},_0x31238f={'count':0x0,'rows':[]};var _0x324661=_[_0x468b('0x1f')](db[_0x468b('0x20')]['rawAttributes'],function(_0x569288){return{'name':_0x569288[_0x468b('0x21')],'type':_0x569288['type'][_0x468b('0x22')]};});_0x36ebf8[_0x468b('0x23')]=_[_0x468b('0x1f')](_0x324661,_0x468b('0x1c'));_0x36ebf8[_0x468b('0x24')]=_['keys'](_0x4d06ec['query']);_0x36ebf8[_0x468b('0x25')]=_['intersection'](_0x36ebf8[_0x468b('0x23')],_0x36ebf8['query']);_0xa86a6[_0x468b('0x26')]=_[_0x468b('0x27')](_0x36ebf8['model'],qs['fields'](_0x4d06ec[_0x468b('0x24')][_0x468b('0x28')]));_0xa86a6['attributes']=_0xa86a6[_0x468b('0x26')][_0x468b('0x29')]?_0xa86a6[_0x468b('0x26')]:_0x36ebf8[_0x468b('0x23')];if(!_0x4d06ec[_0x468b('0x24')][_0x468b('0x2a')]('nolimit')){_0xa86a6[_0x468b('0xd')]=qs[_0x468b('0xd')](_0x4d06ec[_0x468b('0x24')]['limit']);_0xa86a6[_0x468b('0xc')]=qs['offset'](_0x4d06ec[_0x468b('0x24')]['offset']);}_0xa86a6[_0x468b('0x2b')]=qs[_0x468b('0x2c')](_0x4d06ec[_0x468b('0x24')][_0x468b('0x2c')]);_0xa86a6[_0x468b('0x2d')]=qs['filters'](_[_0x468b('0x2e')](_0x4d06ec[_0x468b('0x24')],_0x36ebf8[_0x468b('0x25')]),_0x324661);if(_0x4d06ec[_0x468b('0x24')][_0x468b('0x2f')]){_0xa86a6[_0x468b('0x2d')]=_['merge'](_0xa86a6['where'],{'$or':_[_0x468b('0x1f')](_0x324661,function(_0x4780a0){if(_0x4780a0['type']!=='VIRTUAL'){var _0x5d149d={};_0x5d149d[_0x4780a0[_0x468b('0x1c')]]={'$like':'%'+_0x4d06ec[_0x468b('0x24')][_0x468b('0x2f')]+'%'};return _0x5d149d;}})});}_0xa86a6=_[_0x468b('0x30')]({},_0xa86a6,_0x4d06ec['options']);var _0x251ba1={'where':_0xa86a6[_0x468b('0x2d')]};return db[_0x468b('0x20')][_0x468b('0xf')](_0x251ba1)['then'](function(_0xcdd04f){_0x31238f['count']=_0xcdd04f;if(_0x4d06ec[_0x468b('0x24')][_0x468b('0x31')]){_0xa86a6[_0x468b('0x32')]=[{'all':!![]}];}return db[_0x468b('0x20')]['findAll'](_0xa86a6);})['then'](function(_0x1a01d3){_0x31238f[_0x468b('0x33')]=_0x1a01d3;return _0x31238f;})[_0x468b('0x16')](respondWithFilteredResult(_0x1e25e0,_0xa86a6))[_0x468b('0x34')](handleError(_0x1e25e0,null));};exports['show']=function(_0x52b8e3,_0x517d47){var _0x182f5a={'raw':![],'where':{'id':_0x52b8e3[_0x468b('0x35')]['id']}},_0x543c15={};_0x543c15[_0x468b('0x23')]=_['keys'](db[_0x468b('0x20')][_0x468b('0x36')]);_0x543c15['query']=_[_0x468b('0x37')](_0x52b8e3[_0x468b('0x24')]);_0x543c15['filters']=_[_0x468b('0x27')](_0x543c15[_0x468b('0x23')],_0x543c15[_0x468b('0x24')]);_0x182f5a[_0x468b('0x26')]=_[_0x468b('0x27')](_0x543c15[_0x468b('0x23')],qs[_0x468b('0x28')](_0x52b8e3[_0x468b('0x24')][_0x468b('0x28')]));_0x182f5a[_0x468b('0x26')]=_0x182f5a[_0x468b('0x26')][_0x468b('0x29')]?_0x182f5a['attributes']:_0x543c15[_0x468b('0x23')];if(_0x52b8e3['query']['includeAll']){_0x182f5a[_0x468b('0x32')]=[{'all':!![]}];}_0x182f5a=_['merge']({},_0x182f5a,_0x52b8e3[_0x468b('0x38')]);return db[_0x468b('0x20')][_0x468b('0x39')](_0x182f5a)[_0x468b('0x16')](handleEntityNotFound(_0x517d47,null))[_0x468b('0x16')](respondWithResult(_0x517d47,null))[_0x468b('0x34')](handleError(_0x517d47,null));};exports[_0x468b('0x3a')]=function(_0xe40c38,_0x39831a){return db[_0x468b('0x20')][_0x468b('0x3a')](_0xe40c38['body'],{})[_0x468b('0x16')](function(_0x425433){var _0x2ed9d6=_0xe40c38[_0x468b('0x3b')][_0x468b('0x14')]({'plain':!![]});if(!_0x2ed9d6)throw new Error(_0x468b('0x3c'));if(_0x2ed9d6[_0x468b('0x3d')]===_0x468b('0x3b')){var _0x1ecfe7=_0x425433[_0x468b('0x14')]({'plain':!![]});var _0x2c0a3c=_0x468b('0x15');return db[_0x468b('0x3e')]['find']({'where':{'name':_0x2c0a3c,'userProfileId':_0x2ed9d6[_0x468b('0x3f')]},'raw':!![]})[_0x468b('0x16')](function(_0x57919d){if(_0x57919d&&_0x57919d[_0x468b('0x40')]===0x0){return db[_0x468b('0x41')][_0x468b('0x3a')]({'name':_0x1ecfe7['name'],'resourceId':_0x1ecfe7['id'],'type':_0x57919d[_0x468b('0x1c')],'sectionId':_0x57919d['id']},{})[_0x468b('0x16')](function(){return _0x425433;});}else{return _0x425433;}})[_0x468b('0x34')](function(_0x57cbd1){logger[_0x468b('0x1a')](_0x468b('0x42'),_0x57cbd1);throw _0x57cbd1;});}return _0x425433;})[_0x468b('0x16')](respondWithResult(_0x39831a,0xc9))[_0x468b('0x34')](handleError(_0x39831a,null));};exports[_0x468b('0x12')]=function(_0x5a9ffe,_0x37d829){if(_0x5a9ffe[_0x468b('0x43')]['id']){delete _0x5a9ffe[_0x468b('0x43')]['id'];}return db[_0x468b('0x20')][_0x468b('0x39')]({'where':{'id':_0x5a9ffe[_0x468b('0x35')]['id']}})[_0x468b('0x16')](handleEntityNotFound(_0x37d829,null))[_0x468b('0x16')](saveUpdates(_0x5a9ffe['body'],null))[_0x468b('0x16')](function(_0x3dffb4){if(!_0x3dffb4)return;var _0x735436=_0x3dffb4[_0x468b('0x14')]({'plain':!![]});return _0x735436;})[_0x468b('0x16')](function(_0x17e2b4){var _0x1b1d48=new Redis(config['redis']);_0x1b1d48['publish'](_0x468b('0x44'),JSON[_0x468b('0x18')](_[_0x468b('0x2e')](_0x17e2b4,['id',_0x468b('0x1c'),_0x468b('0x45')])));return _0x17e2b4;})['then'](respondWithResult(_0x37d829,null))['catch'](handleError(_0x37d829,null));};exports[_0x468b('0x13')]=function(_0x18a120,_0x43cbac){return db[_0x468b('0x20')][_0x468b('0x39')]({'where':{'id':_0x18a120[_0x468b('0x35')]['id']}})[_0x468b('0x16')](handleEntityNotFound(_0x43cbac,null))[_0x468b('0x16')](removeEntity(_0x43cbac,null))[_0x468b('0x34')](handleError(_0x43cbac,null));}; \ No newline at end of file +var _0x7451=['rawAttributes','type','key','model','query','keys','filters','intersection','attributes','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','fields','length','create','body','user','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','../../components/parsers/qs','../../config/logger','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./squareProject.socket','status','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','get','SquareProjects','UserProfileResource','publish','stringify','sendStatus','error','stack','name','index','map','SquareProject'];(function(_0x5d5c4c,_0x46ba9a){var _0x4ced4f=function(_0x3e75f3){while(--_0x3e75f3){_0x5d5c4c['push'](_0x5d5c4c['shift']());}};_0x4ced4f(++_0x46ba9a);}(_0x7451,0xa6));var _0x1745=function(_0x4b55b0,_0x1c5b77){_0x4b55b0=_0x4b55b0-0x0;var _0x3ae0f8=_0x7451[_0x4b55b0];return _0x3ae0f8;};'use strict';var _=require('lodash');var Redis=require('ioredis');var qs=require(_0x1745('0x0'));var logger=require(_0x1745('0x1'))('api');var config=require(_0x1745('0x2'));var db=require(_0x1745('0x3'))['db'];config[_0x1745('0x4')]=_[_0x1745('0x5')](config[_0x1745('0x4')],{'host':_0x1745('0x6'),'port':0x18eb});var socket=require(_0x1745('0x7'))(new Redis(config[_0x1745('0x4')]));require(_0x1745('0x8'))['register'](socket);function respondWithResult(_0x747b41,_0x344337){_0x344337=_0x344337||0xc8;return function(_0x149c15){if(_0x149c15){return _0x747b41[_0x1745('0x9')](_0x344337)[_0x1745('0xa')](_0x149c15);}};}function respondWithFilteredResult(_0x560292,_0x6adeb5){return function(_0x4cae19){if(_0x4cae19){var _0x51cd43=typeof _0x6adeb5[_0x1745('0xb')]===_0x1745('0xc')&&typeof _0x6adeb5[_0x1745('0xd')]==='undefined';var _0x4036c5=_0x4cae19[_0x1745('0xe')];var _0x27a356=_0x51cd43?0x0:_0x6adeb5[_0x1745('0xb')];var _0x638c57=_0x51cd43?_0x4cae19[_0x1745('0xe')]:_0x6adeb5[_0x1745('0xb')]+_0x6adeb5[_0x1745('0xd')];var _0x3b08ce;if(_0x638c57>=_0x4036c5){_0x638c57=_0x4036c5;_0x3b08ce=0xc8;}else{_0x3b08ce=0xce;}_0x560292[_0x1745('0x9')](_0x3b08ce);return _0x560292[_0x1745('0xf')](_0x1745('0x10'),_0x27a356+'-'+_0x638c57+'/'+_0x4036c5)[_0x1745('0xa')](_0x4cae19);}return null;};}function saveUpdates(_0x1c5e92){return function(_0x5878ab){if(_0x5878ab){return _0x5878ab[_0x1745('0x11')](_0x1c5e92)[_0x1745('0x12')](function(_0x427f09){return _0x427f09;});}return null;};}function removeEntity(_0x345c7a){return function(_0x33626f){if(_0x33626f){return _0x33626f[_0x1745('0x13')]()[_0x1745('0x12')](function(){var _0x4b0aac=_0x33626f[_0x1745('0x14')]({'plain':!![]});var _0x3025a4=_0x1745('0x15');return db[_0x1745('0x16')][_0x1745('0x13')]({'where':{'type':_0x3025a4,'resourceId':_0x4b0aac['id']}})[_0x1745('0x12')](function(){return _0x33626f;});})[_0x1745('0x12')](function(){var _0x4e31c0=new Redis(config['redis']);_0x4e31c0[_0x1745('0x17')]('agi',JSON[_0x1745('0x18')]({'id':_0x33626f['id'],'deleted':!![]}));})[_0x1745('0x12')](function(){_0x345c7a['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x88001d){return function(_0x519df9){if(!_0x519df9){_0x88001d[_0x1745('0x19')](0x194);}return _0x519df9;};}function handleError(_0x2008a9,_0x4cbf7b){_0x4cbf7b=_0x4cbf7b||0x1f4;return function(_0x3d76b8){logger[_0x1745('0x1a')](_0x3d76b8[_0x1745('0x1b')]);if(_0x3d76b8[_0x1745('0x1c')]){delete _0x3d76b8['name'];}_0x2008a9['status'](_0x4cbf7b)['send'](_0x3d76b8);};}exports[_0x1745('0x1d')]=function(_0x350892,_0x309bbd){var _0x2f644d={},_0x38491c={},_0x563cdf={'count':0x0,'rows':[]};var _0x4ef6b9=_[_0x1745('0x1e')](db[_0x1745('0x1f')][_0x1745('0x20')],function(_0x1183fa){return{'name':_0x1183fa['fieldName'],'type':_0x1183fa[_0x1745('0x21')][_0x1745('0x22')]};});_0x38491c[_0x1745('0x23')]=_[_0x1745('0x1e')](_0x4ef6b9,_0x1745('0x1c'));_0x38491c[_0x1745('0x24')]=_[_0x1745('0x25')](_0x350892[_0x1745('0x24')]);_0x38491c[_0x1745('0x26')]=_[_0x1745('0x27')](_0x38491c['model'],_0x38491c[_0x1745('0x24')]);_0x2f644d[_0x1745('0x28')]=_['intersection'](_0x38491c[_0x1745('0x23')],qs['fields'](_0x350892[_0x1745('0x24')]['fields']));_0x2f644d[_0x1745('0x28')]=_0x2f644d[_0x1745('0x28')]['length']?_0x2f644d[_0x1745('0x28')]:_0x38491c[_0x1745('0x23')];if(!_0x350892[_0x1745('0x24')][_0x1745('0x29')]('nolimit')){_0x2f644d[_0x1745('0xd')]=qs[_0x1745('0xd')](_0x350892[_0x1745('0x24')][_0x1745('0xd')]);_0x2f644d['offset']=qs[_0x1745('0xb')](_0x350892['query']['offset']);}_0x2f644d[_0x1745('0x2a')]=qs[_0x1745('0x2b')](_0x350892['query'][_0x1745('0x2b')]);_0x2f644d[_0x1745('0x2c')]=qs[_0x1745('0x26')](_[_0x1745('0x2d')](_0x350892[_0x1745('0x24')],_0x38491c[_0x1745('0x26')]),_0x4ef6b9);if(_0x350892['query']['filter']){_0x2f644d[_0x1745('0x2c')]=_[_0x1745('0x2e')](_0x2f644d[_0x1745('0x2c')],{'$or':_['map'](_0x4ef6b9,function(_0xf8fe79){if(_0xf8fe79[_0x1745('0x21')]!==_0x1745('0x2f')){var _0x28f40b={};_0x28f40b[_0xf8fe79['name']]={'$like':'%'+_0x350892[_0x1745('0x24')][_0x1745('0x30')]+'%'};return _0x28f40b;}})});}_0x2f644d=_['merge']({},_0x2f644d,_0x350892[_0x1745('0x31')]);var _0x1c7884={'where':_0x2f644d[_0x1745('0x2c')]};return db[_0x1745('0x1f')][_0x1745('0xe')](_0x1c7884)['then'](function(_0x13641f){_0x563cdf['count']=_0x13641f;if(_0x350892[_0x1745('0x24')][_0x1745('0x32')]){_0x2f644d[_0x1745('0x33')]=[{'all':!![]}];}return db['SquareProject'][_0x1745('0x34')](_0x2f644d);})['then'](function(_0x5b94ab){_0x563cdf[_0x1745('0x35')]=_0x5b94ab;return _0x563cdf;})[_0x1745('0x12')](respondWithFilteredResult(_0x309bbd,_0x2f644d))[_0x1745('0x36')](handleError(_0x309bbd,null));};exports['show']=function(_0x87890a,_0x5c52cd){var _0x4aea83={'raw':![],'where':{'id':_0x87890a['params']['id']}},_0x29ec0f={};_0x29ec0f[_0x1745('0x23')]=_[_0x1745('0x25')](db[_0x1745('0x1f')][_0x1745('0x20')]);_0x29ec0f[_0x1745('0x24')]=_[_0x1745('0x25')](_0x87890a[_0x1745('0x24')]);_0x29ec0f[_0x1745('0x26')]=_['intersection'](_0x29ec0f['model'],_0x29ec0f['query']);_0x4aea83[_0x1745('0x28')]=_[_0x1745('0x27')](_0x29ec0f[_0x1745('0x23')],qs[_0x1745('0x37')](_0x87890a['query'][_0x1745('0x37')]));_0x4aea83[_0x1745('0x28')]=_0x4aea83[_0x1745('0x28')][_0x1745('0x38')]?_0x4aea83['attributes']:_0x29ec0f[_0x1745('0x23')];if(_0x87890a[_0x1745('0x24')][_0x1745('0x32')]){_0x4aea83['include']=[{'all':!![]}];}_0x4aea83=_[_0x1745('0x2e')]({},_0x4aea83,_0x87890a['options']);return db[_0x1745('0x1f')]['find'](_0x4aea83)[_0x1745('0x12')](handleEntityNotFound(_0x5c52cd,null))['then'](respondWithResult(_0x5c52cd,null))[_0x1745('0x36')](handleError(_0x5c52cd,null));};exports[_0x1745('0x39')]=function(_0x7c241,_0xb91c5d){return db['SquareProject'][_0x1745('0x39')](_0x7c241[_0x1745('0x3a')],{})[_0x1745('0x12')](function(_0x402002){var _0x2bfd31=_0x7c241[_0x1745('0x3b')][_0x1745('0x14')]({'plain':!![]});if(!_0x2bfd31)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2bfd31['role']==='user'){var _0x1ff35d=_0x402002[_0x1745('0x14')]({'plain':!![]});var _0x28bf27='SquareProjects';return db[_0x1745('0x3c')][_0x1745('0x3d')]({'where':{'name':_0x28bf27,'userProfileId':_0x2bfd31[_0x1745('0x3e')]},'raw':!![]})['then'](function(_0x30a890){if(_0x30a890&&_0x30a890[_0x1745('0x3f')]===0x0){return db[_0x1745('0x16')]['create']({'name':_0x1ff35d[_0x1745('0x1c')],'resourceId':_0x1ff35d['id'],'type':_0x30a890[_0x1745('0x1c')],'sectionId':_0x30a890['id']},{})[_0x1745('0x12')](function(){return _0x402002;});}else{return _0x402002;}})[_0x1745('0x36')](function(_0x224e8b){logger[_0x1745('0x1a')](_0x1745('0x40'),_0x224e8b);throw _0x224e8b;});}return _0x402002;})[_0x1745('0x12')](respondWithResult(_0xb91c5d,0xc9))[_0x1745('0x36')](handleError(_0xb91c5d,null));};exports[_0x1745('0x11')]=function(_0x2f9e98,_0xd1186a){if(_0x2f9e98[_0x1745('0x3a')]['id']){delete _0x2f9e98['body']['id'];}return db[_0x1745('0x1f')]['find']({'where':{'id':_0x2f9e98[_0x1745('0x41')]['id']}})[_0x1745('0x12')](handleEntityNotFound(_0xd1186a,null))['then'](saveUpdates(_0x2f9e98[_0x1745('0x3a')],null))['then'](function(_0x516a90){if(!_0x516a90)return;var _0xfa257a=_0x516a90[_0x1745('0x14')]({'plain':!![]});return _0xfa257a;})[_0x1745('0x12')](function(_0x3d3810){var _0x3e512f=new Redis(config[_0x1745('0x4')]);_0x3e512f[_0x1745('0x17')]('agi',JSON[_0x1745('0x18')](_[_0x1745('0x2d')](_0x3d3810,['id',_0x1745('0x1c'),'production'])));return _0x3d3810;})[_0x1745('0x12')](respondWithResult(_0xd1186a,null))[_0x1745('0x36')](handleError(_0xd1186a,null));};exports[_0x1745('0x13')]=function(_0x24fbff,_0x1f0fb5){return db[_0x1745('0x1f')][_0x1745('0x3d')]({'where':{'id':_0x24fbff[_0x1745('0x41')]['id']}})[_0x1745('0x12')](handleEntityNotFound(_0x1f0fb5,null))[_0x1745('0x12')](removeEntity(_0x1f0fb5,null))[_0x1745('0x36')](handleError(_0x1f0fb5,null));}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.events.js b/server/api/squareProject/squareProject.events.js index 6270cef..868bbd3 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 _0xbff8=['update','remove','emit','hasOwnProperty','exports','events','../../mysqldb','SquareProject','setMaxListeners'];(function(_0x3a88f3,_0x49b51e){var _0x5026e1=function(_0xa74f8f){while(--_0xa74f8f){_0x3a88f3['push'](_0x3a88f3['shift']());}};_0x5026e1(++_0x49b51e);}(_0xbff8,0xd4));var _0x8bff=function(_0x2554d3,_0x528f9b){_0x2554d3=_0x2554d3-0x0;var _0x580fae=_0xbff8[_0x2554d3];return _0x580fae;};'use strict';var EventEmitter=require(_0x8bff('0x0'));var SquareProject=require(_0x8bff('0x1'))['db'][_0x8bff('0x2')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0x8bff('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x8bff('0x4'),'afterDestroy':_0x8bff('0x5')};function emitEvent(_0x779700){return function(_0x43003b,_0x2ea593,_0x3dcf0b){SquareProjectEvents[_0x8bff('0x6')](_0x779700+':'+_0x43003b['id'],_0x43003b);SquareProjectEvents[_0x8bff('0x6')](_0x779700,_0x43003b);_0x3dcf0b(null);};}for(var e in events){if(events[_0x8bff('0x7')](e)){var event=events[e];SquareProject['hook'](e,emitEvent(event));}}module[_0x8bff('0x8')]=SquareProjectEvents; \ No newline at end of file +var _0xfa7c=['update','remove','emit','hasOwnProperty','hook','events','../../mysqldb','SquareProject','setMaxListeners','save'];(function(_0x2b9e94,_0x4f33c7){var _0x1ad1f7=function(_0x3fb202){while(--_0x3fb202){_0x2b9e94['push'](_0x2b9e94['shift']());}};_0x1ad1f7(++_0x4f33c7);}(_0xfa7c,0x195));var _0xcfa7=function(_0x2bddd2,_0x2143c3){_0x2bddd2=_0x2bddd2-0x0;var _0x2825ae=_0xfa7c[_0x2bddd2];return _0x2825ae;};'use strict';var EventEmitter=require(_0xcfa7('0x0'));var SquareProject=require(_0xcfa7('0x1'))['db'][_0xcfa7('0x2')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0xcfa7('0x3')](0x0);var events={'afterCreate':_0xcfa7('0x4'),'afterUpdate':_0xcfa7('0x5'),'afterDestroy':_0xcfa7('0x6')};function emitEvent(_0x157405){return function(_0x111664,_0x54134a,_0x29946b){SquareProjectEvents[_0xcfa7('0x7')](_0x157405+':'+_0x111664['id'],_0x111664);SquareProjectEvents[_0xcfa7('0x7')](_0x157405,_0x111664);_0x29946b(null);};}for(var e in events){if(events[_0xcfa7('0x8')](e)){var event=events[e];SquareProject[_0xcfa7('0x9')](e,emitEvent(event));}}module['exports']=SquareProjectEvents; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.model.js b/server/api/squareProject/squareProject.model.js index c7b7891..99956a7 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 _0xc26e=['production','format','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','square_projects','changed','preproduction','savedAt','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x553b3e,_0x2fd9da){var _0x2e3cdc=function(_0x2e79ea){while(--_0x2e79ea){_0x553b3e['push'](_0x553b3e['shift']());}};_0x2e3cdc(++_0x2fd9da);}(_0xc26e,0x1a0));var _0xec26=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc26e[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xec26('0x0'));var util=require('util');var logger=require(_0xec26('0x1'))(_0xec26('0x2'));var moment=require(_0xec26('0x3'));var BPromise=require(_0xec26('0x4'));var rp=require(_0xec26('0x5'));var fs=require('fs');var path=require(_0xec26('0x6'));var rimraf=require(_0xec26('0x7'));var config=require(_0xec26('0x8'));var attributes=require('./squareProject.attributes');module[_0xec26('0x9')]=function(_0x22d84a,_0x4c2590){return _0x22d84a[_0xec26('0xa')]('SquareProject',attributes,{'tableName':_0xec26('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x3bfca5,_0x1717e4,_0x1c1b2c){if(_0x3bfca5[_0xec26('0xc')](_0xec26('0xd'))){_0x3bfca5[_0xec26('0xe')]=moment()['format'](_0xec26('0xf'));}if(_0x3bfca5[_0xec26('0xc')](_0xec26('0x10'))){_0x3bfca5['publishedAt']=moment()[_0xec26('0x11')]('YYYY-MM-DD\x20HH:mm:ss');}_0x1c1b2c(null,_0x3bfca5);}}});}; \ No newline at end of file +var _0x1203=['../../config/environment','define','SquareProject','changed','preproduction','savedAt','format','YYYY-MM-DD\x20HH:mm:ss','production','publishedAt','lodash','util','api','bluebird','request-promise'];(function(_0x178e48,_0x3c9509){var _0x440d7e=function(_0xc2f8a0){while(--_0xc2f8a0){_0x178e48['push'](_0x178e48['shift']());}};_0x440d7e(++_0x3c9509);}(_0x1203,0x163));var _0x3120=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x1203[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x3120('0x0'));var util=require(_0x3120('0x1'));var logger=require('../../config/logger')(_0x3120('0x2'));var moment=require('moment');var BPromise=require(_0x3120('0x3'));var rp=require(_0x3120('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x3120('0x5'));var attributes=require('./squareProject.attributes');module['exports']=function(_0x52a8d2,_0x147c94){return _0x52a8d2[_0x3120('0x6')](_0x3120('0x7'),attributes,{'tableName':'square_projects','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x17a802,_0x170114,_0x338b95){if(_0x17a802[_0x3120('0x8')](_0x3120('0x9'))){_0x17a802[_0x3120('0xa')]=moment()[_0x3120('0xb')](_0x3120('0xc'));}if(_0x17a802[_0x3120('0x8')](_0x3120('0xd'))){_0x17a802[_0x3120('0xe')]=moment()[_0x3120('0xb')](_0x3120('0xc'));}_0x338b95(null,_0x17a802);}}});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.rpc.js b/server/api/squareProject/squareProject.rpc.js index daf2cd3..f41ac73 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 _0xe989=['ShowSquareProject','find','lodash','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','redis','defaults','socket.io-emitter','./squareProject.socket','register','SquareProject','findAll','options','where','attributes','include','map','model','then','info','GetSquareProjects','debug','stringify','catch','error','message'];(function(_0x1a36a5,_0x746928){var _0x746243=function(_0x481966){while(--_0x481966){_0x1a36a5['push'](_0x1a36a5['shift']());}};_0x746243(++_0x746928);}(_0xe989,0x198));var _0x9e98=function(_0x29c768,_0x56446f){_0x29c768=_0x29c768-0x0;var _0x19fcdb=_0xe989[_0x29c768];return _0x19fcdb;};'use strict';var _=require(_0x9e98('0x0'));var Redis=require(_0x9e98('0x1'));var db=require(_0x9e98('0x2'))['db'];var logger=require(_0x9e98('0x3'))(_0x9e98('0x4'));var config=require(_0x9e98('0x5'));config[_0x9e98('0x6')]=_[_0x9e98('0x7')](config[_0x9e98('0x6')],{'host':'localhost','port':0x18eb});var socket=require(_0x9e98('0x8'))(new Redis(config['redis']));require(_0x9e98('0x9'))[_0x9e98('0xa')](socket);exports['GetSquareProjects']=function(_0x145431){var _0x33fa87=this;return new Promise(function(_0x27b057,_0x519882){return db[_0x9e98('0xb')][_0x9e98('0xc')]({'raw':_0x145431['options']?_0x145431['options']['raw']===undefined?!![]:![]:!![],'where':_0x145431[_0x9e98('0xd')]?_0x145431[_0x9e98('0xd')][_0x9e98('0xe')]||null:null,'attributes':_0x145431[_0x9e98('0xd')]?_0x145431['options'][_0x9e98('0xf')]||null:null,'limit':_0x145431[_0x9e98('0xd')]?_0x145431[_0x9e98('0xd')]['limit']||null:null,'include':_0x145431[_0x9e98('0xd')]?_0x145431[_0x9e98('0xd')]['include']?_['map'](_0x145431['options']['include'],function(_0xe56b4b){return{'model':db[_0xe56b4b['model']],'as':_0xe56b4b['as'],'attributes':_0xe56b4b[_0x9e98('0xf')],'include':_0xe56b4b[_0x9e98('0x10')]?_[_0x9e98('0x11')](_0xe56b4b[_0x9e98('0x10')],function(_0x1a7c51){return{'model':db[_0x1a7c51[_0x9e98('0x12')]],'as':_0x1a7c51['as'],'attributes':_0x1a7c51[_0x9e98('0xf')],'include':_0x1a7c51['include']?_[_0x9e98('0x11')](_0x1a7c51[_0x9e98('0x10')],function(_0x28d1cb){return{'model':db[_0x28d1cb['model']],'as':_0x28d1cb['as'],'attributes':_0x28d1cb['attributes']};}):[]};}):[]};}):[]:[]})[_0x9e98('0x13')](function(_0x351af8){logger[_0x9e98('0x14')](_0x9e98('0x15'),_0x145431);logger[_0x9e98('0x16')](_0x9e98('0x15'),_0x145431,JSON[_0x9e98('0x17')](_0x351af8));_0x27b057(_0x351af8);})[_0x9e98('0x18')](function(_0x4c6e34){logger[_0x9e98('0x19')](_0x9e98('0x15'),_0x4c6e34[_0x9e98('0x1a')],_0x145431);_0x519882(_0x33fa87['error'](0x1f4,_0x4c6e34[_0x9e98('0x1a')]));});});};exports[_0x9e98('0x1b')]=function(_0x2439f8){var _0x279e99=this;return new Promise(function(_0x1f9083,_0x146fae){return db[_0x9e98('0xb')][_0x9e98('0x1c')]({'raw':_0x2439f8[_0x9e98('0xd')]?_0x2439f8['options']['raw']===undefined?!![]:![]:!![],'where':_0x2439f8[_0x9e98('0xd')]?_0x2439f8[_0x9e98('0xd')][_0x9e98('0xe')]||null:null,'attributes':_0x2439f8['options']?_0x2439f8['options'][_0x9e98('0xf')]||null:null,'include':_0x2439f8[_0x9e98('0xd')]?_0x2439f8['options'][_0x9e98('0x10')]?_[_0x9e98('0x11')](_0x2439f8[_0x9e98('0xd')]['include'],function(_0x7d3a40){return{'model':db[_0x7d3a40['model']],'as':_0x7d3a40['as'],'attributes':_0x7d3a40[_0x9e98('0xf')],'include':_0x7d3a40[_0x9e98('0x10')]?_[_0x9e98('0x11')](_0x7d3a40[_0x9e98('0x10')],function(_0x3fc015){return{'model':db[_0x3fc015[_0x9e98('0x12')]],'as':_0x3fc015['as'],'attributes':_0x3fc015[_0x9e98('0xf')],'include':_0x3fc015[_0x9e98('0x10')]?_['map'](_0x3fc015[_0x9e98('0x10')],function(_0xfc3db3){return{'model':db[_0xfc3db3[_0x9e98('0x12')]],'as':_0xfc3db3['as'],'attributes':_0xfc3db3[_0x9e98('0xf')]};}):[]};}):[]};}):[]:[]})[_0x9e98('0x13')](function(_0x2c43fe){logger['info'](_0x9e98('0x1b'),_0x2439f8);logger[_0x9e98('0x16')](_0x9e98('0x1b'),_0x2439f8,JSON[_0x9e98('0x17')](_0x2c43fe));_0x1f9083(_0x2c43fe);})[_0x9e98('0x18')](function(_0x5f4053){logger[_0x9e98('0x19')](_0x9e98('0x1b'),_0x5f4053[_0x9e98('0x1a')],_0x2439f8);_0x146fae(_0x279e99[_0x9e98('0x19')](0x1f4,_0x5f4053[_0x9e98('0x1a')]));});});}; \ No newline at end of file +var _0xa0be=['attributes','limit','include','map','model','then','info','GetSquareProjects','debug','stringify','catch','message','ShowSquareProject','find','error','lodash','ioredis','rpc','redis','defaults','localhost','socket.io-emitter','./squareProject.socket','register','SquareProject','options','raw','where'];(function(_0x21c6b8,_0x16d6f6){var _0x39d474=function(_0x27dbf5){while(--_0x27dbf5){_0x21c6b8['push'](_0x21c6b8['shift']());}};_0x39d474(++_0x16d6f6);}(_0xa0be,0x127));var _0xea0b=function(_0x26946d,_0x3a3463){_0x26946d=_0x26946d-0x0;var _0x252a8d=_0xa0be[_0x26946d];return _0x252a8d;};'use strict';var _=require(_0xea0b('0x0'));var Redis=require(_0xea0b('0x1'));var db=require('../../mysqldb')['db'];var logger=require('../../config/logger')(_0xea0b('0x2'));var config=require('../../config/environment');config[_0xea0b('0x3')]=_[_0xea0b('0x4')](config[_0xea0b('0x3')],{'host':_0xea0b('0x5'),'port':0x18eb});var socket=require(_0xea0b('0x6'))(new Redis(config[_0xea0b('0x3')]));require(_0xea0b('0x7'))[_0xea0b('0x8')](socket);exports['GetSquareProjects']=function(_0x1bd482){var _0x328a57=this;return new Promise(function(_0x42e9e0,_0x94cd1b){return db[_0xea0b('0x9')]['findAll']({'raw':_0x1bd482[_0xea0b('0xa')]?_0x1bd482[_0xea0b('0xa')][_0xea0b('0xb')]===undefined?!![]:![]:!![],'where':_0x1bd482[_0xea0b('0xa')]?_0x1bd482[_0xea0b('0xa')][_0xea0b('0xc')]||null:null,'attributes':_0x1bd482[_0xea0b('0xa')]?_0x1bd482[_0xea0b('0xa')][_0xea0b('0xd')]||null:null,'limit':_0x1bd482['options']?_0x1bd482[_0xea0b('0xa')][_0xea0b('0xe')]||null:null,'include':_0x1bd482[_0xea0b('0xa')]?_0x1bd482['options'][_0xea0b('0xf')]?_[_0xea0b('0x10')](_0x1bd482[_0xea0b('0xa')][_0xea0b('0xf')],function(_0x2f0dda){return{'model':db[_0x2f0dda[_0xea0b('0x11')]],'as':_0x2f0dda['as'],'attributes':_0x2f0dda[_0xea0b('0xd')],'include':_0x2f0dda['include']?_[_0xea0b('0x10')](_0x2f0dda[_0xea0b('0xf')],function(_0x3d612c){return{'model':db[_0x3d612c[_0xea0b('0x11')]],'as':_0x3d612c['as'],'attributes':_0x3d612c[_0xea0b('0xd')],'include':_0x3d612c[_0xea0b('0xf')]?_[_0xea0b('0x10')](_0x3d612c[_0xea0b('0xf')],function(_0x39e010){return{'model':db[_0x39e010[_0xea0b('0x11')]],'as':_0x39e010['as'],'attributes':_0x39e010[_0xea0b('0xd')]};}):[]};}):[]};}):[]:[]})[_0xea0b('0x12')](function(_0xf1fbd7){logger[_0xea0b('0x13')](_0xea0b('0x14'),_0x1bd482);logger[_0xea0b('0x15')](_0xea0b('0x14'),_0x1bd482,JSON[_0xea0b('0x16')](_0xf1fbd7));_0x42e9e0(_0xf1fbd7);})[_0xea0b('0x17')](function(_0x110cc0){logger['error'](_0xea0b('0x14'),_0x110cc0[_0xea0b('0x18')],_0x1bd482);_0x94cd1b(_0x328a57['error'](0x1f4,_0x110cc0[_0xea0b('0x18')]));});});};exports[_0xea0b('0x19')]=function(_0x20e9dc){var _0x502919=this;return new Promise(function(_0x13276e,_0x21484e){return db[_0xea0b('0x9')][_0xea0b('0x1a')]({'raw':_0x20e9dc[_0xea0b('0xa')]?_0x20e9dc[_0xea0b('0xa')][_0xea0b('0xb')]===undefined?!![]:![]:!![],'where':_0x20e9dc[_0xea0b('0xa')]?_0x20e9dc['options'][_0xea0b('0xc')]||null:null,'attributes':_0x20e9dc[_0xea0b('0xa')]?_0x20e9dc[_0xea0b('0xa')]['attributes']||null:null,'include':_0x20e9dc[_0xea0b('0xa')]?_0x20e9dc['options'][_0xea0b('0xf')]?_['map'](_0x20e9dc[_0xea0b('0xa')][_0xea0b('0xf')],function(_0x107ce6){return{'model':db[_0x107ce6[_0xea0b('0x11')]],'as':_0x107ce6['as'],'attributes':_0x107ce6[_0xea0b('0xd')],'include':_0x107ce6[_0xea0b('0xf')]?_[_0xea0b('0x10')](_0x107ce6['include'],function(_0x53f81b){return{'model':db[_0x53f81b[_0xea0b('0x11')]],'as':_0x53f81b['as'],'attributes':_0x53f81b[_0xea0b('0xd')],'include':_0x53f81b['include']?_['map'](_0x53f81b[_0xea0b('0xf')],function(_0x455ba9){return{'model':db[_0x455ba9['model']],'as':_0x455ba9['as'],'attributes':_0x455ba9[_0xea0b('0xd')]};}):[]};}):[]};}):[]:[]})[_0xea0b('0x12')](function(_0x5e0039){logger['info'](_0xea0b('0x19'),_0x20e9dc);logger[_0xea0b('0x15')](_0xea0b('0x19'),_0x20e9dc,JSON['stringify'](_0x5e0039));_0x13276e(_0x5e0039);})[_0xea0b('0x17')](function(_0x51a19e){logger[_0xea0b('0x1b')](_0xea0b('0x19'),_0x51a19e['message'],_0x20e9dc);_0x21484e(_0x502919[_0xea0b('0x1b')](0x1f4,_0x51a19e['message']));});});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.socket.js b/server/api/squareProject/squareProject.socket.js index 5a7e0ec..b5b89d3 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 _0x763f=['update','emit','removeListener','length','squareProject:','./squareProject.events','remove'];(function(_0x5f415d,_0x39b258){var _0x3ac7a6=function(_0x314dc5){while(--_0x314dc5){_0x5f415d['push'](_0x5f415d['shift']());}};_0x3ac7a6(++_0x39b258);}(_0x763f,0x67));var _0xf763=function(_0x104c93,_0x45de84){_0x104c93=_0x104c93-0x0;var _0x41c9a3=_0x763f[_0x104c93];return _0x41c9a3;};'use strict';var SquareProjectEvents=require(_0xf763('0x0'));var events=['save',_0xf763('0x1'),_0xf763('0x2')];function createListener(_0x103314,_0x494cda){return function(_0x362f83){_0x494cda[_0xf763('0x3')](_0x103314,_0x362f83);};}function removeListener(_0x556f70,_0xc4fd20){return function(){SquareProjectEvents[_0xf763('0x4')](_0x556f70,_0xc4fd20);};}exports['register']=function(_0x41fc37){for(var _0x5df061=0x0,_0x3a6b9d=events[_0xf763('0x5')];_0x5df061<_0x3a6b9d;_0x5df061++){var _0x584d27=events[_0x5df061];var _0x513ff9=createListener(_0xf763('0x6')+_0x584d27,_0x41fc37);SquareProjectEvents['on'](_0x584d27,_0x513ff9);}}; \ No newline at end of file +var _0x373e=['update','removeListener','length','squareProject:','./squareProject.events','save','remove'];(function(_0x3aaa11,_0x393de6){var _0x422926=function(_0x551cac){while(--_0x551cac){_0x3aaa11['push'](_0x3aaa11['shift']());}};_0x422926(++_0x393de6);}(_0x373e,0x1a8));var _0xe373=function(_0x47694c,_0x4c77e6){_0x47694c=_0x47694c-0x0;var _0x147671=_0x373e[_0x47694c];return _0x147671;};'use strict';var SquareProjectEvents=require(_0xe373('0x0'));var events=[_0xe373('0x1'),_0xe373('0x2'),_0xe373('0x3')];function createListener(_0x56c6ec,_0x3ee36a){return function(_0x401da9){_0x3ee36a['emit'](_0x56c6ec,_0x401da9);};}function removeListener(_0x477620,_0x5b91ce){return function(){SquareProjectEvents[_0xe373('0x4')](_0x477620,_0x5b91ce);};}exports['register']=function(_0x2fe8d8){for(var _0x38af4f=0x0,_0x3ee53d=events[_0xe373('0x5')];_0x38af4f<_0x3ee53d;_0x38af4f++){var _0x31edb7=events[_0x38af4f];var _0x2ffb32=createListener(_0xe373('0x6')+_0x31edb7,_0x2fe8d8);SquareProjectEvents['on'](_0x31edb7,_0x2ffb32);}}; \ No newline at end of file diff --git a/server/api/squareRecording/index.js b/server/api/squareRecording/index.js index b6e1c88..8c1d203 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 _0xabce=['util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','get','show','download','post','create','put','/:id','update','delete','destroy','exports','multer'];(function(_0x38f586,_0x4d338b){var _0x1eb5bb=function(_0x20c97c){while(--_0x20c97c){_0x38f586['push'](_0x38f586['shift']());}};_0x1eb5bb(++_0x4d338b);}(_0xabce,0x103));var _0xeabc=function(_0x481bf7,_0x437f69){_0x481bf7=_0x481bf7-0x0;var _0x461787=_0xabce[_0x481bf7];return _0x461787;};'use strict';var multer=require(_0xeabc('0x0'));var util=require(_0xeabc('0x1'));var path=require(_0xeabc('0x2'));var timeout=require(_0xeabc('0x3'));var express=require(_0xeabc('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xeabc('0x5'));var interaction=require(_0xeabc('0x6'));var config=require(_0xeabc('0x7'));var controller=require('./squareRecording.controller');router['get']('/',auth[_0xeabc('0x8')](),controller['index']);router[_0xeabc('0x9')]('/:id',auth[_0xeabc('0x8')](),controller[_0xeabc('0xa')]);router[_0xeabc('0x9')]('/:id/download',auth[_0xeabc('0x8')](),controller[_0xeabc('0xb')]);router[_0xeabc('0xc')]('/',auth[_0xeabc('0x8')](),controller[_0xeabc('0xd')]);router[_0xeabc('0xe')](_0xeabc('0xf'),auth[_0xeabc('0x8')](),controller[_0xeabc('0x10')]);router[_0xeabc('0x11')](_0xeabc('0xf'),auth[_0xeabc('0x8')](),controller[_0xeabc('0x12')]);module[_0xeabc('0x13')]=router; \ No newline at end of file +var _0x5fc3=['express','Router','fs-extra','../../components/auth/service','../../config/environment','./squareRecording.controller','get','isAuthenticated','show','/:id/download','download','post','create','put','update','/:id','multer','util','connect-timeout'];(function(_0x5c97a3,_0x5a5f4b){var _0x357f22=function(_0x40fd18){while(--_0x40fd18){_0x5c97a3['push'](_0x5c97a3['shift']());}};_0x357f22(++_0x5a5f4b);}(_0x5fc3,0xa8));var _0x35fc=function(_0x37c07d,_0xdbdb5f){_0x37c07d=_0x37c07d-0x0;var _0x10dadc=_0x5fc3[_0x37c07d];return _0x10dadc;};'use strict';var multer=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var path=require('path');var timeout=require(_0x35fc('0x2'));var express=require(_0x35fc('0x3'));var router=express[_0x35fc('0x4')]();var fs_extra=require(_0x35fc('0x5'));var auth=require(_0x35fc('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x35fc('0x7'));var controller=require(_0x35fc('0x8'));router[_0x35fc('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x35fc('0x9')]('/:id',auth[_0x35fc('0xa')](),controller[_0x35fc('0xb')]);router[_0x35fc('0x9')](_0x35fc('0xc'),auth[_0x35fc('0xa')](),controller[_0x35fc('0xd')]);router[_0x35fc('0xe')]('/',auth['isAuthenticated'](),controller[_0x35fc('0xf')]);router[_0x35fc('0x10')]('/:id',auth[_0x35fc('0xa')](),controller[_0x35fc('0x11')]);router['delete'](_0x35fc('0x12'),auth[_0x35fc('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.attributes.js b/server/api/squareRecording/squareRecording.attributes.js index 735c9f7..fc0d7f8 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 _0x038b=['lastIndexOf','exports','STRING','VIRTUAL','substring'];(function(_0x2ce683,_0x15d13a){var _0x30ee93=function(_0x5176bc){while(--_0x5176bc){_0x2ce683['push'](_0x2ce683['shift']());}};_0x30ee93(++_0x15d13a);}(_0x038b,0x114));var _0xb038=function(_0x2578f6,_0x56a5ee){_0x2578f6=_0x2578f6-0x0;var _0x46a132=_0x038b[_0x2578f6];return _0x46a132;};'use strict';var Sequelize=require('sequelize');module[_0xb038('0x0')]={'uniqueid':{'type':Sequelize[_0xb038('0x1')]},'callerid':{'type':Sequelize[_0xb038('0x1')]},'calleridname':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0xb038('0x1')]},'extension':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0xb038('0x1')]},'accountcode':{'type':Sequelize[_0xb038('0x1')]},'dnid':{'type':Sequelize['STRING']},'projectName':{'type':Sequelize[_0xb038('0x1')]},'saveName':{'type':Sequelize[_0xb038('0x1')]},'filename':{'type':Sequelize['STRING']},'savePath':{'type':Sequelize['STRING']},'format':{'type':Sequelize[_0xb038('0x2')],'get':function(){var _0x1b077a='';var _0x1534a9=this['getDataValue']('savePath');if(_0x1534a9){_0x1b077a=_0x1534a9[_0xb038('0x3')](_0x1534a9[_0xb038('0x4')]('.'));}return _0x1b077a;}}}; \ No newline at end of file +var _0x9957=['sequelize','exports','STRING','VIRTUAL','getDataValue','savePath','lastIndexOf'];(function(_0x5cf960,_0x1f4995){var _0x5dbd7a=function(_0x13d26f){while(--_0x13d26f){_0x5cf960['push'](_0x5cf960['shift']());}};_0x5dbd7a(++_0x1f4995);}(_0x9957,0x93));var _0x7995=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x9957[_0x501510];return _0x1e6ee5;};'use strict';var Sequelize=require(_0x7995('0x0'));module[_0x7995('0x1')]={'uniqueid':{'type':Sequelize[_0x7995('0x2')]},'callerid':{'type':Sequelize[_0x7995('0x2')]},'calleridname':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x7995('0x2')]},'extension':{'type':Sequelize[_0x7995('0x2')]},'priority':{'type':Sequelize[_0x7995('0x2')]},'accountcode':{'type':Sequelize[_0x7995('0x2')]},'dnid':{'type':Sequelize['STRING']},'projectName':{'type':Sequelize[_0x7995('0x2')]},'saveName':{'type':Sequelize[_0x7995('0x2')]},'filename':{'type':Sequelize[_0x7995('0x2')]},'savePath':{'type':Sequelize[_0x7995('0x2')]},'format':{'type':Sequelize[_0x7995('0x3')],'get':function(){var _0x326741='';var _0x4996ca=this[_0x7995('0x4')](_0x7995('0x5'));if(_0x4996ca){_0x326741=_0x4996ca['substring'](_0x4996ca[_0x7995('0x6')]('.'));}return _0x326741;}}}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.controller.js b/server/api/squareRecording/squareRecording.controller.js index 13a925f..63c8dd6 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 _0x84b7=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','end','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','destroy','then','sendStatus','error','stack','name','send','index','map','rawAttributes','key','model','keys','query','intersection','fields','attributes','nolimit','order','sort','where','filters','pick','merge','type','VIRTUAL','filter','options','SquareRecording','include','rows','catch','show','length','includeAll','body','find','download','../../components/encryptor','uniqueid','params','savePath','filename','format','%s.cypher','existsSync','decryptFile','recording','Sequelize','ValidationError','SquareRecording\x20not\x20found','unlink','message','Not\x20found','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','isNil','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','papaparse','../../components/auth/service'];(function(_0x3a3add,_0x5589b3){var _0x532b6a=function(_0x4eebcd){while(--_0x4eebcd){_0x3a3add['push'](_0x3a3add['shift']());}};_0x532b6a(++_0x5589b3);}(_0x84b7,0xaf));var _0x784b=function(_0x2bf466,_0x4929a5){_0x2bf466=_0x2bf466-0x0;var _0x856885=_0x84b7[_0x2bf466];return _0x856885;};'use strict';var emlformat=require(_0x784b('0x0'));var rimraf=require(_0x784b('0x1'));var zipdir=require(_0x784b('0x2'));var jsonpatch=require(_0x784b('0x3'));var rp=require(_0x784b('0x4'));var moment=require(_0x784b('0x5'));var BPromise=require(_0x784b('0x6'));var Mustache=require('mustache');var util=require(_0x784b('0x7'));var path=require('path');var sox=require(_0x784b('0x8'));var csv=require(_0x784b('0x9'));var ejs=require(_0x784b('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x784b('0xb'));var squel=require(_0x784b('0xc'));var crypto=require(_0x784b('0xd'));var jsforce=require(_0x784b('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x784b('0x9'));var querystring=require('querystring');var Papa=require(_0x784b('0xf'));var Redis=require('ioredis');var authService=require(_0x784b('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x784b('0x11'));var hardwareService=require(_0x784b('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0x784b('0x13'));var config=require(_0x784b('0x14'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5b75cd,_0x30b8ca){_0x30b8ca=_0x30b8ca||0xcc;return function(_0x3d7142){if(_0x3d7142){return _0x5b75cd['sendStatus'](_0x30b8ca);}return _0x5b75cd['status'](_0x30b8ca)[_0x784b('0x15')]();};}function respondWithResult(_0x344997,_0x476610){_0x476610=_0x476610||0xc8;return function(_0x25c576){if(_0x25c576){return _0x344997[_0x784b('0x16')](_0x476610)[_0x784b('0x17')](_0x25c576);}};}function respondWithFilteredResult(_0x17638f,_0x310373){return function(_0x6f10de){if(_0x6f10de){var _0x28effb=typeof _0x310373[_0x784b('0x18')]==='undefined'&&typeof _0x310373[_0x784b('0x19')]===_0x784b('0x1a');var _0x448588=_0x6f10de[_0x784b('0x1b')];var _0x11d93b=_0x28effb?0x0:_0x310373[_0x784b('0x18')];var _0x7cc739=_0x28effb?_0x6f10de['count']:_0x310373['offset']+_0x310373['limit'];var _0x410309;if(_0x7cc739>=_0x448588){_0x7cc739=_0x448588;_0x410309=0xc8;}else{_0x410309=0xce;}_0x17638f[_0x784b('0x16')](_0x410309);return _0x17638f[_0x784b('0x1c')](_0x784b('0x1d'),_0x11d93b+'-'+_0x7cc739+'/'+_0x448588)['json'](_0x6f10de);}return null;};}function patchUpdates(_0xd36201){return function(_0x470959){try{jsonpatch[_0x784b('0x1e')](_0x470959,_0xd36201,!![]);}catch(_0x515fc3){return BPromise[_0x784b('0x1f')](_0x515fc3);}return _0x470959[_0x784b('0x20')]();};}function saveUpdates(_0x239dbe,_0x56e371){return function(_0x11afd1){if(_0x11afd1){return _0x11afd1[_0x784b('0x21')](_0x239dbe)['then'](function(_0x3e902a){return _0x3e902a;});}return null;};}function removeEntity(_0x2f3ea6,_0x49f0c3){return function(_0x326174){if(_0x326174){return _0x326174[_0x784b('0x22')]()[_0x784b('0x23')](function(){_0x2f3ea6[_0x784b('0x16')](0xcc)[_0x784b('0x15')]();});}};}function handleEntityNotFound(_0x1dfbeb,_0x52d216){return function(_0x1106a1){if(!_0x1106a1){_0x1dfbeb[_0x784b('0x24')](0x194);}return _0x1106a1;};}function handleError(_0x4629da,_0x1b15b1){_0x1b15b1=_0x1b15b1||0x1f4;return function(_0x119a4b){logger[_0x784b('0x25')](_0x119a4b[_0x784b('0x26')]);if(_0x119a4b[_0x784b('0x27')]){delete _0x119a4b['name'];}_0x4629da[_0x784b('0x16')](_0x1b15b1)[_0x784b('0x28')](_0x119a4b);};}exports[_0x784b('0x29')]=function(_0xc5da2e,_0x99a7f){var _0x3288b4={},_0x1eafbc={},_0x537d80={'count':0x0,'rows':[]};var _0x26f209=_[_0x784b('0x2a')](db['SquareRecording'][_0x784b('0x2b')],function(_0x3eb125){return{'name':_0x3eb125['fieldName'],'type':_0x3eb125['type'][_0x784b('0x2c')]};});_0x1eafbc[_0x784b('0x2d')]=_[_0x784b('0x2a')](_0x26f209,_0x784b('0x27'));_0x1eafbc['query']=_[_0x784b('0x2e')](_0xc5da2e[_0x784b('0x2f')]);_0x1eafbc['filters']=_[_0x784b('0x30')](_0x1eafbc[_0x784b('0x2d')],_0x1eafbc[_0x784b('0x2f')]);_0x3288b4['attributes']=_[_0x784b('0x30')](_0x1eafbc[_0x784b('0x2d')],qs[_0x784b('0x31')](_0xc5da2e['query'][_0x784b('0x31')]));_0x3288b4['attributes']=_0x3288b4['attributes']['length']?_0x3288b4[_0x784b('0x32')]:_0x1eafbc[_0x784b('0x2d')];if(!_0xc5da2e['query']['hasOwnProperty'](_0x784b('0x33'))){_0x3288b4[_0x784b('0x19')]=qs['limit'](_0xc5da2e['query'][_0x784b('0x19')]);_0x3288b4['offset']=qs[_0x784b('0x18')](_0xc5da2e[_0x784b('0x2f')][_0x784b('0x18')]);}_0x3288b4[_0x784b('0x34')]=qs[_0x784b('0x35')](_0xc5da2e[_0x784b('0x2f')]['sort']);_0x3288b4[_0x784b('0x36')]=qs[_0x784b('0x37')](_[_0x784b('0x38')](_0xc5da2e[_0x784b('0x2f')],_0x1eafbc['filters']),_0x26f209);if(_0xc5da2e[_0x784b('0x2f')]['filter']){_0x3288b4[_0x784b('0x36')]=_[_0x784b('0x39')](_0x3288b4['where'],{'$or':_[_0x784b('0x2a')](_0x26f209,function(_0x5ac426){if(_0x5ac426[_0x784b('0x3a')]!==_0x784b('0x3b')){var _0x50e276={};_0x50e276[_0x5ac426['name']]={'$like':'%'+_0xc5da2e[_0x784b('0x2f')][_0x784b('0x3c')]+'%'};return _0x50e276;}})});}_0x3288b4=_[_0x784b('0x39')]({},_0x3288b4,_0xc5da2e[_0x784b('0x3d')]);var _0x444d08={'where':_0x3288b4[_0x784b('0x36')]};return db[_0x784b('0x3e')]['count'](_0x444d08)['then'](function(_0x1bb022){_0x537d80[_0x784b('0x1b')]=_0x1bb022;if(_0xc5da2e[_0x784b('0x2f')]['includeAll']){_0x3288b4[_0x784b('0x3f')]=[{'all':!![]}];}return db[_0x784b('0x3e')]['findAll'](_0x3288b4);})[_0x784b('0x23')](function(_0x32af65){_0x537d80[_0x784b('0x40')]=_0x32af65;return _0x537d80;})[_0x784b('0x23')](respondWithFilteredResult(_0x99a7f,_0x3288b4))[_0x784b('0x41')](handleError(_0x99a7f,null));};exports[_0x784b('0x42')]=function(_0x2d60a7,_0x48a45f){var _0x144f06={'raw':!![],'where':{'id':_0x2d60a7['params']['id']}},_0xbcd66e={};_0xbcd66e[_0x784b('0x2d')]=_['keys'](db[_0x784b('0x3e')][_0x784b('0x2b')]);_0xbcd66e[_0x784b('0x2f')]=_[_0x784b('0x2e')](_0x2d60a7[_0x784b('0x2f')]);_0xbcd66e[_0x784b('0x37')]=_['intersection'](_0xbcd66e[_0x784b('0x2d')],_0xbcd66e[_0x784b('0x2f')]);_0x144f06[_0x784b('0x32')]=_[_0x784b('0x30')](_0xbcd66e[_0x784b('0x2d')],qs[_0x784b('0x31')](_0x2d60a7['query']['fields']));_0x144f06[_0x784b('0x32')]=_0x144f06['attributes'][_0x784b('0x43')]?_0x144f06['attributes']:_0xbcd66e[_0x784b('0x2d')];if(_0x2d60a7[_0x784b('0x2f')][_0x784b('0x44')]){_0x144f06[_0x784b('0x3f')]=[{'all':!![]}];}_0x144f06=_[_0x784b('0x39')]({},_0x144f06,_0x2d60a7[_0x784b('0x3d')]);return db[_0x784b('0x3e')]['find'](_0x144f06)['then'](handleEntityNotFound(_0x48a45f,null))[_0x784b('0x23')](respondWithResult(_0x48a45f,null))[_0x784b('0x41')](handleError(_0x48a45f,null));};exports['create']=function(_0x10d0bb,_0x351c1f){return db[_0x784b('0x3e')]['create'](_0x10d0bb[_0x784b('0x45')],{})[_0x784b('0x23')](respondWithResult(_0x351c1f,0xc9))[_0x784b('0x41')](handleError(_0x351c1f,null));};exports['update']=function(_0x46c9c0,_0x196b40){if(_0x46c9c0[_0x784b('0x45')]['id']){delete _0x46c9c0[_0x784b('0x45')]['id'];}return db[_0x784b('0x3e')][_0x784b('0x46')]({'where':{'id':_0x46c9c0['params']['id']}})[_0x784b('0x23')](handleEntityNotFound(_0x196b40,null))[_0x784b('0x23')](saveUpdates(_0x46c9c0[_0x784b('0x45')],null))[_0x784b('0x23')](respondWithResult(_0x196b40,null))[_0x784b('0x41')](handleError(_0x196b40,null));};exports[_0x784b('0x47')]=function(_0x1218d7,_0xa6e7b,_0x5b2bcb){var _0x41439d=require(_0x784b('0x48'));var _0x305099=![];var _0x35e6ab={};if(_0x1218d7['query'][_0x784b('0x3a')]&&_0x1218d7['query'][_0x784b('0x3a')]==='uniqueid'){_0x35e6ab[_0x784b('0x49')]=_0x1218d7[_0x784b('0x4a')]['id'];}else{_0x35e6ab['id']=_0x1218d7['params']['id'];}return db[_0x784b('0x3e')][_0x784b('0x46')]({'where':_0x35e6ab,'attributes':['id',_0x784b('0x4b'),_0x784b('0x4c')],'raw':!![]})[_0x784b('0x23')](handleEntityNotFound(_0xa6e7b,null))[_0x784b('0x23')](function(_0x2be69b){if(_0x2be69b){var _0xb10abd=_0x2be69b[_0x784b('0x4b')];var _0x1e2210=util[_0x784b('0x4d')](_0x784b('0x4e'),_0xb10abd);if(fs[_0x784b('0x4f')](_0x1e2210)){_0x305099=!![];return _0x41439d[_0x784b('0x50')](_0x1e2210,_0xb10abd,config['secrets'][_0x784b('0x51')])[_0x784b('0x23')](function(){return _0x2be69b;});}return _0x2be69b;}})[_0x784b('0x23')](function(_0x1be325){if(_0x1be325){var _0x2afe14=_0x1be325[_0x784b('0x4b')];if(!fs[_0x784b('0x4f')](_0x2afe14)){throw new db[(_0x784b('0x52'))][(_0x784b('0x53'))](_0x784b('0x54'));}if(_0x1be325[_0x784b('0x4c')]){return _0xa6e7b[_0x784b('0x47')](_0x2afe14,_0x1be325[_0x784b('0x4c')]+path['extname'](_0x2afe14),function(){if(_0x305099){fs['unlink'](_0x2afe14);}});}else{return _0xa6e7b[_0x784b('0x47')](_0x2afe14,function(_0x512cac){if(_0x305099){fs[_0x784b('0x55')](_0x2afe14);}});}}})[_0x784b('0x41')](function(_0x531fbc){if(_0x531fbc[_0x784b('0x56')]===_0x784b('0x54')){_0xa6e7b[_0x784b('0x16')](0x194)[_0x784b('0x28')](_0x784b('0x57'));}else{return handleError(_0xa6e7b,null);}});};exports[_0x784b('0x22')]=function(_0x51fb05,_0x5f251b){return db[_0x784b('0x3e')]['find']({'where':{'id':_0x51fb05[_0x784b('0x4a')]['id']}})['then'](function(_0x288857){if(_['isNil'](_0x288857)){throw new ReferenceError(_0x784b('0x58'));}return _0x288857;})[_0x784b('0x23')](function(_0x2e4830){var _0x1062d5=_0x2e4830[_0x784b('0x4b')];logger[_0x784b('0x59')](_0x784b('0x5a'),_0x1062d5);if(!_[_0x784b('0x5b')](_0x2e4830[_0x784b('0x4b')])&&fs[_0x784b('0x4f')](_0x1062d5)){logger['info'](_0x784b('0x5c')+_0x1062d5+_0x784b('0x5d'));fs[_0x784b('0x5e')](_0x1062d5);}_0x1062d5=_0x1062d5+_0x784b('0x5f');if(!_[_0x784b('0x5b')](_0x2e4830[_0x784b('0x4b')])&&fs['existsSync'](_0x1062d5)){logger['info']('File:\x20\x22'+_0x1062d5+_0x784b('0x5d'));fs[_0x784b('0x5e')](_0x1062d5);}return _0x2e4830;})['then'](function(_0x16d82a){if(!_0x16d82a)throw new InternalError();return _0x16d82a[_0x784b('0x22')]();})['then'](function(){_0x5f251b[_0x784b('0x16')](0xcc)[_0x784b('0x15')]();})['catch'](handleError(_0x5f251b,null));}; \ No newline at end of file +var _0x572c=['options','includeAll','include','SquareRecording','findAll','rows','catch','show','find','body','params','download','../../components/encryptor','uniqueid','filename','format','%s.cypher','existsSync','recording','savePath','Sequelize','ValidationError','unlink','message','send','Not\x20found','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','File:\x20\x22','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','save','update','then','destroy','error','stack','name','index','map','rawAttributes','fieldName','type','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge'];(function(_0x10941e,_0x300a87){var _0x5d24b4=function(_0x3f45fd){while(--_0x3f45fd){_0x10941e['push'](_0x10941e['shift']());}};_0x5d24b4(++_0x300a87);}(_0x572c,0x80));var _0xc572=function(_0x46ca5c,_0x318aa0){_0x46ca5c=_0x46ca5c-0x0;var _0x5518dd=_0x572c[_0x46ca5c];return _0x5518dd;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc572('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc572('0x1'));var rp=require(_0xc572('0x2'));var moment=require(_0xc572('0x3'));var BPromise=require(_0xc572('0x4'));var Mustache=require(_0xc572('0x5'));var util=require('util');var path=require(_0xc572('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xc572('0x7'));var fs=require('fs');var fs_extra=require(_0xc572('0x8'));var _=require(_0xc572('0x9'));var squel=require(_0xc572('0xa'));var crypto=require(_0xc572('0xb'));var jsforce=require(_0xc572('0xc'));var deskjs=require(_0xc572('0xd'));var toCsv=require(_0xc572('0xe'));var querystring=require(_0xc572('0xf'));var Papa=require(_0xc572('0x10'));var Redis=require(_0xc572('0x11'));var authService=require(_0xc572('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xc572('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc572('0x14'))(_0xc572('0x15'));var utils=require(_0xc572('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xc572('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x20396e,_0xe1c3ec){_0xe1c3ec=_0xe1c3ec||0xcc;return function(_0x41d3c4){if(_0x41d3c4){return _0x20396e[_0xc572('0x18')](_0xe1c3ec);}return _0x20396e[_0xc572('0x19')](_0xe1c3ec)[_0xc572('0x1a')]();};}function respondWithResult(_0x2a4efb,_0x27d056){_0x27d056=_0x27d056||0xc8;return function(_0x2efc23){if(_0x2efc23){return _0x2a4efb[_0xc572('0x19')](_0x27d056)[_0xc572('0x1b')](_0x2efc23);}};}function respondWithFilteredResult(_0x19ae23,_0x5e0b20){return function(_0x1cd56b){if(_0x1cd56b){var _0x3fa00b=typeof _0x5e0b20[_0xc572('0x1c')]===_0xc572('0x1d')&&typeof _0x5e0b20[_0xc572('0x1e')]===_0xc572('0x1d');var _0x58240a=_0x1cd56b[_0xc572('0x1f')];var _0x29da80=_0x3fa00b?0x0:_0x5e0b20[_0xc572('0x1c')];var _0x3db85c=_0x3fa00b?_0x1cd56b['count']:_0x5e0b20[_0xc572('0x1c')]+_0x5e0b20[_0xc572('0x1e')];var _0x106ed3;if(_0x3db85c>=_0x58240a){_0x3db85c=_0x58240a;_0x106ed3=0xc8;}else{_0x106ed3=0xce;}_0x19ae23['status'](_0x106ed3);return _0x19ae23[_0xc572('0x20')]('Content-Range',_0x29da80+'-'+_0x3db85c+'/'+_0x58240a)[_0xc572('0x1b')](_0x1cd56b);}return null;};}function patchUpdates(_0x1a72de){return function(_0x3a1bca){try{jsonpatch[_0xc572('0x21')](_0x3a1bca,_0x1a72de,!![]);}catch(_0x390240){return BPromise['reject'](_0x390240);}return _0x3a1bca[_0xc572('0x22')]();};}function saveUpdates(_0x3570bc,_0x4a9c6a){return function(_0x5362e8){if(_0x5362e8){return _0x5362e8[_0xc572('0x23')](_0x3570bc)[_0xc572('0x24')](function(_0x51c6da){return _0x51c6da;});}return null;};}function removeEntity(_0x55f458,_0x105a6c){return function(_0x4d017c){if(_0x4d017c){return _0x4d017c[_0xc572('0x25')]()['then'](function(){_0x55f458[_0xc572('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0xb16307,_0x55a1b1){return function(_0x14de98){if(!_0x14de98){_0xb16307[_0xc572('0x18')](0x194);}return _0x14de98;};}function handleError(_0x360fb4,_0x55e31b){_0x55e31b=_0x55e31b||0x1f4;return function(_0x4b7f5d){logger[_0xc572('0x26')](_0x4b7f5d[_0xc572('0x27')]);if(_0x4b7f5d['name']){delete _0x4b7f5d[_0xc572('0x28')];}_0x360fb4[_0xc572('0x19')](_0x55e31b)['send'](_0x4b7f5d);};}exports[_0xc572('0x29')]=function(_0x243c71,_0xf01af7){var _0x14d47c={},_0x3c5fa8={},_0x5579c7={'count':0x0,'rows':[]};var _0x1bd617=_[_0xc572('0x2a')](db['SquareRecording'][_0xc572('0x2b')],function(_0xbf35f0){return{'name':_0xbf35f0[_0xc572('0x2c')],'type':_0xbf35f0[_0xc572('0x2d')]['key']};});_0x3c5fa8['model']=_[_0xc572('0x2a')](_0x1bd617,_0xc572('0x28'));_0x3c5fa8[_0xc572('0x2e')]=_[_0xc572('0x2f')](_0x243c71[_0xc572('0x2e')]);_0x3c5fa8['filters']=_[_0xc572('0x30')](_0x3c5fa8[_0xc572('0x31')],_0x3c5fa8[_0xc572('0x2e')]);_0x14d47c[_0xc572('0x32')]=_['intersection'](_0x3c5fa8['model'],qs[_0xc572('0x33')](_0x243c71[_0xc572('0x2e')]['fields']));_0x14d47c[_0xc572('0x32')]=_0x14d47c[_0xc572('0x32')][_0xc572('0x34')]?_0x14d47c[_0xc572('0x32')]:_0x3c5fa8[_0xc572('0x31')];if(!_0x243c71[_0xc572('0x2e')][_0xc572('0x35')](_0xc572('0x36'))){_0x14d47c[_0xc572('0x1e')]=qs['limit'](_0x243c71[_0xc572('0x2e')][_0xc572('0x1e')]);_0x14d47c[_0xc572('0x1c')]=qs['offset'](_0x243c71[_0xc572('0x2e')][_0xc572('0x1c')]);}_0x14d47c[_0xc572('0x37')]=qs[_0xc572('0x38')](_0x243c71['query'][_0xc572('0x38')]);_0x14d47c[_0xc572('0x39')]=qs[_0xc572('0x3a')](_[_0xc572('0x3b')](_0x243c71[_0xc572('0x2e')],_0x3c5fa8['filters']),_0x1bd617);if(_0x243c71[_0xc572('0x2e')][_0xc572('0x3c')]){_0x14d47c[_0xc572('0x39')]=_[_0xc572('0x3d')](_0x14d47c[_0xc572('0x39')],{'$or':_[_0xc572('0x2a')](_0x1bd617,function(_0x40ab5e){if(_0x40ab5e[_0xc572('0x2d')]!=='VIRTUAL'){var _0x32fa21={};_0x32fa21[_0x40ab5e['name']]={'$like':'%'+_0x243c71[_0xc572('0x2e')][_0xc572('0x3c')]+'%'};return _0x32fa21;}})});}_0x14d47c=_['merge']({},_0x14d47c,_0x243c71[_0xc572('0x3e')]);var _0x2dc4db={'where':_0x14d47c[_0xc572('0x39')]};return db['SquareRecording'][_0xc572('0x1f')](_0x2dc4db)[_0xc572('0x24')](function(_0x5b2422){_0x5579c7[_0xc572('0x1f')]=_0x5b2422;if(_0x243c71[_0xc572('0x2e')][_0xc572('0x3f')]){_0x14d47c[_0xc572('0x40')]=[{'all':!![]}];}return db[_0xc572('0x41')][_0xc572('0x42')](_0x14d47c);})[_0xc572('0x24')](function(_0x2ae8a4){_0x5579c7[_0xc572('0x43')]=_0x2ae8a4;return _0x5579c7;})['then'](respondWithFilteredResult(_0xf01af7,_0x14d47c))[_0xc572('0x44')](handleError(_0xf01af7,null));};exports[_0xc572('0x45')]=function(_0x48b055,_0xf4a489){var _0x4ab9a3={'raw':!![],'where':{'id':_0x48b055['params']['id']}},_0x3eaad5={};_0x3eaad5[_0xc572('0x31')]=_[_0xc572('0x2f')](db[_0xc572('0x41')][_0xc572('0x2b')]);_0x3eaad5['query']=_[_0xc572('0x2f')](_0x48b055[_0xc572('0x2e')]);_0x3eaad5[_0xc572('0x3a')]=_[_0xc572('0x30')](_0x3eaad5[_0xc572('0x31')],_0x3eaad5[_0xc572('0x2e')]);_0x4ab9a3[_0xc572('0x32')]=_[_0xc572('0x30')](_0x3eaad5[_0xc572('0x31')],qs[_0xc572('0x33')](_0x48b055[_0xc572('0x2e')][_0xc572('0x33')]));_0x4ab9a3['attributes']=_0x4ab9a3[_0xc572('0x32')]['length']?_0x4ab9a3[_0xc572('0x32')]:_0x3eaad5[_0xc572('0x31')];if(_0x48b055[_0xc572('0x2e')][_0xc572('0x3f')]){_0x4ab9a3['include']=[{'all':!![]}];}_0x4ab9a3=_[_0xc572('0x3d')]({},_0x4ab9a3,_0x48b055[_0xc572('0x3e')]);return db[_0xc572('0x41')][_0xc572('0x46')](_0x4ab9a3)[_0xc572('0x24')](handleEntityNotFound(_0xf4a489,null))['then'](respondWithResult(_0xf4a489,null))[_0xc572('0x44')](handleError(_0xf4a489,null));};exports['create']=function(_0x551afb,_0x537e24){return db[_0xc572('0x41')]['create'](_0x551afb[_0xc572('0x47')],{})[_0xc572('0x24')](respondWithResult(_0x537e24,0xc9))[_0xc572('0x44')](handleError(_0x537e24,null));};exports[_0xc572('0x23')]=function(_0x10cfb7,_0x584ae2){if(_0x10cfb7[_0xc572('0x47')]['id']){delete _0x10cfb7[_0xc572('0x47')]['id'];}return db[_0xc572('0x41')][_0xc572('0x46')]({'where':{'id':_0x10cfb7[_0xc572('0x48')]['id']}})[_0xc572('0x24')](handleEntityNotFound(_0x584ae2,null))[_0xc572('0x24')](saveUpdates(_0x10cfb7[_0xc572('0x47')],null))['then'](respondWithResult(_0x584ae2,null))['catch'](handleError(_0x584ae2,null));};exports[_0xc572('0x49')]=function(_0x5ce4cc,_0x346e3b,_0x1cc342){var _0x41a023=require(_0xc572('0x4a'));var _0x2e9db5=![];var _0x11f08f={};if(_0x5ce4cc[_0xc572('0x2e')]['type']&&_0x5ce4cc[_0xc572('0x2e')][_0xc572('0x2d')]==='uniqueid'){_0x11f08f[_0xc572('0x4b')]=_0x5ce4cc[_0xc572('0x48')]['id'];}else{_0x11f08f['id']=_0x5ce4cc[_0xc572('0x48')]['id'];}return db[_0xc572('0x41')][_0xc572('0x46')]({'where':_0x11f08f,'attributes':['id','savePath',_0xc572('0x4c')],'raw':!![]})[_0xc572('0x24')](handleEntityNotFound(_0x346e3b,null))[_0xc572('0x24')](function(_0x202585){if(_0x202585){var _0x2233f8=_0x202585['savePath'];var _0x4c4739=util[_0xc572('0x4d')](_0xc572('0x4e'),_0x2233f8);if(fs[_0xc572('0x4f')](_0x4c4739)){_0x2e9db5=!![];return _0x41a023['decryptFile'](_0x4c4739,_0x2233f8,config['secrets'][_0xc572('0x50')])[_0xc572('0x24')](function(){return _0x202585;});}return _0x202585;}})[_0xc572('0x24')](function(_0x2c756c){if(_0x2c756c){var _0x1fc6de=_0x2c756c[_0xc572('0x51')];if(!fs[_0xc572('0x4f')](_0x1fc6de)){throw new db[(_0xc572('0x52'))][(_0xc572('0x53'))]('SquareRecording\x20not\x20found');}if(_0x2c756c[_0xc572('0x4c')]){return _0x346e3b['download'](_0x1fc6de,_0x2c756c[_0xc572('0x4c')]+path['extname'](_0x1fc6de),function(){if(_0x2e9db5){fs[_0xc572('0x54')](_0x1fc6de);}});}else{return _0x346e3b[_0xc572('0x49')](_0x1fc6de,function(_0x486a4d){if(_0x2e9db5){fs['unlink'](_0x1fc6de);}});}}})[_0xc572('0x44')](function(_0x58b682){if(_0x58b682[_0xc572('0x55')]==='SquareRecording\x20not\x20found'){_0x346e3b[_0xc572('0x19')](0x194)[_0xc572('0x56')](_0xc572('0x57'));}else{return handleError(_0x346e3b,null);}});};exports[_0xc572('0x25')]=function(_0x4b8dc3,_0xb80fb){return db[_0xc572('0x41')][_0xc572('0x46')]({'where':{'id':_0x4b8dc3[_0xc572('0x48')]['id']}})[_0xc572('0x24')](function(_0x4e6807){if(_[_0xc572('0x58')](_0x4e6807)){throw new ReferenceError(_0xc572('0x59'));}return _0x4e6807;})[_0xc572('0x24')](function(_0x2fe677){var _0x25fd1f=_0x2fe677[_0xc572('0x51')];logger[_0xc572('0x5a')](_0xc572('0x5b'),_0x25fd1f);if(!_[_0xc572('0x58')](_0x2fe677[_0xc572('0x51')])&&fs[_0xc572('0x4f')](_0x25fd1f)){logger[_0xc572('0x5a')]('File:\x20\x22'+_0x25fd1f+_0xc572('0x5c'));fs[_0xc572('0x5d')](_0x25fd1f);}_0x25fd1f=_0x25fd1f+'.cypher';if(!_[_0xc572('0x58')](_0x2fe677[_0xc572('0x51')])&&fs[_0xc572('0x4f')](_0x25fd1f)){logger[_0xc572('0x5a')](_0xc572('0x5e')+_0x25fd1f+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs['unlinkSync'](_0x25fd1f);}return _0x2fe677;})['then'](function(_0x316e93){if(!_0x316e93)throw new InternalError();return _0x316e93[_0xc572('0x25')]();})[_0xc572('0x24')](function(){_0xb80fb[_0xc572('0x19')](0xcc)[_0xc572('0x1a')]();})[_0xc572('0x44')](handleError(_0xb80fb,null));}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.model.js b/server/api/squareRecording/squareRecording.model.js index a08a964..fd9b4e7 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 _0x649f=['bluebird','path','rimraf','../../config/environment','./squareRecording.attributes','exports','define','lodash','util','../../config/logger'];(function(_0x2b5eae,_0x55010d){var _0x5f3ac9=function(_0x397bfc){while(--_0x397bfc){_0x2b5eae['push'](_0x2b5eae['shift']());}};_0x5f3ac9(++_0x55010d);}(_0x649f,0x93));var _0xf649=function(_0x9c2427,_0x17c865){_0x9c2427=_0x9c2427-0x0;var _0x51984f=_0x649f[_0x9c2427];return _0x51984f;};'use strict';var _=require(_0xf649('0x0'));var util=require(_0xf649('0x1'));var logger=require(_0xf649('0x2'))('api');var moment=require('moment');var BPromise=require(_0xf649('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf649('0x4'));var rimraf=require(_0xf649('0x5'));var config=require(_0xf649('0x6'));var attributes=require(_0xf649('0x7'));module[_0xf649('0x8')]=function(_0x3e2e46,_0x580748){return _0x3e2e46[_0xf649('0x9')]('SquareRecording',attributes,{'tableName':'square_recordings','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8ed7=['path','rimraf','../../config/environment','./squareRecording.attributes','exports','define','square_recordings','util','../../config/logger','api','request-promise'];(function(_0x45a7a6,_0x380289){var _0x514f51=function(_0x366e28){while(--_0x366e28){_0x45a7a6['push'](_0x45a7a6['shift']());}};_0x514f51(++_0x380289);}(_0x8ed7,0x8b));var _0x78ed=function(_0x16acb4,_0x2ad48d){_0x16acb4=_0x16acb4-0x0;var _0xfeed39=_0x8ed7[_0x16acb4];return _0xfeed39;};'use strict';var _=require('lodash');var util=require(_0x78ed('0x0'));var logger=require(_0x78ed('0x1'))(_0x78ed('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x78ed('0x3'));var fs=require('fs');var path=require(_0x78ed('0x4'));var rimraf=require(_0x78ed('0x5'));var config=require(_0x78ed('0x6'));var attributes=require(_0x78ed('0x7'));module[_0x78ed('0x8')]=function(_0x3d8efa,_0x42094f){return _0x3d8efa[_0x78ed('0x9')]('SquareRecording',attributes,{'tableName':_0x78ed('0xa'),'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 0d9b6c5..a26fd17 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 _0xdedb=['code','message','result','catch','SquareRecording','create','body','options','raw','then','CreateSquareRecording','stringify','lodash','util','moment','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','SquareRecording,\x20%s,\x20%s','debug','SquareRecording,\x20%s,\x20%s,\x20%s','error'];(function(_0x2e4e19,_0x493b50){var _0x9ba20b=function(_0x2f6456){while(--_0x2f6456){_0x2e4e19['push'](_0x2e4e19['shift']());}};_0x9ba20b(++_0x493b50);}(_0xdedb,0x1dc));var _0xbded=function(_0x1192a6,_0x1bfd7a){_0x1192a6=_0x1192a6-0x0;var _0x2423ab=_0xdedb[_0x1192a6];return _0x2423ab;};'use strict';var _=require(_0xbded('0x0'));var util=require(_0xbded('0x1'));var moment=require(_0xbded('0x2'));var BPromise=require('bluebird');var rs=require(_0xbded('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbded('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xbded('0x5'))(_0xbded('0x6'));var config=require(_0xbded('0x7'));var jayson=require(_0xbded('0x8'));var client=jayson[_0xbded('0x9')][_0xbded('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x45acf1,_0x406c40,_0x2a7641){return new BPromise(function(_0x358be0,_0x5df343){return client[_0xbded('0xb')](_0x45acf1,_0x2a7641)['then'](function(_0x5bb004){logger[_0xbded('0xc')](_0xbded('0xd'),_0x406c40,'request\x20sent');logger[_0xbded('0xe')](_0xbded('0xf'),_0x406c40,'request\x20sent',JSON['stringify'](_0x5bb004));if(_0x5bb004[_0xbded('0x10')]){if(_0x5bb004['error'][_0xbded('0x11')]===0x1f4){logger[_0xbded('0x10')]('SquareRecording,\x20%s,\x20%s',_0x406c40,_0x5bb004[_0xbded('0x10')][_0xbded('0x12')]);return _0x5df343(_0x5bb004[_0xbded('0x10')][_0xbded('0x12')]);}logger[_0xbded('0x10')]('SquareRecording,\x20%s,\x20%s',_0x406c40,_0x5bb004['error']['message']);return _0x358be0(_0x5bb004['error'][_0xbded('0x12')]);}else{logger[_0xbded('0xc')]('SquareRecording,\x20%s,\x20%s',_0x406c40,'request\x20sent');_0x358be0(_0x5bb004[_0xbded('0x13')][_0xbded('0x12')]);}})[_0xbded('0x14')](function(_0x23cb44){logger[_0xbded('0x10')](_0xbded('0xd'),_0x406c40,_0x23cb44);_0x5df343(_0x23cb44);});});}exports['CreateSquareRecording']=function(_0x35a5b8){var _0x4b0eae=this;return new Promise(function(_0x133268,_0xcf9fa){return db[_0xbded('0x15')][_0xbded('0x16')](_0x35a5b8[_0xbded('0x17')],{'raw':_0x35a5b8[_0xbded('0x18')]?_0x35a5b8[_0xbded('0x18')][_0xbded('0x19')]===undefined?!![]:![]:!![]})[_0xbded('0x1a')](function(_0x1597fe){logger[_0xbded('0xc')](_0xbded('0x1b'),_0x35a5b8);logger[_0xbded('0xe')](_0xbded('0x1b'),_0x35a5b8,JSON[_0xbded('0x1c')](_0x1597fe));_0x133268(_0x1597fe);})[_0xbded('0x14')](function(_0xda80a4){logger[_0xbded('0x10')]('CreateSquareRecording',_0xda80a4[_0xbded('0x12')],_0x35a5b8);_0xcf9fa(_0x4b0eae['error'](0x1f4,_0xda80a4[_0xbded('0x12')]));});});}; \ No newline at end of file +var _0xad97=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','info','request\x20sent','debug','stringify','error','SquareRecording,\x20%s,\x20%s','message','result','CreateSquareRecording','SquareRecording','create','body','options','raw','then','catch','lodash','util','moment','bluebird'];(function(_0x425ede,_0x31feb7){var _0xd9c08d=function(_0x2de050){while(--_0x2de050){_0x425ede['push'](_0x425ede['shift']());}};_0xd9c08d(++_0x31feb7);}(_0xad97,0x192));var _0x7ad9=function(_0x1cbb10,_0x3e6dfa){_0x1cbb10=_0x1cbb10-0x0;var _0x4b4d86=_0xad97[_0x1cbb10];return _0x4b4d86;};'use strict';var _=require(_0x7ad9('0x0'));var util=require(_0x7ad9('0x1'));var moment=require(_0x7ad9('0x2'));var BPromise=require(_0x7ad9('0x3'));var rs=require(_0x7ad9('0x4'));var fs=require('fs');var Redis=require(_0x7ad9('0x5'));var db=require(_0x7ad9('0x6'))['db'];var utils=require(_0x7ad9('0x7'));var logger=require(_0x7ad9('0x8'))(_0x7ad9('0x9'));var config=require('../../config/environment');var jayson=require(_0x7ad9('0xa'));var client=jayson['client'][_0x7ad9('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xca95f,_0x2568ba,_0x360792){return new BPromise(function(_0xdde46d,_0xfc601f){return client[_0x7ad9('0xc')](_0xca95f,_0x360792)['then'](function(_0x4fff94){logger[_0x7ad9('0xd')]('SquareRecording,\x20%s,\x20%s',_0x2568ba,_0x7ad9('0xe'));logger[_0x7ad9('0xf')]('SquareRecording,\x20%s,\x20%s,\x20%s',_0x2568ba,_0x7ad9('0xe'),JSON[_0x7ad9('0x10')](_0x4fff94));if(_0x4fff94[_0x7ad9('0x11')]){if(_0x4fff94[_0x7ad9('0x11')]['code']===0x1f4){logger[_0x7ad9('0x11')](_0x7ad9('0x12'),_0x2568ba,_0x4fff94['error']['message']);return _0xfc601f(_0x4fff94[_0x7ad9('0x11')]['message']);}logger['error']('SquareRecording,\x20%s,\x20%s',_0x2568ba,_0x4fff94[_0x7ad9('0x11')][_0x7ad9('0x13')]);return _0xdde46d(_0x4fff94['error'][_0x7ad9('0x13')]);}else{logger['info'](_0x7ad9('0x12'),_0x2568ba,_0x7ad9('0xe'));_0xdde46d(_0x4fff94[_0x7ad9('0x14')][_0x7ad9('0x13')]);}})['catch'](function(_0x54e30c){logger[_0x7ad9('0x11')](_0x7ad9('0x12'),_0x2568ba,_0x54e30c);_0xfc601f(_0x54e30c);});});}exports[_0x7ad9('0x15')]=function(_0x20f453){var _0x161d1d=this;return new Promise(function(_0x341c0c,_0x472ecc){return db[_0x7ad9('0x16')][_0x7ad9('0x17')](_0x20f453[_0x7ad9('0x18')],{'raw':_0x20f453[_0x7ad9('0x19')]?_0x20f453[_0x7ad9('0x19')][_0x7ad9('0x1a')]===undefined?!![]:![]:!![]})[_0x7ad9('0x1b')](function(_0x214b68){logger[_0x7ad9('0xd')](_0x7ad9('0x15'),_0x20f453);logger[_0x7ad9('0xf')](_0x7ad9('0x15'),_0x20f453,JSON['stringify'](_0x214b68));_0x341c0c(_0x214b68);})[_0x7ad9('0x1c')](function(_0x4480aa){logger['error'](_0x7ad9('0x15'),_0x4480aa['message'],_0x20f453);_0x472ecc(_0x161d1d[_0x7ad9('0x11')](0x1f4,_0x4480aa[_0x7ad9('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/squareReport/index.js b/server/api/squareReport/index.js index 74da576..29f90d8 100644 --- a/server/api/squareReport/index.js +++ b/server/api/squareReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbaf0=['/:id','update','delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./squareReport.controller','get','isAuthenticated','index','/describe','show','post','create','put'];(function(_0x15610a,_0xe8f67){var _0x45f604=function(_0x4b5ee9){while(--_0x4b5ee9){_0x15610a['push'](_0x15610a['shift']());}};_0x45f604(++_0xe8f67);}(_0xbaf0,0x12a));var _0x0baf=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0xbaf0[_0x4cf98e];return _0x1623ac;};'use strict';var multer=require('multer');var util=require(_0x0baf('0x0'));var path=require(_0x0baf('0x1'));var timeout=require(_0x0baf('0x2'));var express=require(_0x0baf('0x3'));var router=express[_0x0baf('0x4')]();var fs_extra=require(_0x0baf('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x0baf('0x6'));var config=require(_0x0baf('0x7'));var controller=require(_0x0baf('0x8'));router[_0x0baf('0x9')]('/',auth[_0x0baf('0xa')](),controller[_0x0baf('0xb')]);router[_0x0baf('0x9')](_0x0baf('0xc'),auth[_0x0baf('0xa')](),controller['describe']);router[_0x0baf('0x9')]('/:id',auth[_0x0baf('0xa')](),controller[_0x0baf('0xd')]);router[_0x0baf('0xe')]('/',auth[_0x0baf('0xa')](),controller[_0x0baf('0xf')]);router[_0x0baf('0x10')](_0x0baf('0x11'),auth[_0x0baf('0xa')](),controller[_0x0baf('0x12')]);router[_0x0baf('0x13')](_0x0baf('0x11'),auth['isAuthenticated'](),controller['destroy']);module[_0x0baf('0x14')]=router; \ No newline at end of file +var _0xe706=['/describe','describe','/:id','show','post','create','put','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareReport.controller','get','isAuthenticated','index'];(function(_0xcc210,_0x7abe44){var _0x520254=function(_0x3578de){while(--_0x3578de){_0xcc210['push'](_0xcc210['shift']());}};_0x520254(++_0x7abe44);}(_0xe706,0xa3));var _0x6e70=function(_0x127af0,_0x49fbc5){_0x127af0=_0x127af0-0x0;var _0x1fc410=_0xe706[_0x127af0];return _0x1fc410;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var controller=require(_0x6e70('0x9'));router[_0x6e70('0xa')]('/',auth[_0x6e70('0xb')](),controller[_0x6e70('0xc')]);router[_0x6e70('0xa')](_0x6e70('0xd'),auth[_0x6e70('0xb')](),controller[_0x6e70('0xe')]);router[_0x6e70('0xa')](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x10')]);router[_0x6e70('0x11')]('/',auth[_0x6e70('0xb')](),controller[_0x6e70('0x12')]);router[_0x6e70('0x13')](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller['update']);router['delete'](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x14')]);module[_0x6e70('0x15')]=router; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.attributes.js b/server/api/squareReport/squareReport.attributes.js index 642e2dc..4251adc 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 _0x6e59=['STRING','DATE','sequelize','exports'];(function(_0x430459,_0x58519c){var _0x3a2439=function(_0x27a0b3){while(--_0x27a0b3){_0x430459['push'](_0x430459['shift']());}};_0x3a2439(++_0x58519c);}(_0x6e59,0x1b2));var _0x96e5=function(_0x21a2e8,_0x2d2b90){_0x21a2e8=_0x21a2e8-0x0;var _0x5aee70=_0x6e59[_0x21a2e8];return _0x5aee70;};'use strict';var Sequelize=require(_0x96e5('0x0'));module[_0x96e5('0x1')]={'network':{'type':Sequelize[_0x96e5('0x2')]},'network_script':{'type':Sequelize[_0x96e5('0x2')]},'request':{'type':Sequelize[_0x96e5('0x2')]},'channel':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x96e5('0x2')]},'type':{'type':Sequelize[_0x96e5('0x2')]},'uniqueid':{'type':Sequelize[_0x96e5('0x2')]},'version':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0x96e5('0x2')]},'calleridname':{'type':Sequelize[_0x96e5('0x2')]},'callingpres':{'type':Sequelize['STRING']},'callingani2':{'type':Sequelize['STRING']},'callington':{'type':Sequelize[_0x96e5('0x2')]},'callingtns':{'type':Sequelize[_0x96e5('0x2')]},'dnid':{'type':Sequelize[_0x96e5('0x2')]},'rdnis':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x96e5('0x2')]},'extension':{'type':Sequelize[_0x96e5('0x2')]},'priority':{'type':Sequelize['STRING']},'enhanced':{'type':Sequelize[_0x96e5('0x2')]},'accountcode':{'type':Sequelize[_0x96e5('0x2')]},'threadid':{'type':Sequelize[_0x96e5('0x2')]},'project_name':{'type':Sequelize[_0x96e5('0x2')]},'joinAt':{'type':Sequelize[_0x96e5('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'bot':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x7e65=['BOOLEAN','exports','STRING','DATE'];(function(_0x3cfb2c,_0x32fb75){var _0x3a79d9=function(_0x1d8980){while(--_0x1d8980){_0x3cfb2c['push'](_0x3cfb2c['shift']());}};_0x3a79d9(++_0x32fb75);}(_0x7e65,0x185));var _0x57e6=function(_0x415ba9,_0x15b1d4){_0x415ba9=_0x415ba9-0x0;var _0x4a1f5c=_0x7e65[_0x415ba9];return _0x4a1f5c;};'use strict';var Sequelize=require('sequelize');module[_0x57e6('0x0')]={'network':{'type':Sequelize[_0x57e6('0x1')]},'network_script':{'type':Sequelize['STRING']},'request':{'type':Sequelize['STRING']},'channel':{'type':Sequelize['STRING']},'language':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x57e6('0x1')]},'uniqueid':{'type':Sequelize[_0x57e6('0x1')]},'version':{'type':Sequelize[_0x57e6('0x1')]},'callerid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'callingpres':{'type':Sequelize[_0x57e6('0x1')]},'callingani2':{'type':Sequelize['STRING']},'callington':{'type':Sequelize[_0x57e6('0x1')]},'callingtns':{'type':Sequelize['STRING']},'dnid':{'type':Sequelize['STRING']},'rdnis':{'type':Sequelize[_0x57e6('0x1')]},'context':{'type':Sequelize[_0x57e6('0x1')]},'extension':{'type':Sequelize[_0x57e6('0x1')]},'priority':{'type':Sequelize[_0x57e6('0x1')]},'enhanced':{'type':Sequelize[_0x57e6('0x1')]},'accountcode':{'type':Sequelize[_0x57e6('0x1')]},'threadid':{'type':Sequelize[_0x57e6('0x1')]},'project_name':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x57e6('0x2')]},'leaveAt':{'type':Sequelize[_0x57e6('0x2')]},'bot':{'type':Sequelize[_0x57e6('0x3')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.controller.js b/server/api/squareReport/squareReport.controller.js index 5b976f3..e49fdfc 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 _0xe409=['then','destroy','error','name','send','map','SquareReport','rawAttributes','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','pick','where','merge','type','VIRTUAL','filter','includeAll','include','rows','catch','show','params','options','find','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','reject','save'];(function(_0x307f72,_0x32fba4){var _0x10f2c6=function(_0x56117a){while(--_0x56117a){_0x307f72['push'](_0x307f72['shift']());}};_0x10f2c6(++_0x32fba4);}(_0xe409,0x19b));var _0x9e40=function(_0x16da6f,_0x210e94){_0x16da6f=_0x16da6f-0x0;var _0x197a9f=_0xe409[_0x16da6f];return _0x197a9f;};'use strict';var emlformat=require(_0x9e40('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9e40('0x1'));var jsonpatch=require(_0x9e40('0x2'));var rp=require(_0x9e40('0x3'));var moment=require(_0x9e40('0x4'));var BPromise=require(_0x9e40('0x5'));var Mustache=require(_0x9e40('0x6'));var util=require(_0x9e40('0x7'));var path=require(_0x9e40('0x8'));var sox=require(_0x9e40('0x9'));var csv=require(_0x9e40('0xa'));var ejs=require(_0x9e40('0xb'));var fs=require('fs');var fs_extra=require(_0x9e40('0xc'));var _=require('lodash');var squel=require(_0x9e40('0xd'));var crypto=require('crypto');var jsforce=require(_0x9e40('0xe'));var deskjs=require(_0x9e40('0xf'));var toCsv=require(_0x9e40('0xa'));var querystring=require(_0x9e40('0x10'));var Papa=require(_0x9e40('0x11'));var Redis=require(_0x9e40('0x12'));var authService=require(_0x9e40('0x13'));var qs=require(_0x9e40('0x14'));var as=require(_0x9e40('0x15'));var hardwareService=require(_0x9e40('0x16'));var logger=require(_0x9e40('0x17'))(_0x9e40('0x18'));var utils=require(_0x9e40('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0x9e40('0x1a'));var db=require(_0x9e40('0x1b'))['db'];function respondWithStatusCode(_0x34120e,_0x1ddbc4){_0x1ddbc4=_0x1ddbc4||0xcc;return function(_0x301f1c){if(_0x301f1c){return _0x34120e[_0x9e40('0x1c')](_0x1ddbc4);}return _0x34120e[_0x9e40('0x1d')](_0x1ddbc4)['end']();};}function respondWithResult(_0x471482,_0x44bd35){_0x44bd35=_0x44bd35||0xc8;return function(_0x3387e4){if(_0x3387e4){return _0x471482[_0x9e40('0x1d')](_0x44bd35)[_0x9e40('0x1e')](_0x3387e4);}};}function respondWithFilteredResult(_0x3d1607,_0x39d12f){return function(_0x4f0186){if(_0x4f0186){var _0x419aa9=typeof _0x39d12f['offset']===_0x9e40('0x1f')&&typeof _0x39d12f[_0x9e40('0x20')]===_0x9e40('0x1f');var _0x85f291=_0x4f0186[_0x9e40('0x21')];var _0x33fe69=_0x419aa9?0x0:_0x39d12f[_0x9e40('0x22')];var _0xbd3a82=_0x419aa9?_0x4f0186[_0x9e40('0x21')]:_0x39d12f[_0x9e40('0x22')]+_0x39d12f['limit'];var _0x41e42e;if(_0xbd3a82>=_0x85f291){_0xbd3a82=_0x85f291;_0x41e42e=0xc8;}else{_0x41e42e=0xce;}_0x3d1607['status'](_0x41e42e);return _0x3d1607[_0x9e40('0x23')](_0x9e40('0x24'),_0x33fe69+'-'+_0xbd3a82+'/'+_0x85f291)[_0x9e40('0x1e')](_0x4f0186);}return null;};}function patchUpdates(_0x4126e1){return function(_0x588248){try{jsonpatch['apply'](_0x588248,_0x4126e1,!![]);}catch(_0x46bc48){return BPromise[_0x9e40('0x25')](_0x46bc48);}return _0x588248[_0x9e40('0x26')]();};}function saveUpdates(_0xf173d1,_0x5bae2d){return function(_0x26a5cf){if(_0x26a5cf){return _0x26a5cf['update'](_0xf173d1)[_0x9e40('0x27')](function(_0x3b7676){return _0x3b7676;});}return null;};}function removeEntity(_0x249351,_0x164750){return function(_0x16ada4){if(_0x16ada4){return _0x16ada4[_0x9e40('0x28')]()[_0x9e40('0x27')](function(){_0x249351[_0x9e40('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0xc957e0,_0x10d44f){return function(_0x575c54){if(!_0x575c54){_0xc957e0['sendStatus'](0x194);}return _0x575c54;};}function handleError(_0x244a3a,_0x57b913){_0x57b913=_0x57b913||0x1f4;return function(_0xe2d5b8){logger[_0x9e40('0x29')](_0xe2d5b8['stack']);if(_0xe2d5b8['name']){delete _0xe2d5b8[_0x9e40('0x2a')];}_0x244a3a[_0x9e40('0x1d')](_0x57b913)[_0x9e40('0x2b')](_0xe2d5b8);};}exports['index']=function(_0x4c7bc1,_0x37957b){var _0x46560e={},_0x75efb7={},_0x2dcbc3={'count':0x0,'rows':[]};var _0x2b6ff3=_[_0x9e40('0x2c')](db[_0x9e40('0x2d')][_0x9e40('0x2e')],function(_0x4fdd7f){return{'name':_0x4fdd7f['fieldName'],'type':_0x4fdd7f['type'][_0x9e40('0x2f')]};});_0x75efb7[_0x9e40('0x30')]=_[_0x9e40('0x2c')](_0x2b6ff3,_0x9e40('0x2a'));_0x75efb7[_0x9e40('0x31')]=_[_0x9e40('0x32')](_0x4c7bc1['query']);_0x75efb7[_0x9e40('0x33')]=_[_0x9e40('0x34')](_0x75efb7[_0x9e40('0x30')],_0x75efb7[_0x9e40('0x31')]);_0x46560e['attributes']=_[_0x9e40('0x34')](_0x75efb7[_0x9e40('0x30')],qs['fields'](_0x4c7bc1[_0x9e40('0x31')][_0x9e40('0x35')]));_0x46560e[_0x9e40('0x36')]=_0x46560e[_0x9e40('0x36')][_0x9e40('0x37')]?_0x46560e[_0x9e40('0x36')]:_0x75efb7[_0x9e40('0x30')];if(!_0x4c7bc1[_0x9e40('0x31')][_0x9e40('0x38')](_0x9e40('0x39'))){_0x46560e[_0x9e40('0x20')]=qs[_0x9e40('0x20')](_0x4c7bc1[_0x9e40('0x31')][_0x9e40('0x20')]);_0x46560e[_0x9e40('0x22')]=qs['offset'](_0x4c7bc1['query']['offset']);}_0x46560e['order']=qs['sort'](_0x4c7bc1[_0x9e40('0x31')][_0x9e40('0x3a')]);_0x46560e['where']=qs[_0x9e40('0x33')](_[_0x9e40('0x3b')](_0x4c7bc1[_0x9e40('0x31')],_0x75efb7[_0x9e40('0x33')]),_0x2b6ff3);if(_0x4c7bc1['query']['filter']){_0x46560e[_0x9e40('0x3c')]=_[_0x9e40('0x3d')](_0x46560e[_0x9e40('0x3c')],{'$or':_[_0x9e40('0x2c')](_0x2b6ff3,function(_0x35e978){if(_0x35e978[_0x9e40('0x3e')]!==_0x9e40('0x3f')){var _0x3cd638={};_0x3cd638[_0x35e978[_0x9e40('0x2a')]]={'$like':'%'+_0x4c7bc1[_0x9e40('0x31')][_0x9e40('0x40')]+'%'};return _0x3cd638;}})});}_0x46560e=_[_0x9e40('0x3d')]({},_0x46560e,_0x4c7bc1['options']);var _0xd48853={'where':_0x46560e['where']};return db[_0x9e40('0x2d')]['count'](_0xd48853)[_0x9e40('0x27')](function(_0x53a836){_0x2dcbc3[_0x9e40('0x21')]=_0x53a836;if(_0x4c7bc1[_0x9e40('0x31')][_0x9e40('0x41')]){_0x46560e[_0x9e40('0x42')]=[{'all':!![]}];}return db[_0x9e40('0x2d')]['findAll'](_0x46560e);})[_0x9e40('0x27')](function(_0x19b9b0){_0x2dcbc3[_0x9e40('0x43')]=_0x19b9b0;return _0x2dcbc3;})[_0x9e40('0x27')](respondWithFilteredResult(_0x37957b,_0x46560e))[_0x9e40('0x44')](handleError(_0x37957b,null));};exports[_0x9e40('0x45')]=function(_0x57618f,_0x4e84e6){var _0x9b70bf={'raw':!![],'where':{'id':_0x57618f[_0x9e40('0x46')]['id']}},_0x52d3df={};_0x52d3df[_0x9e40('0x30')]=_[_0x9e40('0x32')](db[_0x9e40('0x2d')][_0x9e40('0x2e')]);_0x52d3df['query']=_[_0x9e40('0x32')](_0x57618f['query']);_0x52d3df[_0x9e40('0x33')]=_[_0x9e40('0x34')](_0x52d3df[_0x9e40('0x30')],_0x52d3df[_0x9e40('0x31')]);_0x9b70bf[_0x9e40('0x36')]=_[_0x9e40('0x34')](_0x52d3df[_0x9e40('0x30')],qs[_0x9e40('0x35')](_0x57618f[_0x9e40('0x31')]['fields']));_0x9b70bf[_0x9e40('0x36')]=_0x9b70bf[_0x9e40('0x36')][_0x9e40('0x37')]?_0x9b70bf[_0x9e40('0x36')]:_0x52d3df['model'];if(_0x57618f['query']['includeAll']){_0x9b70bf[_0x9e40('0x42')]=[{'all':!![]}];}_0x9b70bf=_[_0x9e40('0x3d')]({},_0x9b70bf,_0x57618f[_0x9e40('0x47')]);return db[_0x9e40('0x2d')][_0x9e40('0x48')](_0x9b70bf)[_0x9e40('0x27')](handleEntityNotFound(_0x4e84e6,null))[_0x9e40('0x27')](respondWithResult(_0x4e84e6,null))[_0x9e40('0x44')](handleError(_0x4e84e6,null));};exports['create']=function(_0x1a5b60,_0x5cb4ff){return db[_0x9e40('0x2d')]['create'](_0x1a5b60[_0x9e40('0x49')],{})[_0x9e40('0x27')](respondWithResult(_0x5cb4ff,0xc9))[_0x9e40('0x44')](handleError(_0x5cb4ff,null));};exports['update']=function(_0x38b2ec,_0x43addc){if(_0x38b2ec[_0x9e40('0x49')]['id']){delete _0x38b2ec[_0x9e40('0x49')]['id'];}return db['SquareReport'][_0x9e40('0x48')]({'where':{'id':_0x38b2ec[_0x9e40('0x46')]['id']}})[_0x9e40('0x27')](handleEntityNotFound(_0x43addc,null))['then'](saveUpdates(_0x38b2ec[_0x9e40('0x49')],null))[_0x9e40('0x27')](respondWithResult(_0x43addc,null))[_0x9e40('0x44')](handleError(_0x43addc,null));};exports['destroy']=function(_0x3b467f,_0x4c5f1c){return db['SquareReport'][_0x9e40('0x48')]({'where':{'id':_0x3b467f[_0x9e40('0x46')]['id']}})[_0x9e40('0x27')](handleEntityNotFound(_0x4c5f1c,null))[_0x9e40('0x27')](removeEntity(_0x4c5f1c,null))['catch'](handleError(_0x4c5f1c,null));};exports[_0x9e40('0x4a')]=function(_0x29a3a7,_0x1901bf){return db[_0x9e40('0x2d')]['describe']()[_0x9e40('0x27')](respondWithResult(_0x1901bf,null))[_0x9e40('0x44')](handleError(_0x1901bf,null));}; \ No newline at end of file +var _0x2809=['crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','error','name','send','index','map','SquareReport','fieldName','type','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','fs-extra','lodash','squel'];(function(_0x19a69d,_0x345f2d){var _0xeac164=function(_0x3d1c63){while(--_0x3d1c63){_0x19a69d['push'](_0x19a69d['shift']());}};_0xeac164(++_0x345f2d);}(_0x2809,0xd2));var _0x9280=function(_0x2d2ec8,_0x3f04b1){_0x2d2ec8=_0x2d2ec8-0x0;var _0x30e4e9=_0x2809[_0x2d2ec8];return _0x30e4e9;};'use strict';var emlformat=require(_0x9280('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9280('0x1'));var jsonpatch=require(_0x9280('0x2'));var rp=require(_0x9280('0x3'));var moment=require('moment');var BPromise=require(_0x9280('0x4'));var Mustache=require(_0x9280('0x5'));var util=require(_0x9280('0x6'));var path=require(_0x9280('0x7'));var sox=require(_0x9280('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9280('0x9'));var _=require(_0x9280('0xa'));var squel=require(_0x9280('0xb'));var crypto=require(_0x9280('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x9280('0xd'));var toCsv=require(_0x9280('0xe'));var querystring=require(_0x9280('0xf'));var Papa=require(_0x9280('0x10'));var Redis=require(_0x9280('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x9280('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9280('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x9280('0x14'));var config=require(_0x9280('0x15'));var licenseUtil=require(_0x9280('0x16'));var db=require(_0x9280('0x17'))['db'];function respondWithStatusCode(_0x3e2369,_0x1b5fc1){_0x1b5fc1=_0x1b5fc1||0xcc;return function(_0x48dcb0){if(_0x48dcb0){return _0x3e2369[_0x9280('0x18')](_0x1b5fc1);}return _0x3e2369[_0x9280('0x19')](_0x1b5fc1)[_0x9280('0x1a')]();};}function respondWithResult(_0x56e8f4,_0x1830b8){_0x1830b8=_0x1830b8||0xc8;return function(_0x527022){if(_0x527022){return _0x56e8f4[_0x9280('0x19')](_0x1830b8)[_0x9280('0x1b')](_0x527022);}};}function respondWithFilteredResult(_0x987237,_0x50c3b1){return function(_0x5ddb89){if(_0x5ddb89){var _0x47cd9d=typeof _0x50c3b1[_0x9280('0x1c')]===_0x9280('0x1d')&&typeof _0x50c3b1[_0x9280('0x1e')]===_0x9280('0x1d');var _0xd63d39=_0x5ddb89[_0x9280('0x1f')];var _0x1ce97f=_0x47cd9d?0x0:_0x50c3b1[_0x9280('0x1c')];var _0x2abd68=_0x47cd9d?_0x5ddb89[_0x9280('0x1f')]:_0x50c3b1['offset']+_0x50c3b1[_0x9280('0x1e')];var _0x4a2510;if(_0x2abd68>=_0xd63d39){_0x2abd68=_0xd63d39;_0x4a2510=0xc8;}else{_0x4a2510=0xce;}_0x987237[_0x9280('0x19')](_0x4a2510);return _0x987237[_0x9280('0x20')](_0x9280('0x21'),_0x1ce97f+'-'+_0x2abd68+'/'+_0xd63d39)[_0x9280('0x1b')](_0x5ddb89);}return null;};}function patchUpdates(_0x7f54c3){return function(_0x8e1489){try{jsonpatch['apply'](_0x8e1489,_0x7f54c3,!![]);}catch(_0x2e1c88){return BPromise[_0x9280('0x22')](_0x2e1c88);}return _0x8e1489[_0x9280('0x23')]();};}function saveUpdates(_0x435384,_0x48b119){return function(_0x38c66f){if(_0x38c66f){return _0x38c66f[_0x9280('0x24')](_0x435384)[_0x9280('0x25')](function(_0x59cafb){return _0x59cafb;});}return null;};}function removeEntity(_0x151c7f,_0x44fdd3){return function(_0x218401){if(_0x218401){return _0x218401['destroy']()[_0x9280('0x25')](function(){_0x151c7f['status'](0xcc)[_0x9280('0x1a')]();});}};}function handleEntityNotFound(_0x596a2d,_0x5653b4){return function(_0xfd4ab9){if(!_0xfd4ab9){_0x596a2d[_0x9280('0x18')](0x194);}return _0xfd4ab9;};}function handleError(_0x225d6d,_0x3bd113){_0x3bd113=_0x3bd113||0x1f4;return function(_0x26e356){logger[_0x9280('0x26')](_0x26e356['stack']);if(_0x26e356['name']){delete _0x26e356[_0x9280('0x27')];}_0x225d6d['status'](_0x3bd113)[_0x9280('0x28')](_0x26e356);};}exports[_0x9280('0x29')]=function(_0x8ee413,_0x551b95){var _0x22ffad={},_0x394894={},_0x134c0c={'count':0x0,'rows':[]};var _0x141242=_[_0x9280('0x2a')](db[_0x9280('0x2b')]['rawAttributes'],function(_0x3f590b){return{'name':_0x3f590b[_0x9280('0x2c')],'type':_0x3f590b[_0x9280('0x2d')][_0x9280('0x2e')]};});_0x394894['model']=_[_0x9280('0x2a')](_0x141242,_0x9280('0x27'));_0x394894[_0x9280('0x2f')]=_['keys'](_0x8ee413['query']);_0x394894[_0x9280('0x30')]=_[_0x9280('0x31')](_0x394894[_0x9280('0x32')],_0x394894[_0x9280('0x2f')]);_0x22ffad[_0x9280('0x33')]=_[_0x9280('0x31')](_0x394894[_0x9280('0x32')],qs[_0x9280('0x34')](_0x8ee413[_0x9280('0x2f')][_0x9280('0x34')]));_0x22ffad[_0x9280('0x33')]=_0x22ffad[_0x9280('0x33')][_0x9280('0x35')]?_0x22ffad[_0x9280('0x33')]:_0x394894[_0x9280('0x32')];if(!_0x8ee413[_0x9280('0x2f')][_0x9280('0x36')](_0x9280('0x37'))){_0x22ffad[_0x9280('0x1e')]=qs['limit'](_0x8ee413['query'][_0x9280('0x1e')]);_0x22ffad['offset']=qs[_0x9280('0x1c')](_0x8ee413[_0x9280('0x2f')][_0x9280('0x1c')]);}_0x22ffad[_0x9280('0x38')]=qs['sort'](_0x8ee413[_0x9280('0x2f')][_0x9280('0x39')]);_0x22ffad[_0x9280('0x3a')]=qs[_0x9280('0x30')](_[_0x9280('0x3b')](_0x8ee413[_0x9280('0x2f')],_0x394894[_0x9280('0x30')]),_0x141242);if(_0x8ee413[_0x9280('0x2f')][_0x9280('0x3c')]){_0x22ffad[_0x9280('0x3a')]=_[_0x9280('0x3d')](_0x22ffad['where'],{'$or':_[_0x9280('0x2a')](_0x141242,function(_0x1116ba){if(_0x1116ba['type']!==_0x9280('0x3e')){var _0x1d57f9={};_0x1d57f9[_0x1116ba[_0x9280('0x27')]]={'$like':'%'+_0x8ee413[_0x9280('0x2f')][_0x9280('0x3c')]+'%'};return _0x1d57f9;}})});}_0x22ffad=_['merge']({},_0x22ffad,_0x8ee413[_0x9280('0x3f')]);var _0x5b10c6={'where':_0x22ffad[_0x9280('0x3a')]};return db[_0x9280('0x2b')][_0x9280('0x1f')](_0x5b10c6)[_0x9280('0x25')](function(_0x5202e5){_0x134c0c[_0x9280('0x1f')]=_0x5202e5;if(_0x8ee413['query'][_0x9280('0x40')]){_0x22ffad[_0x9280('0x41')]=[{'all':!![]}];}return db['SquareReport'][_0x9280('0x42')](_0x22ffad);})[_0x9280('0x25')](function(_0x2fbc92){_0x134c0c[_0x9280('0x43')]=_0x2fbc92;return _0x134c0c;})[_0x9280('0x25')](respondWithFilteredResult(_0x551b95,_0x22ffad))[_0x9280('0x44')](handleError(_0x551b95,null));};exports[_0x9280('0x45')]=function(_0x1ed6b7,_0x27dd81){var _0x133d97={'raw':!![],'where':{'id':_0x1ed6b7[_0x9280('0x46')]['id']}},_0x3cfd4a={};_0x3cfd4a[_0x9280('0x32')]=_['keys'](db[_0x9280('0x2b')]['rawAttributes']);_0x3cfd4a[_0x9280('0x2f')]=_[_0x9280('0x47')](_0x1ed6b7['query']);_0x3cfd4a['filters']=_[_0x9280('0x31')](_0x3cfd4a[_0x9280('0x32')],_0x3cfd4a[_0x9280('0x2f')]);_0x133d97['attributes']=_[_0x9280('0x31')](_0x3cfd4a[_0x9280('0x32')],qs['fields'](_0x1ed6b7[_0x9280('0x2f')]['fields']));_0x133d97[_0x9280('0x33')]=_0x133d97['attributes']['length']?_0x133d97[_0x9280('0x33')]:_0x3cfd4a[_0x9280('0x32')];if(_0x1ed6b7['query'][_0x9280('0x40')]){_0x133d97['include']=[{'all':!![]}];}_0x133d97=_[_0x9280('0x3d')]({},_0x133d97,_0x1ed6b7['options']);return db['SquareReport']['find'](_0x133d97)[_0x9280('0x25')](handleEntityNotFound(_0x27dd81,null))[_0x9280('0x25')](respondWithResult(_0x27dd81,null))['catch'](handleError(_0x27dd81,null));};exports['create']=function(_0x5500e5,_0x4cc886){return db[_0x9280('0x2b')]['create'](_0x5500e5['body'],{})['then'](respondWithResult(_0x4cc886,0xc9))[_0x9280('0x44')](handleError(_0x4cc886,null));};exports[_0x9280('0x24')]=function(_0x1a809c,_0x25fc3f){if(_0x1a809c[_0x9280('0x48')]['id']){delete _0x1a809c['body']['id'];}return db[_0x9280('0x2b')]['find']({'where':{'id':_0x1a809c[_0x9280('0x46')]['id']}})[_0x9280('0x25')](handleEntityNotFound(_0x25fc3f,null))[_0x9280('0x25')](saveUpdates(_0x1a809c[_0x9280('0x48')],null))[_0x9280('0x25')](respondWithResult(_0x25fc3f,null))['catch'](handleError(_0x25fc3f,null));};exports['destroy']=function(_0x3dc964,_0x2b034a){return db['SquareReport']['find']({'where':{'id':_0x3dc964['params']['id']}})[_0x9280('0x25')](handleEntityNotFound(_0x2b034a,null))[_0x9280('0x25')](removeEntity(_0x2b034a,null))[_0x9280('0x44')](handleError(_0x2b034a,null));};exports[_0x9280('0x49')]=function(_0x4293c9,_0x1f2c02){return db['SquareReport'][_0x9280('0x49')]()[_0x9280('0x25')](respondWithResult(_0x1f2c02,null))['catch'](handleError(_0x1f2c02,null));}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.model.js b/server/api/squareReport/squareReport.model.js index db83f73..9800ae4 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 _0xee1d=['util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./squareReport.attributes','exports','SquareReport','report_square','uniqueid','project_name','leaveAt','lodash'];(function(_0x92b755,_0x38e2fe){var _0x2ec69b=function(_0x21c971){while(--_0x21c971){_0x92b755['push'](_0x92b755['shift']());}};_0x2ec69b(++_0x38e2fe);}(_0xee1d,0x7f));var _0xdee1=function(_0x9e276d,_0x551dc4){_0x9e276d=_0x9e276d-0x0;var _0x35e4c4=_0xee1d[_0x9e276d];return _0x35e4c4;};'use strict';var _=require(_0xdee1('0x0'));var util=require(_0xdee1('0x1'));var logger=require(_0xdee1('0x2'))(_0xdee1('0x3'));var moment=require(_0xdee1('0x4'));var BPromise=require('bluebird');var rp=require(_0xdee1('0x5'));var fs=require('fs');var path=require(_0xdee1('0x6'));var rimraf=require(_0xdee1('0x7'));var config=require(_0xdee1('0x8'));var attributes=require(_0xdee1('0x9'));module[_0xdee1('0xa')]=function(_0x31f8de,_0x17c254){return _0x31f8de['define'](_0xdee1('0xb'),attributes,{'tableName':_0xdee1('0xc'),'paranoid':![],'indexes':[{'name':'uid_pname','fields':[_0xdee1('0xd'),_0xdee1('0xe')]},{'name':_0xdee1('0xf'),'fields':[_0xdee1('0xf')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xed96=['rimraf','./squareReport.attributes','exports','SquareReport','uid_pname','leaveAt','lodash','../../config/logger','api','bluebird','request-promise'];(function(_0x263028,_0x47605b){var _0x1d35ab=function(_0x5c3f59){while(--_0x5c3f59){_0x263028['push'](_0x263028['shift']());}};_0x1d35ab(++_0x47605b);}(_0xed96,0x103));var _0x6ed9=function(_0x3d4fc3,_0x4c1d67){_0x3d4fc3=_0x3d4fc3-0x0;var _0x1d0b82=_0xed96[_0x3d4fc3];return _0x1d0b82;};'use strict';var _=require(_0x6ed9('0x0'));var util=require('util');var logger=require(_0x6ed9('0x1'))(_0x6ed9('0x2'));var moment=require('moment');var BPromise=require(_0x6ed9('0x3'));var rp=require(_0x6ed9('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6ed9('0x5'));var config=require('../../config/environment');var attributes=require(_0x6ed9('0x6'));module[_0x6ed9('0x7')]=function(_0x18df04,_0x546a19){return _0x18df04['define'](_0x6ed9('0x8'),attributes,{'tableName':'report_square','paranoid':![],'indexes':[{'name':_0x6ed9('0x9'),'fields':['uniqueid','project_name']},{'name':_0x6ed9('0xa'),'fields':[_0x6ed9('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.rpc.js b/server/api/squareReport/squareReport.rpc.js index c7553c4..1aefbc6 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 _0x26e8=['SquareReport,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','CreateSquareReport','SquareReport','create','body','options','raw','then','debug','UpdateSquareReport','update','where','attributes','limit','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','jayson/promise','client','http','request','info'];(function(_0x3b016f,_0x437023){var _0x284f4b=function(_0x1c7f5d){while(--_0x1c7f5d){_0x3b016f['push'](_0x3b016f['shift']());}};_0x284f4b(++_0x437023);}(_0x26e8,0x194));var _0x826e=function(_0x5c8428,_0x52f340){_0x5c8428=_0x5c8428-0x0;var _0x194282=_0x26e8[_0x5c8428];return _0x194282;};'use strict';var _=require(_0x826e('0x0'));var util=require(_0x826e('0x1'));var moment=require('moment');var BPromise=require(_0x826e('0x2'));var rs=require(_0x826e('0x3'));var fs=require('fs');var Redis=require(_0x826e('0x4'));var db=require(_0x826e('0x5'))['db'];var utils=require(_0x826e('0x6'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x826e('0x7'));var client=jayson[_0x826e('0x8')][_0x826e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x9cac61,_0x3e6a86,_0x3cfc4d){return new BPromise(function(_0x48a9ef,_0x2584f7){return client[_0x826e('0xa')](_0x9cac61,_0x3cfc4d)['then'](function(_0x490691){logger[_0x826e('0xb')](_0x826e('0xc'),_0x3e6a86,_0x826e('0xd'));logger['debug']('SquareReport,\x20%s,\x20%s,\x20%s',_0x3e6a86,_0x826e('0xd'),JSON[_0x826e('0xe')](_0x490691));if(_0x490691[_0x826e('0xf')]){if(_0x490691[_0x826e('0xf')]['code']===0x1f4){logger[_0x826e('0xf')](_0x826e('0xc'),_0x3e6a86,_0x490691[_0x826e('0xf')][_0x826e('0x10')]);return _0x2584f7(_0x490691[_0x826e('0xf')][_0x826e('0x10')]);}logger[_0x826e('0xf')](_0x826e('0xc'),_0x3e6a86,_0x490691[_0x826e('0xf')]['message']);return _0x48a9ef(_0x490691['error'][_0x826e('0x10')]);}else{logger[_0x826e('0xb')]('SquareReport,\x20%s,\x20%s',_0x3e6a86,_0x826e('0xd'));_0x48a9ef(_0x490691[_0x826e('0x11')][_0x826e('0x10')]);}})[_0x826e('0x12')](function(_0x32600e){logger['error'](_0x826e('0xc'),_0x3e6a86,_0x32600e);_0x2584f7(_0x32600e);});});}exports[_0x826e('0x13')]=function(_0x960fe4){var _0x1a7211=this;return new Promise(function(_0x519577,_0x3a218b){return db[_0x826e('0x14')][_0x826e('0x15')](_0x960fe4[_0x826e('0x16')],{'raw':_0x960fe4[_0x826e('0x17')]?_0x960fe4[_0x826e('0x17')][_0x826e('0x18')]===undefined?!![]:![]:!![]})[_0x826e('0x19')](function(_0x1b2d93){logger[_0x826e('0xb')]('CreateSquareReport',_0x960fe4);logger[_0x826e('0x1a')](_0x826e('0x13'),_0x960fe4,JSON[_0x826e('0xe')](_0x1b2d93));_0x519577(_0x1b2d93);})['catch'](function(_0xc56343){logger['error'](_0x826e('0x13'),_0xc56343['message'],_0x960fe4);_0x3a218b(_0x1a7211[_0x826e('0xf')](0x1f4,_0xc56343[_0x826e('0x10')]));});});};exports[_0x826e('0x1b')]=function(_0x43351d){var _0x19adc0=this;return new Promise(function(_0x973fce,_0x165cb9){return db[_0x826e('0x14')][_0x826e('0x1c')](_0x43351d[_0x826e('0x16')],{'raw':_0x43351d['options']?_0x43351d[_0x826e('0x17')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x43351d[_0x826e('0x17')]?_0x43351d[_0x826e('0x17')][_0x826e('0x1d')]||null:null,'attributes':_0x43351d[_0x826e('0x17')]?_0x43351d[_0x826e('0x17')][_0x826e('0x1e')]||null:null,'limit':_0x43351d[_0x826e('0x17')]?_0x43351d[_0x826e('0x17')][_0x826e('0x1f')]||null:null})['then'](function(_0x24e21f){logger[_0x826e('0xb')](_0x826e('0x1b'),_0x43351d);logger['debug']('UpdateSquareReport',_0x43351d,JSON[_0x826e('0xe')](_0x24e21f));_0x973fce(_0x24e21f);})[_0x826e('0x12')](function(_0x13a226){logger[_0x826e('0xf')](_0x826e('0x1b'),_0x13a226[_0x826e('0x10')],_0x43351d);_0x165cb9(_0x19adc0[_0x826e('0xf')](0x1f4,_0x13a226['message']));});});}; \ No newline at end of file +var _0x5664=['update','where','attributes','UpdateSquareReport','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','info','SquareReport,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','CreateSquareReport','SquareReport','create','body','options','raw','then','debug','stringify'];(function(_0x349367,_0x1cede2){var _0x14179b=function(_0x38a191){while(--_0x38a191){_0x349367['push'](_0x349367['shift']());}};_0x14179b(++_0x1cede2);}(_0x5664,0x95));var _0x4566=function(_0x506d83,_0x1899e9){_0x506d83=_0x506d83-0x0;var _0x335e8b=_0x5664[_0x506d83];return _0x335e8b;};'use strict';var _=require('lodash');var util=require(_0x4566('0x0'));var moment=require(_0x4566('0x1'));var BPromise=require(_0x4566('0x2'));var rs=require(_0x4566('0x3'));var fs=require('fs');var Redis=require(_0x4566('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x4566('0x5'))(_0x4566('0x6'));var config=require(_0x4566('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x58e19c,_0x593613,_0x45660e){return new BPromise(function(_0x1b0de1,_0x4e85db){return client['request'](_0x58e19c,_0x45660e)['then'](function(_0x71b9f6){logger[_0x4566('0x8')](_0x4566('0x9'),_0x593613,_0x4566('0xa'));logger['debug']('SquareReport,\x20%s,\x20%s,\x20%s',_0x593613,_0x4566('0xa'),JSON['stringify'](_0x71b9f6));if(_0x71b9f6[_0x4566('0xb')]){if(_0x71b9f6[_0x4566('0xb')][_0x4566('0xc')]===0x1f4){logger['error'](_0x4566('0x9'),_0x593613,_0x71b9f6[_0x4566('0xb')][_0x4566('0xd')]);return _0x4e85db(_0x71b9f6[_0x4566('0xb')][_0x4566('0xd')]);}logger[_0x4566('0xb')]('SquareReport,\x20%s,\x20%s',_0x593613,_0x71b9f6[_0x4566('0xb')][_0x4566('0xd')]);return _0x1b0de1(_0x71b9f6[_0x4566('0xb')][_0x4566('0xd')]);}else{logger[_0x4566('0x8')](_0x4566('0x9'),_0x593613,_0x4566('0xa'));_0x1b0de1(_0x71b9f6[_0x4566('0xe')][_0x4566('0xd')]);}})[_0x4566('0xf')](function(_0x5d4ec5){logger['error'](_0x4566('0x9'),_0x593613,_0x5d4ec5);_0x4e85db(_0x5d4ec5);});});}exports[_0x4566('0x10')]=function(_0xdb4b0){var _0x84115d=this;return new Promise(function(_0x5e4f1d,_0x3d52f0){return db[_0x4566('0x11')][_0x4566('0x12')](_0xdb4b0[_0x4566('0x13')],{'raw':_0xdb4b0[_0x4566('0x14')]?_0xdb4b0[_0x4566('0x14')][_0x4566('0x15')]===undefined?!![]:![]:!![]})[_0x4566('0x16')](function(_0x4e60bd){logger[_0x4566('0x8')](_0x4566('0x10'),_0xdb4b0);logger[_0x4566('0x17')](_0x4566('0x10'),_0xdb4b0,JSON[_0x4566('0x18')](_0x4e60bd));_0x5e4f1d(_0x4e60bd);})[_0x4566('0xf')](function(_0x29ef07){logger[_0x4566('0xb')](_0x4566('0x10'),_0x29ef07[_0x4566('0xd')],_0xdb4b0);_0x3d52f0(_0x84115d[_0x4566('0xb')](0x1f4,_0x29ef07[_0x4566('0xd')]));});});};exports['UpdateSquareReport']=function(_0x19f58a){var _0x2f1c1b=this;return new Promise(function(_0x1702ac,_0xfc3c45){return db['SquareReport'][_0x4566('0x19')](_0x19f58a[_0x4566('0x13')],{'raw':_0x19f58a[_0x4566('0x14')]?_0x19f58a[_0x4566('0x14')][_0x4566('0x15')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x19f58a['options']?_0x19f58a[_0x4566('0x14')][_0x4566('0x1a')]||null:null,'attributes':_0x19f58a['options']?_0x19f58a[_0x4566('0x14')][_0x4566('0x1b')]||null:null,'limit':_0x19f58a[_0x4566('0x14')]?_0x19f58a[_0x4566('0x14')]['limit']||null:null})[_0x4566('0x16')](function(_0x1b1783){logger[_0x4566('0x8')](_0x4566('0x1c'),_0x19f58a);logger[_0x4566('0x17')](_0x4566('0x1c'),_0x19f58a,JSON[_0x4566('0x18')](_0x1b1783));_0x1702ac(_0x1b1783);})[_0x4566('0xf')](function(_0x8d8147){logger[_0x4566('0xb')](_0x4566('0x1c'),_0x8d8147[_0x4566('0xd')],_0x19f58a);_0xfc3c45(_0x2f1c1b[_0x4566('0xb')](0x1f4,_0x8d8147['message']));});});}; \ No newline at end of file diff --git a/server/api/squareReportDetail/index.js b/server/api/squareReportDetail/index.js index 1b8ce08..676fc66 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 _0x8e5e=['isAuthenticated','/describe','describe','/:id','show','post','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./squareReportDetail.controller','get'];(function(_0x4cf517,_0x19ce93){var _0x3dcab4=function(_0x558949){while(--_0x558949){_0x4cf517['push'](_0x4cf517['shift']());}};_0x3dcab4(++_0x19ce93);}(_0x8e5e,0x79));var _0xe8e5=function(_0x16a14c,_0x2dbe5c){_0x16a14c=_0x16a14c-0x0;var _0x12d727=_0x8e5e[_0x16a14c];return _0x12d727;};'use strict';var multer=require(_0xe8e5('0x0'));var util=require(_0xe8e5('0x1'));var path=require(_0xe8e5('0x2'));var timeout=require(_0xe8e5('0x3'));var express=require(_0xe8e5('0x4'));var router=express[_0xe8e5('0x5')]();var fs_extra=require(_0xe8e5('0x6'));var auth=require(_0xe8e5('0x7'));var interaction=require(_0xe8e5('0x8'));var config=require('../../config/environment');var controller=require(_0xe8e5('0x9'));router[_0xe8e5('0xa')]('/',auth[_0xe8e5('0xb')](),controller['index']);router[_0xe8e5('0xa')](_0xe8e5('0xc'),auth[_0xe8e5('0xb')](),controller[_0xe8e5('0xd')]);router['get'](_0xe8e5('0xe'),auth[_0xe8e5('0xb')](),controller[_0xe8e5('0xf')]);router[_0xe8e5('0x10')]('/',auth[_0xe8e5('0xb')](),controller['create']);router[_0xe8e5('0x11')](_0xe8e5('0xe'),auth[_0xe8e5('0xb')](),controller[_0xe8e5('0x12')]);router[_0xe8e5('0x13')](_0xe8e5('0xe'),auth[_0xe8e5('0xb')](),controller[_0xe8e5('0x14')]);module[_0xe8e5('0x15')]=router; \ No newline at end of file +var _0xdacc=['../../config/environment','isAuthenticated','/describe','get','show','post','create','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x1532d8,_0xb18346){var _0x41f562=function(_0x32d1d5){while(--_0x32d1d5){_0x1532d8['push'](_0x1532d8['shift']());}};_0x41f562(++_0xb18346);}(_0xdacc,0x11b));var _0xcdac=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xdacc[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0xcdac('0x0'));var util=require(_0xcdac('0x1'));var path=require(_0xcdac('0x2'));var timeout=require(_0xcdac('0x3'));var express=require(_0xcdac('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xcdac('0x5'));var controller=require('./squareReportDetail.controller');router['get']('/',auth[_0xcdac('0x6')](),controller['index']);router['get'](_0xcdac('0x7'),auth[_0xcdac('0x6')](),controller['describe']);router[_0xcdac('0x8')]('/:id',auth['isAuthenticated'](),controller[_0xcdac('0x9')]);router[_0xcdac('0xa')]('/',auth[_0xcdac('0x6')](),controller[_0xcdac('0xb')]);router[_0xcdac('0xc')](_0xcdac('0xd'),auth[_0xcdac('0x6')](),controller[_0xcdac('0xe')]);router[_0xcdac('0xf')]('/:id',auth[_0xcdac('0x6')](),controller[_0xcdac('0x10')]);module[_0xcdac('0x11')]=router; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.attributes.js b/server/api/squareReportDetail/squareReportDetail.attributes.js index 3ca2810..ed1c41c 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 _0x70e1=['TEXT','sequelize','exports','STRING'];(function(_0x594e9d,_0x883433){var _0x2f4839=function(_0x28e1d4){while(--_0x28e1d4){_0x594e9d['push'](_0x594e9d['shift']());}};_0x2f4839(++_0x883433);}(_0x70e1,0x111));var _0x170e=function(_0x1f62c3,_0x1ff95b){_0x1f62c3=_0x1f62c3-0x0;var _0x385c1c=_0x70e1[_0x1f62c3];return _0x385c1c;};'use strict';var Sequelize=require(_0x170e('0x0'));module[_0x170e('0x1')]={'uniqueid':{'type':Sequelize[_0x170e('0x2')]},'node':{'type':Sequelize[_0x170e('0x2')]},'application':{'type':Sequelize[_0x170e('0x2')]},'data':{'type':Sequelize[_0x170e('0x3')]},'project_name':{'type':Sequelize[_0x170e('0x2')]},'callerid':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xf5cd=['STRING','sequelize'];(function(_0xbeca8d,_0x597fae){var _0x4cb4d8=function(_0x4b503a){while(--_0x4b503a){_0xbeca8d['push'](_0xbeca8d['shift']());}};_0x4cb4d8(++_0x597fae);}(_0xf5cd,0xc9));var _0xdf5c=function(_0x548483,_0x5e53ab){_0x548483=_0x548483-0x0;var _0x53afbd=_0xf5cd[_0x548483];return _0x53afbd;};'use strict';var Sequelize=require(_0xdf5c('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xdf5c('0x1')]},'node':{'type':Sequelize[_0xdf5c('0x1')]},'application':{'type':Sequelize['STRING']},'data':{'type':Sequelize['TEXT']},'project_name':{'type':Sequelize[_0xdf5c('0x1')]},'callerid':{'type':Sequelize[_0xdf5c('0x1')]}}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.controller.js b/server/api/squareReportDetail/squareReportDetail.controller.js index b907daf..7d9f81d 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 _0xb248=['json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','SquareDetailsReport','rawAttributes','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','params','find','catch','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','fs-extra','lodash','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status'];(function(_0x172747,_0x1732bd){var _0x509692=function(_0x448c56){while(--_0x448c56){_0x172747['push'](_0x172747['shift']());}};_0x509692(++_0x1732bd);}(_0xb248,0xc6));var _0x8b24=function(_0xb0f7c3,_0x4eae95){_0xb0f7c3=_0xb0f7c3-0x0;var _0x28ea68=_0xb248[_0xb0f7c3];return _0x28ea68;};'use strict';var emlformat=require(_0x8b24('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8b24('0x1'));var jsonpatch=require(_0x8b24('0x2'));var rp=require(_0x8b24('0x3'));var moment=require(_0x8b24('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x8b24('0x5'));var util=require(_0x8b24('0x6'));var path=require('path');var sox=require(_0x8b24('0x7'));var csv=require(_0x8b24('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8b24('0x9'));var _=require(_0x8b24('0xa'));var squel=require('squel');var crypto=require(_0x8b24('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x8b24('0xc'));var toCsv=require(_0x8b24('0x8'));var querystring=require(_0x8b24('0xd'));var Papa=require('papaparse');var Redis=require(_0x8b24('0xe'));var authService=require(_0x8b24('0xf'));var qs=require(_0x8b24('0x10'));var as=require(_0x8b24('0x11'));var hardwareService=require(_0x8b24('0x12'));var logger=require(_0x8b24('0x13'))(_0x8b24('0x14'));var utils=require(_0x8b24('0x15'));var config=require(_0x8b24('0x16'));var licenseUtil=require(_0x8b24('0x17'));var db=require(_0x8b24('0x18'))['db'];function respondWithStatusCode(_0x3d3450,_0x40c1e6){_0x40c1e6=_0x40c1e6||0xcc;return function(_0x40ea49){if(_0x40ea49){return _0x3d3450['sendStatus'](_0x40c1e6);}return _0x3d3450['status'](_0x40c1e6)[_0x8b24('0x19')]();};}function respondWithResult(_0x4433c0,_0xf92148){_0xf92148=_0xf92148||0xc8;return function(_0x32a451){if(_0x32a451){return _0x4433c0[_0x8b24('0x1a')](_0xf92148)[_0x8b24('0x1b')](_0x32a451);}};}function respondWithFilteredResult(_0x11d2ee,_0x3cd934){return function(_0x4e66ae){if(_0x4e66ae){var _0x5a5745=typeof _0x3cd934['offset']===_0x8b24('0x1c')&&typeof _0x3cd934['limit']==='undefined';var _0xafc423=_0x4e66ae[_0x8b24('0x1d')];var _0x527af7=_0x5a5745?0x0:_0x3cd934[_0x8b24('0x1e')];var _0x5e3c52=_0x5a5745?_0x4e66ae[_0x8b24('0x1d')]:_0x3cd934['offset']+_0x3cd934[_0x8b24('0x1f')];var _0x521f5c;if(_0x5e3c52>=_0xafc423){_0x5e3c52=_0xafc423;_0x521f5c=0xc8;}else{_0x521f5c=0xce;}_0x11d2ee[_0x8b24('0x1a')](_0x521f5c);return _0x11d2ee[_0x8b24('0x20')](_0x8b24('0x21'),_0x527af7+'-'+_0x5e3c52+'/'+_0xafc423)[_0x8b24('0x1b')](_0x4e66ae);}return null;};}function patchUpdates(_0x2a4f2d){return function(_0x44aae9){try{jsonpatch[_0x8b24('0x22')](_0x44aae9,_0x2a4f2d,!![]);}catch(_0x5c9c38){return BPromise[_0x8b24('0x23')](_0x5c9c38);}return _0x44aae9[_0x8b24('0x24')]();};}function saveUpdates(_0x4fff3c,_0xd9b96){return function(_0x13dd68){if(_0x13dd68){return _0x13dd68[_0x8b24('0x25')](_0x4fff3c)[_0x8b24('0x26')](function(_0x12a9f4){return _0x12a9f4;});}return null;};}function removeEntity(_0x10b721,_0x347591){return function(_0x3fddf8){if(_0x3fddf8){return _0x3fddf8[_0x8b24('0x27')]()[_0x8b24('0x26')](function(){_0x10b721[_0x8b24('0x1a')](0xcc)[_0x8b24('0x19')]();});}};}function handleEntityNotFound(_0x2cfb27,_0x3d541e){return function(_0x19600a){if(!_0x19600a){_0x2cfb27[_0x8b24('0x28')](0x194);}return _0x19600a;};}function handleError(_0x1fe79f,_0x1a62e9){_0x1a62e9=_0x1a62e9||0x1f4;return function(_0x44ee85){logger[_0x8b24('0x29')](_0x44ee85[_0x8b24('0x2a')]);if(_0x44ee85[_0x8b24('0x2b')]){delete _0x44ee85[_0x8b24('0x2b')];}_0x1fe79f[_0x8b24('0x1a')](_0x1a62e9)[_0x8b24('0x2c')](_0x44ee85);};}exports[_0x8b24('0x2d')]=function(_0x267f1e,_0x140a50){var _0x5d3958={},_0x36ff89={},_0x59d6e1={'count':0x0,'rows':[]};var _0xadbba0=_[_0x8b24('0x2e')](db[_0x8b24('0x2f')][_0x8b24('0x30')],function(_0x1ab949){return{'name':_0x1ab949['fieldName'],'type':_0x1ab949[_0x8b24('0x31')][_0x8b24('0x32')]};});_0x36ff89[_0x8b24('0x33')]=_['map'](_0xadbba0,'name');_0x36ff89['query']=_[_0x8b24('0x34')](_0x267f1e[_0x8b24('0x35')]);_0x36ff89[_0x8b24('0x36')]=_[_0x8b24('0x37')](_0x36ff89[_0x8b24('0x33')],_0x36ff89[_0x8b24('0x35')]);_0x5d3958[_0x8b24('0x38')]=_[_0x8b24('0x37')](_0x36ff89[_0x8b24('0x33')],qs['fields'](_0x267f1e[_0x8b24('0x35')][_0x8b24('0x39')]));_0x5d3958[_0x8b24('0x38')]=_0x5d3958['attributes'][_0x8b24('0x3a')]?_0x5d3958[_0x8b24('0x38')]:_0x36ff89[_0x8b24('0x33')];if(!_0x267f1e[_0x8b24('0x35')][_0x8b24('0x3b')](_0x8b24('0x3c'))){_0x5d3958[_0x8b24('0x1f')]=qs[_0x8b24('0x1f')](_0x267f1e[_0x8b24('0x35')]['limit']);_0x5d3958[_0x8b24('0x1e')]=qs[_0x8b24('0x1e')](_0x267f1e['query'][_0x8b24('0x1e')]);}_0x5d3958[_0x8b24('0x3d')]=qs['sort'](_0x267f1e[_0x8b24('0x35')][_0x8b24('0x3e')]);_0x5d3958[_0x8b24('0x3f')]=qs[_0x8b24('0x36')](_['pick'](_0x267f1e[_0x8b24('0x35')],_0x36ff89[_0x8b24('0x36')]),_0xadbba0);if(_0x267f1e[_0x8b24('0x35')][_0x8b24('0x40')]){_0x5d3958[_0x8b24('0x3f')]=_[_0x8b24('0x41')](_0x5d3958['where'],{'$or':_[_0x8b24('0x2e')](_0xadbba0,function(_0x30ef3e){if(_0x30ef3e[_0x8b24('0x31')]!==_0x8b24('0x42')){var _0x223faa={};_0x223faa[_0x30ef3e[_0x8b24('0x2b')]]={'$like':'%'+_0x267f1e[_0x8b24('0x35')][_0x8b24('0x40')]+'%'};return _0x223faa;}})});}_0x5d3958=_[_0x8b24('0x41')]({},_0x5d3958,_0x267f1e[_0x8b24('0x43')]);var _0x24f0d6={'where':_0x5d3958['where']};return db[_0x8b24('0x2f')]['count'](_0x24f0d6)[_0x8b24('0x26')](function(_0x6db741){_0x59d6e1[_0x8b24('0x1d')]=_0x6db741;if(_0x267f1e['query'][_0x8b24('0x44')]){_0x5d3958[_0x8b24('0x45')]=[{'all':!![]}];}return db[_0x8b24('0x2f')]['findAll'](_0x5d3958);})[_0x8b24('0x26')](function(_0x4f8da5){_0x59d6e1['rows']=_0x4f8da5;return _0x59d6e1;})[_0x8b24('0x26')](respondWithFilteredResult(_0x140a50,_0x5d3958))['catch'](handleError(_0x140a50,null));};exports['show']=function(_0x32d752,_0xd3f68){var _0x3ee117={'raw':!![],'where':{'id':_0x32d752[_0x8b24('0x46')]['id']}},_0x3c6dc2={};_0x3c6dc2[_0x8b24('0x33')]=_[_0x8b24('0x34')](db['SquareDetailsReport']['rawAttributes']);_0x3c6dc2[_0x8b24('0x35')]=_[_0x8b24('0x34')](_0x32d752[_0x8b24('0x35')]);_0x3c6dc2[_0x8b24('0x36')]=_['intersection'](_0x3c6dc2[_0x8b24('0x33')],_0x3c6dc2[_0x8b24('0x35')]);_0x3ee117[_0x8b24('0x38')]=_['intersection'](_0x3c6dc2[_0x8b24('0x33')],qs['fields'](_0x32d752[_0x8b24('0x35')][_0x8b24('0x39')]));_0x3ee117['attributes']=_0x3ee117[_0x8b24('0x38')][_0x8b24('0x3a')]?_0x3ee117[_0x8b24('0x38')]:_0x3c6dc2[_0x8b24('0x33')];if(_0x32d752[_0x8b24('0x35')][_0x8b24('0x44')]){_0x3ee117[_0x8b24('0x45')]=[{'all':!![]}];}_0x3ee117=_[_0x8b24('0x41')]({},_0x3ee117,_0x32d752[_0x8b24('0x43')]);return db[_0x8b24('0x2f')][_0x8b24('0x47')](_0x3ee117)[_0x8b24('0x26')](handleEntityNotFound(_0xd3f68,null))['then'](respondWithResult(_0xd3f68,null))[_0x8b24('0x48')](handleError(_0xd3f68,null));};exports['create']=function(_0x245a02,_0x43cd46){return db['SquareDetailsReport']['create'](_0x245a02[_0x8b24('0x49')],{})[_0x8b24('0x26')](respondWithResult(_0x43cd46,0xc9))[_0x8b24('0x48')](handleError(_0x43cd46,null));};exports[_0x8b24('0x25')]=function(_0x407b2f,_0x22619e){if(_0x407b2f[_0x8b24('0x49')]['id']){delete _0x407b2f[_0x8b24('0x49')]['id'];}return db['SquareDetailsReport']['find']({'where':{'id':_0x407b2f['params']['id']}})[_0x8b24('0x26')](handleEntityNotFound(_0x22619e,null))['then'](saveUpdates(_0x407b2f[_0x8b24('0x49')],null))[_0x8b24('0x26')](respondWithResult(_0x22619e,null))[_0x8b24('0x48')](handleError(_0x22619e,null));};exports[_0x8b24('0x27')]=function(_0x58a26d,_0x3bc90a){return db[_0x8b24('0x2f')][_0x8b24('0x47')]({'where':{'id':_0x58a26d[_0x8b24('0x46')]['id']}})[_0x8b24('0x26')](handleEntityNotFound(_0x3bc90a,null))[_0x8b24('0x26')](removeEntity(_0x3bc90a,null))[_0x8b24('0x48')](handleError(_0x3bc90a,null));};exports[_0x8b24('0x4a')]=function(_0x31fcf6,_0x2a03fc){return db[_0x8b24('0x2f')][_0x8b24('0x4a')]()[_0x8b24('0x26')](respondWithResult(_0x2a03fc,null))[_0x8b24('0x48')](handleError(_0x2a03fc,null));}; \ No newline at end of file +var _0x553f=['undefined','count','offset','limit','set','apply','reject','save','update','then','destroy','error','stack','name','send','map','SquareDetailsReport','fieldName','type','key','keys','query','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','VIRTUAL','filter','includeAll','include','findAll','rows','catch','params','rawAttributes','merge','options','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','to-csv','ejs','lodash','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json'];(function(_0xcfa2e0,_0x40dd3d){var _0x1dc2b1=function(_0x11eb89){while(--_0x11eb89){_0xcfa2e0['push'](_0xcfa2e0['shift']());}};_0x1dc2b1(++_0x40dd3d);}(_0x553f,0xc5));var _0xf553=function(_0x366c96,_0x1c12bb){_0x366c96=_0x366c96-0x0;var _0x1835ba=_0x553f[_0x366c96];return _0x1835ba;};'use strict';var emlformat=require(_0xf553('0x0'));var rimraf=require(_0xf553('0x1'));var zipdir=require(_0xf553('0x2'));var jsonpatch=require(_0xf553('0x3'));var rp=require(_0xf553('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xf553('0x5'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xf553('0x6'));var ejs=require(_0xf553('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf553('0x8'));var squel=require('squel');var crypto=require(_0xf553('0x9'));var jsforce=require(_0xf553('0xa'));var deskjs=require('desk.js');var toCsv=require(_0xf553('0x6'));var querystring=require('querystring');var Papa=require(_0xf553('0xb'));var Redis=require(_0xf553('0xc'));var authService=require(_0xf553('0xd'));var qs=require(_0xf553('0xe'));var as=require(_0xf553('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf553('0x10'))(_0xf553('0x11'));var utils=require(_0xf553('0x12'));var config=require(_0xf553('0x13'));var licenseUtil=require(_0xf553('0x14'));var db=require(_0xf553('0x15'))['db'];function respondWithStatusCode(_0x436d8e,_0x21b0f2){_0x21b0f2=_0x21b0f2||0xcc;return function(_0x28b462){if(_0x28b462){return _0x436d8e['sendStatus'](_0x21b0f2);}return _0x436d8e[_0xf553('0x16')](_0x21b0f2)[_0xf553('0x17')]();};}function respondWithResult(_0x2afcd4,_0x2843bf){_0x2843bf=_0x2843bf||0xc8;return function(_0x4d84bc){if(_0x4d84bc){return _0x2afcd4[_0xf553('0x16')](_0x2843bf)[_0xf553('0x18')](_0x4d84bc);}};}function respondWithFilteredResult(_0x44c11c,_0x3470fe){return function(_0x565ec9){if(_0x565ec9){var _0x4ef372=typeof _0x3470fe['offset']==='undefined'&&typeof _0x3470fe['limit']===_0xf553('0x19');var _0x579dbf=_0x565ec9[_0xf553('0x1a')];var _0x2e65eb=_0x4ef372?0x0:_0x3470fe[_0xf553('0x1b')];var _0xaf690b=_0x4ef372?_0x565ec9[_0xf553('0x1a')]:_0x3470fe['offset']+_0x3470fe[_0xf553('0x1c')];var _0x4f3c62;if(_0xaf690b>=_0x579dbf){_0xaf690b=_0x579dbf;_0x4f3c62=0xc8;}else{_0x4f3c62=0xce;}_0x44c11c[_0xf553('0x16')](_0x4f3c62);return _0x44c11c[_0xf553('0x1d')]('Content-Range',_0x2e65eb+'-'+_0xaf690b+'/'+_0x579dbf)[_0xf553('0x18')](_0x565ec9);}return null;};}function patchUpdates(_0x3ce7af){return function(_0x163390){try{jsonpatch[_0xf553('0x1e')](_0x163390,_0x3ce7af,!![]);}catch(_0x43d8e3){return BPromise[_0xf553('0x1f')](_0x43d8e3);}return _0x163390[_0xf553('0x20')]();};}function saveUpdates(_0x3ceea3,_0x4a52f9){return function(_0x3d9270){if(_0x3d9270){return _0x3d9270[_0xf553('0x21')](_0x3ceea3)[_0xf553('0x22')](function(_0x347dc4){return _0x347dc4;});}return null;};}function removeEntity(_0x105143,_0x14e8f9){return function(_0x4452ec){if(_0x4452ec){return _0x4452ec[_0xf553('0x23')]()['then'](function(){_0x105143[_0xf553('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x24adab,_0xa531fe){return function(_0x3a67cd){if(!_0x3a67cd){_0x24adab['sendStatus'](0x194);}return _0x3a67cd;};}function handleError(_0x556a6e,_0x1e7320){_0x1e7320=_0x1e7320||0x1f4;return function(_0x5d7466){logger[_0xf553('0x24')](_0x5d7466[_0xf553('0x25')]);if(_0x5d7466[_0xf553('0x26')]){delete _0x5d7466['name'];}_0x556a6e[_0xf553('0x16')](_0x1e7320)[_0xf553('0x27')](_0x5d7466);};}exports['index']=function(_0x4612cc,_0x1d4581){var _0x5e4c8c={},_0x3959b2={},_0x20e5ef={'count':0x0,'rows':[]};var _0xea8282=_[_0xf553('0x28')](db[_0xf553('0x29')]['rawAttributes'],function(_0x22def4){return{'name':_0x22def4[_0xf553('0x2a')],'type':_0x22def4[_0xf553('0x2b')][_0xf553('0x2c')]};});_0x3959b2['model']=_[_0xf553('0x28')](_0xea8282,'name');_0x3959b2['query']=_[_0xf553('0x2d')](_0x4612cc[_0xf553('0x2e')]);_0x3959b2['filters']=_[_0xf553('0x2f')](_0x3959b2['model'],_0x3959b2['query']);_0x5e4c8c['attributes']=_[_0xf553('0x2f')](_0x3959b2[_0xf553('0x30')],qs[_0xf553('0x31')](_0x4612cc[_0xf553('0x2e')]['fields']));_0x5e4c8c[_0xf553('0x32')]=_0x5e4c8c[_0xf553('0x32')][_0xf553('0x33')]?_0x5e4c8c[_0xf553('0x32')]:_0x3959b2[_0xf553('0x30')];if(!_0x4612cc[_0xf553('0x2e')][_0xf553('0x34')](_0xf553('0x35'))){_0x5e4c8c[_0xf553('0x1c')]=qs[_0xf553('0x1c')](_0x4612cc[_0xf553('0x2e')][_0xf553('0x1c')]);_0x5e4c8c['offset']=qs[_0xf553('0x1b')](_0x4612cc[_0xf553('0x2e')][_0xf553('0x1b')]);}_0x5e4c8c[_0xf553('0x36')]=qs[_0xf553('0x37')](_0x4612cc[_0xf553('0x2e')][_0xf553('0x37')]);_0x5e4c8c[_0xf553('0x38')]=qs[_0xf553('0x39')](_[_0xf553('0x3a')](_0x4612cc[_0xf553('0x2e')],_0x3959b2[_0xf553('0x39')]),_0xea8282);if(_0x4612cc[_0xf553('0x2e')]['filter']){_0x5e4c8c[_0xf553('0x38')]=_['merge'](_0x5e4c8c[_0xf553('0x38')],{'$or':_['map'](_0xea8282,function(_0x2e7e7e){if(_0x2e7e7e['type']!==_0xf553('0x3b')){var _0x72e0b8={};_0x72e0b8[_0x2e7e7e[_0xf553('0x26')]]={'$like':'%'+_0x4612cc[_0xf553('0x2e')][_0xf553('0x3c')]+'%'};return _0x72e0b8;}})});}_0x5e4c8c=_['merge']({},_0x5e4c8c,_0x4612cc['options']);var _0x400858={'where':_0x5e4c8c[_0xf553('0x38')]};return db[_0xf553('0x29')][_0xf553('0x1a')](_0x400858)[_0xf553('0x22')](function(_0xd38d4b){_0x20e5ef[_0xf553('0x1a')]=_0xd38d4b;if(_0x4612cc[_0xf553('0x2e')][_0xf553('0x3d')]){_0x5e4c8c[_0xf553('0x3e')]=[{'all':!![]}];}return db[_0xf553('0x29')][_0xf553('0x3f')](_0x5e4c8c);})[_0xf553('0x22')](function(_0x35607e){_0x20e5ef[_0xf553('0x40')]=_0x35607e;return _0x20e5ef;})[_0xf553('0x22')](respondWithFilteredResult(_0x1d4581,_0x5e4c8c))[_0xf553('0x41')](handleError(_0x1d4581,null));};exports['show']=function(_0x5195f4,_0x37cdb6){var _0x4693a5={'raw':!![],'where':{'id':_0x5195f4[_0xf553('0x42')]['id']}},_0x37f913={};_0x37f913[_0xf553('0x30')]=_[_0xf553('0x2d')](db[_0xf553('0x29')][_0xf553('0x43')]);_0x37f913[_0xf553('0x2e')]=_[_0xf553('0x2d')](_0x5195f4[_0xf553('0x2e')]);_0x37f913[_0xf553('0x39')]=_[_0xf553('0x2f')](_0x37f913[_0xf553('0x30')],_0x37f913[_0xf553('0x2e')]);_0x4693a5['attributes']=_['intersection'](_0x37f913[_0xf553('0x30')],qs[_0xf553('0x31')](_0x5195f4[_0xf553('0x2e')][_0xf553('0x31')]));_0x4693a5['attributes']=_0x4693a5['attributes'][_0xf553('0x33')]?_0x4693a5[_0xf553('0x32')]:_0x37f913[_0xf553('0x30')];if(_0x5195f4[_0xf553('0x2e')]['includeAll']){_0x4693a5['include']=[{'all':!![]}];}_0x4693a5=_[_0xf553('0x44')]({},_0x4693a5,_0x5195f4[_0xf553('0x45')]);return db['SquareDetailsReport'][_0xf553('0x46')](_0x4693a5)[_0xf553('0x22')](handleEntityNotFound(_0x37cdb6,null))[_0xf553('0x22')](respondWithResult(_0x37cdb6,null))[_0xf553('0x41')](handleError(_0x37cdb6,null));};exports['create']=function(_0x2d84e7,_0x2117ee){return db[_0xf553('0x29')][_0xf553('0x47')](_0x2d84e7[_0xf553('0x48')],{})[_0xf553('0x22')](respondWithResult(_0x2117ee,0xc9))['catch'](handleError(_0x2117ee,null));};exports['update']=function(_0x5a50ac,_0x2275c5){if(_0x5a50ac[_0xf553('0x48')]['id']){delete _0x5a50ac[_0xf553('0x48')]['id'];}return db[_0xf553('0x29')][_0xf553('0x46')]({'where':{'id':_0x5a50ac['params']['id']}})[_0xf553('0x22')](handleEntityNotFound(_0x2275c5,null))[_0xf553('0x22')](saveUpdates(_0x5a50ac[_0xf553('0x48')],null))['then'](respondWithResult(_0x2275c5,null))[_0xf553('0x41')](handleError(_0x2275c5,null));};exports[_0xf553('0x23')]=function(_0x5e6a88,_0x4f14a1){return db['SquareDetailsReport']['find']({'where':{'id':_0x5e6a88[_0xf553('0x42')]['id']}})[_0xf553('0x22')](handleEntityNotFound(_0x4f14a1,null))[_0xf553('0x22')](removeEntity(_0x4f14a1,null))['catch'](handleError(_0x4f14a1,null));};exports['describe']=function(_0x33a6d4,_0x2124a2){return db[_0xf553('0x29')][_0xf553('0x49')]()[_0xf553('0x22')](respondWithResult(_0x2124a2,null))[_0xf553('0x41')](handleError(_0x2124a2,null));}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.model.js b/server/api/squareReportDetail/squareReportDetail.model.js index 1a6a527..d912607 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 _0x15a5=['exports','SquareDetailsReport','report_square_details','lodash','util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./squareReportDetail.attributes'];(function(_0xbd08b4,_0x4790ed){var _0x314f1e=function(_0x161589){while(--_0x161589){_0xbd08b4['push'](_0xbd08b4['shift']());}};_0x314f1e(++_0x4790ed);}(_0x15a5,0x123));var _0x515a=function(_0xca6644,_0x14c4a3){_0xca6644=_0xca6644-0x0;var _0x151544=_0x15a5[_0xca6644];return _0x151544;};'use strict';var _=require(_0x515a('0x0'));var util=require(_0x515a('0x1'));var logger=require(_0x515a('0x2'))(_0x515a('0x3'));var moment=require(_0x515a('0x4'));var BPromise=require('bluebird');var rp=require(_0x515a('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x515a('0x6'));var config=require(_0x515a('0x7'));var attributes=require(_0x515a('0x8'));module[_0x515a('0x9')]=function(_0x443d49,_0x2ee353){return _0x443d49['define'](_0x515a('0xa'),attributes,{'tableName':_0x515a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8006=['request-promise','rimraf','../../config/environment','exports','SquareDetailsReport','report_square_details','../../config/logger','api','moment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8006,0x10b));var _0x6800=function(_0x2078ee,_0x55d43f){_0x2078ee=_0x2078ee-0x0;var _0x46cb87=_0x8006[_0x2078ee];return _0x46cb87;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x6800('0x0'))(_0x6800('0x1'));var moment=require(_0x6800('0x2'));var BPromise=require('bluebird');var rp=require(_0x6800('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6800('0x4'));var config=require(_0x6800('0x5'));var attributes=require('./squareReportDetail.attributes');module[_0x6800('0x6')]=function(_0x34f38e,_0x26b8a0){return _0x34f38e['define'](_0x6800('0x7'),attributes,{'tableName':_0x6800('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 ff2707d..3616865 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 _0xb78e=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','info','SquareDetailsReport,\x20%s,\x20%s','request\x20sent','debug','SquareDetailsReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','CreateSquareDetailsReport','SquareDetailsReport','body','options','lodash','util'];(function(_0x3d0ae0,_0x53f417){var _0x4b0ae7=function(_0x4f324d){while(--_0x4f324d){_0x3d0ae0['push'](_0x3d0ae0['shift']());}};_0x4b0ae7(++_0x53f417);}(_0xb78e,0x1c9));var _0xeb78=function(_0x672f5a,_0x309026){_0x672f5a=_0x672f5a-0x0;var _0x5744a6=_0xb78e[_0x672f5a];return _0x5744a6;};'use strict';var _=require(_0xeb78('0x0'));var util=require(_0xeb78('0x1'));var moment=require('moment');var BPromise=require(_0xeb78('0x2'));var rs=require(_0xeb78('0x3'));var fs=require('fs');var Redis=require(_0xeb78('0x4'));var db=require(_0xeb78('0x5'))['db'];var utils=require(_0xeb78('0x6'));var logger=require(_0xeb78('0x7'))(_0xeb78('0x8'));var config=require(_0xeb78('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xeb78('0xa')][_0xeb78('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1ccc2f,_0x30c884,_0x2b7925){return new BPromise(function(_0x36963f,_0x5259aa){return client['request'](_0x1ccc2f,_0x2b7925)[_0xeb78('0xc')](function(_0x1c941d){logger[_0xeb78('0xd')](_0xeb78('0xe'),_0x30c884,_0xeb78('0xf'));logger[_0xeb78('0x10')](_0xeb78('0x11'),_0x30c884,_0xeb78('0xf'),JSON[_0xeb78('0x12')](_0x1c941d));if(_0x1c941d['error']){if(_0x1c941d[_0xeb78('0x13')][_0xeb78('0x14')]===0x1f4){logger[_0xeb78('0x13')](_0xeb78('0xe'),_0x30c884,_0x1c941d[_0xeb78('0x13')][_0xeb78('0x15')]);return _0x5259aa(_0x1c941d[_0xeb78('0x13')][_0xeb78('0x15')]);}logger[_0xeb78('0x13')](_0xeb78('0xe'),_0x30c884,_0x1c941d['error'][_0xeb78('0x15')]);return _0x36963f(_0x1c941d[_0xeb78('0x13')]['message']);}else{logger['info']('SquareDetailsReport,\x20%s,\x20%s',_0x30c884,_0xeb78('0xf'));_0x36963f(_0x1c941d['result'][_0xeb78('0x15')]);}})[_0xeb78('0x16')](function(_0x49123d){logger[_0xeb78('0x13')]('SquareDetailsReport,\x20%s,\x20%s',_0x30c884,_0x49123d);_0x5259aa(_0x49123d);});});}exports[_0xeb78('0x17')]=function(_0x92e410){var _0x576802=this;return new Promise(function(_0x45176e,_0xb97756){return db[_0xeb78('0x18')]['create'](_0x92e410[_0xeb78('0x19')],{'raw':_0x92e410[_0xeb78('0x1a')]?_0x92e410['options']['raw']===undefined?!![]:![]:!![]})[_0xeb78('0xc')](function(_0x106c5d){logger[_0xeb78('0xd')](_0xeb78('0x17'),_0x92e410);logger[_0xeb78('0x10')](_0xeb78('0x17'),_0x92e410,JSON[_0xeb78('0x12')](_0x106c5d));_0x45176e(_0x106c5d);})[_0xeb78('0x16')](function(_0x18f08d){logger['error']('CreateSquareDetailsReport',_0x18f08d['message'],_0x92e410);_0xb97756(_0x576802['error'](0x1f4,_0x18f08d[_0xeb78('0x15')]));});});}; \ No newline at end of file +var _0xa866=['client','request','then','info','request\x20sent','debug','SquareDetailsReport,\x20%s,\x20%s,\x20%s','stringify','error','SquareDetailsReport,\x20%s,\x20%s','message','result','catch','SquareDetailsReport','create','body','options','raw','CreateSquareDetailsReport','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise'];(function(_0x466257,_0x52229f){var _0x5a177a=function(_0xc837bd){while(--_0xc837bd){_0x466257['push'](_0x466257['shift']());}};_0x5a177a(++_0x52229f);}(_0xa866,0x6a));var _0x6a86=function(_0x2d518f,_0x1557f5){_0x2d518f=_0x2d518f-0x0;var _0x19a744=_0xa866[_0x2d518f];return _0x19a744;};'use strict';var _=require(_0x6a86('0x0'));var util=require(_0x6a86('0x1'));var moment=require(_0x6a86('0x2'));var BPromise=require(_0x6a86('0x3'));var rs=require(_0x6a86('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6a86('0x5'))['db'];var utils=require(_0x6a86('0x6'));var logger=require(_0x6a86('0x7'))('rpc');var config=require(_0x6a86('0x8'));var jayson=require(_0x6a86('0x9'));var client=jayson[_0x6a86('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x183997,_0x288910,_0x3ed589){return new BPromise(function(_0x1330e1,_0x37e3ee){return client[_0x6a86('0xb')](_0x183997,_0x3ed589)[_0x6a86('0xc')](function(_0x4a83c9){logger[_0x6a86('0xd')]('SquareDetailsReport,\x20%s,\x20%s',_0x288910,_0x6a86('0xe'));logger[_0x6a86('0xf')](_0x6a86('0x10'),_0x288910,'request\x20sent',JSON[_0x6a86('0x11')](_0x4a83c9));if(_0x4a83c9[_0x6a86('0x12')]){if(_0x4a83c9['error']['code']===0x1f4){logger[_0x6a86('0x12')](_0x6a86('0x13'),_0x288910,_0x4a83c9[_0x6a86('0x12')][_0x6a86('0x14')]);return _0x37e3ee(_0x4a83c9[_0x6a86('0x12')][_0x6a86('0x14')]);}logger[_0x6a86('0x12')](_0x6a86('0x13'),_0x288910,_0x4a83c9['error'][_0x6a86('0x14')]);return _0x1330e1(_0x4a83c9[_0x6a86('0x12')]['message']);}else{logger[_0x6a86('0xd')](_0x6a86('0x13'),_0x288910,_0x6a86('0xe'));_0x1330e1(_0x4a83c9[_0x6a86('0x15')][_0x6a86('0x14')]);}})[_0x6a86('0x16')](function(_0x500b59){logger[_0x6a86('0x12')](_0x6a86('0x13'),_0x288910,_0x500b59);_0x37e3ee(_0x500b59);});});}exports['CreateSquareDetailsReport']=function(_0x50024d){var _0x11fe3b=this;return new Promise(function(_0x535fd9,_0x588a2f){return db[_0x6a86('0x17')][_0x6a86('0x18')](_0x50024d[_0x6a86('0x19')],{'raw':_0x50024d['options']?_0x50024d[_0x6a86('0x1a')][_0x6a86('0x1b')]===undefined?!![]:![]:!![]})[_0x6a86('0xc')](function(_0x262bf5){logger[_0x6a86('0xd')](_0x6a86('0x1c'),_0x50024d);logger['debug']('CreateSquareDetailsReport',_0x50024d,JSON['stringify'](_0x262bf5));_0x535fd9(_0x262bf5);})[_0x6a86('0x16')](function(_0x2007c7){logger[_0x6a86('0x12')](_0x6a86('0x1c'),_0x2007c7['message'],_0x50024d);_0x588a2f(_0x11fe3b[_0x6a86('0x12')](0x1f4,_0x2007c7[_0x6a86('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/system/index.js b/server/api/system/index.js index 8dde475..e3dfbbe 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 _0xad2d=['isAuthenticated','index','/process/:pid/kill','killProcess','exports','express','get'];(function(_0x4d0c00,_0x4312b5){var _0xeb1f3=function(_0x28c954){while(--_0x28c954){_0x4d0c00['push'](_0x4d0c00['shift']());}};_0xeb1f3(++_0x4312b5);}(_0xad2d,0x19b));var _0xdad2=function(_0x5520b5,_0x4dbd45){_0x5520b5=_0x5520b5-0x0;var _0x33ee64=_0xad2d[_0x5520b5];return _0x33ee64;};'use strict';var express=require(_0xdad2('0x0'));var router=express['Router']();var auth=require('../../components/auth/service');var controller=require('./system.controller');router[_0xdad2('0x1')]('/',auth[_0xdad2('0x2')](),controller[_0xdad2('0x3')]);router['get'](_0xdad2('0x4'),auth[_0xdad2('0x2')](),controller[_0xdad2('0x5')]);module[_0xdad2('0x6')]=router; \ No newline at end of file +var _0x5f5e=['express','Router','../../components/auth/service','./system.controller','get','isAuthenticated','killProcess','exports'];(function(_0x5db315,_0x4c5461){var _0x1cfa82=function(_0x11fb8e){while(--_0x11fb8e){_0x5db315['push'](_0x5db315['shift']());}};_0x1cfa82(++_0x4c5461);}(_0x5f5e,0xf8));var _0xe5f5=function(_0x523b32,_0x10f5dd){_0x523b32=_0x523b32-0x0;var _0x377ac4=_0x5f5e[_0x523b32];return _0x377ac4;};'use strict';var express=require(_0xe5f5('0x0'));var router=express[_0xe5f5('0x1')]();var auth=require(_0xe5f5('0x2'));var controller=require(_0xe5f5('0x3'));router[_0xe5f5('0x4')]('/',auth[_0xe5f5('0x5')](),controller['index']);router[_0xe5f5('0x4')]('/process/:pid/kill',auth[_0xe5f5('0x5')](),controller[_0xe5f5('0x6')]);module[_0xe5f5('0x7')]=router; \ No newline at end of file diff --git a/server/api/system/system.controller.js b/server/api/system/system.controller.js index 47e700e..924134b 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 _0xf828=['Process\x20with\x20pid\x20%s\x20not\x20found!','pid','kill','systeminformation','child_process','exec','../../config/logger','util','bluebird','inspect','name','status','send','index','getAllData','then','json','catch','killProcess','components/import/cm','format','ps\x20-p\x20%s\x20-ww\x20-o\x20args','params','split','length'];(function(_0x4975b0,_0x3c250c){var _0x1fa9f7=function(_0x4b6047){while(--_0x4b6047){_0x4975b0['push'](_0x4975b0['shift']());}};_0x1fa9f7(++_0x3c250c);}(_0xf828,0x99));var _0x8f82=function(_0x3a8d60,_0xdf2b13){_0x3a8d60=_0x3a8d60-0x0;var _0xacf927=_0xf828[_0x3a8d60];return _0xacf927;};'use strict';var info=require(_0x8f82('0x0'));var exec=require(_0x8f82('0x1'))[_0x8f82('0x2')];var logger=require(_0x8f82('0x3'))('api');var util=require(_0x8f82('0x4'));var BPromise=require(_0x8f82('0x5'));var _=require('lodash');function handleError(_0x55fdca,_0x5ec71c,_0x4ad8d2){_0x5ec71c=_0x5ec71c||0x1f4;return function(_0x4db58d){logger['error']('<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s',_0x4ad8d2,_0x5ec71c,util[_0x8f82('0x6')](_0x4db58d,{'showHidden':![],'depth':null}));delete _0x4db58d[_0x8f82('0x7')];_0x55fdca[_0x8f82('0x8')](_0x5ec71c)[_0x8f82('0x9')](_0x4db58d);};}exports[_0x8f82('0xa')]=function(_0x299b20,_0x51310f){return info[_0x8f82('0xb')]()[_0x8f82('0xc')](function(_0x514f05){return _0x51310f[_0x8f82('0x8')](0xc8)[_0x8f82('0xd')](_0x514f05);})[_0x8f82('0xe')](function(_0x3352b4){return _0x51310f[_0x8f82('0x8')](0x1f4)[_0x8f82('0xd')](_0x3352b4);});};exports[_0x8f82('0xf')]=function(_0x5e59de,_0x4fc90d){var _0x3a38e0=[_0x8f82('0x10')];return new BPromise(function(_0x27c885,_0x13c4d4){return exec(util[_0x8f82('0x11')](_0x8f82('0x12'),_0x5e59de[_0x8f82('0x13')]['pid']),function(_0x434e9a,_0x24301d,_0x1c2a33){if(_0x434e9a){return _0x13c4d4(_0x434e9a);}return _0x27c885(_0x24301d);});})[_0x8f82('0xc')](function(_0x5552ea){var _0x5076d6=![];var _0x324861=_0x5552ea[_0x8f82('0x14')](/\n/);for(var _0x393284=0x0,_0x5bfb49=_0x3a38e0[_0x8f82('0x15')];_0x393284<_0x5bfb49,_0x5076d6===![];_0x393284+=0x1){if(_0x5552ea['indexOf'](_0x3a38e0[_0x393284])>=0x0){_0x5076d6=!![];}}if(!_0x5076d6){throw new Error(util[_0x8f82('0x11')](_0x8f82('0x16'),_0x5e59de[_0x8f82('0x13')][_0x8f82('0x17')]));}process[_0x8f82('0x18')](_0x5e59de[_0x8f82('0x13')][_0x8f82('0x17')],'SIGINT');return _0x4fc90d[_0x8f82('0x8')](0xc8)[_0x8f82('0xd')]({'message':util[_0x8f82('0x11')]('Process\x20with\x20pid\x20%s\x20killed\x20correctly',_0x5e59de['params'][_0x8f82('0x17')])});})['catch'](handleError(_0x4fc90d,null,_0x8f82('0xf')));}; \ No newline at end of file +var _0x28b7=['Process\x20with\x20pid\x20%s\x20not\x20found!','kill','Process\x20with\x20pid\x20%s\x20killed\x20correctly','systeminformation','child_process','exec','api','util','bluebird','lodash','error','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','inspect','name','send','then','status','json','catch','killProcess','ps\x20-p\x20%s\x20-ww\x20-o\x20args','params','pid','length','format'];(function(_0x5c1255,_0xe7aeff){var _0x1824d8=function(_0x3791f3){while(--_0x3791f3){_0x5c1255['push'](_0x5c1255['shift']());}};_0x1824d8(++_0xe7aeff);}(_0x28b7,0x99));var _0x728b=function(_0x441912,_0x46e1f2){_0x441912=_0x441912-0x0;var _0x4923e2=_0x28b7[_0x441912];return _0x4923e2;};'use strict';var info=require(_0x728b('0x0'));var exec=require(_0x728b('0x1'))[_0x728b('0x2')];var logger=require('../../config/logger')(_0x728b('0x3'));var util=require(_0x728b('0x4'));var BPromise=require(_0x728b('0x5'));var _=require(_0x728b('0x6'));function handleError(_0x4f6fbb,_0x42c773,_0x23501c){_0x42c773=_0x42c773||0x1f4;return function(_0x315c3e){logger[_0x728b('0x7')](_0x728b('0x8'),_0x23501c,_0x42c773,util[_0x728b('0x9')](_0x315c3e,{'showHidden':![],'depth':null}));delete _0x315c3e[_0x728b('0xa')];_0x4f6fbb['status'](_0x42c773)[_0x728b('0xb')](_0x315c3e);};}exports['index']=function(_0x1fde7c,_0x280ce5){return info['getAllData']()[_0x728b('0xc')](function(_0x2cb7c4){return _0x280ce5[_0x728b('0xd')](0xc8)[_0x728b('0xe')](_0x2cb7c4);})[_0x728b('0xf')](function(_0x3fbb6b){return _0x280ce5['status'](0x1f4)[_0x728b('0xe')](_0x3fbb6b);});};exports[_0x728b('0x10')]=function(_0x28231e,_0x49b87d){var _0x52fbc0=['components/import/cm'];return new BPromise(function(_0x48673b,_0x34c6b3){return exec(util['format'](_0x728b('0x11'),_0x28231e[_0x728b('0x12')][_0x728b('0x13')]),function(_0x1a38b8,_0xf451ca,_0x2f00a7){if(_0x1a38b8){return _0x34c6b3(_0x1a38b8);}return _0x48673b(_0xf451ca);});})[_0x728b('0xc')](function(_0x2dc954){var _0x4e4ee8=![];var _0x55a0ba=_0x2dc954['split'](/\n/);for(var _0x11c69e=0x0,_0x255a30=_0x52fbc0[_0x728b('0x14')];_0x11c69e<_0x255a30,_0x4e4ee8===![];_0x11c69e+=0x1){if(_0x2dc954['indexOf'](_0x52fbc0[_0x11c69e])>=0x0){_0x4e4ee8=!![];}}if(!_0x4e4ee8){throw new Error(util[_0x728b('0x15')](_0x728b('0x16'),_0x28231e[_0x728b('0x12')][_0x728b('0x13')]));}process[_0x728b('0x17')](_0x28231e[_0x728b('0x12')]['pid'],'SIGINT');return _0x49b87d['status'](0xc8)[_0x728b('0xe')]({'message':util['format'](_0x728b('0x18'),_0x28231e[_0x728b('0x12')][_0x728b('0x13')])});})['catch'](handleError(_0x49b87d,null,_0x728b('0x10')));}; \ No newline at end of file diff --git a/server/api/tag/index.js b/server/api/tag/index.js index 142e857..33713e4 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 _0xc54c=['multer','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','create','update','delete','destroy','exports'];(function(_0x344a3f,_0x579a22){var _0x264712=function(_0x34c9f0){while(--_0x34c9f0){_0x344a3f['push'](_0x344a3f['shift']());}};_0x264712(++_0x579a22);}(_0xc54c,0x1c2));var _0xcc54=function(_0x4c1ec2,_0x4f42b7){_0x4c1ec2=_0x4c1ec2-0x0;var _0x3f6f1c=_0xc54c[_0x4c1ec2];return _0x3f6f1c;};'use strict';var multer=require(_0xcc54('0x0'));var util=require('util');var path=require(_0xcc54('0x1'));var timeout=require('connect-timeout');var express=require(_0xcc54('0x2'));var router=express['Router']();var fs_extra=require(_0xcc54('0x3'));var auth=require(_0xcc54('0x4'));var interaction=require(_0xcc54('0x5'));var config=require(_0xcc54('0x6'));var controller=require('./tag.controller');router[_0xcc54('0x7')]('/',auth[_0xcc54('0x8')](),controller[_0xcc54('0x9')]);router['get'](_0xcc54('0xa'),auth[_0xcc54('0x8')](),controller[_0xcc54('0xb')]);router[_0xcc54('0xc')]('/',auth[_0xcc54('0x8')](),controller[_0xcc54('0xd')]);router['put'](_0xcc54('0xa'),auth[_0xcc54('0x8')](),controller[_0xcc54('0xe')]);router[_0xcc54('0xf')](_0xcc54('0xa'),auth[_0xcc54('0x8')](),controller[_0xcc54('0x10')]);module[_0xcc54('0x11')]=router; \ No newline at end of file +var _0xfed7=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','post','put','update','delete','destroy','exports'];(function(_0x2a6fd5,_0x3d6deb){var _0x43c6a4=function(_0x3aecb3){while(--_0x3aecb3){_0x2a6fd5['push'](_0x2a6fd5['shift']());}};_0x43c6a4(++_0x3d6deb);}(_0xfed7,0x190));var _0x7fed=function(_0x257642,_0x270a80){_0x257642=_0x257642-0x0;var _0x3d813b=_0xfed7[_0x257642];return _0x3d813b;};'use strict';var multer=require(_0x7fed('0x0'));var util=require(_0x7fed('0x1'));var path=require(_0x7fed('0x2'));var timeout=require(_0x7fed('0x3'));var express=require(_0x7fed('0x4'));var router=express[_0x7fed('0x5')]();var fs_extra=require(_0x7fed('0x6'));var auth=require(_0x7fed('0x7'));var interaction=require(_0x7fed('0x8'));var config=require(_0x7fed('0x9'));var controller=require('./tag.controller');router[_0x7fed('0xa')]('/',auth[_0x7fed('0xb')](),controller['index']);router['get'](_0x7fed('0xc'),auth[_0x7fed('0xb')](),controller[_0x7fed('0xd')]);router[_0x7fed('0xe')]('/',auth[_0x7fed('0xb')](),controller['create']);router[_0x7fed('0xf')](_0x7fed('0xc'),auth[_0x7fed('0xb')](),controller[_0x7fed('0x10')]);router[_0x7fed('0x11')]('/:id',auth[_0x7fed('0xb')](),controller[_0x7fed('0x12')]);module[_0x7fed('0x13')]=router; \ No newline at end of file diff --git a/server/api/tag/tag.attributes.js b/server/api/tag/tag.attributes.js index d8ff7cc..d87e815 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 _0x0972=['exports','name','#0091EA','STRING'];(function(_0x8baa0b,_0x24b3fa){var _0x5ebdb9=function(_0x372b7b){while(--_0x372b7b){_0x8baa0b['push'](_0x8baa0b['shift']());}};_0x5ebdb9(++_0x24b3fa);}(_0x0972,0x64));var _0x2097=function(_0x1b0969,_0x560956){_0x1b0969=_0x1b0969-0x0;var _0x22b349=_0x0972[_0x1b0969];return _0x22b349;};'use strict';var Sequelize=require('sequelize');module[_0x2097('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0x2097('0x1'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize['STRING'],'defaultValue':_0x2097('0x2')},'description':{'type':Sequelize[_0x2097('0x3')]}}; \ No newline at end of file +var _0x566f=['name','#0091EA','sequelize','exports','STRING'];(function(_0x34bd34,_0x1444f7){var _0x4e36d6=function(_0x20ed8e){while(--_0x20ed8e){_0x34bd34['push'](_0x34bd34['shift']());}};_0x4e36d6(++_0x1444f7);}(_0x566f,0x124));var _0xf566=function(_0x4b6993,_0x4e2252){_0x4b6993=_0x4b6993-0x0;var _0x3679d1=_0x566f[_0x4b6993];return _0x3679d1;};'use strict';var Sequelize=require(_0xf566('0x0'));module[_0xf566('0x1')]={'name':{'type':Sequelize[_0xf566('0x2')],'unique':_0xf566('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0xf566('0x2')],'defaultValue':_0xf566('0x4')},'description':{'type':Sequelize[_0xf566('0x2')]}}; \ No newline at end of file diff --git a/server/api/tag/tag.controller.js b/server/api/tag/tag.controller.js index 2e10854..87f910c 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 _0x24cd=['undefined','count','limit','Content-Range','apply','reject','save','update','then','destroy','get','Tags','error','stack','name','send','index','Tag','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','options','includeAll','include','catch','params','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset'];(function(_0x4240f0,_0xf19ec3){var _0x179584=function(_0x1aa169){while(--_0x1aa169){_0x4240f0['push'](_0x4240f0['shift']());}};_0x179584(++_0xf19ec3);}(_0x24cd,0x83));var _0xd24c=function(_0x396ed7,_0x5f1aac){_0x396ed7=_0x396ed7-0x0;var _0x10ad03=_0x24cd[_0x396ed7];return _0x10ad03;};'use strict';var emlformat=require(_0xd24c('0x0'));var rimraf=require(_0xd24c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd24c('0x2'));var rp=require('request-promise');var moment=require(_0xd24c('0x3'));var BPromise=require(_0xd24c('0x4'));var Mustache=require(_0xd24c('0x5'));var util=require('util');var path=require(_0xd24c('0x6'));var sox=require(_0xd24c('0x7'));var csv=require('to-csv');var ejs=require(_0xd24c('0x8'));var fs=require('fs');var fs_extra=require(_0xd24c('0x9'));var _=require(_0xd24c('0xa'));var squel=require(_0xd24c('0xb'));var crypto=require(_0xd24c('0xc'));var jsforce=require(_0xd24c('0xd'));var deskjs=require(_0xd24c('0xe'));var toCsv=require(_0xd24c('0xf'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xd24c('0x10'));var authService=require(_0xd24c('0x11'));var qs=require(_0xd24c('0x12'));var as=require(_0xd24c('0x13'));var hardwareService=require(_0xd24c('0x14'));var logger=require(_0xd24c('0x15'))(_0xd24c('0x16'));var utils=require(_0xd24c('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xd24c('0x18'));var db=require(_0xd24c('0x19'))['db'];function respondWithStatusCode(_0x55de4d,_0x3296ea){_0x3296ea=_0x3296ea||0xcc;return function(_0x3bed2){if(_0x3bed2){return _0x55de4d[_0xd24c('0x1a')](_0x3296ea);}return _0x55de4d[_0xd24c('0x1b')](_0x3296ea)[_0xd24c('0x1c')]();};}function respondWithResult(_0x6a81d9,_0x2c29c6){_0x2c29c6=_0x2c29c6||0xc8;return function(_0x20b624){if(_0x20b624){return _0x6a81d9['status'](_0x2c29c6)[_0xd24c('0x1d')](_0x20b624);}};}function respondWithFilteredResult(_0xe096c,_0x528489){return function(_0x34aa92){if(_0x34aa92){var _0x3aa193=typeof _0x528489[_0xd24c('0x1e')]===_0xd24c('0x1f')&&typeof _0x528489['limit']==='undefined';var _0xc87bb7=_0x34aa92[_0xd24c('0x20')];var _0x170d59=_0x3aa193?0x0:_0x528489['offset'];var _0x9f2d2d=_0x3aa193?_0x34aa92[_0xd24c('0x20')]:_0x528489[_0xd24c('0x1e')]+_0x528489[_0xd24c('0x21')];var _0x478a0f;if(_0x9f2d2d>=_0xc87bb7){_0x9f2d2d=_0xc87bb7;_0x478a0f=0xc8;}else{_0x478a0f=0xce;}_0xe096c[_0xd24c('0x1b')](_0x478a0f);return _0xe096c['set'](_0xd24c('0x22'),_0x170d59+'-'+_0x9f2d2d+'/'+_0xc87bb7)[_0xd24c('0x1d')](_0x34aa92);}return null;};}function patchUpdates(_0x1b3a2f){return function(_0x38c380){try{jsonpatch[_0xd24c('0x23')](_0x38c380,_0x1b3a2f,!![]);}catch(_0x4964e5){return BPromise[_0xd24c('0x24')](_0x4964e5);}return _0x38c380[_0xd24c('0x25')]();};}function saveUpdates(_0x17375b,_0x206ce7){return function(_0x48fffd){if(_0x48fffd){return _0x48fffd[_0xd24c('0x26')](_0x17375b)[_0xd24c('0x27')](function(_0x2549d0){return _0x2549d0;});}return null;};}function removeEntity(_0x5c862f,_0x44471f){return function(_0x2c3328){if(_0x2c3328){return _0x2c3328[_0xd24c('0x28')]()['then'](function(){var _0x4539e7=_0x2c3328[_0xd24c('0x29')]({'plain':!![]});var _0x848e0e=_0xd24c('0x2a');return db['UserProfileResource']['destroy']({'where':{'type':_0x848e0e,'resourceId':_0x4539e7['id']}})[_0xd24c('0x27')](function(){return _0x2c3328;});})['then'](function(){_0x5c862f[_0xd24c('0x1b')](0xcc)[_0xd24c('0x1c')]();});}};}function handleEntityNotFound(_0x325fcc,_0x4c0d99){return function(_0x4cb1b3){if(!_0x4cb1b3){_0x325fcc[_0xd24c('0x1a')](0x194);}return _0x4cb1b3;};}function handleError(_0x14d44a,_0x1a18b7){_0x1a18b7=_0x1a18b7||0x1f4;return function(_0x160f03){logger[_0xd24c('0x2b')](_0x160f03[_0xd24c('0x2c')]);if(_0x160f03[_0xd24c('0x2d')]){delete _0x160f03[_0xd24c('0x2d')];}_0x14d44a[_0xd24c('0x1b')](_0x1a18b7)[_0xd24c('0x2e')](_0x160f03);};}exports[_0xd24c('0x2f')]=function(_0x59cbb6,_0x4e128b){var _0x305e90={},_0x445bc6={},_0x1dc70b={'count':0x0,'rows':[]};var _0x56260c=_['map'](db[_0xd24c('0x30')][_0xd24c('0x31')],function(_0x34a64c){return{'name':_0x34a64c[_0xd24c('0x32')],'type':_0x34a64c['type'][_0xd24c('0x33')]};});_0x445bc6[_0xd24c('0x34')]=_[_0xd24c('0x35')](_0x56260c,_0xd24c('0x2d'));_0x445bc6[_0xd24c('0x36')]=_[_0xd24c('0x37')](_0x59cbb6[_0xd24c('0x36')]);_0x445bc6[_0xd24c('0x38')]=_[_0xd24c('0x39')](_0x445bc6['model'],_0x445bc6[_0xd24c('0x36')]);_0x305e90['attributes']=_['intersection'](_0x445bc6[_0xd24c('0x34')],qs[_0xd24c('0x3a')](_0x59cbb6[_0xd24c('0x36')][_0xd24c('0x3a')]));_0x305e90[_0xd24c('0x3b')]=_0x305e90[_0xd24c('0x3b')][_0xd24c('0x3c')]?_0x305e90['attributes']:_0x445bc6[_0xd24c('0x34')];if(!_0x59cbb6[_0xd24c('0x36')][_0xd24c('0x3d')](_0xd24c('0x3e'))){_0x305e90[_0xd24c('0x21')]=qs[_0xd24c('0x21')](_0x59cbb6['query'][_0xd24c('0x21')]);_0x305e90[_0xd24c('0x1e')]=qs['offset'](_0x59cbb6[_0xd24c('0x36')][_0xd24c('0x1e')]);}_0x305e90['order']=qs[_0xd24c('0x3f')](_0x59cbb6[_0xd24c('0x36')]['sort']);_0x305e90[_0xd24c('0x40')]=qs[_0xd24c('0x38')](_[_0xd24c('0x41')](_0x59cbb6[_0xd24c('0x36')],_0x445bc6['filters']),_0x56260c);if(_0x59cbb6[_0xd24c('0x36')]['filter']){_0x305e90[_0xd24c('0x40')]=_['merge'](_0x305e90['where'],{'$or':_['map'](_0x56260c,function(_0x4160fb){if(_0x4160fb['type']!=='VIRTUAL'){var _0x66f45={};_0x66f45[_0x4160fb[_0xd24c('0x2d')]]={'$like':'%'+_0x59cbb6[_0xd24c('0x36')][_0xd24c('0x42')]+'%'};return _0x66f45;}})});}_0x305e90=_['merge']({},_0x305e90,_0x59cbb6[_0xd24c('0x43')]);var _0x54a924={'where':_0x305e90[_0xd24c('0x40')]};return db[_0xd24c('0x30')][_0xd24c('0x20')](_0x54a924)[_0xd24c('0x27')](function(_0x27eefa){_0x1dc70b[_0xd24c('0x20')]=_0x27eefa;if(_0x59cbb6[_0xd24c('0x36')][_0xd24c('0x44')]){_0x305e90[_0xd24c('0x45')]=[{'all':!![]}];}return db[_0xd24c('0x30')]['findAll'](_0x305e90);})[_0xd24c('0x27')](function(_0x742082){_0x1dc70b['rows']=_0x742082;return _0x1dc70b;})[_0xd24c('0x27')](respondWithFilteredResult(_0x4e128b,_0x305e90))[_0xd24c('0x46')](handleError(_0x4e128b,null));};exports['show']=function(_0x2f2981,_0x5d91fe){var _0x39cd94={'raw':!![],'where':{'id':_0x2f2981[_0xd24c('0x47')]['id']}},_0x2d46b8={};_0x2d46b8[_0xd24c('0x34')]=_[_0xd24c('0x37')](db['Tag'][_0xd24c('0x31')]);_0x2d46b8['query']=_[_0xd24c('0x37')](_0x2f2981['query']);_0x2d46b8[_0xd24c('0x38')]=_[_0xd24c('0x39')](_0x2d46b8['model'],_0x2d46b8[_0xd24c('0x36')]);_0x39cd94[_0xd24c('0x3b')]=_['intersection'](_0x2d46b8[_0xd24c('0x34')],qs['fields'](_0x2f2981['query']['fields']));_0x39cd94[_0xd24c('0x3b')]=_0x39cd94[_0xd24c('0x3b')]['length']?_0x39cd94['attributes']:_0x2d46b8[_0xd24c('0x34')];if(_0x2f2981[_0xd24c('0x36')][_0xd24c('0x44')]){_0x39cd94[_0xd24c('0x45')]=[{'all':!![]}];}_0x39cd94=_['merge']({},_0x39cd94,_0x2f2981[_0xd24c('0x43')]);return db[_0xd24c('0x30')]['find'](_0x39cd94)[_0xd24c('0x27')](handleEntityNotFound(_0x5d91fe,null))[_0xd24c('0x27')](respondWithResult(_0x5d91fe,null))[_0xd24c('0x46')](handleError(_0x5d91fe,null));};exports['create']=function(_0x3039aa,_0x4b10c6){return db[_0xd24c('0x30')][_0xd24c('0x48')](_0x3039aa[_0xd24c('0x49')],{})[_0xd24c('0x27')](function(_0x47d5ce){var _0x14684c=_0x3039aa[_0xd24c('0x4a')][_0xd24c('0x29')]({'plain':!![]});if(!_0x14684c)throw new Error(_0xd24c('0x4b'));if(_0x14684c[_0xd24c('0x4c')]===_0xd24c('0x4a')){var _0x3ce7d0=_0x47d5ce[_0xd24c('0x29')]({'plain':!![]});var _0x47067c=_0xd24c('0x2a');return db[_0xd24c('0x4d')]['find']({'where':{'name':_0x47067c,'userProfileId':_0x14684c[_0xd24c('0x4e')]},'raw':!![]})[_0xd24c('0x27')](function(_0x48f011){if(_0x48f011&&_0x48f011['autoAssociation']===0x0){return db['UserProfileResource'][_0xd24c('0x48')]({'name':_0x3ce7d0[_0xd24c('0x2d')],'resourceId':_0x3ce7d0['id'],'type':_0x48f011[_0xd24c('0x2d')],'sectionId':_0x48f011['id']},{})[_0xd24c('0x27')](function(){return _0x47d5ce;});}else{return _0x47d5ce;}})[_0xd24c('0x46')](function(_0x2ea05a){logger[_0xd24c('0x2b')](_0xd24c('0x4f'),_0x2ea05a);throw _0x2ea05a;});}return _0x47d5ce;})[_0xd24c('0x27')](respondWithResult(_0x4b10c6,0xc9))[_0xd24c('0x46')](handleError(_0x4b10c6,null));};exports[_0xd24c('0x26')]=function(_0x4fbb0b,_0x3a8e76){if(_0x4fbb0b[_0xd24c('0x49')]['id']){delete _0x4fbb0b['body']['id'];}return db[_0xd24c('0x30')][_0xd24c('0x50')]({'where':{'id':_0x4fbb0b[_0xd24c('0x47')]['id']}})['then'](handleEntityNotFound(_0x3a8e76,null))['then'](saveUpdates(_0x4fbb0b[_0xd24c('0x49')],null))[_0xd24c('0x27')](respondWithResult(_0x3a8e76,null))[_0xd24c('0x46')](handleError(_0x3a8e76,null));};exports[_0xd24c('0x28')]=function(_0x148685,_0x3dee09){return db[_0xd24c('0x30')][_0xd24c('0x50')]({'where':{'id':_0x148685['params']['id']}})[_0xd24c('0x27')](handleEntityNotFound(_0x3dee09,null))['then'](removeEntity(_0x3dee09,null))['catch'](handleError(_0x3dee09,null));}; \ No newline at end of file +var _0xe812=['userProfileId','catch','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','rimraf','zip-dir','moment','bluebird','util','path','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','limit','count','set','Content-Range','apply','reject','save','then','get','Tags','UserProfileResource','destroy','name','send','index','Tag','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','merge','options','include','findAll','rows','show','params','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','user'];(function(_0x138adb,_0x193fee){var _0x1b27f2=function(_0x5e97a2){while(--_0x5e97a2){_0x138adb['push'](_0x138adb['shift']());}};_0x1b27f2(++_0x193fee);}(_0xe812,0x1f2));var _0x2e81=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0xe812[_0x167cc1];return _0x10bc4b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2e81('0x0'));var zipdir=require(_0x2e81('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x2e81('0x2'));var BPromise=require(_0x2e81('0x3'));var Mustache=require('mustache');var util=require(_0x2e81('0x4'));var path=require(_0x2e81('0x5'));var sox=require('sox');var csv=require(_0x2e81('0x6'));var ejs=require(_0x2e81('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2e81('0x8'));var squel=require(_0x2e81('0x9'));var crypto=require(_0x2e81('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x2e81('0xb'));var toCsv=require(_0x2e81('0x6'));var querystring=require(_0x2e81('0xc'));var Papa=require(_0x2e81('0xd'));var Redis=require('ioredis');var authService=require(_0x2e81('0xe'));var qs=require(_0x2e81('0xf'));var as=require(_0x2e81('0x10'));var hardwareService=require(_0x2e81('0x11'));var logger=require(_0x2e81('0x12'))(_0x2e81('0x13'));var utils=require(_0x2e81('0x14'));var config=require(_0x2e81('0x15'));var licenseUtil=require(_0x2e81('0x16'));var db=require(_0x2e81('0x17'))['db'];function respondWithStatusCode(_0x4284f3,_0x5c58a2){_0x5c58a2=_0x5c58a2||0xcc;return function(_0x30a730){if(_0x30a730){return _0x4284f3[_0x2e81('0x18')](_0x5c58a2);}return _0x4284f3['status'](_0x5c58a2)[_0x2e81('0x19')]();};}function respondWithResult(_0x5598a9,_0x2a4411){_0x2a4411=_0x2a4411||0xc8;return function(_0x2b24f0){if(_0x2b24f0){return _0x5598a9[_0x2e81('0x1a')](_0x2a4411)[_0x2e81('0x1b')](_0x2b24f0);}};}function respondWithFilteredResult(_0x1bb937,_0x3a8c05){return function(_0x53da62){if(_0x53da62){var _0xc4d315=typeof _0x3a8c05[_0x2e81('0x1c')]==='undefined'&&typeof _0x3a8c05[_0x2e81('0x1d')]==='undefined';var _0x2cc0c6=_0x53da62[_0x2e81('0x1e')];var _0x4c1b11=_0xc4d315?0x0:_0x3a8c05[_0x2e81('0x1c')];var _0x2bb9b6=_0xc4d315?_0x53da62[_0x2e81('0x1e')]:_0x3a8c05[_0x2e81('0x1c')]+_0x3a8c05[_0x2e81('0x1d')];var _0x1f20bf;if(_0x2bb9b6>=_0x2cc0c6){_0x2bb9b6=_0x2cc0c6;_0x1f20bf=0xc8;}else{_0x1f20bf=0xce;}_0x1bb937[_0x2e81('0x1a')](_0x1f20bf);return _0x1bb937[_0x2e81('0x1f')](_0x2e81('0x20'),_0x4c1b11+'-'+_0x2bb9b6+'/'+_0x2cc0c6)[_0x2e81('0x1b')](_0x53da62);}return null;};}function patchUpdates(_0x524694){return function(_0x10b77e){try{jsonpatch[_0x2e81('0x21')](_0x10b77e,_0x524694,!![]);}catch(_0x9ddf6b){return BPromise[_0x2e81('0x22')](_0x9ddf6b);}return _0x10b77e[_0x2e81('0x23')]();};}function saveUpdates(_0x386721,_0x18b9be){return function(_0x39ffa8){if(_0x39ffa8){return _0x39ffa8['update'](_0x386721)[_0x2e81('0x24')](function(_0x49e9f1){return _0x49e9f1;});}return null;};}function removeEntity(_0x2d50af,_0x4fe130){return function(_0x1d09cb){if(_0x1d09cb){return _0x1d09cb['destroy']()['then'](function(){var _0x123d3d=_0x1d09cb[_0x2e81('0x25')]({'plain':!![]});var _0x4a75ff=_0x2e81('0x26');return db[_0x2e81('0x27')][_0x2e81('0x28')]({'where':{'type':_0x4a75ff,'resourceId':_0x123d3d['id']}})[_0x2e81('0x24')](function(){return _0x1d09cb;});})[_0x2e81('0x24')](function(){_0x2d50af[_0x2e81('0x1a')](0xcc)[_0x2e81('0x19')]();});}};}function handleEntityNotFound(_0x4669aa,_0x1b34db){return function(_0x1bf5a6){if(!_0x1bf5a6){_0x4669aa[_0x2e81('0x18')](0x194);}return _0x1bf5a6;};}function handleError(_0xc0720f,_0x8edf9c){_0x8edf9c=_0x8edf9c||0x1f4;return function(_0x3ec91d){logger['error'](_0x3ec91d['stack']);if(_0x3ec91d[_0x2e81('0x29')]){delete _0x3ec91d[_0x2e81('0x29')];}_0xc0720f[_0x2e81('0x1a')](_0x8edf9c)[_0x2e81('0x2a')](_0x3ec91d);};}exports[_0x2e81('0x2b')]=function(_0x2a78bb,_0x243b20){var _0x13612b={},_0x26ec2a={},_0x1c37d1={'count':0x0,'rows':[]};var _0x392c5b=_['map'](db[_0x2e81('0x2c')][_0x2e81('0x2d')],function(_0x1d0437){return{'name':_0x1d0437[_0x2e81('0x2e')],'type':_0x1d0437[_0x2e81('0x2f')][_0x2e81('0x30')]};});_0x26ec2a[_0x2e81('0x31')]=_[_0x2e81('0x32')](_0x392c5b,_0x2e81('0x29'));_0x26ec2a[_0x2e81('0x33')]=_[_0x2e81('0x34')](_0x2a78bb[_0x2e81('0x33')]);_0x26ec2a[_0x2e81('0x35')]=_[_0x2e81('0x36')](_0x26ec2a[_0x2e81('0x31')],_0x26ec2a[_0x2e81('0x33')]);_0x13612b[_0x2e81('0x37')]=_['intersection'](_0x26ec2a[_0x2e81('0x31')],qs[_0x2e81('0x38')](_0x2a78bb['query'][_0x2e81('0x38')]));_0x13612b[_0x2e81('0x37')]=_0x13612b['attributes'][_0x2e81('0x39')]?_0x13612b[_0x2e81('0x37')]:_0x26ec2a[_0x2e81('0x31')];if(!_0x2a78bb['query'][_0x2e81('0x3a')](_0x2e81('0x3b'))){_0x13612b[_0x2e81('0x1d')]=qs[_0x2e81('0x1d')](_0x2a78bb[_0x2e81('0x33')]['limit']);_0x13612b['offset']=qs['offset'](_0x2a78bb['query'][_0x2e81('0x1c')]);}_0x13612b['order']=qs['sort'](_0x2a78bb[_0x2e81('0x33')][_0x2e81('0x3c')]);_0x13612b[_0x2e81('0x3d')]=qs['filters'](_[_0x2e81('0x3e')](_0x2a78bb[_0x2e81('0x33')],_0x26ec2a[_0x2e81('0x35')]),_0x392c5b);if(_0x2a78bb[_0x2e81('0x33')][_0x2e81('0x3f')]){_0x13612b['where']=_['merge'](_0x13612b[_0x2e81('0x3d')],{'$or':_[_0x2e81('0x32')](_0x392c5b,function(_0x35d1c0){if(_0x35d1c0['type']!==_0x2e81('0x40')){var _0x44d10c={};_0x44d10c[_0x35d1c0[_0x2e81('0x29')]]={'$like':'%'+_0x2a78bb['query'][_0x2e81('0x3f')]+'%'};return _0x44d10c;}})});}_0x13612b=_[_0x2e81('0x41')]({},_0x13612b,_0x2a78bb[_0x2e81('0x42')]);var _0x10e240={'where':_0x13612b[_0x2e81('0x3d')]};return db[_0x2e81('0x2c')][_0x2e81('0x1e')](_0x10e240)[_0x2e81('0x24')](function(_0x5508f0){_0x1c37d1['count']=_0x5508f0;if(_0x2a78bb[_0x2e81('0x33')]['includeAll']){_0x13612b[_0x2e81('0x43')]=[{'all':!![]}];}return db[_0x2e81('0x2c')][_0x2e81('0x44')](_0x13612b);})[_0x2e81('0x24')](function(_0x3c5fbb){_0x1c37d1[_0x2e81('0x45')]=_0x3c5fbb;return _0x1c37d1;})['then'](respondWithFilteredResult(_0x243b20,_0x13612b))['catch'](handleError(_0x243b20,null));};exports[_0x2e81('0x46')]=function(_0x2bc2a7,_0x1a8233){var _0x53bb7c={'raw':!![],'where':{'id':_0x2bc2a7[_0x2e81('0x47')]['id']}},_0x4499b7={};_0x4499b7['model']=_[_0x2e81('0x34')](db['Tag'][_0x2e81('0x2d')]);_0x4499b7[_0x2e81('0x33')]=_[_0x2e81('0x34')](_0x2bc2a7[_0x2e81('0x33')]);_0x4499b7['filters']=_[_0x2e81('0x36')](_0x4499b7['model'],_0x4499b7[_0x2e81('0x33')]);_0x53bb7c[_0x2e81('0x37')]=_['intersection'](_0x4499b7[_0x2e81('0x31')],qs[_0x2e81('0x38')](_0x2bc2a7[_0x2e81('0x33')][_0x2e81('0x38')]));_0x53bb7c[_0x2e81('0x37')]=_0x53bb7c[_0x2e81('0x37')][_0x2e81('0x39')]?_0x53bb7c['attributes']:_0x4499b7[_0x2e81('0x31')];if(_0x2bc2a7['query']['includeAll']){_0x53bb7c[_0x2e81('0x43')]=[{'all':!![]}];}_0x53bb7c=_['merge']({},_0x53bb7c,_0x2bc2a7['options']);return db[_0x2e81('0x2c')][_0x2e81('0x48')](_0x53bb7c)[_0x2e81('0x24')](handleEntityNotFound(_0x1a8233,null))['then'](respondWithResult(_0x1a8233,null))['catch'](handleError(_0x1a8233,null));};exports[_0x2e81('0x49')]=function(_0x1dd4d7,_0x16ed11){return db[_0x2e81('0x2c')]['create'](_0x1dd4d7['body'],{})[_0x2e81('0x24')](function(_0x4056e8){var _0x5631b6=_0x1dd4d7['user'][_0x2e81('0x25')]({'plain':!![]});if(!_0x5631b6)throw new Error(_0x2e81('0x4a'));if(_0x5631b6['role']===_0x2e81('0x4b')){var _0x33a4d7=_0x4056e8[_0x2e81('0x25')]({'plain':!![]});var _0x3402b3=_0x2e81('0x26');return db['UserProfileSection'][_0x2e81('0x48')]({'where':{'name':_0x3402b3,'userProfileId':_0x5631b6[_0x2e81('0x4c')]},'raw':!![]})[_0x2e81('0x24')](function(_0xb4decd){if(_0xb4decd&&_0xb4decd['autoAssociation']===0x0){return db['UserProfileResource'][_0x2e81('0x49')]({'name':_0x33a4d7[_0x2e81('0x29')],'resourceId':_0x33a4d7['id'],'type':_0xb4decd[_0x2e81('0x29')],'sectionId':_0xb4decd['id']},{})[_0x2e81('0x24')](function(){return _0x4056e8;});}else{return _0x4056e8;}})[_0x2e81('0x4d')](function(_0x482888){logger[_0x2e81('0x4e')](_0x2e81('0x4f'),_0x482888);throw _0x482888;});}return _0x4056e8;})[_0x2e81('0x24')](respondWithResult(_0x16ed11,0xc9))[_0x2e81('0x4d')](handleError(_0x16ed11,null));};exports[_0x2e81('0x50')]=function(_0x4aa5e5,_0x44db7f){if(_0x4aa5e5[_0x2e81('0x51')]['id']){delete _0x4aa5e5['body']['id'];}return db['Tag'][_0x2e81('0x48')]({'where':{'id':_0x4aa5e5['params']['id']}})[_0x2e81('0x24')](handleEntityNotFound(_0x44db7f,null))[_0x2e81('0x24')](saveUpdates(_0x4aa5e5[_0x2e81('0x51')],null))[_0x2e81('0x24')](respondWithResult(_0x44db7f,null))[_0x2e81('0x4d')](handleError(_0x44db7f,null));};exports[_0x2e81('0x28')]=function(_0x18beeb,_0x1570c1){return db['Tag'][_0x2e81('0x48')]({'where':{'id':_0x18beeb['params']['id']}})[_0x2e81('0x24')](handleEntityNotFound(_0x1570c1,null))[_0x2e81('0x24')](removeEntity(_0x1570c1,null))['catch'](handleError(_0x1570c1,null));}; \ No newline at end of file diff --git a/server/api/tag/tag.model.js b/server/api/tag/tag.model.js index 5ef1d9e..1b49aa5 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 _0xef89=['rimraf','../../config/environment','./tag.attributes','tools_tags','lodash','util','../../config/logger','api','moment','request-promise','path'];(function(_0x5032d0,_0xcb50fc){var _0x266054=function(_0x462458){while(--_0x462458){_0x5032d0['push'](_0x5032d0['shift']());}};_0x266054(++_0xcb50fc);}(_0xef89,0xf6));var _0x9ef8=function(_0x22099a,_0x2eb6da){_0x22099a=_0x22099a-0x0;var _0x70ecdb=_0xef89[_0x22099a];return _0x70ecdb;};'use strict';var _=require(_0x9ef8('0x0'));var util=require(_0x9ef8('0x1'));var logger=require(_0x9ef8('0x2'))(_0x9ef8('0x3'));var moment=require(_0x9ef8('0x4'));var BPromise=require('bluebird');var rp=require(_0x9ef8('0x5'));var fs=require('fs');var path=require(_0x9ef8('0x6'));var rimraf=require(_0x9ef8('0x7'));var config=require(_0x9ef8('0x8'));var attributes=require(_0x9ef8('0x9'));module['exports']=function(_0x1698c3,_0x5d40f7){return _0x1698c3['define']('Tag',attributes,{'tableName':_0x9ef8('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8ae4=['define','Tag','tools_tags','../../config/logger','api','moment','bluebird','path','rimraf','./tag.attributes','exports'];(function(_0x21bc0c,_0x141090){var _0x3291d5=function(_0x27367c){while(--_0x27367c){_0x21bc0c['push'](_0x21bc0c['shift']());}};_0x3291d5(++_0x141090);}(_0x8ae4,0x14d));var _0x48ae=function(_0x51411b,_0x2b96d7){_0x51411b=_0x51411b-0x0;var _0x114d97=_0x8ae4[_0x51411b];return _0x114d97;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x48ae('0x0'))(_0x48ae('0x1'));var moment=require(_0x48ae('0x2'));var BPromise=require(_0x48ae('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x48ae('0x4'));var rimraf=require(_0x48ae('0x5'));var config=require('../../config/environment');var attributes=require(_0x48ae('0x6'));module[_0x48ae('0x7')]=function(_0x3cfafe,_0x40b25a){return _0x3cfafe[_0x48ae('0x8')](_0x48ae('0x9'),attributes,{'tableName':_0x48ae('0xa'),'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 7f437ca..334e1bc 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 _0x0207=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','info','Tag,\x20%s,\x20%s','request\x20sent','Tag,\x20%s,\x20%s,\x20%s','error','code','message','util','randomstring','ioredis'];(function(_0x211260,_0x429c42){var _0x50bf50=function(_0xc79d90){while(--_0xc79d90){_0x211260['push'](_0x211260['shift']());}};_0x50bf50(++_0x429c42);}(_0x0207,0x162));var _0x7020=function(_0x4762ce,_0x5d8ca5){_0x4762ce=_0x4762ce-0x0;var _0x43cb29=_0x0207[_0x4762ce];return _0x43cb29;};'use strict';var _=require('lodash');var util=require(_0x7020('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x7020('0x1'));var fs=require('fs');var Redis=require(_0x7020('0x2'));var db=require(_0x7020('0x3'))['db'];var utils=require(_0x7020('0x4'));var logger=require(_0x7020('0x5'))(_0x7020('0x6'));var config=require(_0x7020('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x7020('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x39263c,_0x3c6c11,_0x17deac){return new BPromise(function(_0x42bc79,_0x22ba3e){return client[_0x7020('0x9')](_0x39263c,_0x17deac)['then'](function(_0x5e86b5){logger[_0x7020('0xa')](_0x7020('0xb'),_0x3c6c11,_0x7020('0xc'));logger['debug'](_0x7020('0xd'),_0x3c6c11,_0x7020('0xc'),JSON['stringify'](_0x5e86b5));if(_0x5e86b5[_0x7020('0xe')]){if(_0x5e86b5[_0x7020('0xe')][_0x7020('0xf')]===0x1f4){logger['error'](_0x7020('0xb'),_0x3c6c11,_0x5e86b5[_0x7020('0xe')][_0x7020('0x10')]);return _0x22ba3e(_0x5e86b5[_0x7020('0xe')][_0x7020('0x10')]);}logger['error'](_0x7020('0xb'),_0x3c6c11,_0x5e86b5['error'][_0x7020('0x10')]);return _0x42bc79(_0x5e86b5[_0x7020('0xe')][_0x7020('0x10')]);}else{logger[_0x7020('0xa')](_0x7020('0xb'),_0x3c6c11,_0x7020('0xc'));_0x42bc79(_0x5e86b5['result'][_0x7020('0x10')]);}})['catch'](function(_0x2f4db5){logger[_0x7020('0xe')](_0x7020('0xb'),_0x3c6c11,_0x2f4db5);_0x22ba3e(_0x2f4db5);});});} \ No newline at end of file +var _0x81bd=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../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','stringify','error','code','message','result','catch','lodash'];(function(_0x1ffb83,_0x3ddfa6){var _0x4a685a=function(_0x17081f){while(--_0x17081f){_0x1ffb83['push'](_0x1ffb83['shift']());}};_0x4a685a(++_0x3ddfa6);}(_0x81bd,0x7c));var _0xd81b=function(_0x1a3e23,_0xce45e){_0x1a3e23=_0x1a3e23-0x0;var _0x5ee0d8=_0x81bd[_0x1a3e23];return _0x5ee0d8;};'use strict';var _=require(_0xd81b('0x0'));var util=require(_0xd81b('0x1'));var moment=require(_0xd81b('0x2'));var BPromise=require(_0xd81b('0x3'));var rs=require(_0xd81b('0x4'));var fs=require('fs');var Redis=require(_0xd81b('0x5'));var db=require(_0xd81b('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xd81b('0x7'))(_0xd81b('0x8'));var config=require(_0xd81b('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xd81b('0xa')][_0xd81b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1f3f2c,_0x562084,_0x5e14e8){return new BPromise(function(_0xa4cf97,_0x5468d5){return client[_0xd81b('0xc')](_0x1f3f2c,_0x5e14e8)[_0xd81b('0xd')](function(_0x3420a7){logger[_0xd81b('0xe')](_0xd81b('0xf'),_0x562084,_0xd81b('0x10'));logger[_0xd81b('0x11')](_0xd81b('0x12'),_0x562084,_0xd81b('0x10'),JSON[_0xd81b('0x13')](_0x3420a7));if(_0x3420a7[_0xd81b('0x14')]){if(_0x3420a7[_0xd81b('0x14')][_0xd81b('0x15')]===0x1f4){logger['error'](_0xd81b('0xf'),_0x562084,_0x3420a7['error'][_0xd81b('0x16')]);return _0x5468d5(_0x3420a7[_0xd81b('0x14')]['message']);}logger[_0xd81b('0x14')]('Tag,\x20%s,\x20%s',_0x562084,_0x3420a7[_0xd81b('0x14')][_0xd81b('0x16')]);return _0xa4cf97(_0x3420a7[_0xd81b('0x14')][_0xd81b('0x16')]);}else{logger[_0xd81b('0xe')]('Tag,\x20%s,\x20%s',_0x562084,_0xd81b('0x10'));_0xa4cf97(_0x3420a7[_0xd81b('0x17')]['message']);}})[_0xd81b('0x18')](function(_0x26df61){logger[_0xd81b('0x14')](_0xd81b('0xf'),_0x562084,_0x26df61);_0x5468d5(_0x26df61);});});} \ No newline at end of file diff --git a/server/api/team/index.js b/server/api/team/index.js index bfe698e..badafef 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(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3c2a69,_0x4c8b41){_0x3c2a69=_0x3c2a69-0x0;var _0x596bc8=_0xa9e0[_0x3c2a69];return _0x596bc8;};'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(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0xa9e0,0x123));var _0x0a9e=function(_0x12d033,_0x25fa2f){_0x12d033=_0x12d033-0x0;var _0x3b4e80=_0xa9e0[_0x12d033];return _0x3b4e80;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/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 abb0d4c..013c7d0 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 _0xb7e7=['STRING','sequelize'];(function(_0x3e2fcf,_0x579110){var _0x497db7=function(_0x2f713d){while(--_0x2f713d){_0x3e2fcf['push'](_0x3e2fcf['shift']());}};_0x497db7(++_0x579110);}(_0xb7e7,0x121));var _0x7b7e=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0xb7e7[_0x432682];return _0x463d05;};'use strict';var Sequelize=require(_0x7b7e('0x0'));module['exports']={'name':{'type':Sequelize[_0x7b7e('0x1')],'allowNull':![],'unique':'name'},'description':{'type':Sequelize[_0x7b7e('0x1')]}}; \ No newline at end of file +var _0xbaf0=['name','exports','STRING'];(function(_0x4d7379,_0x4b4e63){var _0x46d7cf=function(_0x53f5f0){while(--_0x53f5f0){_0x4d7379['push'](_0x4d7379['shift']());}};_0x46d7cf(++_0x4b4e63);}(_0xbaf0,0x12a));var _0x0baf=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xbaf0[_0x3947c9];return _0x2e7871;};'use strict';var Sequelize=require('sequelize');module[_0x0baf('0x0')]={'name':{'type':Sequelize[_0x0baf('0x1')],'allowNull':![],'unique':_0x0baf('0x2')},'description':{'type':Sequelize[_0x0baf('0x1')]}}; \ No newline at end of file diff --git a/server/api/team/team.controller.js b/server/api/team/team.controller.js index 5024a03..cc32008 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 _0x111b=['MailQueueId','UserMailQueue','SELECT\x20SmsQueueId\x20FROM\x20team_has_sms_queues\x20WHERE\x20TeamId\x20=\x20','SmsQueueId','SELECT\x20ChatQueueId\x20FROM\x20team_has_chat_queues\x20WHERE\x20TeamId\x20=\x20','ChatQueueId','UserChatQueue','SELECT\x20FaxQueueId\x20FROM\x20team_has_fax_queues\x20WHERE\x20TeamId\x20=\x20','FaxQueueId','SELECT\x20OpenchannelQueueId\x20FROM\x20team_has_openchannel_queues\x20WHERE\x20TeamId\x20=\x20','UserOpenchannelQueue','SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20','WhatsappQueueId','UserWhatsappQueue','TeamVoicePrefix','UserVoicePrefix','VoicePrefixId','Teams','getQueues','findOne','channel','isValidChannel','ValidationError','Unknown\x20channel','toLowerCase','capitalize','Queues','addQueues','add','ids','removeQueues','isArray','Mail','Fax','Openchannel','Whatsapp','Voice','through','penalty','QueueId','defaults','User','Queue','findOrCreate','emit','Queue:save','online','voicePause','interface','UserVoiceQueueRt','upsert','isNil','format','SIP/%s','TeamVoiceQueue','all','addAgents','Chat','Sms','Queue:remove','getAgents','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../mysqldb','redis','localhost','./team.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','update','then','name','send','rawAttributes','fieldName','type','key','map','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','options','Team','includeAll','include','rows','catch','show','params','find','create','user','get','role','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','destroy','sequelize','transaction','QueryTypes','SELECT','Sequelize','VoiceQueueId'];(function(_0x44365d,_0x44e0cb){var _0x1a4a9e=function(_0x198df9){while(--_0x198df9){_0x44365d['push'](_0x44365d['shift']());}};_0x1a4a9e(++_0x44e0cb);}(_0x111b,0x1f3));var _0xb111=function(_0x3e25ac,_0x58e615){_0x3e25ac=_0x3e25ac-0x0;var _0x31f740=_0x111b[_0x3e25ac];return _0x31f740;};'use strict';var emlformat=require(_0xb111('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb111('0x1'));var jsonpatch=require(_0xb111('0x2'));var rp=require(_0xb111('0x3'));var moment=require(_0xb111('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xb111('0x5'));var util=require(_0xb111('0x6'));var path=require('path');var sox=require(_0xb111('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb111('0x8'));var _=require(_0xb111('0x9'));var squel=require(_0xb111('0xa'));var crypto=require('crypto');var jsforce=require(_0xb111('0xb'));var deskjs=require(_0xb111('0xc'));var toCsv=require('to-csv');var querystring=require(_0xb111('0xd'));var Papa=require('papaparse');var Redis=require(_0xb111('0xe'));var authService=require(_0xb111('0xf'));var qs=require(_0xb111('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xb111('0x11'));var utils=require(_0xb111('0x12'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xb111('0x13'))['db'];config[_0xb111('0x14')]=_['defaults'](config['redis'],{'host':_0xb111('0x15'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb111('0x14')]));require(_0xb111('0x16'))[_0xb111('0x17')](socket);function respondWithStatusCode(_0x41b1d4,_0x36c56f){_0x36c56f=_0x36c56f||0xcc;return function(_0x45eebd){if(_0x45eebd){return _0x41b1d4[_0xb111('0x18')](_0x36c56f);}return _0x41b1d4[_0xb111('0x19')](_0x36c56f)[_0xb111('0x1a')]();};}function respondWithResult(_0x5ab3df,_0x593f88){_0x593f88=_0x593f88||0xc8;return function(_0x1eda84){if(_0x1eda84){return _0x5ab3df[_0xb111('0x19')](_0x593f88)[_0xb111('0x1b')](_0x1eda84);}};}function respondWithFilteredResult(_0xddd81a,_0x2fffd3){return function(_0xd36277){if(_0xd36277){var _0x1bff6f=typeof _0x2fffd3[_0xb111('0x1c')]===_0xb111('0x1d')&&typeof _0x2fffd3[_0xb111('0x1e')]==='undefined';var _0x1275e3=_0xd36277[_0xb111('0x1f')];var _0x2b30b2=_0x1bff6f?0x0:_0x2fffd3[_0xb111('0x1c')];var _0x1ee481=_0x1bff6f?_0xd36277[_0xb111('0x1f')]:_0x2fffd3['offset']+_0x2fffd3[_0xb111('0x1e')];var _0x1dea1b;if(_0x1ee481>=_0x1275e3){_0x1ee481=_0x1275e3;_0x1dea1b=0xc8;}else{_0x1dea1b=0xce;}_0xddd81a[_0xb111('0x19')](_0x1dea1b);return _0xddd81a[_0xb111('0x20')](_0xb111('0x21'),_0x2b30b2+'-'+_0x1ee481+'/'+_0x1275e3)['json'](_0xd36277);}return null;};}function patchUpdates(_0x891ea2){return function(_0x1782e1){try{jsonpatch['apply'](_0x1782e1,_0x891ea2,!![]);}catch(_0x83df4d){return BPromise[_0xb111('0x22')](_0x83df4d);}return _0x1782e1['save']();};}function saveUpdates(_0x51e026,_0xb35d73){return function(_0x5d7a84){if(_0x5d7a84){return _0x5d7a84[_0xb111('0x23')](_0x51e026)[_0xb111('0x24')](function(_0x3a1192){return _0x3a1192;});}return null;};}function handleEntityNotFound(_0x22e9d8,_0x580a77){return function(_0x538647){if(!_0x538647){_0x22e9d8['sendStatus'](0x194);}return _0x538647;};}function handleError(_0x3e50ee,_0x389a84){_0x389a84=_0x389a84||0x1f4;return function(_0x360b94){logger['error'](_0x360b94['stack']);if(_0x360b94[_0xb111('0x25')]){delete _0x360b94[_0xb111('0x25')];}_0x3e50ee[_0xb111('0x19')](_0x389a84)[_0xb111('0x26')](_0x360b94);};}exports['index']=function(_0x2f03ec,_0x4496de){var _0x2dafdc={},_0x3ac157={},_0xcab65c={'count':0x0,'rows':[]};var _0x5be13f=_['map'](db['Team'][_0xb111('0x27')],function(_0xb66078){return{'name':_0xb66078[_0xb111('0x28')],'type':_0xb66078[_0xb111('0x29')][_0xb111('0x2a')]};});_0x3ac157['model']=_[_0xb111('0x2b')](_0x5be13f,_0xb111('0x25'));_0x3ac157['query']=_[_0xb111('0x2c')](_0x2f03ec[_0xb111('0x2d')]);_0x3ac157[_0xb111('0x2e')]=_[_0xb111('0x2f')](_0x3ac157[_0xb111('0x30')],_0x3ac157[_0xb111('0x2d')]);_0x2dafdc[_0xb111('0x31')]=_[_0xb111('0x2f')](_0x3ac157[_0xb111('0x30')],qs[_0xb111('0x32')](_0x2f03ec['query'][_0xb111('0x32')]));_0x2dafdc['attributes']=_0x2dafdc[_0xb111('0x31')][_0xb111('0x33')]?_0x2dafdc[_0xb111('0x31')]:_0x3ac157['model'];if(!_0x2f03ec[_0xb111('0x2d')][_0xb111('0x34')](_0xb111('0x35'))){_0x2dafdc[_0xb111('0x1e')]=qs[_0xb111('0x1e')](_0x2f03ec['query'][_0xb111('0x1e')]);_0x2dafdc[_0xb111('0x1c')]=qs[_0xb111('0x1c')](_0x2f03ec[_0xb111('0x2d')][_0xb111('0x1c')]);}_0x2dafdc[_0xb111('0x36')]=qs[_0xb111('0x37')](_0x2f03ec[_0xb111('0x2d')][_0xb111('0x37')]);_0x2dafdc['where']=qs[_0xb111('0x2e')](_[_0xb111('0x38')](_0x2f03ec[_0xb111('0x2d')],_0x3ac157['filters']),_0x5be13f);if(_0x2f03ec[_0xb111('0x2d')][_0xb111('0x39')]){_0x2dafdc[_0xb111('0x3a')]=_[_0xb111('0x3b')](_0x2dafdc[_0xb111('0x3a')],{'$or':_[_0xb111('0x2b')](_0x5be13f,function(_0x53bae3){if(_0x53bae3['type']!=='VIRTUAL'){var _0x4119b5={};_0x4119b5[_0x53bae3[_0xb111('0x25')]]={'$like':'%'+_0x2f03ec[_0xb111('0x2d')]['filter']+'%'};return _0x4119b5;}})});}_0x2dafdc=_['merge']({},_0x2dafdc,_0x2f03ec[_0xb111('0x3c')]);var _0x1e355e={'where':_0x2dafdc[_0xb111('0x3a')]};return db[_0xb111('0x3d')][_0xb111('0x1f')](_0x1e355e)[_0xb111('0x24')](function(_0x4946c5){_0xcab65c[_0xb111('0x1f')]=_0x4946c5;if(_0x2f03ec[_0xb111('0x2d')][_0xb111('0x3e')]){_0x2dafdc[_0xb111('0x3f')]=[{'all':!![]}];}return db['Team']['findAll'](_0x2dafdc);})['then'](function(_0x34c764){_0xcab65c[_0xb111('0x40')]=_0x34c764;return _0xcab65c;})[_0xb111('0x24')](respondWithFilteredResult(_0x4496de,_0x2dafdc))[_0xb111('0x41')](handleError(_0x4496de,null));};exports[_0xb111('0x42')]=function(_0x57b9a4,_0x1003fa){var _0xc886b8={'raw':![],'where':{'id':_0x57b9a4[_0xb111('0x43')]['id']}},_0x3b7eb5={};_0x3b7eb5[_0xb111('0x30')]=_[_0xb111('0x2c')](db[_0xb111('0x3d')]['rawAttributes']);_0x3b7eb5['query']=_[_0xb111('0x2c')](_0x57b9a4[_0xb111('0x2d')]);_0x3b7eb5[_0xb111('0x2e')]=_[_0xb111('0x2f')](_0x3b7eb5[_0xb111('0x30')],_0x3b7eb5[_0xb111('0x2d')]);_0xc886b8[_0xb111('0x31')]=_[_0xb111('0x2f')](_0x3b7eb5[_0xb111('0x30')],qs['fields'](_0x57b9a4[_0xb111('0x2d')][_0xb111('0x32')]));_0xc886b8[_0xb111('0x31')]=_0xc886b8[_0xb111('0x31')][_0xb111('0x33')]?_0xc886b8[_0xb111('0x31')]:_0x3b7eb5[_0xb111('0x30')];if(_0x57b9a4['query'][_0xb111('0x3e')]){_0xc886b8['include']=[{'all':!![]}];}_0xc886b8=_[_0xb111('0x3b')]({},_0xc886b8,_0x57b9a4['options']);return db[_0xb111('0x3d')][_0xb111('0x44')](_0xc886b8)[_0xb111('0x24')](handleEntityNotFound(_0x1003fa,null))['then'](respondWithResult(_0x1003fa,null))[_0xb111('0x41')](handleError(_0x1003fa,null));};exports[_0xb111('0x45')]=function(_0xbf4edc,_0xe8b297){return db[_0xb111('0x3d')][_0xb111('0x45')](_0xbf4edc['body'],{})[_0xb111('0x24')](function(_0x160b1f){var _0xebc214=_0xbf4edc[_0xb111('0x46')][_0xb111('0x47')]({'plain':!![]});if(!_0xebc214)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xebc214[_0xb111('0x48')]===_0xb111('0x46')){var _0x306b82=_0x160b1f[_0xb111('0x47')]({'plain':!![]});var _0xe53763='Teams';return db['UserProfileSection'][_0xb111('0x44')]({'where':{'name':_0xe53763,'userProfileId':_0xebc214[_0xb111('0x49')]},'raw':!![]})[_0xb111('0x24')](function(_0xde5760){if(_0xde5760&&_0xde5760[_0xb111('0x4a')]===0x0){return db[_0xb111('0x4b')][_0xb111('0x45')]({'name':_0x306b82['name'],'resourceId':_0x306b82['id'],'type':_0xde5760[_0xb111('0x25')],'sectionId':_0xde5760['id']},{})[_0xb111('0x24')](function(){return _0x160b1f;});}else{return _0x160b1f;}})[_0xb111('0x41')](function(_0x13aa5e){logger['error'](_0xb111('0x4c'),_0x13aa5e);throw _0x13aa5e;});}return _0x160b1f;})[_0xb111('0x24')](respondWithResult(_0xe8b297,0xc9))[_0xb111('0x41')](handleError(_0xe8b297,null));};exports[_0xb111('0x23')]=function(_0x16e98d,_0x270a0f){if(_0x16e98d[_0xb111('0x4d')]['id']){delete _0x16e98d[_0xb111('0x4d')]['id'];}return db['Team']['find']({'where':{'id':_0x16e98d[_0xb111('0x43')]['id']}})['then'](handleEntityNotFound(_0x270a0f,null))['then'](saveUpdates(_0x16e98d[_0xb111('0x4d')],null))['then'](respondWithResult(_0x270a0f,null))['catch'](handleError(_0x270a0f,null));};exports[_0xb111('0x4e')]=function(_0x2d8cd7,_0x44ba6f){var _0x38e57c=_0x2d8cd7['params']['id'];var _0x3f76cb=[];return db[_0xb111('0x4f')][_0xb111('0x50')](function(_0x3fde1b){var _0x4941d0='SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20'+_0x38e57c;return db[_0xb111('0x4f')][_0xb111('0x2d')](_0x4941d0,{'type':db['Sequelize'][_0xb111('0x51')][_0xb111('0x52')],'raw':!![],'transaction':_0x3fde1b})['then'](function(_0x32c4ad){_0x3f76cb=_[_0xb111('0x2b')](_0x32c4ad,function(_0x42ed13){return Number(_0x42ed13['UserId']);});})[_0xb111('0x24')](function(){var _0x210134='SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20'+_0x38e57c;return db[_0xb111('0x4f')][_0xb111('0x2d')](_0x210134,{'type':db[_0xb111('0x53')][_0xb111('0x51')][_0xb111('0x52')],'raw':!![],'transaction':_0x3fde1b});})[_0xb111('0x24')](function(_0x4a04e0){var _0x53f5ee=_[_0xb111('0x2b')](_0x4a04e0,function(_0x18f5f2){return Number(_0x18f5f2[_0xb111('0x54')]);});return db['UserVoiceQueue'][_0xb111('0x4e')]({'where':{'UserId':{'$in':_0x3f76cb},'VoiceQueueId':{'$in':_0x53f5ee}},'transaction':_0x3fde1b});})[_0xb111('0x24')](function(){var _0x42b416='SELECT\x20MailQueueId\x20FROM\x20team_has_mail_queues\x20WHERE\x20TeamId\x20=\x20'+_0x38e57c;return db[_0xb111('0x4f')][_0xb111('0x2d')](_0x42b416,{'type':db['Sequelize'][_0xb111('0x51')]['SELECT'],'raw':!![],'transaction':_0x3fde1b});})['then'](function(_0x5a5e2b){var _0x3f6529=_[_0xb111('0x2b')](_0x5a5e2b,function(_0x23c01e){return Number(_0x23c01e[_0xb111('0x55')]);});return db[_0xb111('0x56')][_0xb111('0x4e')]({'where':{'UserId':{'$in':_0x3f76cb},'MailQueueId':{'$in':_0x3f6529}},'transaction':_0x3fde1b});})[_0xb111('0x24')](function(){var _0x5c14cb=_0xb111('0x57')+_0x38e57c;return db[_0xb111('0x4f')][_0xb111('0x2d')](_0x5c14cb,{'type':db[_0xb111('0x53')][_0xb111('0x51')][_0xb111('0x52')],'raw':!![],'transaction':_0x3fde1b});})[_0xb111('0x24')](function(_0x3f55af){var _0x2430f4=_['map'](_0x3f55af,function(_0x31cb0f){return Number(_0x31cb0f[_0xb111('0x58')]);});return db['UserSmsQueue'][_0xb111('0x4e')]({'where':{'UserId':{'$in':_0x3f76cb},'SmsQueueId':{'$in':_0x2430f4}},'transaction':_0x3fde1b});})[_0xb111('0x24')](function(){var _0x1e5354=_0xb111('0x59')+_0x38e57c;return db[_0xb111('0x4f')]['query'](_0x1e5354,{'type':db[_0xb111('0x53')][_0xb111('0x51')][_0xb111('0x52')],'raw':!![],'transaction':_0x3fde1b});})[_0xb111('0x24')](function(_0x536969){var _0x51f21d=_[_0xb111('0x2b')](_0x536969,function(_0x3eede5){return Number(_0x3eede5[_0xb111('0x5a')]);});return db[_0xb111('0x5b')]['destroy']({'where':{'UserId':{'$in':_0x3f76cb},'ChatQueueId':{'$in':_0x51f21d}},'transaction':_0x3fde1b});})[_0xb111('0x24')](function(){var _0x303612=_0xb111('0x5c')+_0x38e57c;return db[_0xb111('0x4f')]['query'](_0x303612,{'type':db['Sequelize']['QueryTypes'][_0xb111('0x52')],'raw':!![],'transaction':_0x3fde1b});})[_0xb111('0x24')](function(_0xe13c96){var _0x1bd8a3=_[_0xb111('0x2b')](_0xe13c96,function(_0x33e6ee){return Number(_0x33e6ee[_0xb111('0x5d')]);});return db['UserFaxQueue']['destroy']({'where':{'UserId':{'$in':_0x3f76cb},'FaxQueueId':{'$in':_0x1bd8a3}},'transaction':_0x3fde1b});})['then'](function(){var _0x4648c6=_0xb111('0x5e')+_0x38e57c;return db[_0xb111('0x4f')][_0xb111('0x2d')](_0x4648c6,{'type':db['Sequelize'][_0xb111('0x51')][_0xb111('0x52')],'raw':!![],'transaction':_0x3fde1b});})[_0xb111('0x24')](function(_0x477769){var _0x18b9a5=_[_0xb111('0x2b')](_0x477769,function(_0x52c0f9){return Number(_0x52c0f9['OpenchannelQueueId']);});return db[_0xb111('0x5f')]['destroy']({'where':{'UserId':{'$in':_0x3f76cb},'OpenchannelQueueId':{'$in':_0x18b9a5}},'transaction':_0x3fde1b});})[_0xb111('0x24')](function(){var _0xfe0e15=_0xb111('0x60')+_0x38e57c;return db['sequelize']['query'](_0xfe0e15,{'type':db[_0xb111('0x53')][_0xb111('0x51')][_0xb111('0x52')],'raw':!![],'transaction':_0x3fde1b});})[_0xb111('0x24')](function(_0x2f38c2){var _0x5b718f=_[_0xb111('0x2b')](_0x2f38c2,function(_0x311c83){return Number(_0x311c83[_0xb111('0x61')]);});return db[_0xb111('0x62')][_0xb111('0x4e')]({'where':{'UserId':{'$in':_0x3f76cb},'WhatsappQueueId':{'$in':_0x5b718f}},'transaction':_0x3fde1b});})['then'](function(){return db[_0xb111('0x63')][_0xb111('0x44')]({'where':{'TeamId':_0x38e57c}});})[_0xb111('0x24')](function(_0x5a808e){if(_0x5a808e===null){return;}return db[_0xb111('0x64')][_0xb111('0x4e')]({'where':{'UserId':{'$in':_0x3f76cb},'VoicePrefixId':_0x5a808e[_0xb111('0x65')]},'transaction':_0x3fde1b});})['then'](function(){return db[_0xb111('0x3d')][_0xb111('0x4e')]({'where':{'id':_0x38e57c},'cascade':!![],'transaction':_0x3fde1b});})[_0xb111('0x24')](function(_0x4871b1){if(_0x4871b1===0x0){_0x44ba6f['sendStatus'](0x194);}else{return db['UserProfileResource'][_0xb111('0x4e')]({'where':{'type':_0xb111('0x66'),'resourceId':_0x38e57c},'cascade':!![],'transaction':_0x3fde1b})[_0xb111('0x24')](function(){_0x44ba6f[_0xb111('0x19')](0xcc)[_0xb111('0x1a')]();});}})[_0xb111('0x41')](function(_0x42a362){_0x44ba6f[_0xb111('0x19')](0x1f4)[_0xb111('0x26')](_0x42a362);});});};exports[_0xb111('0x67')]=function(_0x118a04,_0x1f6d6b,_0x5abbe7){return db['Team'][_0xb111('0x68')]({'where':{'id':_0x118a04[_0xb111('0x43')]['id']}})[_0xb111('0x24')](handleEntityNotFound(_0x1f6d6b,null))['then'](function(_0x716d16){if(!_0x118a04['query'][_0xb111('0x69')]||!utils[_0xb111('0x6a')](_0x118a04['query'][_0xb111('0x69')])){throw new db[(_0xb111('0x53'))][(_0xb111('0x6b'))](_0xb111('0x6c'));}var _0x1a62d0={};var _0x1c1f12={};_0x1c1f12[_0xb111('0x30')]=_[_0xb111('0x2c')](db[_['capitalize'](_0x118a04['query'][_0xb111('0x69')][_0xb111('0x6d')]())+'Queue'][_0xb111('0x27')]);_0x1c1f12[_0xb111('0x2d')]=_[_0xb111('0x2c')](_0x118a04[_0xb111('0x2d')]);_0x1c1f12['filters']=_[_0xb111('0x2f')](_0x1c1f12[_0xb111('0x30')],_0x1c1f12['query']);_0x1a62d0['attributes']=_[_0xb111('0x2f')](_0x1c1f12[_0xb111('0x30')],qs[_0xb111('0x32')](_0x118a04[_0xb111('0x2d')][_0xb111('0x32')]));_0x1a62d0[_0xb111('0x31')]=_0x1a62d0['attributes']['length']?_0x1a62d0[_0xb111('0x31')]:_0x1c1f12['model'];_0x1a62d0[_0xb111('0x1e')]=qs[_0xb111('0x1e')](_0x118a04['query'][_0xb111('0x1e')]);_0x1a62d0[_0xb111('0x1c')]=qs[_0xb111('0x1c')](_0x118a04['query'][_0xb111('0x1c')]);_0x1a62d0[_0xb111('0x36')]=qs[_0xb111('0x37')](_0x118a04[_0xb111('0x2d')][_0xb111('0x37')]);_0x1a62d0[_0xb111('0x3a')]=qs[_0xb111('0x2e')](_[_0xb111('0x38')](_0x118a04[_0xb111('0x2d')],_0x1c1f12[_0xb111('0x2e')]));_0x1a62d0=_[_0xb111('0x3b')]({},_0x1a62d0,_0x118a04[_0xb111('0x3c')]);return _0x716d16[_0xb111('0x47')+_[_0xb111('0x6e')](_0x118a04[_0xb111('0x2d')]['channel']['toLowerCase']())+_0xb111('0x6f')](_0x1a62d0);})[_0xb111('0x24')](respondWithResult(_0x1f6d6b,null))[_0xb111('0x41')](handleError(_0x1f6d6b,null));};exports[_0xb111('0x70')]=function(_0x4030e2,_0x2f6286,_0x39cc1d){return db[_0xb111('0x3d')][_0xb111('0x68')]({'where':{'id':_0x4030e2[_0xb111('0x43')]['id']}})['then'](function(_0x9ecc8){if(_0x9ecc8){if(!_0x4030e2[_0xb111('0x4d')][_0xb111('0x69')]||!utils[_0xb111('0x6a')](_0x4030e2[_0xb111('0x4d')][_0xb111('0x69')])){throw new db[(_0xb111('0x53'))]['ValidationError'](_0xb111('0x6c'));}return _0x9ecc8[_0xb111('0x71')+_['capitalize'](_0x4030e2[_0xb111('0x4d')][_0xb111('0x69')][_0xb111('0x6d')]())+_0xb111('0x6f')](_0x4030e2[_0xb111('0x4d')][_0xb111('0x72')]);}return null;})[_0xb111('0x24')](handleEntityNotFound(_0x2f6286,null))[_0xb111('0x24')](respondWithStatusCode(_0x2f6286,null))[_0xb111('0x41')](handleError(_0x2f6286,null));};exports[_0xb111('0x73')]=function(_0x32684b,_0x445ec6,_0x4d7276){return db[_0xb111('0x3d')][_0xb111('0x68')]({'where':{'id':_0x32684b[_0xb111('0x43')]['id']}})[_0xb111('0x24')](function(_0x561f43){if(_0x561f43){if(!_0x32684b['query'][_0xb111('0x69')]||!utils[_0xb111('0x6a')](_0x32684b[_0xb111('0x2d')]['channel'])){throw new db['Sequelize'][(_0xb111('0x6b'))](_0xb111('0x6c'));}return _0x561f43['remove'+_[_0xb111('0x6e')](_0x32684b['query']['channel'][_0xb111('0x6d')]())+_0xb111('0x6f')](_0x32684b['query'][_0xb111('0x72')]);}return null;})[_0xb111('0x24')](handleEntityNotFound(_0x445ec6,null))['then'](respondWithStatusCode(_0x445ec6,null))['catch'](handleError(_0x445ec6,null));};exports['addAgents']=function(_0x4aeaa3,_0x44dedb){var _0x2bcb09=_[_0xb111('0x74')](_0x4aeaa3[_0xb111('0x4d')][_0xb111('0x72')])?_0x4aeaa3[_0xb111('0x4d')]['ids']:[_0x4aeaa3[_0xb111('0x4d')]['ids']];var _0x38c3be=_0x4aeaa3[_0xb111('0x43')]['id'];return db[_0xb111('0x3d')][_0xb111('0x44')]({'where':{'id':_0x38c3be}})[_0xb111('0x24')](handleEntityNotFound(_0x44dedb,null))['then'](function(_0x4b8be8){if(_0x4b8be8){var _0x3c9f1f=['Voice','Chat',_0xb111('0x75'),'Sms',_0xb111('0x76'),_0xb111('0x77'),_0xb111('0x78')];return db[_0xb111('0x4f')]['transaction'](function(_0x13a5f3){var _0x208679=_[_0xb111('0x2b')](_0x3c9f1f,function(_0x434416){var _0x477074={'attributes':['id',_0xb111('0x25')]};if(_0x434416===_0xb111('0x79')){_0x477074[_0xb111('0x7a')]={'attributes':[_0xb111('0x7b')]};}return _0x4b8be8['get'+_0x434416+_0xb111('0x6f')](_0x477074)['then'](function(_0x247a6c){var _0x5c9ef1=_['map'](_0x247a6c,function(_0x140385){var _0x1c77e6=_[_0xb111('0x2b')](_0x2bcb09,function(_0x30734a){var _0x1a1957={'where':{'UserId':_0x30734a,[_0x434416+_0xb111('0x7c')]:_0x140385['id']},'transaction':_0x13a5f3};if(_0x434416===_0xb111('0x79')){_0x1a1957[_0xb111('0x7d')]={'penalty':_0x140385['TeamVoiceQueue'][_0xb111('0x7b')]};}return db[_0xb111('0x7e')+_0x434416+_0xb111('0x7f')][_0xb111('0x80')](_0x1a1957)['then'](function(){socket[_0xb111('0x81')](_0xb111('0x46')+_0x434416+_0xb111('0x82'),{'UserId':_0x30734a,[_0x434416+_0xb111('0x7c')]:_0x140385['id']});if(_0x434416!==_0xb111('0x79')){return;}return db['User']['findAll']({'where':{'id':_0x2bcb09,'online':0x1},'attributes':['id',_0xb111('0x25'),_0xb111('0x83'),_0xb111('0x84'),_0xb111('0x85')],'raw':!![]})['then'](function(_0x32fa6d){var _0x202ffa=_[_0xb111('0x2b')](_0x32fa6d,function(_0x456050){return db[_0xb111('0x86')][_0xb111('0x87')]({'membername':_0x456050[_0xb111('0x25')],'UserId':_0x456050['id'],'queue_name':_0x140385[_0xb111('0x25')],'VoiceQueueId':_0x140385['id'],'interface':_[_0xb111('0x88')](_0x456050[_0xb111('0x85')])?util[_0xb111('0x89')](_0xb111('0x8a'),_0x456050[_0xb111('0x25')]):_0x456050[_0xb111('0x85')],'paused':_0x456050[_0xb111('0x84')]||![],'penalty':_0x140385[_0xb111('0x8b')][_0xb111('0x7b')]},{'transaction':_0x13a5f3});});return Promise[_0xb111('0x8c')](_0x202ffa);});});});return Promise['all'](_0x1c77e6);});return Promise[_0xb111('0x8c')](_0x5c9ef1);})[_0xb111('0x24')](function(){return db[_0xb111('0x63')][_0xb111('0x68')]({'where':{'teamId':_0x38c3be}})[_0xb111('0x24')](function(_0x359572){if(_0x359572){var _0x57b4a7=_[_0xb111('0x2b')](_0x2bcb09,function(_0x1776cb){db[_0xb111('0x64')][_0xb111('0x87')]({'UserId':_0x1776cb,'VoicePrefixId':_0x359572[_0xb111('0x65')]});});return Promise[_0xb111('0x8c')](_0x57b4a7);}});});});return Promise[_0xb111('0x8c')](_0x208679)[_0xb111('0x24')](function(){return _0x4b8be8[_0xb111('0x8d')](_0x2bcb09,{'transaction':_0x13a5f3})['spread'](function(_0x16131c){return _0x16131c;});});});}})['then'](respondWithResult(_0x44dedb,null))[_0xb111('0x41')](handleError(_0x44dedb,null));};exports['removeAgents']=function(_0x5198a4,_0x3cdc1d){var _0x350854=_[_0xb111('0x74')](_0x5198a4[_0xb111('0x2d')][_0xb111('0x72')])?_0x5198a4[_0xb111('0x2d')][_0xb111('0x72')]:[_0x5198a4[_0xb111('0x2d')]['ids']];var _0x51ce99=_0x5198a4[_0xb111('0x43')]['id'];return db[_0xb111('0x3d')]['find']({'where':{'id':_0x51ce99}})[_0xb111('0x24')](handleEntityNotFound(_0x3cdc1d,null))[_0xb111('0x24')](function(_0x5c0ff6){if(_0x5c0ff6){var _0x44c4e6=[_0xb111('0x79'),_0xb111('0x8e'),_0xb111('0x75'),_0xb111('0x8f'),'Fax','Openchannel',_0xb111('0x78')];return db[_0xb111('0x4f')][_0xb111('0x50')](function(_0x78760f){var _0x553122=_[_0xb111('0x2b')](_0x44c4e6,function(_0x4ffd87){var _0x870877={'attributes':['id','name']};return _0x5c0ff6[_0xb111('0x47')+_0x4ffd87+_0xb111('0x6f')](_0x870877)[_0xb111('0x24')](function(_0x3f6fd0){var _0x4794d0=_[_0xb111('0x2b')](_0x3f6fd0,function(_0x542702){return _0x542702['removeAgents'](_0x350854,{'transaction':_0x78760f})['then'](function(){var _0x5ca631=_['map'](_0x350854,function(_0x17f108){socket['emit'](_0xb111('0x46')+_0x4ffd87+_0xb111('0x90'),{'UserId':Number(_0x17f108),[_0x4ffd87+_0xb111('0x7c')]:_0x542702['id']});if(_0x4ffd87!==_0xb111('0x79')){return;}return db[_0xb111('0x86')][_0xb111('0x4e')]({'where':{'VoiceQueueId':_0x542702['id'],'UserId':_0x17f108},'transaction':_0x78760f});});return Promise[_0xb111('0x8c')](_0x5ca631);});});return Promise[_0xb111('0x8c')](_0x4794d0);});});return Promise[_0xb111('0x8c')](_0x553122)['then'](function(){return _0x5c0ff6['removeAgents'](_0x350854,{'transaction':_0x78760f});})[_0xb111('0x24')](function(){return db[_0xb111('0x63')][_0xb111('0x68')]({'where':{'teamId':_0x51ce99}})['then'](function(_0x4ee1b6){if(_0x4ee1b6){var _0x3a5211=_[_0xb111('0x2b')](_0x350854,function(_0x4a6046){db[_0xb111('0x64')][_0xb111('0x4e')]({'where':{'UserId':_0x4a6046,'VoicePrefixId':_0x4ee1b6[_0xb111('0x65')]}});});return Promise[_0xb111('0x8c')](_0x3a5211);}});});});}})[_0xb111('0x24')](respondWithStatusCode(_0x3cdc1d,null))[_0xb111('0x41')](handleError(_0x3cdc1d,null));};exports[_0xb111('0x91')]=function(_0x5297e6,_0x2cb939,_0x28102e){var _0x5c8059={};var _0x11cb0={};var _0x47b338;var _0x13045b;return db[_0xb111('0x3d')]['findOne']({'where':{'id':_0x5297e6[_0xb111('0x43')]['id']}})[_0xb111('0x24')](handleEntityNotFound(_0x2cb939,null))[_0xb111('0x24')](function(_0x5bf3ea){if(_0x5bf3ea){_0x47b338=_0x5bf3ea;_0x11cb0[_0xb111('0x30')]=_[_0xb111('0x2c')](db[_0xb111('0x7e')][_0xb111('0x27')]);_0x11cb0[_0xb111('0x2d')]=_[_0xb111('0x2c')](_0x5297e6[_0xb111('0x2d')]);_0x11cb0[_0xb111('0x2e')]=_[_0xb111('0x2f')](_0x11cb0[_0xb111('0x30')],_0x11cb0[_0xb111('0x2d')]);_0x5c8059[_0xb111('0x31')]=_[_0xb111('0x2f')](_0x11cb0[_0xb111('0x30')],qs[_0xb111('0x32')](_0x5297e6[_0xb111('0x2d')][_0xb111('0x32')]));_0x5c8059[_0xb111('0x31')]=_0x5c8059[_0xb111('0x31')][_0xb111('0x33')]?_0x5c8059[_0xb111('0x31')]:_0x11cb0['model'];_0x5c8059[_0xb111('0x36')]=qs[_0xb111('0x37')](_0x5297e6[_0xb111('0x2d')][_0xb111('0x37')]);_0x5c8059[_0xb111('0x3a')]=qs[_0xb111('0x2e')](_[_0xb111('0x38')](_0x5297e6[_0xb111('0x2d')],_0x11cb0['filters']));if(_0x5297e6[_0xb111('0x2d')][_0xb111('0x39')]){_0x5c8059['where']=_['merge'](_0x5c8059[_0xb111('0x3a')],{'$or':_[_0xb111('0x2b')](_0x5c8059[_0xb111('0x31')],function(_0x296790){var _0x4c3550={};_0x4c3550[_0x296790]={'$like':'%'+_0x5297e6[_0xb111('0x2d')]['filter']+'%'};return _0x4c3550;})});}_0x5c8059=_[_0xb111('0x3b')]({},_0x5c8059,_0x5297e6[_0xb111('0x3c')]);return _0x47b338[_0xb111('0x91')](_0x5c8059);}})[_0xb111('0x24')](function(_0x179b3b){if(_0x179b3b){_0x13045b=_0x179b3b[_0xb111('0x33')];if(!_0x5297e6[_0xb111('0x2d')][_0xb111('0x34')](_0xb111('0x35'))){_0x5c8059['limit']=qs[_0xb111('0x1e')](_0x5297e6[_0xb111('0x2d')]['limit']);_0x5c8059[_0xb111('0x1c')]=qs[_0xb111('0x1c')](_0x5297e6['query'][_0xb111('0x1c')]);}return _0x47b338['getAgents'](_0x5c8059);}})[_0xb111('0x24')](function(_0x154872){if(_0x154872){return _0x154872?{'count':_0x13045b,'rows':_0x154872}:null;}})[_0xb111('0x24')](respondWithResult(_0x2cb939,null))[_0xb111('0x41')](handleError(_0x2cb939,null));}; \ No newline at end of file +var _0xd698=['reject','save','update','then','stack','name','map','rawAttributes','fieldName','type','query','filters','model','attributes','fields','length','nolimit','sort','where','pick','merge','VIRTUAL','filter','options','Team','includeAll','findAll','rows','catch','keys','intersection','include','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','error','params','destroy','sequelize','Sequelize','QueryTypes','SELECT','UserId','SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20','VoiceQueueId','UserVoiceQueue','SELECT\x20MailQueueId\x20FROM\x20team_has_mail_queues\x20WHERE\x20TeamId\x20=\x20','MailQueueId','UserMailQueue','SELECT\x20SmsQueueId\x20FROM\x20team_has_sms_queues\x20WHERE\x20TeamId\x20=\x20','SmsQueueId','UserSmsQueue','SELECT\x20ChatQueueId\x20FROM\x20team_has_chat_queues\x20WHERE\x20TeamId\x20=\x20','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','SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20','UserWhatsappQueue','TeamVoicePrefix','UserVoicePrefix','VoicePrefixId','findOne','isValidChannel','channel','ValidationError','Unknown\x20channel','capitalize','toLowerCase','Queue','Queues','addQueues','ids','removeQueues','remove','addAgents','Voice','Chat','Mail','Sms','Fax','Openchannel','Whatsapp','transaction','penalty','defaults','TeamVoiceQueue','User','findOrCreate','emit','user','Queue:save','QueueId','online','voicePause','interface','UserVoiceQueueRt','upsert','isNil','format','SIP/%s','all','spread','isArray','Queue:remove','removeAgents','getAgents','order','hasOwnProperty','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','register','sendStatus','status','end','offset','undefined','limit','count','Content-Range','apply'];(function(_0x5117cb,_0x1da3ae){var _0x4e8f9a=function(_0x5e43c1){while(--_0x5e43c1){_0x5117cb['push'](_0x5117cb['shift']());}};_0x4e8f9a(++_0x1da3ae);}(_0xd698,0x1ac));var _0x8d69=function(_0x108422,_0x342909){_0x108422=_0x108422-0x0;var _0x2faf94=_0xd698[_0x108422];return _0x2faf94;};'use strict';var emlformat=require(_0x8d69('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x8d69('0x1'));var rp=require(_0x8d69('0x2'));var moment=require(_0x8d69('0x3'));var BPromise=require(_0x8d69('0x4'));var Mustache=require(_0x8d69('0x5'));var util=require(_0x8d69('0x6'));var path=require(_0x8d69('0x7'));var sox=require(_0x8d69('0x8'));var csv=require(_0x8d69('0x9'));var ejs=require(_0x8d69('0xa'));var fs=require('fs');var fs_extra=require(_0x8d69('0xb'));var _=require('lodash');var squel=require(_0x8d69('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x8d69('0xd'));var toCsv=require(_0x8d69('0x9'));var querystring=require(_0x8d69('0xe'));var Papa=require(_0x8d69('0xf'));var Redis=require(_0x8d69('0x10'));var authService=require(_0x8d69('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x8d69('0x12'))(_0x8d69('0x13'));var utils=require(_0x8d69('0x14'));var config=require(_0x8d69('0x15'));var licenseUtil=require(_0x8d69('0x16'));var db=require(_0x8d69('0x17'))['db'];config[_0x8d69('0x18')]=_['defaults'](config[_0x8d69('0x18')],{'host':_0x8d69('0x19'),'port':0x18eb});var socket=require(_0x8d69('0x1a'))(new Redis(config[_0x8d69('0x18')]));require('./team.socket')[_0x8d69('0x1b')](socket);function respondWithStatusCode(_0x3a94cc,_0x370560){_0x370560=_0x370560||0xcc;return function(_0x410a3a){if(_0x410a3a){return _0x3a94cc[_0x8d69('0x1c')](_0x370560);}return _0x3a94cc[_0x8d69('0x1d')](_0x370560)[_0x8d69('0x1e')]();};}function respondWithResult(_0x1f8060,_0x43bf13){_0x43bf13=_0x43bf13||0xc8;return function(_0x19e66e){if(_0x19e66e){return _0x1f8060[_0x8d69('0x1d')](_0x43bf13)['json'](_0x19e66e);}};}function respondWithFilteredResult(_0x3e1212,_0x153aa7){return function(_0x2e091c){if(_0x2e091c){var _0x5eae56=typeof _0x153aa7[_0x8d69('0x1f')]===_0x8d69('0x20')&&typeof _0x153aa7[_0x8d69('0x21')]==='undefined';var _0x1c874b=_0x2e091c[_0x8d69('0x22')];var _0x275988=_0x5eae56?0x0:_0x153aa7[_0x8d69('0x1f')];var _0x34d52c=_0x5eae56?_0x2e091c[_0x8d69('0x22')]:_0x153aa7['offset']+_0x153aa7[_0x8d69('0x21')];var _0x5087f4;if(_0x34d52c>=_0x1c874b){_0x34d52c=_0x1c874b;_0x5087f4=0xc8;}else{_0x5087f4=0xce;}_0x3e1212['status'](_0x5087f4);return _0x3e1212['set'](_0x8d69('0x23'),_0x275988+'-'+_0x34d52c+'/'+_0x1c874b)['json'](_0x2e091c);}return null;};}function patchUpdates(_0x28c551){return function(_0x623ae5){try{jsonpatch[_0x8d69('0x24')](_0x623ae5,_0x28c551,!![]);}catch(_0x47fc3b){return BPromise[_0x8d69('0x25')](_0x47fc3b);}return _0x623ae5[_0x8d69('0x26')]();};}function saveUpdates(_0x17cd97,_0x4b8eda){return function(_0x5b3080){if(_0x5b3080){return _0x5b3080[_0x8d69('0x27')](_0x17cd97)[_0x8d69('0x28')](function(_0x4d9a57){return _0x4d9a57;});}return null;};}function handleEntityNotFound(_0x5e62b1,_0x253096){return function(_0x634cb3){if(!_0x634cb3){_0x5e62b1[_0x8d69('0x1c')](0x194);}return _0x634cb3;};}function handleError(_0x4e2fef,_0x5891c0){_0x5891c0=_0x5891c0||0x1f4;return function(_0x38b682){logger['error'](_0x38b682[_0x8d69('0x29')]);if(_0x38b682['name']){delete _0x38b682[_0x8d69('0x2a')];}_0x4e2fef['status'](_0x5891c0)['send'](_0x38b682);};}exports['index']=function(_0x19b402,_0x58650c){var _0x50d84d={},_0x19e1b8={},_0xdd887b={'count':0x0,'rows':[]};var _0x1c009d=_[_0x8d69('0x2b')](db['Team'][_0x8d69('0x2c')],function(_0x1aafa4){return{'name':_0x1aafa4[_0x8d69('0x2d')],'type':_0x1aafa4[_0x8d69('0x2e')]['key']};});_0x19e1b8['model']=_[_0x8d69('0x2b')](_0x1c009d,_0x8d69('0x2a'));_0x19e1b8[_0x8d69('0x2f')]=_['keys'](_0x19b402[_0x8d69('0x2f')]);_0x19e1b8[_0x8d69('0x30')]=_['intersection'](_0x19e1b8[_0x8d69('0x31')],_0x19e1b8['query']);_0x50d84d[_0x8d69('0x32')]=_['intersection'](_0x19e1b8[_0x8d69('0x31')],qs[_0x8d69('0x33')](_0x19b402[_0x8d69('0x2f')][_0x8d69('0x33')]));_0x50d84d['attributes']=_0x50d84d['attributes'][_0x8d69('0x34')]?_0x50d84d[_0x8d69('0x32')]:_0x19e1b8[_0x8d69('0x31')];if(!_0x19b402['query']['hasOwnProperty'](_0x8d69('0x35'))){_0x50d84d[_0x8d69('0x21')]=qs[_0x8d69('0x21')](_0x19b402[_0x8d69('0x2f')][_0x8d69('0x21')]);_0x50d84d[_0x8d69('0x1f')]=qs[_0x8d69('0x1f')](_0x19b402[_0x8d69('0x2f')]['offset']);}_0x50d84d['order']=qs[_0x8d69('0x36')](_0x19b402[_0x8d69('0x2f')][_0x8d69('0x36')]);_0x50d84d[_0x8d69('0x37')]=qs[_0x8d69('0x30')](_[_0x8d69('0x38')](_0x19b402[_0x8d69('0x2f')],_0x19e1b8[_0x8d69('0x30')]),_0x1c009d);if(_0x19b402[_0x8d69('0x2f')]['filter']){_0x50d84d['where']=_[_0x8d69('0x39')](_0x50d84d['where'],{'$or':_[_0x8d69('0x2b')](_0x1c009d,function(_0x249cfe){if(_0x249cfe['type']!==_0x8d69('0x3a')){var _0x28e7a9={};_0x28e7a9[_0x249cfe['name']]={'$like':'%'+_0x19b402['query'][_0x8d69('0x3b')]+'%'};return _0x28e7a9;}})});}_0x50d84d=_[_0x8d69('0x39')]({},_0x50d84d,_0x19b402[_0x8d69('0x3c')]);var _0x312981={'where':_0x50d84d['where']};return db[_0x8d69('0x3d')]['count'](_0x312981)[_0x8d69('0x28')](function(_0x2b7ce3){_0xdd887b[_0x8d69('0x22')]=_0x2b7ce3;if(_0x19b402[_0x8d69('0x2f')][_0x8d69('0x3e')]){_0x50d84d['include']=[{'all':!![]}];}return db[_0x8d69('0x3d')][_0x8d69('0x3f')](_0x50d84d);})[_0x8d69('0x28')](function(_0x2874a2){_0xdd887b[_0x8d69('0x40')]=_0x2874a2;return _0xdd887b;})[_0x8d69('0x28')](respondWithFilteredResult(_0x58650c,_0x50d84d))[_0x8d69('0x41')](handleError(_0x58650c,null));};exports['show']=function(_0x2b960f,_0x59176e){var _0x3ba414={'raw':![],'where':{'id':_0x2b960f['params']['id']}},_0x349e81={};_0x349e81[_0x8d69('0x31')]=_[_0x8d69('0x42')](db[_0x8d69('0x3d')]['rawAttributes']);_0x349e81[_0x8d69('0x2f')]=_[_0x8d69('0x42')](_0x2b960f[_0x8d69('0x2f')]);_0x349e81['filters']=_[_0x8d69('0x43')](_0x349e81[_0x8d69('0x31')],_0x349e81[_0x8d69('0x2f')]);_0x3ba414[_0x8d69('0x32')]=_[_0x8d69('0x43')](_0x349e81['model'],qs[_0x8d69('0x33')](_0x2b960f[_0x8d69('0x2f')]['fields']));_0x3ba414[_0x8d69('0x32')]=_0x3ba414[_0x8d69('0x32')][_0x8d69('0x34')]?_0x3ba414['attributes']:_0x349e81['model'];if(_0x2b960f['query']['includeAll']){_0x3ba414[_0x8d69('0x44')]=[{'all':!![]}];}_0x3ba414=_[_0x8d69('0x39')]({},_0x3ba414,_0x2b960f['options']);return db[_0x8d69('0x3d')][_0x8d69('0x45')](_0x3ba414)[_0x8d69('0x28')](handleEntityNotFound(_0x59176e,null))[_0x8d69('0x28')](respondWithResult(_0x59176e,null))[_0x8d69('0x41')](handleError(_0x59176e,null));};exports[_0x8d69('0x46')]=function(_0x517986,_0xe68e44){return db[_0x8d69('0x3d')][_0x8d69('0x46')](_0x517986[_0x8d69('0x47')],{})[_0x8d69('0x28')](function(_0x347b62){var _0x1f7ade=_0x517986['user']['get']({'plain':!![]});if(!_0x1f7ade)throw new Error(_0x8d69('0x48'));if(_0x1f7ade[_0x8d69('0x49')]==='user'){var _0x486340=_0x347b62[_0x8d69('0x4a')]({'plain':!![]});var _0x1d41c5='Teams';return db[_0x8d69('0x4b')]['find']({'where':{'name':_0x1d41c5,'userProfileId':_0x1f7ade[_0x8d69('0x4c')]},'raw':!![]})['then'](function(_0x5f4cd2){if(_0x5f4cd2&&_0x5f4cd2[_0x8d69('0x4d')]===0x0){return db[_0x8d69('0x4e')]['create']({'name':_0x486340[_0x8d69('0x2a')],'resourceId':_0x486340['id'],'type':_0x5f4cd2['name'],'sectionId':_0x5f4cd2['id']},{})[_0x8d69('0x28')](function(){return _0x347b62;});}else{return _0x347b62;}})[_0x8d69('0x41')](function(_0x269eec){logger[_0x8d69('0x4f')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x269eec);throw _0x269eec;});}return _0x347b62;})[_0x8d69('0x28')](respondWithResult(_0xe68e44,0xc9))[_0x8d69('0x41')](handleError(_0xe68e44,null));};exports[_0x8d69('0x27')]=function(_0x2c0a86,_0x341ffc){if(_0x2c0a86[_0x8d69('0x47')]['id']){delete _0x2c0a86['body']['id'];}return db[_0x8d69('0x3d')]['find']({'where':{'id':_0x2c0a86[_0x8d69('0x50')]['id']}})[_0x8d69('0x28')](handleEntityNotFound(_0x341ffc,null))[_0x8d69('0x28')](saveUpdates(_0x2c0a86[_0x8d69('0x47')],null))['then'](respondWithResult(_0x341ffc,null))[_0x8d69('0x41')](handleError(_0x341ffc,null));};exports[_0x8d69('0x51')]=function(_0x10557f,_0x5ed3be){var _0x1a0dfd=_0x10557f['params']['id'];var _0x3a4c72=[];return db['sequelize']['transaction'](function(_0x40435c){var _0x36bd6f='SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20'+_0x1a0dfd;return db[_0x8d69('0x52')][_0x8d69('0x2f')](_0x36bd6f,{'type':db[_0x8d69('0x53')][_0x8d69('0x54')][_0x8d69('0x55')],'raw':!![],'transaction':_0x40435c})[_0x8d69('0x28')](function(_0xcaf45d){_0x3a4c72=_[_0x8d69('0x2b')](_0xcaf45d,function(_0x49789b){return Number(_0x49789b[_0x8d69('0x56')]);});})[_0x8d69('0x28')](function(){var _0x1a9fb1=_0x8d69('0x57')+_0x1a0dfd;return db[_0x8d69('0x52')][_0x8d69('0x2f')](_0x1a9fb1,{'type':db[_0x8d69('0x53')][_0x8d69('0x54')][_0x8d69('0x55')],'raw':!![],'transaction':_0x40435c});})[_0x8d69('0x28')](function(_0x18a96f){var _0x22aa24=_['map'](_0x18a96f,function(_0x1e2661){return Number(_0x1e2661[_0x8d69('0x58')]);});return db[_0x8d69('0x59')][_0x8d69('0x51')]({'where':{'UserId':{'$in':_0x3a4c72},'VoiceQueueId':{'$in':_0x22aa24}},'transaction':_0x40435c});})[_0x8d69('0x28')](function(){var _0x4281ab=_0x8d69('0x5a')+_0x1a0dfd;return db[_0x8d69('0x52')][_0x8d69('0x2f')](_0x4281ab,{'type':db[_0x8d69('0x53')][_0x8d69('0x54')][_0x8d69('0x55')],'raw':!![],'transaction':_0x40435c});})['then'](function(_0x5c6a3c){var _0x1ae422=_[_0x8d69('0x2b')](_0x5c6a3c,function(_0x417b54){return Number(_0x417b54[_0x8d69('0x5b')]);});return db[_0x8d69('0x5c')][_0x8d69('0x51')]({'where':{'UserId':{'$in':_0x3a4c72},'MailQueueId':{'$in':_0x1ae422}},'transaction':_0x40435c});})[_0x8d69('0x28')](function(){var _0x524f3a=_0x8d69('0x5d')+_0x1a0dfd;return db[_0x8d69('0x52')][_0x8d69('0x2f')](_0x524f3a,{'type':db[_0x8d69('0x53')][_0x8d69('0x54')]['SELECT'],'raw':!![],'transaction':_0x40435c});})[_0x8d69('0x28')](function(_0x5d616b){var _0x212f19=_[_0x8d69('0x2b')](_0x5d616b,function(_0x400f91){return Number(_0x400f91[_0x8d69('0x5e')]);});return db[_0x8d69('0x5f')][_0x8d69('0x51')]({'where':{'UserId':{'$in':_0x3a4c72},'SmsQueueId':{'$in':_0x212f19}},'transaction':_0x40435c});})[_0x8d69('0x28')](function(){var _0x24fd1c=_0x8d69('0x60')+_0x1a0dfd;return db[_0x8d69('0x52')][_0x8d69('0x2f')](_0x24fd1c,{'type':db['Sequelize'][_0x8d69('0x54')][_0x8d69('0x55')],'raw':!![],'transaction':_0x40435c});})[_0x8d69('0x28')](function(_0x2aaecd){var _0x1a0eee=_['map'](_0x2aaecd,function(_0x7e5df){return Number(_0x7e5df['ChatQueueId']);});return db['UserChatQueue']['destroy']({'where':{'UserId':{'$in':_0x3a4c72},'ChatQueueId':{'$in':_0x1a0eee}},'transaction':_0x40435c});})['then'](function(){var _0x375e03=_0x8d69('0x61')+_0x1a0dfd;return db[_0x8d69('0x52')][_0x8d69('0x2f')](_0x375e03,{'type':db[_0x8d69('0x53')]['QueryTypes'][_0x8d69('0x55')],'raw':!![],'transaction':_0x40435c});})[_0x8d69('0x28')](function(_0x5a1dbd){var _0x3c52d1=_['map'](_0x5a1dbd,function(_0x1decc6){return Number(_0x1decc6[_0x8d69('0x62')]);});return db[_0x8d69('0x63')]['destroy']({'where':{'UserId':{'$in':_0x3a4c72},'FaxQueueId':{'$in':_0x3c52d1}},'transaction':_0x40435c});})['then'](function(){var _0x294ff2=_0x8d69('0x64')+_0x1a0dfd;return db[_0x8d69('0x52')][_0x8d69('0x2f')](_0x294ff2,{'type':db[_0x8d69('0x53')][_0x8d69('0x54')][_0x8d69('0x55')],'raw':!![],'transaction':_0x40435c});})[_0x8d69('0x28')](function(_0x5c1ab2){var _0x72e0f9=_['map'](_0x5c1ab2,function(_0x22a2e2){return Number(_0x22a2e2[_0x8d69('0x65')]);});return db[_0x8d69('0x66')][_0x8d69('0x51')]({'where':{'UserId':{'$in':_0x3a4c72},'OpenchannelQueueId':{'$in':_0x72e0f9}},'transaction':_0x40435c});})[_0x8d69('0x28')](function(){var _0x37d255=_0x8d69('0x67')+_0x1a0dfd;return db[_0x8d69('0x52')][_0x8d69('0x2f')](_0x37d255,{'type':db[_0x8d69('0x53')][_0x8d69('0x54')][_0x8d69('0x55')],'raw':!![],'transaction':_0x40435c});})[_0x8d69('0x28')](function(_0x1c9d98){var _0x2a4d97=_['map'](_0x1c9d98,function(_0x1586ef){return Number(_0x1586ef['WhatsappQueueId']);});return db[_0x8d69('0x68')][_0x8d69('0x51')]({'where':{'UserId':{'$in':_0x3a4c72},'WhatsappQueueId':{'$in':_0x2a4d97}},'transaction':_0x40435c});})[_0x8d69('0x28')](function(){return db[_0x8d69('0x69')]['find']({'where':{'TeamId':_0x1a0dfd}});})['then'](function(_0x294699){if(_0x294699===null){return;}return db[_0x8d69('0x6a')]['destroy']({'where':{'UserId':{'$in':_0x3a4c72},'VoicePrefixId':_0x294699[_0x8d69('0x6b')]},'transaction':_0x40435c});})[_0x8d69('0x28')](function(){return db[_0x8d69('0x3d')][_0x8d69('0x51')]({'where':{'id':_0x1a0dfd},'cascade':!![],'transaction':_0x40435c});})[_0x8d69('0x28')](function(_0x28ca0d){if(_0x28ca0d===0x0){_0x5ed3be['sendStatus'](0x194);}else{return db[_0x8d69('0x4e')][_0x8d69('0x51')]({'where':{'type':'Teams','resourceId':_0x1a0dfd},'cascade':!![],'transaction':_0x40435c})['then'](function(){_0x5ed3be[_0x8d69('0x1d')](0xcc)['end']();});}})['catch'](function(_0x1eb3f4){_0x5ed3be[_0x8d69('0x1d')](0x1f4)['send'](_0x1eb3f4);});});};exports['getQueues']=function(_0x4e6ce4,_0x55d94c,_0x621bcd){return db[_0x8d69('0x3d')][_0x8d69('0x6c')]({'where':{'id':_0x4e6ce4[_0x8d69('0x50')]['id']}})['then'](handleEntityNotFound(_0x55d94c,null))[_0x8d69('0x28')](function(_0x2c8c0a){if(!_0x4e6ce4['query']['channel']||!utils[_0x8d69('0x6d')](_0x4e6ce4[_0x8d69('0x2f')][_0x8d69('0x6e')])){throw new db[(_0x8d69('0x53'))][(_0x8d69('0x6f'))](_0x8d69('0x70'));}var _0x1460d4={};var _0xeb1a2f={};_0xeb1a2f[_0x8d69('0x31')]=_[_0x8d69('0x42')](db[_[_0x8d69('0x71')](_0x4e6ce4['query'][_0x8d69('0x6e')][_0x8d69('0x72')]())+_0x8d69('0x73')][_0x8d69('0x2c')]);_0xeb1a2f['query']=_[_0x8d69('0x42')](_0x4e6ce4['query']);_0xeb1a2f[_0x8d69('0x30')]=_[_0x8d69('0x43')](_0xeb1a2f['model'],_0xeb1a2f[_0x8d69('0x2f')]);_0x1460d4[_0x8d69('0x32')]=_[_0x8d69('0x43')](_0xeb1a2f[_0x8d69('0x31')],qs[_0x8d69('0x33')](_0x4e6ce4[_0x8d69('0x2f')][_0x8d69('0x33')]));_0x1460d4[_0x8d69('0x32')]=_0x1460d4[_0x8d69('0x32')]['length']?_0x1460d4[_0x8d69('0x32')]:_0xeb1a2f[_0x8d69('0x31')];_0x1460d4[_0x8d69('0x21')]=qs[_0x8d69('0x21')](_0x4e6ce4['query'][_0x8d69('0x21')]);_0x1460d4[_0x8d69('0x1f')]=qs[_0x8d69('0x1f')](_0x4e6ce4['query'][_0x8d69('0x1f')]);_0x1460d4['order']=qs[_0x8d69('0x36')](_0x4e6ce4[_0x8d69('0x2f')][_0x8d69('0x36')]);_0x1460d4[_0x8d69('0x37')]=qs['filters'](_[_0x8d69('0x38')](_0x4e6ce4[_0x8d69('0x2f')],_0xeb1a2f[_0x8d69('0x30')]));_0x1460d4=_['merge']({},_0x1460d4,_0x4e6ce4[_0x8d69('0x3c')]);return _0x2c8c0a[_0x8d69('0x4a')+_[_0x8d69('0x71')](_0x4e6ce4[_0x8d69('0x2f')][_0x8d69('0x6e')][_0x8d69('0x72')]())+_0x8d69('0x74')](_0x1460d4);})['then'](respondWithResult(_0x55d94c,null))[_0x8d69('0x41')](handleError(_0x55d94c,null));};exports[_0x8d69('0x75')]=function(_0x5f3610,_0x146b9e,_0x3fbf18){return db[_0x8d69('0x3d')][_0x8d69('0x6c')]({'where':{'id':_0x5f3610[_0x8d69('0x50')]['id']}})[_0x8d69('0x28')](function(_0x2c744d){if(_0x2c744d){if(!_0x5f3610['body']['channel']||!utils[_0x8d69('0x6d')](_0x5f3610['body']['channel'])){throw new db[(_0x8d69('0x53'))][(_0x8d69('0x6f'))](_0x8d69('0x70'));}return _0x2c744d['add'+_['capitalize'](_0x5f3610[_0x8d69('0x47')][_0x8d69('0x6e')]['toLowerCase']())+_0x8d69('0x74')](_0x5f3610['body'][_0x8d69('0x76')]);}return null;})[_0x8d69('0x28')](handleEntityNotFound(_0x146b9e,null))[_0x8d69('0x28')](respondWithStatusCode(_0x146b9e,null))[_0x8d69('0x41')](handleError(_0x146b9e,null));};exports[_0x8d69('0x77')]=function(_0xe997b0,_0x2b49bf,_0x564a07){return db[_0x8d69('0x3d')][_0x8d69('0x6c')]({'where':{'id':_0xe997b0['params']['id']}})[_0x8d69('0x28')](function(_0x2e7172){if(_0x2e7172){if(!_0xe997b0[_0x8d69('0x2f')]['channel']||!utils['isValidChannel'](_0xe997b0[_0x8d69('0x2f')][_0x8d69('0x6e')])){throw new db[(_0x8d69('0x53'))][(_0x8d69('0x6f'))](_0x8d69('0x70'));}return _0x2e7172[_0x8d69('0x78')+_['capitalize'](_0xe997b0[_0x8d69('0x2f')][_0x8d69('0x6e')][_0x8d69('0x72')]())+_0x8d69('0x74')](_0xe997b0[_0x8d69('0x2f')]['ids']);}return null;})['then'](handleEntityNotFound(_0x2b49bf,null))[_0x8d69('0x28')](respondWithStatusCode(_0x2b49bf,null))['catch'](handleError(_0x2b49bf,null));};exports[_0x8d69('0x79')]=function(_0x906b51,_0x343216){var _0x44ba02=_['isArray'](_0x906b51['body'][_0x8d69('0x76')])?_0x906b51['body'][_0x8d69('0x76')]:[_0x906b51[_0x8d69('0x47')][_0x8d69('0x76')]];var _0x276bb1=_0x906b51[_0x8d69('0x50')]['id'];return db[_0x8d69('0x3d')][_0x8d69('0x45')]({'where':{'id':_0x276bb1}})[_0x8d69('0x28')](handleEntityNotFound(_0x343216,null))[_0x8d69('0x28')](function(_0x3a360a){if(_0x3a360a){var _0x578045=[_0x8d69('0x7a'),_0x8d69('0x7b'),_0x8d69('0x7c'),_0x8d69('0x7d'),_0x8d69('0x7e'),_0x8d69('0x7f'),_0x8d69('0x80')];return db[_0x8d69('0x52')][_0x8d69('0x81')](function(_0x5189ae){var _0x5cfa59=_[_0x8d69('0x2b')](_0x578045,function(_0x34ec15){var _0x561b35={'attributes':['id','name']};if(_0x34ec15===_0x8d69('0x7a')){_0x561b35['through']={'attributes':[_0x8d69('0x82')]};}return _0x3a360a['get'+_0x34ec15+_0x8d69('0x74')](_0x561b35)[_0x8d69('0x28')](function(_0x24d802){var _0x5454de=_[_0x8d69('0x2b')](_0x24d802,function(_0x502e3b){var _0x4854f4=_[_0x8d69('0x2b')](_0x44ba02,function(_0xcf9eea){var _0x2b84fe={'where':{'UserId':_0xcf9eea,[_0x34ec15+'QueueId']:_0x502e3b['id']},'transaction':_0x5189ae};if(_0x34ec15===_0x8d69('0x7a')){_0x2b84fe[_0x8d69('0x83')]={'penalty':_0x502e3b[_0x8d69('0x84')][_0x8d69('0x82')]};}return db[_0x8d69('0x85')+_0x34ec15+_0x8d69('0x73')][_0x8d69('0x86')](_0x2b84fe)[_0x8d69('0x28')](function(){socket[_0x8d69('0x87')](_0x8d69('0x88')+_0x34ec15+_0x8d69('0x89'),{'UserId':_0xcf9eea,[_0x34ec15+_0x8d69('0x8a')]:_0x502e3b['id']});if(_0x34ec15!==_0x8d69('0x7a')){return;}return db['User'][_0x8d69('0x3f')]({'where':{'id':_0x44ba02,'online':0x1},'attributes':['id',_0x8d69('0x2a'),_0x8d69('0x8b'),_0x8d69('0x8c'),_0x8d69('0x8d')],'raw':!![]})[_0x8d69('0x28')](function(_0x22111c){var _0x10d583=_[_0x8d69('0x2b')](_0x22111c,function(_0x49507d){return db[_0x8d69('0x8e')][_0x8d69('0x8f')]({'membername':_0x49507d[_0x8d69('0x2a')],'UserId':_0x49507d['id'],'queue_name':_0x502e3b['name'],'VoiceQueueId':_0x502e3b['id'],'interface':_[_0x8d69('0x90')](_0x49507d[_0x8d69('0x8d')])?util[_0x8d69('0x91')](_0x8d69('0x92'),_0x49507d[_0x8d69('0x2a')]):_0x49507d[_0x8d69('0x8d')],'paused':_0x49507d[_0x8d69('0x8c')]||![],'penalty':_0x502e3b[_0x8d69('0x84')][_0x8d69('0x82')]},{'transaction':_0x5189ae});});return Promise[_0x8d69('0x93')](_0x10d583);});});});return Promise['all'](_0x4854f4);});return Promise[_0x8d69('0x93')](_0x5454de);})[_0x8d69('0x28')](function(){return db[_0x8d69('0x69')][_0x8d69('0x6c')]({'where':{'teamId':_0x276bb1}})['then'](function(_0xfbf95){if(_0xfbf95){var _0x3ffa43=_[_0x8d69('0x2b')](_0x44ba02,function(_0x45e323){db[_0x8d69('0x6a')][_0x8d69('0x8f')]({'UserId':_0x45e323,'VoicePrefixId':_0xfbf95[_0x8d69('0x6b')]});});return Promise['all'](_0x3ffa43);}});});});return Promise[_0x8d69('0x93')](_0x5cfa59)[_0x8d69('0x28')](function(){return _0x3a360a[_0x8d69('0x79')](_0x44ba02,{'transaction':_0x5189ae})[_0x8d69('0x94')](function(_0x1cf155){return _0x1cf155;});});});}})[_0x8d69('0x28')](respondWithResult(_0x343216,null))['catch'](handleError(_0x343216,null));};exports['removeAgents']=function(_0x430733,_0x369d82){var _0x5a6174=_[_0x8d69('0x95')](_0x430733['query'][_0x8d69('0x76')])?_0x430733['query'][_0x8d69('0x76')]:[_0x430733['query'][_0x8d69('0x76')]];var _0x1d7359=_0x430733[_0x8d69('0x50')]['id'];return db[_0x8d69('0x3d')][_0x8d69('0x45')]({'where':{'id':_0x1d7359}})['then'](handleEntityNotFound(_0x369d82,null))[_0x8d69('0x28')](function(_0x5b5604){if(_0x5b5604){var _0x599cee=[_0x8d69('0x7a'),'Chat',_0x8d69('0x7c'),_0x8d69('0x7d'),_0x8d69('0x7e'),_0x8d69('0x7f'),'Whatsapp'];return db[_0x8d69('0x52')][_0x8d69('0x81')](function(_0x206933){var _0x42095c=_[_0x8d69('0x2b')](_0x599cee,function(_0x48cc44){var _0x3350a6={'attributes':['id',_0x8d69('0x2a')]};return _0x5b5604[_0x8d69('0x4a')+_0x48cc44+_0x8d69('0x74')](_0x3350a6)[_0x8d69('0x28')](function(_0x12aacd){var _0x3002d7=_['map'](_0x12aacd,function(_0x27302a){return _0x27302a['removeAgents'](_0x5a6174,{'transaction':_0x206933})[_0x8d69('0x28')](function(){var _0x5a3331=_[_0x8d69('0x2b')](_0x5a6174,function(_0x158833){socket[_0x8d69('0x87')](_0x8d69('0x88')+_0x48cc44+_0x8d69('0x96'),{'UserId':Number(_0x158833),[_0x48cc44+_0x8d69('0x8a')]:_0x27302a['id']});if(_0x48cc44!=='Voice'){return;}return db[_0x8d69('0x8e')][_0x8d69('0x51')]({'where':{'VoiceQueueId':_0x27302a['id'],'UserId':_0x158833},'transaction':_0x206933});});return Promise['all'](_0x5a3331);});});return Promise[_0x8d69('0x93')](_0x3002d7);});});return Promise[_0x8d69('0x93')](_0x42095c)[_0x8d69('0x28')](function(){return _0x5b5604[_0x8d69('0x97')](_0x5a6174,{'transaction':_0x206933});})[_0x8d69('0x28')](function(){return db[_0x8d69('0x69')][_0x8d69('0x6c')]({'where':{'teamId':_0x1d7359}})['then'](function(_0xb41332){if(_0xb41332){var _0x697099=_[_0x8d69('0x2b')](_0x5a6174,function(_0x1e9559){db[_0x8d69('0x6a')][_0x8d69('0x51')]({'where':{'UserId':_0x1e9559,'VoicePrefixId':_0xb41332['VoicePrefixId']}});});return Promise[_0x8d69('0x93')](_0x697099);}});});});}})[_0x8d69('0x28')](respondWithStatusCode(_0x369d82,null))[_0x8d69('0x41')](handleError(_0x369d82,null));};exports[_0x8d69('0x98')]=function(_0x3e87be,_0x218ab4,_0x5d5b87){var _0x537311={};var _0x3367cb={};var _0x4b9661;var _0x278632;return db['Team']['findOne']({'where':{'id':_0x3e87be[_0x8d69('0x50')]['id']}})[_0x8d69('0x28')](handleEntityNotFound(_0x218ab4,null))[_0x8d69('0x28')](function(_0x16cc48){if(_0x16cc48){_0x4b9661=_0x16cc48;_0x3367cb[_0x8d69('0x31')]=_[_0x8d69('0x42')](db['User'][_0x8d69('0x2c')]);_0x3367cb[_0x8d69('0x2f')]=_['keys'](_0x3e87be['query']);_0x3367cb[_0x8d69('0x30')]=_[_0x8d69('0x43')](_0x3367cb['model'],_0x3367cb[_0x8d69('0x2f')]);_0x537311['attributes']=_[_0x8d69('0x43')](_0x3367cb[_0x8d69('0x31')],qs['fields'](_0x3e87be['query']['fields']));_0x537311['attributes']=_0x537311[_0x8d69('0x32')][_0x8d69('0x34')]?_0x537311[_0x8d69('0x32')]:_0x3367cb[_0x8d69('0x31')];_0x537311[_0x8d69('0x99')]=qs['sort'](_0x3e87be[_0x8d69('0x2f')][_0x8d69('0x36')]);_0x537311[_0x8d69('0x37')]=qs['filters'](_[_0x8d69('0x38')](_0x3e87be[_0x8d69('0x2f')],_0x3367cb[_0x8d69('0x30')]));if(_0x3e87be[_0x8d69('0x2f')]['filter']){_0x537311['where']=_[_0x8d69('0x39')](_0x537311[_0x8d69('0x37')],{'$or':_[_0x8d69('0x2b')](_0x537311[_0x8d69('0x32')],function(_0x14d914){var _0x8cb2e8={};_0x8cb2e8[_0x14d914]={'$like':'%'+_0x3e87be[_0x8d69('0x2f')][_0x8d69('0x3b')]+'%'};return _0x8cb2e8;})});}_0x537311=_[_0x8d69('0x39')]({},_0x537311,_0x3e87be[_0x8d69('0x3c')]);return _0x4b9661['getAgents'](_0x537311);}})[_0x8d69('0x28')](function(_0x502b59){if(_0x502b59){_0x278632=_0x502b59['length'];if(!_0x3e87be[_0x8d69('0x2f')][_0x8d69('0x9a')](_0x8d69('0x35'))){_0x537311['limit']=qs[_0x8d69('0x21')](_0x3e87be[_0x8d69('0x2f')]['limit']);_0x537311['offset']=qs[_0x8d69('0x1f')](_0x3e87be[_0x8d69('0x2f')][_0x8d69('0x1f')]);}return _0x4b9661[_0x8d69('0x98')](_0x537311);}})[_0x8d69('0x28')](function(_0x191966){if(_0x191966){return _0x191966?{'count':_0x278632,'rows':_0x191966}:null;}})[_0x8d69('0x28')](respondWithResult(_0x218ab4,null))['catch'](handleError(_0x218ab4,null));}; \ No newline at end of file diff --git a/server/api/team/team.events.js b/server/api/team/team.events.js index baf7365..5b533b0 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 _0xd22c=['events','../../mysqldb','Team','setMaxListeners','save','remove','emit','hook','exports'];(function(_0x648163,_0x241576){var _0x199d4d=function(_0x23055d){while(--_0x23055d){_0x648163['push'](_0x648163['shift']());}};_0x199d4d(++_0x241576);}(_0xd22c,0x132));var _0xcd22=function(_0x4316f9,_0x3dd19b){_0x4316f9=_0x4316f9-0x0;var _0x1823bb=_0xd22c[_0x4316f9];return _0x1823bb;};'use strict';var EventEmitter=require(_0xcd22('0x0'));var Team=require(_0xcd22('0x1'))['db'][_0xcd22('0x2')];var TeamEvents=new EventEmitter();TeamEvents[_0xcd22('0x3')](0x0);var events={'afterCreate':_0xcd22('0x4'),'afterUpdate':'update','afterDestroy':_0xcd22('0x5')};function emitEvent(_0x40273a){return function(_0xa7692f,_0x7a956a,_0x5f2828){TeamEvents[_0xcd22('0x6')](_0x40273a+':'+_0xa7692f['id'],_0xa7692f);TeamEvents[_0xcd22('0x6')](_0x40273a,_0xa7692f);_0x5f2828(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Team[_0xcd22('0x7')](e,emitEvent(event));}}module[_0xcd22('0x8')]=TeamEvents; \ No newline at end of file +var _0xf418=['update','remove','hasOwnProperty','hook','exports','events','../../mysqldb','Team','setMaxListeners'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0xf418,0xe6));var _0x8f41=function(_0xfcc8f0,_0x11277c){_0xfcc8f0=_0xfcc8f0-0x0;var _0x35165e=_0xf418[_0xfcc8f0];return _0x35165e;};'use strict';var EventEmitter=require(_0x8f41('0x0'));var Team=require(_0x8f41('0x1'))['db'][_0x8f41('0x2')];var TeamEvents=new EventEmitter();TeamEvents[_0x8f41('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x8f41('0x4'),'afterDestroy':_0x8f41('0x5')};function emitEvent(_0x4391c5){return function(_0x35b8aa,_0x4076bc,_0x3be09a){TeamEvents['emit'](_0x4391c5+':'+_0x35b8aa['id'],_0x35b8aa);TeamEvents['emit'](_0x4391c5,_0x35b8aa);_0x3be09a(null);};}for(var e in events){if(events[_0x8f41('0x6')](e)){var event=events[e];Team[_0x8f41('0x7')](e,emitEvent(event));}}module[_0x8f41('0x8')]=TeamEvents; \ No newline at end of file diff --git a/server/api/team/team.model.js b/server/api/team/team.model.js index 473f815..6a848a4 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 _0x01ae=['Mail','Whatsapp','resolve','all','lodash','./team.attributes','get','then','map','setDataValue','catch','exports','define','Team','Chat'];(function(_0x5cf3c0,_0x4363c1){var _0x39a680=function(_0x2a10f1){while(--_0x2a10f1){_0x5cf3c0['push'](_0x5cf3c0['shift']());}};_0x39a680(++_0x4363c1);}(_0x01ae,0xc7));var _0xe01a=function(_0xc4001c,_0x1bf8f0){_0xc4001c=_0xc4001c-0x0;var _0x49f7bc=_0x01ae[_0xc4001c];return _0x49f7bc;};'use strict';var _=require(_0xe01a('0x0'));var attributes=require(_0xe01a('0x1'));function getQueuesByChannel(_0x576e0d,_0x3acc49){var _0x1bcdc1=_0xe01a('0x2')+_0x3acc49+'Queues';return _0x576e0d[_0x1bcdc1]()[_0xe01a('0x3')](function(_0x513477){return _[_0xe01a('0x4')](_0x513477,function(_0x7f306a){_0x7f306a[_0xe01a('0x5')]('channel',_0x3acc49);return _0x7f306a;});})[_0xe01a('0x6')](function(_0x5ec5d3){throw _0x5ec5d3;});}module[_0xe01a('0x7')]=function(_0x572af1){return _0x572af1[_0xe01a('0x8')](_0xe01a('0x9'),attributes,{'tableName':'teams','paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getAssociatedQueues':function(){var _0x49418a=this;var _0x5efefb=[_0xe01a('0xa'),'Fax',_0xe01a('0xb'),'Openchannel','Sms','Voice',_0xe01a('0xc')];return Promise[_0xe01a('0xd')]()[_0xe01a('0x3')](function(){var _0x2c02a9=_[_0xe01a('0x4')](_0x5efefb,function(_0x3c061a){return getQueuesByChannel(_0x49418a,_0x3c061a);});return Promise[_0xe01a('0xe')](_0x2c02a9);})[_0xe01a('0x6')](function(_0x4e9472){throw _0x4e9472;});}}});}; \ No newline at end of file +var _0xcf5b=['resolve','all','./team.attributes','get','Queues','then','map','setDataValue','channel','catch','exports','define','Team','Openchannel','Sms','Voice','Whatsapp'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xcf5b,0x178));var _0xbcf5=function(_0x2c6810,_0x23c079){_0x2c6810=_0x2c6810-0x0;var _0x213881=_0xcf5b[_0x2c6810];return _0x213881;};'use strict';var _=require('lodash');var attributes=require(_0xbcf5('0x0'));function getQueuesByChannel(_0x21e6d7,_0x3efb54){var _0x397a5d=_0xbcf5('0x1')+_0x3efb54+_0xbcf5('0x2');return _0x21e6d7[_0x397a5d]()[_0xbcf5('0x3')](function(_0x131348){return _[_0xbcf5('0x4')](_0x131348,function(_0xc1d1a6){_0xc1d1a6[_0xbcf5('0x5')](_0xbcf5('0x6'),_0x3efb54);return _0xc1d1a6;});})[_0xbcf5('0x7')](function(_0x380de9){throw _0x380de9;});}module[_0xbcf5('0x8')]=function(_0x3cd25d){return _0x3cd25d[_0xbcf5('0x9')](_0xbcf5('0xa'),attributes,{'tableName':'teams','paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getAssociatedQueues':function(){var _0x182508=this;var _0x770076=['Chat','Fax','Mail',_0xbcf5('0xb'),_0xbcf5('0xc'),_0xbcf5('0xd'),_0xbcf5('0xe')];return Promise[_0xbcf5('0xf')]()['then'](function(){var _0x1c9c30=_[_0xbcf5('0x4')](_0x770076,function(_0x120932){return getQueuesByChannel(_0x182508,_0x120932);});return Promise[_0xbcf5('0x10')](_0x1c9c30);})[_0xbcf5('0x7')](function(_0x19b826){throw _0x19b826;});}}});}; \ No newline at end of file diff --git a/server/api/team/team.rpc.js b/server/api/team/team.rpc.js index 6e39249..eabae9c 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 _0xabaa=['socket.io-emitter','./team.socket','register','request','then','info','Team,\x20%s,\x20%s','Team,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost'];(function(_0x243fdb,_0x31adfd){var _0x2e8ecf=function(_0x307ed7){while(--_0x307ed7){_0x243fdb['push'](_0x243fdb['shift']());}};_0x2e8ecf(++_0x31adfd);}(_0xabaa,0x143));var _0xaaba=function(_0x3aac28,_0x17318e){_0x3aac28=_0x3aac28-0x0;var _0x33a310=_0xabaa[_0x3aac28];return _0x33a310;};'use strict';var _=require(_0xaaba('0x0'));var util=require(_0xaaba('0x1'));var moment=require(_0xaaba('0x2'));var BPromise=require(_0xaaba('0x3'));var rs=require(_0xaaba('0x4'));var fs=require('fs');var Redis=require(_0xaaba('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xaaba('0x6'));var config=require(_0xaaba('0x7'));var jayson=require(_0xaaba('0x8'));var client=jayson['client'][_0xaaba('0x9')]({'port':0x232a});config[_0xaaba('0xa')]=_[_0xaaba('0xb')](config['redis'],{'host':_0xaaba('0xc'),'port':0x18eb});var socket=require(_0xaaba('0xd'))(new Redis(config[_0xaaba('0xa')]));require(_0xaaba('0xe'))[_0xaaba('0xf')](socket);function respondWithRpcPromise(_0x4a7d09,_0x1cef50,_0x31b658){return new BPromise(function(_0x196bd3,_0x582384){return client[_0xaaba('0x10')](_0x4a7d09,_0x31b658)[_0xaaba('0x11')](function(_0x2153f4){logger[_0xaaba('0x12')](_0xaaba('0x13'),_0x1cef50,'request\x20sent');logger['debug'](_0xaaba('0x14'),_0x1cef50,'request\x20sent',JSON[_0xaaba('0x15')](_0x2153f4));if(_0x2153f4[_0xaaba('0x16')]){if(_0x2153f4[_0xaaba('0x16')][_0xaaba('0x17')]===0x1f4){logger['error'](_0xaaba('0x13'),_0x1cef50,_0x2153f4[_0xaaba('0x16')][_0xaaba('0x18')]);return _0x582384(_0x2153f4[_0xaaba('0x16')][_0xaaba('0x18')]);}logger['error']('Team,\x20%s,\x20%s',_0x1cef50,_0x2153f4['error']['message']);return _0x196bd3(_0x2153f4[_0xaaba('0x16')][_0xaaba('0x18')]);}else{logger[_0xaaba('0x12')](_0xaaba('0x13'),_0x1cef50,_0xaaba('0x19'));_0x196bd3(_0x2153f4[_0xaaba('0x1a')][_0xaaba('0x18')]);}})[_0xaaba('0x1b')](function(_0x22e315){logger[_0xaaba('0x16')]('Team,\x20%s,\x20%s',_0x1cef50,_0x22e315);_0x582384(_0x22e315);});});} \ No newline at end of file +var _0x0072=['error','message','result','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','redis','defaults','socket.io-emitter','./team.socket','register','request','info','Team,\x20%s,\x20%s','request\x20sent','debug','Team,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x3976cb,_0x4d3d2c){var _0x436500=function(_0x55fa91){while(--_0x55fa91){_0x3976cb['push'](_0x3976cb['shift']());}};_0x436500(++_0x4d3d2c);}(_0x0072,0xa4));var _0x2007=function(_0xea897b,_0x269096){_0xea897b=_0xea897b-0x0;var _0x8a736e=_0x0072[_0xea897b];return _0x8a736e;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x2007('0x0'));var rs=require(_0x2007('0x1'));var fs=require('fs');var Redis=require(_0x2007('0x2'));var db=require(_0x2007('0x3'))['db'];var utils=require(_0x2007('0x4'));var logger=require(_0x2007('0x5'))(_0x2007('0x6'));var config=require(_0x2007('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});config[_0x2007('0x8')]=_[_0x2007('0x9')](config[_0x2007('0x8')],{'host':'localhost','port':0x18eb});var socket=require(_0x2007('0xa'))(new Redis(config[_0x2007('0x8')]));require(_0x2007('0xb'))[_0x2007('0xc')](socket);function respondWithRpcPromise(_0x2b7ae6,_0x3a37ef,_0x1d11c0){return new BPromise(function(_0x50977d,_0x368e98){return client[_0x2007('0xd')](_0x2b7ae6,_0x1d11c0)['then'](function(_0x23d1b2){logger[_0x2007('0xe')](_0x2007('0xf'),_0x3a37ef,_0x2007('0x10'));logger[_0x2007('0x11')](_0x2007('0x12'),_0x3a37ef,'request\x20sent',JSON[_0x2007('0x13')](_0x23d1b2));if(_0x23d1b2['error']){if(_0x23d1b2[_0x2007('0x14')]['code']===0x1f4){logger[_0x2007('0x14')]('Team,\x20%s,\x20%s',_0x3a37ef,_0x23d1b2[_0x2007('0x14')][_0x2007('0x15')]);return _0x368e98(_0x23d1b2[_0x2007('0x14')][_0x2007('0x15')]);}logger[_0x2007('0x14')](_0x2007('0xf'),_0x3a37ef,_0x23d1b2[_0x2007('0x14')][_0x2007('0x15')]);return _0x50977d(_0x23d1b2[_0x2007('0x14')][_0x2007('0x15')]);}else{logger[_0x2007('0xe')](_0x2007('0xf'),_0x3a37ef,'request\x20sent');_0x50977d(_0x23d1b2[_0x2007('0x16')]['message']);}})['catch'](function(_0x183440){logger[_0x2007('0x14')](_0x2007('0xf'),_0x3a37ef,_0x183440);_0x368e98(_0x183440);});});} \ No newline at end of file diff --git a/server/api/team/team.socket.js b/server/api/team/team.socket.js index 7d22851..28ffaef 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 _0xeffd=['register','length','team:','./team.events','remove','update','emit','removeListener'];(function(_0x75b810,_0x4dc078){var _0x423e56=function(_0xc6b960){while(--_0xc6b960){_0x75b810['push'](_0x75b810['shift']());}};_0x423e56(++_0x4dc078);}(_0xeffd,0x6b));var _0xdeff=function(_0x29a7c7,_0x39e7b9){_0x29a7c7=_0x29a7c7-0x0;var _0x531af9=_0xeffd[_0x29a7c7];return _0x531af9;};'use strict';var TeamEvents=require(_0xdeff('0x0'));var events=['save',_0xdeff('0x1'),_0xdeff('0x2')];function createListener(_0x281a05,_0x27f2d0){return function(_0xafbbb1){_0x27f2d0[_0xdeff('0x3')](_0x281a05,_0xafbbb1);};}function removeListener(_0x298274,_0x2881fd){return function(){TeamEvents[_0xdeff('0x4')](_0x298274,_0x2881fd);};}exports[_0xdeff('0x5')]=function(_0x1ed641){for(var _0x132631=0x0,_0x281ad7=events[_0xdeff('0x6')];_0x132631<_0x281ad7;_0x132631++){var _0x39878e=events[_0x132631];var _0x12e953=createListener(_0xdeff('0x7')+_0x39878e,_0x1ed641);TeamEvents['on'](_0x39878e,_0x12e953);}}; \ No newline at end of file +var _0xbee3=['register','length','team:','save','emit'];(function(_0x44769d,_0x248732){var _0x3d169a=function(_0x49c14a){while(--_0x49c14a){_0x44769d['push'](_0x44769d['shift']());}};_0x3d169a(++_0x248732);}(_0xbee3,0xd5));var _0x3bee=function(_0x2a7a33,_0x2d3fa8){_0x2a7a33=_0x2a7a33-0x0;var _0x293883=_0xbee3[_0x2a7a33];return _0x293883;};'use strict';var TeamEvents=require('./team.events');var events=[_0x3bee('0x0'),'remove','update'];function createListener(_0x45a1bf,_0x27f822){return function(_0x4945a7){_0x27f822[_0x3bee('0x1')](_0x45a1bf,_0x4945a7);};}function removeListener(_0x1956c1,_0x1cf379){return function(){TeamEvents['removeListener'](_0x1956c1,_0x1cf379);};}exports[_0x3bee('0x2')]=function(_0x3baf77){for(var _0x4c5ef5=0x0,_0x2fdeec=events[_0x3bee('0x3')];_0x4c5ef5<_0x2fdeec;_0x4c5ef5++){var _0x1b510d=events[_0x4c5ef5];var _0x339223=createListener(_0x3bee('0x4')+_0x1b510d,_0x3baf77);TeamEvents['on'](_0x1b510d,_0x339223);}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js b/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js index 2c3036f..9b3ddbe 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 _0x9428=['sequelize','exports','INTEGER'];(function(_0x37f212,_0x9bf1b2){var _0x57ba32=function(_0xb71a58){while(--_0xb71a58){_0x37f212['push'](_0x37f212['shift']());}};_0x57ba32(++_0x9bf1b2);}(_0x9428,0xa5));var _0x8942=function(_0x3d4ef1,_0x5a957c){_0x3d4ef1=_0x3d4ef1-0x0;var _0x409423=_0x9428[_0x3d4ef1];return _0x409423;};'use strict';var Sequelize=require(_0x8942('0x0'));module[_0x8942('0x1')]={'TeamId':{'type':Sequelize[_0x8942('0x2')]},'VoicePrefixId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0xe0dc=['INTEGER','exports'];(function(_0x308213,_0x224541){var _0x2e1619=function(_0x972b51){while(--_0x972b51){_0x308213['push'](_0x308213['shift']());}};_0x2e1619(++_0x224541);}(_0xe0dc,0x77));var _0xce0d=function(_0x23d0a1,_0x5011a){_0x23d0a1=_0x23d0a1-0x0;var _0x1ef866=_0xe0dc[_0x23d0a1];return _0x1ef866;};'use strict';var Sequelize=require('sequelize');module[_0xce0d('0x0')]={'TeamId':{'type':Sequelize[_0xce0d('0x1')]},'VoicePrefixId':{'type':Sequelize[_0xce0d('0x1')]}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.model.js b/server/api/teamVoicePrefix/teamVoicePrefix.model.js index 393fd46..995e046 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 _0xb8a0=['./teamVoicePrefix.attributes','exports','define','TeamVoicePrefix','team_has_voice_prefixes','../../config/logger','api','bluebird'];(function(_0x4d6ce,_0x595081){var _0x52f621=function(_0x5961c5){while(--_0x5961c5){_0x4d6ce['push'](_0x4d6ce['shift']());}};_0x52f621(++_0x595081);}(_0xb8a0,0x1d5));var _0x0b8a=function(_0x5a1961,_0x5198e2){_0x5a1961=_0x5a1961-0x0;var _0x2b2d0f=_0xb8a0[_0x5a1961];return _0x2b2d0f;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x0b8a('0x0'))(_0x0b8a('0x1'));var moment=require('moment');var BPromise=require(_0x0b8a('0x2'));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(_0x0b8a('0x3'));module[_0x0b8a('0x4')]=function(_0x381b17,_0x165710){return _0x381b17[_0x0b8a('0x5')](_0x0b8a('0x6'),attributes,{'tableName':_0x0b8a('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x80ed=['api','moment','request-promise','path','rimraf','../../config/environment','exports','TeamVoicePrefix','team_has_voice_prefixes','lodash','../../config/logger'];(function(_0xb66479,_0x5b3ac3){var _0x34c98a=function(_0x4cf32f){while(--_0x4cf32f){_0xb66479['push'](_0xb66479['shift']());}};_0x34c98a(++_0x5b3ac3);}(_0x80ed,0x11c));var _0xd80e=function(_0x2ffa33,_0x2d9714){_0x2ffa33=_0x2ffa33-0x0;var _0x39a406=_0x80ed[_0x2ffa33];return _0x39a406;};'use strict';var _=require(_0xd80e('0x0'));var util=require('util');var logger=require(_0xd80e('0x1'))(_0xd80e('0x2'));var moment=require(_0xd80e('0x3'));var BPromise=require('bluebird');var rp=require(_0xd80e('0x4'));var fs=require('fs');var path=require(_0xd80e('0x5'));var rimraf=require(_0xd80e('0x6'));var config=require(_0xd80e('0x7'));var attributes=require('./teamVoicePrefix.attributes');module[_0xd80e('0x8')]=function(_0x2b4742,_0x252fec){return _0x2b4742['define'](_0xd80e('0x9'),attributes,{'tableName':_0xd80e('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/index.js b/server/api/teamVoiceQueue/index.js index f80b020..dda0a76 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(_0x459ad9,_0x1595a2){var _0x1c5059=function(_0x1f1f2b){while(--_0x1f1f2b){_0x459ad9['push'](_0x459ad9['shift']());}};_0x1c5059(++_0x1595a2);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x5e8c32,_0x1b1f3f){_0x5e8c32=_0x5e8c32-0x0;var _0x595f7b=_0xcb91[_0x5e8c32];return _0x595f7b;};'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(_0xaf025d,_0x586d7a){var _0x1c77cb=function(_0x560b3a){while(--_0x560b3a){_0xaf025d['push'](_0xaf025d['shift']());}};_0x1c77cb(++_0x586d7a);}(_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 a1cfa27..c5ec572 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 _0x048c=['INTEGER','sequelize','exports'];(function(_0x10e3b6,_0x16fa50){var _0x12c6f3=function(_0x3ee6bd){while(--_0x3ee6bd){_0x10e3b6['push'](_0x10e3b6['shift']());}};_0x12c6f3(++_0x16fa50);}(_0x048c,0xc4));var _0xc048=function(_0x30fb37,_0x54df52){_0x30fb37=_0x30fb37-0x0;var _0xc5cc4d=_0x048c[_0x30fb37];return _0xc5cc4d;};'use strict';var Sequelize=require(_0xc048('0x0'));module[_0xc048('0x1')]={'penalty':{'type':Sequelize[_0xc048('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x1b6d=['INTEGER','exports'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x1b6d,0xe7));var _0xd1b6=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x1b6d[_0x4565bf];return _0x5610ba;};'use strict';var Sequelize=require('sequelize');module[_0xd1b6('0x0')]={'penalty':{'type':Sequelize[_0xd1b6('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 d3dd59a..43d0dbd 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 _0x5c4a=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./teamVoiceQueue.attributes','exports','define','TeamVoiceQueue','team_has_voice_queues','util'];(function(_0x50675c,_0x50d4e9){var _0x364b5d=function(_0x5338f0){while(--_0x5338f0){_0x50675c['push'](_0x50675c['shift']());}};_0x364b5d(++_0x50d4e9);}(_0x5c4a,0xfb));var _0xa5c4=function(_0x14f854,_0x583796){_0x14f854=_0x14f854-0x0;var _0x13faa8=_0x5c4a[_0x14f854];return _0x13faa8;};'use strict';var _=require('lodash');var util=require(_0xa5c4('0x0'));var logger=require(_0xa5c4('0x1'))('api');var moment=require(_0xa5c4('0x2'));var BPromise=require(_0xa5c4('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa5c4('0x4'));var rimraf=require(_0xa5c4('0x5'));var config=require(_0xa5c4('0x6'));var attributes=require(_0xa5c4('0x7'));module[_0xa5c4('0x8')]=function(_0x49af82,_0x2410cf){return _0x49af82[_0xa5c4('0x9')](_0xa5c4('0xa'),attributes,{'tableName':_0xa5c4('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3df4=['bluebird','request-promise','path','rimraf','exports','define','../../config/logger','api','moment'];(function(_0x2428b1,_0x97dc1e){var _0x316c8f=function(_0x1e9322){while(--_0x1e9322){_0x2428b1['push'](_0x2428b1['shift']());}};_0x316c8f(++_0x97dc1e);}(_0x3df4,0x102));var _0x43df=function(_0x226cad,_0x262e18){_0x226cad=_0x226cad-0x0;var _0x2f73a1=_0x3df4[_0x226cad];return _0x2f73a1;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x43df('0x0'))(_0x43df('0x1'));var moment=require(_0x43df('0x2'));var BPromise=require(_0x43df('0x3'));var rp=require(_0x43df('0x4'));var fs=require('fs');var path=require(_0x43df('0x5'));var rimraf=require(_0x43df('0x6'));var config=require('../../config/environment');var attributes=require('./teamVoiceQueue.attributes');module[_0x43df('0x7')]=function(_0x3111bf,_0x3af1ec){return _0x3111bf[_0x43df('0x8')]('TeamVoiceQueue',attributes,{'tableName':'team_has_voice_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/teamVoiceQueue.rpc.js b/server/api/teamVoiceQueue/teamVoiceQueue.rpc.js index 753d00e..749dbcf 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 _0x9099=['../../config/environment','jayson/promise','client','http','info','request\x20sent','debug','TeamVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','TeamVoiceQueue,\x20%s,\x20%s','message','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x155c64,_0x26ff95){var _0x1f154a=function(_0xbc46e4){while(--_0xbc46e4){_0x155c64['push'](_0x155c64['shift']());}};_0x1f154a(++_0x26ff95);}(_0x9099,0x1ac));var _0x9909=function(_0x4f2c3a,_0x6bde90){_0x4f2c3a=_0x4f2c3a-0x0;var _0x17d91c=_0x9099[_0x4f2c3a];return _0x17d91c;};'use strict';var _=require(_0x9909('0x0'));var util=require('util');var moment=require(_0x9909('0x1'));var BPromise=require(_0x9909('0x2'));var rs=require(_0x9909('0x3'));var fs=require('fs');var Redis=require(_0x9909('0x4'));var db=require(_0x9909('0x5'))['db'];var utils=require(_0x9909('0x6'));var logger=require(_0x9909('0x7'))(_0x9909('0x8'));var config=require(_0x9909('0x9'));var jayson=require(_0x9909('0xa'));var client=jayson[_0x9909('0xb')][_0x9909('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3b7391,_0x3dc2dd,_0x54011f){return new BPromise(function(_0x6d755a,_0x5dcd39){return client['request'](_0x3b7391,_0x54011f)['then'](function(_0x5023b7){logger[_0x9909('0xd')]('TeamVoiceQueue,\x20%s,\x20%s',_0x3dc2dd,_0x9909('0xe'));logger[_0x9909('0xf')](_0x9909('0x10'),_0x3dc2dd,'request\x20sent',JSON[_0x9909('0x11')](_0x5023b7));if(_0x5023b7['error']){if(_0x5023b7[_0x9909('0x12')][_0x9909('0x13')]===0x1f4){logger[_0x9909('0x12')](_0x9909('0x14'),_0x3dc2dd,_0x5023b7[_0x9909('0x12')][_0x9909('0x15')]);return _0x5dcd39(_0x5023b7[_0x9909('0x12')][_0x9909('0x15')]);}logger[_0x9909('0x12')](_0x9909('0x14'),_0x3dc2dd,_0x5023b7[_0x9909('0x12')][_0x9909('0x15')]);return _0x6d755a(_0x5023b7[_0x9909('0x12')]['message']);}else{logger[_0x9909('0xd')]('TeamVoiceQueue,\x20%s,\x20%s',_0x3dc2dd,_0x9909('0xe'));_0x6d755a(_0x5023b7['result'][_0x9909('0x15')]);}})[_0x9909('0x16')](function(_0x245f0d){logger['error'](_0x9909('0x14'),_0x3dc2dd,_0x245f0d);_0x5dcd39(_0x245f0d);});});} \ No newline at end of file +var _0x8393=['stringify','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','TeamVoiceQueue,\x20%s,\x20%s','debug','TeamVoiceQueue,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x3d72dc,_0x162282){var _0x57989a=function(_0x3cddf5){while(--_0x3cddf5){_0x3d72dc['push'](_0x3d72dc['shift']());}};_0x57989a(++_0x162282);}(_0x8393,0x1e1));var _0x3839=function(_0x2d544d,_0x3a8f6d){_0x2d544d=_0x2d544d-0x0;var _0x162cd2=_0x8393[_0x2d544d];return _0x162cd2;};'use strict';var _=require(_0x3839('0x0'));var util=require(_0x3839('0x1'));var moment=require(_0x3839('0x2'));var BPromise=require(_0x3839('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3839('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x3839('0x5'));var logger=require(_0x3839('0x6'))(_0x3839('0x7'));var config=require(_0x3839('0x8'));var jayson=require(_0x3839('0x9'));var client=jayson[_0x3839('0xa')][_0x3839('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xee7dbc,_0x5444d8,_0x7f097c){return new BPromise(function(_0x36caa8,_0x1ec6b3){return client[_0x3839('0xc')](_0xee7dbc,_0x7f097c)[_0x3839('0xd')](function(_0x578bed){logger[_0x3839('0xe')](_0x3839('0xf'),_0x5444d8,'request\x20sent');logger[_0x3839('0x10')](_0x3839('0x11'),_0x5444d8,_0x3839('0x12'),JSON[_0x3839('0x13')](_0x578bed));if(_0x578bed[_0x3839('0x14')]){if(_0x578bed[_0x3839('0x14')][_0x3839('0x15')]===0x1f4){logger[_0x3839('0x14')](_0x3839('0xf'),_0x5444d8,_0x578bed['error'][_0x3839('0x16')]);return _0x1ec6b3(_0x578bed['error']['message']);}logger[_0x3839('0x14')](_0x3839('0xf'),_0x5444d8,_0x578bed['error'][_0x3839('0x16')]);return _0x36caa8(_0x578bed[_0x3839('0x14')][_0x3839('0x16')]);}else{logger[_0x3839('0xe')](_0x3839('0xf'),_0x5444d8,_0x3839('0x12'));_0x36caa8(_0x578bed[_0x3839('0x17')][_0x3839('0x16')]);}})[_0x3839('0x18')](function(_0x17cebc){logger[_0x3839('0x14')]('TeamVoiceQueue,\x20%s,\x20%s',_0x5444d8,_0x17cebc);_0x1ec6b3(_0x17cebc);});});} \ No newline at end of file diff --git a/server/api/template/index.js b/server/api/template/index.js index b871a61..1e0bf12 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 _0xb145=['./template.controller','get','isAuthenticated','index','/:id','show','post','put','update','delete','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x551e34,_0x5296f5){var _0x5eef83=function(_0x433efc){while(--_0x433efc){_0x551e34['push'](_0x551e34['shift']());}};_0x5eef83(++_0x5296f5);}(_0xb145,0xa3));var _0x5b14=function(_0xf4c336,_0x293679){_0xf4c336=_0xf4c336-0x0;var _0x6e6b59=_0xb145[_0xf4c336];return _0x6e6b59;};'use strict';var multer=require('multer');var util=require(_0x5b14('0x0'));var path=require(_0x5b14('0x1'));var timeout=require(_0x5b14('0x2'));var express=require(_0x5b14('0x3'));var router=express[_0x5b14('0x4')]();var fs_extra=require(_0x5b14('0x5'));var auth=require(_0x5b14('0x6'));var interaction=require(_0x5b14('0x7'));var config=require('../../config/environment');var controller=require(_0x5b14('0x8'));router[_0x5b14('0x9')]('/',auth[_0x5b14('0xa')](),controller[_0x5b14('0xb')]);router['get'](_0x5b14('0xc'),auth[_0x5b14('0xa')](),controller[_0x5b14('0xd')]);router[_0x5b14('0xe')]('/',auth[_0x5b14('0xa')](),controller['create']);router[_0x5b14('0xf')](_0x5b14('0xc'),auth['isAuthenticated'](),controller[_0x5b14('0x10')]);router[_0x5b14('0x11')](_0x5b14('0xc'),auth[_0x5b14('0xa')](),controller[_0x5b14('0x12')]);module['exports']=router; \ No newline at end of file +var _0x225b=['express','fs-extra','../../components/interaction/service','./template.controller','get','isAuthenticated','index','/:id','post','create','put','update','delete','destroy','exports','multer','util','connect-timeout'];(function(_0x35da42,_0x5c2610){var _0x370035=function(_0x546db5){while(--_0x546db5){_0x35da42['push'](_0x35da42['shift']());}};_0x370035(++_0x5c2610);}(_0x225b,0xb1));var _0xb225=function(_0x4f8353,_0x589d62){_0x4f8353=_0x4f8353-0x0;var _0x119b52=_0x225b[_0x4f8353];return _0x119b52;};'use strict';var multer=require(_0xb225('0x0'));var util=require(_0xb225('0x1'));var path=require('path');var timeout=require(_0xb225('0x2'));var express=require(_0xb225('0x3'));var router=express['Router']();var fs_extra=require(_0xb225('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xb225('0x5'));var config=require('../../config/environment');var controller=require(_0xb225('0x6'));router[_0xb225('0x7')]('/',auth[_0xb225('0x8')](),controller[_0xb225('0x9')]);router[_0xb225('0x7')](_0xb225('0xa'),auth[_0xb225('0x8')](),controller['show']);router[_0xb225('0xb')]('/',auth[_0xb225('0x8')](),controller[_0xb225('0xc')]);router[_0xb225('0xd')]('/:id',auth[_0xb225('0x8')](),controller[_0xb225('0xe')]);router[_0xb225('0xf')]('/:id',auth[_0xb225('0x8')](),controller[_0xb225('0x10')]);module[_0xb225('0x11')]=router; \ No newline at end of file diff --git a/server/api/template/template.attributes.js b/server/api/template/template.attributes.js index 10a126e..3d6598d 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 _0x7d2e=['exports','TEXT','sequelize'];(function(_0x50c071,_0x3304bc){var _0x4a007a=function(_0x199c9a){while(--_0x199c9a){_0x50c071['push'](_0x50c071['shift']());}};_0x4a007a(++_0x3304bc);}(_0x7d2e,0x8f));var _0xe7d2=function(_0x5b78e8,_0x55096b){_0x5b78e8=_0x5b78e8-0x0;var _0xf2c321=_0x7d2e[_0x5b78e8];return _0xf2c321;};'use strict';var Sequelize=require(_0xe7d2('0x0'));module[_0xe7d2('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'html':{'type':Sequelize[_0xe7d2('0x2')]}}; \ No newline at end of file +var _0x7639=['sequelize','exports','STRING'];(function(_0x5f2573,_0x590f5c){var _0x343f4e=function(_0x387ef8){while(--_0x387ef8){_0x5f2573['push'](_0x5f2573['shift']());}};_0x343f4e(++_0x590f5c);}(_0x7639,0x14d));var _0x9763=function(_0x14e10d,_0x573a2f){_0x14e10d=_0x14e10d-0x0;var _0x1c15fa=_0x7639[_0x14e10d];return _0x1c15fa;};'use strict';var Sequelize=require(_0x9763('0x0'));module[_0x9763('0x1')]={'name':{'type':Sequelize[_0x9763('0x2')]},'description':{'type':Sequelize[_0x9763('0x2')]},'html':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/template/template.controller.js b/server/api/template/template.controller.js index 734db8c..f0458fc 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 _0x7264=['ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','json','limit','count','offset','status','set','Content-Range','apply','reject','save','update','then','destroy','get','Templates','UserProfileResource','end','stack','send','index','map','Template','rawAttributes','type','key','query','filters','intersection','model','attributes','fields','order','sort','pick','filter','where','merge','name','includeAll','include','rows','show','options','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','find','eml-format','zip-dir','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','papaparse'];(function(_0x12a2a6,_0x374ff1){var _0x1754ae=function(_0x49d787){while(--_0x49d787){_0x12a2a6['push'](_0x12a2a6['shift']());}};_0x1754ae(++_0x374ff1);}(_0x7264,0xd6));var _0x4726=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x7264[_0x1facfa];return _0x9ec701;};'use strict';var emlformat=require(_0x4726('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4726('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4726('0x2'));var moment=require(_0x4726('0x3'));var BPromise=require(_0x4726('0x4'));var Mustache=require(_0x4726('0x5'));var util=require('util');var path=require('path');var sox=require(_0x4726('0x6'));var csv=require(_0x4726('0x7'));var ejs=require(_0x4726('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x4726('0x9'));var crypto=require(_0x4726('0xa'));var jsforce=require(_0x4726('0xb'));var deskjs=require(_0x4726('0xc'));var toCsv=require(_0x4726('0x7'));var querystring=require('querystring');var Papa=require(_0x4726('0xd'));var Redis=require(_0x4726('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x4726('0xf'));var as=require(_0x4726('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4726('0x11'))(_0x4726('0x12'));var utils=require(_0x4726('0x13'));var config=require(_0x4726('0x14'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x291db2,_0x52f587){_0x52f587=_0x52f587||0xcc;return function(_0x36fee2){if(_0x36fee2){return _0x291db2[_0x4726('0x15')](_0x52f587);}return _0x291db2['status'](_0x52f587)['end']();};}function respondWithResult(_0x1411c8,_0x4b09ec){_0x4b09ec=_0x4b09ec||0xc8;return function(_0xbd778d){if(_0xbd778d){return _0x1411c8['status'](_0x4b09ec)[_0x4726('0x16')](_0xbd778d);}};}function respondWithFilteredResult(_0x5c1445,_0x436038){return function(_0x393122){if(_0x393122){var _0x41c7e1=typeof _0x436038['offset']==='undefined'&&typeof _0x436038[_0x4726('0x17')]==='undefined';var _0x549a0f=_0x393122[_0x4726('0x18')];var _0x12ca73=_0x41c7e1?0x0:_0x436038[_0x4726('0x19')];var _0xe917c7=_0x41c7e1?_0x393122[_0x4726('0x18')]:_0x436038[_0x4726('0x19')]+_0x436038['limit'];var _0x3d092d;if(_0xe917c7>=_0x549a0f){_0xe917c7=_0x549a0f;_0x3d092d=0xc8;}else{_0x3d092d=0xce;}_0x5c1445[_0x4726('0x1a')](_0x3d092d);return _0x5c1445[_0x4726('0x1b')](_0x4726('0x1c'),_0x12ca73+'-'+_0xe917c7+'/'+_0x549a0f)[_0x4726('0x16')](_0x393122);}return null;};}function patchUpdates(_0x2ebb97){return function(_0x5dea6a){try{jsonpatch[_0x4726('0x1d')](_0x5dea6a,_0x2ebb97,!![]);}catch(_0x2d4f4f){return BPromise[_0x4726('0x1e')](_0x2d4f4f);}return _0x5dea6a[_0x4726('0x1f')]();};}function saveUpdates(_0x1bff4f,_0x5eea1d){return function(_0x8e67c3){if(_0x8e67c3){return _0x8e67c3[_0x4726('0x20')](_0x1bff4f)[_0x4726('0x21')](function(_0x4595eb){return _0x4595eb;});}return null;};}function removeEntity(_0x14cfbf,_0x427cef){return function(_0x1e6538){if(_0x1e6538){return _0x1e6538[_0x4726('0x22')]()['then'](function(){var _0x3c1b48=_0x1e6538[_0x4726('0x23')]({'plain':!![]});var _0x25b34b=_0x4726('0x24');return db[_0x4726('0x25')]['destroy']({'where':{'type':_0x25b34b,'resourceId':_0x3c1b48['id']}})[_0x4726('0x21')](function(){return _0x1e6538;});})[_0x4726('0x21')](function(){_0x14cfbf[_0x4726('0x1a')](0xcc)[_0x4726('0x26')]();});}};}function handleEntityNotFound(_0x3b34fe,_0x18564b){return function(_0x1bb2ab){if(!_0x1bb2ab){_0x3b34fe[_0x4726('0x15')](0x194);}return _0x1bb2ab;};}function handleError(_0x5df565,_0x31661d){_0x31661d=_0x31661d||0x1f4;return function(_0xf255b7){logger['error'](_0xf255b7[_0x4726('0x27')]);if(_0xf255b7['name']){delete _0xf255b7['name'];}_0x5df565[_0x4726('0x1a')](_0x31661d)[_0x4726('0x28')](_0xf255b7);};}exports[_0x4726('0x29')]=function(_0x30a25f,_0x6910ea){var _0x39532d={},_0x4e9427={},_0x289e18={'count':0x0,'rows':[]};var _0x1bdff2=_[_0x4726('0x2a')](db[_0x4726('0x2b')][_0x4726('0x2c')],function(_0x1d5f34){return{'name':_0x1d5f34['fieldName'],'type':_0x1d5f34[_0x4726('0x2d')][_0x4726('0x2e')]};});_0x4e9427['model']=_[_0x4726('0x2a')](_0x1bdff2,'name');_0x4e9427[_0x4726('0x2f')]=_['keys'](_0x30a25f[_0x4726('0x2f')]);_0x4e9427[_0x4726('0x30')]=_[_0x4726('0x31')](_0x4e9427[_0x4726('0x32')],_0x4e9427['query']);_0x39532d[_0x4726('0x33')]=_[_0x4726('0x31')](_0x4e9427[_0x4726('0x32')],qs[_0x4726('0x34')](_0x30a25f[_0x4726('0x2f')][_0x4726('0x34')]));_0x39532d['attributes']=_0x39532d[_0x4726('0x33')]['length']?_0x39532d[_0x4726('0x33')]:_0x4e9427['model'];if(!_0x30a25f['query']['hasOwnProperty']('nolimit')){_0x39532d['limit']=qs[_0x4726('0x17')](_0x30a25f[_0x4726('0x2f')][_0x4726('0x17')]);_0x39532d['offset']=qs['offset'](_0x30a25f[_0x4726('0x2f')]['offset']);}_0x39532d[_0x4726('0x35')]=qs[_0x4726('0x36')](_0x30a25f[_0x4726('0x2f')]['sort']);_0x39532d['where']=qs[_0x4726('0x30')](_[_0x4726('0x37')](_0x30a25f[_0x4726('0x2f')],_0x4e9427[_0x4726('0x30')]),_0x1bdff2);if(_0x30a25f[_0x4726('0x2f')][_0x4726('0x38')]){_0x39532d[_0x4726('0x39')]=_[_0x4726('0x3a')](_0x39532d[_0x4726('0x39')],{'$or':_[_0x4726('0x2a')](_0x1bdff2,function(_0x471491){if(_0x471491[_0x4726('0x2d')]!=='VIRTUAL'){var _0x28639f={};_0x28639f[_0x471491[_0x4726('0x3b')]]={'$like':'%'+_0x30a25f[_0x4726('0x2f')][_0x4726('0x38')]+'%'};return _0x28639f;}})});}_0x39532d=_['merge']({},_0x39532d,_0x30a25f['options']);var _0x5daf63={'where':_0x39532d[_0x4726('0x39')]};return db['Template'][_0x4726('0x18')](_0x5daf63)[_0x4726('0x21')](function(_0x30974e){_0x289e18[_0x4726('0x18')]=_0x30974e;if(_0x30a25f['query'][_0x4726('0x3c')]){_0x39532d[_0x4726('0x3d')]=[{'all':!![]}];}return db[_0x4726('0x2b')]['findAll'](_0x39532d);})[_0x4726('0x21')](function(_0x4f5089){_0x289e18[_0x4726('0x3e')]=_0x4f5089;return _0x289e18;})[_0x4726('0x21')](respondWithFilteredResult(_0x6910ea,_0x39532d))['catch'](handleError(_0x6910ea,null));};exports[_0x4726('0x3f')]=function(_0x2503fe,_0x3509fb){var _0x53b725={'raw':!![],'where':{'id':_0x2503fe['params']['id']}},_0xb03f3e={};_0xb03f3e['model']=_['keys'](db[_0x4726('0x2b')]['rawAttributes']);_0xb03f3e[_0x4726('0x2f')]=_['keys'](_0x2503fe[_0x4726('0x2f')]);_0xb03f3e[_0x4726('0x30')]=_[_0x4726('0x31')](_0xb03f3e[_0x4726('0x32')],_0xb03f3e['query']);_0x53b725[_0x4726('0x33')]=_['intersection'](_0xb03f3e[_0x4726('0x32')],qs[_0x4726('0x34')](_0x2503fe['query'][_0x4726('0x34')]));_0x53b725['attributes']=_0x53b725[_0x4726('0x33')]['length']?_0x53b725[_0x4726('0x33')]:_0xb03f3e['model'];if(_0x2503fe[_0x4726('0x2f')]['includeAll']){_0x53b725[_0x4726('0x3d')]=[{'all':!![]}];}_0x53b725=_[_0x4726('0x3a')]({},_0x53b725,_0x2503fe[_0x4726('0x40')]);return db[_0x4726('0x2b')]['find'](_0x53b725)[_0x4726('0x21')](handleEntityNotFound(_0x3509fb,null))[_0x4726('0x21')](respondWithResult(_0x3509fb,null))[_0x4726('0x41')](handleError(_0x3509fb,null));};exports[_0x4726('0x42')]=function(_0x2e88c8,_0x14a394){return db[_0x4726('0x2b')][_0x4726('0x42')](_0x2e88c8['body'],{})[_0x4726('0x21')](function(_0x4b1b7d){var _0x37ad3f=_0x2e88c8[_0x4726('0x43')][_0x4726('0x23')]({'plain':!![]});if(!_0x37ad3f)throw new Error(_0x4726('0x44'));if(_0x37ad3f[_0x4726('0x45')]===_0x4726('0x43')){var _0x24db1e=_0x4b1b7d[_0x4726('0x23')]({'plain':!![]});var _0x1efc3f='Templates';return db[_0x4726('0x46')]['find']({'where':{'name':_0x1efc3f,'userProfileId':_0x37ad3f[_0x4726('0x47')]},'raw':!![]})[_0x4726('0x21')](function(_0x4c11bc){if(_0x4c11bc&&_0x4c11bc[_0x4726('0x48')]===0x0){return db[_0x4726('0x25')][_0x4726('0x42')]({'name':_0x24db1e[_0x4726('0x3b')],'resourceId':_0x24db1e['id'],'type':_0x4c11bc[_0x4726('0x3b')],'sectionId':_0x4c11bc['id']},{})[_0x4726('0x21')](function(){return _0x4b1b7d;});}else{return _0x4b1b7d;}})[_0x4726('0x41')](function(_0x14a2c0){logger['error'](_0x4726('0x49'),_0x14a2c0);throw _0x14a2c0;});}return _0x4b1b7d;})[_0x4726('0x21')](respondWithResult(_0x14a394,0xc9))[_0x4726('0x41')](handleError(_0x14a394,null));};exports[_0x4726('0x20')]=function(_0x59a7e8,_0x312e30){if(_0x59a7e8[_0x4726('0x4a')]['id']){delete _0x59a7e8[_0x4726('0x4a')]['id'];}return db['Template'][_0x4726('0x4b')]({'where':{'id':_0x59a7e8['params']['id']}})[_0x4726('0x21')](handleEntityNotFound(_0x312e30,null))['then'](saveUpdates(_0x59a7e8[_0x4726('0x4a')],null))[_0x4726('0x21')](respondWithResult(_0x312e30,null))['catch'](handleError(_0x312e30,null));};exports[_0x4726('0x22')]=function(_0x20fa78,_0x494dbb){return db[_0x4726('0x2b')][_0x4726('0x4b')]({'where':{'id':_0x20fa78['params']['id']}})[_0x4726('0x21')](handleEntityNotFound(_0x494dbb,null))[_0x4726('0x21')](removeEntity(_0x494dbb,null))['catch'](handleError(_0x494dbb,null));}; \ No newline at end of file +var _0xabc5=['where','pick','filter','merge','type','VIRTUAL','options','findAll','rows','show','params','model','includeAll','include','find','catch','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','rimraf','zip-dir','request-promise','moment','mustache','util','sox','to-csv','lodash','squel','crypto','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','status','end','json','undefined','limit','offset','count','apply','reject','save','then','destroy','Templates','UserProfileResource','stack','name','send','map','Template','rawAttributes','key','keys','query','filters','intersection','attributes','fields','length','sort'];(function(_0x112f76,_0xbce6b1){var _0x24589c=function(_0x13d6fa){while(--_0x13d6fa){_0x112f76['push'](_0x112f76['shift']());}};_0x24589c(++_0xbce6b1);}(_0xabc5,0xaf));var _0x5abc=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xabc5[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5abc('0x0'));var zipdir=require(_0x5abc('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5abc('0x2'));var moment=require(_0x5abc('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x5abc('0x4'));var util=require(_0x5abc('0x5'));var path=require('path');var sox=require(_0x5abc('0x6'));var csv=require(_0x5abc('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5abc('0x8'));var squel=require(_0x5abc('0x9'));var crypto=require(_0x5abc('0xa'));var jsforce=require(_0x5abc('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x5abc('0x7'));var querystring=require('querystring');var Papa=require(_0x5abc('0xc'));var Redis=require('ioredis');var authService=require(_0x5abc('0xd'));var qs=require(_0x5abc('0xe'));var as=require(_0x5abc('0xf'));var hardwareService=require(_0x5abc('0x10'));var logger=require('../../config/logger')(_0x5abc('0x11'));var utils=require(_0x5abc('0x12'));var config=require(_0x5abc('0x13'));var licenseUtil=require(_0x5abc('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x415302,_0x2ed396){_0x2ed396=_0x2ed396||0xcc;return function(_0x5a4e79){if(_0x5a4e79){return _0x415302['sendStatus'](_0x2ed396);}return _0x415302[_0x5abc('0x15')](_0x2ed396)[_0x5abc('0x16')]();};}function respondWithResult(_0x3d3a98,_0x50f390){_0x50f390=_0x50f390||0xc8;return function(_0x74b753){if(_0x74b753){return _0x3d3a98[_0x5abc('0x15')](_0x50f390)[_0x5abc('0x17')](_0x74b753);}};}function respondWithFilteredResult(_0x19112f,_0x1da4ce){return function(_0x13b5d9){if(_0x13b5d9){var _0x10aca3=typeof _0x1da4ce['offset']===_0x5abc('0x18')&&typeof _0x1da4ce[_0x5abc('0x19')]===_0x5abc('0x18');var _0x4be0ba=_0x13b5d9['count'];var _0x55b872=_0x10aca3?0x0:_0x1da4ce[_0x5abc('0x1a')];var _0x221c49=_0x10aca3?_0x13b5d9[_0x5abc('0x1b')]:_0x1da4ce['offset']+_0x1da4ce[_0x5abc('0x19')];var _0x40e213;if(_0x221c49>=_0x4be0ba){_0x221c49=_0x4be0ba;_0x40e213=0xc8;}else{_0x40e213=0xce;}_0x19112f[_0x5abc('0x15')](_0x40e213);return _0x19112f['set']('Content-Range',_0x55b872+'-'+_0x221c49+'/'+_0x4be0ba)[_0x5abc('0x17')](_0x13b5d9);}return null;};}function patchUpdates(_0x30ad04){return function(_0x43cde0){try{jsonpatch[_0x5abc('0x1c')](_0x43cde0,_0x30ad04,!![]);}catch(_0x5fd7e7){return BPromise[_0x5abc('0x1d')](_0x5fd7e7);}return _0x43cde0[_0x5abc('0x1e')]();};}function saveUpdates(_0x48330c,_0x27e79f){return function(_0xae9ad2){if(_0xae9ad2){return _0xae9ad2['update'](_0x48330c)[_0x5abc('0x1f')](function(_0x294a05){return _0x294a05;});}return null;};}function removeEntity(_0x58ec51,_0x4392dd){return function(_0x3263ba){if(_0x3263ba){return _0x3263ba[_0x5abc('0x20')]()[_0x5abc('0x1f')](function(){var _0x25d415=_0x3263ba['get']({'plain':!![]});var _0x3c3bc7=_0x5abc('0x21');return db[_0x5abc('0x22')]['destroy']({'where':{'type':_0x3c3bc7,'resourceId':_0x25d415['id']}})[_0x5abc('0x1f')](function(){return _0x3263ba;});})['then'](function(){_0x58ec51[_0x5abc('0x15')](0xcc)[_0x5abc('0x16')]();});}};}function handleEntityNotFound(_0x282e8e,_0x1e4857){return function(_0x31858e){if(!_0x31858e){_0x282e8e['sendStatus'](0x194);}return _0x31858e;};}function handleError(_0x17f8d7,_0x2f6f37){_0x2f6f37=_0x2f6f37||0x1f4;return function(_0x43e716){logger['error'](_0x43e716[_0x5abc('0x23')]);if(_0x43e716[_0x5abc('0x24')]){delete _0x43e716[_0x5abc('0x24')];}_0x17f8d7['status'](_0x2f6f37)[_0x5abc('0x25')](_0x43e716);};}exports['index']=function(_0x26515b,_0x3cd1ef){var _0x1ec6d7={},_0x300e06={},_0x39bfaf={'count':0x0,'rows':[]};var _0x2eb341=_[_0x5abc('0x26')](db[_0x5abc('0x27')][_0x5abc('0x28')],function(_0x2ada5a){return{'name':_0x2ada5a['fieldName'],'type':_0x2ada5a['type'][_0x5abc('0x29')]};});_0x300e06['model']=_['map'](_0x2eb341,_0x5abc('0x24'));_0x300e06['query']=_[_0x5abc('0x2a')](_0x26515b[_0x5abc('0x2b')]);_0x300e06[_0x5abc('0x2c')]=_[_0x5abc('0x2d')](_0x300e06['model'],_0x300e06[_0x5abc('0x2b')]);_0x1ec6d7[_0x5abc('0x2e')]=_[_0x5abc('0x2d')](_0x300e06['model'],qs[_0x5abc('0x2f')](_0x26515b[_0x5abc('0x2b')]['fields']));_0x1ec6d7[_0x5abc('0x2e')]=_0x1ec6d7[_0x5abc('0x2e')][_0x5abc('0x30')]?_0x1ec6d7[_0x5abc('0x2e')]:_0x300e06['model'];if(!_0x26515b[_0x5abc('0x2b')]['hasOwnProperty']('nolimit')){_0x1ec6d7[_0x5abc('0x19')]=qs[_0x5abc('0x19')](_0x26515b[_0x5abc('0x2b')][_0x5abc('0x19')]);_0x1ec6d7['offset']=qs[_0x5abc('0x1a')](_0x26515b[_0x5abc('0x2b')][_0x5abc('0x1a')]);}_0x1ec6d7['order']=qs[_0x5abc('0x31')](_0x26515b[_0x5abc('0x2b')][_0x5abc('0x31')]);_0x1ec6d7[_0x5abc('0x32')]=qs['filters'](_[_0x5abc('0x33')](_0x26515b[_0x5abc('0x2b')],_0x300e06[_0x5abc('0x2c')]),_0x2eb341);if(_0x26515b['query'][_0x5abc('0x34')]){_0x1ec6d7['where']=_[_0x5abc('0x35')](_0x1ec6d7[_0x5abc('0x32')],{'$or':_[_0x5abc('0x26')](_0x2eb341,function(_0x2f1452){if(_0x2f1452[_0x5abc('0x36')]!==_0x5abc('0x37')){var _0x5896a7={};_0x5896a7[_0x2f1452[_0x5abc('0x24')]]={'$like':'%'+_0x26515b[_0x5abc('0x2b')][_0x5abc('0x34')]+'%'};return _0x5896a7;}})});}_0x1ec6d7=_[_0x5abc('0x35')]({},_0x1ec6d7,_0x26515b[_0x5abc('0x38')]);var _0x3e9ec1={'where':_0x1ec6d7[_0x5abc('0x32')]};return db['Template'][_0x5abc('0x1b')](_0x3e9ec1)[_0x5abc('0x1f')](function(_0x1c5aa5){_0x39bfaf[_0x5abc('0x1b')]=_0x1c5aa5;if(_0x26515b[_0x5abc('0x2b')]['includeAll']){_0x1ec6d7['include']=[{'all':!![]}];}return db[_0x5abc('0x27')][_0x5abc('0x39')](_0x1ec6d7);})['then'](function(_0x589fb0){_0x39bfaf[_0x5abc('0x3a')]=_0x589fb0;return _0x39bfaf;})[_0x5abc('0x1f')](respondWithFilteredResult(_0x3cd1ef,_0x1ec6d7))['catch'](handleError(_0x3cd1ef,null));};exports[_0x5abc('0x3b')]=function(_0x1a4892,_0x4c474e){var _0x4ccd09={'raw':!![],'where':{'id':_0x1a4892[_0x5abc('0x3c')]['id']}},_0x3c461d={};_0x3c461d[_0x5abc('0x3d')]=_['keys'](db[_0x5abc('0x27')]['rawAttributes']);_0x3c461d[_0x5abc('0x2b')]=_[_0x5abc('0x2a')](_0x1a4892['query']);_0x3c461d[_0x5abc('0x2c')]=_[_0x5abc('0x2d')](_0x3c461d[_0x5abc('0x3d')],_0x3c461d[_0x5abc('0x2b')]);_0x4ccd09[_0x5abc('0x2e')]=_[_0x5abc('0x2d')](_0x3c461d[_0x5abc('0x3d')],qs[_0x5abc('0x2f')](_0x1a4892[_0x5abc('0x2b')][_0x5abc('0x2f')]));_0x4ccd09[_0x5abc('0x2e')]=_0x4ccd09[_0x5abc('0x2e')]['length']?_0x4ccd09[_0x5abc('0x2e')]:_0x3c461d['model'];if(_0x1a4892[_0x5abc('0x2b')][_0x5abc('0x3e')]){_0x4ccd09[_0x5abc('0x3f')]=[{'all':!![]}];}_0x4ccd09=_[_0x5abc('0x35')]({},_0x4ccd09,_0x1a4892[_0x5abc('0x38')]);return db[_0x5abc('0x27')][_0x5abc('0x40')](_0x4ccd09)[_0x5abc('0x1f')](handleEntityNotFound(_0x4c474e,null))[_0x5abc('0x1f')](respondWithResult(_0x4c474e,null))[_0x5abc('0x41')](handleError(_0x4c474e,null));};exports[_0x5abc('0x42')]=function(_0x45e21f,_0x8d733f){return db['Template'][_0x5abc('0x42')](_0x45e21f[_0x5abc('0x43')],{})[_0x5abc('0x1f')](function(_0xdac314){var _0x1c2896=_0x45e21f['user'][_0x5abc('0x44')]({'plain':!![]});if(!_0x1c2896)throw new Error(_0x5abc('0x45'));if(_0x1c2896['role']==='user'){var _0x1e747b=_0xdac314['get']({'plain':!![]});var _0x704cd6='Templates';return db['UserProfileSection']['find']({'where':{'name':_0x704cd6,'userProfileId':_0x1c2896[_0x5abc('0x46')]},'raw':!![]})[_0x5abc('0x1f')](function(_0x4575f1){if(_0x4575f1&&_0x4575f1[_0x5abc('0x47')]===0x0){return db[_0x5abc('0x22')][_0x5abc('0x42')]({'name':_0x1e747b['name'],'resourceId':_0x1e747b['id'],'type':_0x4575f1[_0x5abc('0x24')],'sectionId':_0x4575f1['id']},{})['then'](function(){return _0xdac314;});}else{return _0xdac314;}})[_0x5abc('0x41')](function(_0x40412a){logger[_0x5abc('0x48')](_0x5abc('0x49'),_0x40412a);throw _0x40412a;});}return _0xdac314;})['then'](respondWithResult(_0x8d733f,0xc9))[_0x5abc('0x41')](handleError(_0x8d733f,null));};exports[_0x5abc('0x4a')]=function(_0x599410,_0x5dc350){if(_0x599410[_0x5abc('0x43')]['id']){delete _0x599410[_0x5abc('0x43')]['id'];}return db['Template'][_0x5abc('0x40')]({'where':{'id':_0x599410[_0x5abc('0x3c')]['id']}})[_0x5abc('0x1f')](handleEntityNotFound(_0x5dc350,null))[_0x5abc('0x1f')](saveUpdates(_0x599410[_0x5abc('0x43')],null))[_0x5abc('0x1f')](respondWithResult(_0x5dc350,null))[_0x5abc('0x41')](handleError(_0x5dc350,null));};exports[_0x5abc('0x20')]=function(_0x4cad36,_0x3ee2c8){return db[_0x5abc('0x27')][_0x5abc('0x40')]({'where':{'id':_0x4cad36[_0x5abc('0x3c')]['id']}})['then'](handleEntityNotFound(_0x3ee2c8,null))['then'](removeEntity(_0x3ee2c8,null))[_0x5abc('0x41')](handleError(_0x3ee2c8,null));}; \ No newline at end of file diff --git a/server/api/template/template.model.js b/server/api/template/template.model.js index 3278868..7cd70c9 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 _0x23a6=['../../config/logger','api','moment','rimraf','../../config/environment','./template.attributes','exports','Template','tools_templates','lodash','util'];(function(_0x559845,_0x207553){var _0x153327=function(_0x2bd0d3){while(--_0x2bd0d3){_0x559845['push'](_0x559845['shift']());}};_0x153327(++_0x207553);}(_0x23a6,0x1e2));var _0x623a=function(_0x410217,_0x39ed1b){_0x410217=_0x410217-0x0;var _0x4356bc=_0x23a6[_0x410217];return _0x4356bc;};'use strict';var _=require(_0x623a('0x0'));var util=require(_0x623a('0x1'));var logger=require(_0x623a('0x2'))(_0x623a('0x3'));var moment=require(_0x623a('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x623a('0x5'));var config=require(_0x623a('0x6'));var attributes=require(_0x623a('0x7'));module[_0x623a('0x8')]=function(_0x2b02bd,_0x144674){return _0x2b02bd['define'](_0x623a('0x9'),attributes,{'tableName':_0x623a('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa655=['./template.attributes','exports','define','tools_templates','lodash','util','../../config/logger','moment','request-promise','path','../../config/environment'];(function(_0x8cc7c,_0x591379){var _0x404b40=function(_0x3d1de1){while(--_0x3d1de1){_0x8cc7c['push'](_0x8cc7c['shift']());}};_0x404b40(++_0x591379);}(_0xa655,0x1a6));var _0x5a65=function(_0x5de58a,_0x23d58e){_0x5de58a=_0x5de58a-0x0;var _0x589a6d=_0xa655[_0x5de58a];return _0x589a6d;};'use strict';var _=require(_0x5a65('0x0'));var util=require(_0x5a65('0x1'));var logger=require(_0x5a65('0x2'))('api');var moment=require(_0x5a65('0x3'));var BPromise=require('bluebird');var rp=require(_0x5a65('0x4'));var fs=require('fs');var path=require(_0x5a65('0x5'));var rimraf=require('rimraf');var config=require(_0x5a65('0x6'));var attributes=require(_0x5a65('0x7'));module[_0x5a65('0x8')]=function(_0x4533c7,_0x5261bd){return _0x4533c7[_0x5a65('0x9')]('Template',attributes,{'tableName':_0x5a65('0xa'),'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 d8f1ccc..c60ee3c 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 _0x521e=['findAll','options','raw','limit','include','model','attributes','map','lodash','util','moment','randomstring','ioredis','../../config/logger','rpc','../../config/environment','client','http','request','then','info','Template,\x20%s,\x20%s','debug','stringify','error','code','message','catch','GetTemplate'];(function(_0x582225,_0x2a1e0f){var _0x25e790=function(_0x4b0b09){while(--_0x4b0b09){_0x582225['push'](_0x582225['shift']());}};_0x25e790(++_0x2a1e0f);}(_0x521e,0xd3));var _0xe521=function(_0x428a17,_0x42213b){_0x428a17=_0x428a17-0x0;var _0x37c13a=_0x521e[_0x428a17];return _0x37c13a;};'use strict';var _=require(_0xe521('0x0'));var util=require(_0xe521('0x1'));var moment=require(_0xe521('0x2'));var BPromise=require('bluebird');var rs=require(_0xe521('0x3'));var fs=require('fs');var Redis=require(_0xe521('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xe521('0x5'))(_0xe521('0x6'));var config=require(_0xe521('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xe521('0x8')][_0xe521('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x443235,_0x32410b,_0x472306){return new BPromise(function(_0x3cbfd8,_0x4be6d7){return client[_0xe521('0xa')](_0x443235,_0x472306)[_0xe521('0xb')](function(_0x4f645f){logger[_0xe521('0xc')](_0xe521('0xd'),_0x32410b,'request\x20sent');logger[_0xe521('0xe')]('Template,\x20%s,\x20%s,\x20%s',_0x32410b,'request\x20sent',JSON[_0xe521('0xf')](_0x4f645f));if(_0x4f645f['error']){if(_0x4f645f[_0xe521('0x10')][_0xe521('0x11')]===0x1f4){logger[_0xe521('0x10')](_0xe521('0xd'),_0x32410b,_0x4f645f[_0xe521('0x10')]['message']);return _0x4be6d7(_0x4f645f['error'][_0xe521('0x12')]);}logger[_0xe521('0x10')](_0xe521('0xd'),_0x32410b,_0x4f645f[_0xe521('0x10')][_0xe521('0x12')]);return _0x3cbfd8(_0x4f645f[_0xe521('0x10')][_0xe521('0x12')]);}else{logger[_0xe521('0xc')](_0xe521('0xd'),_0x32410b,'request\x20sent');_0x3cbfd8(_0x4f645f['result'][_0xe521('0x12')]);}})[_0xe521('0x13')](function(_0x558c94){logger[_0xe521('0x10')](_0xe521('0xd'),_0x32410b,_0x558c94);_0x4be6d7(_0x558c94);});});}exports[_0xe521('0x14')]=function(_0x592283){var _0x1d5b58=this;return new Promise(function(_0x21abc9,_0xf0a363){return db['Template'][_0xe521('0x15')]({'raw':_0x592283['options']?_0x592283[_0xe521('0x16')][_0xe521('0x17')]===undefined?!![]:![]:!![],'where':_0x592283['options']?_0x592283[_0xe521('0x16')]['where']||null:null,'attributes':_0x592283[_0xe521('0x16')]?_0x592283['options']['attributes']||null:null,'limit':_0x592283['options']?_0x592283['options'][_0xe521('0x18')]||null:null,'include':_0x592283[_0xe521('0x16')]?_0x592283[_0xe521('0x16')][_0xe521('0x19')]?_['map'](_0x592283[_0xe521('0x16')][_0xe521('0x19')],function(_0x3425fa){return{'model':db[_0x3425fa[_0xe521('0x1a')]],'as':_0x3425fa['as'],'attributes':_0x3425fa[_0xe521('0x1b')],'include':_0x3425fa[_0xe521('0x19')]?_[_0xe521('0x1c')](_0x3425fa['include'],function(_0x29cc9f){return{'model':db[_0x29cc9f['model']],'as':_0x29cc9f['as'],'attributes':_0x29cc9f['attributes'],'include':_0x29cc9f[_0xe521('0x19')]?_['map'](_0x29cc9f[_0xe521('0x19')],function(_0x2b326e){return{'model':db[_0x2b326e[_0xe521('0x1a')]],'as':_0x2b326e['as'],'attributes':_0x2b326e['attributes']};}):[]};}):[]};}):[]:[]})[_0xe521('0xb')](function(_0x4538c2){logger['info'](_0xe521('0x14'),_0x592283);logger[_0xe521('0xe')](_0xe521('0x14'),_0x592283,JSON[_0xe521('0xf')](_0x4538c2));_0x21abc9(_0x4538c2);})[_0xe521('0x13')](function(_0x367a56){logger['error'](_0xe521('0x14'),_0x367a56['message'],_0x592283);_0xf0a363(_0x1d5b58[_0xe521('0x10')](0x1f4,_0x367a56[_0xe521('0x12')]));});});}; \ No newline at end of file +var _0x64a6=['client','http','request','info','Template,\x20%s,\x20%s','Template,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetTemplate','findAll','options','raw','where','attributes','limit','include','map','model','then','debug','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x6ef27,_0x50189c){var _0xbe126=function(_0x46fb60){while(--_0x46fb60){_0x6ef27['push'](_0x6ef27['shift']());}};_0xbe126(++_0x50189c);}(_0x64a6,0x183));var _0x664a=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x64a6[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0x664a('0x0'));var util=require(_0x664a('0x1'));var moment=require(_0x664a('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x664a('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x664a('0x4'));var logger=require(_0x664a('0x5'))(_0x664a('0x6'));var config=require(_0x664a('0x7'));var jayson=require(_0x664a('0x8'));var client=jayson[_0x664a('0x9')][_0x664a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5f1ffe,_0x441a33,_0x16f0a6){return new BPromise(function(_0x29abcf,_0x52f30a){return client[_0x664a('0xb')](_0x5f1ffe,_0x16f0a6)['then'](function(_0x5ef794){logger[_0x664a('0xc')](_0x664a('0xd'),_0x441a33,'request\x20sent');logger['debug'](_0x664a('0xe'),_0x441a33,'request\x20sent',JSON[_0x664a('0xf')](_0x5ef794));if(_0x5ef794[_0x664a('0x10')]){if(_0x5ef794[_0x664a('0x10')][_0x664a('0x11')]===0x1f4){logger[_0x664a('0x10')](_0x664a('0xd'),_0x441a33,_0x5ef794[_0x664a('0x10')][_0x664a('0x12')]);return _0x52f30a(_0x5ef794[_0x664a('0x10')][_0x664a('0x12')]);}logger[_0x664a('0x10')](_0x664a('0xd'),_0x441a33,_0x5ef794[_0x664a('0x10')][_0x664a('0x12')]);return _0x29abcf(_0x5ef794[_0x664a('0x10')][_0x664a('0x12')]);}else{logger[_0x664a('0xc')](_0x664a('0xd'),_0x441a33,'request\x20sent');_0x29abcf(_0x5ef794[_0x664a('0x13')]['message']);}})[_0x664a('0x14')](function(_0x3fb60c){logger[_0x664a('0x10')]('Template,\x20%s,\x20%s',_0x441a33,_0x3fb60c);_0x52f30a(_0x3fb60c);});});}exports[_0x664a('0x15')]=function(_0x56d58c){var _0x48866e=this;return new Promise(function(_0x5d2c0e,_0x4cd119){return db['Template'][_0x664a('0x16')]({'raw':_0x56d58c[_0x664a('0x17')]?_0x56d58c['options'][_0x664a('0x18')]===undefined?!![]:![]:!![],'where':_0x56d58c[_0x664a('0x17')]?_0x56d58c[_0x664a('0x17')][_0x664a('0x19')]||null:null,'attributes':_0x56d58c['options']?_0x56d58c[_0x664a('0x17')][_0x664a('0x1a')]||null:null,'limit':_0x56d58c['options']?_0x56d58c[_0x664a('0x17')][_0x664a('0x1b')]||null:null,'include':_0x56d58c[_0x664a('0x17')]?_0x56d58c[_0x664a('0x17')][_0x664a('0x1c')]?_[_0x664a('0x1d')](_0x56d58c['options'][_0x664a('0x1c')],function(_0x509bf0){return{'model':db[_0x509bf0[_0x664a('0x1e')]],'as':_0x509bf0['as'],'attributes':_0x509bf0[_0x664a('0x1a')],'include':_0x509bf0[_0x664a('0x1c')]?_[_0x664a('0x1d')](_0x509bf0[_0x664a('0x1c')],function(_0x2590f9){return{'model':db[_0x2590f9['model']],'as':_0x2590f9['as'],'attributes':_0x2590f9[_0x664a('0x1a')],'include':_0x2590f9[_0x664a('0x1c')]?_[_0x664a('0x1d')](_0x2590f9[_0x664a('0x1c')],function(_0xbaf019){return{'model':db[_0xbaf019[_0x664a('0x1e')]],'as':_0xbaf019['as'],'attributes':_0xbaf019[_0x664a('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x664a('0x1f')](function(_0x350641){logger['info'](_0x664a('0x15'),_0x56d58c);logger[_0x664a('0x20')](_0x664a('0x15'),_0x56d58c,JSON['stringify'](_0x350641));_0x5d2c0e(_0x350641);})[_0x664a('0x14')](function(_0x399efe){logger[_0x664a('0x10')](_0x664a('0x15'),_0x399efe[_0x664a('0x12')],_0x56d58c);_0x4cd119(_0x48866e['error'](0x1f4,_0x399efe[_0x664a('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/trigger/index.js b/server/api/trigger/index.js index 0b5342a..8db2387 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 _0xf3f2=['express','Router','fs-extra','../../components/interaction/service','../../config/environment','./trigger.controller','get','isAuthenticated','/:id','show','/:id/all_conditions','getAllConditions','/:id/any_conditions','getAnyConditions','/:id/actions','getActions','post','addAllCondition','addAnyCondition','addAction','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x3d6137,_0x13d351){var _0x5daf34=function(_0x46d844){while(--_0x46d844){_0x3d6137['push'](_0x3d6137['shift']());}};_0x5daf34(++_0x13d351);}(_0xf3f2,0x140));var _0x2f3f=function(_0x2d7c2f,_0x49c9a3){_0x2d7c2f=_0x2d7c2f-0x0;var _0xfcc955=_0xf3f2[_0x2d7c2f];return _0xfcc955;};'use strict';var multer=require(_0x2f3f('0x0'));var util=require(_0x2f3f('0x1'));var path=require(_0x2f3f('0x2'));var timeout=require(_0x2f3f('0x3'));var express=require(_0x2f3f('0x4'));var router=express[_0x2f3f('0x5')]();var fs_extra=require(_0x2f3f('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x2f3f('0x7'));var config=require(_0x2f3f('0x8'));var controller=require(_0x2f3f('0x9'));router[_0x2f3f('0xa')]('/',auth[_0x2f3f('0xb')](),controller['index']);router['get'](_0x2f3f('0xc'),auth[_0x2f3f('0xb')](),controller[_0x2f3f('0xd')]);router[_0x2f3f('0xa')](_0x2f3f('0xe'),auth[_0x2f3f('0xb')](),controller[_0x2f3f('0xf')]);router[_0x2f3f('0xa')](_0x2f3f('0x10'),auth[_0x2f3f('0xb')](),controller[_0x2f3f('0x11')]);router[_0x2f3f('0xa')](_0x2f3f('0x12'),auth['isAuthenticated'](),controller[_0x2f3f('0x13')]);router['post']('/',auth[_0x2f3f('0xb')](),controller['create']);router[_0x2f3f('0x14')]('/:id/all_conditions',auth[_0x2f3f('0xb')](),controller[_0x2f3f('0x15')]);router['post']('/:id/any_conditions',auth['isAuthenticated'](),controller[_0x2f3f('0x16')]);router[_0x2f3f('0x14')](_0x2f3f('0x12'),auth[_0x2f3f('0xb')](),controller[_0x2f3f('0x17')]);router['put'](_0x2f3f('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x2f3f('0x18')](_0x2f3f('0xc'),auth[_0x2f3f('0xb')](),controller[_0x2f3f('0x19')]);module[_0x2f3f('0x1a')]=router; \ No newline at end of file +var _0xebb3=['/:id/all_conditions','getAnyConditions','/:id/actions','getActions','post','create','addAllCondition','/:id/any_conditions','addAnyCondition','addAction','put','delete','destroy','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show'];(function(_0x23d045,_0x5acc88){var _0xaa7b2a=function(_0x2d6816){while(--_0x2d6816){_0x23d045['push'](_0x23d045['shift']());}};_0xaa7b2a(++_0x5acc88);}(_0xebb3,0x187));var _0x3ebb=function(_0x5aff19,_0x1b2577){_0x5aff19=_0x5aff19-0x0;var _0x30d5ff=_0xebb3[_0x5aff19];return _0x30d5ff;};'use strict';var multer=require(_0x3ebb('0x0'));var util=require(_0x3ebb('0x1'));var path=require(_0x3ebb('0x2'));var timeout=require(_0x3ebb('0x3'));var express=require('express');var router=express[_0x3ebb('0x4')]();var fs_extra=require(_0x3ebb('0x5'));var auth=require(_0x3ebb('0x6'));var interaction=require(_0x3ebb('0x7'));var config=require(_0x3ebb('0x8'));var controller=require('./trigger.controller');router[_0x3ebb('0x9')]('/',auth[_0x3ebb('0xa')](),controller[_0x3ebb('0xb')]);router[_0x3ebb('0x9')](_0x3ebb('0xc'),auth[_0x3ebb('0xa')](),controller[_0x3ebb('0xd')]);router['get'](_0x3ebb('0xe'),auth[_0x3ebb('0xa')](),controller['getAllConditions']);router[_0x3ebb('0x9')]('/:id/any_conditions',auth[_0x3ebb('0xa')](),controller[_0x3ebb('0xf')]);router[_0x3ebb('0x9')](_0x3ebb('0x10'),auth['isAuthenticated'](),controller[_0x3ebb('0x11')]);router[_0x3ebb('0x12')]('/',auth[_0x3ebb('0xa')](),controller[_0x3ebb('0x13')]);router['post'](_0x3ebb('0xe'),auth[_0x3ebb('0xa')](),controller[_0x3ebb('0x14')]);router['post'](_0x3ebb('0x15'),auth[_0x3ebb('0xa')](),controller[_0x3ebb('0x16')]);router[_0x3ebb('0x12')](_0x3ebb('0x10'),auth['isAuthenticated'](),controller[_0x3ebb('0x17')]);router[_0x3ebb('0x18')](_0x3ebb('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x3ebb('0x19')](_0x3ebb('0xc'),auth[_0x3ebb('0xa')](),controller[_0x3ebb('0x1a')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/trigger/trigger.attributes.js b/server/api/trigger/trigger.attributes.js index 76bbd3b..24aafa5 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 _0x74e6=['BOOLEAN','sequelize','exports'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x74e6,0x8e));var _0x674e=function(_0x50ca5c,_0xf85062){_0x50ca5c=_0x50ca5c-0x0;var _0x2618e2=_0x74e6[_0x50ca5c];return _0x2618e2;};'use strict';var Sequelize=require(_0x674e('0x0'));module[_0x674e('0x1')]={'name':{'type':Sequelize['STRING']},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize[_0x674e('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0x7147=['BOOLEAN','sequelize','exports','STRING'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x7147,0x1ad));var _0x7714=function(_0x58ac34,_0x5b5bfb){_0x58ac34=_0x58ac34-0x0;var _0x3921ab=_0x7147[_0x58ac34];return _0x3921ab;};'use strict';var Sequelize=require(_0x7714('0x0'));module[_0x7714('0x1')]={'name':{'type':Sequelize[_0x7714('0x2')]},'channel':{'type':Sequelize[_0x7714('0x2')]},'description':{'type':Sequelize[_0x7714('0x2')]},'status':{'type':Sequelize[_0x7714('0x3')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/trigger/trigger.controller.js b/server/api/trigger/trigger.controller.js index e3313b4..b9401d8 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 _0xe68c=['path','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','save','then','destroy','get','Triggers','UserProfileResource','stack','name','send','index','Trigger','rawAttributes','fieldName','type','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','VIRTUAL','filter','merge','options','includeAll','include','findAll','rows','catch','params','find','create','body','user','role','userProfileId','autoAssociation','error','addAllCondition','Condition','addAnyCondition','getAllConditions','findOne','pick','getAnyConditions','map','addAction','TriggerId','Action','getActions','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util'];(function(_0x5b38c1,_0xf66ffb){var _0x512de4=function(_0x1a90c3){while(--_0x1a90c3){_0x5b38c1['push'](_0x5b38c1['shift']());}};_0x512de4(++_0xf66ffb);}(_0xe68c,0x1ce));var _0xce68=function(_0x143ca0,_0x586bd3){_0x143ca0=_0x143ca0-0x0;var _0x11f1c5=_0xe68c[_0x143ca0];return _0x11f1c5;};'use strict';var emlformat=require(_0xce68('0x0'));var rimraf=require(_0xce68('0x1'));var zipdir=require(_0xce68('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xce68('0x3'));var moment=require(_0xce68('0x4'));var BPromise=require(_0xce68('0x5'));var Mustache=require(_0xce68('0x6'));var util=require(_0xce68('0x7'));var path=require(_0xce68('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xce68('0x9'));var fs=require('fs');var fs_extra=require(_0xce68('0xa'));var _=require(_0xce68('0xb'));var squel=require(_0xce68('0xc'));var crypto=require(_0xce68('0xd'));var jsforce=require(_0xce68('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xce68('0xf'));var querystring=require(_0xce68('0x10'));var Papa=require(_0xce68('0x11'));var Redis=require(_0xce68('0x12'));var authService=require(_0xce68('0x13'));var qs=require(_0xce68('0x14'));var as=require(_0xce68('0x15'));var hardwareService=require(_0xce68('0x16'));var logger=require(_0xce68('0x17'))(_0xce68('0x18'));var utils=require(_0xce68('0x19'));var config=require(_0xce68('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0xce68('0x1b'))['db'];function respondWithStatusCode(_0xbe14e6,_0x14cbfc){_0x14cbfc=_0x14cbfc||0xcc;return function(_0x3d8721){if(_0x3d8721){return _0xbe14e6[_0xce68('0x1c')](_0x14cbfc);}return _0xbe14e6[_0xce68('0x1d')](_0x14cbfc)[_0xce68('0x1e')]();};}function respondWithResult(_0x4c4a69,_0x3cc8f6){_0x3cc8f6=_0x3cc8f6||0xc8;return function(_0x397b6b){if(_0x397b6b){return _0x4c4a69[_0xce68('0x1d')](_0x3cc8f6)[_0xce68('0x1f')](_0x397b6b);}};}function respondWithFilteredResult(_0x1d0ae0,_0x590b64){return function(_0x55a8eb){if(_0x55a8eb){var _0x14f6b1=typeof _0x590b64[_0xce68('0x20')]===_0xce68('0x21')&&typeof _0x590b64[_0xce68('0x22')]===_0xce68('0x21');var _0x23ceec=_0x55a8eb[_0xce68('0x23')];var _0x17b311=_0x14f6b1?0x0:_0x590b64[_0xce68('0x20')];var _0x85a613=_0x14f6b1?_0x55a8eb[_0xce68('0x23')]:_0x590b64[_0xce68('0x20')]+_0x590b64[_0xce68('0x22')];var _0x3b6eca;if(_0x85a613>=_0x23ceec){_0x85a613=_0x23ceec;_0x3b6eca=0xc8;}else{_0x3b6eca=0xce;}_0x1d0ae0[_0xce68('0x1d')](_0x3b6eca);return _0x1d0ae0['set'](_0xce68('0x24'),_0x17b311+'-'+_0x85a613+'/'+_0x23ceec)[_0xce68('0x1f')](_0x55a8eb);}return null;};}function patchUpdates(_0x104e66){return function(_0x325994){try{jsonpatch['apply'](_0x325994,_0x104e66,!![]);}catch(_0x24e71b){return BPromise['reject'](_0x24e71b);}return _0x325994[_0xce68('0x25')]();};}function saveUpdates(_0x5ec41c,_0xddf120){return function(_0x16544f){if(_0x16544f){return _0x16544f['update'](_0x5ec41c)[_0xce68('0x26')](function(_0x442228){return _0x442228;});}return null;};}function removeEntity(_0x52c627,_0x486bc1){return function(_0x57e632){if(_0x57e632){return _0x57e632[_0xce68('0x27')]()[_0xce68('0x26')](function(){var _0x1bd5b1=_0x57e632[_0xce68('0x28')]({'plain':!![]});var _0x29e13a=_0xce68('0x29');return db[_0xce68('0x2a')][_0xce68('0x27')]({'where':{'type':_0x29e13a,'resourceId':_0x1bd5b1['id']}})[_0xce68('0x26')](function(){return _0x57e632;});})[_0xce68('0x26')](function(){_0x52c627['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4530f2,_0x10a2da){return function(_0x3c5642){if(!_0x3c5642){_0x4530f2[_0xce68('0x1c')](0x194);}return _0x3c5642;};}function handleError(_0x4f9f7d,_0x15a66c){_0x15a66c=_0x15a66c||0x1f4;return function(_0x48669d){logger['error'](_0x48669d[_0xce68('0x2b')]);if(_0x48669d[_0xce68('0x2c')]){delete _0x48669d[_0xce68('0x2c')];}_0x4f9f7d[_0xce68('0x1d')](_0x15a66c)[_0xce68('0x2d')](_0x48669d);};}exports[_0xce68('0x2e')]=function(_0x56cf30,_0x5819a0){var _0x2f66f2={},_0x211721={},_0x11b75d={'count':0x0,'rows':[]};var _0x1389b0=_['map'](db[_0xce68('0x2f')][_0xce68('0x30')],function(_0x1e3e73){return{'name':_0x1e3e73[_0xce68('0x31')],'type':_0x1e3e73[_0xce68('0x32')]['key']};});_0x211721[_0xce68('0x33')]=_['map'](_0x1389b0,_0xce68('0x2c'));_0x211721['query']=_[_0xce68('0x34')](_0x56cf30['query']);_0x211721[_0xce68('0x35')]=_[_0xce68('0x36')](_0x211721['model'],_0x211721[_0xce68('0x37')]);_0x2f66f2[_0xce68('0x38')]=_[_0xce68('0x36')](_0x211721['model'],qs['fields'](_0x56cf30['query'][_0xce68('0x39')]));_0x2f66f2[_0xce68('0x38')]=_0x2f66f2[_0xce68('0x38')][_0xce68('0x3a')]?_0x2f66f2[_0xce68('0x38')]:_0x211721[_0xce68('0x33')];if(!_0x56cf30['query'][_0xce68('0x3b')](_0xce68('0x3c'))){_0x2f66f2[_0xce68('0x22')]=qs['limit'](_0x56cf30[_0xce68('0x37')]['limit']);_0x2f66f2[_0xce68('0x20')]=qs[_0xce68('0x20')](_0x56cf30['query'][_0xce68('0x20')]);}_0x2f66f2[_0xce68('0x3d')]=qs['sort'](_0x56cf30[_0xce68('0x37')][_0xce68('0x3e')]);_0x2f66f2['where']=qs[_0xce68('0x35')](_['pick'](_0x56cf30['query'],_0x211721[_0xce68('0x35')]),_0x1389b0);if(_0x56cf30[_0xce68('0x37')]['filter']){_0x2f66f2[_0xce68('0x3f')]=_['merge'](_0x2f66f2[_0xce68('0x3f')],{'$or':_['map'](_0x1389b0,function(_0x20a0c4){if(_0x20a0c4[_0xce68('0x32')]!==_0xce68('0x40')){var _0x26028={};_0x26028[_0x20a0c4[_0xce68('0x2c')]]={'$like':'%'+_0x56cf30[_0xce68('0x37')][_0xce68('0x41')]+'%'};return _0x26028;}})});}_0x2f66f2=_[_0xce68('0x42')]({},_0x2f66f2,_0x56cf30[_0xce68('0x43')]);var _0x2a939e={'where':_0x2f66f2[_0xce68('0x3f')]};return db[_0xce68('0x2f')][_0xce68('0x23')](_0x2a939e)[_0xce68('0x26')](function(_0xf94414){_0x11b75d[_0xce68('0x23')]=_0xf94414;if(_0x56cf30[_0xce68('0x37')][_0xce68('0x44')]){_0x2f66f2[_0xce68('0x45')]=[{'all':!![]}];}return db['Trigger'][_0xce68('0x46')](_0x2f66f2);})[_0xce68('0x26')](function(_0x1880b0){_0x11b75d[_0xce68('0x47')]=_0x1880b0;return _0x11b75d;})[_0xce68('0x26')](respondWithFilteredResult(_0x5819a0,_0x2f66f2))[_0xce68('0x48')](handleError(_0x5819a0,null));};exports['show']=function(_0x92e2c7,_0x2365fc){var _0x1c2a00={'raw':![],'where':{'id':_0x92e2c7[_0xce68('0x49')]['id']}},_0x9d33ed={};_0x9d33ed[_0xce68('0x33')]=_[_0xce68('0x34')](db['Trigger']['rawAttributes']);_0x9d33ed['query']=_[_0xce68('0x34')](_0x92e2c7[_0xce68('0x37')]);_0x9d33ed[_0xce68('0x35')]=_['intersection'](_0x9d33ed['model'],_0x9d33ed[_0xce68('0x37')]);_0x1c2a00['attributes']=_[_0xce68('0x36')](_0x9d33ed['model'],qs[_0xce68('0x39')](_0x92e2c7[_0xce68('0x37')][_0xce68('0x39')]));_0x1c2a00[_0xce68('0x38')]=_0x1c2a00[_0xce68('0x38')][_0xce68('0x3a')]?_0x1c2a00[_0xce68('0x38')]:_0x9d33ed[_0xce68('0x33')];if(_0x92e2c7[_0xce68('0x37')][_0xce68('0x44')]){_0x1c2a00[_0xce68('0x45')]=[{'all':!![]}];}_0x1c2a00=_[_0xce68('0x42')]({},_0x1c2a00,_0x92e2c7['options']);return db['Trigger'][_0xce68('0x4a')](_0x1c2a00)[_0xce68('0x26')](handleEntityNotFound(_0x2365fc,null))[_0xce68('0x26')](respondWithResult(_0x2365fc,null))[_0xce68('0x48')](handleError(_0x2365fc,null));};exports[_0xce68('0x4b')]=function(_0x516be9,_0x165d22){return db[_0xce68('0x2f')]['create'](_0x516be9[_0xce68('0x4c')],{})[_0xce68('0x26')](function(_0x2368ff){var _0x45a8dd=_0x516be9[_0xce68('0x4d')]['get']({'plain':!![]});if(!_0x45a8dd)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x45a8dd[_0xce68('0x4e')]===_0xce68('0x4d')){var _0x45903d=_0x2368ff[_0xce68('0x28')]({'plain':!![]});var _0x420eca=_0xce68('0x29');return db['UserProfileSection'][_0xce68('0x4a')]({'where':{'name':_0x420eca,'userProfileId':_0x45a8dd[_0xce68('0x4f')]},'raw':!![]})['then'](function(_0x18fd15){if(_0x18fd15&&_0x18fd15[_0xce68('0x50')]===0x0){return db[_0xce68('0x2a')][_0xce68('0x4b')]({'name':_0x45903d[_0xce68('0x2c')],'resourceId':_0x45903d['id'],'type':_0x18fd15['name'],'sectionId':_0x18fd15['id']},{})[_0xce68('0x26')](function(){return _0x2368ff;});}else{return _0x2368ff;}})[_0xce68('0x48')](function(_0x1b2507){logger[_0xce68('0x51')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1b2507);throw _0x1b2507;});}return _0x2368ff;})['then'](respondWithResult(_0x165d22,0xc9))[_0xce68('0x48')](handleError(_0x165d22,null));};exports['update']=function(_0x14a676,_0x1f1cbf){if(_0x14a676[_0xce68('0x4c')]['id']){delete _0x14a676['body']['id'];}return db[_0xce68('0x2f')][_0xce68('0x4a')]({'where':{'id':_0x14a676['params']['id']}})['then'](handleEntityNotFound(_0x1f1cbf,null))[_0xce68('0x26')](saveUpdates(_0x14a676['body'],null))['then'](respondWithResult(_0x1f1cbf,null))[_0xce68('0x48')](handleError(_0x1f1cbf,null));};exports[_0xce68('0x27')]=function(_0x749a4c,_0x4fcd1d){return db[_0xce68('0x2f')][_0xce68('0x4a')]({'where':{'id':_0x749a4c[_0xce68('0x49')]['id']}})['then'](handleEntityNotFound(_0x4fcd1d,null))['then'](removeEntity(_0x4fcd1d,null))['catch'](handleError(_0x4fcd1d,null));};exports[_0xce68('0x52')]=function(_0x22ecf1,_0x3eccc4,_0x512e21){if(_0x22ecf1['body']['id']){delete _0x22ecf1[_0xce68('0x4c')]['id'];}return db['Trigger'][_0xce68('0x4a')]({'where':{'id':_0x22ecf1[_0xce68('0x49')]['id']}})[_0xce68('0x26')](handleEntityNotFound(_0x3eccc4,null))['then'](function(_0x31101b){if(_0x31101b){_0x22ecf1[_0xce68('0x4c')]['TriggerAllId']=_0x31101b['id'];return db[_0xce68('0x53')][_0xce68('0x4b')](_0x22ecf1[_0xce68('0x4c')]);}})[_0xce68('0x26')](respondWithResult(_0x3eccc4,null))[_0xce68('0x48')](handleError(_0x3eccc4,null));};exports[_0xce68('0x54')]=function(_0x2d8d8f,_0x35b774,_0x511da9){if(_0x2d8d8f[_0xce68('0x4c')]['id']){delete _0x2d8d8f[_0xce68('0x4c')]['id'];}return db['Trigger'][_0xce68('0x4a')]({'where':{'id':_0x2d8d8f[_0xce68('0x49')]['id']}})[_0xce68('0x26')](handleEntityNotFound(_0x35b774,null))[_0xce68('0x26')](function(_0x1427f8){if(_0x1427f8){_0x2d8d8f['body']['TriggerAnyId']=_0x1427f8['id'];return db['Condition']['create'](_0x2d8d8f[_0xce68('0x4c')]);}})[_0xce68('0x26')](respondWithResult(_0x35b774,null))['catch'](handleError(_0x35b774,null));};exports[_0xce68('0x55')]=function(_0x446b31,_0x2ca842,_0x40f3e9){var _0x3f200a={};var _0x156266={};var _0x19ac7c;var _0x5ba499;return db[_0xce68('0x2f')][_0xce68('0x56')]({'where':{'id':_0x446b31['params']['id']}})[_0xce68('0x26')](handleEntityNotFound(_0x2ca842,null))[_0xce68('0x26')](function(_0x11f118){if(_0x11f118){_0x19ac7c=_0x11f118;_0x156266[_0xce68('0x33')]=_[_0xce68('0x34')](db['Condition'][_0xce68('0x30')]);_0x156266[_0xce68('0x37')]=_[_0xce68('0x34')](_0x446b31[_0xce68('0x37')]);_0x156266[_0xce68('0x35')]=_['intersection'](_0x156266[_0xce68('0x33')],_0x156266[_0xce68('0x37')]);_0x3f200a[_0xce68('0x38')]=_['intersection'](_0x156266[_0xce68('0x33')],qs[_0xce68('0x39')](_0x446b31['query']['fields']));_0x3f200a['attributes']=_0x3f200a[_0xce68('0x38')][_0xce68('0x3a')]?_0x3f200a[_0xce68('0x38')]:_0x156266[_0xce68('0x33')];_0x3f200a['order']=qs[_0xce68('0x3e')](_0x446b31[_0xce68('0x37')]['sort']);_0x3f200a['where']=qs[_0xce68('0x35')](_[_0xce68('0x57')](_0x446b31['query'],_0x156266[_0xce68('0x35')]));if(_0x446b31[_0xce68('0x37')]['filter']){_0x3f200a['where']=_[_0xce68('0x42')](_0x3f200a[_0xce68('0x3f')],{'$or':_['map'](_0x3f200a[_0xce68('0x38')],function(_0x5c6881){var _0x1064db={};_0x1064db[_0x5c6881]={'$like':'%'+_0x446b31[_0xce68('0x37')][_0xce68('0x41')]+'%'};return _0x1064db;})});}_0x3f200a=_[_0xce68('0x42')]({},_0x3f200a,_0x446b31[_0xce68('0x43')]);return _0x19ac7c['getAllConditions'](_0x3f200a);}})[_0xce68('0x26')](function(_0x101d1c){if(_0x101d1c){_0x5ba499=_0x101d1c[_0xce68('0x3a')];if(!_0x446b31[_0xce68('0x37')][_0xce68('0x3b')](_0xce68('0x3c'))){_0x3f200a['limit']=qs[_0xce68('0x22')](_0x446b31[_0xce68('0x37')]['limit']);_0x3f200a[_0xce68('0x20')]=qs[_0xce68('0x20')](_0x446b31['query']['offset']);}return _0x19ac7c[_0xce68('0x55')](_0x3f200a);}})[_0xce68('0x26')](function(_0x573d05){if(_0x573d05){return _0x573d05?{'count':_0x5ba499,'rows':_0x573d05}:null;}})[_0xce68('0x26')](respondWithResult(_0x2ca842,null))[_0xce68('0x48')](handleError(_0x2ca842,null));};exports[_0xce68('0x58')]=function(_0x6b54d3,_0x319ad2,_0x6c451f){var _0x200667={};var _0x4e0a7b={};var _0x58c85b;var _0x25d64b;return db['Trigger']['findOne']({'where':{'id':_0x6b54d3[_0xce68('0x49')]['id']}})['then'](handleEntityNotFound(_0x319ad2,null))[_0xce68('0x26')](function(_0x47ca50){if(_0x47ca50){_0x58c85b=_0x47ca50;_0x4e0a7b['model']=_[_0xce68('0x34')](db['Condition'][_0xce68('0x30')]);_0x4e0a7b[_0xce68('0x37')]=_[_0xce68('0x34')](_0x6b54d3[_0xce68('0x37')]);_0x4e0a7b['filters']=_['intersection'](_0x4e0a7b[_0xce68('0x33')],_0x4e0a7b[_0xce68('0x37')]);_0x200667[_0xce68('0x38')]=_['intersection'](_0x4e0a7b[_0xce68('0x33')],qs['fields'](_0x6b54d3['query'][_0xce68('0x39')]));_0x200667[_0xce68('0x38')]=_0x200667[_0xce68('0x38')][_0xce68('0x3a')]?_0x200667[_0xce68('0x38')]:_0x4e0a7b[_0xce68('0x33')];_0x200667['order']=qs[_0xce68('0x3e')](_0x6b54d3[_0xce68('0x37')][_0xce68('0x3e')]);_0x200667[_0xce68('0x3f')]=qs['filters'](_[_0xce68('0x57')](_0x6b54d3[_0xce68('0x37')],_0x4e0a7b[_0xce68('0x35')]));if(_0x6b54d3['query'][_0xce68('0x41')]){_0x200667[_0xce68('0x3f')]=_[_0xce68('0x42')](_0x200667[_0xce68('0x3f')],{'$or':_[_0xce68('0x59')](_0x200667[_0xce68('0x38')],function(_0x3e1fdc){var _0x5bfcf={};_0x5bfcf[_0x3e1fdc]={'$like':'%'+_0x6b54d3[_0xce68('0x37')]['filter']+'%'};return _0x5bfcf;})});}_0x200667=_[_0xce68('0x42')]({},_0x200667,_0x6b54d3[_0xce68('0x43')]);return _0x58c85b['getAnyConditions'](_0x200667);}})[_0xce68('0x26')](function(_0x59eb8c){if(_0x59eb8c){_0x25d64b=_0x59eb8c[_0xce68('0x3a')];if(!_0x6b54d3[_0xce68('0x37')][_0xce68('0x3b')](_0xce68('0x3c'))){_0x200667['limit']=qs[_0xce68('0x22')](_0x6b54d3[_0xce68('0x37')][_0xce68('0x22')]);_0x200667['offset']=qs[_0xce68('0x20')](_0x6b54d3[_0xce68('0x37')][_0xce68('0x20')]);}return _0x58c85b[_0xce68('0x58')](_0x200667);}})['then'](function(_0x516b2a){if(_0x516b2a){return _0x516b2a?{'count':_0x25d64b,'rows':_0x516b2a}:null;}})['then'](respondWithResult(_0x319ad2,null))[_0xce68('0x48')](handleError(_0x319ad2,null));};exports[_0xce68('0x5a')]=function(_0x58ede5,_0x428ce0,_0x2cd72a){if(_0x58ede5['body']['id']){delete _0x58ede5[_0xce68('0x4c')]['id'];}return db[_0xce68('0x2f')]['find']({'where':{'id':_0x58ede5[_0xce68('0x49')]['id']}})[_0xce68('0x26')](handleEntityNotFound(_0x428ce0,null))[_0xce68('0x26')](function(_0x12ae0f){if(_0x12ae0f){_0x58ede5['body'][_0xce68('0x5b')]=_0x12ae0f['id'];return db['Action']['create'](_0x58ede5[_0xce68('0x4c')]);}})[_0xce68('0x26')](respondWithResult(_0x428ce0,null))[_0xce68('0x48')](handleError(_0x428ce0,null));};exports['getActions']=function(_0x13c175,_0x56ff1f,_0x17c1fd){var _0x53ebba={};var _0x375fbf={};var _0x5ba283;var _0x4fd401;return db[_0xce68('0x2f')][_0xce68('0x56')]({'where':{'id':_0x13c175[_0xce68('0x49')]['id']}})[_0xce68('0x26')](handleEntityNotFound(_0x56ff1f,null))[_0xce68('0x26')](function(_0x5d712c){if(_0x5d712c){_0x5ba283=_0x5d712c;_0x375fbf['model']=_[_0xce68('0x34')](db[_0xce68('0x5c')][_0xce68('0x30')]);_0x375fbf[_0xce68('0x37')]=_[_0xce68('0x34')](_0x13c175[_0xce68('0x37')]);_0x375fbf[_0xce68('0x35')]=_[_0xce68('0x36')](_0x375fbf['model'],_0x375fbf[_0xce68('0x37')]);_0x53ebba['attributes']=_[_0xce68('0x36')](_0x375fbf[_0xce68('0x33')],qs[_0xce68('0x39')](_0x13c175[_0xce68('0x37')]['fields']));_0x53ebba['attributes']=_0x53ebba['attributes'][_0xce68('0x3a')]?_0x53ebba['attributes']:_0x375fbf[_0xce68('0x33')];_0x53ebba['order']=qs['sort'](_0x13c175[_0xce68('0x37')]['sort']);_0x53ebba[_0xce68('0x3f')]=qs[_0xce68('0x35')](_['pick'](_0x13c175[_0xce68('0x37')],_0x375fbf[_0xce68('0x35')]));if(_0x13c175[_0xce68('0x37')][_0xce68('0x41')]){_0x53ebba[_0xce68('0x3f')]=_[_0xce68('0x42')](_0x53ebba[_0xce68('0x3f')],{'$or':_[_0xce68('0x59')](_0x53ebba[_0xce68('0x38')],function(_0xe23e4){var _0x210a96={};_0x210a96[_0xe23e4]={'$like':'%'+_0x13c175[_0xce68('0x37')][_0xce68('0x41')]+'%'};return _0x210a96;})});}_0x53ebba=_[_0xce68('0x42')]({},_0x53ebba,_0x13c175[_0xce68('0x43')]);return _0x5ba283[_0xce68('0x5d')](_0x53ebba);}})[_0xce68('0x26')](function(_0x4aa43e){if(_0x4aa43e){_0x4fd401=_0x4aa43e['length'];if(!_0x13c175['query'][_0xce68('0x3b')]('nolimit')){_0x53ebba[_0xce68('0x22')]=qs['limit'](_0x13c175[_0xce68('0x37')][_0xce68('0x22')]);_0x53ebba[_0xce68('0x20')]=qs[_0xce68('0x20')](_0x13c175[_0xce68('0x37')][_0xce68('0x20')]);}return _0x5ba283[_0xce68('0x5d')](_0x53ebba);}})[_0xce68('0x26')](function(_0x546176){if(_0x546176){return _0x546176?{'count':_0x4fd401,'rows':_0x546176}:null;}})[_0xce68('0x26')](respondWithResult(_0x56ff1f,null))[_0xce68('0x48')](handleError(_0x56ff1f,null));}; \ No newline at end of file +var _0x201f=['lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','apply','reject','save','then','destroy','get','UserProfileResource','stack','send','index','map','Trigger','rawAttributes','fieldName','type','model','name','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','count','includeAll','include','findAll','rows','catch','show','params','find','create','body','user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addAllCondition','Condition','TriggerAnyId','getAllConditions','findOne','getAnyConditions','TriggerId','Action','getActions','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra'];(function(_0x1cefaf,_0x36c392){var _0x5da5dc=function(_0x1b6e6d){while(--_0x1b6e6d){_0x1cefaf['push'](_0x1cefaf['shift']());}};_0x5da5dc(++_0x36c392);}(_0x201f,0x1bc));var _0xf201=function(_0x4c4863,_0x39ea81){_0x4c4863=_0x4c4863-0x0;var _0xd60839=_0x201f[_0x4c4863];return _0xd60839;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf201('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf201('0x1'));var rp=require(_0xf201('0x2'));var moment=require(_0xf201('0x3'));var BPromise=require(_0xf201('0x4'));var Mustache=require(_0xf201('0x5'));var util=require(_0xf201('0x6'));var path=require('path');var sox=require(_0xf201('0x7'));var csv=require(_0xf201('0x8'));var ejs=require(_0xf201('0x9'));var fs=require('fs');var fs_extra=require(_0xf201('0xa'));var _=require(_0xf201('0xb'));var squel=require(_0xf201('0xc'));var crypto=require('crypto');var jsforce=require(_0xf201('0xd'));var deskjs=require(_0xf201('0xe'));var toCsv=require(_0xf201('0x8'));var querystring=require('querystring');var Papa=require(_0xf201('0xf'));var Redis=require(_0xf201('0x10'));var authService=require(_0xf201('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xf201('0x12'));var hardwareService=require(_0xf201('0x13'));var logger=require(_0xf201('0x14'))(_0xf201('0x15'));var utils=require(_0xf201('0x16'));var config=require(_0xf201('0x17'));var licenseUtil=require(_0xf201('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x429bdb,_0x36e0d2){_0x36e0d2=_0x36e0d2||0xcc;return function(_0x29d388){if(_0x29d388){return _0x429bdb[_0xf201('0x19')](_0x36e0d2);}return _0x429bdb[_0xf201('0x1a')](_0x36e0d2)[_0xf201('0x1b')]();};}function respondWithResult(_0x1f2d63,_0x10a24a){_0x10a24a=_0x10a24a||0xc8;return function(_0x309f26){if(_0x309f26){return _0x1f2d63[_0xf201('0x1a')](_0x10a24a)[_0xf201('0x1c')](_0x309f26);}};}function respondWithFilteredResult(_0x7c5b28,_0x48798d){return function(_0x276dee){if(_0x276dee){var _0xabc1ce=typeof _0x48798d[_0xf201('0x1d')]===_0xf201('0x1e')&&typeof _0x48798d[_0xf201('0x1f')]===_0xf201('0x1e');var _0x23920d=_0x276dee['count'];var _0x37d84d=_0xabc1ce?0x0:_0x48798d[_0xf201('0x1d')];var _0x520198=_0xabc1ce?_0x276dee['count']:_0x48798d['offset']+_0x48798d['limit'];var _0xe22eea;if(_0x520198>=_0x23920d){_0x520198=_0x23920d;_0xe22eea=0xc8;}else{_0xe22eea=0xce;}_0x7c5b28[_0xf201('0x1a')](_0xe22eea);return _0x7c5b28[_0xf201('0x20')](_0xf201('0x21'),_0x37d84d+'-'+_0x520198+'/'+_0x23920d)[_0xf201('0x1c')](_0x276dee);}return null;};}function patchUpdates(_0x2cf460){return function(_0x3b45ff){try{jsonpatch[_0xf201('0x22')](_0x3b45ff,_0x2cf460,!![]);}catch(_0x5d1f50){return BPromise[_0xf201('0x23')](_0x5d1f50);}return _0x3b45ff[_0xf201('0x24')]();};}function saveUpdates(_0x44857c,_0x345a15){return function(_0x5562eb){if(_0x5562eb){return _0x5562eb['update'](_0x44857c)[_0xf201('0x25')](function(_0x29dc74){return _0x29dc74;});}return null;};}function removeEntity(_0x125b5f,_0x502d84){return function(_0x5ad236){if(_0x5ad236){return _0x5ad236[_0xf201('0x26')]()['then'](function(){var _0x540e8b=_0x5ad236[_0xf201('0x27')]({'plain':!![]});var _0xd05e8f='Triggers';return db[_0xf201('0x28')][_0xf201('0x26')]({'where':{'type':_0xd05e8f,'resourceId':_0x540e8b['id']}})[_0xf201('0x25')](function(){return _0x5ad236;});})[_0xf201('0x25')](function(){_0x125b5f[_0xf201('0x1a')](0xcc)[_0xf201('0x1b')]();});}};}function handleEntityNotFound(_0x26a5e2,_0x2a755b){return function(_0x3b774a){if(!_0x3b774a){_0x26a5e2[_0xf201('0x19')](0x194);}return _0x3b774a;};}function handleError(_0x16cd41,_0x46cc59){_0x46cc59=_0x46cc59||0x1f4;return function(_0x1f2d88){logger['error'](_0x1f2d88[_0xf201('0x29')]);if(_0x1f2d88['name']){delete _0x1f2d88['name'];}_0x16cd41['status'](_0x46cc59)[_0xf201('0x2a')](_0x1f2d88);};}exports[_0xf201('0x2b')]=function(_0x2c704c,_0x558ffa){var _0x162632={},_0x3fea59={},_0x5565b0={'count':0x0,'rows':[]};var _0x5f32bb=_[_0xf201('0x2c')](db[_0xf201('0x2d')][_0xf201('0x2e')],function(_0x403efe){return{'name':_0x403efe[_0xf201('0x2f')],'type':_0x403efe[_0xf201('0x30')]['key']};});_0x3fea59[_0xf201('0x31')]=_[_0xf201('0x2c')](_0x5f32bb,_0xf201('0x32'));_0x3fea59[_0xf201('0x33')]=_[_0xf201('0x34')](_0x2c704c[_0xf201('0x33')]);_0x3fea59[_0xf201('0x35')]=_[_0xf201('0x36')](_0x3fea59[_0xf201('0x31')],_0x3fea59['query']);_0x162632['attributes']=_[_0xf201('0x36')](_0x3fea59[_0xf201('0x31')],qs[_0xf201('0x37')](_0x2c704c[_0xf201('0x33')][_0xf201('0x37')]));_0x162632['attributes']=_0x162632[_0xf201('0x38')][_0xf201('0x39')]?_0x162632[_0xf201('0x38')]:_0x3fea59[_0xf201('0x31')];if(!_0x2c704c['query'][_0xf201('0x3a')](_0xf201('0x3b'))){_0x162632['limit']=qs[_0xf201('0x1f')](_0x2c704c[_0xf201('0x33')]['limit']);_0x162632[_0xf201('0x1d')]=qs[_0xf201('0x1d')](_0x2c704c[_0xf201('0x33')][_0xf201('0x1d')]);}_0x162632[_0xf201('0x3c')]=qs['sort'](_0x2c704c[_0xf201('0x33')][_0xf201('0x3d')]);_0x162632[_0xf201('0x3e')]=qs[_0xf201('0x35')](_[_0xf201('0x3f')](_0x2c704c[_0xf201('0x33')],_0x3fea59[_0xf201('0x35')]),_0x5f32bb);if(_0x2c704c[_0xf201('0x33')][_0xf201('0x40')]){_0x162632[_0xf201('0x3e')]=_['merge'](_0x162632[_0xf201('0x3e')],{'$or':_['map'](_0x5f32bb,function(_0xd701f){if(_0xd701f[_0xf201('0x30')]!=='VIRTUAL'){var _0x442a19={};_0x442a19[_0xd701f[_0xf201('0x32')]]={'$like':'%'+_0x2c704c[_0xf201('0x33')][_0xf201('0x40')]+'%'};return _0x442a19;}})});}_0x162632=_[_0xf201('0x41')]({},_0x162632,_0x2c704c[_0xf201('0x42')]);var _0x5df033={'where':_0x162632['where']};return db['Trigger'][_0xf201('0x43')](_0x5df033)['then'](function(_0x505a7e){_0x5565b0['count']=_0x505a7e;if(_0x2c704c[_0xf201('0x33')][_0xf201('0x44')]){_0x162632[_0xf201('0x45')]=[{'all':!![]}];}return db[_0xf201('0x2d')][_0xf201('0x46')](_0x162632);})[_0xf201('0x25')](function(_0x1e5fcc){_0x5565b0[_0xf201('0x47')]=_0x1e5fcc;return _0x5565b0;})['then'](respondWithFilteredResult(_0x558ffa,_0x162632))[_0xf201('0x48')](handleError(_0x558ffa,null));};exports[_0xf201('0x49')]=function(_0x4ac875,_0xd1b397){var _0x5f5923={'raw':![],'where':{'id':_0x4ac875[_0xf201('0x4a')]['id']}},_0x275c99={};_0x275c99[_0xf201('0x31')]=_[_0xf201('0x34')](db[_0xf201('0x2d')][_0xf201('0x2e')]);_0x275c99['query']=_['keys'](_0x4ac875['query']);_0x275c99[_0xf201('0x35')]=_[_0xf201('0x36')](_0x275c99[_0xf201('0x31')],_0x275c99[_0xf201('0x33')]);_0x5f5923[_0xf201('0x38')]=_[_0xf201('0x36')](_0x275c99[_0xf201('0x31')],qs[_0xf201('0x37')](_0x4ac875[_0xf201('0x33')]['fields']));_0x5f5923[_0xf201('0x38')]=_0x5f5923[_0xf201('0x38')]['length']?_0x5f5923[_0xf201('0x38')]:_0x275c99[_0xf201('0x31')];if(_0x4ac875[_0xf201('0x33')][_0xf201('0x44')]){_0x5f5923[_0xf201('0x45')]=[{'all':!![]}];}_0x5f5923=_[_0xf201('0x41')]({},_0x5f5923,_0x4ac875[_0xf201('0x42')]);return db[_0xf201('0x2d')][_0xf201('0x4b')](_0x5f5923)[_0xf201('0x25')](handleEntityNotFound(_0xd1b397,null))[_0xf201('0x25')](respondWithResult(_0xd1b397,null))[_0xf201('0x48')](handleError(_0xd1b397,null));};exports[_0xf201('0x4c')]=function(_0x4f2bf9,_0x3842e2){return db[_0xf201('0x2d')][_0xf201('0x4c')](_0x4f2bf9[_0xf201('0x4d')],{})[_0xf201('0x25')](function(_0x32449a){var _0x40e23f=_0x4f2bf9[_0xf201('0x4e')][_0xf201('0x27')]({'plain':!![]});if(!_0x40e23f)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x40e23f['role']===_0xf201('0x4e')){var _0x3a9fca=_0x32449a[_0xf201('0x27')]({'plain':!![]});var _0x1ca695='Triggers';return db[_0xf201('0x4f')]['find']({'where':{'name':_0x1ca695,'userProfileId':_0x40e23f['userProfileId']},'raw':!![]})[_0xf201('0x25')](function(_0x41785d){if(_0x41785d&&_0x41785d[_0xf201('0x50')]===0x0){return db[_0xf201('0x28')][_0xf201('0x4c')]({'name':_0x3a9fca[_0xf201('0x32')],'resourceId':_0x3a9fca['id'],'type':_0x41785d[_0xf201('0x32')],'sectionId':_0x41785d['id']},{})['then'](function(){return _0x32449a;});}else{return _0x32449a;}})[_0xf201('0x48')](function(_0x38a32d){logger['error'](_0xf201('0x51'),_0x38a32d);throw _0x38a32d;});}return _0x32449a;})[_0xf201('0x25')](respondWithResult(_0x3842e2,0xc9))['catch'](handleError(_0x3842e2,null));};exports['update']=function(_0xb9f01c,_0x49a67e){if(_0xb9f01c['body']['id']){delete _0xb9f01c[_0xf201('0x4d')]['id'];}return db['Trigger'][_0xf201('0x4b')]({'where':{'id':_0xb9f01c[_0xf201('0x4a')]['id']}})['then'](handleEntityNotFound(_0x49a67e,null))[_0xf201('0x25')](saveUpdates(_0xb9f01c[_0xf201('0x4d')],null))[_0xf201('0x25')](respondWithResult(_0x49a67e,null))[_0xf201('0x48')](handleError(_0x49a67e,null));};exports[_0xf201('0x26')]=function(_0x52b89d,_0x5a8ec7){return db[_0xf201('0x2d')][_0xf201('0x4b')]({'where':{'id':_0x52b89d[_0xf201('0x4a')]['id']}})['then'](handleEntityNotFound(_0x5a8ec7,null))[_0xf201('0x25')](removeEntity(_0x5a8ec7,null))[_0xf201('0x48')](handleError(_0x5a8ec7,null));};exports[_0xf201('0x52')]=function(_0x138395,_0x46d2c6,_0x189b38){if(_0x138395[_0xf201('0x4d')]['id']){delete _0x138395[_0xf201('0x4d')]['id'];}return db[_0xf201('0x2d')][_0xf201('0x4b')]({'where':{'id':_0x138395[_0xf201('0x4a')]['id']}})['then'](handleEntityNotFound(_0x46d2c6,null))['then'](function(_0x870e79){if(_0x870e79){_0x138395[_0xf201('0x4d')]['TriggerAllId']=_0x870e79['id'];return db[_0xf201('0x53')]['create'](_0x138395[_0xf201('0x4d')]);}})[_0xf201('0x25')](respondWithResult(_0x46d2c6,null))['catch'](handleError(_0x46d2c6,null));};exports['addAnyCondition']=function(_0x5d5aa8,_0x5b72b9,_0x15f64f){if(_0x5d5aa8['body']['id']){delete _0x5d5aa8[_0xf201('0x4d')]['id'];}return db[_0xf201('0x2d')]['find']({'where':{'id':_0x5d5aa8[_0xf201('0x4a')]['id']}})[_0xf201('0x25')](handleEntityNotFound(_0x5b72b9,null))[_0xf201('0x25')](function(_0x15aa31){if(_0x15aa31){_0x5d5aa8[_0xf201('0x4d')][_0xf201('0x54')]=_0x15aa31['id'];return db['Condition']['create'](_0x5d5aa8[_0xf201('0x4d')]);}})[_0xf201('0x25')](respondWithResult(_0x5b72b9,null))['catch'](handleError(_0x5b72b9,null));};exports[_0xf201('0x55')]=function(_0x4c5bc5,_0x48d4cf,_0x478f75){var _0x3c3151={};var _0x5c20c5={};var _0x5a5116;var _0xa8c1ed;return db[_0xf201('0x2d')][_0xf201('0x56')]({'where':{'id':_0x4c5bc5[_0xf201('0x4a')]['id']}})[_0xf201('0x25')](handleEntityNotFound(_0x48d4cf,null))[_0xf201('0x25')](function(_0x57676c){if(_0x57676c){_0x5a5116=_0x57676c;_0x5c20c5[_0xf201('0x31')]=_['keys'](db[_0xf201('0x53')][_0xf201('0x2e')]);_0x5c20c5[_0xf201('0x33')]=_['keys'](_0x4c5bc5[_0xf201('0x33')]);_0x5c20c5[_0xf201('0x35')]=_[_0xf201('0x36')](_0x5c20c5[_0xf201('0x31')],_0x5c20c5[_0xf201('0x33')]);_0x3c3151['attributes']=_[_0xf201('0x36')](_0x5c20c5[_0xf201('0x31')],qs[_0xf201('0x37')](_0x4c5bc5[_0xf201('0x33')][_0xf201('0x37')]));_0x3c3151[_0xf201('0x38')]=_0x3c3151[_0xf201('0x38')][_0xf201('0x39')]?_0x3c3151[_0xf201('0x38')]:_0x5c20c5['model'];_0x3c3151[_0xf201('0x3c')]=qs[_0xf201('0x3d')](_0x4c5bc5[_0xf201('0x33')]['sort']);_0x3c3151['where']=qs[_0xf201('0x35')](_[_0xf201('0x3f')](_0x4c5bc5['query'],_0x5c20c5[_0xf201('0x35')]));if(_0x4c5bc5[_0xf201('0x33')][_0xf201('0x40')]){_0x3c3151['where']=_[_0xf201('0x41')](_0x3c3151[_0xf201('0x3e')],{'$or':_[_0xf201('0x2c')](_0x3c3151[_0xf201('0x38')],function(_0x54dc14){var _0x43b1d1={};_0x43b1d1[_0x54dc14]={'$like':'%'+_0x4c5bc5['query'][_0xf201('0x40')]+'%'};return _0x43b1d1;})});}_0x3c3151=_[_0xf201('0x41')]({},_0x3c3151,_0x4c5bc5[_0xf201('0x42')]);return _0x5a5116[_0xf201('0x55')](_0x3c3151);}})[_0xf201('0x25')](function(_0x36e09d){if(_0x36e09d){_0xa8c1ed=_0x36e09d['length'];if(!_0x4c5bc5['query']['hasOwnProperty'](_0xf201('0x3b'))){_0x3c3151[_0xf201('0x1f')]=qs['limit'](_0x4c5bc5[_0xf201('0x33')][_0xf201('0x1f')]);_0x3c3151[_0xf201('0x1d')]=qs[_0xf201('0x1d')](_0x4c5bc5[_0xf201('0x33')]['offset']);}return _0x5a5116['getAllConditions'](_0x3c3151);}})[_0xf201('0x25')](function(_0x3a0251){if(_0x3a0251){return _0x3a0251?{'count':_0xa8c1ed,'rows':_0x3a0251}:null;}})[_0xf201('0x25')](respondWithResult(_0x48d4cf,null))[_0xf201('0x48')](handleError(_0x48d4cf,null));};exports[_0xf201('0x57')]=function(_0x2897e4,_0x37937f,_0x5cc633){var _0x354b0c={};var _0x4aa2dd={};var _0x57cf32;var _0x22fdfc;return db[_0xf201('0x2d')][_0xf201('0x56')]({'where':{'id':_0x2897e4[_0xf201('0x4a')]['id']}})[_0xf201('0x25')](handleEntityNotFound(_0x37937f,null))[_0xf201('0x25')](function(_0x2b0889){if(_0x2b0889){_0x57cf32=_0x2b0889;_0x4aa2dd[_0xf201('0x31')]=_[_0xf201('0x34')](db['Condition'][_0xf201('0x2e')]);_0x4aa2dd[_0xf201('0x33')]=_[_0xf201('0x34')](_0x2897e4[_0xf201('0x33')]);_0x4aa2dd[_0xf201('0x35')]=_[_0xf201('0x36')](_0x4aa2dd[_0xf201('0x31')],_0x4aa2dd[_0xf201('0x33')]);_0x354b0c[_0xf201('0x38')]=_[_0xf201('0x36')](_0x4aa2dd[_0xf201('0x31')],qs['fields'](_0x2897e4[_0xf201('0x33')][_0xf201('0x37')]));_0x354b0c[_0xf201('0x38')]=_0x354b0c[_0xf201('0x38')][_0xf201('0x39')]?_0x354b0c[_0xf201('0x38')]:_0x4aa2dd['model'];_0x354b0c[_0xf201('0x3c')]=qs[_0xf201('0x3d')](_0x2897e4[_0xf201('0x33')][_0xf201('0x3d')]);_0x354b0c[_0xf201('0x3e')]=qs[_0xf201('0x35')](_['pick'](_0x2897e4[_0xf201('0x33')],_0x4aa2dd['filters']));if(_0x2897e4[_0xf201('0x33')][_0xf201('0x40')]){_0x354b0c[_0xf201('0x3e')]=_[_0xf201('0x41')](_0x354b0c[_0xf201('0x3e')],{'$or':_[_0xf201('0x2c')](_0x354b0c[_0xf201('0x38')],function(_0x3f527e){var _0x328bbb={};_0x328bbb[_0x3f527e]={'$like':'%'+_0x2897e4[_0xf201('0x33')][_0xf201('0x40')]+'%'};return _0x328bbb;})});}_0x354b0c=_[_0xf201('0x41')]({},_0x354b0c,_0x2897e4[_0xf201('0x42')]);return _0x57cf32[_0xf201('0x57')](_0x354b0c);}})[_0xf201('0x25')](function(_0x3a30c0){if(_0x3a30c0){_0x22fdfc=_0x3a30c0['length'];if(!_0x2897e4[_0xf201('0x33')]['hasOwnProperty'](_0xf201('0x3b'))){_0x354b0c[_0xf201('0x1f')]=qs['limit'](_0x2897e4['query'][_0xf201('0x1f')]);_0x354b0c[_0xf201('0x1d')]=qs[_0xf201('0x1d')](_0x2897e4['query'][_0xf201('0x1d')]);}return _0x57cf32[_0xf201('0x57')](_0x354b0c);}})[_0xf201('0x25')](function(_0x2eca02){if(_0x2eca02){return _0x2eca02?{'count':_0x22fdfc,'rows':_0x2eca02}:null;}})[_0xf201('0x25')](respondWithResult(_0x37937f,null))[_0xf201('0x48')](handleError(_0x37937f,null));};exports['addAction']=function(_0x4c5396,_0x17dc1d,_0x331c0b){if(_0x4c5396['body']['id']){delete _0x4c5396[_0xf201('0x4d')]['id'];}return db[_0xf201('0x2d')]['find']({'where':{'id':_0x4c5396[_0xf201('0x4a')]['id']}})[_0xf201('0x25')](handleEntityNotFound(_0x17dc1d,null))[_0xf201('0x25')](function(_0x39f003){if(_0x39f003){_0x4c5396[_0xf201('0x4d')][_0xf201('0x58')]=_0x39f003['id'];return db[_0xf201('0x59')]['create'](_0x4c5396[_0xf201('0x4d')]);}})[_0xf201('0x25')](respondWithResult(_0x17dc1d,null))[_0xf201('0x48')](handleError(_0x17dc1d,null));};exports['getActions']=function(_0x39d923,_0x473d85,_0x1515e9){var _0x7e5220={};var _0x490acc={};var _0x5bbff8;var _0x5639e1;return db['Trigger'][_0xf201('0x56')]({'where':{'id':_0x39d923[_0xf201('0x4a')]['id']}})[_0xf201('0x25')](handleEntityNotFound(_0x473d85,null))['then'](function(_0x4f95cc){if(_0x4f95cc){_0x5bbff8=_0x4f95cc;_0x490acc[_0xf201('0x31')]=_[_0xf201('0x34')](db[_0xf201('0x59')]['rawAttributes']);_0x490acc[_0xf201('0x33')]=_[_0xf201('0x34')](_0x39d923[_0xf201('0x33')]);_0x490acc[_0xf201('0x35')]=_[_0xf201('0x36')](_0x490acc['model'],_0x490acc['query']);_0x7e5220[_0xf201('0x38')]=_['intersection'](_0x490acc[_0xf201('0x31')],qs[_0xf201('0x37')](_0x39d923[_0xf201('0x33')]['fields']));_0x7e5220[_0xf201('0x38')]=_0x7e5220['attributes'][_0xf201('0x39')]?_0x7e5220[_0xf201('0x38')]:_0x490acc['model'];_0x7e5220[_0xf201('0x3c')]=qs[_0xf201('0x3d')](_0x39d923[_0xf201('0x33')]['sort']);_0x7e5220[_0xf201('0x3e')]=qs[_0xf201('0x35')](_[_0xf201('0x3f')](_0x39d923[_0xf201('0x33')],_0x490acc['filters']));if(_0x39d923['query']['filter']){_0x7e5220[_0xf201('0x3e')]=_[_0xf201('0x41')](_0x7e5220[_0xf201('0x3e')],{'$or':_['map'](_0x7e5220[_0xf201('0x38')],function(_0x327215){var _0x47c1b1={};_0x47c1b1[_0x327215]={'$like':'%'+_0x39d923[_0xf201('0x33')][_0xf201('0x40')]+'%'};return _0x47c1b1;})});}_0x7e5220=_[_0xf201('0x41')]({},_0x7e5220,_0x39d923[_0xf201('0x42')]);return _0x5bbff8[_0xf201('0x5a')](_0x7e5220);}})[_0xf201('0x25')](function(_0x1467b8){if(_0x1467b8){_0x5639e1=_0x1467b8[_0xf201('0x39')];if(!_0x39d923[_0xf201('0x33')][_0xf201('0x3a')]('nolimit')){_0x7e5220['limit']=qs[_0xf201('0x1f')](_0x39d923[_0xf201('0x33')][_0xf201('0x1f')]);_0x7e5220[_0xf201('0x1d')]=qs[_0xf201('0x1d')](_0x39d923[_0xf201('0x33')][_0xf201('0x1d')]);}return _0x5bbff8['getActions'](_0x7e5220);}})[_0xf201('0x25')](function(_0x853b0b){if(_0x853b0b){return _0x853b0b?{'count':_0x5639e1,'rows':_0x853b0b}:null;}})[_0xf201('0x25')](respondWithResult(_0x473d85,null))[_0xf201('0x48')](handleError(_0x473d85,null));}; \ No newline at end of file diff --git a/server/api/trigger/trigger.model.js b/server/api/trigger/trigger.model.js index 15a81e2..b84c2b9 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 _0x92e0=['exports','define','Trigger','tools_triggers','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./trigger.attributes'];(function(_0x4ca91f,_0x399dc6){var _0xf593f6=function(_0x47de1e){while(--_0x47de1e){_0x4ca91f['push'](_0x4ca91f['shift']());}};_0xf593f6(++_0x399dc6);}(_0x92e0,0x154));var _0x092e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x92e0[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x092e('0x0'));var util=require('util');var logger=require(_0x092e('0x1'))(_0x092e('0x2'));var moment=require(_0x092e('0x3'));var BPromise=require(_0x092e('0x4'));var rp=require(_0x092e('0x5'));var fs=require('fs');var path=require(_0x092e('0x6'));var rimraf=require(_0x092e('0x7'));var config=require(_0x092e('0x8'));var attributes=require(_0x092e('0x9'));module[_0x092e('0xa')]=function(_0x51779f,_0x48af76){return _0x51779f[_0x092e('0xb')](_0x092e('0xc'),attributes,{'tableName':_0x092e('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2fda=['lodash','api','moment','bluebird','request-promise','path','exports','define','Trigger','tools_triggers'];(function(_0x144f9f,_0x43b361){var _0x4b02fe=function(_0x1e458e){while(--_0x1e458e){_0x144f9f['push'](_0x144f9f['shift']());}};_0x4b02fe(++_0x43b361);}(_0x2fda,0x186));var _0xa2fd=function(_0x173d7e,_0x3242fd){_0x173d7e=_0x173d7e-0x0;var _0x2220d6=_0x2fda[_0x173d7e];return _0x2220d6;};'use strict';var _=require(_0xa2fd('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xa2fd('0x1'));var moment=require(_0xa2fd('0x2'));var BPromise=require(_0xa2fd('0x3'));var rp=require(_0xa2fd('0x4'));var fs=require('fs');var path=require(_0xa2fd('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./trigger.attributes');module[_0xa2fd('0x6')]=function(_0x1bab5a,_0x4c6b0b){return _0x1bab5a[_0xa2fd('0x7')](_0xa2fd('0x8'),attributes,{'tableName':_0xa2fd('0x9'),'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 956886c..716377f 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 _0xf373=['code','message','catch','GetTrigger','findAll','options','raw','where','limit','map','model','attributes','include','then','Trigger','find','ShowTrigger','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','info','Trigger,\x20%s,\x20%s','debug','Trigger,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x4832b8,_0x1cde29){var _0x425045=function(_0x27a709){while(--_0x27a709){_0x4832b8['push'](_0x4832b8['shift']());}};_0x425045(++_0x1cde29);}(_0xf373,0x165));var _0x3f37=function(_0x3ee815,_0x108cc6){_0x3ee815=_0x3ee815-0x0;var _0xf1c8b0=_0xf373[_0x3ee815];return _0xf1c8b0;};'use strict';var _=require('lodash');var util=require(_0x3f37('0x0'));var moment=require(_0x3f37('0x1'));var BPromise=require(_0x3f37('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3f37('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x3f37('0x4'));var logger=require(_0x3f37('0x5'))(_0x3f37('0x6'));var config=require(_0x3f37('0x7'));var jayson=require(_0x3f37('0x8'));var client=jayson[_0x3f37('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x457db1,_0x13166e,_0x290d35){return new BPromise(function(_0x2962b3,_0x5dd878){return client['request'](_0x457db1,_0x290d35)['then'](function(_0x84a1a7){logger[_0x3f37('0xa')](_0x3f37('0xb'),_0x13166e,'request\x20sent');logger[_0x3f37('0xc')](_0x3f37('0xd'),_0x13166e,_0x3f37('0xe'),JSON[_0x3f37('0xf')](_0x84a1a7));if(_0x84a1a7[_0x3f37('0x10')]){if(_0x84a1a7['error'][_0x3f37('0x11')]===0x1f4){logger[_0x3f37('0x10')]('Trigger,\x20%s,\x20%s',_0x13166e,_0x84a1a7[_0x3f37('0x10')][_0x3f37('0x12')]);return _0x5dd878(_0x84a1a7[_0x3f37('0x10')][_0x3f37('0x12')]);}logger[_0x3f37('0x10')](_0x3f37('0xb'),_0x13166e,_0x84a1a7[_0x3f37('0x10')][_0x3f37('0x12')]);return _0x2962b3(_0x84a1a7[_0x3f37('0x10')]['message']);}else{logger['info'](_0x3f37('0xb'),_0x13166e,_0x3f37('0xe'));_0x2962b3(_0x84a1a7['result'][_0x3f37('0x12')]);}})[_0x3f37('0x13')](function(_0x49dace){logger['error'](_0x3f37('0xb'),_0x13166e,_0x49dace);_0x5dd878(_0x49dace);});});}exports[_0x3f37('0x14')]=function(_0x36bd76){var _0x2f2f12=this;return new Promise(function(_0x3eec36,_0x1e8c2a){return db['Trigger'][_0x3f37('0x15')]({'raw':_0x36bd76['options']?_0x36bd76[_0x3f37('0x16')][_0x3f37('0x17')]===undefined?!![]:![]:!![],'where':_0x36bd76['options']?_0x36bd76['options'][_0x3f37('0x18')]||null:null,'attributes':_0x36bd76[_0x3f37('0x16')]?_0x36bd76[_0x3f37('0x16')]['attributes']||null:null,'limit':_0x36bd76[_0x3f37('0x16')]?_0x36bd76['options'][_0x3f37('0x19')]||null:null,'include':_0x36bd76[_0x3f37('0x16')]?_0x36bd76[_0x3f37('0x16')]['include']?_[_0x3f37('0x1a')](_0x36bd76[_0x3f37('0x16')]['include'],function(_0x539f03){return{'model':db[_0x539f03[_0x3f37('0x1b')]],'as':_0x539f03['as'],'attributes':_0x539f03[_0x3f37('0x1c')],'include':_0x539f03[_0x3f37('0x1d')]?_['map'](_0x539f03[_0x3f37('0x1d')],function(_0x16b3cd){return{'model':db[_0x16b3cd[_0x3f37('0x1b')]],'as':_0x16b3cd['as'],'attributes':_0x16b3cd[_0x3f37('0x1c')],'include':_0x16b3cd['include']?_[_0x3f37('0x1a')](_0x16b3cd['include'],function(_0x5cd5e0){return{'model':db[_0x5cd5e0['model']],'as':_0x5cd5e0['as'],'attributes':_0x5cd5e0['attributes']};}):[]};}):[]};}):[]:[]})[_0x3f37('0x1e')](function(_0x254dc5){logger[_0x3f37('0xa')](_0x3f37('0x14'),_0x36bd76);logger[_0x3f37('0xc')](_0x3f37('0x14'),_0x36bd76,JSON[_0x3f37('0xf')](_0x254dc5));_0x3eec36(_0x254dc5);})['catch'](function(_0x4d8185){logger[_0x3f37('0x10')]('GetTrigger',_0x4d8185[_0x3f37('0x12')],_0x36bd76);_0x1e8c2a(_0x2f2f12[_0x3f37('0x10')](0x1f4,_0x4d8185[_0x3f37('0x12')]));});});};exports['ShowTrigger']=function(_0x88d672){var _0x319320=this;return new Promise(function(_0x3d746b,_0x28eda3){return db[_0x3f37('0x1f')][_0x3f37('0x20')]({'raw':_0x88d672[_0x3f37('0x16')]?_0x88d672[_0x3f37('0x16')][_0x3f37('0x17')]===undefined?!![]:![]:!![],'where':_0x88d672['options']?_0x88d672[_0x3f37('0x16')][_0x3f37('0x18')]||null:null,'attributes':_0x88d672['options']?_0x88d672[_0x3f37('0x16')][_0x3f37('0x1c')]||null:null,'include':_0x88d672['options']?_0x88d672[_0x3f37('0x16')][_0x3f37('0x1d')]?_[_0x3f37('0x1a')](_0x88d672[_0x3f37('0x16')]['include'],function(_0x2c2908){return{'model':db[_0x2c2908['model']],'as':_0x2c2908['as'],'attributes':_0x2c2908[_0x3f37('0x1c')],'include':_0x2c2908[_0x3f37('0x1d')]?_[_0x3f37('0x1a')](_0x2c2908[_0x3f37('0x1d')],function(_0x390d4d){return{'model':db[_0x390d4d[_0x3f37('0x1b')]],'as':_0x390d4d['as'],'attributes':_0x390d4d[_0x3f37('0x1c')],'include':_0x390d4d['include']?_['map'](_0x390d4d['include'],function(_0x4cc548){return{'model':db[_0x4cc548[_0x3f37('0x1b')]],'as':_0x4cc548['as'],'attributes':_0x4cc548['attributes']};}):[]};}):[]};}):[]:[]})[_0x3f37('0x1e')](function(_0x4c4b96){logger[_0x3f37('0xa')](_0x3f37('0x21'),_0x88d672);logger['debug']('ShowTrigger',_0x88d672,JSON[_0x3f37('0xf')](_0x4c4b96));_0x3d746b(_0x4c4b96);})['catch'](function(_0x1f962f){logger[_0x3f37('0x10')](_0x3f37('0x21'),_0x1f962f[_0x3f37('0x12')],_0x88d672);_0x28eda3(_0x319320[_0x3f37('0x10')](0x1f4,_0x1f962f[_0x3f37('0x12')]));});});}; \ No newline at end of file +var _0x233b=['request\x20sent','stringify','error','code','Trigger,\x20%s,\x20%s','message','result','catch','GetTrigger','Trigger','findAll','options','where','include','map','model','attributes','ShowTrigger','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','info'];(function(_0x4dab14,_0x164ea0){var _0xf41aa=function(_0x305d50){while(--_0x305d50){_0x4dab14['push'](_0x4dab14['shift']());}};_0xf41aa(++_0x164ea0);}(_0x233b,0x92));var _0xb233=function(_0x1694f5,_0x49b7c3){_0x1694f5=_0x1694f5-0x0;var _0x5b4321=_0x233b[_0x1694f5];return _0x5b4321;};'use strict';var _=require('lodash');var util=require(_0xb233('0x0'));var moment=require(_0xb233('0x1'));var BPromise=require(_0xb233('0x2'));var rs=require(_0xb233('0x3'));var fs=require('fs');var Redis=require(_0xb233('0x4'));var db=require(_0xb233('0x5'))['db'];var utils=require(_0xb233('0x6'));var logger=require(_0xb233('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xb233('0x8'));var client=jayson[_0xb233('0x9')][_0xb233('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xe466e3,_0xb3bda5,_0x17d6e5){return new BPromise(function(_0x53ecf6,_0x3f8314){return client[_0xb233('0xb')](_0xe466e3,_0x17d6e5)[_0xb233('0xc')](function(_0x415b49){logger[_0xb233('0xd')]('Trigger,\x20%s,\x20%s',_0xb3bda5,_0xb233('0xe'));logger['debug']('Trigger,\x20%s,\x20%s,\x20%s',_0xb3bda5,'request\x20sent',JSON[_0xb233('0xf')](_0x415b49));if(_0x415b49[_0xb233('0x10')]){if(_0x415b49['error'][_0xb233('0x11')]===0x1f4){logger['error'](_0xb233('0x12'),_0xb3bda5,_0x415b49[_0xb233('0x10')][_0xb233('0x13')]);return _0x3f8314(_0x415b49[_0xb233('0x10')][_0xb233('0x13')]);}logger[_0xb233('0x10')]('Trigger,\x20%s,\x20%s',_0xb3bda5,_0x415b49['error'][_0xb233('0x13')]);return _0x53ecf6(_0x415b49[_0xb233('0x10')][_0xb233('0x13')]);}else{logger[_0xb233('0xd')](_0xb233('0x12'),_0xb3bda5,_0xb233('0xe'));_0x53ecf6(_0x415b49[_0xb233('0x14')]['message']);}})[_0xb233('0x15')](function(_0x373ef2){logger[_0xb233('0x10')](_0xb233('0x12'),_0xb3bda5,_0x373ef2);_0x3f8314(_0x373ef2);});});}exports[_0xb233('0x16')]=function(_0x58b4b5){var _0x7cae04=this;return new Promise(function(_0x5aeea8,_0x1f625f){return db[_0xb233('0x17')][_0xb233('0x18')]({'raw':_0x58b4b5[_0xb233('0x19')]?_0x58b4b5['options']['raw']===undefined?!![]:![]:!![],'where':_0x58b4b5[_0xb233('0x19')]?_0x58b4b5[_0xb233('0x19')][_0xb233('0x1a')]||null:null,'attributes':_0x58b4b5[_0xb233('0x19')]?_0x58b4b5['options']['attributes']||null:null,'limit':_0x58b4b5[_0xb233('0x19')]?_0x58b4b5[_0xb233('0x19')]['limit']||null:null,'include':_0x58b4b5[_0xb233('0x19')]?_0x58b4b5[_0xb233('0x19')][_0xb233('0x1b')]?_[_0xb233('0x1c')](_0x58b4b5[_0xb233('0x19')][_0xb233('0x1b')],function(_0x183571){return{'model':db[_0x183571[_0xb233('0x1d')]],'as':_0x183571['as'],'attributes':_0x183571[_0xb233('0x1e')],'include':_0x183571['include']?_[_0xb233('0x1c')](_0x183571[_0xb233('0x1b')],function(_0x20f457){return{'model':db[_0x20f457[_0xb233('0x1d')]],'as':_0x20f457['as'],'attributes':_0x20f457[_0xb233('0x1e')],'include':_0x20f457['include']?_[_0xb233('0x1c')](_0x20f457['include'],function(_0x433863){return{'model':db[_0x433863[_0xb233('0x1d')]],'as':_0x433863['as'],'attributes':_0x433863['attributes']};}):[]};}):[]};}):[]:[]})[_0xb233('0xc')](function(_0x1f2804){logger[_0xb233('0xd')]('GetTrigger',_0x58b4b5);logger['debug'](_0xb233('0x16'),_0x58b4b5,JSON['stringify'](_0x1f2804));_0x5aeea8(_0x1f2804);})[_0xb233('0x15')](function(_0x2ea11b){logger[_0xb233('0x10')]('GetTrigger',_0x2ea11b[_0xb233('0x13')],_0x58b4b5);_0x1f625f(_0x7cae04['error'](0x1f4,_0x2ea11b[_0xb233('0x13')]));});});};exports[_0xb233('0x1f')]=function(_0x230ec6){var _0x5b6609=this;return new Promise(function(_0x16c34f,_0x2e37d8){return db[_0xb233('0x17')]['find']({'raw':_0x230ec6['options']?_0x230ec6[_0xb233('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x230ec6[_0xb233('0x19')]?_0x230ec6['options']['where']||null:null,'attributes':_0x230ec6[_0xb233('0x19')]?_0x230ec6[_0xb233('0x19')][_0xb233('0x1e')]||null:null,'include':_0x230ec6['options']?_0x230ec6[_0xb233('0x19')][_0xb233('0x1b')]?_[_0xb233('0x1c')](_0x230ec6[_0xb233('0x19')]['include'],function(_0xb605cd){return{'model':db[_0xb605cd['model']],'as':_0xb605cd['as'],'attributes':_0xb605cd[_0xb233('0x1e')],'include':_0xb605cd[_0xb233('0x1b')]?_['map'](_0xb605cd[_0xb233('0x1b')],function(_0x177c07){return{'model':db[_0x177c07[_0xb233('0x1d')]],'as':_0x177c07['as'],'attributes':_0x177c07['attributes'],'include':_0x177c07[_0xb233('0x1b')]?_[_0xb233('0x1c')](_0x177c07[_0xb233('0x1b')],function(_0x5381c4){return{'model':db[_0x5381c4[_0xb233('0x1d')]],'as':_0x5381c4['as'],'attributes':_0x5381c4[_0xb233('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xb233('0xc')](function(_0x478275){logger[_0xb233('0xd')](_0xb233('0x1f'),_0x230ec6);logger['debug'](_0xb233('0x1f'),_0x230ec6,JSON[_0xb233('0xf')](_0x478275));_0x16c34f(_0x478275);})[_0xb233('0x15')](function(_0x2a2b63){logger[_0xb233('0x10')](_0xb233('0x1f'),_0x2a2b63['message'],_0x230ec6);_0x2e37d8(_0x5b6609['error'](0x1f4,_0x2a2b63[_0xb233('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/trunk/index.js b/server/api/trunk/index.js index e8ac8aa..aa0a9c1 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 _0xe926=['show','/:id/clone','clone','post','create','put','update','delete','/:id','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./trunk.controller','isAuthenticated','index','get'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0xe926,0x83));var _0x6e92=function(_0x18d5d7,_0x19074b){_0x18d5d7=_0x18d5d7-0x0;var _0x30a9ea=_0xe926[_0x18d5d7];return _0x30a9ea;};'use strict';var multer=require(_0x6e92('0x0'));var util=require(_0x6e92('0x1'));var path=require(_0x6e92('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e92('0x3'));var router=express[_0x6e92('0x4')]();var fs_extra=require(_0x6e92('0x5'));var auth=require(_0x6e92('0x6'));var interaction=require(_0x6e92('0x7'));var config=require(_0x6e92('0x8'));var controller=require(_0x6e92('0x9'));router['get']('/',auth[_0x6e92('0xa')](),controller[_0x6e92('0xb')]);router[_0x6e92('0xc')]('/:id',auth['isAuthenticated'](),controller[_0x6e92('0xd')]);router['post'](_0x6e92('0xe'),auth['isAuthenticated'](),controller[_0x6e92('0xf')]);router[_0x6e92('0x10')]('/',auth[_0x6e92('0xa')](),controller[_0x6e92('0x11')]);router[_0x6e92('0x12')]('/:id',auth[_0x6e92('0xa')](),controller[_0x6e92('0x13')]);router[_0x6e92('0x14')](_0x6e92('0x15'),auth['isAuthenticated'](),controller[_0x6e92('0x16')]);module[_0x6e92('0x17')]=router; \ No newline at end of file +var _0x32ce=['multer','util','path','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','/:id/clone','put','update','delete','destroy'];(function(_0x50837b,_0x413961){var _0x2b1257=function(_0x5da7a5){while(--_0x5da7a5){_0x50837b['push'](_0x50837b['shift']());}};_0x2b1257(++_0x413961);}(_0x32ce,0x176));var _0xe32c=function(_0x5606f2,_0x4751e3){_0x5606f2=_0x5606f2-0x0;var _0x1c8cdc=_0x32ce[_0x5606f2];return _0x1c8cdc;};'use strict';var multer=require(_0xe32c('0x0'));var util=require(_0xe32c('0x1'));var path=require(_0xe32c('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xe32c('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xe32c('0x4'));var config=require(_0xe32c('0x5'));var controller=require('./trunk.controller');router[_0xe32c('0x6')]('/',auth[_0xe32c('0x7')](),controller[_0xe32c('0x8')]);router[_0xe32c('0x6')](_0xe32c('0x9'),auth[_0xe32c('0x7')](),controller[_0xe32c('0xa')]);router[_0xe32c('0xb')](_0xe32c('0xc'),auth['isAuthenticated'](),controller['clone']);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xe32c('0xd')](_0xe32c('0x9'),auth[_0xe32c('0x7')](),controller[_0xe32c('0xe')]);router[_0xe32c('0xf')](_0xe32c('0x9'),auth[_0xe32c('0x7')](),controller[_0xe32c('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/trunk/trunk.attributes.js b/server/api/trunk/trunk.attributes.js index bf5c8cd..736840c 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 _0xca4e=['INTEGER','accept','refuse','originate','uac','uas','pai','certificate','passive','actpass','dynamic','update','update,nonat','sequelize','exports','name','ENUM','friend','user','peer','STRING','from-voip-provider','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_PASSED_SCREEN','PROHIB','setDataValue','transport','join','getDataValue','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','inband','nonat','outgoing','yes','nat','all','ulaw;alaw;gsm','allow','port,invite','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never'];(function(_0x2a00dd,_0x10da34){var _0x54613f=function(_0x457c2f){while(--_0x457c2f){_0x2a00dd['push'](_0x2a00dd['shift']());}};_0x54613f(++_0x10da34);}(_0xca4e,0x164));var _0xeca4=function(_0x47470e,_0x578388){_0x47470e=_0x47470e-0x0;var _0x4b695d=_0xca4e[_0x47470e];return _0x4b695d;};'use strict';var Sequelize=require(_0xeca4('0x0'));module[_0xeca4('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xeca4('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0xeca4('0x3')](_0xeca4('0x4'),_0xeca4('0x5'),_0xeca4('0x6')),'allowNull':![],'defaultValue':_0xeca4('0x4')},'context':{'type':Sequelize[_0xeca4('0x7')],'allowNull':![],'defaultValue':_0xeca4('0x8')},'callingpres':{'type':Sequelize['ENUM'](_0xeca4('0x9'),_0xeca4('0xa'),_0xeca4('0xb'),_0xeca4('0xc'),'PROHIB_NOT_SCREENED',_0xeca4('0xd'),'PROHIB_FAILED_SCREEN',_0xeca4('0xe'))},'deny':{'type':Sequelize[_0xeca4('0x7')]},'permit':{'type':Sequelize['STRING']},'secret':{'type':Sequelize[_0xeca4('0x7')]},'md5secret':{'type':Sequelize['STRING']},'remotesecret':{'type':Sequelize[_0xeca4('0x7')]},'transport':{'type':Sequelize['STRING'],'defaultValue':'udp','set':function(_0x5d51ff){this[_0xeca4('0xf')](_0xeca4('0x10'),_0x5d51ff?_0x5d51ff[_0xeca4('0x11')](','):null);},'get':function(){return this[_0xeca4('0x12')](_0xeca4('0x10'))?this['getDataValue'](_0xeca4('0x10'))[_0xeca4('0x13')](','):null;},'comment':_0xeca4('0x14')},'dtmfmode':{'type':Sequelize[_0xeca4('0x3')](_0xeca4('0x15'),_0xeca4('0x16'),_0xeca4('0x17'),_0xeca4('0x18'),'auto'),'defaultValue':'rfc2833'},'directmedia':{'type':Sequelize[_0xeca4('0x3')]('yes','no',_0xeca4('0x19'),'update',_0xeca4('0x1a')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0xeca4('0x3')](_0xeca4('0x1b'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize['STRING']},'directmediadeny':{'type':Sequelize[_0xeca4('0x7')]},'nat':{'type':Sequelize[_0xeca4('0x7')],'defaultValue':'force_rport,comedia','set':function(_0x43699f){this['setDataValue']('nat',_0x43699f?_0x43699f['join'](','):null);},'get':function(){return this[_0xeca4('0x12')](_0xeca4('0x1c'))?this[_0xeca4('0x12')](_0xeca4('0x1c'))['split'](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]'},'callgroup':{'type':Sequelize[_0xeca4('0x7')]},'namedcallgroup':{'type':Sequelize['STRING']},'pickupgroup':{'type':Sequelize['STRING']},'namedpickupgroup':{'type':Sequelize[_0xeca4('0x7')]},'language':{'type':Sequelize[_0xeca4('0x7')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0xeca4('0x7')],'allowNull':!![]},'disallow':{'type':Sequelize['STRING'],'defaultValue':_0xeca4('0x1d')},'allow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'ulaw;alaw;gsm','set':function(_0x1399eb){this[_0xeca4('0xf')]('allow',_0x1399eb?_0x1399eb[_0xeca4('0x11')](';'):_0xeca4('0x1e'));},'get':function(){return this[_0xeca4('0x12')](_0xeca4('0x1f'))?this['getDataValue'](_0xeca4('0x1f'))[_0xeca4('0x13')](';'):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]'},'autoframing':{'type':Sequelize['ENUM'](_0xeca4('0x1b'),'no')},'insecure':{'type':Sequelize[_0xeca4('0x7')],'defaultValue':_0xeca4('0x20'),'set':function(_0xf34d12){this[_0xeca4('0xf')](_0xeca4('0x21'),_0xf34d12?_0xf34d12[_0xeca4('0x11')](','):null);},'get':function(){return this[_0xeca4('0x12')](_0xeca4('0x21'))?this[_0xeca4('0x12')](_0xeca4('0x21'))[_0xeca4('0x13')](','):null;},'comment':_0xeca4('0x22')},'trustrpid':{'type':Sequelize[_0xeca4('0x3')](_0xeca4('0x1b'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0xeca4('0x3')](_0xeca4('0x1b'),'no',_0xeca4('0x23'))},'promiscredir':{'type':Sequelize[_0xeca4('0x3')](_0xeca4('0x1b'),'no')},'useclientcode':{'type':Sequelize[_0xeca4('0x3')](_0xeca4('0x1b'),'no')},'accountcode':{'type':Sequelize[_0xeca4('0x24')](0xb)},'setvar':{'type':Sequelize[_0xeca4('0x7')]},'callerid':{'type':Sequelize[_0xeca4('0x7')],'defaultValue':'\x22\x22\x20<>'},'amaflags':{'type':Sequelize['STRING']},'callcounter':{'type':Sequelize[_0xeca4('0x3')](_0xeca4('0x1b'),'no'),'defaultValue':'yes'},'busylevel':{'type':Sequelize[_0xeca4('0x24')](0xb)},'allowoverlap':{'type':Sequelize[_0xeca4('0x3')]('yes','no')},'allowsubscribe':{'type':Sequelize['ENUM']('yes','no')},'allowtransfer':{'type':Sequelize[_0xeca4('0x3')](_0xeca4('0x1b'),'no')},'ignoresdpversion':{'type':Sequelize[_0xeca4('0x3')]('yes','no')},'subscribecontext':{'type':Sequelize['STRING']},'template':{'type':Sequelize[_0xeca4('0x7')]},'videosupport':{'type':Sequelize[_0xeca4('0x3')](_0xeca4('0x1b'),'no','always'),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0xeca4('0x24')](0xb)},'rfc2833compensate':{'type':Sequelize[_0xeca4('0x3')](_0xeca4('0x1b'),'no')},'mailbox':{'type':Sequelize['STRING']},'session_timers':{'type':Sequelize[_0xeca4('0x3')](_0xeca4('0x25'),_0xeca4('0x26'),_0xeca4('0x27'))},'session_expires':{'type':Sequelize[_0xeca4('0x24')](0xb)},'session_minse':{'type':Sequelize[_0xeca4('0x24')](0xb)},'session_refresher':{'type':Sequelize[_0xeca4('0x3')](_0xeca4('0x28'),'uas'),'defaultValue':_0xeca4('0x29')},'t38pt_usertpsource':{'type':Sequelize['STRING']},'regexten':{'type':Sequelize['STRING']},'fromdomain':{'type':Sequelize['STRING']},'fromuser':{'type':Sequelize[_0xeca4('0x7')]},'port':{'type':Sequelize[_0xeca4('0x24')](0x5)},'qualify':{'type':Sequelize[_0xeca4('0x3')](_0xeca4('0x1b'),'no'),'defaultValue':_0xeca4('0x1b')},'keepalive':{'type':Sequelize['INTEGER'](0xb)},'defaultip':{'type':Sequelize[_0xeca4('0x7')]},'defaultuser':{'type':Sequelize[_0xeca4('0x7')]},'rtptimeout':{'type':Sequelize[_0xeca4('0x24')](0xb)},'rtpholdtimeout':{'type':Sequelize['INTEGER'](0xb)},'rtpkeepalive':{'type':Sequelize['INTEGER'](0xb)},'sendrpid':{'type':Sequelize['ENUM']('yes','no',_0xeca4('0x2a')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0xeca4('0x7')]},'callbackextension':{'type':Sequelize[_0xeca4('0x7')]},'timert1':{'type':Sequelize[_0xeca4('0x24')](0xb)},'timerb':{'type':Sequelize[_0xeca4('0x24')](0xb)},'qualifyfreq':{'type':Sequelize[_0xeca4('0x24')](0xb)},'contactpermit':{'type':Sequelize['STRING']},'contactdeny':{'type':Sequelize['STRING']},'contactacl':{'type':Sequelize[_0xeca4('0x7')]},'unsolicited_mailbox':{'type':Sequelize['STRING']},'use_q850_reason':{'type':Sequelize[_0xeca4('0x7')]},'maxforwards':{'type':Sequelize[_0xeca4('0x24')](0xb)},'encryption':{'type':Sequelize['ENUM'](_0xeca4('0x1b'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize['ENUM'](_0xeca4('0x1b'),'no')},'force_avp':{'type':Sequelize['ENUM']('yes','no')},'icesupport':{'type':Sequelize[_0xeca4('0x3')](_0xeca4('0x1b'),'no')},'dtlsenable':{'type':Sequelize[_0xeca4('0x3')](_0xeca4('0x1b'),'no')},'dtlsverify':{'type':Sequelize[_0xeca4('0x3')](_0xeca4('0x1b'),'no','fingerprint',_0xeca4('0x2b'))},'dtlsrekey':{'type':Sequelize[_0xeca4('0x24')](0xb)},'dtlscertfile':{'type':Sequelize[_0xeca4('0x7')]},'dtlsprivatekey':{'type':Sequelize['STRING']},'dtlscipher':{'type':Sequelize['STRING']},'dtlscafile':{'type':Sequelize[_0xeca4('0x7')]},'dtlscapath':{'type':Sequelize['STRING']},'dtlssetup':{'type':Sequelize[_0xeca4('0x3')]('active',_0xeca4('0x2c'),_0xeca4('0x2d')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0xeca4('0x7')]},'usereqphone':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0xeca4('0x7')]},'recordofffeature':{'type':Sequelize[_0xeca4('0x7')]},'call_limit':{'type':Sequelize[_0xeca4('0x24')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize['ENUM']('yes','no')},'subscribemwi':{'type':Sequelize[_0xeca4('0x3')](_0xeca4('0x1b'),'no')},'vmexten':{'type':Sequelize[_0xeca4('0x7')]},'mohinterpret':{'type':Sequelize['STRING']},'mohsuggest':{'type':Sequelize['STRING']},'parkinglot':{'type':Sequelize[_0xeca4('0x7')]},'description':{'type':Sequelize[_0xeca4('0x7')]},'host':{'type':Sequelize[_0xeca4('0x7')],'defaultValue':_0xeca4('0x2e')},'canreinvite':{'type':Sequelize[_0xeca4('0x3')](_0xeca4('0x1b'),'no',_0xeca4('0x19'),_0xeca4('0x2f'),_0xeca4('0x30')),'defaultValue':'no'},'registry':{'type':Sequelize[_0xeca4('0x7')]},'otherFields':{'type':Sequelize[_0xeca4('0x7')]},'active':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0xeca4('0x7')],'defaultValue':'no'}}; \ No newline at end of file +var _0xbd89=['uas','fingerprint','certificate','active','passive','actpass','dynamic','update,nonat','sequelize','ENUM','friend','user','STRING','from-voip-provider','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','udp','setDataValue','join','getDataValue','transport','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','inband','auto','yes','nonat','update','outgoing','force_rport,comedia','nat','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]','insecure','never','INTEGER','always','accept','originate','uac'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xbd89,0xd4));var _0x9bd8=function(_0x7458a9,_0x3e4560){_0x7458a9=_0x7458a9-0x0;var _0x3d522a=_0xbd89[_0x7458a9];return _0x3d522a;};'use strict';var Sequelize=require(_0x9bd8('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x9bd8('0x1')](_0x9bd8('0x2'),_0x9bd8('0x3'),'peer'),'allowNull':![],'defaultValue':_0x9bd8('0x2')},'context':{'type':Sequelize[_0x9bd8('0x4')],'allowNull':![],'defaultValue':_0x9bd8('0x5')},'callingpres':{'type':Sequelize['ENUM'](_0x9bd8('0x6'),_0x9bd8('0x7'),_0x9bd8('0x8'),_0x9bd8('0x9'),_0x9bd8('0xa'),_0x9bd8('0xb'),_0x9bd8('0xc'),_0x9bd8('0xd'))},'deny':{'type':Sequelize[_0x9bd8('0x4')]},'permit':{'type':Sequelize[_0x9bd8('0x4')]},'secret':{'type':Sequelize[_0x9bd8('0x4')]},'md5secret':{'type':Sequelize['STRING']},'remotesecret':{'type':Sequelize['STRING']},'transport':{'type':Sequelize['STRING'],'defaultValue':_0x9bd8('0xe'),'set':function(_0x251c72){this[_0x9bd8('0xf')]('transport',_0x251c72?_0x251c72[_0x9bd8('0x10')](','):null);},'get':function(){return this[_0x9bd8('0x11')](_0x9bd8('0x12'))?this['getDataValue'](_0x9bd8('0x12'))['split'](','):null;},'comment':_0x9bd8('0x13')},'dtmfmode':{'type':Sequelize[_0x9bd8('0x1')](_0x9bd8('0x14'),_0x9bd8('0x15'),_0x9bd8('0x16'),_0x9bd8('0x17'),_0x9bd8('0x18')),'defaultValue':'rfc2833'},'directmedia':{'type':Sequelize[_0x9bd8('0x1')](_0x9bd8('0x19'),'no',_0x9bd8('0x1a'),_0x9bd8('0x1b'),_0x9bd8('0x1c')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x9bd8('0x1')](_0x9bd8('0x19'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x9bd8('0x4')]},'directmediadeny':{'type':Sequelize[_0x9bd8('0x4')]},'nat':{'type':Sequelize['STRING'],'defaultValue':_0x9bd8('0x1d'),'set':function(_0x3ddd1b){this['setDataValue'](_0x9bd8('0x1e'),_0x3ddd1b?_0x3ddd1b['join'](','):null);},'get':function(){return this[_0x9bd8('0x11')](_0x9bd8('0x1e'))?this['getDataValue']('nat')[_0x9bd8('0x1f')](','):null;},'comment':_0x9bd8('0x20')},'callgroup':{'type':Sequelize[_0x9bd8('0x4')]},'namedcallgroup':{'type':Sequelize[_0x9bd8('0x4')]},'pickupgroup':{'type':Sequelize[_0x9bd8('0x4')]},'namedpickupgroup':{'type':Sequelize[_0x9bd8('0x4')]},'language':{'type':Sequelize[_0x9bd8('0x4')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x9bd8('0x4')],'allowNull':!![]},'disallow':{'type':Sequelize['STRING'],'defaultValue':'all'},'allow':{'type':Sequelize[_0x9bd8('0x4')],'allowNull':![],'defaultValue':_0x9bd8('0x21'),'set':function(_0x3e14c1){this[_0x9bd8('0xf')](_0x9bd8('0x22'),_0x3e14c1?_0x3e14c1[_0x9bd8('0x10')](';'):_0x9bd8('0x21'));},'get':function(){return this[_0x9bd8('0x11')]('allow')?this[_0x9bd8('0x11')](_0x9bd8('0x22'))['split'](';'):null;},'comment':_0x9bd8('0x23')},'autoframing':{'type':Sequelize['ENUM'](_0x9bd8('0x19'),'no')},'insecure':{'type':Sequelize[_0x9bd8('0x4')],'defaultValue':'port,invite','set':function(_0x5110be){this[_0x9bd8('0xf')]('insecure',_0x5110be?_0x5110be['join'](','):null);},'get':function(){return this[_0x9bd8('0x11')](_0x9bd8('0x24'))?this[_0x9bd8('0x11')](_0x9bd8('0x24'))[_0x9bd8('0x1f')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]'},'trustrpid':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x9bd8('0x1')](_0x9bd8('0x19'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize['ENUM'](_0x9bd8('0x19'),'no',_0x9bd8('0x25'))},'promiscredir':{'type':Sequelize[_0x9bd8('0x1')]('yes','no')},'useclientcode':{'type':Sequelize[_0x9bd8('0x1')](_0x9bd8('0x19'),'no')},'accountcode':{'type':Sequelize[_0x9bd8('0x26')](0xb)},'setvar':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0x9bd8('0x4')],'defaultValue':'\x22\x22\x20<>'},'amaflags':{'type':Sequelize[_0x9bd8('0x4')]},'callcounter':{'type':Sequelize['ENUM'](_0x9bd8('0x19'),'no'),'defaultValue':_0x9bd8('0x19')},'busylevel':{'type':Sequelize[_0x9bd8('0x26')](0xb)},'allowoverlap':{'type':Sequelize[_0x9bd8('0x1')](_0x9bd8('0x19'),'no')},'allowsubscribe':{'type':Sequelize[_0x9bd8('0x1')](_0x9bd8('0x19'),'no')},'allowtransfer':{'type':Sequelize['ENUM'](_0x9bd8('0x19'),'no')},'ignoresdpversion':{'type':Sequelize['ENUM'](_0x9bd8('0x19'),'no')},'subscribecontext':{'type':Sequelize[_0x9bd8('0x4')]},'template':{'type':Sequelize[_0x9bd8('0x4')]},'videosupport':{'type':Sequelize[_0x9bd8('0x1')](_0x9bd8('0x19'),'no',_0x9bd8('0x27')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x9bd8('0x26')](0xb)},'rfc2833compensate':{'type':Sequelize[_0x9bd8('0x1')](_0x9bd8('0x19'),'no')},'mailbox':{'type':Sequelize[_0x9bd8('0x4')]},'session_timers':{'type':Sequelize['ENUM'](_0x9bd8('0x28'),'refuse',_0x9bd8('0x29'))},'session_expires':{'type':Sequelize[_0x9bd8('0x26')](0xb)},'session_minse':{'type':Sequelize['INTEGER'](0xb)},'session_refresher':{'type':Sequelize[_0x9bd8('0x1')](_0x9bd8('0x2a'),_0x9bd8('0x2b')),'defaultValue':'uas'},'t38pt_usertpsource':{'type':Sequelize['STRING']},'regexten':{'type':Sequelize[_0x9bd8('0x4')]},'fromdomain':{'type':Sequelize[_0x9bd8('0x4')]},'fromuser':{'type':Sequelize[_0x9bd8('0x4')]},'port':{'type':Sequelize[_0x9bd8('0x26')](0x5)},'qualify':{'type':Sequelize[_0x9bd8('0x1')]('yes','no'),'defaultValue':'yes'},'keepalive':{'type':Sequelize[_0x9bd8('0x26')](0xb)},'defaultip':{'type':Sequelize[_0x9bd8('0x4')]},'defaultuser':{'type':Sequelize[_0x9bd8('0x4')]},'rtptimeout':{'type':Sequelize[_0x9bd8('0x26')](0xb)},'rtpholdtimeout':{'type':Sequelize[_0x9bd8('0x26')](0xb)},'rtpkeepalive':{'type':Sequelize['INTEGER'](0xb)},'sendrpid':{'type':Sequelize[_0x9bd8('0x1')]('yes','no','pai'),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x9bd8('0x4')]},'callbackextension':{'type':Sequelize[_0x9bd8('0x4')]},'timert1':{'type':Sequelize[_0x9bd8('0x26')](0xb)},'timerb':{'type':Sequelize[_0x9bd8('0x26')](0xb)},'qualifyfreq':{'type':Sequelize[_0x9bd8('0x26')](0xb)},'contactpermit':{'type':Sequelize[_0x9bd8('0x4')]},'contactdeny':{'type':Sequelize['STRING']},'contactacl':{'type':Sequelize[_0x9bd8('0x4')]},'unsolicited_mailbox':{'type':Sequelize['STRING']},'use_q850_reason':{'type':Sequelize[_0x9bd8('0x4')]},'maxforwards':{'type':Sequelize['INTEGER'](0xb)},'encryption':{'type':Sequelize[_0x9bd8('0x1')](_0x9bd8('0x19'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0x9bd8('0x1')]('yes','no')},'force_avp':{'type':Sequelize[_0x9bd8('0x1')](_0x9bd8('0x19'),'no')},'icesupport':{'type':Sequelize[_0x9bd8('0x1')](_0x9bd8('0x19'),'no')},'dtlsenable':{'type':Sequelize[_0x9bd8('0x1')](_0x9bd8('0x19'),'no')},'dtlsverify':{'type':Sequelize[_0x9bd8('0x1')](_0x9bd8('0x19'),'no',_0x9bd8('0x2c'),_0x9bd8('0x2d'))},'dtlsrekey':{'type':Sequelize[_0x9bd8('0x26')](0xb)},'dtlscertfile':{'type':Sequelize[_0x9bd8('0x4')]},'dtlsprivatekey':{'type':Sequelize['STRING']},'dtlscipher':{'type':Sequelize[_0x9bd8('0x4')]},'dtlscafile':{'type':Sequelize[_0x9bd8('0x4')]},'dtlscapath':{'type':Sequelize[_0x9bd8('0x4')]},'dtlssetup':{'type':Sequelize[_0x9bd8('0x1')](_0x9bd8('0x2e'),_0x9bd8('0x2f'),_0x9bd8('0x30')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x9bd8('0x4')]},'usereqphone':{'type':Sequelize['ENUM'](_0x9bd8('0x19'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x9bd8('0x4')]},'recordofffeature':{'type':Sequelize['STRING']},'call_limit':{'type':Sequelize[_0x9bd8('0x26')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0x9bd8('0x1')]('yes','no')},'subscribemwi':{'type':Sequelize[_0x9bd8('0x1')](_0x9bd8('0x19'),'no')},'vmexten':{'type':Sequelize[_0x9bd8('0x4')]},'mohinterpret':{'type':Sequelize[_0x9bd8('0x4')]},'mohsuggest':{'type':Sequelize[_0x9bd8('0x4')]},'parkinglot':{'type':Sequelize[_0x9bd8('0x4')]},'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize['STRING'],'defaultValue':_0x9bd8('0x31')},'canreinvite':{'type':Sequelize[_0x9bd8('0x1')](_0x9bd8('0x19'),'no',_0x9bd8('0x1a'),_0x9bd8('0x1b'),_0x9bd8('0x32')),'defaultValue':'no'},'registry':{'type':Sequelize[_0x9bd8('0x4')]},'otherFields':{'type':Sequelize['STRING']},'active':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0x9bd8('0x4')],'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 5f0bc33..4515586 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(_0x4cbdc4,_0x8be7a8){var _0x413c70=function(_0x9da4a5){while(--_0x9da4a5){_0x4cbdc4['push'](_0x4cbdc4['shift']());}};_0x413c70(++_0x8be7a8);}(_0x9f62,0x154));var _0x29f6=function(_0x2091b4,_0x4f0d7c){_0x2091b4=_0x2091b4-0x0;var _0x5835b5=_0x9f62[_0x2091b4];return _0x5835b5;};'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 _0x4b84=['omit','createdAt','updatedAt','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','create','readFileSync','join','server/files/templates/trunk.ejs','utf8','root','server/files/templates/registry.ejs','render','writeFileSync','/etc/asterisk/sip_xcally_trunks.conf','registry','/etc/asterisk/sip_xcally_registers.conf','Reload','chan_sip.so','role','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','request-promise','mustache','util','path','fs-extra','squel','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','http','request','then','info','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','code','message','Trunk,\x20%s,\x20%s','request\x20sent','result','sendStatus','end','status','undefined','limit','count','offset','set','Content-Range','json','apply','reject','save','update','destroy','Trunks','UserProfileResource','stack','name','send','index','Trunk','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','nolimit','sort','where','pick','filter','merge','map','VIRTUAL','options','include','findAll','rows','catch','show','params','length','find','includeAll','get'];(function(_0x36eaaa,_0x326732){var _0x461349=function(_0x4e4180){while(--_0x4e4180){_0x36eaaa['push'](_0x36eaaa['shift']());}};_0x461349(++_0x326732);}(_0x4b84,0x1cc));var _0x44b8=function(_0x297eea,_0x5060be){_0x297eea=_0x297eea-0x0;var _0x1c42d2=_0x4b84[_0x297eea];return _0x1c42d2;};'use strict';var emlformat=require(_0x44b8('0x0'));var rimraf=require(_0x44b8('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x44b8('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x44b8('0x3'));var util=require(_0x44b8('0x4'));var path=require(_0x44b8('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x44b8('0x6'));var _=require('lodash');var squel=require(_0x44b8('0x7'));var crypto=require('crypto');var jsforce=require(_0x44b8('0x8'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x44b8('0x9'));var Papa=require(_0x44b8('0xa'));var Redis=require(_0x44b8('0xb'));var authService=require('../../components/auth/service');var qs=require(_0x44b8('0xc'));var as=require(_0x44b8('0xd'));var hardwareService=require(_0x44b8('0xe'));var logger=require(_0x44b8('0xf'))(_0x44b8('0x10'));var utils=require(_0x44b8('0x11'));var config=require(_0x44b8('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0x44b8('0x13'))['db'];var jayson=require(_0x44b8('0x14'));var client=jayson['client'][_0x44b8('0x15')]({'port':0x232a});function respondWithRpcPromise(_0x490bc6,_0x833ea3,_0x18d642,_0x4df670){return new BPromise(function(_0x63e8f6,_0x4be54c){var _0x54fa95=_0x4df670||client;return _0x54fa95[_0x44b8('0x16')](_0x490bc6,_0x18d642)[_0x44b8('0x17')](function(_0x1722da){logger[_0x44b8('0x18')]('Trunk,\x20%s,\x20%s',_0x833ea3,'request\x20sent');logger['debug'](_0x44b8('0x19'),_0x833ea3,'request\x20sent',JSON[_0x44b8('0x1a')](_0x1722da));if(_0x1722da[_0x44b8('0x1b')]){if(_0x1722da['error'][_0x44b8('0x1c')]===0x1f4){logger[_0x44b8('0x1b')]('Trunk,\x20%s,\x20%s',_0x833ea3,_0x1722da[_0x44b8('0x1b')][_0x44b8('0x1d')]);return _0x4be54c(_0x1722da['error'][_0x44b8('0x1d')]);}logger[_0x44b8('0x1b')](_0x44b8('0x1e'),_0x833ea3,_0x1722da[_0x44b8('0x1b')][_0x44b8('0x1d')]);return _0x63e8f6(_0x1722da[_0x44b8('0x1b')][_0x44b8('0x1d')]);}else{logger[_0x44b8('0x18')](_0x44b8('0x1e'),_0x833ea3,_0x44b8('0x1f'));_0x63e8f6(_0x1722da[_0x44b8('0x20')][_0x44b8('0x1d')]);}})['catch'](function(_0x56549a){logger[_0x44b8('0x1b')](_0x44b8('0x1e'),_0x833ea3,_0x56549a);_0x4be54c(_0x56549a);});});}function respondWithStatusCode(_0x1418db,_0x305a5c){_0x305a5c=_0x305a5c||0xcc;return function(_0x51a34a){if(_0x51a34a){return _0x1418db[_0x44b8('0x21')](_0x305a5c);}return _0x1418db['status'](_0x305a5c)[_0x44b8('0x22')]();};}function respondWithResult(_0x228c81,_0x25a0c1){_0x25a0c1=_0x25a0c1||0xc8;return function(_0x47689e){if(_0x47689e){return _0x228c81[_0x44b8('0x23')](_0x25a0c1)['json'](_0x47689e);}};}function respondWithFilteredResult(_0x474f01,_0x502acf){return function(_0x41d673){if(_0x41d673){var _0x350482=typeof _0x502acf['offset']===_0x44b8('0x24')&&typeof _0x502acf[_0x44b8('0x25')]===_0x44b8('0x24');var _0x59c1bf=_0x41d673[_0x44b8('0x26')];var _0x242342=_0x350482?0x0:_0x502acf['offset'];var _0x2e0174=_0x350482?_0x41d673['count']:_0x502acf[_0x44b8('0x27')]+_0x502acf['limit'];var _0x559f0b;if(_0x2e0174>=_0x59c1bf){_0x2e0174=_0x59c1bf;_0x559f0b=0xc8;}else{_0x559f0b=0xce;}_0x474f01['status'](_0x559f0b);return _0x474f01[_0x44b8('0x28')](_0x44b8('0x29'),_0x242342+'-'+_0x2e0174+'/'+_0x59c1bf)[_0x44b8('0x2a')](_0x41d673);}return null;};}function patchUpdates(_0x1bd1be){return function(_0x38cd17){try{jsonpatch[_0x44b8('0x2b')](_0x38cd17,_0x1bd1be,!![]);}catch(_0x2cf205){return BPromise[_0x44b8('0x2c')](_0x2cf205);}return _0x38cd17[_0x44b8('0x2d')]();};}function saveUpdates(_0x28f918,_0x5e1129){return function(_0x417d81){if(_0x417d81){return _0x417d81[_0x44b8('0x2e')](_0x28f918)['then'](function(_0x261ff2){return _0x261ff2;});}return null;};}function removeEntity(_0x538db7,_0x212983){return function(_0x1652cb){if(_0x1652cb){return _0x1652cb[_0x44b8('0x2f')]()[_0x44b8('0x17')](function(){var _0x1b63a7=_0x1652cb['get']({'plain':!![]});var _0x16b706=_0x44b8('0x30');return db[_0x44b8('0x31')][_0x44b8('0x2f')]({'where':{'type':_0x16b706,'resourceId':_0x1b63a7['id']}})[_0x44b8('0x17')](function(){return _0x1652cb;});})['then'](function(){_0x538db7[_0x44b8('0x23')](0xcc)[_0x44b8('0x22')]();});}};}function handleEntityNotFound(_0x1a30fc,_0x3e93af){return function(_0x140a79){if(!_0x140a79){_0x1a30fc[_0x44b8('0x21')](0x194);}return _0x140a79;};}function handleError(_0x2e8b88,_0x14a9d7){_0x14a9d7=_0x14a9d7||0x1f4;return function(_0x28c10d){logger[_0x44b8('0x1b')](_0x28c10d[_0x44b8('0x32')]);if(_0x28c10d[_0x44b8('0x33')]){delete _0x28c10d[_0x44b8('0x33')];}_0x2e8b88[_0x44b8('0x23')](_0x14a9d7)[_0x44b8('0x34')](_0x28c10d);};}exports[_0x44b8('0x35')]=function(_0x323c50,_0xeff999){var _0x28faa9={},_0x3984f8={},_0x2c02d6={'count':0x0,'rows':[]};var _0x282345=_['map'](db[_0x44b8('0x36')][_0x44b8('0x37')],function(_0x4fcfa0){return{'name':_0x4fcfa0[_0x44b8('0x38')],'type':_0x4fcfa0[_0x44b8('0x39')][_0x44b8('0x3a')]};});_0x3984f8[_0x44b8('0x3b')]=_['map'](_0x282345,_0x44b8('0x33'));_0x3984f8[_0x44b8('0x3c')]=_[_0x44b8('0x3d')](_0x323c50[_0x44b8('0x3c')]);_0x3984f8[_0x44b8('0x3e')]=_[_0x44b8('0x3f')](_0x3984f8[_0x44b8('0x3b')],_0x3984f8[_0x44b8('0x3c')]);_0x28faa9[_0x44b8('0x40')]=_[_0x44b8('0x3f')](_0x3984f8[_0x44b8('0x3b')],qs[_0x44b8('0x41')](_0x323c50[_0x44b8('0x3c')][_0x44b8('0x41')]));_0x28faa9[_0x44b8('0x40')]=_0x28faa9[_0x44b8('0x40')]['length']?_0x28faa9[_0x44b8('0x40')]:_0x3984f8[_0x44b8('0x3b')];if(!_0x323c50[_0x44b8('0x3c')]['hasOwnProperty'](_0x44b8('0x42'))){_0x28faa9[_0x44b8('0x25')]=qs[_0x44b8('0x25')](_0x323c50['query'][_0x44b8('0x25')]);_0x28faa9[_0x44b8('0x27')]=qs[_0x44b8('0x27')](_0x323c50[_0x44b8('0x3c')][_0x44b8('0x27')]);}_0x28faa9['order']=qs['sort'](_0x323c50[_0x44b8('0x3c')][_0x44b8('0x43')]);_0x28faa9[_0x44b8('0x44')]=qs[_0x44b8('0x3e')](_[_0x44b8('0x45')](_0x323c50[_0x44b8('0x3c')],_0x3984f8[_0x44b8('0x3e')]),_0x282345);if(_0x323c50[_0x44b8('0x3c')][_0x44b8('0x46')]){_0x28faa9[_0x44b8('0x44')]=_[_0x44b8('0x47')](_0x28faa9[_0x44b8('0x44')],{'$or':_[_0x44b8('0x48')](_0x282345,function(_0x1236c7){if(_0x1236c7[_0x44b8('0x39')]!==_0x44b8('0x49')){var _0xce06dc={};_0xce06dc[_0x1236c7[_0x44b8('0x33')]]={'$like':'%'+_0x323c50[_0x44b8('0x3c')]['filter']+'%'};return _0xce06dc;}})});}_0x28faa9=_['merge']({},_0x28faa9,_0x323c50[_0x44b8('0x4a')]);var _0x1df74b={'where':_0x28faa9[_0x44b8('0x44')]};return db[_0x44b8('0x36')][_0x44b8('0x26')](_0x1df74b)[_0x44b8('0x17')](function(_0x411ed6){_0x2c02d6['count']=_0x411ed6;if(_0x323c50[_0x44b8('0x3c')]['includeAll']){_0x28faa9[_0x44b8('0x4b')]=[{'all':!![]}];}return db[_0x44b8('0x36')][_0x44b8('0x4c')](_0x28faa9);})[_0x44b8('0x17')](function(_0x103d57){_0x2c02d6[_0x44b8('0x4d')]=_0x103d57;return _0x2c02d6;})['then'](respondWithFilteredResult(_0xeff999,_0x28faa9))[_0x44b8('0x4e')](handleError(_0xeff999,null));};exports[_0x44b8('0x4f')]=function(_0x10602c,_0x25d266){var _0x4ccc77={'raw':![],'where':{'id':_0x10602c[_0x44b8('0x50')]['id']}},_0x4e4ed1={};_0x4e4ed1[_0x44b8('0x3b')]=_[_0x44b8('0x3d')](db[_0x44b8('0x36')][_0x44b8('0x37')]);_0x4e4ed1['query']=_[_0x44b8('0x3d')](_0x10602c[_0x44b8('0x3c')]);_0x4e4ed1[_0x44b8('0x3e')]=_[_0x44b8('0x3f')](_0x4e4ed1[_0x44b8('0x3b')],_0x4e4ed1['query']);_0x4ccc77['attributes']=_[_0x44b8('0x3f')](_0x4e4ed1['model'],qs[_0x44b8('0x41')](_0x10602c['query'][_0x44b8('0x41')]));_0x4ccc77[_0x44b8('0x40')]=_0x4ccc77[_0x44b8('0x40')][_0x44b8('0x51')]?_0x4ccc77[_0x44b8('0x40')]:_0x4e4ed1[_0x44b8('0x3b')];if(_0x10602c[_0x44b8('0x3c')]['includeAll']){_0x4ccc77[_0x44b8('0x4b')]=[{'all':!![]}];}_0x4ccc77=_[_0x44b8('0x47')]({},_0x4ccc77,_0x10602c[_0x44b8('0x4a')]);return db['Trunk'][_0x44b8('0x52')](_0x4ccc77)[_0x44b8('0x17')](handleEntityNotFound(_0x25d266,null))[_0x44b8('0x17')](respondWithResult(_0x25d266,null))[_0x44b8('0x4e')](handleError(_0x25d266,null));};exports['clone']=function(_0x399d6b,_0x308f7b){var _0x4a6e55={'where':{'id':_0x399d6b[_0x44b8('0x50')]['id']}},_0x3de425={};_0x3de425[_0x44b8('0x3b')]=_[_0x44b8('0x3d')](db[_0x44b8('0x36')]['rawAttributes']);_0x4a6e55['attributes']=_[_0x44b8('0x3f')](_0x3de425[_0x44b8('0x3b')],qs[_0x44b8('0x41')](_0x399d6b[_0x44b8('0x3c')][_0x44b8('0x41')]));_0x4a6e55[_0x44b8('0x40')]=_0x4a6e55[_0x44b8('0x40')][_0x44b8('0x51')]?_0x4a6e55[_0x44b8('0x40')]:_0x3de425[_0x44b8('0x3b')];if(_0x399d6b[_0x44b8('0x3c')][_0x44b8('0x53')]){_0x4a6e55['include']=[{'all':!![]}];}_0x4a6e55=_[_0x44b8('0x47')]({},_0x4a6e55,_0x399d6b[_0x44b8('0x4a')]);return db[_0x44b8('0x36')][_0x44b8('0x52')](_0x4a6e55)[_0x44b8('0x17')](handleEntityNotFound(_0x308f7b,null))[_0x44b8('0x17')](function(_0x426a6a){if(_0x426a6a){var _0x172ff3=_0x426a6a[_0x44b8('0x54')]({'plain':!![]});_0x172ff3=qs[_0x44b8('0x55')](_0x172ff3,['id',_0x44b8('0x56'),_0x44b8('0x57')]);_0x399d6b[_0x44b8('0x58')]=_[_0x44b8('0x55')](_0x399d6b[_0x44b8('0x58')],['id',_0x44b8('0x56'),_0x44b8('0x57')]);return db[_0x44b8('0x36')]['create'](_[_0x44b8('0x47')](_0x172ff3,_0x399d6b[_0x44b8('0x58')]),{'include':_0x399d6b[_0x44b8('0x3c')][_0x44b8('0x53')]?[{'all':!![]}]:undefined})[_0x44b8('0x17')](function(_0x29ed5d){var _0x2ecf65=_0x399d6b['user'][_0x44b8('0x54')]({'plain':!![]});if(!_0x2ecf65)throw new Error(_0x44b8('0x59'));if(_0x2ecf65['role']===_0x44b8('0x5a')){var _0x3354bd=_0x29ed5d['get']({'plain':!![]});var _0x37e42e=_0x44b8('0x30');return db[_0x44b8('0x5b')]['find']({'where':{'name':_0x37e42e,'userProfileId':_0x2ecf65[_0x44b8('0x5c')]},'raw':!![]})['then'](function(_0x36cdd8){if(_0x36cdd8&&_0x36cdd8['autoAssociation']===0x0){return db[_0x44b8('0x31')][_0x44b8('0x5d')]({'name':_0x3354bd[_0x44b8('0x33')],'resourceId':_0x3354bd['id'],'type':_0x36cdd8[_0x44b8('0x33')],'sectionId':_0x36cdd8['id']},{})[_0x44b8('0x17')](function(){return _0x29ed5d;});}else{return _0x29ed5d;}})[_0x44b8('0x4e')](function(_0x4c7edd){logger[_0x44b8('0x1b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4c7edd);throw _0x4c7edd;});}return _0x29ed5d;});}})[_0x44b8('0x17')](respondWithResult(_0x308f7b,0xc9))[_0x44b8('0x4e')](handleError(_0x308f7b,null));};exports['create']=function(_0x3f9438,_0x1ee26b,_0x1cf31f){var _0x30d60f;return db[_0x44b8('0x36')][_0x44b8('0x5d')](_0x3f9438[_0x44b8('0x58')],{'raw':!![]})[_0x44b8('0x17')](function(_0x3f9102){_0x30d60f=_0x3f9102;return db[_0x44b8('0x36')][_0x44b8('0x4c')]({'raw':!![]});})[_0x44b8('0x17')](function(_0x52381a){var _0xd20d0=fs[_0x44b8('0x5e')](path[_0x44b8('0x5f')](config['root'],_0x44b8('0x60')),_0x44b8('0x61'));var _0x5bff09=fs[_0x44b8('0x5e')](path[_0x44b8('0x5f')](config[_0x44b8('0x62')],_0x44b8('0x63')),_0x44b8('0x61'));var _0x59060b=ejs[_0x44b8('0x64')](_0xd20d0,{'trunks':_0x52381a||[]});fs[_0x44b8('0x65')](_0x44b8('0x66'),_0x59060b);if(_0x30d60f[_0x44b8('0x67')]){var _0x2e02d7=ejs[_0x44b8('0x64')](_0x5bff09,{'trunks':_0x52381a||[]});fs[_0x44b8('0x65')](_0x44b8('0x68'),_0x2e02d7);}})['then'](function(){return respondWithRpcPromise(_0x44b8('0x69'),_0x44b8('0x5d'),{'module':_0x44b8('0x6a')});})[_0x44b8('0x17')](function(){var _0x5b26e8=_0x3f9438['user']['get']({'plain':!![]});if(!_0x5b26e8)throw new Error(_0x44b8('0x59'));if(_0x5b26e8[_0x44b8('0x6b')]===_0x44b8('0x5a')){var _0x46e20f=_0x30d60f[_0x44b8('0x54')]({'plain':!![]});return db['UserProfileSection'][_0x44b8('0x52')]({'where':{'name':'Trunks','userProfileId':_0x5b26e8[_0x44b8('0x5c')]},'raw':!![]})[_0x44b8('0x17')](function(_0xea2c3e){if(_0xea2c3e&&_0xea2c3e['autoAssociation']===0x0){return db['UserProfileResource'][_0x44b8('0x5d')]({'name':_0x46e20f[_0x44b8('0x33')],'resourceId':_0x46e20f['id'],'type':_0xea2c3e[_0x44b8('0x33')],'sectionId':_0xea2c3e['id']},{})['then'](function(){return _0x30d60f;});}else{return _0x30d60f;}})[_0x44b8('0x4e')](function(_0x36f217){logger[_0x44b8('0x1b')](_0x44b8('0x6c'),_0x36f217);throw _0x36f217;});}return _0x30d60f;})[_0x44b8('0x17')](respondWithResult(_0x1ee26b,0xc9))['catch'](handleError(_0x1ee26b,null));};exports[_0x44b8('0x2e')]=function(_0x1888f8,_0xbbdab9,_0x2a8ccc){var _0x220f1b;return db['Trunk'][_0x44b8('0x52')]({'where':{'id':_0x1888f8[_0x44b8('0x50')]['id']}})[_0x44b8('0x17')](handleEntityNotFound(_0xbbdab9,null))[_0x44b8('0x17')](saveUpdates(_0x1888f8[_0x44b8('0x58')],null))[_0x44b8('0x17')](function(_0x1c7ef2){if(_0x1c7ef2){_0x220f1b=_0x1c7ef2;return db['Trunk'][_0x44b8('0x4c')]({'raw':!![]});}})[_0x44b8('0x17')](function(_0x4c3fea){if(_0x4c3fea){var _0x3bb7d8=fs[_0x44b8('0x5e')](path['join'](config[_0x44b8('0x62')],'server/files/templates/trunk.ejs'),'utf8');var _0x31d3b6=fs[_0x44b8('0x5e')](path[_0x44b8('0x5f')](config['root'],'server/files/templates/registry.ejs'),'utf8');var _0x36334a=ejs[_0x44b8('0x64')](_0x3bb7d8,{'trunks':_0x4c3fea||[]});fs[_0x44b8('0x65')](_0x44b8('0x66'),_0x36334a);var _0x1a5621=ejs[_0x44b8('0x64')](_0x31d3b6,{'trunks':_0x4c3fea||[]});fs[_0x44b8('0x65')](_0x44b8('0x68'),_0x1a5621);return respondWithRpcPromise('Reload',_0x44b8('0x2e'),{'module':'chan_sip.so'});}return null;})['then'](function(_0x55f4e4){if(_0x55f4e4){return _0x220f1b;}})[_0x44b8('0x17')](respondWithResult(_0xbbdab9,null))['catch'](handleError(_0xbbdab9,null));};exports[_0x44b8('0x2f')]=function(_0x1e37fd,_0x268e1e,_0x306793){var _0x3a9780;return db[_0x44b8('0x36')][_0x44b8('0x52')]({'where':{'id':_0x1e37fd[_0x44b8('0x50')]['id']}})['then'](handleEntityNotFound(_0x268e1e,null))[_0x44b8('0x17')](removeEntity(_0x268e1e,null))[_0x44b8('0x17')](function(){return db[_0x44b8('0x36')][_0x44b8('0x4c')]({'raw':!![]});})[_0x44b8('0x17')](function(_0xee44b3){var _0x10034d=fs[_0x44b8('0x5e')](path[_0x44b8('0x5f')](config['root'],'server/files/templates/trunk.ejs'),_0x44b8('0x61'));var _0x553aa9=fs[_0x44b8('0x5e')](path[_0x44b8('0x5f')](config[_0x44b8('0x62')],'server/files/templates/registry.ejs'),'utf8');var _0x4b22e7=ejs[_0x44b8('0x64')](_0x10034d,{'trunks':_0xee44b3});var _0x4860af=ejs[_0x44b8('0x64')](_0x553aa9,{'trunks':_0xee44b3});fs[_0x44b8('0x65')](_0x44b8('0x66'),_0x4b22e7);fs[_0x44b8('0x65')](_0x44b8('0x68'),_0x4860af);return respondWithRpcPromise(_0x44b8('0x69'),_0x44b8('0x2f'),{'module':_0x44b8('0x6a')});})[_0x44b8('0x4e')](handleError(_0x268e1e,null));}; \ No newline at end of file diff --git a/server/api/trunk/trunk.model.js b/server/api/trunk/trunk.model.js index 9853319..4bb5405 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 _0x551d=['util','../../config/logger','api','bluebird','request-promise','rimraf','./trunk.attributes','exports','define','Trunk','tools_trunks'];(function(_0x3ab9ee,_0x4a74b8){var _0x82ee88=function(_0x6ccc7e){while(--_0x6ccc7e){_0x3ab9ee['push'](_0x3ab9ee['shift']());}};_0x82ee88(++_0x4a74b8);}(_0x551d,0x197));var _0xd551=function(_0x4715d2,_0x3371b2){_0x4715d2=_0x4715d2-0x0;var _0x141811=_0x551d[_0x4715d2];return _0x141811;};'use strict';var _=require('lodash');var util=require(_0xd551('0x0'));var logger=require(_0xd551('0x1'))(_0xd551('0x2'));var moment=require('moment');var BPromise=require(_0xd551('0x3'));var rp=require(_0xd551('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd551('0x5'));var config=require('../../config/environment');var attributes=require(_0xd551('0x6'));module[_0xd551('0x7')]=function(_0x5c270b,_0x2ffabc){return _0x5c270b[_0xd551('0x8')](_0xd551('0x9'),attributes,{'tableName':_0xd551('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9730=['define','Trunk','tools_trunks','lodash','../../config/logger','api','moment','bluebird','path','rimraf','./trunk.attributes','exports'];(function(_0x49554d,_0x2f57a8){var _0x2ead18=function(_0x343f82){while(--_0x343f82){_0x49554d['push'](_0x49554d['shift']());}};_0x2ead18(++_0x2f57a8);}(_0x9730,0x10b));var _0x0973=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x9730[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x0973('0x0'));var util=require('util');var logger=require(_0x0973('0x1'))(_0x0973('0x2'));var moment=require(_0x0973('0x3'));var BPromise=require(_0x0973('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0973('0x5'));var rimraf=require(_0x0973('0x6'));var config=require('../../config/environment');var attributes=require(_0x0973('0x7'));module[_0x0973('0x8')]=function(_0x22c148,_0x11ef54){return _0x22c148[_0x0973('0x9')](_0x0973('0xa'),attributes,{'tableName':_0x0973('0xb'),'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 eca3ac3..a6baa35 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 _0xb3f6=['request\x20sent','error','message','result','catch','Trunk','raw','options','where','limit','map','include','attributes','model','then','GetTrunk','stringify','find','ShowTrunk','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','info','Trunk,\x20%s,\x20%s','debug','Trunk,\x20%s,\x20%s,\x20%s'];(function(_0x376f3d,_0x294471){var _0x440406=function(_0x198e9b){while(--_0x198e9b){_0x376f3d['push'](_0x376f3d['shift']());}};_0x440406(++_0x294471);}(_0xb3f6,0x12b));var _0x6b3f=function(_0x400219,_0x402421){_0x400219=_0x400219-0x0;var _0x15fd75=_0xb3f6[_0x400219];return _0x15fd75;};'use strict';var _=require(_0x6b3f('0x0'));var util=require(_0x6b3f('0x1'));var moment=require(_0x6b3f('0x2'));var BPromise=require(_0x6b3f('0x3'));var rs=require(_0x6b3f('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6b3f('0x5'))['db'];var utils=require(_0x6b3f('0x6'));var logger=require('../../config/logger')(_0x6b3f('0x7'));var config=require(_0x6b3f('0x8'));var jayson=require(_0x6b3f('0x9'));var client=jayson[_0x6b3f('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2fe874,_0x246655,_0x57031b){return new BPromise(function(_0x4ac8df,_0xd1a811){return client[_0x6b3f('0xb')](_0x2fe874,_0x57031b)['then'](function(_0x10fe8f){logger[_0x6b3f('0xc')](_0x6b3f('0xd'),_0x246655,'request\x20sent');logger[_0x6b3f('0xe')](_0x6b3f('0xf'),_0x246655,_0x6b3f('0x10'),JSON['stringify'](_0x10fe8f));if(_0x10fe8f[_0x6b3f('0x11')]){if(_0x10fe8f['error']['code']===0x1f4){logger[_0x6b3f('0x11')](_0x6b3f('0xd'),_0x246655,_0x10fe8f[_0x6b3f('0x11')]['message']);return _0xd1a811(_0x10fe8f[_0x6b3f('0x11')][_0x6b3f('0x12')]);}logger['error'](_0x6b3f('0xd'),_0x246655,_0x10fe8f[_0x6b3f('0x11')]['message']);return _0x4ac8df(_0x10fe8f[_0x6b3f('0x11')][_0x6b3f('0x12')]);}else{logger[_0x6b3f('0xc')]('Trunk,\x20%s,\x20%s',_0x246655,_0x6b3f('0x10'));_0x4ac8df(_0x10fe8f[_0x6b3f('0x13')][_0x6b3f('0x12')]);}})[_0x6b3f('0x14')](function(_0x5c7402){logger['error'](_0x6b3f('0xd'),_0x246655,_0x5c7402);_0xd1a811(_0x5c7402);});});}exports['GetTrunk']=function(_0x39aac5){var _0x463cd1=this;return new Promise(function(_0x106494,_0x4e79d2){return db[_0x6b3f('0x15')]['findAll']({'raw':_0x39aac5['options']?_0x39aac5['options'][_0x6b3f('0x16')]===undefined?!![]:![]:!![],'where':_0x39aac5[_0x6b3f('0x17')]?_0x39aac5[_0x6b3f('0x17')][_0x6b3f('0x18')]||null:null,'attributes':_0x39aac5[_0x6b3f('0x17')]?_0x39aac5[_0x6b3f('0x17')]['attributes']||null:null,'limit':_0x39aac5[_0x6b3f('0x17')]?_0x39aac5[_0x6b3f('0x17')][_0x6b3f('0x19')]||null:null,'include':_0x39aac5[_0x6b3f('0x17')]?_0x39aac5['options']['include']?_[_0x6b3f('0x1a')](_0x39aac5[_0x6b3f('0x17')][_0x6b3f('0x1b')],function(_0x3353fe){return{'model':db[_0x3353fe['model']],'as':_0x3353fe['as'],'attributes':_0x3353fe[_0x6b3f('0x1c')],'include':_0x3353fe[_0x6b3f('0x1b')]?_[_0x6b3f('0x1a')](_0x3353fe[_0x6b3f('0x1b')],function(_0x4e4b18){return{'model':db[_0x4e4b18[_0x6b3f('0x1d')]],'as':_0x4e4b18['as'],'attributes':_0x4e4b18[_0x6b3f('0x1c')],'include':_0x4e4b18[_0x6b3f('0x1b')]?_[_0x6b3f('0x1a')](_0x4e4b18[_0x6b3f('0x1b')],function(_0x3f0890){return{'model':db[_0x3f0890[_0x6b3f('0x1d')]],'as':_0x3f0890['as'],'attributes':_0x3f0890['attributes']};}):[]};}):[]};}):[]:[]})[_0x6b3f('0x1e')](function(_0x49f94b){logger[_0x6b3f('0xc')]('GetTrunk',_0x39aac5);logger[_0x6b3f('0xe')](_0x6b3f('0x1f'),_0x39aac5,JSON[_0x6b3f('0x20')](_0x49f94b));_0x106494(_0x49f94b);})[_0x6b3f('0x14')](function(_0x19488d){logger[_0x6b3f('0x11')](_0x6b3f('0x1f'),_0x19488d[_0x6b3f('0x12')],_0x39aac5);_0x4e79d2(_0x463cd1[_0x6b3f('0x11')](0x1f4,_0x19488d[_0x6b3f('0x12')]));});});};exports['ShowTrunk']=function(_0x109d3e){var _0x400763=this;return new Promise(function(_0x358f6e,_0x1ddea2){return db[_0x6b3f('0x15')][_0x6b3f('0x21')]({'raw':_0x109d3e[_0x6b3f('0x17')]?_0x109d3e[_0x6b3f('0x17')][_0x6b3f('0x16')]===undefined?!![]:![]:!![],'where':_0x109d3e[_0x6b3f('0x17')]?_0x109d3e[_0x6b3f('0x17')]['where']||null:null,'attributes':_0x109d3e[_0x6b3f('0x17')]?_0x109d3e[_0x6b3f('0x17')]['attributes']||null:null,'include':_0x109d3e[_0x6b3f('0x17')]?_0x109d3e['options'][_0x6b3f('0x1b')]?_[_0x6b3f('0x1a')](_0x109d3e[_0x6b3f('0x17')][_0x6b3f('0x1b')],function(_0x59f18d){return{'model':db[_0x59f18d[_0x6b3f('0x1d')]],'as':_0x59f18d['as'],'attributes':_0x59f18d[_0x6b3f('0x1c')],'include':_0x59f18d[_0x6b3f('0x1b')]?_[_0x6b3f('0x1a')](_0x59f18d[_0x6b3f('0x1b')],function(_0x39e5e6){return{'model':db[_0x39e5e6[_0x6b3f('0x1d')]],'as':_0x39e5e6['as'],'attributes':_0x39e5e6[_0x6b3f('0x1c')],'include':_0x39e5e6['include']?_[_0x6b3f('0x1a')](_0x39e5e6[_0x6b3f('0x1b')],function(_0x2e2bf1){return{'model':db[_0x2e2bf1[_0x6b3f('0x1d')]],'as':_0x2e2bf1['as'],'attributes':_0x2e2bf1['attributes']};}):[]};}):[]};}):[]:[]})[_0x6b3f('0x1e')](function(_0x4aa7ed){logger['info'](_0x6b3f('0x22'),_0x109d3e);logger[_0x6b3f('0xe')](_0x6b3f('0x22'),_0x109d3e,JSON['stringify'](_0x4aa7ed));_0x358f6e(_0x4aa7ed);})[_0x6b3f('0x14')](function(_0x103347){logger[_0x6b3f('0x11')](_0x6b3f('0x22'),_0x103347[_0x6b3f('0x12')],_0x109d3e);_0x1ddea2(_0x400763[_0x6b3f('0x11')](0x1f4,_0x103347[_0x6b3f('0x12')]));});});}; \ No newline at end of file +var _0x0428=['model','ShowTrunk','find','where','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','request','then','info','request\x20sent','debug','stringify','error','code','Trunk,\x20%s,\x20%s','message','result','catch','GetTrunk','Trunk','options','raw','attributes','limit','include','map'];(function(_0x4bb649,_0x1e1118){var _0x19b0bc=function(_0x345373){while(--_0x345373){_0x4bb649['push'](_0x4bb649['shift']());}};_0x19b0bc(++_0x1e1118);}(_0x0428,0x1be));var _0x8042=function(_0x939798,_0x4b2d17){_0x939798=_0x939798-0x0;var _0x18c016=_0x0428[_0x939798];return _0x18c016;};'use strict';var _=require(_0x8042('0x0'));var util=require(_0x8042('0x1'));var moment=require(_0x8042('0x2'));var BPromise=require('bluebird');var rs=require(_0x8042('0x3'));var fs=require('fs');var Redis=require(_0x8042('0x4'));var db=require(_0x8042('0x5'))['db'];var utils=require(_0x8042('0x6'));var logger=require(_0x8042('0x7'))('rpc');var config=require(_0x8042('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x8042('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3983a,_0x5e335b,_0x35c292){return new BPromise(function(_0x2e89e8,_0x158d0d){return client[_0x8042('0xa')](_0x3983a,_0x35c292)[_0x8042('0xb')](function(_0x455489){logger[_0x8042('0xc')]('Trunk,\x20%s,\x20%s',_0x5e335b,_0x8042('0xd'));logger[_0x8042('0xe')]('Trunk,\x20%s,\x20%s,\x20%s',_0x5e335b,_0x8042('0xd'),JSON[_0x8042('0xf')](_0x455489));if(_0x455489['error']){if(_0x455489[_0x8042('0x10')][_0x8042('0x11')]===0x1f4){logger['error'](_0x8042('0x12'),_0x5e335b,_0x455489[_0x8042('0x10')][_0x8042('0x13')]);return _0x158d0d(_0x455489[_0x8042('0x10')][_0x8042('0x13')]);}logger[_0x8042('0x10')](_0x8042('0x12'),_0x5e335b,_0x455489[_0x8042('0x10')]['message']);return _0x2e89e8(_0x455489[_0x8042('0x10')][_0x8042('0x13')]);}else{logger['info'](_0x8042('0x12'),_0x5e335b,'request\x20sent');_0x2e89e8(_0x455489[_0x8042('0x14')][_0x8042('0x13')]);}})[_0x8042('0x15')](function(_0x5f3813){logger[_0x8042('0x10')]('Trunk,\x20%s,\x20%s',_0x5e335b,_0x5f3813);_0x158d0d(_0x5f3813);});});}exports[_0x8042('0x16')]=function(_0x40c87b){var _0x187220=this;return new Promise(function(_0x2ce2f5,_0x6d4b24){return db[_0x8042('0x17')]['findAll']({'raw':_0x40c87b['options']?_0x40c87b[_0x8042('0x18')][_0x8042('0x19')]===undefined?!![]:![]:!![],'where':_0x40c87b[_0x8042('0x18')]?_0x40c87b['options']['where']||null:null,'attributes':_0x40c87b[_0x8042('0x18')]?_0x40c87b[_0x8042('0x18')][_0x8042('0x1a')]||null:null,'limit':_0x40c87b['options']?_0x40c87b[_0x8042('0x18')][_0x8042('0x1b')]||null:null,'include':_0x40c87b['options']?_0x40c87b[_0x8042('0x18')][_0x8042('0x1c')]?_[_0x8042('0x1d')](_0x40c87b[_0x8042('0x18')][_0x8042('0x1c')],function(_0x2788ff){return{'model':db[_0x2788ff[_0x8042('0x1e')]],'as':_0x2788ff['as'],'attributes':_0x2788ff[_0x8042('0x1a')],'include':_0x2788ff[_0x8042('0x1c')]?_[_0x8042('0x1d')](_0x2788ff['include'],function(_0x1298e9){return{'model':db[_0x1298e9[_0x8042('0x1e')]],'as':_0x1298e9['as'],'attributes':_0x1298e9[_0x8042('0x1a')],'include':_0x1298e9[_0x8042('0x1c')]?_[_0x8042('0x1d')](_0x1298e9['include'],function(_0x348f0f){return{'model':db[_0x348f0f[_0x8042('0x1e')]],'as':_0x348f0f['as'],'attributes':_0x348f0f[_0x8042('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x8042('0xb')](function(_0x7a6c4a){logger[_0x8042('0xc')](_0x8042('0x16'),_0x40c87b);logger['debug'](_0x8042('0x16'),_0x40c87b,JSON[_0x8042('0xf')](_0x7a6c4a));_0x2ce2f5(_0x7a6c4a);})[_0x8042('0x15')](function(_0x3f736d){logger['error'](_0x8042('0x16'),_0x3f736d[_0x8042('0x13')],_0x40c87b);_0x6d4b24(_0x187220['error'](0x1f4,_0x3f736d['message']));});});};exports[_0x8042('0x1f')]=function(_0x38db7f){var _0x4a80d9=this;return new Promise(function(_0xe74e2e,_0x91664b){return db[_0x8042('0x17')][_0x8042('0x20')]({'raw':_0x38db7f[_0x8042('0x18')]?_0x38db7f['options'][_0x8042('0x19')]===undefined?!![]:![]:!![],'where':_0x38db7f[_0x8042('0x18')]?_0x38db7f[_0x8042('0x18')][_0x8042('0x21')]||null:null,'attributes':_0x38db7f[_0x8042('0x18')]?_0x38db7f[_0x8042('0x18')]['attributes']||null:null,'include':_0x38db7f[_0x8042('0x18')]?_0x38db7f['options']['include']?_[_0x8042('0x1d')](_0x38db7f[_0x8042('0x18')][_0x8042('0x1c')],function(_0xdeebf6){return{'model':db[_0xdeebf6[_0x8042('0x1e')]],'as':_0xdeebf6['as'],'attributes':_0xdeebf6['attributes'],'include':_0xdeebf6['include']?_['map'](_0xdeebf6['include'],function(_0x72f878){return{'model':db[_0x72f878[_0x8042('0x1e')]],'as':_0x72f878['as'],'attributes':_0x72f878[_0x8042('0x1a')],'include':_0x72f878[_0x8042('0x1c')]?_[_0x8042('0x1d')](_0x72f878[_0x8042('0x1c')],function(_0x94a92){return{'model':db[_0x94a92[_0x8042('0x1e')]],'as':_0x94a92['as'],'attributes':_0x94a92[_0x8042('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xa1be5c){logger[_0x8042('0xc')](_0x8042('0x1f'),_0x38db7f);logger[_0x8042('0xe')](_0x8042('0x1f'),_0x38db7f,JSON['stringify'](_0xa1be5c));_0xe74e2e(_0xa1be5c);})[_0x8042('0x15')](function(_0x3d91f9){logger[_0x8042('0x10')](_0x8042('0x1f'),_0x3d91f9[_0x8042('0x13')],_0x38db7f);_0x91664b(_0x4a80d9[_0x8042('0x10')](0x1f4,_0x3d91f9[_0x8042('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/user-setting/index.js b/server/api/user-setting/index.js index d00392d..a898129 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 _0xe9ef=['../../components/auth/service','put','/:id','update','exports','express','Router'];(function(_0x4a1353,_0x2fbe86){var _0x3805cc=function(_0x39a7ee){while(--_0x39a7ee){_0x4a1353['push'](_0x4a1353['shift']());}};_0x3805cc(++_0x2fbe86);}(_0xe9ef,0x67));var _0xfe9e=function(_0x273f77,_0xe5b0cb){_0x273f77=_0x273f77-0x0;var _0x71e147=_0xe9ef[_0x273f77];return _0x71e147;};'use strict';var express=require(_0xfe9e('0x0'));var router=express[_0xfe9e('0x1')]();var auth=require(_0xfe9e('0x2'));var controller=require('./user-setting.controller');router[_0xfe9e('0x3')](_0xfe9e('0x4'),auth['isAuthenticated'](),controller[_0xfe9e('0x5')]);module[_0xfe9e('0x6')]=router; \ No newline at end of file +var _0x7886=['../../components/auth/service','./user-setting.controller','/:id','isAuthenticated','exports','Router'];(function(_0x4bf264,_0x3be730){var _0x3c855f=function(_0xabf944){while(--_0xabf944){_0x4bf264['push'](_0x4bf264['shift']());}};_0x3c855f(++_0x3be730);}(_0x7886,0xb9));var _0x6788=function(_0x3f155b,_0x53c231){_0x3f155b=_0x3f155b-0x0;var _0x49f344=_0x7886[_0x3f155b];return _0x49f344;};'use strict';var express=require('express');var router=express[_0x6788('0x0')]();var auth=require(_0x6788('0x1'));var controller=require(_0x6788('0x2'));router['put'](_0x6788('0x3'),auth[_0x6788('0x4')](),controller['update']);module[_0x6788('0x5')]=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 1513dac..274a798 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 _0xbdac=['UserId','sequelize','error','warning','info','debug','exports','ENUM','TEXT','DATE','INTEGER'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xbdac,0xf3));var _0xcbda=function(_0x581450,_0x56092d){_0x581450=_0x581450-0x0;var _0xc6e7db=_0xbdac[_0x581450];return _0xc6e7db;};'use strict';var Sequelize=require(_0xcbda('0x0'));const CLIENT_SIDE_LOG_LEVELS=[_0xcbda('0x1'),_0xcbda('0x2'),_0xcbda('0x3'),_0xcbda('0x4')];module[_0xcbda('0x5')]={'clientSideLoggingLevel':{'type':Sequelize[_0xcbda('0x6')](CLIENT_SIDE_LOG_LEVELS),'allowNull':![],'defaultValue':'error','validate':{'isIn':[CLIENT_SIDE_LOG_LEVELS]}},'clientSideLoggingEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'clientSideLoggingScopes':{'type':Sequelize[_0xcbda('0x7')],'allowNull':!![]},'clientSideLoggingEnabledSince':{'type':Sequelize[_0xcbda('0x8')],'allowNull':!![],'defaultValue':null},'UserId':{'type':Sequelize[_0xcbda('0x9')],'unique':_0xcbda('0xa')}}; \ No newline at end of file +var _0x65d3=['sequelize','exports','TEXT','DATE','INTEGER','UserId'];(function(_0x3c6fc6,_0x4c7c7a){var _0x575c1a=function(_0x1929cc){while(--_0x1929cc){_0x3c6fc6['push'](_0x3c6fc6['shift']());}};_0x575c1a(++_0x4c7c7a);}(_0x65d3,0x132));var _0x365d=function(_0x52a083,_0x546666){_0x52a083=_0x52a083-0x0;var _0x182aa8=_0x65d3[_0x52a083];return _0x182aa8;};'use strict';var Sequelize=require(_0x365d('0x0'));const CLIENT_SIDE_LOG_LEVELS=['error','warning','info','debug'];module[_0x365d('0x1')]={'clientSideLoggingLevel':{'type':Sequelize['ENUM'](CLIENT_SIDE_LOG_LEVELS),'allowNull':![],'defaultValue':'error','validate':{'isIn':[CLIENT_SIDE_LOG_LEVELS]}},'clientSideLoggingEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'clientSideLoggingScopes':{'type':Sequelize[_0x365d('0x2')],'allowNull':!![]},'clientSideLoggingEnabledSince':{'type':Sequelize[_0x365d('0x3')],'allowNull':!![],'defaultValue':null},'UserId':{'type':Sequelize[_0x365d('0x4')],'unique':_0x365d('0x5')}}; \ 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 87888ac..d9d6598 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 _0xf25a=['../../config/environment','../../mysqldb','socket.io-emitter','./user-setting.socket','register','redis','localhost','status','json','update','then','sendStatus','name','send','user','admin','Unauthorized','params','Invalid\x20user\x20setting\x20id','find','catch','lodash','ioredis','../../config/logger'];(function(_0x52b7b9,_0x43ed4b){var _0x5b5d30=function(_0x4a5b9c){while(--_0x4a5b9c){_0x52b7b9['push'](_0x52b7b9['shift']());}};_0x5b5d30(++_0x43ed4b);}(_0xf25a,0x195));var _0xaf25=function(_0x37701d,_0x504369){_0x37701d=_0x37701d-0x0;var _0x8917d1=_0xf25a[_0x37701d];return _0x8917d1;};'use strict';var _=require(_0xaf25('0x0'));var Redis=require(_0xaf25('0x1'));var logger=require(_0xaf25('0x2'))('api');var config=require(_0xaf25('0x3'));var db=require(_0xaf25('0x4'))['db'];var socket=require(_0xaf25('0x5'))(new Redis(config['redis']));require(_0xaf25('0x6'))[_0xaf25('0x7')](socket);config[_0xaf25('0x8')]=_['defaults'](config['redis'],{'host':_0xaf25('0x9'),'port':0x18eb});function respondWithResult(_0x48c6e6,_0x4b7258){_0x4b7258=_0x4b7258||0xc8;return function(_0x457ba5){if(_0x457ba5){return _0x48c6e6[_0xaf25('0xa')](_0x4b7258)[_0xaf25('0xb')](_0x457ba5);}};}function saveUpdates(_0x4a8bb2){return function(_0x422eee){if(_0x422eee){return _0x422eee[_0xaf25('0xc')](_0x4a8bb2)[_0xaf25('0xd')](function(_0x2dd7b1){return _0x2dd7b1;});}return null;};}function handleEntityNotFound(_0x439231){return function(_0x4a0cac){if(!_0x4a0cac){_0x439231[_0xaf25('0xe')](0x194);}return _0x4a0cac;};}function handleError(_0x1e3810,_0x350f8e){_0x350f8e=_0x350f8e||0x1f4;return function(_0x785825){logger['error'](_0x785825['stack']);if(_0x785825[_0xaf25('0xf')]){delete _0x785825[_0xaf25('0xf')];}_0x1e3810[_0xaf25('0xa')](_0x350f8e)[_0xaf25('0x10')](_0x785825);};}exports[_0xaf25('0xc')]=function(_0x58610b,_0x586c5a){if(_0x58610b[_0xaf25('0x11')]['role']!==_0xaf25('0x12'))throw new Error(_0xaf25('0x13'));if(isNaN(Number(_0x58610b[_0xaf25('0x14')]['id'])))throw new Error(_0xaf25('0x15'));return db['UserSetting'][_0xaf25('0x16')]({'where':{'id':_0x58610b['params']['id']}})['then'](handleEntityNotFound(_0x586c5a,null))[_0xaf25('0xd')](saveUpdates(_0x58610b['body'],null))[_0xaf25('0xd')](respondWithResult(_0x586c5a,null))[_0xaf25('0x17')](handleError(_0x586c5a,null));}; \ No newline at end of file +var _0x89f7=['../../config/environment','socket.io-emitter','./user-setting.socket','register','redis','defaults','localhost','update','error','stack','name','status','send','user','role','Unauthorized','Invalid\x20user\x20setting\x20id','params','then','body','catch','lodash','ioredis','../../config/logger'];(function(_0x21e2b9,_0x17c238){var _0x1bbc39=function(_0xe76d6a){while(--_0xe76d6a){_0x21e2b9['push'](_0x21e2b9['shift']());}};_0x1bbc39(++_0x17c238);}(_0x89f7,0x105));var _0x789f=function(_0x4ce1b9,_0x397a4b){_0x4ce1b9=_0x4ce1b9-0x0;var _0x2bb15d=_0x89f7[_0x4ce1b9];return _0x2bb15d;};'use strict';var _=require(_0x789f('0x0'));var Redis=require(_0x789f('0x1'));var logger=require(_0x789f('0x2'))('api');var config=require(_0x789f('0x3'));var db=require('../../mysqldb')['db'];var socket=require(_0x789f('0x4'))(new Redis(config['redis']));require(_0x789f('0x5'))[_0x789f('0x6')](socket);config[_0x789f('0x7')]=_[_0x789f('0x8')](config['redis'],{'host':_0x789f('0x9'),'port':0x18eb});function respondWithResult(_0x1faaa5,_0x2e2dba){_0x2e2dba=_0x2e2dba||0xc8;return function(_0x1037cc){if(_0x1037cc){return _0x1faaa5['status'](_0x2e2dba)['json'](_0x1037cc);}};}function saveUpdates(_0x3c0d06){return function(_0x6b7223){if(_0x6b7223){return _0x6b7223[_0x789f('0xa')](_0x3c0d06)['then'](function(_0x300d27){return _0x300d27;});}return null;};}function handleEntityNotFound(_0x42368e){return function(_0xbad53c){if(!_0xbad53c){_0x42368e['sendStatus'](0x194);}return _0xbad53c;};}function handleError(_0x4f85a3,_0x4c986c){_0x4c986c=_0x4c986c||0x1f4;return function(_0x5674fb){logger[_0x789f('0xb')](_0x5674fb[_0x789f('0xc')]);if(_0x5674fb[_0x789f('0xd')]){delete _0x5674fb[_0x789f('0xd')];}_0x4f85a3[_0x789f('0xe')](_0x4c986c)[_0x789f('0xf')](_0x5674fb);};}exports['update']=function(_0x12e118,_0x6e4c1){if(_0x12e118[_0x789f('0x10')][_0x789f('0x11')]!=='admin')throw new Error(_0x789f('0x12'));if(isNaN(Number(_0x12e118['params']['id'])))throw new Error(_0x789f('0x13'));return db['UserSetting']['find']({'where':{'id':_0x12e118[_0x789f('0x14')]['id']}})[_0x789f('0x15')](handleEntityNotFound(_0x6e4c1,null))[_0x789f('0x15')](saveUpdates(_0x12e118[_0x789f('0x16')],null))[_0x789f('0x15')](respondWithResult(_0x6e4c1,null))[_0x789f('0x17')](handleError(_0x6e4c1,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 cc9ebf6..ee46293 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 _0x3dba=['update','remove','emit','hasOwnProperty','hook','exports','events','setMaxListeners','save'];(function(_0x200af4,_0x8416e8){var _0x3831b6=function(_0xf139c0){while(--_0xf139c0){_0x200af4['push'](_0x200af4['shift']());}};_0x3831b6(++_0x8416e8);}(_0x3dba,0x126));var _0xa3db=function(_0x5c96dd,_0x3017af){_0x5c96dd=_0x5c96dd-0x0;var _0x20416f=_0x3dba[_0x5c96dd];return _0x20416f;};'use strict';var EventEmitter=require(_0xa3db('0x0'));var UserSetting=require('../../mysqldb')['db']['UserSetting'];var UserSettingEvents=new EventEmitter();UserSettingEvents[_0xa3db('0x1')](0x0);var events={'afterCreate':_0xa3db('0x2'),'afterUpdate':_0xa3db('0x3'),'afterDestroy':_0xa3db('0x4')};function emitEvent(_0x4f1bbe){return function(_0x1bc0a2,_0x374dcc,_0x27df01){UserSettingEvents[_0xa3db('0x5')](_0x4f1bbe+':'+_0x1bc0a2['id'],_0x1bc0a2);UserSettingEvents[_0xa3db('0x5')](_0x4f1bbe,_0x1bc0a2);_0x27df01(null);};}for(var e in events){if(events[_0xa3db('0x6')](e)){var event=events[e];UserSetting[_0xa3db('0x7')](e,emitEvent(event));}}module[_0xa3db('0x8')]=UserSettingEvents; \ No newline at end of file +var _0x6681=['events','../../mysqldb','UserSetting','setMaxListeners','update','emit','hasOwnProperty'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x6681,0x1d5));var _0x1668=function(_0x14b892,_0x59e0bb){_0x14b892=_0x14b892-0x0;var _0x1dd384=_0x6681[_0x14b892];return _0x1dd384;};'use strict';var EventEmitter=require(_0x1668('0x0'));var UserSetting=require(_0x1668('0x1'))['db'][_0x1668('0x2')];var UserSettingEvents=new EventEmitter();UserSettingEvents[_0x1668('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x1668('0x4'),'afterDestroy':'remove'};function emitEvent(_0x1cf3f6){return function(_0xa1d0b8,_0x5807cb,_0x26463c){UserSettingEvents[_0x1668('0x5')](_0x1cf3f6+':'+_0xa1d0b8['id'],_0xa1d0b8);UserSettingEvents[_0x1668('0x5')](_0x1cf3f6,_0xa1d0b8);_0x26463c(null);};}for(var e in events){if(events[_0x1668('0x6')](e)){var event=events[e];UserSetting['hook'](e,emitEvent(event));}}module['exports']=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 8f97160..23bad4f 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 _0x9c2c=['user_settings','clientSideLoggingEnabled','clientSideLoggingEnabledSince','./user-setting.attributes','exports'];(function(_0x523b8f,_0x4b05ef){var _0x5e77fc=function(_0x48b89a){while(--_0x48b89a){_0x523b8f['push'](_0x523b8f['shift']());}};_0x5e77fc(++_0x4b05ef);}(_0x9c2c,0x1c0));var _0xc9c2=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9c2c[_0x3dd15e];return _0x231fd0;};'use strict';var attributes=require(_0xc9c2('0x0'));module[_0xc9c2('0x1')]=function(_0x4ac695){return _0x4ac695['define']('UserSetting',attributes,{'tableName':_0xc9c2('0x2'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x4ac3bb){if(!_0x4ac3bb[_0xc9c2('0x3')])_0x4ac3bb[_0xc9c2('0x4')]=null;else if(_0x4ac3bb['clientSideLoggingEnabledSince']===null)_0x4ac3bb['clientSideLoggingEnabledSince']=new Date();}}});}; \ No newline at end of file +var _0x5b02=['clientSideLoggingEnabledSince','./user-setting.attributes','exports','define'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x5b02,0xe9));var _0x25b0=function(_0x43a35c,_0x4d59c5){_0x43a35c=_0x43a35c-0x0;var _0x8f5f6f=_0x5b02[_0x43a35c];return _0x8f5f6f;};'use strict';var attributes=require(_0x25b0('0x0'));module[_0x25b0('0x1')]=function(_0x428458){return _0x428458[_0x25b0('0x2')]('UserSetting',attributes,{'tableName':'user_settings','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2b5f2d){if(!_0x2b5f2d['clientSideLoggingEnabled'])_0x2b5f2d[_0x25b0('0x3')]=null;else if(_0x2b5f2d[_0x25b0('0x3')]===null)_0x2b5f2d[_0x25b0('0x3')]=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 89dfb45..e509579 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 _0xf3ca=['./user-setting.events','save','remove','update','emit','user-setting:update','UserId','length','user-setting:'];(function(_0x1c9c24,_0x2a517b){var _0x349c69=function(_0x259ff7){while(--_0x259ff7){_0x1c9c24['push'](_0x1c9c24['shift']());}};_0x349c69(++_0x2a517b);}(_0xf3ca,0x195));var _0xaf3c=function(_0x20d9f3,_0x4b0bc7){_0x20d9f3=_0x20d9f3-0x0;var _0x2f36fc=_0xf3ca[_0x20d9f3];return _0x2f36fc;};'use strict';var UserSettingEvents=require(_0xaf3c('0x0'));var events=[_0xaf3c('0x1'),_0xaf3c('0x2'),_0xaf3c('0x3')];function createListener(_0x545838,_0xa6bdfd){return function(_0x25fd4a){_0xa6bdfd[_0xaf3c('0x4')](_0x545838,_0x25fd4a);if(_0x545838===_0xaf3c('0x5')){_0xa6bdfd[_0xaf3c('0x4')]('user-setting:update:user-'+_0x25fd4a[_0xaf3c('0x6')],_0x25fd4a);}};}exports['register']=function(_0x2ddda7){for(var _0x5af6f2=0x0,_0x4ff4b5=events[_0xaf3c('0x7')];_0x5af6f2<_0x4ff4b5;_0x5af6f2++){var _0xd06e90=events[_0x5af6f2];var _0x59eba6=createListener(_0xaf3c('0x8')+_0xd06e90,_0x2ddda7);UserSettingEvents['on'](_0xd06e90,_0x59eba6);}}; \ No newline at end of file +var _0xcee9=['user-setting:','./user-setting.events','save','remove','update','user-setting:update','emit','user-setting:update:user-','register','length'];(function(_0x40fb90,_0x194d7a){var _0x51978e=function(_0x3be952){while(--_0x3be952){_0x40fb90['push'](_0x40fb90['shift']());}};_0x51978e(++_0x194d7a);}(_0xcee9,0xbf));var _0x9cee=function(_0x8bec16,_0x361375){_0x8bec16=_0x8bec16-0x0;var _0x3e1e27=_0xcee9[_0x8bec16];return _0x3e1e27;};'use strict';var UserSettingEvents=require(_0x9cee('0x0'));var events=[_0x9cee('0x1'),_0x9cee('0x2'),_0x9cee('0x3')];function createListener(_0x4c81ea,_0x53b37f){return function(_0x44608e){_0x53b37f['emit'](_0x4c81ea,_0x44608e);if(_0x4c81ea===_0x9cee('0x4')){_0x53b37f[_0x9cee('0x5')](_0x9cee('0x6')+_0x44608e['UserId'],_0x44608e);}};}exports[_0x9cee('0x7')]=function(_0x17a04b){for(var _0x590a61=0x0,_0x299c39=events[_0x9cee('0x8')];_0x590a61<_0x299c39;_0x590a61++){var _0x5142bf=events[_0x590a61];var _0x2c5665=createListener(_0x9cee('0x9')+_0x5142bf,_0x17a04b);UserSettingEvents['on'](_0x5142bf,_0x2c5665);}}; \ No newline at end of file diff --git a/server/api/user/index.js b/server/api/user/index.js index 250a29f..ef7f753 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 _0x0a01=['getContacts','/:id/queues','/:id/groups','getGroups','/:id/recordings','getRecordings','/:id/chat/interactions','getChatInteractions','/:id/openchannel/interactions','getOpenchannelInteractions','getMailInteractions','/:id/sms/interactions','/:id/fax/interactions','/:id/whatsapp/interactions','getWhatsappInteractions','/:id/teams','getTeams','/:id/lists','getLists','/:id/agents','getAgents','/:id/prefixes','getVoicePrefixes','/:id/fax_accounts','/:id/sms_accounts','/:id/chat_websites','getChatWebsites','/:id/whatsapp_accounts','getWhatsappAccounts','/:id/scheduled_calls','getScheduledCalls','/:id/api_key','getApiKey','post','create','/create_many','bulkCreate','addQueues','diskStorage','root','server/files/images/','format','%s-%s','now','originalname','/:id/avatar','single','file','addAvatar','/:id/login','/:id/logout','/:id/pause','unpause','addTeams','/:id/chat_interactions','/:id/mail_interactions','addMailInteractions','/:id/fax_interactions','addFaxInteractions','/:id/sms_interactions','addSmsInteractions','/:id/openchannel_interactions','addOpenchannelInteractions','/:id/whatsapp_interactions','/:id/mail_accounts','/:id/openchannel_accounts','addChatWebsites','addWhatsappAccounts','createApiKey','update','put','/:id/password','removeQueues','delete','destroy','removeChatInteractions','removeMailInteractions','removeFaxInteractions','removeSmsInteractions','removeOpenchannelInteractions','removeWhatsappInteractions','removeFaxAccounts','removeMailAccounts','removeOpenchannelAccounts','removeSmsAccounts','removeWhatsappAccounts','removeApiKey','/:id/messengerSoundNotification','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./user.controller','get','isAuthenticated','/describe','describe','/presence','getPresence','/:id','show','getAvatar','/:id/open_tabs','getOpenTabs','/:id/contacts'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0a01,0x1a6));var _0x10a0=function(_0x5de924,_0x59a066){_0x5de924=_0x5de924-0x0;var _0x4d755e=_0x0a01[_0x5de924];return _0x4d755e;};'use strict';var multer=require(_0x10a0('0x0'));var util=require(_0x10a0('0x1'));var path=require(_0x10a0('0x2'));var timeout=require(_0x10a0('0x3'));var express=require('express');var router=express[_0x10a0('0x4')]();var fs_extra=require(_0x10a0('0x5'));var auth=require(_0x10a0('0x6'));var interaction=require(_0x10a0('0x7'));var config=require(_0x10a0('0x8'));var controller=require(_0x10a0('0x9'));router[_0x10a0('0xa')]('/',auth[_0x10a0('0xb')](),controller['index']);router[_0x10a0('0xa')](_0x10a0('0xc'),auth[_0x10a0('0xb')](),controller[_0x10a0('0xd')]);router[_0x10a0('0xa')]('/whoami',auth['isAuthenticated'](),controller['whoami']);router['get'](_0x10a0('0xe'),auth[_0x10a0('0xb')](),controller[_0x10a0('0xf')]);router[_0x10a0('0xa')](_0x10a0('0x10'),auth[_0x10a0('0xb')](),controller[_0x10a0('0x11')]);router[_0x10a0('0xa')]('/:id/avatar',controller[_0x10a0('0x12')]);router[_0x10a0('0xa')](_0x10a0('0x13'),auth[_0x10a0('0xb')](),controller[_0x10a0('0x14')]);router['get'](_0x10a0('0x15'),auth[_0x10a0('0xb')](),controller[_0x10a0('0x16')]);router[_0x10a0('0xa')](_0x10a0('0x17'),auth[_0x10a0('0xb')](),controller['getQueues']);router[_0x10a0('0xa')]('/:id/queues_rt',auth['isAuthenticated'](),controller['getVoiceQueuesRt']);router['get'](_0x10a0('0x18'),auth[_0x10a0('0xb')](),controller[_0x10a0('0x19')]);router[_0x10a0('0xa')](_0x10a0('0x1a'),auth['isAuthenticated'](),controller[_0x10a0('0x1b')]);router[_0x10a0('0xa')]('/:id/screen_recordings',auth['isAuthenticated'](),controller['getScreenRecordings']);router[_0x10a0('0xa')](_0x10a0('0x1c'),auth[_0x10a0('0xb')](),controller[_0x10a0('0x1d')]);router[_0x10a0('0xa')](_0x10a0('0x1e'),auth[_0x10a0('0xb')](),controller[_0x10a0('0x1f')]);router[_0x10a0('0xa')]('/:id/mail/interactions',auth[_0x10a0('0xb')](),controller[_0x10a0('0x20')]);router[_0x10a0('0xa')](_0x10a0('0x21'),auth['isAuthenticated'](),controller['getSmsInteractions']);router[_0x10a0('0xa')](_0x10a0('0x22'),auth[_0x10a0('0xb')](),controller['getFaxInteractions']);router[_0x10a0('0xa')](_0x10a0('0x23'),auth[_0x10a0('0xb')](),controller[_0x10a0('0x24')]);router['get'](_0x10a0('0x25'),auth[_0x10a0('0xb')](),controller[_0x10a0('0x26')]);router[_0x10a0('0xa')](_0x10a0('0x27'),auth[_0x10a0('0xb')](),controller[_0x10a0('0x28')]);router['get'](_0x10a0('0x29'),auth['isAuthenticated'](),controller[_0x10a0('0x2a')]);router['get'](_0x10a0('0x2b'),auth['isAuthenticated'](),controller[_0x10a0('0x2c')]);router[_0x10a0('0xa')](_0x10a0('0x2d'),auth['isAuthenticated'](),controller['getFaxAccounts']);router[_0x10a0('0xa')]('/:id/mail_accounts',auth[_0x10a0('0xb')](),controller['getMailAccounts']);router['get']('/:id/openchannel_accounts',auth[_0x10a0('0xb')](),controller['getOpenchannelAccounts']);router['get'](_0x10a0('0x2e'),auth[_0x10a0('0xb')](),controller['getSmsAccounts']);router[_0x10a0('0xa')](_0x10a0('0x2f'),auth[_0x10a0('0xb')](),controller[_0x10a0('0x30')]);router[_0x10a0('0xa')](_0x10a0('0x31'),auth[_0x10a0('0xb')](),controller[_0x10a0('0x32')]);router[_0x10a0('0xa')](_0x10a0('0x33'),auth[_0x10a0('0xb')](),controller[_0x10a0('0x34')]);router[_0x10a0('0xa')](_0x10a0('0x35'),auth['isAuthenticated'](),controller[_0x10a0('0x36')]);router[_0x10a0('0x37')](_0x10a0('0x15'),auth[_0x10a0('0xb')](),controller['addContacts']);router[_0x10a0('0x37')]('/',auth['isAuthenticated'](),controller[_0x10a0('0x38')]);router['post'](_0x10a0('0x39'),auth['isAuthenticated'](),controller[_0x10a0('0x3a')]);router[_0x10a0('0x37')](_0x10a0('0x17'),auth[_0x10a0('0xb')](),controller[_0x10a0('0x3b')]);var upload=multer({'storage':multer[_0x10a0('0x3c')]({'destination':function(_0x176d6c,_0x1773d2,_0x51b0c8){_0x51b0c8(null,path['join'](config[_0x10a0('0x3d')],_0x10a0('0x3e')));},'filename':function(_0x2bb4d0,_0x1501b9,_0x543e40){_0x543e40(null,util[_0x10a0('0x3f')](_0x10a0('0x40'),Date[_0x10a0('0x41')](),_0x1501b9[_0x10a0('0x42')]));}})});router[_0x10a0('0x37')](_0x10a0('0x43'),upload[_0x10a0('0x44')](_0x10a0('0x45')),controller[_0x10a0('0x46')]);router[_0x10a0('0x37')](_0x10a0('0x47'),auth[_0x10a0('0xb')](),controller['login']);router[_0x10a0('0x37')](_0x10a0('0x48'),auth[_0x10a0('0xb')](),controller['logout']);router[_0x10a0('0x37')](_0x10a0('0x49'),auth[_0x10a0('0xb')](),controller['pause']);router[_0x10a0('0x37')]('/:id/unpause',auth[_0x10a0('0xb')](),controller[_0x10a0('0x4a')]);router[_0x10a0('0x37')](_0x10a0('0x25'),auth[_0x10a0('0xb')](),controller[_0x10a0('0x4b')]);router[_0x10a0('0x37')](_0x10a0('0x4c'),auth[_0x10a0('0xb')](),controller['addChatInteractions']);router[_0x10a0('0x37')](_0x10a0('0x4d'),auth[_0x10a0('0xb')](),controller[_0x10a0('0x4e')]);router[_0x10a0('0x37')](_0x10a0('0x4f'),auth['isAuthenticated'](),controller[_0x10a0('0x50')]);router[_0x10a0('0x37')](_0x10a0('0x51'),auth['isAuthenticated'](),controller[_0x10a0('0x52')]);router['post'](_0x10a0('0x53'),auth[_0x10a0('0xb')](),controller[_0x10a0('0x54')]);router[_0x10a0('0x37')](_0x10a0('0x55'),auth[_0x10a0('0xb')](),controller['addWhatsappInteractions']);router[_0x10a0('0x37')](_0x10a0('0x2d'),auth[_0x10a0('0xb')](),controller['addFaxAccounts']);router[_0x10a0('0x37')](_0x10a0('0x56'),auth[_0x10a0('0xb')](),controller['addMailAccounts']);router[_0x10a0('0x37')](_0x10a0('0x57'),auth[_0x10a0('0xb')](),controller['addOpenchannelAccounts']);router['post'](_0x10a0('0x2e'),auth[_0x10a0('0xb')](),controller['addSmsAccounts']);router['post'](_0x10a0('0x2f'),auth['isAuthenticated'](),controller[_0x10a0('0x58')]);router[_0x10a0('0x37')]('/:id/whatsapp_accounts',auth['isAuthenticated'](),controller[_0x10a0('0x59')]);router[_0x10a0('0x37')](_0x10a0('0x35'),auth['isAuthenticated'](),controller[_0x10a0('0x5a')]);router['put']('/:id',auth[_0x10a0('0xb')](),controller[_0x10a0('0x5b')]);router[_0x10a0('0x5c')](_0x10a0('0x5d'),auth[_0x10a0('0xb')](),controller['changePassword']);router['delete'](_0x10a0('0x17'),auth[_0x10a0('0xb')](),controller[_0x10a0('0x5e')]);router[_0x10a0('0x5f')]('/:id/teams',auth[_0x10a0('0xb')](),controller['removeTeams']);router['delete']('/:id',auth[_0x10a0('0xb')](),controller[_0x10a0('0x60')]);router[_0x10a0('0x5f')](_0x10a0('0x4c'),auth[_0x10a0('0xb')](),controller[_0x10a0('0x61')]);router['delete'](_0x10a0('0x4d'),auth[_0x10a0('0xb')](),controller[_0x10a0('0x62')]);router[_0x10a0('0x5f')](_0x10a0('0x4f'),auth[_0x10a0('0xb')](),controller[_0x10a0('0x63')]);router[_0x10a0('0x5f')](_0x10a0('0x51'),auth[_0x10a0('0xb')](),controller[_0x10a0('0x64')]);router[_0x10a0('0x5f')](_0x10a0('0x53'),auth[_0x10a0('0xb')](),controller[_0x10a0('0x65')]);router['delete'](_0x10a0('0x55'),auth[_0x10a0('0xb')](),controller[_0x10a0('0x66')]);router[_0x10a0('0x5f')]('/:id/fax_accounts',auth[_0x10a0('0xb')](),controller[_0x10a0('0x67')]);router[_0x10a0('0x5f')](_0x10a0('0x56'),auth['isAuthenticated'](),controller[_0x10a0('0x68')]);router[_0x10a0('0x5f')](_0x10a0('0x57'),auth[_0x10a0('0xb')](),controller[_0x10a0('0x69')]);router['delete'](_0x10a0('0x2e'),auth[_0x10a0('0xb')](),controller[_0x10a0('0x6a')]);router[_0x10a0('0x5f')](_0x10a0('0x2f'),auth[_0x10a0('0xb')](),controller['removeChatWebsites']);router['delete'](_0x10a0('0x31'),auth[_0x10a0('0xb')](),controller[_0x10a0('0x6b')]);router[_0x10a0('0x5f')](_0x10a0('0x35'),auth[_0x10a0('0xb')](),controller[_0x10a0('0x6c')]);router['post'](_0x10a0('0x6d'),auth[_0x10a0('0xb')](),controller['messengerSoundNotification']);module[_0x10a0('0x6e')]=router; \ No newline at end of file +var _0x2995=['format','now','originalname','addAvatar','post','/:id/login','login','logout','/:id/unpause','unpause','addTeams','addChatInteractions','/:id/mail_interactions','addMailInteractions','/:id/fax_interactions','addFaxInteractions','/:id/sms_interactions','addOpenchannelInteractions','/:id/whatsapp_interactions','addFaxAccounts','addOpenchannelAccounts','addSmsAccounts','addChatWebsites','addWhatsappAccounts','createApiKey','put','/:id','update','changePassword','delete','removeQueues','/:id/teams','removeTeams','/:id/chat_interactions','removeChatInteractions','removeMailInteractions','removeFaxInteractions','/:id/openchannel_interactions','removeOpenchannelInteractions','removeWhatsappInteractions','removeOpenchannelAccounts','removeSmsAccounts','/:id/chat_websites','removeChatWebsites','removeWhatsappAccounts','removeApiKey','/:id/messengerSoundNotification','messengerSoundNotification','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./user.controller','get','isAuthenticated','index','/describe','describe','/presence','getPresence','show','/:id/avatar','getAvatar','/:id/open_tabs','getOpenTabs','/:id/contacts','getContacts','/:id/queues','/:id/queues_rt','getVoiceQueuesRt','/:id/groups','getGroups','/:id/recordings','getRecordings','/:id/screen_recordings','getScreenRecordings','/:id/chat/interactions','getChatInteractions','getOpenchannelInteractions','/:id/mail/interactions','getMailInteractions','/:id/sms/interactions','/:id/fax/interactions','getWhatsappInteractions','getTeams','getLists','/:id/prefixes','getVoicePrefixes','/:id/fax_accounts','getFaxAccounts','/:id/mail_accounts','getMailAccounts','/:id/openchannel_accounts','getOpenchannelAccounts','/:id/sms_accounts','getChatWebsites','/:id/whatsapp_accounts','getWhatsappAccounts','/:id/scheduled_calls','getScheduledCalls','getApiKey','addContacts','create','/create_many','bulkCreate','addQueues','diskStorage','root'];(function(_0x122e9b,_0x391bf4){var _0x22c247=function(_0x1b2c65){while(--_0x1b2c65){_0x122e9b['push'](_0x122e9b['shift']());}};_0x22c247(++_0x391bf4);}(_0x2995,0x180));var _0x5299=function(_0x3bd919,_0xe52ed){_0x3bd919=_0x3bd919-0x0;var _0x55f3b6=_0x2995[_0x3bd919];return _0x55f3b6;};'use strict';var multer=require(_0x5299('0x0'));var util=require(_0x5299('0x1'));var path=require(_0x5299('0x2'));var timeout=require('connect-timeout');var express=require(_0x5299('0x3'));var router=express[_0x5299('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x5299('0x5'));var interaction=require(_0x5299('0x6'));var config=require(_0x5299('0x7'));var controller=require(_0x5299('0x8'));router[_0x5299('0x9')]('/',auth[_0x5299('0xa')](),controller[_0x5299('0xb')]);router['get'](_0x5299('0xc'),auth[_0x5299('0xa')](),controller[_0x5299('0xd')]);router[_0x5299('0x9')]('/whoami',auth['isAuthenticated'](),controller['whoami']);router['get'](_0x5299('0xe'),auth[_0x5299('0xa')](),controller[_0x5299('0xf')]);router[_0x5299('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x5299('0x10')]);router[_0x5299('0x9')](_0x5299('0x11'),controller[_0x5299('0x12')]);router[_0x5299('0x9')](_0x5299('0x13'),auth[_0x5299('0xa')](),controller[_0x5299('0x14')]);router['get'](_0x5299('0x15'),auth[_0x5299('0xa')](),controller[_0x5299('0x16')]);router[_0x5299('0x9')](_0x5299('0x17'),auth[_0x5299('0xa')](),controller['getQueues']);router[_0x5299('0x9')](_0x5299('0x18'),auth[_0x5299('0xa')](),controller[_0x5299('0x19')]);router[_0x5299('0x9')](_0x5299('0x1a'),auth[_0x5299('0xa')](),controller[_0x5299('0x1b')]);router[_0x5299('0x9')](_0x5299('0x1c'),auth[_0x5299('0xa')](),controller[_0x5299('0x1d')]);router[_0x5299('0x9')](_0x5299('0x1e'),auth['isAuthenticated'](),controller[_0x5299('0x1f')]);router[_0x5299('0x9')](_0x5299('0x20'),auth['isAuthenticated'](),controller[_0x5299('0x21')]);router[_0x5299('0x9')]('/:id/openchannel/interactions',auth['isAuthenticated'](),controller[_0x5299('0x22')]);router[_0x5299('0x9')](_0x5299('0x23'),auth[_0x5299('0xa')](),controller[_0x5299('0x24')]);router['get'](_0x5299('0x25'),auth[_0x5299('0xa')](),controller['getSmsInteractions']);router[_0x5299('0x9')](_0x5299('0x26'),auth[_0x5299('0xa')](),controller['getFaxInteractions']);router[_0x5299('0x9')]('/:id/whatsapp/interactions',auth[_0x5299('0xa')](),controller[_0x5299('0x27')]);router['get']('/:id/teams',auth[_0x5299('0xa')](),controller[_0x5299('0x28')]);router[_0x5299('0x9')]('/:id/lists',auth['isAuthenticated'](),controller[_0x5299('0x29')]);router[_0x5299('0x9')]('/:id/agents',auth[_0x5299('0xa')](),controller['getAgents']);router[_0x5299('0x9')](_0x5299('0x2a'),auth['isAuthenticated'](),controller[_0x5299('0x2b')]);router[_0x5299('0x9')](_0x5299('0x2c'),auth[_0x5299('0xa')](),controller[_0x5299('0x2d')]);router[_0x5299('0x9')](_0x5299('0x2e'),auth[_0x5299('0xa')](),controller[_0x5299('0x2f')]);router[_0x5299('0x9')](_0x5299('0x30'),auth[_0x5299('0xa')](),controller[_0x5299('0x31')]);router['get'](_0x5299('0x32'),auth[_0x5299('0xa')](),controller['getSmsAccounts']);router[_0x5299('0x9')]('/:id/chat_websites',auth[_0x5299('0xa')](),controller[_0x5299('0x33')]);router[_0x5299('0x9')](_0x5299('0x34'),auth[_0x5299('0xa')](),controller[_0x5299('0x35')]);router[_0x5299('0x9')](_0x5299('0x36'),auth['isAuthenticated'](),controller[_0x5299('0x37')]);router[_0x5299('0x9')]('/:id/api_key',auth['isAuthenticated'](),controller[_0x5299('0x38')]);router['post'](_0x5299('0x15'),auth[_0x5299('0xa')](),controller[_0x5299('0x39')]);router['post']('/',auth[_0x5299('0xa')](),controller[_0x5299('0x3a')]);router['post'](_0x5299('0x3b'),auth[_0x5299('0xa')](),controller[_0x5299('0x3c')]);router['post']('/:id/queues',auth[_0x5299('0xa')](),controller[_0x5299('0x3d')]);var upload=multer({'storage':multer[_0x5299('0x3e')]({'destination':function(_0x5e2177,_0x394007,_0x1b2a56){_0x1b2a56(null,path['join'](config[_0x5299('0x3f')],'server/files/images/'));},'filename':function(_0x4c1c26,_0x15099f,_0x4abeb3){_0x4abeb3(null,util[_0x5299('0x40')]('%s-%s',Date[_0x5299('0x41')](),_0x15099f[_0x5299('0x42')]));}})});router['post'](_0x5299('0x11'),upload['single']('file'),controller[_0x5299('0x43')]);router[_0x5299('0x44')](_0x5299('0x45'),auth[_0x5299('0xa')](),controller[_0x5299('0x46')]);router['post']('/:id/logout',auth[_0x5299('0xa')](),controller[_0x5299('0x47')]);router[_0x5299('0x44')]('/:id/pause',auth[_0x5299('0xa')](),controller['pause']);router[_0x5299('0x44')](_0x5299('0x48'),auth[_0x5299('0xa')](),controller[_0x5299('0x49')]);router[_0x5299('0x44')]('/:id/teams',auth['isAuthenticated'](),controller[_0x5299('0x4a')]);router[_0x5299('0x44')]('/:id/chat_interactions',auth['isAuthenticated'](),controller[_0x5299('0x4b')]);router['post'](_0x5299('0x4c'),auth['isAuthenticated'](),controller[_0x5299('0x4d')]);router['post'](_0x5299('0x4e'),auth[_0x5299('0xa')](),controller[_0x5299('0x4f')]);router[_0x5299('0x44')](_0x5299('0x50'),auth[_0x5299('0xa')](),controller['addSmsInteractions']);router[_0x5299('0x44')]('/:id/openchannel_interactions',auth[_0x5299('0xa')](),controller[_0x5299('0x51')]);router[_0x5299('0x44')](_0x5299('0x52'),auth['isAuthenticated'](),controller['addWhatsappInteractions']);router['post']('/:id/fax_accounts',auth[_0x5299('0xa')](),controller[_0x5299('0x53')]);router[_0x5299('0x44')]('/:id/mail_accounts',auth[_0x5299('0xa')](),controller['addMailAccounts']);router['post'](_0x5299('0x30'),auth[_0x5299('0xa')](),controller[_0x5299('0x54')]);router['post'](_0x5299('0x32'),auth[_0x5299('0xa')](),controller[_0x5299('0x55')]);router['post']('/:id/chat_websites',auth[_0x5299('0xa')](),controller[_0x5299('0x56')]);router['post'](_0x5299('0x34'),auth[_0x5299('0xa')](),controller[_0x5299('0x57')]);router[_0x5299('0x44')]('/:id/api_key',auth[_0x5299('0xa')](),controller[_0x5299('0x58')]);router[_0x5299('0x59')](_0x5299('0x5a'),auth['isAuthenticated'](),controller[_0x5299('0x5b')]);router[_0x5299('0x59')]('/:id/password',auth['isAuthenticated'](),controller[_0x5299('0x5c')]);router[_0x5299('0x5d')]('/:id/queues',auth[_0x5299('0xa')](),controller[_0x5299('0x5e')]);router['delete'](_0x5299('0x5f'),auth[_0x5299('0xa')](),controller[_0x5299('0x60')]);router[_0x5299('0x5d')]('/:id',auth[_0x5299('0xa')](),controller['destroy']);router[_0x5299('0x5d')](_0x5299('0x61'),auth[_0x5299('0xa')](),controller[_0x5299('0x62')]);router[_0x5299('0x5d')]('/:id/mail_interactions',auth[_0x5299('0xa')](),controller[_0x5299('0x63')]);router[_0x5299('0x5d')](_0x5299('0x4e'),auth[_0x5299('0xa')](),controller[_0x5299('0x64')]);router[_0x5299('0x5d')](_0x5299('0x50'),auth[_0x5299('0xa')](),controller['removeSmsInteractions']);router[_0x5299('0x5d')](_0x5299('0x65'),auth['isAuthenticated'](),controller[_0x5299('0x66')]);router[_0x5299('0x5d')]('/:id/whatsapp_interactions',auth['isAuthenticated'](),controller[_0x5299('0x67')]);router['delete']('/:id/fax_accounts',auth[_0x5299('0xa')](),controller['removeFaxAccounts']);router[_0x5299('0x5d')](_0x5299('0x2e'),auth[_0x5299('0xa')](),controller['removeMailAccounts']);router[_0x5299('0x5d')](_0x5299('0x30'),auth['isAuthenticated'](),controller[_0x5299('0x68')]);router['delete']('/:id/sms_accounts',auth[_0x5299('0xa')](),controller[_0x5299('0x69')]);router['delete'](_0x5299('0x6a'),auth[_0x5299('0xa')](),controller[_0x5299('0x6b')]);router[_0x5299('0x5d')]('/:id/whatsapp_accounts',auth['isAuthenticated'](),controller[_0x5299('0x6c')]);router['delete']('/:id/api_key',auth[_0x5299('0xa')](),controller[_0x5299('0x6d')]);router['post'](_0x5299('0x6e'),auth[_0x5299('0xa')](),controller[_0x5299('0x6f')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/user/user.attributes.js b/server/api/user/user.attributes.js index b7e8765..eb13ddd 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 _0xc1f5=['agent','telephone','local','accountcode','fullname','BOOLEAN','DEFAULT\x20PAUSE','DATE','INTEGER','dynamic','friend','peer','from-sip','ALLOWED_NOT_SCREENED','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB','udp','transport','join','split','rfc2833','info','inband','nonat','update','outgoing','yes','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','\x22\x22\x20<>','always','accept','refuse','originate','uac','uas','fingerprint','passive','actpass','TEXT','showWebBar','isArray','wss','encryption','icesupport','dtlsenable','dtlsverify','dtlssetup','dtlscertfile','dtlsprivatekey','/etc/pki/tls/private/motion.key','permissions','map','phoneBarEnableScreenRecordingByAgent','string','true','false','screenrecording','blocked','blockedAt','loginAttempts','sequelize','moment','util','exports','STRING','name','defaultuser','The\x20name\x20of\x20the\x20user','setDataValue','callerid','format','\x22%s\x22\x20<%s>','getDataValue','internal','email','toLowerCase','ENUM','admin','user'];(function(_0x14077b,_0x30e128){var _0x385b07=function(_0x29d8fd){while(--_0x29d8fd){_0x14077b['push'](_0x14077b['shift']());}};_0x385b07(++_0x30e128);}(_0xc1f5,0xf5));var _0x5c1f=function(_0x19c0ca,_0x42c424){_0x19c0ca=_0x19c0ca-0x0;var _0x30ea4=_0xc1f5[_0x19c0ca];return _0x30ea4;};'use strict';var Sequelize=require(_0x5c1f('0x0'));var moment=require(_0x5c1f('0x1'));var util=require(_0x5c1f('0x2'));var _=require('lodash');module[_0x5c1f('0x3')]={'name':{'type':Sequelize[_0x5c1f('0x4')],'allowNull':![],'unique':_0x5c1f('0x5'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x4461b0){this['setDataValue'](_0x5c1f('0x5'),_0x4461b0);this['setDataValue'](_0x5c1f('0x6'),_0x4461b0);},'comment':_0x5c1f('0x7')},'fullname':{'type':Sequelize[_0x5c1f('0x4')],'allowNull':![],'set':function(_0x126ec1){this[_0x5c1f('0x8')]('fullname',_0x126ec1);this[_0x5c1f('0x8')](_0x5c1f('0x9'),util[_0x5c1f('0xa')](_0x5c1f('0xb'),_0x126ec1,this[_0x5c1f('0xc')](_0x5c1f('0xd'))));}},'alias':{'type':Sequelize[_0x5c1f('0x4')]},'email':{'type':Sequelize[_0x5c1f('0x4')],'allowNull':![],'unique':_0x5c1f('0xe'),'validate':{'isEmail':!![]},'set':function(_0x2e9d07){if(_0x2e9d07){this[_0x5c1f('0x8')]('email',_0x2e9d07[_0x5c1f('0xf')]());}}},'role':{'type':Sequelize[_0x5c1f('0x10')](_0x5c1f('0x11'),_0x5c1f('0x12'),_0x5c1f('0x13'),_0x5c1f('0x14')),'allowNull':![]},'password':{'type':Sequelize[_0x5c1f('0x4')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0x5c1f('0x4')],'defaultValue':_0x5c1f('0x15')},'internal':{'type':Sequelize['INTEGER'](0xb),'allowNull':![],'unique':_0x5c1f('0xd'),'set':function(_0x3c4b11){this[_0x5c1f('0x8')](_0x5c1f('0xd'),_0x3c4b11);this[_0x5c1f('0x8')](_0x5c1f('0x16'),_0x3c4b11);this[_0x5c1f('0x8')](_0x5c1f('0x9'),util[_0x5c1f('0xa')](_0x5c1f('0xb'),this[_0x5c1f('0xc')](_0x5c1f('0x17')),_0x3c4b11));}},'salt':{'type':Sequelize[_0x5c1f('0x4')]},'phone':{'type':Sequelize[_0x5c1f('0x4')]},'mobile':{'type':Sequelize[_0x5c1f('0x4')]},'address':{'type':Sequelize[_0x5c1f('0x4')]},'zipcode':{'type':Sequelize[_0x5c1f('0x4')]},'userpic':{'type':Sequelize[_0x5c1f('0x4')]},'city':{'type':Sequelize[_0x5c1f('0x4')]},'country':{'type':Sequelize[_0x5c1f('0x4')]},'online':{'type':Sequelize[_0x5c1f('0x18')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize['DATE']},'voicePause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chatPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'mailPause':{'type':Sequelize[_0x5c1f('0x18')],'defaultValue':![]},'faxPause':{'type':Sequelize[_0x5c1f('0x18')],'defaultValue':![]},'smsPause':{'type':Sequelize[_0x5c1f('0x18')],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0x5c1f('0x18')],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0x5c1f('0x18')],'defaultValue':![]},'pauseType':{'type':Sequelize[_0x5c1f('0x4')],'defaultValue':_0x5c1f('0x19')},'lastPauseAt':{'type':Sequelize[_0x5c1f('0x1a')]},'chatCapacity':{'type':Sequelize[_0x5c1f('0x1b')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0x5c1f('0x1b')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0x5c1f('0x1b')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0x5c1f('0x1b')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0x5c1f('0x1b')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0x5c1f('0x18')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0x5c1f('0x18')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0x5c1f('0x1b')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0x5c1f('0x1b')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0x5c1f('0x18')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0x5c1f('0x1b')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0x5c1f('0x18')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chanspy':{'type':Sequelize[_0x5c1f('0x18')],'defaultValue':![]},'description':{'type':Sequelize[_0x5c1f('0x4')],'allowNull':!![]},'host':{'type':Sequelize[_0x5c1f('0x4')],'allowNull':!![],'defaultValue':_0x5c1f('0x1c')},'ipaddr':{'type':Sequelize['STRING'],'allowNull':!![]},'port':{'type':Sequelize[_0x5c1f('0x1b')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0x5c1f('0x1b')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0x5c1f('0x4')],'allowNull':!![]},'regserver':{'type':Sequelize[_0x5c1f('0x4')],'allowNull':!![]},'useragent':{'type':Sequelize[_0x5c1f('0x4')],'allowNull':!![]},'lastms':{'type':Sequelize[_0x5c1f('0x1b')](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0x5c1f('0x10')](_0x5c1f('0x1d'),_0x5c1f('0x12'),_0x5c1f('0x1e')),'allowNull':!![],'defaultValue':_0x5c1f('0x1d')},'context':{'type':Sequelize[_0x5c1f('0x4')],'allowNull':!![],'defaultValue':_0x5c1f('0x1f')},'callingpres':{'type':Sequelize[_0x5c1f('0x10')](_0x5c1f('0x20'),'ALLOWED_PASSED_SCREEN',_0x5c1f('0x21'),_0x5c1f('0x22'),_0x5c1f('0x23'),_0x5c1f('0x24'),'PROHIB_FAILED_SCREEN',_0x5c1f('0x25')),'allowNull':!![]},'deny':{'type':Sequelize['STRING'],'allowNull':!![]},'permit':{'type':Sequelize['STRING'],'allowNull':!![]},'secret':{'type':Sequelize[_0x5c1f('0x4')],'allowNull':!![]},'md5secret':{'type':Sequelize['STRING'],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0x5c1f('0x4')],'allowNull':!![]},'transport':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x5c1f('0x26'),'set':function(_0x149c01){this[_0x5c1f('0x8')](_0x5c1f('0x27'),_0x149c01?_0x149c01[_0x5c1f('0x28')](','):null);},'get':function(){return this['getDataValue'](_0x5c1f('0x27'))?this[_0x5c1f('0xc')](_0x5c1f('0x27'))[_0x5c1f('0x29')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]'},'dtmfmode':{'type':Sequelize['ENUM'](_0x5c1f('0x2a'),_0x5c1f('0x2b'),'shortinfo',_0x5c1f('0x2c'),'auto'),'allowNull':!![],'defaultValue':_0x5c1f('0x2a')},'directmedia':{'type':Sequelize['ENUM']('yes','no',_0x5c1f('0x2d'),_0x5c1f('0x2e'),_0x5c1f('0x2f')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x5c1f('0x10')](_0x5c1f('0x30'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize['STRING'],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0x5c1f('0x4')],'allowNull':!![]},'nat':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':'force_rport,comedia','set':function(_0xb9f775){this[_0x5c1f('0x8')](_0x5c1f('0x31'),_0xb9f775?_0xb9f775[_0x5c1f('0x28')](','):null);},'get':function(){return this['getDataValue'](_0x5c1f('0x31'))?this[_0x5c1f('0xc')](_0x5c1f('0x31'))['split'](','):null;},'comment':_0x5c1f('0x32')},'callgroup':{'type':Sequelize[_0x5c1f('0x4')]},'namedcallgroup':{'type':Sequelize[_0x5c1f('0x4')]},'pickupgroup':{'type':Sequelize[_0x5c1f('0x4')]},'namedpickupgroup':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x5c1f('0x4')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x5c1f('0x4')]},'disallow':{'type':Sequelize[_0x5c1f('0x4')],'allowNull':![],'defaultValue':'all'},'allow':{'type':Sequelize[_0x5c1f('0x4')],'allowNull':![],'defaultValue':_0x5c1f('0x33'),'set':function(_0x4b7be0){this[_0x5c1f('0x8')](_0x5c1f('0x34'),_0x4b7be0?_0x4b7be0[_0x5c1f('0x28')](';'):_0x5c1f('0x33'));},'get':function(){return this[_0x5c1f('0xc')](_0x5c1f('0x34'))?this[_0x5c1f('0xc')]('allow')[_0x5c1f('0x29')](';'):null;},'comment':_0x5c1f('0x35')},'autoframing':{'type':Sequelize[_0x5c1f('0x10')](_0x5c1f('0x30'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize['STRING'],'allowNull':!![],'set':function(_0x4202a1){this[_0x5c1f('0x8')](_0x5c1f('0x36'),_0x4202a1?_0x4202a1[_0x5c1f('0x28')](','):null);},'get':function(){return this['getDataValue'](_0x5c1f('0x36'))?this[_0x5c1f('0xc')](_0x5c1f('0x36'))[_0x5c1f('0x29')](','):null;},'comment':_0x5c1f('0x37')},'trustrpid':{'type':Sequelize[_0x5c1f('0x10')](_0x5c1f('0x30'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x5c1f('0x10')](_0x5c1f('0x30'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x5c1f('0x10')]('yes','no','never'),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0x5c1f('0x10')]('yes','no'),'allowNull':!![]},'useclientcode':{'type':Sequelize['ENUM'](_0x5c1f('0x30'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0x5c1f('0x1b')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0x5c1f('0x4')],'allowNull':!![]},'callerid':{'type':Sequelize[_0x5c1f('0x4')],'allowNull':!![],'defaultValue':_0x5c1f('0x38')},'amaflags':{'type':Sequelize[_0x5c1f('0x4')],'allowNull':!![]},'callcounter':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![],'defaultValue':_0x5c1f('0x30')},'busylevel':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0x5c1f('0x10')]('yes','no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize['ENUM'](_0x5c1f('0x30'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0x5c1f('0x10')](_0x5c1f('0x30'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0x5c1f('0x10')](_0x5c1f('0x30'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize['STRING'],'allowNull':!![]},'template':{'type':Sequelize[_0x5c1f('0x4')],'allowNull':!![]},'videosupport':{'type':Sequelize[_0x5c1f('0x10')](_0x5c1f('0x30'),'no',_0x5c1f('0x39')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x5c1f('0x1b')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize['ENUM'](_0x5c1f('0x30'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0x5c1f('0x4')],'allowNull':!![]},'session_timers':{'type':Sequelize[_0x5c1f('0x10')](_0x5c1f('0x3a'),_0x5c1f('0x3b'),_0x5c1f('0x3c')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0x5c1f('0x1b')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0x5c1f('0x1b')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0x5c1f('0x10')](_0x5c1f('0x3d'),_0x5c1f('0x3e')),'allowNull':!![],'defaultValue':_0x5c1f('0x3e')},'t38pt_usertpsource':{'type':Sequelize[_0x5c1f('0x4')],'allowNull':!![]},'regexten':{'type':Sequelize[_0x5c1f('0x4')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0x5c1f('0x4')],'allowNull':!![]},'fromuser':{'type':Sequelize['STRING'],'allowNull':!![]},'qualify':{'type':Sequelize['ENUM'](_0x5c1f('0x30'),'no'),'allowNull':!![],'defaultValue':_0x5c1f('0x30')},'keepalive':{'type':Sequelize[_0x5c1f('0x1b')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize['STRING'],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0x5c1f('0x4')],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0x5c1f('0x1b')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0x5c1f('0x10')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x5c1f('0x4')],'allowNull':!![]},'callbackextension':{'type':Sequelize['STRING'],'allowNull':!![]},'timert1':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'timerb':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0x5c1f('0x1b')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0x5c1f('0x4')],'allowNull':!![]},'contactdeny':{'type':Sequelize['STRING'],'allowNull':!![]},'contactacl':{'type':Sequelize[_0x5c1f('0x4')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0x5c1f('0x4')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0x5c1f('0x4')],'allowNull':!![]},'maxforwards':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0x5c1f('0x10')](_0x5c1f('0x30'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize['ENUM'](_0x5c1f('0x30'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0x5c1f('0x10')](_0x5c1f('0x30'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0x5c1f('0x10')](_0x5c1f('0x30'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0x5c1f('0x10')](_0x5c1f('0x30'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize['ENUM'](_0x5c1f('0x30'),'no',_0x5c1f('0x3f'),'certificate'),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0x5c1f('0x1b')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0x5c1f('0x4')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0x5c1f('0x4')],'allowNull':!![]},'dtlscafile':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0x5c1f('0x4')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0x5c1f('0x10')]('active',_0x5c1f('0x40'),_0x5c1f('0x41')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x5c1f('0x4')],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0x5c1f('0x10')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x5c1f('0x4')],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0x5c1f('0x4')],'allowNull':!![]},'call_limit':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0x5c1f('0x10')](_0x5c1f('0x30'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0x5c1f('0x10')](_0x5c1f('0x30'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0x5c1f('0x4')],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0x5c1f('0x4')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0x5c1f('0x4')],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0x5c1f('0x4')],'allowNull':!![]},'canreinvite':{'type':Sequelize['ENUM'](_0x5c1f('0x30'),'no',_0x5c1f('0x2d'),_0x5c1f('0x2e'),'update,nonat'),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0x5c1f('0x18')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0x5c1f('0x4')]},'resetPasswordExpires':{'type':Sequelize[_0x5c1f('0x1a')]},'passwordResetAt':{'type':Sequelize[_0x5c1f('0x1a')],'defaultValue':null},'previousPasswords':{'type':Sequelize[_0x5c1f('0x42')]},'showWebBar':{'type':Sequelize['INTEGER'],'defaultValue':0x0,'set':function(_0x44121d){this[_0x5c1f('0x8')](_0x5c1f('0x43'),_0x44121d);var _0x3e75ce=this['get']({'plain':!![]});switch(_0x44121d){case 0x0:case 0x1:var _0x21d0ee=_0x3e75ce[_0x5c1f('0x27')]?_[_0x5c1f('0x44')](_0x3e75ce[_0x5c1f('0x27')])?_0x3e75ce[_0x5c1f('0x27')]['join']():_0x3e75ce[_0x5c1f('0x27')]:'udp';if(_0x21d0ee===_0x5c1f('0x45')){_0x21d0ee=_0x5c1f('0x26');}this[_0x5c1f('0x8')](_0x5c1f('0x27'),_0x21d0ee);this[_0x5c1f('0x8')](_0x5c1f('0x46'),'no');this[_0x5c1f('0x8')]('avpf',null);this[_0x5c1f('0x8')]('force_avp',null);this[_0x5c1f('0x8')](_0x5c1f('0x47'),null);this['setDataValue'](_0x5c1f('0x48'),null);this[_0x5c1f('0x8')](_0x5c1f('0x49'),null);this[_0x5c1f('0x8')](_0x5c1f('0x4a'),null);this[_0x5c1f('0x8')](_0x5c1f('0x4b'),null);this[_0x5c1f('0x8')](_0x5c1f('0x4c'),null);this[_0x5c1f('0x8')]('rtcp_mux','no');break;case 0x2:this[_0x5c1f('0x8')](_0x5c1f('0x27'),_0x5c1f('0x45'));this['setDataValue'](_0x5c1f('0x46'),_0x5c1f('0x30'));this[_0x5c1f('0x8')]('avpf',_0x5c1f('0x30'));this[_0x5c1f('0x8')]('force_avp',_0x5c1f('0x30'));this[_0x5c1f('0x8')](_0x5c1f('0x47'),_0x5c1f('0x30'));this['setDataValue'](_0x5c1f('0x48'),_0x5c1f('0x30'));this['setDataValue']('dtlsverify','no');this[_0x5c1f('0x8')]('dtlssetup','actpass');this[_0x5c1f('0x8')](_0x5c1f('0x4b'),_0x3e75ce[_0x5c1f('0x4b')]||'/etc/pki/tls/certs/motion.crt');this[_0x5c1f('0x8')](_0x5c1f('0x4c'),_0x3e75ce[_0x5c1f('0x4c')]||_0x5c1f('0x4d'));this[_0x5c1f('0x8')]('rtcp_mux',_0x5c1f('0x30'));break;default:}}},'permissions':{'type':Sequelize[_0x5c1f('0x42')],'set':function(_0x59557b){this[_0x5c1f('0x8')](_0x5c1f('0x4e'),_0x59557b?_0x59557b[_0x5c1f('0x28')](','):[]);},'get':function(){return this[_0x5c1f('0xc')](_0x5c1f('0x4e'))?_[_0x5c1f('0x4f')](this[_0x5c1f('0xc')](_0x5c1f('0x4e'))[_0x5c1f('0x29')](','),function(_0x327cd6){return parseInt(_0x327cd6,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0x5c1f('0x4')]},'phoneBarNoReplyNumber':{'type':Sequelize[_0x5c1f('0x4')]},'phoneBarBusyNumber':{'type':Sequelize[_0x5c1f('0x4')]},'phoneBarUnconditional':{'type':Sequelize[_0x5c1f('0x18')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0x5c1f('0x18')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0x5c1f('0x18')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0x5c1f('0x18')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0x5c1f('0x4')],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0x5c1f('0x1b')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0x5c1f('0x10')](_0x5c1f('0x30'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0x5c1f('0x18')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0x5c1f('0x4')]},'phoneBarEnableJaws':{'type':Sequelize[_0x5c1f('0x18')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0x5c1f('0x18')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x5c1f('0xc')](_0x5c1f('0x50'))?this[_0x5c1f('0xc')](_0x5c1f('0x50')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0x5c1f('0x18')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0x5c1f('0x18')],'defaultValue':![]},'hotdesk':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'interface':{'type':Sequelize['STRING'],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0x5c1f('0x18')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0x5c1f('0x4')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0x5c1f('0x4')],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0x5c1f('0x18')],'defaultValue':![],'set':function(_0xfe4bec){if(typeof _0xfe4bec===_0x5c1f('0x51')){var _0x99b96e=_0xfe4bec==='1'?!![]:_0xfe4bec==='0'?![]:_0xfe4bec===_0x5c1f('0x52')?!![]:_0xfe4bec===_0x5c1f('0x53')?![]:![];this[_0x5c1f('0x8')]('screenrecording',_0x99b96e);}else{this['setDataValue'](_0x5c1f('0x54'),_0xfe4bec);}}},'blocked':{'type':Sequelize[_0x5c1f('0x18')],'defaultValue':![],'set':function(_0x2eb834){this[_0x5c1f('0x8')](_0x5c1f('0x55'),_0x2eb834);if(_0x2eb834===!![]){this[_0x5c1f('0x8')](_0x5c1f('0x56'),moment());this[_0x5c1f('0x8')](_0x5c1f('0x57'),0x0);}else{this['setDataValue'](_0x5c1f('0x56'),null);}}},'blockedAt':{'type':Sequelize[_0x5c1f('0x1a')],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0x5c1f('0x1b')],'defaultValue':0x0},'disabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'settingsEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0x5c1f('0x1b')](0x5)['UNSIGNED'],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x5c1f('0x18')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x5c1f('0x18')],'defaultValue':!![]},'ignorePauseForPreviewCalls':{'type':Sequelize[_0x5c1f('0x18')],'defaultValue':![]},'selectRecallMeCampaign':{'type':Sequelize[_0x5c1f('0x18')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0x5c1f('0x18')],'defaultValue':![]},'chatAutoanswer':{'type':Sequelize[_0x5c1f('0x18')],'defaultValue':![]},'chatAutoanswerDelay':{'type':Sequelize[_0x5c1f('0x1b')],'defaultValue':0x0},'emailAutoanswer':{'type':Sequelize[_0x5c1f('0x18')],'defaultValue':![]},'emailAutoanswerDelay':{'type':Sequelize[_0x5c1f('0x1b')],'defaultValue':0x0},'smsAutoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'smsAutoanswerDelay':{'type':Sequelize[_0x5c1f('0x1b')],'defaultValue':0x0},'openchannelAutoanswer':{'type':Sequelize[_0x5c1f('0x18')],'defaultValue':![]},'openchannelAutoanswerDelay':{'type':Sequelize[_0x5c1f('0x1b')],'defaultValue':0x0},'faxAutoanswer':{'type':Sequelize[_0x5c1f('0x18')],'defaultValue':![]},'faxAutoanswerDelay':{'type':Sequelize[_0x5c1f('0x1b')],'defaultValue':0x0},'whatsappAutoanswer':{'type':Sequelize[_0x5c1f('0x18')],'defaultValue':![]},'whatsappAutoanswerDelay':{'type':Sequelize[_0x5c1f('0x1b')],'defaultValue':0x0},'messengerSoundNotification':{'type':Sequelize[_0x5c1f('0x18')],'defaultValue':![]}}; \ No newline at end of file +var _0x538c=['split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','inband','auto','yes','nonat','outgoing','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]','insecure','\x22\x22\x20<>','accept','refuse','originate','uac','uas','certificate','active','passive','actpass','update,nonat','TEXT','showWebBar','get','wss','encryption','avpf','dtlsenable','dtlsverify','dtlssetup','dtlscertfile','dtlsprivatekey','rtcp_mux','force_avp','icesupport','permissions','VIRTUAL','string','false','screenrecording','blocked','blockedAt','UNSIGNED','sequelize','util','lodash','STRING','name','setDataValue','The\x20name\x20of\x20the\x20user','fullname','format','\x22%s\x22\x20<%s>','getDataValue','internal','email','toLowerCase','user','agent','telephone','local','INTEGER','accountcode','callerid','BOOLEAN','DEFAULT\x20PAUSE','DATE','dynamic','peer','friend','from-sip','ENUM','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB','udp','transport','join'];(function(_0x409f7e,_0x265f1e){var _0x3225ba=function(_0x276c5c){while(--_0x276c5c){_0x409f7e['push'](_0x409f7e['shift']());}};_0x3225ba(++_0x265f1e);}(_0x538c,0xdd));var _0xc538=function(_0x3db806,_0x19b4db){_0x3db806=_0x3db806-0x0;var _0x9b8cbd=_0x538c[_0x3db806];return _0x9b8cbd;};'use strict';var Sequelize=require(_0xc538('0x0'));var moment=require('moment');var util=require(_0xc538('0x1'));var _=require(_0xc538('0x2'));module['exports']={'name':{'type':Sequelize[_0xc538('0x3')],'allowNull':![],'unique':_0xc538('0x4'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x41ddcb){this[_0xc538('0x5')](_0xc538('0x4'),_0x41ddcb);this[_0xc538('0x5')]('defaultuser',_0x41ddcb);},'comment':_0xc538('0x6')},'fullname':{'type':Sequelize['STRING'],'allowNull':![],'set':function(_0x4596aa){this[_0xc538('0x5')](_0xc538('0x7'),_0x4596aa);this[_0xc538('0x5')]('callerid',util[_0xc538('0x8')](_0xc538('0x9'),_0x4596aa,this[_0xc538('0xa')](_0xc538('0xb'))));}},'alias':{'type':Sequelize[_0xc538('0x3')]},'email':{'type':Sequelize[_0xc538('0x3')],'allowNull':![],'unique':'email','validate':{'isEmail':!![]},'set':function(_0x5c9531){if(_0x5c9531){this['setDataValue'](_0xc538('0xc'),_0x5c9531[_0xc538('0xd')]());}}},'role':{'type':Sequelize['ENUM']('admin',_0xc538('0xe'),_0xc538('0xf'),_0xc538('0x10')),'allowNull':![]},'password':{'type':Sequelize[_0xc538('0x3')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0xc538('0x3')],'defaultValue':_0xc538('0x11')},'internal':{'type':Sequelize[_0xc538('0x12')](0xb),'allowNull':![],'unique':_0xc538('0xb'),'set':function(_0x3ca532){this['setDataValue']('internal',_0x3ca532);this[_0xc538('0x5')](_0xc538('0x13'),_0x3ca532);this[_0xc538('0x5')](_0xc538('0x14'),util[_0xc538('0x8')](_0xc538('0x9'),this[_0xc538('0xa')](_0xc538('0x7')),_0x3ca532));}},'salt':{'type':Sequelize[_0xc538('0x3')]},'phone':{'type':Sequelize[_0xc538('0x3')]},'mobile':{'type':Sequelize[_0xc538('0x3')]},'address':{'type':Sequelize['STRING']},'zipcode':{'type':Sequelize[_0xc538('0x3')]},'userpic':{'type':Sequelize[_0xc538('0x3')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0xc538('0x3')]},'online':{'type':Sequelize[_0xc538('0x15')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize['DATE']},'voicePause':{'type':Sequelize[_0xc538('0x15')],'defaultValue':![]},'chatPause':{'type':Sequelize[_0xc538('0x15')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0xc538('0x15')],'defaultValue':![]},'faxPause':{'type':Sequelize[_0xc538('0x15')],'defaultValue':![]},'smsPause':{'type':Sequelize[_0xc538('0x15')],'defaultValue':![]},'whatsappPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'openchannelPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'pauseType':{'type':Sequelize[_0xc538('0x3')],'defaultValue':_0xc538('0x16')},'lastPauseAt':{'type':Sequelize[_0xc538('0x17')]},'chatCapacity':{'type':Sequelize[_0xc538('0x12')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0xc538('0x12')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0xc538('0x12')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0xc538('0x12')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0xc538('0x12')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0xc538('0x15')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0xc538('0x15')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0xc538('0x12')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0xc538('0x12')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0xc538('0x15')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0xc538('0x12')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0xc538('0x15')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0xc538('0x15')],'defaultValue':![]},'chanspy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'host':{'type':Sequelize[_0xc538('0x3')],'allowNull':!![],'defaultValue':_0xc538('0x18')},'ipaddr':{'type':Sequelize[_0xc538('0x3')],'allowNull':!![]},'port':{'type':Sequelize[_0xc538('0x12')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize['STRING'],'allowNull':!![]},'regserver':{'type':Sequelize['STRING'],'allowNull':!![]},'useragent':{'type':Sequelize[_0xc538('0x3')],'allowNull':!![]},'lastms':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'type':{'type':Sequelize['ENUM']('friend',_0xc538('0xe'),_0xc538('0x19')),'allowNull':!![],'defaultValue':_0xc538('0x1a')},'context':{'type':Sequelize[_0xc538('0x3')],'allowNull':!![],'defaultValue':_0xc538('0x1b')},'callingpres':{'type':Sequelize[_0xc538('0x1c')](_0xc538('0x1d'),_0xc538('0x1e'),'ALLOWED_FAILED_SCREEN',_0xc538('0x1f'),_0xc538('0x20'),'PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN',_0xc538('0x21')),'allowNull':!![]},'deny':{'type':Sequelize[_0xc538('0x3')],'allowNull':!![]},'permit':{'type':Sequelize[_0xc538('0x3')],'allowNull':!![]},'secret':{'type':Sequelize[_0xc538('0x3')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0xc538('0x3')],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0xc538('0x3')],'allowNull':!![]},'transport':{'type':Sequelize[_0xc538('0x3')],'allowNull':!![],'defaultValue':_0xc538('0x22'),'set':function(_0x266d32){this[_0xc538('0x5')](_0xc538('0x23'),_0x266d32?_0x266d32[_0xc538('0x24')](','):null);},'get':function(){return this['getDataValue'](_0xc538('0x23'))?this[_0xc538('0xa')](_0xc538('0x23'))[_0xc538('0x25')](','):null;},'comment':_0xc538('0x26')},'dtmfmode':{'type':Sequelize[_0xc538('0x1c')](_0xc538('0x27'),_0xc538('0x28'),_0xc538('0x29'),_0xc538('0x2a'),_0xc538('0x2b')),'allowNull':!![],'defaultValue':_0xc538('0x27')},'directmedia':{'type':Sequelize[_0xc538('0x1c')](_0xc538('0x2c'),'no',_0xc538('0x2d'),'update',_0xc538('0x2e')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0xc538('0x1c')](_0xc538('0x2c'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0xc538('0x3')],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0xc538('0x3')],'allowNull':!![]},'nat':{'type':Sequelize[_0xc538('0x3')],'allowNull':!![],'defaultValue':'force_rport,comedia','set':function(_0x3f377b){this[_0xc538('0x5')](_0xc538('0x2f'),_0x3f377b?_0x3f377b['join'](','):null);},'get':function(){return this[_0xc538('0xa')](_0xc538('0x2f'))?this['getDataValue'](_0xc538('0x2f'))['split'](','):null;},'comment':_0xc538('0x30')},'callgroup':{'type':Sequelize[_0xc538('0x3')]},'namedcallgroup':{'type':Sequelize['STRING']},'pickupgroup':{'type':Sequelize[_0xc538('0x3')]},'namedpickupgroup':{'type':Sequelize[_0xc538('0x3')]},'language':{'type':Sequelize[_0xc538('0x3')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0xc538('0x3')]},'disallow':{'type':Sequelize[_0xc538('0x3')],'allowNull':![],'defaultValue':'all'},'allow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xc538('0x31'),'set':function(_0x292dcf){this[_0xc538('0x5')](_0xc538('0x32'),_0x292dcf?_0x292dcf[_0xc538('0x24')](';'):_0xc538('0x31'));},'get':function(){return this[_0xc538('0xa')](_0xc538('0x32'))?this[_0xc538('0xa')](_0xc538('0x32'))[_0xc538('0x25')](';'):null;},'comment':_0xc538('0x33')},'autoframing':{'type':Sequelize[_0xc538('0x1c')](_0xc538('0x2c'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize['STRING'],'allowNull':!![],'set':function(_0x2a9fc5){this['setDataValue'](_0xc538('0x34'),_0x2a9fc5?_0x2a9fc5[_0xc538('0x24')](','):null);},'get':function(){return this[_0xc538('0xa')](_0xc538('0x34'))?this[_0xc538('0xa')](_0xc538('0x34'))[_0xc538('0x25')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]'},'trustrpid':{'type':Sequelize[_0xc538('0x1c')](_0xc538('0x2c'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0xc538('0x1c')](_0xc538('0x2c'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize['ENUM'](_0xc538('0x2c'),'no','never'),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0xc538('0x1c')](_0xc538('0x2c'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0xc538('0x1c')](_0xc538('0x2c'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0xc538('0x12')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0xc538('0x3')],'allowNull':!![]},'callerid':{'type':Sequelize[_0xc538('0x3')],'allowNull':!![],'defaultValue':_0xc538('0x35')},'amaflags':{'type':Sequelize[_0xc538('0x3')],'allowNull':!![]},'callcounter':{'type':Sequelize[_0xc538('0x1c')](_0xc538('0x2c'),'no'),'allowNull':!![],'defaultValue':_0xc538('0x2c')},'busylevel':{'type':Sequelize[_0xc538('0x12')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0xc538('0x1c')](_0xc538('0x2c'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize['ENUM'](_0xc538('0x2c'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize['ENUM'](_0xc538('0x2c'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize['STRING'],'allowNull':!![]},'template':{'type':Sequelize[_0xc538('0x3')],'allowNull':!![]},'videosupport':{'type':Sequelize['ENUM'](_0xc538('0x2c'),'no','always'),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0xc538('0x12')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0xc538('0x1c')](_0xc538('0x2c'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0xc538('0x3')],'allowNull':!![]},'session_timers':{'type':Sequelize['ENUM'](_0xc538('0x36'),_0xc538('0x37'),_0xc538('0x38')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0xc538('0x12')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0xc538('0x12')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0xc538('0x1c')](_0xc538('0x39'),_0xc538('0x3a')),'allowNull':!![],'defaultValue':'uas'},'t38pt_usertpsource':{'type':Sequelize[_0xc538('0x3')],'allowNull':!![]},'regexten':{'type':Sequelize[_0xc538('0x3')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0xc538('0x3')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0xc538('0x3')],'allowNull':!![]},'qualify':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![],'defaultValue':_0xc538('0x2c')},'keepalive':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0xc538('0x3')],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0xc538('0x3')],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0xc538('0x12')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0xc538('0x12')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0xc538('0x12')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0xc538('0x1c')](_0xc538('0x2c'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0xc538('0x3')],'allowNull':!![]},'callbackextension':{'type':Sequelize['STRING'],'allowNull':!![]},'timert1':{'type':Sequelize[_0xc538('0x12')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0xc538('0x3')],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0xc538('0x3')],'allowNull':!![]},'contactacl':{'type':Sequelize['STRING'],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0xc538('0x3')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0xc538('0x3')],'allowNull':!![]},'maxforwards':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0xc538('0x1c')](_0xc538('0x2c'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize['ENUM'](_0xc538('0x2c'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0xc538('0x1c')](_0xc538('0x2c'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0xc538('0x1c')](_0xc538('0x2c'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize['ENUM'](_0xc538('0x2c'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0xc538('0x1c')](_0xc538('0x2c'),'no','fingerprint',_0xc538('0x3b')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0xc538('0x12')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0xc538('0x3')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0xc538('0x3')],'allowNull':!![]},'dtlscafile':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscapath':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0xc538('0x1c')](_0xc538('0x3c'),_0xc538('0x3d'),_0xc538('0x3e')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize['STRING'],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0xc538('0x1c')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0xc538('0x3')],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0xc538('0x3')],'allowNull':!![]},'call_limit':{'type':Sequelize[_0xc538('0x12')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0xc538('0x1c')]('yes','no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0xc538('0x3')],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0xc538('0x3')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0xc538('0x3')],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0xc538('0x3')],'allowNull':!![]},'canreinvite':{'type':Sequelize['ENUM'](_0xc538('0x2c'),'no',_0xc538('0x2d'),'update',_0xc538('0x3f')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0xc538('0x15')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0xc538('0x3')]},'resetPasswordExpires':{'type':Sequelize[_0xc538('0x17')]},'passwordResetAt':{'type':Sequelize[_0xc538('0x17')],'defaultValue':null},'previousPasswords':{'type':Sequelize[_0xc538('0x40')]},'showWebBar':{'type':Sequelize[_0xc538('0x12')],'defaultValue':0x0,'set':function(_0x2d1464){this[_0xc538('0x5')](_0xc538('0x41'),_0x2d1464);var _0xd42e0a=this[_0xc538('0x42')]({'plain':!![]});switch(_0x2d1464){case 0x0:case 0x1:var _0x38c752=_0xd42e0a[_0xc538('0x23')]?_['isArray'](_0xd42e0a[_0xc538('0x23')])?_0xd42e0a[_0xc538('0x23')]['join']():_0xd42e0a[_0xc538('0x23')]:'udp';if(_0x38c752===_0xc538('0x43')){_0x38c752='udp';}this[_0xc538('0x5')](_0xc538('0x23'),_0x38c752);this[_0xc538('0x5')](_0xc538('0x44'),'no');this[_0xc538('0x5')](_0xc538('0x45'),null);this[_0xc538('0x5')]('force_avp',null);this[_0xc538('0x5')]('icesupport',null);this[_0xc538('0x5')](_0xc538('0x46'),null);this['setDataValue'](_0xc538('0x47'),null);this['setDataValue'](_0xc538('0x48'),null);this[_0xc538('0x5')](_0xc538('0x49'),null);this['setDataValue'](_0xc538('0x4a'),null);this[_0xc538('0x5')](_0xc538('0x4b'),'no');break;case 0x2:this[_0xc538('0x5')](_0xc538('0x23'),_0xc538('0x43'));this[_0xc538('0x5')](_0xc538('0x44'),_0xc538('0x2c'));this['setDataValue'](_0xc538('0x45'),_0xc538('0x2c'));this['setDataValue'](_0xc538('0x4c'),_0xc538('0x2c'));this[_0xc538('0x5')](_0xc538('0x4d'),'yes');this[_0xc538('0x5')](_0xc538('0x46'),_0xc538('0x2c'));this[_0xc538('0x5')](_0xc538('0x47'),'no');this[_0xc538('0x5')]('dtlssetup',_0xc538('0x3e'));this[_0xc538('0x5')](_0xc538('0x49'),_0xd42e0a[_0xc538('0x49')]||'/etc/pki/tls/certs/motion.crt');this[_0xc538('0x5')](_0xc538('0x4a'),_0xd42e0a[_0xc538('0x4a')]||'/etc/pki/tls/private/motion.key');this[_0xc538('0x5')](_0xc538('0x4b'),_0xc538('0x2c'));break;default:}}},'permissions':{'type':Sequelize[_0xc538('0x40')],'set':function(_0x5f226d){this['setDataValue'](_0xc538('0x4e'),_0x5f226d?_0x5f226d['join'](','):[]);},'get':function(){return this[_0xc538('0xa')](_0xc538('0x4e'))?_['map'](this[_0xc538('0xa')]('permissions')['split'](','),function(_0x37924e){return parseInt(_0x37924e,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0xc538('0x3')]},'phoneBarNoReplyNumber':{'type':Sequelize[_0xc538('0x3')]},'phoneBarBusyNumber':{'type':Sequelize[_0xc538('0x3')]},'phoneBarUnconditional':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0xc538('0x15')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0xc538('0x15')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0xc538('0x15')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0xc538('0x15')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0xc538('0x12')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0xc538('0x3')],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0xc538('0x12')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0xc538('0x1c')](_0xc538('0x2c'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0xc538('0x15')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0xc538('0x3')]},'phoneBarEnableJaws':{'type':Sequelize[_0xc538('0x15')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0xc538('0x15')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0xc538('0x4f')],'get':function(){return this[_0xc538('0xa')]('phoneBarEnableScreenRecordingByAgent')?this[_0xc538('0xa')]('phoneBarEnableScreenRecordingByAgent'):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0xc538('0x15')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0xc538('0x15')],'defaultValue':![]},'interface':{'type':Sequelize[_0xc538('0x3')],'defaultValue':null},'privacyEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize['STRING'],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0xc538('0x3')],'allowNull':!![]},'screenrecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'set':function(_0x15f2a0){if(typeof _0x15f2a0===_0xc538('0x50')){var _0xae848d=_0x15f2a0==='1'?!![]:_0x15f2a0==='0'?![]:_0x15f2a0==='true'?!![]:_0x15f2a0===_0xc538('0x51')?![]:![];this['setDataValue'](_0xc538('0x52'),_0xae848d);}else{this['setDataValue'](_0xc538('0x52'),_0x15f2a0);}}},'blocked':{'type':Sequelize[_0xc538('0x15')],'defaultValue':![],'set':function(_0x209d70){this[_0xc538('0x5')](_0xc538('0x53'),_0x209d70);if(_0x209d70===!![]){this['setDataValue'](_0xc538('0x54'),moment());this[_0xc538('0x5')]('loginAttempts',0x0);}else{this['setDataValue'](_0xc538('0x54'),null);}}},'blockedAt':{'type':Sequelize['DATE'],'defaultValue':null},'loginAttempts':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'disabled':{'type':Sequelize[_0xc538('0x15')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'wssPort':{'type':Sequelize['INTEGER'](0x5)[_0xc538('0x55')],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize[_0xc538('0x15')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'ignorePauseForPreviewCalls':{'type':Sequelize[_0xc538('0x15')],'defaultValue':![]},'selectRecallMeCampaign':{'type':Sequelize[_0xc538('0x15')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0xc538('0x15')],'defaultValue':![]},'chatAutoanswer':{'type':Sequelize[_0xc538('0x15')],'defaultValue':![]},'chatAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'emailAutoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'emailAutoanswerDelay':{'type':Sequelize[_0xc538('0x12')],'defaultValue':0x0},'smsAutoanswer':{'type':Sequelize[_0xc538('0x15')],'defaultValue':![]},'smsAutoanswerDelay':{'type':Sequelize[_0xc538('0x12')],'defaultValue':0x0},'openchannelAutoanswer':{'type':Sequelize[_0xc538('0x15')],'defaultValue':![]},'openchannelAutoanswerDelay':{'type':Sequelize[_0xc538('0x12')],'defaultValue':0x0},'faxAutoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'faxAutoanswerDelay':{'type':Sequelize[_0xc538('0x12')],'defaultValue':0x0},'whatsappAutoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'whatsappAutoanswerDelay':{'type':Sequelize[_0xc538('0x12')],'defaultValue':0x0},'messengerSoundNotification':{'type':Sequelize[_0xc538('0x15')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/user/user.controller.js b/server/api/user/user.controller.js index e5ebfb5..84b4c8e 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 _0x4081=['chatPause','faxPause','whatsappPause','pauseType','getTeams','Team','resolve','Body\x20parameter\x20\x27ids\x27\x20is\x20required','transaction','addTeams','getAssociatedQueues','flattenDeep','addAgent','getDataValue','Voice','TeamVoicePrefix','UserVoicePrefix','VoicePrefixId','Queue:save','removeTeams','Query\x20parameter\x20\x27ids\x27\x20is\x20required','removeAgent','getLists','CmList','getAgents','values','You\x20can\x27t\x20delete\x20yourself','addChatInteractions','user_has_chat_interactions:save','removeChatInteractions','user_has_chat_interactions:remove','addMailInteractions','removeMailInteractions','user_has_mail_interactions:remove','addFaxInteractions','user_has_fax_interactions:save','removeFaxInteractions','user_has_fax_interactions:remove','addSmsInteractions','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','getFaxAccounts','removeFaxAccounts','getMailAccounts','addMailAccounts','removeMailAccounts','getOpenchannelAccounts','OpenchannelAccount','addOpenchannelAccounts','removeOpenchannelAccounts','getSmsAccounts','SmsAccount','addSmsAccounts','removeSmsAccounts','getChatWebsites','ChatWebsite','addChatWebsites','removeChatWebsites','getWhatsappAccounts','WhatsappAccount','addWhatsappAccounts','removeWhatsappAccounts','getScheduledCalls','$and','$or','$gt','$gte','$lt','$lte','$not','$between','$in','$like','$notLike','$iLike','$notILike','$overlap','$contains','CmHopper','firstName','CmContact','Contact','getApiKey','token','No\x20API\x20access\x20key\x20found!','You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.','createApiKey','iat','nonce','apiKeyNonce','API\x20key\x20not\x20available','whoami','Unable\x20to\x20retrieve\x20the\x20current\x20user','getUserSetting','getPresence','idle','unknown','ringing','teams','queues','inbound','toString','lower','col','asc','substring','uniqBy','orderBy','getRealtimeAgents','offline','voiceStatus','unavailable','busy','slice','charAt','toUpperCase','select','field','ui.','InteractionId','ui.createdAt','user_has_','ui.UserId\x20=\x20?','OpenTabs','messengerSoundNotification','enabled','moment','path','lodash','squel','ioredis','../../components/contacts','../../components/parsers/qs','../../components/realtime/agents','../../config/logger','api','APIBadRequestError','../../errors/api','APINotFoundError','../../mysqldb','socket.io-emitter','redis','./user.socket','defaults','localhost','status','end','json','offset','count','limit','set','Content-Range','update','role','agent','emit','userNotification:recalc:','destroy','get','admin','Agents','Telephones','telephone','filter','ignore','map','value','includes','find','name','UserProfileResource','then','sendStatus','error','send','rawAttributes','fieldName','type','key','password','salt','previousPasswords','resetPasswordToken','resetPasswordExpires','md5secret','index','where','User','includeAll','include','query','userSetting','UserSetting','attributes','push','findAll','openTabs','true','rows','chat','dataValues','fax','mail','openchannel','whatsapp','all','catch','show','getOptions','merge','sms','body','params','describe','addContacts','ids','omit','internal','Setting','findById','validatePasswordPattern','max','isNil','min_internal','sequelize','QueryTypes','SELECT','length','from','voicemail','mailbox','VoiceMail','fullname','email','permissions','101','102','103','113','110','104','107','108','111','114','115','create','user','Unauthorized','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20another\x20administrator','settingsEnabled','userProfileId','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','bulkCreate','some','isEmpty','autoAssociation','compact','changePassword','oldPassword','newPassword','Sequelize','ValidationError','authenticate','Wrong\x20credentials','New\x20password\x20must\x20be\x20different\x20from\x20old\x20password','Invalid\x20body\x20format.\x20Use\x20newPassword','findOne','securePassword','enforcePasswordHistory','passwordHistoryLimit','updatePasswordsHistory','channel','online','loginInPause','voicePause','interface','Unknown\x20channel','add','capitalize','toLowerCase','Queues','penalty','spread','voice','VoiceQueue','format','UserVoiceQueueRt','upsert','removeQueues','remove','isArray','Queue:remove','QueueId','addAvatar','userpic','filename','getAvatar','join','root','server/files/images/logos/default_profile.png','existsSync','server/files/images/','download','ChatOpenTabs','CHAT','FAX','createdAt','MAIL','SmsOpenTabs','SMS','WhatsappOpenTabs','WHATSAPP','concat','getContacts','User\x20with\x20id\x20%s\x20not\x20found','hasOwnProperty','List','Tag','Tags','tag','getQueues','model','Queue','intersection','fields','sort','filters','options','Unknown\x20role','nolimit','keys','order','pick','getVoiceQueuesRt','getGroups','ChatGroup','getRecordings','VoiceRecording','ScreenRecording','UserId','getChatInteractions','ChatInteraction','getOpenchannelInteractions','OpenchannelInteraction','getMailInteractions','MailInteraction','getSmsInteractions','SmsInteraction','getFaxInteractions','getWhatsappInteractions','WhatsappInteraction','login','phone','LOCAL/%s@from-sip/n','intrf','SIP/%s','user:%s','user:forcelogout','x-forwarded-for','remoteAddress','socket','connection','getVoiceQueues','UserVoiceQueue.penalty','forEach','YYYY-MM-DD\x20HH:mm:ss','LOGIN','device','PAUSE','MemberReport','LOGININPAUSE','logout','pause','updateAttributes','getChannels','DEFAULT\x20PAUSE','unpause','isValidChannel'];(function(_0x366878,_0x5880ae){var _0x3aa6c8=function(_0x1bf68e){while(--_0x1bf68e){_0x366878['push'](_0x366878['shift']());}};_0x3aa6c8(++_0x5880ae);}(_0x4081,0x86));var _0x1408=function(_0xc40ef7,_0x1c4d0b){_0xc40ef7=_0xc40ef7-0x0;var _0x39dccd=_0x4081[_0xc40ef7];return _0x39dccd;};'use strict';var moment=require(_0x1408('0x0'));var util=require('util');var path=require(_0x1408('0x1'));var fs=require('fs');var _=require(_0x1408('0x2'));var squel=require(_0x1408('0x3'));var Redis=require(_0x1408('0x4'));var authService=require('../../components/auth/service');var contacts=require(_0x1408('0x5'));var qs=require(_0x1408('0x6'));var rta=require(_0x1408('0x7'));var logger=require(_0x1408('0x8'))(_0x1408('0x9'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var APIBadRequestError=require('../../errors/api')[_0x1408('0xa')];var APINotFoundError=require(_0x1408('0xb'))[_0x1408('0xc')];var APIHandleError=require('../../errors/api')['handleError'];var db=require(_0x1408('0xd'))['db'];var socket=require(_0x1408('0xe'))(new Redis(config[_0x1408('0xf')]));require(_0x1408('0x10'))['register'](socket);config[_0x1408('0xf')]=_[_0x1408('0x11')](config['redis'],{'host':_0x1408('0x12'),'port':0x18eb});var values;function respondWithStatusCode(_0x1a8f6c,_0x17207d){_0x17207d=_0x17207d||0xcc;return function(_0x1486f5){if(_0x1486f5){return _0x1a8f6c['sendStatus'](_0x17207d);}return _0x1a8f6c[_0x1408('0x13')](_0x17207d)[_0x1408('0x14')]();};}function respondWithResult(_0x12cb0a,_0x16067b){_0x16067b=_0x16067b||0xc8;return function(_0x3937d1){if(_0x3937d1){return _0x12cb0a['status'](_0x16067b)[_0x1408('0x15')](_0x3937d1);}};}function respondWithFilteredResult(_0x5d269f,_0x444d8b){return function(_0x4da1bd){if(_0x4da1bd){var _0x46e830=typeof _0x444d8b[_0x1408('0x16')]==='undefined'&&typeof _0x444d8b['limit']==='undefined';var _0x58ec5d=_0x4da1bd['count'];var _0x12bb9a=_0x46e830?0x0:_0x444d8b['offset'];var _0x4a4aea=_0x46e830?_0x4da1bd[_0x1408('0x17')]:_0x444d8b[_0x1408('0x16')]+_0x444d8b[_0x1408('0x18')];var _0x5c33e8;if(_0x4a4aea>=_0x58ec5d){_0x4a4aea=_0x58ec5d;_0x5c33e8=0xc8;}else{_0x5c33e8=0xce;}_0x5d269f['status'](_0x5c33e8);return _0x5d269f[_0x1408('0x19')](_0x1408('0x1a'),_0x12bb9a+'-'+_0x4a4aea+'/'+_0x58ec5d)[_0x1408('0x15')](_0x4da1bd);}return null;};}function saveUpdates(_0xec7147){return function(_0x2a570b){if(_0x2a570b){return _0x2a570b[_0x1408('0x1b')](_0xec7147)['then'](function(_0x186d1e){if(_0x186d1e[_0x1408('0x1c')]===_0x1408('0x1d')){socket[_0x1408('0x1e')](_0x1408('0x1f')+_0x186d1e['id'],_0x186d1e);}return _0x186d1e;});}return null;};}function removeEntity(_0xd7952e){return function(_0x594d6c){if(_0x594d6c){return _0x594d6c[_0x1408('0x20')]()['then'](function(){var _0x3bd34c=_0x594d6c[_0x1408('0x21')]({'plain':!![]});if(_0x3bd34c[_0x1408('0x1c')]===_0x1408('0x22'))return;var _0x50474b=[{'name':'Users','value':'user','ignore':!![]},{'name':_0x1408('0x23'),'value':_0x1408('0x1d'),'ignore':![]},{'name':_0x1408('0x24'),'value':_0x1408('0x25'),'ignore':![]}];var _0x53692a=_(_0x50474b)[_0x1408('0x26')](_0x1408('0x27'))[_0x1408('0x28')]('value')[_0x1408('0x29')]();if(_[_0x1408('0x2a')](_0x53692a,_0x3bd34c[_0x1408('0x1c')])){return;}var _0x20ab1a=_[_0x1408('0x2b')](_0x50474b,[_0x1408('0x29'),_0x3bd34c[_0x1408('0x1c')]])[_0x1408('0x2c')];return db[_0x1408('0x2d')][_0x1408('0x20')]({'where':{'type':_0x20ab1a,'resourceId':_0x3bd34c['id']}})['then'](function(){return _0x594d6c;});})[_0x1408('0x2e')](function(){_0xd7952e[_0x1408('0x13')](0xcc)['end']();});}};}function handleEntityNotFound(_0x26c991){return function(_0x2bdc99){if(!_0x2bdc99){_0x26c991[_0x1408('0x2f')](0x194);}return _0x2bdc99;};}function handleError(_0x2fd936,_0x5bd0bf){_0x5bd0bf=_0x5bd0bf||0x1f4;return function(_0x599463){logger[_0x1408('0x30')](_0x599463['stack']);if(_0x599463[_0x1408('0x2c')]){delete _0x599463['name'];}_0x2fd936[_0x1408('0x13')](_0x5bd0bf)[_0x1408('0x31')](_0x599463);};}function getUserAttributes(){return _(db['User'][_0x1408('0x32')])['map'](function(_0x3cde72){return{'name':_0x3cde72[_0x1408('0x33')],'type':_0x3cde72[_0x1408('0x34')][_0x1408('0x35')]};})['filter'](function(_0x3db966){return![_0x1408('0x36'),_0x1408('0x37'),_0x1408('0x38'),_0x1408('0x39'),_0x1408('0x3a'),_0x1408('0x3b')][_0x1408('0x2a')](_0x3db966[_0x1408('0x2c')]);})['value']();}exports[_0x1408('0x3c')]=function(_0x3da66b,_0x1f527d){var _0x505683={},_0x564435={'count':0x0,'rows':[]};var _0x359c33=getUserAttributes();_0x505683=qs['getOptions'](_0x359c33,_0x3da66b);var _0x17e2f5={'where':_0x505683[_0x1408('0x3d')]};return db[_0x1408('0x3e')][_0x1408('0x17')](_0x17e2f5)['then'](function(_0x3f9b4c){_0x564435[_0x1408('0x17')]=_0x3f9b4c;if(_0x3da66b['query'][_0x1408('0x3f')]){_0x505683[_0x1408('0x40')]=[{'all':!![]}];}if(_0x3da66b[_0x1408('0x41')][_0x1408('0x42')]==='true'){_0x505683[_0x1408('0x40')]=[{'model':db[_0x1408('0x43')],'as':'userSetting'}];}if(!_[_0x1408('0x2a')](_0x505683[_0x1408('0x44')],'id')){_0x505683[_0x1408('0x44')][_0x1408('0x45')]('id');}return db[_0x1408('0x3e')][_0x1408('0x46')](_0x505683);})[_0x1408('0x2e')](function(_0x2003ed){_0x564435['rows']=_0x2003ed;if(_0x3da66b[_0x1408('0x41')][_0x1408('0x47')]===_0x1408('0x48')){var _0x2d2957=[];for(var _0x2611c1=0x0;_0x2611c1<_0x564435[_0x1408('0x49')]['length'];_0x2611c1++){_0x2d2957[_0x1408('0x45')](get_open_tabs(_0x1408('0x4a'),_0x564435[_0x1408('0x49')][_0x2611c1][_0x1408('0x4b')]));_0x2d2957['push'](get_open_tabs('sms',_0x564435['rows'][_0x2611c1]['dataValues']));_0x2d2957[_0x1408('0x45')](get_open_tabs(_0x1408('0x4c'),_0x564435['rows'][_0x2611c1][_0x1408('0x4b')]));_0x2d2957[_0x1408('0x45')](get_open_tabs(_0x1408('0x4d'),_0x564435['rows'][_0x2611c1][_0x1408('0x4b')]));_0x2d2957[_0x1408('0x45')](get_open_tabs(_0x1408('0x4e'),_0x564435['rows'][_0x2611c1][_0x1408('0x4b')]));_0x2d2957[_0x1408('0x45')](get_open_tabs(_0x1408('0x4f'),_0x564435[_0x1408('0x49')][_0x2611c1][_0x1408('0x4b')]));}return Promise[_0x1408('0x50')](_0x2d2957)['then'](function(){return _0x564435;});}else{return _0x564435;}})[_0x1408('0x2e')](respondWithFilteredResult(_0x1f527d,_0x505683))[_0x1408('0x51')](handleError(_0x1f527d,null));};exports[_0x1408('0x52')]=function(_0x3c9631,_0xd51495){var _0x55d9a6=getUserAttributes();_0x3c9631[_0x1408('0x41')]['id']=_0x3c9631['params']['id'];var _0x53647d=qs[_0x1408('0x53')](_0x55d9a6,_0x3c9631);if(_0x3c9631[_0x1408('0x41')][_0x1408('0x3f')]){_0x53647d[_0x1408('0x40')]=[{'all':!![]}];}if(_0x3c9631[_0x1408('0x41')]['userSetting']===_0x1408('0x48')){_0x53647d[_0x1408('0x40')]=[{'model':db[_0x1408('0x43')],'as':_0x1408('0x42')}];}_0x53647d=_[_0x1408('0x54')]({},_0x53647d,_0x3c9631['options']);if(!_[_0x1408('0x2a')](_0x53647d[_0x1408('0x44')],'id')){_0x53647d['attributes'][_0x1408('0x45')]('id');}return db[_0x1408('0x3e')][_0x1408('0x2b')](_0x53647d)[_0x1408('0x2e')](handleEntityNotFound(_0xd51495,null))[_0x1408('0x2e')](function(_0x3b1140){var _0x3cb1bd=[];values=_0x3b1140;if(_0x3c9631[_0x1408('0x41')][_0x1408('0x47')]===_0x1408('0x48')){_0x3cb1bd[_0x1408('0x45')](get_open_tabs(_0x1408('0x4a'),_0x3b1140['dataValues']));_0x3cb1bd[_0x1408('0x45')](get_open_tabs(_0x1408('0x55'),_0x3b1140[_0x1408('0x4b')]));_0x3cb1bd[_0x1408('0x45')](get_open_tabs('openchannel',_0x3b1140['dataValues']));_0x3cb1bd[_0x1408('0x45')](get_open_tabs(_0x1408('0x4f'),_0x3b1140[_0x1408('0x4b')]));_0x3cb1bd[_0x1408('0x45')](get_open_tabs(_0x1408('0x4c'),_0x3b1140['dataValues']));_0x3cb1bd['push'](get_open_tabs(_0x1408('0x4d'),_0x3b1140['dataValues']));return Promise['all'](_0x3cb1bd);}else{return values;}})[_0x1408('0x2e')](function(){return values;})[_0x1408('0x2e')](respondWithResult(_0xd51495,null))[_0x1408('0x51')](handleError(_0xd51495,null));};exports[_0x1408('0x1b')]=function(_0x1a3f35,_0x288a03){if(_0x1a3f35[_0x1408('0x56')]['id']){delete _0x1a3f35[_0x1408('0x56')]['id'];}delete _0x1a3f35['body'][_0x1408('0x1c')];return db[_0x1408('0x3e')][_0x1408('0x2b')]({'where':{'id':_0x1a3f35[_0x1408('0x57')]['id']}})['then'](handleEntityNotFound(_0x288a03,null))['then'](saveUpdates(_0x1a3f35[_0x1408('0x56')],null))[_0x1408('0x2e')](respondWithResult(_0x288a03,null))[_0x1408('0x51')](handleError(_0x288a03,null));};exports['describe']=function(_0x2d52ab,_0x34298e){return db[_0x1408('0x3e')][_0x1408('0x58')]()[_0x1408('0x2e')](respondWithResult(_0x34298e,null))['catch'](handleError(_0x34298e,null));};exports[_0x1408('0x59')]=function(_0x11ffc8,_0xf70e6){return db[_0x1408('0x3e')][_0x1408('0x2b')]({'where':{'id':_0x11ffc8[_0x1408('0x57')]['id']}})['then'](handleEntityNotFound(_0xf70e6,null))[_0x1408('0x2e')](function(_0x477d08){if(_0x477d08){return _0x477d08[_0x1408('0x59')](_0x11ffc8[_0x1408('0x56')][_0x1408('0x5a')],_[_0x1408('0x5b')](_0x11ffc8[_0x1408('0x56')],['ids','id'])||{});}})[_0x1408('0x2e')](respondWithResult(_0xf70e6,null))[_0x1408('0x51')](handleError(_0xf70e6,null));};function validateUser(_0x582a47){return new Promise(function(_0xafdf0d,_0x2c51eb){if(_0x582a47[_0x1408('0x5c')])return _0xafdf0d(_0x582a47);return db[_0x1408('0x5d')][_0x1408('0x5e')](0x1)['then'](function(_0xc80848){if(_0xc80848['securePassword'])authService[_0x1408('0x5f')](_0x582a47[_0x1408('0x36')]);db[_0x1408('0x3e')][_0x1408('0x60')]('internal')[_0x1408('0x2e')](function(_0x505f00){if(_[_0x1408('0x61')](_0x505f00)){_0x582a47[_0x1408('0x5c')]=_0xc80848['min_internal']||0x1;return;}if(_[_0x1408('0x61')](_0xc80848[_0x1408('0x62')])||_0xc80848[_0x1408('0x62')]===_0x505f00){_0x582a47[_0x1408('0x5c')]=_0x505f00+0x1;return;}if(_0xc80848['min_internal']>_0x505f00){_0x582a47[_0x1408('0x5c')]=_0xc80848[_0x1408('0x62')];return;}return db[_0x1408('0x63')][_0x1408('0x41')]('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[_0x1408('0x63')][_0x1408('0x64')][_0x1408('0x65')]})[_0x1408('0x2e')](function(_0x33299d){if(_0x33299d&&_0x33299d['length']){for(var _0x23be56=0x0,_0x94b290=_0x33299d[_0x1408('0x66')];_0x23be56<_0x94b290&&_[_0x1408('0x61')](_0x582a47[_0x1408('0x5c')]);_0x23be56++){if(_0xc80848['min_internal']<=_0x33299d[_0x23be56][_0x1408('0x67')]){_0x582a47['internal']=_0x33299d[_0x23be56][_0x1408('0x67')];}else if(_0xc80848[_0x1408('0x62')]>_0x33299d[_0x23be56]['from']&&_0xc80848[_0x1408('0x62')]<=_0x33299d[_0x23be56]['to']){_0x582a47['internal']=_0xc80848['min_internal'];}}}if(_['isNil'](_0x582a47[_0x1408('0x5c')])){_0x582a47[_0x1408('0x5c')]=_0x505f00+0x1;}return _0xafdf0d(_0x582a47);});});})[_0x1408('0x51')](function(_0x1a2c0f){_0x2c51eb(_0x1a2c0f);});});}function updateUser(_0xce9b2){return new Promise(function(_0x129a74,_0x5bc985){try{if(_0xce9b2[_0x1408('0x68')]){_0xce9b2[_0x1408('0x69')]=_0xce9b2['internal'];_0xce9b2[_0x1408('0x6a')]={'mailbox':_0xce9b2['internal'],'password':_0xce9b2[_0x1408('0x36')],'fullname':_0xce9b2[_0x1408('0x6b')],'email':_0xce9b2[_0x1408('0x6c')]};}if(_0xce9b2[_0x1408('0x1c')]===_0x1408('0x1d')){if(!_0xce9b2['permissions'])_0xce9b2[_0x1408('0x6d')]=[_0x1408('0x6e'),_0x1408('0x6f'),_0x1408('0x70'),_0x1408('0x71'),_0x1408('0x72'),_0x1408('0x73'),'105','106',_0x1408('0x74'),_0x1408('0x75'),'109','100',_0x1408('0x76'),_0x1408('0x77'),_0x1408('0x78')];}_0x129a74(_0xce9b2);}catch(_0x2cd32e){_0x5bc985(_0x2cd32e);}});}exports[_0x1408('0x79')]=function(_0x258103,_0x5de35e){if(_0x258103[_0x1408('0x7a')]['role']===_0x1408('0x1d'))throw new Error(_0x1408('0x7b'));if(_0x258103[_0x1408('0x56')]['role']===_0x1408('0x7a')&&_0x258103[_0x1408('0x7a')]['role']!==_0x1408('0x22')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user');}if(_0x258103[_0x1408('0x56')]['role']==='admin'&&_0x258103['user'][_0x1408('0x1c')]!==_0x1408('0x22')){throw new Error(_0x1408('0x7c'));}return licenseUtil['checkUserLimits']([_0x258103['body']])[_0x1408('0x2e')](function(){return validateUser(_0x258103[_0x1408('0x56')]);})[_0x1408('0x2e')](function(_0x153732){return updateUser(_0x153732)['then'](function(_0x3bd167){if(_0x3bd167[_0x1408('0x1c')]==='admin'){_0x3bd167['settingsEnabled']=_0x258103[_0x1408('0x7a')][_0x1408('0x7d')];delete _0x3bd167[_0x1408('0x7e')];}return _0x3bd167;});})[_0x1408('0x2e')](function(_0x4b6ff2){return db['User'][_0x1408('0x79')](_0x4b6ff2,{'include':[{'model':db[_0x1408('0x6a')],'as':_0x1408('0x6a')}]});})['then'](function(_0x5597e0){if(_0x258103['body']['role']===_0x1408('0x7a'))return _0x5597e0;if(_0x258103[_0x1408('0x7a')][_0x1408('0x1c')]!==_0x1408('0x7a'))return _0x5597e0;return db[_0x1408('0x7f')][_0x1408('0x2b')]({'where':{'name':_0x5597e0[_0x1408('0x1c')]===_0x1408('0x1d')?'Agents':_0x1408('0x24'),'userProfileId':_0x258103[_0x1408('0x7a')]['userProfileId']},'raw':!![]})['then'](function(_0xdabc5e){if(!_0xdabc5e||_0xdabc5e['autoAssociation']!=0x0)return _0x5597e0;return db[_0x1408('0x2d')][_0x1408('0x79')]({'name':_0x5597e0[_0x1408('0x2c')],'resourceId':_0x5597e0['id'],'type':_0xdabc5e[_0x1408('0x2c')],'sectionId':_0xdabc5e['id']},{})[_0x1408('0x2e')](function(){return _0x5597e0;});})[_0x1408('0x51')](function(_0x57ec5b){logger['error'](_0x1408('0x80'),_0x57ec5b);throw _0x57ec5b;});})[_0x1408('0x2e')](respondWithResult(_0x5de35e,0xc9))[_0x1408('0x51')](handleError(_0x5de35e,null));};exports[_0x1408('0x81')]=function(_0x267218,_0x1eed29){var _0x190193=_0x267218[_0x1408('0x56')];var _0x1781d5=[];if(_0x267218[_0x1408('0x7a')]['role']==='agent')throw new Error('Unauthorized');if(_['some'](_0x190193,[_0x1408('0x1c'),_0x1408('0x7a')])&&_0x267218[_0x1408('0x7a')]['role']!==_0x1408('0x22')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user');}if(_[_0x1408('0x82')](_0x190193,[_0x1408('0x1c'),_0x1408('0x22')])&&_0x267218[_0x1408('0x7a')]['role']!==_0x1408('0x22')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20administrator');}return licenseUtil['checkUserLimits'](_0x190193)[_0x1408('0x2e')](function(){return validateUser(_0x190193[0x0]);})[_0x1408('0x2e')](function(){for(var _0x178c29=0x1;_0x178c29<_0x190193[_0x1408('0x66')];_0x178c29++){var _0x2d71d5=_0x190193[_0x178c29-0x1]['internal'];if(!_0x190193[_0x178c29][_0x1408('0x5c')])_0x190193[_0x178c29][_0x1408('0x5c')]=_0x2d71d5+0x1;_0x1781d5['push'](validateUser(_0x190193[_0x178c29]));}return Promise['all'](_0x1781d5);})[_0x1408('0x2e')](function(){_0x1781d5=[];for(var _0x4be662=0x0;_0x4be662<_0x190193['length'];_0x4be662++){_0x1781d5[_0x1408('0x45')](updateUser(_0x190193[_0x4be662]));}return Promise[_0x1408('0x50')](_0x1781d5);})['then'](function(){_0x1781d5=_0x190193[_0x1408('0x28')](function(_0x265fd6){return db[_0x1408('0x3e')]['create'](_0x265fd6,{'include':[{'model':db['VoiceMail'],'as':_0x1408('0x6a')}]})[_0x1408('0x2e')](function(_0x36ecb7){_0x265fd6['id']=_0x36ecb7['id'];return _0x265fd6;});});return Promise[_0x1408('0x50')](_0x1781d5);})[_0x1408('0x2e')](function(_0xb64821){if(_0x267218[_0x1408('0x56')][_0x1408('0x1c')]===_0x1408('0x7a'))return _0xb64821;if(_0x267218[_0x1408('0x7a')]['role']!==_0x1408('0x7a'))return _0xb64821;var _0x114938=_['some'](_0xb64821,function(_0x49c687){return _0x49c687[_0x1408('0x1c')]===_0x1408('0x1d')||_0x49c687['role']===_0x1408('0x25');});if(!_0x114938)return _0xb64821;return db[_0x1408('0x7f')][_0x1408('0x46')]({'where':{'name':{'$or':[_0x1408('0x23'),'Telephones']},'userProfileId':_0x267218['user'][_0x1408('0x7e')]},'raw':!![]})['then'](function(_0x533b55){if(_[_0x1408('0x83')](_0x533b55)||!_[_0x1408('0x82')](_0x533b55,[_0x1408('0x84'),0x0]))return _0xb64821;_0x1781d5=[];var _0x12f45b=_(_0x533b55)[_0x1408('0x28')](function(_0x352e3c){if(_0x352e3c['autoAssociation']===0x1)return;return _0x352e3c['name']===_0x1408('0x23')?_0x1408('0x1d'):_0x1408('0x25');})[_0x1408('0x85')]()[_0x1408('0x29')]();for(var _0x2121f3=0x0;_0x2121f3<_0xb64821['length'];_0x2121f3++){if(!_[_0x1408('0x2a')](_0x12f45b,_0xb64821[_0x2121f3][_0x1408('0x1c')]))return;var _0x1391f1=_0xb64821[_0x2121f3][_0x1408('0x1c')]===_0x1408('0x1d')?'Agents':_0x1408('0x24');_0x1781d5['push'](db[_0x1408('0x2d')][_0x1408('0x79')]({'name':_0xb64821[_0x2121f3][_0x1408('0x2c')],'resourceId':_0xb64821[_0x2121f3]['id'],'type':_0x1391f1,'sectionId':_[_0x1408('0x2b')](_0x533b55,[_0x1408('0x2c'),_0x1391f1])['id']},{}));}return Promise[_0x1408('0x50')](_0x1781d5);});})[_0x1408('0x2e')](respondWithResult(_0x1eed29,0xc9))['catch'](handleError(_0x1eed29,null));};exports[_0x1408('0x86')]=function(_0x19aea5,_0xacbb6d){if(_0x19aea5['body']['id']){delete _0x19aea5[_0x1408('0x56')]['id'];}return db[_0x1408('0x3e')][_0x1408('0x2b')]({'where':{'id':_0x19aea5[_0x1408('0x57')]['id']}})['then'](function(_0x283967){if(!_0x283967)return null;if(_0x283967['id']===_0x19aea5[_0x1408('0x7a')]['id']){if(!_0x19aea5[_0x1408('0x56')][_0x1408('0x87')]||!_0x19aea5['body'][_0x1408('0x88')]){throw new db[(_0x1408('0x89'))][(_0x1408('0x8a'))]('Invalid\x20body\x20format.\x20Use\x20oldPassword\x20and\x20newPassword');}if(!_0x283967[_0x1408('0x8b')](_0x19aea5[_0x1408('0x56')][_0x1408('0x87')])){throw new db[(_0x1408('0x89'))]['ValidationError'](_0x1408('0x8c'));}if(_0x19aea5[_0x1408('0x56')][_0x1408('0x87')]===_0x19aea5[_0x1408('0x56')][_0x1408('0x88')]){throw new db['Sequelize'][(_0x1408('0x8a'))](_0x1408('0x8d'));}}else if(_0x19aea5['user'][_0x1408('0x1c')]===_0x1408('0x22')){if(!_0x19aea5[_0x1408('0x56')][_0x1408('0x88')]){throw new db['Sequelize'][(_0x1408('0x8a'))]('Invalid\x20body\x20format.\x20Use\x20newPassword');}}else if(_0x19aea5[_0x1408('0x7a')][_0x1408('0x1c')]===_0x1408('0x7a')){if(!_0x19aea5[_0x1408('0x56')][_0x1408('0x88')]){throw new db[(_0x1408('0x89'))][(_0x1408('0x8a'))](_0x1408('0x8e'));}if(_0x283967[_0x1408('0x1c')]!==_0x1408('0x1d')){throw new db['Sequelize'][(_0x1408('0x8a'))](_0x1408('0x7b'));}}else{throw new db[(_0x1408('0x89'))][(_0x1408('0x8a'))](_0x1408('0x7b'));}return _0x283967;})[_0x1408('0x2e')](handleEntityNotFound(_0xacbb6d,null))[_0x1408('0x2e')](function(_0x44bd6b){return db[_0x1408('0x5d')][_0x1408('0x8f')]({'attributes':['id',_0x1408('0x90'),_0x1408('0x91'),_0x1408('0x92')]})[_0x1408('0x2e')](function(_0x54b419){if(_0x54b419[_0x1408('0x90')])authService['validatePasswordPattern'](_0x19aea5['body'][_0x1408('0x88')]);if(!_0x54b419[_0x1408('0x91')]||!_0x44bd6b[_0x1408('0x38')])return _0x44bd6b;authService['validatePasswordHistory'](_0x19aea5[_0x1408('0x56')][_0x1408('0x88')],_0x44bd6b[_0x1408('0x38')],_0x54b419[_0x1408('0x92')]);return _0x44bd6b;})[_0x1408('0x2e')](saveUpdates({'password':_0x19aea5[_0x1408('0x56')][_0x1408('0x88')],'passwordResetAt':_0x19aea5[_0x1408('0x7a')]['id']==_0x19aea5[_0x1408('0x57')]['id']?moment():null,'previousPasswords':authService[_0x1408('0x93')](_0x19aea5[_0x1408('0x56')][_0x1408('0x88')],_0x44bd6b[_0x1408('0x38')])},null));})[_0x1408('0x2e')](respondWithResult(_0xacbb6d,null))[_0x1408('0x51')](handleError(_0xacbb6d,null));};exports['addQueues']=function(_0xd2b5fd,_0x2c042c){var _0x5cb2fc=_0xd2b5fd[_0x1408('0x56')][_0x1408('0x94')];return db[_0x1408('0x3e')]['find']({'where':{'id':_0xd2b5fd[_0x1408('0x57')]['id']},'attributes':['id',_0x1408('0x2c'),_0x1408('0x1c'),_0x1408('0x95'),_0x1408('0x96'),_0x1408('0x97'),_0x1408('0x98')]})['then'](handleEntityNotFound(_0x2c042c,null))[_0x1408('0x2e')](function(_0x14be81){if(_0x14be81){if(!utils['isValidChannel'](_0x5cb2fc)){throw new db['Sequelize'][(_0x1408('0x8a'))](_0x1408('0x99'));}return _0x14be81[_0x1408('0x9a')+_[_0x1408('0x9b')](_0x5cb2fc[_0x1408('0x9c')]())+_0x1408('0x9d')](_0xd2b5fd[_0x1408('0x56')][_0x1408('0x5a')],{'penalty':_0xd2b5fd[_0x1408('0x56')][_0x1408('0x9e')]||0x0})[_0x1408('0x9f')](function(_0x4d440f){for(var _0xdef3ae=0x0;_0xdef3ae<_0xd2b5fd[_0x1408('0x56')][_0x1408('0x5a')][_0x1408('0x66')];_0xdef3ae+=0x1){var _0xee8d55={'UserId':Number(_0xd2b5fd['params']['id'])};_0xee8d55[_[_0x1408('0x9b')](_0x5cb2fc[_0x1408('0x9c')]())+'QueueId']=Number(_0xd2b5fd['body'][_0x1408('0x5a')][_0xdef3ae]);socket[_0x1408('0x1e')](_0x1408('0x7a')+_['capitalize'](_0x5cb2fc[_0x1408('0x9c')]())+'Queue:save',_0xee8d55);}return _0x4d440f;})[_0x1408('0x2e')](function(){if(_0x5cb2fc===_0x1408('0xa0')){return db[_0x1408('0xa1')]['findAll']({'where':{'id':_0xd2b5fd[_0x1408('0x56')]['ids']||[]},'raw':!![],'attributes':['id',_0x1408('0x2c')]});}})[_0x1408('0x2e')](function(_0x40454f){var _0x3385ac=_0x14be81['get']({'plain':!![]});var _0x5d314b=[];if(_0x5cb2fc==='voice'&&_0x3385ac['role']===_0x1408('0x1d')&&_0x3385ac[_0x1408('0x95')]){for(let _0x340d83=0x0;_0x340d83<_0x40454f['length'];_0x340d83+=0x1){_0x5d314b['push']({'membername':_0x3385ac['name'],'UserId':_0x3385ac['id'],'queue_name':_0x40454f[_0x340d83][_0x1408('0x2c')],'VoiceQueueId':_0x40454f[_0x340d83]['id'],'interface':_[_0x1408('0x61')](_0x3385ac['interface'])?util[_0x1408('0xa2')]('SIP/%s',_0x3385ac[_0x1408('0x2c')]):_0x3385ac[_0x1408('0x98')],'paused':_0x3385ac[_0x1408('0x97')]||![],'penalty':_0xd2b5fd[_0x1408('0x56')][_0x1408('0x9e')]||0x0});}return Promise['all'](_0x5d314b[_0x1408('0x28')](function(_0x15f208){return db[_0x1408('0xa3')][_0x1408('0xa4')](_0x15f208);}));}return _0x14be81;});}})[_0x1408('0x2e')](respondWithStatusCode(_0x2c042c,null))[_0x1408('0x51')](handleError(_0x2c042c,null));};exports[_0x1408('0xa5')]=function(_0x241f7b,_0x21ec14){var _0x5b5b43,_0x34f74c;return db[_0x1408('0x3e')][_0x1408('0x2b')]({'where':{'id':_0x241f7b[_0x1408('0x57')]['id']},'attributes':['id','name',_0x1408('0x1c')]})['then'](handleEntityNotFound(_0x21ec14,null))[_0x1408('0x2e')](function(_0x21a29e){if(_0x21a29e){_0x5b5b43=_0x21a29e;if(!_0x241f7b['query'][_0x1408('0x94')]||!utils['isValidChannel'](_0x241f7b[_0x1408('0x41')]['channel'])){throw new db['Sequelize']['ValidationError'](_0x1408('0x99'));}return _0x21a29e[_0x1408('0xa6')+_['capitalize'](_0x241f7b[_0x1408('0x41')][_0x1408('0x94')][_0x1408('0x9c')]())+_0x1408('0x9d')](_0x241f7b[_0x1408('0x41')]['ids']);}})[_0x1408('0x2e')](function(_0x2e5d66){if(_[_0x1408('0xa7')](_0x241f7b['query'][_0x1408('0x5a')])){for(var _0x5bc621=0x0;_0x5bc621<_0x241f7b[_0x1408('0x41')][_0x1408('0x5a')][_0x1408('0x66')];_0x5bc621+=0x1){_0x34f74c={'UserId':Number(_0x241f7b[_0x1408('0x57')]['id'])};_0x34f74c[_[_0x1408('0x9b')](_0x241f7b[_0x1408('0x41')][_0x1408('0x94')][_0x1408('0x9c')]())+'QueueId']=Number(_0x241f7b[_0x1408('0x41')][_0x1408('0x5a')][_0x5bc621]);socket[_0x1408('0x1e')]('user'+_[_0x1408('0x9b')](_0x241f7b[_0x1408('0x41')][_0x1408('0x94')][_0x1408('0x9c')]())+_0x1408('0xa8'),_0x34f74c);}}else{_0x34f74c={'UserId':Number(_0x241f7b[_0x1408('0x57')]['id'])};_0x34f74c[_[_0x1408('0x9b')](_0x241f7b[_0x1408('0x41')][_0x1408('0x94')][_0x1408('0x9c')]())+_0x1408('0xa9')]=Number(_0x241f7b['query']['ids']);socket['emit'](_0x1408('0x7a')+_[_0x1408('0x9b')](_0x241f7b['query'][_0x1408('0x94')][_0x1408('0x9c')]())+_0x1408('0xa8'),_0x34f74c);}return _0x2e5d66;})[_0x1408('0x2e')](function(){if(_0x241f7b['query'][_0x1408('0x94')]==='voice'){return db[_0x1408('0xa3')][_0x1408('0x20')]({'where':{'UserId':_0x241f7b[_0x1408('0x57')]['id'],'VoiceQueueId':_0x241f7b[_0x1408('0x41')][_0x1408('0x5a')]},'individualHooks':!![]})['then'](function(){return _0x5b5b43;});}return _0x5b5b43;})[_0x1408('0x2e')](respondWithStatusCode(_0x21ec14,null))['catch'](handleError(_0x21ec14,null));};exports[_0x1408('0xaa')]=function(_0x164091,_0x53559c){_0x164091[_0x1408('0x56')][_0x1408('0xab')]=_0x164091['file'][_0x1408('0xac')];return db[_0x1408('0x3e')][_0x1408('0x2b')]({'where':{'id':_0x164091['params']['id']}})[_0x1408('0x2e')](handleEntityNotFound(_0x53559c,null))['then'](saveUpdates(_0x164091['body'],null))['then'](respondWithResult(_0x53559c,null))['catch'](handleError(_0x53559c,null));};exports[_0x1408('0xad')]=function(_0x4bc109,_0x50a294){var _0x202bca=path[_0x1408('0xae')](config[_0x1408('0xaf')],_0x1408('0xb0'));return db[_0x1408('0x3e')]['find']({'where':{'id':_0x4bc109[_0x1408('0x57')]['id']},'attributes':['id',_0x1408('0xab')],'raw':!![]})[_0x1408('0x2e')](handleEntityNotFound(_0x50a294,null))[_0x1408('0x2e')](function(_0x2f9af3){if(_0x2f9af3){if(_['isNil'](_0x2f9af3[_0x1408('0xab')])){return _0x50a294['download'](_0x202bca);}else{if(!fs[_0x1408('0xb1')](path['join'](config[_0x1408('0xaf')],_0x1408('0xb2'),_0x2f9af3['userpic']))){return _0x50a294[_0x1408('0xb3')](_0x202bca);}return _0x50a294[_0x1408('0xb3')](path[_0x1408('0xae')](config[_0x1408('0xaf')],_0x1408('0xb2'),_0x2f9af3[_0x1408('0xab')]));}}})[_0x1408('0x51')](handleError(_0x50a294,null));};exports['getOpenTabs']=function(_0x46ff19,_0x33eaee){return db['User'][_0x1408('0x2b')]({'where':{'id':_0x46ff19[_0x1408('0x57')]['id']},'attributes':['id']})[_0x1408('0x2e')](handleEntityNotFound(_0x33eaee,null))[_0x1408('0x2e')](function(_0x18e0b8){var _0x13f13c=[];values=_0x18e0b8['dataValues'];_0x13f13c[_0x1408('0x45')](get_open_tabs('chat',_0x18e0b8[_0x1408('0x4b')]));_0x13f13c[_0x1408('0x45')](get_open_tabs(_0x1408('0x55'),_0x18e0b8[_0x1408('0x4b')]));_0x13f13c[_0x1408('0x45')](get_open_tabs('openchannel',_0x18e0b8[_0x1408('0x4b')]));_0x13f13c['push'](get_open_tabs(_0x1408('0x4f'),_0x18e0b8['dataValues']));_0x13f13c[_0x1408('0x45')](get_open_tabs(_0x1408('0x4c'),_0x18e0b8[_0x1408('0x4b')]));_0x13f13c[_0x1408('0x45')](get_open_tabs(_0x1408('0x4d'),_0x18e0b8['dataValues']));return Promise['all'](_0x13f13c);})['then'](function(_0x89610c){if(_0x89610c){var _0x4608d6=_[_0x1408('0x28')](values[_0x1408('0xb4')],function(_0xaeaaf){return{'channel':_0x1408('0xb5'),'id':_0xaeaaf['id'],'createdAt':_0xaeaaf['createdAt']};});var _0x3c60da=_['map'](values['FaxOpenTabs'],function(_0x17b549){return{'channel':_0x1408('0xb6'),'id':_0x17b549['id'],'createdAt':_0x17b549[_0x1408('0xb7')]};});var _0x5b9079=_[_0x1408('0x28')](values['OpenchannelOpenTabs'],function(_0x268547){return{'channel':'OPENCHANNEL','id':_0x268547['id'],'createdAt':_0x268547[_0x1408('0xb7')]};});var _0x594558=_['map'](values['MailOpenTabs'],function(_0x4124ce){return{'channel':_0x1408('0xb8'),'id':_0x4124ce['id'],'createdAt':_0x4124ce['createdAt']};});var _0x39e95b=_[_0x1408('0x28')](values[_0x1408('0xb9')],function(_0x3694b9){return{'channel':_0x1408('0xba'),'id':_0x3694b9['id'],'createdAt':_0x3694b9['createdAt']};});var _0x7041d1=_[_0x1408('0x28')](values[_0x1408('0xbb')],function(_0x4effa3){return{'channel':_0x1408('0xbc'),'id':_0x4effa3['id'],'createdAt':_0x4effa3[_0x1408('0xb7')]};});var _0x3732e0=_[_0x1408('0xbd')](_0x4608d6,_0x3c60da,_0x5b9079,_0x594558,_0x39e95b,_0x7041d1);var _0x2d243f={'count':_0x3732e0[_0x1408('0x66')],'rows':_0x3732e0};return _0x2d243f;}else return null;})[_0x1408('0x2e')](respondWithResult(_0x33eaee,null))['catch'](handleError(_0x33eaee,null));};exports[_0x1408('0xbe')]=function(_0x3a30ab,_0x47e703){var _0x24c2f3={};return db[_0x1408('0x3e')][_0x1408('0x8f')]({'where':{'id':_0x3a30ab['params']['id']}})[_0x1408('0x2e')](function(_0x24c2ea){if(!_0x24c2ea){throw new APINotFoundError(util['format'](_0x1408('0xbf'),_0x3a30ab[_0x1408('0x57')]['id']));}return contacts[_0x1408('0x58')]();})[_0x1408('0x2e')](function(_0x10b9c0){_0x3a30ab[_0x1408('0x41')][_0x1408('0x3e')]=_0x3a30ab[_0x1408('0x57')]['id'];_0x24c2f3=qs[_0x1408('0x53')](_0x10b9c0,_0x3a30ab);if(_0x3a30ab[_0x1408('0x41')][_0x1408('0xc0')](_0x1408('0x3f'))){_0x24c2f3['include']=[{'model':db['CmList'],'as':_0x1408('0xc1'),'required':![]},{'model':db[_0x1408('0xc2')],'as':_0x1408('0xc3'),'attributes':['id',_0x1408('0x2c'),'color'],'where':_0x3a30ab['query'][_0x1408('0xc4')]?{'id':_0x3a30ab[_0x1408('0x41')][_0x1408('0xc4')]}:undefined,'required':_0x3a30ab['query'][_0x1408('0xc4')]?!![]:![]}];}return contacts[_0x1408('0x46')](_0x3a30ab[_0x1408('0x41')],_0x3a30ab[_0x1408('0x7a')],_0x24c2f3,_0x10b9c0);})['then'](respondWithFilteredResult(_0x47e703,_0x24c2f3))[_0x1408('0x51')](APIHandleError(_0x47e703));};exports[_0x1408('0xc5')]=function(_0x3046f6,_0x3ae275){var _0x55d1fd;var _0x6ef11a={};var _0x564a6e;return db[_0x1408('0x3e')][_0x1408('0x8f')]({'where':{'id':_0x3046f6['params']['id']},'attributes':['id','name',_0x1408('0x1c')]})[_0x1408('0x2e')](handleEntityNotFound(_0x3ae275,null))[_0x1408('0x2e')](function(_0x20fc36){if(!utils['isValidChannel'](_0x3046f6[_0x1408('0x41')][_0x1408('0x94')])){throw new db[(_0x1408('0x89'))][(_0x1408('0x8a'))]('Unknown\x20channel');}_0x55d1fd=_0x20fc36;var _0x488d59={};_0x488d59[_0x1408('0xc6')]=_['keys'](db[_[_0x1408('0x9b')](_0x3046f6[_0x1408('0x41')]['channel'])+_0x1408('0xc7')][_0x1408('0x32')]);_0x488d59[_0x1408('0x41')]=_['keys'](_0x3046f6[_0x1408('0x41')]);_0x488d59['filters']=_[_0x1408('0xc8')](_0x488d59['model'],_0x488d59[_0x1408('0x41')]);_0x6ef11a[_0x1408('0x44')]=_[_0x1408('0xc8')](_0x488d59[_0x1408('0xc6')],qs[_0x1408('0xc9')](_0x3046f6[_0x1408('0x41')]['fields']));_0x6ef11a['attributes']=_0x6ef11a[_0x1408('0x44')]['length']?_0x6ef11a[_0x1408('0x44')]:_0x488d59[_0x1408('0xc6')];_0x6ef11a['order']=qs[_0x1408('0xca')](_0x3046f6[_0x1408('0x41')][_0x1408('0xca')]);_0x6ef11a[_0x1408('0x3d')]=qs[_0x1408('0xcb')](_['pick'](_0x3046f6['query'],_0x488d59[_0x1408('0xcb')]));if(_0x3046f6['query']['filter']){_0x6ef11a[_0x1408('0x3d')]=_[_0x1408('0x54')](_0x6ef11a[_0x1408('0x3d')],{'$or':_[_0x1408('0x28')](_0x6ef11a['attributes'],function(_0x4e078c){var _0x5f4996={};_0x5f4996[_0x4e078c]={'$like':'%'+_0x3046f6[_0x1408('0x41')][_0x1408('0x26')]+'%'};return _0x5f4996;})});}_0x6ef11a=_[_0x1408('0x54')]({},_0x6ef11a,_0x3046f6[_0x1408('0xcc')]);switch(_0x55d1fd[_0x1408('0x1c')]){case'admin':return db[_[_0x1408('0x9b')](_0x3046f6['query']['channel'])+'Queue'][_0x1408('0x46')](_0x6ef11a);case'user':case _0x1408('0x1d'):return _0x55d1fd[_0x1408('0x21')+_[_0x1408('0x9b')](_0x3046f6['query'][_0x1408('0x94')])+'Queues'](_0x6ef11a);default:throw new db['Sequelize'][(_0x1408('0x8a'))](_0x1408('0xcd'));}})['then'](function(_0x31d223){_0x564a6e=_0x31d223[_0x1408('0x66')];if(!_0x3046f6['query']['hasOwnProperty'](_0x1408('0xce'))){_0x6ef11a['limit']=qs[_0x1408('0x18')](_0x3046f6[_0x1408('0x41')][_0x1408('0x18')]);_0x6ef11a[_0x1408('0x16')]=qs[_0x1408('0x16')](_0x3046f6[_0x1408('0x41')][_0x1408('0x16')]);}switch(_0x55d1fd['role']){case _0x1408('0x22'):return db[_[_0x1408('0x9b')](_0x3046f6[_0x1408('0x41')][_0x1408('0x94')])+_0x1408('0xc7')][_0x1408('0x46')](_0x6ef11a);case _0x1408('0x7a'):case _0x1408('0x1d'):return _0x55d1fd[_0x1408('0x21')+_['capitalize'](_0x3046f6['query'][_0x1408('0x94')])+_0x1408('0x9d')](_0x6ef11a);}})[_0x1408('0x2e')](function(_0xc8aee9){return{'count':_0x564a6e,'rows':_0xc8aee9};})['then'](respondWithResult(_0x3ae275,null))[_0x1408('0x51')](handleError(_0x3ae275,null));};exports['getVoiceQueuesRt']=function(_0x1af24d,_0x146a8a){var _0x517860={};var _0x171a0d={};var _0xf75c4c;var _0x299a6e;return db[_0x1408('0x3e')][_0x1408('0x8f')]({'where':{'id':_0x1af24d[_0x1408('0x57')]['id']}})[_0x1408('0x2e')](handleEntityNotFound(_0x146a8a,null))['then'](function(_0x36ed0d){if(_0x36ed0d){_0xf75c4c=_0x36ed0d;_0x171a0d[_0x1408('0xc6')]=_['keys'](db[_0x1408('0xa3')]['rawAttributes']);_0x171a0d[_0x1408('0x41')]=_[_0x1408('0xcf')](_0x1af24d['query']);_0x171a0d[_0x1408('0xcb')]=_['intersection'](_0x171a0d['model'],_0x171a0d[_0x1408('0x41')]);_0x517860[_0x1408('0x44')]=_[_0x1408('0xc8')](_0x171a0d[_0x1408('0xc6')],qs[_0x1408('0xc9')](_0x1af24d[_0x1408('0x41')][_0x1408('0xc9')]));_0x517860[_0x1408('0x44')]=_0x517860[_0x1408('0x44')]['length']?_0x517860[_0x1408('0x44')]:_0x171a0d[_0x1408('0xc6')];_0x517860[_0x1408('0xd0')]=qs['sort'](_0x1af24d[_0x1408('0x41')][_0x1408('0xca')]);_0x517860['where']=qs[_0x1408('0xcb')](_[_0x1408('0xd1')](_0x1af24d[_0x1408('0x41')],_0x171a0d['filters']));if(_0x1af24d[_0x1408('0x41')][_0x1408('0x26')]){_0x517860[_0x1408('0x3d')]=_[_0x1408('0x54')](_0x517860[_0x1408('0x3d')],{'$or':_['map'](_0x517860[_0x1408('0x44')],function(_0x46caac){var _0x583c7e={};_0x583c7e[_0x46caac]={'$like':'%'+_0x1af24d[_0x1408('0x41')][_0x1408('0x26')]+'%'};return _0x583c7e;})});}_0x517860=_[_0x1408('0x54')]({},_0x517860,_0x1af24d[_0x1408('0xcc')]);return _0xf75c4c[_0x1408('0xd2')](_0x517860);}})['then'](function(_0x2d3a11){if(_0x2d3a11){_0x299a6e=_0x2d3a11[_0x1408('0x66')];if(!_0x1af24d[_0x1408('0x41')][_0x1408('0xc0')](_0x1408('0xce'))){_0x517860[_0x1408('0x18')]=qs['limit'](_0x1af24d['query'][_0x1408('0x18')]);_0x517860[_0x1408('0x16')]=qs[_0x1408('0x16')](_0x1af24d[_0x1408('0x41')][_0x1408('0x16')]);}return _0xf75c4c['getVoiceQueuesRt'](_0x517860);}})['then'](function(_0x29cfab){if(_0x29cfab){return _0x29cfab?{'count':_0x299a6e,'rows':_0x29cfab}:null;}})[_0x1408('0x2e')](respondWithResult(_0x146a8a,null))[_0x1408('0x51')](handleError(_0x146a8a,null));};exports[_0x1408('0xd3')]=function(_0x31bf09,_0x4e87cb){var _0x4b28e2={};var _0x243790={};var _0x2c4ee9;var _0x34c155;return db[_0x1408('0x3e')][_0x1408('0x8f')]({'where':{'id':_0x31bf09[_0x1408('0x57')]['id']}})[_0x1408('0x2e')](handleEntityNotFound(_0x4e87cb,null))['then'](function(_0x3c479e){if(_0x3c479e){_0x2c4ee9=_0x3c479e;_0x243790[_0x1408('0xc6')]=_[_0x1408('0xcf')](db[_0x1408('0xd4')]['rawAttributes']);_0x243790[_0x1408('0x41')]=_[_0x1408('0xcf')](_0x31bf09[_0x1408('0x41')]);_0x243790[_0x1408('0xcb')]=_[_0x1408('0xc8')](_0x243790['model'],_0x243790[_0x1408('0x41')]);_0x4b28e2[_0x1408('0x44')]=_['intersection'](_0x243790[_0x1408('0xc6')],qs[_0x1408('0xc9')](_0x31bf09[_0x1408('0x41')][_0x1408('0xc9')]));_0x4b28e2[_0x1408('0x44')]=_0x4b28e2[_0x1408('0x44')][_0x1408('0x66')]?_0x4b28e2[_0x1408('0x44')]:_0x243790[_0x1408('0xc6')];_0x4b28e2[_0x1408('0xd0')]=qs[_0x1408('0xca')](_0x31bf09['query']['sort']);_0x4b28e2[_0x1408('0x3d')]=qs['filters'](_[_0x1408('0xd1')](_0x31bf09['query'],_0x243790['filters']));if(_0x31bf09[_0x1408('0x41')][_0x1408('0x26')]){_0x4b28e2[_0x1408('0x3d')]=_[_0x1408('0x54')](_0x4b28e2[_0x1408('0x3d')],{'$or':_[_0x1408('0x28')](_0x4b28e2[_0x1408('0x44')],function(_0x2ba15e){var _0x1e541b={};_0x1e541b[_0x2ba15e]={'$like':'%'+_0x31bf09[_0x1408('0x41')][_0x1408('0x26')]+'%'};return _0x1e541b;})});}_0x4b28e2=_['merge']({},_0x4b28e2,_0x31bf09[_0x1408('0xcc')]);return _0x2c4ee9['getGroups'](_0x4b28e2);}})['then'](function(_0x1444df){if(_0x1444df){_0x34c155=_0x1444df[_0x1408('0x66')];if(!_0x31bf09['query'][_0x1408('0xc0')](_0x1408('0xce'))){_0x4b28e2[_0x1408('0x18')]=qs['limit'](_0x31bf09[_0x1408('0x41')][_0x1408('0x18')]);_0x4b28e2[_0x1408('0x16')]=qs[_0x1408('0x16')](_0x31bf09[_0x1408('0x41')][_0x1408('0x16')]);}return _0x2c4ee9[_0x1408('0xd3')](_0x4b28e2);}})[_0x1408('0x2e')](function(_0x49fc60){if(_0x49fc60){return _0x49fc60?{'count':_0x34c155,'rows':_0x49fc60}:null;}})[_0x1408('0x2e')](respondWithResult(_0x4e87cb,null))['catch'](handleError(_0x4e87cb,null));};exports[_0x1408('0xd5')]=function(_0x381552,_0x460db4){var _0x42a66e={'raw':!![],'where':{}};var _0x5122e6={};var _0x104ac4={'count':0x0,'rows':[]};return db[_0x1408('0x3e')][_0x1408('0x8f')]({'where':{'id':_0x381552[_0x1408('0x57')]['id']}})[_0x1408('0x2e')](handleEntityNotFound(_0x460db4,null))[_0x1408('0x2e')](function(_0x29f2f8){if(_0x29f2f8){_0x5122e6['model']=_[_0x1408('0xcf')](db[_0x1408('0xd6')][_0x1408('0x32')]);_0x5122e6[_0x1408('0x41')]=_['keys'](_0x381552[_0x1408('0x41')]);_0x5122e6[_0x1408('0xcb')]=_[_0x1408('0xc8')](_0x5122e6[_0x1408('0xc6')],_0x5122e6[_0x1408('0x41')]);_0x42a66e[_0x1408('0x44')]=_['intersection'](_0x5122e6[_0x1408('0xc6')],qs['fields'](_0x381552[_0x1408('0x41')][_0x1408('0xc9')]));_0x42a66e[_0x1408('0x44')]=_0x42a66e[_0x1408('0x44')]['length']?_0x42a66e[_0x1408('0x44')]:_0x5122e6[_0x1408('0xc6')];if(!_0x381552[_0x1408('0x41')]['hasOwnProperty'](_0x1408('0xce'))){_0x42a66e[_0x1408('0x18')]=qs['limit'](_0x381552[_0x1408('0x41')][_0x1408('0x18')]);_0x42a66e[_0x1408('0x16')]=qs[_0x1408('0x16')](_0x381552['query'][_0x1408('0x16')]);}_0x42a66e[_0x1408('0xd0')]=qs[_0x1408('0xca')](_0x381552[_0x1408('0x41')][_0x1408('0xca')]);_0x42a66e[_0x1408('0x3d')]=qs[_0x1408('0xcb')](_['pick'](_0x381552[_0x1408('0x41')],_0x5122e6[_0x1408('0xcb')]));_0x42a66e[_0x1408('0x3d')]['UserId']=_0x29f2f8['id'];if(_0x381552[_0x1408('0x41')]['filter']){_0x42a66e['where']=_[_0x1408('0x54')](_0x42a66e[_0x1408('0x3d')],{'$or':_['map'](_0x42a66e[_0x1408('0x44')],function(_0x4f4748){var _0x1e5dfb={};_0x1e5dfb[_0x4f4748]={'$like':'%'+_0x381552[_0x1408('0x41')][_0x1408('0x26')]+'%'};return _0x1e5dfb;})});}_0x42a66e=_['merge']({},_0x42a66e,_0x381552['options']);return db['VoiceRecording'][_0x1408('0x17')]({'where':_0x42a66e['where']})['then'](function(_0x3620e5){_0x104ac4[_0x1408('0x17')]=_0x3620e5;if(_0x381552[_0x1408('0x41')][_0x1408('0x3f')]){_0x42a66e[_0x1408('0x40')]=[{'all':!![]}];}return db[_0x1408('0xd6')]['findAll'](_0x42a66e);})[_0x1408('0x2e')](function(_0x4736e1){_0x104ac4[_0x1408('0x49')]=_0x4736e1;return _0x104ac4;});}})['then'](respondWithFilteredResult(_0x460db4,_0x42a66e))[_0x1408('0x51')](handleError(_0x460db4,null));};exports['getScreenRecordings']=function(_0x23b31f,_0x69ceda){var _0x5b6150={'raw':!![],'where':{}};var _0x1d4c19={};var _0x410590={'count':0x0,'rows':[]};return db[_0x1408('0x3e')][_0x1408('0x8f')]({'where':{'id':_0x23b31f['params']['id']}})[_0x1408('0x2e')](handleEntityNotFound(_0x69ceda,null))[_0x1408('0x2e')](function(_0x488ed9){if(_0x488ed9){_0x1d4c19['model']=_[_0x1408('0xcf')](db[_0x1408('0xd7')]['rawAttributes']);_0x1d4c19[_0x1408('0x41')]=_[_0x1408('0xcf')](_0x23b31f['query']);_0x1d4c19[_0x1408('0xcb')]=_[_0x1408('0xc8')](_0x1d4c19['model'],_0x1d4c19[_0x1408('0x41')]);_0x5b6150[_0x1408('0x44')]=_[_0x1408('0xc8')](_0x1d4c19[_0x1408('0xc6')],qs[_0x1408('0xc9')](_0x23b31f[_0x1408('0x41')]['fields']));_0x5b6150['attributes']=_0x5b6150[_0x1408('0x44')][_0x1408('0x66')]?_0x5b6150['attributes']:_0x1d4c19['model'];if(!_0x23b31f[_0x1408('0x41')]['hasOwnProperty'](_0x1408('0xce'))){_0x5b6150[_0x1408('0x18')]=qs[_0x1408('0x18')](_0x23b31f['query'][_0x1408('0x18')]);_0x5b6150['offset']=qs[_0x1408('0x16')](_0x23b31f[_0x1408('0x41')]['offset']);}_0x5b6150[_0x1408('0xd0')]=qs[_0x1408('0xca')](_0x23b31f['query']['sort']);_0x5b6150[_0x1408('0x3d')]=qs['filters'](_[_0x1408('0xd1')](_0x23b31f[_0x1408('0x41')],_0x1d4c19[_0x1408('0xcb')]));_0x5b6150[_0x1408('0x3d')][_0x1408('0xd8')]=_0x488ed9['id'];if(_0x23b31f[_0x1408('0x41')][_0x1408('0x26')]){_0x5b6150['where']=_[_0x1408('0x54')](_0x5b6150[_0x1408('0x3d')],{'$or':_['map'](_0x5b6150['attributes'],function(_0x2b24b8){var _0x2c5aa3={};_0x2c5aa3[_0x2b24b8]={'$like':'%'+_0x23b31f['query'][_0x1408('0x26')]+'%'};return _0x2c5aa3;})});}_0x5b6150=_['merge']({},_0x5b6150,_0x23b31f[_0x1408('0xcc')]);return db[_0x1408('0xd7')][_0x1408('0x17')]({'where':_0x5b6150['where']})[_0x1408('0x2e')](function(_0x63aaa3){_0x410590[_0x1408('0x17')]=_0x63aaa3;if(_0x23b31f[_0x1408('0x41')]['includeAll']){_0x5b6150[_0x1408('0x40')]=[{'all':!![]}];}return db[_0x1408('0xd7')][_0x1408('0x46')](_0x5b6150);})[_0x1408('0x2e')](function(_0x127f16){_0x410590[_0x1408('0x49')]=_0x127f16;return _0x410590;});}})['then'](respondWithFilteredResult(_0x69ceda,_0x5b6150))[_0x1408('0x51')](handleError(_0x69ceda,null));};exports[_0x1408('0xd9')]=function(_0x2ccbea,_0x41a654){var _0x445601={};var _0x3f222f={};var _0x205ef6;var _0x32da81;return db[_0x1408('0x3e')][_0x1408('0x8f')]({'where':{'id':_0x2ccbea[_0x1408('0x57')]['id']}})[_0x1408('0x2e')](handleEntityNotFound(_0x41a654,null))[_0x1408('0x2e')](function(_0x25495a){if(_0x25495a){_0x205ef6=_0x25495a;_0x3f222f[_0x1408('0xc6')]=_[_0x1408('0xcf')](db[_0x1408('0xda')][_0x1408('0x32')]);_0x3f222f[_0x1408('0x41')]=_[_0x1408('0xcf')](_0x2ccbea[_0x1408('0x41')]);_0x3f222f[_0x1408('0xcb')]=_[_0x1408('0xc8')](_0x3f222f[_0x1408('0xc6')],_0x3f222f[_0x1408('0x41')]);_0x445601[_0x1408('0x44')]=_[_0x1408('0xc8')](_0x3f222f[_0x1408('0xc6')],qs[_0x1408('0xc9')](_0x2ccbea[_0x1408('0x41')][_0x1408('0xc9')]));_0x445601[_0x1408('0x44')]=_0x445601[_0x1408('0x44')][_0x1408('0x66')]?_0x445601[_0x1408('0x44')]:_0x3f222f[_0x1408('0xc6')];_0x445601[_0x1408('0xd0')]=qs['sort'](_0x2ccbea['query'][_0x1408('0xca')]);_0x445601[_0x1408('0x3d')]=qs['filters'](_[_0x1408('0xd1')](_0x2ccbea[_0x1408('0x41')],_0x3f222f[_0x1408('0xcb')]));if(_0x2ccbea[_0x1408('0x41')][_0x1408('0x26')]){_0x445601['where']=_[_0x1408('0x54')](_0x445601[_0x1408('0x3d')],{'$or':_[_0x1408('0x28')](_0x445601['attributes'],function(_0x43b8ca){var _0x5db34f={};_0x5db34f[_0x43b8ca]={'$like':'%'+_0x2ccbea[_0x1408('0x41')][_0x1408('0x26')]+'%'};return _0x5db34f;})});}_0x445601=_[_0x1408('0x54')]({},_0x445601,_0x2ccbea[_0x1408('0xcc')]);return _0x205ef6[_0x1408('0xd9')](_0x445601);}})[_0x1408('0x2e')](function(_0x48b713){if(_0x48b713){_0x32da81=_0x48b713[_0x1408('0x66')];if(!_0x2ccbea[_0x1408('0x41')][_0x1408('0xc0')](_0x1408('0xce'))){_0x445601[_0x1408('0x18')]=qs[_0x1408('0x18')](_0x2ccbea[_0x1408('0x41')][_0x1408('0x18')]);_0x445601[_0x1408('0x16')]=qs[_0x1408('0x16')](_0x2ccbea[_0x1408('0x41')]['offset']);}return _0x205ef6[_0x1408('0xd9')](_0x445601);}})['then'](function(_0x6ad782){if(_0x6ad782){return _0x6ad782?{'count':_0x32da81,'rows':_0x6ad782}:null;}})[_0x1408('0x2e')](respondWithResult(_0x41a654,null))[_0x1408('0x51')](handleError(_0x41a654,null));};exports[_0x1408('0xdb')]=function(_0x2e810e,_0x4f1917){var _0x54a523={};var _0x253da6={};var _0x3ee8c0;var _0x3cb243;return db[_0x1408('0x3e')][_0x1408('0x8f')]({'where':{'id':_0x2e810e[_0x1408('0x57')]['id']}})[_0x1408('0x2e')](handleEntityNotFound(_0x4f1917,null))[_0x1408('0x2e')](function(_0x43517a){if(_0x43517a){_0x3ee8c0=_0x43517a;_0x253da6[_0x1408('0xc6')]=_[_0x1408('0xcf')](db[_0x1408('0xdc')][_0x1408('0x32')]);_0x253da6[_0x1408('0x41')]=_['keys'](_0x2e810e[_0x1408('0x41')]);_0x253da6[_0x1408('0xcb')]=_['intersection'](_0x253da6[_0x1408('0xc6')],_0x253da6[_0x1408('0x41')]);_0x54a523[_0x1408('0x44')]=_[_0x1408('0xc8')](_0x253da6[_0x1408('0xc6')],qs[_0x1408('0xc9')](_0x2e810e[_0x1408('0x41')][_0x1408('0xc9')]));_0x54a523['attributes']=_0x54a523[_0x1408('0x44')][_0x1408('0x66')]?_0x54a523['attributes']:_0x253da6[_0x1408('0xc6')];_0x54a523['order']=qs[_0x1408('0xca')](_0x2e810e[_0x1408('0x41')][_0x1408('0xca')]);_0x54a523['where']=qs[_0x1408('0xcb')](_['pick'](_0x2e810e[_0x1408('0x41')],_0x253da6[_0x1408('0xcb')]));if(_0x2e810e[_0x1408('0x41')][_0x1408('0x26')]){_0x54a523[_0x1408('0x3d')]=_[_0x1408('0x54')](_0x54a523[_0x1408('0x3d')],{'$or':_[_0x1408('0x28')](_0x54a523[_0x1408('0x44')],function(_0x2a5f4b){var _0x403e21={};_0x403e21[_0x2a5f4b]={'$like':'%'+_0x2e810e['query'][_0x1408('0x26')]+'%'};return _0x403e21;})});}_0x54a523=_[_0x1408('0x54')]({},_0x54a523,_0x2e810e[_0x1408('0xcc')]);return _0x3ee8c0[_0x1408('0xdb')](_0x54a523);}})[_0x1408('0x2e')](function(_0x4a644f){if(_0x4a644f){_0x3cb243=_0x4a644f['length'];if(!_0x2e810e['query'][_0x1408('0xc0')](_0x1408('0xce'))){_0x54a523[_0x1408('0x18')]=qs['limit'](_0x2e810e[_0x1408('0x41')][_0x1408('0x18')]);_0x54a523[_0x1408('0x16')]=qs[_0x1408('0x16')](_0x2e810e[_0x1408('0x41')][_0x1408('0x16')]);}return _0x3ee8c0['getOpenchannelInteractions'](_0x54a523);}})[_0x1408('0x2e')](function(_0x499601){if(_0x499601){return _0x499601?{'count':_0x3cb243,'rows':_0x499601}:null;}})['then'](respondWithResult(_0x4f1917,null))[_0x1408('0x51')](handleError(_0x4f1917,null));};exports[_0x1408('0xdd')]=function(_0xbb0e1b,_0x2b06b9){var _0x4a7de4={'raw':!![],'where':{}};var _0x148abb={};var _0x14b0db={'count':0x0,'rows':[]};return db['User'][_0x1408('0x8f')]({'where':{'id':_0xbb0e1b[_0x1408('0x57')]['id']}})[_0x1408('0x2e')](handleEntityNotFound(_0x2b06b9,null))[_0x1408('0x2e')](function(_0x4af5f1){if(_0x4af5f1){_0x148abb[_0x1408('0xc6')]=_[_0x1408('0xcf')](db['MailInteraction'][_0x1408('0x32')]);_0x148abb[_0x1408('0x41')]=_[_0x1408('0xcf')](_0xbb0e1b['query']);_0x148abb[_0x1408('0xcb')]=_['intersection'](_0x148abb[_0x1408('0xc6')],_0x148abb[_0x1408('0x41')]);_0x4a7de4[_0x1408('0x44')]=_[_0x1408('0xc8')](_0x148abb[_0x1408('0xc6')],qs['fields'](_0xbb0e1b[_0x1408('0x41')][_0x1408('0xc9')]));_0x4a7de4[_0x1408('0x44')]=_0x4a7de4[_0x1408('0x44')][_0x1408('0x66')]?_0x4a7de4['attributes']:_0x148abb[_0x1408('0xc6')];if(!_0xbb0e1b[_0x1408('0x41')][_0x1408('0xc0')](_0x1408('0xce'))){_0x4a7de4[_0x1408('0x18')]=qs[_0x1408('0x18')](_0xbb0e1b['query']['limit']);_0x4a7de4[_0x1408('0x16')]=qs['offset'](_0xbb0e1b[_0x1408('0x41')]['offset']);}_0x4a7de4[_0x1408('0xd0')]=qs[_0x1408('0xca')](_0xbb0e1b[_0x1408('0x41')][_0x1408('0xca')]);_0x4a7de4[_0x1408('0x3d')]=qs[_0x1408('0xcb')](_[_0x1408('0xd1')](_0xbb0e1b[_0x1408('0x41')],_0x148abb[_0x1408('0xcb')]));_0x4a7de4[_0x1408('0x3d')][_0x1408('0xd8')]=_0x4af5f1['id'];if(_0xbb0e1b[_0x1408('0x41')][_0x1408('0x26')]){_0x4a7de4[_0x1408('0x3d')]=_['merge'](_0x4a7de4[_0x1408('0x3d')],{'$or':_[_0x1408('0x28')](_0x4a7de4[_0x1408('0x44')],function(_0x5d3472){var _0x2c7723={};_0x2c7723[_0x5d3472]={'$like':'%'+_0xbb0e1b[_0x1408('0x41')]['filter']+'%'};return _0x2c7723;})});}_0x4a7de4=_[_0x1408('0x54')]({},_0x4a7de4,_0xbb0e1b['options']);return db['MailInteraction'][_0x1408('0x17')]({'where':_0x4a7de4['where']})['then'](function(_0x40dccd){_0x14b0db[_0x1408('0x17')]=_0x40dccd;if(_0xbb0e1b['query'][_0x1408('0x3f')]){_0x4a7de4[_0x1408('0x40')]=[{'all':!![]}];}return db[_0x1408('0xde')]['findAll'](_0x4a7de4);})[_0x1408('0x2e')](function(_0xaf21e6){_0x14b0db[_0x1408('0x49')]=_0xaf21e6;return _0x14b0db;});}})['then'](respondWithFilteredResult(_0x2b06b9,_0x4a7de4))[_0x1408('0x51')](handleError(_0x2b06b9,null));};exports[_0x1408('0xdf')]=function(_0x372985,_0x96e29){var _0x385bf6={};var _0x19900d={};var _0x8352da;var _0x5694e5;return db[_0x1408('0x3e')][_0x1408('0x8f')]({'where':{'id':_0x372985[_0x1408('0x57')]['id']}})['then'](handleEntityNotFound(_0x96e29,null))[_0x1408('0x2e')](function(_0xa4c7bc){if(_0xa4c7bc){_0x8352da=_0xa4c7bc;_0x19900d['model']=_[_0x1408('0xcf')](db[_0x1408('0xe0')][_0x1408('0x32')]);_0x19900d[_0x1408('0x41')]=_[_0x1408('0xcf')](_0x372985[_0x1408('0x41')]);_0x19900d['filters']=_[_0x1408('0xc8')](_0x19900d[_0x1408('0xc6')],_0x19900d[_0x1408('0x41')]);_0x385bf6[_0x1408('0x44')]=_['intersection'](_0x19900d['model'],qs[_0x1408('0xc9')](_0x372985[_0x1408('0x41')][_0x1408('0xc9')]));_0x385bf6[_0x1408('0x44')]=_0x385bf6[_0x1408('0x44')]['length']?_0x385bf6[_0x1408('0x44')]:_0x19900d['model'];_0x385bf6[_0x1408('0xd0')]=qs[_0x1408('0xca')](_0x372985['query'][_0x1408('0xca')]);_0x385bf6[_0x1408('0x3d')]=qs['filters'](_[_0x1408('0xd1')](_0x372985[_0x1408('0x41')],_0x19900d[_0x1408('0xcb')]));if(_0x372985[_0x1408('0x41')][_0x1408('0x26')]){_0x385bf6[_0x1408('0x3d')]=_[_0x1408('0x54')](_0x385bf6[_0x1408('0x3d')],{'$or':_[_0x1408('0x28')](_0x385bf6[_0x1408('0x44')],function(_0x885372){var _0x5cde5e={};_0x5cde5e[_0x885372]={'$like':'%'+_0x372985[_0x1408('0x41')][_0x1408('0x26')]+'%'};return _0x5cde5e;})});}_0x385bf6=_['merge']({},_0x385bf6,_0x372985[_0x1408('0xcc')]);return _0x8352da[_0x1408('0xdf')](_0x385bf6);}})[_0x1408('0x2e')](function(_0x258440){if(_0x258440){_0x5694e5=_0x258440['length'];if(!_0x372985[_0x1408('0x41')][_0x1408('0xc0')]('nolimit')){_0x385bf6[_0x1408('0x18')]=qs[_0x1408('0x18')](_0x372985[_0x1408('0x41')]['limit']);_0x385bf6['offset']=qs['offset'](_0x372985[_0x1408('0x41')][_0x1408('0x16')]);}return _0x8352da[_0x1408('0xdf')](_0x385bf6);}})[_0x1408('0x2e')](function(_0x1eec3b){if(_0x1eec3b){return _0x1eec3b?{'count':_0x5694e5,'rows':_0x1eec3b}:null;}})[_0x1408('0x2e')](respondWithResult(_0x96e29,null))[_0x1408('0x51')](handleError(_0x96e29,null));};exports[_0x1408('0xe1')]=function(_0x383a22,_0x56a7a7){var _0x59a87f={};var _0x4b3071={};var _0x2c4727;var _0x2b62f8;return db[_0x1408('0x3e')][_0x1408('0x8f')]({'where':{'id':_0x383a22[_0x1408('0x57')]['id']}})[_0x1408('0x2e')](handleEntityNotFound(_0x56a7a7,null))['then'](function(_0x275797){if(_0x275797){_0x2c4727=_0x275797;_0x4b3071[_0x1408('0xc6')]=_[_0x1408('0xcf')](db['FaxInteraction']['rawAttributes']);_0x4b3071['query']=_[_0x1408('0xcf')](_0x383a22[_0x1408('0x41')]);_0x4b3071['filters']=_[_0x1408('0xc8')](_0x4b3071[_0x1408('0xc6')],_0x4b3071['query']);_0x59a87f[_0x1408('0x44')]=_[_0x1408('0xc8')](_0x4b3071['model'],qs['fields'](_0x383a22[_0x1408('0x41')][_0x1408('0xc9')]));_0x59a87f[_0x1408('0x44')]=_0x59a87f['attributes']['length']?_0x59a87f[_0x1408('0x44')]:_0x4b3071[_0x1408('0xc6')];_0x59a87f[_0x1408('0xd0')]=qs[_0x1408('0xca')](_0x383a22[_0x1408('0x41')][_0x1408('0xca')]);_0x59a87f['where']=qs['filters'](_[_0x1408('0xd1')](_0x383a22[_0x1408('0x41')],_0x4b3071[_0x1408('0xcb')]));if(_0x383a22['query'][_0x1408('0x26')]){_0x59a87f[_0x1408('0x3d')]=_[_0x1408('0x54')](_0x59a87f[_0x1408('0x3d')],{'$or':_[_0x1408('0x28')](_0x59a87f[_0x1408('0x44')],function(_0x4c4b64){var _0x407221={};_0x407221[_0x4c4b64]={'$like':'%'+_0x383a22[_0x1408('0x41')][_0x1408('0x26')]+'%'};return _0x407221;})});}_0x59a87f=_[_0x1408('0x54')]({},_0x59a87f,_0x383a22[_0x1408('0xcc')]);return _0x2c4727[_0x1408('0xe1')](_0x59a87f);}})[_0x1408('0x2e')](function(_0x3a2588){if(_0x3a2588){_0x2b62f8=_0x3a2588[_0x1408('0x66')];if(!_0x383a22[_0x1408('0x41')]['hasOwnProperty'](_0x1408('0xce'))){_0x59a87f[_0x1408('0x18')]=qs[_0x1408('0x18')](_0x383a22['query']['limit']);_0x59a87f[_0x1408('0x16')]=qs[_0x1408('0x16')](_0x383a22['query']['offset']);}return _0x2c4727[_0x1408('0xe1')](_0x59a87f);}})[_0x1408('0x2e')](function(_0x5700f0){if(_0x5700f0){return _0x5700f0?{'count':_0x2b62f8,'rows':_0x5700f0}:null;}})[_0x1408('0x2e')](respondWithResult(_0x56a7a7,null))['catch'](handleError(_0x56a7a7,null));};exports[_0x1408('0xe2')]=function(_0xec3f86,_0x4a66da){var _0x568246={};var _0x5d9786={};var _0x460639;var _0x303fd7;return db[_0x1408('0x3e')][_0x1408('0x8f')]({'where':{'id':_0xec3f86[_0x1408('0x57')]['id']}})[_0x1408('0x2e')](handleEntityNotFound(_0x4a66da,null))[_0x1408('0x2e')](function(_0x3e2b72){if(_0x3e2b72){_0x460639=_0x3e2b72;_0x5d9786[_0x1408('0xc6')]=_['keys'](db[_0x1408('0xe3')][_0x1408('0x32')]);_0x5d9786[_0x1408('0x41')]=_[_0x1408('0xcf')](_0xec3f86[_0x1408('0x41')]);_0x5d9786[_0x1408('0xcb')]=_[_0x1408('0xc8')](_0x5d9786[_0x1408('0xc6')],_0x5d9786[_0x1408('0x41')]);_0x568246[_0x1408('0x44')]=_['intersection'](_0x5d9786[_0x1408('0xc6')],qs[_0x1408('0xc9')](_0xec3f86[_0x1408('0x41')][_0x1408('0xc9')]));_0x568246[_0x1408('0x44')]=_0x568246[_0x1408('0x44')][_0x1408('0x66')]?_0x568246[_0x1408('0x44')]:_0x5d9786[_0x1408('0xc6')];_0x568246[_0x1408('0xd0')]=qs['sort'](_0xec3f86[_0x1408('0x41')][_0x1408('0xca')]);_0x568246[_0x1408('0x3d')]=qs['filters'](_['pick'](_0xec3f86[_0x1408('0x41')],_0x5d9786[_0x1408('0xcb')]));if(_0xec3f86[_0x1408('0x41')][_0x1408('0x26')]){_0x568246[_0x1408('0x3d')]=_[_0x1408('0x54')](_0x568246[_0x1408('0x3d')],{'$or':_[_0x1408('0x28')](_0x568246[_0x1408('0x44')],function(_0xc23658){var _0x359cb5={};_0x359cb5[_0xc23658]={'$like':'%'+_0xec3f86['query'][_0x1408('0x26')]+'%'};return _0x359cb5;})});}_0x568246=_[_0x1408('0x54')]({},_0x568246,_0xec3f86[_0x1408('0xcc')]);return _0x460639['getWhatsappInteractions'](_0x568246);}})[_0x1408('0x2e')](function(_0x58eec0){if(_0x58eec0){_0x303fd7=_0x58eec0[_0x1408('0x66')];if(!_0xec3f86['query'][_0x1408('0xc0')](_0x1408('0xce'))){_0x568246['limit']=qs[_0x1408('0x18')](_0xec3f86[_0x1408('0x41')][_0x1408('0x18')]);_0x568246[_0x1408('0x16')]=qs[_0x1408('0x16')](_0xec3f86[_0x1408('0x41')]['offset']);}return _0x460639[_0x1408('0xe2')](_0x568246);}})[_0x1408('0x2e')](function(_0x5535bc){if(_0x5535bc){return _0x5535bc?{'count':_0x303fd7,'rows':_0x5535bc}:null;}})['then'](respondWithResult(_0x4a66da,null))['catch'](handleError(_0x4a66da,null));};exports[_0x1408('0xe4')]=function(_0x3379c5,_0x1581c8,_0x360644){var _0x2c78a2;var _0x464bfc;var _0x1e7b24;var _0x5ba9b7=!_[_0x1408('0x61')](_0x3379c5['params']['id'])?_0x3379c5[_0x1408('0x57')]['id']:!_[_0x1408('0x61')](_0x3379c5[_0x1408('0x7a')]['id'])?_0x3379c5[_0x1408('0x7a')]['id']:null;return db['User'][_0x1408('0x2b')]({'where':{'id':_0x5ba9b7,'role':{'$or':[_0x1408('0x22'),_0x1408('0x7a'),_0x1408('0x1d')]}},'attributes':['id','name',_0x1408('0xe5'),'mobile',_0x1408('0x1c'),'internal','loginInPause']})[_0x1408('0x2e')](function(_0x37140d){if(_0x37140d){if(_0x37140d[_0x1408('0x1c')]===_0x1408('0x1d')){_0x2c78a2=_0x37140d;if(_0x3379c5[_0x1408('0x56')][_0x1408('0x98')]){_0x1e7b24=util[_0x1408('0xa2')](_0x1408('0xe6'),_0x2c78a2[_0x3379c5[_0x1408('0x56')][_0x1408('0x98')]]);}else if(_0x3379c5[_0x1408('0x56')][_0x1408('0xe7')]){_0x1e7b24=util[_0x1408('0xa2')](_0x1408('0xe8'),_0x3379c5[_0x1408('0x56')]['intrf']);}else{_0x1e7b24=util[_0x1408('0xa2')]('SIP/%s',_0x2c78a2[_0x1408('0x2c')]);}socket['to'](util['format'](_0x1408('0xe9'),_0x2c78a2[_0x1408('0x2c')]))[_0x1408('0x1e')](_0x1408('0xea'),{'user':{'id':_0x2c78a2['id'],'name':_0x2c78a2[_0x1408('0x2c')]},'ip':_0x3379c5['headers'][_0x1408('0xeb')]||_0x3379c5['connection'][_0x1408('0xec')]||_0x3379c5[_0x1408('0xed')]['remoteAddress']||_0x3379c5[_0x1408('0xee')][_0x1408('0xed')]['remoteAddress']});return db[_0x1408('0xa3')]['destroy']({'where':{'membername':_0x2c78a2[_0x1408('0x2c')]},'individualHooks':!![]});}}else{throw new db[(_0x1408('0x89'))][(_0x1408('0x8a'))]('User\x20not\x20found\x20or\x20not\x20allowed\x20to\x20perform\x20login\x20method');}})['then'](function(){if(_0x2c78a2){return _0x2c78a2[_0x1408('0xef')]({'raw':!![]});}})[_0x1408('0x2e')](function(_0x1c36db){if(_0x2c78a2){if(_0x1c36db){_0x464bfc=_0x1c36db;if(_0x464bfc['length']){var _0x49a61a=_0x464bfc[_0x1408('0x28')](function(_0x2f49ce){var _0x4606a3={'membername':_0x2c78a2['name'],'UserId':_0x2c78a2['id'],'queue_name':_0x2f49ce[_0x1408('0x2c')],'VoiceQueueId':_0x2f49ce['id'],'interface':_0x1e7b24,'paused':_0x2c78a2['loginInPause']||![],'penalty':_0x2f49ce[_0x1408('0xf0')]||0x0};return db[_0x1408('0xa3')][_0x1408('0xa4')](_0x4606a3);});return Promise[_0x1408('0x50')](_0x49a61a);}}}})['then'](function(){if(_0x2c78a2){return db['MemberReport'][_0x1408('0x46')]({'where':{'membername':_0x2c78a2[_0x1408('0x2c')],'exitAt':null}});}})['then'](function(_0xd5e084){if(_0x2c78a2){var _0x5931f2=[];_0xd5e084[_0x1408('0xf1')](function(_0x9c7665){_0x5931f2[_0x1408('0x45')](_0x9c7665['update']({'exitAt':moment()[_0x1408('0xa2')](_0x1408('0xf2'))}));});return Promise[_0x1408('0x50')](_0x5931f2);}})[_0x1408('0x2e')](function(){if(_0x2c78a2){var _0x5aa504=[];var _0x212ae0=[];var _0x5e6772=utils['getChannels']();var _0x3c1f24={'membername':_0x2c78a2[_0x1408('0x2c')],'interface':_0x1e7b24,'enterAt':moment()['format'](_0x1408('0xf2')),'role':_0x2c78a2[_0x1408('0x1c')],'internal':_0x2c78a2['internal']};_0x5e6772[_0x1408('0xf1')](function(_0x1e113f){_0x5aa504[_0x1408('0x45')](_[_0x1408('0x54')]({'channel':_0x1e113f,'type':_0x1408('0xf3'),'data1':_0x3379c5[_0x1408('0x56')][_0x1408('0xf4')],'data2':_0x1e7b24},_0x3c1f24));if(_0x2c78a2[_0x1408('0x96')]){_0x212ae0['push'](_[_0x1408('0x54')]({'channel':_0x1e113f,'type':_0x1408('0xf5'),'data1':'LOGININPAUSE'},_0x3c1f24));}});return db[_0x1408('0xf6')][_0x1408('0x81')](_0x5aa504['concat'](_0x212ae0),{'individualHooks':!![]});}})[_0x1408('0x2e')](function(){if(_0x2c78a2){return _0x2c78a2[_0x1408('0x1b')]({'online':!![],'lastLoginAt':moment()['format'](_0x1408('0xf2')),'voicePause':_0x2c78a2['loginInPause']||![],'mailPause':_0x2c78a2[_0x1408('0x96')]||![],'chatPause':_0x2c78a2['loginInPause']||![],'faxPause':_0x2c78a2[_0x1408('0x96')]||![],'smsPause':_0x2c78a2['loginInPause']||![],'openchannelPause':_0x2c78a2['loginInPause']||![],'whatsappPause':_0x2c78a2[_0x1408('0x96')]||![],'pauseType':_0x2c78a2[_0x1408('0x96')]?_0x1408('0xf7'):null,'interface':_0x1e7b24,'lastPauseAt':moment()[_0x1408('0xa2')](_0x1408('0xf2'))});}})['then'](function(_0x1d05a0){if(_0x3379c5['isMiddleware']){return _0x360644();}else{return Promise['resolve'](_0x1d05a0)['then'](respondWithResult(_0x1581c8,null));}})['catch'](handleError(_0x1581c8,null));};exports[_0x1408('0xf8')]=function(_0x5ea415,_0x768d19){var _0x1ca953;return db[_0x1408('0x3e')][_0x1408('0x2b')]({'where':{'id':_0x5ea415[_0x1408('0x57')]['id'],'role':_0x1408('0x1d')},'attributes':['id',_0x1408('0x2c'),_0x1408('0x1c')]})[_0x1408('0x2e')](handleEntityNotFound(_0x768d19,null))[_0x1408('0x2e')](function(_0x318adf){if(_0x318adf){_0x1ca953=_0x318adf;return db[_0x1408('0xa3')][_0x1408('0x20')]({'where':{'membername':_0x1ca953['name']},'individualHooks':!![]});}})[_0x1408('0x2e')](function(){return db[_0x1408('0xf6')]['findAll']({'where':{'membername':_0x1ca953[_0x1408('0x2c')],'exitAt':null}});})[_0x1408('0x2e')](function(_0x57f9ac){var _0x2e274f=[];_0x57f9ac['forEach'](function(_0x3827db){_0x2e274f[_0x1408('0x45')](_0x3827db['update']({'exitAt':moment()[_0x1408('0xa2')]('YYYY-MM-DD\x20HH:mm:ss')}));});return Promise[_0x1408('0x50')](_0x2e274f);})[_0x1408('0x2e')](function(){return _0x1ca953[_0x1408('0x1b')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})[_0x1408('0x2e')](respondWithResult(_0x768d19,null))[_0x1408('0x51')](handleError(_0x768d19,null));};exports[_0x1408('0xf9')]=function(_0x382cb7,_0x1d6019){var _0x421d50;return db[_0x1408('0xa3')]['update']({'paused':0x1},{'where':{'UserId':_0x382cb7[_0x1408('0x57')]['id']},'individualHooks':!![]})[_0x1408('0x2e')](function(){return db[_0x1408('0x3e')][_0x1408('0x2b')]({'where':{'id':_0x382cb7[_0x1408('0x57')]['id'],'role':_0x1408('0x1d')},'attributes':['id','name','role','internal',_0x1408('0x98'),_0x1408('0x95')]});})[_0x1408('0x2e')](handleEntityNotFound(_0x1d6019,null))[_0x1408('0x2e')](function(_0x24e74c){if(_0x24e74c){_0x421d50=_0x24e74c;return db[_0x1408('0xf6')][_0x1408('0x46')]({'where':{'membername':_0x421d50[_0x1408('0x2c')],'type':_0x1408('0xf5'),'exitAt':null}});}})[_0x1408('0x2e')](function(_0x4b17ba){if(_0x4b17ba[_0x1408('0x66')]){var _0x34339f=moment()[_0x1408('0xa2')](_0x1408('0xf2'));for(var _0x45eec6=0x0,_0x4849f2=_0x4b17ba[_0x1408('0x66')];_0x45eec6<_0x4849f2;_0x45eec6++){_0x4b17ba[_0x45eec6][_0x1408('0xfa')]({'exitAt':_0x34339f});}}})['then'](function(){var _0x41ebdd=[];var _0x475eef=utils[_0x1408('0xfb')]();_0x475eef['forEach'](function(_0x5631ad){_0x41ebdd[_0x1408('0x45')]({'channel':_0x5631ad,'membername':_0x421d50[_0x1408('0x2c')],'interface':_['isNil'](_0x421d50[_0x1408('0x98')])?util[_0x1408('0xa2')]('SIP/%s',_0x421d50[_0x1408('0x2c')]):_0x421d50['interface'],'type':_0x1408('0xf5'),'enterAt':moment()['format'](_0x1408('0xf2')),'data1':_0x382cb7[_0x1408('0x56')]['type']||_0x1408('0xfc'),'role':_0x421d50['role'],'internal':_0x421d50[_0x1408('0x5c')]});});return db[_0x1408('0xf6')][_0x1408('0x81')](_0x41ebdd,{'individualHooks':!![]});})[_0x1408('0x2e')](function(){return _0x421d50['update']({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0x382cb7[_0x1408('0x56')]['type']||_0x1408('0xfc'),'lastPauseAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')});})[_0x1408('0x2e')](respondWithResult(_0x1d6019,null))['catch'](handleError(_0x1d6019,null));};exports[_0x1408('0xfd')]=function(_0x1e968f,_0x793e58){if(_0x1e968f[_0x1408('0x56')][_0x1408('0x94')]&&!utils[_0x1408('0xfe')](_0x1e968f[_0x1408('0x56')][_0x1408('0x94')])){throw new APIBadRequestError(util[_0x1408('0xa2')]('Channel\x20parameter\x20%s\x20is\x20invalid',_0x1e968f[_0x1408('0x56')]['channel']));}return db[_0x1408('0x3e')][_0x1408('0x2b')]({'where':{'id':_0x1e968f[_0x1408('0x57')]['id']},'attributes':['id','name',_0x1408('0x1c'),'internal',_0x1408('0x98'),_0x1408('0x95'),'voicePause','mailPause',_0x1408('0xff'),_0x1408('0x100'),'openchannelPause','smsPause',_0x1408('0x101'),_0x1408('0x102'),'lastPauseAt']})['then'](function(_0x51d8b7){if(!_0x51d8b7){throw new APINotFoundError(util['format'](_0x1408('0xbf'),_0x1e968f[_0x1408('0x57')]['id']));}return _0x51d8b7[_0x1408('0xfd')](_0x1e968f[_0x1408('0x56')][_0x1408('0x94')]);})[_0x1408('0x2e')](respondWithResult(_0x793e58,null))['catch'](APIHandleError(_0x793e58));};exports[_0x1408('0x103')]=function(_0xc920e6,_0x2a2873){var _0x4f2296={};var _0x5d5796={};var _0xf1ed04;var _0xa32f3d;return db['User'][_0x1408('0x8f')]({'where':{'id':_0xc920e6[_0x1408('0x57')]['id']}})[_0x1408('0x2e')](handleEntityNotFound(_0x2a2873,null))[_0x1408('0x2e')](function(_0x12d6f0){if(_0x12d6f0){_0xf1ed04=_0x12d6f0;_0x5d5796['model']=_[_0x1408('0xcf')](db[_0x1408('0x104')][_0x1408('0x32')]);_0x5d5796[_0x1408('0x41')]=_[_0x1408('0xcf')](_0xc920e6[_0x1408('0x41')]);_0x5d5796[_0x1408('0xcb')]=_[_0x1408('0xc8')](_0x5d5796['model'],_0x5d5796[_0x1408('0x41')]);_0x4f2296['attributes']=_['intersection'](_0x5d5796[_0x1408('0xc6')],qs[_0x1408('0xc9')](_0xc920e6[_0x1408('0x41')][_0x1408('0xc9')]));_0x4f2296[_0x1408('0x44')]=_0x4f2296[_0x1408('0x44')][_0x1408('0x66')]?_0x4f2296[_0x1408('0x44')]:_0x5d5796[_0x1408('0xc6')];_0x4f2296[_0x1408('0xd0')]=qs['sort'](_0xc920e6[_0x1408('0x41')]['sort']);_0x4f2296['where']=qs[_0x1408('0xcb')](_['pick'](_0xc920e6[_0x1408('0x41')],_0x5d5796[_0x1408('0xcb')]));if(_0xc920e6['query'][_0x1408('0x26')]){_0x4f2296[_0x1408('0x3d')]=_[_0x1408('0x54')](_0x4f2296['where'],{'$or':_[_0x1408('0x28')](_0x4f2296[_0x1408('0x44')],function(_0x105389){var _0x4445ae={};_0x4445ae[_0x105389]={'$like':'%'+_0xc920e6['query'][_0x1408('0x26')]+'%'};return _0x4445ae;})});}_0x4f2296=_[_0x1408('0x54')]({},_0x4f2296,_0xc920e6[_0x1408('0xcc')]);return _0xf1ed04['getTeams'](_0x4f2296);}})[_0x1408('0x2e')](function(_0x10d0f3){if(_0x10d0f3){_0xa32f3d=_0x10d0f3[_0x1408('0x66')];if(!_0xc920e6['query'][_0x1408('0xc0')]('nolimit')){_0x4f2296['limit']=qs[_0x1408('0x18')](_0xc920e6['query'][_0x1408('0x18')]);_0x4f2296['offset']=qs[_0x1408('0x16')](_0xc920e6[_0x1408('0x41')][_0x1408('0x16')]);}return _0xf1ed04[_0x1408('0x103')](_0x4f2296);}})[_0x1408('0x2e')](function(_0x8edc88){if(_0x8edc88){return _0x8edc88?{'count':_0xa32f3d,'rows':_0x8edc88}:null;}})['then'](respondWithResult(_0x2a2873,null))['catch'](handleError(_0x2a2873,null));};exports['addTeams']=function(_0x59ebbb,_0x1227c3){var _0x1fe87c=_0x59ebbb[_0x1408('0x57')]['id'];var _0x2fb646=_0x59ebbb[_0x1408('0x56')]?_0x59ebbb[_0x1408('0x56')][_0x1408('0x5a')]:null;var _0x253040=[];return Promise[_0x1408('0x105')]()['then'](function(){if(!_0x2fb646)throw new APIBadRequestError(_0x1408('0x106'));})['then'](function(){return db[_0x1408('0x3e')][_0x1408('0x8f')]({'where':{'id':_0x1fe87c}});})[_0x1408('0x2e')](function(_0x778658){if(!_0x778658)throw new APINotFoundError(util[_0x1408('0xa2')](_0x1408('0xbf'),_0x59ebbb[_0x1408('0x57')]['id']));return db[_0x1408('0x63')][_0x1408('0x107')](function(_0x547d28){return _0x778658[_0x1408('0x108')](_0x2fb646,{'transaction':_0x547d28})[_0x1408('0x2e')](function(){return db[_0x1408('0x104')][_0x1408('0x46')]({'where':{'id':{'$in':_0x2fb646}}});})[_0x1408('0x2e')](function(_0x4ff2c0){var _0x4bfe3f=_['map'](_0x4ff2c0,function(_0x11650c){return _0x11650c[_0x1408('0x109')]();});return Promise[_0x1408('0x50')](_0x4bfe3f);})['then'](function(_0xeeddbe){_0x253040=_[_0x1408('0x10a')](_0xeeddbe);var _0x52a9e3=_[_0x1408('0x28')](_0x253040,function(_0x460ab6){return _0x460ab6[_0x1408('0x10b')](_0x778658['id'],{'transaction':_0x547d28});});return Promise[_0x1408('0x50')](_0x52a9e3);})[_0x1408('0x2e')](function(){if(!_0x778658[_0x1408('0x95')])return;var _0x492940=_[_0x1408('0x26')](_0x253040,function(_0x14e8ce){return _0x14e8ce[_0x1408('0x10c')](_0x1408('0x94'))===_0x1408('0x10d');});var _0x40baee=_[_0x1408('0x28')](_0x492940,function(_0x2da696){return db[_0x1408('0xa3')][_0x1408('0xa4')]({'membername':_0x778658['name'],'UserId':_0x778658['id'],'queue_name':_0x2da696[_0x1408('0x2c')],'VoiceQueueId':_0x2da696['id'],'interface':_[_0x1408('0x61')](_0x778658[_0x1408('0x98')])?util['format'](_0x1408('0xe8'),_0x778658[_0x1408('0x2c')]):_0x778658[_0x1408('0x98')],'paused':_0x778658[_0x1408('0x97')]||![],'penalty':_0x778658['penalty']},{'transaction':_0x547d28});});return Promise['all'](_0x40baee);})[_0x1408('0x2e')](function(){return db[_0x1408('0x10e')]['findAll']({'where':{'teamId':{'$in':_0x2fb646}}});})[_0x1408('0x2e')](function(_0x31dd99){var _0x3a3b2b=_['map'](_0x31dd99,function(_0x5008f8){return db[_0x1408('0x10f')]['create']({'UserId':_0x778658['id'],'VoicePrefixId':_0x5008f8[_0x1408('0x110')]},{'transaction':_0x547d28});});return Promise[_0x1408('0x50')](_0x3a3b2b);});});})[_0x1408('0x2e')](function(){for(var _0x34bb74=0x0;_0x34bb74<_0x253040[_0x1408('0x66')];_0x34bb74++){var _0x56ba2e=_0x253040[_0x34bb74][_0x1408('0x10c')]('channel');var _0x38b7d8=_0x56ba2e+_0x1408('0xa9');socket['emit'](_0x1408('0x7a')+_0x56ba2e+_0x1408('0x111'),{'UserId':_0x1fe87c,['queueField']:_0x253040[_0x34bb74]['id']});}})[_0x1408('0x2e')](respondWithStatusCode(_0x1227c3,null))[_0x1408('0x51')](APIHandleError(_0x1227c3));};exports[_0x1408('0x112')]=function(_0x5676df,_0x17a80a){var _0x60c20b=_0x5676df[_0x1408('0x57')]['id'];var _0x1102df=null;if(_0x5676df[_0x1408('0x41')][_0x1408('0x5a')]){_0x1102df=_[_0x1408('0xa7')](_0x5676df[_0x1408('0x41')][_0x1408('0x5a')])?_0x5676df[_0x1408('0x41')][_0x1408('0x5a')]:[_0x5676df['query'][_0x1408('0x5a')]];}var _0x273f7c=[];return Promise[_0x1408('0x105')]()[_0x1408('0x2e')](function(){if(!_0x1102df)throw new APIBadRequestError(_0x1408('0x113'));})['then'](function(){return db[_0x1408('0x3e')][_0x1408('0x8f')]({'where':{'id':_0x60c20b}});})[_0x1408('0x2e')](function(_0x4ff80f){if(!_0x4ff80f)throw new APINotFoundError(util['format']('User\x20with\x20id\x20%s\x20not\x20found',_0x5676df[_0x1408('0x57')]['id']));return db[_0x1408('0x63')]['transaction'](function(_0x3bda9b){return _0x4ff80f[_0x1408('0x112')](_0x1102df,{'transaction':_0x3bda9b})[_0x1408('0x2e')](function(){return db[_0x1408('0x104')][_0x1408('0x46')]({'where':{'id':{'$in':_0x1102df}}});})[_0x1408('0x2e')](function(_0x12bbef){var _0x47d14d=_[_0x1408('0x28')](_0x12bbef,function(_0x3ec6dd){return _0x3ec6dd[_0x1408('0x109')]();});return Promise[_0x1408('0x50')](_0x47d14d);})[_0x1408('0x2e')](function(_0xaca717){_0x273f7c=_['flattenDeep'](_0xaca717);var _0x2fbff6=_['map'](_0x273f7c,function(_0x265379){return _0x265379[_0x1408('0x114')](_0x4ff80f['id'],{'transaction':_0x3bda9b});});return Promise[_0x1408('0x50')](_0x2fbff6);})[_0x1408('0x2e')](function(){if(!_0x4ff80f[_0x1408('0x95')])return;var _0x48ad56=_[_0x1408('0x26')](_0x273f7c,function(_0x3b29cf){return _0x3b29cf[_0x1408('0x10c')](_0x1408('0x94'))===_0x1408('0x10d');});var _0x51a98c=_[_0x1408('0x28')](_0x48ad56,function(_0x25bd47){return db[_0x1408('0xa3')][_0x1408('0x20')]({'where':{'VoiceQueueId':_0x25bd47['id'],'UserId':_0x4ff80f['id']},'transaction':_0x3bda9b});});return Promise[_0x1408('0x50')](_0x51a98c);})[_0x1408('0x2e')](function(){return db['TeamVoicePrefix'][_0x1408('0x46')]({'where':{'teamId':{'$in':_0x1102df}}});})['then'](function(_0x5d48e6){var _0x1d424d=_[_0x1408('0x28')](_0x5d48e6,function(_0x4df397){return db['UserVoicePrefix'][_0x1408('0x20')]({'where':{'UserId':_0x4ff80f['id'],'VoicePrefixId':_0x4df397[_0x1408('0x110')]}},{'transaction':_0x3bda9b});});return Promise[_0x1408('0x50')](_0x1d424d);});});})[_0x1408('0x2e')](function(){for(var _0x1dfd31=0x0;_0x1dfd31<_0x273f7c[_0x1408('0x66')];_0x1dfd31++){var _0x3d6d7f=_0x273f7c[_0x1dfd31][_0x1408('0x10c')](_0x1408('0x94'));var _0x26785d=_0x3d6d7f+'QueueId';socket[_0x1408('0x1e')](_0x1408('0x7a')+_0x3d6d7f+_0x1408('0xa8'),{'UserId':_0x60c20b,['queueField']:_0x273f7c[_0x1dfd31]['id']});}})[_0x1408('0x2e')](respondWithStatusCode(_0x17a80a,null))[_0x1408('0x51')](APIHandleError(_0x17a80a));};exports[_0x1408('0x115')]=function(_0x3f99e0,_0x26489e){var _0x5308b8={};var _0x450aca={};var _0x2c5e84;var _0xc8d88d;return db[_0x1408('0x3e')]['findOne']({'where':{'id':_0x3f99e0[_0x1408('0x57')]['id']}})[_0x1408('0x2e')](handleEntityNotFound(_0x26489e,null))[_0x1408('0x2e')](function(_0x4ed53d){if(_0x4ed53d){_0x2c5e84=_0x4ed53d;_0x450aca[_0x1408('0xc6')]=_[_0x1408('0xcf')](db[_0x1408('0x116')][_0x1408('0x32')]);_0x450aca[_0x1408('0x41')]=_[_0x1408('0xcf')](_0x3f99e0[_0x1408('0x41')]);_0x450aca[_0x1408('0xcb')]=_[_0x1408('0xc8')](_0x450aca['model'],_0x450aca[_0x1408('0x41')]);_0x5308b8['attributes']=_[_0x1408('0xc8')](_0x450aca[_0x1408('0xc6')],qs[_0x1408('0xc9')](_0x3f99e0[_0x1408('0x41')][_0x1408('0xc9')]));_0x5308b8[_0x1408('0x44')]=_0x5308b8[_0x1408('0x44')][_0x1408('0x66')]?_0x5308b8[_0x1408('0x44')]:_0x450aca[_0x1408('0xc6')];_0x5308b8[_0x1408('0xd0')]=qs[_0x1408('0xca')](_0x3f99e0['query'][_0x1408('0xca')]);_0x5308b8['where']=qs[_0x1408('0xcb')](_[_0x1408('0xd1')](_0x3f99e0[_0x1408('0x41')],_0x450aca['filters']));if(_0x3f99e0[_0x1408('0x41')][_0x1408('0x26')]){_0x5308b8[_0x1408('0x3d')]=_['merge'](_0x5308b8[_0x1408('0x3d')],{'$or':_[_0x1408('0x28')](_0x5308b8[_0x1408('0x44')],function(_0x82022){var _0xb258e6={};_0xb258e6[_0x82022]={'$like':'%'+_0x3f99e0[_0x1408('0x41')][_0x1408('0x26')]+'%'};return _0xb258e6;})});}_0x5308b8=_[_0x1408('0x54')]({},_0x5308b8,_0x3f99e0[_0x1408('0xcc')]);return _0x2c5e84[_0x1408('0x115')](_0x5308b8);}})[_0x1408('0x2e')](function(_0x411b87){if(_0x411b87){_0xc8d88d=_0x411b87[_0x1408('0x66')];if(!_0x3f99e0[_0x1408('0x41')][_0x1408('0xc0')](_0x1408('0xce'))){_0x5308b8[_0x1408('0x18')]=qs['limit'](_0x3f99e0[_0x1408('0x41')][_0x1408('0x18')]);_0x5308b8[_0x1408('0x16')]=qs[_0x1408('0x16')](_0x3f99e0['query'][_0x1408('0x16')]);}return _0x2c5e84['getLists'](_0x5308b8);}})[_0x1408('0x2e')](function(_0x392894){if(_0x392894){return _0x392894?{'count':_0xc8d88d,'rows':_0x392894}:null;}})[_0x1408('0x2e')](respondWithResult(_0x26489e,null))[_0x1408('0x51')](handleError(_0x26489e,null));};exports[_0x1408('0x117')]=function(_0x410c62,_0x3f3770){var _0x21f2f2={};var _0x2c7a64={};var _0x21b830;return db[_0x1408('0x3e')][_0x1408('0x8f')]({'where':{'id':_0x410c62[_0x1408('0x57')]['id']}})[_0x1408('0x2e')](handleEntityNotFound(_0x3f3770,null))['then'](function(_0x649c8b){if(_0x649c8b){_0x21b830=_0x649c8b;_0x2c7a64[_0x1408('0xc6')]=_['keys'](db['User'][_0x1408('0x32')]);_0x2c7a64[_0x1408('0x41')]=_[_0x1408('0xcf')](_0x410c62[_0x1408('0x41')]);_0x2c7a64[_0x1408('0xcb')]=_[_0x1408('0xc8')](_0x2c7a64[_0x1408('0xc6')],_0x2c7a64[_0x1408('0x41')]);_0x21f2f2[_0x1408('0x44')]=_[_0x1408('0xc8')](_0x2c7a64['model'],qs['fields'](_0x410c62['query'][_0x1408('0xc9')]));_0x21f2f2[_0x1408('0x44')]=_0x21f2f2['attributes']['length']?_0x21f2f2[_0x1408('0x44')]:_0x2c7a64[_0x1408('0xc6')];_0x21f2f2['order']=qs[_0x1408('0xca')](_0x410c62[_0x1408('0x41')][_0x1408('0xca')]);_0x21f2f2[_0x1408('0x3d')]=qs['filters'](_[_0x1408('0xd1')](_0x410c62[_0x1408('0x41')],_0x2c7a64[_0x1408('0xcb')]));if(_0x410c62[_0x1408('0x41')][_0x1408('0x26')]){_0x21f2f2[_0x1408('0x3d')]=_[_0x1408('0x54')](_0x21f2f2[_0x1408('0x3d')],{'$or':_[_0x1408('0x28')](_0x21f2f2[_0x1408('0x44')],function(_0x3ef918){var _0x4fd6cf={};_0x4fd6cf[_0x3ef918]={'$like':'%'+_0x410c62['query'][_0x1408('0x26')]+'%'};return _0x4fd6cf;})});}_0x21f2f2[_0x1408('0xc6')]=db[_0x1408('0x3e')];_0x21f2f2['as']=_0x1408('0x23');_0x21f2f2=_[_0x1408('0x54')]({},_0x21f2f2,_0x410c62['options']);return _0x21b830['getVoiceQueues']({'include':[_0x21f2f2]});}})['then'](function(_0x18647e){if(_0x18647e){var _0x1952e0={},_0x1fdf04=[];for(var _0x409ae8=0x0;_0x409ae8<_0x18647e[_0x1408('0x66')];_0x409ae8+=0x1){for(var _0x59f813=0x0,_0x22e127;_0x59f813<_0x18647e[_0x409ae8][_0x1408('0x23')]['length'];_0x59f813+=0x1){_0x22e127=_0x18647e[_0x409ae8][_0x1408('0x23')][_0x59f813][_0x1408('0x21')]({'plain':!![]});_0x1952e0[_0x22e127['id']]=_0x22e127;}}_0x1952e0=_[_0x1408('0x118')](_0x1952e0);for(var _0xe16c1b=qs[_0x1408('0x16')](_0x410c62[_0x1408('0x41')][_0x1408('0x16')]);_0xe16c1b<_0x1952e0[_0x1408('0x66')]&&_0x1fdf04[_0x1408('0x66')]=_0x3a319e){_0x351b12=_0x3a319e;_0x5da5b0=0xc8;}else{_0x5da5b0=0xce;}_0x5486e6[_0xa8fa('0x13')](_0x5da5b0);return _0x5486e6[_0xa8fa('0x19')](_0xa8fa('0x1a'),_0x1baa33+'-'+_0x351b12+'/'+_0x3a319e)[_0xa8fa('0x14')](_0x2824e1);}return null;};}function saveUpdates(_0x27332d){return function(_0x586253){if(_0x586253){return _0x586253[_0xa8fa('0x1b')](_0x27332d)[_0xa8fa('0x1c')](function(_0x33cacf){if(_0x33cacf[_0xa8fa('0x1d')]==='agent'){socket[_0xa8fa('0x1e')](_0xa8fa('0x1f')+_0x33cacf['id'],_0x33cacf);}return _0x33cacf;});}return null;};}function removeEntity(_0x1a130d){return function(_0x7d8581){if(_0x7d8581){return _0x7d8581[_0xa8fa('0x20')]()['then'](function(){var _0x4a14d7=_0x7d8581[_0xa8fa('0x21')]({'plain':!![]});if(_0x4a14d7[_0xa8fa('0x1d')]===_0xa8fa('0x22'))return;var _0x4d0f41=[{'name':_0xa8fa('0x23'),'value':_0xa8fa('0x24'),'ignore':!![]},{'name':_0xa8fa('0x25'),'value':_0xa8fa('0x26'),'ignore':![]},{'name':_0xa8fa('0x27'),'value':_0xa8fa('0x28'),'ignore':![]}];var _0x4ea35d=_(_0x4d0f41)['filter'](_0xa8fa('0x29'))[_0xa8fa('0x2a')](_0xa8fa('0x2b'))[_0xa8fa('0x2b')]();if(_[_0xa8fa('0x2c')](_0x4ea35d,_0x4a14d7[_0xa8fa('0x1d')])){return;}var _0x1349cb=_[_0xa8fa('0x2d')](_0x4d0f41,[_0xa8fa('0x2b'),_0x4a14d7[_0xa8fa('0x1d')]])[_0xa8fa('0x2e')];return db[_0xa8fa('0x2f')]['destroy']({'where':{'type':_0x1349cb,'resourceId':_0x4a14d7['id']}})['then'](function(){return _0x7d8581;});})[_0xa8fa('0x1c')](function(){_0x1a130d[_0xa8fa('0x13')](0xcc)[_0xa8fa('0x30')]();});}};}function handleEntityNotFound(_0xa7100c){return function(_0x5eac35){if(!_0x5eac35){_0xa7100c[_0xa8fa('0x31')](0x194);}return _0x5eac35;};}function handleError(_0x391874,_0x39ec63){_0x39ec63=_0x39ec63||0x1f4;return function(_0x522bbf){logger[_0xa8fa('0x32')](_0x522bbf[_0xa8fa('0x33')]);if(_0x522bbf[_0xa8fa('0x2e')]){delete _0x522bbf[_0xa8fa('0x2e')];}_0x391874[_0xa8fa('0x13')](_0x39ec63)[_0xa8fa('0x34')](_0x522bbf);};}function getUserAttributes(){return _(db[_0xa8fa('0x35')]['rawAttributes'])[_0xa8fa('0x2a')](function(_0x2c6330){return{'name':_0x2c6330[_0xa8fa('0x36')],'type':_0x2c6330[_0xa8fa('0x37')][_0xa8fa('0x38')]};})[_0xa8fa('0x39')](function(_0x486836){return![_0xa8fa('0x3a'),_0xa8fa('0x3b'),_0xa8fa('0x3c'),_0xa8fa('0x3d'),_0xa8fa('0x3e'),'md5secret'][_0xa8fa('0x2c')](_0x486836[_0xa8fa('0x2e')]);})[_0xa8fa('0x2b')]();}exports[_0xa8fa('0x3f')]=function(_0xef4854,_0x593f88){var _0x4c0af3={},_0x322858={'count':0x0,'rows':[]};var _0x4d0373=getUserAttributes();_0x4c0af3=qs[_0xa8fa('0x40')](_0x4d0373,_0xef4854);var _0x3ab058={'where':_0x4c0af3[_0xa8fa('0x41')]};return db[_0xa8fa('0x35')][_0xa8fa('0x18')](_0x3ab058)['then'](function(_0x4a99d3){_0x322858[_0xa8fa('0x18')]=_0x4a99d3;if(_0xef4854[_0xa8fa('0x42')]['includeAll']){_0x4c0af3['include']=[{'all':!![]}];}if(_0xef4854['query'][_0xa8fa('0x43')]===_0xa8fa('0x44')){_0x4c0af3[_0xa8fa('0x45')]=[{'model':db['UserSetting'],'as':'userSetting'}];}if(!_['includes'](_0x4c0af3[_0xa8fa('0x46')],'id')){_0x4c0af3[_0xa8fa('0x46')]['push']('id');}return db[_0xa8fa('0x35')][_0xa8fa('0x47')](_0x4c0af3);})[_0xa8fa('0x1c')](function(_0x4c1636){_0x322858[_0xa8fa('0x48')]=_0x4c1636;if(_0xef4854[_0xa8fa('0x42')][_0xa8fa('0x49')]===_0xa8fa('0x44')){var _0x7d581b=[];for(var _0x1c2103=0x0;_0x1c2103<_0x322858[_0xa8fa('0x48')][_0xa8fa('0x4a')];_0x1c2103++){_0x7d581b[_0xa8fa('0x4b')](get_open_tabs(_0xa8fa('0x4c'),_0x322858[_0xa8fa('0x48')][_0x1c2103][_0xa8fa('0x4d')]));_0x7d581b[_0xa8fa('0x4b')](get_open_tabs('sms',_0x322858[_0xa8fa('0x48')][_0x1c2103]['dataValues']));_0x7d581b[_0xa8fa('0x4b')](get_open_tabs(_0xa8fa('0x4e'),_0x322858[_0xa8fa('0x48')][_0x1c2103][_0xa8fa('0x4d')]));_0x7d581b[_0xa8fa('0x4b')](get_open_tabs('mail',_0x322858[_0xa8fa('0x48')][_0x1c2103]['dataValues']));_0x7d581b['push'](get_open_tabs(_0xa8fa('0x4f'),_0x322858[_0xa8fa('0x48')][_0x1c2103][_0xa8fa('0x4d')]));_0x7d581b[_0xa8fa('0x4b')](get_open_tabs(_0xa8fa('0x50'),_0x322858[_0xa8fa('0x48')][_0x1c2103]['dataValues']));}return Promise['all'](_0x7d581b)[_0xa8fa('0x1c')](function(){return _0x322858;});}else{return _0x322858;}})[_0xa8fa('0x1c')](respondWithFilteredResult(_0x593f88,_0x4c0af3))[_0xa8fa('0x51')](handleError(_0x593f88,null));};exports['show']=function(_0x785ebc,_0x2a8196){var _0x21e99d=getUserAttributes();_0x785ebc['query']['id']=_0x785ebc[_0xa8fa('0x52')]['id'];var _0x226424=qs[_0xa8fa('0x40')](_0x21e99d,_0x785ebc);if(_0x785ebc['query'][_0xa8fa('0x53')]){_0x226424[_0xa8fa('0x45')]=[{'all':!![]}];}if(_0x785ebc['query'][_0xa8fa('0x43')]===_0xa8fa('0x44')){_0x226424[_0xa8fa('0x45')]=[{'model':db[_0xa8fa('0x54')],'as':_0xa8fa('0x43')}];}_0x226424=_['merge']({},_0x226424,_0x785ebc[_0xa8fa('0x55')]);if(!_[_0xa8fa('0x2c')](_0x226424[_0xa8fa('0x46')],'id')){_0x226424[_0xa8fa('0x46')][_0xa8fa('0x4b')]('id');}return db[_0xa8fa('0x35')][_0xa8fa('0x2d')](_0x226424)[_0xa8fa('0x1c')](handleEntityNotFound(_0x2a8196,null))['then'](function(_0x59cdf5){var _0x2ba0be=[];values=_0x59cdf5;if(_0x785ebc[_0xa8fa('0x42')][_0xa8fa('0x49')]===_0xa8fa('0x44')){_0x2ba0be['push'](get_open_tabs(_0xa8fa('0x4c'),_0x59cdf5[_0xa8fa('0x4d')]));_0x2ba0be[_0xa8fa('0x4b')](get_open_tabs('sms',_0x59cdf5[_0xa8fa('0x4d')]));_0x2ba0be[_0xa8fa('0x4b')](get_open_tabs(_0xa8fa('0x4f'),_0x59cdf5['dataValues']));_0x2ba0be[_0xa8fa('0x4b')](get_open_tabs(_0xa8fa('0x50'),_0x59cdf5[_0xa8fa('0x4d')]));_0x2ba0be[_0xa8fa('0x4b')](get_open_tabs('fax',_0x59cdf5[_0xa8fa('0x4d')]));_0x2ba0be['push'](get_open_tabs('mail',_0x59cdf5['dataValues']));return Promise[_0xa8fa('0x56')](_0x2ba0be);}else{return values;}})[_0xa8fa('0x1c')](function(){return values;})[_0xa8fa('0x1c')](respondWithResult(_0x2a8196,null))[_0xa8fa('0x51')](handleError(_0x2a8196,null));};exports[_0xa8fa('0x1b')]=function(_0x16dec8,_0xe63bf8){if(_0x16dec8[_0xa8fa('0x57')]['id']){delete _0x16dec8[_0xa8fa('0x57')]['id'];}delete _0x16dec8[_0xa8fa('0x57')][_0xa8fa('0x1d')];return db['User'][_0xa8fa('0x2d')]({'where':{'id':_0x16dec8[_0xa8fa('0x52')]['id']}})[_0xa8fa('0x1c')](handleEntityNotFound(_0xe63bf8,null))[_0xa8fa('0x1c')](saveUpdates(_0x16dec8[_0xa8fa('0x57')],null))[_0xa8fa('0x1c')](respondWithResult(_0xe63bf8,null))['catch'](handleError(_0xe63bf8,null));};exports['describe']=function(_0x2fbe12,_0x5f43de){return db[_0xa8fa('0x35')][_0xa8fa('0x58')]()['then'](respondWithResult(_0x5f43de,null))['catch'](handleError(_0x5f43de,null));};exports[_0xa8fa('0x59')]=function(_0x308677,_0x3adcc0){return db[_0xa8fa('0x35')]['find']({'where':{'id':_0x308677[_0xa8fa('0x52')]['id']}})[_0xa8fa('0x1c')](handleEntityNotFound(_0x3adcc0,null))[_0xa8fa('0x1c')](function(_0x1f6482){if(_0x1f6482){return _0x1f6482['addContacts'](_0x308677[_0xa8fa('0x57')][_0xa8fa('0x5a')],_[_0xa8fa('0x5b')](_0x308677[_0xa8fa('0x57')],['ids','id'])||{});}})[_0xa8fa('0x1c')](respondWithResult(_0x3adcc0,null))['catch'](handleError(_0x3adcc0,null));};function validateUser(_0x7e9750){return new Promise(function(_0x25e9d4,_0x1cef06){if(_0x7e9750[_0xa8fa('0x5c')])return _0x25e9d4(_0x7e9750);return db['Setting'][_0xa8fa('0x5d')](0x1)[_0xa8fa('0x1c')](function(_0x559f92){if(_0x559f92[_0xa8fa('0x5e')])authService[_0xa8fa('0x5f')](_0x7e9750[_0xa8fa('0x3a')]);db['User'][_0xa8fa('0x60')](_0xa8fa('0x5c'))['then'](function(_0x5891ba){if(_['isNil'](_0x5891ba)){_0x7e9750['internal']=_0x559f92['min_internal']||0x1;return;}if(_['isNil'](_0x559f92[_0xa8fa('0x61')])||_0x559f92[_0xa8fa('0x61')]===_0x5891ba){_0x7e9750[_0xa8fa('0x5c')]=_0x5891ba+0x1;return;}if(_0x559f92[_0xa8fa('0x61')]>_0x5891ba){_0x7e9750[_0xa8fa('0x5c')]=_0x559f92[_0xa8fa('0x61')];return;}return db[_0xa8fa('0x62')][_0xa8fa('0x42')](_0xa8fa('0x63'),{'type':db[_0xa8fa('0x62')][_0xa8fa('0x64')][_0xa8fa('0x65')]})[_0xa8fa('0x1c')](function(_0x4c6448){if(_0x4c6448&&_0x4c6448[_0xa8fa('0x4a')]){for(var _0x3be840=0x0,_0x3cec13=_0x4c6448[_0xa8fa('0x4a')];_0x3be840<_0x3cec13&&_[_0xa8fa('0x66')](_0x7e9750['internal']);_0x3be840++){if(_0x559f92['min_internal']<=_0x4c6448[_0x3be840][_0xa8fa('0x67')]){_0x7e9750[_0xa8fa('0x5c')]=_0x4c6448[_0x3be840][_0xa8fa('0x67')];}else if(_0x559f92['min_internal']>_0x4c6448[_0x3be840][_0xa8fa('0x67')]&&_0x559f92[_0xa8fa('0x61')]<=_0x4c6448[_0x3be840]['to']){_0x7e9750[_0xa8fa('0x5c')]=_0x559f92[_0xa8fa('0x61')];}}}if(_[_0xa8fa('0x66')](_0x7e9750[_0xa8fa('0x5c')])){_0x7e9750[_0xa8fa('0x5c')]=_0x5891ba+0x1;}return _0x25e9d4(_0x7e9750);});});})[_0xa8fa('0x51')](function(_0x7b6a07){_0x1cef06(_0x7b6a07);});});}function updateUser(_0x4a5016){return new Promise(function(_0x93854,_0x52f2da){try{if(_0x4a5016[_0xa8fa('0x68')]){_0x4a5016[_0xa8fa('0x69')]=_0x4a5016[_0xa8fa('0x5c')];_0x4a5016[_0xa8fa('0x6a')]={'mailbox':_0x4a5016[_0xa8fa('0x5c')],'password':_0x4a5016[_0xa8fa('0x3a')],'fullname':_0x4a5016[_0xa8fa('0x6b')],'email':_0x4a5016[_0xa8fa('0x6c')]};}if(_0x4a5016[_0xa8fa('0x1d')]===_0xa8fa('0x26')){if(!_0x4a5016[_0xa8fa('0x6d')])_0x4a5016['permissions']=[_0xa8fa('0x6e'),'102','103',_0xa8fa('0x6f'),_0xa8fa('0x70'),'104','105','106','107',_0xa8fa('0x71'),_0xa8fa('0x72'),_0xa8fa('0x73'),_0xa8fa('0x74'),_0xa8fa('0x75'),_0xa8fa('0x76')];}_0x93854(_0x4a5016);}catch(_0x3e0f32){_0x52f2da(_0x3e0f32);}});}exports['create']=function(_0x5c1acc,_0x298a07){if(_0x5c1acc['user'][_0xa8fa('0x1d')]===_0xa8fa('0x26'))throw new Error('Unauthorized');if(_0x5c1acc[_0xa8fa('0x57')][_0xa8fa('0x1d')]===_0xa8fa('0x24')&&_0x5c1acc[_0xa8fa('0x24')][_0xa8fa('0x1d')]!==_0xa8fa('0x22')){throw new Error(_0xa8fa('0x77'));}if(_0x5c1acc[_0xa8fa('0x57')]['role']==='admin'&&_0x5c1acc['user']['role']!==_0xa8fa('0x22')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20another\x20administrator');}return licenseUtil[_0xa8fa('0x78')]([_0x5c1acc[_0xa8fa('0x57')]])[_0xa8fa('0x1c')](function(){return validateUser(_0x5c1acc[_0xa8fa('0x57')]);})[_0xa8fa('0x1c')](function(_0xd13523){return updateUser(_0xd13523)[_0xa8fa('0x1c')](function(_0x2966e0){if(_0x2966e0['role']===_0xa8fa('0x22')){_0x2966e0[_0xa8fa('0x79')]=_0x5c1acc[_0xa8fa('0x24')][_0xa8fa('0x79')];delete _0x2966e0[_0xa8fa('0x7a')];}return _0x2966e0;});})[_0xa8fa('0x1c')](function(_0x38e194){return db[_0xa8fa('0x35')][_0xa8fa('0x7b')](_0x38e194,{'include':[{'model':db[_0xa8fa('0x6a')],'as':_0xa8fa('0x6a')}]});})[_0xa8fa('0x1c')](function(_0x59cd9b){if(_0x5c1acc[_0xa8fa('0x57')][_0xa8fa('0x1d')]==='user')return _0x59cd9b;if(_0x5c1acc[_0xa8fa('0x24')][_0xa8fa('0x1d')]!=='user')return _0x59cd9b;return db[_0xa8fa('0x7c')][_0xa8fa('0x2d')]({'where':{'name':_0x59cd9b[_0xa8fa('0x1d')]==='agent'?_0xa8fa('0x25'):_0xa8fa('0x27'),'userProfileId':_0x5c1acc['user']['userProfileId']},'raw':!![]})['then'](function(_0x1990a2){if(!_0x1990a2||_0x1990a2['autoAssociation']!=0x0)return _0x59cd9b;return db[_0xa8fa('0x2f')][_0xa8fa('0x7b')]({'name':_0x59cd9b[_0xa8fa('0x2e')],'resourceId':_0x59cd9b['id'],'type':_0x1990a2[_0xa8fa('0x2e')],'sectionId':_0x1990a2['id']},{})['then'](function(){return _0x59cd9b;});})[_0xa8fa('0x51')](function(_0x588a14){logger[_0xa8fa('0x32')](_0xa8fa('0x7d'),_0x588a14);throw _0x588a14;});})['then'](respondWithResult(_0x298a07,0xc9))[_0xa8fa('0x51')](handleError(_0x298a07,null));};exports[_0xa8fa('0x7e')]=function(_0x16068a,_0x5ba4b8){var _0x1665f1=_0x16068a[_0xa8fa('0x57')];var _0x378a7c=[];if(_0x16068a[_0xa8fa('0x24')][_0xa8fa('0x1d')]===_0xa8fa('0x26'))throw new Error(_0xa8fa('0x7f'));if(_['some'](_0x1665f1,[_0xa8fa('0x1d'),_0xa8fa('0x24')])&&_0x16068a[_0xa8fa('0x24')][_0xa8fa('0x1d')]!==_0xa8fa('0x22')){throw new Error(_0xa8fa('0x77'));}if(_['some'](_0x1665f1,[_0xa8fa('0x1d'),_0xa8fa('0x22')])&&_0x16068a[_0xa8fa('0x24')][_0xa8fa('0x1d')]!==_0xa8fa('0x22')){throw new Error(_0xa8fa('0x80'));}return licenseUtil[_0xa8fa('0x78')](_0x1665f1)[_0xa8fa('0x1c')](function(){return validateUser(_0x1665f1[0x0]);})[_0xa8fa('0x1c')](function(){for(var _0x3563fb=0x1;_0x3563fb<_0x1665f1[_0xa8fa('0x4a')];_0x3563fb++){var _0x38d58c=_0x1665f1[_0x3563fb-0x1][_0xa8fa('0x5c')];if(!_0x1665f1[_0x3563fb]['internal'])_0x1665f1[_0x3563fb][_0xa8fa('0x5c')]=_0x38d58c+0x1;_0x378a7c[_0xa8fa('0x4b')](validateUser(_0x1665f1[_0x3563fb]));}return Promise[_0xa8fa('0x56')](_0x378a7c);})[_0xa8fa('0x1c')](function(){_0x378a7c=[];for(var _0x210d08=0x0;_0x210d08<_0x1665f1['length'];_0x210d08++){_0x378a7c[_0xa8fa('0x4b')](updateUser(_0x1665f1[_0x210d08]));}return Promise[_0xa8fa('0x56')](_0x378a7c);})[_0xa8fa('0x1c')](function(){_0x378a7c=_0x1665f1['map'](function(_0xaeaf4){return db[_0xa8fa('0x35')][_0xa8fa('0x7b')](_0xaeaf4,{'include':[{'model':db[_0xa8fa('0x6a')],'as':_0xa8fa('0x6a')}]})[_0xa8fa('0x1c')](function(_0x451d95){_0xaeaf4['id']=_0x451d95['id'];return _0xaeaf4;});});return Promise[_0xa8fa('0x56')](_0x378a7c);})[_0xa8fa('0x1c')](function(_0x19a7ed){if(_0x16068a[_0xa8fa('0x57')]['role']==='user')return _0x19a7ed;if(_0x16068a[_0xa8fa('0x24')]['role']!==_0xa8fa('0x24'))return _0x19a7ed;var _0x373008=_[_0xa8fa('0x81')](_0x19a7ed,function(_0x327625){return _0x327625[_0xa8fa('0x1d')]===_0xa8fa('0x26')||_0x327625['role']===_0xa8fa('0x28');});if(!_0x373008)return _0x19a7ed;return db['UserProfileSection'][_0xa8fa('0x47')]({'where':{'name':{'$or':[_0xa8fa('0x25'),_0xa8fa('0x27')]},'userProfileId':_0x16068a[_0xa8fa('0x24')]['userProfileId']},'raw':!![]})[_0xa8fa('0x1c')](function(_0x5f29c0){if(_[_0xa8fa('0x82')](_0x5f29c0)||!_[_0xa8fa('0x81')](_0x5f29c0,['autoAssociation',0x0]))return _0x19a7ed;_0x378a7c=[];var _0x199ddf=_(_0x5f29c0)[_0xa8fa('0x2a')](function(_0x555fba){if(_0x555fba[_0xa8fa('0x83')]===0x1)return;return _0x555fba[_0xa8fa('0x2e')]===_0xa8fa('0x25')?_0xa8fa('0x26'):_0xa8fa('0x28');})['compact']()[_0xa8fa('0x2b')]();for(var _0x235d90=0x0;_0x235d90<_0x19a7ed['length'];_0x235d90++){if(!_[_0xa8fa('0x2c')](_0x199ddf,_0x19a7ed[_0x235d90][_0xa8fa('0x1d')]))return;var _0x4093a=_0x19a7ed[_0x235d90][_0xa8fa('0x1d')]===_0xa8fa('0x26')?_0xa8fa('0x25'):_0xa8fa('0x27');_0x378a7c[_0xa8fa('0x4b')](db['UserProfileResource'][_0xa8fa('0x7b')]({'name':_0x19a7ed[_0x235d90][_0xa8fa('0x2e')],'resourceId':_0x19a7ed[_0x235d90]['id'],'type':_0x4093a,'sectionId':_[_0xa8fa('0x2d')](_0x5f29c0,[_0xa8fa('0x2e'),_0x4093a])['id']},{}));}return Promise[_0xa8fa('0x56')](_0x378a7c);});})[_0xa8fa('0x1c')](respondWithResult(_0x5ba4b8,0xc9))['catch'](handleError(_0x5ba4b8,null));};exports['changePassword']=function(_0x5c3ad4,_0x460041){if(_0x5c3ad4[_0xa8fa('0x57')]['id']){delete _0x5c3ad4['body']['id'];}return db[_0xa8fa('0x35')]['find']({'where':{'id':_0x5c3ad4[_0xa8fa('0x52')]['id']}})[_0xa8fa('0x1c')](function(_0x6b7e3b){if(!_0x6b7e3b)return null;if(_0x6b7e3b['id']===_0x5c3ad4['user']['id']){if(!_0x5c3ad4[_0xa8fa('0x57')][_0xa8fa('0x84')]||!_0x5c3ad4[_0xa8fa('0x57')][_0xa8fa('0x85')]){throw new db[(_0xa8fa('0x86'))][(_0xa8fa('0x87'))](_0xa8fa('0x88'));}if(!_0x6b7e3b['authenticate'](_0x5c3ad4[_0xa8fa('0x57')][_0xa8fa('0x84')])){throw new db[(_0xa8fa('0x86'))][(_0xa8fa('0x87'))]('Wrong\x20credentials');}if(_0x5c3ad4['body']['oldPassword']===_0x5c3ad4[_0xa8fa('0x57')][_0xa8fa('0x85')]){throw new db['Sequelize'][(_0xa8fa('0x87'))]('New\x20password\x20must\x20be\x20different\x20from\x20old\x20password');}}else if(_0x5c3ad4['user'][_0xa8fa('0x1d')]===_0xa8fa('0x22')){if(!_0x5c3ad4[_0xa8fa('0x57')][_0xa8fa('0x85')]){throw new db['Sequelize'][(_0xa8fa('0x87'))](_0xa8fa('0x89'));}}else if(_0x5c3ad4['user'][_0xa8fa('0x1d')]===_0xa8fa('0x24')){if(!_0x5c3ad4[_0xa8fa('0x57')][_0xa8fa('0x85')]){throw new db['Sequelize'][(_0xa8fa('0x87'))]('Invalid\x20body\x20format.\x20Use\x20newPassword');}if(_0x6b7e3b['role']!==_0xa8fa('0x26')){throw new db[(_0xa8fa('0x86'))][(_0xa8fa('0x87'))](_0xa8fa('0x7f'));}}else{throw new db[(_0xa8fa('0x86'))][(_0xa8fa('0x87'))](_0xa8fa('0x7f'));}return _0x6b7e3b;})['then'](handleEntityNotFound(_0x460041,null))['then'](function(_0x2b662a){return db[_0xa8fa('0x8a')]['findOne']({'attributes':['id',_0xa8fa('0x5e'),_0xa8fa('0x8b'),'passwordHistoryLimit']})[_0xa8fa('0x1c')](function(_0xd06691){if(_0xd06691[_0xa8fa('0x5e')])authService[_0xa8fa('0x5f')](_0x5c3ad4['body'][_0xa8fa('0x85')]);if(!_0xd06691['enforcePasswordHistory']||!_0x2b662a[_0xa8fa('0x3c')])return _0x2b662a;authService[_0xa8fa('0x8c')](_0x5c3ad4['body'][_0xa8fa('0x85')],_0x2b662a[_0xa8fa('0x3c')],_0xd06691[_0xa8fa('0x8d')]);return _0x2b662a;})[_0xa8fa('0x1c')](saveUpdates({'password':_0x5c3ad4[_0xa8fa('0x57')][_0xa8fa('0x85')],'passwordResetAt':_0x5c3ad4[_0xa8fa('0x24')]['id']==_0x5c3ad4[_0xa8fa('0x52')]['id']?moment():null,'previousPasswords':authService[_0xa8fa('0x8e')](_0x5c3ad4[_0xa8fa('0x57')][_0xa8fa('0x85')],_0x2b662a[_0xa8fa('0x3c')])},null));})['then'](respondWithResult(_0x460041,null))['catch'](handleError(_0x460041,null));};exports[_0xa8fa('0x8f')]=function(_0x6dee18,_0x13cc10){var _0x3407eb=_0x6dee18[_0xa8fa('0x57')][_0xa8fa('0x90')];return db[_0xa8fa('0x35')][_0xa8fa('0x2d')]({'where':{'id':_0x6dee18['params']['id']},'attributes':['id','name',_0xa8fa('0x1d'),_0xa8fa('0x91'),'loginInPause',_0xa8fa('0x92'),_0xa8fa('0x93')]})['then'](handleEntityNotFound(_0x13cc10,null))[_0xa8fa('0x1c')](function(_0xe92a53){if(_0xe92a53){if(!utils[_0xa8fa('0x94')](_0x3407eb)){throw new db[(_0xa8fa('0x86'))][(_0xa8fa('0x87'))]('Unknown\x20channel');}return _0xe92a53[_0xa8fa('0x95')+_['capitalize'](_0x3407eb['toLowerCase']())+_0xa8fa('0x96')](_0x6dee18[_0xa8fa('0x57')]['ids'],{'penalty':_0x6dee18[_0xa8fa('0x57')][_0xa8fa('0x97')]||0x0})[_0xa8fa('0x98')](function(_0x455f86){for(var _0x596a8d=0x0;_0x596a8d<_0x6dee18[_0xa8fa('0x57')][_0xa8fa('0x5a')][_0xa8fa('0x4a')];_0x596a8d+=0x1){var _0x1c03ad={'UserId':Number(_0x6dee18[_0xa8fa('0x52')]['id'])};_0x1c03ad[_[_0xa8fa('0x99')](_0x3407eb[_0xa8fa('0x9a')]())+_0xa8fa('0x9b')]=Number(_0x6dee18[_0xa8fa('0x57')][_0xa8fa('0x5a')][_0x596a8d]);socket['emit'](_0xa8fa('0x24')+_[_0xa8fa('0x99')](_0x3407eb[_0xa8fa('0x9a')]())+_0xa8fa('0x9c'),_0x1c03ad);}return _0x455f86;})['then'](function(){if(_0x3407eb===_0xa8fa('0x9d')){return db[_0xa8fa('0x9e')]['findAll']({'where':{'id':_0x6dee18['body']['ids']||[]},'raw':!![],'attributes':['id',_0xa8fa('0x2e')]});}})['then'](function(_0x1bdb7d){var _0x10e8c5=_0xe92a53[_0xa8fa('0x21')]({'plain':!![]});var _0x5807f4=[];if(_0x3407eb===_0xa8fa('0x9d')&&_0x10e8c5[_0xa8fa('0x1d')]===_0xa8fa('0x26')&&_0x10e8c5['online']){for(let _0x57d8bf=0x0;_0x57d8bf<_0x1bdb7d[_0xa8fa('0x4a')];_0x57d8bf+=0x1){_0x5807f4[_0xa8fa('0x4b')]({'membername':_0x10e8c5[_0xa8fa('0x2e')],'UserId':_0x10e8c5['id'],'queue_name':_0x1bdb7d[_0x57d8bf][_0xa8fa('0x2e')],'VoiceQueueId':_0x1bdb7d[_0x57d8bf]['id'],'interface':_[_0xa8fa('0x66')](_0x10e8c5[_0xa8fa('0x93')])?util['format'](_0xa8fa('0x9f'),_0x10e8c5[_0xa8fa('0x2e')]):_0x10e8c5[_0xa8fa('0x93')],'paused':_0x10e8c5[_0xa8fa('0x92')]||![],'penalty':_0x6dee18[_0xa8fa('0x57')][_0xa8fa('0x97')]||0x0});}return Promise[_0xa8fa('0x56')](_0x5807f4[_0xa8fa('0x2a')](function(_0x2376f3){return db['UserVoiceQueueRt'][_0xa8fa('0xa0')](_0x2376f3);}));}return _0xe92a53;});}})[_0xa8fa('0x1c')](respondWithStatusCode(_0x13cc10,null))[_0xa8fa('0x51')](handleError(_0x13cc10,null));};exports['removeQueues']=function(_0x24420f,_0x12722b){var _0x3d56d4,_0x437ee2;return db['User'][_0xa8fa('0x2d')]({'where':{'id':_0x24420f[_0xa8fa('0x52')]['id']},'attributes':['id',_0xa8fa('0x2e'),_0xa8fa('0x1d')]})[_0xa8fa('0x1c')](handleEntityNotFound(_0x12722b,null))[_0xa8fa('0x1c')](function(_0x4b62bd){if(_0x4b62bd){_0x3d56d4=_0x4b62bd;if(!_0x24420f['query'][_0xa8fa('0x90')]||!utils['isValidChannel'](_0x24420f[_0xa8fa('0x42')]['channel'])){throw new db['Sequelize']['ValidationError'](_0xa8fa('0xa1'));}return _0x4b62bd[_0xa8fa('0xa2')+_[_0xa8fa('0x99')](_0x24420f[_0xa8fa('0x42')][_0xa8fa('0x90')][_0xa8fa('0x9a')]())+'Queues'](_0x24420f['query'][_0xa8fa('0x5a')]);}})['then'](function(_0x350cc6){if(_[_0xa8fa('0xa3')](_0x24420f[_0xa8fa('0x42')]['ids'])){for(var _0x5972e8=0x0;_0x5972e8<_0x24420f[_0xa8fa('0x42')][_0xa8fa('0x5a')][_0xa8fa('0x4a')];_0x5972e8+=0x1){_0x437ee2={'UserId':Number(_0x24420f[_0xa8fa('0x52')]['id'])};_0x437ee2[_[_0xa8fa('0x99')](_0x24420f['query'][_0xa8fa('0x90')]['toLowerCase']())+_0xa8fa('0x9b')]=Number(_0x24420f['query']['ids'][_0x5972e8]);socket['emit'](_0xa8fa('0x24')+_['capitalize'](_0x24420f['query']['channel'][_0xa8fa('0x9a')]())+_0xa8fa('0xa4'),_0x437ee2);}}else{_0x437ee2={'UserId':Number(_0x24420f['params']['id'])};_0x437ee2[_[_0xa8fa('0x99')](_0x24420f[_0xa8fa('0x42')][_0xa8fa('0x90')][_0xa8fa('0x9a')]())+_0xa8fa('0x9b')]=Number(_0x24420f[_0xa8fa('0x42')][_0xa8fa('0x5a')]);socket['emit']('user'+_[_0xa8fa('0x99')](_0x24420f['query'][_0xa8fa('0x90')][_0xa8fa('0x9a')]())+_0xa8fa('0xa4'),_0x437ee2);}return _0x350cc6;})[_0xa8fa('0x1c')](function(){if(_0x24420f['query'][_0xa8fa('0x90')]===_0xa8fa('0x9d')){return db[_0xa8fa('0xa5')][_0xa8fa('0x20')]({'where':{'UserId':_0x24420f[_0xa8fa('0x52')]['id'],'VoiceQueueId':_0x24420f[_0xa8fa('0x42')][_0xa8fa('0x5a')]},'individualHooks':!![]})[_0xa8fa('0x1c')](function(){return _0x3d56d4;});}return _0x3d56d4;})[_0xa8fa('0x1c')](respondWithStatusCode(_0x12722b,null))['catch'](handleError(_0x12722b,null));};exports[_0xa8fa('0xa6')]=function(_0x6671c9,_0x54ebc4){_0x6671c9['body'][_0xa8fa('0xa7')]=_0x6671c9['file'][_0xa8fa('0xa8')];return db['User'][_0xa8fa('0x2d')]({'where':{'id':_0x6671c9[_0xa8fa('0x52')]['id']}})[_0xa8fa('0x1c')](handleEntityNotFound(_0x54ebc4,null))[_0xa8fa('0x1c')](saveUpdates(_0x6671c9[_0xa8fa('0x57')],null))[_0xa8fa('0x1c')](respondWithResult(_0x54ebc4,null))[_0xa8fa('0x51')](handleError(_0x54ebc4,null));};exports['getAvatar']=function(_0x285809,_0x1581ed){var _0x53cfa4=path['join'](config['root'],_0xa8fa('0xa9'));return db[_0xa8fa('0x35')][_0xa8fa('0x2d')]({'where':{'id':_0x285809[_0xa8fa('0x52')]['id']},'attributes':['id',_0xa8fa('0xa7')],'raw':!![]})['then'](handleEntityNotFound(_0x1581ed,null))[_0xa8fa('0x1c')](function(_0x480527){if(_0x480527){if(_[_0xa8fa('0x66')](_0x480527[_0xa8fa('0xa7')])){return _0x1581ed[_0xa8fa('0xaa')](_0x53cfa4);}else{if(!fs[_0xa8fa('0xab')](path[_0xa8fa('0xac')](config[_0xa8fa('0xad')],_0xa8fa('0xae'),_0x480527[_0xa8fa('0xa7')]))){return _0x1581ed[_0xa8fa('0xaa')](_0x53cfa4);}return _0x1581ed['download'](path[_0xa8fa('0xac')](config[_0xa8fa('0xad')],'server/files/images/',_0x480527[_0xa8fa('0xa7')]));}}})['catch'](handleError(_0x1581ed,null));};exports[_0xa8fa('0xaf')]=function(_0x780791,_0x277512){return db[_0xa8fa('0x35')][_0xa8fa('0x2d')]({'where':{'id':_0x780791[_0xa8fa('0x52')]['id']},'attributes':['id']})[_0xa8fa('0x1c')](handleEntityNotFound(_0x277512,null))[_0xa8fa('0x1c')](function(_0x599220){var _0x52fff9=[];values=_0x599220[_0xa8fa('0x4d')];_0x52fff9[_0xa8fa('0x4b')](get_open_tabs(_0xa8fa('0x4c'),_0x599220[_0xa8fa('0x4d')]));_0x52fff9['push'](get_open_tabs(_0xa8fa('0xb0'),_0x599220[_0xa8fa('0x4d')]));_0x52fff9[_0xa8fa('0x4b')](get_open_tabs(_0xa8fa('0x4f'),_0x599220[_0xa8fa('0x4d')]));_0x52fff9[_0xa8fa('0x4b')](get_open_tabs(_0xa8fa('0x50'),_0x599220[_0xa8fa('0x4d')]));_0x52fff9[_0xa8fa('0x4b')](get_open_tabs(_0xa8fa('0x4e'),_0x599220[_0xa8fa('0x4d')]));_0x52fff9[_0xa8fa('0x4b')](get_open_tabs(_0xa8fa('0xb1'),_0x599220[_0xa8fa('0x4d')]));return Promise['all'](_0x52fff9);})[_0xa8fa('0x1c')](function(_0x5a410d){if(_0x5a410d){var _0x3fd12e=_[_0xa8fa('0x2a')](values[_0xa8fa('0xb2')],function(_0x29f0ab){return{'channel':_0xa8fa('0xb3'),'id':_0x29f0ab['id'],'createdAt':_0x29f0ab[_0xa8fa('0xb4')]};});var _0x393894=_[_0xa8fa('0x2a')](values[_0xa8fa('0xb5')],function(_0x309844){return{'channel':'FAX','id':_0x309844['id'],'createdAt':_0x309844[_0xa8fa('0xb4')]};});var _0x124024=_[_0xa8fa('0x2a')](values[_0xa8fa('0xb6')],function(_0x2ff999){return{'channel':_0xa8fa('0xb7'),'id':_0x2ff999['id'],'createdAt':_0x2ff999[_0xa8fa('0xb4')]};});var _0x2c1dc6=_[_0xa8fa('0x2a')](values[_0xa8fa('0xb8')],function(_0x53968f){return{'channel':'MAIL','id':_0x53968f['id'],'createdAt':_0x53968f[_0xa8fa('0xb4')]};});var _0x240964=_['map'](values['SmsOpenTabs'],function(_0x2d6866){return{'channel':_0xa8fa('0xb9'),'id':_0x2d6866['id'],'createdAt':_0x2d6866['createdAt']};});var _0x5028d0=_[_0xa8fa('0x2a')](values['WhatsappOpenTabs'],function(_0x1bd2cc){return{'channel':_0xa8fa('0xba'),'id':_0x1bd2cc['id'],'createdAt':_0x1bd2cc[_0xa8fa('0xb4')]};});var _0x430d9f=_[_0xa8fa('0xbb')](_0x3fd12e,_0x393894,_0x124024,_0x2c1dc6,_0x240964,_0x5028d0);var _0x47a125={'count':_0x430d9f['length'],'rows':_0x430d9f};return _0x47a125;}else return null;})['then'](respondWithResult(_0x277512,null))['catch'](handleError(_0x277512,null));};exports[_0xa8fa('0xbc')]=function(_0x15b087,_0x2d7591){var _0x43bc5e={};return db[_0xa8fa('0x35')][_0xa8fa('0xbd')]({'where':{'id':_0x15b087['params']['id']}})[_0xa8fa('0x1c')](function(_0x33442f){if(!_0x33442f){throw new APINotFoundError(util[_0xa8fa('0xbe')](_0xa8fa('0xbf'),_0x15b087[_0xa8fa('0x52')]['id']));}return contacts[_0xa8fa('0x58')]();})['then'](function(_0x2cbadd){_0x15b087[_0xa8fa('0x42')][_0xa8fa('0x35')]=_0x15b087['params']['id'];_0x43bc5e=qs[_0xa8fa('0x40')](_0x2cbadd,_0x15b087);if(_0x15b087[_0xa8fa('0x42')]['hasOwnProperty']('includeAll')){_0x43bc5e[_0xa8fa('0x45')]=[{'model':db[_0xa8fa('0xc0')],'as':_0xa8fa('0xc1'),'required':![]},{'model':db[_0xa8fa('0xc2')],'as':'Tags','attributes':['id',_0xa8fa('0x2e'),_0xa8fa('0xc3')],'where':_0x15b087[_0xa8fa('0x42')][_0xa8fa('0xc4')]?{'id':_0x15b087[_0xa8fa('0x42')]['tag']}:undefined,'required':_0x15b087[_0xa8fa('0x42')][_0xa8fa('0xc4')]?!![]:![]}];}return contacts['findAll'](_0x15b087[_0xa8fa('0x42')],_0x15b087['user'],_0x43bc5e,_0x2cbadd);})[_0xa8fa('0x1c')](respondWithFilteredResult(_0x2d7591,_0x43bc5e))['catch'](APIHandleError(_0x2d7591));};exports['getQueues']=function(_0x3cdf00,_0x5059d8){var _0x55ec36;var _0x48a8e5={};var _0x58c0b4;return db[_0xa8fa('0x35')]['findOne']({'where':{'id':_0x3cdf00['params']['id']},'attributes':['id',_0xa8fa('0x2e'),_0xa8fa('0x1d')]})[_0xa8fa('0x1c')](handleEntityNotFound(_0x5059d8,null))[_0xa8fa('0x1c')](function(_0x1b9b8e){if(!utils[_0xa8fa('0x94')](_0x3cdf00[_0xa8fa('0x42')]['channel'])){throw new db[(_0xa8fa('0x86'))][(_0xa8fa('0x87'))](_0xa8fa('0xa1'));}_0x55ec36=_0x1b9b8e;var _0x277384={};_0x277384['model']=_['keys'](db[_[_0xa8fa('0x99')](_0x3cdf00[_0xa8fa('0x42')][_0xa8fa('0x90')])+'Queue'][_0xa8fa('0xc5')]);_0x277384[_0xa8fa('0x42')]=_['keys'](_0x3cdf00[_0xa8fa('0x42')]);_0x277384[_0xa8fa('0xc6')]=_[_0xa8fa('0xc7')](_0x277384['model'],_0x277384['query']);_0x48a8e5['attributes']=_[_0xa8fa('0xc7')](_0x277384['model'],qs[_0xa8fa('0xc8')](_0x3cdf00['query'][_0xa8fa('0xc8')]));_0x48a8e5['attributes']=_0x48a8e5[_0xa8fa('0x46')]['length']?_0x48a8e5[_0xa8fa('0x46')]:_0x277384[_0xa8fa('0xc9')];_0x48a8e5[_0xa8fa('0xca')]=qs[_0xa8fa('0xcb')](_0x3cdf00[_0xa8fa('0x42')][_0xa8fa('0xcb')]);_0x48a8e5['where']=qs['filters'](_[_0xa8fa('0xcc')](_0x3cdf00[_0xa8fa('0x42')],_0x277384[_0xa8fa('0xc6')]));if(_0x3cdf00[_0xa8fa('0x42')]['filter']){_0x48a8e5[_0xa8fa('0x41')]=_[_0xa8fa('0xcd')](_0x48a8e5[_0xa8fa('0x41')],{'$or':_[_0xa8fa('0x2a')](_0x48a8e5[_0xa8fa('0x46')],function(_0x2dae38){var _0x47cee3={};_0x47cee3[_0x2dae38]={'$like':'%'+_0x3cdf00[_0xa8fa('0x42')]['filter']+'%'};return _0x47cee3;})});}_0x48a8e5=_[_0xa8fa('0xcd')]({},_0x48a8e5,_0x3cdf00[_0xa8fa('0x55')]);switch(_0x55ec36['role']){case'admin':return db[_[_0xa8fa('0x99')](_0x3cdf00[_0xa8fa('0x42')][_0xa8fa('0x90')])+_0xa8fa('0xce')][_0xa8fa('0x47')](_0x48a8e5);case _0xa8fa('0x24'):case _0xa8fa('0x26'):return _0x55ec36['get'+_[_0xa8fa('0x99')](_0x3cdf00['query']['channel'])+_0xa8fa('0x96')](_0x48a8e5);default:throw new db['Sequelize'][(_0xa8fa('0x87'))](_0xa8fa('0xcf'));}})[_0xa8fa('0x1c')](function(_0x39b89c){_0x58c0b4=_0x39b89c['length'];if(!_0x3cdf00['query']['hasOwnProperty'](_0xa8fa('0xd0'))){_0x48a8e5[_0xa8fa('0x16')]=qs['limit'](_0x3cdf00[_0xa8fa('0x42')][_0xa8fa('0x16')]);_0x48a8e5['offset']=qs[_0xa8fa('0x15')](_0x3cdf00[_0xa8fa('0x42')]['offset']);}switch(_0x55ec36[_0xa8fa('0x1d')]){case'admin':return db[_[_0xa8fa('0x99')](_0x3cdf00[_0xa8fa('0x42')][_0xa8fa('0x90')])+_0xa8fa('0xce')]['findAll'](_0x48a8e5);case _0xa8fa('0x24'):case _0xa8fa('0x26'):return _0x55ec36['get'+_[_0xa8fa('0x99')](_0x3cdf00[_0xa8fa('0x42')]['channel'])+_0xa8fa('0x96')](_0x48a8e5);}})[_0xa8fa('0x1c')](function(_0x39b506){return{'count':_0x58c0b4,'rows':_0x39b506};})[_0xa8fa('0x1c')](respondWithResult(_0x5059d8,null))[_0xa8fa('0x51')](handleError(_0x5059d8,null));};exports[_0xa8fa('0xd1')]=function(_0x36244e,_0x5c2f52){var _0x354a12={};var _0x4013b0={};var _0x5ae844;var _0x4a1fc9;return db[_0xa8fa('0x35')][_0xa8fa('0xbd')]({'where':{'id':_0x36244e['params']['id']}})[_0xa8fa('0x1c')](handleEntityNotFound(_0x5c2f52,null))[_0xa8fa('0x1c')](function(_0x4441ca){if(_0x4441ca){_0x5ae844=_0x4441ca;_0x4013b0[_0xa8fa('0xc9')]=_[_0xa8fa('0xd2')](db['UserVoiceQueueRt'][_0xa8fa('0xc5')]);_0x4013b0[_0xa8fa('0x42')]=_['keys'](_0x36244e[_0xa8fa('0x42')]);_0x4013b0[_0xa8fa('0xc6')]=_[_0xa8fa('0xc7')](_0x4013b0[_0xa8fa('0xc9')],_0x4013b0[_0xa8fa('0x42')]);_0x354a12[_0xa8fa('0x46')]=_['intersection'](_0x4013b0[_0xa8fa('0xc9')],qs['fields'](_0x36244e[_0xa8fa('0x42')][_0xa8fa('0xc8')]));_0x354a12[_0xa8fa('0x46')]=_0x354a12[_0xa8fa('0x46')]['length']?_0x354a12['attributes']:_0x4013b0[_0xa8fa('0xc9')];_0x354a12[_0xa8fa('0xca')]=qs[_0xa8fa('0xcb')](_0x36244e[_0xa8fa('0x42')][_0xa8fa('0xcb')]);_0x354a12['where']=qs[_0xa8fa('0xc6')](_[_0xa8fa('0xcc')](_0x36244e[_0xa8fa('0x42')],_0x4013b0[_0xa8fa('0xc6')]));if(_0x36244e[_0xa8fa('0x42')][_0xa8fa('0x39')]){_0x354a12[_0xa8fa('0x41')]=_[_0xa8fa('0xcd')](_0x354a12[_0xa8fa('0x41')],{'$or':_['map'](_0x354a12[_0xa8fa('0x46')],function(_0x43ffe4){var _0x47334f={};_0x47334f[_0x43ffe4]={'$like':'%'+_0x36244e[_0xa8fa('0x42')][_0xa8fa('0x39')]+'%'};return _0x47334f;})});}_0x354a12=_[_0xa8fa('0xcd')]({},_0x354a12,_0x36244e['options']);return _0x5ae844[_0xa8fa('0xd1')](_0x354a12);}})[_0xa8fa('0x1c')](function(_0x3e58ed){if(_0x3e58ed){_0x4a1fc9=_0x3e58ed[_0xa8fa('0x4a')];if(!_0x36244e[_0xa8fa('0x42')][_0xa8fa('0xd3')](_0xa8fa('0xd0'))){_0x354a12['limit']=qs[_0xa8fa('0x16')](_0x36244e[_0xa8fa('0x42')][_0xa8fa('0x16')]);_0x354a12['offset']=qs[_0xa8fa('0x15')](_0x36244e[_0xa8fa('0x42')][_0xa8fa('0x15')]);}return _0x5ae844['getVoiceQueuesRt'](_0x354a12);}})['then'](function(_0x3c80e4){if(_0x3c80e4){return _0x3c80e4?{'count':_0x4a1fc9,'rows':_0x3c80e4}:null;}})[_0xa8fa('0x1c')](respondWithResult(_0x5c2f52,null))['catch'](handleError(_0x5c2f52,null));};exports[_0xa8fa('0xd4')]=function(_0x51e5d1,_0x51f975){var _0x2d9758={};var _0x977fff={};var _0x1d5887;var _0x13c2d5;return db[_0xa8fa('0x35')]['findOne']({'where':{'id':_0x51e5d1[_0xa8fa('0x52')]['id']}})[_0xa8fa('0x1c')](handleEntityNotFound(_0x51f975,null))['then'](function(_0x36b1da){if(_0x36b1da){_0x1d5887=_0x36b1da;_0x977fff['model']=_[_0xa8fa('0xd2')](db[_0xa8fa('0xd5')][_0xa8fa('0xc5')]);_0x977fff[_0xa8fa('0x42')]=_[_0xa8fa('0xd2')](_0x51e5d1[_0xa8fa('0x42')]);_0x977fff[_0xa8fa('0xc6')]=_['intersection'](_0x977fff[_0xa8fa('0xc9')],_0x977fff[_0xa8fa('0x42')]);_0x2d9758[_0xa8fa('0x46')]=_[_0xa8fa('0xc7')](_0x977fff[_0xa8fa('0xc9')],qs[_0xa8fa('0xc8')](_0x51e5d1[_0xa8fa('0x42')]['fields']));_0x2d9758[_0xa8fa('0x46')]=_0x2d9758[_0xa8fa('0x46')]['length']?_0x2d9758['attributes']:_0x977fff[_0xa8fa('0xc9')];_0x2d9758[_0xa8fa('0xca')]=qs[_0xa8fa('0xcb')](_0x51e5d1['query'][_0xa8fa('0xcb')]);_0x2d9758[_0xa8fa('0x41')]=qs['filters'](_[_0xa8fa('0xcc')](_0x51e5d1[_0xa8fa('0x42')],_0x977fff['filters']));if(_0x51e5d1[_0xa8fa('0x42')]['filter']){_0x2d9758[_0xa8fa('0x41')]=_[_0xa8fa('0xcd')](_0x2d9758[_0xa8fa('0x41')],{'$or':_[_0xa8fa('0x2a')](_0x2d9758['attributes'],function(_0xf4f8e3){var _0x129740={};_0x129740[_0xf4f8e3]={'$like':'%'+_0x51e5d1[_0xa8fa('0x42')]['filter']+'%'};return _0x129740;})});}_0x2d9758=_[_0xa8fa('0xcd')]({},_0x2d9758,_0x51e5d1[_0xa8fa('0x55')]);return _0x1d5887[_0xa8fa('0xd4')](_0x2d9758);}})[_0xa8fa('0x1c')](function(_0x3317f3){if(_0x3317f3){_0x13c2d5=_0x3317f3[_0xa8fa('0x4a')];if(!_0x51e5d1['query']['hasOwnProperty']('nolimit')){_0x2d9758[_0xa8fa('0x16')]=qs['limit'](_0x51e5d1[_0xa8fa('0x42')][_0xa8fa('0x16')]);_0x2d9758[_0xa8fa('0x15')]=qs[_0xa8fa('0x15')](_0x51e5d1[_0xa8fa('0x42')]['offset']);}return _0x1d5887['getGroups'](_0x2d9758);}})['then'](function(_0x51b31d){if(_0x51b31d){return _0x51b31d?{'count':_0x13c2d5,'rows':_0x51b31d}:null;}})[_0xa8fa('0x1c')](respondWithResult(_0x51f975,null))[_0xa8fa('0x51')](handleError(_0x51f975,null));};exports['getRecordings']=function(_0x3359b8,_0x493218){var _0x56f9e8={'raw':!![],'where':{}};var _0x4a1913={};var _0x414d1c={'count':0x0,'rows':[]};return db[_0xa8fa('0x35')]['findOne']({'where':{'id':_0x3359b8[_0xa8fa('0x52')]['id']}})['then'](handleEntityNotFound(_0x493218,null))[_0xa8fa('0x1c')](function(_0x1dfe94){if(_0x1dfe94){_0x4a1913[_0xa8fa('0xc9')]=_['keys'](db[_0xa8fa('0xd6')]['rawAttributes']);_0x4a1913['query']=_[_0xa8fa('0xd2')](_0x3359b8['query']);_0x4a1913['filters']=_[_0xa8fa('0xc7')](_0x4a1913['model'],_0x4a1913[_0xa8fa('0x42')]);_0x56f9e8[_0xa8fa('0x46')]=_['intersection'](_0x4a1913[_0xa8fa('0xc9')],qs[_0xa8fa('0xc8')](_0x3359b8[_0xa8fa('0x42')][_0xa8fa('0xc8')]));_0x56f9e8['attributes']=_0x56f9e8['attributes'][_0xa8fa('0x4a')]?_0x56f9e8[_0xa8fa('0x46')]:_0x4a1913['model'];if(!_0x3359b8[_0xa8fa('0x42')][_0xa8fa('0xd3')](_0xa8fa('0xd0'))){_0x56f9e8[_0xa8fa('0x16')]=qs[_0xa8fa('0x16')](_0x3359b8['query'][_0xa8fa('0x16')]);_0x56f9e8[_0xa8fa('0x15')]=qs[_0xa8fa('0x15')](_0x3359b8[_0xa8fa('0x42')]['offset']);}_0x56f9e8[_0xa8fa('0xca')]=qs[_0xa8fa('0xcb')](_0x3359b8[_0xa8fa('0x42')][_0xa8fa('0xcb')]);_0x56f9e8[_0xa8fa('0x41')]=qs[_0xa8fa('0xc6')](_[_0xa8fa('0xcc')](_0x3359b8[_0xa8fa('0x42')],_0x4a1913[_0xa8fa('0xc6')]));_0x56f9e8[_0xa8fa('0x41')][_0xa8fa('0xd7')]=_0x1dfe94['id'];if(_0x3359b8[_0xa8fa('0x42')]['filter']){_0x56f9e8[_0xa8fa('0x41')]=_['merge'](_0x56f9e8[_0xa8fa('0x41')],{'$or':_[_0xa8fa('0x2a')](_0x56f9e8['attributes'],function(_0x906220){var _0x4575aa={};_0x4575aa[_0x906220]={'$like':'%'+_0x3359b8[_0xa8fa('0x42')][_0xa8fa('0x39')]+'%'};return _0x4575aa;})});}_0x56f9e8=_[_0xa8fa('0xcd')]({},_0x56f9e8,_0x3359b8[_0xa8fa('0x55')]);return db[_0xa8fa('0xd6')][_0xa8fa('0x18')]({'where':_0x56f9e8[_0xa8fa('0x41')]})[_0xa8fa('0x1c')](function(_0x20d8e4){_0x414d1c[_0xa8fa('0x18')]=_0x20d8e4;if(_0x3359b8['query'][_0xa8fa('0x53')]){_0x56f9e8['include']=[{'all':!![]}];}return db[_0xa8fa('0xd6')][_0xa8fa('0x47')](_0x56f9e8);})[_0xa8fa('0x1c')](function(_0x371635){_0x414d1c[_0xa8fa('0x48')]=_0x371635;return _0x414d1c;});}})[_0xa8fa('0x1c')](respondWithFilteredResult(_0x493218,_0x56f9e8))[_0xa8fa('0x51')](handleError(_0x493218,null));};exports[_0xa8fa('0xd8')]=function(_0x522c41,_0x3e2f61){var _0x1022ae={'raw':!![],'where':{}};var _0x486566={};var _0x4513de={'count':0x0,'rows':[]};return db['User'][_0xa8fa('0xbd')]({'where':{'id':_0x522c41[_0xa8fa('0x52')]['id']}})[_0xa8fa('0x1c')](handleEntityNotFound(_0x3e2f61,null))[_0xa8fa('0x1c')](function(_0x40caba){if(_0x40caba){_0x486566['model']=_[_0xa8fa('0xd2')](db['ScreenRecording'][_0xa8fa('0xc5')]);_0x486566[_0xa8fa('0x42')]=_[_0xa8fa('0xd2')](_0x522c41[_0xa8fa('0x42')]);_0x486566['filters']=_[_0xa8fa('0xc7')](_0x486566[_0xa8fa('0xc9')],_0x486566[_0xa8fa('0x42')]);_0x1022ae['attributes']=_[_0xa8fa('0xc7')](_0x486566[_0xa8fa('0xc9')],qs[_0xa8fa('0xc8')](_0x522c41[_0xa8fa('0x42')][_0xa8fa('0xc8')]));_0x1022ae[_0xa8fa('0x46')]=_0x1022ae[_0xa8fa('0x46')]['length']?_0x1022ae['attributes']:_0x486566['model'];if(!_0x522c41['query'][_0xa8fa('0xd3')](_0xa8fa('0xd0'))){_0x1022ae[_0xa8fa('0x16')]=qs[_0xa8fa('0x16')](_0x522c41[_0xa8fa('0x42')]['limit']);_0x1022ae[_0xa8fa('0x15')]=qs[_0xa8fa('0x15')](_0x522c41[_0xa8fa('0x42')]['offset']);}_0x1022ae[_0xa8fa('0xca')]=qs[_0xa8fa('0xcb')](_0x522c41[_0xa8fa('0x42')][_0xa8fa('0xcb')]);_0x1022ae[_0xa8fa('0x41')]=qs[_0xa8fa('0xc6')](_[_0xa8fa('0xcc')](_0x522c41['query'],_0x486566[_0xa8fa('0xc6')]));_0x1022ae[_0xa8fa('0x41')][_0xa8fa('0xd7')]=_0x40caba['id'];if(_0x522c41[_0xa8fa('0x42')][_0xa8fa('0x39')]){_0x1022ae[_0xa8fa('0x41')]=_[_0xa8fa('0xcd')](_0x1022ae[_0xa8fa('0x41')],{'$or':_[_0xa8fa('0x2a')](_0x1022ae[_0xa8fa('0x46')],function(_0x5f0660){var _0x53ef93={};_0x53ef93[_0x5f0660]={'$like':'%'+_0x522c41[_0xa8fa('0x42')]['filter']+'%'};return _0x53ef93;})});}_0x1022ae=_[_0xa8fa('0xcd')]({},_0x1022ae,_0x522c41[_0xa8fa('0x55')]);return db[_0xa8fa('0xd9')][_0xa8fa('0x18')]({'where':_0x1022ae[_0xa8fa('0x41')]})[_0xa8fa('0x1c')](function(_0x2f976b){_0x4513de[_0xa8fa('0x18')]=_0x2f976b;if(_0x522c41['query']['includeAll']){_0x1022ae[_0xa8fa('0x45')]=[{'all':!![]}];}return db[_0xa8fa('0xd9')]['findAll'](_0x1022ae);})[_0xa8fa('0x1c')](function(_0x5374a6){_0x4513de['rows']=_0x5374a6;return _0x4513de;});}})[_0xa8fa('0x1c')](respondWithFilteredResult(_0x3e2f61,_0x1022ae))[_0xa8fa('0x51')](handleError(_0x3e2f61,null));};exports['getChatInteractions']=function(_0x4e7e47,_0x2c39be){var _0x57728c={};var _0x43a1b8={};var _0x5b593d;var _0x296337;return db['User']['findOne']({'where':{'id':_0x4e7e47[_0xa8fa('0x52')]['id']}})[_0xa8fa('0x1c')](handleEntityNotFound(_0x2c39be,null))[_0xa8fa('0x1c')](function(_0x56fda0){if(_0x56fda0){_0x5b593d=_0x56fda0;_0x43a1b8['model']=_[_0xa8fa('0xd2')](db[_0xa8fa('0xda')]['rawAttributes']);_0x43a1b8['query']=_[_0xa8fa('0xd2')](_0x4e7e47[_0xa8fa('0x42')]);_0x43a1b8[_0xa8fa('0xc6')]=_[_0xa8fa('0xc7')](_0x43a1b8[_0xa8fa('0xc9')],_0x43a1b8[_0xa8fa('0x42')]);_0x57728c[_0xa8fa('0x46')]=_[_0xa8fa('0xc7')](_0x43a1b8['model'],qs[_0xa8fa('0xc8')](_0x4e7e47[_0xa8fa('0x42')][_0xa8fa('0xc8')]));_0x57728c[_0xa8fa('0x46')]=_0x57728c[_0xa8fa('0x46')][_0xa8fa('0x4a')]?_0x57728c[_0xa8fa('0x46')]:_0x43a1b8[_0xa8fa('0xc9')];_0x57728c[_0xa8fa('0xca')]=qs[_0xa8fa('0xcb')](_0x4e7e47[_0xa8fa('0x42')][_0xa8fa('0xcb')]);_0x57728c['where']=qs[_0xa8fa('0xc6')](_[_0xa8fa('0xcc')](_0x4e7e47['query'],_0x43a1b8['filters']));if(_0x4e7e47[_0xa8fa('0x42')][_0xa8fa('0x39')]){_0x57728c[_0xa8fa('0x41')]=_[_0xa8fa('0xcd')](_0x57728c[_0xa8fa('0x41')],{'$or':_[_0xa8fa('0x2a')](_0x57728c[_0xa8fa('0x46')],function(_0x2a515c){var _0x9f0521={};_0x9f0521[_0x2a515c]={'$like':'%'+_0x4e7e47[_0xa8fa('0x42')][_0xa8fa('0x39')]+'%'};return _0x9f0521;})});}_0x57728c=_[_0xa8fa('0xcd')]({},_0x57728c,_0x4e7e47[_0xa8fa('0x55')]);return _0x5b593d[_0xa8fa('0xdb')](_0x57728c);}})['then'](function(_0x52dd5b){if(_0x52dd5b){_0x296337=_0x52dd5b['length'];if(!_0x4e7e47['query'][_0xa8fa('0xd3')](_0xa8fa('0xd0'))){_0x57728c['limit']=qs[_0xa8fa('0x16')](_0x4e7e47[_0xa8fa('0x42')][_0xa8fa('0x16')]);_0x57728c[_0xa8fa('0x15')]=qs[_0xa8fa('0x15')](_0x4e7e47['query'][_0xa8fa('0x15')]);}return _0x5b593d[_0xa8fa('0xdb')](_0x57728c);}})[_0xa8fa('0x1c')](function(_0x1f892d){if(_0x1f892d){return _0x1f892d?{'count':_0x296337,'rows':_0x1f892d}:null;}})[_0xa8fa('0x1c')](respondWithResult(_0x2c39be,null))[_0xa8fa('0x51')](handleError(_0x2c39be,null));};exports[_0xa8fa('0xdc')]=function(_0x1b9870,_0x5e92d6){var _0x321961={};var _0x2e4cc7={};var _0x26207b;var _0x3921ac;return db[_0xa8fa('0x35')][_0xa8fa('0xbd')]({'where':{'id':_0x1b9870['params']['id']}})[_0xa8fa('0x1c')](handleEntityNotFound(_0x5e92d6,null))[_0xa8fa('0x1c')](function(_0x55fc85){if(_0x55fc85){_0x26207b=_0x55fc85;_0x2e4cc7[_0xa8fa('0xc9')]=_[_0xa8fa('0xd2')](db[_0xa8fa('0xdd')][_0xa8fa('0xc5')]);_0x2e4cc7[_0xa8fa('0x42')]=_[_0xa8fa('0xd2')](_0x1b9870[_0xa8fa('0x42')]);_0x2e4cc7[_0xa8fa('0xc6')]=_[_0xa8fa('0xc7')](_0x2e4cc7[_0xa8fa('0xc9')],_0x2e4cc7['query']);_0x321961[_0xa8fa('0x46')]=_[_0xa8fa('0xc7')](_0x2e4cc7[_0xa8fa('0xc9')],qs[_0xa8fa('0xc8')](_0x1b9870[_0xa8fa('0x42')][_0xa8fa('0xc8')]));_0x321961[_0xa8fa('0x46')]=_0x321961[_0xa8fa('0x46')][_0xa8fa('0x4a')]?_0x321961[_0xa8fa('0x46')]:_0x2e4cc7[_0xa8fa('0xc9')];_0x321961[_0xa8fa('0xca')]=qs[_0xa8fa('0xcb')](_0x1b9870['query'][_0xa8fa('0xcb')]);_0x321961[_0xa8fa('0x41')]=qs[_0xa8fa('0xc6')](_[_0xa8fa('0xcc')](_0x1b9870[_0xa8fa('0x42')],_0x2e4cc7[_0xa8fa('0xc6')]));if(_0x1b9870[_0xa8fa('0x42')][_0xa8fa('0x39')]){_0x321961[_0xa8fa('0x41')]=_['merge'](_0x321961[_0xa8fa('0x41')],{'$or':_[_0xa8fa('0x2a')](_0x321961[_0xa8fa('0x46')],function(_0x53d88f){var _0x117ddc={};_0x117ddc[_0x53d88f]={'$like':'%'+_0x1b9870['query'][_0xa8fa('0x39')]+'%'};return _0x117ddc;})});}_0x321961=_['merge']({},_0x321961,_0x1b9870[_0xa8fa('0x55')]);return _0x26207b[_0xa8fa('0xdc')](_0x321961);}})[_0xa8fa('0x1c')](function(_0x28efa6){if(_0x28efa6){_0x3921ac=_0x28efa6[_0xa8fa('0x4a')];if(!_0x1b9870['query'][_0xa8fa('0xd3')](_0xa8fa('0xd0'))){_0x321961[_0xa8fa('0x16')]=qs[_0xa8fa('0x16')](_0x1b9870[_0xa8fa('0x42')][_0xa8fa('0x16')]);_0x321961[_0xa8fa('0x15')]=qs[_0xa8fa('0x15')](_0x1b9870[_0xa8fa('0x42')][_0xa8fa('0x15')]);}return _0x26207b[_0xa8fa('0xdc')](_0x321961);}})[_0xa8fa('0x1c')](function(_0x783b69){if(_0x783b69){return _0x783b69?{'count':_0x3921ac,'rows':_0x783b69}:null;}})[_0xa8fa('0x1c')](respondWithResult(_0x5e92d6,null))[_0xa8fa('0x51')](handleError(_0x5e92d6,null));};exports[_0xa8fa('0xde')]=function(_0x319c4a,_0x42dde1){var _0x573c0d={'raw':!![],'where':{}};var _0x3676dc={};var _0x54d7c7={'count':0x0,'rows':[]};return db['User']['findOne']({'where':{'id':_0x319c4a[_0xa8fa('0x52')]['id']}})['then'](handleEntityNotFound(_0x42dde1,null))['then'](function(_0x42e42f){if(_0x42e42f){_0x3676dc[_0xa8fa('0xc9')]=_[_0xa8fa('0xd2')](db[_0xa8fa('0xdf')][_0xa8fa('0xc5')]);_0x3676dc[_0xa8fa('0x42')]=_['keys'](_0x319c4a['query']);_0x3676dc[_0xa8fa('0xc6')]=_[_0xa8fa('0xc7')](_0x3676dc[_0xa8fa('0xc9')],_0x3676dc['query']);_0x573c0d[_0xa8fa('0x46')]=_[_0xa8fa('0xc7')](_0x3676dc[_0xa8fa('0xc9')],qs[_0xa8fa('0xc8')](_0x319c4a[_0xa8fa('0x42')][_0xa8fa('0xc8')]));_0x573c0d[_0xa8fa('0x46')]=_0x573c0d[_0xa8fa('0x46')][_0xa8fa('0x4a')]?_0x573c0d[_0xa8fa('0x46')]:_0x3676dc['model'];if(!_0x319c4a[_0xa8fa('0x42')][_0xa8fa('0xd3')](_0xa8fa('0xd0'))){_0x573c0d[_0xa8fa('0x16')]=qs[_0xa8fa('0x16')](_0x319c4a[_0xa8fa('0x42')][_0xa8fa('0x16')]);_0x573c0d[_0xa8fa('0x15')]=qs[_0xa8fa('0x15')](_0x319c4a['query'][_0xa8fa('0x15')]);}_0x573c0d[_0xa8fa('0xca')]=qs[_0xa8fa('0xcb')](_0x319c4a['query'][_0xa8fa('0xcb')]);_0x573c0d[_0xa8fa('0x41')]=qs[_0xa8fa('0xc6')](_[_0xa8fa('0xcc')](_0x319c4a[_0xa8fa('0x42')],_0x3676dc[_0xa8fa('0xc6')]));_0x573c0d[_0xa8fa('0x41')]['UserId']=_0x42e42f['id'];if(_0x319c4a['query']['filter']){_0x573c0d[_0xa8fa('0x41')]=_[_0xa8fa('0xcd')](_0x573c0d['where'],{'$or':_[_0xa8fa('0x2a')](_0x573c0d[_0xa8fa('0x46')],function(_0x3a6291){var _0x15afa8={};_0x15afa8[_0x3a6291]={'$like':'%'+_0x319c4a[_0xa8fa('0x42')][_0xa8fa('0x39')]+'%'};return _0x15afa8;})});}_0x573c0d=_[_0xa8fa('0xcd')]({},_0x573c0d,_0x319c4a[_0xa8fa('0x55')]);return db[_0xa8fa('0xdf')][_0xa8fa('0x18')]({'where':_0x573c0d[_0xa8fa('0x41')]})['then'](function(_0x4d5b19){_0x54d7c7['count']=_0x4d5b19;if(_0x319c4a[_0xa8fa('0x42')]['includeAll']){_0x573c0d[_0xa8fa('0x45')]=[{'all':!![]}];}return db['MailInteraction'][_0xa8fa('0x47')](_0x573c0d);})['then'](function(_0x5a6a7f){_0x54d7c7[_0xa8fa('0x48')]=_0x5a6a7f;return _0x54d7c7;});}})[_0xa8fa('0x1c')](respondWithFilteredResult(_0x42dde1,_0x573c0d))[_0xa8fa('0x51')](handleError(_0x42dde1,null));};exports[_0xa8fa('0xe0')]=function(_0x234e52,_0x29232a){var _0xbeb60e={};var _0x113847={};var _0x45e928;var _0x2c1025;return db[_0xa8fa('0x35')][_0xa8fa('0xbd')]({'where':{'id':_0x234e52[_0xa8fa('0x52')]['id']}})[_0xa8fa('0x1c')](handleEntityNotFound(_0x29232a,null))[_0xa8fa('0x1c')](function(_0x7d7d5d){if(_0x7d7d5d){_0x45e928=_0x7d7d5d;_0x113847['model']=_[_0xa8fa('0xd2')](db['SmsInteraction'][_0xa8fa('0xc5')]);_0x113847[_0xa8fa('0x42')]=_[_0xa8fa('0xd2')](_0x234e52[_0xa8fa('0x42')]);_0x113847[_0xa8fa('0xc6')]=_[_0xa8fa('0xc7')](_0x113847[_0xa8fa('0xc9')],_0x113847[_0xa8fa('0x42')]);_0xbeb60e[_0xa8fa('0x46')]=_[_0xa8fa('0xc7')](_0x113847[_0xa8fa('0xc9')],qs[_0xa8fa('0xc8')](_0x234e52[_0xa8fa('0x42')][_0xa8fa('0xc8')]));_0xbeb60e[_0xa8fa('0x46')]=_0xbeb60e[_0xa8fa('0x46')][_0xa8fa('0x4a')]?_0xbeb60e[_0xa8fa('0x46')]:_0x113847[_0xa8fa('0xc9')];_0xbeb60e['order']=qs['sort'](_0x234e52[_0xa8fa('0x42')][_0xa8fa('0xcb')]);_0xbeb60e[_0xa8fa('0x41')]=qs[_0xa8fa('0xc6')](_[_0xa8fa('0xcc')](_0x234e52[_0xa8fa('0x42')],_0x113847[_0xa8fa('0xc6')]));if(_0x234e52[_0xa8fa('0x42')][_0xa8fa('0x39')]){_0xbeb60e[_0xa8fa('0x41')]=_[_0xa8fa('0xcd')](_0xbeb60e['where'],{'$or':_['map'](_0xbeb60e[_0xa8fa('0x46')],function(_0x2a660b){var _0x356e28={};_0x356e28[_0x2a660b]={'$like':'%'+_0x234e52[_0xa8fa('0x42')][_0xa8fa('0x39')]+'%'};return _0x356e28;})});}_0xbeb60e=_['merge']({},_0xbeb60e,_0x234e52[_0xa8fa('0x55')]);return _0x45e928['getSmsInteractions'](_0xbeb60e);}})[_0xa8fa('0x1c')](function(_0x2216ea){if(_0x2216ea){_0x2c1025=_0x2216ea[_0xa8fa('0x4a')];if(!_0x234e52[_0xa8fa('0x42')][_0xa8fa('0xd3')](_0xa8fa('0xd0'))){_0xbeb60e['limit']=qs['limit'](_0x234e52[_0xa8fa('0x42')][_0xa8fa('0x16')]);_0xbeb60e['offset']=qs[_0xa8fa('0x15')](_0x234e52[_0xa8fa('0x42')][_0xa8fa('0x15')]);}return _0x45e928[_0xa8fa('0xe0')](_0xbeb60e);}})[_0xa8fa('0x1c')](function(_0x27f6a6){if(_0x27f6a6){return _0x27f6a6?{'count':_0x2c1025,'rows':_0x27f6a6}:null;}})[_0xa8fa('0x1c')](respondWithResult(_0x29232a,null))[_0xa8fa('0x51')](handleError(_0x29232a,null));};exports[_0xa8fa('0xe1')]=function(_0x2240e0,_0x53fad2){var _0x1e8ddc={};var _0x1f778c={};var _0x126229;var _0x130bcb;return db[_0xa8fa('0x35')]['findOne']({'where':{'id':_0x2240e0['params']['id']}})['then'](handleEntityNotFound(_0x53fad2,null))[_0xa8fa('0x1c')](function(_0x485db2){if(_0x485db2){_0x126229=_0x485db2;_0x1f778c[_0xa8fa('0xc9')]=_[_0xa8fa('0xd2')](db['FaxInteraction'][_0xa8fa('0xc5')]);_0x1f778c['query']=_[_0xa8fa('0xd2')](_0x2240e0[_0xa8fa('0x42')]);_0x1f778c[_0xa8fa('0xc6')]=_[_0xa8fa('0xc7')](_0x1f778c[_0xa8fa('0xc9')],_0x1f778c[_0xa8fa('0x42')]);_0x1e8ddc['attributes']=_['intersection'](_0x1f778c[_0xa8fa('0xc9')],qs['fields'](_0x2240e0['query'][_0xa8fa('0xc8')]));_0x1e8ddc[_0xa8fa('0x46')]=_0x1e8ddc['attributes'][_0xa8fa('0x4a')]?_0x1e8ddc[_0xa8fa('0x46')]:_0x1f778c[_0xa8fa('0xc9')];_0x1e8ddc[_0xa8fa('0xca')]=qs[_0xa8fa('0xcb')](_0x2240e0[_0xa8fa('0x42')][_0xa8fa('0xcb')]);_0x1e8ddc[_0xa8fa('0x41')]=qs['filters'](_[_0xa8fa('0xcc')](_0x2240e0[_0xa8fa('0x42')],_0x1f778c[_0xa8fa('0xc6')]));if(_0x2240e0[_0xa8fa('0x42')][_0xa8fa('0x39')]){_0x1e8ddc[_0xa8fa('0x41')]=_['merge'](_0x1e8ddc[_0xa8fa('0x41')],{'$or':_[_0xa8fa('0x2a')](_0x1e8ddc[_0xa8fa('0x46')],function(_0x351eeb){var _0x234569={};_0x234569[_0x351eeb]={'$like':'%'+_0x2240e0[_0xa8fa('0x42')][_0xa8fa('0x39')]+'%'};return _0x234569;})});}_0x1e8ddc=_[_0xa8fa('0xcd')]({},_0x1e8ddc,_0x2240e0[_0xa8fa('0x55')]);return _0x126229[_0xa8fa('0xe1')](_0x1e8ddc);}})[_0xa8fa('0x1c')](function(_0x79e6a5){if(_0x79e6a5){_0x130bcb=_0x79e6a5[_0xa8fa('0x4a')];if(!_0x2240e0[_0xa8fa('0x42')][_0xa8fa('0xd3')](_0xa8fa('0xd0'))){_0x1e8ddc['limit']=qs[_0xa8fa('0x16')](_0x2240e0[_0xa8fa('0x42')]['limit']);_0x1e8ddc['offset']=qs[_0xa8fa('0x15')](_0x2240e0[_0xa8fa('0x42')][_0xa8fa('0x15')]);}return _0x126229[_0xa8fa('0xe1')](_0x1e8ddc);}})['then'](function(_0x3ccb63){if(_0x3ccb63){return _0x3ccb63?{'count':_0x130bcb,'rows':_0x3ccb63}:null;}})['then'](respondWithResult(_0x53fad2,null))['catch'](handleError(_0x53fad2,null));};exports[_0xa8fa('0xe2')]=function(_0x1c67e2,_0x377ee8){var _0x52d1a8={};var _0x5c375f={};var _0x440305;var _0x1d6bff;return db[_0xa8fa('0x35')][_0xa8fa('0xbd')]({'where':{'id':_0x1c67e2['params']['id']}})[_0xa8fa('0x1c')](handleEntityNotFound(_0x377ee8,null))[_0xa8fa('0x1c')](function(_0x546d32){if(_0x546d32){_0x440305=_0x546d32;_0x5c375f['model']=_[_0xa8fa('0xd2')](db[_0xa8fa('0xe3')][_0xa8fa('0xc5')]);_0x5c375f[_0xa8fa('0x42')]=_[_0xa8fa('0xd2')](_0x1c67e2[_0xa8fa('0x42')]);_0x5c375f[_0xa8fa('0xc6')]=_['intersection'](_0x5c375f['model'],_0x5c375f['query']);_0x52d1a8[_0xa8fa('0x46')]=_[_0xa8fa('0xc7')](_0x5c375f[_0xa8fa('0xc9')],qs[_0xa8fa('0xc8')](_0x1c67e2[_0xa8fa('0x42')][_0xa8fa('0xc8')]));_0x52d1a8[_0xa8fa('0x46')]=_0x52d1a8[_0xa8fa('0x46')]['length']?_0x52d1a8[_0xa8fa('0x46')]:_0x5c375f[_0xa8fa('0xc9')];_0x52d1a8[_0xa8fa('0xca')]=qs[_0xa8fa('0xcb')](_0x1c67e2[_0xa8fa('0x42')][_0xa8fa('0xcb')]);_0x52d1a8[_0xa8fa('0x41')]=qs[_0xa8fa('0xc6')](_[_0xa8fa('0xcc')](_0x1c67e2[_0xa8fa('0x42')],_0x5c375f['filters']));if(_0x1c67e2[_0xa8fa('0x42')]['filter']){_0x52d1a8['where']=_[_0xa8fa('0xcd')](_0x52d1a8[_0xa8fa('0x41')],{'$or':_[_0xa8fa('0x2a')](_0x52d1a8[_0xa8fa('0x46')],function(_0x44120e){var _0x5c11f5={};_0x5c11f5[_0x44120e]={'$like':'%'+_0x1c67e2[_0xa8fa('0x42')][_0xa8fa('0x39')]+'%'};return _0x5c11f5;})});}_0x52d1a8=_[_0xa8fa('0xcd')]({},_0x52d1a8,_0x1c67e2['options']);return _0x440305[_0xa8fa('0xe2')](_0x52d1a8);}})['then'](function(_0x24932f){if(_0x24932f){_0x1d6bff=_0x24932f[_0xa8fa('0x4a')];if(!_0x1c67e2[_0xa8fa('0x42')][_0xa8fa('0xd3')]('nolimit')){_0x52d1a8[_0xa8fa('0x16')]=qs['limit'](_0x1c67e2[_0xa8fa('0x42')]['limit']);_0x52d1a8['offset']=qs['offset'](_0x1c67e2[_0xa8fa('0x42')][_0xa8fa('0x15')]);}return _0x440305[_0xa8fa('0xe2')](_0x52d1a8);}})['then'](function(_0x52869a){if(_0x52869a){return _0x52869a?{'count':_0x1d6bff,'rows':_0x52869a}:null;}})['then'](respondWithResult(_0x377ee8,null))[_0xa8fa('0x51')](handleError(_0x377ee8,null));};exports[_0xa8fa('0xe4')]=function(_0x90a30d,_0x1f413a,_0x25acc4){var _0x260125;var _0x2419de;var _0x5e5387;var _0x236417=!_[_0xa8fa('0x66')](_0x90a30d[_0xa8fa('0x52')]['id'])?_0x90a30d[_0xa8fa('0x52')]['id']:!_['isNil'](_0x90a30d[_0xa8fa('0x24')]['id'])?_0x90a30d[_0xa8fa('0x24')]['id']:null;return db['User'][_0xa8fa('0x2d')]({'where':{'id':_0x236417,'role':{'$or':[_0xa8fa('0x22'),_0xa8fa('0x24'),'agent']}},'attributes':['id',_0xa8fa('0x2e'),_0xa8fa('0xe5'),'mobile',_0xa8fa('0x1d'),_0xa8fa('0x5c'),_0xa8fa('0xe6')]})[_0xa8fa('0x1c')](function(_0x437634){if(_0x437634){if(_0x437634[_0xa8fa('0x1d')]===_0xa8fa('0x26')){_0x260125=_0x437634;if(_0x90a30d[_0xa8fa('0x57')][_0xa8fa('0x93')]){_0x5e5387=util[_0xa8fa('0xbe')](_0xa8fa('0xe7'),_0x260125[_0x90a30d[_0xa8fa('0x57')]['interface']]);}else if(_0x90a30d[_0xa8fa('0x57')][_0xa8fa('0xe8')]){_0x5e5387=util[_0xa8fa('0xbe')](_0xa8fa('0x9f'),_0x90a30d[_0xa8fa('0x57')][_0xa8fa('0xe8')]);}else{_0x5e5387=util[_0xa8fa('0xbe')](_0xa8fa('0x9f'),_0x260125[_0xa8fa('0x2e')]);}socket['to'](util['format']('user:%s',_0x260125[_0xa8fa('0x2e')]))[_0xa8fa('0x1e')]('user:forcelogout',{'user':{'id':_0x260125['id'],'name':_0x260125['name']},'ip':_0x90a30d[_0xa8fa('0xe9')]['x-forwarded-for']||_0x90a30d['connection'][_0xa8fa('0xea')]||_0x90a30d[_0xa8fa('0xeb')][_0xa8fa('0xea')]||_0x90a30d[_0xa8fa('0xec')]['socket'][_0xa8fa('0xea')]});return db[_0xa8fa('0xa5')][_0xa8fa('0x20')]({'where':{'membername':_0x260125[_0xa8fa('0x2e')]},'individualHooks':!![]});}}else{throw new db[(_0xa8fa('0x86'))][(_0xa8fa('0x87'))](_0xa8fa('0xed'));}})[_0xa8fa('0x1c')](function(){if(_0x260125){return _0x260125[_0xa8fa('0xee')]({'raw':!![]});}})[_0xa8fa('0x1c')](function(_0x5b603f){if(_0x260125){if(_0x5b603f){_0x2419de=_0x5b603f;if(_0x2419de[_0xa8fa('0x4a')]){var _0x2334c1=_0x2419de[_0xa8fa('0x2a')](function(_0x5c8f2d){var _0x5051f7={'membername':_0x260125[_0xa8fa('0x2e')],'UserId':_0x260125['id'],'queue_name':_0x5c8f2d[_0xa8fa('0x2e')],'VoiceQueueId':_0x5c8f2d['id'],'interface':_0x5e5387,'paused':_0x260125[_0xa8fa('0xe6')]||![],'penalty':_0x5c8f2d['UserVoiceQueue.penalty']||0x0};return db[_0xa8fa('0xa5')][_0xa8fa('0xa0')](_0x5051f7);});return Promise[_0xa8fa('0x56')](_0x2334c1);}}}})[_0xa8fa('0x1c')](function(){if(_0x260125){return db['MemberReport'][_0xa8fa('0x47')]({'where':{'membername':_0x260125[_0xa8fa('0x2e')],'exitAt':null}});}})[_0xa8fa('0x1c')](function(_0x228fe1){if(_0x260125){var _0x306c8a=[];_0x228fe1['forEach'](function(_0x1edf33){_0x306c8a[_0xa8fa('0x4b')](_0x1edf33[_0xa8fa('0x1b')]({'exitAt':moment()['format'](_0xa8fa('0xef'))}));});return Promise[_0xa8fa('0x56')](_0x306c8a);}})[_0xa8fa('0x1c')](function(){if(_0x260125){var _0x430488=[];var _0x2de825=[];var _0x2b221b=utils[_0xa8fa('0xf0')]();var _0x272ee4={'membername':_0x260125[_0xa8fa('0x2e')],'interface':_0x5e5387,'enterAt':moment()[_0xa8fa('0xbe')](_0xa8fa('0xef')),'role':_0x260125[_0xa8fa('0x1d')],'internal':_0x260125[_0xa8fa('0x5c')]};_0x2b221b[_0xa8fa('0xf1')](function(_0xa6a09d){_0x430488[_0xa8fa('0x4b')](_[_0xa8fa('0xcd')]({'channel':_0xa6a09d,'type':_0xa8fa('0xf2'),'data1':_0x90a30d[_0xa8fa('0x57')][_0xa8fa('0xf3')],'data2':_0x5e5387},_0x272ee4));if(_0x260125[_0xa8fa('0xe6')]){_0x2de825[_0xa8fa('0x4b')](_[_0xa8fa('0xcd')]({'channel':_0xa6a09d,'type':'PAUSE','data1':_0xa8fa('0xf4')},_0x272ee4));}});return db['MemberReport']['bulkCreate'](_0x430488['concat'](_0x2de825),{'individualHooks':!![]});}})[_0xa8fa('0x1c')](function(){if(_0x260125){return _0x260125[_0xa8fa('0x1b')]({'online':!![],'lastLoginAt':moment()[_0xa8fa('0xbe')](_0xa8fa('0xef')),'voicePause':_0x260125[_0xa8fa('0xe6')]||![],'mailPause':_0x260125[_0xa8fa('0xe6')]||![],'chatPause':_0x260125[_0xa8fa('0xe6')]||![],'faxPause':_0x260125['loginInPause']||![],'smsPause':_0x260125[_0xa8fa('0xe6')]||![],'openchannelPause':_0x260125[_0xa8fa('0xe6')]||![],'whatsappPause':_0x260125['loginInPause']||![],'pauseType':_0x260125['loginInPause']?_0xa8fa('0xf4'):null,'interface':_0x5e5387,'lastPauseAt':moment()[_0xa8fa('0xbe')](_0xa8fa('0xef'))});}})['then'](function(_0x29a923){if(_0x90a30d[_0xa8fa('0xf5')]){return _0x25acc4();}else{return Promise[_0xa8fa('0xf6')](_0x29a923)[_0xa8fa('0x1c')](respondWithResult(_0x1f413a,null));}})[_0xa8fa('0x51')](handleError(_0x1f413a,null));};exports[_0xa8fa('0xf7')]=function(_0x2f0248,_0x10efcd){var _0x3900ce;return db[_0xa8fa('0x35')][_0xa8fa('0x2d')]({'where':{'id':_0x2f0248[_0xa8fa('0x52')]['id'],'role':'agent'},'attributes':['id',_0xa8fa('0x2e'),_0xa8fa('0x1d')]})['then'](handleEntityNotFound(_0x10efcd,null))['then'](function(_0x142b94){if(_0x142b94){_0x3900ce=_0x142b94;return db[_0xa8fa('0xa5')][_0xa8fa('0x20')]({'where':{'membername':_0x3900ce['name']},'individualHooks':!![]});}})['then'](function(){return db[_0xa8fa('0xf8')][_0xa8fa('0x47')]({'where':{'membername':_0x3900ce['name'],'exitAt':null}});})['then'](function(_0x208e1a){var _0x2c9100=[];_0x208e1a[_0xa8fa('0xf1')](function(_0x25af41){_0x2c9100[_0xa8fa('0x4b')](_0x25af41[_0xa8fa('0x1b')]({'exitAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')}));});return Promise['all'](_0x2c9100);})[_0xa8fa('0x1c')](function(){return _0x3900ce[_0xa8fa('0x1b')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})[_0xa8fa('0x1c')](respondWithResult(_0x10efcd,null))[_0xa8fa('0x51')](handleError(_0x10efcd,null));};exports[_0xa8fa('0xf9')]=function(_0x287bd0,_0x5a616c){var _0x526791;return db[_0xa8fa('0xa5')][_0xa8fa('0x1b')]({'paused':0x1},{'where':{'UserId':_0x287bd0[_0xa8fa('0x52')]['id']},'individualHooks':!![]})[_0xa8fa('0x1c')](function(){return db[_0xa8fa('0x35')][_0xa8fa('0x2d')]({'where':{'id':_0x287bd0['params']['id'],'role':_0xa8fa('0x26')},'attributes':['id','name',_0xa8fa('0x1d'),'internal',_0xa8fa('0x93'),_0xa8fa('0x91')]});})['then'](handleEntityNotFound(_0x5a616c,null))[_0xa8fa('0x1c')](function(_0x5280d6){if(_0x5280d6){_0x526791=_0x5280d6;return db[_0xa8fa('0xf8')][_0xa8fa('0x47')]({'where':{'membername':_0x526791[_0xa8fa('0x2e')],'type':_0xa8fa('0xfa'),'exitAt':null}});}})[_0xa8fa('0x1c')](function(_0x119907){if(_0x119907['length']){var _0x1cb03e=moment()[_0xa8fa('0xbe')]('YYYY-MM-DD\x20HH:mm:ss');for(var _0x36be5d=0x0,_0x443bb6=_0x119907[_0xa8fa('0x4a')];_0x36be5d<_0x443bb6;_0x36be5d++){_0x119907[_0x36be5d][_0xa8fa('0xfb')]({'exitAt':_0x1cb03e});}}})[_0xa8fa('0x1c')](function(){var _0x1c705a=[];var _0x360607=utils[_0xa8fa('0xf0')]();_0x360607['forEach'](function(_0x272275){_0x1c705a['push']({'channel':_0x272275,'membername':_0x526791['name'],'interface':_[_0xa8fa('0x66')](_0x526791[_0xa8fa('0x93')])?util[_0xa8fa('0xbe')](_0xa8fa('0x9f'),_0x526791[_0xa8fa('0x2e')]):_0x526791[_0xa8fa('0x93')],'type':_0xa8fa('0xfa'),'enterAt':moment()[_0xa8fa('0xbe')](_0xa8fa('0xef')),'data1':_0x287bd0[_0xa8fa('0x57')][_0xa8fa('0x37')]||'DEFAULT\x20PAUSE','role':_0x526791[_0xa8fa('0x1d')],'internal':_0x526791['internal']});});return db['MemberReport'][_0xa8fa('0x7e')](_0x1c705a,{'individualHooks':!![]});})[_0xa8fa('0x1c')](function(){return _0x526791['update']({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0x287bd0[_0xa8fa('0x57')][_0xa8fa('0x37')]||_0xa8fa('0xfc'),'lastPauseAt':moment()[_0xa8fa('0xbe')]('YYYY-MM-DD\x20HH:mm:ss')});})[_0xa8fa('0x1c')](respondWithResult(_0x5a616c,null))[_0xa8fa('0x51')](handleError(_0x5a616c,null));};exports['unpause']=function(_0x2d3bbc,_0xc9b2b6){if(_0x2d3bbc[_0xa8fa('0x57')]['channel']&&!utils[_0xa8fa('0x94')](_0x2d3bbc[_0xa8fa('0x57')][_0xa8fa('0x90')])){throw new APIBadRequestError(util[_0xa8fa('0xbe')]('Channel\x20parameter\x20%s\x20is\x20invalid',_0x2d3bbc[_0xa8fa('0x57')][_0xa8fa('0x90')]));}return db[_0xa8fa('0x35')][_0xa8fa('0x2d')]({'where':{'id':_0x2d3bbc[_0xa8fa('0x52')]['id']},'attributes':['id',_0xa8fa('0x2e'),_0xa8fa('0x1d'),_0xa8fa('0x5c'),_0xa8fa('0x93'),_0xa8fa('0x91'),'voicePause',_0xa8fa('0xfd'),_0xa8fa('0xfe'),'faxPause',_0xa8fa('0xff'),_0xa8fa('0x100'),_0xa8fa('0x101'),'pauseType',_0xa8fa('0x102')]})[_0xa8fa('0x1c')](function(_0x255a34){if(!_0x255a34){throw new APINotFoundError(util[_0xa8fa('0xbe')]('User\x20with\x20id\x20%s\x20not\x20found',_0x2d3bbc['params']['id']));}return _0x255a34[_0xa8fa('0x103')](_0x2d3bbc['body'][_0xa8fa('0x90')]);})[_0xa8fa('0x1c')](respondWithResult(_0xc9b2b6,null))[_0xa8fa('0x51')](APIHandleError(_0xc9b2b6));};exports[_0xa8fa('0x104')]=function(_0x7e0811,_0x282ebb){var _0x36b5ba={};var _0x2188a5={};var _0x563925;var _0x37e29a;return db[_0xa8fa('0x35')][_0xa8fa('0xbd')]({'where':{'id':_0x7e0811[_0xa8fa('0x52')]['id']}})['then'](handleEntityNotFound(_0x282ebb,null))['then'](function(_0x3b4d2d){if(_0x3b4d2d){_0x563925=_0x3b4d2d;_0x2188a5[_0xa8fa('0xc9')]=_[_0xa8fa('0xd2')](db[_0xa8fa('0x105')][_0xa8fa('0xc5')]);_0x2188a5[_0xa8fa('0x42')]=_['keys'](_0x7e0811[_0xa8fa('0x42')]);_0x2188a5[_0xa8fa('0xc6')]=_['intersection'](_0x2188a5[_0xa8fa('0xc9')],_0x2188a5[_0xa8fa('0x42')]);_0x36b5ba[_0xa8fa('0x46')]=_[_0xa8fa('0xc7')](_0x2188a5[_0xa8fa('0xc9')],qs[_0xa8fa('0xc8')](_0x7e0811['query'][_0xa8fa('0xc8')]));_0x36b5ba[_0xa8fa('0x46')]=_0x36b5ba['attributes'][_0xa8fa('0x4a')]?_0x36b5ba[_0xa8fa('0x46')]:_0x2188a5['model'];_0x36b5ba[_0xa8fa('0xca')]=qs[_0xa8fa('0xcb')](_0x7e0811[_0xa8fa('0x42')]['sort']);_0x36b5ba['where']=qs[_0xa8fa('0xc6')](_[_0xa8fa('0xcc')](_0x7e0811[_0xa8fa('0x42')],_0x2188a5['filters']));if(_0x7e0811[_0xa8fa('0x42')][_0xa8fa('0x39')]){_0x36b5ba[_0xa8fa('0x41')]=_[_0xa8fa('0xcd')](_0x36b5ba[_0xa8fa('0x41')],{'$or':_['map'](_0x36b5ba[_0xa8fa('0x46')],function(_0x20b36e){var _0x7166f1={};_0x7166f1[_0x20b36e]={'$like':'%'+_0x7e0811['query'][_0xa8fa('0x39')]+'%'};return _0x7166f1;})});}_0x36b5ba=_[_0xa8fa('0xcd')]({},_0x36b5ba,_0x7e0811[_0xa8fa('0x55')]);return _0x563925[_0xa8fa('0x104')](_0x36b5ba);}})[_0xa8fa('0x1c')](function(_0x2f8d2d){if(_0x2f8d2d){_0x37e29a=_0x2f8d2d[_0xa8fa('0x4a')];if(!_0x7e0811['query'][_0xa8fa('0xd3')](_0xa8fa('0xd0'))){_0x36b5ba[_0xa8fa('0x16')]=qs['limit'](_0x7e0811['query'][_0xa8fa('0x16')]);_0x36b5ba[_0xa8fa('0x15')]=qs['offset'](_0x7e0811[_0xa8fa('0x42')][_0xa8fa('0x15')]);}return _0x563925['getTeams'](_0x36b5ba);}})[_0xa8fa('0x1c')](function(_0x40832c){if(_0x40832c){return _0x40832c?{'count':_0x37e29a,'rows':_0x40832c}:null;}})[_0xa8fa('0x1c')](respondWithResult(_0x282ebb,null))[_0xa8fa('0x51')](handleError(_0x282ebb,null));};exports[_0xa8fa('0x106')]=function(_0x4d2df6,_0x13cc31){var _0x17f238=_0x4d2df6[_0xa8fa('0x52')]['id'];var _0x4950c1=_0x4d2df6[_0xa8fa('0x57')]?_0x4d2df6[_0xa8fa('0x57')][_0xa8fa('0x5a')]:null;var _0x32f56e=[];return Promise[_0xa8fa('0xf6')]()[_0xa8fa('0x1c')](function(){if(!_0x4950c1)throw new APIBadRequestError(_0xa8fa('0x107'));})[_0xa8fa('0x1c')](function(){return db[_0xa8fa('0x35')][_0xa8fa('0xbd')]({'where':{'id':_0x17f238}});})[_0xa8fa('0x1c')](function(_0x421d71){if(!_0x421d71)throw new APINotFoundError(util[_0xa8fa('0xbe')]('User\x20with\x20id\x20%s\x20not\x20found',_0x4d2df6[_0xa8fa('0x52')]['id']));return db[_0xa8fa('0x62')][_0xa8fa('0x108')](function(_0x5ce61b){return _0x421d71[_0xa8fa('0x106')](_0x4950c1,{'transaction':_0x5ce61b})[_0xa8fa('0x1c')](function(){return db[_0xa8fa('0x105')][_0xa8fa('0x47')]({'where':{'id':{'$in':_0x4950c1}}});})[_0xa8fa('0x1c')](function(_0x4ba26a){var _0x5a1c72=_[_0xa8fa('0x2a')](_0x4ba26a,function(_0x4b140e){return _0x4b140e[_0xa8fa('0x109')]();});return Promise['all'](_0x5a1c72);})[_0xa8fa('0x1c')](function(_0x37b892){_0x32f56e=_['flattenDeep'](_0x37b892);var _0x3e4736=_[_0xa8fa('0x2a')](_0x32f56e,function(_0x26b6c7){return _0x26b6c7['addAgent'](_0x421d71['id'],{'transaction':_0x5ce61b});});return Promise['all'](_0x3e4736);})[_0xa8fa('0x1c')](function(){if(!_0x421d71[_0xa8fa('0x91')])return;var _0x1871fb=_[_0xa8fa('0x39')](_0x32f56e,function(_0x3cf75c){return _0x3cf75c[_0xa8fa('0x10a')](_0xa8fa('0x90'))==='Voice';});var _0x223211=_[_0xa8fa('0x2a')](_0x1871fb,function(_0x39d4d8){return db[_0xa8fa('0xa5')][_0xa8fa('0xa0')]({'membername':_0x421d71[_0xa8fa('0x2e')],'UserId':_0x421d71['id'],'queue_name':_0x39d4d8['name'],'VoiceQueueId':_0x39d4d8['id'],'interface':_[_0xa8fa('0x66')](_0x421d71[_0xa8fa('0x93')])?util['format']('SIP/%s',_0x421d71[_0xa8fa('0x2e')]):_0x421d71[_0xa8fa('0x93')],'paused':_0x421d71['voicePause']||![],'penalty':_0x421d71[_0xa8fa('0x97')]},{'transaction':_0x5ce61b});});return Promise[_0xa8fa('0x56')](_0x223211);})[_0xa8fa('0x1c')](function(){return db[_0xa8fa('0x10b')][_0xa8fa('0x47')]({'where':{'teamId':{'$in':_0x4950c1}}});})[_0xa8fa('0x1c')](function(_0x4335ed){var _0x2f384a=_['map'](_0x4335ed,function(_0xd1f7a){return db[_0xa8fa('0x10c')][_0xa8fa('0x7b')]({'UserId':_0x421d71['id'],'VoicePrefixId':_0xd1f7a[_0xa8fa('0x10d')]},{'transaction':_0x5ce61b});});return Promise[_0xa8fa('0x56')](_0x2f384a);});});})[_0xa8fa('0x1c')](function(){for(var _0x3ee815=0x0;_0x3ee815<_0x32f56e[_0xa8fa('0x4a')];_0x3ee815++){var _0x61e827=_0x32f56e[_0x3ee815][_0xa8fa('0x10a')]('channel');var _0x1cbee6=_0x61e827+_0xa8fa('0x9b');socket[_0xa8fa('0x1e')](_0xa8fa('0x24')+_0x61e827+_0xa8fa('0x9c'),{'UserId':_0x17f238,['queueField']:_0x32f56e[_0x3ee815]['id']});}})[_0xa8fa('0x1c')](respondWithStatusCode(_0x13cc31,null))[_0xa8fa('0x51')](APIHandleError(_0x13cc31));};exports['removeTeams']=function(_0x5dfb06,_0x8af4fc){var _0x2a98e5=_0x5dfb06[_0xa8fa('0x52')]['id'];var _0x1ea2e2=null;if(_0x5dfb06[_0xa8fa('0x42')][_0xa8fa('0x5a')]){_0x1ea2e2=_[_0xa8fa('0xa3')](_0x5dfb06[_0xa8fa('0x42')][_0xa8fa('0x5a')])?_0x5dfb06['query'][_0xa8fa('0x5a')]:[_0x5dfb06['query'][_0xa8fa('0x5a')]];}var _0x5daba6=[];return Promise[_0xa8fa('0xf6')]()['then'](function(){if(!_0x1ea2e2)throw new APIBadRequestError(_0xa8fa('0x10e'));})[_0xa8fa('0x1c')](function(){return db['User'][_0xa8fa('0xbd')]({'where':{'id':_0x2a98e5}});})['then'](function(_0x563d4d){if(!_0x563d4d)throw new APINotFoundError(util[_0xa8fa('0xbe')]('User\x20with\x20id\x20%s\x20not\x20found',_0x5dfb06['params']['id']));return db[_0xa8fa('0x62')][_0xa8fa('0x108')](function(_0x2c79be){return _0x563d4d[_0xa8fa('0x10f')](_0x1ea2e2,{'transaction':_0x2c79be})['then'](function(){return db[_0xa8fa('0x105')][_0xa8fa('0x47')]({'where':{'id':{'$in':_0x1ea2e2}}});})[_0xa8fa('0x1c')](function(_0x177b05){var _0x42018d=_[_0xa8fa('0x2a')](_0x177b05,function(_0x3fe4c0){return _0x3fe4c0[_0xa8fa('0x109')]();});return Promise['all'](_0x42018d);})[_0xa8fa('0x1c')](function(_0x59cd5c){_0x5daba6=_[_0xa8fa('0x110')](_0x59cd5c);var _0x58fe9f=_[_0xa8fa('0x2a')](_0x5daba6,function(_0x163cb3){return _0x163cb3[_0xa8fa('0x111')](_0x563d4d['id'],{'transaction':_0x2c79be});});return Promise['all'](_0x58fe9f);})['then'](function(){if(!_0x563d4d[_0xa8fa('0x91')])return;var _0x583f2f=_[_0xa8fa('0x39')](_0x5daba6,function(_0x232bc7){return _0x232bc7['getDataValue'](_0xa8fa('0x90'))===_0xa8fa('0x112');});var _0x9c38d=_[_0xa8fa('0x2a')](_0x583f2f,function(_0xf9c57e){return db['UserVoiceQueueRt'][_0xa8fa('0x20')]({'where':{'VoiceQueueId':_0xf9c57e['id'],'UserId':_0x563d4d['id']},'transaction':_0x2c79be});});return Promise[_0xa8fa('0x56')](_0x9c38d);})[_0xa8fa('0x1c')](function(){return db[_0xa8fa('0x10b')][_0xa8fa('0x47')]({'where':{'teamId':{'$in':_0x1ea2e2}}});})[_0xa8fa('0x1c')](function(_0x3b17b4){var _0x43679f=_[_0xa8fa('0x2a')](_0x3b17b4,function(_0x20afa0){return db[_0xa8fa('0x10c')][_0xa8fa('0x20')]({'where':{'UserId':_0x563d4d['id'],'VoicePrefixId':_0x20afa0[_0xa8fa('0x10d')]}},{'transaction':_0x2c79be});});return Promise['all'](_0x43679f);});});})['then'](function(){for(var _0x30a3ae=0x0;_0x30a3ae<_0x5daba6['length'];_0x30a3ae++){var _0xf76e54=_0x5daba6[_0x30a3ae][_0xa8fa('0x10a')]('channel');var _0x1cc273=_0xf76e54+'QueueId';socket['emit'](_0xa8fa('0x24')+_0xf76e54+'Queue:remove',{'UserId':_0x2a98e5,['queueField']:_0x5daba6[_0x30a3ae]['id']});}})['then'](respondWithStatusCode(_0x8af4fc,null))[_0xa8fa('0x51')](APIHandleError(_0x8af4fc));};exports[_0xa8fa('0x113')]=function(_0x4ebe71,_0x3ccd31){var _0x3fddfb={};var _0x554abd={};var _0x3016d0;var _0x4c7ed0;return db[_0xa8fa('0x35')][_0xa8fa('0xbd')]({'where':{'id':_0x4ebe71[_0xa8fa('0x52')]['id']}})['then'](handleEntityNotFound(_0x3ccd31,null))[_0xa8fa('0x1c')](function(_0x14bc60){if(_0x14bc60){_0x3016d0=_0x14bc60;_0x554abd[_0xa8fa('0xc9')]=_[_0xa8fa('0xd2')](db[_0xa8fa('0xc0')][_0xa8fa('0xc5')]);_0x554abd[_0xa8fa('0x42')]=_[_0xa8fa('0xd2')](_0x4ebe71['query']);_0x554abd[_0xa8fa('0xc6')]=_[_0xa8fa('0xc7')](_0x554abd['model'],_0x554abd[_0xa8fa('0x42')]);_0x3fddfb[_0xa8fa('0x46')]=_[_0xa8fa('0xc7')](_0x554abd['model'],qs[_0xa8fa('0xc8')](_0x4ebe71[_0xa8fa('0x42')][_0xa8fa('0xc8')]));_0x3fddfb[_0xa8fa('0x46')]=_0x3fddfb['attributes'][_0xa8fa('0x4a')]?_0x3fddfb[_0xa8fa('0x46')]:_0x554abd['model'];_0x3fddfb['order']=qs['sort'](_0x4ebe71[_0xa8fa('0x42')][_0xa8fa('0xcb')]);_0x3fddfb[_0xa8fa('0x41')]=qs[_0xa8fa('0xc6')](_[_0xa8fa('0xcc')](_0x4ebe71[_0xa8fa('0x42')],_0x554abd[_0xa8fa('0xc6')]));if(_0x4ebe71[_0xa8fa('0x42')]['filter']){_0x3fddfb[_0xa8fa('0x41')]=_['merge'](_0x3fddfb[_0xa8fa('0x41')],{'$or':_[_0xa8fa('0x2a')](_0x3fddfb[_0xa8fa('0x46')],function(_0x3556d8){var _0x59b6b3={};_0x59b6b3[_0x3556d8]={'$like':'%'+_0x4ebe71['query'][_0xa8fa('0x39')]+'%'};return _0x59b6b3;})});}_0x3fddfb=_[_0xa8fa('0xcd')]({},_0x3fddfb,_0x4ebe71[_0xa8fa('0x55')]);return _0x3016d0[_0xa8fa('0x113')](_0x3fddfb);}})[_0xa8fa('0x1c')](function(_0x24b011){if(_0x24b011){_0x4c7ed0=_0x24b011[_0xa8fa('0x4a')];if(!_0x4ebe71[_0xa8fa('0x42')][_0xa8fa('0xd3')]('nolimit')){_0x3fddfb['limit']=qs[_0xa8fa('0x16')](_0x4ebe71[_0xa8fa('0x42')][_0xa8fa('0x16')]);_0x3fddfb[_0xa8fa('0x15')]=qs['offset'](_0x4ebe71['query'][_0xa8fa('0x15')]);}return _0x3016d0[_0xa8fa('0x113')](_0x3fddfb);}})[_0xa8fa('0x1c')](function(_0x49fffb){if(_0x49fffb){return _0x49fffb?{'count':_0x4c7ed0,'rows':_0x49fffb}:null;}})[_0xa8fa('0x1c')](respondWithResult(_0x3ccd31,null))['catch'](handleError(_0x3ccd31,null));};exports[_0xa8fa('0x114')]=function(_0x2996e9,_0x531be8){var _0x1c7cbe={};var _0x2734d3={};var _0x4e9fe5;return db[_0xa8fa('0x35')][_0xa8fa('0xbd')]({'where':{'id':_0x2996e9[_0xa8fa('0x52')]['id']}})['then'](handleEntityNotFound(_0x531be8,null))['then'](function(_0x175804){if(_0x175804){_0x4e9fe5=_0x175804;_0x2734d3[_0xa8fa('0xc9')]=_[_0xa8fa('0xd2')](db[_0xa8fa('0x35')][_0xa8fa('0xc5')]);_0x2734d3[_0xa8fa('0x42')]=_['keys'](_0x2996e9[_0xa8fa('0x42')]);_0x2734d3[_0xa8fa('0xc6')]=_[_0xa8fa('0xc7')](_0x2734d3[_0xa8fa('0xc9')],_0x2734d3[_0xa8fa('0x42')]);_0x1c7cbe[_0xa8fa('0x46')]=_[_0xa8fa('0xc7')](_0x2734d3[_0xa8fa('0xc9')],qs[_0xa8fa('0xc8')](_0x2996e9['query'][_0xa8fa('0xc8')]));_0x1c7cbe['attributes']=_0x1c7cbe['attributes'][_0xa8fa('0x4a')]?_0x1c7cbe[_0xa8fa('0x46')]:_0x2734d3[_0xa8fa('0xc9')];_0x1c7cbe[_0xa8fa('0xca')]=qs[_0xa8fa('0xcb')](_0x2996e9['query'][_0xa8fa('0xcb')]);_0x1c7cbe[_0xa8fa('0x41')]=qs[_0xa8fa('0xc6')](_['pick'](_0x2996e9[_0xa8fa('0x42')],_0x2734d3[_0xa8fa('0xc6')]));if(_0x2996e9[_0xa8fa('0x42')][_0xa8fa('0x39')]){_0x1c7cbe['where']=_['merge'](_0x1c7cbe[_0xa8fa('0x41')],{'$or':_['map'](_0x1c7cbe['attributes'],function(_0x48eb5d){var _0x49950f={};_0x49950f[_0x48eb5d]={'$like':'%'+_0x2996e9['query'][_0xa8fa('0x39')]+'%'};return _0x49950f;})});}_0x1c7cbe[_0xa8fa('0xc9')]=db[_0xa8fa('0x35')];_0x1c7cbe['as']='Agents';_0x1c7cbe=_['merge']({},_0x1c7cbe,_0x2996e9[_0xa8fa('0x55')]);return _0x4e9fe5[_0xa8fa('0xee')]({'include':[_0x1c7cbe]});}})[_0xa8fa('0x1c')](function(_0x33dec8){if(_0x33dec8){var _0x22329b={},_0x7f2444=[];for(var _0x31d607=0x0;_0x31d607<_0x33dec8[_0xa8fa('0x4a')];_0x31d607+=0x1){for(var _0xb6e2b2=0x0,_0x3cce27;_0xb6e2b2<_0x33dec8[_0x31d607][_0xa8fa('0x25')][_0xa8fa('0x4a')];_0xb6e2b2+=0x1){_0x3cce27=_0x33dec8[_0x31d607][_0xa8fa('0x25')][_0xb6e2b2][_0xa8fa('0x21')]({'plain':!![]});_0x22329b[_0x3cce27['id']]=_0x3cce27;}}_0x22329b=_[_0xa8fa('0x115')](_0x22329b);for(var _0x15d4da=qs['offset'](_0x2996e9[_0xa8fa('0x42')]['offset']);_0x15d4da<_0x22329b[_0xa8fa('0x4a')]&&_0x7f2444[_0xa8fa('0x4a')]=_0x12817b[_0xee60('0x4f')]){throw new Error(_0xee60('0x50'));}})[_0xee60('0x1c')](function(){if(_0x4ee4e7){return db[_0xee60('0x25')]['destroy']({'where':{'membername':_0x4ee4e7['name']},'individualHooks':!![]});}})[_0xee60('0x1c')](function(){if(_0x4ee4e7){return _0x4ee4e7['getVoiceQueues']({'raw':!![]});}})[_0xee60('0x1c')](function(_0x69ed62){if(_0x4ee4e7){if(_0x69ed62){var _0x36826d=[];_0x21c0ab=_0x69ed62;if(_0x21c0ab[_0xee60('0x29')]){for(var _0x5823d7=0x0;_0x5823d7<_0x21c0ab[_0xee60('0x29')];_0x5823d7++){_0x36826d[_0xee60('0x2d')](db[_0xee60('0x25')][_0xee60('0x51')]({'membername':_0x4ee4e7[_0xee60('0x21')],'UserId':_0x4ee4e7['id'],'queue_name':_0x21c0ab[_0x5823d7]['name'],'VoiceQueueId':_0x21c0ab[_0x5823d7]['id'],'interface':_0x4d7553,'paused':_0x4ee4e7[_0xee60('0x4c')]||![],'penalty':_0x21c0ab[_0x5823d7][_0xee60('0x52')]||0x0}));}return BPromise[_0xee60('0x48')](_0x36826d);}}}})[_0xee60('0x1c')](function(){if(_0x4ee4e7){return db['MemberReport'][_0xee60('0xf')]({'where':{'membername':_0x4ee4e7['name'],'exitAt':null}});}})['then'](function(_0xe18755){if(_0x4ee4e7){if(_0xe18755&&_0xe18755['length']){var _0x25461a=[];_0xe18755['forEach'](function(_0x334f4f){_0x25461a[_0xee60('0x2d')](_0x334f4f[_0xee60('0x26')]({'exitAt':moment()[_0xee60('0x24')]('YYYY-MM-DD\x20HH:mm:ss')}));});return BPromise['all'](_0x25461a);}}})['then'](function(){if(_0x4ee4e7){var _0x5e9a98=[];var _0x2cf4e3=[];var _0x25e1e1=utils[_0xee60('0x2b')]();var _0x1ce164={'membername':_0x4ee4e7['name'],'interface':_0x4d7553,'enterAt':moment()['format'](_0xee60('0x2a')),'role':_0x4ee4e7['role'],'internal':_0x4ee4e7[_0xee60('0x23')]};_0x25e1e1[_0xee60('0x2c')](function(_0x273d3d){_0x5e9a98[_0xee60('0x2d')](_[_0xee60('0x53')]({'channel':_0x273d3d,'type':_0xee60('0x54'),'data1':_0xee60('0x55'),'data2':_0x4d7553},_0x1ce164));if(_0x4ee4e7[_0xee60('0x4c')]){_0x2cf4e3[_0xee60('0x2d')](_[_0xee60('0x53')]({'channel':_0x273d3d,'type':_0xee60('0x28'),'data1':'LOGININPAUSE'},_0x1ce164));}});return db[_0xee60('0x27')][_0xee60('0x35')](_0x5e9a98[_0xee60('0x56')](_0x2cf4e3),{'individualHooks':!![]});}})[_0xee60('0x1c')](function(){if(_0x4ee4e7){return _0x4ee4e7[_0xee60('0x26')]({'online':!![],'lastLoginAt':moment()[_0xee60('0x24')]('YYYY-MM-DD\x20HH:mm:ss'),'voicePause':_0x4ee4e7[_0xee60('0x4c')]||![],'mailPause':_0x4ee4e7[_0xee60('0x4c')]||![],'chatPause':_0x4ee4e7[_0xee60('0x4c')]||![],'faxPause':_0x4ee4e7[_0xee60('0x4c')]||![],'smsPause':_0x4ee4e7[_0xee60('0x4c')]||![],'openchannelPause':_0x4ee4e7['loginInPause']||![],'pauseType':_0x4ee4e7['loginInPause']?_0xee60('0x57'):null,'lastPauseAt':moment()[_0xee60('0x24')]('YYYY-MM-DD\x20HH:mm:ss'),'interface':_0x4d7553});}})[_0xee60('0x1c')](function(_0x43f51f){_0x26e5c8(_0x43f51f);})[_0xee60('0x1f')](function(_0x1b7c28){_0x5a18b7(_0x4fdee5[_0xee60('0x1a')](0x1f4,_0x1b7c28[_0xee60('0x1b')]));});});}; \ No newline at end of file +var _0xe776=['getChannels','SIP/%s','body','type','DEFAULT\x20PAUSE','internal','bulkCreate','UnpauseUser','channel','Channel\x20parameter\x20%s\x20is\x20invalid','findOne','online','voicePause','mailPause','chatPause','openchannelPause','smsPause','whatsappPause','pauseType','lastPauseAt','params','unpause','LogoutUser','destroy','forEach','push','LoginUser','mobile','phone','loginInPause','agent','../../config/license/util','getLicense','agents','Maximum\x20login\x20has\x20been\x20reached','getVoiceQueues','upsert','UserVoiceQueue.penalty','all','MemberReport','merge','LOGIN','callysquare','LOGININPAUSE','concat','lodash','util','moment','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','redis','defaults','localhost','./user.socket','register','GetUser','User','options','raw','where','attributes','limit','include','map','model','then','info','debug','stringify','error','message','ShowUser','find','catch','PauseUser','name','role','interface','format','User\x20with\x20id\x20%s\x20not\x20found','UserVoiceQueueRt','update','findAll','PAUSE','length','YYYY-MM-DD\x20HH:mm:ss','updateAttributes'];(function(_0x232955,_0x4464a4){var _0x452b6a=function(_0x176bad){while(--_0x176bad){_0x232955['push'](_0x232955['shift']());}};_0x452b6a(++_0x4464a4);}(_0xe776,0x195));var _0x6e77=function(_0x303f09,_0x4f1be9){_0x303f09=_0x303f09-0x0;var _0x2ef21d=_0xe776[_0x303f09];return _0x2ef21d;};'use strict';var _=require(_0x6e77('0x0'));var util=require(_0x6e77('0x1'));var moment=require(_0x6e77('0x2'));var BPromise=require(_0x6e77('0x3'));var Redis=require('ioredis');var db=require(_0x6e77('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x6e77('0x5'))(_0x6e77('0x6'));var config=require(_0x6e77('0x7'));config[_0x6e77('0x8')]=_[_0x6e77('0x9')](config[_0x6e77('0x8')],{'host':_0x6e77('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6e77('0x8')]));require(_0x6e77('0xb'))[_0x6e77('0xc')](socket);exports[_0x6e77('0xd')]=function(_0xbd6f2f){var _0x2ff110=this;return new Promise(function(_0xb07fda,_0x4661ca){return db[_0x6e77('0xe')]['findAll']({'raw':_0xbd6f2f[_0x6e77('0xf')]?_0xbd6f2f[_0x6e77('0xf')][_0x6e77('0x10')]===undefined?!![]:![]:!![],'where':_0xbd6f2f['options']?_0xbd6f2f[_0x6e77('0xf')][_0x6e77('0x11')]||null:null,'attributes':_0xbd6f2f[_0x6e77('0xf')]?_0xbd6f2f['options'][_0x6e77('0x12')]||null:null,'limit':_0xbd6f2f[_0x6e77('0xf')]?_0xbd6f2f[_0x6e77('0xf')][_0x6e77('0x13')]||null:null,'include':_0xbd6f2f[_0x6e77('0xf')]?_0xbd6f2f[_0x6e77('0xf')][_0x6e77('0x14')]?_[_0x6e77('0x15')](_0xbd6f2f[_0x6e77('0xf')][_0x6e77('0x14')],function(_0x36ae3b){return{'model':db[_0x36ae3b['model']],'as':_0x36ae3b['as'],'attributes':_0x36ae3b[_0x6e77('0x12')],'include':_0x36ae3b[_0x6e77('0x14')]?_['map'](_0x36ae3b[_0x6e77('0x14')],function(_0x48e08e){return{'model':db[_0x48e08e[_0x6e77('0x16')]],'as':_0x48e08e['as'],'attributes':_0x48e08e['attributes'],'include':_0x48e08e[_0x6e77('0x14')]?_[_0x6e77('0x15')](_0x48e08e[_0x6e77('0x14')],function(_0x5057c6){return{'model':db[_0x5057c6[_0x6e77('0x16')]],'as':_0x5057c6['as'],'attributes':_0x5057c6['attributes']};}):[]};}):[]};}):[]:[]})[_0x6e77('0x17')](function(_0x4cbb68){logger[_0x6e77('0x18')]('GetUser',_0xbd6f2f);logger[_0x6e77('0x19')](_0x6e77('0xd'),_0xbd6f2f,JSON[_0x6e77('0x1a')](_0x4cbb68));_0xb07fda(_0x4cbb68);})['catch'](function(_0x513cbf){logger[_0x6e77('0x1b')](_0x6e77('0xd'),_0x513cbf[_0x6e77('0x1c')],_0xbd6f2f);_0x4661ca(_0x2ff110[_0x6e77('0x1b')](0x1f4,_0x513cbf[_0x6e77('0x1c')]));});});};exports[_0x6e77('0x1d')]=function(_0x3147b5){var _0x36aaca=this;return new Promise(function(_0x346161,_0x6225e){return db[_0x6e77('0xe')][_0x6e77('0x1e')]({'raw':_0x3147b5[_0x6e77('0xf')]?_0x3147b5[_0x6e77('0xf')][_0x6e77('0x10')]===undefined?!![]:![]:!![],'where':_0x3147b5[_0x6e77('0xf')]?_0x3147b5[_0x6e77('0xf')]['where']||null:null,'attributes':_0x3147b5[_0x6e77('0xf')]?_0x3147b5[_0x6e77('0xf')][_0x6e77('0x12')]||null:null,'include':_0x3147b5[_0x6e77('0xf')]?_0x3147b5[_0x6e77('0xf')][_0x6e77('0x14')]?_['map'](_0x3147b5[_0x6e77('0xf')]['include'],function(_0x52f89e){return{'model':db[_0x52f89e[_0x6e77('0x16')]],'as':_0x52f89e['as'],'attributes':_0x52f89e[_0x6e77('0x12')],'include':_0x52f89e['include']?_[_0x6e77('0x15')](_0x52f89e[_0x6e77('0x14')],function(_0x5969cd){return{'model':db[_0x5969cd[_0x6e77('0x16')]],'as':_0x5969cd['as'],'attributes':_0x5969cd[_0x6e77('0x12')],'include':_0x5969cd[_0x6e77('0x14')]?_[_0x6e77('0x15')](_0x5969cd[_0x6e77('0x14')],function(_0xf22a96){return{'model':db[_0xf22a96[_0x6e77('0x16')]],'as':_0xf22a96['as'],'attributes':_0xf22a96['attributes']};}):[]};}):[]};}):[]:[]})[_0x6e77('0x17')](function(_0x1f58f0){logger[_0x6e77('0x18')](_0x6e77('0x1d'),_0x3147b5);logger[_0x6e77('0x19')](_0x6e77('0x1d'),_0x3147b5,JSON['stringify'](_0x1f58f0));_0x346161(_0x1f58f0);})[_0x6e77('0x1f')](function(_0x40f779){logger[_0x6e77('0x1b')](_0x6e77('0x1d'),_0x40f779['message'],_0x3147b5);_0x6225e(_0x36aaca[_0x6e77('0x1b')](0x1f4,_0x40f779[_0x6e77('0x1c')]));});});};exports[_0x6e77('0x20')]=function(_0x3deb7c){var _0x436f98;return db['User']['find']({'where':_0x3deb7c[_0x6e77('0xf')][_0x6e77('0x11')]||{},'attributes':['id',_0x6e77('0x21'),_0x6e77('0x22'),'internal',_0x6e77('0x23')]})[_0x6e77('0x17')](function(_0x1edffb){if(!_0x1edffb){throw new Error(util[_0x6e77('0x24')](_0x6e77('0x25'),_0x3deb7c['params']['id']));}_0x436f98=_0x1edffb;return db[_0x6e77('0x26')][_0x6e77('0x27')]({'paused':0x1},{'where':{'UserId':_0x436f98['id']},'individualHooks':!![]});})['then'](function(){return db['MemberReport'][_0x6e77('0x28')]({'where':{'membername':_0x436f98['name'],'type':_0x6e77('0x29'),'exitAt':null}});})[_0x6e77('0x17')](function(_0x4ed52e){if(_0x4ed52e&&_0x4ed52e[_0x6e77('0x2a')]){var _0xb03bd1=moment()[_0x6e77('0x24')](_0x6e77('0x2b'));for(var _0x5a5790=0x0,_0x201124=_0x4ed52e[_0x6e77('0x2a')];_0x5a5790<_0x201124;_0x5a5790++){_0x4ed52e[_0x5a5790][_0x6e77('0x2c')]({'exitAt':_0xb03bd1});}}})[_0x6e77('0x17')](function(){var _0x3eddb0=[];var _0x4356c6=utils[_0x6e77('0x2d')]();_0x4356c6['forEach'](function(_0x29b4f5){_0x3eddb0['push']({'channel':_0x29b4f5,'membername':_0x436f98[_0x6e77('0x21')],'interface':_['isNil'](_0x436f98[_0x6e77('0x23')])?util[_0x6e77('0x24')](_0x6e77('0x2e'),_0x436f98['name']):_0x436f98['interface'],'type':_0x6e77('0x29'),'enterAt':moment()[_0x6e77('0x24')](_0x6e77('0x2b')),'data1':_0x3deb7c[_0x6e77('0x2f')][_0x6e77('0x30')]||_0x6e77('0x31'),'role':_0x436f98[_0x6e77('0x22')],'internal':_0x436f98[_0x6e77('0x32')],'uniqueid':_0x3deb7c[_0x6e77('0x2f')]['uniqueid']||null});});return db['MemberReport'][_0x6e77('0x33')](_0x3eddb0,{'individualHooks':!![]});})[_0x6e77('0x17')](function(){return _0x436f98['update']({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'whatsappPause':!![],'pauseType':_0x3deb7c[_0x6e77('0x2f')][_0x6e77('0x30')]||_0x6e77('0x31'),'lastPauseAt':moment()['format'](_0x6e77('0x2b'))});})['catch'](function(_0x468bfb){throw _0x468bfb;});};exports[_0x6e77('0x34')]=function(_0x261135){return Promise['resolve']()[_0x6e77('0x17')](function(){if(_0x261135[_0x6e77('0x2f')]['channel']&&!utils['isValidChannel'](_0x261135['body'][_0x6e77('0x35')])){throw new Error(util['format'](_0x6e77('0x36'),_0x261135[_0x6e77('0x2f')][_0x6e77('0x35')]));}return db[_0x6e77('0xe')][_0x6e77('0x37')]({'where':_0x261135[_0x6e77('0xf')]['where']||{},'attributes':['id','name','role',_0x6e77('0x32'),'interface',_0x6e77('0x38'),_0x6e77('0x39'),_0x6e77('0x3a'),_0x6e77('0x3b'),'faxPause',_0x6e77('0x3c'),_0x6e77('0x3d'),_0x6e77('0x3e'),_0x6e77('0x3f'),_0x6e77('0x40')]});})[_0x6e77('0x17')](function(_0x472f48){if(!_0x472f48){throw new Error(util[_0x6e77('0x24')]('User\x20with\x20id\x20%s\x20not\x20found',_0x261135[_0x6e77('0x41')]['id']));}return _0x472f48[_0x6e77('0x42')](_0x261135['body'][_0x6e77('0x35')],'system');})['catch'](function(_0xdb034d){throw _0xdb034d;});};exports[_0x6e77('0x43')]=function(_0x1a0678){var _0x2ae240=this;return new Promise(function(_0x5cd4ef,_0x2b1706){var _0x281560;return db[_0x6e77('0xe')][_0x6e77('0x37')]({'where':_0x1a0678[_0x6e77('0xf')][_0x6e77('0x11')]||{},'attributes':['id','name']})[_0x6e77('0x17')](function(_0x45c1c2){if(_0x45c1c2){_0x281560=_0x45c1c2;return db[_0x6e77('0x26')][_0x6e77('0x44')]({'where':{'membername':_0x281560[_0x6e77('0x21')]},'individualHooks':!![]});}})[_0x6e77('0x17')](function(){if(_0x281560){return db['MemberReport']['findAll']({'where':{'membername':_0x281560['name'],'exitAt':null}});}})[_0x6e77('0x17')](function(_0x5dabbf){if(_0x281560){if(_0x5dabbf&&_0x5dabbf[_0x6e77('0x2a')]){var _0x1745c2=[];_0x5dabbf[_0x6e77('0x45')](function(_0x2927c4){_0x1745c2[_0x6e77('0x46')](_0x2927c4['update']({'exitAt':moment()['format'](_0x6e77('0x2b'))}));});return BPromise['all'](_0x1745c2);}}})['then'](function(){if(_0x281560){return _0x281560[_0x6e77('0x27')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});}})[_0x6e77('0x17')](function(_0x9efdb7){_0x5cd4ef(_0x9efdb7);})[_0x6e77('0x1f')](function(_0x4d4758){_0x2b1706(_0x2ae240[_0x6e77('0x1b')](0x1f4,_0x4d4758[_0x6e77('0x1c')]));});});};exports[_0x6e77('0x47')]=function(_0x2a9589){var _0x2d255b=this;return new Promise(function(_0x2db57d,_0x3dbee9){var _0x3ce48e;var _0x81216d;var _0x14a0a0;var _0x5cda40;return db[_0x6e77('0xe')][_0x6e77('0x37')]({'where':_0x2a9589[_0x6e77('0xf')][_0x6e77('0x11')]||{},'attributes':['id',_0x6e77('0x21'),'role',_0x6e77('0x48'),_0x6e77('0x49'),'internal',_0x6e77('0x4a'),_0x6e77('0x23')]})[_0x6e77('0x17')](function(_0x3651fa){if(_0x3651fa){_0x3ce48e=_0x3651fa;_0x5cda40=_0x2a9589[_0x6e77('0x2f')][_0x6e77('0x23')]?_0x2a9589[_0x6e77('0x2f')][_0x6e77('0x23')]:util['format']('SIP/%s',_0x3ce48e['name']);return db[_0x6e77('0xe')]['count']({'where':{'role':_0x6e77('0x4b'),'online':!![],'id':{'$ne':_0x3ce48e['id']}}});}})[_0x6e77('0x17')](function(_0xae4801){if(_0xae4801){_0x14a0a0=_0xae4801;return require(_0x6e77('0x4c'))[_0x6e77('0x4d')]();}})[_0x6e77('0x17')](function(_0x19c5ec){if(_0x19c5ec&&_0x19c5ec[_0x6e77('0x4e')]&&_0x14a0a0>=_0x19c5ec['agents']){throw new Error(_0x6e77('0x4f'));}})[_0x6e77('0x17')](function(){if(_0x3ce48e){return db[_0x6e77('0x26')][_0x6e77('0x44')]({'where':{'membername':_0x3ce48e[_0x6e77('0x21')]},'individualHooks':!![]});}})[_0x6e77('0x17')](function(){if(_0x3ce48e){return _0x3ce48e[_0x6e77('0x50')]({'raw':!![]});}})[_0x6e77('0x17')](function(_0x3994f8){if(_0x3ce48e){if(_0x3994f8){var _0x54d098=[];_0x81216d=_0x3994f8;if(_0x81216d[_0x6e77('0x2a')]){for(var _0x43ec10=0x0;_0x43ec10<_0x81216d[_0x6e77('0x2a')];_0x43ec10++){_0x54d098['push'](db['UserVoiceQueueRt'][_0x6e77('0x51')]({'membername':_0x3ce48e[_0x6e77('0x21')],'UserId':_0x3ce48e['id'],'queue_name':_0x81216d[_0x43ec10][_0x6e77('0x21')],'VoiceQueueId':_0x81216d[_0x43ec10]['id'],'interface':_0x5cda40,'paused':_0x3ce48e[_0x6e77('0x4a')]||![],'penalty':_0x81216d[_0x43ec10][_0x6e77('0x52')]||0x0}));}return BPromise[_0x6e77('0x53')](_0x54d098);}}}})[_0x6e77('0x17')](function(){if(_0x3ce48e){return db[_0x6e77('0x54')]['findAll']({'where':{'membername':_0x3ce48e['name'],'exitAt':null}});}})['then'](function(_0x1c8063){if(_0x3ce48e){if(_0x1c8063&&_0x1c8063['length']){var _0x252f89=[];_0x1c8063[_0x6e77('0x45')](function(_0x5b16b5){_0x252f89[_0x6e77('0x46')](_0x5b16b5[_0x6e77('0x27')]({'exitAt':moment()[_0x6e77('0x24')](_0x6e77('0x2b'))}));});return BPromise[_0x6e77('0x53')](_0x252f89);}}})[_0x6e77('0x17')](function(){if(_0x3ce48e){var _0x3dbbeb=[];var _0x1d0179=[];var _0x1d0978=utils['getChannels']();var _0x112b51={'membername':_0x3ce48e[_0x6e77('0x21')],'interface':_0x5cda40,'enterAt':moment()['format'](_0x6e77('0x2b')),'role':_0x3ce48e[_0x6e77('0x22')],'internal':_0x3ce48e['internal']};_0x1d0978[_0x6e77('0x45')](function(_0x2ca750){_0x3dbbeb[_0x6e77('0x46')](_[_0x6e77('0x55')]({'channel':_0x2ca750,'type':_0x6e77('0x56'),'data1':_0x6e77('0x57'),'data2':_0x5cda40},_0x112b51));if(_0x3ce48e[_0x6e77('0x4a')]){_0x1d0179[_0x6e77('0x46')](_[_0x6e77('0x55')]({'channel':_0x2ca750,'type':'PAUSE','data1':_0x6e77('0x58')},_0x112b51));}});return db['MemberReport']['bulkCreate'](_0x3dbbeb[_0x6e77('0x59')](_0x1d0179),{'individualHooks':!![]});}})['then'](function(){if(_0x3ce48e){return _0x3ce48e[_0x6e77('0x27')]({'online':!![],'lastLoginAt':moment()[_0x6e77('0x24')](_0x6e77('0x2b')),'voicePause':_0x3ce48e[_0x6e77('0x4a')]||![],'mailPause':_0x3ce48e[_0x6e77('0x4a')]||![],'chatPause':_0x3ce48e[_0x6e77('0x4a')]||![],'faxPause':_0x3ce48e[_0x6e77('0x4a')]||![],'smsPause':_0x3ce48e[_0x6e77('0x4a')]||![],'openchannelPause':_0x3ce48e['loginInPause']||![],'pauseType':_0x3ce48e[_0x6e77('0x4a')]?_0x6e77('0x58'):null,'lastPauseAt':moment()[_0x6e77('0x24')]('YYYY-MM-DD\x20HH:mm:ss'),'interface':_0x5cda40});}})[_0x6e77('0x17')](function(_0x3df1b){_0x2db57d(_0x3df1b);})[_0x6e77('0x1f')](function(_0x3bb2b9){_0x3dbee9(_0x2d255b['error'](0x1f4,_0x3bb2b9[_0x6e77('0x1c')]));});});}; \ No newline at end of file diff --git a/server/api/user/user.socket.js b/server/api/user/user.socket.js index 5824520..bf4edd2 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 _0x7a1d=['save','remove','length','user:'];(function(_0x1f48e5,_0x5b4543){var _0x20da09=function(_0x30cc67){while(--_0x30cc67){_0x1f48e5['push'](_0x1f48e5['shift']());}};_0x20da09(++_0x5b4543);}(_0x7a1d,0xbc));var _0xd7a1=function(_0x52096b,_0x20bab4){_0x52096b=_0x52096b-0x0;var _0x2b1cc7=_0x7a1d[_0x52096b];return _0x2b1cc7;};'use strict';var UserEvents=require('./user.events');var events=[_0xd7a1('0x0'),_0xd7a1('0x1'),'update'];function createListener(_0x2b1f53,_0x3faf1b){return function(_0x56f8c9){_0x3faf1b['emit'](_0x2b1f53,_0x56f8c9);};}function removeListener(_0xae973d,_0x3d3673){return function(){UserEvents['removeListener'](_0xae973d,_0x3d3673);};}exports['register']=function(_0x4472f6){for(var _0x98d89e=0x0,_0x6c1e20=events[_0xd7a1('0x2')];_0x98d89e<_0x6c1e20;_0x98d89e++){var _0x4babb0=events[_0x98d89e];var _0x20f189=createListener(_0xd7a1('0x3')+_0x4babb0,_0x4472f6);UserEvents['on'](_0x4babb0,_0x20f189);}}; \ No newline at end of file +var _0x7dc7=['emit','removeListener','register','length','user:','save','remove','update'];(function(_0x5e1739,_0x137e18){var _0x1d80af=function(_0x2cf619){while(--_0x2cf619){_0x5e1739['push'](_0x5e1739['shift']());}};_0x1d80af(++_0x137e18);}(_0x7dc7,0x1ad));var _0x77dc=function(_0x3485f0,_0x9841a3){_0x3485f0=_0x3485f0-0x0;var _0x593efb=_0x7dc7[_0x3485f0];return _0x593efb;};'use strict';var UserEvents=require('./user.events');var events=[_0x77dc('0x0'),_0x77dc('0x1'),_0x77dc('0x2')];function createListener(_0x36a4b4,_0x9578dc){return function(_0x194740){_0x9578dc[_0x77dc('0x3')](_0x36a4b4,_0x194740);};}function removeListener(_0x13affa,_0x133c81){return function(){UserEvents[_0x77dc('0x4')](_0x13affa,_0x133c81);};}exports[_0x77dc('0x5')]=function(_0x1be605){for(var _0x105051=0x0,_0x5cf55e=events[_0x77dc('0x6')];_0x105051<_0x5cf55e;_0x105051++){var _0x18b61c=events[_0x105051];var _0x152e72=createListener(_0x77dc('0x7')+_0x18b61c,_0x1be605);UserEvents['on'](_0x18b61c,_0x152e72);}}; \ No newline at end of file diff --git a/server/api/userChatQueue/index.js b/server/api/userChatQueue/index.js index bbea767..3a33df8 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 _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x579681,_0x181f3f){var _0x3054e0=function(_0x3c57ac){while(--_0x3c57ac){_0x579681['push'](_0x579681['shift']());}};_0x3054e0(++_0x181f3f);}(_0x9c44,0x178));var _0x49c4=function(_0x17b6e3,_0x4522ed){_0x17b6e3=_0x17b6e3-0x0;var _0x3906f3=_0x9c44[_0x17b6e3];return _0x3906f3;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file +var _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x3ca968,_0x38e50e){var _0x292554=function(_0xd73fff){while(--_0xd73fff){_0x3ca968['push'](_0x3ca968['shift']());}};_0x292554(++_0x38e50e);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.attributes.js b/server/api/userChatQueue/userChatQueue.attributes.js index 26154f6..508109a 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 _0x1b1d=['INTEGER','exports'];(function(_0x1f8b8e,_0x5c4e17){var _0x5d8a83=function(_0x493dd4){while(--_0x493dd4){_0x1f8b8e['push'](_0x1f8b8e['shift']());}};_0x5d8a83(++_0x5c4e17);}(_0x1b1d,0x97));var _0xd1b1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1b1d[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module[_0xd1b1('0x0')]={'penalty':{'type':Sequelize[_0xd1b1('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0x8d81=['sequelize','exports','INTEGER'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x8d81,0xe4));var _0x18d8=function(_0x57d09c,_0x1f9c46){_0x57d09c=_0x57d09c-0x0;var _0x41eb36=_0x8d81[_0x57d09c];return _0x41eb36;};'use strict';var Sequelize=require(_0x18d8('0x0'));module[_0x18d8('0x1')]={'penalty':{'type':Sequelize[_0x18d8('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 a592e4c..f3513ff 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 _0x82e6=['./userChatQueue.attributes','exports','UserChatQueue','user_has_chat_queues','lodash','util','api','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x2738ea,_0x203734){var _0x4f9ddd=function(_0x5b600f){while(--_0x5b600f){_0x2738ea['push'](_0x2738ea['shift']());}};_0x4f9ddd(++_0x203734);}(_0x82e6,0x19c));var _0x682e=function(_0xe0b81f,_0x1fb734){_0xe0b81f=_0xe0b81f-0x0;var _0x290e5e=_0x82e6[_0xe0b81f];return _0x290e5e;};'use strict';var _=require(_0x682e('0x0'));var util=require(_0x682e('0x1'));var logger=require('../../config/logger')(_0x682e('0x2'));var moment=require(_0x682e('0x3'));var BPromise=require(_0x682e('0x4'));var rp=require(_0x682e('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x682e('0x6'));var config=require(_0x682e('0x7'));var attributes=require(_0x682e('0x8'));module[_0x682e('0x9')]=function(_0x3511dd,_0x5bad93){return _0x3511dd['define'](_0x682e('0xa'),attributes,{'tableName':_0x682e('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x153a=['./userChatQueue.attributes','exports','define','UserChatQueue','user_has_chat_queues','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x153a,0x1ef));var _0xa153=function(_0x2c7618,_0x26be9c){_0x2c7618=_0x2c7618-0x0;var _0x5ce3f0=_0x153a[_0x2c7618];return _0x5ce3f0;};'use strict';var _=require(_0xa153('0x0'));var util=require('util');var logger=require(_0xa153('0x1'))(_0xa153('0x2'));var moment=require(_0xa153('0x3'));var BPromise=require(_0xa153('0x4'));var rp=require(_0xa153('0x5'));var fs=require('fs');var path=require(_0xa153('0x6'));var rimraf=require(_0xa153('0x7'));var config=require(_0xa153('0x8'));var attributes=require(_0xa153('0x9'));module[_0xa153('0xa')]=function(_0x19c5cc,_0x19995f){return _0x19c5cc[_0xa153('0xb')](_0xa153('0xc'),attributes,{'tableName':_0xa153('0xd'),'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 215d50e..ab846ab 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 _0xf733=['lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','then','debug','UserChatQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','UserChatQueue,\x20%s,\x20%s','message','info','catch'];(function(_0x2599f6,_0x1e7e39){var _0x3cc842=function(_0x54296d){while(--_0x54296d){_0x2599f6['push'](_0x2599f6['shift']());}};_0x3cc842(++_0x1e7e39);}(_0xf733,0xf2));var _0x3f73=function(_0x38cf75,_0x2aa799){_0x38cf75=_0x38cf75-0x0;var _0x222b18=_0xf733[_0x38cf75];return _0x222b18;};'use strict';var _=require(_0x3f73('0x0'));var util=require('util');var moment=require(_0x3f73('0x1'));var BPromise=require(_0x3f73('0x2'));var rs=require(_0x3f73('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3f73('0x4'))['db'];var utils=require(_0x3f73('0x5'));var logger=require('../../config/logger')(_0x3f73('0x6'));var config=require('../../config/environment');var jayson=require(_0x3f73('0x7'));var client=jayson[_0x3f73('0x8')][_0x3f73('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x15f1d9,_0x5ad347,_0x4e8137){return new BPromise(function(_0x33b616,_0x47c925){return client[_0x3f73('0xa')](_0x15f1d9,_0x4e8137)[_0x3f73('0xb')](function(_0x42f838){logger['info']('UserChatQueue,\x20%s,\x20%s',_0x5ad347,'request\x20sent');logger[_0x3f73('0xc')](_0x3f73('0xd'),_0x5ad347,_0x3f73('0xe'),JSON[_0x3f73('0xf')](_0x42f838));if(_0x42f838['error']){if(_0x42f838[_0x3f73('0x10')][_0x3f73('0x11')]===0x1f4){logger[_0x3f73('0x10')](_0x3f73('0x12'),_0x5ad347,_0x42f838[_0x3f73('0x10')][_0x3f73('0x13')]);return _0x47c925(_0x42f838[_0x3f73('0x10')]['message']);}logger[_0x3f73('0x10')](_0x3f73('0x12'),_0x5ad347,_0x42f838[_0x3f73('0x10')][_0x3f73('0x13')]);return _0x33b616(_0x42f838['error'][_0x3f73('0x13')]);}else{logger[_0x3f73('0x14')](_0x3f73('0x12'),_0x5ad347,_0x3f73('0xe'));_0x33b616(_0x42f838['result']['message']);}})[_0x3f73('0x15')](function(_0x1bba6a){logger[_0x3f73('0x10')](_0x3f73('0x12'),_0x5ad347,_0x1bba6a);_0x47c925(_0x1bba6a);});});} \ No newline at end of file +var _0xf5e2=['bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','info','UserChatQueue,\x20%s,\x20%s','request\x20sent','debug','UserChatQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash'];(function(_0x2d93b2,_0x780a6f){var _0x4445b8=function(_0x15fed1){while(--_0x15fed1){_0x2d93b2['push'](_0x2d93b2['shift']());}};_0x4445b8(++_0x780a6f);}(_0xf5e2,0xb3));var _0x2f5e=function(_0x42e17f,_0xda528d){_0x42e17f=_0x42e17f-0x0;var _0x501ef2=_0xf5e2[_0x42e17f];return _0x501ef2;};'use strict';var _=require(_0x2f5e('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x2f5e('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2f5e('0x2'));var db=require(_0x2f5e('0x3'))['db'];var utils=require(_0x2f5e('0x4'));var logger=require(_0x2f5e('0x5'))(_0x2f5e('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x2f5e('0x7')][_0x2f5e('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x29d064,_0x5da6ca,_0x1257f7){return new BPromise(function(_0x9456cb,_0x1d00a2){return client[_0x2f5e('0x9')](_0x29d064,_0x1257f7)['then'](function(_0x33bf53){logger[_0x2f5e('0xa')](_0x2f5e('0xb'),_0x5da6ca,_0x2f5e('0xc'));logger[_0x2f5e('0xd')](_0x2f5e('0xe'),_0x5da6ca,_0x2f5e('0xc'),JSON['stringify'](_0x33bf53));if(_0x33bf53[_0x2f5e('0xf')]){if(_0x33bf53[_0x2f5e('0xf')][_0x2f5e('0x10')]===0x1f4){logger[_0x2f5e('0xf')]('UserChatQueue,\x20%s,\x20%s',_0x5da6ca,_0x33bf53['error'][_0x2f5e('0x11')]);return _0x1d00a2(_0x33bf53[_0x2f5e('0xf')]['message']);}logger['error'](_0x2f5e('0xb'),_0x5da6ca,_0x33bf53[_0x2f5e('0xf')][_0x2f5e('0x11')]);return _0x9456cb(_0x33bf53[_0x2f5e('0xf')]['message']);}else{logger[_0x2f5e('0xa')](_0x2f5e('0xb'),_0x5da6ca,_0x2f5e('0xc'));_0x9456cb(_0x33bf53[_0x2f5e('0x12')][_0x2f5e('0x11')]);}})[_0x2f5e('0x13')](function(_0x376ba1){logger[_0x2f5e('0xf')](_0x2f5e('0xb'),_0x5da6ca,_0x376ba1);_0x1d00a2(_0x376ba1);});});} \ No newline at end of file diff --git a/server/api/userFaxQueue/index.js b/server/api/userFaxQueue/index.js index 8cce19e..f0f26ef 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 _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x1bd39f,_0x53ad83){var _0x42ecb0=function(_0x5032c1){while(--_0x5032c1){_0x1bd39f['push'](_0x1bd39f['shift']());}};_0x42ecb0(++_0x53ad83);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file +var _0xedd9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','exports'];(function(_0x497658,_0x18a533){var _0x13026e=function(_0x139bab){while(--_0x139bab){_0x497658['push'](_0x497658['shift']());}};_0x13026e(++_0x18a533);}(_0xedd9,0xfc));var _0x9edd=function(_0x549408,_0x5c6be7){_0x549408=_0x549408-0x0;var _0x129c43=_0xedd9[_0x549408];return _0x129c43;};'use strict';var multer=require('multer');var util=require(_0x9edd('0x0'));var path=require(_0x9edd('0x1'));var timeout=require(_0x9edd('0x2'));var express=require(_0x9edd('0x3'));var router=express[_0x9edd('0x4')]();var fs_extra=require(_0x9edd('0x5'));var auth=require(_0x9edd('0x6'));var interaction=require(_0x9edd('0x7'));var config=require('../../config/environment');module[_0x9edd('0x8')]=router; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.attributes.js b/server/api/userFaxQueue/userFaxQueue.attributes.js index f63ca25..cac5aab 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 _0x2a98=['STRING','sequelize','INTEGER'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x2a98,0x181));var _0x82a9=function(_0x410a8e,_0x19e986){_0x410a8e=_0x410a8e-0x0;var _0x9319e=_0x2a98[_0x410a8e];return _0x9319e;};'use strict';var Sequelize=require(_0x82a9('0x0'));module['exports']={'penalty':{'type':Sequelize[_0x82a9('0x1')],'defaultValue':0x0},'assigned':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'queue':{'type':Sequelize[_0x82a9('0x2')]}}; \ No newline at end of file +var _0xa1f2=['INTEGER'];(function(_0x1ddcdf,_0x51f300){var _0x4ff7d6=function(_0x662fe4){while(--_0x662fe4){_0x1ddcdf['push'](_0x1ddcdf['shift']());}};_0x4ff7d6(++_0x51f300);}(_0xa1f2,0x132));var _0x2a1f=function(_0x281fe4,_0x1fc737){_0x281fe4=_0x281fe4-0x0;var _0x10a303=_0xa1f2[_0x281fe4];return _0x10a303;};'use strict';var Sequelize=require('sequelize');module['exports']={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x2a1f('0x0')],'defaultValue':0x0},'queue':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.model.js b/server/api/userFaxQueue/userFaxQueue.model.js index 53cf8c8..6b20060 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 _0x6bde=['api','moment','bluebird','request-promise','path','rimraf','./userFaxQueue.attributes','exports','define','UserFaxQueue','user_has_fax_queues','lodash','util'];(function(_0x4a8418,_0x39078a){var _0x390174=function(_0x173ea6){while(--_0x173ea6){_0x4a8418['push'](_0x4a8418['shift']());}};_0x390174(++_0x39078a);}(_0x6bde,0x1b8));var _0xe6bd=function(_0x2e2ddc,_0x49b41a){_0x2e2ddc=_0x2e2ddc-0x0;var _0x3eea7f=_0x6bde[_0x2e2ddc];return _0x3eea7f;};'use strict';var _=require(_0xe6bd('0x0'));var util=require(_0xe6bd('0x1'));var logger=require('../../config/logger')(_0xe6bd('0x2'));var moment=require(_0xe6bd('0x3'));var BPromise=require(_0xe6bd('0x4'));var rp=require(_0xe6bd('0x5'));var fs=require('fs');var path=require(_0xe6bd('0x6'));var rimraf=require(_0xe6bd('0x7'));var config=require('../../config/environment');var attributes=require(_0xe6bd('0x8'));module[_0xe6bd('0x9')]=function(_0x498241,_0x512192){return _0x498241[_0xe6bd('0xa')](_0xe6bd('0xb'),attributes,{'tableName':_0xe6bd('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8862=['path','rimraf','../../config/environment','exports','define','UserFaxQueue','user_has_fax_queues','lodash','api','moment','bluebird'];(function(_0x3355e9,_0x281750){var _0xabcebb=function(_0x235ab1){while(--_0x235ab1){_0x3355e9['push'](_0x3355e9['shift']());}};_0xabcebb(++_0x281750);}(_0x8862,0x193));var _0x2886=function(_0x17589e,_0x1ce410){_0x17589e=_0x17589e-0x0;var _0x21c664=_0x8862[_0x17589e];return _0x21c664;};'use strict';var _=require(_0x2886('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x2886('0x1'));var moment=require(_0x2886('0x2'));var BPromise=require(_0x2886('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2886('0x4'));var rimraf=require(_0x2886('0x5'));var config=require(_0x2886('0x6'));var attributes=require('./userFaxQueue.attributes');module[_0x2886('0x7')]=function(_0x38a472,_0x2df81e){return _0x38a472[_0x2886('0x8')](_0x2886('0x9'),attributes,{'tableName':_0x2886('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.rpc.js b/server/api/userFaxQueue/userFaxQueue.rpc.js index d3d6e62..be58edc 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 _0x1938=['then','UserFaxQueue,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request'];(function(_0x587577,_0x53a237){var _0x75d167=function(_0x1997b4){while(--_0x1997b4){_0x587577['push'](_0x587577['shift']());}};_0x75d167(++_0x53a237);}(_0x1938,0x1bc));var _0x8193=function(_0x38d9a3,_0x2c7288){_0x38d9a3=_0x38d9a3-0x0;var _0x4c968f=_0x1938[_0x38d9a3];return _0x4c968f;};'use strict';var _=require(_0x8193('0x0'));var util=require(_0x8193('0x1'));var moment=require(_0x8193('0x2'));var BPromise=require('bluebird');var rs=require(_0x8193('0x3'));var fs=require('fs');var Redis=require(_0x8193('0x4'));var db=require(_0x8193('0x5'))['db'];var utils=require(_0x8193('0x6'));var logger=require(_0x8193('0x7'))(_0x8193('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x8193('0x9')][_0x8193('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x254626,_0x45c7b8,_0x3a5d1){return new BPromise(function(_0x424966,_0x1ea21a){return client[_0x8193('0xb')](_0x254626,_0x3a5d1)[_0x8193('0xc')](function(_0x29a75e){logger['info'](_0x8193('0xd'),_0x45c7b8,_0x8193('0xe'));logger['debug']('UserFaxQueue,\x20%s,\x20%s,\x20%s',_0x45c7b8,_0x8193('0xe'),JSON[_0x8193('0xf')](_0x29a75e));if(_0x29a75e[_0x8193('0x10')]){if(_0x29a75e[_0x8193('0x10')]['code']===0x1f4){logger['error'](_0x8193('0xd'),_0x45c7b8,_0x29a75e[_0x8193('0x10')][_0x8193('0x11')]);return _0x1ea21a(_0x29a75e[_0x8193('0x10')][_0x8193('0x11')]);}logger[_0x8193('0x10')]('UserFaxQueue,\x20%s,\x20%s',_0x45c7b8,_0x29a75e[_0x8193('0x10')]['message']);return _0x424966(_0x29a75e[_0x8193('0x10')][_0x8193('0x11')]);}else{logger['info']('UserFaxQueue,\x20%s,\x20%s',_0x45c7b8,'request\x20sent');_0x424966(_0x29a75e[_0x8193('0x12')][_0x8193('0x11')]);}})['catch'](function(_0x2f7b3d){logger[_0x8193('0x10')](_0x8193('0xd'),_0x45c7b8,_0x2f7b3d);_0x1ea21a(_0x2f7b3d);});});} \ No newline at end of file +var _0xfce8=['request\x20sent','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','then','info','UserFaxQueue,\x20%s,\x20%s','debug','UserFaxQueue,\x20%s,\x20%s,\x20%s'];(function(_0x11bb66,_0x1e12c0){var _0x4cde42=function(_0xa55baa){while(--_0xa55baa){_0x11bb66['push'](_0x11bb66['shift']());}};_0x4cde42(++_0x1e12c0);}(_0xfce8,0xb7));var _0x8fce=function(_0x169c01,_0x59f28d){_0x169c01=_0x169c01-0x0;var _0x2c3be4=_0xfce8[_0x169c01];return _0x2c3be4;};'use strict';var _=require(_0x8fce('0x0'));var util=require(_0x8fce('0x1'));var moment=require('moment');var BPromise=require(_0x8fce('0x2'));var rs=require(_0x8fce('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8fce('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x8fce('0x5'))(_0x8fce('0x6'));var config=require(_0x8fce('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x8fce('0x8')][_0x8fce('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4bae7c,_0x4a5ce2,_0x2d18d2){return new BPromise(function(_0x3ba30a,_0x2c00ba){return client['request'](_0x4bae7c,_0x2d18d2)[_0x8fce('0xa')](function(_0x225f7d){logger[_0x8fce('0xb')](_0x8fce('0xc'),_0x4a5ce2,'request\x20sent');logger[_0x8fce('0xd')](_0x8fce('0xe'),_0x4a5ce2,_0x8fce('0xf'),JSON[_0x8fce('0x10')](_0x225f7d));if(_0x225f7d[_0x8fce('0x11')]){if(_0x225f7d[_0x8fce('0x11')][_0x8fce('0x12')]===0x1f4){logger['error'](_0x8fce('0xc'),_0x4a5ce2,_0x225f7d[_0x8fce('0x11')][_0x8fce('0x13')]);return _0x2c00ba(_0x225f7d['error'][_0x8fce('0x13')]);}logger[_0x8fce('0x11')](_0x8fce('0xc'),_0x4a5ce2,_0x225f7d[_0x8fce('0x11')][_0x8fce('0x13')]);return _0x3ba30a(_0x225f7d['error']['message']);}else{logger[_0x8fce('0xb')](_0x8fce('0xc'),_0x4a5ce2,_0x8fce('0xf'));_0x3ba30a(_0x225f7d[_0x8fce('0x14')][_0x8fce('0x13')]);}})[_0x8fce('0x15')](function(_0x13f94f){logger['error']('UserFaxQueue,\x20%s,\x20%s',_0x4a5ce2,_0x13f94f);_0x2c00ba(_0x13f94f);});});} \ No newline at end of file diff --git a/server/api/userMailQueue/index.js b/server/api/userMailQueue/index.js index ab48536..ca6ed28 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 _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x513201,_0x14b010){var _0x4897a1=function(_0x4e4db7){while(--_0x4e4db7){_0x513201['push'](_0x513201['shift']());}};_0x4897a1(++_0x14b010);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x325501,_0x5242f6){_0x325501=_0x325501-0x0;var _0x2c1626=_0xcb91[_0x325501];return _0x2c1626;};'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 _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x5a21f1,_0x182429){var _0x573668=function(_0x31ec64){while(--_0x31ec64){_0x5a21f1['push'](_0x5a21f1['shift']());}};_0x573668(++_0x182429);}(_0xe706,0xa3));var _0x6e70=function(_0x4bfb8b,_0x10b39f){_0x4bfb8b=_0x4bfb8b-0x0;var _0x48f13c=_0xe706[_0x4bfb8b];return _0x48f13c;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));module[_0x6e70('0x9')]=router; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.attributes.js b/server/api/userMailQueue/userMailQueue.attributes.js index ba7b331..2c1242c 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 _0xffde=['INTEGER','exports'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xffde,0x9f));var _0xeffd=function(_0x32d646,_0xfceabd){_0x32d646=_0x32d646-0x0;var _0x45bbae=_0xffde[_0x32d646];return _0x45bbae;};'use strict';var Sequelize=require('sequelize');module[_0xeffd('0x0')]={'penalty':{'type':Sequelize[_0xeffd('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0xef8b=['exports','INTEGER'];(function(_0x192d66,_0x3656e7){var _0x2b8739=function(_0x36f6ed){while(--_0x36f6ed){_0x192d66['push'](_0x192d66['shift']());}};_0x2b8739(++_0x3656e7);}(_0xef8b,0x192));var _0xbef8=function(_0x1b95a1,_0x529852){_0x1b95a1=_0x1b95a1-0x0;var _0x57aef1=_0xef8b[_0x1b95a1];return _0x57aef1;};'use strict';var Sequelize=require('sequelize');module[_0xbef8('0x0')]={'penalty':{'type':Sequelize[_0xbef8('0x1')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.model.js b/server/api/userMailQueue/userMailQueue.model.js index 40f417f..5c54df3 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 _0xc916=['request-promise','exports','define','util','../../config/logger','api','moment','bluebird'];(function(_0x3e112d,_0x2bb132){var _0x531c31=function(_0x1954bc){while(--_0x1954bc){_0x3e112d['push'](_0x3e112d['shift']());}};_0x531c31(++_0x2bb132);}(_0xc916,0x83));var _0x6c91=function(_0x4b4277,_0x22676f){_0x4b4277=_0x4b4277-0x0;var _0x1ff405=_0xc916[_0x4b4277];return _0x1ff405;};'use strict';var _=require('lodash');var util=require(_0x6c91('0x0'));var logger=require(_0x6c91('0x1'))(_0x6c91('0x2'));var moment=require(_0x6c91('0x3'));var BPromise=require(_0x6c91('0x4'));var rp=require(_0x6c91('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./userMailQueue.attributes');module[_0x6c91('0x6')]=function(_0x1f230c,_0xea5a5c){return _0x1f230c[_0x6c91('0x7')]('UserMailQueue',attributes,{'tableName':'user_has_mail_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8224=['../../config/environment','./userMailQueue.attributes','UserMailQueue','user_has_mail_queues','util','moment','bluebird','request-promise','path','rimraf'];(function(_0x2a6809,_0x44edde){var _0x11c371=function(_0x1a4888){while(--_0x1a4888){_0x2a6809['push'](_0x2a6809['shift']());}};_0x11c371(++_0x44edde);}(_0x8224,0x1da));var _0x4822=function(_0x1a5a68,_0xf5bfab){_0x1a5a68=_0x1a5a68-0x0;var _0x5c5721=_0x8224[_0x1a5a68];return _0x5c5721;};'use strict';var _=require('lodash');var util=require(_0x4822('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x4822('0x1'));var BPromise=require(_0x4822('0x2'));var rp=require(_0x4822('0x3'));var fs=require('fs');var path=require(_0x4822('0x4'));var rimraf=require(_0x4822('0x5'));var config=require(_0x4822('0x6'));var attributes=require(_0x4822('0x7'));module['exports']=function(_0x49f27a,_0x2530e6){return _0x49f27a['define'](_0x4822('0x8'),attributes,{'tableName':_0x4822('0x9'),'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 5e91428..28c3496 100644 --- a/server/api/userMailQueue/userMailQueue.rpc.js +++ b/server/api/userMailQueue/userMailQueue.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x008c=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','UserMailQueue,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','UserMailQueue,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x008c,0x188));var _0xc008=function(_0x2cbfe5,_0x1fb99b){_0x2cbfe5=_0x2cbfe5-0x0;var _0x3f69ad=_0x008c[_0x2cbfe5];return _0x3f69ad;};'use strict';var _=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var moment=require(_0xc008('0x2'));var BPromise=require(_0xc008('0x3'));var rs=require(_0xc008('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc008('0x5'))['db'];var utils=require(_0xc008('0x6'));var logger=require(_0xc008('0x7'))(_0xc008('0x8'));var config=require(_0xc008('0x9'));var jayson=require(_0xc008('0xa'));var client=jayson[_0xc008('0xb')][_0xc008('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x9c8cb2,_0x4af530,_0x428fa9){return new BPromise(function(_0x5aa09b,_0x30be38){return client['request'](_0x9c8cb2,_0x428fa9)['then'](function(_0x27830d){logger[_0xc008('0xd')]('UserMailQueue,\x20%s,\x20%s',_0x4af530,'request\x20sent');logger['debug'](_0xc008('0xe'),_0x4af530,_0xc008('0xf'),JSON['stringify'](_0x27830d));if(_0x27830d[_0xc008('0x10')]){if(_0x27830d[_0xc008('0x10')][_0xc008('0x11')]===0x1f4){logger[_0xc008('0x10')](_0xc008('0x12'),_0x4af530,_0x27830d[_0xc008('0x10')][_0xc008('0x13')]);return _0x30be38(_0x27830d['error']['message']);}logger[_0xc008('0x10')]('UserMailQueue,\x20%s,\x20%s',_0x4af530,_0x27830d[_0xc008('0x10')][_0xc008('0x13')]);return _0x5aa09b(_0x27830d[_0xc008('0x10')][_0xc008('0x13')]);}else{logger[_0xc008('0xd')]('UserMailQueue,\x20%s,\x20%s',_0x4af530,'request\x20sent');_0x5aa09b(_0x27830d['result'][_0xc008('0x13')]);}})[_0xc008('0x14')](function(_0x3cafe3){logger[_0xc008('0x10')]('UserMailQueue,\x20%s,\x20%s',_0x4af530,_0x3cafe3);_0x30be38(_0x3cafe3);});});} \ No newline at end of file +var _0x6aa7=['result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','client','request','then','info','UserMailQueue,\x20%s,\x20%s','request\x20sent','debug','UserMailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0xf6074f,_0x40fe18){var _0x4c6c10=function(_0x499c8b){while(--_0x499c8b){_0xf6074f['push'](_0xf6074f['shift']());}};_0x4c6c10(++_0x40fe18);}(_0x6aa7,0x178));var _0x76aa=function(_0x17063c,_0x1aa564){_0x17063c=_0x17063c-0x0;var _0x1683c8=_0x6aa7[_0x17063c];return _0x1683c8;};'use strict';var _=require(_0x76aa('0x0'));var util=require('util');var moment=require(_0x76aa('0x1'));var BPromise=require(_0x76aa('0x2'));var rs=require(_0x76aa('0x3'));var fs=require('fs');var Redis=require(_0x76aa('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x76aa('0x5'));var logger=require(_0x76aa('0x6'))(_0x76aa('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x76aa('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x32dee5,_0x36d12b,_0xa9b695){return new BPromise(function(_0x56d6bc,_0x3dae33){return client[_0x76aa('0x9')](_0x32dee5,_0xa9b695)[_0x76aa('0xa')](function(_0x557d69){logger[_0x76aa('0xb')](_0x76aa('0xc'),_0x36d12b,_0x76aa('0xd'));logger[_0x76aa('0xe')](_0x76aa('0xf'),_0x36d12b,_0x76aa('0xd'),JSON[_0x76aa('0x10')](_0x557d69));if(_0x557d69[_0x76aa('0x11')]){if(_0x557d69[_0x76aa('0x11')][_0x76aa('0x12')]===0x1f4){logger['error'](_0x76aa('0xc'),_0x36d12b,_0x557d69['error'][_0x76aa('0x13')]);return _0x3dae33(_0x557d69[_0x76aa('0x11')][_0x76aa('0x13')]);}logger[_0x76aa('0x11')](_0x76aa('0xc'),_0x36d12b,_0x557d69['error']['message']);return _0x56d6bc(_0x557d69[_0x76aa('0x11')]['message']);}else{logger[_0x76aa('0xb')](_0x76aa('0xc'),_0x36d12b,'request\x20sent');_0x56d6bc(_0x557d69[_0x76aa('0x14')]['message']);}})[_0x76aa('0x15')](function(_0x5181d2){logger[_0x76aa('0x11')](_0x76aa('0xc'),_0x36d12b,_0x5181d2);_0x3dae33(_0x5181d2);});});} \ No newline at end of file diff --git a/server/api/userNotification/index.js b/server/api/userNotification/index.js index 65fe714..4320be0 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 _0xb27a=['sendUserNotification','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./userNotification.controller','post','isAuthenticated'];(function(_0x4eb4b9,_0x160925){var _0x570971=function(_0x361e51){while(--_0x361e51){_0x4eb4b9['push'](_0x4eb4b9['shift']());}};_0x570971(++_0x160925);}(_0xb27a,0x161));var _0xab27=function(_0x86b219,_0x43038f){_0x86b219=_0x86b219-0x0;var _0x1f320c=_0xb27a[_0x86b219];return _0x1f320c;};'use strict';var multer=require(_0xab27('0x0'));var util=require(_0xab27('0x1'));var path=require(_0xab27('0x2'));var timeout=require(_0xab27('0x3'));var express=require(_0xab27('0x4'));var router=express['Router']();var fs_extra=require(_0xab27('0x5'));var auth=require(_0xab27('0x6'));var interaction=require(_0xab27('0x7'));var config=require('../../config/environment');var controller=require(_0xab27('0x8'));router[_0xab27('0x9')]('/',auth[_0xab27('0xa')](),controller[_0xab27('0xb')]);module[_0xab27('0xc')]=router; \ No newline at end of file +var _0x54de=['path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','post','isAuthenticated','sendUserNotification','exports','multer'];(function(_0x43d83a,_0x34855c){var _0x455387=function(_0x529458){while(--_0x529458){_0x43d83a['push'](_0x43d83a['shift']());}};_0x455387(++_0x34855c);}(_0x54de,0x9f));var _0xe54d=function(_0x25aaa6,_0xf1b1d1){_0x25aaa6=_0x25aaa6-0x0;var _0x4badfb=_0x54de[_0x25aaa6];return _0x4badfb;};'use strict';var multer=require(_0xe54d('0x0'));var util=require('util');var path=require(_0xe54d('0x1'));var timeout=require(_0xe54d('0x2'));var express=require(_0xe54d('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xe54d('0x4'));var interaction=require(_0xe54d('0x5'));var config=require('../../config/environment');var controller=require('./userNotification.controller');router[_0xe54d('0x6')]('/',auth[_0xe54d('0x7')](),controller[_0xe54d('0x8')]);module[_0xe54d('0x9')]=router; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.attributes.js b/server/api/userNotification/userNotification.attributes.js index 0a203f0..a4bcb28 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 _0x5a1a=['BOOLEAN','sequelize','exports','TEXT','STRING'];(function(_0x4978a5,_0x2246d6){var _0x13da2f=function(_0xd467a0){while(--_0xd467a0){_0x4978a5['push'](_0x4978a5['shift']());}};_0x13da2f(++_0x2246d6);}(_0x5a1a,0x8d));var _0xa5a1=function(_0x49f1b4,_0x4dbe76){_0x49f1b4=_0x49f1b4-0x0;var _0xf341d9=_0x5a1a[_0x49f1b4];return _0xf341d9;};'use strict';var Sequelize=require(_0xa5a1('0x0'));module[_0xa5a1('0x1')]={'body':{'type':Sequelize[_0xa5a1('0x2')]},'senderName':{'type':Sequelize[_0xa5a1('0x3')]},'recipientsId':{'type':Sequelize[_0xa5a1('0x2')]},'recipientsDescription':{'type':Sequelize[_0xa5a1('0x3')]},'beep':{'type':Sequelize[_0xa5a1('0x4')]}}; \ No newline at end of file +var _0xdf17=['exports','TEXT','STRING','BOOLEAN','sequelize'];(function(_0x2aa0e7,_0x4e5145){var _0x1472c0=function(_0x4deaeb){while(--_0x4deaeb){_0x2aa0e7['push'](_0x2aa0e7['shift']());}};_0x1472c0(++_0x4e5145);}(_0xdf17,0x86));var _0x7df1=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0xdf17[_0x311c35];return _0x5cc50c;};'use strict';var Sequelize=require(_0x7df1('0x0'));module[_0x7df1('0x1')]={'body':{'type':Sequelize[_0x7df1('0x2')]},'senderName':{'type':Sequelize['STRING']},'recipientsId':{'type':Sequelize[_0x7df1('0x2')]},'recipientsDescription':{'type':Sequelize[_0x7df1('0x3')]},'beep':{'type':Sequelize[_0x7df1('0x4')]}}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.controller.js b/server/api/userNotification/userNotification.controller.js index 8b98f94..880d444 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 _0x115f=['smsqueue','team','includes','toLowerCase','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','user','fullname','isEmpty','recipientsDescription','beep','SenderId','recipientsId','sortBy','join','sequelize','transaction','UserNotification','create','forEach','recipient','emit','userNotification:send','catch','text','findOne','Invalid\x20\x27TemplateId\x27\x20parameter','render','html','startCase','model','User','ids','queue','replace','Queue','push','all','union','flatten','getAgents','map','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','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/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./userNotification.socket','register','sendStatus','status','json','offset','undefined','count','set','Content-Range','save','update','then','error','name','send','body','hasOwnProperty','Sequelize','ValidationError','TemplateId','view','Missing\x20\x27view\x27\x20parameter','recipients','Missing\x20\x27recipients\x27\x20parameter','parse','Invalid\x20\x27recipients\x27\x20object','chatqueue','faxqueue','mailqueue'];(function(_0x2e60f8,_0x439d4e){var _0x313522=function(_0x45d3f8){while(--_0x45d3f8){_0x2e60f8['push'](_0x2e60f8['shift']());}};_0x313522(++_0x439d4e);}(_0x115f,0xfc));var _0xf115=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x115f[_0x2f5ac5];return _0x37c9a8;};'use strict';var emlformat=require(_0xf115('0x0'));var rimraf=require(_0xf115('0x1'));var zipdir=require(_0xf115('0x2'));var jsonpatch=require(_0xf115('0x3'));var rp=require('request-promise');var moment=require(_0xf115('0x4'));var BPromise=require(_0xf115('0x5'));var Mustache=require(_0xf115('0x6'));var util=require(_0xf115('0x7'));var path=require('path');var sox=require(_0xf115('0x8'));var csv=require(_0xf115('0x9'));var ejs=require(_0xf115('0xa'));var fs=require('fs');var fs_extra=require(_0xf115('0xb'));var _=require(_0xf115('0xc'));var squel=require(_0xf115('0xd'));var crypto=require(_0xf115('0xe'));var jsforce=require(_0xf115('0xf'));var deskjs=require(_0xf115('0x10'));var toCsv=require('to-csv');var querystring=require(_0xf115('0x11'));var Papa=require(_0xf115('0x12'));var Redis=require(_0xf115('0x13'));var authService=require(_0xf115('0x14'));var qs=require(_0xf115('0x15'));var as=require(_0xf115('0x16'));var hardwareService=require(_0xf115('0x17'));var logger=require(_0xf115('0x18'))(_0xf115('0x19'));var utils=require(_0xf115('0x1a'));var config=require(_0xf115('0x1b'));var licenseUtil=require(_0xf115('0x1c'));var db=require(_0xf115('0x1d'))['db'];config[_0xf115('0x1e')]=_[_0xf115('0x1f')](config[_0xf115('0x1e')],{'host':'localhost','port':0x18eb});var socket=require(_0xf115('0x20'))(new Redis(config[_0xf115('0x1e')]));require(_0xf115('0x21'))[_0xf115('0x22')](socket);function respondWithStatusCode(_0x361795,_0x4fdae0){_0x4fdae0=_0x4fdae0||0xcc;return function(_0x4897d8){if(_0x4897d8){return _0x361795[_0xf115('0x23')](_0x4fdae0);}return _0x361795[_0xf115('0x24')](_0x4fdae0)['end']();};}function respondWithResult(_0x4b8982,_0x2204d0){_0x2204d0=_0x2204d0||0xc8;return function(_0x391318){if(_0x391318){return _0x4b8982[_0xf115('0x24')](_0x2204d0)[_0xf115('0x25')](_0x391318);}};}function respondWithFilteredResult(_0x5afe5d,_0x331037){return function(_0x2f8559){if(_0x2f8559){var _0x5069d5=typeof _0x331037[_0xf115('0x26')]===_0xf115('0x27')&&typeof _0x331037['limit']===_0xf115('0x27');var _0x38f4b9=_0x2f8559[_0xf115('0x28')];var _0x578e97=_0x5069d5?0x0:_0x331037['offset'];var _0xb97615=_0x5069d5?_0x2f8559[_0xf115('0x28')]:_0x331037[_0xf115('0x26')]+_0x331037['limit'];var _0x4845f3;if(_0xb97615>=_0x38f4b9){_0xb97615=_0x38f4b9;_0x4845f3=0xc8;}else{_0x4845f3=0xce;}_0x5afe5d['status'](_0x4845f3);return _0x5afe5d[_0xf115('0x29')](_0xf115('0x2a'),_0x578e97+'-'+_0xb97615+'/'+_0x38f4b9)[_0xf115('0x25')](_0x2f8559);}return null;};}function patchUpdates(_0x587a72){return function(_0x460b71){try{jsonpatch['apply'](_0x460b71,_0x587a72,!![]);}catch(_0x5509c4){return BPromise['reject'](_0x5509c4);}return _0x460b71[_0xf115('0x2b')]();};}function saveUpdates(_0x1c543e,_0x2af54a){return function(_0x358fa6){if(_0x358fa6){return _0x358fa6[_0xf115('0x2c')](_0x1c543e)[_0xf115('0x2d')](function(_0x2e3e11){return _0x2e3e11;});}return null;};}function removeEntity(_0x576abe,_0xc6d371){return function(_0xb2a2d9){if(_0xb2a2d9){return _0xb2a2d9['destroy']()[_0xf115('0x2d')](function(){_0x576abe[_0xf115('0x24')](0xcc)['end']();});}};}function handleEntityNotFound(_0x57555d,_0x280138){return function(_0x1ee327){if(!_0x1ee327){_0x57555d[_0xf115('0x23')](0x194);}return _0x1ee327;};}function handleError(_0x45db69,_0x447f95){_0x447f95=_0x447f95||0x1f4;return function(_0x52946a){logger[_0xf115('0x2e')](_0x52946a['stack']);if(_0x52946a[_0xf115('0x2f')]){delete _0x52946a[_0xf115('0x2f')];}_0x45db69[_0xf115('0x24')](_0x447f95)[_0xf115('0x30')](_0x52946a);};}exports['sendUserNotification']=function(_0x1d96aa,_0x4cf52e,_0x23a2fe){if(!_0x1d96aa[_0xf115('0x31')][_0xf115('0x32')]('text')&&!_0x1d96aa[_0xf115('0x31')]['hasOwnProperty']('TemplateId')){throw new db[(_0xf115('0x33'))][(_0xf115('0x34'))]('Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27');}else{if(_0x1d96aa[_0xf115('0x31')][_0xf115('0x32')](_0xf115('0x35'))&&!_0x1d96aa['body'][_0xf115('0x32')](_0xf115('0x36'))){throw new db[(_0xf115('0x33'))][(_0xf115('0x34'))](_0xf115('0x37'));}if(!_0x1d96aa[_0xf115('0x31')]['hasOwnProperty'](_0xf115('0x38'))){throw new db[(_0xf115('0x33'))][(_0xf115('0x34'))](_0xf115('0x39'));}else{try{var _0x30b484=JSON[_0xf115('0x3a')](_0x1d96aa[_0xf115('0x31')][_0xf115('0x38')]);}catch(_0x18c03f){logger[_0xf115('0x2e')](_0x18c03f);throw new db[(_0xf115('0x33'))][(_0xf115('0x34'))](_0xf115('0x3b'));}var _0x1f7d4e=[_0xf115('0x3c'),_0xf115('0x3d'),_0xf115('0x3e'),'openchannelqueue',_0xf115('0x3f'),'voicequeue','whatsappqueue',_0xf115('0x40'),'user'];if(_['some'](_0x30b484,function(_0x2e547a){return!_[_0xf115('0x41')](_0x1f7d4e,_0x2e547a['model'][_0xf115('0x42')]());})){throw new db[(_0xf115('0x33'))]['ValidationError'](_0xf115('0x43'));}}}var _0x32d73d={};_0x32d73d['senderName']=_0x1d96aa[_0xf115('0x31')][_0xf115('0x32')](_0xf115('0x44'))?_0x1d96aa['body']['senderName']:_0x1d96aa[_0xf115('0x45')][_0xf115('0x46')];_0x32d73d['recipientsDescription']=_[_0xf115('0x47')](_0x1d96aa[_0xf115('0x31')][_0xf115('0x48')])?null:_0x1d96aa['body'][_0xf115('0x48')];_0x32d73d['beep']=_0x1d96aa[_0xf115('0x31')][_0xf115('0x49')]||![];_0x32d73d[_0xf115('0x4a')]=_0x1d96aa[_0xf115('0x45')]['id'];return getContent(_0x1d96aa[_0xf115('0x31')])['then'](function(_0x152d83){_0x32d73d[_0xf115('0x31')]=_0x152d83;return getRecipients(_0x30b484);})[_0xf115('0x2d')](function(_0x17ef6e){_0x32d73d[_0xf115('0x4b')]=_[_0xf115('0x4c')](_0x17ef6e)[_0xf115('0x4d')](',');return db[_0xf115('0x4e')][_0xf115('0x4f')](function(_0xe170b0){return db[_0xf115('0x50')][_0xf115('0x51')](_0x32d73d,{'raw':!![],'transaction':_0xe170b0})[_0xf115('0x2d')](function(_0x427f08){var _0x511a1f={'sender':_0x32d73d[_0xf115('0x44')],'description':_0x32d73d[_0xf115('0x48')],'content':_0x32d73d[_0xf115('0x31')],'beep':_0x32d73d['beep']};_0x17ef6e[_0xf115('0x52')](function(_0x5ea60f){_0x511a1f[_0xf115('0x53')]=_0x5ea60f;socket[_0xf115('0x54')](_0xf115('0x55'),_0x511a1f);});return _0x427f08;});});})[_0xf115('0x2d')](respondWithResult(_0x4cf52e,0xc9))[_0xf115('0x56')](handleError(_0x4cf52e,null));};function getContent(_0x3787b7){return new BPromise(function(_0x55502f,_0xf1c512){if(_0x3787b7[_0xf115('0x57')]){_0x55502f(_0x3787b7['text']);return;}return db['Template'][_0xf115('0x58')]({'attributes':['html'],'where':{'id':_0x3787b7[_0xf115('0x35')]},'raw':!![]})[_0xf115('0x2d')](function(_0x1d25d4){if(!_0x1d25d4)throw new db[(_0xf115('0x33'))][(_0xf115('0x34'))](_0xf115('0x59'));var _0x3d70d0=Mustache[_0xf115('0x5a')](_0x1d25d4[_0xf115('0x5b')],_0x3787b7[_0xf115('0x36')]);_0x55502f(_0x3d70d0);})[_0xf115('0x56')](function(_0x462808){_0xf1c512(_0x462808);});});}function getRecipients(_0x866807){return new BPromise(function(_0xefc6d6,_0x5efa72){var _0x4d7d4d=[];var _0x3aeb34=[];_0x866807['forEach'](function(_0x4340ab){var _0xc93cdf=_[_0xf115('0x5c')](_0x4340ab[_0xf115('0x5d')][_0xf115('0x42')]());if(_0xc93cdf===_0xf115('0x5e')){_0x4d7d4d=_['union'](_0x4d7d4d,_0x4340ab[_0xf115('0x5f')]);}else{if(_[_0xf115('0x41')](_0xc93cdf,_0xf115('0x60')))_0xc93cdf=_0xc93cdf[_0xf115('0x61')]('queue',_0xf115('0x62'));_0x4340ab[_0xf115('0x5f')]['forEach'](function(_0x5df7ec){_0x3aeb34[_0xf115('0x63')](getAgents(_0xc93cdf,_0x5df7ec));});}});return BPromise[_0xf115('0x64')](_0x3aeb34)[_0xf115('0x2d')](function(_0x403c59){_0x4d7d4d=_[_0xf115('0x65')](_0x4d7d4d,_[_0xf115('0x66')](_0x403c59));_0xefc6d6(_0x4d7d4d);})[_0xf115('0x56')](function(_0x17b8bd){_0x5efa72(_0x17b8bd);});});}function getAgents(_0x3091d8,_0x51849c){return new BPromise(function(_0x1ba07a,_0xa148fe){return db[_0x3091d8][_0xf115('0x58')]({'where':{'id':_0x51849c}})['then'](function(_0x30aef9){return _0x30aef9[_0xf115('0x67')]({'attributes':['id'],'raw':!![]})[_0xf115('0x2d')](function(_0x2f2bf5){var _0x33e41e=_[_0xf115('0x68')](_0x2f2bf5,'id');_0x1ba07a(_0x33e41e);});})[_0xf115('0x56')](function(_0x1447f7){_0xa148fe(_0x1447f7);});});} \ No newline at end of file +var _0x3e3f=['fs-extra','lodash','squel','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','redis','defaults','socket.io-emitter','./userNotification.socket','register','sendStatus','status','end','json','offset','undefined','count','limit','apply','reject','save','update','then','destroy','name','sendUserNotification','hasOwnProperty','text','body','TemplateId','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','view','Sequelize','ValidationError','Missing\x20\x27view\x27\x20parameter','Missing\x20\x27recipients\x27\x20parameter','recipients','error','chatqueue','faxqueue','mailqueue','openchannelqueue','voicequeue','team','some','model','toLowerCase','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','user','fullname','recipientsDescription','beep','SenderId','recipientsId','sortBy','join','sequelize','UserNotification','create','forEach','recipient','emit','userNotification:send','Template','findOne','html','catch','startCase','union','includes','queue','Queue','ids','push','all','map','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv'];(function(_0x1728c2,_0x2133dd){var _0x666253=function(_0x3d3abb){while(--_0x3d3abb){_0x1728c2['push'](_0x1728c2['shift']());}};_0x666253(++_0x2133dd);}(_0x3e3f,0x1d5));var _0xf3e3=function(_0x5683b1,_0x2b75fd){_0x5683b1=_0x5683b1-0x0;var _0x1e164d=_0x3e3f[_0x5683b1];return _0x1e164d;};'use strict';var emlformat=require(_0xf3e3('0x0'));var rimraf=require(_0xf3e3('0x1'));var zipdir=require(_0xf3e3('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf3e3('0x3'));var moment=require(_0xf3e3('0x4'));var BPromise=require(_0xf3e3('0x5'));var Mustache=require(_0xf3e3('0x6'));var util=require(_0xf3e3('0x7'));var path=require(_0xf3e3('0x8'));var sox=require(_0xf3e3('0x9'));var csv=require(_0xf3e3('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf3e3('0xb'));var _=require(_0xf3e3('0xc'));var squel=require(_0xf3e3('0xd'));var crypto=require('crypto');var jsforce=require(_0xf3e3('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xf3e3('0xf'));var Papa=require(_0xf3e3('0x10'));var Redis=require('ioredis');var authService=require(_0xf3e3('0x11'));var qs=require(_0xf3e3('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf3e3('0x13'));var logger=require(_0xf3e3('0x14'))(_0xf3e3('0x15'));var utils=require(_0xf3e3('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xf3e3('0x17'));var db=require('../../mysqldb')['db'];config[_0xf3e3('0x18')]=_[_0xf3e3('0x19')](config[_0xf3e3('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0xf3e3('0x1a'))(new Redis(config[_0xf3e3('0x18')]));require(_0xf3e3('0x1b'))[_0xf3e3('0x1c')](socket);function respondWithStatusCode(_0x3228d7,_0x48bac2){_0x48bac2=_0x48bac2||0xcc;return function(_0x16f41b){if(_0x16f41b){return _0x3228d7[_0xf3e3('0x1d')](_0x48bac2);}return _0x3228d7[_0xf3e3('0x1e')](_0x48bac2)[_0xf3e3('0x1f')]();};}function respondWithResult(_0x5eb844,_0x1bba2f){_0x1bba2f=_0x1bba2f||0xc8;return function(_0x31331b){if(_0x31331b){return _0x5eb844[_0xf3e3('0x1e')](_0x1bba2f)[_0xf3e3('0x20')](_0x31331b);}};}function respondWithFilteredResult(_0x14f43e,_0x43ba26){return function(_0x41eca5){if(_0x41eca5){var _0x28a0a2=typeof _0x43ba26[_0xf3e3('0x21')]===_0xf3e3('0x22')&&typeof _0x43ba26['limit']==='undefined';var _0x3bb0fb=_0x41eca5[_0xf3e3('0x23')];var _0xe1ba57=_0x28a0a2?0x0:_0x43ba26['offset'];var _0x479048=_0x28a0a2?_0x41eca5[_0xf3e3('0x23')]:_0x43ba26[_0xf3e3('0x21')]+_0x43ba26[_0xf3e3('0x24')];var _0x6b1cbe;if(_0x479048>=_0x3bb0fb){_0x479048=_0x3bb0fb;_0x6b1cbe=0xc8;}else{_0x6b1cbe=0xce;}_0x14f43e[_0xf3e3('0x1e')](_0x6b1cbe);return _0x14f43e['set']('Content-Range',_0xe1ba57+'-'+_0x479048+'/'+_0x3bb0fb)[_0xf3e3('0x20')](_0x41eca5);}return null;};}function patchUpdates(_0x248374){return function(_0x385495){try{jsonpatch[_0xf3e3('0x25')](_0x385495,_0x248374,!![]);}catch(_0x544b21){return BPromise[_0xf3e3('0x26')](_0x544b21);}return _0x385495[_0xf3e3('0x27')]();};}function saveUpdates(_0x3bd01a,_0x4d6c07){return function(_0x5f492b){if(_0x5f492b){return _0x5f492b[_0xf3e3('0x28')](_0x3bd01a)[_0xf3e3('0x29')](function(_0x200a06){return _0x200a06;});}return null;};}function removeEntity(_0xecca71,_0x3210c7){return function(_0x402f94){if(_0x402f94){return _0x402f94[_0xf3e3('0x2a')]()[_0xf3e3('0x29')](function(){_0xecca71[_0xf3e3('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x56e9a9,_0x1454d5){return function(_0x3fee63){if(!_0x3fee63){_0x56e9a9[_0xf3e3('0x1d')](0x194);}return _0x3fee63;};}function handleError(_0x41ed23,_0x49e790){_0x49e790=_0x49e790||0x1f4;return function(_0x2ce083){logger['error'](_0x2ce083['stack']);if(_0x2ce083[_0xf3e3('0x2b')]){delete _0x2ce083[_0xf3e3('0x2b')];}_0x41ed23[_0xf3e3('0x1e')](_0x49e790)['send'](_0x2ce083);};}exports[_0xf3e3('0x2c')]=function(_0x140c71,_0xf2be63,_0xb803a8){if(!_0x140c71['body'][_0xf3e3('0x2d')](_0xf3e3('0x2e'))&&!_0x140c71[_0xf3e3('0x2f')][_0xf3e3('0x2d')](_0xf3e3('0x30'))){throw new db['Sequelize']['ValidationError'](_0xf3e3('0x31'));}else{if(_0x140c71[_0xf3e3('0x2f')][_0xf3e3('0x2d')]('TemplateId')&&!_0x140c71['body'][_0xf3e3('0x2d')](_0xf3e3('0x32'))){throw new db[(_0xf3e3('0x33'))][(_0xf3e3('0x34'))](_0xf3e3('0x35'));}if(!_0x140c71[_0xf3e3('0x2f')]['hasOwnProperty']('recipients')){throw new db[(_0xf3e3('0x33'))][(_0xf3e3('0x34'))](_0xf3e3('0x36'));}else{try{var _0x1f4854=JSON['parse'](_0x140c71['body'][_0xf3e3('0x37')]);}catch(_0x5edc4a){logger[_0xf3e3('0x38')](_0x5edc4a);throw new db['Sequelize'][(_0xf3e3('0x34'))]('Invalid\x20\x27recipients\x27\x20object');}var _0x5bdc67=[_0xf3e3('0x39'),_0xf3e3('0x3a'),_0xf3e3('0x3b'),_0xf3e3('0x3c'),'smsqueue',_0xf3e3('0x3d'),'whatsappqueue',_0xf3e3('0x3e'),'user'];if(_[_0xf3e3('0x3f')](_0x1f4854,function(_0x4d036a){return!_['includes'](_0x5bdc67,_0x4d036a[_0xf3e3('0x40')][_0xf3e3('0x41')]());})){throw new db['Sequelize'][(_0xf3e3('0x34'))](_0xf3e3('0x42'));}}}var _0x605247={};_0x605247['senderName']=_0x140c71[_0xf3e3('0x2f')][_0xf3e3('0x2d')]('senderName')?_0x140c71[_0xf3e3('0x2f')][_0xf3e3('0x43')]:_0x140c71[_0xf3e3('0x44')][_0xf3e3('0x45')];_0x605247[_0xf3e3('0x46')]=_['isEmpty'](_0x140c71[_0xf3e3('0x2f')][_0xf3e3('0x46')])?null:_0x140c71[_0xf3e3('0x2f')][_0xf3e3('0x46')];_0x605247[_0xf3e3('0x47')]=_0x140c71[_0xf3e3('0x2f')][_0xf3e3('0x47')]||![];_0x605247[_0xf3e3('0x48')]=_0x140c71[_0xf3e3('0x44')]['id'];return getContent(_0x140c71['body'])['then'](function(_0x5e775d){_0x605247[_0xf3e3('0x2f')]=_0x5e775d;return getRecipients(_0x1f4854);})[_0xf3e3('0x29')](function(_0x46a35c){_0x605247[_0xf3e3('0x49')]=_[_0xf3e3('0x4a')](_0x46a35c)[_0xf3e3('0x4b')](',');return db[_0xf3e3('0x4c')]['transaction'](function(_0x1bdc82){return db[_0xf3e3('0x4d')][_0xf3e3('0x4e')](_0x605247,{'raw':!![],'transaction':_0x1bdc82})['then'](function(_0x154f13){var _0x2faa72={'sender':_0x605247['senderName'],'description':_0x605247[_0xf3e3('0x46')],'content':_0x605247[_0xf3e3('0x2f')],'beep':_0x605247[_0xf3e3('0x47')]};_0x46a35c[_0xf3e3('0x4f')](function(_0x26005b){_0x2faa72[_0xf3e3('0x50')]=_0x26005b;socket[_0xf3e3('0x51')](_0xf3e3('0x52'),_0x2faa72);});return _0x154f13;});});})[_0xf3e3('0x29')](respondWithResult(_0xf2be63,0xc9))['catch'](handleError(_0xf2be63,null));};function getContent(_0x576fa6){return new BPromise(function(_0x196bdb,_0x15e255){if(_0x576fa6[_0xf3e3('0x2e')]){_0x196bdb(_0x576fa6[_0xf3e3('0x2e')]);return;}return db[_0xf3e3('0x53')][_0xf3e3('0x54')]({'attributes':[_0xf3e3('0x55')],'where':{'id':_0x576fa6[_0xf3e3('0x30')]},'raw':!![]})['then'](function(_0xf3e735){if(!_0xf3e735)throw new db[(_0xf3e3('0x33'))][(_0xf3e3('0x34'))]('Invalid\x20\x27TemplateId\x27\x20parameter');var _0x429588=Mustache['render'](_0xf3e735[_0xf3e3('0x55')],_0x576fa6[_0xf3e3('0x32')]);_0x196bdb(_0x429588);})[_0xf3e3('0x56')](function(_0x3ff166){_0x15e255(_0x3ff166);});});}function getRecipients(_0x34cd3b){return new BPromise(function(_0x442626,_0x582e0a){var _0x5f5411=[];var _0x4c03a9=[];_0x34cd3b[_0xf3e3('0x4f')](function(_0x3e0b4a){var _0x3163ec=_[_0xf3e3('0x57')](_0x3e0b4a[_0xf3e3('0x40')][_0xf3e3('0x41')]());if(_0x3163ec==='User'){_0x5f5411=_[_0xf3e3('0x58')](_0x5f5411,_0x3e0b4a['ids']);}else{if(_[_0xf3e3('0x59')](_0x3163ec,_0xf3e3('0x5a')))_0x3163ec=_0x3163ec['replace'](_0xf3e3('0x5a'),_0xf3e3('0x5b'));_0x3e0b4a[_0xf3e3('0x5c')][_0xf3e3('0x4f')](function(_0x162f7f){_0x4c03a9[_0xf3e3('0x5d')](getAgents(_0x3163ec,_0x162f7f));});}});return BPromise[_0xf3e3('0x5e')](_0x4c03a9)[_0xf3e3('0x29')](function(_0x5a2e52){_0x5f5411=_['union'](_0x5f5411,_['flatten'](_0x5a2e52));_0x442626(_0x5f5411);})[_0xf3e3('0x56')](function(_0x201284){_0x582e0a(_0x201284);});});}function getAgents(_0x135cb8,_0x597315){return new BPromise(function(_0x3ece30,_0x496846){return db[_0x135cb8][_0xf3e3('0x54')]({'where':{'id':_0x597315}})[_0xf3e3('0x29')](function(_0x3ab085){return _0x3ab085['getAgents']({'attributes':['id'],'raw':!![]})['then'](function(_0x50d594){var _0x76ceb0=_[_0xf3e3('0x5f')](_0x50d594,'id');_0x3ece30(_0x76ceb0);});})[_0xf3e3('0x56')](function(_0x49ba7e){_0x496846(_0x49ba7e);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.events.js b/server/api/userNotification/userNotification.events.js index c98dee7..b0f3e79 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 _0x8c89=['hook','events','../../mysqldb','UserNotification','setMaxListeners','save','update','emit','hasOwnProperty'];(function(_0x5fa7e4,_0x409cab){var _0x3de437=function(_0x148c57){while(--_0x148c57){_0x5fa7e4['push'](_0x5fa7e4['shift']());}};_0x3de437(++_0x409cab);}(_0x8c89,0xb5));var _0x98c8=function(_0x421530,_0x1f0c44){_0x421530=_0x421530-0x0;var _0x10641b=_0x8c89[_0x421530];return _0x10641b;};'use strict';var EventEmitter=require(_0x98c8('0x0'));var UserNotification=require(_0x98c8('0x1'))['db'][_0x98c8('0x2')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0x98c8('0x3')](0x0);var events={'afterCreate':_0x98c8('0x4'),'afterUpdate':_0x98c8('0x5'),'afterDestroy':'remove'};function emitEvent(_0x41ad72){return function(_0xe03b49,_0x1e67ba,_0xec6530){UserNotificationEvents[_0x98c8('0x6')](_0x41ad72+':'+_0xe03b49['id'],_0xe03b49);UserNotificationEvents['emit'](_0x41ad72,_0xe03b49);_0xec6530(null);};}for(var e in events){if(events[_0x98c8('0x7')](e)){var event=events[e];UserNotification[_0x98c8('0x8')](e,emitEvent(event));}}module['exports']=UserNotificationEvents; \ No newline at end of file +var _0xe7e4=['setMaxListeners','save','update','hook','events','../../mysqldb','UserNotification'];(function(_0x3e16f9,_0x27376a){var _0x3588fe=function(_0x419760){while(--_0x419760){_0x3e16f9['push'](_0x3e16f9['shift']());}};_0x3588fe(++_0x27376a);}(_0xe7e4,0x11c));var _0x4e7e=function(_0x3bf43f,_0x15a79f){_0x3bf43f=_0x3bf43f-0x0;var _0x151010=_0xe7e4[_0x3bf43f];return _0x151010;};'use strict';var EventEmitter=require(_0x4e7e('0x0'));var UserNotification=require(_0x4e7e('0x1'))['db'][_0x4e7e('0x2')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0x4e7e('0x3')](0x0);var events={'afterCreate':_0x4e7e('0x4'),'afterUpdate':_0x4e7e('0x5'),'afterDestroy':'remove'};function emitEvent(_0x566695){return function(_0x213748,_0x5562f0,_0x49bbc9){UserNotificationEvents['emit'](_0x566695+':'+_0x213748['id'],_0x213748);UserNotificationEvents['emit'](_0x566695,_0x213748);_0x49bbc9(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserNotification[_0x4e7e('0x6')](e,emitEvent(event));}}module['exports']=UserNotificationEvents; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.model.js b/server/api/userNotification/userNotification.model.js index 0a3a353..aaceaea 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 _0x381c=['../../config/logger','api','request-promise','path','rimraf','./userNotification.attributes','exports','define','UserNotification','userNotifications','utf8mb4_unicode_ci','lodash','util'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x381c,0x136));var _0xc381=function(_0x5f3091,_0x18c226){_0x5f3091=_0x5f3091-0x0;var _0xf93aba=_0x381c[_0x5f3091];return _0xf93aba;};'use strict';var _=require(_0xc381('0x0'));var util=require(_0xc381('0x1'));var logger=require(_0xc381('0x2'))(_0xc381('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xc381('0x4'));var fs=require('fs');var path=require(_0xc381('0x5'));var rimraf=require(_0xc381('0x6'));var config=require('../../config/environment');var attributes=require(_0xc381('0x7'));module[_0xc381('0x8')]=function(_0x526306,_0x2d17ee){return _0x526306[_0xc381('0x9')](_0xc381('0xa'),attributes,{'tableName':_0xc381('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xc381('0xc')});}; \ No newline at end of file +var _0x4cf8=['utf8mb4','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userNotification.attributes','exports','define','userNotifications'];(function(_0x3ab353,_0x5d5283){var _0x1e2285=function(_0x55804f){while(--_0x55804f){_0x3ab353['push'](_0x3ab353['shift']());}};_0x1e2285(++_0x5d5283);}(_0x4cf8,0x1e1));var _0x84cf=function(_0x1c6ef2,_0x8d926a){_0x1c6ef2=_0x1c6ef2-0x0;var _0x404b8c=_0x4cf8[_0x1c6ef2];return _0x404b8c;};'use strict';var _=require(_0x84cf('0x0'));var util=require(_0x84cf('0x1'));var logger=require(_0x84cf('0x2'))(_0x84cf('0x3'));var moment=require(_0x84cf('0x4'));var BPromise=require(_0x84cf('0x5'));var rp=require(_0x84cf('0x6'));var fs=require('fs');var path=require(_0x84cf('0x7'));var rimraf=require(_0x84cf('0x8'));var config=require(_0x84cf('0x9'));var attributes=require(_0x84cf('0xa'));module[_0x84cf('0xb')]=function(_0x50ade2,_0x4af3f1){return _0x50ade2[_0x84cf('0xc')]('UserNotification',attributes,{'tableName':_0x84cf('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x84cf('0xe'),'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 c176318..b87c61e 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 _0x196f=['message','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./userNotification.socket','register','request','then','info','UserNotification,\x20%s,\x20%s','request\x20sent','debug','UserNotification,\x20%s,\x20%s,\x20%s','error','code','result'];(function(_0xdac04d,_0x5a42b6){var _0x4d2012=function(_0x331a9f){while(--_0x331a9f){_0xdac04d['push'](_0xdac04d['shift']());}};_0x4d2012(++_0x5a42b6);}(_0x196f,0x76));var _0xf196=function(_0x2935d3,_0x4c007b){_0x2935d3=_0x2935d3-0x0;var _0x40ad5e=_0x196f[_0x2935d3];return _0x40ad5e;};'use strict';var _=require(_0xf196('0x0'));var util=require('util');var moment=require(_0xf196('0x1'));var BPromise=require(_0xf196('0x2'));var rs=require(_0xf196('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf196('0x4'))['db'];var utils=require(_0xf196('0x5'));var logger=require('../../config/logger')(_0xf196('0x6'));var config=require(_0xf196('0x7'));var jayson=require(_0xf196('0x8'));var client=jayson[_0xf196('0x9')][_0xf196('0xa')]({'port':0x232a});config[_0xf196('0xb')]=_[_0xf196('0xc')](config[_0xf196('0xb')],{'host':_0xf196('0xd'),'port':0x18eb});var socket=require(_0xf196('0xe'))(new Redis(config[_0xf196('0xb')]));require(_0xf196('0xf'))[_0xf196('0x10')](socket);function respondWithRpcPromise(_0x1731b2,_0xc33259,_0x56f12d){return new BPromise(function(_0x55ac5d,_0x1728a9){return client[_0xf196('0x11')](_0x1731b2,_0x56f12d)[_0xf196('0x12')](function(_0x20cfb3){logger[_0xf196('0x13')](_0xf196('0x14'),_0xc33259,_0xf196('0x15'));logger[_0xf196('0x16')](_0xf196('0x17'),_0xc33259,'request\x20sent',JSON['stringify'](_0x20cfb3));if(_0x20cfb3[_0xf196('0x18')]){if(_0x20cfb3[_0xf196('0x18')][_0xf196('0x19')]===0x1f4){logger[_0xf196('0x18')](_0xf196('0x14'),_0xc33259,_0x20cfb3['error']['message']);return _0x1728a9(_0x20cfb3[_0xf196('0x18')]['message']);}logger[_0xf196('0x18')]('UserNotification,\x20%s,\x20%s',_0xc33259,_0x20cfb3[_0xf196('0x18')]['message']);return _0x55ac5d(_0x20cfb3[_0xf196('0x18')]['message']);}else{logger['info'](_0xf196('0x14'),_0xc33259,_0xf196('0x15'));_0x55ac5d(_0x20cfb3[_0xf196('0x1a')][_0xf196('0x1b')]);}})[_0xf196('0x1c')](function(_0x559323){logger[_0xf196('0x18')](_0xf196('0x14'),_0xc33259,_0x559323);_0x1728a9(_0x559323);});});} \ No newline at end of file +var _0x0050=['../../config/environment','jayson/promise','client','http','defaults','redis','socket.io-emitter','./userNotification.socket','register','info','debug','UserNotification,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','UserNotification,\x20%s,\x20%s','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x34232c,_0x18e61d){var _0x4d4f4e=function(_0x1aeb3d){while(--_0x1aeb3d){_0x34232c['push'](_0x34232c['shift']());}};_0x4d4f4e(++_0x18e61d);}(_0x0050,0xbc));var _0x0005=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x0050[_0x167cc1];return _0x10bc4b;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x0005('0x0'));var BPromise=require(_0x0005('0x1'));var rs=require(_0x0005('0x2'));var fs=require('fs');var Redis=require(_0x0005('0x3'));var db=require(_0x0005('0x4'))['db'];var utils=require(_0x0005('0x5'));var logger=require(_0x0005('0x6'))(_0x0005('0x7'));var config=require(_0x0005('0x8'));var jayson=require(_0x0005('0x9'));var client=jayson[_0x0005('0xa')][_0x0005('0xb')]({'port':0x232a});config['redis']=_[_0x0005('0xc')](config[_0x0005('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0x0005('0xe'))(new Redis(config[_0x0005('0xd')]));require(_0x0005('0xf'))[_0x0005('0x10')](socket);function respondWithRpcPromise(_0x1dc45f,_0x4d8a12,_0x4259f1){return new BPromise(function(_0x20099f,_0x40705b){return client['request'](_0x1dc45f,_0x4259f1)['then'](function(_0x232526){logger[_0x0005('0x11')]('UserNotification,\x20%s,\x20%s',_0x4d8a12,'request\x20sent');logger[_0x0005('0x12')](_0x0005('0x13'),_0x4d8a12,_0x0005('0x14'),JSON[_0x0005('0x15')](_0x232526));if(_0x232526[_0x0005('0x16')]){if(_0x232526['error'][_0x0005('0x17')]===0x1f4){logger[_0x0005('0x16')](_0x0005('0x18'),_0x4d8a12,_0x232526[_0x0005('0x16')][_0x0005('0x19')]);return _0x40705b(_0x232526[_0x0005('0x16')]['message']);}logger[_0x0005('0x16')](_0x0005('0x18'),_0x4d8a12,_0x232526[_0x0005('0x16')][_0x0005('0x19')]);return _0x20099f(_0x232526[_0x0005('0x16')][_0x0005('0x19')]);}else{logger[_0x0005('0x11')]('UserNotification,\x20%s,\x20%s',_0x4d8a12,_0x0005('0x14'));_0x20099f(_0x232526[_0x0005('0x1a')][_0x0005('0x19')]);}})[_0x0005('0x1b')](function(_0x14a440){logger['error']('UserNotification,\x20%s,\x20%s',_0x4d8a12,_0x14a440);_0x40705b(_0x14a440);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.socket.js b/server/api/userNotification/userNotification.socket.js index 85a3749..42038a0 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 _0x3d1a=['./userNotification.events','save','remove','update','emit','removeListener','register','userNotification:'];(function(_0xa880a2,_0x2dbf9b){var _0x67ef33=function(_0x407fe3){while(--_0x407fe3){_0xa880a2['push'](_0xa880a2['shift']());}};_0x67ef33(++_0x2dbf9b);}(_0x3d1a,0xb0));var _0xa3d1=function(_0x1e2b23,_0x39f675){_0x1e2b23=_0x1e2b23-0x0;var _0x5419bd=_0x3d1a[_0x1e2b23];return _0x5419bd;};'use strict';var UserNotificationEvents=require(_0xa3d1('0x0'));var events=[_0xa3d1('0x1'),_0xa3d1('0x2'),_0xa3d1('0x3')];function createListener(_0x459d6f,_0x593f28){return function(_0x507e37){_0x593f28[_0xa3d1('0x4')](_0x459d6f,_0x507e37);};}function removeListener(_0xc651d6,_0x4526df){return function(){UserNotificationEvents[_0xa3d1('0x5')](_0xc651d6,_0x4526df);};}exports[_0xa3d1('0x6')]=function(_0x4ed394){for(var _0x3ef7f8=0x0,_0x502396=events['length'];_0x3ef7f8<_0x502396;_0x3ef7f8++){var _0x4674a9=events[_0x3ef7f8];var _0x38bf73=createListener(_0xa3d1('0x7')+_0x4674a9,_0x4ed394);UserNotificationEvents['on'](_0x4674a9,_0x38bf73);}}; \ No newline at end of file +var _0xb70e=['./userNotification.events','save','remove','emit','removeListener','register','userNotification:'];(function(_0x47e7c4,_0x742022){var _0x595192=function(_0x1e9752){while(--_0x1e9752){_0x47e7c4['push'](_0x47e7c4['shift']());}};_0x595192(++_0x742022);}(_0xb70e,0x15e));var _0xeb70=function(_0x5e7256,_0x3f4b59){_0x5e7256=_0x5e7256-0x0;var _0x16c230=_0xb70e[_0x5e7256];return _0x16c230;};'use strict';var UserNotificationEvents=require(_0xeb70('0x0'));var events=[_0xeb70('0x1'),_0xeb70('0x2'),'update'];function createListener(_0x75e9ef,_0xe6a8a6){return function(_0x4153b4){_0xe6a8a6[_0xeb70('0x3')](_0x75e9ef,_0x4153b4);};}function removeListener(_0x5161cd,_0x53f1ca){return function(){UserNotificationEvents[_0xeb70('0x4')](_0x5161cd,_0x53f1ca);};}exports[_0xeb70('0x5')]=function(_0x16b8ff){for(var _0x5069c6=0x0,_0x456871=events['length'];_0x5069c6<_0x456871;_0x5069c6++){var _0x272060=events[_0x5069c6];var _0x4623c1=createListener(_0xeb70('0x6')+_0x272060,_0x16b8ff);UserNotificationEvents['on'](_0x272060,_0x4623c1);}}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/index.js b/server/api/userOpenchannelQueue/index.js index b679a52..4b3aa7b 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 _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x14813a,_0x2e9124){var _0x3cfa96=function(_0x240f92){while(--_0x240f92){_0x14813a['push'](_0x14813a['shift']());}};_0x3cfa96(++_0x2e9124);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x4f1da5,_0x4ced17){_0x4f1da5=_0x4f1da5-0x0;var _0xe972a8=_0xcb91[_0x4f1da5];return _0xe972a8;};'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 _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x13382b,_0xb0a004){var _0x50e27a=function(_0x52158e){while(--_0x52158e){_0x13382b['push'](_0x13382b['shift']());}};_0x50e27a(++_0xb0a004);}(_0xe706,0xa3));var _0x6e70=function(_0x26b4e8,_0x1c1a98){_0x26b4e8=_0x26b4e8-0x0;var _0x448057=_0xe706[_0x26b4e8];return _0x448057;};'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 15e42e1..b75956e 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 _0x9eb5=['exports','INTEGER','sequelize'];(function(_0x4947f0,_0x138314){var _0x11ad58=function(_0x563cf1){while(--_0x563cf1){_0x4947f0['push'](_0x4947f0['shift']());}};_0x11ad58(++_0x138314);}(_0x9eb5,0xb9));var _0x59eb=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x9eb5[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0x59eb('0x0'));module[_0x59eb('0x1')]={'penalty':{'type':Sequelize[_0x59eb('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xf9d5=['exports','INTEGER'];(function(_0xa6cc5c,_0x239c99){var _0x44803d=function(_0x515b6e){while(--_0x515b6e){_0xa6cc5c['push'](_0xa6cc5c['shift']());}};_0x44803d(++_0x239c99);}(_0xf9d5,0x122));var _0x5f9d=function(_0x5f1845,_0x4910dc){_0x5f1845=_0x5f1845-0x0;var _0x5dd4d8=_0xf9d5[_0x5f1845];return _0x5dd4d8;};'use strict';var Sequelize=require('sequelize');module[_0x5f9d('0x0')]={'penalty':{'type':Sequelize[_0x5f9d('0x1')],'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 c2ff407..a18fb31 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 _0x74ec=['./userOpenchannelQueue.attributes','UserOpenchannelQueue','user_has_openchannel_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment'];(function(_0x33032e,_0x31411a){var _0x13316b=function(_0x2fb049){while(--_0x2fb049){_0x33032e['push'](_0x33032e['shift']());}};_0x13316b(++_0x31411a);}(_0x74ec,0x1bb));var _0xc74e=function(_0x44a402,_0x3444b6){_0x44a402=_0x44a402-0x0;var _0x5f16de=_0x74ec[_0x44a402];return _0x5f16de;};'use strict';var _=require(_0xc74e('0x0'));var util=require(_0xc74e('0x1'));var logger=require(_0xc74e('0x2'))(_0xc74e('0x3'));var moment=require(_0xc74e('0x4'));var BPromise=require(_0xc74e('0x5'));var rp=require(_0xc74e('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xc74e('0x7'));var attributes=require(_0xc74e('0x8'));module['exports']=function(_0x110297,_0xd90429){return _0x110297['define'](_0xc74e('0x9'),attributes,{'tableName':_0xc74e('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x94e7=['../../config/environment','./userOpenchannelQueue.attributes','exports','UserOpenchannelQueue','user_has_openchannel_queues','lodash','util','bluebird','rimraf'];(function(_0x313c96,_0x3cee6e){var _0x522f53=function(_0x8961e){while(--_0x8961e){_0x313c96['push'](_0x313c96['shift']());}};_0x522f53(++_0x3cee6e);}(_0x94e7,0x191));var _0x794e=function(_0x3c0d15,_0x112669){_0x3c0d15=_0x3c0d15-0x0;var _0x4244df=_0x94e7[_0x3c0d15];return _0x4244df;};'use strict';var _=require(_0x794e('0x0'));var util=require(_0x794e('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x794e('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x794e('0x3'));var config=require(_0x794e('0x4'));var attributes=require(_0x794e('0x5'));module[_0x794e('0x6')]=function(_0x4d1910,_0xa454cd){return _0x4d1910['define'](_0x794e('0x7'),attributes,{'tableName':_0x794e('0x8'),'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 c7cec55..2d46498 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 _0x8dd2=['randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','UserOpenchannelQueue,\x20%s,\x20%s','request\x20sent','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','bluebird'];(function(_0x56c70f,_0x4e4493){var _0x3812ed=function(_0x25460f){while(--_0x25460f){_0x56c70f['push'](_0x56c70f['shift']());}};_0x3812ed(++_0x4e4493);}(_0x8dd2,0x16d));var _0x28dd=function(_0x3c23ed,_0x3de49c){_0x3c23ed=_0x3c23ed-0x0;var _0x112ed9=_0x8dd2[_0x3c23ed];return _0x112ed9;};'use strict';var _=require(_0x28dd('0x0'));var util=require(_0x28dd('0x1'));var moment=require('moment');var BPromise=require(_0x28dd('0x2'));var rs=require(_0x28dd('0x3'));var fs=require('fs');var Redis=require(_0x28dd('0x4'));var db=require(_0x28dd('0x5'))['db'];var utils=require(_0x28dd('0x6'));var logger=require('../../config/logger')(_0x28dd('0x7'));var config=require(_0x28dd('0x8'));var jayson=require(_0x28dd('0x9'));var client=jayson[_0x28dd('0xa')][_0x28dd('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1242fb,_0x40475e,_0x1eed09){return new BPromise(function(_0x5549ab,_0x49ff2){return client[_0x28dd('0xc')](_0x1242fb,_0x1eed09)[_0x28dd('0xd')](function(_0x47324a){logger[_0x28dd('0xe')](_0x28dd('0xf'),_0x40475e,_0x28dd('0x10'));logger['debug'](_0x28dd('0x11'),_0x40475e,_0x28dd('0x10'),JSON[_0x28dd('0x12')](_0x47324a));if(_0x47324a[_0x28dd('0x13')]){if(_0x47324a[_0x28dd('0x13')][_0x28dd('0x14')]===0x1f4){logger[_0x28dd('0x13')](_0x28dd('0xf'),_0x40475e,_0x47324a[_0x28dd('0x13')][_0x28dd('0x15')]);return _0x49ff2(_0x47324a[_0x28dd('0x13')][_0x28dd('0x15')]);}logger[_0x28dd('0x13')](_0x28dd('0xf'),_0x40475e,_0x47324a[_0x28dd('0x13')]['message']);return _0x5549ab(_0x47324a[_0x28dd('0x13')][_0x28dd('0x15')]);}else{logger[_0x28dd('0xe')](_0x28dd('0xf'),_0x40475e,_0x28dd('0x10'));_0x5549ab(_0x47324a[_0x28dd('0x16')][_0x28dd('0x15')]);}})['catch'](function(_0x6d76d5){logger[_0x28dd('0x13')](_0x28dd('0xf'),_0x40475e,_0x6d76d5);_0x49ff2(_0x6d76d5);});});} \ No newline at end of file +var _0x9a03=['debug','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','moment','randomstring','ioredis','../../config/utils','../../config/environment','jayson/promise','client','request','info','UserOpenchannelQueue,\x20%s,\x20%s','request\x20sent'];(function(_0x503e22,_0x15763e){var _0x527a8d=function(_0x23b64c){while(--_0x23b64c){_0x503e22['push'](_0x503e22['shift']());}};_0x527a8d(++_0x15763e);}(_0x9a03,0x1c9));var _0x39a0=function(_0x628eee,_0x3f3fba){_0x628eee=_0x628eee-0x0;var _0x447718=_0x9a03[_0x628eee];return _0x447718;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x39a0('0x0'));var BPromise=require('bluebird');var rs=require(_0x39a0('0x1'));var fs=require('fs');var Redis=require(_0x39a0('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x39a0('0x3'));var logger=require('../../config/logger')('rpc');var config=require(_0x39a0('0x4'));var jayson=require(_0x39a0('0x5'));var client=jayson[_0x39a0('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3a1a5b,_0x1371c5,_0x34c498){return new BPromise(function(_0x51688d,_0x2e1303){return client[_0x39a0('0x7')](_0x3a1a5b,_0x34c498)['then'](function(_0x47eb3b){logger[_0x39a0('0x8')](_0x39a0('0x9'),_0x1371c5,_0x39a0('0xa'));logger[_0x39a0('0xb')](_0x39a0('0xc'),_0x1371c5,_0x39a0('0xa'),JSON[_0x39a0('0xd')](_0x47eb3b));if(_0x47eb3b['error']){if(_0x47eb3b['error']['code']===0x1f4){logger[_0x39a0('0xe')](_0x39a0('0x9'),_0x1371c5,_0x47eb3b[_0x39a0('0xe')][_0x39a0('0xf')]);return _0x2e1303(_0x47eb3b[_0x39a0('0xe')][_0x39a0('0xf')]);}logger[_0x39a0('0xe')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x1371c5,_0x47eb3b[_0x39a0('0xe')][_0x39a0('0xf')]);return _0x51688d(_0x47eb3b[_0x39a0('0xe')][_0x39a0('0xf')]);}else{logger[_0x39a0('0x8')](_0x39a0('0x9'),_0x1371c5,'request\x20sent');_0x51688d(_0x47eb3b[_0x39a0('0x10')][_0x39a0('0xf')]);}})[_0x39a0('0x11')](function(_0x534049){logger[_0x39a0('0xe')](_0x39a0('0x9'),_0x1371c5,_0x534049);_0x2e1303(_0x534049);});});} \ No newline at end of file diff --git a/server/api/userProfile/index.js b/server/api/userProfile/index.js index efbfd43..b86414e 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 _0xe2fb=['put','update','destroy','delete','removeSections','removeResources','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./userProfile.controller','get','isAuthenticated','index','/describe','describe','/:id','/:id/sections','getSections','/:id/resources','getResources','post','create','/:id/clone','clone'];(function(_0x212c3e,_0x3063f5){var _0x517214=function(_0x22ce77){while(--_0x22ce77){_0x212c3e['push'](_0x212c3e['shift']());}};_0x517214(++_0x3063f5);}(_0xe2fb,0xd1));var _0xbe2f=function(_0x39a16e,_0x1060d0){_0x39a16e=_0x39a16e-0x0;var _0xe4005d=_0xe2fb[_0x39a16e];return _0xe4005d;};'use strict';var multer=require(_0xbe2f('0x0'));var util=require(_0xbe2f('0x1'));var path=require(_0xbe2f('0x2'));var timeout=require(_0xbe2f('0x3'));var express=require(_0xbe2f('0x4'));var router=express[_0xbe2f('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xbe2f('0x6'));var config=require(_0xbe2f('0x7'));var controller=require(_0xbe2f('0x8'));router[_0xbe2f('0x9')]('/',auth[_0xbe2f('0xa')](),controller[_0xbe2f('0xb')]);router[_0xbe2f('0x9')](_0xbe2f('0xc'),auth[_0xbe2f('0xa')](),controller[_0xbe2f('0xd')]);router[_0xbe2f('0x9')](_0xbe2f('0xe'),auth['isAuthenticated'](),controller['show']);router[_0xbe2f('0x9')](_0xbe2f('0xf'),auth['isAuthenticated'](),controller[_0xbe2f('0x10')]);router['get'](_0xbe2f('0x11'),auth[_0xbe2f('0xa')](),controller[_0xbe2f('0x12')]);router[_0xbe2f('0x13')]('/',auth[_0xbe2f('0xa')](),controller[_0xbe2f('0x14')]);router[_0xbe2f('0x13')](_0xbe2f('0x15'),auth[_0xbe2f('0xa')](),controller[_0xbe2f('0x16')]);router['post']('/:id/sections',auth['isAuthenticated'](),controller['addSections']);router[_0xbe2f('0x13')]('/:id/resources',auth[_0xbe2f('0xa')](),controller['addResources']);router[_0xbe2f('0x17')](_0xbe2f('0xe'),auth[_0xbe2f('0xa')](),controller[_0xbe2f('0x18')]);router['delete'](_0xbe2f('0xe'),auth[_0xbe2f('0xa')](),controller[_0xbe2f('0x19')]);router[_0xbe2f('0x1a')](_0xbe2f('0xf'),auth[_0xbe2f('0xa')](),controller[_0xbe2f('0x1b')]);router['delete']('/:id/resources',auth[_0xbe2f('0xa')](),controller[_0xbe2f('0x1c')]);module['exports']=router; \ No newline at end of file +var _0x0685=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfile.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/sections','getSections','/:id/resources','getResources','create','post','/:id/clone','clone','addResources','put','update','destroy','delete','removeSections','removeResources','multer','util','path'];(function(_0x253364,_0x1bd7f6){var _0x23d984=function(_0x2fdeaa){while(--_0x2fdeaa){_0x253364['push'](_0x253364['shift']());}};_0x23d984(++_0x1bd7f6);}(_0x0685,0xe4));var _0x5068=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x0685[_0x59ee6f];return _0x4c0979;};'use strict';var multer=require(_0x5068('0x0'));var util=require(_0x5068('0x1'));var path=require(_0x5068('0x2'));var timeout=require(_0x5068('0x3'));var express=require(_0x5068('0x4'));var router=express[_0x5068('0x5')]();var fs_extra=require(_0x5068('0x6'));var auth=require(_0x5068('0x7'));var interaction=require(_0x5068('0x8'));var config=require(_0x5068('0x9'));var controller=require(_0x5068('0xa'));router[_0x5068('0xb')]('/',auth[_0x5068('0xc')](),controller[_0x5068('0xd')]);router[_0x5068('0xb')](_0x5068('0xe'),auth[_0x5068('0xc')](),controller[_0x5068('0xf')]);router[_0x5068('0xb')](_0x5068('0x10'),auth[_0x5068('0xc')](),controller[_0x5068('0x11')]);router['get'](_0x5068('0x12'),auth['isAuthenticated'](),controller[_0x5068('0x13')]);router[_0x5068('0xb')](_0x5068('0x14'),auth['isAuthenticated'](),controller[_0x5068('0x15')]);router['post']('/',auth[_0x5068('0xc')](),controller[_0x5068('0x16')]);router[_0x5068('0x17')](_0x5068('0x18'),auth[_0x5068('0xc')](),controller[_0x5068('0x19')]);router['post'](_0x5068('0x12'),auth[_0x5068('0xc')](),controller['addSections']);router['post'](_0x5068('0x14'),auth['isAuthenticated'](),controller[_0x5068('0x1a')]);router[_0x5068('0x1b')](_0x5068('0x10'),auth[_0x5068('0xc')](),controller[_0x5068('0x1c')]);router['delete'](_0x5068('0x10'),auth[_0x5068('0xc')](),controller[_0x5068('0x1d')]);router[_0x5068('0x1e')](_0x5068('0x12'),auth[_0x5068('0xc')](),controller[_0x5068('0x1f')]);router[_0x5068('0x1e')](_0x5068('0x14'),auth[_0x5068('0xc')](),controller[_0x5068('0x20')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.attributes.js b/server/api/userProfile/userProfile.attributes.js index 01ed4ed..fb83464 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 _0xfc3e=['crudPermissions','getDataValue','split','BOOLEAN','sequelize','exports','STRING','name','setDataValue'];(function(_0x101286,_0x2bc45e){var _0x201a53=function(_0x53d1cb){while(--_0x53d1cb){_0x101286['push'](_0x101286['shift']());}};_0x201a53(++_0x2bc45e);}(_0xfc3e,0x124));var _0xefc3=function(_0x582942,_0xcb8901){_0x582942=_0x582942-0x0;var _0x3e33c1=_0xfc3e[_0x582942];return _0x3e33c1;};'use strict';var Sequelize=require(_0xefc3('0x0'));module[_0xefc3('0x1')]={'name':{'type':Sequelize[_0xefc3('0x2')],'allowNull':![],'unique':_0xefc3('0x3')},'crudPermissions':{'type':Sequelize[_0xefc3('0x2')],'set':function(_0x54f37b){this[_0xefc3('0x4')](_0xefc3('0x5'),_0x54f37b?_0x54f37b['join'](''):[]);},'get':function(){return this[_0xefc3('0x6')](_0xefc3('0x5'))?this[_0xefc3('0x6')](_0xefc3('0x5'))[_0xefc3('0x7')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0xefc3('0x2')],'allowNull':!![]},'privacyEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'downloadAttachments':{'type':Sequelize[_0xefc3('0x8')],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0xefc3('0x8')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize[_0xefc3('0x8')],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0xefc3('0x8')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize[_0xefc3('0x8')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0xefc3('0x8')],'defaultValue':!![]}}; \ No newline at end of file +var _0x37df=['STRING','name','crudPermissions','join','getDataValue','split','BOOLEAN','exports'];(function(_0x32af34,_0x5de6e0){var _0x3ecd7e=function(_0x114134){while(--_0x114134){_0x32af34['push'](_0x32af34['shift']());}};_0x3ecd7e(++_0x5de6e0);}(_0x37df,0x157));var _0xf37d=function(_0x5f12fd,_0x33c70d){_0x5f12fd=_0x5f12fd-0x0;var _0x58bd80=_0x37df[_0x5f12fd];return _0x58bd80;};'use strict';var Sequelize=require('sequelize');module[_0xf37d('0x0')]={'name':{'type':Sequelize[_0xf37d('0x1')],'allowNull':![],'unique':_0xf37d('0x2')},'crudPermissions':{'type':Sequelize['STRING'],'set':function(_0x4cae64){this['setDataValue'](_0xf37d('0x3'),_0x4cae64?_0x4cae64[_0xf37d('0x4')](''):[]);},'get':function(){return this[_0xf37d('0x5')]('crudPermissions')?this['getDataValue']('crudPermissions')[_0xf37d('0x6')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0xf37d('0x1')],'allowNull':!![]},'privacyEnabled':{'type':Sequelize[_0xf37d('0x7')],'defaultValue':![]},'downloadAttachments':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0xf37d('0x7')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize[_0xf37d('0x7')],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0xf37d('0x7')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0xf37d('0x7')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize[_0xf37d('0x7')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0xf37d('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 4f29bd4..d582670 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 _0x5f35=['forEach','resourceId','Plugin','addResources','bulkCreate','removeResources','getResources','section','No\x20User\x20Profile\x20found\x20for\x20id\x20','rimraf','zip-dir','fast-json-patch','moment','bluebird','path','sox','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./userProfile.socket','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','error','stack','name','send','UserProfile','rawAttributes','fieldName','key','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','VIRTUAL','merge','options','include','findAll','rows','catch','show','includeAll','find','create','body','clone','get','omit','createdAt','updatedAt','crudPermissions','sequelize','params','each','autoAssociation','UserProfileResource','sectionId','userProfileId','Resources','destroy','describe','addSections','transaction','UserProfileSection','push','ids','enabled','isEmpty','includes','subsections','concat','Dashboard'];(function(_0x406362,_0x58d77c){var _0x31f3f4=function(_0x217011){while(--_0x217011){_0x406362['push'](_0x406362['shift']());}};_0x31f3f4(++_0x58d77c);}(_0x5f35,0x15c));var _0x55f3=function(_0x389832,_0x10a4a9){_0x389832=_0x389832-0x0;var _0x59429e=_0x5f35[_0x389832];return _0x59429e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x55f3('0x0'));var zipdir=require(_0x55f3('0x1'));var jsonpatch=require(_0x55f3('0x2'));var rp=require('request-promise');var moment=require(_0x55f3('0x3'));var BPromise=require(_0x55f3('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x55f3('0x5'));var sox=require(_0x55f3('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x55f3('0x7'));var _=require(_0x55f3('0x8'));var squel=require(_0x55f3('0x9'));var crypto=require(_0x55f3('0xa'));var jsforce=require(_0x55f3('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x55f3('0xc'));var querystring=require(_0x55f3('0xd'));var Papa=require(_0x55f3('0xe'));var Redis=require(_0x55f3('0xf'));var authService=require(_0x55f3('0x10'));var qs=require(_0x55f3('0x11'));var as=require(_0x55f3('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x55f3('0x13'));var config=require(_0x55f3('0x14'));var licenseUtil=require(_0x55f3('0x15'));var db=require(_0x55f3('0x16'))['db'];config[_0x55f3('0x17')]=_[_0x55f3('0x18')](config[_0x55f3('0x17')],{'host':_0x55f3('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x55f3('0x1a'))['register'](socket);function respondWithStatusCode(_0x1ee8a2,_0x578fc3){_0x578fc3=_0x578fc3||0xcc;return function(_0x1d8c86){if(_0x1d8c86){return _0x1ee8a2[_0x55f3('0x1b')](_0x578fc3);}return _0x1ee8a2[_0x55f3('0x1c')](_0x578fc3)[_0x55f3('0x1d')]();};}function respondWithResult(_0x5a05dd,_0x26d137){_0x26d137=_0x26d137||0xc8;return function(_0x405f75){if(_0x405f75){return _0x5a05dd[_0x55f3('0x1c')](_0x26d137)[_0x55f3('0x1e')](_0x405f75);}};}function respondWithFilteredResult(_0x44776c,_0x1689ea){return function(_0xd61460){if(_0xd61460){var _0x511fe6=typeof _0x1689ea[_0x55f3('0x1f')]===_0x55f3('0x20')&&typeof _0x1689ea[_0x55f3('0x21')]===_0x55f3('0x20');var _0x15f97a=_0xd61460[_0x55f3('0x22')];var _0xc55f33=_0x511fe6?0x0:_0x1689ea['offset'];var _0x8e0a86=_0x511fe6?_0xd61460['count']:_0x1689ea[_0x55f3('0x1f')]+_0x1689ea[_0x55f3('0x21')];var _0x5caa60;if(_0x8e0a86>=_0x15f97a){_0x8e0a86=_0x15f97a;_0x5caa60=0xc8;}else{_0x5caa60=0xce;}_0x44776c[_0x55f3('0x1c')](_0x5caa60);return _0x44776c[_0x55f3('0x23')](_0x55f3('0x24'),_0xc55f33+'-'+_0x8e0a86+'/'+_0x15f97a)[_0x55f3('0x1e')](_0xd61460);}return null;};}function patchUpdates(_0x6ada1b){return function(_0x314e69){try{jsonpatch[_0x55f3('0x25')](_0x314e69,_0x6ada1b,!![]);}catch(_0x25b5fa){return BPromise['reject'](_0x25b5fa);}return _0x314e69[_0x55f3('0x26')]();};}function saveUpdates(_0x4f8533,_0x2cda9e){return function(_0x329986){if(_0x329986){return _0x329986[_0x55f3('0x27')](_0x4f8533)[_0x55f3('0x28')](function(_0x5830e9){return _0x5830e9;});}return null;};}function removeEntity(_0x742651,_0x2e0da8){return function(_0x5ada99){if(_0x5ada99){return _0x5ada99['destroy']()['then'](function(){_0x742651['status'](0xcc)[_0x55f3('0x1d')]();});}};}function handleEntityNotFound(_0x3f998b,_0x3aef11){return function(_0x2330f3){if(!_0x2330f3){_0x3f998b[_0x55f3('0x1b')](0x194);}return _0x2330f3;};}function handleError(_0x56cb1f,_0x4dda57){_0x4dda57=_0x4dda57||0x1f4;return function(_0x46fefc){logger[_0x55f3('0x29')](_0x46fefc[_0x55f3('0x2a')]);if(_0x46fefc[_0x55f3('0x2b')]){delete _0x46fefc[_0x55f3('0x2b')];}_0x56cb1f[_0x55f3('0x1c')](_0x4dda57)[_0x55f3('0x2c')](_0x46fefc);};}exports['index']=function(_0x3ae759,_0x254656){var _0x2be706={},_0xce6e0b={},_0x379a1d={'count':0x0,'rows':[]};var _0x50ff4a=_['map'](db[_0x55f3('0x2d')][_0x55f3('0x2e')],function(_0x22d1c9){return{'name':_0x22d1c9[_0x55f3('0x2f')],'type':_0x22d1c9['type'][_0x55f3('0x30')]};});_0xce6e0b[_0x55f3('0x31')]=_[_0x55f3('0x32')](_0x50ff4a,_0x55f3('0x2b'));_0xce6e0b[_0x55f3('0x33')]=_[_0x55f3('0x34')](_0x3ae759[_0x55f3('0x33')]);_0xce6e0b['filters']=_[_0x55f3('0x35')](_0xce6e0b[_0x55f3('0x31')],_0xce6e0b['query']);_0x2be706[_0x55f3('0x36')]=_[_0x55f3('0x35')](_0xce6e0b['model'],qs[_0x55f3('0x37')](_0x3ae759['query']['fields']));_0x2be706[_0x55f3('0x36')]=_0x2be706[_0x55f3('0x36')][_0x55f3('0x38')]?_0x2be706['attributes']:_0xce6e0b[_0x55f3('0x31')];if(!_0x3ae759[_0x55f3('0x33')][_0x55f3('0x39')](_0x55f3('0x3a'))){_0x2be706['limit']=qs[_0x55f3('0x21')](_0x3ae759[_0x55f3('0x33')][_0x55f3('0x21')]);_0x2be706[_0x55f3('0x1f')]=qs[_0x55f3('0x1f')](_0x3ae759[_0x55f3('0x33')][_0x55f3('0x1f')]);}_0x2be706[_0x55f3('0x3b')]=qs['sort'](_0x3ae759[_0x55f3('0x33')][_0x55f3('0x3c')]);_0x2be706[_0x55f3('0x3d')]=qs['filters'](_[_0x55f3('0x3e')](_0x3ae759[_0x55f3('0x33')],_0xce6e0b[_0x55f3('0x3f')]),_0x50ff4a);if(_0x3ae759[_0x55f3('0x33')][_0x55f3('0x40')]){_0x2be706[_0x55f3('0x3d')]=_['merge'](_0x2be706[_0x55f3('0x3d')],{'$or':_['map'](_0x50ff4a,function(_0x4b1c4f){if(_0x4b1c4f['type']!==_0x55f3('0x41')){var _0xb538cc={};_0xb538cc[_0x4b1c4f[_0x55f3('0x2b')]]={'$like':'%'+_0x3ae759[_0x55f3('0x33')][_0x55f3('0x40')]+'%'};return _0xb538cc;}})});}_0x2be706=_[_0x55f3('0x42')]({},_0x2be706,_0x3ae759[_0x55f3('0x43')]);var _0x1e3921={'where':_0x2be706['where']};return db['UserProfile'][_0x55f3('0x22')](_0x1e3921)['then'](function(_0x461b06){_0x379a1d[_0x55f3('0x22')]=_0x461b06;if(_0x3ae759[_0x55f3('0x33')]['includeAll']){_0x2be706[_0x55f3('0x44')]=[{'all':!![]}];}return db[_0x55f3('0x2d')][_0x55f3('0x45')](_0x2be706);})[_0x55f3('0x28')](function(_0x46a232){_0x379a1d[_0x55f3('0x46')]=_0x46a232;return _0x379a1d;})['then'](respondWithFilteredResult(_0x254656,_0x2be706))[_0x55f3('0x47')](handleError(_0x254656,null));};exports[_0x55f3('0x48')]=function(_0x2ec9f9,_0x5a8cbd){var _0x4a38e7={'raw':![],'where':{'id':_0x2ec9f9['params']['id']}},_0x26dfb6={};_0x26dfb6[_0x55f3('0x31')]=_[_0x55f3('0x34')](db[_0x55f3('0x2d')][_0x55f3('0x2e')]);_0x26dfb6['query']=_[_0x55f3('0x34')](_0x2ec9f9[_0x55f3('0x33')]);_0x26dfb6[_0x55f3('0x3f')]=_[_0x55f3('0x35')](_0x26dfb6[_0x55f3('0x31')],_0x26dfb6[_0x55f3('0x33')]);_0x4a38e7[_0x55f3('0x36')]=_['intersection'](_0x26dfb6[_0x55f3('0x31')],qs['fields'](_0x2ec9f9['query'][_0x55f3('0x37')]));_0x4a38e7[_0x55f3('0x36')]=_0x4a38e7[_0x55f3('0x36')]['length']?_0x4a38e7[_0x55f3('0x36')]:_0x26dfb6[_0x55f3('0x31')];if(_0x2ec9f9[_0x55f3('0x33')][_0x55f3('0x49')]){_0x4a38e7[_0x55f3('0x44')]=[{'all':!![]}];}_0x4a38e7=_[_0x55f3('0x42')]({},_0x4a38e7,_0x2ec9f9[_0x55f3('0x43')]);return db[_0x55f3('0x2d')][_0x55f3('0x4a')](_0x4a38e7)['then'](handleEntityNotFound(_0x5a8cbd,null))['then'](respondWithResult(_0x5a8cbd,null))[_0x55f3('0x47')](handleError(_0x5a8cbd,null));};exports[_0x55f3('0x4b')]=function(_0xa5272a,_0x20237e){return db[_0x55f3('0x2d')][_0x55f3('0x4b')](_0xa5272a[_0x55f3('0x4c')],{})[_0x55f3('0x28')](respondWithResult(_0x20237e,0xc9))[_0x55f3('0x47')](handleError(_0x20237e,null));};exports[_0x55f3('0x4d')]=function(_0x645f8d,_0x1ec5ec){var _0x15fa0f={'where':{'id':_0x645f8d['params']['id']}},_0x58eb37={};_0x58eb37[_0x55f3('0x31')]=_[_0x55f3('0x34')](db[_0x55f3('0x2d')]['rawAttributes']);_0x15fa0f[_0x55f3('0x36')]=_[_0x55f3('0x35')](_0x58eb37[_0x55f3('0x31')],qs[_0x55f3('0x37')](_0x645f8d[_0x55f3('0x33')]['fields']));_0x15fa0f[_0x55f3('0x36')]=_0x15fa0f[_0x55f3('0x36')][_0x55f3('0x38')]?_0x15fa0f['attributes']:_0x58eb37[_0x55f3('0x31')];if(_0x645f8d[_0x55f3('0x33')][_0x55f3('0x49')]){_0x15fa0f['include']=[{'all':!![]}];}_0x15fa0f=_[_0x55f3('0x42')]({},_0x15fa0f,_0x645f8d['options']);return db[_0x55f3('0x2d')][_0x55f3('0x4a')](_0x15fa0f)[_0x55f3('0x28')](handleEntityNotFound(_0x1ec5ec,null))[_0x55f3('0x28')](function(_0xd2947e){if(_0xd2947e){var _0x20642d=_0xd2947e[_0x55f3('0x4e')]({'plain':!![]});_0x20642d=qs[_0x55f3('0x4f')](_0x20642d,['id',_0x55f3('0x50'),_0x55f3('0x51'),_0x55f3('0x52')]);_0x645f8d[_0x55f3('0x4c')]=_['omit'](_0x645f8d[_0x55f3('0x4c')],['id',_0x55f3('0x50'),_0x55f3('0x51')]);return db[_0x55f3('0x53')]['transaction'](function(_0x6d1983){return db[_0x55f3('0x2d')][_0x55f3('0x4b')](_[_0x55f3('0x42')](_0x20642d,_0x645f8d[_0x55f3('0x4c')]),{'include':_0x645f8d[_0x55f3('0x33')][_0x55f3('0x49')]?[{'all':!![]}]:undefined,'transaction':_0x6d1983})['then'](function(_0x2cdda9){var _0x319cd8=_0x2cdda9[_0x55f3('0x4e')]({'plain':!![]});return db['UserProfileSection']['findAll']({'where':{'userProfileId':_0x645f8d[_0x55f3('0x54')]['id']},'raw':!![]})[_0x55f3('0x28')](function(_0x514da7){if(_0x514da7){return BPromise[_0x55f3('0x55')](_0x514da7,function(_0x29e9a3){return new BPromise(function(_0x355656,_0x4de302){if(_0x29e9a3[_0x55f3('0x56')]===null||_0x29e9a3['autoAssociation']===0x1)_0x355656(null);return db[_0x55f3('0x57')][_0x55f3('0x45')]({'where':{'sectionId':_0x29e9a3['id']},'raw':!![]})[_0x55f3('0x28')](function(_0x4cb4ee){var _0x115a14=_['map'](_0x4cb4ee,function(_0x466c1f){return qs[_0x55f3('0x4f')](_0x466c1f,['id',_0x55f3('0x50'),'updatedAt',_0x55f3('0x58')]);});_0x355656(_0x115a14);})[_0x55f3('0x47')](function(_0x336684){_0x4de302(_0x336684);});})[_0x55f3('0x28')](function(_0x11c5c0){var _0x32218d=qs['omit'](_0x29e9a3,['id',_0x55f3('0x50'),_0x55f3('0x51')]);_0x32218d[_0x55f3('0x59')]=_0x319cd8['id'];if(_0x11c5c0)_0x32218d[_0x55f3('0x5a')]=_0x11c5c0;return _0x32218d;})['then'](function(_0x2231a7){return db['UserProfileSection'][_0x55f3('0x4b')](_0x2231a7,{'include':[{'model':db[_0x55f3('0x57')],'as':'Resources'}],'raw':!![],'transaction':_0x6d1983});});})['then'](function(){return _0x319cd8;});}});});});}})['then'](respondWithResult(_0x1ec5ec,0xc9))[_0x55f3('0x47')](handleError(_0x1ec5ec,null));};exports[_0x55f3('0x27')]=function(_0x17fcf7,_0x471424){if(_0x17fcf7[_0x55f3('0x4c')]['id']){delete _0x17fcf7['body']['id'];}return db[_0x55f3('0x2d')][_0x55f3('0x4a')]({'where':{'id':_0x17fcf7[_0x55f3('0x54')]['id']}})[_0x55f3('0x28')](handleEntityNotFound(_0x471424,null))[_0x55f3('0x28')](saveUpdates(_0x17fcf7['body'],null))[_0x55f3('0x28')](respondWithResult(_0x471424,null))[_0x55f3('0x47')](handleError(_0x471424,null));};exports[_0x55f3('0x5b')]=function(_0x15c3a6,_0x527e42){return db[_0x55f3('0x2d')]['find']({'where':{'id':_0x15c3a6['params']['id']}})[_0x55f3('0x28')](handleEntityNotFound(_0x527e42,null))['then'](removeEntity(_0x527e42,null))['catch'](handleError(_0x527e42,null));};exports[_0x55f3('0x5c')]=function(_0x413678,_0x1354ab){return db[_0x55f3('0x2d')][_0x55f3('0x5c')]()[_0x55f3('0x28')](respondWithResult(_0x1354ab,null))['catch'](handleError(_0x1354ab,null));};exports[_0x55f3('0x5d')]=function(_0x15e644,_0x178642){var _0x49828d=_0x15e644['body'];return db[_0x55f3('0x2d')]['find']({'where':{'id':_0x15e644[_0x55f3('0x54')]['id']}})[_0x55f3('0x28')](handleEntityNotFound(_0x178642,null))[_0x55f3('0x28')](function(_0x193943){if(_0x193943){return db[_0x55f3('0x53')][_0x55f3('0x5e')](function(_0x492dd9){return db['UserProfileSection'][_0x55f3('0x5b')]({'where':{'userProfileId':_0x15e644[_0x55f3('0x54')]['id'],'sectionId':_[_0x55f3('0x32')](_0x49828d,function(_0x3057f7){return _0x3057f7[_0x55f3('0x58')];})},'transaction':_0x492dd9})[_0x55f3('0x28')](function(){var _0xd6b7c8=_[_0x55f3('0x32')](_0x49828d,function(_0x1a6648){_0x1a6648['userProfileId']=_0x15e644[_0x55f3('0x54')]['id'];return _0x1a6648;});var _0x375741=[];return BPromise['each'](_0xd6b7c8,function(_0x3eda2e){return db[_0x55f3('0x5f')][_0x55f3('0x4b')](_0x3eda2e,{'include':[{'model':db[_0x55f3('0x57')],'as':'Resources'}],'raw':!![],'transaction':_0x492dd9})['then'](function(_0x82c221){_0x375741[_0x55f3('0x60')](_0x82c221[_0x55f3('0x4e')]({'plain':!![]}));});})[_0x55f3('0x28')](function(){return _0x375741;});});});}})[_0x55f3('0x28')](function(_0x1862e6){return _0x1862e6;})['then'](respondWithResult(_0x178642,null))[_0x55f3('0x47')](handleError(_0x178642,null));};exports['removeSections']=function(_0x5be8f5,_0x50d5d9){var _0x3f43bd;return db['UserProfile'][_0x55f3('0x4a')]({'where':{'id':_0x5be8f5[_0x55f3('0x54')]['id']},'attributes':['id','name']})['then'](handleEntityNotFound(_0x50d5d9,null))[_0x55f3('0x28')](function(_0x1e6864){if(_0x1e6864){_0x3f43bd=_0x1e6864;return db[_0x55f3('0x5f')][_0x55f3('0x5b')]({'where':{'userProfileId':_0x5be8f5[_0x55f3('0x54')]['id'],'sectionId':_0x5be8f5['query'][_0x55f3('0x61')]}});}})[_0x55f3('0x28')](function(){return _0x3f43bd;})['then'](respondWithStatusCode(_0x50d5d9,null))[_0x55f3('0x47')](handleError(_0x50d5d9,null));};exports['getSections']=function(_0x331f48,_0x41639f){var _0x3d4d5f=[];var _0x2259ee=[];return db['UserProfileSection'][_0x55f3('0x45')]({'where':{'userProfileId':_0x331f48['params']['id']},'raw':!![]})[_0x55f3('0x28')](function(_0x4c32a9){_0x3d4d5f=_[_0x55f3('0x40')](_0x4c32a9,function(_0x53042d){return _0x53042d[_0x55f3('0x62')]===0x1||_['includes']([0x3eb,0x709],_0x53042d[_0x55f3('0x58')]);});if(!_[_0x55f3('0x63')](_0x3d4d5f)){return _['map'](_0x3d4d5f,function(_0x224e3a){return _0x224e3a['sectionId'];});}else{return;}})[_0x55f3('0x28')](function(_0x58f435){if(_0x58f435)_0x2259ee=_0x58f435;if(_['includes'](_0x2259ee,0x64)){var _0x366380=_[_0x55f3('0x4a')](_0x3d4d5f,{'sectionId':0x64});return hasDefaultDashboard(_0x366380)[_0x55f3('0x28')](function(_0x4a1a7d){return _['map'](_0x3d4d5f,function(_0x3b88c3){if(_0x3b88c3[_0x55f3('0x58')]===0x64){_0x3b88c3['subsections']=_0x4a1a7d;}return _0x3b88c3;});});}else{return;}})[_0x55f3('0x28')](function(_0x3c40f1){if(_0x3c40f1)_0x3d4d5f=_0x3c40f1;if(_[_0x55f3('0x64')](_0x2259ee,0x3eb)){var _0x361234=_[_0x55f3('0x4a')](_0x3d4d5f,{'sectionId':0x3eb});return getCustomDashboards(_0x361234)[_0x55f3('0x28')](function(_0x50fd1a){return _[_0x55f3('0x32')](_0x3d4d5f,function(_0x4e6296){if(_0x361234[_0x55f3('0x62')]){if(_0x4e6296[_0x55f3('0x58')]===0x3eb){_0x4e6296[_0x55f3('0x65')]=_0x50fd1a;}}else{if(_0x4e6296[_0x55f3('0x58')]===0x64){if(!_0x4e6296['subsections']){_0x4e6296['subsections']=[];}_0x4e6296[_0x55f3('0x65')]=_0x4e6296[_0x55f3('0x65')][_0x55f3('0x66')](_0x50fd1a);}}return _0x4e6296;});});}else{return;}})[_0x55f3('0x28')](function(_0x1b7063){if(_0x1b7063)_0x3d4d5f=_0x1b7063;if(_[_0x55f3('0x64')](_0x2259ee,0x709)){var _0x1f9034=_[_0x55f3('0x4a')](_0x3d4d5f,{'sectionId':0x709});return getPlugins(_0x1f9034)['then'](function(_0x57b798){if(_0x1f9034[_0x55f3('0x62')]){return _[_0x55f3('0x32')](_0x3d4d5f,function(_0x39911c){if(_0x39911c[_0x55f3('0x58')]===0x709){_0x39911c['subsections']=_0x57b798;}return _0x39911c;});}else{var _0x4926f2={'sectionId':0x76c,'enabled':0x1,'subsections':_0x57b798};var _0x72017e=_[_0x55f3('0x32')](_0x3d4d5f);_0x72017e[_0x55f3('0x60')](_0x4926f2);return _0x72017e;}});}else{return;}})['then'](function(_0x1dbf09){if(_0x1dbf09)_0x3d4d5f=_0x1dbf09;return _['filter'](_0x3d4d5f,[_0x55f3('0x62'),0x1]);})['then'](respondWithResult(_0x41639f,null))[_0x55f3('0x47')](handleError(_0x41639f,null));};function hasDefaultDashboard(_0x28135c){var _0x1f6822=[0x65];return new BPromise(function(_0x35060e,_0x44c0cf){try{if(_0x28135c[_0x55f3('0x56')]){_0x35060e(_0x1f6822);}else{return db[_0x55f3('0x57')]['findOne']({'where':{'sectionId':_0x28135c['id']},'raw':!![]})[_0x55f3('0x28')](function(_0x1db5fe){_0x1db5fe?_0x35060e(_0x1f6822):_0x35060e();});}}catch(_0x135e1b){_0x44c0cf(_0x135e1b);}});}function getCustomDashboards(_0x432bd2){var _0x481cdd=[];return new BPromise(function(_0x284609,_0x4f6480){try{if(_0x432bd2[_0x55f3('0x56')]){return db[_0x55f3('0x67')][_0x55f3('0x45')]({'raw':!![]})[_0x55f3('0x28')](function(_0x4b394d){_0x4b394d[_0x55f3('0x68')](function(_0x328dd9){_0x481cdd['push'](_0x328dd9['id']+0x1869f);});_0x284609(_0x481cdd);});}else{return db['UserProfileResource'][_0x55f3('0x45')]({'where':{'sectionId':_0x432bd2['id']},'raw':!![]})[_0x55f3('0x28')](function(_0x3696a8){_0x3696a8[_0x55f3('0x68')](function(_0x22bbe9){_0x481cdd[_0x55f3('0x60')](_0x22bbe9[_0x55f3('0x69')]+0x1869f);});_0x284609(_0x481cdd);});}}catch(_0x3c9868){_0x4f6480(_0x3c9868);}});}function getPlugins(_0x2bf973){var _0x51d453=[];return new BPromise(function(_0x368b5e,_0x15a4bf){try{if(_0x2bf973[_0x55f3('0x56')]){return db[_0x55f3('0x6a')][_0x55f3('0x45')]({'raw':!![]})[_0x55f3('0x28')](function(_0x4758ab){_0x4758ab[_0x55f3('0x68')](function(_0x4c3c98){_0x51d453[_0x55f3('0x60')](_0x4c3c98['id']+0x15b38);});_0x368b5e(_0x51d453);});}else{return db['UserProfileResource'][_0x55f3('0x45')]({'where':{'sectionId':_0x2bf973['id']},'raw':!![]})[_0x55f3('0x28')](function(_0x26ff86){_0x26ff86[_0x55f3('0x68')](function(_0x5e962f){_0x51d453['push'](_0x5e962f[_0x55f3('0x69')]+0x15b38);});_0x368b5e(_0x51d453);});}}catch(_0x4616c5){_0x15a4bf(_0x4616c5);}});}exports[_0x55f3('0x6b')]=function(_0x4a5510,_0x22c12c){return db[_0x55f3('0x2d')]['find']({'where':{'id':_0x4a5510[_0x55f3('0x54')]['id']}})['then'](handleEntityNotFound(_0x22c12c,null))[_0x55f3('0x28')](function(_0x309660){if(_0x309660){return db[_0x55f3('0x53')][_0x55f3('0x5e')](function(_0x567dc5){return db[_0x55f3('0x5f')][_0x55f3('0x45')]({'where':{'userProfileId':_0x4a5510['params']['id']},'attributes':['id'],'raw':!![]})['then'](function(_0x1e7417){if(_0x1e7417){return db[_0x55f3('0x5f')][_0x55f3('0x5b')]({'where':{'userProfileId':_0x4a5510['params']['id'],'id':_[_0x55f3('0x32')](_0x1e7417,function(_0x351ff2){return _0x351ff2['id'];})},'transaction':_0x567dc5});}})['then'](function(_0x12927c){var _0x19987b=_[_0x55f3('0x32')](_0x4a5510['body'],function(_0x125890){_0x125890[_0x55f3('0x59')]=_0x4a5510[_0x55f3('0x54')]['id'];return _0x125890;});return db['UserProfileSection'][_0x55f3('0x6c')](_0x19987b,{'raw':!![],'transaction':_0x567dc5});})[_0x55f3('0x28')](function(_0x470671){var _0x4c7e3b=_[_0x55f3('0x40')](_[_0x55f3('0x32')](_0x470671,function(_0x44c5d6){return _0x44c5d6['get']({'plain':!![]});}),{'includeAll':![]});if(_0x4c7e3b){return db[_0x55f3('0x5f')]['findAll']({'where':{'userProfileId':_0x4a5510[_0x55f3('0x54')]['id'],'sectionId':_[_0x55f3('0x32')](_0x4c7e3b,function(_0x3922d5){return _0x3922d5['sectionId'];})},'attributes':['id','sectionId'],'raw':!![]})[_0x55f3('0x28')](function(_0x4dab20){var _0xc5b2d5=_['map'](_0x4a5510['body'],function(_0x46544f){_0x46544f[_0x55f3('0x59')]=_0x4a5510[_0x55f3('0x54')]['id'];return _0x46544f;});return db[_0x55f3('0x57')]['bulkCreate'](_0xc5b2d5,{'raw':!![],'transaction':_0x567dc5});});}})[_0x55f3('0x47')](handleError(_0x22c12c,null));});}})[_0x55f3('0x28')](function(_0x1ea4e6){var _0x158355=_[_0x55f3('0x32')](_0x1ea4e6,function(_0x95e31e){return _0x95e31e[_0x55f3('0x4e')]({'plain':!![]});});})[_0x55f3('0x28')](respondWithResult(_0x22c12c,null))[_0x55f3('0x47')](handleError(_0x22c12c,null));};exports['removeResources']=function(_0x52cb2e,_0x3d64bb,_0xb7f58){return db[_0x55f3('0x2d')]['find']({'where':{'id':_0x52cb2e[_0x55f3('0x54')]['id']}})[_0x55f3('0x28')](handleEntityNotFound(_0x3d64bb,null))[_0x55f3('0x28')](function(_0x50e63d){if(_0x50e63d){return _0x50e63d[_0x55f3('0x6d')](_0x52cb2e[_0x55f3('0x33')][_0x55f3('0x61')]);}})[_0x55f3('0x28')](respondWithStatusCode(_0x3d64bb,null))[_0x55f3('0x47')](handleError(_0x3d64bb,null));};exports[_0x55f3('0x6e')]=function(_0x14aabc,_0x56d4ea){var _0x205f3d={};if(!_0x14aabc[_0x55f3('0x33')][_0x55f3('0x6f')])throw new Error('Missing\x20section\x20parameter');if(!_0x14aabc[_0x55f3('0x33')][_0x55f3('0x39')]('nolimit')){_0x205f3d[_0x55f3('0x21')]=qs[_0x55f3('0x21')](_0x14aabc[_0x55f3('0x33')][_0x55f3('0x21')]);_0x205f3d[_0x55f3('0x1f')]=qs[_0x55f3('0x1f')](_0x14aabc['query']['offset']);}return db[_0x55f3('0x2d')][_0x55f3('0x4a')]({'where':{'id':_0x14aabc[_0x55f3('0x54')]['id']}})[_0x55f3('0x28')](function(_0x13f1ac){if(!_0x13f1ac)throw new Error(_0x55f3('0x70')+_0x14aabc[_0x55f3('0x54')]['id']);return db[_0x55f3('0x2d')][_0x55f3('0x6e')](_0x14aabc);})[_0x55f3('0x28')](respondWithFilteredResult(_0x56d4ea,_0x205f3d))[_0x55f3('0x47')](handleError(_0x56d4ea,null));}; \ No newline at end of file +var _0x7d92=['Plugin','resourceId','bulkCreate','removeResources','getResources','section','Missing\x20section\x20parameter','hasOwnProperty','eml-format','rimraf','request-promise','moment','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','redis','defaults','socket.io-emitter','./userProfile.socket','register','sendStatus','end','limit','undefined','count','offset','status','Content-Range','json','reject','save','update','then','destroy','error','stack','name','send','index','map','UserProfile','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','options','include','findAll','rows','catch','show','params','find','includeAll','omit','createdAt','updatedAt','crudPermissions','body','sequelize','transaction','create','get','UserProfileSection','autoAssociation','UserProfileResource','sectionId','describe','userProfileId','each','push','removeSections','ids','getSections','enabled','includes','subsections','concat','findOne','Dashboard','forEach'];(function(_0x328834,_0x1ed3be){var _0x227cfd=function(_0xe3ee05){while(--_0xe3ee05){_0x328834['push'](_0x328834['shift']());}};_0x227cfd(++_0x1ed3be);}(_0x7d92,0x155));var _0x27d9=function(_0x5dfc2a,_0x1a953f){_0x5dfc2a=_0x5dfc2a-0x0;var _0x3f1a71=_0x7d92[_0x5dfc2a];return _0x3f1a71;};'use strict';var emlformat=require(_0x27d9('0x0'));var rimraf=require(_0x27d9('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x27d9('0x2'));var moment=require(_0x27d9('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x27d9('0x4'));var path=require(_0x27d9('0x5'));var sox=require(_0x27d9('0x6'));var csv=require(_0x27d9('0x7'));var ejs=require(_0x27d9('0x8'));var fs=require('fs');var fs_extra=require(_0x27d9('0x9'));var _=require(_0x27d9('0xa'));var squel=require(_0x27d9('0xb'));var crypto=require(_0x27d9('0xc'));var jsforce=require(_0x27d9('0xd'));var deskjs=require(_0x27d9('0xe'));var toCsv=require(_0x27d9('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x27d9('0xf'));var qs=require(_0x27d9('0x10'));var as=require(_0x27d9('0x11'));var hardwareService=require(_0x27d9('0x12'));var logger=require('../../config/logger')(_0x27d9('0x13'));var utils=require(_0x27d9('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x27d9('0x15'));var db=require('../../mysqldb')['db'];config[_0x27d9('0x16')]=_[_0x27d9('0x17')](config[_0x27d9('0x16')],{'host':'localhost','port':0x18eb});var socket=require(_0x27d9('0x18'))(new Redis(config[_0x27d9('0x16')]));require(_0x27d9('0x19'))[_0x27d9('0x1a')](socket);function respondWithStatusCode(_0x2c5f3d,_0x5ce01a){_0x5ce01a=_0x5ce01a||0xcc;return function(_0x160ac8){if(_0x160ac8){return _0x2c5f3d[_0x27d9('0x1b')](_0x5ce01a);}return _0x2c5f3d['status'](_0x5ce01a)[_0x27d9('0x1c')]();};}function respondWithResult(_0x1ef6cb,_0xa6d501){_0xa6d501=_0xa6d501||0xc8;return function(_0x2af5ad){if(_0x2af5ad){return _0x1ef6cb['status'](_0xa6d501)['json'](_0x2af5ad);}};}function respondWithFilteredResult(_0x4821e1,_0x21fc3a){return function(_0x22c69d){if(_0x22c69d){var _0x501d95=typeof _0x21fc3a['offset']==='undefined'&&typeof _0x21fc3a[_0x27d9('0x1d')]===_0x27d9('0x1e');var _0x980109=_0x22c69d[_0x27d9('0x1f')];var _0x1a6746=_0x501d95?0x0:_0x21fc3a[_0x27d9('0x20')];var _0x3a1dab=_0x501d95?_0x22c69d[_0x27d9('0x1f')]:_0x21fc3a[_0x27d9('0x20')]+_0x21fc3a[_0x27d9('0x1d')];var _0x16f601;if(_0x3a1dab>=_0x980109){_0x3a1dab=_0x980109;_0x16f601=0xc8;}else{_0x16f601=0xce;}_0x4821e1[_0x27d9('0x21')](_0x16f601);return _0x4821e1['set'](_0x27d9('0x22'),_0x1a6746+'-'+_0x3a1dab+'/'+_0x980109)[_0x27d9('0x23')](_0x22c69d);}return null;};}function patchUpdates(_0x1197e5){return function(_0x1254a2){try{jsonpatch['apply'](_0x1254a2,_0x1197e5,!![]);}catch(_0x206ee1){return BPromise[_0x27d9('0x24')](_0x206ee1);}return _0x1254a2[_0x27d9('0x25')]();};}function saveUpdates(_0x3a2666,_0x351064){return function(_0x142083){if(_0x142083){return _0x142083[_0x27d9('0x26')](_0x3a2666)[_0x27d9('0x27')](function(_0x195fd1){return _0x195fd1;});}return null;};}function removeEntity(_0x10f042,_0x2b725d){return function(_0xd9f190){if(_0xd9f190){return _0xd9f190[_0x27d9('0x28')]()[_0x27d9('0x27')](function(){_0x10f042[_0x27d9('0x21')](0xcc)['end']();});}};}function handleEntityNotFound(_0x316519,_0x2047f5){return function(_0x102637){if(!_0x102637){_0x316519[_0x27d9('0x1b')](0x194);}return _0x102637;};}function handleError(_0x356ee0,_0x330c60){_0x330c60=_0x330c60||0x1f4;return function(_0x4f3932){logger[_0x27d9('0x29')](_0x4f3932[_0x27d9('0x2a')]);if(_0x4f3932[_0x27d9('0x2b')]){delete _0x4f3932[_0x27d9('0x2b')];}_0x356ee0[_0x27d9('0x21')](_0x330c60)[_0x27d9('0x2c')](_0x4f3932);};}exports[_0x27d9('0x2d')]=function(_0x4b7b44,_0x12624f){var _0x21e427={},_0xae90ab={},_0x5c6760={'count':0x0,'rows':[]};var _0x1d70d0=_[_0x27d9('0x2e')](db[_0x27d9('0x2f')][_0x27d9('0x30')],function(_0x2cd426){return{'name':_0x2cd426[_0x27d9('0x31')],'type':_0x2cd426[_0x27d9('0x32')][_0x27d9('0x33')]};});_0xae90ab[_0x27d9('0x34')]=_[_0x27d9('0x2e')](_0x1d70d0,_0x27d9('0x2b'));_0xae90ab['query']=_[_0x27d9('0x35')](_0x4b7b44['query']);_0xae90ab[_0x27d9('0x36')]=_[_0x27d9('0x37')](_0xae90ab['model'],_0xae90ab[_0x27d9('0x38')]);_0x21e427[_0x27d9('0x39')]=_['intersection'](_0xae90ab[_0x27d9('0x34')],qs[_0x27d9('0x3a')](_0x4b7b44[_0x27d9('0x38')][_0x27d9('0x3a')]));_0x21e427[_0x27d9('0x39')]=_0x21e427['attributes'][_0x27d9('0x3b')]?_0x21e427[_0x27d9('0x39')]:_0xae90ab[_0x27d9('0x34')];if(!_0x4b7b44[_0x27d9('0x38')]['hasOwnProperty'](_0x27d9('0x3c'))){_0x21e427[_0x27d9('0x1d')]=qs[_0x27d9('0x1d')](_0x4b7b44['query'][_0x27d9('0x1d')]);_0x21e427['offset']=qs[_0x27d9('0x20')](_0x4b7b44[_0x27d9('0x38')][_0x27d9('0x20')]);}_0x21e427[_0x27d9('0x3d')]=qs['sort'](_0x4b7b44[_0x27d9('0x38')][_0x27d9('0x3e')]);_0x21e427[_0x27d9('0x3f')]=qs['filters'](_[_0x27d9('0x40')](_0x4b7b44[_0x27d9('0x38')],_0xae90ab[_0x27d9('0x36')]),_0x1d70d0);if(_0x4b7b44['query'][_0x27d9('0x41')]){_0x21e427[_0x27d9('0x3f')]=_[_0x27d9('0x42')](_0x21e427['where'],{'$or':_[_0x27d9('0x2e')](_0x1d70d0,function(_0x19b7f0){if(_0x19b7f0[_0x27d9('0x32')]!=='VIRTUAL'){var _0x3ea282={};_0x3ea282[_0x19b7f0[_0x27d9('0x2b')]]={'$like':'%'+_0x4b7b44[_0x27d9('0x38')][_0x27d9('0x41')]+'%'};return _0x3ea282;}})});}_0x21e427=_[_0x27d9('0x42')]({},_0x21e427,_0x4b7b44[_0x27d9('0x43')]);var _0x54a650={'where':_0x21e427[_0x27d9('0x3f')]};return db[_0x27d9('0x2f')][_0x27d9('0x1f')](_0x54a650)[_0x27d9('0x27')](function(_0x8a3fd9){_0x5c6760[_0x27d9('0x1f')]=_0x8a3fd9;if(_0x4b7b44[_0x27d9('0x38')]['includeAll']){_0x21e427[_0x27d9('0x44')]=[{'all':!![]}];}return db['UserProfile'][_0x27d9('0x45')](_0x21e427);})[_0x27d9('0x27')](function(_0x3fa9b2){_0x5c6760[_0x27d9('0x46')]=_0x3fa9b2;return _0x5c6760;})[_0x27d9('0x27')](respondWithFilteredResult(_0x12624f,_0x21e427))[_0x27d9('0x47')](handleError(_0x12624f,null));};exports[_0x27d9('0x48')]=function(_0x52b3a7,_0x9920c3){var _0x31dac7={'raw':![],'where':{'id':_0x52b3a7[_0x27d9('0x49')]['id']}},_0x47e91e={};_0x47e91e[_0x27d9('0x34')]=_['keys'](db['UserProfile'][_0x27d9('0x30')]);_0x47e91e['query']=_[_0x27d9('0x35')](_0x52b3a7[_0x27d9('0x38')]);_0x47e91e[_0x27d9('0x36')]=_[_0x27d9('0x37')](_0x47e91e[_0x27d9('0x34')],_0x47e91e['query']);_0x31dac7[_0x27d9('0x39')]=_['intersection'](_0x47e91e[_0x27d9('0x34')],qs['fields'](_0x52b3a7[_0x27d9('0x38')][_0x27d9('0x3a')]));_0x31dac7[_0x27d9('0x39')]=_0x31dac7[_0x27d9('0x39')]['length']?_0x31dac7[_0x27d9('0x39')]:_0x47e91e['model'];if(_0x52b3a7[_0x27d9('0x38')]['includeAll']){_0x31dac7[_0x27d9('0x44')]=[{'all':!![]}];}_0x31dac7=_[_0x27d9('0x42')]({},_0x31dac7,_0x52b3a7[_0x27d9('0x43')]);return db[_0x27d9('0x2f')][_0x27d9('0x4a')](_0x31dac7)[_0x27d9('0x27')](handleEntityNotFound(_0x9920c3,null))[_0x27d9('0x27')](respondWithResult(_0x9920c3,null))['catch'](handleError(_0x9920c3,null));};exports['create']=function(_0x17e012,_0x3c97f7){return db[_0x27d9('0x2f')]['create'](_0x17e012['body'],{})[_0x27d9('0x27')](respondWithResult(_0x3c97f7,0xc9))[_0x27d9('0x47')](handleError(_0x3c97f7,null));};exports['clone']=function(_0x5f2cad,_0x23b656){var _0x46f523={'where':{'id':_0x5f2cad[_0x27d9('0x49')]['id']}},_0x2ff322={};_0x2ff322[_0x27d9('0x34')]=_['keys'](db['UserProfile']['rawAttributes']);_0x46f523['attributes']=_[_0x27d9('0x37')](_0x2ff322['model'],qs[_0x27d9('0x3a')](_0x5f2cad['query'][_0x27d9('0x3a')]));_0x46f523[_0x27d9('0x39')]=_0x46f523['attributes'][_0x27d9('0x3b')]?_0x46f523[_0x27d9('0x39')]:_0x2ff322['model'];if(_0x5f2cad[_0x27d9('0x38')][_0x27d9('0x4b')]){_0x46f523['include']=[{'all':!![]}];}_0x46f523=_[_0x27d9('0x42')]({},_0x46f523,_0x5f2cad[_0x27d9('0x43')]);return db[_0x27d9('0x2f')][_0x27d9('0x4a')](_0x46f523)[_0x27d9('0x27')](handleEntityNotFound(_0x23b656,null))[_0x27d9('0x27')](function(_0x4e648e){if(_0x4e648e){var _0x1297f3=_0x4e648e['get']({'plain':!![]});_0x1297f3=qs[_0x27d9('0x4c')](_0x1297f3,['id',_0x27d9('0x4d'),_0x27d9('0x4e'),_0x27d9('0x4f')]);_0x5f2cad[_0x27d9('0x50')]=_[_0x27d9('0x4c')](_0x5f2cad[_0x27d9('0x50')],['id',_0x27d9('0x4d'),_0x27d9('0x4e')]);return db[_0x27d9('0x51')][_0x27d9('0x52')](function(_0xcbe34d){return db[_0x27d9('0x2f')][_0x27d9('0x53')](_[_0x27d9('0x42')](_0x1297f3,_0x5f2cad[_0x27d9('0x50')]),{'include':_0x5f2cad[_0x27d9('0x38')][_0x27d9('0x4b')]?[{'all':!![]}]:undefined,'transaction':_0xcbe34d})[_0x27d9('0x27')](function(_0x170bd1){var _0x250845=_0x170bd1[_0x27d9('0x54')]({'plain':!![]});return db[_0x27d9('0x55')][_0x27d9('0x45')]({'where':{'userProfileId':_0x5f2cad[_0x27d9('0x49')]['id']},'raw':!![]})[_0x27d9('0x27')](function(_0xd9fa41){if(_0xd9fa41){return BPromise['each'](_0xd9fa41,function(_0x42a65a){return new BPromise(function(_0x4ae0b7,_0xe11a95){if(_0x42a65a['autoAssociation']===null||_0x42a65a[_0x27d9('0x56')]===0x1)_0x4ae0b7(null);return db[_0x27d9('0x57')][_0x27d9('0x45')]({'where':{'sectionId':_0x42a65a['id']},'raw':!![]})[_0x27d9('0x27')](function(_0x38ac57){var _0x1770e2=_['map'](_0x38ac57,function(_0x43719f){return qs['omit'](_0x43719f,['id','createdAt',_0x27d9('0x4e'),_0x27d9('0x58')]);});_0x4ae0b7(_0x1770e2);})[_0x27d9('0x47')](function(_0x5763b0){_0xe11a95(_0x5763b0);});})[_0x27d9('0x27')](function(_0x3ecb2c){var _0x3da381=qs[_0x27d9('0x4c')](_0x42a65a,['id','createdAt',_0x27d9('0x4e')]);_0x3da381['userProfileId']=_0x250845['id'];if(_0x3ecb2c)_0x3da381['Resources']=_0x3ecb2c;return _0x3da381;})[_0x27d9('0x27')](function(_0x33028f){return db['UserProfileSection'][_0x27d9('0x53')](_0x33028f,{'include':[{'model':db[_0x27d9('0x57')],'as':'Resources'}],'raw':!![],'transaction':_0xcbe34d});});})[_0x27d9('0x27')](function(){return _0x250845;});}});});});}})[_0x27d9('0x27')](respondWithResult(_0x23b656,0xc9))['catch'](handleError(_0x23b656,null));};exports[_0x27d9('0x26')]=function(_0x5b9ff2,_0x2aca88){if(_0x5b9ff2['body']['id']){delete _0x5b9ff2[_0x27d9('0x50')]['id'];}return db[_0x27d9('0x2f')][_0x27d9('0x4a')]({'where':{'id':_0x5b9ff2[_0x27d9('0x49')]['id']}})[_0x27d9('0x27')](handleEntityNotFound(_0x2aca88,null))[_0x27d9('0x27')](saveUpdates(_0x5b9ff2[_0x27d9('0x50')],null))[_0x27d9('0x27')](respondWithResult(_0x2aca88,null))[_0x27d9('0x47')](handleError(_0x2aca88,null));};exports[_0x27d9('0x28')]=function(_0x5e7df2,_0x49b1f8){return db[_0x27d9('0x2f')][_0x27d9('0x4a')]({'where':{'id':_0x5e7df2[_0x27d9('0x49')]['id']}})[_0x27d9('0x27')](handleEntityNotFound(_0x49b1f8,null))['then'](removeEntity(_0x49b1f8,null))[_0x27d9('0x47')](handleError(_0x49b1f8,null));};exports[_0x27d9('0x59')]=function(_0x21d054,_0x3c3cca){return db[_0x27d9('0x2f')][_0x27d9('0x59')]()['then'](respondWithResult(_0x3c3cca,null))[_0x27d9('0x47')](handleError(_0x3c3cca,null));};exports['addSections']=function(_0x3293ba,_0x5c3873){var _0x22679e=_0x3293ba['body'];return db[_0x27d9('0x2f')][_0x27d9('0x4a')]({'where':{'id':_0x3293ba[_0x27d9('0x49')]['id']}})[_0x27d9('0x27')](handleEntityNotFound(_0x5c3873,null))['then'](function(_0x32e1f7){if(_0x32e1f7){return db[_0x27d9('0x51')][_0x27d9('0x52')](function(_0x3701c1){return db[_0x27d9('0x55')][_0x27d9('0x28')]({'where':{'userProfileId':_0x3293ba[_0x27d9('0x49')]['id'],'sectionId':_[_0x27d9('0x2e')](_0x22679e,function(_0x58bb09){return _0x58bb09[_0x27d9('0x58')];})},'transaction':_0x3701c1})[_0x27d9('0x27')](function(){var _0x289e38=_[_0x27d9('0x2e')](_0x22679e,function(_0x164d05){_0x164d05[_0x27d9('0x5a')]=_0x3293ba[_0x27d9('0x49')]['id'];return _0x164d05;});var _0x16ec11=[];return BPromise[_0x27d9('0x5b')](_0x289e38,function(_0x1b6fe4){return db[_0x27d9('0x55')]['create'](_0x1b6fe4,{'include':[{'model':db[_0x27d9('0x57')],'as':'Resources'}],'raw':!![],'transaction':_0x3701c1})['then'](function(_0x452c57){_0x16ec11[_0x27d9('0x5c')](_0x452c57['get']({'plain':!![]}));});})[_0x27d9('0x27')](function(){return _0x16ec11;});});});}})[_0x27d9('0x27')](function(_0x5090e9){return _0x5090e9;})[_0x27d9('0x27')](respondWithResult(_0x5c3873,null))['catch'](handleError(_0x5c3873,null));};exports[_0x27d9('0x5d')]=function(_0x43efd8,_0x126e74){var _0x1c9fb0;return db['UserProfile'][_0x27d9('0x4a')]({'where':{'id':_0x43efd8[_0x27d9('0x49')]['id']},'attributes':['id',_0x27d9('0x2b')]})['then'](handleEntityNotFound(_0x126e74,null))[_0x27d9('0x27')](function(_0x517bc3){if(_0x517bc3){_0x1c9fb0=_0x517bc3;return db['UserProfileSection'][_0x27d9('0x28')]({'where':{'userProfileId':_0x43efd8[_0x27d9('0x49')]['id'],'sectionId':_0x43efd8[_0x27d9('0x38')][_0x27d9('0x5e')]}});}})[_0x27d9('0x27')](function(){return _0x1c9fb0;})['then'](respondWithStatusCode(_0x126e74,null))[_0x27d9('0x47')](handleError(_0x126e74,null));};exports[_0x27d9('0x5f')]=function(_0x458d43,_0x109e02){var _0x25c1c4=[];var _0x14f11e=[];return db[_0x27d9('0x55')][_0x27d9('0x45')]({'where':{'userProfileId':_0x458d43[_0x27d9('0x49')]['id']},'raw':!![]})['then'](function(_0x481457){_0x25c1c4=_['filter'](_0x481457,function(_0x4fda72){return _0x4fda72[_0x27d9('0x60')]===0x1||_['includes']([0x3eb,0x709],_0x4fda72[_0x27d9('0x58')]);});if(!_['isEmpty'](_0x25c1c4)){return _[_0x27d9('0x2e')](_0x25c1c4,function(_0x394f96){return _0x394f96[_0x27d9('0x58')];});}else{return;}})[_0x27d9('0x27')](function(_0x2a1652){if(_0x2a1652)_0x14f11e=_0x2a1652;if(_[_0x27d9('0x61')](_0x14f11e,0x64)){var _0x54b317=_[_0x27d9('0x4a')](_0x25c1c4,{'sectionId':0x64});return hasDefaultDashboard(_0x54b317)['then'](function(_0x4e15d3){return _['map'](_0x25c1c4,function(_0x1cef6b){if(_0x1cef6b[_0x27d9('0x58')]===0x64){_0x1cef6b[_0x27d9('0x62')]=_0x4e15d3;}return _0x1cef6b;});});}else{return;}})['then'](function(_0x43288f){if(_0x43288f)_0x25c1c4=_0x43288f;if(_[_0x27d9('0x61')](_0x14f11e,0x3eb)){var _0x26bc31=_['find'](_0x25c1c4,{'sectionId':0x3eb});return getCustomDashboards(_0x26bc31)[_0x27d9('0x27')](function(_0xd35a53){return _[_0x27d9('0x2e')](_0x25c1c4,function(_0xec9d6e){if(_0x26bc31['enabled']){if(_0xec9d6e[_0x27d9('0x58')]===0x3eb){_0xec9d6e[_0x27d9('0x62')]=_0xd35a53;}}else{if(_0xec9d6e[_0x27d9('0x58')]===0x64){if(!_0xec9d6e[_0x27d9('0x62')]){_0xec9d6e[_0x27d9('0x62')]=[];}_0xec9d6e[_0x27d9('0x62')]=_0xec9d6e[_0x27d9('0x62')][_0x27d9('0x63')](_0xd35a53);}}return _0xec9d6e;});});}else{return;}})[_0x27d9('0x27')](function(_0x177dcb){if(_0x177dcb)_0x25c1c4=_0x177dcb;if(_[_0x27d9('0x61')](_0x14f11e,0x709)){var _0x3725dd=_['find'](_0x25c1c4,{'sectionId':0x709});return getPlugins(_0x3725dd)[_0x27d9('0x27')](function(_0x21bb06){if(_0x3725dd[_0x27d9('0x60')]){return _[_0x27d9('0x2e')](_0x25c1c4,function(_0x477861){if(_0x477861[_0x27d9('0x58')]===0x709){_0x477861[_0x27d9('0x62')]=_0x21bb06;}return _0x477861;});}else{var _0x4ca932={'sectionId':0x76c,'enabled':0x1,'subsections':_0x21bb06};var _0xf408d4=_[_0x27d9('0x2e')](_0x25c1c4);_0xf408d4[_0x27d9('0x5c')](_0x4ca932);return _0xf408d4;}});}else{return;}})[_0x27d9('0x27')](function(_0x50eae7){if(_0x50eae7)_0x25c1c4=_0x50eae7;return _[_0x27d9('0x41')](_0x25c1c4,[_0x27d9('0x60'),0x1]);})[_0x27d9('0x27')](respondWithResult(_0x109e02,null))[_0x27d9('0x47')](handleError(_0x109e02,null));};function hasDefaultDashboard(_0x2deafd){var _0xed1490=[0x65];return new BPromise(function(_0x3e33cb,_0x202832){try{if(_0x2deafd[_0x27d9('0x56')]){_0x3e33cb(_0xed1490);}else{return db[_0x27d9('0x57')][_0x27d9('0x64')]({'where':{'sectionId':_0x2deafd['id']},'raw':!![]})[_0x27d9('0x27')](function(_0x342bd1){_0x342bd1?_0x3e33cb(_0xed1490):_0x3e33cb();});}}catch(_0x819d00){_0x202832(_0x819d00);}});}function getCustomDashboards(_0x1af5b4){var _0x38bb6d=[];return new BPromise(function(_0x24ab56,_0x4d572a){try{if(_0x1af5b4[_0x27d9('0x56')]){return db[_0x27d9('0x65')]['findAll']({'raw':!![]})[_0x27d9('0x27')](function(_0x7a2024){_0x7a2024[_0x27d9('0x66')](function(_0x2e284a){_0x38bb6d[_0x27d9('0x5c')](_0x2e284a['id']+0x1869f);});_0x24ab56(_0x38bb6d);});}else{return db['UserProfileResource'][_0x27d9('0x45')]({'where':{'sectionId':_0x1af5b4['id']},'raw':!![]})[_0x27d9('0x27')](function(_0x54c1f7){_0x54c1f7['forEach'](function(_0x57c855){_0x38bb6d['push'](_0x57c855['resourceId']+0x1869f);});_0x24ab56(_0x38bb6d);});}}catch(_0x156730){_0x4d572a(_0x156730);}});}function getPlugins(_0x201495){var _0x1f021f=[];return new BPromise(function(_0x408c07,_0x5f2a7f){try{if(_0x201495[_0x27d9('0x56')]){return db[_0x27d9('0x67')][_0x27d9('0x45')]({'raw':!![]})[_0x27d9('0x27')](function(_0x39cf0c){_0x39cf0c['forEach'](function(_0x804fbf){_0x1f021f['push'](_0x804fbf['id']+0x15b38);});_0x408c07(_0x1f021f);});}else{return db['UserProfileResource'][_0x27d9('0x45')]({'where':{'sectionId':_0x201495['id']},'raw':!![]})[_0x27d9('0x27')](function(_0x59113b){_0x59113b['forEach'](function(_0x1b7fbc){_0x1f021f[_0x27d9('0x5c')](_0x1b7fbc[_0x27d9('0x68')]+0x15b38);});_0x408c07(_0x1f021f);});}}catch(_0x118f48){_0x5f2a7f(_0x118f48);}});}exports['addResources']=function(_0x36c533,_0xa24ee){return db[_0x27d9('0x2f')]['find']({'where':{'id':_0x36c533[_0x27d9('0x49')]['id']}})[_0x27d9('0x27')](handleEntityNotFound(_0xa24ee,null))['then'](function(_0x6bc82b){if(_0x6bc82b){return db[_0x27d9('0x51')][_0x27d9('0x52')](function(_0x173779){return db[_0x27d9('0x55')][_0x27d9('0x45')]({'where':{'userProfileId':_0x36c533['params']['id']},'attributes':['id'],'raw':!![]})['then'](function(_0x439a2e){if(_0x439a2e){return db[_0x27d9('0x55')][_0x27d9('0x28')]({'where':{'userProfileId':_0x36c533[_0x27d9('0x49')]['id'],'id':_[_0x27d9('0x2e')](_0x439a2e,function(_0x50ff19){return _0x50ff19['id'];})},'transaction':_0x173779});}})[_0x27d9('0x27')](function(_0x3962e5){var _0x41586d=_[_0x27d9('0x2e')](_0x36c533[_0x27d9('0x50')],function(_0x17bfb8){_0x17bfb8['userProfileId']=_0x36c533[_0x27d9('0x49')]['id'];return _0x17bfb8;});return db[_0x27d9('0x55')]['bulkCreate'](_0x41586d,{'raw':!![],'transaction':_0x173779});})[_0x27d9('0x27')](function(_0x1ee17d){var _0x2fb7bb=_[_0x27d9('0x41')](_[_0x27d9('0x2e')](_0x1ee17d,function(_0x49b1ee){return _0x49b1ee[_0x27d9('0x54')]({'plain':!![]});}),{'includeAll':![]});if(_0x2fb7bb){return db['UserProfileSection'][_0x27d9('0x45')]({'where':{'userProfileId':_0x36c533[_0x27d9('0x49')]['id'],'sectionId':_['map'](_0x2fb7bb,function(_0x498df9){return _0x498df9[_0x27d9('0x58')];})},'attributes':['id',_0x27d9('0x58')],'raw':!![]})[_0x27d9('0x27')](function(_0x1a8fc1){var _0x566c69=_[_0x27d9('0x2e')](_0x36c533[_0x27d9('0x50')],function(_0x1915dc){_0x1915dc['userProfileId']=_0x36c533['params']['id'];return _0x1915dc;});return db[_0x27d9('0x57')][_0x27d9('0x69')](_0x566c69,{'raw':!![],'transaction':_0x173779});});}})[_0x27d9('0x47')](handleError(_0xa24ee,null));});}})['then'](function(_0x280309){var _0x4c2818=_[_0x27d9('0x2e')](_0x280309,function(_0x577e75){return _0x577e75[_0x27d9('0x54')]({'plain':!![]});});})[_0x27d9('0x27')](respondWithResult(_0xa24ee,null))[_0x27d9('0x47')](handleError(_0xa24ee,null));};exports['removeResources']=function(_0x335fea,_0x95b513,_0xb31dcb){return db[_0x27d9('0x2f')][_0x27d9('0x4a')]({'where':{'id':_0x335fea[_0x27d9('0x49')]['id']}})[_0x27d9('0x27')](handleEntityNotFound(_0x95b513,null))[_0x27d9('0x27')](function(_0x368237){if(_0x368237){return _0x368237[_0x27d9('0x6a')](_0x335fea[_0x27d9('0x38')][_0x27d9('0x5e')]);}})[_0x27d9('0x27')](respondWithStatusCode(_0x95b513,null))[_0x27d9('0x47')](handleError(_0x95b513,null));};exports[_0x27d9('0x6b')]=function(_0x40a0c8,_0x4850b2){var _0xaab5d1={};if(!_0x40a0c8[_0x27d9('0x38')][_0x27d9('0x6c')])throw new Error(_0x27d9('0x6d'));if(!_0x40a0c8[_0x27d9('0x38')][_0x27d9('0x6e')](_0x27d9('0x3c'))){_0xaab5d1['limit']=qs[_0x27d9('0x1d')](_0x40a0c8[_0x27d9('0x38')][_0x27d9('0x1d')]);_0xaab5d1[_0x27d9('0x20')]=qs[_0x27d9('0x20')](_0x40a0c8['query'][_0x27d9('0x20')]);}return db[_0x27d9('0x2f')][_0x27d9('0x4a')]({'where':{'id':_0x40a0c8[_0x27d9('0x49')]['id']}})['then'](function(_0x1412bf){if(!_0x1412bf)throw new Error('No\x20User\x20Profile\x20found\x20for\x20id\x20'+_0x40a0c8[_0x27d9('0x49')]['id']);return db[_0x27d9('0x2f')][_0x27d9('0x6b')](_0x40a0c8);})[_0x27d9('0x27')](respondWithFilteredResult(_0x4850b2,_0xaab5d1))['catch'](handleError(_0x4850b2,null));}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.events.js b/server/api/userProfile/userProfile.events.js index 76cb81b..07c44a8 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 _0x430c=['update','emit','hasOwnProperty','exports','events','setMaxListeners','save'];(function(_0x23bd05,_0x409ba8){var _0x2ea842=function(_0x55ff6d){while(--_0x55ff6d){_0x23bd05['push'](_0x23bd05['shift']());}};_0x2ea842(++_0x409ba8);}(_0x430c,0x1a1));var _0xc430=function(_0x32b542,_0x4512fa){_0x32b542=_0x32b542-0x0;var _0x554d54=_0x430c[_0x32b542];return _0x554d54;};'use strict';var EventEmitter=require(_0xc430('0x0'));var UserProfile=require('../../mysqldb')['db']['UserProfile'];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0xc430('0x1')](0x0);var events={'afterCreate':_0xc430('0x2'),'afterUpdate':_0xc430('0x3'),'afterDestroy':'remove'};function emitEvent(_0x4f0118){return function(_0x5ccda6,_0x47d8b9,_0x338a82){UserProfileEvents[_0xc430('0x4')](_0x4f0118+':'+_0x5ccda6['id'],_0x5ccda6);UserProfileEvents['emit'](_0x4f0118,_0x5ccda6);_0x338a82(null);};}for(var e in events){if(events[_0xc430('0x5')](e)){var event=events[e];UserProfile['hook'](e,emitEvent(event));}}module[_0xc430('0x6')]=UserProfileEvents; \ No newline at end of file +var _0xc1db=['hasOwnProperty','events','UserProfile','setMaxListeners','save','update','remove'];(function(_0x2d34d6,_0x397ff9){var _0x1d3d12=function(_0x558800){while(--_0x558800){_0x2d34d6['push'](_0x2d34d6['shift']());}};_0x1d3d12(++_0x397ff9);}(_0xc1db,0x120));var _0xbc1d=function(_0x48bf8f,_0xf45987){_0x48bf8f=_0x48bf8f-0x0;var _0x196630=_0xc1db[_0x48bf8f];return _0x196630;};'use strict';var EventEmitter=require(_0xbc1d('0x0'));var UserProfile=require('../../mysqldb')['db'][_0xbc1d('0x1')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0xbc1d('0x2')](0x0);var events={'afterCreate':_0xbc1d('0x3'),'afterUpdate':_0xbc1d('0x4'),'afterDestroy':_0xbc1d('0x5')};function emitEvent(_0x4b69f6){return function(_0x3d0b27,_0x329960,_0x23a61e){UserProfileEvents['emit'](_0x4b69f6+':'+_0x3d0b27['id'],_0x3d0b27);UserProfileEvents['emit'](_0x4b69f6,_0x3d0b27);_0x23a61e(null);};}for(var e in events){if(events[_0xbc1d('0x6')](e)){var event=events[e];UserProfile['hook'](e,emitEvent(event));}}module['exports']=UserProfileEvents; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.model.js b/server/api/userProfile/userProfile.model.js index 52b46d2..78bbeb2 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 _0x7248=['outbound','musiconholds','VoiceMusicOnHold','VoiceChanSpy','voiceprefixes','VoicePrefix','ivrcampaigns','Campaign','mailqueues','MailQueue','mailaccounts','MailAccount','mailsubstatuses','MailSubstatus','openchannelqueues','OpenchannelQueue','openchannelaccounts','smsqueues','SmsQueue','SmsAccount','WhatsappQueue','WhatsappAccount','teams','Team','voicequeues','queuecampaigns','users','agents','telephones','Users','user','Agents','salesforceaccounts','SalesforceAccount','freshdeskaccounts','FreshdeskAccount','sugarcrmaccounts','SugarcrmAccount','deskaccounts','ZohoAccount','cannedanswers','CannedAnswer','Disposition','customdashboards','pauses','scheduler','Schedule','sounds','Sound','tags','Template','triggers','Trigger','trunks','Trunk','variables','Variable','Plugin','extractedreports','Reports','reportId','metrics','AnalyticMetric','charAt','toUpperCase','slice','Sequelize','QueryTypes','SELECT','ui.','InteractionId','ui.createdAt','from','user_has_','_interactions','where','ui.UserId\x20=\x20?','sequelize','define','query','raw','section','mergeResources','Invalid\x20section\x20\x27','isEmpty','length','push','UserProfileSection','params','all','ignore','union','find','autoAssociation','rawAttributes','keys','filters','intersection','attributes','fields','hasOwnProperty','limit','offset','sort','pick','merge','key','VIRTUAL','foreignKey','forEach','includeAll','include','reportType','default','DefaultReports','custom','CustomReports','rows','ids','customSorting','order','extraQueryConditions','count','color','Tag','tag','chat','dataValues','sms','mail','openchannel','lodash','./userProfile.attributes','filter','field','findAll','then','map','catch','value','model','associatedResources','name','resolve','UserProfileResource','AnalyticExtractedReport','resourceId','squareprojects','SquareProject','odbc','childModel','SquareOdbc','squarerecordings','SquareRecording','parentSections','SquareProjects','projectName','projects','JscriptyProject','CmContact','Lists','lists','companies','CmCompany','globalcustomfields','CmCustomField','chatqueues','ChatQueue','faxqueues','FaxQueue','faxaccounts','inboundroutes','outboundroutes','VoiceExtension','VoiceContext','voicemails','VoiceMail','voicerecordings','VoiceRecording','membername','User','role','agent','Telephones','telephone','queue','type','QueueCampaigns','VoiceQueue'];(function(_0x5d4607,_0x6b5e7b){var _0x5e4a86=function(_0x46891a){while(--_0x46891a){_0x5d4607['push'](_0x5d4607['shift']());}};_0x5e4a86(++_0x6b5e7b);}(_0x7248,0x83));var _0x8724=function(_0x216d45,_0x4989fe){_0x216d45=_0x216d45-0x0;var _0xbaac0b=_0x7248[_0x216d45];return _0xbaac0b;};'use strict';var _=require(_0x8724('0x0'));var attributes=require(_0x8724('0x1'));var squel=require('squel');module['exports']=function(_0x6226a2){var _0x3d465c=_0x6226a2['models'];function _0x3fc85e(_0x4ed14b,_0x1232d4){return new Promise(function(_0x53ec95,_0x4b7c14){if(!_0x1232d4)return _0x53ec95(null);var _0x1fe0b3=_0x1232d4[_0x8724('0x2')]?{[_0x1232d4[_0x8724('0x2')][_0x8724('0x3')]]:_0x1232d4[_0x8724('0x2')]['value']}:undefined;return _0x3d465c[_0x4ed14b][_0x8724('0x4')]({'where':_0x1fe0b3,'raw':!![]})[_0x8724('0x5')](function(_0x3ac402){_0x1232d4['associatedResources']=_[_0x8724('0x6')](_0x3ac402,'id');_0x53ec95(_0x1232d4);})[_0x8724('0x7')](function(_0x347c63){_0x4b7c14(_0x347c63);});});}function _0x5e4910(_0x2c7ab1,_0x439875){return new Promise(function(_0x5c4212,_0x5bbafd){var _0x4b0bfc=_0x2c7ab1['filter']?{[_0x2c7ab1['filter'][_0x8724('0x3')]]:_0x2c7ab1['filter'][_0x8724('0x8')]}:undefined;return _0x3d465c[_0x2c7ab1[_0x8724('0x9')]][_0x8724('0x4')]({'where':_0x4b0bfc,'raw':!![]})[_0x8724('0x5')](function(_0x3b5df8){_0x439875[_0x8724('0xa')]=_[_0x8724('0x6')](_0x3b5df8,function(_0x4ab20d){return _0x4ab20d[_0x8724('0xb')];});_0x5c4212(_0x439875);})[_0x8724('0x7')](function(_0x220c37){_0x5bbafd(_0x220c37);});});}function _0x24fcc8(_0x77e25a,_0xafbe7e,_0x17d5b4){if(!_0xafbe7e)return Promise[_0x8724('0xc')](null);return new Promise(function(_0x93445b,_0x4a08b8){return _0x3d465c[_0x8724('0xd')][_0x8724('0x4')]({'where':{'sectionId':_0xafbe7e['id']},'raw':!![]})[_0x8724('0x5')](function(_0xa7315c){if(_0x77e25a[_0x8724('0x3')]&&_0x77e25a[_0x8724('0x3')]!=='id'){_0xafbe7e[_0x8724('0xa')]=_[_0x8724('0x6')](_0xa7315c,function(_0x7eb0f5){return _0x7eb0f5[_0x77e25a[_0x8724('0x3')]];});}else{if(_0x17d5b4===_0x8724('0xe')){_0xafbe7e['associatedResources']=_[_0x8724('0x6')](_0xa7315c,function(_0x118ab8){return{'id':_0x118ab8[_0x8724('0xf')],'type':_0x118ab8['type']};});}else{_0xafbe7e[_0x8724('0xa')]=_[_0x8724('0x6')](_0xa7315c,function(_0x1157d3){return _0x1157d3[_0x8724('0xf')];});}}_0x93445b(_0xafbe7e);})['catch'](function(_0x19b609){_0x4a08b8(_0x19b609);});});}function _0x102c1a(_0x17f195,_0xb3e99){var _0x4dcb06={'parentSections':[]};switch(_0x17f195['toLowerCase']()){case _0x8724('0x10'):_0x4dcb06['childModel']=_0x8724('0x11');break;case _0x8724('0x12'):_0x4dcb06[_0x8724('0x13')]=_0x8724('0x14');break;case _0x8724('0x15'):_0x4dcb06[_0x8724('0x13')]=_0x8724('0x16');_0x4dcb06[_0x8724('0x17')]=[{'name':_0x8724('0x18'),'field':_0x8724('0xb'),'foreignKey':_0x8724('0x19')}];break;case _0x8724('0x1a'):_0x4dcb06[_0x8724('0x13')]=_0x8724('0x1b');break;case'contacts':_0x4dcb06['childModel']=_0x8724('0x1c');_0x4dcb06[_0x8724('0x17')]=[{'name':_0x8724('0x1d'),'field':'id','foreignKey':'ListId'}];break;case _0x8724('0x1e'):_0x4dcb06[_0x8724('0x13')]='CmList';break;case _0x8724('0x1f'):_0x4dcb06[_0x8724('0x13')]=_0x8724('0x20');break;case _0x8724('0x21'):_0x4dcb06[_0x8724('0x13')]=_0x8724('0x22');break;case _0x8724('0x23'):_0x4dcb06['childModel']=_0x8724('0x24');break;case'chatwebsites':_0x4dcb06[_0x8724('0x13')]='ChatWebsite';break;case _0x8724('0x25'):_0x4dcb06[_0x8724('0x13')]=_0x8724('0x26');break;case _0x8724('0x27'):_0x4dcb06[_0x8724('0x13')]='FaxAccount';break;case _0x8724('0x28'):case'internalroutes':case _0x8724('0x29'):_0x4dcb06[_0x8724('0x13')]=_0x8724('0x2a');break;case'contexts':_0x4dcb06['childModel']=_0x8724('0x2b');break;case _0x8724('0x2c'):_0x4dcb06[_0x8724('0x13')]=_0x8724('0x2d');break;case _0x8724('0x2e'):_0x4dcb06[_0x8724('0x13')]=_0x8724('0x2f');_0x4dcb06['parentSections']=[{'name':'Agents','field':'name','foreignKey':_0x8724('0x30'),'model':_0x8724('0x31'),'filter':{'field':_0x8724('0x32'),'value':[_0x8724('0x33')]}},{'name':_0x8724('0x34'),'field':'name','foreignKey':_0x8724('0x30'),'model':_0x8724('0x31'),'filter':{'field':_0x8724('0x32'),'value':[_0x8724('0x35')]}},{'name':'VoiceQueues','field':_0x8724('0xb'),'foreignKey':_0x8724('0x36'),'model':'VoiceQueue','filter':{'field':_0x8724('0x37'),'value':['inbound']}},{'name':_0x8724('0x38'),'field':_0x8724('0xb'),'foreignKey':'queue','model':_0x8724('0x39'),'filter':{'field':_0x8724('0x37'),'value':[_0x8724('0x3a')]}}];break;case _0x8724('0x3b'):_0x4dcb06[_0x8724('0x13')]=_0x8724('0x3c');break;case'chanspies':_0x4dcb06['childModel']=_0x8724('0x3d');break;case _0x8724('0x3e'):_0x4dcb06[_0x8724('0x13')]=_0x8724('0x3f');break;case _0x8724('0x40'):_0x4dcb06[_0x8724('0x13')]=_0x8724('0x41');break;case _0x8724('0x42'):_0x4dcb06[_0x8724('0x13')]=_0x8724('0x43');break;case _0x8724('0x44'):_0x4dcb06['childModel']=_0x8724('0x45');break;case _0x8724('0x46'):_0x4dcb06[_0x8724('0x13')]=_0x8724('0x47');break;case _0x8724('0x48'):_0x4dcb06[_0x8724('0x13')]=_0x8724('0x49');break;case _0x8724('0x4a'):_0x4dcb06['childModel']='OpenchannelAccount';break;case _0x8724('0x4b'):_0x4dcb06['childModel']=_0x8724('0x4c');break;case'smsaccounts':_0x4dcb06['childModel']=_0x8724('0x4d');break;case'whatsappqueues':_0x4dcb06[_0x8724('0x13')]=_0x8724('0x4e');break;case'whatsappaccounts':_0x4dcb06['childModel']=_0x8724('0x4f');break;case _0x8724('0x50'):_0x4dcb06[_0x8724('0x13')]=_0x8724('0x51');break;case _0x8724('0x52'):case _0x8724('0x53'):_0x4dcb06[_0x8724('0x13')]=_0x8724('0x39');if(_0xb3e99){_0x4dcb06[_0x8724('0x17')]=[{'name':'VoiceQueues'},{'name':'QueueCampaigns'}];}break;case _0x8724('0x54'):case _0x8724('0x55'):case _0x8724('0x56'):_0x4dcb06[_0x8724('0x13')]=_0x8724('0x31');if(_0xb3e99){_0x4dcb06[_0x8724('0x17')]=[{'name':_0x8724('0x57'),'filter':{'field':'role','value':['admin',_0x8724('0x58')]},'ignore':!![]},{'name':_0x8724('0x59')},{'name':_0x8724('0x34')}];}break;case'zendeskaccounts':_0x4dcb06[_0x8724('0x13')]='ZendeskAccount';break;case _0x8724('0x5a'):_0x4dcb06[_0x8724('0x13')]=_0x8724('0x5b');break;case _0x8724('0x5c'):_0x4dcb06['childModel']=_0x8724('0x5d');break;case _0x8724('0x5e'):_0x4dcb06[_0x8724('0x13')]=_0x8724('0x5f');break;case _0x8724('0x60'):_0x4dcb06[_0x8724('0x13')]='DeskAccount';break;case'zohoaccounts':_0x4dcb06[_0x8724('0x13')]=_0x8724('0x61');break;case'vtigeraccounts':_0x4dcb06['childModel']=_0x8724('0x31');break;case _0x8724('0x62'):_0x4dcb06['childModel']=_0x8724('0x63');break;case'dispositions':_0x4dcb06[_0x8724('0x13')]=_0x8724('0x64');break;case _0x8724('0x65'):_0x4dcb06[_0x8724('0x13')]='Dashboard';break;case'intervals':_0x4dcb06[_0x8724('0x13')]='Interval';break;case _0x8724('0x66'):_0x4dcb06['childModel']='Pause';break;case _0x8724('0x67'):_0x4dcb06['childModel']=_0x8724('0x68');break;case _0x8724('0x69'):_0x4dcb06[_0x8724('0x13')]=_0x8724('0x6a');break;case _0x8724('0x6b'):_0x4dcb06[_0x8724('0x13')]='Tag';break;case'templates':_0x4dcb06['childModel']=_0x8724('0x6c');break;case _0x8724('0x6d'):_0x4dcb06[_0x8724('0x13')]=_0x8724('0x6e');break;case _0x8724('0x6f'):_0x4dcb06[_0x8724('0x13')]=_0x8724('0x70');break;case _0x8724('0x71'):_0x4dcb06['childModel']=_0x8724('0x72');break;case'plugins':_0x4dcb06['childModel']=_0x8724('0x73');break;case _0x8724('0x74'):_0x4dcb06[_0x8724('0x13')]='AnalyticExtractedReport';_0x4dcb06[_0x8724('0x17')]=[{'name':_0x8724('0x75'),'field':'id','foreignKey':_0x8724('0x76')}];break;case _0x8724('0x77'):_0x4dcb06[_0x8724('0x13')]=_0x8724('0x78');break;}return _0x4dcb06;}function _0x17ef65(_0x39b40d,_0x1f2f77){var _0xd224d5=_0x39b40d[_0x8724('0x79')](0x0)[_0x8724('0x7a')]()+_0x39b40d[_0x8724('0x7b')](0x1);var _0x3f836c={'type':_0x3d465c[_0x8724('0x7c')][_0x8724('0x7d')][_0x8724('0x7e')],'raw':!![]};return new Promise(function(_0x2c959b,_0x23cbca){var _0x377f20=squel['select']()['field'](_0x8724('0x7f')+_0xd224d5+_0x8724('0x80'),'id')['field'](_0x8724('0x81'))[_0x8724('0x82')](_0x8724('0x83')+_0x39b40d+_0x8724('0x84'),'ui')[_0x8724('0x85')](_0x8724('0x86'),_0x1f2f77['id']);return _0x3d465c[_0x8724('0x87')]['query'](_0x377f20['toString'](),_0x3f836c)['then'](function(_0x5871f6){_0x1f2f77[_0xd224d5+'OpenTabs']=_0x5871f6;_0x2c959b(_0x5871f6);})[_0x8724('0x7')](function(_0x5381a5){_0x23cbca(_0x5381a5);});});}return _0x6226a2[_0x8724('0x88')]('UserProfile',attributes,{'tableName':'user_profiles','paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x434ac9){var _0x552c5b=require('../../components/parsers/qs');var _0x387a33={'raw':_0x434ac9[_0x8724('0x89')][_0x8724('0x8a')],'where':{}};var _0x3b6df5={};var _0x43b5c3={'count':0x0,'rows':[]};var _0x1b16f8=_0x434ac9[_0x8724('0x89')][_0x8724('0x8b')];var _0xfbbfea=_0x434ac9[_0x8724('0x89')][_0x8724('0x8c')]||![];var _0x3925fa=_0x102c1a(_0x1b16f8,_0xfbbfea);if(!_0x3925fa[_0x8724('0x13')])throw new Error(_0x8724('0x8d')+_0x1b16f8+'\x27');var _0x11e1a5=[{'name':_0x1b16f8}];if(!_[_0x8724('0x8e')](_0x3925fa['parentSections']))_0x11e1a5=_0x3925fa[_0x8724('0x17')];var _0x52b88d=[];for(var _0x1182fa=0x0;_0x1182fa<_0x11e1a5[_0x8724('0x8f')];_0x1182fa++){_0x52b88d[_0x8724('0x90')](_0x3d465c[_0x8724('0x91')]['find']({'where':{'userProfileId':_0x434ac9[_0x8724('0x92')]['id'],'name':_0x11e1a5[_0x1182fa][_0x8724('0xb')]},'raw':!![]}));}return Promise[_0x8724('0x93')](_0x52b88d)[_0x8724('0x5')](function(_0x61a15b){var _0x3749ab=_[_0x8724('0x2')](_0x61a15b,function(_0x2cd175){return _0x2cd175?_0x2cd175:undefined;});var _0x75bc21=_[_0x8724('0x2')](_0x11e1a5,[_0x8724('0x94'),!![]]);var _0x15541b=_[_0x8724('0x8e')](_0x3749ab)&&_['isEmpty'](_0x75bc21)?null:_[_0x8724('0x95')](_0x75bc21,_0x3749ab);if(!_0x15541b)return null;var _0x515d4a=[];for(var _0x2429af=0x0;_0x2429af<_0x15541b[_0x8724('0x8f')];_0x2429af++){var _0x5d185d=_[_0x8724('0x96')](_0x11e1a5,function(_0xf75bc1){return _0x15541b[_0x2429af]?_0xf75bc1['name']===_0x15541b[_0x2429af]['name']:null;});if(_0x5d185d){if(_0x15541b[_0x2429af][_0x8724('0x94')]){_0x515d4a['push'](_0x3fc85e(_0x3925fa[_0x8724('0x13')],_0x15541b[_0x2429af]));}else{if(!_0x15541b[_0x2429af][_0x8724('0x97')]){_0x515d4a['push'](_0x24fcc8(_0x5d185d,_0x15541b[_0x2429af],_0x3925fa['childModel']));}else{if(_0x5d185d[_0x8724('0x9')]){_0x515d4a[_0x8724('0x90')](_0x5e4910(_0x5d185d,_0x15541b[_0x2429af]));}}}}}return Promise[_0x8724('0x93')](_0x515d4a);})[_0x8724('0x5')](function(_0xb40d14){var _0x555b9c=_0xb40d14;var _0x57ecc1=null;if(_0x555b9c){_0x57ecc1=_0x555b9c[_0x8724('0x8f')]===0x1?_0x555b9c[0x0]:null;}if(!_0x57ecc1&&!_0x555b9c)return _0x43b5c3;var _0xf7b05=_0x3d465c[_0x3925fa[_0x8724('0x13')]][_0x8724('0x98')];_0x3b6df5[_0x8724('0x9')]=_[_0x8724('0x99')](_0xf7b05);_0x3b6df5['query']=_['keys'](_0x434ac9[_0x8724('0x89')]);_0x3b6df5[_0x8724('0x9a')]=_[_0x8724('0x9b')](_0x3b6df5[_0x8724('0x9')],_0x3b6df5[_0x8724('0x89')]);_0x387a33[_0x8724('0x9c')]=_[_0x8724('0x9b')](_0x3b6df5[_0x8724('0x9')],_0x552c5b[_0x8724('0x9d')](_0x434ac9[_0x8724('0x89')][_0x8724('0x9d')]));_0x387a33[_0x8724('0x9c')]=_0x387a33[_0x8724('0x9c')][_0x8724('0x8f')]?_0x387a33[_0x8724('0x9c')]:_0x3b6df5[_0x8724('0x9')];if(!_0x434ac9[_0x8724('0x89')][_0x8724('0x9e')]('nolimit')){_0x387a33[_0x8724('0x9f')]=_0x552c5b[_0x8724('0x9f')](_0x434ac9[_0x8724('0x89')][_0x8724('0x9f')]);_0x387a33[_0x8724('0xa0')]=_0x552c5b[_0x8724('0xa0')](_0x434ac9[_0x8724('0x89')][_0x8724('0xa0')]);}_0x387a33['order']=_0x552c5b[_0x8724('0xa1')](_0x434ac9[_0x8724('0x89')]['sort']);_0x387a33[_0x8724('0x85')]=_0x552c5b['filters'](_[_0x8724('0xa2')](_0x434ac9[_0x8724('0x89')],_0x3b6df5[_0x8724('0x9a')]));if(_0x434ac9[_0x8724('0x89')][_0x8724('0x2')]){_0x387a33['where']=_[_0x8724('0xa3')](_0x387a33[_0x8724('0x85')],{'$or':_['map'](_0xf7b05,function(_0x184681){if(_0x184681[_0x8724('0x37')][_0x8724('0xa4')]!==_0x8724('0xa5')){var _0x4aed06={};_0x4aed06[_0x184681[_0x8724('0x3')]]={'$like':'%'+_0x434ac9[_0x8724('0x89')][_0x8724('0x2')]+'%'};return _0x4aed06;}})});}var _0x5ebd2c=[];var _0x3bfb4e=null;var _0xd766b4={};if(_0x57ecc1){_0x3bfb4e=_['find'](_0x11e1a5,['name',_0x57ecc1[_0x8724('0xb')]]);if(_0x3bfb4e[_0x8724('0x3')]){_0xd766b4={};if(_0x3925fa[_0x8724('0x13')]===_0x8724('0xe')){_0xd766b4[_0x3bfb4e['foreignKey']]=_[_0x8724('0x6')](_0x57ecc1[_0x8724('0xa')],'id');}else{_0xd766b4[_0x3bfb4e['foreignKey']]=_0x57ecc1[_0x8724('0xa')];}_0x5ebd2c['push'](_0xd766b4);}else{_0x387a33[_0x8724('0x85')]['id']=_0x57ecc1[_0x8724('0xa')];}}else{for(var _0x443d1e=0x0;_0x443d1e<_0x555b9c[_0x8724('0x8f')];_0x443d1e++){_0x3bfb4e=_[_0x8724('0x96')](_0x11e1a5,[_0x8724('0xb'),_0x555b9c[_0x443d1e][_0x8724('0xb')]]);if(_0x3bfb4e[_0x8724('0x3')]){_0xd766b4={};_0xd766b4[_0x3bfb4e[_0x8724('0xa6')]]=_0x555b9c[_0x443d1e][_0x8724('0xa')];_0x5ebd2c[_0x8724('0x90')](_0xd766b4);}else{if(!_0x387a33[_0x8724('0x85')]['id'])_0x387a33[_0x8724('0x85')]['id']=[];_0x555b9c[_0x443d1e][_0x8724('0xa')][_0x8724('0xa7')](function(_0x4dd73b){_0x387a33[_0x8724('0x85')]['id']['push'](_0x4dd73b);});}}}if(!_[_0x8724('0x8e')](_0x5ebd2c)){_0x387a33[_0x8724('0x85')]=_['merge'](_0x387a33['where'],{'$and':{'$or':_0x5ebd2c}});}_0x387a33=_['merge']({},_0x387a33,_0x434ac9['options']);if(_0x57ecc1&&!_0x57ecc1[_0x8724('0x97')]&&_0x3925fa[_0x8724('0x13')]==='AnalyticExtractedReport'){if(_0x434ac9[_0x8724('0x89')][_0x8724('0xa8')]){_0x387a33[_0x8724('0xa9')]=[{'all':!![]}];}return _0x3d465c[_0x3925fa['childModel']][_0x8724('0x4')](_0x387a33)[_0x8724('0x5')](function(_0x34f8b6){var _0x39b96e=[];_0x34f8b6[_0x8724('0xa7')](function(_0x2d6bdf){var _0x4f8168;switch(_0x2d6bdf[_0x8724('0xaa')]){case _0x8724('0xab'):_0x4f8168=_[_0x8724('0x96')](_0x57ecc1[_0x8724('0xa')],function(_0x43b338){return _0x43b338['id']===_0x2d6bdf['reportId']&&_0x43b338[_0x8724('0x37')]===_0x8724('0xac');});break;case _0x8724('0xad'):_0x4f8168=_[_0x8724('0x96')](_0x57ecc1[_0x8724('0xa')],function(_0x5697ff){return _0x5697ff['id']===_0x2d6bdf[_0x8724('0x76')]&&_0x5697ff[_0x8724('0x37')]===_0x8724('0xae');});break;}if(_0x4f8168)_0x39b96e[_0x8724('0x90')](_0x2d6bdf);});_0x43b5c3['count']=_0x39b96e[_0x8724('0x8f')];_0x43b5c3[_0x8724('0xaf')]=_0x39b96e;return _0x43b5c3;});}else{if(!_[_0x8724('0x8e')](_0x434ac9[_0x8724('0x89')][_0x8724('0xb0')])){_0x387a33[_0x8724('0x85')]['id']=_0x387a33[_0x8724('0x85')]['id']?_[_0x8724('0x9b')](_0x387a33[_0x8724('0x85')]['id'],_0x434ac9['query']['ids']):_0x434ac9[_0x8724('0x89')]['ids'];if(_0x434ac9['query'][_0x8724('0xb1')]){_0x387a33[_0x8724('0xb2')]=_0x434ac9[_0x8724('0x89')]['customSorting'];}}if(_0x434ac9[_0x8724('0x89')][_0x8724('0xb3')]){_0x387a33[_0x8724('0x85')]=_[_0x8724('0xa3')](_0x387a33['where'],{'$and':_0x434ac9['query'][_0x8724('0xb3')]});}return _0x3d465c[_0x3925fa['childModel']][_0x8724('0xb4')]({'where':_0x387a33[_0x8724('0x85')]})['then'](function(_0x47bcd4){_0x43b5c3['count']=_0x47bcd4;if(_0x434ac9[_0x8724('0x89')][_0x8724('0xa8')]){if(_0x3925fa['childModel']===_0x8724('0x1c')){_0x387a33[_0x8724('0xa9')]=[{'model':_0x3d465c['Tag'],'as':'Tags','attributes':['id',_0x8724('0xb'),_0x8724('0xb5')],'required':_0x434ac9[_0x8724('0x89')]['tag']?!![]:![]},{'model':_0x3d465c[_0x8724('0xb6')],'as':'ThroughTags','attributes':['id',_0x8724('0xb'),_0x8724('0xb5')],'through':_0x434ac9[_0x8724('0x89')]['tag']?{'attributes':[],'where':{'TagId':_0x434ac9[_0x8724('0x89')]['tag']||undefined}}:{},'required':_0x434ac9[_0x8724('0x89')][_0x8724('0xb7')]?!![]:![]}];}else{_0x387a33[_0x8724('0xa9')]=[{'all':!![]}];}}return _0x3d465c[_0x3925fa[_0x8724('0x13')]][_0x8724('0x4')](_0x387a33);})[_0x8724('0x5')](function(_0x41e0eb){_0x43b5c3['rows']=_0x41e0eb;if(_0x1b16f8===_0x8724('0x59')&&_0x434ac9[_0x8724('0x89')]['openTabs']==='true'){var _0x54f3fd=[];for(var _0xf30a4b=0x0;_0xf30a4b<_0x43b5c3[_0x8724('0xaf')]['length'];_0xf30a4b++){_0x54f3fd['push'](_0x17ef65(_0x8724('0xb8'),_0x43b5c3[_0x8724('0xaf')][_0xf30a4b][_0x8724('0xb9')]));_0x54f3fd['push'](_0x17ef65(_0x8724('0xba'),_0x43b5c3['rows'][_0xf30a4b][_0x8724('0xb9')]));_0x54f3fd[_0x8724('0x90')](_0x17ef65('fax',_0x43b5c3['rows'][_0xf30a4b]['dataValues']));_0x54f3fd[_0x8724('0x90')](_0x17ef65(_0x8724('0xbb'),_0x43b5c3[_0x8724('0xaf')][_0xf30a4b][_0x8724('0xb9')]));_0x54f3fd[_0x8724('0x90')](_0x17ef65(_0x8724('0xbc'),_0x43b5c3[_0x8724('0xaf')][_0xf30a4b][_0x8724('0xb9')]));_0x54f3fd[_0x8724('0x90')](_0x17ef65('whatsapp',_0x43b5c3['rows'][_0xf30a4b][_0x8724('0xb9')]));}return Promise[_0x8724('0x93')](_0x54f3fd)[_0x8724('0x5')](function(){return _0x43b5c3;});}return _0x43b5c3;});}});}}});}; \ No newline at end of file +var _0x80c0=['ZendeskAccount','SalesforceAccount','freshdeskaccounts','FreshdeskAccount','sugarcrmaccounts','SugarcrmAccount','DeskAccount','ZohoAccount','cannedanswers','CannedAnswer','dispositions','Disposition','customdashboards','Dashboard','intervals','Pause','scheduler','Sound','tags','Tag','templates','Template','triggers','trunks','Trunk','variables','plugins','Plugin','extractedreports','Reports','reportId','metrics','charAt','toUpperCase','slice','Sequelize','SELECT','ui.','ui.createdAt','from','user_has_','_interactions','ui.UserId\x20=\x20?','sequelize','query','define','UserProfile','user_profiles','raw','section','mergeResources','Invalid\x20section\x20\x27','isEmpty','length','push','UserProfileSection','find','params','all','ignore','union','keys','intersection','attributes','hasOwnProperty','nolimit','limit','offset','order','sort','where','pick','filters','merge','key','VIRTUAL','foreignKey','options','autoAssociation','includeAll','include','reportType','DefaultReports','CustomReports','rows','ids','customSorting','extraQueryConditions','count','CmContact','Tags','ThroughTags','color','tag','openTabs','true','chat','dataValues','sms','fax','mail','openchannel','whatsapp','lodash','squel','models','filter','field','findAll','then','associatedResources','map','catch','model','AnalyticExtractedReport','resourceId','type','toLowerCase','squareprojects','childModel','SquareProject','odbc','SquareOdbc','squarerecordings','SquareRecording','SquareProjects','name','projectName','JscriptyProject','parentSections','Lists','ListId','lists','CmList','chatqueues','chatwebsites','ChatWebsite','FaxQueue','faxaccounts','FaxAccount','inboundroutes','internalroutes','outboundroutes','VoiceContext','voicemails','VoiceMail','voicerecordings','VoiceRecording','membername','User','role','agent','Telephones','VoiceQueues','queue','VoiceQueue','inbound','QueueCampaigns','VoiceMusicOnHold','chanspies','VoiceChanSpy','voiceprefixes','ivrcampaigns','mailqueues','MailQueue','mailsubstatuses','MailSubstatus','openchannelqueues','openchannelaccounts','OpenchannelAccount','smsqueues','SmsQueue','smsaccounts','whatsappqueues','WhatsappQueue','whatsappaccounts','WhatsappAccount','voicequeues','queuecampaigns','users','agents','telephones','Users','admin','user','Agents','zendeskaccounts'];(function(_0x46aff0,_0x122890){var _0x9d78cf=function(_0x3f14cb){while(--_0x3f14cb){_0x46aff0['push'](_0x46aff0['shift']());}};_0x9d78cf(++_0x122890);}(_0x80c0,0x122));var _0x080c=function(_0xbca836,_0x46bbcf){_0xbca836=_0xbca836-0x0;var _0x1e53dc=_0x80c0[_0xbca836];return _0x1e53dc;};'use strict';var _=require(_0x080c('0x0'));var attributes=require('./userProfile.attributes');var squel=require(_0x080c('0x1'));module['exports']=function(_0x58c5e0){var _0x4f4f68=_0x58c5e0[_0x080c('0x2')];function _0x22324c(_0x4eb997,_0x355de9){return new Promise(function(_0x4e4052,_0x48f871){if(!_0x355de9)return _0x4e4052(null);var _0x40ee2b=_0x355de9[_0x080c('0x3')]?{[_0x355de9[_0x080c('0x3')][_0x080c('0x4')]]:_0x355de9[_0x080c('0x3')]['value']}:undefined;return _0x4f4f68[_0x4eb997][_0x080c('0x5')]({'where':_0x40ee2b,'raw':!![]})[_0x080c('0x6')](function(_0x55461c){_0x355de9[_0x080c('0x7')]=_[_0x080c('0x8')](_0x55461c,'id');_0x4e4052(_0x355de9);})[_0x080c('0x9')](function(_0x5a4f20){_0x48f871(_0x5a4f20);});});}function _0x2ba79e(_0x41c56d,_0x4de421){return new Promise(function(_0x45ef41,_0x28a934){var _0xcc05fc=_0x41c56d[_0x080c('0x3')]?{[_0x41c56d[_0x080c('0x3')]['field']]:_0x41c56d[_0x080c('0x3')]['value']}:undefined;return _0x4f4f68[_0x41c56d[_0x080c('0xa')]][_0x080c('0x5')]({'where':_0xcc05fc,'raw':!![]})['then'](function(_0x540069){_0x4de421['associatedResources']=_[_0x080c('0x8')](_0x540069,function(_0xfd93d8){return _0xfd93d8['name'];});_0x45ef41(_0x4de421);})[_0x080c('0x9')](function(_0x130414){_0x28a934(_0x130414);});});}function _0x5b11db(_0x27c7e8,_0x5066f7,_0x3317a8){if(!_0x5066f7)return Promise['resolve'](null);return new Promise(function(_0x2d5409,_0x5429d0){return _0x4f4f68['UserProfileResource'][_0x080c('0x5')]({'where':{'sectionId':_0x5066f7['id']},'raw':!![]})[_0x080c('0x6')](function(_0x543f67){if(_0x27c7e8['field']&&_0x27c7e8[_0x080c('0x4')]!=='id'){_0x5066f7[_0x080c('0x7')]=_[_0x080c('0x8')](_0x543f67,function(_0x45f801){return _0x45f801[_0x27c7e8[_0x080c('0x4')]];});}else{if(_0x3317a8===_0x080c('0xb')){_0x5066f7[_0x080c('0x7')]=_['map'](_0x543f67,function(_0x4f66fc){return{'id':_0x4f66fc[_0x080c('0xc')],'type':_0x4f66fc[_0x080c('0xd')]};});}else{_0x5066f7['associatedResources']=_[_0x080c('0x8')](_0x543f67,function(_0x5aafc2){return _0x5aafc2[_0x080c('0xc')];});}}_0x2d5409(_0x5066f7);})[_0x080c('0x9')](function(_0x315a14){_0x5429d0(_0x315a14);});});}function _0x1017e4(_0x4a5c6a,_0x1a2c15){var _0x2adaaf={'parentSections':[]};switch(_0x4a5c6a[_0x080c('0xe')]()){case _0x080c('0xf'):_0x2adaaf[_0x080c('0x10')]=_0x080c('0x11');break;case _0x080c('0x12'):_0x2adaaf[_0x080c('0x10')]=_0x080c('0x13');break;case _0x080c('0x14'):_0x2adaaf[_0x080c('0x10')]=_0x080c('0x15');_0x2adaaf['parentSections']=[{'name':_0x080c('0x16'),'field':_0x080c('0x17'),'foreignKey':_0x080c('0x18')}];break;case'projects':_0x2adaaf[_0x080c('0x10')]=_0x080c('0x19');break;case'contacts':_0x2adaaf[_0x080c('0x10')]='CmContact';_0x2adaaf[_0x080c('0x1a')]=[{'name':_0x080c('0x1b'),'field':'id','foreignKey':_0x080c('0x1c')}];break;case _0x080c('0x1d'):_0x2adaaf[_0x080c('0x10')]=_0x080c('0x1e');break;case'companies':_0x2adaaf[_0x080c('0x10')]='CmCompany';break;case'globalcustomfields':_0x2adaaf['childModel']='CmCustomField';break;case _0x080c('0x1f'):_0x2adaaf[_0x080c('0x10')]='ChatQueue';break;case _0x080c('0x20'):_0x2adaaf[_0x080c('0x10')]=_0x080c('0x21');break;case'faxqueues':_0x2adaaf[_0x080c('0x10')]=_0x080c('0x22');break;case _0x080c('0x23'):_0x2adaaf[_0x080c('0x10')]=_0x080c('0x24');break;case _0x080c('0x25'):case _0x080c('0x26'):case _0x080c('0x27'):_0x2adaaf[_0x080c('0x10')]='VoiceExtension';break;case'contexts':_0x2adaaf[_0x080c('0x10')]=_0x080c('0x28');break;case _0x080c('0x29'):_0x2adaaf['childModel']=_0x080c('0x2a');break;case _0x080c('0x2b'):_0x2adaaf[_0x080c('0x10')]=_0x080c('0x2c');_0x2adaaf['parentSections']=[{'name':'Agents','field':_0x080c('0x17'),'foreignKey':_0x080c('0x2d'),'model':_0x080c('0x2e'),'filter':{'field':_0x080c('0x2f'),'value':[_0x080c('0x30')]}},{'name':_0x080c('0x31'),'field':_0x080c('0x17'),'foreignKey':_0x080c('0x2d'),'model':_0x080c('0x2e'),'filter':{'field':_0x080c('0x2f'),'value':['telephone']}},{'name':_0x080c('0x32'),'field':_0x080c('0x17'),'foreignKey':_0x080c('0x33'),'model':_0x080c('0x34'),'filter':{'field':_0x080c('0xd'),'value':[_0x080c('0x35')]}},{'name':_0x080c('0x36'),'field':_0x080c('0x17'),'foreignKey':_0x080c('0x33'),'model':_0x080c('0x34'),'filter':{'field':_0x080c('0xd'),'value':['outbound']}}];break;case'musiconholds':_0x2adaaf[_0x080c('0x10')]=_0x080c('0x37');break;case _0x080c('0x38'):_0x2adaaf[_0x080c('0x10')]=_0x080c('0x39');break;case _0x080c('0x3a'):_0x2adaaf[_0x080c('0x10')]='VoicePrefix';break;case _0x080c('0x3b'):_0x2adaaf[_0x080c('0x10')]='Campaign';break;case _0x080c('0x3c'):_0x2adaaf[_0x080c('0x10')]=_0x080c('0x3d');break;case'mailaccounts':_0x2adaaf['childModel']='MailAccount';break;case _0x080c('0x3e'):_0x2adaaf['childModel']=_0x080c('0x3f');break;case _0x080c('0x40'):_0x2adaaf[_0x080c('0x10')]='OpenchannelQueue';break;case _0x080c('0x41'):_0x2adaaf[_0x080c('0x10')]=_0x080c('0x42');break;case _0x080c('0x43'):_0x2adaaf[_0x080c('0x10')]=_0x080c('0x44');break;case _0x080c('0x45'):_0x2adaaf['childModel']='SmsAccount';break;case _0x080c('0x46'):_0x2adaaf[_0x080c('0x10')]=_0x080c('0x47');break;case _0x080c('0x48'):_0x2adaaf['childModel']=_0x080c('0x49');break;case'teams':_0x2adaaf[_0x080c('0x10')]='Team';break;case _0x080c('0x4a'):case _0x080c('0x4b'):_0x2adaaf[_0x080c('0x10')]=_0x080c('0x34');if(_0x1a2c15){_0x2adaaf[_0x080c('0x1a')]=[{'name':'VoiceQueues'},{'name':_0x080c('0x36')}];}break;case _0x080c('0x4c'):case _0x080c('0x4d'):case _0x080c('0x4e'):_0x2adaaf[_0x080c('0x10')]=_0x080c('0x2e');if(_0x1a2c15){_0x2adaaf[_0x080c('0x1a')]=[{'name':_0x080c('0x4f'),'filter':{'field':'role','value':[_0x080c('0x50'),_0x080c('0x51')]},'ignore':!![]},{'name':_0x080c('0x52')},{'name':_0x080c('0x31')}];}break;case _0x080c('0x53'):_0x2adaaf['childModel']=_0x080c('0x54');break;case'salesforceaccounts':_0x2adaaf['childModel']=_0x080c('0x55');break;case _0x080c('0x56'):_0x2adaaf[_0x080c('0x10')]=_0x080c('0x57');break;case _0x080c('0x58'):_0x2adaaf[_0x080c('0x10')]=_0x080c('0x59');break;case'deskaccounts':_0x2adaaf[_0x080c('0x10')]=_0x080c('0x5a');break;case'zohoaccounts':_0x2adaaf[_0x080c('0x10')]=_0x080c('0x5b');break;case'vtigeraccounts':_0x2adaaf['childModel']=_0x080c('0x2e');break;case _0x080c('0x5c'):_0x2adaaf['childModel']=_0x080c('0x5d');break;case _0x080c('0x5e'):_0x2adaaf[_0x080c('0x10')]=_0x080c('0x5f');break;case _0x080c('0x60'):_0x2adaaf[_0x080c('0x10')]=_0x080c('0x61');break;case _0x080c('0x62'):_0x2adaaf[_0x080c('0x10')]='Interval';break;case'pauses':_0x2adaaf[_0x080c('0x10')]=_0x080c('0x63');break;case _0x080c('0x64'):_0x2adaaf[_0x080c('0x10')]='Schedule';break;case'sounds':_0x2adaaf['childModel']=_0x080c('0x65');break;case _0x080c('0x66'):_0x2adaaf[_0x080c('0x10')]=_0x080c('0x67');break;case _0x080c('0x68'):_0x2adaaf['childModel']=_0x080c('0x69');break;case _0x080c('0x6a'):_0x2adaaf['childModel']='Trigger';break;case _0x080c('0x6b'):_0x2adaaf['childModel']=_0x080c('0x6c');break;case _0x080c('0x6d'):_0x2adaaf[_0x080c('0x10')]='Variable';break;case _0x080c('0x6e'):_0x2adaaf[_0x080c('0x10')]=_0x080c('0x6f');break;case _0x080c('0x70'):_0x2adaaf[_0x080c('0x10')]='AnalyticExtractedReport';_0x2adaaf['parentSections']=[{'name':_0x080c('0x71'),'field':'id','foreignKey':_0x080c('0x72')}];break;case _0x080c('0x73'):_0x2adaaf[_0x080c('0x10')]='AnalyticMetric';break;}return _0x2adaaf;}function _0x4b4256(_0x184d6d,_0x2a3bf6){var _0x54fe5f=_0x184d6d[_0x080c('0x74')](0x0)[_0x080c('0x75')]()+_0x184d6d[_0x080c('0x76')](0x1);var _0x4b5b1b={'type':_0x4f4f68[_0x080c('0x77')]['QueryTypes'][_0x080c('0x78')],'raw':!![]};return new Promise(function(_0x58d3ff,_0x2d2b43){var _0x5edd87=squel['select']()['field'](_0x080c('0x79')+_0x54fe5f+'InteractionId','id')[_0x080c('0x4')](_0x080c('0x7a'))[_0x080c('0x7b')](_0x080c('0x7c')+_0x184d6d+_0x080c('0x7d'),'ui')['where'](_0x080c('0x7e'),_0x2a3bf6['id']);return _0x4f4f68[_0x080c('0x7f')][_0x080c('0x80')](_0x5edd87['toString'](),_0x4b5b1b)[_0x080c('0x6')](function(_0x1f41f7){_0x2a3bf6[_0x54fe5f+'OpenTabs']=_0x1f41f7;_0x58d3ff(_0x1f41f7);})[_0x080c('0x9')](function(_0x260a60){_0x2d2b43(_0x260a60);});});}return _0x58c5e0[_0x080c('0x81')](_0x080c('0x82'),attributes,{'tableName':_0x080c('0x83'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x386a71){var _0x4cb2ac=require('../../components/parsers/qs');var _0x383da6={'raw':_0x386a71['query'][_0x080c('0x84')],'where':{}};var _0x5d1967={};var _0x16693d={'count':0x0,'rows':[]};var _0x5adcbf=_0x386a71['query'][_0x080c('0x85')];var _0x143553=_0x386a71[_0x080c('0x80')][_0x080c('0x86')]||![];var _0x3beb5b=_0x1017e4(_0x5adcbf,_0x143553);if(!_0x3beb5b[_0x080c('0x10')])throw new Error(_0x080c('0x87')+_0x5adcbf+'\x27');var _0x2ad1c7=[{'name':_0x5adcbf}];if(!_[_0x080c('0x88')](_0x3beb5b[_0x080c('0x1a')]))_0x2ad1c7=_0x3beb5b['parentSections'];var _0x303314=[];for(var _0xc8faa6=0x0;_0xc8faa6<_0x2ad1c7[_0x080c('0x89')];_0xc8faa6++){_0x303314[_0x080c('0x8a')](_0x4f4f68[_0x080c('0x8b')][_0x080c('0x8c')]({'where':{'userProfileId':_0x386a71[_0x080c('0x8d')]['id'],'name':_0x2ad1c7[_0xc8faa6][_0x080c('0x17')]},'raw':!![]}));}return Promise[_0x080c('0x8e')](_0x303314)[_0x080c('0x6')](function(_0x216069){var _0xdc1de5=_[_0x080c('0x3')](_0x216069,function(_0x4e5bb0){return _0x4e5bb0?_0x4e5bb0:undefined;});var _0x1e0033=_['filter'](_0x2ad1c7,[_0x080c('0x8f'),!![]]);var _0x11a901=_['isEmpty'](_0xdc1de5)&&_['isEmpty'](_0x1e0033)?null:_[_0x080c('0x90')](_0x1e0033,_0xdc1de5);if(!_0x11a901)return null;var _0x53001c=[];for(var _0x4f9d88=0x0;_0x4f9d88<_0x11a901[_0x080c('0x89')];_0x4f9d88++){var _0xda3715=_[_0x080c('0x8c')](_0x2ad1c7,function(_0x13658b){return _0x11a901[_0x4f9d88]?_0x13658b[_0x080c('0x17')]===_0x11a901[_0x4f9d88]['name']:null;});if(_0xda3715){if(_0x11a901[_0x4f9d88][_0x080c('0x8f')]){_0x53001c['push'](_0x22324c(_0x3beb5b[_0x080c('0x10')],_0x11a901[_0x4f9d88]));}else{if(!_0x11a901[_0x4f9d88]['autoAssociation']){_0x53001c[_0x080c('0x8a')](_0x5b11db(_0xda3715,_0x11a901[_0x4f9d88],_0x3beb5b[_0x080c('0x10')]));}else{if(_0xda3715['model']){_0x53001c['push'](_0x2ba79e(_0xda3715,_0x11a901[_0x4f9d88]));}}}}}return Promise[_0x080c('0x8e')](_0x53001c);})[_0x080c('0x6')](function(_0xe6d0a7){var _0x24d43f=_0xe6d0a7;var _0x56ea2c=null;if(_0x24d43f){_0x56ea2c=_0x24d43f['length']===0x1?_0x24d43f[0x0]:null;}if(!_0x56ea2c&&!_0x24d43f)return _0x16693d;var _0x306c52=_0x4f4f68[_0x3beb5b['childModel']]['rawAttributes'];_0x5d1967[_0x080c('0xa')]=_[_0x080c('0x91')](_0x306c52);_0x5d1967['query']=_[_0x080c('0x91')](_0x386a71[_0x080c('0x80')]);_0x5d1967['filters']=_[_0x080c('0x92')](_0x5d1967[_0x080c('0xa')],_0x5d1967[_0x080c('0x80')]);_0x383da6[_0x080c('0x93')]=_['intersection'](_0x5d1967[_0x080c('0xa')],_0x4cb2ac['fields'](_0x386a71[_0x080c('0x80')]['fields']));_0x383da6[_0x080c('0x93')]=_0x383da6[_0x080c('0x93')][_0x080c('0x89')]?_0x383da6[_0x080c('0x93')]:_0x5d1967[_0x080c('0xa')];if(!_0x386a71[_0x080c('0x80')][_0x080c('0x94')](_0x080c('0x95'))){_0x383da6[_0x080c('0x96')]=_0x4cb2ac[_0x080c('0x96')](_0x386a71[_0x080c('0x80')][_0x080c('0x96')]);_0x383da6['offset']=_0x4cb2ac['offset'](_0x386a71[_0x080c('0x80')][_0x080c('0x97')]);}_0x383da6[_0x080c('0x98')]=_0x4cb2ac[_0x080c('0x99')](_0x386a71['query'][_0x080c('0x99')]);_0x383da6[_0x080c('0x9a')]=_0x4cb2ac['filters'](_[_0x080c('0x9b')](_0x386a71[_0x080c('0x80')],_0x5d1967[_0x080c('0x9c')]));if(_0x386a71[_0x080c('0x80')][_0x080c('0x3')]){_0x383da6[_0x080c('0x9a')]=_[_0x080c('0x9d')](_0x383da6[_0x080c('0x9a')],{'$or':_['map'](_0x306c52,function(_0x5d2a43){if(_0x5d2a43[_0x080c('0xd')][_0x080c('0x9e')]!==_0x080c('0x9f')){var _0x1fee65={};_0x1fee65[_0x5d2a43[_0x080c('0x4')]]={'$like':'%'+_0x386a71['query'][_0x080c('0x3')]+'%'};return _0x1fee65;}})});}var _0x2ce979=[];var _0x46d786=null;var _0x2fd514={};if(_0x56ea2c){_0x46d786=_['find'](_0x2ad1c7,[_0x080c('0x17'),_0x56ea2c[_0x080c('0x17')]]);if(_0x46d786['field']){_0x2fd514={};if(_0x3beb5b[_0x080c('0x10')]==='AnalyticExtractedReport'){_0x2fd514[_0x46d786[_0x080c('0xa0')]]=_[_0x080c('0x8')](_0x56ea2c[_0x080c('0x7')],'id');}else{_0x2fd514[_0x46d786['foreignKey']]=_0x56ea2c[_0x080c('0x7')];}_0x2ce979[_0x080c('0x8a')](_0x2fd514);}else{_0x383da6[_0x080c('0x9a')]['id']=_0x56ea2c[_0x080c('0x7')];}}else{for(var _0x14b881=0x0;_0x14b881<_0x24d43f[_0x080c('0x89')];_0x14b881++){_0x46d786=_[_0x080c('0x8c')](_0x2ad1c7,[_0x080c('0x17'),_0x24d43f[_0x14b881]['name']]);if(_0x46d786['field']){_0x2fd514={};_0x2fd514[_0x46d786[_0x080c('0xa0')]]=_0x24d43f[_0x14b881][_0x080c('0x7')];_0x2ce979[_0x080c('0x8a')](_0x2fd514);}else{if(!_0x383da6[_0x080c('0x9a')]['id'])_0x383da6[_0x080c('0x9a')]['id']=[];_0x24d43f[_0x14b881]['associatedResources']['forEach'](function(_0x29d4fe){_0x383da6[_0x080c('0x9a')]['id']['push'](_0x29d4fe);});}}}if(!_[_0x080c('0x88')](_0x2ce979)){_0x383da6[_0x080c('0x9a')]=_['merge'](_0x383da6[_0x080c('0x9a')],{'$and':{'$or':_0x2ce979}});}_0x383da6=_[_0x080c('0x9d')]({},_0x383da6,_0x386a71[_0x080c('0xa1')]);if(_0x56ea2c&&!_0x56ea2c[_0x080c('0xa2')]&&_0x3beb5b[_0x080c('0x10')]==='AnalyticExtractedReport'){if(_0x386a71[_0x080c('0x80')][_0x080c('0xa3')]){_0x383da6[_0x080c('0xa4')]=[{'all':!![]}];}return _0x4f4f68[_0x3beb5b[_0x080c('0x10')]][_0x080c('0x5')](_0x383da6)[_0x080c('0x6')](function(_0x1c698b){var _0x4d1a9f=[];_0x1c698b['forEach'](function(_0x545ffa){var _0x2bf30d;switch(_0x545ffa[_0x080c('0xa5')]){case'default':_0x2bf30d=_[_0x080c('0x8c')](_0x56ea2c[_0x080c('0x7')],function(_0x5280b7){return _0x5280b7['id']===_0x545ffa[_0x080c('0x72')]&&_0x5280b7['type']===_0x080c('0xa6');});break;case'custom':_0x2bf30d=_[_0x080c('0x8c')](_0x56ea2c[_0x080c('0x7')],function(_0x190f26){return _0x190f26['id']===_0x545ffa['reportId']&&_0x190f26['type']===_0x080c('0xa7');});break;}if(_0x2bf30d)_0x4d1a9f[_0x080c('0x8a')](_0x545ffa);});_0x16693d['count']=_0x4d1a9f[_0x080c('0x89')];_0x16693d[_0x080c('0xa8')]=_0x4d1a9f;return _0x16693d;});}else{if(!_[_0x080c('0x88')](_0x386a71[_0x080c('0x80')][_0x080c('0xa9')])){_0x383da6[_0x080c('0x9a')]['id']=_0x383da6[_0x080c('0x9a')]['id']?_[_0x080c('0x92')](_0x383da6[_0x080c('0x9a')]['id'],_0x386a71['query'][_0x080c('0xa9')]):_0x386a71[_0x080c('0x80')][_0x080c('0xa9')];if(_0x386a71[_0x080c('0x80')][_0x080c('0xaa')]){_0x383da6[_0x080c('0x98')]=_0x386a71[_0x080c('0x80')][_0x080c('0xaa')];}}if(_0x386a71['query'][_0x080c('0xab')]){_0x383da6[_0x080c('0x9a')]=_[_0x080c('0x9d')](_0x383da6[_0x080c('0x9a')],{'$and':_0x386a71[_0x080c('0x80')][_0x080c('0xab')]});}return _0x4f4f68[_0x3beb5b[_0x080c('0x10')]][_0x080c('0xac')]({'where':_0x383da6[_0x080c('0x9a')]})[_0x080c('0x6')](function(_0x47a8e2){_0x16693d[_0x080c('0xac')]=_0x47a8e2;if(_0x386a71[_0x080c('0x80')][_0x080c('0xa3')]){if(_0x3beb5b[_0x080c('0x10')]===_0x080c('0xad')){_0x383da6['include']=[{'model':_0x4f4f68[_0x080c('0x67')],'as':_0x080c('0xae'),'attributes':['id',_0x080c('0x17'),'color'],'required':_0x386a71[_0x080c('0x80')]['tag']?!![]:![]},{'model':_0x4f4f68['Tag'],'as':_0x080c('0xaf'),'attributes':['id','name',_0x080c('0xb0')],'through':_0x386a71['query'][_0x080c('0xb1')]?{'attributes':[],'where':{'TagId':_0x386a71[_0x080c('0x80')][_0x080c('0xb1')]||undefined}}:{},'required':_0x386a71[_0x080c('0x80')][_0x080c('0xb1')]?!![]:![]}];}else{_0x383da6['include']=[{'all':!![]}];}}return _0x4f4f68[_0x3beb5b['childModel']]['findAll'](_0x383da6);})[_0x080c('0x6')](function(_0xe135d0){_0x16693d[_0x080c('0xa8')]=_0xe135d0;if(_0x5adcbf===_0x080c('0x52')&&_0x386a71[_0x080c('0x80')][_0x080c('0xb2')]===_0x080c('0xb3')){var _0x3ab794=[];for(var _0x3579bc=0x0;_0x3579bc<_0x16693d[_0x080c('0xa8')][_0x080c('0x89')];_0x3579bc++){_0x3ab794[_0x080c('0x8a')](_0x4b4256(_0x080c('0xb4'),_0x16693d[_0x080c('0xa8')][_0x3579bc][_0x080c('0xb5')]));_0x3ab794[_0x080c('0x8a')](_0x4b4256(_0x080c('0xb6'),_0x16693d[_0x080c('0xa8')][_0x3579bc]['dataValues']));_0x3ab794[_0x080c('0x8a')](_0x4b4256(_0x080c('0xb7'),_0x16693d[_0x080c('0xa8')][_0x3579bc][_0x080c('0xb5')]));_0x3ab794[_0x080c('0x8a')](_0x4b4256(_0x080c('0xb8'),_0x16693d[_0x080c('0xa8')][_0x3579bc]['dataValues']));_0x3ab794[_0x080c('0x8a')](_0x4b4256(_0x080c('0xb9'),_0x16693d[_0x080c('0xa8')][_0x3579bc][_0x080c('0xb5')]));_0x3ab794[_0x080c('0x8a')](_0x4b4256(_0x080c('0xba'),_0x16693d[_0x080c('0xa8')][_0x3579bc]['dataValues']));}return Promise[_0x080c('0x8e')](_0x3ab794)[_0x080c('0x6')](function(){return _0x16693d;});}return _0x16693d;});}});}}});}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.rpc.js b/server/api/userProfile/userProfile.rpc.js index fe5efbd..2e6c8df 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 _0xce14=['error','code','message','result','catch','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','UserProfile,\x20%s,\x20%s','request\x20sent','debug','UserProfile,\x20%s,\x20%s,\x20%s','stringify'];(function(_0xab998c,_0x44bde4){var _0x10119b=function(_0x226d6f){while(--_0x226d6f){_0xab998c['push'](_0xab998c['shift']());}};_0x10119b(++_0x44bde4);}(_0xce14,0x17f));var _0x4ce1=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0xce14[_0xbca1b1];return _0x4e1686;};'use strict';var _=require('lodash');var util=require(_0x4ce1('0x0'));var moment=require('moment');var BPromise=require(_0x4ce1('0x1'));var rs=require(_0x4ce1('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4ce1('0x3'))['db'];var utils=require(_0x4ce1('0x4'));var logger=require(_0x4ce1('0x5'))(_0x4ce1('0x6'));var config=require(_0x4ce1('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x4ce1('0x8')][_0x4ce1('0x9')]({'port':0x232a});config[_0x4ce1('0xa')]=_[_0x4ce1('0xb')](config['redis'],{'host':_0x4ce1('0xc'),'port':0x18eb});var socket=require(_0x4ce1('0xd'))(new Redis(config[_0x4ce1('0xa')]));require('./userProfile.socket')[_0x4ce1('0xe')](socket);function respondWithRpcPromise(_0x28b881,_0x255dd0,_0x37947f){return new BPromise(function(_0x4c78ac,_0x14d7b1){return client[_0x4ce1('0xf')](_0x28b881,_0x37947f)[_0x4ce1('0x10')](function(_0x35d8a9){logger['info'](_0x4ce1('0x11'),_0x255dd0,_0x4ce1('0x12'));logger[_0x4ce1('0x13')](_0x4ce1('0x14'),_0x255dd0,_0x4ce1('0x12'),JSON[_0x4ce1('0x15')](_0x35d8a9));if(_0x35d8a9[_0x4ce1('0x16')]){if(_0x35d8a9[_0x4ce1('0x16')][_0x4ce1('0x17')]===0x1f4){logger[_0x4ce1('0x16')](_0x4ce1('0x11'),_0x255dd0,_0x35d8a9['error'][_0x4ce1('0x18')]);return _0x14d7b1(_0x35d8a9['error'][_0x4ce1('0x18')]);}logger[_0x4ce1('0x16')](_0x4ce1('0x11'),_0x255dd0,_0x35d8a9[_0x4ce1('0x16')]['message']);return _0x4c78ac(_0x35d8a9[_0x4ce1('0x16')]['message']);}else{logger['info']('UserProfile,\x20%s,\x20%s',_0x255dd0,_0x4ce1('0x12'));_0x4c78ac(_0x35d8a9[_0x4ce1('0x19')][_0x4ce1('0x18')]);}})[_0x4ce1('0x1a')](function(_0x5c38fb){logger[_0x4ce1('0x16')]('UserProfile,\x20%s,\x20%s',_0x255dd0,_0x5c38fb);_0x14d7b1(_0x5c38fb);});});} \ No newline at end of file +var _0x01db=['info','UserProfile,\x20%s,\x20%s','request\x20sent','debug','UserProfile,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash','bluebird','randomstring','ioredis','../../config/utils','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./userProfile.socket','register','then'];(function(_0x384ae4,_0xd2f00a){var _0x5974bc=function(_0x2ee34a){while(--_0x2ee34a){_0x384ae4['push'](_0x384ae4['shift']());}};_0x5974bc(++_0xd2f00a);}(_0x01db,0x171));var _0xb01d=function(_0x59bd93,_0x83f072){_0x59bd93=_0x59bd93-0x0;var _0x189f9a=_0x01db[_0x59bd93];return _0x189f9a;};'use strict';var _=require(_0xb01d('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xb01d('0x1'));var rs=require(_0xb01d('0x2'));var fs=require('fs');var Redis=require(_0xb01d('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xb01d('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xb01d('0x5'));var jayson=require(_0xb01d('0x6'));var client=jayson[_0xb01d('0x7')][_0xb01d('0x8')]({'port':0x232a});config[_0xb01d('0x9')]=_[_0xb01d('0xa')](config[_0xb01d('0x9')],{'host':_0xb01d('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xb01d('0xc'))[_0xb01d('0xd')](socket);function respondWithRpcPromise(_0x28e0fc,_0x3b2de4,_0x147b7b){return new BPromise(function(_0x9112c1,_0x4eb866){return client['request'](_0x28e0fc,_0x147b7b)[_0xb01d('0xe')](function(_0x1b59b9){logger[_0xb01d('0xf')](_0xb01d('0x10'),_0x3b2de4,_0xb01d('0x11'));logger[_0xb01d('0x12')](_0xb01d('0x13'),_0x3b2de4,'request\x20sent',JSON['stringify'](_0x1b59b9));if(_0x1b59b9[_0xb01d('0x14')]){if(_0x1b59b9['error'][_0xb01d('0x15')]===0x1f4){logger[_0xb01d('0x14')]('UserProfile,\x20%s,\x20%s',_0x3b2de4,_0x1b59b9[_0xb01d('0x14')][_0xb01d('0x16')]);return _0x4eb866(_0x1b59b9[_0xb01d('0x14')][_0xb01d('0x16')]);}logger['error'](_0xb01d('0x10'),_0x3b2de4,_0x1b59b9['error'][_0xb01d('0x16')]);return _0x9112c1(_0x1b59b9[_0xb01d('0x14')][_0xb01d('0x16')]);}else{logger[_0xb01d('0xf')]('UserProfile,\x20%s,\x20%s',_0x3b2de4,_0xb01d('0x11'));_0x9112c1(_0x1b59b9[_0xb01d('0x17')][_0xb01d('0x16')]);}})['catch'](function(_0x210023){logger['error'](_0xb01d('0x10'),_0x3b2de4,_0x210023);_0x4eb866(_0x210023);});});} \ No newline at end of file diff --git a/server/api/userProfile/userProfile.socket.js b/server/api/userProfile/userProfile.socket.js index 1a87a3e..3a97530 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 _0xca8e=['./userProfile.events','save','remove','update','emit','removeListener','userProfile:'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xca8e,0x8c));var _0xeca8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xca8e[_0x3dd15e];return _0x231fd0;};'use strict';var UserProfileEvents=require(_0xeca8('0x0'));var events=[_0xeca8('0x1'),_0xeca8('0x2'),_0xeca8('0x3')];function createListener(_0x1ef347,_0x7c76b8){return function(_0x35e88a){_0x7c76b8[_0xeca8('0x4')](_0x1ef347,_0x35e88a);};}function removeListener(_0x53a125,_0x41dfec){return function(){UserProfileEvents[_0xeca8('0x5')](_0x53a125,_0x41dfec);};}exports['register']=function(_0xbd29fb){for(var _0x4229eb=0x0,_0x5ab85c=events['length'];_0x4229eb<_0x5ab85c;_0x4229eb++){var _0x4f302a=events[_0x4229eb];var _0x56e42e=createListener(_0xeca8('0x6')+_0x4f302a,_0xbd29fb);UserProfileEvents['on'](_0x4f302a,_0x56e42e);}}; \ No newline at end of file +var _0xfd58=['register','length','./userProfile.events','save','remove','update','emit','removeListener'];(function(_0x48c615,_0x4cc757){var _0x3d9e22=function(_0x1ee9f2){while(--_0x1ee9f2){_0x48c615['push'](_0x48c615['shift']());}};_0x3d9e22(++_0x4cc757);}(_0xfd58,0x92));var _0x8fd5=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xfd58[_0x2641f9];return _0x585741;};'use strict';var UserProfileEvents=require(_0x8fd5('0x0'));var events=[_0x8fd5('0x1'),_0x8fd5('0x2'),_0x8fd5('0x3')];function createListener(_0x30df2f,_0x2ff807){return function(_0x3e2eeb){_0x2ff807[_0x8fd5('0x4')](_0x30df2f,_0x3e2eeb);};}function removeListener(_0x28eb4c,_0x4ce669){return function(){UserProfileEvents[_0x8fd5('0x5')](_0x28eb4c,_0x4ce669);};}exports[_0x8fd5('0x6')]=function(_0x3f04c7){for(var _0x291101=0x0,_0x26d1f9=events[_0x8fd5('0x7')];_0x291101<_0x26d1f9;_0x291101++){var _0x3bdf46=events[_0x291101];var _0x5eabd8=createListener('userProfile:'+_0x3bdf46,_0x3f04c7);UserProfileEvents['on'](_0x3bdf46,_0x5eabd8);}}; \ No newline at end of file diff --git a/server/api/userProfileResource/index.js b/server/api/userProfileResource/index.js index 48a9c56..80f00d0 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 _0xed0d=['post','create','put','update','delete','destroy','exports','multer','util','path','express','fs-extra','../../components/interaction/service','get','index','/describe','isAuthenticated','describe','/:id','show'];(function(_0x1b5a7f,_0x5b8327){var _0x35086a=function(_0x1f6bea){while(--_0x1f6bea){_0x1b5a7f['push'](_0x1b5a7f['shift']());}};_0x35086a(++_0x5b8327);}(_0xed0d,0x1d3));var _0xded0=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xed0d[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xded0('0x0'));var util=require(_0xded0('0x1'));var path=require(_0xded0('0x2'));var timeout=require('connect-timeout');var express=require(_0xded0('0x3'));var router=express['Router']();var fs_extra=require(_0xded0('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xded0('0x5'));var config=require('../../config/environment');var controller=require('./userProfileResource.controller');router[_0xded0('0x6')]('/',auth['isAuthenticated'](),controller[_0xded0('0x7')]);router[_0xded0('0x6')](_0xded0('0x8'),auth[_0xded0('0x9')](),controller[_0xded0('0xa')]);router['get'](_0xded0('0xb'),auth[_0xded0('0x9')](),controller[_0xded0('0xc')]);router[_0xded0('0xd')]('/',auth[_0xded0('0x9')](),controller[_0xded0('0xe')]);router[_0xded0('0xf')](_0xded0('0xb'),auth[_0xded0('0x9')](),controller[_0xded0('0x10')]);router[_0xded0('0x11')]('/:id',auth['isAuthenticated'](),controller[_0xded0('0x12')]);module[_0xded0('0x13')]=router; \ No newline at end of file +var _0x0d5f=['/describe','/:id','isAuthenticated','post','create','put','update','delete','destroy','multer','util','path','connect-timeout','express','../../components/auth/service','../../config/environment','./userProfileResource.controller','get','index'];(function(_0x9c607a,_0x1cb2c6){var _0x3b1311=function(_0x1b3fec){while(--_0x1b3fec){_0x9c607a['push'](_0x9c607a['shift']());}};_0x3b1311(++_0x1cb2c6);}(_0x0d5f,0xa1));var _0xf0d5=function(_0x2b9920,_0x327ebb){_0x2b9920=_0x2b9920-0x0;var _0x23c2df=_0x0d5f[_0x2b9920];return _0x23c2df;};'use strict';var multer=require(_0xf0d5('0x0'));var util=require(_0xf0d5('0x1'));var path=require(_0xf0d5('0x2'));var timeout=require(_0xf0d5('0x3'));var express=require(_0xf0d5('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xf0d5('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xf0d5('0x6'));var controller=require(_0xf0d5('0x7'));router[_0xf0d5('0x8')]('/',auth['isAuthenticated'](),controller[_0xf0d5('0x9')]);router[_0xf0d5('0x8')](_0xf0d5('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0xf0d5('0x8')](_0xf0d5('0xb'),auth[_0xf0d5('0xc')](),controller['show']);router[_0xf0d5('0xd')]('/',auth[_0xf0d5('0xc')](),controller[_0xf0d5('0xe')]);router[_0xf0d5('0xf')](_0xf0d5('0xb'),auth[_0xf0d5('0xc')](),controller[_0xf0d5('0x10')]);router[_0xf0d5('0x11')](_0xf0d5('0xb'),auth['isAuthenticated'](),controller[_0xf0d5('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.attributes.js b/server/api/userProfileResource/userProfileResource.attributes.js index 2c4bf56..124847f 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 _0x3618=['STRING','INTEGER','sequelize','exports'];(function(_0x118542,_0x3892dd){var _0x414cca=function(_0x2e9e05){while(--_0x2e9e05){_0x118542['push'](_0x118542['shift']());}};_0x414cca(++_0x3892dd);}(_0x3618,0x82));var _0x8361=function(_0x5bd426,_0x4878e5){_0x5bd426=_0x5bd426-0x0;var _0x23a7eb=_0x3618[_0x5bd426];return _0x23a7eb;};'use strict';var Sequelize=require(_0x8361('0x0'));module[_0x8361('0x1')]={'name':{'type':Sequelize[_0x8361('0x2')],'allowNull':![]},'resourceId':{'type':Sequelize[_0x8361('0x3')],'allowNull':![]},'type':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file +var _0x607f=['STRING','INTEGER','exports'];(function(_0x3e4ad3,_0x443712){var _0xa1b1ee=function(_0x5d6bc5){while(--_0x5d6bc5){_0x3e4ad3['push'](_0x3e4ad3['shift']());}};_0xa1b1ee(++_0x443712);}(_0x607f,0x17f));var _0xf607=function(_0x4f0e5b,_0x1a5bce){_0x4f0e5b=_0x4f0e5b-0x0;var _0x4dad9d=_0x607f[_0x4f0e5b];return _0x4dad9d;};'use strict';var Sequelize=require('sequelize');module[_0xf607('0x0')]={'name':{'type':Sequelize[_0xf607('0x1')],'allowNull':![]},'resourceId':{'type':Sequelize[_0xf607('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xf607('0x1')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.controller.js b/server/api/userProfileResource/userProfileResource.controller.js index 2f16cef..5f5e370 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 _0xafc4=['update','destroy','then','stack','name','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filter','merge','map','VIRTUAL','options','UserProfileResource','includeAll','catch','show','params','create','body','find','describe','eml-format','zip-dir','request-promise','moment','bluebird','mustache','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','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','Content-Range','apply','reject','save'];(function(_0x2e3a2c,_0x52ae45){var _0x1939b5=function(_0x3f0a4b){while(--_0x3f0a4b){_0x2e3a2c['push'](_0x2e3a2c['shift']());}};_0x1939b5(++_0x52ae45);}(_0xafc4,0x69));var _0x4afc=function(_0x285676,_0x3b6d20){_0x285676=_0x285676-0x0;var _0x5c6784=_0xafc4[_0x285676];return _0x5c6784;};'use strict';var emlformat=require(_0x4afc('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4afc('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4afc('0x2'));var moment=require(_0x4afc('0x3'));var BPromise=require(_0x4afc('0x4'));var Mustache=require(_0x4afc('0x5'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x4afc('0x6'));var ejs=require(_0x4afc('0x7'));var fs=require('fs');var fs_extra=require(_0x4afc('0x8'));var _=require(_0x4afc('0x9'));var squel=require(_0x4afc('0xa'));var crypto=require(_0x4afc('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x4afc('0xc'));var toCsv=require(_0x4afc('0x6'));var querystring=require(_0x4afc('0xd'));var Papa=require(_0x4afc('0xe'));var Redis=require(_0x4afc('0xf'));var authService=require(_0x4afc('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4afc('0x11'));var logger=require('../../config/logger')(_0x4afc('0x12'));var utils=require(_0x4afc('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x4afc('0x14'));var db=require(_0x4afc('0x15'))['db'];function respondWithStatusCode(_0x2b191c,_0x2768bf){_0x2768bf=_0x2768bf||0xcc;return function(_0x1d8f98){if(_0x1d8f98){return _0x2b191c[_0x4afc('0x16')](_0x2768bf);}return _0x2b191c[_0x4afc('0x17')](_0x2768bf)[_0x4afc('0x18')]();};}function respondWithResult(_0x5effb4,_0x26f3f1){_0x26f3f1=_0x26f3f1||0xc8;return function(_0x429fd8){if(_0x429fd8){return _0x5effb4[_0x4afc('0x17')](_0x26f3f1)[_0x4afc('0x19')](_0x429fd8);}};}function respondWithFilteredResult(_0x5f2dc9,_0x4e32e8){return function(_0x2452ae){if(_0x2452ae){var _0x4f3127=typeof _0x4e32e8[_0x4afc('0x1a')]===_0x4afc('0x1b')&&typeof _0x4e32e8[_0x4afc('0x1c')]===_0x4afc('0x1b');var _0x3a306f=_0x2452ae[_0x4afc('0x1d')];var _0x22f809=_0x4f3127?0x0:_0x4e32e8[_0x4afc('0x1a')];var _0x16365f=_0x4f3127?_0x2452ae[_0x4afc('0x1d')]:_0x4e32e8[_0x4afc('0x1a')]+_0x4e32e8['limit'];var _0x1a8f49;if(_0x16365f>=_0x3a306f){_0x16365f=_0x3a306f;_0x1a8f49=0xc8;}else{_0x1a8f49=0xce;}_0x5f2dc9[_0x4afc('0x17')](_0x1a8f49);return _0x5f2dc9[_0x4afc('0x1e')](_0x4afc('0x1f'),_0x22f809+'-'+_0x16365f+'/'+_0x3a306f)['json'](_0x2452ae);}return null;};}function patchUpdates(_0x3bddc0){return function(_0x30eda3){try{jsonpatch[_0x4afc('0x20')](_0x30eda3,_0x3bddc0,!![]);}catch(_0x280587){return BPromise[_0x4afc('0x21')](_0x280587);}return _0x30eda3[_0x4afc('0x22')]();};}function saveUpdates(_0x3ad7a5,_0x573a75){return function(_0x5403e4){if(_0x5403e4){return _0x5403e4[_0x4afc('0x23')](_0x3ad7a5)['then'](function(_0x37debf){return _0x37debf;});}return null;};}function removeEntity(_0x4e9a48,_0x1aa676){return function(_0x2a0314){if(_0x2a0314){return _0x2a0314[_0x4afc('0x24')]()[_0x4afc('0x25')](function(){_0x4e9a48[_0x4afc('0x17')](0xcc)[_0x4afc('0x18')]();});}};}function handleEntityNotFound(_0x40a0db,_0x383a71){return function(_0x2bb837){if(!_0x2bb837){_0x40a0db[_0x4afc('0x16')](0x194);}return _0x2bb837;};}function handleError(_0x4e8273,_0x359c07){_0x359c07=_0x359c07||0x1f4;return function(_0x35f5b3){logger['error'](_0x35f5b3[_0x4afc('0x26')]);if(_0x35f5b3[_0x4afc('0x27')]){delete _0x35f5b3[_0x4afc('0x27')];}_0x4e8273['status'](_0x359c07)['send'](_0x35f5b3);};}exports['index']=function(_0x426e9d,_0x5db47e){var _0x5e4747={},_0xd26d2f={},_0x628e42={'count':0x0,'rows':[]};var _0x494fe7=_['map'](db['UserProfileResource'][_0x4afc('0x28')],function(_0x34434a){return{'name':_0x34434a[_0x4afc('0x29')],'type':_0x34434a[_0x4afc('0x2a')][_0x4afc('0x2b')]};});_0xd26d2f[_0x4afc('0x2c')]=_['map'](_0x494fe7,_0x4afc('0x27'));_0xd26d2f[_0x4afc('0x2d')]=_[_0x4afc('0x2e')](_0x426e9d[_0x4afc('0x2d')]);_0xd26d2f[_0x4afc('0x2f')]=_[_0x4afc('0x30')](_0xd26d2f[_0x4afc('0x2c')],_0xd26d2f[_0x4afc('0x2d')]);_0x5e4747['attributes']=_[_0x4afc('0x30')](_0xd26d2f['model'],qs['fields'](_0x426e9d[_0x4afc('0x2d')][_0x4afc('0x31')]));_0x5e4747[_0x4afc('0x32')]=_0x5e4747[_0x4afc('0x32')][_0x4afc('0x33')]?_0x5e4747[_0x4afc('0x32')]:_0xd26d2f['model'];if(!_0x426e9d[_0x4afc('0x2d')][_0x4afc('0x34')](_0x4afc('0x35'))){_0x5e4747[_0x4afc('0x1c')]=qs[_0x4afc('0x1c')](_0x426e9d[_0x4afc('0x2d')]['limit']);_0x5e4747[_0x4afc('0x1a')]=qs[_0x4afc('0x1a')](_0x426e9d[_0x4afc('0x2d')][_0x4afc('0x1a')]);}_0x5e4747['order']=qs['sort'](_0x426e9d[_0x4afc('0x2d')][_0x4afc('0x36')]);_0x5e4747[_0x4afc('0x37')]=qs['filters'](_['pick'](_0x426e9d[_0x4afc('0x2d')],_0xd26d2f['filters']),_0x494fe7);if(_0x426e9d['query'][_0x4afc('0x38')]){_0x5e4747[_0x4afc('0x37')]=_[_0x4afc('0x39')](_0x5e4747[_0x4afc('0x37')],{'$or':_[_0x4afc('0x3a')](_0x494fe7,function(_0x4420fb){if(_0x4420fb[_0x4afc('0x2a')]!==_0x4afc('0x3b')){var _0x3ccc5a={};_0x3ccc5a[_0x4420fb[_0x4afc('0x27')]]={'$like':'%'+_0x426e9d[_0x4afc('0x2d')][_0x4afc('0x38')]+'%'};return _0x3ccc5a;}})});}_0x5e4747=_[_0x4afc('0x39')]({},_0x5e4747,_0x426e9d[_0x4afc('0x3c')]);var _0x46dd2a={'where':_0x5e4747['where']};return db[_0x4afc('0x3d')][_0x4afc('0x1d')](_0x46dd2a)[_0x4afc('0x25')](function(_0xe6db12){_0x628e42[_0x4afc('0x1d')]=_0xe6db12;if(_0x426e9d[_0x4afc('0x2d')][_0x4afc('0x3e')]){_0x5e4747['include']=[{'all':!![]}];}return db['UserProfileResource']['findAll'](_0x5e4747);})[_0x4afc('0x25')](function(_0x105c03){_0x628e42['rows']=_0x105c03;return _0x628e42;})[_0x4afc('0x25')](respondWithFilteredResult(_0x5db47e,_0x5e4747))[_0x4afc('0x3f')](handleError(_0x5db47e,null));};exports[_0x4afc('0x40')]=function(_0x397996,_0x545109){var _0x12b5db={'raw':![],'where':{'id':_0x397996[_0x4afc('0x41')]['id']}},_0x45c9c3={};_0x45c9c3[_0x4afc('0x2c')]=_[_0x4afc('0x2e')](db[_0x4afc('0x3d')]['rawAttributes']);_0x45c9c3[_0x4afc('0x2d')]=_['keys'](_0x397996[_0x4afc('0x2d')]);_0x45c9c3[_0x4afc('0x2f')]=_[_0x4afc('0x30')](_0x45c9c3['model'],_0x45c9c3['query']);_0x12b5db[_0x4afc('0x32')]=_[_0x4afc('0x30')](_0x45c9c3[_0x4afc('0x2c')],qs[_0x4afc('0x31')](_0x397996[_0x4afc('0x2d')][_0x4afc('0x31')]));_0x12b5db[_0x4afc('0x32')]=_0x12b5db[_0x4afc('0x32')]['length']?_0x12b5db[_0x4afc('0x32')]:_0x45c9c3[_0x4afc('0x2c')];if(_0x397996['query'][_0x4afc('0x3e')]){_0x12b5db['include']=[{'all':!![]}];}_0x12b5db=_[_0x4afc('0x39')]({},_0x12b5db,_0x397996[_0x4afc('0x3c')]);return db[_0x4afc('0x3d')]['find'](_0x12b5db)[_0x4afc('0x25')](handleEntityNotFound(_0x545109,null))[_0x4afc('0x25')](respondWithResult(_0x545109,null))[_0x4afc('0x3f')](handleError(_0x545109,null));};exports[_0x4afc('0x42')]=function(_0x4772db,_0x19a0ac){return db['UserProfileResource']['create'](_0x4772db['body'],{})[_0x4afc('0x25')](respondWithResult(_0x19a0ac,0xc9))[_0x4afc('0x3f')](handleError(_0x19a0ac,null));};exports[_0x4afc('0x23')]=function(_0x269c24,_0xb5cca9){if(_0x269c24[_0x4afc('0x43')]['id']){delete _0x269c24[_0x4afc('0x43')]['id'];}return db[_0x4afc('0x3d')][_0x4afc('0x44')]({'where':{'id':_0x269c24[_0x4afc('0x41')]['id']}})['then'](handleEntityNotFound(_0xb5cca9,null))[_0x4afc('0x25')](saveUpdates(_0x269c24['body'],null))['then'](respondWithResult(_0xb5cca9,null))[_0x4afc('0x3f')](handleError(_0xb5cca9,null));};exports['destroy']=function(_0x428d78,_0x355198){return db[_0x4afc('0x3d')][_0x4afc('0x44')]({'where':{'id':_0x428d78['params']['id']}})[_0x4afc('0x25')](handleEntityNotFound(_0x355198,null))['then'](removeEntity(_0x355198,null))[_0x4afc('0x3f')](handleError(_0x355198,null));};exports[_0x4afc('0x45')]=function(_0x3625c9,_0x387834){return db[_0x4afc('0x3d')][_0x4afc('0x45')]()[_0x4afc('0x25')](respondWithResult(_0x387834,null))[_0x4afc('0x3f')](handleError(_0x387834,null));}; \ No newline at end of file +var _0x9536=['rawAttributes','intersection','length','options','find','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','update','error','stack','name','index','map','UserProfileResource','fieldName','model','query','keys','filters','fields','attributes','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','then','includeAll','include','findAll','rows','catch','params'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x9536,0x179));var _0x6953=function(_0x4f1da5,_0x4ced17){_0x4f1da5=_0x4f1da5-0x0;var _0xe972a8=_0x9536[_0x4f1da5];return _0xe972a8;};'use strict';var emlformat=require(_0x6953('0x0'));var rimraf=require(_0x6953('0x1'));var zipdir=require(_0x6953('0x2'));var jsonpatch=require(_0x6953('0x3'));var rp=require('request-promise');var moment=require(_0x6953('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x6953('0x5'));var util=require(_0x6953('0x6'));var path=require(_0x6953('0x7'));var sox=require(_0x6953('0x8'));var csv=require(_0x6953('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6953('0xa'));var _=require(_0x6953('0xb'));var squel=require(_0x6953('0xc'));var crypto=require(_0x6953('0xd'));var jsforce=require(_0x6953('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x6953('0x9'));var querystring=require(_0x6953('0xf'));var Papa=require(_0x6953('0x10'));var Redis=require('ioredis');var authService=require(_0x6953('0x11'));var qs=require(_0x6953('0x12'));var as=require(_0x6953('0x13'));var hardwareService=require(_0x6953('0x14'));var logger=require(_0x6953('0x15'))(_0x6953('0x16'));var utils=require(_0x6953('0x17'));var config=require(_0x6953('0x18'));var licenseUtil=require(_0x6953('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x358388,_0x513dd0){_0x513dd0=_0x513dd0||0xcc;return function(_0x8de91e){if(_0x8de91e){return _0x358388[_0x6953('0x1a')](_0x513dd0);}return _0x358388[_0x6953('0x1b')](_0x513dd0)[_0x6953('0x1c')]();};}function respondWithResult(_0x1b5221,_0x244713){_0x244713=_0x244713||0xc8;return function(_0x175fa9){if(_0x175fa9){return _0x1b5221[_0x6953('0x1b')](_0x244713)[_0x6953('0x1d')](_0x175fa9);}};}function respondWithFilteredResult(_0x31d182,_0xae5515){return function(_0x548473){if(_0x548473){var _0x5f49db=typeof _0xae5515[_0x6953('0x1e')]===_0x6953('0x1f')&&typeof _0xae5515[_0x6953('0x20')]===_0x6953('0x1f');var _0x510d46=_0x548473[_0x6953('0x21')];var _0x2da771=_0x5f49db?0x0:_0xae5515['offset'];var _0x10858a=_0x5f49db?_0x548473[_0x6953('0x21')]:_0xae5515[_0x6953('0x1e')]+_0xae5515[_0x6953('0x20')];var _0xc714d3;if(_0x10858a>=_0x510d46){_0x10858a=_0x510d46;_0xc714d3=0xc8;}else{_0xc714d3=0xce;}_0x31d182['status'](_0xc714d3);return _0x31d182[_0x6953('0x22')](_0x6953('0x23'),_0x2da771+'-'+_0x10858a+'/'+_0x510d46)[_0x6953('0x1d')](_0x548473);}return null;};}function patchUpdates(_0x2ba433){return function(_0x41f021){try{jsonpatch['apply'](_0x41f021,_0x2ba433,!![]);}catch(_0xf96d07){return BPromise[_0x6953('0x24')](_0xf96d07);}return _0x41f021['save']();};}function saveUpdates(_0x317979,_0x40c9d1){return function(_0xb92529){if(_0xb92529){return _0xb92529[_0x6953('0x25')](_0x317979)['then'](function(_0x37f339){return _0x37f339;});}return null;};}function removeEntity(_0x231cb2,_0x2a7f6a){return function(_0x508ea7){if(_0x508ea7){return _0x508ea7['destroy']()['then'](function(){_0x231cb2[_0x6953('0x1b')](0xcc)[_0x6953('0x1c')]();});}};}function handleEntityNotFound(_0x550be4,_0x1a32f4){return function(_0x587df0){if(!_0x587df0){_0x550be4[_0x6953('0x1a')](0x194);}return _0x587df0;};}function handleError(_0x2bf39b,_0xcdbce8){_0xcdbce8=_0xcdbce8||0x1f4;return function(_0x2cc01e){logger[_0x6953('0x26')](_0x2cc01e[_0x6953('0x27')]);if(_0x2cc01e['name']){delete _0x2cc01e[_0x6953('0x28')];}_0x2bf39b[_0x6953('0x1b')](_0xcdbce8)['send'](_0x2cc01e);};}exports[_0x6953('0x29')]=function(_0x4af39d,_0x173b3c){var _0x3b1175={},_0x426c7c={},_0x4b0325={'count':0x0,'rows':[]};var _0x131992=_[_0x6953('0x2a')](db[_0x6953('0x2b')]['rawAttributes'],function(_0x4c49fc){return{'name':_0x4c49fc[_0x6953('0x2c')],'type':_0x4c49fc['type']['key']};});_0x426c7c[_0x6953('0x2d')]=_[_0x6953('0x2a')](_0x131992,_0x6953('0x28'));_0x426c7c[_0x6953('0x2e')]=_[_0x6953('0x2f')](_0x4af39d['query']);_0x426c7c[_0x6953('0x30')]=_['intersection'](_0x426c7c[_0x6953('0x2d')],_0x426c7c[_0x6953('0x2e')]);_0x3b1175['attributes']=_['intersection'](_0x426c7c[_0x6953('0x2d')],qs[_0x6953('0x31')](_0x4af39d[_0x6953('0x2e')]['fields']));_0x3b1175[_0x6953('0x32')]=_0x3b1175['attributes']['length']?_0x3b1175['attributes']:_0x426c7c['model'];if(!_0x4af39d[_0x6953('0x2e')][_0x6953('0x33')](_0x6953('0x34'))){_0x3b1175[_0x6953('0x20')]=qs[_0x6953('0x20')](_0x4af39d[_0x6953('0x2e')]['limit']);_0x3b1175[_0x6953('0x1e')]=qs['offset'](_0x4af39d[_0x6953('0x2e')]['offset']);}_0x3b1175[_0x6953('0x35')]=qs[_0x6953('0x36')](_0x4af39d[_0x6953('0x2e')][_0x6953('0x36')]);_0x3b1175['where']=qs[_0x6953('0x30')](_[_0x6953('0x37')](_0x4af39d[_0x6953('0x2e')],_0x426c7c[_0x6953('0x30')]),_0x131992);if(_0x4af39d[_0x6953('0x2e')][_0x6953('0x38')]){_0x3b1175[_0x6953('0x39')]=_[_0x6953('0x3a')](_0x3b1175[_0x6953('0x39')],{'$or':_[_0x6953('0x2a')](_0x131992,function(_0x2d9d81){if(_0x2d9d81['type']!==_0x6953('0x3b')){var _0x3c03ab={};_0x3c03ab[_0x2d9d81[_0x6953('0x28')]]={'$like':'%'+_0x4af39d['query']['filter']+'%'};return _0x3c03ab;}})});}_0x3b1175=_[_0x6953('0x3a')]({},_0x3b1175,_0x4af39d['options']);var _0x5abaf2={'where':_0x3b1175[_0x6953('0x39')]};return db[_0x6953('0x2b')]['count'](_0x5abaf2)[_0x6953('0x3c')](function(_0x263728){_0x4b0325[_0x6953('0x21')]=_0x263728;if(_0x4af39d[_0x6953('0x2e')][_0x6953('0x3d')]){_0x3b1175[_0x6953('0x3e')]=[{'all':!![]}];}return db['UserProfileResource'][_0x6953('0x3f')](_0x3b1175);})[_0x6953('0x3c')](function(_0x30a27a){_0x4b0325[_0x6953('0x40')]=_0x30a27a;return _0x4b0325;})[_0x6953('0x3c')](respondWithFilteredResult(_0x173b3c,_0x3b1175))[_0x6953('0x41')](handleError(_0x173b3c,null));};exports['show']=function(_0x5a40de,_0xeef91a){var _0x54d7c2={'raw':![],'where':{'id':_0x5a40de[_0x6953('0x42')]['id']}},_0x588ff8={};_0x588ff8[_0x6953('0x2d')]=_[_0x6953('0x2f')](db[_0x6953('0x2b')][_0x6953('0x43')]);_0x588ff8['query']=_['keys'](_0x5a40de[_0x6953('0x2e')]);_0x588ff8[_0x6953('0x30')]=_['intersection'](_0x588ff8[_0x6953('0x2d')],_0x588ff8['query']);_0x54d7c2[_0x6953('0x32')]=_[_0x6953('0x44')](_0x588ff8[_0x6953('0x2d')],qs[_0x6953('0x31')](_0x5a40de['query'][_0x6953('0x31')]));_0x54d7c2[_0x6953('0x32')]=_0x54d7c2['attributes'][_0x6953('0x45')]?_0x54d7c2[_0x6953('0x32')]:_0x588ff8[_0x6953('0x2d')];if(_0x5a40de[_0x6953('0x2e')][_0x6953('0x3d')]){_0x54d7c2[_0x6953('0x3e')]=[{'all':!![]}];}_0x54d7c2=_[_0x6953('0x3a')]({},_0x54d7c2,_0x5a40de[_0x6953('0x46')]);return db[_0x6953('0x2b')][_0x6953('0x47')](_0x54d7c2)[_0x6953('0x3c')](handleEntityNotFound(_0xeef91a,null))['then'](respondWithResult(_0xeef91a,null))[_0x6953('0x41')](handleError(_0xeef91a,null));};exports['create']=function(_0x15c142,_0x1d5979){return db[_0x6953('0x2b')]['create'](_0x15c142[_0x6953('0x48')],{})[_0x6953('0x3c')](respondWithResult(_0x1d5979,0xc9))['catch'](handleError(_0x1d5979,null));};exports['update']=function(_0xbf5b61,_0x265b44){if(_0xbf5b61[_0x6953('0x48')]['id']){delete _0xbf5b61[_0x6953('0x48')]['id'];}return db[_0x6953('0x2b')][_0x6953('0x47')]({'where':{'id':_0xbf5b61[_0x6953('0x42')]['id']}})[_0x6953('0x3c')](handleEntityNotFound(_0x265b44,null))[_0x6953('0x3c')](saveUpdates(_0xbf5b61[_0x6953('0x48')],null))[_0x6953('0x3c')](respondWithResult(_0x265b44,null))['catch'](handleError(_0x265b44,null));};exports['destroy']=function(_0x14a7bf,_0x38e3e8){return db[_0x6953('0x2b')][_0x6953('0x47')]({'where':{'id':_0x14a7bf[_0x6953('0x42')]['id']}})[_0x6953('0x3c')](handleEntityNotFound(_0x38e3e8,null))[_0x6953('0x3c')](removeEntity(_0x38e3e8,null))[_0x6953('0x41')](handleError(_0x38e3e8,null));};exports[_0x6953('0x49')]=function(_0x50b962,_0x5f15b0){return db['UserProfileResource']['describe']()[_0x6953('0x3c')](respondWithResult(_0x5f15b0,null))[_0x6953('0x41')](handleError(_0x5f15b0,null));}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.model.js b/server/api/userProfileResource/userProfileResource.model.js index f380419..499e814 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 _0x3a1f=['util','api','request-promise','./userProfileResource.attributes','exports','UserProfileResource','compositeIndex','sectionId','lodash'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3a1f,0x1af));var _0xf3a1=function(_0x5c351c,_0x2046d8){_0x5c351c=_0x5c351c-0x0;var _0x26f3b3=_0x3a1f[_0x5c351c];return _0x26f3b3;};'use strict';var _=require(_0xf3a1('0x0'));var util=require(_0xf3a1('0x1'));var logger=require('../../config/logger')(_0xf3a1('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xf3a1('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xf3a1('0x4'));module[_0xf3a1('0x5')]=function(_0x5bab3f,_0x418eac){return _0x5bab3f['define'](_0xf3a1('0x6'),attributes,{'tableName':'user_profile_has_resources','paranoid':![],'indexes':[{'name':_0xf3a1('0x7'),'fields':['resourceId',_0xf3a1('0x8')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x7a37=['../../config/environment','./userProfileResource.attributes','exports','define','UserProfileResource','user_profile_has_resources','resourceId','sectionId','lodash','util','../../config/logger','api','bluebird','request-promise','path'];(function(_0x4cc492,_0x162c85){var _0x1f36b9=function(_0xce4b2){while(--_0xce4b2){_0x4cc492['push'](_0x4cc492['shift']());}};_0x1f36b9(++_0x162c85);}(_0x7a37,0xad));var _0x77a3=function(_0x5e2f80,_0x2afd67){_0x5e2f80=_0x5e2f80-0x0;var _0x15d05e=_0x7a37[_0x5e2f80];return _0x15d05e;};'use strict';var _=require(_0x77a3('0x0'));var util=require(_0x77a3('0x1'));var logger=require(_0x77a3('0x2'))(_0x77a3('0x3'));var moment=require('moment');var BPromise=require(_0x77a3('0x4'));var rp=require(_0x77a3('0x5'));var fs=require('fs');var path=require(_0x77a3('0x6'));var rimraf=require('rimraf');var config=require(_0x77a3('0x7'));var attributes=require(_0x77a3('0x8'));module[_0x77a3('0x9')]=function(_0x24b165,_0x3f5855){return _0x24b165[_0x77a3('0xa')](_0x77a3('0xb'),attributes,{'tableName':_0x77a3('0xc'),'paranoid':![],'indexes':[{'name':'compositeIndex','fields':[_0x77a3('0xd'),_0x77a3('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.rpc.js b/server/api/userProfileResource/userProfileResource.rpc.js index 2b75770..84196f8 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 _0x9b6c=['debug','UserProfileResource,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','lodash','util','moment','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','info','UserProfileResource,\x20%s,\x20%s'];(function(_0x374029,_0x37a996){var _0x553ad7=function(_0x5f5dfe){while(--_0x5f5dfe){_0x374029['push'](_0x374029['shift']());}};_0x553ad7(++_0x37a996);}(_0x9b6c,0x10b));var _0xc9b6=function(_0x4c5537,_0x4fc4fa){_0x4c5537=_0x4c5537-0x0;var _0x1f00ca=_0x9b6c[_0x4c5537];return _0x1f00ca;};'use strict';var _=require(_0xc9b6('0x0'));var util=require(_0xc9b6('0x1'));var moment=require(_0xc9b6('0x2'));var BPromise=require('bluebird');var rs=require(_0xc9b6('0x3'));var fs=require('fs');var Redis=require(_0xc9b6('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xc9b6('0x5'));var config=require(_0xc9b6('0x6'));var jayson=require(_0xc9b6('0x7'));var client=jayson[_0xc9b6('0x8')][_0xc9b6('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x36552c,_0x8e9444,_0x2e857){return new BPromise(function(_0x15aac0,_0x5bca9a){return client[_0xc9b6('0xa')](_0x36552c,_0x2e857)['then'](function(_0x4a16eb){logger[_0xc9b6('0xb')](_0xc9b6('0xc'),_0x8e9444,'request\x20sent');logger[_0xc9b6('0xd')](_0xc9b6('0xe'),_0x8e9444,_0xc9b6('0xf'),JSON[_0xc9b6('0x10')](_0x4a16eb));if(_0x4a16eb[_0xc9b6('0x11')]){if(_0x4a16eb[_0xc9b6('0x11')]['code']===0x1f4){logger[_0xc9b6('0x11')]('UserProfileResource,\x20%s,\x20%s',_0x8e9444,_0x4a16eb['error'][_0xc9b6('0x12')]);return _0x5bca9a(_0x4a16eb[_0xc9b6('0x11')]['message']);}logger[_0xc9b6('0x11')](_0xc9b6('0xc'),_0x8e9444,_0x4a16eb['error']['message']);return _0x15aac0(_0x4a16eb['error'][_0xc9b6('0x12')]);}else{logger[_0xc9b6('0xb')](_0xc9b6('0xc'),_0x8e9444,_0xc9b6('0xf'));_0x15aac0(_0x4a16eb[_0xc9b6('0x13')][_0xc9b6('0x12')]);}})['catch'](function(_0x36ef76){logger['error'](_0xc9b6('0xc'),_0x8e9444,_0x36ef76);_0x5bca9a(_0x36ef76);});});} \ No newline at end of file +var _0xa3dd=['UserProfileResource,\x20%s,\x20%s','request\x20sent','debug','error','code','message','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','info'];(function(_0x374ccf,_0xa945c4){var _0x443cde=function(_0x27ff10){while(--_0x27ff10){_0x374ccf['push'](_0x374ccf['shift']());}};_0x443cde(++_0xa945c4);}(_0xa3dd,0x1e1));var _0xda3d=function(_0x1a97cb,_0x3e174c){_0x1a97cb=_0x1a97cb-0x0;var _0x4ab190=_0xa3dd[_0x1a97cb];return _0x4ab190;};'use strict';var _=require(_0xda3d('0x0'));var util=require(_0xda3d('0x1'));var moment=require('moment');var BPromise=require(_0xda3d('0x2'));var rs=require(_0xda3d('0x3'));var fs=require('fs');var Redis=require(_0xda3d('0x4'));var db=require(_0xda3d('0x5'))['db'];var utils=require(_0xda3d('0x6'));var logger=require(_0xda3d('0x7'))(_0xda3d('0x8'));var config=require(_0xda3d('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xda3d('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x16dee5,_0x494d6d,_0x1453e9){return new BPromise(function(_0xe6ff9,_0x68938e){return client[_0xda3d('0xb')](_0x16dee5,_0x1453e9)['then'](function(_0x1ff055){logger[_0xda3d('0xc')](_0xda3d('0xd'),_0x494d6d,_0xda3d('0xe'));logger[_0xda3d('0xf')]('UserProfileResource,\x20%s,\x20%s,\x20%s',_0x494d6d,_0xda3d('0xe'),JSON['stringify'](_0x1ff055));if(_0x1ff055[_0xda3d('0x10')]){if(_0x1ff055[_0xda3d('0x10')][_0xda3d('0x11')]===0x1f4){logger['error'](_0xda3d('0xd'),_0x494d6d,_0x1ff055[_0xda3d('0x10')][_0xda3d('0x12')]);return _0x68938e(_0x1ff055[_0xda3d('0x10')][_0xda3d('0x12')]);}logger[_0xda3d('0x10')](_0xda3d('0xd'),_0x494d6d,_0x1ff055[_0xda3d('0x10')][_0xda3d('0x12')]);return _0xe6ff9(_0x1ff055['error'][_0xda3d('0x12')]);}else{logger[_0xda3d('0xc')](_0xda3d('0xd'),_0x494d6d,_0xda3d('0xe'));_0xe6ff9(_0x1ff055['result'][_0xda3d('0x12')]);}})['catch'](function(_0x34187c){logger['error']('UserProfileResource,\x20%s,\x20%s',_0x494d6d,_0x34187c);_0x68938e(_0x34187c);});});} \ No newline at end of file diff --git a/server/api/userProfileSection/index.js b/server/api/userProfileSection/index.js index d320805..e823452 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 _0x825f=['../../components/interaction/service','./userProfileSection.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service'];(function(_0x512eb0,_0x27edfe){var _0x1378fe=function(_0xfd3680){while(--_0xfd3680){_0x512eb0['push'](_0x512eb0['shift']());}};_0x1378fe(++_0x27edfe);}(_0x825f,0x135));var _0xf825=function(_0x197703,_0x21c011){_0x197703=_0x197703-0x0;var _0x5424d4=_0x825f[_0x197703];return _0x5424d4;};'use strict';var multer=require(_0xf825('0x0'));var util=require(_0xf825('0x1'));var path=require(_0xf825('0x2'));var timeout=require('connect-timeout');var express=require(_0xf825('0x3'));var router=express[_0xf825('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xf825('0x5'));var interaction=require(_0xf825('0x6'));var config=require('../../config/environment');var controller=require(_0xf825('0x7'));router[_0xf825('0x8')]('/',auth[_0xf825('0x9')](),controller[_0xf825('0xa')]);router[_0xf825('0x8')](_0xf825('0xb'),auth[_0xf825('0x9')](),controller[_0xf825('0xc')]);router['get'](_0xf825('0xd'),auth['isAuthenticated'](),controller[_0xf825('0xe')]);router[_0xf825('0xf')]('/',auth['isAuthenticated'](),controller[_0xf825('0x10')]);router[_0xf825('0x11')](_0xf825('0xd'),auth['isAuthenticated'](),controller['update']);router[_0xf825('0x12')](_0xf825('0xd'),auth[_0xf825('0x9')](),controller[_0xf825('0x13')]);module[_0xf825('0x14')]=router; \ No newline at end of file +var _0xd67c=['../../config/environment','./userProfileSection.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','update','delete','destroy','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x8b5741,_0x14828b){var _0x4d1af6=function(_0x203aef){while(--_0x203aef){_0x8b5741['push'](_0x8b5741['shift']());}};_0x4d1af6(++_0x14828b);}(_0xd67c,0x14e));var _0xcd67=function(_0xf69ea2,_0x4b0d5c){_0xf69ea2=_0xf69ea2-0x0;var _0x2c88ec=_0xd67c[_0xf69ea2];return _0x2c88ec;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xcd67('0x0'));var timeout=require(_0xcd67('0x1'));var express=require(_0xcd67('0x2'));var router=express[_0xcd67('0x3')]();var fs_extra=require(_0xcd67('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xcd67('0x5'));var config=require(_0xcd67('0x6'));var controller=require(_0xcd67('0x7'));router[_0xcd67('0x8')]('/',auth[_0xcd67('0x9')](),controller[_0xcd67('0xa')]);router[_0xcd67('0x8')](_0xcd67('0xb'),auth[_0xcd67('0x9')](),controller[_0xcd67('0xc')]);router['get'](_0xcd67('0xd'),auth[_0xcd67('0x9')](),controller[_0xcd67('0xe')]);router[_0xcd67('0xf')]('/',auth[_0xcd67('0x9')](),controller[_0xcd67('0x10')]);router['put']('/:id',auth[_0xcd67('0x9')](),controller[_0xcd67('0x11')]);router[_0xcd67('0x12')](_0xcd67('0xd'),auth[_0xcd67('0x9')](),controller[_0xcd67('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.attributes.js b/server/api/userProfileSection/userProfileSection.attributes.js index 8448159..c4b142a 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 _0x8f59=['INTEGER','BOOLEAN','setDataValue','crudPermissions','getDataValue','sequelize','exports','STRING'];(function(_0x2ff89c,_0x3f81b1){var _0xdf161f=function(_0x206b6e){while(--_0x206b6e){_0x2ff89c['push'](_0x2ff89c['shift']());}};_0xdf161f(++_0x3f81b1);}(_0x8f59,0x11d));var _0x98f5=function(_0x2acbce,_0x1bba43){_0x2acbce=_0x2acbce-0x0;var _0x5f0461=_0x8f59[_0x2acbce];return _0x5f0461;};'use strict';var Sequelize=require(_0x98f5('0x0'));module[_0x98f5('0x1')]={'name':{'type':Sequelize[_0x98f5('0x2')],'allowNull':![]},'category':{'type':Sequelize[_0x98f5('0x2')],'allowNull':![]},'sectionId':{'type':Sequelize[_0x98f5('0x3')],'allowNull':![]},'enabled':{'type':Sequelize[_0x98f5('0x4')],'defaultValue':null},'autoAssociation':{'type':Sequelize['BOOLEAN'],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0x98f5('0x2')],'set':function(_0x320235){this[_0x98f5('0x5')](_0x98f5('0x6'),_0x320235?_0x320235['join'](''):[]);},'get':function(){return this[_0x98f5('0x7')](_0x98f5('0x6'))?this[_0x98f5('0x7')]('crudPermissions')['split'](''):[];}}}; \ No newline at end of file +var _0x2547=['BOOLEAN','crudPermissions','join','getDataValue','split','exports','STRING','INTEGER'];(function(_0x43924b,_0x20ceee){var _0x3dfff6=function(_0xaa7087){while(--_0xaa7087){_0x43924b['push'](_0x43924b['shift']());}};_0x3dfff6(++_0x20ceee);}(_0x2547,0x1cd));var _0x7254=function(_0x2c52a6,_0x238b3a){_0x2c52a6=_0x2c52a6-0x0;var _0x3d440c=_0x2547[_0x2c52a6];return _0x3d440c;};'use strict';var Sequelize=require('sequelize');module[_0x7254('0x0')]={'name':{'type':Sequelize[_0x7254('0x1')],'allowNull':![]},'category':{'type':Sequelize[_0x7254('0x1')],'allowNull':![]},'sectionId':{'type':Sequelize[_0x7254('0x2')],'allowNull':![]},'enabled':{'type':Sequelize[_0x7254('0x3')],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0x7254('0x3')],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0x7254('0x1')],'set':function(_0x265ebf){this['setDataValue'](_0x7254('0x4'),_0x265ebf?_0x265ebf[_0x7254('0x5')](''):[]);},'get':function(){return this[_0x7254('0x6')](_0x7254('0x4'))?this['getDataValue'](_0x7254('0x4'))[_0x7254('0x7')](''):[];}}}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.controller.js b/server/api/userProfileSection/userProfileSection.controller.js index 75e14d1..16cf735 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 _0xca53=['sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','rows','catch','show','create','body','find','params','describe','eml-format','zip-dir','fast-json-patch','moment','bluebird','sox','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/environment','../../mysqldb','end','status','json','limit','undefined','count','offset','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','UserProfileSection','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order'];(function(_0x48d6a3,_0x37c848){var _0x38bfa0=function(_0x3fba2e){while(--_0x3fba2e){_0x48d6a3['push'](_0x48d6a3['shift']());}};_0x38bfa0(++_0x37c848);}(_0xca53,0x142));var _0x3ca5=function(_0x4f0f6d,_0x28b6f4){_0x4f0f6d=_0x4f0f6d-0x0;var _0x2b2c98=_0xca53[_0x4f0f6d];return _0x2b2c98;};'use strict';var emlformat=require(_0x3ca5('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3ca5('0x1'));var jsonpatch=require(_0x3ca5('0x2'));var rp=require('request-promise');var moment=require(_0x3ca5('0x3'));var BPromise=require(_0x3ca5('0x4'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x3ca5('0x5'));var csv=require('to-csv');var ejs=require(_0x3ca5('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3ca5('0x7'));var squel=require(_0x3ca5('0x8'));var crypto=require(_0x3ca5('0x9'));var jsforce=require(_0x3ca5('0xa'));var deskjs=require(_0x3ca5('0xb'));var toCsv=require(_0x3ca5('0xc'));var querystring=require(_0x3ca5('0xd'));var Papa=require(_0x3ca5('0xe'));var Redis=require(_0x3ca5('0xf'));var authService=require(_0x3ca5('0x10'));var qs=require(_0x3ca5('0x11'));var as=require(_0x3ca5('0x12'));var hardwareService=require(_0x3ca5('0x13'));var logger=require(_0x3ca5('0x14'))(_0x3ca5('0x15'));var utils=require('../../config/utils');var config=require(_0x3ca5('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x3ca5('0x17'))['db'];function respondWithStatusCode(_0x2dee2b,_0x37f987){_0x37f987=_0x37f987||0xcc;return function(_0x4ebb5d){if(_0x4ebb5d){return _0x2dee2b['sendStatus'](_0x37f987);}return _0x2dee2b['status'](_0x37f987)[_0x3ca5('0x18')]();};}function respondWithResult(_0x2d6860,_0x218caa){_0x218caa=_0x218caa||0xc8;return function(_0x20ece2){if(_0x20ece2){return _0x2d6860[_0x3ca5('0x19')](_0x218caa)[_0x3ca5('0x1a')](_0x20ece2);}};}function respondWithFilteredResult(_0x230209,_0x50903c){return function(_0x12deb5){if(_0x12deb5){var _0x2da397=typeof _0x50903c['offset']==='undefined'&&typeof _0x50903c[_0x3ca5('0x1b')]===_0x3ca5('0x1c');var _0x38509b=_0x12deb5[_0x3ca5('0x1d')];var _0x3f8f7d=_0x2da397?0x0:_0x50903c[_0x3ca5('0x1e')];var _0x3a5abd=_0x2da397?_0x12deb5[_0x3ca5('0x1d')]:_0x50903c[_0x3ca5('0x1e')]+_0x50903c[_0x3ca5('0x1b')];var _0x78d4ea;if(_0x3a5abd>=_0x38509b){_0x3a5abd=_0x38509b;_0x78d4ea=0xc8;}else{_0x78d4ea=0xce;}_0x230209['status'](_0x78d4ea);return _0x230209['set']('Content-Range',_0x3f8f7d+'-'+_0x3a5abd+'/'+_0x38509b)[_0x3ca5('0x1a')](_0x12deb5);}return null;};}function patchUpdates(_0x50e419){return function(_0x15d795){try{jsonpatch['apply'](_0x15d795,_0x50e419,!![]);}catch(_0x5d943d){return BPromise[_0x3ca5('0x1f')](_0x5d943d);}return _0x15d795[_0x3ca5('0x20')]();};}function saveUpdates(_0x45e5c4,_0x41fac8){return function(_0x40bb00){if(_0x40bb00){return _0x40bb00[_0x3ca5('0x21')](_0x45e5c4)[_0x3ca5('0x22')](function(_0x47badc){return _0x47badc;});}return null;};}function removeEntity(_0x334d25,_0x9e8cfc){return function(_0x55df06){if(_0x55df06){return _0x55df06[_0x3ca5('0x23')]()['then'](function(){_0x334d25[_0x3ca5('0x19')](0xcc)[_0x3ca5('0x18')]();});}};}function handleEntityNotFound(_0x124ea4,_0x368500){return function(_0x214538){if(!_0x214538){_0x124ea4[_0x3ca5('0x24')](0x194);}return _0x214538;};}function handleError(_0x1a1422,_0x3e802a){_0x3e802a=_0x3e802a||0x1f4;return function(_0x55fc9c){logger[_0x3ca5('0x25')](_0x55fc9c[_0x3ca5('0x26')]);if(_0x55fc9c['name']){delete _0x55fc9c[_0x3ca5('0x27')];}_0x1a1422[_0x3ca5('0x19')](_0x3e802a)[_0x3ca5('0x28')](_0x55fc9c);};}exports[_0x3ca5('0x29')]=function(_0x2df0c2,_0x25caeb){var _0x22b403={},_0x5c8191={},_0x1b4ec9={'count':0x0,'rows':[]};var _0x26dfa4=_[_0x3ca5('0x2a')](db[_0x3ca5('0x2b')][_0x3ca5('0x2c')],function(_0x16f527){return{'name':_0x16f527[_0x3ca5('0x2d')],'type':_0x16f527['type'][_0x3ca5('0x2e')]};});_0x5c8191[_0x3ca5('0x2f')]=_[_0x3ca5('0x2a')](_0x26dfa4,_0x3ca5('0x27'));_0x5c8191[_0x3ca5('0x30')]=_[_0x3ca5('0x31')](_0x2df0c2[_0x3ca5('0x30')]);_0x5c8191[_0x3ca5('0x32')]=_[_0x3ca5('0x33')](_0x5c8191[_0x3ca5('0x2f')],_0x5c8191[_0x3ca5('0x30')]);_0x22b403[_0x3ca5('0x34')]=_[_0x3ca5('0x33')](_0x5c8191['model'],qs[_0x3ca5('0x35')](_0x2df0c2[_0x3ca5('0x30')][_0x3ca5('0x35')]));_0x22b403[_0x3ca5('0x34')]=_0x22b403[_0x3ca5('0x34')][_0x3ca5('0x36')]?_0x22b403[_0x3ca5('0x34')]:_0x5c8191[_0x3ca5('0x2f')];if(!_0x2df0c2[_0x3ca5('0x30')][_0x3ca5('0x37')](_0x3ca5('0x38'))){_0x22b403['limit']=qs[_0x3ca5('0x1b')](_0x2df0c2[_0x3ca5('0x30')][_0x3ca5('0x1b')]);_0x22b403['offset']=qs[_0x3ca5('0x1e')](_0x2df0c2[_0x3ca5('0x30')][_0x3ca5('0x1e')]);}_0x22b403[_0x3ca5('0x39')]=qs[_0x3ca5('0x3a')](_0x2df0c2[_0x3ca5('0x30')][_0x3ca5('0x3a')]);_0x22b403[_0x3ca5('0x3b')]=qs[_0x3ca5('0x32')](_[_0x3ca5('0x3c')](_0x2df0c2[_0x3ca5('0x30')],_0x5c8191[_0x3ca5('0x32')]),_0x26dfa4);if(_0x2df0c2[_0x3ca5('0x30')][_0x3ca5('0x3d')]){_0x22b403[_0x3ca5('0x3b')]=_[_0x3ca5('0x3e')](_0x22b403[_0x3ca5('0x3b')],{'$or':_[_0x3ca5('0x2a')](_0x26dfa4,function(_0x103ea0){if(_0x103ea0[_0x3ca5('0x3f')]!==_0x3ca5('0x40')){var _0xc04e6a={};_0xc04e6a[_0x103ea0[_0x3ca5('0x27')]]={'$like':'%'+_0x2df0c2[_0x3ca5('0x30')][_0x3ca5('0x3d')]+'%'};return _0xc04e6a;}})});}_0x22b403=_['merge']({},_0x22b403,_0x2df0c2[_0x3ca5('0x41')]);var _0x28fa2b={'where':_0x22b403[_0x3ca5('0x3b')]};return db[_0x3ca5('0x2b')][_0x3ca5('0x1d')](_0x28fa2b)[_0x3ca5('0x22')](function(_0x3f1c4e){_0x1b4ec9['count']=_0x3f1c4e;if(_0x2df0c2[_0x3ca5('0x30')][_0x3ca5('0x42')]){_0x22b403[_0x3ca5('0x43')]=[{'all':!![]}];}return db['UserProfileSection']['findAll'](_0x22b403);})[_0x3ca5('0x22')](function(_0x2d6cd1){_0x1b4ec9[_0x3ca5('0x44')]=_0x2d6cd1;return _0x1b4ec9;})['then'](respondWithFilteredResult(_0x25caeb,_0x22b403))[_0x3ca5('0x45')](handleError(_0x25caeb,null));};exports[_0x3ca5('0x46')]=function(_0x262957,_0x579b43){var _0x1a6843={'raw':![],'where':{'id':_0x262957['params']['id']}},_0x183295={};_0x183295[_0x3ca5('0x2f')]=_[_0x3ca5('0x31')](db['UserProfileSection'][_0x3ca5('0x2c')]);_0x183295['query']=_[_0x3ca5('0x31')](_0x262957[_0x3ca5('0x30')]);_0x183295['filters']=_[_0x3ca5('0x33')](_0x183295['model'],_0x183295[_0x3ca5('0x30')]);_0x1a6843[_0x3ca5('0x34')]=_[_0x3ca5('0x33')](_0x183295['model'],qs['fields'](_0x262957[_0x3ca5('0x30')][_0x3ca5('0x35')]));_0x1a6843[_0x3ca5('0x34')]=_0x1a6843['attributes'][_0x3ca5('0x36')]?_0x1a6843[_0x3ca5('0x34')]:_0x183295[_0x3ca5('0x2f')];if(_0x262957[_0x3ca5('0x30')][_0x3ca5('0x42')]){_0x1a6843[_0x3ca5('0x43')]=[{'all':!![]}];}_0x1a6843=_[_0x3ca5('0x3e')]({},_0x1a6843,_0x262957['options']);return db[_0x3ca5('0x2b')]['find'](_0x1a6843)[_0x3ca5('0x22')](handleEntityNotFound(_0x579b43,null))['then'](respondWithResult(_0x579b43,null))[_0x3ca5('0x45')](handleError(_0x579b43,null));};exports['create']=function(_0x3e4583,_0x1dedfc){return db[_0x3ca5('0x2b')][_0x3ca5('0x47')](_0x3e4583[_0x3ca5('0x48')],{})[_0x3ca5('0x22')](respondWithResult(_0x1dedfc,0xc9))[_0x3ca5('0x45')](handleError(_0x1dedfc,null));};exports[_0x3ca5('0x21')]=function(_0x176f41,_0x1f51cc){if(_0x176f41['body']['id']){delete _0x176f41[_0x3ca5('0x48')]['id'];}return db[_0x3ca5('0x2b')][_0x3ca5('0x49')]({'where':{'id':_0x176f41[_0x3ca5('0x4a')]['id']}})[_0x3ca5('0x22')](handleEntityNotFound(_0x1f51cc,null))['then'](saveUpdates(_0x176f41['body'],null))['then'](respondWithResult(_0x1f51cc,null))[_0x3ca5('0x45')](handleError(_0x1f51cc,null));};exports[_0x3ca5('0x23')]=function(_0x304bbd,_0x395d1b){return db[_0x3ca5('0x2b')][_0x3ca5('0x49')]({'where':{'id':_0x304bbd[_0x3ca5('0x4a')]['id']}})[_0x3ca5('0x22')](handleEntityNotFound(_0x395d1b,null))[_0x3ca5('0x22')](removeEntity(_0x395d1b,null))[_0x3ca5('0x45')](handleError(_0x395d1b,null));};exports[_0x3ca5('0x4b')]=function(_0x1542b9,_0x430a5a){return db[_0x3ca5('0x2b')][_0x3ca5('0x4b')]()['then'](respondWithResult(_0x430a5a,null))[_0x3ca5('0x45')](handleError(_0x430a5a,null));}; \ No newline at end of file +var _0xae0a=['model','query','filters','intersection','attributes','fields','nolimit','order','sort','where','filter','merge','VIRTUAL','options','UserProfileSection','include','rows','show','params','keys','find','catch','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','end','json','offset','limit','undefined','count','status','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','index','map','fieldName','type','key'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0xae0a,0xaf));var _0xaae0=function(_0x41c6dc,_0x3f830a){_0x41c6dc=_0x41c6dc-0x0;var _0x3152c1=_0xae0a[_0x41c6dc];return _0x3152c1;};'use strict';var emlformat=require(_0xaae0('0x0'));var rimraf=require(_0xaae0('0x1'));var zipdir=require(_0xaae0('0x2'));var jsonpatch=require(_0xaae0('0x3'));var rp=require(_0xaae0('0x4'));var moment=require(_0xaae0('0x5'));var BPromise=require(_0xaae0('0x6'));var Mustache=require('mustache');var util=require(_0xaae0('0x7'));var path=require(_0xaae0('0x8'));var sox=require(_0xaae0('0x9'));var csv=require(_0xaae0('0xa'));var ejs=require(_0xaae0('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xaae0('0xc'));var squel=require(_0xaae0('0xd'));var crypto=require(_0xaae0('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xaae0('0xf'));var Papa=require(_0xaae0('0x10'));var Redis=require(_0xaae0('0x11'));var authService=require(_0xaae0('0x12'));var qs=require(_0xaae0('0x13'));var as=require(_0xaae0('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xaae0('0x15'))(_0xaae0('0x16'));var utils=require(_0xaae0('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xaae0('0x18'));var db=require(_0xaae0('0x19'))['db'];function respondWithStatusCode(_0x5ae60a,_0x17143d){_0x17143d=_0x17143d||0xcc;return function(_0x365697){if(_0x365697){return _0x5ae60a['sendStatus'](_0x17143d);}return _0x5ae60a['status'](_0x17143d)[_0xaae0('0x1a')]();};}function respondWithResult(_0x25b431,_0x396cb1){_0x396cb1=_0x396cb1||0xc8;return function(_0x5af12b){if(_0x5af12b){return _0x25b431['status'](_0x396cb1)[_0xaae0('0x1b')](_0x5af12b);}};}function respondWithFilteredResult(_0x42165e,_0x2e1bdf){return function(_0x37f890){if(_0x37f890){var _0x520de5=typeof _0x2e1bdf[_0xaae0('0x1c')]==='undefined'&&typeof _0x2e1bdf[_0xaae0('0x1d')]===_0xaae0('0x1e');var _0x20c1f4=_0x37f890['count'];var _0x26a535=_0x520de5?0x0:_0x2e1bdf['offset'];var _0x47067f=_0x520de5?_0x37f890[_0xaae0('0x1f')]:_0x2e1bdf['offset']+_0x2e1bdf[_0xaae0('0x1d')];var _0x220d33;if(_0x47067f>=_0x20c1f4){_0x47067f=_0x20c1f4;_0x220d33=0xc8;}else{_0x220d33=0xce;}_0x42165e[_0xaae0('0x20')](_0x220d33);return _0x42165e[_0xaae0('0x21')](_0xaae0('0x22'),_0x26a535+'-'+_0x47067f+'/'+_0x20c1f4)['json'](_0x37f890);}return null;};}function patchUpdates(_0x110c76){return function(_0x110330){try{jsonpatch[_0xaae0('0x23')](_0x110330,_0x110c76,!![]);}catch(_0x362236){return BPromise[_0xaae0('0x24')](_0x362236);}return _0x110330[_0xaae0('0x25')]();};}function saveUpdates(_0x4338be,_0x44c1cc){return function(_0x367dc9){if(_0x367dc9){return _0x367dc9[_0xaae0('0x26')](_0x4338be)[_0xaae0('0x27')](function(_0x321e6e){return _0x321e6e;});}return null;};}function removeEntity(_0x3af158,_0x24f4fe){return function(_0x330a09){if(_0x330a09){return _0x330a09[_0xaae0('0x28')]()['then'](function(){_0x3af158[_0xaae0('0x20')](0xcc)[_0xaae0('0x1a')]();});}};}function handleEntityNotFound(_0x4280b7,_0xfdcb45){return function(_0xe18864){if(!_0xe18864){_0x4280b7[_0xaae0('0x29')](0x194);}return _0xe18864;};}function handleError(_0x13f442,_0x62f365){_0x62f365=_0x62f365||0x1f4;return function(_0x13bbf9){logger[_0xaae0('0x2a')](_0x13bbf9[_0xaae0('0x2b')]);if(_0x13bbf9['name']){delete _0x13bbf9[_0xaae0('0x2c')];}_0x13f442[_0xaae0('0x20')](_0x62f365)['send'](_0x13bbf9);};}exports[_0xaae0('0x2d')]=function(_0x3a01b0,_0x36336a){var _0x5d777e={},_0x3e3e72={},_0x47645b={'count':0x0,'rows':[]};var _0x32f58f=_[_0xaae0('0x2e')](db['UserProfileSection']['rawAttributes'],function(_0xeb2585){return{'name':_0xeb2585[_0xaae0('0x2f')],'type':_0xeb2585[_0xaae0('0x30')][_0xaae0('0x31')]};});_0x3e3e72[_0xaae0('0x32')]=_['map'](_0x32f58f,_0xaae0('0x2c'));_0x3e3e72[_0xaae0('0x33')]=_['keys'](_0x3a01b0[_0xaae0('0x33')]);_0x3e3e72[_0xaae0('0x34')]=_[_0xaae0('0x35')](_0x3e3e72[_0xaae0('0x32')],_0x3e3e72[_0xaae0('0x33')]);_0x5d777e[_0xaae0('0x36')]=_[_0xaae0('0x35')](_0x3e3e72[_0xaae0('0x32')],qs[_0xaae0('0x37')](_0x3a01b0[_0xaae0('0x33')]['fields']));_0x5d777e[_0xaae0('0x36')]=_0x5d777e['attributes']['length']?_0x5d777e[_0xaae0('0x36')]:_0x3e3e72[_0xaae0('0x32')];if(!_0x3a01b0[_0xaae0('0x33')]['hasOwnProperty'](_0xaae0('0x38'))){_0x5d777e[_0xaae0('0x1d')]=qs[_0xaae0('0x1d')](_0x3a01b0[_0xaae0('0x33')][_0xaae0('0x1d')]);_0x5d777e[_0xaae0('0x1c')]=qs[_0xaae0('0x1c')](_0x3a01b0['query'][_0xaae0('0x1c')]);}_0x5d777e[_0xaae0('0x39')]=qs[_0xaae0('0x3a')](_0x3a01b0[_0xaae0('0x33')][_0xaae0('0x3a')]);_0x5d777e[_0xaae0('0x3b')]=qs['filters'](_['pick'](_0x3a01b0['query'],_0x3e3e72[_0xaae0('0x34')]),_0x32f58f);if(_0x3a01b0[_0xaae0('0x33')][_0xaae0('0x3c')]){_0x5d777e[_0xaae0('0x3b')]=_[_0xaae0('0x3d')](_0x5d777e[_0xaae0('0x3b')],{'$or':_[_0xaae0('0x2e')](_0x32f58f,function(_0x2d0f88){if(_0x2d0f88[_0xaae0('0x30')]!==_0xaae0('0x3e')){var _0x244501={};_0x244501[_0x2d0f88[_0xaae0('0x2c')]]={'$like':'%'+_0x3a01b0['query']['filter']+'%'};return _0x244501;}})});}_0x5d777e=_[_0xaae0('0x3d')]({},_0x5d777e,_0x3a01b0[_0xaae0('0x3f')]);var _0x131323={'where':_0x5d777e[_0xaae0('0x3b')]};return db[_0xaae0('0x40')][_0xaae0('0x1f')](_0x131323)['then'](function(_0x43002c){_0x47645b['count']=_0x43002c;if(_0x3a01b0['query']['includeAll']){_0x5d777e[_0xaae0('0x41')]=[{'all':!![]}];}return db['UserProfileSection']['findAll'](_0x5d777e);})[_0xaae0('0x27')](function(_0x20199c){_0x47645b[_0xaae0('0x42')]=_0x20199c;return _0x47645b;})[_0xaae0('0x27')](respondWithFilteredResult(_0x36336a,_0x5d777e))['catch'](handleError(_0x36336a,null));};exports[_0xaae0('0x43')]=function(_0x36a777,_0x1763fb){var _0x1a8c34={'raw':![],'where':{'id':_0x36a777[_0xaae0('0x44')]['id']}},_0x4b8bd3={};_0x4b8bd3['model']=_[_0xaae0('0x45')](db['UserProfileSection']['rawAttributes']);_0x4b8bd3[_0xaae0('0x33')]=_['keys'](_0x36a777[_0xaae0('0x33')]);_0x4b8bd3['filters']=_[_0xaae0('0x35')](_0x4b8bd3[_0xaae0('0x32')],_0x4b8bd3[_0xaae0('0x33')]);_0x1a8c34[_0xaae0('0x36')]=_[_0xaae0('0x35')](_0x4b8bd3[_0xaae0('0x32')],qs[_0xaae0('0x37')](_0x36a777['query']['fields']));_0x1a8c34[_0xaae0('0x36')]=_0x1a8c34[_0xaae0('0x36')]['length']?_0x1a8c34[_0xaae0('0x36')]:_0x4b8bd3[_0xaae0('0x32')];if(_0x36a777[_0xaae0('0x33')]['includeAll']){_0x1a8c34[_0xaae0('0x41')]=[{'all':!![]}];}_0x1a8c34=_[_0xaae0('0x3d')]({},_0x1a8c34,_0x36a777[_0xaae0('0x3f')]);return db[_0xaae0('0x40')][_0xaae0('0x46')](_0x1a8c34)['then'](handleEntityNotFound(_0x1763fb,null))[_0xaae0('0x27')](respondWithResult(_0x1763fb,null))[_0xaae0('0x47')](handleError(_0x1763fb,null));};exports[_0xaae0('0x48')]=function(_0x290c09,_0x59defb){return db[_0xaae0('0x40')][_0xaae0('0x48')](_0x290c09['body'],{})[_0xaae0('0x27')](respondWithResult(_0x59defb,0xc9))[_0xaae0('0x47')](handleError(_0x59defb,null));};exports['update']=function(_0x50ea8b,_0x551fc1){if(_0x50ea8b['body']['id']){delete _0x50ea8b[_0xaae0('0x49')]['id'];}return db['UserProfileSection']['find']({'where':{'id':_0x50ea8b[_0xaae0('0x44')]['id']}})[_0xaae0('0x27')](handleEntityNotFound(_0x551fc1,null))['then'](saveUpdates(_0x50ea8b[_0xaae0('0x49')],null))[_0xaae0('0x27')](respondWithResult(_0x551fc1,null))[_0xaae0('0x47')](handleError(_0x551fc1,null));};exports[_0xaae0('0x28')]=function(_0x48c03e,_0x541538){return db['UserProfileSection'][_0xaae0('0x46')]({'where':{'id':_0x48c03e[_0xaae0('0x44')]['id']}})[_0xaae0('0x27')](handleEntityNotFound(_0x541538,null))[_0xaae0('0x27')](removeEntity(_0x541538,null))[_0xaae0('0x47')](handleError(_0x541538,null));};exports[_0xaae0('0x4a')]=function(_0x14c4c5,_0x3c8502){return db['UserProfileSection'][_0xaae0('0x4a')]()[_0xaae0('0x27')](respondWithResult(_0x3c8502,null))[_0xaae0('0x47')](handleError(_0x3c8502,null));}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.model.js b/server/api/userProfileSection/userProfileSection.model.js index 85d297c..0a40577 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 _0xdb67=['UserProfileSection','user_profile_has_sections','compositeIndex','sectionId','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x2f12db,_0x4df646){var _0x4fd623=function(_0x4453ad){while(--_0x4453ad){_0x2f12db['push'](_0x2f12db['shift']());}};_0x4fd623(++_0x4df646);}(_0xdb67,0x13c));var _0x7db6=function(_0x17d72f,_0x34701c){_0x17d72f=_0x17d72f-0x0;var _0x80e91e=_0xdb67[_0x17d72f];return _0x80e91e;};'use strict';var _=require(_0x7db6('0x0'));var util=require(_0x7db6('0x1'));var logger=require(_0x7db6('0x2'))('api');var moment=require('moment');var BPromise=require(_0x7db6('0x3'));var rp=require(_0x7db6('0x4'));var fs=require('fs');var path=require(_0x7db6('0x5'));var rimraf=require(_0x7db6('0x6'));var config=require(_0x7db6('0x7'));var attributes=require('./userProfileSection.attributes');module[_0x7db6('0x8')]=function(_0xe9dff7,_0x286efa){return _0xe9dff7['define'](_0x7db6('0x9'),attributes,{'tableName':_0x7db6('0xa'),'paranoid':![],'indexes':[{'name':_0x7db6('0xb'),'fields':[_0x7db6('0xc'),'userProfileId']}],'timestamps':!![]});}; \ No newline at end of file +var _0xe312=['compositeIndex','sectionId','lodash','util','api','bluebird','request-promise','path','rimraf','exports','define','UserProfileSection','user_profile_has_sections'];(function(_0x2a6d18,_0x17d154){var _0x180d41=function(_0x209c36){while(--_0x209c36){_0x2a6d18['push'](_0x2a6d18['shift']());}};_0x180d41(++_0x17d154);}(_0xe312,0x1f0));var _0x2e31=function(_0xae7c2f,_0xf31e04){_0xae7c2f=_0xae7c2f-0x0;var _0x5d7001=_0xe312[_0xae7c2f];return _0x5d7001;};'use strict';var _=require(_0x2e31('0x0'));var util=require(_0x2e31('0x1'));var logger=require('../../config/logger')(_0x2e31('0x2'));var moment=require('moment');var BPromise=require(_0x2e31('0x3'));var rp=require(_0x2e31('0x4'));var fs=require('fs');var path=require(_0x2e31('0x5'));var rimraf=require(_0x2e31('0x6'));var config=require('../../config/environment');var attributes=require('./userProfileSection.attributes');module[_0x2e31('0x7')]=function(_0x2eceb2,_0xd11bb2){return _0x2eceb2[_0x2e31('0x8')](_0x2e31('0x9'),attributes,{'tableName':_0x2e31('0xa'),'paranoid':![],'indexes':[{'name':_0x2e31('0xb'),'fields':[_0x2e31('0xc'),'userProfileId']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.rpc.js b/server/api/userProfileSection/userProfileSection.rpc.js index 900607a..f096b59 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 _0xb322=['jayson/promise','client','http','then','info','UserProfileSection,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment'];(function(_0x296749,_0x11aace){var _0x35f57d=function(_0x3ca6d8){while(--_0x3ca6d8){_0x296749['push'](_0x296749['shift']());}};_0x35f57d(++_0x11aace);}(_0xb322,0x139));var _0x2b32=function(_0x34bb30,_0x4fbfd3){_0x34bb30=_0x34bb30-0x0;var _0x1fc98e=_0xb322[_0x34bb30];return _0x1fc98e;};'use strict';var _=require('lodash');var util=require(_0x2b32('0x0'));var moment=require(_0x2b32('0x1'));var BPromise=require(_0x2b32('0x2'));var rs=require(_0x2b32('0x3'));var fs=require('fs');var Redis=require(_0x2b32('0x4'));var db=require(_0x2b32('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x2b32('0x6'))(_0x2b32('0x7'));var config=require(_0x2b32('0x8'));var jayson=require(_0x2b32('0x9'));var client=jayson[_0x2b32('0xa')][_0x2b32('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4468a8,_0x34e75e,_0x11b2af){return new BPromise(function(_0x2c06bb,_0x40af74){return client['request'](_0x4468a8,_0x11b2af)[_0x2b32('0xc')](function(_0x86dcc4){logger[_0x2b32('0xd')](_0x2b32('0xe'),_0x34e75e,_0x2b32('0xf'));logger[_0x2b32('0x10')]('UserProfileSection,\x20%s,\x20%s,\x20%s',_0x34e75e,'request\x20sent',JSON[_0x2b32('0x11')](_0x86dcc4));if(_0x86dcc4['error']){if(_0x86dcc4[_0x2b32('0x12')][_0x2b32('0x13')]===0x1f4){logger['error'](_0x2b32('0xe'),_0x34e75e,_0x86dcc4[_0x2b32('0x12')][_0x2b32('0x14')]);return _0x40af74(_0x86dcc4[_0x2b32('0x12')][_0x2b32('0x14')]);}logger[_0x2b32('0x12')](_0x2b32('0xe'),_0x34e75e,_0x86dcc4[_0x2b32('0x12')][_0x2b32('0x14')]);return _0x2c06bb(_0x86dcc4[_0x2b32('0x12')][_0x2b32('0x14')]);}else{logger[_0x2b32('0xd')](_0x2b32('0xe'),_0x34e75e,_0x2b32('0xf'));_0x2c06bb(_0x86dcc4[_0x2b32('0x15')][_0x2b32('0x14')]);}})[_0x2b32('0x16')](function(_0x5d2545){logger[_0x2b32('0x12')](_0x2b32('0xe'),_0x34e75e,_0x5d2545);_0x40af74(_0x5d2545);});});} \ No newline at end of file +var _0xc47b=['debug','UserProfileSection,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','UserProfileSection,\x20%s,\x20%s','request\x20sent'];(function(_0x2f04b9,_0x3de71c){var _0x1dcb58=function(_0x1fdca8){while(--_0x1fdca8){_0x2f04b9['push'](_0x2f04b9['shift']());}};_0x1dcb58(++_0x3de71c);}(_0xc47b,0x14c));var _0xbc47=function(_0x29d090,_0x46c53e){_0x29d090=_0x29d090-0x0;var _0x4e3a87=_0xc47b[_0x29d090];return _0x4e3a87;};'use strict';var _=require(_0xbc47('0x0'));var util=require(_0xbc47('0x1'));var moment=require(_0xbc47('0x2'));var BPromise=require(_0xbc47('0x3'));var rs=require(_0xbc47('0x4'));var fs=require('fs');var Redis=require(_0xbc47('0x5'));var db=require(_0xbc47('0x6'))['db'];var utils=require(_0xbc47('0x7'));var logger=require(_0xbc47('0x8'))('rpc');var config=require(_0xbc47('0x9'));var jayson=require(_0xbc47('0xa'));var client=jayson[_0xbc47('0xb')][_0xbc47('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x463a82,_0x2b8732,_0x4b85ae){return new BPromise(function(_0x131a5,_0x455826){return client[_0xbc47('0xd')](_0x463a82,_0x4b85ae)[_0xbc47('0xe')](function(_0x1b8146){logger[_0xbc47('0xf')](_0xbc47('0x10'),_0x2b8732,_0xbc47('0x11'));logger[_0xbc47('0x12')](_0xbc47('0x13'),_0x2b8732,'request\x20sent',JSON['stringify'](_0x1b8146));if(_0x1b8146[_0xbc47('0x14')]){if(_0x1b8146[_0xbc47('0x14')][_0xbc47('0x15')]===0x1f4){logger['error'](_0xbc47('0x10'),_0x2b8732,_0x1b8146['error'][_0xbc47('0x16')]);return _0x455826(_0x1b8146[_0xbc47('0x14')][_0xbc47('0x16')]);}logger[_0xbc47('0x14')](_0xbc47('0x10'),_0x2b8732,_0x1b8146[_0xbc47('0x14')]['message']);return _0x131a5(_0x1b8146[_0xbc47('0x14')][_0xbc47('0x16')]);}else{logger[_0xbc47('0xf')]('UserProfileSection,\x20%s,\x20%s',_0x2b8732,_0xbc47('0x11'));_0x131a5(_0x1b8146[_0xbc47('0x17')][_0xbc47('0x16')]);}})[_0xbc47('0x18')](function(_0x1c828e){logger[_0xbc47('0x14')](_0xbc47('0x10'),_0x2b8732,_0x1c828e);_0x455826(_0x1c828e);});});} \ No newline at end of file diff --git a/server/api/userSmsQueue/index.js b/server/api/userSmsQueue/index.js index 149d913..04398ed 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(_0x220720,_0x10d6b4){var _0x20f9a7=function(_0xfd086c){while(--_0xfd086c){_0x220720['push'](_0x220720['shift']());}};_0x20f9a7(++_0x10d6b4);}(_0xa9e0,0x123));var _0x0a9e=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xa9e0[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file +var _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x6717b7,_0x378d25){var _0xa0f6ec=function(_0x943918){while(--_0x943918){_0x6717b7['push'](_0x6717b7['shift']());}};_0xa0f6ec(++_0x378d25);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.attributes.js b/server/api/userSmsQueue/userSmsQueue.attributes.js index c58221f..08add36 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 _0x78ef=['exports'];(function(_0x2e3ebb,_0x5afc59){var _0x8f027f=function(_0x29b2f3){while(--_0x29b2f3){_0x2e3ebb['push'](_0x2e3ebb['shift']());}};_0x8f027f(++_0x5afc59);}(_0x78ef,0x162));var _0xf78e=function(_0x73fc58,_0x2056a4){_0x73fc58=_0x73fc58-0x0;var _0x5861eb=_0x78ef[_0x73fc58];return _0x5861eb;};'use strict';var Sequelize=require('sequelize');module[_0xf78e('0x0')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x2899=['exports','INTEGER','sequelize'];(function(_0x1c06be,_0x31153c){var _0x237925=function(_0xcd457c){while(--_0xcd457c){_0x1c06be['push'](_0x1c06be['shift']());}};_0x237925(++_0x31153c);}(_0x2899,0xfe));var _0x9289=function(_0x3c4a53,_0x559195){_0x3c4a53=_0x3c4a53-0x0;var _0x10cc32=_0x2899[_0x3c4a53];return _0x10cc32;};'use strict';var Sequelize=require(_0x9289('0x0'));module[_0x9289('0x1')]={'penalty':{'type':Sequelize[_0x9289('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.model.js b/server/api/userSmsQueue/userSmsQueue.model.js index 77528c1..7994378 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 _0xfc46=['api','moment','request-promise','path','rimraf','../../config/environment','exports','define','UserSmsQueue','user_has_sms_queues','lodash','../../config/logger'];(function(_0x4ff860,_0x428bd4){var _0x5ac8aa=function(_0x531879){while(--_0x531879){_0x4ff860['push'](_0x4ff860['shift']());}};_0x5ac8aa(++_0x428bd4);}(_0xfc46,0x9a));var _0x6fc4=function(_0x21090b,_0x39dd3b){_0x21090b=_0x21090b-0x0;var _0x3c68d7=_0xfc46[_0x21090b];return _0x3c68d7;};'use strict';var _=require(_0x6fc4('0x0'));var util=require('util');var logger=require(_0x6fc4('0x1'))(_0x6fc4('0x2'));var moment=require(_0x6fc4('0x3'));var BPromise=require('bluebird');var rp=require(_0x6fc4('0x4'));var fs=require('fs');var path=require(_0x6fc4('0x5'));var rimraf=require(_0x6fc4('0x6'));var config=require(_0x6fc4('0x7'));var attributes=require('./userSmsQueue.attributes');module[_0x6fc4('0x8')]=function(_0xf57aa9,_0x3100a0){return _0xf57aa9[_0x6fc4('0x9')](_0x6fc4('0xa'),attributes,{'tableName':_0x6fc4('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xaa37=['util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./userSmsQueue.attributes','exports','define','user_has_sms_queues','lodash'];(function(_0x2c0c6d,_0x58ce65){var _0x562e39=function(_0x5ede1c){while(--_0x5ede1c){_0x2c0c6d['push'](_0x2c0c6d['shift']());}};_0x562e39(++_0x58ce65);}(_0xaa37,0x1d3));var _0x7aa3=function(_0x33032e,_0x31411a){_0x33032e=_0x33032e-0x0;var _0x13316b=_0xaa37[_0x33032e];return _0x13316b;};'use strict';var _=require(_0x7aa3('0x0'));var util=require(_0x7aa3('0x1'));var logger=require(_0x7aa3('0x2'))(_0x7aa3('0x3'));var moment=require('moment');var BPromise=require(_0x7aa3('0x4'));var rp=require(_0x7aa3('0x5'));var fs=require('fs');var path=require(_0x7aa3('0x6'));var rimraf=require(_0x7aa3('0x7'));var config=require(_0x7aa3('0x8'));var attributes=require(_0x7aa3('0x9'));module[_0x7aa3('0xa')]=function(_0x5b738a,_0x437b90){return _0x5b738a[_0x7aa3('0xb')]('UserSmsQueue',attributes,{'tableName':_0x7aa3('0xc'),'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 00b49d1..97f49b6 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 _0xc29f=['../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','info','request\x20sent','debug','UserSmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','UserSmsQueue,\x20%s,\x20%s','message','result','lodash','moment','bluebird','ioredis','../../mysqldb'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc29f,0x18a));var _0xfc29=function(_0x476f30,_0x26bc0c){_0x476f30=_0x476f30-0x0;var _0x21a1db=_0xc29f[_0x476f30];return _0x21a1db;};'use strict';var _=require(_0xfc29('0x0'));var util=require('util');var moment=require(_0xfc29('0x1'));var BPromise=require(_0xfc29('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfc29('0x3'));var db=require(_0xfc29('0x4'))['db'];var utils=require(_0xfc29('0x5'));var logger=require(_0xfc29('0x6'))('rpc');var config=require(_0xfc29('0x7'));var jayson=require(_0xfc29('0x8'));var client=jayson['client'][_0xfc29('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5e6b31,_0x1abbf1,_0x5ed783){return new BPromise(function(_0x5bb94f,_0x239484){return client[_0xfc29('0xa')](_0x5e6b31,_0x5ed783)['then'](function(_0x250d3f){logger[_0xfc29('0xb')]('UserSmsQueue,\x20%s,\x20%s',_0x1abbf1,_0xfc29('0xc'));logger[_0xfc29('0xd')](_0xfc29('0xe'),_0x1abbf1,'request\x20sent',JSON[_0xfc29('0xf')](_0x250d3f));if(_0x250d3f[_0xfc29('0x10')]){if(_0x250d3f[_0xfc29('0x10')][_0xfc29('0x11')]===0x1f4){logger[_0xfc29('0x10')](_0xfc29('0x12'),_0x1abbf1,_0x250d3f[_0xfc29('0x10')][_0xfc29('0x13')]);return _0x239484(_0x250d3f[_0xfc29('0x10')][_0xfc29('0x13')]);}logger[_0xfc29('0x10')](_0xfc29('0x12'),_0x1abbf1,_0x250d3f['error']['message']);return _0x5bb94f(_0x250d3f[_0xfc29('0x10')][_0xfc29('0x13')]);}else{logger[_0xfc29('0xb')]('UserSmsQueue,\x20%s,\x20%s',_0x1abbf1,_0xfc29('0xc'));_0x5bb94f(_0x250d3f[_0xfc29('0x14')][_0xfc29('0x13')]);}})['catch'](function(_0x2741f9){logger[_0xfc29('0x10')](_0xfc29('0x12'),_0x1abbf1,_0x2741f9);_0x239484(_0x2741f9);});});} \ No newline at end of file +var _0x7322=['info','request\x20sent','UserSmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','UserSmsQueue,\x20%s,\x20%s','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x4e5e6c,_0x959eb4){var _0xcf9053=function(_0x3bce18){while(--_0x3bce18){_0x4e5e6c['push'](_0x4e5e6c['shift']());}};_0xcf9053(++_0x959eb4);}(_0x7322,0x7d));var _0x2732=function(_0x26bd8e,_0x2a9fdf){_0x26bd8e=_0x26bd8e-0x0;var _0x3a659d=_0x7322[_0x26bd8e];return _0x3a659d;};'use strict';var _=require(_0x2732('0x0'));var util=require(_0x2732('0x1'));var moment=require(_0x2732('0x2'));var BPromise=require('bluebird');var rs=require(_0x2732('0x3'));var fs=require('fs');var Redis=require(_0x2732('0x4'));var db=require(_0x2732('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x2732('0x6'));var config=require(_0x2732('0x7'));var jayson=require(_0x2732('0x8'));var client=jayson[_0x2732('0x9')][_0x2732('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4a9b14,_0x367117,_0x3ff664){return new BPromise(function(_0x4ec181,_0x35a8a4){return client[_0x2732('0xb')](_0x4a9b14,_0x3ff664)[_0x2732('0xc')](function(_0x3f1691){logger[_0x2732('0xd')]('UserSmsQueue,\x20%s,\x20%s',_0x367117,_0x2732('0xe'));logger['debug'](_0x2732('0xf'),_0x367117,_0x2732('0xe'),JSON[_0x2732('0x10')](_0x3f1691));if(_0x3f1691[_0x2732('0x11')]){if(_0x3f1691[_0x2732('0x11')][_0x2732('0x12')]===0x1f4){logger[_0x2732('0x11')]('UserSmsQueue,\x20%s,\x20%s',_0x367117,_0x3f1691[_0x2732('0x11')]['message']);return _0x35a8a4(_0x3f1691[_0x2732('0x11')]['message']);}logger[_0x2732('0x11')]('UserSmsQueue,\x20%s,\x20%s',_0x367117,_0x3f1691[_0x2732('0x11')]['message']);return _0x4ec181(_0x3f1691[_0x2732('0x11')][_0x2732('0x13')]);}else{logger[_0x2732('0xd')](_0x2732('0x14'),_0x367117,_0x2732('0xe'));_0x4ec181(_0x3f1691[_0x2732('0x15')]['message']);}})[_0x2732('0x16')](function(_0xa261f3){logger[_0x2732('0x11')]('UserSmsQueue,\x20%s,\x20%s',_0x367117,_0xa261f3);_0x35a8a4(_0xa261f3);});});} \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.attributes.js b/server/api/userVoicePrefix/userVoicePrefix.attributes.js index 30002cf..c434204 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 _0x8224=['sequelize','exports','INTEGER'];(function(_0x188d31,_0x576e87){var _0x30ed33=function(_0x15f9a5){while(--_0x15f9a5){_0x188d31['push'](_0x188d31['shift']());}};_0x30ed33(++_0x576e87);}(_0x8224,0x117));var _0x4822=function(_0x2bf3a9,_0x23260b){_0x2bf3a9=_0x2bf3a9-0x0;var _0x1f6c26=_0x8224[_0x2bf3a9];return _0x1f6c26;};'use strict';var Sequelize=require(_0x4822('0x0'));module[_0x4822('0x1')]={'UserId':{'type':Sequelize['INTEGER']},'VoicePrefixId':{'type':Sequelize[_0x4822('0x2')]}}; \ No newline at end of file +var _0x4be3=['sequelize','INTEGER'];(function(_0x34ad55,_0x2fb590){var _0x4239f9=function(_0x1f95ee){while(--_0x1f95ee){_0x34ad55['push'](_0x34ad55['shift']());}};_0x4239f9(++_0x2fb590);}(_0x4be3,0x16e));var _0x34be=function(_0x2e8080,_0x5b6a25){_0x2e8080=_0x2e8080-0x0;var _0x444959=_0x4be3[_0x2e8080];return _0x444959;};'use strict';var Sequelize=require(_0x34be('0x0'));module['exports']={'UserId':{'type':Sequelize[_0x34be('0x1')]},'VoicePrefixId':{'type':Sequelize[_0x34be('0x1')]}}; \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.model.js b/server/api/userVoicePrefix/userVoicePrefix.model.js index 4118a09..46fec43 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(_0x975a0d,_0x238f48){var _0x1004f8=function(_0x834c58){while(--_0x834c58){_0x975a0d['push'](_0x975a0d['shift']());}};_0x1004f8(++_0x238f48);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5c3c0b,_0x4ee35e){_0x5c3c0b=_0x5c3c0b-0x0;var _0x52ecd2=_0xa9e0[_0x5c3c0b];return _0x52ecd2;};'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(_0x39c590,_0x4a4fa5){var _0x324534=function(_0x1640a3){while(--_0x1640a3){_0x39c590['push'](_0x39c590['shift']());}};_0x324534(++_0x4a4fa5);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1b349a,_0x22222c){_0x1b349a=_0x1b349a-0x0;var _0x5d1f7c=_0xa9e0[_0x1b349a];return _0x5d1f7c;};'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 81ced71..1fd21ef 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 _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x46bae1,_0x1fe177){var _0x544fe1=function(_0x2031a4){while(--_0x2031a4){_0x46bae1['push'](_0x46bae1['shift']());}};_0x544fe1(++_0x1fe177);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router; \ No newline at end of file +var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x3e25bc,_0x1b01f3){var _0x345958=function(_0x289e7e){while(--_0x289e7e){_0x3e25bc['push'](_0x3e25bc['shift']());}};_0x345958(++_0x1b01f3);}(_0x9c44,0x178));var _0x49c4=function(_0x279d37,_0x14de3f){_0x279d37=_0x279d37-0x0;var _0x530173=_0x9c44[_0x279d37];return _0x530173;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.attributes.js b/server/api/userVoiceQueue/userVoiceQueue.attributes.js index e577ab7..edf2801 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 _0x28d1=['INTEGER','sequelize','exports'];(function(_0x6afc97,_0x5ba962){var _0x298925=function(_0x337e7e){while(--_0x337e7e){_0x6afc97['push'](_0x6afc97['shift']());}};_0x298925(++_0x5ba962);}(_0x28d1,0x1d2));var _0x128d=function(_0x5e3822,_0x34152f){_0x5e3822=_0x5e3822-0x0;var _0x3ed66b=_0x28d1[_0x5e3822];return _0x3ed66b;};'use strict';var Sequelize=require(_0x128d('0x0'));module[_0x128d('0x1')]={'penalty':{'type':Sequelize[_0x128d('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xc492=['exports','INTEGER','sequelize'];(function(_0x16de68,_0x33d7ff){var _0x1c277e=function(_0x1d8549){while(--_0x1d8549){_0x16de68['push'](_0x16de68['shift']());}};_0x1c277e(++_0x33d7ff);}(_0xc492,0xd7));var _0x2c49=function(_0x1d6c72,_0x22e79a){_0x1d6c72=_0x1d6c72-0x0;var _0x4c3968=_0xc492[_0x1d6c72];return _0x4c3968;};'use strict';var Sequelize=require(_0x2c49('0x0'));module[_0x2c49('0x1')]={'penalty':{'type':Sequelize[_0x2c49('0x2')],'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 5145a04..b68d712 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 _0x9ab3=['path','../../config/environment','./userVoiceQueue.attributes','exports','UserVoiceQueue','util','api','moment','bluebird','request-promise'];(function(_0xc6b104,_0x1d805a){var _0x1c6fce=function(_0x1bfb3f){while(--_0x1bfb3f){_0xc6b104['push'](_0xc6b104['shift']());}};_0x1c6fce(++_0x1d805a);}(_0x9ab3,0xcd));var _0x39ab=function(_0x476b5d,_0x34d205){_0x476b5d=_0x476b5d-0x0;var _0x3858a1=_0x9ab3[_0x476b5d];return _0x3858a1;};'use strict';var _=require('lodash');var util=require(_0x39ab('0x0'));var logger=require('../../config/logger')(_0x39ab('0x1'));var moment=require(_0x39ab('0x2'));var BPromise=require(_0x39ab('0x3'));var rp=require(_0x39ab('0x4'));var fs=require('fs');var path=require(_0x39ab('0x5'));var rimraf=require('rimraf');var config=require(_0x39ab('0x6'));var attributes=require(_0x39ab('0x7'));module[_0x39ab('0x8')]=function(_0x58e77c,_0x5b778d){return _0x58e77c['define'](_0x39ab('0x9'),attributes,{'tableName':'user_has_voice_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xde6b=['../../config/environment','exports','define','UserVoiceQueue','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x146176,_0x17bbf3){var _0x167041=function(_0x2f5c4b){while(--_0x2f5c4b){_0x146176['push'](_0x146176['shift']());}};_0x167041(++_0x17bbf3);}(_0xde6b,0x14e));var _0xbde6=function(_0x37bd26,_0x5ad346){_0x37bd26=_0x37bd26-0x0;var _0xe83dc4=_0xde6b[_0x37bd26];return _0xe83dc4;};'use strict';var _=require('lodash');var util=require(_0xbde6('0x0'));var logger=require(_0xbde6('0x1'))(_0xbde6('0x2'));var moment=require(_0xbde6('0x3'));var BPromise=require(_0xbde6('0x4'));var rp=require(_0xbde6('0x5'));var fs=require('fs');var path=require(_0xbde6('0x6'));var rimraf=require('rimraf');var config=require(_0xbde6('0x7'));var attributes=require('./userVoiceQueue.attributes');module[_0xbde6('0x8')]=function(_0x415b17,_0x9cdcce){return _0x415b17[_0xbde6('0x9')](_0xbde6('0xa'),attributes,{'tableName':'user_has_voice_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.rpc.js b/server/api/userVoiceQueue/userVoiceQueue.rpc.js index 857bd66..4bb387e 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 _0xfc2c=['message','result','bluebird','randomstring','ioredis','../../config/environment','jayson/promise','request','then','info','UserVoiceQueue,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x3baabc,_0x2f0167){var _0x5abbca=function(_0x36e9f6){while(--_0x36e9f6){_0x3baabc['push'](_0x3baabc['shift']());}};_0x5abbca(++_0x2f0167);}(_0xfc2c,0x11f));var _0xcfc2=function(_0x2820ec,_0x4f1a6f){_0x2820ec=_0x2820ec-0x0;var _0x2b8fd4=_0xfc2c[_0x2820ec];return _0x2b8fd4;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xcfc2('0x0'));var rs=require(_0xcfc2('0x1'));var fs=require('fs');var Redis=require(_0xcfc2('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xcfc2('0x3'));var jayson=require(_0xcfc2('0x4'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4d96c6,_0x353b4c,_0x186cdb){return new BPromise(function(_0x1c9bb5,_0xcb2b88){return client[_0xcfc2('0x5')](_0x4d96c6,_0x186cdb)[_0xcfc2('0x6')](function(_0x4116c2){logger[_0xcfc2('0x7')](_0xcfc2('0x8'),_0x353b4c,_0xcfc2('0x9'));logger['debug']('UserVoiceQueue,\x20%s,\x20%s,\x20%s',_0x353b4c,_0xcfc2('0x9'),JSON[_0xcfc2('0xa')](_0x4116c2));if(_0x4116c2[_0xcfc2('0xb')]){if(_0x4116c2[_0xcfc2('0xb')][_0xcfc2('0xc')]===0x1f4){logger[_0xcfc2('0xb')](_0xcfc2('0x8'),_0x353b4c,_0x4116c2[_0xcfc2('0xb')]['message']);return _0xcb2b88(_0x4116c2[_0xcfc2('0xb')][_0xcfc2('0xd')]);}logger['error'](_0xcfc2('0x8'),_0x353b4c,_0x4116c2['error']['message']);return _0x1c9bb5(_0x4116c2[_0xcfc2('0xb')][_0xcfc2('0xd')]);}else{logger[_0xcfc2('0x7')](_0xcfc2('0x8'),_0x353b4c,'request\x20sent');_0x1c9bb5(_0x4116c2[_0xcfc2('0xe')][_0xcfc2('0xd')]);}})['catch'](function(_0x277f6c){logger[_0xcfc2('0xb')](_0xcfc2('0x8'),_0x353b4c,_0x277f6c);_0xcb2b88(_0x277f6c);});});} \ No newline at end of file +var _0x5404=['../../config/environment','jayson/promise','client','request','then','UserVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','UserVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','moment','bluebird','randomstring','ioredis','rpc'];(function(_0x2aec52,_0x59d962){var _0x3b8835=function(_0x3e2604){while(--_0x3e2604){_0x2aec52['push'](_0x2aec52['shift']());}};_0x3b8835(++_0x59d962);}(_0x5404,0x1ef));var _0x4540=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x5404[_0x42cae2];return _0x5f256f;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x4540('0x0'));var BPromise=require(_0x4540('0x1'));var rs=require(_0x4540('0x2'));var fs=require('fs');var Redis=require(_0x4540('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x4540('0x4'));var config=require(_0x4540('0x5'));var jayson=require(_0x4540('0x6'));var client=jayson[_0x4540('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x414a5c,_0x2df208,_0x384ae5){return new BPromise(function(_0x11f5a7,_0xcdf115){return client[_0x4540('0x8')](_0x414a5c,_0x384ae5)[_0x4540('0x9')](function(_0x29d3f9){logger['info'](_0x4540('0xa'),_0x2df208,_0x4540('0xb'));logger[_0x4540('0xc')](_0x4540('0xd'),_0x2df208,_0x4540('0xb'),JSON[_0x4540('0xe')](_0x29d3f9));if(_0x29d3f9[_0x4540('0xf')]){if(_0x29d3f9[_0x4540('0xf')][_0x4540('0x10')]===0x1f4){logger[_0x4540('0xf')](_0x4540('0xa'),_0x2df208,_0x29d3f9[_0x4540('0xf')][_0x4540('0x11')]);return _0xcdf115(_0x29d3f9[_0x4540('0xf')][_0x4540('0x11')]);}logger[_0x4540('0xf')](_0x4540('0xa'),_0x2df208,_0x29d3f9[_0x4540('0xf')][_0x4540('0x11')]);return _0x11f5a7(_0x29d3f9[_0x4540('0xf')][_0x4540('0x11')]);}else{logger[_0x4540('0x12')](_0x4540('0xa'),_0x2df208,_0x4540('0xb'));_0x11f5a7(_0x29d3f9[_0x4540('0x13')][_0x4540('0x11')]);}})['catch'](function(_0x36e53f){logger[_0x4540('0xf')]('UserVoiceQueue,\x20%s,\x20%s',_0x2df208,_0x36e53f);_0xcdf115(_0x36e53f);});});} \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/index.js b/server/api/userVoiceQueueRt/index.js index bea8f23..a6e00af 100644 --- a/server/api/userVoiceQueueRt/index.js +++ b/server/api/userVoiceQueueRt/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x2fae70,_0x4012f6){var _0x360ac0=function(_0x5f57f4){while(--_0x5f57f4){_0x2fae70['push'](_0x2fae70['shift']());}};_0x360ac0(++_0x4012f6);}(_0xe706,0xa3));var _0x6e70=function(_0x543a4e,_0x544f2e){_0x543a4e=_0x543a4e-0x0;var _0x27a3a9=_0xe706[_0x543a4e];return _0x27a3a9;};'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 _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x1232e7,_0x3808cd){var _0x29a410=function(_0x297a02){while(--_0x297a02){_0x1232e7['push'](_0x1232e7['shift']());}};_0x29a410(++_0x3808cd);}(_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 diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js index 3435e50..412a094 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 _0xa3ab=['STRING','queue_interface','sequelize','exports','INTEGER','Required\x20by\x20Asterisk'];(function(_0x229f2f,_0x4e7bd3){var _0x46913a=function(_0x3b9283){while(--_0x3b9283){_0x229f2f['push'](_0x229f2f['shift']());}};_0x46913a(++_0x4e7bd3);}(_0xa3ab,0x104));var _0xba3a=function(_0x25fe51,_0x9efc04){_0x25fe51=_0x25fe51-0x0;var _0x3c1c63=_0xa3ab[_0x25fe51];return _0x3c1c63;};'use strict';var Sequelize=require(_0xba3a('0x0'));module[_0xba3a('0x1')]={'uniqueid':{'type':Sequelize[_0xba3a('0x2')],'primaryKey':!![],'autoIncrement':!![],'comment':_0xba3a('0x3')},'membername':{'type':Sequelize[_0xba3a('0x4')],'allowNull':![],'comment':_0xba3a('0x3')},'UserId':{'type':Sequelize[_0xba3a('0x2')],'allowNull':![]},'queue_name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xba3a('0x5'),'comment':_0xba3a('0x3')},'VoiceQueueId':{'type':Sequelize[_0xba3a('0x2')],'allowNull':![]},'interface':{'type':Sequelize[_0xba3a('0x4')],'allowNull':![],'unique':_0xba3a('0x5'),'comment':_0xba3a('0x3')},'penalty':{'type':Sequelize[_0xba3a('0x2')](0xb),'defaultValue':0x0,'comment':_0xba3a('0x3')},'paused':{'type':Sequelize[_0xba3a('0x2')](0xb),'defaultValue':0x0,'comment':'Required\x20by\x20Asterisk'}}; \ No newline at end of file +var _0x9964=['STRING','Required\x20by\x20Asterisk','queue_interface','INTEGER'];(function(_0x395bfe,_0x4db521){var _0x35c81c=function(_0x484a1b){while(--_0x484a1b){_0x395bfe['push'](_0x395bfe['shift']());}};_0x35c81c(++_0x4db521);}(_0x9964,0x1d7));var _0x4996=function(_0x1b25c1,_0x2c6ce6){_0x1b25c1=_0x1b25c1-0x0;var _0x1e4447=_0x9964[_0x1b25c1];return _0x1e4447;};'use strict';var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0x4996('0x0')],'primaryKey':!![],'autoIncrement':!![],'comment':'Required\x20by\x20Asterisk'},'membername':{'type':Sequelize[_0x4996('0x1')],'allowNull':![],'comment':_0x4996('0x2')},'UserId':{'type':Sequelize[_0x4996('0x0')],'allowNull':![]},'queue_name':{'type':Sequelize[_0x4996('0x1')],'allowNull':![],'unique':_0x4996('0x3'),'comment':_0x4996('0x2')},'VoiceQueueId':{'type':Sequelize['INTEGER'],'allowNull':![]},'interface':{'type':Sequelize[_0x4996('0x1')],'allowNull':![],'unique':_0x4996('0x3'),'comment':_0x4996('0x2')},'penalty':{'type':Sequelize[_0x4996('0x0')](0xb),'defaultValue':0x0,'comment':_0x4996('0x2')},'paused':{'type':Sequelize[_0x4996('0x0')](0xb),'defaultValue':0x0,'comment':_0x4996('0x2')}}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js index 88fac17..e6eebb5 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 _0xdbce=['exports','../../mysqldb','UserVoiceQueueRt','remove','hasOwnProperty','hook'];(function(_0x5bed28,_0x3069b3){var _0x44fe9f=function(_0x5c934e){while(--_0x5c934e){_0x5bed28['push'](_0x5bed28['shift']());}};_0x44fe9f(++_0x3069b3);}(_0xdbce,0xeb));var _0xedbc=function(_0x2192ae,_0x197b1e){_0x2192ae=_0x2192ae-0x0;var _0x5d8404=_0xdbce[_0x2192ae];return _0x5d8404;};'use strict';var EventEmitter=require('events');var UserVoiceQueueRt=require(_0xedbc('0x0'))['db'][_0xedbc('0x1')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xedbc('0x2')};function emitEvent(_0x49d2cd){return function(_0x3d3cb9,_0x2bb3cb,_0x1d0472){UserVoiceQueueRtEvents['emit'](_0x49d2cd+':'+_0x3d3cb9['id'],_0x3d3cb9);UserVoiceQueueRtEvents['emit'](_0x49d2cd,_0x3d3cb9);_0x1d0472(null);};}for(var e in events){if(events[_0xedbc('0x3')](e)){var event=events[e];UserVoiceQueueRt[_0xedbc('0x4')](e,emitEvent(event));}}module[_0xedbc('0x5')]=UserVoiceQueueRtEvents; \ No newline at end of file +var _0xee99=['../../mysqldb','UserVoiceQueueRt','save','update','remove','emit','hook','events'];(function(_0x1e62b7,_0x1f166d){var _0x42aa9c=function(_0x1134db){while(--_0x1134db){_0x1e62b7['push'](_0x1e62b7['shift']());}};_0x42aa9c(++_0x1f166d);}(_0xee99,0xdf));var _0x9ee9=function(_0x26c5e6,_0x88231b){_0x26c5e6=_0x26c5e6-0x0;var _0x4f6706=_0xee99[_0x26c5e6];return _0x4f6706;};'use strict';var EventEmitter=require(_0x9ee9('0x0'));var UserVoiceQueueRt=require(_0x9ee9('0x1'))['db'][_0x9ee9('0x2')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x9ee9('0x3'),'afterUpdate':_0x9ee9('0x4'),'afterDestroy':_0x9ee9('0x5')};function emitEvent(_0x3ca5d0){return function(_0x545a31,_0x55f1bd,_0x293993){UserVoiceQueueRtEvents['emit'](_0x3ca5d0+':'+_0x545a31['id'],_0x545a31);UserVoiceQueueRtEvents[_0x9ee9('0x6')](_0x3ca5d0,_0x545a31);_0x293993(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserVoiceQueueRt[_0x9ee9('0x7')](e,emitEvent(event));}}module['exports']=UserVoiceQueueRtEvents; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js index 6a1f47b..92c5c99 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 _0xb8ee=['request-promise','path','rimraf','../../config/environment','./userVoiceQueueRt.attributes','exports','define','UserVoiceQueueRt','util','../../config/logger','api','moment'];(function(_0x59bbc3,_0x12ab06){var _0x22ebbe=function(_0x4ad230){while(--_0x4ad230){_0x59bbc3['push'](_0x59bbc3['shift']());}};_0x22ebbe(++_0x12ab06);}(_0xb8ee,0x188));var _0xeb8e=function(_0x2ecdbe,_0x114206){_0x2ecdbe=_0x2ecdbe-0x0;var _0x44d6d4=_0xb8ee[_0x2ecdbe];return _0x44d6d4;};'use strict';var _=require('lodash');var util=require(_0xeb8e('0x0'));var logger=require(_0xeb8e('0x1'))(_0xeb8e('0x2'));var moment=require(_0xeb8e('0x3'));var BPromise=require('bluebird');var rp=require(_0xeb8e('0x4'));var fs=require('fs');var path=require(_0xeb8e('0x5'));var rimraf=require(_0xeb8e('0x6'));var config=require(_0xeb8e('0x7'));var attributes=require(_0xeb8e('0x8'));module[_0xeb8e('0x9')]=function(_0x4009e5,_0xf57c51){return _0x4009e5[_0xeb8e('0xa')](_0xeb8e('0xb'),attributes,{'tableName':'user_has_voice_queues_rt','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x37c3=['lodash','util','../../config/logger','moment','bluebird','path','../../config/environment','./userVoiceQueueRt.attributes','exports','define','user_has_voice_queues_rt'];(function(_0x1dfa8a,_0x40e990){var _0x36ebe8=function(_0xd6c70e){while(--_0xd6c70e){_0x1dfa8a['push'](_0x1dfa8a['shift']());}};_0x36ebe8(++_0x40e990);}(_0x37c3,0xdc));var _0x337c=function(_0x1d5865,_0x385a06){_0x1d5865=_0x1d5865-0x0;var _0x2f064d=_0x37c3[_0x1d5865];return _0x2f064d;};'use strict';var _=require(_0x337c('0x0'));var util=require(_0x337c('0x1'));var logger=require(_0x337c('0x2'))('api');var moment=require(_0x337c('0x3'));var BPromise=require(_0x337c('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x337c('0x5'));var rimraf=require('rimraf');var config=require(_0x337c('0x6'));var attributes=require(_0x337c('0x7'));module[_0x337c('0x8')]=function(_0x33d998,_0x184fe6){return _0x33d998[_0x337c('0x9')]('UserVoiceQueueRt',attributes,{'tableName':_0x337c('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.rpc.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.rpc.js index 3156cde..373a8a3 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 _0xf082=['localhost','socket.io-emitter','./userVoiceQueueRt.socket','register','request','UserVoiceQueueRt,\x20%s,\x20%s','request\x20sent','debug','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','GetVoiceQueueRtPauses','UserVoiceQueueRt','findAll','raw','options','where','sequelize','COUNT','literal','outboundQueuePauses','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','jayson/promise','client','http','redis'];(function(_0x4001ad,_0x1e22dd){var _0x4c7ec2=function(_0x24cb8a){while(--_0x24cb8a){_0x4001ad['push'](_0x4001ad['shift']());}};_0x4c7ec2(++_0x1e22dd);}(_0xf082,0x1a5));var _0x2f08=function(_0x9170bf,_0x457a19){_0x9170bf=_0x9170bf-0x0;var _0x36dd95=_0xf082[_0x9170bf];return _0x36dd95;};'use strict';var _=require('lodash');var util=require(_0x2f08('0x0'));var moment=require(_0x2f08('0x1'));var BPromise=require(_0x2f08('0x2'));var rs=require(_0x2f08('0x3'));var fs=require('fs');var Redis=require(_0x2f08('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x2f08('0x5'))(_0x2f08('0x6'));var config=require('../../config/environment');var jayson=require(_0x2f08('0x7'));var client=jayson[_0x2f08('0x8')][_0x2f08('0x9')]({'port':0x232a});config[_0x2f08('0xa')]=_['defaults'](config[_0x2f08('0xa')],{'host':_0x2f08('0xb'),'port':0x18eb});var socket=require(_0x2f08('0xc'))(new Redis(config[_0x2f08('0xa')]));require(_0x2f08('0xd'))[_0x2f08('0xe')](socket);function respondWithRpcPromise(_0x24c9f6,_0x4acf62,_0x1fdea9){return new BPromise(function(_0x2d3a99,_0x25575e){return client[_0x2f08('0xf')](_0x24c9f6,_0x1fdea9)['then'](function(_0x4bb9be){logger['info'](_0x2f08('0x10'),_0x4acf62,_0x2f08('0x11'));logger[_0x2f08('0x12')](_0x2f08('0x13'),_0x4acf62,_0x2f08('0x11'),JSON[_0x2f08('0x14')](_0x4bb9be));if(_0x4bb9be[_0x2f08('0x15')]){if(_0x4bb9be['error'][_0x2f08('0x16')]===0x1f4){logger['error'](_0x2f08('0x10'),_0x4acf62,_0x4bb9be['error'][_0x2f08('0x17')]);return _0x25575e(_0x4bb9be[_0x2f08('0x15')][_0x2f08('0x17')]);}logger[_0x2f08('0x15')](_0x2f08('0x10'),_0x4acf62,_0x4bb9be[_0x2f08('0x15')]['message']);return _0x2d3a99(_0x4bb9be[_0x2f08('0x15')][_0x2f08('0x17')]);}else{logger[_0x2f08('0x18')](_0x2f08('0x10'),_0x4acf62,'request\x20sent');_0x2d3a99(_0x4bb9be[_0x2f08('0x19')][_0x2f08('0x17')]);}})['catch'](function(_0x157b59){logger['error'](_0x2f08('0x10'),_0x4acf62,_0x157b59);_0x25575e(_0x157b59);});});}exports[_0x2f08('0x1a')]=function(_0xb49394){var _0x1b8c8b=this;return new Promise(function(_0x212575,_0x5efc6b){return db[_0x2f08('0x1b')][_0x2f08('0x1c')]({'raw':_0xb49394['options']?_0xb49394['options'][_0x2f08('0x1d')]===undefined?!![]:![]:!![],'where':_0xb49394['options']?_0xb49394[_0x2f08('0x1e')][_0x2f08('0x1f')]||null:null,'attributes':[[db[_0x2f08('0x20')]['fn'](_0x2f08('0x21'),db[_0x2f08('0x20')]['fn']('IF',db[_0x2f08('0x20')][_0x2f08('0x22')]('`paused`\x20=\x201,\x201,\x20null'))),_0x2f08('0x23')]]})['then'](function(_0x3316ac){logger[_0x2f08('0x18')]('GetVoiceQueueRtPauses',_0xb49394);logger[_0x2f08('0x12')](_0x2f08('0x1a'),_0xb49394,JSON[_0x2f08('0x14')](_0x3316ac));_0x212575(_0x3316ac);})['catch'](function(_0x4e1cc3){logger['error'](_0x2f08('0x1a'),_0x4e1cc3[_0x2f08('0x17')],_0xb49394);_0x5efc6b(_0x1b8c8b[_0x2f08('0x15')](0x1f4,_0x4e1cc3[_0x2f08('0x17')]));});});}; \ No newline at end of file +var _0x7a1b=['UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetVoiceQueueRtPauses','UserVoiceQueueRt','findAll','options','raw','where','sequelize','literal','`paused`\x20=\x201,\x201,\x20null','outboundQueuePauses','debug','stringify','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','redis','localhost','socket.io-emitter','./userVoiceQueueRt.socket','register','request','then','info','UserVoiceQueueRt,\x20%s,\x20%s','request\x20sent'];(function(_0x406696,_0x39f9b1){var _0x10e35c=function(_0x108de3){while(--_0x108de3){_0x406696['push'](_0x406696['shift']());}};_0x10e35c(++_0x39f9b1);}(_0x7a1b,0x81));var _0xb7a1=function(_0x1001c2,_0x348adf){_0x1001c2=_0x1001c2-0x0;var _0x18ccb4=_0x7a1b[_0x1001c2];return _0x18ccb4;};'use strict';var _=require(_0xb7a1('0x0'));var util=require('util');var moment=require(_0xb7a1('0x1'));var BPromise=require(_0xb7a1('0x2'));var rs=require(_0xb7a1('0x3'));var fs=require('fs');var Redis=require(_0xb7a1('0x4'));var db=require(_0xb7a1('0x5'))['db'];var utils=require(_0xb7a1('0x6'));var logger=require('../../config/logger')(_0xb7a1('0x7'));var config=require(_0xb7a1('0x8'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});config['redis']=_['defaults'](config[_0xb7a1('0x9')],{'host':_0xb7a1('0xa'),'port':0x18eb});var socket=require(_0xb7a1('0xb'))(new Redis(config[_0xb7a1('0x9')]));require(_0xb7a1('0xc'))[_0xb7a1('0xd')](socket);function respondWithRpcPromise(_0x4eeec2,_0x4427b8,_0x1362d2){return new BPromise(function(_0x51e485,_0x26430c){return client[_0xb7a1('0xe')](_0x4eeec2,_0x1362d2)[_0xb7a1('0xf')](function(_0x3902a4){logger[_0xb7a1('0x10')](_0xb7a1('0x11'),_0x4427b8,_0xb7a1('0x12'));logger['debug'](_0xb7a1('0x13'),_0x4427b8,_0xb7a1('0x12'),JSON['stringify'](_0x3902a4));if(_0x3902a4['error']){if(_0x3902a4[_0xb7a1('0x14')][_0xb7a1('0x15')]===0x1f4){logger[_0xb7a1('0x14')](_0xb7a1('0x11'),_0x4427b8,_0x3902a4[_0xb7a1('0x14')][_0xb7a1('0x16')]);return _0x26430c(_0x3902a4[_0xb7a1('0x14')][_0xb7a1('0x16')]);}logger[_0xb7a1('0x14')](_0xb7a1('0x11'),_0x4427b8,_0x3902a4[_0xb7a1('0x14')]['message']);return _0x51e485(_0x3902a4['error'][_0xb7a1('0x16')]);}else{logger[_0xb7a1('0x10')](_0xb7a1('0x11'),_0x4427b8,_0xb7a1('0x12'));_0x51e485(_0x3902a4[_0xb7a1('0x17')][_0xb7a1('0x16')]);}})[_0xb7a1('0x18')](function(_0x4aca76){logger[_0xb7a1('0x14')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x4427b8,_0x4aca76);_0x26430c(_0x4aca76);});});}exports[_0xb7a1('0x19')]=function(_0x430a4e){var _0xec8389=this;return new Promise(function(_0x418636,_0x2a927c){return db[_0xb7a1('0x1a')][_0xb7a1('0x1b')]({'raw':_0x430a4e['options']?_0x430a4e[_0xb7a1('0x1c')][_0xb7a1('0x1d')]===undefined?!![]:![]:!![],'where':_0x430a4e[_0xb7a1('0x1c')]?_0x430a4e[_0xb7a1('0x1c')][_0xb7a1('0x1e')]||null:null,'attributes':[[db['sequelize']['fn']('COUNT',db[_0xb7a1('0x1f')]['fn']('IF',db['sequelize'][_0xb7a1('0x20')](_0xb7a1('0x21')))),_0xb7a1('0x22')]]})[_0xb7a1('0xf')](function(_0x1bef0c){logger[_0xb7a1('0x10')](_0xb7a1('0x19'),_0x430a4e);logger[_0xb7a1('0x23')](_0xb7a1('0x19'),_0x430a4e,JSON[_0xb7a1('0x24')](_0x1bef0c));_0x418636(_0x1bef0c);})[_0xb7a1('0x18')](function(_0x40a569){logger['error']('GetVoiceQueueRtPauses',_0x40a569[_0xb7a1('0x16')],_0x430a4e);_0x2a927c(_0xec8389[_0xb7a1('0x14')](0x1f4,_0x40a569[_0xb7a1('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js index 63b60e8..27907a8 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 _0xd8a5=['register','length','./userVoiceQueueRt.events','remove','update','emit','removeListener'];(function(_0x4fd109,_0x33c503){var _0x30f0a6=function(_0xc11c0d){while(--_0xc11c0d){_0x4fd109['push'](_0x4fd109['shift']());}};_0x30f0a6(++_0x33c503);}(_0xd8a5,0x160));var _0x5d8a=function(_0x558a26,_0x9a945e){_0x558a26=_0x558a26-0x0;var _0x4ae640=_0xd8a5[_0x558a26];return _0x4ae640;};'use strict';var UserVoiceQueueRtEvents=require(_0x5d8a('0x0'));var events=['save',_0x5d8a('0x1'),_0x5d8a('0x2')];function createListener(_0x4f7eae,_0x363b44){return function(_0xf03a8f){_0x363b44[_0x5d8a('0x3')](_0x4f7eae,_0xf03a8f);};}function removeListener(_0x22863c,_0x821a16){return function(){UserVoiceQueueRtEvents[_0x5d8a('0x4')](_0x22863c,_0x821a16);};}exports[_0x5d8a('0x5')]=function(_0x38eaa5){for(var _0x1ef405=0x0,_0x46ab34=events[_0x5d8a('0x6')];_0x1ef405<_0x46ab34;_0x1ef405++){var _0x3514c5=events[_0x1ef405];var _0x32cd30=createListener('userVoiceQueueRt:'+_0x3514c5,_0x38eaa5);UserVoiceQueueRtEvents['on'](_0x3514c5,_0x32cd30);}}; \ No newline at end of file +var _0xfc46=['./userVoiceQueueRt.events','remove','update','emit','register','length','userVoiceQueueRt:'];(function(_0x5a674b,_0xdb65a7){var _0xb03391=function(_0x27d855){while(--_0x27d855){_0x5a674b['push'](_0x5a674b['shift']());}};_0xb03391(++_0xdb65a7);}(_0xfc46,0x9a));var _0x6fc4=function(_0x4b3e49,_0x9e566c){_0x4b3e49=_0x4b3e49-0x0;var _0x57e339=_0xfc46[_0x4b3e49];return _0x57e339;};'use strict';var UserVoiceQueueRtEvents=require(_0x6fc4('0x0'));var events=['save',_0x6fc4('0x1'),_0x6fc4('0x2')];function createListener(_0x6a918d,_0x561fba){return function(_0x3c7815){_0x561fba[_0x6fc4('0x3')](_0x6a918d,_0x3c7815);};}function removeListener(_0x29e213,_0x3491f2){return function(){UserVoiceQueueRtEvents['removeListener'](_0x29e213,_0x3491f2);};}exports[_0x6fc4('0x4')]=function(_0xf57aa9){for(var _0x3100a0=0x0,_0x454abb=events[_0x6fc4('0x5')];_0x3100a0<_0x454abb;_0x3100a0++){var _0x241761=events[_0x3100a0];var _0x56cee3=createListener(_0x6fc4('0x6')+_0x241761,_0xf57aa9);UserVoiceQueueRtEvents['on'](_0x241761,_0x56cee3);}}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/index.js b/server/api/userWhatsappQueue/index.js index da1a954..3e7e2ea 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 _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x1f7839,_0x2a26e6){var _0x36b42e=function(_0x553222){while(--_0x553222){_0x1f7839['push'](_0x1f7839['shift']());}};_0x36b42e(++_0x2a26e6);}(_0xa9e0,0x123));var _0x0a9e=function(_0x9df060,_0x253d33){_0x9df060=_0x9df060-0x0;var _0x338dfe=_0xa9e0[_0x9df060];return _0x338dfe;};'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 _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0xc2ec9,_0x53a1e4){var _0x5333ec=function(_0x4ae2de){while(--_0x4ae2de){_0xc2ec9['push'](_0xc2ec9['shift']());}};_0x5333ec(++_0x53a1e4);}(_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/userWhatsappQueue/userWhatsappQueue.attributes.js b/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js index 45a6a6b..a06c3ad 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 _0xf84c=['exports','INTEGER','sequelize'];(function(_0xc40228,_0x3f786f){var _0x18d720=function(_0x40962c){while(--_0x40962c){_0xc40228['push'](_0xc40228['shift']());}};_0x18d720(++_0x3f786f);}(_0xf84c,0x1b5));var _0xcf84=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf84c[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xcf84('0x0'));module[_0xcf84('0x1')]={'penalty':{'type':Sequelize[_0xcf84('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xb7a0=['exports','INTEGER','sequelize'];(function(_0x2b2244,_0x20010a){var _0x1723e8=function(_0x1d90ad){while(--_0x1d90ad){_0x2b2244['push'](_0x2b2244['shift']());}};_0x1723e8(++_0x20010a);}(_0xb7a0,0x143));var _0x0b7a=function(_0x241fbc,_0x378b9f){_0x241fbc=_0x241fbc-0x0;var _0x377339=_0xb7a0[_0x241fbc];return _0x377339;};'use strict';var Sequelize=require(_0x0b7a('0x0'));module[_0x0b7a('0x1')]={'penalty':{'type':Sequelize[_0x0b7a('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 a58d117..735fef6 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 _0xad76=['request-promise','path','rimraf','../../config/environment','exports','user_has_whatsapp_queues','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x271d94,_0x35718c){var _0x29bd5e=function(_0x1ec967){while(--_0x1ec967){_0x271d94['push'](_0x271d94['shift']());}};_0x29bd5e(++_0x35718c);}(_0xad76,0x72));var _0x6ad7=function(_0x4ba4ff,_0xe0e987){_0x4ba4ff=_0x4ba4ff-0x0;var _0x38bb1c=_0xad76[_0x4ba4ff];return _0x38bb1c;};'use strict';var _=require(_0x6ad7('0x0'));var util=require(_0x6ad7('0x1'));var logger=require(_0x6ad7('0x2'))(_0x6ad7('0x3'));var moment=require(_0x6ad7('0x4'));var BPromise=require(_0x6ad7('0x5'));var rp=require(_0x6ad7('0x6'));var fs=require('fs');var path=require(_0x6ad7('0x7'));var rimraf=require(_0x6ad7('0x8'));var config=require(_0x6ad7('0x9'));var attributes=require('./userWhatsappQueue.attributes');module[_0x6ad7('0xa')]=function(_0x1e7957,_0x4d4f62){return _0x1e7957['define']('UserWhatsappQueue',attributes,{'tableName':_0x6ad7('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1273=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','user_has_whatsapp_queues','lodash','util'];(function(_0x118d06,_0x5a0d9a){var _0x3c6eb3=function(_0x265475){while(--_0x265475){_0x118d06['push'](_0x118d06['shift']());}};_0x3c6eb3(++_0x5a0d9a);}(_0x1273,0x1ae));var _0x3127=function(_0x2782b9,_0x3d8b97){_0x2782b9=_0x2782b9-0x0;var _0x453af9=_0x1273[_0x2782b9];return _0x453af9;};'use strict';var _=require(_0x3127('0x0'));var util=require(_0x3127('0x1'));var logger=require(_0x3127('0x2'))(_0x3127('0x3'));var moment=require(_0x3127('0x4'));var BPromise=require(_0x3127('0x5'));var rp=require(_0x3127('0x6'));var fs=require('fs');var path=require(_0x3127('0x7'));var rimraf=require(_0x3127('0x8'));var config=require(_0x3127('0x9'));var attributes=require('./userWhatsappQueue.attributes');module[_0x3127('0xa')]=function(_0x23caeb,_0x5d25c5){return _0x23caeb['define']('UserWhatsappQueue',attributes,{'tableName':_0x3127('0xb'),'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 32e0a49..29e75f3 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 _0x3421=['lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','jayson/promise','client','http','request','then','UserWhatsappQueue,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch'];(function(_0x269624,_0x2305a9){var _0x1e1946=function(_0x23be12){while(--_0x23be12){_0x269624['push'](_0x269624['shift']());}};_0x1e1946(++_0x2305a9);}(_0x3421,0x1e3));var _0x1342=function(_0x582478,_0x5f2229){_0x582478=_0x582478-0x0;var _0x349633=_0x3421[_0x582478];return _0x349633;};'use strict';var _=require(_0x1342('0x0'));var util=require(_0x1342('0x1'));var moment=require(_0x1342('0x2'));var BPromise=require(_0x1342('0x3'));var rs=require(_0x1342('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1342('0x5'))['db'];var utils=require(_0x1342('0x6'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x1342('0x7'));var client=jayson[_0x1342('0x8')][_0x1342('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xf399fc,_0xca71b6,_0x399e09){return new BPromise(function(_0x2b7d48,_0x2bc772){return client[_0x1342('0xa')](_0xf399fc,_0x399e09)[_0x1342('0xb')](function(_0xd5c2d6){logger['info'](_0x1342('0xc'),_0xca71b6,'request\x20sent');logger['debug']('UserWhatsappQueue,\x20%s,\x20%s,\x20%s',_0xca71b6,_0x1342('0xd'),JSON[_0x1342('0xe')](_0xd5c2d6));if(_0xd5c2d6[_0x1342('0xf')]){if(_0xd5c2d6[_0x1342('0xf')][_0x1342('0x10')]===0x1f4){logger['error'](_0x1342('0xc'),_0xca71b6,_0xd5c2d6[_0x1342('0xf')][_0x1342('0x11')]);return _0x2bc772(_0xd5c2d6[_0x1342('0xf')][_0x1342('0x11')]);}logger['error']('UserWhatsappQueue,\x20%s,\x20%s',_0xca71b6,_0xd5c2d6[_0x1342('0xf')]['message']);return _0x2b7d48(_0xd5c2d6['error'][_0x1342('0x11')]);}else{logger[_0x1342('0x12')](_0x1342('0xc'),_0xca71b6,_0x1342('0xd'));_0x2b7d48(_0xd5c2d6[_0x1342('0x13')][_0x1342('0x11')]);}})[_0x1342('0x14')](function(_0x40be16){logger[_0x1342('0xf')](_0x1342('0xc'),_0xca71b6,_0x40be16);_0x2bc772(_0x40be16);});});} \ No newline at end of file +var _0xc57a=['code','UserWhatsappQueue,\x20%s,\x20%s','message','result','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','client','http','request','then','info','request\x20sent','debug','UserWhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x19d6b7,_0x49f5ae){var _0x1a2dfc=function(_0x456e0d){while(--_0x456e0d){_0x19d6b7['push'](_0x19d6b7['shift']());}};_0x1a2dfc(++_0x49f5ae);}(_0xc57a,0x122));var _0xac57=function(_0x151edd,_0x5b2228){_0x151edd=_0x151edd-0x0;var _0x233982=_0xc57a[_0x151edd];return _0x233982;};'use strict';var _=require(_0xac57('0x0'));var util=require(_0xac57('0x1'));var moment=require(_0xac57('0x2'));var BPromise=require(_0xac57('0x3'));var rs=require(_0xac57('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xac57('0x5'))['db'];var utils=require(_0xac57('0x6'));var logger=require(_0xac57('0x7'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xac57('0x8')][_0xac57('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x28c0f3,_0x509775,_0x3aeef0){return new BPromise(function(_0x25be63,_0x3ddb67){return client[_0xac57('0xa')](_0x28c0f3,_0x3aeef0)[_0xac57('0xb')](function(_0x138653){logger[_0xac57('0xc')]('UserWhatsappQueue,\x20%s,\x20%s',_0x509775,_0xac57('0xd'));logger[_0xac57('0xe')](_0xac57('0xf'),_0x509775,_0xac57('0xd'),JSON[_0xac57('0x10')](_0x138653));if(_0x138653['error']){if(_0x138653[_0xac57('0x11')][_0xac57('0x12')]===0x1f4){logger['error'](_0xac57('0x13'),_0x509775,_0x138653[_0xac57('0x11')][_0xac57('0x14')]);return _0x3ddb67(_0x138653[_0xac57('0x11')][_0xac57('0x14')]);}logger[_0xac57('0x11')]('UserWhatsappQueue,\x20%s,\x20%s',_0x509775,_0x138653[_0xac57('0x11')]['message']);return _0x25be63(_0x138653['error'][_0xac57('0x14')]);}else{logger[_0xac57('0xc')](_0xac57('0x13'),_0x509775,'request\x20sent');_0x25be63(_0x138653[_0xac57('0x15')][_0xac57('0x14')]);}})['catch'](function(_0x3d9d9c){logger[_0xac57('0x11')]('UserWhatsappQueue,\x20%s,\x20%s',_0x509775,_0x3d9d9c);_0x3ddb67(_0x3d9d9c);});});} \ No newline at end of file diff --git a/server/api/variable/index.js b/server/api/variable/index.js index 85c7696..1326030 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 _0xf4dd=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./variable.controller','isAuthenticated','get','post','create','/:id','update','delete','destroy','exports'];(function(_0x3c3b60,_0x58cb60){var _0x24db16=function(_0x50de55){while(--_0x50de55){_0x3c3b60['push'](_0x3c3b60['shift']());}};_0x24db16(++_0x58cb60);}(_0xf4dd,0xb4));var _0xdf4d=function(_0x3e55f9,_0x303df7){_0x3e55f9=_0x3e55f9-0x0;var _0x11852f=_0xf4dd[_0x3e55f9];return _0x11852f;};'use strict';var multer=require(_0xdf4d('0x0'));var util=require(_0xdf4d('0x1'));var path=require(_0xdf4d('0x2'));var timeout=require(_0xdf4d('0x3'));var express=require(_0xdf4d('0x4'));var router=express[_0xdf4d('0x5')]();var fs_extra=require(_0xdf4d('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xdf4d('0x7'));var config=require('../../config/environment');var controller=require(_0xdf4d('0x8'));router['get']('/',auth[_0xdf4d('0x9')](),controller['index']);router[_0xdf4d('0xa')]('/:id',auth[_0xdf4d('0x9')](),controller['show']);router[_0xdf4d('0xb')]('/',auth[_0xdf4d('0x9')](),controller[_0xdf4d('0xc')]);router['put'](_0xdf4d('0xd'),auth[_0xdf4d('0x9')](),controller[_0xdf4d('0xe')]);router[_0xdf4d('0xf')](_0xdf4d('0xd'),auth[_0xdf4d('0x9')](),controller[_0xdf4d('0x10')]);module[_0xdf4d('0x11')]=router; \ No newline at end of file +var _0x6fb8=['post','create','update','delete','destroy','multer','path','connect-timeout','Router','../../components/interaction/service','../../config/environment','./variable.controller','get','isAuthenticated','index','/:id','show'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x6fb8,0x104));var _0x86fb=function(_0x4bc428,_0xf56dd9){_0x4bc428=_0x4bc428-0x0;var _0x3ca37f=_0x6fb8[_0x4bc428];return _0x3ca37f;};'use strict';var multer=require(_0x86fb('0x0'));var util=require('util');var path=require(_0x86fb('0x1'));var timeout=require(_0x86fb('0x2'));var express=require('express');var router=express[_0x86fb('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x86fb('0x4'));var config=require(_0x86fb('0x5'));var controller=require(_0x86fb('0x6'));router[_0x86fb('0x7')]('/',auth[_0x86fb('0x8')](),controller[_0x86fb('0x9')]);router[_0x86fb('0x7')](_0x86fb('0xa'),auth[_0x86fb('0x8')](),controller[_0x86fb('0xb')]);router[_0x86fb('0xc')]('/',auth[_0x86fb('0x8')](),controller[_0x86fb('0xd')]);router['put'](_0x86fb('0xa'),auth['isAuthenticated'](),controller[_0x86fb('0xe')]);router[_0x86fb('0xf')](_0x86fb('0xa'),auth['isAuthenticated'](),controller[_0x86fb('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/variable/variable.attributes.js b/server/api/variable/variable.attributes.js index 9c3ab08..616e1e5 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 _0x46ba=['STRING','sequelize','exports'];(function(_0x3452eb,_0x44035e){var _0x4244fd=function(_0x48564b){while(--_0x48564b){_0x3452eb['push'](_0x3452eb['shift']());}};_0x4244fd(++_0x44035e);}(_0x46ba,0xd9));var _0xa46b=function(_0x3feb9b,_0x3518a8){_0x3feb9b=_0x3feb9b-0x0;var _0x457c94=_0x46ba[_0x3feb9b];return _0x457c94;};'use strict';var Sequelize=require(_0xa46b('0x0'));module[_0xa46b('0x1')]={'name':{'type':Sequelize[_0xa46b('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xa46b('0x2')]}}; \ No newline at end of file +var _0x00d4=['name','sequelize','STRING'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0x00d4,0x121));var _0x400d=function(_0x45b034,_0x3a57dd){_0x45b034=_0x45b034-0x0;var _0x509cb0=_0x00d4[_0x45b034];return _0x509cb0;};'use strict';var Sequelize=require(_0x400d('0x0'));module['exports']={'name':{'type':Sequelize[_0x400d('0x1')],'unique':_0x400d('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x400d('0x1')]}}; \ No newline at end of file diff --git a/server/api/variable/variable.controller.js b/server/api/variable/variable.controller.js index d3f5336..c5cf9a8 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 _0x67d6=['pick','filter','merge','VIRTUAL','options','Variable','include','rows','catch','length','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','ejs','fs-extra','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','apply','reject','save','update','destroy','then','get','Variables','error','name','send','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','nolimit','order','sort','where'];(function(_0x1253e6,_0x31ce52){var _0x416bce=function(_0x25259f){while(--_0x25259f){_0x1253e6['push'](_0x1253e6['shift']());}};_0x416bce(++_0x31ce52);}(_0x67d6,0xb8));var _0x667d=function(_0x14476b,_0xd1a7a4){_0x14476b=_0x14476b-0x0;var _0x24e2e8=_0x67d6[_0x14476b];return _0x24e2e8;};'use strict';var emlformat=require(_0x667d('0x0'));var rimraf=require(_0x667d('0x1'));var zipdir=require(_0x667d('0x2'));var jsonpatch=require(_0x667d('0x3'));var rp=require(_0x667d('0x4'));var moment=require('moment');var BPromise=require(_0x667d('0x5'));var Mustache=require(_0x667d('0x6'));var util=require(_0x667d('0x7'));var path=require(_0x667d('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x667d('0x9'));var fs=require('fs');var fs_extra=require(_0x667d('0xa'));var _=require('lodash');var squel=require(_0x667d('0xb'));var crypto=require(_0x667d('0xc'));var jsforce=require(_0x667d('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x667d('0xe'));var querystring=require(_0x667d('0xf'));var Papa=require(_0x667d('0x10'));var Redis=require(_0x667d('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x667d('0x12'));var hardwareService=require(_0x667d('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x667d('0x14'));var config=require(_0x667d('0x15'));var licenseUtil=require(_0x667d('0x16'));var db=require(_0x667d('0x17'))['db'];function respondWithStatusCode(_0x1315b4,_0x131e0a){_0x131e0a=_0x131e0a||0xcc;return function(_0x56f5f0){if(_0x56f5f0){return _0x1315b4[_0x667d('0x18')](_0x131e0a);}return _0x1315b4[_0x667d('0x19')](_0x131e0a)['end']();};}function respondWithResult(_0x5cda6f,_0x64a76a){_0x64a76a=_0x64a76a||0xc8;return function(_0x264540){if(_0x264540){return _0x5cda6f[_0x667d('0x19')](_0x64a76a)[_0x667d('0x1a')](_0x264540);}};}function respondWithFilteredResult(_0x5901f7,_0x38403b){return function(_0x5a1e97){if(_0x5a1e97){var _0xe2778b=typeof _0x38403b[_0x667d('0x1b')]===_0x667d('0x1c')&&typeof _0x38403b[_0x667d('0x1d')]===_0x667d('0x1c');var _0xc01f3f=_0x5a1e97[_0x667d('0x1e')];var _0x351d8f=_0xe2778b?0x0:_0x38403b[_0x667d('0x1b')];var _0x5b1912=_0xe2778b?_0x5a1e97[_0x667d('0x1e')]:_0x38403b[_0x667d('0x1b')]+_0x38403b[_0x667d('0x1d')];var _0x17dec2;if(_0x5b1912>=_0xc01f3f){_0x5b1912=_0xc01f3f;_0x17dec2=0xc8;}else{_0x17dec2=0xce;}_0x5901f7[_0x667d('0x19')](_0x17dec2);return _0x5901f7[_0x667d('0x1f')]('Content-Range',_0x351d8f+'-'+_0x5b1912+'/'+_0xc01f3f)['json'](_0x5a1e97);}return null;};}function patchUpdates(_0x5e7ce6){return function(_0x3d7516){try{jsonpatch[_0x667d('0x20')](_0x3d7516,_0x5e7ce6,!![]);}catch(_0x2e0b9d){return BPromise[_0x667d('0x21')](_0x2e0b9d);}return _0x3d7516[_0x667d('0x22')]();};}function saveUpdates(_0x2be74e,_0x484ecc){return function(_0x5d5c3b){if(_0x5d5c3b){return _0x5d5c3b[_0x667d('0x23')](_0x2be74e)['then'](function(_0x5962ee){return _0x5962ee;});}return null;};}function removeEntity(_0x308d92,_0x28b28a){return function(_0x1f287d){if(_0x1f287d){return _0x1f287d[_0x667d('0x24')]()[_0x667d('0x25')](function(){var _0x85f81a=_0x1f287d[_0x667d('0x26')]({'plain':!![]});var _0x8d5d09=_0x667d('0x27');return db['UserProfileResource'][_0x667d('0x24')]({'where':{'type':_0x8d5d09,'resourceId':_0x85f81a['id']}})[_0x667d('0x25')](function(){return _0x1f287d;});})[_0x667d('0x25')](function(){_0x308d92[_0x667d('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3217f5,_0x379a2a){return function(_0x165749){if(!_0x165749){_0x3217f5['sendStatus'](0x194);}return _0x165749;};}function handleError(_0x5367f1,_0x9d0e0a){_0x9d0e0a=_0x9d0e0a||0x1f4;return function(_0xe1ae10){logger[_0x667d('0x28')](_0xe1ae10['stack']);if(_0xe1ae10[_0x667d('0x29')]){delete _0xe1ae10['name'];}_0x5367f1[_0x667d('0x19')](_0x9d0e0a)[_0x667d('0x2a')](_0xe1ae10);};}exports['index']=function(_0x1022e4,_0x5903fe){var _0x235488={},_0x508e7a={},_0x4703f1={'count':0x0,'rows':[]};var _0x7b544=_[_0x667d('0x2b')](db['Variable'][_0x667d('0x2c')],function(_0xc60752){return{'name':_0xc60752[_0x667d('0x2d')],'type':_0xc60752[_0x667d('0x2e')][_0x667d('0x2f')]};});_0x508e7a[_0x667d('0x30')]=_[_0x667d('0x2b')](_0x7b544,'name');_0x508e7a[_0x667d('0x31')]=_[_0x667d('0x32')](_0x1022e4['query']);_0x508e7a[_0x667d('0x33')]=_[_0x667d('0x34')](_0x508e7a[_0x667d('0x30')],_0x508e7a[_0x667d('0x31')]);_0x235488['attributes']=_[_0x667d('0x34')](_0x508e7a[_0x667d('0x30')],qs[_0x667d('0x35')](_0x1022e4[_0x667d('0x31')][_0x667d('0x35')]));_0x235488[_0x667d('0x36')]=_0x235488[_0x667d('0x36')]['length']?_0x235488['attributes']:_0x508e7a[_0x667d('0x30')];if(!_0x1022e4['query']['hasOwnProperty'](_0x667d('0x37'))){_0x235488[_0x667d('0x1d')]=qs[_0x667d('0x1d')](_0x1022e4[_0x667d('0x31')]['limit']);_0x235488['offset']=qs['offset'](_0x1022e4[_0x667d('0x31')]['offset']);}_0x235488[_0x667d('0x38')]=qs[_0x667d('0x39')](_0x1022e4[_0x667d('0x31')]['sort']);_0x235488[_0x667d('0x3a')]=qs['filters'](_[_0x667d('0x3b')](_0x1022e4['query'],_0x508e7a[_0x667d('0x33')]),_0x7b544);if(_0x1022e4['query'][_0x667d('0x3c')]){_0x235488[_0x667d('0x3a')]=_[_0x667d('0x3d')](_0x235488['where'],{'$or':_['map'](_0x7b544,function(_0x107d8d){if(_0x107d8d['type']!==_0x667d('0x3e')){var _0x1b35a4={};_0x1b35a4[_0x107d8d['name']]={'$like':'%'+_0x1022e4[_0x667d('0x31')][_0x667d('0x3c')]+'%'};return _0x1b35a4;}})});}_0x235488=_[_0x667d('0x3d')]({},_0x235488,_0x1022e4[_0x667d('0x3f')]);var _0x86d228={'where':_0x235488[_0x667d('0x3a')]};return db[_0x667d('0x40')]['count'](_0x86d228)['then'](function(_0x252132){_0x4703f1[_0x667d('0x1e')]=_0x252132;if(_0x1022e4[_0x667d('0x31')]['includeAll']){_0x235488[_0x667d('0x41')]=[{'all':!![]}];}return db[_0x667d('0x40')]['findAll'](_0x235488);})[_0x667d('0x25')](function(_0x87d858){_0x4703f1[_0x667d('0x42')]=_0x87d858;return _0x4703f1;})[_0x667d('0x25')](respondWithFilteredResult(_0x5903fe,_0x235488))[_0x667d('0x43')](handleError(_0x5903fe,null));};exports['show']=function(_0x2e51df,_0x16af69){var _0x2926c2={'raw':!![],'where':{'id':_0x2e51df['params']['id']}},_0x54303e={};_0x54303e[_0x667d('0x30')]=_['keys'](db[_0x667d('0x40')][_0x667d('0x2c')]);_0x54303e[_0x667d('0x31')]=_[_0x667d('0x32')](_0x2e51df[_0x667d('0x31')]);_0x54303e[_0x667d('0x33')]=_[_0x667d('0x34')](_0x54303e[_0x667d('0x30')],_0x54303e[_0x667d('0x31')]);_0x2926c2[_0x667d('0x36')]=_[_0x667d('0x34')](_0x54303e[_0x667d('0x30')],qs[_0x667d('0x35')](_0x2e51df[_0x667d('0x31')][_0x667d('0x35')]));_0x2926c2[_0x667d('0x36')]=_0x2926c2['attributes'][_0x667d('0x44')]?_0x2926c2[_0x667d('0x36')]:_0x54303e[_0x667d('0x30')];if(_0x2e51df[_0x667d('0x31')][_0x667d('0x45')]){_0x2926c2[_0x667d('0x41')]=[{'all':!![]}];}_0x2926c2=_['merge']({},_0x2926c2,_0x2e51df[_0x667d('0x3f')]);return db['Variable'][_0x667d('0x46')](_0x2926c2)[_0x667d('0x25')](handleEntityNotFound(_0x16af69,null))[_0x667d('0x25')](respondWithResult(_0x16af69,null))[_0x667d('0x43')](handleError(_0x16af69,null));};exports[_0x667d('0x47')]=function(_0x8cd721,_0x60a51){return db[_0x667d('0x40')]['create'](_0x8cd721[_0x667d('0x48')],{})['then'](function(_0x8ba3db){var _0x3f6614=_0x8cd721[_0x667d('0x49')][_0x667d('0x26')]({'plain':!![]});if(!_0x3f6614)throw new Error(_0x667d('0x4a'));if(_0x3f6614[_0x667d('0x4b')]===_0x667d('0x49')){var _0x467b5f=_0x8ba3db[_0x667d('0x26')]({'plain':!![]});var _0x40a546=_0x667d('0x27');return db[_0x667d('0x4c')][_0x667d('0x46')]({'where':{'name':_0x40a546,'userProfileId':_0x3f6614[_0x667d('0x4d')]},'raw':!![]})[_0x667d('0x25')](function(_0x303d38){if(_0x303d38&&_0x303d38[_0x667d('0x4e')]===0x0){return db['UserProfileResource'][_0x667d('0x47')]({'name':_0x467b5f[_0x667d('0x29')],'resourceId':_0x467b5f['id'],'type':_0x303d38[_0x667d('0x29')],'sectionId':_0x303d38['id']},{})[_0x667d('0x25')](function(){return _0x8ba3db;});}else{return _0x8ba3db;}})[_0x667d('0x43')](function(_0x53b749){logger[_0x667d('0x28')](_0x667d('0x4f'),_0x53b749);throw _0x53b749;});}return _0x8ba3db;})[_0x667d('0x25')](respondWithResult(_0x60a51,0xc9))[_0x667d('0x43')](handleError(_0x60a51,null));};exports[_0x667d('0x23')]=function(_0x37f4d6,_0x27eee0){if(_0x37f4d6[_0x667d('0x48')]['id']){delete _0x37f4d6[_0x667d('0x48')]['id'];}return db[_0x667d('0x40')][_0x667d('0x46')]({'where':{'id':_0x37f4d6[_0x667d('0x50')]['id']}})[_0x667d('0x25')](handleEntityNotFound(_0x27eee0,null))['then'](saveUpdates(_0x37f4d6[_0x667d('0x48')],null))[_0x667d('0x25')](respondWithResult(_0x27eee0,null))[_0x667d('0x43')](handleError(_0x27eee0,null));};exports[_0x667d('0x24')]=function(_0x1a60f4,_0x5abccd){return db[_0x667d('0x40')][_0x667d('0x46')]({'where':{'id':_0x1a60f4[_0x667d('0x50')]['id']}})[_0x667d('0x25')](handleEntityNotFound(_0x5abccd,null))[_0x667d('0x25')](removeEntity(_0x5abccd,null))[_0x667d('0x43')](handleError(_0x5abccd,null));}; \ No newline at end of file +var _0xb50e=['squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','apply','update','then','destroy','get','Variables','sendStatus','error','stack','name','send','map','Variable','rawAttributes','fieldName','type','model','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','filter','includeAll','include','rows','catch','show','params','keys','length','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra'];(function(_0x22af28,_0x58fdad){var _0x56a08c=function(_0x3d2328){while(--_0x3d2328){_0x22af28['push'](_0x22af28['shift']());}};_0x56a08c(++_0x58fdad);}(_0xb50e,0x18d));var _0xeb50=function(_0x48e86c,_0x9f034d){_0x48e86c=_0x48e86c-0x0;var _0x54fa11=_0xb50e[_0x48e86c];return _0x54fa11;};'use strict';var emlformat=require(_0xeb50('0x0'));var rimraf=require(_0xeb50('0x1'));var zipdir=require(_0xeb50('0x2'));var jsonpatch=require(_0xeb50('0x3'));var rp=require(_0xeb50('0x4'));var moment=require(_0xeb50('0x5'));var BPromise=require(_0xeb50('0x6'));var Mustache=require(_0xeb50('0x7'));var util=require(_0xeb50('0x8'));var path=require(_0xeb50('0x9'));var sox=require(_0xeb50('0xa'));var csv=require('to-csv');var ejs=require(_0xeb50('0xb'));var fs=require('fs');var fs_extra=require(_0xeb50('0xc'));var _=require('lodash');var squel=require(_0xeb50('0xd'));var crypto=require(_0xeb50('0xe'));var jsforce=require(_0xeb50('0xf'));var deskjs=require(_0xeb50('0x10'));var toCsv=require(_0xeb50('0x11'));var querystring=require(_0xeb50('0x12'));var Papa=require(_0xeb50('0x13'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xeb50('0x14'));var hardwareService=require(_0xeb50('0x15'));var logger=require('../../config/logger')(_0xeb50('0x16'));var utils=require(_0xeb50('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xeb50('0x18'));var db=require(_0xeb50('0x19'))['db'];function respondWithStatusCode(_0x27105c,_0x25dfe0){_0x25dfe0=_0x25dfe0||0xcc;return function(_0x59c137){if(_0x59c137){return _0x27105c['sendStatus'](_0x25dfe0);}return _0x27105c[_0xeb50('0x1a')](_0x25dfe0)[_0xeb50('0x1b')]();};}function respondWithResult(_0x5c77b3,_0x5aaa0c){_0x5aaa0c=_0x5aaa0c||0xc8;return function(_0x5791d3){if(_0x5791d3){return _0x5c77b3[_0xeb50('0x1a')](_0x5aaa0c)[_0xeb50('0x1c')](_0x5791d3);}};}function respondWithFilteredResult(_0x4b5702,_0x6cfae7){return function(_0x7cddaa){if(_0x7cddaa){var _0x5b4b71=typeof _0x6cfae7[_0xeb50('0x1d')]===_0xeb50('0x1e')&&typeof _0x6cfae7[_0xeb50('0x1f')]===_0xeb50('0x1e');var _0x134ffb=_0x7cddaa[_0xeb50('0x20')];var _0x257882=_0x5b4b71?0x0:_0x6cfae7['offset'];var _0xf1063=_0x5b4b71?_0x7cddaa['count']:_0x6cfae7[_0xeb50('0x1d')]+_0x6cfae7[_0xeb50('0x1f')];var _0x36df27;if(_0xf1063>=_0x134ffb){_0xf1063=_0x134ffb;_0x36df27=0xc8;}else{_0x36df27=0xce;}_0x4b5702['status'](_0x36df27);return _0x4b5702[_0xeb50('0x21')]('Content-Range',_0x257882+'-'+_0xf1063+'/'+_0x134ffb)[_0xeb50('0x1c')](_0x7cddaa);}return null;};}function patchUpdates(_0x58b4db){return function(_0x533869){try{jsonpatch[_0xeb50('0x22')](_0x533869,_0x58b4db,!![]);}catch(_0x369055){return BPromise['reject'](_0x369055);}return _0x533869['save']();};}function saveUpdates(_0x467619,_0x4bb83c){return function(_0x14fccf){if(_0x14fccf){return _0x14fccf[_0xeb50('0x23')](_0x467619)[_0xeb50('0x24')](function(_0x3dc538){return _0x3dc538;});}return null;};}function removeEntity(_0x155124,_0x3bf751){return function(_0x47c0db){if(_0x47c0db){return _0x47c0db[_0xeb50('0x25')]()[_0xeb50('0x24')](function(){var _0x49aa3c=_0x47c0db[_0xeb50('0x26')]({'plain':!![]});var _0x5bb53b=_0xeb50('0x27');return db['UserProfileResource'][_0xeb50('0x25')]({'where':{'type':_0x5bb53b,'resourceId':_0x49aa3c['id']}})[_0xeb50('0x24')](function(){return _0x47c0db;});})[_0xeb50('0x24')](function(){_0x155124[_0xeb50('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x356b22,_0x5a5802){return function(_0x49e37b){if(!_0x49e37b){_0x356b22[_0xeb50('0x28')](0x194);}return _0x49e37b;};}function handleError(_0x5776fa,_0x32756b){_0x32756b=_0x32756b||0x1f4;return function(_0x534227){logger[_0xeb50('0x29')](_0x534227[_0xeb50('0x2a')]);if(_0x534227['name']){delete _0x534227[_0xeb50('0x2b')];}_0x5776fa[_0xeb50('0x1a')](_0x32756b)[_0xeb50('0x2c')](_0x534227);};}exports['index']=function(_0x32ac89,_0x2b8fbc){var _0x456001={},_0x2b3a3c={},_0x59fece={'count':0x0,'rows':[]};var _0xa269=_[_0xeb50('0x2d')](db[_0xeb50('0x2e')][_0xeb50('0x2f')],function(_0x2d301f){return{'name':_0x2d301f[_0xeb50('0x30')],'type':_0x2d301f[_0xeb50('0x31')]['key']};});_0x2b3a3c[_0xeb50('0x32')]=_['map'](_0xa269,'name');_0x2b3a3c[_0xeb50('0x33')]=_['keys'](_0x32ac89[_0xeb50('0x33')]);_0x2b3a3c[_0xeb50('0x34')]=_['intersection'](_0x2b3a3c[_0xeb50('0x32')],_0x2b3a3c[_0xeb50('0x33')]);_0x456001[_0xeb50('0x35')]=_[_0xeb50('0x36')](_0x2b3a3c[_0xeb50('0x32')],qs[_0xeb50('0x37')](_0x32ac89[_0xeb50('0x33')]['fields']));_0x456001[_0xeb50('0x35')]=_0x456001['attributes']['length']?_0x456001[_0xeb50('0x35')]:_0x2b3a3c[_0xeb50('0x32')];if(!_0x32ac89[_0xeb50('0x33')][_0xeb50('0x38')](_0xeb50('0x39'))){_0x456001['limit']=qs[_0xeb50('0x1f')](_0x32ac89[_0xeb50('0x33')][_0xeb50('0x1f')]);_0x456001['offset']=qs[_0xeb50('0x1d')](_0x32ac89[_0xeb50('0x33')][_0xeb50('0x1d')]);}_0x456001[_0xeb50('0x3a')]=qs[_0xeb50('0x3b')](_0x32ac89[_0xeb50('0x33')][_0xeb50('0x3b')]);_0x456001[_0xeb50('0x3c')]=qs[_0xeb50('0x34')](_[_0xeb50('0x3d')](_0x32ac89[_0xeb50('0x33')],_0x2b3a3c[_0xeb50('0x34')]),_0xa269);if(_0x32ac89[_0xeb50('0x33')]['filter']){_0x456001[_0xeb50('0x3c')]=_['merge'](_0x456001[_0xeb50('0x3c')],{'$or':_[_0xeb50('0x2d')](_0xa269,function(_0x19fb64){if(_0x19fb64[_0xeb50('0x31')]!==_0xeb50('0x3e')){var _0x4de291={};_0x4de291[_0x19fb64[_0xeb50('0x2b')]]={'$like':'%'+_0x32ac89[_0xeb50('0x33')][_0xeb50('0x3f')]+'%'};return _0x4de291;}})});}_0x456001=_['merge']({},_0x456001,_0x32ac89['options']);var _0x13fadf={'where':_0x456001[_0xeb50('0x3c')]};return db['Variable']['count'](_0x13fadf)['then'](function(_0x572c16){_0x59fece[_0xeb50('0x20')]=_0x572c16;if(_0x32ac89[_0xeb50('0x33')][_0xeb50('0x40')]){_0x456001[_0xeb50('0x41')]=[{'all':!![]}];}return db[_0xeb50('0x2e')]['findAll'](_0x456001);})[_0xeb50('0x24')](function(_0x21bb66){_0x59fece[_0xeb50('0x42')]=_0x21bb66;return _0x59fece;})[_0xeb50('0x24')](respondWithFilteredResult(_0x2b8fbc,_0x456001))[_0xeb50('0x43')](handleError(_0x2b8fbc,null));};exports[_0xeb50('0x44')]=function(_0x29d766,_0x52dc8d){var _0x1572b0={'raw':!![],'where':{'id':_0x29d766[_0xeb50('0x45')]['id']}},_0x30154b={};_0x30154b[_0xeb50('0x32')]=_[_0xeb50('0x46')](db[_0xeb50('0x2e')][_0xeb50('0x2f')]);_0x30154b['query']=_['keys'](_0x29d766['query']);_0x30154b[_0xeb50('0x34')]=_[_0xeb50('0x36')](_0x30154b['model'],_0x30154b[_0xeb50('0x33')]);_0x1572b0[_0xeb50('0x35')]=_[_0xeb50('0x36')](_0x30154b[_0xeb50('0x32')],qs[_0xeb50('0x37')](_0x29d766['query'][_0xeb50('0x37')]));_0x1572b0[_0xeb50('0x35')]=_0x1572b0[_0xeb50('0x35')][_0xeb50('0x47')]?_0x1572b0[_0xeb50('0x35')]:_0x30154b[_0xeb50('0x32')];if(_0x29d766[_0xeb50('0x33')][_0xeb50('0x40')]){_0x1572b0['include']=[{'all':!![]}];}_0x1572b0=_['merge']({},_0x1572b0,_0x29d766[_0xeb50('0x48')]);return db['Variable'][_0xeb50('0x49')](_0x1572b0)[_0xeb50('0x24')](handleEntityNotFound(_0x52dc8d,null))[_0xeb50('0x24')](respondWithResult(_0x52dc8d,null))[_0xeb50('0x43')](handleError(_0x52dc8d,null));};exports['create']=function(_0x390b09,_0x5ea3e3){return db['Variable'][_0xeb50('0x4a')](_0x390b09[_0xeb50('0x4b')],{})[_0xeb50('0x24')](function(_0x404891){var _0x5a77f4=_0x390b09[_0xeb50('0x4c')]['get']({'plain':!![]});if(!_0x5a77f4)throw new Error(_0xeb50('0x4d'));if(_0x5a77f4['role']===_0xeb50('0x4c')){var _0x440e17=_0x404891[_0xeb50('0x26')]({'plain':!![]});var _0x460765='Variables';return db[_0xeb50('0x4e')][_0xeb50('0x49')]({'where':{'name':_0x460765,'userProfileId':_0x5a77f4[_0xeb50('0x4f')]},'raw':!![]})[_0xeb50('0x24')](function(_0x3533d3){if(_0x3533d3&&_0x3533d3['autoAssociation']===0x0){return db[_0xeb50('0x50')][_0xeb50('0x4a')]({'name':_0x440e17[_0xeb50('0x2b')],'resourceId':_0x440e17['id'],'type':_0x3533d3['name'],'sectionId':_0x3533d3['id']},{})[_0xeb50('0x24')](function(){return _0x404891;});}else{return _0x404891;}})[_0xeb50('0x43')](function(_0x1d4de4){logger[_0xeb50('0x29')](_0xeb50('0x51'),_0x1d4de4);throw _0x1d4de4;});}return _0x404891;})[_0xeb50('0x24')](respondWithResult(_0x5ea3e3,0xc9))['catch'](handleError(_0x5ea3e3,null));};exports[_0xeb50('0x23')]=function(_0x447a39,_0x597914){if(_0x447a39['body']['id']){delete _0x447a39['body']['id'];}return db[_0xeb50('0x2e')]['find']({'where':{'id':_0x447a39['params']['id']}})[_0xeb50('0x24')](handleEntityNotFound(_0x597914,null))[_0xeb50('0x24')](saveUpdates(_0x447a39[_0xeb50('0x4b')],null))['then'](respondWithResult(_0x597914,null))[_0xeb50('0x43')](handleError(_0x597914,null));};exports['destroy']=function(_0x9ae2f9,_0x4d010b){return db['Variable'][_0xeb50('0x49')]({'where':{'id':_0x9ae2f9[_0xeb50('0x45')]['id']}})[_0xeb50('0x24')](handleEntityNotFound(_0x4d010b,null))[_0xeb50('0x24')](removeEntity(_0x4d010b,null))[_0xeb50('0x43')](handleError(_0x4d010b,null));}; \ No newline at end of file diff --git a/server/api/variable/variable.model.js b/server/api/variable/variable.model.js index e0f66bf..21e9e03 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 _0x9b22=['../../config/environment','./variable.attributes','exports','define','tools_variables','util','../../config/logger','api','moment','request-promise','path','rimraf'];(function(_0xe19bf,_0x13f982){var _0x3f30c0=function(_0x43f5f6){while(--_0x43f5f6){_0xe19bf['push'](_0xe19bf['shift']());}};_0x3f30c0(++_0x13f982);}(_0x9b22,0x1cd));var _0x29b2=function(_0x48ee3a,_0x19b0e8){_0x48ee3a=_0x48ee3a-0x0;var _0x2ee85c=_0x9b22[_0x48ee3a];return _0x2ee85c;};'use strict';var _=require('lodash');var util=require(_0x29b2('0x0'));var logger=require(_0x29b2('0x1'))(_0x29b2('0x2'));var moment=require(_0x29b2('0x3'));var BPromise=require('bluebird');var rp=require(_0x29b2('0x4'));var fs=require('fs');var path=require(_0x29b2('0x5'));var rimraf=require(_0x29b2('0x6'));var config=require(_0x29b2('0x7'));var attributes=require(_0x29b2('0x8'));module[_0x29b2('0x9')]=function(_0x328621,_0x5e1235){return _0x328621[_0x29b2('0xa')]('Variable',attributes,{'tableName':_0x29b2('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2e59=['util','api','bluebird','path','rimraf','../../config/environment','./variable.attributes','exports','define','tools_variables','lodash'];(function(_0x3fad96,_0x551362){var _0x5b8dba=function(_0x27ba60){while(--_0x27ba60){_0x3fad96['push'](_0x3fad96['shift']());}};_0x5b8dba(++_0x551362);}(_0x2e59,0xc5));var _0x92e5=function(_0x46efd7,_0x43f84d){_0x46efd7=_0x46efd7-0x0;var _0x5637e4=_0x2e59[_0x46efd7];return _0x5637e4;};'use strict';var _=require(_0x92e5('0x0'));var util=require(_0x92e5('0x1'));var logger=require('../../config/logger')(_0x92e5('0x2'));var moment=require('moment');var BPromise=require(_0x92e5('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x92e5('0x4'));var rimraf=require(_0x92e5('0x5'));var config=require(_0x92e5('0x6'));var attributes=require(_0x92e5('0x7'));module[_0x92e5('0x8')]=function(_0x5cf4bf,_0x3b91c9){return _0x5cf4bf[_0x92e5('0x9')]('Variable',attributes,{'tableName':_0x92e5('0xa'),'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 30673e9..554293f 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 _0xabce=['moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','client','then','info','Variable,\x20%s,\x20%s','request\x20sent','debug','Variable,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','ShowVariable','Variable','find','options','attributes','map','include','model','catch','lodash','util'];(function(_0x4822bd,_0xbcc68c){var _0x4fbfa4=function(_0x13eef0){while(--_0x13eef0){_0x4822bd['push'](_0x4822bd['shift']());}};_0x4fbfa4(++_0xbcc68c);}(_0xabce,0x103));var _0xeabc=function(_0x220dbb,_0x99328d){_0x220dbb=_0x220dbb-0x0;var _0x2b77de=_0xabce[_0x220dbb];return _0x2b77de;};'use strict';var _=require(_0xeabc('0x0'));var util=require(_0xeabc('0x1'));var moment=require(_0xeabc('0x2'));var BPromise=require(_0xeabc('0x3'));var rs=require(_0xeabc('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xeabc('0x5'));var logger=require(_0xeabc('0x6'))(_0xeabc('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xeabc('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x229ba4,_0x52ede8,_0x3bdc29){return new BPromise(function(_0x9417af,_0x8434c5){return client['request'](_0x229ba4,_0x3bdc29)[_0xeabc('0x9')](function(_0x341f16){logger[_0xeabc('0xa')](_0xeabc('0xb'),_0x52ede8,_0xeabc('0xc'));logger[_0xeabc('0xd')](_0xeabc('0xe'),_0x52ede8,_0xeabc('0xc'),JSON[_0xeabc('0xf')](_0x341f16));if(_0x341f16[_0xeabc('0x10')]){if(_0x341f16[_0xeabc('0x10')][_0xeabc('0x11')]===0x1f4){logger[_0xeabc('0x10')](_0xeabc('0xb'),_0x52ede8,_0x341f16[_0xeabc('0x10')][_0xeabc('0x12')]);return _0x8434c5(_0x341f16['error'][_0xeabc('0x12')]);}logger[_0xeabc('0x10')](_0xeabc('0xb'),_0x52ede8,_0x341f16['error']['message']);return _0x9417af(_0x341f16[_0xeabc('0x10')][_0xeabc('0x12')]);}else{logger[_0xeabc('0xa')]('Variable,\x20%s,\x20%s',_0x52ede8,_0xeabc('0xc'));_0x9417af(_0x341f16[_0xeabc('0x13')]['message']);}})['catch'](function(_0x10fa8e){logger['error'](_0xeabc('0xb'),_0x52ede8,_0x10fa8e);_0x8434c5(_0x10fa8e);});});}exports[_0xeabc('0x14')]=function(_0x58a3c0){var _0x16f08b=this;return new Promise(function(_0x31dd53,_0x31f52a){return db[_0xeabc('0x15')][_0xeabc('0x16')]({'raw':_0x58a3c0['options']?_0x58a3c0[_0xeabc('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x58a3c0[_0xeabc('0x17')]?_0x58a3c0[_0xeabc('0x17')]['where']||null:null,'attributes':_0x58a3c0[_0xeabc('0x17')]?_0x58a3c0[_0xeabc('0x17')][_0xeabc('0x18')]||null:null,'include':_0x58a3c0[_0xeabc('0x17')]?_0x58a3c0[_0xeabc('0x17')]['include']?_[_0xeabc('0x19')](_0x58a3c0[_0xeabc('0x17')][_0xeabc('0x1a')],function(_0x5bdd57){return{'model':db[_0x5bdd57[_0xeabc('0x1b')]],'as':_0x5bdd57['as'],'attributes':_0x5bdd57[_0xeabc('0x18')],'include':_0x5bdd57[_0xeabc('0x1a')]?_[_0xeabc('0x19')](_0x5bdd57['include'],function(_0x109e1d){return{'model':db[_0x109e1d['model']],'as':_0x109e1d['as'],'attributes':_0x109e1d[_0xeabc('0x18')],'include':_0x109e1d['include']?_[_0xeabc('0x19')](_0x109e1d[_0xeabc('0x1a')],function(_0x269621){return{'model':db[_0x269621[_0xeabc('0x1b')]],'as':_0x269621['as'],'attributes':_0x269621[_0xeabc('0x18')]};}):[]};}):[]};}):[]:[]})[_0xeabc('0x9')](function(_0x131722){logger['info']('ShowVariable',_0x58a3c0);logger[_0xeabc('0xd')]('ShowVariable',_0x58a3c0,JSON[_0xeabc('0xf')](_0x131722));_0x31dd53(_0x131722);})[_0xeabc('0x1c')](function(_0x48fb52){logger[_0xeabc('0x10')](_0xeabc('0x14'),_0x48fb52[_0xeabc('0x12')],_0x58a3c0);_0x31f52a(_0x16f08b[_0xeabc('0x10')](0x1f4,_0x48fb52[_0xeabc('0x12')]));});});}; \ No newline at end of file +var _0x55ca=['options','where','attributes','include','map','model','lodash','util','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','Variable,\x20%s,\x20%s','request\x20sent','debug','Variable,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','ShowVariable','Variable','find'];(function(_0x423e4b,_0x1bb75b){var _0x626fd4=function(_0x1e731e){while(--_0x1e731e){_0x423e4b['push'](_0x423e4b['shift']());}};_0x626fd4(++_0x1bb75b);}(_0x55ca,0x126));var _0xa55c=function(_0x5a77fb,_0x2d2d59){_0x5a77fb=_0x5a77fb-0x0;var _0x6ca4fb=_0x55ca[_0x5a77fb];return _0x6ca4fb;};'use strict';var _=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa55c('0x2'));var db=require(_0xa55c('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xa55c('0x4'))(_0xa55c('0x5'));var config=require(_0xa55c('0x6'));var jayson=require(_0xa55c('0x7'));var client=jayson[_0xa55c('0x8')][_0xa55c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x36b623,_0x4d0624,_0x2121fd){return new BPromise(function(_0x2537f0,_0x57e069){return client[_0xa55c('0xa')](_0x36b623,_0x2121fd)[_0xa55c('0xb')](function(_0x52a3bc){logger['info'](_0xa55c('0xc'),_0x4d0624,_0xa55c('0xd'));logger[_0xa55c('0xe')](_0xa55c('0xf'),_0x4d0624,_0xa55c('0xd'),JSON[_0xa55c('0x10')](_0x52a3bc));if(_0x52a3bc[_0xa55c('0x11')]){if(_0x52a3bc[_0xa55c('0x11')][_0xa55c('0x12')]===0x1f4){logger[_0xa55c('0x11')]('Variable,\x20%s,\x20%s',_0x4d0624,_0x52a3bc['error'][_0xa55c('0x13')]);return _0x57e069(_0x52a3bc['error']['message']);}logger['error'](_0xa55c('0xc'),_0x4d0624,_0x52a3bc[_0xa55c('0x11')][_0xa55c('0x13')]);return _0x2537f0(_0x52a3bc[_0xa55c('0x11')][_0xa55c('0x13')]);}else{logger[_0xa55c('0x14')]('Variable,\x20%s,\x20%s',_0x4d0624,_0xa55c('0xd'));_0x2537f0(_0x52a3bc[_0xa55c('0x15')][_0xa55c('0x13')]);}})[_0xa55c('0x16')](function(_0x1c4cfd){logger[_0xa55c('0x11')](_0xa55c('0xc'),_0x4d0624,_0x1c4cfd);_0x57e069(_0x1c4cfd);});});}exports[_0xa55c('0x17')]=function(_0x24783b){var _0x4cee3c=this;return new Promise(function(_0x3d4c9e,_0x104a99){return db[_0xa55c('0x18')][_0xa55c('0x19')]({'raw':_0x24783b[_0xa55c('0x1a')]?_0x24783b[_0xa55c('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x24783b['options']?_0x24783b[_0xa55c('0x1a')][_0xa55c('0x1b')]||null:null,'attributes':_0x24783b[_0xa55c('0x1a')]?_0x24783b['options'][_0xa55c('0x1c')]||null:null,'include':_0x24783b[_0xa55c('0x1a')]?_0x24783b['options'][_0xa55c('0x1d')]?_[_0xa55c('0x1e')](_0x24783b[_0xa55c('0x1a')][_0xa55c('0x1d')],function(_0x234372){return{'model':db[_0x234372['model']],'as':_0x234372['as'],'attributes':_0x234372[_0xa55c('0x1c')],'include':_0x234372['include']?_['map'](_0x234372['include'],function(_0x19ae88){return{'model':db[_0x19ae88['model']],'as':_0x19ae88['as'],'attributes':_0x19ae88[_0xa55c('0x1c')],'include':_0x19ae88[_0xa55c('0x1d')]?_[_0xa55c('0x1e')](_0x19ae88[_0xa55c('0x1d')],function(_0x2313a9){return{'model':db[_0x2313a9[_0xa55c('0x1f')]],'as':_0x2313a9['as'],'attributes':_0x2313a9[_0xa55c('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xa55c('0xb')](function(_0x192df2){logger[_0xa55c('0x14')](_0xa55c('0x17'),_0x24783b);logger['debug'](_0xa55c('0x17'),_0x24783b,JSON[_0xa55c('0x10')](_0x192df2));_0x3d4c9e(_0x192df2);})[_0xa55c('0x16')](function(_0x906caa){logger['error'](_0xa55c('0x17'),_0x906caa[_0xa55c('0x13')],_0x24783b);_0x104a99(_0x4cee3c[_0xa55c('0x11')](0x1f4,_0x906caa[_0xa55c('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/version/index.js b/server/api/version/index.js index adf6ba8..94bdd72 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 _0x4b11=['/fetch','isAuthenticated','canUpdate','fetch','/reset','reset','/pull','/restart','restart','/migrations','exports','express','Router','get','index'];(function(_0x577783,_0x47a5ca){var _0x4362f3=function(_0x152cdb){while(--_0x152cdb){_0x577783['push'](_0x577783['shift']());}};_0x4362f3(++_0x47a5ca);}(_0x4b11,0x74));var _0x14b1=function(_0x5ca51a,_0x5d2d6d){_0x5ca51a=_0x5ca51a-0x0;var _0x5bc89c=_0x4b11[_0x5ca51a];return _0x5bc89c;};'use strict';var express=require(_0x14b1('0x0'));var router=express[_0x14b1('0x1')]();var auth=require('../../components/auth/service');var controller=require('./version.controller');router[_0x14b1('0x2')]('/',controller[_0x14b1('0x3')]);router['get'](_0x14b1('0x4'),auth[_0x14b1('0x5')](),auth[_0x14b1('0x6')](),controller[_0x14b1('0x7')]);router[_0x14b1('0x2')](_0x14b1('0x8'),auth[_0x14b1('0x5')](),auth[_0x14b1('0x6')](),controller[_0x14b1('0x9')]);router[_0x14b1('0x2')](_0x14b1('0xa'),auth[_0x14b1('0x5')](),auth[_0x14b1('0x6')](),controller['pull']);router[_0x14b1('0x2')](_0x14b1('0xb'),auth['isAuthenticated'](),controller[_0x14b1('0xc')]);router[_0x14b1('0x2')](_0x14b1('0xd'),controller['migrations']);module[_0x14b1('0xe')]=router; \ No newline at end of file +var _0x19f8=['../../components/auth/service','./version.controller','get','index','/fetch','isAuthenticated','fetch','/reset','canUpdate','reset','restart','/migrations','migrations','Router'];(function(_0x354b62,_0x570564){var _0x5633e3=function(_0xc892e0){while(--_0xc892e0){_0x354b62['push'](_0x354b62['shift']());}};_0x5633e3(++_0x570564);}(_0x19f8,0x179));var _0x819f=function(_0x463f29,_0x315360){_0x463f29=_0x463f29-0x0;var _0x516d9b=_0x19f8[_0x463f29];return _0x516d9b;};'use strict';var express=require('express');var router=express[_0x819f('0x0')]();var auth=require(_0x819f('0x1'));var controller=require(_0x819f('0x2'));router[_0x819f('0x3')]('/',controller[_0x819f('0x4')]);router[_0x819f('0x3')](_0x819f('0x5'),auth[_0x819f('0x6')](),auth['canUpdate'](),controller[_0x819f('0x7')]);router[_0x819f('0x3')](_0x819f('0x8'),auth[_0x819f('0x6')](),auth[_0x819f('0x9')](),controller[_0x819f('0xa')]);router['get']('/pull',auth[_0x819f('0x6')](),auth[_0x819f('0x9')](),controller['pull']);router[_0x819f('0x3')]('/restart',auth[_0x819f('0x6')](),controller[_0x819f('0xb')]);router[_0x819f('0x3')](_0x819f('0xc'),controller[_0x819f('0xd')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/version/version.controller.js b/server/api/version/version.controller.js index 1d967f0..3f5a636 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 _0xc0a4=['server','migrations','replace','.js','length','sort','sequelize','Migration','getQueryInterface','constructor','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','map','then','Database\x20migrated\x20successfully\x20from\x20version\x20','\x20to\x20','last','UniqueConstraintError','Database\x20already\x20up-to-date','umzug','path','lodash','compare-versions','child_process','exec','../../mysqldb','../../config/environment','../../config/pm2','../../config/logger','update','simple-git','root','index','version','query','latest','fetch','tags','exports','2.0.0','status','json','origin','master','info','git\x20fetch','git\x20fetch\x20origin\x20master','reset','--hard','FETCH_HEAD','error','git\x20reset\x20--hard\x20FETCH_HEAD','pull','npm\x20install\x20--production','restart','motion2','pm2\x20restart\x20motion\x20%s','catch','readdirSync','join'];(function(_0x20b0a8,_0x2c0277){var _0x509710=function(_0x151078){while(--_0x151078){_0x20b0a8['push'](_0x20b0a8['shift']());}};_0x509710(++_0x2c0277);}(_0xc0a4,0xfe));var _0x4c0a=function(_0x1e55d8,_0x3326c5){_0x1e55d8=_0x1e55d8-0x0;var _0xb412ca=_0xc0a4[_0x1e55d8];return _0xb412ca;};'use strict';var Umzug=require(_0x4c0a('0x0'));var path=require(_0x4c0a('0x1'));var fs=require('fs');var _=require(_0x4c0a('0x2'));var pkginfo=require('pkginfo')(module,'version');var compareVersions=require(_0x4c0a('0x3'));var exec=require(_0x4c0a('0x4'))[_0x4c0a('0x5')];var db=require(_0x4c0a('0x6'))['db'];var config=require(_0x4c0a('0x7'));var pm2=require(_0x4c0a('0x8'));var logger=require(_0x4c0a('0x9'))(_0x4c0a('0xa'));var git=require(_0x4c0a('0xb'))(config[_0x4c0a('0xc')]);exports[_0x4c0a('0xd')]=function(_0x14a40a,_0x5c3b03){var _0x176ec8={'current':module['exports'][_0x4c0a('0xe')],'phonebar':0x2};if(_0x14a40a[_0x4c0a('0xf')]&&_0x14a40a['query'][_0x4c0a('0x10')]){return git[_0x4c0a('0x11')]()[_0x4c0a('0x12')](function(_0x87f983,_0x4b0f5d){_0x176ec8[_0x4c0a('0x10')]=(_0x87f983?module[_0x4c0a('0x13')][_0x4c0a('0xe')]:_0x4b0f5d[_0x4c0a('0x10')])||_0x4c0a('0x14');return _0x5c3b03[_0x4c0a('0x15')](0xc8)['json'](_0x176ec8);});}else{return _0x5c3b03[_0x4c0a('0x15')](0xc8)[_0x4c0a('0x16')](_0x176ec8);}};exports[_0x4c0a('0x11')]=function(_0x3ff434,_0xd57328){return git[_0x4c0a('0x11')]([_0x4c0a('0x17'),_0x4c0a('0x18')],function(_0x145a3c){if(_0x145a3c){logger['error'](_0x145a3c);return _0xd57328['status'](0x1f4)[_0x4c0a('0x16')](_0x145a3c);}logger[_0x4c0a('0x19')](_0x4c0a('0x1a'));return _0xd57328[_0x4c0a('0x15')](0xc8)['json']({'output':_0x4c0a('0x1b')});});};exports[_0x4c0a('0x1c')]=function(_0x896e40,_0x402559){return git[_0x4c0a('0x1c')]([_0x4c0a('0x1d'),_0x4c0a('0x1e')],function(_0x72252c){if(_0x72252c){logger[_0x4c0a('0x1f')](_0x72252c);return _0x402559[_0x4c0a('0x15')](0x1f4)[_0x4c0a('0x16')](_0x72252c);}logger[_0x4c0a('0x19')](_0x4c0a('0x20'));return _0x402559[_0x4c0a('0x15')](0xc8)[_0x4c0a('0x16')]({'output':'git\x20reset\x20--hard'});});};exports[_0x4c0a('0x21')]=function(_0x35fd28,_0x13c975){exec(_0x4c0a('0x22'),function(_0x45df0f,_0x1fb902,_0x2b1bc4){logger[_0x4c0a('0x19')](_0x1fb902);logger['info'](_0x2b1bc4);if(_0x45df0f){logger['error'](_0x45df0f);return _0x13c975[_0x4c0a('0x15')](0x1f4)[_0x4c0a('0x16')](_0x45df0f);}return _0x13c975['status'](0xc8)[_0x4c0a('0x16')]({'output':_0x1fb902});});};exports[_0x4c0a('0x23')]=function(_0x22e9e0,_0x27fe5d){return pm2[_0x4c0a('0x23')](_0x4c0a('0x24'))['then'](function(_0x343ee9){logger[_0x4c0a('0x19')](_0x4c0a('0x25'),_0x343ee9);return _0x27fe5d[_0x4c0a('0x15')](0xc8)[_0x4c0a('0x16')]({'output':'Your\x20system\x20has\x20been\x20restart\x20successfully'});})[_0x4c0a('0x26')](function(_0x28f241){logger[_0x4c0a('0x1f')](_0x28f241);return _0x27fe5d['status'](0x1f4)[_0x4c0a('0x16')](_0x28f241);});};exports['migrations']=function(_0x2bda20,_0x561f34){var _0x328ad7=fs[_0x4c0a('0x27')](path[_0x4c0a('0x28')](config[_0x4c0a('0xc')],_0x4c0a('0x29'),_0x4c0a('0x2a')));var _0xfe5bfa=[];for(var _0x591640=0x0;_0x591640<_0x328ad7['length'];_0x591640++){var _0x492b57=_0x328ad7[_0x591640][_0x4c0a('0x2b')](_0x4c0a('0x2c'),'');if(compareVersions(module[_0x4c0a('0x13')][_0x4c0a('0xe')],_0x492b57)===-0x1){_0xfe5bfa['push'](_0x492b57);}}if(_0xfe5bfa[_0x4c0a('0x2d')]){var _0x4cfa5a=_0xfe5bfa[_0x4c0a('0x2e')](compareVersions);var _0x2daf18=new Umzug({'storage':_0x4c0a('0x2f'),'storageOptions':{'model':db[_0x4c0a('0x30')],'modelName':_0x4c0a('0x30'),'columnName':_0x4c0a('0xe')},'migrations':{'params':[db[_0x4c0a('0x2f')][_0x4c0a('0x31')](),db[_0x4c0a('0x2f')][_0x4c0a('0x32')],function(){throw new Error(_0x4c0a('0x33'));}],'path':path[_0x4c0a('0x28')](config[_0x4c0a('0xc')],_0x4c0a('0x29'),'migrations'),'pattern':/\.js$/}});_0x2daf18['up']({'migrations':_[_0x4c0a('0x34')](_0x4cfa5a,function(_0x5bebd2){return _0x5bebd2+_0x4c0a('0x2c');})})[_0x4c0a('0x35')](function(){return _0x561f34[_0x4c0a('0x15')](0xc8)[_0x4c0a('0x16')]({'output':_0x4c0a('0x36')+module['exports']['version']+_0x4c0a('0x37')+_[_0x4c0a('0x38')](_0x4cfa5a),'migrations':_['join'](_0x4cfa5a)});})['catch'](function(_0x156cbb){if(_0x156cbb instanceof db[_0x4c0a('0x2f')][_0x4c0a('0x39')]){return _0x561f34[_0x4c0a('0x15')](0xc8)[_0x4c0a('0x16')]({'output':_0x4c0a('0x3a')});}else{return _0x561f34['status'](0x1f4)[_0x4c0a('0x16')](_0x156cbb);}});}else{return _0x561f34[_0x4c0a('0x15')](0xc8)['json']({'output':_0x4c0a('0x3a')});}}; \ No newline at end of file +var _0x9ecd=['../../mysqldb','../../config/environment','../../config/pm2','update','simple-git','exports','query','fetch','latest','2.0.0','json','status','origin','error','info','git\x20fetch','git\x20fetch\x20origin\x20master','reset','--hard','FETCH_HEAD','git\x20reset\x20--hard','pull','npm\x20install\x20--production','restart','motion2','pm2\x20restart\x20motion\x20%s','Your\x20system\x20has\x20been\x20restart\x20successfully','catch','migrations','readdirSync','join','root','server','replace','.js','push','sort','Migration','sequelize','getQueryInterface','constructor','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','map','then','Database\x20migrated\x20successfully\x20from\x20version\x20','\x20to\x20','last','UniqueConstraintError','Database\x20already\x20up-to-date','umzug','path','lodash','version','child_process','exec'];(function(_0x1925ba,_0x28824f){var _0x2185a2=function(_0x1ba7ad){while(--_0x1ba7ad){_0x1925ba['push'](_0x1925ba['shift']());}};_0x2185a2(++_0x28824f);}(_0x9ecd,0x68));var _0xd9ec=function(_0x471291,_0x2bc36d){_0x471291=_0x471291-0x0;var _0x579793=_0x9ecd[_0x471291];return _0x579793;};'use strict';var Umzug=require(_0xd9ec('0x0'));var path=require(_0xd9ec('0x1'));var fs=require('fs');var _=require(_0xd9ec('0x2'));var pkginfo=require('pkginfo')(module,_0xd9ec('0x3'));var compareVersions=require('compare-versions');var exec=require(_0xd9ec('0x4'))[_0xd9ec('0x5')];var db=require(_0xd9ec('0x6'))['db'];var config=require(_0xd9ec('0x7'));var pm2=require(_0xd9ec('0x8'));var logger=require('../../config/logger')(_0xd9ec('0x9'));var git=require(_0xd9ec('0xa'))(config['root']);exports['index']=function(_0x4c9472,_0x7fa1d6){var _0x2591ee={'current':module[_0xd9ec('0xb')]['version'],'phonebar':0x2};if(_0x4c9472[_0xd9ec('0xc')]&&_0x4c9472[_0xd9ec('0xc')]['latest']){return git[_0xd9ec('0xd')]()['tags'](function(_0x51f141,_0x25899a){_0x2591ee[_0xd9ec('0xe')]=(_0x51f141?module[_0xd9ec('0xb')][_0xd9ec('0x3')]:_0x25899a[_0xd9ec('0xe')])||_0xd9ec('0xf');return _0x7fa1d6['status'](0xc8)[_0xd9ec('0x10')](_0x2591ee);});}else{return _0x7fa1d6[_0xd9ec('0x11')](0xc8)[_0xd9ec('0x10')](_0x2591ee);}};exports[_0xd9ec('0xd')]=function(_0x3dcff6,_0x4ae8e8){return git[_0xd9ec('0xd')]([_0xd9ec('0x12'),'master'],function(_0x3cb3c8){if(_0x3cb3c8){logger[_0xd9ec('0x13')](_0x3cb3c8);return _0x4ae8e8[_0xd9ec('0x11')](0x1f4)[_0xd9ec('0x10')](_0x3cb3c8);}logger[_0xd9ec('0x14')](_0xd9ec('0x15'));return _0x4ae8e8[_0xd9ec('0x11')](0xc8)['json']({'output':_0xd9ec('0x16')});});};exports[_0xd9ec('0x17')]=function(_0x209992,_0x12ac72){return git[_0xd9ec('0x17')]([_0xd9ec('0x18'),_0xd9ec('0x19')],function(_0x4c52a3){if(_0x4c52a3){logger[_0xd9ec('0x13')](_0x4c52a3);return _0x12ac72[_0xd9ec('0x11')](0x1f4)[_0xd9ec('0x10')](_0x4c52a3);}logger[_0xd9ec('0x14')]('git\x20reset\x20--hard\x20FETCH_HEAD');return _0x12ac72['status'](0xc8)[_0xd9ec('0x10')]({'output':_0xd9ec('0x1a')});});};exports[_0xd9ec('0x1b')]=function(_0x2a0007,_0xc0291c){exec(_0xd9ec('0x1c'),function(_0x5c7d79,_0x30f74e,_0x45c3bc){logger[_0xd9ec('0x14')](_0x30f74e);logger['info'](_0x45c3bc);if(_0x5c7d79){logger[_0xd9ec('0x13')](_0x5c7d79);return _0xc0291c['status'](0x1f4)[_0xd9ec('0x10')](_0x5c7d79);}return _0xc0291c['status'](0xc8)[_0xd9ec('0x10')]({'output':_0x30f74e});});};exports[_0xd9ec('0x1d')]=function(_0xd12b10,_0x4f818d){return pm2['restart'](_0xd9ec('0x1e'))['then'](function(_0x1cbedb){logger[_0xd9ec('0x14')](_0xd9ec('0x1f'),_0x1cbedb);return _0x4f818d[_0xd9ec('0x11')](0xc8)[_0xd9ec('0x10')]({'output':_0xd9ec('0x20')});})[_0xd9ec('0x21')](function(_0x5e994e){logger[_0xd9ec('0x13')](_0x5e994e);return _0x4f818d['status'](0x1f4)[_0xd9ec('0x10')](_0x5e994e);});};exports[_0xd9ec('0x22')]=function(_0x1193c7,_0x3669e4){var _0x24caa4=fs[_0xd9ec('0x23')](path[_0xd9ec('0x24')](config[_0xd9ec('0x25')],_0xd9ec('0x26'),_0xd9ec('0x22')));var _0x5052ac=[];for(var _0x433494=0x0;_0x433494<_0x24caa4['length'];_0x433494++){var _0x1a9789=_0x24caa4[_0x433494][_0xd9ec('0x27')](_0xd9ec('0x28'),'');if(compareVersions(module[_0xd9ec('0xb')]['version'],_0x1a9789)===-0x1){_0x5052ac[_0xd9ec('0x29')](_0x1a9789);}}if(_0x5052ac['length']){var _0xe7a15c=_0x5052ac[_0xd9ec('0x2a')](compareVersions);var _0x20edad=new Umzug({'storage':'sequelize','storageOptions':{'model':db[_0xd9ec('0x2b')],'modelName':'Migration','columnName':'version'},'migrations':{'params':[db[_0xd9ec('0x2c')][_0xd9ec('0x2d')](),db[_0xd9ec('0x2c')][_0xd9ec('0x2e')],function(){throw new Error(_0xd9ec('0x2f'));}],'path':path[_0xd9ec('0x24')](config[_0xd9ec('0x25')],'server',_0xd9ec('0x22')),'pattern':/\.js$/}});_0x20edad['up']({'migrations':_[_0xd9ec('0x30')](_0xe7a15c,function(_0x2c6785){return _0x2c6785+'.js';})})[_0xd9ec('0x31')](function(){return _0x3669e4['status'](0xc8)['json']({'output':_0xd9ec('0x32')+module[_0xd9ec('0xb')][_0xd9ec('0x3')]+_0xd9ec('0x33')+_[_0xd9ec('0x34')](_0xe7a15c),'migrations':_[_0xd9ec('0x24')](_0xe7a15c)});})[_0xd9ec('0x21')](function(_0xd82791){if(_0xd82791 instanceof db[_0xd9ec('0x2c')][_0xd9ec('0x35')]){return _0x3669e4[_0xd9ec('0x11')](0xc8)[_0xd9ec('0x10')]({'output':_0xd9ec('0x36')});}else{return _0x3669e4[_0xd9ec('0x11')](0x1f4)[_0xd9ec('0x10')](_0xd82791);}});}else{return _0x3669e4['status'](0xc8)['json']({'output':_0xd9ec('0x36')});}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/index.js b/server/api/voiceAgentReport/index.js index a71b635..9a69320 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 _0x80a9=['fs-extra','../../config/environment','get','isAuthenticated','/:id','show','post','create','update','delete','exports','util','connect-timeout','express','Router'];(function(_0x261903,_0x38c2d3){var _0x5b28c0=function(_0x5a8979){while(--_0x5a8979){_0x261903['push'](_0x261903['shift']());}};_0x5b28c0(++_0x38c2d3);}(_0x80a9,0xb0));var _0x980a=function(_0x9cd4c3,_0x1c9b2c){_0x9cd4c3=_0x9cd4c3-0x0;var _0x4c9025=_0x80a9[_0x9cd4c3];return _0x4c9025;};'use strict';var multer=require('multer');var util=require(_0x980a('0x0'));var path=require('path');var timeout=require(_0x980a('0x1'));var express=require(_0x980a('0x2'));var router=express[_0x980a('0x3')]();var fs_extra=require(_0x980a('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x980a('0x5'));var controller=require('./voiceAgentReport.controller');router[_0x980a('0x6')]('/',auth['isAuthenticated'](),controller['index']);router[_0x980a('0x6')]('/describe',auth[_0x980a('0x7')](),controller['describe']);router[_0x980a('0x6')](_0x980a('0x8'),auth[_0x980a('0x7')](),controller[_0x980a('0x9')]);router[_0x980a('0xa')]('/',auth[_0x980a('0x7')](),controller[_0x980a('0xb')]);router['put']('/:id',auth[_0x980a('0x7')](),controller[_0x980a('0xc')]);router[_0x980a('0xd')](_0x980a('0x8'),auth[_0x980a('0x7')](),controller['destroy']);module[_0x980a('0xe')]=router; \ No newline at end of file +var _0x484f=['show','post','create','put','update','delete','destroy','util','path','../../components/auth/service','../../config/environment','isAuthenticated','index','get','describe'];(function(_0x2c044c,_0x217c40){var _0x2144a0=function(_0x3a4696){while(--_0x3a4696){_0x2c044c['push'](_0x2c044c['shift']());}};_0x2144a0(++_0x217c40);}(_0x484f,0x115));var _0xf484=function(_0x725a4c,_0x102507){_0x725a4c=_0x725a4c-0x0;var _0x37b2cc=_0x484f[_0x725a4c];return _0x37b2cc;};'use strict';var multer=require('multer');var util=require(_0xf484('0x0'));var path=require(_0xf484('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xf484('0x2'));var interaction=require('../../components/interaction/service');var config=require(_0xf484('0x3'));var controller=require('./voiceAgentReport.controller');router['get']('/',auth[_0xf484('0x4')](),controller[_0xf484('0x5')]);router[_0xf484('0x6')]('/describe',auth['isAuthenticated'](),controller[_0xf484('0x7')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xf484('0x8')]);router[_0xf484('0x9')]('/',auth[_0xf484('0x4')](),controller[_0xf484('0xa')]);router[_0xf484('0xb')]('/:id',auth[_0xf484('0x4')](),controller[_0xf484('0xc')]);router[_0xf484('0xd')]('/:id',auth[_0xf484('0x4')](),controller[_0xf484('0xe')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.attributes.js b/server/api/voiceAgentReport/voiceAgentReport.attributes.js index 19659a4..4fe5010 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 _0xe511=['INTEGER','BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','exports','STRING','DATE'];(function(_0x17f23d,_0x179d6b){var _0x52f18a=function(_0x5a027a){while(--_0x5a027a){_0x17f23d['push'](_0x17f23d['shift']());}};_0x52f18a(++_0x179d6b);}(_0xe511,0x16f));var _0x1e51=function(_0xea98ab,_0x297344){_0xea98ab=_0xea98ab-0x0;var _0x39058e=_0xe511[_0xea98ab];return _0x39058e;};'use strict';var Sequelize=require(_0x1e51('0x0'));module[_0x1e51('0x1')]={'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x1e51('0x2')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x1e51('0x2')]},'queue':{'type':Sequelize[_0x1e51('0x2')]},'interface':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x1e51('0x2')]},'agentcalledAt':{'type':Sequelize[_0x1e51('0x3')]},'agentconnectAt':{'type':Sequelize[_0x1e51('0x3')]},'agentcompleteAt':{'type':Sequelize[_0x1e51('0x3')]},'agentringnoanswerAt':{'type':Sequelize['DATE']},'agentdumpAt':{'type':Sequelize[_0x1e51('0x3')]},'holdtime':{'type':Sequelize[_0x1e51('0x4')]},'agentcomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentdump':{'type':Sequelize[_0x1e51('0x5')],'defaultValue':![]},'talktime':{'type':Sequelize[_0x1e51('0x4')]},'agentacw':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'acwtime':{'type':Sequelize['INTEGER']},'reason':{'type':Sequelize[_0x1e51('0x2')]},'lastevent':{'type':Sequelize[_0x1e51('0x2')]},'channel':{'type':Sequelize[_0x1e51('0x2')]},'channelstate':{'type':Sequelize[_0x1e51('0x4')]},'channelstatedesc':{'type':Sequelize[_0x1e51('0x2')]},'connectedlinenum':{'type':Sequelize[_0x1e51('0x2')]},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x1e51('0x2')]},'accountcode':{'type':Sequelize[_0x1e51('0x2')]},'context':{'type':Sequelize[_0x1e51('0x2')]},'exten':{'type':Sequelize[_0x1e51('0x2')]},'priority':{'type':Sequelize[_0x1e51('0x2')]},'destchannel':{'type':Sequelize[_0x1e51('0x2')]},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize[_0x1e51('0x2')]},'destcalleridnum':{'type':Sequelize[_0x1e51('0x2')]},'destcalleridname':{'type':Sequelize[_0x1e51('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0x1e51('0x2')]},'destconnectedlinename':{'type':Sequelize[_0x1e51('0x2')]},'destlanguage':{'type':Sequelize[_0x1e51('0x2')]},'destaccountcode':{'type':Sequelize[_0x1e51('0x2')]},'destcontext':{'type':Sequelize[_0x1e51('0x2')]},'destexten':{'type':Sequelize[_0x1e51('0x2')]},'destpriority':{'type':Sequelize[_0x1e51('0x2')]},'destuniqueid':{'type':Sequelize['STRING']},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0x1e51('0x2')]},'answeredelsewheremembername':{'type':Sequelize[_0x1e51('0x2')]},'transfer':{'type':Sequelize[_0x1e51('0x5')],'defaultValue':![]},'transfertype':{'type':Sequelize['STRING'],'comment':_0x1e51('0x6')},'transferexten':{'type':Sequelize['STRING']},'transferuniqueid':{'type':Sequelize['STRING']},'agententerreason':{'type':Sequelize[_0x1e51('0x4')],'defaultValue':0x0}}; \ No newline at end of file +var _0x3264=['FORWARD,\x20BLIND,\x20ATTENDED','exports','STRING','DATE','BOOLEAN','INTEGER'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x3264,0x7f));var _0x4326=function(_0x10004e,_0xd701e6){_0x10004e=_0x10004e-0x0;var _0x5af990=_0x3264[_0x10004e];return _0x5af990;};'use strict';var Sequelize=require('sequelize');module[_0x4326('0x0')]={'type':{'type':Sequelize[_0x4326('0x1')]},'uniqueid':{'type':Sequelize[_0x4326('0x1')]},'calleridnum':{'type':Sequelize[_0x4326('0x1')]},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize['STRING']},'interface':{'type':Sequelize[_0x4326('0x1')]},'membername':{'type':Sequelize['STRING']},'agentcalledAt':{'type':Sequelize['DATE']},'agentconnectAt':{'type':Sequelize[_0x4326('0x2')]},'agentcompleteAt':{'type':Sequelize[_0x4326('0x2')]},'agentringnoanswerAt':{'type':Sequelize[_0x4326('0x2')]},'agentdumpAt':{'type':Sequelize[_0x4326('0x2')]},'holdtime':{'type':Sequelize['INTEGER']},'agentcomplete':{'type':Sequelize[_0x4326('0x3')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0x4326('0x3')],'defaultValue':![]},'agentdump':{'type':Sequelize[_0x4326('0x3')],'defaultValue':![]},'talktime':{'type':Sequelize[_0x4326('0x4')]},'agentacw':{'type':Sequelize[_0x4326('0x3')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x4326('0x4')]},'reason':{'type':Sequelize[_0x4326('0x1')]},'lastevent':{'type':Sequelize['STRING']},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize[_0x4326('0x4')]},'channelstatedesc':{'type':Sequelize[_0x4326('0x1')]},'connectedlinenum':{'type':Sequelize[_0x4326('0x1')]},'connectedlinename':{'type':Sequelize[_0x4326('0x1')]},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x4326('0x1')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x4326('0x1')]},'destchannel':{'type':Sequelize[_0x4326('0x1')]},'destchannelstate':{'type':Sequelize[_0x4326('0x4')]},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize[_0x4326('0x1')]},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize[_0x4326('0x1')]},'destaccountcode':{'type':Sequelize[_0x4326('0x1')]},'destcontext':{'type':Sequelize[_0x4326('0x1')]},'destexten':{'type':Sequelize[_0x4326('0x1')]},'destpriority':{'type':Sequelize['STRING']},'destuniqueid':{'type':Sequelize[_0x4326('0x1')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0x4326('0x1')]},'answeredelsewheremembername':{'type':Sequelize[_0x4326('0x1')]},'transfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x4326('0x1')],'comment':_0x4326('0x5')},'transferexten':{'type':Sequelize[_0x4326('0x1')]},'transferuniqueid':{'type':Sequelize[_0x4326('0x1')]},'agententerreason':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.controller.js b/server/api/voiceAgentReport/voiceAgentReport.controller.js index 0d4991f..e94415c 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(_0x4b7895,_0x3c4f5d){var _0x264180=function(_0xe0e861){while(--_0xe0e861){_0x4b7895['push'](_0x4b7895['shift']());}};_0x264180(++_0x3c4f5d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x45e98e,_0x169b60){_0x45e98e=_0x45e98e-0x0;var _0x374dba=_0xa9e0[_0x45e98e];return _0x374dba;};'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(_0xb24a3e,_0x4a3594){var _0x4038d7=function(_0x1ea3c3){while(--_0x1ea3c3){_0xb24a3e['push'](_0xb24a3e['shift']());}};_0x4038d7(++_0x4a3594);}(_0xa9e0,0x123));var _0x0a9e=function(_0x138f59,_0x1b53fb){_0x138f59=_0x138f59-0x0;var _0x3d114d=_0xa9e0[_0x138f59];return _0x3d114d;};'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 2b6ea8c..e81fe03 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 _0x5075=['report_agent','uniqueid','destuniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./voiceAgentReport.attributes','define'];(function(_0x256823,_0x2392df){var _0x5db66b=function(_0x2bd5d6){while(--_0x2bd5d6){_0x256823['push'](_0x256823['shift']());}};_0x5db66b(++_0x2392df);}(_0x5075,0x73));var _0x5507=function(_0x1fb4e1,_0x3d4ce6){_0x1fb4e1=_0x1fb4e1-0x0;var _0x22d1b0=_0x5075[_0x1fb4e1];return _0x22d1b0;};'use strict';var _=require(_0x5507('0x0'));var util=require(_0x5507('0x1'));var logger=require(_0x5507('0x2'))(_0x5507('0x3'));var moment=require(_0x5507('0x4'));var BPromise=require(_0x5507('0x5'));var rp=require(_0x5507('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5507('0x7'));var config=require(_0x5507('0x8'));var attributes=require(_0x5507('0x9'));module['exports']=function(_0x5b6d7f,_0x2cd9ee){return _0x5b6d7f[_0x5507('0xa')]('VoiceAgentReport',attributes,{'tableName':_0x5507('0xb'),'paranoid':![],'indexes':[{'fields':[_0x5507('0xc'),_0x5507('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x029b=['define','report_agent','destuniqueid','lodash','util','api','moment','request-promise','path','./voiceAgentReport.attributes','exports'];(function(_0xc83a19,_0x40f352){var _0x489adf=function(_0x3375f0){while(--_0x3375f0){_0xc83a19['push'](_0xc83a19['shift']());}};_0x489adf(++_0x40f352);}(_0x029b,0x66));var _0xb029=function(_0x101e1c,_0x9ca1f5){_0x101e1c=_0x101e1c-0x0;var _0x2663fc=_0x029b[_0x101e1c];return _0x2663fc;};'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')]('VoiceAgentReport',attributes,{'tableName':_0xb029('0x9'),'paranoid':![],'indexes':[{'fields':['uniqueid',_0xb029('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.rpc.js b/server/api/voiceAgentReport/voiceAgentReport.rpc.js index 7e0e90b..8b1c09b 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 _0xafc2=['body','options','raw','update','attributes','limit','UpdateVoiceAgentReport','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','VoiceAgentReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','CreateVoiceAgentReport','VoiceAgentReport','create'];(function(_0x512caa,_0x6411d1){var _0x48f8bb=function(_0x156da5){while(--_0x156da5){_0x512caa['push'](_0x512caa['shift']());}};_0x48f8bb(++_0x6411d1);}(_0xafc2,0xe7));var _0x2afc=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0xafc2[_0x397e5f];return _0x5302b8;};'use strict';var _=require(_0x2afc('0x0'));var util=require(_0x2afc('0x1'));var moment=require(_0x2afc('0x2'));var BPromise=require(_0x2afc('0x3'));var rs=require(_0x2afc('0x4'));var fs=require('fs');var Redis=require(_0x2afc('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x2afc('0x6'))(_0x2afc('0x7'));var config=require(_0x2afc('0x8'));var jayson=require(_0x2afc('0x9'));var client=jayson[_0x2afc('0xa')][_0x2afc('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1a36d6,_0x36e6be,_0x3b7a7d){return new BPromise(function(_0x4a2790,_0x432b3b){return client['request'](_0x1a36d6,_0x3b7a7d)[_0x2afc('0xc')](function(_0x4cbc25){logger['info'](_0x2afc('0xd'),_0x36e6be,_0x2afc('0xe'));logger[_0x2afc('0xf')]('VoiceAgentReport,\x20%s,\x20%s,\x20%s',_0x36e6be,_0x2afc('0xe'),JSON[_0x2afc('0x10')](_0x4cbc25));if(_0x4cbc25[_0x2afc('0x11')]){if(_0x4cbc25[_0x2afc('0x11')][_0x2afc('0x12')]===0x1f4){logger[_0x2afc('0x11')](_0x2afc('0xd'),_0x36e6be,_0x4cbc25[_0x2afc('0x11')][_0x2afc('0x13')]);return _0x432b3b(_0x4cbc25[_0x2afc('0x11')][_0x2afc('0x13')]);}logger[_0x2afc('0x11')](_0x2afc('0xd'),_0x36e6be,_0x4cbc25[_0x2afc('0x11')]['message']);return _0x4a2790(_0x4cbc25[_0x2afc('0x11')][_0x2afc('0x13')]);}else{logger[_0x2afc('0x14')](_0x2afc('0xd'),_0x36e6be,_0x2afc('0xe'));_0x4a2790(_0x4cbc25['result'][_0x2afc('0x13')]);}})[_0x2afc('0x15')](function(_0x22f213){logger[_0x2afc('0x11')](_0x2afc('0xd'),_0x36e6be,_0x22f213);_0x432b3b(_0x22f213);});});}exports[_0x2afc('0x16')]=function(_0x5acd20){var _0x333eab=this;return new Promise(function(_0x2c2bd3,_0x4fe503){return db[_0x2afc('0x17')][_0x2afc('0x18')](_0x5acd20[_0x2afc('0x19')],{'raw':_0x5acd20[_0x2afc('0x1a')]?_0x5acd20[_0x2afc('0x1a')][_0x2afc('0x1b')]===undefined?!![]:![]:!![]})[_0x2afc('0xc')](function(_0x148cd3){logger[_0x2afc('0x14')]('CreateVoiceAgentReport',_0x5acd20);logger[_0x2afc('0xf')]('CreateVoiceAgentReport',_0x5acd20,JSON[_0x2afc('0x10')](_0x148cd3));_0x2c2bd3(_0x148cd3);})[_0x2afc('0x15')](function(_0x539b4a){logger[_0x2afc('0x11')](_0x2afc('0x16'),_0x539b4a[_0x2afc('0x13')],_0x5acd20);_0x4fe503(_0x333eab[_0x2afc('0x11')](0x1f4,_0x539b4a[_0x2afc('0x13')]));});});};exports['UpdateVoiceAgentReport']=function(_0x4db07d){var _0x12210e=this;return new Promise(function(_0x3e94d4,_0xa5d1e6){return db[_0x2afc('0x17')][_0x2afc('0x1c')](_0x4db07d['body'],{'raw':_0x4db07d[_0x2afc('0x1a')]?_0x4db07d['options'][_0x2afc('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4db07d['options']?_0x4db07d['options']['where']||null:null,'attributes':_0x4db07d['options']?_0x4db07d[_0x2afc('0x1a')][_0x2afc('0x1d')]||null:null,'limit':_0x4db07d[_0x2afc('0x1a')]?_0x4db07d[_0x2afc('0x1a')][_0x2afc('0x1e')]||null:null})[_0x2afc('0xc')](function(_0x406604){logger['info']('UpdateVoiceAgentReport',_0x4db07d);logger['debug'](_0x2afc('0x1f'),_0x4db07d,JSON[_0x2afc('0x10')](_0x406604));_0x3e94d4(_0x406604);})['catch'](function(_0xfe05d0){logger[_0x2afc('0x11')]('UpdateVoiceAgentReport',_0xfe05d0[_0x2afc('0x13')],_0x4db07d);_0xa5d1e6(_0x12210e[_0x2afc('0x11')](0x1f4,_0xfe05d0[_0x2afc('0x13')]));});});}; \ No newline at end of file +var _0x274c=['request','then','info','debug','VoiceAgentReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','VoiceAgentReport,\x20%s,\x20%s','message','result','catch','CreateVoiceAgentReport','VoiceAgentReport','create','body','options','raw','UpdateVoiceAgentReport','update','attributes','limit','lodash','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x302ce4,_0x53f6d7){var _0x4a1c0d=function(_0x3abe21){while(--_0x3abe21){_0x302ce4['push'](_0x302ce4['shift']());}};_0x4a1c0d(++_0x53f6d7);}(_0x274c,0x7a));var _0xc274=function(_0x4d729f,_0x52bf8b){_0x4d729f=_0x4d729f-0x0;var _0x5ce12a=_0x274c[_0x4d729f];return _0x5ce12a;};'use strict';var _=require(_0xc274('0x0'));var util=require('util');var moment=require(_0xc274('0x1'));var BPromise=require(_0xc274('0x2'));var rs=require(_0xc274('0x3'));var fs=require('fs');var Redis=require(_0xc274('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xc274('0x5'))(_0xc274('0x6'));var config=require(_0xc274('0x7'));var jayson=require(_0xc274('0x8'));var client=jayson['client'][_0xc274('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1bf5f8,_0x37c750,_0x548eca){return new BPromise(function(_0x425e73,_0x1822ce){return client[_0xc274('0xa')](_0x1bf5f8,_0x548eca)[_0xc274('0xb')](function(_0x100292){logger[_0xc274('0xc')]('VoiceAgentReport,\x20%s,\x20%s',_0x37c750,'request\x20sent');logger[_0xc274('0xd')](_0xc274('0xe'),_0x37c750,_0xc274('0xf'),JSON[_0xc274('0x10')](_0x100292));if(_0x100292[_0xc274('0x11')]){if(_0x100292['error'][_0xc274('0x12')]===0x1f4){logger[_0xc274('0x11')](_0xc274('0x13'),_0x37c750,_0x100292['error']['message']);return _0x1822ce(_0x100292[_0xc274('0x11')][_0xc274('0x14')]);}logger['error'](_0xc274('0x13'),_0x37c750,_0x100292[_0xc274('0x11')]['message']);return _0x425e73(_0x100292[_0xc274('0x11')][_0xc274('0x14')]);}else{logger[_0xc274('0xc')](_0xc274('0x13'),_0x37c750,'request\x20sent');_0x425e73(_0x100292[_0xc274('0x15')][_0xc274('0x14')]);}})[_0xc274('0x16')](function(_0x136918){logger[_0xc274('0x11')]('VoiceAgentReport,\x20%s,\x20%s',_0x37c750,_0x136918);_0x1822ce(_0x136918);});});}exports[_0xc274('0x17')]=function(_0x18f078){var _0x717e6f=this;return new Promise(function(_0x1897cb,_0xff2312){return db[_0xc274('0x18')][_0xc274('0x19')](_0x18f078[_0xc274('0x1a')],{'raw':_0x18f078['options']?_0x18f078[_0xc274('0x1b')][_0xc274('0x1c')]===undefined?!![]:![]:!![]})[_0xc274('0xb')](function(_0x2f99a2){logger[_0xc274('0xc')]('CreateVoiceAgentReport',_0x18f078);logger[_0xc274('0xd')](_0xc274('0x17'),_0x18f078,JSON[_0xc274('0x10')](_0x2f99a2));_0x1897cb(_0x2f99a2);})[_0xc274('0x16')](function(_0x4e2346){logger[_0xc274('0x11')](_0xc274('0x17'),_0x4e2346['message'],_0x18f078);_0xff2312(_0x717e6f[_0xc274('0x11')](0x1f4,_0x4e2346[_0xc274('0x14')]));});});};exports[_0xc274('0x1d')]=function(_0x313469){var _0x17ee06=this;return new Promise(function(_0x2784ad,_0x3c55fe){return db['VoiceAgentReport'][_0xc274('0x1e')](_0x313469['body'],{'raw':_0x313469[_0xc274('0x1b')]?_0x313469[_0xc274('0x1b')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x313469[_0xc274('0x1b')]?_0x313469[_0xc274('0x1b')]['where']||null:null,'attributes':_0x313469['options']?_0x313469[_0xc274('0x1b')][_0xc274('0x1f')]||null:null,'limit':_0x313469[_0xc274('0x1b')]?_0x313469[_0xc274('0x1b')][_0xc274('0x20')]||null:null})[_0xc274('0xb')](function(_0x5b17c7){logger[_0xc274('0xc')](_0xc274('0x1d'),_0x313469);logger[_0xc274('0xd')]('UpdateVoiceAgentReport',_0x313469,JSON[_0xc274('0x10')](_0x5b17c7));_0x2784ad(_0x5b17c7);})[_0xc274('0x16')](function(_0xbfa063){logger['error']('UpdateVoiceAgentReport',_0xbfa063['message'],_0x313469);_0x3c55fe(_0x17ee06[_0xc274('0x11')](0x1f4,_0xbfa063[_0xc274('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/index.js b/server/api/voiceCallReport/index.js index 2eee4bb..b503d24 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 _0x3435=['path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','/describe','describe','/:id','show','create','put','delete','exports','multer','util'];(function(_0x54e1a4,_0x3b4dd1){var _0x45b87a=function(_0x1ba9a2){while(--_0x1ba9a2){_0x54e1a4['push'](_0x54e1a4['shift']());}};_0x45b87a(++_0x3b4dd1);}(_0x3435,0xfa));var _0x5343=function(_0x51020b,_0x38c2c7){_0x51020b=_0x51020b-0x0;var _0x371e47=_0x3435[_0x51020b];return _0x371e47;};'use strict';var multer=require(_0x5343('0x0'));var util=require(_0x5343('0x1'));var path=require(_0x5343('0x2'));var timeout=require(_0x5343('0x3'));var express=require(_0x5343('0x4'));var router=express[_0x5343('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x5343('0x6'));var interaction=require(_0x5343('0x7'));var config=require('../../config/environment');var controller=require('./voiceCallReport.controller');router[_0x5343('0x8')]('/',auth[_0x5343('0x9')](),controller['index']);router['get'](_0x5343('0xa'),auth[_0x5343('0x9')](),controller[_0x5343('0xb')]);router[_0x5343('0x8')](_0x5343('0xc'),auth['isAuthenticated'](),controller[_0x5343('0xd')]);router['post']('/',auth[_0x5343('0x9')](),controller[_0x5343('0xe')]);router[_0x5343('0xf')](_0x5343('0xc'),auth[_0x5343('0x9')](),controller['update']);router[_0x5343('0x10')](_0x5343('0xc'),auth[_0x5343('0x9')](),controller['destroy']);module[_0x5343('0x11')]=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(_0x289c52,_0x4f9e67){var _0x5d6929=function(_0x33ce64){while(--_0x33ce64){_0x289c52['push'](_0x289c52['shift']());}};_0x5d6929(++_0x4f9e67);}(_0x29d4,0x1a1));var _0x429d=function(_0x1e7b16,_0x4607a1){_0x1e7b16=_0x1e7b16-0x0;var _0x37fadc=_0x29d4[_0x1e7b16];return _0x37fadc;};'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 1bb651a..61da33d 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 _0x2f0c=['STRING','TEXT','DATE','INTEGER','sequelize','exports','inbound','outbound','inbound-fax','dialer'];(function(_0x3466b9,_0x19082b){var _0x3a7c7c=function(_0x4555d6){while(--_0x4555d6){_0x3466b9['push'](_0x3466b9['shift']());}};_0x3a7c7c(++_0x19082b);}(_0x2f0c,0x1b2));var _0xc2f0=function(_0x348e46,_0x5187dc){_0x348e46=_0x348e46-0x0;var _0x58b74f=_0x2f0c[_0x348e46];return _0x58b74f;};'use strict';var Sequelize=require(_0xc2f0('0x0'));module[_0xc2f0('0x1')]={'uniqueid':{'type':Sequelize['STRING']},'type':{'type':Sequelize['ENUM'](_0xc2f0('0x2'),'internal',_0xc2f0('0x3'),_0xc2f0('0x4'),'outbound-fax',_0xc2f0('0x5'))},'tag':{'type':Sequelize[_0xc2f0('0x6')]},'accountcode':{'type':Sequelize[_0xc2f0('0x6')]},'source':{'type':Sequelize['STRING']},'destination':{'type':Sequelize[_0xc2f0('0x6')]},'destinationcontext':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0xc2f0('0x6')]},'channel':{'type':Sequelize[_0xc2f0('0x6')]},'destinationchannel':{'type':Sequelize[_0xc2f0('0x6')]},'lastapplication':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize[_0xc2f0('0x7')]},'starttime':{'type':Sequelize[_0xc2f0('0x8')]},'systemanswertime':{'type':Sequelize[_0xc2f0('0x8')]},'answertime':{'type':Sequelize[_0xc2f0('0x8')]},'endtime':{'type':Sequelize[_0xc2f0('0x8')]},'duration':{'type':Sequelize[_0xc2f0('0x9')]},'billableseconds':{'type':Sequelize[_0xc2f0('0x9')]},'mohtime':{'type':Sequelize[_0xc2f0('0x9')],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xc2f0('0x6')]},'amaflags':{'type':Sequelize[_0xc2f0('0x6')]},'userfield':{'type':Sequelize['STRING']},'userDisposition':{'type':Sequelize[_0xc2f0('0x6')]},'userSecondDisposition':{'type':Sequelize[_0xc2f0('0x6')]},'userThirdDisposition':{'type':Sequelize[_0xc2f0('0x6')]},'note':{'type':Sequelize[_0xc2f0('0x6')]},'prefix':{'type':Sequelize[_0xc2f0('0x6')]},'routeid':{'type':Sequelize['INTEGER']},'sipcallid':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x39b2=['INTEGER','sequelize','STRING','inbound','outbound','inbound-fax','dialer','TEXT','DATE'];(function(_0x1b95a1,_0x529852){var _0x57aef1=function(_0x1cb2fd){while(--_0x1cb2fd){_0x1b95a1['push'](_0x1b95a1['shift']());}};_0x57aef1(++_0x529852);}(_0x39b2,0x10f));var _0x239b=function(_0xf965f0,_0x6b0afc){_0xf965f0=_0xf965f0-0x0;var _0x467b05=_0x39b2[_0xf965f0];return _0x467b05;};'use strict';var Sequelize=require(_0x239b('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x239b('0x1')]},'type':{'type':Sequelize['ENUM'](_0x239b('0x2'),'internal',_0x239b('0x3'),_0x239b('0x4'),'outbound-fax',_0x239b('0x5'))},'tag':{'type':Sequelize[_0x239b('0x1')]},'accountcode':{'type':Sequelize['STRING']},'source':{'type':Sequelize['STRING']},'destination':{'type':Sequelize['STRING']},'destinationcontext':{'type':Sequelize[_0x239b('0x1')]},'callerid':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x239b('0x1')]},'destinationchannel':{'type':Sequelize['STRING']},'lastapplication':{'type':Sequelize[_0x239b('0x1')]},'lastdata':{'type':Sequelize[_0x239b('0x6')]},'starttime':{'type':Sequelize[_0x239b('0x7')]},'systemanswertime':{'type':Sequelize[_0x239b('0x7')]},'answertime':{'type':Sequelize[_0x239b('0x7')]},'endtime':{'type':Sequelize['DATE']},'duration':{'type':Sequelize['INTEGER']},'billableseconds':{'type':Sequelize[_0x239b('0x8')]},'mohtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x239b('0x1')]},'amaflags':{'type':Sequelize[_0x239b('0x1')]},'userfield':{'type':Sequelize['STRING']},'userDisposition':{'type':Sequelize[_0x239b('0x1')]},'userSecondDisposition':{'type':Sequelize[_0x239b('0x1')]},'userThirdDisposition':{'type':Sequelize[_0x239b('0x1')]},'note':{'type':Sequelize[_0x239b('0x1')]},'prefix':{'type':Sequelize['STRING']},'routeid':{'type':Sequelize[_0x239b('0x8')]},'sipcallid':{'type':Sequelize[_0x239b('0x1')]}}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.controller.js b/server/api/voiceCallReport/voiceCallReport.controller.js index 9bc52b1..11636cf 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 _0xb10b=['desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','reject','update','then','destroy','end','error','stack','name','send','index','map','rawAttributes','fieldName','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','VIRTUAL','filter','merge','options','VoiceCallReport','includeAll','include','alias','User','rows','show','find','create','body','catch','params','describe','uniqueid','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce'];(function(_0x186bbc,_0xca3452){var _0x139a89=function(_0x4d2733){while(--_0x4d2733){_0x186bbc['push'](_0x186bbc['shift']());}};_0x139a89(++_0xca3452);}(_0xb10b,0x12a));var _0xbb10=function(_0x2e0d2a,_0x8d568){_0x2e0d2a=_0x2e0d2a-0x0;var _0x4014f0=_0xb10b[_0x2e0d2a];return _0x4014f0;};'use strict';var emlformat=require(_0xbb10('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbb10('0x1'));var jsonpatch=require(_0xbb10('0x2'));var rp=require(_0xbb10('0x3'));var moment=require('moment');var BPromise=require(_0xbb10('0x4'));var Mustache=require(_0xbb10('0x5'));var util=require(_0xbb10('0x6'));var path=require(_0xbb10('0x7'));var sox=require(_0xbb10('0x8'));var csv=require(_0xbb10('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbb10('0xa'));var _=require(_0xbb10('0xb'));var squel=require('squel');var crypto=require(_0xbb10('0xc'));var jsforce=require(_0xbb10('0xd'));var deskjs=require(_0xbb10('0xe'));var toCsv=require(_0xbb10('0x9'));var querystring=require(_0xbb10('0xf'));var Papa=require(_0xbb10('0x10'));var Redis=require(_0xbb10('0x11'));var authService=require(_0xbb10('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbb10('0x13'));var logger=require(_0xbb10('0x14'))(_0xbb10('0x15'));var utils=require('../../config/utils');var config=require(_0xbb10('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xbb10('0x17'))['db'];function respondWithStatusCode(_0x916a32,_0x285009){_0x285009=_0x285009||0xcc;return function(_0x193a27){if(_0x193a27){return _0x916a32[_0xbb10('0x18')](_0x285009);}return _0x916a32[_0xbb10('0x19')](_0x285009)['end']();};}function respondWithResult(_0x26e021,_0x42d7e4){_0x42d7e4=_0x42d7e4||0xc8;return function(_0x45b9d6){if(_0x45b9d6){return _0x26e021[_0xbb10('0x19')](_0x42d7e4)[_0xbb10('0x1a')](_0x45b9d6);}};}function respondWithFilteredResult(_0x2f2ebf,_0x24a57b){return function(_0x36b5e8){if(_0x36b5e8){var _0x3e26f4=typeof _0x24a57b[_0xbb10('0x1b')]==='undefined'&&typeof _0x24a57b[_0xbb10('0x1c')]===_0xbb10('0x1d');var _0x133ac2=_0x36b5e8[_0xbb10('0x1e')];var _0x378da8=_0x3e26f4?0x0:_0x24a57b[_0xbb10('0x1b')];var _0x575cca=_0x3e26f4?_0x36b5e8[_0xbb10('0x1e')]:_0x24a57b[_0xbb10('0x1b')]+_0x24a57b[_0xbb10('0x1c')];var _0x48b6e9;if(_0x575cca>=_0x133ac2){_0x575cca=_0x133ac2;_0x48b6e9=0xc8;}else{_0x48b6e9=0xce;}_0x2f2ebf[_0xbb10('0x19')](_0x48b6e9);return _0x2f2ebf[_0xbb10('0x1f')](_0xbb10('0x20'),_0x378da8+'-'+_0x575cca+'/'+_0x133ac2)[_0xbb10('0x1a')](_0x36b5e8);}return null;};}function patchUpdates(_0xdf237d){return function(_0x44e563){try{jsonpatch['apply'](_0x44e563,_0xdf237d,!![]);}catch(_0x12f888){return BPromise[_0xbb10('0x21')](_0x12f888);}return _0x44e563['save']();};}function saveUpdates(_0x4c4b0d,_0x8e2b97){return function(_0x311abe){if(_0x311abe){return _0x311abe[_0xbb10('0x22')](_0x4c4b0d)[_0xbb10('0x23')](function(_0x445761){return _0x445761;});}return null;};}function removeEntity(_0x1824b7,_0x407cb4){return function(_0x436104){if(_0x436104){return _0x436104[_0xbb10('0x24')]()[_0xbb10('0x23')](function(){_0x1824b7[_0xbb10('0x19')](0xcc)[_0xbb10('0x25')]();});}};}function handleEntityNotFound(_0x537898,_0x4fedac){return function(_0x4fb5e0){if(!_0x4fb5e0){_0x537898[_0xbb10('0x18')](0x194);}return _0x4fb5e0;};}function handleError(_0x3c5ae7,_0x2c89b9){_0x2c89b9=_0x2c89b9||0x1f4;return function(_0x4e25ff){logger[_0xbb10('0x26')](_0x4e25ff[_0xbb10('0x27')]);if(_0x4e25ff[_0xbb10('0x28')]){delete _0x4e25ff[_0xbb10('0x28')];}_0x3c5ae7[_0xbb10('0x19')](_0x2c89b9)[_0xbb10('0x29')](_0x4e25ff);};}exports[_0xbb10('0x2a')]=function(_0x4aabb9,_0x3796c7){var _0x21ac54={},_0xfc3595={},_0x2e0249={'count':0x0,'rows':[]};var _0x1d30aa=_[_0xbb10('0x2b')](db['VoiceCallReport'][_0xbb10('0x2c')],function(_0x4ee02e){return{'name':_0x4ee02e[_0xbb10('0x2d')],'type':_0x4ee02e['type'][_0xbb10('0x2e')]};});_0xfc3595[_0xbb10('0x2f')]=_[_0xbb10('0x2b')](_0x1d30aa,'name');_0xfc3595['query']=_[_0xbb10('0x30')](_0x4aabb9[_0xbb10('0x31')]);_0xfc3595['filters']=_[_0xbb10('0x32')](_0xfc3595[_0xbb10('0x2f')],_0xfc3595[_0xbb10('0x31')]);_0x21ac54[_0xbb10('0x33')]=_[_0xbb10('0x32')](_0xfc3595[_0xbb10('0x2f')],qs[_0xbb10('0x34')](_0x4aabb9['query'][_0xbb10('0x34')]));_0x21ac54[_0xbb10('0x33')]=_0x21ac54[_0xbb10('0x33')][_0xbb10('0x35')]?_0x21ac54[_0xbb10('0x33')]:_0xfc3595[_0xbb10('0x2f')];if(!_0x4aabb9[_0xbb10('0x31')][_0xbb10('0x36')](_0xbb10('0x37'))){_0x21ac54['limit']=qs[_0xbb10('0x1c')](_0x4aabb9[_0xbb10('0x31')][_0xbb10('0x1c')]);_0x21ac54[_0xbb10('0x1b')]=qs['offset'](_0x4aabb9[_0xbb10('0x31')]['offset']);}_0x21ac54['order']=qs[_0xbb10('0x38')](_0x4aabb9[_0xbb10('0x31')][_0xbb10('0x38')]);_0x21ac54[_0xbb10('0x39')]=qs[_0xbb10('0x3a')](_[_0xbb10('0x3b')](_0x4aabb9['query'],_0xfc3595[_0xbb10('0x3a')]),_0x1d30aa);if(_0x4aabb9[_0xbb10('0x31')]['filter']){_0x21ac54['where']=_['merge'](_0x21ac54[_0xbb10('0x39')],{'$or':_[_0xbb10('0x2b')](_0x1d30aa,function(_0x2b658a){if(_0x2b658a['type']!==_0xbb10('0x3c')){var _0x3e8538={};_0x3e8538[_0x2b658a[_0xbb10('0x28')]]={'$like':'%'+_0x4aabb9['query'][_0xbb10('0x3d')]+'%'};return _0x3e8538;}})});}_0x21ac54=_[_0xbb10('0x3e')]({},_0x21ac54,_0x4aabb9[_0xbb10('0x3f')]);var _0x446f49={'where':_0x21ac54['where']};return db[_0xbb10('0x40')][_0xbb10('0x1e')](_0x446f49)['then'](function(_0xe2040f){_0x2e0249[_0xbb10('0x1e')]=_0xe2040f;if(_0x4aabb9[_0xbb10('0x31')][_0xbb10('0x41')]){_0x21ac54[_0xbb10('0x42')]=[{'attributes':['id',_0xbb10('0x28'),'fullname',_0xbb10('0x43')],'model':db[_0xbb10('0x44')],'as':_0xbb10('0x44')}];}return db[_0xbb10('0x40')]['findAll'](_0x21ac54);})[_0xbb10('0x23')](function(_0x331751){_0x2e0249[_0xbb10('0x45')]=_0x331751;return _0x2e0249;})[_0xbb10('0x23')](respondWithFilteredResult(_0x3796c7,_0x21ac54))['catch'](handleError(_0x3796c7,null));};exports[_0xbb10('0x46')]=function(_0x202c60,_0x54ac18){var _0x5d9a4f={'raw':!![],'where':{'id':_0x202c60['params']['id']}},_0x38d78f={};_0x38d78f[_0xbb10('0x2f')]=_[_0xbb10('0x30')](db['VoiceCallReport'][_0xbb10('0x2c')]);_0x38d78f[_0xbb10('0x31')]=_[_0xbb10('0x30')](_0x202c60['query']);_0x38d78f[_0xbb10('0x3a')]=_[_0xbb10('0x32')](_0x38d78f[_0xbb10('0x2f')],_0x38d78f[_0xbb10('0x31')]);_0x5d9a4f[_0xbb10('0x33')]=_[_0xbb10('0x32')](_0x38d78f[_0xbb10('0x2f')],qs[_0xbb10('0x34')](_0x202c60[_0xbb10('0x31')][_0xbb10('0x34')]));_0x5d9a4f[_0xbb10('0x33')]=_0x5d9a4f[_0xbb10('0x33')]['length']?_0x5d9a4f[_0xbb10('0x33')]:_0x38d78f[_0xbb10('0x2f')];if(_0x202c60['query'][_0xbb10('0x41')]){_0x5d9a4f[_0xbb10('0x42')]=[{'all':!![]}];}_0x5d9a4f=_[_0xbb10('0x3e')]({},_0x5d9a4f,_0x202c60[_0xbb10('0x3f')]);return db[_0xbb10('0x40')][_0xbb10('0x47')](_0x5d9a4f)[_0xbb10('0x23')](handleEntityNotFound(_0x54ac18,null))['then'](respondWithResult(_0x54ac18,null))['catch'](handleError(_0x54ac18,null));};exports[_0xbb10('0x48')]=function(_0x76a208,_0x2b12bd){return db['VoiceCallReport']['create'](_0x76a208[_0xbb10('0x49')],{})[_0xbb10('0x23')](respondWithResult(_0x2b12bd,0xc9))[_0xbb10('0x4a')](handleError(_0x2b12bd,null));};exports[_0xbb10('0x24')]=function(_0x10159b,_0x22b315){return db[_0xbb10('0x40')][_0xbb10('0x47')]({'where':{'id':_0x10159b[_0xbb10('0x4b')]['id']}})[_0xbb10('0x23')](handleEntityNotFound(_0x22b315,null))['then'](removeEntity(_0x22b315,null))['catch'](handleError(_0x22b315,null));};exports[_0xbb10('0x4c')]=function(_0x467dba,_0x36ab7d){return db[_0xbb10('0x40')][_0xbb10('0x4c')]()[_0xbb10('0x23')](respondWithResult(_0x36ab7d,null))[_0xbb10('0x4a')](handleError(_0x36ab7d,null));};exports[_0xbb10('0x22')]=function(_0x1c0d8f,_0x1214f7){if(_0x1c0d8f[_0xbb10('0x49')][_0xbb10('0x4d')]){delete _0x1c0d8f[_0xbb10('0x49')][_0xbb10('0x4d')];}return db[_0xbb10('0x40')]['find']({'where':{'uniqueid':_0x1c0d8f[_0xbb10('0x4b')]['id'],'UserId':{'$or':[null,_0x1c0d8f['user']['id']]}}})[_0xbb10('0x23')](handleEntityNotFound(_0x1214f7,null))[_0xbb10('0x23')](saveUpdates(_0x1c0d8f[_0xbb10('0x49')],null))[_0xbb10('0x23')](respondWithResult(_0x1214f7,null))[_0xbb10('0x4a')](handleError(_0x1214f7,null));}; \ No newline at end of file +var _0x2032=['../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','then','destroy','sendStatus','error','stack','name','send','index','map','VoiceCallReport','fieldName','type','key','query','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','pick','filters','filter','merge','where','options','alias','User','rows','catch','show','params','keys','rawAttributes','includeAll','include','create','body','find','describe','uniqueid','user','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2032,0xd9));var _0x2203=function(_0x473464,_0x1e1aaa){_0x473464=_0x473464-0x0;var _0x4bd4a6=_0x2032[_0x473464];return _0x4bd4a6;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2203('0x0'));var zipdir=require(_0x2203('0x1'));var jsonpatch=require(_0x2203('0x2'));var rp=require('request-promise');var moment=require(_0x2203('0x3'));var BPromise=require(_0x2203('0x4'));var Mustache=require('mustache');var util=require(_0x2203('0x5'));var path=require(_0x2203('0x6'));var sox=require(_0x2203('0x7'));var csv=require(_0x2203('0x8'));var ejs=require(_0x2203('0x9'));var fs=require('fs');var fs_extra=require(_0x2203('0xa'));var _=require(_0x2203('0xb'));var squel=require(_0x2203('0xc'));var crypto=require(_0x2203('0xd'));var jsforce=require(_0x2203('0xe'));var deskjs=require(_0x2203('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x2203('0x10'));var Redis=require('ioredis');var authService=require(_0x2203('0x11'));var qs=require(_0x2203('0x12'));var as=require(_0x2203('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2203('0x14'))('api');var utils=require(_0x2203('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x2203('0x16'));var db=require(_0x2203('0x17'))['db'];function respondWithStatusCode(_0x4b9376,_0x583bc7){_0x583bc7=_0x583bc7||0xcc;return function(_0x585c76){if(_0x585c76){return _0x4b9376['sendStatus'](_0x583bc7);}return _0x4b9376['status'](_0x583bc7)[_0x2203('0x18')]();};}function respondWithResult(_0x538b30,_0x592e47){_0x592e47=_0x592e47||0xc8;return function(_0x21a3af){if(_0x21a3af){return _0x538b30[_0x2203('0x19')](_0x592e47)[_0x2203('0x1a')](_0x21a3af);}};}function respondWithFilteredResult(_0x41af85,_0x226209){return function(_0x3fe0a8){if(_0x3fe0a8){var _0x2c36e6=typeof _0x226209[_0x2203('0x1b')]===_0x2203('0x1c')&&typeof _0x226209[_0x2203('0x1d')]==='undefined';var _0x280eda=_0x3fe0a8[_0x2203('0x1e')];var _0x4893ff=_0x2c36e6?0x0:_0x226209[_0x2203('0x1b')];var _0x8906e1=_0x2c36e6?_0x3fe0a8['count']:_0x226209[_0x2203('0x1b')]+_0x226209['limit'];var _0x2904ba;if(_0x8906e1>=_0x280eda){_0x8906e1=_0x280eda;_0x2904ba=0xc8;}else{_0x2904ba=0xce;}_0x41af85[_0x2203('0x19')](_0x2904ba);return _0x41af85[_0x2203('0x1f')](_0x2203('0x20'),_0x4893ff+'-'+_0x8906e1+'/'+_0x280eda)[_0x2203('0x1a')](_0x3fe0a8);}return null;};}function patchUpdates(_0x449039){return function(_0x538c23){try{jsonpatch[_0x2203('0x21')](_0x538c23,_0x449039,!![]);}catch(_0x50822b){return BPromise['reject'](_0x50822b);}return _0x538c23[_0x2203('0x22')]();};}function saveUpdates(_0x496d82,_0x3b8ef9){return function(_0x5bfe61){if(_0x5bfe61){return _0x5bfe61['update'](_0x496d82)[_0x2203('0x23')](function(_0x5e29cd){return _0x5e29cd;});}return null;};}function removeEntity(_0x5c8da9,_0x226374){return function(_0x2718f5){if(_0x2718f5){return _0x2718f5[_0x2203('0x24')]()[_0x2203('0x23')](function(){_0x5c8da9[_0x2203('0x19')](0xcc)[_0x2203('0x18')]();});}};}function handleEntityNotFound(_0x49c12,_0x250349){return function(_0x576378){if(!_0x576378){_0x49c12[_0x2203('0x25')](0x194);}return _0x576378;};}function handleError(_0x36b958,_0x39a11a){_0x39a11a=_0x39a11a||0x1f4;return function(_0x5f11bf){logger[_0x2203('0x26')](_0x5f11bf[_0x2203('0x27')]);if(_0x5f11bf['name']){delete _0x5f11bf[_0x2203('0x28')];}_0x36b958[_0x2203('0x19')](_0x39a11a)[_0x2203('0x29')](_0x5f11bf);};}exports[_0x2203('0x2a')]=function(_0x28ae02,_0x1df508){var _0x9c53f={},_0x5a95c1={},_0x34b8ba={'count':0x0,'rows':[]};var _0x616ed8=_[_0x2203('0x2b')](db[_0x2203('0x2c')]['rawAttributes'],function(_0x3a8e23){return{'name':_0x3a8e23[_0x2203('0x2d')],'type':_0x3a8e23[_0x2203('0x2e')][_0x2203('0x2f')]};});_0x5a95c1['model']=_[_0x2203('0x2b')](_0x616ed8,_0x2203('0x28'));_0x5a95c1['query']=_['keys'](_0x28ae02[_0x2203('0x30')]);_0x5a95c1['filters']=_['intersection'](_0x5a95c1[_0x2203('0x31')],_0x5a95c1[_0x2203('0x30')]);_0x9c53f[_0x2203('0x32')]=_[_0x2203('0x33')](_0x5a95c1[_0x2203('0x31')],qs['fields'](_0x28ae02[_0x2203('0x30')][_0x2203('0x34')]));_0x9c53f['attributes']=_0x9c53f[_0x2203('0x32')][_0x2203('0x35')]?_0x9c53f[_0x2203('0x32')]:_0x5a95c1[_0x2203('0x31')];if(!_0x28ae02[_0x2203('0x30')][_0x2203('0x36')](_0x2203('0x37'))){_0x9c53f[_0x2203('0x1d')]=qs[_0x2203('0x1d')](_0x28ae02['query'][_0x2203('0x1d')]);_0x9c53f[_0x2203('0x1b')]=qs['offset'](_0x28ae02['query'][_0x2203('0x1b')]);}_0x9c53f['order']=qs[_0x2203('0x38')](_0x28ae02[_0x2203('0x30')][_0x2203('0x38')]);_0x9c53f['where']=qs['filters'](_[_0x2203('0x39')](_0x28ae02['query'],_0x5a95c1[_0x2203('0x3a')]),_0x616ed8);if(_0x28ae02['query'][_0x2203('0x3b')]){_0x9c53f['where']=_[_0x2203('0x3c')](_0x9c53f[_0x2203('0x3d')],{'$or':_[_0x2203('0x2b')](_0x616ed8,function(_0x40a793){if(_0x40a793[_0x2203('0x2e')]!=='VIRTUAL'){var _0x5f1561={};_0x5f1561[_0x40a793['name']]={'$like':'%'+_0x28ae02[_0x2203('0x30')][_0x2203('0x3b')]+'%'};return _0x5f1561;}})});}_0x9c53f=_[_0x2203('0x3c')]({},_0x9c53f,_0x28ae02[_0x2203('0x3e')]);var _0x3283fb={'where':_0x9c53f[_0x2203('0x3d')]};return db[_0x2203('0x2c')]['count'](_0x3283fb)[_0x2203('0x23')](function(_0x1b12c3){_0x34b8ba[_0x2203('0x1e')]=_0x1b12c3;if(_0x28ae02[_0x2203('0x30')]['includeAll']){_0x9c53f['include']=[{'attributes':['id',_0x2203('0x28'),'fullname',_0x2203('0x3f')],'model':db[_0x2203('0x40')],'as':_0x2203('0x40')}];}return db['VoiceCallReport']['findAll'](_0x9c53f);})[_0x2203('0x23')](function(_0x3739f6){_0x34b8ba[_0x2203('0x41')]=_0x3739f6;return _0x34b8ba;})[_0x2203('0x23')](respondWithFilteredResult(_0x1df508,_0x9c53f))[_0x2203('0x42')](handleError(_0x1df508,null));};exports[_0x2203('0x43')]=function(_0x5cd573,_0x15d3b6){var _0x165a3f={'raw':!![],'where':{'id':_0x5cd573[_0x2203('0x44')]['id']}},_0x3a866c={};_0x3a866c[_0x2203('0x31')]=_[_0x2203('0x45')](db[_0x2203('0x2c')][_0x2203('0x46')]);_0x3a866c[_0x2203('0x30')]=_[_0x2203('0x45')](_0x5cd573['query']);_0x3a866c[_0x2203('0x3a')]=_[_0x2203('0x33')](_0x3a866c[_0x2203('0x31')],_0x3a866c[_0x2203('0x30')]);_0x165a3f['attributes']=_['intersection'](_0x3a866c[_0x2203('0x31')],qs['fields'](_0x5cd573[_0x2203('0x30')][_0x2203('0x34')]));_0x165a3f[_0x2203('0x32')]=_0x165a3f[_0x2203('0x32')]['length']?_0x165a3f[_0x2203('0x32')]:_0x3a866c[_0x2203('0x31')];if(_0x5cd573['query'][_0x2203('0x47')]){_0x165a3f[_0x2203('0x48')]=[{'all':!![]}];}_0x165a3f=_[_0x2203('0x3c')]({},_0x165a3f,_0x5cd573[_0x2203('0x3e')]);return db['VoiceCallReport']['find'](_0x165a3f)[_0x2203('0x23')](handleEntityNotFound(_0x15d3b6,null))['then'](respondWithResult(_0x15d3b6,null))['catch'](handleError(_0x15d3b6,null));};exports[_0x2203('0x49')]=function(_0x33b7b5,_0x1a2665){return db['VoiceCallReport']['create'](_0x33b7b5[_0x2203('0x4a')],{})[_0x2203('0x23')](respondWithResult(_0x1a2665,0xc9))[_0x2203('0x42')](handleError(_0x1a2665,null));};exports[_0x2203('0x24')]=function(_0x225b0e,_0x21fd78){return db['VoiceCallReport'][_0x2203('0x4b')]({'where':{'id':_0x225b0e['params']['id']}})[_0x2203('0x23')](handleEntityNotFound(_0x21fd78,null))[_0x2203('0x23')](removeEntity(_0x21fd78,null))[_0x2203('0x42')](handleError(_0x21fd78,null));};exports[_0x2203('0x4c')]=function(_0x58b9bb,_0x506795){return db[_0x2203('0x2c')][_0x2203('0x4c')]()[_0x2203('0x23')](respondWithResult(_0x506795,null))[_0x2203('0x42')](handleError(_0x506795,null));};exports['update']=function(_0x4de47a,_0x49999a){if(_0x4de47a[_0x2203('0x4a')][_0x2203('0x4d')]){delete _0x4de47a['body'][_0x2203('0x4d')];}return db[_0x2203('0x2c')]['find']({'where':{'uniqueid':_0x4de47a[_0x2203('0x44')]['id'],'UserId':{'$or':[null,_0x4de47a[_0x2203('0x4e')]['id']]}}})[_0x2203('0x23')](handleEntityNotFound(_0x49999a,null))[_0x2203('0x23')](saveUpdates(_0x4de47a['body'],null))[_0x2203('0x23')](respondWithResult(_0x49999a,null))['catch'](handleError(_0x49999a,null));}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.model.js b/server/api/voiceCallReport/voiceCallReport.model.js index 76a0972..b973774 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 _0xd6da=['../../config/logger','path','./voiceCallReport.attributes','exports','define','VoiceCallReport','util'];(function(_0x2d11b7,_0x3031f0){var _0x2b183f=function(_0x538af5){while(--_0x538af5){_0x2d11b7['push'](_0x2d11b7['shift']());}};_0x2b183f(++_0x3031f0);}(_0xd6da,0x76));var _0xad6d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd6da[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0xad6d('0x0'));var logger=require(_0xad6d('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xad6d('0x2'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xad6d('0x3'));module[_0xad6d('0x4')]=function(_0x36c772,_0x1ea4f2){return _0x36c772[_0xad6d('0x5')](_0xad6d('0x6'),attributes,{'tableName':'report_call','paranoid':![],'indexes':[{'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x1006=['rimraf','./voiceCallReport.attributes','exports','define','report_call','uniqueid','lodash','util','api','bluebird','request-promise','path'];(function(_0x333f44,_0x8eba6c){var _0x7e2c8c=function(_0x508bfd){while(--_0x508bfd){_0x333f44['push'](_0x333f44['shift']());}};_0x7e2c8c(++_0x8eba6c);}(_0x1006,0x102));var _0x6100=function(_0x4e9628,_0x250573){_0x4e9628=_0x4e9628-0x0;var _0x27bc8c=_0x1006[_0x4e9628];return _0x27bc8c;};'use strict';var _=require(_0x6100('0x0'));var util=require(_0x6100('0x1'));var logger=require('../../config/logger')(_0x6100('0x2'));var moment=require('moment');var BPromise=require(_0x6100('0x3'));var rp=require(_0x6100('0x4'));var fs=require('fs');var path=require(_0x6100('0x5'));var rimraf=require(_0x6100('0x6'));var config=require('../../config/environment');var attributes=require(_0x6100('0x7'));module[_0x6100('0x8')]=function(_0x5f26e6,_0x2e5166){return _0x5f26e6[_0x6100('0x9')]('VoiceCallReport',attributes,{'tableName':_0x6100('0xa'),'paranoid':![],'indexes':[{'fields':[_0x6100('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.rpc.js b/server/api/voiceCallReport/voiceCallReport.rpc.js index b608718..b209cff 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 _0x7189=['ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','code','error','VoiceCallReport,\x20%s,\x20%s','message','result','GetVoiceCallReport','findAll','options','raw','limit','include','map','model','attributes','catch','CreateVoiceCallReport','VoiceCallReport','create','body','UpdateVoiceCallReport','update','where','lodash','moment','randomstring'];(function(_0x42504b,_0x519da3){var _0x495ebc=function(_0x32ecee){while(--_0x32ecee){_0x42504b['push'](_0x42504b['shift']());}};_0x495ebc(++_0x519da3);}(_0x7189,0x179));var _0x9718=function(_0x93359d,_0xd47143){_0x93359d=_0x93359d-0x0;var _0x5b53b7=_0x7189[_0x93359d];return _0x5b53b7;};'use strict';var _=require(_0x9718('0x0'));var util=require('util');var moment=require(_0x9718('0x1'));var BPromise=require('bluebird');var rs=require(_0x9718('0x2'));var fs=require('fs');var Redis=require(_0x9718('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x9718('0x4'));var logger=require(_0x9718('0x5'))('rpc');var config=require(_0x9718('0x6'));var jayson=require(_0x9718('0x7'));var client=jayson[_0x9718('0x8')][_0x9718('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4e8ec2,_0x59e25c,_0x1f20c4){return new BPromise(function(_0x2a3368,_0x483bdd){return client[_0x9718('0xa')](_0x4e8ec2,_0x1f20c4)[_0x9718('0xb')](function(_0x11818f){logger[_0x9718('0xc')]('VoiceCallReport,\x20%s,\x20%s',_0x59e25c,_0x9718('0xd'));logger[_0x9718('0xe')]('VoiceCallReport,\x20%s,\x20%s,\x20%s',_0x59e25c,'request\x20sent',JSON[_0x9718('0xf')](_0x11818f));if(_0x11818f['error']){if(_0x11818f['error'][_0x9718('0x10')]===0x1f4){logger[_0x9718('0x11')](_0x9718('0x12'),_0x59e25c,_0x11818f['error'][_0x9718('0x13')]);return _0x483bdd(_0x11818f['error']['message']);}logger[_0x9718('0x11')](_0x9718('0x12'),_0x59e25c,_0x11818f['error'][_0x9718('0x13')]);return _0x2a3368(_0x11818f[_0x9718('0x11')]['message']);}else{logger[_0x9718('0xc')]('VoiceCallReport,\x20%s,\x20%s',_0x59e25c,_0x9718('0xd'));_0x2a3368(_0x11818f[_0x9718('0x14')][_0x9718('0x13')]);}})['catch'](function(_0x23e694){logger['error']('VoiceCallReport,\x20%s,\x20%s',_0x59e25c,_0x23e694);_0x483bdd(_0x23e694);});});}exports[_0x9718('0x15')]=function(_0x43eff3){var _0x2808af=this;return new Promise(function(_0x1d1334,_0x11e486){return db['VoiceCallReport'][_0x9718('0x16')]({'raw':_0x43eff3[_0x9718('0x17')]?_0x43eff3[_0x9718('0x17')][_0x9718('0x18')]===undefined?!![]:![]:!![],'where':_0x43eff3['options']?_0x43eff3[_0x9718('0x17')]['where']||null:null,'attributes':_0x43eff3[_0x9718('0x17')]?_0x43eff3['options']['attributes']||null:null,'limit':_0x43eff3[_0x9718('0x17')]?_0x43eff3[_0x9718('0x17')][_0x9718('0x19')]||null:null,'include':_0x43eff3['options']?_0x43eff3[_0x9718('0x17')][_0x9718('0x1a')]?_[_0x9718('0x1b')](_0x43eff3[_0x9718('0x17')][_0x9718('0x1a')],function(_0x558710){return{'model':db[_0x558710[_0x9718('0x1c')]],'as':_0x558710['as'],'attributes':_0x558710[_0x9718('0x1d')],'include':_0x558710[_0x9718('0x1a')]?_['map'](_0x558710[_0x9718('0x1a')],function(_0x1811ec){return{'model':db[_0x1811ec[_0x9718('0x1c')]],'as':_0x1811ec['as'],'attributes':_0x1811ec['attributes'],'include':_0x1811ec[_0x9718('0x1a')]?_[_0x9718('0x1b')](_0x1811ec[_0x9718('0x1a')],function(_0x505aa4){return{'model':db[_0x505aa4[_0x9718('0x1c')]],'as':_0x505aa4['as'],'attributes':_0x505aa4[_0x9718('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x9718('0xb')](function(_0xdb69b9){logger[_0x9718('0xc')](_0x9718('0x15'),_0x43eff3);logger[_0x9718('0xe')]('GetVoiceCallReport',_0x43eff3,JSON[_0x9718('0xf')](_0xdb69b9));_0x1d1334(_0xdb69b9);})[_0x9718('0x1e')](function(_0x11f06e){logger[_0x9718('0x11')](_0x9718('0x15'),_0x11f06e[_0x9718('0x13')],_0x43eff3);_0x11e486(_0x2808af['error'](0x1f4,_0x11f06e['message']));});});};exports[_0x9718('0x1f')]=function(_0x31aeed){var _0x4ea10f=this;return new Promise(function(_0x16ce59,_0x19bbd1){return db[_0x9718('0x20')][_0x9718('0x21')](_0x31aeed[_0x9718('0x22')],{'raw':_0x31aeed[_0x9718('0x17')]?_0x31aeed[_0x9718('0x17')][_0x9718('0x18')]===undefined?!![]:![]:!![]})[_0x9718('0xb')](function(_0x3b31b7){logger[_0x9718('0xc')]('CreateVoiceCallReport',_0x31aeed);logger[_0x9718('0xe')](_0x9718('0x1f'),_0x31aeed,JSON[_0x9718('0xf')](_0x3b31b7));_0x16ce59(_0x3b31b7);})['catch'](function(_0x5d9026){logger['error']('CreateVoiceCallReport',_0x5d9026[_0x9718('0x13')],_0x31aeed);_0x19bbd1(_0x4ea10f[_0x9718('0x11')](0x1f4,_0x5d9026['message']));});});};exports[_0x9718('0x23')]=function(_0x59e60b){var _0x21159a=this;return new Promise(function(_0x3b312d,_0x15aeb5){return db[_0x9718('0x20')][_0x9718('0x24')](_0x59e60b[_0x9718('0x22')],{'raw':_0x59e60b[_0x9718('0x17')]?_0x59e60b[_0x9718('0x17')][_0x9718('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x59e60b[_0x9718('0x17')]?_0x59e60b[_0x9718('0x17')][_0x9718('0x25')]||null:null,'attributes':_0x59e60b[_0x9718('0x17')]?_0x59e60b[_0x9718('0x17')][_0x9718('0x1d')]||null:null,'limit':_0x59e60b['options']?_0x59e60b[_0x9718('0x17')][_0x9718('0x19')]||null:null})[_0x9718('0xb')](function(_0x599490){logger[_0x9718('0xc')](_0x9718('0x23'),_0x59e60b);logger[_0x9718('0xe')]('UpdateVoiceCallReport',_0x59e60b,JSON[_0x9718('0xf')](_0x599490));_0x3b312d(_0x599490);})[_0x9718('0x1e')](function(_0x9568f4){logger[_0x9718('0x11')](_0x9718('0x23'),_0x9568f4[_0x9718('0x13')],_0x59e60b);_0x15aeb5(_0x21159a[_0x9718('0x11')](0x1f4,_0x9568f4[_0x9718('0x13')]));});});}; \ No newline at end of file +var _0x4a49=['info','VoiceCallReport,\x20%s,\x20%s','request\x20sent','debug','VoiceCallReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','findAll','options','raw','where','limit','include','map','model','attributes','GetVoiceCallReport','CreateVoiceCallReport','VoiceCallReport','create','body','UpdateVoiceCallReport','update','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then'];(function(_0x415393,_0x4ea055){var _0x1b191b=function(_0xcfb0f1){while(--_0xcfb0f1){_0x415393['push'](_0x415393['shift']());}};_0x1b191b(++_0x4ea055);}(_0x4a49,0x183));var _0x94a4=function(_0xc09bc1,_0x5192e1){_0xc09bc1=_0xc09bc1-0x0;var _0x48096e=_0x4a49[_0xc09bc1];return _0x48096e;};'use strict';var _=require(_0x94a4('0x0'));var util=require(_0x94a4('0x1'));var moment=require(_0x94a4('0x2'));var BPromise=require(_0x94a4('0x3'));var rs=require(_0x94a4('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x94a4('0x5'))['db'];var utils=require(_0x94a4('0x6'));var logger=require(_0x94a4('0x7'))(_0x94a4('0x8'));var config=require('../../config/environment');var jayson=require(_0x94a4('0x9'));var client=jayson[_0x94a4('0xa')][_0x94a4('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5bfc7f,_0x67f0e6,_0x43641b){return new BPromise(function(_0x4496b5,_0x2a6ad9){return client['request'](_0x5bfc7f,_0x43641b)[_0x94a4('0xc')](function(_0x4e0952){logger[_0x94a4('0xd')](_0x94a4('0xe'),_0x67f0e6,_0x94a4('0xf'));logger[_0x94a4('0x10')](_0x94a4('0x11'),_0x67f0e6,'request\x20sent',JSON[_0x94a4('0x12')](_0x4e0952));if(_0x4e0952['error']){if(_0x4e0952[_0x94a4('0x13')][_0x94a4('0x14')]===0x1f4){logger[_0x94a4('0x13')]('VoiceCallReport,\x20%s,\x20%s',_0x67f0e6,_0x4e0952[_0x94a4('0x13')][_0x94a4('0x15')]);return _0x2a6ad9(_0x4e0952[_0x94a4('0x13')][_0x94a4('0x15')]);}logger['error'](_0x94a4('0xe'),_0x67f0e6,_0x4e0952['error'][_0x94a4('0x15')]);return _0x4496b5(_0x4e0952[_0x94a4('0x13')][_0x94a4('0x15')]);}else{logger[_0x94a4('0xd')](_0x94a4('0xe'),_0x67f0e6,_0x94a4('0xf'));_0x4496b5(_0x4e0952[_0x94a4('0x16')]['message']);}})[_0x94a4('0x17')](function(_0x232979){logger[_0x94a4('0x13')](_0x94a4('0xe'),_0x67f0e6,_0x232979);_0x2a6ad9(_0x232979);});});}exports['GetVoiceCallReport']=function(_0x2ec28c){var _0x12a7ef=this;return new Promise(function(_0x2b0ae1,_0x142ec4){return db['VoiceCallReport'][_0x94a4('0x18')]({'raw':_0x2ec28c[_0x94a4('0x19')]?_0x2ec28c[_0x94a4('0x19')][_0x94a4('0x1a')]===undefined?!![]:![]:!![],'where':_0x2ec28c['options']?_0x2ec28c[_0x94a4('0x19')][_0x94a4('0x1b')]||null:null,'attributes':_0x2ec28c[_0x94a4('0x19')]?_0x2ec28c[_0x94a4('0x19')]['attributes']||null:null,'limit':_0x2ec28c[_0x94a4('0x19')]?_0x2ec28c[_0x94a4('0x19')][_0x94a4('0x1c')]||null:null,'include':_0x2ec28c[_0x94a4('0x19')]?_0x2ec28c[_0x94a4('0x19')][_0x94a4('0x1d')]?_[_0x94a4('0x1e')](_0x2ec28c[_0x94a4('0x19')][_0x94a4('0x1d')],function(_0x5e9c56){return{'model':db[_0x5e9c56[_0x94a4('0x1f')]],'as':_0x5e9c56['as'],'attributes':_0x5e9c56[_0x94a4('0x20')],'include':_0x5e9c56[_0x94a4('0x1d')]?_['map'](_0x5e9c56['include'],function(_0x27b580){return{'model':db[_0x27b580[_0x94a4('0x1f')]],'as':_0x27b580['as'],'attributes':_0x27b580['attributes'],'include':_0x27b580[_0x94a4('0x1d')]?_[_0x94a4('0x1e')](_0x27b580[_0x94a4('0x1d')],function(_0x201c4b){return{'model':db[_0x201c4b[_0x94a4('0x1f')]],'as':_0x201c4b['as'],'attributes':_0x201c4b['attributes']};}):[]};}):[]};}):[]:[]})[_0x94a4('0xc')](function(_0x312e9c){logger[_0x94a4('0xd')]('GetVoiceCallReport',_0x2ec28c);logger[_0x94a4('0x10')]('GetVoiceCallReport',_0x2ec28c,JSON[_0x94a4('0x12')](_0x312e9c));_0x2b0ae1(_0x312e9c);})['catch'](function(_0x53a597){logger['error'](_0x94a4('0x21'),_0x53a597[_0x94a4('0x15')],_0x2ec28c);_0x142ec4(_0x12a7ef['error'](0x1f4,_0x53a597[_0x94a4('0x15')]));});});};exports[_0x94a4('0x22')]=function(_0x4bd60e){var _0x10af37=this;return new Promise(function(_0x22c5a9,_0x40e479){return db[_0x94a4('0x23')][_0x94a4('0x24')](_0x4bd60e[_0x94a4('0x25')],{'raw':_0x4bd60e['options']?_0x4bd60e[_0x94a4('0x19')][_0x94a4('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x37805c){logger[_0x94a4('0xd')](_0x94a4('0x22'),_0x4bd60e);logger['debug']('CreateVoiceCallReport',_0x4bd60e,JSON[_0x94a4('0x12')](_0x37805c));_0x22c5a9(_0x37805c);})[_0x94a4('0x17')](function(_0x4ed7eb){logger['error'](_0x94a4('0x22'),_0x4ed7eb[_0x94a4('0x15')],_0x4bd60e);_0x40e479(_0x10af37[_0x94a4('0x13')](0x1f4,_0x4ed7eb[_0x94a4('0x15')]));});});};exports[_0x94a4('0x26')]=function(_0x4de9c9){var _0x457d2f=this;return new Promise(function(_0x5569b4,_0x4146eb){return db[_0x94a4('0x23')][_0x94a4('0x27')](_0x4de9c9[_0x94a4('0x25')],{'raw':_0x4de9c9[_0x94a4('0x19')]?_0x4de9c9[_0x94a4('0x19')][_0x94a4('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4de9c9[_0x94a4('0x19')]?_0x4de9c9[_0x94a4('0x19')][_0x94a4('0x1b')]||null:null,'attributes':_0x4de9c9[_0x94a4('0x19')]?_0x4de9c9['options']['attributes']||null:null,'limit':_0x4de9c9[_0x94a4('0x19')]?_0x4de9c9[_0x94a4('0x19')]['limit']||null:null})['then'](function(_0x3d42ee){logger[_0x94a4('0xd')](_0x94a4('0x26'),_0x4de9c9);logger['debug'](_0x94a4('0x26'),_0x4de9c9,JSON[_0x94a4('0x12')](_0x3d42ee));_0x5569b4(_0x3d42ee);})[_0x94a4('0x17')](function(_0x261eb1){logger['error']('UpdateVoiceCallReport',_0x261eb1['message'],_0x4de9c9);_0x4146eb(_0x457d2f[_0x94a4('0x13')](0x1f4,_0x261eb1[_0x94a4('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/index.js b/server/api/voiceChanSpy/index.js index b738e70..116f0bb 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 _0xefd1=['/:id','show','create','update','delete','exports','multer','util','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated'];(function(_0x5f4cd7,_0x459c44){var _0x47c93f=function(_0x11f384){while(--_0x11f384){_0x5f4cd7['push'](_0x5f4cd7['shift']());}};_0x47c93f(++_0x459c44);}(_0xefd1,0x141));var _0x1efd=function(_0x202067,_0x25e057){_0x202067=_0x202067-0x0;var _0x4c792e=_0xefd1[_0x202067];return _0x4c792e;};'use strict';var multer=require(_0x1efd('0x0'));var util=require(_0x1efd('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x1efd('0x2'));var router=express[_0x1efd('0x3')]();var fs_extra=require(_0x1efd('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x1efd('0x5'));var config=require(_0x1efd('0x6'));var controller=require('./voiceChanSpy.controller');router[_0x1efd('0x7')]('/',auth[_0x1efd('0x8')](),controller['index']);router[_0x1efd('0x7')](_0x1efd('0x9'),auth['isAuthenticated'](),controller[_0x1efd('0xa')]);router['post']('/',auth['isAuthenticated'](),controller[_0x1efd('0xb')]);router['put'](_0x1efd('0x9'),auth[_0x1efd('0x8')](),controller[_0x1efd('0xc')]);router[_0x1efd('0xd')](_0x1efd('0x9'),auth[_0x1efd('0x8')](),controller['destroy']);module[_0x1efd('0xe')]=router; \ No newline at end of file +var _0x37ca=['isAuthenticated','index','/:id','show','create','put','update','destroy','util','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./voiceChanSpy.controller','get'];(function(_0x3070dc,_0x40cf11){var _0x431489=function(_0x49bc2a){while(--_0x49bc2a){_0x3070dc['push'](_0x3070dc['shift']());}};_0x431489(++_0x40cf11);}(_0x37ca,0x1a8));var _0xa37c=function(_0x4c4d90,_0x36f62a){_0x4c4d90=_0x4c4d90-0x0;var _0x13969a=_0x37ca[_0x4c4d90];return _0x13969a;};'use strict';var multer=require('multer');var util=require(_0xa37c('0x0'));var path=require('path');var timeout=require(_0xa37c('0x1'));var express=require(_0xa37c('0x2'));var router=express[_0xa37c('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xa37c('0x4'));var config=require(_0xa37c('0x5'));var controller=require(_0xa37c('0x6'));router[_0xa37c('0x7')]('/',auth[_0xa37c('0x8')](),controller[_0xa37c('0x9')]);router['get'](_0xa37c('0xa'),auth[_0xa37c('0x8')](),controller[_0xa37c('0xb')]);router['post']('/',auth['isAuthenticated'](),controller[_0xa37c('0xc')]);router[_0xa37c('0xd')]('/:id',auth[_0xa37c('0x8')](),controller[_0xa37c('0xe')]);router['delete'](_0xa37c('0xa'),auth[_0xa37c('0x8')](),controller[_0xa37c('0xf')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.attributes.js b/server/api/voiceChanSpy/voiceChanSpy.attributes.js index 3da4718..d95bba4 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 _0x6b02=['options','join','getDataValue','split','BOOLEAN','sequelize','exports','STRING','name'];(function(_0x1b7523,_0x1f7b56){var _0x41c140=function(_0x46b1c8){while(--_0x46b1c8){_0x1b7523['push'](_0x1b7523['shift']());}};_0x41c140(++_0x1f7b56);}(_0x6b02,0x11c));var _0x26b0=function(_0x12a244,_0x1bc014){_0x12a244=_0x12a244-0x0;var _0x13e553=_0x6b02[_0x12a244];return _0x13e553;};'use strict';var Sequelize=require(_0x26b0('0x0'));module[_0x26b0('0x1')]={'name':{'type':Sequelize[_0x26b0('0x2')]},'prefix':{'type':Sequelize[_0x26b0('0x2')],'unique':_0x26b0('0x3'),'allowNull':![]},'options':{'type':Sequelize[_0x26b0('0x2')],'set':function(_0x3cae98){this['setDataValue'](_0x26b0('0x4'),_0x3cae98?_0x3cae98[_0x26b0('0x5')](''):[]);},'get':function(){return this[_0x26b0('0x6')]('options')?this[_0x26b0('0x6')](_0x26b0('0x4'))[_0x26b0('0x7')](''):[];}},'auth':{'type':Sequelize[_0x26b0('0x8')],'defaultValue':![]},'password':{'type':Sequelize['STRING']},'record':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'recordingFormat':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xba3b=['options','join','getDataValue','split','BOOLEAN','sequelize','STRING','name','setDataValue'];(function(_0x40b3cd,_0x7bb2bb){var _0xda5bd5=function(_0x3cc149){while(--_0x3cc149){_0x40b3cd['push'](_0x40b3cd['shift']());}};_0xda5bd5(++_0x7bb2bb);}(_0xba3b,0x71));var _0xbba3=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0xba3b[_0x19950b];return _0x3c6b41;};'use strict';var Sequelize=require(_0xbba3('0x0'));module['exports']={'name':{'type':Sequelize[_0xbba3('0x1')]},'prefix':{'type':Sequelize[_0xbba3('0x1')],'unique':_0xbba3('0x2'),'allowNull':![]},'options':{'type':Sequelize[_0xbba3('0x1')],'set':function(_0x3f2931){this[_0xbba3('0x3')](_0xbba3('0x4'),_0x3f2931?_0x3f2931[_0xbba3('0x5')](''):[]);},'get':function(){return this[_0xbba3('0x6')](_0xbba3('0x4'))?this[_0xbba3('0x6')](_0xbba3('0x4'))[_0xbba3('0x7')](''):[];}},'auth':{'type':Sequelize[_0xbba3('0x8')],'defaultValue':![]},'password':{'type':Sequelize['STRING']},'record':{'type':Sequelize[_0xbba3('0x8')],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0xbba3('0x1')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.controller.js b/server/api/voiceChanSpy/voiceChanSpy.controller.js index 2fed632..2f1be8b 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 _0xbbfa=['hasOwnProperty','nolimit','order','sort','filters','pick','merge','VIRTUAL','filter','options','VoiceChanSpy','includeAll','include','catch','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','desk.js','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','apply','update','then','destroy','get','ChanSpies','UserProfileResource','name','send','index','map','rawAttributes','type','key','model','query','keys','intersection','attributes','fields','length'];(function(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0xbbfa,0x1e9));var _0xabbf=function(_0x467ef6,_0x932cef){_0x467ef6=_0x467ef6-0x0;var _0x3e4aa2=_0xbbfa[_0x467ef6];return _0x3e4aa2;};'use strict';var emlformat=require(_0xabbf('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xabbf('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xabbf('0x2'));var moment=require(_0xabbf('0x3'));var BPromise=require(_0xabbf('0x4'));var Mustache=require(_0xabbf('0x5'));var util=require(_0xabbf('0x6'));var path=require(_0xabbf('0x7'));var sox=require(_0xabbf('0x8'));var csv=require(_0xabbf('0x9'));var ejs=require(_0xabbf('0xa'));var fs=require('fs');var fs_extra=require(_0xabbf('0xb'));var _=require(_0xabbf('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xabbf('0xd'));var toCsv=require(_0xabbf('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xabbf('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xabbf('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xabbf('0x10'));var logger=require('../../config/logger')('api');var utils=require(_0xabbf('0x11'));var config=require(_0xabbf('0x12'));var licenseUtil=require(_0xabbf('0x13'));var db=require(_0xabbf('0x14'))['db'];function respondWithStatusCode(_0x265487,_0x1cc1a0){_0x1cc1a0=_0x1cc1a0||0xcc;return function(_0x28fb83){if(_0x28fb83){return _0x265487[_0xabbf('0x15')](_0x1cc1a0);}return _0x265487[_0xabbf('0x16')](_0x1cc1a0)['end']();};}function respondWithResult(_0x3c85e8,_0x5e6866){_0x5e6866=_0x5e6866||0xc8;return function(_0x3c6e6d){if(_0x3c6e6d){return _0x3c85e8['status'](_0x5e6866)[_0xabbf('0x17')](_0x3c6e6d);}};}function respondWithFilteredResult(_0x23a44a,_0x1df763){return function(_0x13b970){if(_0x13b970){var _0x529af0=typeof _0x1df763[_0xabbf('0x18')]===_0xabbf('0x19')&&typeof _0x1df763[_0xabbf('0x1a')]===_0xabbf('0x19');var _0xbfddcf=_0x13b970['count'];var _0x4252e1=_0x529af0?0x0:_0x1df763[_0xabbf('0x18')];var _0x57002d=_0x529af0?_0x13b970[_0xabbf('0x1b')]:_0x1df763[_0xabbf('0x18')]+_0x1df763['limit'];var _0x1269d9;if(_0x57002d>=_0xbfddcf){_0x57002d=_0xbfddcf;_0x1269d9=0xc8;}else{_0x1269d9=0xce;}_0x23a44a[_0xabbf('0x16')](_0x1269d9);return _0x23a44a[_0xabbf('0x1c')]('Content-Range',_0x4252e1+'-'+_0x57002d+'/'+_0xbfddcf)['json'](_0x13b970);}return null;};}function patchUpdates(_0xdf7640){return function(_0x4d4efb){try{jsonpatch[_0xabbf('0x1d')](_0x4d4efb,_0xdf7640,!![]);}catch(_0x918fc8){return BPromise['reject'](_0x918fc8);}return _0x4d4efb['save']();};}function saveUpdates(_0x44248b,_0x45cf44){return function(_0x2eaa02){if(_0x2eaa02){return _0x2eaa02[_0xabbf('0x1e')](_0x44248b)[_0xabbf('0x1f')](function(_0x35313f){return _0x35313f;});}return null;};}function removeEntity(_0x17d684,_0x573d83){return function(_0x281b36){if(_0x281b36){return _0x281b36[_0xabbf('0x20')]()[_0xabbf('0x1f')](function(){var _0x5b9380=_0x281b36[_0xabbf('0x21')]({'plain':!![]});var _0x26ebc6=_0xabbf('0x22');return db[_0xabbf('0x23')][_0xabbf('0x20')]({'where':{'type':_0x26ebc6,'resourceId':_0x5b9380['id']}})['then'](function(){return _0x281b36;});})[_0xabbf('0x1f')](function(){_0x17d684['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x20e61d,_0x649d52){return function(_0x51d38d){if(!_0x51d38d){_0x20e61d[_0xabbf('0x15')](0x194);}return _0x51d38d;};}function handleError(_0xa39ccd,_0x527838){_0x527838=_0x527838||0x1f4;return function(_0x4f8ed7){logger['error'](_0x4f8ed7['stack']);if(_0x4f8ed7[_0xabbf('0x24')]){delete _0x4f8ed7[_0xabbf('0x24')];}_0xa39ccd[_0xabbf('0x16')](_0x527838)[_0xabbf('0x25')](_0x4f8ed7);};}exports[_0xabbf('0x26')]=function(_0xeae198,_0x1ed1fd){var _0x3d8ffc={},_0x40c3bf={},_0x3d8b20={'count':0x0,'rows':[]};var _0x50fd8d=_[_0xabbf('0x27')](db['VoiceChanSpy'][_0xabbf('0x28')],function(_0x18b390){return{'name':_0x18b390['fieldName'],'type':_0x18b390[_0xabbf('0x29')][_0xabbf('0x2a')]};});_0x40c3bf[_0xabbf('0x2b')]=_[_0xabbf('0x27')](_0x50fd8d,_0xabbf('0x24'));_0x40c3bf[_0xabbf('0x2c')]=_[_0xabbf('0x2d')](_0xeae198['query']);_0x40c3bf['filters']=_[_0xabbf('0x2e')](_0x40c3bf['model'],_0x40c3bf[_0xabbf('0x2c')]);_0x3d8ffc[_0xabbf('0x2f')]=_[_0xabbf('0x2e')](_0x40c3bf[_0xabbf('0x2b')],qs[_0xabbf('0x30')](_0xeae198[_0xabbf('0x2c')][_0xabbf('0x30')]));_0x3d8ffc['attributes']=_0x3d8ffc[_0xabbf('0x2f')][_0xabbf('0x31')]?_0x3d8ffc[_0xabbf('0x2f')]:_0x40c3bf['model'];if(!_0xeae198[_0xabbf('0x2c')][_0xabbf('0x32')](_0xabbf('0x33'))){_0x3d8ffc[_0xabbf('0x1a')]=qs[_0xabbf('0x1a')](_0xeae198[_0xabbf('0x2c')][_0xabbf('0x1a')]);_0x3d8ffc[_0xabbf('0x18')]=qs[_0xabbf('0x18')](_0xeae198['query'][_0xabbf('0x18')]);}_0x3d8ffc[_0xabbf('0x34')]=qs[_0xabbf('0x35')](_0xeae198[_0xabbf('0x2c')][_0xabbf('0x35')]);_0x3d8ffc['where']=qs[_0xabbf('0x36')](_[_0xabbf('0x37')](_0xeae198[_0xabbf('0x2c')],_0x40c3bf[_0xabbf('0x36')]),_0x50fd8d);if(_0xeae198[_0xabbf('0x2c')]['filter']){_0x3d8ffc['where']=_[_0xabbf('0x38')](_0x3d8ffc['where'],{'$or':_[_0xabbf('0x27')](_0x50fd8d,function(_0x3fc1f6){if(_0x3fc1f6['type']!==_0xabbf('0x39')){var _0xb05c7e={};_0xb05c7e[_0x3fc1f6[_0xabbf('0x24')]]={'$like':'%'+_0xeae198['query'][_0xabbf('0x3a')]+'%'};return _0xb05c7e;}})});}_0x3d8ffc=_['merge']({},_0x3d8ffc,_0xeae198[_0xabbf('0x3b')]);var _0x11de8b={'where':_0x3d8ffc['where']};return db[_0xabbf('0x3c')][_0xabbf('0x1b')](_0x11de8b)[_0xabbf('0x1f')](function(_0x22cb8d){_0x3d8b20[_0xabbf('0x1b')]=_0x22cb8d;if(_0xeae198[_0xabbf('0x2c')][_0xabbf('0x3d')]){_0x3d8ffc[_0xabbf('0x3e')]=[{'all':!![]}];}return db[_0xabbf('0x3c')]['findAll'](_0x3d8ffc);})[_0xabbf('0x1f')](function(_0x547672){_0x3d8b20['rows']=_0x547672;return _0x3d8b20;})[_0xabbf('0x1f')](respondWithFilteredResult(_0x1ed1fd,_0x3d8ffc))[_0xabbf('0x3f')](handleError(_0x1ed1fd,null));};exports[_0xabbf('0x40')]=function(_0x109817,_0x291f7e){var _0x3450e8={'raw':![],'where':{'id':_0x109817[_0xabbf('0x41')]['id']}},_0xec2a82={};_0xec2a82[_0xabbf('0x2b')]=_[_0xabbf('0x2d')](db[_0xabbf('0x3c')][_0xabbf('0x28')]);_0xec2a82[_0xabbf('0x2c')]=_['keys'](_0x109817[_0xabbf('0x2c')]);_0xec2a82[_0xabbf('0x36')]=_['intersection'](_0xec2a82[_0xabbf('0x2b')],_0xec2a82[_0xabbf('0x2c')]);_0x3450e8[_0xabbf('0x2f')]=_[_0xabbf('0x2e')](_0xec2a82[_0xabbf('0x2b')],qs[_0xabbf('0x30')](_0x109817[_0xabbf('0x2c')][_0xabbf('0x30')]));_0x3450e8[_0xabbf('0x2f')]=_0x3450e8[_0xabbf('0x2f')][_0xabbf('0x31')]?_0x3450e8[_0xabbf('0x2f')]:_0xec2a82[_0xabbf('0x2b')];if(_0x109817[_0xabbf('0x2c')][_0xabbf('0x3d')]){_0x3450e8[_0xabbf('0x3e')]=[{'all':!![]}];}_0x3450e8=_[_0xabbf('0x38')]({},_0x3450e8,_0x109817[_0xabbf('0x3b')]);return db[_0xabbf('0x3c')][_0xabbf('0x42')](_0x3450e8)['then'](handleEntityNotFound(_0x291f7e,null))[_0xabbf('0x1f')](respondWithResult(_0x291f7e,null))[_0xabbf('0x3f')](handleError(_0x291f7e,null));};exports[_0xabbf('0x43')]=function(_0x370f66,_0x60d9d6){return db['VoiceChanSpy'][_0xabbf('0x43')](_0x370f66[_0xabbf('0x44')],{})['then'](function(_0x2b4cf5){var _0x1c156d=_0x370f66[_0xabbf('0x45')][_0xabbf('0x21')]({'plain':!![]});if(!_0x1c156d)throw new Error(_0xabbf('0x46'));if(_0x1c156d[_0xabbf('0x47')]===_0xabbf('0x45')){var _0x4fa51f=_0x2b4cf5[_0xabbf('0x21')]({'plain':!![]});var _0x41dc9d='ChanSpies';return db[_0xabbf('0x48')][_0xabbf('0x42')]({'where':{'name':_0x41dc9d,'userProfileId':_0x1c156d[_0xabbf('0x49')]},'raw':!![]})[_0xabbf('0x1f')](function(_0x29c051){if(_0x29c051&&_0x29c051[_0xabbf('0x4a')]===0x0){return db[_0xabbf('0x23')][_0xabbf('0x43')]({'name':_0x4fa51f[_0xabbf('0x24')],'resourceId':_0x4fa51f['id'],'type':_0x29c051[_0xabbf('0x24')],'sectionId':_0x29c051['id']},{})['then'](function(){return _0x2b4cf5;});}else{return _0x2b4cf5;}})[_0xabbf('0x3f')](function(_0x4fcc5b){logger[_0xabbf('0x4b')](_0xabbf('0x4c'),_0x4fcc5b);throw _0x4fcc5b;});}return _0x2b4cf5;})[_0xabbf('0x1f')](respondWithResult(_0x60d9d6,0xc9))[_0xabbf('0x3f')](handleError(_0x60d9d6,null));};exports[_0xabbf('0x1e')]=function(_0x216972,_0x18324f){if(_0x216972[_0xabbf('0x44')]['id']){delete _0x216972[_0xabbf('0x44')]['id'];}return db[_0xabbf('0x3c')][_0xabbf('0x42')]({'where':{'id':_0x216972[_0xabbf('0x41')]['id']}})['then'](handleEntityNotFound(_0x18324f,null))['then'](saveUpdates(_0x216972['body'],null))[_0xabbf('0x1f')](respondWithResult(_0x18324f,null))[_0xabbf('0x3f')](handleError(_0x18324f,null));};exports[_0xabbf('0x20')]=function(_0x5cf6ff,_0x278a01){return db[_0xabbf('0x3c')][_0xabbf('0x42')]({'where':{'id':_0x5cf6ff['params']['id']}})['then'](handleEntityNotFound(_0x278a01,null))[_0xabbf('0x1f')](removeEntity(_0x278a01,null))[_0xabbf('0x3f')](handleError(_0x278a01,null));}; \ No newline at end of file +var _0xb910=['stack','send','index','map','VoiceChanSpy','rawAttributes','type','key','model','name','query','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','filter','where','VIRTUAL','merge','include','findAll','rows','catch','show','params','keys','includeAll','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','destroy','then','get','ChanSpies','UserProfileResource','error'];(function(_0xad2f33,_0x5144c8){var _0x1c3078=function(_0x3ecfa4){while(--_0x3ecfa4){_0xad2f33['push'](_0xad2f33['shift']());}};_0x1c3078(++_0x5144c8);}(_0xb910,0x12b));var _0x0b91=function(_0x3305de,_0x16582f){_0x3305de=_0x3305de-0x0;var _0x3b5a84=_0xb910[_0x3305de];return _0x3b5a84;};'use strict';var emlformat=require(_0x0b91('0x0'));var rimraf=require(_0x0b91('0x1'));var zipdir=require(_0x0b91('0x2'));var jsonpatch=require(_0x0b91('0x3'));var rp=require(_0x0b91('0x4'));var moment=require(_0x0b91('0x5'));var BPromise=require(_0x0b91('0x6'));var Mustache=require(_0x0b91('0x7'));var util=require(_0x0b91('0x8'));var path=require(_0x0b91('0x9'));var sox=require(_0x0b91('0xa'));var csv=require(_0x0b91('0xb'));var ejs=require(_0x0b91('0xc'));var fs=require('fs');var fs_extra=require(_0x0b91('0xd'));var _=require('lodash');var squel=require(_0x0b91('0xe'));var crypto=require(_0x0b91('0xf'));var jsforce=require(_0x0b91('0x10'));var deskjs=require(_0x0b91('0x11'));var toCsv=require(_0x0b91('0xb'));var querystring=require(_0x0b91('0x12'));var Papa=require(_0x0b91('0x13'));var Redis=require(_0x0b91('0x14'));var authService=require(_0x0b91('0x15'));var qs=require('../../components/parsers/qs');var as=require(_0x0b91('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0b91('0x17'))('api');var utils=require('../../config/utils');var config=require(_0x0b91('0x18'));var licenseUtil=require(_0x0b91('0x19'));var db=require(_0x0b91('0x1a'))['db'];function respondWithStatusCode(_0x320409,_0x5b6f36){_0x5b6f36=_0x5b6f36||0xcc;return function(_0x2e8430){if(_0x2e8430){return _0x320409[_0x0b91('0x1b')](_0x5b6f36);}return _0x320409[_0x0b91('0x1c')](_0x5b6f36)[_0x0b91('0x1d')]();};}function respondWithResult(_0x590128,_0x5e1ac4){_0x5e1ac4=_0x5e1ac4||0xc8;return function(_0x3b8a94){if(_0x3b8a94){return _0x590128[_0x0b91('0x1c')](_0x5e1ac4)[_0x0b91('0x1e')](_0x3b8a94);}};}function respondWithFilteredResult(_0x88daae,_0x46c0f2){return function(_0x4ac8f5){if(_0x4ac8f5){var _0x83ffe1=typeof _0x46c0f2[_0x0b91('0x1f')]===_0x0b91('0x20')&&typeof _0x46c0f2[_0x0b91('0x21')]===_0x0b91('0x20');var _0xf2d1a9=_0x4ac8f5[_0x0b91('0x22')];var _0x12239b=_0x83ffe1?0x0:_0x46c0f2[_0x0b91('0x1f')];var _0x201797=_0x83ffe1?_0x4ac8f5[_0x0b91('0x22')]:_0x46c0f2[_0x0b91('0x1f')]+_0x46c0f2['limit'];var _0x2df818;if(_0x201797>=_0xf2d1a9){_0x201797=_0xf2d1a9;_0x2df818=0xc8;}else{_0x2df818=0xce;}_0x88daae['status'](_0x2df818);return _0x88daae['set'](_0x0b91('0x23'),_0x12239b+'-'+_0x201797+'/'+_0xf2d1a9)[_0x0b91('0x1e')](_0x4ac8f5);}return null;};}function patchUpdates(_0x1dd913){return function(_0x251e0f){try{jsonpatch[_0x0b91('0x24')](_0x251e0f,_0x1dd913,!![]);}catch(_0x5369c0){return BPromise[_0x0b91('0x25')](_0x5369c0);}return _0x251e0f[_0x0b91('0x26')]();};}function saveUpdates(_0xf01735,_0x51f5fd){return function(_0x540102){if(_0x540102){return _0x540102['update'](_0xf01735)['then'](function(_0x765d64){return _0x765d64;});}return null;};}function removeEntity(_0x434b9f,_0x7ab137){return function(_0x24b98f){if(_0x24b98f){return _0x24b98f[_0x0b91('0x27')]()[_0x0b91('0x28')](function(){var _0x119748=_0x24b98f[_0x0b91('0x29')]({'plain':!![]});var _0x231327=_0x0b91('0x2a');return db[_0x0b91('0x2b')][_0x0b91('0x27')]({'where':{'type':_0x231327,'resourceId':_0x119748['id']}})['then'](function(){return _0x24b98f;});})[_0x0b91('0x28')](function(){_0x434b9f['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1ea590,_0x5b6811){return function(_0x120ae2){if(!_0x120ae2){_0x1ea590['sendStatus'](0x194);}return _0x120ae2;};}function handleError(_0xb8cebf,_0x15755c){_0x15755c=_0x15755c||0x1f4;return function(_0x55d174){logger[_0x0b91('0x2c')](_0x55d174[_0x0b91('0x2d')]);if(_0x55d174['name']){delete _0x55d174['name'];}_0xb8cebf['status'](_0x15755c)[_0x0b91('0x2e')](_0x55d174);};}exports[_0x0b91('0x2f')]=function(_0x33ba12,_0xddf36){var _0x70649f={},_0x3facb={},_0x1c248f={'count':0x0,'rows':[]};var _0x1248d1=_[_0x0b91('0x30')](db[_0x0b91('0x31')][_0x0b91('0x32')],function(_0x4eca88){return{'name':_0x4eca88['fieldName'],'type':_0x4eca88[_0x0b91('0x33')][_0x0b91('0x34')]};});_0x3facb[_0x0b91('0x35')]=_[_0x0b91('0x30')](_0x1248d1,_0x0b91('0x36'));_0x3facb[_0x0b91('0x37')]=_['keys'](_0x33ba12[_0x0b91('0x37')]);_0x3facb[_0x0b91('0x38')]=_['intersection'](_0x3facb['model'],_0x3facb[_0x0b91('0x37')]);_0x70649f[_0x0b91('0x39')]=_[_0x0b91('0x3a')](_0x3facb[_0x0b91('0x35')],qs[_0x0b91('0x3b')](_0x33ba12['query']['fields']));_0x70649f[_0x0b91('0x39')]=_0x70649f[_0x0b91('0x39')][_0x0b91('0x3c')]?_0x70649f[_0x0b91('0x39')]:_0x3facb[_0x0b91('0x35')];if(!_0x33ba12['query'][_0x0b91('0x3d')]('nolimit')){_0x70649f[_0x0b91('0x21')]=qs['limit'](_0x33ba12['query']['limit']);_0x70649f[_0x0b91('0x1f')]=qs[_0x0b91('0x1f')](_0x33ba12[_0x0b91('0x37')]['offset']);}_0x70649f[_0x0b91('0x3e')]=qs[_0x0b91('0x3f')](_0x33ba12[_0x0b91('0x37')][_0x0b91('0x3f')]);_0x70649f['where']=qs[_0x0b91('0x38')](_['pick'](_0x33ba12[_0x0b91('0x37')],_0x3facb[_0x0b91('0x38')]),_0x1248d1);if(_0x33ba12[_0x0b91('0x37')][_0x0b91('0x40')]){_0x70649f[_0x0b91('0x41')]=_['merge'](_0x70649f[_0x0b91('0x41')],{'$or':_[_0x0b91('0x30')](_0x1248d1,function(_0x5a7277){if(_0x5a7277['type']!==_0x0b91('0x42')){var _0x34b872={};_0x34b872[_0x5a7277['name']]={'$like':'%'+_0x33ba12[_0x0b91('0x37')][_0x0b91('0x40')]+'%'};return _0x34b872;}})});}_0x70649f=_[_0x0b91('0x43')]({},_0x70649f,_0x33ba12['options']);var _0x4c4503={'where':_0x70649f[_0x0b91('0x41')]};return db[_0x0b91('0x31')][_0x0b91('0x22')](_0x4c4503)[_0x0b91('0x28')](function(_0x43b8ee){_0x1c248f[_0x0b91('0x22')]=_0x43b8ee;if(_0x33ba12[_0x0b91('0x37')]['includeAll']){_0x70649f[_0x0b91('0x44')]=[{'all':!![]}];}return db[_0x0b91('0x31')][_0x0b91('0x45')](_0x70649f);})[_0x0b91('0x28')](function(_0x523a1a){_0x1c248f[_0x0b91('0x46')]=_0x523a1a;return _0x1c248f;})[_0x0b91('0x28')](respondWithFilteredResult(_0xddf36,_0x70649f))[_0x0b91('0x47')](handleError(_0xddf36,null));};exports[_0x0b91('0x48')]=function(_0x473972,_0x1f7a29){var _0x59b6d5={'raw':![],'where':{'id':_0x473972[_0x0b91('0x49')]['id']}},_0x35be67={};_0x35be67[_0x0b91('0x35')]=_[_0x0b91('0x4a')](db['VoiceChanSpy'][_0x0b91('0x32')]);_0x35be67[_0x0b91('0x37')]=_['keys'](_0x473972[_0x0b91('0x37')]);_0x35be67[_0x0b91('0x38')]=_[_0x0b91('0x3a')](_0x35be67['model'],_0x35be67[_0x0b91('0x37')]);_0x59b6d5[_0x0b91('0x39')]=_[_0x0b91('0x3a')](_0x35be67[_0x0b91('0x35')],qs[_0x0b91('0x3b')](_0x473972[_0x0b91('0x37')][_0x0b91('0x3b')]));_0x59b6d5[_0x0b91('0x39')]=_0x59b6d5[_0x0b91('0x39')][_0x0b91('0x3c')]?_0x59b6d5[_0x0b91('0x39')]:_0x35be67[_0x0b91('0x35')];if(_0x473972[_0x0b91('0x37')][_0x0b91('0x4b')]){_0x59b6d5[_0x0b91('0x44')]=[{'all':!![]}];}_0x59b6d5=_['merge']({},_0x59b6d5,_0x473972[_0x0b91('0x4c')]);return db[_0x0b91('0x31')][_0x0b91('0x4d')](_0x59b6d5)[_0x0b91('0x28')](handleEntityNotFound(_0x1f7a29,null))[_0x0b91('0x28')](respondWithResult(_0x1f7a29,null))[_0x0b91('0x47')](handleError(_0x1f7a29,null));};exports[_0x0b91('0x4e')]=function(_0x90294b,_0x7522ae){return db[_0x0b91('0x31')][_0x0b91('0x4e')](_0x90294b[_0x0b91('0x4f')],{})[_0x0b91('0x28')](function(_0x4b20eb){var _0x547fdc=_0x90294b[_0x0b91('0x50')][_0x0b91('0x29')]({'plain':!![]});if(!_0x547fdc)throw new Error(_0x0b91('0x51'));if(_0x547fdc['role']==='user'){var _0x1a367b=_0x4b20eb[_0x0b91('0x29')]({'plain':!![]});var _0x448668=_0x0b91('0x2a');return db[_0x0b91('0x52')][_0x0b91('0x4d')]({'where':{'name':_0x448668,'userProfileId':_0x547fdc[_0x0b91('0x53')]},'raw':!![]})['then'](function(_0x384266){if(_0x384266&&_0x384266[_0x0b91('0x54')]===0x0){return db[_0x0b91('0x2b')][_0x0b91('0x4e')]({'name':_0x1a367b['name'],'resourceId':_0x1a367b['id'],'type':_0x384266[_0x0b91('0x36')],'sectionId':_0x384266['id']},{})[_0x0b91('0x28')](function(){return _0x4b20eb;});}else{return _0x4b20eb;}})['catch'](function(_0x9a71a6){logger[_0x0b91('0x2c')](_0x0b91('0x55'),_0x9a71a6);throw _0x9a71a6;});}return _0x4b20eb;})[_0x0b91('0x28')](respondWithResult(_0x7522ae,0xc9))['catch'](handleError(_0x7522ae,null));};exports['update']=function(_0x2579f6,_0x45febd){if(_0x2579f6[_0x0b91('0x4f')]['id']){delete _0x2579f6[_0x0b91('0x4f')]['id'];}return db[_0x0b91('0x31')][_0x0b91('0x4d')]({'where':{'id':_0x2579f6['params']['id']}})[_0x0b91('0x28')](handleEntityNotFound(_0x45febd,null))[_0x0b91('0x28')](saveUpdates(_0x2579f6[_0x0b91('0x4f')],null))[_0x0b91('0x28')](respondWithResult(_0x45febd,null))[_0x0b91('0x47')](handleError(_0x45febd,null));};exports[_0x0b91('0x27')]=function(_0x40dee6,_0x5117bc){return db[_0x0b91('0x31')][_0x0b91('0x4d')]({'where':{'id':_0x40dee6[_0x0b91('0x49')]['id']}})[_0x0b91('0x28')](handleEntityNotFound(_0x5117bc,null))['then'](removeEntity(_0x5117bc,null))[_0x0b91('0x47')](handleError(_0x5117bc,null));}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.model.js b/server/api/voiceChanSpy/voiceChanSpy.model.js index cfefeac..877aa4a 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 _0x1208=['join','StopMixMonitor','length','concat','internal','User','agent','then','catch','exports','define','VoiceChanSpy','VoiceExtension','bulkCreate','destroy','lodash','util','bluebird','from-sip','format','%s%s','prefix','push','merge','Set','CDR(type)=%s','chanspy','record','MixMonitor','${UNIQUEID}.%s,a','recordingFormat','auth','Authenticate','password','ChanSpy','name','options'];(function(_0x18baf4,_0x33086b){var _0x278ed1=function(_0x3ea0a2){while(--_0x3ea0a2){_0x18baf4['push'](_0x18baf4['shift']());}};_0x278ed1(++_0x33086b);}(_0x1208,0x7e));var _0x8120=function(_0x3d0690,_0x738bea){_0x3d0690=_0x3d0690-0x0;var _0x243256=_0x1208[_0x3d0690];return _0x243256;};'use strict';var _=require(_0x8120('0x0'));var util=require(_0x8120('0x1'));var BPromise=require(_0x8120('0x2'));var attributes=require('./voiceChanSpy.attributes');var getUserApplications=function(_0x467e16,_0xfc2086,_0x4430f6){var _0x149adf=0x1;var _0x2085f7=[];var _0x1101ae={'context':_0xfc2086['context']||_0x8120('0x3'),'exten':util[_0x8120('0x4')](_0x8120('0x5'),_0x467e16[_0x8120('0x6')],_0x4430f6),'type':'system','isApp':![],'ChanSpyId':_0x467e16['id'],'UserId':_0xfc2086['id']};_0x2085f7[_0x8120('0x7')](_[_0x8120('0x8')]({'app':_0x8120('0x9'),'appdata':util[_0x8120('0x4')](_0x8120('0xa'),_0x8120('0xb')),'priority':_0x149adf++},_0x1101ae));if(_0x467e16[_0x8120('0xc')]){_0x2085f7['push'](_[_0x8120('0x8')]({'app':_0x8120('0xd'),'appdata':util[_0x8120('0x4')](_0x8120('0xe'),_0x467e16[_0x8120('0xf')]),'priority':_0x149adf++},_0x1101ae));}if(_0x467e16[_0x8120('0x10')]){_0x2085f7[_0x8120('0x7')](_[_0x8120('0x8')]({'app':_0x8120('0x11'),'appdata':_0x467e16[_0x8120('0x12')],'priority':_0x149adf++},_0x1101ae));}_0x2085f7[_0x8120('0x7')](_['merge']({'app':_0x8120('0x13'),'appdata':util[_0x8120('0x4')]('SIP/%s,%s',_0xfc2086[_0x8120('0x14')],_0x467e16[_0x8120('0x15')]?_0x467e16[_0x8120('0x15')][_0x8120('0x16')](''):''),'priority':_0x149adf++},_0x1101ae));if(_0x467e16[_0x8120('0xc')]){_0x2085f7[_0x8120('0x7')](_[_0x8120('0x8')]({'app':_0x8120('0x17'),'priority':_0x149adf++},_0x1101ae));}return _0x2085f7;};var getChanSpyApplications=function(_0x5d87f0,_0x344fbb){var _0x200e07=[];for(var _0x148f01=0x0,_0x47b92b=0x1;_0x148f01<_0x344fbb[_0x8120('0x18')];_0x148f01++,_0x47b92b=0x1){_0x200e07=_0x200e07[_0x8120('0x19')](getUserApplications(_0x5d87f0,_0x344fbb[_0x148f01],_0x344fbb[_0x148f01]['internal']));if(_0x344fbb[_0x148f01][_0x8120('0x1a')]!=_0x344fbb[_0x148f01][_0x8120('0x14')]){_0x200e07=_0x200e07[_0x8120('0x19')](getUserApplications(_0x5d87f0,_0x344fbb[_0x148f01],_0x344fbb[_0x148f01][_0x8120('0x14')]));}}return _0x200e07;};var getChanSpyPromise=function(_0x2fa299,_0x453373){return new BPromise(function(_0x40ac8c,_0x3c1a24){return _0x2fa299[_0x8120('0x1b')]['findAll']({'attributes':['id',_0x8120('0x14'),_0x8120('0x1a')],'where':{'role':_0x8120('0x1c'),'chanspy':!![]},'raw':!![]})[_0x8120('0x1d')](function(_0x1aea68){if(_0x1aea68){return _0x40ac8c(getChanSpyApplications(_0x453373,_0x1aea68));}return _0x40ac8c([]);})[_0x8120('0x1e')](function(_0x4c9f2a){_0x3c1a24(_0x4c9f2a);});});};module[_0x8120('0x1f')]=function(_0x382829,_0xd71cb9){var _0x2677a0=_0x382829['models'];return _0x382829[_0x8120('0x20')](_0x8120('0x21'),attributes,{'tableName':'voice_chanspy','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x3f87b2,_0x92de8a,_0xd028ce){return getChanSpyPromise(_0x2677a0,_0x3f87b2)[_0x8120('0x1d')](function(_0x5abd85){if(_0x5abd85&&_0x5abd85[_0x8120('0x18')]){return _0x2677a0[_0x8120('0x22')][_0x8120('0x23')](_0x5abd85);}})[_0x8120('0x1d')](function(){_0xd028ce();})[_0x8120('0x1e')](function(_0x1e89d8){_0xd028ce(_0x1e89d8);});},'afterUpdate':function(_0x2f01cb,_0x581200,_0x1e4a5f){return _0x2677a0[_0x8120('0x22')][_0x8120('0x24')]({'where':{'ChanSpyId':_0x2f01cb['id']}})[_0x8120('0x1d')](function(){return getChanSpyPromise(_0x2677a0,_0x2f01cb);})['then'](function(_0x43d657){if(_0x43d657&&_0x43d657[_0x8120('0x18')]){return _0x2677a0[_0x8120('0x22')][_0x8120('0x23')](_0x43d657);}})['then'](function(){_0x1e4a5f();})[_0x8120('0x1e')](function(_0x390bd2){_0x1e4a5f(_0x390bd2);});},'afterDestroy':function(_0x2e154d,_0x56c290,_0x2abe79){return _0x2677a0[_0x8120('0x22')]['destroy']({'where':{'ChanSpyId':_0x2e154d['id']}})[_0x8120('0x1d')](function(){_0x2abe79();})['catch'](function(_0x2b2932){_0x2abe79(_0x2b2932);});}}});}; \ No newline at end of file +var _0xceb7=['context','from-sip','format','%s%s','system','push','merge','Set','CDR(type)=%s','chanspy','record','MixMonitor','${UNIQUEID}.%s,a','recordingFormat','password','ChanSpy','SIP/%s,%s','name','options','StopMixMonitor','length','concat','internal','agent','then','catch','exports','models','VoiceChanSpy','voice_chanspy','VoiceExtension','bulkCreate','destroy','lodash','util','bluebird','./voiceChanSpy.attributes'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xceb7,0x193));var _0x7ceb=function(_0x290b07,_0x176d8e){_0x290b07=_0x290b07-0x0;var _0x4e4fa6=_0xceb7[_0x290b07];return _0x4e4fa6;};'use strict';var _=require(_0x7ceb('0x0'));var util=require(_0x7ceb('0x1'));var BPromise=require(_0x7ceb('0x2'));var attributes=require(_0x7ceb('0x3'));var getUserApplications=function(_0x48dc0a,_0x34f59c,_0x5bdaa7){var _0x44a37a=0x1;var _0x3b9f6e=[];var _0x4cd75c={'context':_0x34f59c[_0x7ceb('0x4')]||_0x7ceb('0x5'),'exten':util[_0x7ceb('0x6')](_0x7ceb('0x7'),_0x48dc0a['prefix'],_0x5bdaa7),'type':_0x7ceb('0x8'),'isApp':![],'ChanSpyId':_0x48dc0a['id'],'UserId':_0x34f59c['id']};_0x3b9f6e[_0x7ceb('0x9')](_[_0x7ceb('0xa')]({'app':_0x7ceb('0xb'),'appdata':util[_0x7ceb('0x6')](_0x7ceb('0xc'),_0x7ceb('0xd')),'priority':_0x44a37a++},_0x4cd75c));if(_0x48dc0a[_0x7ceb('0xe')]){_0x3b9f6e['push'](_['merge']({'app':_0x7ceb('0xf'),'appdata':util[_0x7ceb('0x6')](_0x7ceb('0x10'),_0x48dc0a[_0x7ceb('0x11')]),'priority':_0x44a37a++},_0x4cd75c));}if(_0x48dc0a['auth']){_0x3b9f6e[_0x7ceb('0x9')](_[_0x7ceb('0xa')]({'app':'Authenticate','appdata':_0x48dc0a[_0x7ceb('0x12')],'priority':_0x44a37a++},_0x4cd75c));}_0x3b9f6e[_0x7ceb('0x9')](_['merge']({'app':_0x7ceb('0x13'),'appdata':util[_0x7ceb('0x6')](_0x7ceb('0x14'),_0x34f59c[_0x7ceb('0x15')],_0x48dc0a['options']?_0x48dc0a[_0x7ceb('0x16')]['join'](''):''),'priority':_0x44a37a++},_0x4cd75c));if(_0x48dc0a[_0x7ceb('0xe')]){_0x3b9f6e['push'](_[_0x7ceb('0xa')]({'app':_0x7ceb('0x17'),'priority':_0x44a37a++},_0x4cd75c));}return _0x3b9f6e;};var getChanSpyApplications=function(_0x4d3190,_0x29406f){var _0x4736d4=[];for(var _0x225d98=0x0,_0xb2f387=0x1;_0x225d98<_0x29406f[_0x7ceb('0x18')];_0x225d98++,_0xb2f387=0x1){_0x4736d4=_0x4736d4[_0x7ceb('0x19')](getUserApplications(_0x4d3190,_0x29406f[_0x225d98],_0x29406f[_0x225d98][_0x7ceb('0x1a')]));if(_0x29406f[_0x225d98]['internal']!=_0x29406f[_0x225d98][_0x7ceb('0x15')]){_0x4736d4=_0x4736d4[_0x7ceb('0x19')](getUserApplications(_0x4d3190,_0x29406f[_0x225d98],_0x29406f[_0x225d98][_0x7ceb('0x15')]));}}return _0x4736d4;};var getChanSpyPromise=function(_0x42b00d,_0x2546a0){return new BPromise(function(_0x11f40f,_0x46a52c){return _0x42b00d['User']['findAll']({'attributes':['id',_0x7ceb('0x15'),_0x7ceb('0x1a')],'where':{'role':_0x7ceb('0x1b'),'chanspy':!![]},'raw':!![]})[_0x7ceb('0x1c')](function(_0x3275e8){if(_0x3275e8){return _0x11f40f(getChanSpyApplications(_0x2546a0,_0x3275e8));}return _0x11f40f([]);})[_0x7ceb('0x1d')](function(_0xa7449e){_0x46a52c(_0xa7449e);});});};module[_0x7ceb('0x1e')]=function(_0x2d8029,_0x523994){var _0x4697cf=_0x2d8029[_0x7ceb('0x1f')];return _0x2d8029['define'](_0x7ceb('0x20'),attributes,{'tableName':_0x7ceb('0x21'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x36048b,_0x4acd90,_0x3f2d30){return getChanSpyPromise(_0x4697cf,_0x36048b)[_0x7ceb('0x1c')](function(_0x31b04d){if(_0x31b04d&&_0x31b04d['length']){return _0x4697cf[_0x7ceb('0x22')][_0x7ceb('0x23')](_0x31b04d);}})['then'](function(){_0x3f2d30();})[_0x7ceb('0x1d')](function(_0x38ead0){_0x3f2d30(_0x38ead0);});},'afterUpdate':function(_0x4a5e18,_0x418178,_0x525a3d){return _0x4697cf[_0x7ceb('0x22')][_0x7ceb('0x24')]({'where':{'ChanSpyId':_0x4a5e18['id']}})[_0x7ceb('0x1c')](function(){return getChanSpyPromise(_0x4697cf,_0x4a5e18);})['then'](function(_0xcf59dd){if(_0xcf59dd&&_0xcf59dd[_0x7ceb('0x18')]){return _0x4697cf[_0x7ceb('0x22')][_0x7ceb('0x23')](_0xcf59dd);}})[_0x7ceb('0x1c')](function(){_0x525a3d();})[_0x7ceb('0x1d')](function(_0x26e30f){_0x525a3d(_0x26e30f);});},'afterDestroy':function(_0x26bab0,_0x2add4f,_0x44127b){return _0x4697cf[_0x7ceb('0x22')]['destroy']({'where':{'ChanSpyId':_0x26bab0['id']}})['then'](function(){_0x44127b();})[_0x7ceb('0x1d')](function(_0x4dc53f){_0x44127b(_0x4dc53f);});}}});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.rpc.js b/server/api/voiceChanSpy/voiceChanSpy.rpc.js index 5905736..31ec4a7 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 _0xaa88=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','then','info','request\x20sent','debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s','error','VoiceChanSpy,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird'];(function(_0x345695,_0x2ba140){var _0x5002d3=function(_0x1f6cbb){while(--_0x1f6cbb){_0x345695['push'](_0x345695['shift']());}};_0x5002d3(++_0x2ba140);}(_0xaa88,0x137));var _0x8aa8=function(_0x59e862,_0x477bf2){_0x59e862=_0x59e862-0x0;var _0x1a25ee=_0xaa88[_0x59e862];return _0x1a25ee;};'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')]('VoiceChanSpy,\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')]('VoiceChanSpy,\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')]('VoiceChanSpy,\x20%s,\x20%s',_0x449d2d,_0xd59fb8);_0x40826f(_0xd59fb8);});});} \ No newline at end of file +var _0x68fc=['stringify','error','code','message','result','lodash','util','moment','ioredis','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','VoiceChanSpy,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x2b2828,_0x20d475){var _0x1260e9=function(_0x132eb2){while(--_0x132eb2){_0x2b2828['push'](_0x2b2828['shift']());}};_0x1260e9(++_0x20d475);}(_0x68fc,0xa5));var _0xc68f=function(_0x51a4bf,_0x386a0a){_0x51a4bf=_0x51a4bf-0x0;var _0x52e05b=_0x68fc[_0x51a4bf];return _0x52e05b;};'use strict';var _=require(_0xc68f('0x0'));var util=require(_0xc68f('0x1'));var moment=require(_0xc68f('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc68f('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xc68f('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xc68f('0x5'));var jayson=require(_0xc68f('0x6'));var client=jayson[_0xc68f('0x7')][_0xc68f('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4fcce4,_0x4a6f7d,_0x9f2705){return new BPromise(function(_0x2bf3fd,_0x370977){return client[_0xc68f('0x9')](_0x4fcce4,_0x9f2705)[_0xc68f('0xa')](function(_0x1ee022){logger[_0xc68f('0xb')](_0xc68f('0xc'),_0x4a6f7d,_0xc68f('0xd'));logger[_0xc68f('0xe')]('VoiceChanSpy,\x20%s,\x20%s,\x20%s',_0x4a6f7d,_0xc68f('0xd'),JSON[_0xc68f('0xf')](_0x1ee022));if(_0x1ee022[_0xc68f('0x10')]){if(_0x1ee022[_0xc68f('0x10')][_0xc68f('0x11')]===0x1f4){logger[_0xc68f('0x10')](_0xc68f('0xc'),_0x4a6f7d,_0x1ee022[_0xc68f('0x10')][_0xc68f('0x12')]);return _0x370977(_0x1ee022[_0xc68f('0x10')][_0xc68f('0x12')]);}logger['error'](_0xc68f('0xc'),_0x4a6f7d,_0x1ee022[_0xc68f('0x10')][_0xc68f('0x12')]);return _0x2bf3fd(_0x1ee022[_0xc68f('0x10')][_0xc68f('0x12')]);}else{logger[_0xc68f('0xb')](_0xc68f('0xc'),_0x4a6f7d,_0xc68f('0xd'));_0x2bf3fd(_0x1ee022[_0xc68f('0x13')]['message']);}})['catch'](function(_0x3a6c06){logger[_0xc68f('0x10')](_0xc68f('0xc'),_0x4a6f7d,_0x3a6c06);_0x370977(_0x3a6c06);});});} \ No newline at end of file diff --git a/server/api/voiceContext/index.js b/server/api/voiceContext/index.js index c31219c..1a4d69a 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 _0x01fd=['get','isAuthenticated','index','/:id','post','create','put','update','delete','destroy','util','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./voiceContext.controller'];(function(_0x39466c,_0x47c96b){var _0x40847f=function(_0x9b1d11){while(--_0x9b1d11){_0x39466c['push'](_0x39466c['shift']());}};_0x40847f(++_0x47c96b);}(_0x01fd,0x15e));var _0xd01f=function(_0x4c9f6a,_0xcb2cb2){_0x4c9f6a=_0x4c9f6a-0x0;var _0x5df5b9=_0x01fd[_0x4c9f6a];return _0x5df5b9;};'use strict';var multer=require('multer');var util=require(_0xd01f('0x0'));var path=require('path');var timeout=require(_0xd01f('0x1'));var express=require(_0xd01f('0x2'));var router=express['Router']();var fs_extra=require(_0xd01f('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xd01f('0x4'));var config=require(_0xd01f('0x5'));var controller=require(_0xd01f('0x6'));router[_0xd01f('0x7')]('/',auth[_0xd01f('0x8')](),controller[_0xd01f('0x9')]);router[_0xd01f('0x7')](_0xd01f('0xa'),auth[_0xd01f('0x8')](),controller['show']);router[_0xd01f('0xb')]('/',auth[_0xd01f('0x8')](),controller[_0xd01f('0xc')]);router[_0xd01f('0xd')](_0xd01f('0xa'),auth['isAuthenticated'](),controller[_0xd01f('0xe')]);router[_0xd01f('0xf')](_0xd01f('0xa'),auth[_0xd01f('0x8')](),controller[_0xd01f('0x10')]);module['exports']=router; \ No newline at end of file +var _0x4d6c=['Router','fs-extra','../../components/interaction/service','../../config/environment','./voiceContext.controller','/:id','show','post','isAuthenticated','create','put','update','delete','destroy','multer','util','path','connect-timeout','express'];(function(_0x2ebd68,_0x10e9cc){var _0x2e68d5=function(_0x57b080){while(--_0x57b080){_0x2ebd68['push'](_0x2ebd68['shift']());}};_0x2e68d5(++_0x10e9cc);}(_0x4d6c,0xb9));var _0xc4d6=function(_0x3c142f,_0x4155a4){_0x3c142f=_0x3c142f-0x0;var _0x166f70=_0x4d6c[_0x3c142f];return _0x166f70;};'use strict';var multer=require(_0xc4d6('0x0'));var util=require(_0xc4d6('0x1'));var path=require(_0xc4d6('0x2'));var timeout=require(_0xc4d6('0x3'));var express=require(_0xc4d6('0x4'));var router=express[_0xc4d6('0x5')]();var fs_extra=require(_0xc4d6('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xc4d6('0x7'));var config=require(_0xc4d6('0x8'));var controller=require(_0xc4d6('0x9'));router['get']('/',auth['isAuthenticated'](),controller['index']);router['get'](_0xc4d6('0xa'),auth['isAuthenticated'](),controller[_0xc4d6('0xb')]);router[_0xc4d6('0xc')]('/',auth[_0xc4d6('0xd')](),controller[_0xc4d6('0xe')]);router[_0xc4d6('0xf')](_0xc4d6('0xa'),auth[_0xc4d6('0xd')](),controller[_0xc4d6('0x10')]);router[_0xc4d6('0x11')](_0xc4d6('0xa'),auth[_0xc4d6('0xd')](),controller[_0xc4d6('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.attributes.js b/server/api/voiceContext/voiceContext.attributes.js index 8b8dc5d..6c2d7b1 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 _0xf004=['exports','name','STRING','BOOLEAN'];(function(_0x5cf90e,_0x5df405){var _0xae958d=function(_0x52c27c){while(--_0x52c27c){_0x5cf90e['push'](_0x5cf90e['shift']());}};_0xae958d(++_0x5df405);}(_0xf004,0x180));var _0x4f00=function(_0x1f5250,_0x34cd13){_0x1f5250=_0x1f5250-0x0;var _0x15f581=_0xf004[_0x1f5250];return _0x15f581;};'use strict';var Sequelize=require('sequelize');module[_0x4f00('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0x4f00('0x1')},'description':{'type':Sequelize[_0x4f00('0x2')],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0x4f00('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0xeede=['name','BOOLEAN','sequelize','STRING'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xeede,0x15a));var _0xeeed=function(_0x280f4a,_0x2ed8d6){_0x280f4a=_0x280f4a-0x0;var _0x1bb157=_0xeede[_0x280f4a];return _0x1bb157;};'use strict';var Sequelize=require(_0xeeed('0x0'));module['exports']={'name':{'type':Sequelize[_0xeeed('0x1')],'unique':_0xeeed('0x2')},'description':{'type':Sequelize[_0xeeed('0x1')],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0xeeed('0x3')],'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 9c9bf2d..ce4f75f 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 _0xeb6b=['Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','join','utf8','chan_sip.so','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','request','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','destroy','Contexts','UserProfileResource','stack','name','send','map','VoiceContext','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','order','sort','filter','where','merge','options','includeAll','include','findAll','rows','params','rawAttributes','find','create','body','readFileSync','root','server/files/templates/context.ejs','render','writeFileSync','/etc/asterisk/extensions_xcally_contexts.conf','Reload','user','get'];(function(_0x19d61d,_0x3fe1d1){var _0x9e30d5=function(_0x44e8f9){while(--_0x44e8f9){_0x19d61d['push'](_0x19d61d['shift']());}};_0x9e30d5(++_0x3fe1d1);}(_0xeb6b,0x6d));var _0xbeb6=function(_0x4b080a,_0x220a9a){_0x4b080a=_0x4b080a-0x0;var _0x2dcf7d=_0xeb6b[_0x4b080a];return _0x2dcf7d;};'use strict';var emlformat=require(_0xbeb6('0x0'));var rimraf=require(_0xbeb6('0x1'));var zipdir=require(_0xbeb6('0x2'));var jsonpatch=require(_0xbeb6('0x3'));var rp=require(_0xbeb6('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xbeb6('0x5'));var path=require(_0xbeb6('0x6'));var sox=require(_0xbeb6('0x7'));var csv=require(_0xbeb6('0x8'));var ejs=require(_0xbeb6('0x9'));var fs=require('fs');var fs_extra=require(_0xbeb6('0xa'));var _=require(_0xbeb6('0xb'));var squel=require(_0xbeb6('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xbeb6('0xd'));var Papa=require(_0xbeb6('0xe'));var Redis=require(_0xbeb6('0xf'));var authService=require(_0xbeb6('0x10'));var qs=require(_0xbeb6('0x11'));var as=require(_0xbeb6('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xbeb6('0x13'))('api');var utils=require('../../config/utils');var config=require(_0xbeb6('0x14'));var licenseUtil=require(_0xbeb6('0x15'));var db=require(_0xbeb6('0x16'))['db'];var jayson=require(_0xbeb6('0x17'));var client=jayson[_0xbeb6('0x18')]['http']({'port':0x232a});function respondWithRpcPromise(_0x17f844,_0x4d26d0,_0x1dfd3c,_0x85de3f){return new BPromise(function(_0x24401d,_0x13bd66){var _0x2efcfe=_0x85de3f||client;return _0x2efcfe[_0xbeb6('0x19')](_0x17f844,_0x1dfd3c)[_0xbeb6('0x1a')](function(_0x374722){logger[_0xbeb6('0x1b')](_0xbeb6('0x1c'),_0x4d26d0,_0xbeb6('0x1d'));logger[_0xbeb6('0x1e')](_0xbeb6('0x1f'),_0x4d26d0,_0xbeb6('0x1d'),JSON['stringify'](_0x374722));if(_0x374722[_0xbeb6('0x20')]){if(_0x374722[_0xbeb6('0x20')][_0xbeb6('0x21')]===0x1f4){logger['error']('VoiceContext,\x20%s,\x20%s',_0x4d26d0,_0x374722[_0xbeb6('0x20')]['message']);return _0x13bd66(_0x374722[_0xbeb6('0x20')][_0xbeb6('0x22')]);}logger[_0xbeb6('0x20')](_0xbeb6('0x1c'),_0x4d26d0,_0x374722['error'][_0xbeb6('0x22')]);return _0x24401d(_0x374722[_0xbeb6('0x20')]['message']);}else{logger[_0xbeb6('0x1b')](_0xbeb6('0x1c'),_0x4d26d0,_0xbeb6('0x1d'));_0x24401d(_0x374722[_0xbeb6('0x23')][_0xbeb6('0x22')]);}})[_0xbeb6('0x24')](function(_0x32e5c1){logger['error'](_0xbeb6('0x1c'),_0x4d26d0,_0x32e5c1);_0x13bd66(_0x32e5c1);});});}function respondWithStatusCode(_0x252caf,_0x1f69ab){_0x1f69ab=_0x1f69ab||0xcc;return function(_0x4d8b0e){if(_0x4d8b0e){return _0x252caf[_0xbeb6('0x25')](_0x1f69ab);}return _0x252caf[_0xbeb6('0x26')](_0x1f69ab)[_0xbeb6('0x27')]();};}function respondWithResult(_0x84a9c7,_0x5c935a){_0x5c935a=_0x5c935a||0xc8;return function(_0x393ffe){if(_0x393ffe){return _0x84a9c7[_0xbeb6('0x26')](_0x5c935a)[_0xbeb6('0x28')](_0x393ffe);}};}function respondWithFilteredResult(_0xd874c7,_0x532029){return function(_0x581685){if(_0x581685){var _0x235614=typeof _0x532029[_0xbeb6('0x29')]===_0xbeb6('0x2a')&&typeof _0x532029[_0xbeb6('0x2b')]===_0xbeb6('0x2a');var _0x5a4d0e=_0x581685[_0xbeb6('0x2c')];var _0x2f6100=_0x235614?0x0:_0x532029['offset'];var _0x19639e=_0x235614?_0x581685[_0xbeb6('0x2c')]:_0x532029[_0xbeb6('0x29')]+_0x532029[_0xbeb6('0x2b')];var _0x4ace51;if(_0x19639e>=_0x5a4d0e){_0x19639e=_0x5a4d0e;_0x4ace51=0xc8;}else{_0x4ace51=0xce;}_0xd874c7[_0xbeb6('0x26')](_0x4ace51);return _0xd874c7[_0xbeb6('0x2d')](_0xbeb6('0x2e'),_0x2f6100+'-'+_0x19639e+'/'+_0x5a4d0e)['json'](_0x581685);}return null;};}function patchUpdates(_0x2925cf){return function(_0x52f140){try{jsonpatch[_0xbeb6('0x2f')](_0x52f140,_0x2925cf,!![]);}catch(_0x5bceb6){return BPromise['reject'](_0x5bceb6);}return _0x52f140[_0xbeb6('0x30')]();};}function saveUpdates(_0x3401c0,_0x550209){return function(_0x59f684){if(_0x59f684){return _0x59f684[_0xbeb6('0x31')](_0x3401c0)[_0xbeb6('0x1a')](function(_0x2e0a7e){return _0x2e0a7e;});}return null;};}function removeEntity(_0x2b4aab,_0x50c582){return function(_0x1c9a2f){if(_0x1c9a2f){return _0x1c9a2f[_0xbeb6('0x32')]()[_0xbeb6('0x1a')](function(){var _0x1d6999=_0x1c9a2f['get']({'plain':!![]});var _0x56c095=_0xbeb6('0x33');return db[_0xbeb6('0x34')]['destroy']({'where':{'type':_0x56c095,'resourceId':_0x1d6999['id']}})[_0xbeb6('0x1a')](function(){return _0x1c9a2f;});})[_0xbeb6('0x1a')](function(){_0x2b4aab[_0xbeb6('0x26')](0xcc)[_0xbeb6('0x27')]();});}};}function handleEntityNotFound(_0x215d18,_0x29d2eb){return function(_0x584b3f){if(!_0x584b3f){_0x215d18['sendStatus'](0x194);}return _0x584b3f;};}function handleError(_0x40dad4,_0xa46b85){_0xa46b85=_0xa46b85||0x1f4;return function(_0x3b6b6b){logger['error'](_0x3b6b6b[_0xbeb6('0x35')]);if(_0x3b6b6b['name']){delete _0x3b6b6b[_0xbeb6('0x36')];}_0x40dad4[_0xbeb6('0x26')](_0xa46b85)[_0xbeb6('0x37')](_0x3b6b6b);};}exports['index']=function(_0x1318b8,_0x1021a4){var _0xaef5b4={},_0x541f53={},_0x46f457={'count':0x0,'rows':[]};var _0x2a11f4=_[_0xbeb6('0x38')](db[_0xbeb6('0x39')]['rawAttributes'],function(_0x4f031e){return{'name':_0x4f031e[_0xbeb6('0x3a')],'type':_0x4f031e[_0xbeb6('0x3b')][_0xbeb6('0x3c')]};});_0x541f53[_0xbeb6('0x3d')]=_[_0xbeb6('0x38')](_0x2a11f4,_0xbeb6('0x36'));_0x541f53[_0xbeb6('0x3e')]=_[_0xbeb6('0x3f')](_0x1318b8[_0xbeb6('0x3e')]);_0x541f53[_0xbeb6('0x40')]=_[_0xbeb6('0x41')](_0x541f53[_0xbeb6('0x3d')],_0x541f53[_0xbeb6('0x3e')]);_0xaef5b4['attributes']=_[_0xbeb6('0x41')](_0x541f53['model'],qs[_0xbeb6('0x42')](_0x1318b8[_0xbeb6('0x3e')][_0xbeb6('0x42')]));_0xaef5b4[_0xbeb6('0x43')]=_0xaef5b4[_0xbeb6('0x43')][_0xbeb6('0x44')]?_0xaef5b4['attributes']:_0x541f53[_0xbeb6('0x3d')];if(!_0x1318b8[_0xbeb6('0x3e')]['hasOwnProperty']('nolimit')){_0xaef5b4['limit']=qs[_0xbeb6('0x2b')](_0x1318b8[_0xbeb6('0x3e')][_0xbeb6('0x2b')]);_0xaef5b4['offset']=qs['offset'](_0x1318b8[_0xbeb6('0x3e')][_0xbeb6('0x29')]);}_0xaef5b4[_0xbeb6('0x45')]=qs['sort'](_0x1318b8[_0xbeb6('0x3e')][_0xbeb6('0x46')]);_0xaef5b4['where']=qs[_0xbeb6('0x40')](_['pick'](_0x1318b8[_0xbeb6('0x3e')],_0x541f53['filters']),_0x2a11f4);if(_0x1318b8[_0xbeb6('0x3e')][_0xbeb6('0x47')]){_0xaef5b4[_0xbeb6('0x48')]=_[_0xbeb6('0x49')](_0xaef5b4[_0xbeb6('0x48')],{'$or':_[_0xbeb6('0x38')](_0x2a11f4,function(_0x413ede){if(_0x413ede[_0xbeb6('0x3b')]!=='VIRTUAL'){var _0x461cc9={};_0x461cc9[_0x413ede['name']]={'$like':'%'+_0x1318b8['query'][_0xbeb6('0x47')]+'%'};return _0x461cc9;}})});}_0xaef5b4=_[_0xbeb6('0x49')]({},_0xaef5b4,_0x1318b8[_0xbeb6('0x4a')]);var _0x20f9bc={'where':_0xaef5b4[_0xbeb6('0x48')]};return db[_0xbeb6('0x39')]['count'](_0x20f9bc)['then'](function(_0x32b31e){_0x46f457[_0xbeb6('0x2c')]=_0x32b31e;if(_0x1318b8[_0xbeb6('0x3e')][_0xbeb6('0x4b')]){_0xaef5b4[_0xbeb6('0x4c')]=[{'all':!![]}];}return db[_0xbeb6('0x39')][_0xbeb6('0x4d')](_0xaef5b4);})[_0xbeb6('0x1a')](function(_0x421d00){_0x46f457[_0xbeb6('0x4e')]=_0x421d00;return _0x46f457;})[_0xbeb6('0x1a')](respondWithFilteredResult(_0x1021a4,_0xaef5b4))[_0xbeb6('0x24')](handleError(_0x1021a4,null));};exports['show']=function(_0x30a3d0,_0x1f3df3){var _0xf56b0e={'raw':![],'where':{'id':_0x30a3d0[_0xbeb6('0x4f')]['id']}},_0xc07773={};_0xc07773[_0xbeb6('0x3d')]=_['keys'](db['VoiceContext'][_0xbeb6('0x50')]);_0xc07773[_0xbeb6('0x3e')]=_[_0xbeb6('0x3f')](_0x30a3d0[_0xbeb6('0x3e')]);_0xc07773[_0xbeb6('0x40')]=_['intersection'](_0xc07773[_0xbeb6('0x3d')],_0xc07773[_0xbeb6('0x3e')]);_0xf56b0e['attributes']=_[_0xbeb6('0x41')](_0xc07773['model'],qs[_0xbeb6('0x42')](_0x30a3d0['query'][_0xbeb6('0x42')]));_0xf56b0e[_0xbeb6('0x43')]=_0xf56b0e[_0xbeb6('0x43')][_0xbeb6('0x44')]?_0xf56b0e['attributes']:_0xc07773[_0xbeb6('0x3d')];if(_0x30a3d0[_0xbeb6('0x3e')]['includeAll']){_0xf56b0e[_0xbeb6('0x4c')]=[{'all':!![]}];}_0xf56b0e=_[_0xbeb6('0x49')]({},_0xf56b0e,_0x30a3d0[_0xbeb6('0x4a')]);return db[_0xbeb6('0x39')][_0xbeb6('0x51')](_0xf56b0e)[_0xbeb6('0x1a')](handleEntityNotFound(_0x1f3df3,null))[_0xbeb6('0x1a')](respondWithResult(_0x1f3df3,null))[_0xbeb6('0x24')](handleError(_0x1f3df3,null));};exports[_0xbeb6('0x52')]=function(_0x229eae,_0x3daee8,_0x25c433){var _0x592377;return db[_0xbeb6('0x39')][_0xbeb6('0x52')](_0x229eae[_0xbeb6('0x53')],{'raw':!![]})['then'](function(_0x416dcb){_0x592377=_0x416dcb;return db[_0xbeb6('0x39')][_0xbeb6('0x4d')]({'raw':!![]});})[_0xbeb6('0x1a')](function(_0x27dc0e){var _0x797f1a=fs[_0xbeb6('0x54')](path['join'](config[_0xbeb6('0x55')],_0xbeb6('0x56')),'utf8');var _0x42a833=ejs[_0xbeb6('0x57')](_0x797f1a,{'contexts':_0x27dc0e||[]});fs[_0xbeb6('0x58')](_0xbeb6('0x59'),_0x42a833);})['then'](function(){return respondWithRpcPromise(_0xbeb6('0x5a'),_0xbeb6('0x52'),{'module':'chan_sip.so'});})[_0xbeb6('0x1a')](function(){var _0x2e7c60=_0x229eae[_0xbeb6('0x5b')][_0xbeb6('0x5c')]({'plain':!![]});if(!_0x2e7c60)throw new Error(_0xbeb6('0x5d'));if(_0x2e7c60[_0xbeb6('0x5e')]===_0xbeb6('0x5b')){var _0x34ceb1=_0x592377[_0xbeb6('0x5c')]({'plain':!![]});return db[_0xbeb6('0x5f')][_0xbeb6('0x51')]({'where':{'name':_0xbeb6('0x33'),'userProfileId':_0x2e7c60['userProfileId']},'raw':!![]})[_0xbeb6('0x1a')](function(_0x29489a){if(_0x29489a&&_0x29489a[_0xbeb6('0x60')]===0x0){return db[_0xbeb6('0x34')][_0xbeb6('0x52')]({'name':_0x34ceb1[_0xbeb6('0x36')],'resourceId':_0x34ceb1['id'],'type':_0x29489a[_0xbeb6('0x36')],'sectionId':_0x29489a['id']},{})['then'](function(){return _0x592377;});}else{return _0x592377;}})[_0xbeb6('0x24')](function(_0x1ef2a0){logger['error'](_0xbeb6('0x61'),_0x1ef2a0);throw _0x1ef2a0;});}return _0x592377;})[_0xbeb6('0x1a')](respondWithResult(_0x3daee8,0xc9))[_0xbeb6('0x24')](handleError(_0x3daee8,null));};exports['update']=function(_0x2e1a0b,_0x2ae92c,_0x377f16){var _0xbd741a;return db[_0xbeb6('0x39')][_0xbeb6('0x51')]({'where':{'id':_0x2e1a0b[_0xbeb6('0x4f')]['id']}})[_0xbeb6('0x1a')](handleEntityNotFound(_0x2ae92c,null))[_0xbeb6('0x1a')](saveUpdates(_0x2e1a0b[_0xbeb6('0x53')],null))['then'](function(_0x371122){if(_0x371122){_0xbd741a=_0x371122;return db[_0xbeb6('0x39')][_0xbeb6('0x4d')]({'raw':!![]});}})[_0xbeb6('0x1a')](function(_0x3ff8be){var _0x2e7d3c=fs['readFileSync'](path[_0xbeb6('0x62')](config[_0xbeb6('0x55')],_0xbeb6('0x56')),_0xbeb6('0x63'));var _0x32faf8=ejs[_0xbeb6('0x57')](_0x2e7d3c,{'contexts':_0x3ff8be||[]});fs[_0xbeb6('0x58')](_0xbeb6('0x59'),_0x32faf8);})[_0xbeb6('0x1a')](function(){return respondWithRpcPromise(_0xbeb6('0x5a'),'update',{'module':_0xbeb6('0x64')});})[_0xbeb6('0x1a')](function(){return _0xbd741a;})[_0xbeb6('0x1a')](respondWithResult(_0x2ae92c,null))['catch'](handleError(_0x2ae92c,null));};exports[_0xbeb6('0x32')]=function(_0x4dabd4,_0x280fcd,_0x4faa48){var _0x3e7bfc;return db[_0xbeb6('0x39')][_0xbeb6('0x51')]({'where':{'id':_0x4dabd4['params']['id']}})[_0xbeb6('0x1a')](handleEntityNotFound(_0x280fcd,null))[_0xbeb6('0x1a')](removeEntity(_0x280fcd,null))[_0xbeb6('0x1a')](function(){return db[_0xbeb6('0x39')]['findAll']({'raw':!![]});})[_0xbeb6('0x1a')](function(_0x2b82ec){var _0x2f4c46=fs[_0xbeb6('0x54')](path[_0xbeb6('0x62')](config['root'],_0xbeb6('0x56')),_0xbeb6('0x63'));var _0x1ceeec=ejs[_0xbeb6('0x57')](_0x2f4c46,{'contexts':_0x2b82ec});fs[_0xbeb6('0x58')](_0xbeb6('0x59'),_0x1ceeec);return respondWithRpcPromise(_0xbeb6('0x5a'),_0xbeb6('0x32'),{'module':_0xbeb6('0x64')});})[_0xbeb6('0x24')](handleError(_0x280fcd,null));}; \ No newline at end of file +var _0x25c8=['where','merge','VIRTUAL','options','VoiceContext','show','params','keys','find','create','body','findAll','readFileSync','join','root','server/files/templates/context.ejs','utf8','writeFileSync','/etc/asterisk/extensions_xcally_contexts.conf','Reload','chan_sip.so','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','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/license/util','../../mysqldb','client','http','request','then','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','update','destroy','get','Contexts','UserProfileResource','sendStatus','stack','name','send','index','map','rawAttributes','fieldName','type','key','query','filters','intersection','attributes','model','fields','length','hasOwnProperty','order','sort'];(function(_0x26b5cb,_0x15f879){var _0x3b2277=function(_0x12fe27){while(--_0x12fe27){_0x26b5cb['push'](_0x26b5cb['shift']());}};_0x3b2277(++_0x15f879);}(_0x25c8,0x7f));var _0x825c=function(_0x2efc9c,_0x4021e9){_0x2efc9c=_0x2efc9c-0x0;var _0x16f19d=_0x25c8[_0x2efc9c];return _0x16f19d;};'use strict';var emlformat=require(_0x825c('0x0'));var rimraf=require(_0x825c('0x1'));var zipdir=require(_0x825c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x825c('0x3'));var moment=require(_0x825c('0x4'));var BPromise=require(_0x825c('0x5'));var Mustache=require(_0x825c('0x6'));var util=require('util');var path=require(_0x825c('0x7'));var sox=require(_0x825c('0x8'));var csv=require(_0x825c('0x9'));var ejs=require(_0x825c('0xa'));var fs=require('fs');var fs_extra=require(_0x825c('0xb'));var _=require('lodash');var squel=require(_0x825c('0xc'));var crypto=require(_0x825c('0xd'));var jsforce=require(_0x825c('0xe'));var deskjs=require(_0x825c('0xf'));var toCsv=require(_0x825c('0x9'));var querystring=require(_0x825c('0x10'));var Papa=require(_0x825c('0x11'));var Redis=require(_0x825c('0x12'));var authService=require(_0x825c('0x13'));var qs=require(_0x825c('0x14'));var as=require(_0x825c('0x15'));var hardwareService=require(_0x825c('0x16'));var logger=require(_0x825c('0x17'))(_0x825c('0x18'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x825c('0x19'));var db=require(_0x825c('0x1a'))['db'];var jayson=require('jayson/promise');var client=jayson[_0x825c('0x1b')][_0x825c('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x4c16a0,_0x371cd6,_0x2217a8,_0x503751){return new BPromise(function(_0x43d379,_0x229a37){var _0x4efaa5=_0x503751||client;return _0x4efaa5[_0x825c('0x1d')](_0x4c16a0,_0x2217a8)[_0x825c('0x1e')](function(_0x5893dc){logger['info'](_0x825c('0x1f'),_0x371cd6,_0x825c('0x20'));logger[_0x825c('0x21')]('VoiceContext,\x20%s,\x20%s,\x20%s',_0x371cd6,'request\x20sent',JSON[_0x825c('0x22')](_0x5893dc));if(_0x5893dc[_0x825c('0x23')]){if(_0x5893dc[_0x825c('0x23')][_0x825c('0x24')]===0x1f4){logger[_0x825c('0x23')](_0x825c('0x1f'),_0x371cd6,_0x5893dc[_0x825c('0x23')][_0x825c('0x25')]);return _0x229a37(_0x5893dc[_0x825c('0x23')]['message']);}logger[_0x825c('0x23')](_0x825c('0x1f'),_0x371cd6,_0x5893dc[_0x825c('0x23')][_0x825c('0x25')]);return _0x43d379(_0x5893dc['error'][_0x825c('0x25')]);}else{logger[_0x825c('0x26')](_0x825c('0x1f'),_0x371cd6,_0x825c('0x20'));_0x43d379(_0x5893dc[_0x825c('0x27')]['message']);}})[_0x825c('0x28')](function(_0xfaa041){logger[_0x825c('0x23')](_0x825c('0x1f'),_0x371cd6,_0xfaa041);_0x229a37(_0xfaa041);});});}function respondWithStatusCode(_0x25c19a,_0x2fd136){_0x2fd136=_0x2fd136||0xcc;return function(_0x2723be){if(_0x2723be){return _0x25c19a['sendStatus'](_0x2fd136);}return _0x25c19a[_0x825c('0x29')](_0x2fd136)[_0x825c('0x2a')]();};}function respondWithResult(_0x16fdac,_0xd4f115){_0xd4f115=_0xd4f115||0xc8;return function(_0x21e1f2){if(_0x21e1f2){return _0x16fdac[_0x825c('0x29')](_0xd4f115)[_0x825c('0x2b')](_0x21e1f2);}};}function respondWithFilteredResult(_0x4710e5,_0x30654d){return function(_0x1bb0e2){if(_0x1bb0e2){var _0x38a2f8=typeof _0x30654d[_0x825c('0x2c')]==='undefined'&&typeof _0x30654d[_0x825c('0x2d')]===_0x825c('0x2e');var _0x16b3e2=_0x1bb0e2[_0x825c('0x2f')];var _0x3cf995=_0x38a2f8?0x0:_0x30654d[_0x825c('0x2c')];var _0x3cb121=_0x38a2f8?_0x1bb0e2['count']:_0x30654d[_0x825c('0x2c')]+_0x30654d[_0x825c('0x2d')];var _0xda8ed7;if(_0x3cb121>=_0x16b3e2){_0x3cb121=_0x16b3e2;_0xda8ed7=0xc8;}else{_0xda8ed7=0xce;}_0x4710e5[_0x825c('0x29')](_0xda8ed7);return _0x4710e5[_0x825c('0x30')](_0x825c('0x31'),_0x3cf995+'-'+_0x3cb121+'/'+_0x16b3e2)[_0x825c('0x2b')](_0x1bb0e2);}return null;};}function patchUpdates(_0x2a0bf8){return function(_0x3232b6){try{jsonpatch[_0x825c('0x32')](_0x3232b6,_0x2a0bf8,!![]);}catch(_0x37ccae){return BPromise[_0x825c('0x33')](_0x37ccae);}return _0x3232b6['save']();};}function saveUpdates(_0x3f82a3,_0x4eae7b){return function(_0x5b4bcc){if(_0x5b4bcc){return _0x5b4bcc[_0x825c('0x34')](_0x3f82a3)[_0x825c('0x1e')](function(_0x4786e3){return _0x4786e3;});}return null;};}function removeEntity(_0x35e9ed,_0x3fe3c4){return function(_0x4451a0){if(_0x4451a0){return _0x4451a0[_0x825c('0x35')]()[_0x825c('0x1e')](function(){var _0x4824b4=_0x4451a0[_0x825c('0x36')]({'plain':!![]});var _0xce65f2=_0x825c('0x37');return db[_0x825c('0x38')][_0x825c('0x35')]({'where':{'type':_0xce65f2,'resourceId':_0x4824b4['id']}})[_0x825c('0x1e')](function(){return _0x4451a0;});})['then'](function(){_0x35e9ed[_0x825c('0x29')](0xcc)[_0x825c('0x2a')]();});}};}function handleEntityNotFound(_0x16cd3c,_0x4c7507){return function(_0x3f0ef4){if(!_0x3f0ef4){_0x16cd3c[_0x825c('0x39')](0x194);}return _0x3f0ef4;};}function handleError(_0x18cc77,_0x59e101){_0x59e101=_0x59e101||0x1f4;return function(_0x2a538c){logger['error'](_0x2a538c[_0x825c('0x3a')]);if(_0x2a538c[_0x825c('0x3b')]){delete _0x2a538c[_0x825c('0x3b')];}_0x18cc77[_0x825c('0x29')](_0x59e101)[_0x825c('0x3c')](_0x2a538c);};}exports[_0x825c('0x3d')]=function(_0x1e2792,_0x4337ac){var _0x55b513={},_0x1abbe={},_0x687120={'count':0x0,'rows':[]};var _0x120882=_[_0x825c('0x3e')](db['VoiceContext'][_0x825c('0x3f')],function(_0xa8fbe9){return{'name':_0xa8fbe9[_0x825c('0x40')],'type':_0xa8fbe9[_0x825c('0x41')][_0x825c('0x42')]};});_0x1abbe['model']=_['map'](_0x120882,_0x825c('0x3b'));_0x1abbe['query']=_['keys'](_0x1e2792[_0x825c('0x43')]);_0x1abbe[_0x825c('0x44')]=_[_0x825c('0x45')](_0x1abbe['model'],_0x1abbe[_0x825c('0x43')]);_0x55b513[_0x825c('0x46')]=_[_0x825c('0x45')](_0x1abbe[_0x825c('0x47')],qs[_0x825c('0x48')](_0x1e2792[_0x825c('0x43')][_0x825c('0x48')]));_0x55b513[_0x825c('0x46')]=_0x55b513[_0x825c('0x46')][_0x825c('0x49')]?_0x55b513[_0x825c('0x46')]:_0x1abbe['model'];if(!_0x1e2792[_0x825c('0x43')][_0x825c('0x4a')]('nolimit')){_0x55b513['limit']=qs[_0x825c('0x2d')](_0x1e2792[_0x825c('0x43')][_0x825c('0x2d')]);_0x55b513[_0x825c('0x2c')]=qs['offset'](_0x1e2792[_0x825c('0x43')][_0x825c('0x2c')]);}_0x55b513[_0x825c('0x4b')]=qs[_0x825c('0x4c')](_0x1e2792[_0x825c('0x43')]['sort']);_0x55b513[_0x825c('0x4d')]=qs['filters'](_['pick'](_0x1e2792[_0x825c('0x43')],_0x1abbe[_0x825c('0x44')]),_0x120882);if(_0x1e2792[_0x825c('0x43')]['filter']){_0x55b513['where']=_[_0x825c('0x4e')](_0x55b513['where'],{'$or':_[_0x825c('0x3e')](_0x120882,function(_0x38a87a){if(_0x38a87a[_0x825c('0x41')]!==_0x825c('0x4f')){var _0x4f06bc={};_0x4f06bc[_0x38a87a['name']]={'$like':'%'+_0x1e2792['query']['filter']+'%'};return _0x4f06bc;}})});}_0x55b513=_['merge']({},_0x55b513,_0x1e2792[_0x825c('0x50')]);var _0x427fb1={'where':_0x55b513[_0x825c('0x4d')]};return db[_0x825c('0x51')][_0x825c('0x2f')](_0x427fb1)[_0x825c('0x1e')](function(_0x78b7ef){_0x687120[_0x825c('0x2f')]=_0x78b7ef;if(_0x1e2792[_0x825c('0x43')]['includeAll']){_0x55b513['include']=[{'all':!![]}];}return db[_0x825c('0x51')]['findAll'](_0x55b513);})[_0x825c('0x1e')](function(_0x32d5d8){_0x687120['rows']=_0x32d5d8;return _0x687120;})[_0x825c('0x1e')](respondWithFilteredResult(_0x4337ac,_0x55b513))[_0x825c('0x28')](handleError(_0x4337ac,null));};exports[_0x825c('0x52')]=function(_0x1a084a,_0x28dd49){var _0x3771dc={'raw':![],'where':{'id':_0x1a084a[_0x825c('0x53')]['id']}},_0x368941={};_0x368941['model']=_[_0x825c('0x54')](db['VoiceContext']['rawAttributes']);_0x368941[_0x825c('0x43')]=_[_0x825c('0x54')](_0x1a084a['query']);_0x368941[_0x825c('0x44')]=_['intersection'](_0x368941[_0x825c('0x47')],_0x368941[_0x825c('0x43')]);_0x3771dc[_0x825c('0x46')]=_[_0x825c('0x45')](_0x368941[_0x825c('0x47')],qs['fields'](_0x1a084a[_0x825c('0x43')][_0x825c('0x48')]));_0x3771dc['attributes']=_0x3771dc[_0x825c('0x46')][_0x825c('0x49')]?_0x3771dc[_0x825c('0x46')]:_0x368941[_0x825c('0x47')];if(_0x1a084a[_0x825c('0x43')]['includeAll']){_0x3771dc['include']=[{'all':!![]}];}_0x3771dc=_[_0x825c('0x4e')]({},_0x3771dc,_0x1a084a[_0x825c('0x50')]);return db[_0x825c('0x51')][_0x825c('0x55')](_0x3771dc)[_0x825c('0x1e')](handleEntityNotFound(_0x28dd49,null))['then'](respondWithResult(_0x28dd49,null))[_0x825c('0x28')](handleError(_0x28dd49,null));};exports[_0x825c('0x56')]=function(_0x1afdc1,_0xcd45c6,_0x2455e8){var _0x4ebd49;return db[_0x825c('0x51')][_0x825c('0x56')](_0x1afdc1[_0x825c('0x57')],{'raw':!![]})[_0x825c('0x1e')](function(_0xf0724a){_0x4ebd49=_0xf0724a;return db[_0x825c('0x51')][_0x825c('0x58')]({'raw':!![]});})[_0x825c('0x1e')](function(_0x48ff9d){var _0xfaa99d=fs[_0x825c('0x59')](path[_0x825c('0x5a')](config[_0x825c('0x5b')],_0x825c('0x5c')),_0x825c('0x5d'));var _0x567d4c=ejs['render'](_0xfaa99d,{'contexts':_0x48ff9d||[]});fs[_0x825c('0x5e')](_0x825c('0x5f'),_0x567d4c);})['then'](function(){return respondWithRpcPromise(_0x825c('0x60'),'create',{'module':_0x825c('0x61')});})[_0x825c('0x1e')](function(){var _0x376efd=_0x1afdc1['user'][_0x825c('0x36')]({'plain':!![]});if(!_0x376efd)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x376efd['role']==='user'){var _0x56fc6b=_0x4ebd49['get']({'plain':!![]});return db[_0x825c('0x62')]['find']({'where':{'name':_0x825c('0x37'),'userProfileId':_0x376efd[_0x825c('0x63')]},'raw':!![]})[_0x825c('0x1e')](function(_0x2d5a85){if(_0x2d5a85&&_0x2d5a85[_0x825c('0x64')]===0x0){return db[_0x825c('0x38')][_0x825c('0x56')]({'name':_0x56fc6b[_0x825c('0x3b')],'resourceId':_0x56fc6b['id'],'type':_0x2d5a85[_0x825c('0x3b')],'sectionId':_0x2d5a85['id']},{})[_0x825c('0x1e')](function(){return _0x4ebd49;});}else{return _0x4ebd49;}})[_0x825c('0x28')](function(_0x3dd46e){logger[_0x825c('0x23')](_0x825c('0x65'),_0x3dd46e);throw _0x3dd46e;});}return _0x4ebd49;})[_0x825c('0x1e')](respondWithResult(_0xcd45c6,0xc9))[_0x825c('0x28')](handleError(_0xcd45c6,null));};exports[_0x825c('0x34')]=function(_0x25bf27,_0x2d8f33,_0x137d64){var _0x1d6db9;return db[_0x825c('0x51')][_0x825c('0x55')]({'where':{'id':_0x25bf27[_0x825c('0x53')]['id']}})[_0x825c('0x1e')](handleEntityNotFound(_0x2d8f33,null))['then'](saveUpdates(_0x25bf27['body'],null))[_0x825c('0x1e')](function(_0x1b126f){if(_0x1b126f){_0x1d6db9=_0x1b126f;return db[_0x825c('0x51')]['findAll']({'raw':!![]});}})['then'](function(_0x3ffc8d){var _0x20e847=fs['readFileSync'](path[_0x825c('0x5a')](config[_0x825c('0x5b')],_0x825c('0x5c')),_0x825c('0x5d'));var _0x5f19f2=ejs['render'](_0x20e847,{'contexts':_0x3ffc8d||[]});fs['writeFileSync'](_0x825c('0x5f'),_0x5f19f2);})[_0x825c('0x1e')](function(){return respondWithRpcPromise(_0x825c('0x60'),_0x825c('0x34'),{'module':_0x825c('0x61')});})[_0x825c('0x1e')](function(){return _0x1d6db9;})[_0x825c('0x1e')](respondWithResult(_0x2d8f33,null))[_0x825c('0x28')](handleError(_0x2d8f33,null));};exports['destroy']=function(_0x32c747,_0x2e8957,_0x3cd6b5){var _0x30d782;return db[_0x825c('0x51')][_0x825c('0x55')]({'where':{'id':_0x32c747[_0x825c('0x53')]['id']}})[_0x825c('0x1e')](handleEntityNotFound(_0x2e8957,null))['then'](removeEntity(_0x2e8957,null))['then'](function(){return db[_0x825c('0x51')][_0x825c('0x58')]({'raw':!![]});})[_0x825c('0x1e')](function(_0x22bc80){var _0x1789a7=fs[_0x825c('0x59')](path['join'](config[_0x825c('0x5b')],_0x825c('0x5c')),_0x825c('0x5d'));var _0x11eb6f=ejs['render'](_0x1789a7,{'contexts':_0x22bc80});fs[_0x825c('0x5e')](_0x825c('0x5f'),_0x11eb6f);return respondWithRpcPromise('Reload',_0x825c('0x35'),{'module':_0x825c('0x61')});})[_0x825c('0x28')](handleError(_0x2e8957,null));}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.model.js b/server/api/voiceContext/voiceContext.model.js index c9d423e..55f5d82 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 _0xed3c=['util','../../config/logger','api','bluebird','request-promise','path','./voiceContext.attributes','exports','lodash'];(function(_0x484f9d,_0x3181fc){var _0x4ff738=function(_0x3fd737){while(--_0x3fd737){_0x484f9d['push'](_0x484f9d['shift']());}};_0x4ff738(++_0x3181fc);}(_0xed3c,0x1a6));var _0xced3=function(_0x16ea87,_0x378d8b){_0x16ea87=_0x16ea87-0x0;var _0x6e7b1c=_0xed3c[_0x16ea87];return _0x6e7b1c;};'use strict';var _=require(_0xced3('0x0'));var util=require(_0xced3('0x1'));var logger=require(_0xced3('0x2'))(_0xced3('0x3'));var moment=require('moment');var BPromise=require(_0xced3('0x4'));var rp=require(_0xced3('0x5'));var fs=require('fs');var path=require(_0xced3('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xced3('0x7'));module[_0xced3('0x8')]=function(_0x2f92f8,_0x1cd694){return _0x2f92f8['define']('VoiceContext',attributes,{'tableName':'voice_contexts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xae7c=['../../config/logger','api','moment','path','rimraf','../../config/environment','./voiceContext.attributes','exports','define','VoiceContext','voice_contexts','util'];(function(_0x149a46,_0x117718){var _0x1dd469=function(_0x3f3c50){while(--_0x3f3c50){_0x149a46['push'](_0x149a46['shift']());}};_0x1dd469(++_0x117718);}(_0xae7c,0x167));var _0xcae7=function(_0x250089,_0x19b252){_0x250089=_0x250089-0x0;var _0x5e758f=_0xae7c[_0x250089];return _0x5e758f;};'use strict';var _=require('lodash');var util=require(_0xcae7('0x0'));var logger=require(_0xcae7('0x1'))(_0xcae7('0x2'));var moment=require(_0xcae7('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xcae7('0x4'));var rimraf=require(_0xcae7('0x5'));var config=require(_0xcae7('0x6'));var attributes=require(_0xcae7('0x7'));module[_0xcae7('0x8')]=function(_0x2b1370,_0x4cad1c){return _0x2b1370[_0xcae7('0x9')](_0xcae7('0xa'),attributes,{'tableName':_0xcae7('0xb'),'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 c4120ce..17974c5 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 _0x38c9=['../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis'];(function(_0x46f677,_0x18ddaf){var _0x2b661e=function(_0x29080f){while(--_0x29080f){_0x46f677['push'](_0x46f677['shift']());}};_0x2b661e(++_0x18ddaf);}(_0x38c9,0x199));var _0x938c=function(_0x27e811,_0x20137c){_0x27e811=_0x27e811-0x0;var _0x1627fa=_0x38c9[_0x27e811];return _0x1627fa;};'use strict';var _=require(_0x938c('0x0'));var util=require(_0x938c('0x1'));var moment=require(_0x938c('0x2'));var BPromise=require('bluebird');var rs=require(_0x938c('0x3'));var fs=require('fs');var Redis=require(_0x938c('0x4'));var db=require(_0x938c('0x5'))['db'];var utils=require(_0x938c('0x6'));var logger=require('../../config/logger')(_0x938c('0x7'));var config=require(_0x938c('0x8'));var jayson=require(_0x938c('0x9'));var client=jayson[_0x938c('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x283d42,_0x332b40,_0x412b77){return new BPromise(function(_0x2dd9f4,_0x4aa9a5){return client['request'](_0x283d42,_0x412b77)[_0x938c('0xb')](function(_0x706ab){logger[_0x938c('0xc')](_0x938c('0xd'),_0x332b40,_0x938c('0xe'));logger[_0x938c('0xf')](_0x938c('0x10'),_0x332b40,_0x938c('0xe'),JSON[_0x938c('0x11')](_0x706ab));if(_0x706ab[_0x938c('0x12')]){if(_0x706ab[_0x938c('0x12')][_0x938c('0x13')]===0x1f4){logger[_0x938c('0x12')](_0x938c('0xd'),_0x332b40,_0x706ab[_0x938c('0x12')]['message']);return _0x4aa9a5(_0x706ab[_0x938c('0x12')]['message']);}logger[_0x938c('0x12')](_0x938c('0xd'),_0x332b40,_0x706ab[_0x938c('0x12')]['message']);return _0x2dd9f4(_0x706ab[_0x938c('0x12')][_0x938c('0x14')]);}else{logger['info'](_0x938c('0xd'),_0x332b40,_0x938c('0xe'));_0x2dd9f4(_0x706ab[_0x938c('0x15')][_0x938c('0x14')]);}})[_0x938c('0x16')](function(_0x5b5858){logger[_0x938c('0x12')](_0x938c('0xd'),_0x332b40,_0x5b5858);_0x4aa9a5(_0x5b5858);});});} \ No newline at end of file +var _0xfc75=['rpc','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','VoiceContext,\x20%s,\x20%s','message','result','lodash','util','moment','bluebird','randomstring','../../config/utils'];(function(_0x1ef6b9,_0x1d26e9){var _0x535323=function(_0x587f54){while(--_0x587f54){_0x1ef6b9['push'](_0x1ef6b9['shift']());}};_0x535323(++_0x1d26e9);}(_0xfc75,0xe1));var _0x5fc7=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0xfc75[_0x2c91e9];return _0x13f0ff;};'use strict';var _=require(_0x5fc7('0x0'));var util=require(_0x5fc7('0x1'));var moment=require(_0x5fc7('0x2'));var BPromise=require(_0x5fc7('0x3'));var rs=require(_0x5fc7('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x5fc7('0x5'));var logger=require('../../config/logger')(_0x5fc7('0x6'));var config=require(_0x5fc7('0x7'));var jayson=require(_0x5fc7('0x8'));var client=jayson[_0x5fc7('0x9')][_0x5fc7('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x503eaa,_0x2385ad,_0x56f284){return new BPromise(function(_0x1bb845,_0x4828fd){return client['request'](_0x503eaa,_0x56f284)[_0x5fc7('0xb')](function(_0x5d30b9){logger[_0x5fc7('0xc')]('VoiceContext,\x20%s,\x20%s',_0x2385ad,_0x5fc7('0xd'));logger[_0x5fc7('0xe')](_0x5fc7('0xf'),_0x2385ad,'request\x20sent',JSON[_0x5fc7('0x10')](_0x5d30b9));if(_0x5d30b9[_0x5fc7('0x11')]){if(_0x5d30b9[_0x5fc7('0x11')]['code']===0x1f4){logger[_0x5fc7('0x11')](_0x5fc7('0x12'),_0x2385ad,_0x5d30b9[_0x5fc7('0x11')][_0x5fc7('0x13')]);return _0x4828fd(_0x5d30b9['error']['message']);}logger['error']('VoiceContext,\x20%s,\x20%s',_0x2385ad,_0x5d30b9[_0x5fc7('0x11')][_0x5fc7('0x13')]);return _0x1bb845(_0x5d30b9[_0x5fc7('0x11')][_0x5fc7('0x13')]);}else{logger['info'](_0x5fc7('0x12'),_0x2385ad,_0x5fc7('0xd'));_0x1bb845(_0x5d30b9[_0x5fc7('0x14')][_0x5fc7('0x13')]);}})['catch'](function(_0x188101){logger[_0x5fc7('0x11')]('VoiceContext,\x20%s,\x20%s',_0x2385ad,_0x188101);_0x4828fd(_0x188101);});});} \ No newline at end of file diff --git a/server/api/voiceDialReport/index.js b/server/api/voiceDialReport/index.js index 38b57bf..f94d973 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 _0x3d09=['../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceDialReport.controller','get','isAuthenticated','index','/describe','post','create','/:id','update','delete','exports','multer','path','Router','fs-extra'];(function(_0x5bd880,_0x55c4da){var _0x4c9674=function(_0x19ebdd){while(--_0x19ebdd){_0x5bd880['push'](_0x5bd880['shift']());}};_0x4c9674(++_0x55c4da);}(_0x3d09,0x8c));var _0x93d0=function(_0x2e2d8e,_0x2cc01c){_0x2e2d8e=_0x2e2d8e-0x0;var _0x5b2612=_0x3d09[_0x2e2d8e];return _0x5b2612;};'use strict';var multer=require(_0x93d0('0x0'));var util=require('util');var path=require(_0x93d0('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x93d0('0x2')]();var fs_extra=require(_0x93d0('0x3'));var auth=require(_0x93d0('0x4'));var interaction=require(_0x93d0('0x5'));var config=require(_0x93d0('0x6'));var controller=require(_0x93d0('0x7'));router[_0x93d0('0x8')]('/',auth[_0x93d0('0x9')](),controller[_0x93d0('0xa')]);router[_0x93d0('0x8')](_0x93d0('0xb'),auth[_0x93d0('0x9')](),controller['describe']);router[_0x93d0('0x8')]('/:id',auth[_0x93d0('0x9')](),controller['show']);router[_0x93d0('0xc')]('/',auth[_0x93d0('0x9')](),controller[_0x93d0('0xd')]);router['put'](_0x93d0('0xe'),auth[_0x93d0('0x9')](),controller[_0x93d0('0xf')]);router[_0x93d0('0x10')](_0x93d0('0xe'),auth['isAuthenticated'](),controller['destroy']);module[_0x93d0('0x11')]=router; \ No newline at end of file +var _0x6de8=['describe','/:id','show','put','update','delete','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceDialReport.controller','get','isAuthenticated'];(function(_0x481a77,_0x46c959){var _0x1d82bc=function(_0x36084a){while(--_0x36084a){_0x481a77['push'](_0x481a77['shift']());}};_0x1d82bc(++_0x46c959);}(_0x6de8,0x126));var _0x86de=function(_0x725b8e,_0xc22b48){_0x725b8e=_0x725b8e-0x0;var _0x43ac45=_0x6de8[_0x725b8e];return _0x43ac45;};'use strict';var multer=require('multer');var util=require(_0x86de('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x86de('0x1'));var router=express[_0x86de('0x2')]();var fs_extra=require(_0x86de('0x3'));var auth=require(_0x86de('0x4'));var interaction=require(_0x86de('0x5'));var config=require(_0x86de('0x6'));var controller=require(_0x86de('0x7'));router[_0x86de('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x86de('0x8')]('/describe',auth[_0x86de('0x9')](),controller[_0x86de('0xa')]);router['get'](_0x86de('0xb'),auth[_0x86de('0x9')](),controller[_0x86de('0xc')]);router['post']('/',auth[_0x86de('0x9')](),controller['create']);router[_0x86de('0xd')](_0x86de('0xb'),auth[_0x86de('0x9')](),controller[_0x86de('0xe')]);router[_0x86de('0xf')](_0x86de('0xb'),auth['isAuthenticated'](),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 d2c0e92..ce8d114 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 _0xdace=['DATE','called,connect,complete','sequelize','STRING','INTEGER'];(function(_0x1a1f82,_0x16e88b){var _0x152427=function(_0xcddcba){while(--_0xcddcba){_0x1a1f82['push'](_0x1a1f82['shift']());}};_0x152427(++_0x16e88b);}(_0xdace,0xc5));var _0xedac=function(_0x5311e8,_0x57c5bb){_0x5311e8=_0x5311e8-0x0;var _0x582ad8=_0xdace[_0x5311e8];return _0x582ad8;};'use strict';var Sequelize=require(_0xedac('0x0'));module['exports']={'privilege':{'type':Sequelize[_0xedac('0x1')]},'channel':{'type':Sequelize[_0xedac('0x1')]},'channelstate':{'type':Sequelize[_0xedac('0x2')]},'channelstatedesc':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xedac('0x1')]},'calleridname':{'type':Sequelize[_0xedac('0x1')]},'connectedlinenum':{'type':Sequelize[_0xedac('0x1')]},'connectedlinename':{'type':Sequelize[_0xedac('0x1')]},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0xedac('0x1')]},'context':{'type':Sequelize[_0xedac('0x1')]},'exten':{'type':Sequelize[_0xedac('0x1')]},'priority':{'type':Sequelize['INTEGER']},'uniqueid':{'type':Sequelize[_0xedac('0x1')]},'linkedid':{'type':Sequelize[_0xedac('0x1')]},'destchannel':{'type':Sequelize[_0xedac('0x1')]},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize[_0xedac('0x1')]},'destcalleridnum':{'type':Sequelize[_0xedac('0x1')]},'destcalleridname':{'type':Sequelize[_0xedac('0x1')]},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize[_0xedac('0x1')]},'destaccountcode':{'type':Sequelize[_0xedac('0x1')]},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize[_0xedac('0x2')]},'destuniqueid':{'type':Sequelize[_0xedac('0x1')]},'destlinkedid':{'type':Sequelize['STRING']},'dialstring':{'type':Sequelize[_0xedac('0x1')]},'dialstatus':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0xedac('0x3')]},'answertime':{'type':Sequelize[_0xedac('0x3')]},'endtime':{'type':Sequelize[_0xedac('0x3')]},'lastevent':{'type':Sequelize[_0xedac('0x1')],'comment':_0xedac('0x4')},'routeId':{'type':Sequelize[_0xedac('0x2')]},'duration':{'type':Sequelize[_0xedac('0x2')]},'holdtime':{'type':Sequelize[_0xedac('0x2')]},'billableseconds':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x8d0e=['INTEGER','DATE','called,connect,complete','sequelize','exports','STRING'];(function(_0x2addd5,_0x171b92){var _0x1c5745=function(_0x1911cf){while(--_0x1911cf){_0x2addd5['push'](_0x2addd5['shift']());}};_0x1c5745(++_0x171b92);}(_0x8d0e,0x1d7));var _0xe8d0=function(_0x5ed2bb,_0x5ad585){_0x5ed2bb=_0x5ed2bb-0x0;var _0x4d4c12=_0x8d0e[_0x5ed2bb];return _0x4d4c12;};'use strict';var Sequelize=require(_0xe8d0('0x0'));module[_0xe8d0('0x1')]={'privilege':{'type':Sequelize[_0xe8d0('0x2')]},'channel':{'type':Sequelize[_0xe8d0('0x2')]},'channelstate':{'type':Sequelize[_0xe8d0('0x3')]},'channelstatedesc':{'type':Sequelize[_0xe8d0('0x2')]},'calleridnum':{'type':Sequelize[_0xe8d0('0x2')]},'calleridname':{'type':Sequelize[_0xe8d0('0x2')]},'connectedlinenum':{'type':Sequelize[_0xe8d0('0x2')]},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0xe8d0('0x2')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0xe8d0('0x2')]},'priority':{'type':Sequelize[_0xe8d0('0x3')]},'uniqueid':{'type':Sequelize[_0xe8d0('0x2')]},'linkedid':{'type':Sequelize[_0xe8d0('0x2')]},'destchannel':{'type':Sequelize[_0xe8d0('0x2')]},'destchannelstate':{'type':Sequelize[_0xe8d0('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0xe8d0('0x2')]},'destcalleridnum':{'type':Sequelize[_0xe8d0('0x2')]},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0xe8d0('0x2')]},'destconnectedlinename':{'type':Sequelize[_0xe8d0('0x2')]},'destlanguage':{'type':Sequelize[_0xe8d0('0x2')]},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize[_0xe8d0('0x2')]},'destpriority':{'type':Sequelize[_0xe8d0('0x3')]},'destuniqueid':{'type':Sequelize[_0xe8d0('0x2')]},'destlinkedid':{'type':Sequelize[_0xe8d0('0x2')]},'dialstring':{'type':Sequelize[_0xe8d0('0x2')]},'dialstatus':{'type':Sequelize[_0xe8d0('0x2')]},'starttime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0xe8d0('0x4')]},'endtime':{'type':Sequelize[_0xe8d0('0x4')]},'lastevent':{'type':Sequelize['STRING'],'comment':_0xe8d0('0x5')},'routeId':{'type':Sequelize['INTEGER']},'duration':{'type':Sequelize['INTEGER']},'holdtime':{'type':Sequelize[_0xe8d0('0x3')]},'billableseconds':{'type':Sequelize[_0xe8d0('0x3')]}}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.controller.js b/server/api/voiceDialReport/voiceDialReport.controller.js index d41dc18..f9bcd52 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 _0xc3c6=['limit','set','reject','save','then','end','stack','name','send','index','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','VoiceDialReport','includeAll','include','findAll','catch','show','params','keys','rawAttributes','length','options','find','create','body','destroy','describe','rimraf','zip-dir','request-promise','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','../../config/logger','api','../../config/utils','sendStatus','status','json','undefined','offset','count'];(function(_0x14ba4d,_0x27c2ab){var _0x395801=function(_0x344843){while(--_0x344843){_0x14ba4d['push'](_0x14ba4d['shift']());}};_0x395801(++_0x27c2ab);}(_0xc3c6,0x1dc));var _0x6c3c=function(_0xb195,_0x2d4aa7){_0xb195=_0xb195-0x0;var _0x14fc76=_0xc3c6[_0xb195];return _0x14fc76;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6c3c('0x0'));var zipdir=require(_0x6c3c('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6c3c('0x2'));var moment=require('moment');var BPromise=require(_0x6c3c('0x3'));var Mustache=require(_0x6c3c('0x4'));var util=require(_0x6c3c('0x5'));var path=require(_0x6c3c('0x6'));var sox=require(_0x6c3c('0x7'));var csv=require(_0x6c3c('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6c3c('0x9'));var _=require(_0x6c3c('0xa'));var squel=require(_0x6c3c('0xb'));var crypto=require(_0x6c3c('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x6c3c('0xd'));var toCsv=require(_0x6c3c('0x8'));var querystring=require(_0x6c3c('0xe'));var Papa=require(_0x6c3c('0xf'));var Redis=require('ioredis');var authService=require(_0x6c3c('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x6c3c('0x11'));var hardwareService=require(_0x6c3c('0x12'));var logger=require(_0x6c3c('0x13'))(_0x6c3c('0x14'));var utils=require(_0x6c3c('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x501694,_0x56a592){_0x56a592=_0x56a592||0xcc;return function(_0x2096bd){if(_0x2096bd){return _0x501694[_0x6c3c('0x16')](_0x56a592);}return _0x501694[_0x6c3c('0x17')](_0x56a592)['end']();};}function respondWithResult(_0x57298f,_0x2c2bb5){_0x2c2bb5=_0x2c2bb5||0xc8;return function(_0x491980){if(_0x491980){return _0x57298f[_0x6c3c('0x17')](_0x2c2bb5)[_0x6c3c('0x18')](_0x491980);}};}function respondWithFilteredResult(_0x4d9a8a,_0x592613){return function(_0x46b963){if(_0x46b963){var _0x354c2e=typeof _0x592613['offset']==='undefined'&&typeof _0x592613['limit']===_0x6c3c('0x19');var _0x50d538=_0x46b963['count'];var _0x3dc7fa=_0x354c2e?0x0:_0x592613[_0x6c3c('0x1a')];var _0x131bb7=_0x354c2e?_0x46b963[_0x6c3c('0x1b')]:_0x592613[_0x6c3c('0x1a')]+_0x592613[_0x6c3c('0x1c')];var _0x2ad706;if(_0x131bb7>=_0x50d538){_0x131bb7=_0x50d538;_0x2ad706=0xc8;}else{_0x2ad706=0xce;}_0x4d9a8a[_0x6c3c('0x17')](_0x2ad706);return _0x4d9a8a[_0x6c3c('0x1d')]('Content-Range',_0x3dc7fa+'-'+_0x131bb7+'/'+_0x50d538)[_0x6c3c('0x18')](_0x46b963);}return null;};}function patchUpdates(_0x115f9b){return function(_0x51ee0c){try{jsonpatch['apply'](_0x51ee0c,_0x115f9b,!![]);}catch(_0x2b2ce7){return BPromise[_0x6c3c('0x1e')](_0x2b2ce7);}return _0x51ee0c[_0x6c3c('0x1f')]();};}function saveUpdates(_0x214e1f,_0x308100){return function(_0x4defe6){if(_0x4defe6){return _0x4defe6['update'](_0x214e1f)[_0x6c3c('0x20')](function(_0x480703){return _0x480703;});}return null;};}function removeEntity(_0x247f5a,_0x44fa16){return function(_0x5b25d0){if(_0x5b25d0){return _0x5b25d0['destroy']()['then'](function(){_0x247f5a[_0x6c3c('0x17')](0xcc)[_0x6c3c('0x21')]();});}};}function handleEntityNotFound(_0xe49cd,_0x32ad7d){return function(_0x455194){if(!_0x455194){_0xe49cd[_0x6c3c('0x16')](0x194);}return _0x455194;};}function handleError(_0x1c8433,_0x37870b){_0x37870b=_0x37870b||0x1f4;return function(_0x52b24a){logger['error'](_0x52b24a[_0x6c3c('0x22')]);if(_0x52b24a['name']){delete _0x52b24a[_0x6c3c('0x23')];}_0x1c8433['status'](_0x37870b)[_0x6c3c('0x24')](_0x52b24a);};}exports[_0x6c3c('0x25')]=function(_0x25022e,_0x45b68c){var _0x4e3f2a={},_0x302889={},_0x413810={'count':0x0,'rows':[]};var _0x24ec12=_['map'](db['VoiceDialReport']['rawAttributes'],function(_0x61adfb){return{'name':_0x61adfb[_0x6c3c('0x26')],'type':_0x61adfb[_0x6c3c('0x27')][_0x6c3c('0x28')]};});_0x302889[_0x6c3c('0x29')]=_[_0x6c3c('0x2a')](_0x24ec12,_0x6c3c('0x23'));_0x302889[_0x6c3c('0x2b')]=_['keys'](_0x25022e['query']);_0x302889[_0x6c3c('0x2c')]=_[_0x6c3c('0x2d')](_0x302889[_0x6c3c('0x29')],_0x302889[_0x6c3c('0x2b')]);_0x4e3f2a[_0x6c3c('0x2e')]=_[_0x6c3c('0x2d')](_0x302889[_0x6c3c('0x29')],qs[_0x6c3c('0x2f')](_0x25022e[_0x6c3c('0x2b')][_0x6c3c('0x2f')]));_0x4e3f2a['attributes']=_0x4e3f2a[_0x6c3c('0x2e')]['length']?_0x4e3f2a[_0x6c3c('0x2e')]:_0x302889['model'];if(!_0x25022e[_0x6c3c('0x2b')][_0x6c3c('0x30')](_0x6c3c('0x31'))){_0x4e3f2a[_0x6c3c('0x1c')]=qs[_0x6c3c('0x1c')](_0x25022e[_0x6c3c('0x2b')]['limit']);_0x4e3f2a[_0x6c3c('0x1a')]=qs[_0x6c3c('0x1a')](_0x25022e[_0x6c3c('0x2b')][_0x6c3c('0x1a')]);}_0x4e3f2a['order']=qs[_0x6c3c('0x32')](_0x25022e['query'][_0x6c3c('0x32')]);_0x4e3f2a[_0x6c3c('0x33')]=qs[_0x6c3c('0x2c')](_[_0x6c3c('0x34')](_0x25022e[_0x6c3c('0x2b')],_0x302889[_0x6c3c('0x2c')]),_0x24ec12);if(_0x25022e[_0x6c3c('0x2b')][_0x6c3c('0x35')]){_0x4e3f2a[_0x6c3c('0x33')]=_[_0x6c3c('0x36')](_0x4e3f2a[_0x6c3c('0x33')],{'$or':_[_0x6c3c('0x2a')](_0x24ec12,function(_0x48e187){if(_0x48e187[_0x6c3c('0x27')]!==_0x6c3c('0x37')){var _0x111e2b={};_0x111e2b[_0x48e187[_0x6c3c('0x23')]]={'$like':'%'+_0x25022e[_0x6c3c('0x2b')][_0x6c3c('0x35')]+'%'};return _0x111e2b;}})});}_0x4e3f2a=_[_0x6c3c('0x36')]({},_0x4e3f2a,_0x25022e['options']);var _0x1ff5ad={'where':_0x4e3f2a[_0x6c3c('0x33')]};return db[_0x6c3c('0x38')][_0x6c3c('0x1b')](_0x1ff5ad)[_0x6c3c('0x20')](function(_0x3410cc){_0x413810[_0x6c3c('0x1b')]=_0x3410cc;if(_0x25022e[_0x6c3c('0x2b')][_0x6c3c('0x39')]){_0x4e3f2a[_0x6c3c('0x3a')]=[{'all':!![]}];}return db[_0x6c3c('0x38')][_0x6c3c('0x3b')](_0x4e3f2a);})[_0x6c3c('0x20')](function(_0x31cf21){_0x413810['rows']=_0x31cf21;return _0x413810;})[_0x6c3c('0x20')](respondWithFilteredResult(_0x45b68c,_0x4e3f2a))[_0x6c3c('0x3c')](handleError(_0x45b68c,null));};exports[_0x6c3c('0x3d')]=function(_0x139a09,_0x13a3b1){var _0x93cecf={'raw':!![],'where':{'id':_0x139a09[_0x6c3c('0x3e')]['id']}},_0x258788={};_0x258788[_0x6c3c('0x29')]=_[_0x6c3c('0x3f')](db[_0x6c3c('0x38')][_0x6c3c('0x40')]);_0x258788[_0x6c3c('0x2b')]=_[_0x6c3c('0x3f')](_0x139a09[_0x6c3c('0x2b')]);_0x258788['filters']=_[_0x6c3c('0x2d')](_0x258788['model'],_0x258788[_0x6c3c('0x2b')]);_0x93cecf[_0x6c3c('0x2e')]=_[_0x6c3c('0x2d')](_0x258788[_0x6c3c('0x29')],qs[_0x6c3c('0x2f')](_0x139a09[_0x6c3c('0x2b')]['fields']));_0x93cecf[_0x6c3c('0x2e')]=_0x93cecf[_0x6c3c('0x2e')][_0x6c3c('0x41')]?_0x93cecf[_0x6c3c('0x2e')]:_0x258788[_0x6c3c('0x29')];if(_0x139a09['query'][_0x6c3c('0x39')]){_0x93cecf[_0x6c3c('0x3a')]=[{'all':!![]}];}_0x93cecf=_['merge']({},_0x93cecf,_0x139a09[_0x6c3c('0x42')]);return db[_0x6c3c('0x38')][_0x6c3c('0x43')](_0x93cecf)['then'](handleEntityNotFound(_0x13a3b1,null))[_0x6c3c('0x20')](respondWithResult(_0x13a3b1,null))[_0x6c3c('0x3c')](handleError(_0x13a3b1,null));};exports['create']=function(_0x3b91d6,_0x3ffbf9){return db[_0x6c3c('0x38')][_0x6c3c('0x44')](_0x3b91d6[_0x6c3c('0x45')],{})[_0x6c3c('0x20')](respondWithResult(_0x3ffbf9,0xc9))[_0x6c3c('0x3c')](handleError(_0x3ffbf9,null));};exports['update']=function(_0x56f576,_0x8d3e7a){if(_0x56f576[_0x6c3c('0x45')]['id']){delete _0x56f576[_0x6c3c('0x45')]['id'];}return db[_0x6c3c('0x38')][_0x6c3c('0x43')]({'where':{'id':_0x56f576[_0x6c3c('0x3e')]['id']}})['then'](handleEntityNotFound(_0x8d3e7a,null))[_0x6c3c('0x20')](saveUpdates(_0x56f576[_0x6c3c('0x45')],null))[_0x6c3c('0x20')](respondWithResult(_0x8d3e7a,null))[_0x6c3c('0x3c')](handleError(_0x8d3e7a,null));};exports[_0x6c3c('0x46')]=function(_0x57045e,_0x5d14e1){return db[_0x6c3c('0x38')]['find']({'where':{'id':_0x57045e[_0x6c3c('0x3e')]['id']}})[_0x6c3c('0x20')](handleEntityNotFound(_0x5d14e1,null))['then'](removeEntity(_0x5d14e1,null))[_0x6c3c('0x3c')](handleError(_0x5d14e1,null));};exports[_0x6c3c('0x47')]=function(_0x2f7e17,_0x2b8dc6){return db[_0x6c3c('0x38')][_0x6c3c('0x47')]()[_0x6c3c('0x20')](respondWithResult(_0x2b8dc6,null))[_0x6c3c('0x3c')](handleError(_0x2b8dc6,null));}; \ No newline at end of file +var _0xf72e=['rows','catch','show','find','create','body','params','describe','eml-format','rimraf','zip-dir','request-promise','mustache','util','sox','to-csv','fs-extra','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','apply','save','update','then','destroy','stack','name','send','index','map','VoiceDialReport','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','filters','filter','merge','where','type','options','includeAll','include','findAll'];(function(_0x2ec461,_0x5f588a){var _0x28603d=function(_0x21114b){while(--_0x21114b){_0x2ec461['push'](_0x2ec461['shift']());}};_0x28603d(++_0x5f588a);}(_0xf72e,0x9c));var _0xef72=function(_0x2c9c4d,_0x174bcd){_0x2c9c4d=_0x2c9c4d-0x0;var _0x39660e=_0xf72e[_0x2c9c4d];return _0x39660e;};'use strict';var emlformat=require(_0xef72('0x0'));var rimraf=require(_0xef72('0x1'));var zipdir=require(_0xef72('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xef72('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xef72('0x4'));var util=require(_0xef72('0x5'));var path=require('path');var sox=require(_0xef72('0x6'));var csv=require(_0xef72('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xef72('0x8'));var _=require(_0xef72('0x9'));var squel=require(_0xef72('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xef72('0xb'));var toCsv=require(_0xef72('0x7'));var querystring=require(_0xef72('0xc'));var Papa=require(_0xef72('0xd'));var Redis=require(_0xef72('0xe'));var authService=require(_0xef72('0xf'));var qs=require(_0xef72('0x10'));var as=require(_0xef72('0x11'));var hardwareService=require(_0xef72('0x12'));var logger=require(_0xef72('0x13'))(_0xef72('0x14'));var utils=require(_0xef72('0x15'));var config=require(_0xef72('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x34e17e,_0x34f44a){_0x34f44a=_0x34f44a||0xcc;return function(_0x24c3ff){if(_0x24c3ff){return _0x34e17e[_0xef72('0x17')](_0x34f44a);}return _0x34e17e[_0xef72('0x18')](_0x34f44a)[_0xef72('0x19')]();};}function respondWithResult(_0xdb6f50,_0x4c3d42){_0x4c3d42=_0x4c3d42||0xc8;return function(_0x218728){if(_0x218728){return _0xdb6f50[_0xef72('0x18')](_0x4c3d42)['json'](_0x218728);}};}function respondWithFilteredResult(_0x2de493,_0x4f09ae){return function(_0x334080){if(_0x334080){var _0x4b182a=typeof _0x4f09ae[_0xef72('0x1a')]===_0xef72('0x1b')&&typeof _0x4f09ae['limit']===_0xef72('0x1b');var _0x49057d=_0x334080[_0xef72('0x1c')];var _0x4d0e8b=_0x4b182a?0x0:_0x4f09ae['offset'];var _0x1a3cad=_0x4b182a?_0x334080[_0xef72('0x1c')]:_0x4f09ae[_0xef72('0x1a')]+_0x4f09ae[_0xef72('0x1d')];var _0x4413c2;if(_0x1a3cad>=_0x49057d){_0x1a3cad=_0x49057d;_0x4413c2=0xc8;}else{_0x4413c2=0xce;}_0x2de493[_0xef72('0x18')](_0x4413c2);return _0x2de493[_0xef72('0x1e')](_0xef72('0x1f'),_0x4d0e8b+'-'+_0x1a3cad+'/'+_0x49057d)['json'](_0x334080);}return null;};}function patchUpdates(_0x364fa0){return function(_0x3383ac){try{jsonpatch[_0xef72('0x20')](_0x3383ac,_0x364fa0,!![]);}catch(_0x465f16){return BPromise['reject'](_0x465f16);}return _0x3383ac[_0xef72('0x21')]();};}function saveUpdates(_0x33dff4,_0x5ec566){return function(_0x416bdc){if(_0x416bdc){return _0x416bdc[_0xef72('0x22')](_0x33dff4)[_0xef72('0x23')](function(_0x5e06b1){return _0x5e06b1;});}return null;};}function removeEntity(_0x2fc8c2,_0x19ef23){return function(_0x40204e){if(_0x40204e){return _0x40204e[_0xef72('0x24')]()['then'](function(){_0x2fc8c2[_0xef72('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3fea74,_0x5222b5){return function(_0x4774f5){if(!_0x4774f5){_0x3fea74['sendStatus'](0x194);}return _0x4774f5;};}function handleError(_0x4a515b,_0x426481){_0x426481=_0x426481||0x1f4;return function(_0x5132fc){logger['error'](_0x5132fc[_0xef72('0x25')]);if(_0x5132fc['name']){delete _0x5132fc[_0xef72('0x26')];}_0x4a515b[_0xef72('0x18')](_0x426481)[_0xef72('0x27')](_0x5132fc);};}exports[_0xef72('0x28')]=function(_0x23ccf0,_0x5883d6){var _0x31b38d={},_0x5f2a52={},_0x349d78={'count':0x0,'rows':[]};var _0x974a62=_[_0xef72('0x29')](db[_0xef72('0x2a')][_0xef72('0x2b')],function(_0x357b84){return{'name':_0x357b84[_0xef72('0x2c')],'type':_0x357b84['type'][_0xef72('0x2d')]};});_0x5f2a52[_0xef72('0x2e')]=_[_0xef72('0x29')](_0x974a62,_0xef72('0x26'));_0x5f2a52[_0xef72('0x2f')]=_[_0xef72('0x30')](_0x23ccf0[_0xef72('0x2f')]);_0x5f2a52['filters']=_[_0xef72('0x31')](_0x5f2a52[_0xef72('0x2e')],_0x5f2a52['query']);_0x31b38d[_0xef72('0x32')]=_[_0xef72('0x31')](_0x5f2a52['model'],qs[_0xef72('0x33')](_0x23ccf0[_0xef72('0x2f')][_0xef72('0x33')]));_0x31b38d[_0xef72('0x32')]=_0x31b38d['attributes'][_0xef72('0x34')]?_0x31b38d[_0xef72('0x32')]:_0x5f2a52[_0xef72('0x2e')];if(!_0x23ccf0[_0xef72('0x2f')][_0xef72('0x35')]('nolimit')){_0x31b38d[_0xef72('0x1d')]=qs[_0xef72('0x1d')](_0x23ccf0['query'][_0xef72('0x1d')]);_0x31b38d[_0xef72('0x1a')]=qs['offset'](_0x23ccf0['query'][_0xef72('0x1a')]);}_0x31b38d[_0xef72('0x36')]=qs['sort'](_0x23ccf0[_0xef72('0x2f')][_0xef72('0x37')]);_0x31b38d['where']=qs['filters'](_[_0xef72('0x38')](_0x23ccf0['query'],_0x5f2a52[_0xef72('0x39')]),_0x974a62);if(_0x23ccf0[_0xef72('0x2f')][_0xef72('0x3a')]){_0x31b38d['where']=_[_0xef72('0x3b')](_0x31b38d[_0xef72('0x3c')],{'$or':_[_0xef72('0x29')](_0x974a62,function(_0x3aac87){if(_0x3aac87[_0xef72('0x3d')]!=='VIRTUAL'){var _0x4d5bd0={};_0x4d5bd0[_0x3aac87['name']]={'$like':'%'+_0x23ccf0[_0xef72('0x2f')][_0xef72('0x3a')]+'%'};return _0x4d5bd0;}})});}_0x31b38d=_[_0xef72('0x3b')]({},_0x31b38d,_0x23ccf0[_0xef72('0x3e')]);var _0x263477={'where':_0x31b38d[_0xef72('0x3c')]};return db[_0xef72('0x2a')][_0xef72('0x1c')](_0x263477)[_0xef72('0x23')](function(_0x2f8c66){_0x349d78['count']=_0x2f8c66;if(_0x23ccf0[_0xef72('0x2f')][_0xef72('0x3f')]){_0x31b38d[_0xef72('0x40')]=[{'all':!![]}];}return db['VoiceDialReport'][_0xef72('0x41')](_0x31b38d);})['then'](function(_0x5d9ed3){_0x349d78[_0xef72('0x42')]=_0x5d9ed3;return _0x349d78;})[_0xef72('0x23')](respondWithFilteredResult(_0x5883d6,_0x31b38d))[_0xef72('0x43')](handleError(_0x5883d6,null));};exports[_0xef72('0x44')]=function(_0x2e6c89,_0x570f02){var _0x13dcc4={'raw':!![],'where':{'id':_0x2e6c89['params']['id']}},_0x30cf54={};_0x30cf54[_0xef72('0x2e')]=_[_0xef72('0x30')](db['VoiceDialReport'][_0xef72('0x2b')]);_0x30cf54[_0xef72('0x2f')]=_[_0xef72('0x30')](_0x2e6c89[_0xef72('0x2f')]);_0x30cf54[_0xef72('0x39')]=_[_0xef72('0x31')](_0x30cf54[_0xef72('0x2e')],_0x30cf54['query']);_0x13dcc4[_0xef72('0x32')]=_[_0xef72('0x31')](_0x30cf54[_0xef72('0x2e')],qs[_0xef72('0x33')](_0x2e6c89[_0xef72('0x2f')][_0xef72('0x33')]));_0x13dcc4[_0xef72('0x32')]=_0x13dcc4[_0xef72('0x32')][_0xef72('0x34')]?_0x13dcc4['attributes']:_0x30cf54[_0xef72('0x2e')];if(_0x2e6c89[_0xef72('0x2f')]['includeAll']){_0x13dcc4[_0xef72('0x40')]=[{'all':!![]}];}_0x13dcc4=_[_0xef72('0x3b')]({},_0x13dcc4,_0x2e6c89[_0xef72('0x3e')]);return db['VoiceDialReport'][_0xef72('0x45')](_0x13dcc4)[_0xef72('0x23')](handleEntityNotFound(_0x570f02,null))[_0xef72('0x23')](respondWithResult(_0x570f02,null))[_0xef72('0x43')](handleError(_0x570f02,null));};exports[_0xef72('0x46')]=function(_0x4d0176,_0x252834){return db[_0xef72('0x2a')][_0xef72('0x46')](_0x4d0176[_0xef72('0x47')],{})[_0xef72('0x23')](respondWithResult(_0x252834,0xc9))['catch'](handleError(_0x252834,null));};exports[_0xef72('0x22')]=function(_0xa1319b,_0x45d010){if(_0xa1319b[_0xef72('0x47')]['id']){delete _0xa1319b[_0xef72('0x47')]['id'];}return db[_0xef72('0x2a')][_0xef72('0x45')]({'where':{'id':_0xa1319b[_0xef72('0x48')]['id']}})[_0xef72('0x23')](handleEntityNotFound(_0x45d010,null))['then'](saveUpdates(_0xa1319b[_0xef72('0x47')],null))[_0xef72('0x23')](respondWithResult(_0x45d010,null))[_0xef72('0x43')](handleError(_0x45d010,null));};exports[_0xef72('0x24')]=function(_0x4fbd19,_0x40fbb6){return db[_0xef72('0x2a')][_0xef72('0x45')]({'where':{'id':_0x4fbd19['params']['id']}})[_0xef72('0x23')](handleEntityNotFound(_0x40fbb6,null))[_0xef72('0x23')](removeEntity(_0x40fbb6,null))['catch'](handleError(_0x40fbb6,null));};exports[_0xef72('0x49')]=function(_0x278e0b,_0xcc59cf){return db[_0xef72('0x2a')]['describe']()[_0xef72('0x23')](respondWithResult(_0xcc59cf,null))[_0xef72('0x43')](handleError(_0xcc59cf,null));}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.model.js b/server/api/voiceDialReport/voiceDialReport.model.js index 3eae28a..a33d12e 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 _0x65c2=['exports','define','VoiceDialReport','uniqueid','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf'];(function(_0x110dcf,_0x5cc131){var _0x265d6c=function(_0x485fac){while(--_0x485fac){_0x110dcf['push'](_0x110dcf['shift']());}};_0x265d6c(++_0x5cc131);}(_0x65c2,0x184));var _0x265c=function(_0x5d3ea9,_0x5a7d46){_0x5d3ea9=_0x5d3ea9-0x0;var _0x266357=_0x65c2[_0x5d3ea9];return _0x266357;};'use strict';var _=require(_0x265c('0x0'));var util=require(_0x265c('0x1'));var logger=require(_0x265c('0x2'))(_0x265c('0x3'));var moment=require(_0x265c('0x4'));var BPromise=require('bluebird');var rp=require(_0x265c('0x5'));var fs=require('fs');var path=require(_0x265c('0x6'));var rimraf=require(_0x265c('0x7'));var config=require('../../config/environment');var attributes=require('./voiceDialReport.attributes');module[_0x265c('0x8')]=function(_0xdd9b8,_0x2003b2){return _0xdd9b8[_0x265c('0x9')](_0x265c('0xa'),attributes,{'tableName':'report_dial','paranoid':![],'indexes':[{'fields':[_0x265c('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xf1b6=['uniqueid','util','api','moment','bluebird','request-promise','path','../../config/environment','./voiceDialReport.attributes','exports','define','VoiceDialReport','report_dial'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0xf1b6,0xd1));var _0x6f1b=function(_0x5dafd3,_0x2ecb17){_0x5dafd3=_0x5dafd3-0x0;var _0x40363f=_0xf1b6[_0x5dafd3];return _0x40363f;};'use strict';var _=require('lodash');var util=require(_0x6f1b('0x0'));var logger=require('../../config/logger')(_0x6f1b('0x1'));var moment=require(_0x6f1b('0x2'));var BPromise=require(_0x6f1b('0x3'));var rp=require(_0x6f1b('0x4'));var fs=require('fs');var path=require(_0x6f1b('0x5'));var rimraf=require('rimraf');var config=require(_0x6f1b('0x6'));var attributes=require(_0x6f1b('0x7'));module[_0x6f1b('0x8')]=function(_0x25425d,_0x29734c){return _0x25425d[_0x6f1b('0x9')](_0x6f1b('0xa'),attributes,{'tableName':_0x6f1b('0xb'),'paranoid':![],'indexes':[{'fields':[_0x6f1b('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.rpc.js b/server/api/voiceDialReport/voiceDialReport.rpc.js index 8ebbbcd..873266f 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 _0x3752=['VoiceDialReport,\x20%s,\x20%s','info','result','catch','CreateVoiceDialReport','VoiceDialReport','body','options','UpdateVoiceDialReport','where','attributes','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','debug','VoiceDialReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message'];(function(_0x3806d3,_0x766c44){var _0x650eff=function(_0x1a5a08){while(--_0x1a5a08){_0x3806d3['push'](_0x3806d3['shift']());}};_0x650eff(++_0x766c44);}(_0x3752,0x87));var _0x2375=function(_0x251fa8,_0x438d42){_0x251fa8=_0x251fa8-0x0;var _0x3d89e9=_0x3752[_0x251fa8];return _0x3d89e9;};'use strict';var _=require(_0x2375('0x0'));var util=require(_0x2375('0x1'));var moment=require(_0x2375('0x2'));var BPromise=require(_0x2375('0x3'));var rs=require(_0x2375('0x4'));var fs=require('fs');var Redis=require(_0x2375('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x2375('0x6'));var logger=require(_0x2375('0x7'))(_0x2375('0x8'));var config=require(_0x2375('0x9'));var jayson=require(_0x2375('0xa'));var client=jayson['client'][_0x2375('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4eb6de,_0x4cd667,_0x2b3194){return new BPromise(function(_0x1b7eeb,_0x26353d){return client['request'](_0x4eb6de,_0x2b3194)[_0x2375('0xc')](function(_0x2ae4d7){logger['info']('VoiceDialReport,\x20%s,\x20%s',_0x4cd667,'request\x20sent');logger[_0x2375('0xd')](_0x2375('0xe'),_0x4cd667,_0x2375('0xf'),JSON[_0x2375('0x10')](_0x2ae4d7));if(_0x2ae4d7['error']){if(_0x2ae4d7['error'][_0x2375('0x11')]===0x1f4){logger[_0x2375('0x12')]('VoiceDialReport,\x20%s,\x20%s',_0x4cd667,_0x2ae4d7[_0x2375('0x12')]['message']);return _0x26353d(_0x2ae4d7['error'][_0x2375('0x13')]);}logger[_0x2375('0x12')](_0x2375('0x14'),_0x4cd667,_0x2ae4d7['error'][_0x2375('0x13')]);return _0x1b7eeb(_0x2ae4d7['error'][_0x2375('0x13')]);}else{logger[_0x2375('0x15')](_0x2375('0x14'),_0x4cd667,_0x2375('0xf'));_0x1b7eeb(_0x2ae4d7[_0x2375('0x16')][_0x2375('0x13')]);}})[_0x2375('0x17')](function(_0x3dfa3c){logger[_0x2375('0x12')](_0x2375('0x14'),_0x4cd667,_0x3dfa3c);_0x26353d(_0x3dfa3c);});});}exports[_0x2375('0x18')]=function(_0xb6f3c7){var _0x83ab25=this;return new Promise(function(_0x40640a,_0x4a1f29){return db[_0x2375('0x19')]['create'](_0xb6f3c7[_0x2375('0x1a')],{'raw':_0xb6f3c7[_0x2375('0x1b')]?_0xb6f3c7[_0x2375('0x1b')]['raw']===undefined?!![]:![]:!![]})[_0x2375('0xc')](function(_0x3d3529){logger[_0x2375('0x15')]('CreateVoiceDialReport',_0xb6f3c7);logger[_0x2375('0xd')](_0x2375('0x18'),_0xb6f3c7,JSON['stringify'](_0x3d3529));_0x40640a(_0x3d3529);})[_0x2375('0x17')](function(_0x2d1d29){logger[_0x2375('0x12')](_0x2375('0x18'),_0x2d1d29[_0x2375('0x13')],_0xb6f3c7);_0x4a1f29(_0x83ab25['error'](0x1f4,_0x2d1d29[_0x2375('0x13')]));});});};exports[_0x2375('0x1c')]=function(_0x2a5588){var _0x89bad=this;return new Promise(function(_0x26354c,_0x2bf77b){return db[_0x2375('0x19')]['update'](_0x2a5588[_0x2375('0x1a')],{'raw':_0x2a5588[_0x2375('0x1b')]?_0x2a5588['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2a5588['options']?_0x2a5588[_0x2375('0x1b')][_0x2375('0x1d')]||null:null,'attributes':_0x2a5588['options']?_0x2a5588[_0x2375('0x1b')][_0x2375('0x1e')]||null:null,'limit':_0x2a5588[_0x2375('0x1b')]?_0x2a5588[_0x2375('0x1b')]['limit']||null:null})[_0x2375('0xc')](function(_0x4e9e48){logger['info'](_0x2375('0x1c'),_0x2a5588);logger['debug'](_0x2375('0x1c'),_0x2a5588,JSON[_0x2375('0x10')](_0x4e9e48));_0x26354c(_0x4e9e48);})['catch'](function(_0x178bef){logger[_0x2375('0x12')](_0x2375('0x1c'),_0x178bef[_0x2375('0x13')],_0x2a5588);_0x2bf77b(_0x89bad[_0x2375('0x12')](0x1f4,_0x178bef[_0x2375('0x13')]));});});}; \ No newline at end of file +var _0x47de=['request\x20sent','VoiceDialReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateVoiceDialReport','options','raw','then','debug','UpdateVoiceDialReport','VoiceDialReport','update','body','where','attributes','limit','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','info','VoiceDialReport,\x20%s,\x20%s'];(function(_0x49b207,_0x408ade){var _0x2dc8fa=function(_0x150975){while(--_0x150975){_0x49b207['push'](_0x49b207['shift']());}};_0x2dc8fa(++_0x408ade);}(_0x47de,0x7a));var _0xe47d=function(_0xe3ded2,_0x5a3776){_0xe3ded2=_0xe3ded2-0x0;var _0x3eba2f=_0x47de[_0xe3ded2];return _0x3eba2f;};'use strict';var _=require(_0xe47d('0x0'));var util=require('util');var moment=require(_0xe47d('0x1'));var BPromise=require(_0xe47d('0x2'));var rs=require(_0xe47d('0x3'));var fs=require('fs');var Redis=require(_0xe47d('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xe47d('0x5'));var logger=require(_0xe47d('0x6'))(_0xe47d('0x7'));var config=require('../../config/environment');var jayson=require(_0xe47d('0x8'));var client=jayson[_0xe47d('0x9')][_0xe47d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5f5d8b,_0x45210d,_0x2a2ed9){return new BPromise(function(_0x1b3a4e,_0x3f918c){return client[_0xe47d('0xb')](_0x5f5d8b,_0x2a2ed9)['then'](function(_0x2d9bc6){logger[_0xe47d('0xc')](_0xe47d('0xd'),_0x45210d,_0xe47d('0xe'));logger['debug'](_0xe47d('0xf'),_0x45210d,_0xe47d('0xe'),JSON[_0xe47d('0x10')](_0x2d9bc6));if(_0x2d9bc6[_0xe47d('0x11')]){if(_0x2d9bc6[_0xe47d('0x11')][_0xe47d('0x12')]===0x1f4){logger['error'](_0xe47d('0xd'),_0x45210d,_0x2d9bc6[_0xe47d('0x11')][_0xe47d('0x13')]);return _0x3f918c(_0x2d9bc6[_0xe47d('0x11')][_0xe47d('0x13')]);}logger['error'](_0xe47d('0xd'),_0x45210d,_0x2d9bc6[_0xe47d('0x11')][_0xe47d('0x13')]);return _0x1b3a4e(_0x2d9bc6[_0xe47d('0x11')][_0xe47d('0x13')]);}else{logger['info'](_0xe47d('0xd'),_0x45210d,'request\x20sent');_0x1b3a4e(_0x2d9bc6[_0xe47d('0x14')][_0xe47d('0x13')]);}})[_0xe47d('0x15')](function(_0x35a366){logger['error'](_0xe47d('0xd'),_0x45210d,_0x35a366);_0x3f918c(_0x35a366);});});}exports[_0xe47d('0x16')]=function(_0x51e305){var _0x4a074c=this;return new Promise(function(_0x1db09c,_0x478960){return db['VoiceDialReport']['create'](_0x51e305['body'],{'raw':_0x51e305['options']?_0x51e305[_0xe47d('0x17')][_0xe47d('0x18')]===undefined?!![]:![]:!![]})[_0xe47d('0x19')](function(_0xc65d75){logger[_0xe47d('0xc')]('CreateVoiceDialReport',_0x51e305);logger[_0xe47d('0x1a')](_0xe47d('0x16'),_0x51e305,JSON[_0xe47d('0x10')](_0xc65d75));_0x1db09c(_0xc65d75);})[_0xe47d('0x15')](function(_0x502889){logger['error']('CreateVoiceDialReport',_0x502889[_0xe47d('0x13')],_0x51e305);_0x478960(_0x4a074c[_0xe47d('0x11')](0x1f4,_0x502889[_0xe47d('0x13')]));});});};exports[_0xe47d('0x1b')]=function(_0x350964){var _0x593d97=this;return new Promise(function(_0x550f98,_0x554fd9){return db[_0xe47d('0x1c')][_0xe47d('0x1d')](_0x350964[_0xe47d('0x1e')],{'raw':_0x350964['options']?_0x350964[_0xe47d('0x17')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x350964['options']?_0x350964[_0xe47d('0x17')][_0xe47d('0x1f')]||null:null,'attributes':_0x350964[_0xe47d('0x17')]?_0x350964[_0xe47d('0x17')][_0xe47d('0x20')]||null:null,'limit':_0x350964[_0xe47d('0x17')]?_0x350964[_0xe47d('0x17')][_0xe47d('0x21')]||null:null})[_0xe47d('0x19')](function(_0x24a604){logger[_0xe47d('0xc')](_0xe47d('0x1b'),_0x350964);logger[_0xe47d('0x1a')](_0xe47d('0x1b'),_0x350964,JSON[_0xe47d('0x10')](_0x24a604));_0x550f98(_0x24a604);})[_0xe47d('0x15')](function(_0x18fbf7){logger[_0xe47d('0x11')](_0xe47d('0x1b'),_0x18fbf7[_0xe47d('0x13')],_0x350964);_0x554fd9(_0x593d97['error'](0x1f4,_0x18fbf7[_0xe47d('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/index.js b/server/api/voiceExtension/index.js index 6da95e9..1dc748f 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 _0xe1e3=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceExtension.controller','get','isAuthenticated','index','/:id','show','post','/:id/applications','addApplications','put','update','delete','exports','multer','connect-timeout','express'];(function(_0x44058b,_0x1c81c5){var _0x4df45e=function(_0x1b8655){while(--_0x1b8655){_0x44058b['push'](_0x44058b['shift']());}};_0x4df45e(++_0x1c81c5);}(_0xe1e3,0x1e0));var _0x3e1e=function(_0x5b4dd6,_0x382a0d){_0x5b4dd6=_0x5b4dd6-0x0;var _0x996af0=_0xe1e3[_0x5b4dd6];return _0x996af0;};'use strict';var multer=require(_0x3e1e('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x3e1e('0x1'));var express=require(_0x3e1e('0x2'));var router=express[_0x3e1e('0x3')]();var fs_extra=require(_0x3e1e('0x4'));var auth=require(_0x3e1e('0x5'));var interaction=require(_0x3e1e('0x6'));var config=require(_0x3e1e('0x7'));var controller=require(_0x3e1e('0x8'));router[_0x3e1e('0x9')]('/',auth[_0x3e1e('0xa')](),controller[_0x3e1e('0xb')]);router[_0x3e1e('0x9')](_0x3e1e('0xc'),auth['isAuthenticated'](),controller[_0x3e1e('0xd')]);router[_0x3e1e('0xe')]('/',auth[_0x3e1e('0xa')](),controller['create']);router['post'](_0x3e1e('0xf'),auth[_0x3e1e('0xa')](),controller[_0x3e1e('0x10')]);router[_0x3e1e('0x11')](_0x3e1e('0xc'),auth[_0x3e1e('0xa')](),controller[_0x3e1e('0x12')]);router[_0x3e1e('0x13')](_0x3e1e('0xc'),auth[_0x3e1e('0xa')](),controller['destroy']);module[_0x3e1e('0x14')]=router; \ No newline at end of file +var _0xf37b=['addApplications','update','delete','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceExtension.controller','get','isAuthenticated','/:id','show','post','create','/:id/applications'];(function(_0x3be389,_0x3345bb){var _0x2c5585=function(_0x287746){while(--_0x287746){_0x3be389['push'](_0x3be389['shift']());}};_0x2c5585(++_0x3345bb);}(_0xf37b,0xe0));var _0xbf37=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xf37b[_0x19e35c];return _0x3e1fe8;};'use strict';var multer=require(_0xbf37('0x0'));var util=require(_0xbf37('0x1'));var path=require(_0xbf37('0x2'));var timeout=require(_0xbf37('0x3'));var express=require('express');var router=express[_0xbf37('0x4')]();var fs_extra=require(_0xbf37('0x5'));var auth=require(_0xbf37('0x6'));var interaction=require(_0xbf37('0x7'));var config=require('../../config/environment');var controller=require(_0xbf37('0x8'));router[_0xbf37('0x9')]('/',auth[_0xbf37('0xa')](),controller['index']);router['get'](_0xbf37('0xb'),auth[_0xbf37('0xa')](),controller[_0xbf37('0xc')]);router[_0xbf37('0xd')]('/',auth[_0xbf37('0xa')](),controller[_0xbf37('0xe')]);router[_0xbf37('0xd')](_0xbf37('0xf'),auth[_0xbf37('0xa')](),controller[_0xbf37('0x10')]);router['put'](_0xbf37('0xb'),auth[_0xbf37('0xa')](),controller[_0xbf37('0x11')]);router[_0xbf37('0x12')](_0xbf37('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0xbf37('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 189bac4..f018074 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 _0x4399=['NoOp','inbound','outbound','internal','inbound-fax','outbound-fax','any','*,*,*,*','INTEGER','BOOLEAN','wav','VIRTUAL','getDataValue','exten','sequelize','exports','compositeIndex','STRING'];(function(_0x52e147,_0x41c63a){var _0x567f00=function(_0x58a0c9){while(--_0x58a0c9){_0x52e147['push'](_0x52e147['shift']());}};_0x567f00(++_0x41c63a);}(_0x4399,0xd4));var _0x9439=function(_0xbc4297,_0x492167){_0xbc4297=_0xbc4297-0x0;var _0x2d8df3=_0x4399[_0xbc4297];return _0x2d8df3;};'use strict';var Sequelize=require(_0x9439('0x0'));module[_0x9439('0x1')]={'context':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x9439('0x2'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x9439('0x2')},'priority':{'type':Sequelize[_0x9439('0x3')],'allowNull':![],'defaultValue':'1','unique':_0x9439('0x2')},'tag':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0x9439('0x3')],'allowNull':![],'defaultValue':_0x9439('0x4')},'appdata':{'type':Sequelize[_0x9439('0x3')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize['ENUM'](_0x9439('0x5'),_0x9439('0x6'),_0x9439('0x7'),_0x9439('0x8'),_0x9439('0x9'),'system',_0x9439('0xa')),'allowNull':![]},'description':{'type':Sequelize[_0x9439('0x3')]},'interval':{'type':Sequelize[_0x9439('0x3')],'allowNull':![],'defaultValue':_0x9439('0xb')},'IntervalId':{'type':Sequelize[_0x9439('0xc')]},'isApp':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0x9439('0x3')],'defaultValue':null},'callerID':{'type':Sequelize[_0x9439('0x3')],'allowNull':!![]},'record':{'type':Sequelize[_0x9439('0xd')],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0x9439('0xc')]},'recordingFormat':{'type':Sequelize[_0x9439('0x3')],'defaultValue':_0x9439('0xe')},'answer':{'type':Sequelize[_0x9439('0xd')],'defaultValue':!![]},'name':{'type':Sequelize[_0x9439('0xf')],'get':function(_0x3729d9){return this[_0x9439('0x10')](_0x9439('0x11'));}},'alias':{'type':Sequelize[_0x9439('0x3')],'allowNull':!![]}}; \ No newline at end of file +var _0x932b=['*,*,*,*','INTEGER','BOOLEAN','wav','VIRTUAL','getDataValue','exten','sequelize','STRING','compositeIndex','ENUM','outbound','internal','inbound-fax','outbound-fax','system','any'];(function(_0x1873df,_0x55861a){var _0x1f471c=function(_0x31294f){while(--_0x31294f){_0x1873df['push'](_0x1873df['shift']());}};_0x1f471c(++_0x55861a);}(_0x932b,0xb1));var _0xb932=function(_0x4baac3,_0x481c9a){_0x4baac3=_0x4baac3-0x0;var _0x4fb4bc=_0x932b[_0x4baac3];return _0x4fb4bc;};'use strict';var Sequelize=require(_0xb932('0x0'));module['exports']={'context':{'type':Sequelize[_0xb932('0x1')],'allowNull':![],'unique':_0xb932('0x2'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0xb932('0x1')],'allowNull':![],'unique':_0xb932('0x2')},'priority':{'type':Sequelize[_0xb932('0x1')],'allowNull':![],'defaultValue':'1','unique':_0xb932('0x2')},'tag':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'NoOp'},'appdata':{'type':Sequelize[_0xb932('0x1')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0xb932('0x3')]('inbound',_0xb932('0x4'),_0xb932('0x5'),_0xb932('0x6'),_0xb932('0x7'),_0xb932('0x8'),_0xb932('0x9')),'allowNull':![]},'description':{'type':Sequelize[_0xb932('0x1')]},'interval':{'type':Sequelize[_0xb932('0x1')],'allowNull':![],'defaultValue':_0xb932('0xa')},'IntervalId':{'type':Sequelize[_0xb932('0xb')]},'isApp':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0xb932('0x1')],'defaultValue':null},'callerID':{'type':Sequelize['STRING'],'allowNull':!![]},'record':{'type':Sequelize[_0xb932('0xc')],'defaultValue':![]},'cutdigits':{'type':Sequelize['INTEGER']},'recordingFormat':{'type':Sequelize['STRING'],'defaultValue':_0xb932('0xd')},'answer':{'type':Sequelize[_0xb932('0xc')],'defaultValue':!![]},'name':{'type':Sequelize[_0xb932('0xe')],'get':function(_0x130fc1){return this[_0xb932('0xf')](_0xb932('0x10'));}},'alias':{'type':Sequelize[_0xb932('0x1')],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.controller.js b/server/api/voiceExtension/voiceExtension.controller.js index e3492ec..bee33c8 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 _0x62fc=['intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','merge','VIRTUAL','include','findAll','rows','show','includeAll','options','catch','create','body','exten','concat','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','OutboundRoutes','internal','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','description','recordingFormat','alias','context','addApplications','params','sequelize','transaction','ISOLATION_LEVELS','findOne','createRouting','bulkCreate','findAndCountAll','stack','send','lodash','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','register','status','end','json','offset','undefined','limit','count','destroy','get','InboundRoutes','inbound','outbound','InternalRoutes','filter','ignore','map','value','includes','find','type','name','UserProfileResource','then','sendStatus','index','VoiceExtension','rawAttributes','fieldName','key','model','query','keys'];(function(_0x3f37c8,_0x2de1ad){var _0x1c3bc2=function(_0x45caf0){while(--_0x45caf0){_0x3f37c8['push'](_0x3f37c8['shift']());}};_0x1c3bc2(++_0x2de1ad);}(_0x62fc,0x8b));var _0xc62f=function(_0x3f3427,_0x1089e4){_0x3f3427=_0x3f3427-0x0;var _0xd9a450=_0x62fc[_0x3f3427];return _0xd9a450;};'use strict';var _=require(_0xc62f('0x0'));var Redis=require(_0xc62f('0x1'));var qs=require(_0xc62f('0x2'));var logger=require(_0xc62f('0x3'))(_0xc62f('0x4'));var config=require(_0xc62f('0x5'));var db=require(_0xc62f('0x6'))['db'];config[_0xc62f('0x7')]=_[_0xc62f('0x8')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xc62f('0x9'))(new Redis(config[_0xc62f('0x7')]));require('./voiceExtension.socket')[_0xc62f('0xa')](socket);function respondWithStatusCode(_0x31dc4d,_0x3c4719){_0x3c4719=_0x3c4719||0xcc;return function(_0x3cc0d6){if(_0x3cc0d6){return _0x31dc4d['sendStatus'](_0x3c4719);}return _0x31dc4d[_0xc62f('0xb')](_0x3c4719)[_0xc62f('0xc')]();};}function respondWithResult(_0x386955,_0x315c31){_0x315c31=_0x315c31||0xc8;return function(_0x5ebb0b){if(_0x5ebb0b){return _0x386955[_0xc62f('0xb')](_0x315c31)[_0xc62f('0xd')](_0x5ebb0b);}};}function respondWithFilteredResult(_0x33e540,_0x25de18){return function(_0x1eae10){if(_0x1eae10){var _0x4597c6=typeof _0x25de18[_0xc62f('0xe')]===_0xc62f('0xf')&&typeof _0x25de18[_0xc62f('0x10')]===_0xc62f('0xf');var _0x2730b5=_0x1eae10[_0xc62f('0x11')];var _0x123be4=_0x4597c6?0x0:_0x25de18['offset'];var _0x3fee43=_0x4597c6?_0x1eae10[_0xc62f('0x11')]:_0x25de18[_0xc62f('0xe')]+_0x25de18['limit'];var _0x19123c;if(_0x3fee43>=_0x2730b5){_0x3fee43=_0x2730b5;_0x19123c=0xc8;}else{_0x19123c=0xce;}_0x33e540['status'](_0x19123c);return _0x33e540['set']('Content-Range',_0x123be4+'-'+_0x3fee43+'/'+_0x2730b5)['json'](_0x1eae10);}return null;};}function removeEntity(_0x4024a7){return function(_0x53b385){if(_0x53b385){return _0x53b385[_0xc62f('0x12')]()['then'](function(){var _0xdb203d=_0x53b385[_0xc62f('0x13')]({'plain':!![]});var _0x586ff8=[{'name':_0xc62f('0x14'),'value':_0xc62f('0x15'),'ignore':![]},{'name':'OutboundRoutes','value':_0xc62f('0x16'),'ignore':![]},{'name':_0xc62f('0x17'),'value':'internal','ignore':![]}];var _0x28c7c5=_(_0x586ff8)[_0xc62f('0x18')](_0xc62f('0x19'))[_0xc62f('0x1a')](_0xc62f('0x1b'))['value']();if(_[_0xc62f('0x1c')](_0x28c7c5,_0xdb203d['type'])){return;}var _0x1e75c3=_[_0xc62f('0x1d')](_0x586ff8,[_0xc62f('0x1b'),_0xdb203d[_0xc62f('0x1e')]])[_0xc62f('0x1f')];return db[_0xc62f('0x20')][_0xc62f('0x12')]({'where':{'type':_0x1e75c3,'resourceId':_0xdb203d['id']}})['then'](function(){return _0x53b385;});})[_0xc62f('0x21')](function(){_0x4024a7['status'](0xcc)[_0xc62f('0xc')]();});}};}function handleEntityNotFound(_0x54a2ae){return function(_0x3570a6){if(!_0x3570a6){_0x54a2ae[_0xc62f('0x22')](0x194);}return _0x3570a6;};}function handleError(_0x2c0d05,_0x52c425){_0x52c425=_0x52c425||0x1f4;return function(_0x2291e3){logger['error'](_0x2291e3['stack']);if(_0x2291e3['name']){delete _0x2291e3[_0xc62f('0x1f')];}_0x2c0d05[_0xc62f('0xb')](_0x52c425)['send'](_0x2291e3);};}exports[_0xc62f('0x23')]=function(_0x145edd,_0x13853d){var _0x306496={},_0x50c2f6={},_0x3c1192={'count':0x0,'rows':[]};var _0x40b924=_[_0xc62f('0x1a')](db[_0xc62f('0x24')][_0xc62f('0x25')],function(_0x24aeea){return{'name':_0x24aeea[_0xc62f('0x26')],'type':_0x24aeea[_0xc62f('0x1e')][_0xc62f('0x27')]};});_0x50c2f6[_0xc62f('0x28')]=_[_0xc62f('0x1a')](_0x40b924,_0xc62f('0x1f'));_0x50c2f6[_0xc62f('0x29')]=_[_0xc62f('0x2a')](_0x145edd[_0xc62f('0x29')]);_0x50c2f6['filters']=_[_0xc62f('0x2b')](_0x50c2f6['model'],_0x50c2f6['query']);_0x306496[_0xc62f('0x2c')]=_[_0xc62f('0x2b')](_0x50c2f6[_0xc62f('0x28')],qs[_0xc62f('0x2d')](_0x145edd[_0xc62f('0x29')][_0xc62f('0x2d')]));_0x306496[_0xc62f('0x2c')]=_0x306496['attributes'][_0xc62f('0x2e')]?_0x306496[_0xc62f('0x2c')]:_0x50c2f6[_0xc62f('0x28')];if(!_0x145edd[_0xc62f('0x29')][_0xc62f('0x2f')](_0xc62f('0x30'))){_0x306496[_0xc62f('0x10')]=qs[_0xc62f('0x10')](_0x145edd['query'][_0xc62f('0x10')]);_0x306496[_0xc62f('0xe')]=qs[_0xc62f('0xe')](_0x145edd[_0xc62f('0x29')][_0xc62f('0xe')]);}_0x306496[_0xc62f('0x31')]=qs['sort'](_0x145edd[_0xc62f('0x29')][_0xc62f('0x32')]);_0x306496[_0xc62f('0x33')]=qs['filters'](_[_0xc62f('0x34')](_0x145edd[_0xc62f('0x29')],_0x50c2f6[_0xc62f('0x35')]),_0x40b924);if(_0x145edd['query']['filter']){_0x306496[_0xc62f('0x33')]=_[_0xc62f('0x36')](_0x306496[_0xc62f('0x33')],{'$or':_[_0xc62f('0x1a')](_0x40b924,function(_0x11e1fa){if(_0x11e1fa[_0xc62f('0x1e')]!==_0xc62f('0x37')){var _0x2a490a={};_0x2a490a[_0x11e1fa[_0xc62f('0x1f')]]={'$like':'%'+_0x145edd[_0xc62f('0x29')][_0xc62f('0x18')]+'%'};return _0x2a490a;}})});}_0x306496=_[_0xc62f('0x36')]({},_0x306496,_0x145edd['options']);var _0x3164a3={'where':_0x306496[_0xc62f('0x33')]};return db[_0xc62f('0x24')][_0xc62f('0x11')](_0x3164a3)[_0xc62f('0x21')](function(_0x3085e4){_0x3c1192['count']=_0x3085e4;if(_0x145edd[_0xc62f('0x29')]['includeAll']){_0x306496[_0xc62f('0x38')]=[{'all':!![]}];}return db[_0xc62f('0x24')][_0xc62f('0x39')](_0x306496);})[_0xc62f('0x21')](function(_0xc1f976){_0x3c1192[_0xc62f('0x3a')]=_0xc1f976;return _0x3c1192;})[_0xc62f('0x21')](respondWithFilteredResult(_0x13853d,_0x306496))['catch'](handleError(_0x13853d,null));};exports[_0xc62f('0x3b')]=function(_0x58ba2d,_0x3ffcea){var _0x4f7873={'raw':![],'where':{'id':_0x58ba2d['params']['id']}},_0x4cf029={};_0x4cf029[_0xc62f('0x28')]=_['keys'](db[_0xc62f('0x24')][_0xc62f('0x25')]);_0x4cf029[_0xc62f('0x29')]=_[_0xc62f('0x2a')](_0x58ba2d[_0xc62f('0x29')]);_0x4cf029[_0xc62f('0x35')]=_['intersection'](_0x4cf029[_0xc62f('0x28')],_0x4cf029['query']);_0x4f7873[_0xc62f('0x2c')]=_[_0xc62f('0x2b')](_0x4cf029[_0xc62f('0x28')],qs[_0xc62f('0x2d')](_0x58ba2d['query'][_0xc62f('0x2d')]));_0x4f7873[_0xc62f('0x2c')]=_0x4f7873['attributes']['length']?_0x4f7873[_0xc62f('0x2c')]:_0x4cf029[_0xc62f('0x28')];if(_0x58ba2d[_0xc62f('0x29')][_0xc62f('0x3c')]){_0x4f7873['include']=[{'all':!![]}];}_0x4f7873=_[_0xc62f('0x36')]({},_0x4f7873,_0x58ba2d[_0xc62f('0x3d')]);return db[_0xc62f('0x24')][_0xc62f('0x1d')](_0x4f7873)['then'](handleEntityNotFound(_0x3ffcea,null))[_0xc62f('0x21')](respondWithResult(_0x3ffcea,null))[_0xc62f('0x3e')](handleError(_0x3ffcea,null));};exports[_0xc62f('0x12')]=function(_0x53f624,_0x587faa){return db[_0xc62f('0x24')][_0xc62f('0x1d')]({'where':{'id':_0x53f624['params']['id']}})[_0xc62f('0x21')](handleEntityNotFound(_0x587faa,null))[_0xc62f('0x21')](removeEntity(_0x587faa,null))[_0xc62f('0x3e')](handleError(_0x587faa,null));};exports[_0xc62f('0x3f')]=function(_0x358533,_0x375897){if(_0x358533[_0xc62f('0x40')]['type']===_0xc62f('0x16')&&!_['startsWith'](_0x358533[_0xc62f('0x40')][_0xc62f('0x41')],'_')){_0x358533['body'][_0xc62f('0x41')]='_'[_0xc62f('0x42')](_0x358533[_0xc62f('0x40')]['exten']);}return db['VoiceExtension'][_0xc62f('0x3f')](_0x358533['body'],{'raw':![]})[_0xc62f('0x21')](function(_0x152e44){var _0x40d677=_0x358533[_0xc62f('0x43')]['get']({'plain':!![]});if(!_0x40d677)throw new Error(_0xc62f('0x44'));if(_0x40d677['role']==='user'){var _0x551f66=_0x152e44[_0xc62f('0x13')]({'plain':!![]});var _0x21ba54=[{'name':_0xc62f('0x14'),'value':_0xc62f('0x15')},{'name':_0xc62f('0x45'),'value':_0xc62f('0x16')},{'name':_0xc62f('0x17'),'value':_0xc62f('0x46')}];var _0xb6bd06=_[_0xc62f('0x1d')](_0x21ba54,['value',_0x551f66[_0xc62f('0x1e')]])[_0xc62f('0x1f')];return db['UserProfileSection'][_0xc62f('0x1d')]({'where':{'name':_0xb6bd06,'userProfileId':_0x40d677[_0xc62f('0x47')]},'raw':!![]})[_0xc62f('0x21')](function(_0x1592ec){if(_0x1592ec&&_0x1592ec[_0xc62f('0x48')]===0x0){return db[_0xc62f('0x20')]['create']({'name':_0x551f66[_0xc62f('0x1f')],'resourceId':_0x551f66['id'],'type':_0x1592ec['name'],'sectionId':_0x1592ec['id']},{})[_0xc62f('0x21')](function(){return _0x152e44;});}else{return _0x152e44;}})[_0xc62f('0x3e')](function(_0x335f51){logger[_0xc62f('0x49')](_0xc62f('0x4a'),_0x335f51);throw _0x335f51;});}return _0x152e44;})[_0xc62f('0x21')](respondWithResult(_0x375897,0xc9))['catch'](handleError(_0x375897,null));};exports[_0xc62f('0x4b')]=function(_0x1be1f3,_0x27db60){if(_0x1be1f3[_0xc62f('0x40')]['id']){delete _0x1be1f3[_0xc62f('0x40')]['id'];}return db[_0xc62f('0x24')][_0xc62f('0x1d')]({'where':{'id':_0x1be1f3['params']['id']}})[_0xc62f('0x21')](handleEntityNotFound(_0x27db60,null))[_0xc62f('0x21')](function(_0x1a547c){if(_0x1a547c){return db[_0xc62f('0x24')][_0xc62f('0x4b')](_['pick'](_0x1be1f3['body'],[_0xc62f('0x41'),'context',_0xc62f('0x4c'),_0xc62f('0x4d'),'cutdigits','mandatoryDisposition',_0xc62f('0x4e')]),{'where':{'context':_0x1a547c[_0xc62f('0x4f')],'exten':_0x1a547c[_0xc62f('0x41')]},'individualHooks':!![]})['then'](function(_0x55dcb7){return _0x55dcb7;});}return null;})['then'](respondWithStatusCode(_0x27db60,null))[_0xc62f('0x3e')](handleError(_0x27db60,null));};exports[_0xc62f('0x50')]=function(_0x43a9ee,_0x272c94){var _0x3121d1=_0x43a9ee[_0xc62f('0x51')]['id'];var _0x12754d=_0x43a9ee[_0xc62f('0x40')];var _0x278de2=0xc8;var _0x44952a=null;return db[_0xc62f('0x52')][_0xc62f('0x53')]({'isolationLevel':db[_0xc62f('0x52')]['Transaction'][_0xc62f('0x54')]['READ_COMMITTED']},function(_0x2e86de){return db[_0xc62f('0x24')][_0xc62f('0x55')]({'where':{'id':_0x3121d1},'transaction':_0x2e86de})[_0xc62f('0x21')](function(_0x480a04){if(_0x480a04){return db[_0xc62f('0x24')]['destroy']({'where':{'VoiceExtensionId':_0x3121d1},'transaction':_0x2e86de})[_0xc62f('0x21')](function(){var _0x172b63=_[_0xc62f('0x1a')](_0x12754d,function(_0x33842a){_0x33842a['VoiceExtensionId']=_0x3121d1;_0x33842a['isApp']=!![];return _0x33842a;});return _0x480a04[_0xc62f('0x56')](_0x172b63);})[_0xc62f('0x21')](function(_0x5dab30){return db[_0xc62f('0x24')][_0xc62f('0x57')](_0x5dab30,{'transaction':_0x2e86de});});}else{_0x278de2=0x194;_0x44952a=[];}});})['then'](function(){if(_0x278de2!==0x194){return db['VoiceExtension'][_0xc62f('0x58')]({'where':{'isApp':!![],'VoiceExtensionId':_0x3121d1},'order':'cast(priority\x20as\x20unsigned)'})[_0xc62f('0x21')](function(_0x25039e){_0x44952a=_0x25039e;});}})[_0xc62f('0x3e')](function(_0x3724fe){_0x278de2=0x1f4;logger[_0xc62f('0x49')](_0x3724fe[_0xc62f('0x59')]);if(_0x3724fe[_0xc62f('0x1f')]){delete _0x3724fe['name'];}_0x44952a=_0x3724fe;})['finally'](function(){if(_0x44952a===null){_0x272c94[_0xc62f('0x22')](_0x278de2);}else{if(_0x278de2===0x1f4){_0x272c94[_0xc62f('0xb')](_0x278de2)[_0xc62f('0x5a')](_0x44952a);}else{_0x272c94[_0xc62f('0xb')](_0x278de2)['json'](_0x44952a);}}});}; \ No newline at end of file +var _0x0cae=['get','OutboundRoutes','InternalRoutes','internal','filter','ignore','map','value','includes','find','type','destroy','then','error','stack','name','send','index','VoiceExtension','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','options','include','findAll','rows','catch','params','keys','includeAll','body','outbound','startsWith','exten','concat','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','InboundRoutes','inbound','userProfileId','autoAssociation','update','context','description','mandatoryDisposition','alias','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','findOne','VoiceExtensionId','isApp','createRouting','findAndCountAll','cast(priority\x20as\x20unsigned)','finally','lodash','ioredis','../../config/logger','api','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voiceExtension.socket','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range'];(function(_0x443f97,_0x107510){var _0x2da516=function(_0x428b7f){while(--_0x428b7f){_0x443f97['push'](_0x443f97['shift']());}};_0x2da516(++_0x107510);}(_0x0cae,0xa8));var _0xe0ca=function(_0x120b10,_0x5ba9e0){_0x120b10=_0x120b10-0x0;var _0x545e68=_0x0cae[_0x120b10];return _0x545e68;};'use strict';var _=require(_0xe0ca('0x0'));var Redis=require(_0xe0ca('0x1'));var qs=require('../../components/parsers/qs');var logger=require(_0xe0ca('0x2'))(_0xe0ca('0x3'));var config=require('../../config/environment');var db=require(_0xe0ca('0x4'))['db'];config[_0xe0ca('0x5')]=_[_0xe0ca('0x6')](config['redis'],{'host':_0xe0ca('0x7'),'port':0x18eb});var socket=require(_0xe0ca('0x8'))(new Redis(config[_0xe0ca('0x5')]));require(_0xe0ca('0x9'))['register'](socket);function respondWithStatusCode(_0x1b00b1,_0x4a7ede){_0x4a7ede=_0x4a7ede||0xcc;return function(_0x5c8c0c){if(_0x5c8c0c){return _0x1b00b1[_0xe0ca('0xa')](_0x4a7ede);}return _0x1b00b1[_0xe0ca('0xb')](_0x4a7ede)[_0xe0ca('0xc')]();};}function respondWithResult(_0x1ebcd8,_0x14a043){_0x14a043=_0x14a043||0xc8;return function(_0x420e5b){if(_0x420e5b){return _0x1ebcd8[_0xe0ca('0xb')](_0x14a043)[_0xe0ca('0xd')](_0x420e5b);}};}function respondWithFilteredResult(_0x49e24b,_0x8b605a){return function(_0x3709e7){if(_0x3709e7){var _0x3b1a8a=typeof _0x8b605a[_0xe0ca('0xe')]===_0xe0ca('0xf')&&typeof _0x8b605a['limit']==='undefined';var _0x279907=_0x3709e7[_0xe0ca('0x10')];var _0x203c73=_0x3b1a8a?0x0:_0x8b605a[_0xe0ca('0xe')];var _0x589007=_0x3b1a8a?_0x3709e7['count']:_0x8b605a[_0xe0ca('0xe')]+_0x8b605a[_0xe0ca('0x11')];var _0x211218;if(_0x589007>=_0x279907){_0x589007=_0x279907;_0x211218=0xc8;}else{_0x211218=0xce;}_0x49e24b['status'](_0x211218);return _0x49e24b[_0xe0ca('0x12')](_0xe0ca('0x13'),_0x203c73+'-'+_0x589007+'/'+_0x279907)[_0xe0ca('0xd')](_0x3709e7);}return null;};}function removeEntity(_0x13e244){return function(_0x4cc4bc){if(_0x4cc4bc){return _0x4cc4bc['destroy']()['then'](function(){var _0x5b65a5=_0x4cc4bc[_0xe0ca('0x14')]({'plain':!![]});var _0x39f536=[{'name':'InboundRoutes','value':'inbound','ignore':![]},{'name':_0xe0ca('0x15'),'value':'outbound','ignore':![]},{'name':_0xe0ca('0x16'),'value':_0xe0ca('0x17'),'ignore':![]}];var _0x186299=_(_0x39f536)[_0xe0ca('0x18')](_0xe0ca('0x19'))[_0xe0ca('0x1a')](_0xe0ca('0x1b'))[_0xe0ca('0x1b')]();if(_[_0xe0ca('0x1c')](_0x186299,_0x5b65a5['type'])){return;}var _0x361c84=_[_0xe0ca('0x1d')](_0x39f536,[_0xe0ca('0x1b'),_0x5b65a5[_0xe0ca('0x1e')]])['name'];return db['UserProfileResource'][_0xe0ca('0x1f')]({'where':{'type':_0x361c84,'resourceId':_0x5b65a5['id']}})['then'](function(){return _0x4cc4bc;});})[_0xe0ca('0x20')](function(){_0x13e244[_0xe0ca('0xb')](0xcc)['end']();});}};}function handleEntityNotFound(_0x555af9){return function(_0x188563){if(!_0x188563){_0x555af9[_0xe0ca('0xa')](0x194);}return _0x188563;};}function handleError(_0x3b0441,_0x5bb545){_0x5bb545=_0x5bb545||0x1f4;return function(_0x210f70){logger[_0xe0ca('0x21')](_0x210f70[_0xe0ca('0x22')]);if(_0x210f70[_0xe0ca('0x23')]){delete _0x210f70[_0xe0ca('0x23')];}_0x3b0441[_0xe0ca('0xb')](_0x5bb545)[_0xe0ca('0x24')](_0x210f70);};}exports[_0xe0ca('0x25')]=function(_0x4561bf,_0x44b728){var _0x2f54bf={},_0x2ee517={},_0x2835f9={'count':0x0,'rows':[]};var _0x31b241=_[_0xe0ca('0x1a')](db[_0xe0ca('0x26')][_0xe0ca('0x27')],function(_0x185ea7){return{'name':_0x185ea7[_0xe0ca('0x28')],'type':_0x185ea7[_0xe0ca('0x1e')][_0xe0ca('0x29')]};});_0x2ee517[_0xe0ca('0x2a')]=_[_0xe0ca('0x1a')](_0x31b241,_0xe0ca('0x23'));_0x2ee517[_0xe0ca('0x2b')]=_['keys'](_0x4561bf[_0xe0ca('0x2b')]);_0x2ee517[_0xe0ca('0x2c')]=_[_0xe0ca('0x2d')](_0x2ee517[_0xe0ca('0x2a')],_0x2ee517['query']);_0x2f54bf[_0xe0ca('0x2e')]=_[_0xe0ca('0x2d')](_0x2ee517[_0xe0ca('0x2a')],qs[_0xe0ca('0x2f')](_0x4561bf[_0xe0ca('0x2b')][_0xe0ca('0x2f')]));_0x2f54bf[_0xe0ca('0x2e')]=_0x2f54bf[_0xe0ca('0x2e')][_0xe0ca('0x30')]?_0x2f54bf[_0xe0ca('0x2e')]:_0x2ee517[_0xe0ca('0x2a')];if(!_0x4561bf[_0xe0ca('0x2b')][_0xe0ca('0x31')](_0xe0ca('0x32'))){_0x2f54bf[_0xe0ca('0x11')]=qs[_0xe0ca('0x11')](_0x4561bf[_0xe0ca('0x2b')][_0xe0ca('0x11')]);_0x2f54bf[_0xe0ca('0xe')]=qs[_0xe0ca('0xe')](_0x4561bf[_0xe0ca('0x2b')][_0xe0ca('0xe')]);}_0x2f54bf[_0xe0ca('0x33')]=qs[_0xe0ca('0x34')](_0x4561bf['query'][_0xe0ca('0x34')]);_0x2f54bf[_0xe0ca('0x35')]=qs[_0xe0ca('0x2c')](_[_0xe0ca('0x36')](_0x4561bf[_0xe0ca('0x2b')],_0x2ee517[_0xe0ca('0x2c')]),_0x31b241);if(_0x4561bf[_0xe0ca('0x2b')][_0xe0ca('0x18')]){_0x2f54bf[_0xe0ca('0x35')]=_[_0xe0ca('0x37')](_0x2f54bf['where'],{'$or':_[_0xe0ca('0x1a')](_0x31b241,function(_0x2e8d84){if(_0x2e8d84[_0xe0ca('0x1e')]!==_0xe0ca('0x38')){var _0x54cfdd={};_0x54cfdd[_0x2e8d84[_0xe0ca('0x23')]]={'$like':'%'+_0x4561bf[_0xe0ca('0x2b')][_0xe0ca('0x18')]+'%'};return _0x54cfdd;}})});}_0x2f54bf=_[_0xe0ca('0x37')]({},_0x2f54bf,_0x4561bf[_0xe0ca('0x39')]);var _0x46df83={'where':_0x2f54bf[_0xe0ca('0x35')]};return db[_0xe0ca('0x26')][_0xe0ca('0x10')](_0x46df83)[_0xe0ca('0x20')](function(_0x37c3b5){_0x2835f9[_0xe0ca('0x10')]=_0x37c3b5;if(_0x4561bf[_0xe0ca('0x2b')]['includeAll']){_0x2f54bf[_0xe0ca('0x3a')]=[{'all':!![]}];}return db[_0xe0ca('0x26')][_0xe0ca('0x3b')](_0x2f54bf);})[_0xe0ca('0x20')](function(_0xe1d2ea){_0x2835f9[_0xe0ca('0x3c')]=_0xe1d2ea;return _0x2835f9;})['then'](respondWithFilteredResult(_0x44b728,_0x2f54bf))[_0xe0ca('0x3d')](handleError(_0x44b728,null));};exports['show']=function(_0x1c0bd8,_0x12c1e0){var _0x2ebedd={'raw':![],'where':{'id':_0x1c0bd8[_0xe0ca('0x3e')]['id']}},_0x14d1ec={};_0x14d1ec['model']=_['keys'](db['VoiceExtension'][_0xe0ca('0x27')]);_0x14d1ec['query']=_[_0xe0ca('0x3f')](_0x1c0bd8[_0xe0ca('0x2b')]);_0x14d1ec[_0xe0ca('0x2c')]=_[_0xe0ca('0x2d')](_0x14d1ec['model'],_0x14d1ec[_0xe0ca('0x2b')]);_0x2ebedd[_0xe0ca('0x2e')]=_[_0xe0ca('0x2d')](_0x14d1ec[_0xe0ca('0x2a')],qs[_0xe0ca('0x2f')](_0x1c0bd8[_0xe0ca('0x2b')][_0xe0ca('0x2f')]));_0x2ebedd[_0xe0ca('0x2e')]=_0x2ebedd[_0xe0ca('0x2e')]['length']?_0x2ebedd['attributes']:_0x14d1ec[_0xe0ca('0x2a')];if(_0x1c0bd8['query'][_0xe0ca('0x40')]){_0x2ebedd[_0xe0ca('0x3a')]=[{'all':!![]}];}_0x2ebedd=_[_0xe0ca('0x37')]({},_0x2ebedd,_0x1c0bd8[_0xe0ca('0x39')]);return db[_0xe0ca('0x26')]['find'](_0x2ebedd)['then'](handleEntityNotFound(_0x12c1e0,null))['then'](respondWithResult(_0x12c1e0,null))[_0xe0ca('0x3d')](handleError(_0x12c1e0,null));};exports[_0xe0ca('0x1f')]=function(_0x3b97aa,_0x427e11){return db[_0xe0ca('0x26')][_0xe0ca('0x1d')]({'where':{'id':_0x3b97aa['params']['id']}})[_0xe0ca('0x20')](handleEntityNotFound(_0x427e11,null))[_0xe0ca('0x20')](removeEntity(_0x427e11,null))[_0xe0ca('0x3d')](handleError(_0x427e11,null));};exports['create']=function(_0x2a9c8c,_0xd93e61){if(_0x2a9c8c[_0xe0ca('0x41')]['type']===_0xe0ca('0x42')&&!_[_0xe0ca('0x43')](_0x2a9c8c[_0xe0ca('0x41')][_0xe0ca('0x44')],'_')){_0x2a9c8c[_0xe0ca('0x41')][_0xe0ca('0x44')]='_'[_0xe0ca('0x45')](_0x2a9c8c[_0xe0ca('0x41')][_0xe0ca('0x44')]);}return db[_0xe0ca('0x26')][_0xe0ca('0x46')](_0x2a9c8c[_0xe0ca('0x41')],{'raw':![]})['then'](function(_0x53e504){var _0x4aa9e0=_0x2a9c8c[_0xe0ca('0x47')][_0xe0ca('0x14')]({'plain':!![]});if(!_0x4aa9e0)throw new Error(_0xe0ca('0x48'));if(_0x4aa9e0[_0xe0ca('0x49')]==='user'){var _0x19a638=_0x53e504[_0xe0ca('0x14')]({'plain':!![]});var _0x2722ab=[{'name':_0xe0ca('0x4a'),'value':_0xe0ca('0x4b')},{'name':_0xe0ca('0x15'),'value':_0xe0ca('0x42')},{'name':_0xe0ca('0x16'),'value':_0xe0ca('0x17')}];var _0x38b079=_[_0xe0ca('0x1d')](_0x2722ab,[_0xe0ca('0x1b'),_0x19a638[_0xe0ca('0x1e')]])[_0xe0ca('0x23')];return db['UserProfileSection']['find']({'where':{'name':_0x38b079,'userProfileId':_0x4aa9e0[_0xe0ca('0x4c')]},'raw':!![]})[_0xe0ca('0x20')](function(_0x4a9885){if(_0x4a9885&&_0x4a9885[_0xe0ca('0x4d')]===0x0){return db['UserProfileResource']['create']({'name':_0x19a638[_0xe0ca('0x23')],'resourceId':_0x19a638['id'],'type':_0x4a9885[_0xe0ca('0x23')],'sectionId':_0x4a9885['id']},{})[_0xe0ca('0x20')](function(){return _0x53e504;});}else{return _0x53e504;}})['catch'](function(_0x559b5f){logger[_0xe0ca('0x21')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x559b5f);throw _0x559b5f;});}return _0x53e504;})['then'](respondWithResult(_0xd93e61,0xc9))[_0xe0ca('0x3d')](handleError(_0xd93e61,null));};exports[_0xe0ca('0x4e')]=function(_0x1d8cfe,_0x1fb0e2){if(_0x1d8cfe[_0xe0ca('0x41')]['id']){delete _0x1d8cfe[_0xe0ca('0x41')]['id'];}return db[_0xe0ca('0x26')][_0xe0ca('0x1d')]({'where':{'id':_0x1d8cfe['params']['id']}})[_0xe0ca('0x20')](handleEntityNotFound(_0x1fb0e2,null))[_0xe0ca('0x20')](function(_0xb5f931){if(_0xb5f931){return db[_0xe0ca('0x26')][_0xe0ca('0x4e')](_[_0xe0ca('0x36')](_0x1d8cfe[_0xe0ca('0x41')],[_0xe0ca('0x44'),_0xe0ca('0x4f'),_0xe0ca('0x50'),'recordingFormat','cutdigits',_0xe0ca('0x51'),_0xe0ca('0x52')]),{'where':{'context':_0xb5f931[_0xe0ca('0x4f')],'exten':_0xb5f931[_0xe0ca('0x44')]},'individualHooks':!![]})[_0xe0ca('0x20')](function(_0x4b061a){return _0x4b061a;});}return null;})[_0xe0ca('0x20')](respondWithStatusCode(_0x1fb0e2,null))[_0xe0ca('0x3d')](handleError(_0x1fb0e2,null));};exports['addApplications']=function(_0xf74bd1,_0x498d87){var _0x34de5e=_0xf74bd1[_0xe0ca('0x3e')]['id'];var _0x2edd4d=_0xf74bd1[_0xe0ca('0x41')];var _0x4bf3e6=0xc8;var _0x2a224c=null;return db[_0xe0ca('0x53')]['transaction']({'isolationLevel':db[_0xe0ca('0x53')][_0xe0ca('0x54')][_0xe0ca('0x55')][_0xe0ca('0x56')]},function(_0x300edc){return db[_0xe0ca('0x26')][_0xe0ca('0x57')]({'where':{'id':_0x34de5e},'transaction':_0x300edc})[_0xe0ca('0x20')](function(_0x4dc9e3){if(_0x4dc9e3){return db[_0xe0ca('0x26')][_0xe0ca('0x1f')]({'where':{'VoiceExtensionId':_0x34de5e},'transaction':_0x300edc})[_0xe0ca('0x20')](function(){var _0x2a6d51=_[_0xe0ca('0x1a')](_0x2edd4d,function(_0x2a6603){_0x2a6603[_0xe0ca('0x58')]=_0x34de5e;_0x2a6603[_0xe0ca('0x59')]=!![];return _0x2a6603;});return _0x4dc9e3[_0xe0ca('0x5a')](_0x2a6d51);})['then'](function(_0x4dce60){return db[_0xe0ca('0x26')]['bulkCreate'](_0x4dce60,{'transaction':_0x300edc});});}else{_0x4bf3e6=0x194;_0x2a224c=[];}});})['then'](function(){if(_0x4bf3e6!==0x194){return db[_0xe0ca('0x26')][_0xe0ca('0x5b')]({'where':{'isApp':!![],'VoiceExtensionId':_0x34de5e},'order':_0xe0ca('0x5c')})[_0xe0ca('0x20')](function(_0x2a9a4f){_0x2a224c=_0x2a9a4f;});}})[_0xe0ca('0x3d')](function(_0x532fa9){_0x4bf3e6=0x1f4;logger['error'](_0x532fa9[_0xe0ca('0x22')]);if(_0x532fa9[_0xe0ca('0x23')]){delete _0x532fa9['name'];}_0x2a224c=_0x532fa9;})[_0xe0ca('0x5d')](function(){if(_0x2a224c===null){_0x498d87[_0xe0ca('0xa')](_0x4bf3e6);}else{if(_0x4bf3e6===0x1f4){_0x498d87[_0xe0ca('0xb')](_0x4bf3e6)[_0xe0ca('0x24')](_0x2a224c);}else{_0x498d87['status'](_0x4bf3e6)['json'](_0x2a224c);}}});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.events.js b/server/api/voiceExtension/voiceExtension.events.js index 3747c5e..e5c4170 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 _0x7ab0=['events','save','emit','hasOwnProperty','exports'];(function(_0x2bef11,_0x32144a){var _0x308b98=function(_0x2925ae){while(--_0x2925ae){_0x2bef11['push'](_0x2bef11['shift']());}};_0x308b98(++_0x32144a);}(_0x7ab0,0x190));var _0x07ab=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0x7ab0[_0x110c3d];return _0x226d67;};'use strict';var EventEmitter=require(_0x07ab('0x0'));var VoiceExtension=require('../../mysqldb')['db']['VoiceExtension'];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x07ab('0x1'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x1d02ca){return function(_0x3e0aae,_0x6420c,_0x233d32){VoiceExtensionEvents[_0x07ab('0x2')](_0x1d02ca+':'+_0x3e0aae['id'],_0x3e0aae);VoiceExtensionEvents[_0x07ab('0x2')](_0x1d02ca,_0x3e0aae);_0x233d32(null);};}for(var e in events){if(events[_0x07ab('0x3')](e)){var event=events[e];VoiceExtension['hook'](e,emitEvent(event));}}module[_0x07ab('0x4')]=VoiceExtensionEvents; \ No newline at end of file +var _0xecd1=['VoiceExtension','setMaxListeners','update','emit','hook','exports','events'];(function(_0x360af4,_0x34f939){var _0x2cb5a4=function(_0x23aa9f){while(--_0x23aa9f){_0x360af4['push'](_0x360af4['shift']());}};_0x2cb5a4(++_0x34f939);}(_0xecd1,0xc3));var _0x1ecd=function(_0x238bb4,_0x48c39d){_0x238bb4=_0x238bb4-0x0;var _0x319efd=_0xecd1[_0x238bb4];return _0x319efd;};'use strict';var EventEmitter=require(_0x1ecd('0x0'));var VoiceExtension=require('../../mysqldb')['db'][_0x1ecd('0x1')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0x1ecd('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x1ecd('0x3'),'afterDestroy':'remove'};function emitEvent(_0x926aa1){return function(_0x1eed76,_0x8df23a,_0xb739eb){VoiceExtensionEvents['emit'](_0x926aa1+':'+_0x1eed76['id'],_0x1eed76);VoiceExtensionEvents[_0x1ecd('0x4')](_0x926aa1,_0x1eed76);_0xb739eb(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceExtension[_0x1ecd('0x5')](e,emitEvent(event));}}module[_0x1ecd('0x6')]=VoiceExtensionEvents; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.model.js b/server/api/voiceExtension/voiceExtension.model.js index c1f4eaa..cfc632a 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 _0x81b6=['context','alias','NoOp','CDR(routeAlias)=','No\x20alias\x20set','exten','push','inbound','CDR(routeid)=','XCALLY-MOTION-PROGRESS=0','outbound','CDR(type)=outbound','CDR(destination)=','cutdigits','${EXTEN}','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=noprefix','XCALLY-MOTION-ANSWER=0','hasOwnProperty','recordingFormat','_XCALLY_MIXMONITOR_FORMAT=','wav','trunk','url','split','length','name','param','phone','prefix','${EXTEN:','SIP','join','options','none','U(xcally-mixmonitor-context)','replace','findAll','IntervalId','then','*,*,*,*','interval','intervals','filter','toLowerCase','tag','CDR(tag)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):','callerID','Set(CALLERID(all)=','NoOp(No\x20number\x20available)','queue','includes','appType','custom','answer','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','XCALLY-MOTION-PROGRESS=1','GotoIfTime',',${EXTEN},','outboundDial','appdata','XMCS-UNIQUEID=${CHANNEL(LINKEDID)}','priority','concat','last','catch','define','VoiceExtension','voice_extensions','Hangup','lodash','./voiceExtension.attributes','models','type','Set'];(function(_0x300aeb,_0x4f62e2){var _0x459abc=function(_0x135ec4){while(--_0x135ec4){_0x300aeb['push'](_0x300aeb['shift']());}};_0x459abc(++_0x4f62e2);}(_0x81b6,0x137));var _0x681b=function(_0x4eefd6,_0x28f412){_0x4eefd6=_0x4eefd6-0x0;var _0x3a39ff=_0x81b6[_0x4eefd6];return _0x3a39ff;};'use strict';var _=require(_0x681b('0x0'));var attributes=require(_0x681b('0x1'));module['exports']=function(_0x590aa9){var _0x8f40d=_0x590aa9[_0x681b('0x2')];function _0x5177d5(_0x870cae){var _0x46d793=0x2;var _0x1f4917=[{'type':_0x870cae[_0x681b('0x3')],'app':_0x681b('0x4'),'appdata':'CDR(type)='+_0x870cae['type'],'context':_0x870cae[_0x681b('0x5')],'exten':_0x870cae['exten'],'priority':_0x46d793++,'VoiceExtensionId':_0x870cae['id']},{'type':_0x870cae[_0x681b('0x3')],'app':_0x870cae[_0x681b('0x6')]?'Set':_0x681b('0x7'),'appdata':_0x870cae[_0x681b('0x6')]?_0x681b('0x8')+_0x870cae[_0x681b('0x6')]:_0x681b('0x9'),'context':_0x870cae[_0x681b('0x5')],'exten':_0x870cae[_0x681b('0xa')],'priority':_0x46d793++,'VoiceExtensionId':_0x870cae['id']}];if(_0x870cae[_0x681b('0x3')]==='inbound'){_0x1f4917[_0x681b('0xb')]({'type':_0x681b('0xc'),'app':_0x681b('0x4'),'appdata':_0x681b('0xd')+_0x870cae['id'],'context':_0x870cae[_0x681b('0x5')],'exten':_0x870cae[_0x681b('0xa')],'priority':_0x46d793++,'VoiceExtensionId':_0x870cae['id']});}_0x1f4917[_0x681b('0xb')]({'type':_0x870cae['type'],'app':_0x681b('0x4'),'appdata':'XCALLY-MOTION-ANSWER=0','context':_0x870cae[_0x681b('0x5')],'exten':_0x870cae['exten'],'priority':_0x46d793++,'VoiceExtensionId':_0x870cae['id']},{'type':_0x870cae[_0x681b('0x3')],'app':_0x681b('0x4'),'appdata':_0x681b('0xe'),'context':_0x870cae['context'],'exten':_0x870cae[_0x681b('0xa')],'priority':_0x46d793++,'VoiceExtensionId':_0x870cae['id']},{'type':_0x870cae[_0x681b('0x3')],'app':'Set','appdata':'MONITOR_OPTIONS=ab','context':_0x870cae[_0x681b('0x5')],'exten':_0x870cae['exten'],'priority':_0x46d793++,'VoiceExtensionId':_0x870cae['id']});return _0x1f4917;}function _0x781536(_0x5a9c17){var _0x4f2f6e=0x2;var _0x1849d8=[{'type':_0x681b('0xf'),'app':_0x681b('0x4'),'appdata':_0x681b('0x10'),'context':_0x5a9c17[_0x681b('0x5')],'exten':_0x5a9c17[_0x681b('0xa')],'priority':_0x4f2f6e++,'VoiceExtensionId':_0x5a9c17['id']},{'type':_0x681b('0xf'),'app':_0x5a9c17['alias']?_0x681b('0x4'):_0x681b('0x7'),'appdata':_0x5a9c17['alias']?_0x681b('0x8')+_0x5a9c17[_0x681b('0x6')]:'No\x20alias\x20set','context':_0x5a9c17[_0x681b('0x5')],'exten':_0x5a9c17[_0x681b('0xa')],'priority':_0x4f2f6e++,'VoiceExtensionId':_0x5a9c17['id']},{'type':_0x681b('0xf'),'app':_0x681b('0x4'),'appdata':_0x681b('0x11')+(_0x5a9c17[_0x681b('0x12')]?'${EXTEN:'+_0x5a9c17[_0x681b('0x12')]+'}':_0x681b('0x13')),'context':_0x5a9c17[_0x681b('0x5')],'exten':_0x5a9c17[_0x681b('0xa')],'priority':_0x4f2f6e++,'VoiceExtensionId':_0x5a9c17['id']},{'type':_0x681b('0xf'),'app':_0x681b('0x4'),'appdata':'CDR(routeid)='+_0x5a9c17['id'],'context':_0x5a9c17['context'],'exten':_0x5a9c17[_0x681b('0xa')],'priority':_0x4f2f6e++,'VoiceExtensionId':_0x5a9c17['id']},{'type':_0x681b('0xf'),'app':_0x681b('0x14'),'appdata':_0x681b('0x15')+(_0x4f2f6e+0x2)+_0x681b('0x16')+(_0x4f2f6e+0x1)+')','context':_0x5a9c17[_0x681b('0x5')],'exten':_0x5a9c17['exten'],'priority':_0x4f2f6e++,'VoiceExtensionId':_0x5a9c17['id']},{'type':_0x681b('0xf'),'app':_0x681b('0x4'),'appdata':_0x5a9c17[_0x681b('0x12')]?'CDR(prefix)=${EXTEN:0:'+_0x5a9c17[_0x681b('0x12')]+'}':_0x681b('0x17'),'context':_0x5a9c17[_0x681b('0x5')],'exten':_0x5a9c17['exten'],'priority':_0x4f2f6e++,'VoiceExtensionId':_0x5a9c17['id']},{'type':_0x681b('0xf'),'app':_0x681b('0x4'),'appdata':_0x681b('0x18'),'context':_0x5a9c17['context'],'exten':_0x5a9c17['exten'],'priority':_0x4f2f6e++,'VoiceExtensionId':_0x5a9c17['id']},{'type':'outbound','app':'Set','appdata':'XCALLY-MOTION-PROGRESS=0','context':_0x5a9c17[_0x681b('0x5')],'exten':_0x5a9c17['exten'],'priority':_0x4f2f6e++,'VoiceExtensionId':_0x5a9c17['id']},{'type':'outbound','app':_0x681b('0x4'),'appdata':'MONITOR_OPTIONS=ab','context':_0x5a9c17[_0x681b('0x5')],'exten':_0x5a9c17['exten'],'priority':_0x4f2f6e++,'VoiceExtensionId':_0x5a9c17['id']},{'type':_0x681b('0xf'),'app':_0x681b('0x4'),'appdata':'outboundrouteid='+_0x5a9c17['id'],'context':_0x5a9c17['context'],'exten':_0x5a9c17[_0x681b('0xa')],'priority':_0x4f2f6e++,'VoiceExtensionId':_0x5a9c17['id']}];if(_0x5a9c17[_0x681b('0x19')]('recordingFormat')&&_0x5a9c17[_0x681b('0x1a')]!=='none'){_0x1849d8['push']({'type':'outbound','app':_0x681b('0x4'),'appdata':'_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','context':_0x5a9c17[_0x681b('0x5')],'exten':_0x5a9c17[_0x681b('0xa')],'priority':_0x4f2f6e++,'VoiceExtensionId':_0x5a9c17['id']},{'type':_0x681b('0xf'),'app':_0x681b('0x4'),'appdata':_0x681b('0x1b')+_0x5a9c17[_0x681b('0x1a')]||_0x681b('0x1c'),'context':_0x5a9c17[_0x681b('0x5')],'exten':_0x5a9c17[_0x681b('0xa')],'priority':_0x4f2f6e++,'VoiceExtensionId':_0x5a9c17['id']});}return _0x1849d8;}function _0x189ab0(_0x40a853,_0x47aa55){var _0x10599f=[{'name':_0x681b('0x1d'),'param':0x0},{'name':'timeout','param':0x1},{'name':'options','param':0x2},{'name':_0x681b('0x1e'),'param':0x3}];var _0x27413a={};var _0x15b582=_0x47aa55[_0x681b('0x1f')](',');var _0x20bea5=[];for(var _0x5dc061=0x0;_0x5dc061<_0x10599f[_0x681b('0x20')];_0x5dc061++){switch(_0x10599f[_0x5dc061][_0x681b('0x21')]){case _0x681b('0x1d'):_0x27413a[_0x681b('0x1d')]=_0x15b582[_0x10599f[_0x5dc061][_0x681b('0x22')]][_0x681b('0x1f')]('/')[0x1];_0x27413a[_0x681b('0x23')]=_0x15b582[_0x10599f[_0x5dc061][_0x681b('0x22')]]['split']('/')[0x2];_0x27413a['prefix']=_0x27413a[_0x681b('0x23')]?_0x27413a[_0x681b('0x23')][_0x681b('0x1f')]('$')[0x0]:undefined;_0x27413a[_0x681b('0x23')]=_0x40a853['cutdigits']?(_0x27413a[_0x681b('0x24')]||'')+_0x681b('0x25')+_0x40a853[_0x681b('0x12')]+'}':(_0x27413a['prefix']||'')+'${EXTEN}';_0x20bea5[_0x10599f[_0x5dc061][_0x681b('0x22')]]=[_0x681b('0x26'),_0x27413a[_0x681b('0x1d')],_0x27413a[_0x681b('0x23')]][_0x681b('0x27')]('/');break;case _0x681b('0x28'):_0x27413a[_0x681b('0x28')]=_0x15b582[_0x10599f[_0x5dc061]['param']];if(_0x40a853[_0x681b('0x1a')]!==_0x681b('0x29')){if(_0x27413a[_0x681b('0x28')]['indexOf']('U(xcally-mixmonitor-context)')<0x0){_0x27413a[_0x681b('0x28')]+=_0x681b('0x2a');}}else{_0x27413a[_0x681b('0x28')]=_0x27413a[_0x681b('0x28')][_0x681b('0x2b')](_0x681b('0x2a'),'');}_0x20bea5[_0x10599f[_0x5dc061][_0x681b('0x22')]]=_0x27413a[_0x681b('0x28')];break;default:_0x20bea5[_0x10599f[_0x5dc061][_0x681b('0x22')]]=_0x15b582[_0x10599f[_0x5dc061]['param']];}}return _0x20bea5[_0x681b('0x27')](',');}function _0x5c7643(_0x1ea4c2,_0x3153f8,_0x3d9080){return new Promise(function(_0xaac125,_0x5a7134){var _0x1c6946=[];if(_['isEmpty'](_0x3153f8))return _0xaac125(_0x1c6946);_0x8f40d['Interval'][_0x681b('0x2c')]({'attributes':['id','interval',_0x681b('0x2d')],'raw':!![]})[_0x681b('0x2e')](function(_0x1ca3ed){for(var _0x182e88=0x0,_0xb86287=0x0;_0x182e88<_0x3153f8[_0x681b('0x20')];_0x182e88++,_0xb86287=0x0){var _0x190fb5=_0x3153f8[_0x182e88];var _0xf319e1=[];var _0x27d0c9=[];delete _0x190fb5['id'];if(_0x190fb5['interval']!==_0x681b('0x2f')){_0x190fb5['intervals']=[_0x190fb5[_0x681b('0x30')]];}else{_0x190fb5[_0x681b('0x31')]=_0x190fb5['IntervalId']?_['map'](_[_0x681b('0x32')](_0x1ca3ed,{'IntervalId':_0x190fb5[_0x681b('0x2d')]}),_0x681b('0x30')):[];}_0x190fb5['context']=_0x1ea4c2['context'];_0x190fb5['exten']=_0x1ea4c2[_0x681b('0xa')];if(_0x190fb5[_0x681b('0x3')])_0x190fb5[_0x681b('0x3')]=_0x190fb5[_0x681b('0x3')][_0x681b('0x33')]();if(_0x1ea4c2[_0x681b('0x3')]===_0x681b('0xf')){if(_0x190fb5[_0x681b('0x19')]('tag')&&_0x190fb5['tag']&&_0x190fb5[_0x681b('0x34')]!=='--'){_0xf319e1[_0x681b('0xb')]({'type':_0x190fb5[_0x681b('0x3')]['toLowerCase'](),'app':_0x681b('0x4'),'appdata':_0x681b('0x35')+_0x190fb5['tag'],'context':_0x1ea4c2[_0x681b('0x5')],'exten':_0x1ea4c2[_0x681b('0xa')],'priority':_0x190fb5[_0x681b('0x31')]['length']+_0x3d9080+_0xb86287++,'VoiceExtensionId':_0x1ea4c2['id']});}_0xf319e1[_0x681b('0xb')]({'type':_0x190fb5[_0x681b('0x3')][_0x681b('0x33')](),'app':_0x681b('0x14'),'appdata':_0x681b('0x36')+(_0x190fb5[_0x681b('0x37')]?_0x681b('0x38')+_0x190fb5[_0x681b('0x37')]+')':_0x681b('0x39')),'context':_0x1ea4c2['context'],'exten':_0x1ea4c2[_0x681b('0xa')],'priority':_0x190fb5[_0x681b('0x31')][_0x681b('0x20')]+_0x3d9080+_0xb86287++,'VoiceExtensionId':_0x1ea4c2['id']});}else{if(_0x190fb5[_0x681b('0x19')]('answer')){if([_0x681b('0x3a'),'playback'][_0x681b('0x3b')](_0x190fb5['app'][_0x681b('0x33')]())&&_0x190fb5[_0x681b('0x3c')]!==_0x681b('0x3d')){if(_0x190fb5[_0x681b('0x3e')]){_0xf319e1[_0x681b('0xb')]({'type':_0x190fb5['type']['toLowerCase'](),'app':_0x681b('0x14'),'appdata':_0x681b('0x3f'),'context':_0x1ea4c2[_0x681b('0x5')],'exten':_0x1ea4c2['exten'],'priority':_0x190fb5[_0x681b('0x31')][_0x681b('0x20')]+_0x3d9080+_0xb86287++,'VoiceExtensionId':_0x1ea4c2['id']});_0xf319e1[_0x681b('0xb')]({'type':_0x190fb5[_0x681b('0x3')][_0x681b('0x33')](),'app':'Set','appdata':_0x681b('0x40'),'context':_0x1ea4c2[_0x681b('0x5')],'exten':_0x1ea4c2[_0x681b('0xa')],'priority':_0x190fb5['intervals'][_0x681b('0x20')]+_0x3d9080+_0xb86287++,'VoiceExtensionId':_0x1ea4c2['id']});}else{_0xf319e1[_0x681b('0xb')]({'type':_0x190fb5[_0x681b('0x3')][_0x681b('0x33')](),'app':_0x681b('0x14'),'appdata':'$[${XCALLY-MOTION-PROGRESS}=0]?Progress','context':_0x1ea4c2[_0x681b('0x5')],'exten':_0x1ea4c2[_0x681b('0xa')],'priority':_0x190fb5[_0x681b('0x31')][_0x681b('0x20')]+_0x3d9080+_0xb86287++,'VoiceExtensionId':_0x1ea4c2['id']});_0xf319e1[_0x681b('0xb')]({'type':_0x190fb5[_0x681b('0x3')][_0x681b('0x33')](),'app':_0x681b('0x4'),'appdata':_0x681b('0x41'),'context':_0x1ea4c2[_0x681b('0x5')],'exten':_0x1ea4c2[_0x681b('0xa')],'priority':_0x190fb5[_0x681b('0x31')]['length']+_0x3d9080+_0xb86287++,'VoiceExtensionId':_0x1ea4c2['id']});}}}}for(var _0x576e2b=0x0;_0x576e2b<_0x190fb5[_0x681b('0x31')][_0x681b('0x20')];_0x576e2b++){var _0x46d393=_0x3d9080+_0x190fb5[_0x681b('0x31')][_0x681b('0x20')];var _0x4db5e9=_0x576e2b===_0x190fb5[_0x681b('0x31')][_0x681b('0x20')]-0x1?_0x3d9080+_0xf319e1[_0x681b('0x20')]+_0x27d0c9[_0x681b('0x20')]+0x2:_0x3d9080+_0x576e2b+0x1;_0xf319e1['splice'](_0x576e2b,0x0,{'type':_0x1ea4c2[_0x681b('0x3')],'app':_0x681b('0x42'),'appdata':_0x190fb5[_0x681b('0x31')][_0x576e2b]+'?'+_0x1ea4c2['context']+_0x681b('0x43')+_0x46d393+':'+_0x1ea4c2[_0x681b('0x5')]+_0x681b('0x43')+_0x4db5e9,'exten':_0x1ea4c2['exten'],'context':_0x1ea4c2['context'],'priority':_0x3d9080+_0x576e2b,'VoiceExtensionId':_0x1ea4c2['id']});}if(_0x190fb5[_0x681b('0x3c')]===_0x681b('0x44')){_0x190fb5[_0x681b('0x45')]=_0x189ab0(_0x1ea4c2,_0x190fb5[_0x681b('0x45')]);}if(_0x190fb5[_0x681b('0x3c')]==='agi'){_0xf319e1['push']({'type':_0x190fb5[_0x681b('0x3')]['toLowerCase'](),'app':'Set','appdata':_0x681b('0x46'),'context':_0x1ea4c2['context'],'exten':_0x1ea4c2[_0x681b('0xa')],'priority':_0x190fb5[_0x681b('0x31')]['length']+_0x3d9080+_0xb86287++,'VoiceExtensionId':_0x1ea4c2['id']});}_0x190fb5[_0x681b('0x47')]=_0xf319e1[_0x681b('0x20')]?_['last'](_0xf319e1)[_0x681b('0x47')]+0x1:_0x3d9080;_0x1c6946=_[_0x681b('0x48')](_0x1c6946,_0xf319e1,[_0x190fb5],_0x27d0c9);_0x3d9080=_[_0x681b('0x49')](_0x1c6946)[_0x681b('0x47')]+0x1;}return _0xaac125(_0x1c6946);})[_0x681b('0x4a')](function(_0x59fd94){_0x5a7134(_0x59fd94);});});}return _0x590aa9[_0x681b('0x4b')](_0x681b('0x4c'),attributes,{'tableName':_0x681b('0x4d'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x3c5bb1){var _0x53750b=this['get']({'plain':!![]});var _0x2912ba=_0x53750b[_0x681b('0x3')]===_0x681b('0xf')?_0x781536(_0x53750b):_0x5177d5(_0x53750b);return _0x5c7643(_0x53750b,_0x3c5bb1,_[_0x681b('0x49')](_0x2912ba)[_0x681b('0x47')]+0x1)[_0x681b('0x2e')](function(_0x49d1e2){var _0x42dc59=_[_0x681b('0x48')](_0x2912ba,_0x49d1e2);_0x42dc59[_0x681b('0xb')]({'type':_0x53750b[_0x681b('0x3')],'app':_0x681b('0x4e'),'exten':_0x53750b[_0x681b('0xa')],'context':_0x53750b['context'],'priority':_[_0x681b('0x49')](_0x42dc59)[_0x681b('0x47')]+0x1,'VoiceExtensionId':_0x53750b['id']});return _0x42dc59;});}}});}; \ No newline at end of file +var _0xcb19=['phone','split','prefix','join','indexOf','U(xcally-mixmonitor-context)','replace','isEmpty','Interval','interval','IntervalId','then','length','*,*,*,*','intervals','filter','toLowerCase','hasOwnProperty','tag','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):','callerID','NoOp(No\x20number\x20available)','answer','queue','playback','includes','app','appType','custom','XCALLY-MOTION-ANSWER=1','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','outboundDial','appdata','agi','priority','last','concat','catch','define','VoiceExtension','voice_extensions','get','Hangup','lodash','./voiceExtension.attributes','exports','models','type','Set','context','exten','NoOp','alias','No\x20alias\x20set','inbound','XCALLY-MOTION-ANSWER=0','MONITOR_OPTIONS=ab','outbound','CDR(type)=outbound','CDR(routeAlias)=','CDR(destination)=','cutdigits','${EXTEN:','${EXTEN}','CDR(routeid)=','ExecIf','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','outboundrouteid=','recordingFormat','none','push','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','timeout','options','url','trunk','param'];(function(_0x2706da,_0x3856f5){var _0x3ba87e=function(_0x479a79){while(--_0x479a79){_0x2706da['push'](_0x2706da['shift']());}};_0x3ba87e(++_0x3856f5);}(_0xcb19,0x127));var _0x9cb1=function(_0x43c7ec,_0x1bb884){_0x43c7ec=_0x43c7ec-0x0;var _0x520a12=_0xcb19[_0x43c7ec];return _0x520a12;};'use strict';var _=require(_0x9cb1('0x0'));var attributes=require(_0x9cb1('0x1'));module[_0x9cb1('0x2')]=function(_0x47ca78){var _0x3bd03b=_0x47ca78[_0x9cb1('0x3')];function _0x3144de(_0x7c2191){var _0x27c613=0x2;var _0x2c5142=[{'type':_0x7c2191[_0x9cb1('0x4')],'app':_0x9cb1('0x5'),'appdata':'CDR(type)='+_0x7c2191[_0x9cb1('0x4')],'context':_0x7c2191[_0x9cb1('0x6')],'exten':_0x7c2191[_0x9cb1('0x7')],'priority':_0x27c613++,'VoiceExtensionId':_0x7c2191['id']},{'type':_0x7c2191['type'],'app':_0x7c2191['alias']?_0x9cb1('0x5'):_0x9cb1('0x8'),'appdata':_0x7c2191['alias']?'CDR(routeAlias)='+_0x7c2191[_0x9cb1('0x9')]:_0x9cb1('0xa'),'context':_0x7c2191[_0x9cb1('0x6')],'exten':_0x7c2191[_0x9cb1('0x7')],'priority':_0x27c613++,'VoiceExtensionId':_0x7c2191['id']}];if(_0x7c2191['type']===_0x9cb1('0xb')){_0x2c5142['push']({'type':_0x9cb1('0xb'),'app':_0x9cb1('0x5'),'appdata':'CDR(routeid)='+_0x7c2191['id'],'context':_0x7c2191[_0x9cb1('0x6')],'exten':_0x7c2191[_0x9cb1('0x7')],'priority':_0x27c613++,'VoiceExtensionId':_0x7c2191['id']});}_0x2c5142['push']({'type':_0x7c2191['type'],'app':_0x9cb1('0x5'),'appdata':_0x9cb1('0xc'),'context':_0x7c2191[_0x9cb1('0x6')],'exten':_0x7c2191['exten'],'priority':_0x27c613++,'VoiceExtensionId':_0x7c2191['id']},{'type':_0x7c2191[_0x9cb1('0x4')],'app':'Set','appdata':'XCALLY-MOTION-PROGRESS=0','context':_0x7c2191[_0x9cb1('0x6')],'exten':_0x7c2191['exten'],'priority':_0x27c613++,'VoiceExtensionId':_0x7c2191['id']},{'type':_0x7c2191['type'],'app':_0x9cb1('0x5'),'appdata':_0x9cb1('0xd'),'context':_0x7c2191['context'],'exten':_0x7c2191[_0x9cb1('0x7')],'priority':_0x27c613++,'VoiceExtensionId':_0x7c2191['id']});return _0x2c5142;}function _0x428452(_0x585f6d){var _0x403b2e=0x2;var _0x3523b2=[{'type':_0x9cb1('0xe'),'app':_0x9cb1('0x5'),'appdata':_0x9cb1('0xf'),'context':_0x585f6d[_0x9cb1('0x6')],'exten':_0x585f6d[_0x9cb1('0x7')],'priority':_0x403b2e++,'VoiceExtensionId':_0x585f6d['id']},{'type':'outbound','app':_0x585f6d[_0x9cb1('0x9')]?_0x9cb1('0x5'):_0x9cb1('0x8'),'appdata':_0x585f6d['alias']?_0x9cb1('0x10')+_0x585f6d[_0x9cb1('0x9')]:'No\x20alias\x20set','context':_0x585f6d['context'],'exten':_0x585f6d[_0x9cb1('0x7')],'priority':_0x403b2e++,'VoiceExtensionId':_0x585f6d['id']},{'type':_0x9cb1('0xe'),'app':_0x9cb1('0x5'),'appdata':_0x9cb1('0x11')+(_0x585f6d[_0x9cb1('0x12')]?_0x9cb1('0x13')+_0x585f6d[_0x9cb1('0x12')]+'}':_0x9cb1('0x14')),'context':_0x585f6d['context'],'exten':_0x585f6d[_0x9cb1('0x7')],'priority':_0x403b2e++,'VoiceExtensionId':_0x585f6d['id']},{'type':_0x9cb1('0xe'),'app':_0x9cb1('0x5'),'appdata':_0x9cb1('0x15')+_0x585f6d['id'],'context':_0x585f6d['context'],'exten':_0x585f6d[_0x9cb1('0x7')],'priority':_0x403b2e++,'VoiceExtensionId':_0x585f6d['id']},{'type':_0x9cb1('0xe'),'app':_0x9cb1('0x16'),'appdata':'$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto('+(_0x403b2e+0x2)+'):Goto('+(_0x403b2e+0x1)+')','context':_0x585f6d[_0x9cb1('0x6')],'exten':_0x585f6d['exten'],'priority':_0x403b2e++,'VoiceExtensionId':_0x585f6d['id']},{'type':_0x9cb1('0xe'),'app':_0x9cb1('0x5'),'appdata':_0x585f6d['cutdigits']?_0x9cb1('0x17')+_0x585f6d[_0x9cb1('0x12')]+'}':_0x9cb1('0x18'),'context':_0x585f6d['context'],'exten':_0x585f6d[_0x9cb1('0x7')],'priority':_0x403b2e++,'VoiceExtensionId':_0x585f6d['id']},{'type':_0x9cb1('0xe'),'app':_0x9cb1('0x5'),'appdata':_0x9cb1('0xc'),'context':_0x585f6d[_0x9cb1('0x6')],'exten':_0x585f6d[_0x9cb1('0x7')],'priority':_0x403b2e++,'VoiceExtensionId':_0x585f6d['id']},{'type':'outbound','app':_0x9cb1('0x5'),'appdata':'XCALLY-MOTION-PROGRESS=0','context':_0x585f6d['context'],'exten':_0x585f6d[_0x9cb1('0x7')],'priority':_0x403b2e++,'VoiceExtensionId':_0x585f6d['id']},{'type':_0x9cb1('0xe'),'app':_0x9cb1('0x5'),'appdata':_0x9cb1('0xd'),'context':_0x585f6d[_0x9cb1('0x6')],'exten':_0x585f6d[_0x9cb1('0x7')],'priority':_0x403b2e++,'VoiceExtensionId':_0x585f6d['id']},{'type':_0x9cb1('0xe'),'app':'Set','appdata':_0x9cb1('0x19')+_0x585f6d['id'],'context':_0x585f6d[_0x9cb1('0x6')],'exten':_0x585f6d[_0x9cb1('0x7')],'priority':_0x403b2e++,'VoiceExtensionId':_0x585f6d['id']}];if(_0x585f6d['hasOwnProperty'](_0x9cb1('0x1a'))&&_0x585f6d[_0x9cb1('0x1a')]!==_0x9cb1('0x1b')){_0x3523b2[_0x9cb1('0x1c')]({'type':_0x9cb1('0xe'),'app':_0x9cb1('0x5'),'appdata':_0x9cb1('0x1d'),'context':_0x585f6d[_0x9cb1('0x6')],'exten':_0x585f6d[_0x9cb1('0x7')],'priority':_0x403b2e++,'VoiceExtensionId':_0x585f6d['id']},{'type':_0x9cb1('0xe'),'app':_0x9cb1('0x5'),'appdata':_0x9cb1('0x1e')+_0x585f6d['recordingFormat']||_0x9cb1('0x1f'),'context':_0x585f6d[_0x9cb1('0x6')],'exten':_0x585f6d[_0x9cb1('0x7')],'priority':_0x403b2e++,'VoiceExtensionId':_0x585f6d['id']});}return _0x3523b2;}function _0x51a238(_0x303930,_0x4501bf){var _0xc69b8c=[{'name':'trunk','param':0x0},{'name':_0x9cb1('0x20'),'param':0x1},{'name':_0x9cb1('0x21'),'param':0x2},{'name':_0x9cb1('0x22'),'param':0x3}];var _0x258f82={};var _0xa91cd5=_0x4501bf['split'](',');var _0x3c9f21=[];for(var _0xebbd2b=0x0;_0xebbd2b<_0xc69b8c['length'];_0xebbd2b++){switch(_0xc69b8c[_0xebbd2b]['name']){case _0x9cb1('0x23'):_0x258f82[_0x9cb1('0x23')]=_0xa91cd5[_0xc69b8c[_0xebbd2b][_0x9cb1('0x24')]]['split']('/')[0x1];_0x258f82[_0x9cb1('0x25')]=_0xa91cd5[_0xc69b8c[_0xebbd2b][_0x9cb1('0x24')]][_0x9cb1('0x26')]('/')[0x2];_0x258f82[_0x9cb1('0x27')]=_0x258f82[_0x9cb1('0x25')]?_0x258f82['phone'][_0x9cb1('0x26')]('$')[0x0]:undefined;_0x258f82[_0x9cb1('0x25')]=_0x303930['cutdigits']?(_0x258f82['prefix']||'')+_0x9cb1('0x13')+_0x303930[_0x9cb1('0x12')]+'}':(_0x258f82[_0x9cb1('0x27')]||'')+_0x9cb1('0x14');_0x3c9f21[_0xc69b8c[_0xebbd2b][_0x9cb1('0x24')]]=['SIP',_0x258f82[_0x9cb1('0x23')],_0x258f82['phone']][_0x9cb1('0x28')]('/');break;case _0x9cb1('0x21'):_0x258f82[_0x9cb1('0x21')]=_0xa91cd5[_0xc69b8c[_0xebbd2b]['param']];if(_0x303930['recordingFormat']!==_0x9cb1('0x1b')){if(_0x258f82['options'][_0x9cb1('0x29')](_0x9cb1('0x2a'))<0x0){_0x258f82[_0x9cb1('0x21')]+='U(xcally-mixmonitor-context)';}}else{_0x258f82['options']=_0x258f82[_0x9cb1('0x21')][_0x9cb1('0x2b')](_0x9cb1('0x2a'),'');}_0x3c9f21[_0xc69b8c[_0xebbd2b][_0x9cb1('0x24')]]=_0x258f82[_0x9cb1('0x21')];break;default:_0x3c9f21[_0xc69b8c[_0xebbd2b][_0x9cb1('0x24')]]=_0xa91cd5[_0xc69b8c[_0xebbd2b][_0x9cb1('0x24')]];}}return _0x3c9f21[_0x9cb1('0x28')](',');}function _0x2385b5(_0x4393d5,_0x2145dd,_0x6c0ecc){return new Promise(function(_0x16dfd6,_0x2443dd){var _0x47024f=[];if(_[_0x9cb1('0x2c')](_0x2145dd))return _0x16dfd6(_0x47024f);_0x3bd03b[_0x9cb1('0x2d')]['findAll']({'attributes':['id',_0x9cb1('0x2e'),_0x9cb1('0x2f')],'raw':!![]})[_0x9cb1('0x30')](function(_0x213dab){for(var _0x31b7eb=0x0,_0x3207b8=0x0;_0x31b7eb<_0x2145dd[_0x9cb1('0x31')];_0x31b7eb++,_0x3207b8=0x0){var _0xc0ca27=_0x2145dd[_0x31b7eb];var _0x3be902=[];var _0x45eaa7=[];delete _0xc0ca27['id'];if(_0xc0ca27['interval']!==_0x9cb1('0x32')){_0xc0ca27[_0x9cb1('0x33')]=[_0xc0ca27[_0x9cb1('0x2e')]];}else{_0xc0ca27['intervals']=_0xc0ca27[_0x9cb1('0x2f')]?_['map'](_[_0x9cb1('0x34')](_0x213dab,{'IntervalId':_0xc0ca27[_0x9cb1('0x2f')]}),_0x9cb1('0x2e')):[];}_0xc0ca27[_0x9cb1('0x6')]=_0x4393d5['context'];_0xc0ca27[_0x9cb1('0x7')]=_0x4393d5['exten'];if(_0xc0ca27['type'])_0xc0ca27['type']=_0xc0ca27[_0x9cb1('0x4')][_0x9cb1('0x35')]();if(_0x4393d5[_0x9cb1('0x4')]===_0x9cb1('0xe')){if(_0xc0ca27[_0x9cb1('0x36')](_0x9cb1('0x37'))&&_0xc0ca27['tag']&&_0xc0ca27['tag']!=='--'){_0x3be902['push']({'type':_0xc0ca27[_0x9cb1('0x4')][_0x9cb1('0x35')](),'app':_0x9cb1('0x5'),'appdata':'CDR(tag)='+_0xc0ca27[_0x9cb1('0x37')],'context':_0x4393d5['context'],'exten':_0x4393d5[_0x9cb1('0x7')],'priority':_0xc0ca27[_0x9cb1('0x33')]['length']+_0x6c0ecc+_0x3207b8++,'VoiceExtensionId':_0x4393d5['id']});}_0x3be902[_0x9cb1('0x1c')]({'type':_0xc0ca27[_0x9cb1('0x4')][_0x9cb1('0x35')](),'app':_0x9cb1('0x16'),'appdata':_0x9cb1('0x38')+(_0xc0ca27[_0x9cb1('0x39')]?'Set(CALLERID(all)='+_0xc0ca27[_0x9cb1('0x39')]+')':_0x9cb1('0x3a')),'context':_0x4393d5[_0x9cb1('0x6')],'exten':_0x4393d5[_0x9cb1('0x7')],'priority':_0xc0ca27['intervals'][_0x9cb1('0x31')]+_0x6c0ecc+_0x3207b8++,'VoiceExtensionId':_0x4393d5['id']});}else{if(_0xc0ca27[_0x9cb1('0x36')](_0x9cb1('0x3b'))){if([_0x9cb1('0x3c'),_0x9cb1('0x3d')][_0x9cb1('0x3e')](_0xc0ca27[_0x9cb1('0x3f')][_0x9cb1('0x35')]())&&_0xc0ca27[_0x9cb1('0x40')]!==_0x9cb1('0x41')){if(_0xc0ca27[_0x9cb1('0x3b')]){_0x3be902[_0x9cb1('0x1c')]({'type':_0xc0ca27[_0x9cb1('0x4')]['toLowerCase'](),'app':_0x9cb1('0x16'),'appdata':'$[${XCALLY-MOTION-ANSWER}=0]?Answer','context':_0x4393d5[_0x9cb1('0x6')],'exten':_0x4393d5[_0x9cb1('0x7')],'priority':_0xc0ca27[_0x9cb1('0x33')][_0x9cb1('0x31')]+_0x6c0ecc+_0x3207b8++,'VoiceExtensionId':_0x4393d5['id']});_0x3be902['push']({'type':_0xc0ca27[_0x9cb1('0x4')][_0x9cb1('0x35')](),'app':_0x9cb1('0x5'),'appdata':_0x9cb1('0x42'),'context':_0x4393d5[_0x9cb1('0x6')],'exten':_0x4393d5[_0x9cb1('0x7')],'priority':_0xc0ca27[_0x9cb1('0x33')][_0x9cb1('0x31')]+_0x6c0ecc+_0x3207b8++,'VoiceExtensionId':_0x4393d5['id']});}else{_0x3be902['push']({'type':_0xc0ca27['type'][_0x9cb1('0x35')](),'app':'ExecIf','appdata':'$[${XCALLY-MOTION-PROGRESS}=0]?Progress','context':_0x4393d5[_0x9cb1('0x6')],'exten':_0x4393d5[_0x9cb1('0x7')],'priority':_0xc0ca27[_0x9cb1('0x33')][_0x9cb1('0x31')]+_0x6c0ecc+_0x3207b8++,'VoiceExtensionId':_0x4393d5['id']});_0x3be902['push']({'type':_0xc0ca27['type'][_0x9cb1('0x35')](),'app':_0x9cb1('0x5'),'appdata':_0x9cb1('0x43'),'context':_0x4393d5[_0x9cb1('0x6')],'exten':_0x4393d5[_0x9cb1('0x7')],'priority':_0xc0ca27[_0x9cb1('0x33')][_0x9cb1('0x31')]+_0x6c0ecc+_0x3207b8++,'VoiceExtensionId':_0x4393d5['id']});}}}}for(var _0xe72223=0x0;_0xe72223<_0xc0ca27[_0x9cb1('0x33')]['length'];_0xe72223++){var _0x43c94e=_0x6c0ecc+_0xc0ca27[_0x9cb1('0x33')][_0x9cb1('0x31')];var _0x45c9dc=_0xe72223===_0xc0ca27[_0x9cb1('0x33')]['length']-0x1?_0x6c0ecc+_0x3be902[_0x9cb1('0x31')]+_0x45eaa7['length']+0x2:_0x6c0ecc+_0xe72223+0x1;_0x3be902[_0x9cb1('0x44')](_0xe72223,0x0,{'type':_0x4393d5[_0x9cb1('0x4')],'app':_0x9cb1('0x45'),'appdata':_0xc0ca27[_0x9cb1('0x33')][_0xe72223]+'?'+_0x4393d5[_0x9cb1('0x6')]+_0x9cb1('0x46')+_0x43c94e+':'+_0x4393d5['context']+_0x9cb1('0x46')+_0x45c9dc,'exten':_0x4393d5['exten'],'context':_0x4393d5[_0x9cb1('0x6')],'priority':_0x6c0ecc+_0xe72223,'VoiceExtensionId':_0x4393d5['id']});}if(_0xc0ca27[_0x9cb1('0x40')]===_0x9cb1('0x47')){_0xc0ca27[_0x9cb1('0x48')]=_0x51a238(_0x4393d5,_0xc0ca27[_0x9cb1('0x48')]);}if(_0xc0ca27['appType']===_0x9cb1('0x49')){_0x3be902[_0x9cb1('0x1c')]({'type':_0xc0ca27[_0x9cb1('0x4')]['toLowerCase'](),'app':_0x9cb1('0x5'),'appdata':'XMCS-UNIQUEID=${CHANNEL(LINKEDID)}','context':_0x4393d5[_0x9cb1('0x6')],'exten':_0x4393d5[_0x9cb1('0x7')],'priority':_0xc0ca27['intervals'][_0x9cb1('0x31')]+_0x6c0ecc+_0x3207b8++,'VoiceExtensionId':_0x4393d5['id']});}_0xc0ca27[_0x9cb1('0x4a')]=_0x3be902[_0x9cb1('0x31')]?_[_0x9cb1('0x4b')](_0x3be902)[_0x9cb1('0x4a')]+0x1:_0x6c0ecc;_0x47024f=_[_0x9cb1('0x4c')](_0x47024f,_0x3be902,[_0xc0ca27],_0x45eaa7);_0x6c0ecc=_['last'](_0x47024f)[_0x9cb1('0x4a')]+0x1;}return _0x16dfd6(_0x47024f);})[_0x9cb1('0x4d')](function(_0x189e77){_0x2443dd(_0x189e77);});});}return _0x47ca78[_0x9cb1('0x4e')](_0x9cb1('0x4f'),attributes,{'tableName':_0x9cb1('0x50'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x4c6ab1){var _0x548963=this[_0x9cb1('0x51')]({'plain':!![]});var _0x2f7451=_0x548963[_0x9cb1('0x4')]===_0x9cb1('0xe')?_0x428452(_0x548963):_0x3144de(_0x548963);return _0x2385b5(_0x548963,_0x4c6ab1,_[_0x9cb1('0x4b')](_0x2f7451)[_0x9cb1('0x4a')]+0x1)[_0x9cb1('0x30')](function(_0x5b76db){var _0x280cad=_[_0x9cb1('0x4c')](_0x2f7451,_0x5b76db);_0x280cad[_0x9cb1('0x1c')]({'type':_0x548963['type'],'app':_0x9cb1('0x52'),'exten':_0x548963[_0x9cb1('0x7')],'context':_0x548963[_0x9cb1('0x6')],'priority':_[_0x9cb1('0x4b')](_0x280cad)[_0x9cb1('0x4a')]+0x1,'VoiceExtensionId':_0x548963['id']});return _0x280cad;});}}});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.rpc.js b/server/api/voiceExtension/voiceExtension.rpc.js index bdc8ce7..be994ff 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 _0xe7de=['attributes','limit','map','include','model','GetVoiceExtension','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./voiceExtension.socket','register','request','info','VoiceExtension,\x20%s,\x20%s','request\x20sent','debug','VoiceExtension,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','VoiceExtension','options','raw','where'];(function(_0x255d5b,_0x4f6f35){var _0x3e141a=function(_0x249ee2){while(--_0x249ee2){_0x255d5b['push'](_0x255d5b['shift']());}};_0x3e141a(++_0x4f6f35);}(_0xe7de,0x165));var _0xee7d=function(_0x56691a,_0x182201){_0x56691a=_0x56691a-0x0;var _0x953081=_0xe7de[_0x56691a];return _0x953081;};'use strict';var _=require(_0xee7d('0x0'));var util=require(_0xee7d('0x1'));var moment=require(_0xee7d('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xee7d('0x3'));var db=require(_0xee7d('0x4'))['db'];var utils=require(_0xee7d('0x5'));var logger=require(_0xee7d('0x6'))(_0xee7d('0x7'));var config=require(_0xee7d('0x8'));var jayson=require(_0xee7d('0x9'));var client=jayson[_0xee7d('0xa')][_0xee7d('0xb')]({'port':0x232a});config[_0xee7d('0xc')]=_[_0xee7d('0xd')](config[_0xee7d('0xc')],{'host':_0xee7d('0xe'),'port':0x18eb});var socket=require(_0xee7d('0xf'))(new Redis(config['redis']));require(_0xee7d('0x10'))[_0xee7d('0x11')](socket);function respondWithRpcPromise(_0x44e6ef,_0x474c53,_0x146172){return new BPromise(function(_0x36e00f,_0x598421){return client[_0xee7d('0x12')](_0x44e6ef,_0x146172)['then'](function(_0x1bf8af){logger[_0xee7d('0x13')](_0xee7d('0x14'),_0x474c53,_0xee7d('0x15'));logger[_0xee7d('0x16')](_0xee7d('0x17'),_0x474c53,_0xee7d('0x15'),JSON[_0xee7d('0x18')](_0x1bf8af));if(_0x1bf8af[_0xee7d('0x19')]){if(_0x1bf8af[_0xee7d('0x19')][_0xee7d('0x1a')]===0x1f4){logger['error']('VoiceExtension,\x20%s,\x20%s',_0x474c53,_0x1bf8af[_0xee7d('0x19')][_0xee7d('0x1b')]);return _0x598421(_0x1bf8af[_0xee7d('0x19')][_0xee7d('0x1b')]);}logger[_0xee7d('0x19')](_0xee7d('0x14'),_0x474c53,_0x1bf8af['error'][_0xee7d('0x1b')]);return _0x36e00f(_0x1bf8af[_0xee7d('0x19')][_0xee7d('0x1b')]);}else{logger[_0xee7d('0x13')](_0xee7d('0x14'),_0x474c53,_0xee7d('0x15'));_0x36e00f(_0x1bf8af['result'][_0xee7d('0x1b')]);}})[_0xee7d('0x1c')](function(_0x3facfb){logger['error'](_0xee7d('0x14'),_0x474c53,_0x3facfb);_0x598421(_0x3facfb);});});}exports['GetVoiceExtension']=function(_0x1ef8ea){var _0x34209e=this;return new Promise(function(_0x2eb283,_0x4f6445){return db[_0xee7d('0x1d')]['findAll']({'raw':_0x1ef8ea[_0xee7d('0x1e')]?_0x1ef8ea[_0xee7d('0x1e')][_0xee7d('0x1f')]===undefined?!![]:![]:!![],'where':_0x1ef8ea[_0xee7d('0x1e')]?_0x1ef8ea['options'][_0xee7d('0x20')]||null:null,'attributes':_0x1ef8ea[_0xee7d('0x1e')]?_0x1ef8ea[_0xee7d('0x1e')][_0xee7d('0x21')]||null:null,'limit':_0x1ef8ea[_0xee7d('0x1e')]?_0x1ef8ea[_0xee7d('0x1e')][_0xee7d('0x22')]||null:null,'include':_0x1ef8ea[_0xee7d('0x1e')]?_0x1ef8ea[_0xee7d('0x1e')]['include']?_[_0xee7d('0x23')](_0x1ef8ea[_0xee7d('0x1e')][_0xee7d('0x24')],function(_0x576d56){return{'model':db[_0x576d56[_0xee7d('0x25')]],'as':_0x576d56['as'],'attributes':_0x576d56[_0xee7d('0x21')],'include':_0x576d56[_0xee7d('0x24')]?_[_0xee7d('0x23')](_0x576d56[_0xee7d('0x24')],function(_0x1b4492){return{'model':db[_0x1b4492[_0xee7d('0x25')]],'as':_0x1b4492['as'],'attributes':_0x1b4492[_0xee7d('0x21')],'include':_0x1b4492[_0xee7d('0x24')]?_['map'](_0x1b4492[_0xee7d('0x24')],function(_0x4e1bf5){return{'model':db[_0x4e1bf5['model']],'as':_0x4e1bf5['as'],'attributes':_0x4e1bf5[_0xee7d('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x151094){logger[_0xee7d('0x13')]('GetVoiceExtension',_0x1ef8ea);logger[_0xee7d('0x16')](_0xee7d('0x26'),_0x1ef8ea,JSON[_0xee7d('0x18')](_0x151094));_0x2eb283(_0x151094);})[_0xee7d('0x1c')](function(_0xcbfec4){logger['error'](_0xee7d('0x26'),_0xcbfec4[_0xee7d('0x1b')],_0x1ef8ea);_0x4f6445(_0x34209e[_0xee7d('0x19')](0x1f4,_0xcbfec4[_0xee7d('0x1b')]));});});}; \ No newline at end of file +var _0xf1c6=['request\x20sent','error','code','message','VoiceExtension,\x20%s,\x20%s','info','catch','GetVoiceExtension','findAll','options','raw','where','attributes','limit','include','model','map','then','stringify','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','jayson/promise','client','http','defaults','localhost','socket.io-emitter','redis','register','request'];(function(_0x34021d,_0x753aa6){var _0x16597b=function(_0x2d040a){while(--_0x2d040a){_0x34021d['push'](_0x34021d['shift']());}};_0x16597b(++_0x753aa6);}(_0xf1c6,0x145));var _0x6f1c=function(_0x23427d,_0x40a66e){_0x23427d=_0x23427d-0x0;var _0x556eb3=_0xf1c6[_0x23427d];return _0x556eb3;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x6f1c('0x0'));var BPromise=require(_0x6f1c('0x1'));var rs=require(_0x6f1c('0x2'));var fs=require('fs');var Redis=require(_0x6f1c('0x3'));var db=require(_0x6f1c('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x6f1c('0x5'));var config=require('../../config/environment');var jayson=require(_0x6f1c('0x6'));var client=jayson[_0x6f1c('0x7')][_0x6f1c('0x8')]({'port':0x232a});config['redis']=_[_0x6f1c('0x9')](config['redis'],{'host':_0x6f1c('0xa'),'port':0x18eb});var socket=require(_0x6f1c('0xb'))(new Redis(config[_0x6f1c('0xc')]));require('./voiceExtension.socket')[_0x6f1c('0xd')](socket);function respondWithRpcPromise(_0x49ac1a,_0x41586d,_0x13136d){return new BPromise(function(_0x5777a0,_0x422ac2){return client[_0x6f1c('0xe')](_0x49ac1a,_0x13136d)['then'](function(_0x4817c4){logger['info']('VoiceExtension,\x20%s,\x20%s',_0x41586d,_0x6f1c('0xf'));logger['debug']('VoiceExtension,\x20%s,\x20%s,\x20%s',_0x41586d,'request\x20sent',JSON['stringify'](_0x4817c4));if(_0x4817c4['error']){if(_0x4817c4[_0x6f1c('0x10')][_0x6f1c('0x11')]===0x1f4){logger[_0x6f1c('0x10')]('VoiceExtension,\x20%s,\x20%s',_0x41586d,_0x4817c4[_0x6f1c('0x10')][_0x6f1c('0x12')]);return _0x422ac2(_0x4817c4[_0x6f1c('0x10')]['message']);}logger[_0x6f1c('0x10')](_0x6f1c('0x13'),_0x41586d,_0x4817c4['error'][_0x6f1c('0x12')]);return _0x5777a0(_0x4817c4[_0x6f1c('0x10')][_0x6f1c('0x12')]);}else{logger[_0x6f1c('0x14')](_0x6f1c('0x13'),_0x41586d,_0x6f1c('0xf'));_0x5777a0(_0x4817c4['result'][_0x6f1c('0x12')]);}})[_0x6f1c('0x15')](function(_0xfab35b){logger[_0x6f1c('0x10')](_0x6f1c('0x13'),_0x41586d,_0xfab35b);_0x422ac2(_0xfab35b);});});}exports[_0x6f1c('0x16')]=function(_0x4dbb3f){var _0x59ccaa=this;return new Promise(function(_0x58c2d8,_0x29e9b5){return db['VoiceExtension'][_0x6f1c('0x17')]({'raw':_0x4dbb3f['options']?_0x4dbb3f[_0x6f1c('0x18')][_0x6f1c('0x19')]===undefined?!![]:![]:!![],'where':_0x4dbb3f[_0x6f1c('0x18')]?_0x4dbb3f[_0x6f1c('0x18')][_0x6f1c('0x1a')]||null:null,'attributes':_0x4dbb3f[_0x6f1c('0x18')]?_0x4dbb3f[_0x6f1c('0x18')][_0x6f1c('0x1b')]||null:null,'limit':_0x4dbb3f[_0x6f1c('0x18')]?_0x4dbb3f[_0x6f1c('0x18')][_0x6f1c('0x1c')]||null:null,'include':_0x4dbb3f[_0x6f1c('0x18')]?_0x4dbb3f[_0x6f1c('0x18')][_0x6f1c('0x1d')]?_['map'](_0x4dbb3f[_0x6f1c('0x18')][_0x6f1c('0x1d')],function(_0x4a8fc1){return{'model':db[_0x4a8fc1[_0x6f1c('0x1e')]],'as':_0x4a8fc1['as'],'attributes':_0x4a8fc1[_0x6f1c('0x1b')],'include':_0x4a8fc1['include']?_['map'](_0x4a8fc1['include'],function(_0x500e36){return{'model':db[_0x500e36[_0x6f1c('0x1e')]],'as':_0x500e36['as'],'attributes':_0x500e36[_0x6f1c('0x1b')],'include':_0x500e36[_0x6f1c('0x1d')]?_[_0x6f1c('0x1f')](_0x500e36[_0x6f1c('0x1d')],function(_0x66cb25){return{'model':db[_0x66cb25[_0x6f1c('0x1e')]],'as':_0x66cb25['as'],'attributes':_0x66cb25[_0x6f1c('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x6f1c('0x20')](function(_0xd5e1a7){logger[_0x6f1c('0x14')](_0x6f1c('0x16'),_0x4dbb3f);logger['debug']('GetVoiceExtension',_0x4dbb3f,JSON[_0x6f1c('0x21')](_0xd5e1a7));_0x58c2d8(_0xd5e1a7);})[_0x6f1c('0x15')](function(_0x383802){logger[_0x6f1c('0x10')](_0x6f1c('0x16'),_0x383802['message'],_0x4dbb3f);_0x29e9b5(_0x59ccaa[_0x6f1c('0x10')](0x1f4,_0x383802['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.socket.js b/server/api/voiceExtension/voiceExtension.socket.js index 6262dec..2696546 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 _0x5fc3=['./voiceExtension.events','save','update','emit','removeListener','register','voiceExtension:'];(function(_0x22b47c,_0x3a71ba){var _0x5eb941=function(_0x220171){while(--_0x220171){_0x22b47c['push'](_0x22b47c['shift']());}};_0x5eb941(++_0x3a71ba);}(_0x5fc3,0xa8));var _0x35fc=function(_0x3816c2,_0xb221e1){_0x3816c2=_0x3816c2-0x0;var _0x144669=_0x5fc3[_0x3816c2];return _0x144669;};'use strict';var VoiceExtensionEvents=require(_0x35fc('0x0'));var events=[_0x35fc('0x1'),'remove',_0x35fc('0x2')];function createListener(_0x2ac6da,_0x196bc2){return function(_0x91d024){_0x196bc2[_0x35fc('0x3')](_0x2ac6da,_0x91d024);};}function removeListener(_0x5e75e6,_0x2d1404){return function(){VoiceExtensionEvents[_0x35fc('0x4')](_0x5e75e6,_0x2d1404);};}exports[_0x35fc('0x5')]=function(_0x5b85ad){for(var _0x5754be=0x0,_0x19a0d1=events['length'];_0x5754be<_0x19a0d1;_0x5754be++){var _0x16e153=events[_0x5754be];var _0x27524f=createListener(_0x35fc('0x6')+_0x16e153,_0x5b85ad);VoiceExtensionEvents['on'](_0x16e153,_0x27524f);}}; \ No newline at end of file +var _0x1cb9=['update','emit','removeListener','register','length','./voiceExtension.events','remove'];(function(_0x266618,_0x18f637){var _0x54dbf5=function(_0x1f7985){while(--_0x1f7985){_0x266618['push'](_0x266618['shift']());}};_0x54dbf5(++_0x18f637);}(_0x1cb9,0x14e));var _0x91cb=function(_0x523ee2,_0x4a7df1){_0x523ee2=_0x523ee2-0x0;var _0x2f4120=_0x1cb9[_0x523ee2];return _0x2f4120;};'use strict';var VoiceExtensionEvents=require(_0x91cb('0x0'));var events=['save',_0x91cb('0x1'),_0x91cb('0x2')];function createListener(_0x2b1894,_0x351bdb){return function(_0x57ea48){_0x351bdb[_0x91cb('0x3')](_0x2b1894,_0x57ea48);};}function removeListener(_0x2b7314,_0x5652cd){return function(){VoiceExtensionEvents[_0x91cb('0x4')](_0x2b7314,_0x5652cd);};}exports[_0x91cb('0x5')]=function(_0x186dc3){for(var _0x28543e=0x0,_0x3b9d98=events[_0x91cb('0x6')];_0x28543e<_0x3b9d98;_0x28543e++){var _0x4c1f56=events[_0x28543e];var _0x15c517=createListener('voiceExtension:'+_0x4c1f56,_0x186dc3);VoiceExtensionEvents['on'](_0x4c1f56,_0x15c517);}}; \ No newline at end of file diff --git a/server/api/voiceMail/index.js b/server/api/voiceMail/index.js index 4466a33..2fbeb74 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 _0x7278=['express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMail.controller','get','isAuthenticated','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x4ecdea,_0x3ef162){var _0x21f9ee=function(_0x2c31d4){while(--_0x2c31d4){_0x4ecdea['push'](_0x4ecdea['shift']());}};_0x21f9ee(++_0x3ef162);}(_0x7278,0x161));var _0x8727=function(_0x10f2e6,_0x539de3){_0x10f2e6=_0x10f2e6-0x0;var _0x94da68=_0x7278[_0x10f2e6];return _0x94da68;};'use strict';var multer=require(_0x8727('0x0'));var util=require(_0x8727('0x1'));var path=require(_0x8727('0x2'));var timeout=require(_0x8727('0x3'));var express=require(_0x8727('0x4'));var router=express['Router']();var fs_extra=require(_0x8727('0x5'));var auth=require(_0x8727('0x6'));var interaction=require(_0x8727('0x7'));var config=require(_0x8727('0x8'));var controller=require(_0x8727('0x9'));router[_0x8727('0xa')]('/',auth[_0x8727('0xb')](),controller['index']);router[_0x8727('0xa')](_0x8727('0xc'),auth[_0x8727('0xb')](),controller[_0x8727('0xd')]);router[_0x8727('0xa')]('/:id/messages',auth['isAuthenticated'](),controller['getMessages']);router[_0x8727('0xe')]('/',auth[_0x8727('0xb')](),controller[_0x8727('0xf')]);router[_0x8727('0x10')](_0x8727('0xc'),auth[_0x8727('0xb')](),controller[_0x8727('0x11')]);router[_0x8727('0x12')]('/:id',auth[_0x8727('0xb')](),controller[_0x8727('0x13')]);module[_0x8727('0x14')]=router; \ No newline at end of file +var _0x524e=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMail.controller','get','index','/:id','show','/:id/messages','isAuthenticated','getMessages','post','create','put','update','delete','destroy','path','connect-timeout'];(function(_0x555b90,_0xbe36b3){var _0x15056d=function(_0x45a83a){while(--_0x45a83a){_0x555b90['push'](_0x555b90['shift']());}};_0x15056d(++_0xbe36b3);}(_0x524e,0x15e));var _0xe524=function(_0x51c3c9,_0x141529){_0x51c3c9=_0x51c3c9-0x0;var _0x24ba14=_0x524e[_0x51c3c9];return _0x24ba14;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xe524('0x0'));var timeout=require(_0xe524('0x1'));var express=require(_0xe524('0x2'));var router=express[_0xe524('0x3')]();var fs_extra=require(_0xe524('0x4'));var auth=require(_0xe524('0x5'));var interaction=require(_0xe524('0x6'));var config=require(_0xe524('0x7'));var controller=require(_0xe524('0x8'));router[_0xe524('0x9')]('/',auth['isAuthenticated'](),controller[_0xe524('0xa')]);router[_0xe524('0x9')](_0xe524('0xb'),auth['isAuthenticated'](),controller[_0xe524('0xc')]);router[_0xe524('0x9')](_0xe524('0xd'),auth[_0xe524('0xe')](),controller[_0xe524('0xf')]);router[_0xe524('0x10')]('/',auth[_0xe524('0xe')](),controller[_0xe524('0x11')]);router[_0xe524('0x12')](_0xe524('0xb'),auth[_0xe524('0xe')](),controller[_0xe524('0x13')]);router[_0xe524('0x14')](_0xe524('0xb'),auth[_0xe524('0xe')](),controller[_0xe524('0x15')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.attributes.js b/server/api/voiceMail/voiceMail.attributes.js index 850a837..7c4961f 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 _0xc98a=['exports','from-voicemail','contest_mailbox','STRING','setDataValue','email','trim','central','ENUM','yes','TINYINT(4)','TIMESTAMP','INTEGER','VIRTUAL','fullname','\x20-\x20','getDataValue','mailbox'];(function(_0x4a229a,_0x2fd423){var _0x5545e3=function(_0x37d8a6){while(--_0x37d8a6){_0x4a229a['push'](_0x4a229a['shift']());}};_0x5545e3(++_0x2fd423);}(_0xc98a,0x18c));var _0xac98=function(_0x2d2a58,_0x1f8f4b){_0x2d2a58=_0x2d2a58-0x0;var _0x451dfb=_0xc98a[_0x2d2a58];return _0x451dfb;};'use strict';var Sequelize=require('sequelize');module[_0xac98('0x0')]={'customer_id':{'type':Sequelize['STRING']},'context':{'type':Sequelize['STRING'],'defaultValue':_0xac98('0x1'),'unique':_0xac98('0x2')},'mailbox':{'type':Sequelize[_0xac98('0x3')],'defaultValue':'','allowNull':![],'unique':_0xac98('0x2')},'password':{'type':Sequelize[_0xac98('0x3')]},'fullname':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0xac98('0x3')],'validate':{'isEmail':!![]},'set':function(_0x15ab01){this[_0xac98('0x4')](_0xac98('0x5'),typeof _0x15ab01==='string'&&_0x15ab01['trim']()?_0x15ab01[_0xac98('0x6')]():null);}},'pager':{'type':Sequelize[_0xac98('0x3')]},'tz':{'type':Sequelize['STRING'],'defaultValue':_0xac98('0x7')},'attach':{'type':Sequelize[_0xac98('0x8')](_0xac98('0x9'),'no'),'defaultValue':_0xac98('0x9'),'allowNull':![]},'saycid':{'type':Sequelize[_0xac98('0x8')](_0xac98('0x9'),'no'),'defaultValue':_0xac98('0x9'),'allowNull':![]},'dialout':{'type':Sequelize['STRING']},'callback':{'type':Sequelize[_0xac98('0x3')]},'review':{'type':Sequelize[_0xac98('0x8')](_0xac98('0x9'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0xac98('0x8')](_0xac98('0x9'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0xac98('0x8')](_0xac98('0x9'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0xac98('0xa'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0xac98('0x8')](_0xac98('0x9'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0xac98('0x8')](_0xac98('0x9'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':_0xac98('0x9'),'allowNull':![]},'forcename':{'type':Sequelize[_0xac98('0x8')](_0xac98('0x9'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize['ENUM'](_0xac98('0x9'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0xac98('0x8')]('yes','no'),'defaultValue':'yes','allowNull':![]},'stamp':{'type':_0xac98('0xb')},'emailsubject':{'type':Sequelize['STRING']},'emailbody':{'type':Sequelize[_0xac98('0x3')]},'maxsecs':{'type':Sequelize[_0xac98('0xc')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0xac98('0xc')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0xac98('0xd')],'get':function(){return this['getDataValue'](_0xac98('0xe'))+_0xac98('0xf')+this[_0xac98('0x10')](_0xac98('0x11'));}}}; \ No newline at end of file +var _0x848e=['setDataValue','email','string','trim','central','ENUM','yes','TINYINT(4)','TIMESTAMP','INTEGER','VIRTUAL','getDataValue','fullname','\x20-\x20','STRING','contest_mailbox'];(function(_0x1a0139,_0xf3f49b){var _0x111033=function(_0x4ce1ae){while(--_0x4ce1ae){_0x1a0139['push'](_0x1a0139['shift']());}};_0x111033(++_0xf3f49b);}(_0x848e,0x1be));var _0xe848=function(_0x5f03ac,_0x690a79){_0x5f03ac=_0x5f03ac-0x0;var _0x2e2fdd=_0x848e[_0x5f03ac];return _0x2e2fdd;};'use strict';var Sequelize=require('sequelize');module['exports']={'customer_id':{'type':Sequelize[_0xe848('0x0')]},'context':{'type':Sequelize[_0xe848('0x0')],'defaultValue':'from-voicemail','unique':_0xe848('0x1')},'mailbox':{'type':Sequelize[_0xe848('0x0')],'defaultValue':'','allowNull':![],'unique':_0xe848('0x1')},'password':{'type':Sequelize[_0xe848('0x0')]},'fullname':{'type':Sequelize[_0xe848('0x0')]},'email':{'type':Sequelize[_0xe848('0x0')],'validate':{'isEmail':!![]},'set':function(_0x46420c){this[_0xe848('0x2')](_0xe848('0x3'),typeof _0x46420c===_0xe848('0x4')&&_0x46420c['trim']()?_0x46420c[_0xe848('0x5')]():null);}},'pager':{'type':Sequelize[_0xe848('0x0')]},'tz':{'type':Sequelize[_0xe848('0x0')],'defaultValue':_0xe848('0x6')},'attach':{'type':Sequelize[_0xe848('0x7')](_0xe848('0x8'),'no'),'defaultValue':_0xe848('0x8'),'allowNull':![]},'saycid':{'type':Sequelize[_0xe848('0x7')](_0xe848('0x8'),'no'),'defaultValue':'yes','allowNull':![]},'dialout':{'type':Sequelize[_0xe848('0x0')]},'callback':{'type':Sequelize[_0xe848('0x0')]},'review':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0xe848('0x7')](_0xe848('0x8'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize['ENUM'](_0xe848('0x8'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0xe848('0x7')]('yes','no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0xe848('0x9'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0xe848('0x7')](_0xe848('0x8'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0xe848('0x7')](_0xe848('0x8'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0xe848('0x7')]('yes','no'),'defaultValue':_0xe848('0x8'),'allowNull':![]},'forcename':{'type':Sequelize[_0xe848('0x7')](_0xe848('0x8'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize['ENUM'](_0xe848('0x8'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0xe848('0x7')](_0xe848('0x8'),'no'),'defaultValue':_0xe848('0x8'),'allowNull':![]},'stamp':{'type':_0xe848('0xa')},'emailsubject':{'type':Sequelize[_0xe848('0x0')]},'emailbody':{'type':Sequelize['STRING']},'maxsecs':{'type':Sequelize[_0xe848('0xb')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0xe848('0xb')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0xe848('0xc')],'get':function(){return this[_0xe848('0xd')](_0xe848('0xe'))+_0xe848('0xf')+this[_0xe848('0xd')]('mailbox');}}}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.controller.js b/server/api/voiceMail/voiceMail.controller.js index 698080b..aaf53f5 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 _0x1be1=['set','Content-Range','apply','reject','save','update','then','get','Voicemails','destroy','sendStatus','error','stack','name','send','index','map','VoiceMail','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','type','include','findAll','rows','show','options','find','catch','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','findOne','VoiceMailMessage','length','mailbox','findAndCountAll','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','offset','undefined','limit','count'];(function(_0x1bd526,_0x7f95c9){var _0x271710=function(_0x47c207){while(--_0x47c207){_0x1bd526['push'](_0x1bd526['shift']());}};_0x271710(++_0x7f95c9);}(_0x1be1,0x192));var _0x11be=function(_0xbe6888,_0x10f17f){_0xbe6888=_0xbe6888-0x0;var _0x3713b0=_0x1be1[_0xbe6888];return _0x3713b0;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x11be('0x0'));var jsonpatch=require(_0x11be('0x1'));var rp=require('request-promise');var moment=require(_0x11be('0x2'));var BPromise=require(_0x11be('0x3'));var Mustache=require(_0x11be('0x4'));var util=require(_0x11be('0x5'));var path=require('path');var sox=require(_0x11be('0x6'));var csv=require(_0x11be('0x7'));var ejs=require(_0x11be('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x11be('0x9'));var squel=require('squel');var crypto=require(_0x11be('0xa'));var jsforce=require(_0x11be('0xb'));var deskjs=require(_0x11be('0xc'));var toCsv=require(_0x11be('0x7'));var querystring=require(_0x11be('0xd'));var Papa=require('papaparse');var Redis=require(_0x11be('0xe'));var authService=require(_0x11be('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x11be('0x10'));var hardwareService=require(_0x11be('0x11'));var logger=require(_0x11be('0x12'))(_0x11be('0x13'));var utils=require('../../config/utils');var config=require(_0x11be('0x14'));var licenseUtil=require(_0x11be('0x15'));var db=require(_0x11be('0x16'))['db'];function respondWithStatusCode(_0x4b36c8,_0x3ff31f){_0x3ff31f=_0x3ff31f||0xcc;return function(_0x2dad05){if(_0x2dad05){return _0x4b36c8['sendStatus'](_0x3ff31f);}return _0x4b36c8[_0x11be('0x17')](_0x3ff31f)['end']();};}function respondWithResult(_0x49228e,_0x569842){_0x569842=_0x569842||0xc8;return function(_0x4b6e7e){if(_0x4b6e7e){return _0x49228e['status'](_0x569842)['json'](_0x4b6e7e);}};}function respondWithFilteredResult(_0x588871,_0x2280e2){return function(_0x52bbef){if(_0x52bbef){var _0x31047c=typeof _0x2280e2[_0x11be('0x18')]===_0x11be('0x19')&&typeof _0x2280e2[_0x11be('0x1a')]==='undefined';var _0x2ed725=_0x52bbef[_0x11be('0x1b')];var _0x56ab61=_0x31047c?0x0:_0x2280e2[_0x11be('0x18')];var _0xc3263c=_0x31047c?_0x52bbef[_0x11be('0x1b')]:_0x2280e2['offset']+_0x2280e2['limit'];var _0x141391;if(_0xc3263c>=_0x2ed725){_0xc3263c=_0x2ed725;_0x141391=0xc8;}else{_0x141391=0xce;}_0x588871[_0x11be('0x17')](_0x141391);return _0x588871[_0x11be('0x1c')](_0x11be('0x1d'),_0x56ab61+'-'+_0xc3263c+'/'+_0x2ed725)['json'](_0x52bbef);}return null;};}function patchUpdates(_0x12a5bd){return function(_0x45136f){try{jsonpatch[_0x11be('0x1e')](_0x45136f,_0x12a5bd,!![]);}catch(_0x452315){return BPromise[_0x11be('0x1f')](_0x452315);}return _0x45136f[_0x11be('0x20')]();};}function saveUpdates(_0xa944ac,_0x17678d){return function(_0x3aea14){if(_0x3aea14){return _0x3aea14[_0x11be('0x21')](_0xa944ac)['then'](function(_0xfe3737){return _0xfe3737;});}return null;};}function removeEntity(_0x46b7c2,_0x2fe43c){return function(_0x5d1690){if(_0x5d1690){return _0x5d1690['destroy']()[_0x11be('0x22')](function(){var _0x10ce04=_0x5d1690[_0x11be('0x23')]({'plain':!![]});var _0x4cb27f=_0x11be('0x24');return db['UserProfileResource'][_0x11be('0x25')]({'where':{'type':_0x4cb27f,'resourceId':_0x10ce04['id']}})['then'](function(){return _0x5d1690;});})[_0x11be('0x22')](function(){_0x46b7c2[_0x11be('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x48029b,_0x28b3a0){return function(_0x1d3b5c){if(!_0x1d3b5c){_0x48029b[_0x11be('0x26')](0x194);}return _0x1d3b5c;};}function handleError(_0x30427b,_0x17c67f){_0x17c67f=_0x17c67f||0x1f4;return function(_0xf5a6ac){logger[_0x11be('0x27')](_0xf5a6ac[_0x11be('0x28')]);if(_0xf5a6ac['name']){delete _0xf5a6ac[_0x11be('0x29')];}_0x30427b['status'](_0x17c67f)[_0x11be('0x2a')](_0xf5a6ac);};}exports[_0x11be('0x2b')]=function(_0x510476,_0x584d4c){var _0x49fd5c={},_0x265fc9={},_0x5e8f9a={'count':0x0,'rows':[]};var _0x66316d=_[_0x11be('0x2c')](db[_0x11be('0x2d')][_0x11be('0x2e')],function(_0x25e214){return{'name':_0x25e214[_0x11be('0x2f')],'type':_0x25e214['type'][_0x11be('0x30')]};});_0x265fc9[_0x11be('0x31')]=_[_0x11be('0x2c')](_0x66316d,_0x11be('0x29'));_0x265fc9[_0x11be('0x32')]=_[_0x11be('0x33')](_0x510476['query']);_0x265fc9[_0x11be('0x34')]=_[_0x11be('0x35')](_0x265fc9[_0x11be('0x31')],_0x265fc9[_0x11be('0x32')]);_0x49fd5c[_0x11be('0x36')]=_['intersection'](_0x265fc9[_0x11be('0x31')],qs[_0x11be('0x37')](_0x510476[_0x11be('0x32')]['fields']));_0x49fd5c[_0x11be('0x36')]=_0x49fd5c['attributes']['length']?_0x49fd5c['attributes']:_0x265fc9['model'];if(!_0x510476[_0x11be('0x32')][_0x11be('0x38')](_0x11be('0x39'))){_0x49fd5c['limit']=qs[_0x11be('0x1a')](_0x510476[_0x11be('0x32')]['limit']);_0x49fd5c[_0x11be('0x18')]=qs['offset'](_0x510476[_0x11be('0x32')]['offset']);}_0x49fd5c[_0x11be('0x3a')]=qs[_0x11be('0x3b')](_0x510476[_0x11be('0x32')][_0x11be('0x3b')]);_0x49fd5c['where']=qs[_0x11be('0x34')](_[_0x11be('0x3c')](_0x510476[_0x11be('0x32')],_0x265fc9[_0x11be('0x34')]),_0x66316d);if(_0x510476['query'][_0x11be('0x3d')]){_0x49fd5c[_0x11be('0x3e')]=_[_0x11be('0x3f')](_0x49fd5c[_0x11be('0x3e')],{'$or':_[_0x11be('0x2c')](_0x66316d,function(_0x1b1aac){if(_0x1b1aac[_0x11be('0x40')]!=='VIRTUAL'){var _0x2618f5={};_0x2618f5[_0x1b1aac[_0x11be('0x29')]]={'$like':'%'+_0x510476['query'][_0x11be('0x3d')]+'%'};return _0x2618f5;}})});}_0x49fd5c=_[_0x11be('0x3f')]({},_0x49fd5c,_0x510476['options']);var _0x30b67a={'where':_0x49fd5c['where']};return db[_0x11be('0x2d')]['count'](_0x30b67a)[_0x11be('0x22')](function(_0x30be21){_0x5e8f9a['count']=_0x30be21;if(_0x510476[_0x11be('0x32')]['includeAll']){_0x49fd5c[_0x11be('0x41')]=[{'all':!![]}];}return db[_0x11be('0x2d')][_0x11be('0x42')](_0x49fd5c);})[_0x11be('0x22')](function(_0x2b847a){_0x5e8f9a[_0x11be('0x43')]=_0x2b847a;return _0x5e8f9a;})[_0x11be('0x22')](respondWithFilteredResult(_0x584d4c,_0x49fd5c))['catch'](handleError(_0x584d4c,null));};exports[_0x11be('0x44')]=function(_0x18cddf,_0x9610a1){var _0x317e2d={'raw':!![],'where':{'id':_0x18cddf['params']['id']}},_0x589ac4={};_0x589ac4['model']=_[_0x11be('0x33')](db['VoiceMail'][_0x11be('0x2e')]);_0x589ac4['query']=_[_0x11be('0x33')](_0x18cddf[_0x11be('0x32')]);_0x589ac4[_0x11be('0x34')]=_[_0x11be('0x35')](_0x589ac4[_0x11be('0x31')],_0x589ac4[_0x11be('0x32')]);_0x317e2d[_0x11be('0x36')]=_['intersection'](_0x589ac4[_0x11be('0x31')],qs['fields'](_0x18cddf[_0x11be('0x32')][_0x11be('0x37')]));_0x317e2d[_0x11be('0x36')]=_0x317e2d['attributes']['length']?_0x317e2d['attributes']:_0x589ac4[_0x11be('0x31')];if(_0x18cddf[_0x11be('0x32')]['includeAll']){_0x317e2d['include']=[{'all':!![]}];}_0x317e2d=_['merge']({},_0x317e2d,_0x18cddf[_0x11be('0x45')]);return db[_0x11be('0x2d')][_0x11be('0x46')](_0x317e2d)[_0x11be('0x22')](handleEntityNotFound(_0x9610a1,null))[_0x11be('0x22')](respondWithResult(_0x9610a1,null))[_0x11be('0x47')](handleError(_0x9610a1,null));};exports[_0x11be('0x48')]=function(_0x3f2070,_0x2ce110){return db[_0x11be('0x2d')][_0x11be('0x48')](_0x3f2070['body'],{})[_0x11be('0x22')](function(_0x29f82f){var _0x534ee7=_0x3f2070['user']['get']({'plain':!![]});if(!_0x534ee7)throw new Error(_0x11be('0x49'));if(_0x534ee7['role']===_0x11be('0x4a')){var _0x1c1626=_0x29f82f[_0x11be('0x23')]({'plain':!![]});var _0x1fb48d=_0x11be('0x24');return db[_0x11be('0x4b')][_0x11be('0x46')]({'where':{'name':_0x1fb48d,'userProfileId':_0x534ee7[_0x11be('0x4c')]},'raw':!![]})[_0x11be('0x22')](function(_0x4c873a){if(_0x4c873a&&_0x4c873a[_0x11be('0x4d')]===0x0){return db['UserProfileResource'][_0x11be('0x48')]({'name':_0x1c1626[_0x11be('0x29')],'resourceId':_0x1c1626['id'],'type':_0x4c873a['name'],'sectionId':_0x4c873a['id']},{})[_0x11be('0x22')](function(){return _0x29f82f;});}else{return _0x29f82f;}})[_0x11be('0x47')](function(_0x4c0e37){logger[_0x11be('0x27')](_0x11be('0x4e'),_0x4c0e37);throw _0x4c0e37;});}return _0x29f82f;})['then'](respondWithResult(_0x2ce110,0xc9))['catch'](handleError(_0x2ce110,null));};exports[_0x11be('0x21')]=function(_0x2886ac,_0x50eeab){if(_0x2886ac['body']['id']){delete _0x2886ac[_0x11be('0x4f')]['id'];}return db[_0x11be('0x2d')][_0x11be('0x46')]({'where':{'id':_0x2886ac['params']['id']}})['then'](handleEntityNotFound(_0x50eeab,null))['then'](saveUpdates(_0x2886ac[_0x11be('0x4f')],null))[_0x11be('0x22')](respondWithResult(_0x50eeab,null))[_0x11be('0x47')](handleError(_0x50eeab,null));};exports['destroy']=function(_0x4db963,_0x33409c){return db[_0x11be('0x2d')][_0x11be('0x46')]({'where':{'id':_0x4db963[_0x11be('0x50')]['id']}})['then'](handleEntityNotFound(_0x33409c,null))[_0x11be('0x22')](removeEntity(_0x33409c,null))['catch'](handleError(_0x33409c,null));};exports['getMessages']=function(_0x568f20,_0x5aa6bf,_0x1a43df){return db[_0x11be('0x2d')][_0x11be('0x51')]({'where':{'id':_0x568f20[_0x11be('0x50')]['id']}})[_0x11be('0x22')](handleEntityNotFound(_0x5aa6bf,null))[_0x11be('0x22')](function(_0xb97604){var _0x55e79d;var _0x54e52a={},_0x7c1ee5={};_0x7c1ee5[_0x11be('0x31')]=_[_0x11be('0x33')](db[_0x11be('0x52')][_0x11be('0x2e')]);_0x7c1ee5[_0x11be('0x32')]=_[_0x11be('0x33')](_0x568f20[_0x11be('0x32')]);_0x7c1ee5[_0x11be('0x34')]=_['intersection'](_0x7c1ee5[_0x11be('0x31')],_0x7c1ee5[_0x11be('0x32')]);_0x54e52a[_0x11be('0x36')]=_['intersection'](_0x7c1ee5[_0x11be('0x31')],qs[_0x11be('0x37')](_0x568f20['query']['fields']));_0x54e52a[_0x11be('0x36')]=_0x54e52a[_0x11be('0x36')][_0x11be('0x53')]?_0x54e52a[_0x11be('0x36')]:_0x7c1ee5['model'];if(!_0x568f20[_0x11be('0x32')][_0x11be('0x38')](_0x11be('0x39'))){_0x54e52a[_0x11be('0x1a')]=qs[_0x11be('0x1a')](_0x568f20[_0x11be('0x32')][_0x11be('0x1a')]);_0x54e52a[_0x11be('0x18')]=qs[_0x11be('0x18')](_0x568f20['query']['offset']);}_0x54e52a[_0x11be('0x3a')]=qs[_0x11be('0x3b')](_0x568f20['query'][_0x11be('0x3b')]);_0x54e52a[_0x11be('0x3e')]=qs[_0x11be('0x34')](_[_0x11be('0x3c')](_0x568f20[_0x11be('0x32')],_0x7c1ee5[_0x11be('0x34')]));if(_0x568f20[_0x11be('0x32')]['filter']){_0x54e52a['where']=_[_0x11be('0x3f')](_0x54e52a[_0x11be('0x3e')],{'$or':_[_0x11be('0x2c')](_0x54e52a['attributes'],function(_0x82c02c){var _0x422696={};_0x422696[_0x82c02c]={'$like':'%'+_0x568f20[_0x11be('0x32')][_0x11be('0x3d')]+'%'};return _0x422696;})});}_0x54e52a[_0x11be('0x3e')]=_[_0x11be('0x3f')](_0x54e52a[_0x11be('0x3e')],{'mailboxuser':_0xb97604[_0x11be('0x54')]});_0x54e52a=_[_0x11be('0x3f')]({},_0x54e52a,_0x568f20[_0x11be('0x45')]);return db[_0x11be('0x52')][_0x11be('0x55')](_0x54e52a)[_0x11be('0x22')](respondWithFilteredResult(_0x5aa6bf,_0x54e52a));})[_0x11be('0x47')](handleError(_0x5aa6bf,null));}; \ No newline at end of file +var _0xbfcc=['stack','name','send','index','map','VoiceMail','rawAttributes','fieldName','type','key','keys','query','filters','attributes','intersection','model','fields','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','length','find','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','create','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','getMessages','nolimit','VoiceMailMessage','eml-format','fast-json-patch','request-promise','moment','bluebird','to-csv','ejs','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','limit','undefined','offset','count','set','Content-Range','json','reject','then','destroy','get','Voicemails','UserProfileResource','error'];(function(_0xb8be32,_0x2c1e92){var _0x25283d=function(_0x4cad99){while(--_0x4cad99){_0xb8be32['push'](_0xb8be32['shift']());}};_0x25283d(++_0x2c1e92);}(_0xbfcc,0x1dd));var _0xcbfc=function(_0x2ddfd9,_0x5877d0){_0x2ddfd9=_0x2ddfd9-0x0;var _0x2668f0=_0xbfcc[_0x2ddfd9];return _0x2668f0;};'use strict';var emlformat=require(_0xcbfc('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xcbfc('0x1'));var rp=require(_0xcbfc('0x2'));var moment=require(_0xcbfc('0x3'));var BPromise=require(_0xcbfc('0x4'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xcbfc('0x5'));var ejs=require(_0xcbfc('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xcbfc('0x7'));var squel=require('squel');var crypto=require(_0xcbfc('0x8'));var jsforce=require(_0xcbfc('0x9'));var deskjs=require(_0xcbfc('0xa'));var toCsv=require(_0xcbfc('0x5'));var querystring=require('querystring');var Papa=require(_0xcbfc('0xb'));var Redis=require(_0xcbfc('0xc'));var authService=require(_0xcbfc('0xd'));var qs=require(_0xcbfc('0xe'));var as=require(_0xcbfc('0xf'));var hardwareService=require(_0xcbfc('0x10'));var logger=require('../../config/logger')(_0xcbfc('0x11'));var utils=require(_0xcbfc('0x12'));var config=require(_0xcbfc('0x13'));var licenseUtil=require(_0xcbfc('0x14'));var db=require(_0xcbfc('0x15'))['db'];function respondWithStatusCode(_0x4e8b34,_0x3bfd05){_0x3bfd05=_0x3bfd05||0xcc;return function(_0x86f67c){if(_0x86f67c){return _0x4e8b34[_0xcbfc('0x16')](_0x3bfd05);}return _0x4e8b34['status'](_0x3bfd05)[_0xcbfc('0x17')]();};}function respondWithResult(_0x3ec338,_0x2f2bdd){_0x2f2bdd=_0x2f2bdd||0xc8;return function(_0x45a5cc){if(_0x45a5cc){return _0x3ec338[_0xcbfc('0x18')](_0x2f2bdd)['json'](_0x45a5cc);}};}function respondWithFilteredResult(_0x3c69ed,_0x1963de){return function(_0x1ec8c4){if(_0x1ec8c4){var _0x4317e4=typeof _0x1963de['offset']==='undefined'&&typeof _0x1963de[_0xcbfc('0x19')]===_0xcbfc('0x1a');var _0xa65368=_0x1ec8c4['count'];var _0x5b078f=_0x4317e4?0x0:_0x1963de[_0xcbfc('0x1b')];var _0x99b59d=_0x4317e4?_0x1ec8c4[_0xcbfc('0x1c')]:_0x1963de['offset']+_0x1963de[_0xcbfc('0x19')];var _0x552777;if(_0x99b59d>=_0xa65368){_0x99b59d=_0xa65368;_0x552777=0xc8;}else{_0x552777=0xce;}_0x3c69ed[_0xcbfc('0x18')](_0x552777);return _0x3c69ed[_0xcbfc('0x1d')](_0xcbfc('0x1e'),_0x5b078f+'-'+_0x99b59d+'/'+_0xa65368)[_0xcbfc('0x1f')](_0x1ec8c4);}return null;};}function patchUpdates(_0x25c167){return function(_0x2653b1){try{jsonpatch['apply'](_0x2653b1,_0x25c167,!![]);}catch(_0x9c79da){return BPromise[_0xcbfc('0x20')](_0x9c79da);}return _0x2653b1['save']();};}function saveUpdates(_0x1da958,_0x5a449b){return function(_0x4cc8b3){if(_0x4cc8b3){return _0x4cc8b3['update'](_0x1da958)[_0xcbfc('0x21')](function(_0x4a0fcb){return _0x4a0fcb;});}return null;};}function removeEntity(_0x4a1915,_0x1b3e42){return function(_0x34cffa){if(_0x34cffa){return _0x34cffa[_0xcbfc('0x22')]()[_0xcbfc('0x21')](function(){var _0x49f5bf=_0x34cffa[_0xcbfc('0x23')]({'plain':!![]});var _0x51284a=_0xcbfc('0x24');return db[_0xcbfc('0x25')]['destroy']({'where':{'type':_0x51284a,'resourceId':_0x49f5bf['id']}})[_0xcbfc('0x21')](function(){return _0x34cffa;});})[_0xcbfc('0x21')](function(){_0x4a1915['status'](0xcc)[_0xcbfc('0x17')]();});}};}function handleEntityNotFound(_0x3c3afd,_0x2f7549){return function(_0x41f3b8){if(!_0x41f3b8){_0x3c3afd['sendStatus'](0x194);}return _0x41f3b8;};}function handleError(_0x29f896,_0x1ec530){_0x1ec530=_0x1ec530||0x1f4;return function(_0x4f632a){logger[_0xcbfc('0x26')](_0x4f632a[_0xcbfc('0x27')]);if(_0x4f632a[_0xcbfc('0x28')]){delete _0x4f632a[_0xcbfc('0x28')];}_0x29f896[_0xcbfc('0x18')](_0x1ec530)[_0xcbfc('0x29')](_0x4f632a);};}exports[_0xcbfc('0x2a')]=function(_0x5366cf,_0x41b68b){var _0x433300={},_0x3f9d20={},_0x20a378={'count':0x0,'rows':[]};var _0x500a0b=_[_0xcbfc('0x2b')](db[_0xcbfc('0x2c')][_0xcbfc('0x2d')],function(_0x245986){return{'name':_0x245986[_0xcbfc('0x2e')],'type':_0x245986[_0xcbfc('0x2f')][_0xcbfc('0x30')]};});_0x3f9d20['model']=_[_0xcbfc('0x2b')](_0x500a0b,_0xcbfc('0x28'));_0x3f9d20['query']=_[_0xcbfc('0x31')](_0x5366cf[_0xcbfc('0x32')]);_0x3f9d20[_0xcbfc('0x33')]=_['intersection'](_0x3f9d20['model'],_0x3f9d20['query']);_0x433300[_0xcbfc('0x34')]=_[_0xcbfc('0x35')](_0x3f9d20[_0xcbfc('0x36')],qs[_0xcbfc('0x37')](_0x5366cf[_0xcbfc('0x32')][_0xcbfc('0x37')]));_0x433300[_0xcbfc('0x34')]=_0x433300[_0xcbfc('0x34')]['length']?_0x433300[_0xcbfc('0x34')]:_0x3f9d20[_0xcbfc('0x36')];if(!_0x5366cf['query'][_0xcbfc('0x38')]('nolimit')){_0x433300[_0xcbfc('0x19')]=qs[_0xcbfc('0x19')](_0x5366cf[_0xcbfc('0x32')]['limit']);_0x433300[_0xcbfc('0x1b')]=qs['offset'](_0x5366cf['query'][_0xcbfc('0x1b')]);}_0x433300[_0xcbfc('0x39')]=qs[_0xcbfc('0x3a')](_0x5366cf[_0xcbfc('0x32')][_0xcbfc('0x3a')]);_0x433300[_0xcbfc('0x3b')]=qs[_0xcbfc('0x33')](_[_0xcbfc('0x3c')](_0x5366cf['query'],_0x3f9d20[_0xcbfc('0x33')]),_0x500a0b);if(_0x5366cf['query'][_0xcbfc('0x3d')]){_0x433300[_0xcbfc('0x3b')]=_[_0xcbfc('0x3e')](_0x433300[_0xcbfc('0x3b')],{'$or':_['map'](_0x500a0b,function(_0x5306e9){if(_0x5306e9[_0xcbfc('0x2f')]!==_0xcbfc('0x3f')){var _0x404f46={};_0x404f46[_0x5306e9[_0xcbfc('0x28')]]={'$like':'%'+_0x5366cf[_0xcbfc('0x32')]['filter']+'%'};return _0x404f46;}})});}_0x433300=_[_0xcbfc('0x3e')]({},_0x433300,_0x5366cf[_0xcbfc('0x40')]);var _0xf2da32={'where':_0x433300['where']};return db[_0xcbfc('0x2c')][_0xcbfc('0x1c')](_0xf2da32)[_0xcbfc('0x21')](function(_0x4ca55c){_0x20a378[_0xcbfc('0x1c')]=_0x4ca55c;if(_0x5366cf[_0xcbfc('0x32')][_0xcbfc('0x41')]){_0x433300[_0xcbfc('0x42')]=[{'all':!![]}];}return db[_0xcbfc('0x2c')][_0xcbfc('0x43')](_0x433300);})[_0xcbfc('0x21')](function(_0x561544){_0x20a378[_0xcbfc('0x44')]=_0x561544;return _0x20a378;})[_0xcbfc('0x21')](respondWithFilteredResult(_0x41b68b,_0x433300))['catch'](handleError(_0x41b68b,null));};exports[_0xcbfc('0x45')]=function(_0x50a01c,_0x17b87b){var _0xdc0521={'raw':!![],'where':{'id':_0x50a01c[_0xcbfc('0x46')]['id']}},_0xd609ec={};_0xd609ec[_0xcbfc('0x36')]=_[_0xcbfc('0x31')](db['VoiceMail'][_0xcbfc('0x2d')]);_0xd609ec[_0xcbfc('0x32')]=_[_0xcbfc('0x31')](_0x50a01c[_0xcbfc('0x32')]);_0xd609ec[_0xcbfc('0x33')]=_[_0xcbfc('0x35')](_0xd609ec[_0xcbfc('0x36')],_0xd609ec['query']);_0xdc0521[_0xcbfc('0x34')]=_[_0xcbfc('0x35')](_0xd609ec['model'],qs[_0xcbfc('0x37')](_0x50a01c[_0xcbfc('0x32')][_0xcbfc('0x37')]));_0xdc0521['attributes']=_0xdc0521[_0xcbfc('0x34')][_0xcbfc('0x47')]?_0xdc0521[_0xcbfc('0x34')]:_0xd609ec[_0xcbfc('0x36')];if(_0x50a01c[_0xcbfc('0x32')][_0xcbfc('0x41')]){_0xdc0521[_0xcbfc('0x42')]=[{'all':!![]}];}_0xdc0521=_['merge']({},_0xdc0521,_0x50a01c['options']);return db[_0xcbfc('0x2c')][_0xcbfc('0x48')](_0xdc0521)[_0xcbfc('0x21')](handleEntityNotFound(_0x17b87b,null))[_0xcbfc('0x21')](respondWithResult(_0x17b87b,null))['catch'](handleError(_0x17b87b,null));};exports['create']=function(_0x2e89bf,_0xe5c5ef){return db[_0xcbfc('0x2c')]['create'](_0x2e89bf[_0xcbfc('0x49')],{})[_0xcbfc('0x21')](function(_0x4446b7){var _0x4b3096=_0x2e89bf[_0xcbfc('0x4a')][_0xcbfc('0x23')]({'plain':!![]});if(!_0x4b3096)throw new Error(_0xcbfc('0x4b'));if(_0x4b3096[_0xcbfc('0x4c')]===_0xcbfc('0x4a')){var _0xd9976d=_0x4446b7[_0xcbfc('0x23')]({'plain':!![]});var _0x374998=_0xcbfc('0x24');return db[_0xcbfc('0x4d')]['find']({'where':{'name':_0x374998,'userProfileId':_0x4b3096[_0xcbfc('0x4e')]},'raw':!![]})[_0xcbfc('0x21')](function(_0x44cc11){if(_0x44cc11&&_0x44cc11['autoAssociation']===0x0){return db[_0xcbfc('0x25')][_0xcbfc('0x4f')]({'name':_0xd9976d['name'],'resourceId':_0xd9976d['id'],'type':_0x44cc11[_0xcbfc('0x28')],'sectionId':_0x44cc11['id']},{})[_0xcbfc('0x21')](function(){return _0x4446b7;});}else{return _0x4446b7;}})[_0xcbfc('0x50')](function(_0x25e48d){logger['error'](_0xcbfc('0x51'),_0x25e48d);throw _0x25e48d;});}return _0x4446b7;})[_0xcbfc('0x21')](respondWithResult(_0xe5c5ef,0xc9))['catch'](handleError(_0xe5c5ef,null));};exports[_0xcbfc('0x52')]=function(_0x34db13,_0x3ed9f0){if(_0x34db13[_0xcbfc('0x49')]['id']){delete _0x34db13[_0xcbfc('0x49')]['id'];}return db[_0xcbfc('0x2c')][_0xcbfc('0x48')]({'where':{'id':_0x34db13[_0xcbfc('0x46')]['id']}})[_0xcbfc('0x21')](handleEntityNotFound(_0x3ed9f0,null))[_0xcbfc('0x21')](saveUpdates(_0x34db13['body'],null))[_0xcbfc('0x21')](respondWithResult(_0x3ed9f0,null))['catch'](handleError(_0x3ed9f0,null));};exports['destroy']=function(_0x4a10e6,_0x4239da){return db[_0xcbfc('0x2c')][_0xcbfc('0x48')]({'where':{'id':_0x4a10e6[_0xcbfc('0x46')]['id']}})[_0xcbfc('0x21')](handleEntityNotFound(_0x4239da,null))[_0xcbfc('0x21')](removeEntity(_0x4239da,null))[_0xcbfc('0x50')](handleError(_0x4239da,null));};exports[_0xcbfc('0x53')]=function(_0x4d2df1,_0x9e0c38,_0xf5f5e1){return db[_0xcbfc('0x2c')]['findOne']({'where':{'id':_0x4d2df1[_0xcbfc('0x46')]['id']}})[_0xcbfc('0x21')](handleEntityNotFound(_0x9e0c38,null))[_0xcbfc('0x21')](function(_0x3b526f){var _0x1ed350;var _0x310b78={},_0x34ec1d={};_0x34ec1d['model']=_[_0xcbfc('0x31')](db['VoiceMailMessage'][_0xcbfc('0x2d')]);_0x34ec1d[_0xcbfc('0x32')]=_['keys'](_0x4d2df1[_0xcbfc('0x32')]);_0x34ec1d['filters']=_[_0xcbfc('0x35')](_0x34ec1d[_0xcbfc('0x36')],_0x34ec1d[_0xcbfc('0x32')]);_0x310b78[_0xcbfc('0x34')]=_[_0xcbfc('0x35')](_0x34ec1d[_0xcbfc('0x36')],qs['fields'](_0x4d2df1[_0xcbfc('0x32')][_0xcbfc('0x37')]));_0x310b78['attributes']=_0x310b78[_0xcbfc('0x34')][_0xcbfc('0x47')]?_0x310b78[_0xcbfc('0x34')]:_0x34ec1d[_0xcbfc('0x36')];if(!_0x4d2df1[_0xcbfc('0x32')][_0xcbfc('0x38')](_0xcbfc('0x54'))){_0x310b78[_0xcbfc('0x19')]=qs['limit'](_0x4d2df1[_0xcbfc('0x32')][_0xcbfc('0x19')]);_0x310b78[_0xcbfc('0x1b')]=qs[_0xcbfc('0x1b')](_0x4d2df1[_0xcbfc('0x32')][_0xcbfc('0x1b')]);}_0x310b78[_0xcbfc('0x39')]=qs[_0xcbfc('0x3a')](_0x4d2df1[_0xcbfc('0x32')][_0xcbfc('0x3a')]);_0x310b78['where']=qs[_0xcbfc('0x33')](_[_0xcbfc('0x3c')](_0x4d2df1['query'],_0x34ec1d[_0xcbfc('0x33')]));if(_0x4d2df1['query']['filter']){_0x310b78[_0xcbfc('0x3b')]=_[_0xcbfc('0x3e')](_0x310b78[_0xcbfc('0x3b')],{'$or':_[_0xcbfc('0x2b')](_0x310b78[_0xcbfc('0x34')],function(_0x4d8d2a){var _0x53babd={};_0x53babd[_0x4d8d2a]={'$like':'%'+_0x4d2df1[_0xcbfc('0x32')][_0xcbfc('0x3d')]+'%'};return _0x53babd;})});}_0x310b78[_0xcbfc('0x3b')]=_[_0xcbfc('0x3e')](_0x310b78[_0xcbfc('0x3b')],{'mailboxuser':_0x3b526f['mailbox']});_0x310b78=_[_0xcbfc('0x3e')]({},_0x310b78,_0x4d2df1[_0xcbfc('0x40')]);return db[_0xcbfc('0x55')]['findAndCountAll'](_0x310b78)['then'](respondWithFilteredResult(_0x9e0c38,_0x310b78));})['catch'](handleError(_0x9e0c38,null));}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.model.js b/server/api/voiceMail/voiceMail.model.js index 72d2780..d8941a9 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 _0xdfbc=['voice_voicemail','mailbox','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./voiceMail.attributes','exports','define','VoiceMail'];(function(_0x1dca5c,_0x405d6a){var _0x12bb8f=function(_0x2c2629){while(--_0x2c2629){_0x1dca5c['push'](_0x1dca5c['shift']());}};_0x12bb8f(++_0x405d6a);}(_0xdfbc,0x188));var _0xcdfb=function(_0x2a5a11,_0x4f6f1c){_0x2a5a11=_0x2a5a11-0x0;var _0x233839=_0xdfbc[_0x2a5a11];return _0x233839;};'use strict';var _=require(_0xcdfb('0x0'));var util=require(_0xcdfb('0x1'));var logger=require(_0xcdfb('0x2'))(_0xcdfb('0x3'));var moment=require(_0xcdfb('0x4'));var BPromise=require(_0xcdfb('0x5'));var rp=require(_0xcdfb('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xcdfb('0x7'));var config=require(_0xcdfb('0x8'));var attributes=require(_0xcdfb('0x9'));module[_0xcdfb('0xa')]=function(_0x5e0411,_0x286174){return _0x5e0411[_0xcdfb('0xb')](_0xcdfb('0xc'),attributes,{'tableName':_0xcdfb('0xd'),'paranoid':![],'indexes':[{'name':'mailbox_context','fields':[_0xcdfb('0xe'),'context']}],'timestamps':!![]});}; \ No newline at end of file +var _0x3031=['lodash','util','../../config/logger','api','bluebird','path','../../config/environment','./voiceMail.attributes','exports','voice_voicemail','mailbox_context','mailbox'];(function(_0x308213,_0x224541){var _0x2e1619=function(_0x972b51){while(--_0x972b51){_0x308213['push'](_0x308213['shift']());}};_0x2e1619(++_0x224541);}(_0x3031,0x9c));var _0x1303=function(_0xb681a0,_0x3fb054){_0xb681a0=_0xb681a0-0x0;var _0x47890e=_0x3031[_0xb681a0];return _0x47890e;};'use strict';var _=require(_0x1303('0x0'));var util=require(_0x1303('0x1'));var logger=require(_0x1303('0x2'))(_0x1303('0x3'));var moment=require('moment');var BPromise=require(_0x1303('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1303('0x5'));var rimraf=require('rimraf');var config=require(_0x1303('0x6'));var attributes=require(_0x1303('0x7'));module[_0x1303('0x8')]=function(_0x184e03,_0x222ec7){return _0x184e03['define']('VoiceMail',attributes,{'tableName':_0x1303('0x9'),'paranoid':![],'indexes':[{'name':_0x1303('0xa'),'fields':[_0x1303('0xb'),'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 138beca..b09f547 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 _0xf7d6=['message','info','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/environment','http','request','then','VoiceMail,\x20%s,\x20%s','request\x20sent','debug','VoiceMail,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x3f95b7,_0x4065c4){var _0x210713=function(_0x588202){while(--_0x588202){_0x3f95b7['push'](_0x3f95b7['shift']());}};_0x210713(++_0x4065c4);}(_0xf7d6,0x1e3));var _0x6f7d=function(_0x491a7f,_0x28bb80){_0x491a7f=_0x491a7f-0x0;var _0x3d8f44=_0xf7d6[_0x491a7f];return _0x3d8f44;};'use strict';var _=require(_0x6f7d('0x0'));var util=require(_0x6f7d('0x1'));var moment=require(_0x6f7d('0x2'));var BPromise=require(_0x6f7d('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6f7d('0x4'));var db=require(_0x6f7d('0x5'))['db'];var utils=require(_0x6f7d('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x6f7d('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x6f7d('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x406879,_0x242d88,_0x42ff28){return new BPromise(function(_0x2f2eb0,_0x22bcbb){return client[_0x6f7d('0x9')](_0x406879,_0x42ff28)[_0x6f7d('0xa')](function(_0x5d53aa){logger['info'](_0x6f7d('0xb'),_0x242d88,_0x6f7d('0xc'));logger[_0x6f7d('0xd')](_0x6f7d('0xe'),_0x242d88,_0x6f7d('0xc'),JSON[_0x6f7d('0xf')](_0x5d53aa));if(_0x5d53aa[_0x6f7d('0x10')]){if(_0x5d53aa[_0x6f7d('0x10')]['code']===0x1f4){logger[_0x6f7d('0x10')](_0x6f7d('0xb'),_0x242d88,_0x5d53aa['error']['message']);return _0x22bcbb(_0x5d53aa['error'][_0x6f7d('0x11')]);}logger[_0x6f7d('0x10')](_0x6f7d('0xb'),_0x242d88,_0x5d53aa[_0x6f7d('0x10')][_0x6f7d('0x11')]);return _0x2f2eb0(_0x5d53aa[_0x6f7d('0x10')]['message']);}else{logger[_0x6f7d('0x12')]('VoiceMail,\x20%s,\x20%s',_0x242d88,'request\x20sent');_0x2f2eb0(_0x5d53aa['result'][_0x6f7d('0x11')]);}})[_0x6f7d('0x13')](function(_0x48ab55){logger['error'](_0x6f7d('0xb'),_0x242d88,_0x48ab55);_0x22bcbb(_0x48ab55);});});} \ No newline at end of file +var _0x6421=['code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','VoiceMail,\x20%s,\x20%s','request\x20sent','debug','VoiceMail,\x20%s,\x20%s,\x20%s','error'];(function(_0x25701b,_0x2a6976){var _0x3a8a2c=function(_0x1a5e78){while(--_0x1a5e78){_0x25701b['push'](_0x25701b['shift']());}};_0x3a8a2c(++_0x2a6976);}(_0x6421,0xa4));var _0x1642=function(_0x530ea1,_0x14502e){_0x530ea1=_0x530ea1-0x0;var _0x4bc8f1=_0x6421[_0x530ea1];return _0x4bc8f1;};'use strict';var _=require(_0x1642('0x0'));var util=require(_0x1642('0x1'));var moment=require(_0x1642('0x2'));var BPromise=require(_0x1642('0x3'));var rs=require(_0x1642('0x4'));var fs=require('fs');var Redis=require(_0x1642('0x5'));var db=require(_0x1642('0x6'))['db'];var utils=require(_0x1642('0x7'));var logger=require(_0x1642('0x8'))(_0x1642('0x9'));var config=require(_0x1642('0xa'));var jayson=require(_0x1642('0xb'));var client=jayson['client'][_0x1642('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1dfeb6,_0x3d6281,_0x4cab54){return new BPromise(function(_0x23e5fe,_0x16b729){return client[_0x1642('0xd')](_0x1dfeb6,_0x4cab54)[_0x1642('0xe')](function(_0x1a92ca){logger['info'](_0x1642('0xf'),_0x3d6281,_0x1642('0x10'));logger[_0x1642('0x11')](_0x1642('0x12'),_0x3d6281,_0x1642('0x10'),JSON['stringify'](_0x1a92ca));if(_0x1a92ca[_0x1642('0x13')]){if(_0x1a92ca[_0x1642('0x13')][_0x1642('0x14')]===0x1f4){logger['error'](_0x1642('0xf'),_0x3d6281,_0x1a92ca[_0x1642('0x13')]['message']);return _0x16b729(_0x1a92ca['error'][_0x1642('0x15')]);}logger['error']('VoiceMail,\x20%s,\x20%s',_0x3d6281,_0x1a92ca[_0x1642('0x13')][_0x1642('0x15')]);return _0x23e5fe(_0x1a92ca[_0x1642('0x13')][_0x1642('0x15')]);}else{logger['info']('VoiceMail,\x20%s,\x20%s',_0x3d6281,'request\x20sent');_0x23e5fe(_0x1a92ca['result'][_0x1642('0x15')]);}})[_0x1642('0x16')](function(_0xb586c6){logger['error']('VoiceMail,\x20%s,\x20%s',_0x3d6281,_0xb586c6);_0x16b729(_0xb586c6);});});} \ No newline at end of file diff --git a/server/api/voiceMailMessage/index.js b/server/api/voiceMailMessage/index.js index 9b71978..07b1137 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 _0x80ca=['show','/:id/download','download','create','put','update','delete','destroy','exports','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMailMessage.controller','isAuthenticated','index','get','/:id'];(function(_0x40220a,_0x22feb1){var _0x3903cc=function(_0x33a296){while(--_0x33a296){_0x40220a['push'](_0x40220a['shift']());}};_0x3903cc(++_0x22feb1);}(_0x80ca,0xdb));var _0xa80c=function(_0x5e548e,_0x12d0b5){_0x5e548e=_0x5e548e-0x0;var _0x272835=_0x80ca[_0x5e548e];return _0x272835;};'use strict';var multer=require('multer');var util=require(_0xa80c('0x0'));var path=require(_0xa80c('0x1'));var timeout=require('connect-timeout');var express=require(_0xa80c('0x2'));var router=express[_0xa80c('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xa80c('0x4'));var interaction=require(_0xa80c('0x5'));var config=require(_0xa80c('0x6'));var controller=require(_0xa80c('0x7'));router['get']('/',auth[_0xa80c('0x8')](),controller[_0xa80c('0x9')]);router[_0xa80c('0xa')](_0xa80c('0xb'),auth[_0xa80c('0x8')](),controller[_0xa80c('0xc')]);router[_0xa80c('0xa')](_0xa80c('0xd'),auth[_0xa80c('0x8')](),controller[_0xa80c('0xe')]);router['post']('/',auth[_0xa80c('0x8')](),controller[_0xa80c('0xf')]);router[_0xa80c('0x10')](_0xa80c('0xb'),auth[_0xa80c('0x8')](),controller[_0xa80c('0x11')]);router[_0xa80c('0x12')](_0xa80c('0xb'),auth[_0xa80c('0x8')](),controller[_0xa80c('0x13')]);module[_0xa80c('0x14')]=router; \ No newline at end of file +var _0xf31c=['put','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','/:id/download','download','create'];(function(_0x9c2427,_0x17c865){var _0x51984f=function(_0x177af6){while(--_0x177af6){_0x9c2427['push'](_0x9c2427['shift']());}};_0x51984f(++_0x17c865);}(_0xf31c,0x17f));var _0xcf31=function(_0x133277,_0xb1d6b2){_0x133277=_0x133277-0x0;var _0x5b4a22=_0xf31c[_0x133277];return _0x5b4a22;};'use strict';var multer=require(_0xcf31('0x0'));var util=require(_0xcf31('0x1'));var path=require(_0xcf31('0x2'));var timeout=require('connect-timeout');var express=require(_0xcf31('0x3'));var router=express[_0xcf31('0x4')]();var fs_extra=require(_0xcf31('0x5'));var auth=require(_0xcf31('0x6'));var interaction=require(_0xcf31('0x7'));var config=require(_0xcf31('0x8'));var controller=require('./voiceMailMessage.controller');router[_0xcf31('0x9')]('/',auth[_0xcf31('0xa')](),controller[_0xcf31('0xb')]);router[_0xcf31('0x9')](_0xcf31('0xc'),auth[_0xcf31('0xa')](),controller['show']);router[_0xcf31('0x9')](_0xcf31('0xd'),auth[_0xcf31('0xa')](),controller[_0xcf31('0xe')]);router['post']('/',auth[_0xcf31('0xa')](),controller[_0xcf31('0xf')]);router[_0xcf31('0x10')](_0xcf31('0xc'),auth['isAuthenticated'](),controller[_0xcf31('0x11')]);router[_0xcf31('0x12')](_0xcf31('0xc'),auth[_0xcf31('0xa')](),controller[_0xcf31('0x13')]);module[_0xcf31('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 a0d4cbe..b8519d2 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 _0x4c40=['literal','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','exports','VIRTUAL','getDataValue','INTEGER','STRING','long','TIMESTAMP'];(function(_0x5028ab,_0x25f8b1){var _0x203df7=function(_0xd7ec30){while(--_0xd7ec30){_0x5028ab['push'](_0x5028ab['shift']());}};_0x203df7(++_0x25f8b1);}(_0x4c40,0x1c4));var _0x04c4=function(_0x3c457c,_0x245fd5){_0x3c457c=_0x3c457c-0x0;var _0x476779=_0x4c40[_0x3c457c];return _0x476779;};'use strict';var Sequelize=require('sequelize');module[_0x04c4('0x0')]={'name':{'type':Sequelize[_0x04c4('0x1')],'get':function(_0x429513){return this[_0x04c4('0x2')]('id');}},'msgnum':{'type':Sequelize[_0x04c4('0x3')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize['STRING'],'defaultValue':''},'context':{'type':Sequelize[_0x04c4('0x4')],'defaultValue':''},'macrocontext':{'type':Sequelize[_0x04c4('0x4')],'defaultValue':''},'callerid':{'type':Sequelize[_0x04c4('0x4')],'defaultValue':''},'origtime':{'type':Sequelize['STRING'],'defaultValue':''},'duration':{'type':Sequelize[_0x04c4('0x4')],'defaultValue':''},'mailboxuser':{'type':Sequelize['STRING'],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0x04c4('0x4')],'defaultValue':''},'recording':{'type':Sequelize['BLOB'](_0x04c4('0x5')),'defaultValue':null},'flag':{'type':Sequelize[_0x04c4('0x4')],'defaultValue':''},'msg_id':{'type':Sequelize[_0x04c4('0x4')],'defaultValue':''},'stamp':{'type':_0x04c4('0x6'),'defaultValue':Sequelize[_0x04c4('0x7')](_0x04c4('0x8'))}}; \ No newline at end of file +var _0x6412=['TIMESTAMP','literal','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','sequelize','exports','getDataValue','STRING','long'];(function(_0x4b4df7,_0x2eb7a1){var _0x30f24a=function(_0x5bfea6){while(--_0x5bfea6){_0x4b4df7['push'](_0x4b4df7['shift']());}};_0x30f24a(++_0x2eb7a1);}(_0x6412,0xeb));var _0x2641=function(_0x431e61,_0x53c722){_0x431e61=_0x431e61-0x0;var _0x5328e4=_0x6412[_0x431e61];return _0x5328e4;};'use strict';var Sequelize=require(_0x2641('0x0'));module[_0x2641('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x11425d){return this[_0x2641('0x2')]('id');}},'msgnum':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0x2641('0x3')],'defaultValue':''},'context':{'type':Sequelize[_0x2641('0x3')],'defaultValue':''},'macrocontext':{'type':Sequelize[_0x2641('0x3')],'defaultValue':''},'callerid':{'type':Sequelize[_0x2641('0x3')],'defaultValue':''},'origtime':{'type':Sequelize[_0x2641('0x3')],'defaultValue':''},'duration':{'type':Sequelize[_0x2641('0x3')],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0x2641('0x3')],'defaultValue':''},'mailboxcontext':{'type':Sequelize['STRING'],'defaultValue':''},'recording':{'type':Sequelize['BLOB'](_0x2641('0x4')),'defaultValue':null},'flag':{'type':Sequelize['STRING'],'defaultValue':''},'msg_id':{'type':Sequelize['STRING'],'defaultValue':''},'stamp':{'type':_0x2641('0x5'),'defaultValue':Sequelize[_0x2641('0x6')](_0x2641('0x7'))}}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.controller.js b/server/api/voiceMailMessage/voiceMailMessage.controller.js index f35381d..91b152a 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 _0x6b37=['differenceBy','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','sort','where','filters','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','keys','create','body','destroy','find','download','recording','VoiceMailMessage\x20not\x20found','audio/wav','attachment','msg_id','Content-Disposition','attachment;\x20filename=\x22','send','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set','apply','reject','save','update','then','error','stack','name','index','map','VoiceMailMessage','rawAttributes','fieldName','type','key','model'];(function(_0x562fbb,_0xb1c66){var _0x2839a9=function(_0x6890b9){while(--_0x6890b9){_0x562fbb['push'](_0x562fbb['shift']());}};_0x2839a9(++_0xb1c66);}(_0x6b37,0x1de));var _0x76b3=function(_0x3c3e72,_0x3e1858){_0x3c3e72=_0x3c3e72-0x0;var _0x48a7e5=_0x6b37[_0x3c3e72];return _0x48a7e5;};'use strict';var emlformat=require(_0x76b3('0x0'));var rimraf=require(_0x76b3('0x1'));var zipdir=require(_0x76b3('0x2'));var jsonpatch=require(_0x76b3('0x3'));var rp=require('request-promise');var moment=require(_0x76b3('0x4'));var BPromise=require(_0x76b3('0x5'));var Mustache=require(_0x76b3('0x6'));var util=require('util');var path=require(_0x76b3('0x7'));var sox=require(_0x76b3('0x8'));var csv=require(_0x76b3('0x9'));var ejs=require(_0x76b3('0xa'));var fs=require('fs');var fs_extra=require(_0x76b3('0xb'));var _=require(_0x76b3('0xc'));var squel=require(_0x76b3('0xd'));var crypto=require('crypto');var jsforce=require(_0x76b3('0xe'));var deskjs=require(_0x76b3('0xf'));var toCsv=require(_0x76b3('0x9'));var querystring=require(_0x76b3('0x10'));var Papa=require(_0x76b3('0x11'));var Redis=require(_0x76b3('0x12'));var authService=require(_0x76b3('0x13'));var qs=require(_0x76b3('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x76b3('0x15'));var logger=require(_0x76b3('0x16'))(_0x76b3('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x76b3('0x18'));var db=require(_0x76b3('0x19'))['db'];function respondWithStatusCode(_0x11508b,_0x1d0cf4){_0x1d0cf4=_0x1d0cf4||0xcc;return function(_0x385fbc){if(_0x385fbc){return _0x11508b[_0x76b3('0x1a')](_0x1d0cf4);}return _0x11508b[_0x76b3('0x1b')](_0x1d0cf4)[_0x76b3('0x1c')]();};}function respondWithResult(_0xe1e75e,_0x1ec9ca){_0x1ec9ca=_0x1ec9ca||0xc8;return function(_0x57623a){if(_0x57623a){return _0xe1e75e[_0x76b3('0x1b')](_0x1ec9ca)[_0x76b3('0x1d')](_0x57623a);}};}function respondWithFilteredResult(_0x1141fb,_0x3c7448){return function(_0x5dbc1e){if(_0x5dbc1e){var _0x29a7b3=typeof _0x3c7448[_0x76b3('0x1e')]===_0x76b3('0x1f')&&typeof _0x3c7448['limit']===_0x76b3('0x1f');var _0x257bc4=_0x5dbc1e[_0x76b3('0x20')];var _0x2604c9=_0x29a7b3?0x0:_0x3c7448['offset'];var _0x209743=_0x29a7b3?_0x5dbc1e[_0x76b3('0x20')]:_0x3c7448[_0x76b3('0x1e')]+_0x3c7448['limit'];var _0x3400b8;if(_0x209743>=_0x257bc4){_0x209743=_0x257bc4;_0x3400b8=0xc8;}else{_0x3400b8=0xce;}_0x1141fb[_0x76b3('0x1b')](_0x3400b8);return _0x1141fb[_0x76b3('0x21')]('Content-Range',_0x2604c9+'-'+_0x209743+'/'+_0x257bc4)['json'](_0x5dbc1e);}return null;};}function patchUpdates(_0x5cffe9){return function(_0x1683d7){try{jsonpatch[_0x76b3('0x22')](_0x1683d7,_0x5cffe9,!![]);}catch(_0x1a1242){return BPromise[_0x76b3('0x23')](_0x1a1242);}return _0x1683d7[_0x76b3('0x24')]();};}function saveUpdates(_0x125b8b,_0x55fc64){return function(_0x5b4bd8){if(_0x5b4bd8){return _0x5b4bd8[_0x76b3('0x25')](_0x125b8b)[_0x76b3('0x26')](function(_0x1996c1){return _0x1996c1;});}return null;};}function removeEntity(_0x3d52b2,_0x51c9f3){return function(_0x4d1f59){if(_0x4d1f59){return _0x4d1f59['destroy']()[_0x76b3('0x26')](function(){_0x3d52b2[_0x76b3('0x1b')](0xcc)[_0x76b3('0x1c')]();});}};}function handleEntityNotFound(_0x52d7fe,_0x11685f){return function(_0x3cb66d){if(!_0x3cb66d){_0x52d7fe[_0x76b3('0x1a')](0x194);}return _0x3cb66d;};}function handleError(_0x26dab7,_0x239603){_0x239603=_0x239603||0x1f4;return function(_0x263a38){logger[_0x76b3('0x27')](_0x263a38[_0x76b3('0x28')]);if(_0x263a38[_0x76b3('0x29')]){delete _0x263a38['name'];}_0x26dab7[_0x76b3('0x1b')](_0x239603)['send'](_0x263a38);};}exports[_0x76b3('0x2a')]=function(_0x55c4ff,_0x3d7a4c){var _0x373b01={},_0x49f97b={},_0x60099a={'count':0x0,'rows':[]};var _0x1c7b30=_[_0x76b3('0x2b')](db[_0x76b3('0x2c')][_0x76b3('0x2d')],function(_0x20ffe2){return{'name':_0x20ffe2[_0x76b3('0x2e')],'type':_0x20ffe2[_0x76b3('0x2f')][_0x76b3('0x30')]};});_0x49f97b[_0x76b3('0x31')]=_[_0x76b3('0x32')](_[_0x76b3('0x2b')](_0x1c7b30,_0x76b3('0x29')),[_0x76b3('0x29')]);_0x49f97b[_0x76b3('0x33')]=_['keys'](_0x55c4ff[_0x76b3('0x33')]);_0x49f97b['filters']=_[_0x76b3('0x34')](_0x49f97b['model'],_0x49f97b[_0x76b3('0x33')]);_0x373b01['attributes']=_['intersection'](_0x49f97b['model'],qs['fields'](_0x55c4ff[_0x76b3('0x33')][_0x76b3('0x35')]));_0x373b01[_0x76b3('0x36')]=_0x373b01[_0x76b3('0x36')][_0x76b3('0x37')]?_0x373b01[_0x76b3('0x36')]:_0x49f97b[_0x76b3('0x31')];if(!_0x55c4ff[_0x76b3('0x33')][_0x76b3('0x38')](_0x76b3('0x39'))){_0x373b01[_0x76b3('0x3a')]=qs[_0x76b3('0x3a')](_0x55c4ff['query'][_0x76b3('0x3a')]);_0x373b01[_0x76b3('0x1e')]=qs['offset'](_0x55c4ff['query'][_0x76b3('0x1e')]);}_0x373b01['order']=qs[_0x76b3('0x3b')](_0x55c4ff[_0x76b3('0x33')]['sort']);_0x373b01[_0x76b3('0x3c')]=qs[_0x76b3('0x3d')](_[_0x76b3('0x3e')](_0x55c4ff[_0x76b3('0x33')],_0x49f97b[_0x76b3('0x3d')]),_0x1c7b30);if(_0x55c4ff[_0x76b3('0x33')]['filter']){_0x373b01[_0x76b3('0x3c')]=_[_0x76b3('0x3f')](_0x373b01[_0x76b3('0x3c')],{'$or':_['map'](_0x1c7b30,function(_0x2e1da6){if(_0x2e1da6[_0x76b3('0x2f')]!==_0x76b3('0x40')){var _0x98ac09={};_0x98ac09[_0x2e1da6[_0x76b3('0x29')]]={'$like':'%'+_0x55c4ff['query'][_0x76b3('0x41')]+'%'};return _0x98ac09;}})});}_0x373b01=_[_0x76b3('0x3f')]({},_0x373b01,_0x55c4ff[_0x76b3('0x42')]);var _0x199dfe={'where':_0x373b01['where']};return db['VoiceMailMessage'][_0x76b3('0x20')](_0x199dfe)[_0x76b3('0x26')](function(_0x57b0f1){_0x60099a[_0x76b3('0x20')]=_0x57b0f1;if(_0x55c4ff[_0x76b3('0x33')][_0x76b3('0x43')]){_0x373b01[_0x76b3('0x44')]=[{'all':!![]}];}return db[_0x76b3('0x2c')][_0x76b3('0x45')](_0x373b01);})[_0x76b3('0x26')](function(_0x1d7579){_0x60099a[_0x76b3('0x46')]=_0x1d7579;return _0x60099a;})[_0x76b3('0x26')](respondWithFilteredResult(_0x3d7a4c,_0x373b01))[_0x76b3('0x47')](handleError(_0x3d7a4c,null));};exports[_0x76b3('0x48')]=function(_0x3af6dd,_0x8fa01){var _0x2bde80={'raw':!![],'where':{'id':_0x3af6dd[_0x76b3('0x49')]['id']}},_0x3cf7ee={};_0x3cf7ee[_0x76b3('0x31')]=_['keys'](db[_0x76b3('0x2c')][_0x76b3('0x2d')]);_0x3cf7ee[_0x76b3('0x33')]=_[_0x76b3('0x4a')](_0x3af6dd[_0x76b3('0x33')]);_0x3cf7ee[_0x76b3('0x3d')]=_['intersection'](_0x3cf7ee[_0x76b3('0x31')],_0x3cf7ee[_0x76b3('0x33')]);_0x2bde80[_0x76b3('0x36')]=_['intersection'](_0x3cf7ee[_0x76b3('0x31')],qs[_0x76b3('0x35')](_0x3af6dd[_0x76b3('0x33')][_0x76b3('0x35')]));_0x2bde80['attributes']=_0x2bde80[_0x76b3('0x36')][_0x76b3('0x37')]?_0x2bde80['attributes']:_0x3cf7ee[_0x76b3('0x31')];if(_0x3af6dd[_0x76b3('0x33')][_0x76b3('0x43')]){_0x2bde80[_0x76b3('0x44')]=[{'all':!![]}];}_0x2bde80=_['merge']({},_0x2bde80,_0x3af6dd[_0x76b3('0x42')]);return db['VoiceMailMessage']['find'](_0x2bde80)[_0x76b3('0x26')](handleEntityNotFound(_0x8fa01,null))[_0x76b3('0x26')](respondWithResult(_0x8fa01,null))[_0x76b3('0x47')](handleError(_0x8fa01,null));};exports[_0x76b3('0x4b')]=function(_0x54fb2b,_0x2bdfe1){return db[_0x76b3('0x2c')][_0x76b3('0x4b')](_0x54fb2b['body'],{})[_0x76b3('0x26')](respondWithResult(_0x2bdfe1,0xc9))['catch'](handleError(_0x2bdfe1,null));};exports['update']=function(_0x20ebbe,_0xfe16bc){if(_0x20ebbe[_0x76b3('0x4c')]['id']){delete _0x20ebbe[_0x76b3('0x4c')]['id'];}return db['VoiceMailMessage']['find']({'where':{'id':_0x20ebbe[_0x76b3('0x49')]['id']}})[_0x76b3('0x26')](handleEntityNotFound(_0xfe16bc,null))['then'](saveUpdates(_0x20ebbe[_0x76b3('0x4c')],null))['then'](respondWithResult(_0xfe16bc,null))[_0x76b3('0x47')](handleError(_0xfe16bc,null));};exports[_0x76b3('0x4d')]=function(_0x2d3a64,_0x1165ed){return db[_0x76b3('0x2c')][_0x76b3('0x4e')]({'where':{'id':_0x2d3a64[_0x76b3('0x49')]['id']}})[_0x76b3('0x26')](handleEntityNotFound(_0x1165ed,null))[_0x76b3('0x26')](removeEntity(_0x1165ed,null))[_0x76b3('0x47')](handleError(_0x1165ed,null));};exports[_0x76b3('0x4f')]=function(_0xb4170e,_0x4d39a5,_0x401b20){return db[_0x76b3('0x2c')][_0x76b3('0x4e')]({'where':{'id':_0xb4170e[_0x76b3('0x49')]['id']},'attributes':['id','recording','msg_id']})[_0x76b3('0x26')](handleEntityNotFound(_0x4d39a5,null))[_0x76b3('0x26')](function(_0x252c60){if(_0x252c60){if(!_0x252c60[_0x76b3('0x50')]){throw new db['Sequelize']['ValidationError'](_0x76b3('0x51'));}var _0x17e1a8={'Content-Type':_0x76b3('0x52'),'Content-Disposition':_0x76b3('0x53')};if(_0x252c60[_0x76b3('0x54')]){_0x17e1a8[_0x76b3('0x55')]=_0x76b3('0x56')+_0x252c60[_0x76b3('0x54')]+'.wav\x22';}_0x4d39a5[_0x76b3('0x21')](_0x17e1a8);return _0x4d39a5[_0x76b3('0x57')](new Buffer(_0x252c60['recording']));}})[_0x76b3('0x47')](handleError(_0x4d39a5,null));}; \ No newline at end of file +var _0x31de=['index','map','fieldName','type','key','model','keys','query','filters','intersection','attributes','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','options','VoiceMailMessage','includeAll','include','rows','catch','show','params','rawAttributes','fields','length','find','body','update','download','recording','msg_id','Sequelize','ValidationError','audio/wav','Content-Disposition','attachment;\x20filename=\x22','rimraf','zip-dir','request-promise','moment','mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','error','stack','name','send'];(function(_0x1e2466,_0x50c296){var _0x4e0887=function(_0x425f59){while(--_0x425f59){_0x1e2466['push'](_0x1e2466['shift']());}};_0x4e0887(++_0x50c296);}(_0x31de,0x125));var _0xe31d=function(_0x1fa4d0,_0x59fc53){_0x1fa4d0=_0x1fa4d0-0x0;var _0x471576=_0x31de[_0x1fa4d0];return _0x471576;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe31d('0x0'));var zipdir=require(_0xe31d('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe31d('0x2'));var moment=require(_0xe31d('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xe31d('0x4'));var util=require(_0xe31d('0x5'));var path=require('path');var sox=require(_0xe31d('0x6'));var csv=require(_0xe31d('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe31d('0x8'));var _=require(_0xe31d('0x9'));var squel=require(_0xe31d('0xa'));var crypto=require(_0xe31d('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xe31d('0xc'));var toCsv=require(_0xe31d('0x7'));var querystring=require(_0xe31d('0xd'));var Papa=require(_0xe31d('0xe'));var Redis=require(_0xe31d('0xf'));var authService=require(_0xe31d('0x10'));var qs=require(_0xe31d('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe31d('0x12'));var logger=require(_0xe31d('0x13'))(_0xe31d('0x14'));var utils=require(_0xe31d('0x15'));var config=require(_0xe31d('0x16'));var licenseUtil=require(_0xe31d('0x17'));var db=require(_0xe31d('0x18'))['db'];function respondWithStatusCode(_0x43e0af,_0x4464d9){_0x4464d9=_0x4464d9||0xcc;return function(_0x5d4b75){if(_0x5d4b75){return _0x43e0af[_0xe31d('0x19')](_0x4464d9);}return _0x43e0af['status'](_0x4464d9)[_0xe31d('0x1a')]();};}function respondWithResult(_0x7e26af,_0x4f8b76){_0x4f8b76=_0x4f8b76||0xc8;return function(_0x8f25c2){if(_0x8f25c2){return _0x7e26af[_0xe31d('0x1b')](_0x4f8b76)[_0xe31d('0x1c')](_0x8f25c2);}};}function respondWithFilteredResult(_0x4fff2b,_0x14f947){return function(_0x417233){if(_0x417233){var _0x441087=typeof _0x14f947[_0xe31d('0x1d')]===_0xe31d('0x1e')&&typeof _0x14f947[_0xe31d('0x1f')]==='undefined';var _0x58705b=_0x417233['count'];var _0xee1a07=_0x441087?0x0:_0x14f947[_0xe31d('0x1d')];var _0x2a5602=_0x441087?_0x417233[_0xe31d('0x20')]:_0x14f947[_0xe31d('0x1d')]+_0x14f947['limit'];var _0x25dcf8;if(_0x2a5602>=_0x58705b){_0x2a5602=_0x58705b;_0x25dcf8=0xc8;}else{_0x25dcf8=0xce;}_0x4fff2b['status'](_0x25dcf8);return _0x4fff2b[_0xe31d('0x21')](_0xe31d('0x22'),_0xee1a07+'-'+_0x2a5602+'/'+_0x58705b)[_0xe31d('0x1c')](_0x417233);}return null;};}function patchUpdates(_0x554184){return function(_0x1f70ad){try{jsonpatch[_0xe31d('0x23')](_0x1f70ad,_0x554184,!![]);}catch(_0x173ece){return BPromise[_0xe31d('0x24')](_0x173ece);}return _0x1f70ad[_0xe31d('0x25')]();};}function saveUpdates(_0x34df08,_0x2186b1){return function(_0x49b7a6){if(_0x49b7a6){return _0x49b7a6['update'](_0x34df08)[_0xe31d('0x26')](function(_0xc2ce55){return _0xc2ce55;});}return null;};}function removeEntity(_0x19debf,_0x577d2c){return function(_0x1136c8){if(_0x1136c8){return _0x1136c8['destroy']()[_0xe31d('0x26')](function(){_0x19debf[_0xe31d('0x1b')](0xcc)[_0xe31d('0x1a')]();});}};}function handleEntityNotFound(_0x37a97e,_0x17f9b3){return function(_0x261941){if(!_0x261941){_0x37a97e[_0xe31d('0x19')](0x194);}return _0x261941;};}function handleError(_0x22ff1b,_0x557f0a){_0x557f0a=_0x557f0a||0x1f4;return function(_0x9061a0){logger[_0xe31d('0x27')](_0x9061a0[_0xe31d('0x28')]);if(_0x9061a0[_0xe31d('0x29')]){delete _0x9061a0[_0xe31d('0x29')];}_0x22ff1b[_0xe31d('0x1b')](_0x557f0a)[_0xe31d('0x2a')](_0x9061a0);};}exports[_0xe31d('0x2b')]=function(_0x57ddeb,_0x4a8b23){var _0x3c4f33={},_0x5c5bd7={},_0x340b38={'count':0x0,'rows':[]};var _0x56c03b=_[_0xe31d('0x2c')](db['VoiceMailMessage']['rawAttributes'],function(_0x305b42){return{'name':_0x305b42[_0xe31d('0x2d')],'type':_0x305b42[_0xe31d('0x2e')][_0xe31d('0x2f')]};});_0x5c5bd7[_0xe31d('0x30')]=_['differenceBy'](_[_0xe31d('0x2c')](_0x56c03b,_0xe31d('0x29')),[_0xe31d('0x29')]);_0x5c5bd7['query']=_[_0xe31d('0x31')](_0x57ddeb[_0xe31d('0x32')]);_0x5c5bd7[_0xe31d('0x33')]=_[_0xe31d('0x34')](_0x5c5bd7[_0xe31d('0x30')],_0x5c5bd7[_0xe31d('0x32')]);_0x3c4f33[_0xe31d('0x35')]=_[_0xe31d('0x34')](_0x5c5bd7[_0xe31d('0x30')],qs['fields'](_0x57ddeb[_0xe31d('0x32')]['fields']));_0x3c4f33[_0xe31d('0x35')]=_0x3c4f33['attributes']['length']?_0x3c4f33[_0xe31d('0x35')]:_0x5c5bd7[_0xe31d('0x30')];if(!_0x57ddeb['query'][_0xe31d('0x36')](_0xe31d('0x37'))){_0x3c4f33['limit']=qs[_0xe31d('0x1f')](_0x57ddeb[_0xe31d('0x32')][_0xe31d('0x1f')]);_0x3c4f33[_0xe31d('0x1d')]=qs[_0xe31d('0x1d')](_0x57ddeb['query'][_0xe31d('0x1d')]);}_0x3c4f33[_0xe31d('0x38')]=qs[_0xe31d('0x39')](_0x57ddeb[_0xe31d('0x32')][_0xe31d('0x39')]);_0x3c4f33[_0xe31d('0x3a')]=qs['filters'](_['pick'](_0x57ddeb[_0xe31d('0x32')],_0x5c5bd7[_0xe31d('0x33')]),_0x56c03b);if(_0x57ddeb[_0xe31d('0x32')]['filter']){_0x3c4f33[_0xe31d('0x3a')]=_[_0xe31d('0x3b')](_0x3c4f33[_0xe31d('0x3a')],{'$or':_[_0xe31d('0x2c')](_0x56c03b,function(_0x4d64e6){if(_0x4d64e6[_0xe31d('0x2e')]!==_0xe31d('0x3c')){var _0x1f1a12={};_0x1f1a12[_0x4d64e6[_0xe31d('0x29')]]={'$like':'%'+_0x57ddeb[_0xe31d('0x32')][_0xe31d('0x3d')]+'%'};return _0x1f1a12;}})});}_0x3c4f33=_[_0xe31d('0x3b')]({},_0x3c4f33,_0x57ddeb[_0xe31d('0x3e')]);var _0x1440f5={'where':_0x3c4f33[_0xe31d('0x3a')]};return db[_0xe31d('0x3f')][_0xe31d('0x20')](_0x1440f5)[_0xe31d('0x26')](function(_0x5d6e0c){_0x340b38[_0xe31d('0x20')]=_0x5d6e0c;if(_0x57ddeb['query'][_0xe31d('0x40')]){_0x3c4f33[_0xe31d('0x41')]=[{'all':!![]}];}return db[_0xe31d('0x3f')]['findAll'](_0x3c4f33);})['then'](function(_0x37e268){_0x340b38[_0xe31d('0x42')]=_0x37e268;return _0x340b38;})[_0xe31d('0x26')](respondWithFilteredResult(_0x4a8b23,_0x3c4f33))[_0xe31d('0x43')](handleError(_0x4a8b23,null));};exports[_0xe31d('0x44')]=function(_0x25211e,_0x58e665){var _0x285872={'raw':!![],'where':{'id':_0x25211e[_0xe31d('0x45')]['id']}},_0x5de3c2={};_0x5de3c2['model']=_[_0xe31d('0x31')](db[_0xe31d('0x3f')][_0xe31d('0x46')]);_0x5de3c2[_0xe31d('0x32')]=_[_0xe31d('0x31')](_0x25211e[_0xe31d('0x32')]);_0x5de3c2['filters']=_[_0xe31d('0x34')](_0x5de3c2['model'],_0x5de3c2[_0xe31d('0x32')]);_0x285872[_0xe31d('0x35')]=_['intersection'](_0x5de3c2[_0xe31d('0x30')],qs[_0xe31d('0x47')](_0x25211e[_0xe31d('0x32')][_0xe31d('0x47')]));_0x285872[_0xe31d('0x35')]=_0x285872[_0xe31d('0x35')][_0xe31d('0x48')]?_0x285872[_0xe31d('0x35')]:_0x5de3c2[_0xe31d('0x30')];if(_0x25211e[_0xe31d('0x32')]['includeAll']){_0x285872['include']=[{'all':!![]}];}_0x285872=_[_0xe31d('0x3b')]({},_0x285872,_0x25211e[_0xe31d('0x3e')]);return db[_0xe31d('0x3f')][_0xe31d('0x49')](_0x285872)[_0xe31d('0x26')](handleEntityNotFound(_0x58e665,null))['then'](respondWithResult(_0x58e665,null))[_0xe31d('0x43')](handleError(_0x58e665,null));};exports['create']=function(_0x321138,_0x45bf9c){return db[_0xe31d('0x3f')]['create'](_0x321138[_0xe31d('0x4a')],{})['then'](respondWithResult(_0x45bf9c,0xc9))['catch'](handleError(_0x45bf9c,null));};exports[_0xe31d('0x4b')]=function(_0x385d2d,_0x101be6){if(_0x385d2d[_0xe31d('0x4a')]['id']){delete _0x385d2d['body']['id'];}return db[_0xe31d('0x3f')][_0xe31d('0x49')]({'where':{'id':_0x385d2d[_0xe31d('0x45')]['id']}})[_0xe31d('0x26')](handleEntityNotFound(_0x101be6,null))['then'](saveUpdates(_0x385d2d[_0xe31d('0x4a')],null))[_0xe31d('0x26')](respondWithResult(_0x101be6,null))[_0xe31d('0x43')](handleError(_0x101be6,null));};exports['destroy']=function(_0x27fa49,_0x3727fe){return db[_0xe31d('0x3f')]['find']({'where':{'id':_0x27fa49[_0xe31d('0x45')]['id']}})['then'](handleEntityNotFound(_0x3727fe,null))[_0xe31d('0x26')](removeEntity(_0x3727fe,null))[_0xe31d('0x43')](handleError(_0x3727fe,null));};exports[_0xe31d('0x4c')]=function(_0x375c91,_0x538dc2,_0x477709){return db[_0xe31d('0x3f')][_0xe31d('0x49')]({'where':{'id':_0x375c91['params']['id']},'attributes':['id',_0xe31d('0x4d'),_0xe31d('0x4e')]})['then'](handleEntityNotFound(_0x538dc2,null))[_0xe31d('0x26')](function(_0x3cad03){if(_0x3cad03){if(!_0x3cad03['recording']){throw new db[(_0xe31d('0x4f'))][(_0xe31d('0x50'))]('VoiceMailMessage\x20not\x20found');}var _0x41e62a={'Content-Type':_0xe31d('0x51'),'Content-Disposition':'attachment'};if(_0x3cad03['msg_id']){_0x41e62a[_0xe31d('0x52')]=_0xe31d('0x53')+_0x3cad03['msg_id']+'.wav\x22';}_0x538dc2['set'](_0x41e62a);return _0x538dc2[_0xe31d('0x2a')](new Buffer(_0x3cad03[_0xe31d('0x4d')]));}})[_0xe31d('0x43')](handleError(_0x538dc2,null));}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.model.js b/server/api/voiceMailMessage/voiceMailMessage.model.js index b550306..9ecd0d0 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 _0x1bde=['rimraf','./voiceMailMessage.attributes','exports','voice_voicemail_messages','dir','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1bde,0x144));var _0xe1bd=function(_0x3c9bdf,_0x3b30cd){_0x3c9bdf=_0x3c9bdf-0x0;var _0x5664a6=_0x1bde[_0x3c9bdf];return _0x5664a6;};'use strict';var _=require(_0xe1bd('0x0'));var util=require(_0xe1bd('0x1'));var logger=require(_0xe1bd('0x2'))(_0xe1bd('0x3'));var moment=require(_0xe1bd('0x4'));var BPromise=require(_0xe1bd('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xe1bd('0x6'));var config=require('../../config/environment');var attributes=require(_0xe1bd('0x7'));module[_0xe1bd('0x8')]=function(_0x34f8dc,_0x2d6b45){return _0x34f8dc['define']('VoiceMailMessage',attributes,{'tableName':_0xe1bd('0x9'),'paranoid':![],'indexes':[{'name':_0xe1bd('0xa'),'fields':[_0xe1bd('0xa')]}],'timestamps':![]});}; \ No newline at end of file +var _0xa157=['bluebird','request-promise','rimraf','../../config/environment','./voiceMailMessage.attributes','define','VoiceMailMessage','voice_voicemail_messages','lodash','util','moment'];(function(_0xf266fa,_0x448c3c){var _0x6493b6=function(_0x4adcbf){while(--_0x4adcbf){_0xf266fa['push'](_0xf266fa['shift']());}};_0x6493b6(++_0x448c3c);}(_0xa157,0x131));var _0x7a15=function(_0x53dc5c,_0x6e322d){_0x53dc5c=_0x53dc5c-0x0;var _0x557090=_0xa157[_0x53dc5c];return _0x557090;};'use strict';var _=require(_0x7a15('0x0'));var util=require(_0x7a15('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x7a15('0x2'));var BPromise=require(_0x7a15('0x3'));var rp=require(_0x7a15('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7a15('0x5'));var config=require(_0x7a15('0x6'));var attributes=require(_0x7a15('0x7'));module['exports']=function(_0x588cea,_0x52a256){return _0x588cea[_0x7a15('0x8')](_0x7a15('0x9'),attributes,{'tableName':_0x7a15('0xa'),'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 7df8f0a..4b10f90 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 _0x8b72=['rpc','../../config/environment','jayson/promise','http','request','then','info','VoiceMailMessage,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x5466ab,_0x227b13){var _0x40751a=function(_0x477f9e){while(--_0x477f9e){_0x5466ab['push'](_0x5466ab['shift']());}};_0x40751a(++_0x227b13);}(_0x8b72,0x18f));var _0x28b7=function(_0xf7ec53,_0x59076c){_0xf7ec53=_0xf7ec53-0x0;var _0x224a41=_0x8b72[_0xf7ec53];return _0x224a41;};'use strict';var _=require(_0x28b7('0x0'));var util=require(_0x28b7('0x1'));var moment=require(_0x28b7('0x2'));var BPromise=require(_0x28b7('0x3'));var rs=require(_0x28b7('0x4'));var fs=require('fs');var Redis=require(_0x28b7('0x5'));var db=require(_0x28b7('0x6'))['db'];var utils=require(_0x28b7('0x7'));var logger=require(_0x28b7('0x8'))(_0x28b7('0x9'));var config=require(_0x28b7('0xa'));var jayson=require(_0x28b7('0xb'));var client=jayson['client'][_0x28b7('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x10300a,_0x381069,_0x1d1278){return new BPromise(function(_0x4b2bc1,_0xcd1379){return client[_0x28b7('0xd')](_0x10300a,_0x1d1278)[_0x28b7('0xe')](function(_0x2bfffe){logger[_0x28b7('0xf')](_0x28b7('0x10'),_0x381069,'request\x20sent');logger['debug']('VoiceMailMessage,\x20%s,\x20%s,\x20%s',_0x381069,_0x28b7('0x11'),JSON[_0x28b7('0x12')](_0x2bfffe));if(_0x2bfffe[_0x28b7('0x13')]){if(_0x2bfffe[_0x28b7('0x13')][_0x28b7('0x14')]===0x1f4){logger[_0x28b7('0x13')](_0x28b7('0x10'),_0x381069,_0x2bfffe[_0x28b7('0x13')]['message']);return _0xcd1379(_0x2bfffe['error'][_0x28b7('0x15')]);}logger[_0x28b7('0x13')](_0x28b7('0x10'),_0x381069,_0x2bfffe[_0x28b7('0x13')]['message']);return _0x4b2bc1(_0x2bfffe[_0x28b7('0x13')][_0x28b7('0x15')]);}else{logger[_0x28b7('0xf')]('VoiceMailMessage,\x20%s,\x20%s',_0x381069,'request\x20sent');_0x4b2bc1(_0x2bfffe[_0x28b7('0x16')][_0x28b7('0x15')]);}})[_0x28b7('0x17')](function(_0x38cc5f){logger[_0x28b7('0x13')](_0x28b7('0x10'),_0x381069,_0x38cc5f);_0xcd1379(_0x38cc5f);});});} \ No newline at end of file +var _0xf81f=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','VoiceMailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceMailMessage,\x20%s,\x20%s','message','result','catch'];(function(_0x345035,_0x5ed485){var _0x133090=function(_0x4bf688){while(--_0x4bf688){_0x345035['push'](_0x345035['shift']());}};_0x133090(++_0x5ed485);}(_0xf81f,0xb8));var _0xff81=function(_0x20bdff,_0x3bcf0d){_0x20bdff=_0x20bdff-0x0;var _0x5edb15=_0xf81f[_0x20bdff];return _0x5edb15;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xff81('0x0'));var BPromise=require(_0xff81('0x1'));var rs=require(_0xff81('0x2'));var fs=require('fs');var Redis=require(_0xff81('0x3'));var db=require(_0xff81('0x4'))['db'];var utils=require(_0xff81('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0xff81('0x6'));var jayson=require(_0xff81('0x7'));var client=jayson[_0xff81('0x8')][_0xff81('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x502df9,_0x1362b8,_0x8c3b2){return new BPromise(function(_0x144b2a,_0x3b6892){return client[_0xff81('0xa')](_0x502df9,_0x8c3b2)[_0xff81('0xb')](function(_0x451131){logger[_0xff81('0xc')]('VoiceMailMessage,\x20%s,\x20%s',_0x1362b8,_0xff81('0xd'));logger[_0xff81('0xe')](_0xff81('0xf'),_0x1362b8,'request\x20sent',JSON[_0xff81('0x10')](_0x451131));if(_0x451131[_0xff81('0x11')]){if(_0x451131[_0xff81('0x11')][_0xff81('0x12')]===0x1f4){logger['error'](_0xff81('0x13'),_0x1362b8,_0x451131['error'][_0xff81('0x14')]);return _0x3b6892(_0x451131[_0xff81('0x11')]['message']);}logger[_0xff81('0x11')](_0xff81('0x13'),_0x1362b8,_0x451131['error'][_0xff81('0x14')]);return _0x144b2a(_0x451131[_0xff81('0x11')][_0xff81('0x14')]);}else{logger[_0xff81('0xc')](_0xff81('0x13'),_0x1362b8,'request\x20sent');_0x144b2a(_0x451131[_0xff81('0x15')]['message']);}})[_0xff81('0x16')](function(_0xebf309){logger[_0xff81('0x11')]('VoiceMailMessage,\x20%s,\x20%s',_0x1362b8,_0xebf309);_0x3b6892(_0xebf309);});});} \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/index.js b/server/api/voiceMusicOnHold/index.js index 25f00f9..4d6c1e6 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 _0xe09c=['connect-timeout','Router','../../components/interaction/service','../../config/environment','./voiceMusicOnHold.controller','get','isAuthenticated','index','/:id','show','/:id/sounds','getSounds','post','put','update','delete','/:id/sounds/:id2','removeSound','multer','util'];(function(_0x5033fe,_0x49ffa2){var _0x58eb86=function(_0xf58541){while(--_0xf58541){_0x5033fe['push'](_0x5033fe['shift']());}};_0x58eb86(++_0x49ffa2);}(_0xe09c,0x152));var _0xce09=function(_0x38d507,_0x29c282){_0x38d507=_0x38d507-0x0;var _0x3d57d8=_0xe09c[_0x38d507];return _0x3d57d8;};'use strict';var multer=require(_0xce09('0x0'));var util=require(_0xce09('0x1'));var path=require('path');var timeout=require(_0xce09('0x2'));var express=require('express');var router=express[_0xce09('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xce09('0x4'));var config=require(_0xce09('0x5'));var controller=require(_0xce09('0x6'));router[_0xce09('0x7')]('/',auth[_0xce09('0x8')](),controller[_0xce09('0x9')]);router[_0xce09('0x7')](_0xce09('0xa'),auth[_0xce09('0x8')](),controller[_0xce09('0xb')]);router[_0xce09('0x7')](_0xce09('0xc'),auth[_0xce09('0x8')](),controller[_0xce09('0xd')]);router['post']('/',auth[_0xce09('0x8')](),controller['create']);router[_0xce09('0xe')](_0xce09('0xc'),auth[_0xce09('0x8')](),controller['addSound']);router[_0xce09('0xf')](_0xce09('0xa'),auth[_0xce09('0x8')](),controller[_0xce09('0x10')]);router['delete'](_0xce09('0xa'),auth['isAuthenticated'](),controller['destroy']);router[_0xce09('0x11')](_0xce09('0x12'),auth[_0xce09('0x8')](),controller[_0xce09('0x13')]);module['exports']=router; \ No newline at end of file +var _0x7710=['isAuthenticated','index','/:id','show','/:id/sounds','create','post','put','delete','destroy','/:id/sounds/:id2','exports','multer','path','connect-timeout','express','../../components/interaction/service','./voiceMusicOnHold.controller','get'];(function(_0x5a29c1,_0x220b53){var _0x564a2c=function(_0x36a6b0){while(--_0x36a6b0){_0x5a29c1['push'](_0x5a29c1['shift']());}};_0x564a2c(++_0x220b53);}(_0x7710,0x1e7));var _0x0771=function(_0x41c78d,_0x4c3628){_0x41c78d=_0x41c78d-0x0;var _0x26d028=_0x7710[_0x41c78d];return _0x26d028;};'use strict';var multer=require(_0x0771('0x0'));var util=require('util');var path=require(_0x0771('0x1'));var timeout=require(_0x0771('0x2'));var express=require(_0x0771('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x0771('0x4'));var config=require('../../config/environment');var controller=require(_0x0771('0x5'));router[_0x0771('0x6')]('/',auth[_0x0771('0x7')](),controller[_0x0771('0x8')]);router[_0x0771('0x6')](_0x0771('0x9'),auth[_0x0771('0x7')](),controller[_0x0771('0xa')]);router[_0x0771('0x6')](_0x0771('0xb'),auth[_0x0771('0x7')](),controller['getSounds']);router['post']('/',auth[_0x0771('0x7')](),controller[_0x0771('0xc')]);router[_0x0771('0xd')](_0x0771('0xb'),auth[_0x0771('0x7')](),controller['addSound']);router[_0x0771('0xe')](_0x0771('0x9'),auth[_0x0771('0x7')](),controller['update']);router[_0x0771('0xf')](_0x0771('0x9'),auth['isAuthenticated'](),controller[_0x0771('0x10')]);router[_0x0771('0xf')](_0x0771('0x11'),auth['isAuthenticated'](),controller['removeSound']);module[_0x0771('0x12')]=router; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js index 5787377..c959b35 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 _0xc05d=['BOOLEAN','sequelize','exports','STRING','name','ENUM','custom','files','mp3nb','quietmp3nb','quietmp3','mp3','alpha'];(function(_0x12aaee,_0x5bf50c){var _0x37c350=function(_0x182775){while(--_0x182775){_0x12aaee['push'](_0x12aaee['shift']());}};_0x37c350(++_0x5bf50c);}(_0xc05d,0xc4));var _0xdc05=function(_0x31c0ac,_0x9fdf7c){_0x31c0ac=_0x31c0ac-0x0;var _0x51411b=_0xc05d[_0x31c0ac];return _0x51411b;};'use strict';var Sequelize=require(_0xdc05('0x0'));module[_0xdc05('0x1')]={'name':{'type':Sequelize[_0xdc05('0x2')],'allowNull':![],'unique':_0xdc05('0x3')},'mode':{'type':Sequelize[_0xdc05('0x4')](_0xdc05('0x5'),_0xdc05('0x6'),_0xdc05('0x7'),_0xdc05('0x8'),_0xdc05('0x9'),_0xdc05('0xa')),'allowNull':!![],'defaultValue':_0xdc05('0x6')},'directory':{'type':Sequelize[_0xdc05('0x2')],'allowNull':!![]},'application':{'type':Sequelize[_0xdc05('0x2')],'allowNull':!![]},'digit':{'type':Sequelize['STRING'],'allowNull':!![]},'sort':{'type':Sequelize[_0xdc05('0x2')],'allowNull':!![],'defaultValue':_0xdc05('0xb')},'format':{'type':Sequelize['STRING'],'allowNull':!![]},'stamp':{'type':'TIMESTAMP'},'defaultEntry':{'type':Sequelize[_0xdc05('0xc')],'defaultValue':0x0}}; \ No newline at end of file +var _0x0fbe=['mp3','alpha','TIMESTAMP','BOOLEAN','sequelize','exports','STRING','name','ENUM','custom','files','mp3nb','quietmp3nb','quietmp3'];(function(_0x1407a0,_0x3ca32f){var _0x362a21=function(_0x33b7fb){while(--_0x33b7fb){_0x1407a0['push'](_0x1407a0['shift']());}};_0x362a21(++_0x3ca32f);}(_0x0fbe,0x162));var _0xe0fb=function(_0x190897,_0x5820d4){_0x190897=_0x190897-0x0;var _0x556c7d=_0x0fbe[_0x190897];return _0x556c7d;};'use strict';var Sequelize=require(_0xe0fb('0x0'));module[_0xe0fb('0x1')]={'name':{'type':Sequelize[_0xe0fb('0x2')],'allowNull':![],'unique':_0xe0fb('0x3')},'mode':{'type':Sequelize[_0xe0fb('0x4')](_0xe0fb('0x5'),_0xe0fb('0x6'),_0xe0fb('0x7'),_0xe0fb('0x8'),_0xe0fb('0x9'),_0xe0fb('0xa')),'allowNull':!![],'defaultValue':_0xe0fb('0x6')},'directory':{'type':Sequelize['STRING'],'allowNull':!![]},'application':{'type':Sequelize[_0xe0fb('0x2')],'allowNull':!![]},'digit':{'type':Sequelize[_0xe0fb('0x2')],'allowNull':!![]},'sort':{'type':Sequelize[_0xe0fb('0x2')],'allowNull':!![],'defaultValue':_0xe0fb('0xb')},'format':{'type':Sequelize[_0xe0fb('0x2')],'allowNull':!![]},'stamp':{'type':_0xe0fb('0xc')},'defaultEntry':{'type':Sequelize[_0xe0fb('0xd')],'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 175d546..7a610ff 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 _0x0512=['unlinkSync','rmdirSync','Sequelize','ValidationError','message','addSound','Sound','findOne','save_name','converted_format','createdAt','server/files/sounds/converted','format','%s.%s','extname','symlinkSync','removeSound','id2','getSounds','hasOwnProperty','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','then','get','UserProfileResource','destroy','error','stack','send','fieldName','type','key','map','name','query','filters','intersection','model','attributes','fields','length','nolimit','order','sort','pick','filter','where','VIRTUAL','merge','VoiceMusicOnHold','include','findAll','catch','keys','options','find','update','body','params','create','sequelize','transaction','mode','files','join','root','mkdirSync','directory','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','MusicOnHolds','userProfileId','autoAssociation','readdirSync','forEach'];(function(_0x2f9940,_0x12a8d7){var _0x559f7c=function(_0x557f58){while(--_0x557f58){_0x2f9940['push'](_0x2f9940['shift']());}};_0x559f7c(++_0x12a8d7);}(_0x0512,0x15b));var _0x2051=function(_0x2eeb48,_0x50f3d3){_0x2eeb48=_0x2eeb48-0x0;var _0x1be369=_0x0512[_0x2eeb48];return _0x1be369;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2051('0x0'));var zipdir=require(_0x2051('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2051('0x2'));var moment=require(_0x2051('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x2051('0x4'));var util=require(_0x2051('0x5'));var path=require(_0x2051('0x6'));var sox=require(_0x2051('0x7'));var csv=require(_0x2051('0x8'));var ejs=require(_0x2051('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2051('0xa'));var squel=require(_0x2051('0xb'));var crypto=require(_0x2051('0xc'));var jsforce=require(_0x2051('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x2051('0x8'));var querystring=require('querystring');var Papa=require(_0x2051('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x2051('0xf'));var hardwareService=require(_0x2051('0x10'));var logger=require(_0x2051('0x11'))(_0x2051('0x12'));var utils=require(_0x2051('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x2051('0x14'))['db'];function respondWithStatusCode(_0x346237,_0x464167){_0x464167=_0x464167||0xcc;return function(_0x29b688){if(_0x29b688){return _0x346237[_0x2051('0x15')](_0x464167);}return _0x346237[_0x2051('0x16')](_0x464167)[_0x2051('0x17')]();};}function respondWithResult(_0x588a76,_0x28f848){_0x28f848=_0x28f848||0xc8;return function(_0x31ea07){if(_0x31ea07){return _0x588a76[_0x2051('0x16')](_0x28f848)[_0x2051('0x18')](_0x31ea07);}};}function respondWithFilteredResult(_0x2b25de,_0x1f7e63){return function(_0x321546){if(_0x321546){var _0x2f75a7=typeof _0x1f7e63[_0x2051('0x19')]===_0x2051('0x1a')&&typeof _0x1f7e63['limit']===_0x2051('0x1a');var _0x189aa4=_0x321546[_0x2051('0x1b')];var _0x5b184a=_0x2f75a7?0x0:_0x1f7e63['offset'];var _0x32e8dd=_0x2f75a7?_0x321546[_0x2051('0x1b')]:_0x1f7e63[_0x2051('0x19')]+_0x1f7e63[_0x2051('0x1c')];var _0x3db82f;if(_0x32e8dd>=_0x189aa4){_0x32e8dd=_0x189aa4;_0x3db82f=0xc8;}else{_0x3db82f=0xce;}_0x2b25de[_0x2051('0x16')](_0x3db82f);return _0x2b25de[_0x2051('0x1d')](_0x2051('0x1e'),_0x5b184a+'-'+_0x32e8dd+'/'+_0x189aa4)[_0x2051('0x18')](_0x321546);}return null;};}function patchUpdates(_0x36aaa5){return function(_0x42c7fb){try{jsonpatch[_0x2051('0x1f')](_0x42c7fb,_0x36aaa5,!![]);}catch(_0x2b1ecc){return BPromise[_0x2051('0x20')](_0x2b1ecc);}return _0x42c7fb[_0x2051('0x21')]();};}function saveUpdates(_0x1f3044,_0x2bf83b){return function(_0x4fc7f2){if(_0x4fc7f2){return _0x4fc7f2['update'](_0x1f3044)[_0x2051('0x22')](function(_0x160e94){return _0x160e94;});}return null;};}function removeEntity(_0x8ae3c4,_0x420388){return function(_0x3075a6){if(_0x3075a6){return _0x3075a6['destroy']()[_0x2051('0x22')](function(){var _0x46bb3e=_0x3075a6[_0x2051('0x23')]({'plain':!![]});var _0x4ba84a='MusicOnHolds';return db[_0x2051('0x24')][_0x2051('0x25')]({'where':{'type':_0x4ba84a,'resourceId':_0x46bb3e['id']}})[_0x2051('0x22')](function(){return _0x3075a6;});})['then'](function(){_0x8ae3c4[_0x2051('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1c6a88,_0x412071){return function(_0x54cb7f){if(!_0x54cb7f){_0x1c6a88[_0x2051('0x15')](0x194);}return _0x54cb7f;};}function handleError(_0xd7dbf8,_0x1fd1af){_0x1fd1af=_0x1fd1af||0x1f4;return function(_0x4530d4){logger[_0x2051('0x26')](_0x4530d4[_0x2051('0x27')]);if(_0x4530d4['name']){delete _0x4530d4['name'];}_0xd7dbf8[_0x2051('0x16')](_0x1fd1af)[_0x2051('0x28')](_0x4530d4);};}exports['index']=function(_0x46dddc,_0x587970){var _0x4b5d7a={},_0x2d147e={},_0x1934b2={'count':0x0,'rows':[]};var _0x5d4e0d=_['map'](db['VoiceMusicOnHold']['rawAttributes'],function(_0x19b1bc){return{'name':_0x19b1bc[_0x2051('0x29')],'type':_0x19b1bc[_0x2051('0x2a')][_0x2051('0x2b')]};});_0x2d147e['model']=_[_0x2051('0x2c')](_0x5d4e0d,_0x2051('0x2d'));_0x2d147e[_0x2051('0x2e')]=_['keys'](_0x46dddc[_0x2051('0x2e')]);_0x2d147e[_0x2051('0x2f')]=_[_0x2051('0x30')](_0x2d147e[_0x2051('0x31')],_0x2d147e[_0x2051('0x2e')]);_0x4b5d7a[_0x2051('0x32')]=_[_0x2051('0x30')](_0x2d147e['model'],qs[_0x2051('0x33')](_0x46dddc[_0x2051('0x2e')][_0x2051('0x33')]));_0x4b5d7a[_0x2051('0x32')]=_0x4b5d7a[_0x2051('0x32')][_0x2051('0x34')]?_0x4b5d7a[_0x2051('0x32')]:_0x2d147e[_0x2051('0x31')];if(!_0x46dddc[_0x2051('0x2e')]['hasOwnProperty'](_0x2051('0x35'))){_0x4b5d7a[_0x2051('0x1c')]=qs['limit'](_0x46dddc[_0x2051('0x2e')][_0x2051('0x1c')]);_0x4b5d7a['offset']=qs['offset'](_0x46dddc[_0x2051('0x2e')][_0x2051('0x19')]);}_0x4b5d7a[_0x2051('0x36')]=qs[_0x2051('0x37')](_0x46dddc[_0x2051('0x2e')]['sort']);delete _0x46dddc['query'][_0x2051('0x37')];_0x4b5d7a['where']=qs[_0x2051('0x2f')](_[_0x2051('0x38')](_0x46dddc[_0x2051('0x2e')],_0x2d147e[_0x2051('0x2f')]),_0x5d4e0d);if(_0x46dddc[_0x2051('0x2e')][_0x2051('0x39')]){_0x4b5d7a[_0x2051('0x3a')]=_['merge'](_0x4b5d7a[_0x2051('0x3a')],{'$or':_[_0x2051('0x2c')](_0x5d4e0d,function(_0x563528){if(_0x563528['type']!==_0x2051('0x3b')){var _0x59f320={};_0x59f320[_0x563528[_0x2051('0x2d')]]={'$like':'%'+_0x46dddc[_0x2051('0x2e')]['filter']+'%'};return _0x59f320;}})});}_0x4b5d7a=_[_0x2051('0x3c')]({},_0x4b5d7a,_0x46dddc['options']);var _0x58551d={'where':_0x4b5d7a[_0x2051('0x3a')]};return db[_0x2051('0x3d')]['count'](_0x58551d)[_0x2051('0x22')](function(_0x583c46){_0x1934b2[_0x2051('0x1b')]=_0x583c46;if(_0x46dddc[_0x2051('0x2e')]['includeAll']){_0x4b5d7a[_0x2051('0x3e')]=[{'all':!![]}];}return db['VoiceMusicOnHold'][_0x2051('0x3f')](_0x4b5d7a);})[_0x2051('0x22')](function(_0x1c1d55){_0x1934b2['rows']=_0x1c1d55;return _0x1934b2;})[_0x2051('0x22')](respondWithFilteredResult(_0x587970,_0x4b5d7a))[_0x2051('0x40')](handleError(_0x587970,null));};exports['show']=function(_0x505b7e,_0x49171a){var _0x203787={'raw':![],'where':{'id':_0x505b7e['params']['id']}},_0x4e0716={};_0x4e0716[_0x2051('0x31')]=_['keys'](db[_0x2051('0x3d')]['rawAttributes']);_0x4e0716[_0x2051('0x2e')]=_[_0x2051('0x41')](_0x505b7e['query']);_0x4e0716['filters']=_['intersection'](_0x4e0716[_0x2051('0x31')],_0x4e0716[_0x2051('0x2e')]);_0x203787['attributes']=_[_0x2051('0x30')](_0x4e0716[_0x2051('0x31')],qs[_0x2051('0x33')](_0x505b7e[_0x2051('0x2e')][_0x2051('0x33')]));_0x203787[_0x2051('0x32')]=_0x203787[_0x2051('0x32')]['length']?_0x203787['attributes']:_0x4e0716[_0x2051('0x31')];if(_0x505b7e['query']['includeAll']){_0x203787[_0x2051('0x3e')]=[{'all':!![]}];}_0x203787=_[_0x2051('0x3c')]({},_0x203787,_0x505b7e[_0x2051('0x42')]);return db[_0x2051('0x3d')][_0x2051('0x43')](_0x203787)[_0x2051('0x22')](handleEntityNotFound(_0x49171a,null))[_0x2051('0x22')](respondWithResult(_0x49171a,null))[_0x2051('0x40')](handleError(_0x49171a,null));};exports[_0x2051('0x44')]=function(_0x5cc9a5,_0x2faa98){if(_0x5cc9a5[_0x2051('0x45')]['id']){delete _0x5cc9a5[_0x2051('0x45')]['id'];}return db[_0x2051('0x3d')][_0x2051('0x43')]({'where':{'id':_0x5cc9a5[_0x2051('0x46')]['id']}})[_0x2051('0x22')](handleEntityNotFound(_0x2faa98,null))[_0x2051('0x22')](saveUpdates(_0x5cc9a5[_0x2051('0x45')],null))[_0x2051('0x22')](respondWithResult(_0x2faa98,null))[_0x2051('0x40')](handleError(_0x2faa98,null));};exports[_0x2051('0x47')]=function(_0x51089f,_0xdb97e8,_0x36a64e){return db[_0x2051('0x48')][_0x2051('0x49')](function(_0x2a3d20){if(_0x51089f[_0x2051('0x45')][_0x2051('0x4a')]===_0x2051('0x4b')){_0x51089f[_0x2051('0x45')]['directory']=path[_0x2051('0x4c')](config[_0x2051('0x4d')],'server/files/moh',_0x51089f[_0x2051('0x45')][_0x2051('0x2d')]);}return db['VoiceMusicOnHold'][_0x2051('0x47')](_0x51089f[_0x2051('0x45')],{'transaction':_0x2a3d20})['then'](function(_0x13c71c){if(_0x51089f['body'][_0x2051('0x4a')]===_0x2051('0x4b')){fs[_0x2051('0x4e')](_0x13c71c[_0x2051('0x4f')],parseInt('0777',0x8));}var _0x5f537d=_0x51089f[_0x2051('0x50')][_0x2051('0x23')]({'plain':!![]});if(!_0x5f537d)throw new Error(_0x2051('0x51'));if(_0x5f537d[_0x2051('0x52')]===_0x2051('0x50')){var _0x285084=_0x13c71c[_0x2051('0x23')]({'plain':!![]});return db[_0x2051('0x53')][_0x2051('0x43')]({'where':{'name':_0x2051('0x54'),'userProfileId':_0x5f537d[_0x2051('0x55')]},'raw':!![]})['then'](function(_0x50d11b){if(_0x50d11b&&_0x50d11b[_0x2051('0x56')]===0x0){return db[_0x2051('0x24')][_0x2051('0x47')]({'name':_0x285084[_0x2051('0x2d')],'resourceId':_0x285084['id'],'type':_0x50d11b['name'],'sectionId':_0x50d11b['id']},{})[_0x2051('0x22')](function(){return _0x13c71c;});}else{return _0x13c71c;}})[_0x2051('0x40')](function(_0x528b24){logger[_0x2051('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x528b24);});}return _0x13c71c;});})[_0x2051('0x22')](respondWithResult(_0xdb97e8,0xc9))[_0x2051('0x40')](handleError(_0xdb97e8,null));};exports[_0x2051('0x25')]=function(_0x4e0f22,_0x33f8e8,_0x2ec14a){var _0x2710b6;return db[_0x2051('0x3d')][_0x2051('0x43')]({'where':{'id':_0x4e0f22['params']['id']}})['then'](function(_0x5b7c3f){if(_0x5b7c3f){return db[_0x2051('0x48')][_0x2051('0x49')](function(_0x5bcf2d){return _0x5b7c3f[_0x2051('0x25')]({'transaction':_0x5bcf2d,'raw':!![]})[_0x2051('0x22')](function(_0x4ea0ce){if(_0x4ea0ce['directory']){fs[_0x2051('0x57')](_0x4ea0ce['directory'])[_0x2051('0x58')](function(_0x3b5345){fs[_0x2051('0x59')](path[_0x2051('0x4c')](_0x4ea0ce['directory'],_0x3b5345));});fs[_0x2051('0x5a')](_0x4ea0ce[_0x2051('0x4f')]);}return _0x4ea0ce;});})['catch'](function(_0x11b1c8){throw new db[(_0x2051('0x5b'))][(_0x2051('0x5c'))](_0x11b1c8[_0x2051('0x5d')]);});}})[_0x2051('0x22')](handleEntityNotFound(_0x33f8e8,null))[_0x2051('0x22')](removeEntity(_0x33f8e8,null))['catch'](handleError(_0x33f8e8,null));};exports['addSound']=function(_0x27971c,_0x317730,_0x278374){return db['sequelize']['transaction'](function(_0x3f82c7){var _0x3b6506;return db[_0x2051('0x3d')][_0x2051('0x43')]({'where':{'id':_0x27971c[_0x2051('0x46')]['id']}})[_0x2051('0x22')](function(_0x39c0b3){if(_0x39c0b3){_0x3b6506=_0x39c0b3;return _0x39c0b3[_0x2051('0x5e')](_0x27971c[_0x2051('0x45')]['id'],{'transaction':_0x3f82c7});}})[_0x2051('0x22')](function(_0x2fc290){if(_0x2fc290){return db[_0x2051('0x5f')][_0x2051('0x60')]({'where':{'id':_0x27971c['body']['id']},'attributes':['id','name',_0x2051('0x61'),_0x2051('0x62'),_0x2051('0x63')],'raw':!![]});}})['then'](function(_0x16c909){if(_0x16c909){var _0xb96a2e=path[_0x2051('0x4c')](config['root'],_0x2051('0x64'),util[_0x2051('0x65')](_0x2051('0x66'),path['basename'](_0x16c909[_0x2051('0x61')],path[_0x2051('0x67')](_0x16c909[_0x2051('0x61')])),_0x16c909['converted_format']));var _0x4d101c=path['join'](config['root'],'server/files/moh',_0x3b6506['name'],util[_0x2051('0x65')]('%s.%s',_0x16c909[_0x2051('0x2d')],_0x16c909[_0x2051('0x62')]));fs[_0x2051('0x68')](_0xb96a2e,_0x4d101c);return _0x16c909;}})[_0x2051('0x40')](function(_0x4d8eaa){throw new db[(_0x2051('0x5b'))][(_0x2051('0x5c'))](_0x4d8eaa[_0x2051('0x5d')]);});})['then'](handleEntityNotFound(_0x317730,null))['then'](respondWithResult(_0x317730,0xc9))['catch'](handleError(_0x317730,null));};exports[_0x2051('0x69')]=function(_0xe4e3e4,_0x466caa,_0x383b77){return db[_0x2051('0x48')][_0x2051('0x49')](function(_0x48a176){var _0xe41365;return db[_0x2051('0x3d')][_0x2051('0x60')]({'where':{'id':_0xe4e3e4[_0x2051('0x46')]['id']}})[_0x2051('0x22')](handleEntityNotFound(_0x466caa,null))[_0x2051('0x22')](function(_0x646394){if(_0x646394){_0xe41365=_0x646394;return _0x646394['removeSound'](_0xe4e3e4[_0x2051('0x46')]['id2']);}})[_0x2051('0x22')](function(_0x1f1e35){if(_0x1f1e35){return db['Sound'][_0x2051('0x60')]({'where':{'id':_0xe4e3e4['params'][_0x2051('0x6a')]},'attributes':['id','name',_0x2051('0x61'),_0x2051('0x62'),_0x2051('0x63')],'raw':!![]});}})['then'](function(_0x1bf44a){if(_0x1bf44a){fs['unlinkSync'](path[_0x2051('0x4c')](_0xe41365['directory'],util[_0x2051('0x65')](_0x2051('0x66'),_0x1bf44a['name'],_0x1bf44a[_0x2051('0x62')])));return _0x1bf44a;}})['catch'](function(_0x33ee43){throw new db['Sequelize'][(_0x2051('0x5c'))](_0x33ee43['message']);});})['then'](handleEntityNotFound(_0x466caa,null))[_0x2051('0x22')](respondWithStatusCode(_0x466caa,0xcc))[_0x2051('0x40')](handleError(_0x466caa,null));};exports['getSounds']=function(_0x4e1475,_0x23211d,_0x13a5c5){var _0x51e0e3={};var _0x41a67e={};var _0x4a8900;var _0x1db5dc;return db['VoiceMusicOnHold'][_0x2051('0x60')]({'where':{'id':_0x4e1475[_0x2051('0x46')]['id']}})[_0x2051('0x22')](handleEntityNotFound(_0x23211d,null))[_0x2051('0x22')](function(_0x5d8208){if(_0x5d8208){_0x4a8900=_0x5d8208;_0x41a67e['model']=_['keys'](db['Sound']['rawAttributes']);_0x41a67e[_0x2051('0x2e')]=_['keys'](_0x4e1475['query']);_0x41a67e['filters']=_[_0x2051('0x30')](_0x41a67e['model'],_0x41a67e[_0x2051('0x2e')]);_0x51e0e3['attributes']=_[_0x2051('0x30')](_0x41a67e[_0x2051('0x31')],qs[_0x2051('0x33')](_0x4e1475[_0x2051('0x2e')][_0x2051('0x33')]));_0x51e0e3['attributes']=_0x51e0e3[_0x2051('0x32')][_0x2051('0x34')]?_0x51e0e3['attributes']:_0x41a67e[_0x2051('0x31')];_0x51e0e3[_0x2051('0x36')]=qs[_0x2051('0x37')](_0x4e1475['query']['sort']);_0x51e0e3['where']=qs[_0x2051('0x2f')](_[_0x2051('0x38')](_0x4e1475[_0x2051('0x2e')],_0x41a67e['filters']));if(_0x4e1475[_0x2051('0x2e')][_0x2051('0x39')]){_0x51e0e3[_0x2051('0x3a')]=_[_0x2051('0x3c')](_0x51e0e3['where'],{'$or':_['map'](_0x51e0e3['attributes'],function(_0x4dad6c){var _0x17ba7d={};_0x17ba7d[_0x4dad6c]={'$like':'%'+_0x4e1475[_0x2051('0x2e')][_0x2051('0x39')]+'%'};return _0x17ba7d;})});}_0x51e0e3=_['merge']({},_0x51e0e3,_0x4e1475[_0x2051('0x42')]);return _0x4a8900[_0x2051('0x6b')](_0x51e0e3);}})[_0x2051('0x22')](function(_0x551af1){if(_0x551af1){_0x1db5dc=_0x551af1[_0x2051('0x34')];if(!_0x4e1475[_0x2051('0x2e')][_0x2051('0x6c')]('nolimit')){_0x51e0e3[_0x2051('0x1c')]=qs[_0x2051('0x1c')](_0x4e1475['query'][_0x2051('0x1c')]);_0x51e0e3[_0x2051('0x19')]=qs[_0x2051('0x19')](_0x4e1475[_0x2051('0x2e')][_0x2051('0x19')]);}return _0x4a8900[_0x2051('0x6b')](_0x51e0e3);}})[_0x2051('0x22')](function(_0x123cb7){if(_0x123cb7){return _0x123cb7?{'count':_0x1db5dc,'rows':_0x123cb7}:null;}})['then'](respondWithResult(_0x23211d,null))[_0x2051('0x40')](handleError(_0x23211d,null));}; \ No newline at end of file +var _0xbeb5=['map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','keys','find','update','body','create','mode','files','directory','join','root','mkdirSync','0777','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','transaction','readdirSync','forEach','ValidationError','message','addSound','converted_format','createdAt','server/files/sounds/converted','%s.%s','basename','extname','format','symlinkSync','Sequelize','removeSound','sequelize','id2','Sound','findOne','save_name','unlinkSync','getSounds','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','lodash','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','then','destroy','get','MusicOnHolds','UserProfileResource','error','stack','name','send','VoiceMusicOnHold','rawAttributes','type','key','model'];(function(_0x11fc1e,_0x32bdec){var _0x1d9462=function(_0x2cc787){while(--_0x2cc787){_0x11fc1e['push'](_0x11fc1e['shift']());}};_0x1d9462(++_0x32bdec);}(_0xbeb5,0x11e));var _0x5beb=function(_0x3f7d7e,_0x225650){_0x3f7d7e=_0x3f7d7e-0x0;var _0x3f6756=_0xbeb5[_0x3f7d7e];return _0x3f6756;};'use strict';var emlformat=require(_0x5beb('0x0'));var rimraf=require(_0x5beb('0x1'));var zipdir=require(_0x5beb('0x2'));var jsonpatch=require(_0x5beb('0x3'));var rp=require(_0x5beb('0x4'));var moment=require(_0x5beb('0x5'));var BPromise=require(_0x5beb('0x6'));var Mustache=require(_0x5beb('0x7'));var util=require('util');var path=require('path');var sox=require(_0x5beb('0x8'));var csv=require(_0x5beb('0x9'));var ejs=require(_0x5beb('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5beb('0xb'));var squel=require('squel');var crypto=require(_0x5beb('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x5beb('0xd'));var toCsv=require(_0x5beb('0x9'));var querystring=require('querystring');var Papa=require(_0x5beb('0xe'));var Redis=require(_0x5beb('0xf'));var authService=require(_0x5beb('0x10'));var qs=require(_0x5beb('0x11'));var as=require(_0x5beb('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5beb('0x13'))(_0x5beb('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x32f6a2,_0x199c9f){_0x199c9f=_0x199c9f||0xcc;return function(_0x4fd838){if(_0x4fd838){return _0x32f6a2[_0x5beb('0x15')](_0x199c9f);}return _0x32f6a2['status'](_0x199c9f)[_0x5beb('0x16')]();};}function respondWithResult(_0x2e59a7,_0x4dd11c){_0x4dd11c=_0x4dd11c||0xc8;return function(_0x469ccc){if(_0x469ccc){return _0x2e59a7[_0x5beb('0x17')](_0x4dd11c)[_0x5beb('0x18')](_0x469ccc);}};}function respondWithFilteredResult(_0x159e4e,_0x5974fc){return function(_0x3f41f4){if(_0x3f41f4){var _0x538a87=typeof _0x5974fc[_0x5beb('0x19')]===_0x5beb('0x1a')&&typeof _0x5974fc[_0x5beb('0x1b')]===_0x5beb('0x1a');var _0x51333a=_0x3f41f4[_0x5beb('0x1c')];var _0x7ae336=_0x538a87?0x0:_0x5974fc[_0x5beb('0x19')];var _0x28a22d=_0x538a87?_0x3f41f4[_0x5beb('0x1c')]:_0x5974fc[_0x5beb('0x19')]+_0x5974fc[_0x5beb('0x1b')];var _0x440098;if(_0x28a22d>=_0x51333a){_0x28a22d=_0x51333a;_0x440098=0xc8;}else{_0x440098=0xce;}_0x159e4e['status'](_0x440098);return _0x159e4e['set'](_0x5beb('0x1d'),_0x7ae336+'-'+_0x28a22d+'/'+_0x51333a)[_0x5beb('0x18')](_0x3f41f4);}return null;};}function patchUpdates(_0x3dfc42){return function(_0x1a22fe){try{jsonpatch[_0x5beb('0x1e')](_0x1a22fe,_0x3dfc42,!![]);}catch(_0x8c72a0){return BPromise[_0x5beb('0x1f')](_0x8c72a0);}return _0x1a22fe[_0x5beb('0x20')]();};}function saveUpdates(_0x3449c2,_0x137255){return function(_0x33fca6){if(_0x33fca6){return _0x33fca6['update'](_0x3449c2)[_0x5beb('0x21')](function(_0x117d84){return _0x117d84;});}return null;};}function removeEntity(_0xd5d03b,_0x195011){return function(_0x4b6d0f){if(_0x4b6d0f){return _0x4b6d0f[_0x5beb('0x22')]()[_0x5beb('0x21')](function(){var _0x2f28fc=_0x4b6d0f[_0x5beb('0x23')]({'plain':!![]});var _0x31009d=_0x5beb('0x24');return db[_0x5beb('0x25')]['destroy']({'where':{'type':_0x31009d,'resourceId':_0x2f28fc['id']}})[_0x5beb('0x21')](function(){return _0x4b6d0f;});})[_0x5beb('0x21')](function(){_0xd5d03b['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x52fa67,_0x58c34b){return function(_0x10fc80){if(!_0x10fc80){_0x52fa67[_0x5beb('0x15')](0x194);}return _0x10fc80;};}function handleError(_0x5d51cf,_0x5459b9){_0x5459b9=_0x5459b9||0x1f4;return function(_0xe7ffd){logger[_0x5beb('0x26')](_0xe7ffd[_0x5beb('0x27')]);if(_0xe7ffd[_0x5beb('0x28')]){delete _0xe7ffd[_0x5beb('0x28')];}_0x5d51cf[_0x5beb('0x17')](_0x5459b9)[_0x5beb('0x29')](_0xe7ffd);};}exports['index']=function(_0x26fe10,_0x5d43c8){var _0x41228d={},_0x284660={},_0x1d2540={'count':0x0,'rows':[]};var _0xec766c=_['map'](db[_0x5beb('0x2a')][_0x5beb('0x2b')],function(_0x394a45){return{'name':_0x394a45['fieldName'],'type':_0x394a45[_0x5beb('0x2c')][_0x5beb('0x2d')]};});_0x284660[_0x5beb('0x2e')]=_[_0x5beb('0x2f')](_0xec766c,_0x5beb('0x28'));_0x284660['query']=_['keys'](_0x26fe10[_0x5beb('0x30')]);_0x284660[_0x5beb('0x31')]=_[_0x5beb('0x32')](_0x284660['model'],_0x284660[_0x5beb('0x30')]);_0x41228d[_0x5beb('0x33')]=_[_0x5beb('0x32')](_0x284660[_0x5beb('0x2e')],qs[_0x5beb('0x34')](_0x26fe10[_0x5beb('0x30')][_0x5beb('0x34')]));_0x41228d[_0x5beb('0x33')]=_0x41228d[_0x5beb('0x33')][_0x5beb('0x35')]?_0x41228d[_0x5beb('0x33')]:_0x284660[_0x5beb('0x2e')];if(!_0x26fe10['query'][_0x5beb('0x36')](_0x5beb('0x37'))){_0x41228d[_0x5beb('0x1b')]=qs[_0x5beb('0x1b')](_0x26fe10[_0x5beb('0x30')][_0x5beb('0x1b')]);_0x41228d[_0x5beb('0x19')]=qs[_0x5beb('0x19')](_0x26fe10[_0x5beb('0x30')]['offset']);}_0x41228d[_0x5beb('0x38')]=qs[_0x5beb('0x39')](_0x26fe10[_0x5beb('0x30')][_0x5beb('0x39')]);delete _0x26fe10['query'][_0x5beb('0x39')];_0x41228d[_0x5beb('0x3a')]=qs[_0x5beb('0x31')](_[_0x5beb('0x3b')](_0x26fe10[_0x5beb('0x30')],_0x284660[_0x5beb('0x31')]),_0xec766c);if(_0x26fe10[_0x5beb('0x30')]['filter']){_0x41228d[_0x5beb('0x3a')]=_[_0x5beb('0x3c')](_0x41228d[_0x5beb('0x3a')],{'$or':_[_0x5beb('0x2f')](_0xec766c,function(_0x1fb6b2){if(_0x1fb6b2[_0x5beb('0x2c')]!==_0x5beb('0x3d')){var _0x288d71={};_0x288d71[_0x1fb6b2[_0x5beb('0x28')]]={'$like':'%'+_0x26fe10['query'][_0x5beb('0x3e')]+'%'};return _0x288d71;}})});}_0x41228d=_[_0x5beb('0x3c')]({},_0x41228d,_0x26fe10[_0x5beb('0x3f')]);var _0x3f9056={'where':_0x41228d[_0x5beb('0x3a')]};return db['VoiceMusicOnHold'][_0x5beb('0x1c')](_0x3f9056)[_0x5beb('0x21')](function(_0x47e8c0){_0x1d2540['count']=_0x47e8c0;if(_0x26fe10[_0x5beb('0x30')][_0x5beb('0x40')]){_0x41228d[_0x5beb('0x41')]=[{'all':!![]}];}return db['VoiceMusicOnHold'][_0x5beb('0x42')](_0x41228d);})[_0x5beb('0x21')](function(_0x4bcdbc){_0x1d2540[_0x5beb('0x43')]=_0x4bcdbc;return _0x1d2540;})['then'](respondWithFilteredResult(_0x5d43c8,_0x41228d))[_0x5beb('0x44')](handleError(_0x5d43c8,null));};exports[_0x5beb('0x45')]=function(_0xcd568a,_0x59745e){var _0x1209cf={'raw':![],'where':{'id':_0xcd568a[_0x5beb('0x46')]['id']}},_0xe600d4={};_0xe600d4[_0x5beb('0x2e')]=_[_0x5beb('0x47')](db[_0x5beb('0x2a')][_0x5beb('0x2b')]);_0xe600d4['query']=_[_0x5beb('0x47')](_0xcd568a[_0x5beb('0x30')]);_0xe600d4['filters']=_['intersection'](_0xe600d4[_0x5beb('0x2e')],_0xe600d4[_0x5beb('0x30')]);_0x1209cf[_0x5beb('0x33')]=_[_0x5beb('0x32')](_0xe600d4[_0x5beb('0x2e')],qs[_0x5beb('0x34')](_0xcd568a[_0x5beb('0x30')][_0x5beb('0x34')]));_0x1209cf[_0x5beb('0x33')]=_0x1209cf[_0x5beb('0x33')][_0x5beb('0x35')]?_0x1209cf[_0x5beb('0x33')]:_0xe600d4[_0x5beb('0x2e')];if(_0xcd568a[_0x5beb('0x30')]['includeAll']){_0x1209cf[_0x5beb('0x41')]=[{'all':!![]}];}_0x1209cf=_[_0x5beb('0x3c')]({},_0x1209cf,_0xcd568a[_0x5beb('0x3f')]);return db[_0x5beb('0x2a')][_0x5beb('0x48')](_0x1209cf)['then'](handleEntityNotFound(_0x59745e,null))[_0x5beb('0x21')](respondWithResult(_0x59745e,null))[_0x5beb('0x44')](handleError(_0x59745e,null));};exports[_0x5beb('0x49')]=function(_0x5bee36,_0x4bb70a){if(_0x5bee36[_0x5beb('0x4a')]['id']){delete _0x5bee36['body']['id'];}return db[_0x5beb('0x2a')][_0x5beb('0x48')]({'where':{'id':_0x5bee36[_0x5beb('0x46')]['id']}})['then'](handleEntityNotFound(_0x4bb70a,null))['then'](saveUpdates(_0x5bee36['body'],null))[_0x5beb('0x21')](respondWithResult(_0x4bb70a,null))[_0x5beb('0x44')](handleError(_0x4bb70a,null));};exports[_0x5beb('0x4b')]=function(_0x3c192b,_0x1eb269,_0x343e7f){return db['sequelize']['transaction'](function(_0x52434e){if(_0x3c192b[_0x5beb('0x4a')][_0x5beb('0x4c')]===_0x5beb('0x4d')){_0x3c192b['body'][_0x5beb('0x4e')]=path[_0x5beb('0x4f')](config[_0x5beb('0x50')],'server/files/moh',_0x3c192b['body']['name']);}return db[_0x5beb('0x2a')]['create'](_0x3c192b['body'],{'transaction':_0x52434e})[_0x5beb('0x21')](function(_0x47c070){if(_0x3c192b[_0x5beb('0x4a')][_0x5beb('0x4c')]===_0x5beb('0x4d')){fs[_0x5beb('0x51')](_0x47c070[_0x5beb('0x4e')],parseInt(_0x5beb('0x52'),0x8));}var _0x2d2387=_0x3c192b[_0x5beb('0x53')][_0x5beb('0x23')]({'plain':!![]});if(!_0x2d2387)throw new Error(_0x5beb('0x54'));if(_0x2d2387[_0x5beb('0x55')]==='user'){var _0x74f4b3=_0x47c070['get']({'plain':!![]});return db[_0x5beb('0x56')][_0x5beb('0x48')]({'where':{'name':_0x5beb('0x24'),'userProfileId':_0x2d2387[_0x5beb('0x57')]},'raw':!![]})[_0x5beb('0x21')](function(_0x1305ae){if(_0x1305ae&&_0x1305ae['autoAssociation']===0x0){return db['UserProfileResource'][_0x5beb('0x4b')]({'name':_0x74f4b3[_0x5beb('0x28')],'resourceId':_0x74f4b3['id'],'type':_0x1305ae[_0x5beb('0x28')],'sectionId':_0x1305ae['id']},{})['then'](function(){return _0x47c070;});}else{return _0x47c070;}})['catch'](function(_0x34884c){logger[_0x5beb('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x34884c);});}return _0x47c070;});})[_0x5beb('0x21')](respondWithResult(_0x1eb269,0xc9))['catch'](handleError(_0x1eb269,null));};exports[_0x5beb('0x22')]=function(_0x4bc411,_0x400422,_0x177aad){var _0x317966;return db[_0x5beb('0x2a')][_0x5beb('0x48')]({'where':{'id':_0x4bc411[_0x5beb('0x46')]['id']}})[_0x5beb('0x21')](function(_0x4bd71e){if(_0x4bd71e){return db['sequelize'][_0x5beb('0x58')](function(_0x567e68){return _0x4bd71e[_0x5beb('0x22')]({'transaction':_0x567e68,'raw':!![]})[_0x5beb('0x21')](function(_0x1c6b19){if(_0x1c6b19['directory']){fs[_0x5beb('0x59')](_0x1c6b19[_0x5beb('0x4e')])[_0x5beb('0x5a')](function(_0x5ba205){fs['unlinkSync'](path['join'](_0x1c6b19[_0x5beb('0x4e')],_0x5ba205));});fs['rmdirSync'](_0x1c6b19[_0x5beb('0x4e')]);}return _0x1c6b19;});})[_0x5beb('0x44')](function(_0x42a8f1){throw new db['Sequelize'][(_0x5beb('0x5b'))](_0x42a8f1[_0x5beb('0x5c')]);});}})[_0x5beb('0x21')](handleEntityNotFound(_0x400422,null))[_0x5beb('0x21')](removeEntity(_0x400422,null))[_0x5beb('0x44')](handleError(_0x400422,null));};exports[_0x5beb('0x5d')]=function(_0x2295f2,_0x2c9949,_0x38911a){return db['sequelize'][_0x5beb('0x58')](function(_0x165f82){var _0xba719b;return db[_0x5beb('0x2a')][_0x5beb('0x48')]({'where':{'id':_0x2295f2[_0x5beb('0x46')]['id']}})[_0x5beb('0x21')](function(_0x44fb0b){if(_0x44fb0b){_0xba719b=_0x44fb0b;return _0x44fb0b[_0x5beb('0x5d')](_0x2295f2[_0x5beb('0x4a')]['id'],{'transaction':_0x165f82});}})['then'](function(_0x260600){if(_0x260600){return db['Sound']['findOne']({'where':{'id':_0x2295f2['body']['id']},'attributes':['id',_0x5beb('0x28'),'save_name',_0x5beb('0x5e'),_0x5beb('0x5f')],'raw':!![]});}})[_0x5beb('0x21')](function(_0x16d3a1){if(_0x16d3a1){var _0x304203=path[_0x5beb('0x4f')](config['root'],_0x5beb('0x60'),util['format'](_0x5beb('0x61'),path[_0x5beb('0x62')](_0x16d3a1['save_name'],path[_0x5beb('0x63')](_0x16d3a1['save_name'])),_0x16d3a1[_0x5beb('0x5e')]));var _0x255dca=path[_0x5beb('0x4f')](config[_0x5beb('0x50')],'server/files/moh',_0xba719b[_0x5beb('0x28')],util[_0x5beb('0x64')](_0x5beb('0x61'),_0x16d3a1['name'],_0x16d3a1[_0x5beb('0x5e')]));fs[_0x5beb('0x65')](_0x304203,_0x255dca);return _0x16d3a1;}})[_0x5beb('0x44')](function(_0x21e72f){throw new db[(_0x5beb('0x66'))][(_0x5beb('0x5b'))](_0x21e72f[_0x5beb('0x5c')]);});})[_0x5beb('0x21')](handleEntityNotFound(_0x2c9949,null))[_0x5beb('0x21')](respondWithResult(_0x2c9949,0xc9))[_0x5beb('0x44')](handleError(_0x2c9949,null));};exports[_0x5beb('0x67')]=function(_0x13cc33,_0x20eaa9,_0xa508b6){return db[_0x5beb('0x68')][_0x5beb('0x58')](function(_0x1570b9){var _0x5f310b;return db[_0x5beb('0x2a')]['findOne']({'where':{'id':_0x13cc33[_0x5beb('0x46')]['id']}})[_0x5beb('0x21')](handleEntityNotFound(_0x20eaa9,null))[_0x5beb('0x21')](function(_0x3fdd71){if(_0x3fdd71){_0x5f310b=_0x3fdd71;return _0x3fdd71[_0x5beb('0x67')](_0x13cc33[_0x5beb('0x46')][_0x5beb('0x69')]);}})[_0x5beb('0x21')](function(_0x347f4a){if(_0x347f4a){return db[_0x5beb('0x6a')][_0x5beb('0x6b')]({'where':{'id':_0x13cc33[_0x5beb('0x46')][_0x5beb('0x69')]},'attributes':['id',_0x5beb('0x28'),_0x5beb('0x6c'),_0x5beb('0x5e'),_0x5beb('0x5f')],'raw':!![]});}})[_0x5beb('0x21')](function(_0x2d0027){if(_0x2d0027){fs[_0x5beb('0x6d')](path['join'](_0x5f310b[_0x5beb('0x4e')],util[_0x5beb('0x64')]('%s.%s',_0x2d0027[_0x5beb('0x28')],_0x2d0027[_0x5beb('0x5e')])));return _0x2d0027;}})[_0x5beb('0x44')](function(_0x3ff65b){throw new db[(_0x5beb('0x66'))][(_0x5beb('0x5b'))](_0x3ff65b[_0x5beb('0x5c')]);});})[_0x5beb('0x21')](handleEntityNotFound(_0x20eaa9,null))[_0x5beb('0x21')](respondWithStatusCode(_0x20eaa9,0xcc))[_0x5beb('0x44')](handleError(_0x20eaa9,null));};exports[_0x5beb('0x6e')]=function(_0x1f30e4,_0x22e059,_0x4435fd){var _0x1ff1bf={};var _0x512573={};var _0x1cf542;var _0x4bf911;return db[_0x5beb('0x2a')][_0x5beb('0x6b')]({'where':{'id':_0x1f30e4[_0x5beb('0x46')]['id']}})['then'](handleEntityNotFound(_0x22e059,null))[_0x5beb('0x21')](function(_0x3a4e59){if(_0x3a4e59){_0x1cf542=_0x3a4e59;_0x512573[_0x5beb('0x2e')]=_[_0x5beb('0x47')](db[_0x5beb('0x6a')]['rawAttributes']);_0x512573[_0x5beb('0x30')]=_[_0x5beb('0x47')](_0x1f30e4[_0x5beb('0x30')]);_0x512573[_0x5beb('0x31')]=_[_0x5beb('0x32')](_0x512573[_0x5beb('0x2e')],_0x512573['query']);_0x1ff1bf[_0x5beb('0x33')]=_[_0x5beb('0x32')](_0x512573[_0x5beb('0x2e')],qs[_0x5beb('0x34')](_0x1f30e4['query']['fields']));_0x1ff1bf[_0x5beb('0x33')]=_0x1ff1bf[_0x5beb('0x33')][_0x5beb('0x35')]?_0x1ff1bf['attributes']:_0x512573[_0x5beb('0x2e')];_0x1ff1bf['order']=qs[_0x5beb('0x39')](_0x1f30e4[_0x5beb('0x30')][_0x5beb('0x39')]);_0x1ff1bf['where']=qs[_0x5beb('0x31')](_[_0x5beb('0x3b')](_0x1f30e4[_0x5beb('0x30')],_0x512573[_0x5beb('0x31')]));if(_0x1f30e4[_0x5beb('0x30')]['filter']){_0x1ff1bf[_0x5beb('0x3a')]=_[_0x5beb('0x3c')](_0x1ff1bf[_0x5beb('0x3a')],{'$or':_[_0x5beb('0x2f')](_0x1ff1bf[_0x5beb('0x33')],function(_0x51ac2f){var _0x350e9b={};_0x350e9b[_0x51ac2f]={'$like':'%'+_0x1f30e4['query'][_0x5beb('0x3e')]+'%'};return _0x350e9b;})});}_0x1ff1bf=_[_0x5beb('0x3c')]({},_0x1ff1bf,_0x1f30e4['options']);return _0x1cf542[_0x5beb('0x6e')](_0x1ff1bf);}})['then'](function(_0x41a4f8){if(_0x41a4f8){_0x4bf911=_0x41a4f8[_0x5beb('0x35')];if(!_0x1f30e4[_0x5beb('0x30')][_0x5beb('0x36')](_0x5beb('0x37'))){_0x1ff1bf[_0x5beb('0x1b')]=qs['limit'](_0x1f30e4['query'][_0x5beb('0x1b')]);_0x1ff1bf[_0x5beb('0x19')]=qs[_0x5beb('0x19')](_0x1f30e4['query'][_0x5beb('0x19')]);}return _0x1cf542['getSounds'](_0x1ff1bf);}})[_0x5beb('0x21')](function(_0x511d9b){if(_0x511d9b){return _0x511d9b?{'count':_0x4bf911,'rows':_0x511d9b}:null;}})[_0x5beb('0x21')](respondWithResult(_0x22e059,null))['catch'](handleError(_0x22e059,null));}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js index c899c75..be92d00 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 _0xa2e7=['api','moment','bluebird','request-promise','path','../../config/environment','./voiceMusicOnHold.attributes','exports','define','VoiceMusicOnHold','voice_musiconhold','lodash','util','../../config/logger'];(function(_0x1a9390,_0x3339e6){var _0x2b4514=function(_0x1c07d5){while(--_0x1c07d5){_0x1a9390['push'](_0x1a9390['shift']());}};_0x2b4514(++_0x3339e6);}(_0xa2e7,0x185));var _0x7a2e=function(_0x420f2c,_0x220e65){_0x420f2c=_0x420f2c-0x0;var _0x2f7b3a=_0xa2e7[_0x420f2c];return _0x2f7b3a;};'use strict';var _=require(_0x7a2e('0x0'));var util=require(_0x7a2e('0x1'));var logger=require(_0x7a2e('0x2'))(_0x7a2e('0x3'));var moment=require(_0x7a2e('0x4'));var BPromise=require(_0x7a2e('0x5'));var rp=require(_0x7a2e('0x6'));var fs=require('fs');var path=require(_0x7a2e('0x7'));var rimraf=require('rimraf');var config=require(_0x7a2e('0x8'));var attributes=require(_0x7a2e('0x9'));module[_0x7a2e('0xa')]=function(_0x4b942d,_0x253ae2){return _0x4b942d[_0x7a2e('0xb')](_0x7a2e('0xc'),attributes,{'tableName':_0x7a2e('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9a9c=['./voiceMusicOnHold.attributes','exports','define','VoiceMusicOnHold','voice_musiconhold','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf'];(function(_0x2ec962,_0x143c01){var _0x4a67e9=function(_0x29adf0){while(--_0x29adf0){_0x2ec962['push'](_0x2ec962['shift']());}};_0x4a67e9(++_0x143c01);}(_0x9a9c,0x94));var _0xc9a9=function(_0x8cdc3c,_0x10a3c8){_0x8cdc3c=_0x8cdc3c-0x0;var _0x401b4b=_0x9a9c[_0x8cdc3c];return _0x401b4b;};'use strict';var _=require(_0xc9a9('0x0'));var util=require(_0xc9a9('0x1'));var logger=require(_0xc9a9('0x2'))(_0xc9a9('0x3'));var moment=require(_0xc9a9('0x4'));var BPromise=require(_0xc9a9('0x5'));var rp=require(_0xc9a9('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc9a9('0x7'));var config=require('../../config/environment');var attributes=require(_0xc9a9('0x8'));module[_0xc9a9('0x9')]=function(_0x2f6896,_0x37e467){return _0x2f6896[_0xc9a9('0xa')](_0xc9a9('0xb'),attributes,{'tableName':_0xc9a9('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js index 926b621..85938d0 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(_0x4dcdcb,_0x48ed21){var _0x2f21ac=function(_0x60372d){while(--_0x60372d){_0x4dcdcb['push'](_0x4dcdcb['shift']());}};_0x2f21ac(++_0x48ed21);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x4b4f24,_0x5654a8){_0x4b4f24=_0x4b4f24-0x0;var _0x1c13d4=_0xcb91[_0x4b4f24];return _0x1c13d4;};'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 _0xedd9=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','code','VoiceMusicOnHold,\x20%s,\x20%s','message','catch','util'];(function(_0x32df03,_0xe1a285){var _0xd99c54=function(_0x191f39){while(--_0x191f39){_0x32df03['push'](_0x32df03['shift']());}};_0xd99c54(++_0xe1a285);}(_0xedd9,0xfc));var _0x9edd=function(_0x55768b,_0x3dbd37){_0x55768b=_0x55768b-0x0;var _0x32c5bf=_0xedd9[_0x55768b];return _0x32c5bf;};'use strict';var _=require('lodash');var util=require(_0x9edd('0x0'));var moment=require(_0x9edd('0x1'));var BPromise=require(_0x9edd('0x2'));var rs=require(_0x9edd('0x3'));var fs=require('fs');var Redis=require(_0x9edd('0x4'));var db=require(_0x9edd('0x5'))['db'];var utils=require(_0x9edd('0x6'));var logger=require(_0x9edd('0x7'))('rpc');var config=require(_0x9edd('0x8'));var jayson=require(_0x9edd('0x9'));var client=jayson[_0x9edd('0xa')][_0x9edd('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5319f7,_0xf0b2d8,_0x571af9){return new BPromise(function(_0x172522,_0x190185){return client[_0x9edd('0xc')](_0x5319f7,_0x571af9)[_0x9edd('0xd')](function(_0x49d5e3){logger[_0x9edd('0xe')]('VoiceMusicOnHold,\x20%s,\x20%s',_0xf0b2d8,_0x9edd('0xf'));logger[_0x9edd('0x10')]('VoiceMusicOnHold,\x20%s,\x20%s,\x20%s',_0xf0b2d8,_0x9edd('0xf'),JSON[_0x9edd('0x11')](_0x49d5e3));if(_0x49d5e3['error']){if(_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x13')]===0x1f4){logger[_0x9edd('0x12')](_0x9edd('0x14'),_0xf0b2d8,_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x15')]);return _0x190185(_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x15')]);}logger['error'](_0x9edd('0x14'),_0xf0b2d8,_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x15')]);return _0x172522(_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x15')]);}else{logger[_0x9edd('0xe')](_0x9edd('0x14'),_0xf0b2d8,_0x9edd('0xf'));_0x172522(_0x49d5e3['result'][_0x9edd('0x15')]);}})[_0x9edd('0x16')](function(_0x449cee){logger['error'](_0x9edd('0x14'),_0xf0b2d8,_0x449cee);_0x190185(_0x449cee);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/index.js b/server/api/voicePrefix/index.js index 1d4225c..f804a80 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 _0xc9df=['/:id/teams','getTeams','post','create','addTeams','put','delete','removeTeams','exports','util','path','connect-timeout','get','isAuthenticated','index','/describe','/:id','show','/:id/users','getAgents'];(function(_0x4ff09b,_0x53f67d){var _0x3f5c2e=function(_0x124592){while(--_0x124592){_0x4ff09b['push'](_0x4ff09b['shift']());}};_0x3f5c2e(++_0x53f67d);}(_0xc9df,0x121));var _0xfc9d=function(_0x3e2077,_0x4b47d8){_0x3e2077=_0x3e2077-0x0;var _0x384fa4=_0xc9df[_0x3e2077];return _0x384fa4;};'use strict';var multer=require('multer');var util=require(_0xfc9d('0x0'));var path=require(_0xfc9d('0x1'));var timeout=require(_0xfc9d('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./voicePrefix.controller');router[_0xfc9d('0x3')]('/',auth[_0xfc9d('0x4')](),controller[_0xfc9d('0x5')]);router[_0xfc9d('0x3')](_0xfc9d('0x6'),auth[_0xfc9d('0x4')](),controller['describe']);router[_0xfc9d('0x3')](_0xfc9d('0x7'),auth[_0xfc9d('0x4')](),controller[_0xfc9d('0x8')]);router[_0xfc9d('0x3')](_0xfc9d('0x9'),auth[_0xfc9d('0x4')](),controller[_0xfc9d('0xa')]);router[_0xfc9d('0x3')](_0xfc9d('0xb'),auth[_0xfc9d('0x4')](),controller[_0xfc9d('0xc')]);router[_0xfc9d('0xd')]('/',auth[_0xfc9d('0x4')](),controller[_0xfc9d('0xe')]);router[_0xfc9d('0xd')]('/:id/users',auth[_0xfc9d('0x4')](),controller['addAgents']);router[_0xfc9d('0xd')]('/:id/teams',auth[_0xfc9d('0x4')](),controller[_0xfc9d('0xf')]);router[_0xfc9d('0x10')](_0xfc9d('0x7'),auth[_0xfc9d('0x4')](),controller['update']);router[_0xfc9d('0x11')]('/:id',auth[_0xfc9d('0x4')](),controller['destroy']);router[_0xfc9d('0x11')](_0xfc9d('0x9'),auth[_0xfc9d('0x4')](),controller['removeAgents']);router['delete'](_0xfc9d('0xb'),auth[_0xfc9d('0x4')](),controller[_0xfc9d('0x12')]);module[_0xfc9d('0x13')]=router; \ No newline at end of file +var _0xe91f=['connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./voicePrefix.controller','get','/describe','isAuthenticated','show','getTeams','create','post','addAgents','/:id/teams','put','/:id','destroy','delete','/:id/users','removeAgents','removeTeams','exports','multer','util'];(function(_0x12c9ce,_0xf36fda){var _0x66992=function(_0x6865be){while(--_0x6865be){_0x12c9ce['push'](_0x12c9ce['shift']());}};_0x66992(++_0xf36fda);}(_0xe91f,0xf8));var _0xfe91=function(_0x30b39d,_0x35559d){_0x30b39d=_0x30b39d-0x0;var _0x2af004=_0xe91f[_0x30b39d];return _0x2af004;};'use strict';var multer=require(_0xfe91('0x0'));var util=require(_0xfe91('0x1'));var path=require('path');var timeout=require(_0xfe91('0x2'));var express=require('express');var router=express[_0xfe91('0x3')]();var fs_extra=require(_0xfe91('0x4'));var auth=require(_0xfe91('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xfe91('0x6'));var controller=require(_0xfe91('0x7'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0xfe91('0x8')](_0xfe91('0x9'),auth[_0xfe91('0xa')](),controller['describe']);router[_0xfe91('0x8')]('/:id',auth['isAuthenticated'](),controller[_0xfe91('0xb')]);router[_0xfe91('0x8')]('/:id/users',auth['isAuthenticated'](),controller['getAgents']);router['get']('/:id/teams',auth[_0xfe91('0xa')](),controller[_0xfe91('0xc')]);router['post']('/',auth[_0xfe91('0xa')](),controller[_0xfe91('0xd')]);router[_0xfe91('0xe')]('/:id/users',auth[_0xfe91('0xa')](),controller[_0xfe91('0xf')]);router[_0xfe91('0xe')](_0xfe91('0x10'),auth[_0xfe91('0xa')](),controller['addTeams']);router[_0xfe91('0x11')](_0xfe91('0x12'),auth[_0xfe91('0xa')](),controller['update']);router['delete'](_0xfe91('0x12'),auth['isAuthenticated'](),controller[_0xfe91('0x13')]);router[_0xfe91('0x14')](_0xfe91('0x15'),auth[_0xfe91('0xa')](),controller[_0xfe91('0x16')]);router[_0xfe91('0x14')]('/:id/teams',auth[_0xfe91('0xa')](),controller[_0xfe91('0x17')]);module[_0xfe91('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 ac00471..33f6191 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 _0x46bb=['INTEGER','STRING','system-','name'];(function(_0x357113,_0x20e63a){var _0x5ef3c7=function(_0x5abca6){while(--_0x5abca6){_0x357113['push'](_0x357113['shift']());}};_0x5ef3c7(++_0x20e63a);}(_0x46bb,0x17d));var _0xb46b=function(_0x3ff417,_0x1217d8){_0x3ff417=_0x3ff417-0x0;var _0x208cee=_0x46bb[_0x3ff417];return _0x208cee;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xb46b('0x0')],'allowNull':![],'unique':'name'},'prefix':{'type':Sequelize['VIRTUAL'],'get':function(_0xb1276e){return _0xb46b('0x1')+this['getDataValue'](_0xb46b('0x2'))+'-';}},'description':{'type':Sequelize[_0xb46b('0x0')]},'callerIdAll':{'type':Sequelize['STRING']},'VoiceExtensionId':{'type':Sequelize[_0xb46b('0x3')]}}; \ No newline at end of file +var _0x421c=['system-','getDataValue','INTEGER','sequelize','exports','STRING','name'];(function(_0x19defe,_0x4d8ccc){var _0x5c79e4=function(_0x299e58){while(--_0x299e58){_0x19defe['push'](_0x19defe['shift']());}};_0x5c79e4(++_0x4d8ccc);}(_0x421c,0x17d));var _0xc421=function(_0x4f6163,_0x12f181){_0x4f6163=_0x4f6163-0x0;var _0x5e9b85=_0x421c[_0x4f6163];return _0x5e9b85;};'use strict';var Sequelize=require(_0xc421('0x0'));module[_0xc421('0x1')]={'name':{'type':Sequelize[_0xc421('0x2')],'allowNull':![],'unique':_0xc421('0x3')},'prefix':{'type':Sequelize['VIRTUAL'],'get':function(_0x4f90de){return _0xc421('0x4')+this[_0xc421('0x5')]('name')+'-';}},'description':{'type':Sequelize[_0xc421('0x2')]},'callerIdAll':{'type':Sequelize['STRING']},'VoiceExtensionId':{'type':Sequelize[_0xc421('0x6')]}}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.controller.js b/server/api/voicePrefix/voicePrefix.controller.js index 61e2392..514a742 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 _0x1399=['Extensions\x20creation\x20failed','push','Set','callerIdAll','PREFIX-CALLERIDALL=','No\x20callerid\x20available','goto','charAt','system-','findById','addAgents','ids','omit','spread','emit','userVoicePrefix:save','removeAgents','userVoicePrefix:remove','getAgents','findOne','User','Team','getTeams','addTeams','online','voicePause','interface','flatMap','Agents','sequelize','each','upsert','UserVoicePrefix','findOrCreate','forEach','removeTeams','select','field','tq.TeamId','from','team_has_voice_prefixes','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoicePrefixId\x20=\x20?','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','every','includes','all','compact','value','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','socket.io-emitter','./voicePrefix.socket','register','end','status','json','limit','undefined','count','offset','set','Content-Range','apply','reject','save','update','destroy','then','get','VoicePrefixes','name','send','index','map','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','VoicePrefix','findAll','catch','show','params','includeAll','find','describe','transaction','create','body','VoiceExtension','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','UserProfileResource','error','context','from-sip','exten','app','system','description','Voice\x20Prefix\x20Extension','appdata','prefix','NoOp','Voice\x20Prefix','VoicePrefixId','VoiceExtensionId','bulkCreate'];(function(_0x545387,_0xf1946){var _0x229ada=function(_0x52fde4){while(--_0x52fde4){_0x545387['push'](_0x545387['shift']());}};_0x229ada(++_0xf1946);}(_0x1399,0x16c));var _0x9139=function(_0x45fb8f,_0x46da98){_0x45fb8f=_0x45fb8f-0x0;var _0x3d906b=_0x1399[_0x45fb8f];return _0x3d906b;};'use strict';var emlformat=require(_0x9139('0x0'));var rimraf=require(_0x9139('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9139('0x2'));var rp=require('request-promise');var moment=require(_0x9139('0x3'));var BPromise=require(_0x9139('0x4'));var Mustache=require(_0x9139('0x5'));var util=require(_0x9139('0x6'));var path=require(_0x9139('0x7'));var sox=require(_0x9139('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9139('0x9'));var _=require(_0x9139('0xa'));var squel=require(_0x9139('0xb'));var crypto=require('crypto');var jsforce=require(_0x9139('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x9139('0xd'));var Papa=require(_0x9139('0xe'));var Redis=require('ioredis');var authService=require(_0x9139('0xf'));var qs=require(_0x9139('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x9139('0x11'))(_0x9139('0x12'));var utils=require(_0x9139('0x13'));var config=require(_0x9139('0x14'));var licenseUtil=require(_0x9139('0x15'));var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config[_0x9139('0x16')],{'host':'localhost','port':0x18eb});var socket=require(_0x9139('0x17'))(new Redis(config[_0x9139('0x16')]));require(_0x9139('0x18'))[_0x9139('0x19')](socket);function respondWithStatusCode(_0x5936d2,_0x3b1f21){_0x3b1f21=_0x3b1f21||0xcc;return function(_0x4d1a85){if(_0x4d1a85){return _0x5936d2['sendStatus'](_0x3b1f21);}return _0x5936d2['status'](_0x3b1f21)[_0x9139('0x1a')]();};}function respondWithResult(_0x3e2bad,_0x1cd24e){_0x1cd24e=_0x1cd24e||0xc8;return function(_0x3fadf7){if(_0x3fadf7){return _0x3e2bad[_0x9139('0x1b')](_0x1cd24e)[_0x9139('0x1c')](_0x3fadf7);}};}function respondWithFilteredResult(_0x4bd957,_0x57b9df){return function(_0x13cab8){if(_0x13cab8){var _0xe39cbc=typeof _0x57b9df['offset']==='undefined'&&typeof _0x57b9df[_0x9139('0x1d')]===_0x9139('0x1e');var _0x56add4=_0x13cab8[_0x9139('0x1f')];var _0x1ef57b=_0xe39cbc?0x0:_0x57b9df[_0x9139('0x20')];var _0x3c8296=_0xe39cbc?_0x13cab8[_0x9139('0x1f')]:_0x57b9df[_0x9139('0x20')]+_0x57b9df[_0x9139('0x1d')];var _0x45fa16;if(_0x3c8296>=_0x56add4){_0x3c8296=_0x56add4;_0x45fa16=0xc8;}else{_0x45fa16=0xce;}_0x4bd957[_0x9139('0x1b')](_0x45fa16);return _0x4bd957[_0x9139('0x21')](_0x9139('0x22'),_0x1ef57b+'-'+_0x3c8296+'/'+_0x56add4)[_0x9139('0x1c')](_0x13cab8);}return null;};}function patchUpdates(_0x5a3e2e){return function(_0x105170){try{jsonpatch[_0x9139('0x23')](_0x105170,_0x5a3e2e,!![]);}catch(_0x31635a){return BPromise[_0x9139('0x24')](_0x31635a);}return _0x105170[_0x9139('0x25')]();};}function saveUpdates(_0x1a7350,_0x4b7fe0){return function(_0x28bf7d){if(_0x28bf7d){return _0x28bf7d[_0x9139('0x26')](_0x1a7350)['then'](function(_0x3ed4da){return _0x3ed4da;});}return null;};}function removeEntity(_0x2ee4bb,_0x10bfa0){return function(_0x4a3ed2){if(_0x4a3ed2){return _0x4a3ed2[_0x9139('0x27')]()[_0x9139('0x28')](function(){var _0x49d01e=_0x4a3ed2[_0x9139('0x29')]({'plain':!![]});var _0x39e8cf=_0x9139('0x2a');return db['UserProfileResource'][_0x9139('0x27')]({'where':{'type':_0x39e8cf,'resourceId':_0x49d01e['id']}})[_0x9139('0x28')](function(){return _0x4a3ed2;});})[_0x9139('0x28')](function(){_0x2ee4bb[_0x9139('0x1b')](0xcc)[_0x9139('0x1a')]();});}};}function handleEntityNotFound(_0x16dfb4,_0xfe6854){return function(_0x573a05){if(!_0x573a05){_0x16dfb4['sendStatus'](0x194);}return _0x573a05;};}function handleError(_0x1b3fd9,_0x22d0f8){_0x22d0f8=_0x22d0f8||0x1f4;return function(_0xd27355){logger['error'](_0xd27355['stack']);if(_0xd27355[_0x9139('0x2b')]){delete _0xd27355[_0x9139('0x2b')];}_0x1b3fd9[_0x9139('0x1b')](_0x22d0f8)[_0x9139('0x2c')](_0xd27355);};}exports[_0x9139('0x2d')]=function(_0x541644,_0x5a1673){var _0x2f26de={},_0x57a6fb={},_0x4de1a2={'count':0x0,'rows':[]};var _0x222429=_[_0x9139('0x2e')](db['VoicePrefix'][_0x9139('0x2f')],function(_0xe658c2){return{'name':_0xe658c2['fieldName'],'type':_0xe658c2[_0x9139('0x30')][_0x9139('0x31')]};});_0x57a6fb[_0x9139('0x32')]=_[_0x9139('0x2e')](_0x222429,_0x9139('0x2b'));_0x57a6fb[_0x9139('0x33')]=_[_0x9139('0x34')](_0x541644[_0x9139('0x33')]);_0x57a6fb[_0x9139('0x35')]=_[_0x9139('0x36')](_0x57a6fb[_0x9139('0x32')],_0x57a6fb['query']);_0x2f26de[_0x9139('0x37')]=_[_0x9139('0x36')](_0x57a6fb['model'],qs[_0x9139('0x38')](_0x541644[_0x9139('0x33')][_0x9139('0x38')]));_0x2f26de['attributes']=_0x2f26de[_0x9139('0x37')][_0x9139('0x39')]?_0x2f26de[_0x9139('0x37')]:_0x57a6fb[_0x9139('0x32')];if(!_0x541644[_0x9139('0x33')][_0x9139('0x3a')](_0x9139('0x3b'))){_0x2f26de[_0x9139('0x1d')]=qs[_0x9139('0x1d')](_0x541644[_0x9139('0x33')]['limit']);_0x2f26de[_0x9139('0x20')]=qs[_0x9139('0x20')](_0x541644[_0x9139('0x33')][_0x9139('0x20')]);}_0x2f26de[_0x9139('0x3c')]=qs[_0x9139('0x3d')](_0x541644[_0x9139('0x33')]['sort']);_0x2f26de[_0x9139('0x3e')]=qs['filters'](_[_0x9139('0x3f')](_0x541644[_0x9139('0x33')],_0x57a6fb[_0x9139('0x35')]),_0x222429);if(_0x541644['query'][_0x9139('0x40')]){_0x2f26de[_0x9139('0x3e')]=_[_0x9139('0x41')](_0x2f26de[_0x9139('0x3e')],{'$or':_[_0x9139('0x2e')](_0x222429,function(_0xe90991){if(_0xe90991[_0x9139('0x30')]!==_0x9139('0x42')){var _0x118d53={};_0x118d53[_0xe90991[_0x9139('0x2b')]]={'$like':'%'+_0x541644['query'][_0x9139('0x40')]+'%'};return _0x118d53;}})});}_0x2f26de=_[_0x9139('0x41')]({},_0x2f26de,_0x541644[_0x9139('0x43')]);var _0x4b8dd7={'where':_0x2f26de['where']};return db['VoicePrefix'][_0x9139('0x1f')](_0x4b8dd7)[_0x9139('0x28')](function(_0x3611b4){_0x4de1a2[_0x9139('0x1f')]=_0x3611b4;if(_0x541644[_0x9139('0x33')]['includeAll']){_0x2f26de[_0x9139('0x44')]=[{'all':!![]}];}return db[_0x9139('0x45')][_0x9139('0x46')](_0x2f26de);})[_0x9139('0x28')](function(_0x2197ff){_0x4de1a2['rows']=_0x2197ff;return _0x4de1a2;})[_0x9139('0x28')](respondWithFilteredResult(_0x5a1673,_0x2f26de))[_0x9139('0x47')](handleError(_0x5a1673,null));};exports[_0x9139('0x48')]=function(_0x197891,_0x539a55){var _0x5b0aec={'raw':![],'where':{'id':_0x197891[_0x9139('0x49')]['id']}},_0x39d3dc={};_0x39d3dc['model']=_['keys'](db[_0x9139('0x45')][_0x9139('0x2f')]);_0x39d3dc['query']=_[_0x9139('0x34')](_0x197891[_0x9139('0x33')]);_0x39d3dc['filters']=_[_0x9139('0x36')](_0x39d3dc['model'],_0x39d3dc['query']);_0x5b0aec[_0x9139('0x37')]=_[_0x9139('0x36')](_0x39d3dc[_0x9139('0x32')],qs[_0x9139('0x38')](_0x197891[_0x9139('0x33')]['fields']));_0x5b0aec[_0x9139('0x37')]=_0x5b0aec[_0x9139('0x37')][_0x9139('0x39')]?_0x5b0aec['attributes']:_0x39d3dc[_0x9139('0x32')];if(_0x197891[_0x9139('0x33')][_0x9139('0x4a')]){_0x5b0aec[_0x9139('0x44')]=[{'all':!![]}];}_0x5b0aec=_[_0x9139('0x41')]({},_0x5b0aec,_0x197891[_0x9139('0x43')]);return db[_0x9139('0x45')][_0x9139('0x4b')](_0x5b0aec)[_0x9139('0x28')](handleEntityNotFound(_0x539a55,null))[_0x9139('0x28')](respondWithResult(_0x539a55,null))[_0x9139('0x47')](handleError(_0x539a55,null));};exports['destroy']=function(_0x10eb03,_0x2e1bbe){return db[_0x9139('0x45')]['find']({'where':{'id':_0x10eb03[_0x9139('0x49')]['id']}})[_0x9139('0x28')](handleEntityNotFound(_0x2e1bbe,null))['then'](removeEntity(_0x2e1bbe,null))[_0x9139('0x47')](handleError(_0x2e1bbe,null));};exports[_0x9139('0x4c')]=function(_0x83f1d2,_0x5180b5){return db[_0x9139('0x45')][_0x9139('0x4c')]()[_0x9139('0x28')](respondWithResult(_0x5180b5,null))[_0x9139('0x47')](handleError(_0x5180b5,null));};exports['create']=function(_0x2b6948,_0x1a2a2d){var _0x3ba071;return db['sequelize'][_0x9139('0x4d')](function(_0x146201){return db[_0x9139('0x45')][_0x9139('0x4e')](_0x2b6948[_0x9139('0x4f')],{'transaction':_0x146201})[_0x9139('0x28')](function(_0x2b22fa){_0x3ba071=_0x2b22fa['get']({'plain':!![]});return db[_0x9139('0x50')][_0x9139('0x4b')]({'where':{'id':_0x3ba071['VoiceExtensionId']},'raw':!![]})[_0x9139('0x28')](function(_0x1e1290){return createVoicePrefixExtensions(_0x3ba071,_0x1e1290,_0x146201);});});})[_0x9139('0x28')](function(){var _0x1a0841=_0x2b6948[_0x9139('0x51')]['get']({'plain':!![]});if(!_0x1a0841)throw new Error(_0x9139('0x52'));if(_0x1a0841[_0x9139('0x53')]==='user'){var _0x500863=_0x3ba071;return db[_0x9139('0x54')][_0x9139('0x4b')]({'where':{'name':_0x9139('0x2a'),'userProfileId':_0x1a0841['userProfileId']},'raw':!![]})[_0x9139('0x28')](function(_0x576b5a){if(_0x576b5a&&_0x576b5a['autoAssociation']===0x0){return db[_0x9139('0x55')][_0x9139('0x4e')]({'name':_0x500863[_0x9139('0x2b')],'resourceId':_0x500863['id'],'type':_0x576b5a[_0x9139('0x2b')],'sectionId':_0x576b5a['id']},{})['then'](function(){return _0x3ba071;});}else{return _0x3ba071;}})[_0x9139('0x47')](function(_0x91a5a8){logger[_0x9139('0x56')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x91a5a8);throw _0x91a5a8;});}return _0x3ba071;})[_0x9139('0x28')](respondWithResult(_0x1a2a2d,null))[_0x9139('0x47')](handleError(_0x1a2a2d,null));};function Extension(_0x25cf0f,_0x73d4fc,_0x163730,_0x3f7e41){this[_0x9139('0x57')]=_0x9139('0x58');this[_0x9139('0x59')]=_0x25cf0f;this[_0x9139('0x5a')]=_0x163730;this[_0x9139('0x30')]=_0x9139('0x5b');this[_0x9139('0x5c')]=_0x9139('0x5d');this['priority']=_0x73d4fc;this[_0x9139('0x5e')]=_0x3f7e41;}function createVoicePrefixExtensions(_0x32b31b,_0x3ef34c,_0x37433c){return new BPromise(function(_0x40afea,_0x53c09a){var _0x3feaac=new Extension(formatPrefixName(_0x32b31b[_0x9139('0x5f')]),0x1,_0x9139('0x60'),_0x9139('0x61'));_0x3feaac[_0x9139('0x62')]=_0x32b31b['id'];return db['VoiceExtension']['create'](_0x3feaac,{'transaction':_0x37433c})[_0x9139('0x28')](function(_0x3a0bc6){var _0x4b0274=_0x3a0bc6[_0x9139('0x29')]({'plain':!![]});var _0xd20c65=_[_0x9139('0x2e')](addVoicePrefixExtensions(_0x32b31b,_0x3ef34c),function(_0x4c125e){_0x4c125e[_0x9139('0x63')]=_0x4b0274['id'];_0x4c125e[_0x9139('0x62')]=_0x32b31b['id'];return _0x4c125e;});return db[_0x9139('0x50')][_0x9139('0x64')](_0xd20c65,{'transaction':_0x37433c})[_0x9139('0x28')](function(_0x53a27f){if(!_0x53a27f){return _0x53c09a(_0x9139('0x65'));}else{return _0x40afea(_0x53a27f);}})[_0x9139('0x47')](function(_0x336230){return _0x53c09a(_0x336230);});});;});};function addVoicePrefixExtensions(_0x26fe55,_0x4f6e7c){var _0x53152f=[];var _0x46b5cb=formatPrefixName(_0x26fe55[_0x9139('0x5f')]);_0x53152f[_0x9139('0x66')](new Extension(_0x46b5cb,0x2,_0x9139('0x67'),'CDR(prefix)='+_0x26fe55[_0x9139('0x2b')]));if(_0x26fe55[_0x9139('0x68')]){_0x53152f['push'](new Extension(_0x46b5cb,0x3,_0x9139('0x67'),_0x9139('0x69')+_0x26fe55[_0x9139('0x68')]));}else{_0x53152f[_0x9139('0x66')](new Extension(_0x46b5cb,0x3,_0x9139('0x60'),_0x9139('0x6a')));}_0x53152f[_0x9139('0x66')](new Extension(_0x46b5cb,0x4,_0x9139('0x6b'),_0x4f6e7c['context']+','+'${EXTEN:'+(0x8+_0x26fe55['name'][_0x9139('0x39')])+'}'+','+0x1));return _0x53152f;}function formatPrefixName(_0x1025d6){var _0x2235fb='_';for(var _0x4eefd8=0x0;_0x4eefd8<_0x1025d6[_0x9139('0x39')];_0x4eefd8++){if(_0x1025d6[_0x9139('0x6c')](_0x4eefd8)=='-'){_0x2235fb+=_0x1025d6[_0x9139('0x6c')](_0x4eefd8);}else{_0x2235fb+='['+_0x1025d6[_0x9139('0x6c')](_0x4eefd8)+']';}}_0x2235fb+='.';return _0x2235fb;}exports[_0x9139('0x26')]=function(_0x3aacdb,_0x5d9ae8,_0x437d18){var _0x582b67=_0x3aacdb[_0x9139('0x4f')];_0x582b67['prefix']=_0x9139('0x6d')+_0x582b67[_0x9139('0x2b')]+'-';return db['sequelize']['transaction'](function(_0x4324ed){return db[_0x9139('0x45')][_0x9139('0x26')](_0x582b67,{'where':{'id':_0x582b67['id']},'transaction':_0x4324ed})['then'](function(){return db[_0x9139('0x50')][_0x9139('0x27')]({'where':{'VoicePrefixId':_0x582b67['id']},'transaction':_0x4324ed})[_0x9139('0x28')](function(){return db[_0x9139('0x50')]['find']({'where':{'id':_0x582b67['VoiceExtensionId']},'raw':!![]})[_0x9139('0x28')](function(_0x2462fc){return createVoicePrefixExtensions(_0x582b67,_0x2462fc,_0x4324ed);});});});})['then'](function(){return db[_0x9139('0x45')][_0x9139('0x6e')](_0x582b67['id']);})[_0x9139('0x28')](respondWithResult(_0x5d9ae8,null))[_0x9139('0x47')](handleError(_0x5d9ae8,null));};exports[_0x9139('0x6f')]=function(_0x400ac9,_0x3c17fd,_0x3167bb){return db[_0x9139('0x45')][_0x9139('0x4b')]({'where':{'id':_0x400ac9[_0x9139('0x49')]['id']}})[_0x9139('0x28')](handleEntityNotFound(_0x3c17fd,null))[_0x9139('0x28')](function(_0x582a47){if(_0x582a47){return _0x582a47[_0x9139('0x6f')](_0x400ac9[_0x9139('0x4f')][_0x9139('0x70')],_[_0x9139('0x71')](_0x400ac9[_0x9139('0x4f')],['ids','id'])||{})[_0x9139('0x72')](function(_0x54cd2a){for(var _0x14868a=0x0;_0x14868a<_0x400ac9[_0x9139('0x4f')][_0x9139('0x70')]['length'];_0x14868a+=0x1){socket[_0x9139('0x73')](_0x9139('0x74'),{'UserId':Number(_0x400ac9['body'][_0x9139('0x70')][_0x14868a]),'VoicePrefixId':Number(_0x400ac9[_0x9139('0x49')]['id'])});}return _0x54cd2a;});}})[_0x9139('0x28')](respondWithResult(_0x3c17fd,null))[_0x9139('0x47')](handleError(_0x3c17fd,null));};exports[_0x9139('0x75')]=function(_0x451458,_0x1abb10,_0x24b8d8){return db[_0x9139('0x45')]['find']({'where':{'id':_0x451458[_0x9139('0x49')]['id']}})[_0x9139('0x28')](handleEntityNotFound(_0x1abb10,null))[_0x9139('0x28')](function(_0x3c3474){if(_0x3c3474){return _0x3c3474[_0x9139('0x75')](_0x451458['query'][_0x9139('0x70')])[_0x9139('0x28')](function(){if(_['isArray'](_0x451458['query'][_0x9139('0x70')])){for(var _0x377234=0x0;_0x377234<_0x451458[_0x9139('0x33')][_0x9139('0x70')]['length'];_0x377234+=0x1){socket[_0x9139('0x73')](_0x9139('0x76'),{'UserId':Number(_0x451458[_0x9139('0x33')][_0x9139('0x70')][_0x377234]),'VoicePrefixId':Number(_0x451458[_0x9139('0x49')]['id'])});}}else{socket[_0x9139('0x73')](_0x9139('0x76'),{'UserId':Number(_0x451458[_0x9139('0x33')][_0x9139('0x70')]),'VoicePrefixId':Number(_0x451458[_0x9139('0x49')]['id'])});}});}})[_0x9139('0x28')](respondWithStatusCode(_0x1abb10,null))[_0x9139('0x47')](handleError(_0x1abb10,null));};exports[_0x9139('0x77')]=function(_0x100c61,_0x1bcf40,_0x402a07){var _0x4152b2={};var _0x43a3d4={};var _0x2d9821;var _0x55ac7a;return db[_0x9139('0x45')][_0x9139('0x78')]({'where':{'id':_0x100c61[_0x9139('0x49')]['id']}})[_0x9139('0x28')](handleEntityNotFound(_0x1bcf40,null))[_0x9139('0x28')](function(_0x4c633e){if(_0x4c633e){_0x2d9821=_0x4c633e;_0x43a3d4[_0x9139('0x32')]=_[_0x9139('0x34')](db[_0x9139('0x79')][_0x9139('0x2f')]);_0x43a3d4[_0x9139('0x33')]=_[_0x9139('0x34')](_0x100c61[_0x9139('0x33')]);_0x43a3d4['filters']=_['intersection'](_0x43a3d4[_0x9139('0x32')],_0x43a3d4[_0x9139('0x33')]);_0x4152b2[_0x9139('0x37')]=_[_0x9139('0x36')](_0x43a3d4['model'],qs['fields'](_0x100c61[_0x9139('0x33')][_0x9139('0x38')]));_0x4152b2[_0x9139('0x37')]=_0x4152b2[_0x9139('0x37')][_0x9139('0x39')]?_0x4152b2[_0x9139('0x37')]:_0x43a3d4[_0x9139('0x32')];_0x4152b2[_0x9139('0x3c')]=qs[_0x9139('0x3d')](_0x100c61['query'][_0x9139('0x3d')]);_0x4152b2['where']=qs[_0x9139('0x35')](_[_0x9139('0x3f')](_0x100c61[_0x9139('0x33')],_0x43a3d4[_0x9139('0x35')]));if(_0x100c61['query']['filter']){_0x4152b2[_0x9139('0x3e')]=_[_0x9139('0x41')](_0x4152b2[_0x9139('0x3e')],{'$or':_[_0x9139('0x2e')](_0x4152b2[_0x9139('0x37')],function(_0x49bdc7){var _0x47e8bf={};_0x47e8bf[_0x49bdc7]={'$like':'%'+_0x100c61[_0x9139('0x33')]['filter']+'%'};return _0x47e8bf;})});}_0x4152b2=_[_0x9139('0x41')]({},_0x4152b2,_0x100c61[_0x9139('0x43')]);return _0x2d9821[_0x9139('0x77')](_0x4152b2);}})['then'](function(_0x22ce9c){if(_0x22ce9c){_0x55ac7a=_0x22ce9c[_0x9139('0x39')];if(!_0x100c61[_0x9139('0x33')][_0x9139('0x3a')](_0x9139('0x3b'))){_0x4152b2[_0x9139('0x1d')]=qs['limit'](_0x100c61[_0x9139('0x33')][_0x9139('0x1d')]);_0x4152b2[_0x9139('0x20')]=qs[_0x9139('0x20')](_0x100c61['query']['offset']);}return _0x2d9821[_0x9139('0x77')](_0x4152b2);}})[_0x9139('0x28')](function(_0x4fe06f){if(_0x4fe06f){return _0x4fe06f?{'count':_0x55ac7a,'rows':_0x4fe06f}:null;}})['then'](respondWithResult(_0x1bcf40,null))[_0x9139('0x47')](handleError(_0x1bcf40,null));};exports['getTeams']=function(_0x43514f,_0x550504,_0x580185){var _0x21c1e0={};var _0x2ed30b={};var _0x7eeefb;var _0x22349d;return db[_0x9139('0x45')]['findOne']({'where':{'id':_0x43514f['params']['id']}})[_0x9139('0x28')](handleEntityNotFound(_0x550504,null))[_0x9139('0x28')](function(_0x459e1e){if(_0x459e1e){_0x7eeefb=_0x459e1e;_0x2ed30b[_0x9139('0x32')]=_['keys'](db[_0x9139('0x7a')]['rawAttributes']);_0x2ed30b[_0x9139('0x33')]=_[_0x9139('0x34')](_0x43514f[_0x9139('0x33')]);_0x2ed30b['filters']=_[_0x9139('0x36')](_0x2ed30b['model'],_0x2ed30b['query']);_0x21c1e0[_0x9139('0x37')]=_[_0x9139('0x36')](_0x2ed30b[_0x9139('0x32')],qs['fields'](_0x43514f[_0x9139('0x33')]['fields']));_0x21c1e0[_0x9139('0x37')]=_0x21c1e0[_0x9139('0x37')][_0x9139('0x39')]?_0x21c1e0[_0x9139('0x37')]:_0x2ed30b[_0x9139('0x32')];_0x21c1e0[_0x9139('0x3c')]=qs['sort'](_0x43514f['query'][_0x9139('0x3d')]);_0x21c1e0[_0x9139('0x3e')]=qs[_0x9139('0x35')](_[_0x9139('0x3f')](_0x43514f[_0x9139('0x33')],_0x2ed30b['filters']));if(_0x43514f['query'][_0x9139('0x40')]){_0x21c1e0[_0x9139('0x3e')]=_[_0x9139('0x41')](_0x21c1e0[_0x9139('0x3e')],{'$or':_[_0x9139('0x2e')](_0x21c1e0[_0x9139('0x37')],function(_0x5614df){var _0x55e8d7={};_0x55e8d7[_0x5614df]={'$like':'%'+_0x43514f[_0x9139('0x33')][_0x9139('0x40')]+'%'};return _0x55e8d7;})});}_0x21c1e0=_[_0x9139('0x41')]({},_0x21c1e0,_0x43514f['options']);return _0x7eeefb['getTeams'](_0x21c1e0);}})[_0x9139('0x28')](function(_0x4f8488){if(_0x4f8488){_0x22349d=_0x4f8488[_0x9139('0x39')];if(!_0x43514f['query'][_0x9139('0x3a')](_0x9139('0x3b'))){_0x21c1e0['limit']=qs[_0x9139('0x1d')](_0x43514f['query']['limit']);_0x21c1e0[_0x9139('0x20')]=qs[_0x9139('0x20')](_0x43514f[_0x9139('0x33')][_0x9139('0x20')]);}return _0x7eeefb[_0x9139('0x7b')](_0x21c1e0);}})[_0x9139('0x28')](function(_0x4cce2c){if(_0x4cce2c){return _0x4cce2c?{'count':_0x22349d,'rows':_0x4cce2c}:null;}})[_0x9139('0x28')](respondWithResult(_0x550504,null))[_0x9139('0x47')](handleError(_0x550504,null));};exports[_0x9139('0x7c')]=function(_0x387d19,_0x5511ac,_0x2c3437){var _0x24e241=_0x387d19[_0x9139('0x4f')][_0x9139('0x70')];var _0x10c463;return db[_0x9139('0x7a')][_0x9139('0x46')]({'where':{'id':_0x24e241},'attributes':['id'],'include':[{'model':db[_0x9139('0x79')],'as':'Agents','attributes':['id',_0x9139('0x2b'),_0x9139('0x7d'),_0x9139('0x7e'),_0x9139('0x7f')],'raw':!![]}]})[_0x9139('0x28')](function(_0xdbd388){if(_0xdbd388){_0x10c463=_0xdbd388;var _0x6a479a=_[_0x9139('0x80')](_0xdbd388,function(_0x4ab1ed){var _0x4ac0a5=_0x4ab1ed[_0x9139('0x29')]({'plain':!![]});return _0x4ac0a5[_0x9139('0x81')];});return db[_0x9139('0x45')][_0x9139('0x4b')]({'where':{'id':_0x387d19[_0x9139('0x49')]['id']}})[_0x9139('0x28')](function(_0x338cf4){return db[_0x9139('0x82')][_0x9139('0x4d')](function(_0x4ac429){return _0x338cf4[_0x9139('0x7c')](_0x24e241,{'transaction':_0x4ac429})[_0x9139('0x28')](function(){return BPromise[_0x9139('0x83')](_0x10c463,function(_0xee935b){return db['TeamVoicePrefix'][_0x9139('0x84')]({'TeamId':_0xee935b['id'],'VoicePrefixId':_0x387d19['params']['id']},{'transaction':_0x4ac429});});})[_0x9139('0x28')](function(){return BPromise[_0x9139('0x83')](_0x6a479a,function(_0x8ee6f3){return db[_0x9139('0x85')][_0x9139('0x86')]({'where':{'UserId':_0x8ee6f3['id'],'VoicePrefixId':_0x387d19[_0x9139('0x49')]['id']},'transaction':_0x4ac429});});})[_0x9139('0x28')](function(){_0x6a479a[_0x9139('0x87')](function(_0x520457){socket['emit']('userVoicePrefix:save',{'UserId':_0x520457['id'],'VoicePrefixId':_0x338cf4['id']});});});});});}})[_0x9139('0x28')](respondWithStatusCode(_0x5511ac,null))['catch'](handleError(_0x5511ac,null));};exports[_0x9139('0x88')]=function(_0x26e724,_0x31ede0,_0x13f114){return db[_0x9139('0x7a')][_0x9139('0x46')]({'where':{'id':_0x26e724[_0x9139('0x33')][_0x9139('0x70')]},'attributes':['id'],'include':[{'model':db[_0x9139('0x79')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x9139('0x28')](handleEntityNotFound(_0x31ede0,null))['then'](function(_0x2cc56d){var _0x346236=_[_0x9139('0x2e')](_0x2cc56d,'id');var _0x2c3a84=[];var _0x518031=[];var _0x4e1267=squel[_0x9139('0x89')]();_0x4e1267[_0x9139('0x8a')](_0x9139('0x8b'))[_0x9139('0x8c')](_0x9139('0x8d'),'tq')[_0x9139('0x8e')](_0x9139('0x8f'),'ut',_0x9139('0x90'))[_0x9139('0x3e')](_0x9139('0x91'),_0x26e724['params']['id']);for(var _0x568234=0x0;_0x568234<_0x2cc56d[_0x9139('0x39')];_0x568234+=0x1){let _0x3e41e5=_0x2cc56d[_0x568234];for(var _0x27c1a2=0x0;_0x27c1a2<_0x3e41e5[_0x9139('0x81')][_0x9139('0x39')];_0x27c1a2+=0x1){let _0x40a2a5=_0x3e41e5[_0x9139('0x81')][_0x27c1a2];var _0x194b7d=_0x4e1267['clone']();_0x194b7d[_0x9139('0x3e')](_0x9139('0x92'),_0x40a2a5['id']);_0x518031['push'](db[_0x9139('0x82')][_0x9139('0x33')](_0x194b7d[_0x9139('0x93')](),{'type':db[_0x9139('0x82')][_0x9139('0x94')][_0x9139('0x95')]})[_0x9139('0x28')](function(_0x43ef80){if(_0x43ef80[_0x9139('0x39')]===0x1){return _0x40a2a5['id'];}else{var _0x4cb6ad=_[_0x9139('0x96')](_['map'](_0x43ef80,'TeamId'),function(_0xd0b878){return _[_0x9139('0x97')](_0x346236,_0xd0b878);});if(_0x4cb6ad){return _0x40a2a5['id'];}}}));}}return BPromise[_0x9139('0x98')](_0x518031)[_0x9139('0x28')](function(_0x59cf9d){_0x2c3a84=_(_0x2c3a84)['union'](_0x59cf9d)[_0x9139('0x99')]()[_0x9139('0x9a')]();return db['VoicePrefix'][_0x9139('0x4b')]({'where':{'id':_0x26e724[_0x9139('0x49')]['id']}})['then'](function(_0x18625c){return db['sequelize'][_0x9139('0x4d')](function(_0x20ff88){return _0x18625c[_0x9139('0x88')](_0x26e724[_0x9139('0x33')][_0x9139('0x70')],{'transaction':_0x20ff88})['then'](function(){if(!_['isEmpty'](_0x2c3a84)){return _0x18625c['removeAgents'](_0x2c3a84,{'transaction':_0x20ff88});}})['then'](function(){_0x2c3a84[_0x9139('0x87')](function(_0x4c4081){socket[_0x9139('0x73')](_0x9139('0x76'),{'UserId':_0x4c4081,'VoicePrefixId':_0x18625c['id']});});});});});});})[_0x9139('0x28')](respondWithStatusCode(_0x31ede0,null))[_0x9139('0x47')](handleError(_0x31ede0,null));}; \ No newline at end of file +var _0x056b=['forEach','removeTeams','select','field','tq.TeamId','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoicePrefixId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','every','TeamId','includes','all','union','value','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','./voicePrefix.socket','register','sendStatus','end','json','offset','limit','undefined','count','set','apply','reject','update','destroy','then','get','VoicePrefixes','UserProfileResource','status','error','stack','name','send','index','map','VoicePrefix','rawAttributes','fieldName','key','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','options','includeAll','include','findAll','rows','catch','params','find','describe','create','sequelize','transaction','body','VoiceExtension','VoiceExtensionId','user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','from-sip','app','system','description','Voice\x20Prefix\x20Extension','priority','appdata','prefix','Voice\x20Prefix','VoicePrefixId','bulkCreate','Extensions\x20creation\x20failed','Set','CDR(prefix)=','callerIdAll','push','NoOp','goto','${EXTEN:','charAt','system-','findById','addAgents','ids','spread','emit','userVoicePrefix:save','removeAgents','isArray','userVoicePrefix:remove','getAgents','findOne','order','Team','getTeams','addTeams','User','Agents','online','voicePause','flatMap','each','TeamVoicePrefix','upsert','UserVoicePrefix','findOrCreate'];(function(_0x30bd4d,_0x50eb60){var _0x306915=function(_0x5ae782){while(--_0x5ae782){_0x30bd4d['push'](_0x30bd4d['shift']());}};_0x306915(++_0x50eb60);}(_0x056b,0xb6));var _0xb056=function(_0x4c0de6,_0x4f95d0){_0x4c0de6=_0x4c0de6-0x0;var _0x47795b=_0x056b[_0x4c0de6];return _0x47795b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb056('0x0'));var zipdir=require(_0xb056('0x1'));var jsonpatch=require(_0xb056('0x2'));var rp=require(_0xb056('0x3'));var moment=require(_0xb056('0x4'));var BPromise=require(_0xb056('0x5'));var Mustache=require(_0xb056('0x6'));var util=require(_0xb056('0x7'));var path=require(_0xb056('0x8'));var sox=require(_0xb056('0x9'));var csv=require(_0xb056('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb056('0xb'));var _=require(_0xb056('0xc'));var squel=require(_0xb056('0xd'));var crypto=require(_0xb056('0xe'));var jsforce=require(_0xb056('0xf'));var deskjs=require(_0xb056('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xb056('0x11'));var Redis=require(_0xb056('0x12'));var authService=require(_0xb056('0x13'));var qs=require(_0xb056('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb056('0x15'));var logger=require('../../config/logger')(_0xb056('0x16'));var utils=require(_0xb056('0x17'));var config=require(_0xb056('0x18'));var licenseUtil=require(_0xb056('0x19'));var db=require(_0xb056('0x1a'))['db'];config['redis']=_['defaults'](config[_0xb056('0x1b')],{'host':_0xb056('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb056('0x1b')]));require(_0xb056('0x1d'))[_0xb056('0x1e')](socket);function respondWithStatusCode(_0x1197e5,_0x10dd19){_0x10dd19=_0x10dd19||0xcc;return function(_0x3776a1){if(_0x3776a1){return _0x1197e5[_0xb056('0x1f')](_0x10dd19);}return _0x1197e5['status'](_0x10dd19)[_0xb056('0x20')]();};}function respondWithResult(_0x43565e,_0x9e2eed){_0x9e2eed=_0x9e2eed||0xc8;return function(_0x65d7ca){if(_0x65d7ca){return _0x43565e['status'](_0x9e2eed)[_0xb056('0x21')](_0x65d7ca);}};}function respondWithFilteredResult(_0x4e501a,_0x2daffc){return function(_0x311eb9){if(_0x311eb9){var _0x48e140=typeof _0x2daffc[_0xb056('0x22')]==='undefined'&&typeof _0x2daffc[_0xb056('0x23')]===_0xb056('0x24');var _0x5e4bd9=_0x311eb9[_0xb056('0x25')];var _0x48cdaf=_0x48e140?0x0:_0x2daffc[_0xb056('0x22')];var _0x225081=_0x48e140?_0x311eb9[_0xb056('0x25')]:_0x2daffc[_0xb056('0x22')]+_0x2daffc['limit'];var _0x1db585;if(_0x225081>=_0x5e4bd9){_0x225081=_0x5e4bd9;_0x1db585=0xc8;}else{_0x1db585=0xce;}_0x4e501a['status'](_0x1db585);return _0x4e501a[_0xb056('0x26')]('Content-Range',_0x48cdaf+'-'+_0x225081+'/'+_0x5e4bd9)[_0xb056('0x21')](_0x311eb9);}return null;};}function patchUpdates(_0x40ac2d){return function(_0x1de11b){try{jsonpatch[_0xb056('0x27')](_0x1de11b,_0x40ac2d,!![]);}catch(_0x36e539){return BPromise[_0xb056('0x28')](_0x36e539);}return _0x1de11b['save']();};}function saveUpdates(_0x1016da,_0x18a3f2){return function(_0x341544){if(_0x341544){return _0x341544[_0xb056('0x29')](_0x1016da)['then'](function(_0x44a14f){return _0x44a14f;});}return null;};}function removeEntity(_0x10b9b3,_0x5c39db){return function(_0x6d0483){if(_0x6d0483){return _0x6d0483[_0xb056('0x2a')]()[_0xb056('0x2b')](function(){var _0x1d2c66=_0x6d0483[_0xb056('0x2c')]({'plain':!![]});var _0x4024d7=_0xb056('0x2d');return db[_0xb056('0x2e')]['destroy']({'where':{'type':_0x4024d7,'resourceId':_0x1d2c66['id']}})[_0xb056('0x2b')](function(){return _0x6d0483;});})['then'](function(){_0x10b9b3[_0xb056('0x2f')](0xcc)[_0xb056('0x20')]();});}};}function handleEntityNotFound(_0x294874,_0x488185){return function(_0xd53267){if(!_0xd53267){_0x294874[_0xb056('0x1f')](0x194);}return _0xd53267;};}function handleError(_0x4ba5f8,_0x3a9e7d){_0x3a9e7d=_0x3a9e7d||0x1f4;return function(_0x43aa63){logger[_0xb056('0x30')](_0x43aa63[_0xb056('0x31')]);if(_0x43aa63[_0xb056('0x32')]){delete _0x43aa63['name'];}_0x4ba5f8[_0xb056('0x2f')](_0x3a9e7d)[_0xb056('0x33')](_0x43aa63);};}exports[_0xb056('0x34')]=function(_0x248473,_0x103482){var _0x559c34={},_0x16bbd2={},_0x290807={'count':0x0,'rows':[]};var _0x16c1d6=_[_0xb056('0x35')](db[_0xb056('0x36')][_0xb056('0x37')],function(_0x19f277){return{'name':_0x19f277[_0xb056('0x38')],'type':_0x19f277['type'][_0xb056('0x39')]};});_0x16bbd2['model']=_[_0xb056('0x35')](_0x16c1d6,'name');_0x16bbd2['query']=_[_0xb056('0x3a')](_0x248473[_0xb056('0x3b')]);_0x16bbd2[_0xb056('0x3c')]=_[_0xb056('0x3d')](_0x16bbd2[_0xb056('0x3e')],_0x16bbd2[_0xb056('0x3b')]);_0x559c34[_0xb056('0x3f')]=_['intersection'](_0x16bbd2[_0xb056('0x3e')],qs[_0xb056('0x40')](_0x248473['query']['fields']));_0x559c34[_0xb056('0x3f')]=_0x559c34[_0xb056('0x3f')][_0xb056('0x41')]?_0x559c34['attributes']:_0x16bbd2[_0xb056('0x3e')];if(!_0x248473[_0xb056('0x3b')][_0xb056('0x42')](_0xb056('0x43'))){_0x559c34[_0xb056('0x23')]=qs[_0xb056('0x23')](_0x248473[_0xb056('0x3b')][_0xb056('0x23')]);_0x559c34[_0xb056('0x22')]=qs[_0xb056('0x22')](_0x248473[_0xb056('0x3b')][_0xb056('0x22')]);}_0x559c34['order']=qs[_0xb056('0x44')](_0x248473['query'][_0xb056('0x44')]);_0x559c34[_0xb056('0x45')]=qs[_0xb056('0x3c')](_[_0xb056('0x46')](_0x248473[_0xb056('0x3b')],_0x16bbd2[_0xb056('0x3c')]),_0x16c1d6);if(_0x248473[_0xb056('0x3b')][_0xb056('0x47')]){_0x559c34['where']=_[_0xb056('0x48')](_0x559c34[_0xb056('0x45')],{'$or':_[_0xb056('0x35')](_0x16c1d6,function(_0x4c2b1e){if(_0x4c2b1e[_0xb056('0x49')]!=='VIRTUAL'){var _0x39b861={};_0x39b861[_0x4c2b1e[_0xb056('0x32')]]={'$like':'%'+_0x248473[_0xb056('0x3b')][_0xb056('0x47')]+'%'};return _0x39b861;}})});}_0x559c34=_[_0xb056('0x48')]({},_0x559c34,_0x248473[_0xb056('0x4a')]);var _0x57da48={'where':_0x559c34[_0xb056('0x45')]};return db['VoicePrefix'][_0xb056('0x25')](_0x57da48)[_0xb056('0x2b')](function(_0x21d98e){_0x290807[_0xb056('0x25')]=_0x21d98e;if(_0x248473[_0xb056('0x3b')][_0xb056('0x4b')]){_0x559c34[_0xb056('0x4c')]=[{'all':!![]}];}return db[_0xb056('0x36')][_0xb056('0x4d')](_0x559c34);})[_0xb056('0x2b')](function(_0x4fa3c5){_0x290807[_0xb056('0x4e')]=_0x4fa3c5;return _0x290807;})[_0xb056('0x2b')](respondWithFilteredResult(_0x103482,_0x559c34))[_0xb056('0x4f')](handleError(_0x103482,null));};exports['show']=function(_0x2bf4dd,_0x505cad){var _0x49597d={'raw':![],'where':{'id':_0x2bf4dd[_0xb056('0x50')]['id']}},_0x5821e1={};_0x5821e1[_0xb056('0x3e')]=_[_0xb056('0x3a')](db[_0xb056('0x36')]['rawAttributes']);_0x5821e1['query']=_['keys'](_0x2bf4dd['query']);_0x5821e1['filters']=_['intersection'](_0x5821e1[_0xb056('0x3e')],_0x5821e1['query']);_0x49597d[_0xb056('0x3f')]=_[_0xb056('0x3d')](_0x5821e1[_0xb056('0x3e')],qs[_0xb056('0x40')](_0x2bf4dd[_0xb056('0x3b')][_0xb056('0x40')]));_0x49597d[_0xb056('0x3f')]=_0x49597d[_0xb056('0x3f')]['length']?_0x49597d[_0xb056('0x3f')]:_0x5821e1[_0xb056('0x3e')];if(_0x2bf4dd['query'][_0xb056('0x4b')]){_0x49597d[_0xb056('0x4c')]=[{'all':!![]}];}_0x49597d=_[_0xb056('0x48')]({},_0x49597d,_0x2bf4dd[_0xb056('0x4a')]);return db[_0xb056('0x36')][_0xb056('0x51')](_0x49597d)['then'](handleEntityNotFound(_0x505cad,null))[_0xb056('0x2b')](respondWithResult(_0x505cad,null))['catch'](handleError(_0x505cad,null));};exports[_0xb056('0x2a')]=function(_0x3e4a14,_0xde5564){return db[_0xb056('0x36')][_0xb056('0x51')]({'where':{'id':_0x3e4a14[_0xb056('0x50')]['id']}})[_0xb056('0x2b')](handleEntityNotFound(_0xde5564,null))[_0xb056('0x2b')](removeEntity(_0xde5564,null))['catch'](handleError(_0xde5564,null));};exports[_0xb056('0x52')]=function(_0x472a91,_0x5927c7){return db[_0xb056('0x36')][_0xb056('0x52')]()[_0xb056('0x2b')](respondWithResult(_0x5927c7,null))[_0xb056('0x4f')](handleError(_0x5927c7,null));};exports[_0xb056('0x53')]=function(_0x4a9968,_0x122ed7){var _0xc0be0d;return db[_0xb056('0x54')][_0xb056('0x55')](function(_0x1a5170){return db[_0xb056('0x36')]['create'](_0x4a9968[_0xb056('0x56')],{'transaction':_0x1a5170})[_0xb056('0x2b')](function(_0x30ba6e){_0xc0be0d=_0x30ba6e['get']({'plain':!![]});return db[_0xb056('0x57')]['find']({'where':{'id':_0xc0be0d[_0xb056('0x58')]},'raw':!![]})[_0xb056('0x2b')](function(_0x2a064f){return createVoicePrefixExtensions(_0xc0be0d,_0x2a064f,_0x1a5170);});});})[_0xb056('0x2b')](function(){var _0x58c533=_0x4a9968[_0xb056('0x59')][_0xb056('0x2c')]({'plain':!![]});if(!_0x58c533)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x58c533[_0xb056('0x5a')]===_0xb056('0x59')){var _0x1d3cdd=_0xc0be0d;return db[_0xb056('0x5b')][_0xb056('0x51')]({'where':{'name':'VoicePrefixes','userProfileId':_0x58c533[_0xb056('0x5c')]},'raw':!![]})[_0xb056('0x2b')](function(_0x10681b){if(_0x10681b&&_0x10681b[_0xb056('0x5d')]===0x0){return db[_0xb056('0x2e')][_0xb056('0x53')]({'name':_0x1d3cdd[_0xb056('0x32')],'resourceId':_0x1d3cdd['id'],'type':_0x10681b[_0xb056('0x32')],'sectionId':_0x10681b['id']},{})[_0xb056('0x2b')](function(){return _0xc0be0d;});}else{return _0xc0be0d;}})[_0xb056('0x4f')](function(_0x1b4a0d){logger[_0xb056('0x30')](_0xb056('0x5e'),_0x1b4a0d);throw _0x1b4a0d;});}return _0xc0be0d;})[_0xb056('0x2b')](respondWithResult(_0x122ed7,null))[_0xb056('0x4f')](handleError(_0x122ed7,null));};function Extension(_0x282c31,_0x28fc90,_0x435fe9,_0x39765e){this[_0xb056('0x5f')]=_0xb056('0x60');this['exten']=_0x282c31;this[_0xb056('0x61')]=_0x435fe9;this[_0xb056('0x49')]=_0xb056('0x62');this[_0xb056('0x63')]=_0xb056('0x64');this[_0xb056('0x65')]=_0x28fc90;this[_0xb056('0x66')]=_0x39765e;}function createVoicePrefixExtensions(_0x55808b,_0x5b03df,_0x30441e){return new BPromise(function(_0x388817,_0x1205cc){var _0x7b81c7=new Extension(formatPrefixName(_0x55808b[_0xb056('0x67')]),0x1,'NoOp',_0xb056('0x68'));_0x7b81c7[_0xb056('0x69')]=_0x55808b['id'];return db[_0xb056('0x57')][_0xb056('0x53')](_0x7b81c7,{'transaction':_0x30441e})['then'](function(_0x405108){var _0x24b037=_0x405108[_0xb056('0x2c')]({'plain':!![]});var _0x5e419e=_[_0xb056('0x35')](addVoicePrefixExtensions(_0x55808b,_0x5b03df),function(_0x2e02d5){_0x2e02d5[_0xb056('0x58')]=_0x24b037['id'];_0x2e02d5['VoicePrefixId']=_0x55808b['id'];return _0x2e02d5;});return db[_0xb056('0x57')][_0xb056('0x6a')](_0x5e419e,{'transaction':_0x30441e})[_0xb056('0x2b')](function(_0x5bf8ce){if(!_0x5bf8ce){return _0x1205cc(_0xb056('0x6b'));}else{return _0x388817(_0x5bf8ce);}})['catch'](function(_0x2d555d){return _0x1205cc(_0x2d555d);});});;});};function addVoicePrefixExtensions(_0x3e18c1,_0x103ff2){var _0x556a93=[];var _0x45d347=formatPrefixName(_0x3e18c1[_0xb056('0x67')]);_0x556a93['push'](new Extension(_0x45d347,0x2,_0xb056('0x6c'),_0xb056('0x6d')+_0x3e18c1[_0xb056('0x32')]));if(_0x3e18c1[_0xb056('0x6e')]){_0x556a93[_0xb056('0x6f')](new Extension(_0x45d347,0x3,'Set','PREFIX-CALLERIDALL='+_0x3e18c1[_0xb056('0x6e')]));}else{_0x556a93['push'](new Extension(_0x45d347,0x3,_0xb056('0x70'),'No\x20callerid\x20available'));}_0x556a93[_0xb056('0x6f')](new Extension(_0x45d347,0x4,_0xb056('0x71'),_0x103ff2[_0xb056('0x5f')]+','+_0xb056('0x72')+(0x8+_0x3e18c1['name']['length'])+'}'+','+0x1));return _0x556a93;}function formatPrefixName(_0xe6caf7){var _0x1e14e1='_';for(var _0x3b3bbf=0x0;_0x3b3bbf<_0xe6caf7[_0xb056('0x41')];_0x3b3bbf++){if(_0xe6caf7['charAt'](_0x3b3bbf)=='-'){_0x1e14e1+=_0xe6caf7[_0xb056('0x73')](_0x3b3bbf);}else{_0x1e14e1+='['+_0xe6caf7['charAt'](_0x3b3bbf)+']';}}_0x1e14e1+='.';return _0x1e14e1;}exports[_0xb056('0x29')]=function(_0x5f0278,_0x2129c5,_0x56bab7){var _0x432501=_0x5f0278[_0xb056('0x56')];_0x432501[_0xb056('0x67')]=_0xb056('0x74')+_0x432501['name']+'-';return db[_0xb056('0x54')]['transaction'](function(_0x227ab0){return db[_0xb056('0x36')][_0xb056('0x29')](_0x432501,{'where':{'id':_0x432501['id']},'transaction':_0x227ab0})[_0xb056('0x2b')](function(){return db[_0xb056('0x57')][_0xb056('0x2a')]({'where':{'VoicePrefixId':_0x432501['id']},'transaction':_0x227ab0})[_0xb056('0x2b')](function(){return db[_0xb056('0x57')][_0xb056('0x51')]({'where':{'id':_0x432501[_0xb056('0x58')]},'raw':!![]})[_0xb056('0x2b')](function(_0x3f6e2f){return createVoicePrefixExtensions(_0x432501,_0x3f6e2f,_0x227ab0);});});});})['then'](function(){return db['VoicePrefix'][_0xb056('0x75')](_0x432501['id']);})['then'](respondWithResult(_0x2129c5,null))[_0xb056('0x4f')](handleError(_0x2129c5,null));};exports['addAgents']=function(_0x208696,_0x5df962,_0x5f4b72){return db['VoicePrefix'][_0xb056('0x51')]({'where':{'id':_0x208696['params']['id']}})['then'](handleEntityNotFound(_0x5df962,null))[_0xb056('0x2b')](function(_0xb6fd9b){if(_0xb6fd9b){return _0xb6fd9b[_0xb056('0x76')](_0x208696['body']['ids'],_['omit'](_0x208696[_0xb056('0x56')],[_0xb056('0x77'),'id'])||{})[_0xb056('0x78')](function(_0x13bd5f){for(var _0x9185c=0x0;_0x9185c<_0x208696[_0xb056('0x56')][_0xb056('0x77')][_0xb056('0x41')];_0x9185c+=0x1){socket[_0xb056('0x79')](_0xb056('0x7a'),{'UserId':Number(_0x208696[_0xb056('0x56')][_0xb056('0x77')][_0x9185c]),'VoicePrefixId':Number(_0x208696[_0xb056('0x50')]['id'])});}return _0x13bd5f;});}})[_0xb056('0x2b')](respondWithResult(_0x5df962,null))['catch'](handleError(_0x5df962,null));};exports['removeAgents']=function(_0x18feb4,_0x5ef886,_0x11ef5f){return db[_0xb056('0x36')][_0xb056('0x51')]({'where':{'id':_0x18feb4[_0xb056('0x50')]['id']}})['then'](handleEntityNotFound(_0x5ef886,null))['then'](function(_0x2e027a){if(_0x2e027a){return _0x2e027a[_0xb056('0x7b')](_0x18feb4[_0xb056('0x3b')]['ids'])['then'](function(){if(_[_0xb056('0x7c')](_0x18feb4[_0xb056('0x3b')]['ids'])){for(var _0x345cf9=0x0;_0x345cf9<_0x18feb4[_0xb056('0x3b')][_0xb056('0x77')][_0xb056('0x41')];_0x345cf9+=0x1){socket[_0xb056('0x79')](_0xb056('0x7d'),{'UserId':Number(_0x18feb4[_0xb056('0x3b')][_0xb056('0x77')][_0x345cf9]),'VoicePrefixId':Number(_0x18feb4[_0xb056('0x50')]['id'])});}}else{socket[_0xb056('0x79')](_0xb056('0x7d'),{'UserId':Number(_0x18feb4['query'][_0xb056('0x77')]),'VoicePrefixId':Number(_0x18feb4[_0xb056('0x50')]['id'])});}});}})[_0xb056('0x2b')](respondWithStatusCode(_0x5ef886,null))['catch'](handleError(_0x5ef886,null));};exports[_0xb056('0x7e')]=function(_0x4dc495,_0x489233,_0x1b0bbb){var _0x3a2f2f={};var _0x2d7c96={};var _0x56578e;var _0x493d0d;return db[_0xb056('0x36')][_0xb056('0x7f')]({'where':{'id':_0x4dc495['params']['id']}})[_0xb056('0x2b')](handleEntityNotFound(_0x489233,null))['then'](function(_0x3b0f93){if(_0x3b0f93){_0x56578e=_0x3b0f93;_0x2d7c96[_0xb056('0x3e')]=_['keys'](db['User'][_0xb056('0x37')]);_0x2d7c96[_0xb056('0x3b')]=_['keys'](_0x4dc495[_0xb056('0x3b')]);_0x2d7c96['filters']=_['intersection'](_0x2d7c96[_0xb056('0x3e')],_0x2d7c96[_0xb056('0x3b')]);_0x3a2f2f[_0xb056('0x3f')]=_[_0xb056('0x3d')](_0x2d7c96[_0xb056('0x3e')],qs[_0xb056('0x40')](_0x4dc495['query'][_0xb056('0x40')]));_0x3a2f2f['attributes']=_0x3a2f2f[_0xb056('0x3f')][_0xb056('0x41')]?_0x3a2f2f['attributes']:_0x2d7c96[_0xb056('0x3e')];_0x3a2f2f[_0xb056('0x80')]=qs['sort'](_0x4dc495[_0xb056('0x3b')]['sort']);_0x3a2f2f[_0xb056('0x45')]=qs['filters'](_[_0xb056('0x46')](_0x4dc495[_0xb056('0x3b')],_0x2d7c96['filters']));if(_0x4dc495[_0xb056('0x3b')]['filter']){_0x3a2f2f[_0xb056('0x45')]=_[_0xb056('0x48')](_0x3a2f2f[_0xb056('0x45')],{'$or':_[_0xb056('0x35')](_0x3a2f2f[_0xb056('0x3f')],function(_0x100a52){var _0x1bac84={};_0x1bac84[_0x100a52]={'$like':'%'+_0x4dc495[_0xb056('0x3b')]['filter']+'%'};return _0x1bac84;})});}_0x3a2f2f=_[_0xb056('0x48')]({},_0x3a2f2f,_0x4dc495['options']);return _0x56578e['getAgents'](_0x3a2f2f);}})['then'](function(_0x2ea984){if(_0x2ea984){_0x493d0d=_0x2ea984[_0xb056('0x41')];if(!_0x4dc495[_0xb056('0x3b')][_0xb056('0x42')]('nolimit')){_0x3a2f2f[_0xb056('0x23')]=qs[_0xb056('0x23')](_0x4dc495[_0xb056('0x3b')][_0xb056('0x23')]);_0x3a2f2f[_0xb056('0x22')]=qs['offset'](_0x4dc495[_0xb056('0x3b')][_0xb056('0x22')]);}return _0x56578e[_0xb056('0x7e')](_0x3a2f2f);}})['then'](function(_0x526035){if(_0x526035){return _0x526035?{'count':_0x493d0d,'rows':_0x526035}:null;}})['then'](respondWithResult(_0x489233,null))['catch'](handleError(_0x489233,null));};exports['getTeams']=function(_0x5021d2,_0x41532c,_0x1f5c6d){var _0xd82e9={};var _0x2b62f1={};var _0x38b119;var _0xcdd8d6;return db['VoicePrefix'][_0xb056('0x7f')]({'where':{'id':_0x5021d2[_0xb056('0x50')]['id']}})[_0xb056('0x2b')](handleEntityNotFound(_0x41532c,null))[_0xb056('0x2b')](function(_0x1ff1e7){if(_0x1ff1e7){_0x38b119=_0x1ff1e7;_0x2b62f1[_0xb056('0x3e')]=_[_0xb056('0x3a')](db[_0xb056('0x81')][_0xb056('0x37')]);_0x2b62f1[_0xb056('0x3b')]=_['keys'](_0x5021d2['query']);_0x2b62f1['filters']=_[_0xb056('0x3d')](_0x2b62f1['model'],_0x2b62f1[_0xb056('0x3b')]);_0xd82e9[_0xb056('0x3f')]=_[_0xb056('0x3d')](_0x2b62f1[_0xb056('0x3e')],qs[_0xb056('0x40')](_0x5021d2[_0xb056('0x3b')][_0xb056('0x40')]));_0xd82e9[_0xb056('0x3f')]=_0xd82e9[_0xb056('0x3f')]['length']?_0xd82e9[_0xb056('0x3f')]:_0x2b62f1[_0xb056('0x3e')];_0xd82e9[_0xb056('0x80')]=qs[_0xb056('0x44')](_0x5021d2['query']['sort']);_0xd82e9[_0xb056('0x45')]=qs[_0xb056('0x3c')](_[_0xb056('0x46')](_0x5021d2[_0xb056('0x3b')],_0x2b62f1[_0xb056('0x3c')]));if(_0x5021d2[_0xb056('0x3b')][_0xb056('0x47')]){_0xd82e9['where']=_[_0xb056('0x48')](_0xd82e9['where'],{'$or':_[_0xb056('0x35')](_0xd82e9[_0xb056('0x3f')],function(_0x5ba4b4){var _0x13ea6a={};_0x13ea6a[_0x5ba4b4]={'$like':'%'+_0x5021d2['query'][_0xb056('0x47')]+'%'};return _0x13ea6a;})});}_0xd82e9=_[_0xb056('0x48')]({},_0xd82e9,_0x5021d2[_0xb056('0x4a')]);return _0x38b119[_0xb056('0x82')](_0xd82e9);}})[_0xb056('0x2b')](function(_0x48dbfb){if(_0x48dbfb){_0xcdd8d6=_0x48dbfb[_0xb056('0x41')];if(!_0x5021d2[_0xb056('0x3b')][_0xb056('0x42')](_0xb056('0x43'))){_0xd82e9[_0xb056('0x23')]=qs[_0xb056('0x23')](_0x5021d2[_0xb056('0x3b')][_0xb056('0x23')]);_0xd82e9[_0xb056('0x22')]=qs[_0xb056('0x22')](_0x5021d2[_0xb056('0x3b')][_0xb056('0x22')]);}return _0x38b119[_0xb056('0x82')](_0xd82e9);}})[_0xb056('0x2b')](function(_0x3837af){if(_0x3837af){return _0x3837af?{'count':_0xcdd8d6,'rows':_0x3837af}:null;}})[_0xb056('0x2b')](respondWithResult(_0x41532c,null))[_0xb056('0x4f')](handleError(_0x41532c,null));};exports[_0xb056('0x83')]=function(_0x1a8d5b,_0x341a86,_0x506e61){var _0x263bbe=_0x1a8d5b[_0xb056('0x56')][_0xb056('0x77')];var _0x3de775;return db[_0xb056('0x81')][_0xb056('0x4d')]({'where':{'id':_0x263bbe},'attributes':['id'],'include':[{'model':db[_0xb056('0x84')],'as':_0xb056('0x85'),'attributes':['id',_0xb056('0x32'),_0xb056('0x86'),_0xb056('0x87'),'interface'],'raw':!![]}]})['then'](function(_0x330dd3){if(_0x330dd3){_0x3de775=_0x330dd3;var _0x5e5b65=_[_0xb056('0x88')](_0x330dd3,function(_0x88e59f){var _0x2b36b0=_0x88e59f['get']({'plain':!![]});return _0x2b36b0[_0xb056('0x85')];});return db[_0xb056('0x36')]['find']({'where':{'id':_0x1a8d5b['params']['id']}})[_0xb056('0x2b')](function(_0x3f80ab){return db[_0xb056('0x54')][_0xb056('0x55')](function(_0x11276e){return _0x3f80ab['addTeams'](_0x263bbe,{'transaction':_0x11276e})['then'](function(){return BPromise[_0xb056('0x89')](_0x3de775,function(_0x587fcc){return db[_0xb056('0x8a')][_0xb056('0x8b')]({'TeamId':_0x587fcc['id'],'VoicePrefixId':_0x1a8d5b[_0xb056('0x50')]['id']},{'transaction':_0x11276e});});})[_0xb056('0x2b')](function(){return BPromise['each'](_0x5e5b65,function(_0x31fc76){return db[_0xb056('0x8c')][_0xb056('0x8d')]({'where':{'UserId':_0x31fc76['id'],'VoicePrefixId':_0x1a8d5b[_0xb056('0x50')]['id']},'transaction':_0x11276e});});})[_0xb056('0x2b')](function(){_0x5e5b65[_0xb056('0x8e')](function(_0x221269){socket['emit'](_0xb056('0x7a'),{'UserId':_0x221269['id'],'VoicePrefixId':_0x3f80ab['id']});});});});});}})[_0xb056('0x2b')](respondWithStatusCode(_0x341a86,null))[_0xb056('0x4f')](handleError(_0x341a86,null));};exports[_0xb056('0x8f')]=function(_0x38c9fd,_0x3d277a,_0x3803bc){return db['Team'][_0xb056('0x4d')]({'where':{'id':_0x38c9fd[_0xb056('0x3b')][_0xb056('0x77')]},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xb056('0x2b')](handleEntityNotFound(_0x3d277a,null))['then'](function(_0x59020b){var _0x158f35=_[_0xb056('0x35')](_0x59020b,'id');var _0x18ee53=[];var _0xc4c8b4=[];var _0x1cca4d=squel[_0xb056('0x90')]();_0x1cca4d[_0xb056('0x91')](_0xb056('0x92'))['from']('team_has_voice_prefixes','tq')[_0xb056('0x93')](_0xb056('0x94'),'ut',_0xb056('0x95'))[_0xb056('0x45')](_0xb056('0x96'),_0x38c9fd[_0xb056('0x50')]['id']);for(var _0x5a7549=0x0;_0x5a7549<_0x59020b['length'];_0x5a7549+=0x1){let _0x4c9894=_0x59020b[_0x5a7549];for(var _0x2b75e4=0x0;_0x2b75e4<_0x4c9894['Agents'][_0xb056('0x41')];_0x2b75e4+=0x1){let _0x505f0d=_0x4c9894[_0xb056('0x85')][_0x2b75e4];var _0x462eb8=_0x1cca4d[_0xb056('0x97')]();_0x462eb8[_0xb056('0x45')](_0xb056('0x98'),_0x505f0d['id']);_0xc4c8b4[_0xb056('0x6f')](db[_0xb056('0x54')]['query'](_0x462eb8[_0xb056('0x99')](),{'type':db[_0xb056('0x54')][_0xb056('0x9a')][_0xb056('0x9b')]})[_0xb056('0x2b')](function(_0x499233){if(_0x499233[_0xb056('0x41')]===0x1){return _0x505f0d['id'];}else{var _0x391783=_[_0xb056('0x9c')](_[_0xb056('0x35')](_0x499233,_0xb056('0x9d')),function(_0x2f08e1){return _[_0xb056('0x9e')](_0x158f35,_0x2f08e1);});if(_0x391783){return _0x505f0d['id'];}}}));}}return BPromise[_0xb056('0x9f')](_0xc4c8b4)[_0xb056('0x2b')](function(_0x42b105){_0x18ee53=_(_0x18ee53)[_0xb056('0xa0')](_0x42b105)['compact']()[_0xb056('0xa1')]();return db[_0xb056('0x36')]['find']({'where':{'id':_0x38c9fd['params']['id']}})['then'](function(_0x512997){return db[_0xb056('0x54')][_0xb056('0x55')](function(_0x2f7ca9){return _0x512997[_0xb056('0x8f')](_0x38c9fd[_0xb056('0x3b')][_0xb056('0x77')],{'transaction':_0x2f7ca9})[_0xb056('0x2b')](function(){if(!_['isEmpty'](_0x18ee53)){return _0x512997[_0xb056('0x7b')](_0x18ee53,{'transaction':_0x2f7ca9});}})['then'](function(){_0x18ee53['forEach'](function(_0x33b1ad){socket[_0xb056('0x79')](_0xb056('0x7d'),{'UserId':_0x33b1ad,'VoicePrefixId':_0x512997['id']});});});});});});})[_0xb056('0x2b')](respondWithStatusCode(_0x3d277a,null))[_0xb056('0x4f')](handleError(_0x3d277a,null));}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.events.js b/server/api/voicePrefix/voicePrefix.events.js index 8466f36..999b6ff 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 _0xf1fd=['remove','emit','hook','exports','../../mysqldb','setMaxListeners','update'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xf1fd,0x6d));var _0xdf1f=function(_0x58417b,_0xc00192){_0x58417b=_0x58417b-0x0;var _0x418f5f=_0xf1fd[_0x58417b];return _0x418f5f;};'use strict';var EventEmitter=require('events');var VoicePrefix=require(_0xdf1f('0x0'))['db']['VoicePrefix'];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0xdf1f('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0xdf1f('0x2'),'afterDestroy':_0xdf1f('0x3')};function emitEvent(_0x6b0ec){return function(_0x2d6e40,_0x557aea,_0x12d6fe){VoicePrefixEvents['emit'](_0x6b0ec+':'+_0x2d6e40['id'],_0x2d6e40);VoicePrefixEvents[_0xdf1f('0x4')](_0x6b0ec,_0x2d6e40);_0x12d6fe(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoicePrefix[_0xdf1f('0x5')](e,emitEvent(event));}}module[_0xdf1f('0x6')]=VoicePrefixEvents; \ No newline at end of file +var _0x243e=['hasOwnProperty','exports','events','../../mysqldb','VoicePrefix','setMaxListeners','save','remove','emit'];(function(_0x5ec84c,_0xa6b2b1){var _0x4d86d7=function(_0x2ae982){while(--_0x2ae982){_0x5ec84c['push'](_0x5ec84c['shift']());}};_0x4d86d7(++_0xa6b2b1);}(_0x243e,0xe3));var _0xe243=function(_0x1b128f,_0x368097){_0x1b128f=_0x1b128f-0x0;var _0x27fb39=_0x243e[_0x1b128f];return _0x27fb39;};'use strict';var EventEmitter=require(_0xe243('0x0'));var VoicePrefix=require(_0xe243('0x1'))['db'][_0xe243('0x2')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0xe243('0x3')](0x0);var events={'afterCreate':_0xe243('0x4'),'afterUpdate':'update','afterDestroy':_0xe243('0x5')};function emitEvent(_0x5e5870){return function(_0xa658a,_0x2b141c,_0x426f0d){VoicePrefixEvents[_0xe243('0x6')](_0x5e5870+':'+_0xa658a['id'],_0xa658a);VoicePrefixEvents[_0xe243('0x6')](_0x5e5870,_0xa658a);_0x426f0d(null);};}for(var e in events){if(events[_0xe243('0x7')](e)){var event=events[e];VoicePrefix['hook'](e,emitEvent(event));}}module[_0xe243('0x8')]=VoicePrefixEvents; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.model.js b/server/api/voicePrefix/voicePrefix.model.js index 05c8817..8f665a0 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 _0xc921=['../../config/environment','./voicePrefix.attributes','exports','VoicePrefix','util','../../config/logger','api','moment'];(function(_0x2a3cc5,_0x1c88d4){var _0x238c13=function(_0x2209ca){while(--_0x2209ca){_0x2a3cc5['push'](_0x2a3cc5['shift']());}};_0x238c13(++_0x1c88d4);}(_0xc921,0x154));var _0x1c92=function(_0x2eb5bc,_0x4634c6){_0x2eb5bc=_0x2eb5bc-0x0;var _0x51c7b1=_0xc921[_0x2eb5bc];return _0x51c7b1;};'use strict';var _=require('lodash');var util=require(_0x1c92('0x0'));var logger=require(_0x1c92('0x1'))(_0x1c92('0x2'));var moment=require(_0x1c92('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(_0x1c92('0x4'));var attributes=require(_0x1c92('0x5'));module[_0x1c92('0x6')]=function(_0x2bb00b,_0x5ecea1){return _0x2bb00b['define'](_0x1c92('0x7'),attributes,{'tableName':'voice_prefixes','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2d97=['../../config/environment','./voicePrefix.attributes','exports','define','VoicePrefix','voice_prefixes','lodash','../../config/logger','api','bluebird','request-promise','path','rimraf'];(function(_0x290094,_0x26d5d2){var _0x252903=function(_0x1eb256){while(--_0x1eb256){_0x290094['push'](_0x290094['shift']());}};_0x252903(++_0x26d5d2);}(_0x2d97,0x124));var _0x72d9=function(_0x45f945,_0x2c5a50){_0x45f945=_0x45f945-0x0;var _0x2866b8=_0x2d97[_0x45f945];return _0x2866b8;};'use strict';var _=require(_0x72d9('0x0'));var util=require('util');var logger=require(_0x72d9('0x1'))(_0x72d9('0x2'));var moment=require('moment');var BPromise=require(_0x72d9('0x3'));var rp=require(_0x72d9('0x4'));var fs=require('fs');var path=require(_0x72d9('0x5'));var rimraf=require(_0x72d9('0x6'));var config=require(_0x72d9('0x7'));var attributes=require(_0x72d9('0x8'));module[_0x72d9('0x9')]=function(_0x278b45,_0x4d0dc1){return _0x278b45[_0x72d9('0xa')](_0x72d9('0xb'),attributes,{'tableName':_0x72d9('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 657ee84..28e2232 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 _0x5f6f=['jayson/promise','client','http','redis','localhost','socket.io-emitter','./voicePrefix.socket','register','request','then','info','VoicePrefix,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x5f6f,0x1ef));var _0xf5f6=function(_0x2c0d7b,_0x4ec918){_0x2c0d7b=_0x2c0d7b-0x0;var _0x3c769f=_0x5f6f[_0x2c0d7b];return _0x3c769f;};'use strict';var _=require(_0xf5f6('0x0'));var util=require(_0xf5f6('0x1'));var moment=require(_0xf5f6('0x2'));var BPromise=require(_0xf5f6('0x3'));var rs=require(_0xf5f6('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf5f6('0x5'))['db'];var utils=require(_0xf5f6('0x6'));var logger=require(_0xf5f6('0x7'))('rpc');var config=require(_0xf5f6('0x8'));var jayson=require(_0xf5f6('0x9'));var client=jayson[_0xf5f6('0xa')][_0xf5f6('0xb')]({'port':0x232a});config['redis']=_['defaults'](config[_0xf5f6('0xc')],{'host':_0xf5f6('0xd'),'port':0x18eb});var socket=require(_0xf5f6('0xe'))(new Redis(config[_0xf5f6('0xc')]));require(_0xf5f6('0xf'))[_0xf5f6('0x10')](socket);function respondWithRpcPromise(_0x57fc19,_0x5ba0f5,_0x988c4a){return new BPromise(function(_0x369b18,_0x491c14){return client[_0xf5f6('0x11')](_0x57fc19,_0x988c4a)[_0xf5f6('0x12')](function(_0xeb94fb){logger[_0xf5f6('0x13')](_0xf5f6('0x14'),_0x5ba0f5,'request\x20sent');logger[_0xf5f6('0x15')]('VoicePrefix,\x20%s,\x20%s,\x20%s',_0x5ba0f5,_0xf5f6('0x16'),JSON[_0xf5f6('0x17')](_0xeb94fb));if(_0xeb94fb[_0xf5f6('0x18')]){if(_0xeb94fb[_0xf5f6('0x18')]['code']===0x1f4){logger[_0xf5f6('0x18')](_0xf5f6('0x14'),_0x5ba0f5,_0xeb94fb[_0xf5f6('0x18')][_0xf5f6('0x19')]);return _0x491c14(_0xeb94fb['error'][_0xf5f6('0x19')]);}logger[_0xf5f6('0x18')](_0xf5f6('0x14'),_0x5ba0f5,_0xeb94fb[_0xf5f6('0x18')]['message']);return _0x369b18(_0xeb94fb['error'][_0xf5f6('0x19')]);}else{logger['info'](_0xf5f6('0x14'),_0x5ba0f5,'request\x20sent');_0x369b18(_0xeb94fb[_0xf5f6('0x1a')][_0xf5f6('0x19')]);}})[_0xf5f6('0x1b')](function(_0x301e2a){logger[_0xf5f6('0x18')](_0xf5f6('0x14'),_0x5ba0f5,_0x301e2a);_0x491c14(_0x301e2a);});});} \ No newline at end of file +var _0xbff5=['register','then','info','VoicePrefix,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter'];(function(_0x1ae59c,_0x7b8339){var _0x176aae=function(_0x39e3d8){while(--_0x39e3d8){_0x1ae59c['push'](_0x1ae59c['shift']());}};_0x176aae(++_0x7b8339);}(_0xbff5,0x1bc));var _0x5bff=function(_0x57e1ee,_0x4e2798){_0x57e1ee=_0x57e1ee-0x0;var _0x2ad15a=_0xbff5[_0x57e1ee];return _0x2ad15a;};'use strict';var _=require(_0x5bff('0x0'));var util=require(_0x5bff('0x1'));var moment=require(_0x5bff('0x2'));var BPromise=require(_0x5bff('0x3'));var rs=require(_0x5bff('0x4'));var fs=require('fs');var Redis=require(_0x5bff('0x5'));var db=require(_0x5bff('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x5bff('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x5bff('0x8'));var client=jayson[_0x5bff('0x9')][_0x5bff('0xa')]({'port':0x232a});config[_0x5bff('0xb')]=_[_0x5bff('0xc')](config[_0x5bff('0xb')],{'host':_0x5bff('0xd'),'port':0x18eb});var socket=require(_0x5bff('0xe'))(new Redis(config[_0x5bff('0xb')]));require('./voicePrefix.socket')[_0x5bff('0xf')](socket);function respondWithRpcPromise(_0x5e7d10,_0x1d8197,_0x40b806){return new BPromise(function(_0x4fc146,_0x3e72e9){return client['request'](_0x5e7d10,_0x40b806)[_0x5bff('0x10')](function(_0x4ff164){logger[_0x5bff('0x11')](_0x5bff('0x12'),_0x1d8197,'request\x20sent');logger[_0x5bff('0x13')]('VoicePrefix,\x20%s,\x20%s,\x20%s',_0x1d8197,_0x5bff('0x14'),JSON[_0x5bff('0x15')](_0x4ff164));if(_0x4ff164['error']){if(_0x4ff164[_0x5bff('0x16')][_0x5bff('0x17')]===0x1f4){logger['error']('VoicePrefix,\x20%s,\x20%s',_0x1d8197,_0x4ff164[_0x5bff('0x16')][_0x5bff('0x18')]);return _0x3e72e9(_0x4ff164[_0x5bff('0x16')]['message']);}logger[_0x5bff('0x16')](_0x5bff('0x12'),_0x1d8197,_0x4ff164[_0x5bff('0x16')]['message']);return _0x4fc146(_0x4ff164[_0x5bff('0x16')][_0x5bff('0x18')]);}else{logger[_0x5bff('0x11')]('VoicePrefix,\x20%s,\x20%s',_0x1d8197,_0x5bff('0x14'));_0x4fc146(_0x4ff164[_0x5bff('0x19')][_0x5bff('0x18')]);}})[_0x5bff('0x1a')](function(_0x5216dc){logger[_0x5bff('0x16')]('VoicePrefix,\x20%s,\x20%s',_0x1d8197,_0x5216dc);_0x3e72e9(_0x5216dc);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.socket.js b/server/api/voicePrefix/voicePrefix.socket.js index 86c724d..d3f614a 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 _0xe630=['./voicePrefix.events','save','update','emit','register','length','voicePrefix:'];(function(_0x4b0ca8,_0x1a1af3){var _0x8e13e2=function(_0x299fd1){while(--_0x299fd1){_0x4b0ca8['push'](_0x4b0ca8['shift']());}};_0x8e13e2(++_0x1a1af3);}(_0xe630,0x149));var _0x0e63=function(_0x4c7241,_0x1a26fe){_0x4c7241=_0x4c7241-0x0;var _0xf6002f=_0xe630[_0x4c7241];return _0xf6002f;};'use strict';var VoicePrefixEvents=require(_0x0e63('0x0'));var events=[_0x0e63('0x1'),'remove',_0x0e63('0x2')];function createListener(_0x294aee,_0x45c680){return function(_0x500458){_0x45c680[_0x0e63('0x3')](_0x294aee,_0x500458);};}function removeListener(_0x219cbe,_0x42c141){return function(){VoicePrefixEvents['removeListener'](_0x219cbe,_0x42c141);};}exports[_0x0e63('0x4')]=function(_0x308039){for(var _0x356abb=0x0,_0x3e461b=events[_0x0e63('0x5')];_0x356abb<_0x3e461b;_0x356abb++){var _0x563ad9=events[_0x356abb];var _0x35e304=createListener(_0x0e63('0x6')+_0x563ad9,_0x308039);VoicePrefixEvents['on'](_0x563ad9,_0x35e304);}}; \ No newline at end of file +var _0x5bc5=['register','length','./voicePrefix.events','save','remove','update','emit','removeListener'];(function(_0x3c4dad,_0x25ffd5){var _0x1a4f49=function(_0x6fe6c){while(--_0x6fe6c){_0x3c4dad['push'](_0x3c4dad['shift']());}};_0x1a4f49(++_0x25ffd5);}(_0x5bc5,0xb2));var _0x55bc=function(_0x5a636f,_0x3fec2b){_0x5a636f=_0x5a636f-0x0;var _0x6a8cfb=_0x5bc5[_0x5a636f];return _0x6a8cfb;};'use strict';var VoicePrefixEvents=require(_0x55bc('0x0'));var events=[_0x55bc('0x1'),_0x55bc('0x2'),_0x55bc('0x3')];function createListener(_0x19006b,_0x2e077d){return function(_0x2ebc5a){_0x2e077d[_0x55bc('0x4')](_0x19006b,_0x2ebc5a);};}function removeListener(_0xa94795,_0x1ea633){return function(){VoicePrefixEvents[_0x55bc('0x5')](_0xa94795,_0x1ea633);};}exports[_0x55bc('0x6')]=function(_0x188eb6){for(var _0x5d5f1d=0x0,_0x4d78d6=events[_0x55bc('0x7')];_0x5d5f1d<_0x4d78d6;_0x5d5f1d++){var _0x2a612b=events[_0x5d5f1d];var _0x38839e=createListener('voicePrefix:'+_0x2a612b,_0x188eb6);VoicePrefixEvents['on'](_0x2a612b,_0x38839e);}}; \ No newline at end of file diff --git a/server/api/voiceQueue/index.js b/server/api/voiceQueue/index.js index 8e77e10..4c9593c 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(_0x3c5f8d,_0x39891f){var _0x3b7beb=function(_0x44d6c9){while(--_0x44d6c9){_0x3c5f8d['push'](_0x3c5f8d['shift']());}};_0x3b7beb(++_0x39891f);}(_0xb10b,0x12a));var _0xbb10=function(_0x211de7,_0x2e6f69){_0x211de7=_0x211de7-0x0;var _0x2b29e0=_0xb10b[_0x211de7];return _0x2b29e0;};'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(_0x10b2d5,_0x5a7743){var _0x14b8d1=function(_0x3b888c){while(--_0x3b888c){_0x10b2d5['push'](_0x10b2d5['shift']());}};_0x14b8d1(++_0x5a7743);}(_0xb10b,0x12a));var _0xbb10=function(_0x54b283,_0x5eb8a6){_0x54b283=_0x54b283-0x0;var _0x2462b3=_0xb10b[_0x54b283];return _0x2462b3;};'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 3de7796..b419ea2 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 _0xb919=['progressive','power','predictive','Dial\x20Method.','UNSIGNED','Max\x209999\x20channels,\x200\x20means\x20unlimited.','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','FLOAT','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','agentBusyFactor','dropRate','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','https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue','Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#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)','#RecallMe\x20Timeout\x20(min:1)','Active/Disactive\x20Recall\x20In\x20Queue','DESC','ASC','Cut\x20Digit\x20(min:1,\x20max:15)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','name','ENUM','inbound','outbound','STRING','leastrecent','fewestcalls','random','rrmemory','wrandom','rrordered','ringall','setDataValue','strategy','getDataValue','type','booked','roundrobin','includes','INTEGER','yes','all','once','TEXT','periodic_announce','join','joinempty','split','leavewhenempty','BOOLEAN','wrapuptime','Active/Disactive\x20Campaign'];(function(_0x353e55,_0x384e65){var _0xe1646a=function(_0x4f2877){while(--_0x4f2877){_0x353e55['push'](_0x353e55['shift']());}};_0xe1646a(++_0x384e65);}(_0xb919,0x12f));var _0x9b91=function(_0x5c5578,_0x13d5ea){_0x5c5578=_0x5c5578-0x0;var _0x267f89=_0xb919[_0x5c5578];return _0x267f89;};'use strict';var Sequelize=require(_0x9b91('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x9b91('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x9b91('0x2')](_0x9b91('0x3'),_0x9b91('0x4')),'allowNull':![],'defaultValue':_0x9b91('0x3')},'musiconhold':{'type':Sequelize[_0x9b91('0x5')],'defaultValue':'default'},'announce':{'type':Sequelize[_0x9b91('0x5')],'defaultValue':''},'strategy':{'type':Sequelize[_0x9b91('0x2')]('rr','ringall',_0x9b91('0x6'),_0x9b91('0x7'),_0x9b91('0x8'),_0x9b91('0x9'),'linear',_0x9b91('0xa'),_0x9b91('0xb')),'allowNull':![],'defaultValue':_0x9b91('0xc'),'set':function(_0x1dfa06){this[_0x9b91('0xd')](_0x9b91('0xe'),_0x1dfa06?_0x1dfa06:_0x9b91('0x9'));},'get':function(){var _0x1b0bb0=this[_0x9b91('0xf')](_0x9b91('0x10'));var _0x164498=this[_0x9b91('0xf')]('dialMethod');var _0x17cef6=this[_0x9b91('0xf')](_0x9b91('0xe'));if(_0x1b0bb0===_0x9b91('0x4')){if(_0x164498==='preview'){return null;}if(_0x164498===_0x9b91('0x11')&&![_0x9b91('0x9'),_0x9b91('0x12')][_0x9b91('0x13')](_0x17cef6)){this[_0x9b91('0xd')](_0x9b91('0xe'),_0x9b91('0x9'));}}return _0x17cef6;}},'servicelevel':{'type':Sequelize[_0x9b91('0x14')](0xb),'defaultValue':0x0},'context':{'type':Sequelize['STRING'],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize['INTEGER'](0xb)},'timeout':{'type':Sequelize[_0x9b91('0x14')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0x9b91('0x14')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0x9b91('0x5')]},'weight':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0x9b91('0x14')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0x9b91('0x2')](_0x9b91('0x15'),'no'),'defaultValue':'yes'},'autopause':{'type':Sequelize[_0x9b91('0x2')](_0x9b91('0x15'),'no',_0x9b91('0x16')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize['INTEGER'](0xb)},'autopausebusy':{'type':Sequelize['ENUM'](_0x9b91('0x15'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize['ENUM'](_0x9b91('0x15'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0x9b91('0x2')](_0x9b91('0x15'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0x9b91('0x2')](_0x9b91('0x15'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize['ENUM'](_0x9b91('0x15'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize['ENUM'](_0x9b91('0x15'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0x9b91('0x5')],'allowNull':!![]},'membergosub':{'type':Sequelize['STRING'],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0x9b91('0x14')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0x9b91('0x14')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0x9b91('0x2')](_0x9b91('0x15'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0x9b91('0x2')](_0x9b91('0x15'),'no'),'defaultValue':_0x9b91('0x15')},'announce_holdtime':{'type':Sequelize[_0x9b91('0x2')](_0x9b91('0x15'),'no',_0x9b91('0x17')),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0x9b91('0x5')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0x9b91('0x2')](_0x9b91('0x15'),'no')},'announce_position_limit':{'type':Sequelize[_0x9b91('0x14')](0xb)},'announce_round_seconds':{'type':Sequelize['ENUM']('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize['STRING'],'defaultValue':''},'monitor_type':{'type':Sequelize['STRING']},'queue_youarenext':{'type':Sequelize[_0x9b91('0x5')],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0x9b91('0x5')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0x9b91('0x5')],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0x9b91('0x5')],'defaultValue':null},'queue_minute':{'type':Sequelize[_0x9b91('0x5')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0x9b91('0x5')],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0x9b91('0x5')],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0x9b91('0x5')],'defaultValue':null},'queue_reporthold':{'type':Sequelize['STRING']},'queue_quantity1':{'type':Sequelize['STRING']},'queue_quantity2':{'type':Sequelize[_0x9b91('0x5')]},'queue_periodic_announce':{'type':Sequelize['STRING']},'queue_less_than':{'type':Sequelize[_0x9b91('0x5')]},'periodic_announce':{'type':Sequelize[_0x9b91('0x18')],'set':function(_0x1166d4){this['setDataValue'](_0x9b91('0x19'),_0x1166d4?_0x1166d4[_0x9b91('0x1a')](','):[]);},'get':function(){return this[_0x9b91('0xf')](_0x9b91('0x19'))?this['getDataValue']('periodic_announce')['split'](','):[];}},'joinempty':{'type':Sequelize['STRING'],'defaultValue':_0x9b91('0x15'),'set':function(_0x54dedc){this[_0x9b91('0xd')](_0x9b91('0x1b'),_0x54dedc?_0x54dedc[_0x9b91('0x1a')](','):undefined);},'get':function(){return this[_0x9b91('0xf')](_0x9b91('0x1b'))?this[_0x9b91('0xf')](_0x9b91('0x1b'))[_0x9b91('0x1c')](','):undefined;}},'leavewhenempty':{'type':Sequelize['STRING'],'defaultValue':'no','set':function(_0x5605de){this[_0x9b91('0xd')](_0x9b91('0x1d'),_0x5605de?_0x5605de[_0x9b91('0x1a')](','):undefined);},'get':function(){return this[_0x9b91('0xf')]('leavewhenempty')?this[_0x9b91('0xf')]('leavewhenempty')[_0x9b91('0x1c')](','):undefined;}},'reportholdtime':{'type':Sequelize[_0x9b91('0x2')](_0x9b91('0x15'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize['ENUM'](_0x9b91('0x15'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0x9b91('0x14')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x9b91('0x5')]},'acw':{'type':Sequelize[_0x9b91('0x1e')],'defaultValue':0x0,'set':function(_0x33bedc){this[_0x9b91('0xd')]('acw',_0x33bedc);if(_0x33bedc){if(this['getDataValue'](_0x9b91('0x1f'))<0x2){this[_0x9b91('0xd')](_0x9b91('0x1f'),0x2);}}}},'acwTimeout':{'type':Sequelize[_0x9b91('0x14')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x9b91('0x20')},'dialMethod':{'type':Sequelize[_0x9b91('0x2')]('preview',_0x9b91('0x21'),_0x9b91('0x22'),_0x9b91('0x23'),_0x9b91('0x11')),'defaultValue':_0x9b91('0x21'),'comment':_0x9b91('0x24')},'dialLimitChannel':{'type':Sequelize[_0x9b91('0x14')](0x4)[_0x9b91('0x25')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x9b91('0x26')},'dialLimitQueue':{'type':Sequelize[_0x9b91('0x14')](0x4)[_0x9b91('0x25')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x9b91('0x27')},'dialPowerLevel':{'type':Sequelize[_0x9b91('0x28')](0x2)[_0x9b91('0x25')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0x9b91('0x29')},'dialPredictiveOptimization':{'type':Sequelize['ENUM'](_0x9b91('0x2a'),_0x9b91('0x2b')),'defaultValue':'dropRate','comment':'Only\x20for\x20predictive\x20method.'},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0x9b91('0x28')](0x2)[_0x9b91('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0x9b91('0x2c')},'dialPredictiveInterval':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0x9b91('0x2d')},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize[_0x9b91('0x14')](0x3)[_0x9b91('0x25')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x9b91('0x2e')},'dialQueueOptions':{'type':Sequelize['STRING'],'defaultValue':_0x9b91('0x2f'),'comment':_0x9b91('0x30')},'dialQueueTimeout':{'type':Sequelize[_0x9b91('0x14')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x9b91('0x31')},'dialQueueProject':{'type':Sequelize[_0x9b91('0x5')],'comment':_0x9b91('0x32')},'dialCongestionMaxRetry':{'type':Sequelize[_0x9b91('0x14')](0x3)[_0x9b91('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x9b91('0x33')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x9b91('0x14')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x9b91('0x34')},'dialBusyMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x9b91('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize[_0x9b91('0x14')](0x5)[_0x9b91('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x9b91('0x35')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x9b91('0x14')](0x3)[_0x9b91('0x25')],'defaultValue':0x3,'comment':_0x9b91('0x36')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x9b91('0x14')](0x5)[_0x9b91('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x9b91('0x37')},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x9b91('0x25')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x9b91('0x38')},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':_0x9b91('0x39')},'dialPrefix':{'type':Sequelize[_0x9b91('0x5')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0x9b91('0x2')](_0x9b91('0x3a'),'never',_0x9b91('0x3b')),'defaultValue':_0x9b91('0x3a')},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x9b91('0x3c')},'dialAMDInitialSilence':{'type':Sequelize[_0x9b91('0x14')](0x9)[_0x9b91('0x25')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x9b91('0x3d')},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)[_0x9b91('0x25')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x9b91('0x3e')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x9b91('0x14')](0x9)[_0x9b91('0x25')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x9b91('0x3f')},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)[_0x9b91('0x25')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x9b91('0x40')},'dialAMDMinWordLength':{'type':Sequelize[_0x9b91('0x14')](0x9)[_0x9b91('0x25')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x9b91('0x41')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x9b91('0x14')](0x9)[_0x9b91('0x25')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x9b91('0x42')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x9b91('0x14')](0x9)[_0x9b91('0x25')],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize[_0x9b91('0x14')](0x5)[_0x9b91('0x25')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x9b91('0x43')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x9b91('0x14')](0x9)[_0x9b91('0x25')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialRecallMeTimeout':{'type':Sequelize[_0x9b91('0x14')](0x5)[_0x9b91('0x25')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0x9b91('0x44')},'dialRecallInQueue':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x9b91('0x45')},'dialOrderByScheduledAt':{'type':Sequelize['ENUM'](_0x9b91('0x46'),_0x9b91('0x47')),'defaultValue':_0x9b91('0x46')},'dialQueueProject2':{'type':Sequelize[_0x9b91('0x5')],'comment':'AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)'},'dialAgiAfterHangupClient':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0x9b91('0x1e')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x9b91('0x14')](0x3)[_0x9b91('0x25')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize[_0x9b91('0x14')](0x3)[_0x9b91('0x25')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x9b91('0x48')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x9b91('0x14')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x9b91('0x14')](0x5)[_0x9b91('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x9b91('0x49')},'dialDropMaxRetry':{'type':Sequelize[_0x9b91('0x14')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x9b91('0x4a')},'dialDropRetryFrequency':{'type':Sequelize[_0x9b91('0x14')](0x5)[_0x9b91('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x9b91('0x4b')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x9b91('0x14')](0x3)[_0x9b91('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x9b91('0x14')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x9b91('0x4c')},'dialMachineMaxRetry':{'type':Sequelize[_0x9b91('0x14')](0x3)[_0x9b91('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x9b91('0x4d')},'dialMachineRetryFrequency':{'type':Sequelize[_0x9b91('0x14')](0x5)[_0x9b91('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x9b91('0x4e')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x9b91('0x14')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x9b91('0x4f')},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x9b91('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x9b91('0x50')},'mandatoryDispositionPauseId':{'type':Sequelize[_0x9b91('0x14')],'allowNull':!![],'comment':_0x9b91('0x51')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x10eed2){if(!_0x10eed2)this['setDataValue'](_0x9b91('0x52'),null);this[_0x9b91('0xd')](_0x9b91('0x53'),_0x10eed2);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0x9b91('0x14')](0x3)[_0x9b91('0x25')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0x9b91('0x14')](0x3)['UNSIGNED'],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'dialPreviewAutoRecallMe':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'callAdditionalPhoneAfterMin':{'type':Sequelize[_0x9b91('0x14')](0x3)['UNSIGNED'],'defaultValue':0x4},'dialPreviewRecallmeReminder':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x54b7=['DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','#Drop\x20Retry\x20(min:1,\x20max:999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','exports','name','ENUM','inbound','outbound','default','STRING','ringall','leastrecent','fewestcalls','random','rrmemory','linear','wrandom','setDataValue','getDataValue','type','dialMethod','strategy','preview','booked','roundrobin','INTEGER','yes','all','once','TEXT','periodic_announce','join','split','joinempty','leavewhenempty','BOOLEAN','acw','wrapuptime','Active/Disactive\x20Campaign','progressive','predictive','Max\x209999\x20channels,\x200\x20means\x20unlimited.','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','FLOAT','UNSIGNED','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','dropRate','Only\x20for\x20predictive\x20method.','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','tTxX','Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','never','onlyIfOpen','always','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20Min\x20Word\x20Length','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','Active/Disactive\x20Recall\x20In\x20Queue'];(function(_0x378086,_0x2f597a){var _0xbf861d=function(_0x458664){while(--_0x458664){_0x378086['push'](_0x378086['shift']());}};_0xbf861d(++_0x2f597a);}(_0x54b7,0x148));var _0x754b=function(_0x372f1c,_0x1b6c84){_0x372f1c=_0x372f1c-0x0;var _0x55f677=_0x54b7[_0x372f1c];return _0x55f677;};'use strict';var Sequelize=require('sequelize');module[_0x754b('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x754b('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x754b('0x2')](_0x754b('0x3'),_0x754b('0x4')),'allowNull':![],'defaultValue':_0x754b('0x3')},'musiconhold':{'type':Sequelize['STRING'],'defaultValue':_0x754b('0x5')},'announce':{'type':Sequelize[_0x754b('0x6')],'defaultValue':''},'strategy':{'type':Sequelize[_0x754b('0x2')]('rr',_0x754b('0x7'),_0x754b('0x8'),_0x754b('0x9'),_0x754b('0xa'),_0x754b('0xb'),_0x754b('0xc'),_0x754b('0xd'),'rrordered'),'allowNull':![],'defaultValue':'ringall','set':function(_0x64728a){this[_0x754b('0xe')]('strategy',_0x64728a?_0x64728a:_0x754b('0xb'));},'get':function(){var _0x59acd3=this[_0x754b('0xf')](_0x754b('0x10'));var _0x23bec0=this[_0x754b('0xf')](_0x754b('0x11'));var _0x4f504c=this[_0x754b('0xf')](_0x754b('0x12'));if(_0x59acd3==='outbound'){if(_0x23bec0===_0x754b('0x13')){return null;}if(_0x23bec0===_0x754b('0x14')&&![_0x754b('0xb'),_0x754b('0x15')]['includes'](_0x4f504c)){this['setDataValue']('strategy',_0x754b('0xb'));}}return _0x4f504c;}},'servicelevel':{'type':Sequelize[_0x754b('0x16')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0x754b('0x6')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0x754b('0x16')](0xb)},'timeout':{'type':Sequelize[_0x754b('0x16')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0x754b('0x16')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0x754b('0x6')]},'weight':{'type':Sequelize[_0x754b('0x16')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0x754b('0x16')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0x754b('0x2')]('yes','no'),'defaultValue':_0x754b('0x17')},'autopause':{'type':Sequelize[_0x754b('0x2')](_0x754b('0x17'),'no',_0x754b('0x18')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0x754b('0x16')](0xb)},'autopausebusy':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0x754b('0x2')](_0x754b('0x17'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0x754b('0x16')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0x754b('0x2')]('yes','no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0x754b('0x2')](_0x754b('0x17'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0x754b('0x2')](_0x754b('0x17'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize['STRING'],'allowNull':!![]},'membergosub':{'type':Sequelize[_0x754b('0x6')],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0x754b('0x16')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0x754b('0x16')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0x754b('0x16')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize['ENUM'](_0x754b('0x17'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0x754b('0x2')](_0x754b('0x17'),'no'),'defaultValue':_0x754b('0x17')},'announce_holdtime':{'type':Sequelize[_0x754b('0x2')](_0x754b('0x17'),'no',_0x754b('0x19')),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0x754b('0x6')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0x754b('0x2')](_0x754b('0x17'),'no')},'announce_position_limit':{'type':Sequelize[_0x754b('0x16')](0xb)},'announce_round_seconds':{'type':Sequelize['ENUM']('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0x754b('0x6')],'defaultValue':''},'monitor_type':{'type':Sequelize[_0x754b('0x6')]},'queue_youarenext':{'type':Sequelize[_0x754b('0x6')],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0x754b('0x6')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize['STRING'],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0x754b('0x6')],'defaultValue':null},'queue_minute':{'type':Sequelize[_0x754b('0x6')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0x754b('0x6')],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0x754b('0x6')],'defaultValue':null},'queue_thankyou':{'type':Sequelize['STRING'],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0x754b('0x6')]},'queue_quantity1':{'type':Sequelize[_0x754b('0x6')]},'queue_quantity2':{'type':Sequelize[_0x754b('0x6')]},'queue_periodic_announce':{'type':Sequelize[_0x754b('0x6')]},'queue_less_than':{'type':Sequelize[_0x754b('0x6')]},'periodic_announce':{'type':Sequelize[_0x754b('0x1a')],'set':function(_0x42754c){this['setDataValue'](_0x754b('0x1b'),_0x42754c?_0x42754c[_0x754b('0x1c')](','):[]);},'get':function(){return this[_0x754b('0xf')](_0x754b('0x1b'))?this['getDataValue'](_0x754b('0x1b'))[_0x754b('0x1d')](','):[];}},'joinempty':{'type':Sequelize['STRING'],'defaultValue':_0x754b('0x17'),'set':function(_0x25036a){this[_0x754b('0xe')](_0x754b('0x1e'),_0x25036a?_0x25036a[_0x754b('0x1c')](','):undefined);},'get':function(){return this[_0x754b('0xf')](_0x754b('0x1e'))?this[_0x754b('0xf')](_0x754b('0x1e'))[_0x754b('0x1d')](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0x754b('0x6')],'defaultValue':'no','set':function(_0x4ab537){this['setDataValue'](_0x754b('0x1f'),_0x4ab537?_0x4ab537[_0x754b('0x1c')](','):undefined);},'get':function(){return this[_0x754b('0xf')](_0x754b('0x1f'))?this[_0x754b('0xf')](_0x754b('0x1f'))[_0x754b('0x1d')](','):undefined;}},'reportholdtime':{'type':Sequelize[_0x754b('0x2')](_0x754b('0x17'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0x754b('0x2')](_0x754b('0x17'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0x754b('0x16')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0x754b('0x2')](_0x754b('0x17'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x754b('0x6')]},'acw':{'type':Sequelize[_0x754b('0x20')],'defaultValue':0x0,'set':function(_0x4212a5){this[_0x754b('0xe')](_0x754b('0x21'),_0x4212a5);if(_0x4212a5){if(this[_0x754b('0xf')]('wrapuptime')<0x2){this['setDataValue'](_0x754b('0x22'),0x2);}}}},'acwTimeout':{'type':Sequelize[_0x754b('0x16')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0x754b('0x20')],'defaultValue':0x0,'comment':_0x754b('0x23')},'dialMethod':{'type':Sequelize[_0x754b('0x2')](_0x754b('0x13'),_0x754b('0x24'),'power',_0x754b('0x25'),'booked'),'defaultValue':_0x754b('0x24'),'comment':'Dial\x20Method.'},'dialLimitChannel':{'type':Sequelize[_0x754b('0x16')](0x4)['UNSIGNED'],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x754b('0x26')},'dialLimitQueue':{'type':Sequelize[_0x754b('0x16')](0x4)['UNSIGNED'],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x754b('0x27')},'dialPowerLevel':{'type':Sequelize[_0x754b('0x28')](0x2)[_0x754b('0x29')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0x754b('0x2a')},'dialPredictiveOptimization':{'type':Sequelize[_0x754b('0x2')]('agentBusyFactor',_0x754b('0x2b')),'defaultValue':_0x754b('0x2b'),'comment':_0x754b('0x2c')},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0x754b('0x28')](0x2)[_0x754b('0x29')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0x754b('0x2d')},'dialPredictiveInterval':{'type':Sequelize[_0x754b('0x16')](0x3)[_0x754b('0x29')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':'Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)'},'dialOriginateCallerIdName':{'type':Sequelize[_0x754b('0x6')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x754b('0x6')]},'dialOriginateTimeout':{'type':Sequelize[_0x754b('0x16')](0x3)[_0x754b('0x29')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x754b('0x2e')},'dialQueueOptions':{'type':Sequelize[_0x754b('0x6')],'defaultValue':_0x754b('0x2f'),'comment':'https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue'},'dialQueueTimeout':{'type':Sequelize['INTEGER'](0x3)[_0x754b('0x29')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x754b('0x30')},'dialQueueProject':{'type':Sequelize['STRING'],'comment':_0x754b('0x31')},'dialCongestionMaxRetry':{'type':Sequelize[_0x754b('0x16')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x754b('0x29')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x754b('0x32')},'dialBusyMaxRetry':{'type':Sequelize[_0x754b('0x16')](0x3)[_0x754b('0x29')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x754b('0x33')},'dialBusyRetryFrequency':{'type':Sequelize[_0x754b('0x16')](0x5)[_0x754b('0x29')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x754b('0x34')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x754b('0x16')](0x3)[_0x754b('0x29')],'defaultValue':0x3,'comment':_0x754b('0x35')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x754b('0x16')](0x5)[_0x754b('0x29')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize[_0x754b('0x16')](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x754b('0x36')},'dialTimezone':{'type':Sequelize[_0x754b('0x6')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x754b('0x6')],'defaultValue':_0x754b('0x37')},'dialPrefix':{'type':Sequelize[_0x754b('0x6')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize['ENUM']('always',_0x754b('0x38'),_0x754b('0x39')),'defaultValue':_0x754b('0x3a')},'dialAMDActive':{'type':Sequelize[_0x754b('0x20')],'defaultValue':0x0,'comment':_0x754b('0x3b')},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)[_0x754b('0x29')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x754b('0x3c')},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x754b('0x3d')},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x754b('0x16')](0x9)[_0x754b('0x29')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize[_0x754b('0x16')](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x754b('0x3e')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x754b('0x16')](0x9)[_0x754b('0x29')],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x754b('0x16')](0x9)[_0x754b('0x29')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x754b('0x3f')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x754b('0x16')](0x5)[_0x754b('0x29')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x754b('0x40')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x754b('0x16')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x754b('0x41')},'dialRecallMeTimeout':{'type':Sequelize[_0x754b('0x16')](0x5)[_0x754b('0x29')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':'#RecallMe\x20Timeout\x20(min:1)'},'dialRecallInQueue':{'type':Sequelize[_0x754b('0x20')],'defaultValue':0x0,'comment':_0x754b('0x42')},'dialOrderByScheduledAt':{'type':Sequelize[_0x754b('0x2')](_0x754b('0x43'),_0x754b('0x44')),'defaultValue':_0x754b('0x43')},'dialQueueProject2':{'type':Sequelize['STRING'],'comment':_0x754b('0x31')},'dialAgiAfterHangupClient':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0x754b('0x20')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x754b('0x16')](0x3)[_0x754b('0x29')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x754b('0x45')},'dialCutDigit':{'type':Sequelize[_0x754b('0x16')](0x3)[_0x754b('0x29')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x754b('0x46')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x754b('0x16')](0x3)[_0x754b('0x29')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x754b('0x47')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x754b('0x16')](0x5)[_0x754b('0x29')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize[_0x754b('0x16')](0x3)[_0x754b('0x29')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x754b('0x48')},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x754b('0x29')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAbandonedMaxRetry':{'type':Sequelize[_0x754b('0x16')](0x3)[_0x754b('0x29')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x754b('0x49')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x754b('0x16')](0x5)[_0x754b('0x29')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize[_0x754b('0x16')](0x3)[_0x754b('0x29')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x754b('0x4a')},'dialMachineRetryFrequency':{'type':Sequelize[_0x754b('0x16')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x754b('0x4b')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x754b('0x16')](0x3)[_0x754b('0x29')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#AgentReject\x20Retry\x20(min:1,\x20max:999)'},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x754b('0x4c')},'mandatoryDispositionPauseId':{'type':Sequelize[_0x754b('0x16')],'allowNull':!![],'comment':_0x754b('0x4d')},'mandatoryDisposition':{'type':Sequelize[_0x754b('0x20')],'defaultValue':![],'comment':_0x754b('0x4e'),'set':function(_0x2b5d7d){if(!_0x2b5d7d)this[_0x754b('0xe')]('mandatoryDispositionPauseId',null);this[_0x754b('0xe')]('mandatoryDisposition',_0x2b5d7d);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0x754b('0x16')](0x3)[_0x754b('0x29')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0x754b('0x16')](0x3)['UNSIGNED'],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'dialPreviewAutoRecallMe':{'type':Sequelize[_0x754b('0x20')],'defaultValue':!![]},'callAdditionalPhoneAfterMin':{'type':Sequelize[_0x754b('0x16')](0x3)['UNSIGNED'],'defaultValue':0x4},'dialPreviewRecallmeReminder':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.controller.js b/server/api/voiceQueue/voiceQueue.controller.js index a7a62cc..975f11d 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 _0x4b84=['type','find','UserProfileResource','stack','name','send','index','rawAttributes','fieldName','key','getOptions','where','VoiceQueue','include','findAll','rows','catch','show','params','model','keys','query','filters','intersection','attributes','fields','length','includeAll','merge','options','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','userProfileId','findOne','hasOwnProperty','nolimit','order','sort','VoiceQueueId','CmHopper','getHopperHistories','pick','CmHopperHistory','CmHopperFinal','CmHopperBlack','getTeams','Team','addTeams','User','Agents','voicePause','interface','forEach','penalty','transaction','TeamVoiceQueue','each','UserVoiceQueue','UserVoiceQueueRt','upsert','format','SIP/%s','emit','ids','field','from','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoiceQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','sequelize','SELECT','TeamId','all','removeTeams','isEmpty','removeAgents','addAgents','spread','userVoiceQueue:save','online','isNil','isArray','userVoiceQueue:remove','getAgents','getMembers','getLists','CmList','addLists','dialCheckDuplicateType','fromQuery','phone','scheduledAt','ContactId','ListId','select','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','CmListId','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','COALESCE(phone,\x27\x27)','cm_hopper','onlyIfOpen','insert','into','CmHopperId','OrderBy','h.id','ci.item','ci.OrderBy+1','cm_contact_has_items','h.scheduledat=?','ci.ItemClass=?','removeLists','getBlackLists','NOW()','removeBlackLists','moment','bluebird','squel','../../config/logger','api','../../config/environment','redis','socket.io-emitter','./voiceQueue.socket','sendStatus','end','status','json','undefined','count','offset','limit','update','destroy','then','get','VoiceQueues','inbound','QueueCampaigns','outbound','filter','ignore','map','value'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4b84,0x1cc));var _0x44b8=function(_0x423097,_0x8a09f4){_0x423097=_0x423097-0x0;var _0x3a73f1=_0x4b84[_0x423097];return _0x3a73f1;};'use strict';var moment=require(_0x44b8('0x0'));var BPromise=require(_0x44b8('0x1'));var util=require('util');var _=require('lodash');var squel=require(_0x44b8('0x2'));var Redis=require('ioredis');var qs=require('../../components/parsers/qs');var logger=require(_0x44b8('0x3'))(_0x44b8('0x4'));var config=require(_0x44b8('0x5'));var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config[_0x44b8('0x6')],{'host':'localhost','port':0x18eb});var socket=require(_0x44b8('0x7'))(new Redis(config['redis']));require(_0x44b8('0x8'))['register'](socket);function respondWithStatusCode(_0x5034b6,_0x41d515){_0x41d515=_0x41d515||0xcc;return function(_0x42319d){if(_0x42319d){return _0x5034b6[_0x44b8('0x9')](_0x41d515);}return _0x5034b6['status'](_0x41d515)[_0x44b8('0xa')]();};}function respondWithResult(_0x2cc74b,_0x4315f6){_0x4315f6=_0x4315f6||0xc8;return function(_0x9b6048){if(_0x9b6048){return _0x2cc74b[_0x44b8('0xb')](_0x4315f6)[_0x44b8('0xc')](_0x9b6048);}};}function respondWithFilteredResult(_0xe9a025,_0x4ae8a1){return function(_0x147529){if(_0x147529){var _0x4301a6=typeof _0x4ae8a1['offset']===_0x44b8('0xd')&&typeof _0x4ae8a1['limit']===_0x44b8('0xd');var _0x18d642=_0x147529['count'];var _0x63e8f6=_0x4301a6?0x0:_0x4ae8a1['offset'];var _0x54fa95=_0x4301a6?_0x147529[_0x44b8('0xe')]:_0x4ae8a1[_0x44b8('0xf')]+_0x4ae8a1[_0x44b8('0x10')];var _0x41ab46;if(_0x54fa95>=_0x18d642){_0x54fa95=_0x18d642;_0x41ab46=0xc8;}else{_0x41ab46=0xce;}_0xe9a025['status'](_0x41ab46);return _0xe9a025['set']('Content-Range',_0x63e8f6+'-'+_0x54fa95+'/'+_0x18d642)[_0x44b8('0xc')](_0x147529);}return null;};}function saveUpdates(_0x5b7803){return function(_0x28ef36){if(_0x28ef36){return _0x28ef36[_0x44b8('0x11')](_0x5b7803)['then'](function(_0x36743e){return _0x36743e;});}return null;};}function removeEntity(_0xe3de8f){return function(_0x5103f5){if(_0x5103f5){return _0x5103f5[_0x44b8('0x12')]()[_0x44b8('0x13')](function(){var _0x4b600f=_0x5103f5[_0x44b8('0x14')]({'plain':!![]});var _0x8b4301=[{'name':_0x44b8('0x15'),'value':_0x44b8('0x16'),'ignore':![]},{'name':_0x44b8('0x17'),'value':_0x44b8('0x18'),'ignore':![]}];var _0x452f2f=_(_0x8b4301)[_0x44b8('0x19')](_0x44b8('0x1a'))[_0x44b8('0x1b')](_0x44b8('0x1c'))[_0x44b8('0x1c')]();if(_['includes'](_0x452f2f,_0x4b600f[_0x44b8('0x1d')])){return;}var _0x3a8aa4=_[_0x44b8('0x1e')](_0x8b4301,[_0x44b8('0x1c'),_0x4b600f[_0x44b8('0x1d')]])['name'];return db[_0x44b8('0x1f')]['destroy']({'where':{'type':_0x3a8aa4,'resourceId':_0x4b600f['id']}})[_0x44b8('0x13')](function(){return _0x5103f5;});})[_0x44b8('0x13')](function(){_0xe3de8f[_0x44b8('0xb')](0xcc)[_0x44b8('0xa')]();});}};}function handleEntityNotFound(_0x230a3d){return function(_0x59acbc){if(!_0x59acbc){_0x230a3d[_0x44b8('0x9')](0x194);}return _0x59acbc;};}function handleError(_0x502acf,_0x41d673){_0x41d673=_0x41d673||0x1f4;return function(_0x350482){logger['error'](_0x350482[_0x44b8('0x20')]);if(_0x350482[_0x44b8('0x21')]){delete _0x350482[_0x44b8('0x21')];}_0x502acf['status'](_0x41d673)[_0x44b8('0x22')](_0x350482);};}exports[_0x44b8('0x23')]=function(_0x53d9c7,_0x2e0174){var _0x4a182d={};var _0xfb0028={'count':0x0,'rows':[]};var _0x5a544c=_['map'](db['VoiceQueue'][_0x44b8('0x24')],function(_0x29b18d){return{'name':_0x29b18d[_0x44b8('0x25')],'type':_0x29b18d[_0x44b8('0x1d')][_0x44b8('0x26')]};});_0x4a182d=qs[_0x44b8('0x27')](_0x5a544c,_0x53d9c7);var _0x2cf205={'where':_0x4a182d[_0x44b8('0x28')]};return db[_0x44b8('0x29')][_0x44b8('0xe')](_0x2cf205)[_0x44b8('0x13')](function(_0x417d81){_0xfb0028[_0x44b8('0xe')]=_0x417d81;_0x4a182d['include']=qs[_0x44b8('0x2a')](_0x53d9c7['query']);return db[_0x44b8('0x29')][_0x44b8('0x2b')](_0x4a182d);})[_0x44b8('0x13')](function(_0xb64609){_0xfb0028[_0x44b8('0x2c')]=_0xb64609;return _0xfb0028;})['then'](respondWithFilteredResult(_0x2e0174,_0x4a182d))[_0x44b8('0x2d')](handleError(_0x2e0174,null));};exports[_0x44b8('0x2e')]=function(_0x26265f,_0x339f0f){var _0x46b008={'raw':![],'where':{'id':_0x26265f[_0x44b8('0x2f')]['id']}},_0x5f541d={};_0x5f541d[_0x44b8('0x30')]=_[_0x44b8('0x31')](db[_0x44b8('0x29')][_0x44b8('0x24')]);_0x5f541d[_0x44b8('0x32')]=_[_0x44b8('0x31')](_0x26265f[_0x44b8('0x32')]);_0x5f541d[_0x44b8('0x33')]=_[_0x44b8('0x34')](_0x5f541d[_0x44b8('0x30')],_0x5f541d[_0x44b8('0x32')]);_0x46b008[_0x44b8('0x35')]=_[_0x44b8('0x34')](_0x5f541d[_0x44b8('0x30')],qs[_0x44b8('0x36')](_0x26265f[_0x44b8('0x32')][_0x44b8('0x36')]));_0x46b008[_0x44b8('0x35')]=_0x46b008[_0x44b8('0x35')][_0x44b8('0x37')]?_0x46b008[_0x44b8('0x35')]:_0x5f541d['model'];if(_0x26265f[_0x44b8('0x32')][_0x44b8('0x38')]){_0x46b008['include']=[{'all':!![]}];}_0x46b008=_[_0x44b8('0x39')]({},_0x46b008,_0x26265f[_0x44b8('0x3a')]);return db[_0x44b8('0x29')][_0x44b8('0x1e')](_0x46b008)['then'](handleEntityNotFound(_0x339f0f,null))[_0x44b8('0x13')](respondWithResult(_0x339f0f,null))[_0x44b8('0x2d')](handleError(_0x339f0f,null));};exports[_0x44b8('0x3b')]=function(_0x1ee3cc,_0x9cb2a){return db[_0x44b8('0x29')][_0x44b8('0x3b')](_0x1ee3cc[_0x44b8('0x3c')],{})[_0x44b8('0x13')](function(_0x3d1be1){var _0x1c9983=_0x1ee3cc[_0x44b8('0x3d')][_0x44b8('0x14')]({'plain':!![]});if(!_0x1c9983)throw new Error(_0x44b8('0x3e'));if(_0x1c9983[_0x44b8('0x3f')]===_0x44b8('0x3d')){var _0x57d8c4=_0x3d1be1[_0x44b8('0x14')]({'plain':!![]});var _0x43e43a=[{'name':_0x44b8('0x15'),'value':'inbound'},{'name':_0x44b8('0x17'),'value':_0x44b8('0x18')}];var _0x229cc9=_['find'](_0x43e43a,[_0x44b8('0x1c'),_0x57d8c4[_0x44b8('0x1d')]])[_0x44b8('0x21')];return db[_0x44b8('0x40')][_0x44b8('0x1e')]({'where':{'name':_0x229cc9,'userProfileId':_0x1c9983['userProfileId']},'raw':!![]})['then'](function(_0x215f7b){if(_0x215f7b&&_0x215f7b[_0x44b8('0x41')]===0x0){return db[_0x44b8('0x1f')][_0x44b8('0x3b')]({'name':_0x57d8c4[_0x44b8('0x21')],'resourceId':_0x57d8c4['id'],'type':_0x215f7b[_0x44b8('0x21')],'sectionId':_0x215f7b['id']},{})[_0x44b8('0x13')](function(){return _0x3d1be1;});}else{return _0x3d1be1;}})[_0x44b8('0x2d')](function(_0x455fd6){logger[_0x44b8('0x42')](_0x44b8('0x43'),_0x455fd6);throw _0x455fd6;});}return _0x3d1be1;})[_0x44b8('0x13')](respondWithResult(_0x9cb2a,0xc9))[_0x44b8('0x2d')](handleError(_0x9cb2a,null));};exports[_0x44b8('0x44')]=function(_0x149731,_0x60eeb2){var _0xce06dc={'where':{'id':_0x149731[_0x44b8('0x2f')]['id']}},_0x3b3d5d={};_0x3b3d5d['model']=_['keys'](db[_0x44b8('0x29')][_0x44b8('0x24')]);_0xce06dc[_0x44b8('0x35')]=_[_0x44b8('0x34')](_0x3b3d5d[_0x44b8('0x30')],qs[_0x44b8('0x36')](_0x149731[_0x44b8('0x32')]['fields']));_0xce06dc[_0x44b8('0x35')]=_0xce06dc['attributes'][_0x44b8('0x37')]?_0xce06dc[_0x44b8('0x35')]:_0x3b3d5d[_0x44b8('0x30')];if(_0x149731[_0x44b8('0x32')][_0x44b8('0x38')]){_0xce06dc[_0x44b8('0x2a')]=[{'all':!![]}];}_0xce06dc=_['merge']({},_0xce06dc,_0x149731[_0x44b8('0x3a')]);return db[_0x44b8('0x29')][_0x44b8('0x1e')](_0xce06dc)[_0x44b8('0x13')](handleEntityNotFound(_0x60eeb2,null))['then'](function(_0x4e4ed1){if(_0x4e4ed1){var _0x2f549d=_0x4e4ed1[_0x44b8('0x14')]({'plain':!![]});_0x2f549d=qs[_0x44b8('0x45')](_0x2f549d,['id',_0x44b8('0x46'),_0x44b8('0x47')]);_0x149731['body']=_[_0x44b8('0x45')](_0x149731[_0x44b8('0x3c')],['id',_0x44b8('0x46'),_0x44b8('0x47')]);return db[_0x44b8('0x29')]['create'](_['merge'](_0x2f549d,_0x149731[_0x44b8('0x3c')]),{'include':_0x149731['query'][_0x44b8('0x38')]?[{'all':!![]}]:undefined})['then'](function(_0x40164d){var _0x434d6a=_0x149731[_0x44b8('0x3d')][_0x44b8('0x14')]({'plain':!![]});if(!_0x434d6a)throw new Error(_0x44b8('0x3e'));if(_0x434d6a[_0x44b8('0x3f')]===_0x44b8('0x3d')){var _0x533967=_0x40164d[_0x44b8('0x14')]({'plain':!![]});var _0x37b2c2=[{'name':_0x44b8('0x15'),'value':'inbound'},{'name':_0x44b8('0x17'),'value':_0x44b8('0x18')}];var _0x45f9a0=_[_0x44b8('0x1e')](_0x37b2c2,['value',_0x533967[_0x44b8('0x1d')]])[_0x44b8('0x21')];return db['UserProfileSection'][_0x44b8('0x1e')]({'where':{'name':_0x45f9a0,'userProfileId':_0x434d6a[_0x44b8('0x48')]},'raw':!![]})[_0x44b8('0x13')](function(_0x3df6aa){if(_0x3df6aa&&_0x3df6aa[_0x44b8('0x41')]===0x0){return db['UserProfileResource']['create']({'name':_0x533967[_0x44b8('0x21')],'resourceId':_0x533967['id'],'type':_0x3df6aa[_0x44b8('0x21')],'sectionId':_0x3df6aa['id']},{})[_0x44b8('0x13')](function(){return _0x40164d;});}else{return _0x40164d;}})[_0x44b8('0x2d')](function(_0x765e45){logger[_0x44b8('0x42')](_0x44b8('0x43'),_0x765e45);throw _0x765e45;});}return _0x40164d;});}})[_0x44b8('0x13')](respondWithResult(_0x60eeb2,0xc9))[_0x44b8('0x2d')](handleError(_0x60eeb2,null));};exports[_0x44b8('0x11')]=function(_0x16c628,_0x3f7576){if(_0x16c628['body']['id']){delete _0x16c628[_0x44b8('0x3c')]['id'];}return db[_0x44b8('0x29')][_0x44b8('0x1e')]({'where':{'id':_0x16c628[_0x44b8('0x2f')]['id']}})[_0x44b8('0x13')](handleEntityNotFound(_0x3f7576,null))[_0x44b8('0x13')](saveUpdates(_0x16c628[_0x44b8('0x3c')],null))[_0x44b8('0x13')](respondWithResult(_0x3f7576,null))[_0x44b8('0x2d')](handleError(_0x3f7576,null));};exports[_0x44b8('0x12')]=function(_0x2ecff9,_0x15bcba){return db[_0x44b8('0x29')][_0x44b8('0x1e')]({'where':{'id':_0x2ecff9[_0x44b8('0x2f')]['id']}})[_0x44b8('0x13')](handleEntityNotFound(_0x15bcba,null))[_0x44b8('0x13')](removeEntity(_0x15bcba,null))[_0x44b8('0x2d')](handleError(_0x15bcba,null));};exports['getHoppers']=function(_0x1ec516,_0x3aac51){var _0x10e519={'raw':![],'where':{}};var _0x2b37e={};var _0x51f763={'count':0x0,'rows':[]};return db[_0x44b8('0x29')][_0x44b8('0x49')]({'where':{'id':_0x1ec516['params']['id']}})[_0x44b8('0x13')](handleEntityNotFound(_0x3aac51,null))[_0x44b8('0x13')](function(_0x5df821){if(_0x5df821){_0x2b37e[_0x44b8('0x30')]=_[_0x44b8('0x31')](db['CmHopper'][_0x44b8('0x24')]);_0x2b37e[_0x44b8('0x32')]=_[_0x44b8('0x31')](_0x1ec516['query']);_0x2b37e[_0x44b8('0x33')]=_['intersection'](_0x2b37e[_0x44b8('0x30')],_0x2b37e['query']);_0x10e519[_0x44b8('0x35')]=_[_0x44b8('0x34')](_0x2b37e[_0x44b8('0x30')],qs[_0x44b8('0x36')](_0x1ec516[_0x44b8('0x32')][_0x44b8('0x36')]));_0x10e519['attributes']=_0x10e519[_0x44b8('0x35')]['length']?_0x10e519[_0x44b8('0x35')]:_0x2b37e[_0x44b8('0x30')];if(!_0x1ec516['query'][_0x44b8('0x4a')](_0x44b8('0x4b'))){_0x10e519[_0x44b8('0x10')]=qs[_0x44b8('0x10')](_0x1ec516[_0x44b8('0x32')][_0x44b8('0x10')]);_0x10e519[_0x44b8('0xf')]=qs[_0x44b8('0xf')](_0x1ec516[_0x44b8('0x32')][_0x44b8('0xf')]);}_0x10e519[_0x44b8('0x4c')]=qs[_0x44b8('0x4d')](_0x1ec516['query'][_0x44b8('0x4d')]);_0x10e519[_0x44b8('0x28')]=qs[_0x44b8('0x33')](_['pick'](_0x1ec516[_0x44b8('0x32')],_0x2b37e[_0x44b8('0x33')]));_0x10e519['where'][_0x44b8('0x4e')]=_0x5df821['id'];if(_0x1ec516[_0x44b8('0x32')][_0x44b8('0x19')]){_0x10e519[_0x44b8('0x28')]=_[_0x44b8('0x39')](_0x10e519['where'],{'$or':_[_0x44b8('0x1b')](_0x10e519[_0x44b8('0x35')],function(_0x279753){var _0x270224={};_0x270224[_0x279753]={'$like':'%'+_0x1ec516[_0x44b8('0x32')][_0x44b8('0x19')]+'%'};return _0x270224;})});}_0x10e519=_[_0x44b8('0x39')]({},_0x10e519,_0x1ec516[_0x44b8('0x3a')]);return db['CmHopper'][_0x44b8('0xe')]({'where':_0x10e519[_0x44b8('0x28')]})[_0x44b8('0x13')](function(_0x3ce76e){_0x51f763['count']=_0x3ce76e;if(_0x1ec516['query']['includeAll']){_0x10e519[_0x44b8('0x2a')]=[{'all':!![]}];}return db[_0x44b8('0x4f')][_0x44b8('0x2b')](_0x10e519);})[_0x44b8('0x13')](function(_0x32e630){_0x51f763['rows']=_0x32e630;return _0x51f763;});}})[_0x44b8('0x13')](respondWithFilteredResult(_0x3aac51,_0x10e519))['catch'](handleError(_0x3aac51,null));};exports[_0x44b8('0x50')]=function(_0x155bcf,_0xea2c3e){var _0x5da034={'raw':!![],'where':{}};var _0x4cac12={};var _0xb4c6dc={'count':0x0,'rows':[]};return db[_0x44b8('0x29')][_0x44b8('0x49')]({'where':{'id':_0x155bcf['params']['id']}})[_0x44b8('0x13')](handleEntityNotFound(_0xea2c3e,null))[_0x44b8('0x13')](function(_0x1258c2){if(_0x1258c2){_0x4cac12[_0x44b8('0x30')]=_[_0x44b8('0x31')](db['CmHopperHistory'][_0x44b8('0x24')]);_0x4cac12[_0x44b8('0x32')]=_[_0x44b8('0x31')](_0x155bcf[_0x44b8('0x32')]);_0x4cac12[_0x44b8('0x33')]=_['intersection'](_0x4cac12[_0x44b8('0x30')],_0x4cac12[_0x44b8('0x32')]);_0x5da034[_0x44b8('0x35')]=_[_0x44b8('0x34')](_0x4cac12[_0x44b8('0x30')],qs[_0x44b8('0x36')](_0x155bcf[_0x44b8('0x32')]['fields']));_0x5da034[_0x44b8('0x35')]=_0x5da034[_0x44b8('0x35')]['length']?_0x5da034[_0x44b8('0x35')]:_0x4cac12[_0x44b8('0x30')];if(!_0x155bcf['query'][_0x44b8('0x4a')]('nolimit')){_0x5da034['limit']=qs[_0x44b8('0x10')](_0x155bcf[_0x44b8('0x32')][_0x44b8('0x10')]);_0x5da034['offset']=qs['offset'](_0x155bcf['query'][_0x44b8('0xf')]);}_0x5da034[_0x44b8('0x4c')]=qs[_0x44b8('0x4d')](_0x155bcf[_0x44b8('0x32')][_0x44b8('0x4d')]);_0x5da034[_0x44b8('0x28')]=qs[_0x44b8('0x33')](_[_0x44b8('0x51')](_0x155bcf['query'],_0x4cac12[_0x44b8('0x33')]));_0x5da034['where']['VoiceQueueId']=_0x1258c2['id'];if(_0x155bcf['query'][_0x44b8('0x19')]){_0x5da034['where']=_[_0x44b8('0x39')](_0x5da034[_0x44b8('0x28')],{'$or':_[_0x44b8('0x1b')](_0x5da034[_0x44b8('0x35')],function(_0x3a9780){var _0x245ba3={};_0x245ba3[_0x3a9780]={'$like':'%'+_0x155bcf[_0x44b8('0x32')][_0x44b8('0x19')]+'%'};return _0x245ba3;})});}_0x5da034=_['merge']({},_0x5da034,_0x155bcf[_0x44b8('0x3a')]);return db[_0x44b8('0x52')][_0x44b8('0xe')]({'where':_0x5da034[_0x44b8('0x28')]})[_0x44b8('0x13')](function(_0xee44b3){_0xb4c6dc[_0x44b8('0xe')]=_0xee44b3;if(_0x155bcf[_0x44b8('0x32')][_0x44b8('0x38')]){_0x5da034['include']=[{'all':!![]}];}return db['CmHopperHistory'][_0x44b8('0x2b')](_0x5da034);})['then'](function(_0x531d65){_0xb4c6dc[_0x44b8('0x2c')]=_0x531d65;return _0xb4c6dc;});}})[_0x44b8('0x13')](respondWithFilteredResult(_0xea2c3e,_0x5da034))['catch'](handleError(_0xea2c3e,null));};exports['getHopperFinals']=function(_0x4b22e7,_0x2e0289){var _0x4860af={'raw':!![],'where':{}};var _0x353ff1={};var _0x2812da={'count':0x0,'rows':[]};return db[_0x44b8('0x29')][_0x44b8('0x49')]({'where':{'id':_0x4b22e7[_0x44b8('0x2f')]['id']}})[_0x44b8('0x13')](handleEntityNotFound(_0x2e0289,null))[_0x44b8('0x13')](function(_0x3a7229){if(_0x3a7229){_0x353ff1[_0x44b8('0x30')]=_[_0x44b8('0x31')](db[_0x44b8('0x53')][_0x44b8('0x24')]);_0x353ff1[_0x44b8('0x32')]=_[_0x44b8('0x31')](_0x4b22e7['query']);_0x353ff1[_0x44b8('0x33')]=_[_0x44b8('0x34')](_0x353ff1[_0x44b8('0x30')],_0x353ff1[_0x44b8('0x32')]);_0x4860af[_0x44b8('0x35')]=_[_0x44b8('0x34')](_0x353ff1[_0x44b8('0x30')],qs[_0x44b8('0x36')](_0x4b22e7[_0x44b8('0x32')][_0x44b8('0x36')]));_0x4860af[_0x44b8('0x35')]=_0x4860af[_0x44b8('0x35')][_0x44b8('0x37')]?_0x4860af['attributes']:_0x353ff1[_0x44b8('0x30')];if(!_0x4b22e7[_0x44b8('0x32')][_0x44b8('0x4a')]('nolimit')){_0x4860af['limit']=qs[_0x44b8('0x10')](_0x4b22e7[_0x44b8('0x32')][_0x44b8('0x10')]);_0x4860af['offset']=qs[_0x44b8('0xf')](_0x4b22e7[_0x44b8('0x32')][_0x44b8('0xf')]);}_0x4860af[_0x44b8('0x4c')]=qs[_0x44b8('0x4d')](_0x4b22e7[_0x44b8('0x32')][_0x44b8('0x4d')]);_0x4860af[_0x44b8('0x28')]=qs['filters'](_[_0x44b8('0x51')](_0x4b22e7[_0x44b8('0x32')],_0x353ff1[_0x44b8('0x33')]));_0x4860af[_0x44b8('0x28')][_0x44b8('0x4e')]=_0x3a7229['id'];if(_0x4b22e7[_0x44b8('0x32')][_0x44b8('0x19')]){_0x4860af['where']=_['merge'](_0x4860af['where'],{'$or':_[_0x44b8('0x1b')](_0x4860af[_0x44b8('0x35')],function(_0x2d74ee){var _0x312f4c={};_0x312f4c[_0x2d74ee]={'$like':'%'+_0x4b22e7[_0x44b8('0x32')][_0x44b8('0x19')]+'%'};return _0x312f4c;})});}_0x4860af=_[_0x44b8('0x39')]({},_0x4860af,_0x4b22e7[_0x44b8('0x3a')]);return db[_0x44b8('0x53')]['count']({'where':_0x4860af[_0x44b8('0x28')]})[_0x44b8('0x13')](function(_0x4b8036){_0x2812da['count']=_0x4b8036;if(_0x4b22e7[_0x44b8('0x32')]['includeAll']){_0x4860af[_0x44b8('0x2a')]=[{'all':!![]}];}return db[_0x44b8('0x53')][_0x44b8('0x2b')](_0x4860af);})['then'](function(_0x3f4a2a){_0x2812da[_0x44b8('0x2c')]=_0x3f4a2a;return _0x2812da;});}})[_0x44b8('0x13')](respondWithFilteredResult(_0x2e0289,_0x4860af))[_0x44b8('0x2d')](handleError(_0x2e0289,null));};exports['getHopperBlacks']=function(_0x216030,_0x584ae3){var _0x38c0c5={'raw':!![],'where':{}};var _0x2f2923={};var _0x2d9d62={'count':0x0,'rows':[]};return db[_0x44b8('0x29')][_0x44b8('0x49')]({'where':{'id':_0x216030[_0x44b8('0x2f')]['id']}})[_0x44b8('0x13')](handleEntityNotFound(_0x584ae3,null))['then'](function(_0x4d3b82){if(_0x4d3b82){_0x2f2923['model']=_[_0x44b8('0x31')](db[_0x44b8('0x54')][_0x44b8('0x24')]);_0x2f2923[_0x44b8('0x32')]=_[_0x44b8('0x31')](_0x216030[_0x44b8('0x32')]);_0x2f2923[_0x44b8('0x33')]=_[_0x44b8('0x34')](_0x2f2923[_0x44b8('0x30')],_0x2f2923[_0x44b8('0x32')]);_0x38c0c5[_0x44b8('0x35')]=_[_0x44b8('0x34')](_0x2f2923[_0x44b8('0x30')],qs[_0x44b8('0x36')](_0x216030[_0x44b8('0x32')][_0x44b8('0x36')]));_0x38c0c5[_0x44b8('0x35')]=_0x38c0c5[_0x44b8('0x35')]['length']?_0x38c0c5[_0x44b8('0x35')]:_0x2f2923['model'];if(!_0x216030[_0x44b8('0x32')]['hasOwnProperty']('nolimit')){_0x38c0c5[_0x44b8('0x10')]=qs['limit'](_0x216030['query']['limit']);_0x38c0c5['offset']=qs['offset'](_0x216030[_0x44b8('0x32')][_0x44b8('0xf')]);}_0x38c0c5[_0x44b8('0x4c')]=qs[_0x44b8('0x4d')](_0x216030['query'][_0x44b8('0x4d')]);_0x38c0c5[_0x44b8('0x28')]=qs['filters'](_['pick'](_0x216030[_0x44b8('0x32')],_0x2f2923[_0x44b8('0x33')]));_0x38c0c5[_0x44b8('0x28')]['VoiceQueueId']=_0x4d3b82['id'];if(_0x216030[_0x44b8('0x32')][_0x44b8('0x19')]){_0x38c0c5[_0x44b8('0x28')]=_[_0x44b8('0x39')](_0x38c0c5[_0x44b8('0x28')],{'$or':_[_0x44b8('0x1b')](_0x38c0c5[_0x44b8('0x35')],function(_0x16344b){var _0x21057f={};_0x21057f[_0x16344b]={'$like':'%'+_0x216030['query'][_0x44b8('0x19')]+'%'};return _0x21057f;})});}_0x38c0c5=_[_0x44b8('0x39')]({},_0x38c0c5,_0x216030['options']);return db[_0x44b8('0x54')][_0x44b8('0xe')]({'where':_0x38c0c5[_0x44b8('0x28')]})['then'](function(_0x3a09e4){_0x2d9d62['count']=_0x3a09e4;if(_0x216030[_0x44b8('0x32')][_0x44b8('0x38')]){_0x38c0c5['include']=[{'all':!![]}];}return db[_0x44b8('0x54')][_0x44b8('0x2b')](_0x38c0c5);})[_0x44b8('0x13')](function(_0x37871e){_0x2d9d62['rows']=_0x37871e;return _0x2d9d62;});}})[_0x44b8('0x13')](respondWithFilteredResult(_0x584ae3,_0x38c0c5))[_0x44b8('0x2d')](handleError(_0x584ae3,null));};exports[_0x44b8('0x55')]=function(_0x35d46c,_0x2d4a8a){var _0x1d666e={};var _0x10a66a={};var _0x1e608f;var _0x470f90;return db['VoiceQueue']['findOne']({'where':{'id':_0x35d46c[_0x44b8('0x2f')]['id']}})[_0x44b8('0x13')](handleEntityNotFound(_0x2d4a8a,null))[_0x44b8('0x13')](function(_0x3539f9){if(_0x3539f9){_0x1e608f=_0x3539f9;_0x10a66a[_0x44b8('0x30')]=_['keys'](db[_0x44b8('0x56')]['rawAttributes']);_0x10a66a[_0x44b8('0x32')]=_['keys'](_0x35d46c[_0x44b8('0x32')]);_0x10a66a[_0x44b8('0x33')]=_[_0x44b8('0x34')](_0x10a66a[_0x44b8('0x30')],_0x10a66a[_0x44b8('0x32')]);_0x1d666e[_0x44b8('0x35')]=_[_0x44b8('0x34')](_0x10a66a[_0x44b8('0x30')],qs[_0x44b8('0x36')](_0x35d46c['query'][_0x44b8('0x36')]));_0x1d666e[_0x44b8('0x35')]=_0x1d666e[_0x44b8('0x35')][_0x44b8('0x37')]?_0x1d666e['attributes']:_0x10a66a['model'];_0x1d666e['order']=qs[_0x44b8('0x4d')](_0x35d46c['query']['sort']);_0x1d666e[_0x44b8('0x28')]=qs[_0x44b8('0x33')](_[_0x44b8('0x51')](_0x35d46c[_0x44b8('0x32')],_0x10a66a[_0x44b8('0x33')]));if(_0x35d46c[_0x44b8('0x32')][_0x44b8('0x19')]){_0x1d666e[_0x44b8('0x28')]=_['merge'](_0x1d666e[_0x44b8('0x28')],{'$or':_[_0x44b8('0x1b')](_0x1d666e[_0x44b8('0x35')],function(_0x2594bf){var _0x5f0c0c={};_0x5f0c0c[_0x2594bf]={'$like':'%'+_0x35d46c[_0x44b8('0x32')][_0x44b8('0x19')]+'%'};return _0x5f0c0c;})});}_0x1d666e=_[_0x44b8('0x39')]({},_0x1d666e,_0x35d46c['options']);return _0x1e608f['getTeams'](_0x1d666e);}})[_0x44b8('0x13')](function(_0xae9b10){if(_0xae9b10){_0x470f90=_0xae9b10[_0x44b8('0x37')];if(!_0x35d46c[_0x44b8('0x32')][_0x44b8('0x4a')]('nolimit')){_0x1d666e[_0x44b8('0x10')]=qs[_0x44b8('0x10')](_0x35d46c['query'][_0x44b8('0x10')]);_0x1d666e[_0x44b8('0xf')]=qs[_0x44b8('0xf')](_0x35d46c[_0x44b8('0x32')]['offset']);}return _0x1e608f[_0x44b8('0x55')](_0x1d666e);}})['then'](function(_0x4464d3){if(_0x4464d3){return _0x4464d3?{'count':_0x470f90,'rows':_0x4464d3}:null;}})[_0x44b8('0x13')](respondWithResult(_0x2d4a8a,null))[_0x44b8('0x2d')](handleError(_0x2d4a8a,null));};exports[_0x44b8('0x57')]=function(_0x45ff62,_0x343c5c){var _0x3cb290=_0x45ff62[_0x44b8('0x3c')]['teams'];var _0x2d27bf=_[_0x44b8('0x1b')](_0x3cb290,'id');return db[_0x44b8('0x56')][_0x44b8('0x2b')]({'where':{'id':_0x2d27bf},'attributes':['id'],'include':[{'model':db[_0x44b8('0x58')],'as':_0x44b8('0x59'),'attributes':['id','name','online',_0x44b8('0x5a'),_0x44b8('0x5b')],'raw':!![]}]})['then'](function(_0x41f732){if(_0x41f732){var _0x16074e=_['flatMap'](_0x41f732,function(_0x1ec23e){var _0x3208b4=_0x1ec23e[_0x44b8('0x14')]({'plain':!![]});_0x3208b4[_0x44b8('0x59')][_0x44b8('0x5c')](function(_0x43f416){_0x43f416[_0x44b8('0x5d')]=_[_0x44b8('0x1e')](_0x3cb290,{'id':_0x3208b4['id']})[_0x44b8('0x5d')];});return _0x3208b4[_0x44b8('0x59')];});return db[_0x44b8('0x29')][_0x44b8('0x1e')]({'where':{'id':_0x45ff62[_0x44b8('0x2f')]['id']}})[_0x44b8('0x13')](function(_0x15365d){return db['sequelize'][_0x44b8('0x5e')](function(_0x3d92a9){return _0x15365d[_0x44b8('0x57')](_0x2d27bf,{'transaction':_0x3d92a9})[_0x44b8('0x13')](function(){return BPromise['each'](_0x3cb290,function(_0x611876){return db[_0x44b8('0x5f')]['upsert']({'TeamId':_0x611876['id'],'VoiceQueueId':_0x45ff62[_0x44b8('0x2f')]['id'],'penalty':_0x611876['penalty']},{'transaction':_0x3d92a9});});})[_0x44b8('0x13')](function(){return BPromise[_0x44b8('0x60')](_0x16074e,function(_0x5a508f){return db[_0x44b8('0x61')]['findOrCreate']({'where':{'UserId':_0x5a508f['id'],'VoiceQueueId':_0x45ff62['params']['id']},'defaults':{'penalty':_0x5a508f[_0x44b8('0x5d')]},'transaction':_0x3d92a9});});})[_0x44b8('0x13')](function(){return BPromise['each'](_['filter'](_0x16074e,{'online':!![]}),function(_0x52af57){return db[_0x44b8('0x62')][_0x44b8('0x63')]({'membername':_0x52af57[_0x44b8('0x21')],'UserId':_0x52af57['id'],'queue_name':_0x15365d['name'],'VoiceQueueId':_0x15365d['id'],'interface':_['isNil'](_0x52af57[_0x44b8('0x5b')])?util[_0x44b8('0x64')](_0x44b8('0x65'),_0x52af57[_0x44b8('0x21')]):_0x52af57[_0x44b8('0x5b')],'paused':_0x52af57[_0x44b8('0x5a')]||![],'penalty':_0x52af57[_0x44b8('0x5d')]},{'transaction':_0x3d92a9});});})[_0x44b8('0x13')](function(){_0x16074e[_0x44b8('0x5c')](function(_0x4ed62f){socket[_0x44b8('0x66')]('userVoiceQueue:save',{'UserId':_0x4ed62f['id'],'VoiceQueueId':_0x15365d['id']});});});});});}})[_0x44b8('0x13')](respondWithStatusCode(_0x343c5c,null))['catch'](handleError(_0x343c5c,null));};exports['removeTeams']=function(_0x1fb070,_0x224071){return db[_0x44b8('0x56')][_0x44b8('0x2b')]({'where':{'id':_0x1fb070[_0x44b8('0x32')][_0x44b8('0x67')]},'attributes':['id'],'include':[{'model':db[_0x44b8('0x58')],'as':_0x44b8('0x59'),'attributes':['id'],'raw':!![]}]})[_0x44b8('0x13')](handleEntityNotFound(_0x224071,null))['then'](function(_0x1eb0a8){var _0x1e3b5f=_[_0x44b8('0x1b')](_0x1eb0a8,'id');var _0x536d1d=[];var _0x5bc747=[];var _0x3e44ea=squel['select']();_0x3e44ea[_0x44b8('0x68')]('tq.TeamId')[_0x44b8('0x69')]('team_has_voice_queues','tq')['join'](_0x44b8('0x6a'),'ut',_0x44b8('0x6b'))['where'](_0x44b8('0x6c'),_0x1fb070[_0x44b8('0x2f')]['id']);for(var _0x276dfc=0x0;_0x276dfc<_0x1eb0a8[_0x44b8('0x37')];_0x276dfc+=0x1){let _0x291617=_0x1eb0a8[_0x276dfc];for(var _0x57b73f=0x0;_0x57b73f<_0x291617[_0x44b8('0x59')]['length'];_0x57b73f+=0x1){let _0x595af5=_0x291617['Agents'][_0x57b73f];var _0x3015f9=_0x3e44ea[_0x44b8('0x44')]();_0x3015f9['where'](_0x44b8('0x6d'),_0x595af5['id']);_0x5bc747[_0x44b8('0x6e')](db['sequelize']['query'](_0x3015f9[_0x44b8('0x6f')](),{'type':db[_0x44b8('0x70')]['QueryTypes'][_0x44b8('0x71')]})[_0x44b8('0x13')](function(_0x5e2d3b){if(_0x5e2d3b[_0x44b8('0x37')]===0x1){return _0x595af5['id'];}else{var _0x97f4=_['every'](_[_0x44b8('0x1b')](_0x5e2d3b,_0x44b8('0x72')),function(_0xdb42f2){return _['includes'](_0x1e3b5f,_0xdb42f2);});if(_0x97f4){return _0x595af5['id'];}}}));}}return BPromise[_0x44b8('0x73')](_0x5bc747)['then'](function(_0x2ea49d){_0x536d1d=_(_0x536d1d)['union'](_0x2ea49d)['compact']()[_0x44b8('0x1c')]();return db[_0x44b8('0x29')][_0x44b8('0x1e')]({'where':{'id':_0x1fb070[_0x44b8('0x2f')]['id']}})[_0x44b8('0x13')](function(_0x1db2cf){return db[_0x44b8('0x70')][_0x44b8('0x5e')](function(_0x1b7826){return _0x1db2cf[_0x44b8('0x74')](_0x1fb070[_0x44b8('0x32')]['ids'],{'transaction':_0x1b7826})[_0x44b8('0x13')](function(){if(!_[_0x44b8('0x75')](_0x536d1d)){return _0x1db2cf[_0x44b8('0x76')](_0x536d1d,{'transaction':_0x1b7826})[_0x44b8('0x13')](function(){return db[_0x44b8('0x62')][_0x44b8('0x12')]({'where':{'VoiceQueueId':_0x1fb070[_0x44b8('0x2f')]['id'],'UserId':_0x536d1d},'transaction':_0x1b7826});});}})[_0x44b8('0x13')](function(){_0x536d1d['forEach'](function(_0x4234bc){socket[_0x44b8('0x66')]('userVoiceQueue:remove',{'UserId':_0x4234bc,'VoiceQueueId':_0x1db2cf['id']});});});});});});})[_0x44b8('0x13')](respondWithStatusCode(_0x224071,null))[_0x44b8('0x2d')](handleError(_0x224071,null));};exports[_0x44b8('0x77')]=function(_0x5596c0,_0x4b2b8f){var _0x18cd30,_0x133da8;return db['VoiceQueue']['find']({'where':{'id':_0x5596c0[_0x44b8('0x2f')]['id']}})[_0x44b8('0x13')](handleEntityNotFound(_0x4b2b8f,null))[_0x44b8('0x13')](function(_0x2bccf9){if(_0x2bccf9){_0x133da8=_0x2bccf9;return _0x2bccf9[_0x44b8('0x77')](_0x5596c0['body'][_0x44b8('0x67')],_['omit'](_0x5596c0[_0x44b8('0x3c')],[_0x44b8('0x67'),'id'])||{})[_0x44b8('0x78')](function(_0x156a60){for(var _0x3cbec9=0x0;_0x3cbec9<_0x5596c0[_0x44b8('0x3c')]['ids'][_0x44b8('0x37')];_0x3cbec9+=0x1){socket['emit'](_0x44b8('0x79'),{'UserId':Number(_0x5596c0[_0x44b8('0x3c')]['ids'][_0x3cbec9]),'VoiceQueueId':Number(_0x5596c0[_0x44b8('0x2f')]['id'])});}return _0x156a60;});}})['then'](function(_0x42b0c9){_0x18cd30=_0x42b0c9||[];if(_0x133da8){return db[_0x44b8('0x58')][_0x44b8('0x2b')]({'where':{'id':_0x5596c0['body'][_0x44b8('0x67')]},'attributes':['id',_0x44b8('0x21'),'online',_0x44b8('0x5a'),'interface'],'raw':!![]});}})['then'](function(_0x4220b5){if(!_['isEmpty'](_0x4220b5)){var _0x336436=[];for(var _0x51add5=0x0;_0x51add5<_0x4220b5[_0x44b8('0x37')];_0x51add5++){if(_0x4220b5[_0x51add5][_0x44b8('0x7a')]){_0x336436['push'](db[_0x44b8('0x62')][_0x44b8('0x63')]({'membername':_0x4220b5[_0x51add5]['name'],'UserId':_0x4220b5[_0x51add5]['id'],'queue_name':_0x133da8['name'],'VoiceQueueId':_0x133da8['id'],'interface':_[_0x44b8('0x7b')](_0x4220b5[_0x51add5][_0x44b8('0x5b')])?util[_0x44b8('0x64')](_0x44b8('0x65'),_0x4220b5[_0x51add5]['name']):_0x4220b5[_0x51add5][_0x44b8('0x5b')],'paused':_0x4220b5[_0x51add5][_0x44b8('0x5a')]||![],'penalty':_0x5596c0[_0x44b8('0x3c')][_0x44b8('0x5d')]||0x0}));}}return BPromise['all'](_0x336436);}})['then'](function(){return _0x18cd30;})[_0x44b8('0x13')](respondWithResult(_0x4b2b8f,null))[_0x44b8('0x2d')](handleError(_0x4b2b8f,null));};exports[_0x44b8('0x76')]=function(_0x4cf4a0,_0x1443bd){return db[_0x44b8('0x29')]['find']({'where':{'id':_0x4cf4a0[_0x44b8('0x2f')]['id']}})[_0x44b8('0x13')](handleEntityNotFound(_0x1443bd,null))[_0x44b8('0x13')](function(_0x2cb698){if(_0x2cb698){return _0x2cb698[_0x44b8('0x76')](_0x4cf4a0[_0x44b8('0x32')]['ids'])['then'](function(){if(_[_0x44b8('0x7c')](_0x4cf4a0['query'][_0x44b8('0x67')])){for(var _0x4dc333=0x0;_0x4dc333<_0x4cf4a0[_0x44b8('0x32')][_0x44b8('0x67')][_0x44b8('0x37')];_0x4dc333+=0x1){socket[_0x44b8('0x66')](_0x44b8('0x7d'),{'UserId':Number(_0x4cf4a0[_0x44b8('0x32')][_0x44b8('0x67')][_0x4dc333]),'VoiceQueueId':Number(_0x4cf4a0[_0x44b8('0x2f')]['id'])});}}else{socket[_0x44b8('0x66')](_0x44b8('0x7d'),{'UserId':Number(_0x4cf4a0[_0x44b8('0x32')][_0x44b8('0x67')]),'VoiceQueueId':Number(_0x4cf4a0[_0x44b8('0x2f')]['id'])});}});}})[_0x44b8('0x13')](function(_0x4026d7){return db[_0x44b8('0x62')]['destroy']({'where':{'VoiceQueueId':_0x4cf4a0[_0x44b8('0x2f')]['id'],'UserId':_0x4cf4a0['query'][_0x44b8('0x67')]}})[_0x44b8('0x13')](function(){return _0x4026d7;});})[_0x44b8('0x13')](respondWithStatusCode(_0x1443bd,null))[_0x44b8('0x2d')](handleError(_0x1443bd,null));};exports[_0x44b8('0x7e')]=function(_0x22e5ae,_0x2f3340){var _0x4d98de={};var _0x597139={};var _0x2fffd5;var _0x3c90c2;return db[_0x44b8('0x29')][_0x44b8('0x49')]({'where':{'id':_0x22e5ae[_0x44b8('0x2f')]['id']}})['then'](handleEntityNotFound(_0x2f3340,null))[_0x44b8('0x13')](function(_0x208c53){if(_0x208c53){_0x2fffd5=_0x208c53;_0x597139[_0x44b8('0x30')]=_[_0x44b8('0x31')](db[_0x44b8('0x58')][_0x44b8('0x24')]);_0x597139['query']=_[_0x44b8('0x31')](_0x22e5ae[_0x44b8('0x32')]);_0x597139[_0x44b8('0x33')]=_[_0x44b8('0x34')](_0x597139[_0x44b8('0x30')],_0x597139['query']);_0x4d98de['attributes']=_[_0x44b8('0x34')](_0x597139[_0x44b8('0x30')],qs['fields'](_0x22e5ae['query'][_0x44b8('0x36')]));_0x4d98de['attributes']=_0x4d98de[_0x44b8('0x35')][_0x44b8('0x37')]?_0x4d98de[_0x44b8('0x35')]:_0x597139[_0x44b8('0x30')];_0x4d98de[_0x44b8('0x4c')]=qs[_0x44b8('0x4d')](_0x22e5ae[_0x44b8('0x32')][_0x44b8('0x4d')]);_0x4d98de['where']=qs[_0x44b8('0x33')](_[_0x44b8('0x51')](_0x22e5ae[_0x44b8('0x32')],_0x597139['filters']));if(_0x22e5ae[_0x44b8('0x32')][_0x44b8('0x19')]){_0x4d98de['where']=_['merge'](_0x4d98de['where'],{'$or':_['map'](_0x4d98de[_0x44b8('0x35')],function(_0x5e423c){var _0x48065d={};_0x48065d[_0x5e423c]={'$like':'%'+_0x22e5ae[_0x44b8('0x32')][_0x44b8('0x19')]+'%'};return _0x48065d;})});}_0x4d98de=_[_0x44b8('0x39')]({},_0x4d98de,_0x22e5ae['options']);return _0x2fffd5[_0x44b8('0x7e')](_0x4d98de);}})['then'](function(_0x230407){if(_0x230407){_0x3c90c2=_0x230407[_0x44b8('0x37')];if(!_0x22e5ae[_0x44b8('0x32')][_0x44b8('0x4a')]('nolimit')){_0x4d98de[_0x44b8('0x10')]=qs[_0x44b8('0x10')](_0x22e5ae[_0x44b8('0x32')][_0x44b8('0x10')]);_0x4d98de['offset']=qs['offset'](_0x22e5ae[_0x44b8('0x32')][_0x44b8('0xf')]);}return _0x2fffd5['getAgents'](_0x4d98de);}})[_0x44b8('0x13')](function(_0x188744){if(_0x188744){return _0x188744?{'count':_0x3c90c2,'rows':_0x188744}:null;}})[_0x44b8('0x13')](respondWithResult(_0x2f3340,null))[_0x44b8('0x2d')](handleError(_0x2f3340,null));};exports[_0x44b8('0x7f')]=function(_0x2da727,_0x319520){var _0x2f7550={};var _0x57d24f={};var _0x223e54;var _0x3e5fa8;return db[_0x44b8('0x29')]['findOne']({'where':{'id':_0x2da727[_0x44b8('0x2f')]['id']}})['then'](handleEntityNotFound(_0x319520,null))[_0x44b8('0x13')](function(_0x5370a5){if(_0x5370a5){_0x223e54=_0x5370a5;_0x57d24f[_0x44b8('0x30')]=_[_0x44b8('0x31')](db[_0x44b8('0x62')][_0x44b8('0x24')]);_0x57d24f[_0x44b8('0x32')]=_[_0x44b8('0x31')](_0x2da727[_0x44b8('0x32')]);_0x57d24f[_0x44b8('0x33')]=_[_0x44b8('0x34')](_0x57d24f[_0x44b8('0x30')],_0x57d24f[_0x44b8('0x32')]);_0x2f7550[_0x44b8('0x35')]=_['intersection'](_0x57d24f[_0x44b8('0x30')],qs['fields'](_0x2da727[_0x44b8('0x32')]['fields']));_0x2f7550[_0x44b8('0x35')]=_0x2f7550[_0x44b8('0x35')][_0x44b8('0x37')]?_0x2f7550[_0x44b8('0x35')]:_0x57d24f[_0x44b8('0x30')];_0x2f7550[_0x44b8('0x4c')]=qs[_0x44b8('0x4d')](_0x2da727['query'][_0x44b8('0x4d')]);_0x2f7550[_0x44b8('0x28')]=qs[_0x44b8('0x33')](_[_0x44b8('0x51')](_0x2da727[_0x44b8('0x32')],_0x57d24f[_0x44b8('0x33')]));if(_0x2da727[_0x44b8('0x32')][_0x44b8('0x19')]){_0x2f7550[_0x44b8('0x28')]=_[_0x44b8('0x39')](_0x2f7550[_0x44b8('0x28')],{'$or':_[_0x44b8('0x1b')](_0x2f7550[_0x44b8('0x35')],function(_0x4281a6){var _0x4bb399={};_0x4bb399[_0x4281a6]={'$like':'%'+_0x2da727[_0x44b8('0x32')][_0x44b8('0x19')]+'%'};return _0x4bb399;})});}_0x2f7550=_['merge']({},_0x2f7550,_0x2da727[_0x44b8('0x3a')]);return _0x223e54[_0x44b8('0x7f')](_0x2f7550);}})[_0x44b8('0x13')](function(_0x1f389e){if(_0x1f389e){_0x3e5fa8=_0x1f389e[_0x44b8('0x37')];if(!_0x2da727['query'][_0x44b8('0x4a')](_0x44b8('0x4b'))){_0x2f7550[_0x44b8('0x10')]=qs[_0x44b8('0x10')](_0x2da727['query'][_0x44b8('0x10')]);_0x2f7550[_0x44b8('0xf')]=qs['offset'](_0x2da727['query']['offset']);}return _0x223e54['getMembers'](_0x2f7550);}})[_0x44b8('0x13')](function(_0x5824a8){return _0x5824a8?{'count':_0x3e5fa8,'rows':_0x5824a8}:null;})['then'](respondWithResult(_0x319520,null))[_0x44b8('0x2d')](handleError(_0x319520,null));};exports[_0x44b8('0x80')]=function(_0x87a38,_0x54adf9){var _0x44dc3d={};var _0x32dafb={};var _0x3c8e0c;var _0x21ea61;return db['VoiceQueue'][_0x44b8('0x49')]({'where':{'id':_0x87a38['params']['id']}})[_0x44b8('0x13')](handleEntityNotFound(_0x54adf9,null))[_0x44b8('0x13')](function(_0x56cfa5){if(_0x56cfa5){_0x3c8e0c=_0x56cfa5;_0x32dafb[_0x44b8('0x30')]=_[_0x44b8('0x31')](db[_0x44b8('0x81')][_0x44b8('0x24')]);_0x32dafb[_0x44b8('0x32')]=_['keys'](_0x87a38['query']);_0x32dafb[_0x44b8('0x33')]=_[_0x44b8('0x34')](_0x32dafb[_0x44b8('0x30')],_0x32dafb[_0x44b8('0x32')]);_0x44dc3d[_0x44b8('0x35')]=_[_0x44b8('0x34')](_0x32dafb[_0x44b8('0x30')],qs[_0x44b8('0x36')](_0x87a38[_0x44b8('0x32')][_0x44b8('0x36')]));_0x44dc3d[_0x44b8('0x35')]=_0x44dc3d[_0x44b8('0x35')]['length']?_0x44dc3d['attributes']:_0x32dafb[_0x44b8('0x30')];_0x44dc3d['order']=qs[_0x44b8('0x4d')](_0x87a38[_0x44b8('0x32')][_0x44b8('0x4d')]);_0x44dc3d['where']=qs[_0x44b8('0x33')](_[_0x44b8('0x51')](_0x87a38[_0x44b8('0x32')],_0x32dafb[_0x44b8('0x33')]));if(_0x87a38[_0x44b8('0x32')][_0x44b8('0x19')]){_0x44dc3d['where']=_[_0x44b8('0x39')](_0x44dc3d[_0x44b8('0x28')],{'$or':_['map'](_0x44dc3d[_0x44b8('0x35')],function(_0x1ffa05){var _0x22edd7={};_0x22edd7[_0x1ffa05]={'$like':'%'+_0x87a38[_0x44b8('0x32')][_0x44b8('0x19')]+'%'};return _0x22edd7;})});}_0x44dc3d=_['merge']({},_0x44dc3d,_0x87a38[_0x44b8('0x3a')]);return _0x3c8e0c[_0x44b8('0x80')](_0x44dc3d);}})[_0x44b8('0x13')](function(_0x2fca1a){if(_0x2fca1a){_0x21ea61=_0x2fca1a[_0x44b8('0x37')];if(!_0x87a38[_0x44b8('0x32')][_0x44b8('0x4a')](_0x44b8('0x4b'))){_0x44dc3d[_0x44b8('0x10')]=qs[_0x44b8('0x10')](_0x87a38['query'][_0x44b8('0x10')]);_0x44dc3d[_0x44b8('0xf')]=qs[_0x44b8('0xf')](_0x87a38['query']['offset']);}return _0x3c8e0c[_0x44b8('0x80')](_0x44dc3d);}})['then'](function(_0x9458fb){if(_0x9458fb){return _0x9458fb?{'count':_0x21ea61,'rows':_0x9458fb}:null;}})[_0x44b8('0x13')](respondWithResult(_0x54adf9,null))[_0x44b8('0x2d')](handleError(_0x54adf9,null));};exports[_0x44b8('0x82')]=function(_0x2eb6ce,_0x105ca0){var _0x25f364=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');var _0x77c009,_0x161362;return db[_0x44b8('0x29')][_0x44b8('0x1e')]({'where':{'id':_0x2eb6ce[_0x44b8('0x2f')]['id']}})[_0x44b8('0x13')](handleEntityNotFound(_0x105ca0,null))['then'](function(_0x4d88a6){if(_0x4d88a6){_0x161362=_0x4d88a6;return _0x4d88a6[_0x44b8('0x82')](_0x2eb6ce[_0x44b8('0x3c')][_0x44b8('0x67')],_[_0x44b8('0x45')](_0x2eb6ce[_0x44b8('0x3c')],[_0x44b8('0x67'),'id'])||{});}return null;})[_0x44b8('0x78')](function(_0x4b49df){var _0xbf96c1;_0x77c009=_0x4b49df||[];var _0x1f6244=[];if(_0x4b49df){for(var _0x96a3cd=0x0;_0x96a3cd<_0x4b49df['length'];_0x96a3cd+=0x1){var _0x16721d=_0x4b49df[_0x96a3cd][_0x44b8('0x14')]({'plain':!![]});_0x161362[_0x44b8('0x83')]=_0x2eb6ce[_0x44b8('0x3c')]['dialCheckDuplicateType']?_0x2eb6ce[_0x44b8('0x3c')][_0x44b8('0x83')]:_0x161362[_0x44b8('0x83')];switch(_0x161362['dialCheckDuplicateType']){case'always':_0xbf96c1=squel['insert']()['into']('cm_hopper')[_0x44b8('0x84')]([_0x44b8('0x85'),_0x44b8('0x86'),_0x44b8('0x87'),_0x44b8('0x88'),_0x44b8('0x4e'),_0x44b8('0x46'),_0x44b8('0x47')],squel[_0x44b8('0x89')]()[_0x44b8('0x68')](_0x44b8('0x85'),'phone')[_0x44b8('0x68')]('\x27'+_0x25f364+'\x27',_0x44b8('0x86'))[_0x44b8('0x68')]('id',_0x44b8('0x87'))[_0x44b8('0x68')](_0x16721d['CmListId'][_0x44b8('0x6f')](),'ListId')[_0x44b8('0x68')](_0x2eb6ce[_0x44b8('0x2f')]['id'][_0x44b8('0x6f')](),'VoiceQueueId')[_0x44b8('0x68')]('\x27'+_0x25f364+'\x27',_0x44b8('0x46'))['field']('\x27'+_0x25f364+'\x27',_0x44b8('0x47'))[_0x44b8('0x69')](_0x44b8('0x8a'))['where'](_0x44b8('0x8b'))['where'](_0x44b8('0x8c'),_0x16721d[_0x44b8('0x8d')][_0x44b8('0x6f')]())['where'](_0x44b8('0x8e'))['where'](_0x44b8('0x8f'),squel[_0x44b8('0x89')]()[_0x44b8('0x68')](_0x44b8('0x90'))[_0x44b8('0x69')](_0x44b8('0x91'))['where'](_0x44b8('0x6c'),_0x2eb6ce[_0x44b8('0x2f')]['id'][_0x44b8('0x6f')]()))[_0x44b8('0x28')]('phone\x20NOT\x20IN\x20(?)',squel[_0x44b8('0x89')]()[_0x44b8('0x68')](_0x44b8('0x92'))[_0x44b8('0x69')](_0x44b8('0x93'))[_0x44b8('0x28')](_0x44b8('0x6c'),_0x2eb6ce[_0x44b8('0x2f')]['id'][_0x44b8('0x6f')]())))[_0x44b8('0x6f')]();break;case _0x44b8('0x94'):_0xbf96c1=squel[_0x44b8('0x95')]()['into'](_0x44b8('0x93'))[_0x44b8('0x84')]([_0x44b8('0x85'),_0x44b8('0x86'),'ContactId',_0x44b8('0x88'),'VoiceQueueId',_0x44b8('0x46'),_0x44b8('0x47')],squel[_0x44b8('0x89')]()['field'](_0x44b8('0x85'),_0x44b8('0x85'))[_0x44b8('0x68')]('\x27'+_0x25f364+'\x27',_0x44b8('0x86'))[_0x44b8('0x68')]('id','ContactId')[_0x44b8('0x68')](_0x16721d[_0x44b8('0x8d')][_0x44b8('0x6f')](),_0x44b8('0x88'))[_0x44b8('0x68')](_0x2eb6ce['params']['id'][_0x44b8('0x6f')](),_0x44b8('0x4e'))[_0x44b8('0x68')]('\x27'+_0x25f364+'\x27',_0x44b8('0x46'))[_0x44b8('0x68')]('\x27'+_0x25f364+'\x27',_0x44b8('0x47'))[_0x44b8('0x69')]('cm_contacts')['where']('deletedAt\x20IS\x20NULL')[_0x44b8('0x28')](_0x44b8('0x8c'),_0x16721d[_0x44b8('0x8d')]['toString']())['where'](_0x44b8('0x8e'))[_0x44b8('0x28')](_0x44b8('0x8f'),squel[_0x44b8('0x89')]()[_0x44b8('0x68')]('COALESCE(phone,\x27\x27)')['from']('cm_hopper')['where'](_0x44b8('0x6c'),_0x2eb6ce[_0x44b8('0x2f')]['id'][_0x44b8('0x6f')]())))[_0x44b8('0x6f')]();break;default:_0xbf96c1=squel[_0x44b8('0x95')]()[_0x44b8('0x96')]('cm_hopper')[_0x44b8('0x84')](['phone',_0x44b8('0x86'),_0x44b8('0x87'),_0x44b8('0x88'),'VoiceQueueId','createdAt',_0x44b8('0x47')],squel[_0x44b8('0x89')]()['field']('phone',_0x44b8('0x85'))[_0x44b8('0x68')]('\x27'+_0x25f364+'\x27',_0x44b8('0x86'))[_0x44b8('0x68')]('id',_0x44b8('0x87'))['field'](_0x16721d[_0x44b8('0x8d')][_0x44b8('0x6f')](),_0x44b8('0x88'))[_0x44b8('0x68')](_0x2eb6ce[_0x44b8('0x2f')]['id'][_0x44b8('0x6f')](),_0x44b8('0x4e'))['field']('\x27'+_0x25f364+'\x27',_0x44b8('0x46'))[_0x44b8('0x68')]('\x27'+_0x25f364+'\x27',_0x44b8('0x47'))[_0x44b8('0x69')](_0x44b8('0x8a'))[_0x44b8('0x28')]('deletedAt\x20IS\x20NULL')[_0x44b8('0x28')](_0x44b8('0x8c'),_0x16721d[_0x44b8('0x8d')][_0x44b8('0x6f')]())['where'](_0x44b8('0x8e')))[_0x44b8('0x6f')]();}_0x1f6244[_0x44b8('0x6e')](db[_0x44b8('0x70')]['query'](_0xbf96c1));}return BPromise['all'](_0x1f6244);}})[_0x44b8('0x13')](function(){var _0x2ad4ab=[];var _0x196b4b=squel[_0x44b8('0x95')]()[_0x44b8('0x96')]('cm_hopper_additional_phones')[_0x44b8('0x84')]([_0x44b8('0x97'),_0x44b8('0x85'),_0x44b8('0x98'),_0x44b8('0x46'),_0x44b8('0x47')],squel['select']()[_0x44b8('0x68')](_0x44b8('0x99'))[_0x44b8('0x68')](_0x44b8('0x9a'))[_0x44b8('0x68')](_0x44b8('0x9b'))[_0x44b8('0x68')]('\x27'+_0x25f364+'\x27','createdAt')[_0x44b8('0x68')]('\x27'+_0x25f364+'\x27',_0x44b8('0x47'))[_0x44b8('0x69')](_0x44b8('0x9c'),'ci')['join'](_0x44b8('0x93'),'h','h.ContactId=ci.CmContactId')[_0x44b8('0x28')](_0x44b8('0x9d'),_0x25f364)[_0x44b8('0x28')](_0x44b8('0x9e'),'PHONE'))[_0x44b8('0x6f')]();_0x2ad4ab[_0x44b8('0x6e')](db[_0x44b8('0x70')]['query'](_0x196b4b));return BPromise[_0x44b8('0x73')](_0x2ad4ab);})[_0x44b8('0x13')](function(){return _0x77c009;})[_0x44b8('0x13')](respondWithResult(_0x105ca0,null))[_0x44b8('0x2d')](handleError(_0x105ca0,null));};exports[_0x44b8('0x9f')]=function(_0x257702,_0x17560c){return db[_0x44b8('0x29')][_0x44b8('0x1e')]({'where':{'id':_0x257702[_0x44b8('0x2f')]['id']}})['then'](handleEntityNotFound(_0x17560c,null))[_0x44b8('0x13')](function(_0x4d11d5){if(_0x4d11d5){return _0x4d11d5[_0x44b8('0x9f')](_0x257702[_0x44b8('0x32')][_0x44b8('0x67')]);}})[_0x44b8('0x13')](function(_0xafca17){if(_0xafca17){return db['CmHopper']['destroy']({'where':{'ListId':_0x257702['query'][_0x44b8('0x67')],'VoiceQueueId':_0x257702[_0x44b8('0x2f')]['id']}})[_0x44b8('0x13')](function(){return _0xafca17;});}})[_0x44b8('0x13')](respondWithStatusCode(_0x17560c,null))[_0x44b8('0x2d')](handleError(_0x17560c,null));};exports[_0x44b8('0xa0')]=function(_0x513302,_0xfdb408){var _0x119dda={};var _0x5834fe={};var _0xe5cc1e;var _0x4c55e6;return db[_0x44b8('0x29')][_0x44b8('0x49')]({'where':{'id':_0x513302['params']['id']}})[_0x44b8('0x13')](handleEntityNotFound(_0xfdb408,null))[_0x44b8('0x13')](function(_0x537eab){if(_0x537eab){_0xe5cc1e=_0x537eab;_0x5834fe[_0x44b8('0x30')]=_[_0x44b8('0x31')](db[_0x44b8('0x81')][_0x44b8('0x24')]);_0x5834fe['query']=_[_0x44b8('0x31')](_0x513302[_0x44b8('0x32')]);_0x5834fe[_0x44b8('0x33')]=_[_0x44b8('0x34')](_0x5834fe[_0x44b8('0x30')],_0x5834fe[_0x44b8('0x32')]);_0x119dda[_0x44b8('0x35')]=_['intersection'](_0x5834fe[_0x44b8('0x30')],qs[_0x44b8('0x36')](_0x513302[_0x44b8('0x32')]['fields']));_0x119dda[_0x44b8('0x35')]=_0x119dda[_0x44b8('0x35')]['length']?_0x119dda[_0x44b8('0x35')]:_0x5834fe[_0x44b8('0x30')];_0x119dda[_0x44b8('0x4c')]=qs[_0x44b8('0x4d')](_0x513302['query'][_0x44b8('0x4d')]);_0x119dda[_0x44b8('0x28')]=qs[_0x44b8('0x33')](_[_0x44b8('0x51')](_0x513302[_0x44b8('0x32')],_0x5834fe['filters']));if(_0x513302[_0x44b8('0x32')][_0x44b8('0x19')]){_0x119dda['where']=_[_0x44b8('0x39')](_0x119dda[_0x44b8('0x28')],{'$or':_[_0x44b8('0x1b')](_0x119dda[_0x44b8('0x35')],function(_0x4e9376){var _0x25f31c={};_0x25f31c[_0x4e9376]={'$like':'%'+_0x513302[_0x44b8('0x32')][_0x44b8('0x19')]+'%'};return _0x25f31c;})});}_0x119dda=_[_0x44b8('0x39')]({},_0x119dda,_0x513302[_0x44b8('0x3a')]);return _0xe5cc1e[_0x44b8('0xa0')](_0x119dda);}})[_0x44b8('0x13')](function(_0x57e3c9){if(_0x57e3c9){_0x4c55e6=_0x57e3c9[_0x44b8('0x37')];if(!_0x513302[_0x44b8('0x32')][_0x44b8('0x4a')](_0x44b8('0x4b'))){_0x119dda['limit']=qs[_0x44b8('0x10')](_0x513302[_0x44b8('0x32')][_0x44b8('0x10')]);_0x119dda['offset']=qs['offset'](_0x513302[_0x44b8('0x32')][_0x44b8('0xf')]);}return _0xe5cc1e[_0x44b8('0xa0')](_0x119dda);}})[_0x44b8('0x13')](function(_0x4a5916){if(_0x4a5916){return _0x4a5916?{'count':_0x4c55e6,'rows':_0x4a5916}:null;}})[_0x44b8('0x13')](respondWithResult(_0xfdb408,null))[_0x44b8('0x2d')](handleError(_0xfdb408,null));};exports['addBlackLists']=function(_0xd19a35,_0x2439f2){var _0x22a624;return db['VoiceQueue'][_0x44b8('0x1e')]({'where':{'id':_0xd19a35[_0x44b8('0x2f')]['id']}})[_0x44b8('0x13')](handleEntityNotFound(_0x2439f2,null))[_0x44b8('0x13')](function(_0x14c021){if(_0x14c021){return _0x14c021['addBlackLists'](_0xd19a35[_0x44b8('0x3c')][_0x44b8('0x67')],_['omit'](_0xd19a35[_0x44b8('0x3c')],[_0x44b8('0x67'),'id'])||{});}return null;})[_0x44b8('0x78')](function(_0x3b9cd2){var _0xb6cadf;_0x22a624=_0x3b9cd2||[];var _0x2024eb=[];if(_0x3b9cd2){for(var _0x29af58=0x0;_0x29af58<_0x3b9cd2[_0x44b8('0x37')];_0x29af58+=0x1){var _0x3870a9=_0x3b9cd2[_0x29af58]['get']({'plain':!![]});_0xb6cadf=squel['insert']()['into']('cm_hopper_black')[_0x44b8('0x84')]([_0x44b8('0x85'),'ContactId',_0x44b8('0x88'),_0x44b8('0x4e'),_0x44b8('0x46'),_0x44b8('0x47')],squel[_0x44b8('0x89')]()[_0x44b8('0x68')]('phone',_0x44b8('0x85'))['field']('id','ContactId')[_0x44b8('0x68')](_0x3870a9[_0x44b8('0x8d')][_0x44b8('0x6f')](),_0x44b8('0x88'))[_0x44b8('0x68')](_0xd19a35['params']['id'][_0x44b8('0x6f')](),_0x44b8('0x4e'))[_0x44b8('0x68')](_0x44b8('0xa1'),_0x44b8('0x46'))[_0x44b8('0x68')](_0x44b8('0xa1'),'updatedAt')[_0x44b8('0x69')](_0x44b8('0x8a'))[_0x44b8('0x28')]('deletedAt\x20IS\x20NULL')[_0x44b8('0x28')](_0x44b8('0x8c'),_0x3870a9[_0x44b8('0x8d')][_0x44b8('0x6f')]())[_0x44b8('0x28')](_0x44b8('0x8e')))[_0x44b8('0x6f')]();_0x2024eb[_0x44b8('0x6e')](db['sequelize'][_0x44b8('0x32')](_0xb6cadf));}return BPromise[_0x44b8('0x73')](_0x2024eb);}})[_0x44b8('0x13')](function(){return _0x22a624;})[_0x44b8('0x13')](respondWithResult(_0x2439f2,null))[_0x44b8('0x2d')](handleError(_0x2439f2,null));};exports[_0x44b8('0xa2')]=function(_0x4ec799,_0x3fa943){return db[_0x44b8('0x29')]['find']({'where':{'id':_0x4ec799[_0x44b8('0x2f')]['id']}})[_0x44b8('0x13')](handleEntityNotFound(_0x3fa943,null))[_0x44b8('0x13')](function(_0x3b1643){if(_0x3b1643){return _0x3b1643['removeBlackLists'](_0x4ec799[_0x44b8('0x32')]['ids']);}})['then'](function(_0x9a5734){if(_0x9a5734){return db[_0x44b8('0x54')][_0x44b8('0x12')]({'where':{'ListId':_0x4ec799[_0x44b8('0x32')][_0x44b8('0x67')],'VoiceQueueId':_0x4ec799['params']['id']}})['then'](function(){return _0x9a5734;});}})['then'](respondWithStatusCode(_0x3fa943,null))[_0x44b8('0x2d')](handleError(_0x3fa943,null));}; \ No newline at end of file +var _0x7fbe=['send','VoiceQueue','rawAttributes','fieldName','key','where','include','query','findAll','rows','catch','show','params','keys','filters','intersection','model','attributes','fields','length','includeAll','merge','options','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','updatedAt','createdAt','inbound','outbound','update','getHoppers','findOne','hasOwnProperty','nolimit','order','sort','VoiceQueueId','CmHopper','CmHopperHistory','pick','CmHopperFinal','getHopperBlacks','CmHopperBlack','getTeams','Team','addTeams','teams','Agents','forEach','penalty','sequelize','each','TeamVoiceQueue','upsert','UserVoiceQueue','UserVoiceQueueRt','interface','format','SIP/%s','voicePause','userVoiceQueue:save','removeTeams','ids','User','select','field','from','team_has_voice_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoiceQueueId\x20=\x20?','push','toString','SELECT','every','TeamId','includes','all','union','compact','transaction','isEmpty','removeAgents','userVoiceQueue:remove','addAgents','emit','online','isNil','isArray','getAgents','getMembers','CmList','getLists','addLists','YYYY-MM-DD\x20HH:mm:ss','spread','dialCheckDuplicateType','always','insert','into','cm_hopper','phone','scheduledAt','ContactId','ListId','CmListId','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','phone\x20NOT\x20IN\x20(?)','COALESCE(phone,\x27\x27)','onlyIfOpen','fromQuery','cm_contacts','phone\x20IS\x20NOT\x20NULL','cm_hopper_additional_phones','CmHopperId','OrderBy','h.id','ci.OrderBy+1','cm_contact_has_items','join','h.ContactId=ci.CmContactId','PHONE','removeLists','getBlackLists','addBlackLists','cm_hopper_black','NOW()','removeBlackLists','util','lodash','squel','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voiceQueue.socket','register','status','end','json','offset','undefined','limit','count','set','Content-Range','then','destroy','get','VoiceQueues','QueueCampaigns','filter','map','value','type','name','sendStatus','error'];(function(_0x384cf4,_0x36d5f4){var _0x2918c7=function(_0x1e0d35){while(--_0x1e0d35){_0x384cf4['push'](_0x384cf4['shift']());}};_0x2918c7(++_0x36d5f4);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x4f95f8,_0xb73784){_0x4f95f8=_0x4f95f8-0x0;var _0x123b8e=_0x7fbe[_0x4f95f8];return _0x123b8e;};'use strict';var moment=require('moment');var BPromise=require('bluebird');var util=require(_0xe7fb('0x0'));var _=require(_0xe7fb('0x1'));var squel=require(_0xe7fb('0x2'));var Redis=require(_0xe7fb('0x3'));var qs=require(_0xe7fb('0x4'));var logger=require(_0xe7fb('0x5'))(_0xe7fb('0x6'));var config=require(_0xe7fb('0x7'));var db=require(_0xe7fb('0x8'))['db'];config[_0xe7fb('0x9')]=_[_0xe7fb('0xa')](config[_0xe7fb('0x9')],{'host':_0xe7fb('0xb'),'port':0x18eb});var socket=require(_0xe7fb('0xc'))(new Redis(config['redis']));require(_0xe7fb('0xd'))[_0xe7fb('0xe')](socket);function respondWithStatusCode(_0x1d0741,_0x190a7a){_0x190a7a=_0x190a7a||0xcc;return function(_0x4ba197){if(_0x4ba197){return _0x1d0741['sendStatus'](_0x190a7a);}return _0x1d0741[_0xe7fb('0xf')](_0x190a7a)[_0xe7fb('0x10')]();};}function respondWithResult(_0x41a514,_0x348a73){_0x348a73=_0x348a73||0xc8;return function(_0x2a2223){if(_0x2a2223){return _0x41a514[_0xe7fb('0xf')](_0x348a73)[_0xe7fb('0x11')](_0x2a2223);}};}function respondWithFilteredResult(_0x3c07f3,_0x325035){return function(_0x2fe8ab){if(_0x2fe8ab){var _0x2437d4=typeof _0x325035[_0xe7fb('0x12')]===_0xe7fb('0x13')&&typeof _0x325035[_0xe7fb('0x14')]===_0xe7fb('0x13');var _0x598729=_0x2fe8ab[_0xe7fb('0x15')];var _0x2225e5=_0x2437d4?0x0:_0x325035['offset'];var _0x30015a=_0x2437d4?_0x2fe8ab[_0xe7fb('0x15')]:_0x325035['offset']+_0x325035[_0xe7fb('0x14')];var _0x559129;if(_0x30015a>=_0x598729){_0x30015a=_0x598729;_0x559129=0xc8;}else{_0x559129=0xce;}_0x3c07f3[_0xe7fb('0xf')](_0x559129);return _0x3c07f3[_0xe7fb('0x16')](_0xe7fb('0x17'),_0x2225e5+'-'+_0x30015a+'/'+_0x598729)[_0xe7fb('0x11')](_0x2fe8ab);}return null;};}function saveUpdates(_0x562262){return function(_0x892b0f){if(_0x892b0f){return _0x892b0f['update'](_0x562262)[_0xe7fb('0x18')](function(_0x546463){return _0x546463;});}return null;};}function removeEntity(_0x1e77fd){return function(_0x4708f7){if(_0x4708f7){return _0x4708f7[_0xe7fb('0x19')]()[_0xe7fb('0x18')](function(){var _0x5df1a1=_0x4708f7[_0xe7fb('0x1a')]({'plain':!![]});var _0x5d1c87=[{'name':_0xe7fb('0x1b'),'value':'inbound','ignore':![]},{'name':_0xe7fb('0x1c'),'value':'outbound','ignore':![]}];var _0xa5af01=_(_0x5d1c87)[_0xe7fb('0x1d')]('ignore')[_0xe7fb('0x1e')](_0xe7fb('0x1f'))[_0xe7fb('0x1f')]();if(_['includes'](_0xa5af01,_0x5df1a1[_0xe7fb('0x20')])){return;}var _0x469ead=_['find'](_0x5d1c87,['value',_0x5df1a1['type']])[_0xe7fb('0x21')];return db['UserProfileResource']['destroy']({'where':{'type':_0x469ead,'resourceId':_0x5df1a1['id']}})[_0xe7fb('0x18')](function(){return _0x4708f7;});})[_0xe7fb('0x18')](function(){_0x1e77fd[_0xe7fb('0xf')](0xcc)['end']();});}};}function handleEntityNotFound(_0x6c930){return function(_0x2b69c4){if(!_0x2b69c4){_0x6c930[_0xe7fb('0x22')](0x194);}return _0x2b69c4;};}function handleError(_0x1ceed8,_0x392d75){_0x392d75=_0x392d75||0x1f4;return function(_0x16237a){logger[_0xe7fb('0x23')](_0x16237a['stack']);if(_0x16237a['name']){delete _0x16237a[_0xe7fb('0x21')];}_0x1ceed8[_0xe7fb('0xf')](_0x392d75)[_0xe7fb('0x24')](_0x16237a);};}exports['index']=function(_0xb1f2f4,_0x251807){var _0xd3fffe={};var _0x5f265f={'count':0x0,'rows':[]};var _0x219554=_[_0xe7fb('0x1e')](db[_0xe7fb('0x25')][_0xe7fb('0x26')],function(_0x4ce993){return{'name':_0x4ce993[_0xe7fb('0x27')],'type':_0x4ce993[_0xe7fb('0x20')][_0xe7fb('0x28')]};});_0xd3fffe=qs['getOptions'](_0x219554,_0xb1f2f4);var _0x517d70={'where':_0xd3fffe[_0xe7fb('0x29')]};return db['VoiceQueue'][_0xe7fb('0x15')](_0x517d70)[_0xe7fb('0x18')](function(_0xe49053){_0x5f265f[_0xe7fb('0x15')]=_0xe49053;_0xd3fffe['include']=qs[_0xe7fb('0x2a')](_0xb1f2f4[_0xe7fb('0x2b')]);return db[_0xe7fb('0x25')][_0xe7fb('0x2c')](_0xd3fffe);})[_0xe7fb('0x18')](function(_0x480819){_0x5f265f[_0xe7fb('0x2d')]=_0x480819;return _0x5f265f;})[_0xe7fb('0x18')](respondWithFilteredResult(_0x251807,_0xd3fffe))[_0xe7fb('0x2e')](handleError(_0x251807,null));};exports[_0xe7fb('0x2f')]=function(_0x46f430,_0x25e925){var _0x1bc72d={'raw':![],'where':{'id':_0x46f430[_0xe7fb('0x30')]['id']}},_0x147eb1={};_0x147eb1['model']=_[_0xe7fb('0x31')](db[_0xe7fb('0x25')][_0xe7fb('0x26')]);_0x147eb1['query']=_[_0xe7fb('0x31')](_0x46f430[_0xe7fb('0x2b')]);_0x147eb1[_0xe7fb('0x32')]=_[_0xe7fb('0x33')](_0x147eb1[_0xe7fb('0x34')],_0x147eb1[_0xe7fb('0x2b')]);_0x1bc72d[_0xe7fb('0x35')]=_[_0xe7fb('0x33')](_0x147eb1[_0xe7fb('0x34')],qs[_0xe7fb('0x36')](_0x46f430[_0xe7fb('0x2b')][_0xe7fb('0x36')]));_0x1bc72d[_0xe7fb('0x35')]=_0x1bc72d[_0xe7fb('0x35')][_0xe7fb('0x37')]?_0x1bc72d[_0xe7fb('0x35')]:_0x147eb1[_0xe7fb('0x34')];if(_0x46f430[_0xe7fb('0x2b')][_0xe7fb('0x38')]){_0x1bc72d['include']=[{'all':!![]}];}_0x1bc72d=_[_0xe7fb('0x39')]({},_0x1bc72d,_0x46f430[_0xe7fb('0x3a')]);return db[_0xe7fb('0x25')][_0xe7fb('0x3b')](_0x1bc72d)['then'](handleEntityNotFound(_0x25e925,null))[_0xe7fb('0x18')](respondWithResult(_0x25e925,null))[_0xe7fb('0x2e')](handleError(_0x25e925,null));};exports[_0xe7fb('0x3c')]=function(_0x413a13,_0x49fe9d){return db[_0xe7fb('0x25')][_0xe7fb('0x3c')](_0x413a13[_0xe7fb('0x3d')],{})[_0xe7fb('0x18')](function(_0x468d16){var _0xb729fc=_0x413a13['user'][_0xe7fb('0x1a')]({'plain':!![]});if(!_0xb729fc)throw new Error(_0xe7fb('0x3e'));if(_0xb729fc[_0xe7fb('0x3f')]==='user'){var _0x36a341=_0x468d16[_0xe7fb('0x1a')]({'plain':!![]});var _0x5d42ac=[{'name':'VoiceQueues','value':'inbound'},{'name':'QueueCampaigns','value':'outbound'}];var _0x900d67=_[_0xe7fb('0x3b')](_0x5d42ac,[_0xe7fb('0x1f'),_0x36a341['type']])[_0xe7fb('0x21')];return db['UserProfileSection'][_0xe7fb('0x3b')]({'where':{'name':_0x900d67,'userProfileId':_0xb729fc[_0xe7fb('0x40')]},'raw':!![]})['then'](function(_0x108a16){if(_0x108a16&&_0x108a16[_0xe7fb('0x41')]===0x0){return db[_0xe7fb('0x42')][_0xe7fb('0x3c')]({'name':_0x36a341['name'],'resourceId':_0x36a341['id'],'type':_0x108a16[_0xe7fb('0x21')],'sectionId':_0x108a16['id']},{})[_0xe7fb('0x18')](function(){return _0x468d16;});}else{return _0x468d16;}})[_0xe7fb('0x2e')](function(_0x56a84f){logger[_0xe7fb('0x23')](_0xe7fb('0x43'),_0x56a84f);throw _0x56a84f;});}return _0x468d16;})[_0xe7fb('0x18')](respondWithResult(_0x49fe9d,0xc9))[_0xe7fb('0x2e')](handleError(_0x49fe9d,null));};exports[_0xe7fb('0x44')]=function(_0x5a1ce1,_0x2eb999){var _0x4df4aa={'where':{'id':_0x5a1ce1[_0xe7fb('0x30')]['id']}},_0x2c72dd={};_0x2c72dd[_0xe7fb('0x34')]=_[_0xe7fb('0x31')](db[_0xe7fb('0x25')]['rawAttributes']);_0x4df4aa[_0xe7fb('0x35')]=_['intersection'](_0x2c72dd['model'],qs[_0xe7fb('0x36')](_0x5a1ce1[_0xe7fb('0x2b')][_0xe7fb('0x36')]));_0x4df4aa['attributes']=_0x4df4aa[_0xe7fb('0x35')][_0xe7fb('0x37')]?_0x4df4aa['attributes']:_0x2c72dd['model'];if(_0x5a1ce1[_0xe7fb('0x2b')][_0xe7fb('0x38')]){_0x4df4aa[_0xe7fb('0x2a')]=[{'all':!![]}];}_0x4df4aa=_[_0xe7fb('0x39')]({},_0x4df4aa,_0x5a1ce1[_0xe7fb('0x3a')]);return db[_0xe7fb('0x25')][_0xe7fb('0x3b')](_0x4df4aa)[_0xe7fb('0x18')](handleEntityNotFound(_0x2eb999,null))['then'](function(_0x925a5e){if(_0x925a5e){var _0x5cc28f=_0x925a5e[_0xe7fb('0x1a')]({'plain':!![]});_0x5cc28f=qs[_0xe7fb('0x45')](_0x5cc28f,['id','createdAt',_0xe7fb('0x46')]);_0x5a1ce1['body']=_[_0xe7fb('0x45')](_0x5a1ce1['body'],['id',_0xe7fb('0x47'),'updatedAt']);return db[_0xe7fb('0x25')]['create'](_[_0xe7fb('0x39')](_0x5cc28f,_0x5a1ce1[_0xe7fb('0x3d')]),{'include':_0x5a1ce1[_0xe7fb('0x2b')][_0xe7fb('0x38')]?[{'all':!![]}]:undefined})[_0xe7fb('0x18')](function(_0x2f959d){var _0x2f4760=_0x5a1ce1['user']['get']({'plain':!![]});if(!_0x2f4760)throw new Error(_0xe7fb('0x3e'));if(_0x2f4760['role']==='user'){var _0x4c3eb7=_0x2f959d['get']({'plain':!![]});var _0x539252=[{'name':_0xe7fb('0x1b'),'value':_0xe7fb('0x48')},{'name':_0xe7fb('0x1c'),'value':_0xe7fb('0x49')}];var _0x59c92d=_[_0xe7fb('0x3b')](_0x539252,[_0xe7fb('0x1f'),_0x4c3eb7[_0xe7fb('0x20')]])['name'];return db['UserProfileSection'][_0xe7fb('0x3b')]({'where':{'name':_0x59c92d,'userProfileId':_0x2f4760[_0xe7fb('0x40')]},'raw':!![]})[_0xe7fb('0x18')](function(_0x4f4ba3){if(_0x4f4ba3&&_0x4f4ba3[_0xe7fb('0x41')]===0x0){return db[_0xe7fb('0x42')][_0xe7fb('0x3c')]({'name':_0x4c3eb7[_0xe7fb('0x21')],'resourceId':_0x4c3eb7['id'],'type':_0x4f4ba3['name'],'sectionId':_0x4f4ba3['id']},{})['then'](function(){return _0x2f959d;});}else{return _0x2f959d;}})[_0xe7fb('0x2e')](function(_0x3104c2){logger[_0xe7fb('0x23')](_0xe7fb('0x43'),_0x3104c2);throw _0x3104c2;});}return _0x2f959d;});}})[_0xe7fb('0x18')](respondWithResult(_0x2eb999,0xc9))['catch'](handleError(_0x2eb999,null));};exports[_0xe7fb('0x4a')]=function(_0x349a2a,_0x23755b){if(_0x349a2a['body']['id']){delete _0x349a2a['body']['id'];}return db[_0xe7fb('0x25')][_0xe7fb('0x3b')]({'where':{'id':_0x349a2a[_0xe7fb('0x30')]['id']}})[_0xe7fb('0x18')](handleEntityNotFound(_0x23755b,null))[_0xe7fb('0x18')](saveUpdates(_0x349a2a[_0xe7fb('0x3d')],null))['then'](respondWithResult(_0x23755b,null))[_0xe7fb('0x2e')](handleError(_0x23755b,null));};exports[_0xe7fb('0x19')]=function(_0x2cd4e5,_0x1aef59){return db[_0xe7fb('0x25')][_0xe7fb('0x3b')]({'where':{'id':_0x2cd4e5['params']['id']}})[_0xe7fb('0x18')](handleEntityNotFound(_0x1aef59,null))['then'](removeEntity(_0x1aef59,null))[_0xe7fb('0x2e')](handleError(_0x1aef59,null));};exports[_0xe7fb('0x4b')]=function(_0x116c7e,_0x1b24fd){var _0x5925e6={'raw':![],'where':{}};var _0x47ac92={};var _0x2789a4={'count':0x0,'rows':[]};return db[_0xe7fb('0x25')][_0xe7fb('0x4c')]({'where':{'id':_0x116c7e[_0xe7fb('0x30')]['id']}})[_0xe7fb('0x18')](handleEntityNotFound(_0x1b24fd,null))['then'](function(_0x4096d4){if(_0x4096d4){_0x47ac92['model']=_[_0xe7fb('0x31')](db['CmHopper']['rawAttributes']);_0x47ac92[_0xe7fb('0x2b')]=_[_0xe7fb('0x31')](_0x116c7e[_0xe7fb('0x2b')]);_0x47ac92['filters']=_[_0xe7fb('0x33')](_0x47ac92[_0xe7fb('0x34')],_0x47ac92[_0xe7fb('0x2b')]);_0x5925e6[_0xe7fb('0x35')]=_[_0xe7fb('0x33')](_0x47ac92['model'],qs[_0xe7fb('0x36')](_0x116c7e[_0xe7fb('0x2b')]['fields']));_0x5925e6[_0xe7fb('0x35')]=_0x5925e6[_0xe7fb('0x35')]['length']?_0x5925e6[_0xe7fb('0x35')]:_0x47ac92['model'];if(!_0x116c7e[_0xe7fb('0x2b')][_0xe7fb('0x4d')](_0xe7fb('0x4e'))){_0x5925e6['limit']=qs[_0xe7fb('0x14')](_0x116c7e[_0xe7fb('0x2b')][_0xe7fb('0x14')]);_0x5925e6[_0xe7fb('0x12')]=qs[_0xe7fb('0x12')](_0x116c7e[_0xe7fb('0x2b')][_0xe7fb('0x12')]);}_0x5925e6[_0xe7fb('0x4f')]=qs['sort'](_0x116c7e['query'][_0xe7fb('0x50')]);_0x5925e6[_0xe7fb('0x29')]=qs[_0xe7fb('0x32')](_['pick'](_0x116c7e['query'],_0x47ac92[_0xe7fb('0x32')]));_0x5925e6[_0xe7fb('0x29')][_0xe7fb('0x51')]=_0x4096d4['id'];if(_0x116c7e[_0xe7fb('0x2b')][_0xe7fb('0x1d')]){_0x5925e6[_0xe7fb('0x29')]=_[_0xe7fb('0x39')](_0x5925e6[_0xe7fb('0x29')],{'$or':_[_0xe7fb('0x1e')](_0x5925e6[_0xe7fb('0x35')],function(_0x1ff5e7){var _0xf423ab={};_0xf423ab[_0x1ff5e7]={'$like':'%'+_0x116c7e[_0xe7fb('0x2b')]['filter']+'%'};return _0xf423ab;})});}_0x5925e6=_['merge']({},_0x5925e6,_0x116c7e[_0xe7fb('0x3a')]);return db[_0xe7fb('0x52')][_0xe7fb('0x15')]({'where':_0x5925e6[_0xe7fb('0x29')]})[_0xe7fb('0x18')](function(_0x562493){_0x2789a4[_0xe7fb('0x15')]=_0x562493;if(_0x116c7e[_0xe7fb('0x2b')][_0xe7fb('0x38')]){_0x5925e6[_0xe7fb('0x2a')]=[{'all':!![]}];}return db[_0xe7fb('0x52')][_0xe7fb('0x2c')](_0x5925e6);})[_0xe7fb('0x18')](function(_0x1e6256){_0x2789a4[_0xe7fb('0x2d')]=_0x1e6256;return _0x2789a4;});}})['then'](respondWithFilteredResult(_0x1b24fd,_0x5925e6))[_0xe7fb('0x2e')](handleError(_0x1b24fd,null));};exports['getHopperHistories']=function(_0x279663,_0x2f13f2){var _0x2a2079={'raw':!![],'where':{}};var _0x31c159={};var _0x318d06={'count':0x0,'rows':[]};return db['VoiceQueue'][_0xe7fb('0x4c')]({'where':{'id':_0x279663[_0xe7fb('0x30')]['id']}})[_0xe7fb('0x18')](handleEntityNotFound(_0x2f13f2,null))[_0xe7fb('0x18')](function(_0x15d881){if(_0x15d881){_0x31c159[_0xe7fb('0x34')]=_[_0xe7fb('0x31')](db[_0xe7fb('0x53')][_0xe7fb('0x26')]);_0x31c159[_0xe7fb('0x2b')]=_[_0xe7fb('0x31')](_0x279663[_0xe7fb('0x2b')]);_0x31c159[_0xe7fb('0x32')]=_[_0xe7fb('0x33')](_0x31c159['model'],_0x31c159['query']);_0x2a2079['attributes']=_[_0xe7fb('0x33')](_0x31c159[_0xe7fb('0x34')],qs[_0xe7fb('0x36')](_0x279663[_0xe7fb('0x2b')]['fields']));_0x2a2079[_0xe7fb('0x35')]=_0x2a2079[_0xe7fb('0x35')][_0xe7fb('0x37')]?_0x2a2079[_0xe7fb('0x35')]:_0x31c159['model'];if(!_0x279663[_0xe7fb('0x2b')]['hasOwnProperty'](_0xe7fb('0x4e'))){_0x2a2079[_0xe7fb('0x14')]=qs[_0xe7fb('0x14')](_0x279663[_0xe7fb('0x2b')][_0xe7fb('0x14')]);_0x2a2079['offset']=qs[_0xe7fb('0x12')](_0x279663['query'][_0xe7fb('0x12')]);}_0x2a2079['order']=qs[_0xe7fb('0x50')](_0x279663[_0xe7fb('0x2b')]['sort']);_0x2a2079[_0xe7fb('0x29')]=qs[_0xe7fb('0x32')](_[_0xe7fb('0x54')](_0x279663[_0xe7fb('0x2b')],_0x31c159['filters']));_0x2a2079[_0xe7fb('0x29')][_0xe7fb('0x51')]=_0x15d881['id'];if(_0x279663[_0xe7fb('0x2b')]['filter']){_0x2a2079[_0xe7fb('0x29')]=_['merge'](_0x2a2079['where'],{'$or':_['map'](_0x2a2079[_0xe7fb('0x35')],function(_0x27019a){var _0x4a8a65={};_0x4a8a65[_0x27019a]={'$like':'%'+_0x279663[_0xe7fb('0x2b')][_0xe7fb('0x1d')]+'%'};return _0x4a8a65;})});}_0x2a2079=_[_0xe7fb('0x39')]({},_0x2a2079,_0x279663[_0xe7fb('0x3a')]);return db[_0xe7fb('0x53')][_0xe7fb('0x15')]({'where':_0x2a2079[_0xe7fb('0x29')]})[_0xe7fb('0x18')](function(_0x42190e){_0x318d06[_0xe7fb('0x15')]=_0x42190e;if(_0x279663[_0xe7fb('0x2b')][_0xe7fb('0x38')]){_0x2a2079[_0xe7fb('0x2a')]=[{'all':!![]}];}return db[_0xe7fb('0x53')][_0xe7fb('0x2c')](_0x2a2079);})[_0xe7fb('0x18')](function(_0x3c5bd9){_0x318d06[_0xe7fb('0x2d')]=_0x3c5bd9;return _0x318d06;});}})[_0xe7fb('0x18')](respondWithFilteredResult(_0x2f13f2,_0x2a2079))[_0xe7fb('0x2e')](handleError(_0x2f13f2,null));};exports['getHopperFinals']=function(_0x47568c,_0x185ac0){var _0xc3958f={'raw':!![],'where':{}};var _0x1b8fdb={};var _0x19fe06={'count':0x0,'rows':[]};return db[_0xe7fb('0x25')][_0xe7fb('0x4c')]({'where':{'id':_0x47568c['params']['id']}})['then'](handleEntityNotFound(_0x185ac0,null))[_0xe7fb('0x18')](function(_0x4e1865){if(_0x4e1865){_0x1b8fdb[_0xe7fb('0x34')]=_[_0xe7fb('0x31')](db['CmHopperFinal'][_0xe7fb('0x26')]);_0x1b8fdb[_0xe7fb('0x2b')]=_[_0xe7fb('0x31')](_0x47568c[_0xe7fb('0x2b')]);_0x1b8fdb[_0xe7fb('0x32')]=_[_0xe7fb('0x33')](_0x1b8fdb['model'],_0x1b8fdb[_0xe7fb('0x2b')]);_0xc3958f[_0xe7fb('0x35')]=_[_0xe7fb('0x33')](_0x1b8fdb[_0xe7fb('0x34')],qs[_0xe7fb('0x36')](_0x47568c[_0xe7fb('0x2b')]['fields']));_0xc3958f['attributes']=_0xc3958f['attributes'][_0xe7fb('0x37')]?_0xc3958f[_0xe7fb('0x35')]:_0x1b8fdb[_0xe7fb('0x34')];if(!_0x47568c['query'][_0xe7fb('0x4d')]('nolimit')){_0xc3958f[_0xe7fb('0x14')]=qs[_0xe7fb('0x14')](_0x47568c[_0xe7fb('0x2b')][_0xe7fb('0x14')]);_0xc3958f['offset']=qs[_0xe7fb('0x12')](_0x47568c[_0xe7fb('0x2b')][_0xe7fb('0x12')]);}_0xc3958f[_0xe7fb('0x4f')]=qs[_0xe7fb('0x50')](_0x47568c[_0xe7fb('0x2b')][_0xe7fb('0x50')]);_0xc3958f[_0xe7fb('0x29')]=qs['filters'](_['pick'](_0x47568c[_0xe7fb('0x2b')],_0x1b8fdb['filters']));_0xc3958f[_0xe7fb('0x29')][_0xe7fb('0x51')]=_0x4e1865['id'];if(_0x47568c[_0xe7fb('0x2b')][_0xe7fb('0x1d')]){_0xc3958f['where']=_['merge'](_0xc3958f[_0xe7fb('0x29')],{'$or':_[_0xe7fb('0x1e')](_0xc3958f['attributes'],function(_0x21cb12){var _0x431d21={};_0x431d21[_0x21cb12]={'$like':'%'+_0x47568c[_0xe7fb('0x2b')][_0xe7fb('0x1d')]+'%'};return _0x431d21;})});}_0xc3958f=_[_0xe7fb('0x39')]({},_0xc3958f,_0x47568c[_0xe7fb('0x3a')]);return db['CmHopperFinal'][_0xe7fb('0x15')]({'where':_0xc3958f[_0xe7fb('0x29')]})[_0xe7fb('0x18')](function(_0x2607b9){_0x19fe06[_0xe7fb('0x15')]=_0x2607b9;if(_0x47568c[_0xe7fb('0x2b')][_0xe7fb('0x38')]){_0xc3958f[_0xe7fb('0x2a')]=[{'all':!![]}];}return db[_0xe7fb('0x55')][_0xe7fb('0x2c')](_0xc3958f);})[_0xe7fb('0x18')](function(_0x3b1a90){_0x19fe06[_0xe7fb('0x2d')]=_0x3b1a90;return _0x19fe06;});}})[_0xe7fb('0x18')](respondWithFilteredResult(_0x185ac0,_0xc3958f))[_0xe7fb('0x2e')](handleError(_0x185ac0,null));};exports[_0xe7fb('0x56')]=function(_0x27c100,_0x19e86f){var _0x4b4cf6={'raw':!![],'where':{}};var _0x173d85={};var _0xa1368a={'count':0x0,'rows':[]};return db[_0xe7fb('0x25')][_0xe7fb('0x4c')]({'where':{'id':_0x27c100['params']['id']}})[_0xe7fb('0x18')](handleEntityNotFound(_0x19e86f,null))[_0xe7fb('0x18')](function(_0x4ca09c){if(_0x4ca09c){_0x173d85[_0xe7fb('0x34')]=_[_0xe7fb('0x31')](db[_0xe7fb('0x57')]['rawAttributes']);_0x173d85[_0xe7fb('0x2b')]=_[_0xe7fb('0x31')](_0x27c100['query']);_0x173d85['filters']=_[_0xe7fb('0x33')](_0x173d85[_0xe7fb('0x34')],_0x173d85[_0xe7fb('0x2b')]);_0x4b4cf6[_0xe7fb('0x35')]=_[_0xe7fb('0x33')](_0x173d85[_0xe7fb('0x34')],qs['fields'](_0x27c100[_0xe7fb('0x2b')][_0xe7fb('0x36')]));_0x4b4cf6[_0xe7fb('0x35')]=_0x4b4cf6['attributes'][_0xe7fb('0x37')]?_0x4b4cf6[_0xe7fb('0x35')]:_0x173d85[_0xe7fb('0x34')];if(!_0x27c100[_0xe7fb('0x2b')]['hasOwnProperty'](_0xe7fb('0x4e'))){_0x4b4cf6[_0xe7fb('0x14')]=qs[_0xe7fb('0x14')](_0x27c100['query'][_0xe7fb('0x14')]);_0x4b4cf6[_0xe7fb('0x12')]=qs[_0xe7fb('0x12')](_0x27c100[_0xe7fb('0x2b')]['offset']);}_0x4b4cf6[_0xe7fb('0x4f')]=qs['sort'](_0x27c100[_0xe7fb('0x2b')]['sort']);_0x4b4cf6[_0xe7fb('0x29')]=qs[_0xe7fb('0x32')](_['pick'](_0x27c100['query'],_0x173d85[_0xe7fb('0x32')]));_0x4b4cf6['where'][_0xe7fb('0x51')]=_0x4ca09c['id'];if(_0x27c100[_0xe7fb('0x2b')][_0xe7fb('0x1d')]){_0x4b4cf6[_0xe7fb('0x29')]=_['merge'](_0x4b4cf6[_0xe7fb('0x29')],{'$or':_[_0xe7fb('0x1e')](_0x4b4cf6[_0xe7fb('0x35')],function(_0x27a822){var _0x5505e5={};_0x5505e5[_0x27a822]={'$like':'%'+_0x27c100[_0xe7fb('0x2b')][_0xe7fb('0x1d')]+'%'};return _0x5505e5;})});}_0x4b4cf6=_[_0xe7fb('0x39')]({},_0x4b4cf6,_0x27c100[_0xe7fb('0x3a')]);return db[_0xe7fb('0x57')]['count']({'where':_0x4b4cf6[_0xe7fb('0x29')]})[_0xe7fb('0x18')](function(_0x54233){_0xa1368a[_0xe7fb('0x15')]=_0x54233;if(_0x27c100[_0xe7fb('0x2b')][_0xe7fb('0x38')]){_0x4b4cf6[_0xe7fb('0x2a')]=[{'all':!![]}];}return db[_0xe7fb('0x57')][_0xe7fb('0x2c')](_0x4b4cf6);})['then'](function(_0x795e32){_0xa1368a[_0xe7fb('0x2d')]=_0x795e32;return _0xa1368a;});}})[_0xe7fb('0x18')](respondWithFilteredResult(_0x19e86f,_0x4b4cf6))[_0xe7fb('0x2e')](handleError(_0x19e86f,null));};exports[_0xe7fb('0x58')]=function(_0x16f2b1,_0x3a8154){var _0x51335c={};var _0x4f4772={};var _0x4ef7b4;var _0x1bcee7;return db['VoiceQueue'][_0xe7fb('0x4c')]({'where':{'id':_0x16f2b1['params']['id']}})['then'](handleEntityNotFound(_0x3a8154,null))[_0xe7fb('0x18')](function(_0x5bd869){if(_0x5bd869){_0x4ef7b4=_0x5bd869;_0x4f4772[_0xe7fb('0x34')]=_['keys'](db[_0xe7fb('0x59')][_0xe7fb('0x26')]);_0x4f4772[_0xe7fb('0x2b')]=_[_0xe7fb('0x31')](_0x16f2b1[_0xe7fb('0x2b')]);_0x4f4772[_0xe7fb('0x32')]=_['intersection'](_0x4f4772[_0xe7fb('0x34')],_0x4f4772[_0xe7fb('0x2b')]);_0x51335c[_0xe7fb('0x35')]=_[_0xe7fb('0x33')](_0x4f4772[_0xe7fb('0x34')],qs[_0xe7fb('0x36')](_0x16f2b1[_0xe7fb('0x2b')]['fields']));_0x51335c[_0xe7fb('0x35')]=_0x51335c[_0xe7fb('0x35')][_0xe7fb('0x37')]?_0x51335c[_0xe7fb('0x35')]:_0x4f4772['model'];_0x51335c[_0xe7fb('0x4f')]=qs[_0xe7fb('0x50')](_0x16f2b1[_0xe7fb('0x2b')][_0xe7fb('0x50')]);_0x51335c[_0xe7fb('0x29')]=qs[_0xe7fb('0x32')](_[_0xe7fb('0x54')](_0x16f2b1['query'],_0x4f4772['filters']));if(_0x16f2b1[_0xe7fb('0x2b')][_0xe7fb('0x1d')]){_0x51335c['where']=_[_0xe7fb('0x39')](_0x51335c['where'],{'$or':_[_0xe7fb('0x1e')](_0x51335c[_0xe7fb('0x35')],function(_0x220d72){var _0x5ea91d={};_0x5ea91d[_0x220d72]={'$like':'%'+_0x16f2b1['query'][_0xe7fb('0x1d')]+'%'};return _0x5ea91d;})});}_0x51335c=_['merge']({},_0x51335c,_0x16f2b1['options']);return _0x4ef7b4[_0xe7fb('0x58')](_0x51335c);}})[_0xe7fb('0x18')](function(_0x3b073e){if(_0x3b073e){_0x1bcee7=_0x3b073e[_0xe7fb('0x37')];if(!_0x16f2b1[_0xe7fb('0x2b')][_0xe7fb('0x4d')](_0xe7fb('0x4e'))){_0x51335c[_0xe7fb('0x14')]=qs[_0xe7fb('0x14')](_0x16f2b1[_0xe7fb('0x2b')][_0xe7fb('0x14')]);_0x51335c[_0xe7fb('0x12')]=qs[_0xe7fb('0x12')](_0x16f2b1[_0xe7fb('0x2b')][_0xe7fb('0x12')]);}return _0x4ef7b4[_0xe7fb('0x58')](_0x51335c);}})[_0xe7fb('0x18')](function(_0x249d6f){if(_0x249d6f){return _0x249d6f?{'count':_0x1bcee7,'rows':_0x249d6f}:null;}})[_0xe7fb('0x18')](respondWithResult(_0x3a8154,null))['catch'](handleError(_0x3a8154,null));};exports[_0xe7fb('0x5a')]=function(_0x19ebe2,_0x3406ed){var _0x1631cc=_0x19ebe2['body'][_0xe7fb('0x5b')];var _0x21ee89=_[_0xe7fb('0x1e')](_0x1631cc,'id');return db[_0xe7fb('0x59')][_0xe7fb('0x2c')]({'where':{'id':_0x21ee89},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id',_0xe7fb('0x21'),'online','voicePause','interface'],'raw':!![]}]})[_0xe7fb('0x18')](function(_0x5a97c8){if(_0x5a97c8){var _0x503ae2=_['flatMap'](_0x5a97c8,function(_0x2ccf71){var _0x35be16=_0x2ccf71[_0xe7fb('0x1a')]({'plain':!![]});_0x35be16[_0xe7fb('0x5c')][_0xe7fb('0x5d')](function(_0x1db971){_0x1db971['penalty']=_['find'](_0x1631cc,{'id':_0x35be16['id']})[_0xe7fb('0x5e')];});return _0x35be16['Agents'];});return db[_0xe7fb('0x25')][_0xe7fb('0x3b')]({'where':{'id':_0x19ebe2[_0xe7fb('0x30')]['id']}})[_0xe7fb('0x18')](function(_0x3891ed){return db[_0xe7fb('0x5f')]['transaction'](function(_0x4aa499){return _0x3891ed[_0xe7fb('0x5a')](_0x21ee89,{'transaction':_0x4aa499})[_0xe7fb('0x18')](function(){return BPromise[_0xe7fb('0x60')](_0x1631cc,function(_0x7a7a6b){return db[_0xe7fb('0x61')][_0xe7fb('0x62')]({'TeamId':_0x7a7a6b['id'],'VoiceQueueId':_0x19ebe2['params']['id'],'penalty':_0x7a7a6b[_0xe7fb('0x5e')]},{'transaction':_0x4aa499});});})[_0xe7fb('0x18')](function(){return BPromise[_0xe7fb('0x60')](_0x503ae2,function(_0x33d638){return db[_0xe7fb('0x63')]['findOrCreate']({'where':{'UserId':_0x33d638['id'],'VoiceQueueId':_0x19ebe2[_0xe7fb('0x30')]['id']},'defaults':{'penalty':_0x33d638[_0xe7fb('0x5e')]},'transaction':_0x4aa499});});})[_0xe7fb('0x18')](function(){return BPromise['each'](_['filter'](_0x503ae2,{'online':!![]}),function(_0x5d30ef){return db[_0xe7fb('0x64')]['upsert']({'membername':_0x5d30ef['name'],'UserId':_0x5d30ef['id'],'queue_name':_0x3891ed[_0xe7fb('0x21')],'VoiceQueueId':_0x3891ed['id'],'interface':_['isNil'](_0x5d30ef[_0xe7fb('0x65')])?util[_0xe7fb('0x66')](_0xe7fb('0x67'),_0x5d30ef[_0xe7fb('0x21')]):_0x5d30ef[_0xe7fb('0x65')],'paused':_0x5d30ef[_0xe7fb('0x68')]||![],'penalty':_0x5d30ef[_0xe7fb('0x5e')]},{'transaction':_0x4aa499});});})['then'](function(){_0x503ae2[_0xe7fb('0x5d')](function(_0x16e9d4){socket['emit'](_0xe7fb('0x69'),{'UserId':_0x16e9d4['id'],'VoiceQueueId':_0x3891ed['id']});});});});});}})[_0xe7fb('0x18')](respondWithStatusCode(_0x3406ed,null))[_0xe7fb('0x2e')](handleError(_0x3406ed,null));};exports[_0xe7fb('0x6a')]=function(_0x366acb,_0x4d2c92){return db['Team'][_0xe7fb('0x2c')]({'where':{'id':_0x366acb[_0xe7fb('0x2b')][_0xe7fb('0x6b')]},'attributes':['id'],'include':[{'model':db[_0xe7fb('0x6c')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xe7fb('0x18')](handleEntityNotFound(_0x4d2c92,null))[_0xe7fb('0x18')](function(_0x2e276c){var _0x4efcdc=_[_0xe7fb('0x1e')](_0x2e276c,'id');var _0x146fc9=[];var _0x470718=[];var _0x55048c=squel[_0xe7fb('0x6d')]();_0x55048c[_0xe7fb('0x6e')]('tq.TeamId')[_0xe7fb('0x6f')](_0xe7fb('0x70'),'tq')['join'](_0xe7fb('0x71'),'ut',_0xe7fb('0x72'))[_0xe7fb('0x29')](_0xe7fb('0x73'),_0x366acb[_0xe7fb('0x30')]['id']);for(var _0x5d9b58=0x0;_0x5d9b58<_0x2e276c['length'];_0x5d9b58+=0x1){let _0x5986f1=_0x2e276c[_0x5d9b58];for(var _0x23ec12=0x0;_0x23ec12<_0x5986f1[_0xe7fb('0x5c')][_0xe7fb('0x37')];_0x23ec12+=0x1){let _0x36be03=_0x5986f1['Agents'][_0x23ec12];var _0x29de1e=_0x55048c[_0xe7fb('0x44')]();_0x29de1e['where']('ut.UserId\x20=\x20?',_0x36be03['id']);_0x470718[_0xe7fb('0x74')](db[_0xe7fb('0x5f')][_0xe7fb('0x2b')](_0x29de1e[_0xe7fb('0x75')](),{'type':db[_0xe7fb('0x5f')]['QueryTypes'][_0xe7fb('0x76')]})[_0xe7fb('0x18')](function(_0xe52155){if(_0xe52155['length']===0x1){return _0x36be03['id'];}else{var _0x20b1fc=_[_0xe7fb('0x77')](_['map'](_0xe52155,_0xe7fb('0x78')),function(_0x6ec6b6){return _[_0xe7fb('0x79')](_0x4efcdc,_0x6ec6b6);});if(_0x20b1fc){return _0x36be03['id'];}}}));}}return BPromise[_0xe7fb('0x7a')](_0x470718)['then'](function(_0x4ed327){_0x146fc9=_(_0x146fc9)[_0xe7fb('0x7b')](_0x4ed327)[_0xe7fb('0x7c')]()[_0xe7fb('0x1f')]();return db['VoiceQueue'][_0xe7fb('0x3b')]({'where':{'id':_0x366acb[_0xe7fb('0x30')]['id']}})[_0xe7fb('0x18')](function(_0x49fb4b){return db[_0xe7fb('0x5f')][_0xe7fb('0x7d')](function(_0x362fe1){return _0x49fb4b['removeTeams'](_0x366acb[_0xe7fb('0x2b')][_0xe7fb('0x6b')],{'transaction':_0x362fe1})[_0xe7fb('0x18')](function(){if(!_[_0xe7fb('0x7e')](_0x146fc9)){return _0x49fb4b[_0xe7fb('0x7f')](_0x146fc9,{'transaction':_0x362fe1})[_0xe7fb('0x18')](function(){return db[_0xe7fb('0x64')][_0xe7fb('0x19')]({'where':{'VoiceQueueId':_0x366acb['params']['id'],'UserId':_0x146fc9},'transaction':_0x362fe1});});}})[_0xe7fb('0x18')](function(){_0x146fc9[_0xe7fb('0x5d')](function(_0x5dadac){socket['emit'](_0xe7fb('0x80'),{'UserId':_0x5dadac,'VoiceQueueId':_0x49fb4b['id']});});});});});});})[_0xe7fb('0x18')](respondWithStatusCode(_0x4d2c92,null))[_0xe7fb('0x2e')](handleError(_0x4d2c92,null));};exports[_0xe7fb('0x81')]=function(_0x4b58de,_0x4386ea){var _0x41c771,_0x489c9d;return db[_0xe7fb('0x25')][_0xe7fb('0x3b')]({'where':{'id':_0x4b58de[_0xe7fb('0x30')]['id']}})[_0xe7fb('0x18')](handleEntityNotFound(_0x4386ea,null))[_0xe7fb('0x18')](function(_0x39fef6){if(_0x39fef6){_0x489c9d=_0x39fef6;return _0x39fef6[_0xe7fb('0x81')](_0x4b58de['body'][_0xe7fb('0x6b')],_['omit'](_0x4b58de[_0xe7fb('0x3d')],['ids','id'])||{})['spread'](function(_0x260067){for(var _0xed4af4=0x0;_0xed4af4<_0x4b58de[_0xe7fb('0x3d')][_0xe7fb('0x6b')][_0xe7fb('0x37')];_0xed4af4+=0x1){socket[_0xe7fb('0x82')](_0xe7fb('0x69'),{'UserId':Number(_0x4b58de['body'][_0xe7fb('0x6b')][_0xed4af4]),'VoiceQueueId':Number(_0x4b58de[_0xe7fb('0x30')]['id'])});}return _0x260067;});}})[_0xe7fb('0x18')](function(_0x19a7ec){_0x41c771=_0x19a7ec||[];if(_0x489c9d){return db[_0xe7fb('0x6c')][_0xe7fb('0x2c')]({'where':{'id':_0x4b58de[_0xe7fb('0x3d')]['ids']},'attributes':['id',_0xe7fb('0x21'),_0xe7fb('0x83'),_0xe7fb('0x68'),'interface'],'raw':!![]});}})[_0xe7fb('0x18')](function(_0x52c758){if(!_['isEmpty'](_0x52c758)){var _0x4930c6=[];for(var _0x1a3d44=0x0;_0x1a3d44<_0x52c758[_0xe7fb('0x37')];_0x1a3d44++){if(_0x52c758[_0x1a3d44]['online']){_0x4930c6[_0xe7fb('0x74')](db[_0xe7fb('0x64')]['upsert']({'membername':_0x52c758[_0x1a3d44]['name'],'UserId':_0x52c758[_0x1a3d44]['id'],'queue_name':_0x489c9d[_0xe7fb('0x21')],'VoiceQueueId':_0x489c9d['id'],'interface':_[_0xe7fb('0x84')](_0x52c758[_0x1a3d44][_0xe7fb('0x65')])?util['format'](_0xe7fb('0x67'),_0x52c758[_0x1a3d44][_0xe7fb('0x21')]):_0x52c758[_0x1a3d44]['interface'],'paused':_0x52c758[_0x1a3d44]['voicePause']||![],'penalty':_0x4b58de[_0xe7fb('0x3d')]['penalty']||0x0}));}}return BPromise['all'](_0x4930c6);}})['then'](function(){return _0x41c771;})[_0xe7fb('0x18')](respondWithResult(_0x4386ea,null))[_0xe7fb('0x2e')](handleError(_0x4386ea,null));};exports['removeAgents']=function(_0x35b5ad,_0x55c935){return db[_0xe7fb('0x25')][_0xe7fb('0x3b')]({'where':{'id':_0x35b5ad[_0xe7fb('0x30')]['id']}})[_0xe7fb('0x18')](handleEntityNotFound(_0x55c935,null))[_0xe7fb('0x18')](function(_0x4736bf){if(_0x4736bf){return _0x4736bf[_0xe7fb('0x7f')](_0x35b5ad[_0xe7fb('0x2b')][_0xe7fb('0x6b')])[_0xe7fb('0x18')](function(){if(_[_0xe7fb('0x85')](_0x35b5ad[_0xe7fb('0x2b')][_0xe7fb('0x6b')])){for(var _0x5744a8=0x0;_0x5744a8<_0x35b5ad[_0xe7fb('0x2b')][_0xe7fb('0x6b')]['length'];_0x5744a8+=0x1){socket['emit'](_0xe7fb('0x80'),{'UserId':Number(_0x35b5ad['query'][_0xe7fb('0x6b')][_0x5744a8]),'VoiceQueueId':Number(_0x35b5ad[_0xe7fb('0x30')]['id'])});}}else{socket[_0xe7fb('0x82')](_0xe7fb('0x80'),{'UserId':Number(_0x35b5ad[_0xe7fb('0x2b')]['ids']),'VoiceQueueId':Number(_0x35b5ad['params']['id'])});}});}})[_0xe7fb('0x18')](function(_0x27b153){return db[_0xe7fb('0x64')][_0xe7fb('0x19')]({'where':{'VoiceQueueId':_0x35b5ad[_0xe7fb('0x30')]['id'],'UserId':_0x35b5ad['query'][_0xe7fb('0x6b')]}})['then'](function(){return _0x27b153;});})[_0xe7fb('0x18')](respondWithStatusCode(_0x55c935,null))[_0xe7fb('0x2e')](handleError(_0x55c935,null));};exports['getAgents']=function(_0x5d0f05,_0x519e35){var _0x16ae95={};var _0xb1a3fa={};var _0x59e676;var _0x577895;return db[_0xe7fb('0x25')][_0xe7fb('0x4c')]({'where':{'id':_0x5d0f05['params']['id']}})['then'](handleEntityNotFound(_0x519e35,null))[_0xe7fb('0x18')](function(_0xe1613c){if(_0xe1613c){_0x59e676=_0xe1613c;_0xb1a3fa[_0xe7fb('0x34')]=_[_0xe7fb('0x31')](db['User'][_0xe7fb('0x26')]);_0xb1a3fa[_0xe7fb('0x2b')]=_[_0xe7fb('0x31')](_0x5d0f05[_0xe7fb('0x2b')]);_0xb1a3fa[_0xe7fb('0x32')]=_['intersection'](_0xb1a3fa['model'],_0xb1a3fa[_0xe7fb('0x2b')]);_0x16ae95[_0xe7fb('0x35')]=_[_0xe7fb('0x33')](_0xb1a3fa[_0xe7fb('0x34')],qs[_0xe7fb('0x36')](_0x5d0f05['query'][_0xe7fb('0x36')]));_0x16ae95['attributes']=_0x16ae95['attributes'][_0xe7fb('0x37')]?_0x16ae95[_0xe7fb('0x35')]:_0xb1a3fa[_0xe7fb('0x34')];_0x16ae95[_0xe7fb('0x4f')]=qs['sort'](_0x5d0f05[_0xe7fb('0x2b')]['sort']);_0x16ae95['where']=qs[_0xe7fb('0x32')](_[_0xe7fb('0x54')](_0x5d0f05[_0xe7fb('0x2b')],_0xb1a3fa[_0xe7fb('0x32')]));if(_0x5d0f05[_0xe7fb('0x2b')]['filter']){_0x16ae95['where']=_[_0xe7fb('0x39')](_0x16ae95['where'],{'$or':_['map'](_0x16ae95[_0xe7fb('0x35')],function(_0x5763dd){var _0x4cab2f={};_0x4cab2f[_0x5763dd]={'$like':'%'+_0x5d0f05[_0xe7fb('0x2b')][_0xe7fb('0x1d')]+'%'};return _0x4cab2f;})});}_0x16ae95=_[_0xe7fb('0x39')]({},_0x16ae95,_0x5d0f05[_0xe7fb('0x3a')]);return _0x59e676[_0xe7fb('0x86')](_0x16ae95);}})['then'](function(_0xcf6d2){if(_0xcf6d2){_0x577895=_0xcf6d2['length'];if(!_0x5d0f05['query'][_0xe7fb('0x4d')](_0xe7fb('0x4e'))){_0x16ae95[_0xe7fb('0x14')]=qs[_0xe7fb('0x14')](_0x5d0f05[_0xe7fb('0x2b')][_0xe7fb('0x14')]);_0x16ae95[_0xe7fb('0x12')]=qs['offset'](_0x5d0f05['query'][_0xe7fb('0x12')]);}return _0x59e676['getAgents'](_0x16ae95);}})[_0xe7fb('0x18')](function(_0x51ff1e){if(_0x51ff1e){return _0x51ff1e?{'count':_0x577895,'rows':_0x51ff1e}:null;}})[_0xe7fb('0x18')](respondWithResult(_0x519e35,null))['catch'](handleError(_0x519e35,null));};exports[_0xe7fb('0x87')]=function(_0x4407ee,_0x56869b){var _0x2139e3={};var _0x2e0e13={};var _0x23e1db;var _0x2a2fa6;return db['VoiceQueue'][_0xe7fb('0x4c')]({'where':{'id':_0x4407ee[_0xe7fb('0x30')]['id']}})[_0xe7fb('0x18')](handleEntityNotFound(_0x56869b,null))[_0xe7fb('0x18')](function(_0x454ef0){if(_0x454ef0){_0x23e1db=_0x454ef0;_0x2e0e13['model']=_[_0xe7fb('0x31')](db[_0xe7fb('0x64')][_0xe7fb('0x26')]);_0x2e0e13[_0xe7fb('0x2b')]=_[_0xe7fb('0x31')](_0x4407ee[_0xe7fb('0x2b')]);_0x2e0e13[_0xe7fb('0x32')]=_[_0xe7fb('0x33')](_0x2e0e13[_0xe7fb('0x34')],_0x2e0e13[_0xe7fb('0x2b')]);_0x2139e3[_0xe7fb('0x35')]=_[_0xe7fb('0x33')](_0x2e0e13[_0xe7fb('0x34')],qs[_0xe7fb('0x36')](_0x4407ee[_0xe7fb('0x2b')]['fields']));_0x2139e3['attributes']=_0x2139e3[_0xe7fb('0x35')][_0xe7fb('0x37')]?_0x2139e3[_0xe7fb('0x35')]:_0x2e0e13[_0xe7fb('0x34')];_0x2139e3[_0xe7fb('0x4f')]=qs[_0xe7fb('0x50')](_0x4407ee[_0xe7fb('0x2b')][_0xe7fb('0x50')]);_0x2139e3['where']=qs[_0xe7fb('0x32')](_[_0xe7fb('0x54')](_0x4407ee[_0xe7fb('0x2b')],_0x2e0e13[_0xe7fb('0x32')]));if(_0x4407ee[_0xe7fb('0x2b')][_0xe7fb('0x1d')]){_0x2139e3['where']=_[_0xe7fb('0x39')](_0x2139e3[_0xe7fb('0x29')],{'$or':_['map'](_0x2139e3[_0xe7fb('0x35')],function(_0x5dde83){var _0x21d86e={};_0x21d86e[_0x5dde83]={'$like':'%'+_0x4407ee['query'][_0xe7fb('0x1d')]+'%'};return _0x21d86e;})});}_0x2139e3=_[_0xe7fb('0x39')]({},_0x2139e3,_0x4407ee['options']);return _0x23e1db[_0xe7fb('0x87')](_0x2139e3);}})[_0xe7fb('0x18')](function(_0x5892cd){if(_0x5892cd){_0x2a2fa6=_0x5892cd['length'];if(!_0x4407ee['query']['hasOwnProperty'](_0xe7fb('0x4e'))){_0x2139e3[_0xe7fb('0x14')]=qs[_0xe7fb('0x14')](_0x4407ee[_0xe7fb('0x2b')][_0xe7fb('0x14')]);_0x2139e3[_0xe7fb('0x12')]=qs['offset'](_0x4407ee[_0xe7fb('0x2b')][_0xe7fb('0x12')]);}return _0x23e1db[_0xe7fb('0x87')](_0x2139e3);}})['then'](function(_0x3c56ad){return _0x3c56ad?{'count':_0x2a2fa6,'rows':_0x3c56ad}:null;})['then'](respondWithResult(_0x56869b,null))[_0xe7fb('0x2e')](handleError(_0x56869b,null));};exports['getLists']=function(_0x4880a7,_0x27669f){var _0x3d8b9a={};var _0x3503ac={};var _0x413843;var _0x55ce0f;return db[_0xe7fb('0x25')][_0xe7fb('0x4c')]({'where':{'id':_0x4880a7[_0xe7fb('0x30')]['id']}})[_0xe7fb('0x18')](handleEntityNotFound(_0x27669f,null))[_0xe7fb('0x18')](function(_0x21d9b0){if(_0x21d9b0){_0x413843=_0x21d9b0;_0x3503ac[_0xe7fb('0x34')]=_[_0xe7fb('0x31')](db[_0xe7fb('0x88')][_0xe7fb('0x26')]);_0x3503ac[_0xe7fb('0x2b')]=_[_0xe7fb('0x31')](_0x4880a7[_0xe7fb('0x2b')]);_0x3503ac[_0xe7fb('0x32')]=_[_0xe7fb('0x33')](_0x3503ac[_0xe7fb('0x34')],_0x3503ac[_0xe7fb('0x2b')]);_0x3d8b9a['attributes']=_[_0xe7fb('0x33')](_0x3503ac[_0xe7fb('0x34')],qs['fields'](_0x4880a7[_0xe7fb('0x2b')][_0xe7fb('0x36')]));_0x3d8b9a[_0xe7fb('0x35')]=_0x3d8b9a['attributes'][_0xe7fb('0x37')]?_0x3d8b9a[_0xe7fb('0x35')]:_0x3503ac[_0xe7fb('0x34')];_0x3d8b9a[_0xe7fb('0x4f')]=qs[_0xe7fb('0x50')](_0x4880a7[_0xe7fb('0x2b')]['sort']);_0x3d8b9a[_0xe7fb('0x29')]=qs[_0xe7fb('0x32')](_[_0xe7fb('0x54')](_0x4880a7['query'],_0x3503ac[_0xe7fb('0x32')]));if(_0x4880a7[_0xe7fb('0x2b')][_0xe7fb('0x1d')]){_0x3d8b9a[_0xe7fb('0x29')]=_['merge'](_0x3d8b9a[_0xe7fb('0x29')],{'$or':_[_0xe7fb('0x1e')](_0x3d8b9a[_0xe7fb('0x35')],function(_0x39ffed){var _0x47e833={};_0x47e833[_0x39ffed]={'$like':'%'+_0x4880a7['query'][_0xe7fb('0x1d')]+'%'};return _0x47e833;})});}_0x3d8b9a=_[_0xe7fb('0x39')]({},_0x3d8b9a,_0x4880a7[_0xe7fb('0x3a')]);return _0x413843[_0xe7fb('0x89')](_0x3d8b9a);}})['then'](function(_0x57750a){if(_0x57750a){_0x55ce0f=_0x57750a[_0xe7fb('0x37')];if(!_0x4880a7['query'][_0xe7fb('0x4d')]('nolimit')){_0x3d8b9a[_0xe7fb('0x14')]=qs[_0xe7fb('0x14')](_0x4880a7[_0xe7fb('0x2b')][_0xe7fb('0x14')]);_0x3d8b9a[_0xe7fb('0x12')]=qs[_0xe7fb('0x12')](_0x4880a7[_0xe7fb('0x2b')][_0xe7fb('0x12')]);}return _0x413843[_0xe7fb('0x89')](_0x3d8b9a);}})[_0xe7fb('0x18')](function(_0x14014d){if(_0x14014d){return _0x14014d?{'count':_0x55ce0f,'rows':_0x14014d}:null;}})[_0xe7fb('0x18')](respondWithResult(_0x27669f,null))[_0xe7fb('0x2e')](handleError(_0x27669f,null));};exports[_0xe7fb('0x8a')]=function(_0x4d9a76,_0x23a49e){var _0x30651f=moment()[_0xe7fb('0x66')](_0xe7fb('0x8b'));var _0x582862,_0x5b6da5;return db[_0xe7fb('0x25')][_0xe7fb('0x3b')]({'where':{'id':_0x4d9a76[_0xe7fb('0x30')]['id']}})[_0xe7fb('0x18')](handleEntityNotFound(_0x23a49e,null))['then'](function(_0x4e09d8){if(_0x4e09d8){_0x5b6da5=_0x4e09d8;return _0x4e09d8[_0xe7fb('0x8a')](_0x4d9a76[_0xe7fb('0x3d')][_0xe7fb('0x6b')],_[_0xe7fb('0x45')](_0x4d9a76[_0xe7fb('0x3d')],[_0xe7fb('0x6b'),'id'])||{});}return null;})[_0xe7fb('0x8c')](function(_0x2e2167){var _0xd7f440;_0x582862=_0x2e2167||[];var _0xc8055f=[];if(_0x2e2167){for(var _0x45b449=0x0;_0x45b449<_0x2e2167['length'];_0x45b449+=0x1){var _0x366c06=_0x2e2167[_0x45b449][_0xe7fb('0x1a')]({'plain':!![]});_0x5b6da5[_0xe7fb('0x8d')]=_0x4d9a76[_0xe7fb('0x3d')][_0xe7fb('0x8d')]?_0x4d9a76[_0xe7fb('0x3d')][_0xe7fb('0x8d')]:_0x5b6da5[_0xe7fb('0x8d')];switch(_0x5b6da5['dialCheckDuplicateType']){case _0xe7fb('0x8e'):_0xd7f440=squel[_0xe7fb('0x8f')]()[_0xe7fb('0x90')](_0xe7fb('0x91'))['fromQuery']([_0xe7fb('0x92'),_0xe7fb('0x93'),_0xe7fb('0x94'),_0xe7fb('0x95'),_0xe7fb('0x51'),_0xe7fb('0x47'),_0xe7fb('0x46')],squel[_0xe7fb('0x6d')]()['field'](_0xe7fb('0x92'),_0xe7fb('0x92'))[_0xe7fb('0x6e')]('\x27'+_0x30651f+'\x27',_0xe7fb('0x93'))['field']('id',_0xe7fb('0x94'))[_0xe7fb('0x6e')](_0x366c06[_0xe7fb('0x96')][_0xe7fb('0x75')](),_0xe7fb('0x95'))[_0xe7fb('0x6e')](_0x4d9a76[_0xe7fb('0x30')]['id']['toString'](),'VoiceQueueId')[_0xe7fb('0x6e')]('\x27'+_0x30651f+'\x27','createdAt')['field']('\x27'+_0x30651f+'\x27',_0xe7fb('0x46'))[_0xe7fb('0x6f')]('cm_contacts')[_0xe7fb('0x29')](_0xe7fb('0x97'))['where'](_0xe7fb('0x98'),_0x366c06['CmListId'][_0xe7fb('0x75')]())['where']('phone\x20IS\x20NOT\x20NULL')[_0xe7fb('0x29')]('phone\x20NOT\x20IN\x20(?)',squel['select']()[_0xe7fb('0x6e')](_0xe7fb('0x99'))['from'](_0xe7fb('0x9a'))[_0xe7fb('0x29')](_0xe7fb('0x73'),_0x4d9a76[_0xe7fb('0x30')]['id'][_0xe7fb('0x75')]()))[_0xe7fb('0x29')](_0xe7fb('0x9b'),squel['select']()['field'](_0xe7fb('0x9c'))['from']('cm_hopper')[_0xe7fb('0x29')]('VoiceQueueId\x20=\x20?',_0x4d9a76['params']['id'][_0xe7fb('0x75')]())))['toString']();break;case _0xe7fb('0x9d'):_0xd7f440=squel[_0xe7fb('0x8f')]()[_0xe7fb('0x90')](_0xe7fb('0x91'))[_0xe7fb('0x9e')]([_0xe7fb('0x92'),'scheduledAt',_0xe7fb('0x94'),_0xe7fb('0x95'),_0xe7fb('0x51'),_0xe7fb('0x47'),_0xe7fb('0x46')],squel[_0xe7fb('0x6d')]()[_0xe7fb('0x6e')](_0xe7fb('0x92'),_0xe7fb('0x92'))['field']('\x27'+_0x30651f+'\x27',_0xe7fb('0x93'))[_0xe7fb('0x6e')]('id',_0xe7fb('0x94'))[_0xe7fb('0x6e')](_0x366c06[_0xe7fb('0x96')][_0xe7fb('0x75')](),_0xe7fb('0x95'))['field'](_0x4d9a76['params']['id']['toString'](),_0xe7fb('0x51'))[_0xe7fb('0x6e')]('\x27'+_0x30651f+'\x27',_0xe7fb('0x47'))[_0xe7fb('0x6e')]('\x27'+_0x30651f+'\x27',_0xe7fb('0x46'))[_0xe7fb('0x6f')](_0xe7fb('0x9f'))['where'](_0xe7fb('0x97'))[_0xe7fb('0x29')](_0xe7fb('0x98'),_0x366c06['CmListId']['toString']())[_0xe7fb('0x29')](_0xe7fb('0xa0'))[_0xe7fb('0x29')](_0xe7fb('0x9b'),squel[_0xe7fb('0x6d')]()[_0xe7fb('0x6e')](_0xe7fb('0x9c'))['from'](_0xe7fb('0x91'))[_0xe7fb('0x29')](_0xe7fb('0x73'),_0x4d9a76['params']['id'][_0xe7fb('0x75')]())))['toString']();break;default:_0xd7f440=squel[_0xe7fb('0x8f')]()['into'](_0xe7fb('0x91'))[_0xe7fb('0x9e')]([_0xe7fb('0x92'),_0xe7fb('0x93'),_0xe7fb('0x94'),'ListId',_0xe7fb('0x51'),'createdAt','updatedAt'],squel['select']()[_0xe7fb('0x6e')]('phone','phone')['field']('\x27'+_0x30651f+'\x27',_0xe7fb('0x93'))[_0xe7fb('0x6e')]('id','ContactId')[_0xe7fb('0x6e')](_0x366c06[_0xe7fb('0x96')]['toString'](),_0xe7fb('0x95'))['field'](_0x4d9a76[_0xe7fb('0x30')]['id'][_0xe7fb('0x75')](),_0xe7fb('0x51'))[_0xe7fb('0x6e')]('\x27'+_0x30651f+'\x27',_0xe7fb('0x47'))[_0xe7fb('0x6e')]('\x27'+_0x30651f+'\x27',_0xe7fb('0x46'))[_0xe7fb('0x6f')](_0xe7fb('0x9f'))['where'](_0xe7fb('0x97'))[_0xe7fb('0x29')](_0xe7fb('0x98'),_0x366c06[_0xe7fb('0x96')]['toString']())[_0xe7fb('0x29')](_0xe7fb('0xa0')))['toString']();}_0xc8055f['push'](db[_0xe7fb('0x5f')]['query'](_0xd7f440));}return BPromise[_0xe7fb('0x7a')](_0xc8055f);}})[_0xe7fb('0x18')](function(){var _0x20b22f=[];var _0x2e22c1=squel[_0xe7fb('0x8f')]()['into'](_0xe7fb('0xa1'))['fromQuery']([_0xe7fb('0xa2'),_0xe7fb('0x92'),_0xe7fb('0xa3'),'createdAt',_0xe7fb('0x46')],squel[_0xe7fb('0x6d')]()[_0xe7fb('0x6e')](_0xe7fb('0xa4'))[_0xe7fb('0x6e')]('ci.item')[_0xe7fb('0x6e')](_0xe7fb('0xa5'))[_0xe7fb('0x6e')]('\x27'+_0x30651f+'\x27',_0xe7fb('0x47'))[_0xe7fb('0x6e')]('\x27'+_0x30651f+'\x27',_0xe7fb('0x46'))[_0xe7fb('0x6f')](_0xe7fb('0xa6'),'ci')[_0xe7fb('0xa7')]('cm_hopper','h',_0xe7fb('0xa8'))[_0xe7fb('0x29')]('h.scheduledat=?',_0x30651f)[_0xe7fb('0x29')]('ci.ItemClass=?',_0xe7fb('0xa9')))[_0xe7fb('0x75')]();_0x20b22f[_0xe7fb('0x74')](db[_0xe7fb('0x5f')][_0xe7fb('0x2b')](_0x2e22c1));return BPromise[_0xe7fb('0x7a')](_0x20b22f);})[_0xe7fb('0x18')](function(){return _0x582862;})['then'](respondWithResult(_0x23a49e,null))[_0xe7fb('0x2e')](handleError(_0x23a49e,null));};exports[_0xe7fb('0xaa')]=function(_0x3c04f4,_0x290cc3){return db[_0xe7fb('0x25')][_0xe7fb('0x3b')]({'where':{'id':_0x3c04f4['params']['id']}})[_0xe7fb('0x18')](handleEntityNotFound(_0x290cc3,null))[_0xe7fb('0x18')](function(_0x3ed48f){if(_0x3ed48f){return _0x3ed48f['removeLists'](_0x3c04f4[_0xe7fb('0x2b')][_0xe7fb('0x6b')]);}})[_0xe7fb('0x18')](function(_0x2eeff4){if(_0x2eeff4){return db[_0xe7fb('0x52')]['destroy']({'where':{'ListId':_0x3c04f4[_0xe7fb('0x2b')][_0xe7fb('0x6b')],'VoiceQueueId':_0x3c04f4[_0xe7fb('0x30')]['id']}})[_0xe7fb('0x18')](function(){return _0x2eeff4;});}})[_0xe7fb('0x18')](respondWithStatusCode(_0x290cc3,null))[_0xe7fb('0x2e')](handleError(_0x290cc3,null));};exports[_0xe7fb('0xab')]=function(_0xcaad94,_0x5b88bd){var _0x143dbb={};var _0x715444={};var _0x92a316;var _0x30a834;return db[_0xe7fb('0x25')][_0xe7fb('0x4c')]({'where':{'id':_0xcaad94[_0xe7fb('0x30')]['id']}})[_0xe7fb('0x18')](handleEntityNotFound(_0x5b88bd,null))[_0xe7fb('0x18')](function(_0x1b1818){if(_0x1b1818){_0x92a316=_0x1b1818;_0x715444[_0xe7fb('0x34')]=_[_0xe7fb('0x31')](db[_0xe7fb('0x88')][_0xe7fb('0x26')]);_0x715444[_0xe7fb('0x2b')]=_['keys'](_0xcaad94[_0xe7fb('0x2b')]);_0x715444[_0xe7fb('0x32')]=_[_0xe7fb('0x33')](_0x715444[_0xe7fb('0x34')],_0x715444[_0xe7fb('0x2b')]);_0x143dbb['attributes']=_[_0xe7fb('0x33')](_0x715444[_0xe7fb('0x34')],qs[_0xe7fb('0x36')](_0xcaad94['query']['fields']));_0x143dbb[_0xe7fb('0x35')]=_0x143dbb[_0xe7fb('0x35')][_0xe7fb('0x37')]?_0x143dbb[_0xe7fb('0x35')]:_0x715444['model'];_0x143dbb[_0xe7fb('0x4f')]=qs[_0xe7fb('0x50')](_0xcaad94[_0xe7fb('0x2b')][_0xe7fb('0x50')]);_0x143dbb['where']=qs[_0xe7fb('0x32')](_[_0xe7fb('0x54')](_0xcaad94['query'],_0x715444[_0xe7fb('0x32')]));if(_0xcaad94[_0xe7fb('0x2b')]['filter']){_0x143dbb['where']=_[_0xe7fb('0x39')](_0x143dbb[_0xe7fb('0x29')],{'$or':_[_0xe7fb('0x1e')](_0x143dbb['attributes'],function(_0x3b2375){var _0x170347={};_0x170347[_0x3b2375]={'$like':'%'+_0xcaad94[_0xe7fb('0x2b')][_0xe7fb('0x1d')]+'%'};return _0x170347;})});}_0x143dbb=_['merge']({},_0x143dbb,_0xcaad94[_0xe7fb('0x3a')]);return _0x92a316[_0xe7fb('0xab')](_0x143dbb);}})[_0xe7fb('0x18')](function(_0x2a984e){if(_0x2a984e){_0x30a834=_0x2a984e[_0xe7fb('0x37')];if(!_0xcaad94[_0xe7fb('0x2b')]['hasOwnProperty']('nolimit')){_0x143dbb[_0xe7fb('0x14')]=qs[_0xe7fb('0x14')](_0xcaad94[_0xe7fb('0x2b')][_0xe7fb('0x14')]);_0x143dbb[_0xe7fb('0x12')]=qs['offset'](_0xcaad94[_0xe7fb('0x2b')][_0xe7fb('0x12')]);}return _0x92a316[_0xe7fb('0xab')](_0x143dbb);}})[_0xe7fb('0x18')](function(_0x286382){if(_0x286382){return _0x286382?{'count':_0x30a834,'rows':_0x286382}:null;}})[_0xe7fb('0x18')](respondWithResult(_0x5b88bd,null))[_0xe7fb('0x2e')](handleError(_0x5b88bd,null));};exports[_0xe7fb('0xac')]=function(_0x325c7b,_0x38472b){var _0x1a33f8;return db[_0xe7fb('0x25')][_0xe7fb('0x3b')]({'where':{'id':_0x325c7b[_0xe7fb('0x30')]['id']}})['then'](handleEntityNotFound(_0x38472b,null))[_0xe7fb('0x18')](function(_0x291a8d){if(_0x291a8d){return _0x291a8d['addBlackLists'](_0x325c7b[_0xe7fb('0x3d')]['ids'],_[_0xe7fb('0x45')](_0x325c7b[_0xe7fb('0x3d')],[_0xe7fb('0x6b'),'id'])||{});}return null;})[_0xe7fb('0x8c')](function(_0x3ade81){var _0x1b9ea2;_0x1a33f8=_0x3ade81||[];var _0x418561=[];if(_0x3ade81){for(var _0x3ec66a=0x0;_0x3ec66a<_0x3ade81[_0xe7fb('0x37')];_0x3ec66a+=0x1){var _0x1c76a1=_0x3ade81[_0x3ec66a][_0xe7fb('0x1a')]({'plain':!![]});_0x1b9ea2=squel[_0xe7fb('0x8f')]()[_0xe7fb('0x90')](_0xe7fb('0xad'))[_0xe7fb('0x9e')]([_0xe7fb('0x92'),_0xe7fb('0x94'),_0xe7fb('0x95'),_0xe7fb('0x51'),_0xe7fb('0x47'),_0xe7fb('0x46')],squel[_0xe7fb('0x6d')]()[_0xe7fb('0x6e')]('phone',_0xe7fb('0x92'))[_0xe7fb('0x6e')]('id',_0xe7fb('0x94'))['field'](_0x1c76a1[_0xe7fb('0x96')][_0xe7fb('0x75')](),_0xe7fb('0x95'))[_0xe7fb('0x6e')](_0x325c7b[_0xe7fb('0x30')]['id'][_0xe7fb('0x75')](),'VoiceQueueId')[_0xe7fb('0x6e')](_0xe7fb('0xae'),_0xe7fb('0x47'))[_0xe7fb('0x6e')]('NOW()',_0xe7fb('0x46'))[_0xe7fb('0x6f')](_0xe7fb('0x9f'))[_0xe7fb('0x29')]('deletedAt\x20IS\x20NULL')[_0xe7fb('0x29')](_0xe7fb('0x98'),_0x1c76a1[_0xe7fb('0x96')][_0xe7fb('0x75')]())[_0xe7fb('0x29')](_0xe7fb('0xa0')))['toString']();_0x418561[_0xe7fb('0x74')](db[_0xe7fb('0x5f')]['query'](_0x1b9ea2));}return BPromise[_0xe7fb('0x7a')](_0x418561);}})[_0xe7fb('0x18')](function(){return _0x1a33f8;})['then'](respondWithResult(_0x38472b,null))[_0xe7fb('0x2e')](handleError(_0x38472b,null));};exports['removeBlackLists']=function(_0x127051,_0x4d9376){return db[_0xe7fb('0x25')]['find']({'where':{'id':_0x127051['params']['id']}})['then'](handleEntityNotFound(_0x4d9376,null))['then'](function(_0x547d29){if(_0x547d29){return _0x547d29[_0xe7fb('0xaf')](_0x127051[_0xe7fb('0x2b')]['ids']);}})[_0xe7fb('0x18')](function(_0x5c0baf){if(_0x5c0baf){return db['CmHopperBlack']['destroy']({'where':{'ListId':_0x127051['query'][_0xe7fb('0x6b')],'VoiceQueueId':_0x127051[_0xe7fb('0x30')]['id']}})[_0xe7fb('0x18')](function(){return _0x5c0baf;});}})['then'](respondWithStatusCode(_0x4d9376,null))[_0xe7fb('0x2e')](handleError(_0x4d9376,null));}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.events.js b/server/api/voiceQueue/voiceQueue.events.js index f899597..b053251 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 _0x8139=['VoiceQueue','save','update','emit','exports','events'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x8139,0x143));var _0x9813=function(_0x4715be,_0x1b9087){_0x4715be=_0x4715be-0x0;var _0x1b01cb=_0x8139[_0x4715be];return _0x1b01cb;};'use strict';var EventEmitter=require(_0x9813('0x0'));var VoiceQueue=require('../../mysqldb')['db'][_0x9813('0x1')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x9813('0x2'),'afterUpdate':_0x9813('0x3'),'afterDestroy':'remove'};function emitEvent(_0x10d34b){return function(_0x3ae681,_0x2357bd,_0x52618a){VoiceQueueEvents[_0x9813('0x4')](_0x10d34b+':'+_0x3ae681['id'],_0x3ae681);VoiceQueueEvents[_0x9813('0x4')](_0x10d34b,_0x3ae681);_0x52618a(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueue['hook'](e,emitEvent(event));}}module[_0x9813('0x5')]=VoiceQueueEvents; \ No newline at end of file +var _0xa19a=['../../mysqldb','VoiceQueue','setMaxListeners','remove','emit','hasOwnProperty','exports'];(function(_0x25c988,_0xce8221){var _0x45fcc2=function(_0x47fba5){while(--_0x47fba5){_0x25c988['push'](_0x25c988['shift']());}};_0x45fcc2(++_0xce8221);}(_0xa19a,0x1e3));var _0xaa19=function(_0xa9c764,_0x134a9a){_0xa9c764=_0xa9c764-0x0;var _0x1913d0=_0xa19a[_0xa9c764];return _0x1913d0;};'use strict';var EventEmitter=require('events');var VoiceQueue=require(_0xaa19('0x0'))['db'][_0xaa19('0x1')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0xaa19('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xaa19('0x3')};function emitEvent(_0x226bf7){return function(_0x236d44,_0x3be491,_0x533f8c){VoiceQueueEvents['emit'](_0x226bf7+':'+_0x236d44['id'],_0x236d44);VoiceQueueEvents[_0xaa19('0x4')](_0x226bf7,_0x236d44);_0x533f8c(null);};}for(var e in events){if(events[_0xaa19('0x5')](e)){var event=events[e];VoiceQueue['hook'](e,emitEvent(event));}}module[_0xaa19('0x6')]=VoiceQueueEvents; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.model.js b/server/api/voiceQueue/voiceQueue.model.js index b793cb0..907505f 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 _0xa9e0=['../../config/environment','./voiceQueue.attributes','exports','define','VoiceQueue','lodash','util','../../config/logger','bluebird','path','rimraf'];(function(_0x5968f4,_0x8b5197){var _0x33257c=function(_0x419ec3){while(--_0x419ec3){_0x5968f4['push'](_0x5968f4['shift']());}};_0x33257c(++_0x8b5197);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5783f4,_0x4a9e0a){_0x5783f4=_0x5783f4-0x0;var _0x28e380=_0xa9e0[_0x5783f4];return _0x28e380;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'voice_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x70e0=['voice_queues','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','./voiceQueue.attributes'];(function(_0x2fe457,_0x1c58d6){var _0x40dac7=function(_0x29839b){while(--_0x29839b){_0x2fe457['push'](_0x2fe457['shift']());}};_0x40dac7(++_0x1c58d6);}(_0x70e0,0x17b));var _0x070e=function(_0x1e94a7,_0x478142){_0x1e94a7=_0x1e94a7-0x0;var _0x5c14e5=_0x70e0[_0x1e94a7];return _0x5c14e5;};'use strict';var _=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var logger=require(_0x070e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x070e('0x3'));var rp=require(_0x070e('0x4'));var fs=require('fs');var path=require(_0x070e('0x5'));var rimraf=require(_0x070e('0x6'));var config=require('../../config/environment');var attributes=require(_0x070e('0x7'));module['exports']=function(_0x46fe68,_0x4b041d){return _0x46fe68['define']('VoiceQueue',attributes,{'tableName':_0x070e('0x8'),'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 fe3b6a8..c35cfac 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 _0x49af=['result','catch','VoiceQueue','findAll','options','raw','where','attributes','include','map','model','debug','GetVoiceQueue','ShowVoiceQueue','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./voiceQueue.socket','register','then','info','VoiceQueue,\x20%s,\x20%s','request\x20sent','VoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','message'];(function(_0x3ffee4,_0x5bf592){var _0x25aa92=function(_0x3d12e5){while(--_0x3d12e5){_0x3ffee4['push'](_0x3ffee4['shift']());}};_0x25aa92(++_0x5bf592);}(_0x49af,0xd6));var _0xf49a=function(_0x5ad424,_0x28d5d2){_0x5ad424=_0x5ad424-0x0;var _0x30f802=_0x49af[_0x5ad424];return _0x30f802;};'use strict';var _=require(_0xf49a('0x0'));var util=require(_0xf49a('0x1'));var moment=require(_0xf49a('0x2'));var BPromise=require(_0xf49a('0x3'));var rs=require(_0xf49a('0x4'));var fs=require('fs');var Redis=require(_0xf49a('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xf49a('0x6'))(_0xf49a('0x7'));var config=require(_0xf49a('0x8'));var jayson=require(_0xf49a('0x9'));var client=jayson[_0xf49a('0xa')][_0xf49a('0xb')]({'port':0x232a});config[_0xf49a('0xc')]=_[_0xf49a('0xd')](config['redis'],{'host':_0xf49a('0xe'),'port':0x18eb});var socket=require(_0xf49a('0xf'))(new Redis(config[_0xf49a('0xc')]));require(_0xf49a('0x10'))[_0xf49a('0x11')](socket);function respondWithRpcPromise(_0x4cccd0,_0x38c8f2,_0x386bdf){return new BPromise(function(_0x486fec,_0x551b90){return client['request'](_0x4cccd0,_0x386bdf)[_0xf49a('0x12')](function(_0x54201f){logger[_0xf49a('0x13')](_0xf49a('0x14'),_0x38c8f2,_0xf49a('0x15'));logger['debug'](_0xf49a('0x16'),_0x38c8f2,'request\x20sent',JSON[_0xf49a('0x17')](_0x54201f));if(_0x54201f['error']){if(_0x54201f[_0xf49a('0x18')]['code']===0x1f4){logger[_0xf49a('0x18')](_0xf49a('0x14'),_0x38c8f2,_0x54201f[_0xf49a('0x18')]['message']);return _0x551b90(_0x54201f['error']['message']);}logger[_0xf49a('0x18')]('VoiceQueue,\x20%s,\x20%s',_0x38c8f2,_0x54201f[_0xf49a('0x18')][_0xf49a('0x19')]);return _0x486fec(_0x54201f['error'][_0xf49a('0x19')]);}else{logger[_0xf49a('0x13')](_0xf49a('0x14'),_0x38c8f2,_0xf49a('0x15'));_0x486fec(_0x54201f[_0xf49a('0x1a')][_0xf49a('0x19')]);}})[_0xf49a('0x1b')](function(_0x26eeb1){logger[_0xf49a('0x18')](_0xf49a('0x14'),_0x38c8f2,_0x26eeb1);_0x551b90(_0x26eeb1);});});}exports['GetVoiceQueue']=function(_0x5611ce){var _0x420e66=this;return new Promise(function(_0x59fcd2,_0x469094){return db[_0xf49a('0x1c')][_0xf49a('0x1d')]({'raw':_0x5611ce[_0xf49a('0x1e')]?_0x5611ce[_0xf49a('0x1e')][_0xf49a('0x1f')]===undefined?!![]:![]:!![],'where':_0x5611ce['options']?_0x5611ce[_0xf49a('0x1e')][_0xf49a('0x20')]||null:null,'attributes':_0x5611ce['options']?_0x5611ce[_0xf49a('0x1e')][_0xf49a('0x21')]||null:null,'limit':_0x5611ce[_0xf49a('0x1e')]?_0x5611ce['options']['limit']||null:null,'include':_0x5611ce[_0xf49a('0x1e')]?_0x5611ce[_0xf49a('0x1e')][_0xf49a('0x22')]?_[_0xf49a('0x23')](_0x5611ce[_0xf49a('0x1e')][_0xf49a('0x22')],function(_0x102122){return{'model':db[_0x102122[_0xf49a('0x24')]],'as':_0x102122['as'],'attributes':_0x102122['attributes'],'include':_0x102122[_0xf49a('0x22')]?_[_0xf49a('0x23')](_0x102122['include'],function(_0x432ece){return{'model':db[_0x432ece[_0xf49a('0x24')]],'as':_0x432ece['as'],'attributes':_0x432ece['attributes'],'include':_0x432ece['include']?_[_0xf49a('0x23')](_0x432ece['include'],function(_0x11ccd9){return{'model':db[_0x11ccd9[_0xf49a('0x24')]],'as':_0x11ccd9['as'],'attributes':_0x11ccd9[_0xf49a('0x21')]};}):[]};}):[]};}):[]:[]})[_0xf49a('0x12')](function(_0x2472ec){logger[_0xf49a('0x13')]('GetVoiceQueue',_0x5611ce);logger[_0xf49a('0x25')](_0xf49a('0x26'),_0x5611ce,JSON['stringify'](_0x2472ec));_0x59fcd2(_0x2472ec);})[_0xf49a('0x1b')](function(_0x339c93){logger[_0xf49a('0x18')](_0xf49a('0x26'),_0x339c93['message'],_0x5611ce);_0x469094(_0x420e66[_0xf49a('0x18')](0x1f4,_0x339c93[_0xf49a('0x19')]));});});};exports['ShowVoiceQueue']=function(_0x3c06b7){var _0xcaf818=this;return new Promise(function(_0x2e99d8,_0x569946){return db[_0xf49a('0x1c')]['find']({'raw':_0x3c06b7['options']?_0x3c06b7[_0xf49a('0x1e')][_0xf49a('0x1f')]===undefined?!![]:![]:!![],'where':_0x3c06b7[_0xf49a('0x1e')]?_0x3c06b7[_0xf49a('0x1e')][_0xf49a('0x20')]||null:null,'attributes':_0x3c06b7[_0xf49a('0x1e')]?_0x3c06b7['options']['attributes']||null:null,'include':_0x3c06b7['options']?_0x3c06b7[_0xf49a('0x1e')][_0xf49a('0x22')]?_[_0xf49a('0x23')](_0x3c06b7[_0xf49a('0x1e')]['include'],function(_0x4ee052){return{'model':db[_0x4ee052[_0xf49a('0x24')]],'as':_0x4ee052['as'],'attributes':_0x4ee052[_0xf49a('0x21')],'include':_0x4ee052['include']?_[_0xf49a('0x23')](_0x4ee052[_0xf49a('0x22')],function(_0x2a05cf){return{'model':db[_0x2a05cf['model']],'as':_0x2a05cf['as'],'attributes':_0x2a05cf[_0xf49a('0x21')],'include':_0x2a05cf[_0xf49a('0x22')]?_[_0xf49a('0x23')](_0x2a05cf[_0xf49a('0x22')],function(_0x16349f){return{'model':db[_0x16349f[_0xf49a('0x24')]],'as':_0x16349f['as'],'attributes':_0x16349f[_0xf49a('0x21')]};}):[]};}):[]};}):[]:[]})[_0xf49a('0x12')](function(_0x435f72){logger['info']('ShowVoiceQueue',_0x3c06b7);logger['debug']('ShowVoiceQueue',_0x3c06b7,JSON[_0xf49a('0x17')](_0x435f72));_0x2e99d8(_0x435f72);})[_0xf49a('0x1b')](function(_0x3b08d7){logger[_0xf49a('0x18')](_0xf49a('0x27'),_0x3b08d7[_0xf49a('0x19')],_0x3c06b7);_0x569946(_0xcaf818['error'](0x1f4,_0x3b08d7['message']));});});}; \ No newline at end of file +var _0xdb69=['attributes','limit','include','map','model','stringify','lodash','util','moment','bluebird','../../config/utils','rpc','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./voiceQueue.socket','register','then','info','VoiceQueue,\x20%s,\x20%s','request\x20sent','debug','VoiceQueue,\x20%s,\x20%s,\x20%s','error','message','result','catch','GetVoiceQueue','findAll','options','raw','where'];(function(_0x2fd634,_0x73fa18){var _0x28020d=function(_0x26f195){while(--_0x26f195){_0x2fd634['push'](_0x2fd634['shift']());}};_0x28020d(++_0x73fa18);}(_0xdb69,0x16e));var _0x9db6=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0xdb69[_0x167cc1];return _0x10bc4b;};'use strict';var _=require(_0x9db6('0x0'));var util=require(_0x9db6('0x1'));var moment=require(_0x9db6('0x2'));var BPromise=require(_0x9db6('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x9db6('0x4'));var logger=require('../../config/logger')(_0x9db6('0x5'));var config=require('../../config/environment');var jayson=require(_0x9db6('0x6'));var client=jayson[_0x9db6('0x7')][_0x9db6('0x8')]({'port':0x232a});config['redis']=_[_0x9db6('0x9')](config[_0x9db6('0xa')],{'host':_0x9db6('0xb'),'port':0x18eb});var socket=require(_0x9db6('0xc'))(new Redis(config['redis']));require(_0x9db6('0xd'))[_0x9db6('0xe')](socket);function respondWithRpcPromise(_0x276b94,_0x4b90f3,_0x81c901){return new BPromise(function(_0x13fe29,_0x2964e8){return client['request'](_0x276b94,_0x81c901)[_0x9db6('0xf')](function(_0x5b1bf7){logger[_0x9db6('0x10')](_0x9db6('0x11'),_0x4b90f3,_0x9db6('0x12'));logger[_0x9db6('0x13')](_0x9db6('0x14'),_0x4b90f3,_0x9db6('0x12'),JSON['stringify'](_0x5b1bf7));if(_0x5b1bf7[_0x9db6('0x15')]){if(_0x5b1bf7['error']['code']===0x1f4){logger[_0x9db6('0x15')](_0x9db6('0x11'),_0x4b90f3,_0x5b1bf7[_0x9db6('0x15')]['message']);return _0x2964e8(_0x5b1bf7[_0x9db6('0x15')][_0x9db6('0x16')]);}logger[_0x9db6('0x15')](_0x9db6('0x11'),_0x4b90f3,_0x5b1bf7['error'][_0x9db6('0x16')]);return _0x13fe29(_0x5b1bf7[_0x9db6('0x15')][_0x9db6('0x16')]);}else{logger[_0x9db6('0x10')]('VoiceQueue,\x20%s,\x20%s',_0x4b90f3,_0x9db6('0x12'));_0x13fe29(_0x5b1bf7[_0x9db6('0x17')][_0x9db6('0x16')]);}})[_0x9db6('0x18')](function(_0x27e125){logger[_0x9db6('0x15')](_0x9db6('0x11'),_0x4b90f3,_0x27e125);_0x2964e8(_0x27e125);});});}exports[_0x9db6('0x19')]=function(_0xce0eff){var _0x3a906a=this;return new Promise(function(_0x4bc4aa,_0x3059e3){return db['VoiceQueue'][_0x9db6('0x1a')]({'raw':_0xce0eff[_0x9db6('0x1b')]?_0xce0eff[_0x9db6('0x1b')][_0x9db6('0x1c')]===undefined?!![]:![]:!![],'where':_0xce0eff[_0x9db6('0x1b')]?_0xce0eff[_0x9db6('0x1b')][_0x9db6('0x1d')]||null:null,'attributes':_0xce0eff[_0x9db6('0x1b')]?_0xce0eff[_0x9db6('0x1b')][_0x9db6('0x1e')]||null:null,'limit':_0xce0eff['options']?_0xce0eff[_0x9db6('0x1b')][_0x9db6('0x1f')]||null:null,'include':_0xce0eff[_0x9db6('0x1b')]?_0xce0eff[_0x9db6('0x1b')][_0x9db6('0x20')]?_[_0x9db6('0x21')](_0xce0eff[_0x9db6('0x1b')]['include'],function(_0x1c8d78){return{'model':db[_0x1c8d78[_0x9db6('0x22')]],'as':_0x1c8d78['as'],'attributes':_0x1c8d78[_0x9db6('0x1e')],'include':_0x1c8d78['include']?_['map'](_0x1c8d78[_0x9db6('0x20')],function(_0x18eb93){return{'model':db[_0x18eb93[_0x9db6('0x22')]],'as':_0x18eb93['as'],'attributes':_0x18eb93['attributes'],'include':_0x18eb93[_0x9db6('0x20')]?_[_0x9db6('0x21')](_0x18eb93[_0x9db6('0x20')],function(_0x495bc8){return{'model':db[_0x495bc8[_0x9db6('0x22')]],'as':_0x495bc8['as'],'attributes':_0x495bc8[_0x9db6('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x9db6('0xf')](function(_0xc6b4c7){logger['info'](_0x9db6('0x19'),_0xce0eff);logger[_0x9db6('0x13')](_0x9db6('0x19'),_0xce0eff,JSON[_0x9db6('0x23')](_0xc6b4c7));_0x4bc4aa(_0xc6b4c7);})[_0x9db6('0x18')](function(_0x3d93d1){logger['error']('GetVoiceQueue',_0x3d93d1[_0x9db6('0x16')],_0xce0eff);_0x3059e3(_0x3a906a[_0x9db6('0x15')](0x1f4,_0x3d93d1[_0x9db6('0x16')]));});});};exports['ShowVoiceQueue']=function(_0x5f2d0a){var _0x25ff4a=this;return new Promise(function(_0x6bfdda,_0x50ec6a){return db['VoiceQueue']['find']({'raw':_0x5f2d0a[_0x9db6('0x1b')]?_0x5f2d0a['options'][_0x9db6('0x1c')]===undefined?!![]:![]:!![],'where':_0x5f2d0a[_0x9db6('0x1b')]?_0x5f2d0a[_0x9db6('0x1b')][_0x9db6('0x1d')]||null:null,'attributes':_0x5f2d0a[_0x9db6('0x1b')]?_0x5f2d0a[_0x9db6('0x1b')][_0x9db6('0x1e')]||null:null,'include':_0x5f2d0a[_0x9db6('0x1b')]?_0x5f2d0a[_0x9db6('0x1b')][_0x9db6('0x20')]?_[_0x9db6('0x21')](_0x5f2d0a[_0x9db6('0x1b')][_0x9db6('0x20')],function(_0x107d2d){return{'model':db[_0x107d2d['model']],'as':_0x107d2d['as'],'attributes':_0x107d2d[_0x9db6('0x1e')],'include':_0x107d2d[_0x9db6('0x20')]?_[_0x9db6('0x21')](_0x107d2d[_0x9db6('0x20')],function(_0x3d0a51){return{'model':db[_0x3d0a51[_0x9db6('0x22')]],'as':_0x3d0a51['as'],'attributes':_0x3d0a51['attributes'],'include':_0x3d0a51[_0x9db6('0x20')]?_[_0x9db6('0x21')](_0x3d0a51['include'],function(_0x480588){return{'model':db[_0x480588[_0x9db6('0x22')]],'as':_0x480588['as'],'attributes':_0x480588[_0x9db6('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x9db6('0xf')](function(_0xbad361){logger['info']('ShowVoiceQueue',_0x5f2d0a);logger[_0x9db6('0x13')]('ShowVoiceQueue',_0x5f2d0a,JSON['stringify'](_0xbad361));_0x6bfdda(_0xbad361);})[_0x9db6('0x18')](function(_0x5f15b3){logger[_0x9db6('0x15')]('ShowVoiceQueue',_0x5f15b3[_0x9db6('0x16')],_0x5f2d0a);_0x50ec6a(_0x25ff4a[_0x9db6('0x15')](0x1f4,_0x5f15b3[_0x9db6('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.socket.js b/server/api/voiceQueue/voiceQueue.socket.js index 572b96d..f528ca7 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 _0x291c=['update','register','length','./voiceQueue.events','save'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x291c,0xcb));var _0xc291=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x291c[_0x2c91e9];return _0x13f0ff;};'use strict';var VoiceQueueEvents=require(_0xc291('0x0'));var events=[_0xc291('0x1'),'remove',_0xc291('0x2')];function createListener(_0x96ae77,_0x3d7261){return function(_0x5a1f16){_0x3d7261['emit'](_0x96ae77,_0x5a1f16);};}function removeListener(_0x7deab7,_0xf39410){return function(){VoiceQueueEvents['removeListener'](_0x7deab7,_0xf39410);};}exports[_0xc291('0x3')]=function(_0x38016d){for(var _0x128881=0x0,_0xe806e4=events[_0xc291('0x4')];_0x128881<_0xe806e4;_0x128881++){var _0xcd2110=events[_0x128881];var _0x5d6c03=createListener('voiceQueue:'+_0xcd2110,_0x38016d);VoiceQueueEvents['on'](_0xcd2110,_0x5d6c03);}}; \ No newline at end of file +var _0x9121=['./voiceQueue.events','remove','update','emit','removeListener','length'];(function(_0x5068d5,_0x353c3d){var _0x22123e=function(_0x3cf8ee){while(--_0x3cf8ee){_0x5068d5['push'](_0x5068d5['shift']());}};_0x22123e(++_0x353c3d);}(_0x9121,0x192));var _0x1912=function(_0x5a709c,_0x1e6cfe){_0x5a709c=_0x5a709c-0x0;var _0x719025=_0x9121[_0x5a709c];return _0x719025;};'use strict';var VoiceQueueEvents=require(_0x1912('0x0'));var events=['save',_0x1912('0x1'),_0x1912('0x2')];function createListener(_0x110305,_0x233474){return function(_0xb45f4c){_0x233474[_0x1912('0x3')](_0x110305,_0xb45f4c);};}function removeListener(_0x64e82f,_0xb1a5b0){return function(){VoiceQueueEvents[_0x1912('0x4')](_0x64e82f,_0xb1a5b0);};}exports['register']=function(_0x2fc7cf){for(var _0x217d10=0x0,_0xa9ec32=events[_0x1912('0x5')];_0x217d10<_0xa9ec32;_0x217d10++){var _0x2bb66e=events[_0x217d10];var _0x5abbf6=createListener('voiceQueue:'+_0x2bb66e,_0x2fc7cf);VoiceQueueEvents['on'](_0x2bb66e,_0x5abbf6);}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/index.js b/server/api/voiceQueueReport/index.js index bd062bd..680e8a4 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 _0x23c9=['index','/describe','describe','/index','isAuthenticated','getVoiceQueuesReport','show','post','create','put','/:id','update','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceQueueReport.controller','get'];(function(_0x546aaf,_0x1ed138){var _0x1cbf6d=function(_0x36c837){while(--_0x36c837){_0x546aaf['push'](_0x546aaf['shift']());}};_0x1cbf6d(++_0x1ed138);}(_0x23c9,0x1ee));var _0x923c=function(_0x5404e9,_0x132866){_0x5404e9=_0x5404e9-0x0;var _0x2d7c75=_0x23c9[_0x5404e9];return _0x2d7c75;};'use strict';var multer=require(_0x923c('0x0'));var util=require('util');var path=require(_0x923c('0x1'));var timeout=require(_0x923c('0x2'));var express=require(_0x923c('0x3'));var router=express[_0x923c('0x4')]();var fs_extra=require(_0x923c('0x5'));var auth=require(_0x923c('0x6'));var interaction=require(_0x923c('0x7'));var config=require('../../config/environment');var controller=require(_0x923c('0x8'));router[_0x923c('0x9')]('/',auth['isAuthenticated'](),controller[_0x923c('0xa')]);router[_0x923c('0x9')](_0x923c('0xb'),auth['isAuthenticated'](),controller[_0x923c('0xc')]);router[_0x923c('0x9')](_0x923c('0xd'),auth[_0x923c('0xe')](),controller[_0x923c('0xf')]);router[_0x923c('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x923c('0x10')]);router[_0x923c('0x11')]('/',auth[_0x923c('0xe')](),controller[_0x923c('0x12')]);router[_0x923c('0x13')](_0x923c('0x14'),auth[_0x923c('0xe')](),controller[_0x923c('0x15')]);router['delete']('/:id',auth[_0x923c('0xe')](),controller[_0x923c('0x16')]);module[_0x923c('0x17')]=router; \ No newline at end of file +var _0x29a1=['put','delete','destroy','exports','util','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./voiceQueueReport.controller','get','isAuthenticated','index','/describe','describe','/index','/:id','show','post','create'];(function(_0x1e099f,_0x470a08){var _0x2027a3=function(_0xea10c1){while(--_0xea10c1){_0x1e099f['push'](_0x1e099f['shift']());}};_0x2027a3(++_0x470a08);}(_0x29a1,0x12a));var _0x129a=function(_0x4305ee,_0x413fce){_0x4305ee=_0x4305ee-0x0;var _0x1e8201=_0x29a1[_0x4305ee];return _0x1e8201;};'use strict';var multer=require('multer');var util=require(_0x129a('0x0'));var path=require('path');var timeout=require(_0x129a('0x1'));var express=require(_0x129a('0x2'));var router=express[_0x129a('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x129a('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x129a('0x5'));var controller=require(_0x129a('0x6'));router[_0x129a('0x7')]('/',auth[_0x129a('0x8')](),controller[_0x129a('0x9')]);router[_0x129a('0x7')](_0x129a('0xa'),auth[_0x129a('0x8')](),controller[_0x129a('0xb')]);router[_0x129a('0x7')](_0x129a('0xc'),auth[_0x129a('0x8')](),controller['getVoiceQueuesReport']);router[_0x129a('0x7')](_0x129a('0xd'),auth[_0x129a('0x8')](),controller[_0x129a('0xe')]);router[_0x129a('0xf')]('/',auth[_0x129a('0x8')](),controller[_0x129a('0x10')]);router[_0x129a('0x11')](_0x129a('0xd'),auth[_0x129a('0x8')](),controller['update']);router[_0x129a('0x12')](_0x129a('0xd'),auth[_0x129a('0x8')](),controller[_0x129a('0x13')]);module[_0x129a('0x14')]=router; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.attributes.js b/server/api/voiceQueueReport/voiceQueueReport.attributes.js index 9637c27..0db9e5d 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 _0x3611=['YYYY-MM-DD\x20HH:mm:ss','diff','seconds','setDataValue','queuecallerleaveAt','holdtime','INTEGER','BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','moment','STRING','DATE','getDataValue','queuecallerjoinAt'];(function(_0x2a0138,_0x317777){var _0x135e94=function(_0x3cbf30){while(--_0x3cbf30){_0x2a0138['push'](_0x2a0138['shift']());}};_0x135e94(++_0x317777);}(_0x3611,0xea));var _0x1361=function(_0x1c7ddd,_0xbb066c){_0x1c7ddd=_0x1c7ddd-0x0;var _0xf0d47e=_0x3611[_0x1c7ddd];return _0xf0d47e;};'use strict';var Sequelize=require(_0x1361('0x0'));var moment=require(_0x1361('0x1'));module['exports']={'type':{'type':Sequelize[_0x1361('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x1361('0x2')]},'calleridname':{'type':Sequelize[_0x1361('0x2')]},'queue':{'type':Sequelize[_0x1361('0x2')]},'queuecallerjoinAt':{'type':Sequelize[_0x1361('0x3')]},'queuecallerleaveAt':{'type':Sequelize['DATE'],'set':function(_0x38d050){var _0x306f42=moment(_0x38d050);var _0xebfe0d=moment(this[_0x1361('0x4')](_0x1361('0x5')))['format'](_0x1361('0x6'));var _0x11c117=_0x306f42[_0x1361('0x7')](_0xebfe0d,_0x1361('0x8'));this[_0x1361('0x9')](_0x1361('0xa'),_0x38d050);this[_0x1361('0x9')](_0x1361('0xb'),_0x11c117||null);}},'position':{'type':Sequelize[_0x1361('0xc')]},'count':{'type':Sequelize['INTEGER']},'queuecallerabandon':{'type':Sequelize[_0x1361('0xd')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize['DATE']},'queuecallercomplete':{'type':Sequelize[_0x1361('0xd')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0x1361('0x3')]},'queuecallerexit':{'type':Sequelize[_0x1361('0xd')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize['DATE']},'queuecallerexitreason':{'type':Sequelize[_0x1361('0x2')],'comment':_0x1361('0xe')},'originalposition':{'type':Sequelize[_0x1361('0xc')]},'channel':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x1361('0x2')]},'connectedlinename':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x1361('0x2')]},'context':{'type':Sequelize[_0x1361('0x2')]},'exten':{'type':Sequelize[_0x1361('0x2')]},'priority':{'type':Sequelize[_0x1361('0x2')]},'holdtime':{'type':Sequelize[_0x1361('0xc')]},'mohtime':{'type':Sequelize[_0x1361('0xc')],'defaultValue':0x0},'assigned':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize['STRING']},'transfer':{'type':Sequelize[_0x1361('0xd')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x1361('0x2')],'comment':_0x1361('0xf')},'transferexten':{'type':Sequelize['STRING']},'transferuniqueid':{'type':Sequelize[_0x1361('0x2')]},'disposition':{'type':Sequelize[_0x1361('0x2')]},'secondDisposition':{'type':Sequelize[_0x1361('0x2')]},'thirdDisposition':{'type':Sequelize[_0x1361('0x2')]},'queuecallerenterreason':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'note':{'type':Sequelize[_0x1361('0x2')]}}; \ No newline at end of file +var _0xad0f=['exports','STRING','DATE','getDataValue','queuecallerjoinAt','format','diff','seconds','setDataValue','queuecallerleaveAt','holdtime','INTEGER','BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','moment'];(function(_0x50e566,_0x4c7ec5){var _0x177526=function(_0x5d36c7){while(--_0x5d36c7){_0x50e566['push'](_0x50e566['shift']());}};_0x177526(++_0x4c7ec5);}(_0xad0f,0x64));var _0xfad0=function(_0x5b3b9b,_0x1c71b0){_0x5b3b9b=_0x5b3b9b-0x0;var _0x47c1d7=_0xad0f[_0x5b3b9b];return _0x47c1d7;};'use strict';var Sequelize=require(_0xfad0('0x0'));var moment=require(_0xfad0('0x1'));module[_0xfad0('0x2')]={'type':{'type':Sequelize[_0xfad0('0x3')]},'uniqueid':{'type':Sequelize[_0xfad0('0x3')]},'calleridnum':{'type':Sequelize[_0xfad0('0x3')]},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0xfad0('0x3')]},'queuecallerjoinAt':{'type':Sequelize['DATE']},'queuecallerleaveAt':{'type':Sequelize[_0xfad0('0x4')],'set':function(_0x3e4a6b){var _0x31a7a6=moment(_0x3e4a6b);var _0x2ea939=moment(this[_0xfad0('0x5')](_0xfad0('0x6')))[_0xfad0('0x7')]('YYYY-MM-DD\x20HH:mm:ss');var _0xcb3584=_0x31a7a6[_0xfad0('0x8')](_0x2ea939,_0xfad0('0x9'));this[_0xfad0('0xa')](_0xfad0('0xb'),_0x3e4a6b);this[_0xfad0('0xa')](_0xfad0('0xc'),_0xcb3584||null);}},'position':{'type':Sequelize['INTEGER']},'count':{'type':Sequelize[_0xfad0('0xd')]},'queuecallerabandon':{'type':Sequelize[_0xfad0('0xe')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize['DATE']},'queuecallercomplete':{'type':Sequelize[_0xfad0('0xe')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0xfad0('0x4')]},'queuecallerexit':{'type':Sequelize[_0xfad0('0xe')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize['DATE']},'queuecallerexitreason':{'type':Sequelize[_0xfad0('0x3')],'comment':_0xfad0('0xf')},'originalposition':{'type':Sequelize[_0xfad0('0xd')]},'channel':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0xfad0('0x3')]},'connectedlinename':{'type':Sequelize[_0xfad0('0x3')]},'accountcode':{'type':Sequelize[_0xfad0('0x3')]},'context':{'type':Sequelize[_0xfad0('0x3')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize['STRING']},'holdtime':{'type':Sequelize[_0xfad0('0xd')]},'mohtime':{'type':Sequelize[_0xfad0('0xd')],'defaultValue':0x0},'assigned':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0xfad0('0x3')]},'transfer':{'type':Sequelize[_0xfad0('0xe')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0xfad0('0x3')],'comment':_0xfad0('0x10')},'transferexten':{'type':Sequelize[_0xfad0('0x3')]},'transferuniqueid':{'type':Sequelize['STRING']},'disposition':{'type':Sequelize[_0xfad0('0x3')]},'secondDisposition':{'type':Sequelize[_0xfad0('0x3')]},'thirdDisposition':{'type':Sequelize[_0xfad0('0x3')]},'queuecallerenterreason':{'type':Sequelize[_0xfad0('0xd')],'defaultValue':0x0},'note':{'type':Sequelize[_0xfad0('0x3')]}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.controller.js b/server/api/voiceQueueReport/voiceQueueReport.controller.js index 405c18d..33f0a1a 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 _0x3583=['fs-extra','lodash','squel','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./voiceQueueReport.socket','register','sendStatus','status','json','offset','limit','count','set','Content-Range','apply','reject','save','then','destroy','end','error','name','send','index','map','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','VoiceQueueReport','includeAll','include','rows','catch','params','find','create','body','describe','findAll','getVoiceQueuesReport','rimraf','fast-json-patch','mustache','util'];(function(_0xc27d6c,_0x6cca52){var _0x50a94f=function(_0x1a94ce){while(--_0x1a94ce){_0xc27d6c['push'](_0xc27d6c['shift']());}};_0x50a94f(++_0x6cca52);}(_0x3583,0x173));var _0x3358=function(_0x56e406,_0x18aa8d){_0x56e406=_0x56e406-0x0;var _0x497ab7=_0x3583[_0x56e406];return _0x497ab7;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3358('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3358('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x3358('0x2'));var util=require(_0x3358('0x3'));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(_0x3358('0x4'));var _=require(_0x3358('0x5'));var squel=require(_0x3358('0x6'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x3358('0x7'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x3358('0x8'));var Redis=require('ioredis');var authService=require(_0x3358('0x9'));var qs=require(_0x3358('0xa'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3358('0xb'));var logger=require(_0x3358('0xc'))(_0x3358('0xd'));var utils=require(_0x3358('0xe'));var config=require(_0x3358('0xf'));var licenseUtil=require(_0x3358('0x10'));var db=require(_0x3358('0x11'))['db'];config['redis']=_['defaults'](config[_0x3358('0x12')],{'host':_0x3358('0x13'),'port':0x18eb});var socket=require(_0x3358('0x14'))(new Redis(config['redis']));require(_0x3358('0x15'))[_0x3358('0x16')](socket);function respondWithStatusCode(_0x167549,_0x3df844){_0x3df844=_0x3df844||0xcc;return function(_0x2850f3){if(_0x2850f3){return _0x167549[_0x3358('0x17')](_0x3df844);}return _0x167549['status'](_0x3df844)['end']();};}function respondWithResult(_0x1586fc,_0x511b3f){_0x511b3f=_0x511b3f||0xc8;return function(_0x473972){if(_0x473972){return _0x1586fc[_0x3358('0x18')](_0x511b3f)[_0x3358('0x19')](_0x473972);}};}function respondWithFilteredResult(_0x5655b3,_0x3ea380){return function(_0x33d7de){if(_0x33d7de){var _0x95f34f=typeof _0x3ea380[_0x3358('0x1a')]==='undefined'&&typeof _0x3ea380[_0x3358('0x1b')]==='undefined';var _0x50d22e=_0x33d7de[_0x3358('0x1c')];var _0x4417ee=_0x95f34f?0x0:_0x3ea380[_0x3358('0x1a')];var _0x3d9cfc=_0x95f34f?_0x33d7de['count']:_0x3ea380['offset']+_0x3ea380[_0x3358('0x1b')];var _0x2f41c5;if(_0x3d9cfc>=_0x50d22e){_0x3d9cfc=_0x50d22e;_0x2f41c5=0xc8;}else{_0x2f41c5=0xce;}_0x5655b3[_0x3358('0x18')](_0x2f41c5);return _0x5655b3[_0x3358('0x1d')](_0x3358('0x1e'),_0x4417ee+'-'+_0x3d9cfc+'/'+_0x50d22e)[_0x3358('0x19')](_0x33d7de);}return null;};}function patchUpdates(_0x383419){return function(_0x59e363){try{jsonpatch[_0x3358('0x1f')](_0x59e363,_0x383419,!![]);}catch(_0xc8cbf7){return BPromise[_0x3358('0x20')](_0xc8cbf7);}return _0x59e363[_0x3358('0x21')]();};}function saveUpdates(_0x6ccacb,_0x6a3cc){return function(_0x33c6eb){if(_0x33c6eb){return _0x33c6eb['update'](_0x6ccacb)[_0x3358('0x22')](function(_0x433961){return _0x433961;});}return null;};}function removeEntity(_0x55a75f,_0x33f610){return function(_0x1d22e5){if(_0x1d22e5){return _0x1d22e5[_0x3358('0x23')]()[_0x3358('0x22')](function(){_0x55a75f[_0x3358('0x18')](0xcc)[_0x3358('0x24')]();});}};}function handleEntityNotFound(_0x26fd4b,_0x25faf2){return function(_0x26100d){if(!_0x26100d){_0x26fd4b[_0x3358('0x17')](0x194);}return _0x26100d;};}function handleError(_0x306dcc,_0x3163b7){_0x3163b7=_0x3163b7||0x1f4;return function(_0x5bb092){logger[_0x3358('0x25')](_0x5bb092['stack']);if(_0x5bb092[_0x3358('0x26')]){delete _0x5bb092[_0x3358('0x26')];}_0x306dcc[_0x3358('0x18')](_0x3163b7)[_0x3358('0x27')](_0x5bb092);};}exports[_0x3358('0x28')]=function(_0x21c7e3,_0x3325db){var _0x2e9092={},_0x186ae4={},_0x2a9cc7={'count':0x0,'rows':[]};var _0x5b3a61=_[_0x3358('0x29')](db['VoiceQueueReport'][_0x3358('0x2a')],function(_0x4eac33){return{'name':_0x4eac33[_0x3358('0x2b')],'type':_0x4eac33[_0x3358('0x2c')][_0x3358('0x2d')]};});_0x186ae4[_0x3358('0x2e')]=_[_0x3358('0x29')](_0x5b3a61,_0x3358('0x26'));_0x186ae4['query']=_[_0x3358('0x2f')](_0x21c7e3['query']);_0x186ae4[_0x3358('0x30')]=_[_0x3358('0x31')](_0x186ae4[_0x3358('0x2e')],_0x186ae4[_0x3358('0x32')]);_0x2e9092[_0x3358('0x33')]=_['intersection'](_0x186ae4[_0x3358('0x2e')],qs[_0x3358('0x34')](_0x21c7e3['query']['fields']));_0x2e9092[_0x3358('0x33')]=_0x2e9092[_0x3358('0x33')][_0x3358('0x35')]?_0x2e9092[_0x3358('0x33')]:_0x186ae4[_0x3358('0x2e')];if(!_0x21c7e3[_0x3358('0x32')][_0x3358('0x36')](_0x3358('0x37'))){_0x2e9092[_0x3358('0x1b')]=qs[_0x3358('0x1b')](_0x21c7e3[_0x3358('0x32')][_0x3358('0x1b')]);_0x2e9092[_0x3358('0x1a')]=qs[_0x3358('0x1a')](_0x21c7e3[_0x3358('0x32')][_0x3358('0x1a')]);}_0x2e9092[_0x3358('0x38')]=qs[_0x3358('0x39')](_0x21c7e3['query'][_0x3358('0x39')]);_0x2e9092[_0x3358('0x3a')]=qs[_0x3358('0x30')](_[_0x3358('0x3b')](_0x21c7e3[_0x3358('0x32')],_0x186ae4[_0x3358('0x30')]),_0x5b3a61);if(_0x21c7e3[_0x3358('0x32')][_0x3358('0x3c')]){_0x2e9092[_0x3358('0x3a')]=_[_0x3358('0x3d')](_0x2e9092[_0x3358('0x3a')],{'$or':_['map'](_0x5b3a61,function(_0x20e7a4){if(_0x20e7a4[_0x3358('0x2c')]!=='VIRTUAL'){var _0x4a5023={};_0x4a5023[_0x20e7a4[_0x3358('0x26')]]={'$like':'%'+_0x21c7e3[_0x3358('0x32')][_0x3358('0x3c')]+'%'};return _0x4a5023;}})});}_0x2e9092=_['merge']({},_0x2e9092,_0x21c7e3[_0x3358('0x3e')]);var _0x3cb2cb={'where':_0x2e9092['where']};return db[_0x3358('0x3f')][_0x3358('0x1c')](_0x3cb2cb)['then'](function(_0x53c73e){_0x2a9cc7[_0x3358('0x1c')]=_0x53c73e;if(_0x21c7e3[_0x3358('0x32')][_0x3358('0x40')]){_0x2e9092[_0x3358('0x41')]=[{'all':!![]}];}return db['VoiceQueueReport']['findAll'](_0x2e9092);})[_0x3358('0x22')](function(_0x3bff0a){_0x2a9cc7[_0x3358('0x42')]=_0x3bff0a;return _0x2a9cc7;})[_0x3358('0x22')](respondWithFilteredResult(_0x3325db,_0x2e9092))[_0x3358('0x43')](handleError(_0x3325db,null));};exports['show']=function(_0x1fc66c,_0x3a468c){var _0x4f5985={'raw':![],'where':{'id':_0x1fc66c[_0x3358('0x44')]['id']}},_0x2d4930={};_0x2d4930[_0x3358('0x2e')]=_[_0x3358('0x2f')](db[_0x3358('0x3f')][_0x3358('0x2a')]);_0x2d4930[_0x3358('0x32')]=_[_0x3358('0x2f')](_0x1fc66c[_0x3358('0x32')]);_0x2d4930[_0x3358('0x30')]=_[_0x3358('0x31')](_0x2d4930['model'],_0x2d4930['query']);_0x4f5985[_0x3358('0x33')]=_[_0x3358('0x31')](_0x2d4930[_0x3358('0x2e')],qs[_0x3358('0x34')](_0x1fc66c[_0x3358('0x32')][_0x3358('0x34')]));_0x4f5985[_0x3358('0x33')]=_0x4f5985[_0x3358('0x33')][_0x3358('0x35')]?_0x4f5985[_0x3358('0x33')]:_0x2d4930['model'];if(_0x1fc66c[_0x3358('0x32')][_0x3358('0x40')]){_0x4f5985['include']=[{'all':!![]}];}_0x4f5985=_[_0x3358('0x3d')]({},_0x4f5985,_0x1fc66c['options']);return db['VoiceQueueReport'][_0x3358('0x45')](_0x4f5985)[_0x3358('0x22')](handleEntityNotFound(_0x3a468c,null))[_0x3358('0x22')](respondWithResult(_0x3a468c,null))[_0x3358('0x43')](handleError(_0x3a468c,null));};exports['create']=function(_0x515f24,_0x37515d){return db[_0x3358('0x3f')][_0x3358('0x46')](_0x515f24[_0x3358('0x47')],{})['then'](respondWithResult(_0x37515d,0xc9))[_0x3358('0x43')](handleError(_0x37515d,null));};exports['update']=function(_0x10f901,_0x4dd301){if(_0x10f901[_0x3358('0x47')]['id']){delete _0x10f901['body']['id'];}return db[_0x3358('0x3f')]['find']({'where':{'id':_0x10f901[_0x3358('0x44')]['id']}})['then'](handleEntityNotFound(_0x4dd301,null))[_0x3358('0x22')](saveUpdates(_0x10f901['body'],null))[_0x3358('0x22')](respondWithResult(_0x4dd301,null))['catch'](handleError(_0x4dd301,null));};exports['destroy']=function(_0x1806aa,_0x21fa26){return db['VoiceQueueReport'][_0x3358('0x45')]({'where':{'id':_0x1806aa[_0x3358('0x44')]['id']}})[_0x3358('0x22')](handleEntityNotFound(_0x21fa26,null))['then'](removeEntity(_0x21fa26,null))['catch'](handleError(_0x21fa26,null));};exports['describe']=function(_0x2e65bf,_0x150fa6){return db['VoiceQueueReport'][_0x3358('0x48')]()[_0x3358('0x22')](respondWithResult(_0x150fa6,null))['catch'](handleError(_0x150fa6,null));};exports['getVoiceQueuesReport']=function(_0x3bcc23,_0x1207a5){var _0x341538={},_0x262610={},_0x2cf06a={'count':0x0,'rows':[]};_0x262610[_0x3358('0x2e')]=_[_0x3358('0x2f')](db['VoiceQueueReport'][_0x3358('0x2a')]);_0x262610[_0x3358('0x32')]=_[_0x3358('0x2f')](_0x3bcc23['query']);_0x262610[_0x3358('0x30')]=_['intersection'](_0x262610['model'],_0x262610[_0x3358('0x32')]);_0x341538['attributes']=_['intersection'](_0x262610[_0x3358('0x2e')],qs['fields'](_0x3bcc23[_0x3358('0x32')][_0x3358('0x34')]));_0x341538['attributes']=_0x341538[_0x3358('0x33')][_0x3358('0x35')]?_0x341538[_0x3358('0x33')]:_0x262610[_0x3358('0x2e')];if(!_0x3bcc23[_0x3358('0x32')][_0x3358('0x36')](_0x3358('0x37'))){_0x341538['limit']=qs[_0x3358('0x1b')](_0x3bcc23[_0x3358('0x32')]['limit']);_0x341538[_0x3358('0x1a')]=qs['offset'](_0x3bcc23[_0x3358('0x32')]['offset']);}_0x341538['order']=qs[_0x3358('0x39')](_0x3bcc23[_0x3358('0x32')][_0x3358('0x39')]);_0x341538[_0x3358('0x3a')]=qs[_0x3358('0x30')](_[_0x3358('0x3b')](_0x3bcc23[_0x3358('0x32')],_0x262610[_0x3358('0x30')]));if(_0x3bcc23[_0x3358('0x32')][_0x3358('0x3c')]){_0x341538[_0x3358('0x3a')]=_['merge'](_0x341538[_0x3358('0x3a')],{'$or':_['map'](_0x341538['attributes'],function(_0x2dfa98){var _0x568500={};_0x568500[_0x2dfa98]={'$like':'%'+_0x3bcc23[_0x3358('0x32')][_0x3358('0x3c')]+'%'};return _0x568500;})});}_0x341538=_[_0x3358('0x3d')]({},_0x341538,_0x3bcc23[_0x3358('0x3e')]);var _0x48f843={'where':_0x341538[_0x3358('0x3a')]};return db[_0x3358('0x3f')][_0x3358('0x1c')](_0x48f843)['then'](function(_0x1ec5fb){_0x2cf06a[_0x3358('0x1c')]=_0x1ec5fb;if(_0x3bcc23[_0x3358('0x32')][_0x3358('0x40')]){_0x341538[_0x3358('0x41')]=[{'all':!![]}];}return db['VoiceQueueReport'][_0x3358('0x49')](_0x341538);})[_0x3358('0x22')](function(_0x1a424f){_0x2cf06a[_0x3358('0x42')]=_0x1a424f;return _0x2cf06a;})[_0x3358('0x22')](respondWithFilteredResult(_0x1207a5,_0x341538,'getVoiceQueuesReport'))[_0x3358('0x43')](handleError(_0x1207a5,null,_0x3358('0x4a')));}; \ No newline at end of file +var _0x600a=['bluebird','mustache','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','redis','localhost','socket.io-emitter','register','sendStatus','status','end','json','offset','limit','count','Content-Range','save','update','then','destroy','error','name','index','map','VoiceQueueReport','rawAttributes','fieldName','type','query','filters','intersection','model','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','show','params','keys','find','catch','create','body','describe','getVoiceQueuesReport','include','rows','eml-format','zip-dir','request-promise'];(function(_0x240c68,_0x3e647f){var _0x41ebfa=function(_0x4a344f){while(--_0x4a344f){_0x240c68['push'](_0x240c68['shift']());}};_0x41ebfa(++_0x3e647f);}(_0x600a,0x8f));var _0xa600=function(_0x2ff762,_0x342c0b){_0x2ff762=_0x2ff762-0x0;var _0x158b02=_0x600a[_0x2ff762];return _0x158b02;};'use strict';var emlformat=require(_0xa600('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa600('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa600('0x2'));var moment=require('moment');var BPromise=require(_0xa600('0x3'));var Mustache=require(_0xa600('0x4'));var util=require('util');var path=require('path');var sox=require(_0xa600('0x5'));var csv=require(_0xa600('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa600('0x7'));var _=require(_0xa600('0x8'));var squel=require(_0xa600('0x9'));var crypto=require(_0xa600('0xa'));var jsforce=require(_0xa600('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xa600('0x6'));var querystring=require('querystring');var Papa=require(_0xa600('0xc'));var Redis=require(_0xa600('0xd'));var authService=require(_0xa600('0xe'));var qs=require(_0xa600('0xf'));var as=require(_0xa600('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xa600('0x11'));var utils=require('../../config/utils');var config=require(_0xa600('0x12'));var licenseUtil=require(_0xa600('0x13'));var db=require('../../mysqldb')['db'];config[_0xa600('0x14')]=_['defaults'](config[_0xa600('0x14')],{'host':_0xa600('0x15'),'port':0x18eb});var socket=require(_0xa600('0x16'))(new Redis(config[_0xa600('0x14')]));require('./voiceQueueReport.socket')[_0xa600('0x17')](socket);function respondWithStatusCode(_0x371adb,_0x1d02fc){_0x1d02fc=_0x1d02fc||0xcc;return function(_0x2c0a04){if(_0x2c0a04){return _0x371adb[_0xa600('0x18')](_0x1d02fc);}return _0x371adb[_0xa600('0x19')](_0x1d02fc)[_0xa600('0x1a')]();};}function respondWithResult(_0x1d208f,_0x4fff45){_0x4fff45=_0x4fff45||0xc8;return function(_0x123544){if(_0x123544){return _0x1d208f['status'](_0x4fff45)[_0xa600('0x1b')](_0x123544);}};}function respondWithFilteredResult(_0x30991a,_0x160366){return function(_0xa026ad){if(_0xa026ad){var _0x4ff5b5=typeof _0x160366[_0xa600('0x1c')]==='undefined'&&typeof _0x160366[_0xa600('0x1d')]==='undefined';var _0xb047d4=_0xa026ad['count'];var _0xebf718=_0x4ff5b5?0x0:_0x160366['offset'];var _0x22a3d4=_0x4ff5b5?_0xa026ad[_0xa600('0x1e')]:_0x160366[_0xa600('0x1c')]+_0x160366[_0xa600('0x1d')];var _0x49a17e;if(_0x22a3d4>=_0xb047d4){_0x22a3d4=_0xb047d4;_0x49a17e=0xc8;}else{_0x49a17e=0xce;}_0x30991a['status'](_0x49a17e);return _0x30991a['set'](_0xa600('0x1f'),_0xebf718+'-'+_0x22a3d4+'/'+_0xb047d4)['json'](_0xa026ad);}return null;};}function patchUpdates(_0x5144f5){return function(_0x2eca39){try{jsonpatch['apply'](_0x2eca39,_0x5144f5,!![]);}catch(_0x4a942e){return BPromise['reject'](_0x4a942e);}return _0x2eca39[_0xa600('0x20')]();};}function saveUpdates(_0x3d5252,_0x41e4b2){return function(_0x12c9e3){if(_0x12c9e3){return _0x12c9e3[_0xa600('0x21')](_0x3d5252)[_0xa600('0x22')](function(_0x4259e5){return _0x4259e5;});}return null;};}function removeEntity(_0x164bbb,_0x1ce7db){return function(_0x5a590b){if(_0x5a590b){return _0x5a590b[_0xa600('0x23')]()[_0xa600('0x22')](function(){_0x164bbb['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x7ee722,_0xb64089){return function(_0x31f6e8){if(!_0x31f6e8){_0x7ee722[_0xa600('0x18')](0x194);}return _0x31f6e8;};}function handleError(_0x4755c2,_0x415b45){_0x415b45=_0x415b45||0x1f4;return function(_0xbda06b){logger[_0xa600('0x24')](_0xbda06b['stack']);if(_0xbda06b[_0xa600('0x25')]){delete _0xbda06b[_0xa600('0x25')];}_0x4755c2[_0xa600('0x19')](_0x415b45)['send'](_0xbda06b);};}exports[_0xa600('0x26')]=function(_0x56fe79,_0x28f4fa){var _0x15f56a={},_0x21bf36={},_0x115344={'count':0x0,'rows':[]};var _0x5c8bd3=_[_0xa600('0x27')](db[_0xa600('0x28')][_0xa600('0x29')],function(_0x59d697){return{'name':_0x59d697[_0xa600('0x2a')],'type':_0x59d697[_0xa600('0x2b')]['key']};});_0x21bf36['model']=_[_0xa600('0x27')](_0x5c8bd3,_0xa600('0x25'));_0x21bf36[_0xa600('0x2c')]=_['keys'](_0x56fe79['query']);_0x21bf36[_0xa600('0x2d')]=_[_0xa600('0x2e')](_0x21bf36[_0xa600('0x2f')],_0x21bf36[_0xa600('0x2c')]);_0x15f56a['attributes']=_[_0xa600('0x2e')](_0x21bf36[_0xa600('0x2f')],qs[_0xa600('0x30')](_0x56fe79[_0xa600('0x2c')][_0xa600('0x30')]));_0x15f56a[_0xa600('0x31')]=_0x15f56a[_0xa600('0x31')]['length']?_0x15f56a['attributes']:_0x21bf36[_0xa600('0x2f')];if(!_0x56fe79[_0xa600('0x2c')][_0xa600('0x32')](_0xa600('0x33'))){_0x15f56a['limit']=qs[_0xa600('0x1d')](_0x56fe79[_0xa600('0x2c')][_0xa600('0x1d')]);_0x15f56a[_0xa600('0x1c')]=qs['offset'](_0x56fe79[_0xa600('0x2c')][_0xa600('0x1c')]);}_0x15f56a[_0xa600('0x34')]=qs[_0xa600('0x35')](_0x56fe79[_0xa600('0x2c')][_0xa600('0x35')]);_0x15f56a[_0xa600('0x36')]=qs[_0xa600('0x2d')](_[_0xa600('0x37')](_0x56fe79[_0xa600('0x2c')],_0x21bf36[_0xa600('0x2d')]),_0x5c8bd3);if(_0x56fe79[_0xa600('0x2c')][_0xa600('0x38')]){_0x15f56a['where']=_[_0xa600('0x39')](_0x15f56a[_0xa600('0x36')],{'$or':_[_0xa600('0x27')](_0x5c8bd3,function(_0xf1da36){if(_0xf1da36[_0xa600('0x2b')]!==_0xa600('0x3a')){var _0x4a63ba={};_0x4a63ba[_0xf1da36['name']]={'$like':'%'+_0x56fe79[_0xa600('0x2c')][_0xa600('0x38')]+'%'};return _0x4a63ba;}})});}_0x15f56a=_[_0xa600('0x39')]({},_0x15f56a,_0x56fe79[_0xa600('0x3b')]);var _0xa36c2a={'where':_0x15f56a['where']};return db[_0xa600('0x28')][_0xa600('0x1e')](_0xa36c2a)[_0xa600('0x22')](function(_0x40b192){_0x115344['count']=_0x40b192;if(_0x56fe79[_0xa600('0x2c')][_0xa600('0x3c')]){_0x15f56a['include']=[{'all':!![]}];}return db[_0xa600('0x28')][_0xa600('0x3d')](_0x15f56a);})[_0xa600('0x22')](function(_0x1045db){_0x115344['rows']=_0x1045db;return _0x115344;})['then'](respondWithFilteredResult(_0x28f4fa,_0x15f56a))['catch'](handleError(_0x28f4fa,null));};exports[_0xa600('0x3e')]=function(_0x17863b,_0x1293c0){var _0x1e4bc6={'raw':![],'where':{'id':_0x17863b[_0xa600('0x3f')]['id']}},_0x1c87c2={};_0x1c87c2[_0xa600('0x2f')]=_[_0xa600('0x40')](db[_0xa600('0x28')]['rawAttributes']);_0x1c87c2['query']=_[_0xa600('0x40')](_0x17863b[_0xa600('0x2c')]);_0x1c87c2[_0xa600('0x2d')]=_['intersection'](_0x1c87c2[_0xa600('0x2f')],_0x1c87c2[_0xa600('0x2c')]);_0x1e4bc6[_0xa600('0x31')]=_[_0xa600('0x2e')](_0x1c87c2[_0xa600('0x2f')],qs[_0xa600('0x30')](_0x17863b[_0xa600('0x2c')][_0xa600('0x30')]));_0x1e4bc6[_0xa600('0x31')]=_0x1e4bc6[_0xa600('0x31')]['length']?_0x1e4bc6[_0xa600('0x31')]:_0x1c87c2[_0xa600('0x2f')];if(_0x17863b[_0xa600('0x2c')]['includeAll']){_0x1e4bc6['include']=[{'all':!![]}];}_0x1e4bc6=_[_0xa600('0x39')]({},_0x1e4bc6,_0x17863b[_0xa600('0x3b')]);return db[_0xa600('0x28')][_0xa600('0x41')](_0x1e4bc6)['then'](handleEntityNotFound(_0x1293c0,null))[_0xa600('0x22')](respondWithResult(_0x1293c0,null))[_0xa600('0x42')](handleError(_0x1293c0,null));};exports[_0xa600('0x43')]=function(_0xa86085,_0x41c64b){return db['VoiceQueueReport'][_0xa600('0x43')](_0xa86085[_0xa600('0x44')],{})['then'](respondWithResult(_0x41c64b,0xc9))[_0xa600('0x42')](handleError(_0x41c64b,null));};exports[_0xa600('0x21')]=function(_0x2b9064,_0x504c6a){if(_0x2b9064[_0xa600('0x44')]['id']){delete _0x2b9064[_0xa600('0x44')]['id'];}return db[_0xa600('0x28')][_0xa600('0x41')]({'where':{'id':_0x2b9064[_0xa600('0x3f')]['id']}})[_0xa600('0x22')](handleEntityNotFound(_0x504c6a,null))['then'](saveUpdates(_0x2b9064[_0xa600('0x44')],null))[_0xa600('0x22')](respondWithResult(_0x504c6a,null))['catch'](handleError(_0x504c6a,null));};exports[_0xa600('0x23')]=function(_0x373e19,_0x44d987){return db['VoiceQueueReport']['find']({'where':{'id':_0x373e19[_0xa600('0x3f')]['id']}})[_0xa600('0x22')](handleEntityNotFound(_0x44d987,null))[_0xa600('0x22')](removeEntity(_0x44d987,null))[_0xa600('0x42')](handleError(_0x44d987,null));};exports[_0xa600('0x45')]=function(_0x15f066,_0x3998dd){return db[_0xa600('0x28')][_0xa600('0x45')]()['then'](respondWithResult(_0x3998dd,null))['catch'](handleError(_0x3998dd,null));};exports[_0xa600('0x46')]=function(_0xecd8c0,_0x5b193e){var _0x2c934b={},_0x341561={},_0xa0c7ea={'count':0x0,'rows':[]};_0x341561[_0xa600('0x2f')]=_[_0xa600('0x40')](db[_0xa600('0x28')][_0xa600('0x29')]);_0x341561[_0xa600('0x2c')]=_[_0xa600('0x40')](_0xecd8c0[_0xa600('0x2c')]);_0x341561['filters']=_[_0xa600('0x2e')](_0x341561[_0xa600('0x2f')],_0x341561[_0xa600('0x2c')]);_0x2c934b[_0xa600('0x31')]=_[_0xa600('0x2e')](_0x341561['model'],qs[_0xa600('0x30')](_0xecd8c0[_0xa600('0x2c')]['fields']));_0x2c934b[_0xa600('0x31')]=_0x2c934b['attributes']['length']?_0x2c934b[_0xa600('0x31')]:_0x341561['model'];if(!_0xecd8c0['query']['hasOwnProperty'](_0xa600('0x33'))){_0x2c934b[_0xa600('0x1d')]=qs[_0xa600('0x1d')](_0xecd8c0[_0xa600('0x2c')]['limit']);_0x2c934b[_0xa600('0x1c')]=qs[_0xa600('0x1c')](_0xecd8c0[_0xa600('0x2c')]['offset']);}_0x2c934b[_0xa600('0x34')]=qs[_0xa600('0x35')](_0xecd8c0[_0xa600('0x2c')][_0xa600('0x35')]);_0x2c934b[_0xa600('0x36')]=qs[_0xa600('0x2d')](_['pick'](_0xecd8c0[_0xa600('0x2c')],_0x341561[_0xa600('0x2d')]));if(_0xecd8c0['query'][_0xa600('0x38')]){_0x2c934b[_0xa600('0x36')]=_[_0xa600('0x39')](_0x2c934b[_0xa600('0x36')],{'$or':_[_0xa600('0x27')](_0x2c934b[_0xa600('0x31')],function(_0xd0064c){var _0x3f793b={};_0x3f793b[_0xd0064c]={'$like':'%'+_0xecd8c0[_0xa600('0x2c')][_0xa600('0x38')]+'%'};return _0x3f793b;})});}_0x2c934b=_[_0xa600('0x39')]({},_0x2c934b,_0xecd8c0[_0xa600('0x3b')]);var _0x41749b={'where':_0x2c934b[_0xa600('0x36')]};return db[_0xa600('0x28')]['count'](_0x41749b)[_0xa600('0x22')](function(_0x1b3d0c){_0xa0c7ea[_0xa600('0x1e')]=_0x1b3d0c;if(_0xecd8c0[_0xa600('0x2c')][_0xa600('0x3c')]){_0x2c934b[_0xa600('0x47')]=[{'all':!![]}];}return db[_0xa600('0x28')][_0xa600('0x3d')](_0x2c934b);})['then'](function(_0x400fc1){_0xa0c7ea[_0xa600('0x48')]=_0x400fc1;return _0xa0c7ea;})[_0xa600('0x22')](respondWithFilteredResult(_0x5b193e,_0x2c934b,_0xa600('0x46')))[_0xa600('0x42')](handleError(_0x5b193e,null,_0xa600('0x46')));}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.events.js b/server/api/voiceQueueReport/voiceQueueReport.events.js index b8288db..2b3470b 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 _0x7729=['save','update','remove','emit','hasOwnProperty','hook','exports','events','VoiceQueueReport'];(function(_0xf37978,_0x143d68){var _0x385191=function(_0x416883){while(--_0x416883){_0xf37978['push'](_0xf37978['shift']());}};_0x385191(++_0x143d68);}(_0x7729,0x1d2));var _0x9772=function(_0x7e79aa,_0x177253){_0x7e79aa=_0x7e79aa-0x0;var _0x50a7f1=_0x7729[_0x7e79aa];return _0x50a7f1;};'use strict';var EventEmitter=require(_0x9772('0x0'));var VoiceQueueReport=require('../../mysqldb')['db'][_0x9772('0x1')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x9772('0x2'),'afterUpdate':_0x9772('0x3'),'afterDestroy':_0x9772('0x4')};function emitEvent(_0x2d3f3b){return function(_0x4773f2,_0xc90eb6,_0x59c975){VoiceQueueReportEvents[_0x9772('0x5')](_0x2d3f3b+':'+_0x4773f2['id'],_0x4773f2);VoiceQueueReportEvents[_0x9772('0x5')](_0x2d3f3b,_0x4773f2);_0x59c975(null);};}for(var e in events){if(events[_0x9772('0x6')](e)){var event=events[e];VoiceQueueReport[_0x9772('0x7')](e,emitEvent(event));}}module[_0x9772('0x8')]=VoiceQueueReportEvents; \ No newline at end of file +var _0xc775=['save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','VoiceQueueReport','setMaxListeners'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0xc775,0xe3));var _0x5c77=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0xc775[_0x17d9e3];return _0x14192d;};'use strict';var EventEmitter=require(_0x5c77('0x0'));var VoiceQueueReport=require(_0x5c77('0x1'))['db'][_0x5c77('0x2')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0x5c77('0x3')](0x0);var events={'afterCreate':_0x5c77('0x4'),'afterUpdate':_0x5c77('0x5'),'afterDestroy':_0x5c77('0x6')};function emitEvent(_0x411714){return function(_0x187a24,_0x1bcd7f,_0x7c4bbb){VoiceQueueReportEvents[_0x5c77('0x7')](_0x411714+':'+_0x187a24['id'],_0x187a24);VoiceQueueReportEvents[_0x5c77('0x7')](_0x411714,_0x187a24);_0x7c4bbb(null);};}for(var e in events){if(events[_0x5c77('0x8')](e)){var event=events[e];VoiceQueueReport[_0x5c77('0x9')](e,emitEvent(event));}}module[_0x5c77('0xa')]=VoiceQueueReportEvents; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.model.js b/server/api/voiceQueueReport/voiceQueueReport.model.js index 2c2a87c..aad968a 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 _0xa84c=['uniqueid','lodash','../../config/logger','moment','path','./voiceQueueReport.attributes','exports','VoiceQueueReport','report_queue'];(function(_0x10f7bf,_0x43bc43){var _0x1d4fb3=function(_0x47f473){while(--_0x47f473){_0x10f7bf['push'](_0x10f7bf['shift']());}};_0x1d4fb3(++_0x43bc43);}(_0xa84c,0xf4));var _0xca84=function(_0x4f9617,_0x16a10a){_0x4f9617=_0x4f9617-0x0;var _0x55b7d0=_0xa84c[_0x4f9617];return _0x55b7d0;};'use strict';var _=require(_0xca84('0x0'));var util=require('util');var logger=require(_0xca84('0x1'))('api');var moment=require(_0xca84('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xca84('0x3'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xca84('0x4'));module[_0xca84('0x5')]=function(_0x7193ce,_0x3dabc4){return _0x7193ce['define'](_0xca84('0x6'),attributes,{'tableName':_0xca84('0x7'),'paranoid':![],'indexes':[{'fields':[_0xca84('0x8')]},{'fields':['calleridnum']}],'timestamps':!![]});}; \ No newline at end of file +var _0x5667=['api','bluebird','request-promise','path','rimraf','../../config/environment','./voiceQueueReport.attributes','exports','define','VoiceQueueReport','report_queue','uniqueid','calleridnum','util'];(function(_0x845505,_0x19e5f3){var _0x2513b9=function(_0x10e7af){while(--_0x10e7af){_0x845505['push'](_0x845505['shift']());}};_0x2513b9(++_0x19e5f3);}(_0x5667,0xd1));var _0x7566=function(_0x30d588,_0x3feb55){_0x30d588=_0x30d588-0x0;var _0x1218ad=_0x5667[_0x30d588];return _0x1218ad;};'use strict';var _=require('lodash');var util=require(_0x7566('0x0'));var logger=require('../../config/logger')(_0x7566('0x1'));var moment=require('moment');var BPromise=require(_0x7566('0x2'));var rp=require(_0x7566('0x3'));var fs=require('fs');var path=require(_0x7566('0x4'));var rimraf=require(_0x7566('0x5'));var config=require(_0x7566('0x6'));var attributes=require(_0x7566('0x7'));module[_0x7566('0x8')]=function(_0x154b8e,_0x374ad9){return _0x154b8e[_0x7566('0x9')](_0x7566('0xa'),attributes,{'tableName':_0x7566('0xb'),'paranoid':![],'indexes':[{'fields':[_0x7566('0xc')]},{'fields':[_0x7566('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.rpc.js b/server/api/voiceQueueReport/voiceQueueReport.rpc.js index 173cc6e..3f92c7a 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 _0xac8a=['request','then','info','VoiceQueueReport,\x20%s,\x20%s','request\x20sent','debug','VoiceQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','VoiceQueueReport','findAll','options','raw','attributes','limit','include','map','model','GetVoiceQueueReport','catch','CreateVoiceQueueReport','create','body','UpdateVoiceQueueReport','update','where','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','http','redis','socket.io-emitter','./voiceQueueReport.socket','register'];(function(_0x125b06,_0x4d4ff4){var _0x3cc44b=function(_0x1deef9){while(--_0x1deef9){_0x125b06['push'](_0x125b06['shift']());}};_0x3cc44b(++_0x4d4ff4);}(_0xac8a,0x175));var _0xaac8=function(_0x31ea6f,_0x5d2e87){_0x31ea6f=_0x31ea6f-0x0;var _0x164b40=_0xac8a[_0x31ea6f];return _0x164b40;};'use strict';var _=require(_0xaac8('0x0'));var util=require(_0xaac8('0x1'));var moment=require(_0xaac8('0x2'));var BPromise=require(_0xaac8('0x3'));var rs=require(_0xaac8('0x4'));var fs=require('fs');var Redis=require(_0xaac8('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xaac8('0x6'));var logger=require(_0xaac8('0x7'))(_0xaac8('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xaac8('0x9')]({'port':0x232a});config['redis']=_['defaults'](config[_0xaac8('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0xaac8('0xb'))(new Redis(config[_0xaac8('0xa')]));require(_0xaac8('0xc'))[_0xaac8('0xd')](socket);function respondWithRpcPromise(_0x57aa5a,_0x530e24,_0x4464a1){return new BPromise(function(_0x277d4d,_0x203f23){return client[_0xaac8('0xe')](_0x57aa5a,_0x4464a1)[_0xaac8('0xf')](function(_0x236fa3){logger[_0xaac8('0x10')](_0xaac8('0x11'),_0x530e24,_0xaac8('0x12'));logger[_0xaac8('0x13')](_0xaac8('0x14'),_0x530e24,_0xaac8('0x12'),JSON[_0xaac8('0x15')](_0x236fa3));if(_0x236fa3['error']){if(_0x236fa3[_0xaac8('0x16')][_0xaac8('0x17')]===0x1f4){logger[_0xaac8('0x16')](_0xaac8('0x11'),_0x530e24,_0x236fa3[_0xaac8('0x16')]['message']);return _0x203f23(_0x236fa3[_0xaac8('0x16')][_0xaac8('0x18')]);}logger[_0xaac8('0x16')](_0xaac8('0x11'),_0x530e24,_0x236fa3['error'][_0xaac8('0x18')]);return _0x277d4d(_0x236fa3[_0xaac8('0x16')][_0xaac8('0x18')]);}else{logger[_0xaac8('0x10')]('VoiceQueueReport,\x20%s,\x20%s',_0x530e24,'request\x20sent');_0x277d4d(_0x236fa3[_0xaac8('0x19')][_0xaac8('0x18')]);}})['catch'](function(_0x45c6dd){logger['error'](_0xaac8('0x11'),_0x530e24,_0x45c6dd);_0x203f23(_0x45c6dd);});});}exports['GetVoiceQueueReport']=function(_0x178b91){var _0x2e9111=this;return new Promise(function(_0x1d443f,_0x327c11){return db[_0xaac8('0x1a')][_0xaac8('0x1b')]({'raw':_0x178b91[_0xaac8('0x1c')]?_0x178b91[_0xaac8('0x1c')][_0xaac8('0x1d')]===undefined?!![]:![]:!![],'where':_0x178b91[_0xaac8('0x1c')]?_0x178b91[_0xaac8('0x1c')]['where']||null:null,'attributes':_0x178b91['options']?_0x178b91[_0xaac8('0x1c')][_0xaac8('0x1e')]||null:null,'limit':_0x178b91['options']?_0x178b91['options'][_0xaac8('0x1f')]||null:null,'include':_0x178b91[_0xaac8('0x1c')]?_0x178b91['options'][_0xaac8('0x20')]?_[_0xaac8('0x21')](_0x178b91['options'][_0xaac8('0x20')],function(_0xd88e53){return{'model':db[_0xd88e53[_0xaac8('0x22')]],'as':_0xd88e53['as'],'attributes':_0xd88e53[_0xaac8('0x1e')],'include':_0xd88e53[_0xaac8('0x20')]?_[_0xaac8('0x21')](_0xd88e53[_0xaac8('0x20')],function(_0x1a9169){return{'model':db[_0x1a9169[_0xaac8('0x22')]],'as':_0x1a9169['as'],'attributes':_0x1a9169[_0xaac8('0x1e')],'include':_0x1a9169[_0xaac8('0x20')]?_['map'](_0x1a9169[_0xaac8('0x20')],function(_0x10fdfa){return{'model':db[_0x10fdfa['model']],'as':_0x10fdfa['as'],'attributes':_0x10fdfa[_0xaac8('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xaac8('0xf')](function(_0x330cdc){logger[_0xaac8('0x10')]('GetVoiceQueueReport',_0x178b91);logger[_0xaac8('0x13')](_0xaac8('0x23'),_0x178b91,JSON['stringify'](_0x330cdc));_0x1d443f(_0x330cdc);})[_0xaac8('0x24')](function(_0x5a7a3f){logger['error']('GetVoiceQueueReport',_0x5a7a3f[_0xaac8('0x18')],_0x178b91);_0x327c11(_0x2e9111['error'](0x1f4,_0x5a7a3f[_0xaac8('0x18')]));});});};exports[_0xaac8('0x25')]=function(_0x41919c){var _0x188451=this;return new Promise(function(_0x456675,_0x171218){return db[_0xaac8('0x1a')][_0xaac8('0x26')](_0x41919c[_0xaac8('0x27')],{'raw':_0x41919c[_0xaac8('0x1c')]?_0x41919c[_0xaac8('0x1c')]['raw']===undefined?!![]:![]:!![]})[_0xaac8('0xf')](function(_0x23c42f){logger[_0xaac8('0x10')](_0xaac8('0x25'),_0x41919c);logger[_0xaac8('0x13')](_0xaac8('0x25'),_0x41919c,JSON['stringify'](_0x23c42f));_0x456675(_0x23c42f);})[_0xaac8('0x24')](function(_0x234db0){logger[_0xaac8('0x16')](_0xaac8('0x25'),_0x234db0[_0xaac8('0x18')],_0x41919c);_0x171218(_0x188451[_0xaac8('0x16')](0x1f4,_0x234db0[_0xaac8('0x18')]));});});};exports[_0xaac8('0x28')]=function(_0x17ef6a){var _0x1fa1a1=this;return new Promise(function(_0x59c0f2,_0x49d7af){return db[_0xaac8('0x1a')][_0xaac8('0x29')](_0x17ef6a[_0xaac8('0x27')],{'raw':_0x17ef6a['options']?_0x17ef6a[_0xaac8('0x1c')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x17ef6a[_0xaac8('0x1c')]?_0x17ef6a[_0xaac8('0x1c')][_0xaac8('0x2a')]||null:null,'attributes':_0x17ef6a[_0xaac8('0x1c')]?_0x17ef6a[_0xaac8('0x1c')][_0xaac8('0x1e')]||null:null,'limit':_0x17ef6a[_0xaac8('0x1c')]?_0x17ef6a[_0xaac8('0x1c')]['limit']||null:null})['then'](function(_0x38f044){logger[_0xaac8('0x10')](_0xaac8('0x28'),_0x17ef6a);logger['debug'](_0xaac8('0x28'),_0x17ef6a,JSON['stringify'](_0x38f044));_0x59c0f2(_0x38f044);})['catch'](function(_0x5a9a3c){logger[_0xaac8('0x16')]('UpdateVoiceQueueReport',_0x5a9a3c[_0xaac8('0x18')],_0x17ef6a);_0x49d7af(_0x1fa1a1[_0xaac8('0x16')](0x1f4,_0x5a9a3c['message']));});});}; \ No newline at end of file +var _0x23de=['info','catch','GetVoiceQueueReport','findAll','options','raw','where','limit','map','attributes','include','model','then','VoiceQueueReport','create','CreateVoiceQueueReport','UpdateVoiceQueueReport','update','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','./voiceQueueReport.socket','register','request','VoiceQueueReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message'];(function(_0x42bc91,_0x41f40a){var _0x3f5507=function(_0x20cfaf){while(--_0x20cfaf){_0x42bc91['push'](_0x42bc91['shift']());}};_0x3f5507(++_0x41f40a);}(_0x23de,0x11a));var _0xe23d=function(_0x3c0dcc,_0x18c419){_0x3c0dcc=_0x3c0dcc-0x0;var _0x1a224c=_0x23de[_0x3c0dcc];return _0x1a224c;};'use strict';var _=require(_0xe23d('0x0'));var util=require('util');var moment=require(_0xe23d('0x1'));var BPromise=require(_0xe23d('0x2'));var rs=require(_0xe23d('0x3'));var fs=require('fs');var Redis=require(_0xe23d('0x4'));var db=require(_0xe23d('0x5'))['db'];var utils=require(_0xe23d('0x6'));var logger=require(_0xe23d('0x7'))(_0xe23d('0x8'));var config=require(_0xe23d('0x9'));var jayson=require(_0xe23d('0xa'));var client=jayson[_0xe23d('0xb')][_0xe23d('0xc')]({'port':0x232a});config['redis']=_[_0xe23d('0xd')](config[_0xe23d('0xe')],{'host':_0xe23d('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe23d('0xe')]));require(_0xe23d('0x10'))[_0xe23d('0x11')](socket);function respondWithRpcPromise(_0x141df9,_0x8b7e20,_0x1c90d5){return new BPromise(function(_0x107c7f,_0x5be9a3){return client[_0xe23d('0x12')](_0x141df9,_0x1c90d5)['then'](function(_0x58fe6b){logger['info'](_0xe23d('0x13'),_0x8b7e20,_0xe23d('0x14'));logger[_0xe23d('0x15')]('VoiceQueueReport,\x20%s,\x20%s,\x20%s',_0x8b7e20,'request\x20sent',JSON[_0xe23d('0x16')](_0x58fe6b));if(_0x58fe6b['error']){if(_0x58fe6b[_0xe23d('0x17')][_0xe23d('0x18')]===0x1f4){logger[_0xe23d('0x17')](_0xe23d('0x13'),_0x8b7e20,_0x58fe6b[_0xe23d('0x17')]['message']);return _0x5be9a3(_0x58fe6b[_0xe23d('0x17')][_0xe23d('0x19')]);}logger[_0xe23d('0x17')](_0xe23d('0x13'),_0x8b7e20,_0x58fe6b[_0xe23d('0x17')][_0xe23d('0x19')]);return _0x107c7f(_0x58fe6b['error'][_0xe23d('0x19')]);}else{logger[_0xe23d('0x1a')](_0xe23d('0x13'),_0x8b7e20,_0xe23d('0x14'));_0x107c7f(_0x58fe6b['result'][_0xe23d('0x19')]);}})[_0xe23d('0x1b')](function(_0x5e3329){logger['error'](_0xe23d('0x13'),_0x8b7e20,_0x5e3329);_0x5be9a3(_0x5e3329);});});}exports[_0xe23d('0x1c')]=function(_0x13e242){var _0x33b83e=this;return new Promise(function(_0x41a938,_0x334c67){return db['VoiceQueueReport'][_0xe23d('0x1d')]({'raw':_0x13e242[_0xe23d('0x1e')]?_0x13e242['options'][_0xe23d('0x1f')]===undefined?!![]:![]:!![],'where':_0x13e242[_0xe23d('0x1e')]?_0x13e242[_0xe23d('0x1e')][_0xe23d('0x20')]||null:null,'attributes':_0x13e242[_0xe23d('0x1e')]?_0x13e242[_0xe23d('0x1e')]['attributes']||null:null,'limit':_0x13e242[_0xe23d('0x1e')]?_0x13e242[_0xe23d('0x1e')][_0xe23d('0x21')]||null:null,'include':_0x13e242[_0xe23d('0x1e')]?_0x13e242['options']['include']?_[_0xe23d('0x22')](_0x13e242[_0xe23d('0x1e')]['include'],function(_0x4a4267){return{'model':db[_0x4a4267['model']],'as':_0x4a4267['as'],'attributes':_0x4a4267[_0xe23d('0x23')],'include':_0x4a4267[_0xe23d('0x24')]?_[_0xe23d('0x22')](_0x4a4267[_0xe23d('0x24')],function(_0x414db9){return{'model':db[_0x414db9['model']],'as':_0x414db9['as'],'attributes':_0x414db9[_0xe23d('0x23')],'include':_0x414db9[_0xe23d('0x24')]?_['map'](_0x414db9[_0xe23d('0x24')],function(_0x28bf87){return{'model':db[_0x28bf87[_0xe23d('0x25')]],'as':_0x28bf87['as'],'attributes':_0x28bf87[_0xe23d('0x23')]};}):[]};}):[]};}):[]:[]})[_0xe23d('0x26')](function(_0x386a8b){logger[_0xe23d('0x1a')](_0xe23d('0x1c'),_0x13e242);logger[_0xe23d('0x15')](_0xe23d('0x1c'),_0x13e242,JSON['stringify'](_0x386a8b));_0x41a938(_0x386a8b);})[_0xe23d('0x1b')](function(_0x5966c0){logger[_0xe23d('0x17')](_0xe23d('0x1c'),_0x5966c0['message'],_0x13e242);_0x334c67(_0x33b83e[_0xe23d('0x17')](0x1f4,_0x5966c0[_0xe23d('0x19')]));});});};exports['CreateVoiceQueueReport']=function(_0x407011){var _0x3ad011=this;return new Promise(function(_0x4a8e43,_0x538297){return db[_0xe23d('0x27')][_0xe23d('0x28')](_0x407011['body'],{'raw':_0x407011[_0xe23d('0x1e')]?_0x407011[_0xe23d('0x1e')]['raw']===undefined?!![]:![]:!![]})[_0xe23d('0x26')](function(_0x5e6c67){logger[_0xe23d('0x1a')]('CreateVoiceQueueReport',_0x407011);logger['debug']('CreateVoiceQueueReport',_0x407011,JSON[_0xe23d('0x16')](_0x5e6c67));_0x4a8e43(_0x5e6c67);})[_0xe23d('0x1b')](function(_0x55bad4){logger['error'](_0xe23d('0x29'),_0x55bad4[_0xe23d('0x19')],_0x407011);_0x538297(_0x3ad011['error'](0x1f4,_0x55bad4[_0xe23d('0x19')]));});});};exports[_0xe23d('0x2a')]=function(_0x366a3b){var _0x4e9943=this;return new Promise(function(_0xf96799,_0x364dba){return db['VoiceQueueReport'][_0xe23d('0x2b')](_0x366a3b['body'],{'raw':_0x366a3b['options']?_0x366a3b[_0xe23d('0x1e')][_0xe23d('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x366a3b[_0xe23d('0x1e')]?_0x366a3b[_0xe23d('0x1e')][_0xe23d('0x20')]||null:null,'attributes':_0x366a3b['options']?_0x366a3b[_0xe23d('0x1e')][_0xe23d('0x23')]||null:null,'limit':_0x366a3b[_0xe23d('0x1e')]?_0x366a3b[_0xe23d('0x1e')][_0xe23d('0x21')]||null:null})['then'](function(_0x2e6620){logger[_0xe23d('0x1a')]('UpdateVoiceQueueReport',_0x366a3b);logger[_0xe23d('0x15')](_0xe23d('0x2a'),_0x366a3b,JSON['stringify'](_0x2e6620));_0xf96799(_0x2e6620);})[_0xe23d('0x1b')](function(_0x46a441){logger[_0xe23d('0x17')](_0xe23d('0x2a'),_0x46a441[_0xe23d('0x19')],_0x366a3b);_0x364dba(_0x4e9943[_0xe23d('0x17')](0x1f4,_0x46a441[_0xe23d('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.socket.js b/server/api/voiceQueueReport/voiceQueueReport.socket.js index f98e52e..7793af2 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 _0x131a=['register','length','voiceQueueReport:','./voiceQueueReport.events','save','remove','update'];(function(_0x162de1,_0x43c729){var _0x4cc7e9=function(_0x1c8601){while(--_0x1c8601){_0x162de1['push'](_0x162de1['shift']());}};_0x4cc7e9(++_0x43c729);}(_0x131a,0x18b));var _0xa131=function(_0x199fc2,_0x2ac31c){_0x199fc2=_0x199fc2-0x0;var _0x4078f5=_0x131a[_0x199fc2];return _0x4078f5;};'use strict';var VoiceQueueReportEvents=require(_0xa131('0x0'));var events=[_0xa131('0x1'),_0xa131('0x2'),_0xa131('0x3')];function createListener(_0x2bc3d1,_0x47b042){return function(_0x38a99b){_0x47b042['emit'](_0x2bc3d1,_0x38a99b);};}function removeListener(_0x20560e,_0x1bf41d){return function(){VoiceQueueReportEvents['removeListener'](_0x20560e,_0x1bf41d);};}exports[_0xa131('0x4')]=function(_0xdb263c){for(var _0x1a51cf=0x0,_0x273875=events[_0xa131('0x5')];_0x1a51cf<_0x273875;_0x1a51cf++){var _0x43ac6c=events[_0x1a51cf];var _0x26bdfb=createListener(_0xa131('0x6')+_0x43ac6c,_0xdb263c);VoiceQueueReportEvents['on'](_0x43ac6c,_0x26bdfb);}}; \ No newline at end of file +var _0x20ad=['save','remove','update','emit','removeListener','register','length','voiceQueueReport:','./voiceQueueReport.events'];(function(_0x4926eb,_0x4226e8){var _0x27af75=function(_0x378f10){while(--_0x378f10){_0x4926eb['push'](_0x4926eb['shift']());}};_0x27af75(++_0x4226e8);}(_0x20ad,0x13a));var _0xd20a=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x20ad[_0x618414];return _0x21c19a;};'use strict';var VoiceQueueReportEvents=require(_0xd20a('0x0'));var events=[_0xd20a('0x1'),_0xd20a('0x2'),_0xd20a('0x3')];function createListener(_0x510c0e,_0x2de53e){return function(_0x3297dd){_0x2de53e[_0xd20a('0x4')](_0x510c0e,_0x3297dd);};}function removeListener(_0x274c14,_0x1d6f52){return function(){VoiceQueueReportEvents[_0xd20a('0x5')](_0x274c14,_0x1d6f52);};}exports[_0xd20a('0x6')]=function(_0x26be33){for(var _0x1c71e=0x0,_0x58f33b=events[_0xd20a('0x7')];_0x1c71e<_0x58f33b;_0x1c71e++){var _0xf47652=events[_0x1c71e];var _0x4c56a0=createListener(_0xd20a('0x8')+_0xf47652,_0x26be33);VoiceQueueReportEvents['on'](_0xf47652,_0x4c56a0);}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/index.js b/server/api/voiceQueuesLog/index.js index aab759b..d6ee23d 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 _0x1246=['exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceQueuesLog.controller','isAuthenticated','get','show','post','create','put','/:id','update','delete','destroy'];(function(_0x9884e3,_0x34a043){var _0x6e3ec=function(_0x4d328c){while(--_0x4d328c){_0x9884e3['push'](_0x9884e3['shift']());}};_0x6e3ec(++_0x34a043);}(_0x1246,0x10b));var _0x6124=function(_0xe211fd,_0x47708d){_0xe211fd=_0xe211fd-0x0;var _0x1eedb6=_0x1246[_0xe211fd];return _0x1eedb6;};'use strict';var multer=require(_0x6124('0x0'));var util=require(_0x6124('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x6124('0x2'));var router=express[_0x6124('0x3')]();var fs_extra=require(_0x6124('0x4'));var auth=require(_0x6124('0x5'));var interaction=require(_0x6124('0x6'));var config=require('../../config/environment');var controller=require(_0x6124('0x7'));router['get']('/',auth[_0x6124('0x8')](),controller['index']);router[_0x6124('0x9')]('/:id',auth[_0x6124('0x8')](),controller[_0x6124('0xa')]);router[_0x6124('0xb')]('/',auth[_0x6124('0x8')](),controller[_0x6124('0xc')]);router[_0x6124('0xd')](_0x6124('0xe'),auth[_0x6124('0x8')](),controller[_0x6124('0xf')]);router[_0x6124('0x10')](_0x6124('0xe'),auth[_0x6124('0x8')](),controller[_0x6124('0x11')]);module[_0x6124('0x12')]=router; \ No newline at end of file +var _0x8ff9=['../../config/environment','./voiceQueuesLog.controller','isAuthenticated','get','/:id','show','post','create','put','update','delete','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x5d5e94,_0x31d24c){var _0x1c2a04=function(_0x411002){while(--_0x411002){_0x5d5e94['push'](_0x5d5e94['shift']());}};_0x1c2a04(++_0x31d24c);}(_0x8ff9,0x188));var _0x98ff=function(_0x40393f,_0x588b8a){_0x40393f=_0x40393f-0x0;var _0x2ad94e=_0x8ff9[_0x40393f];return _0x2ad94e;};'use strict';var multer=require(_0x98ff('0x0'));var util=require(_0x98ff('0x1'));var path=require(_0x98ff('0x2'));var timeout=require('connect-timeout');var express=require(_0x98ff('0x3'));var router=express[_0x98ff('0x4')]();var fs_extra=require(_0x98ff('0x5'));var auth=require(_0x98ff('0x6'));var interaction=require(_0x98ff('0x7'));var config=require(_0x98ff('0x8'));var controller=require(_0x98ff('0x9'));router['get']('/',auth[_0x98ff('0xa')](),controller['index']);router[_0x98ff('0xb')](_0x98ff('0xc'),auth['isAuthenticated'](),controller[_0x98ff('0xd')]);router[_0x98ff('0xe')]('/',auth[_0x98ff('0xa')](),controller[_0x98ff('0xf')]);router[_0x98ff('0x10')](_0x98ff('0xc'),auth['isAuthenticated'](),controller[_0x98ff('0x11')]);router[_0x98ff('0x12')](_0x98ff('0xc'),auth[_0x98ff('0xa')](),controller['destroy']);module[_0x98ff('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 f9cb48b..7fb4527 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 _0x7158=['STRING','DATE','literal','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','moment','exports'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x7158,0x6a));var _0x8715=function(_0x2e2681,_0x4089c1){_0x2e2681=_0x2e2681-0x0;var _0x368a64=_0x7158[_0x2e2681];return _0x368a64;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x8715('0x0'));module[_0x8715('0x1')]={'time':{'type':Sequelize[_0x8715('0x2')]},'callid':{'type':Sequelize[_0x8715('0x2')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0x8715('0x2')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0x8715('0x2')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0x8715('0x2')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0x8715('0x2')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0x8715('0x2')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0x8715('0x2')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0x8715('0x2')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0x8715('0x3')],'allowNull':![],'defaultValue':Sequelize[_0x8715('0x4')](_0x8715('0x5'))}}; \ No newline at end of file +var _0x5c5c=['literal','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','sequelize','moment','exports','STRING','DATE'];(function(_0x4561bc,_0xf4d8a){var _0x16b4f2=function(_0x478110){while(--_0x478110){_0x4561bc['push'](_0x4561bc['shift']());}};_0x16b4f2(++_0xf4d8a);}(_0x5c5c,0xfe));var _0xc5c5=function(_0x86cce6,_0xf459ca){_0x86cce6=_0x86cce6-0x0;var _0x170287=_0x5c5c[_0x86cce6];return _0x170287;};'use strict';var Sequelize=require(_0xc5c5('0x0'));var moment=require(_0xc5c5('0x1'));module[_0xc5c5('0x2')]={'time':{'type':Sequelize['STRING']},'callid':{'type':Sequelize[_0xc5c5('0x3')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0xc5c5('0x3')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0xc5c5('0x3')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0xc5c5('0x3')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0xc5c5('0x3')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0xc5c5('0x3')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0xc5c5('0x3')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0xc5c5('0x4')],'allowNull':![],'defaultValue':Sequelize[_0xc5c5('0x5')](_0xc5c5('0x6'))}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.controller.js b/server/api/voiceQueuesLog/voiceQueuesLog.controller.js index baaa67d..1bcf3be 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 _0x72c8=['pick','filter','where','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','keys','length','options','find','create','body','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','reject','update','then','destroy','name','send','index','VoiceQueuesLog','rawAttributes','fieldName','map','query','intersection','model','attributes','hasOwnProperty','sort','filters'];(function(_0x18bebd,_0x32f07a){var _0x42524b=function(_0x2db8d2){while(--_0x2db8d2){_0x18bebd['push'](_0x18bebd['shift']());}};_0x42524b(++_0x32f07a);}(_0x72c8,0x15c));var _0x872c=function(_0x3db7aa,_0x1c68ce){_0x3db7aa=_0x3db7aa-0x0;var _0x4ae53e=_0x72c8[_0x3db7aa];return _0x4ae53e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x872c('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x872c('0x1'));var rp=require(_0x872c('0x2'));var moment=require(_0x872c('0x3'));var BPromise=require(_0x872c('0x4'));var Mustache=require('mustache');var util=require(_0x872c('0x5'));var path=require(_0x872c('0x6'));var sox=require(_0x872c('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x872c('0x8'));var crypto=require(_0x872c('0x9'));var jsforce=require(_0x872c('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x872c('0xb'));var querystring=require(_0x872c('0xc'));var Papa=require(_0x872c('0xd'));var Redis=require(_0x872c('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x872c('0xf'));var logger=require(_0x872c('0x10'))(_0x872c('0x11'));var utils=require(_0x872c('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x872c('0x13'));var db=require(_0x872c('0x14'))['db'];function respondWithStatusCode(_0x47ab19,_0x40a1ab){_0x40a1ab=_0x40a1ab||0xcc;return function(_0x5b2d81){if(_0x5b2d81){return _0x47ab19[_0x872c('0x15')](_0x40a1ab);}return _0x47ab19['status'](_0x40a1ab)[_0x872c('0x16')]();};}function respondWithResult(_0x4229bb,_0x3e821a){_0x3e821a=_0x3e821a||0xc8;return function(_0x15cadd){if(_0x15cadd){return _0x4229bb[_0x872c('0x17')](_0x3e821a)[_0x872c('0x18')](_0x15cadd);}};}function respondWithFilteredResult(_0x5ede39,_0x13d8f6){return function(_0x1d261c){if(_0x1d261c){var _0x385911=typeof _0x13d8f6[_0x872c('0x19')]===_0x872c('0x1a')&&typeof _0x13d8f6[_0x872c('0x1b')]===_0x872c('0x1a');var _0xc4633a=_0x1d261c[_0x872c('0x1c')];var _0x3a9c8c=_0x385911?0x0:_0x13d8f6[_0x872c('0x19')];var _0x346e71=_0x385911?_0x1d261c[_0x872c('0x1c')]:_0x13d8f6[_0x872c('0x19')]+_0x13d8f6[_0x872c('0x1b')];var _0x41a03a;if(_0x346e71>=_0xc4633a){_0x346e71=_0xc4633a;_0x41a03a=0xc8;}else{_0x41a03a=0xce;}_0x5ede39[_0x872c('0x17')](_0x41a03a);return _0x5ede39[_0x872c('0x1d')]('Content-Range',_0x3a9c8c+'-'+_0x346e71+'/'+_0xc4633a)[_0x872c('0x18')](_0x1d261c);}return null;};}function patchUpdates(_0x1857ea){return function(_0x1719ed){try{jsonpatch['apply'](_0x1719ed,_0x1857ea,!![]);}catch(_0x2a3f4b){return BPromise[_0x872c('0x1e')](_0x2a3f4b);}return _0x1719ed['save']();};}function saveUpdates(_0x5bbf59,_0x3fdb82){return function(_0x4c3b67){if(_0x4c3b67){return _0x4c3b67[_0x872c('0x1f')](_0x5bbf59)[_0x872c('0x20')](function(_0x1df1cd){return _0x1df1cd;});}return null;};}function removeEntity(_0x3bba76,_0x48a827){return function(_0x3c3da2){if(_0x3c3da2){return _0x3c3da2[_0x872c('0x21')]()[_0x872c('0x20')](function(){_0x3bba76[_0x872c('0x17')](0xcc)[_0x872c('0x16')]();});}};}function handleEntityNotFound(_0x30e2cb,_0x42d971){return function(_0x3659b8){if(!_0x3659b8){_0x30e2cb[_0x872c('0x15')](0x194);}return _0x3659b8;};}function handleError(_0x285707,_0x46623a){_0x46623a=_0x46623a||0x1f4;return function(_0x5cbf95){logger['error'](_0x5cbf95['stack']);if(_0x5cbf95[_0x872c('0x22')]){delete _0x5cbf95[_0x872c('0x22')];}_0x285707['status'](_0x46623a)[_0x872c('0x23')](_0x5cbf95);};}exports[_0x872c('0x24')]=function(_0x1f9e45,_0x21a09c){var _0x23fe28={},_0x16ad92={},_0x4342dc={'count':0x0,'rows':[]};var _0x2ff30c=_['map'](db[_0x872c('0x25')][_0x872c('0x26')],function(_0xdfea5a){return{'name':_0xdfea5a[_0x872c('0x27')],'type':_0xdfea5a['type']['key']};});_0x16ad92['model']=_[_0x872c('0x28')](_0x2ff30c,_0x872c('0x22'));_0x16ad92[_0x872c('0x29')]=_['keys'](_0x1f9e45[_0x872c('0x29')]);_0x16ad92['filters']=_[_0x872c('0x2a')](_0x16ad92[_0x872c('0x2b')],_0x16ad92[_0x872c('0x29')]);_0x23fe28[_0x872c('0x2c')]=_[_0x872c('0x2a')](_0x16ad92[_0x872c('0x2b')],qs['fields'](_0x1f9e45['query']['fields']));_0x23fe28['attributes']=_0x23fe28['attributes']['length']?_0x23fe28[_0x872c('0x2c')]:_0x16ad92[_0x872c('0x2b')];if(!_0x1f9e45[_0x872c('0x29')][_0x872c('0x2d')]('nolimit')){_0x23fe28['limit']=qs[_0x872c('0x1b')](_0x1f9e45[_0x872c('0x29')]['limit']);_0x23fe28[_0x872c('0x19')]=qs[_0x872c('0x19')](_0x1f9e45['query'][_0x872c('0x19')]);}_0x23fe28['order']=qs[_0x872c('0x2e')](_0x1f9e45['query']['sort']);_0x23fe28['where']=qs[_0x872c('0x2f')](_[_0x872c('0x30')](_0x1f9e45[_0x872c('0x29')],_0x16ad92[_0x872c('0x2f')]),_0x2ff30c);if(_0x1f9e45[_0x872c('0x29')][_0x872c('0x31')]){_0x23fe28[_0x872c('0x32')]=_[_0x872c('0x33')](_0x23fe28[_0x872c('0x32')],{'$or':_[_0x872c('0x28')](_0x2ff30c,function(_0x399e80){if(_0x399e80['type']!==_0x872c('0x34')){var _0x28e1fd={};_0x28e1fd[_0x399e80[_0x872c('0x22')]]={'$like':'%'+_0x1f9e45[_0x872c('0x29')][_0x872c('0x31')]+'%'};return _0x28e1fd;}})});}_0x23fe28=_[_0x872c('0x33')]({},_0x23fe28,_0x1f9e45['options']);var _0x4a2ab4={'where':_0x23fe28[_0x872c('0x32')]};return db[_0x872c('0x25')][_0x872c('0x1c')](_0x4a2ab4)[_0x872c('0x20')](function(_0x1899be){_0x4342dc[_0x872c('0x1c')]=_0x1899be;if(_0x1f9e45[_0x872c('0x29')][_0x872c('0x35')]){_0x23fe28[_0x872c('0x36')]=[{'all':!![]}];}return db[_0x872c('0x25')][_0x872c('0x37')](_0x23fe28);})[_0x872c('0x20')](function(_0x39803b){_0x4342dc[_0x872c('0x38')]=_0x39803b;return _0x4342dc;})[_0x872c('0x20')](respondWithFilteredResult(_0x21a09c,_0x23fe28))[_0x872c('0x39')](handleError(_0x21a09c,null));};exports[_0x872c('0x3a')]=function(_0x5d2221,_0x5b0c7a){var _0x334d1a={'raw':!![],'where':{'id':_0x5d2221[_0x872c('0x3b')]['id']}},_0x290cfc={};_0x290cfc[_0x872c('0x2b')]=_['keys'](db[_0x872c('0x25')][_0x872c('0x26')]);_0x290cfc[_0x872c('0x29')]=_[_0x872c('0x3c')](_0x5d2221[_0x872c('0x29')]);_0x290cfc[_0x872c('0x2f')]=_[_0x872c('0x2a')](_0x290cfc['model'],_0x290cfc[_0x872c('0x29')]);_0x334d1a[_0x872c('0x2c')]=_[_0x872c('0x2a')](_0x290cfc[_0x872c('0x2b')],qs['fields'](_0x5d2221[_0x872c('0x29')]['fields']));_0x334d1a[_0x872c('0x2c')]=_0x334d1a[_0x872c('0x2c')][_0x872c('0x3d')]?_0x334d1a[_0x872c('0x2c')]:_0x290cfc[_0x872c('0x2b')];if(_0x5d2221[_0x872c('0x29')][_0x872c('0x35')]){_0x334d1a['include']=[{'all':!![]}];}_0x334d1a=_[_0x872c('0x33')]({},_0x334d1a,_0x5d2221[_0x872c('0x3e')]);return db['VoiceQueuesLog'][_0x872c('0x3f')](_0x334d1a)['then'](handleEntityNotFound(_0x5b0c7a,null))[_0x872c('0x20')](respondWithResult(_0x5b0c7a,null))[_0x872c('0x39')](handleError(_0x5b0c7a,null));};exports[_0x872c('0x40')]=function(_0x36df3c,_0x553d17){return db[_0x872c('0x25')][_0x872c('0x40')](_0x36df3c[_0x872c('0x41')],{})[_0x872c('0x20')](respondWithResult(_0x553d17,0xc9))[_0x872c('0x39')](handleError(_0x553d17,null));};exports[_0x872c('0x1f')]=function(_0x13c6a5,_0x37efdc){if(_0x13c6a5[_0x872c('0x41')]['id']){delete _0x13c6a5['body']['id'];}return db[_0x872c('0x25')][_0x872c('0x3f')]({'where':{'id':_0x13c6a5['params']['id']}})['then'](handleEntityNotFound(_0x37efdc,null))['then'](saveUpdates(_0x13c6a5[_0x872c('0x41')],null))[_0x872c('0x20')](respondWithResult(_0x37efdc,null))['catch'](handleError(_0x37efdc,null));};exports[_0x872c('0x21')]=function(_0x4abc4c,_0x21cdaa){return db['VoiceQueuesLog']['find']({'where':{'id':_0x4abc4c[_0x872c('0x3b')]['id']}})[_0x872c('0x20')](handleEntityNotFound(_0x21cdaa,null))[_0x872c('0x20')](removeEntity(_0x21cdaa,null))[_0x872c('0x39')](handleError(_0x21cdaa,null));}; \ No newline at end of file +var _0xcd60=['model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','rawAttributes','find','catch','create','body','destroy','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','save','update','then','stack','name','send','index','map','VoiceQueuesLog','type','key'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xcd60,0x66));var _0x0cd6=function(_0x18a325,_0x4de022){_0x18a325=_0x18a325-0x0;var _0x73dc63=_0xcd60[_0x18a325];return _0x73dc63;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0cd6('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0cd6('0x1'));var rp=require('request-promise');var moment=require(_0x0cd6('0x2'));var BPromise=require(_0x0cd6('0x3'));var Mustache=require(_0x0cd6('0x4'));var util=require(_0x0cd6('0x5'));var path=require(_0x0cd6('0x6'));var sox=require(_0x0cd6('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0cd6('0x8'));var _=require(_0x0cd6('0x9'));var squel=require(_0x0cd6('0xa'));var crypto=require(_0x0cd6('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x0cd6('0xc'));var toCsv=require(_0x0cd6('0xd'));var querystring=require(_0x0cd6('0xe'));var Papa=require(_0x0cd6('0xf'));var Redis=require(_0x0cd6('0x10'));var authService=require(_0x0cd6('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x0cd6('0x12'))(_0x0cd6('0x13'));var utils=require(_0x0cd6('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x0cd6('0x15'));var db=require(_0x0cd6('0x16'))['db'];function respondWithStatusCode(_0x56ff79,_0x2c48cb){_0x2c48cb=_0x2c48cb||0xcc;return function(_0x3d026e){if(_0x3d026e){return _0x56ff79[_0x0cd6('0x17')](_0x2c48cb);}return _0x56ff79[_0x0cd6('0x18')](_0x2c48cb)[_0x0cd6('0x19')]();};}function respondWithResult(_0x16f7b5,_0x19c399){_0x19c399=_0x19c399||0xc8;return function(_0x1826ea){if(_0x1826ea){return _0x16f7b5[_0x0cd6('0x18')](_0x19c399)[_0x0cd6('0x1a')](_0x1826ea);}};}function respondWithFilteredResult(_0x402cb2,_0x5e2650){return function(_0x4eda8d){if(_0x4eda8d){var _0x547e67=typeof _0x5e2650[_0x0cd6('0x1b')]===_0x0cd6('0x1c')&&typeof _0x5e2650[_0x0cd6('0x1d')]===_0x0cd6('0x1c');var _0x295629=_0x4eda8d[_0x0cd6('0x1e')];var _0x2949a6=_0x547e67?0x0:_0x5e2650['offset'];var _0x4c64e8=_0x547e67?_0x4eda8d[_0x0cd6('0x1e')]:_0x5e2650[_0x0cd6('0x1b')]+_0x5e2650[_0x0cd6('0x1d')];var _0x183d22;if(_0x4c64e8>=_0x295629){_0x4c64e8=_0x295629;_0x183d22=0xc8;}else{_0x183d22=0xce;}_0x402cb2[_0x0cd6('0x18')](_0x183d22);return _0x402cb2[_0x0cd6('0x1f')]('Content-Range',_0x2949a6+'-'+_0x4c64e8+'/'+_0x295629)[_0x0cd6('0x1a')](_0x4eda8d);}return null;};}function patchUpdates(_0x56a3c8){return function(_0xcbb9c8){try{jsonpatch[_0x0cd6('0x20')](_0xcbb9c8,_0x56a3c8,!![]);}catch(_0x3e0c47){return BPromise['reject'](_0x3e0c47);}return _0xcbb9c8[_0x0cd6('0x21')]();};}function saveUpdates(_0x59fea4,_0x250687){return function(_0x21e0e7){if(_0x21e0e7){return _0x21e0e7[_0x0cd6('0x22')](_0x59fea4)[_0x0cd6('0x23')](function(_0x8991de){return _0x8991de;});}return null;};}function removeEntity(_0x4513a0,_0x5dda36){return function(_0x123396){if(_0x123396){return _0x123396['destroy']()['then'](function(){_0x4513a0[_0x0cd6('0x18')](0xcc)[_0x0cd6('0x19')]();});}};}function handleEntityNotFound(_0x55db1c,_0x50f151){return function(_0xf2456c){if(!_0xf2456c){_0x55db1c[_0x0cd6('0x17')](0x194);}return _0xf2456c;};}function handleError(_0x39cdf7,_0x39bc3e){_0x39bc3e=_0x39bc3e||0x1f4;return function(_0xe051b7){logger['error'](_0xe051b7[_0x0cd6('0x24')]);if(_0xe051b7[_0x0cd6('0x25')]){delete _0xe051b7[_0x0cd6('0x25')];}_0x39cdf7[_0x0cd6('0x18')](_0x39bc3e)[_0x0cd6('0x26')](_0xe051b7);};}exports[_0x0cd6('0x27')]=function(_0xd5942a,_0xf368d8){var _0x8b7b93={},_0x42c199={},_0x4b3008={'count':0x0,'rows':[]};var _0x3d7f0b=_[_0x0cd6('0x28')](db[_0x0cd6('0x29')]['rawAttributes'],function(_0x4d4142){return{'name':_0x4d4142['fieldName'],'type':_0x4d4142[_0x0cd6('0x2a')][_0x0cd6('0x2b')]};});_0x42c199[_0x0cd6('0x2c')]=_[_0x0cd6('0x28')](_0x3d7f0b,_0x0cd6('0x25'));_0x42c199[_0x0cd6('0x2d')]=_[_0x0cd6('0x2e')](_0xd5942a[_0x0cd6('0x2d')]);_0x42c199[_0x0cd6('0x2f')]=_[_0x0cd6('0x30')](_0x42c199[_0x0cd6('0x2c')],_0x42c199[_0x0cd6('0x2d')]);_0x8b7b93['attributes']=_['intersection'](_0x42c199[_0x0cd6('0x2c')],qs['fields'](_0xd5942a[_0x0cd6('0x2d')][_0x0cd6('0x31')]));_0x8b7b93[_0x0cd6('0x32')]=_0x8b7b93[_0x0cd6('0x32')][_0x0cd6('0x33')]?_0x8b7b93['attributes']:_0x42c199[_0x0cd6('0x2c')];if(!_0xd5942a[_0x0cd6('0x2d')][_0x0cd6('0x34')]('nolimit')){_0x8b7b93[_0x0cd6('0x1d')]=qs[_0x0cd6('0x1d')](_0xd5942a[_0x0cd6('0x2d')][_0x0cd6('0x1d')]);_0x8b7b93[_0x0cd6('0x1b')]=qs[_0x0cd6('0x1b')](_0xd5942a[_0x0cd6('0x2d')]['offset']);}_0x8b7b93[_0x0cd6('0x35')]=qs[_0x0cd6('0x36')](_0xd5942a[_0x0cd6('0x2d')][_0x0cd6('0x36')]);_0x8b7b93[_0x0cd6('0x37')]=qs[_0x0cd6('0x2f')](_[_0x0cd6('0x38')](_0xd5942a['query'],_0x42c199['filters']),_0x3d7f0b);if(_0xd5942a[_0x0cd6('0x2d')][_0x0cd6('0x39')]){_0x8b7b93[_0x0cd6('0x37')]=_[_0x0cd6('0x3a')](_0x8b7b93['where'],{'$or':_[_0x0cd6('0x28')](_0x3d7f0b,function(_0xeb4957){if(_0xeb4957[_0x0cd6('0x2a')]!==_0x0cd6('0x3b')){var _0x50ae35={};_0x50ae35[_0xeb4957[_0x0cd6('0x25')]]={'$like':'%'+_0xd5942a[_0x0cd6('0x2d')][_0x0cd6('0x39')]+'%'};return _0x50ae35;}})});}_0x8b7b93=_[_0x0cd6('0x3a')]({},_0x8b7b93,_0xd5942a[_0x0cd6('0x3c')]);var _0x35233a={'where':_0x8b7b93[_0x0cd6('0x37')]};return db[_0x0cd6('0x29')][_0x0cd6('0x1e')](_0x35233a)['then'](function(_0x555859){_0x4b3008[_0x0cd6('0x1e')]=_0x555859;if(_0xd5942a['query'][_0x0cd6('0x3d')]){_0x8b7b93[_0x0cd6('0x3e')]=[{'all':!![]}];}return db['VoiceQueuesLog'][_0x0cd6('0x3f')](_0x8b7b93);})[_0x0cd6('0x23')](function(_0x3fa226){_0x4b3008[_0x0cd6('0x40')]=_0x3fa226;return _0x4b3008;})[_0x0cd6('0x23')](respondWithFilteredResult(_0xf368d8,_0x8b7b93))['catch'](handleError(_0xf368d8,null));};exports[_0x0cd6('0x41')]=function(_0x24a17e,_0x59c52f){var _0x70250b={'raw':!![],'where':{'id':_0x24a17e[_0x0cd6('0x42')]['id']}},_0x4fcefe={};_0x4fcefe['model']=_[_0x0cd6('0x2e')](db[_0x0cd6('0x29')][_0x0cd6('0x43')]);_0x4fcefe[_0x0cd6('0x2d')]=_[_0x0cd6('0x2e')](_0x24a17e[_0x0cd6('0x2d')]);_0x4fcefe[_0x0cd6('0x2f')]=_[_0x0cd6('0x30')](_0x4fcefe[_0x0cd6('0x2c')],_0x4fcefe['query']);_0x70250b[_0x0cd6('0x32')]=_['intersection'](_0x4fcefe[_0x0cd6('0x2c')],qs[_0x0cd6('0x31')](_0x24a17e['query'][_0x0cd6('0x31')]));_0x70250b[_0x0cd6('0x32')]=_0x70250b['attributes'][_0x0cd6('0x33')]?_0x70250b[_0x0cd6('0x32')]:_0x4fcefe[_0x0cd6('0x2c')];if(_0x24a17e['query']['includeAll']){_0x70250b[_0x0cd6('0x3e')]=[{'all':!![]}];}_0x70250b=_[_0x0cd6('0x3a')]({},_0x70250b,_0x24a17e[_0x0cd6('0x3c')]);return db['VoiceQueuesLog'][_0x0cd6('0x44')](_0x70250b)['then'](handleEntityNotFound(_0x59c52f,null))[_0x0cd6('0x23')](respondWithResult(_0x59c52f,null))[_0x0cd6('0x45')](handleError(_0x59c52f,null));};exports['create']=function(_0xdc81da,_0x54ef0b){return db[_0x0cd6('0x29')][_0x0cd6('0x46')](_0xdc81da['body'],{})[_0x0cd6('0x23')](respondWithResult(_0x54ef0b,0xc9))[_0x0cd6('0x45')](handleError(_0x54ef0b,null));};exports[_0x0cd6('0x22')]=function(_0xc55f22,_0x2f8564){if(_0xc55f22[_0x0cd6('0x47')]['id']){delete _0xc55f22['body']['id'];}return db[_0x0cd6('0x29')]['find']({'where':{'id':_0xc55f22['params']['id']}})[_0x0cd6('0x23')](handleEntityNotFound(_0x2f8564,null))[_0x0cd6('0x23')](saveUpdates(_0xc55f22[_0x0cd6('0x47')],null))['then'](respondWithResult(_0x2f8564,null))[_0x0cd6('0x45')](handleError(_0x2f8564,null));};exports[_0x0cd6('0x48')]=function(_0xc8eb96,_0x3687e9){return db[_0x0cd6('0x29')][_0x0cd6('0x44')]({'where':{'id':_0xc8eb96[_0x0cd6('0x42')]['id']}})[_0x0cd6('0x23')](handleEntityNotFound(_0x3687e9,null))[_0x0cd6('0x23')](removeEntity(_0x3687e9,null))[_0x0cd6('0x45')](handleError(_0x3687e9,null));}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.model.js b/server/api/voiceQueuesLog/voiceQueuesLog.model.js index dd8ffe3..ff30833 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 _0x73bd=['voice_queues_log','event_dtm','event','lodash','../../config/logger','api','moment','bluebird','path','rimraf','./voiceQueuesLog.attributes','define','VoiceQueuesLog'];(function(_0x1a1b9d,_0x570841){var _0x1bfb73=function(_0x3f2ba1){while(--_0x3f2ba1){_0x1a1b9d['push'](_0x1a1b9d['shift']());}};_0x1bfb73(++_0x570841);}(_0x73bd,0x6b));var _0xd73b=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x73bd[_0x4565bf];return _0x5610ba;};'use strict';var _=require(_0xd73b('0x0'));var util=require('util');var logger=require(_0xd73b('0x1'))(_0xd73b('0x2'));var moment=require(_0xd73b('0x3'));var BPromise=require(_0xd73b('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd73b('0x5'));var rimraf=require(_0xd73b('0x6'));var config=require('../../config/environment');var attributes=require(_0xd73b('0x7'));module['exports']=function(_0x58a62a,_0x2282bf){return _0x58a62a[_0xd73b('0x8')](_0xd73b('0x9'),attributes,{'tableName':_0xd73b('0xa'),'paranoid':![],'indexes':[{'name':_0xd73b('0xb'),'fields':[_0xd73b('0xc'),'dtm']}],'timestamps':![]});}; \ No newline at end of file +var _0x4322=['lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','VoiceQueuesLog','voice_queues_log','event_dtm','event'];(function(_0x46800d,_0x588500){var _0x3824cd=function(_0x14b132){while(--_0x14b132){_0x46800d['push'](_0x46800d['shift']());}};_0x3824cd(++_0x588500);}(_0x4322,0x174));var _0x2432=function(_0x1b3155,_0x1d2066){_0x1b3155=_0x1b3155-0x0;var _0x2b0a83=_0x4322[_0x1b3155];return _0x2b0a83;};'use strict';var _=require(_0x2432('0x0'));var util=require('util');var logger=require(_0x2432('0x1'))(_0x2432('0x2'));var moment=require(_0x2432('0x3'));var BPromise=require(_0x2432('0x4'));var rp=require(_0x2432('0x5'));var fs=require('fs');var path=require(_0x2432('0x6'));var rimraf=require(_0x2432('0x7'));var config=require('../../config/environment');var attributes=require('./voiceQueuesLog.attributes');module['exports']=function(_0x689fbb,_0x11d670){return _0x689fbb['define'](_0x2432('0x8'),attributes,{'tableName':_0x2432('0x9'),'paranoid':![],'indexes':[{'name':_0x2432('0xa'),'fields':[_0x2432('0xb'),'dtm']}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js b/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js index 5a73af0..84b686d 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 _0x61be=['request\x20sent','debug','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','VoiceQueuesLog,\x20%s,\x20%s'];(function(_0x2235bf,_0x3a06a7){var _0x4c3a64=function(_0x3b3bb6){while(--_0x3b3bb6){_0x2235bf['push'](_0x2235bf['shift']());}};_0x4c3a64(++_0x3a06a7);}(_0x61be,0x1d7));var _0xe61b=function(_0xf9cc12,_0x8a5a90){_0xf9cc12=_0xf9cc12-0x0;var _0x1827fa=_0x61be[_0xf9cc12];return _0x1827fa;};'use strict';var _=require(_0xe61b('0x0'));var util=require(_0xe61b('0x1'));var moment=require(_0xe61b('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe61b('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xe61b('0x4'))(_0xe61b('0x5'));var config=require(_0xe61b('0x6'));var jayson=require(_0xe61b('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2b5d6b,_0x4e89af,_0x3bc8e5){return new BPromise(function(_0x4d48fd,_0x4e62a9){return client[_0xe61b('0x8')](_0x2b5d6b,_0x3bc8e5)[_0xe61b('0x9')](function(_0x23b7c1){logger[_0xe61b('0xa')](_0xe61b('0xb'),_0x4e89af,_0xe61b('0xc'));logger[_0xe61b('0xd')](_0xe61b('0xe'),_0x4e89af,'request\x20sent',JSON[_0xe61b('0xf')](_0x23b7c1));if(_0x23b7c1[_0xe61b('0x10')]){if(_0x23b7c1[_0xe61b('0x10')][_0xe61b('0x11')]===0x1f4){logger[_0xe61b('0x10')](_0xe61b('0xb'),_0x4e89af,_0x23b7c1[_0xe61b('0x10')]['message']);return _0x4e62a9(_0x23b7c1['error'][_0xe61b('0x12')]);}logger[_0xe61b('0x10')](_0xe61b('0xb'),_0x4e89af,_0x23b7c1['error'][_0xe61b('0x12')]);return _0x4d48fd(_0x23b7c1[_0xe61b('0x10')][_0xe61b('0x12')]);}else{logger[_0xe61b('0xa')]('VoiceQueuesLog,\x20%s,\x20%s',_0x4e89af,_0xe61b('0xc'));_0x4d48fd(_0x23b7c1[_0xe61b('0x13')][_0xe61b('0x12')]);}})[_0xe61b('0x14')](function(_0x3123de){logger[_0xe61b('0x10')]('VoiceQueuesLog,\x20%s,\x20%s',_0x4e89af,_0x3123de);_0x4e62a9(_0x3123de);});});} \ No newline at end of file +var _0xca1d=['code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','info','VoiceQueuesLog,\x20%s,\x20%s','request\x20sent','debug','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x5f09c5,_0x2bfca0){var _0x426ad9=function(_0x18fe5f){while(--_0x18fe5f){_0x5f09c5['push'](_0x5f09c5['shift']());}};_0x426ad9(++_0x2bfca0);}(_0xca1d,0x1e6));var _0xdca1=function(_0x4245c1,_0x2aef74){_0x4245c1=_0x4245c1-0x0;var _0x43badb=_0xca1d[_0x4245c1];return _0x43badb;};'use strict';var _=require(_0xdca1('0x0'));var util=require(_0xdca1('0x1'));var moment=require(_0xdca1('0x2'));var BPromise=require(_0xdca1('0x3'));var rs=require(_0xdca1('0x4'));var fs=require('fs');var Redis=require(_0xdca1('0x5'));var db=require(_0xdca1('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xdca1('0x7'))(_0xdca1('0x8'));var config=require('../../config/environment');var jayson=require(_0xdca1('0x9'));var client=jayson[_0xdca1('0xa')][_0xdca1('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4de495,_0x290b14,_0x124ced){return new BPromise(function(_0x43f029,_0x1837b1){return client[_0xdca1('0xc')](_0x4de495,_0x124ced)['then'](function(_0x319e07){logger[_0xdca1('0xd')](_0xdca1('0xe'),_0x290b14,_0xdca1('0xf'));logger[_0xdca1('0x10')](_0xdca1('0x11'),_0x290b14,'request\x20sent',JSON[_0xdca1('0x12')](_0x319e07));if(_0x319e07[_0xdca1('0x13')]){if(_0x319e07['error'][_0xdca1('0x14')]===0x1f4){logger[_0xdca1('0x13')](_0xdca1('0xe'),_0x290b14,_0x319e07[_0xdca1('0x13')][_0xdca1('0x15')]);return _0x1837b1(_0x319e07[_0xdca1('0x13')]['message']);}logger[_0xdca1('0x13')]('VoiceQueuesLog,\x20%s,\x20%s',_0x290b14,_0x319e07[_0xdca1('0x13')][_0xdca1('0x15')]);return _0x43f029(_0x319e07[_0xdca1('0x13')][_0xdca1('0x15')]);}else{logger[_0xdca1('0xd')](_0xdca1('0xe'),_0x290b14,_0xdca1('0xf'));_0x43f029(_0x319e07['result']['message']);}})[_0xdca1('0x16')](function(_0x2f1a03){logger[_0xdca1('0x13')](_0xdca1('0xe'),_0x290b14,_0x2f1a03);_0x1837b1(_0x2f1a03);});});} \ No newline at end of file diff --git a/server/api/voiceRecording/index.js b/server/api/voiceRecording/index.js index 1c40e34..653ef90 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 _0xe92a=['../../components/interaction/service','../../config/environment','./voiceRecording.controller','get','isAuthenticated','index','/:id','/:id/download','download','/:id/downloads','downloads','/:id/transcribe','post','create','runTranscribe','put','update','delete','destroy','exports','multer','util','path','express','fs-extra','../../components/auth/service'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe92a,0xe4));var _0xae92=function(_0x57857f,_0x40f726){_0x57857f=_0x57857f-0x0;var _0x9b6a44=_0xe92a[_0x57857f];return _0x9b6a44;};'use strict';var multer=require(_0xae92('0x0'));var util=require(_0xae92('0x1'));var path=require(_0xae92('0x2'));var timeout=require('connect-timeout');var express=require(_0xae92('0x3'));var router=express['Router']();var fs_extra=require(_0xae92('0x4'));var auth=require(_0xae92('0x5'));var interaction=require(_0xae92('0x6'));var config=require(_0xae92('0x7'));var controller=require(_0xae92('0x8'));router[_0xae92('0x9')]('/',auth[_0xae92('0xa')](),controller[_0xae92('0xb')]);router[_0xae92('0x9')]('/describe',auth[_0xae92('0xa')](),controller['describe']);router[_0xae92('0x9')](_0xae92('0xc'),auth[_0xae92('0xa')](),controller['show']);router[_0xae92('0x9')](_0xae92('0xd'),auth[_0xae92('0xa')](),controller[_0xae92('0xe')]);router['get'](_0xae92('0xf'),controller[_0xae92('0x10')]);router['get'](_0xae92('0x11'),auth[_0xae92('0xa')](),controller['downloadTranscribe']);router[_0xae92('0x12')]('/',auth[_0xae92('0xa')](),controller[_0xae92('0x13')]);router['post'](_0xae92('0x11'),auth[_0xae92('0xa')](),controller[_0xae92('0x14')]);router[_0xae92('0x15')](_0xae92('0xc'),auth[_0xae92('0xa')](),controller[_0xae92('0x16')]);router[_0xae92('0x17')](_0xae92('0xc'),auth[_0xae92('0xa')](),controller[_0xae92('0x18')]);module[_0xae92('0x19')]=router; \ No newline at end of file +var _0x059c=['delete','destroy','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceRecording.controller','get','isAuthenticated','index','/describe','/:id','show','/:id/downloads','/:id/transcribe','post','create','runTranscribe','put','update'];(function(_0xd47466,_0x459545){var _0x4244fd=function(_0x1df91a){while(--_0x1df91a){_0xd47466['push'](_0xd47466['shift']());}};_0x4244fd(++_0x459545);}(_0x059c,0xd1));var _0xc059=function(_0x15fe68,_0xddc145){_0x15fe68=_0x15fe68-0x0;var _0x1d144c=_0x059c[_0x15fe68];return _0x1d144c;};'use strict';var multer=require('multer');var util=require(_0xc059('0x0'));var path=require('path');var timeout=require(_0xc059('0x1'));var express=require(_0xc059('0x2'));var router=express[_0xc059('0x3')]();var fs_extra=require(_0xc059('0x4'));var auth=require(_0xc059('0x5'));var interaction=require(_0xc059('0x6'));var config=require('../../config/environment');var controller=require(_0xc059('0x7'));router[_0xc059('0x8')]('/',auth[_0xc059('0x9')](),controller[_0xc059('0xa')]);router['get'](_0xc059('0xb'),auth[_0xc059('0x9')](),controller['describe']);router[_0xc059('0x8')](_0xc059('0xc'),auth[_0xc059('0x9')](),controller[_0xc059('0xd')]);router[_0xc059('0x8')]('/:id/download',auth['isAuthenticated'](),controller['download']);router['get'](_0xc059('0xe'),controller['downloads']);router['get'](_0xc059('0xf'),auth[_0xc059('0x9')](),controller['downloadTranscribe']);router[_0xc059('0x10')]('/',auth[_0xc059('0x9')](),controller[_0xc059('0x11')]);router[_0xc059('0x10')]('/:id/transcribe',auth[_0xc059('0x9')](),controller[_0xc059('0x12')]);router[_0xc059('0x13')](_0xc059('0xc'),auth[_0xc059('0x9')](),controller[_0xc059('0x14')]);router[_0xc059('0x15')](_0xc059('0xc'),auth[_0xc059('0x9')](),controller[_0xc059('0x16')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.attributes.js b/server/api/voiceRecording/voiceRecording.attributes.js index ea79a05..f25d78c 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(_0x341e0f,_0x4a09d0){var _0x59555a=function(_0x4343a8){while(--_0x4343a8){_0x341e0f['push'](_0x341e0f['shift']());}};_0x59555a(++_0x4a09d0);}(_0xa9e0,0x123));var _0x0a9e=function(_0x21aec3,_0x5c97e9){_0x21aec3=_0x21aec3-0x0;var _0x288bbc=_0xa9e0[_0x21aec3];return _0x288bbc;};'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(_0x9cd4c3,_0x1c9b2c){var _0x4c9025=function(_0x25b3c6){while(--_0x25b3c6){_0x9cd4c3['push'](_0x9cd4c3['shift']());}};_0x4c9025(++_0x1c9b2c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2b10c6,_0x185590){_0x2b10c6=_0x2b10c6-0x0;var _0x3789d2=_0xa9e0[_0x2b10c6];return _0x3789d2;};'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 9311334..0826adf 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 _0xdcad=['updateAttributes','writeFile','downloadTranscribe','fileText','root','/server/files/transcribes/transcribe_','.txt','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','desk.js','querystring','aws-sdk','uuid/v4','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','offset','undefined','limit','count','set','json','apply','save','update','destroy','then','end','error','stack','name','send','index','map','VoiceRecording','rawAttributes','fieldName','type','key','model','differenceBy','query','intersection','fields','attributes','length','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','findAll','rows','catch','params','keys','includeAll','include','find','create','body','describe','download','../../components/encryptor','uniqueid','value','format','%s.cypher','existsSync','decryptFile','secrets','Sequelize','ValidationError','filename','extname','unlink','message','VoiceRecording\x20not\x20found','downloads','sequelize','token','push','$and','recording','Entity\x20not\x20found','info','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','isNil','listBuckets','createBucket','upload','TranscribeService','startTranscriptionJob','readFileSync','[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)','Location','bucket','Bucket','[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','TranscriptionJob','TranscriptionJobName','transcribeStatus','TranscriptionJobStatus','runTranscribe','findOne','Voice\x20Recording\x20not\x20found','Setting','transcribe','transcribeRegion','Transcribe\x20not\x20configured','runSentiment','sentiment','sentimentRegion','language','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','Cloud\x20Provider\x20not\x20available','data2','Buckets','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','data1','NEW','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','IN_PROGRESS','tempSentiment'];(function(_0x39f794,_0x212dc5){var _0x180134=function(_0x1b6401){while(--_0x1b6401){_0x39f794['push'](_0x39f794['shift']());}};_0x180134(++_0x212dc5);}(_0xdcad,0x135));var _0xddca=function(_0x5cfe40,_0x2cb9d8){_0x5cfe40=_0x5cfe40-0x0;var _0x3d9b46=_0xdcad[_0x5cfe40];return _0x3d9b46;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xddca('0x0'));var zipdir=require(_0xddca('0x1'));var jsonpatch=require(_0xddca('0x2'));var rp=require(_0xddca('0x3'));var moment=require(_0xddca('0x4'));var BPromise=require(_0xddca('0x5'));var Mustache=require(_0xddca('0x6'));var util=require(_0xddca('0x7'));var path=require(_0xddca('0x8'));var sox=require(_0xddca('0x9'));var csv=require(_0xddca('0xa'));var ejs=require(_0xddca('0xb'));var fs=require('fs');var fs_extra=require(_0xddca('0xc'));var _=require('lodash');var squel=require(_0xddca('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xddca('0xe'));var toCsv=require('to-csv');var querystring=require(_0xddca('0xf'));var Papa=require('papaparse');var AWS=require(_0xddca('0x10'));var uuidv4=require(_0xddca('0x11'));var Redis=require(_0xddca('0x12'));var authService=require(_0xddca('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xddca('0x14'));var hardwareService=require(_0xddca('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0xddca('0x16'));var config=require(_0xddca('0x17'));var licenseUtil=require(_0xddca('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4101af,_0x47eb91){_0x47eb91=_0x47eb91||0xcc;return function(_0x47a340){if(_0x47a340){return _0x4101af[_0xddca('0x19')](_0x47eb91);}return _0x4101af['status'](_0x47eb91)['end']();};}function respondWithResult(_0x51ae85,_0x4ce631){_0x4ce631=_0x4ce631||0xc8;return function(_0x3f185a){if(_0x3f185a){return _0x51ae85[_0xddca('0x1a')](_0x4ce631)['json'](_0x3f185a);}};}function respondWithFilteredResult(_0x17d467,_0x4f1945){return function(_0x3f5b68){if(_0x3f5b68){var _0x2ad10f=typeof _0x4f1945[_0xddca('0x1b')]===_0xddca('0x1c')&&typeof _0x4f1945[_0xddca('0x1d')]===_0xddca('0x1c');var _0x270f5f=_0x3f5b68[_0xddca('0x1e')];var _0x4ec26e=_0x2ad10f?0x0:_0x4f1945[_0xddca('0x1b')];var _0x3b89da=_0x2ad10f?_0x3f5b68[_0xddca('0x1e')]:_0x4f1945[_0xddca('0x1b')]+_0x4f1945['limit'];var _0x1c75f0;if(_0x3b89da>=_0x270f5f){_0x3b89da=_0x270f5f;_0x1c75f0=0xc8;}else{_0x1c75f0=0xce;}_0x17d467['status'](_0x1c75f0);return _0x17d467[_0xddca('0x1f')]('Content-Range',_0x4ec26e+'-'+_0x3b89da+'/'+_0x270f5f)[_0xddca('0x20')](_0x3f5b68);}return null;};}function patchUpdates(_0x51eee7){return function(_0x15cd50){try{jsonpatch[_0xddca('0x21')](_0x15cd50,_0x51eee7,!![]);}catch(_0x124b02){return BPromise['reject'](_0x124b02);}return _0x15cd50[_0xddca('0x22')]();};}function saveUpdates(_0xab6827,_0x1727e8){return function(_0xdc07d){if(_0xdc07d){return _0xdc07d[_0xddca('0x23')](_0xab6827)['then'](function(_0x350bd0){return _0x350bd0;});}return null;};}function removeEntity(_0x1483d6,_0x5f1041){return function(_0x37a755){if(_0x37a755){return _0x37a755[_0xddca('0x24')]()[_0xddca('0x25')](function(){_0x1483d6['status'](0xcc)[_0xddca('0x26')]();});}};}function handleEntityNotFound(_0x250fac,_0x227c45){return function(_0x4e5afc){if(!_0x4e5afc){_0x250fac[_0xddca('0x19')](0x194);}return _0x4e5afc;};}function handleError(_0x1db3c9,_0x2ebb38){_0x2ebb38=_0x2ebb38||0x1f4;return function(_0x423478){logger[_0xddca('0x27')](_0x423478[_0xddca('0x28')]);if(_0x423478['name']){delete _0x423478[_0xddca('0x29')];}_0x1db3c9[_0xddca('0x1a')](_0x2ebb38)[_0xddca('0x2a')](_0x423478);};}exports[_0xddca('0x2b')]=function(_0x5e08ff,_0x25f664){var _0x36a237={},_0x30520f={},_0x469fa8={'count':0x0,'rows':[]};var _0x3f554b=_[_0xddca('0x2c')](db[_0xddca('0x2d')][_0xddca('0x2e')],function(_0x2b06c7){return{'name':_0x2b06c7[_0xddca('0x2f')],'type':_0x2b06c7[_0xddca('0x30')][_0xddca('0x31')]};});_0x30520f[_0xddca('0x32')]=_[_0xddca('0x33')](_[_0xddca('0x2c')](_0x3f554b,_0xddca('0x29')),['format']);_0x30520f[_0xddca('0x34')]=_['keys'](_0x5e08ff[_0xddca('0x34')]);_0x30520f['filters']=_['intersection'](_0x30520f[_0xddca('0x32')],_0x30520f[_0xddca('0x34')]);_0x36a237['attributes']=_[_0xddca('0x35')](_0x30520f[_0xddca('0x32')],qs[_0xddca('0x36')](_0x5e08ff['query'][_0xddca('0x36')]));_0x36a237[_0xddca('0x37')]=_0x36a237['attributes'][_0xddca('0x38')]?_0x36a237[_0xddca('0x37')]:_0x30520f[_0xddca('0x32')];if(!_0x5e08ff[_0xddca('0x34')]['hasOwnProperty'](_0xddca('0x39'))){_0x36a237[_0xddca('0x1d')]=qs[_0xddca('0x1d')](_0x5e08ff[_0xddca('0x34')]['limit']);_0x36a237[_0xddca('0x1b')]=qs[_0xddca('0x1b')](_0x5e08ff[_0xddca('0x34')][_0xddca('0x1b')]);}_0x36a237[_0xddca('0x3a')]=qs[_0xddca('0x3b')](_0x5e08ff['query'][_0xddca('0x3b')]);_0x36a237[_0xddca('0x3c')]=qs[_0xddca('0x3d')](_[_0xddca('0x3e')](_0x5e08ff[_0xddca('0x34')],_0x30520f[_0xddca('0x3d')]),_0x3f554b);if(_0x5e08ff[_0xddca('0x34')][_0xddca('0x3f')]){_0x36a237['where']=_[_0xddca('0x40')](_0x36a237[_0xddca('0x3c')],{'$or':_[_0xddca('0x2c')](_0x3f554b,function(_0x12e0a9){if(_0x12e0a9[_0xddca('0x30')]!==_0xddca('0x41')){var _0x4384d6={};_0x4384d6[_0x12e0a9[_0xddca('0x29')]]={'$like':'%'+_0x5e08ff[_0xddca('0x34')][_0xddca('0x3f')]+'%'};return _0x4384d6;}})});}_0x36a237=_[_0xddca('0x40')]({},_0x36a237,_0x5e08ff['options']);var _0x24bdef={'where':_0x36a237[_0xddca('0x3c')]};return db[_0xddca('0x2d')]['count'](_0x24bdef)[_0xddca('0x25')](function(_0x4ba31e){_0x469fa8[_0xddca('0x1e')]=_0x4ba31e;if(_0x5e08ff[_0xddca('0x34')]['includeAll']){_0x36a237['include']=[{'all':!![]}];}return db['VoiceRecording'][_0xddca('0x42')](_0x36a237);})[_0xddca('0x25')](function(_0x2b2709){_0x469fa8[_0xddca('0x43')]=_0x2b2709;return _0x469fa8;})[_0xddca('0x25')](respondWithFilteredResult(_0x25f664,_0x36a237))[_0xddca('0x44')](handleError(_0x25f664,null));};exports['show']=function(_0x26acb3,_0x466304){var _0x26ae22={'raw':![],'where':{'id':_0x26acb3[_0xddca('0x45')]['id']}},_0x587adb={};_0x587adb['model']=_[_0xddca('0x46')](db[_0xddca('0x2d')][_0xddca('0x2e')]);_0x587adb['query']=_[_0xddca('0x46')](_0x26acb3[_0xddca('0x34')]);_0x587adb[_0xddca('0x3d')]=_[_0xddca('0x35')](_0x587adb['model'],_0x587adb['query']);_0x26ae22['attributes']=_['intersection'](_0x587adb[_0xddca('0x32')],qs[_0xddca('0x36')](_0x26acb3[_0xddca('0x34')][_0xddca('0x36')]));_0x26ae22[_0xddca('0x37')]=_0x26ae22['attributes'][_0xddca('0x38')]?_0x26ae22[_0xddca('0x37')]:_0x587adb['model'];if(_0x26acb3['query'][_0xddca('0x47')]){_0x26ae22[_0xddca('0x48')]=[{'all':!![]}];}_0x26ae22=_[_0xddca('0x40')]({},_0x26ae22,_0x26acb3['options']);return db[_0xddca('0x2d')][_0xddca('0x49')](_0x26ae22)[_0xddca('0x25')](handleEntityNotFound(_0x466304,null))[_0xddca('0x25')](respondWithResult(_0x466304,null))[_0xddca('0x44')](handleError(_0x466304,null));};exports['create']=function(_0x28e851,_0x2b2c03){return db['VoiceRecording'][_0xddca('0x4a')](_0x28e851[_0xddca('0x4b')],{})['then'](respondWithResult(_0x2b2c03,0xc9))[_0xddca('0x44')](handleError(_0x2b2c03,null));};exports[_0xddca('0x23')]=function(_0x3b391c,_0x4792c2){if(_0x3b391c['body']['id']){delete _0x3b391c[_0xddca('0x4b')]['id'];}return db[_0xddca('0x2d')]['find']({'where':{'id':_0x3b391c[_0xddca('0x45')]['id']}})[_0xddca('0x25')](handleEntityNotFound(_0x4792c2,null))[_0xddca('0x25')](saveUpdates(_0x3b391c[_0xddca('0x4b')],null))[_0xddca('0x25')](respondWithResult(_0x4792c2,null))['catch'](handleError(_0x4792c2,null));};exports['describe']=function(_0x84255a,_0x53bcfe){return db[_0xddca('0x2d')][_0xddca('0x4c')]()[_0xddca('0x25')](respondWithResult(_0x53bcfe,null))['catch'](handleError(_0x53bcfe,null));};exports[_0xddca('0x4d')]=function(_0x19661c,_0x3fb4e0,_0x2533e9){var _0x9db42a=require(_0xddca('0x4e'));var _0x163858=![];var _0x249d9f={};if(_0x19661c[_0xddca('0x34')][_0xddca('0x30')]&&_0x19661c[_0xddca('0x34')]['type']==='uniqueid'){_0x249d9f[_0xddca('0x4f')]=_0x19661c['params']['id'];}else{_0x249d9f['id']=_0x19661c['params']['id'];}return db[_0xddca('0x2d')][_0xddca('0x49')]({'where':_0x249d9f,'attributes':['id',_0xddca('0x50')],'raw':!![]})[_0xddca('0x25')](handleEntityNotFound(_0x3fb4e0,null))['then'](function(_0x5d5d19){if(_0x5d5d19){var _0x4d5c5a=_0x5d5d19['value'];var _0x2bb2ea=util[_0xddca('0x51')](_0xddca('0x52'),_0x4d5c5a);if(fs[_0xddca('0x53')](_0x2bb2ea)){_0x163858=!![];return _0x9db42a[_0xddca('0x54')](_0x2bb2ea,_0x4d5c5a,config[_0xddca('0x55')]['recording'])[_0xddca('0x25')](function(){return _0x5d5d19;});}return _0x5d5d19;}})[_0xddca('0x25')](function(_0x4e6b0b){if(_0x4e6b0b){var _0x1cc9f1=_0x4e6b0b[_0xddca('0x50')];if(!fs['existsSync'](_0x1cc9f1)){throw new db[(_0xddca('0x56'))][(_0xddca('0x57'))]('VoiceRecording\x20not\x20found');}if(_0x4e6b0b[_0xddca('0x58')]){return _0x3fb4e0[_0xddca('0x4d')](_0x1cc9f1,_0x4e6b0b[_0xddca('0x58')]+path[_0xddca('0x59')](_0x1cc9f1),function(){if(_0x163858){fs['unlink'](_0x1cc9f1);}});}else{return _0x3fb4e0[_0xddca('0x4d')](_0x1cc9f1,function(_0x23c326){if(_0x163858){fs[_0xddca('0x5a')](_0x1cc9f1);}});}}})[_0xddca('0x44')](function(_0x42e0d2){if(_0x42e0d2[_0xddca('0x5b')]===_0xddca('0x5c')){_0x3fb4e0[_0xddca('0x1a')](0x194)[_0xddca('0x2a')]('Not\x20found');}else{return handleError(_0x3fb4e0,null);}});};exports[_0xddca('0x5d')]=function(_0x3ac722,_0x480099,_0xb7317a){var _0x593657=require(_0xddca('0x4e'));var _0x1dc51a=![];var _0x15276b={'$and':[db[_0xddca('0x5e')][_0xddca('0x3c')](db[_0xddca('0x5e')]['fn']('MD5',db['sequelize']['col'](_0xddca('0x4f'))),_0x3ac722['query'][_0xddca('0x5f')])]};if(_0x3ac722[_0xddca('0x34')]['type']&&_0x3ac722['query'][_0xddca('0x30')]===_0xddca('0x4f')){_0x15276b['$and'][_0xddca('0x60')]({'uniqueid':_0x3ac722[_0xddca('0x45')]['id']});}else{_0x15276b[_0xddca('0x61')][_0xddca('0x60')]({'id':_0x3ac722[_0xddca('0x45')]['id']});}return db[_0xddca('0x2d')][_0xddca('0x49')]({'where':_0x15276b,'attributes':['id',_0xddca('0x50')],'raw':!![]})[_0xddca('0x25')](handleEntityNotFound(_0x480099,null))['then'](function(_0x91317){if(_0x91317){var _0x4b3822=util[_0xddca('0x51')](_0xddca('0x52'),_0x91317[_0xddca('0x50')]);if(fs[_0xddca('0x53')](_0x4b3822)){_0x1dc51a=!![];return _0x593657[_0xddca('0x54')](_0x4b3822,_0x91317[_0xddca('0x50')],config[_0xddca('0x55')][_0xddca('0x62')])[_0xddca('0x25')](function(){return _0x91317;});}return _0x91317;}})['then'](function(_0x2ddffe){if(_0x2ddffe){if(!fs[_0xddca('0x53')](_0x2ddffe[_0xddca('0x50')])){throw new db[(_0xddca('0x56'))]['ValidationError'](_0xddca('0x5c'));}if(_0x2ddffe[_0xddca('0x58')]){return _0x480099[_0xddca('0x4d')](_0x2ddffe[_0xddca('0x50')],_0x2ddffe[_0xddca('0x58')]+path['extname'](_0x2ddffe['value']),function(){if(_0x1dc51a){fs[_0xddca('0x5a')](_0x2ddffe[_0xddca('0x50')]);}});}else{return _0x480099['download'](_0x2ddffe[_0xddca('0x50')],function(_0x2ba391){if(_0x1dc51a){fs[_0xddca('0x5a')](_0x2ddffe[_0xddca('0x50')]);}});}}})['catch'](handleError(_0x480099,null));};exports[_0xddca('0x24')]=function(_0x43b86f,_0x2cee12){return db[_0xddca('0x2d')][_0xddca('0x49')]({'where':{'id':_0x43b86f[_0xddca('0x45')]['id']}})['then'](function(_0x425d20){if(_['isNil'](_0x425d20)){throw new ReferenceError(_0xddca('0x63'));}return _0x425d20;})['then'](function(_0x13fc1f){var _0x10bb79=_0x13fc1f[_0xddca('0x50')];logger[_0xddca('0x64')]('cancellazione\x20fisica\x20documento\x20%s',_0x10bb79);if(!_['isNil'](_0x13fc1f[_0xddca('0x50')])&&fs['existsSync'](_0x10bb79)){logger[_0xddca('0x64')](_0xddca('0x65')+_0x10bb79+_0xddca('0x66'));fs[_0xddca('0x67')](_0x10bb79);}_0x10bb79=_0x10bb79+_0xddca('0x68');if(!_[_0xddca('0x69')](_0x13fc1f[_0xddca('0x50')])&&fs['existsSync'](_0x10bb79)){logger[_0xddca('0x64')](_0xddca('0x65')+_0x10bb79+_0xddca('0x66'));fs[_0xddca('0x67')](_0x10bb79);}return _0x13fc1f;})[_0xddca('0x25')](function(_0x3c0a3d){if(!_0x3c0a3d)throw new InternalError();return _0x3c0a3d[_0xddca('0x24')]();})['then'](function(){_0x2cee12[_0xddca('0x1a')](0xcc)[_0xddca('0x26')]();})[_0xddca('0x44')](handleError(_0x2cee12,null));};function getBucketslist(_0x2fe74e,_0x16ac8d,_0x39a97b){return new Promise(function(_0x5c6fae,_0x5564af){var _0x475a02=new AWS['S3']({'accessKeyId':_0x16ac8d,'secretAccessKey':_0x2fe74e,'region':_0x39a97b});_0x475a02[_0xddca('0x6a')]({},function(_0x3182d9,_0x5820c4){if(_0x3182d9){return _0x5564af(_0x3182d9);}else{return _0x5c6fae(_0x5820c4);}});});}function createBucket(_0x21389f,_0x4edbfd,_0x427007,_0x556fda){return new Promise(function(_0x34f367,_0x3a22c9){var _0x125224=new AWS['S3']({'accessKeyId':_0x4edbfd,'secretAccessKey':_0x21389f,'region':_0x427007});_0x125224[_0xddca('0x6b')]({'Bucket':_0x556fda},function(_0x42ab07,_0x1952ad){if(_0x42ab07){return _0x3a22c9(_0x42ab07);}else{return _0x34f367(_0x1952ad);}});});}function uploadFile(_0x42a6ff,_0x11ad15,_0x2b64b4,_0x5ed5d6,_0x3b1716,_0x2f1d2c){return new Promise(function(_0x3ebb8d,_0x144a9d){var _0x4199c2=new AWS['S3']({'accessKeyId':_0x11ad15,'secretAccessKey':_0x42a6ff,'region':_0x2b64b4});_0x4199c2[_0xddca('0x6c')]({'Bucket':_0x5ed5d6,'Key':_0x3b1716,'Body':_0x2f1d2c},function(_0x25526c,_0x45a32d){if(_0x25526c){return _0x144a9d(_0x25526c);}else{return _0x3ebb8d(_0x45a32d);}});});}function startTranscribe(_0x1e4cae,_0x16a4c1,_0x4a893a,_0x3e35f9,_0x504dac,_0x5c8a16){return new Promise(function(_0x57114e,_0xd8427b){var _0x11c8bb=new AWS[(_0xddca('0x6d'))]({'accessKeyId':_0x16a4c1,'secretAccessKey':_0x1e4cae,'region':_0x4a893a});_0x11c8bb[_0xddca('0x6e')]({'TranscriptionJobName':_0x3e35f9,'LanguageCode':_0x504dac,'Media':{'MediaFileUri':_0x5c8a16}},function(_0xa1c624,_0xadb792){if(_0xa1c624){return _0xd8427b(_0xa1c624);}else{return _0x57114e(_0xadb792);}});});}function transcribe(_0x44184c,_0x3fbd8b,_0xff8a2,_0x302803,_0x2e7421,_0x143fc2,_0x77e75e){return new Promise(function(_0x4be8b1,_0x43847d){var _0x43a772={};logger[_0xddca('0x64')](util[_0xddca('0x51')]('[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s',_0x44184c,_0x2e7421));return uploadFile(_0x3fbd8b,_0xff8a2,_0x302803,_0x2e7421,path['basename'](_0x143fc2),fs[_0xddca('0x6f')](_0x143fc2))[_0xddca('0x25')](function(_0x18699b){logger[_0xddca('0x64')](util[_0xddca('0x51')](_0xddca('0x70'),_0x44184c,_0x2e7421,_0x18699b[_0xddca('0x71')]));_0x43a772[_0xddca('0x72')]=_0x18699b[_0xddca('0x73')];_0x43a772['location']=_0x18699b[_0xddca('0x71')];logger[_0xddca('0x64')](util[_0xddca('0x51')](_0xddca('0x74'),_0x44184c));return startTranscribe(_0x3fbd8b,_0xff8a2,_0x302803,uuidv4(),_0x77e75e,_0x18699b[_0xddca('0x71')]);})['then'](function(_0x5b2839){logger[_0xddca('0x64')](util[_0xddca('0x51')](_0xddca('0x75'),_0x44184c,_0x5b2839[_0xddca('0x76')][_0xddca('0x77')]));_0x43a772['transcribeName']=_0x5b2839[_0xddca('0x76')][_0xddca('0x77')];_0x43a772[_0xddca('0x78')]=_0x5b2839[_0xddca('0x76')][_0xddca('0x79')];return _0x4be8b1(_0x43a772);})[_0xddca('0x44')](function(_0x3847c3){return _0x43847d(_0x3847c3);});});}exports[_0xddca('0x7a')]=function(_0x3c7727,_0xdee885,_0x4c4517){var _0x1f4628;var _0x5b8c1b;var _0x48dfb3;var _0x30e70f=require(_0xddca('0x4e'));return db[_0xddca('0x2d')][_0xddca('0x7b')]({'where':{'id':_0x3c7727[_0xddca('0x45')]['id']}})[_0xddca('0x25')](function(_0x54b5fe){if(_0x54b5fe){var _0x2e9c79=util['format']('%s.cypher',_0x54b5fe[_0xddca('0x50')]);if(fs[_0xddca('0x53')](_0x2e9c79)){cypher=!![];return _0x30e70f[_0xddca('0x54')](_0x2e9c79,_0x54b5fe['value'],config[_0xddca('0x55')]['recording'])[_0xddca('0x25')](function(){return _0x54b5fe;});}return _0x54b5fe;}})[_0xddca('0x25')](function(_0x291637){if(!_0x291637){throw new db[(_0xddca('0x56'))][(_0xddca('0x57'))](_0xddca('0x7c'));}_0x5b8c1b=_0x291637;return db[_0xddca('0x7d')][_0xddca('0x7b')]({'where':{'id':0x1}});})[_0xddca('0x25')](handleEntityNotFound(_0xdee885,null))[_0xddca('0x25')](function(_0x514f6f){if(_0x514f6f){_0x1f4628=_0x514f6f;if(!_0x1f4628[_0xddca('0x7e')]||!_0x1f4628['transcribeAccountId']||!_0x1f4628[_0xddca('0x7f')]||!_0x1f4628['language']||!_0x1f4628[_0xddca('0x72')]){throw new db[(_0xddca('0x56'))][(_0xddca('0x57'))](_0xddca('0x80'));}if(_0x3c7727[_0xddca('0x4b')][_0xddca('0x81')]&&(!_0x1f4628[_0xddca('0x82')]||!_0x1f4628['sentimentAccountId']||!_0x1f4628[_0xddca('0x83')]||!_0x1f4628[_0xddca('0x84')]||!_0x1f4628['bucket'])){throw new db[(_0xddca('0x56'))][(_0xddca('0x57'))](_0xddca('0x85'));}return db[_0xddca('0x86')]['findOne']({'where':{'id':_0x1f4628['transcribeAccountId']}});}})['then'](function(_0x1ecf88){if(!_0x1ecf88){throw new db[(_0xddca('0x56'))][(_0xddca('0x57'))](_0xddca('0x87'));}if(!_0x1ecf88['data1']||!_0x1ecf88[_0xddca('0x88')]){throw new db[(_0xddca('0x56'))][(_0xddca('0x57'))]('Cloud\x20Provider\x20not\x20configured');}_0x48dfb3=_0x1ecf88;return getBucketslist(_0x48dfb3['data1'],_0x48dfb3[_0xddca('0x88')],_0x1f4628['transcribeRegion']);})[_0xddca('0x25')](function(_0x4b233e){if(_0x4b233e&&_0x4b233e['Buckets']){var _0x37a617=_[_0xddca('0x49')](_0x4b233e[_0xddca('0x89')],function(_0x40dbdc){return _0x40dbdc['Name']===_0x1f4628[_0xddca('0x72')];});if(!_0x37a617){logger[_0xddca('0x64')](util['format'](_0xddca('0x8a'),_0x3c7727[_0xddca('0x45')]['id'],_0x1f4628[_0xddca('0x72')]));return createBucket(_0x48dfb3[_0xddca('0x8b')],_0x48dfb3[_0xddca('0x88')],_0x1f4628['transcribeRegion'],_0x1f4628[_0xddca('0x72')]);}logger[_0xddca('0x64')](util[_0xddca('0x51')]('[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available',_0x3c7727['params']['id'],_0x1f4628[_0xddca('0x72')]));return;}})[_0xddca('0x25')](function(_0x576cd2){if(_0x5b8c1b[_0xddca('0x78')]===_0xddca('0x8c')){return transcribe(_0x3c7727[_0xddca('0x45')]['id'],_0x48dfb3[_0xddca('0x8b')],_0x48dfb3[_0xddca('0x88')],_0x1f4628['transcribeRegion'],_0x1f4628[_0xddca('0x72')],_0x5b8c1b[_0xddca('0x50')],_0x1f4628['language']);}else{logger[_0xddca('0x64')](util[_0xddca('0x51')](_0xddca('0x8d'),_0x3c7727[_0xddca('0x45')]['id']));return{'transcribeStatus':_0xddca('0x8e')};}})[_0xddca('0x25')](function(_0x2cc355){if(_0x2cc355){_0x2cc355[_0xddca('0x8f')]=_0x3c7727[_0xddca('0x4b')][_0xddca('0x81')];return _0x5b8c1b[_0xddca('0x90')](_0x2cc355);}})['then'](respondWithResult(_0xdee885,null))[_0xddca('0x44')](handleError(_0xdee885,null));};function writeFile(_0x231c01,_0x4f04d5){return new Promise(function(_0x54b2bb,_0x3a9873){fs[_0xddca('0x91')](_0x4f04d5,_0x231c01,function(_0x490a81,_0x303c85){if(_0x490a81){return _0x3a9873(_0x490a81);}else{return _0x54b2bb(_0x303c85);}});});}exports[_0xddca('0x92')]=function(_0x436e84,_0x4356b1,_0x76da44){return db[_0xddca('0x2d')]['findOne']({'where':{'id':_0x436e84[_0xddca('0x45')]['id']}})[_0xddca('0x25')](handleEntityNotFound(_0x4356b1))[_0xddca('0x25')](function(_0x54a163){if(_0x54a163&&_0x54a163['fileText']){var _0x2004d1=_0x54a163[_0xddca('0x93')];var _0x38eed2=config[_0xddca('0x94')]+_0xddca('0x95')+_0x54a163['id']+_0xddca('0x96');if(fs[_0xddca('0x53')](_0x38eed2)){return _0x38eed2;}return writeFile(_0x2004d1,_0x38eed2)['then'](function(){return _0x38eed2;});}else{throw new db[(_0xddca('0x56'))]['ValidationError']('Transcript\x20not\x20available');}})[_0xddca('0x25')](function(_0x4e4d70){return _0x4356b1[_0xddca('0x4d')](_0x4e4d70);})['catch'](handleError(_0x4356b1));}; \ No newline at end of file +var _0x2e25=['intersection','fields','attributes','hasOwnProperty','order','sort','pick','merge','where','VIRTUAL','filter','options','then','rows','catch','show','length','includeAll','include','create','update','body','find','params','describe','download','../../components/encryptor','type','uniqueid','value','%s.cypher','recording','Sequelize','ValidationError','VoiceRecording\x20not\x20found','filename','extname','unlink','message','downloads','sequelize','col','token','$and','push','decryptFile','secrets','existsSync','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','destroy','listBuckets','createBucket','upload','startTranscriptionJob','[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s','readFileSync','[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)','Location','bucket','Bucket','location','[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request','TranscriptionJob','TranscriptionJobName','transcribeName','transcribeStatus','TranscriptionJobStatus','findOne','Setting','transcribe','transcribeRegion','language','sentiment','sentimentAccountId','sentimentRegion','CloudProvider','transcribeAccountId','Cloud\x20Provider\x20not\x20available','data1','data2','Cloud\x20Provider\x20not\x20configured','Buckets','Name','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','NEW','tempSentiment','runSentiment','updateAttributes','writeFile','downloadTranscribe','fileText','/server/files/transcribes/transcribe_','.txt','Transcript\x20not\x20available','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','aws-sdk','uuid/v4','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','apply','save','error','stack','name','index','map','VoiceRecording','rawAttributes','fieldName','key','model','differenceBy','format','query','keys','filters'];(function(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0x2e25,0x101));var _0x52e2=function(_0x42d10a,_0x2b627c){_0x42d10a=_0x42d10a-0x0;var _0x400710=_0x2e25[_0x42d10a];return _0x400710;};'use strict';var emlformat=require(_0x52e2('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x52e2('0x1'));var jsonpatch=require(_0x52e2('0x2'));var rp=require('request-promise');var moment=require(_0x52e2('0x3'));var BPromise=require(_0x52e2('0x4'));var Mustache=require(_0x52e2('0x5'));var util=require(_0x52e2('0x6'));var path=require(_0x52e2('0x7'));var sox=require(_0x52e2('0x8'));var csv=require(_0x52e2('0x9'));var ejs=require(_0x52e2('0xa'));var fs=require('fs');var fs_extra=require(_0x52e2('0xb'));var _=require(_0x52e2('0xc'));var squel=require('squel');var crypto=require(_0x52e2('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x52e2('0xe'));var toCsv=require('to-csv');var querystring=require(_0x52e2('0xf'));var Papa=require(_0x52e2('0x10'));var AWS=require(_0x52e2('0x11'));var uuidv4=require(_0x52e2('0x12'));var Redis=require(_0x52e2('0x13'));var authService=require(_0x52e2('0x14'));var qs=require(_0x52e2('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x52e2('0x16'));var logger=require('../../config/logger')(_0x52e2('0x17'));var utils=require(_0x52e2('0x18'));var config=require(_0x52e2('0x19'));var licenseUtil=require(_0x52e2('0x1a'));var db=require(_0x52e2('0x1b'))['db'];function respondWithStatusCode(_0x5c99cc,_0xec2b2b){_0xec2b2b=_0xec2b2b||0xcc;return function(_0x17ea91){if(_0x17ea91){return _0x5c99cc[_0x52e2('0x1c')](_0xec2b2b);}return _0x5c99cc['status'](_0xec2b2b)[_0x52e2('0x1d')]();};}function respondWithResult(_0x57f853,_0x37745f){_0x37745f=_0x37745f||0xc8;return function(_0x48f6b3){if(_0x48f6b3){return _0x57f853[_0x52e2('0x1e')](_0x37745f)[_0x52e2('0x1f')](_0x48f6b3);}};}function respondWithFilteredResult(_0x26a1e7,_0x142be1){return function(_0x652e70){if(_0x652e70){var _0x592dcb=typeof _0x142be1[_0x52e2('0x20')]===_0x52e2('0x21')&&typeof _0x142be1['limit']===_0x52e2('0x21');var _0x2a0d63=_0x652e70[_0x52e2('0x22')];var _0x9b03f0=_0x592dcb?0x0:_0x142be1[_0x52e2('0x20')];var _0x517e36=_0x592dcb?_0x652e70['count']:_0x142be1[_0x52e2('0x20')]+_0x142be1[_0x52e2('0x23')];var _0x51f7d0;if(_0x517e36>=_0x2a0d63){_0x517e36=_0x2a0d63;_0x51f7d0=0xc8;}else{_0x51f7d0=0xce;}_0x26a1e7[_0x52e2('0x1e')](_0x51f7d0);return _0x26a1e7[_0x52e2('0x24')](_0x52e2('0x25'),_0x9b03f0+'-'+_0x517e36+'/'+_0x2a0d63)['json'](_0x652e70);}return null;};}function patchUpdates(_0x2d822c){return function(_0x5061b1){try{jsonpatch[_0x52e2('0x26')](_0x5061b1,_0x2d822c,!![]);}catch(_0x9de2be){return BPromise['reject'](_0x9de2be);}return _0x5061b1[_0x52e2('0x27')]();};}function saveUpdates(_0x9e9017,_0x194238){return function(_0x306d1f){if(_0x306d1f){return _0x306d1f['update'](_0x9e9017)['then'](function(_0x5d5ebb){return _0x5d5ebb;});}return null;};}function removeEntity(_0xf7a4d,_0xcc341b){return function(_0x4494dc){if(_0x4494dc){return _0x4494dc['destroy']()['then'](function(){_0xf7a4d['status'](0xcc)[_0x52e2('0x1d')]();});}};}function handleEntityNotFound(_0x4e403a,_0x122960){return function(_0x989c9){if(!_0x989c9){_0x4e403a[_0x52e2('0x1c')](0x194);}return _0x989c9;};}function handleError(_0x163367,_0x2cbb59){_0x2cbb59=_0x2cbb59||0x1f4;return function(_0x1b096a){logger[_0x52e2('0x28')](_0x1b096a[_0x52e2('0x29')]);if(_0x1b096a[_0x52e2('0x2a')]){delete _0x1b096a[_0x52e2('0x2a')];}_0x163367[_0x52e2('0x1e')](_0x2cbb59)['send'](_0x1b096a);};}exports[_0x52e2('0x2b')]=function(_0x4de1b0,_0xd87b20){var _0x54954d={},_0x1ba92e={},_0x22f511={'count':0x0,'rows':[]};var _0x281bfe=_[_0x52e2('0x2c')](db[_0x52e2('0x2d')][_0x52e2('0x2e')],function(_0x46653f){return{'name':_0x46653f[_0x52e2('0x2f')],'type':_0x46653f['type'][_0x52e2('0x30')]};});_0x1ba92e[_0x52e2('0x31')]=_[_0x52e2('0x32')](_['map'](_0x281bfe,_0x52e2('0x2a')),[_0x52e2('0x33')]);_0x1ba92e[_0x52e2('0x34')]=_[_0x52e2('0x35')](_0x4de1b0[_0x52e2('0x34')]);_0x1ba92e[_0x52e2('0x36')]=_['intersection'](_0x1ba92e[_0x52e2('0x31')],_0x1ba92e[_0x52e2('0x34')]);_0x54954d['attributes']=_[_0x52e2('0x37')](_0x1ba92e[_0x52e2('0x31')],qs[_0x52e2('0x38')](_0x4de1b0[_0x52e2('0x34')][_0x52e2('0x38')]));_0x54954d['attributes']=_0x54954d[_0x52e2('0x39')]['length']?_0x54954d[_0x52e2('0x39')]:_0x1ba92e[_0x52e2('0x31')];if(!_0x4de1b0[_0x52e2('0x34')][_0x52e2('0x3a')]('nolimit')){_0x54954d[_0x52e2('0x23')]=qs[_0x52e2('0x23')](_0x4de1b0[_0x52e2('0x34')][_0x52e2('0x23')]);_0x54954d['offset']=qs[_0x52e2('0x20')](_0x4de1b0[_0x52e2('0x34')][_0x52e2('0x20')]);}_0x54954d[_0x52e2('0x3b')]=qs[_0x52e2('0x3c')](_0x4de1b0['query'][_0x52e2('0x3c')]);_0x54954d['where']=qs[_0x52e2('0x36')](_[_0x52e2('0x3d')](_0x4de1b0[_0x52e2('0x34')],_0x1ba92e[_0x52e2('0x36')]),_0x281bfe);if(_0x4de1b0[_0x52e2('0x34')]['filter']){_0x54954d['where']=_[_0x52e2('0x3e')](_0x54954d[_0x52e2('0x3f')],{'$or':_[_0x52e2('0x2c')](_0x281bfe,function(_0x213c75){if(_0x213c75['type']!==_0x52e2('0x40')){var _0x4a4756={};_0x4a4756[_0x213c75[_0x52e2('0x2a')]]={'$like':'%'+_0x4de1b0[_0x52e2('0x34')][_0x52e2('0x41')]+'%'};return _0x4a4756;}})});}_0x54954d=_[_0x52e2('0x3e')]({},_0x54954d,_0x4de1b0[_0x52e2('0x42')]);var _0x16b221={'where':_0x54954d[_0x52e2('0x3f')]};return db[_0x52e2('0x2d')][_0x52e2('0x22')](_0x16b221)[_0x52e2('0x43')](function(_0x5694ad){_0x22f511[_0x52e2('0x22')]=_0x5694ad;if(_0x4de1b0['query']['includeAll']){_0x54954d['include']=[{'all':!![]}];}return db['VoiceRecording']['findAll'](_0x54954d);})[_0x52e2('0x43')](function(_0x4ea86f){_0x22f511[_0x52e2('0x44')]=_0x4ea86f;return _0x22f511;})['then'](respondWithFilteredResult(_0xd87b20,_0x54954d))[_0x52e2('0x45')](handleError(_0xd87b20,null));};exports[_0x52e2('0x46')]=function(_0x4647ad,_0x34dc8a){var _0x10e22c={'raw':![],'where':{'id':_0x4647ad['params']['id']}},_0x1d2cb9={};_0x1d2cb9[_0x52e2('0x31')]=_[_0x52e2('0x35')](db[_0x52e2('0x2d')][_0x52e2('0x2e')]);_0x1d2cb9[_0x52e2('0x34')]=_['keys'](_0x4647ad[_0x52e2('0x34')]);_0x1d2cb9['filters']=_[_0x52e2('0x37')](_0x1d2cb9[_0x52e2('0x31')],_0x1d2cb9[_0x52e2('0x34')]);_0x10e22c['attributes']=_[_0x52e2('0x37')](_0x1d2cb9[_0x52e2('0x31')],qs[_0x52e2('0x38')](_0x4647ad[_0x52e2('0x34')][_0x52e2('0x38')]));_0x10e22c[_0x52e2('0x39')]=_0x10e22c[_0x52e2('0x39')][_0x52e2('0x47')]?_0x10e22c[_0x52e2('0x39')]:_0x1d2cb9[_0x52e2('0x31')];if(_0x4647ad['query'][_0x52e2('0x48')]){_0x10e22c[_0x52e2('0x49')]=[{'all':!![]}];}_0x10e22c=_[_0x52e2('0x3e')]({},_0x10e22c,_0x4647ad[_0x52e2('0x42')]);return db['VoiceRecording']['find'](_0x10e22c)['then'](handleEntityNotFound(_0x34dc8a,null))[_0x52e2('0x43')](respondWithResult(_0x34dc8a,null))[_0x52e2('0x45')](handleError(_0x34dc8a,null));};exports[_0x52e2('0x4a')]=function(_0x35841f,_0x19e448){return db[_0x52e2('0x2d')][_0x52e2('0x4a')](_0x35841f['body'],{})[_0x52e2('0x43')](respondWithResult(_0x19e448,0xc9))[_0x52e2('0x45')](handleError(_0x19e448,null));};exports[_0x52e2('0x4b')]=function(_0x3133ce,_0x1e8b3c){if(_0x3133ce[_0x52e2('0x4c')]['id']){delete _0x3133ce[_0x52e2('0x4c')]['id'];}return db['VoiceRecording'][_0x52e2('0x4d')]({'where':{'id':_0x3133ce[_0x52e2('0x4e')]['id']}})[_0x52e2('0x43')](handleEntityNotFound(_0x1e8b3c,null))[_0x52e2('0x43')](saveUpdates(_0x3133ce[_0x52e2('0x4c')],null))[_0x52e2('0x43')](respondWithResult(_0x1e8b3c,null))[_0x52e2('0x45')](handleError(_0x1e8b3c,null));};exports[_0x52e2('0x4f')]=function(_0x3cc52d,_0x357c5d){return db['VoiceRecording']['describe']()[_0x52e2('0x43')](respondWithResult(_0x357c5d,null))[_0x52e2('0x45')](handleError(_0x357c5d,null));};exports[_0x52e2('0x50')]=function(_0xff8618,_0x199ba0,_0x37ef3a){var _0x22db77=require(_0x52e2('0x51'));var _0x15fdaf=![];var _0x51fc72={};if(_0xff8618[_0x52e2('0x34')]['type']&&_0xff8618[_0x52e2('0x34')][_0x52e2('0x52')]===_0x52e2('0x53')){_0x51fc72['uniqueid']=_0xff8618['params']['id'];}else{_0x51fc72['id']=_0xff8618[_0x52e2('0x4e')]['id'];}return db[_0x52e2('0x2d')][_0x52e2('0x4d')]({'where':_0x51fc72,'attributes':['id',_0x52e2('0x54')],'raw':!![]})['then'](handleEntityNotFound(_0x199ba0,null))[_0x52e2('0x43')](function(_0x593685){if(_0x593685){var _0x1e39ce=_0x593685[_0x52e2('0x54')];var _0x35458e=util[_0x52e2('0x33')](_0x52e2('0x55'),_0x1e39ce);if(fs['existsSync'](_0x35458e)){_0x15fdaf=!![];return _0x22db77['decryptFile'](_0x35458e,_0x1e39ce,config['secrets'][_0x52e2('0x56')])[_0x52e2('0x43')](function(){return _0x593685;});}return _0x593685;}})[_0x52e2('0x43')](function(_0x5436f8){if(_0x5436f8){var _0x52d495=_0x5436f8[_0x52e2('0x54')];if(!fs['existsSync'](_0x52d495)){throw new db[(_0x52e2('0x57'))][(_0x52e2('0x58'))](_0x52e2('0x59'));}if(_0x5436f8[_0x52e2('0x5a')]){return _0x199ba0[_0x52e2('0x50')](_0x52d495,_0x5436f8[_0x52e2('0x5a')]+path[_0x52e2('0x5b')](_0x52d495),function(){if(_0x15fdaf){fs[_0x52e2('0x5c')](_0x52d495);}});}else{return _0x199ba0[_0x52e2('0x50')](_0x52d495,function(_0x4957d6){if(_0x15fdaf){fs['unlink'](_0x52d495);}});}}})['catch'](function(_0x209bb8){if(_0x209bb8[_0x52e2('0x5d')]===_0x52e2('0x59')){_0x199ba0[_0x52e2('0x1e')](0x194)['send']('Not\x20found');}else{return handleError(_0x199ba0,null);}});};exports[_0x52e2('0x5e')]=function(_0x536cb3,_0x10c10c,_0x296adc){var _0x5721e4=require(_0x52e2('0x51'));var _0x125f59=![];var _0x5643ce={'$and':[db['sequelize'][_0x52e2('0x3f')](db[_0x52e2('0x5f')]['fn']('MD5',db[_0x52e2('0x5f')][_0x52e2('0x60')](_0x52e2('0x53'))),_0x536cb3[_0x52e2('0x34')][_0x52e2('0x61')])]};if(_0x536cb3['query'][_0x52e2('0x52')]&&_0x536cb3[_0x52e2('0x34')][_0x52e2('0x52')]===_0x52e2('0x53')){_0x5643ce[_0x52e2('0x62')]['push']({'uniqueid':_0x536cb3[_0x52e2('0x4e')]['id']});}else{_0x5643ce['$and'][_0x52e2('0x63')]({'id':_0x536cb3[_0x52e2('0x4e')]['id']});}return db[_0x52e2('0x2d')]['find']({'where':_0x5643ce,'attributes':['id',_0x52e2('0x54')],'raw':!![]})['then'](handleEntityNotFound(_0x10c10c,null))[_0x52e2('0x43')](function(_0x498914){if(_0x498914){var _0x25c36e=util[_0x52e2('0x33')](_0x52e2('0x55'),_0x498914[_0x52e2('0x54')]);if(fs['existsSync'](_0x25c36e)){_0x125f59=!![];return _0x5721e4[_0x52e2('0x64')](_0x25c36e,_0x498914[_0x52e2('0x54')],config[_0x52e2('0x65')][_0x52e2('0x56')])[_0x52e2('0x43')](function(){return _0x498914;});}return _0x498914;}})[_0x52e2('0x43')](function(_0xe090cb){if(_0xe090cb){if(!fs[_0x52e2('0x66')](_0xe090cb['value'])){throw new db[(_0x52e2('0x57'))][(_0x52e2('0x58'))](_0x52e2('0x59'));}if(_0xe090cb['filename']){return _0x10c10c[_0x52e2('0x50')](_0xe090cb[_0x52e2('0x54')],_0xe090cb[_0x52e2('0x5a')]+path[_0x52e2('0x5b')](_0xe090cb[_0x52e2('0x54')]),function(){if(_0x125f59){fs[_0x52e2('0x5c')](_0xe090cb['value']);}});}else{return _0x10c10c[_0x52e2('0x50')](_0xe090cb[_0x52e2('0x54')],function(_0x338bd7){if(_0x125f59){fs[_0x52e2('0x5c')](_0xe090cb['value']);}});}}})[_0x52e2('0x45')](handleError(_0x10c10c,null));};exports['destroy']=function(_0x208c49,_0x196645){return db[_0x52e2('0x2d')][_0x52e2('0x4d')]({'where':{'id':_0x208c49['params']['id']}})[_0x52e2('0x43')](function(_0x490650){if(_[_0x52e2('0x67')](_0x490650)){throw new ReferenceError(_0x52e2('0x68'));}return _0x490650;})[_0x52e2('0x43')](function(_0x519e3f){var _0x4bbe9e=_0x519e3f['value'];logger[_0x52e2('0x69')](_0x52e2('0x6a'),_0x4bbe9e);if(!_[_0x52e2('0x67')](_0x519e3f[_0x52e2('0x54')])&&fs[_0x52e2('0x66')](_0x4bbe9e)){logger[_0x52e2('0x69')]('File:\x20\x22'+_0x4bbe9e+_0x52e2('0x6b'));fs[_0x52e2('0x6c')](_0x4bbe9e);}_0x4bbe9e=_0x4bbe9e+_0x52e2('0x6d');if(!_['isNil'](_0x519e3f[_0x52e2('0x54')])&&fs['existsSync'](_0x4bbe9e)){logger[_0x52e2('0x69')]('File:\x20\x22'+_0x4bbe9e+_0x52e2('0x6b'));fs[_0x52e2('0x6c')](_0x4bbe9e);}return _0x519e3f;})[_0x52e2('0x43')](function(_0x3ccb52){if(!_0x3ccb52)throw new InternalError();return _0x3ccb52[_0x52e2('0x6e')]();})[_0x52e2('0x43')](function(){_0x196645[_0x52e2('0x1e')](0xcc)[_0x52e2('0x1d')]();})[_0x52e2('0x45')](handleError(_0x196645,null));};function getBucketslist(_0x36064f,_0x3b734d,_0x11b277){return new Promise(function(_0x43990b,_0x5cd466){var _0xeb5132=new AWS['S3']({'accessKeyId':_0x3b734d,'secretAccessKey':_0x36064f,'region':_0x11b277});_0xeb5132[_0x52e2('0x6f')]({},function(_0x45a7cd,_0x36907e){if(_0x45a7cd){return _0x5cd466(_0x45a7cd);}else{return _0x43990b(_0x36907e);}});});}function createBucket(_0x1466a0,_0x1bb050,_0xdc7443,_0x8a24e8){return new Promise(function(_0x49bfa4,_0x234a5c){var _0xa208d8=new AWS['S3']({'accessKeyId':_0x1bb050,'secretAccessKey':_0x1466a0,'region':_0xdc7443});_0xa208d8[_0x52e2('0x70')]({'Bucket':_0x8a24e8},function(_0x4856a2,_0x4deadb){if(_0x4856a2){return _0x234a5c(_0x4856a2);}else{return _0x49bfa4(_0x4deadb);}});});}function uploadFile(_0x1cbbbb,_0x23a228,_0x43be00,_0x19a7c9,_0x50a22b,_0x5981a9){return new Promise(function(_0x25e46a,_0x40ed5c){var _0xc921c0=new AWS['S3']({'accessKeyId':_0x23a228,'secretAccessKey':_0x1cbbbb,'region':_0x43be00});_0xc921c0[_0x52e2('0x71')]({'Bucket':_0x19a7c9,'Key':_0x50a22b,'Body':_0x5981a9},function(_0x2fe1ad,_0x345734){if(_0x2fe1ad){return _0x40ed5c(_0x2fe1ad);}else{return _0x25e46a(_0x345734);}});});}function startTranscribe(_0xa309bc,_0x53601e,_0x391686,_0xeed3b9,_0x545e91,_0x5e802d){return new Promise(function(_0xff9350,_0x383329){var _0x3613e0=new AWS['TranscribeService']({'accessKeyId':_0x53601e,'secretAccessKey':_0xa309bc,'region':_0x391686});_0x3613e0[_0x52e2('0x72')]({'TranscriptionJobName':_0xeed3b9,'LanguageCode':_0x545e91,'Media':{'MediaFileUri':_0x5e802d}},function(_0x250d70,_0x5c9944){if(_0x250d70){return _0x383329(_0x250d70);}else{return _0xff9350(_0x5c9944);}});});}function transcribe(_0x2b92d9,_0x1d2aa3,_0x21824a,_0x3b8a1d,_0x185265,_0x8969c1,_0x919ab4){return new Promise(function(_0xdfd2d2,_0x37e2d5){var _0x1d9197={};logger[_0x52e2('0x69')](util['format'](_0x52e2('0x73'),_0x2b92d9,_0x185265));return uploadFile(_0x1d2aa3,_0x21824a,_0x3b8a1d,_0x185265,path['basename'](_0x8969c1),fs[_0x52e2('0x74')](_0x8969c1))[_0x52e2('0x43')](function(_0xd431fd){logger[_0x52e2('0x69')](util[_0x52e2('0x33')](_0x52e2('0x75'),_0x2b92d9,_0x185265,_0xd431fd[_0x52e2('0x76')]));_0x1d9197[_0x52e2('0x77')]=_0xd431fd[_0x52e2('0x78')];_0x1d9197[_0x52e2('0x79')]=_0xd431fd['Location'];logger[_0x52e2('0x69')](util[_0x52e2('0x33')](_0x52e2('0x7a'),_0x2b92d9));return startTranscribe(_0x1d2aa3,_0x21824a,_0x3b8a1d,uuidv4(),_0x919ab4,_0xd431fd[_0x52e2('0x76')]);})['then'](function(_0x337021){logger[_0x52e2('0x69')](util[_0x52e2('0x33')]('[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created',_0x2b92d9,_0x337021[_0x52e2('0x7b')][_0x52e2('0x7c')]));_0x1d9197[_0x52e2('0x7d')]=_0x337021[_0x52e2('0x7b')]['TranscriptionJobName'];_0x1d9197[_0x52e2('0x7e')]=_0x337021[_0x52e2('0x7b')][_0x52e2('0x7f')];return _0xdfd2d2(_0x1d9197);})[_0x52e2('0x45')](function(_0x157133){return _0x37e2d5(_0x157133);});});}exports['runTranscribe']=function(_0xc980d,_0x35655d,_0x19c90f){var _0x4f4562;var _0x2e5ac5;var _0x1f8fbd;var _0x12405f=require(_0x52e2('0x51'));return db[_0x52e2('0x2d')][_0x52e2('0x80')]({'where':{'id':_0xc980d['params']['id']}})['then'](function(_0x275b50){if(_0x275b50){var _0x590cc6=util[_0x52e2('0x33')](_0x52e2('0x55'),_0x275b50['value']);if(fs['existsSync'](_0x590cc6)){cypher=!![];return _0x12405f[_0x52e2('0x64')](_0x590cc6,_0x275b50[_0x52e2('0x54')],config[_0x52e2('0x65')][_0x52e2('0x56')])[_0x52e2('0x43')](function(){return _0x275b50;});}return _0x275b50;}})[_0x52e2('0x43')](function(_0x2ebe97){if(!_0x2ebe97){throw new db['Sequelize'][(_0x52e2('0x58'))]('Voice\x20Recording\x20not\x20found');}_0x2e5ac5=_0x2ebe97;return db[_0x52e2('0x81')][_0x52e2('0x80')]({'where':{'id':0x1}});})[_0x52e2('0x43')](handleEntityNotFound(_0x35655d,null))[_0x52e2('0x43')](function(_0x320bec){if(_0x320bec){_0x4f4562=_0x320bec;if(!_0x4f4562[_0x52e2('0x82')]||!_0x4f4562['transcribeAccountId']||!_0x4f4562[_0x52e2('0x83')]||!_0x4f4562[_0x52e2('0x84')]||!_0x4f4562[_0x52e2('0x77')]){throw new db[(_0x52e2('0x57'))][(_0x52e2('0x58'))]('Transcribe\x20not\x20configured');}if(_0xc980d[_0x52e2('0x4c')]['runSentiment']&&(!_0x4f4562[_0x52e2('0x85')]||!_0x4f4562[_0x52e2('0x86')]||!_0x4f4562[_0x52e2('0x87')]||!_0x4f4562['language']||!_0x4f4562['bucket'])){throw new db[(_0x52e2('0x57'))][(_0x52e2('0x58'))]('Sentiment\x20Analysis\x20not\x20configured');}return db[_0x52e2('0x88')][_0x52e2('0x80')]({'where':{'id':_0x4f4562[_0x52e2('0x89')]}});}})['then'](function(_0x3a5ea9){if(!_0x3a5ea9){throw new db['Sequelize']['ValidationError'](_0x52e2('0x8a'));}if(!_0x3a5ea9[_0x52e2('0x8b')]||!_0x3a5ea9[_0x52e2('0x8c')]){throw new db['Sequelize'][(_0x52e2('0x58'))](_0x52e2('0x8d'));}_0x1f8fbd=_0x3a5ea9;return getBucketslist(_0x1f8fbd[_0x52e2('0x8b')],_0x1f8fbd[_0x52e2('0x8c')],_0x4f4562[_0x52e2('0x83')]);})[_0x52e2('0x43')](function(_0x459e2e){if(_0x459e2e&&_0x459e2e[_0x52e2('0x8e')]){var _0x395865=_[_0x52e2('0x4d')](_0x459e2e[_0x52e2('0x8e')],function(_0x3cbf0f){return _0x3cbf0f[_0x52e2('0x8f')]===_0x4f4562['bucket'];});if(!_0x395865){logger[_0x52e2('0x69')](util['format'](_0x52e2('0x90'),_0xc980d[_0x52e2('0x4e')]['id'],_0x4f4562[_0x52e2('0x77')]));return createBucket(_0x1f8fbd[_0x52e2('0x8b')],_0x1f8fbd[_0x52e2('0x8c')],_0x4f4562[_0x52e2('0x83')],_0x4f4562[_0x52e2('0x77')]);}logger[_0x52e2('0x69')](util['format'](_0x52e2('0x91'),_0xc980d['params']['id'],_0x4f4562['bucket']));return;}})[_0x52e2('0x43')](function(_0x1f0300){if(_0x2e5ac5[_0x52e2('0x7e')]===_0x52e2('0x92')){return transcribe(_0xc980d[_0x52e2('0x4e')]['id'],_0x1f8fbd[_0x52e2('0x8b')],_0x1f8fbd['data2'],_0x4f4562[_0x52e2('0x83')],_0x4f4562['bucket'],_0x2e5ac5[_0x52e2('0x54')],_0x4f4562[_0x52e2('0x84')]);}else{logger[_0x52e2('0x69')](util[_0x52e2('0x33')]('[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested',_0xc980d[_0x52e2('0x4e')]['id']));return{'transcribeStatus':'IN_PROGRESS'};}})[_0x52e2('0x43')](function(_0x7013a4){if(_0x7013a4){_0x7013a4[_0x52e2('0x93')]=_0xc980d[_0x52e2('0x4c')][_0x52e2('0x94')];return _0x2e5ac5[_0x52e2('0x95')](_0x7013a4);}})[_0x52e2('0x43')](respondWithResult(_0x35655d,null))[_0x52e2('0x45')](handleError(_0x35655d,null));};function writeFile(_0x571c30,_0x358544){return new Promise(function(_0x2318d8,_0x2d9dca){fs[_0x52e2('0x96')](_0x358544,_0x571c30,function(_0x3f5986,_0x53439c){if(_0x3f5986){return _0x2d9dca(_0x3f5986);}else{return _0x2318d8(_0x53439c);}});});}exports[_0x52e2('0x97')]=function(_0x43ef38,_0x4d86ee,_0x2926c6){return db[_0x52e2('0x2d')][_0x52e2('0x80')]({'where':{'id':_0x43ef38[_0x52e2('0x4e')]['id']}})['then'](handleEntityNotFound(_0x4d86ee))['then'](function(_0x20e072){if(_0x20e072&&_0x20e072['fileText']){var _0x53061f=_0x20e072[_0x52e2('0x98')];var _0x1b6446=config['root']+_0x52e2('0x99')+_0x20e072['id']+_0x52e2('0x9a');if(fs['existsSync'](_0x1b6446)){return _0x1b6446;}return writeFile(_0x53061f,_0x1b6446)[_0x52e2('0x43')](function(){return _0x1b6446;});}else{throw new db['Sequelize'][(_0x52e2('0x58'))](_0x52e2('0x9b'));}})['then'](function(_0x44c631){return _0x4d86ee[_0x52e2('0x50')](_0x44c631);})[_0x52e2('0x45')](handleError(_0x4d86ee));}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.model.js b/server/api/voiceRecording/voiceRecording.model.js index 039b711..2fec9f8 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 _0x62c8=['transcribeStatus','VoiceRecording','voice_recordings','uniqueid'];(function(_0x3cf2a4,_0x5ec78a){var _0x34b723=function(_0x32a112){while(--_0x32a112){_0x3cf2a4['push'](_0x3cf2a4['shift']());}};_0x34b723(++_0x5ec78a);}(_0x62c8,0x1ad));var _0x862c=function(_0x1bd226,_0x1b0169){_0x1bd226=_0x1bd226-0x0;var _0x3b7859=_0x62c8[_0x1bd226];return _0x3b7859;};'use strict';var attributes=require('./voiceRecording.attributes');module['exports']=function(_0x365036,_0x5f1e0f){return _0x365036['define'](_0x862c('0x0'),attributes,{'tableName':_0x862c('0x1'),'paranoid':![],'indexes':[{'name':_0x862c('0x2'),'fields':[_0x862c('0x2')]},{'name':_0x862c('0x3'),'fields':[_0x862c('0x3')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x6b61=['uniqueid','transcribeStatus','./voiceRecording.attributes','define','VoiceRecording','voice_recordings'];(function(_0x5a856c,_0x4a325a){var _0x10e12d=function(_0x45a65f){while(--_0x45a65f){_0x5a856c['push'](_0x5a856c['shift']());}};_0x10e12d(++_0x4a325a);}(_0x6b61,0x16a));var _0x16b6=function(_0x28669c,_0x1f62c4){_0x28669c=_0x28669c-0x0;var _0x4a3af6=_0x6b61[_0x28669c];return _0x4a3af6;};'use strict';var attributes=require(_0x16b6('0x0'));module['exports']=function(_0x4443d4,_0x71a55){return _0x4443d4[_0x16b6('0x1')](_0x16b6('0x2'),attributes,{'tableName':_0x16b6('0x3'),'paranoid':![],'indexes':[{'name':_0x16b6('0x4'),'fields':[_0x16b6('0x4')]},{'name':_0x16b6('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 617f8dd..dea65ba 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 _0x8e3f=['where','attributes','limit','stringify','CreateVoiceRecording','../../components/encryptor','Setting','findOne','callRecordingEncryption','create','existsSync','value','format','%s.cypher','encryptFile','recording','CreateVoiceRecording\x20file\x20encrypted','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','then','info','VoiceRecording,\x20%s,\x20%s','request\x20sent','debug','VoiceRecording,\x20%s,\x20%s,\x20%s','error','code','message','catch','UpdateVoiceRecording','VoiceRecording','body','options','raw'];(function(_0x23ffa0,_0x3d39bc){var _0x237ab3=function(_0x375185){while(--_0x375185){_0x23ffa0['push'](_0x23ffa0['shift']());}};_0x237ab3(++_0x3d39bc);}(_0x8e3f,0xc1));var _0xf8e3=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x8e3f[_0x57b54c];return _0x59cc19;};'use strict';var _=require(_0xf8e3('0x0'));var util=require(_0xf8e3('0x1'));var moment=require(_0xf8e3('0x2'));var BPromise=require('bluebird');var rs=require(_0xf8e3('0x3'));var fs=require('fs');var Redis=require(_0xf8e3('0x4'));var db=require(_0xf8e3('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xf8e3('0x6'))(_0xf8e3('0x7'));var config=require('../../config/environment');var jayson=require(_0xf8e3('0x8'));var client=jayson[_0xf8e3('0x9')][_0xf8e3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1ee9f3,_0x4e9e57,_0x4504dd){return new BPromise(function(_0x2e39b7,_0x17f56c){return client[_0xf8e3('0xb')](_0x1ee9f3,_0x4504dd)[_0xf8e3('0xc')](function(_0x4055e2){logger[_0xf8e3('0xd')](_0xf8e3('0xe'),_0x4e9e57,_0xf8e3('0xf'));logger[_0xf8e3('0x10')](_0xf8e3('0x11'),_0x4e9e57,_0xf8e3('0xf'),JSON['stringify'](_0x4055e2));if(_0x4055e2[_0xf8e3('0x12')]){if(_0x4055e2[_0xf8e3('0x12')][_0xf8e3('0x13')]===0x1f4){logger['error'](_0xf8e3('0xe'),_0x4e9e57,_0x4055e2[_0xf8e3('0x12')][_0xf8e3('0x14')]);return _0x17f56c(_0x4055e2[_0xf8e3('0x12')]['message']);}logger[_0xf8e3('0x12')](_0xf8e3('0xe'),_0x4e9e57,_0x4055e2[_0xf8e3('0x12')]['message']);return _0x2e39b7(_0x4055e2[_0xf8e3('0x12')]['message']);}else{logger[_0xf8e3('0xd')](_0xf8e3('0xe'),_0x4e9e57,_0xf8e3('0xf'));_0x2e39b7(_0x4055e2['result']['message']);}})[_0xf8e3('0x15')](function(_0x385dde){logger[_0xf8e3('0x12')](_0xf8e3('0xe'),_0x4e9e57,_0x385dde);_0x17f56c(_0x385dde);});});}exports[_0xf8e3('0x16')]=function(_0x11d4cc){var _0x7a81c3=this;return new Promise(function(_0x2e27e3,_0x1337ae){return db[_0xf8e3('0x17')]['update'](_0x11d4cc[_0xf8e3('0x18')],{'raw':_0x11d4cc[_0xf8e3('0x19')]?_0x11d4cc[_0xf8e3('0x19')][_0xf8e3('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x11d4cc[_0xf8e3('0x19')]?_0x11d4cc[_0xf8e3('0x19')][_0xf8e3('0x1b')]||null:null,'attributes':_0x11d4cc[_0xf8e3('0x19')]?_0x11d4cc['options'][_0xf8e3('0x1c')]||null:null,'limit':_0x11d4cc[_0xf8e3('0x19')]?_0x11d4cc[_0xf8e3('0x19')][_0xf8e3('0x1d')]||null:null})['then'](function(_0x39df34){logger['info'](_0xf8e3('0x16'),_0x11d4cc);logger[_0xf8e3('0x10')](_0xf8e3('0x16'),_0x11d4cc,JSON[_0xf8e3('0x1e')](_0x39df34));_0x2e27e3(_0x39df34);})[_0xf8e3('0x15')](function(_0x3ac384){logger['error'](_0xf8e3('0x16'),_0x3ac384[_0xf8e3('0x14')],_0x11d4cc);_0x1337ae(_0x7a81c3[_0xf8e3('0x12')](0x1f4,_0x3ac384[_0xf8e3('0x14')]));});});};exports[_0xf8e3('0x1f')]=function(_0x3b41a1){var _0x2963ed=this;return new Promise(function(_0x157a2d,_0x56fa8e){var _0x356e0a=require(_0xf8e3('0x20'));var _0x12ebd2;return db[_0xf8e3('0x21')][_0xf8e3('0x22')]({'attributes':['id',_0xf8e3('0x23')],'where':{'id':0x1},'raw':!![]})[_0xf8e3('0xc')](function(_0xfaf15d){_0x12ebd2=_0xfaf15d;return db['VoiceRecording'][_0xf8e3('0x24')](_0x3b41a1[_0xf8e3('0x18')]);})[_0xf8e3('0xc')](function(_0x28b2f2){if(_0x12ebd2['callRecordingEncryption']&&fs[_0xf8e3('0x25')](_0x28b2f2[_0xf8e3('0x26')])){var _0x40f64d=util[_0xf8e3('0x27')](_0xf8e3('0x28'),_0x28b2f2[_0xf8e3('0x26')]);return _0x356e0a[_0xf8e3('0x29')](_0x28b2f2[_0xf8e3('0x26')],_0x40f64d,config['secrets'][_0xf8e3('0x2a')])[_0xf8e3('0xc')](function(){fs['unlink'](_0x28b2f2['value']);logger['info'](_0xf8e3('0x2b'));return _0x28b2f2;});}return _0x28b2f2;})['then'](function(_0x2559ea){logger[_0xf8e3('0xd')](_0xf8e3('0x1f'),_0x3b41a1);logger[_0xf8e3('0x10')]('CreateVoiceRecording',_0x3b41a1,JSON['stringify'](_0x2559ea));_0x157a2d(_0x2559ea);})[_0xf8e3('0x15')](function(_0x2f87d8){logger[_0xf8e3('0x12')](_0xf8e3('0x1f'),_0x2f87d8[_0xf8e3('0x14')],_0x3b41a1);_0x56fa8e(_0x2963ed[_0xf8e3('0x12')](0x1f4,_0x2f87d8['message']));});});}; \ No newline at end of file +var _0x77d4=['%s.cypher','encryptFile','secrets','recording','unlink','CreateVoiceRecording\x20file\x20encrypted','util','bluebird','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','then','info','VoiceRecording,\x20%s,\x20%s','request\x20sent','VoiceRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','UpdateVoiceRecording','VoiceRecording','update','body','options','where','attributes','limit','debug','CreateVoiceRecording','../../components/encryptor','Setting','findOne','callRecordingEncryption','create','existsSync','value','format'];(function(_0x2f4c28,_0x190c92){var _0x2d169b=function(_0x27b862){while(--_0x27b862){_0x2f4c28['push'](_0x2f4c28['shift']());}};_0x2d169b(++_0x190c92);}(_0x77d4,0x108));var _0x477d=function(_0x5a6ee4,_0x2e1727){_0x5a6ee4=_0x5a6ee4-0x0;var _0x5906fa=_0x77d4[_0x5a6ee4];return _0x5906fa;};'use strict';var _=require('lodash');var util=require(_0x477d('0x0'));var moment=require('moment');var BPromise=require(_0x477d('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x477d('0x2'));var db=require(_0x477d('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x477d('0x4'));var config=require(_0x477d('0x5'));var jayson=require(_0x477d('0x6'));var client=jayson[_0x477d('0x7')][_0x477d('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x45ca2d,_0x5153df,_0x4f4fb4){return new BPromise(function(_0x2dd5d2,_0x579859){return client['request'](_0x45ca2d,_0x4f4fb4)[_0x477d('0x9')](function(_0x29f11b){logger[_0x477d('0xa')](_0x477d('0xb'),_0x5153df,_0x477d('0xc'));logger['debug'](_0x477d('0xd'),_0x5153df,'request\x20sent',JSON[_0x477d('0xe')](_0x29f11b));if(_0x29f11b[_0x477d('0xf')]){if(_0x29f11b['error'][_0x477d('0x10')]===0x1f4){logger[_0x477d('0xf')]('VoiceRecording,\x20%s,\x20%s',_0x5153df,_0x29f11b['error'][_0x477d('0x11')]);return _0x579859(_0x29f11b[_0x477d('0xf')]['message']);}logger[_0x477d('0xf')](_0x477d('0xb'),_0x5153df,_0x29f11b['error']['message']);return _0x2dd5d2(_0x29f11b[_0x477d('0xf')]['message']);}else{logger[_0x477d('0xa')](_0x477d('0xb'),_0x5153df,_0x477d('0xc'));_0x2dd5d2(_0x29f11b['result'][_0x477d('0x11')]);}})[_0x477d('0x12')](function(_0x29c6f8){logger[_0x477d('0xf')]('VoiceRecording,\x20%s,\x20%s',_0x5153df,_0x29c6f8);_0x579859(_0x29c6f8);});});}exports[_0x477d('0x13')]=function(_0x5d5553){var _0x367965=this;return new Promise(function(_0x1399d7,_0x159beb){return db[_0x477d('0x14')][_0x477d('0x15')](_0x5d5553[_0x477d('0x16')],{'raw':_0x5d5553['options']?_0x5d5553[_0x477d('0x17')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5d5553[_0x477d('0x17')]?_0x5d5553[_0x477d('0x17')][_0x477d('0x18')]||null:null,'attributes':_0x5d5553[_0x477d('0x17')]?_0x5d5553[_0x477d('0x17')][_0x477d('0x19')]||null:null,'limit':_0x5d5553[_0x477d('0x17')]?_0x5d5553[_0x477d('0x17')][_0x477d('0x1a')]||null:null})[_0x477d('0x9')](function(_0x3d2943){logger[_0x477d('0xa')](_0x477d('0x13'),_0x5d5553);logger[_0x477d('0x1b')]('UpdateVoiceRecording',_0x5d5553,JSON[_0x477d('0xe')](_0x3d2943));_0x1399d7(_0x3d2943);})['catch'](function(_0x239b56){logger[_0x477d('0xf')](_0x477d('0x13'),_0x239b56[_0x477d('0x11')],_0x5d5553);_0x159beb(_0x367965['error'](0x1f4,_0x239b56[_0x477d('0x11')]));});});};exports[_0x477d('0x1c')]=function(_0x1ca4fe){var _0x48ee5e=this;return new Promise(function(_0x585648,_0x198697){var _0x3c6270=require(_0x477d('0x1d'));var _0x5c8ef1;return db[_0x477d('0x1e')][_0x477d('0x1f')]({'attributes':['id',_0x477d('0x20')],'where':{'id':0x1},'raw':!![]})[_0x477d('0x9')](function(_0x37b332){_0x5c8ef1=_0x37b332;return db['VoiceRecording'][_0x477d('0x21')](_0x1ca4fe[_0x477d('0x16')]);})[_0x477d('0x9')](function(_0x25a329){if(_0x5c8ef1[_0x477d('0x20')]&&fs[_0x477d('0x22')](_0x25a329[_0x477d('0x23')])){var _0x98b5d9=util[_0x477d('0x24')](_0x477d('0x25'),_0x25a329[_0x477d('0x23')]);return _0x3c6270[_0x477d('0x26')](_0x25a329[_0x477d('0x23')],_0x98b5d9,config[_0x477d('0x27')][_0x477d('0x28')])[_0x477d('0x9')](function(){fs[_0x477d('0x29')](_0x25a329[_0x477d('0x23')]);logger[_0x477d('0xa')](_0x477d('0x2a'));return _0x25a329;});}return _0x25a329;})['then'](function(_0x304d25){logger['info'](_0x477d('0x1c'),_0x1ca4fe);logger[_0x477d('0x1b')](_0x477d('0x1c'),_0x1ca4fe,JSON['stringify'](_0x304d25));_0x585648(_0x304d25);})[_0x477d('0x12')](function(_0x1201a9){logger[_0x477d('0xf')](_0x477d('0x1c'),_0x1201a9[_0x477d('0x11')],_0x1ca4fe);_0x198697(_0x48ee5e[_0x477d('0xf')](0x1f4,_0x1201a9[_0x477d('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/index.js b/server/api/voiceTransferReport/index.js index 2e16a23..7c8a8c0 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 _0x2680=['path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceTransferReport.controller','get','isAuthenticated','index','/describe','show','post','create','put','update','delete','multer','util'];(function(_0x3e567c,_0x25548e){var _0x3219dd=function(_0x41a9fd){while(--_0x41a9fd){_0x3e567c['push'](_0x3e567c['shift']());}};_0x3219dd(++_0x25548e);}(_0x2680,0xbc));var _0x0268=function(_0x426d73,_0x21c5c5){_0x426d73=_0x426d73-0x0;var _0x56ed84=_0x2680[_0x426d73];return _0x56ed84;};'use strict';var multer=require(_0x0268('0x0'));var util=require(_0x0268('0x1'));var path=require(_0x0268('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0268('0x3')]();var fs_extra=require(_0x0268('0x4'));var auth=require(_0x0268('0x5'));var interaction=require(_0x0268('0x6'));var config=require(_0x0268('0x7'));var controller=require(_0x0268('0x8'));router[_0x0268('0x9')]('/',auth[_0x0268('0xa')](),controller[_0x0268('0xb')]);router[_0x0268('0x9')](_0x0268('0xc'),auth[_0x0268('0xa')](),controller['describe']);router[_0x0268('0x9')]('/:id',auth[_0x0268('0xa')](),controller[_0x0268('0xd')]);router[_0x0268('0xe')]('/',auth[_0x0268('0xa')](),controller[_0x0268('0xf')]);router[_0x0268('0x10')]('/:id',auth[_0x0268('0xa')](),controller[_0x0268('0x11')]);router[_0x0268('0x12')]('/:id',auth[_0x0268('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xae09=['/describe','describe','/:id','show','post','update','destroy','multer','util','express','Router','fs-extra','../../components/auth/service','../../config/environment','./voiceTransferReport.controller','get','isAuthenticated'];(function(_0x376b26,_0x17682a){var _0x4a5d36=function(_0x2f4018){while(--_0x2f4018){_0x376b26['push'](_0x376b26['shift']());}};_0x4a5d36(++_0x17682a);}(_0xae09,0x16c));var _0x9ae0=function(_0x2a61ba,_0x421a58){_0x2a61ba=_0x2a61ba-0x0;var _0x3bb658=_0xae09[_0x2a61ba];return _0x3bb658;};'use strict';var multer=require(_0x9ae0('0x0'));var util=require(_0x9ae0('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x9ae0('0x2'));var router=express[_0x9ae0('0x3')]();var fs_extra=require(_0x9ae0('0x4'));var auth=require(_0x9ae0('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x9ae0('0x6'));var controller=require(_0x9ae0('0x7'));router[_0x9ae0('0x8')]('/',auth[_0x9ae0('0x9')](),controller['index']);router[_0x9ae0('0x8')](_0x9ae0('0xa'),auth[_0x9ae0('0x9')](),controller[_0x9ae0('0xb')]);router[_0x9ae0('0x8')](_0x9ae0('0xc'),auth['isAuthenticated'](),controller[_0x9ae0('0xd')]);router[_0x9ae0('0xe')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x9ae0('0xc'),auth[_0x9ae0('0x9')](),controller[_0x9ae0('0xf')]);router['delete'](_0x9ae0('0xc'),auth[_0x9ae0('0x9')](),controller[_0x9ae0('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.attributes.js b/server/api/voiceTransferReport/voiceTransferReport.attributes.js index 6982bd9..f9215f8 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 _0x8758=['moment','ENUM','blind','attended','STRING','Yes','sequelize'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x8758,0x1b8));var _0x8875=function(_0x33c714,_0x25f8a4){_0x33c714=_0x33c714-0x0;var _0x1c929d=_0x8758[_0x33c714];return _0x1c929d;};'use strict';var Sequelize=require(_0x8875('0x0'));var moment=require(_0x8875('0x1'));module['exports']={'type':{'type':Sequelize[_0x8875('0x2')](_0x8875('0x3'),_0x8875('0x4'))},'result':{'type':Sequelize['STRING']},'transfererchannel':{'type':Sequelize[_0x8875('0x5')]},'transferercalleridnum':{'type':Sequelize[_0x8875('0x5')]},'transferercalleridname':{'type':Sequelize[_0x8875('0x5')]},'transfererconnectedlinenum':{'type':Sequelize[_0x8875('0x5')]},'transfererconnectedlinename':{'type':Sequelize[_0x8875('0x5')]},'transfereraccountcode':{'type':Sequelize['STRING']},'transferercontext':{'type':Sequelize['STRING']},'transfererexten':{'type':Sequelize[_0x8875('0x5')]},'transfererlinkedid':{'type':Sequelize['STRING']},'transfereechannel':{'type':Sequelize[_0x8875('0x5')]},'transfereecalleridnum':{'type':Sequelize[_0x8875('0x5')]},'transfereecalleridname':{'type':Sequelize['STRING']},'transfereeconnectedlinenum':{'type':Sequelize[_0x8875('0x5')]},'transfereeconnectedlinename':{'type':Sequelize[_0x8875('0x5')]},'transfereeaccountcode':{'type':Sequelize['STRING']},'transfereecontext':{'type':Sequelize[_0x8875('0x5')]},'transfereeexten':{'type':Sequelize['STRING']},'transfereelinkedid':{'type':Sequelize[_0x8875('0x5')]},'isexternal':{'type':Sequelize[_0x8875('0x2')](_0x8875('0x6'),'No')},'context':{'type':Sequelize[_0x8875('0x5')]},'extension':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xa0a9=['ENUM','blind','attended','STRING','Yes','sequelize'];(function(_0x32e649,_0x228649){var _0x14d386=function(_0x3fb3ed){while(--_0x3fb3ed){_0x32e649['push'](_0x32e649['shift']());}};_0x14d386(++_0x228649);}(_0xa0a9,0x65));var _0x9a0a=function(_0x3f990e,_0x15a472){_0x3f990e=_0x3f990e-0x0;var _0x46af91=_0xa0a9[_0x3f990e];return _0x46af91;};'use strict';var Sequelize=require(_0x9a0a('0x0'));var moment=require('moment');module['exports']={'type':{'type':Sequelize[_0x9a0a('0x1')](_0x9a0a('0x2'),_0x9a0a('0x3'))},'result':{'type':Sequelize[_0x9a0a('0x4')]},'transfererchannel':{'type':Sequelize[_0x9a0a('0x4')]},'transferercalleridnum':{'type':Sequelize[_0x9a0a('0x4')]},'transferercalleridname':{'type':Sequelize[_0x9a0a('0x4')]},'transfererconnectedlinenum':{'type':Sequelize[_0x9a0a('0x4')]},'transfererconnectedlinename':{'type':Sequelize[_0x9a0a('0x4')]},'transfereraccountcode':{'type':Sequelize[_0x9a0a('0x4')]},'transferercontext':{'type':Sequelize[_0x9a0a('0x4')]},'transfererexten':{'type':Sequelize['STRING']},'transfererlinkedid':{'type':Sequelize[_0x9a0a('0x4')]},'transfereechannel':{'type':Sequelize['STRING']},'transfereecalleridnum':{'type':Sequelize[_0x9a0a('0x4')]},'transfereecalleridname':{'type':Sequelize[_0x9a0a('0x4')]},'transfereeconnectedlinenum':{'type':Sequelize['STRING']},'transfereeconnectedlinename':{'type':Sequelize['STRING']},'transfereeaccountcode':{'type':Sequelize[_0x9a0a('0x4')]},'transfereecontext':{'type':Sequelize[_0x9a0a('0x4')]},'transfereeexten':{'type':Sequelize[_0x9a0a('0x4')]},'transfereelinkedid':{'type':Sequelize[_0x9a0a('0x4')]},'isexternal':{'type':Sequelize[_0x9a0a('0x1')](_0x9a0a('0x5'),'No')},'context':{'type':Sequelize[_0x9a0a('0x4')]},'extension':{'type':Sequelize[_0x9a0a('0x4')]}}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.controller.js b/server/api/voiceTransferReport/voiceTransferReport.controller.js index e7f79ea..416d18f 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 _0x84ec=['papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','count','limit','set','Content-Range','save','update','destroy','then','error','stack','name','index','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','fields','attributes','length','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','VoiceTransferReport','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x84ec,0x16b));var _0xc84e=function(_0x48a48f,_0x217fd1){_0x48a48f=_0x48a48f-0x0;var _0x3aa9f3=_0x84ec[_0x48a48f];return _0x3aa9f3;};'use strict';var emlformat=require(_0xc84e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc84e('0x1'));var jsonpatch=require(_0xc84e('0x2'));var rp=require(_0xc84e('0x3'));var moment=require('moment');var BPromise=require(_0xc84e('0x4'));var Mustache=require(_0xc84e('0x5'));var util=require(_0xc84e('0x6'));var path=require(_0xc84e('0x7'));var sox=require('sox');var csv=require(_0xc84e('0x8'));var ejs=require(_0xc84e('0x9'));var fs=require('fs');var fs_extra=require(_0xc84e('0xa'));var _=require(_0xc84e('0xb'));var squel=require(_0xc84e('0xc'));var crypto=require(_0xc84e('0xd'));var jsforce=require(_0xc84e('0xe'));var deskjs=require(_0xc84e('0xf'));var toCsv=require(_0xc84e('0x8'));var querystring=require(_0xc84e('0x10'));var Papa=require(_0xc84e('0x11'));var Redis=require(_0xc84e('0x12'));var authService=require(_0xc84e('0x13'));var qs=require(_0xc84e('0x14'));var as=require(_0xc84e('0x15'));var hardwareService=require(_0xc84e('0x16'));var logger=require(_0xc84e('0x17'))(_0xc84e('0x18'));var utils=require(_0xc84e('0x19'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xc84e('0x1a'))['db'];function respondWithStatusCode(_0x243745,_0x2b080c){_0x2b080c=_0x2b080c||0xcc;return function(_0x1bc6e3){if(_0x1bc6e3){return _0x243745[_0xc84e('0x1b')](_0x2b080c);}return _0x243745[_0xc84e('0x1c')](_0x2b080c)[_0xc84e('0x1d')]();};}function respondWithResult(_0x5c89ba,_0x32b2e0){_0x32b2e0=_0x32b2e0||0xc8;return function(_0x4ecced){if(_0x4ecced){return _0x5c89ba['status'](_0x32b2e0)[_0xc84e('0x1e')](_0x4ecced);}};}function respondWithFilteredResult(_0x3e1028,_0x58f680){return function(_0x357e91){if(_0x357e91){var _0x3f8793=typeof _0x58f680[_0xc84e('0x1f')]==='undefined'&&typeof _0x58f680['limit']==='undefined';var _0x43ff3d=_0x357e91[_0xc84e('0x20')];var _0x4ac007=_0x3f8793?0x0:_0x58f680[_0xc84e('0x1f')];var _0x1153ff=_0x3f8793?_0x357e91[_0xc84e('0x20')]:_0x58f680[_0xc84e('0x1f')]+_0x58f680[_0xc84e('0x21')];var _0x270e63;if(_0x1153ff>=_0x43ff3d){_0x1153ff=_0x43ff3d;_0x270e63=0xc8;}else{_0x270e63=0xce;}_0x3e1028[_0xc84e('0x1c')](_0x270e63);return _0x3e1028[_0xc84e('0x22')](_0xc84e('0x23'),_0x4ac007+'-'+_0x1153ff+'/'+_0x43ff3d)[_0xc84e('0x1e')](_0x357e91);}return null;};}function patchUpdates(_0x5e1df2){return function(_0x484fda){try{jsonpatch['apply'](_0x484fda,_0x5e1df2,!![]);}catch(_0x15f31a){return BPromise['reject'](_0x15f31a);}return _0x484fda[_0xc84e('0x24')]();};}function saveUpdates(_0x3af2a3,_0x3578bc){return function(_0x40c37f){if(_0x40c37f){return _0x40c37f[_0xc84e('0x25')](_0x3af2a3)['then'](function(_0x490cbd){return _0x490cbd;});}return null;};}function removeEntity(_0x502d60,_0x568d2f){return function(_0x3d1934){if(_0x3d1934){return _0x3d1934[_0xc84e('0x26')]()[_0xc84e('0x27')](function(){_0x502d60[_0xc84e('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x318183,_0x25ef40){return function(_0x696612){if(!_0x696612){_0x318183['sendStatus'](0x194);}return _0x696612;};}function handleError(_0x2f7a7e,_0x59a9f8){_0x59a9f8=_0x59a9f8||0x1f4;return function(_0x566830){logger[_0xc84e('0x28')](_0x566830[_0xc84e('0x29')]);if(_0x566830['name']){delete _0x566830[_0xc84e('0x2a')];}_0x2f7a7e[_0xc84e('0x1c')](_0x59a9f8)['send'](_0x566830);};}exports[_0xc84e('0x2b')]=function(_0x253617,_0x52256e){var _0x73b0b8={},_0xcbb5cf={},_0x417fe3={'count':0x0,'rows':[]};var _0x3c3049=_['map'](db['VoiceTransferReport'][_0xc84e('0x2c')],function(_0x409f14){return{'name':_0x409f14[_0xc84e('0x2d')],'type':_0x409f14[_0xc84e('0x2e')][_0xc84e('0x2f')]};});_0xcbb5cf[_0xc84e('0x30')]=_['map'](_0x3c3049,_0xc84e('0x2a'));_0xcbb5cf['query']=_[_0xc84e('0x31')](_0x253617['query']);_0xcbb5cf[_0xc84e('0x32')]=_[_0xc84e('0x33')](_0xcbb5cf[_0xc84e('0x30')],_0xcbb5cf[_0xc84e('0x34')]);_0x73b0b8['attributes']=_[_0xc84e('0x33')](_0xcbb5cf[_0xc84e('0x30')],qs['fields'](_0x253617['query'][_0xc84e('0x35')]));_0x73b0b8[_0xc84e('0x36')]=_0x73b0b8['attributes'][_0xc84e('0x37')]?_0x73b0b8[_0xc84e('0x36')]:_0xcbb5cf[_0xc84e('0x30')];if(!_0x253617['query']['hasOwnProperty'](_0xc84e('0x38'))){_0x73b0b8['limit']=qs[_0xc84e('0x21')](_0x253617[_0xc84e('0x34')][_0xc84e('0x21')]);_0x73b0b8['offset']=qs[_0xc84e('0x1f')](_0x253617[_0xc84e('0x34')][_0xc84e('0x1f')]);}_0x73b0b8['order']=qs[_0xc84e('0x39')](_0x253617[_0xc84e('0x34')][_0xc84e('0x39')]);_0x73b0b8[_0xc84e('0x3a')]=qs[_0xc84e('0x32')](_[_0xc84e('0x3b')](_0x253617[_0xc84e('0x34')],_0xcbb5cf[_0xc84e('0x32')]),_0x3c3049);if(_0x253617[_0xc84e('0x34')][_0xc84e('0x3c')]){_0x73b0b8[_0xc84e('0x3a')]=_[_0xc84e('0x3d')](_0x73b0b8['where'],{'$or':_['map'](_0x3c3049,function(_0x3deead){if(_0x3deead[_0xc84e('0x2e')]!==_0xc84e('0x3e')){var _0x1c5277={};_0x1c5277[_0x3deead[_0xc84e('0x2a')]]={'$like':'%'+_0x253617[_0xc84e('0x34')][_0xc84e('0x3c')]+'%'};return _0x1c5277;}})});}_0x73b0b8=_[_0xc84e('0x3d')]({},_0x73b0b8,_0x253617[_0xc84e('0x3f')]);var _0x244cb7={'where':_0x73b0b8[_0xc84e('0x3a')]};return db[_0xc84e('0x40')][_0xc84e('0x20')](_0x244cb7)[_0xc84e('0x27')](function(_0x572e64){_0x417fe3[_0xc84e('0x20')]=_0x572e64;if(_0x253617[_0xc84e('0x34')][_0xc84e('0x41')]){_0x73b0b8[_0xc84e('0x42')]=[{'all':!![]}];}return db[_0xc84e('0x40')][_0xc84e('0x43')](_0x73b0b8);})['then'](function(_0x264a91){_0x417fe3[_0xc84e('0x44')]=_0x264a91;return _0x417fe3;})['then'](respondWithFilteredResult(_0x52256e,_0x73b0b8))[_0xc84e('0x45')](handleError(_0x52256e,null));};exports[_0xc84e('0x46')]=function(_0x51e863,_0x4b7b3e){var _0x38dbb8={'raw':!![],'where':{'id':_0x51e863[_0xc84e('0x47')]['id']}},_0x1e69c4={};_0x1e69c4[_0xc84e('0x30')]=_[_0xc84e('0x31')](db[_0xc84e('0x40')][_0xc84e('0x2c')]);_0x1e69c4[_0xc84e('0x34')]=_[_0xc84e('0x31')](_0x51e863['query']);_0x1e69c4[_0xc84e('0x32')]=_[_0xc84e('0x33')](_0x1e69c4[_0xc84e('0x30')],_0x1e69c4[_0xc84e('0x34')]);_0x38dbb8[_0xc84e('0x36')]=_['intersection'](_0x1e69c4[_0xc84e('0x30')],qs[_0xc84e('0x35')](_0x51e863[_0xc84e('0x34')]['fields']));_0x38dbb8[_0xc84e('0x36')]=_0x38dbb8[_0xc84e('0x36')][_0xc84e('0x37')]?_0x38dbb8[_0xc84e('0x36')]:_0x1e69c4[_0xc84e('0x30')];if(_0x51e863['query']['includeAll']){_0x38dbb8[_0xc84e('0x42')]=[{'all':!![]}];}_0x38dbb8=_[_0xc84e('0x3d')]({},_0x38dbb8,_0x51e863['options']);return db[_0xc84e('0x40')][_0xc84e('0x48')](_0x38dbb8)['then'](handleEntityNotFound(_0x4b7b3e,null))[_0xc84e('0x27')](respondWithResult(_0x4b7b3e,null))['catch'](handleError(_0x4b7b3e,null));};exports[_0xc84e('0x49')]=function(_0x11cc39,_0x1383e3){return db[_0xc84e('0x40')][_0xc84e('0x49')](_0x11cc39[_0xc84e('0x4a')],{})['then'](respondWithResult(_0x1383e3,0xc9))[_0xc84e('0x45')](handleError(_0x1383e3,null));};exports['update']=function(_0x5c3283,_0xbadaca){if(_0x5c3283[_0xc84e('0x4a')]['id']){delete _0x5c3283[_0xc84e('0x4a')]['id'];}return db[_0xc84e('0x40')][_0xc84e('0x48')]({'where':{'id':_0x5c3283[_0xc84e('0x47')]['id']}})[_0xc84e('0x27')](handleEntityNotFound(_0xbadaca,null))[_0xc84e('0x27')](saveUpdates(_0x5c3283[_0xc84e('0x4a')],null))[_0xc84e('0x27')](respondWithResult(_0xbadaca,null))[_0xc84e('0x45')](handleError(_0xbadaca,null));};exports[_0xc84e('0x26')]=function(_0xb4b783,_0x445a5b){return db[_0xc84e('0x40')][_0xc84e('0x48')]({'where':{'id':_0xb4b783['params']['id']}})[_0xc84e('0x27')](handleEntityNotFound(_0x445a5b,null))[_0xc84e('0x27')](removeEntity(_0x445a5b,null))[_0xc84e('0x45')](handleError(_0x445a5b,null));};exports['describe']=function(_0x1b0a86,_0x1a9eee){return db['VoiceTransferReport'][_0xc84e('0x4b')]()[_0xc84e('0x27')](respondWithResult(_0x1a9eee,null))[_0xc84e('0x45')](handleError(_0x1a9eee,null));}; \ No newline at end of file +var _0x39a0=['sendStatus','error','stack','name','index','map','VoiceTransferReport','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','params','find','create','body','describe','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','sox','fs-extra','lodash','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','json','offset','undefined','limit','count','set','apply','reject','save','update','then','end'];(function(_0x29380b,_0x1057cd){var _0x2a74a4=function(_0x43ee74){while(--_0x43ee74){_0x29380b['push'](_0x29380b['shift']());}};_0x2a74a4(++_0x1057cd);}(_0x39a0,0x1e9));var _0x039a=function(_0x103e3c,_0x417302){_0x103e3c=_0x103e3c-0x0;var _0x47948a=_0x39a0[_0x103e3c];return _0x47948a;};'use strict';var emlformat=require(_0x039a('0x0'));var rimraf=require(_0x039a('0x1'));var zipdir=require(_0x039a('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x039a('0x3'));var BPromise=require(_0x039a('0x4'));var Mustache=require(_0x039a('0x5'));var util=require(_0x039a('0x6'));var path=require('path');var sox=require(_0x039a('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x039a('0x8'));var _=require(_0x039a('0x9'));var squel=require('squel');var crypto=require(_0x039a('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x039a('0xb'));var toCsv=require('to-csv');var querystring=require(_0x039a('0xc'));var Papa=require(_0x039a('0xd'));var Redis=require('ioredis');var authService=require(_0x039a('0xe'));var qs=require(_0x039a('0xf'));var as=require(_0x039a('0x10'));var hardwareService=require(_0x039a('0x11'));var logger=require(_0x039a('0x12'))(_0x039a('0x13'));var utils=require(_0x039a('0x14'));var config=require(_0x039a('0x15'));var licenseUtil=require(_0x039a('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x496006,_0x51a96){_0x51a96=_0x51a96||0xcc;return function(_0x602eb6){if(_0x602eb6){return _0x496006['sendStatus'](_0x51a96);}return _0x496006[_0x039a('0x17')](_0x51a96)['end']();};}function respondWithResult(_0xd9c1,_0x2789a1){_0x2789a1=_0x2789a1||0xc8;return function(_0x581bcc){if(_0x581bcc){return _0xd9c1['status'](_0x2789a1)[_0x039a('0x18')](_0x581bcc);}};}function respondWithFilteredResult(_0xfc2a9a,_0x49181b){return function(_0x59f1a4){if(_0x59f1a4){var _0x2fe56e=typeof _0x49181b[_0x039a('0x19')]===_0x039a('0x1a')&&typeof _0x49181b[_0x039a('0x1b')]===_0x039a('0x1a');var _0xb13d60=_0x59f1a4[_0x039a('0x1c')];var _0x4416b7=_0x2fe56e?0x0:_0x49181b[_0x039a('0x19')];var _0x36f9cf=_0x2fe56e?_0x59f1a4[_0x039a('0x1c')]:_0x49181b[_0x039a('0x19')]+_0x49181b[_0x039a('0x1b')];var _0x3394d1;if(_0x36f9cf>=_0xb13d60){_0x36f9cf=_0xb13d60;_0x3394d1=0xc8;}else{_0x3394d1=0xce;}_0xfc2a9a[_0x039a('0x17')](_0x3394d1);return _0xfc2a9a[_0x039a('0x1d')]('Content-Range',_0x4416b7+'-'+_0x36f9cf+'/'+_0xb13d60)['json'](_0x59f1a4);}return null;};}function patchUpdates(_0x307429){return function(_0x13afdd){try{jsonpatch[_0x039a('0x1e')](_0x13afdd,_0x307429,!![]);}catch(_0x302f30){return BPromise[_0x039a('0x1f')](_0x302f30);}return _0x13afdd[_0x039a('0x20')]();};}function saveUpdates(_0x4423a2,_0x5ef53d){return function(_0x442316){if(_0x442316){return _0x442316[_0x039a('0x21')](_0x4423a2)[_0x039a('0x22')](function(_0x40b1ba){return _0x40b1ba;});}return null;};}function removeEntity(_0x1affb9,_0x25b945){return function(_0x5791c9){if(_0x5791c9){return _0x5791c9['destroy']()[_0x039a('0x22')](function(){_0x1affb9[_0x039a('0x17')](0xcc)[_0x039a('0x23')]();});}};}function handleEntityNotFound(_0x308ba6,_0xdd2a25){return function(_0x21b875){if(!_0x21b875){_0x308ba6[_0x039a('0x24')](0x194);}return _0x21b875;};}function handleError(_0x3c9e2c,_0x3789bc){_0x3789bc=_0x3789bc||0x1f4;return function(_0x461868){logger[_0x039a('0x25')](_0x461868[_0x039a('0x26')]);if(_0x461868[_0x039a('0x27')]){delete _0x461868[_0x039a('0x27')];}_0x3c9e2c[_0x039a('0x17')](_0x3789bc)['send'](_0x461868);};}exports[_0x039a('0x28')]=function(_0x594989,_0x3bd347){var _0x11b5e4={},_0x145c4e={},_0x4f6f45={'count':0x0,'rows':[]};var _0x5cbddb=_[_0x039a('0x29')](db[_0x039a('0x2a')][_0x039a('0x2b')],function(_0x560309){return{'name':_0x560309[_0x039a('0x2c')],'type':_0x560309[_0x039a('0x2d')][_0x039a('0x2e')]};});_0x145c4e['model']=_['map'](_0x5cbddb,_0x039a('0x27'));_0x145c4e[_0x039a('0x2f')]=_[_0x039a('0x30')](_0x594989[_0x039a('0x2f')]);_0x145c4e[_0x039a('0x31')]=_[_0x039a('0x32')](_0x145c4e[_0x039a('0x33')],_0x145c4e[_0x039a('0x2f')]);_0x11b5e4['attributes']=_[_0x039a('0x32')](_0x145c4e[_0x039a('0x33')],qs[_0x039a('0x34')](_0x594989[_0x039a('0x2f')]['fields']));_0x11b5e4[_0x039a('0x35')]=_0x11b5e4[_0x039a('0x35')][_0x039a('0x36')]?_0x11b5e4[_0x039a('0x35')]:_0x145c4e[_0x039a('0x33')];if(!_0x594989['query'][_0x039a('0x37')](_0x039a('0x38'))){_0x11b5e4[_0x039a('0x1b')]=qs['limit'](_0x594989['query']['limit']);_0x11b5e4[_0x039a('0x19')]=qs[_0x039a('0x19')](_0x594989['query'][_0x039a('0x19')]);}_0x11b5e4[_0x039a('0x39')]=qs[_0x039a('0x3a')](_0x594989[_0x039a('0x2f')][_0x039a('0x3a')]);_0x11b5e4['where']=qs[_0x039a('0x31')](_[_0x039a('0x3b')](_0x594989['query'],_0x145c4e['filters']),_0x5cbddb);if(_0x594989[_0x039a('0x2f')][_0x039a('0x3c')]){_0x11b5e4[_0x039a('0x3d')]=_['merge'](_0x11b5e4[_0x039a('0x3d')],{'$or':_['map'](_0x5cbddb,function(_0x18d988){if(_0x18d988['type']!==_0x039a('0x3e')){var _0x4ca93a={};_0x4ca93a[_0x18d988['name']]={'$like':'%'+_0x594989[_0x039a('0x2f')][_0x039a('0x3c')]+'%'};return _0x4ca93a;}})});}_0x11b5e4=_[_0x039a('0x3f')]({},_0x11b5e4,_0x594989[_0x039a('0x40')]);var _0x52d5c5={'where':_0x11b5e4['where']};return db[_0x039a('0x2a')][_0x039a('0x1c')](_0x52d5c5)[_0x039a('0x22')](function(_0x3d217b){_0x4f6f45[_0x039a('0x1c')]=_0x3d217b;if(_0x594989['query'][_0x039a('0x41')]){_0x11b5e4[_0x039a('0x42')]=[{'all':!![]}];}return db[_0x039a('0x2a')][_0x039a('0x43')](_0x11b5e4);})[_0x039a('0x22')](function(_0x4f648f){_0x4f6f45[_0x039a('0x44')]=_0x4f648f;return _0x4f6f45;})[_0x039a('0x22')](respondWithFilteredResult(_0x3bd347,_0x11b5e4))[_0x039a('0x45')](handleError(_0x3bd347,null));};exports['show']=function(_0x24e60f,_0x14f712){var _0x1a2632={'raw':!![],'where':{'id':_0x24e60f[_0x039a('0x46')]['id']}},_0x50b890={};_0x50b890[_0x039a('0x33')]=_[_0x039a('0x30')](db[_0x039a('0x2a')][_0x039a('0x2b')]);_0x50b890[_0x039a('0x2f')]=_['keys'](_0x24e60f[_0x039a('0x2f')]);_0x50b890[_0x039a('0x31')]=_[_0x039a('0x32')](_0x50b890[_0x039a('0x33')],_0x50b890[_0x039a('0x2f')]);_0x1a2632[_0x039a('0x35')]=_['intersection'](_0x50b890[_0x039a('0x33')],qs[_0x039a('0x34')](_0x24e60f[_0x039a('0x2f')][_0x039a('0x34')]));_0x1a2632['attributes']=_0x1a2632[_0x039a('0x35')][_0x039a('0x36')]?_0x1a2632[_0x039a('0x35')]:_0x50b890[_0x039a('0x33')];if(_0x24e60f['query']['includeAll']){_0x1a2632['include']=[{'all':!![]}];}_0x1a2632=_[_0x039a('0x3f')]({},_0x1a2632,_0x24e60f[_0x039a('0x40')]);return db[_0x039a('0x2a')][_0x039a('0x47')](_0x1a2632)[_0x039a('0x22')](handleEntityNotFound(_0x14f712,null))[_0x039a('0x22')](respondWithResult(_0x14f712,null))['catch'](handleError(_0x14f712,null));};exports[_0x039a('0x48')]=function(_0x35ad82,_0x38be93){return db[_0x039a('0x2a')][_0x039a('0x48')](_0x35ad82[_0x039a('0x49')],{})[_0x039a('0x22')](respondWithResult(_0x38be93,0xc9))['catch'](handleError(_0x38be93,null));};exports[_0x039a('0x21')]=function(_0x43f37a,_0x467db0){if(_0x43f37a[_0x039a('0x49')]['id']){delete _0x43f37a['body']['id'];}return db['VoiceTransferReport'][_0x039a('0x47')]({'where':{'id':_0x43f37a[_0x039a('0x46')]['id']}})['then'](handleEntityNotFound(_0x467db0,null))[_0x039a('0x22')](saveUpdates(_0x43f37a['body'],null))[_0x039a('0x22')](respondWithResult(_0x467db0,null))[_0x039a('0x45')](handleError(_0x467db0,null));};exports['destroy']=function(_0xea531f,_0x322c7b){return db[_0x039a('0x2a')][_0x039a('0x47')]({'where':{'id':_0xea531f[_0x039a('0x46')]['id']}})[_0x039a('0x22')](handleEntityNotFound(_0x322c7b,null))['then'](removeEntity(_0x322c7b,null))['catch'](handleError(_0x322c7b,null));};exports['describe']=function(_0x267ef2,_0x527ff6){return db[_0x039a('0x2a')][_0x039a('0x4a')]()['then'](respondWithResult(_0x527ff6,null))[_0x039a('0x45')](handleError(_0x527ff6,null));}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.model.js b/server/api/voiceTransferReport/voiceTransferReport.model.js index 74f933a..c0daea9 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 _0x2dc2=['moment','request-promise','rimraf','../../config/environment','exports','VoiceTransferReport','report_call_transfer','lodash','util','api'];(function(_0x31b151,_0x42fc2a){var _0x325470=function(_0x2127b2){while(--_0x2127b2){_0x31b151['push'](_0x31b151['shift']());}};_0x325470(++_0x42fc2a);}(_0x2dc2,0x15b));var _0x22dc=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0x2dc2[_0x56482c];return _0x5aae7a;};'use strict';var _=require(_0x22dc('0x0'));var util=require(_0x22dc('0x1'));var logger=require('../../config/logger')(_0x22dc('0x2'));var moment=require(_0x22dc('0x3'));var BPromise=require('bluebird');var rp=require(_0x22dc('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x22dc('0x5'));var config=require(_0x22dc('0x6'));var attributes=require('./voiceTransferReport.attributes');module[_0x22dc('0x7')]=function(_0x5f8426,_0x1bc9ff){return _0x5f8426['define'](_0x22dc('0x8'),attributes,{'tableName':_0x22dc('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x82c2=['path','rimraf','../../config/environment','./voiceTransferReport.attributes','VoiceTransferReport','lodash','util','../../config/logger','api','request-promise'];(function(_0x5eb4e1,_0x4ed3e3){var _0x4a5254=function(_0x4dab48){while(--_0x4dab48){_0x5eb4e1['push'](_0x5eb4e1['shift']());}};_0x4a5254(++_0x4ed3e3);}(_0x82c2,0x181));var _0x282c=function(_0x336c8b,_0x56b55b){_0x336c8b=_0x336c8b-0x0;var _0x4dd2f6=_0x82c2[_0x336c8b];return _0x4dd2f6;};'use strict';var _=require(_0x282c('0x0'));var util=require(_0x282c('0x1'));var logger=require(_0x282c('0x2'))(_0x282c('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x282c('0x4'));var fs=require('fs');var path=require(_0x282c('0x5'));var rimraf=require(_0x282c('0x6'));var config=require(_0x282c('0x7'));var attributes=require(_0x282c('0x8'));module['exports']=function(_0x48e8ec,_0x3f8a43){return _0x48e8ec['define'](_0x282c('0x9'),attributes,{'tableName':'report_call_transfer','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.rpc.js b/server/api/voiceTransferReport/voiceTransferReport.rpc.js index 8c71d94..4ed23b1 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 _0x10bb=['client','http','request','then','VoiceTransferReport,\x20%s,\x20%s','request\x20sent','debug','VoiceTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','CreateVoiceTransferReport','VoiceTransferReport','create','body','options','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/environment','jayson/promise'];(function(_0x1f4811,_0x53abb2){var _0x28b51a=function(_0x34ad4a){while(--_0x34ad4a){_0x1f4811['push'](_0x1f4811['shift']());}};_0x28b51a(++_0x53abb2);}(_0x10bb,0x19c));var _0xb10b=function(_0xfa0c3d,_0x8bb6ed){_0xfa0c3d=_0xfa0c3d-0x0;var _0x2f972b=_0x10bb[_0xfa0c3d];return _0x2f972b;};'use strict';var _=require(_0xb10b('0x0'));var util=require(_0xb10b('0x1'));var moment=require(_0xb10b('0x2'));var BPromise=require(_0xb10b('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb10b('0x4'))['db'];var utils=require(_0xb10b('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0xb10b('0x6'));var jayson=require(_0xb10b('0x7'));var client=jayson[_0xb10b('0x8')][_0xb10b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2310ed,_0x25c064,_0x1c7c4b){return new BPromise(function(_0x35e552,_0x3457e0){return client[_0xb10b('0xa')](_0x2310ed,_0x1c7c4b)[_0xb10b('0xb')](function(_0x3d0cc6){logger['info'](_0xb10b('0xc'),_0x25c064,_0xb10b('0xd'));logger[_0xb10b('0xe')](_0xb10b('0xf'),_0x25c064,'request\x20sent',JSON[_0xb10b('0x10')](_0x3d0cc6));if(_0x3d0cc6[_0xb10b('0x11')]){if(_0x3d0cc6[_0xb10b('0x11')][_0xb10b('0x12')]===0x1f4){logger['error']('VoiceTransferReport,\x20%s,\x20%s',_0x25c064,_0x3d0cc6[_0xb10b('0x11')][_0xb10b('0x13')]);return _0x3457e0(_0x3d0cc6['error'][_0xb10b('0x13')]);}logger[_0xb10b('0x11')](_0xb10b('0xc'),_0x25c064,_0x3d0cc6['error'][_0xb10b('0x13')]);return _0x35e552(_0x3d0cc6[_0xb10b('0x11')][_0xb10b('0x13')]);}else{logger[_0xb10b('0x14')](_0xb10b('0xc'),_0x25c064,_0xb10b('0xd'));_0x35e552(_0x3d0cc6[_0xb10b('0x15')]['message']);}})[_0xb10b('0x16')](function(_0x605b31){logger[_0xb10b('0x11')](_0xb10b('0xc'),_0x25c064,_0x605b31);_0x3457e0(_0x605b31);});});}exports[_0xb10b('0x17')]=function(_0x35086d){var _0x43660c=this;return new Promise(function(_0x3b80ee,_0x8f91cd){return db[_0xb10b('0x18')][_0xb10b('0x19')](_0x35086d[_0xb10b('0x1a')],{'raw':_0x35086d[_0xb10b('0x1b')]?_0x35086d[_0xb10b('0x1b')]['raw']===undefined?!![]:![]:!![]})[_0xb10b('0xb')](function(_0x5d7b4d){logger[_0xb10b('0x14')]('CreateVoiceTransferReport',_0x35086d);logger['debug'](_0xb10b('0x17'),_0x35086d,JSON['stringify'](_0x5d7b4d));_0x3b80ee(_0x5d7b4d);})[_0xb10b('0x16')](function(_0x5b3859){logger[_0xb10b('0x11')]('CreateVoiceTransferReport',_0x5b3859[_0xb10b('0x13')],_0x35086d);_0x8f91cd(_0x43660c[_0xb10b('0x11')](0x1f4,_0x5b3859[_0xb10b('0x13')]));});});}; \ No newline at end of file +var _0x8254=['stringify','error','code','message','VoiceTransferReport,\x20%s,\x20%s','catch','create','body','options','raw','CreateVoiceTransferReport','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','VoiceTransferReport,\x20%s,\x20%s,\x20%s'];(function(_0x3c683a,_0x22496d){var _0x3bb948=function(_0x21d22c){while(--_0x21d22c){_0x3c683a['push'](_0x3c683a['shift']());}};_0x3bb948(++_0x22496d);}(_0x8254,0x167));var _0x4825=function(_0x109eb3,_0x3da78f){_0x109eb3=_0x109eb3-0x0;var _0x5971d3=_0x8254[_0x109eb3];return _0x5971d3;};'use strict';var _=require(_0x4825('0x0'));var util=require(_0x4825('0x1'));var moment=require(_0x4825('0x2'));var BPromise=require(_0x4825('0x3'));var rs=require(_0x4825('0x4'));var fs=require('fs');var Redis=require(_0x4825('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x4825('0x6'))(_0x4825('0x7'));var config=require(_0x4825('0x8'));var jayson=require(_0x4825('0x9'));var client=jayson[_0x4825('0xa')][_0x4825('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x434c09,_0x8f1813,_0x481178){return new BPromise(function(_0x2ed958,_0x2e8557){return client[_0x4825('0xc')](_0x434c09,_0x481178)[_0x4825('0xd')](function(_0x15daf3){logger[_0x4825('0xe')]('VoiceTransferReport,\x20%s,\x20%s',_0x8f1813,_0x4825('0xf'));logger[_0x4825('0x10')](_0x4825('0x11'),_0x8f1813,_0x4825('0xf'),JSON[_0x4825('0x12')](_0x15daf3));if(_0x15daf3[_0x4825('0x13')]){if(_0x15daf3['error'][_0x4825('0x14')]===0x1f4){logger[_0x4825('0x13')]('VoiceTransferReport,\x20%s,\x20%s',_0x8f1813,_0x15daf3['error'][_0x4825('0x15')]);return _0x2e8557(_0x15daf3[_0x4825('0x13')][_0x4825('0x15')]);}logger['error'](_0x4825('0x16'),_0x8f1813,_0x15daf3[_0x4825('0x13')]['message']);return _0x2ed958(_0x15daf3[_0x4825('0x13')]['message']);}else{logger[_0x4825('0xe')](_0x4825('0x16'),_0x8f1813,_0x4825('0xf'));_0x2ed958(_0x15daf3['result'][_0x4825('0x15')]);}})[_0x4825('0x17')](function(_0x14eff0){logger[_0x4825('0x13')](_0x4825('0x16'),_0x8f1813,_0x14eff0);_0x2e8557(_0x14eff0);});});}exports['CreateVoiceTransferReport']=function(_0x5260f6){var _0x2a8c89=this;return new Promise(function(_0x10e202,_0xe56cb1){return db['VoiceTransferReport'][_0x4825('0x18')](_0x5260f6[_0x4825('0x19')],{'raw':_0x5260f6[_0x4825('0x1a')]?_0x5260f6[_0x4825('0x1a')][_0x4825('0x1b')]===undefined?!![]:![]:!![]})[_0x4825('0xd')](function(_0x1e24df){logger[_0x4825('0xe')](_0x4825('0x1c'),_0x5260f6);logger[_0x4825('0x10')](_0x4825('0x1c'),_0x5260f6,JSON[_0x4825('0x12')](_0x1e24df));_0x10e202(_0x1e24df);})[_0x4825('0x17')](function(_0x48c9ee){logger[_0x4825('0x13')](_0x4825('0x1c'),_0x48c9ee[_0x4825('0x15')],_0x5260f6);_0xe56cb1(_0x2a8c89[_0x4825('0x13')](0x1f4,_0x48c9ee[_0x4825('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/webbar/index.js b/server/api/webbar/index.js index 0755e20..1f6725a 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 _0x153f=['hold','/unhold','unhold','calls','/transfer','transfer','exports','express','Router','../../components/auth/service','./webbar.controller','post','/originate','isAuthenticated','originate','/hangup','isWebrtcLicence','hangup','answer','/hold'];(function(_0x126989,_0xbcd410){var _0x2a4534=function(_0x3f2228){while(--_0x3f2228){_0x126989['push'](_0x126989['shift']());}};_0x2a4534(++_0xbcd410);}(_0x153f,0x15b));var _0xf153=function(_0x150e1b,_0x405b77){_0x150e1b=_0x150e1b-0x0;var _0x1e04dc=_0x153f[_0x150e1b];return _0x1e04dc;};'use strict';var express=require(_0xf153('0x0'));var router=express[_0xf153('0x1')]();var auth=require(_0xf153('0x2'));var controller=require(_0xf153('0x3'));router[_0xf153('0x4')](_0xf153('0x5'),auth[_0xf153('0x6')](),auth['isWebrtcLicence'](),controller[_0xf153('0x7')]);router['post'](_0xf153('0x8'),auth[_0xf153('0x6')](),auth[_0xf153('0x9')](),controller[_0xf153('0xa')]);router[_0xf153('0x4')]('/answer',auth[_0xf153('0x6')](),auth[_0xf153('0x9')](),controller[_0xf153('0xb')]);router[_0xf153('0x4')](_0xf153('0xc'),auth[_0xf153('0x6')](),auth[_0xf153('0x9')](),controller[_0xf153('0xd')]);router[_0xf153('0x4')](_0xf153('0xe'),auth['isAuthenticated'](),auth[_0xf153('0x9')](),controller[_0xf153('0xf')]);router[_0xf153('0x4')]('/calls',auth[_0xf153('0x6')](),auth[_0xf153('0x9')](),controller[_0xf153('0x10')]);router[_0xf153('0x4')](_0xf153('0x11'),auth[_0xf153('0x6')](),auth[_0xf153('0x9')](),controller[_0xf153('0x12')]);module[_0xf153('0x13')]=router; \ No newline at end of file +var _0xbec5=['exports','express','Router','./webbar.controller','post','/originate','isAuthenticated','isWebrtcLicence','/hangup','hangup','/answer','answer','/hold','/unhold','unhold','/calls','calls','/transfer','transfer'];(function(_0x274df3,_0x2cd03d){var _0x1480bf=function(_0x23aea4){while(--_0x23aea4){_0x274df3['push'](_0x274df3['shift']());}};_0x1480bf(++_0x2cd03d);}(_0xbec5,0xe5));var _0x5bec=function(_0x5d2803,_0xf375bd){_0x5d2803=_0x5d2803-0x0;var _0xdcad2c=_0xbec5[_0x5d2803];return _0xdcad2c;};'use strict';var express=require(_0x5bec('0x0'));var router=express[_0x5bec('0x1')]();var auth=require('../../components/auth/service');var controller=require(_0x5bec('0x2'));router[_0x5bec('0x3')](_0x5bec('0x4'),auth[_0x5bec('0x5')](),auth[_0x5bec('0x6')](),controller['originate']);router[_0x5bec('0x3')](_0x5bec('0x7'),auth[_0x5bec('0x5')](),auth['isWebrtcLicence'](),controller[_0x5bec('0x8')]);router[_0x5bec('0x3')](_0x5bec('0x9'),auth[_0x5bec('0x5')](),auth[_0x5bec('0x6')](),controller[_0x5bec('0xa')]);router[_0x5bec('0x3')](_0x5bec('0xb'),auth['isAuthenticated'](),auth[_0x5bec('0x6')](),controller['hold']);router[_0x5bec('0x3')](_0x5bec('0xc'),auth[_0x5bec('0x5')](),auth['isWebrtcLicence'](),controller[_0x5bec('0xd')]);router[_0x5bec('0x3')](_0x5bec('0xe'),auth['isAuthenticated'](),auth[_0x5bec('0x6')](),controller[_0x5bec('0xf')]);router['post'](_0x5bec('0x10'),auth[_0x5bec('0x5')](),auth[_0x5bec('0x6')](),controller[_0x5bec('0x11')]);module[_0x5bec('0x12')]=router; \ No newline at end of file diff --git a/server/api/webbar/webbar.controller.js b/server/api/webbar/webbar.controller.js index fd96f8a..a04d87f 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 _0x5636=['then','error','message','result','findOne','agent','VoiceChannels','all','rows','UserId','sessionId','length','sessionId\x20','\x20not\x20found!','originate','originate\x20fired:','body','userId','callNumber','callerId','callbackUrl','entityFound:','user:%s','json','originate\x20executed!','catch','hangup','info','format','answer','answer\x20fired:','webbar:answer','answer\x20executed!','webbar:hold','unhold\x20executed!','calls','calls\x20fired:','filter','conference\x20fired:','webbar:conference','conference\x20executed!','transfer','transfer\x20fired:','webbar:transfer','transfer\x20executed!','path','lodash','bluebird','jayson/promise','client','../../config/logger','webbarapi','ioredis','redis','defaults','localhost','socket.io-emitter','validate','number','userId\x20is\x20required','string','sessionId\x20is\x20required','transferNumber\x20is\x20required','stringify','log','stack','name','status','send','NotFound','request'];(function(_0x5e6bec,_0x1eb54d){var _0x5dc5cf=function(_0x59429a){while(--_0x59429a){_0x5e6bec['push'](_0x5e6bec['shift']());}};_0x5dc5cf(++_0x1eb54d);}(_0x5636,0x102));var _0x6563=function(_0x4aa153,_0x565cf6){_0x4aa153=_0x4aa153-0x0;var _0x1e9a33=_0x5636[_0x4aa153];return _0x1e9a33;};'use strict';var path=require(_0x6563('0x0'));var fs=require('fs');var _=require(_0x6563('0x1'));var db=require('../../mysqldb')['db'];var config=require('../../config/environment');var util=require('util');var BPromise=require(_0x6563('0x2'));var jayson=require(_0x6563('0x3'));var amiClient=jayson[_0x6563('0x4')]['http']({'port':0x232a});var logger=require(_0x6563('0x5'))(_0x6563('0x6'));var Redis=require(_0x6563('0x7'));config[_0x6563('0x8')]=_[_0x6563('0x9')](config[_0x6563('0x8')],{'host':_0x6563('0xa'),'port':0x18eb});var io=require(_0x6563('0xb'))(new Redis(config[_0x6563('0x8')]));var Schema=require(_0x6563('0xc'));var originateValidation=new Schema({'userId':{'type':_0x6563('0xd'),'required':[!![],_0x6563('0xe')]},'callNumber':{'type':_0x6563('0xf'),'required':[!![],'callNumber\x20is\x20required']},'callerId':{'type':'string'},'callbackUrl':{'type':_0x6563('0xf')}});var hangupValidation=new Schema({'userId':{'type':_0x6563('0xd'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':'string','required':![]}});var answerValidation=new Schema({'userId':{'type':'number','required':[!![],_0x6563('0xe')]},'sessionId':{'type':_0x6563('0xf'),'required':![]}});var transferValidation=new Schema({'userId':{'type':_0x6563('0xd'),'required':[!![],_0x6563('0xe')]},'sessionId':{'type':_0x6563('0xf'),'required':[!![],_0x6563('0x10')]},'transferNumber':{'type':_0x6563('0xf'),'required':[!![],_0x6563('0x11')]}});var holdValidation=new Schema({'userId':{'type':_0x6563('0xd'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0x6563('0xf'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':'number','required':[!![],_0x6563('0xe')]},'sessionId':{'type':_0x6563('0xf'),'required':![]}});var callsValidation=new Schema({'userId':{'type':_0x6563('0xd'),'required':[!![],_0x6563('0xe')]}});var conferenceValidation=new Schema({'userId':{'type':'number','required':[!![],_0x6563('0xe')]}});function emit(_0x11baa2,_0x477d9b,_0xd398ce){logger['info'](_0x11baa2,_0x477d9b,JSON[_0x6563('0x12')](_0xd398ce));io['to'](_0x11baa2)['emit'](_0x477d9b,_0xd398ce);}function handleError(_0x502694){return function(_0x47972a){console[_0x6563('0x13')]('handleError:',_0x47972a,_0x47972a instanceof RangeError);logger['error'](_0x47972a[_0x6563('0x14')]);if(_0x47972a instanceof RangeError){if(_0x47972a[_0x6563('0x15')]){delete _0x47972a[_0x6563('0x15')];}_0x502694[_0x6563('0x16')](0x194)[_0x6563('0x17')](_0x47972a);}else{if(_0x47972a[_0x6563('0x15')]){delete _0x47972a[_0x6563('0x15')];}_0x502694[_0x6563('0x16')](0x1f4)[_0x6563('0x17')](_0x47972a);}};}function checkError(){return function(_0x5bf608){if(!_0x5bf608){throw new RangeError(_0x6563('0x18'));}return _0x5bf608;};}function respondWithRpcPromise(_0x9c3da7,_0x20b478){return new BPromise(function(_0x5a335c,_0x293db2){var _0x5c37bb=amiClient;return _0x5c37bb[_0x6563('0x19')](_0x9c3da7,_0x20b478)[_0x6563('0x1a')](function(_0x5610b0){if(_0x5610b0['error']){if(_0x5610b0[_0x6563('0x1b')]['code']===0x1f4){return _0x293db2(_0x5610b0[_0x6563('0x1b')][_0x6563('0x1c')]);}return _0x5a335c(_0x5610b0[_0x6563('0x1b')]['message']);}else{_0x5a335c(_0x5610b0[_0x6563('0x1d')]);}})['catch'](function(_0x7ea857){_0x293db2(_0x7ea857);});});}function getAgent(_0x1590e6){return db['User'][_0x6563('0x1e')]({'where':{'id':_0x1590e6,'role':_0x6563('0x1f')}})['then'](checkError());}function getAgentCheckSession(_0x2ddb2b,_0x5b03a7){return new BPromise(function(_0x1fe1cb,_0x4fbb20){var _0x480408=respondWithRpcPromise(_0x6563('0x20'));var _0x118d31=getAgent(_0x2ddb2b);Promise[_0x6563('0x21')]([_0x480408,_0x118d31])[_0x6563('0x1a')](function(_0x3eb23b){var _0x4b4d3b=_0x3eb23b[0x0];var _0x3c8bd1=_0x3eb23b[0x1];var _0x4f275c=_['filter'](_0x4b4d3b[_0x6563('0x22')],function(_0x35af37){return _0x35af37[_0x6563('0x23')]==_0x3c8bd1['id']&&_0x35af37[_0x6563('0x24')]==_0x5b03a7;});if(_0x4f275c[_0x6563('0x25')]==0x1){_0x1fe1cb(_0x3c8bd1);}else{_0x4fbb20(new RangeError(_0x6563('0x26')+_0x5b03a7+_0x6563('0x27')));}});});}exports[_0x6563('0x28')]=function(_0x101b24,_0x246d53){logger['info'](_0x6563('0x29'),_0x101b24[_0x6563('0x2a')]);var _0x29fb9d=originateValidation[_0x6563('0xc')](_0x101b24[_0x6563('0x2a')]);if(_0x29fb9d[_0x6563('0x25')]>0x0){return _0x246d53[_0x6563('0x16')](0x190)['json'](_0x29fb9d);}var _0x8cf1=_0x101b24[_0x6563('0x2a')][_0x6563('0x2b')];var _0x46fb1b=_0x101b24[_0x6563('0x2a')][_0x6563('0x2c')];var _0x574a35=_0x101b24[_0x6563('0x2a')][_0x6563('0x2d')];var _0x26c24b=_0x101b24[_0x6563('0x2a')][_0x6563('0x2e')];return getAgent(_0x8cf1)[_0x6563('0x1a')](function(_0x3f578a){logger['info'](_0x6563('0x2f'),_0x3f578a[_0x6563('0x15')]);emit(util['format'](_0x6563('0x30'),_0x3f578a[_0x6563('0x15')]),'webbar:originate',{'callNumber':_0x46fb1b,'callerId':_0x574a35,'callbackUrl':_0x26c24b});return _0x246d53['status'](0xc8)[_0x6563('0x31')]({'error':![],'message':_0x6563('0x32')});})[_0x6563('0x33')](handleError(_0x246d53));};exports[_0x6563('0x34')]=function(_0x4962c2,_0x2d36d4){logger[_0x6563('0x35')]('hangup\x20fired:',_0x4962c2[_0x6563('0x2a')]);var _0xe5e80f=hangupValidation[_0x6563('0xc')](_0x4962c2[_0x6563('0x2a')]);if(_0xe5e80f[_0x6563('0x25')]>0x0){return _0x2d36d4[_0x6563('0x16')](0x190)[_0x6563('0x31')](_0xe5e80f);}var _0x15c23e=_0x4962c2[_0x6563('0x2a')]['userId'];var _0x130a88=_0x4962c2[_0x6563('0x2a')][_0x6563('0x24')];return getAgent(_0x15c23e)[_0x6563('0x1a')](function(_0x5ebe88){logger['info'](_0x6563('0x2f'),_0x5ebe88[_0x6563('0x15')]);emit(util[_0x6563('0x36')]('user:%s',_0x5ebe88[_0x6563('0x15')]),'webbar:hangup',{'sessionId':_0x130a88});return _0x2d36d4[_0x6563('0x16')](0xc8)[_0x6563('0x31')]({'error':![],'message':'hangup\x20executed!'});})[_0x6563('0x33')](handleError(_0x2d36d4));};exports[_0x6563('0x37')]=function(_0xea186,_0xcf92cd){logger[_0x6563('0x35')](_0x6563('0x38'),_0xea186[_0x6563('0x2a')]);var _0x32932f=answerValidation[_0x6563('0xc')](_0xea186[_0x6563('0x2a')]);if(_0x32932f[_0x6563('0x25')]>0x0){return _0xcf92cd['status'](0x190)['json'](_0x32932f);}var _0x38eab4=_0xea186[_0x6563('0x2a')][_0x6563('0x2b')];var _0x2f2aa6=_0xea186[_0x6563('0x2a')][_0x6563('0x24')];return getAgent(_0x38eab4)[_0x6563('0x1a')](function(_0x4b7838){logger[_0x6563('0x35')](_0x6563('0x2f'),_0x4b7838[_0x6563('0x15')]);emit(util[_0x6563('0x36')]('user:%s',_0x4b7838[_0x6563('0x15')]),_0x6563('0x39'),{'sessionId':_0x2f2aa6});return _0xcf92cd[_0x6563('0x16')](0xc8)[_0x6563('0x31')]({'error':![],'message':_0x6563('0x3a')});})['catch'](handleError(_0xcf92cd));};exports['hold']=function(_0x1504ca,_0x42d54c){logger[_0x6563('0x35')]('hold\x20fired:',_0x1504ca[_0x6563('0x2a')]);var _0x120723=holdValidation[_0x6563('0xc')](_0x1504ca[_0x6563('0x2a')]);if(_0x120723['length']>0x0){return _0x42d54c[_0x6563('0x16')](0x190)[_0x6563('0x31')](_0x120723);}var _0xd54477=_0x1504ca['body'][_0x6563('0x2b')];var _0x4bcfff=_0x1504ca[_0x6563('0x2a')]['sessionId'];return getAgent(_0xd54477)['then'](function(_0x1ef2da){logger[_0x6563('0x35')](_0x6563('0x2f'),_0x1ef2da[_0x6563('0x15')]);emit(util[_0x6563('0x36')](_0x6563('0x30'),_0x1ef2da[_0x6563('0x15')]),_0x6563('0x3b'),{'sessionId':_0x4bcfff});return _0x42d54c[_0x6563('0x16')](0xc8)[_0x6563('0x31')]({'error':![],'message':'hold\x20executed!'});})[_0x6563('0x33')](handleError(_0x42d54c));};exports['unhold']=function(_0x22306a,_0xb339e9){logger[_0x6563('0x35')]('unhold\x20fired:',_0x22306a[_0x6563('0x2a')]);var _0x141f0c=unholdValidation['validate'](_0x22306a[_0x6563('0x2a')]);if(_0x141f0c[_0x6563('0x25')]>0x0){return _0xb339e9[_0x6563('0x16')](0x190)[_0x6563('0x31')](_0x141f0c);}var _0xbd920a=_0x22306a['body'][_0x6563('0x2b')];var _0x5c4cfa=_0x22306a[_0x6563('0x2a')]['sessionId'];return getAgent(_0xbd920a)[_0x6563('0x1a')](function(_0x5992c8){logger['info']('entityFound:',_0x5992c8['name']);emit(util[_0x6563('0x36')]('user:%s',_0x5992c8[_0x6563('0x15')]),'webbar:unhold',{'sessionId':_0x5c4cfa});return _0xb339e9[_0x6563('0x16')](0xc8)[_0x6563('0x31')]({'error':![],'message':_0x6563('0x3c')});})[_0x6563('0x33')](handleError(_0xb339e9));};exports[_0x6563('0x3d')]=function(_0x199a0e,_0x23c94a){logger[_0x6563('0x35')](_0x6563('0x3e'),_0x23c94a['body']);var _0x386ae9=callsValidation[_0x6563('0xc')](_0x199a0e[_0x6563('0x2a')]);if(_0x386ae9[_0x6563('0x25')]>0x0){return _0x23c94a[_0x6563('0x16')](0x190)[_0x6563('0x31')](_0x386ae9);}var _0x40c99b=_0x199a0e[_0x6563('0x2a')][_0x6563('0x2b')];var _0x2c7e9d=respondWithRpcPromise(_0x6563('0x20'));var _0x5c456b=getAgent(_0x40c99b);return Promise[_0x6563('0x21')]([_0x2c7e9d,_0x5c456b])[_0x6563('0x1a')](function(_0x23f38d){var _0x2e9c69=_0x23f38d[0x0];var _0x46c26c=_0x23f38d[0x1];var _0x3c06ac=_[_0x6563('0x3f')](_0x2e9c69[_0x6563('0x22')],function(_0x53292e){return _0x53292e[_0x6563('0x23')]==_0x46c26c['id'];});return _0x23c94a['status'](0xc8)[_0x6563('0x31')]({'count':_0x3c06ac[_0x6563('0x25')],'rows':_0x3c06ac});})['catch'](handleError(_0x23c94a));};exports['conference']=function(_0x3374b0,_0x8f5e46){logger[_0x6563('0x35')](_0x6563('0x40'),_0x3374b0['body']);var _0x2a3df0=conferenceValidation['validate'](_0x3374b0[_0x6563('0x2a')]);if(_0x2a3df0[_0x6563('0x25')]>0x0){return _0x8f5e46['status'](0x190)['json'](_0x2a3df0);}var _0x3a3a35=_0x3374b0['body']['userId'];return getAgent(_0x3a3a35)[_0x6563('0x1a')](function(_0x49d6a5){logger[_0x6563('0x35')](_0x6563('0x2f'),_0x49d6a5[_0x6563('0x15')]);emit(util[_0x6563('0x36')]('user:%s',_0x49d6a5[_0x6563('0x15')]),_0x6563('0x41'));return _0x8f5e46[_0x6563('0x16')](0xc8)[_0x6563('0x31')]({'error':![],'message':_0x6563('0x42')});})[_0x6563('0x33')](handleError(_0x8f5e46));};exports[_0x6563('0x43')]=function(_0x7d8546,_0x58728d){logger['info'](_0x6563('0x44'),_0x7d8546[_0x6563('0x2a')]);var _0x5b5783=transferValidation['validate'](_0x7d8546['body']);if(_0x5b5783[_0x6563('0x25')]>0x0){return _0x58728d[_0x6563('0x16')](0x190)[_0x6563('0x31')](_0x5b5783);}var _0x149b74=_0x7d8546['body'][_0x6563('0x2b')];var _0x1a5c54=_0x7d8546[_0x6563('0x2a')][_0x6563('0x24')];var _0xb55389=_0x7d8546['body']['transferNumber'];return getAgent(_0x149b74)[_0x6563('0x1a')](function(_0x1d7b5d){logger[_0x6563('0x35')]('entityFound:',_0x1d7b5d[_0x6563('0x15')]);emit(util['format'](_0x6563('0x30'),_0x1d7b5d[_0x6563('0x15')]),_0x6563('0x45'),{'sessionId':_0x1a5c54,'transferNumber':_0xb55389});return _0x58728d[_0x6563('0x16')](0xc8)[_0x6563('0x31')]({'error':![],'message':_0x6563('0x46')});})[_0x6563('0x33')](handleError(_0x58728d));}; \ No newline at end of file +var _0xad95=['send','NotFound','request','message','result','catch','findOne','then','VoiceChannels','filter','UserId','sessionId','length','originate','body','json','userId','callNumber','callerId','callbackUrl','entityFound:','user:%s','originate\x20executed!','hangup','format','webbar:hangup','hangup\x20executed!','answer\x20fired:','webbar:answer','answer\x20executed!','hold\x20fired:','webbar:hold','hold\x20executed!','unhold','unhold\x20fired:','webbar:unhold','rows','conference','conference\x20fired:','conference\x20executed!','transfer','transfer\x20fired:','transferNumber','webbar:transfer','transfer\x20executed!','path','lodash','../../mysqldb','bluebird','jayson/promise','../../config/logger','redis','localhost','socket.io-emitter','validate','userId\x20is\x20required','string','number','sessionId\x20is\x20required','info','stringify','log','handleError:','error','stack','name','status'];(function(_0x277581,_0x40379d){var _0xc8abfc=function(_0xb0eaa9){while(--_0xb0eaa9){_0x277581['push'](_0x277581['shift']());}};_0xc8abfc(++_0x40379d);}(_0xad95,0x70));var _0x5ad9=function(_0x349711,_0x4468b0){_0x349711=_0x349711-0x0;var _0x3dd824=_0xad95[_0x349711];return _0x3dd824;};'use strict';var path=require(_0x5ad9('0x0'));var fs=require('fs');var _=require(_0x5ad9('0x1'));var db=require(_0x5ad9('0x2'))['db'];var config=require('../../config/environment');var util=require('util');var BPromise=require(_0x5ad9('0x3'));var jayson=require(_0x5ad9('0x4'));var amiClient=jayson['client']['http']({'port':0x232a});var logger=require(_0x5ad9('0x5'))('webbarapi');var Redis=require('ioredis');config['redis']=_['defaults'](config[_0x5ad9('0x6')],{'host':_0x5ad9('0x7'),'port':0x18eb});var io=require(_0x5ad9('0x8'))(new Redis(config[_0x5ad9('0x6')]));var Schema=require(_0x5ad9('0x9'));var originateValidation=new Schema({'userId':{'type':'number','required':[!![],_0x5ad9('0xa')]},'callNumber':{'type':'string','required':[!![],'callNumber\x20is\x20required']},'callerId':{'type':_0x5ad9('0xb')},'callbackUrl':{'type':_0x5ad9('0xb')}});var hangupValidation=new Schema({'userId':{'type':_0x5ad9('0xc'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0x5ad9('0xb'),'required':![]}});var answerValidation=new Schema({'userId':{'type':_0x5ad9('0xc'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0x5ad9('0xb'),'required':![]}});var transferValidation=new Schema({'userId':{'type':_0x5ad9('0xc'),'required':[!![],_0x5ad9('0xa')]},'sessionId':{'type':_0x5ad9('0xb'),'required':[!![],_0x5ad9('0xd')]},'transferNumber':{'type':_0x5ad9('0xb'),'required':[!![],'transferNumber\x20is\x20required']}});var holdValidation=new Schema({'userId':{'type':'number','required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0x5ad9('0xb'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':_0x5ad9('0xc'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0x5ad9('0xb'),'required':![]}});var callsValidation=new Schema({'userId':{'type':_0x5ad9('0xc'),'required':[!![],_0x5ad9('0xa')]}});var conferenceValidation=new Schema({'userId':{'type':_0x5ad9('0xc'),'required':[!![],_0x5ad9('0xa')]}});function emit(_0x32b0bd,_0x112d44,_0x321c78){logger[_0x5ad9('0xe')](_0x32b0bd,_0x112d44,JSON[_0x5ad9('0xf')](_0x321c78));io['to'](_0x32b0bd)['emit'](_0x112d44,_0x321c78);}function handleError(_0x1c0b8e){return function(_0x54f392){console[_0x5ad9('0x10')](_0x5ad9('0x11'),_0x54f392,_0x54f392 instanceof RangeError);logger[_0x5ad9('0x12')](_0x54f392[_0x5ad9('0x13')]);if(_0x54f392 instanceof RangeError){if(_0x54f392[_0x5ad9('0x14')]){delete _0x54f392[_0x5ad9('0x14')];}_0x1c0b8e[_0x5ad9('0x15')](0x194)['send'](_0x54f392);}else{if(_0x54f392[_0x5ad9('0x14')]){delete _0x54f392['name'];}_0x1c0b8e['status'](0x1f4)[_0x5ad9('0x16')](_0x54f392);}};}function checkError(){return function(_0x545268){if(!_0x545268){throw new RangeError(_0x5ad9('0x17'));}return _0x545268;};}function respondWithRpcPromise(_0x36a2e9,_0x13e38c){return new BPromise(function(_0xebbe63,_0x1274f7){var _0x57b2ba=amiClient;return _0x57b2ba[_0x5ad9('0x18')](_0x36a2e9,_0x13e38c)['then'](function(_0x807b05){if(_0x807b05['error']){if(_0x807b05['error']['code']===0x1f4){return _0x1274f7(_0x807b05[_0x5ad9('0x12')][_0x5ad9('0x19')]);}return _0xebbe63(_0x807b05[_0x5ad9('0x12')][_0x5ad9('0x19')]);}else{_0xebbe63(_0x807b05[_0x5ad9('0x1a')]);}})[_0x5ad9('0x1b')](function(_0x11d919){_0x1274f7(_0x11d919);});});}function getAgent(_0x4fd73e){return db['User'][_0x5ad9('0x1c')]({'where':{'id':_0x4fd73e,'role':'agent'}})[_0x5ad9('0x1d')](checkError());}function getAgentCheckSession(_0x584de3,_0x346f35){return new BPromise(function(_0x55a0e4,_0x58a156){var _0x243f82=respondWithRpcPromise(_0x5ad9('0x1e'));var _0x49b3df=getAgent(_0x584de3);Promise['all']([_0x243f82,_0x49b3df])[_0x5ad9('0x1d')](function(_0x129804){var _0x1b6faf=_0x129804[0x0];var _0x2ad078=_0x129804[0x1];var _0xe06a1d=_[_0x5ad9('0x1f')](_0x1b6faf['rows'],function(_0x132ec6){return _0x132ec6[_0x5ad9('0x20')]==_0x2ad078['id']&&_0x132ec6[_0x5ad9('0x21')]==_0x346f35;});if(_0xe06a1d[_0x5ad9('0x22')]==0x1){_0x55a0e4(_0x2ad078);}else{_0x58a156(new RangeError('sessionId\x20'+_0x346f35+'\x20not\x20found!'));}});});}exports[_0x5ad9('0x23')]=function(_0xe044cf,_0x4afceb){logger['info']('originate\x20fired:',_0xe044cf[_0x5ad9('0x24')]);var _0x15365b=originateValidation['validate'](_0xe044cf[_0x5ad9('0x24')]);if(_0x15365b[_0x5ad9('0x22')]>0x0){return _0x4afceb[_0x5ad9('0x15')](0x190)[_0x5ad9('0x25')](_0x15365b);}var _0x4daf7b=_0xe044cf['body'][_0x5ad9('0x26')];var _0x433728=_0xe044cf[_0x5ad9('0x24')][_0x5ad9('0x27')];var _0x211426=_0xe044cf['body'][_0x5ad9('0x28')];var _0x4091b8=_0xe044cf[_0x5ad9('0x24')][_0x5ad9('0x29')];return getAgent(_0x4daf7b)[_0x5ad9('0x1d')](function(_0x1f67d4){logger['info'](_0x5ad9('0x2a'),_0x1f67d4[_0x5ad9('0x14')]);emit(util['format'](_0x5ad9('0x2b'),_0x1f67d4[_0x5ad9('0x14')]),'webbar:originate',{'callNumber':_0x433728,'callerId':_0x211426,'callbackUrl':_0x4091b8});return _0x4afceb[_0x5ad9('0x15')](0xc8)[_0x5ad9('0x25')]({'error':![],'message':_0x5ad9('0x2c')});})['catch'](handleError(_0x4afceb));};exports[_0x5ad9('0x2d')]=function(_0x1815cc,_0x1f8b9b){logger[_0x5ad9('0xe')]('hangup\x20fired:',_0x1815cc[_0x5ad9('0x24')]);var _0xf3301a=hangupValidation[_0x5ad9('0x9')](_0x1815cc[_0x5ad9('0x24')]);if(_0xf3301a[_0x5ad9('0x22')]>0x0){return _0x1f8b9b[_0x5ad9('0x15')](0x190)[_0x5ad9('0x25')](_0xf3301a);}var _0x9219c6=_0x1815cc[_0x5ad9('0x24')]['userId'];var _0x46fc19=_0x1815cc[_0x5ad9('0x24')][_0x5ad9('0x21')];return getAgent(_0x9219c6)[_0x5ad9('0x1d')](function(_0x2a9e3b){logger['info'](_0x5ad9('0x2a'),_0x2a9e3b[_0x5ad9('0x14')]);emit(util[_0x5ad9('0x2e')]('user:%s',_0x2a9e3b[_0x5ad9('0x14')]),_0x5ad9('0x2f'),{'sessionId':_0x46fc19});return _0x1f8b9b[_0x5ad9('0x15')](0xc8)['json']({'error':![],'message':_0x5ad9('0x30')});})['catch'](handleError(_0x1f8b9b));};exports['answer']=function(_0x77689e,_0x34d201){logger[_0x5ad9('0xe')](_0x5ad9('0x31'),_0x77689e['body']);var _0x526fda=answerValidation[_0x5ad9('0x9')](_0x77689e['body']);if(_0x526fda[_0x5ad9('0x22')]>0x0){return _0x34d201['status'](0x190)[_0x5ad9('0x25')](_0x526fda);}var _0x5c5a7a=_0x77689e[_0x5ad9('0x24')][_0x5ad9('0x26')];var _0x6b2fa7=_0x77689e[_0x5ad9('0x24')][_0x5ad9('0x21')];return getAgent(_0x5c5a7a)[_0x5ad9('0x1d')](function(_0x76e642){logger[_0x5ad9('0xe')](_0x5ad9('0x2a'),_0x76e642['name']);emit(util[_0x5ad9('0x2e')](_0x5ad9('0x2b'),_0x76e642[_0x5ad9('0x14')]),_0x5ad9('0x32'),{'sessionId':_0x6b2fa7});return _0x34d201[_0x5ad9('0x15')](0xc8)['json']({'error':![],'message':_0x5ad9('0x33')});})['catch'](handleError(_0x34d201));};exports['hold']=function(_0x4cccab,_0x2c094c){logger[_0x5ad9('0xe')](_0x5ad9('0x34'),_0x4cccab['body']);var _0x39db4b=holdValidation[_0x5ad9('0x9')](_0x4cccab[_0x5ad9('0x24')]);if(_0x39db4b[_0x5ad9('0x22')]>0x0){return _0x2c094c['status'](0x190)[_0x5ad9('0x25')](_0x39db4b);}var _0x420677=_0x4cccab[_0x5ad9('0x24')][_0x5ad9('0x26')];var _0x4fdbb6=_0x4cccab[_0x5ad9('0x24')][_0x5ad9('0x21')];return getAgent(_0x420677)[_0x5ad9('0x1d')](function(_0x1e03f){logger[_0x5ad9('0xe')](_0x5ad9('0x2a'),_0x1e03f[_0x5ad9('0x14')]);emit(util['format'](_0x5ad9('0x2b'),_0x1e03f['name']),_0x5ad9('0x35'),{'sessionId':_0x4fdbb6});return _0x2c094c[_0x5ad9('0x15')](0xc8)[_0x5ad9('0x25')]({'error':![],'message':_0x5ad9('0x36')});})[_0x5ad9('0x1b')](handleError(_0x2c094c));};exports[_0x5ad9('0x37')]=function(_0xa0f426,_0x2c3945){logger[_0x5ad9('0xe')](_0x5ad9('0x38'),_0xa0f426[_0x5ad9('0x24')]);var _0x2457aa=unholdValidation[_0x5ad9('0x9')](_0xa0f426[_0x5ad9('0x24')]);if(_0x2457aa[_0x5ad9('0x22')]>0x0){return _0x2c3945['status'](0x190)[_0x5ad9('0x25')](_0x2457aa);}var _0x349d5f=_0xa0f426[_0x5ad9('0x24')][_0x5ad9('0x26')];var _0x1c4f6e=_0xa0f426[_0x5ad9('0x24')][_0x5ad9('0x21')];return getAgent(_0x349d5f)[_0x5ad9('0x1d')](function(_0x518072){logger[_0x5ad9('0xe')]('entityFound:',_0x518072[_0x5ad9('0x14')]);emit(util[_0x5ad9('0x2e')](_0x5ad9('0x2b'),_0x518072['name']),_0x5ad9('0x39'),{'sessionId':_0x1c4f6e});return _0x2c3945[_0x5ad9('0x15')](0xc8)[_0x5ad9('0x25')]({'error':![],'message':'unhold\x20executed!'});})[_0x5ad9('0x1b')](handleError(_0x2c3945));};exports['calls']=function(_0x4e2bbb,_0x4071aa){logger[_0x5ad9('0xe')]('calls\x20fired:',_0x4071aa['body']);var _0xbda89a=callsValidation[_0x5ad9('0x9')](_0x4e2bbb[_0x5ad9('0x24')]);if(_0xbda89a[_0x5ad9('0x22')]>0x0){return _0x4071aa[_0x5ad9('0x15')](0x190)[_0x5ad9('0x25')](_0xbda89a);}var _0x23bddf=_0x4e2bbb[_0x5ad9('0x24')][_0x5ad9('0x26')];var _0x5b5997=respondWithRpcPromise(_0x5ad9('0x1e'));var _0x3b233f=getAgent(_0x23bddf);return Promise['all']([_0x5b5997,_0x3b233f])[_0x5ad9('0x1d')](function(_0x3f3121){var _0x375af6=_0x3f3121[0x0];var _0x574260=_0x3f3121[0x1];var _0x2f3d04=_[_0x5ad9('0x1f')](_0x375af6[_0x5ad9('0x3a')],function(_0x8030a9){return _0x8030a9[_0x5ad9('0x20')]==_0x574260['id'];});return _0x4071aa[_0x5ad9('0x15')](0xc8)[_0x5ad9('0x25')]({'count':_0x2f3d04[_0x5ad9('0x22')],'rows':_0x2f3d04});})['catch'](handleError(_0x4071aa));};exports[_0x5ad9('0x3b')]=function(_0x4305b5,_0x1e9658){logger[_0x5ad9('0xe')](_0x5ad9('0x3c'),_0x4305b5[_0x5ad9('0x24')]);var _0x313205=conferenceValidation[_0x5ad9('0x9')](_0x4305b5[_0x5ad9('0x24')]);if(_0x313205[_0x5ad9('0x22')]>0x0){return _0x1e9658[_0x5ad9('0x15')](0x190)[_0x5ad9('0x25')](_0x313205);}var _0x515d96=_0x4305b5[_0x5ad9('0x24')][_0x5ad9('0x26')];return getAgent(_0x515d96)[_0x5ad9('0x1d')](function(_0x2bc55c){logger['info'](_0x5ad9('0x2a'),_0x2bc55c['name']);emit(util[_0x5ad9('0x2e')](_0x5ad9('0x2b'),_0x2bc55c[_0x5ad9('0x14')]),'webbar:conference');return _0x1e9658[_0x5ad9('0x15')](0xc8)[_0x5ad9('0x25')]({'error':![],'message':_0x5ad9('0x3d')});})[_0x5ad9('0x1b')](handleError(_0x1e9658));};exports[_0x5ad9('0x3e')]=function(_0x196bf8,_0x5f53aa){logger[_0x5ad9('0xe')](_0x5ad9('0x3f'),_0x196bf8['body']);var _0x12e253=transferValidation[_0x5ad9('0x9')](_0x196bf8['body']);if(_0x12e253[_0x5ad9('0x22')]>0x0){return _0x5f53aa[_0x5ad9('0x15')](0x190)['json'](_0x12e253);}var _0x2899b4=_0x196bf8[_0x5ad9('0x24')][_0x5ad9('0x26')];var _0x5ac26f=_0x196bf8[_0x5ad9('0x24')][_0x5ad9('0x21')];var _0x32f972=_0x196bf8[_0x5ad9('0x24')][_0x5ad9('0x40')];return getAgent(_0x2899b4)['then'](function(_0x5152aa){logger['info']('entityFound:',_0x5152aa['name']);emit(util['format']('user:%s',_0x5152aa[_0x5ad9('0x14')]),_0x5ad9('0x41'),{'sessionId':_0x5ac26f,'transferNumber':_0x32f972});return _0x5f53aa[_0x5ad9('0x15')](0xc8)[_0x5ad9('0x25')]({'error':![],'message':_0x5ad9('0x42')});})[_0x5ad9('0x1b')](handleError(_0x5f53aa));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/index.js b/server/api/whatsappAccount/index.js index 2a8971d..2019c88 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 _0x2c4b=['removeDispositions','removeAnswers','removeAgents','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappAccount.controller','get','isAuthenticated','index','/describe','/:id','show','getDispositions','getAnswers','/:id/users','getAgents','getApplications','create','post','/:id/dispositions','addDisposition','/:id/canned_answers','addAnswer','addAgents','/:id/applications','addApplications','/:id/notify','/:id/send','send','update','delete'];(function(_0x6ea8a2,_0x561d6c){var _0x4fe938=function(_0x1efa6c){while(--_0x1efa6c){_0x6ea8a2['push'](_0x6ea8a2['shift']());}};_0x4fe938(++_0x561d6c);}(_0x2c4b,0x115));var _0xb2c4=function(_0x3eef69,_0x3731e7){_0x3eef69=_0x3eef69-0x0;var _0x11ad69=_0x2c4b[_0x3eef69];return _0x11ad69;};'use strict';var multer=require(_0xb2c4('0x0'));var util=require(_0xb2c4('0x1'));var path=require('path');var timeout=require(_0xb2c4('0x2'));var express=require(_0xb2c4('0x3'));var router=express[_0xb2c4('0x4')]();var fs_extra=require(_0xb2c4('0x5'));var auth=require(_0xb2c4('0x6'));var interaction=require(_0xb2c4('0x7'));var config=require(_0xb2c4('0x8'));var controller=require(_0xb2c4('0x9'));router[_0xb2c4('0xa')]('/',auth[_0xb2c4('0xb')](),controller[_0xb2c4('0xc')]);router['get'](_0xb2c4('0xd'),auth['isAuthenticated'](),controller['describe']);router[_0xb2c4('0xa')](_0xb2c4('0xe'),auth[_0xb2c4('0xb')](),controller[_0xb2c4('0xf')]);router[_0xb2c4('0xa')]('/:id/dispositions',auth[_0xb2c4('0xb')](),controller[_0xb2c4('0x10')]);router[_0xb2c4('0xa')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0xb2c4('0x11')]);router['get'](_0xb2c4('0x12'),auth[_0xb2c4('0xb')](),controller[_0xb2c4('0x13')]);router[_0xb2c4('0xa')]('/:id/applications',auth[_0xb2c4('0xb')](),controller[_0xb2c4('0x14')]);router['post']('/',auth[_0xb2c4('0xb')](),controller[_0xb2c4('0x15')]);router[_0xb2c4('0x16')](_0xb2c4('0x17'),auth['isAuthenticated'](),controller[_0xb2c4('0x18')]);router[_0xb2c4('0x16')](_0xb2c4('0x19'),auth[_0xb2c4('0xb')](),controller[_0xb2c4('0x1a')]);router[_0xb2c4('0x16')]('/:id/users',auth['isAuthenticated'](),controller[_0xb2c4('0x1b')]);router['post'](_0xb2c4('0x1c'),auth[_0xb2c4('0xb')](),controller[_0xb2c4('0x1d')]);router[_0xb2c4('0x16')](_0xb2c4('0x1e'),controller['notify']);router[_0xb2c4('0x16')](_0xb2c4('0x1f'),auth[_0xb2c4('0xb')](),controller[_0xb2c4('0x20')]);router['put'](_0xb2c4('0xe'),auth['isAuthenticated'](),controller[_0xb2c4('0x21')]);router[_0xb2c4('0x22')](_0xb2c4('0xe'),auth[_0xb2c4('0xb')](),controller['destroy']);router[_0xb2c4('0x22')](_0xb2c4('0x17'),auth[_0xb2c4('0xb')](),controller[_0xb2c4('0x23')]);router[_0xb2c4('0x22')]('/:id/canned_answers',auth[_0xb2c4('0xb')](),controller[_0xb2c4('0x24')]);router[_0xb2c4('0x22')](_0xb2c4('0x12'),auth[_0xb2c4('0xb')](),controller[_0xb2c4('0x25')]);module[_0xb2c4('0x26')]=router; \ No newline at end of file +var _0x2b8d=['notify','put','update','delete','removeAnswers','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./whatsappAccount.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/users','getAgents','post','addDisposition','addAnswer','addAgents','/:id/applications','/:id/notify'];(function(_0x308a79,_0x3b9435){var _0x3ee756=function(_0x8886ee){while(--_0x8886ee){_0x308a79['push'](_0x308a79['shift']());}};_0x3ee756(++_0x3b9435);}(_0x2b8d,0x106));var _0xd2b8=function(_0x115621,_0x341cde){_0x115621=_0x115621-0x0;var _0x5ef5ce=_0x2b8d[_0x115621];return _0x5ef5ce;};'use strict';var multer=require(_0xd2b8('0x0'));var util=require(_0xd2b8('0x1'));var path=require('path');var timeout=require(_0xd2b8('0x2'));var express=require(_0xd2b8('0x3'));var router=express[_0xd2b8('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xd2b8('0x5'));var interaction=require(_0xd2b8('0x6'));var config=require('../../config/environment');var controller=require(_0xd2b8('0x7'));router[_0xd2b8('0x8')]('/',auth[_0xd2b8('0x9')](),controller['index']);router['get'](_0xd2b8('0xa'),auth[_0xd2b8('0x9')](),controller[_0xd2b8('0xb')]);router[_0xd2b8('0x8')](_0xd2b8('0xc'),auth[_0xd2b8('0x9')](),controller[_0xd2b8('0xd')]);router[_0xd2b8('0x8')](_0xd2b8('0xe'),auth[_0xd2b8('0x9')](),controller[_0xd2b8('0xf')]);router['get'](_0xd2b8('0x10'),auth[_0xd2b8('0x9')](),controller[_0xd2b8('0x11')]);router[_0xd2b8('0x8')](_0xd2b8('0x12'),auth[_0xd2b8('0x9')](),controller[_0xd2b8('0x13')]);router['get']('/:id/applications',auth[_0xd2b8('0x9')](),controller['getApplications']);router['post']('/',auth[_0xd2b8('0x9')](),controller['create']);router[_0xd2b8('0x14')]('/:id/dispositions',auth[_0xd2b8('0x9')](),controller[_0xd2b8('0x15')]);router[_0xd2b8('0x14')](_0xd2b8('0x10'),auth['isAuthenticated'](),controller[_0xd2b8('0x16')]);router[_0xd2b8('0x14')](_0xd2b8('0x12'),auth[_0xd2b8('0x9')](),controller[_0xd2b8('0x17')]);router[_0xd2b8('0x14')](_0xd2b8('0x18'),auth['isAuthenticated'](),controller['addApplications']);router[_0xd2b8('0x14')](_0xd2b8('0x19'),controller[_0xd2b8('0x1a')]);router['post']('/:id/send',auth[_0xd2b8('0x9')](),controller['send']);router[_0xd2b8('0x1b')](_0xd2b8('0xc'),auth[_0xd2b8('0x9')](),controller[_0xd2b8('0x1c')]);router[_0xd2b8('0x1d')]('/:id',auth['isAuthenticated'](),controller['destroy']);router[_0xd2b8('0x1d')](_0xd2b8('0xe'),auth[_0xd2b8('0x9')](),controller['removeDispositions']);router[_0xd2b8('0x1d')](_0xd2b8('0x10'),auth[_0xd2b8('0x9')](),controller[_0xd2b8('0x1e')]);router[_0xd2b8('0x1d')](_0xd2b8('0x12'),auth[_0xd2b8('0x9')](),controller['removeAgents']);module[_0xd2b8('0x1f')]=router; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.attributes.js b/server/api/whatsappAccount/whatsappAccount.attributes.js index d7886f5..ca56f3e 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 _0x182d=['Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','name','STRING','ENUM','sinch','TEXT'];(function(_0x26d849,_0x3559dd){var _0x149eed=function(_0x239e06){while(--_0x239e06){_0x26d849['push'](_0x26d849['shift']());}};_0x149eed(++_0x3559dd);}(_0x182d,0x152));var _0xd182=function(_0x3a95f2,_0x1e0366){_0x3a95f2=_0x3a95f2-0x0;var _0x4c083d=_0x182d[_0x3a95f2];return _0x4c083d;};'use strict';var Sequelize=require(_0xd182('0x0'));var rs=require('randomstring');module[_0xd182('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xd182('0x2'),'allowNull':![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'remote':{'type':Sequelize[_0xd182('0x3')],'allowNull':![]},'token':{'type':Sequelize[_0xd182('0x3')],'defaultValue':function(){return rs['generate']();}},'phone':{'type':Sequelize[_0xd182('0x3')]},'type':{'type':Sequelize[_0xd182('0x4')]('twilio',_0xd182('0x5'))},'accountSid':{'type':Sequelize[_0xd182('0x3')]},'baseUrl':{'type':Sequelize[_0xd182('0x3')]},'authToken':{'type':Sequelize[_0xd182('0x3')]},'notificationTemplate':{'type':Sequelize[_0xd182('0x6')],'defaultValue':function(){return _0xd182('0x7');}},'notificationSound':{'type':Sequelize[_0xd182('0x8')],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0xd182('0x8')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xd182('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0xd182('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xd182('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xd182('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xd182('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xd182('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0xd182('0xa')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0xd182('0xb'),'set':function(_0x5bf19e){if(!_0x5bf19e){this[_0xd182('0xc')](_0xd182('0xd'),null);}this[_0xd182('0xc')](_0xd182('0xe'),_0x5bf19e);}},'description':{'type':Sequelize[_0xd182('0x3')]}}; \ No newline at end of file +var _0xa765=['exports','STRING','generate','ENUM','twilio','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'];(function(_0x31b970,_0x562c0e){var _0xcfce8c=function(_0x5e8a09){while(--_0x5e8a09){_0x31b970['push'](_0x31b970['shift']());}};_0xcfce8c(++_0x562c0e);}(_0xa765,0x144));var _0x5a76=function(_0x29e0bd,_0x199b5b){_0x29e0bd=_0x29e0bd-0x0;var _0x1aab58=_0xa765[_0x29e0bd];return _0x1aab58;};'use strict';var Sequelize=require('sequelize');var rs=require('randomstring');module[_0x5a76('0x0')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![]},'key':{'type':Sequelize[_0x5a76('0x1')],'allowNull':![]},'remote':{'type':Sequelize['STRING'],'allowNull':![]},'token':{'type':Sequelize[_0x5a76('0x1')],'defaultValue':function(){return rs[_0x5a76('0x2')]();}},'phone':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x5a76('0x3')](_0x5a76('0x4'),'sinch')},'accountSid':{'type':Sequelize['STRING']},'baseUrl':{'type':Sequelize[_0x5a76('0x1')]},'authToken':{'type':Sequelize[_0x5a76('0x1')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x5a76('0x5');}},'notificationSound':{'type':Sequelize[_0x5a76('0x6')],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0x5a76('0x6')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x5a76('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x5a76('0x6')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x5a76('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x5a76('0x7')],'comment':_0x5a76('0x8')},'mandatoryDisposition':{'type':Sequelize[_0x5a76('0x6')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x3babdb){if(!_0x3babdb){this[_0x5a76('0x9')](_0x5a76('0xa'),null);}this[_0x5a76('0x9')](_0x5a76('0xb'),_0x3babdb);}},'description':{'type':Sequelize[_0x5a76('0x1')]}}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.controller.js b/server/api/whatsappAccount/whatsappAccount.controller.js index 45b4831..23c03f7 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 _0x3743=['queue','waitForTheAssignedQueue','Start','startRouting','receiveMessage','entity\x20found','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','Content-Type','text/xml','\x0a','to\x20is\x20mandatory','CmList','List','DESC','out','Messages','dataValues','eml-format','zip-dir','request-promise','bluebird','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','./whatsappAccount.socket','jayson/promise','client','then','WhatsappAccount,\x20%s,\x20%s','request\x20sent','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','WhatsappAccounts','UserProfileResource','destroy','stack','name','send','mandatoryDispositionPause','map','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','order','sort','pick','filter','where','merge','VIRTUAL','options','WhatsappAccount','findAll','show','params','includeAll','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','UserProfileSection','userProfileId','autoAssociation','update','Pause','describe','addDisposition','WhatsappAccountId','Disposition','getDispositions','findOne','hasOwnProperty','nolimit','rows','removeDispositions','CannedAnswer','getAnswers','removeAnswers','ids','addAgents','omit','spread','emit','userWhatsappAccount:save','removeAgents','isArray','userWhatsappAccount:remove','getAgents','User','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','WhatsappApplication','findAndCountAll','priority','finally','getApplications','Applications','account','statuses','state','read','timestamp','message_id','applications','orderBy','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','mobile','twilio','from','From','replace','Body','messageId','MessageSid','notifications','isNil','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','Contacts','list','contact','WhatsappInteraction','interaction','created','push','unmanaged','*,*,*,*','WhatsappMessage','UserId','agent','queueId','WhatsappQueue'];(function(_0x231e5a,_0x1718f8){var _0x216a7d=function(_0x212271){while(--_0x212271){_0x231e5a['push'](_0x231e5a['shift']());}};_0x216a7d(++_0x1718f8);}(_0x3743,0xd1));var _0x3374=function(_0x26a818,_0x40708a){_0x26a818=_0x26a818-0x0;var _0x5d8ca0=_0x3743[_0x26a818];return _0x5d8ca0;};'use strict';var emlformat=require(_0x3374('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3374('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3374('0x2'));var moment=require('moment');var BPromise=require(_0x3374('0x3'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x3374('0x4'));var ejs=require(_0x3374('0x5'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3374('0x6'));var squel=require('squel');var crypto=require(_0x3374('0x7'));var jsforce=require(_0x3374('0x8'));var deskjs=require(_0x3374('0x9'));var toCsv=require('to-csv');var querystring=require(_0x3374('0xa'));var Papa=require('papaparse');var Redis=require(_0x3374('0xb'));var authService=require('../../components/auth/service');var qs=require(_0x3374('0xc'));var as=require(_0x3374('0xd'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3374('0xe'))(_0x3374('0xf'));var utils=require(_0x3374('0x10'));var config=require(_0x3374('0x11'));var licenseUtil=require(_0x3374('0x12'));var db=require('../../mysqldb')['db'];config[_0x3374('0x13')]=_[_0x3374('0x14')](config[_0x3374('0x13')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3374('0x13')]));require(_0x3374('0x15'))['register'](socket);var jayson=require(_0x3374('0x16'));var client=jayson[_0x3374('0x17')]['http']({'port':0x232c});function respondWithRpcPromise(_0x45654a,_0x59b5f9,_0x18c07d,_0x32ded7){return new BPromise(function(_0x2ecb47,_0x145180){var _0x3ce639=_0x32ded7||client;return _0x3ce639['request'](_0x45654a,_0x18c07d)[_0x3374('0x18')](function(_0x13b9ee){logger['info'](_0x3374('0x19'),_0x59b5f9,_0x3374('0x1a'));logger['debug'](_0x3374('0x1b'),_0x59b5f9,_0x3374('0x1a'),JSON[_0x3374('0x1c')](_0x13b9ee));if(_0x13b9ee[_0x3374('0x1d')]){if(_0x13b9ee[_0x3374('0x1d')][_0x3374('0x1e')]===0x1f4){logger[_0x3374('0x1d')]('WhatsappAccount,\x20%s,\x20%s',_0x59b5f9,_0x13b9ee[_0x3374('0x1d')][_0x3374('0x1f')]);return _0x145180(_0x13b9ee[_0x3374('0x1d')][_0x3374('0x1f')]);}logger[_0x3374('0x1d')]('WhatsappAccount,\x20%s,\x20%s',_0x59b5f9,_0x13b9ee[_0x3374('0x1d')]['message']);return _0x2ecb47(_0x13b9ee[_0x3374('0x1d')]['message']);}else{logger[_0x3374('0x20')](_0x3374('0x19'),_0x59b5f9,'request\x20sent');_0x2ecb47(_0x13b9ee[_0x3374('0x21')][_0x3374('0x1f')]);}})[_0x3374('0x22')](function(_0x429f95){logger[_0x3374('0x1d')](_0x3374('0x19'),_0x59b5f9,_0x429f95);_0x145180(_0x429f95);});});}function respondWithStatusCode(_0x414130,_0x320b60){_0x320b60=_0x320b60||0xcc;return function(_0x521ee9){if(_0x521ee9){return _0x414130[_0x3374('0x23')](_0x320b60);}return _0x414130[_0x3374('0x24')](_0x320b60)[_0x3374('0x25')]();};}function respondWithResult(_0x3b4c3d,_0x3343d){_0x3343d=_0x3343d||0xc8;return function(_0x255518){if(_0x255518){return _0x3b4c3d['status'](_0x3343d)[_0x3374('0x26')](_0x255518);}};}function respondWithFilteredResult(_0x1fcdc2,_0x146baa){return function(_0x548ee3){if(_0x548ee3){var _0x51c721=typeof _0x146baa[_0x3374('0x27')]===_0x3374('0x28')&&typeof _0x146baa[_0x3374('0x29')]===_0x3374('0x28');var _0x47947c=_0x548ee3[_0x3374('0x2a')];var _0x37b97a=_0x51c721?0x0:_0x146baa[_0x3374('0x27')];var _0x1dcc92=_0x51c721?_0x548ee3[_0x3374('0x2a')]:_0x146baa[_0x3374('0x27')]+_0x146baa[_0x3374('0x29')];var _0x51f80d;if(_0x1dcc92>=_0x47947c){_0x1dcc92=_0x47947c;_0x51f80d=0xc8;}else{_0x51f80d=0xce;}_0x1fcdc2['status'](_0x51f80d);return _0x1fcdc2[_0x3374('0x2b')](_0x3374('0x2c'),_0x37b97a+'-'+_0x1dcc92+'/'+_0x47947c)[_0x3374('0x26')](_0x548ee3);}return null;};}function patchUpdates(_0x1a0e3d){return function(_0x11871e){try{jsonpatch[_0x3374('0x2d')](_0x11871e,_0x1a0e3d,!![]);}catch(_0x37fb00){return BPromise[_0x3374('0x2e')](_0x37fb00);}return _0x11871e[_0x3374('0x2f')]();};}function saveUpdates(_0x5c24a3,_0x4de175){return function(_0x26be47){if(_0x26be47){return _0x26be47['update'](_0x5c24a3)[_0x3374('0x18')](function(_0x25536f){return _0x25536f;});}return null;};}function removeEntity(_0x3921f6,_0x351d21){return function(_0x319ad8){if(_0x319ad8){return _0x319ad8['destroy']()['then'](function(){var _0x1cd0be=_0x319ad8['get']({'plain':!![]});var _0x252faf=_0x3374('0x30');return db[_0x3374('0x31')][_0x3374('0x32')]({'where':{'type':_0x252faf,'resourceId':_0x1cd0be['id']}})[_0x3374('0x18')](function(){return _0x319ad8;});})[_0x3374('0x18')](function(){_0x3921f6[_0x3374('0x24')](0xcc)['end']();});}};}function handleEntityNotFound(_0x56fdfb,_0x592639){return function(_0x431979){if(!_0x431979){_0x56fdfb['sendStatus'](0x194);}return _0x431979;};}function handleError(_0x391cf9,_0x49faae){_0x49faae=_0x49faae||0x1f4;return function(_0x2ec5c9){logger['error'](_0x2ec5c9[_0x3374('0x33')]);if(_0x2ec5c9[_0x3374('0x34')]){delete _0x2ec5c9[_0x3374('0x34')];}_0x391cf9[_0x3374('0x24')](_0x49faae)[_0x3374('0x35')](_0x2ec5c9);};}exports['index']=function(_0x3baec1,_0x7dd555){var _0x36f4d6={'include':[{'model':db['Pause'],'as':_0x3374('0x36')}]},_0x538f27={},_0x1cc87e={'count':0x0,'rows':[]};var _0x5609de=_[_0x3374('0x37')](db['WhatsappAccount'][_0x3374('0x38')],function(_0x3ed533){return{'name':_0x3ed533[_0x3374('0x39')],'type':_0x3ed533[_0x3374('0x3a')][_0x3374('0x3b')]};});_0x538f27['model']=_[_0x3374('0x37')](_0x5609de,'name');_0x538f27[_0x3374('0x3c')]=_[_0x3374('0x3d')](_0x3baec1[_0x3374('0x3c')]);_0x538f27[_0x3374('0x3e')]=_[_0x3374('0x3f')](_0x538f27[_0x3374('0x40')],_0x538f27[_0x3374('0x3c')]);_0x36f4d6[_0x3374('0x41')]=_[_0x3374('0x3f')](_0x538f27[_0x3374('0x40')],qs[_0x3374('0x42')](_0x3baec1[_0x3374('0x3c')][_0x3374('0x42')]));_0x36f4d6[_0x3374('0x41')]=_0x36f4d6[_0x3374('0x41')][_0x3374('0x43')]?_0x36f4d6[_0x3374('0x41')]:_0x538f27[_0x3374('0x40')];if(!_0x3baec1[_0x3374('0x3c')]['hasOwnProperty']('nolimit')){_0x36f4d6[_0x3374('0x29')]=qs['limit'](_0x3baec1[_0x3374('0x3c')][_0x3374('0x29')]);_0x36f4d6[_0x3374('0x27')]=qs[_0x3374('0x27')](_0x3baec1[_0x3374('0x3c')][_0x3374('0x27')]);}_0x36f4d6[_0x3374('0x44')]=qs[_0x3374('0x45')](_0x3baec1[_0x3374('0x3c')][_0x3374('0x45')]);_0x36f4d6['where']=qs[_0x3374('0x3e')](_[_0x3374('0x46')](_0x3baec1[_0x3374('0x3c')],_0x538f27[_0x3374('0x3e')]),_0x5609de);if(_0x3baec1[_0x3374('0x3c')][_0x3374('0x47')]){_0x36f4d6[_0x3374('0x48')]=_[_0x3374('0x49')](_0x36f4d6[_0x3374('0x48')],{'$or':_['map'](_0x5609de,function(_0x34a3bd){if(_0x34a3bd[_0x3374('0x3a')]!==_0x3374('0x4a')){var _0x44b274={};_0x44b274[_0x34a3bd['name']]={'$like':'%'+_0x3baec1[_0x3374('0x3c')][_0x3374('0x47')]+'%'};return _0x44b274;}})});}_0x36f4d6=_[_0x3374('0x49')]({},_0x36f4d6,_0x3baec1[_0x3374('0x4b')]);var _0x103d36={'where':_0x36f4d6[_0x3374('0x48')]};return db[_0x3374('0x4c')][_0x3374('0x2a')](_0x103d36)['then'](function(_0x26d8b8){_0x1cc87e[_0x3374('0x2a')]=_0x26d8b8;if(_0x3baec1[_0x3374('0x3c')]['includeAll']){_0x36f4d6['include']=[{'all':!![]}];}return db[_0x3374('0x4c')][_0x3374('0x4d')](_0x36f4d6);})['then'](function(_0x1acb05){_0x1cc87e['rows']=_0x1acb05;return _0x1cc87e;})[_0x3374('0x18')](respondWithFilteredResult(_0x7dd555,_0x36f4d6))[_0x3374('0x22')](handleError(_0x7dd555,null));};exports[_0x3374('0x4e')]=function(_0x1310a1,_0xd2d7e6){var _0x340181={'raw':![],'where':{'id':_0x1310a1[_0x3374('0x4f')]['id']},'include':[{'model':db['Pause'],'as':_0x3374('0x36')}]},_0x29bb73={};_0x29bb73[_0x3374('0x40')]=_[_0x3374('0x3d')](db['WhatsappAccount'][_0x3374('0x38')]);_0x29bb73[_0x3374('0x3c')]=_[_0x3374('0x3d')](_0x1310a1['query']);_0x29bb73[_0x3374('0x3e')]=_[_0x3374('0x3f')](_0x29bb73[_0x3374('0x40')],_0x29bb73[_0x3374('0x3c')]);_0x340181[_0x3374('0x41')]=_[_0x3374('0x3f')](_0x29bb73[_0x3374('0x40')],qs[_0x3374('0x42')](_0x1310a1['query'][_0x3374('0x42')]));_0x340181[_0x3374('0x41')]=_0x340181[_0x3374('0x41')][_0x3374('0x43')]?_0x340181[_0x3374('0x41')]:_0x29bb73['model'];if(_0x1310a1['query'][_0x3374('0x50')]){_0x340181[_0x3374('0x51')]=[{'all':!![]}];}_0x340181=_[_0x3374('0x49')]({},_0x340181,_0x1310a1[_0x3374('0x4b')]);return db['WhatsappAccount'][_0x3374('0x52')](_0x340181)['then'](handleEntityNotFound(_0xd2d7e6,null))[_0x3374('0x18')](respondWithResult(_0xd2d7e6,null))['catch'](handleError(_0xd2d7e6,null));};exports[_0x3374('0x53')]=function(_0x50807e,_0x462b89){return db[_0x3374('0x4c')][_0x3374('0x53')](_0x50807e[_0x3374('0x54')],{})[_0x3374('0x18')](function(_0x819adc){var _0x2d8185=_0x50807e[_0x3374('0x55')]['get']({'plain':!![]});if(!_0x2d8185)throw new Error(_0x3374('0x56'));if(_0x2d8185[_0x3374('0x57')]===_0x3374('0x55')){var _0x3f49ed=_0x819adc[_0x3374('0x58')]({'plain':!![]});var _0x3778cc='WhatsappAccounts';return db[_0x3374('0x59')][_0x3374('0x52')]({'where':{'name':_0x3778cc,'userProfileId':_0x2d8185[_0x3374('0x5a')]},'raw':!![]})[_0x3374('0x18')](function(_0x324947){if(_0x324947&&_0x324947[_0x3374('0x5b')]===0x0){return db[_0x3374('0x31')][_0x3374('0x53')]({'name':_0x3f49ed[_0x3374('0x34')],'resourceId':_0x3f49ed['id'],'type':_0x324947[_0x3374('0x34')],'sectionId':_0x324947['id']},{})[_0x3374('0x18')](function(){return _0x819adc;});}else{return _0x819adc;}})[_0x3374('0x22')](function(_0x25482a){logger[_0x3374('0x1d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x25482a);throw _0x25482a;});}return _0x819adc;})['then'](respondWithResult(_0x462b89,0xc9))[_0x3374('0x22')](handleError(_0x462b89,null));};exports[_0x3374('0x5c')]=function(_0x5c796c,_0x46dbec){if(_0x5c796c[_0x3374('0x54')]['id']){delete _0x5c796c[_0x3374('0x54')]['id'];}return db['WhatsappAccount']['find']({'where':{'id':_0x5c796c['params']['id']},'include':[{'model':db[_0x3374('0x5d')],'as':'mandatoryDispositionPause'}]})[_0x3374('0x18')](handleEntityNotFound(_0x46dbec,null))['then'](saveUpdates(_0x5c796c[_0x3374('0x54')],null))[_0x3374('0x18')](respondWithResult(_0x46dbec,null))['catch'](handleError(_0x46dbec,null));};exports[_0x3374('0x32')]=function(_0xa76153,_0x48e078){return db[_0x3374('0x4c')][_0x3374('0x52')]({'where':{'id':_0xa76153[_0x3374('0x4f')]['id']}})[_0x3374('0x18')](handleEntityNotFound(_0x48e078,null))[_0x3374('0x18')](removeEntity(_0x48e078,null))[_0x3374('0x22')](handleError(_0x48e078,null));};exports[_0x3374('0x5e')]=function(_0x67bc7,_0x3a9cff){return db[_0x3374('0x4c')][_0x3374('0x5e')]()['then'](respondWithResult(_0x3a9cff,null))[_0x3374('0x22')](handleError(_0x3a9cff,null));};exports[_0x3374('0x5f')]=function(_0x1348d2,_0x34797e,_0x2f1717){if(_0x1348d2[_0x3374('0x54')]['id']){delete _0x1348d2['body']['id'];}return db['WhatsappAccount'][_0x3374('0x52')]({'where':{'id':_0x1348d2[_0x3374('0x4f')]['id']}})[_0x3374('0x18')](handleEntityNotFound(_0x34797e,null))[_0x3374('0x18')](function(_0x949397){if(_0x949397){_0x1348d2['body'][_0x3374('0x60')]=_0x949397['id'];return db[_0x3374('0x61')]['create'](_0x1348d2['body']);}})[_0x3374('0x18')](respondWithResult(_0x34797e,null))[_0x3374('0x22')](handleError(_0x34797e,null));};exports[_0x3374('0x62')]=function(_0x2acf26,_0x3465f5,_0x43098e){var _0x16ade6={'raw':![],'where':{}};var _0x2c4bc1={};var _0x363368={'count':0x0,'rows':[]};return db[_0x3374('0x4c')][_0x3374('0x63')]({'where':{'id':_0x2acf26[_0x3374('0x4f')]['id']}})[_0x3374('0x18')](handleEntityNotFound(_0x3465f5,null))[_0x3374('0x18')](function(_0x4d0c65){if(_0x4d0c65){_0x2c4bc1[_0x3374('0x40')]=_['keys'](db[_0x3374('0x61')][_0x3374('0x38')]);_0x2c4bc1[_0x3374('0x3c')]=_[_0x3374('0x3d')](_0x2acf26[_0x3374('0x3c')]);_0x2c4bc1[_0x3374('0x3e')]=_[_0x3374('0x3f')](_0x2c4bc1[_0x3374('0x40')],_0x2c4bc1[_0x3374('0x3c')]);_0x16ade6['attributes']=_[_0x3374('0x3f')](_0x2c4bc1[_0x3374('0x40')],qs['fields'](_0x2acf26[_0x3374('0x3c')][_0x3374('0x42')]));_0x16ade6[_0x3374('0x41')]=_0x16ade6[_0x3374('0x41')]['length']?_0x16ade6[_0x3374('0x41')]:_0x2c4bc1[_0x3374('0x40')];if(!_0x2acf26[_0x3374('0x3c')][_0x3374('0x64')](_0x3374('0x65'))){_0x16ade6[_0x3374('0x29')]=qs[_0x3374('0x29')](_0x2acf26[_0x3374('0x3c')][_0x3374('0x29')]);_0x16ade6[_0x3374('0x27')]=qs[_0x3374('0x27')](_0x2acf26[_0x3374('0x3c')]['offset']);}_0x16ade6[_0x3374('0x44')]=qs[_0x3374('0x45')](_0x2acf26[_0x3374('0x3c')][_0x3374('0x45')]);_0x16ade6['where']=qs['filters'](_[_0x3374('0x46')](_0x2acf26[_0x3374('0x3c')],_0x2c4bc1[_0x3374('0x3e')]));_0x16ade6[_0x3374('0x48')][_0x3374('0x60')]=_0x4d0c65['id'];if(_0x2acf26[_0x3374('0x3c')]['filter']){_0x16ade6[_0x3374('0x48')]=_[_0x3374('0x49')](_0x16ade6[_0x3374('0x48')],{'$or':_[_0x3374('0x37')](_0x16ade6[_0x3374('0x41')],function(_0x30b814){var _0x306cf7={};_0x306cf7[_0x30b814]={'$like':'%'+_0x2acf26[_0x3374('0x3c')][_0x3374('0x47')]+'%'};return _0x306cf7;})});}_0x16ade6=_['merge']({},_0x16ade6,_0x2acf26[_0x3374('0x4b')]);return db['Disposition'][_0x3374('0x2a')]({'where':_0x16ade6[_0x3374('0x48')]})['then'](function(_0x30d2c3){_0x363368['count']=_0x30d2c3;if(_0x2acf26[_0x3374('0x3c')][_0x3374('0x50')]){_0x16ade6[_0x3374('0x51')]=[{'all':!![]}];}return db[_0x3374('0x61')][_0x3374('0x4d')](_0x16ade6);})[_0x3374('0x18')](function(_0x5a2cb1){_0x363368[_0x3374('0x66')]=_0x5a2cb1;return _0x363368;});}})[_0x3374('0x18')](respondWithFilteredResult(_0x3465f5,_0x16ade6))['catch'](handleError(_0x3465f5,null));};exports['removeDispositions']=function(_0x314cee,_0x5b2f46,_0x5f3a6f){return db['WhatsappAccount']['find']({'where':{'id':_0x314cee[_0x3374('0x4f')]['id']}})[_0x3374('0x18')](handleEntityNotFound(_0x5b2f46,null))[_0x3374('0x18')](function(_0x3df9be){if(_0x3df9be){return _0x3df9be[_0x3374('0x67')](_0x314cee[_0x3374('0x3c')]['ids']);}})[_0x3374('0x18')](respondWithStatusCode(_0x5b2f46,null))[_0x3374('0x22')](handleError(_0x5b2f46,null));};exports['addAnswer']=function(_0x560eb5,_0x4bfd30,_0x3fd81){if(_0x560eb5[_0x3374('0x54')]['id']){delete _0x560eb5[_0x3374('0x54')]['id'];}return db[_0x3374('0x4c')]['find']({'where':{'id':_0x560eb5[_0x3374('0x4f')]['id']}})[_0x3374('0x18')](handleEntityNotFound(_0x4bfd30,null))[_0x3374('0x18')](function(_0x29056d){if(_0x29056d){_0x560eb5[_0x3374('0x54')]['WhatsappAccountId']=_0x29056d['id'];return db[_0x3374('0x68')][_0x3374('0x53')](_0x560eb5['body']);}})[_0x3374('0x18')](respondWithResult(_0x4bfd30,null))[_0x3374('0x22')](handleError(_0x4bfd30,null));};exports[_0x3374('0x69')]=function(_0x2d0271,_0x3cdaf0,_0xb5fe39){var _0x50b2b2={'raw':![],'where':{}};var _0x3c19a8={};var _0x1653e7={'count':0x0,'rows':[]};return db[_0x3374('0x4c')]['findOne']({'where':{'id':_0x2d0271[_0x3374('0x4f')]['id']}})[_0x3374('0x18')](handleEntityNotFound(_0x3cdaf0,null))[_0x3374('0x18')](function(_0x440ba3){if(_0x440ba3){_0x3c19a8[_0x3374('0x40')]=_[_0x3374('0x3d')](db[_0x3374('0x68')]['rawAttributes']);_0x3c19a8[_0x3374('0x3c')]=_[_0x3374('0x3d')](_0x2d0271[_0x3374('0x3c')]);_0x3c19a8[_0x3374('0x3e')]=_[_0x3374('0x3f')](_0x3c19a8['model'],_0x3c19a8['query']);_0x50b2b2['attributes']=_['intersection'](_0x3c19a8[_0x3374('0x40')],qs['fields'](_0x2d0271[_0x3374('0x3c')][_0x3374('0x42')]));_0x50b2b2['attributes']=_0x50b2b2[_0x3374('0x41')][_0x3374('0x43')]?_0x50b2b2['attributes']:_0x3c19a8[_0x3374('0x40')];if(!_0x2d0271[_0x3374('0x3c')][_0x3374('0x64')](_0x3374('0x65'))){_0x50b2b2[_0x3374('0x29')]=qs[_0x3374('0x29')](_0x2d0271[_0x3374('0x3c')]['limit']);_0x50b2b2[_0x3374('0x27')]=qs[_0x3374('0x27')](_0x2d0271[_0x3374('0x3c')][_0x3374('0x27')]);}_0x50b2b2[_0x3374('0x44')]=qs[_0x3374('0x45')](_0x2d0271[_0x3374('0x3c')][_0x3374('0x45')]);_0x50b2b2[_0x3374('0x48')]=qs[_0x3374('0x3e')](_['pick'](_0x2d0271[_0x3374('0x3c')],_0x3c19a8[_0x3374('0x3e')]));_0x50b2b2[_0x3374('0x48')]['WhatsappAccountId']=_0x440ba3['id'];if(_0x2d0271[_0x3374('0x3c')][_0x3374('0x47')]){_0x50b2b2['where']=_[_0x3374('0x49')](_0x50b2b2[_0x3374('0x48')],{'$or':_[_0x3374('0x37')](_0x50b2b2[_0x3374('0x41')],function(_0x16dfe6){var _0x2dae03={};_0x2dae03[_0x16dfe6]={'$like':'%'+_0x2d0271['query'][_0x3374('0x47')]+'%'};return _0x2dae03;})});}_0x50b2b2=_[_0x3374('0x49')]({},_0x50b2b2,_0x2d0271[_0x3374('0x4b')]);return db[_0x3374('0x68')][_0x3374('0x2a')]({'where':_0x50b2b2[_0x3374('0x48')]})[_0x3374('0x18')](function(_0x44e80f){_0x1653e7[_0x3374('0x2a')]=_0x44e80f;if(_0x2d0271[_0x3374('0x3c')][_0x3374('0x50')]){_0x50b2b2[_0x3374('0x51')]=[{'all':!![]}];}return db[_0x3374('0x68')][_0x3374('0x4d')](_0x50b2b2);})[_0x3374('0x18')](function(_0x27b9c7){_0x1653e7[_0x3374('0x66')]=_0x27b9c7;return _0x1653e7;});}})[_0x3374('0x18')](respondWithFilteredResult(_0x3cdaf0,_0x50b2b2))[_0x3374('0x22')](handleError(_0x3cdaf0,null));};exports[_0x3374('0x6a')]=function(_0x405b19,_0x54ae99,_0x6f6d44){return db[_0x3374('0x4c')][_0x3374('0x52')]({'where':{'id':_0x405b19[_0x3374('0x4f')]['id']}})[_0x3374('0x18')](handleEntityNotFound(_0x54ae99,null))[_0x3374('0x18')](function(_0x4a937c){if(_0x4a937c){return _0x4a937c[_0x3374('0x6a')](_0x405b19[_0x3374('0x3c')][_0x3374('0x6b')]);}})[_0x3374('0x18')](respondWithStatusCode(_0x54ae99,null))['catch'](handleError(_0x54ae99,null));};exports[_0x3374('0x6c')]=function(_0x2ff738,_0x31d1bb,_0x44bed0){return db[_0x3374('0x4c')][_0x3374('0x52')]({'where':{'id':_0x2ff738[_0x3374('0x4f')]['id']}})[_0x3374('0x18')](handleEntityNotFound(_0x31d1bb,null))['then'](function(_0x499efa){if(_0x499efa){return _0x499efa[_0x3374('0x6c')](_0x2ff738[_0x3374('0x54')][_0x3374('0x6b')],_[_0x3374('0x6d')](_0x2ff738[_0x3374('0x54')],[_0x3374('0x6b'),'id'])||{})[_0x3374('0x6e')](function(_0x2176d6){for(var _0x3b490c=0x0;_0x3b490c<_0x2ff738[_0x3374('0x54')][_0x3374('0x6b')]['length'];_0x3b490c+=0x1){socket[_0x3374('0x6f')](_0x3374('0x70'),{'UserId':Number(_0x2ff738[_0x3374('0x54')][_0x3374('0x6b')][_0x3b490c]),'WhatsappAccountId':Number(_0x2ff738[_0x3374('0x4f')]['id'])});}return _0x2176d6;});}})[_0x3374('0x18')](respondWithResult(_0x31d1bb,null))[_0x3374('0x22')](handleError(_0x31d1bb,null));};exports[_0x3374('0x71')]=function(_0xa5ef7d,_0xa58fe3,_0x1c3123){return db[_0x3374('0x4c')][_0x3374('0x52')]({'where':{'id':_0xa5ef7d[_0x3374('0x4f')]['id']}})[_0x3374('0x18')](handleEntityNotFound(_0xa58fe3,null))[_0x3374('0x18')](function(_0x553d7c){if(_0x553d7c){return _0x553d7c[_0x3374('0x71')](_0xa5ef7d['query'][_0x3374('0x6b')])[_0x3374('0x18')](function(){if(_[_0x3374('0x72')](_0xa5ef7d[_0x3374('0x3c')][_0x3374('0x6b')])){for(var _0x451ea8=0x0;_0x451ea8<_0xa5ef7d[_0x3374('0x3c')][_0x3374('0x6b')][_0x3374('0x43')];_0x451ea8+=0x1){socket[_0x3374('0x6f')](_0x3374('0x73'),{'UserId':Number(_0xa5ef7d[_0x3374('0x3c')]['ids'][_0x451ea8]),'WhatsappAccountId':Number(_0xa5ef7d[_0x3374('0x4f')]['id'])});}}else{socket[_0x3374('0x6f')](_0x3374('0x73'),{'UserId':Number(_0xa5ef7d['query'][_0x3374('0x6b')]),'WhatsappAccountId':Number(_0xa5ef7d[_0x3374('0x4f')]['id'])});}});}})[_0x3374('0x18')](respondWithStatusCode(_0xa58fe3,null))[_0x3374('0x22')](handleError(_0xa58fe3,null));};exports[_0x3374('0x74')]=function(_0x57e923,_0x5e3532,_0x49054b){var _0xb2104={};var _0x388a0a={};var _0x30df13;var _0x255067;return db[_0x3374('0x4c')][_0x3374('0x63')]({'where':{'id':_0x57e923[_0x3374('0x4f')]['id']}})[_0x3374('0x18')](handleEntityNotFound(_0x5e3532,null))[_0x3374('0x18')](function(_0x12f910){if(_0x12f910){_0x30df13=_0x12f910;_0x388a0a[_0x3374('0x40')]=_['keys'](db[_0x3374('0x75')][_0x3374('0x38')]);_0x388a0a[_0x3374('0x3c')]=_[_0x3374('0x3d')](_0x57e923[_0x3374('0x3c')]);_0x388a0a[_0x3374('0x3e')]=_[_0x3374('0x3f')](_0x388a0a['model'],_0x388a0a['query']);_0xb2104['attributes']=_[_0x3374('0x3f')](_0x388a0a[_0x3374('0x40')],qs[_0x3374('0x42')](_0x57e923[_0x3374('0x3c')][_0x3374('0x42')]));_0xb2104[_0x3374('0x41')]=_0xb2104[_0x3374('0x41')][_0x3374('0x43')]?_0xb2104[_0x3374('0x41')]:_0x388a0a['model'];_0xb2104[_0x3374('0x44')]=qs[_0x3374('0x45')](_0x57e923[_0x3374('0x3c')][_0x3374('0x45')]);_0xb2104[_0x3374('0x48')]=qs['filters'](_[_0x3374('0x46')](_0x57e923[_0x3374('0x3c')],_0x388a0a[_0x3374('0x3e')]));if(_0x57e923[_0x3374('0x3c')]['filter']){_0xb2104[_0x3374('0x48')]=_[_0x3374('0x49')](_0xb2104[_0x3374('0x48')],{'$or':_[_0x3374('0x37')](_0xb2104[_0x3374('0x41')],function(_0x56a7d9){var _0x520282={};_0x520282[_0x56a7d9]={'$like':'%'+_0x57e923['query'][_0x3374('0x47')]+'%'};return _0x520282;})});}_0xb2104=_['merge']({},_0xb2104,_0x57e923[_0x3374('0x4b')]);return _0x30df13[_0x3374('0x74')](_0xb2104);}})[_0x3374('0x18')](function(_0xa41e72){if(_0xa41e72){_0x255067=_0xa41e72['length'];if(!_0x57e923[_0x3374('0x3c')][_0x3374('0x64')](_0x3374('0x65'))){_0xb2104[_0x3374('0x29')]=qs[_0x3374('0x29')](_0x57e923['query']['limit']);_0xb2104[_0x3374('0x27')]=qs[_0x3374('0x27')](_0x57e923[_0x3374('0x3c')][_0x3374('0x27')]);}return _0x30df13[_0x3374('0x74')](_0xb2104);}})['then'](function(_0x2294e5){if(_0x2294e5){return _0x2294e5?{'count':_0x255067,'rows':_0x2294e5}:null;}})[_0x3374('0x18')](respondWithResult(_0x5e3532,null))[_0x3374('0x22')](handleError(_0x5e3532,null));};exports[_0x3374('0x76')]=function(_0x5b37fc,_0x97451b){var _0xb93c39=_0x5b37fc[_0x3374('0x4f')]['id'];var _0x3d1adf=_0x5b37fc['body'];var _0x2ab668=0xc8;var _0x415293=null;return db[_0x3374('0x77')][_0x3374('0x78')]({'isolationLevel':db[_0x3374('0x77')][_0x3374('0x79')][_0x3374('0x7a')]['READ_COMMITTED']},function(_0x23b0b1){return db[_0x3374('0x4c')][_0x3374('0x63')]({'where':{'id':_0xb93c39},'transaction':_0x23b0b1})[_0x3374('0x18')](function(_0x2c1cce){if(_0x2c1cce){return db[_0x3374('0x7b')]['destroy']({'where':{'WhatsappAccountId':_0xb93c39},'transaction':_0x23b0b1})[_0x3374('0x18')](function(){var _0x2df05c=_[_0x3374('0x37')](_0x3d1adf,function(_0x5a0bf8){_0x5a0bf8[_0x3374('0x60')]=_0xb93c39;return _0x5a0bf8;});return db[_0x3374('0x7b')]['bulkCreate'](_0x2df05c,{'transaction':_0x23b0b1});});}else{_0x2ab668=0x194;_0x415293=[];}});})['then'](function(){if(_0x2ab668!==0x194){return db[_0x3374('0x7b')][_0x3374('0x7c')]({'where':{'WhatsappAccountId':_0xb93c39},'order':_0x3374('0x7d')})[_0x3374('0x18')](function(_0x22f922){_0x415293=_0x22f922;});}})['catch'](function(_0x5a7467){_0x2ab668=0x1f4;logger[_0x3374('0x1d')](_0x5a7467['stack']);if(_0x5a7467[_0x3374('0x34')]){delete _0x5a7467[_0x3374('0x34')];}_0x415293=_0x5a7467;})[_0x3374('0x7e')](function(){if(_0x415293===null){_0x97451b[_0x3374('0x23')](_0x2ab668);}else{if(_0x2ab668===0x1f4){_0x97451b[_0x3374('0x24')](_0x2ab668)[_0x3374('0x35')](_0x415293);}else{_0x97451b[_0x3374('0x24')](_0x2ab668)[_0x3374('0x26')](_0x415293);}}});};exports[_0x3374('0x7f')]=function(_0x57820b,_0x2cbab9,_0x1e8e8d){var _0x30d226={};var _0x5b2369={};var _0x1056cc;var _0x1ee6e0;return db['WhatsappAccount'][_0x3374('0x63')]({'where':{'id':_0x57820b['params']['id']}})[_0x3374('0x18')](handleEntityNotFound(_0x2cbab9,null))['then'](function(_0x54d447){if(_0x54d447){_0x1056cc=_0x54d447;_0x5b2369['model']=_[_0x3374('0x3d')](db[_0x3374('0x7b')]['rawAttributes']);_0x5b2369[_0x3374('0x3c')]=_[_0x3374('0x3d')](_0x57820b[_0x3374('0x3c')]);_0x5b2369['filters']=_[_0x3374('0x3f')](_0x5b2369[_0x3374('0x40')],_0x5b2369[_0x3374('0x3c')]);_0x30d226[_0x3374('0x41')]=_[_0x3374('0x3f')](_0x5b2369[_0x3374('0x40')],qs[_0x3374('0x42')](_0x57820b[_0x3374('0x3c')]['fields']));_0x30d226[_0x3374('0x41')]=_0x30d226[_0x3374('0x41')][_0x3374('0x43')]?_0x30d226[_0x3374('0x41')]:_0x5b2369[_0x3374('0x40')];_0x30d226['order']=qs['sort'](_0x57820b[_0x3374('0x3c')][_0x3374('0x45')]);_0x30d226[_0x3374('0x48')]=qs['filters'](_['pick'](_0x57820b[_0x3374('0x3c')],_0x5b2369[_0x3374('0x3e')]));if(_0x57820b['query'][_0x3374('0x47')]){_0x30d226[_0x3374('0x48')]=_[_0x3374('0x49')](_0x30d226[_0x3374('0x48')],{'$or':_[_0x3374('0x37')](_0x30d226['attributes'],function(_0x5f1a35){var _0x5d63={};_0x5d63[_0x5f1a35]={'$like':'%'+_0x57820b['query'][_0x3374('0x47')]+'%'};return _0x5d63;})});}_0x30d226=_[_0x3374('0x49')]({},_0x30d226,_0x57820b[_0x3374('0x4b')]);return _0x1056cc[_0x3374('0x7f')](_0x30d226);}})[_0x3374('0x18')](function(_0x21d36c){if(_0x21d36c){_0x1ee6e0=_0x21d36c['length'];if(!_0x57820b[_0x3374('0x3c')][_0x3374('0x64')](_0x3374('0x65'))){_0x30d226['limit']=qs[_0x3374('0x29')](_0x57820b[_0x3374('0x3c')]['limit']);_0x30d226[_0x3374('0x27')]=qs['offset'](_0x57820b[_0x3374('0x3c')][_0x3374('0x27')]);}return _0x1056cc[_0x3374('0x7f')](_0x30d226);}})[_0x3374('0x18')](function(_0x3a7aed){if(_0x3a7aed){return _0x3a7aed?{'count':_0x1ee6e0,'rows':_0x3a7aed}:null;}})['then'](respondWithResult(_0x2cbab9,null))[_0x3374('0x22')](handleError(_0x2cbab9,null));};exports['notify']=function(_0x9ab153,_0x77a20c,_0x28e3f3){var _0x4c5b81={'channel':'whatsapp'};var _0x3d59c1=[];var _0x4fbee8=[];var _0x374188={};return db[_0x3374('0x4c')][_0x3374('0x52')]({'where':{'id':_0x9ab153[_0x3374('0x4f')]['id']},'include':[{'model':db[_0x3374('0x7b')],'as':_0x3374('0x80')}]})['then'](handleEntityNotFound(_0x77a20c,null))['then'](function(_0x35df28){_0x4c5b81[_0x3374('0x81')]=_0x35df28;if(_0x4c5b81['account']&&_0x4c5b81[_0x3374('0x81')][_0x3374('0x3a')]==='sinch'&&_0x9ab153[_0x3374('0x54')]['statuses']){if(_0x9ab153[_0x3374('0x54')][_0x3374('0x82')][_0x3374('0x43')]===0x0)return;if(_0x9ab153[_0x3374('0x54')][_0x3374('0x82')][0x0][_0x3374('0x83')]!==_0x3374('0x84'))return;return db['WhatsappMessage'][_0x3374('0x5c')]({'read':!![],'readAt':_0x9ab153[_0x3374('0x54')]['statuses'][0x0][_0x3374('0x85')]},{'where':{'messageId':_0x9ab153[_0x3374('0x54')][_0x3374('0x82')][0x0][_0x3374('0x86')]},'individualHooks':!![]})[_0x3374('0x18')](function(_0x225b72){return _0x77a20c[_0x3374('0x24')](0xc8)[_0x3374('0x26')](_0x225b72);});}_0x4c5b81[_0x3374('0x87')]=_[_0x3374('0x88')](_0x35df28[_0x3374('0x80')],['priority'],['asc']);if(_0x4c5b81['account'][_0x3374('0x80')]){delete _0x4c5b81[_0x3374('0x81')][_0x3374('0x80')];}return db[_0x3374('0x89')][_0x3374('0x5e')]()['then'](function(_0x58fc9a){if(!_0x58fc9a){throw new db[(_0x3374('0x8a'))][(_0x3374('0x8b'))](_0x3374('0x8c'));}_0x3d59c1=_[_0x3374('0x8d')](_[_0x3374('0x3d')](_0x58fc9a),[_0x3374('0x8e'),'updatedAt']);_0x4fbee8=_[_0x3374('0x8d')](_[_0x3374('0x3d')](_0x58fc9a),[_0x3374('0x8e'),_0x3374('0x8f'),_0x3374('0x90'),_0x3374('0x91')]);_0x4c5b81[_0x3374('0x54')]={'mapKey':_0x3374('0x92')};if(_0x4c5b81[_0x3374('0x81')]&&_0x4c5b81['account'][_0x3374('0x3a')]===_0x3374('0x93')){_0x4c5b81['body'][_0x3374('0x94')]=_0x9ab153[_0x3374('0x54')][_0x3374('0x95')][_0x3374('0x96')]('whatsapp:','');_0x4c5b81[_0x3374('0x54')][_0x3374('0x54')]=_0x9ab153[_0x3374('0x54')][_0x3374('0x97')];_0x4c5b81[_0x3374('0x54')][_0x3374('0x98')]=_0x9ab153['body'][_0x3374('0x99')];}if(_0x4c5b81['account']&&_0x4c5b81['account'][_0x3374('0x3a')]==='sinch'){_0x4c5b81[_0x3374('0x54')][_0x3374('0x94')]=_0x9ab153['body'][_0x3374('0x9a')][0x0][_0x3374('0x94')];_0x4c5b81[_0x3374('0x54')][_0x3374('0x54')]=_0x9ab153['body']['notifications'][0x0]['message'][_0x3374('0x54')];_0x4c5b81[_0x3374('0x54')]['messageId']=_0x9ab153[_0x3374('0x54')][_0x3374('0x9a')][0x0][_0x3374('0x86')];}if(_0x4c5b81[_0x3374('0x54')]['id']){delete _0x4c5b81[_0x3374('0x54')]['id'];}if(_[_0x3374('0x9b')](_0x4c5b81[_0x3374('0x54')][_0x3374('0x94')])){throw new db[(_0x3374('0x8a'))][(_0x3374('0x8b'))](_0x3374('0x9c'));}if(_['isNil'](_0x4c5b81[_0x3374('0x54')][_0x3374('0x54')])||_0x4c5b81['body'][_0x3374('0x54')]===''){throw new db[(_0x3374('0x8a'))][(_0x3374('0x8b'))](_0x3374('0x9d'));}if(_[_0x3374('0x9b')](_0x4c5b81[_0x3374('0x54')][_0x3374('0x9e')])){throw new db[(_0x3374('0x8a'))][(_0x3374('0x8b'))](_0x3374('0x9f')+_0x4fbee8);}if(!_['includes'](_0x4fbee8,_0x4c5b81[_0x3374('0x54')][_0x3374('0x9e')])){throw new db[(_0x3374('0x8a'))][(_0x3374('0x8b'))](_0x3374('0xa0')+_0x4fbee8);}_0x374188[_0x4c5b81[_0x3374('0x54')]['mapKey']]=_0x4c5b81['body']['from'];return db['CmList']['find']({'where':{'id':_0x4c5b81[_0x3374('0x81')][_0x3374('0x91')]},'include':[{'model':db[_0x3374('0x89')],'as':_0x3374('0xa1'),'where':_0x374188,'limit':0x1,'order':[['updatedAt','DESC']]}]});})[_0x3374('0x18')](handleEntityNotFound(_0x77a20c,null))['then'](function(_0x245d57){if(_0x245d57){_0x4c5b81[_0x3374('0xa2')]=_[_0x3374('0x6d')](_0x245d57,[_0x3374('0xa1')]);if(_0x245d57['Contacts'][_0x3374('0x43')]){return _0x245d57[_0x3374('0xa1')][0x0];}var _0x249cc=_[_0x3374('0x14')](_0x4c5b81[_0x3374('0x54')],{'firstName':_0x4c5b81[_0x3374('0x54')][_0x3374('0x94')],'ListId':_0x245d57['id']});_0x249cc[_0x4c5b81[_0x3374('0x54')][_0x3374('0x9e')]]=_0x4c5b81[_0x3374('0x54')]['from'];return db['CmContact']['create'](_0x249cc,{'fields':_0x3d59c1,'raw':!![]});}})[_0x3374('0x18')](handleEntityNotFound(_0x77a20c,null))['then'](function(_0x1833d6){if(_0x1833d6){_0x4c5b81[_0x3374('0xa3')]=_0x1833d6;var _0x401289={'ContactId':_0x1833d6['id'],'phone':_0x4c5b81[_0x3374('0x54')][_0x3374('0x94')],'WhatsappAccountId':_0x9ab153[_0x3374('0x4f')]['id']};var _0x303897={'ContactId':_0x1833d6['id'],'WhatsappAccountId':_0x9ab153[_0x3374('0x4f')]['id'],'closed':![]};return db['WhatsappInteraction'][_0x3374('0x52')]({'where':_0x303897})[_0x3374('0x18')](function(_0x3e13ad){if(_0x3e13ad){return[_0x3e13ad,![]];}return db[_0x3374('0xa4')]['create'](_0x401289)[_0x3374('0x18')](function(_0x49267c){return[_0x49267c,!![]];});});}})[_0x3374('0x6e')](function(_0x35125d,_0x46d17c){_0x4c5b81[_0x3374('0xa5')]=_0x35125d[_0x3374('0x58')]({'plain':!![]});_0x4c5b81[_0x3374('0xa5')][_0x3374('0xa6')]=![];if(_0x46d17c){if(_0x4c5b81['account']['autoclose']){_0x4c5b81[_0x3374('0x87')][_0x3374('0xa7')]({'id':0x0,'priority':_0x4c5b81[_0x3374('0x87')][_0x3374('0x43')]+0x1,'app':'close','appdata':_0x3374('0xa8'),'interval':_0x3374('0xa9')});}_0x4c5b81[_0x3374('0xa5')][_0x3374('0xa6')]=!![];}return db[_0x3374('0xaa')][_0x3374('0x53')]({'phone':_0x4c5b81['body']['from'],'messageId':_0x4c5b81['body']['messageId'],'body':_0x4c5b81[_0x3374('0x54')]['body'],'WhatsappAccountId':_0x9ab153['params']['id'],'WhatsappInteractionId':_0x35125d['id'],'direction':'in','ContactId':_0x35125d['ContactId'],'AttachmentId':_0x4c5b81['body']['AttachmentId']});})[_0x3374('0x18')](function(_0x5597d9){_0x4c5b81[_0x3374('0x1f')]=_0x5597d9;if(!_0x4c5b81[_0x3374('0xa5')][_0x3374('0xab')])return;return db[_0x3374('0x75')][_0x3374('0x52')]({'attributes':['id',_0x3374('0x34')],'where':{'id':_0x4c5b81['interaction']['UserId']}});})[_0x3374('0x18')](function(_0x40386f){if(_0x40386f){_0x4c5b81['applications']['unshift']({'id':0x0,'priority':0x0,'app':_0x3374('0xac'),'appdata':_0x40386f[_0x3374('0x34')]+','+(_0x4c5b81[_0x3374('0x81')]['waitForTheAssignedAgent']||0xa),'interval':_0x3374('0xa9')});}if(!_0x4c5b81[_0x3374('0xa5')][_0x3374('0xad')])return;return db[_0x3374('0xae')][_0x3374('0x52')]({'attributes':['id',_0x3374('0x34')],'where':{'id':_0x4c5b81[_0x3374('0xa5')][_0x3374('0xad')]}});})[_0x3374('0x18')](function(_0x16888d){if(_0x16888d){_0x4c5b81['applications']['unshift']({'id':0x0,'priority':0x1,'app':_0x3374('0xaf'),'appdata':_0x16888d[_0x3374('0x34')]+','+(_0x4c5b81['account'][_0x3374('0xb0')]||0x12c),'interval':_0x3374('0xa9')});}return respondWithRpcPromise(_0x3374('0xb1'),_0x3374('0xb2'),_0x4c5b81);})[_0x3374('0x18')](function(_0x79e3c1){if(_0x79e3c1){var _0x100ba8=0xc8;var _0x2c181d=_0x3374('0xb3');logger[_0x3374('0x20')](_0x3374('0x1b'),_0x2c181d,_0x100ba8,_0x3374('0xb4'));logger['debug'](_0x3374('0xb5'),_0x2c181d,_0x100ba8,_0x3374('0xb4'),JSON[_0x3374('0x1c')](_0x79e3c1));if(_0x4c5b81[_0x3374('0x81')]['type']===_0x3374('0x93')){return _0x77a20c[_0x3374('0x24')](_0x100ba8)['set'](_0x3374('0xb6'),_0x3374('0xb7'))[_0x3374('0x35')](_0x3374('0xb8'));}else{return _0x77a20c['status'](_0x100ba8)['json'](_0x79e3c1);}}});})[_0x3374('0x22')](handleError(_0x77a20c,null));};exports[_0x3374('0x35')]=function(_0x392dbc,_0x4dcf58,_0x3f9f35){var _0xb24075,_0x61aaff,_0xfd314b;if(_[_0x3374('0x9b')](_0x392dbc['body'][_0x3374('0x54')])||_0x392dbc[_0x3374('0x54')][_0x3374('0x54')]===''){throw new db[(_0x3374('0x8a'))]['ValidationError'](_0x3374('0x9d'));}if(_[_0x3374('0x9b')](_0x392dbc['body']['to'])){throw new db[(_0x3374('0x8a'))][(_0x3374('0x8b'))](_0x3374('0xb9'));}_0xb24075=_0x392dbc[_0x3374('0x54')]['to'];return db[_0x3374('0x4c')][_0x3374('0x52')]({'where':{'id':_0x392dbc['params']['id']},'include':[{'model':db[_0x3374('0xba')],'as':_0x3374('0xbb'),'include':[{'model':db['CmContact'],'as':'Contacts','where':{'mobile':_0xb24075},'limit':0x1,'order':[[_0x3374('0x8f'),_0x3374('0xbc')]]}]}]})['then'](handleEntityNotFound(_0x4dcf58,null))[_0x3374('0x18')](function(_0x3d5f70){if(_0x3d5f70&&_0x3d5f70[_0x3374('0xbb')]){_0x61aaff=_0x3d5f70['get']({'plain':!![]});if(_0x61aaff[_0x3374('0xbb')]&&_0x61aaff[_0x3374('0xbb')][_0x3374('0xa1')][_0x3374('0x43')]){return _0x61aaff[_0x3374('0xbb')][_0x3374('0xa1')][0x0];}return db[_0x3374('0x89')][_0x3374('0x53')](_[_0x3374('0x14')](_0x392dbc[_0x3374('0x54')],{'firstName':_0xb24075,'mobile':_0xb24075,'phone':_0xb24075,'ListId':_0x61aaff[_0x3374('0x91')]}));}})[_0x3374('0x18')](handleEntityNotFound(_0x4dcf58,null))[_0x3374('0x18')](function(_0x50ecd5){if(_0x50ecd5){_0xfd314b=_0x50ecd5;return db[_0x3374('0xa4')][_0x3374('0x52')]({'where':{'ContactId':_0xfd314b['id'],'closed':![],'WhatsappAccountId':_0x61aaff['id']}})[_0x3374('0x18')](function(_0x3c0a43){if(_0x3c0a43){return[_0x3c0a43,![]];}return db[_0x3374('0xa4')][_0x3374('0x53')]({'UserId':_0x392dbc[_0x3374('0x55')]['id'],'ContactId':_0xfd314b['id'],'WhatsappAccountId':_0x61aaff['id'],'phone':_0xb24075,'firstMsgDirection':_0x3374('0xbd'),'Messages':[_[_0x3374('0x49')](_0x392dbc[_0x3374('0x54')],{'read':![],'body':_0x392dbc['body'][_0x3374('0x54')],'phone':_0xb24075,'WhatsappAccountId':_0x61aaff['id'],'UserId':_0x392dbc[_0x3374('0x55')]['id'],'ContactId':_0xfd314b['id']})]},{'include':[{'model':db[_0x3374('0xaa')],'as':_0x3374('0xbe')}]})[_0x3374('0x18')](function(_0x480b60){return[_0x480b60,!![]];});});}})[_0x3374('0x6e')](function(_0x13eb30,_0x16e574){if(_0x16e574){return _0x13eb30;}return db[_0x3374('0xaa')][_0x3374('0x53')](_[_0x3374('0x49')](_0x392dbc[_0x3374('0x54')],{'read':![],'body':_0x392dbc[_0x3374('0x54')]['body'],'phone':_0xb24075,'WhatsappAccountId':_0x61aaff['id'],'WhatsappInteractionId':_0x13eb30['id'],'UserId':_0x392dbc[_0x3374('0x55')]['id'],'ContactId':_0xfd314b['id']}))[_0x3374('0x18')](function(_0x4f1a55){_0x13eb30[_0x3374('0xbf')]['Messages']=[];_0x13eb30[_0x3374('0xbf')][_0x3374('0xbe')]['push'](_0x4f1a55[_0x3374('0xbf')]);return _0x13eb30;});})[_0x3374('0x18')](respondWithResult(_0x4dcf58,null))[_0x3374('0x22')](handleError(_0x4dcf58,null));}; \ No newline at end of file +var _0xd5b4=['count','set','Content-Range','apply','save','update','get','WhatsappAccounts','UserProfileResource','destroy','end','stack','send','index','Pause','mandatoryDispositionPause','map','WhatsappAccount','rawAttributes','type','key','model','name','query','keys','filters','intersection','attributes','fields','length','limit','sort','where','pick','filter','merge','options','include','findAll','show','params','includeAll','create','role','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','WhatsappAccountId','Disposition','getDispositions','findOne','hasOwnProperty','nolimit','order','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','rows','removeAnswers','addAgents','omit','emit','removeAgents','userWhatsappAccount:remove','getAgents','addApplications','sequelize','transaction','Transaction','READ_COMMITTED','WhatsappApplication','bulkCreate','findAndCountAll','finally','getApplications','notify','whatsapp','account','statuses','read','WhatsappMessage','applications','Applications','priority','asc','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','ListId','mobile','twilio','from','From','replace','whatsapp:','Body','messageId','MessageSid','sinch','notifications','message_id','isNil','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','Contacts','DESC','list','WhatsappInteraction','spread','interaction','created','autoclose','push','unmanaged','ContactId','AttachmentId','UserId','agent','waitForTheAssignedAgent','*,*,*,*','queueId','WhatsappQueue','unshift','queue','waitForTheAssignedQueue','startRouting','receiveMessage','entity\x20found','Content-Type','text/xml','\x0a','CmList','List','user','dataValues','Messages','eml-format','rimraf','fast-json-patch','moment','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','jayson/promise','client','http','request','then','info','WhatsappAccount,\x20%s,\x20%s','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','json','offset'];(function(_0xdeaaaf,_0x267a2c){var _0x1fa264=function(_0x3e3ab8){while(--_0x3e3ab8){_0xdeaaaf['push'](_0xdeaaaf['shift']());}};_0x1fa264(++_0x267a2c);}(_0xd5b4,0x157));var _0x4d5b=function(_0x4a20f2,_0x16ecd0){_0x4a20f2=_0x4a20f2-0x0;var _0x52d2ff=_0xd5b4[_0x4a20f2];return _0x52d2ff;};'use strict';var emlformat=require(_0x4d5b('0x0'));var rimraf=require(_0x4d5b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4d5b('0x2'));var rp=require('request-promise');var moment=require(_0x4d5b('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x4d5b('0x4'));var path=require(_0x4d5b('0x5'));var sox=require('sox');var csv=require(_0x4d5b('0x6'));var ejs=require(_0x4d5b('0x7'));var fs=require('fs');var fs_extra=require(_0x4d5b('0x8'));var _=require(_0x4d5b('0x9'));var squel=require(_0x4d5b('0xa'));var crypto=require(_0x4d5b('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x4d5b('0xc'));var toCsv=require(_0x4d5b('0x6'));var querystring=require(_0x4d5b('0xd'));var Papa=require(_0x4d5b('0xe'));var Redis=require(_0x4d5b('0xf'));var authService=require(_0x4d5b('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x4d5b('0x11'));var hardwareService=require(_0x4d5b('0x12'));var logger=require('../../config/logger')(_0x4d5b('0x13'));var utils=require(_0x4d5b('0x14'));var config=require(_0x4d5b('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x4d5b('0x16'))['db'];config['redis']=_[_0x4d5b('0x17')](config[_0x4d5b('0x18')],{'host':_0x4d5b('0x19'),'port':0x18eb});var socket=require(_0x4d5b('0x1a'))(new Redis(config[_0x4d5b('0x18')]));require('./whatsappAccount.socket')['register'](socket);var jayson=require(_0x4d5b('0x1b'));var client=jayson[_0x4d5b('0x1c')][_0x4d5b('0x1d')]({'port':0x232c});function respondWithRpcPromise(_0xa3ff40,_0x3037b8,_0x145ce4,_0x2a9165){return new BPromise(function(_0x5ef281,_0x59f19e){var _0x31bb1a=_0x2a9165||client;return _0x31bb1a[_0x4d5b('0x1e')](_0xa3ff40,_0x145ce4)[_0x4d5b('0x1f')](function(_0x502a1e){logger[_0x4d5b('0x20')](_0x4d5b('0x21'),_0x3037b8,'request\x20sent');logger[_0x4d5b('0x22')](_0x4d5b('0x23'),_0x3037b8,_0x4d5b('0x24'),JSON[_0x4d5b('0x25')](_0x502a1e));if(_0x502a1e[_0x4d5b('0x26')]){if(_0x502a1e['error'][_0x4d5b('0x27')]===0x1f4){logger[_0x4d5b('0x26')](_0x4d5b('0x21'),_0x3037b8,_0x502a1e[_0x4d5b('0x26')][_0x4d5b('0x28')]);return _0x59f19e(_0x502a1e[_0x4d5b('0x26')][_0x4d5b('0x28')]);}logger[_0x4d5b('0x26')](_0x4d5b('0x21'),_0x3037b8,_0x502a1e[_0x4d5b('0x26')][_0x4d5b('0x28')]);return _0x5ef281(_0x502a1e[_0x4d5b('0x26')][_0x4d5b('0x28')]);}else{logger[_0x4d5b('0x20')]('WhatsappAccount,\x20%s,\x20%s',_0x3037b8,_0x4d5b('0x24'));_0x5ef281(_0x502a1e[_0x4d5b('0x29')][_0x4d5b('0x28')]);}})[_0x4d5b('0x2a')](function(_0x516edb){logger['error'](_0x4d5b('0x21'),_0x3037b8,_0x516edb);_0x59f19e(_0x516edb);});});}function respondWithStatusCode(_0x56f595,_0x2810d6){_0x2810d6=_0x2810d6||0xcc;return function(_0x32cbf3){if(_0x32cbf3){return _0x56f595[_0x4d5b('0x2b')](_0x2810d6);}return _0x56f595[_0x4d5b('0x2c')](_0x2810d6)['end']();};}function respondWithResult(_0x3f139b,_0x3b15b9){_0x3b15b9=_0x3b15b9||0xc8;return function(_0x4b03ad){if(_0x4b03ad){return _0x3f139b['status'](_0x3b15b9)[_0x4d5b('0x2d')](_0x4b03ad);}};}function respondWithFilteredResult(_0x23bbf5,_0x4720e4){return function(_0x38b500){if(_0x38b500){var _0x274d7a=typeof _0x4720e4[_0x4d5b('0x2e')]==='undefined'&&typeof _0x4720e4['limit']==='undefined';var _0x35d206=_0x38b500[_0x4d5b('0x2f')];var _0x817a1d=_0x274d7a?0x0:_0x4720e4[_0x4d5b('0x2e')];var _0x17fdee=_0x274d7a?_0x38b500['count']:_0x4720e4['offset']+_0x4720e4['limit'];var _0x309174;if(_0x17fdee>=_0x35d206){_0x17fdee=_0x35d206;_0x309174=0xc8;}else{_0x309174=0xce;}_0x23bbf5[_0x4d5b('0x2c')](_0x309174);return _0x23bbf5[_0x4d5b('0x30')](_0x4d5b('0x31'),_0x817a1d+'-'+_0x17fdee+'/'+_0x35d206)[_0x4d5b('0x2d')](_0x38b500);}return null;};}function patchUpdates(_0x4cc664){return function(_0x13fc37){try{jsonpatch[_0x4d5b('0x32')](_0x13fc37,_0x4cc664,!![]);}catch(_0x5d39dc){return BPromise['reject'](_0x5d39dc);}return _0x13fc37[_0x4d5b('0x33')]();};}function saveUpdates(_0x28cb70,_0x28caac){return function(_0x1c9baa){if(_0x1c9baa){return _0x1c9baa[_0x4d5b('0x34')](_0x28cb70)[_0x4d5b('0x1f')](function(_0x3b5b4e){return _0x3b5b4e;});}return null;};}function removeEntity(_0x134775,_0x35cb94){return function(_0x5f54cf){if(_0x5f54cf){return _0x5f54cf['destroy']()['then'](function(){var _0x26bcd8=_0x5f54cf[_0x4d5b('0x35')]({'plain':!![]});var _0x51e0e4=_0x4d5b('0x36');return db[_0x4d5b('0x37')][_0x4d5b('0x38')]({'where':{'type':_0x51e0e4,'resourceId':_0x26bcd8['id']}})['then'](function(){return _0x5f54cf;});})[_0x4d5b('0x1f')](function(){_0x134775[_0x4d5b('0x2c')](0xcc)[_0x4d5b('0x39')]();});}};}function handleEntityNotFound(_0x5ae589,_0x1d5c97){return function(_0x5ad951){if(!_0x5ad951){_0x5ae589[_0x4d5b('0x2b')](0x194);}return _0x5ad951;};}function handleError(_0x39dc41,_0xdf4be0){_0xdf4be0=_0xdf4be0||0x1f4;return function(_0x22a47c){logger[_0x4d5b('0x26')](_0x22a47c[_0x4d5b('0x3a')]);if(_0x22a47c['name']){delete _0x22a47c['name'];}_0x39dc41[_0x4d5b('0x2c')](_0xdf4be0)[_0x4d5b('0x3b')](_0x22a47c);};}exports[_0x4d5b('0x3c')]=function(_0x3437a2,_0x546882){var _0x4d660d={'include':[{'model':db[_0x4d5b('0x3d')],'as':_0x4d5b('0x3e')}]},_0x150f26={},_0x3ed4db={'count':0x0,'rows':[]};var _0x1e92e3=_[_0x4d5b('0x3f')](db[_0x4d5b('0x40')][_0x4d5b('0x41')],function(_0x51cb77){return{'name':_0x51cb77['fieldName'],'type':_0x51cb77[_0x4d5b('0x42')][_0x4d5b('0x43')]};});_0x150f26[_0x4d5b('0x44')]=_[_0x4d5b('0x3f')](_0x1e92e3,_0x4d5b('0x45'));_0x150f26[_0x4d5b('0x46')]=_[_0x4d5b('0x47')](_0x3437a2[_0x4d5b('0x46')]);_0x150f26[_0x4d5b('0x48')]=_[_0x4d5b('0x49')](_0x150f26['model'],_0x150f26[_0x4d5b('0x46')]);_0x4d660d[_0x4d5b('0x4a')]=_[_0x4d5b('0x49')](_0x150f26[_0x4d5b('0x44')],qs[_0x4d5b('0x4b')](_0x3437a2[_0x4d5b('0x46')][_0x4d5b('0x4b')]));_0x4d660d[_0x4d5b('0x4a')]=_0x4d660d[_0x4d5b('0x4a')][_0x4d5b('0x4c')]?_0x4d660d[_0x4d5b('0x4a')]:_0x150f26['model'];if(!_0x3437a2[_0x4d5b('0x46')]['hasOwnProperty']('nolimit')){_0x4d660d[_0x4d5b('0x4d')]=qs[_0x4d5b('0x4d')](_0x3437a2[_0x4d5b('0x46')]['limit']);_0x4d660d[_0x4d5b('0x2e')]=qs[_0x4d5b('0x2e')](_0x3437a2[_0x4d5b('0x46')][_0x4d5b('0x2e')]);}_0x4d660d['order']=qs[_0x4d5b('0x4e')](_0x3437a2[_0x4d5b('0x46')][_0x4d5b('0x4e')]);_0x4d660d[_0x4d5b('0x4f')]=qs[_0x4d5b('0x48')](_[_0x4d5b('0x50')](_0x3437a2[_0x4d5b('0x46')],_0x150f26['filters']),_0x1e92e3);if(_0x3437a2['query'][_0x4d5b('0x51')]){_0x4d660d['where']=_['merge'](_0x4d660d[_0x4d5b('0x4f')],{'$or':_[_0x4d5b('0x3f')](_0x1e92e3,function(_0x320d41){if(_0x320d41['type']!=='VIRTUAL'){var _0x2d8f84={};_0x2d8f84[_0x320d41['name']]={'$like':'%'+_0x3437a2[_0x4d5b('0x46')]['filter']+'%'};return _0x2d8f84;}})});}_0x4d660d=_[_0x4d5b('0x52')]({},_0x4d660d,_0x3437a2[_0x4d5b('0x53')]);var _0x36c03a={'where':_0x4d660d[_0x4d5b('0x4f')]};return db[_0x4d5b('0x40')][_0x4d5b('0x2f')](_0x36c03a)[_0x4d5b('0x1f')](function(_0x572dde){_0x3ed4db['count']=_0x572dde;if(_0x3437a2['query']['includeAll']){_0x4d660d[_0x4d5b('0x54')]=[{'all':!![]}];}return db[_0x4d5b('0x40')][_0x4d5b('0x55')](_0x4d660d);})[_0x4d5b('0x1f')](function(_0x56ee4b){_0x3ed4db['rows']=_0x56ee4b;return _0x3ed4db;})[_0x4d5b('0x1f')](respondWithFilteredResult(_0x546882,_0x4d660d))[_0x4d5b('0x2a')](handleError(_0x546882,null));};exports[_0x4d5b('0x56')]=function(_0x46275b,_0x3e69bb){var _0x5f2670={'raw':![],'where':{'id':_0x46275b[_0x4d5b('0x57')]['id']},'include':[{'model':db['Pause'],'as':_0x4d5b('0x3e')}]},_0x1e5940={};_0x1e5940[_0x4d5b('0x44')]=_[_0x4d5b('0x47')](db[_0x4d5b('0x40')][_0x4d5b('0x41')]);_0x1e5940[_0x4d5b('0x46')]=_[_0x4d5b('0x47')](_0x46275b[_0x4d5b('0x46')]);_0x1e5940[_0x4d5b('0x48')]=_[_0x4d5b('0x49')](_0x1e5940['model'],_0x1e5940[_0x4d5b('0x46')]);_0x5f2670[_0x4d5b('0x4a')]=_[_0x4d5b('0x49')](_0x1e5940[_0x4d5b('0x44')],qs[_0x4d5b('0x4b')](_0x46275b[_0x4d5b('0x46')][_0x4d5b('0x4b')]));_0x5f2670[_0x4d5b('0x4a')]=_0x5f2670[_0x4d5b('0x4a')]['length']?_0x5f2670[_0x4d5b('0x4a')]:_0x1e5940[_0x4d5b('0x44')];if(_0x46275b[_0x4d5b('0x46')][_0x4d5b('0x58')]){_0x5f2670[_0x4d5b('0x54')]=[{'all':!![]}];}_0x5f2670=_[_0x4d5b('0x52')]({},_0x5f2670,_0x46275b[_0x4d5b('0x53')]);return db[_0x4d5b('0x40')]['find'](_0x5f2670)['then'](handleEntityNotFound(_0x3e69bb,null))[_0x4d5b('0x1f')](respondWithResult(_0x3e69bb,null))[_0x4d5b('0x2a')](handleError(_0x3e69bb,null));};exports['create']=function(_0x19a846,_0x5be7e4){return db[_0x4d5b('0x40')][_0x4d5b('0x59')](_0x19a846['body'],{})['then'](function(_0x2dd358){var _0x1f7f9c=_0x19a846['user'][_0x4d5b('0x35')]({'plain':!![]});if(!_0x1f7f9c)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1f7f9c[_0x4d5b('0x5a')]==='user'){var _0x48c6ce=_0x2dd358[_0x4d5b('0x35')]({'plain':!![]});var _0x2aa04a=_0x4d5b('0x36');return db[_0x4d5b('0x5b')][_0x4d5b('0x5c')]({'where':{'name':_0x2aa04a,'userProfileId':_0x1f7f9c[_0x4d5b('0x5d')]},'raw':!![]})['then'](function(_0x352c09){if(_0x352c09&&_0x352c09[_0x4d5b('0x5e')]===0x0){return db[_0x4d5b('0x37')]['create']({'name':_0x48c6ce[_0x4d5b('0x45')],'resourceId':_0x48c6ce['id'],'type':_0x352c09[_0x4d5b('0x45')],'sectionId':_0x352c09['id']},{})[_0x4d5b('0x1f')](function(){return _0x2dd358;});}else{return _0x2dd358;}})['catch'](function(_0x204921){logger[_0x4d5b('0x26')](_0x4d5b('0x5f'),_0x204921);throw _0x204921;});}return _0x2dd358;})[_0x4d5b('0x1f')](respondWithResult(_0x5be7e4,0xc9))['catch'](handleError(_0x5be7e4,null));};exports[_0x4d5b('0x34')]=function(_0x1c73a2,_0x60a925){if(_0x1c73a2[_0x4d5b('0x60')]['id']){delete _0x1c73a2[_0x4d5b('0x60')]['id'];}return db[_0x4d5b('0x40')][_0x4d5b('0x5c')]({'where':{'id':_0x1c73a2['params']['id']},'include':[{'model':db['Pause'],'as':_0x4d5b('0x3e')}]})['then'](handleEntityNotFound(_0x60a925,null))[_0x4d5b('0x1f')](saveUpdates(_0x1c73a2[_0x4d5b('0x60')],null))[_0x4d5b('0x1f')](respondWithResult(_0x60a925,null))[_0x4d5b('0x2a')](handleError(_0x60a925,null));};exports['destroy']=function(_0x12e9f5,_0x148c1f){return db['WhatsappAccount'][_0x4d5b('0x5c')]({'where':{'id':_0x12e9f5['params']['id']}})['then'](handleEntityNotFound(_0x148c1f,null))['then'](removeEntity(_0x148c1f,null))[_0x4d5b('0x2a')](handleError(_0x148c1f,null));};exports[_0x4d5b('0x61')]=function(_0x41f3fa,_0x350ced){return db['WhatsappAccount']['describe']()[_0x4d5b('0x1f')](respondWithResult(_0x350ced,null))[_0x4d5b('0x2a')](handleError(_0x350ced,null));};exports['addDisposition']=function(_0xdd1184,_0x588277,_0x3d10d9){if(_0xdd1184[_0x4d5b('0x60')]['id']){delete _0xdd1184[_0x4d5b('0x60')]['id'];}return db[_0x4d5b('0x40')][_0x4d5b('0x5c')]({'where':{'id':_0xdd1184[_0x4d5b('0x57')]['id']}})[_0x4d5b('0x1f')](handleEntityNotFound(_0x588277,null))['then'](function(_0x4053ce){if(_0x4053ce){_0xdd1184[_0x4d5b('0x60')][_0x4d5b('0x62')]=_0x4053ce['id'];return db[_0x4d5b('0x63')][_0x4d5b('0x59')](_0xdd1184[_0x4d5b('0x60')]);}})[_0x4d5b('0x1f')](respondWithResult(_0x588277,null))['catch'](handleError(_0x588277,null));};exports[_0x4d5b('0x64')]=function(_0x272654,_0x14e101,_0x79738a){var _0x37b094={'raw':![],'where':{}};var _0xd79762={};var _0x4ed0e1={'count':0x0,'rows':[]};return db['WhatsappAccount'][_0x4d5b('0x65')]({'where':{'id':_0x272654[_0x4d5b('0x57')]['id']}})[_0x4d5b('0x1f')](handleEntityNotFound(_0x14e101,null))[_0x4d5b('0x1f')](function(_0x2ed494){if(_0x2ed494){_0xd79762[_0x4d5b('0x44')]=_[_0x4d5b('0x47')](db[_0x4d5b('0x63')][_0x4d5b('0x41')]);_0xd79762[_0x4d5b('0x46')]=_['keys'](_0x272654[_0x4d5b('0x46')]);_0xd79762[_0x4d5b('0x48')]=_[_0x4d5b('0x49')](_0xd79762[_0x4d5b('0x44')],_0xd79762['query']);_0x37b094[_0x4d5b('0x4a')]=_[_0x4d5b('0x49')](_0xd79762[_0x4d5b('0x44')],qs['fields'](_0x272654[_0x4d5b('0x46')]['fields']));_0x37b094[_0x4d5b('0x4a')]=_0x37b094[_0x4d5b('0x4a')][_0x4d5b('0x4c')]?_0x37b094[_0x4d5b('0x4a')]:_0xd79762[_0x4d5b('0x44')];if(!_0x272654['query'][_0x4d5b('0x66')](_0x4d5b('0x67'))){_0x37b094[_0x4d5b('0x4d')]=qs['limit'](_0x272654[_0x4d5b('0x46')][_0x4d5b('0x4d')]);_0x37b094['offset']=qs['offset'](_0x272654[_0x4d5b('0x46')]['offset']);}_0x37b094[_0x4d5b('0x68')]=qs['sort'](_0x272654['query'][_0x4d5b('0x4e')]);_0x37b094[_0x4d5b('0x4f')]=qs[_0x4d5b('0x48')](_[_0x4d5b('0x50')](_0x272654[_0x4d5b('0x46')],_0xd79762['filters']));_0x37b094['where'][_0x4d5b('0x62')]=_0x2ed494['id'];if(_0x272654[_0x4d5b('0x46')]['filter']){_0x37b094[_0x4d5b('0x4f')]=_[_0x4d5b('0x52')](_0x37b094['where'],{'$or':_[_0x4d5b('0x3f')](_0x37b094[_0x4d5b('0x4a')],function(_0x5e4f02){var _0xa743cf={};_0xa743cf[_0x5e4f02]={'$like':'%'+_0x272654[_0x4d5b('0x46')][_0x4d5b('0x51')]+'%'};return _0xa743cf;})});}_0x37b094=_[_0x4d5b('0x52')]({},_0x37b094,_0x272654[_0x4d5b('0x53')]);return db[_0x4d5b('0x63')][_0x4d5b('0x2f')]({'where':_0x37b094['where']})['then'](function(_0xeedd5){_0x4ed0e1[_0x4d5b('0x2f')]=_0xeedd5;if(_0x272654[_0x4d5b('0x46')][_0x4d5b('0x58')]){_0x37b094[_0x4d5b('0x54')]=[{'all':!![]}];}return db[_0x4d5b('0x63')][_0x4d5b('0x55')](_0x37b094);})[_0x4d5b('0x1f')](function(_0x59bace){_0x4ed0e1['rows']=_0x59bace;return _0x4ed0e1;});}})[_0x4d5b('0x1f')](respondWithFilteredResult(_0x14e101,_0x37b094))['catch'](handleError(_0x14e101,null));};exports[_0x4d5b('0x69')]=function(_0x173a8d,_0x8d9c9,_0x2fd3db){return db[_0x4d5b('0x40')][_0x4d5b('0x5c')]({'where':{'id':_0x173a8d[_0x4d5b('0x57')]['id']}})[_0x4d5b('0x1f')](handleEntityNotFound(_0x8d9c9,null))['then'](function(_0x2447ea){if(_0x2447ea){return _0x2447ea[_0x4d5b('0x69')](_0x173a8d[_0x4d5b('0x46')][_0x4d5b('0x6a')]);}})[_0x4d5b('0x1f')](respondWithStatusCode(_0x8d9c9,null))[_0x4d5b('0x2a')](handleError(_0x8d9c9,null));};exports[_0x4d5b('0x6b')]=function(_0x4e1de3,_0x8c3ab5,_0x465bb4){if(_0x4e1de3[_0x4d5b('0x60')]['id']){delete _0x4e1de3[_0x4d5b('0x60')]['id'];}return db['WhatsappAccount'][_0x4d5b('0x5c')]({'where':{'id':_0x4e1de3[_0x4d5b('0x57')]['id']}})[_0x4d5b('0x1f')](handleEntityNotFound(_0x8c3ab5,null))[_0x4d5b('0x1f')](function(_0x46add0){if(_0x46add0){_0x4e1de3['body']['WhatsappAccountId']=_0x46add0['id'];return db[_0x4d5b('0x6c')]['create'](_0x4e1de3[_0x4d5b('0x60')]);}})['then'](respondWithResult(_0x8c3ab5,null))[_0x4d5b('0x2a')](handleError(_0x8c3ab5,null));};exports[_0x4d5b('0x6d')]=function(_0xec3c3c,_0x48de44,_0x108c93){var _0xf7eb={'raw':![],'where':{}};var _0x1ac241={};var _0x207838={'count':0x0,'rows':[]};return db[_0x4d5b('0x40')][_0x4d5b('0x65')]({'where':{'id':_0xec3c3c[_0x4d5b('0x57')]['id']}})[_0x4d5b('0x1f')](handleEntityNotFound(_0x48de44,null))[_0x4d5b('0x1f')](function(_0x19cc47){if(_0x19cc47){_0x1ac241[_0x4d5b('0x44')]=_['keys'](db[_0x4d5b('0x6c')][_0x4d5b('0x41')]);_0x1ac241['query']=_[_0x4d5b('0x47')](_0xec3c3c[_0x4d5b('0x46')]);_0x1ac241['filters']=_[_0x4d5b('0x49')](_0x1ac241[_0x4d5b('0x44')],_0x1ac241[_0x4d5b('0x46')]);_0xf7eb[_0x4d5b('0x4a')]=_[_0x4d5b('0x49')](_0x1ac241['model'],qs[_0x4d5b('0x4b')](_0xec3c3c[_0x4d5b('0x46')]['fields']));_0xf7eb[_0x4d5b('0x4a')]=_0xf7eb[_0x4d5b('0x4a')]['length']?_0xf7eb[_0x4d5b('0x4a')]:_0x1ac241[_0x4d5b('0x44')];if(!_0xec3c3c['query']['hasOwnProperty'](_0x4d5b('0x67'))){_0xf7eb['limit']=qs['limit'](_0xec3c3c[_0x4d5b('0x46')][_0x4d5b('0x4d')]);_0xf7eb[_0x4d5b('0x2e')]=qs[_0x4d5b('0x2e')](_0xec3c3c[_0x4d5b('0x46')][_0x4d5b('0x2e')]);}_0xf7eb[_0x4d5b('0x68')]=qs[_0x4d5b('0x4e')](_0xec3c3c['query'][_0x4d5b('0x4e')]);_0xf7eb[_0x4d5b('0x4f')]=qs[_0x4d5b('0x48')](_[_0x4d5b('0x50')](_0xec3c3c[_0x4d5b('0x46')],_0x1ac241[_0x4d5b('0x48')]));_0xf7eb[_0x4d5b('0x4f')]['WhatsappAccountId']=_0x19cc47['id'];if(_0xec3c3c[_0x4d5b('0x46')][_0x4d5b('0x51')]){_0xf7eb[_0x4d5b('0x4f')]=_[_0x4d5b('0x52')](_0xf7eb[_0x4d5b('0x4f')],{'$or':_['map'](_0xf7eb[_0x4d5b('0x4a')],function(_0x168dc0){var _0x3cc824={};_0x3cc824[_0x168dc0]={'$like':'%'+_0xec3c3c[_0x4d5b('0x46')][_0x4d5b('0x51')]+'%'};return _0x3cc824;})});}_0xf7eb=_['merge']({},_0xf7eb,_0xec3c3c['options']);return db[_0x4d5b('0x6c')][_0x4d5b('0x2f')]({'where':_0xf7eb[_0x4d5b('0x4f')]})[_0x4d5b('0x1f')](function(_0xe37535){_0x207838['count']=_0xe37535;if(_0xec3c3c['query']['includeAll']){_0xf7eb[_0x4d5b('0x54')]=[{'all':!![]}];}return db[_0x4d5b('0x6c')][_0x4d5b('0x55')](_0xf7eb);})[_0x4d5b('0x1f')](function(_0x4e4e1e){_0x207838[_0x4d5b('0x6e')]=_0x4e4e1e;return _0x207838;});}})[_0x4d5b('0x1f')](respondWithFilteredResult(_0x48de44,_0xf7eb))[_0x4d5b('0x2a')](handleError(_0x48de44,null));};exports[_0x4d5b('0x6f')]=function(_0x25d044,_0x2377f9,_0x166251){return db[_0x4d5b('0x40')][_0x4d5b('0x5c')]({'where':{'id':_0x25d044[_0x4d5b('0x57')]['id']}})['then'](handleEntityNotFound(_0x2377f9,null))['then'](function(_0x76f7b3){if(_0x76f7b3){return _0x76f7b3['removeAnswers'](_0x25d044[_0x4d5b('0x46')]['ids']);}})[_0x4d5b('0x1f')](respondWithStatusCode(_0x2377f9,null))[_0x4d5b('0x2a')](handleError(_0x2377f9,null));};exports[_0x4d5b('0x70')]=function(_0x2747cc,_0x3918d8,_0x573dc6){return db[_0x4d5b('0x40')]['find']({'where':{'id':_0x2747cc[_0x4d5b('0x57')]['id']}})[_0x4d5b('0x1f')](handleEntityNotFound(_0x3918d8,null))[_0x4d5b('0x1f')](function(_0x30e75b){if(_0x30e75b){return _0x30e75b['addAgents'](_0x2747cc['body']['ids'],_[_0x4d5b('0x71')](_0x2747cc[_0x4d5b('0x60')],[_0x4d5b('0x6a'),'id'])||{})['spread'](function(_0x4d6031){for(var _0x3bbb4c=0x0;_0x3bbb4c<_0x2747cc[_0x4d5b('0x60')][_0x4d5b('0x6a')][_0x4d5b('0x4c')];_0x3bbb4c+=0x1){socket[_0x4d5b('0x72')]('userWhatsappAccount:save',{'UserId':Number(_0x2747cc['body'][_0x4d5b('0x6a')][_0x3bbb4c]),'WhatsappAccountId':Number(_0x2747cc[_0x4d5b('0x57')]['id'])});}return _0x4d6031;});}})[_0x4d5b('0x1f')](respondWithResult(_0x3918d8,null))[_0x4d5b('0x2a')](handleError(_0x3918d8,null));};exports[_0x4d5b('0x73')]=function(_0x1ed444,_0xc1c1b6,_0x39f65b){return db[_0x4d5b('0x40')][_0x4d5b('0x5c')]({'where':{'id':_0x1ed444[_0x4d5b('0x57')]['id']}})[_0x4d5b('0x1f')](handleEntityNotFound(_0xc1c1b6,null))[_0x4d5b('0x1f')](function(_0x52c786){if(_0x52c786){return _0x52c786[_0x4d5b('0x73')](_0x1ed444[_0x4d5b('0x46')]['ids'])[_0x4d5b('0x1f')](function(){if(_['isArray'](_0x1ed444['query'][_0x4d5b('0x6a')])){for(var _0x5bd514=0x0;_0x5bd514<_0x1ed444['query'][_0x4d5b('0x6a')]['length'];_0x5bd514+=0x1){socket[_0x4d5b('0x72')](_0x4d5b('0x74'),{'UserId':Number(_0x1ed444[_0x4d5b('0x46')][_0x4d5b('0x6a')][_0x5bd514]),'WhatsappAccountId':Number(_0x1ed444['params']['id'])});}}else{socket[_0x4d5b('0x72')](_0x4d5b('0x74'),{'UserId':Number(_0x1ed444[_0x4d5b('0x46')]['ids']),'WhatsappAccountId':Number(_0x1ed444[_0x4d5b('0x57')]['id'])});}});}})['then'](respondWithStatusCode(_0xc1c1b6,null))['catch'](handleError(_0xc1c1b6,null));};exports[_0x4d5b('0x75')]=function(_0x2fe228,_0x3ec86c,_0x568b06){var _0xef9520={};var _0x3d17ef={};var _0x7ecac9;var _0x36af0e;return db[_0x4d5b('0x40')][_0x4d5b('0x65')]({'where':{'id':_0x2fe228[_0x4d5b('0x57')]['id']}})[_0x4d5b('0x1f')](handleEntityNotFound(_0x3ec86c,null))['then'](function(_0x5084ea){if(_0x5084ea){_0x7ecac9=_0x5084ea;_0x3d17ef[_0x4d5b('0x44')]=_['keys'](db['User'][_0x4d5b('0x41')]);_0x3d17ef[_0x4d5b('0x46')]=_['keys'](_0x2fe228[_0x4d5b('0x46')]);_0x3d17ef[_0x4d5b('0x48')]=_['intersection'](_0x3d17ef[_0x4d5b('0x44')],_0x3d17ef[_0x4d5b('0x46')]);_0xef9520[_0x4d5b('0x4a')]=_[_0x4d5b('0x49')](_0x3d17ef[_0x4d5b('0x44')],qs[_0x4d5b('0x4b')](_0x2fe228[_0x4d5b('0x46')][_0x4d5b('0x4b')]));_0xef9520[_0x4d5b('0x4a')]=_0xef9520[_0x4d5b('0x4a')]['length']?_0xef9520['attributes']:_0x3d17ef[_0x4d5b('0x44')];_0xef9520[_0x4d5b('0x68')]=qs[_0x4d5b('0x4e')](_0x2fe228[_0x4d5b('0x46')]['sort']);_0xef9520[_0x4d5b('0x4f')]=qs['filters'](_[_0x4d5b('0x50')](_0x2fe228['query'],_0x3d17ef[_0x4d5b('0x48')]));if(_0x2fe228[_0x4d5b('0x46')]['filter']){_0xef9520[_0x4d5b('0x4f')]=_[_0x4d5b('0x52')](_0xef9520[_0x4d5b('0x4f')],{'$or':_['map'](_0xef9520[_0x4d5b('0x4a')],function(_0x4b7ea6){var _0x565836={};_0x565836[_0x4b7ea6]={'$like':'%'+_0x2fe228[_0x4d5b('0x46')]['filter']+'%'};return _0x565836;})});}_0xef9520=_[_0x4d5b('0x52')]({},_0xef9520,_0x2fe228['options']);return _0x7ecac9[_0x4d5b('0x75')](_0xef9520);}})[_0x4d5b('0x1f')](function(_0x1a3283){if(_0x1a3283){_0x36af0e=_0x1a3283[_0x4d5b('0x4c')];if(!_0x2fe228[_0x4d5b('0x46')][_0x4d5b('0x66')](_0x4d5b('0x67'))){_0xef9520[_0x4d5b('0x4d')]=qs[_0x4d5b('0x4d')](_0x2fe228[_0x4d5b('0x46')][_0x4d5b('0x4d')]);_0xef9520['offset']=qs['offset'](_0x2fe228['query']['offset']);}return _0x7ecac9[_0x4d5b('0x75')](_0xef9520);}})[_0x4d5b('0x1f')](function(_0x37e134){if(_0x37e134){return _0x37e134?{'count':_0x36af0e,'rows':_0x37e134}:null;}})[_0x4d5b('0x1f')](respondWithResult(_0x3ec86c,null))['catch'](handleError(_0x3ec86c,null));};exports[_0x4d5b('0x76')]=function(_0x27338b,_0x1b5e20){var _0x4528ff=_0x27338b['params']['id'];var _0x5f2723=_0x27338b['body'];var _0x115f10=0xc8;var _0x2ddfba=null;return db[_0x4d5b('0x77')][_0x4d5b('0x78')]({'isolationLevel':db[_0x4d5b('0x77')][_0x4d5b('0x79')]['ISOLATION_LEVELS'][_0x4d5b('0x7a')]},function(_0x31ed8a){return db['WhatsappAccount'][_0x4d5b('0x65')]({'where':{'id':_0x4528ff},'transaction':_0x31ed8a})[_0x4d5b('0x1f')](function(_0x14186c){if(_0x14186c){return db[_0x4d5b('0x7b')]['destroy']({'where':{'WhatsappAccountId':_0x4528ff},'transaction':_0x31ed8a})[_0x4d5b('0x1f')](function(){var _0x8970f7=_[_0x4d5b('0x3f')](_0x5f2723,function(_0x4f092f){_0x4f092f['WhatsappAccountId']=_0x4528ff;return _0x4f092f;});return db['WhatsappApplication'][_0x4d5b('0x7c')](_0x8970f7,{'transaction':_0x31ed8a});});}else{_0x115f10=0x194;_0x2ddfba=[];}});})[_0x4d5b('0x1f')](function(){if(_0x115f10!==0x194){return db[_0x4d5b('0x7b')][_0x4d5b('0x7d')]({'where':{'WhatsappAccountId':_0x4528ff},'order':'priority'})[_0x4d5b('0x1f')](function(_0x1ee57f){_0x2ddfba=_0x1ee57f;});}})['catch'](function(_0x4cd075){_0x115f10=0x1f4;logger[_0x4d5b('0x26')](_0x4cd075['stack']);if(_0x4cd075[_0x4d5b('0x45')]){delete _0x4cd075[_0x4d5b('0x45')];}_0x2ddfba=_0x4cd075;})[_0x4d5b('0x7e')](function(){if(_0x2ddfba===null){_0x1b5e20['sendStatus'](_0x115f10);}else{if(_0x115f10===0x1f4){_0x1b5e20['status'](_0x115f10)['send'](_0x2ddfba);}else{_0x1b5e20[_0x4d5b('0x2c')](_0x115f10)[_0x4d5b('0x2d')](_0x2ddfba);}}});};exports[_0x4d5b('0x7f')]=function(_0x2b5cc3,_0x4005a2,_0x249688){var _0x43c02e={};var _0x3b1ef0={};var _0x2a4c82;var _0xa88b08;return db[_0x4d5b('0x40')][_0x4d5b('0x65')]({'where':{'id':_0x2b5cc3[_0x4d5b('0x57')]['id']}})[_0x4d5b('0x1f')](handleEntityNotFound(_0x4005a2,null))[_0x4d5b('0x1f')](function(_0x5b0e85){if(_0x5b0e85){_0x2a4c82=_0x5b0e85;_0x3b1ef0[_0x4d5b('0x44')]=_[_0x4d5b('0x47')](db[_0x4d5b('0x7b')]['rawAttributes']);_0x3b1ef0[_0x4d5b('0x46')]=_[_0x4d5b('0x47')](_0x2b5cc3['query']);_0x3b1ef0[_0x4d5b('0x48')]=_['intersection'](_0x3b1ef0[_0x4d5b('0x44')],_0x3b1ef0[_0x4d5b('0x46')]);_0x43c02e[_0x4d5b('0x4a')]=_[_0x4d5b('0x49')](_0x3b1ef0[_0x4d5b('0x44')],qs[_0x4d5b('0x4b')](_0x2b5cc3['query']['fields']));_0x43c02e[_0x4d5b('0x4a')]=_0x43c02e[_0x4d5b('0x4a')][_0x4d5b('0x4c')]?_0x43c02e[_0x4d5b('0x4a')]:_0x3b1ef0[_0x4d5b('0x44')];_0x43c02e[_0x4d5b('0x68')]=qs[_0x4d5b('0x4e')](_0x2b5cc3[_0x4d5b('0x46')]['sort']);_0x43c02e[_0x4d5b('0x4f')]=qs[_0x4d5b('0x48')](_['pick'](_0x2b5cc3['query'],_0x3b1ef0[_0x4d5b('0x48')]));if(_0x2b5cc3[_0x4d5b('0x46')][_0x4d5b('0x51')]){_0x43c02e['where']=_[_0x4d5b('0x52')](_0x43c02e['where'],{'$or':_['map'](_0x43c02e[_0x4d5b('0x4a')],function(_0xf9c673){var _0x1ca0f7={};_0x1ca0f7[_0xf9c673]={'$like':'%'+_0x2b5cc3[_0x4d5b('0x46')]['filter']+'%'};return _0x1ca0f7;})});}_0x43c02e=_[_0x4d5b('0x52')]({},_0x43c02e,_0x2b5cc3[_0x4d5b('0x53')]);return _0x2a4c82[_0x4d5b('0x7f')](_0x43c02e);}})[_0x4d5b('0x1f')](function(_0x4f98fa){if(_0x4f98fa){_0xa88b08=_0x4f98fa[_0x4d5b('0x4c')];if(!_0x2b5cc3[_0x4d5b('0x46')][_0x4d5b('0x66')](_0x4d5b('0x67'))){_0x43c02e[_0x4d5b('0x4d')]=qs[_0x4d5b('0x4d')](_0x2b5cc3[_0x4d5b('0x46')]['limit']);_0x43c02e[_0x4d5b('0x2e')]=qs[_0x4d5b('0x2e')](_0x2b5cc3[_0x4d5b('0x46')][_0x4d5b('0x2e')]);}return _0x2a4c82[_0x4d5b('0x7f')](_0x43c02e);}})[_0x4d5b('0x1f')](function(_0x16889f){if(_0x16889f){return _0x16889f?{'count':_0xa88b08,'rows':_0x16889f}:null;}})[_0x4d5b('0x1f')](respondWithResult(_0x4005a2,null))[_0x4d5b('0x2a')](handleError(_0x4005a2,null));};exports[_0x4d5b('0x80')]=function(_0x15a787,_0x24b7f7,_0xa414cf){var _0x4b7619={'channel':_0x4d5b('0x81')};var _0x4a85a7=[];var _0x3d5092=[];var _0xcbd37={};return db[_0x4d5b('0x40')][_0x4d5b('0x5c')]({'where':{'id':_0x15a787[_0x4d5b('0x57')]['id']},'include':[{'model':db[_0x4d5b('0x7b')],'as':'Applications'}]})['then'](handleEntityNotFound(_0x24b7f7,null))[_0x4d5b('0x1f')](function(_0x3b7621){_0x4b7619[_0x4d5b('0x82')]=_0x3b7621;if(_0x4b7619['account']&&_0x4b7619[_0x4d5b('0x82')]['type']==='sinch'&&_0x15a787[_0x4d5b('0x60')][_0x4d5b('0x83')]){if(_0x15a787[_0x4d5b('0x60')][_0x4d5b('0x83')]['length']===0x0)return;if(_0x15a787['body']['statuses'][0x0]['state']!==_0x4d5b('0x84'))return;return db[_0x4d5b('0x85')]['update']({'read':!![],'readAt':_0x15a787[_0x4d5b('0x60')]['statuses'][0x0]['timestamp']},{'where':{'messageId':_0x15a787[_0x4d5b('0x60')]['statuses'][0x0]['message_id']},'individualHooks':!![]})[_0x4d5b('0x1f')](function(_0x74352c){return _0x24b7f7[_0x4d5b('0x2c')](0xc8)[_0x4d5b('0x2d')](_0x74352c);});}_0x4b7619[_0x4d5b('0x86')]=_['orderBy'](_0x3b7621[_0x4d5b('0x87')],[_0x4d5b('0x88')],[_0x4d5b('0x89')]);if(_0x4b7619[_0x4d5b('0x82')][_0x4d5b('0x87')]){delete _0x4b7619[_0x4d5b('0x82')]['Applications'];}return db[_0x4d5b('0x8a')][_0x4d5b('0x61')]()[_0x4d5b('0x1f')](function(_0x4a4ff5){if(!_0x4a4ff5){throw new db[(_0x4d5b('0x8b'))][(_0x4d5b('0x8c'))](_0x4d5b('0x8d'));}_0x4a85a7=_[_0x4d5b('0x8e')](_[_0x4d5b('0x47')](_0x4a4ff5),[_0x4d5b('0x8f'),_0x4d5b('0x90')]);_0x3d5092=_[_0x4d5b('0x8e')](_[_0x4d5b('0x47')](_0x4a4ff5),[_0x4d5b('0x8f'),'updatedAt','CompanyId',_0x4d5b('0x91')]);_0x4b7619['body']={'mapKey':_0x4d5b('0x92')};if(_0x4b7619['account']&&_0x4b7619['account'][_0x4d5b('0x42')]===_0x4d5b('0x93')){_0x4b7619['body'][_0x4d5b('0x94')]=_0x15a787[_0x4d5b('0x60')][_0x4d5b('0x95')][_0x4d5b('0x96')](_0x4d5b('0x97'),'');_0x4b7619['body'][_0x4d5b('0x60')]=_0x15a787[_0x4d5b('0x60')][_0x4d5b('0x98')];_0x4b7619[_0x4d5b('0x60')][_0x4d5b('0x99')]=_0x15a787[_0x4d5b('0x60')][_0x4d5b('0x9a')];}if(_0x4b7619[_0x4d5b('0x82')]&&_0x4b7619['account'][_0x4d5b('0x42')]===_0x4d5b('0x9b')){_0x4b7619[_0x4d5b('0x60')][_0x4d5b('0x94')]=_0x15a787[_0x4d5b('0x60')][_0x4d5b('0x9c')][0x0][_0x4d5b('0x94')];_0x4b7619[_0x4d5b('0x60')][_0x4d5b('0x60')]=_0x15a787['body'][_0x4d5b('0x9c')][0x0]['message'][_0x4d5b('0x60')];_0x4b7619[_0x4d5b('0x60')][_0x4d5b('0x99')]=_0x15a787[_0x4d5b('0x60')][_0x4d5b('0x9c')][0x0][_0x4d5b('0x9d')];}if(_0x4b7619['body']['id']){delete _0x4b7619[_0x4d5b('0x60')]['id'];}if(_[_0x4d5b('0x9e')](_0x4b7619['body'][_0x4d5b('0x94')])){throw new db[(_0x4d5b('0x8b'))]['ValidationError'](_0x4d5b('0x9f'));}if(_[_0x4d5b('0x9e')](_0x4b7619[_0x4d5b('0x60')][_0x4d5b('0x60')])||_0x4b7619[_0x4d5b('0x60')][_0x4d5b('0x60')]===''){throw new db[(_0x4d5b('0x8b'))][(_0x4d5b('0x8c'))](_0x4d5b('0xa0'));}if(_['isNil'](_0x4b7619[_0x4d5b('0x60')][_0x4d5b('0xa1')])){throw new db[(_0x4d5b('0x8b'))][(_0x4d5b('0x8c'))](_0x4d5b('0xa2')+_0x3d5092);}if(!_['includes'](_0x3d5092,_0x4b7619[_0x4d5b('0x60')][_0x4d5b('0xa1')])){throw new db[(_0x4d5b('0x8b'))][(_0x4d5b('0x8c'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x3d5092);}_0xcbd37[_0x4b7619['body']['mapKey']]=_0x4b7619[_0x4d5b('0x60')][_0x4d5b('0x94')];return db['CmList']['find']({'where':{'id':_0x4b7619['account'][_0x4d5b('0x91')]},'include':[{'model':db['CmContact'],'as':_0x4d5b('0xa3'),'where':_0xcbd37,'limit':0x1,'order':[[_0x4d5b('0x90'),_0x4d5b('0xa4')]]}]});})[_0x4d5b('0x1f')](handleEntityNotFound(_0x24b7f7,null))[_0x4d5b('0x1f')](function(_0x4db147){if(_0x4db147){_0x4b7619[_0x4d5b('0xa5')]=_[_0x4d5b('0x71')](_0x4db147,[_0x4d5b('0xa3')]);if(_0x4db147['Contacts']['length']){return _0x4db147[_0x4d5b('0xa3')][0x0];}var _0xcc3785=_[_0x4d5b('0x17')](_0x4b7619[_0x4d5b('0x60')],{'firstName':_0x4b7619[_0x4d5b('0x60')]['from'],'ListId':_0x4db147['id']});_0xcc3785[_0x4b7619[_0x4d5b('0x60')][_0x4d5b('0xa1')]]=_0x4b7619['body'][_0x4d5b('0x94')];return db[_0x4d5b('0x8a')]['create'](_0xcc3785,{'fields':_0x4a85a7,'raw':!![]});}})[_0x4d5b('0x1f')](handleEntityNotFound(_0x24b7f7,null))[_0x4d5b('0x1f')](function(_0xe73e59){if(_0xe73e59){_0x4b7619['contact']=_0xe73e59;var _0x1ca60f={'ContactId':_0xe73e59['id'],'phone':_0x4b7619['body'][_0x4d5b('0x94')],'WhatsappAccountId':_0x15a787[_0x4d5b('0x57')]['id']};var _0x670fe7={'ContactId':_0xe73e59['id'],'WhatsappAccountId':_0x15a787[_0x4d5b('0x57')]['id'],'closed':![]};return db[_0x4d5b('0xa6')][_0x4d5b('0x5c')]({'where':_0x670fe7})['then'](function(_0x2229e9){if(_0x2229e9){return[_0x2229e9,![]];}return db[_0x4d5b('0xa6')][_0x4d5b('0x59')](_0x1ca60f)[_0x4d5b('0x1f')](function(_0xe4d040){return[_0xe4d040,!![]];});});}})[_0x4d5b('0xa7')](function(_0x3d3237,_0x50613d){_0x4b7619[_0x4d5b('0xa8')]=_0x3d3237[_0x4d5b('0x35')]({'plain':!![]});_0x4b7619[_0x4d5b('0xa8')][_0x4d5b('0xa9')]=![];if(_0x50613d){if(_0x4b7619['account'][_0x4d5b('0xaa')]){_0x4b7619['applications'][_0x4d5b('0xab')]({'id':0x0,'priority':_0x4b7619['applications'][_0x4d5b('0x4c')]+0x1,'app':'close','appdata':_0x4d5b('0xac'),'interval':'*,*,*,*'});}_0x4b7619[_0x4d5b('0xa8')][_0x4d5b('0xa9')]=!![];}return db[_0x4d5b('0x85')][_0x4d5b('0x59')]({'phone':_0x4b7619[_0x4d5b('0x60')][_0x4d5b('0x94')],'messageId':_0x4b7619[_0x4d5b('0x60')]['messageId'],'body':_0x4b7619[_0x4d5b('0x60')]['body'],'WhatsappAccountId':_0x15a787[_0x4d5b('0x57')]['id'],'WhatsappInteractionId':_0x3d3237['id'],'direction':'in','ContactId':_0x3d3237[_0x4d5b('0xad')],'AttachmentId':_0x4b7619[_0x4d5b('0x60')][_0x4d5b('0xae')]});})[_0x4d5b('0x1f')](function(_0x26f397){_0x4b7619[_0x4d5b('0x28')]=_0x26f397;if(!_0x4b7619[_0x4d5b('0xa8')][_0x4d5b('0xaf')])return;return db['User'][_0x4d5b('0x5c')]({'attributes':['id',_0x4d5b('0x45')],'where':{'id':_0x4b7619['interaction'][_0x4d5b('0xaf')]}});})[_0x4d5b('0x1f')](function(_0x39633c){if(_0x39633c){_0x4b7619[_0x4d5b('0x86')]['unshift']({'id':0x0,'priority':0x0,'app':_0x4d5b('0xb0'),'appdata':_0x39633c[_0x4d5b('0x45')]+','+(_0x4b7619['account'][_0x4d5b('0xb1')]||0xa),'interval':_0x4d5b('0xb2')});}if(!_0x4b7619['interaction'][_0x4d5b('0xb3')])return;return db[_0x4d5b('0xb4')][_0x4d5b('0x5c')]({'attributes':['id',_0x4d5b('0x45')],'where':{'id':_0x4b7619['interaction'][_0x4d5b('0xb3')]}});})['then'](function(_0x443f2a){if(_0x443f2a){_0x4b7619[_0x4d5b('0x86')][_0x4d5b('0xb5')]({'id':0x0,'priority':0x1,'app':_0x4d5b('0xb6'),'appdata':_0x443f2a['name']+','+(_0x4b7619[_0x4d5b('0x82')][_0x4d5b('0xb7')]||0x12c),'interval':_0x4d5b('0xb2')});}return respondWithRpcPromise('Start',_0x4d5b('0xb8'),_0x4b7619);})[_0x4d5b('0x1f')](function(_0x4720c7){if(_0x4720c7){var _0x3b95c7=0xc8;var _0x15c761=_0x4d5b('0xb9');logger[_0x4d5b('0x20')](_0x4d5b('0x23'),_0x15c761,_0x3b95c7,_0x4d5b('0xba'));logger['debug']('WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s',_0x15c761,_0x3b95c7,_0x4d5b('0xba'),JSON[_0x4d5b('0x25')](_0x4720c7));if(_0x4b7619[_0x4d5b('0x82')][_0x4d5b('0x42')]===_0x4d5b('0x93')){return _0x24b7f7[_0x4d5b('0x2c')](_0x3b95c7)[_0x4d5b('0x30')](_0x4d5b('0xbb'),_0x4d5b('0xbc'))['send'](_0x4d5b('0xbd'));}else{return _0x24b7f7[_0x4d5b('0x2c')](_0x3b95c7)['json'](_0x4720c7);}}});})[_0x4d5b('0x2a')](handleError(_0x24b7f7,null));};exports[_0x4d5b('0x3b')]=function(_0x2a792e,_0x517028,_0x491ddf){var _0x2b3cec,_0x2011bb,_0x120cdc;if(_[_0x4d5b('0x9e')](_0x2a792e[_0x4d5b('0x60')][_0x4d5b('0x60')])||_0x2a792e['body'][_0x4d5b('0x60')]===''){throw new db['Sequelize']['ValidationError'](_0x4d5b('0xa0'));}if(_[_0x4d5b('0x9e')](_0x2a792e[_0x4d5b('0x60')]['to'])){throw new db[(_0x4d5b('0x8b'))][(_0x4d5b('0x8c'))]('to\x20is\x20mandatory');}_0x2b3cec=_0x2a792e[_0x4d5b('0x60')]['to'];return db[_0x4d5b('0x40')][_0x4d5b('0x5c')]({'where':{'id':_0x2a792e['params']['id']},'include':[{'model':db[_0x4d5b('0xbe')],'as':'List','include':[{'model':db[_0x4d5b('0x8a')],'as':_0x4d5b('0xa3'),'where':{'mobile':_0x2b3cec},'limit':0x1,'order':[['updatedAt','DESC']]}]}]})[_0x4d5b('0x1f')](handleEntityNotFound(_0x517028,null))['then'](function(_0x39fe47){if(_0x39fe47&&_0x39fe47[_0x4d5b('0xbf')]){_0x2011bb=_0x39fe47[_0x4d5b('0x35')]({'plain':!![]});if(_0x2011bb[_0x4d5b('0xbf')]&&_0x2011bb['List'][_0x4d5b('0xa3')]['length']){return _0x2011bb[_0x4d5b('0xbf')][_0x4d5b('0xa3')][0x0];}return db[_0x4d5b('0x8a')][_0x4d5b('0x59')](_['defaults'](_0x2a792e[_0x4d5b('0x60')],{'firstName':_0x2b3cec,'mobile':_0x2b3cec,'phone':_0x2b3cec,'ListId':_0x2011bb[_0x4d5b('0x91')]}));}})[_0x4d5b('0x1f')](handleEntityNotFound(_0x517028,null))[_0x4d5b('0x1f')](function(_0x334e58){if(_0x334e58){_0x120cdc=_0x334e58;return db['WhatsappInteraction'][_0x4d5b('0x5c')]({'where':{'ContactId':_0x120cdc['id'],'closed':![],'WhatsappAccountId':_0x2011bb['id']}})[_0x4d5b('0x1f')](function(_0x1d8c28){if(_0x1d8c28){return[_0x1d8c28,![]];}return db[_0x4d5b('0xa6')][_0x4d5b('0x59')]({'UserId':_0x2a792e['user']['id'],'ContactId':_0x120cdc['id'],'WhatsappAccountId':_0x2011bb['id'],'phone':_0x2b3cec,'firstMsgDirection':'out','Messages':[_[_0x4d5b('0x52')](_0x2a792e[_0x4d5b('0x60')],{'read':![],'body':_0x2a792e[_0x4d5b('0x60')]['body'],'phone':_0x2b3cec,'WhatsappAccountId':_0x2011bb['id'],'UserId':_0x2a792e[_0x4d5b('0xc0')]['id'],'ContactId':_0x120cdc['id']})]},{'include':[{'model':db[_0x4d5b('0x85')],'as':'Messages'}]})['then'](function(_0x3130ef){return[_0x3130ef,!![]];});});}})[_0x4d5b('0xa7')](function(_0x4f1631,_0x4893e4){if(_0x4893e4){return _0x4f1631;}return db[_0x4d5b('0x85')][_0x4d5b('0x59')](_['merge'](_0x2a792e[_0x4d5b('0x60')],{'read':![],'body':_0x2a792e['body'][_0x4d5b('0x60')],'phone':_0x2b3cec,'WhatsappAccountId':_0x2011bb['id'],'WhatsappInteractionId':_0x4f1631['id'],'UserId':_0x2a792e[_0x4d5b('0xc0')]['id'],'ContactId':_0x120cdc['id']}))['then'](function(_0x2d5bf1){_0x4f1631[_0x4d5b('0xc1')][_0x4d5b('0xc2')]=[];_0x4f1631[_0x4d5b('0xc1')][_0x4d5b('0xc2')]['push'](_0x2d5bf1[_0x4d5b('0xc1')]);return _0x4f1631;});})[_0x4d5b('0x1f')](respondWithResult(_0x517028,null))[_0x4d5b('0x2a')](handleError(_0x517028,null));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.events.js b/server/api/whatsappAccount/whatsappAccount.events.js index f8444a0..d365d81 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 _0x201a=['hook','exports','events','WhatsappAccount','setMaxListeners','save','emit'];(function(_0x39707c,_0x7a95e){var _0x45e594=function(_0xf7b22c){while(--_0xf7b22c){_0x39707c['push'](_0x39707c['shift']());}};_0x45e594(++_0x7a95e);}(_0x201a,0x191));var _0xa201=function(_0x31be18,_0x54d357){_0x31be18=_0x31be18-0x0;var _0x21d638=_0x201a[_0x31be18];return _0x21d638;};'use strict';var EventEmitter=require(_0xa201('0x0'));var WhatsappAccount=require('../../mysqldb')['db'][_0xa201('0x1')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0xa201('0x2')](0x0);var events={'afterCreate':_0xa201('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x2af24e){return function(_0x16631e,_0xdff378,_0x5a6f9e){WhatsappAccountEvents[_0xa201('0x4')](_0x2af24e+':'+_0x16631e['id'],_0x16631e);WhatsappAccountEvents[_0xa201('0x4')](_0x2af24e,_0x16631e);_0x5a6f9e(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappAccount[_0xa201('0x5')](e,emitEvent(event));}}module[_0xa201('0x6')]=WhatsappAccountEvents; \ No newline at end of file +var _0x08fc=['WhatsappAccount','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','events','../../mysqldb'];(function(_0x54763e,_0x4072b1){var _0x4365b1=function(_0x3e8fcb){while(--_0x3e8fcb){_0x54763e['push'](_0x54763e['shift']());}};_0x4365b1(++_0x4072b1);}(_0x08fc,0x6c));var _0xc08f=function(_0x5b13c3,_0x378e0a){_0x5b13c3=_0x5b13c3-0x0;var _0x3d6780=_0x08fc[_0x5b13c3];return _0x3d6780;};'use strict';var EventEmitter=require(_0xc08f('0x0'));var WhatsappAccount=require(_0xc08f('0x1'))['db'][_0xc08f('0x2')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0xc08f('0x3')](0x0);var events={'afterCreate':_0xc08f('0x4'),'afterUpdate':_0xc08f('0x5'),'afterDestroy':_0xc08f('0x6')};function emitEvent(_0x2a3ac5){return function(_0x1cb3c9,_0x12ce1e,_0x30b9ff){WhatsappAccountEvents[_0xc08f('0x7')](_0x2a3ac5+':'+_0x1cb3c9['id'],_0x1cb3c9);WhatsappAccountEvents['emit'](_0x2a3ac5,_0x1cb3c9);_0x30b9ff(null);};}for(var e in events){if(events[_0xc08f('0x8')](e)){var event=events[e];WhatsappAccount[_0xc08f('0x9')](e,emitEvent(event));}}module['exports']=WhatsappAccountEvents; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.model.js b/server/api/whatsappAccount/whatsappAccount.model.js index 3c1ef8c..9773b04 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 _0xd703=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./whatsappAccount.attributes','exports','define','WhatsappAccount','whatsapp_accounts'];(function(_0x42dd35,_0x331d14){var _0x25f611=function(_0x3e1f30){while(--_0x3e1f30){_0x42dd35['push'](_0x42dd35['shift']());}};_0x25f611(++_0x331d14);}(_0xd703,0xf0));var _0x3d70=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0xd703[_0x413feb];return _0x40ee88;};'use strict';var _=require(_0x3d70('0x0'));var util=require(_0x3d70('0x1'));var logger=require(_0x3d70('0x2'))(_0x3d70('0x3'));var moment=require(_0x3d70('0x4'));var BPromise=require(_0x3d70('0x5'));var rp=require(_0x3d70('0x6'));var fs=require('fs');var path=require(_0x3d70('0x7'));var rimraf=require(_0x3d70('0x8'));var config=require(_0x3d70('0x9'));var attributes=require(_0x3d70('0xa'));module[_0x3d70('0xb')]=function(_0x47d57e,_0x3a00b4){return _0x47d57e[_0x3d70('0xc')](_0x3d70('0xd'),attributes,{'tableName':_0x3d70('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd91a=['WhatsappAccount','whatsapp_accounts','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./whatsappAccount.attributes','exports','define'];(function(_0x2ca515,_0x2f0654){var _0x2f7701=function(_0x20b48b){while(--_0x20b48b){_0x2ca515['push'](_0x2ca515['shift']());}};_0x2f7701(++_0x2f0654);}(_0xd91a,0x1b5));var _0xad91=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd91a[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xad91('0x0'));var util=require(_0xad91('0x1'));var logger=require(_0xad91('0x2'))(_0xad91('0x3'));var moment=require(_0xad91('0x4'));var BPromise=require(_0xad91('0x5'));var rp=require(_0xad91('0x6'));var fs=require('fs');var path=require(_0xad91('0x7'));var rimraf=require(_0xad91('0x8'));var config=require(_0xad91('0x9'));var attributes=require(_0xad91('0xa'));module[_0xad91('0xb')]=function(_0x1ae659,_0x3d1b65){return _0x1ae659[_0xad91('0xc')](_0xad91('0xd'),attributes,{'tableName':_0xad91('0xe'),'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 9d44943..80607c7 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 _0xdcc1=['../../config/utils','../../config/logger','../../config/environment','http','redis','localhost','socket.io-emitter','then','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ShowWhatsappAccount','WhatsappAccount','find','raw','options','attributes','map','model','include','lodash','util','moment','bluebird','ioredis','../../mysqldb'];(function(_0x411c4a,_0x1769a5){var _0xdca442=function(_0x4f916b){while(--_0x4f916b){_0x411c4a['push'](_0x411c4a['shift']());}};_0xdca442(++_0x1769a5);}(_0xdcc1,0x170));var _0x1dcc=function(_0x26d420,_0x558aa7){_0x26d420=_0x26d420-0x0;var _0x50e4e5=_0xdcc1[_0x26d420];return _0x50e4e5;};'use strict';var _=require(_0x1dcc('0x0'));var util=require(_0x1dcc('0x1'));var moment=require(_0x1dcc('0x2'));var BPromise=require(_0x1dcc('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1dcc('0x4'));var db=require(_0x1dcc('0x5'))['db'];var utils=require(_0x1dcc('0x6'));var logger=require(_0x1dcc('0x7'))('rpc');var config=require(_0x1dcc('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1dcc('0x9')]({'port':0x232a});config[_0x1dcc('0xa')]=_['defaults'](config[_0x1dcc('0xa')],{'host':_0x1dcc('0xb'),'port':0x18eb});var socket=require(_0x1dcc('0xc'))(new Redis(config[_0x1dcc('0xa')]));require('./whatsappAccount.socket')['register'](socket);function respondWithRpcPromise(_0x58d64d,_0x2974be,_0x6b814b){return new BPromise(function(_0x105432,_0x53d1e7){return client['request'](_0x58d64d,_0x6b814b)[_0x1dcc('0xd')](function(_0x2bf175){logger[_0x1dcc('0xe')](_0x1dcc('0xf'),_0x2974be,_0x1dcc('0x10'));logger[_0x1dcc('0x11')](_0x1dcc('0x12'),_0x2974be,_0x1dcc('0x10'),JSON[_0x1dcc('0x13')](_0x2bf175));if(_0x2bf175[_0x1dcc('0x14')]){if(_0x2bf175[_0x1dcc('0x14')][_0x1dcc('0x15')]===0x1f4){logger['error'](_0x1dcc('0xf'),_0x2974be,_0x2bf175['error'][_0x1dcc('0x16')]);return _0x53d1e7(_0x2bf175[_0x1dcc('0x14')][_0x1dcc('0x16')]);}logger['error'](_0x1dcc('0xf'),_0x2974be,_0x2bf175[_0x1dcc('0x14')][_0x1dcc('0x16')]);return _0x105432(_0x2bf175[_0x1dcc('0x14')][_0x1dcc('0x16')]);}else{logger[_0x1dcc('0xe')](_0x1dcc('0xf'),_0x2974be,'request\x20sent');_0x105432(_0x2bf175[_0x1dcc('0x17')]['message']);}})[_0x1dcc('0x18')](function(_0x4ae3ec){logger[_0x1dcc('0x14')]('WhatsappAccount,\x20%s,\x20%s',_0x2974be,_0x4ae3ec);_0x53d1e7(_0x4ae3ec);});});}exports[_0x1dcc('0x19')]=function(_0x1773d0){var _0x2cd50c=this;return new Promise(function(_0x379345,_0x40aebf){return db[_0x1dcc('0x1a')][_0x1dcc('0x1b')]({'raw':_0x1773d0['options']?_0x1773d0['options'][_0x1dcc('0x1c')]===undefined?!![]:![]:!![],'where':_0x1773d0[_0x1dcc('0x1d')]?_0x1773d0['options']['where']||null:null,'attributes':_0x1773d0['options']?_0x1773d0[_0x1dcc('0x1d')][_0x1dcc('0x1e')]||null:null,'include':_0x1773d0[_0x1dcc('0x1d')]?_0x1773d0[_0x1dcc('0x1d')]['include']?_[_0x1dcc('0x1f')](_0x1773d0[_0x1dcc('0x1d')]['include'],function(_0x18466f){return{'model':db[_0x18466f[_0x1dcc('0x20')]],'as':_0x18466f['as'],'attributes':_0x18466f[_0x1dcc('0x1e')],'include':_0x18466f[_0x1dcc('0x21')]?_['map'](_0x18466f[_0x1dcc('0x21')],function(_0x2eb616){return{'model':db[_0x2eb616[_0x1dcc('0x20')]],'as':_0x2eb616['as'],'attributes':_0x2eb616[_0x1dcc('0x1e')],'include':_0x2eb616[_0x1dcc('0x21')]?_[_0x1dcc('0x1f')](_0x2eb616[_0x1dcc('0x21')],function(_0x557633){return{'model':db[_0x557633[_0x1dcc('0x20')]],'as':_0x557633['as'],'attributes':_0x557633['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x4b44cd){logger['info']('ShowWhatsappAccount',_0x1773d0);logger[_0x1dcc('0x11')](_0x1dcc('0x19'),_0x1773d0,JSON[_0x1dcc('0x13')](_0x4b44cd));_0x379345(_0x4b44cd);})[_0x1dcc('0x18')](function(_0x32ea3a){logger['error'](_0x1dcc('0x19'),_0x32ea3a['message'],_0x1773d0);_0x40aebf(_0x2cd50c['error'](0x1f4,_0x32ea3a[_0x1dcc('0x16')]));});});}; \ No newline at end of file +var _0xd490=['request','then','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','error','message','result','catch','ShowWhatsappAccount','WhatsappAccount','options','raw','where','attributes','include','map','model','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','register'];(function(_0x187f4b,_0x12fd52){var _0x132087=function(_0x2b68ef){while(--_0x2b68ef){_0x187f4b['push'](_0x187f4b['shift']());}};_0x132087(++_0x12fd52);}(_0xd490,0x14d));var _0x0d49=function(_0x511dc2,_0x59b529){_0x511dc2=_0x511dc2-0x0;var _0x2ba37d=_0xd490[_0x511dc2];return _0x2ba37d;};'use strict';var _=require(_0x0d49('0x0'));var util=require(_0x0d49('0x1'));var moment=require(_0x0d49('0x2'));var BPromise=require(_0x0d49('0x3'));var rs=require(_0x0d49('0x4'));var fs=require('fs');var Redis=require(_0x0d49('0x5'));var db=require(_0x0d49('0x6'))['db'];var utils=require(_0x0d49('0x7'));var logger=require(_0x0d49('0x8'))(_0x0d49('0x9'));var config=require(_0x0d49('0xa'));var jayson=require(_0x0d49('0xb'));var client=jayson['client'][_0x0d49('0xc')]({'port':0x232a});config[_0x0d49('0xd')]=_[_0x0d49('0xe')](config[_0x0d49('0xd')],{'host':_0x0d49('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0d49('0xd')]));require('./whatsappAccount.socket')[_0x0d49('0x10')](socket);function respondWithRpcPromise(_0x51a918,_0x4d2fcc,_0x48212a){return new BPromise(function(_0x2f4077,_0x319f11){return client[_0x0d49('0x11')](_0x51a918,_0x48212a)[_0x0d49('0x12')](function(_0x1b985d){logger[_0x0d49('0x13')](_0x0d49('0x14'),_0x4d2fcc,'request\x20sent');logger['debug']('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x4d2fcc,_0x0d49('0x15'),JSON['stringify'](_0x1b985d));if(_0x1b985d['error']){if(_0x1b985d[_0x0d49('0x16')]['code']===0x1f4){logger[_0x0d49('0x16')](_0x0d49('0x14'),_0x4d2fcc,_0x1b985d[_0x0d49('0x16')][_0x0d49('0x17')]);return _0x319f11(_0x1b985d[_0x0d49('0x16')][_0x0d49('0x17')]);}logger[_0x0d49('0x16')](_0x0d49('0x14'),_0x4d2fcc,_0x1b985d[_0x0d49('0x16')][_0x0d49('0x17')]);return _0x2f4077(_0x1b985d[_0x0d49('0x16')][_0x0d49('0x17')]);}else{logger[_0x0d49('0x13')](_0x0d49('0x14'),_0x4d2fcc,'request\x20sent');_0x2f4077(_0x1b985d[_0x0d49('0x18')][_0x0d49('0x17')]);}})[_0x0d49('0x19')](function(_0x587916){logger[_0x0d49('0x16')]('WhatsappAccount,\x20%s,\x20%s',_0x4d2fcc,_0x587916);_0x319f11(_0x587916);});});}exports[_0x0d49('0x1a')]=function(_0x1e08b4){var _0x21eae4=this;return new Promise(function(_0xb409ba,_0x4b6c14){return db[_0x0d49('0x1b')]['find']({'raw':_0x1e08b4[_0x0d49('0x1c')]?_0x1e08b4[_0x0d49('0x1c')][_0x0d49('0x1d')]===undefined?!![]:![]:!![],'where':_0x1e08b4[_0x0d49('0x1c')]?_0x1e08b4[_0x0d49('0x1c')][_0x0d49('0x1e')]||null:null,'attributes':_0x1e08b4['options']?_0x1e08b4[_0x0d49('0x1c')][_0x0d49('0x1f')]||null:null,'include':_0x1e08b4[_0x0d49('0x1c')]?_0x1e08b4[_0x0d49('0x1c')][_0x0d49('0x20')]?_[_0x0d49('0x21')](_0x1e08b4['options']['include'],function(_0x190ff8){return{'model':db[_0x190ff8[_0x0d49('0x22')]],'as':_0x190ff8['as'],'attributes':_0x190ff8[_0x0d49('0x1f')],'include':_0x190ff8['include']?_['map'](_0x190ff8[_0x0d49('0x20')],function(_0x2853da){return{'model':db[_0x2853da[_0x0d49('0x22')]],'as':_0x2853da['as'],'attributes':_0x2853da[_0x0d49('0x1f')],'include':_0x2853da[_0x0d49('0x20')]?_[_0x0d49('0x21')](_0x2853da[_0x0d49('0x20')],function(_0x4dc058){return{'model':db[_0x4dc058[_0x0d49('0x22')]],'as':_0x4dc058['as'],'attributes':_0x4dc058[_0x0d49('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x16daa8){logger[_0x0d49('0x13')]('ShowWhatsappAccount',_0x1e08b4);logger['debug'](_0x0d49('0x1a'),_0x1e08b4,JSON['stringify'](_0x16daa8));_0xb409ba(_0x16daa8);})[_0x0d49('0x19')](function(_0x93e07a){logger[_0x0d49('0x16')](_0x0d49('0x1a'),_0x93e07a[_0x0d49('0x17')],_0x1e08b4);_0x4b6c14(_0x21eae4[_0x0d49('0x16')](0x1f4,_0x93e07a[_0x0d49('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.socket.js b/server/api/whatsappAccount/whatsappAccount.socket.js index dffcae7..bf203ce 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 _0x1fd1=['save','remove','update','emit','removeListener','register','whatsappAccount:','./whatsappAccount.events'];(function(_0x2e913b,_0x4b7071){var _0x173899=function(_0x2a7d22){while(--_0x2a7d22){_0x2e913b['push'](_0x2e913b['shift']());}};_0x173899(++_0x4b7071);}(_0x1fd1,0xa7));var _0x11fd=function(_0x464e9d,_0x9a5964){_0x464e9d=_0x464e9d-0x0;var _0xb05cf=_0x1fd1[_0x464e9d];return _0xb05cf;};'use strict';var WhatsappAccountEvents=require(_0x11fd('0x0'));var events=[_0x11fd('0x1'),_0x11fd('0x2'),_0x11fd('0x3')];function createListener(_0x58ba59,_0x5ca165){return function(_0x42320c){_0x5ca165[_0x11fd('0x4')](_0x58ba59,_0x42320c);};}function removeListener(_0x1936e0,_0x3511f1){return function(){WhatsappAccountEvents[_0x11fd('0x5')](_0x1936e0,_0x3511f1);};}exports[_0x11fd('0x6')]=function(_0x5eaf6c){for(var _0x5820ad=0x0,_0x2c138d=events['length'];_0x5820ad<_0x2c138d;_0x5820ad++){var _0x5dc595=events[_0x5820ad];var _0x503b26=createListener(_0x11fd('0x7')+_0x5dc595,_0x5eaf6c);WhatsappAccountEvents['on'](_0x5dc595,_0x503b26);}}; \ No newline at end of file +var _0xdb67=['emit','removeListener','register','whatsappAccount:','./whatsappAccount.events'];(function(_0x578d16,_0x4add21){var _0x3a9213=function(_0x4134cb){while(--_0x4134cb){_0x578d16['push'](_0x578d16['shift']());}};_0x3a9213(++_0x4add21);}(_0xdb67,0x90));var _0x7db6=function(_0x43c02d,_0x3e5b80){_0x43c02d=_0x43c02d-0x0;var _0x502ca1=_0xdb67[_0x43c02d];return _0x502ca1;};'use strict';var WhatsappAccountEvents=require(_0x7db6('0x0'));var events=['save','remove','update'];function createListener(_0x51d5ef,_0x3b4855){return function(_0x1b9867){_0x3b4855[_0x7db6('0x1')](_0x51d5ef,_0x1b9867);};}function removeListener(_0x5386e0,_0x4b02cb){return function(){WhatsappAccountEvents[_0x7db6('0x2')](_0x5386e0,_0x4b02cb);};}exports[_0x7db6('0x3')]=function(_0x114dbd){for(var _0x590232=0x0,_0x59b1f6=events['length'];_0x590232<_0x59b1f6;_0x590232++){var _0x1dc63d=events[_0x590232];var _0x269d7d=createListener(_0x7db6('0x4')+_0x1dc63d,_0x114dbd);WhatsappAccountEvents['on'](_0x1dc63d,_0x269d7d);}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/index.js b/server/api/whatsappApplication/index.js index 8996ad8..8ac3b63 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 _0x617f=['express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/:id','show','create','put','update','delete','destroy','exports','multer','util','path'];(function(_0x342700,_0x569f75){var _0x53406f=function(_0x3b3c32){while(--_0x3b3c32){_0x342700['push'](_0x342700['shift']());}};_0x53406f(++_0x569f75);}(_0x617f,0x1b2));var _0xf617=function(_0x48c812,_0x544a7e){_0x48c812=_0x48c812-0x0;var _0x121efb=_0x617f[_0x48c812];return _0x121efb;};'use strict';var multer=require(_0xf617('0x0'));var util=require(_0xf617('0x1'));var path=require(_0xf617('0x2'));var timeout=require('connect-timeout');var express=require(_0xf617('0x3'));var router=express[_0xf617('0x4')]();var fs_extra=require(_0xf617('0x5'));var auth=require(_0xf617('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xf617('0x7'));var controller=require('./whatsappApplication.controller');router[_0xf617('0x8')]('/',auth[_0xf617('0x9')](),controller[_0xf617('0xa')]);router[_0xf617('0x8')](_0xf617('0xb'),auth['isAuthenticated'](),controller[_0xf617('0xc')]);router['post']('/',auth['isAuthenticated'](),controller[_0xf617('0xd')]);router[_0xf617('0xe')](_0xf617('0xb'),auth['isAuthenticated'](),controller[_0xf617('0xf')]);router[_0xf617('0x10')]('/:id',auth[_0xf617('0x9')](),controller[_0xf617('0x11')]);module[_0xf617('0x12')]=router; \ No newline at end of file +var _0xf27f=['destroy','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./whatsappApplication.controller','get','isAuthenticated','index','show','post','put','/:id'];(function(_0x5a56dc,_0x31d868){var _0x1d4edc=function(_0x2aa941){while(--_0x2aa941){_0x5a56dc['push'](_0x5a56dc['shift']());}};_0x1d4edc(++_0x31d868);}(_0xf27f,0x1b1));var _0xff27=function(_0x2700d4,_0xc7089f){_0x2700d4=_0x2700d4-0x0;var _0x21b16d=_0xf27f[_0x2700d4];return _0x21b16d;};'use strict';var multer=require(_0xff27('0x0'));var util=require(_0xff27('0x1'));var path=require('path');var timeout=require(_0xff27('0x2'));var express=require('express');var router=express[_0xff27('0x3')]();var fs_extra=require(_0xff27('0x4'));var auth=require(_0xff27('0x5'));var interaction=require(_0xff27('0x6'));var config=require('../../config/environment');var controller=require(_0xff27('0x7'));router[_0xff27('0x8')]('/',auth[_0xff27('0x9')](),controller[_0xff27('0xa')]);router[_0xff27('0x8')]('/:id',auth[_0xff27('0x9')](),controller[_0xff27('0xb')]);router[_0xff27('0xc')]('/',auth[_0xff27('0x9')](),controller['create']);router[_0xff27('0xd')](_0xff27('0xe'),auth[_0xff27('0x9')](),controller['update']);router['delete'](_0xff27('0xe'),auth[_0xff27('0x9')](),controller[_0xff27('0xf')]);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 317a31d..edb7eb5 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 _0x9890=['noop','*,*,*,*','sequelize','exports','STRING'];(function(_0x32e036,_0x3eba40){var _0x41bf28=function(_0x4b16b8){while(--_0x4b16b8){_0x32e036['push'](_0x32e036['shift']());}};_0x41bf28(++_0x3eba40);}(_0x9890,0xfc));var _0x0989=function(_0x23594e,_0x1429f1){_0x23594e=_0x23594e-0x0;var _0x1bd289=_0x9890[_0x23594e];return _0x1bd289;};'use strict';var Sequelize=require(_0x0989('0x0'));module[_0x0989('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x0989('0x2')],'allowNull':![],'defaultValue':_0x0989('0x3')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x0989('0x2')],'defaultValue':_0x0989('0x4')}}; \ No newline at end of file +var _0x9672=['STRING','*,*,*,*','sequelize','exports','INTEGER','noop','TEXT'];(function(_0x21c5e7,_0x525dc8){var _0x299035=function(_0x2a6195){while(--_0x2a6195){_0x21c5e7['push'](_0x21c5e7['shift']());}};_0x299035(++_0x525dc8);}(_0x9672,0x79));var _0x2967=function(_0x10ffd0,_0x2a5b79){_0x10ffd0=_0x10ffd0-0x0;var _0x30b550=_0x9672[_0x10ffd0];return _0x30b550;};'use strict';var Sequelize=require(_0x2967('0x0'));module[_0x2967('0x1')]={'priority':{'type':Sequelize[_0x2967('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x2967('0x3')},'appdata':{'type':Sequelize[_0x2967('0x4')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x2967('0x5')],'defaultValue':_0x2967('0x6')}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.controller.js b/server/api/whatsappApplication/whatsappApplication.controller.js index e2d00aa..a9b7bfc 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 _0xc1dc=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','save','update','then','destroy','stack','name','send','index','map','rawAttributes','fieldName','type','key','keys','filters','query','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','options','WhatsappApplication','includeAll','include','findAll','rows','catch','params','find','create','body','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse'];(function(_0x2048cb,_0x171969){var _0x19b9ab=function(_0x4768b5){while(--_0x4768b5){_0x2048cb['push'](_0x2048cb['shift']());}};_0x19b9ab(++_0x171969);}(_0xc1dc,0x84));var _0xcc1d=function(_0x45590e,_0x2d325f){_0x45590e=_0x45590e-0x0;var _0x32d4ad=_0xc1dc[_0x45590e];return _0x32d4ad;};'use strict';var emlformat=require(_0xcc1d('0x0'));var rimraf=require(_0xcc1d('0x1'));var zipdir=require(_0xcc1d('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xcc1d('0x3'));var moment=require('moment');var BPromise=require(_0xcc1d('0x4'));var Mustache=require(_0xcc1d('0x5'));var util=require('util');var path=require(_0xcc1d('0x6'));var sox=require(_0xcc1d('0x7'));var csv=require(_0xcc1d('0x8'));var ejs=require(_0xcc1d('0x9'));var fs=require('fs');var fs_extra=require(_0xcc1d('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xcc1d('0xb'));var jsforce=require(_0xcc1d('0xc'));var deskjs=require(_0xcc1d('0xd'));var toCsv=require(_0xcc1d('0x8'));var querystring=require(_0xcc1d('0xe'));var Papa=require(_0xcc1d('0xf'));var Redis=require('ioredis');var authService=require(_0xcc1d('0x10'));var qs=require(_0xcc1d('0x11'));var as=require(_0xcc1d('0x12'));var hardwareService=require(_0xcc1d('0x13'));var logger=require(_0xcc1d('0x14'))(_0xcc1d('0x15'));var utils=require('../../config/utils');var config=require(_0xcc1d('0x16'));var licenseUtil=require(_0xcc1d('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x11a34f,_0x3e2534){_0x3e2534=_0x3e2534||0xcc;return function(_0x1440f6){if(_0x1440f6){return _0x11a34f[_0xcc1d('0x18')](_0x3e2534);}return _0x11a34f[_0xcc1d('0x19')](_0x3e2534)[_0xcc1d('0x1a')]();};}function respondWithResult(_0x18b64a,_0x5345ab){_0x5345ab=_0x5345ab||0xc8;return function(_0x5e66ce){if(_0x5e66ce){return _0x18b64a[_0xcc1d('0x19')](_0x5345ab)['json'](_0x5e66ce);}};}function respondWithFilteredResult(_0x35e177,_0x452772){return function(_0x35f147){if(_0x35f147){var _0xc71166=typeof _0x452772[_0xcc1d('0x1b')]===_0xcc1d('0x1c')&&typeof _0x452772[_0xcc1d('0x1d')]===_0xcc1d('0x1c');var _0x2147ca=_0x35f147[_0xcc1d('0x1e')];var _0x483963=_0xc71166?0x0:_0x452772['offset'];var _0x2ee388=_0xc71166?_0x35f147['count']:_0x452772[_0xcc1d('0x1b')]+_0x452772[_0xcc1d('0x1d')];var _0xf44327;if(_0x2ee388>=_0x2147ca){_0x2ee388=_0x2147ca;_0xf44327=0xc8;}else{_0xf44327=0xce;}_0x35e177[_0xcc1d('0x19')](_0xf44327);return _0x35e177[_0xcc1d('0x1f')](_0xcc1d('0x20'),_0x483963+'-'+_0x2ee388+'/'+_0x2147ca)[_0xcc1d('0x21')](_0x35f147);}return null;};}function patchUpdates(_0x1b88f4){return function(_0x438288){try{jsonpatch['apply'](_0x438288,_0x1b88f4,!![]);}catch(_0x23189c){return BPromise['reject'](_0x23189c);}return _0x438288[_0xcc1d('0x22')]();};}function saveUpdates(_0x1bcf7b,_0x167b9f){return function(_0x5a2df6){if(_0x5a2df6){return _0x5a2df6[_0xcc1d('0x23')](_0x1bcf7b)[_0xcc1d('0x24')](function(_0x31a006){return _0x31a006;});}return null;};}function removeEntity(_0x451523,_0xac9e86){return function(_0x5e2f74){if(_0x5e2f74){return _0x5e2f74[_0xcc1d('0x25')]()['then'](function(){_0x451523[_0xcc1d('0x19')](0xcc)[_0xcc1d('0x1a')]();});}};}function handleEntityNotFound(_0x3f8b30,_0x40e31c){return function(_0xd2dba0){if(!_0xd2dba0){_0x3f8b30['sendStatus'](0x194);}return _0xd2dba0;};}function handleError(_0x8ae1a4,_0x17cdfe){_0x17cdfe=_0x17cdfe||0x1f4;return function(_0xec0667){logger['error'](_0xec0667[_0xcc1d('0x26')]);if(_0xec0667['name']){delete _0xec0667[_0xcc1d('0x27')];}_0x8ae1a4['status'](_0x17cdfe)[_0xcc1d('0x28')](_0xec0667);};}exports[_0xcc1d('0x29')]=function(_0x47710b,_0x50b769){var _0x2c5c51={},_0x10f5d3={},_0x11ba24={'count':0x0,'rows':[]};var _0x4a406f=_[_0xcc1d('0x2a')](db['WhatsappApplication'][_0xcc1d('0x2b')],function(_0x2a68ef){return{'name':_0x2a68ef[_0xcc1d('0x2c')],'type':_0x2a68ef[_0xcc1d('0x2d')][_0xcc1d('0x2e')]};});_0x10f5d3['model']=_[_0xcc1d('0x2a')](_0x4a406f,_0xcc1d('0x27'));_0x10f5d3['query']=_[_0xcc1d('0x2f')](_0x47710b['query']);_0x10f5d3[_0xcc1d('0x30')]=_['intersection'](_0x10f5d3['model'],_0x10f5d3[_0xcc1d('0x31')]);_0x2c5c51['attributes']=_[_0xcc1d('0x32')](_0x10f5d3[_0xcc1d('0x33')],qs[_0xcc1d('0x34')](_0x47710b[_0xcc1d('0x31')][_0xcc1d('0x34')]));_0x2c5c51[_0xcc1d('0x35')]=_0x2c5c51['attributes'][_0xcc1d('0x36')]?_0x2c5c51['attributes']:_0x10f5d3[_0xcc1d('0x33')];if(!_0x47710b[_0xcc1d('0x31')][_0xcc1d('0x37')](_0xcc1d('0x38'))){_0x2c5c51['limit']=qs[_0xcc1d('0x1d')](_0x47710b[_0xcc1d('0x31')][_0xcc1d('0x1d')]);_0x2c5c51[_0xcc1d('0x1b')]=qs[_0xcc1d('0x1b')](_0x47710b[_0xcc1d('0x31')][_0xcc1d('0x1b')]);}_0x2c5c51[_0xcc1d('0x39')]=qs[_0xcc1d('0x3a')](_0x47710b[_0xcc1d('0x31')]['sort']);_0x2c5c51['where']=qs[_0xcc1d('0x30')](_[_0xcc1d('0x3b')](_0x47710b['query'],_0x10f5d3['filters']),_0x4a406f);if(_0x47710b['query'][_0xcc1d('0x3c')]){_0x2c5c51[_0xcc1d('0x3d')]=_[_0xcc1d('0x3e')](_0x2c5c51[_0xcc1d('0x3d')],{'$or':_[_0xcc1d('0x2a')](_0x4a406f,function(_0xcc81fd){if(_0xcc81fd[_0xcc1d('0x2d')]!=='VIRTUAL'){var _0x3d35e9={};_0x3d35e9[_0xcc81fd['name']]={'$like':'%'+_0x47710b['query']['filter']+'%'};return _0x3d35e9;}})});}_0x2c5c51=_[_0xcc1d('0x3e')]({},_0x2c5c51,_0x47710b[_0xcc1d('0x3f')]);var _0x59d656={'where':_0x2c5c51['where']};return db[_0xcc1d('0x40')]['count'](_0x59d656)[_0xcc1d('0x24')](function(_0x91e50d){_0x11ba24[_0xcc1d('0x1e')]=_0x91e50d;if(_0x47710b['query'][_0xcc1d('0x41')]){_0x2c5c51[_0xcc1d('0x42')]=[{'all':!![]}];}return db[_0xcc1d('0x40')][_0xcc1d('0x43')](_0x2c5c51);})[_0xcc1d('0x24')](function(_0x350b9d){_0x11ba24[_0xcc1d('0x44')]=_0x350b9d;return _0x11ba24;})['then'](respondWithFilteredResult(_0x50b769,_0x2c5c51))[_0xcc1d('0x45')](handleError(_0x50b769,null));};exports['show']=function(_0x809c64,_0x2ac320){var _0x1d74b4={'raw':!![],'where':{'id':_0x809c64[_0xcc1d('0x46')]['id']}},_0x252361={};_0x252361[_0xcc1d('0x33')]=_[_0xcc1d('0x2f')](db[_0xcc1d('0x40')][_0xcc1d('0x2b')]);_0x252361[_0xcc1d('0x31')]=_[_0xcc1d('0x2f')](_0x809c64[_0xcc1d('0x31')]);_0x252361['filters']=_[_0xcc1d('0x32')](_0x252361[_0xcc1d('0x33')],_0x252361[_0xcc1d('0x31')]);_0x1d74b4[_0xcc1d('0x35')]=_[_0xcc1d('0x32')](_0x252361[_0xcc1d('0x33')],qs[_0xcc1d('0x34')](_0x809c64[_0xcc1d('0x31')][_0xcc1d('0x34')]));_0x1d74b4[_0xcc1d('0x35')]=_0x1d74b4[_0xcc1d('0x35')]['length']?_0x1d74b4[_0xcc1d('0x35')]:_0x252361[_0xcc1d('0x33')];if(_0x809c64[_0xcc1d('0x31')][_0xcc1d('0x41')]){_0x1d74b4[_0xcc1d('0x42')]=[{'all':!![]}];}_0x1d74b4=_[_0xcc1d('0x3e')]({},_0x1d74b4,_0x809c64[_0xcc1d('0x3f')]);return db[_0xcc1d('0x40')][_0xcc1d('0x47')](_0x1d74b4)[_0xcc1d('0x24')](handleEntityNotFound(_0x2ac320,null))[_0xcc1d('0x24')](respondWithResult(_0x2ac320,null))[_0xcc1d('0x45')](handleError(_0x2ac320,null));};exports[_0xcc1d('0x48')]=function(_0x1ba4fc,_0x3e9a69){return db[_0xcc1d('0x40')][_0xcc1d('0x48')](_0x1ba4fc[_0xcc1d('0x49')],{})[_0xcc1d('0x24')](respondWithResult(_0x3e9a69,0xc9))[_0xcc1d('0x45')](handleError(_0x3e9a69,null));};exports['update']=function(_0x46a883,_0x4f4359){if(_0x46a883[_0xcc1d('0x49')]['id']){delete _0x46a883[_0xcc1d('0x49')]['id'];}return db['WhatsappApplication']['find']({'where':{'id':_0x46a883[_0xcc1d('0x46')]['id']}})[_0xcc1d('0x24')](handleEntityNotFound(_0x4f4359,null))[_0xcc1d('0x24')](saveUpdates(_0x46a883[_0xcc1d('0x49')],null))[_0xcc1d('0x24')](respondWithResult(_0x4f4359,null))[_0xcc1d('0x45')](handleError(_0x4f4359,null));};exports['destroy']=function(_0x40b834,_0x98ee9a){return db['WhatsappApplication'][_0xcc1d('0x47')]({'where':{'id':_0x40b834[_0xcc1d('0x46')]['id']}})[_0xcc1d('0x24')](handleEntityNotFound(_0x98ee9a,null))['then'](removeEntity(_0x98ee9a,null))[_0xcc1d('0x45')](handleError(_0x98ee9a,null));}; \ No newline at end of file +var _0x6d0c=['squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','sendStatus','name','send','map','WhatsappApplication','rawAttributes','fieldName','type','model','query','keys','intersection','attributes','fields','hasOwnProperty','order','sort','filters','pick','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','sox','fs-extra','lodash'];(function(_0x56482c,_0x16118d){var _0x5aae7a=function(_0x52512f){while(--_0x52512f){_0x56482c['push'](_0x56482c['shift']());}};_0x5aae7a(++_0x16118d);}(_0x6d0c,0x8c));var _0xc6d0=function(_0x5f009f,_0xd0d0c0){_0x5f009f=_0x5f009f-0x0;var _0x2e2fbe=_0x6d0c[_0x5f009f];return _0x2e2fbe;};'use strict';var emlformat=require(_0xc6d0('0x0'));var rimraf=require(_0xc6d0('0x1'));var zipdir=require(_0xc6d0('0x2'));var jsonpatch=require(_0xc6d0('0x3'));var rp=require(_0xc6d0('0x4'));var moment=require(_0xc6d0('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xc6d0('0x6'));var util=require('util');var path=require('path');var sox=require(_0xc6d0('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc6d0('0x8'));var _=require(_0xc6d0('0x9'));var squel=require(_0xc6d0('0xa'));var crypto=require(_0xc6d0('0xb'));var jsforce=require(_0xc6d0('0xc'));var deskjs=require(_0xc6d0('0xd'));var toCsv=require(_0xc6d0('0xe'));var querystring=require(_0xc6d0('0xf'));var Papa=require(_0xc6d0('0x10'));var Redis=require(_0xc6d0('0x11'));var authService=require(_0xc6d0('0x12'));var qs=require(_0xc6d0('0x13'));var as=require(_0xc6d0('0x14'));var hardwareService=require(_0xc6d0('0x15'));var logger=require(_0xc6d0('0x16'))(_0xc6d0('0x17'));var utils=require(_0xc6d0('0x18'));var config=require(_0xc6d0('0x19'));var licenseUtil=require(_0xc6d0('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x562ae9,_0x170c38){_0x170c38=_0x170c38||0xcc;return function(_0x3b3a05){if(_0x3b3a05){return _0x562ae9['sendStatus'](_0x170c38);}return _0x562ae9[_0xc6d0('0x1b')](_0x170c38)[_0xc6d0('0x1c')]();};}function respondWithResult(_0x16170e,_0x58393c){_0x58393c=_0x58393c||0xc8;return function(_0x5c4521){if(_0x5c4521){return _0x16170e[_0xc6d0('0x1b')](_0x58393c)[_0xc6d0('0x1d')](_0x5c4521);}};}function respondWithFilteredResult(_0x17afb5,_0x501260){return function(_0x2e1ba2){if(_0x2e1ba2){var _0x49ef8e=typeof _0x501260[_0xc6d0('0x1e')]===_0xc6d0('0x1f')&&typeof _0x501260[_0xc6d0('0x20')]===_0xc6d0('0x1f');var _0x3acff1=_0x2e1ba2['count'];var _0x4b178c=_0x49ef8e?0x0:_0x501260['offset'];var _0x1fa160=_0x49ef8e?_0x2e1ba2[_0xc6d0('0x21')]:_0x501260[_0xc6d0('0x1e')]+_0x501260['limit'];var _0x278552;if(_0x1fa160>=_0x3acff1){_0x1fa160=_0x3acff1;_0x278552=0xc8;}else{_0x278552=0xce;}_0x17afb5['status'](_0x278552);return _0x17afb5['set'](_0xc6d0('0x22'),_0x4b178c+'-'+_0x1fa160+'/'+_0x3acff1)[_0xc6d0('0x1d')](_0x2e1ba2);}return null;};}function patchUpdates(_0x2121f2){return function(_0x42d2d7){try{jsonpatch[_0xc6d0('0x23')](_0x42d2d7,_0x2121f2,!![]);}catch(_0x7a0604){return BPromise[_0xc6d0('0x24')](_0x7a0604);}return _0x42d2d7[_0xc6d0('0x25')]();};}function saveUpdates(_0x4e88b2,_0x411faa){return function(_0x2fbbd9){if(_0x2fbbd9){return _0x2fbbd9[_0xc6d0('0x26')](_0x4e88b2)[_0xc6d0('0x27')](function(_0x4b48f3){return _0x4b48f3;});}return null;};}function removeEntity(_0x5e7a68,_0x321a97){return function(_0x55b44d){if(_0x55b44d){return _0x55b44d[_0xc6d0('0x28')]()[_0xc6d0('0x27')](function(){_0x5e7a68[_0xc6d0('0x1b')](0xcc)[_0xc6d0('0x1c')]();});}};}function handleEntityNotFound(_0x2cc17e,_0x47182b){return function(_0x420cf4){if(!_0x420cf4){_0x2cc17e[_0xc6d0('0x29')](0x194);}return _0x420cf4;};}function handleError(_0x345c58,_0x1126fa){_0x1126fa=_0x1126fa||0x1f4;return function(_0x2bb7a8){logger['error'](_0x2bb7a8['stack']);if(_0x2bb7a8[_0xc6d0('0x2a')]){delete _0x2bb7a8[_0xc6d0('0x2a')];}_0x345c58[_0xc6d0('0x1b')](_0x1126fa)[_0xc6d0('0x2b')](_0x2bb7a8);};}exports['index']=function(_0xa457fa,_0x4720d7){var _0x1e2a03={},_0x3dcc61={},_0x6d0d94={'count':0x0,'rows':[]};var _0x4b7013=_[_0xc6d0('0x2c')](db[_0xc6d0('0x2d')][_0xc6d0('0x2e')],function(_0x8463ab){return{'name':_0x8463ab[_0xc6d0('0x2f')],'type':_0x8463ab[_0xc6d0('0x30')]['key']};});_0x3dcc61[_0xc6d0('0x31')]=_[_0xc6d0('0x2c')](_0x4b7013,_0xc6d0('0x2a'));_0x3dcc61[_0xc6d0('0x32')]=_[_0xc6d0('0x33')](_0xa457fa['query']);_0x3dcc61['filters']=_[_0xc6d0('0x34')](_0x3dcc61[_0xc6d0('0x31')],_0x3dcc61['query']);_0x1e2a03[_0xc6d0('0x35')]=_[_0xc6d0('0x34')](_0x3dcc61[_0xc6d0('0x31')],qs[_0xc6d0('0x36')](_0xa457fa[_0xc6d0('0x32')][_0xc6d0('0x36')]));_0x1e2a03['attributes']=_0x1e2a03[_0xc6d0('0x35')]['length']?_0x1e2a03['attributes']:_0x3dcc61[_0xc6d0('0x31')];if(!_0xa457fa[_0xc6d0('0x32')][_0xc6d0('0x37')]('nolimit')){_0x1e2a03['limit']=qs[_0xc6d0('0x20')](_0xa457fa[_0xc6d0('0x32')]['limit']);_0x1e2a03['offset']=qs[_0xc6d0('0x1e')](_0xa457fa[_0xc6d0('0x32')]['offset']);}_0x1e2a03[_0xc6d0('0x38')]=qs[_0xc6d0('0x39')](_0xa457fa[_0xc6d0('0x32')]['sort']);_0x1e2a03['where']=qs[_0xc6d0('0x3a')](_[_0xc6d0('0x3b')](_0xa457fa[_0xc6d0('0x32')],_0x3dcc61['filters']),_0x4b7013);if(_0xa457fa['query']['filter']){_0x1e2a03[_0xc6d0('0x3c')]=_[_0xc6d0('0x3d')](_0x1e2a03[_0xc6d0('0x3c')],{'$or':_['map'](_0x4b7013,function(_0x50a30e){if(_0x50a30e[_0xc6d0('0x30')]!==_0xc6d0('0x3e')){var _0xcd19fa={};_0xcd19fa[_0x50a30e['name']]={'$like':'%'+_0xa457fa[_0xc6d0('0x32')][_0xc6d0('0x3f')]+'%'};return _0xcd19fa;}})});}_0x1e2a03=_['merge']({},_0x1e2a03,_0xa457fa[_0xc6d0('0x40')]);var _0x1d812f={'where':_0x1e2a03[_0xc6d0('0x3c')]};return db[_0xc6d0('0x2d')][_0xc6d0('0x21')](_0x1d812f)['then'](function(_0x3718c0){_0x6d0d94[_0xc6d0('0x21')]=_0x3718c0;if(_0xa457fa['query'][_0xc6d0('0x41')]){_0x1e2a03[_0xc6d0('0x42')]=[{'all':!![]}];}return db[_0xc6d0('0x2d')][_0xc6d0('0x43')](_0x1e2a03);})['then'](function(_0x4a3cd8){_0x6d0d94[_0xc6d0('0x44')]=_0x4a3cd8;return _0x6d0d94;})[_0xc6d0('0x27')](respondWithFilteredResult(_0x4720d7,_0x1e2a03))[_0xc6d0('0x45')](handleError(_0x4720d7,null));};exports[_0xc6d0('0x46')]=function(_0x2e7c85,_0x1d4962){var _0x5776bf={'raw':!![],'where':{'id':_0x2e7c85[_0xc6d0('0x47')]['id']}},_0x3c54fc={};_0x3c54fc[_0xc6d0('0x31')]=_[_0xc6d0('0x33')](db['WhatsappApplication'][_0xc6d0('0x2e')]);_0x3c54fc['query']=_[_0xc6d0('0x33')](_0x2e7c85['query']);_0x3c54fc[_0xc6d0('0x3a')]=_[_0xc6d0('0x34')](_0x3c54fc[_0xc6d0('0x31')],_0x3c54fc[_0xc6d0('0x32')]);_0x5776bf['attributes']=_[_0xc6d0('0x34')](_0x3c54fc['model'],qs[_0xc6d0('0x36')](_0x2e7c85['query'][_0xc6d0('0x36')]));_0x5776bf[_0xc6d0('0x35')]=_0x5776bf[_0xc6d0('0x35')]['length']?_0x5776bf[_0xc6d0('0x35')]:_0x3c54fc[_0xc6d0('0x31')];if(_0x2e7c85[_0xc6d0('0x32')][_0xc6d0('0x41')]){_0x5776bf['include']=[{'all':!![]}];}_0x5776bf=_[_0xc6d0('0x3d')]({},_0x5776bf,_0x2e7c85[_0xc6d0('0x40')]);return db[_0xc6d0('0x2d')][_0xc6d0('0x48')](_0x5776bf)['then'](handleEntityNotFound(_0x1d4962,null))['then'](respondWithResult(_0x1d4962,null))['catch'](handleError(_0x1d4962,null));};exports[_0xc6d0('0x49')]=function(_0x45f786,_0x1f7320){return db['WhatsappApplication'][_0xc6d0('0x49')](_0x45f786[_0xc6d0('0x4a')],{})[_0xc6d0('0x27')](respondWithResult(_0x1f7320,0xc9))[_0xc6d0('0x45')](handleError(_0x1f7320,null));};exports['update']=function(_0x530472,_0x47ec13){if(_0x530472[_0xc6d0('0x4a')]['id']){delete _0x530472['body']['id'];}return db['WhatsappApplication'][_0xc6d0('0x48')]({'where':{'id':_0x530472[_0xc6d0('0x47')]['id']}})['then'](handleEntityNotFound(_0x47ec13,null))['then'](saveUpdates(_0x530472['body'],null))['then'](respondWithResult(_0x47ec13,null))[_0xc6d0('0x45')](handleError(_0x47ec13,null));};exports['destroy']=function(_0x234783,_0x212ce8){return db[_0xc6d0('0x2d')][_0xc6d0('0x48')]({'where':{'id':_0x234783['params']['id']}})['then'](handleEntityNotFound(_0x212ce8,null))['then'](removeEntity(_0x212ce8,null))[_0xc6d0('0x45')](handleError(_0x212ce8,null));}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.model.js b/server/api/whatsappApplication/whatsappApplication.model.js index e252f88..aabfbc5 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 _0x13c0=['lodash','util','../../config/logger','api','path','rimraf','../../config/environment','./whatsappApplication.attributes','exports','define','utf8mb4_unicode_ci'];(function(_0x444c7b,_0x121bcd){var _0x3828e6=function(_0x1a1fa9){while(--_0x1a1fa9){_0x444c7b['push'](_0x444c7b['shift']());}};_0x3828e6(++_0x121bcd);}(_0x13c0,0x79));var _0x013c=function(_0x1440ce,_0x136aee){_0x1440ce=_0x1440ce-0x0;var _0x389c35=_0x13c0[_0x1440ce];return _0x389c35;};'use strict';var _=require(_0x013c('0x0'));var util=require(_0x013c('0x1'));var logger=require(_0x013c('0x2'))(_0x013c('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x013c('0x4'));var rimraf=require(_0x013c('0x5'));var config=require(_0x013c('0x6'));var attributes=require(_0x013c('0x7'));module[_0x013c('0x8')]=function(_0x12d78e,_0x1142f4){return _0x12d78e[_0x013c('0x9')]('WhatsappApplication',attributes,{'tableName':'whatsapp_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x013c('0xa')});}; \ No newline at end of file +var _0x7dfd=['whatsapp_applications','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./whatsappApplication.attributes','exports','define','WhatsappApplication'];(function(_0xb7bbb4,_0x1ce632){var _0x167ca6=function(_0x34d643){while(--_0x34d643){_0xb7bbb4['push'](_0xb7bbb4['shift']());}};_0x167ca6(++_0x1ce632);}(_0x7dfd,0x1c2));var _0xd7df=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7dfd[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xd7df('0x0'));var util=require(_0xd7df('0x1'));var logger=require(_0xd7df('0x2'))(_0xd7df('0x3'));var moment=require(_0xd7df('0x4'));var BPromise=require(_0xd7df('0x5'));var rp=require(_0xd7df('0x6'));var fs=require('fs');var path=require(_0xd7df('0x7'));var rimraf=require(_0xd7df('0x8'));var config=require(_0xd7df('0x9'));var attributes=require(_0xd7df('0xa'));module[_0xd7df('0xb')]=function(_0x36cf0f,_0x39ce98){return _0x36cf0f[_0xd7df('0xc')](_0xd7df('0xd'),attributes,{'tableName':_0xd7df('0xe'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xd7df('0xf')});}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.rpc.js b/server/api/whatsappApplication/whatsappApplication.rpc.js index 53c6b1d..dbf13a1 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 _0xb903=['http','request','WhatsappApplication,\x20%s,\x20%s,\x20%s','request\x20sent','error','WhatsappApplication,\x20%s,\x20%s','message','info','result','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x3b85c2,_0x50d623){var _0x48a40d=function(_0x7283d){while(--_0x7283d){_0x3b85c2['push'](_0x3b85c2['shift']());}};_0x48a40d(++_0x50d623);}(_0xb903,0x185));var _0x3b90=function(_0x1839f1,_0x160301){_0x1839f1=_0x1839f1-0x0;var _0x4ff7b4=_0xb903[_0x1839f1];return _0x4ff7b4;};'use strict';var _=require(_0x3b90('0x0'));var util=require(_0x3b90('0x1'));var moment=require(_0x3b90('0x2'));var BPromise=require(_0x3b90('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3b90('0x4'));var db=require(_0x3b90('0x5'))['db'];var utils=require(_0x3b90('0x6'));var logger=require(_0x3b90('0x7'))(_0x3b90('0x8'));var config=require(_0x3b90('0x9'));var jayson=require(_0x3b90('0xa'));var client=jayson['client'][_0x3b90('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5e845a,_0x55792c,_0x153283){return new BPromise(function(_0x2e4c06,_0x42efe8){return client[_0x3b90('0xc')](_0x5e845a,_0x153283)['then'](function(_0x5cda1d){logger['info']('WhatsappApplication,\x20%s,\x20%s',_0x55792c,'request\x20sent');logger['debug'](_0x3b90('0xd'),_0x55792c,_0x3b90('0xe'),JSON['stringify'](_0x5cda1d));if(_0x5cda1d[_0x3b90('0xf')]){if(_0x5cda1d[_0x3b90('0xf')]['code']===0x1f4){logger[_0x3b90('0xf')](_0x3b90('0x10'),_0x55792c,_0x5cda1d[_0x3b90('0xf')]['message']);return _0x42efe8(_0x5cda1d['error'][_0x3b90('0x11')]);}logger['error']('WhatsappApplication,\x20%s,\x20%s',_0x55792c,_0x5cda1d[_0x3b90('0xf')][_0x3b90('0x11')]);return _0x2e4c06(_0x5cda1d['error']['message']);}else{logger[_0x3b90('0x12')](_0x3b90('0x10'),_0x55792c,_0x3b90('0xe'));_0x2e4c06(_0x5cda1d[_0x3b90('0x13')][_0x3b90('0x11')]);}})['catch'](function(_0x494970){logger[_0x3b90('0xf')](_0x3b90('0x10'),_0x55792c,_0x494970);_0x42efe8(_0x494970);});});} \ No newline at end of file +var _0xe5b3=['request\x20sent','debug','WhatsappApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','WhatsappApplication,\x20%s,\x20%s'];(function(_0x2c3bd9,_0x45f815){var _0x112e55=function(_0x22de25){while(--_0x22de25){_0x2c3bd9['push'](_0x2c3bd9['shift']());}};_0x112e55(++_0x45f815);}(_0xe5b3,0x133));var _0x3e5b=function(_0x51fca9,_0x54a13f){_0x51fca9=_0x51fca9-0x0;var _0xbf5bb=_0xe5b3[_0x51fca9];return _0xbf5bb;};'use strict';var _=require('lodash');var util=require(_0x3e5b('0x0'));var moment=require(_0x3e5b('0x1'));var BPromise=require(_0x3e5b('0x2'));var rs=require(_0x3e5b('0x3'));var fs=require('fs');var Redis=require(_0x3e5b('0x4'));var db=require(_0x3e5b('0x5'))['db'];var utils=require(_0x3e5b('0x6'));var logger=require(_0x3e5b('0x7'))(_0x3e5b('0x8'));var config=require(_0x3e5b('0x9'));var jayson=require(_0x3e5b('0xa'));var client=jayson['client'][_0x3e5b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5dcf55,_0x534e7d,_0x41d46f){return new BPromise(function(_0x3901c2,_0x3c7c2e){return client[_0x3e5b('0xc')](_0x5dcf55,_0x41d46f)['then'](function(_0x4ed6bc){logger[_0x3e5b('0xd')](_0x3e5b('0xe'),_0x534e7d,_0x3e5b('0xf'));logger[_0x3e5b('0x10')](_0x3e5b('0x11'),_0x534e7d,'request\x20sent',JSON[_0x3e5b('0x12')](_0x4ed6bc));if(_0x4ed6bc['error']){if(_0x4ed6bc[_0x3e5b('0x13')][_0x3e5b('0x14')]===0x1f4){logger[_0x3e5b('0x13')](_0x3e5b('0xe'),_0x534e7d,_0x4ed6bc[_0x3e5b('0x13')][_0x3e5b('0x15')]);return _0x3c7c2e(_0x4ed6bc[_0x3e5b('0x13')]['message']);}logger[_0x3e5b('0x13')]('WhatsappApplication,\x20%s,\x20%s',_0x534e7d,_0x4ed6bc['error']['message']);return _0x3901c2(_0x4ed6bc[_0x3e5b('0x13')][_0x3e5b('0x15')]);}else{logger[_0x3e5b('0xd')]('WhatsappApplication,\x20%s,\x20%s',_0x534e7d,_0x3e5b('0xf'));_0x3901c2(_0x4ed6bc['result']['message']);}})[_0x3e5b('0x16')](function(_0x11b41b){logger['error'](_0x3e5b('0xe'),_0x534e7d,_0x11b41b);_0x3c7c2e(_0x11b41b);});});} \ No newline at end of file diff --git a/server/api/whatsappInteraction/index.js b/server/api/whatsappInteraction/index.js index b88004b..5b9c342 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 _0x3baf=['put','/:id','tracked','whatsappinteraction:update','delete','whatsappinteraction:destroy','destroy','removeTags','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappInteraction.controller','get','isAuthenticated','index','show','/:id/messages','getMessages','/:id/download','download','post','create','addMessage','whatsapp','whatsappinteraction:addtags','addTags'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x3baf,0xf7));var _0xf3ba=function(_0x536b33,_0xab0be1){_0x536b33=_0x536b33-0x0;var _0x53018c=_0x3baf[_0x536b33];return _0x53018c;};'use strict';var multer=require(_0xf3ba('0x0'));var util=require(_0xf3ba('0x1'));var path=require(_0xf3ba('0x2'));var timeout=require(_0xf3ba('0x3'));var express=require(_0xf3ba('0x4'));var router=express[_0xf3ba('0x5')]();var fs_extra=require(_0xf3ba('0x6'));var auth=require(_0xf3ba('0x7'));var interaction=require(_0xf3ba('0x8'));var config=require(_0xf3ba('0x9'));var controller=require(_0xf3ba('0xa'));router[_0xf3ba('0xb')]('/',auth[_0xf3ba('0xc')](),controller[_0xf3ba('0xd')]);router[_0xf3ba('0xb')]('/describe',auth['isAuthenticated'](),controller['describe']);router[_0xf3ba('0xb')]('/:id',auth[_0xf3ba('0xc')](),controller[_0xf3ba('0xe')]);router[_0xf3ba('0xb')](_0xf3ba('0xf'),auth[_0xf3ba('0xc')](),controller[_0xf3ba('0x10')]);router[_0xf3ba('0xb')](_0xf3ba('0x11'),auth[_0xf3ba('0xc')](),controller[_0xf3ba('0x12')]);router[_0xf3ba('0x13')]('/',auth[_0xf3ba('0xc')](),controller[_0xf3ba('0x14')]);router[_0xf3ba('0x13')](_0xf3ba('0xf'),auth[_0xf3ba('0xc')](),controller[_0xf3ba('0x15')]);router[_0xf3ba('0x13')]('/:id/tags',auth[_0xf3ba('0xc')](),interaction['tracked'](_0xf3ba('0x16'),_0xf3ba('0x17')),controller[_0xf3ba('0x18')]);router[_0xf3ba('0x19')](_0xf3ba('0x1a'),auth['isAuthenticated'](),interaction[_0xf3ba('0x1b')](_0xf3ba('0x16'),_0xf3ba('0x1c')),controller['update']);router[_0xf3ba('0x1d')](_0xf3ba('0x1a'),auth[_0xf3ba('0xc')](),interaction[_0xf3ba('0x1b')]('whatsapp',_0xf3ba('0x1e')),controller[_0xf3ba('0x1f')]);router['delete']('/:id/tags',auth[_0xf3ba('0xc')](),controller[_0xf3ba('0x20')]);module[_0xf3ba('0x21')]=router; \ No newline at end of file +var _0xc7a3=['show','/:id/messages','post','create','addMessage','/:id/tags','tracked','whatsappinteraction:addtags','addTags','whatsapp','update','whatsappinteraction:destroy','destroy','removeTags','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc7a3,0xbd));var _0x3c7a=function(_0x46b2ef,_0x4c1df5){_0x46b2ef=_0x46b2ef-0x0;var _0x1f297d=_0xc7a3[_0x46b2ef];return _0x1f297d;};'use strict';var multer=require('multer');var util=require(_0x3c7a('0x0'));var path=require(_0x3c7a('0x1'));var timeout=require(_0x3c7a('0x2'));var express=require(_0x3c7a('0x3'));var router=express[_0x3c7a('0x4')]();var fs_extra=require(_0x3c7a('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x3c7a('0x6'));var config=require(_0x3c7a('0x7'));var controller=require('./whatsappInteraction.controller');router[_0x3c7a('0x8')]('/',auth[_0x3c7a('0x9')](),controller[_0x3c7a('0xa')]);router['get'](_0x3c7a('0xb'),auth['isAuthenticated'](),controller[_0x3c7a('0xc')]);router['get'](_0x3c7a('0xd'),auth[_0x3c7a('0x9')](),controller[_0x3c7a('0xe')]);router['get'](_0x3c7a('0xf'),auth[_0x3c7a('0x9')](),controller['getMessages']);router[_0x3c7a('0x8')]('/:id/download',auth[_0x3c7a('0x9')](),controller['download']);router[_0x3c7a('0x10')]('/',auth[_0x3c7a('0x9')](),controller[_0x3c7a('0x11')]);router[_0x3c7a('0x10')](_0x3c7a('0xf'),auth['isAuthenticated'](),controller[_0x3c7a('0x12')]);router[_0x3c7a('0x10')](_0x3c7a('0x13'),auth[_0x3c7a('0x9')](),interaction[_0x3c7a('0x14')]('whatsapp',_0x3c7a('0x15')),controller[_0x3c7a('0x16')]);router['put']('/:id',auth[_0x3c7a('0x9')](),interaction[_0x3c7a('0x14')](_0x3c7a('0x17'),'whatsappinteraction:update'),controller[_0x3c7a('0x18')]);router['delete'](_0x3c7a('0xd'),auth[_0x3c7a('0x9')](),interaction[_0x3c7a('0x14')](_0x3c7a('0x17'),_0x3c7a('0x19')),controller[_0x3c7a('0x1a')]);router['delete'](_0x3c7a('0x13'),auth[_0x3c7a('0x9')](),controller[_0x3c7a('0x1b')]);module[_0x3c7a('0x1c')]=router; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.attributes.js b/server/api/whatsappInteraction/whatsappInteraction.attributes.js index 9a637ca..220a016 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 _0x59ac=['exports','BOOLEAN','DATE','STRING','ENUM','out','INTEGER','sequelize','moment'];(function(_0x934425,_0x5af72f){var _0x31d596=function(_0x219869){while(--_0x219869){_0x934425['push'](_0x934425['shift']());}};_0x31d596(++_0x5af72f);}(_0x59ac,0x73));var _0xc59a=function(_0x375aa0,_0x152f4e){_0x375aa0=_0x375aa0-0x0;var _0x22975a=_0x59ac[_0x375aa0];return _0x22975a;};'use strict';var Sequelize=require(_0xc59a('0x0'));var moment=require(_0xc59a('0x1'));module[_0xc59a('0x2')]={'closed':{'type':Sequelize[_0xc59a('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xc59a('0x4')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0xc59a('0x5')]},'thirdDisposition':{'type':Sequelize[_0xc59a('0x5')]},'note':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0xc59a('0x5')]},'read1stAt':{'type':Sequelize[_0xc59a('0x4')]},'firstMsgDirection':{'type':Sequelize[_0xc59a('0x6')]('in',_0xc59a('0x7')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xc59a('0x4')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0xc59a('0x7')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueId':{'type':Sequelize[_0xc59a('0x8')]}}; \ No newline at end of file +var _0x2fc9=['out','INTEGER','moment','exports','BOOLEAN','DATE','STRING','ENUM'];(function(_0x2e4e19,_0x493b50){var _0x9ba20b=function(_0x2f6456){while(--_0x2f6456){_0x2e4e19['push'](_0x2e4e19['shift']());}};_0x9ba20b(++_0x493b50);}(_0x2fc9,0xc2));var _0x92fc=function(_0x36ed3c,_0x44a00a){_0x36ed3c=_0x36ed3c-0x0;var _0x52a2e0=_0x2fc9[_0x36ed3c];return _0x52a2e0;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x92fc('0x0'));module[_0x92fc('0x1')]={'closed':{'type':Sequelize[_0x92fc('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x92fc('0x3')]},'disposition':{'type':Sequelize[_0x92fc('0x4')]},'secondDisposition':{'type':Sequelize[_0x92fc('0x4')]},'thirdDisposition':{'type':Sequelize[_0x92fc('0x4')]},'note':{'type':Sequelize[_0x92fc('0x4')]},'phone':{'type':Sequelize[_0x92fc('0x4')]},'read1stAt':{'type':Sequelize[_0x92fc('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x92fc('0x5')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x92fc('0x6')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x92fc('0x2')],'defaultValue':![]},'queueId':{'type':Sequelize[_0x92fc('0x7')]}}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.controller.js b/server/api/whatsappInteraction/whatsappInteraction.controller.js index a3c8b8f..93ad2db 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 _0xc1e4=['../../config/environment','redis','localhost','sendStatus','status','end','offset','undefined','limit','count','set','json','update','then','destroy','error','stack','name','send','index','map','WhatsappInteraction','rawAttributes','type','key','getOptions','findAll','whatsapp','query','catch','show','params','keys','filters','model','fields','attributes','length','includeAll','merge','options','find','create','body','describe','addMessage','WhatsappMessage','ids','omit','getMessages','findOne','intersection','hasOwnProperty','nolimit','order','sort','pick','where','WhatsappInteractionId','filter','$gte','format','YYYY-MM-DD\x20HH:mm:ss','include','rows','addTags','spread','color','emit','whatsappInteractionTags:save','removeTags','download','unix','join','files','tmp','server','attachments','transcript-%d-%s.zip','User','fullname','push','CmContact','Contact','firstName','lastName','Attachment','createdAt','secret','read','WhatsappAccount','Owner','get','mkdirSync','Whatsapp','Account','N.A.','toString','closed','closedAt','disposition','Messages','basename','existsSync','createReadStream','pipe','createWriteStream','direction','out','System','value','renderFile','root','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','log','err','rimraf','zip-dir','moment','bluebird','util','path','ejs','ioredis','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api'];(function(_0x58f457,_0x990c9b){var _0x2e8229=function(_0x53b2aa){while(--_0x53b2aa){_0x58f457['push'](_0x58f457['shift']());}};_0x2e8229(++_0x990c9b);}(_0xc1e4,0x78));var _0x4c1e=function(_0x4dbc65,_0x30f8be){_0x4dbc65=_0x4dbc65-0x0;var _0x3e2e79=_0xc1e4[_0x4dbc65];return _0x3e2e79;};'use strict';var rimraf=require(_0x4c1e('0x0'));var zipdir=require(_0x4c1e('0x1'));var moment=require(_0x4c1e('0x2'));var BPromise=require(_0x4c1e('0x3'));var util=require(_0x4c1e('0x4'));var path=require(_0x4c1e('0x5'));var ejs=require(_0x4c1e('0x6'));var fs=require('fs');var _=require('lodash');var Redis=require(_0x4c1e('0x7'));var interaction=require('../../components/interaction/service');var qs=require(_0x4c1e('0x8'));var pdf=require(_0x4c1e('0x9'));var logger=require(_0x4c1e('0xa'))(_0x4c1e('0xb'));var config=require(_0x4c1e('0xc'));var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config[_0x4c1e('0xd')],{'host':_0x4c1e('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4c1e('0xd')]));require('./whatsappInteraction.socket')['register'](socket);function respondWithStatusCode(_0x79a2e3,_0x5bca40){_0x5bca40=_0x5bca40||0xcc;return function(_0x26e634){if(_0x26e634){return _0x79a2e3[_0x4c1e('0xf')](_0x5bca40);}return _0x79a2e3[_0x4c1e('0x10')](_0x5bca40)[_0x4c1e('0x11')]();};}function respondWithResult(_0x591c45,_0x18d1bb){_0x18d1bb=_0x18d1bb||0xc8;return function(_0x5a0fd3){if(_0x5a0fd3){return _0x591c45[_0x4c1e('0x10')](_0x18d1bb)['json'](_0x5a0fd3);}};}function respondWithFilteredResult(_0x4f7e34,_0x2f4a74){return function(_0x28fd54){if(_0x28fd54){var _0x5514cf=typeof _0x2f4a74[_0x4c1e('0x12')]===_0x4c1e('0x13')&&typeof _0x2f4a74[_0x4c1e('0x14')]===_0x4c1e('0x13');var _0x170950=_0x28fd54[_0x4c1e('0x15')];var _0x159b88=_0x5514cf?0x0:_0x2f4a74['offset'];var _0x1778e6=_0x5514cf?_0x28fd54[_0x4c1e('0x15')]:_0x2f4a74[_0x4c1e('0x12')]+_0x2f4a74[_0x4c1e('0x14')];var _0x4e9aa8;if(_0x1778e6>=_0x170950){_0x1778e6=_0x170950;_0x4e9aa8=0xc8;}else{_0x4e9aa8=0xce;}_0x4f7e34['status'](_0x4e9aa8);return _0x4f7e34[_0x4c1e('0x16')]('Content-Range',_0x159b88+'-'+_0x1778e6+'/'+_0x170950)[_0x4c1e('0x17')](_0x28fd54);}return null;};}function saveUpdates(_0x1bd866){return function(_0x3be776){if(_0x3be776){return _0x3be776[_0x4c1e('0x18')](_0x1bd866)[_0x4c1e('0x19')](function(_0x5d6d7a){return _0x5d6d7a;});}return null;};}function removeEntity(_0x3e347a){return function(_0x535581){if(_0x535581){return _0x535581[_0x4c1e('0x1a')]()[_0x4c1e('0x19')](function(){_0x3e347a[_0x4c1e('0x10')](0xcc)[_0x4c1e('0x11')]();});}};}function handleEntityNotFound(_0x56eea3){return function(_0x5933e1){if(!_0x5933e1){_0x56eea3[_0x4c1e('0xf')](0x194);}return _0x5933e1;};}function handleError(_0xf01f68,_0x428e69){_0x428e69=_0x428e69||0x1f4;return function(_0x3fe88e){logger[_0x4c1e('0x1b')](_0x3fe88e[_0x4c1e('0x1c')]);if(_0x3fe88e[_0x4c1e('0x1d')]){delete _0x3fe88e[_0x4c1e('0x1d')];}_0xf01f68[_0x4c1e('0x10')](_0x428e69)[_0x4c1e('0x1e')](_0x3fe88e);};}exports[_0x4c1e('0x1f')]=function(_0x18ab83,_0x5421a8){var _0x1e1174={};var _0x5e41a7=_[_0x4c1e('0x20')](db[_0x4c1e('0x21')][_0x4c1e('0x22')],function(_0x26dfe2){return{'name':_0x26dfe2['fieldName'],'type':_0x26dfe2[_0x4c1e('0x23')][_0x4c1e('0x24')]};});_0x1e1174=qs[_0x4c1e('0x25')](_0x5e41a7,_0x18ab83);return interaction[_0x4c1e('0x26')](_0x4c1e('0x27'),_0x18ab83[_0x4c1e('0x28')],_0x18ab83['user'],_0x1e1174,_0x5e41a7)['then'](respondWithFilteredResult(_0x5421a8,_0x1e1174))[_0x4c1e('0x29')](handleError(_0x5421a8,null));};exports[_0x4c1e('0x2a')]=function(_0x338ede,_0x3664a4){var _0x35f325={'raw':![],'where':{'id':_0x338ede[_0x4c1e('0x2b')]['id']}},_0x1a0a50={};_0x1a0a50['model']=_[_0x4c1e('0x2c')](db['WhatsappInteraction'][_0x4c1e('0x22')]);_0x1a0a50[_0x4c1e('0x28')]=_[_0x4c1e('0x2c')](_0x338ede['query']);_0x1a0a50[_0x4c1e('0x2d')]=_['intersection'](_0x1a0a50[_0x4c1e('0x2e')],_0x1a0a50[_0x4c1e('0x28')]);_0x35f325['attributes']=_['intersection'](_0x1a0a50[_0x4c1e('0x2e')],qs[_0x4c1e('0x2f')](_0x338ede['query'][_0x4c1e('0x2f')]));_0x35f325[_0x4c1e('0x30')]=_0x35f325[_0x4c1e('0x30')][_0x4c1e('0x31')]?_0x35f325[_0x4c1e('0x30')]:_0x1a0a50[_0x4c1e('0x2e')];if(_0x338ede[_0x4c1e('0x28')][_0x4c1e('0x32')]){_0x35f325['include']=[{'all':!![]}];}_0x35f325=_[_0x4c1e('0x33')]({},_0x35f325,_0x338ede[_0x4c1e('0x34')]);return db[_0x4c1e('0x21')][_0x4c1e('0x35')](_0x35f325)[_0x4c1e('0x19')](handleEntityNotFound(_0x3664a4,null))[_0x4c1e('0x19')](respondWithResult(_0x3664a4,null))[_0x4c1e('0x29')](handleError(_0x3664a4,null));};exports[_0x4c1e('0x36')]=function(_0x291d57,_0x5f1a1c){return db[_0x4c1e('0x21')]['create'](_0x291d57[_0x4c1e('0x37')],{})[_0x4c1e('0x19')](respondWithResult(_0x5f1a1c,0xc9))[_0x4c1e('0x29')](handleError(_0x5f1a1c,null));};exports['update']=function(_0xc04969,_0x2feff4){if(_0xc04969[_0x4c1e('0x37')]['id']){delete _0xc04969[_0x4c1e('0x37')]['id'];}return db['WhatsappInteraction'][_0x4c1e('0x35')]({'where':{'id':_0xc04969[_0x4c1e('0x2b')]['id']}})[_0x4c1e('0x19')](handleEntityNotFound(_0x2feff4,null))[_0x4c1e('0x19')](saveUpdates(_0xc04969['body'],null))[_0x4c1e('0x19')](respondWithResult(_0x2feff4,null))[_0x4c1e('0x29')](handleError(_0x2feff4,null));};exports['destroy']=function(_0x4ea5fa,_0x33fa0a){return db[_0x4c1e('0x21')][_0x4c1e('0x35')]({'where':{'id':_0x4ea5fa[_0x4c1e('0x2b')]['id']}})['then'](handleEntityNotFound(_0x33fa0a,null))[_0x4c1e('0x19')](removeEntity(_0x33fa0a,null))['catch'](handleError(_0x33fa0a,null));};exports['describe']=function(_0x1c1b30,_0x17e5ee){return db[_0x4c1e('0x21')][_0x4c1e('0x38')]()['then'](respondWithResult(_0x17e5ee,null))[_0x4c1e('0x29')](handleError(_0x17e5ee,null));};exports[_0x4c1e('0x39')]=function(_0x192e2d,_0x3d913b){return db[_0x4c1e('0x3a')][_0x4c1e('0x35')]({'where':{'id':_0x192e2d['params']['id']}})[_0x4c1e('0x19')](handleEntityNotFound(_0x3d913b,null))[_0x4c1e('0x19')](function(_0x5bce0c){if(_0x5bce0c){return _0x5bce0c[_0x4c1e('0x39')](_0x192e2d['body'][_0x4c1e('0x3b')],_[_0x4c1e('0x3c')](_0x192e2d[_0x4c1e('0x37')],['ids','id'])||{});}})[_0x4c1e('0x19')](respondWithResult(_0x3d913b,null))[_0x4c1e('0x29')](handleError(_0x3d913b,null));};exports[_0x4c1e('0x3d')]=function(_0x220dc9,_0x3cbe1a){var _0xb83edb={'raw':![],'where':{}};var _0x124990={};var _0x56ec3c={'count':0x0,'rows':[]};return db[_0x4c1e('0x21')][_0x4c1e('0x3e')]({'where':{'id':_0x220dc9[_0x4c1e('0x2b')]['id']}})[_0x4c1e('0x19')](handleEntityNotFound(_0x3cbe1a,null))[_0x4c1e('0x19')](function(_0x1132a9){if(_0x1132a9){_0x124990[_0x4c1e('0x2e')]=_[_0x4c1e('0x2c')](db[_0x4c1e('0x3a')]['rawAttributes']);_0x124990[_0x4c1e('0x28')]=_['keys'](_0x220dc9[_0x4c1e('0x28')]);_0x124990['filters']=_['intersection'](_0x124990[_0x4c1e('0x2e')],_0x124990[_0x4c1e('0x28')]);_0xb83edb[_0x4c1e('0x30')]=_[_0x4c1e('0x3f')](_0x124990[_0x4c1e('0x2e')],qs[_0x4c1e('0x2f')](_0x220dc9[_0x4c1e('0x28')]['fields']));_0xb83edb[_0x4c1e('0x30')]=_0xb83edb['attributes'][_0x4c1e('0x31')]?_0xb83edb[_0x4c1e('0x30')]:_0x124990[_0x4c1e('0x2e')];if(!_0x220dc9[_0x4c1e('0x28')][_0x4c1e('0x40')](_0x4c1e('0x41'))){_0xb83edb['limit']=qs[_0x4c1e('0x14')](_0x220dc9[_0x4c1e('0x28')]['limit']);_0xb83edb['offset']=qs[_0x4c1e('0x12')](_0x220dc9[_0x4c1e('0x28')][_0x4c1e('0x12')]);}_0xb83edb[_0x4c1e('0x42')]=qs[_0x4c1e('0x43')](_0x220dc9[_0x4c1e('0x28')][_0x4c1e('0x43')]);_0xb83edb['where']=qs['filters'](_[_0x4c1e('0x44')](_0x220dc9['query'],_0x124990[_0x4c1e('0x2d')]));_0xb83edb[_0x4c1e('0x45')][_0x4c1e('0x46')]=_0x1132a9['id'];if(_0x220dc9['query'][_0x4c1e('0x47')]){_0xb83edb[_0x4c1e('0x45')]=_['merge'](_0xb83edb[_0x4c1e('0x45')],{'$or':_[_0x4c1e('0x20')](_0xb83edb[_0x4c1e('0x30')],function(_0x192f23){var _0x371330={};_0x371330[_0x192f23]={'$like':'%'+_0x220dc9[_0x4c1e('0x28')][_0x4c1e('0x47')]+'%'};return _0x371330;})});}if(_0x220dc9[_0x4c1e('0x28')][_0x4c1e('0x48')]){var _0xd0f11c=_0x220dc9[_0x4c1e('0x28')]['$gte']['split'](',');var _0x2a5694={};_0x2a5694[_0xd0f11c[0x0]]={'$gte':moment(_0xd0f11c[0x1])[_0x4c1e('0x49')](_0x4c1e('0x4a'))};_0xb83edb[_0x4c1e('0x45')]=_['merge'](_0xb83edb[_0x4c1e('0x45')],_0x2a5694);}_0xb83edb=_[_0x4c1e('0x33')]({},_0xb83edb,_0x220dc9[_0x4c1e('0x34')]);return db[_0x4c1e('0x3a')][_0x4c1e('0x15')]({'where':_0xb83edb[_0x4c1e('0x45')]})[_0x4c1e('0x19')](function(_0x252f24){_0x56ec3c[_0x4c1e('0x15')]=_0x252f24;if(_0x220dc9[_0x4c1e('0x28')][_0x4c1e('0x32')]){_0xb83edb[_0x4c1e('0x4b')]=[{'all':!![]}];}return db['WhatsappMessage'][_0x4c1e('0x26')](_0xb83edb);})[_0x4c1e('0x19')](function(_0x4573d1){_0x56ec3c[_0x4c1e('0x4c')]=_0x4573d1;return _0x56ec3c;});}})[_0x4c1e('0x19')](respondWithFilteredResult(_0x3cbe1a,_0xb83edb))['catch'](handleError(_0x3cbe1a,null));};exports[_0x4c1e('0x4d')]=function(_0x4a1962,_0x31a9e2){return db['WhatsappInteraction'][_0x4c1e('0x35')]({'where':{'id':_0x4a1962[_0x4c1e('0x2b')]['id']}})[_0x4c1e('0x19')](handleEntityNotFound(_0x31a9e2,null))[_0x4c1e('0x19')](function(_0x9457cc){if(_0x9457cc){return _0x9457cc['setTags'](_0x4a1962['body'][_0x4c1e('0x3b')],_[_0x4c1e('0x3c')](_0x4a1962[_0x4c1e('0x37')],['ids','id'])||{})[_0x4c1e('0x4e')](function(){return db['Tag'][_0x4c1e('0x26')]({'attributes':['id',_0x4c1e('0x1d'),_0x4c1e('0x4f')],'where':{'id':_0x4a1962[_0x4c1e('0x37')]['ids']}});})[_0x4c1e('0x19')](function(_0x13f0d4){socket[_0x4c1e('0x50')](_0x4c1e('0x51'),{'id':Number(_0x4a1962[_0x4c1e('0x2b')]['id']),'tags':_0x13f0d4||[]});return{'id':Number(_0x4a1962['params']['id']),'tags':_0x13f0d4||[]};});}})[_0x4c1e('0x19')](respondWithResult(_0x31a9e2,null))['catch'](handleError(_0x31a9e2,null));};exports['removeTags']=function(_0x49057b,_0x42310a){return db[_0x4c1e('0x21')][_0x4c1e('0x35')]({'where':{'id':_0x49057b[_0x4c1e('0x2b')]['id']}})[_0x4c1e('0x19')](handleEntityNotFound(_0x42310a,null))['then'](function(_0x41b8bb){if(_0x41b8bb){return _0x41b8bb[_0x4c1e('0x52')](_0x49057b[_0x4c1e('0x28')]['ids']);}})[_0x4c1e('0x19')](respondWithStatusCode(_0x42310a,null))[_0x4c1e('0x29')](handleError(_0x42310a,null));};exports[_0x4c1e('0x53')]=function(_0x17c3ba,_0x55f467){var _0x444c37=moment()[_0x4c1e('0x54')]()['toString']();var _0x1da4d0=path[_0x4c1e('0x55')](config['root'],'server',_0x4c1e('0x56'),_0x4c1e('0x57'));var _0x547317=path['join'](config['root'],_0x4c1e('0x58'),_0x4c1e('0x56'),_0x4c1e('0x59'));var _0x39110d=path[_0x4c1e('0x55')](_0x1da4d0,_0x444c37);var _0x3aa04a=util[_0x4c1e('0x49')](_0x4c1e('0x5a'),_0x17c3ba[_0x4c1e('0x2b')]['id'],_0x444c37);var _0x2216ac=path[_0x4c1e('0x55')](_0x1da4d0,_0x3aa04a);var _0x65d6ac=[];_0x65d6ac['push']({'model':db[_0x4c1e('0x5b')],'as':_0x4c1e('0x5b'),'attributes':['id',_0x4c1e('0x5c')],'raw':!![]});_0x65d6ac[_0x4c1e('0x5d')]({'model':db[_0x4c1e('0x5e')],'as':_0x4c1e('0x5f'),'attributes':['id',_0x4c1e('0x60'),_0x4c1e('0x61')],'raw':!![]});if(_0x17c3ba[_0x4c1e('0x28')]['attachments']){_0x65d6ac[_0x4c1e('0x5d')]({'model':db[_0x4c1e('0x62')],'as':_0x4c1e('0x62'),'raw':!![]});}var _0x471160=[{'model':db[_0x4c1e('0x3a')],'as':'Messages','attributes':['id',_0x4c1e('0x37'),_0x4c1e('0x63'),'direction',_0x4c1e('0x64'),_0x4c1e('0x65')],'include':_0x65d6ac}];_0x471160[_0x4c1e('0x5d')]({'model':db[_0x4c1e('0x66')],'as':'Account','attributes':['id',_0x4c1e('0x1d')]});_0x471160[_0x4c1e('0x5d')]({'model':db[_0x4c1e('0x5b')],'as':_0x4c1e('0x67'),'attributes':['id','fullname']});return db[_0x4c1e('0x21')][_0x4c1e('0x35')]({'where':{'id':_0x17c3ba[_0x4c1e('0x2b')]['id']},'include':_0x471160})[_0x4c1e('0x19')](handleEntityNotFound(_0x55f467,null))['then'](function(_0x455d50){if(_0x455d50){var _0x2f22c7=_0x455d50[_0x4c1e('0x68')]({'plain':!![]});fs[_0x4c1e('0x69')](_0x39110d);var _0x2346de={'channel':_0x4c1e('0x6a'),'account':_0x2f22c7[_0x4c1e('0x6b')]['name'],'agent':_0x2f22c7[_0x4c1e('0x67')]?_0x2f22c7['Owner'][_0x4c1e('0x5c')]:_0x4c1e('0x6c'),'createdAt':moment(_0x2f22c7[_0x4c1e('0x63')])[_0x4c1e('0x49')](_0x4c1e('0x4a'))[_0x4c1e('0x6d')](),'closedAt':_0x2f22c7[_0x4c1e('0x6e')]?moment(_0x2f22c7[_0x4c1e('0x6f')])['format'](_0x4c1e('0x4a'))[_0x4c1e('0x6d')]():'','disposition':_0x2f22c7[_0x4c1e('0x70')],'messages':_(_0x2f22c7[_0x4c1e('0x71')])[_0x4c1e('0x47')]({'secret':![]})[_0x4c1e('0x20')](function(_0x5f2788){if(_0x5f2788['Attachment']){var _0x4d8882=path[_0x4c1e('0x55')](_0x547317,_0x5f2788['Attachment'][_0x4c1e('0x72')]);if(fs[_0x4c1e('0x73')](_0x4d8882)){fs[_0x4c1e('0x74')](_0x4d8882)[_0x4c1e('0x75')](fs[_0x4c1e('0x76')](path[_0x4c1e('0x55')](_0x39110d,_0x5f2788[_0x4c1e('0x62')][_0x4c1e('0x72')])));}}return{'date':moment(_0x5f2788[_0x4c1e('0x63')])[_0x4c1e('0x49')]('YYYY-MM-DD\x20HH:mm:ss')[_0x4c1e('0x6d')](),'sender':_0x5f2788[_0x4c1e('0x77')]===_0x4c1e('0x78')?_0x5f2788[_0x4c1e('0x5b')]?_0x5f2788[_0x4c1e('0x5b')][_0x4c1e('0x5c')]:_0x4c1e('0x79'):_0x5f2788[_0x4c1e('0x5f')][_0x4c1e('0x60')]+(_0x5f2788[_0x4c1e('0x5f')][_0x4c1e('0x61')]?'\x20'+_0x5f2788[_0x4c1e('0x5f')][_0x4c1e('0x61')]:''),'body':_0x5f2788['Attachment']?_0x5f2788['Attachment']['basename']:_0x5f2788[_0x4c1e('0x37')],'direction':_0x5f2788[_0x4c1e('0x77')]===_0x4c1e('0x78')?'A':'C','secret':_0x5f2788['secret'],'read':_0x5f2788[_0x4c1e('0x65')],'attachment':_0x5f2788[_0x4c1e('0x62')]};})[_0x4c1e('0x7a')]()};return ejs[_0x4c1e('0x7b')](path['join'](config[_0x4c1e('0x7c')],'server',_0x4c1e('0x7d'),_0x4c1e('0x7e')),{'interaction':_0x2346de})['then'](function(_0x3fdaab){var _0x3ceb77=path[_0x4c1e('0x55')](_0x39110d,_0x4c1e('0x7f')+_0x2f22c7['id']+'-'+_0x444c37+_0x4c1e('0x80'));var _0x1914e7={'path':_0x3ceb77,'channel':_0x4c1e('0x6a'),'interactionId':_0x2f22c7['id']};return pdf[_0x4c1e('0x81')](_0x3fdaab,_0x1914e7);})[_0x4c1e('0x19')](function(){return new BPromise(function(_0xe3f21,_0x12ba49){zipdir(_0x39110d,{'saveTo':_0x2216ac},function(_0x4671eb,_0x2f4f6a){if(_0x4671eb)return _0x12ba49(_0x4671eb);return _0xe3f21(_0x2f4f6a);});})['then'](function(){return new BPromise(function(_0x14242c,_0x457acf){rimraf(_0x39110d,function(_0x18aac0){if(_0x18aac0)_0x457acf(_0x18aac0);return _0x14242c();});});})['then'](function(){return _0x55f467[_0x4c1e('0x53')](_0x2216ac,_0x3aa04a,function(_0x25421a){if(_0x25421a){console[_0x4c1e('0x82')](_0x4c1e('0x83'),_0x25421a);}else{fs['unlinkSync'](_0x2216ac);}});});});}else{return _0x55f467[_0x4c1e('0xf')](0xc8);}})[_0x4c1e('0x29')](handleError(_0x55f467,null));}; \ No newline at end of file +var _0x04bc=['end','json','offset','undefined','limit','count','set','Content-Range','update','then','error','stack','name','send','index','map','WhatsappInteraction','fieldName','type','getOptions','findAll','whatsapp','query','user','show','params','model','keys','rawAttributes','filters','intersection','fields','attributes','length','includeAll','include','merge','options','find','create','body','catch','destroy','describe','addMessage','WhatsappMessage','ids','getMessages','findOne','nolimit','sort','where','pick','WhatsappInteractionId','filter','$gte','split','format','rows','addTags','setTags','omit','Tag','color','removeTags','toString','join','root','server','transcript-%d-%s.zip','push','User','fullname','CmContact','Contact','lastName','attachments','Attachment','direction','secret','read','Account','Owner','get','mkdirSync','Whatsapp','N.A.','createdAt','closed','closedAt','YYYY-MM-DD\x20HH:mm:ss','disposition','Messages','existsSync','createReadStream','createWriteStream','System','firstName','basename','out','views','downloadInteraction.ejs','transcript-','createPdfFromHTML','download','log','err','unlinkSync','rimraf','zip-dir','moment','bluebird','util','ejs','lodash','ioredis','../../components/parsers/qs','../../components/export/pdf','api','../../config/environment','../../mysqldb','redis','defaults','localhost','register','sendStatus','status'];(function(_0xb3f4a6,_0x3cb9cb){var _0x1ba6bb=function(_0x3fdb37){while(--_0x3fdb37){_0xb3f4a6['push'](_0xb3f4a6['shift']());}};_0x1ba6bb(++_0x3cb9cb);}(_0x04bc,0xeb));var _0xc04b=function(_0x530a1b,_0x18540a){_0x530a1b=_0x530a1b-0x0;var _0x3e2ef0=_0x04bc[_0x530a1b];return _0x3e2ef0;};'use strict';var rimraf=require(_0xc04b('0x0'));var zipdir=require(_0xc04b('0x1'));var moment=require(_0xc04b('0x2'));var BPromise=require(_0xc04b('0x3'));var util=require(_0xc04b('0x4'));var path=require('path');var ejs=require(_0xc04b('0x5'));var fs=require('fs');var _=require(_0xc04b('0x6'));var Redis=require(_0xc04b('0x7'));var interaction=require('../../components/interaction/service');var qs=require(_0xc04b('0x8'));var pdf=require(_0xc04b('0x9'));var logger=require('../../config/logger')(_0xc04b('0xa'));var config=require(_0xc04b('0xb'));var db=require(_0xc04b('0xc'))['db'];config[_0xc04b('0xd')]=_[_0xc04b('0xe')](config[_0xc04b('0xd')],{'host':_0xc04b('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./whatsappInteraction.socket')[_0xc04b('0x10')](socket);function respondWithStatusCode(_0x4788c1,_0x3742b8){_0x3742b8=_0x3742b8||0xcc;return function(_0x6c33b8){if(_0x6c33b8){return _0x4788c1[_0xc04b('0x11')](_0x3742b8);}return _0x4788c1[_0xc04b('0x12')](_0x3742b8)[_0xc04b('0x13')]();};}function respondWithResult(_0x1d5bb4,_0x31e217){_0x31e217=_0x31e217||0xc8;return function(_0x2a3fc4){if(_0x2a3fc4){return _0x1d5bb4[_0xc04b('0x12')](_0x31e217)[_0xc04b('0x14')](_0x2a3fc4);}};}function respondWithFilteredResult(_0xd9c01d,_0x257cac){return function(_0x2de543){if(_0x2de543){var _0x42d77c=typeof _0x257cac[_0xc04b('0x15')]===_0xc04b('0x16')&&typeof _0x257cac[_0xc04b('0x17')]===_0xc04b('0x16');var _0x2b2036=_0x2de543[_0xc04b('0x18')];var _0x39b3dc=_0x42d77c?0x0:_0x257cac[_0xc04b('0x15')];var _0x3d4a43=_0x42d77c?_0x2de543['count']:_0x257cac['offset']+_0x257cac[_0xc04b('0x17')];var _0x2baa8d;if(_0x3d4a43>=_0x2b2036){_0x3d4a43=_0x2b2036;_0x2baa8d=0xc8;}else{_0x2baa8d=0xce;}_0xd9c01d[_0xc04b('0x12')](_0x2baa8d);return _0xd9c01d[_0xc04b('0x19')](_0xc04b('0x1a'),_0x39b3dc+'-'+_0x3d4a43+'/'+_0x2b2036)[_0xc04b('0x14')](_0x2de543);}return null;};}function saveUpdates(_0x136880){return function(_0x50b366){if(_0x50b366){return _0x50b366[_0xc04b('0x1b')](_0x136880)['then'](function(_0xc0815a){return _0xc0815a;});}return null;};}function removeEntity(_0x11859b){return function(_0xea6c61){if(_0xea6c61){return _0xea6c61['destroy']()[_0xc04b('0x1c')](function(){_0x11859b['status'](0xcc)[_0xc04b('0x13')]();});}};}function handleEntityNotFound(_0x65d2d1){return function(_0x2ebc01){if(!_0x2ebc01){_0x65d2d1[_0xc04b('0x11')](0x194);}return _0x2ebc01;};}function handleError(_0x1bf32a,_0x4f8dd2){_0x4f8dd2=_0x4f8dd2||0x1f4;return function(_0x48d4cd){logger[_0xc04b('0x1d')](_0x48d4cd[_0xc04b('0x1e')]);if(_0x48d4cd[_0xc04b('0x1f')]){delete _0x48d4cd[_0xc04b('0x1f')];}_0x1bf32a['status'](_0x4f8dd2)[_0xc04b('0x20')](_0x48d4cd);};}exports[_0xc04b('0x21')]=function(_0x1a6e7f,_0xedb8cd){var _0x33a2a8={};var _0x485b83=_[_0xc04b('0x22')](db[_0xc04b('0x23')]['rawAttributes'],function(_0x3c3bda){return{'name':_0x3c3bda[_0xc04b('0x24')],'type':_0x3c3bda[_0xc04b('0x25')]['key']};});_0x33a2a8=qs[_0xc04b('0x26')](_0x485b83,_0x1a6e7f);return interaction[_0xc04b('0x27')](_0xc04b('0x28'),_0x1a6e7f[_0xc04b('0x29')],_0x1a6e7f[_0xc04b('0x2a')],_0x33a2a8,_0x485b83)[_0xc04b('0x1c')](respondWithFilteredResult(_0xedb8cd,_0x33a2a8))['catch'](handleError(_0xedb8cd,null));};exports[_0xc04b('0x2b')]=function(_0x335989,_0x3c93fa){var _0x379377={'raw':![],'where':{'id':_0x335989[_0xc04b('0x2c')]['id']}},_0x5436c2={};_0x5436c2[_0xc04b('0x2d')]=_[_0xc04b('0x2e')](db['WhatsappInteraction'][_0xc04b('0x2f')]);_0x5436c2[_0xc04b('0x29')]=_['keys'](_0x335989[_0xc04b('0x29')]);_0x5436c2[_0xc04b('0x30')]=_[_0xc04b('0x31')](_0x5436c2[_0xc04b('0x2d')],_0x5436c2[_0xc04b('0x29')]);_0x379377['attributes']=_[_0xc04b('0x31')](_0x5436c2[_0xc04b('0x2d')],qs[_0xc04b('0x32')](_0x335989[_0xc04b('0x29')]['fields']));_0x379377[_0xc04b('0x33')]=_0x379377[_0xc04b('0x33')][_0xc04b('0x34')]?_0x379377[_0xc04b('0x33')]:_0x5436c2[_0xc04b('0x2d')];if(_0x335989[_0xc04b('0x29')][_0xc04b('0x35')]){_0x379377[_0xc04b('0x36')]=[{'all':!![]}];}_0x379377=_[_0xc04b('0x37')]({},_0x379377,_0x335989[_0xc04b('0x38')]);return db['WhatsappInteraction'][_0xc04b('0x39')](_0x379377)[_0xc04b('0x1c')](handleEntityNotFound(_0x3c93fa,null))[_0xc04b('0x1c')](respondWithResult(_0x3c93fa,null))['catch'](handleError(_0x3c93fa,null));};exports[_0xc04b('0x3a')]=function(_0x36d275,_0x541755){return db['WhatsappInteraction'][_0xc04b('0x3a')](_0x36d275[_0xc04b('0x3b')],{})[_0xc04b('0x1c')](respondWithResult(_0x541755,0xc9))[_0xc04b('0x3c')](handleError(_0x541755,null));};exports[_0xc04b('0x1b')]=function(_0x11abdc,_0x525026){if(_0x11abdc[_0xc04b('0x3b')]['id']){delete _0x11abdc[_0xc04b('0x3b')]['id'];}return db[_0xc04b('0x23')][_0xc04b('0x39')]({'where':{'id':_0x11abdc['params']['id']}})[_0xc04b('0x1c')](handleEntityNotFound(_0x525026,null))[_0xc04b('0x1c')](saveUpdates(_0x11abdc['body'],null))[_0xc04b('0x1c')](respondWithResult(_0x525026,null))[_0xc04b('0x3c')](handleError(_0x525026,null));};exports[_0xc04b('0x3d')]=function(_0x1b0972,_0x368bb8){return db[_0xc04b('0x23')][_0xc04b('0x39')]({'where':{'id':_0x1b0972[_0xc04b('0x2c')]['id']}})[_0xc04b('0x1c')](handleEntityNotFound(_0x368bb8,null))[_0xc04b('0x1c')](removeEntity(_0x368bb8,null))['catch'](handleError(_0x368bb8,null));};exports[_0xc04b('0x3e')]=function(_0x2a6566,_0x437f8a){return db[_0xc04b('0x23')][_0xc04b('0x3e')]()[_0xc04b('0x1c')](respondWithResult(_0x437f8a,null))[_0xc04b('0x3c')](handleError(_0x437f8a,null));};exports[_0xc04b('0x3f')]=function(_0x33c160,_0x4ba4a2){return db[_0xc04b('0x40')][_0xc04b('0x39')]({'where':{'id':_0x33c160[_0xc04b('0x2c')]['id']}})[_0xc04b('0x1c')](handleEntityNotFound(_0x4ba4a2,null))[_0xc04b('0x1c')](function(_0x159f3e){if(_0x159f3e){return _0x159f3e[_0xc04b('0x3f')](_0x33c160[_0xc04b('0x3b')][_0xc04b('0x41')],_['omit'](_0x33c160[_0xc04b('0x3b')],['ids','id'])||{});}})[_0xc04b('0x1c')](respondWithResult(_0x4ba4a2,null))[_0xc04b('0x3c')](handleError(_0x4ba4a2,null));};exports[_0xc04b('0x42')]=function(_0x4f8ffd,_0x27681f){var _0xb20431={'raw':![],'where':{}};var _0x3ce2c4={};var _0x2f027f={'count':0x0,'rows':[]};return db[_0xc04b('0x23')][_0xc04b('0x43')]({'where':{'id':_0x4f8ffd[_0xc04b('0x2c')]['id']}})['then'](handleEntityNotFound(_0x27681f,null))[_0xc04b('0x1c')](function(_0xb0f7d3){if(_0xb0f7d3){_0x3ce2c4[_0xc04b('0x2d')]=_[_0xc04b('0x2e')](db['WhatsappMessage'][_0xc04b('0x2f')]);_0x3ce2c4['query']=_['keys'](_0x4f8ffd['query']);_0x3ce2c4[_0xc04b('0x30')]=_['intersection'](_0x3ce2c4['model'],_0x3ce2c4[_0xc04b('0x29')]);_0xb20431[_0xc04b('0x33')]=_['intersection'](_0x3ce2c4[_0xc04b('0x2d')],qs[_0xc04b('0x32')](_0x4f8ffd[_0xc04b('0x29')][_0xc04b('0x32')]));_0xb20431[_0xc04b('0x33')]=_0xb20431['attributes'][_0xc04b('0x34')]?_0xb20431[_0xc04b('0x33')]:_0x3ce2c4['model'];if(!_0x4f8ffd[_0xc04b('0x29')]['hasOwnProperty'](_0xc04b('0x44'))){_0xb20431['limit']=qs[_0xc04b('0x17')](_0x4f8ffd[_0xc04b('0x29')]['limit']);_0xb20431[_0xc04b('0x15')]=qs['offset'](_0x4f8ffd[_0xc04b('0x29')][_0xc04b('0x15')]);}_0xb20431['order']=qs[_0xc04b('0x45')](_0x4f8ffd[_0xc04b('0x29')][_0xc04b('0x45')]);_0xb20431[_0xc04b('0x46')]=qs[_0xc04b('0x30')](_[_0xc04b('0x47')](_0x4f8ffd['query'],_0x3ce2c4[_0xc04b('0x30')]));_0xb20431[_0xc04b('0x46')][_0xc04b('0x48')]=_0xb0f7d3['id'];if(_0x4f8ffd[_0xc04b('0x29')][_0xc04b('0x49')]){_0xb20431['where']=_['merge'](_0xb20431[_0xc04b('0x46')],{'$or':_[_0xc04b('0x22')](_0xb20431[_0xc04b('0x33')],function(_0x1f10f5){var _0x115ffb={};_0x115ffb[_0x1f10f5]={'$like':'%'+_0x4f8ffd[_0xc04b('0x29')][_0xc04b('0x49')]+'%'};return _0x115ffb;})});}if(_0x4f8ffd['query'][_0xc04b('0x4a')]){var _0x563da2=_0x4f8ffd[_0xc04b('0x29')][_0xc04b('0x4a')][_0xc04b('0x4b')](',');var _0xb7ce8f={};_0xb7ce8f[_0x563da2[0x0]]={'$gte':moment(_0x563da2[0x1])[_0xc04b('0x4c')]('YYYY-MM-DD\x20HH:mm:ss')};_0xb20431['where']=_[_0xc04b('0x37')](_0xb20431['where'],_0xb7ce8f);}_0xb20431=_[_0xc04b('0x37')]({},_0xb20431,_0x4f8ffd['options']);return db[_0xc04b('0x40')][_0xc04b('0x18')]({'where':_0xb20431[_0xc04b('0x46')]})['then'](function(_0x1dec66){_0x2f027f[_0xc04b('0x18')]=_0x1dec66;if(_0x4f8ffd[_0xc04b('0x29')]['includeAll']){_0xb20431[_0xc04b('0x36')]=[{'all':!![]}];}return db[_0xc04b('0x40')]['findAll'](_0xb20431);})[_0xc04b('0x1c')](function(_0x54b0ad){_0x2f027f[_0xc04b('0x4d')]=_0x54b0ad;return _0x2f027f;});}})[_0xc04b('0x1c')](respondWithFilteredResult(_0x27681f,_0xb20431))['catch'](handleError(_0x27681f,null));};exports[_0xc04b('0x4e')]=function(_0x42a2db,_0x1011bc){return db[_0xc04b('0x23')][_0xc04b('0x39')]({'where':{'id':_0x42a2db[_0xc04b('0x2c')]['id']}})[_0xc04b('0x1c')](handleEntityNotFound(_0x1011bc,null))[_0xc04b('0x1c')](function(_0x4fda2c){if(_0x4fda2c){return _0x4fda2c[_0xc04b('0x4f')](_0x42a2db[_0xc04b('0x3b')][_0xc04b('0x41')],_[_0xc04b('0x50')](_0x42a2db[_0xc04b('0x3b')],[_0xc04b('0x41'),'id'])||{})['spread'](function(){return db[_0xc04b('0x51')][_0xc04b('0x27')]({'attributes':['id',_0xc04b('0x1f'),_0xc04b('0x52')],'where':{'id':_0x42a2db['body'][_0xc04b('0x41')]}});})[_0xc04b('0x1c')](function(_0x447c79){socket['emit']('whatsappInteractionTags:save',{'id':Number(_0x42a2db[_0xc04b('0x2c')]['id']),'tags':_0x447c79||[]});return{'id':Number(_0x42a2db['params']['id']),'tags':_0x447c79||[]};});}})[_0xc04b('0x1c')](respondWithResult(_0x1011bc,null))[_0xc04b('0x3c')](handleError(_0x1011bc,null));};exports[_0xc04b('0x53')]=function(_0x1a9517,_0x346355){return db[_0xc04b('0x23')]['find']({'where':{'id':_0x1a9517['params']['id']}})[_0xc04b('0x1c')](handleEntityNotFound(_0x346355,null))[_0xc04b('0x1c')](function(_0x38baee){if(_0x38baee){return _0x38baee[_0xc04b('0x53')](_0x1a9517[_0xc04b('0x29')][_0xc04b('0x41')]);}})[_0xc04b('0x1c')](respondWithStatusCode(_0x346355,null))[_0xc04b('0x3c')](handleError(_0x346355,null));};exports['download']=function(_0x236d59,_0x3ef6b6){var _0x1246b3=moment()['unix']()[_0xc04b('0x54')]();var _0xb3f341=path[_0xc04b('0x55')](config[_0xc04b('0x56')],_0xc04b('0x57'),'files','tmp');var _0x360f84=path[_0xc04b('0x55')](config['root'],_0xc04b('0x57'),'files','attachments');var _0x1e147f=path[_0xc04b('0x55')](_0xb3f341,_0x1246b3);var _0x57454e=util['format'](_0xc04b('0x58'),_0x236d59[_0xc04b('0x2c')]['id'],_0x1246b3);var _0x5a45df=path[_0xc04b('0x55')](_0xb3f341,_0x57454e);var _0xe22a9a=[];_0xe22a9a[_0xc04b('0x59')]({'model':db[_0xc04b('0x5a')],'as':'User','attributes':['id',_0xc04b('0x5b')],'raw':!![]});_0xe22a9a[_0xc04b('0x59')]({'model':db[_0xc04b('0x5c')],'as':_0xc04b('0x5d'),'attributes':['id','firstName',_0xc04b('0x5e')],'raw':!![]});if(_0x236d59['query'][_0xc04b('0x5f')]){_0xe22a9a[_0xc04b('0x59')]({'model':db[_0xc04b('0x60')],'as':_0xc04b('0x60'),'raw':!![]});}var _0x9ca8=[{'model':db[_0xc04b('0x40')],'as':'Messages','attributes':['id',_0xc04b('0x3b'),'createdAt',_0xc04b('0x61'),_0xc04b('0x62'),_0xc04b('0x63')],'include':_0xe22a9a}];_0x9ca8['push']({'model':db['WhatsappAccount'],'as':_0xc04b('0x64'),'attributes':['id',_0xc04b('0x1f')]});_0x9ca8[_0xc04b('0x59')]({'model':db[_0xc04b('0x5a')],'as':_0xc04b('0x65'),'attributes':['id',_0xc04b('0x5b')]});return db[_0xc04b('0x23')][_0xc04b('0x39')]({'where':{'id':_0x236d59['params']['id']},'include':_0x9ca8})[_0xc04b('0x1c')](handleEntityNotFound(_0x3ef6b6,null))[_0xc04b('0x1c')](function(_0x567ea9){if(_0x567ea9){var _0x32b9d9=_0x567ea9[_0xc04b('0x66')]({'plain':!![]});fs[_0xc04b('0x67')](_0x1e147f);var _0x5c2e7d={'channel':_0xc04b('0x68'),'account':_0x32b9d9[_0xc04b('0x64')][_0xc04b('0x1f')],'agent':_0x32b9d9[_0xc04b('0x65')]?_0x32b9d9[_0xc04b('0x65')]['fullname']:_0xc04b('0x69'),'createdAt':moment(_0x32b9d9[_0xc04b('0x6a')])['format']('YYYY-MM-DD\x20HH:mm:ss')['toString'](),'closedAt':_0x32b9d9[_0xc04b('0x6b')]?moment(_0x32b9d9[_0xc04b('0x6c')])[_0xc04b('0x4c')](_0xc04b('0x6d'))[_0xc04b('0x54')]():'','disposition':_0x32b9d9[_0xc04b('0x6e')],'messages':_(_0x32b9d9[_0xc04b('0x6f')])[_0xc04b('0x49')]({'secret':![]})['map'](function(_0x374af9){if(_0x374af9[_0xc04b('0x60')]){var _0xf54279=path[_0xc04b('0x55')](_0x360f84,_0x374af9[_0xc04b('0x60')]['basename']);if(fs[_0xc04b('0x70')](_0xf54279)){fs[_0xc04b('0x71')](_0xf54279)['pipe'](fs[_0xc04b('0x72')](path[_0xc04b('0x55')](_0x1e147f,_0x374af9[_0xc04b('0x60')]['basename'])));}}return{'date':moment(_0x374af9[_0xc04b('0x6a')])['format'](_0xc04b('0x6d'))[_0xc04b('0x54')](),'sender':_0x374af9[_0xc04b('0x61')]==='out'?_0x374af9[_0xc04b('0x5a')]?_0x374af9['User']['fullname']:_0xc04b('0x73'):_0x374af9[_0xc04b('0x5d')][_0xc04b('0x74')]+(_0x374af9[_0xc04b('0x5d')][_0xc04b('0x5e')]?'\x20'+_0x374af9[_0xc04b('0x5d')][_0xc04b('0x5e')]:''),'body':_0x374af9[_0xc04b('0x60')]?_0x374af9[_0xc04b('0x60')][_0xc04b('0x75')]:_0x374af9['body'],'direction':_0x374af9['direction']===_0xc04b('0x76')?'A':'C','secret':_0x374af9['secret'],'read':_0x374af9[_0xc04b('0x63')],'attachment':_0x374af9[_0xc04b('0x60')]};})['value']()};return ejs['renderFile'](path[_0xc04b('0x55')](config['root'],'server',_0xc04b('0x77'),_0xc04b('0x78')),{'interaction':_0x5c2e7d})[_0xc04b('0x1c')](function(_0x5da0dc){var _0x5861f0=path[_0xc04b('0x55')](_0x1e147f,_0xc04b('0x79')+_0x32b9d9['id']+'-'+_0x1246b3+'.pdf');var _0xc15b15={'path':_0x5861f0,'channel':_0xc04b('0x68'),'interactionId':_0x32b9d9['id']};return pdf[_0xc04b('0x7a')](_0x5da0dc,_0xc15b15);})[_0xc04b('0x1c')](function(){return new BPromise(function(_0x5e7ef1,_0x1cb065){zipdir(_0x1e147f,{'saveTo':_0x5a45df},function(_0x11dc25,_0x4deef5){if(_0x11dc25)return _0x1cb065(_0x11dc25);return _0x5e7ef1(_0x4deef5);});})[_0xc04b('0x1c')](function(){return new BPromise(function(_0x19fee0,_0x1d1f6b){rimraf(_0x1e147f,function(_0x1a08e7){if(_0x1a08e7)_0x1d1f6b(_0x1a08e7);return _0x19fee0();});});})[_0xc04b('0x1c')](function(){return _0x3ef6b6[_0xc04b('0x7b')](_0x5a45df,_0x57454e,function(_0x5782d0){if(_0x5782d0){console[_0xc04b('0x7c')](_0xc04b('0x7d'),_0x5782d0);}else{fs[_0xc04b('0x7e')](_0x5a45df);}});});});}else{return _0x3ef6b6[_0xc04b('0x11')](0xc8);}})[_0xc04b('0x3c')](handleError(_0x3ef6b6,null));}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.events.js b/server/api/whatsappInteraction/whatsappInteraction.events.js index d658310..7162206 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 _0xb43b=['Users','map','then','unreadMessages','length','emit','catch','hasOwnProperty','exports','events','../../mysqldb','WhatsappMessage','setMaxListeners','update','remove','getUsers','setDataValue'];(function(_0xaaa123,_0x4c23e3){var _0x44d6d7=function(_0x5c92e4){while(--_0x5c92e4){_0xaaa123['push'](_0xaaa123['shift']());}};_0x44d6d7(++_0x4c23e3);}(_0xb43b,0x1b2));var _0xbb43=function(_0x2bc4d4,_0x36b5ed){_0x2bc4d4=_0x2bc4d4-0x0;var _0xb4655e=_0xb43b[_0x2bc4d4];return _0xb4655e;};'use strict';var EventEmitter=require(_0xbb43('0x0'));var WhatsappInteraction=require(_0xbb43('0x1'))['db']['WhatsappInteraction'];var WhatsappMessage=require(_0xbb43('0x1'))['db'][_0xbb43('0x2')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0xbb43('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xbb43('0x4'),'afterDestroy':_0xbb43('0x5')};function emitEvent(_0x351254){return function(_0x16432a,_0x5dfb22,_0x491fb9){_0x16432a[_0xbb43('0x6')]({'attributes':['id'],'raw':!![]})['then'](function(_0x80fe61){_0x16432a[_0xbb43('0x7')](_0xbb43('0x8'),_0x80fe61[_0xbb43('0x9')](function(_0x364718){return{'id':_0x364718['id']};}));return WhatsappMessage['findAll']({'where':{'WhatsappInteractionId':_0x16432a['id'],'direction':'in','read':![]},'raw':!![]});})[_0xbb43('0xa')](function(_0xf54ac5){_0x16432a['setDataValue'](_0xbb43('0xb'),_0xf54ac5[_0xbb43('0xc')]);WhatsappInteractionEvents[_0xbb43('0xd')](_0x351254+':'+_0x16432a['id'],_0x16432a);WhatsappInteractionEvents[_0xbb43('0xd')](_0x351254,_0x16432a);_0x491fb9(null);})[_0xbb43('0xe')](_0x491fb9(null));};}for(var e in events){if(events[_0xbb43('0xf')](e)){var event=events[e];WhatsappInteraction['hook'](e,emitEvent(event));}}module[_0xbb43('0x10')]=WhatsappInteractionEvents; \ No newline at end of file +var _0xdf79=['setMaxListeners','save','getUsers','then','setDataValue','map','findAll','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','WhatsappInteraction','../../mysqldb','WhatsappMessage'];(function(_0x1e9e56,_0x34a74a){var _0x5d5e2e=function(_0x4bfcc2){while(--_0x4bfcc2){_0x1e9e56['push'](_0x1e9e56['shift']());}};_0x5d5e2e(++_0x34a74a);}(_0xdf79,0xa7));var _0x9df7=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xdf79[_0x20a584];return _0x4b41a8;};'use strict';var EventEmitter=require('events');var WhatsappInteraction=require('../../mysqldb')['db'][_0x9df7('0x0')];var WhatsappMessage=require(_0x9df7('0x1'))['db'][_0x9df7('0x2')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0x9df7('0x3')](0x0);var events={'afterCreate':_0x9df7('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x5c0301){return function(_0x531eed,_0x975891,_0x23c80b){_0x531eed[_0x9df7('0x5')]({'attributes':['id'],'raw':!![]})[_0x9df7('0x6')](function(_0x5cf73b){_0x531eed[_0x9df7('0x7')]('Users',_0x5cf73b[_0x9df7('0x8')](function(_0x57abfe){return{'id':_0x57abfe['id']};}));return WhatsappMessage[_0x9df7('0x9')]({'where':{'WhatsappInteractionId':_0x531eed['id'],'direction':'in','read':![]},'raw':!![]});})[_0x9df7('0x6')](function(_0x340553){_0x531eed['setDataValue'](_0x9df7('0xa'),_0x340553[_0x9df7('0xb')]);WhatsappInteractionEvents[_0x9df7('0xc')](_0x5c0301+':'+_0x531eed['id'],_0x531eed);WhatsappInteractionEvents['emit'](_0x5c0301,_0x531eed);_0x23c80b(null);})[_0x9df7('0xd')](_0x23c80b(null));};}for(var e in events){if(events[_0x9df7('0xe')](e)){var event=events[e];WhatsappInteraction[_0x9df7('0xf')](e,emitEvent(event));}}module[_0x9df7('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 9aaadbb..e3e1114 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 _0x777f=['closedAt','format','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./whatsappInteraction.attributes','exports','WhatsappInteraction','whatsapp_interactions','changed','closed'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x777f,0x1a2));var _0xf777=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x777f[_0x3bf83f];return _0x22c4a9;};'use strict';var _=require('lodash');var util=require(_0xf777('0x0'));var logger=require('../../config/logger')(_0xf777('0x1'));var moment=require(_0xf777('0x2'));var BPromise=require(_0xf777('0x3'));var rp=require(_0xf777('0x4'));var fs=require('fs');var path=require(_0xf777('0x5'));var rimraf=require(_0xf777('0x6'));var config=require(_0xf777('0x7'));var attributes=require(_0xf777('0x8'));module[_0xf777('0x9')]=function(_0x1cbe59,_0x44308b){return _0x1cbe59['define'](_0xf777('0xa'),attributes,{'tableName':_0xf777('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x17740e,_0x1c2a4c,_0x4a1d0b){if(_0x17740e[_0xf777('0xc')](_0xf777('0xd'))){_0x17740e[_0xf777('0xe')]=moment()[_0xf777('0xf')]('YYYY-MM-DD\x20HH:mm:ss');}_0x4a1d0b(null,_0x17740e);}}});}; \ No newline at end of file +var _0x76c1=['api','moment','bluebird','rimraf','../../config/environment','./whatsappInteraction.attributes','define','whatsapp_interactions','closed','closedAt','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger'];(function(_0x3fe393,_0x234a3a){var _0x534d14=function(_0x277fab){while(--_0x277fab){_0x3fe393['push'](_0x3fe393['shift']());}};_0x534d14(++_0x234a3a);}(_0x76c1,0x15b));var _0x176c=function(_0x16b9ed,_0x56517a){_0x16b9ed=_0x16b9ed-0x0;var _0x66b1f8=_0x76c1[_0x16b9ed];return _0x66b1f8;};'use strict';var _=require(_0x176c('0x0'));var util=require(_0x176c('0x1'));var logger=require(_0x176c('0x2'))(_0x176c('0x3'));var moment=require(_0x176c('0x4'));var BPromise=require(_0x176c('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x176c('0x6'));var config=require(_0x176c('0x7'));var attributes=require(_0x176c('0x8'));module['exports']=function(_0x5a1e37,_0xc28671){return _0x5a1e37[_0x176c('0x9')]('WhatsappInteraction',attributes,{'tableName':_0x176c('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x3fc769,_0x40c110,_0x5d58ba){if(_0x3fc769['changed'](_0x176c('0xb'))){_0x3fc769[_0x176c('0xc')]=moment()['format'](_0x176c('0xd'));}_0x5d58ba(null,_0x3fc769);}}});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.rpc.js b/server/api/whatsappInteraction/whatsappInteraction.rpc.js index 41bade8..2b1df47 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 _0xa6fd=['info','AddTagsToWhatsappInteraction','find','addTags','ids','omit','spread','AddTags','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./whatsappInteraction.socket','register','request','then','request\x20sent','debug','WhatsappInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','WhatsappInteraction,\x20%s,\x20%s','result','catch','UpdateWhatsappInteraction','WhatsappInteraction','update','body','options','where','attributes','limit'];(function(_0x572dc2,_0x5ec7f6){var _0x3afc06=function(_0x2e72d9){while(--_0x2e72d9){_0x572dc2['push'](_0x572dc2['shift']());}};_0x3afc06(++_0x5ec7f6);}(_0xa6fd,0x11c));var _0xda6f=function(_0x146484,_0x27a7f0){_0x146484=_0x146484-0x0;var _0x4c7aa3=_0xa6fd[_0x146484];return _0x4c7aa3;};'use strict';var _=require(_0xda6f('0x0'));var util=require('util');var moment=require(_0xda6f('0x1'));var BPromise=require(_0xda6f('0x2'));var rs=require(_0xda6f('0x3'));var fs=require('fs');var Redis=require(_0xda6f('0x4'));var db=require(_0xda6f('0x5'))['db'];var utils=require(_0xda6f('0x6'));var logger=require(_0xda6f('0x7'))(_0xda6f('0x8'));var config=require(_0xda6f('0x9'));var jayson=require(_0xda6f('0xa'));var client=jayson[_0xda6f('0xb')][_0xda6f('0xc')]({'port':0x232a});config[_0xda6f('0xd')]=_[_0xda6f('0xe')](config[_0xda6f('0xd')],{'host':_0xda6f('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xda6f('0xd')]));require(_0xda6f('0x10'))[_0xda6f('0x11')](socket);function respondWithRpcPromise(_0x5775df,_0x23da33,_0xe75243){return new BPromise(function(_0x359733,_0x9e8876){return client[_0xda6f('0x12')](_0x5775df,_0xe75243)[_0xda6f('0x13')](function(_0x144f2a){logger['info']('WhatsappInteraction,\x20%s,\x20%s',_0x23da33,_0xda6f('0x14'));logger[_0xda6f('0x15')](_0xda6f('0x16'),_0x23da33,'request\x20sent',JSON[_0xda6f('0x17')](_0x144f2a));if(_0x144f2a['error']){if(_0x144f2a[_0xda6f('0x18')][_0xda6f('0x19')]===0x1f4){logger[_0xda6f('0x18')]('WhatsappInteraction,\x20%s,\x20%s',_0x23da33,_0x144f2a[_0xda6f('0x18')]['message']);return _0x9e8876(_0x144f2a[_0xda6f('0x18')][_0xda6f('0x1a')]);}logger[_0xda6f('0x18')](_0xda6f('0x1b'),_0x23da33,_0x144f2a[_0xda6f('0x18')]['message']);return _0x359733(_0x144f2a['error'][_0xda6f('0x1a')]);}else{logger['info']('WhatsappInteraction,\x20%s,\x20%s',_0x23da33,_0xda6f('0x14'));_0x359733(_0x144f2a[_0xda6f('0x1c')][_0xda6f('0x1a')]);}})[_0xda6f('0x1d')](function(_0x48e27b){logger[_0xda6f('0x18')](_0xda6f('0x1b'),_0x23da33,_0x48e27b);_0x9e8876(_0x48e27b);});});}exports[_0xda6f('0x1e')]=function(_0x1e56e7){var _0x3a2b13=this;return new Promise(function(_0x2b2fb6,_0x1de420){return db[_0xda6f('0x1f')][_0xda6f('0x20')](_0x1e56e7[_0xda6f('0x21')],{'raw':_0x1e56e7[_0xda6f('0x22')]?_0x1e56e7[_0xda6f('0x22')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1e56e7['options']?_0x1e56e7[_0xda6f('0x22')][_0xda6f('0x23')]||null:null,'attributes':_0x1e56e7['options']?_0x1e56e7[_0xda6f('0x22')][_0xda6f('0x24')]||null:null,'limit':_0x1e56e7[_0xda6f('0x22')]?_0x1e56e7['options'][_0xda6f('0x25')]||null:null})[_0xda6f('0x13')](function(_0x42abcd){logger[_0xda6f('0x26')](_0xda6f('0x1e'),_0x1e56e7);logger[_0xda6f('0x15')](_0xda6f('0x1e'),_0x1e56e7,JSON[_0xda6f('0x17')](_0x42abcd));_0x2b2fb6(_0x42abcd);})[_0xda6f('0x1d')](function(_0x1c7795){logger[_0xda6f('0x18')](_0xda6f('0x1e'),_0x1c7795[_0xda6f('0x1a')],_0x1e56e7);_0x1de420(_0x3a2b13[_0xda6f('0x18')](0x1f4,_0x1c7795[_0xda6f('0x1a')]));});});};exports[_0xda6f('0x27')]=function(_0x1665ea){return new Promise(function(_0x1d1ca5,_0x349bd5){return db[_0xda6f('0x1f')][_0xda6f('0x28')]({'where':_0x1665ea['options']?_0x1665ea['options'][_0xda6f('0x23')]||null:null})['then'](function(_0x8651e0){if(_0x8651e0){return _0x8651e0[_0xda6f('0x29')](_0x1665ea['body'][_0xda6f('0x2a')],_[_0xda6f('0x2b')](_0x1665ea['body'],[_0xda6f('0x2a'),'id'])||{});}})[_0xda6f('0x2c')](function(_0x414ada){logger[_0xda6f('0x26')]('AddTags',_0x1665ea);logger[_0xda6f('0x15')](_0xda6f('0x2d'),_0x1665ea,JSON[_0xda6f('0x17')](_0x414ada));_0x1d1ca5(_0x414ada);})['catch'](function(_0x222ee4){logger['error'](_0xda6f('0x2d'),_0x222ee4[_0xda6f('0x1a')],_0x1665ea);_0x349bd5(_this[_0xda6f('0x18')](0x1f4,_0x222ee4['message']));});});}; \ No newline at end of file +var _0x2827=['debug','WhatsappInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','UpdateWhatsappInteraction','WhatsappInteraction','update','body','options','where','attributes','AddTagsToWhatsappInteraction','find','addTags','ids','omit','spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','./whatsappInteraction.socket','register','request','then','WhatsappInteraction,\x20%s,\x20%s','request\x20sent'];(function(_0x35de68,_0x165ef8){var _0xf70815=function(_0x731b8e){while(--_0x731b8e){_0x35de68['push'](_0x35de68['shift']());}};_0xf70815(++_0x165ef8);}(_0x2827,0x1d9));var _0x7282=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2827[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x7282('0x0'));var util=require(_0x7282('0x1'));var moment=require(_0x7282('0x2'));var BPromise=require(_0x7282('0x3'));var rs=require(_0x7282('0x4'));var fs=require('fs');var Redis=require(_0x7282('0x5'));var db=require(_0x7282('0x6'))['db'];var utils=require(_0x7282('0x7'));var logger=require(_0x7282('0x8'))(_0x7282('0x9'));var config=require(_0x7282('0xa'));var jayson=require(_0x7282('0xb'));var client=jayson[_0x7282('0xc')][_0x7282('0xd')]({'port':0x232a});config[_0x7282('0xe')]=_['defaults'](config[_0x7282('0xe')],{'host':_0x7282('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7282('0xe')]));require(_0x7282('0x10'))[_0x7282('0x11')](socket);function respondWithRpcPromise(_0x49f505,_0x24af9a,_0x2e365a){return new BPromise(function(_0x301345,_0x531108){return client[_0x7282('0x12')](_0x49f505,_0x2e365a)[_0x7282('0x13')](function(_0x51e91b){logger['info'](_0x7282('0x14'),_0x24af9a,_0x7282('0x15'));logger[_0x7282('0x16')](_0x7282('0x17'),_0x24af9a,'request\x20sent',JSON[_0x7282('0x18')](_0x51e91b));if(_0x51e91b['error']){if(_0x51e91b[_0x7282('0x19')][_0x7282('0x1a')]===0x1f4){logger[_0x7282('0x19')](_0x7282('0x14'),_0x24af9a,_0x51e91b[_0x7282('0x19')][_0x7282('0x1b')]);return _0x531108(_0x51e91b[_0x7282('0x19')]['message']);}logger['error'](_0x7282('0x14'),_0x24af9a,_0x51e91b['error'][_0x7282('0x1b')]);return _0x301345(_0x51e91b['error'][_0x7282('0x1b')]);}else{logger[_0x7282('0x1c')](_0x7282('0x14'),_0x24af9a,_0x7282('0x15'));_0x301345(_0x51e91b[_0x7282('0x1d')][_0x7282('0x1b')]);}})[_0x7282('0x1e')](function(_0x2814c7){logger[_0x7282('0x19')](_0x7282('0x14'),_0x24af9a,_0x2814c7);_0x531108(_0x2814c7);});});}exports[_0x7282('0x1f')]=function(_0xba0a42){var _0x488abb=this;return new Promise(function(_0x497d02,_0x390154){return db[_0x7282('0x20')][_0x7282('0x21')](_0xba0a42[_0x7282('0x22')],{'raw':_0xba0a42['options']?_0xba0a42[_0x7282('0x23')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xba0a42[_0x7282('0x23')]?_0xba0a42[_0x7282('0x23')][_0x7282('0x24')]||null:null,'attributes':_0xba0a42['options']?_0xba0a42[_0x7282('0x23')][_0x7282('0x25')]||null:null,'limit':_0xba0a42[_0x7282('0x23')]?_0xba0a42[_0x7282('0x23')]['limit']||null:null})[_0x7282('0x13')](function(_0x2bb476){logger['info'](_0x7282('0x1f'),_0xba0a42);logger[_0x7282('0x16')]('UpdateWhatsappInteraction',_0xba0a42,JSON[_0x7282('0x18')](_0x2bb476));_0x497d02(_0x2bb476);})[_0x7282('0x1e')](function(_0xfaf7f5){logger[_0x7282('0x19')]('UpdateWhatsappInteraction',_0xfaf7f5[_0x7282('0x1b')],_0xba0a42);_0x390154(_0x488abb[_0x7282('0x19')](0x1f4,_0xfaf7f5[_0x7282('0x1b')]));});});};exports[_0x7282('0x26')]=function(_0x5304a9){return new Promise(function(_0x17e8c5,_0x5c85ce){return db['WhatsappInteraction'][_0x7282('0x27')]({'where':_0x5304a9[_0x7282('0x23')]?_0x5304a9[_0x7282('0x23')][_0x7282('0x24')]||null:null})[_0x7282('0x13')](function(_0x5b85c3){if(_0x5b85c3){return _0x5b85c3[_0x7282('0x28')](_0x5304a9[_0x7282('0x22')][_0x7282('0x29')],_[_0x7282('0x2a')](_0x5304a9[_0x7282('0x22')],['ids','id'])||{});}})[_0x7282('0x2b')](function(_0xd0252b){logger[_0x7282('0x1c')](_0x7282('0x2c'),_0x5304a9);logger[_0x7282('0x16')]('AddTags',_0x5304a9,JSON[_0x7282('0x18')](_0xd0252b));_0x17e8c5(_0xd0252b);})[_0x7282('0x1e')](function(_0x434091){logger[_0x7282('0x19')]('AddTags',_0x434091[_0x7282('0x1b')],_0x5304a9);_0x5c85ce(_this[_0x7282('0x19')](0x1f4,_0x434091[_0x7282('0x1b')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.socket.js b/server/api/whatsappInteraction/whatsappInteraction.socket.js index 3ec2877..f877c0c 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 _0x74a4=['remove','update','emit','removeListener','register','length','whatsappInteraction:','./whatsappInteraction.events','save'];(function(_0x149ad5,_0x12b417){var _0x2566b7=function(_0x157f10){while(--_0x157f10){_0x149ad5['push'](_0x149ad5['shift']());}};_0x2566b7(++_0x12b417);}(_0x74a4,0xd6));var _0x474a=function(_0x32e86e,_0x37fc1e){_0x32e86e=_0x32e86e-0x0;var _0x3f4d4b=_0x74a4[_0x32e86e];return _0x3f4d4b;};'use strict';var WhatsappInteractionEvents=require(_0x474a('0x0'));var events=[_0x474a('0x1'),_0x474a('0x2'),_0x474a('0x3')];function createListener(_0xdbe85a,_0x115dea){return function(_0x23ea2c){_0x115dea[_0x474a('0x4')](_0xdbe85a,_0x23ea2c);};}function removeListener(_0x394981,_0x5e4ecc){return function(){WhatsappInteractionEvents[_0x474a('0x5')](_0x394981,_0x5e4ecc);};}exports[_0x474a('0x6')]=function(_0x2aca3b){for(var _0x26c5b6=0x0,_0x305a58=events[_0x474a('0x7')];_0x26c5b6<_0x305a58;_0x26c5b6++){var _0x383d6d=events[_0x26c5b6];var _0x4c49ef=createListener(_0x474a('0x8')+_0x383d6d,_0x2aca3b);WhatsappInteractionEvents['on'](_0x383d6d,_0x4c49ef);}}; \ No newline at end of file +var _0xa70d=['remove','update','emit','removeListener','register','whatsappInteraction:','./whatsappInteraction.events'];(function(_0x52392b,_0x2cf6ca){var _0x2bf64f=function(_0x1ba177){while(--_0x1ba177){_0x52392b['push'](_0x52392b['shift']());}};_0x2bf64f(++_0x2cf6ca);}(_0xa70d,0x156));var _0xda70=function(_0x566b3e,_0xa50838){_0x566b3e=_0x566b3e-0x0;var _0x26abc2=_0xa70d[_0x566b3e];return _0x26abc2;};'use strict';var WhatsappInteractionEvents=require(_0xda70('0x0'));var events=['save',_0xda70('0x1'),_0xda70('0x2')];function createListener(_0x3d1df7,_0x2a2d0e){return function(_0x2fb86f){_0x2a2d0e[_0xda70('0x3')](_0x3d1df7,_0x2fb86f);};}function removeListener(_0x398f72,_0x2b7207){return function(){WhatsappInteractionEvents[_0xda70('0x4')](_0x398f72,_0x2b7207);};}exports[_0xda70('0x5')]=function(_0x345817){for(var _0x55e435=0x0,_0x41d3fc=events['length'];_0x55e435<_0x41d3fc;_0x55e435++){var _0x401aab=events[_0x55e435];var _0xd71663=createListener(_0xda70('0x6')+_0x401aab,_0x345817);WhatsappInteractionEvents['on'](_0x401aab,_0xd71663);}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/index.js b/server/api/whatsappMessage/index.js index 0be3209..e44db88 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 _0xbd0f=['../../config/environment','./whatsappMessage.controller','isAuthenticated','index','get','/describe','/:id','post','tracked','whatsapp','whatsappmessage:create','create','/:id/status','status','/:id/accept','accept','/:id/reject','reject','delete','destroy','exports','multer','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x23b946,_0x2653e1){var _0xcfad4f=function(_0x5200d1){while(--_0x5200d1){_0x23b946['push'](_0x23b946['shift']());}};_0xcfad4f(++_0x2653e1);}(_0xbd0f,0x174));var _0xfbd0=function(_0x4f4a9f,_0x41a618){_0x4f4a9f=_0x4f4a9f-0x0;var _0x170138=_0xbd0f[_0x4f4a9f];return _0x170138;};'use strict';var multer=require(_0xfbd0('0x0'));var util=require('util');var path=require(_0xfbd0('0x1'));var timeout=require('connect-timeout');var express=require(_0xfbd0('0x2'));var router=express[_0xfbd0('0x3')]();var fs_extra=require(_0xfbd0('0x4'));var auth=require(_0xfbd0('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xfbd0('0x6'));var controller=require(_0xfbd0('0x7'));router['get']('/',auth[_0xfbd0('0x8')](),controller[_0xfbd0('0x9')]);router[_0xfbd0('0xa')](_0xfbd0('0xb'),auth[_0xfbd0('0x8')](),controller['describe']);router['get'](_0xfbd0('0xc'),auth['isAuthenticated'](),controller['show']);router[_0xfbd0('0xd')]('/',auth[_0xfbd0('0x8')](),interaction[_0xfbd0('0xe')](_0xfbd0('0xf'),_0xfbd0('0x10')),controller[_0xfbd0('0x11')]);router[_0xfbd0('0xd')](_0xfbd0('0x12'),controller[_0xfbd0('0x13')]);router['put'](_0xfbd0('0xc'),auth[_0xfbd0('0x8')](),controller['update']);router['put'](_0xfbd0('0x14'),auth[_0xfbd0('0x8')](),controller[_0xfbd0('0x15')]);router['put'](_0xfbd0('0x16'),auth[_0xfbd0('0x8')](),controller[_0xfbd0('0x17')]);router[_0xfbd0('0x18')](_0xfbd0('0xc'),auth['isAuthenticated'](),controller[_0xfbd0('0x19')]);module[_0xfbd0('0x1a')]=router; \ No newline at end of file +var _0x6b10=['index','/describe','describe','/:id','show','post','whatsappmessage:create','put','update','/:id/accept','accept','/:id/reject','reject','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated'];(function(_0x2a529c,_0xe5ee81){var _0x4c093c=function(_0x24a5ca){while(--_0x24a5ca){_0x2a529c['push'](_0x2a529c['shift']());}};_0x4c093c(++_0xe5ee81);}(_0x6b10,0x103));var _0x06b1=function(_0x393d7d,_0x1060d6){_0x393d7d=_0x393d7d-0x0;var _0x57fc72=_0x6b10[_0x393d7d];return _0x57fc72;};'use strict';var multer=require('multer');var util=require(_0x06b1('0x0'));var path=require(_0x06b1('0x1'));var timeout=require(_0x06b1('0x2'));var express=require(_0x06b1('0x3'));var router=express[_0x06b1('0x4')]();var fs_extra=require(_0x06b1('0x5'));var auth=require(_0x06b1('0x6'));var interaction=require(_0x06b1('0x7'));var config=require(_0x06b1('0x8'));var controller=require('./whatsappMessage.controller');router[_0x06b1('0x9')]('/',auth[_0x06b1('0xa')](),controller[_0x06b1('0xb')]);router[_0x06b1('0x9')](_0x06b1('0xc'),auth[_0x06b1('0xa')](),controller[_0x06b1('0xd')]);router[_0x06b1('0x9')](_0x06b1('0xe'),auth[_0x06b1('0xa')](),controller[_0x06b1('0xf')]);router[_0x06b1('0x10')]('/',auth[_0x06b1('0xa')](),interaction['tracked']('whatsapp',_0x06b1('0x11')),controller['create']);router[_0x06b1('0x10')]('/:id/status',controller['status']);router[_0x06b1('0x12')]('/:id',auth['isAuthenticated'](),controller[_0x06b1('0x13')]);router['put'](_0x06b1('0x14'),auth[_0x06b1('0xa')](),controller[_0x06b1('0x15')]);router[_0x06b1('0x12')](_0x06b1('0x16'),auth[_0x06b1('0xa')](),controller[_0x06b1('0x17')]);router[_0x06b1('0x18')](_0x06b1('0xe'),auth['isAuthenticated'](),controller[_0x06b1('0x19')]);module[_0x06b1('0x1a')]=router; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.attributes.js b/server/api/whatsappMessage/whatsappMessage.attributes.js index 924bdf2..b932a59 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 _0x3c9a=['DATE','sequelize','exports','TEXT','medium','BOOLEAN','ENUM','out','STRING'];(function(_0x314ccd,_0xb410af){var _0x27ed35=function(_0x35fd09){while(--_0x35fd09){_0x314ccd['push'](_0x314ccd['shift']());}};_0x27ed35(++_0xb410af);}(_0x3c9a,0x13c));var _0xa3c9=function(_0x443d1b,_0x1d8b39){_0x443d1b=_0x443d1b-0x0;var _0x5a18dd=_0x3c9a[_0x443d1b];return _0x5a18dd;};'use strict';var Sequelize=require(_0xa3c9('0x0'));module[_0xa3c9('0x1')]={'body':{'type':Sequelize[_0xa3c9('0x2')](_0xa3c9('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xa3c9('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0xa3c9('0x5')]('in',_0xa3c9('0x6')),'defaultValue':_0xa3c9('0x6'),'allowNull':![]},'messageId':{'type':Sequelize['STRING'](0xbe)},'phone':{'type':Sequelize[_0xa3c9('0x7')]},'readAt':{'type':Sequelize[_0xa3c9('0x8')]},'secret':{'type':Sequelize[_0xa3c9('0x4')],'defaultValue':![]},'providerName':{'type':Sequelize[_0xa3c9('0x7')]},'providerResponse':{'type':Sequelize[_0xa3c9('0x2')]}}; \ No newline at end of file +var _0x322e=['STRING','sequelize','exports','medium','BOOLEAN','ENUM','out'];(function(_0x1deb03,_0xd05ad8){var _0x189fe7=function(_0x321225){while(--_0x321225){_0x1deb03['push'](_0x1deb03['shift']());}};_0x189fe7(++_0xd05ad8);}(_0x322e,0x189));var _0xe322=function(_0x15de0c,_0x3d9d68){_0x15de0c=_0x15de0c-0x0;var _0x20449e=_0x322e[_0x15de0c];return _0x20449e;};'use strict';var Sequelize=require(_0xe322('0x0'));module[_0xe322('0x1')]={'body':{'type':Sequelize['TEXT'](_0xe322('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xe322('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0xe322('0x4')]('in',_0xe322('0x5')),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize[_0xe322('0x6')](0xbe)},'phone':{'type':Sequelize[_0xe322('0x6')]},'readAt':{'type':Sequelize['DATE']},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'providerName':{'type':Sequelize[_0xe322('0x6')]},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.controller.js b/server/api/whatsappMessage/whatsappMessage.controller.js index f142af4..e5b0a2c 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 _0x0b02=['body','find','describe','whatsapp-interactions','accept','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','get','WhatsappInteractionId','read1stAt','interaction','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','stringify','null','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','User','agent','fullname','email','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','whatsapp','WhatsappInteraction','role','RejectMessage','rejectMessage','internal','rejectmessage','WhatsappAccount','WhatsappAccountId','twilio','MessageSid','messageId','MessageStatus','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','squel','crypto','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','./whatsappMessage.socket','jayson/promise','client','http','request','then','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','error','code','WhatsappMessage,\x20%s,\x20%s','message','info','result','sendStatus','status','end','json','offset','limit','undefined','count','set','apply','reject','save','update','stack','name','send','index','WhatsappMessage','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','filter','VIRTUAL','merge','options','includeAll','include','rows','catch','show','params','rawAttributes'];(function(_0x23534c,_0x11f723){var _0x23ca8d=function(_0x24614e){while(--_0x24614e){_0x23534c['push'](_0x23534c['shift']());}};_0x23ca8d(++_0x11f723);}(_0x0b02,0xbd));var _0x20b0=function(_0xfec329,_0x2aadab){_0xfec329=_0xfec329-0x0;var _0x33a8e4=_0x0b02[_0xfec329];return _0x33a8e4;};'use strict';var emlformat=require(_0x20b0('0x0'));var rimraf=require(_0x20b0('0x1'));var zipdir=require(_0x20b0('0x2'));var jsonpatch=require(_0x20b0('0x3'));var rp=require(_0x20b0('0x4'));var moment=require(_0x20b0('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x20b0('0x6'));var util=require(_0x20b0('0x7'));var path=require(_0x20b0('0x8'));var sox=require(_0x20b0('0x9'));var csv=require('to-csv');var ejs=require(_0x20b0('0xa'));var fs=require('fs');var fs_extra=require(_0x20b0('0xb'));var _=require('lodash');var squel=require(_0x20b0('0xc'));var crypto=require(_0x20b0('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x20b0('0xe'));var querystring=require(_0x20b0('0xf'));var Papa=require(_0x20b0('0x10'));var Redis=require(_0x20b0('0x11'));var authService=require(_0x20b0('0x12'));var qs=require(_0x20b0('0x13'));var as=require(_0x20b0('0x14'));var hardwareService=require(_0x20b0('0x15'));var logger=require(_0x20b0('0x16'))('api');var utils=require(_0x20b0('0x17'));var config=require(_0x20b0('0x18'));var licenseUtil=require(_0x20b0('0x19'));var db=require(_0x20b0('0x1a'))['db'];config[_0x20b0('0x1b')]=_['defaults'](config['redis'],{'host':_0x20b0('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x20b0('0x1d'))['register'](socket);var jayson=require(_0x20b0('0x1e'));var client=jayson[_0x20b0('0x1f')][_0x20b0('0x20')]({'port':0x232c});var client9002=jayson[_0x20b0('0x1f')][_0x20b0('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x5424bb,_0x20396e,_0x231df3,_0x1d1f79){return new BPromise(function(_0x360dee,_0x1428c9){var _0x427ab3=_0x1d1f79||client;return _0x427ab3[_0x20b0('0x21')](_0x5424bb,_0x231df3)[_0x20b0('0x22')](function(_0xef2656){logger['info']('WhatsappMessage,\x20%s,\x20%s',_0x20396e,_0x20b0('0x23'));logger[_0x20b0('0x24')](_0x20b0('0x25'),_0x20396e,_0x20b0('0x23'),JSON['stringify'](_0xef2656));if(_0xef2656[_0x20b0('0x26')]){if(_0xef2656['error'][_0x20b0('0x27')]===0x1f4){logger[_0x20b0('0x26')]('WhatsappMessage,\x20%s,\x20%s',_0x20396e,_0xef2656['error']['message']);return _0x1428c9(_0xef2656['error']['message']);}logger[_0x20b0('0x26')](_0x20b0('0x28'),_0x20396e,_0xef2656['error'][_0x20b0('0x29')]);return _0x360dee(_0xef2656['error'][_0x20b0('0x29')]);}else{logger[_0x20b0('0x2a')]('WhatsappMessage,\x20%s,\x20%s',_0x20396e,_0x20b0('0x23'));_0x360dee(_0xef2656[_0x20b0('0x2b')][_0x20b0('0x29')]);}})['catch'](function(_0x47b1e1){logger['error'](_0x20b0('0x28'),_0x20396e,_0x47b1e1);_0x1428c9(_0x47b1e1);});});}function respondWithStatusCode(_0x31021e,_0x5e4b58){_0x5e4b58=_0x5e4b58||0xcc;return function(_0x3a93ed){if(_0x3a93ed){return _0x31021e[_0x20b0('0x2c')](_0x5e4b58);}return _0x31021e[_0x20b0('0x2d')](_0x5e4b58)[_0x20b0('0x2e')]();};}function respondWithResult(_0x482215,_0x55c58f){_0x55c58f=_0x55c58f||0xc8;return function(_0x1a3867){if(_0x1a3867){return _0x482215[_0x20b0('0x2d')](_0x55c58f)[_0x20b0('0x2f')](_0x1a3867);}};}function respondWithFilteredResult(_0x4829af,_0x16d6ac){return function(_0x5883b3){if(_0x5883b3){var _0x37102d=typeof _0x16d6ac[_0x20b0('0x30')]==='undefined'&&typeof _0x16d6ac[_0x20b0('0x31')]===_0x20b0('0x32');var _0x549a3c=_0x5883b3[_0x20b0('0x33')];var _0xf5b2d8=_0x37102d?0x0:_0x16d6ac[_0x20b0('0x30')];var _0x32d0fb=_0x37102d?_0x5883b3['count']:_0x16d6ac['offset']+_0x16d6ac['limit'];var _0x3f7eac;if(_0x32d0fb>=_0x549a3c){_0x32d0fb=_0x549a3c;_0x3f7eac=0xc8;}else{_0x3f7eac=0xce;}_0x4829af['status'](_0x3f7eac);return _0x4829af[_0x20b0('0x34')]('Content-Range',_0xf5b2d8+'-'+_0x32d0fb+'/'+_0x549a3c)[_0x20b0('0x2f')](_0x5883b3);}return null;};}function patchUpdates(_0x3358f9){return function(_0xdbff42){try{jsonpatch[_0x20b0('0x35')](_0xdbff42,_0x3358f9,!![]);}catch(_0x5e704f){return BPromise[_0x20b0('0x36')](_0x5e704f);}return _0xdbff42[_0x20b0('0x37')]();};}function saveUpdates(_0x4008a9,_0x4521cb){return function(_0x23ce42){if(_0x23ce42){return _0x23ce42[_0x20b0('0x38')](_0x4008a9)[_0x20b0('0x22')](function(_0x5d7547){return _0x5d7547;});}return null;};}function removeEntity(_0x336151,_0x23e4bf){return function(_0x483e70){if(_0x483e70){return _0x483e70['destroy']()[_0x20b0('0x22')](function(){_0x336151[_0x20b0('0x2d')](0xcc)[_0x20b0('0x2e')]();});}};}function handleEntityNotFound(_0x2f4e15,_0x53319e){return function(_0x2b1719){if(!_0x2b1719){_0x2f4e15['sendStatus'](0x194);}return _0x2b1719;};}function handleError(_0x12dfa1,_0x5d5da1){_0x5d5da1=_0x5d5da1||0x1f4;return function(_0x343c30){logger[_0x20b0('0x26')](_0x343c30[_0x20b0('0x39')]);if(_0x343c30[_0x20b0('0x3a')]){delete _0x343c30[_0x20b0('0x3a')];}_0x12dfa1[_0x20b0('0x2d')](_0x5d5da1)[_0x20b0('0x3b')](_0x343c30);};}exports[_0x20b0('0x3c')]=function(_0x475a90,_0x5aad9b){var _0x2cbee6={},_0x32d289={},_0x4e2df0={'count':0x0,'rows':[]};var _0x147ace=_['map'](db[_0x20b0('0x3d')]['rawAttributes'],function(_0x27ee6c){return{'name':_0x27ee6c['fieldName'],'type':_0x27ee6c[_0x20b0('0x3e')][_0x20b0('0x3f')]};});_0x32d289[_0x20b0('0x40')]=_['map'](_0x147ace,_0x20b0('0x3a'));_0x32d289[_0x20b0('0x41')]=_[_0x20b0('0x42')](_0x475a90[_0x20b0('0x41')]);_0x32d289[_0x20b0('0x43')]=_[_0x20b0('0x44')](_0x32d289['model'],_0x32d289['query']);_0x2cbee6['attributes']=_[_0x20b0('0x44')](_0x32d289[_0x20b0('0x40')],qs[_0x20b0('0x45')](_0x475a90['query'][_0x20b0('0x45')]));_0x2cbee6['attributes']=_0x2cbee6[_0x20b0('0x46')][_0x20b0('0x47')]?_0x2cbee6['attributes']:_0x32d289[_0x20b0('0x40')];if(!_0x475a90[_0x20b0('0x41')][_0x20b0('0x48')]('nolimit')){_0x2cbee6['limit']=qs['limit'](_0x475a90['query']['limit']);_0x2cbee6[_0x20b0('0x30')]=qs[_0x20b0('0x30')](_0x475a90[_0x20b0('0x41')][_0x20b0('0x30')]);}_0x2cbee6[_0x20b0('0x49')]=qs['sort'](_0x475a90['query'][_0x20b0('0x4a')]);_0x2cbee6[_0x20b0('0x4b')]=qs[_0x20b0('0x43')](_['pick'](_0x475a90[_0x20b0('0x41')],_0x32d289['filters']),_0x147ace);if(_0x475a90[_0x20b0('0x41')][_0x20b0('0x4c')]){_0x2cbee6['where']=_['merge'](_0x2cbee6[_0x20b0('0x4b')],{'$or':_['map'](_0x147ace,function(_0x5bdd88){if(_0x5bdd88[_0x20b0('0x3e')]!==_0x20b0('0x4d')){var _0x3712b7={};_0x3712b7[_0x5bdd88[_0x20b0('0x3a')]]={'$like':'%'+_0x475a90[_0x20b0('0x41')][_0x20b0('0x4c')]+'%'};return _0x3712b7;}})});}_0x2cbee6=_[_0x20b0('0x4e')]({},_0x2cbee6,_0x475a90[_0x20b0('0x4f')]);var _0x525414={'where':_0x2cbee6[_0x20b0('0x4b')]};return db[_0x20b0('0x3d')][_0x20b0('0x33')](_0x525414)[_0x20b0('0x22')](function(_0x573c68){_0x4e2df0[_0x20b0('0x33')]=_0x573c68;if(_0x475a90[_0x20b0('0x41')][_0x20b0('0x50')]){_0x2cbee6[_0x20b0('0x51')]=[{'all':!![]}];}return db[_0x20b0('0x3d')]['findAll'](_0x2cbee6);})[_0x20b0('0x22')](function(_0x1d35cb){_0x4e2df0[_0x20b0('0x52')]=_0x1d35cb;return _0x4e2df0;})[_0x20b0('0x22')](respondWithFilteredResult(_0x5aad9b,_0x2cbee6))[_0x20b0('0x53')](handleError(_0x5aad9b,null));};exports[_0x20b0('0x54')]=function(_0x495cfd,_0x2c019f){var _0x4c4db9={'raw':!![],'where':{'id':_0x495cfd[_0x20b0('0x55')]['id']}},_0x1b1351={};_0x1b1351[_0x20b0('0x40')]=_['keys'](db['WhatsappMessage'][_0x20b0('0x56')]);_0x1b1351[_0x20b0('0x41')]=_[_0x20b0('0x42')](_0x495cfd[_0x20b0('0x41')]);_0x1b1351['filters']=_[_0x20b0('0x44')](_0x1b1351[_0x20b0('0x40')],_0x1b1351[_0x20b0('0x41')]);_0x4c4db9[_0x20b0('0x46')]=_['intersection'](_0x1b1351[_0x20b0('0x40')],qs[_0x20b0('0x45')](_0x495cfd[_0x20b0('0x41')]['fields']));_0x4c4db9[_0x20b0('0x46')]=_0x4c4db9['attributes'][_0x20b0('0x47')]?_0x4c4db9[_0x20b0('0x46')]:_0x1b1351[_0x20b0('0x40')];if(_0x495cfd[_0x20b0('0x41')]['includeAll']){_0x4c4db9['include']=[{'all':!![]}];}_0x4c4db9=_['merge']({},_0x4c4db9,_0x495cfd[_0x20b0('0x4f')]);return db[_0x20b0('0x3d')]['find'](_0x4c4db9)[_0x20b0('0x22')](handleEntityNotFound(_0x2c019f,null))[_0x20b0('0x22')](respondWithResult(_0x2c019f,null))[_0x20b0('0x53')](handleError(_0x2c019f,null));};exports['create']=function(_0xab70e2,_0x2d4327){return db[_0x20b0('0x3d')]['create'](_0xab70e2[_0x20b0('0x57')],{})[_0x20b0('0x22')](respondWithResult(_0x2d4327,0xc9))[_0x20b0('0x53')](handleError(_0x2d4327,null));};exports[_0x20b0('0x38')]=function(_0x4c1710,_0x1c766f){if(_0x4c1710[_0x20b0('0x57')]['id']){delete _0x4c1710['body']['id'];}return db[_0x20b0('0x3d')]['find']({'where':{'id':_0x4c1710['params']['id']}})[_0x20b0('0x22')](handleEntityNotFound(_0x1c766f,null))[_0x20b0('0x22')](saveUpdates(_0x4c1710[_0x20b0('0x57')],null))[_0x20b0('0x22')](respondWithResult(_0x1c766f,null))[_0x20b0('0x53')](handleError(_0x1c766f,null));};exports['destroy']=function(_0x15403c,_0x34aa87){return db['WhatsappMessage'][_0x20b0('0x58')]({'where':{'id':_0x15403c[_0x20b0('0x55')]['id']}})['then'](handleEntityNotFound(_0x34aa87,null))[_0x20b0('0x22')](removeEntity(_0x34aa87,null))['catch'](handleError(_0x34aa87,null));};exports[_0x20b0('0x59')]=function(_0x590798,_0x492051){return db[_0x20b0('0x3d')][_0x20b0('0x59')]()['then'](respondWithResult(_0x492051,null))[_0x20b0('0x53')](handleError(_0x492051,null));};var interaction_log=require(_0x20b0('0x16'))(_0x20b0('0x5a'));exports[_0x20b0('0x5b')]=function(_0x13b189,_0x4967de,_0x3e0e25){var _0x1da999={'agent':{},'channel':'whatsapp'};if(_0x13b189[_0x20b0('0x57')]['id']){delete _0x13b189[_0x20b0('0x57')]['id'];}_0x13b189[_0x20b0('0x57')][_0x20b0('0x5c')]=!![];_0x13b189[_0x20b0('0x57')][_0x20b0('0x5d')]=moment()[_0x20b0('0x5e')](_0x20b0('0x5f'));_0x13b189[_0x20b0('0x57')][_0x20b0('0x60')]=_0x13b189[_0x20b0('0x57')][_0x20b0('0x60')]||_0x13b189[_0x20b0('0x61')]['id'];_0x1da999['agent']['id']=_0x13b189['body'][_0x20b0('0x60')];return db[_0x20b0('0x3d')][_0x20b0('0x58')]({'where':{'id':_0x13b189[_0x20b0('0x55')]['id'],'UserId':null}})[_0x20b0('0x22')](handleEntityNotFound(_0x4967de,null))['then'](saveUpdates(_0x13b189[_0x20b0('0x57')],null))['then'](function(_0x3a9926){if(_0x3a9926){_0x1da999[_0x20b0('0x29')]=_0x3a9926[_0x20b0('0x62')]({'plain':!![]});return db['WhatsappInteraction']['find']({'where':{'id':_0x3a9926[_0x20b0('0x63')]}});}return null;})['then'](handleEntityNotFound(_0x4967de,null))[_0x20b0('0x22')](function(_0x48a763){if(_0x48a763){return _0x48a763[_0x20b0('0x38')]({'UserId':_0x13b189[_0x20b0('0x57')][_0x20b0('0x60')],'read1stAt':_['isNil'](_0x48a763[_0x20b0('0x64')])?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x20b0('0x22')](function(_0x6127eb){if(_0x6127eb){_0x1da999[_0x20b0('0x65')]=_0x6127eb[_0x20b0('0x62')]({'plain':!![]});interaction_log[_0x20b0('0x2a')](_0x20b0('0x66'),_0x13b189[_0x20b0('0x61')]['id'],_0x13b189[_0x20b0('0x61')][_0x20b0('0x3a')],_0x13b189[_0x20b0('0x61')]['role'],_0x1da999[_0x20b0('0x65')]['id'],_0x13b189[_0x20b0('0x57')]?JSON[_0x20b0('0x67')](_0x13b189[_0x20b0('0x57')]):_0x20b0('0x68'));return respondWithRpcPromise('AcceptMessage',_0x20b0('0x69'),_0x1da999);}return null;})[_0x20b0('0x22')](function(_0x2d3a77){var _0x416995=_0x20b0('0x6a')+_0x2d3a77[_0x20b0('0x29')][_0x20b0('0x6b')];return db[_0x20b0('0x6c')][_0x20b0('0x41')](_0x416995,{'type':db[_0x20b0('0x6d')][_0x20b0('0x6e')][_0x20b0('0x6f')],'raw':!![]})['then'](function(_0x536dba){return _0x536dba;});})[_0x20b0('0x22')](function(_0x3e7fd9){if(_0x3e7fd9){_0x1da999['message'][_0x20b0('0x70')]=_0x3e7fd9[0x0];if(!_0x13b189[_0x20b0('0x57')][_0x20b0('0x60')])return;return db[_0x20b0('0x71')][_0x20b0('0x58')]({'where':{'id':_0x13b189[_0x20b0('0x57')][_0x20b0('0x60')],'role':_0x20b0('0x72')},'attributes':['id',_0x20b0('0x3a'),_0x20b0('0x73'),_0x20b0('0x74'),'internal'],'raw':!![]});}return null;})[_0x20b0('0x22')](function(_0x3f4ccf){if(!_0x3f4ccf)return null;_0x1da999[_0x20b0('0x29')][_0x20b0('0x72')]=_0x3f4ccf;return _0x1da999;})[_0x20b0('0x22')](function(_0x5e5b0e){if(_0x5e5b0e){if(_0x13b189['body'][_0x20b0('0x75')]){_0x1da999[_0x20b0('0x29')][_0x20b0('0x76')]=util[_0x20b0('0x5e')](_0x20b0('0x77'),_0x13b189[_0x20b0('0x61')][_0x20b0('0x3a')]);_0x1da999[_0x20b0('0x29')][_0x20b0('0x78')]=_0x1da999[_0x20b0('0x78')];_0x1da999['message'][_0x20b0('0x79')]=_0x1da999[_0x20b0('0x78')];_0x1da999[_0x20b0('0x29')][_0x20b0('0x7a')]='accept';return respondWithRpcPromise(_0x20b0('0x7b'),'EventManager',{'event':_0x20b0('0x7c'),'message':_0x1da999[_0x20b0('0x29')]},client9002)[_0x20b0('0x22')](function(){return _0x1da999;});}return _0x1da999;}return null;})[_0x20b0('0x22')](respondWithResult(_0x4967de,null))[_0x20b0('0x53')](handleError(_0x4967de,null));};var interaction_log=require(_0x20b0('0x16'))('whatsapp-interactions');exports['reject']=function(_0x5232c6,_0x31f56d,_0x323d95){var _0x22281a={'agent':{},'channel':_0x20b0('0x7d')};if(_0x5232c6[_0x20b0('0x57')]['id']){delete _0x5232c6['body']['id'];}_0x5232c6['body'][_0x20b0('0x60')]=_0x5232c6['body'][_0x20b0('0x60')]||_0x5232c6[_0x20b0('0x61')]['id'];_0x22281a[_0x20b0('0x72')]['id']=_0x5232c6[_0x20b0('0x57')][_0x20b0('0x60')];return db[_0x20b0('0x3d')][_0x20b0('0x58')]({'where':{'id':_0x5232c6['params']['id'],'UserId':null}})[_0x20b0('0x22')](handleEntityNotFound(_0x31f56d,null))[_0x20b0('0x22')](function(_0x47434b){if(_0x47434b){_0x22281a[_0x20b0('0x29')]=_0x47434b[_0x20b0('0x62')]({'plain':!![]});return db[_0x20b0('0x7e')][_0x20b0('0x58')]({'where':{'id':_0x47434b[_0x20b0('0x63')]}});}return null;})[_0x20b0('0x22')](handleEntityNotFound(_0x31f56d,null))[_0x20b0('0x22')](function(_0x35483b){if(_0x35483b){_0x22281a[_0x20b0('0x65')]=_0x35483b[_0x20b0('0x62')]({'plain':!![]});interaction_log[_0x20b0('0x2a')]('[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x5232c6[_0x20b0('0x61')]['id'],_0x5232c6[_0x20b0('0x61')][_0x20b0('0x3a')],_0x5232c6[_0x20b0('0x61')][_0x20b0('0x7f')],_0x22281a[_0x20b0('0x65')]['id'],_0x5232c6[_0x20b0('0x57')]?JSON[_0x20b0('0x67')](_0x5232c6[_0x20b0('0x57')]):_0x20b0('0x68'));return respondWithRpcPromise(_0x20b0('0x80'),_0x20b0('0x81'),_0x22281a);}return null;})[_0x20b0('0x22')](function(_0x16e055){var _0x31a55f=_0x20b0('0x6a')+_0x16e055[_0x20b0('0x29')][_0x20b0('0x6b')];return db[_0x20b0('0x6c')]['query'](_0x31a55f,{'type':db[_0x20b0('0x6d')][_0x20b0('0x6e')][_0x20b0('0x6f')],'raw':!![]})[_0x20b0('0x22')](function(_0x23aadb){return _0x23aadb;});})[_0x20b0('0x22')](function(_0x2167df){if(_0x2167df){_0x22281a[_0x20b0('0x29')][_0x20b0('0x70')]=_0x2167df[0x0];if(!_0x5232c6[_0x20b0('0x57')][_0x20b0('0x60')])return;return db[_0x20b0('0x71')][_0x20b0('0x58')]({'where':{'id':_0x5232c6[_0x20b0('0x57')][_0x20b0('0x60')],'role':_0x20b0('0x72')},'attributes':['id',_0x20b0('0x3a'),_0x20b0('0x73'),_0x20b0('0x74'),_0x20b0('0x82')],'raw':!![]});}return null;})['then'](function(_0x57949c){if(!_0x57949c)return null;_0x22281a[_0x20b0('0x29')][_0x20b0('0x72')]=_0x57949c;return _0x22281a;})[_0x20b0('0x22')](function(_0x2cda6c){if(_0x2cda6c){_0x2cda6c[_0x20b0('0x29')]['interface']=util[_0x20b0('0x5e')](_0x20b0('0x77'),_0x5232c6['user']['name']);_0x2cda6c[_0x20b0('0x29')][_0x20b0('0x78')]=_0x22281a[_0x20b0('0x78')];_0x2cda6c[_0x20b0('0x29')][_0x20b0('0x79')]=_0x22281a[_0x20b0('0x78')];_0x2cda6c['message']['event']=_0x20b0('0x36');respondWithRpcPromise(_0x20b0('0x7b'),_0x20b0('0x7b'),{'event':_0x20b0('0x83'),'message':_0x2cda6c[_0x20b0('0x29')]},client9002);return _0x22281a;}return null;})[_0x20b0('0x22')](respondWithResult(_0x31f56d,null))['catch'](handleError(_0x31f56d,null));};exports[_0x20b0('0x2d')]=function(_0x134bb7,_0x1bd27f,_0xe393f0){if(_0x134bb7['body']['id']){delete _0x134bb7[_0x20b0('0x57')]['id'];}var _0x1e6e00;return db[_0x20b0('0x3d')][_0x20b0('0x58')]({'where':{'id':_0x134bb7[_0x20b0('0x55')]['id']}})[_0x20b0('0x22')](handleEntityNotFound(_0x1bd27f,null))['then'](function(_0x34cfa3){if(_0x34cfa3){_0x1e6e00=_0x34cfa3;return db[_0x20b0('0x84')][_0x20b0('0x58')]({'where':{'id':_0x34cfa3[_0x20b0('0x85')]}});}})[_0x20b0('0x22')](handleEntityNotFound(_0x1bd27f,null))['then'](function(_0xaf1054){if(_0xaf1054){logger[_0x20b0('0x24')]('WhatsppMessage,\x20%s,\x20%s,\x20%s',_0x20b0('0x2d'),'received\x20delivery\x20report\x20from',_0xaf1054['type'],util['inspect'](_0x134bb7['body'],{'showHidden':![],'depth':null}));switch(_0xaf1054[_0x20b0('0x3e')]){case _0x20b0('0x86'):if(_0x134bb7[_0x20b0('0x57')][_0x20b0('0x87')]&&_0x134bb7[_0x20b0('0x57')][_0x20b0('0x87')]===_0x1e6e00[_0x20b0('0x88')]&&_0x134bb7['body'][_0x20b0('0x89')]&&_0x134bb7[_0x20b0('0x57')]['MessageStatus']==='read'){return _0x1e6e00['update']({'read':!![]});}else{logger[_0x20b0('0x26')]('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x20b0('0x2d'),_0x20b0('0x86'),util['inspect'](_0x134bb7['body'],{'showHidden':![],'depth':null}));}break;}return _0x1e6e00;}})[_0x20b0('0x22')](respondWithResult(_0x1bd27f,null))[_0x20b0('0x53')](handleError(_0x1bd27f,null));}; \ No newline at end of file +var _0xbeab=['format','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','get','WhatsappInteractionId','read1stAt','interaction','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','null','AcceptMessage','acceptMessage','sequelize','SELECT','contact','User','fullname','internal','manual','interface','SIP/%s','channel','motionChannel','event','accept','EventManager','acceptmessage','whatsapp','WhatsappInteraction','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize','QueryTypes','email','WhatsppMessage,\x20%s,\x20%s,\x20%s','received\x20delivery\x20report\x20from','inspect','twilio','MessageSid','MessageStatus','WhatsappAccount,\x20%s,\x20%s,\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','redis','defaults','./whatsappMessage.socket','register','jayson/promise','client','http','request','then','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','WhatsappMessage,\x20%s,\x20%s','message','info','request\x20sent','catch','sendStatus','end','offset','limit','count','set','json','apply','reject','save','update','destroy','status','name','index','rawAttributes','fieldName','type','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','WhatsappMessage','includeAll','include','rows','params','find','create','body','describe','whatsapp-interactions','read','readAt'];(function(_0x3a27e5,_0x2b4924){var _0x4ee054=function(_0x10e530){while(--_0x10e530){_0x3a27e5['push'](_0x3a27e5['shift']());}};_0x4ee054(++_0x2b4924);}(_0xbeab,0x13c));var _0xbbea=function(_0x495330,_0x4a7a55){_0x495330=_0x495330-0x0;var _0x533cca=_0xbeab[_0x495330];return _0x533cca;};'use strict';var emlformat=require(_0xbbea('0x0'));var rimraf=require(_0xbbea('0x1'));var zipdir=require(_0xbbea('0x2'));var jsonpatch=require(_0xbbea('0x3'));var rp=require(_0xbbea('0x4'));var moment=require(_0xbbea('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xbbea('0x6'));var util=require(_0xbbea('0x7'));var path=require(_0xbbea('0x8'));var sox=require(_0xbbea('0x9'));var csv=require(_0xbbea('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xbbea('0xb'));var crypto=require(_0xbbea('0xc'));var jsforce=require(_0xbbea('0xd'));var deskjs=require(_0xbbea('0xe'));var toCsv=require(_0xbbea('0xa'));var querystring=require('querystring');var Papa=require(_0xbbea('0xf'));var Redis=require(_0xbbea('0x10'));var authService=require(_0xbbea('0x11'));var qs=require(_0xbbea('0x12'));var as=require(_0xbbea('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xbbea('0x14'));var utils=require('../../config/utils');var config=require(_0xbbea('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0xbbea('0x16')]=_[_0xbbea('0x17')](config[_0xbbea('0x16')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xbbea('0x16')]));require(_0xbbea('0x18'))[_0xbbea('0x19')](socket);var jayson=require(_0xbbea('0x1a'));var client=jayson[_0xbbea('0x1b')]['http']({'port':0x232c});var client9002=jayson[_0xbbea('0x1b')][_0xbbea('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x25c956,_0x499e19,_0x28a5dd,_0x6f5d7e){return new BPromise(function(_0x5d5f62,_0x5583f5){var _0x5667e1=_0x6f5d7e||client;return _0x5667e1[_0xbbea('0x1d')](_0x25c956,_0x28a5dd)[_0xbbea('0x1e')](function(_0x585fc5){logger['info']('WhatsappMessage,\x20%s,\x20%s',_0x499e19,'request\x20sent');logger['debug'](_0xbbea('0x1f'),_0x499e19,'request\x20sent',JSON[_0xbbea('0x20')](_0x585fc5));if(_0x585fc5[_0xbbea('0x21')]){if(_0x585fc5['error'][_0xbbea('0x22')]===0x1f4){logger[_0xbbea('0x21')](_0xbbea('0x23'),_0x499e19,_0x585fc5[_0xbbea('0x21')][_0xbbea('0x24')]);return _0x5583f5(_0x585fc5[_0xbbea('0x21')]['message']);}logger[_0xbbea('0x21')](_0xbbea('0x23'),_0x499e19,_0x585fc5['error'][_0xbbea('0x24')]);return _0x5d5f62(_0x585fc5[_0xbbea('0x21')]['message']);}else{logger[_0xbbea('0x25')](_0xbbea('0x23'),_0x499e19,_0xbbea('0x26'));_0x5d5f62(_0x585fc5['result'][_0xbbea('0x24')]);}})[_0xbbea('0x27')](function(_0xde5861){logger[_0xbbea('0x21')](_0xbbea('0x23'),_0x499e19,_0xde5861);_0x5583f5(_0xde5861);});});}function respondWithStatusCode(_0x2e65bf,_0x40933a){_0x40933a=_0x40933a||0xcc;return function(_0x114a24){if(_0x114a24){return _0x2e65bf[_0xbbea('0x28')](_0x40933a);}return _0x2e65bf['status'](_0x40933a)[_0xbbea('0x29')]();};}function respondWithResult(_0x4406f0,_0x57ada1){_0x57ada1=_0x57ada1||0xc8;return function(_0x345ef5){if(_0x345ef5){return _0x4406f0['status'](_0x57ada1)['json'](_0x345ef5);}};}function respondWithFilteredResult(_0x548f73,_0x55df17){return function(_0x3799d0){if(_0x3799d0){var _0x4621e7=typeof _0x55df17[_0xbbea('0x2a')]==='undefined'&&typeof _0x55df17[_0xbbea('0x2b')]==='undefined';var _0x2a5c16=_0x3799d0[_0xbbea('0x2c')];var _0x45e9e8=_0x4621e7?0x0:_0x55df17[_0xbbea('0x2a')];var _0x848ae8=_0x4621e7?_0x3799d0['count']:_0x55df17[_0xbbea('0x2a')]+_0x55df17['limit'];var _0x99a7c;if(_0x848ae8>=_0x2a5c16){_0x848ae8=_0x2a5c16;_0x99a7c=0xc8;}else{_0x99a7c=0xce;}_0x548f73['status'](_0x99a7c);return _0x548f73[_0xbbea('0x2d')]('Content-Range',_0x45e9e8+'-'+_0x848ae8+'/'+_0x2a5c16)[_0xbbea('0x2e')](_0x3799d0);}return null;};}function patchUpdates(_0x3dd242){return function(_0x1a7b36){try{jsonpatch[_0xbbea('0x2f')](_0x1a7b36,_0x3dd242,!![]);}catch(_0x4982c0){return BPromise[_0xbbea('0x30')](_0x4982c0);}return _0x1a7b36[_0xbbea('0x31')]();};}function saveUpdates(_0x3d3c76,_0x565730){return function(_0x5cc4de){if(_0x5cc4de){return _0x5cc4de[_0xbbea('0x32')](_0x3d3c76)[_0xbbea('0x1e')](function(_0x1aeac4){return _0x1aeac4;});}return null;};}function removeEntity(_0x188344,_0x31f627){return function(_0x49cfa5){if(_0x49cfa5){return _0x49cfa5[_0xbbea('0x33')]()[_0xbbea('0x1e')](function(){_0x188344[_0xbbea('0x34')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5e0565,_0x14244e){return function(_0x3bdb3e){if(!_0x3bdb3e){_0x5e0565[_0xbbea('0x28')](0x194);}return _0x3bdb3e;};}function handleError(_0x316251,_0x3826ae){_0x3826ae=_0x3826ae||0x1f4;return function(_0x1c151f){logger[_0xbbea('0x21')](_0x1c151f['stack']);if(_0x1c151f[_0xbbea('0x35')]){delete _0x1c151f[_0xbbea('0x35')];}_0x316251[_0xbbea('0x34')](_0x3826ae)['send'](_0x1c151f);};}exports[_0xbbea('0x36')]=function(_0x15aa19,_0x51d442){var _0x555246={},_0x273808={},_0x3cca80={'count':0x0,'rows':[]};var _0x2762ff=_['map'](db['WhatsappMessage'][_0xbbea('0x37')],function(_0x4f6c41){return{'name':_0x4f6c41[_0xbbea('0x38')],'type':_0x4f6c41[_0xbbea('0x39')]['key']};});_0x273808[_0xbbea('0x3a')]=_[_0xbbea('0x3b')](_0x2762ff,_0xbbea('0x35'));_0x273808[_0xbbea('0x3c')]=_[_0xbbea('0x3d')](_0x15aa19[_0xbbea('0x3c')]);_0x273808[_0xbbea('0x3e')]=_[_0xbbea('0x3f')](_0x273808['model'],_0x273808[_0xbbea('0x3c')]);_0x555246[_0xbbea('0x40')]=_[_0xbbea('0x3f')](_0x273808[_0xbbea('0x3a')],qs[_0xbbea('0x41')](_0x15aa19[_0xbbea('0x3c')]['fields']));_0x555246[_0xbbea('0x40')]=_0x555246[_0xbbea('0x40')][_0xbbea('0x42')]?_0x555246[_0xbbea('0x40')]:_0x273808[_0xbbea('0x3a')];if(!_0x15aa19['query'][_0xbbea('0x43')](_0xbbea('0x44'))){_0x555246[_0xbbea('0x2b')]=qs[_0xbbea('0x2b')](_0x15aa19[_0xbbea('0x3c')][_0xbbea('0x2b')]);_0x555246['offset']=qs[_0xbbea('0x2a')](_0x15aa19[_0xbbea('0x3c')][_0xbbea('0x2a')]);}_0x555246[_0xbbea('0x45')]=qs['sort'](_0x15aa19['query'][_0xbbea('0x46')]);_0x555246[_0xbbea('0x47')]=qs[_0xbbea('0x3e')](_[_0xbbea('0x48')](_0x15aa19['query'],_0x273808[_0xbbea('0x3e')]),_0x2762ff);if(_0x15aa19[_0xbbea('0x3c')][_0xbbea('0x49')]){_0x555246[_0xbbea('0x47')]=_[_0xbbea('0x4a')](_0x555246['where'],{'$or':_[_0xbbea('0x3b')](_0x2762ff,function(_0x10da30){if(_0x10da30[_0xbbea('0x39')]!==_0xbbea('0x4b')){var _0x2d0af4={};_0x2d0af4[_0x10da30['name']]={'$like':'%'+_0x15aa19['query']['filter']+'%'};return _0x2d0af4;}})});}_0x555246=_['merge']({},_0x555246,_0x15aa19[_0xbbea('0x4c')]);var _0x10c33c={'where':_0x555246[_0xbbea('0x47')]};return db[_0xbbea('0x4d')][_0xbbea('0x2c')](_0x10c33c)[_0xbbea('0x1e')](function(_0x169e36){_0x3cca80[_0xbbea('0x2c')]=_0x169e36;if(_0x15aa19[_0xbbea('0x3c')][_0xbbea('0x4e')]){_0x555246[_0xbbea('0x4f')]=[{'all':!![]}];}return db['WhatsappMessage']['findAll'](_0x555246);})[_0xbbea('0x1e')](function(_0x77119e){_0x3cca80[_0xbbea('0x50')]=_0x77119e;return _0x3cca80;})[_0xbbea('0x1e')](respondWithFilteredResult(_0x51d442,_0x555246))[_0xbbea('0x27')](handleError(_0x51d442,null));};exports['show']=function(_0x3f249e,_0x5a483e){var _0x2b41ce={'raw':!![],'where':{'id':_0x3f249e[_0xbbea('0x51')]['id']}},_0x4c0af3={};_0x4c0af3[_0xbbea('0x3a')]=_['keys'](db[_0xbbea('0x4d')][_0xbbea('0x37')]);_0x4c0af3[_0xbbea('0x3c')]=_[_0xbbea('0x3d')](_0x3f249e[_0xbbea('0x3c')]);_0x4c0af3[_0xbbea('0x3e')]=_[_0xbbea('0x3f')](_0x4c0af3[_0xbbea('0x3a')],_0x4c0af3['query']);_0x2b41ce[_0xbbea('0x40')]=_[_0xbbea('0x3f')](_0x4c0af3['model'],qs['fields'](_0x3f249e[_0xbbea('0x3c')][_0xbbea('0x41')]));_0x2b41ce[_0xbbea('0x40')]=_0x2b41ce['attributes'][_0xbbea('0x42')]?_0x2b41ce[_0xbbea('0x40')]:_0x4c0af3['model'];if(_0x3f249e[_0xbbea('0x3c')][_0xbbea('0x4e')]){_0x2b41ce['include']=[{'all':!![]}];}_0x2b41ce=_[_0xbbea('0x4a')]({},_0x2b41ce,_0x3f249e['options']);return db[_0xbbea('0x4d')][_0xbbea('0x52')](_0x2b41ce)[_0xbbea('0x1e')](handleEntityNotFound(_0x5a483e,null))[_0xbbea('0x1e')](respondWithResult(_0x5a483e,null))['catch'](handleError(_0x5a483e,null));};exports[_0xbbea('0x53')]=function(_0x29221b,_0x316a90){return db[_0xbbea('0x4d')][_0xbbea('0x53')](_0x29221b[_0xbbea('0x54')],{})['then'](respondWithResult(_0x316a90,0xc9))[_0xbbea('0x27')](handleError(_0x316a90,null));};exports[_0xbbea('0x32')]=function(_0x558312,_0x28950b){if(_0x558312[_0xbbea('0x54')]['id']){delete _0x558312[_0xbbea('0x54')]['id'];}return db[_0xbbea('0x4d')]['find']({'where':{'id':_0x558312[_0xbbea('0x51')]['id']}})[_0xbbea('0x1e')](handleEntityNotFound(_0x28950b,null))[_0xbbea('0x1e')](saveUpdates(_0x558312['body'],null))['then'](respondWithResult(_0x28950b,null))['catch'](handleError(_0x28950b,null));};exports[_0xbbea('0x33')]=function(_0xc57020,_0x5f0fa4){return db[_0xbbea('0x4d')]['find']({'where':{'id':_0xc57020[_0xbbea('0x51')]['id']}})[_0xbbea('0x1e')](handleEntityNotFound(_0x5f0fa4,null))[_0xbbea('0x1e')](removeEntity(_0x5f0fa4,null))[_0xbbea('0x27')](handleError(_0x5f0fa4,null));};exports[_0xbbea('0x55')]=function(_0x4945a3,_0x928584){return db[_0xbbea('0x4d')][_0xbbea('0x55')]()[_0xbbea('0x1e')](respondWithResult(_0x928584,null))[_0xbbea('0x27')](handleError(_0x928584,null));};var interaction_log=require('../../config/logger')(_0xbbea('0x56'));exports['accept']=function(_0x7343a5,_0x5d05ea,_0x1b6e83){var _0x53d9da={'agent':{},'channel':'whatsapp'};if(_0x7343a5['body']['id']){delete _0x7343a5['body']['id'];}_0x7343a5[_0xbbea('0x54')][_0xbbea('0x57')]=!![];_0x7343a5[_0xbbea('0x54')][_0xbbea('0x58')]=moment()[_0xbbea('0x59')](_0xbbea('0x5a'));_0x7343a5[_0xbbea('0x54')][_0xbbea('0x5b')]=_0x7343a5['body']['UserId']||_0x7343a5['user']['id'];_0x53d9da[_0xbbea('0x5c')]['id']=_0x7343a5[_0xbbea('0x54')][_0xbbea('0x5b')];return db[_0xbbea('0x4d')][_0xbbea('0x52')]({'where':{'id':_0x7343a5['params']['id'],'UserId':null}})[_0xbbea('0x1e')](handleEntityNotFound(_0x5d05ea,null))[_0xbbea('0x1e')](saveUpdates(_0x7343a5[_0xbbea('0x54')],null))['then'](function(_0x3bc668){if(_0x3bc668){_0x53d9da[_0xbbea('0x24')]=_0x3bc668[_0xbbea('0x5d')]({'plain':!![]});return db['WhatsappInteraction']['find']({'where':{'id':_0x3bc668[_0xbbea('0x5e')]}});}return null;})[_0xbbea('0x1e')](handleEntityNotFound(_0x5d05ea,null))[_0xbbea('0x1e')](function(_0x190299){if(_0x190299){return _0x190299[_0xbbea('0x32')]({'UserId':_0x7343a5['body'][_0xbbea('0x5b')],'read1stAt':_['isNil'](_0x190299[_0xbbea('0x5f')])?moment()['format'](_0xbbea('0x5a')):undefined});}return null;})[_0xbbea('0x1e')](function(_0xda9219){if(_0xda9219){_0x53d9da[_0xbbea('0x60')]=_0xda9219[_0xbbea('0x5d')]({'plain':!![]});interaction_log[_0xbbea('0x25')](_0xbbea('0x61'),_0x7343a5['user']['id'],_0x7343a5[_0xbbea('0x62')][_0xbbea('0x35')],_0x7343a5['user'][_0xbbea('0x63')],_0x53d9da[_0xbbea('0x60')]['id'],_0x7343a5['body']?JSON[_0xbbea('0x20')](_0x7343a5[_0xbbea('0x54')]):_0xbbea('0x64'));return respondWithRpcPromise(_0xbbea('0x65'),_0xbbea('0x66'),_0x53d9da);}return null;})[_0xbbea('0x1e')](function(_0x15c3af){var _0x566fa3='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x15c3af[_0xbbea('0x24')]['ContactId'];return db[_0xbbea('0x67')]['query'](_0x566fa3,{'type':db['Sequelize']['QueryTypes'][_0xbbea('0x68')],'raw':!![]})['then'](function(_0x2f6578){return _0x2f6578;});})['then'](function(_0x382917){if(_0x382917){_0x53d9da['message'][_0xbbea('0x69')]=_0x382917[0x0];if(!_0x7343a5[_0xbbea('0x54')]['UserId'])return;return db[_0xbbea('0x6a')][_0xbbea('0x52')]({'where':{'id':_0x7343a5[_0xbbea('0x54')][_0xbbea('0x5b')],'role':_0xbbea('0x5c')},'attributes':['id',_0xbbea('0x35'),_0xbbea('0x6b'),'email',_0xbbea('0x6c')],'raw':!![]});}return null;})[_0xbbea('0x1e')](function(_0x97f9b0){if(!_0x97f9b0)return null;_0x53d9da[_0xbbea('0x24')][_0xbbea('0x5c')]=_0x97f9b0;return _0x53d9da;})[_0xbbea('0x1e')](function(_0x1b7d46){if(_0x1b7d46){if(_0x7343a5[_0xbbea('0x54')][_0xbbea('0x6d')]){_0x53d9da[_0xbbea('0x24')][_0xbbea('0x6e')]=util['format'](_0xbbea('0x6f'),_0x7343a5[_0xbbea('0x62')][_0xbbea('0x35')]);_0x53d9da[_0xbbea('0x24')]['channel']=_0x53d9da[_0xbbea('0x70')];_0x53d9da['message'][_0xbbea('0x71')]=_0x53d9da[_0xbbea('0x70')];_0x53d9da[_0xbbea('0x24')][_0xbbea('0x72')]=_0xbbea('0x73');return respondWithRpcPromise(_0xbbea('0x74'),_0xbbea('0x74'),{'event':_0xbbea('0x75'),'message':_0x53d9da[_0xbbea('0x24')]},client9002)[_0xbbea('0x1e')](function(){return _0x53d9da;});}return _0x53d9da;}return null;})[_0xbbea('0x1e')](respondWithResult(_0x5d05ea,null))['catch'](handleError(_0x5d05ea,null));};var interaction_log=require('../../config/logger')(_0xbbea('0x56'));exports[_0xbbea('0x30')]=function(_0x1e3acd,_0x1c1516,_0x56dba7){var _0x3fddef={'agent':{},'channel':_0xbbea('0x76')};if(_0x1e3acd[_0xbbea('0x54')]['id']){delete _0x1e3acd[_0xbbea('0x54')]['id'];}_0x1e3acd[_0xbbea('0x54')][_0xbbea('0x5b')]=_0x1e3acd['body'][_0xbbea('0x5b')]||_0x1e3acd['user']['id'];_0x3fddef[_0xbbea('0x5c')]['id']=_0x1e3acd[_0xbbea('0x54')]['UserId'];return db[_0xbbea('0x4d')]['find']({'where':{'id':_0x1e3acd[_0xbbea('0x51')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x1c1516,null))[_0xbbea('0x1e')](function(_0xad224){if(_0xad224){_0x3fddef[_0xbbea('0x24')]=_0xad224[_0xbbea('0x5d')]({'plain':!![]});return db[_0xbbea('0x77')][_0xbbea('0x52')]({'where':{'id':_0xad224['WhatsappInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x1c1516,null))[_0xbbea('0x1e')](function(_0x1b060d){if(_0x1b060d){_0x3fddef[_0xbbea('0x60')]=_0x1b060d[_0xbbea('0x5d')]({'plain':!![]});interaction_log[_0xbbea('0x25')](_0xbbea('0x78'),_0x1e3acd['user']['id'],_0x1e3acd[_0xbbea('0x62')]['name'],_0x1e3acd[_0xbbea('0x62')][_0xbbea('0x63')],_0x3fddef['interaction']['id'],_0x1e3acd[_0xbbea('0x54')]?JSON[_0xbbea('0x20')](_0x1e3acd[_0xbbea('0x54')]):'null');return respondWithRpcPromise(_0xbbea('0x79'),_0xbbea('0x7a'),_0x3fddef);}return null;})[_0xbbea('0x1e')](function(_0x441401){var _0x5e6c79=_0xbbea('0x7b')+_0x441401['message'][_0xbbea('0x7c')];return db['sequelize'][_0xbbea('0x3c')](_0x5e6c79,{'type':db[_0xbbea('0x7d')][_0xbbea('0x7e')][_0xbbea('0x68')],'raw':!![]})['then'](function(_0x5e6a8d){return _0x5e6a8d;});})[_0xbbea('0x1e')](function(_0x406c1c){if(_0x406c1c){_0x3fddef[_0xbbea('0x24')][_0xbbea('0x69')]=_0x406c1c[0x0];if(!_0x1e3acd[_0xbbea('0x54')]['UserId'])return;return db[_0xbbea('0x6a')][_0xbbea('0x52')]({'where':{'id':_0x1e3acd[_0xbbea('0x54')]['UserId'],'role':_0xbbea('0x5c')},'attributes':['id','name',_0xbbea('0x6b'),_0xbbea('0x7f'),_0xbbea('0x6c')],'raw':!![]});}return null;})['then'](function(_0x1991d5){if(!_0x1991d5)return null;_0x3fddef[_0xbbea('0x24')][_0xbbea('0x5c')]=_0x1991d5;return _0x3fddef;})[_0xbbea('0x1e')](function(_0x387f6a){if(_0x387f6a){_0x387f6a[_0xbbea('0x24')][_0xbbea('0x6e')]=util[_0xbbea('0x59')]('SIP/%s',_0x1e3acd[_0xbbea('0x62')][_0xbbea('0x35')]);_0x387f6a[_0xbbea('0x24')]['channel']=_0x3fddef[_0xbbea('0x70')];_0x387f6a[_0xbbea('0x24')][_0xbbea('0x71')]=_0x3fddef[_0xbbea('0x70')];_0x387f6a[_0xbbea('0x24')]['event']='reject';respondWithRpcPromise('EventManager',_0xbbea('0x74'),{'event':'rejectmessage','message':_0x387f6a[_0xbbea('0x24')]},client9002);return _0x3fddef;}return null;})[_0xbbea('0x1e')](respondWithResult(_0x1c1516,null))[_0xbbea('0x27')](handleError(_0x1c1516,null));};exports[_0xbbea('0x34')]=function(_0x366bfc,_0x27716b,_0x657b18){if(_0x366bfc[_0xbbea('0x54')]['id']){delete _0x366bfc['body']['id'];}var _0xf0c694;return db[_0xbbea('0x4d')][_0xbbea('0x52')]({'where':{'id':_0x366bfc['params']['id']}})[_0xbbea('0x1e')](handleEntityNotFound(_0x27716b,null))[_0xbbea('0x1e')](function(_0x31fd56){if(_0x31fd56){_0xf0c694=_0x31fd56;return db['WhatsappAccount']['find']({'where':{'id':_0x31fd56['WhatsappAccountId']}});}})[_0xbbea('0x1e')](handleEntityNotFound(_0x27716b,null))[_0xbbea('0x1e')](function(_0x70975b){if(_0x70975b){logger['debug'](_0xbbea('0x80'),'status',_0xbbea('0x81'),_0x70975b[_0xbbea('0x39')],util[_0xbbea('0x82')](_0x366bfc[_0xbbea('0x54')],{'showHidden':![],'depth':null}));switch(_0x70975b[_0xbbea('0x39')]){case _0xbbea('0x83'):if(_0x366bfc['body'][_0xbbea('0x84')]&&_0x366bfc[_0xbbea('0x54')][_0xbbea('0x84')]===_0xf0c694['messageId']&&_0x366bfc[_0xbbea('0x54')][_0xbbea('0x85')]&&_0x366bfc[_0xbbea('0x54')][_0xbbea('0x85')]===_0xbbea('0x57')){return _0xf0c694[_0xbbea('0x32')]({'read':!![]});}else{logger['error'](_0xbbea('0x86'),_0xbbea('0x34'),'twilio',util[_0xbbea('0x82')](_0x366bfc[_0xbbea('0x54')],{'showHidden':![],'depth':null}));}break;}return _0xf0c694;}})['then'](respondWithResult(_0x27716b,null))[_0xbbea('0x27')](handleError(_0x27716b,null));}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.events.js b/server/api/whatsappMessage/whatsappMessage.events.js index 9ba3c1f..f40569c 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 _0x93e6=['hasOwnProperty','events','setMaxListeners','update','emit'];(function(_0x1baef6,_0x104b34){var _0x5f34a6=function(_0x4db449){while(--_0x4db449){_0x1baef6['push'](_0x1baef6['shift']());}};_0x5f34a6(++_0x104b34);}(_0x93e6,0x11e));var _0x693e=function(_0x4baac8,_0x5f1dc7){_0x4baac8=_0x4baac8-0x0;var _0x56ebc5=_0x93e6[_0x4baac8];return _0x56ebc5;};'use strict';var EventEmitter=require(_0x693e('0x0'));var WhatsappMessage=require('../../mysqldb')['db']['WhatsappMessage'];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0x693e('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0x693e('0x2'),'afterDestroy':'remove'};function emitEvent(_0x313261){return function(_0x3fb653,_0x17cf23,_0x53e728){WhatsappMessageEvents[_0x693e('0x3')](_0x313261+':'+_0x3fb653['id'],_0x3fb653);WhatsappMessageEvents[_0x693e('0x3')](_0x313261,_0x3fb653);_0x53e728(null);};}for(var e in events){if(events[_0x693e('0x4')](e)){var event=events[e];WhatsappMessage['hook'](e,emitEvent(event));}}module['exports']=WhatsappMessageEvents; \ No newline at end of file +var _0x8d05=['events','../../mysqldb','WhatsappMessage','setMaxListeners','save','emit','hasOwnProperty','exports'];(function(_0x128a40,_0x546c18){var _0x1359d4=function(_0x594f59){while(--_0x594f59){_0x128a40['push'](_0x128a40['shift']());}};_0x1359d4(++_0x546c18);}(_0x8d05,0xe8));var _0x58d0=function(_0xe8b208,_0xe9a8e0){_0xe8b208=_0xe8b208-0x0;var _0x5c4353=_0x8d05[_0xe8b208];return _0x5c4353;};'use strict';var EventEmitter=require(_0x58d0('0x0'));var WhatsappMessage=require(_0x58d0('0x1'))['db'][_0x58d0('0x2')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0x58d0('0x3')](0x0);var events={'afterCreate':_0x58d0('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x276e0a){return function(_0x3de956,_0x1a2d82,_0x55f391){WhatsappMessageEvents['emit'](_0x276e0a+':'+_0x3de956['id'],_0x3de956);WhatsappMessageEvents[_0x58d0('0x5')](_0x276e0a,_0x3de956);_0x55f391(null);};}for(var e in events){if(events[_0x58d0('0x6')](e)){var event=events[e];WhatsappMessage['hook'](e,emitEvent(event));}}module[_0x58d0('0x7')]=WhatsappMessageEvents; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.model.js b/server/api/whatsappMessage/whatsappMessage.model.js index f264c57..0485c45 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 _0x362a=['../../config/logger','api','moment','bluebird','request-promise','node-fetch','path','rimraf','../../config/environment','./whatsappMessage.attributes','define','WhatsappMessage','whatsapp_messages','messageId','fti_whatsapp_messages','body','FULLTEXT','models','get','direction','toLowerCase','isNil','UserId','WhatsappInteraction','findOne','createdAt','catch','out','secret','find','WhatsappAccountId','then','type','twilio','accountSid','authToken','phone','messages','create','whatsapp:','remote','/api/whatsapp/messages/','token','sid','WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','error','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','sinch','baseUrl','/whatsapp/v1/','/messages/','text','Bearer\x20','application/json','statuses','update','message_id','err','WhatsappMessage,\x20%s','finally','utf8mb4_unicode_ci','lodash','util'];(function(_0x1452da,_0x318b41){var _0x17dc99=function(_0x1ef0e5){while(--_0x1ef0e5){_0x1452da['push'](_0x1452da['shift']());}};_0x17dc99(++_0x318b41);}(_0x362a,0x102));var _0xa362=function(_0x26973e,_0x4d1d08){_0x26973e=_0x26973e-0x0;var _0x26893c=_0x362a[_0x26973e];return _0x26893c;};'use strict';var _=require(_0xa362('0x0'));var util=require(_0xa362('0x1'));var logger=require(_0xa362('0x2'))(_0xa362('0x3'));var moment=require(_0xa362('0x4'));var BPromise=require(_0xa362('0x5'));var rp=require(_0xa362('0x6'));var fetch=require(_0xa362('0x7'));var fs=require('fs');var path=require(_0xa362('0x8'));var rimraf=require(_0xa362('0x9'));var config=require(_0xa362('0xa'));var attributes=require(_0xa362('0xb'));module['exports']=function(_0x1944a4,_0x1cdcc5){return _0x1944a4[_0xa362('0xc')](_0xa362('0xd'),attributes,{'tableName':_0xa362('0xe'),'paranoid':![],'indexes':[{'name':'messageId','fields':[_0xa362('0xf')]},{'name':_0xa362('0x10'),'fields':[_0xa362('0x11')],'type':_0xa362('0x12')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x277c3f,_0x6695dc,_0x23b842){var _0x5e0869=_0x1944a4[_0xa362('0x13')];var _0x100eeb=_0x277c3f[_0xa362('0x14')]({'plain':!![]});if(_0x100eeb[_0xa362('0x15')][_0xa362('0x16')]()==='in'||_0x100eeb[_0xa362('0x15')][_0xa362('0x16')]()==='out'&&!_0x100eeb['secret']&&!_[_0xa362('0x17')](_0x100eeb[_0xa362('0x18')])){_0x5e0869[_0xa362('0x19')][_0xa362('0x1a')]({'where':{'id':_0x100eeb['WhatsappInteractionId']}})['then'](function(_0x218465){if(_0x218465){_0x218465['update']({'lastMsgAt':_0x100eeb[_0xa362('0x1b')],'lastMsgDirection':_0x100eeb[_0xa362('0x15')][_0xa362('0x16')]()});}})[_0xa362('0x1c')](function(_0x5b1838){console['error'](_0x5b1838);});}if(_0x100eeb[_0xa362('0x15')]===_0xa362('0x1d')&&!_0x100eeb[_0xa362('0x1e')]){var _0x405826;_0x5e0869['WhatsappAccount'][_0xa362('0x1f')]({'where':{'id':_0x100eeb[_0xa362('0x20')]},'raw':!![]})[_0xa362('0x21')](function(_0x1078de){_0x405826=_0x1078de;if(_0x405826&&_0x405826[_0xa362('0x22')]){switch(_0x405826['type']){case'twilio':var _0x57b00d=require(_0xa362('0x23'));if(_0x405826[_0xa362('0x24')]&&_0x405826[_0xa362('0x25')]&&_0x405826[_0xa362('0x26')]){var _0x19ab56=new _0x57b00d(_0x405826[_0xa362('0x24')],_0x405826[_0xa362('0x25')]);_0x19ab56[_0xa362('0x27')][_0xa362('0x28')]({'body':_0x100eeb[_0xa362('0x11')],'to':_0xa362('0x29')+_0x100eeb['phone'],'from':_0xa362('0x29')+_0x405826['phone'],'statusCallback':_0x405826[_0xa362('0x2a')]+_0xa362('0x2b')+_0x100eeb['id']+'/status?token='+_0x405826[_0xa362('0x2c')]})['then'](function(_0x50a851){if(_0x50a851[_0xa362('0x2d')]){return _0x277c3f['update']({'messageId':_0x50a851[_0xa362('0x2d')]});}})[_0xa362('0x1c')](function(_0x462c50){logger['error'](_0xa362('0x2e'),_0xa362('0x2f'),_0xa362('0x23'),util[_0xa362('0x30')](_0x462c50,{'showHidden':![],'depth':null}));});}else{logger[_0xa362('0x31')](_0xa362('0x2e'),_0xa362('0x2f'),_0xa362('0x23'),_0xa362('0x32'));}break;case _0xa362('0x33'):var _0x5de0f3=_0x405826[_0xa362('0x24')];var _0x31d2bf=_0x405826['authToken'];var _0x167fd5=_0x405826[_0xa362('0x34')]+_0xa362('0x35')+_0x5de0f3+_0xa362('0x36');var _0x3af38c={'to':[_0x100eeb[_0xa362('0x26')]],'message':{'type':_0xa362('0x37'),'text':_0x100eeb['body']}};var _0x12fe50={'method':'POST','uri':_0x167fd5,'headers':{'Authorization':_0xa362('0x38')+_0x31d2bf,'Content-Type':_0xa362('0x39')},'body':_0x3af38c,'json':!![]};rp(_0x12fe50)[_0xa362('0x21')](function(_0x28c0e2){if(_0x28c0e2[_0xa362('0x3a')][0x0]['message_id']){return _0x277c3f[_0xa362('0x3b')]({'messageId':_0x28c0e2[_0xa362('0x3a')][0x0][_0xa362('0x3c')]});}})['catch'](function(_0x3b4058){logger[_0xa362('0x3d')](_0xa362('0x3e'),_0x3b4058);});break;}}})[_0xa362('0x3f')](function(){_0x23b842();});}else{_0x23b842();}}},'charset':'utf8mb4','collate':_0xa362('0x40')});}; \ No newline at end of file +var _0xaaa7=['WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','sinch','/whatsapp/v1/','/messages/','text','POST','Bearer\x20','statuses','message_id','err','utf8mb4_unicode_ci','util','moment','bluebird','request-promise','node-fetch','path','rimraf','../../config/environment','./whatsappMessage.attributes','define','WhatsappMessage','whatsapp_messages','messageId','fti_whatsapp_messages','models','get','direction','toLowerCase','out','isNil','UserId','WhatsappInteraction','findOne','then','update','createdAt','catch','error','WhatsappAccountId','type','twilio','accountSid','authToken','create','body','whatsapp:','phone','remote','/api/whatsapp/messages/','/status?token=','token','sid'];(function(_0xa6cc5c,_0x239c99){var _0x44803d=function(_0x515b6e){while(--_0x515b6e){_0xa6cc5c['push'](_0xa6cc5c['shift']());}};_0x44803d(++_0x239c99);}(_0xaaa7,0x15e));var _0x7aaa=function(_0x48ae21,_0x3d12af){_0x48ae21=_0x48ae21-0x0;var _0x104e7a=_0xaaa7[_0x48ae21];return _0x104e7a;};'use strict';var _=require('lodash');var util=require(_0x7aaa('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x7aaa('0x1'));var BPromise=require(_0x7aaa('0x2'));var rp=require(_0x7aaa('0x3'));var fetch=require(_0x7aaa('0x4'));var fs=require('fs');var path=require(_0x7aaa('0x5'));var rimraf=require(_0x7aaa('0x6'));var config=require(_0x7aaa('0x7'));var attributes=require(_0x7aaa('0x8'));module['exports']=function(_0xa6141a,_0x544f44){return _0xa6141a[_0x7aaa('0x9')](_0x7aaa('0xa'),attributes,{'tableName':_0x7aaa('0xb'),'paranoid':![],'indexes':[{'name':_0x7aaa('0xc'),'fields':['messageId']},{'name':_0x7aaa('0xd'),'fields':['body'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x31aaba,_0x14d1ce,_0x47395d){var _0x298d7d=_0xa6141a[_0x7aaa('0xe')];var _0x440aed=_0x31aaba[_0x7aaa('0xf')]({'plain':!![]});if(_0x440aed[_0x7aaa('0x10')][_0x7aaa('0x11')]()==='in'||_0x440aed[_0x7aaa('0x10')][_0x7aaa('0x11')]()===_0x7aaa('0x12')&&!_0x440aed['secret']&&!_[_0x7aaa('0x13')](_0x440aed[_0x7aaa('0x14')])){_0x298d7d[_0x7aaa('0x15')][_0x7aaa('0x16')]({'where':{'id':_0x440aed['WhatsappInteractionId']}})[_0x7aaa('0x17')](function(_0x5acbcf){if(_0x5acbcf){_0x5acbcf[_0x7aaa('0x18')]({'lastMsgAt':_0x440aed[_0x7aaa('0x19')],'lastMsgDirection':_0x440aed['direction']['toLowerCase']()});}})[_0x7aaa('0x1a')](function(_0x1dd347){console[_0x7aaa('0x1b')](_0x1dd347);});}if(_0x440aed[_0x7aaa('0x10')]===_0x7aaa('0x12')&&!_0x440aed['secret']){var _0x21b3f8;_0x298d7d['WhatsappAccount']['find']({'where':{'id':_0x440aed[_0x7aaa('0x1c')]},'raw':!![]})['then'](function(_0x17743d){_0x21b3f8=_0x17743d;if(_0x21b3f8&&_0x21b3f8['type']){switch(_0x21b3f8[_0x7aaa('0x1d')]){case _0x7aaa('0x1e'):var _0x232997=require(_0x7aaa('0x1e'));if(_0x21b3f8[_0x7aaa('0x1f')]&&_0x21b3f8['authToken']&&_0x21b3f8['phone']){var _0x59ea85=new _0x232997(_0x21b3f8[_0x7aaa('0x1f')],_0x21b3f8[_0x7aaa('0x20')]);_0x59ea85['messages'][_0x7aaa('0x21')]({'body':_0x440aed[_0x7aaa('0x22')],'to':_0x7aaa('0x23')+_0x440aed[_0x7aaa('0x24')],'from':_0x7aaa('0x23')+_0x21b3f8[_0x7aaa('0x24')],'statusCallback':_0x21b3f8[_0x7aaa('0x25')]+_0x7aaa('0x26')+_0x440aed['id']+_0x7aaa('0x27')+_0x21b3f8[_0x7aaa('0x28')]})[_0x7aaa('0x17')](function(_0xd6dfa){if(_0xd6dfa['sid']){return _0x31aaba['update']({'messageId':_0xd6dfa[_0x7aaa('0x29')]});}})[_0x7aaa('0x1a')](function(_0x1317f7){logger[_0x7aaa('0x1b')](_0x7aaa('0x2a'),_0x7aaa('0x2b'),_0x7aaa('0x1e'),util[_0x7aaa('0x2c')](_0x1317f7,{'showHidden':![],'depth':null}));});}else{logger[_0x7aaa('0x1b')](_0x7aaa('0x2a'),_0x7aaa('0x2b'),_0x7aaa('0x1e'),_0x7aaa('0x2d'));}break;case _0x7aaa('0x2e'):var _0x35f9c0=_0x21b3f8['accountSid'];var _0x30d4f9=_0x21b3f8[_0x7aaa('0x20')];var _0x4b4e7a=_0x21b3f8['baseUrl']+_0x7aaa('0x2f')+_0x35f9c0+_0x7aaa('0x30');var _0x5b51e7={'to':[_0x440aed['phone']],'message':{'type':_0x7aaa('0x31'),'text':_0x440aed[_0x7aaa('0x22')]}};var _0x22946d={'method':_0x7aaa('0x32'),'uri':_0x4b4e7a,'headers':{'Authorization':_0x7aaa('0x33')+_0x30d4f9,'Content-Type':'application/json'},'body':_0x5b51e7,'json':!![]};rp(_0x22946d)[_0x7aaa('0x17')](function(_0x3be1f6){if(_0x3be1f6[_0x7aaa('0x34')][0x0][_0x7aaa('0x35')]){return _0x31aaba[_0x7aaa('0x18')]({'messageId':_0x3be1f6[_0x7aaa('0x34')][0x0][_0x7aaa('0x35')]});}})[_0x7aaa('0x1a')](function(_0x308788){logger[_0x7aaa('0x36')]('WhatsappMessage,\x20%s',_0x308788);});break;}}})['finally'](function(){_0x47395d();});}else{_0x47395d();}}},'charset':'utf8mb4','collate':_0x7aaa('0x37')});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.rpc.js b/server/api/whatsappMessage/whatsappMessage.rpc.js index 4580e4e..02de875 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 _0x8013=['../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./whatsappMessage.socket','register','request','then','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateWhatsappMessage','create','body','options','raw','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x590a38,_0x2bc65c){var _0xf36626=function(_0x551cd1){while(--_0x551cd1){_0x590a38['push'](_0x590a38['shift']());}};_0xf36626(++_0x2bc65c);}(_0x8013,0xd8));var _0x3801=function(_0x3892e3,_0x24cfbc){_0x3892e3=_0x3892e3-0x0;var _0x35ba3c=_0x8013[_0x3892e3];return _0x35ba3c;};'use strict';var _=require(_0x3801('0x0'));var util=require(_0x3801('0x1'));var moment=require(_0x3801('0x2'));var BPromise=require(_0x3801('0x3'));var rs=require(_0x3801('0x4'));var fs=require('fs');var Redis=require(_0x3801('0x5'));var db=require(_0x3801('0x6'))['db'];var utils=require(_0x3801('0x7'));var logger=require(_0x3801('0x8'))('rpc');var config=require(_0x3801('0x9'));var jayson=require(_0x3801('0xa'));var client=jayson[_0x3801('0xb')][_0x3801('0xc')]({'port':0x232a});config[_0x3801('0xd')]=_[_0x3801('0xe')](config[_0x3801('0xd')],{'host':_0x3801('0xf'),'port':0x18eb});var socket=require(_0x3801('0x10'))(new Redis(config[_0x3801('0xd')]));require(_0x3801('0x11'))[_0x3801('0x12')](socket);function respondWithRpcPromise(_0x232b2d,_0x3810fd,_0x2902ff){return new BPromise(function(_0x1c87e1,_0x4b41dc){return client[_0x3801('0x13')](_0x232b2d,_0x2902ff)[_0x3801('0x14')](function(_0x10e09c){logger[_0x3801('0x15')](_0x3801('0x16'),_0x3810fd,_0x3801('0x17'));logger[_0x3801('0x18')](_0x3801('0x19'),_0x3810fd,'request\x20sent',JSON[_0x3801('0x1a')](_0x10e09c));if(_0x10e09c[_0x3801('0x1b')]){if(_0x10e09c['error'][_0x3801('0x1c')]===0x1f4){logger[_0x3801('0x1b')](_0x3801('0x16'),_0x3810fd,_0x10e09c[_0x3801('0x1b')]['message']);return _0x4b41dc(_0x10e09c[_0x3801('0x1b')][_0x3801('0x1d')]);}logger[_0x3801('0x1b')](_0x3801('0x16'),_0x3810fd,_0x10e09c['error'][_0x3801('0x1d')]);return _0x1c87e1(_0x10e09c[_0x3801('0x1b')][_0x3801('0x1d')]);}else{logger[_0x3801('0x15')](_0x3801('0x16'),_0x3810fd,_0x3801('0x17'));_0x1c87e1(_0x10e09c[_0x3801('0x1e')]['message']);}})[_0x3801('0x1f')](function(_0xed11c6){logger[_0x3801('0x1b')](_0x3801('0x16'),_0x3810fd,_0xed11c6);_0x4b41dc(_0xed11c6);});});}exports[_0x3801('0x20')]=function(_0x4d9df7){var _0x22f014=this;return new Promise(function(_0x41a06d,_0x372aa1){return db['WhatsappMessage'][_0x3801('0x21')](_0x4d9df7[_0x3801('0x22')],{'raw':_0x4d9df7[_0x3801('0x23')]?_0x4d9df7['options'][_0x3801('0x24')]===undefined?!![]:![]:!![]})[_0x3801('0x14')](function(_0x233702){logger[_0x3801('0x15')](_0x3801('0x20'),_0x4d9df7);logger[_0x3801('0x18')](_0x3801('0x20'),_0x4d9df7,JSON[_0x3801('0x1a')](_0x233702));_0x41a06d(_0x233702);})['catch'](function(_0x1b8065){logger[_0x3801('0x1b')]('CreateWhatsappMessage',_0x1b8065['message'],_0x4d9df7);_0x372aa1(_0x22f014[_0x3801('0x1b')](0x1f4,_0x1b8065['message']));});});}; \ No newline at end of file +var _0xfffe=['create','body','options','raw','CreateWhatsappMessage','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./whatsappMessage.socket','register','then','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','WhatsappMessage'];(function(_0x3258d6,_0xeb3608){var _0x2a5efb=function(_0x22fbac){while(--_0x22fbac){_0x3258d6['push'](_0x3258d6['shift']());}};_0x2a5efb(++_0xeb3608);}(_0xfffe,0x1b6));var _0xefff=function(_0x439bcd,_0x2db4fd){_0x439bcd=_0x439bcd-0x0;var _0x1afad4=_0xfffe[_0x439bcd];return _0x1afad4;};'use strict';var _=require('lodash');var util=require(_0xefff('0x0'));var moment=require(_0xefff('0x1'));var BPromise=require(_0xefff('0x2'));var rs=require(_0xefff('0x3'));var fs=require('fs');var Redis=require(_0xefff('0x4'));var db=require(_0xefff('0x5'))['db'];var utils=require(_0xefff('0x6'));var logger=require(_0xefff('0x7'))(_0xefff('0x8'));var config=require('../../config/environment');var jayson=require(_0xefff('0x9'));var client=jayson[_0xefff('0xa')][_0xefff('0xb')]({'port':0x232a});config[_0xefff('0xc')]=_[_0xefff('0xd')](config[_0xefff('0xc')],{'host':_0xefff('0xe'),'port':0x18eb});var socket=require(_0xefff('0xf'))(new Redis(config[_0xefff('0xc')]));require(_0xefff('0x10'))[_0xefff('0x11')](socket);function respondWithRpcPromise(_0x36e6a3,_0x5aad24,_0x48d21f){return new BPromise(function(_0x3870e5,_0x3fe8d2){return client['request'](_0x36e6a3,_0x48d21f)[_0xefff('0x12')](function(_0x24d737){logger[_0xefff('0x13')](_0xefff('0x14'),_0x5aad24,_0xefff('0x15'));logger[_0xefff('0x16')](_0xefff('0x17'),_0x5aad24,_0xefff('0x15'),JSON[_0xefff('0x18')](_0x24d737));if(_0x24d737[_0xefff('0x19')]){if(_0x24d737[_0xefff('0x19')][_0xefff('0x1a')]===0x1f4){logger[_0xefff('0x19')]('WhatsappMessage,\x20%s,\x20%s',_0x5aad24,_0x24d737[_0xefff('0x19')]['message']);return _0x3fe8d2(_0x24d737['error'][_0xefff('0x1b')]);}logger['error'](_0xefff('0x14'),_0x5aad24,_0x24d737[_0xefff('0x19')][_0xefff('0x1b')]);return _0x3870e5(_0x24d737[_0xefff('0x19')][_0xefff('0x1b')]);}else{logger[_0xefff('0x13')](_0xefff('0x14'),_0x5aad24,_0xefff('0x15'));_0x3870e5(_0x24d737[_0xefff('0x1c')]['message']);}})['catch'](function(_0xa611f9){logger['error'](_0xefff('0x14'),_0x5aad24,_0xa611f9);_0x3fe8d2(_0xa611f9);});});}exports['CreateWhatsappMessage']=function(_0x173415){var _0x51b392=this;return new Promise(function(_0x4a2945,_0x30ff94){return db[_0xefff('0x1d')][_0xefff('0x1e')](_0x173415[_0xefff('0x1f')],{'raw':_0x173415[_0xefff('0x20')]?_0x173415['options'][_0xefff('0x21')]===undefined?!![]:![]:!![]})[_0xefff('0x12')](function(_0x16c63b){logger[_0xefff('0x13')]('CreateWhatsappMessage',_0x173415);logger[_0xefff('0x16')](_0xefff('0x22'),_0x173415,JSON[_0xefff('0x18')](_0x16c63b));_0x4a2945(_0x16c63b);})[_0xefff('0x23')](function(_0x11485c){logger[_0xefff('0x19')]('CreateWhatsappMessage',_0x11485c[_0xefff('0x1b')],_0x173415);_0x30ff94(_0x51b392[_0xefff('0x19')](0x1f4,_0x11485c[_0xefff('0x1b')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.socket.js b/server/api/whatsappMessage/whatsappMessage.socket.js index 92044e1..ba8319f 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 _0x5463=['register','whatsappMessage:','./whatsappMessage.events','remove','emit','removeListener'];(function(_0x2de348,_0x403400){var _0x5cb3d3=function(_0x4bd763){while(--_0x4bd763){_0x2de348['push'](_0x2de348['shift']());}};_0x5cb3d3(++_0x403400);}(_0x5463,0xa4));var _0x3546=function(_0x4cbf57,_0x1639e6){_0x4cbf57=_0x4cbf57-0x0;var _0x226e64=_0x5463[_0x4cbf57];return _0x226e64;};'use strict';var WhatsappMessageEvents=require(_0x3546('0x0'));var events=['save',_0x3546('0x1'),'update'];function createListener(_0x2cb651,_0x5b76a4){return function(_0x2a27e5){_0x5b76a4[_0x3546('0x2')](_0x2cb651,_0x2a27e5);};}function removeListener(_0x154c30,_0x1024fb){return function(){WhatsappMessageEvents[_0x3546('0x3')](_0x154c30,_0x1024fb);};}exports[_0x3546('0x4')]=function(_0x369bf4){for(var _0x48ffcb=0x0,_0x2f1762=events['length'];_0x48ffcb<_0x2f1762;_0x48ffcb++){var _0x183951=events[_0x48ffcb];var _0x4a8c29=createListener(_0x3546('0x5')+_0x183951,_0x369bf4);WhatsappMessageEvents['on'](_0x183951,_0x4a8c29);}}; \ No newline at end of file +var _0xb817=['removeListener','whatsappMessage:','save','remove','update','emit'];(function(_0x124d12,_0x2351a1){var _0x54180f=function(_0x1cf6ef){while(--_0x1cf6ef){_0x124d12['push'](_0x124d12['shift']());}};_0x54180f(++_0x2351a1);}(_0xb817,0xb0));var _0x7b81=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb817[_0x3dd15e];return _0x231fd0;};'use strict';var WhatsappMessageEvents=require('./whatsappMessage.events');var events=[_0x7b81('0x0'),_0x7b81('0x1'),_0x7b81('0x2')];function createListener(_0x1558c6,_0x2a2494){return function(_0x393c33){_0x2a2494[_0x7b81('0x3')](_0x1558c6,_0x393c33);};}function removeListener(_0x427491,_0x3a0942){return function(){WhatsappMessageEvents[_0x7b81('0x4')](_0x427491,_0x3a0942);};}exports['register']=function(_0x42db66){for(var _0x59e10b=0x0,_0x3672a5=events['length'];_0x59e10b<_0x3672a5;_0x59e10b++){var _0x5a2f26=events[_0x59e10b];var _0x3ed7e6=createListener(_0x7b81('0x5')+_0x5a2f26,_0x42db66);WhatsappMessageEvents['on'](_0x5a2f26,_0x3ed7e6);}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/index.js b/server/api/whatsappQueue/index.js index d4dbdd7..b2b2613 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 _0x6ec6=['delete','destroy','removeTeams','removeAgents','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./whatsappQueue.controller','get','isAuthenticated','/describe','describe','/:id','/:id/members','getMembers','/:id/teams','getTeams','getAgents','post','create','/:id/users','put','update'];(function(_0x195654,_0x1252db){var _0x5b0eba=function(_0x7422c5){while(--_0x7422c5){_0x195654['push'](_0x195654['shift']());}};_0x5b0eba(++_0x1252db);}(_0x6ec6,0x11d));var _0x66ec=function(_0x137d1d,_0x35c663){_0x137d1d=_0x137d1d-0x0;var _0x485108=_0x6ec6[_0x137d1d];return _0x485108;};'use strict';var multer=require(_0x66ec('0x0'));var util=require('util');var path=require(_0x66ec('0x1'));var timeout=require('connect-timeout');var express=require(_0x66ec('0x2'));var router=express[_0x66ec('0x3')]();var fs_extra=require(_0x66ec('0x4'));var auth=require(_0x66ec('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x66ec('0x6'));var controller=require(_0x66ec('0x7'));router[_0x66ec('0x8')]('/',auth[_0x66ec('0x9')](),controller['index']);router[_0x66ec('0x8')](_0x66ec('0xa'),auth[_0x66ec('0x9')](),controller[_0x66ec('0xb')]);router['get'](_0x66ec('0xc'),auth['isAuthenticated'](),controller['show']);router[_0x66ec('0x8')](_0x66ec('0xd'),auth[_0x66ec('0x9')](),controller[_0x66ec('0xe')]);router[_0x66ec('0x8')](_0x66ec('0xf'),auth[_0x66ec('0x9')](),controller[_0x66ec('0x10')]);router[_0x66ec('0x8')]('/:id/users',auth[_0x66ec('0x9')](),controller[_0x66ec('0x11')]);router[_0x66ec('0x12')]('/',auth[_0x66ec('0x9')](),controller[_0x66ec('0x13')]);router[_0x66ec('0x12')]('/:id/teams',auth[_0x66ec('0x9')](),controller['addTeams']);router[_0x66ec('0x12')](_0x66ec('0x14'),auth[_0x66ec('0x9')](),controller['addAgents']);router[_0x66ec('0x15')]('/:id',auth['isAuthenticated'](),controller[_0x66ec('0x16')]);router[_0x66ec('0x17')](_0x66ec('0xc'),auth[_0x66ec('0x9')](),controller[_0x66ec('0x18')]);router[_0x66ec('0x17')](_0x66ec('0xf'),auth['isAuthenticated'](),controller[_0x66ec('0x19')]);router[_0x66ec('0x17')](_0x66ec('0x14'),auth['isAuthenticated'](),controller[_0x66ec('0x1a')]);module[_0x66ec('0x1b')]=router; \ No newline at end of file +var _0x4b0c=['../../config/environment','./whatsappQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','getMembers','/:id/users','post','create','/:id/teams','addTeams','addAgents','update','destroy','delete','removeAgents','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x476bf4,_0x2a3755){var _0x788ffe=function(_0x13fa11){while(--_0x13fa11){_0x476bf4['push'](_0x476bf4['shift']());}};_0x788ffe(++_0x2a3755);}(_0x4b0c,0xa6));var _0xc4b0=function(_0x3cb7b4,_0x502af2){_0x3cb7b4=_0x3cb7b4-0x0;var _0x2e75f3=_0x4b0c[_0x3cb7b4];return _0x2e75f3;};'use strict';var multer=require(_0xc4b0('0x0'));var util=require(_0xc4b0('0x1'));var path=require(_0xc4b0('0x2'));var timeout=require(_0xc4b0('0x3'));var express=require(_0xc4b0('0x4'));var router=express[_0xc4b0('0x5')]();var fs_extra=require(_0xc4b0('0x6'));var auth=require(_0xc4b0('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xc4b0('0x8'));var controller=require(_0xc4b0('0x9'));router[_0xc4b0('0xa')]('/',auth[_0xc4b0('0xb')](),controller[_0xc4b0('0xc')]);router[_0xc4b0('0xa')](_0xc4b0('0xd'),auth[_0xc4b0('0xb')](),controller[_0xc4b0('0xe')]);router[_0xc4b0('0xa')](_0xc4b0('0xf'),auth['isAuthenticated'](),controller[_0xc4b0('0x10')]);router[_0xc4b0('0xa')]('/:id/members',auth[_0xc4b0('0xb')](),controller[_0xc4b0('0x11')]);router[_0xc4b0('0xa')]('/:id/teams',auth[_0xc4b0('0xb')](),controller['getTeams']);router[_0xc4b0('0xa')](_0xc4b0('0x12'),auth[_0xc4b0('0xb')](),controller['getAgents']);router[_0xc4b0('0x13')]('/',auth['isAuthenticated'](),controller[_0xc4b0('0x14')]);router[_0xc4b0('0x13')](_0xc4b0('0x15'),auth['isAuthenticated'](),controller[_0xc4b0('0x16')]);router[_0xc4b0('0x13')](_0xc4b0('0x12'),auth[_0xc4b0('0xb')](),controller[_0xc4b0('0x17')]);router['put'](_0xc4b0('0xf'),auth['isAuthenticated'](),controller[_0xc4b0('0x18')]);router['delete'](_0xc4b0('0xf'),auth[_0xc4b0('0xb')](),controller[_0xc4b0('0x19')]);router[_0xc4b0('0x1a')]('/:id/teams',auth['isAuthenticated'](),controller['removeTeams']);router['delete'](_0xc4b0('0x12'),auth['isAuthenticated'](),controller[_0xc4b0('0x1b')]);module[_0xc4b0('0x1c')]=router; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.attributes.js b/server/api/whatsappQueue/whatsappQueue.attributes.js index f6d9d69..e1823c9 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 _0x7eb9=['roundrobin','sequelize','name','ENUM','rrmemory','beepall'];(function(_0x4c098e,_0x251a5e){var _0x3e001c=function(_0x41fd9d){while(--_0x41fd9d){_0x4c098e['push'](_0x4c098e['shift']());}};_0x3e001c(++_0x251a5e);}(_0x7eb9,0xd9));var _0x97eb=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x7eb9[_0x17d9e3];return _0x14192d;};'use strict';var Sequelize=require(_0x97eb('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x97eb('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x97eb('0x2')](_0x97eb('0x3'),_0x97eb('0x4'),_0x97eb('0x5'))},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x7ae7=['STRING','sequelize','exports','name','INTEGER','ENUM','rrmemory','beepall','roundrobin'];(function(_0x3d84d0,_0x35f402){var _0x2beaa7=function(_0x4e31c8){while(--_0x4e31c8){_0x3d84d0['push'](_0x3d84d0['shift']());}};_0x2beaa7(++_0x35f402);}(_0x7ae7,0xd9));var _0x77ae=function(_0x8a9bbd,_0x488163){_0x8a9bbd=_0x8a9bbd-0x0;var _0x426359=_0x7ae7[_0x8a9bbd];return _0x426359;};'use strict';var Sequelize=require(_0x77ae('0x0'));module[_0x77ae('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x77ae('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0x77ae('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x77ae('0x4')](_0x77ae('0x5'),_0x77ae('0x6'),_0x77ae('0x7'))},'description':{'type':Sequelize[_0x77ae('0x8')]}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.controller.js b/server/api/whatsappQueue/whatsappQueue.controller.js index c22f6b1..1029995 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 _0x52c5=['update','then','destroy','get','UserProfileResource','error','stack','name','send','map','WhatsappQueue','type','key','getOptions','where','include','query','rows','catch','model','keys','rawAttributes','filters','intersection','fields','attributes','length','merge','options','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','body','params','getMembers','UserWhatsappQueue','hasOwnProperty','order','sort','pick','WhatsappQueueId','filter','findAll','User','findAndCountAll','UserId','agent','whatsappPause','createdAt','%s/%s','updatedAt','findOne','Team','getTeams','Agents','online','voicePause','interface','flatMap','transaction','addTeams','each','findOrCreate','forEach','removeTeams','ids','select','field','tq.TeamId','team_has_whatsapp_queues','ut.TeamId\x20=\x20tq.TeamId','WhatsappQueueId\x20=\x20?','push','sequelize','QueryTypes','every','TeamId','includes','all','compact','value','addAgents','omit','spread','emit','userWhatsappQueue:save','removeAgents','userWhatsappQueue:remove','getAgents','util','lodash','ioredis','../../components/parsers/qs','../../config/logger','../../config/environment','redis','socket.io-emitter','./whatsappQueue.socket','register','sendStatus','end','status','json','undefined','limit','count','offset','set'];(function(_0x4b6507,_0x5518b5){var _0x2001ec=function(_0x330ddf){while(--_0x330ddf){_0x4b6507['push'](_0x4b6507['shift']());}};_0x2001ec(++_0x5518b5);}(_0x52c5,0x140));var _0x552c=function(_0x2112d4,_0x3c863c){_0x2112d4=_0x2112d4-0x0;var _0x434972=_0x52c5[_0x2112d4];return _0x434972;};'use strict';var BPromise=require('bluebird');var util=require(_0x552c('0x0'));var _=require(_0x552c('0x1'));var squel=require('squel');var Redis=require(_0x552c('0x2'));var qs=require(_0x552c('0x3'));var logger=require(_0x552c('0x4'))('api');var config=require(_0x552c('0x5'));var db=require('../../mysqldb')['db'];config[_0x552c('0x6')]=_['defaults'](config[_0x552c('0x6')],{'host':'localhost','port':0x18eb});var socket=require(_0x552c('0x7'))(new Redis(config[_0x552c('0x6')]));require(_0x552c('0x8'))[_0x552c('0x9')](socket);function respondWithStatusCode(_0x409240,_0x3f364b){_0x3f364b=_0x3f364b||0xcc;return function(_0x18d4f0){if(_0x18d4f0){return _0x409240[_0x552c('0xa')](_0x3f364b);}return _0x409240['status'](_0x3f364b)[_0x552c('0xb')]();};}function respondWithResult(_0x1cdc13,_0x3cf049){_0x3cf049=_0x3cf049||0xc8;return function(_0x2a4de9){if(_0x2a4de9){return _0x1cdc13[_0x552c('0xc')](_0x3cf049)[_0x552c('0xd')](_0x2a4de9);}};}function respondWithFilteredResult(_0x12126a,_0x11ea38){return function(_0x4bd625){if(_0x4bd625){var _0x3ea1e0=typeof _0x11ea38['offset']===_0x552c('0xe')&&typeof _0x11ea38[_0x552c('0xf')]==='undefined';var _0x2300f2=_0x4bd625[_0x552c('0x10')];var _0x4b99d7=_0x3ea1e0?0x0:_0x11ea38[_0x552c('0x11')];var _0x47ea3a=_0x3ea1e0?_0x4bd625['count']:_0x11ea38['offset']+_0x11ea38[_0x552c('0xf')];var _0x503f73;if(_0x47ea3a>=_0x2300f2){_0x47ea3a=_0x2300f2;_0x503f73=0xc8;}else{_0x503f73=0xce;}_0x12126a[_0x552c('0xc')](_0x503f73);return _0x12126a[_0x552c('0x12')]('Content-Range',_0x4b99d7+'-'+_0x47ea3a+'/'+_0x2300f2)[_0x552c('0xd')](_0x4bd625);}return null;};}function saveUpdates(_0x5504c3){return function(_0x14719e){if(_0x14719e){return _0x14719e[_0x552c('0x13')](_0x5504c3)[_0x552c('0x14')](function(_0x306240){return _0x306240;});}return null;};}function removeEntity(_0x3f4eef){return function(_0x33b67f){if(_0x33b67f){return _0x33b67f[_0x552c('0x15')]()[_0x552c('0x14')](function(){var _0x2235e3=_0x33b67f[_0x552c('0x16')]({'plain':!![]});var _0x3b0f67='WhatsappQueues';return db[_0x552c('0x17')]['destroy']({'where':{'type':_0x3b0f67,'resourceId':_0x2235e3['id']}})[_0x552c('0x14')](function(){return _0x33b67f;});})['then'](function(){_0x3f4eef[_0x552c('0xc')](0xcc)[_0x552c('0xb')]();});}};}function handleEntityNotFound(_0x4a8872){return function(_0x4f2d4d){if(!_0x4f2d4d){_0x4a8872['sendStatus'](0x194);}return _0x4f2d4d;};}function handleError(_0x3beb32,_0xf75f55){_0xf75f55=_0xf75f55||0x1f4;return function(_0x5837a0){logger[_0x552c('0x18')](_0x5837a0[_0x552c('0x19')]);if(_0x5837a0[_0x552c('0x1a')]){delete _0x5837a0[_0x552c('0x1a')];}_0x3beb32['status'](_0xf75f55)[_0x552c('0x1b')](_0x5837a0);};}exports['index']=function(_0x16d5b7,_0xbd0bd8){var _0x4bee44={};var _0x9f1943={'count':0x0,'rows':[]};var _0x271b05=_[_0x552c('0x1c')](db[_0x552c('0x1d')]['rawAttributes'],function(_0x3029ce){return{'name':_0x3029ce['fieldName'],'type':_0x3029ce[_0x552c('0x1e')][_0x552c('0x1f')]};});_0x4bee44=qs[_0x552c('0x20')](_0x271b05,_0x16d5b7);var _0x5b7df2={'where':_0x4bee44[_0x552c('0x21')]};return db[_0x552c('0x1d')][_0x552c('0x10')](_0x5b7df2)['then'](function(_0x2ccfe8){_0x9f1943['count']=_0x2ccfe8;_0x4bee44['include']=qs[_0x552c('0x22')](_0x16d5b7[_0x552c('0x23')]);return db[_0x552c('0x1d')]['findAll'](_0x4bee44);})['then'](function(_0x49cd0e){_0x9f1943[_0x552c('0x24')]=_0x49cd0e;return _0x9f1943;})[_0x552c('0x14')](respondWithFilteredResult(_0xbd0bd8,_0x4bee44))[_0x552c('0x25')](handleError(_0xbd0bd8,null));};exports['show']=function(_0x33b2b5,_0x47f542){var _0x2b836b={'raw':!![],'where':{'id':_0x33b2b5['params']['id']}},_0x3ff9a6={};_0x3ff9a6[_0x552c('0x26')]=_[_0x552c('0x27')](db[_0x552c('0x1d')][_0x552c('0x28')]);_0x3ff9a6[_0x552c('0x23')]=_[_0x552c('0x27')](_0x33b2b5[_0x552c('0x23')]);_0x3ff9a6[_0x552c('0x29')]=_[_0x552c('0x2a')](_0x3ff9a6['model'],_0x3ff9a6['query']);_0x2b836b['attributes']=_[_0x552c('0x2a')](_0x3ff9a6[_0x552c('0x26')],qs[_0x552c('0x2b')](_0x33b2b5[_0x552c('0x23')][_0x552c('0x2b')]));_0x2b836b[_0x552c('0x2c')]=_0x2b836b[_0x552c('0x2c')][_0x552c('0x2d')]?_0x2b836b['attributes']:_0x3ff9a6[_0x552c('0x26')];if(_0x33b2b5[_0x552c('0x23')]['includeAll']){_0x2b836b[_0x552c('0x22')]=[{'all':!![]}];}_0x2b836b=_[_0x552c('0x2e')]({},_0x2b836b,_0x33b2b5[_0x552c('0x2f')]);return db[_0x552c('0x1d')][_0x552c('0x30')](_0x2b836b)[_0x552c('0x14')](handleEntityNotFound(_0x47f542,null))[_0x552c('0x14')](respondWithResult(_0x47f542,null))[_0x552c('0x25')](handleError(_0x47f542,null));};exports[_0x552c('0x31')]=function(_0x35105a,_0x3ceeb4){return db['WhatsappQueue'][_0x552c('0x31')](_0x35105a['body'],{})[_0x552c('0x14')](function(_0x14a486){var _0x110b89=_0x35105a[_0x552c('0x32')][_0x552c('0x16')]({'plain':!![]});if(!_0x110b89)throw new Error(_0x552c('0x33'));if(_0x110b89[_0x552c('0x34')]===_0x552c('0x32')){var _0x41122b=_0x14a486[_0x552c('0x16')]({'plain':!![]});var _0x18f321='WhatsappQueues';return db[_0x552c('0x35')][_0x552c('0x30')]({'where':{'name':_0x18f321,'userProfileId':_0x110b89[_0x552c('0x36')]},'raw':!![]})[_0x552c('0x14')](function(_0x17ca8c){if(_0x17ca8c&&_0x17ca8c[_0x552c('0x37')]===0x0){return db[_0x552c('0x17')]['create']({'name':_0x41122b[_0x552c('0x1a')],'resourceId':_0x41122b['id'],'type':_0x17ca8c[_0x552c('0x1a')],'sectionId':_0x17ca8c['id']},{})[_0x552c('0x14')](function(){return _0x14a486;});}else{return _0x14a486;}})[_0x552c('0x25')](function(_0x4422d1){logger[_0x552c('0x18')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4422d1);throw _0x4422d1;});}return _0x14a486;})[_0x552c('0x14')](respondWithResult(_0x3ceeb4,0xc9))[_0x552c('0x25')](handleError(_0x3ceeb4,null));};exports[_0x552c('0x13')]=function(_0x308e79,_0xcbdf90){if(_0x308e79[_0x552c('0x38')]['id']){delete _0x308e79[_0x552c('0x38')]['id'];}return db['WhatsappQueue']['find']({'where':{'id':_0x308e79[_0x552c('0x39')]['id']}})[_0x552c('0x14')](handleEntityNotFound(_0xcbdf90,null))[_0x552c('0x14')](saveUpdates(_0x308e79[_0x552c('0x38')],null))[_0x552c('0x14')](respondWithResult(_0xcbdf90,null))[_0x552c('0x25')](handleError(_0xcbdf90,null));};exports[_0x552c('0x15')]=function(_0x2d7426,_0x1cfb18){return db[_0x552c('0x1d')]['find']({'where':{'id':_0x2d7426[_0x552c('0x39')]['id']}})['then'](handleEntityNotFound(_0x1cfb18,null))[_0x552c('0x14')](removeEntity(_0x1cfb18,null))[_0x552c('0x25')](handleError(_0x1cfb18,null));};exports['describe']=function(_0x41a1db,_0x38c614){return db[_0x552c('0x1d')]['describe']()[_0x552c('0x14')](respondWithResult(_0x38c614,null))['catch'](handleError(_0x38c614,null));};exports[_0x552c('0x3a')]=function(_0x5aae28,_0x5d33f0){var _0x2e5ffb={'raw':!![],'where':{}},_0x47871a={},_0x1e9da0;return db[_0x552c('0x1d')]['findOne']({'where':{'id':_0x5aae28[_0x552c('0x39')]['id']}})[_0x552c('0x14')](handleEntityNotFound(_0x5d33f0,null))['then'](function(_0x41bd6a){if(_0x41bd6a){_0x1e9da0=_0x41bd6a['get']({'plain':!![]});_0x47871a['model']=_['keys'](db[_0x552c('0x3b')][_0x552c('0x28')]);_0x47871a['query']=_['keys'](_0x5aae28['query']);_0x47871a['filters']=_[_0x552c('0x2a')](_0x47871a[_0x552c('0x26')],_0x47871a[_0x552c('0x23')]);_0x2e5ffb['attributes']=_[_0x552c('0x2a')](_0x47871a['model'],qs[_0x552c('0x2b')](_0x5aae28[_0x552c('0x23')][_0x552c('0x2b')]));_0x2e5ffb[_0x552c('0x2c')]=_0x2e5ffb['attributes'][_0x552c('0x2d')]?_0x2e5ffb['attributes']:_0x47871a['model'];if(!_0x5aae28[_0x552c('0x23')][_0x552c('0x3c')]('nolimit')){_0x2e5ffb[_0x552c('0xf')]=qs[_0x552c('0xf')](_0x5aae28['query'][_0x552c('0xf')]);_0x2e5ffb[_0x552c('0x11')]=qs[_0x552c('0x11')](_0x5aae28[_0x552c('0x23')]['offset']);}_0x2e5ffb[_0x552c('0x3d')]=qs[_0x552c('0x3e')](_0x5aae28[_0x552c('0x23')][_0x552c('0x3e')]);_0x2e5ffb[_0x552c('0x21')]=qs[_0x552c('0x29')](_[_0x552c('0x3f')](_0x5aae28[_0x552c('0x23')],_0x47871a[_0x552c('0x29')]));_0x2e5ffb[_0x552c('0x21')][_0x552c('0x40')]=_0x41bd6a['id'];if(_0x5aae28[_0x552c('0x23')][_0x552c('0x41')]){_0x2e5ffb['where']=_[_0x552c('0x2e')](_0x2e5ffb[_0x552c('0x21')],{'$or':_[_0x552c('0x1c')](_0x2e5ffb[_0x552c('0x2c')],function(_0x2fb2f1){var _0x264f0d={};_0x264f0d[_0x2fb2f1]={'$like':'%'+_0x5aae28['query'][_0x552c('0x41')]+'%'};return _0x264f0d;})});}_0x2e5ffb=_['merge']({},_0x2e5ffb,_0x5aae28[_0x552c('0x2f')]);return db[_0x552c('0x3b')][_0x552c('0x42')](_0x2e5ffb);}})[_0x552c('0x14')](function(_0x11f899){if(_0x11f899){return db[_0x552c('0x43')][_0x552c('0x44')]({'where':{'id':_[_0x552c('0x1c')](_0x11f899,_0x552c('0x45')),'role':_0x552c('0x46')},'attributes':['id',_0x552c('0x1a'),_0x552c('0x47'),'updatedAt',_0x552c('0x48')]});}})[_0x552c('0x14')](function(_0x345283){if(_0x345283){return{'count':_0x345283[_0x552c('0x10')],'rows':_[_0x552c('0x1c')](_0x345283[_0x552c('0x24')],function(_0x1f1808){return{'membername':_0x1f1808['name'],'UserId':_0x1f1808['id'],'queue_name':_0x1e9da0[_0x552c('0x1a')],'WhatsappQueueId':_0x1e9da0['id'],'interface':util['format'](_0x552c('0x49'),'SIP',_0x1f1808[_0x552c('0x1a')]),'penalty':0x0,'paused':_0x1f1808[_0x552c('0x47')],'createdAt':_0x1f1808[_0x552c('0x48')],'updatedAt':_0x1f1808[_0x552c('0x4a')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x552c('0x14')](respondWithFilteredResult(_0x5d33f0,_0x2e5ffb))[_0x552c('0x25')](handleError(_0x5d33f0,null));};exports['getTeams']=function(_0x27331e,_0x2e8aaf){var _0x140df7={};var _0x193b6d={};var _0x1a8849;var _0x1c5ce3;return db[_0x552c('0x1d')][_0x552c('0x4b')]({'where':{'id':_0x27331e[_0x552c('0x39')]['id']}})[_0x552c('0x14')](handleEntityNotFound(_0x2e8aaf,null))['then'](function(_0x1aab9f){if(_0x1aab9f){_0x1a8849=_0x1aab9f;_0x193b6d[_0x552c('0x26')]=_[_0x552c('0x27')](db[_0x552c('0x4c')][_0x552c('0x28')]);_0x193b6d['query']=_[_0x552c('0x27')](_0x27331e['query']);_0x193b6d[_0x552c('0x29')]=_['intersection'](_0x193b6d['model'],_0x193b6d['query']);_0x140df7['attributes']=_[_0x552c('0x2a')](_0x193b6d[_0x552c('0x26')],qs[_0x552c('0x2b')](_0x27331e[_0x552c('0x23')][_0x552c('0x2b')]));_0x140df7['attributes']=_0x140df7['attributes'][_0x552c('0x2d')]?_0x140df7[_0x552c('0x2c')]:_0x193b6d[_0x552c('0x26')];_0x140df7['order']=qs[_0x552c('0x3e')](_0x27331e[_0x552c('0x23')][_0x552c('0x3e')]);_0x140df7[_0x552c('0x21')]=qs[_0x552c('0x29')](_[_0x552c('0x3f')](_0x27331e[_0x552c('0x23')],_0x193b6d[_0x552c('0x29')]));if(_0x27331e[_0x552c('0x23')]['filter']){_0x140df7['where']=_['merge'](_0x140df7[_0x552c('0x21')],{'$or':_[_0x552c('0x1c')](_0x140df7['attributes'],function(_0x350850){var _0x23c5f0={};_0x23c5f0[_0x350850]={'$like':'%'+_0x27331e[_0x552c('0x23')][_0x552c('0x41')]+'%'};return _0x23c5f0;})});}_0x140df7=_[_0x552c('0x2e')]({},_0x140df7,_0x27331e[_0x552c('0x2f')]);return _0x1a8849[_0x552c('0x4d')](_0x140df7);}})[_0x552c('0x14')](function(_0x5cae39){if(_0x5cae39){_0x1c5ce3=_0x5cae39[_0x552c('0x2d')];if(!_0x27331e['query'][_0x552c('0x3c')]('nolimit')){_0x140df7['limit']=qs[_0x552c('0xf')](_0x27331e['query']['limit']);_0x140df7['offset']=qs['offset'](_0x27331e[_0x552c('0x23')][_0x552c('0x11')]);}return _0x1a8849[_0x552c('0x4d')](_0x140df7);}})['then'](function(_0x349f85){if(_0x349f85){return _0x349f85?{'count':_0x1c5ce3,'rows':_0x349f85}:null;}})[_0x552c('0x14')](respondWithResult(_0x2e8aaf,null))[_0x552c('0x25')](handleError(_0x2e8aaf,null));};exports['addTeams']=function(_0x3618da,_0x32b3f8){var _0x84ca19=_0x3618da[_0x552c('0x38')]['ids'];return db['Team'][_0x552c('0x42')]({'where':{'id':_0x84ca19},'attributes':['id'],'include':[{'model':db[_0x552c('0x43')],'as':_0x552c('0x4e'),'attributes':['id',_0x552c('0x1a'),_0x552c('0x4f'),_0x552c('0x50'),_0x552c('0x51')],'raw':!![]}]})[_0x552c('0x14')](function(_0x1e3478){if(_0x1e3478){var _0x5829b9=_[_0x552c('0x52')](_0x1e3478,function(_0x192df4){var _0xde3ec5=_0x192df4[_0x552c('0x16')]({'plain':!![]});return _0xde3ec5[_0x552c('0x4e')];});return db['WhatsappQueue'][_0x552c('0x30')]({'where':{'id':_0x3618da[_0x552c('0x39')]['id']}})[_0x552c('0x14')](function(_0x111d2e){return db['sequelize'][_0x552c('0x53')](function(_0x5cbde3){return _0x111d2e[_0x552c('0x54')](_0x84ca19,{'transaction':_0x5cbde3})['then'](function(){return BPromise[_0x552c('0x55')](_0x5829b9,function(_0xbda14f){return db[_0x552c('0x3b')][_0x552c('0x56')]({'where':{'UserId':_0xbda14f['id'],'WhatsappQueueId':_0x3618da[_0x552c('0x39')]['id']},'transaction':_0x5cbde3});});})[_0x552c('0x14')](function(){_0x5829b9[_0x552c('0x57')](function(_0x32e7f6){socket['emit']('userWhatsappQueue:save',{'UserId':_0x32e7f6['id'],'WhatsappQueueId':_0x111d2e['id']});});});});});}})['then'](respondWithStatusCode(_0x32b3f8,null))[_0x552c('0x25')](handleError(_0x32b3f8,null));};exports[_0x552c('0x58')]=function(_0x16b08d,_0x352a6b){return db[_0x552c('0x4c')][_0x552c('0x42')]({'where':{'id':_0x16b08d['query'][_0x552c('0x59')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x552c('0x4e'),'attributes':['id'],'raw':!![]}]})[_0x552c('0x14')](handleEntityNotFound(_0x352a6b,null))['then'](function(_0x25f3b3){var _0x4d1d64=_[_0x552c('0x1c')](_0x25f3b3,'id');var _0x16ac5c=[];var _0x2860a9=[];var _0x443586=squel[_0x552c('0x5a')]();_0x443586[_0x552c('0x5b')](_0x552c('0x5c'))['from'](_0x552c('0x5d'),'tq')['join']('user_has_teams','ut',_0x552c('0x5e'))[_0x552c('0x21')](_0x552c('0x5f'),_0x16b08d[_0x552c('0x39')]['id']);for(var _0x18e244=0x0;_0x18e244<_0x25f3b3[_0x552c('0x2d')];_0x18e244+=0x1){let _0x42446c=_0x25f3b3[_0x18e244];for(var _0x2dce0a=0x0;_0x2dce0a<_0x42446c['Agents']['length'];_0x2dce0a+=0x1){let _0x50cc3e=_0x42446c[_0x552c('0x4e')][_0x2dce0a];var _0x102ecd=_0x443586['clone']();_0x102ecd['where']('ut.UserId\x20=\x20?',_0x50cc3e['id']);_0x2860a9[_0x552c('0x60')](db['sequelize'][_0x552c('0x23')](_0x102ecd['toString'](),{'type':db[_0x552c('0x61')][_0x552c('0x62')]['SELECT']})[_0x552c('0x14')](function(_0x5db436){if(_0x5db436[_0x552c('0x2d')]===0x1){return _0x50cc3e['id'];}else{var _0x960e72=_[_0x552c('0x63')](_[_0x552c('0x1c')](_0x5db436,_0x552c('0x64')),function(_0x110fdd){return _[_0x552c('0x65')](_0x4d1d64,_0x110fdd);});if(_0x960e72){return _0x50cc3e['id'];}}}));}}return BPromise[_0x552c('0x66')](_0x2860a9)[_0x552c('0x14')](function(_0x10b455){_0x16ac5c=_(_0x16ac5c)['union'](_0x10b455)[_0x552c('0x67')]()[_0x552c('0x68')]();return db['WhatsappQueue'][_0x552c('0x30')]({'where':{'id':_0x16b08d['params']['id']}})[_0x552c('0x14')](function(_0xe43c47){return db[_0x552c('0x61')]['transaction'](function(_0x4a4398){return _0xe43c47[_0x552c('0x58')](_0x16b08d['query'][_0x552c('0x59')],{'transaction':_0x4a4398})[_0x552c('0x14')](function(){if(!_['isEmpty'](_0x16ac5c)){return _0xe43c47['removeAgents'](_0x16ac5c,{'transaction':_0x4a4398});}})[_0x552c('0x14')](function(){_0x16ac5c[_0x552c('0x57')](function(_0x2673a0){socket['emit']('userWhatsappQueue:remove',{'UserId':_0x2673a0,'WhatsappQueueId':_0xe43c47['id']});});});});});});})['then'](respondWithStatusCode(_0x352a6b,null))[_0x552c('0x25')](handleError(_0x352a6b,null));};exports[_0x552c('0x69')]=function(_0x5dcdc7,_0x54cc85){return db[_0x552c('0x1d')]['find']({'where':{'id':_0x5dcdc7[_0x552c('0x39')]['id']}})[_0x552c('0x14')](handleEntityNotFound(_0x54cc85,null))[_0x552c('0x14')](function(_0x32a290){if(_0x32a290){return _0x32a290[_0x552c('0x69')](_0x5dcdc7[_0x552c('0x38')][_0x552c('0x59')],_[_0x552c('0x6a')](_0x5dcdc7[_0x552c('0x38')],[_0x552c('0x59'),'id'])||{})[_0x552c('0x6b')](function(_0x2798d0){for(var _0x7ddb38=0x0;_0x7ddb38<_0x5dcdc7[_0x552c('0x38')][_0x552c('0x59')][_0x552c('0x2d')];_0x7ddb38+=0x1){socket[_0x552c('0x6c')](_0x552c('0x6d'),{'UserId':Number(_0x5dcdc7['body']['ids'][_0x7ddb38]),'WhatsappQueueId':Number(_0x5dcdc7[_0x552c('0x39')]['id'])});}return _0x2798d0;});}})[_0x552c('0x14')](respondWithResult(_0x54cc85,null))[_0x552c('0x25')](handleError(_0x54cc85,null));};exports['removeAgents']=function(_0x1d0dd6,_0x49e456){return db[_0x552c('0x1d')][_0x552c('0x30')]({'where':{'id':_0x1d0dd6[_0x552c('0x39')]['id']}})[_0x552c('0x14')](handleEntityNotFound(_0x49e456,null))[_0x552c('0x14')](function(_0x2c73de){if(_0x2c73de){return _0x2c73de[_0x552c('0x6e')](_0x1d0dd6[_0x552c('0x23')][_0x552c('0x59')])[_0x552c('0x14')](function(){if(_['isArray'](_0x1d0dd6['query'][_0x552c('0x59')])){for(var _0xd0da8a=0x0;_0xd0da8a<_0x1d0dd6[_0x552c('0x23')][_0x552c('0x59')][_0x552c('0x2d')];_0xd0da8a+=0x1){socket['emit'](_0x552c('0x6f'),{'UserId':Number(_0x1d0dd6[_0x552c('0x23')]['ids'][_0xd0da8a]),'WhatsappQueueId':Number(_0x1d0dd6['params']['id'])});}}else{socket[_0x552c('0x6c')](_0x552c('0x6f'),{'UserId':Number(_0x1d0dd6[_0x552c('0x23')]['ids']),'WhatsappQueueId':Number(_0x1d0dd6['params']['id'])});}});}})[_0x552c('0x14')](respondWithStatusCode(_0x49e456,null))[_0x552c('0x25')](handleError(_0x49e456,null));};exports['getAgents']=function(_0x335d20,_0x567f38){var _0x20d914={};var _0x5bb5e8={};var _0x1da51e;var _0x46c179;return db[_0x552c('0x1d')][_0x552c('0x4b')]({'where':{'id':_0x335d20[_0x552c('0x39')]['id']}})[_0x552c('0x14')](handleEntityNotFound(_0x567f38,null))[_0x552c('0x14')](function(_0x46ecb8){if(_0x46ecb8){_0x1da51e=_0x46ecb8;_0x5bb5e8[_0x552c('0x26')]=_[_0x552c('0x27')](db[_0x552c('0x43')][_0x552c('0x28')]);_0x5bb5e8[_0x552c('0x23')]=_[_0x552c('0x27')](_0x335d20[_0x552c('0x23')]);_0x5bb5e8[_0x552c('0x29')]=_[_0x552c('0x2a')](_0x5bb5e8[_0x552c('0x26')],_0x5bb5e8['query']);_0x20d914[_0x552c('0x2c')]=_[_0x552c('0x2a')](_0x5bb5e8[_0x552c('0x26')],qs['fields'](_0x335d20['query']['fields']));_0x20d914[_0x552c('0x2c')]=_0x20d914[_0x552c('0x2c')][_0x552c('0x2d')]?_0x20d914[_0x552c('0x2c')]:_0x5bb5e8[_0x552c('0x26')];_0x20d914[_0x552c('0x3d')]=qs[_0x552c('0x3e')](_0x335d20[_0x552c('0x23')][_0x552c('0x3e')]);_0x20d914[_0x552c('0x21')]=qs[_0x552c('0x29')](_['pick'](_0x335d20[_0x552c('0x23')],_0x5bb5e8[_0x552c('0x29')]));if(_0x335d20[_0x552c('0x23')]['filter']){_0x20d914['where']=_[_0x552c('0x2e')](_0x20d914[_0x552c('0x21')],{'$or':_[_0x552c('0x1c')](_0x20d914['attributes'],function(_0x5c14b9){var _0xd82feb={};_0xd82feb[_0x5c14b9]={'$like':'%'+_0x335d20[_0x552c('0x23')]['filter']+'%'};return _0xd82feb;})});}_0x20d914=_['merge']({},_0x20d914,_0x335d20[_0x552c('0x2f')]);return _0x1da51e['getAgents'](_0x20d914);}})[_0x552c('0x14')](function(_0x493cca){if(_0x493cca){_0x46c179=_0x493cca[_0x552c('0x2d')];if(!_0x335d20[_0x552c('0x23')][_0x552c('0x3c')]('nolimit')){_0x20d914[_0x552c('0xf')]=qs[_0x552c('0xf')](_0x335d20['query'][_0x552c('0xf')]);_0x20d914[_0x552c('0x11')]=qs['offset'](_0x335d20['query']['offset']);}return _0x1da51e[_0x552c('0x70')](_0x20d914);}})[_0x552c('0x14')](function(_0x58c3a4){if(_0x58c3a4){return _0x58c3a4?{'count':_0x46c179,'rows':_0x58c3a4}:null;}})['then'](respondWithResult(_0x567f38,null))[_0x552c('0x25')](handleError(_0x567f38,null));}; \ No newline at end of file +var _0x5557=['WhatsappQueueId\x20=\x20?','push','toString','QueryTypes','SELECT','every','includes','all','compact','value','isEmpty','removeAgents','forEach','userWhatsappQueue:remove','addAgents','omit','spread','isArray','getAgents','order','lodash','squel','../../components/parsers/qs','api','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./whatsappQueue.socket','register','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','update','then','destroy','get','WhatsappQueues','UserProfileResource','error','stack','name','index','map','WhatsappQueue','rawAttributes','key','where','include','query','findAll','catch','show','model','filters','intersection','attributes','fields','length','includeAll','merge','options','find','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','findOne','keys','UserWhatsappQueue','nolimit','sort','pick','WhatsappQueueId','filter','findAndCountAll','UserId','agent','whatsappPause','updatedAt','createdAt','rows','format','%s/%s','SIP','getTeams','hasOwnProperty','ids','Team','User','Agents','online','interface','flatMap','sequelize','transaction','each','findOrCreate','emit','userWhatsappQueue:save','removeTeams','select','tq.TeamId','from','team_has_whatsapp_queues','join'];(function(_0x2deec1,_0x2e1180){var _0x2d6053=function(_0x3b0d96){while(--_0x3b0d96){_0x2deec1['push'](_0x2deec1['shift']());}};_0x2d6053(++_0x2e1180);}(_0x5557,0x104));var _0x7555=function(_0x532572,_0x4abe2e){_0x532572=_0x532572-0x0;var _0x5603e7=_0x5557[_0x532572];return _0x5603e7;};'use strict';var BPromise=require('bluebird');var util=require('util');var _=require(_0x7555('0x0'));var squel=require(_0x7555('0x1'));var Redis=require('ioredis');var qs=require(_0x7555('0x2'));var logger=require('../../config/logger')(_0x7555('0x3'));var config=require(_0x7555('0x4'));var db=require(_0x7555('0x5'))['db'];config['redis']=_['defaults'](config[_0x7555('0x6')],{'host':_0x7555('0x7'),'port':0x18eb});var socket=require(_0x7555('0x8'))(new Redis(config[_0x7555('0x6')]));require(_0x7555('0x9'))[_0x7555('0xa')](socket);function respondWithStatusCode(_0x2f773f,_0x21160c){_0x21160c=_0x21160c||0xcc;return function(_0x5d9e0d){if(_0x5d9e0d){return _0x2f773f[_0x7555('0xb')](_0x21160c);}return _0x2f773f[_0x7555('0xc')](_0x21160c)[_0x7555('0xd')]();};}function respondWithResult(_0x1587b8,_0x5cc892){_0x5cc892=_0x5cc892||0xc8;return function(_0x45f34a){if(_0x45f34a){return _0x1587b8['status'](_0x5cc892)['json'](_0x45f34a);}};}function respondWithFilteredResult(_0x4a970d,_0x4c34b4){return function(_0x593dd3){if(_0x593dd3){var _0x534a35=typeof _0x4c34b4[_0x7555('0xe')]===_0x7555('0xf')&&typeof _0x4c34b4['limit']==='undefined';var _0xd2a624=_0x593dd3[_0x7555('0x10')];var _0x3ff138=_0x534a35?0x0:_0x4c34b4['offset'];var _0x346c4a=_0x534a35?_0x593dd3[_0x7555('0x10')]:_0x4c34b4[_0x7555('0xe')]+_0x4c34b4[_0x7555('0x11')];var _0x58a125;if(_0x346c4a>=_0xd2a624){_0x346c4a=_0xd2a624;_0x58a125=0xc8;}else{_0x58a125=0xce;}_0x4a970d[_0x7555('0xc')](_0x58a125);return _0x4a970d[_0x7555('0x12')](_0x7555('0x13'),_0x3ff138+'-'+_0x346c4a+'/'+_0xd2a624)[_0x7555('0x14')](_0x593dd3);}return null;};}function saveUpdates(_0x246f1c){return function(_0x40c72f){if(_0x40c72f){return _0x40c72f[_0x7555('0x15')](_0x246f1c)[_0x7555('0x16')](function(_0x36f4ca){return _0x36f4ca;});}return null;};}function removeEntity(_0x3721c6){return function(_0x228501){if(_0x228501){return _0x228501[_0x7555('0x17')]()[_0x7555('0x16')](function(){var _0x502ca1=_0x228501[_0x7555('0x18')]({'plain':!![]});var _0x21d77a=_0x7555('0x19');return db[_0x7555('0x1a')][_0x7555('0x17')]({'where':{'type':_0x21d77a,'resourceId':_0x502ca1['id']}})['then'](function(){return _0x228501;});})[_0x7555('0x16')](function(){_0x3721c6['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x36a4f1){return function(_0x6ed4fa){if(!_0x6ed4fa){_0x36a4f1['sendStatus'](0x194);}return _0x6ed4fa;};}function handleError(_0x1d4d58,_0x3a38d4){_0x3a38d4=_0x3a38d4||0x1f4;return function(_0x23c666){logger[_0x7555('0x1b')](_0x23c666[_0x7555('0x1c')]);if(_0x23c666['name']){delete _0x23c666[_0x7555('0x1d')];}_0x1d4d58[_0x7555('0xc')](_0x3a38d4)['send'](_0x23c666);};}exports[_0x7555('0x1e')]=function(_0x5dfe17,_0x430926){var _0x1ab5f6={};var _0x13801c={'count':0x0,'rows':[]};var _0x190165=_[_0x7555('0x1f')](db[_0x7555('0x20')][_0x7555('0x21')],function(_0x4bb4ee){return{'name':_0x4bb4ee['fieldName'],'type':_0x4bb4ee['type'][_0x7555('0x22')]};});_0x1ab5f6=qs['getOptions'](_0x190165,_0x5dfe17);var _0x506658={'where':_0x1ab5f6[_0x7555('0x23')]};return db[_0x7555('0x20')]['count'](_0x506658)[_0x7555('0x16')](function(_0x2c184a){_0x13801c['count']=_0x2c184a;_0x1ab5f6[_0x7555('0x24')]=qs[_0x7555('0x24')](_0x5dfe17[_0x7555('0x25')]);return db[_0x7555('0x20')][_0x7555('0x26')](_0x1ab5f6);})[_0x7555('0x16')](function(_0x2d6977){_0x13801c['rows']=_0x2d6977;return _0x13801c;})[_0x7555('0x16')](respondWithFilteredResult(_0x430926,_0x1ab5f6))[_0x7555('0x27')](handleError(_0x430926,null));};exports[_0x7555('0x28')]=function(_0x417985,_0x29e01b){var _0x4faa87={'raw':!![],'where':{'id':_0x417985['params']['id']}},_0x2f7db6={};_0x2f7db6[_0x7555('0x29')]=_['keys'](db[_0x7555('0x20')][_0x7555('0x21')]);_0x2f7db6[_0x7555('0x25')]=_['keys'](_0x417985[_0x7555('0x25')]);_0x2f7db6[_0x7555('0x2a')]=_[_0x7555('0x2b')](_0x2f7db6['model'],_0x2f7db6[_0x7555('0x25')]);_0x4faa87[_0x7555('0x2c')]=_[_0x7555('0x2b')](_0x2f7db6[_0x7555('0x29')],qs[_0x7555('0x2d')](_0x417985[_0x7555('0x25')][_0x7555('0x2d')]));_0x4faa87['attributes']=_0x4faa87[_0x7555('0x2c')][_0x7555('0x2e')]?_0x4faa87['attributes']:_0x2f7db6[_0x7555('0x29')];if(_0x417985[_0x7555('0x25')][_0x7555('0x2f')]){_0x4faa87['include']=[{'all':!![]}];}_0x4faa87=_[_0x7555('0x30')]({},_0x4faa87,_0x417985[_0x7555('0x31')]);return db['WhatsappQueue'][_0x7555('0x32')](_0x4faa87)['then'](handleEntityNotFound(_0x29e01b,null))[_0x7555('0x16')](respondWithResult(_0x29e01b,null))[_0x7555('0x27')](handleError(_0x29e01b,null));};exports[_0x7555('0x33')]=function(_0x3b5768,_0x3fc726){return db['WhatsappQueue']['create'](_0x3b5768[_0x7555('0x34')],{})[_0x7555('0x16')](function(_0x4a4d6f){var _0x42155e=_0x3b5768[_0x7555('0x35')][_0x7555('0x18')]({'plain':!![]});if(!_0x42155e)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x42155e[_0x7555('0x36')]===_0x7555('0x35')){var _0xf589d=_0x4a4d6f[_0x7555('0x18')]({'plain':!![]});var _0x4e6f31=_0x7555('0x19');return db[_0x7555('0x37')][_0x7555('0x32')]({'where':{'name':_0x4e6f31,'userProfileId':_0x42155e[_0x7555('0x38')]},'raw':!![]})['then'](function(_0x8fa52b){if(_0x8fa52b&&_0x8fa52b[_0x7555('0x39')]===0x0){return db[_0x7555('0x1a')][_0x7555('0x33')]({'name':_0xf589d[_0x7555('0x1d')],'resourceId':_0xf589d['id'],'type':_0x8fa52b[_0x7555('0x1d')],'sectionId':_0x8fa52b['id']},{})[_0x7555('0x16')](function(){return _0x4a4d6f;});}else{return _0x4a4d6f;}})[_0x7555('0x27')](function(_0x2fa62e){logger[_0x7555('0x1b')](_0x7555('0x3a'),_0x2fa62e);throw _0x2fa62e;});}return _0x4a4d6f;})[_0x7555('0x16')](respondWithResult(_0x3fc726,0xc9))[_0x7555('0x27')](handleError(_0x3fc726,null));};exports[_0x7555('0x15')]=function(_0x5114ea,_0xcaa64b){if(_0x5114ea[_0x7555('0x34')]['id']){delete _0x5114ea['body']['id'];}return db['WhatsappQueue'][_0x7555('0x32')]({'where':{'id':_0x5114ea[_0x7555('0x3b')]['id']}})[_0x7555('0x16')](handleEntityNotFound(_0xcaa64b,null))[_0x7555('0x16')](saveUpdates(_0x5114ea[_0x7555('0x34')],null))[_0x7555('0x16')](respondWithResult(_0xcaa64b,null))['catch'](handleError(_0xcaa64b,null));};exports[_0x7555('0x17')]=function(_0x55f869,_0x52ee45){return db[_0x7555('0x20')][_0x7555('0x32')]({'where':{'id':_0x55f869[_0x7555('0x3b')]['id']}})[_0x7555('0x16')](handleEntityNotFound(_0x52ee45,null))[_0x7555('0x16')](removeEntity(_0x52ee45,null))[_0x7555('0x27')](handleError(_0x52ee45,null));};exports[_0x7555('0x3c')]=function(_0x4e4070,_0x65880d){return db[_0x7555('0x20')][_0x7555('0x3c')]()[_0x7555('0x16')](respondWithResult(_0x65880d,null))['catch'](handleError(_0x65880d,null));};exports['getMembers']=function(_0x588b9e,_0x1c6aa5){var _0x2c7d85={'raw':!![],'where':{}},_0x12fade={},_0x59ae34;return db[_0x7555('0x20')][_0x7555('0x3d')]({'where':{'id':_0x588b9e[_0x7555('0x3b')]['id']}})[_0x7555('0x16')](handleEntityNotFound(_0x1c6aa5,null))[_0x7555('0x16')](function(_0x4b7084){if(_0x4b7084){_0x59ae34=_0x4b7084[_0x7555('0x18')]({'plain':!![]});_0x12fade[_0x7555('0x29')]=_[_0x7555('0x3e')](db[_0x7555('0x3f')][_0x7555('0x21')]);_0x12fade[_0x7555('0x25')]=_['keys'](_0x588b9e[_0x7555('0x25')]);_0x12fade[_0x7555('0x2a')]=_[_0x7555('0x2b')](_0x12fade[_0x7555('0x29')],_0x12fade[_0x7555('0x25')]);_0x2c7d85[_0x7555('0x2c')]=_[_0x7555('0x2b')](_0x12fade[_0x7555('0x29')],qs[_0x7555('0x2d')](_0x588b9e['query'][_0x7555('0x2d')]));_0x2c7d85[_0x7555('0x2c')]=_0x2c7d85[_0x7555('0x2c')][_0x7555('0x2e')]?_0x2c7d85[_0x7555('0x2c')]:_0x12fade[_0x7555('0x29')];if(!_0x588b9e[_0x7555('0x25')]['hasOwnProperty'](_0x7555('0x40'))){_0x2c7d85[_0x7555('0x11')]=qs[_0x7555('0x11')](_0x588b9e['query'][_0x7555('0x11')]);_0x2c7d85['offset']=qs[_0x7555('0xe')](_0x588b9e[_0x7555('0x25')][_0x7555('0xe')]);}_0x2c7d85['order']=qs[_0x7555('0x41')](_0x588b9e['query']['sort']);_0x2c7d85[_0x7555('0x23')]=qs[_0x7555('0x2a')](_[_0x7555('0x42')](_0x588b9e['query'],_0x12fade[_0x7555('0x2a')]));_0x2c7d85[_0x7555('0x23')][_0x7555('0x43')]=_0x4b7084['id'];if(_0x588b9e[_0x7555('0x25')]['filter']){_0x2c7d85[_0x7555('0x23')]=_[_0x7555('0x30')](_0x2c7d85[_0x7555('0x23')],{'$or':_['map'](_0x2c7d85[_0x7555('0x2c')],function(_0x52b1fd){var _0x343840={};_0x343840[_0x52b1fd]={'$like':'%'+_0x588b9e[_0x7555('0x25')][_0x7555('0x44')]+'%'};return _0x343840;})});}_0x2c7d85=_[_0x7555('0x30')]({},_0x2c7d85,_0x588b9e['options']);return db[_0x7555('0x3f')]['findAll'](_0x2c7d85);}})[_0x7555('0x16')](function(_0x5e2503){if(_0x5e2503){return db['User'][_0x7555('0x45')]({'where':{'id':_[_0x7555('0x1f')](_0x5e2503,_0x7555('0x46')),'role':_0x7555('0x47')},'attributes':['id',_0x7555('0x1d'),_0x7555('0x48'),_0x7555('0x49'),_0x7555('0x4a')]});}})[_0x7555('0x16')](function(_0x4fa9d3){if(_0x4fa9d3){return{'count':_0x4fa9d3[_0x7555('0x10')],'rows':_[_0x7555('0x1f')](_0x4fa9d3[_0x7555('0x4b')],function(_0x548c99){return{'membername':_0x548c99['name'],'UserId':_0x548c99['id'],'queue_name':_0x59ae34[_0x7555('0x1d')],'WhatsappQueueId':_0x59ae34['id'],'interface':util[_0x7555('0x4c')](_0x7555('0x4d'),_0x7555('0x4e'),_0x548c99[_0x7555('0x1d')]),'penalty':0x0,'paused':_0x548c99[_0x7555('0x48')],'createdAt':_0x548c99[_0x7555('0x4a')],'updatedAt':_0x548c99['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x7555('0x16')](respondWithFilteredResult(_0x1c6aa5,_0x2c7d85))['catch'](handleError(_0x1c6aa5,null));};exports[_0x7555('0x4f')]=function(_0x2f408b,_0x4708f7){var _0x53ef2e={};var _0x5d2102={};var _0x3a47b3;var _0x3383ff;return db['WhatsappQueue'][_0x7555('0x3d')]({'where':{'id':_0x2f408b['params']['id']}})[_0x7555('0x16')](handleEntityNotFound(_0x4708f7,null))['then'](function(_0x36522e){if(_0x36522e){_0x3a47b3=_0x36522e;_0x5d2102['model']=_[_0x7555('0x3e')](db['Team'][_0x7555('0x21')]);_0x5d2102[_0x7555('0x25')]=_[_0x7555('0x3e')](_0x2f408b[_0x7555('0x25')]);_0x5d2102[_0x7555('0x2a')]=_[_0x7555('0x2b')](_0x5d2102['model'],_0x5d2102[_0x7555('0x25')]);_0x53ef2e[_0x7555('0x2c')]=_[_0x7555('0x2b')](_0x5d2102[_0x7555('0x29')],qs[_0x7555('0x2d')](_0x2f408b[_0x7555('0x25')][_0x7555('0x2d')]));_0x53ef2e[_0x7555('0x2c')]=_0x53ef2e['attributes']['length']?_0x53ef2e['attributes']:_0x5d2102[_0x7555('0x29')];_0x53ef2e['order']=qs[_0x7555('0x41')](_0x2f408b[_0x7555('0x25')][_0x7555('0x41')]);_0x53ef2e[_0x7555('0x23')]=qs[_0x7555('0x2a')](_[_0x7555('0x42')](_0x2f408b[_0x7555('0x25')],_0x5d2102[_0x7555('0x2a')]));if(_0x2f408b[_0x7555('0x25')][_0x7555('0x44')]){_0x53ef2e[_0x7555('0x23')]=_['merge'](_0x53ef2e[_0x7555('0x23')],{'$or':_[_0x7555('0x1f')](_0x53ef2e[_0x7555('0x2c')],function(_0x3fdc39){var _0x2f139e={};_0x2f139e[_0x3fdc39]={'$like':'%'+_0x2f408b[_0x7555('0x25')][_0x7555('0x44')]+'%'};return _0x2f139e;})});}_0x53ef2e=_[_0x7555('0x30')]({},_0x53ef2e,_0x2f408b[_0x7555('0x31')]);return _0x3a47b3[_0x7555('0x4f')](_0x53ef2e);}})['then'](function(_0x103ece){if(_0x103ece){_0x3383ff=_0x103ece[_0x7555('0x2e')];if(!_0x2f408b[_0x7555('0x25')][_0x7555('0x50')](_0x7555('0x40'))){_0x53ef2e[_0x7555('0x11')]=qs[_0x7555('0x11')](_0x2f408b[_0x7555('0x25')][_0x7555('0x11')]);_0x53ef2e[_0x7555('0xe')]=qs['offset'](_0x2f408b['query'][_0x7555('0xe')]);}return _0x3a47b3[_0x7555('0x4f')](_0x53ef2e);}})['then'](function(_0x506ccf){if(_0x506ccf){return _0x506ccf?{'count':_0x3383ff,'rows':_0x506ccf}:null;}})[_0x7555('0x16')](respondWithResult(_0x4708f7,null))[_0x7555('0x27')](handleError(_0x4708f7,null));};exports['addTeams']=function(_0x56204b,_0x4fadc2){var _0x88be23=_0x56204b['body'][_0x7555('0x51')];return db[_0x7555('0x52')][_0x7555('0x26')]({'where':{'id':_0x88be23},'attributes':['id'],'include':[{'model':db[_0x7555('0x53')],'as':_0x7555('0x54'),'attributes':['id','name',_0x7555('0x55'),'voicePause',_0x7555('0x56')],'raw':!![]}]})[_0x7555('0x16')](function(_0x2ea7e7){if(_0x2ea7e7){var _0x389005=_[_0x7555('0x57')](_0x2ea7e7,function(_0x56d12a){var _0x2b836e=_0x56d12a[_0x7555('0x18')]({'plain':!![]});return _0x2b836e[_0x7555('0x54')];});return db[_0x7555('0x20')][_0x7555('0x32')]({'where':{'id':_0x56204b['params']['id']}})['then'](function(_0x5f08e7){return db[_0x7555('0x58')][_0x7555('0x59')](function(_0x386ecb){return _0x5f08e7['addTeams'](_0x88be23,{'transaction':_0x386ecb})['then'](function(){return BPromise[_0x7555('0x5a')](_0x389005,function(_0x2689d6){return db[_0x7555('0x3f')][_0x7555('0x5b')]({'where':{'UserId':_0x2689d6['id'],'WhatsappQueueId':_0x56204b[_0x7555('0x3b')]['id']},'transaction':_0x386ecb});});})[_0x7555('0x16')](function(){_0x389005['forEach'](function(_0x46f0f2){socket[_0x7555('0x5c')](_0x7555('0x5d'),{'UserId':_0x46f0f2['id'],'WhatsappQueueId':_0x5f08e7['id']});});});});});}})[_0x7555('0x16')](respondWithStatusCode(_0x4fadc2,null))['catch'](handleError(_0x4fadc2,null));};exports[_0x7555('0x5e')]=function(_0x3aabb0,_0x1169cd){return db[_0x7555('0x52')][_0x7555('0x26')]({'where':{'id':_0x3aabb0[_0x7555('0x25')][_0x7555('0x51')]},'attributes':['id'],'include':[{'model':db[_0x7555('0x53')],'as':_0x7555('0x54'),'attributes':['id'],'raw':!![]}]})[_0x7555('0x16')](handleEntityNotFound(_0x1169cd,null))[_0x7555('0x16')](function(_0x38c257){var _0xeecab4=_[_0x7555('0x1f')](_0x38c257,'id');var _0x4540eb=[];var _0x57a007=[];var _0x24312e=squel[_0x7555('0x5f')]();_0x24312e['field'](_0x7555('0x60'))[_0x7555('0x61')](_0x7555('0x62'),'tq')[_0x7555('0x63')]('user_has_teams','ut','ut.TeamId\x20=\x20tq.TeamId')['where'](_0x7555('0x64'),_0x3aabb0[_0x7555('0x3b')]['id']);for(var _0x44493d=0x0;_0x44493d<_0x38c257[_0x7555('0x2e')];_0x44493d+=0x1){let _0x4a6ab2=_0x38c257[_0x44493d];for(var _0x3bf14a=0x0;_0x3bf14a<_0x4a6ab2[_0x7555('0x54')][_0x7555('0x2e')];_0x3bf14a+=0x1){let _0xf4b00f=_0x4a6ab2['Agents'][_0x3bf14a];var _0x43926b=_0x24312e['clone']();_0x43926b['where']('ut.UserId\x20=\x20?',_0xf4b00f['id']);_0x57a007[_0x7555('0x65')](db[_0x7555('0x58')][_0x7555('0x25')](_0x43926b[_0x7555('0x66')](),{'type':db[_0x7555('0x58')][_0x7555('0x67')][_0x7555('0x68')]})['then'](function(_0x3e3b33){if(_0x3e3b33['length']===0x1){return _0xf4b00f['id'];}else{var _0x455395=_[_0x7555('0x69')](_[_0x7555('0x1f')](_0x3e3b33,'TeamId'),function(_0x2fa280){return _[_0x7555('0x6a')](_0xeecab4,_0x2fa280);});if(_0x455395){return _0xf4b00f['id'];}}}));}}return BPromise[_0x7555('0x6b')](_0x57a007)['then'](function(_0x5cbbf4){_0x4540eb=_(_0x4540eb)['union'](_0x5cbbf4)[_0x7555('0x6c')]()[_0x7555('0x6d')]();return db[_0x7555('0x20')][_0x7555('0x32')]({'where':{'id':_0x3aabb0[_0x7555('0x3b')]['id']}})[_0x7555('0x16')](function(_0x38b480){return db[_0x7555('0x58')]['transaction'](function(_0x2c0baa){return _0x38b480[_0x7555('0x5e')](_0x3aabb0[_0x7555('0x25')][_0x7555('0x51')],{'transaction':_0x2c0baa})[_0x7555('0x16')](function(){if(!_[_0x7555('0x6e')](_0x4540eb)){return _0x38b480[_0x7555('0x6f')](_0x4540eb,{'transaction':_0x2c0baa});}})['then'](function(){_0x4540eb[_0x7555('0x70')](function(_0x1e339a){socket[_0x7555('0x5c')](_0x7555('0x71'),{'UserId':_0x1e339a,'WhatsappQueueId':_0x38b480['id']});});});});});});})[_0x7555('0x16')](respondWithStatusCode(_0x1169cd,null))[_0x7555('0x27')](handleError(_0x1169cd,null));};exports[_0x7555('0x72')]=function(_0x3e9b1a,_0x2b75a8){return db[_0x7555('0x20')][_0x7555('0x32')]({'where':{'id':_0x3e9b1a[_0x7555('0x3b')]['id']}})[_0x7555('0x16')](handleEntityNotFound(_0x2b75a8,null))[_0x7555('0x16')](function(_0x1a8d3f){if(_0x1a8d3f){return _0x1a8d3f[_0x7555('0x72')](_0x3e9b1a[_0x7555('0x34')][_0x7555('0x51')],_[_0x7555('0x73')](_0x3e9b1a[_0x7555('0x34')],[_0x7555('0x51'),'id'])||{})[_0x7555('0x74')](function(_0x54aa60){for(var _0x1d40f4=0x0;_0x1d40f4<_0x3e9b1a[_0x7555('0x34')]['ids'][_0x7555('0x2e')];_0x1d40f4+=0x1){socket[_0x7555('0x5c')](_0x7555('0x5d'),{'UserId':Number(_0x3e9b1a[_0x7555('0x34')][_0x7555('0x51')][_0x1d40f4]),'WhatsappQueueId':Number(_0x3e9b1a[_0x7555('0x3b')]['id'])});}return _0x54aa60;});}})[_0x7555('0x16')](respondWithResult(_0x2b75a8,null))[_0x7555('0x27')](handleError(_0x2b75a8,null));};exports[_0x7555('0x6f')]=function(_0x246f70,_0x86c92b){return db[_0x7555('0x20')][_0x7555('0x32')]({'where':{'id':_0x246f70[_0x7555('0x3b')]['id']}})[_0x7555('0x16')](handleEntityNotFound(_0x86c92b,null))[_0x7555('0x16')](function(_0x33844e){if(_0x33844e){return _0x33844e[_0x7555('0x6f')](_0x246f70[_0x7555('0x25')][_0x7555('0x51')])[_0x7555('0x16')](function(){if(_[_0x7555('0x75')](_0x246f70[_0x7555('0x25')][_0x7555('0x51')])){for(var _0x5c5970=0x0;_0x5c5970<_0x246f70[_0x7555('0x25')][_0x7555('0x51')][_0x7555('0x2e')];_0x5c5970+=0x1){socket[_0x7555('0x5c')](_0x7555('0x71'),{'UserId':Number(_0x246f70['query'][_0x7555('0x51')][_0x5c5970]),'WhatsappQueueId':Number(_0x246f70[_0x7555('0x3b')]['id'])});}}else{socket['emit'](_0x7555('0x71'),{'UserId':Number(_0x246f70[_0x7555('0x25')][_0x7555('0x51')]),'WhatsappQueueId':Number(_0x246f70[_0x7555('0x3b')]['id'])});}});}})[_0x7555('0x16')](respondWithStatusCode(_0x86c92b,null))[_0x7555('0x27')](handleError(_0x86c92b,null));};exports[_0x7555('0x76')]=function(_0x3b0ecc,_0x1518cc){var _0x5b3636={};var _0x6a8f0e={};var _0x2c3492;var _0x54edc9;return db[_0x7555('0x20')][_0x7555('0x3d')]({'where':{'id':_0x3b0ecc[_0x7555('0x3b')]['id']}})[_0x7555('0x16')](handleEntityNotFound(_0x1518cc,null))['then'](function(_0x4e414d){if(_0x4e414d){_0x2c3492=_0x4e414d;_0x6a8f0e['model']=_[_0x7555('0x3e')](db['User'][_0x7555('0x21')]);_0x6a8f0e[_0x7555('0x25')]=_[_0x7555('0x3e')](_0x3b0ecc[_0x7555('0x25')]);_0x6a8f0e['filters']=_['intersection'](_0x6a8f0e[_0x7555('0x29')],_0x6a8f0e[_0x7555('0x25')]);_0x5b3636[_0x7555('0x2c')]=_[_0x7555('0x2b')](_0x6a8f0e[_0x7555('0x29')],qs[_0x7555('0x2d')](_0x3b0ecc['query'][_0x7555('0x2d')]));_0x5b3636[_0x7555('0x2c')]=_0x5b3636[_0x7555('0x2c')][_0x7555('0x2e')]?_0x5b3636[_0x7555('0x2c')]:_0x6a8f0e['model'];_0x5b3636[_0x7555('0x77')]=qs['sort'](_0x3b0ecc[_0x7555('0x25')]['sort']);_0x5b3636[_0x7555('0x23')]=qs[_0x7555('0x2a')](_[_0x7555('0x42')](_0x3b0ecc[_0x7555('0x25')],_0x6a8f0e[_0x7555('0x2a')]));if(_0x3b0ecc['query'][_0x7555('0x44')]){_0x5b3636[_0x7555('0x23')]=_[_0x7555('0x30')](_0x5b3636[_0x7555('0x23')],{'$or':_[_0x7555('0x1f')](_0x5b3636[_0x7555('0x2c')],function(_0xcdc633){var _0x2a3425={};_0x2a3425[_0xcdc633]={'$like':'%'+_0x3b0ecc[_0x7555('0x25')]['filter']+'%'};return _0x2a3425;})});}_0x5b3636=_['merge']({},_0x5b3636,_0x3b0ecc['options']);return _0x2c3492['getAgents'](_0x5b3636);}})[_0x7555('0x16')](function(_0x58fcf6){if(_0x58fcf6){_0x54edc9=_0x58fcf6[_0x7555('0x2e')];if(!_0x3b0ecc[_0x7555('0x25')][_0x7555('0x50')]('nolimit')){_0x5b3636[_0x7555('0x11')]=qs[_0x7555('0x11')](_0x3b0ecc[_0x7555('0x25')]['limit']);_0x5b3636[_0x7555('0xe')]=qs[_0x7555('0xe')](_0x3b0ecc[_0x7555('0x25')][_0x7555('0xe')]);}return _0x2c3492[_0x7555('0x76')](_0x5b3636);}})[_0x7555('0x16')](function(_0x54bbd3){if(_0x54bbd3){return _0x54bbd3?{'count':_0x54edc9,'rows':_0x54bbd3}:null;}})[_0x7555('0x16')](respondWithResult(_0x1518cc,null))[_0x7555('0x27')](handleError(_0x1518cc,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.events.js b/server/api/whatsappQueue/whatsappQueue.events.js index 1804604..2f4cf43 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 _0xc5d4=['WhatsappQueue','setMaxListeners','save','update','remove','emit','hook','exports','events'];(function(_0x1fbd2d,_0x2c4250){var _0x33a43a=function(_0x3431fe){while(--_0x3431fe){_0x1fbd2d['push'](_0x1fbd2d['shift']());}};_0x33a43a(++_0x2c4250);}(_0xc5d4,0xb3));var _0x4c5d=function(_0x322c36,_0x5aa4ce){_0x322c36=_0x322c36-0x0;var _0x3941a4=_0xc5d4[_0x322c36];return _0x3941a4;};'use strict';var EventEmitter=require(_0x4c5d('0x0'));var WhatsappQueue=require('../../mysqldb')['db'][_0x4c5d('0x1')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0x4c5d('0x2')](0x0);var events={'afterCreate':_0x4c5d('0x3'),'afterUpdate':_0x4c5d('0x4'),'afterDestroy':_0x4c5d('0x5')};function emitEvent(_0x1c83c4){return function(_0x4529e4,_0x6cfa03,_0x487c14){WhatsappQueueEvents[_0x4c5d('0x6')](_0x1c83c4+':'+_0x4529e4['id'],_0x4529e4);WhatsappQueueEvents[_0x4c5d('0x6')](_0x1c83c4,_0x4529e4);_0x487c14(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappQueue[_0x4c5d('0x7')](e,emitEvent(event));}}module[_0x4c5d('0x8')]=WhatsappQueueEvents; \ No newline at end of file +var _0xb659=['update','remove','emit','hasOwnProperty','hook','exports','WhatsappQueue','setMaxListeners','save'];(function(_0x2b46fa,_0x5ac5ce){var _0x26aa22=function(_0x262621){while(--_0x262621){_0x2b46fa['push'](_0x2b46fa['shift']());}};_0x26aa22(++_0x5ac5ce);}(_0xb659,0x19b));var _0x9b65=function(_0x21a11d,_0x18d8ec){_0x21a11d=_0x21a11d-0x0;var _0x474e50=_0xb659[_0x21a11d];return _0x474e50;};'use strict';var EventEmitter=require('events');var WhatsappQueue=require('../../mysqldb')['db'][_0x9b65('0x0')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0x9b65('0x1')](0x0);var events={'afterCreate':_0x9b65('0x2'),'afterUpdate':_0x9b65('0x3'),'afterDestroy':_0x9b65('0x4')};function emitEvent(_0x1bb8eb){return function(_0x1546f0,_0x166817,_0x289a50){WhatsappQueueEvents[_0x9b65('0x5')](_0x1bb8eb+':'+_0x1546f0['id'],_0x1546f0);WhatsappQueueEvents[_0x9b65('0x5')](_0x1bb8eb,_0x1546f0);_0x289a50(null);};}for(var e in events){if(events[_0x9b65('0x6')](e)){var event=events[e];WhatsappQueue[_0x9b65('0x7')](e,emitEvent(event));}}module[_0x9b65('0x8')]=WhatsappQueueEvents; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.model.js b/server/api/whatsappQueue/whatsappQueue.model.js index 6852da3..df72d81 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 _0x443b=['./whatsappQueue.attributes','define','whatsapp_queues','lodash','util','api','moment','request-promise','path','../../config/environment'];(function(_0x3fb5a7,_0x173c20){var _0x4b7dbf=function(_0x59111a){while(--_0x59111a){_0x3fb5a7['push'](_0x3fb5a7['shift']());}};_0x4b7dbf(++_0x173c20);}(_0x443b,0x8f));var _0xb443=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x443b[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0xb443('0x0'));var util=require(_0xb443('0x1'));var logger=require('../../config/logger')(_0xb443('0x2'));var moment=require(_0xb443('0x3'));var BPromise=require('bluebird');var rp=require(_0xb443('0x4'));var fs=require('fs');var path=require(_0xb443('0x5'));var rimraf=require('rimraf');var config=require(_0xb443('0x6'));var attributes=require(_0xb443('0x7'));module['exports']=function(_0x1ca98c,_0x4c1a97){return _0x1ca98c[_0xb443('0x8')]('WhatsappQueue',attributes,{'tableName':_0xb443('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x28d5=['./whatsappQueue.attributes','exports','define','lodash','util','../../config/logger','api','moment','rimraf','../../config/environment'];(function(_0x31efe7,_0x52fe9e){var _0x24b6ee=function(_0x65ae94){while(--_0x65ae94){_0x31efe7['push'](_0x31efe7['shift']());}};_0x24b6ee(++_0x52fe9e);}(_0x28d5,0x111));var _0x528d=function(_0x4eb9b7,_0x2b6622){_0x4eb9b7=_0x4eb9b7-0x0;var _0x3d8db5=_0x28d5[_0x4eb9b7];return _0x3d8db5;};'use strict';var _=require(_0x528d('0x0'));var util=require(_0x528d('0x1'));var logger=require(_0x528d('0x2'))(_0x528d('0x3'));var moment=require(_0x528d('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x528d('0x5'));var config=require(_0x528d('0x6'));var attributes=require(_0x528d('0x7'));module[_0x528d('0x8')]=function(_0x680892,_0x1abee1){return _0x680892[_0x528d('0x9')]('WhatsappQueue',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 c9eedb6..afe664f 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 _0x9884=['redis','localhost','socket.io-emitter','./whatsappQueue.socket','then','info','WhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','WhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetWhatsappQueue','findAll','options','raw','where','attributes','limit','include','model','map','ShowWhatsappQueue','WhatsappQueue','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','defaults'];(function(_0x297fd3,_0x115406){var _0x2af381=function(_0x1dd31b){while(--_0x1dd31b){_0x297fd3['push'](_0x297fd3['shift']());}};_0x2af381(++_0x115406);}(_0x9884,0x8d));var _0x4988=function(_0x4282cd,_0xb92621){_0x4282cd=_0x4282cd-0x0;var _0x160d0c=_0x9884[_0x4282cd];return _0x160d0c;};'use strict';var _=require('lodash');var util=require(_0x4988('0x0'));var moment=require(_0x4988('0x1'));var BPromise=require(_0x4988('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4988('0x3'));var db=require(_0x4988('0x4'))['db'];var utils=require(_0x4988('0x5'));var logger=require(_0x4988('0x6'))(_0x4988('0x7'));var config=require(_0x4988('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x4988('0x9')]({'port':0x232a});config['redis']=_[_0x4988('0xa')](config[_0x4988('0xb')],{'host':_0x4988('0xc'),'port':0x18eb});var socket=require(_0x4988('0xd'))(new Redis(config[_0x4988('0xb')]));require(_0x4988('0xe'))['register'](socket);function respondWithRpcPromise(_0x23c3ed,_0x349f49,_0x4b2d74){return new BPromise(function(_0x403586,_0x561a82){return client['request'](_0x23c3ed,_0x4b2d74)[_0x4988('0xf')](function(_0x4a0af8){logger[_0x4988('0x10')](_0x4988('0x11'),_0x349f49,_0x4988('0x12'));logger[_0x4988('0x13')](_0x4988('0x14'),_0x349f49,_0x4988('0x12'),JSON[_0x4988('0x15')](_0x4a0af8));if(_0x4a0af8['error']){if(_0x4a0af8[_0x4988('0x16')][_0x4988('0x17')]===0x1f4){logger['error'](_0x4988('0x11'),_0x349f49,_0x4a0af8['error'][_0x4988('0x18')]);return _0x561a82(_0x4a0af8['error']['message']);}logger[_0x4988('0x16')](_0x4988('0x11'),_0x349f49,_0x4a0af8[_0x4988('0x16')]['message']);return _0x403586(_0x4a0af8['error'][_0x4988('0x18')]);}else{logger[_0x4988('0x10')](_0x4988('0x11'),_0x349f49,_0x4988('0x12'));_0x403586(_0x4a0af8['result']['message']);}})[_0x4988('0x19')](function(_0x206f94){logger[_0x4988('0x16')](_0x4988('0x11'),_0x349f49,_0x206f94);_0x561a82(_0x206f94);});});}exports[_0x4988('0x1a')]=function(_0xc0c1cb){var _0x41b319=this;return new Promise(function(_0x526018,_0x208f1e){return db['WhatsappQueue'][_0x4988('0x1b')]({'raw':_0xc0c1cb[_0x4988('0x1c')]?_0xc0c1cb[_0x4988('0x1c')][_0x4988('0x1d')]===undefined?!![]:![]:!![],'where':_0xc0c1cb[_0x4988('0x1c')]?_0xc0c1cb[_0x4988('0x1c')][_0x4988('0x1e')]||null:null,'attributes':_0xc0c1cb[_0x4988('0x1c')]?_0xc0c1cb[_0x4988('0x1c')][_0x4988('0x1f')]||null:null,'limit':_0xc0c1cb[_0x4988('0x1c')]?_0xc0c1cb['options'][_0x4988('0x20')]||null:null,'include':_0xc0c1cb[_0x4988('0x1c')]?_0xc0c1cb['options'][_0x4988('0x21')]?_['map'](_0xc0c1cb[_0x4988('0x1c')][_0x4988('0x21')],function(_0x9332b5){return{'model':db[_0x9332b5[_0x4988('0x22')]],'as':_0x9332b5['as'],'attributes':_0x9332b5[_0x4988('0x1f')],'include':_0x9332b5[_0x4988('0x21')]?_[_0x4988('0x23')](_0x9332b5['include'],function(_0x30c550){return{'model':db[_0x30c550[_0x4988('0x22')]],'as':_0x30c550['as'],'attributes':_0x30c550[_0x4988('0x1f')],'include':_0x30c550[_0x4988('0x21')]?_[_0x4988('0x23')](_0x30c550[_0x4988('0x21')],function(_0x1ac44c){return{'model':db[_0x1ac44c['model']],'as':_0x1ac44c['as'],'attributes':_0x1ac44c[_0x4988('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x237610){logger[_0x4988('0x10')](_0x4988('0x1a'),_0xc0c1cb);logger['debug'](_0x4988('0x1a'),_0xc0c1cb,JSON[_0x4988('0x15')](_0x237610));_0x526018(_0x237610);})[_0x4988('0x19')](function(_0x3e43dd){logger[_0x4988('0x16')]('GetWhatsappQueue',_0x3e43dd[_0x4988('0x18')],_0xc0c1cb);_0x208f1e(_0x41b319['error'](0x1f4,_0x3e43dd[_0x4988('0x18')]));});});};exports[_0x4988('0x24')]=function(_0x45e475){var _0x44b602=this;return new Promise(function(_0xcc36cd,_0x15e0a6){return db[_0x4988('0x25')]['find']({'raw':_0x45e475['options']?_0x45e475['options'][_0x4988('0x1d')]===undefined?!![]:![]:!![],'where':_0x45e475[_0x4988('0x1c')]?_0x45e475[_0x4988('0x1c')][_0x4988('0x1e')]||null:null,'attributes':_0x45e475[_0x4988('0x1c')]?_0x45e475[_0x4988('0x1c')][_0x4988('0x1f')]||null:null,'include':_0x45e475[_0x4988('0x1c')]?_0x45e475[_0x4988('0x1c')]['include']?_[_0x4988('0x23')](_0x45e475[_0x4988('0x1c')][_0x4988('0x21')],function(_0xba94d6){return{'model':db[_0xba94d6['model']],'as':_0xba94d6['as'],'attributes':_0xba94d6[_0x4988('0x1f')],'include':_0xba94d6[_0x4988('0x21')]?_['map'](_0xba94d6[_0x4988('0x21')],function(_0x28d80c){return{'model':db[_0x28d80c['model']],'as':_0x28d80c['as'],'attributes':_0x28d80c[_0x4988('0x1f')],'include':_0x28d80c['include']?_[_0x4988('0x23')](_0x28d80c[_0x4988('0x21')],function(_0xb5e9b7){return{'model':db[_0xb5e9b7['model']],'as':_0xb5e9b7['as'],'attributes':_0xb5e9b7['attributes']};}):[]};}):[]};}):[]:[]})[_0x4988('0xf')](function(_0x517138){logger['info'](_0x4988('0x24'),_0x45e475);logger[_0x4988('0x13')](_0x4988('0x24'),_0x45e475,JSON[_0x4988('0x15')](_0x517138));_0xcc36cd(_0x517138);})[_0x4988('0x19')](function(_0xa52658){logger['error']('ShowWhatsappQueue',_0xa52658['message'],_0x45e475);_0x15e0a6(_0x44b602['error'](0x1f4,_0xa52658['message']));});});}; \ No newline at end of file +var _0xe2cf=['catch','GetWhatsappQueue','WhatsappQueue','findAll','options','raw','where','attributes','limit','include','model','map','then','ShowWhatsappQueue','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','localhost','socket.io-emitter','register','request','WhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','WhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info'];(function(_0x598d4a,_0x45c128){var _0x259c12=function(_0x56179d){while(--_0x56179d){_0x598d4a['push'](_0x598d4a['shift']());}};_0x259c12(++_0x45c128);}(_0xe2cf,0x192));var _0xfe2c=function(_0x1d03f1,_0x7f2edf){_0x1d03f1=_0x1d03f1-0x0;var _0x40c77e=_0xe2cf[_0x1d03f1];return _0x40c77e;};'use strict';var _=require(_0xfe2c('0x0'));var util=require(_0xfe2c('0x1'));var moment=require(_0xfe2c('0x2'));var BPromise=require(_0xfe2c('0x3'));var rs=require(_0xfe2c('0x4'));var fs=require('fs');var Redis=require(_0xfe2c('0x5'));var db=require(_0xfe2c('0x6'))['db'];var utils=require(_0xfe2c('0x7'));var logger=require(_0xfe2c('0x8'))(_0xfe2c('0x9'));var config=require(_0xfe2c('0xa'));var jayson=require(_0xfe2c('0xb'));var client=jayson[_0xfe2c('0xc')][_0xfe2c('0xd')]({'port':0x232a});config['redis']=_[_0xfe2c('0xe')](config['redis'],{'host':_0xfe2c('0xf'),'port':0x18eb});var socket=require(_0xfe2c('0x10'))(new Redis(config['redis']));require('./whatsappQueue.socket')[_0xfe2c('0x11')](socket);function respondWithRpcPromise(_0x42dac5,_0x414ef3,_0x1645e6){return new BPromise(function(_0x5347e6,_0x5afd33){return client[_0xfe2c('0x12')](_0x42dac5,_0x1645e6)['then'](function(_0x28e32f){logger['info'](_0xfe2c('0x13'),_0x414ef3,_0xfe2c('0x14'));logger[_0xfe2c('0x15')](_0xfe2c('0x16'),_0x414ef3,_0xfe2c('0x14'),JSON[_0xfe2c('0x17')](_0x28e32f));if(_0x28e32f[_0xfe2c('0x18')]){if(_0x28e32f[_0xfe2c('0x18')][_0xfe2c('0x19')]===0x1f4){logger[_0xfe2c('0x18')](_0xfe2c('0x13'),_0x414ef3,_0x28e32f[_0xfe2c('0x18')][_0xfe2c('0x1a')]);return _0x5afd33(_0x28e32f[_0xfe2c('0x18')][_0xfe2c('0x1a')]);}logger[_0xfe2c('0x18')]('WhatsappQueue,\x20%s,\x20%s',_0x414ef3,_0x28e32f['error'][_0xfe2c('0x1a')]);return _0x5347e6(_0x28e32f[_0xfe2c('0x18')][_0xfe2c('0x1a')]);}else{logger[_0xfe2c('0x1b')]('WhatsappQueue,\x20%s,\x20%s',_0x414ef3,_0xfe2c('0x14'));_0x5347e6(_0x28e32f['result']['message']);}})[_0xfe2c('0x1c')](function(_0xc6bf9){logger['error'](_0xfe2c('0x13'),_0x414ef3,_0xc6bf9);_0x5afd33(_0xc6bf9);});});}exports[_0xfe2c('0x1d')]=function(_0x155765){var _0x34cf34=this;return new Promise(function(_0x15ca7c,_0x1b81fc){return db[_0xfe2c('0x1e')][_0xfe2c('0x1f')]({'raw':_0x155765['options']?_0x155765[_0xfe2c('0x20')][_0xfe2c('0x21')]===undefined?!![]:![]:!![],'where':_0x155765[_0xfe2c('0x20')]?_0x155765[_0xfe2c('0x20')][_0xfe2c('0x22')]||null:null,'attributes':_0x155765[_0xfe2c('0x20')]?_0x155765[_0xfe2c('0x20')][_0xfe2c('0x23')]||null:null,'limit':_0x155765[_0xfe2c('0x20')]?_0x155765[_0xfe2c('0x20')][_0xfe2c('0x24')]||null:null,'include':_0x155765[_0xfe2c('0x20')]?_0x155765['options'][_0xfe2c('0x25')]?_['map'](_0x155765['options']['include'],function(_0x26df74){return{'model':db[_0x26df74[_0xfe2c('0x26')]],'as':_0x26df74['as'],'attributes':_0x26df74[_0xfe2c('0x23')],'include':_0x26df74[_0xfe2c('0x25')]?_[_0xfe2c('0x27')](_0x26df74['include'],function(_0x1465de){return{'model':db[_0x1465de[_0xfe2c('0x26')]],'as':_0x1465de['as'],'attributes':_0x1465de['attributes'],'include':_0x1465de['include']?_[_0xfe2c('0x27')](_0x1465de['include'],function(_0x2cfc54){return{'model':db[_0x2cfc54[_0xfe2c('0x26')]],'as':_0x2cfc54['as'],'attributes':_0x2cfc54[_0xfe2c('0x23')]};}):[]};}):[]};}):[]:[]})[_0xfe2c('0x28')](function(_0x468a68){logger[_0xfe2c('0x1b')](_0xfe2c('0x1d'),_0x155765);logger['debug'](_0xfe2c('0x1d'),_0x155765,JSON['stringify'](_0x468a68));_0x15ca7c(_0x468a68);})[_0xfe2c('0x1c')](function(_0x1fedc0){logger['error'](_0xfe2c('0x1d'),_0x1fedc0[_0xfe2c('0x1a')],_0x155765);_0x1b81fc(_0x34cf34[_0xfe2c('0x18')](0x1f4,_0x1fedc0[_0xfe2c('0x1a')]));});});};exports[_0xfe2c('0x29')]=function(_0x1a2837){var _0x16c47b=this;return new Promise(function(_0x541e74,_0x563f26){return db[_0xfe2c('0x1e')][_0xfe2c('0x2a')]({'raw':_0x1a2837[_0xfe2c('0x20')]?_0x1a2837[_0xfe2c('0x20')][_0xfe2c('0x21')]===undefined?!![]:![]:!![],'where':_0x1a2837[_0xfe2c('0x20')]?_0x1a2837[_0xfe2c('0x20')][_0xfe2c('0x22')]||null:null,'attributes':_0x1a2837[_0xfe2c('0x20')]?_0x1a2837[_0xfe2c('0x20')][_0xfe2c('0x23')]||null:null,'include':_0x1a2837['options']?_0x1a2837['options'][_0xfe2c('0x25')]?_[_0xfe2c('0x27')](_0x1a2837['options'][_0xfe2c('0x25')],function(_0x1da2f4){return{'model':db[_0x1da2f4[_0xfe2c('0x26')]],'as':_0x1da2f4['as'],'attributes':_0x1da2f4[_0xfe2c('0x23')],'include':_0x1da2f4['include']?_[_0xfe2c('0x27')](_0x1da2f4[_0xfe2c('0x25')],function(_0x326c59){return{'model':db[_0x326c59['model']],'as':_0x326c59['as'],'attributes':_0x326c59[_0xfe2c('0x23')],'include':_0x326c59[_0xfe2c('0x25')]?_[_0xfe2c('0x27')](_0x326c59[_0xfe2c('0x25')],function(_0x125037){return{'model':db[_0x125037['model']],'as':_0x125037['as'],'attributes':_0x125037[_0xfe2c('0x23')]};}):[]};}):[]};}):[]:[]})[_0xfe2c('0x28')](function(_0x1e8f72){logger['info'](_0xfe2c('0x29'),_0x1a2837);logger['debug'](_0xfe2c('0x29'),_0x1a2837,JSON[_0xfe2c('0x17')](_0x1e8f72));_0x541e74(_0x1e8f72);})[_0xfe2c('0x1c')](function(_0x3c5710){logger['error'](_0xfe2c('0x29'),_0x3c5710[_0xfe2c('0x1a')],_0x1a2837);_0x563f26(_0x16c47b['error'](0x1f4,_0x3c5710[_0xfe2c('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.socket.js b/server/api/whatsappQueue/whatsappQueue.socket.js index cb1c444..32064bc 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 _0xa7f2=['remove','removeListener','register','length','whatsappQueue:'];(function(_0xf2a676,_0x221c7d){var _0x382a51=function(_0x44f37b){while(--_0x44f37b){_0xf2a676['push'](_0xf2a676['shift']());}};_0x382a51(++_0x221c7d);}(_0xa7f2,0x190));var _0x2a7f=function(_0x2b4d26,_0x279b45){_0x2b4d26=_0x2b4d26-0x0;var _0x1b5a40=_0xa7f2[_0x2b4d26];return _0x1b5a40;};'use strict';var WhatsappQueueEvents=require('./whatsappQueue.events');var events=['save',_0x2a7f('0x0'),'update'];function createListener(_0xeed3bf,_0x41f5dd){return function(_0x303811){_0x41f5dd['emit'](_0xeed3bf,_0x303811);};}function removeListener(_0x17ee00,_0x116a5b){return function(){WhatsappQueueEvents[_0x2a7f('0x1')](_0x17ee00,_0x116a5b);};}exports[_0x2a7f('0x2')]=function(_0x5f089f){for(var _0x3eef6f=0x0,_0x1550b3=events[_0x2a7f('0x3')];_0x3eef6f<_0x1550b3;_0x3eef6f++){var _0x1897c2=events[_0x3eef6f];var _0x2e868d=createListener(_0x2a7f('0x4')+_0x1897c2,_0x5f089f);WhatsappQueueEvents['on'](_0x1897c2,_0x2e868d);}}; \ No newline at end of file +var _0xc15c=['removeListener','length','whatsappQueue:','./whatsappQueue.events','save','remove','update','emit'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc15c,0x183));var _0xcc15=function(_0xa4fc56,_0x22ab3b){_0xa4fc56=_0xa4fc56-0x0;var _0x4e4501=_0xc15c[_0xa4fc56];return _0x4e4501;};'use strict';var WhatsappQueueEvents=require(_0xcc15('0x0'));var events=[_0xcc15('0x1'),_0xcc15('0x2'),_0xcc15('0x3')];function createListener(_0x4e91d6,_0x33cd0d){return function(_0x22263d){_0x33cd0d[_0xcc15('0x4')](_0x4e91d6,_0x22263d);};}function removeListener(_0x1485b0,_0x21d4be){return function(){WhatsappQueueEvents[_0xcc15('0x5')](_0x1485b0,_0x21d4be);};}exports['register']=function(_0x3b6845){for(var _0x395cc7=0x0,_0x7395b9=events[_0xcc15('0x6')];_0x395cc7<_0x7395b9;_0x395cc7++){var _0xf40654=events[_0x395cc7];var _0x4f351c=createListener(_0xcc15('0x7')+_0xf40654,_0x3b6845);WhatsappQueueEvents['on'](_0xf40654,_0x4f351c);}}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/index.js b/server/api/whatsappQueueReport/index.js index d731003..9cd9958 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 _0xfdfb=['isAuthenticated','update','delete','destroy','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','./whatsappQueueReport.controller','get','/describe','describe','/:id','show','post'];(function(_0xb86665,_0x2791ff){var _0x33c66c=function(_0x160476){while(--_0x160476){_0xb86665['push'](_0xb86665['shift']());}};_0x33c66c(++_0x2791ff);}(_0xfdfb,0x8c));var _0xbfdf=function(_0x135f76,_0x4cbb88){_0x135f76=_0x135f76-0x0;var _0x581144=_0xfdfb[_0x135f76];return _0x581144;};'use strict';var multer=require(_0xbfdf('0x0'));var util=require(_0xbfdf('0x1'));var path=require('path');var timeout=require(_0xbfdf('0x2'));var express=require('express');var router=express[_0xbfdf('0x3')]();var fs_extra=require(_0xbfdf('0x4'));var auth=require(_0xbfdf('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xbfdf('0x6'));router[_0xbfdf('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0xbfdf('0x7')](_0xbfdf('0x8'),auth['isAuthenticated'](),controller[_0xbfdf('0x9')]);router[_0xbfdf('0x7')](_0xbfdf('0xa'),auth['isAuthenticated'](),controller[_0xbfdf('0xb')]);router[_0xbfdf('0xc')]('/',auth[_0xbfdf('0xd')](),controller['create']);router['put'](_0xbfdf('0xa'),auth[_0xbfdf('0xd')](),controller[_0xbfdf('0xe')]);router[_0xbfdf('0xf')](_0xbfdf('0xa'),auth[_0xbfdf('0xd')](),controller[_0xbfdf('0x10')]);module['exports']=router; \ No newline at end of file +var _0xb265=['get','isAuthenticated','index','/describe','describe','show','post','/:id','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./whatsappQueueReport.controller'];(function(_0x3f333c,_0x14f59a){var _0x6af3ad=function(_0x497511){while(--_0x497511){_0x3f333c['push'](_0x3f333c['shift']());}};_0x6af3ad(++_0x14f59a);}(_0xb265,0x131));var _0x5b26=function(_0x5a86d3,_0x5dba4b){_0x5a86d3=_0x5a86d3-0x0;var _0x567a6e=_0xb265[_0x5a86d3];return _0x567a6e;};'use strict';var multer=require(_0x5b26('0x0'));var util=require(_0x5b26('0x1'));var path=require(_0x5b26('0x2'));var timeout=require(_0x5b26('0x3'));var express=require(_0x5b26('0x4'));var router=express[_0x5b26('0x5')]();var fs_extra=require(_0x5b26('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x5b26('0x7'));var config=require(_0x5b26('0x8'));var controller=require(_0x5b26('0x9'));router[_0x5b26('0xa')]('/',auth[_0x5b26('0xb')](),controller[_0x5b26('0xc')]);router['get'](_0x5b26('0xd'),auth[_0x5b26('0xb')](),controller[_0x5b26('0xe')]);router[_0x5b26('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x5b26('0xf')]);router[_0x5b26('0x10')]('/',auth[_0x5b26('0xb')](),controller['create']);router['put'](_0x5b26('0x11'),auth[_0x5b26('0xb')](),controller[_0x5b26('0x12')]);router['delete']('/:id',auth[_0x5b26('0xb')](),controller[_0x5b26('0x13')]);module[_0x5b26('0x14')]=router; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js b/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js index 896f4de..0b9dd32 100644 --- a/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js +++ b/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['exports','STRING','DATE','sequelize'];(function(_0xc686c6,_0x6f570e){var _0x4fbfd6=function(_0x43f942){while(--_0x43f942){_0xc686c6['push'](_0xc686c6['shift']());}};_0x4fbfd6(++_0x6f570e);}(_0x9957,0x93));var _0x7995=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x9957[_0x3b380d];return _0x54502b;};'use strict';var Sequelize=require(_0x7995('0x0'));module[_0x7995('0x1')]={'uniqueid':{'type':Sequelize[_0x7995('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x7995('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x7995('0x3')]},'acceptAt':{'type':Sequelize[_0x7995('0x3')]},'exitAt':{'type':Sequelize[_0x7995('0x3')]},'reason':{'type':Sequelize[_0x7995('0x2')]}}; \ No newline at end of file +var _0x9957=['exports','STRING','DATE','sequelize'];(function(_0x38bc5d,_0x8ba01a){var _0x1c729c=function(_0x4786f2){while(--_0x4786f2){_0x38bc5d['push'](_0x38bc5d['shift']());}};_0x1c729c(++_0x8ba01a);}(_0x9957,0x93));var _0x7995=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x9957[_0x5b644e];return _0x49c6bf;};'use strict';var Sequelize=require(_0x7995('0x0'));module[_0x7995('0x1')]={'uniqueid':{'type':Sequelize[_0x7995('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x7995('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x7995('0x3')]},'acceptAt':{'type':Sequelize[_0x7995('0x3')]},'exitAt':{'type':Sequelize[_0x7995('0x3')]},'reason':{'type':Sequelize[_0x7995('0x2')]}}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.controller.js b/server/api/whatsappQueueReport/whatsappQueueReport.controller.js index 6a59f2f..2613d68 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 _0x282b=['intersection','attributes','model','fields','hasOwnProperty','order','where','filters','pick','filter','merge','VIRTUAL','options','WhatsappQueueReport','includeAll','include','findAll','rows','catch','show','find','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','reject','save','update','then','destroy','end','error','name','send','map','rawAttributes','fieldName','type','key','query','keys'];(function(_0x13ed98,_0x1065c7){var _0x36855b=function(_0x284469){while(--_0x284469){_0x13ed98['push'](_0x13ed98['shift']());}};_0x36855b(++_0x1065c7);}(_0x282b,0xec));var _0xb282=function(_0x411e87,_0x36af29){_0x411e87=_0x411e87-0x0;var _0x4bf03a=_0x282b[_0x411e87];return _0x4bf03a;};'use strict';var emlformat=require(_0xb282('0x0'));var rimraf=require(_0xb282('0x1'));var zipdir=require(_0xb282('0x2'));var jsonpatch=require(_0xb282('0x3'));var rp=require(_0xb282('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xb282('0x5'));var util=require('util');var path=require(_0xb282('0x6'));var sox=require(_0xb282('0x7'));var csv=require(_0xb282('0x8'));var ejs=require(_0xb282('0x9'));var fs=require('fs');var fs_extra=require(_0xb282('0xa'));var _=require(_0xb282('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xb282('0xc'));var deskjs=require(_0xb282('0xd'));var toCsv=require('to-csv');var querystring=require(_0xb282('0xe'));var Papa=require(_0xb282('0xf'));var Redis=require(_0xb282('0x10'));var authService=require(_0xb282('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb282('0x12'));var logger=require(_0xb282('0x13'))(_0xb282('0x14'));var utils=require(_0xb282('0x15'));var config=require(_0xb282('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x338bdb,_0xc08746){_0xc08746=_0xc08746||0xcc;return function(_0x40d7b8){if(_0x40d7b8){return _0x338bdb[_0xb282('0x17')](_0xc08746);}return _0x338bdb[_0xb282('0x18')](_0xc08746)['end']();};}function respondWithResult(_0x34c595,_0x5adf7f){_0x5adf7f=_0x5adf7f||0xc8;return function(_0xe1d53){if(_0xe1d53){return _0x34c595[_0xb282('0x18')](_0x5adf7f)['json'](_0xe1d53);}};}function respondWithFilteredResult(_0x525cfa,_0x5bc7c3){return function(_0x13cea1){if(_0x13cea1){var _0x350676=typeof _0x5bc7c3[_0xb282('0x19')]===_0xb282('0x1a')&&typeof _0x5bc7c3[_0xb282('0x1b')]==='undefined';var _0x191a31=_0x13cea1[_0xb282('0x1c')];var _0xca5f12=_0x350676?0x0:_0x5bc7c3[_0xb282('0x19')];var _0x3f8a3f=_0x350676?_0x13cea1['count']:_0x5bc7c3['offset']+_0x5bc7c3[_0xb282('0x1b')];var _0x2cdeb1;if(_0x3f8a3f>=_0x191a31){_0x3f8a3f=_0x191a31;_0x2cdeb1=0xc8;}else{_0x2cdeb1=0xce;}_0x525cfa['status'](_0x2cdeb1);return _0x525cfa[_0xb282('0x1d')](_0xb282('0x1e'),_0xca5f12+'-'+_0x3f8a3f+'/'+_0x191a31)[_0xb282('0x1f')](_0x13cea1);}return null;};}function patchUpdates(_0x438dbe){return function(_0x1c3084){try{jsonpatch['apply'](_0x1c3084,_0x438dbe,!![]);}catch(_0x1de407){return BPromise[_0xb282('0x20')](_0x1de407);}return _0x1c3084[_0xb282('0x21')]();};}function saveUpdates(_0x4b79d7,_0x437d66){return function(_0x2a7ef8){if(_0x2a7ef8){return _0x2a7ef8[_0xb282('0x22')](_0x4b79d7)[_0xb282('0x23')](function(_0x680095){return _0x680095;});}return null;};}function removeEntity(_0x56645f,_0x4d624f){return function(_0x360f15){if(_0x360f15){return _0x360f15[_0xb282('0x24')]()['then'](function(){_0x56645f['status'](0xcc)[_0xb282('0x25')]();});}};}function handleEntityNotFound(_0x114f77,_0x3451e5){return function(_0x3c4018){if(!_0x3c4018){_0x114f77[_0xb282('0x17')](0x194);}return _0x3c4018;};}function handleError(_0x2b1303,_0x5b1d3d){_0x5b1d3d=_0x5b1d3d||0x1f4;return function(_0xa0d7fb){logger[_0xb282('0x26')](_0xa0d7fb['stack']);if(_0xa0d7fb[_0xb282('0x27')]){delete _0xa0d7fb[_0xb282('0x27')];}_0x2b1303[_0xb282('0x18')](_0x5b1d3d)[_0xb282('0x28')](_0xa0d7fb);};}exports['index']=function(_0x1520b1,_0x1fb89f){var _0xe337b8={},_0x433ad5={},_0x4cee93={'count':0x0,'rows':[]};var _0xfddd2e=_[_0xb282('0x29')](db['WhatsappQueueReport'][_0xb282('0x2a')],function(_0x1e2861){return{'name':_0x1e2861[_0xb282('0x2b')],'type':_0x1e2861[_0xb282('0x2c')][_0xb282('0x2d')]};});_0x433ad5['model']=_[_0xb282('0x29')](_0xfddd2e,'name');_0x433ad5[_0xb282('0x2e')]=_[_0xb282('0x2f')](_0x1520b1[_0xb282('0x2e')]);_0x433ad5['filters']=_[_0xb282('0x30')](_0x433ad5['model'],_0x433ad5[_0xb282('0x2e')]);_0xe337b8[_0xb282('0x31')]=_[_0xb282('0x30')](_0x433ad5[_0xb282('0x32')],qs[_0xb282('0x33')](_0x1520b1[_0xb282('0x2e')]['fields']));_0xe337b8[_0xb282('0x31')]=_0xe337b8[_0xb282('0x31')]['length']?_0xe337b8['attributes']:_0x433ad5[_0xb282('0x32')];if(!_0x1520b1[_0xb282('0x2e')][_0xb282('0x34')]('nolimit')){_0xe337b8['limit']=qs['limit'](_0x1520b1[_0xb282('0x2e')][_0xb282('0x1b')]);_0xe337b8[_0xb282('0x19')]=qs[_0xb282('0x19')](_0x1520b1[_0xb282('0x2e')][_0xb282('0x19')]);}_0xe337b8[_0xb282('0x35')]=qs['sort'](_0x1520b1[_0xb282('0x2e')]['sort']);_0xe337b8[_0xb282('0x36')]=qs[_0xb282('0x37')](_[_0xb282('0x38')](_0x1520b1['query'],_0x433ad5[_0xb282('0x37')]),_0xfddd2e);if(_0x1520b1['query'][_0xb282('0x39')]){_0xe337b8[_0xb282('0x36')]=_[_0xb282('0x3a')](_0xe337b8[_0xb282('0x36')],{'$or':_['map'](_0xfddd2e,function(_0x5c86bb){if(_0x5c86bb[_0xb282('0x2c')]!==_0xb282('0x3b')){var _0x3791fd={};_0x3791fd[_0x5c86bb[_0xb282('0x27')]]={'$like':'%'+_0x1520b1['query'][_0xb282('0x39')]+'%'};return _0x3791fd;}})});}_0xe337b8=_['merge']({},_0xe337b8,_0x1520b1[_0xb282('0x3c')]);var _0x1a1b50={'where':_0xe337b8['where']};return db[_0xb282('0x3d')][_0xb282('0x1c')](_0x1a1b50)[_0xb282('0x23')](function(_0x2c988a){_0x4cee93[_0xb282('0x1c')]=_0x2c988a;if(_0x1520b1[_0xb282('0x2e')][_0xb282('0x3e')]){_0xe337b8[_0xb282('0x3f')]=[{'all':!![]}];}return db[_0xb282('0x3d')][_0xb282('0x40')](_0xe337b8);})[_0xb282('0x23')](function(_0x91fe43){_0x4cee93[_0xb282('0x41')]=_0x91fe43;return _0x4cee93;})[_0xb282('0x23')](respondWithFilteredResult(_0x1fb89f,_0xe337b8))[_0xb282('0x42')](handleError(_0x1fb89f,null));};exports[_0xb282('0x43')]=function(_0x2416a4,_0x7332d2){var _0x573da7={'raw':!![],'where':{'id':_0x2416a4['params']['id']}},_0x310ad1={};_0x310ad1[_0xb282('0x32')]=_[_0xb282('0x2f')](db[_0xb282('0x3d')][_0xb282('0x2a')]);_0x310ad1[_0xb282('0x2e')]=_[_0xb282('0x2f')](_0x2416a4['query']);_0x310ad1['filters']=_[_0xb282('0x30')](_0x310ad1['model'],_0x310ad1[_0xb282('0x2e')]);_0x573da7[_0xb282('0x31')]=_['intersection'](_0x310ad1[_0xb282('0x32')],qs[_0xb282('0x33')](_0x2416a4[_0xb282('0x2e')]['fields']));_0x573da7['attributes']=_0x573da7[_0xb282('0x31')]['length']?_0x573da7[_0xb282('0x31')]:_0x310ad1[_0xb282('0x32')];if(_0x2416a4[_0xb282('0x2e')][_0xb282('0x3e')]){_0x573da7[_0xb282('0x3f')]=[{'all':!![]}];}_0x573da7=_[_0xb282('0x3a')]({},_0x573da7,_0x2416a4['options']);return db[_0xb282('0x3d')][_0xb282('0x44')](_0x573da7)[_0xb282('0x23')](handleEntityNotFound(_0x7332d2,null))['then'](respondWithResult(_0x7332d2,null))[_0xb282('0x42')](handleError(_0x7332d2,null));};exports['create']=function(_0x32fc1d,_0x4b0822){return db[_0xb282('0x3d')]['create'](_0x32fc1d['body'],{})['then'](respondWithResult(_0x4b0822,0xc9))[_0xb282('0x42')](handleError(_0x4b0822,null));};exports[_0xb282('0x22')]=function(_0x42d99f,_0x7a5aa4){if(_0x42d99f['body']['id']){delete _0x42d99f['body']['id'];}return db['WhatsappQueueReport'][_0xb282('0x44')]({'where':{'id':_0x42d99f[_0xb282('0x45')]['id']}})[_0xb282('0x23')](handleEntityNotFound(_0x7a5aa4,null))[_0xb282('0x23')](saveUpdates(_0x42d99f['body'],null))[_0xb282('0x23')](respondWithResult(_0x7a5aa4,null))[_0xb282('0x42')](handleError(_0x7a5aa4,null));};exports['destroy']=function(_0x33bded,_0x9f4d79){return db[_0xb282('0x3d')][_0xb282('0x44')]({'where':{'id':_0x33bded[_0xb282('0x45')]['id']}})['then'](handleEntityNotFound(_0x9f4d79,null))[_0xb282('0x23')](removeEntity(_0x9f4d79,null))[_0xb282('0x42')](handleError(_0x9f4d79,null));};exports[_0xb282('0x46')]=function(_0x22d129,_0x308aa8){return db[_0xb282('0x3d')]['describe']()[_0xb282('0x23')](respondWithResult(_0x308aa8,null))['catch'](handleError(_0x308aa8,null));}; \ No newline at end of file +var _0x087b=['name','send','index','map','WhatsappQueueReport','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','keys','merge','find','create','body','update','params','describe','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','apply','reject','save','then','error','stack'];(function(_0x1dbda4,_0x12f583){var _0x59ccbf=function(_0x43b0d0){while(--_0x43b0d0){_0x1dbda4['push'](_0x1dbda4['shift']());}};_0x59ccbf(++_0x12f583);}(_0x087b,0x11a));var _0xb087=function(_0x2f45ea,_0x15c656){_0x2f45ea=_0x2f45ea-0x0;var _0x485a84=_0x087b[_0x2f45ea];return _0x485a84;};'use strict';var emlformat=require(_0xb087('0x0'));var rimraf=require(_0xb087('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xb087('0x2'));var moment=require('moment');var BPromise=require(_0xb087('0x3'));var Mustache=require(_0xb087('0x4'));var util=require(_0xb087('0x5'));var path=require(_0xb087('0x6'));var sox=require(_0xb087('0x7'));var csv=require(_0xb087('0x8'));var ejs=require(_0xb087('0x9'));var fs=require('fs');var fs_extra=require(_0xb087('0xa'));var _=require(_0xb087('0xb'));var squel=require(_0xb087('0xc'));var crypto=require(_0xb087('0xd'));var jsforce=require(_0xb087('0xe'));var deskjs=require(_0xb087('0xf'));var toCsv=require(_0xb087('0x8'));var querystring=require(_0xb087('0x10'));var Papa=require(_0xb087('0x11'));var Redis=require(_0xb087('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xb087('0x13'));var as=require(_0xb087('0x14'));var hardwareService=require(_0xb087('0x15'));var logger=require(_0xb087('0x16'))(_0xb087('0x17'));var utils=require(_0xb087('0x18'));var config=require(_0xb087('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xb087('0x1a'))['db'];function respondWithStatusCode(_0x31f977,_0x323656){_0x323656=_0x323656||0xcc;return function(_0x51ceaa){if(_0x51ceaa){return _0x31f977[_0xb087('0x1b')](_0x323656);}return _0x31f977[_0xb087('0x1c')](_0x323656)[_0xb087('0x1d')]();};}function respondWithResult(_0x46410b,_0x11784c){_0x11784c=_0x11784c||0xc8;return function(_0x12d0db){if(_0x12d0db){return _0x46410b[_0xb087('0x1c')](_0x11784c)[_0xb087('0x1e')](_0x12d0db);}};}function respondWithFilteredResult(_0x24e1a3,_0x16d0b7){return function(_0x5193a4){if(_0x5193a4){var _0x43e576=typeof _0x16d0b7[_0xb087('0x1f')]==='undefined'&&typeof _0x16d0b7[_0xb087('0x20')]===_0xb087('0x21');var _0x2e9e74=_0x5193a4['count'];var _0x330005=_0x43e576?0x0:_0x16d0b7[_0xb087('0x1f')];var _0x17200d=_0x43e576?_0x5193a4[_0xb087('0x22')]:_0x16d0b7['offset']+_0x16d0b7[_0xb087('0x20')];var _0x28428e;if(_0x17200d>=_0x2e9e74){_0x17200d=_0x2e9e74;_0x28428e=0xc8;}else{_0x28428e=0xce;}_0x24e1a3[_0xb087('0x1c')](_0x28428e);return _0x24e1a3[_0xb087('0x23')]('Content-Range',_0x330005+'-'+_0x17200d+'/'+_0x2e9e74)['json'](_0x5193a4);}return null;};}function patchUpdates(_0x5ea3dc){return function(_0x49450a){try{jsonpatch[_0xb087('0x24')](_0x49450a,_0x5ea3dc,!![]);}catch(_0x17be8e){return BPromise[_0xb087('0x25')](_0x17be8e);}return _0x49450a[_0xb087('0x26')]();};}function saveUpdates(_0x1fb765,_0x258b4c){return function(_0x31ae01){if(_0x31ae01){return _0x31ae01['update'](_0x1fb765)[_0xb087('0x27')](function(_0x466397){return _0x466397;});}return null;};}function removeEntity(_0x1de654,_0x1cfb3e){return function(_0x3ad74e){if(_0x3ad74e){return _0x3ad74e['destroy']()[_0xb087('0x27')](function(){_0x1de654[_0xb087('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5a2dc6,_0x50745a){return function(_0x598b99){if(!_0x598b99){_0x5a2dc6['sendStatus'](0x194);}return _0x598b99;};}function handleError(_0x304840,_0x45685d){_0x45685d=_0x45685d||0x1f4;return function(_0x1d124f){logger[_0xb087('0x28')](_0x1d124f[_0xb087('0x29')]);if(_0x1d124f[_0xb087('0x2a')]){delete _0x1d124f[_0xb087('0x2a')];}_0x304840[_0xb087('0x1c')](_0x45685d)[_0xb087('0x2b')](_0x1d124f);};}exports[_0xb087('0x2c')]=function(_0x18058c,_0x31e3e6){var _0xb0baf6={},_0x263259={},_0x593b78={'count':0x0,'rows':[]};var _0x37393a=_[_0xb087('0x2d')](db[_0xb087('0x2e')][_0xb087('0x2f')],function(_0x22d441){return{'name':_0x22d441[_0xb087('0x30')],'type':_0x22d441[_0xb087('0x31')][_0xb087('0x32')]};});_0x263259['model']=_['map'](_0x37393a,_0xb087('0x2a'));_0x263259[_0xb087('0x33')]=_['keys'](_0x18058c[_0xb087('0x33')]);_0x263259[_0xb087('0x34')]=_[_0xb087('0x35')](_0x263259[_0xb087('0x36')],_0x263259[_0xb087('0x33')]);_0xb0baf6[_0xb087('0x37')]=_[_0xb087('0x35')](_0x263259[_0xb087('0x36')],qs[_0xb087('0x38')](_0x18058c[_0xb087('0x33')][_0xb087('0x38')]));_0xb0baf6[_0xb087('0x37')]=_0xb0baf6['attributes'][_0xb087('0x39')]?_0xb0baf6['attributes']:_0x263259[_0xb087('0x36')];if(!_0x18058c[_0xb087('0x33')][_0xb087('0x3a')](_0xb087('0x3b'))){_0xb0baf6[_0xb087('0x20')]=qs[_0xb087('0x20')](_0x18058c[_0xb087('0x33')][_0xb087('0x20')]);_0xb0baf6[_0xb087('0x1f')]=qs['offset'](_0x18058c['query'][_0xb087('0x1f')]);}_0xb0baf6[_0xb087('0x3c')]=qs[_0xb087('0x3d')](_0x18058c[_0xb087('0x33')][_0xb087('0x3d')]);_0xb0baf6['where']=qs[_0xb087('0x34')](_[_0xb087('0x3e')](_0x18058c['query'],_0x263259['filters']),_0x37393a);if(_0x18058c[_0xb087('0x33')][_0xb087('0x3f')]){_0xb0baf6[_0xb087('0x40')]=_['merge'](_0xb0baf6[_0xb087('0x40')],{'$or':_[_0xb087('0x2d')](_0x37393a,function(_0x1caa6e){if(_0x1caa6e[_0xb087('0x31')]!==_0xb087('0x41')){var _0x5db6b9={};_0x5db6b9[_0x1caa6e[_0xb087('0x2a')]]={'$like':'%'+_0x18058c['query'][_0xb087('0x3f')]+'%'};return _0x5db6b9;}})});}_0xb0baf6=_['merge']({},_0xb0baf6,_0x18058c[_0xb087('0x42')]);var _0xc9f9e9={'where':_0xb0baf6['where']};return db[_0xb087('0x2e')]['count'](_0xc9f9e9)[_0xb087('0x27')](function(_0x4a360c){_0x593b78[_0xb087('0x22')]=_0x4a360c;if(_0x18058c[_0xb087('0x33')][_0xb087('0x43')]){_0xb0baf6[_0xb087('0x44')]=[{'all':!![]}];}return db[_0xb087('0x2e')][_0xb087('0x45')](_0xb0baf6);})[_0xb087('0x27')](function(_0x5e7690){_0x593b78[_0xb087('0x46')]=_0x5e7690;return _0x593b78;})['then'](respondWithFilteredResult(_0x31e3e6,_0xb0baf6))[_0xb087('0x47')](handleError(_0x31e3e6,null));};exports[_0xb087('0x48')]=function(_0x5b6924,_0xb662bf){var _0x45dc6f={'raw':!![],'where':{'id':_0x5b6924['params']['id']}},_0x7650c5={};_0x7650c5[_0xb087('0x36')]=_['keys'](db[_0xb087('0x2e')][_0xb087('0x2f')]);_0x7650c5['query']=_[_0xb087('0x49')](_0x5b6924[_0xb087('0x33')]);_0x7650c5['filters']=_[_0xb087('0x35')](_0x7650c5[_0xb087('0x36')],_0x7650c5['query']);_0x45dc6f[_0xb087('0x37')]=_[_0xb087('0x35')](_0x7650c5[_0xb087('0x36')],qs[_0xb087('0x38')](_0x5b6924['query']['fields']));_0x45dc6f[_0xb087('0x37')]=_0x45dc6f[_0xb087('0x37')][_0xb087('0x39')]?_0x45dc6f[_0xb087('0x37')]:_0x7650c5[_0xb087('0x36')];if(_0x5b6924[_0xb087('0x33')]['includeAll']){_0x45dc6f['include']=[{'all':!![]}];}_0x45dc6f=_[_0xb087('0x4a')]({},_0x45dc6f,_0x5b6924['options']);return db[_0xb087('0x2e')][_0xb087('0x4b')](_0x45dc6f)[_0xb087('0x27')](handleEntityNotFound(_0xb662bf,null))[_0xb087('0x27')](respondWithResult(_0xb662bf,null))['catch'](handleError(_0xb662bf,null));};exports[_0xb087('0x4c')]=function(_0x562751,_0x2fe8a0){return db[_0xb087('0x2e')][_0xb087('0x4c')](_0x562751[_0xb087('0x4d')],{})[_0xb087('0x27')](respondWithResult(_0x2fe8a0,0xc9))['catch'](handleError(_0x2fe8a0,null));};exports[_0xb087('0x4e')]=function(_0xb15e28,_0x588d96){if(_0xb15e28['body']['id']){delete _0xb15e28[_0xb087('0x4d')]['id'];}return db['WhatsappQueueReport']['find']({'where':{'id':_0xb15e28[_0xb087('0x4f')]['id']}})[_0xb087('0x27')](handleEntityNotFound(_0x588d96,null))['then'](saveUpdates(_0xb15e28[_0xb087('0x4d')],null))[_0xb087('0x27')](respondWithResult(_0x588d96,null))[_0xb087('0x47')](handleError(_0x588d96,null));};exports['destroy']=function(_0x5ba160,_0x30cc83){return db['WhatsappQueueReport']['find']({'where':{'id':_0x5ba160[_0xb087('0x4f')]['id']}})[_0xb087('0x27')](handleEntityNotFound(_0x30cc83,null))[_0xb087('0x27')](removeEntity(_0x30cc83,null))[_0xb087('0x47')](handleError(_0x30cc83,null));};exports[_0xb087('0x50')]=function(_0x148642,_0xbd849d){return db[_0xb087('0x2e')][_0xb087('0x50')]()[_0xb087('0x27')](respondWithResult(_0xbd849d,null))[_0xb087('0x47')](handleError(_0xbd849d,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.model.js b/server/api/whatsappQueueReport/whatsappQueueReport.model.js index 3a81d33..3ab54e5 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 _0x6e9e=['lodash','util','api','bluebird','request-promise','path','./whatsappQueueReport.attributes','exports','define','report_whatsapp_queue','uniqueid'];(function(_0x2c6d77,_0x2a74b3){var _0x3a9566=function(_0x40c227){while(--_0x40c227){_0x2c6d77['push'](_0x2c6d77['shift']());}};_0x3a9566(++_0x2a74b3);}(_0x6e9e,0x1c3));var _0xe6e9=function(_0x5a2d3f,_0x27b04e){_0x5a2d3f=_0x5a2d3f-0x0;var _0x5c65d8=_0x6e9e[_0x5a2d3f];return _0x5c65d8;};'use strict';var _=require(_0xe6e9('0x0'));var util=require(_0xe6e9('0x1'));var logger=require('../../config/logger')(_0xe6e9('0x2'));var moment=require('moment');var BPromise=require(_0xe6e9('0x3'));var rp=require(_0xe6e9('0x4'));var fs=require('fs');var path=require(_0xe6e9('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xe6e9('0x6'));module[_0xe6e9('0x7')]=function(_0x5cd2ce,_0x1fb9ba){return _0x5cd2ce[_0xe6e9('0x8')]('WhatsappQueueReport',attributes,{'tableName':_0xe6e9('0x9'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xe6e9('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xc830=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./whatsappQueueReport.attributes','exports','define','report_whatsapp_queue','uniqueid','lodash','util','../../config/logger','api'];(function(_0x930390,_0x4f080e){var _0x386ca7=function(_0x25609f){while(--_0x25609f){_0x930390['push'](_0x930390['shift']());}};_0x386ca7(++_0x4f080e);}(_0xc830,0x128));var _0x0c83=function(_0x7719e1,_0x17a548){_0x7719e1=_0x7719e1-0x0;var _0x19ab70=_0xc830[_0x7719e1];return _0x19ab70;};'use strict';var _=require(_0x0c83('0x0'));var util=require(_0x0c83('0x1'));var logger=require(_0x0c83('0x2'))(_0x0c83('0x3'));var moment=require(_0x0c83('0x4'));var BPromise=require(_0x0c83('0x5'));var rp=require(_0x0c83('0x6'));var fs=require('fs');var path=require(_0x0c83('0x7'));var rimraf=require(_0x0c83('0x8'));var config=require(_0x0c83('0x9'));var attributes=require(_0x0c83('0xa'));module[_0x0c83('0xb')]=function(_0x57641b,_0x5cc8fe){return _0x57641b[_0x0c83('0xc')]('WhatsappQueueReport',attributes,{'tableName':_0x0c83('0xd'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x0c83('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js b/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js index 0f25019..82a6df6 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 _0x6264=['WhatsappQueueReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','CreateWhatsappQueueReport','WhatsappQueueReport','create','raw','then','body','options','where','attributes','limit','UpdateWhatsappQueueReport','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','info'];(function(_0x448ed9,_0x5a62f5){var _0x24ed9e=function(_0x5f5b06){while(--_0x5f5b06){_0x448ed9['push'](_0x448ed9['shift']());}};_0x24ed9e(++_0x5a62f5);}(_0x6264,0xfb));var _0x4626=function(_0x5b560a,_0x50f60d){_0x5b560a=_0x5b560a-0x0;var _0x3b9858=_0x6264[_0x5b560a];return _0x3b9858;};'use strict';var _=require(_0x4626('0x0'));var util=require('util');var moment=require(_0x4626('0x1'));var BPromise=require(_0x4626('0x2'));var rs=require(_0x4626('0x3'));var fs=require('fs');var Redis=require(_0x4626('0x4'));var db=require(_0x4626('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x4626('0x6'))('rpc');var config=require(_0x4626('0x7'));var jayson=require(_0x4626('0x8'));var client=jayson[_0x4626('0x9')][_0x4626('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x414c52,_0x28af15,_0x41e8e6){return new BPromise(function(_0x205bc6,_0x12ac32){return client[_0x4626('0xb')](_0x414c52,_0x41e8e6)['then'](function(_0x2c7189){logger[_0x4626('0xc')](_0x4626('0xd'),_0x28af15,_0x4626('0xe'));logger[_0x4626('0xf')]('WhatsappQueueReport,\x20%s,\x20%s,\x20%s',_0x28af15,_0x4626('0xe'),JSON[_0x4626('0x10')](_0x2c7189));if(_0x2c7189[_0x4626('0x11')]){if(_0x2c7189[_0x4626('0x11')][_0x4626('0x12')]===0x1f4){logger[_0x4626('0x11')](_0x4626('0xd'),_0x28af15,_0x2c7189[_0x4626('0x11')][_0x4626('0x13')]);return _0x12ac32(_0x2c7189[_0x4626('0x11')][_0x4626('0x13')]);}logger[_0x4626('0x11')](_0x4626('0xd'),_0x28af15,_0x2c7189[_0x4626('0x11')][_0x4626('0x13')]);return _0x205bc6(_0x2c7189[_0x4626('0x11')][_0x4626('0x13')]);}else{logger['info'](_0x4626('0xd'),_0x28af15,_0x4626('0xe'));_0x205bc6(_0x2c7189[_0x4626('0x14')][_0x4626('0x13')]);}})[_0x4626('0x15')](function(_0x38d0db){logger[_0x4626('0x11')](_0x4626('0xd'),_0x28af15,_0x38d0db);_0x12ac32(_0x38d0db);});});}exports[_0x4626('0x16')]=function(_0x436248){var _0x34e9b0=this;return new Promise(function(_0x26516c,_0x24b336){return db[_0x4626('0x17')][_0x4626('0x18')](_0x436248['body'],{'raw':_0x436248['options']?_0x436248['options'][_0x4626('0x19')]===undefined?!![]:![]:!![]})[_0x4626('0x1a')](function(_0x3954d7){logger[_0x4626('0xc')]('CreateWhatsappQueueReport',_0x436248);logger[_0x4626('0xf')](_0x4626('0x16'),_0x436248,JSON[_0x4626('0x10')](_0x3954d7));_0x26516c(_0x3954d7);})[_0x4626('0x15')](function(_0xab2f5b){logger['error'](_0x4626('0x16'),_0xab2f5b[_0x4626('0x13')],_0x436248);_0x24b336(_0x34e9b0[_0x4626('0x11')](0x1f4,_0xab2f5b[_0x4626('0x13')]));});});};exports['UpdateWhatsappQueueReport']=function(_0xba078b){var _0x4184c9=this;return new Promise(function(_0x161fa1,_0x4d5bfb){return db[_0x4626('0x17')]['update'](_0xba078b[_0x4626('0x1b')],{'raw':_0xba078b['options']?_0xba078b[_0x4626('0x1c')][_0x4626('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xba078b[_0x4626('0x1c')]?_0xba078b[_0x4626('0x1c')][_0x4626('0x1d')]||null:null,'attributes':_0xba078b[_0x4626('0x1c')]?_0xba078b['options'][_0x4626('0x1e')]||null:null,'limit':_0xba078b[_0x4626('0x1c')]?_0xba078b[_0x4626('0x1c')][_0x4626('0x1f')]||null:null})['then'](function(_0x175c11){logger['info'](_0x4626('0x20'),_0xba078b);logger[_0x4626('0xf')](_0x4626('0x20'),_0xba078b,JSON[_0x4626('0x10')](_0x175c11));_0x161fa1(_0x175c11);})['catch'](function(_0x4d201b){logger[_0x4626('0x11')](_0x4626('0x20'),_0x4d201b[_0x4626('0x13')],_0xba078b);_0x4d5bfb(_0x4184c9[_0x4626('0x11')](0x1f4,_0x4d201b['message']));});});}; \ No newline at end of file +var _0xc35f=['../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','WhatsappQueueReport,\x20%s,\x20%s','request\x20sent','debug','WhatsappQueueReport,\x20%s,\x20%s,\x20%s','error','code','result','message','catch','CreateWhatsappQueueReport','body','options','stringify','UpdateWhatsappQueueReport','WhatsappQueueReport','update','raw','where','attributes','limit','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xc35f,0x82));var _0xfc35=function(_0x447f09,_0x94b5b0){_0x447f09=_0x447f09-0x0;var _0x29b2f7=_0xc35f[_0x447f09];return _0x29b2f7;};'use strict';var _=require(_0xfc35('0x0'));var util=require(_0xfc35('0x1'));var moment=require(_0xfc35('0x2'));var BPromise=require(_0xfc35('0x3'));var rs=require(_0xfc35('0x4'));var fs=require('fs');var Redis=require(_0xfc35('0x5'));var db=require(_0xfc35('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xfc35('0x7'))(_0xfc35('0x8'));var config=require(_0xfc35('0x9'));var jayson=require(_0xfc35('0xa'));var client=jayson['client'][_0xfc35('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x418304,_0x344788,_0x203a74){return new BPromise(function(_0x104777,_0x38d142){return client['request'](_0x418304,_0x203a74)[_0xfc35('0xc')](function(_0x4ff592){logger[_0xfc35('0xd')](_0xfc35('0xe'),_0x344788,_0xfc35('0xf'));logger[_0xfc35('0x10')](_0xfc35('0x11'),_0x344788,'request\x20sent',JSON['stringify'](_0x4ff592));if(_0x4ff592[_0xfc35('0x12')]){if(_0x4ff592['error'][_0xfc35('0x13')]===0x1f4){logger[_0xfc35('0x12')](_0xfc35('0xe'),_0x344788,_0x4ff592['error']['message']);return _0x38d142(_0x4ff592[_0xfc35('0x12')]['message']);}logger[_0xfc35('0x12')](_0xfc35('0xe'),_0x344788,_0x4ff592[_0xfc35('0x12')]['message']);return _0x104777(_0x4ff592[_0xfc35('0x12')]['message']);}else{logger[_0xfc35('0xd')](_0xfc35('0xe'),_0x344788,'request\x20sent');_0x104777(_0x4ff592[_0xfc35('0x14')][_0xfc35('0x15')]);}})[_0xfc35('0x16')](function(_0x50b05a){logger[_0xfc35('0x12')](_0xfc35('0xe'),_0x344788,_0x50b05a);_0x38d142(_0x50b05a);});});}exports[_0xfc35('0x17')]=function(_0x30fc3f){var _0x13b56f=this;return new Promise(function(_0x3280b8,_0xb111fa){return db['WhatsappQueueReport']['create'](_0x30fc3f[_0xfc35('0x18')],{'raw':_0x30fc3f[_0xfc35('0x19')]?_0x30fc3f[_0xfc35('0x19')]['raw']===undefined?!![]:![]:!![]})[_0xfc35('0xc')](function(_0x4e6b41){logger['info'](_0xfc35('0x17'),_0x30fc3f);logger[_0xfc35('0x10')](_0xfc35('0x17'),_0x30fc3f,JSON[_0xfc35('0x1a')](_0x4e6b41));_0x3280b8(_0x4e6b41);})[_0xfc35('0x16')](function(_0xceec7d){logger[_0xfc35('0x12')]('CreateWhatsappQueueReport',_0xceec7d['message'],_0x30fc3f);_0xb111fa(_0x13b56f[_0xfc35('0x12')](0x1f4,_0xceec7d[_0xfc35('0x15')]));});});};exports[_0xfc35('0x1b')]=function(_0x246c22){var _0x1f80d1=this;return new Promise(function(_0x89ac3f,_0x4e2340){return db[_0xfc35('0x1c')][_0xfc35('0x1d')](_0x246c22[_0xfc35('0x18')],{'raw':_0x246c22[_0xfc35('0x19')]?_0x246c22['options'][_0xfc35('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x246c22['options']?_0x246c22[_0xfc35('0x19')][_0xfc35('0x1f')]||null:null,'attributes':_0x246c22[_0xfc35('0x19')]?_0x246c22[_0xfc35('0x19')][_0xfc35('0x20')]||null:null,'limit':_0x246c22[_0xfc35('0x19')]?_0x246c22[_0xfc35('0x19')][_0xfc35('0x21')]||null:null})[_0xfc35('0xc')](function(_0x4cfc6b){logger['info']('UpdateWhatsappQueueReport',_0x246c22);logger[_0xfc35('0x10')]('UpdateWhatsappQueueReport',_0x246c22,JSON['stringify'](_0x4cfc6b));_0x89ac3f(_0x4cfc6b);})[_0xfc35('0x16')](function(_0x2ecf09){logger[_0xfc35('0x12')]('UpdateWhatsappQueueReport',_0x2ecf09[_0xfc35('0x15')],_0x246c22);_0x4e2340(_0x1f80d1[_0xfc35('0x12')](0x1f4,_0x2ecf09[_0xfc35('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/index.js b/server/api/whatsappTransferReport/index.js index 61fca5e..e904e19 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 _0x284c=['/:id','update','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','show','post','create','put'];(function(_0x3be499,_0x3a53cb){var _0xe62d45=function(_0xc55ef7){while(--_0xc55ef7){_0x3be499['push'](_0x3be499['shift']());}};_0xe62d45(++_0x3a53cb);}(_0x284c,0x1bd));var _0xc284=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x284c[_0x14add3];return _0x4a174f;};'use strict';var multer=require('multer');var util=require(_0xc284('0x0'));var path=require(_0xc284('0x1'));var timeout=require(_0xc284('0x2'));var express=require(_0xc284('0x3'));var router=express[_0xc284('0x4')]();var fs_extra=require(_0xc284('0x5'));var auth=require(_0xc284('0x6'));var interaction=require(_0xc284('0x7'));var config=require(_0xc284('0x8'));var controller=require('./whatsappTransferReport.controller');router[_0xc284('0x9')]('/',auth[_0xc284('0xa')](),controller[_0xc284('0xb')]);router[_0xc284('0x9')](_0xc284('0xc'),auth[_0xc284('0xa')](),controller['describe']);router[_0xc284('0x9')]('/:id',auth[_0xc284('0xa')](),controller[_0xc284('0xd')]);router[_0xc284('0xe')]('/',auth[_0xc284('0xa')](),controller[_0xc284('0xf')]);router[_0xc284('0x10')](_0xc284('0x11'),auth[_0xc284('0xa')](),controller[_0xc284('0x12')]);router['delete']('/:id',auth[_0xc284('0xa')](),controller[_0xc284('0x13')]);module[_0xc284('0x14')]=router; \ No newline at end of file +var _0xd895=['delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappTransferReport.controller','get','isAuthenticated','index','post','/:id','update'];(function(_0x372083,_0x5a552a){var _0x3dfa97=function(_0x4b511c){while(--_0x4b511c){_0x372083['push'](_0x372083['shift']());}};_0x3dfa97(++_0x5a552a);}(_0xd895,0xae));var _0x5d89=function(_0x494dcb,_0xcb7707){_0x494dcb=_0x494dcb-0x0;var _0x3abf45=_0xd895[_0x494dcb];return _0x3abf45;};'use strict';var multer=require(_0x5d89('0x0'));var util=require(_0x5d89('0x1'));var path=require(_0x5d89('0x2'));var timeout=require(_0x5d89('0x3'));var express=require(_0x5d89('0x4'));var router=express[_0x5d89('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x5d89('0x6'));var interaction=require(_0x5d89('0x7'));var config=require(_0x5d89('0x8'));var controller=require(_0x5d89('0x9'));router[_0x5d89('0xa')]('/',auth[_0x5d89('0xb')](),controller[_0x5d89('0xc')]);router['get']('/describe',auth[_0x5d89('0xb')](),controller['describe']);router['get']('/:id',auth[_0x5d89('0xb')](),controller['show']);router[_0x5d89('0xd')]('/',auth[_0x5d89('0xb')](),controller['create']);router['put'](_0x5d89('0xe'),auth[_0x5d89('0xb')](),controller[_0x5d89('0xf')]);router[_0x5d89('0x10')](_0x5d89('0xe'),auth[_0x5d89('0xb')](),controller[_0x5d89('0x11')]);module[_0x5d89('0x12')]=router; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js b/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js index 4891433..4808f1e 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 _0xb03e=['DATE','exports','STRING','ENUM','account','agent','queue'];(function(_0x9d58ed,_0x545f09){var _0x1f558a=function(_0x4b44c2){while(--_0x4b44c2){_0x9d58ed['push'](_0x9d58ed['shift']());}};_0x1f558a(++_0x545f09);}(_0xb03e,0x1eb));var _0xeb03=function(_0x81f98c,_0x424e02){_0x81f98c=_0x81f98c-0x0;var _0x54894f=_0xb03e[_0x81f98c];return _0x54894f;};'use strict';var Sequelize=require('sequelize');module[_0xeb03('0x0')]={'uniqueid':{'type':Sequelize[_0xeb03('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0xeb03('0x2')](_0xeb03('0x3'),_0xeb03('0x4'),_0xeb03('0x5')),'allowNull':![]},'transferredAt':{'type':Sequelize[_0xeb03('0x6')]}}; \ No newline at end of file +var _0x1c9a=['agent','queue','sequelize','STRING','account'];(function(_0x5c7a85,_0x41dd19){var _0x35290f=function(_0x26215b){while(--_0x26215b){_0x5c7a85['push'](_0x5c7a85['shift']());}};_0x35290f(++_0x41dd19);}(_0x1c9a,0x98));var _0xa1c9=function(_0x437ca9,_0x36ef5b){_0x437ca9=_0x437ca9-0x0;var _0xc7ec1a=_0x1c9a[_0x437ca9];return _0xc7ec1a;};'use strict';var Sequelize=require(_0xa1c9('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xa1c9('0x1')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xa1c9('0x2'),_0xa1c9('0x3'),_0xa1c9('0x4')),'allowNull':![]},'transferredAt':{'type':Sequelize['DATE']}}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.controller.js b/server/api/whatsappTransferReport/whatsappTransferReport.controller.js index dd10713..0d94f14 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 _0x5490=['set','apply','save','update','then','destroy','end','error','stack','name','send','index','fieldName','type','model','map','query','keys','filters','attributes','intersection','fields','length','sort','where','pick','filter','merge','VIRTUAL','WhatsappTransferReport','includeAll','include','findAll','rows','catch','show','params','rawAttributes','options','find','body','describe','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','limit','undefined','count','offset'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5490,0x152));var _0x0549=function(_0x3e3526,_0x5b18ba){_0x3e3526=_0x3e3526-0x0;var _0x327df4=_0x5490[_0x3e3526];return _0x327df4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0549('0x0'));var zipdir=require(_0x0549('0x1'));var jsonpatch=require(_0x0549('0x2'));var rp=require(_0x0549('0x3'));var moment=require('moment');var BPromise=require(_0x0549('0x4'));var Mustache=require(_0x0549('0x5'));var util=require('util');var path=require(_0x0549('0x6'));var sox=require(_0x0549('0x7'));var csv=require(_0x0549('0x8'));var ejs=require(_0x0549('0x9'));var fs=require('fs');var fs_extra=require(_0x0549('0xa'));var _=require('lodash');var squel=require(_0x0549('0xb'));var crypto=require(_0x0549('0xc'));var jsforce=require(_0x0549('0xd'));var deskjs=require(_0x0549('0xe'));var toCsv=require(_0x0549('0x8'));var querystring=require(_0x0549('0xf'));var Papa=require('papaparse');var Redis=require(_0x0549('0x10'));var authService=require(_0x0549('0x11'));var qs=require(_0x0549('0x12'));var as=require(_0x0549('0x13'));var hardwareService=require(_0x0549('0x14'));var logger=require(_0x0549('0x15'))('api');var utils=require(_0x0549('0x16'));var config=require(_0x0549('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x0549('0x18'))['db'];function respondWithStatusCode(_0x2aac61,_0x23ea0a){_0x23ea0a=_0x23ea0a||0xcc;return function(_0x547b69){if(_0x547b69){return _0x2aac61[_0x0549('0x19')](_0x23ea0a);}return _0x2aac61[_0x0549('0x1a')](_0x23ea0a)['end']();};}function respondWithResult(_0x1e725f,_0x87abc){_0x87abc=_0x87abc||0xc8;return function(_0xbae0f6){if(_0xbae0f6){return _0x1e725f[_0x0549('0x1a')](_0x87abc)[_0x0549('0x1b')](_0xbae0f6);}};}function respondWithFilteredResult(_0x3904dc,_0x2d84f9){return function(_0xba217d){if(_0xba217d){var _0x234506=typeof _0x2d84f9['offset']==='undefined'&&typeof _0x2d84f9[_0x0549('0x1c')]===_0x0549('0x1d');var _0x45bb33=_0xba217d['count'];var _0x23ecb4=_0x234506?0x0:_0x2d84f9['offset'];var _0x404c80=_0x234506?_0xba217d[_0x0549('0x1e')]:_0x2d84f9[_0x0549('0x1f')]+_0x2d84f9[_0x0549('0x1c')];var _0x4d6cb5;if(_0x404c80>=_0x45bb33){_0x404c80=_0x45bb33;_0x4d6cb5=0xc8;}else{_0x4d6cb5=0xce;}_0x3904dc[_0x0549('0x1a')](_0x4d6cb5);return _0x3904dc[_0x0549('0x20')]('Content-Range',_0x23ecb4+'-'+_0x404c80+'/'+_0x45bb33)[_0x0549('0x1b')](_0xba217d);}return null;};}function patchUpdates(_0x110d89){return function(_0x45a472){try{jsonpatch[_0x0549('0x21')](_0x45a472,_0x110d89,!![]);}catch(_0x245883){return BPromise['reject'](_0x245883);}return _0x45a472[_0x0549('0x22')]();};}function saveUpdates(_0x593ccc,_0x26a575){return function(_0x2df92f){if(_0x2df92f){return _0x2df92f[_0x0549('0x23')](_0x593ccc)[_0x0549('0x24')](function(_0x1d6912){return _0x1d6912;});}return null;};}function removeEntity(_0x3c0f52,_0x2dd9ba){return function(_0x35a6af){if(_0x35a6af){return _0x35a6af[_0x0549('0x25')]()[_0x0549('0x24')](function(){_0x3c0f52[_0x0549('0x1a')](0xcc)[_0x0549('0x26')]();});}};}function handleEntityNotFound(_0x63989b,_0x388762){return function(_0x31a925){if(!_0x31a925){_0x63989b[_0x0549('0x19')](0x194);}return _0x31a925;};}function handleError(_0x3e3806,_0x53d279){_0x53d279=_0x53d279||0x1f4;return function(_0x65cc33){logger[_0x0549('0x27')](_0x65cc33[_0x0549('0x28')]);if(_0x65cc33[_0x0549('0x29')]){delete _0x65cc33[_0x0549('0x29')];}_0x3e3806['status'](_0x53d279)[_0x0549('0x2a')](_0x65cc33);};}exports[_0x0549('0x2b')]=function(_0xfe4f15,_0x44bbf9){var _0x51372b={},_0x4dc9b4={},_0x562138={'count':0x0,'rows':[]};var _0x386f38=_['map'](db['WhatsappTransferReport']['rawAttributes'],function(_0x51b36a){return{'name':_0x51b36a[_0x0549('0x2c')],'type':_0x51b36a[_0x0549('0x2d')]['key']};});_0x4dc9b4[_0x0549('0x2e')]=_[_0x0549('0x2f')](_0x386f38,'name');_0x4dc9b4[_0x0549('0x30')]=_[_0x0549('0x31')](_0xfe4f15['query']);_0x4dc9b4[_0x0549('0x32')]=_['intersection'](_0x4dc9b4[_0x0549('0x2e')],_0x4dc9b4[_0x0549('0x30')]);_0x51372b[_0x0549('0x33')]=_[_0x0549('0x34')](_0x4dc9b4[_0x0549('0x2e')],qs['fields'](_0xfe4f15['query'][_0x0549('0x35')]));_0x51372b['attributes']=_0x51372b[_0x0549('0x33')][_0x0549('0x36')]?_0x51372b[_0x0549('0x33')]:_0x4dc9b4['model'];if(!_0xfe4f15[_0x0549('0x30')]['hasOwnProperty']('nolimit')){_0x51372b[_0x0549('0x1c')]=qs['limit'](_0xfe4f15['query'][_0x0549('0x1c')]);_0x51372b[_0x0549('0x1f')]=qs[_0x0549('0x1f')](_0xfe4f15[_0x0549('0x30')][_0x0549('0x1f')]);}_0x51372b['order']=qs[_0x0549('0x37')](_0xfe4f15[_0x0549('0x30')][_0x0549('0x37')]);_0x51372b[_0x0549('0x38')]=qs[_0x0549('0x32')](_[_0x0549('0x39')](_0xfe4f15[_0x0549('0x30')],_0x4dc9b4[_0x0549('0x32')]),_0x386f38);if(_0xfe4f15['query'][_0x0549('0x3a')]){_0x51372b[_0x0549('0x38')]=_[_0x0549('0x3b')](_0x51372b[_0x0549('0x38')],{'$or':_[_0x0549('0x2f')](_0x386f38,function(_0xd18887){if(_0xd18887['type']!==_0x0549('0x3c')){var _0x22ddb0={};_0x22ddb0[_0xd18887[_0x0549('0x29')]]={'$like':'%'+_0xfe4f15['query']['filter']+'%'};return _0x22ddb0;}})});}_0x51372b=_['merge']({},_0x51372b,_0xfe4f15['options']);var _0x433c49={'where':_0x51372b[_0x0549('0x38')]};return db[_0x0549('0x3d')][_0x0549('0x1e')](_0x433c49)[_0x0549('0x24')](function(_0x1729e0){_0x562138[_0x0549('0x1e')]=_0x1729e0;if(_0xfe4f15[_0x0549('0x30')][_0x0549('0x3e')]){_0x51372b[_0x0549('0x3f')]=[{'all':!![]}];}return db[_0x0549('0x3d')][_0x0549('0x40')](_0x51372b);})[_0x0549('0x24')](function(_0x5c0a2b){_0x562138[_0x0549('0x41')]=_0x5c0a2b;return _0x562138;})['then'](respondWithFilteredResult(_0x44bbf9,_0x51372b))[_0x0549('0x42')](handleError(_0x44bbf9,null));};exports[_0x0549('0x43')]=function(_0x37624d,_0x2ae7e7){var _0x1b399a={'raw':!![],'where':{'id':_0x37624d[_0x0549('0x44')]['id']}},_0x3fd073={};_0x3fd073[_0x0549('0x2e')]=_[_0x0549('0x31')](db[_0x0549('0x3d')][_0x0549('0x45')]);_0x3fd073['query']=_[_0x0549('0x31')](_0x37624d[_0x0549('0x30')]);_0x3fd073['filters']=_[_0x0549('0x34')](_0x3fd073[_0x0549('0x2e')],_0x3fd073[_0x0549('0x30')]);_0x1b399a['attributes']=_[_0x0549('0x34')](_0x3fd073[_0x0549('0x2e')],qs[_0x0549('0x35')](_0x37624d[_0x0549('0x30')][_0x0549('0x35')]));_0x1b399a[_0x0549('0x33')]=_0x1b399a[_0x0549('0x33')][_0x0549('0x36')]?_0x1b399a[_0x0549('0x33')]:_0x3fd073[_0x0549('0x2e')];if(_0x37624d[_0x0549('0x30')][_0x0549('0x3e')]){_0x1b399a['include']=[{'all':!![]}];}_0x1b399a=_['merge']({},_0x1b399a,_0x37624d[_0x0549('0x46')]);return db[_0x0549('0x3d')][_0x0549('0x47')](_0x1b399a)[_0x0549('0x24')](handleEntityNotFound(_0x2ae7e7,null))[_0x0549('0x24')](respondWithResult(_0x2ae7e7,null))[_0x0549('0x42')](handleError(_0x2ae7e7,null));};exports['create']=function(_0x18439e,_0x4706fa){return db[_0x0549('0x3d')]['create'](_0x18439e['body'],{})['then'](respondWithResult(_0x4706fa,0xc9))[_0x0549('0x42')](handleError(_0x4706fa,null));};exports['update']=function(_0xaa6849,_0x4f0f94){if(_0xaa6849[_0x0549('0x48')]['id']){delete _0xaa6849[_0x0549('0x48')]['id'];}return db[_0x0549('0x3d')][_0x0549('0x47')]({'where':{'id':_0xaa6849[_0x0549('0x44')]['id']}})[_0x0549('0x24')](handleEntityNotFound(_0x4f0f94,null))[_0x0549('0x24')](saveUpdates(_0xaa6849[_0x0549('0x48')],null))[_0x0549('0x24')](respondWithResult(_0x4f0f94,null))['catch'](handleError(_0x4f0f94,null));};exports[_0x0549('0x25')]=function(_0x282b64,_0x349c50){return db['WhatsappTransferReport']['find']({'where':{'id':_0x282b64[_0x0549('0x44')]['id']}})[_0x0549('0x24')](handleEntityNotFound(_0x349c50,null))[_0x0549('0x24')](removeEntity(_0x349c50,null))[_0x0549('0x42')](handleError(_0x349c50,null));};exports[_0x0549('0x49')]=function(_0x33afb3,_0x57b10a){return db['WhatsappTransferReport'][_0x0549('0x49')]()[_0x0549('0x24')](respondWithResult(_0x57b10a,null))[_0x0549('0x42')](handleError(_0x57b10a,null));}; \ No newline at end of file +var _0xec18=['body','describe','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','update','then','destroy','end','error','stack','name','index','map','WhatsappTransferReport','rawAttributes','fieldName','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','show','params','find','catch','create'];(function(_0x461b30,_0x31dc82){var _0x89475b=function(_0x1e3467){while(--_0x1e3467){_0x461b30['push'](_0x461b30['shift']());}};_0x89475b(++_0x31dc82);}(_0xec18,0x12a));var _0x8ec1=function(_0x2864c0,_0x3ae98e){_0x2864c0=_0x2864c0-0x0;var _0x270ace=_0xec18[_0x2864c0];return _0x270ace;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8ec1('0x0'));var zipdir=require(_0x8ec1('0x1'));var jsonpatch=require(_0x8ec1('0x2'));var rp=require('request-promise');var moment=require(_0x8ec1('0x3'));var BPromise=require(_0x8ec1('0x4'));var Mustache=require(_0x8ec1('0x5'));var util=require(_0x8ec1('0x6'));var path=require(_0x8ec1('0x7'));var sox=require(_0x8ec1('0x8'));var csv=require(_0x8ec1('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8ec1('0xa'));var _=require(_0x8ec1('0xb'));var squel=require(_0x8ec1('0xc'));var crypto=require(_0x8ec1('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x8ec1('0x9'));var querystring=require(_0x8ec1('0xe'));var Papa=require(_0x8ec1('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x8ec1('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8ec1('0x11'));var logger=require(_0x8ec1('0x12'))(_0x8ec1('0x13'));var utils=require(_0x8ec1('0x14'));var config=require(_0x8ec1('0x15'));var licenseUtil=require(_0x8ec1('0x16'));var db=require(_0x8ec1('0x17'))['db'];function respondWithStatusCode(_0x483a5e,_0x47f6e2){_0x47f6e2=_0x47f6e2||0xcc;return function(_0x4e3f0d){if(_0x4e3f0d){return _0x483a5e[_0x8ec1('0x18')](_0x47f6e2);}return _0x483a5e[_0x8ec1('0x19')](_0x47f6e2)['end']();};}function respondWithResult(_0x37a768,_0x132309){_0x132309=_0x132309||0xc8;return function(_0x246ea9){if(_0x246ea9){return _0x37a768['status'](_0x132309)[_0x8ec1('0x1a')](_0x246ea9);}};}function respondWithFilteredResult(_0x5e30c9,_0x19814e){return function(_0x276c28){if(_0x276c28){var _0x4b88a9=typeof _0x19814e[_0x8ec1('0x1b')]===_0x8ec1('0x1c')&&typeof _0x19814e[_0x8ec1('0x1d')]===_0x8ec1('0x1c');var _0x4a3e21=_0x276c28[_0x8ec1('0x1e')];var _0x3ab47d=_0x4b88a9?0x0:_0x19814e[_0x8ec1('0x1b')];var _0x462624=_0x4b88a9?_0x276c28[_0x8ec1('0x1e')]:_0x19814e['offset']+_0x19814e[_0x8ec1('0x1d')];var _0x2b5b74;if(_0x462624>=_0x4a3e21){_0x462624=_0x4a3e21;_0x2b5b74=0xc8;}else{_0x2b5b74=0xce;}_0x5e30c9[_0x8ec1('0x19')](_0x2b5b74);return _0x5e30c9['set'](_0x8ec1('0x1f'),_0x3ab47d+'-'+_0x462624+'/'+_0x4a3e21)['json'](_0x276c28);}return null;};}function patchUpdates(_0x44faa5){return function(_0x28ae5b){try{jsonpatch[_0x8ec1('0x20')](_0x28ae5b,_0x44faa5,!![]);}catch(_0x222b41){return BPromise[_0x8ec1('0x21')](_0x222b41);}return _0x28ae5b['save']();};}function saveUpdates(_0x5a8e7a,_0x39274d){return function(_0x4d3dfd){if(_0x4d3dfd){return _0x4d3dfd[_0x8ec1('0x22')](_0x5a8e7a)[_0x8ec1('0x23')](function(_0x12ac8f){return _0x12ac8f;});}return null;};}function removeEntity(_0x460b10,_0x559677){return function(_0x54c041){if(_0x54c041){return _0x54c041[_0x8ec1('0x24')]()[_0x8ec1('0x23')](function(){_0x460b10[_0x8ec1('0x19')](0xcc)[_0x8ec1('0x25')]();});}};}function handleEntityNotFound(_0x1b1846,_0x3ef82b){return function(_0x4362e4){if(!_0x4362e4){_0x1b1846['sendStatus'](0x194);}return _0x4362e4;};}function handleError(_0x592ed2,_0x40db42){_0x40db42=_0x40db42||0x1f4;return function(_0x99763e){logger[_0x8ec1('0x26')](_0x99763e[_0x8ec1('0x27')]);if(_0x99763e[_0x8ec1('0x28')]){delete _0x99763e[_0x8ec1('0x28')];}_0x592ed2['status'](_0x40db42)['send'](_0x99763e);};}exports[_0x8ec1('0x29')]=function(_0x1d8d6c,_0x4f0774){var _0x305ab6={},_0x3b8847={},_0x2ca8b3={'count':0x0,'rows':[]};var _0x24316f=_[_0x8ec1('0x2a')](db[_0x8ec1('0x2b')][_0x8ec1('0x2c')],function(_0x4e3eff){return{'name':_0x4e3eff[_0x8ec1('0x2d')],'type':_0x4e3eff['type']['key']};});_0x3b8847[_0x8ec1('0x2e')]=_[_0x8ec1('0x2a')](_0x24316f,_0x8ec1('0x28'));_0x3b8847[_0x8ec1('0x2f')]=_[_0x8ec1('0x30')](_0x1d8d6c[_0x8ec1('0x2f')]);_0x3b8847[_0x8ec1('0x31')]=_['intersection'](_0x3b8847[_0x8ec1('0x2e')],_0x3b8847[_0x8ec1('0x2f')]);_0x305ab6[_0x8ec1('0x32')]=_[_0x8ec1('0x33')](_0x3b8847[_0x8ec1('0x2e')],qs[_0x8ec1('0x34')](_0x1d8d6c[_0x8ec1('0x2f')][_0x8ec1('0x34')]));_0x305ab6[_0x8ec1('0x32')]=_0x305ab6[_0x8ec1('0x32')][_0x8ec1('0x35')]?_0x305ab6[_0x8ec1('0x32')]:_0x3b8847[_0x8ec1('0x2e')];if(!_0x1d8d6c[_0x8ec1('0x2f')][_0x8ec1('0x36')](_0x8ec1('0x37'))){_0x305ab6['limit']=qs[_0x8ec1('0x1d')](_0x1d8d6c[_0x8ec1('0x2f')][_0x8ec1('0x1d')]);_0x305ab6[_0x8ec1('0x1b')]=qs['offset'](_0x1d8d6c['query'][_0x8ec1('0x1b')]);}_0x305ab6[_0x8ec1('0x38')]=qs[_0x8ec1('0x39')](_0x1d8d6c[_0x8ec1('0x2f')][_0x8ec1('0x39')]);_0x305ab6[_0x8ec1('0x3a')]=qs[_0x8ec1('0x31')](_['pick'](_0x1d8d6c[_0x8ec1('0x2f')],_0x3b8847[_0x8ec1('0x31')]),_0x24316f);if(_0x1d8d6c['query'][_0x8ec1('0x3b')]){_0x305ab6[_0x8ec1('0x3a')]=_[_0x8ec1('0x3c')](_0x305ab6[_0x8ec1('0x3a')],{'$or':_[_0x8ec1('0x2a')](_0x24316f,function(_0x2bf398){if(_0x2bf398[_0x8ec1('0x3d')]!==_0x8ec1('0x3e')){var _0x3da170={};_0x3da170[_0x2bf398[_0x8ec1('0x28')]]={'$like':'%'+_0x1d8d6c[_0x8ec1('0x2f')]['filter']+'%'};return _0x3da170;}})});}_0x305ab6=_[_0x8ec1('0x3c')]({},_0x305ab6,_0x1d8d6c[_0x8ec1('0x3f')]);var _0x52be66={'where':_0x305ab6[_0x8ec1('0x3a')]};return db[_0x8ec1('0x2b')][_0x8ec1('0x1e')](_0x52be66)[_0x8ec1('0x23')](function(_0xba9290){_0x2ca8b3[_0x8ec1('0x1e')]=_0xba9290;if(_0x1d8d6c[_0x8ec1('0x2f')][_0x8ec1('0x40')]){_0x305ab6[_0x8ec1('0x41')]=[{'all':!![]}];}return db[_0x8ec1('0x2b')][_0x8ec1('0x42')](_0x305ab6);})[_0x8ec1('0x23')](function(_0x35c32b){_0x2ca8b3['rows']=_0x35c32b;return _0x2ca8b3;})['then'](respondWithFilteredResult(_0x4f0774,_0x305ab6))['catch'](handleError(_0x4f0774,null));};exports[_0x8ec1('0x43')]=function(_0x30af15,_0x242c77){var _0x72b534={'raw':!![],'where':{'id':_0x30af15[_0x8ec1('0x44')]['id']}},_0x74605={};_0x74605[_0x8ec1('0x2e')]=_['keys'](db[_0x8ec1('0x2b')]['rawAttributes']);_0x74605[_0x8ec1('0x2f')]=_[_0x8ec1('0x30')](_0x30af15[_0x8ec1('0x2f')]);_0x74605['filters']=_[_0x8ec1('0x33')](_0x74605[_0x8ec1('0x2e')],_0x74605['query']);_0x72b534[_0x8ec1('0x32')]=_[_0x8ec1('0x33')](_0x74605[_0x8ec1('0x2e')],qs[_0x8ec1('0x34')](_0x30af15[_0x8ec1('0x2f')]['fields']));_0x72b534['attributes']=_0x72b534[_0x8ec1('0x32')][_0x8ec1('0x35')]?_0x72b534[_0x8ec1('0x32')]:_0x74605[_0x8ec1('0x2e')];if(_0x30af15['query']['includeAll']){_0x72b534[_0x8ec1('0x41')]=[{'all':!![]}];}_0x72b534=_[_0x8ec1('0x3c')]({},_0x72b534,_0x30af15[_0x8ec1('0x3f')]);return db['WhatsappTransferReport'][_0x8ec1('0x45')](_0x72b534)['then'](handleEntityNotFound(_0x242c77,null))['then'](respondWithResult(_0x242c77,null))[_0x8ec1('0x46')](handleError(_0x242c77,null));};exports[_0x8ec1('0x47')]=function(_0x521e14,_0x411053){return db[_0x8ec1('0x2b')][_0x8ec1('0x47')](_0x521e14[_0x8ec1('0x48')],{})[_0x8ec1('0x23')](respondWithResult(_0x411053,0xc9))[_0x8ec1('0x46')](handleError(_0x411053,null));};exports[_0x8ec1('0x22')]=function(_0x3f6527,_0x4db913){if(_0x3f6527[_0x8ec1('0x48')]['id']){delete _0x3f6527[_0x8ec1('0x48')]['id'];}return db[_0x8ec1('0x2b')]['find']({'where':{'id':_0x3f6527[_0x8ec1('0x44')]['id']}})[_0x8ec1('0x23')](handleEntityNotFound(_0x4db913,null))[_0x8ec1('0x23')](saveUpdates(_0x3f6527['body'],null))[_0x8ec1('0x23')](respondWithResult(_0x4db913,null))[_0x8ec1('0x46')](handleError(_0x4db913,null));};exports[_0x8ec1('0x24')]=function(_0x50dcc8,_0x402007){return db[_0x8ec1('0x2b')][_0x8ec1('0x45')]({'where':{'id':_0x50dcc8[_0x8ec1('0x44')]['id']}})[_0x8ec1('0x23')](handleEntityNotFound(_0x402007,null))[_0x8ec1('0x23')](removeEntity(_0x402007,null))['catch'](handleError(_0x402007,null));};exports[_0x8ec1('0x49')]=function(_0x370d45,_0x41d7c8){return db['WhatsappTransferReport'][_0x8ec1('0x49')]()[_0x8ec1('0x23')](respondWithResult(_0x41d7c8,null))[_0x8ec1('0x46')](handleError(_0x41d7c8,null));}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.model.js b/server/api/whatsappTransferReport/whatsappTransferReport.model.js index cbf5d3d..723b62f 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 _0x39f9=['exports','WhatsappTransferReport','report_whatsapp_transfer','uniqueid','lodash','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./whatsappTransferReport.attributes'];(function(_0x33f118,_0xd56380){var _0x1d6fd7=function(_0x5ea0ec){while(--_0x5ea0ec){_0x33f118['push'](_0x33f118['shift']());}};_0x1d6fd7(++_0xd56380);}(_0x39f9,0xe1));var _0x939f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x39f9[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x939f('0x0'));var util=require('util');var logger=require(_0x939f('0x1'))(_0x939f('0x2'));var moment=require(_0x939f('0x3'));var BPromise=require(_0x939f('0x4'));var rp=require(_0x939f('0x5'));var fs=require('fs');var path=require(_0x939f('0x6'));var rimraf=require('rimraf');var config=require(_0x939f('0x7'));var attributes=require(_0x939f('0x8'));module[_0x939f('0x9')]=function(_0x587176,_0x194eaf){return _0x587176['define'](_0x939f('0xa'),attributes,{'tableName':_0x939f('0xb'),'paranoid':![],'indexes':[{'name':_0x939f('0xc'),'fields':[_0x939f('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xfaaf=['exports','define','WhatsappTransferReport','report_whatsapp_transfer','uniqueid','lodash','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment','./whatsappTransferReport.attributes'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xfaaf,0x171));var _0xffaa=function(_0x1dce91,_0x5021c7){_0x1dce91=_0x1dce91-0x0;var _0x57834e=_0xfaaf[_0x1dce91];return _0x57834e;};'use strict';var _=require(_0xffaa('0x0'));var util=require(_0xffaa('0x1'));var logger=require(_0xffaa('0x2'))(_0xffaa('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xffaa('0x4'));var fs=require('fs');var path=require(_0xffaa('0x5'));var rimraf=require(_0xffaa('0x6'));var config=require(_0xffaa('0x7'));var attributes=require(_0xffaa('0x8'));module[_0xffaa('0x9')]=function(_0x1da030,_0x13bfba){return _0x1da030[_0xffaa('0xa')](_0xffaa('0xb'),attributes,{'tableName':_0xffaa('0xc'),'paranoid':![],'indexes':[{'name':_0xffaa('0xd'),'fields':[_0xffaa('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 8fc8c1d..2b121e6 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 _0xc2d8=['moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','WhatsappTransferReport,\x20%s,\x20%s','WhatsappTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash'];(function(_0x32f26d,_0x2c0b5d){var _0x5d9ddc=function(_0x1f0e26){while(--_0x1f0e26){_0x32f26d['push'](_0x32f26d['shift']());}};_0x5d9ddc(++_0x2c0b5d);}(_0xc2d8,0x1b4));var _0x8c2d=function(_0x16432,_0x21b51b){_0x16432=_0x16432-0x0;var _0xd4a3f2=_0xc2d8[_0x16432];return _0xd4a3f2;};'use strict';var _=require(_0x8c2d('0x0'));var util=require('util');var moment=require(_0x8c2d('0x1'));var BPromise=require('bluebird');var rs=require(_0x8c2d('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8c2d('0x3'))['db'];var utils=require(_0x8c2d('0x4'));var logger=require(_0x8c2d('0x5'))(_0x8c2d('0x6'));var config=require(_0x8c2d('0x7'));var jayson=require(_0x8c2d('0x8'));var client=jayson[_0x8c2d('0x9')][_0x8c2d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x55f149,_0x4c369f,_0x2e3aa5){return new BPromise(function(_0x4c238f,_0x40789b){return client[_0x8c2d('0xb')](_0x55f149,_0x2e3aa5)[_0x8c2d('0xc')](function(_0x226695){logger[_0x8c2d('0xd')](_0x8c2d('0xe'),_0x4c369f,'request\x20sent');logger['debug'](_0x8c2d('0xf'),_0x4c369f,_0x8c2d('0x10'),JSON[_0x8c2d('0x11')](_0x226695));if(_0x226695[_0x8c2d('0x12')]){if(_0x226695[_0x8c2d('0x12')][_0x8c2d('0x13')]===0x1f4){logger[_0x8c2d('0x12')]('WhatsappTransferReport,\x20%s,\x20%s',_0x4c369f,_0x226695['error']['message']);return _0x40789b(_0x226695[_0x8c2d('0x12')][_0x8c2d('0x14')]);}logger[_0x8c2d('0x12')](_0x8c2d('0xe'),_0x4c369f,_0x226695[_0x8c2d('0x12')]['message']);return _0x4c238f(_0x226695['error']['message']);}else{logger['info'](_0x8c2d('0xe'),_0x4c369f,'request\x20sent');_0x4c238f(_0x226695[_0x8c2d('0x15')][_0x8c2d('0x14')]);}})[_0x8c2d('0x16')](function(_0x1caee7){logger[_0x8c2d('0x12')](_0x8c2d('0xe'),_0x4c369f,_0x1caee7);_0x40789b(_0x1caee7);});});} \ No newline at end of file +var _0xa00d=['debug','WhatsappTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','WhatsappTransferReport,\x20%s,\x20%s','request\x20sent'];(function(_0x222909,_0x8cfb5){var _0x32c706=function(_0x59d027){while(--_0x59d027){_0x222909['push'](_0x222909['shift']());}};_0x32c706(++_0x8cfb5);}(_0xa00d,0x14c));var _0xda00=function(_0x314005,_0x133f31){_0x314005=_0x314005-0x0;var _0x364be5=_0xa00d[_0x314005];return _0x364be5;};'use strict';var _=require(_0xda00('0x0'));var util=require(_0xda00('0x1'));var moment=require(_0xda00('0x2'));var BPromise=require(_0xda00('0x3'));var rs=require(_0xda00('0x4'));var fs=require('fs');var Redis=require(_0xda00('0x5'));var db=require(_0xda00('0x6'))['db'];var utils=require(_0xda00('0x7'));var logger=require(_0xda00('0x8'))(_0xda00('0x9'));var config=require(_0xda00('0xa'));var jayson=require(_0xda00('0xb'));var client=jayson[_0xda00('0xc')][_0xda00('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x251fbb,_0x528b2d,_0x575454){return new BPromise(function(_0x1a09fe,_0x59659e){return client['request'](_0x251fbb,_0x575454)[_0xda00('0xe')](function(_0x106ff3){logger[_0xda00('0xf')](_0xda00('0x10'),_0x528b2d,_0xda00('0x11'));logger[_0xda00('0x12')](_0xda00('0x13'),_0x528b2d,_0xda00('0x11'),JSON[_0xda00('0x14')](_0x106ff3));if(_0x106ff3[_0xda00('0x15')]){if(_0x106ff3[_0xda00('0x15')][_0xda00('0x16')]===0x1f4){logger[_0xda00('0x15')](_0xda00('0x10'),_0x528b2d,_0x106ff3[_0xda00('0x15')]['message']);return _0x59659e(_0x106ff3['error']['message']);}logger[_0xda00('0x15')](_0xda00('0x10'),_0x528b2d,_0x106ff3[_0xda00('0x15')][_0xda00('0x17')]);return _0x1a09fe(_0x106ff3[_0xda00('0x15')]['message']);}else{logger[_0xda00('0xf')](_0xda00('0x10'),_0x528b2d,_0xda00('0x11'));_0x1a09fe(_0x106ff3['result']['message']);}})[_0xda00('0x18')](function(_0x304f66){logger['error'](_0xda00('0x10'),_0x528b2d,_0x304f66);_0x59659e(_0x304f66);});});} \ No newline at end of file diff --git a/server/app.js b/server/app.js index d6041b9..2b90a16 100644 --- a/server/app.js +++ b/server/app.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd6d2=['./mysqldb','./config/license','./rpc','./config/logger','./config/pm2','./config/pm2/config','./config/schedule','./config/schedule/whatsapp','./config/schedule/transcribe','./config/schedule/cloud-provider','sequelize','sync','then','seedDB','default','info','start','exitCode','number','length','pm2_env','name','Online\x20apps:','map','filter','online','join','Offline\x20apps:','status','None','App\x20Ready!','catch','error','lodash'];(function(_0x403c20,_0x4a7b99){var _0x2b271a=function(_0x106ecb){while(--_0x106ecb){_0x403c20['push'](_0x403c20['shift']());}};_0x2b271a(++_0x4a7b99);}(_0xd6d2,0xcb));var _0x2d6d=function(_0x50bf9a,_0x2cb0a1){_0x50bf9a=_0x50bf9a-0x0;var _0x2fec58=_0xd6d2[_0x50bf9a];return _0x2fec58;};'use strict';var _=require(_0x2d6d('0x0'));var db=require(_0x2d6d('0x1'))['db'];var seedDb=require('./config/seedDB');var checkLicense=require(_0x2d6d('0x2'));var rpc=require(_0x2d6d('0x3'));var config=require('./config/environment');var logger=require(_0x2d6d('0x4'))('app');var pm2=require(_0x2d6d('0x5'));var pm2Config=require(_0x2d6d('0x6'));var schedule=require(_0x2d6d('0x7'));var chat=require('./config/schedule/chat');var whatsapp=require(_0x2d6d('0x8'));var transcribe=require(_0x2d6d('0x9'));var provider=require(_0x2d6d('0xa'));function main(){return db[_0x2d6d('0xb')][_0x2d6d('0xc')]()[_0x2d6d('0xd')](function(){if(config[_0x2d6d('0xe')]){return seedDb[_0x2d6d('0xf')]();}})[_0x2d6d('0xd')](function(){return checkLicense[_0x2d6d('0xf')]();})[_0x2d6d('0xd')](function(){return rpc['listen']();})[_0x2d6d('0xd')](function(_0x32a9c3){logger[_0x2d6d('0x10')](_0x32a9c3);return chat[_0x2d6d('0x11')]();})[_0x2d6d('0xd')](function(){return whatsapp['start']();})[_0x2d6d('0xd')](function(){return schedule[_0x2d6d('0x11')]();})[_0x2d6d('0xd')](function(){return transcribe[_0x2d6d('0x11')]();})[_0x2d6d('0xd')](function(){return provider['start']();})[_0x2d6d('0xd')](function(_0x156188){logger[_0x2d6d('0x10')](_0x156188);return pm2[_0x2d6d('0x11')](pm2Config);})['then'](function(_0x1ec6aa){var _0x40a6a9=_0x1ec6aa['filter'](function(_0x586085){return typeof _0x586085[_0x2d6d('0x12')]===_0x2d6d('0x13')&&_0x586085[_0x2d6d('0x12')]>=0x0;});if(_0x40a6a9['length']>0x0){throw new Error(_0x40a6a9[_0x2d6d('0x14')]+'\x20processes\x20failed\x20at\x20startup:\x20'+_['map'](_0x40a6a9,function(_0x4c3092){return'\x22'+_0x4c3092[_0x2d6d('0x15')][_0x2d6d('0x16')]+'\x22';}));}logger[_0x2d6d('0x10')](_0x2d6d('0x17'),_[_0x2d6d('0x18')](_[_0x2d6d('0x19')](_0x1ec6aa,{'status':_0x2d6d('0x1a')}),_0x2d6d('0x16'))[_0x2d6d('0x1b')]());logger['info'](_0x2d6d('0x1c'),_[_0x2d6d('0x18')](_['filter'](_0x1ec6aa,function(_0x227e44){return _0x227e44[_0x2d6d('0x1d')]!==_0x2d6d('0x1a');}),_0x2d6d('0x16'))[_0x2d6d('0x1b')]()||_0x2d6d('0x1e'));console['log'](_0x2d6d('0x1f'));})[_0x2d6d('0x20')](function(_0x3d5399){console['log']('Server\x20failed\x20to\x20start\x20due\x20to\x20error!',_0x3d5399);logger[_0x2d6d('0x21')]('Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s',_0x3d5399);process['exit'](0x1);});}main(); \ No newline at end of file +var _0xaa3f=['None','log','App\x20Ready!','Server\x20failed\x20to\x20start\x20due\x20to\x20error!','error','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','exit','lodash','./mysqldb','./config/seedDB','./config/license','./rpc','./config/environment','./config/logger','app','./config/pm2','./config/schedule/chat','./config/schedule/transcribe','./config/schedule/cloud-provider','sequelize','sync','then','seedDB','default','info','start','filter','exitCode','length','\x20processes\x20failed\x20at\x20startup:\x20','map','online','name','join','Offline\x20apps:','status'];(function(_0x1969a7,_0x5a133a){var _0x3d665f=function(_0x39c64b){while(--_0x39c64b){_0x1969a7['push'](_0x1969a7['shift']());}};_0x3d665f(++_0x5a133a);}(_0xaa3f,0xbb));var _0xfaa3=function(_0xc3ca5e,_0x184b39){_0xc3ca5e=_0xc3ca5e-0x0;var _0x2a7387=_0xaa3f[_0xc3ca5e];return _0x2a7387;};'use strict';var _=require(_0xfaa3('0x0'));var db=require(_0xfaa3('0x1'))['db'];var seedDb=require(_0xfaa3('0x2'));var checkLicense=require(_0xfaa3('0x3'));var rpc=require(_0xfaa3('0x4'));var config=require(_0xfaa3('0x5'));var logger=require(_0xfaa3('0x6'))(_0xfaa3('0x7'));var pm2=require(_0xfaa3('0x8'));var pm2Config=require('./config/pm2/config');var schedule=require('./config/schedule');var chat=require(_0xfaa3('0x9'));var whatsapp=require('./config/schedule/whatsapp');var transcribe=require(_0xfaa3('0xa'));var provider=require(_0xfaa3('0xb'));function main(){return db[_0xfaa3('0xc')][_0xfaa3('0xd')]()[_0xfaa3('0xe')](function(){if(config[_0xfaa3('0xf')]){return seedDb[_0xfaa3('0x10')]();}})['then'](function(){return checkLicense[_0xfaa3('0x10')]();})[_0xfaa3('0xe')](function(){return rpc['listen']();})['then'](function(_0x44d88e){logger[_0xfaa3('0x11')](_0x44d88e);return chat[_0xfaa3('0x12')]();})[_0xfaa3('0xe')](function(){return whatsapp[_0xfaa3('0x12')]();})[_0xfaa3('0xe')](function(){return schedule['start']();})[_0xfaa3('0xe')](function(){return transcribe['start']();})[_0xfaa3('0xe')](function(){return provider[_0xfaa3('0x12')]();})[_0xfaa3('0xe')](function(_0x58f71b){logger[_0xfaa3('0x11')](_0x58f71b);return pm2['start'](pm2Config);})[_0xfaa3('0xe')](function(_0x84b465){var _0x2361a9=_0x84b465[_0xfaa3('0x13')](function(_0x1243ed){return typeof _0x1243ed[_0xfaa3('0x14')]==='number'&&_0x1243ed['exitCode']>=0x0;});if(_0x2361a9[_0xfaa3('0x15')]>0x0){throw new Error(_0x2361a9[_0xfaa3('0x15')]+_0xfaa3('0x16')+_[_0xfaa3('0x17')](_0x2361a9,function(_0x4e54e4){return'\x22'+_0x4e54e4['pm2_env']['name']+'\x22';}));}logger['info']('Online\x20apps:',_[_0xfaa3('0x17')](_['filter'](_0x84b465,{'status':_0xfaa3('0x18')}),_0xfaa3('0x19'))[_0xfaa3('0x1a')]());logger[_0xfaa3('0x11')](_0xfaa3('0x1b'),_[_0xfaa3('0x17')](_[_0xfaa3('0x13')](_0x84b465,function(_0x1ab9cc){return _0x1ab9cc[_0xfaa3('0x1c')]!==_0xfaa3('0x18');}),'name')[_0xfaa3('0x1a')]()||_0xfaa3('0x1d'));console[_0xfaa3('0x1e')](_0xfaa3('0x1f'));})['catch'](function(_0x1f7324){console[_0xfaa3('0x1e')](_0xfaa3('0x20'),_0x1f7324);logger[_0xfaa3('0x21')](_0xfaa3('0x22'),_0x1f7324);process[_0xfaa3('0x23')](0x1);});}main(); \ No newline at end of file diff --git a/server/components/auth/service.js b/server/components/auth/service.js index c965c2b..aa4a850 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 _0x0b0e=['../encryptor','lodash','jsonwebtoken','express-jwt','composable-middleware','basic-auth','crypto','bluebird','util','moment','secrets','fullname','name','internal','email','permissions','md5secret','chatPause','mailPause','smsPause','openchannelPause','pauseType','lastLoginAt','lastPauseAt','crudPermissions','allowmessenger','passwordResetAt','phoneBarAutoAnswer','phoneBarAutoAnswerDelay','phoneBarDnd','phoneBarEnableRecording','phoneBarEnableDtmfTone','phoneBarExpires','phoneBarRemoteControl','phoneBarRemoteControlPort','interface','privacyEnabled','settingsEnabled','downloadOmnichannelInteractions','chatAutoanswer','emailAutoanswerDelay','smsAutoanswerDelay','openchannelAutoanswerDelay','faxAutoanswer','faxAutoanswerDelay','whatsappAutoanswer','whatsappAutoanswerDelay','isAuthenticated','user','findOne','closed','then','disposition','json','unmanaged','Unmanaged.','Forbidden.','catch','headers','authorization','startsWith','Basic','find','authenticate','status','Wrong\x20credentials.','Bearer','Unknown\x20authorization\x20format','query','apikey','getUuid','User','sub','Setting','isEqual','apiKeyNonce','nonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','disabled','Invalid\x20API\x20access\x20key','blocked','blockDuration','blockedAt','add','minutes','use','User\x20not\x20found.','canUpdate','getLicense','Forbidden','isWebrtcLicence','webrtc','signToken','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','redirect','/dashboards/general','send','retrieveApiKey','isNil','generateApiKey','apiKeyIat','validatePasswordPattern','test','Sequelize','ValidationError','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','length','splice','unshift','encryptString','promisify','sign','secret','session','options','verify','randomBytes','toString','hex','floor','now','HS512','../../mysqldb','../../config/license/hardware'];(function(_0x47fe6c,_0x417582){var _0x5588bf=function(_0x552a15){while(--_0x552a15){_0x47fe6c['push'](_0x47fe6c['shift']());}};_0x5588bf(++_0x417582);}(_0x0b0e,0x187));var _0xe0b0=function(_0x48a836,_0xa1d010){_0x48a836=_0x48a836-0x0;var _0x249dc8=_0x0b0e[_0x48a836];return _0x249dc8;};'use strict';var db=require(_0xe0b0('0x0'))['db'];var config=require('../../config/environment');var hardwareConf=require(_0xe0b0('0x1'));var licenseUtil=require('../../config/license/util');var encryptor=require(_0xe0b0('0x2'));var _=require(_0xe0b0('0x3'));var jwt=require(_0xe0b0('0x4'));var expressJwt=require(_0xe0b0('0x5'));var compose=require(_0xe0b0('0x6'));var basicAuth=require(_0xe0b0('0x7'));var crypto=require(_0xe0b0('0x8'));var BPromise=require(_0xe0b0('0x9'));var util=require(_0xe0b0('0xa'));var moment=require(_0xe0b0('0xb'));var validateJwt=expressJwt({'secret':config[_0xe0b0('0xc')]['session']});var userAttributes=['id','role',_0xe0b0('0xd'),_0xe0b0('0xe'),_0xe0b0('0xf'),_0xe0b0('0x10'),'userpic',_0xe0b0('0x11'),_0xe0b0('0x12'),'voicePause',_0xe0b0('0x13'),_0xe0b0('0x14'),'faxPause',_0xe0b0('0x15'),_0xe0b0('0x16'),_0xe0b0('0x17'),'showWebBar',_0xe0b0('0x18'),_0xe0b0('0x19'),_0xe0b0('0x1a'),_0xe0b0('0x1b'),_0xe0b0('0x1c'),'alias',_0xe0b0('0x1d'),_0xe0b0('0x1e'),_0xe0b0('0x1f'),_0xe0b0('0x20'),_0xe0b0('0x21'),'phoneBarEnableSettings',_0xe0b0('0x22'),'phoneBarPrefixRequired',_0xe0b0('0x23'),_0xe0b0('0x24'),'hotdesk',_0xe0b0('0x25'),'userProfileId',_0xe0b0('0x26'),_0xe0b0('0x27'),'wssPort','downloadVoiceRecordings',_0xe0b0('0x28'),'downloadAttachments','ignorePauseForPreviewCalls','selectRecallMeCampaign',_0xe0b0('0x29'),'chatAutoanswerDelay','emailAutoanswer',_0xe0b0('0x2a'),'smsAutoanswer',_0xe0b0('0x2b'),'openchannelAutoanswer',_0xe0b0('0x2c'),_0xe0b0('0x2d'),_0xe0b0('0x2e'),_0xe0b0('0x2f'),_0xe0b0('0x30'),'messengerSoundNotification'];exports['isChatInteractionAuthorized']=function(){return this[_0xe0b0('0x31')](!![])['use'](function(_0x12b260,_0x31b5f8,_0x513e63){if(_0x12b260[_0xe0b0('0x32')]){_0x513e63();}else{return db['ChatInteraction'][_0xe0b0('0x33')]({'where':{'id':_0x12b260['params']['id']},'attributes':['id',_0xe0b0('0x34'),'disposition'],'raw':!![]})[_0xe0b0('0x35')](function(_0x4de537){if(_0x4de537&&_0x4de537[_0xe0b0('0x34')]){return _0x31b5f8['status'](_0x4de537[_0xe0b0('0x36')]==='unmanaged'?0x195:0x193)[_0xe0b0('0x37')]({'message':_0x4de537[_0xe0b0('0x36')]===_0xe0b0('0x38')?_0xe0b0('0x39'):_0xe0b0('0x3a')});}else{_0x513e63();}})[_0xe0b0('0x3b')](function(_0x5200a6){_0x513e63(_0x5200a6);});}});};exports[_0xe0b0('0x31')]=function isAuthenticated(_0x1b8aa8){return compose()['use'](function(_0x15e13b,_0x419b1f,_0x36d137){var _0x1d5759;if(_0x15e13b[_0xe0b0('0x3c')][_0xe0b0('0x3d')]){if(_[_0xe0b0('0x3e')](_0x15e13b['headers'][_0xe0b0('0x3d')],_0xe0b0('0x3f'))){var _0x48a9b5=basicAuth(_0x15e13b);db['User'][_0xe0b0('0x40')]({'where':{'name':_0x48a9b5[_0xe0b0('0xe')]}})[_0xe0b0('0x35')](function(_0x3f81d5){if(!_0x3f81d5||!_0x3f81d5[_0xe0b0('0x41')](_0x48a9b5['pass'])){return _0x419b1f[_0xe0b0('0x42')](0x191)[_0xe0b0('0x37')]({'message':_0xe0b0('0x43')});}_0x15e13b[_0xe0b0('0x32')]={'id':_0x3f81d5['id']};_0x36d137();})[_0xe0b0('0x3b')](function(_0x4fe835){_0x36d137(_0x4fe835);});}else if(_[_0xe0b0('0x3e')](_0x15e13b[_0xe0b0('0x3c')][_0xe0b0('0x3d')],_0xe0b0('0x44'))){validateJwt(_0x15e13b,_0x419b1f,_0x36d137);}else{if(_0x1b8aa8){_0x36d137();}else{return _0x419b1f[_0xe0b0('0x42')](0x193)[_0xe0b0('0x37')]({'message':_0xe0b0('0x45')});}}}else if(_0x15e13b[_0xe0b0('0x46')][_0xe0b0('0x47')]){try{var _0x1dd010={'audience':hardwareConf[_0xe0b0('0x48')](),'issuer':hardwareConf[_0xe0b0('0x48')]()};verifyJwt(_0x15e13b[_0xe0b0('0x46')][_0xe0b0('0x47')],_0x1dd010)[_0xe0b0('0x35')](function(_0x4cf80c){return db[_0xe0b0('0x49')][_0xe0b0('0x40')]({'where':{'id':_0x4cf80c[_0xe0b0('0x4a')]}})[_0xe0b0('0x35')](function(_0x1a2d24){_0x1d5759=_0x1a2d24;return db[_0xe0b0('0x4b')][_0xe0b0('0x33')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts','blockDuration'],'raw':!![]});})['then'](function(_0x5317df){if(!_0x1d5759||!_[_0xe0b0('0x4c')](_0x1d5759[_0xe0b0('0x4d')],_0x4cf80c[_0xe0b0('0x4e')])){return _0x419b1f['status'](0x191)[_0xe0b0('0x37')]({'message':_0xe0b0('0x4f')});}if(_0x1d5759[_0xe0b0('0x50')]){return _0x419b1f[_0xe0b0('0x42')](0x191)['json']({'message':_0xe0b0('0x51')});}if(_0x1d5759[_0xe0b0('0x52')]){if(_0x5317df[_0xe0b0('0x53')]>0x0){if(moment(_0x1d5759[_0xe0b0('0x54')])[_0xe0b0('0x55')](_0x5317df[_0xe0b0('0x53')],_0xe0b0('0x56'))>moment()){return _0x419b1f[_0xe0b0('0x42')](0x191)[_0xe0b0('0x37')]({'message':'Invalid\x20API\x20access\x20key'});}}else{return _0x419b1f[_0xe0b0('0x42')](0x191)['json']({'message':_0xe0b0('0x51')});}}_0x15e13b[_0xe0b0('0x32')]={'id':_0x1d5759['id']};_0x36d137();});})[_0xe0b0('0x3b')](function(){return _0x419b1f[_0xe0b0('0x42')](0x191)['json']({'message':_0xe0b0('0x51')});});}catch(_0x41adcb){_0x36d137(_0x41adcb);}}else if(_0x1b8aa8){_0x36d137();}else{return _0x419b1f[_0xe0b0('0x42')](0x193)[_0xe0b0('0x37')]({'message':_0xe0b0('0x45')});}})[_0xe0b0('0x57')](function(_0x3ad564,_0x3bde8b,_0x52ffe4){if(_0x3ad564[_0xe0b0('0x32')]){db[_0xe0b0('0x49')]['find']({'where':{'id':_0x3ad564['user']['id']},'attributes':userAttributes})[_0xe0b0('0x35')](function(_0x247f8d){if(!_0x247f8d){return _0x3bde8b['status'](0x194)[_0xe0b0('0x37')]({'message':_0xe0b0('0x58')});}_0x3ad564[_0xe0b0('0x32')]=_0x247f8d;_0x52ffe4();})[_0xe0b0('0x3b')](function(_0x1a8cc7){_0x52ffe4(_0x1a8cc7);});}else if(_0x1b8aa8){_0x52ffe4();}else{return _0x3bde8b['status'](0x194)['json']({'message':'User\x20object\x20not\x20found.'});}});};exports[_0xe0b0('0x59')]=function canUpdate(){return compose()[_0xe0b0('0x57')](function(_0x5c2f3b,_0x9f7459,_0x1d897f){return licenseUtil[_0xe0b0('0x5a')]()[_0xe0b0('0x35')](function(_0x16ccca){if(_0x16ccca['update']){_0x1d897f();}else{return _0x9f7459['status'](0x193)[_0xe0b0('0x37')]({'message':_0xe0b0('0x5b')});}})[_0xe0b0('0x3b')](function(_0x1acc50){_0x1d897f(_0x1acc50);});});};exports[_0xe0b0('0x5c')]=function isWebrtcLicence(){return compose()['use'](function(_0x3b1474,_0x11d4fd,_0x534340){return licenseUtil['getLicense']()['then'](function(_0x1b7777){if(_0x1b7777[_0xe0b0('0x5d')]){_0x534340();}else{return _0x11d4fd[_0xe0b0('0x42')](0x193)[_0xe0b0('0x37')]({'message':'Forbidden'});}})[_0xe0b0('0x3b')](function(_0x87d8f3){_0x534340(_0x87d8f3);});});};exports['isMiddleware']=function(_0x58b69c,_0x2365be,_0x1bc6e0){_0x58b69c['isMiddleware']=!![];return _0x1bc6e0();};exports[_0xe0b0('0x5e')]=function signToken(_0x27fd31){return signJwt(_0x27fd31);};exports['setTokenCookie']=function(_0x5cb2b6,_0x123ad2){if(!_0x5cb2b6['user']){return _0x123ad2[_0xe0b0('0x42')](0x194)[_0xe0b0('0x37')]({'message':_0xe0b0('0x5f')});}var _0x45cc4e={'payload':{'id':_0x5cb2b6[_0xe0b0('0x32')]['id'],'role':_0x5cb2b6[_0xe0b0('0x32')]['role']},'options':{'expiresIn':0x15180}};return signJwt(_0x45cc4e)['then'](function(_0x2ef908){_0x123ad2['cookie']('motion.token',_0x2ef908);_0x123ad2[_0xe0b0('0x60')](_0xe0b0('0x61'));})['catch'](function(_0x4b65d1){return _0x123ad2[_0xe0b0('0x42')](0x1f4)[_0xe0b0('0x62')](_0x4b65d1);});};exports[_0xe0b0('0x63')]=function(_0x4365d1){if(_[_0xe0b0('0x64')](_0x4365d1[_0xe0b0('0x4d')])||_[_0xe0b0('0x64')](_0x4365d1['apiKeyIat'])){return null;}else{return createJwt(_0x4365d1);}};exports[_0xe0b0('0x65')]=function(_0x5ec880){_0x5ec880[_0xe0b0('0x4d')]=generateNonce();_0x5ec880['apiKeyIat']=generateIssuedAt();return createJwt(_0x5ec880);};exports['regenerateApiKey']=function(_0x33822e,_0x237e8c){var _0x228174=_0x33822e[_0xe0b0('0x46')][_0xe0b0('0x47')];if(_0x228174){var _0x2a588d={'nonce':_0x237e8c[_0xe0b0('0x4d')],'iat':_0x237e8c[_0xe0b0('0x66')],'audience':hardwareConf[_0xe0b0('0x48')](),'issuer':hardwareConf['getUuid']()};return verifyJwt(_0x228174,_0x2a588d)[_0xe0b0('0x35')](function(){return generateApiKey(_0x237e8c);});}else{throw{'message':'Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one'};}};exports[_0xe0b0('0x67')]=function(_0x3ae36e){var _0x30c4a9=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x30c4a9[_0xe0b0('0x68')](_0x3ae36e))throw new db[(_0xe0b0('0x69'))][(_0xe0b0('0x6a'))]('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[_0xe0b0('0x6b')]=function(_0x16ea00,_0x437a15,_0x271445){var _0x3bb6d6=encryptor[_0xe0b0('0x6c')](_0x437a15)[_0xe0b0('0x6d')](',');for(var _0x1a60d2=0x0;_0x1a60d2<_0x271445;_0x1a60d2++){if(!_0x3bb6d6[_0x1a60d2])break;if(_0x16ea00[_0xe0b0('0x6e')]()===_0x3bb6d6[_0x1a60d2][_0xe0b0('0x6e')]()){var _0x1eb5d6=util[_0xe0b0('0x6f')](_0xe0b0('0x70'),_0x271445);if(_0x271445===0x1){_0x1eb5d6=_0xe0b0('0x71');}throw new db[(_0xe0b0('0x69'))][(_0xe0b0('0x6a'))](_0x1eb5d6);}}return;};exports[_0xe0b0('0x72')]=function(_0x155738,_0x5aa79b){var _0x46627e=_0x5aa79b?encryptor[_0xe0b0('0x6c')](_0x5aa79b)[_0xe0b0('0x6d')](','):[];if(_0x46627e[_0xe0b0('0x73')]===0x5){_0x46627e[_0xe0b0('0x74')](-0x1,0x1);}_0x46627e[_0xe0b0('0x75')](_0x155738);return encryptor[_0xe0b0('0x76')](_0x46627e['join'](','));};function signJwt(_0x47dcc4){var _0x139014=BPromise[_0xe0b0('0x77')](jwt[_0xe0b0('0x78')],{'context':jwt});var _0x47ecc1=_0x47dcc4[_0xe0b0('0x79')]||config[_0xe0b0('0xc')][_0xe0b0('0x7a')];return new BPromise(function(_0x3d820c,_0x3537e7){_0x139014(_0x47dcc4['payload'],_0x47ecc1,_0x47dcc4[_0xe0b0('0x7b')])[_0xe0b0('0x35')](function(_0x1821c3){_0x3d820c(_0x1821c3);})['catch'](function(_0x3604e6){_0x3537e7(_0x3604e6);});});}function verifyJwt(_0x30b3ae,_0x5aa850,_0x1bd249){var _0x4c5478=BPromise['promisify'](jwt[_0xe0b0('0x7c')],{'context':jwt});var _0x57b51e=_0x1bd249||config['secrets'][_0xe0b0('0x7a')];return new BPromise(function(_0xd750b4,_0x2d91f1){_0x4c5478(_0x30b3ae,_0x57b51e,_0x5aa850)[_0xe0b0('0x35')](function(_0x5a7913){_0xd750b4(_0x5a7913);})[_0xe0b0('0x3b')](function(_0x2287a5){_0x2d91f1(_0x2287a5);});});}function generateNonce(){return crypto[_0xe0b0('0x7d')](0x10)[_0xe0b0('0x7e')](_0xe0b0('0x7f'));}function generateIssuedAt(){return Math[_0xe0b0('0x80')](Date[_0xe0b0('0x81')]()/0x3e8)[_0xe0b0('0x7e')]();}function createJwt(_0x514df5){var _0x51940f={'payload':{'iat':_0x514df5[_0xe0b0('0x66')],'nonce':_0x514df5[_0xe0b0('0x4d')]},'options':{'algorithm':_0xe0b0('0x82'),'subject':_0x514df5['id']['toString'](),'issuer':hardwareConf['getUuid'](),'audience':hardwareConf[_0xe0b0('0x48')]()}};return signJwt(_0x51940f)[_0xe0b0('0x35')](function(_0x5d7cf4){return{'iat':_0x514df5['apiKeyIat'],'nonce':_0x514df5[_0xe0b0('0x4d')],'token':_0x5d7cf4};});} \ No newline at end of file +var _0xb688=['use','user','findOne','params','disposition','then','unmanaged','json','Unmanaged.','headers','authorization','startsWith','find','authenticate','pass','Wrong\x20credentials.','catch','Bearer','status','Unknown\x20authorization\x20format','query','apikey','getUuid','User','Setting','allowedLoginAttempts','blockDuration','isEqual','nonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','disabled','Invalid\x20API\x20access\x20key','blockedAt','add','minutes','User\x20not\x20found.','canUpdate','getLicense','update','Forbidden','isWebrtcLicence','webrtc','isMiddleware','setTokenCookie','cookie','motion.token','send','retrieveApiKey','apiKeyNonce','isNil','apiKeyIat','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','validatePasswordPattern','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','decryptString','split','toLowerCase','format','The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.','The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.','updatePasswordsHistory','length','encryptString','promisify','secret','secrets','payload','verify','hex','floor','HS512','toString','../../config/environment','../../config/license/hardware','../../config/license/util','../encryptor','lodash','jsonwebtoken','composable-middleware','basic-auth','crypto','bluebird','moment','session','role','fullname','name','internal','email','userpic','permissions','md5secret','voicePause','chatPause','mailPause','faxPause','openchannelPause','pauseType','showWebBar','lastLoginAt','lastPauseAt','crudPermissions','allowmessenger','passwordResetAt','alias','phoneBarAutoAnswerDelay','phoneBarEnableDtmfTone','phoneBarEnableSettings','phoneBarExpires','phoneBarRemoteControlPort','interface','userProfileId','privacyEnabled','settingsEnabled','downloadVoiceRecordings','downloadOmnichannelInteractions','ignorePauseForPreviewCalls','selectRecallMeCampaign','chatAutoanswer','chatAutoanswerDelay','emailAutoanswer','smsAutoanswer','smsAutoanswerDelay','openchannelAutoanswer','openchannelAutoanswerDelay','faxAutoanswer','faxAutoanswerDelay','messengerSoundNotification','isAuthenticated'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xb688,0xcf));var _0x8b68=function(_0x341c95,_0x5c1fd6){_0x341c95=_0x341c95-0x0;var _0x9a637f=_0xb688[_0x341c95];return _0x9a637f;};'use strict';var db=require('../../mysqldb')['db'];var config=require(_0x8b68('0x0'));var hardwareConf=require(_0x8b68('0x1'));var licenseUtil=require(_0x8b68('0x2'));var encryptor=require(_0x8b68('0x3'));var _=require(_0x8b68('0x4'));var jwt=require(_0x8b68('0x5'));var expressJwt=require('express-jwt');var compose=require(_0x8b68('0x6'));var basicAuth=require(_0x8b68('0x7'));var crypto=require(_0x8b68('0x8'));var BPromise=require(_0x8b68('0x9'));var util=require('util');var moment=require(_0x8b68('0xa'));var validateJwt=expressJwt({'secret':config['secrets'][_0x8b68('0xb')]});var userAttributes=['id',_0x8b68('0xc'),_0x8b68('0xd'),_0x8b68('0xe'),_0x8b68('0xf'),_0x8b68('0x10'),_0x8b68('0x11'),_0x8b68('0x12'),_0x8b68('0x13'),_0x8b68('0x14'),_0x8b68('0x15'),_0x8b68('0x16'),_0x8b68('0x17'),'smsPause',_0x8b68('0x18'),_0x8b68('0x19'),_0x8b68('0x1a'),_0x8b68('0x1b'),_0x8b68('0x1c'),_0x8b68('0x1d'),_0x8b68('0x1e'),_0x8b68('0x1f'),_0x8b68('0x20'),'phoneBarAutoAnswer',_0x8b68('0x21'),'phoneBarDnd','phoneBarEnableRecording',_0x8b68('0x22'),_0x8b68('0x23'),_0x8b68('0x24'),'phoneBarPrefixRequired','phoneBarRemoteControl',_0x8b68('0x25'),'hotdesk',_0x8b68('0x26'),_0x8b68('0x27'),_0x8b68('0x28'),_0x8b68('0x29'),'wssPort',_0x8b68('0x2a'),_0x8b68('0x2b'),'downloadAttachments',_0x8b68('0x2c'),_0x8b68('0x2d'),_0x8b68('0x2e'),_0x8b68('0x2f'),_0x8b68('0x30'),'emailAutoanswerDelay',_0x8b68('0x31'),_0x8b68('0x32'),_0x8b68('0x33'),_0x8b68('0x34'),_0x8b68('0x35'),_0x8b68('0x36'),'whatsappAutoanswer','whatsappAutoanswerDelay',_0x8b68('0x37')];exports['isChatInteractionAuthorized']=function(){return this[_0x8b68('0x38')](!![])[_0x8b68('0x39')](function(_0x13aee5,_0x21ecca,_0x32ddc5){if(_0x13aee5[_0x8b68('0x3a')]){_0x32ddc5();}else{return db['ChatInteraction'][_0x8b68('0x3b')]({'where':{'id':_0x13aee5[_0x8b68('0x3c')]['id']},'attributes':['id','closed',_0x8b68('0x3d')],'raw':!![]})[_0x8b68('0x3e')](function(_0x240b0b){if(_0x240b0b&&_0x240b0b['closed']){return _0x21ecca['status'](_0x240b0b['disposition']===_0x8b68('0x3f')?0x195:0x193)[_0x8b68('0x40')]({'message':_0x240b0b[_0x8b68('0x3d')]==='unmanaged'?_0x8b68('0x41'):'Forbidden.'});}else{_0x32ddc5();}})['catch'](function(_0x3865ea){_0x32ddc5(_0x3865ea);});}});};exports['isAuthenticated']=function isAuthenticated(_0x26cad7){return compose()[_0x8b68('0x39')](function(_0x48e2c8,_0x494ce4,_0x357635){var _0x1cd230;if(_0x48e2c8[_0x8b68('0x42')][_0x8b68('0x43')]){if(_[_0x8b68('0x44')](_0x48e2c8[_0x8b68('0x42')][_0x8b68('0x43')],'Basic')){var _0x3b6d1b=basicAuth(_0x48e2c8);db['User'][_0x8b68('0x45')]({'where':{'name':_0x3b6d1b[_0x8b68('0xe')]}})['then'](function(_0x216aa6){if(!_0x216aa6||!_0x216aa6[_0x8b68('0x46')](_0x3b6d1b[_0x8b68('0x47')])){return _0x494ce4['status'](0x191)['json']({'message':_0x8b68('0x48')});}_0x48e2c8[_0x8b68('0x3a')]={'id':_0x216aa6['id']};_0x357635();})[_0x8b68('0x49')](function(_0x394cca){_0x357635(_0x394cca);});}else if(_[_0x8b68('0x44')](_0x48e2c8[_0x8b68('0x42')][_0x8b68('0x43')],_0x8b68('0x4a'))){validateJwt(_0x48e2c8,_0x494ce4,_0x357635);}else{if(_0x26cad7){_0x357635();}else{return _0x494ce4[_0x8b68('0x4b')](0x193)[_0x8b68('0x40')]({'message':_0x8b68('0x4c')});}}}else if(_0x48e2c8[_0x8b68('0x4d')][_0x8b68('0x4e')]){try{var _0x439d36={'audience':hardwareConf[_0x8b68('0x4f')](),'issuer':hardwareConf[_0x8b68('0x4f')]()};verifyJwt(_0x48e2c8[_0x8b68('0x4d')][_0x8b68('0x4e')],_0x439d36)[_0x8b68('0x3e')](function(_0x18dfae){return db[_0x8b68('0x50')][_0x8b68('0x45')]({'where':{'id':_0x18dfae['sub']}})['then'](function(_0x24026c){_0x1cd230=_0x24026c;return db[_0x8b68('0x51')][_0x8b68('0x3b')]({'where':{'id':0x1},'attributes':[_0x8b68('0x52'),_0x8b68('0x53')],'raw':!![]});})[_0x8b68('0x3e')](function(_0x75a62f){if(!_0x1cd230||!_[_0x8b68('0x54')](_0x1cd230['apiKeyNonce'],_0x18dfae[_0x8b68('0x55')])){return _0x494ce4[_0x8b68('0x4b')](0x191)[_0x8b68('0x40')]({'message':_0x8b68('0x56')});}if(_0x1cd230[_0x8b68('0x57')]){return _0x494ce4[_0x8b68('0x4b')](0x191)[_0x8b68('0x40')]({'message':_0x8b68('0x58')});}if(_0x1cd230['blocked']){if(_0x75a62f[_0x8b68('0x53')]>0x0){if(moment(_0x1cd230[_0x8b68('0x59')])[_0x8b68('0x5a')](_0x75a62f[_0x8b68('0x53')],_0x8b68('0x5b'))>moment()){return _0x494ce4[_0x8b68('0x4b')](0x191)[_0x8b68('0x40')]({'message':'Invalid\x20API\x20access\x20key'});}}else{return _0x494ce4[_0x8b68('0x4b')](0x191)[_0x8b68('0x40')]({'message':'Invalid\x20API\x20access\x20key'});}}_0x48e2c8[_0x8b68('0x3a')]={'id':_0x1cd230['id']};_0x357635();});})[_0x8b68('0x49')](function(){return _0x494ce4['status'](0x191)['json']({'message':'Invalid\x20API\x20access\x20key'});});}catch(_0x4a093e){_0x357635(_0x4a093e);}}else if(_0x26cad7){_0x357635();}else{return _0x494ce4[_0x8b68('0x4b')](0x193)[_0x8b68('0x40')]({'message':'Unknown\x20authorization\x20format'});}})[_0x8b68('0x39')](function(_0x5960fc,_0x6a2a54,_0x3841d2){if(_0x5960fc['user']){db[_0x8b68('0x50')]['find']({'where':{'id':_0x5960fc['user']['id']},'attributes':userAttributes})['then'](function(_0x3ec20a){if(!_0x3ec20a){return _0x6a2a54[_0x8b68('0x4b')](0x194)[_0x8b68('0x40')]({'message':_0x8b68('0x5c')});}_0x5960fc['user']=_0x3ec20a;_0x3841d2();})[_0x8b68('0x49')](function(_0x58a5e3){_0x3841d2(_0x58a5e3);});}else if(_0x26cad7){_0x3841d2();}else{return _0x6a2a54[_0x8b68('0x4b')](0x194)[_0x8b68('0x40')]({'message':'User\x20object\x20not\x20found.'});}});};exports[_0x8b68('0x5d')]=function canUpdate(){return compose()[_0x8b68('0x39')](function(_0x422f91,_0x225d67,_0x5f136f){return licenseUtil[_0x8b68('0x5e')]()[_0x8b68('0x3e')](function(_0xd2b889){if(_0xd2b889[_0x8b68('0x5f')]){_0x5f136f();}else{return _0x225d67[_0x8b68('0x4b')](0x193)[_0x8b68('0x40')]({'message':_0x8b68('0x60')});}})[_0x8b68('0x49')](function(_0x29e265){_0x5f136f(_0x29e265);});});};exports[_0x8b68('0x61')]=function isWebrtcLicence(){return compose()[_0x8b68('0x39')](function(_0x2a2a99,_0x1af430,_0x108c8d){return licenseUtil[_0x8b68('0x5e')]()[_0x8b68('0x3e')](function(_0x50099e){if(_0x50099e[_0x8b68('0x62')]){_0x108c8d();}else{return _0x1af430[_0x8b68('0x4b')](0x193)['json']({'message':_0x8b68('0x60')});}})['catch'](function(_0x58cf66){_0x108c8d(_0x58cf66);});});};exports['isMiddleware']=function(_0x1c8a3e,_0x35874b,_0x34047c){_0x1c8a3e[_0x8b68('0x63')]=!![];return _0x34047c();};exports['signToken']=function signToken(_0x522f47){return signJwt(_0x522f47);};exports[_0x8b68('0x64')]=function(_0x163fd5,_0x1e900f){if(!_0x163fd5['user']){return _0x1e900f[_0x8b68('0x4b')](0x194)[_0x8b68('0x40')]({'message':'It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.'});}var _0x429ebb={'payload':{'id':_0x163fd5[_0x8b68('0x3a')]['id'],'role':_0x163fd5['user'][_0x8b68('0xc')]},'options':{'expiresIn':0x15180}};return signJwt(_0x429ebb)[_0x8b68('0x3e')](function(_0x51bf1b){_0x1e900f[_0x8b68('0x65')](_0x8b68('0x66'),_0x51bf1b);_0x1e900f['redirect']('/dashboards/general');})['catch'](function(_0x28f82d){return _0x1e900f[_0x8b68('0x4b')](0x1f4)[_0x8b68('0x67')](_0x28f82d);});};exports[_0x8b68('0x68')]=function(_0x55aad3){if(_['isNil'](_0x55aad3[_0x8b68('0x69')])||_[_0x8b68('0x6a')](_0x55aad3[_0x8b68('0x6b')])){return null;}else{return createJwt(_0x55aad3);}};exports['generateApiKey']=function(_0x2053a7){_0x2053a7[_0x8b68('0x69')]=generateNonce();_0x2053a7[_0x8b68('0x6b')]=generateIssuedAt();return createJwt(_0x2053a7);};exports['regenerateApiKey']=function(_0x49dc86,_0x4825df){var _0x2b1fd8=_0x49dc86[_0x8b68('0x4d')]['apikey'];if(_0x2b1fd8){var _0xba7139={'nonce':_0x4825df[_0x8b68('0x69')],'iat':_0x4825df[_0x8b68('0x6b')],'audience':hardwareConf[_0x8b68('0x4f')](),'issuer':hardwareConf[_0x8b68('0x4f')]()};return verifyJwt(_0x2b1fd8,_0xba7139)['then'](function(){return generateApiKey(_0x4825df);});}else{throw{'message':_0x8b68('0x6c')};}};exports[_0x8b68('0x6d')]=function(_0x32cd05){var _0x31a090=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x31a090[_0x8b68('0x6e')](_0x32cd05))throw new db[(_0x8b68('0x6f'))][(_0x8b68('0x70'))](_0x8b68('0x71'));return;};exports['validatePasswordHistory']=function(_0x3f423e,_0x1a85da,_0x1e8694){var _0x3cc1f4=encryptor[_0x8b68('0x72')](_0x1a85da)[_0x8b68('0x73')](',');for(var _0x3a90ba=0x0;_0x3a90ba<_0x1e8694;_0x3a90ba++){if(!_0x3cc1f4[_0x3a90ba])break;if(_0x3f423e[_0x8b68('0x74')]()===_0x3cc1f4[_0x3a90ba][_0x8b68('0x74')]()){var _0x271dbe=util[_0x8b68('0x75')](_0x8b68('0x76'),_0x1e8694);if(_0x1e8694===0x1){_0x271dbe=_0x8b68('0x77');}throw new db[(_0x8b68('0x6f'))][(_0x8b68('0x70'))](_0x271dbe);}}return;};exports[_0x8b68('0x78')]=function(_0xf07a90,_0x3da7b4){var _0xae90f0=_0x3da7b4?encryptor[_0x8b68('0x72')](_0x3da7b4)['split'](','):[];if(_0xae90f0[_0x8b68('0x79')]===0x5){_0xae90f0['splice'](-0x1,0x1);}_0xae90f0['unshift'](_0xf07a90);return encryptor[_0x8b68('0x7a')](_0xae90f0['join'](','));};function signJwt(_0x43f826){var _0x61dac8=BPromise[_0x8b68('0x7b')](jwt['sign'],{'context':jwt});var _0x3a034a=_0x43f826[_0x8b68('0x7c')]||config[_0x8b68('0x7d')][_0x8b68('0xb')];return new BPromise(function(_0x401c20,_0x3031d1){_0x61dac8(_0x43f826[_0x8b68('0x7e')],_0x3a034a,_0x43f826['options'])['then'](function(_0x20aac1){_0x401c20(_0x20aac1);})[_0x8b68('0x49')](function(_0x250528){_0x3031d1(_0x250528);});});}function verifyJwt(_0x371526,_0x3c930d,_0x37da34){var _0x2d1519=BPromise[_0x8b68('0x7b')](jwt[_0x8b68('0x7f')],{'context':jwt});var _0x36d47a=_0x37da34||config[_0x8b68('0x7d')][_0x8b68('0xb')];return new BPromise(function(_0x316652,_0x195f82){_0x2d1519(_0x371526,_0x36d47a,_0x3c930d)[_0x8b68('0x3e')](function(_0x414096){_0x316652(_0x414096);})[_0x8b68('0x49')](function(_0x10e8b7){_0x195f82(_0x10e8b7);});});}function generateNonce(){return crypto['randomBytes'](0x10)['toString'](_0x8b68('0x80'));}function generateIssuedAt(){return Math[_0x8b68('0x81')](Date['now']()/0x3e8)['toString']();}function createJwt(_0x574aca){var _0x39a04e={'payload':{'iat':_0x574aca[_0x8b68('0x6b')],'nonce':_0x574aca[_0x8b68('0x69')]},'options':{'algorithm':_0x8b68('0x82'),'subject':_0x574aca['id'][_0x8b68('0x83')](),'issuer':hardwareConf['getUuid'](),'audience':hardwareConf[_0x8b68('0x4f')]()}};return signJwt(_0x39a04e)[_0x8b68('0x3e')](function(_0x5c24f8){return{'iat':_0x574aca[_0x8b68('0x6b')],'nonce':_0x574aca['apiKeyNonce'],'token':_0x5c24f8};});} \ No newline at end of file diff --git a/server/components/contacts/index.js b/server/components/contacts/index.js index f0dd418..0056265 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 _0xb674=['user','clause','tags','checkListsRestrictions','tag','countFilteredContacts','count','User','buildContactsQuery','fields','getFilteredContacts','catch','CmContact','keys','map','CmCustomField','findOne','all','length','cf_','fieldType','type','lodash','../../mysqldb','findAll','skipContactsQuery','resolve','then','search','parseAdvancedSearchFilter','parseQueryParameters','where','filter'];(function(_0x30ad27,_0x750e0f){var _0x42242a=function(_0x352f81){while(--_0x352f81){_0x30ad27['push'](_0x30ad27['shift']());}};_0x42242a(++_0x750e0f);}(_0xb674,0x1c3));var _0x4b67=function(_0x493353,_0x4a2fa9){_0x493353=_0x493353-0x0;var _0x52bf9b=_0xb674[_0x493353];return _0x52bf9b;};'use strict';var _=require(_0x4b67('0x0'));var sqlUtils=require('./sql-utils');var db=require(_0x4b67('0x1'))['db'];exports[_0x4b67('0x2')]=function(_0x489e77,_0xc7252d,_0x5bf48f,_0x257a86){var _0x2e0345={'count':0x0,'rows':[]};var _0x138aaa=sqlUtils[_0x4b67('0x3')](_0xc7252d,_0x489e77);if(_0x138aaa){return Promise[_0x4b67('0x4')](_0x2e0345);}var _0x2d99b2=sqlUtils['getContactsSubquery']();var _0x3650d2={};var _0x30e2f4=![];var _0x4ae7e0=![];return Promise[_0x4b67('0x4')]()[_0x4b67('0x5')](function(){if(_0x489e77[_0x4b67('0x6')]){return sqlUtils[_0x4b67('0x7')](_0x489e77[_0x4b67('0x6')],_0x257a86);}else{return sqlUtils[_0x4b67('0x8')](_0x489e77,_0x257a86);}})['then'](function(_0x26ac38){_0x2d99b2['where'](_0x26ac38['default']);_0x2d99b2[_0x4b67('0x9')](_0x26ac38['fields']);_0x2d99b2[_0x4b67('0x9')](_0x26ac38[_0x4b67('0xa')]);_0x2d99b2[_0x4b67('0x9')](_0x26ac38[_0x4b67('0xb')][_0x4b67('0xc')]);_0x3650d2=_0x26ac38[_0x4b67('0xd')];_0x4ae7e0=_0x26ac38[_0x4b67('0xb')]['skip'];return sqlUtils[_0x4b67('0xe')](_0xc7252d,_0x489e77,_0x4ae7e0);})['then'](function(_0xe48165){_0x2d99b2[_0x4b67('0x9')](_0xe48165);var _0xc44f54=_0x489e77['search']?_0x3650d2['ids']:_0x489e77[_0x4b67('0xf')];_0x30e2f4=_0xc44f54?!![]:![];return sqlUtils[_0x4b67('0x10')](_0x2d99b2,_0xc44f54);})[_0x4b67('0x5')](function(_0x15a87e){_0x2e0345[_0x4b67('0x11')]=_0x15a87e;if(_0x2e0345[_0x4b67('0x11')]===0x0){return;}if(_0x489e77[_0x4b67('0x12')]){_0x4ae7e0=!![];}return sqlUtils[_0x4b67('0x13')](_0x2d99b2,_0x489e77[_0x4b67('0x14')],_0x5bf48f,_0x30e2f4,_0x3650d2[_0x4b67('0xc')],_0x4ae7e0);})['then'](function(_0x1520cd){if(!_0x1520cd){return[];}return sqlUtils[_0x4b67('0x15')](_0x1520cd,_0x489e77,_0x5bf48f);})['then'](function(_0x3ab433){_0x2e0345['rows']=_0x3ab433;return _0x2e0345;})[_0x4b67('0x16')](function(_0x410978){throw _0x410978;});};exports['describe']=function(){var _0x18fb8c={};var _0x142231=[];return db[_0x4b67('0x17')]['describe']()[_0x4b67('0x5')](function(_0x3663c5){_0x18fb8c=_0x3663c5;var _0x5469e2=Object[_0x4b67('0x18')](_0x18fb8c)['filter'](function(_0x45afc2){return _['startsWith'](_0x45afc2,'cf_')?_0x45afc2:undefined;});var _0x4a4043=_0x5469e2[_0x4b67('0x19')](function(_0x24b07b){return db[_0x4b67('0x1a')][_0x4b67('0x1b')]({'where':{'id':_0x24b07b['slice'](0x3)},'raw':!![]});});return Promise[_0x4b67('0x1c')](_0x4a4043);})['then'](function(_0x11bcd9){for(var _0x4719ea=0x0;_0x4719ea<_0x11bcd9[_0x4b67('0x1d')];_0x4719ea++){if(_0x11bcd9[_0x4719ea]){var _0x437e76=_0x4b67('0x1e')+_0x11bcd9[_0x4719ea]['id'];_0x18fb8c[_0x437e76][_0x4b67('0x1f')]=_0x11bcd9[_0x4719ea][_0x4b67('0x20')];}}_0x142231=_[_0x4b67('0x19')](Object['keys'](_0x18fb8c),function(_0x12ceae){return{'name':_0x12ceae,'type':_0x18fb8c[_0x12ceae]['type']};});return _0x142231;})[_0x4b67('0x16')](function(_0x3125ef){throw _0x3125ef;});}; \ No newline at end of file +var _0xb46d=['count','User','buildContactsQuery','fields','getFilteredContacts','rows','catch','describe','keys','startsWith','cf_','map','findOne','slice','all','length','fieldType','type','lodash','../../mysqldb','findAll','skipContactsQuery','resolve','getContactsSubquery','then','parseQueryParameters','where','default','filter','user','clause','tags','skip','checkListsRestrictions','search','ids','tag'];(function(_0x82129b,_0x484ae9){var _0x2ae5dc=function(_0x299e34){while(--_0x299e34){_0x82129b['push'](_0x82129b['shift']());}};_0x2ae5dc(++_0x484ae9);}(_0xb46d,0xf0));var _0xdb46=function(_0x5302fb,_0x1a2db3){_0x5302fb=_0x5302fb-0x0;var _0x43e6a4=_0xb46d[_0x5302fb];return _0x43e6a4;};'use strict';var _=require(_0xdb46('0x0'));var sqlUtils=require('./sql-utils');var db=require(_0xdb46('0x1'))['db'];exports[_0xdb46('0x2')]=function(_0x31295d,_0x4db028,_0x399852,_0x344da6){var _0x59eadc={'count':0x0,'rows':[]};var _0x4491dc=sqlUtils[_0xdb46('0x3')](_0x4db028,_0x31295d);if(_0x4491dc){return Promise[_0xdb46('0x4')](_0x59eadc);}var _0x357e6a=sqlUtils[_0xdb46('0x5')]();var _0x2e17e7={};var _0x28fe4c=![];var _0xef9db0=![];return Promise[_0xdb46('0x4')]()[_0xdb46('0x6')](function(){if(_0x31295d['search']){return sqlUtils['parseAdvancedSearchFilter'](_0x31295d['search'],_0x344da6);}else{return sqlUtils[_0xdb46('0x7')](_0x31295d,_0x344da6);}})[_0xdb46('0x6')](function(_0x2e6784){_0x357e6a[_0xdb46('0x8')](_0x2e6784[_0xdb46('0x9')]);_0x357e6a[_0xdb46('0x8')](_0x2e6784['fields']);_0x357e6a[_0xdb46('0x8')](_0x2e6784[_0xdb46('0xa')]);_0x357e6a[_0xdb46('0x8')](_0x2e6784[_0xdb46('0xb')][_0xdb46('0xc')]);_0x2e17e7=_0x2e6784[_0xdb46('0xd')];_0xef9db0=_0x2e6784[_0xdb46('0xb')][_0xdb46('0xe')];return sqlUtils[_0xdb46('0xf')](_0x4db028,_0x31295d,_0xef9db0);})['then'](function(_0x5d0acc){_0x357e6a[_0xdb46('0x8')](_0x5d0acc);var _0x25a498=_0x31295d[_0xdb46('0x10')]?_0x2e17e7[_0xdb46('0x11')]:_0x31295d[_0xdb46('0x12')];_0x28fe4c=_0x25a498?!![]:![];return sqlUtils['countFilteredContacts'](_0x357e6a,_0x25a498);})[_0xdb46('0x6')](function(_0x34d274){_0x59eadc[_0xdb46('0x13')]=_0x34d274;if(_0x59eadc['count']===0x0){return;}if(_0x31295d[_0xdb46('0x14')]){_0xef9db0=!![];}return sqlUtils[_0xdb46('0x15')](_0x357e6a,_0x31295d[_0xdb46('0x16')],_0x399852,_0x28fe4c,_0x2e17e7[_0xdb46('0xc')],_0xef9db0);})[_0xdb46('0x6')](function(_0x3c2969){if(!_0x3c2969){return[];}return sqlUtils[_0xdb46('0x17')](_0x3c2969,_0x31295d,_0x399852);})[_0xdb46('0x6')](function(_0x27db10){_0x59eadc[_0xdb46('0x18')]=_0x27db10;return _0x59eadc;})[_0xdb46('0x19')](function(_0x42805d){throw _0x42805d;});};exports[_0xdb46('0x1a')]=function(){var _0x128096={};var _0x3592f7=[];return db['CmContact']['describe']()[_0xdb46('0x6')](function(_0x41824c){_0x128096=_0x41824c;var _0x5d0dbe=Object[_0xdb46('0x1b')](_0x128096)[_0xdb46('0xa')](function(_0x53c6c5){return _[_0xdb46('0x1c')](_0x53c6c5,_0xdb46('0x1d'))?_0x53c6c5:undefined;});var _0x47e51e=_0x5d0dbe[_0xdb46('0x1e')](function(_0x2fd2b9){return db['CmCustomField'][_0xdb46('0x1f')]({'where':{'id':_0x2fd2b9[_0xdb46('0x20')](0x3)},'raw':!![]});});return Promise[_0xdb46('0x21')](_0x47e51e);})[_0xdb46('0x6')](function(_0x521d5a){for(var _0x58c5c3=0x0;_0x58c5c3<_0x521d5a[_0xdb46('0x22')];_0x58c5c3++){if(_0x521d5a[_0x58c5c3]){var _0x3175f6=_0xdb46('0x1d')+_0x521d5a[_0x58c5c3]['id'];_0x128096[_0x3175f6][_0xdb46('0x23')]=_0x521d5a[_0x58c5c3][_0xdb46('0x24')];}}_0x3592f7=_[_0xdb46('0x1e')](Object[_0xdb46('0x1b')](_0x128096),function(_0x4ab1bb){return{'name':_0x4ab1bb,'type':_0x128096[_0x4ab1bb]['type']};});return _0x3592f7;})[_0xdb46('0x19')](function(_0x1707b7){throw _0x1707b7;});}; \ No newline at end of file diff --git a/server/components/contacts/sql-utils.js b/server/components/contacts/sql-utils.js index 7a6e382..635f527 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 _0xbfec=['COUNT(*)','isEmpty','t.id\x20IN\x20?','SELECT','sequelize','lodash','../parsers/advancedSearch','../parsers/qs','../interaction/utils','../../mysqldb','search','ListId','autocomplete','select','from','cm_contacts','where','c.deletedAt\x20IS\x20NULL','left_join','cm_user_has_contacts','uc.CmContactId\x20=\x20','.id','cm_contact_has_tags','ct.CmContactId\x20=\x20','t.id\x20=\x20ct.TagId','subqry','firstName','phone','mobile','fax','email','CompanyId','createdAt','updatedAt','deletedAt','TagIds','push','field','GROUP_CONCAT(DISTINCT\x20t.id)','expr','getSelectedTags','forEach','CONCAT(\x27,\x27,\x20subqry.TagIds,\x20\x27,\x27)\x20LIKE\x20?','replace','length','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.phone\x20LIKE\x20?','c.mobile\x20LIKE\x20?','c.fax\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','c.firstName\x20LIKE\x20?','parseSearch','sqlOperator','conditions','name','dateOfBirth','fieldType','datetime','castTo','DATE','buildExpression','type','text','value','start','split','map','tags','clause','and','User','user','uc.UserId\x20=\x20?','skip','some','compact','concat','Contact','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','\x20=\x20?','resolve','then','filter','role','agent','c.ListId\x20IN\x20?','attributes','group','c.id','limit','offset','subqry.id','having','order','DESC','subqry.','Tag','color','keyBy','Sequelize','QueryTypes','CmContact','query','toString','Tags'];(function(_0x5b70a7,_0x659d7f){var _0x1daa52=function(_0x56a8fd){while(--_0x56a8fd){_0x5b70a7['push'](_0x5b70a7['shift']());}};_0x1daa52(++_0x659d7f);}(_0xbfec,0x146));var _0xcbfe=function(_0x41e4b1,_0x477840){_0x41e4b1=_0x41e4b1-0x0;var _0x395607=_0xbfec[_0x41e4b1];return _0x395607;};'use strict';var _=require(_0xcbfe('0x0'));var squel=require('squel');var as=require(_0xcbfe('0x1'));var qs=require(_0xcbfe('0x2'));var utils=require(_0xcbfe('0x3'));var db=require(_0xcbfe('0x4'))['db'];function skipContactsQuery(_0x430449,_0x3ee80b){var _0x5088df=![];if(_0x430449['role']==='agent'&&!_0x3ee80b[_0xcbfe('0x5')]&&!_0x3ee80b[_0xcbfe('0x6')]&&_0x3ee80b[_0xcbfe('0x7')]!=='true'){_0x5088df=!![];}return _0x5088df;}function getContactsSubquery(){return squel[_0xcbfe('0x8')]()[_0xcbfe('0x9')](_0xcbfe('0xa'),'c')[_0xcbfe('0xb')](_0xcbfe('0xc'));}function applyJoinClauses(_0x12b947,_0xa3ea11){var _0x45fa83=_0xa3ea11?'c':'subqry';_0x12b947[_0xcbfe('0xd')](_0xcbfe('0xe'),'uc',_0xcbfe('0xf')+_0x45fa83+_0xcbfe('0x10'))['left_join'](_0xcbfe('0x11'),'ct',_0xcbfe('0x12')+_0x45fa83+_0xcbfe('0x10'))[_0xcbfe('0xd')]('tools_tags','t',_0xcbfe('0x13'));return _0x12b947;}function addFieldsToQuery(_0x497db3,_0x23ec35,_0x48e9f3,_0x77e52f,_0x483453){var _0x2502d5=_0x483453?'c':_0xcbfe('0x14');if(!_0x23ec35){_0x23ec35=['id',_0xcbfe('0x15'),'lastName',_0xcbfe('0x16'),_0xcbfe('0x17'),_0xcbfe('0x18'),_0xcbfe('0x19'),_0xcbfe('0x6'),_0xcbfe('0x1a'),_0xcbfe('0x1b'),_0xcbfe('0x1c'),_0xcbfe('0x1d'),_0xcbfe('0x1e')];}else if(!_0x23ec35['includes']('id')){_0x23ec35[_0xcbfe('0x1f')]('id');}var _0x2f0c07=_0x48e9f3&&_0x483453||!_0x48e9f3&&!_0x483453;if(_0x77e52f){_0x2f0c07=_0x77e52f&&_0x483453||!_0x77e52f&&!_0x483453;}_0x23ec35['forEach'](function(_0x2188b3){if(_0x2188b3===_0xcbfe('0x1e')){if(_0x2f0c07){_0x497db3[_0xcbfe('0x20')](_0xcbfe('0x21'),_0x2188b3);}else if(_0x48e9f3||_0x77e52f){_0x497db3[_0xcbfe('0x20')](_0x2502d5+'.'+_0x2188b3);}}else{_0x497db3[_0xcbfe('0x20')](_0x2502d5+'.'+_0x2188b3);}});return _0x497db3;}function getSqlClauses(){var _0xd13fab={'default':squel[_0xcbfe('0x22')](),'fields':squel['expr'](),'filter':squel[_0xcbfe('0x22')](),'tags':{'clause':squel[_0xcbfe('0x22')](),'ids':null},'user':{'clause':squel[_0xcbfe('0x22')](),'skip':![]}};return _0xd13fab;}function parseTagParameter(_0x541297){var _0x10220f=squel[_0xcbfe('0x22')]();if(_0x541297){var _0x1eb403=utils[_0xcbfe('0x23')](_0x541297);_0x1eb403[_0xcbfe('0x24')](function(_0x34cb1e){_0x10220f['or'](_0xcbfe('0x25'),'%,'+_0x34cb1e+',%');});}return _0x10220f;}function parseSearchFilter(_0x16ee7b){var _0x2642b2=squel[_0xcbfe('0x22')]();if(_0x16ee7b){var _0x2d299b=_0x16ee7b['replace']('\x5c','\x5c\x5c')[_0xcbfe('0x26')](/'/g,'\x27\x27');if(_0x2d299b['split']('\x20')[_0xcbfe('0x27')]>0x1){_0x2642b2['or'](_0xcbfe('0x28'),qs[_0xcbfe('0x29')](_0x2d299b,!![]),null);}else{if(qs['isNumeric'](_0x2d299b)){_0x2642b2['or']('c.id\x20LIKE\x20?',_0x2d299b+'%');_0x2642b2['or'](_0xcbfe('0x2a'),_0x2d299b+'%');_0x2642b2['or'](_0xcbfe('0x2b'),_0x2d299b+'%');_0x2642b2['or'](_0xcbfe('0x2c'),_0x2d299b+'%');}else if(qs[_0xcbfe('0x2d')](_0x2d299b)){_0x2642b2['or'](_0xcbfe('0x2e'),_0x2d299b+'%');}else{_0x2642b2['or'](_0xcbfe('0x2f'),'%'+_0x2d299b+'%');_0x2642b2['or']('c.lastName\x20LIKE\x20?','%'+_0x2d299b+'%');_0x2642b2['or'](_0xcbfe('0x2e'),'%'+_0x2d299b+'%');}}}return _0x2642b2;}function parseAdvancedSearchFilter(_0x372722,_0xf071af){var _0x592b19=getSqlClauses();var _0xc2333a=as[_0xcbfe('0x30')](_0x372722);var _0x2287f1=_0xc2333a[_0xcbfe('0x31')];for(var _0x329f2e=0x0;_0x329f2e<_0xc2333a[_0xcbfe('0x32')]['length'];_0x329f2e++){var _0x31f296=_0xc2333a[_0xcbfe('0x32')][_0x329f2e];var _0x4d281='c';var _0x360c33=_['find'](_0xf071af,[_0xcbfe('0x33'),_0x31f296[_0xcbfe('0x20')]]);if(_0x360c33){if(_0x31f296[_0xcbfe('0x20')]===_0xcbfe('0x34')||_0x360c33[_0xcbfe('0x35')]===_0xcbfe('0x36')){_0x31f296[_0xcbfe('0x37')]=_0xcbfe('0x38');}var _0x1154ce=as[_0xcbfe('0x39')](_0x4d281,_0x360c33[_0xcbfe('0x3a')],_0x31f296);_0x592b19['default'][_0x2287f1](_0x1154ce[_0xcbfe('0x3b')],_0x1154ce[_0xcbfe('0x3c')][_0xcbfe('0x3d')],_0x1154ce[_0xcbfe('0x3c')]['end']);}else{if(_0x31f296[_0xcbfe('0x20')]==='Tag'){var _0x4e7865=_0x31f296[_0xcbfe('0x3c')][_0xcbfe('0x3e')](',')[_0xcbfe('0x3f')](function(_0x4bceb3){return Number(_0x4bceb3);});var _0x409ebc=parseTagParameter(_0x4e7865);_0x592b19[_0xcbfe('0x40')][_0xcbfe('0x41')][_0xcbfe('0x42')](_0x409ebc);_0x592b19[_0xcbfe('0x40')]['ids']=_0x4e7865;}else if(_0x31f296['field']===_0xcbfe('0x43')){_0x592b19[_0xcbfe('0x44')][_0xcbfe('0x41')][_0xcbfe('0x42')](_0xcbfe('0x45'),_0x31f296[_0xcbfe('0x3c')]);_0x592b19['user'][_0xcbfe('0x46')]=!![];}}}return _0x592b19;}function parseModelFields(_0x49b5e1,_0x4818ea){var _0x579552=squel[_0xcbfe('0x22')]();var _0x58bbd9=_(_0x49b5e1)['keys']()['map'](function(_0x3cc5fe){return _[_0xcbfe('0x47')](_0x4818ea,[_0xcbfe('0x33'),_0x3cc5fe])?_0x3cc5fe:undefined;})[_0xcbfe('0x48')]()[_0xcbfe('0x3c')]();if(_0x49b5e1['Contact']){_0x58bbd9[_0xcbfe('0x1f')]('Contact');}if(_0x49b5e1[_0xcbfe('0x43')]){_0x58bbd9['push']('User');}if(_0x58bbd9[_0xcbfe('0x27')]>0x0){_0x58bbd9[_0xcbfe('0x24')](function(_0x3eb417){if(_0x3eb417===_0xcbfe('0x6')){_0x579552['and']('c.ListId\x20IN\x20?',[][_0xcbfe('0x49')](_0x49b5e1[_0x3eb417]));}else if(_0x3eb417===_0xcbfe('0x4a')){var _0x204a4c='%'+_0x49b5e1[_0x3eb417]+'%';_0x579552['and'](_0xcbfe('0x4b'),_0x204a4c);}else if(_0x3eb417===_0xcbfe('0x43')){_0x579552[_0xcbfe('0x42')](_0xcbfe('0x45'),_0x49b5e1[_0x3eb417]);}else{_0x579552[_0xcbfe('0x42')]('c.'+_0x3eb417+_0xcbfe('0x4c'),_0x49b5e1[_0x3eb417]);}});}return _0x579552;}function parseQueryParameters(_0x213c1b,_0x469337){var _0x25a91d=getSqlClauses();return Promise[_0xcbfe('0x4d')]()[_0xcbfe('0x4e')](function(){return parseModelFields(_0x213c1b,_0x469337);})['then'](function(_0xd259b4){_0x25a91d['fields'][_0xcbfe('0x42')](_0xd259b4);return parseTagParameter(_0x213c1b['tag']);})[_0xcbfe('0x4e')](function(_0x2dc72b){_0x25a91d[_0xcbfe('0x40')][_0xcbfe('0x41')][_0xcbfe('0x42')](_0x2dc72b);return parseSearchFilter(_0x213c1b[_0xcbfe('0x4f')]);})[_0xcbfe('0x4e')](function(_0x1dbc5c){_0x25a91d[_0xcbfe('0x4f')]=_0x1dbc5c;return _0x25a91d;});}function checkListsRestrictions(_0x20d4ad,_0x55cc3c,_0x2c5a67){var _0x10a3d3=squel[_0xcbfe('0x22')]();return Promise['resolve']()[_0xcbfe('0x4e')](function(){if(_0x55cc3c[_0xcbfe('0x5')]&&_0x20d4ad[_0xcbfe('0x50')]===_0xcbfe('0x51')&&!_0x2c5a67){return _0x20d4ad['getLists']({'attributes':['id'],'raw':!![]});}})[_0xcbfe('0x4e')](function(_0x515fe3){if(_0x515fe3){if(_0x515fe3[_0xcbfe('0x27')]===0x0){_0x10a3d3[_0xcbfe('0x42')]('c.ListId\x20IS\x20NULL');}else{_0x10a3d3[_0xcbfe('0x42')](_0xcbfe('0x52'),_[_0xcbfe('0x3f')](_0x515fe3,'id'));}}})[_0xcbfe('0x4e')](function(){return _0x10a3d3;});}function buildContactsQuery(_0x211ca3,_0x3958b1,_0x1c0df7,_0x44aba3,_0x1f05b9,_0x481f00){if(_0x3958b1){_0x3958b1=_0x1c0df7[_0xcbfe('0x53')];}_0x211ca3=addFieldsToQuery(_0x211ca3,_0x3958b1,_0x44aba3,_0x481f00,!![]);var _0x4095d4=squel[_0xcbfe('0x8')]();_0x4095d4=addFieldsToQuery(_0x4095d4,_0x3958b1,_0x44aba3,_0x481f00,![]);if(_0x44aba3||_0x481f00){_0x211ca3=applyJoinClauses(_0x211ca3,!![]);_0x211ca3[_0xcbfe('0x54')](_0xcbfe('0x55'));if(_0x1c0df7[_0xcbfe('0x56')]){_0x4095d4['limit'](_0x1c0df7[_0xcbfe('0x56')]);}if(_0x1c0df7[_0xcbfe('0x57')]){_0x4095d4['offset'](_0x1c0df7[_0xcbfe('0x57')]);}}else{_0x4095d4=applyJoinClauses(_0x4095d4,![]);_0x4095d4[_0xcbfe('0x54')](_0xcbfe('0x58'));if(_0x1c0df7[_0xcbfe('0x56')]){_0x211ca3[_0xcbfe('0x56')](_0x1c0df7[_0xcbfe('0x56')]);}if(_0x1c0df7[_0xcbfe('0x57')]){_0x211ca3['offset'](_0x1c0df7[_0xcbfe('0x57')]);}}_0x4095d4[_0xcbfe('0x59')](_0x1f05b9);if(_0x1c0df7[_0xcbfe('0x5a')]){_0x1c0df7['order']['forEach'](function(_0x1706ae){_0x211ca3[_0xcbfe('0x5a')]('c.'+_0x1706ae[0x0],_0x1706ae[0x1]===_0xcbfe('0x5b')?![]:!![]);_0x4095d4[_0xcbfe('0x5a')](_0xcbfe('0x5c')+_0x1706ae[0x0],_0x1706ae[0x1]===_0xcbfe('0x5b')?![]:!![]);});}_0x4095d4[_0xcbfe('0x9')](_0x211ca3,_0xcbfe('0x14'));return _0x4095d4;}function getFilteredContacts(_0x1a0ccb){var _0x32a0d3=[];return db[_0xcbfe('0x5d')]['findAll']({'attributes':['id','name',_0xcbfe('0x5e')],'raw':!![]})[_0xcbfe('0x4e')](function(_0x263c2f){_0x32a0d3=_[_0xcbfe('0x5f')](_0x263c2f,'id');var _0x166281={'type':db[_0xcbfe('0x60')][_0xcbfe('0x61')]['SELECT'],'model':db[_0xcbfe('0x62')],'mapToModel':!![],'nest':!![],'raw':!![]};return db['sequelize'][_0xcbfe('0x63')](_0x1a0ccb[_0xcbfe('0x64')](),_0x166281);})[_0xcbfe('0x4e')](function(_0x35602d){_0x35602d['forEach'](function(_0x34f8e9){if(_0x34f8e9[_0xcbfe('0x1e')]){_0x34f8e9['Tags']=[];_0x34f8e9[_0xcbfe('0x1e')][_0xcbfe('0x3e')](',')[_0xcbfe('0x24')](function(_0x206bc6){_0x34f8e9[_0xcbfe('0x65')][_0xcbfe('0x1f')](_0x32a0d3[_0x206bc6]);});}delete _0x34f8e9[_0xcbfe('0x1e')];});return _0x35602d;});}function countFilteredContacts(_0x4de556,_0x2aaacc){var _0x2adfbb=_0x4de556['clone']();_0x2adfbb['field'](_0xcbfe('0x66'));_0x2adfbb=applyJoinClauses(_0x2adfbb,!![]);_0x4de556['group'](_0xcbfe('0x55'));var _0x428e0f=utils[_0xcbfe('0x23')](_0x2aaacc);if(!_[_0xcbfe('0x67')](_0x428e0f)){_0x2adfbb[_0xcbfe('0xb')](_0xcbfe('0x68'),_0x428e0f);}var _0x3adb9e={'type':db[_0xcbfe('0x60')]['QueryTypes'][_0xcbfe('0x69')],'raw':!![]};return db[_0xcbfe('0x6a')][_0xcbfe('0x63')](_0x2adfbb[_0xcbfe('0x64')](),_0x3adb9e)[_0xcbfe('0x4e')](function(_0x3edb3a){return _0x3edb3a[0x0]['COUNT(*)'];});}module['exports']={'buildContactsQuery':buildContactsQuery,'checkListsRestrictions':checkListsRestrictions,'countFilteredContacts':countFilteredContacts,'getContactsSubquery':getContactsSubquery,'getFilteredContacts':getFilteredContacts,'parseAdvancedSearchFilter':parseAdvancedSearchFilter,'parseQueryParameters':parseQueryParameters,'skipContactsQuery':skipContactsQuery}; \ No newline at end of file +var _0x19a6=['having','order','DESC','findAll','keyBy','Sequelize','QueryTypes','CmContact','sequelize','query','toString','Tags','t.id\x20IN\x20?','SELECT','COUNT(*)','exports','lodash','../parsers/advancedSearch','../parsers/qs','../interaction/utils','../../mysqldb','role','ListId','autocomplete','true','from','cm_contacts','where','c.deletedAt\x20IS\x20NULL','subqry','left_join','cm_user_has_contacts','uc.CmContactId\x20=\x20','.id','cm_contact_has_tags','ct.CmContactId\x20=\x20','tools_tags','t.id\x20=\x20ct.TagId','firstName','lastName','phone','mobile','fax','email','CompanyId','updatedAt','deletedAt','TagIds','includes','push','field','expr','getSelectedTags','forEach','CONCAT(\x27,\x27,\x20subqry.TagIds,\x20\x27,\x27)\x20LIKE\x20?','replace','split','length','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','isNumeric','c.id\x20LIKE\x20?','c.phone\x20LIKE\x20?','c.fax\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','c.lastName\x20LIKE\x20?','sqlOperator','conditions','find','name','dateOfBirth','fieldType','castTo','DATE','buildExpression','type','default','value','start','end','Tag','map','tags','and','ids','User','user','clause','uc.UserId\x20=\x20?','skip','keys','some','compact','Contact','concat','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','\x20=\x20?','resolve','then','fields','tag','filter','search','agent','getLists','c.ListId\x20IN\x20?','attributes','select','c.id','limit','offset','group'];(function(_0x2a38e6,_0x18f3fe){var _0x71e076=function(_0x593ef1){while(--_0x593ef1){_0x2a38e6['push'](_0x2a38e6['shift']());}};_0x71e076(++_0x18f3fe);}(_0x19a6,0x1d4));var _0x619a=function(_0x5003f3,_0x25ddf6){_0x5003f3=_0x5003f3-0x0;var _0x49047a=_0x19a6[_0x5003f3];return _0x49047a;};'use strict';var _=require(_0x619a('0x0'));var squel=require('squel');var as=require(_0x619a('0x1'));var qs=require(_0x619a('0x2'));var utils=require(_0x619a('0x3'));var db=require(_0x619a('0x4'))['db'];function skipContactsQuery(_0x742267,_0x5a3f17){var _0x414787=![];if(_0x742267[_0x619a('0x5')]==='agent'&&!_0x5a3f17['search']&&!_0x5a3f17[_0x619a('0x6')]&&_0x5a3f17[_0x619a('0x7')]!==_0x619a('0x8')){_0x414787=!![];}return _0x414787;}function getContactsSubquery(){return squel['select']()[_0x619a('0x9')](_0x619a('0xa'),'c')[_0x619a('0xb')](_0x619a('0xc'));}function applyJoinClauses(_0x5969bc,_0x53ed88){var _0x1e2852=_0x53ed88?'c':_0x619a('0xd');_0x5969bc[_0x619a('0xe')](_0x619a('0xf'),'uc',_0x619a('0x10')+_0x1e2852+_0x619a('0x11'))[_0x619a('0xe')](_0x619a('0x12'),'ct',_0x619a('0x13')+_0x1e2852+_0x619a('0x11'))[_0x619a('0xe')](_0x619a('0x14'),'t',_0x619a('0x15'));return _0x5969bc;}function addFieldsToQuery(_0x10da6e,_0x28f551,_0x107d60,_0x3e6eb8,_0x32e334){var _0x7176a7=_0x32e334?'c':_0x619a('0xd');if(!_0x28f551){_0x28f551=['id',_0x619a('0x16'),_0x619a('0x17'),_0x619a('0x18'),_0x619a('0x19'),_0x619a('0x1a'),_0x619a('0x1b'),_0x619a('0x6'),_0x619a('0x1c'),'createdAt',_0x619a('0x1d'),_0x619a('0x1e'),_0x619a('0x1f')];}else if(!_0x28f551[_0x619a('0x20')]('id')){_0x28f551[_0x619a('0x21')]('id');}var _0x2ed9cc=_0x107d60&&_0x32e334||!_0x107d60&&!_0x32e334;if(_0x3e6eb8){_0x2ed9cc=_0x3e6eb8&&_0x32e334||!_0x3e6eb8&&!_0x32e334;}_0x28f551['forEach'](function(_0x13cb4e){if(_0x13cb4e===_0x619a('0x1f')){if(_0x2ed9cc){_0x10da6e[_0x619a('0x22')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0x13cb4e);}else if(_0x107d60||_0x3e6eb8){_0x10da6e[_0x619a('0x22')](_0x7176a7+'.'+_0x13cb4e);}}else{_0x10da6e[_0x619a('0x22')](_0x7176a7+'.'+_0x13cb4e);}});return _0x10da6e;}function getSqlClauses(){var _0x329bb2={'default':squel['expr'](),'fields':squel[_0x619a('0x23')](),'filter':squel[_0x619a('0x23')](),'tags':{'clause':squel['expr'](),'ids':null},'user':{'clause':squel[_0x619a('0x23')](),'skip':![]}};return _0x329bb2;}function parseTagParameter(_0x47ac43){var _0xf1863b=squel[_0x619a('0x23')]();if(_0x47ac43){var _0x2ceb7f=utils[_0x619a('0x24')](_0x47ac43);_0x2ceb7f[_0x619a('0x25')](function(_0x2d94d6){_0xf1863b['or'](_0x619a('0x26'),'%,'+_0x2d94d6+',%');});}return _0xf1863b;}function parseSearchFilter(_0x510b70){var _0x503284=squel[_0x619a('0x23')]();if(_0x510b70){var _0x9ea8d2=_0x510b70[_0x619a('0x27')]('\x5c','\x5c\x5c')[_0x619a('0x27')](/'/g,'\x27\x27');if(_0x9ea8d2[_0x619a('0x28')]('\x20')[_0x619a('0x29')]>0x1){_0x503284['or'](_0x619a('0x2a'),qs[_0x619a('0x2b')](_0x9ea8d2,!![]),null);}else{if(qs[_0x619a('0x2c')](_0x9ea8d2)){_0x503284['or'](_0x619a('0x2d'),_0x9ea8d2+'%');_0x503284['or'](_0x619a('0x2e'),_0x9ea8d2+'%');_0x503284['or']('c.mobile\x20LIKE\x20?',_0x9ea8d2+'%');_0x503284['or'](_0x619a('0x2f'),_0x9ea8d2+'%');}else if(qs[_0x619a('0x30')](_0x9ea8d2)){_0x503284['or'](_0x619a('0x31'),_0x9ea8d2+'%');}else{_0x503284['or']('c.firstName\x20LIKE\x20?','%'+_0x9ea8d2+'%');_0x503284['or'](_0x619a('0x32'),'%'+_0x9ea8d2+'%');_0x503284['or'](_0x619a('0x31'),'%'+_0x9ea8d2+'%');}}}return _0x503284;}function parseAdvancedSearchFilter(_0x567120,_0xa86382){var _0x14c58a=getSqlClauses();var _0x551d05=as['parseSearch'](_0x567120);var _0x214b2a=_0x551d05[_0x619a('0x33')];for(var _0x46aa2b=0x0;_0x46aa2b<_0x551d05[_0x619a('0x34')][_0x619a('0x29')];_0x46aa2b++){var _0x3a5bed=_0x551d05[_0x619a('0x34')][_0x46aa2b];var _0xb783df='c';var _0x197f15=_[_0x619a('0x35')](_0xa86382,[_0x619a('0x36'),_0x3a5bed[_0x619a('0x22')]]);if(_0x197f15){if(_0x3a5bed[_0x619a('0x22')]===_0x619a('0x37')||_0x197f15[_0x619a('0x38')]==='datetime'){_0x3a5bed[_0x619a('0x39')]=_0x619a('0x3a');}var _0x4e6c17=as[_0x619a('0x3b')](_0xb783df,_0x197f15[_0x619a('0x3c')],_0x3a5bed);_0x14c58a[_0x619a('0x3d')][_0x214b2a](_0x4e6c17['text'],_0x4e6c17[_0x619a('0x3e')][_0x619a('0x3f')],_0x4e6c17['value'][_0x619a('0x40')]);}else{if(_0x3a5bed['field']===_0x619a('0x41')){var _0x1d5f1e=_0x3a5bed[_0x619a('0x3e')]['split'](',')[_0x619a('0x42')](function(_0x26944c){return Number(_0x26944c);});var _0x1bc4e0=parseTagParameter(_0x1d5f1e);_0x14c58a[_0x619a('0x43')]['clause'][_0x619a('0x44')](_0x1bc4e0);_0x14c58a[_0x619a('0x43')][_0x619a('0x45')]=_0x1d5f1e;}else if(_0x3a5bed[_0x619a('0x22')]===_0x619a('0x46')){_0x14c58a[_0x619a('0x47')][_0x619a('0x48')][_0x619a('0x44')](_0x619a('0x49'),_0x3a5bed[_0x619a('0x3e')]);_0x14c58a[_0x619a('0x47')][_0x619a('0x4a')]=!![];}}}return _0x14c58a;}function parseModelFields(_0x5626cc,_0x58bd86){var _0x2b0c34=squel[_0x619a('0x23')]();var _0x16d0ac=_(_0x5626cc)[_0x619a('0x4b')]()['map'](function(_0x3053aa){return _[_0x619a('0x4c')](_0x58bd86,[_0x619a('0x36'),_0x3053aa])?_0x3053aa:undefined;})[_0x619a('0x4d')]()['value']();if(_0x5626cc[_0x619a('0x4e')]){_0x16d0ac['push'](_0x619a('0x4e'));}if(_0x5626cc[_0x619a('0x46')]){_0x16d0ac[_0x619a('0x21')](_0x619a('0x46'));}if(_0x16d0ac[_0x619a('0x29')]>0x0){_0x16d0ac[_0x619a('0x25')](function(_0x2fa817){if(_0x2fa817===_0x619a('0x6')){_0x2b0c34[_0x619a('0x44')]('c.ListId\x20IN\x20?',[][_0x619a('0x4f')](_0x5626cc[_0x2fa817]));}else if(_0x2fa817==='Contact'){var _0x1112d7='%'+_0x5626cc[_0x2fa817]+'%';_0x2b0c34['and'](_0x619a('0x50'),_0x1112d7);}else if(_0x2fa817===_0x619a('0x46')){_0x2b0c34[_0x619a('0x44')](_0x619a('0x49'),_0x5626cc[_0x2fa817]);}else{_0x2b0c34['and']('c.'+_0x2fa817+_0x619a('0x51'),_0x5626cc[_0x2fa817]);}});}return _0x2b0c34;}function parseQueryParameters(_0x7972ed,_0x55474f){var _0x3f64ed=getSqlClauses();return Promise[_0x619a('0x52')]()['then'](function(){return parseModelFields(_0x7972ed,_0x55474f);})[_0x619a('0x53')](function(_0x1ec74a){_0x3f64ed[_0x619a('0x54')][_0x619a('0x44')](_0x1ec74a);return parseTagParameter(_0x7972ed[_0x619a('0x55')]);})[_0x619a('0x53')](function(_0xeb275){_0x3f64ed['tags'][_0x619a('0x48')][_0x619a('0x44')](_0xeb275);return parseSearchFilter(_0x7972ed[_0x619a('0x56')]);})[_0x619a('0x53')](function(_0x22a9eb){_0x3f64ed[_0x619a('0x56')]=_0x22a9eb;return _0x3f64ed;});}function checkListsRestrictions(_0x2b01e2,_0x490b55,_0x5c3a54){var _0x2bdefe=squel[_0x619a('0x23')]();return Promise['resolve']()[_0x619a('0x53')](function(){if(_0x490b55[_0x619a('0x57')]&&_0x2b01e2['role']===_0x619a('0x58')&&!_0x5c3a54){return _0x2b01e2[_0x619a('0x59')]({'attributes':['id'],'raw':!![]});}})[_0x619a('0x53')](function(_0x2781c4){if(_0x2781c4){if(_0x2781c4['length']===0x0){_0x2bdefe[_0x619a('0x44')]('c.ListId\x20IS\x20NULL');}else{_0x2bdefe['and'](_0x619a('0x5a'),_[_0x619a('0x42')](_0x2781c4,'id'));}}})['then'](function(){return _0x2bdefe;});}function buildContactsQuery(_0x3eaa1f,_0x3e7275,_0xe1b300,_0x20c492,_0x50f65c,_0x119abf){if(_0x3e7275){_0x3e7275=_0xe1b300[_0x619a('0x5b')];}_0x3eaa1f=addFieldsToQuery(_0x3eaa1f,_0x3e7275,_0x20c492,_0x119abf,!![]);var _0x494e31=squel[_0x619a('0x5c')]();_0x494e31=addFieldsToQuery(_0x494e31,_0x3e7275,_0x20c492,_0x119abf,![]);if(_0x20c492||_0x119abf){_0x3eaa1f=applyJoinClauses(_0x3eaa1f,!![]);_0x3eaa1f['group'](_0x619a('0x5d'));if(_0xe1b300['limit']){_0x494e31[_0x619a('0x5e')](_0xe1b300[_0x619a('0x5e')]);}if(_0xe1b300['offset']){_0x494e31[_0x619a('0x5f')](_0xe1b300['offset']);}}else{_0x494e31=applyJoinClauses(_0x494e31,![]);_0x494e31[_0x619a('0x60')]('subqry.id');if(_0xe1b300[_0x619a('0x5e')]){_0x3eaa1f['limit'](_0xe1b300[_0x619a('0x5e')]);}if(_0xe1b300[_0x619a('0x5f')]){_0x3eaa1f[_0x619a('0x5f')](_0xe1b300[_0x619a('0x5f')]);}}_0x494e31[_0x619a('0x61')](_0x50f65c);if(_0xe1b300[_0x619a('0x62')]){_0xe1b300[_0x619a('0x62')][_0x619a('0x25')](function(_0x3bb199){_0x3eaa1f[_0x619a('0x62')]('c.'+_0x3bb199[0x0],_0x3bb199[0x1]===_0x619a('0x63')?![]:!![]);_0x494e31[_0x619a('0x62')]('subqry.'+_0x3bb199[0x0],_0x3bb199[0x1]==='DESC'?![]:!![]);});}_0x494e31[_0x619a('0x9')](_0x3eaa1f,_0x619a('0xd'));return _0x494e31;}function getFilteredContacts(_0x44d8de){var _0x36567f=[];return db[_0x619a('0x41')][_0x619a('0x64')]({'attributes':['id',_0x619a('0x36'),'color'],'raw':!![]})['then'](function(_0x11b1d0){_0x36567f=_[_0x619a('0x65')](_0x11b1d0,'id');var _0x5019a5={'type':db[_0x619a('0x66')][_0x619a('0x67')]['SELECT'],'model':db[_0x619a('0x68')],'mapToModel':!![],'nest':!![],'raw':!![]};return db[_0x619a('0x69')][_0x619a('0x6a')](_0x44d8de[_0x619a('0x6b')](),_0x5019a5);})['then'](function(_0x1ae8b5){_0x1ae8b5['forEach'](function(_0x3cf721){if(_0x3cf721[_0x619a('0x1f')]){_0x3cf721['Tags']=[];_0x3cf721[_0x619a('0x1f')][_0x619a('0x28')](',')['forEach'](function(_0x2a607d){_0x3cf721[_0x619a('0x6c')]['push'](_0x36567f[_0x2a607d]);});}delete _0x3cf721[_0x619a('0x1f')];});return _0x1ae8b5;});}function countFilteredContacts(_0x4f33c4,_0x17a847){var _0x18bbf8=_0x4f33c4['clone']();_0x18bbf8[_0x619a('0x22')]('COUNT(*)');_0x18bbf8=applyJoinClauses(_0x18bbf8,!![]);_0x4f33c4[_0x619a('0x60')](_0x619a('0x5d'));var _0x4a4c2c=utils[_0x619a('0x24')](_0x17a847);if(!_['isEmpty'](_0x4a4c2c)){_0x18bbf8[_0x619a('0xb')](_0x619a('0x6d'),_0x4a4c2c);}var _0x586db1={'type':db[_0x619a('0x66')]['QueryTypes'][_0x619a('0x6e')],'raw':!![]};return db[_0x619a('0x69')][_0x619a('0x6a')](_0x18bbf8[_0x619a('0x6b')](),_0x586db1)[_0x619a('0x53')](function(_0x5de164){return _0x5de164[0x0][_0x619a('0x6f')];});}module[_0x619a('0x70')]={'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 4d90b0a..c5a54b3 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 _0x397b=['encryptFile','createWriteStream','createCipher','data','update','binary','write','final','end','close','unlink','decryptFile','createDecipher','encryptString','utf8','decryptString','secret','base64','../../config/logger','app','secrets','session','aes-256-ctr','aes192','encrypt','algorithm','join','error','is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:','test','getCiphers','filter','indexOf','hasOwnProperty'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x397b,0xde));var _0xb397=function(_0x24ea2a,_0x3ceac3){_0x24ea2a=_0x24ea2a-0x0;var _0x1a599e=_0x397b[_0x24ea2a];return _0x1a599e;};'use strict';var crypto=require('crypto');var fs=require('fs');var BPromise=require('bluebird');var _=require('lodash');var config=require('../../config/environment');var logger=require(_0xb397('0x0'))(_0xb397('0x1'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config[_0xb397('0x2')][_0xb397('0x3')],'algorithm':_0xb397('0x4')};const fileOptions={'algorithm':_0xb397('0x5')};if(config[_0xb397('0x6')]&&config[_0xb397('0x6')][_0xb397('0x7')]){var isSupported=isAlgorithmSupported(config[_0xb397('0x6')][_0xb397('0x7')]);if(isSupported){fileOptions[_0xb397('0x7')]=config[_0xb397('0x6')]['algorithm'];}else{var supportedAlgorithms=getSupportedCiphers()[_0xb397('0x8')](',\x20');logger[_0xb397('0x9')](config[_0xb397('0x6')][_0xb397('0x7')],_0xb397('0xa'),supportedAlgorithms);}}function isASupportedCipher(_0x4f5ec1){return AES_SUPPORTED_RX[_0xb397('0xb')](_0x4f5ec1);}function getSupportedCiphers(){return crypto[_0xb397('0xc')]()[_0xb397('0xd')](isASupportedCipher);}function isAlgorithmSupported(_0x220744){return getSupportedCiphers()[_0xb397('0xe')](_0x220744)>-0x1;}function combineOptions(_0x14465f){var _0x3f77e0={};for(var _0x1998db in fileOptions){if(fileOptions[_0xb397('0xf')](_0x1998db)){_0x3f77e0[_0x1998db]=fileOptions[_0x1998db];}}if(_0x14465f){for(var _0x31fa7a in _0x14465f){if(_0x14465f[_0xb397('0xf')](_0x31fa7a)){_0x3f77e0[_0x31fa7a]=_0x14465f[_0x31fa7a];}}}return _0x3f77e0;}exports[_0xb397('0x10')]=function(_0x5f5065,_0x5a08fc,_0x53b2f8,_0x47aef1){return new BPromise(function(_0x15645a,_0x26d390){_0x47aef1=combineOptions(_0x47aef1);var _0x14a7fe=new Buffer(_0x53b2f8);var _0x1a5341=fs['createReadStream'](_0x5f5065);var _0x2d4d71=fs[_0xb397('0x11')](_0x5a08fc);var _0x44e01f=crypto[_0xb397('0x12')](_0x47aef1[_0xb397('0x7')],_0x14a7fe);_0x1a5341['on'](_0xb397('0x13'),function(_0x13d5bc){var _0x542be3=new Buffer(_0x44e01f[_0xb397('0x14')](_0x13d5bc),_0xb397('0x15'));_0x2d4d71[_0xb397('0x16')](_0x542be3);});_0x1a5341['on']('end',function(){try{var _0x461aaf=new Buffer(_0x44e01f[_0xb397('0x17')]('binary'),_0xb397('0x15'));_0x2d4d71[_0xb397('0x16')](_0x461aaf);_0x2d4d71[_0xb397('0x18')]();_0x2d4d71['on'](_0xb397('0x19'),function(){return _0x15645a(_0x5a08fc);});}catch(_0x357da2){fs[_0xb397('0x1a')](_0x5a08fc);return _0x26d390(_0x357da2);}});});};exports[_0xb397('0x1b')]=function(_0x4ed9bb,_0x35a45d,_0x2556c4,_0x52ca31){return new BPromise(function(_0x315ef0,_0x3fbee7){_0x52ca31=combineOptions(_0x52ca31);var _0x144893=new Buffer(_0x2556c4);var _0x487a71=fs['createReadStream'](_0x4ed9bb);var _0x281ea0=fs['createWriteStream'](_0x35a45d);var _0x1a5c45=crypto[_0xb397('0x1c')](_0x52ca31[_0xb397('0x7')],_0x144893);_0x487a71['on'](_0xb397('0x13'),function(_0x59f15b){var _0x20b75d=new Buffer(_0x1a5c45[_0xb397('0x14')](_0x59f15b),_0xb397('0x15'));_0x281ea0[_0xb397('0x16')](_0x20b75d);});_0x487a71['on'](_0xb397('0x18'),function(){try{var _0x594b0e=new Buffer(_0x1a5c45['final'](_0xb397('0x15')),'binary');_0x281ea0['write'](_0x594b0e);_0x281ea0[_0xb397('0x18')]();_0x281ea0['on'](_0xb397('0x19'),function(){return _0x315ef0(_0x35a45d);});}catch(_0x5b962e){fs[_0xb397('0x1a')](_0x35a45d);return _0x3fbee7(_0x5b962e);}});});};exports[_0xb397('0x1d')]=function(_0x47430a,_0x11ed3b,_0x2b4004){var _0x31c8b0=_0x2b4004||stringOptions[_0xb397('0x7')];var _0x527ab6=_0x11ed3b||stringOptions['secret'];var _0x22e3ff=crypto['createCipher'](_0x31c8b0,_0x527ab6);var _0x18e439=_0x22e3ff[_0xb397('0x14')](_0x47430a,_0xb397('0x1e'),'base64');_0x18e439+=_0x22e3ff[_0xb397('0x17')]('base64');return _0x18e439;};exports[_0xb397('0x1f')]=function(_0x4419d1,_0x1f5970,_0x2caf94){var _0xb8e4a3=_0x2caf94||stringOptions[_0xb397('0x7')];var _0x442ded=_0x1f5970||stringOptions[_0xb397('0x20')];var _0x42c5c9=crypto[_0xb397('0x1c')](_0xb8e4a3,_0x442ded);var _0x376068=_0x42c5c9[_0xb397('0x14')](_0x4419d1,_0xb397('0x21'),_0xb397('0x1e'));_0x376068+=_0x42c5c9['final'](_0xb397('0x1e'));return _0x376068;}; \ No newline at end of file +var _0x8f2e=['aes-256-ctr','aes192','encrypt','algorithm','join','error','is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:','test','getCiphers','filter','indexOf','hasOwnProperty','encryptFile','createWriteStream','createCipher','data','update','write','end','final','binary','unlink','decryptFile','createReadStream','createDecipher','close','encryptString','secret','utf8','base64','crypto','bluebird','lodash','../../config/environment','../../config/logger','app','session'];(function(_0x2edbf6,_0x3898d9){var _0x2dcc6f=function(_0x4468a5){while(--_0x4468a5){_0x2edbf6['push'](_0x2edbf6['shift']());}};_0x2dcc6f(++_0x3898d9);}(_0x8f2e,0xfc));var _0xe8f2=function(_0x45d992,_0x2a4afd){_0x45d992=_0x45d992-0x0;var _0x443f92=_0x8f2e[_0x45d992];return _0x443f92;};'use strict';var crypto=require(_0xe8f2('0x0'));var fs=require('fs');var BPromise=require(_0xe8f2('0x1'));var _=require(_0xe8f2('0x2'));var config=require(_0xe8f2('0x3'));var logger=require(_0xe8f2('0x4'))(_0xe8f2('0x5'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config['secrets'][_0xe8f2('0x6')],'algorithm':_0xe8f2('0x7')};const fileOptions={'algorithm':_0xe8f2('0x8')};if(config[_0xe8f2('0x9')]&&config[_0xe8f2('0x9')][_0xe8f2('0xa')]){var isSupported=isAlgorithmSupported(config[_0xe8f2('0x9')][_0xe8f2('0xa')]);if(isSupported){fileOptions[_0xe8f2('0xa')]=config[_0xe8f2('0x9')][_0xe8f2('0xa')];}else{var supportedAlgorithms=getSupportedCiphers()[_0xe8f2('0xb')](',\x20');logger[_0xe8f2('0xc')](config[_0xe8f2('0x9')][_0xe8f2('0xa')],_0xe8f2('0xd'),supportedAlgorithms);}}function isASupportedCipher(_0x534cfc){return AES_SUPPORTED_RX[_0xe8f2('0xe')](_0x534cfc);}function getSupportedCiphers(){return crypto[_0xe8f2('0xf')]()[_0xe8f2('0x10')](isASupportedCipher);}function isAlgorithmSupported(_0x52d3b2){return getSupportedCiphers()[_0xe8f2('0x11')](_0x52d3b2)>-0x1;}function combineOptions(_0x1ca30d){var _0x429613={};for(var _0x4eb16f in fileOptions){if(fileOptions[_0xe8f2('0x12')](_0x4eb16f)){_0x429613[_0x4eb16f]=fileOptions[_0x4eb16f];}}if(_0x1ca30d){for(var _0x1e11e4 in _0x1ca30d){if(_0x1ca30d[_0xe8f2('0x12')](_0x1e11e4)){_0x429613[_0x1e11e4]=_0x1ca30d[_0x1e11e4];}}}return _0x429613;}exports[_0xe8f2('0x13')]=function(_0x26479a,_0x29b935,_0x3d6996,_0x34d29f){return new BPromise(function(_0x4c18de,_0xa54b0f){_0x34d29f=combineOptions(_0x34d29f);var _0x1c6557=new Buffer(_0x3d6996);var _0x3a8bc7=fs['createReadStream'](_0x26479a);var _0x1ececa=fs[_0xe8f2('0x14')](_0x29b935);var _0x162c3d=crypto[_0xe8f2('0x15')](_0x34d29f[_0xe8f2('0xa')],_0x1c6557);_0x3a8bc7['on'](_0xe8f2('0x16'),function(_0x156626){var _0x31be20=new Buffer(_0x162c3d[_0xe8f2('0x17')](_0x156626),'binary');_0x1ececa[_0xe8f2('0x18')](_0x31be20);});_0x3a8bc7['on'](_0xe8f2('0x19'),function(){try{var _0x35cdac=new Buffer(_0x162c3d[_0xe8f2('0x1a')](_0xe8f2('0x1b')),_0xe8f2('0x1b'));_0x1ececa[_0xe8f2('0x18')](_0x35cdac);_0x1ececa[_0xe8f2('0x19')]();_0x1ececa['on']('close',function(){return _0x4c18de(_0x29b935);});}catch(_0x3b8fcd){fs[_0xe8f2('0x1c')](_0x29b935);return _0xa54b0f(_0x3b8fcd);}});});};exports[_0xe8f2('0x1d')]=function(_0x38e4ca,_0x50d0ec,_0x277438,_0x2a051a){return new BPromise(function(_0x57a10b,_0x14a902){_0x2a051a=combineOptions(_0x2a051a);var _0x5e2a21=new Buffer(_0x277438);var _0x394500=fs[_0xe8f2('0x1e')](_0x38e4ca);var _0x205d60=fs['createWriteStream'](_0x50d0ec);var _0x17eb6e=crypto[_0xe8f2('0x1f')](_0x2a051a[_0xe8f2('0xa')],_0x5e2a21);_0x394500['on'](_0xe8f2('0x16'),function(_0x1f6b25){var _0x5b8c54=new Buffer(_0x17eb6e[_0xe8f2('0x17')](_0x1f6b25),_0xe8f2('0x1b'));_0x205d60[_0xe8f2('0x18')](_0x5b8c54);});_0x394500['on']('end',function(){try{var _0x3bc661=new Buffer(_0x17eb6e[_0xe8f2('0x1a')](_0xe8f2('0x1b')),'binary');_0x205d60[_0xe8f2('0x18')](_0x3bc661);_0x205d60[_0xe8f2('0x19')]();_0x205d60['on'](_0xe8f2('0x20'),function(){return _0x57a10b(_0x50d0ec);});}catch(_0x416e89){fs[_0xe8f2('0x1c')](_0x50d0ec);return _0x14a902(_0x416e89);}});});};exports[_0xe8f2('0x21')]=function(_0x45e656,_0x508c59,_0x44c9a4){var _0x10a938=_0x44c9a4||stringOptions[_0xe8f2('0xa')];var _0x325106=_0x508c59||stringOptions[_0xe8f2('0x22')];var _0x3ef416=crypto['createCipher'](_0x10a938,_0x325106);var _0x326b11=_0x3ef416[_0xe8f2('0x17')](_0x45e656,_0xe8f2('0x23'),_0xe8f2('0x24'));_0x326b11+=_0x3ef416['final'](_0xe8f2('0x24'));return _0x326b11;};exports['decryptString']=function(_0x47388a,_0x400a43,_0x530be6){var _0x1699c1=_0x530be6||stringOptions['algorithm'];var _0x437d71=_0x400a43||stringOptions[_0xe8f2('0x22')];var _0x4b03a7=crypto[_0xe8f2('0x1f')](_0x1699c1,_0x437d71);var _0x5b44e6=_0x4b03a7[_0xe8f2('0x17')](_0x47388a,_0xe8f2('0x24'),_0xe8f2('0x23'));_0x5b44e6+=_0x4b03a7['final']('utf8');return _0x5b44e6;}; \ No newline at end of file diff --git a/server/components/export/csv.js b/server/components/export/csv.js index b11802d..4e9afb9 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 _0xed7f=['Empty','length','range','num','forEach','push','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','basename','existsSync','join','mkdirSync','each','%s%d.%s','csv','%s.%s','writeFileSync','zip','zip\x20finished','Completed','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','finally','exit','util','path','lodash','bluebird','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','analytics','argv','savename','update','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','CSV','Setting','find','split','splitSizeCsv','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT','then'];(function(_0x56ff32,_0x17b7ed){var _0x2e10b1=function(_0x112767){while(--_0x112767){_0x56ff32['push'](_0x56ff32['shift']());}};_0x2e10b1(++_0x17b7ed);}(_0xed7f,0x1b0));var _0xfed7=function(_0xa64da9,_0x549be6){_0xa64da9=_0xa64da9-0x0;var _0x2e5f3a=_0xed7f[_0xa64da9];return _0x2e5f3a;};'use strict';var util=require(_0xfed7('0x0'));var path=require(_0xfed7('0x1'));var _=require(_0xfed7('0x2'));var csv=require('to-csv');var fs=require('fs');var BPromise=require(_0xfed7('0x3'));var zipdir=require(_0xfed7('0x4'));var rimraf=require(_0xfed7('0x5'));var db=require(_0xfed7('0x6'))['db'];var dbH=require(_0xfed7('0x6'))[_0xfed7('0x7')];var logger=require(_0xfed7('0x8'))(_0xfed7('0x9'));var EXTRACTED_REPORT_ID=Number(process[_0xfed7('0xa')][0x2]);var QUERY=process[_0xfed7('0xa')][0x3];var PATH=process[_0xfed7('0xa')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x2809a1,_0x100a69){var _0x20fc32={'status':_0x2809a1};var _0x1b24d2={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x100a69){_0x20fc32[_0xfed7('0xb')]=_0x100a69;}return db['AnalyticExtractedReport'][_0xfed7('0xc')](_0x20fc32,_0x1b24d2);}function main(){var _0x3187f4=0x1388;var _0x558a00;logger[_0xfed7('0xd')](util[_0xfed7('0xe')](_0xfed7('0xf'),EXTRACTED_REPORT_ID,_0xfed7('0x10')));return db[_0xfed7('0x11')][_0xfed7('0x12')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xfed7('0x13'),_0xfed7('0x14')]})['then'](function(_0xec3a20){if(_0xec3a20){_0x558a00=_0xec3a20;_0x3187f4=_0x558a00[_0xfed7('0x14')]||0x1388;}})['then'](function(){return dbH[_0xfed7('0x15')][_0xfed7('0x16')](util[_0xfed7('0xe')](_0xfed7('0x17'),QUERY),{'type':dbH[_0xfed7('0x15')][_0xfed7('0x18')][_0xfed7('0x19')]});})[_0xfed7('0x1a')](function(_0x124389){if(!_0x124389[0x0]['num']){return analyticExtractedReport(_0xfed7('0x1b'));}var _0x3b9d04=[];var _0x3a6877=0x0;if(_0x558a00[_0xfed7('0x13')]){if(_0x124389&&_0x124389[_0xfed7('0x1c')]){var _0x25e3e9=_[_0xfed7('0x1d')](_0x124389[0x0]['num']/_0x3187f4);var _0x88e167=Number['isInteger'](_0x124389[0x0][_0xfed7('0x1e')]/_0x3187f4)?_0x124389[0x0][_0xfed7('0x1e')]%_0x3187f4:0x0;_0x25e3e9[_0xfed7('0x1f')](function(_0x1d62e3){if(_0x1d62e3>0x0){_0x3a6877+=_0x3187f4;}_0x3b9d04[_0xfed7('0x20')](dbH[_0xfed7('0x15')][_0xfed7('0x16')](util['format'](_0xfed7('0x21'),QUERY,_0x3187f4,_0x3a6877),{'type':dbH[_0xfed7('0x15')][_0xfed7('0x18')][_0xfed7('0x19')]}));});if(_0x88e167>0x0){_0x3a6877+=_0x3187f4;_0x3b9d04[_0xfed7('0x20')](dbH[_0xfed7('0x15')]['query'](util[_0xfed7('0xe')](_0xfed7('0x21'),QUERY,_0x88e167,_0x3a6877),{'type':dbH[_0xfed7('0x15')][_0xfed7('0x18')][_0xfed7('0x19')]}));}}}else{_0x3b9d04[_0xfed7('0x20')](dbH[_0xfed7('0x15')][_0xfed7('0x16')](QUERY,{'type':dbH['sequelize'][_0xfed7('0x18')][_0xfed7('0x19')]}));}var _0x511a1e=path[_0xfed7('0x22')](PATH);var _0x12b332=path[_0xfed7('0x23')](PATH,'.csv');var _0x5c4350=_0x558a00['split']&&_0x3b9d04[_0xfed7('0x1c')]>0x1;var _0x444309=[];if(!fs[_0xfed7('0x24')](path[_0xfed7('0x25')](_0x511a1e,_0x12b332))&&_0x5c4350){fs[_0xfed7('0x26')](path[_0xfed7('0x25')](_0x511a1e,_0x12b332));}return BPromise[_0xfed7('0x27')](_0x3b9d04,function(_0x4db50f){_0x444309['push'](_0x4db50f);})[_0xfed7('0x1a')](function(){for(var _0x3a1478=0x0;_0x3a1478<_0x444309[_0xfed7('0x1c')];_0x3a1478+=0x1){var _0x124c56;var _0x3a8484=_0x444309[_0x3a1478];if(_0x5c4350){_0x124c56=path[_0xfed7('0x25')](_0x511a1e,_0x12b332,util[_0xfed7('0xe')](_0xfed7('0x28'),_0x12b332,_0x3a1478,_0xfed7('0x29')));}else{_0x124c56=path['join'](_0x511a1e,util[_0xfed7('0xe')](_0xfed7('0x2a'),_0x12b332,_0xfed7('0x29')));}fs[_0xfed7('0x2b')](_0x124c56,csv(_0x3a8484));}})[_0xfed7('0x1a')](function(){if(_0x5c4350){return new Promise(function(_0x467670){zipdir(path[_0xfed7('0x25')](_0x511a1e,_0x12b332),{'saveTo':path['join'](_0x511a1e,util[_0xfed7('0xe')](_0xfed7('0x2a'),_0x12b332,_0xfed7('0x2c')))},function(_0x2f366,_0x5576d0){rimraf(path[_0xfed7('0x25')](_0x511a1e,_0x12b332),function(){});_0x467670(_0xfed7('0x2d'));});});}})[_0xfed7('0x1a')](function(){logger['info'](util['format']('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,_0xfed7('0x10')));return analyticExtractedReport(_0xfed7('0x2e'),_0x5c4350?util[_0xfed7('0xe')](_0xfed7('0x2a'),_0x12b332,_0x5c4350?'zip':_0xfed7('0x29')):null);});})['catch'](function(_0x199de9){logger[_0xfed7('0xd')](util['format'](_0xfed7('0x2f'),EXTRACTED_REPORT_ID,'CSV'),util[_0xfed7('0x30')](_0x199de9,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport('Failed');})[_0xfed7('0x31')](function(){process[_0xfed7('0x32')](EXIT_CODE);});}main(); \ No newline at end of file +var _0xa45e=['%s.%s','csv','CSV','Completed','zip','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','finally','util','path','lodash','to-csv','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','analytics','argv','AnalyticExtractedReport','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Setting','find','splitSizeCsv','then','sequelize','query','SELECT','num','split','length','range','isInteger','forEach','push','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','dirname','basename','.csv','existsSync','join','mkdirSync','%s%d.%s'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa45e,0xca));var _0xea45=function(_0x5b5d25,_0x48294c){_0x5b5d25=_0x5b5d25-0x0;var _0x3936be=_0xa45e[_0x5b5d25];return _0x3936be;};'use strict';var util=require(_0xea45('0x0'));var path=require(_0xea45('0x1'));var _=require(_0xea45('0x2'));var csv=require(_0xea45('0x3'));var fs=require('fs');var BPromise=require('bluebird');var zipdir=require(_0xea45('0x4'));var rimraf=require(_0xea45('0x5'));var db=require(_0xea45('0x6'))['db'];var dbH=require(_0xea45('0x6'))[_0xea45('0x7')];var logger=require(_0xea45('0x8'))(_0xea45('0x9'));var EXTRACTED_REPORT_ID=Number(process[_0xea45('0xa')][0x2]);var QUERY=process['argv'][0x3];var PATH=process[_0xea45('0xa')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x351d78,_0xb32e8){var _0x4b6357={'status':_0x351d78};var _0x52aa5e={'where':{'id':EXTRACTED_REPORT_ID}};if(_0xb32e8){_0x4b6357['savename']=_0xb32e8;}return db[_0xea45('0xb')]['update'](_0x4b6357,_0x52aa5e);}function main(){var _0x234b80=0x1388;var _0x255128;logger[_0xea45('0xc')](util[_0xea45('0xd')](_0xea45('0xe'),EXTRACTED_REPORT_ID,'CSV'));return db[_0xea45('0xf')][_0xea45('0x10')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0xea45('0x11')]})['then'](function(_0x39fc25){if(_0x39fc25){_0x255128=_0x39fc25;_0x234b80=_0x255128['splitSizeCsv']||0x1388;}})[_0xea45('0x12')](function(){return dbH[_0xea45('0x13')][_0xea45('0x14')](util[_0xea45('0xd')]('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH[_0xea45('0x13')]['QueryTypes'][_0xea45('0x15')]});})['then'](function(_0x12ee58){if(!_0x12ee58[0x0][_0xea45('0x16')]){return analyticExtractedReport('Empty');}var _0x2e6650=[];var _0x5d253c=0x0;if(_0x255128[_0xea45('0x17')]){if(_0x12ee58&&_0x12ee58[_0xea45('0x18')]){var _0x2fe947=_[_0xea45('0x19')](_0x12ee58[0x0][_0xea45('0x16')]/_0x234b80);var _0x30299c=Number[_0xea45('0x1a')](_0x12ee58[0x0][_0xea45('0x16')]/_0x234b80)?_0x12ee58[0x0]['num']%_0x234b80:0x0;_0x2fe947[_0xea45('0x1b')](function(_0x1b2fa6){if(_0x1b2fa6>0x0){_0x5d253c+=_0x234b80;}_0x2e6650[_0xea45('0x1c')](dbH[_0xea45('0x13')][_0xea45('0x14')](util[_0xea45('0xd')](_0xea45('0x1d'),QUERY,_0x234b80,_0x5d253c),{'type':dbH[_0xea45('0x13')][_0xea45('0x1e')]['SELECT']}));});if(_0x30299c>0x0){_0x5d253c+=_0x234b80;_0x2e6650['push'](dbH[_0xea45('0x13')][_0xea45('0x14')](util[_0xea45('0xd')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x30299c,_0x5d253c),{'type':dbH[_0xea45('0x13')][_0xea45('0x1e')][_0xea45('0x15')]}));}}}else{_0x2e6650['push'](dbH[_0xea45('0x13')][_0xea45('0x14')](QUERY,{'type':dbH['sequelize'][_0xea45('0x1e')]['SELECT']}));}var _0x151d13=path[_0xea45('0x1f')](PATH);var _0x413013=path[_0xea45('0x20')](PATH,_0xea45('0x21'));var _0x132e76=_0x255128[_0xea45('0x17')]&&_0x2e6650[_0xea45('0x18')]>0x1;var _0x2ba72e=[];if(!fs[_0xea45('0x22')](path[_0xea45('0x23')](_0x151d13,_0x413013))&&_0x132e76){fs[_0xea45('0x24')](path[_0xea45('0x23')](_0x151d13,_0x413013));}return BPromise['each'](_0x2e6650,function(_0x5cfcb4){_0x2ba72e[_0xea45('0x1c')](_0x5cfcb4);})[_0xea45('0x12')](function(){for(var _0x3a1eb5=0x0;_0x3a1eb5<_0x2ba72e['length'];_0x3a1eb5+=0x1){var _0x4cfe45;var _0x9bea74=_0x2ba72e[_0x3a1eb5];if(_0x132e76){_0x4cfe45=path[_0xea45('0x23')](_0x151d13,_0x413013,util[_0xea45('0xd')](_0xea45('0x25'),_0x413013,_0x3a1eb5,'csv'));}else{_0x4cfe45=path[_0xea45('0x23')](_0x151d13,util[_0xea45('0xd')](_0xea45('0x26'),_0x413013,_0xea45('0x27')));}fs['writeFileSync'](_0x4cfe45,csv(_0x9bea74));}})[_0xea45('0x12')](function(){if(_0x132e76){return new Promise(function(_0x4938c2){zipdir(path[_0xea45('0x23')](_0x151d13,_0x413013),{'saveTo':path[_0xea45('0x23')](_0x151d13,util[_0xea45('0xd')]('%s.%s',_0x413013,'zip'))},function(_0x53615b,_0x2eb004){rimraf(path[_0xea45('0x23')](_0x151d13,_0x413013),function(){});_0x4938c2('zip\x20finished');});});}})[_0xea45('0x12')](function(){logger[_0xea45('0xc')](util[_0xea45('0xd')]('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,_0xea45('0x28')));return analyticExtractedReport(_0xea45('0x29'),_0x132e76?util[_0xea45('0xd')]('%s.%s',_0x413013,_0x132e76?_0xea45('0x2a'):'csv'):null);});})[_0xea45('0x2b')](function(_0x19d792){logger[_0xea45('0xc')](util[_0xea45('0xd')](_0xea45('0x2c'),EXTRACTED_REPORT_ID,'CSV'),util[_0xea45('0x2d')](_0x19d792,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xea45('0x2e'));})[_0xea45('0x2f')](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 fe47f4b..2ee3eda 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 _0x02e8=['\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s','pipe','createWriteStream','finish','end','createPdfFromHTML','util','path','moment','pdfmake/src/printer','zip-dir','rimraf','bluebird','../../mysqldb','dbH','analytics','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','AnalyticExtractedReport','update','map','tableHeader','toString','value','length','auto','body','push','concat','chunk','keys','format','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','header','pageBreak','before','margin','landscape','\x20/\x20','footer','black','right','num','Empty','find','split','splitSizePdf','then','isInteger','forEach','sequelize','query','%s\x20limit\x20%d\x20OFFSET\x20%d','SELECT','QueryTypes','dirname','basename','.pdf','existsSync','join','each','flatten','createPdfKitDocument','%s%d.%s','pdf','%s.%s','all','zip','zip\x20finished','info','PDF','Completed','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','findOne','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','finally','exit','/fonts/arial-regular.ttf','%s\x20#%d','channel','interactionId','Arial','center','Interaction\x20Transcript'];(function(_0x4fc9e6,_0xc51915){var _0x551d28=function(_0x1a603b){while(--_0x1a603b){_0x4fc9e6['push'](_0x4fc9e6['shift']());}};_0x551d28(++_0xc51915);}(_0x02e8,0x166));var _0x802e=function(_0x2a42c4,_0xa9a3a){_0x2a42c4=_0x2a42c4-0x0;var _0x554802=_0x02e8[_0x2a42c4];return _0x554802;};'use strict';var _=require('lodash');var fs=require('fs');var util=require(_0x802e('0x0'));var path=require(_0x802e('0x1'));var moment=require(_0x802e('0x2'));var htmlToPdfmake=require('html-to-pdfmake');var PdfPrinter=require(_0x802e('0x3'));var zipdir=require(_0x802e('0x4'));var rimraf=require(_0x802e('0x5'));var JSDOM=require('jsdom')['JSDOM'];var window=new JSDOM('')['window'];var BPromise=require(_0x802e('0x6'));var db=require(_0x802e('0x7'))['db'];var dbH=require('../../mysqldb')[_0x802e('0x8')];var logger=require('../../config/logger')(_0x802e('0x9'));var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process[_0x802e('0xa')][0x3];var PATH=process[_0x802e('0xa')][0x4];var NAME=process[_0x802e('0xa')][0x5];var FORMAT=_0x802e('0xb');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x3587f1,_0x19f8ce){var _0x1c8e60={'status':_0x3587f1};var _0x586cda={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x19f8ce){_0x1c8e60['savename']=_0x19f8ce;}return db[_0x802e('0xc')][_0x802e('0xd')](_0x1c8e60,_0x586cda);}function getHeaders(_0x5f09bd){return _[_0x802e('0xe')](_0x5f09bd,function(_0x470545){return{'text':_0x470545,'style':_0x802e('0xf')};});}function getRows(_0x33c4ee,_0x5cf97b){return _[_0x802e('0xe')](_0x5cf97b,function(_0x2786a3){return _(_0x2786a3)['pick'](_0x33c4ee)[_0x802e('0xe')](function(_0x324829){return _0x324829?_[_0x802e('0x10')](_0x324829):'';})[_0x802e('0x11')]();});}function createTable(_0x46b622,_0x33745d){var _0x55a61c={'widths':_['fill'](Array(_0x46b622[_0x802e('0x12')]),0x91),'heights':function(_0x4df078){return _0x4df078===0x0?_0x802e('0x13'):0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x11ab52=getHeaders(_0x46b622);_0x55a61c[_0x802e('0x14')][_0x802e('0x15')](_0x11ab52);var _0x251354=getRows(_0x46b622,_0x33745d);_0x55a61c['body']=_0x55a61c[_0x802e('0x14')][_0x802e('0x16')](_0x251354);return _0x55a61c;}function createTables(_0x19b5b7){var _0x1740fa=[];var _0x359796=_[_0x802e('0x17')](Object[_0x802e('0x18')](_0x19b5b7[0x0]),0x5);_0x359796['forEach'](function(_0x3a0e83){_0x1740fa['push'](createTable(_0x3a0e83,_0x19b5b7));});return _0x1740fa;}function getPDFDocDefinition(_0xbcd1cf){var _0x5f47f9=util[_0x802e('0x19')](_0x802e('0x1a'),NAME,EXTRACTED_REPORT['name'],moment(EXTRACTED_REPORT['startDate'])['format'](FORMAT),moment(EXTRACTED_REPORT['endDate'])[_0x802e('0x19')](FORMAT));var _0x23e8a4=[];for(var _0x10cb2a=0x0;_0x10cb2a<_0xbcd1cf['length'];_0x10cb2a++){var _0x154549=[];if(_0x10cb2a===0x0){_0x154549[_0x802e('0x15')]({'text':_0x5f47f9,'style':_0x802e('0x1b')});}var _0x103537={'table':_0xbcd1cf[_0x10cb2a]};if(_0x10cb2a>0x0){_0x103537[_0x802e('0x1c')]=_0x802e('0x1d');_0x103537[_0x802e('0x1e')]=[0x0,0x46,0x0,0x0];}_0x154549[_0x802e('0x15')](_0x103537);_0x23e8a4[_0x802e('0x15')](_0x154549);}return{'pageSize':'A4','pageOrientation':_0x802e('0x1f'),'content':_0x23e8a4,'footer':function(_0x31b186,_0x37b2d7){return{'text':_0x31b186['toString']()+_0x802e('0x20')+_0x37b2d7,'style':_0x802e('0x21')};},'defaultStyle':{'font':'Arial'},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0x802e('0x22')},'footer':{'alignment':_0x802e('0x23'),'margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x479492){var _0x1de971=0x1388;var _0x3c2ef1;if(!_0x479492[0x0][_0x802e('0x24')]){return analyticExtractedReport(_0x802e('0x25'));}return db['Setting'][_0x802e('0x26')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x802e('0x27'),_0x802e('0x28')]})['then'](function(_0x5d0585){if(_0x5d0585){_0x3c2ef1=_0x5d0585;_0x1de971=_0x3c2ef1[_0x802e('0x28')]||0x3e8;}})[_0x802e('0x29')](function(){var _0x5dffb0=[];var _0x3fc89e=0x0;if(_0x3c2ef1[_0x802e('0x27')]){if(_0x479492&&_0x479492['length']){var _0x57ca52=_['range'](_0x479492[0x0][_0x802e('0x24')]/_0x1de971);var _0x4dface=Number[_0x802e('0x2a')](_0x479492[0x0][_0x802e('0x24')]/_0x1de971)?_0x479492[0x0][_0x802e('0x24')]%_0x1de971:0x0;_0x57ca52[_0x802e('0x2b')](function(_0x555a12){if(_0x555a12>0x0){_0x3fc89e+=_0x1de971;}_0x5dffb0[_0x802e('0x15')](dbH[_0x802e('0x2c')][_0x802e('0x2d')](util[_0x802e('0x19')](_0x802e('0x2e'),QUERY,_0x1de971,_0x3fc89e),{'type':dbH[_0x802e('0x2c')]['QueryTypes'][_0x802e('0x2f')]}));});if(_0x4dface>0x0){_0x3fc89e+=_0x1de971;_0x5dffb0[_0x802e('0x15')](dbH[_0x802e('0x2c')][_0x802e('0x2d')](util[_0x802e('0x19')](_0x802e('0x2e'),QUERY,_0x4dface,_0x3fc89e),{'type':dbH['sequelize'][_0x802e('0x30')]['SELECT']}));}}}else{_0x5dffb0[_0x802e('0x15')](dbH['sequelize'][_0x802e('0x2d')](QUERY,{'type':dbH[_0x802e('0x2c')][_0x802e('0x30')][_0x802e('0x2f')]}));}var _0x4c41e2=path[_0x802e('0x31')](PATH);var _0x345534=path[_0x802e('0x32')](PATH,_0x802e('0x33'));var _0x17d56a=_0x3c2ef1[_0x802e('0x27')]&&_0x5dffb0[_0x802e('0x12')]>0x1;var _0x389560=[];if(!fs[_0x802e('0x34')](path[_0x802e('0x35')](_0x4c41e2,_0x345534))&&_0x17d56a){fs['mkdirSync'](path[_0x802e('0x35')](_0x4c41e2,_0x345534));}return BPromise[_0x802e('0x36')](_0x5dffb0,function(_0x4fc141){_0x389560[_0x802e('0x15')](_0x4fc141);})[_0x802e('0x29')](function(){var _0x3a7403=[];for(var _0x437a69=0x0;_0x437a69<_0x389560[_0x802e('0x12')];_0x437a69+=0x1){var _0x13a9c6=_0x389560[_0x437a69];var _0x449864=createTables(_[_0x802e('0x37')](_0x13a9c6));var _0x81cdf4;var _0x2d909b=getPDFDocDefinition(_0x449864);var _0x55a433=getPDFPrinter();var _0x24cffe=_0x55a433[_0x802e('0x38')](_0x2d909b);if(_0x17d56a){_0x81cdf4=path[_0x802e('0x35')](_0x4c41e2,_0x345534,util[_0x802e('0x19')](_0x802e('0x39'),_0x345534,_0x437a69,_0x802e('0x3a')));}else{_0x81cdf4=path[_0x802e('0x35')](_0x4c41e2,util[_0x802e('0x19')](_0x802e('0x3b'),_0x345534,_0x802e('0x3a')));}_0x3a7403[_0x802e('0x15')](writePDFDocument(_0x24cffe,_0x81cdf4));}return Promise[_0x802e('0x3c')](_0x3a7403);})[_0x802e('0x29')](function(){if(_0x17d56a){return new Promise(function(_0x27438f){zipdir(path[_0x802e('0x35')](_0x4c41e2,_0x345534),{'saveTo':path[_0x802e('0x35')](_0x4c41e2,util[_0x802e('0x19')](_0x802e('0x3b'),_0x345534,_0x802e('0x3d')))},function(){rimraf(path['join'](_0x4c41e2,_0x345534),function(){});_0x27438f(_0x802e('0x3e'));});});}})[_0x802e('0x29')](function(){if(!_0x17d56a)return;rimraf(path['join'](_0x4c41e2,_0x345534),function(){});})[_0x802e('0x29')](function(){logger[_0x802e('0x3f')](util[_0x802e('0x19')]('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,_0x802e('0x40')));return analyticExtractedReport(_0x802e('0x41'),_0x17d56a?util[_0x802e('0x19')]('%s.%s',_0x345534,_0x17d56a?_0x802e('0x3d'):_0x802e('0x3a')):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0x802e('0x3f')](util[_0x802e('0x19')](_0x802e('0x42'),EXTRACTED_REPORT_ID,_0x802e('0x40')));return db[_0x802e('0xc')][_0x802e('0x43')]({'where':{'id':EXTRACTED_REPORT_ID}})['then'](function(_0x4435fc){EXTRACTED_REPORT=_0x4435fc;return dbH[_0x802e('0x2c')][_0x802e('0x2d')](util[_0x802e('0x19')](_0x802e('0x44'),QUERY),{'type':dbH[_0x802e('0x2c')][_0x802e('0x30')][_0x802e('0x2f')]});})[_0x802e('0x29')](extractReport)[_0x802e('0x45')](function(_0xbb2d46){logger[_0x802e('0x3f')](util[_0x802e('0x19')](_0x802e('0x46'),EXTRACTED_REPORT_ID,_0x802e('0x40')),util[_0x802e('0x47')](_0xbb2d46,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x802e('0x48'));})[_0x802e('0x49')](function(){process[_0x802e('0x4a')](EXIT_CODE);});}main();function getPDFPrinter(){var _0x12e443=new PdfPrinter({'Arial':{'normal':__dirname+_0x802e('0x4b'),'bold':__dirname+'/fonts/arial-bold.ttf','italics':__dirname+'/fonts/arial-italic.ttf','bolditalics':__dirname+'/fonts/arial-bold-italic.ttf'}});return _0x12e443;}function getPDFDocDefinitionFromHTML(_0x14edd2,_0x552e2f){var _0x5976c3=util[_0x802e('0x19')](_0x802e('0x4c'),_0x552e2f[_0x802e('0x4d')],_0x552e2f[_0x802e('0x4e')]);var _0x451fff=moment()[_0x802e('0x19')]('YYYY-MM-DD')[_0x802e('0x10')]();var _0x3fb8e8=htmlToPdfmake(_0x14edd2,{'window':window,'tableAutoSize':!![]});return{'content':[_0x3fb8e8],'defaultStyle':{'font':_0x802e('0x4f')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0x802e('0x50'),'margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':_0x802e('0x50'),'margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':'center'}},'header':function(){return[{'text':_0x802e('0x51'),'style':'header'}];},'footer':function(_0x5cc800,_0x4f28f3){return[{'text':util[_0x802e('0x19')](_0x802e('0x52'),_0x5976c3,_0x5cc800,_0x4f28f3,_0x451fff),'style':'footer'}];}};}function writePDFDocument(_0x3f41cf,_0x14fc93){return new Promise(function(_0x248295,_0x3bf90){var _0x3b77d9=_0x3f41cf[_0x802e('0x53')](fs[_0x802e('0x54')](_0x14fc93));_0x3b77d9['on'](_0x802e('0x55'),function(){_0x248295(_0x802e('0x55'));});_0x3b77d9['on']('error',function(_0x47d1de){_0x3bf90(_0x47d1de);});_0x3f41cf[_0x802e('0x56')]();});}exports[_0x802e('0x57')]=function(_0x21c85a,_0xbd82d1){var _0x4f65b9=getPDFPrinter();var _0x5754dd=getPDFDocDefinitionFromHTML(_0x21c85a,_0xbd82d1);var _0xb1fadb=_0x4f65b9['createPdfKitDocument'](_0x5754dd);return writePDFDocument(_0xb1fadb,_0xbd82d1[_0x802e('0x1')])[_0x802e('0x45')](function(_0x4d7a1e){throw _0x4d7a1e;});}; \ No newline at end of file +var _0x6702=['each','flatten','createPdfKitDocument','%s%d.%s','pdf','all','%s.%s','zip\x20finished','info','PDF','Completed','zip','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','findOne','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','/fonts/arial-regular.ttf','/fonts/arial-bold.ttf','/fonts/arial-italic.ttf','%s\x20#%d','channel','interactionId','YYYY-MM-DD','center','\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s','pipe','createWriteStream','finish','end','createPdfFromHTML','lodash','path','html-to-pdfmake','pdfmake/src/printer','zip-dir','JSDOM','window','bluebird','../../mysqldb','dbH','../../config/logger','analytics','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','AnalyticExtractedReport','update','map','tableHeader','pick','toString','value','length','auto','body','push','concat','forEach','format','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','name','startDate','endDate','pageBreak','before','landscape','\x20/\x20','footer','Arial','num','Empty','Setting','find','splitSizePdf','then','split','range','query','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','SELECT','sequelize','.pdf','existsSync','join','mkdirSync'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x6702,0x12c));var _0x2670=function(_0x344a3f,_0x579a22){_0x344a3f=_0x344a3f-0x0;var _0x264712=_0x6702[_0x344a3f];return _0x264712;};'use strict';var _=require(_0x2670('0x0'));var fs=require('fs');var util=require('util');var path=require(_0x2670('0x1'));var moment=require('moment');var htmlToPdfmake=require(_0x2670('0x2'));var PdfPrinter=require(_0x2670('0x3'));var zipdir=require(_0x2670('0x4'));var rimraf=require('rimraf');var JSDOM=require('jsdom')[_0x2670('0x5')];var window=new JSDOM('')[_0x2670('0x6')];var BPromise=require(_0x2670('0x7'));var db=require(_0x2670('0x8'))['db'];var dbH=require(_0x2670('0x8'))[_0x2670('0x9')];var logger=require(_0x2670('0xa'))(_0x2670('0xb'));var EXTRACTED_REPORT_ID=Number(process[_0x2670('0xc')][0x2]);var QUERY=process[_0x2670('0xc')][0x3];var PATH=process[_0x2670('0xc')][0x4];var NAME=process['argv'][0x5];var FORMAT=_0x2670('0xd');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x55a301,_0x17d83e){var _0x501bed={'status':_0x55a301};var _0x5c6ac1={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x17d83e){_0x501bed[_0x2670('0xe')]=_0x17d83e;}return db[_0x2670('0xf')][_0x2670('0x10')](_0x501bed,_0x5c6ac1);}function getHeaders(_0x32d28c){return _[_0x2670('0x11')](_0x32d28c,function(_0x3c803e){return{'text':_0x3c803e,'style':_0x2670('0x12')};});}function getRows(_0x3afac6,_0x4e3773){return _[_0x2670('0x11')](_0x4e3773,function(_0x10baf1){return _(_0x10baf1)[_0x2670('0x13')](_0x3afac6)[_0x2670('0x11')](function(_0x21812d){return _0x21812d?_[_0x2670('0x14')](_0x21812d):'';})[_0x2670('0x15')]();});}function createTable(_0x133d22,_0x3cf2a2){var _0x519de4={'widths':_['fill'](Array(_0x133d22[_0x2670('0x16')]),0x91),'heights':function(_0x2ee8ab){return _0x2ee8ab===0x0?_0x2670('0x17'):0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x45cf97=getHeaders(_0x133d22);_0x519de4[_0x2670('0x18')][_0x2670('0x19')](_0x45cf97);var _0x1be719=getRows(_0x133d22,_0x3cf2a2);_0x519de4[_0x2670('0x18')]=_0x519de4[_0x2670('0x18')][_0x2670('0x1a')](_0x1be719);return _0x519de4;}function createTables(_0x2031dd){var _0xe8afdc=[];var _0xc38feb=_['chunk'](Object['keys'](_0x2031dd[0x0]),0x5);_0xc38feb[_0x2670('0x1b')](function(_0x1a3b83){_0xe8afdc[_0x2670('0x19')](createTable(_0x1a3b83,_0x2031dd));});return _0xe8afdc;}function getPDFDocDefinition(_0x3cc73e){var _0x1c54f2=util[_0x2670('0x1c')](_0x2670('0x1d'),NAME,EXTRACTED_REPORT[_0x2670('0x1e')],moment(EXTRACTED_REPORT[_0x2670('0x1f')])[_0x2670('0x1c')](FORMAT),moment(EXTRACTED_REPORT[_0x2670('0x20')])[_0x2670('0x1c')](FORMAT));var _0x59f710=[];for(var _0x58071c=0x0;_0x58071c<_0x3cc73e['length'];_0x58071c++){var _0x286e68=[];if(_0x58071c===0x0){_0x286e68[_0x2670('0x19')]({'text':_0x1c54f2,'style':'header'});}var _0x1fb23c={'table':_0x3cc73e[_0x58071c]};if(_0x58071c>0x0){_0x1fb23c[_0x2670('0x21')]=_0x2670('0x22');_0x1fb23c['margin']=[0x0,0x46,0x0,0x0];}_0x286e68[_0x2670('0x19')](_0x1fb23c);_0x59f710[_0x2670('0x19')](_0x286e68);}return{'pageSize':'A4','pageOrientation':_0x2670('0x23'),'content':_0x59f710,'footer':function(_0x1f1795,_0x18d092){return{'text':_0x1f1795[_0x2670('0x14')]()+_0x2670('0x24')+_0x18d092,'style':_0x2670('0x25')};},'defaultStyle':{'font':_0x2670('0x26')},'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(_0x79bbde){var _0x7afb9b=0x1388;var _0x2cc069;if(!_0x79bbde[0x0][_0x2670('0x27')]){return analyticExtractedReport(_0x2670('0x28'));}return db[_0x2670('0x29')][_0x2670('0x2a')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0x2670('0x2b')]})[_0x2670('0x2c')](function(_0x12b1bc){if(_0x12b1bc){_0x2cc069=_0x12b1bc;_0x7afb9b=_0x2cc069[_0x2670('0x2b')]||0x3e8;}})[_0x2670('0x2c')](function(){var _0x595e13=[];var _0x59fad5=0x0;if(_0x2cc069[_0x2670('0x2d')]){if(_0x79bbde&&_0x79bbde[_0x2670('0x16')]){var _0x57ca19=_[_0x2670('0x2e')](_0x79bbde[0x0][_0x2670('0x27')]/_0x7afb9b);var _0x4123d1=Number['isInteger'](_0x79bbde[0x0]['num']/_0x7afb9b)?_0x79bbde[0x0][_0x2670('0x27')]%_0x7afb9b:0x0;_0x57ca19[_0x2670('0x1b')](function(_0x3268b5){if(_0x3268b5>0x0){_0x59fad5+=_0x7afb9b;}_0x595e13['push'](dbH['sequelize'][_0x2670('0x2f')](util[_0x2670('0x1c')](_0x2670('0x30'),QUERY,_0x7afb9b,_0x59fad5),{'type':dbH['sequelize'][_0x2670('0x31')][_0x2670('0x32')]}));});if(_0x4123d1>0x0){_0x59fad5+=_0x7afb9b;_0x595e13[_0x2670('0x19')](dbH[_0x2670('0x33')][_0x2670('0x2f')](util[_0x2670('0x1c')](_0x2670('0x30'),QUERY,_0x4123d1,_0x59fad5),{'type':dbH[_0x2670('0x33')][_0x2670('0x31')][_0x2670('0x32')]}));}}}else{_0x595e13[_0x2670('0x19')](dbH[_0x2670('0x33')][_0x2670('0x2f')](QUERY,{'type':dbH[_0x2670('0x33')][_0x2670('0x31')][_0x2670('0x32')]}));}var _0x31797d=path['dirname'](PATH);var _0x3b9639=path['basename'](PATH,_0x2670('0x34'));var _0x334794=_0x2cc069[_0x2670('0x2d')]&&_0x595e13[_0x2670('0x16')]>0x1;var _0x6ba6a6=[];if(!fs[_0x2670('0x35')](path[_0x2670('0x36')](_0x31797d,_0x3b9639))&&_0x334794){fs[_0x2670('0x37')](path[_0x2670('0x36')](_0x31797d,_0x3b9639));}return BPromise[_0x2670('0x38')](_0x595e13,function(_0x2a3af5){_0x6ba6a6['push'](_0x2a3af5);})['then'](function(){var _0x4825d3=[];for(var _0x50962e=0x0;_0x50962e<_0x6ba6a6[_0x2670('0x16')];_0x50962e+=0x1){var _0x564949=_0x6ba6a6[_0x50962e];var _0x2af92d=createTables(_[_0x2670('0x39')](_0x564949));var _0x4f46de;var _0x5a9802=getPDFDocDefinition(_0x2af92d);var _0x3c638c=getPDFPrinter();var _0x1a4244=_0x3c638c[_0x2670('0x3a')](_0x5a9802);if(_0x334794){_0x4f46de=path[_0x2670('0x36')](_0x31797d,_0x3b9639,util[_0x2670('0x1c')](_0x2670('0x3b'),_0x3b9639,_0x50962e,_0x2670('0x3c')));}else{_0x4f46de=path[_0x2670('0x36')](_0x31797d,util[_0x2670('0x1c')]('%s.%s',_0x3b9639,'pdf'));}_0x4825d3[_0x2670('0x19')](writePDFDocument(_0x1a4244,_0x4f46de));}return Promise[_0x2670('0x3d')](_0x4825d3);})[_0x2670('0x2c')](function(){if(_0x334794){return new Promise(function(_0x3c94fe){zipdir(path[_0x2670('0x36')](_0x31797d,_0x3b9639),{'saveTo':path[_0x2670('0x36')](_0x31797d,util[_0x2670('0x1c')](_0x2670('0x3e'),_0x3b9639,'zip'))},function(){rimraf(path['join'](_0x31797d,_0x3b9639),function(){});_0x3c94fe(_0x2670('0x3f'));});});}})[_0x2670('0x2c')](function(){if(!_0x334794)return;rimraf(path[_0x2670('0x36')](_0x31797d,_0x3b9639),function(){});})[_0x2670('0x2c')](function(){logger[_0x2670('0x40')](util[_0x2670('0x1c')]('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,_0x2670('0x41')));return analyticExtractedReport(_0x2670('0x42'),_0x334794?util[_0x2670('0x1c')]('%s.%s',_0x3b9639,_0x334794?_0x2670('0x43'):_0x2670('0x3c')):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0x2670('0x40')](util[_0x2670('0x1c')](_0x2670('0x44'),EXTRACTED_REPORT_ID,_0x2670('0x41')));return db[_0x2670('0xf')][_0x2670('0x45')]({'where':{'id':EXTRACTED_REPORT_ID}})[_0x2670('0x2c')](function(_0x5d81f0){EXTRACTED_REPORT=_0x5d81f0;return dbH[_0x2670('0x33')]['query'](util[_0x2670('0x1c')](_0x2670('0x46'),QUERY),{'type':dbH['sequelize'][_0x2670('0x31')]['SELECT']});})[_0x2670('0x2c')](extractReport)[_0x2670('0x47')](function(_0x17a6b2){logger['info'](util[_0x2670('0x1c')](_0x2670('0x48'),EXTRACTED_REPORT_ID,_0x2670('0x41')),util[_0x2670('0x49')](_0x17a6b2,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x2670('0x4a'));})['finally'](function(){process['exit'](EXIT_CODE);});}main();function getPDFPrinter(){var _0xdba0b1=new PdfPrinter({'Arial':{'normal':__dirname+_0x2670('0x4b'),'bold':__dirname+_0x2670('0x4c'),'italics':__dirname+_0x2670('0x4d'),'bolditalics':__dirname+'/fonts/arial-bold-italic.ttf'}});return _0xdba0b1;}function getPDFDocDefinitionFromHTML(_0x3d17bd,_0x553ccd){var _0x11e85b=util['format'](_0x2670('0x4e'),_0x553ccd[_0x2670('0x4f')],_0x553ccd[_0x2670('0x50')]);var _0x2647c9=moment()[_0x2670('0x1c')](_0x2670('0x51'))[_0x2670('0x14')]();var _0x2f88ba=htmlToPdfmake(_0x3d17bd,{'window':window,'tableAutoSize':!![]});return{'content':[_0x2f88ba],'defaultStyle':{'font':_0x2670('0x26')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0x2670('0x52'),'margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':_0x2670('0x52'),'margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':_0x2670('0x52')}},'header':function(){return[{'text':'Interaction\x20Transcript','style':'header'}];},'footer':function(_0x1cd21e,_0xd62fb7){return[{'text':util[_0x2670('0x1c')](_0x2670('0x53'),_0x11e85b,_0x1cd21e,_0xd62fb7,_0x2647c9),'style':_0x2670('0x25')}];}};}function writePDFDocument(_0xf30956,_0x16e322){return new Promise(function(_0x37bbcc,_0x2ffbcd){var _0x1dc582=_0xf30956[_0x2670('0x54')](fs[_0x2670('0x55')](_0x16e322));_0x1dc582['on'](_0x2670('0x56'),function(){_0x37bbcc(_0x2670('0x56'));});_0x1dc582['on']('error',function(_0x2e9173){_0x2ffbcd(_0x2e9173);});_0xf30956[_0x2670('0x57')]();});}exports[_0x2670('0x58')]=function(_0x7f795a,_0x1bcb8d){var _0x15dc6e=getPDFPrinter();var _0x4c941e=getPDFDocDefinitionFromHTML(_0x7f795a,_0x1bcb8d);var _0xf70f49=_0x15dc6e[_0x2670('0x3a')](_0x4c941e);return writePDFDocument(_0xf70f49,_0x1bcb8d[_0x2670('0x1')])[_0x2670('0x47')](function(_0x95b2c0){throw _0x95b2c0;});}; \ No newline at end of file diff --git a/server/components/export/xlsx.js b/server/components/export/xlsx.js index aa1aac5..a7de2f9 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 _0x0626=['zip-dir','rimraf','dbH','analytics','argv','savename','AnalyticExtractedReport','update','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','XLSX','Setting','find','split','splitSizeXlsx','then','sequelize','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','num','Empty','range','isInteger','forEach','query','%s\x20limit\x20%d\x20OFFSET\x20%d','SELECT','push','dirname','basename','.xlsx','length','existsSync','join','xlsx','%s.%s','writeFileSync','binary','zip','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','catch','finally','exit','util','path','lodash','json2xls','bluebird'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x0626,0x1ef));var _0x6062=function(_0x275e49,_0x12a7dd){_0x275e49=_0x275e49-0x0;var _0x1d6ec0=_0x0626[_0x275e49];return _0x1d6ec0;};'use strict';var util=require(_0x6062('0x0'));var path=require(_0x6062('0x1'));var _=require(_0x6062('0x2'));var fs=require('fs');var json2xls=require(_0x6062('0x3'));var BPromise=require(_0x6062('0x4'));var zipdir=require(_0x6062('0x5'));var rimraf=require(_0x6062('0x6'));var db=require('../../mysqldb')['db'];var dbH=require('../../mysqldb')[_0x6062('0x7')];var logger=require('../../config/logger')(_0x6062('0x8'));var EXTRACTED_REPORT_ID=Number(process[_0x6062('0x9')][0x2]);var QUERY=process[_0x6062('0x9')][0x3];var PATH=process[_0x6062('0x9')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x4cf4eb,_0x153042){var _0x5bd954={'status':_0x4cf4eb};var _0x39c380={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x153042){_0x5bd954[_0x6062('0xa')]=_0x153042;}return db[_0x6062('0xb')][_0x6062('0xc')](_0x5bd954,_0x39c380);}function main(){var _0x4ea437=0x1388;var _0x1c7c66;logger[_0x6062('0xd')](util[_0x6062('0xe')](_0x6062('0xf'),EXTRACTED_REPORT_ID,_0x6062('0x10')));return db[_0x6062('0x11')][_0x6062('0x12')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x6062('0x13'),_0x6062('0x14')]})[_0x6062('0x15')](function(_0x40716e){if(_0x40716e){_0x1c7c66=_0x40716e;_0x4ea437=_0x1c7c66[_0x6062('0x14')]||0x1388;}})['then'](function(){return dbH[_0x6062('0x16')]['query'](util[_0x6062('0xe')](_0x6062('0x17'),QUERY),{'type':dbH[_0x6062('0x16')][_0x6062('0x18')]['SELECT']});})[_0x6062('0x15')](function(_0x302f55){if(!_0x302f55[0x0][_0x6062('0x19')]){return analyticExtractedReport(_0x6062('0x1a'));}var _0x4985ee=[];var _0x2ffca7=0x0;if(_0x1c7c66['split']){if(_0x302f55&&_0x302f55['length']){var _0x3ac422=_[_0x6062('0x1b')](_0x302f55[0x0]['num']/_0x4ea437);var _0x5c604f=Number[_0x6062('0x1c')](_0x302f55[0x0][_0x6062('0x19')]/_0x4ea437)?_0x302f55[0x0]['num']%_0x4ea437:0x0;_0x3ac422[_0x6062('0x1d')](function(_0x5775fd){if(_0x5775fd>0x0){_0x2ffca7+=_0x4ea437;}_0x4985ee['push'](dbH[_0x6062('0x16')][_0x6062('0x1e')](util['format'](_0x6062('0x1f'),QUERY,_0x4ea437,_0x2ffca7),{'type':dbH[_0x6062('0x16')]['QueryTypes'][_0x6062('0x20')]}));});if(_0x5c604f>0x0){_0x2ffca7+=_0x4ea437;_0x4985ee['push'](dbH['sequelize']['query'](util[_0x6062('0xe')](_0x6062('0x1f'),QUERY,_0x5c604f,_0x2ffca7),{'type':dbH[_0x6062('0x16')][_0x6062('0x18')][_0x6062('0x20')]}));}}}else{_0x4985ee[_0x6062('0x21')](dbH[_0x6062('0x16')]['query'](QUERY,{'type':dbH[_0x6062('0x16')][_0x6062('0x18')][_0x6062('0x20')]}));}var _0x46987f=path[_0x6062('0x22')](PATH);var _0x9c15e3=path[_0x6062('0x23')](PATH,_0x6062('0x24'));var _0x3363b4=_0x1c7c66[_0x6062('0x13')]&&_0x4985ee[_0x6062('0x25')]>0x1;var _0x3b1a24=[];if(!fs[_0x6062('0x26')](path['join'](_0x46987f,_0x9c15e3))&&_0x3363b4){fs['mkdirSync'](path[_0x6062('0x27')](_0x46987f,_0x9c15e3));}return BPromise['each'](_0x4985ee,function(_0x3c3a79){_0x3b1a24[_0x6062('0x21')](_0x3c3a79);})[_0x6062('0x15')](function(){for(var _0x494981=0x0;_0x494981<_0x3b1a24[_0x6062('0x25')];_0x494981+=0x1){var _0x53c3a3;var _0x5d27ec=_0x3b1a24[_0x494981];if(_0x3363b4){_0x53c3a3=path['join'](_0x46987f,_0x9c15e3,util[_0x6062('0xe')]('%s%d.%s',_0x9c15e3,_0x494981,_0x6062('0x28')));}else{_0x53c3a3=path[_0x6062('0x27')](_0x46987f,util[_0x6062('0xe')](_0x6062('0x29'),_0x9c15e3,_0x6062('0x28')));}fs[_0x6062('0x2a')](_0x53c3a3,json2xls(_0x5d27ec),_0x6062('0x2b'));}})[_0x6062('0x15')](function(){if(_0x3363b4){return new Promise(function(_0x707877){zipdir(path[_0x6062('0x27')](_0x46987f,_0x9c15e3),{'saveTo':path[_0x6062('0x27')](_0x46987f,util['format']('%s.%s',_0x9c15e3,_0x6062('0x2c')))},function(_0x460557,_0x5cdfea){rimraf(path[_0x6062('0x27')](_0x46987f,_0x9c15e3),function(){});_0x707877('zip\x20finished');});});}})[_0x6062('0x15')](function(){logger['info'](util[_0x6062('0xe')](_0x6062('0x2d'),EXTRACTED_REPORT_ID,'XLSX'));return analyticExtractedReport(_0x6062('0x2e'),_0x3363b4?util[_0x6062('0xe')](_0x6062('0x29'),_0x9c15e3,_0x3363b4?_0x6062('0x2c'):_0x6062('0x28')):null);});})[_0x6062('0x2f')](function(_0x327ad1){logger[_0x6062('0xd')](util[_0x6062('0xe')]('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x6062('0x10')),util['inspect'](_0x327ad1,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport('Failed');})[_0x6062('0x30')](function(){process[_0x6062('0x31')](EXIT_CODE);});}main(); \ No newline at end of file +var _0x1477=['splitSizeXlsx','then','sequelize','query','format','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT','num','Empty','split','length','forEach','push','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','basename','.xlsx','existsSync','join','mkdirSync','each','%s%d.%s','xlsx','%s.%s','writeFileSync','zip','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','XLSX','Completed','catch','inspect','Failed','finally','util','path','lodash','json2xls','bluebird','rimraf','../../mysqldb','dbH','../../config/logger','analytics','argv','savename','AnalyticExtractedReport','info','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','find'];(function(_0x5f3543,_0x568f9a){var _0x5f2726=function(_0x33d625){while(--_0x33d625){_0x5f3543['push'](_0x5f3543['shift']());}};_0x5f2726(++_0x568f9a);}(_0x1477,0x122));var _0x7147=function(_0x4b6ad7,_0x1a5221){_0x4b6ad7=_0x4b6ad7-0x0;var _0x17c033=_0x1477[_0x4b6ad7];return _0x17c033;};'use strict';var util=require(_0x7147('0x0'));var path=require(_0x7147('0x1'));var _=require(_0x7147('0x2'));var fs=require('fs');var json2xls=require(_0x7147('0x3'));var BPromise=require(_0x7147('0x4'));var zipdir=require('zip-dir');var rimraf=require(_0x7147('0x5'));var db=require(_0x7147('0x6'))['db'];var dbH=require('../../mysqldb')[_0x7147('0x7')];var logger=require(_0x7147('0x8'))(_0x7147('0x9'));var EXTRACTED_REPORT_ID=Number(process[_0x7147('0xa')][0x2]);var QUERY=process[_0x7147('0xa')][0x3];var PATH=process[_0x7147('0xa')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x538d62,_0x5207ba){var _0x5a1a99={'status':_0x538d62};var _0x5c0e1a={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x5207ba){_0x5a1a99[_0x7147('0xb')]=_0x5207ba;}return db[_0x7147('0xc')]['update'](_0x5a1a99,_0x5c0e1a);}function main(){var _0x263d6a=0x1388;var _0x110dd9;logger[_0x7147('0xd')](util['format'](_0x7147('0xe'),EXTRACTED_REPORT_ID,'XLSX'));return db['Setting'][_0x7147('0xf')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0x7147('0x10')]})[_0x7147('0x11')](function(_0x50e05e){if(_0x50e05e){_0x110dd9=_0x50e05e;_0x263d6a=_0x110dd9['splitSizeXlsx']||0x1388;}})[_0x7147('0x11')](function(){return dbH[_0x7147('0x12')][_0x7147('0x13')](util[_0x7147('0x14')](_0x7147('0x15'),QUERY),{'type':dbH['sequelize'][_0x7147('0x16')][_0x7147('0x17')]});})[_0x7147('0x11')](function(_0xd3fabf){if(!_0xd3fabf[0x0][_0x7147('0x18')]){return analyticExtractedReport(_0x7147('0x19'));}var _0x32fdc9=[];var _0x4ee0bd=0x0;if(_0x110dd9[_0x7147('0x1a')]){if(_0xd3fabf&&_0xd3fabf[_0x7147('0x1b')]){var _0x1226a9=_['range'](_0xd3fabf[0x0][_0x7147('0x18')]/_0x263d6a);var _0x4ae0d3=Number['isInteger'](_0xd3fabf[0x0][_0x7147('0x18')]/_0x263d6a)?_0xd3fabf[0x0][_0x7147('0x18')]%_0x263d6a:0x0;_0x1226a9[_0x7147('0x1c')](function(_0x1f5044){if(_0x1f5044>0x0){_0x4ee0bd+=_0x263d6a;}_0x32fdc9[_0x7147('0x1d')](dbH[_0x7147('0x12')][_0x7147('0x13')](util['format'](_0x7147('0x1e'),QUERY,_0x263d6a,_0x4ee0bd),{'type':dbH[_0x7147('0x12')]['QueryTypes'][_0x7147('0x17')]}));});if(_0x4ae0d3>0x0){_0x4ee0bd+=_0x263d6a;_0x32fdc9[_0x7147('0x1d')](dbH[_0x7147('0x12')][_0x7147('0x13')](util[_0x7147('0x14')](_0x7147('0x1e'),QUERY,_0x4ae0d3,_0x4ee0bd),{'type':dbH[_0x7147('0x12')]['QueryTypes'][_0x7147('0x17')]}));}}}else{_0x32fdc9[_0x7147('0x1d')](dbH[_0x7147('0x12')][_0x7147('0x13')](QUERY,{'type':dbH[_0x7147('0x12')][_0x7147('0x16')][_0x7147('0x17')]}));}var _0x2b8e0a=path[_0x7147('0x1f')](PATH);var _0x5ecc40=path[_0x7147('0x20')](PATH,_0x7147('0x21'));var _0x36c126=_0x110dd9['split']&&_0x32fdc9[_0x7147('0x1b')]>0x1;var _0x2092ad=[];if(!fs[_0x7147('0x22')](path[_0x7147('0x23')](_0x2b8e0a,_0x5ecc40))&&_0x36c126){fs[_0x7147('0x24')](path[_0x7147('0x23')](_0x2b8e0a,_0x5ecc40));}return BPromise[_0x7147('0x25')](_0x32fdc9,function(_0x4f6ca4){_0x2092ad[_0x7147('0x1d')](_0x4f6ca4);})[_0x7147('0x11')](function(){for(var _0x34cb07=0x0;_0x34cb07<_0x2092ad[_0x7147('0x1b')];_0x34cb07+=0x1){var _0x30c86a;var _0xe5ff17=_0x2092ad[_0x34cb07];if(_0x36c126){_0x30c86a=path[_0x7147('0x23')](_0x2b8e0a,_0x5ecc40,util[_0x7147('0x14')](_0x7147('0x26'),_0x5ecc40,_0x34cb07,_0x7147('0x27')));}else{_0x30c86a=path[_0x7147('0x23')](_0x2b8e0a,util[_0x7147('0x14')](_0x7147('0x28'),_0x5ecc40,_0x7147('0x27')));}fs[_0x7147('0x29')](_0x30c86a,json2xls(_0xe5ff17),'binary');}})['then'](function(){if(_0x36c126){return new Promise(function(_0x4c11bc){zipdir(path['join'](_0x2b8e0a,_0x5ecc40),{'saveTo':path[_0x7147('0x23')](_0x2b8e0a,util[_0x7147('0x14')](_0x7147('0x28'),_0x5ecc40,_0x7147('0x2a')))},function(_0x5eb689,_0x11d37c){rimraf(path[_0x7147('0x23')](_0x2b8e0a,_0x5ecc40),function(){});_0x4c11bc(_0x7147('0x2b'));});});}})[_0x7147('0x11')](function(){logger['info'](util[_0x7147('0x14')](_0x7147('0x2c'),EXTRACTED_REPORT_ID,_0x7147('0x2d')));return analyticExtractedReport(_0x7147('0x2e'),_0x36c126?util['format'](_0x7147('0x28'),_0x5ecc40,_0x36c126?_0x7147('0x2a'):'xlsx'):null);});})[_0x7147('0x2f')](function(_0x498652){logger[_0x7147('0xd')](util[_0x7147('0x14')]('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x7147('0x2d')),util[_0x7147('0x30')](_0x498652,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x7147('0x31'));})[_0x7147('0x32')](function(){process['exit'](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/extensions/rewrite.js b/server/components/extensions/rewrite.js index dc01cc9..e090b06 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 _0x0459=['push','Set','format','CDR(type)=%s','type','VoiceExtensionId','inbound','outbound','CDR(destination)=','cutdigits','${EXTEN:','${EXTEN}','context','CDR(routeid)=','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','outboundrouteid=','recordingFormat','none','_XCALLY_MIXMONITOR_FORMAT=','wav','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','toLowerCase','interval','*,*,*,*','IntervalId','tag','CDR(tag)=','callerID','ExecIf','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)=','length','answer','indexOf','app','appType','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','splice','GotoIfTime',',${EXTEN},','last','concat','Hangup','transaction','destroy','bulkCreate','catch','error','rewrite','lodash','util','models','Interval','findAll','then','intervals','VoiceExtension','uniq','map','exten','CAST(priority\x20AS\x20UNSIGNED)','filter','groupBy','queue','playback','hasOwnProperty','priority','extensions','extension','find'];(function(_0x2671ba,_0x27f44a){var _0x3d781=function(_0x597053){while(--_0x597053){_0x2671ba['push'](_0x2671ba['shift']());}};_0x3d781(++_0x27f44a);}(_0x0459,0x10f));var _0x9045=function(_0x9df060,_0x253d33){_0x9df060=_0x9df060-0x0;var _0x338dfe=_0x0459[_0x9df060];return _0x338dfe;};'use strict';var _=require(_0x9045('0x0'));var util=require(_0x9045('0x1'));function rewrite(_0x4580fa,_0x1b1097){var _0x369ef9=this;return _0x4580fa[_0x9045('0x2')][_0x9045('0x3')][_0x9045('0x4')]({'raw':!![]})[_0x9045('0x5')](function(_0x4e26db){_0x369ef9[_0x9045('0x6')]=_0x4e26db;return _0x4580fa[_0x9045('0x2')][_0x9045('0x7')][_0x9045('0x4')]({'where':{'IntervalId':_0x1b1097['IntervalId']},'raw':!![]});})[_0x9045('0x5')](function(_0x118197){return _0x4580fa['models']['VoiceExtension']['findAll']({'where':{'exten':{'$in':_[_0x9045('0x8')](_[_0x9045('0x9')](_0x118197,_0x9045('0xa')))}},'order':[{'raw':_0x9045('0xb')}],'raw':!![]});})[_0x9045('0x5')](function(_0x29c6a7){var _0x5029ea=_[_0x9045('0xc')](_0x29c6a7,{'priority':'1'});var _0x8a93d5=_['filter'](_0x29c6a7,{'isApp':0x1});var _0x266b52=_[_0x9045('0xd')](_0x8a93d5,_0x9045('0xa'));var _0x2f9c8f=[_0x9045('0xe'),_0x9045('0xf')];var _0x4dca59=[];var _0x28dd85=[];for(var _0x5ae99a in _0x266b52){if(_0x266b52[_0x9045('0x10')](_0x5ae99a)){_0x369ef9[_0x9045('0x11')]=0x2;_0x369ef9[_0x9045('0x12')]=[];_0x369ef9[_0x9045('0x13')]=_[_0x9045('0x14')](_0x5029ea,{'exten':_0x266b52[_0x5ae99a][0x0][_0x9045('0xa')]});_0x369ef9[_0x9045('0x12')][_0x9045('0x15')]({'type':_0x266b52[_0x5ae99a][0x0]['type'],'app':_0x9045('0x16'),'appdata':util[_0x9045('0x17')](_0x9045('0x18'),_0x266b52[_0x5ae99a][0x0][_0x9045('0x19')]),'context':_0x266b52[_0x5ae99a][0x0]['context'],'exten':_0x266b52[_0x5ae99a][0x0][_0x9045('0xa')],'priority':_0x369ef9[_0x9045('0x11')]++,'VoiceExtensionId':_0x266b52[_0x5ae99a][0x0][_0x9045('0x1a')]});if(_0x266b52[_0x5ae99a][0x0][_0x9045('0x19')]===_0x9045('0x1b')){_0x369ef9[_0x9045('0x12')][_0x9045('0x15')]({'type':_0x266b52[_0x5ae99a][0x0][_0x9045('0x19')],'app':_0x9045('0x16'),'appdata':'CDR(routeid)='+_0x266b52[_0x5ae99a][0x0]['VoiceExtensionId'],'context':_0x266b52[_0x5ae99a][0x0]['context'],'exten':_0x266b52[_0x5ae99a][0x0][_0x9045('0xa')],'priority':_0x369ef9[_0x9045('0x11')]++,'VoiceExtensionId':_0x266b52[_0x5ae99a][0x0]['VoiceExtensionId']});}else if(_0x266b52[_0x5ae99a][0x0]['type']===_0x9045('0x1c')){if(_0x369ef9[_0x9045('0x13')]){_0x369ef9[_0x9045('0x12')][_0x9045('0x15')]({'type':_0x266b52[_0x5ae99a][0x0][_0x9045('0x19')],'app':_0x9045('0x16'),'appdata':_0x9045('0x1d')+(_0x369ef9[_0x9045('0x13')][_0x9045('0x1e')]?_0x9045('0x1f')+_0x369ef9[_0x9045('0x13')][_0x9045('0x1e')]+'}':_0x9045('0x20')),'context':_0x266b52[_0x5ae99a][0x0][_0x9045('0x21')],'exten':_0x266b52[_0x5ae99a][0x0][_0x9045('0xa')],'priority':_0x369ef9[_0x9045('0x11')]++,'VoiceExtensionId':_0x266b52[_0x5ae99a][0x0]['VoiceExtensionId']});}_0x369ef9[_0x9045('0x12')][_0x9045('0x15')]({'type':_0x266b52[_0x5ae99a][0x0][_0x9045('0x19')],'app':_0x9045('0x16'),'appdata':_0x9045('0x22')+_0x266b52[_0x5ae99a][0x0]['VoiceExtensionId'],'context':_0x266b52[_0x5ae99a][0x0][_0x9045('0x21')],'exten':_0x266b52[_0x5ae99a][0x0][_0x9045('0xa')],'priority':_0x369ef9['priority']++,'VoiceExtensionId':_0x266b52[_0x5ae99a][0x0][_0x9045('0x1a')]});var _0x229198=_0x369ef9[_0x9045('0x11')]++;_0x369ef9[_0x9045('0x12')][_0x9045('0x15')]({'type':_0x266b52[_0x5ae99a][0x0][_0x9045('0x19')],'app':'ExecIf','appdata':'$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto('+(_0x229198+0x2)+_0x9045('0x23')+(_0x229198+0x1)+')','context':_0x266b52[_0x5ae99a][0x0][_0x9045('0x21')],'exten':_0x266b52[_0x5ae99a][0x0]['exten'],'priority':_0x229198,'VoiceExtensionId':_0x266b52[_0x5ae99a][0x0][_0x9045('0x1a')]});if(_0x369ef9[_0x9045('0x13')]){_0x369ef9[_0x9045('0x12')][_0x9045('0x15')]({'type':_0x266b52[_0x5ae99a][0x0][_0x9045('0x19')],'app':_0x9045('0x16'),'appdata':_0x369ef9[_0x9045('0x13')]['cutdigits']?_0x9045('0x24')+_0x369ef9['extension'][_0x9045('0x1e')]+'}':_0x9045('0x25'),'context':_0x266b52[_0x5ae99a][0x0][_0x9045('0x21')],'exten':_0x266b52[_0x5ae99a][0x0][_0x9045('0xa')],'priority':_0x369ef9[_0x9045('0x11')]++,'VoiceExtensionId':_0x266b52[_0x5ae99a][0x0][_0x9045('0x1a')]});}_0x369ef9[_0x9045('0x12')][_0x9045('0x15')]({'type':_0x266b52[_0x5ae99a][0x0]['type'],'app':'Set','appdata':_0x9045('0x26')+_0x266b52[_0x5ae99a][0x0]['VoiceExtensionId'],'context':_0x266b52[_0x5ae99a][0x0][_0x9045('0x21')],'exten':_0x266b52[_0x5ae99a][0x0]['exten'],'priority':_0x369ef9['priority']++,'VoiceExtensionId':_0x266b52[_0x5ae99a][0x0][_0x9045('0x1a')]});if(_0x369ef9['extension']&&_0x369ef9[_0x9045('0x13')][_0x9045('0x10')](_0x9045('0x27'))&&_0x369ef9[_0x9045('0x13')]['recordingFormat']!==_0x9045('0x28')){_0x369ef9[_0x9045('0x12')][_0x9045('0x15')]({'type':_0x266b52[_0x5ae99a][0x0][_0x9045('0x19')],'app':'Set','appdata':'_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','context':_0x266b52[_0x5ae99a][0x0]['context'],'exten':_0x266b52[_0x5ae99a][0x0][_0x9045('0xa')],'priority':_0x369ef9[_0x9045('0x11')]++,'VoiceExtensionId':_0x266b52[_0x5ae99a][0x0]['VoiceExtensionId']});_0x369ef9['extensions'][_0x9045('0x15')]({'type':_0x266b52[_0x5ae99a][0x0][_0x9045('0x19')],'app':_0x9045('0x16'),'appdata':_0x9045('0x29')+_0x369ef9[_0x9045('0x13')][_0x9045('0x27')]||_0x9045('0x2a'),'context':_0x266b52[_0x5ae99a][0x0]['context'],'exten':_0x266b52[_0x5ae99a][0x0]['exten'],'priority':_0x369ef9[_0x9045('0x11')]++,'VoiceExtensionId':_0x266b52[_0x5ae99a][0x0][_0x9045('0x1a')]});}}_0x369ef9[_0x9045('0x12')]['push']({'type':_0x266b52[_0x5ae99a][0x0][_0x9045('0x19')],'app':'Set','appdata':_0x9045('0x2b'),'context':_0x266b52[_0x5ae99a][0x0][_0x9045('0x21')],'exten':_0x266b52[_0x5ae99a][0x0]['exten'],'priority':_0x369ef9[_0x9045('0x11')]++,'VoiceExtensionId':_0x266b52[_0x5ae99a][0x0][_0x9045('0x1a')]});_0x369ef9[_0x9045('0x12')][_0x9045('0x15')]({'type':_0x266b52[_0x5ae99a][0x0][_0x9045('0x19')],'app':'Set','appdata':_0x9045('0x2c'),'context':_0x266b52[_0x5ae99a][0x0][_0x9045('0x21')],'exten':_0x266b52[_0x5ae99a][0x0][_0x9045('0xa')],'priority':_0x369ef9['priority']++,'VoiceExtensionId':_0x266b52[_0x5ae99a][0x0]['VoiceExtensionId']});_0x369ef9[_0x9045('0x12')][_0x9045('0x15')]({'type':_0x266b52[_0x5ae99a][0x0][_0x9045('0x19')],'app':'Set','appdata':'MONITOR_OPTIONS=ab','context':_0x266b52[_0x5ae99a][0x0][_0x9045('0x21')],'exten':_0x266b52[_0x5ae99a][0x0][_0x9045('0xa')],'priority':_0x369ef9[_0x9045('0x11')]++,'VoiceExtensionId':_0x266b52[_0x5ae99a][0x0][_0x9045('0x1a')]});for(var _0x28f4ce=0x0,_0x1d1c94=0x0;_0x28f4ce<_0x266b52[_0x5ae99a]['length'];_0x28f4ce+=0x1,_0x1d1c94=0x0){var _0x10f62f=_0x266b52[_0x5ae99a][_0x28f4ce];if(_0x10f62f[_0x9045('0x19')]){_0x10f62f[_0x9045('0x19')]=_0x10f62f['type'][_0x9045('0x2d')]();}var _0x489a0d=[];var _0x58cc65=[];delete _0x10f62f['id'];delete _0x10f62f['createdAt'];delete _0x10f62f['updatedAt'];var _0x580f8e=_0x10f62f[_0x9045('0x2e')]!==_0x9045('0x2f')?[_0x10f62f[_0x9045('0x2e')]]:_0x10f62f[_0x9045('0x30')]?_[_0x9045('0x9')](_[_0x9045('0xc')](_0x369ef9[_0x9045('0x6')],{'IntervalId':_0x10f62f[_0x9045('0x30')]}),_0x9045('0x2e')):[];if(_0x10f62f[_0x9045('0x10')](_0x9045('0x31'))){if(_0x10f62f['tag']&&_0x10f62f[_0x9045('0x31')]!=='--'){_0x489a0d[_0x9045('0x15')]({'type':_0x10f62f[_0x9045('0x19')],'app':'Set','appdata':_0x9045('0x32')+_0x10f62f[_0x9045('0x31')],'context':_0x10f62f[_0x9045('0x21')],'exten':_0x10f62f['exten'],'priority':_0x580f8e['length']+_0x369ef9[_0x9045('0x11')]+_0x1d1c94++,'VoiceExtensionId':_0x10f62f[_0x9045('0x1a')]});}}if(_0x10f62f[_0x9045('0x19')]===_0x9045('0x1c')&&_0x10f62f[_0x9045('0x10')](_0x9045('0x33'))){if(_0x10f62f[_0x9045('0x33')]){_0x489a0d[_0x9045('0x15')]({'type':_0x10f62f[_0x9045('0x19')],'app':_0x9045('0x34'),'appdata':_0x9045('0x35')+_0x10f62f[_0x9045('0x33')]+')','context':_0x10f62f['context'],'exten':_0x10f62f['exten'],'priority':_0x580f8e[_0x9045('0x36')]+_0x369ef9[_0x9045('0x11')]+_0x1d1c94++,'VoiceExtensionId':_0x10f62f[_0x9045('0x1a')]});}else{_0x489a0d[_0x9045('0x15')]({'type':_0x10f62f[_0x9045('0x19')],'app':_0x9045('0x34'),'appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','context':_0x10f62f[_0x9045('0x21')],'exten':_0x10f62f[_0x9045('0xa')],'priority':_0x580f8e['length']+_0x369ef9['priority']+_0x1d1c94++,'VoiceExtensionId':_0x10f62f['VoiceExtensionId']});}}if(_0x10f62f[_0x9045('0x10')](_0x9045('0x37'))){if(_0x2f9c8f[_0x9045('0x38')](_0x10f62f[_0x9045('0x39')][_0x9045('0x2d')]())>=0x0&&_0x10f62f[_0x9045('0x3a')]!==_0x9045('0x3b')){if(_0x10f62f[_0x9045('0x37')]){_0x489a0d[_0x9045('0x15')]({'type':_0x10f62f[_0x9045('0x19')],'app':_0x9045('0x34'),'appdata':_0x9045('0x3c'),'context':_0x10f62f[_0x9045('0x21')],'exten':_0x10f62f[_0x9045('0xa')],'priority':_0x580f8e[_0x9045('0x36')]+_0x369ef9['priority']+_0x1d1c94++,'VoiceExtensionId':_0x10f62f[_0x9045('0x1a')]});_0x489a0d['push']({'type':_0x10f62f[_0x9045('0x19')],'app':_0x9045('0x16'),'appdata':'XCALLY-MOTION-ANSWER=1','context':_0x10f62f['context'],'exten':_0x10f62f['exten'],'priority':_0x580f8e[_0x9045('0x36')]+_0x369ef9[_0x9045('0x11')]+_0x1d1c94++,'VoiceExtensionId':_0x10f62f[_0x9045('0x1a')]});}else{_0x489a0d['push']({'type':_0x10f62f[_0x9045('0x19')],'app':'ExecIf','appdata':'$[${XCALLY-MOTION-PROGRESS}=0]?Progress','context':_0x10f62f['context'],'exten':_0x10f62f[_0x9045('0xa')],'priority':_0x580f8e[_0x9045('0x36')]+_0x369ef9[_0x9045('0x11')]+_0x1d1c94++,'VoiceExtensionId':_0x10f62f['VoiceExtensionId']});_0x489a0d[_0x9045('0x15')]({'type':_0x10f62f['type'],'app':_0x9045('0x16'),'appdata':'XCALLY-MOTION-PROGRESS=1','context':_0x10f62f[_0x9045('0x21')],'exten':_0x10f62f['exten'],'priority':_0x580f8e[_0x9045('0x36')]+_0x369ef9['priority']+_0x1d1c94++,'VoiceExtensionId':_0x10f62f[_0x9045('0x1a')]});}}}for(var _0x2aa5bf=0x0;_0x2aa5bf<_0x580f8e[_0x9045('0x36')];_0x2aa5bf+=0x1){var _0x4fc4d8=_0x369ef9[_0x9045('0x11')]+_0x580f8e[_0x9045('0x36')];var _0x1d93d9=_0x2aa5bf===_0x580f8e['length']-0x1?_0x369ef9['priority']+_0x489a0d[_0x9045('0x36')]+_0x58cc65[_0x9045('0x36')]+0x2:_0x369ef9['priority']+_0x2aa5bf+0x1;_0x489a0d[_0x9045('0x3d')](_0x2aa5bf,0x0,{'type':_0x10f62f[_0x9045('0x19')],'app':_0x9045('0x3e'),'appdata':_0x580f8e[_0x2aa5bf]+'?'+_0x10f62f['context']+_0x9045('0x3f')+_0x4fc4d8+':'+_0x10f62f[_0x9045('0x21')]+_0x9045('0x3f')+_0x1d93d9,'exten':_0x10f62f[_0x9045('0xa')],'context':_0x10f62f[_0x9045('0x21')],'priority':_0x369ef9['priority']+_0x2aa5bf,'VoiceExtensionId':_0x266b52[_0x5ae99a][0x0][_0x9045('0x1a')]});}_0x10f62f[_0x9045('0x11')]=_0x489a0d[_0x9045('0x36')]?_['last'](_0x489a0d)['priority']+0x1:_0x369ef9[_0x9045('0x11')];_0x369ef9['priority']=(_0x58cc65[_0x9045('0x36')]?_[_0x9045('0x40')](_0x58cc65)[_0x9045('0x11')]:_0x10f62f[_0x9045('0x11')])+0x1;_0x369ef9['extensions']=_[_0x9045('0x41')](_0x369ef9[_0x9045('0x12')],_0x489a0d,[_0x10f62f],_0x58cc65);}_0x369ef9[_0x9045('0x12')][_0x9045('0x15')]({'type':_0x266b52[_0x5ae99a][0x0][_0x9045('0x19')],'app':_0x9045('0x42'),'exten':_0x266b52[_0x5ae99a][0x0][_0x9045('0xa')],'context':_0x266b52[_0x5ae99a][0x0][_0x9045('0x21')],'priority':_0x369ef9['priority'],'VoiceExtensionId':_0x266b52[_0x5ae99a][0x0]['VoiceExtensionId']});_0x4dca59['push'](_0x266b52[_0x5ae99a][0x0][_0x9045('0x1a')]);_0x28dd85=_[_0x9045('0x41')](_0x28dd85,_0x369ef9['extensions']);}}return _0x4580fa[_0x9045('0x43')](function(_0x2ea3ca){return _0x4580fa[_0x9045('0x2')][_0x9045('0x7')][_0x9045('0x44')]({'where':{'VoiceExtensionId':{'$in':_0x4dca59}},'transaction':_0x2ea3ca})[_0x9045('0x5')](function(_0x243dc3){return _0x4580fa['models'][_0x9045('0x7')][_0x9045('0x45')](_['sortBy'](_0x28dd85,_0x9045('0x11')),{'transaction':_0x2ea3ca});});});})[_0x9045('0x46')](function(_0xf89ae7){console[_0x9045('0x47')](_0xf89ae7);});}exports[_0x9045('0x48')]=rewrite; \ No newline at end of file +var _0xf005=['app','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','XCALLY-MOTION-PROGRESS=1',',${EXTEN},','concat','Hangup','destroy','bulkCreate','sortBy','catch','lodash','models','Interval','then','intervals','VoiceExtension','findAll','IntervalId','uniq','map','exten','CAST(priority\x20AS\x20UNSIGNED)','filter','groupBy','queue','playback','hasOwnProperty','extensions','extension','find','push','Set','format','CDR(type)=%s','context','VoiceExtensionId','type','inbound','CDR(routeid)=','priority','outbound','CDR(destination)=','cutdigits','${EXTEN:','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','length','toLowerCase','createdAt','updatedAt','interval','*,*,*,*','tag','CDR(tag)=','callerID','answer','indexOf'];(function(_0x4a1fdb,_0x546b3d){var _0x16360f=function(_0x4105dd){while(--_0x4105dd){_0x4a1fdb['push'](_0x4a1fdb['shift']());}};_0x16360f(++_0x546b3d);}(_0xf005,0x19e));var _0x5f00=function(_0x2c3228,_0x38b939){_0x2c3228=_0x2c3228-0x0;var _0x39a33e=_0xf005[_0x2c3228];return _0x39a33e;};'use strict';var _=require(_0x5f00('0x0'));var util=require('util');function rewrite(_0x497141,_0x1793b7){var _0x3cb209=this;return _0x497141[_0x5f00('0x1')][_0x5f00('0x2')]['findAll']({'raw':!![]})[_0x5f00('0x3')](function(_0x2c4c9f){_0x3cb209[_0x5f00('0x4')]=_0x2c4c9f;return _0x497141[_0x5f00('0x1')][_0x5f00('0x5')][_0x5f00('0x6')]({'where':{'IntervalId':_0x1793b7[_0x5f00('0x7')]},'raw':!![]});})[_0x5f00('0x3')](function(_0x3bf037){return _0x497141[_0x5f00('0x1')][_0x5f00('0x5')][_0x5f00('0x6')]({'where':{'exten':{'$in':_[_0x5f00('0x8')](_[_0x5f00('0x9')](_0x3bf037,_0x5f00('0xa')))}},'order':[{'raw':_0x5f00('0xb')}],'raw':!![]});})['then'](function(_0x57e942){var _0x2192c7=_[_0x5f00('0xc')](_0x57e942,{'priority':'1'});var _0x550aca=_[_0x5f00('0xc')](_0x57e942,{'isApp':0x1});var _0x3ec39c=_[_0x5f00('0xd')](_0x550aca,_0x5f00('0xa'));var _0x37e912=[_0x5f00('0xe'),_0x5f00('0xf')];var _0x43b2cb=[];var _0x103ea2=[];for(var _0x333f0d in _0x3ec39c){if(_0x3ec39c[_0x5f00('0x10')](_0x333f0d)){_0x3cb209['priority']=0x2;_0x3cb209[_0x5f00('0x11')]=[];_0x3cb209[_0x5f00('0x12')]=_[_0x5f00('0x13')](_0x2192c7,{'exten':_0x3ec39c[_0x333f0d][0x0][_0x5f00('0xa')]});_0x3cb209[_0x5f00('0x11')][_0x5f00('0x14')]({'type':_0x3ec39c[_0x333f0d][0x0]['type'],'app':_0x5f00('0x15'),'appdata':util[_0x5f00('0x16')](_0x5f00('0x17'),_0x3ec39c[_0x333f0d][0x0]['type']),'context':_0x3ec39c[_0x333f0d][0x0][_0x5f00('0x18')],'exten':_0x3ec39c[_0x333f0d][0x0][_0x5f00('0xa')],'priority':_0x3cb209['priority']++,'VoiceExtensionId':_0x3ec39c[_0x333f0d][0x0][_0x5f00('0x19')]});if(_0x3ec39c[_0x333f0d][0x0][_0x5f00('0x1a')]===_0x5f00('0x1b')){_0x3cb209[_0x5f00('0x11')]['push']({'type':_0x3ec39c[_0x333f0d][0x0][_0x5f00('0x1a')],'app':_0x5f00('0x15'),'appdata':_0x5f00('0x1c')+_0x3ec39c[_0x333f0d][0x0][_0x5f00('0x19')],'context':_0x3ec39c[_0x333f0d][0x0][_0x5f00('0x18')],'exten':_0x3ec39c[_0x333f0d][0x0][_0x5f00('0xa')],'priority':_0x3cb209[_0x5f00('0x1d')]++,'VoiceExtensionId':_0x3ec39c[_0x333f0d][0x0][_0x5f00('0x19')]});}else if(_0x3ec39c[_0x333f0d][0x0][_0x5f00('0x1a')]===_0x5f00('0x1e')){if(_0x3cb209['extension']){_0x3cb209['extensions'][_0x5f00('0x14')]({'type':_0x3ec39c[_0x333f0d][0x0]['type'],'app':'Set','appdata':_0x5f00('0x1f')+(_0x3cb209[_0x5f00('0x12')][_0x5f00('0x20')]?_0x5f00('0x21')+_0x3cb209['extension']['cutdigits']+'}':'${EXTEN}'),'context':_0x3ec39c[_0x333f0d][0x0][_0x5f00('0x18')],'exten':_0x3ec39c[_0x333f0d][0x0][_0x5f00('0xa')],'priority':_0x3cb209['priority']++,'VoiceExtensionId':_0x3ec39c[_0x333f0d][0x0][_0x5f00('0x19')]});}_0x3cb209[_0x5f00('0x11')][_0x5f00('0x14')]({'type':_0x3ec39c[_0x333f0d][0x0][_0x5f00('0x1a')],'app':_0x5f00('0x15'),'appdata':_0x5f00('0x1c')+_0x3ec39c[_0x333f0d][0x0]['VoiceExtensionId'],'context':_0x3ec39c[_0x333f0d][0x0][_0x5f00('0x18')],'exten':_0x3ec39c[_0x333f0d][0x0][_0x5f00('0xa')],'priority':_0x3cb209[_0x5f00('0x1d')]++,'VoiceExtensionId':_0x3ec39c[_0x333f0d][0x0][_0x5f00('0x19')]});var _0x538ce2=_0x3cb209[_0x5f00('0x1d')]++;_0x3cb209['extensions']['push']({'type':_0x3ec39c[_0x333f0d][0x0]['type'],'app':_0x5f00('0x22'),'appdata':_0x5f00('0x23')+(_0x538ce2+0x2)+_0x5f00('0x24')+(_0x538ce2+0x1)+')','context':_0x3ec39c[_0x333f0d][0x0][_0x5f00('0x18')],'exten':_0x3ec39c[_0x333f0d][0x0][_0x5f00('0xa')],'priority':_0x538ce2,'VoiceExtensionId':_0x3ec39c[_0x333f0d][0x0][_0x5f00('0x19')]});if(_0x3cb209[_0x5f00('0x12')]){_0x3cb209[_0x5f00('0x11')][_0x5f00('0x14')]({'type':_0x3ec39c[_0x333f0d][0x0][_0x5f00('0x1a')],'app':_0x5f00('0x15'),'appdata':_0x3cb209[_0x5f00('0x12')][_0x5f00('0x20')]?_0x5f00('0x25')+_0x3cb209[_0x5f00('0x12')]['cutdigits']+'}':_0x5f00('0x26'),'context':_0x3ec39c[_0x333f0d][0x0]['context'],'exten':_0x3ec39c[_0x333f0d][0x0][_0x5f00('0xa')],'priority':_0x3cb209[_0x5f00('0x1d')]++,'VoiceExtensionId':_0x3ec39c[_0x333f0d][0x0][_0x5f00('0x19')]});}_0x3cb209[_0x5f00('0x11')]['push']({'type':_0x3ec39c[_0x333f0d][0x0][_0x5f00('0x1a')],'app':'Set','appdata':'outboundrouteid='+_0x3ec39c[_0x333f0d][0x0][_0x5f00('0x19')],'context':_0x3ec39c[_0x333f0d][0x0]['context'],'exten':_0x3ec39c[_0x333f0d][0x0][_0x5f00('0xa')],'priority':_0x3cb209[_0x5f00('0x1d')]++,'VoiceExtensionId':_0x3ec39c[_0x333f0d][0x0]['VoiceExtensionId']});if(_0x3cb209[_0x5f00('0x12')]&&_0x3cb209[_0x5f00('0x12')][_0x5f00('0x10')](_0x5f00('0x27'))&&_0x3cb209[_0x5f00('0x12')][_0x5f00('0x27')]!==_0x5f00('0x28')){_0x3cb209[_0x5f00('0x11')]['push']({'type':_0x3ec39c[_0x333f0d][0x0][_0x5f00('0x1a')],'app':_0x5f00('0x15'),'appdata':_0x5f00('0x29'),'context':_0x3ec39c[_0x333f0d][0x0][_0x5f00('0x18')],'exten':_0x3ec39c[_0x333f0d][0x0]['exten'],'priority':_0x3cb209[_0x5f00('0x1d')]++,'VoiceExtensionId':_0x3ec39c[_0x333f0d][0x0][_0x5f00('0x19')]});_0x3cb209[_0x5f00('0x11')]['push']({'type':_0x3ec39c[_0x333f0d][0x0][_0x5f00('0x1a')],'app':_0x5f00('0x15'),'appdata':'_XCALLY_MIXMONITOR_FORMAT='+_0x3cb209[_0x5f00('0x12')][_0x5f00('0x27')]||'wav','context':_0x3ec39c[_0x333f0d][0x0][_0x5f00('0x18')],'exten':_0x3ec39c[_0x333f0d][0x0][_0x5f00('0xa')],'priority':_0x3cb209['priority']++,'VoiceExtensionId':_0x3ec39c[_0x333f0d][0x0][_0x5f00('0x19')]});}}_0x3cb209[_0x5f00('0x11')][_0x5f00('0x14')]({'type':_0x3ec39c[_0x333f0d][0x0][_0x5f00('0x1a')],'app':'Set','appdata':'XCALLY-MOTION-ANSWER=0','context':_0x3ec39c[_0x333f0d][0x0]['context'],'exten':_0x3ec39c[_0x333f0d][0x0][_0x5f00('0xa')],'priority':_0x3cb209[_0x5f00('0x1d')]++,'VoiceExtensionId':_0x3ec39c[_0x333f0d][0x0][_0x5f00('0x19')]});_0x3cb209[_0x5f00('0x11')][_0x5f00('0x14')]({'type':_0x3ec39c[_0x333f0d][0x0]['type'],'app':_0x5f00('0x15'),'appdata':_0x5f00('0x2a'),'context':_0x3ec39c[_0x333f0d][0x0]['context'],'exten':_0x3ec39c[_0x333f0d][0x0][_0x5f00('0xa')],'priority':_0x3cb209[_0x5f00('0x1d')]++,'VoiceExtensionId':_0x3ec39c[_0x333f0d][0x0][_0x5f00('0x19')]});_0x3cb209[_0x5f00('0x11')][_0x5f00('0x14')]({'type':_0x3ec39c[_0x333f0d][0x0][_0x5f00('0x1a')],'app':_0x5f00('0x15'),'appdata':_0x5f00('0x2b'),'context':_0x3ec39c[_0x333f0d][0x0][_0x5f00('0x18')],'exten':_0x3ec39c[_0x333f0d][0x0][_0x5f00('0xa')],'priority':_0x3cb209[_0x5f00('0x1d')]++,'VoiceExtensionId':_0x3ec39c[_0x333f0d][0x0][_0x5f00('0x19')]});for(var _0x5e2957=0x0,_0x3246b1=0x0;_0x5e2957<_0x3ec39c[_0x333f0d][_0x5f00('0x2c')];_0x5e2957+=0x1,_0x3246b1=0x0){var _0x368b96=_0x3ec39c[_0x333f0d][_0x5e2957];if(_0x368b96[_0x5f00('0x1a')]){_0x368b96[_0x5f00('0x1a')]=_0x368b96['type'][_0x5f00('0x2d')]();}var _0xbfc77e=[];var _0x285849=[];delete _0x368b96['id'];delete _0x368b96[_0x5f00('0x2e')];delete _0x368b96[_0x5f00('0x2f')];var _0x48232a=_0x368b96[_0x5f00('0x30')]!==_0x5f00('0x31')?[_0x368b96[_0x5f00('0x30')]]:_0x368b96[_0x5f00('0x7')]?_[_0x5f00('0x9')](_['filter'](_0x3cb209[_0x5f00('0x4')],{'IntervalId':_0x368b96[_0x5f00('0x7')]}),'interval'):[];if(_0x368b96['hasOwnProperty'](_0x5f00('0x32'))){if(_0x368b96['tag']&&_0x368b96[_0x5f00('0x32')]!=='--'){_0xbfc77e[_0x5f00('0x14')]({'type':_0x368b96['type'],'app':'Set','appdata':_0x5f00('0x33')+_0x368b96[_0x5f00('0x32')],'context':_0x368b96['context'],'exten':_0x368b96[_0x5f00('0xa')],'priority':_0x48232a[_0x5f00('0x2c')]+_0x3cb209['priority']+_0x3246b1++,'VoiceExtensionId':_0x368b96[_0x5f00('0x19')]});}}if(_0x368b96[_0x5f00('0x1a')]===_0x5f00('0x1e')&&_0x368b96['hasOwnProperty'](_0x5f00('0x34'))){if(_0x368b96[_0x5f00('0x34')]){_0xbfc77e[_0x5f00('0x14')]({'type':_0x368b96[_0x5f00('0x1a')],'app':_0x5f00('0x22'),'appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)='+_0x368b96[_0x5f00('0x34')]+')','context':_0x368b96[_0x5f00('0x18')],'exten':_0x368b96['exten'],'priority':_0x48232a[_0x5f00('0x2c')]+_0x3cb209[_0x5f00('0x1d')]+_0x3246b1++,'VoiceExtensionId':_0x368b96[_0x5f00('0x19')]});}else{_0xbfc77e[_0x5f00('0x14')]({'type':_0x368b96[_0x5f00('0x1a')],'app':'ExecIf','appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','context':_0x368b96[_0x5f00('0x18')],'exten':_0x368b96[_0x5f00('0xa')],'priority':_0x48232a['length']+_0x3cb209['priority']+_0x3246b1++,'VoiceExtensionId':_0x368b96[_0x5f00('0x19')]});}}if(_0x368b96[_0x5f00('0x10')](_0x5f00('0x35'))){if(_0x37e912[_0x5f00('0x36')](_0x368b96[_0x5f00('0x37')][_0x5f00('0x2d')]())>=0x0&&_0x368b96['appType']!==_0x5f00('0x38')){if(_0x368b96[_0x5f00('0x35')]){_0xbfc77e[_0x5f00('0x14')]({'type':_0x368b96['type'],'app':_0x5f00('0x22'),'appdata':_0x5f00('0x39'),'context':_0x368b96[_0x5f00('0x18')],'exten':_0x368b96[_0x5f00('0xa')],'priority':_0x48232a[_0x5f00('0x2c')]+_0x3cb209['priority']+_0x3246b1++,'VoiceExtensionId':_0x368b96[_0x5f00('0x19')]});_0xbfc77e[_0x5f00('0x14')]({'type':_0x368b96[_0x5f00('0x1a')],'app':_0x5f00('0x15'),'appdata':_0x5f00('0x3a'),'context':_0x368b96[_0x5f00('0x18')],'exten':_0x368b96['exten'],'priority':_0x48232a[_0x5f00('0x2c')]+_0x3cb209[_0x5f00('0x1d')]+_0x3246b1++,'VoiceExtensionId':_0x368b96[_0x5f00('0x19')]});}else{_0xbfc77e[_0x5f00('0x14')]({'type':_0x368b96['type'],'app':'ExecIf','appdata':'$[${XCALLY-MOTION-PROGRESS}=0]?Progress','context':_0x368b96[_0x5f00('0x18')],'exten':_0x368b96[_0x5f00('0xa')],'priority':_0x48232a[_0x5f00('0x2c')]+_0x3cb209[_0x5f00('0x1d')]+_0x3246b1++,'VoiceExtensionId':_0x368b96[_0x5f00('0x19')]});_0xbfc77e[_0x5f00('0x14')]({'type':_0x368b96['type'],'app':'Set','appdata':_0x5f00('0x3b'),'context':_0x368b96[_0x5f00('0x18')],'exten':_0x368b96[_0x5f00('0xa')],'priority':_0x48232a[_0x5f00('0x2c')]+_0x3cb209[_0x5f00('0x1d')]+_0x3246b1++,'VoiceExtensionId':_0x368b96[_0x5f00('0x19')]});}}}for(var _0x40fc60=0x0;_0x40fc60<_0x48232a[_0x5f00('0x2c')];_0x40fc60+=0x1){var _0x42241d=_0x3cb209['priority']+_0x48232a[_0x5f00('0x2c')];var _0x500d4a=_0x40fc60===_0x48232a['length']-0x1?_0x3cb209['priority']+_0xbfc77e[_0x5f00('0x2c')]+_0x285849[_0x5f00('0x2c')]+0x2:_0x3cb209[_0x5f00('0x1d')]+_0x40fc60+0x1;_0xbfc77e['splice'](_0x40fc60,0x0,{'type':_0x368b96[_0x5f00('0x1a')],'app':'GotoIfTime','appdata':_0x48232a[_0x40fc60]+'?'+_0x368b96[_0x5f00('0x18')]+_0x5f00('0x3c')+_0x42241d+':'+_0x368b96[_0x5f00('0x18')]+_0x5f00('0x3c')+_0x500d4a,'exten':_0x368b96[_0x5f00('0xa')],'context':_0x368b96['context'],'priority':_0x3cb209[_0x5f00('0x1d')]+_0x40fc60,'VoiceExtensionId':_0x3ec39c[_0x333f0d][0x0][_0x5f00('0x19')]});}_0x368b96['priority']=_0xbfc77e[_0x5f00('0x2c')]?_['last'](_0xbfc77e)[_0x5f00('0x1d')]+0x1:_0x3cb209[_0x5f00('0x1d')];_0x3cb209[_0x5f00('0x1d')]=(_0x285849[_0x5f00('0x2c')]?_['last'](_0x285849)[_0x5f00('0x1d')]:_0x368b96[_0x5f00('0x1d')])+0x1;_0x3cb209['extensions']=_[_0x5f00('0x3d')](_0x3cb209['extensions'],_0xbfc77e,[_0x368b96],_0x285849);}_0x3cb209[_0x5f00('0x11')][_0x5f00('0x14')]({'type':_0x3ec39c[_0x333f0d][0x0][_0x5f00('0x1a')],'app':_0x5f00('0x3e'),'exten':_0x3ec39c[_0x333f0d][0x0]['exten'],'context':_0x3ec39c[_0x333f0d][0x0][_0x5f00('0x18')],'priority':_0x3cb209[_0x5f00('0x1d')],'VoiceExtensionId':_0x3ec39c[_0x333f0d][0x0][_0x5f00('0x19')]});_0x43b2cb[_0x5f00('0x14')](_0x3ec39c[_0x333f0d][0x0][_0x5f00('0x19')]);_0x103ea2=_[_0x5f00('0x3d')](_0x103ea2,_0x3cb209[_0x5f00('0x11')]);}}return _0x497141['transaction'](function(_0x150ae6){return _0x497141[_0x5f00('0x1')]['VoiceExtension'][_0x5f00('0x3f')]({'where':{'VoiceExtensionId':{'$in':_0x43b2cb}},'transaction':_0x150ae6})[_0x5f00('0x3')](function(_0x6bdf16){return _0x497141[_0x5f00('0x1')][_0x5f00('0x5')][_0x5f00('0x40')](_[_0x5f00('0x41')](_0x103ea2,'priority'),{'transaction':_0x150ae6});});});})[_0x5f00('0x42')](function(_0x5e5f85){console['error'](_0x5e5f85);});}exports['rewrite']=rewrite; \ No newline at end of file diff --git a/server/components/import/cm/csv.js b/server/components/import/cm/csv.js index dcde23a..3bff248 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 _0xc6f7=['createdAt','select','field','NOW()','toString','updatedAt','from','cm_contacts','where','deletedAt\x20IS\x20NULL','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','ListId\x20=\x20?','str','\x20=\x20?','into','id\x20IN\x20?','cm_hopper_black','VoiceQueue','findAll','outbound','dialCheckDuplicateType','CmList','Lists','get','always','sequelize','query','VoiceQueueId','onlyIfOpen','all','BlackLists','Campaign','CampaignId','cmContact,\x20%s,\x20%s','generalCheckHopper','Error\x20processing\x20rows\x20block:','finally','emit','contact:csv_','resume','resolve','unlinkSync','Unable\x20to\x20delete\x20temp\x20file:','exit','SIGINT','info','CSV\x20import\x20process\x20stopped!','parse','pause','CSV\x20parsed\x20correctly!','CSV\x20parse\x20error','Error\x20executing\x20contact\x20csv\x20import:','bluebird','lodash','squel','papaparse','ioredis','../../../config/logger','api','defaults','redis','localhost','socket.io-emitter','../../../api/cmContact/cmContact.socket','register','argv','undefined','null','Missing\x20filepath\x20parameter!','Missing\x20binding\x20parameters!','zipObject','split','Missing\x20socket_timestamp\x20parameter!','error','contact','index','test','isNil','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','length','map','message','hasOwnProperty','data','firstName','firstName\x20not\x20specified!','phone','phone\x20not\x20specified!','birthDate','YYYY-MM-DD','isValid','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','email\x20format\x20is\x20not\x20valid!','ListId','CompanyId','find','duplicate','Duplicate\x20Contact','CmContact','create','then','push','catch','stringify','cmContact','checkHopper','inspect','insert','cm_hopper','fromQuery','scheduledAt','ContactId'];(function(_0xfc7766,_0x327f7d){var _0x83590=function(_0x2a2810){while(--_0x2a2810){_0xfc7766['push'](_0xfc7766['shift']());}};_0x83590(++_0x327f7d);}(_0xc6f7,0xa8));var _0x7c6f=function(_0x17d48c,_0x3a4fce){_0x17d48c=_0x17d48c-0x0;var _0x400170=_0xc6f7[_0x17d48c];return _0x400170;};'use strict';var BPromise=require(_0x7c6f('0x0'));var util=require('util');var _=require(_0x7c6f('0x1'));var fs=require('fs');var squel=require(_0x7c6f('0x2'));var Papa=require(_0x7c6f('0x3'));var Redis=require(_0x7c6f('0x4'));var db=require('../../../mysqldb')['db'];var config=require('../../../config/environment');var logger=require(_0x7c6f('0x5'))(_0x7c6f('0x6'));config['redis']=_[_0x7c6f('0x7')](config[_0x7c6f('0x8')],{'host':_0x7c6f('0x9'),'port':0x18eb});var socket=require(_0x7c6f('0xa'))(new Redis(config[_0x7c6f('0x8')]));require(_0x7c6f('0xb'))[_0x7c6f('0xc')](socket);try{if(!process[_0x7c6f('0xd')][0x2]||process[_0x7c6f('0xd')][0x2]===_0x7c6f('0xe')||process[_0x7c6f('0xd')][0x2]===_0x7c6f('0xf')){throw new Error(_0x7c6f('0x10'));}var FILEPATH=process[_0x7c6f('0xd')][0x2];if(!process[_0x7c6f('0xd')][0x3]||process[_0x7c6f('0xd')][0x3]===_0x7c6f('0xe')||process[_0x7c6f('0xd')][0x3]===_0x7c6f('0xf')||!process[_0x7c6f('0xd')][0x4]||process['argv'][0x4]===_0x7c6f('0xe')||process[_0x7c6f('0xd')][0x4]===_0x7c6f('0xf')){throw new Error(_0x7c6f('0x11'));}var FIELDS=_[_0x7c6f('0x12')](process['argv'][0x3]['split'](','),process[_0x7c6f('0xd')][0x4][_0x7c6f('0x13')](','));if(!process[_0x7c6f('0xd')][0x5]||process[_0x7c6f('0xd')][0x5]===_0x7c6f('0xe')||process['argv'][0x5]==='null'){throw new Error('Missing\x20ListId\x20parameter!');}var LISTID=process[_0x7c6f('0xd')][0x5];var COMPANYID=process[_0x7c6f('0xd')][0x6]&&process[_0x7c6f('0xd')][0x6]!==_0x7c6f('0xe')&&process[_0x7c6f('0xd')][0x6]!==_0x7c6f('0xf')?process[_0x7c6f('0xd')][0x6]:null;var DUPLICATES=process[_0x7c6f('0xd')][0x7]&&process['argv'][0x7]!==_0x7c6f('0xe')&&process[_0x7c6f('0xd')][0x7]!=='null'?process['argv'][0x7]:null;if(!process[_0x7c6f('0xd')][0x8]||process[_0x7c6f('0xd')][0x8]===_0x7c6f('0xe')||process[_0x7c6f('0xd')][0x8]===_0x7c6f('0xf')){throw new Error(_0x7c6f('0x14'));}var SOCKET_TIMESTAMP=process[_0x7c6f('0xd')][0x8];}catch(_0x2e6880){logger[_0x7c6f('0x15')](_0x2e6880);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(_0x22d14e,_0x3c7dde,_0x5d6156,_0x7cc627){var _0x28ea65={'message':_0x3c7dde};_0x28ea65[_0x22d14e]=!![];if(_0x5d6156){_0x28ea65[_0x7c6f('0x16')]=_0x5d6156;}if(_0x7cc627){_0x28ea65[_0x7c6f('0x17')]=_0x7cc627;}return _0x28ea65;}function isEmail(_0x25de8d){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))*$/[_0x7c6f('0x18')](_0x25de8d);}function checkRow(_0x436c28,_0x5e4f49,_0x458ecb){return new BPromise(function(_0x52d258,_0x3d08a2){if(_[_0x7c6f('0x19')](_0x436c28)){return _0x3d08a2(handleCheckRowError(_0x7c6f('0x15'),_0x7c6f('0x1a'),null,_0x458ecb));}if(_0x436c28['errors']&&_0x436c28[_0x7c6f('0x1b')][_0x7c6f('0x1c')]){var _0xf18d36=_[_0x7c6f('0x1d')](_0x436c28[_0x7c6f('0x1b')],_0x7c6f('0x1e'))['join'](';');return _0x3d08a2(handleCheckRowError(_0x7c6f('0x15'),_0xf18d36,null,_0x458ecb));}var _0x29998c={};for(var _0x536008 in FIELDS){if(FIELDS[_0x7c6f('0x1f')](_0x536008)&&FIELDS[_0x536008]){_0x29998c[_0x536008]=_0x436c28[_0x7c6f('0x20')][0x0][FIELDS[_0x536008]]||_0x436c28['data'][0x0]['\ufeff'+FIELDS[_0x536008]];}}if(!_0x29998c[_0x7c6f('0x21')]){return _0x3d08a2(handleCheckRowError('error',_0x7c6f('0x22'),null,_0x458ecb));}if(!_0x29998c[_0x7c6f('0x23')]){return _0x3d08a2(handleCheckRowError(_0x7c6f('0x15'),_0x7c6f('0x24'),null,_0x458ecb));}if(_0x29998c['birthDate']){var _0x1fd615=moment(_0x29998c[_0x7c6f('0x25')],_0x7c6f('0x26'));if(!_0x1fd615[_0x7c6f('0x27')]()){return _0x3d08a2(handleCheckRowError(_0x7c6f('0x15'),_0x7c6f('0x28'),null,_0x458ecb));}}if(_0x29998c[_0x7c6f('0x29')]){if(!isEmail(_0x29998c[_0x7c6f('0x29')])){return _0x3d08a2(handleCheckRowError(_0x7c6f('0x15'),_0x7c6f('0x2a'),null,_0x458ecb));}}_0x29998c[_0x7c6f('0x2b')]=LISTID;_0x29998c[_0x7c6f('0x2c')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES['length']&&_0x5e4f49){var _0x5a2081={};for(var _0x17a8be=0x0,_0x3bd19b=DUPLICATES['length'];_0x17a8be<_0x3bd19b;_0x17a8be+=0x1){_0x5a2081[DUPLICATES[_0x17a8be]]=_0x29998c[DUPLICATES[_0x17a8be]];}var _0x448879=_[_0x7c6f('0x2d')](_0x5e4f49,_0x5a2081);if(_0x448879){return _0x3d08a2(handleCheckRowError(_0x7c6f('0x2e'),_0x7c6f('0x2f'),_0x448879,_0x458ecb));}}return db[_0x7c6f('0x30')][_0x7c6f('0x31')](_0x29998c,{'raw':!![],'hooks':![],'fields':_['keys'](_0x29998c)})[_0x7c6f('0x32')](function(_0x33ba46){if(DUPLICATES&&DUPLICATES['length']&&_0x5e4f49){_0x5e4f49[_0x7c6f('0x33')](_['pick'](_0x29998c,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x33ba46['id'];return _0x52d258();})[_0x7c6f('0x34')](function(_0x234c25){return _0x3d08a2(handleCheckRowError(_0x7c6f('0x15'),'Error\x20while\x20creating\x20contact:\x20'+(_0x234c25[_0x7c6f('0x1e')]||JSON[_0x7c6f('0x35')](_0x234c25)),null,_0x458ecb));});});}function checkHopper(){function _0x462c46(){return function(_0x80260e){logger[_0x7c6f('0x15')](_0x7c6f('0x36'),_0x7c6f('0x37'),util[_0x7c6f('0x38')](_0x80260e,{'showHidden':![],'depth':null}));};}var _0xd26519=function(_0x3c502f,_0x4bb552){var _0x3f38cf=squel[_0x7c6f('0x39')]()['into'](_0x7c6f('0x3a'))[_0x7c6f('0x3b')]([_0x7c6f('0x23'),_0x7c6f('0x3c'),_0x7c6f('0x3d'),_0x7c6f('0x2b'),_0x4bb552,_0x7c6f('0x3e'),'updatedAt'],squel[_0x7c6f('0x3f')]()[_0x7c6f('0x40')](_0x7c6f('0x23'),_0x7c6f('0x23'))['field'](_0x7c6f('0x41'),_0x7c6f('0x3c'))[_0x7c6f('0x40')]('id',_0x7c6f('0x3d'))['field'](LISTID[_0x7c6f('0x42')](),_0x7c6f('0x2b'))[_0x7c6f('0x40')](_0x3c502f['id'][_0x7c6f('0x42')](),_0x4bb552)[_0x7c6f('0x40')](_0x7c6f('0x41'),'createdAt')['field'](_0x7c6f('0x41'),_0x7c6f('0x43'))[_0x7c6f('0x44')](_0x7c6f('0x45'))[_0x7c6f('0x46')](_0x7c6f('0x47'))[_0x7c6f('0x46')]('ListId\x20=\x20?',LISTID[_0x7c6f('0x42')]())[_0x7c6f('0x46')](_0x7c6f('0x48'))[_0x7c6f('0x46')](_0x7c6f('0x49'),squel[_0x7c6f('0x3f')]()[_0x7c6f('0x40')](_0x7c6f('0x23'))[_0x7c6f('0x44')]('cm_hopper')[_0x7c6f('0x46')](_0x4bb552+'\x20=\x20?',_0x3c502f['id'][_0x7c6f('0x42')]())))[_0x7c6f('0x42')]();return _0x3f38cf;};var _0x536b27=function(_0x5e014e,_0x3cdca3){var _0x1b3577=squel['insert']()['into'](_0x7c6f('0x3a'))[_0x7c6f('0x3b')]([_0x7c6f('0x23'),_0x7c6f('0x3c'),_0x7c6f('0x3d'),_0x7c6f('0x2b'),_0x3cdca3,_0x7c6f('0x3e'),_0x7c6f('0x43')],squel[_0x7c6f('0x3f')]()['field'](_0x7c6f('0x23'),'phone')[_0x7c6f('0x40')]('NOW()',_0x7c6f('0x3c'))['field']('id','ContactId')['field'](LISTID['toString'](),_0x7c6f('0x2b'))[_0x7c6f('0x40')](_0x5e014e['id'][_0x7c6f('0x42')](),_0x3cdca3)[_0x7c6f('0x40')](_0x7c6f('0x41'),_0x7c6f('0x3e'))[_0x7c6f('0x40')](_0x7c6f('0x41'),'updatedAt')[_0x7c6f('0x44')](_0x7c6f('0x45'))[_0x7c6f('0x46')](_0x7c6f('0x47'))[_0x7c6f('0x46')](_0x7c6f('0x4a'),LISTID[_0x7c6f('0x42')]())['where']('id\x20IN\x20?',squel[_0x7c6f('0x4b')](hopperContacts))['where'](_0x7c6f('0x48'))[_0x7c6f('0x46')](_0x7c6f('0x49'),squel[_0x7c6f('0x3f')]()[_0x7c6f('0x40')]('calleridnum')[_0x7c6f('0x44')]('cm_hopper_final')[_0x7c6f('0x46')](_0x3cdca3+_0x7c6f('0x4c'),_0x5e014e['id'][_0x7c6f('0x42')]()))[_0x7c6f('0x46')](_0x7c6f('0x49'),squel[_0x7c6f('0x3f')]()['field']('phone')[_0x7c6f('0x44')](_0x7c6f('0x3a'))[_0x7c6f('0x46')](_0x3cdca3+'\x20=\x20?',_0x5e014e['id'][_0x7c6f('0x42')]())))[_0x7c6f('0x42')]();return _0x1b3577;};function _0x3fc1aa(_0xfda9c4,_0x3ad04a){var _0x21dae1=squel['insert']()[_0x7c6f('0x4d')](_0x7c6f('0x3a'))[_0x7c6f('0x3b')]([_0x7c6f('0x23'),_0x7c6f('0x3c'),_0x7c6f('0x3d'),'ListId',_0x3ad04a,'createdAt',_0x7c6f('0x43')],squel[_0x7c6f('0x3f')]()[_0x7c6f('0x40')](_0x7c6f('0x23'),'phone')[_0x7c6f('0x40')](_0x7c6f('0x41'),'scheduledAt')[_0x7c6f('0x40')]('id','ContactId')[_0x7c6f('0x40')](LISTID[_0x7c6f('0x42')](),'ListId')['field'](_0xfda9c4['id'][_0x7c6f('0x42')](),_0x3ad04a)[_0x7c6f('0x40')](_0x7c6f('0x41'),_0x7c6f('0x3e'))[_0x7c6f('0x40')](_0x7c6f('0x41'),_0x7c6f('0x43'))[_0x7c6f('0x44')](_0x7c6f('0x45'))[_0x7c6f('0x46')](_0x7c6f('0x47'))[_0x7c6f('0x46')]('ListId\x20=\x20?',LISTID[_0x7c6f('0x42')]())[_0x7c6f('0x46')](_0x7c6f('0x4e'),squel[_0x7c6f('0x4b')](hopperContacts))[_0x7c6f('0x46')](_0x7c6f('0x48')))[_0x7c6f('0x42')]();return _0x21dae1;}function _0x4aa61b(_0x3e7764,_0x219869){var _0x1df37a=squel[_0x7c6f('0x39')]()[_0x7c6f('0x4d')](_0x7c6f('0x4f'))[_0x7c6f('0x3b')]([_0x7c6f('0x23'),_0x7c6f('0x3d'),_0x7c6f('0x2b'),_0x219869,_0x7c6f('0x3e'),_0x7c6f('0x43')],squel[_0x7c6f('0x3f')]()[_0x7c6f('0x40')](_0x7c6f('0x23'),_0x7c6f('0x23'))['field']('id',_0x7c6f('0x3d'))[_0x7c6f('0x40')](LISTID[_0x7c6f('0x42')](),_0x7c6f('0x2b'))[_0x7c6f('0x40')](_0x3e7764['id']['toString'](),_0x219869)[_0x7c6f('0x40')](_0x7c6f('0x41'),'createdAt')[_0x7c6f('0x40')](_0x7c6f('0x41'),_0x7c6f('0x43'))['from']('cm_contacts')[_0x7c6f('0x46')](_0x7c6f('0x47'))[_0x7c6f('0x46')](_0x7c6f('0x4a'),LISTID['toString']())[_0x7c6f('0x46')](_0x7c6f('0x4e'),squel['str'](hopperContacts))[_0x7c6f('0x46')](_0x7c6f('0x48')))[_0x7c6f('0x42')]();return _0x1df37a;}return db[_0x7c6f('0x50')][_0x7c6f('0x51')]({'where':{'type':_0x7c6f('0x52')},'attributes':['id',_0x7c6f('0x53')],'include':[{'model':db[_0x7c6f('0x54')],'as':_0x7c6f('0x55'),'where':{'id':LISTID}}]})[_0x7c6f('0x32')](function(_0x1d44d6){var _0x2d6f04=[];if(_0x1d44d6){var _0x5c9d10;for(var _0x2e7569=0x0,_0x4630b8;_0x2e7569<_0x1d44d6[_0x7c6f('0x1c')];_0x2e7569+=0x1){_0x4630b8=_0x1d44d6[_0x2e7569][_0x7c6f('0x56')]({'plain':!![]});switch(_0x4630b8[_0x7c6f('0x53')]){case _0x7c6f('0x57'):_0x2d6f04[_0x7c6f('0x33')](db[_0x7c6f('0x58')][_0x7c6f('0x59')](_0x536b27(_0x4630b8,_0x7c6f('0x5a')))[_0x7c6f('0x32')](function(){})[_0x7c6f('0x34')](_0x462c46()));break;case _0x7c6f('0x5b'):_0x2d6f04['push'](db['sequelize'][_0x7c6f('0x59')](_0xd26519(_0x4630b8,_0x7c6f('0x5a')))[_0x7c6f('0x32')](function(){})[_0x7c6f('0x34')](_0x462c46()));break;default:_0x2d6f04[_0x7c6f('0x33')](db[_0x7c6f('0x58')][_0x7c6f('0x59')](_0x3fc1aa(_0x4630b8,_0x7c6f('0x5a')))['then'](function(){})[_0x7c6f('0x34')](_0x462c46()));}}}return _0x2d6f04;})[_0x7c6f('0x5c')]()[_0x7c6f('0x32')](function(){return db[_0x7c6f('0x50')][_0x7c6f('0x51')]({'where':{'type':'outbound'},'attributes':['id'],'include':[{'model':db[_0x7c6f('0x54')],'as':_0x7c6f('0x5d'),'where':{'id':LISTID}}]})['then'](function(_0x2404f7){var _0x5b3024=[];if(_0x2404f7){var _0x34a8df;for(var _0x3ff32d=0x0,_0x52c327;_0x3ff32d<_0x2404f7['length'];_0x3ff32d+=0x1){_0x52c327=_0x2404f7[_0x3ff32d][_0x7c6f('0x56')]({'plain':!![]});_0x5b3024[_0x7c6f('0x33')](db['sequelize'][_0x7c6f('0x59')](_0x4aa61b(_0x52c327,_0x7c6f('0x5a')))[_0x7c6f('0x32')](function(){})[_0x7c6f('0x34')](_0x462c46()));}}return _0x5b3024;})[_0x7c6f('0x5c')]();})[_0x7c6f('0x32')](function(){return db[_0x7c6f('0x5e')][_0x7c6f('0x51')]({'attributes':['id',_0x7c6f('0x53')],'include':[{'model':db[_0x7c6f('0x54')],'as':'Lists','where':{'id':LISTID}}]})[_0x7c6f('0x32')](function(_0x56297c){var _0x50a8bb=[];if(_0x56297c){for(var _0x30cacc=0x0,_0x4292f9;_0x30cacc<_0x56297c[_0x7c6f('0x1c')];_0x30cacc+=0x1){_0x4292f9=_0x56297c[_0x30cacc][_0x7c6f('0x56')]({'plain':!![]});switch(_0x4292f9['dialCheckDuplicateType']){case'always':_0x50a8bb['push'](db[_0x7c6f('0x58')][_0x7c6f('0x59')](_0x536b27(_0x4292f9,'CampaignId'))['then'](function(){})[_0x7c6f('0x34')](_0x462c46()));break;case'onlyIfOpen':_0x50a8bb[_0x7c6f('0x33')](db['sequelize'][_0x7c6f('0x59')](_0xd26519(_0x4292f9,_0x7c6f('0x5f')))[_0x7c6f('0x32')](function(){})[_0x7c6f('0x34')](_0x462c46()));break;default:_0x50a8bb[_0x7c6f('0x33')](db[_0x7c6f('0x58')][_0x7c6f('0x59')](_0x3fc1aa(_0x4292f9,_0x7c6f('0x5f')))[_0x7c6f('0x32')](function(){})['catch'](_0x462c46()));}}}return _0x50a8bb;})['all']();})[_0x7c6f('0x32')](function(){return db[_0x7c6f('0x5e')]['findAll']({'attributes':['id'],'include':[{'model':db['CmList'],'as':_0x7c6f('0x5d'),'where':{'id':LISTID}}]})[_0x7c6f('0x32')](function(_0x294a19){var _0xa71647=[];if(_0x294a19){for(var _0x5d0ce3=0x0,_0x25c38c;_0x5d0ce3<_0x294a19['length'];_0x5d0ce3+=0x1){_0x25c38c=_0x294a19[_0x5d0ce3][_0x7c6f('0x56')]({'plain':!![]});_0xa71647[_0x7c6f('0x33')](db['sequelize'][_0x7c6f('0x59')](_0x4aa61b(_0x25c38c,_0x7c6f('0x5f')))[_0x7c6f('0x32')](function(){})[_0x7c6f('0x34')](_0x462c46()));}}return _0xa71647;})['all']();})[_0x7c6f('0x34')](function(_0x3dc4a8){logger[_0x7c6f('0x15')](_0x7c6f('0x60'),_0x7c6f('0x61'),_0x3dc4a8['message']);});}var processPromises=function(_0x24c840){return BPromise['all'](promises)[_0x7c6f('0x32')](function(_0xb88652){})[_0x7c6f('0x34')](function(_0xf7b783){logger[_0x7c6f('0x15')](_0x7c6f('0x62'),JSON['stringify'](_0xf7b783));})[_0x7c6f('0x63')](function(){socket[_0x7c6f('0x64')](_0x7c6f('0x65')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x24c840){return _0x24c840[_0x7c6f('0x66')]();}});};var endCsv=function(){return BPromise[_0x7c6f('0x67')]()['then'](function(){if(hopperContacts){return checkHopper();}})[_0x7c6f('0x32')](function(){socket['emit'](_0x7c6f('0x65')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0x7c6f('0x68')](FILEPATH);}catch(_0x3bfb41){logger['error'](_0x7c6f('0x69'),JSON[_0x7c6f('0x35')](_0x3bfb41));}finally{process[_0x7c6f('0x6a')](0x0);}});};process['on'](_0x7c6f('0x6b'),function(){logger[_0x7c6f('0x6c')](_0x7c6f('0x6d'));endCsv();});function main(){return BPromise['resolve']()[_0x7c6f('0x32')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0x7c6f('0x13')](',');return db[_0x7c6f('0x30')][_0x7c6f('0x51')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0x7c6f('0x32')](function(_0x3af41e){var _0x4bc076=fs['createReadStream'](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0x7c6f('0x6e')](_0x4bc076,{'header':!![],'skipEmptyLines':!![],'step':function(_0x520bf1,_0x3141f6){total+=0x1;var _0x511e76=total;promises[_0x7c6f('0x33')](checkRow(_0x520bf1,_0x3af41e,_0x511e76)[_0x7c6f('0x32')](function(){success+=0x1;})[_0x7c6f('0x34')](function(_0x34ebd2){if(_0x34ebd2[_0x7c6f('0x15')]){errors+=0x1;delete _0x34ebd2[_0x7c6f('0x15')];}else if(_0x34ebd2[_0x7c6f('0x2e')]){duplicates+=0x1;delete _0x34ebd2['duplicate'];}rows[_0x7c6f('0x33')](_0x34ebd2);}));if(total%0xc8===0x0){_0x3141f6[_0x7c6f('0x6f')]();return processPromises(_0x3141f6);}},'complete':function(){return processPromises()[_0x7c6f('0x32')](function(){logger[_0x7c6f('0x6c')](_0x7c6f('0x70'));endCsv();});},'error':function(_0x42c7ca,_0x2591b6){logger[_0x7c6f('0x6c')](_0x7c6f('0x71'),JSON[_0x7c6f('0x35')](_0x42c7ca));endCsv();}});})[_0x7c6f('0x34')](function(_0x2deab3){logger['error'](_0x7c6f('0x72'),JSON[_0x7c6f('0x35')](_0x2deab3));});}main(); \ No newline at end of file +var _0x679a=['insert','into','cm_hopper','scheduledAt','ContactId','createdAt','updatedAt','select','field','NOW()','toString','from','deletedAt\x20IS\x20NULL','where','phone\x20IS\x20NOT\x20NULL','\x20=\x20?','fromQuery','phone\x20NOT\x20IN\x20(?)','calleridnum','cm_hopper_final','cm_contacts','ListId\x20=\x20?','id\x20IN\x20?','str','cm_hopper_black','VoiceQueue','findAll','outbound','dialCheckDuplicateType','CmList','Lists','get','always','push','sequelize','query','VoiceQueueId','all','BlackLists','CampaignId','cmContact,\x20%s,\x20%s','generalCheckHopper','Error\x20processing\x20rows\x20block:','stringify','finally','resume','Unable\x20to\x20delete\x20temp\x20file:','SIGINT','info','CSV\x20import\x20process\x20stopped!','createReadStream','parse','pause','CSV\x20parsed\x20correctly!','CSV\x20parse\x20error','Error\x20executing\x20contact\x20csv\x20import:','bluebird','util','lodash','squel','papaparse','ioredis','../../../mysqldb','../../../config/environment','../../../config/logger','redis','socket.io-emitter','../../../api/cmContact/cmContact.socket','register','argv','Missing\x20filepath\x20parameter!','undefined','null','Missing\x20binding\x20parameters!','zipObject','split','Missing\x20ListId\x20parameter!','Missing\x20socket_timestamp\x20parameter!','error','contact','index','test','isNil','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','map','join','hasOwnProperty','data','firstName','phone','YYYY-MM-DD','isValid','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','ListId','CompanyId','length','find','duplicate','Duplicate\x20Contact','CmContact','create','keys','then','catch','message','cmContact','checkHopper','inspect'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x679a,0x182));var _0xa679=function(_0x497e1a,_0x39bf4e){_0x497e1a=_0x497e1a-0x0;var _0x6e5280=_0x679a[_0x497e1a];return _0x6e5280;};'use strict';var BPromise=require(_0xa679('0x0'));var util=require(_0xa679('0x1'));var _=require(_0xa679('0x2'));var fs=require('fs');var squel=require(_0xa679('0x3'));var Papa=require(_0xa679('0x4'));var Redis=require(_0xa679('0x5'));var db=require(_0xa679('0x6'))['db'];var config=require(_0xa679('0x7'));var logger=require(_0xa679('0x8'))('api');config[_0xa679('0x9')]=_['defaults'](config[_0xa679('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0xa679('0xa'))(new Redis(config[_0xa679('0x9')]));require(_0xa679('0xb'))[_0xa679('0xc')](socket);try{if(!process[_0xa679('0xd')][0x2]||process[_0xa679('0xd')][0x2]==='undefined'||process[_0xa679('0xd')][0x2]==='null'){throw new Error(_0xa679('0xe'));}var FILEPATH=process[_0xa679('0xd')][0x2];if(!process[_0xa679('0xd')][0x3]||process[_0xa679('0xd')][0x3]===_0xa679('0xf')||process['argv'][0x3]===_0xa679('0x10')||!process['argv'][0x4]||process['argv'][0x4]==='undefined'||process[_0xa679('0xd')][0x4]===_0xa679('0x10')){throw new Error(_0xa679('0x11'));}var FIELDS=_[_0xa679('0x12')](process[_0xa679('0xd')][0x3][_0xa679('0x13')](','),process[_0xa679('0xd')][0x4][_0xa679('0x13')](','));if(!process['argv'][0x5]||process[_0xa679('0xd')][0x5]==='undefined'||process['argv'][0x5]==='null'){throw new Error(_0xa679('0x14'));}var LISTID=process[_0xa679('0xd')][0x5];var COMPANYID=process[_0xa679('0xd')][0x6]&&process[_0xa679('0xd')][0x6]!==_0xa679('0xf')&&process['argv'][0x6]!==_0xa679('0x10')?process['argv'][0x6]:null;var DUPLICATES=process[_0xa679('0xd')][0x7]&&process[_0xa679('0xd')][0x7]!=='undefined'&&process['argv'][0x7]!==_0xa679('0x10')?process[_0xa679('0xd')][0x7]:null;if(!process[_0xa679('0xd')][0x8]||process[_0xa679('0xd')][0x8]===_0xa679('0xf')||process['argv'][0x8]===_0xa679('0x10')){throw new Error(_0xa679('0x15'));}var SOCKET_TIMESTAMP=process[_0xa679('0xd')][0x8];}catch(_0x5ca160){logger[_0xa679('0x16')](_0x5ca160);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(_0x371cda,_0x10a24a,_0x1363eb,_0xd410e5){var _0x2d8561={'message':_0x10a24a};_0x2d8561[_0x371cda]=!![];if(_0x1363eb){_0x2d8561[_0xa679('0x17')]=_0x1363eb;}if(_0xd410e5){_0x2d8561[_0xa679('0x18')]=_0xd410e5;}return _0x2d8561;}function isEmail(_0x2208a2){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))*$/[_0xa679('0x19')](_0x2208a2);}function checkRow(_0x2b8a57,_0x286801,_0x44668e){return new BPromise(function(_0x1067ea,_0x15e926){if(_[_0xa679('0x1a')](_0x2b8a57)){return _0x15e926(handleCheckRowError(_0xa679('0x16'),_0xa679('0x1b'),null,_0x44668e));}if(_0x2b8a57[_0xa679('0x1c')]&&_0x2b8a57[_0xa679('0x1c')]['length']){var _0x3d9dd5=_[_0xa679('0x1d')](_0x2b8a57[_0xa679('0x1c')],'message')[_0xa679('0x1e')](';');return _0x15e926(handleCheckRowError(_0xa679('0x16'),_0x3d9dd5,null,_0x44668e));}var _0x5cb796={};for(var _0x4ea2fb in FIELDS){if(FIELDS[_0xa679('0x1f')](_0x4ea2fb)&&FIELDS[_0x4ea2fb]){_0x5cb796[_0x4ea2fb]=_0x2b8a57['data'][0x0][FIELDS[_0x4ea2fb]]||_0x2b8a57[_0xa679('0x20')][0x0]['\ufeff'+FIELDS[_0x4ea2fb]];}}if(!_0x5cb796[_0xa679('0x21')]){return _0x15e926(handleCheckRowError(_0xa679('0x16'),'firstName\x20not\x20specified!',null,_0x44668e));}if(!_0x5cb796[_0xa679('0x22')]){return _0x15e926(handleCheckRowError(_0xa679('0x16'),'phone\x20not\x20specified!',null,_0x44668e));}if(_0x5cb796['birthDate']){var _0x2011bd=moment(_0x5cb796['birthDate'],_0xa679('0x23'));if(!_0x2011bd[_0xa679('0x24')]()){return _0x15e926(handleCheckRowError('error',_0xa679('0x25'),null,_0x44668e));}}if(_0x5cb796[_0xa679('0x26')]){if(!isEmail(_0x5cb796[_0xa679('0x26')])){return _0x15e926(handleCheckRowError(_0xa679('0x16'),'email\x20format\x20is\x20not\x20valid!',null,_0x44668e));}}_0x5cb796[_0xa679('0x27')]=LISTID;_0x5cb796[_0xa679('0x28')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0xa679('0x29')]&&_0x286801){var _0x5c8c66={};for(var _0x5596d9=0x0,_0x58abd7=DUPLICATES[_0xa679('0x29')];_0x5596d9<_0x58abd7;_0x5596d9+=0x1){_0x5c8c66[DUPLICATES[_0x5596d9]]=_0x5cb796[DUPLICATES[_0x5596d9]];}var _0x3191d1=_[_0xa679('0x2a')](_0x286801,_0x5c8c66);if(_0x3191d1){return _0x15e926(handleCheckRowError(_0xa679('0x2b'),_0xa679('0x2c'),_0x3191d1,_0x44668e));}}return db[_0xa679('0x2d')][_0xa679('0x2e')](_0x5cb796,{'raw':!![],'hooks':![],'fields':_[_0xa679('0x2f')](_0x5cb796)})[_0xa679('0x30')](function(_0x1bd3fe){if(DUPLICATES&&DUPLICATES[_0xa679('0x29')]&&_0x286801){_0x286801['push'](_['pick'](_0x5cb796,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x1bd3fe['id'];return _0x1067ea();})[_0xa679('0x31')](function(_0x3d103c){return _0x15e926(handleCheckRowError(_0xa679('0x16'),'Error\x20while\x20creating\x20contact:\x20'+(_0x3d103c[_0xa679('0x32')]||JSON['stringify'](_0x3d103c)),null,_0x44668e));});});}function checkHopper(){function _0x3f3931(){return function(_0x337379){logger[_0xa679('0x16')](_0xa679('0x33'),_0xa679('0x34'),util[_0xa679('0x35')](_0x337379,{'showHidden':![],'depth':null}));};}var _0xa97d54=function(_0x3d8f73,_0x50c62e){var _0x39eb55=squel[_0xa679('0x36')]()[_0xa679('0x37')](_0xa679('0x38'))['fromQuery']([_0xa679('0x22'),_0xa679('0x39'),_0xa679('0x3a'),_0xa679('0x27'),_0x50c62e,_0xa679('0x3b'),_0xa679('0x3c')],squel[_0xa679('0x3d')]()[_0xa679('0x3e')](_0xa679('0x22'),_0xa679('0x22'))[_0xa679('0x3e')](_0xa679('0x3f'),_0xa679('0x39'))['field']('id','ContactId')['field'](LISTID['toString'](),_0xa679('0x27'))[_0xa679('0x3e')](_0x3d8f73['id'][_0xa679('0x40')](),_0x50c62e)[_0xa679('0x3e')](_0xa679('0x3f'),_0xa679('0x3b'))['field'](_0xa679('0x3f'),_0xa679('0x3c'))[_0xa679('0x41')]('cm_contacts')['where'](_0xa679('0x42'))[_0xa679('0x43')]('ListId\x20=\x20?',LISTID[_0xa679('0x40')]())['where'](_0xa679('0x44'))['where']('phone\x20NOT\x20IN\x20(?)',squel[_0xa679('0x3d')]()['field']('phone')[_0xa679('0x41')](_0xa679('0x38'))['where'](_0x50c62e+_0xa679('0x45'),_0x3d8f73['id']['toString']())))[_0xa679('0x40')]();return _0x39eb55;};var _0x2be61b=function(_0xc88ba7,_0x32d457){var _0x328840=squel[_0xa679('0x36')]()[_0xa679('0x37')](_0xa679('0x38'))[_0xa679('0x46')]([_0xa679('0x22'),_0xa679('0x39'),_0xa679('0x3a'),_0xa679('0x27'),_0x32d457,_0xa679('0x3b'),'updatedAt'],squel[_0xa679('0x3d')]()[_0xa679('0x3e')](_0xa679('0x22'),_0xa679('0x22'))['field'](_0xa679('0x3f'),_0xa679('0x39'))[_0xa679('0x3e')]('id',_0xa679('0x3a'))[_0xa679('0x3e')](LISTID['toString'](),'ListId')[_0xa679('0x3e')](_0xc88ba7['id'][_0xa679('0x40')](),_0x32d457)[_0xa679('0x3e')]('NOW()',_0xa679('0x3b'))[_0xa679('0x3e')](_0xa679('0x3f'),_0xa679('0x3c'))[_0xa679('0x41')]('cm_contacts')['where'](_0xa679('0x42'))[_0xa679('0x43')]('ListId\x20=\x20?',LISTID[_0xa679('0x40')]())[_0xa679('0x43')]('id\x20IN\x20?',squel['str'](hopperContacts))['where'](_0xa679('0x44'))[_0xa679('0x43')](_0xa679('0x47'),squel[_0xa679('0x3d')]()[_0xa679('0x3e')](_0xa679('0x48'))[_0xa679('0x41')](_0xa679('0x49'))[_0xa679('0x43')](_0x32d457+_0xa679('0x45'),_0xc88ba7['id'][_0xa679('0x40')]()))[_0xa679('0x43')](_0xa679('0x47'),squel[_0xa679('0x3d')]()[_0xa679('0x3e')](_0xa679('0x22'))[_0xa679('0x41')](_0xa679('0x38'))['where'](_0x32d457+_0xa679('0x45'),_0xc88ba7['id'][_0xa679('0x40')]())))[_0xa679('0x40')]();return _0x328840;};function _0x3ce26b(_0x1624fd,_0x1ab3be){var _0x408020=squel[_0xa679('0x36')]()[_0xa679('0x37')](_0xa679('0x38'))[_0xa679('0x46')]([_0xa679('0x22'),_0xa679('0x39'),_0xa679('0x3a'),'ListId',_0x1ab3be,_0xa679('0x3b'),_0xa679('0x3c')],squel[_0xa679('0x3d')]()[_0xa679('0x3e')]('phone','phone')[_0xa679('0x3e')](_0xa679('0x3f'),_0xa679('0x39'))[_0xa679('0x3e')]('id','ContactId')[_0xa679('0x3e')](LISTID[_0xa679('0x40')](),_0xa679('0x27'))[_0xa679('0x3e')](_0x1624fd['id']['toString'](),_0x1ab3be)['field'](_0xa679('0x3f'),'createdAt')[_0xa679('0x3e')](_0xa679('0x3f'),_0xa679('0x3c'))[_0xa679('0x41')](_0xa679('0x4a'))['where']('deletedAt\x20IS\x20NULL')[_0xa679('0x43')](_0xa679('0x4b'),LISTID['toString']())[_0xa679('0x43')](_0xa679('0x4c'),squel[_0xa679('0x4d')](hopperContacts))[_0xa679('0x43')](_0xa679('0x44')))['toString']();return _0x408020;}function _0x3f0cb7(_0x2b02fa,_0x31f7d0){var _0x288a1d=squel[_0xa679('0x36')]()[_0xa679('0x37')](_0xa679('0x4e'))[_0xa679('0x46')]([_0xa679('0x22'),'ContactId',_0xa679('0x27'),_0x31f7d0,_0xa679('0x3b'),_0xa679('0x3c')],squel[_0xa679('0x3d')]()[_0xa679('0x3e')](_0xa679('0x22'),_0xa679('0x22'))[_0xa679('0x3e')]('id',_0xa679('0x3a'))[_0xa679('0x3e')](LISTID[_0xa679('0x40')](),_0xa679('0x27'))[_0xa679('0x3e')](_0x2b02fa['id'][_0xa679('0x40')](),_0x31f7d0)['field'](_0xa679('0x3f'),_0xa679('0x3b'))[_0xa679('0x3e')](_0xa679('0x3f'),'updatedAt')[_0xa679('0x41')]('cm_contacts')['where'](_0xa679('0x42'))[_0xa679('0x43')](_0xa679('0x4b'),LISTID[_0xa679('0x40')]())[_0xa679('0x43')](_0xa679('0x4c'),squel[_0xa679('0x4d')](hopperContacts))[_0xa679('0x43')](_0xa679('0x44')))[_0xa679('0x40')]();return _0x288a1d;}return db[_0xa679('0x4f')][_0xa679('0x50')]({'where':{'type':_0xa679('0x51')},'attributes':['id',_0xa679('0x52')],'include':[{'model':db[_0xa679('0x53')],'as':_0xa679('0x54'),'where':{'id':LISTID}}]})[_0xa679('0x30')](function(_0x5b9eb2){var _0x5e9661=[];if(_0x5b9eb2){var _0x2eef04;for(var _0x38fc32=0x0,_0x1bb664;_0x38fc32<_0x5b9eb2[_0xa679('0x29')];_0x38fc32+=0x1){_0x1bb664=_0x5b9eb2[_0x38fc32][_0xa679('0x55')]({'plain':!![]});switch(_0x1bb664[_0xa679('0x52')]){case _0xa679('0x56'):_0x5e9661[_0xa679('0x57')](db['sequelize']['query'](_0x2be61b(_0x1bb664,'VoiceQueueId'))[_0xa679('0x30')](function(){})[_0xa679('0x31')](_0x3f3931()));break;case'onlyIfOpen':_0x5e9661[_0xa679('0x57')](db[_0xa679('0x58')][_0xa679('0x59')](_0xa97d54(_0x1bb664,_0xa679('0x5a')))[_0xa679('0x30')](function(){})[_0xa679('0x31')](_0x3f3931()));break;default:_0x5e9661[_0xa679('0x57')](db[_0xa679('0x58')][_0xa679('0x59')](_0x3ce26b(_0x1bb664,_0xa679('0x5a')))['then'](function(){})[_0xa679('0x31')](_0x3f3931()));}}}return _0x5e9661;})[_0xa679('0x5b')]()['then'](function(){return db['VoiceQueue'][_0xa679('0x50')]({'where':{'type':_0xa679('0x51')},'attributes':['id'],'include':[{'model':db[_0xa679('0x53')],'as':_0xa679('0x5c'),'where':{'id':LISTID}}]})[_0xa679('0x30')](function(_0x5aff26){var _0x5664a2=[];if(_0x5aff26){var _0x52dae2;for(var _0x28d026=0x0,_0x5b90d2;_0x28d026<_0x5aff26[_0xa679('0x29')];_0x28d026+=0x1){_0x5b90d2=_0x5aff26[_0x28d026][_0xa679('0x55')]({'plain':!![]});_0x5664a2['push'](db[_0xa679('0x58')][_0xa679('0x59')](_0x3f0cb7(_0x5b90d2,_0xa679('0x5a')))[_0xa679('0x30')](function(){})[_0xa679('0x31')](_0x3f3931()));}}return _0x5664a2;})[_0xa679('0x5b')]();})['then'](function(){return db['Campaign'][_0xa679('0x50')]({'attributes':['id',_0xa679('0x52')],'include':[{'model':db[_0xa679('0x53')],'as':'Lists','where':{'id':LISTID}}]})[_0xa679('0x30')](function(_0x1bd3fa){var _0x5bb349=[];if(_0x1bd3fa){for(var _0x22a4f5=0x0,_0x15e284;_0x22a4f5<_0x1bd3fa[_0xa679('0x29')];_0x22a4f5+=0x1){_0x15e284=_0x1bd3fa[_0x22a4f5][_0xa679('0x55')]({'plain':!![]});switch(_0x15e284[_0xa679('0x52')]){case _0xa679('0x56'):_0x5bb349[_0xa679('0x57')](db['sequelize']['query'](_0x2be61b(_0x15e284,_0xa679('0x5d')))[_0xa679('0x30')](function(){})[_0xa679('0x31')](_0x3f3931()));break;case'onlyIfOpen':_0x5bb349[_0xa679('0x57')](db[_0xa679('0x58')][_0xa679('0x59')](_0xa97d54(_0x15e284,_0xa679('0x5d')))[_0xa679('0x30')](function(){})['catch'](_0x3f3931()));break;default:_0x5bb349['push'](db[_0xa679('0x58')][_0xa679('0x59')](_0x3ce26b(_0x15e284,_0xa679('0x5d')))[_0xa679('0x30')](function(){})['catch'](_0x3f3931()));}}}return _0x5bb349;})[_0xa679('0x5b')]();})[_0xa679('0x30')](function(){return db['Campaign'][_0xa679('0x50')]({'attributes':['id'],'include':[{'model':db['CmList'],'as':_0xa679('0x5c'),'where':{'id':LISTID}}]})[_0xa679('0x30')](function(_0x305de6){var _0xc6afd=[];if(_0x305de6){for(var _0x1cd1f9=0x0,_0x31a639;_0x1cd1f9<_0x305de6[_0xa679('0x29')];_0x1cd1f9+=0x1){_0x31a639=_0x305de6[_0x1cd1f9][_0xa679('0x55')]({'plain':!![]});_0xc6afd[_0xa679('0x57')](db[_0xa679('0x58')][_0xa679('0x59')](_0x3f0cb7(_0x31a639,_0xa679('0x5d')))[_0xa679('0x30')](function(){})['catch'](_0x3f3931()));}}return _0xc6afd;})['all']();})['catch'](function(_0x19368d){logger[_0xa679('0x16')](_0xa679('0x5e'),_0xa679('0x5f'),_0x19368d[_0xa679('0x32')]);});}var processPromises=function(_0x524391){return BPromise[_0xa679('0x5b')](promises)[_0xa679('0x30')](function(_0x15f2cc){})[_0xa679('0x31')](function(_0x352b46){logger[_0xa679('0x16')](_0xa679('0x60'),JSON[_0xa679('0x61')](_0x352b46));})[_0xa679('0x62')](function(){socket['emit']('contact:csv_'+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x524391){return _0x524391[_0xa679('0x63')]();}});};var endCsv=function(){return BPromise['resolve']()[_0xa679('0x30')](function(){if(hopperContacts){return checkHopper();}})[_0xa679('0x30')](function(){socket['emit']('contact:csv_'+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs['unlinkSync'](FILEPATH);}catch(_0x5802b7){logger[_0xa679('0x16')](_0xa679('0x64'),JSON[_0xa679('0x61')](_0x5802b7));}finally{process['exit'](0x0);}});};process['on'](_0xa679('0x65'),function(){logger[_0xa679('0x66')](_0xa679('0x67'));endCsv();});function main(){return BPromise['resolve']()[_0xa679('0x30')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES['split'](',');return db[_0xa679('0x2d')][_0xa679('0x50')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})['then'](function(_0x483447){var _0x36f4fa=fs[_0xa679('0x68')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0xa679('0x69')](_0x36f4fa,{'header':!![],'skipEmptyLines':!![],'step':function(_0x3b5899,_0x2e3d99){total+=0x1;var _0x1fb039=total;promises[_0xa679('0x57')](checkRow(_0x3b5899,_0x483447,_0x1fb039)[_0xa679('0x30')](function(){success+=0x1;})[_0xa679('0x31')](function(_0x526f37){if(_0x526f37['error']){errors+=0x1;delete _0x526f37[_0xa679('0x16')];}else if(_0x526f37[_0xa679('0x2b')]){duplicates+=0x1;delete _0x526f37[_0xa679('0x2b')];}rows[_0xa679('0x57')](_0x526f37);}));if(total%0xc8===0x0){_0x2e3d99[_0xa679('0x6a')]();return processPromises(_0x2e3d99);}},'complete':function(){return processPromises()[_0xa679('0x30')](function(){logger[_0xa679('0x66')](_0xa679('0x6b'));endCsv();});},'error':function(_0x18d6a3,_0x3bcaa0){logger['info'](_0xa679('0x6c'),JSON['stringify'](_0x18d6a3));endCsv();}});})[_0xa679('0x31')](function(_0x4cf26d){logger[_0xa679('0x16')](_0xa679('0x6d'),JSON[_0xa679('0x61')](_0x4cf26d));});}main(); \ No newline at end of file diff --git a/server/components/import/cm/csv2.js b/server/components/import/cm/csv2.js index 47dbc97..608dfa3 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 _0xa7b7=['ListId\x20=\x20?','cm_hopper.id','cm_contact_has_items.item','cm_contact_has_items.OrderBy','cm_contact_has_items.createdAt','cm_contacts.id\x20=\x20cm_hopper.ContactId','cm_contact_has_items','cm_hopper.ListId\x20=\x20?','keys','CompanyId',')\x20NOT\x20IN\x20?','deletedAt\x20IS\x20NULL','id\x20IN\x20?','MIN(id)','min_id','group','info','Received\x20SIGINT','error','message','exit','errors','code','sequelize','query','spread','catch','campaigns.id','campaigns.dialTimezone','campaigns','campaigns_has_cm_lists','campaigns_has_cm_lists.CmListId=','voice_queues.id','voice_queues.dialTimezone','voice_queues','voice_queues.id\x20=\x20voice_queues_has_cm_lists.VoiceQueueId','voice_queues_has_cm_lists.CmListId=','dialTimezone','utcOffset','set','offset','main','stringify','binding','clone','socket_timestamp','root','server/files/tmp','.csv','ContactItemType','name','_description','rows','data','find','hasOwnProperty','trim','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNaN','isNumber','includes','agent\x20not\x20exists','email','dateOfBirth','YYYY-MM-DD','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','firstName','\x20not\x20specified','itemTypeId','description','replace','SystemRow','Abort\x20parser','step','duplicates','cm_contacts_','CREATE\x20TABLE\x20','\x20LIKE\x20cm_contacts;','campaigns_','(id\x20int,dialTimezone\x20varchar(255),offset\x20int);','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','orderBy','voice_queues_has_cm_lists','VoiceQueueId','voice_queues_has_cm_blacklists','CampaignId','campaigns_has_cm_blacklists','each','finish','affectedRows','emit','contact:import:','unlink','complete','argv','arguments\x20\x20\x20','existsSync','parse','firstName\x20is\x20mandatory','body\x20id\x20mandatory','map','No\x20agent\x20available','SIGINT','uncaughtException','path','lodash','papaparse','squel','../../../config/logger','import','defaults','redis','localhost','socket.io-emitter','format','YYYY-MM-DD\x20HH:mm:ss','test','select','field','from','.id\x20=\x20','where','\x20=\x20','join','findAll','push','then','split','length','all','isNil','filter','CmContactHasItem','update','updated','create','PHONE','cm_contacts.phone','cm_contacts.id','cm_contacts.ListId','cm_contacts.priority','insert','into','cm_hopper','fromQuery','scheduledat','ListId','updatedAt','priority','recallme','fields','cm_contacts.ListId\x20=\x20','.CmListId','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','\x22onlyIfOpen\x22','toString','cm_contacts.createdAt','cm_contacts.updatedAt','cm_hopper_black','phone','ContactId','cm_contacts','.offset-cm_contacts.utcOffset\x20minute)','cm_contacts.UserId','createdAt','UserId'];(function(_0x256720,_0x1195e9){var _0x219ac6=function(_0x1901d0){while(--_0x1901d0){_0x256720['push'](_0x256720['shift']());}};_0x219ac6(++_0x1195e9);}(_0xa7b7,0x119));var _0x7a7b=function(_0xd69340,_0xcb72ae){_0xd69340=_0xd69340-0x0;var _0x3a54b5=_0xa7b7[_0xd69340];return _0x3a54b5;};'use strict';var fs=require('fs');var path=require(_0x7a7b('0x0'));var _=require(_0x7a7b('0x1'));var Papa=require(_0x7a7b('0x2'));var util=require('util');var BPromise=require('bluebird');var moment=require('moment');var squel=require(_0x7a7b('0x3'));var Redis=require('ioredis');var db=require('../../../mysqldb')['db'];var config=require('../../../config/environment');var shared=require('../../../config/environment/shared');var logger=require(_0x7a7b('0x4'))(_0x7a7b('0x5'));config['redis']=_[_0x7a7b('0x6')](config[_0x7a7b('0x7')],{'host':_0x7a7b('0x8'),'port':0x18eb});var socket=require(_0x7a7b('0x9'))(new Redis(config['redis']));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var orderBy=0x0;var stopped=![];var NOW=moment()[_0x7a7b('0xa')](_0x7a7b('0xb'));var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];var tmp_voice_queues;var tmp_campaigns;var tzOffset=0x0;var hasTZ;var NOW=moment()[_0x7a7b('0xa')](_0x7a7b('0xb'));function isEmail(_0x7212b4){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))*$/[_0x7a7b('0xc')](_0x7212b4);}function selectNotIn(_0x4a42be,_0x2ba087,_0x3b3f0d,_0x4e315a,_0x2c28f8){return squel[_0x7a7b('0xd')]()[_0x7a7b('0xe')]('phone')[_0x7a7b('0xf')](_0x4e315a)['join'](_0x2ba087,null,_0x2ba087+_0x7a7b('0x10')+_0x4e315a+'.'+_0x3b3f0d)[_0x7a7b('0x11')](_0x4e315a+'.'+_0x3b3f0d+_0x7a7b('0x12')+_0x4a42be+'.'+_0x3b3f0d)[_0x7a7b('0x11')](_0x2ba087+'.dialCheckDuplicateType\x20IN\x20('+_0x2c28f8[_0x7a7b('0x13')]()+')');}function handleAdditionalPhones(){return new Promise(function(_0x5b3153,_0x566681){promisesAdditionalPhones=[];return db['CmContact'][_0x7a7b('0x14')]({'raw':!![],'attributes':['id','AdditionalPhones'],'where':{'createdAt':NOW,'AdditionalPhones':{'$ne':null}}})['then'](function(_0x560045){if(_0x560045!==null){var _0x5bb2b2=[];for(var _0x7ee657=0x0;_0x7ee657<_0x560045['length'];_0x7ee657++){var _0x1162f3=_0x560045[_0x7ee657];_0x5bb2b2[_0x7a7b('0x15')](insertAdditionalPhones(_0x1162f3));}}Promise['all'](_0x5bb2b2)[_0x7a7b('0x16')](function(){_0x5b3153({'val':0x1});});});});}function insertAdditionalPhones(_0x54e341){return new Promise(function(_0x3ea5ab,_0x33f0b5){var _0x2f7722=_0x54e341['AdditionalPhones'];var _0x3ba003=_0x2f7722[_0x7a7b('0x17')](';');var _0xbffa92=[];orderBy=0x0;for(var _0x4b58c8=0x0;_0x4b58c8<_0x3ba003[_0x7a7b('0x18')];_0x4b58c8++){_0xbffa92['push'](splitAdditionalPhone(_0x54e341['id'],_0x3ba003[_0x4b58c8]));}Promise[_0x7a7b('0x19')](_0xbffa92)['then'](function(){_0x3ea5ab({'val':_0x3ba003['length']});});});}function splitAdditionalPhone(_0x244a06,_0x5ae6e4){return new Promise(function(_0x1551d3,_0x34aa1f){var _0xa8fa46=_0x5ae6e4[_0x7a7b('0x17')](':');var _0x4dc965=_0xa8fa46[0x0];var _0x356862=_0xa8fa46[0x1];if(!_[_0x7a7b('0x1a')](_0x356862)){var _0x1a1194=_0x356862[_0x7a7b('0x17')]('|');var _0x255544=[];for(var _0xdcaca6=0x0;_0xdcaca6<_0x1a1194[_0x7a7b('0x18')];_0xdcaca6++){if(_0x1a1194[_0xdcaca6]!==''){var _0x13c393=_[_0x7a7b('0x1b')](promisesAdditionalPhones,{'contactId':_0x244a06,'phone':_0x1a1194[_0xdcaca6]});if(_0x13c393[_0x7a7b('0x18')]==0x0){orderBy++;promisesAdditionalPhones[_0x7a7b('0x15')]({'contactId':_0x244a06,'contactTypeId':_0x4dc965,'phone':_0x1a1194[_0xdcaca6],'orderBy':orderBy});}}}_0x1551d3({'ok':0x1});}else _0x1551d3({'res':0x0});});}function createAdditionalPhone(_0x153dd2,_0x507910,_0x3f5715,_0x5c416d){var _0x4e14c2='';var _0x3cb0bf='';var _0x1917aa=_0x3f5715[_0x7a7b('0x17')]('§');_0x4e14c2=_0x1917aa[0x0];if(_0x1917aa[_0x7a7b('0x18')]==0x2)_0x3cb0bf=_0x1917aa[0x1];return new Promise(function(_0x16f4e1,_0x3e6c65){return db[_0x7a7b('0x1c')]['findOne']({'where':{'CmContactId':_0x153dd2,'item':_0x4e14c2}})['then'](function(_0x34ea57){if(_0x34ea57){return db['CmContactHasItem'][_0x7a7b('0x1d')]({'ItemTypeId':_0x507910,'description':_0x3cb0bf,'OrderBy':_0x5c416d},{'where':{'CmContactId':_0x153dd2,'item':_0x4e14c2}})[_0x7a7b('0x16')](function(_0x4fcf80){_0x16f4e1({'res':_0x7a7b('0x1e')});});}else{return db[_0x7a7b('0x1c')][_0x7a7b('0x1f')]({'CmContactId':_0x153dd2,'item':_0x4e14c2,'description':_0x3cb0bf,'ItemTypeId':_0x507910,'OrderBy':_0x5c416d,'ItemClass':_0x7a7b('0x20')})[_0x7a7b('0x16')](function(_0x3e9a6f){_0x16f4e1({'res':'inserted'});});}});});}function insertCmHopper(_0x30f1a5,_0x5beb02,_0x4c1f84,_0x2868f3,_0x1b9186){var _0x3b5c30=[_0x7a7b('0x21'),'cm_contacts.scheduledat',_0x7a7b('0x22'),_0x7a7b('0x23'),_0x5beb02+'.'+_0x2868f3,'cm_contacts.createdAt','cm_contacts.updatedAt',_0x7a7b('0x24'),'cm_contacts.UserId','\x22'+_0x1b9186+'\x22'];return squel[_0x7a7b('0x25')]()[_0x7a7b('0x26')](_0x7a7b('0x27'))[_0x7a7b('0x28')](['phone',_0x7a7b('0x29'),'ContactId',_0x7a7b('0x2a'),_0x2868f3,'createdAt',_0x7a7b('0x2b'),_0x7a7b('0x2c'),'UserId',_0x7a7b('0x2d')],squel[_0x7a7b('0xd')]()[_0x7a7b('0x2e')](_0x3b5c30)[_0x7a7b('0xf')](_0x5beb02)[_0x7a7b('0x13')]('cm_contacts',null,_0x7a7b('0x2f')+_0x5beb02+_0x7a7b('0x30'))[_0x7a7b('0x13')](_0x4c1f84,null,_0x4c1f84+_0x7a7b('0x10')+_0x5beb02+'.'+_0x2868f3)['where'](_0x5beb02+_0x7a7b('0x31'),_0x30f1a5)[_0x7a7b('0x11')](_0x7a7b('0x32'),NOW)[_0x7a7b('0x11')](_0x7a7b('0x33'),selectNotIn(_0x5beb02,_0x4c1f84,_0x2868f3,'cm_hopper',[_0x7a7b('0x34'),_0x7a7b('0x35')]))['where'](_0x7a7b('0x33'),selectNotIn(_0x5beb02,_0x4c1f84,_0x2868f3,_0x7a7b('0x27'),[_0x7a7b('0x34')])))[_0x7a7b('0x36')]();}function insertCmHopperBlack(_0x40078d,_0x56f852,_0x3e5217,_0x50ba17){var _0x5f8fbf=[_0x7a7b('0x21'),_0x7a7b('0x22'),_0x7a7b('0x23'),_0x56f852+'.'+_0x50ba17,_0x7a7b('0x37'),_0x7a7b('0x38')];return squel[_0x7a7b('0x25')]()['into'](_0x7a7b('0x39'))[_0x7a7b('0x28')]([_0x7a7b('0x3a'),_0x7a7b('0x3b'),_0x7a7b('0x2a'),_0x50ba17,'createdAt',_0x7a7b('0x2b')],squel[_0x7a7b('0xd')]()[_0x7a7b('0x2e')](_0x5f8fbf)[_0x7a7b('0xf')](_0x56f852)['join'](_0x7a7b('0x3c'),null,'cm_contacts.ListId\x20=\x20'+_0x56f852+_0x7a7b('0x30'))[_0x7a7b('0x13')](_0x3e5217,null,_0x3e5217+_0x7a7b('0x10')+_0x56f852+'.'+_0x50ba17)[_0x7a7b('0x11')](_0x56f852+_0x7a7b('0x31'),_0x40078d)['where'](_0x7a7b('0x32'),NOW)[_0x7a7b('0x11')](_0x7a7b('0x33'),squel[_0x7a7b('0xd')]()[_0x7a7b('0xe')](_0x7a7b('0x3a'))[_0x7a7b('0xf')](_0x7a7b('0x39'))['where']('ListId\x20=\x20?',_0x40078d)[_0x7a7b('0x11')](_0x50ba17+_0x7a7b('0x12')+_0x56f852+'.'+_0x50ba17)))[_0x7a7b('0x36')]();}function insertTzCmHopper(_0x33e682,_0x11e331,_0x28af05,_0x47e059,_0x2d38c5,_0x13b079){var _0x35327d=['cm_contacts.phone','date_add(cm_contacts.scheduledat,interval\x20'+_0x13b079+_0x7a7b('0x3d'),_0x7a7b('0x22'),_0x7a7b('0x23'),_0x11e331+'.'+_0x47e059,'cm_contacts.createdAt',_0x7a7b('0x38'),'cm_contacts.priority',_0x7a7b('0x3e'),'\x22'+_0x2d38c5+'\x22'];var _0x34e20f=squel[_0x7a7b('0x25')]()[_0x7a7b('0x26')]('cm_hopper')[_0x7a7b('0x28')](['phone',_0x7a7b('0x29'),_0x7a7b('0x3b'),'ListId',_0x47e059,_0x7a7b('0x3f'),_0x7a7b('0x2b'),_0x7a7b('0x2c'),_0x7a7b('0x40'),_0x7a7b('0x2d')],squel[_0x7a7b('0xd')]()[_0x7a7b('0x2e')](_0x35327d)[_0x7a7b('0xf')](_0x11e331)[_0x7a7b('0x13')]('cm_contacts',null,_0x7a7b('0x2f')+_0x11e331+_0x7a7b('0x30'))['join'](_0x28af05,null,_0x28af05+'.id\x20=\x20'+_0x11e331+'.'+_0x47e059)['join'](_0x13b079,null,_0x13b079+_0x7a7b('0x10')+_0x11e331+'.'+_0x47e059)['where'](_0x11e331+_0x7a7b('0x31'),_0x33e682)[_0x7a7b('0x11')](_0x7a7b('0x32'),NOW)[_0x7a7b('0x11')](_0x7a7b('0x33'),selectNotIn(_0x11e331,_0x28af05,_0x47e059,'cm_hopper',[_0x7a7b('0x34'),'\x22onlyIfOpen\x22']))[_0x7a7b('0x11')](_0x7a7b('0x33'),selectNotIn(_0x11e331,_0x28af05,_0x47e059,_0x7a7b('0x27'),[_0x7a7b('0x34')])))[_0x7a7b('0x36')]();return _0x34e20f;}function insertTzCmHopperBlack(_0x47dc15,_0x20ec84,_0x5b0c5f,_0x4622ec){var _0x1fe928=[_0x7a7b('0x21'),_0x7a7b('0x22'),_0x7a7b('0x23'),_0x20ec84+'.'+_0x4622ec,'cm_contacts.createdAt',_0x7a7b('0x38')];return squel[_0x7a7b('0x25')]()[_0x7a7b('0x26')](_0x7a7b('0x39'))[_0x7a7b('0x28')](['phone',_0x7a7b('0x3b'),_0x7a7b('0x2a'),_0x4622ec,_0x7a7b('0x3f'),_0x7a7b('0x2b')],squel[_0x7a7b('0xd')]()[_0x7a7b('0x2e')](_0x1fe928)[_0x7a7b('0xf')](_0x20ec84)['join'](_0x7a7b('0x3c'),null,_0x7a7b('0x2f')+_0x20ec84+_0x7a7b('0x30'))['join'](_0x5b0c5f,null,_0x5b0c5f+_0x7a7b('0x10')+_0x20ec84+'.'+_0x4622ec)[_0x7a7b('0x11')](_0x20ec84+_0x7a7b('0x31'),_0x47dc15)[_0x7a7b('0x11')](_0x7a7b('0x32'),NOW)['where'](_0x7a7b('0x33'),squel[_0x7a7b('0xd')]()[_0x7a7b('0xe')](_0x7a7b('0x3a'))[_0x7a7b('0xf')]('cm_hopper_black')[_0x7a7b('0x11')](_0x7a7b('0x41'),_0x47dc15)[_0x7a7b('0x11')](_0x4622ec+_0x7a7b('0x12')+_0x20ec84+'.'+_0x4622ec)))[_0x7a7b('0x36')]();}function insertCmHopperAdditionalPhones(_0x4ea0a7){var _0x3aced1=[_0x7a7b('0x42'),_0x7a7b('0x43'),_0x7a7b('0x44'),_0x7a7b('0x45'),'cm_contact_has_items.updatedAt'];return squel[_0x7a7b('0x25')]()[_0x7a7b('0x26')]('cm_hopper_additional_phones')[_0x7a7b('0x28')](['CmHopperId',_0x7a7b('0x3a'),'OrderBy',_0x7a7b('0x3f'),_0x7a7b('0x2b')],squel[_0x7a7b('0xd')]()[_0x7a7b('0x2e')](_0x3aced1)[_0x7a7b('0xf')](_0x7a7b('0x27'))[_0x7a7b('0x13')](_0x7a7b('0x3c'),null,_0x7a7b('0x46'))[_0x7a7b('0x13')](_0x7a7b('0x47'),null,'cm_contacts.id\x20=\x20cm_contact_has_items.CmContactId')[_0x7a7b('0x11')](_0x7a7b('0x48'),_0x4ea0a7)[_0x7a7b('0x11')](_0x7a7b('0x32'),NOW))['toString']();}function insertCmContact(_0x1fcbe7,_0x559e3b,_0x1973af,_0x22fd35){var _0x5c38f3=_['concat'](_[_0x7a7b('0x49')](_0x22fd35),[_0x7a7b('0x2a'),_0x7a7b('0x4a'),'createdAt','updatedAt','scheduledAt']);return squel[_0x7a7b('0x25')]()[_0x7a7b('0x26')](_0x7a7b('0x3c'))[_0x7a7b('0x28')](_0x5c38f3,squel[_0x7a7b('0xd')]()['fields'](_0x5c38f3)[_0x7a7b('0xf')](_0x559e3b)[_0x7a7b('0x11')]('('+_0x1973af['join'](',')+_0x7a7b('0x4b'),squel[_0x7a7b('0xd')]()['fields'](_0x1973af)[_0x7a7b('0xf')](_0x7a7b('0x3c'))[_0x7a7b('0x11')](_0x7a7b('0x41'),_0x1fcbe7)[_0x7a7b('0x11')](_0x7a7b('0x4c')))[_0x7a7b('0x11')](_0x7a7b('0x4d'),squel[_0x7a7b('0xd')]()['field'](_0x7a7b('0x4e'),_0x7a7b('0x4f'))[_0x7a7b('0xf')](_0x559e3b)[_0x7a7b('0x50')](_0x1973af[_0x7a7b('0x13')](','))))[_0x7a7b('0x36')]();}function handleStop(){logger[_0x7a7b('0x51')](_0x7a7b('0x52'));stopped=!![];}function handleUncaughtException(_0x39826e){logger[_0x7a7b('0x53')](_0x39826e[_0x7a7b('0x54')]);process[_0x7a7b('0x55')](0x1);}function handleError(_0x48f898,_0x585e36){stats[_0x7a7b('0x56')][_0x7a7b('0x15')]({'name':_0x585e36[_0x7a7b('0x57')],'message':_0x585e36[_0x7a7b('0x54')],'row':_0x48f898});}function handleQuery(_0x56fa88){logger[_0x7a7b('0x51')](_0x56fa88);return db[_0x7a7b('0x58')][_0x7a7b('0x59')](_0x56fa88)[_0x7a7b('0x5a')](function(_0x52030f){results[_0x7a7b('0x15')](_0x52030f);})[_0x7a7b('0x5b')](function(_0x5607b8){logger[_0x7a7b('0x53')](_0x5607b8[_0x7a7b('0x54')]);});}function updateTzCampaigns(_0xe46482){return new Promise(function(_0x2f241f,_0x56ec8b){var _0x1f7f2b=squel['select']()[_0x7a7b('0x2e')]([_0x7a7b('0x5c'),_0x7a7b('0x5d')])['from'](_0x7a7b('0x5e'))[_0x7a7b('0x13')](_0x7a7b('0x5f'),null,'campaigns.id\x20=\x20campaigns_has_cm_lists.CampaignId')['where'](_0x7a7b('0x60')+_0xe46482);db[_0x7a7b('0x58')][_0x7a7b('0x59')](_0x1f7f2b[_0x7a7b('0x36')]())['spread'](function(_0x113553){var _0x254d22=[];for(var _0x3af8e3=0x0;_0x3af8e3<_0x113553[_0x7a7b('0x18')];_0x3af8e3++){_0x254d22[_0x7a7b('0x15')](getTimezoneData(_0x113553[_0x3af8e3],tmp_campaigns));}BPromise[_0x7a7b('0x19')](_0x254d22)[_0x7a7b('0x16')](function(){_0x2f241f({'val':0x1});});})[_0x7a7b('0x5b')](function(_0x37641b){logger[_0x7a7b('0x53')](_0x37641b[_0x7a7b('0x54')]);_0x2f241f({'val':0x0});});});}function updateTzVoiceQueues(_0x17446f){return new Promise(function(_0x27115c,_0xf153df){var _0x1733da=squel[_0x7a7b('0xd')]()[_0x7a7b('0x2e')]([_0x7a7b('0x61'),_0x7a7b('0x62')])[_0x7a7b('0xf')](_0x7a7b('0x63'))['join']('voice_queues_has_cm_lists',null,_0x7a7b('0x64'))[_0x7a7b('0x11')](_0x7a7b('0x65')+_0x17446f);db[_0x7a7b('0x58')][_0x7a7b('0x59')](_0x1733da[_0x7a7b('0x36')]())[_0x7a7b('0x5a')](function(_0x13a23f){var _0x59d51b=[];for(var _0x39091d=0x0;_0x39091d<_0x13a23f['length'];_0x39091d++){_0x59d51b[_0x7a7b('0x15')](getTimezoneData(_0x13a23f[_0x39091d],tmp_voice_queues));}BPromise[_0x7a7b('0x19')](_0x59d51b)['then'](function(){_0x27115c({'val':0x1});});})[_0x7a7b('0x5b')](function(_0x2142a2){logger[_0x7a7b('0x53')](_0x2142a2['message']);_0x27115c({'val':0x0});});});}function getTimezoneData(_0x2bae02,_0x3a272d){return new Promise(function(_0x42a6fa,_0x3f6c75){var _0x22901b=shared['timezones'];var _0x27c549=_0x22901b[_0x2bae02[_0x7a7b('0x66')]];if(_[_0x7a7b('0x1a')](_0x27c549)){_0x42a6fa({'ret':0x1});}else{var _0x48329e=_0x27c549[_0x7a7b('0x67')];var _0x5f0bfb=squel[_0x7a7b('0x25')]()[_0x7a7b('0x26')](_0x3a272d)[_0x7a7b('0x68')]('id',_0x2bae02['id'])[_0x7a7b('0x68')](_0x7a7b('0x69'),_0x48329e)['set'](_0x7a7b('0x66'),_0x2bae02[_0x7a7b('0x66')])[_0x7a7b('0x36')]();return db['sequelize']['query'](_0x5f0bfb)[_0x7a7b('0x5a')](function(_0xf367d1){_0x42a6fa({'ret':0x1});})[_0x7a7b('0x5b')](function(_0x1a8e6c){logger['error'](_0x1a8e6c[_0x7a7b('0x54')]);_0x3f6c75({'ret':0x1});});}});}function handleTZQuery(_0x137d83){logger[_0x7a7b('0x51')](_0x137d83);return db[_0x7a7b('0x58')][_0x7a7b('0x59')](_0x137d83)[_0x7a7b('0x5a')](function(_0x216ff8){})[_0x7a7b('0x5b')](function(_0x5be84f){logger[_0x7a7b('0x53')](_0x5be84f['message']);});}function main(_0x537542,_0xbd7b6c,_0x675e27,_0x2229b1){logger[_0x7a7b('0x51')](_0x7a7b('0x6a'),_0x537542,JSON[_0x7a7b('0x6b')](_0xbd7b6c));process['send']('start');var _0x3a419e=_0xbd7b6c[_0x7a7b('0x6c')];var _0x463e77=_[_0x7a7b('0x6d')](_0x3a419e);var _0x4b5c20=_0xbd7b6c[_0x7a7b('0x6e')];var _0x4a0305=path[_0x7a7b('0x13')](config[_0x7a7b('0x6f')],_0x7a7b('0x70'),_0x4b5c20+_0x7a7b('0x71'));hasTZ=_[_0x7a7b('0x49')](_0x3a419e)['includes'](_0x7a7b('0x66'));var _0x506257=_[_0x7a7b('0x49')](_0x3a419e)['join']();logger['info']('header',_0x506257);db[_0x7a7b('0x72')][_0x7a7b('0x14')]({'raw':!![],'attributes':['id','name']})[_0x7a7b('0x16')](function(_0x4ecf8c){for(var _0x5ea8a0=0x0;_0x5ea8a0<_0x4ecf8c[_0x7a7b('0x18')];_0x5ea8a0++){if(_0x4ecf8c[_0x5ea8a0][_0x7a7b('0x73')]in _0x3a419e){contactItemTypes[_0x7a7b('0x15')](_0x4ecf8c[_0x5ea8a0]);delete _0x463e77[_0x4ecf8c[_0x5ea8a0][_0x7a7b('0x73')]];hasAdditionalPhones=!![];}for(var _0x4b28c9 in _0x3a419e){if(_0x4ecf8c[_0x5ea8a0]['name']+_0x7a7b('0x74')===_0x4b28c9){phoneDescriptions['push']({'itemTypeId':_0x4ecf8c[_0x5ea8a0]['id'],'description':_0x4b28c9});delete _0x463e77[_0x4b28c9];}}}if(hasAdditionalPhones)_0x463e77['AdditionalPhones']='';var _0x42990f=_[_0x7a7b('0x49')](_0x463e77)[_0x7a7b('0x13')]();logger[_0x7a7b('0x51')]('header',_0x42990f);fs['writeFileSync'](_0x4a0305,_0x42990f+'\x0a');Papa['parse'](fs['createReadStream'](_0x537542),{'header':!![],'skipEmptyLines':!![],'step':function(_0x55f8d1,_0xb20e92){try{for(var _0x57e581=0x0,_0x716eac=[];_0x57e581<_0x55f8d1['data'][_0x7a7b('0x18')];_0x57e581++){stats[_0x7a7b('0x75')]+=0x1;if(_0x55f8d1[_0x7a7b('0x56')][_0x57e581]){handleError(_0x55f8d1[_0x7a7b('0x76')][_0x57e581],_0x55f8d1[_0x7a7b('0x56')][_0x57e581]);}else{var _0xb8fe0d=[];var _0x52e682=[];var _0x358f01={};for(var _0x10ceca in _0x3a419e){let _0x51e7cf=contactItemTypes[_0x7a7b('0x77')](_0x472b41=>_0x472b41[_0x7a7b('0x73')]===_0x10ceca);let _0xee2be1=contactItemTypes[_0x7a7b('0x77')](_0x168b93=>_0x168b93['name']+'_description'===_0x10ceca);if(_[_0x7a7b('0x1a')](_0x51e7cf)&&_[_0x7a7b('0x1a')](_0xee2be1)){if(_0x3a419e[_0x7a7b('0x78')](_0x10ceca)){if(_0x55f8d1['data'][_0x57e581][_0x3a419e[_0x10ceca]]){var _0x1fbfeb=_[_0x7a7b('0x79')](_0x55f8d1[_0x7a7b('0x76')][_0x57e581][_0x3a419e[_0x10ceca]]['replace'](/"/g,'\x27'));switch(_0x10ceca){case _0x7a7b('0x29'):var _0x3c0d7c=moment(_0x1fbfeb,_0x7a7b('0xb'),!![]);if(_0x3c0d7c['isValid']()){_0x716eac[_0x7a7b('0x15')]('\x22'+_0x1fbfeb+'\x22');}else{_0xb8fe0d[_0x7a7b('0x15')](_0x7a7b('0x7a'));}break;case _0x7a7b('0x2c'):var _0x51b895=parseInt(_0x1fbfeb);_0x1fbfeb=_[_0x7a7b('0x7b')](_0x51b895)||_0x51b895<0x0||_0x51b895>0x4?_0x2229b1?0x3:0x2:_0x51b895;_0x716eac[_0x7a7b('0x15')]('\x22'+_0x1fbfeb+'\x22');break;case _0x7a7b('0x40'):var _0x173e80=parseInt(_0x1fbfeb);if(_[_0x7a7b('0x7c')](_0x173e80)&&_[_0x7a7b('0x7d')](_0x675e27,_0x173e80)){_0x716eac[_0x7a7b('0x15')]('\x22'+_0x173e80+'\x22');}else{_0xb8fe0d[_0x7a7b('0x15')](_0x7a7b('0x7e'));}break;case _0x7a7b('0x7f'):if(isEmail(_0x1fbfeb)){_0x716eac[_0x7a7b('0x15')]('\x22'+_0x1fbfeb+'\x22');}else{_0xb8fe0d['push']('email\x20wrong\x20format');}break;case _0x7a7b('0x80'):var _0x4515a0=moment(_0x1fbfeb,_0x7a7b('0x81'),!![]);if(_0x4515a0['isValid']()){_0x716eac[_0x7a7b('0x15')]('\x22'+_0x1fbfeb+'\x22');}else{_0xb8fe0d[_0x7a7b('0x15')](_0x7a7b('0x82'));}break;case _0x7a7b('0x66'):var _0x5bfea7=shared['timezones'];var _0x2c9d1c=_0x5bfea7[_0x1fbfeb];if(!_['isNil'](_0x2c9d1c)){var _0x191513=_0x2c9d1c[_0x7a7b('0x67')];_0x716eac[_0x7a7b('0x15')]('\x22'+_0x1fbfeb+'\x22');_0x716eac[_0x7a7b('0x15')]('\x22'+_0x191513+'\x22');}break;default:_0x716eac['push']('\x22'+_0x1fbfeb+'\x22');}}else{switch(_0x10ceca){case _0x7a7b('0x83'):case _0x7a7b('0x3a'):_0xb8fe0d[_0x7a7b('0x15')](_0x10ceca+_0x7a7b('0x84'));break;default:_0x716eac[_0x7a7b('0x15')]('\x22\x22');}}}}else{var _0x19cb91='';if(!_[_0x7a7b('0x1a')](_0x51e7cf)){if(!_0x358f01['hasOwnProperty'](_0x51e7cf['id'])){if(!_[_0x7a7b('0x1a')](_0x55f8d1[_0x7a7b('0x76')][_0x57e581][_0x3a419e[_0x10ceca]])){var _0x1fbfeb=_[_0x7a7b('0x79')](_0x55f8d1['data'][_0x57e581][_0x3a419e[_0x10ceca]]['replace'](/"/g,'\x27'));var _0x213071=phoneDescriptions[_0x7a7b('0x77')](_0x86c154=>_0x86c154[_0x7a7b('0x85')]===_0x51e7cf['id']);if(!_['isNil'](_0x213071)){var _0x1ea600=_[_0x7a7b('0x79')](_0x55f8d1[_0x7a7b('0x76')][_0x57e581][_0x3a419e[_0x213071[_0x7a7b('0x86')]]][_0x7a7b('0x87')](/"/g,'\x27'));if(!_[_0x7a7b('0x1a')](_0x1ea600))_0x1fbfeb=_0x1fbfeb+'§'+_0x1ea600;}if(_0x19cb91=='')_0x19cb91=_0x1fbfeb;else _0x19cb91+='|'+_0x1fbfeb;}_0x52e682[_0x7a7b('0x15')](_0x51e7cf['id']+':'+_0x19cb91);_0x358f01[_0x51e7cf['id']]=0x1;}}}}if(hasAdditionalPhones){_0x716eac[_0x7a7b('0x15')]('\x22'+_0x52e682[_0x7a7b('0x13')](';')+'\x22');}if(_0xb8fe0d[_0x7a7b('0x18')]){handleError(_0x55f8d1['data'][_0x57e581],{'code':_0x7a7b('0x88'),'message':_0xb8fe0d[_0x7a7b('0x13')]()});}else{fs['appendFileSync'](_0x4a0305,_0x716eac['join']()+'\x0a');}_0x716eac=[];}if(!(stats[_0x7a7b('0x75')]%0xc8)){socket['emit']('contact:import:'+_0x4b5c20,stats);stats[_0x7a7b('0x56')]=[];}}if(stopped){logger[_0x7a7b('0x51')](_0x7a7b('0x89'));_0xb20e92['abort']();}}catch(_0x301bf6){handleError(_0x55f8d1['data'][_0x57e581],{'code':'SystemError','message':_0x301bf6[_0x7a7b('0x54')]});logger[_0x7a7b('0x53')](_0x7a7b('0x8a'),_0x301bf6['message']);}},'complete':function(){try{var _0x8dea81=[];var _0x60b695=[];var _0x1870f5=_0x7a7b('0x3c');if(_0xbd7b6c[_0x7a7b('0x8b')]&&_0xbd7b6c[_0x7a7b('0x8b')][_0x7a7b('0x18')]){_0x1870f5=_0x7a7b('0x8c')+_0x4b5c20;_0x8dea81[_0x7a7b('0x15')](_0x7a7b('0x8d')+_0x1870f5+_0x7a7b('0x8e'));}tmp_campaigns=_0x7a7b('0x8f')+_0x4b5c20;tmp_voice_queues='voice_queues_'+_0x4b5c20;_0x60b695[_0x7a7b('0x15')]('CREATE\x20TABLE\x20'+tmp_campaigns+_0x7a7b('0x90'));_0x60b695[_0x7a7b('0x15')]('CREATE\x20TABLE\x20'+tmp_voice_queues+_0x7a7b('0x90'));BPromise['each'](_0x60b695,handleTZQuery)[_0x7a7b('0x16')](function(_0xd34074){updateTzCampaigns(_0xbd7b6c[_0x7a7b('0x2a')])[_0x7a7b('0x16')](function(_0x2e7c7b){updateTzVoiceQueues(_0xbd7b6c[_0x7a7b('0x2a')])[_0x7a7b('0x16')](function(_0x20ba01){if(hasTZ)_0x42990f=_0x42990f[_0x7a7b('0x87')](_0x7a7b('0x66'),_0x7a7b('0x91'));var _0x1a4f4e=util[_0x7a7b('0xa')](_0x7a7b('0x92'),_0x4a0305,_0x1870f5,_0x42990f,_0xbd7b6c[_0x7a7b('0x2a')],_0xbd7b6c['CompanyId']||null,NOW,NOW);if(_[_0x7a7b('0x1a')](_0x3a419e[_0x7a7b('0x29')])){_0x1a4f4e+=_0x7a7b('0x93');}_0x8dea81[_0x7a7b('0x15')](_0x1a4f4e);if(_0xbd7b6c['duplicates']&&_0xbd7b6c[_0x7a7b('0x8b')][_0x7a7b('0x18')]){_0x8dea81[_0x7a7b('0x15')](insertCmContact(_0xbd7b6c[_0x7a7b('0x2a')],_0x1870f5,_0xbd7b6c[_0x7a7b('0x8b')],_0x3a419e));_0x8dea81['push'](_0x7a7b('0x94')+_0x1870f5+';');}BPromise['each'](_0x8dea81,handleQuery)[_0x7a7b('0x16')](function(_0x554f7c){BPromise[_0x7a7b('0x19')]([handleAdditionalPhones()])[_0x7a7b('0x16')](function(){_0x8dea81=[];for(var _0x435608=0x0;_0x435608\x20\x20','existsSync','binding\x20doesn\x27t\x20exists','firstName\x20is\x20mandatory','body\x20id\x20mandatory','map','No\x20agent\x20available','SIGINT','uncaughtException','path','lodash','papaparse','util','bluebird','moment','ioredis','../../../mysqldb','../../../config/environment','../../../config/environment/shared','../../../config/logger','import','redis','localhost','format','YYYY-MM-DD\x20HH:mm:ss','test','select','field','phone','from','.id\x20=\x20','\x20=\x20','where','.dialCheckDuplicateType\x20IN\x20(','join','CmContact','findAll','AdditionalPhones','then','push','all','split','length','isNil','filter','CmContactHasItem','findOne','updated','PHONE','cm_contacts.phone','cm_contacts.id','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.priority','insert','into','cm_hopper','fromQuery','ContactId','ListId','createdAt','updatedAt','UserId','recallme'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0xec02,0x13c));var _0x2ec0=function(_0x160c73,_0x2ee678){_0x160c73=_0x160c73-0x0;var _0xd9302=_0xec02[_0x160c73];return _0xd9302;};'use strict';var fs=require('fs');var path=require(_0x2ec0('0x0'));var _=require(_0x2ec0('0x1'));var Papa=require(_0x2ec0('0x2'));var util=require(_0x2ec0('0x3'));var BPromise=require(_0x2ec0('0x4'));var moment=require(_0x2ec0('0x5'));var squel=require('squel');var Redis=require(_0x2ec0('0x6'));var db=require(_0x2ec0('0x7'))['db'];var config=require(_0x2ec0('0x8'));var shared=require(_0x2ec0('0x9'));var logger=require(_0x2ec0('0xa'))(_0x2ec0('0xb'));config['redis']=_['defaults'](config[_0x2ec0('0xc')],{'host':_0x2ec0('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x2ec0('0xc')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var orderBy=0x0;var stopped=![];var NOW=moment()[_0x2ec0('0xe')](_0x2ec0('0xf'));var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];var tmp_voice_queues;var tmp_campaigns;var tzOffset=0x0;var hasTZ;var NOW=moment()['format'](_0x2ec0('0xf'));function isEmail(_0x491afa){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))*$/[_0x2ec0('0x10')](_0x491afa);}function selectNotIn(_0xa72ca4,_0x12d39a,_0x67f977,_0x1438f7,_0x2face5){return squel[_0x2ec0('0x11')]()[_0x2ec0('0x12')](_0x2ec0('0x13'))[_0x2ec0('0x14')](_0x1438f7)['join'](_0x12d39a,null,_0x12d39a+_0x2ec0('0x15')+_0x1438f7+'.'+_0x67f977)['where'](_0x1438f7+'.'+_0x67f977+_0x2ec0('0x16')+_0xa72ca4+'.'+_0x67f977)[_0x2ec0('0x17')](_0x12d39a+_0x2ec0('0x18')+_0x2face5[_0x2ec0('0x19')]()+')');}function handleAdditionalPhones(){return new Promise(function(_0x16436e,_0x4b6029){promisesAdditionalPhones=[];return db[_0x2ec0('0x1a')][_0x2ec0('0x1b')]({'raw':!![],'attributes':['id',_0x2ec0('0x1c')],'where':{'createdAt':NOW,'AdditionalPhones':{'$ne':null}}})[_0x2ec0('0x1d')](function(_0x2077f9){if(_0x2077f9!==null){var _0x25ede6=[];for(var _0xc3b4ae=0x0;_0xc3b4ae<_0x2077f9['length'];_0xc3b4ae++){var _0x1ad77f=_0x2077f9[_0xc3b4ae];_0x25ede6[_0x2ec0('0x1e')](insertAdditionalPhones(_0x1ad77f));}}Promise[_0x2ec0('0x1f')](_0x25ede6)[_0x2ec0('0x1d')](function(){_0x16436e({'val':0x1});});});});}function insertAdditionalPhones(_0x35e864){return new Promise(function(_0x6331ac,_0x48771e){var _0x2eae23=_0x35e864['AdditionalPhones'];var _0x2d3fa8=_0x2eae23[_0x2ec0('0x20')](';');var _0x24b29d=[];orderBy=0x0;for(var _0x5228fc=0x0;_0x5228fc<_0x2d3fa8[_0x2ec0('0x21')];_0x5228fc++){_0x24b29d['push'](splitAdditionalPhone(_0x35e864['id'],_0x2d3fa8[_0x5228fc]));}Promise[_0x2ec0('0x1f')](_0x24b29d)[_0x2ec0('0x1d')](function(){_0x6331ac({'val':_0x2d3fa8[_0x2ec0('0x21')]});});});}function splitAdditionalPhone(_0x3cc9ad,_0x4a1846){return new Promise(function(_0x465596,_0x16527f){var _0x14d2a1=_0x4a1846[_0x2ec0('0x20')](':');var _0x8301da=_0x14d2a1[0x0];var _0x150778=_0x14d2a1[0x1];if(!_[_0x2ec0('0x22')](_0x150778)){var _0x48806c=_0x150778['split']('|');var _0xbd929f=[];for(var _0x59444b=0x0;_0x59444b<_0x48806c['length'];_0x59444b++){if(_0x48806c[_0x59444b]!==''){var _0x2726e3=_[_0x2ec0('0x23')](promisesAdditionalPhones,{'contactId':_0x3cc9ad,'phone':_0x48806c[_0x59444b]});if(_0x2726e3[_0x2ec0('0x21')]==0x0){orderBy++;promisesAdditionalPhones[_0x2ec0('0x1e')]({'contactId':_0x3cc9ad,'contactTypeId':_0x8301da,'phone':_0x48806c[_0x59444b],'orderBy':orderBy});}}}_0x465596({'ok':0x1});}else _0x465596({'res':0x0});});}function createAdditionalPhone(_0x29b665,_0xd5787e,_0x5811ee,_0x134641){var _0x56f245='';var _0x359f03='';var _0x2920ee=_0x5811ee['split']('§');_0x56f245=_0x2920ee[0x0];if(_0x2920ee['length']==0x2)_0x359f03=_0x2920ee[0x1];return new Promise(function(_0x37ee03,_0x5ab548){return db[_0x2ec0('0x24')][_0x2ec0('0x25')]({'where':{'CmContactId':_0x29b665,'item':_0x56f245}})['then'](function(_0x398f19){if(_0x398f19){return db[_0x2ec0('0x24')]['update']({'ItemTypeId':_0xd5787e,'description':_0x359f03,'OrderBy':_0x134641},{'where':{'CmContactId':_0x29b665,'item':_0x56f245}})[_0x2ec0('0x1d')](function(_0xd1fac3){_0x37ee03({'res':_0x2ec0('0x26')});});}else{return db[_0x2ec0('0x24')]['create']({'CmContactId':_0x29b665,'item':_0x56f245,'description':_0x359f03,'ItemTypeId':_0xd5787e,'OrderBy':_0x134641,'ItemClass':_0x2ec0('0x27')})[_0x2ec0('0x1d')](function(_0x4d1455){_0x37ee03({'res':'inserted'});});}});});}function insertCmHopper(_0x238cec,_0x7c9676,_0x402c97,_0x66797e,_0x2159dc){var _0x7e29fe=[_0x2ec0('0x28'),'cm_contacts.scheduledat',_0x2ec0('0x29'),_0x2ec0('0x2a'),_0x7c9676+'.'+_0x66797e,_0x2ec0('0x2b'),_0x2ec0('0x2c'),_0x2ec0('0x2d'),'cm_contacts.UserId','\x22'+_0x2159dc+'\x22'];return squel[_0x2ec0('0x2e')]()[_0x2ec0('0x2f')](_0x2ec0('0x30'))[_0x2ec0('0x31')]([_0x2ec0('0x13'),'scheduledat',_0x2ec0('0x32'),_0x2ec0('0x33'),_0x66797e,_0x2ec0('0x34'),_0x2ec0('0x35'),'priority',_0x2ec0('0x36'),_0x2ec0('0x37')],squel[_0x2ec0('0x11')]()[_0x2ec0('0x38')](_0x7e29fe)[_0x2ec0('0x14')](_0x7c9676)[_0x2ec0('0x19')](_0x2ec0('0x39'),null,_0x2ec0('0x3a')+_0x7c9676+'.CmListId')[_0x2ec0('0x19')](_0x402c97,null,_0x402c97+_0x2ec0('0x15')+_0x7c9676+'.'+_0x66797e)[_0x2ec0('0x17')](_0x7c9676+'.CmListId\x20=\x20?',_0x238cec)[_0x2ec0('0x17')](_0x2ec0('0x3b'),NOW)['where'](_0x2ec0('0x3c'),selectNotIn(_0x7c9676,_0x402c97,_0x66797e,_0x2ec0('0x30'),[_0x2ec0('0x3d'),_0x2ec0('0x3e')]))[_0x2ec0('0x17')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x7c9676,_0x402c97,_0x66797e,_0x2ec0('0x30'),[_0x2ec0('0x3d')])))[_0x2ec0('0x3f')]();}function insertCmHopperBlack(_0x4d2e8b,_0x15f2db,_0x4e596e,_0x5bbfb8){var _0x1fd1b6=[_0x2ec0('0x28'),_0x2ec0('0x29'),_0x2ec0('0x2a'),_0x15f2db+'.'+_0x5bbfb8,_0x2ec0('0x2b'),_0x2ec0('0x2c')];return squel[_0x2ec0('0x2e')]()[_0x2ec0('0x2f')](_0x2ec0('0x40'))[_0x2ec0('0x31')]([_0x2ec0('0x13'),_0x2ec0('0x32'),'ListId',_0x5bbfb8,_0x2ec0('0x34'),'updatedAt'],squel[_0x2ec0('0x11')]()['fields'](_0x1fd1b6)[_0x2ec0('0x14')](_0x15f2db)[_0x2ec0('0x19')](_0x2ec0('0x39'),null,_0x2ec0('0x3a')+_0x15f2db+_0x2ec0('0x41'))['join'](_0x4e596e,null,_0x4e596e+_0x2ec0('0x15')+_0x15f2db+'.'+_0x5bbfb8)['where'](_0x15f2db+'.CmListId\x20=\x20?',_0x4d2e8b)[_0x2ec0('0x17')](_0x2ec0('0x3b'),NOW)[_0x2ec0('0x17')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',squel[_0x2ec0('0x11')]()[_0x2ec0('0x12')](_0x2ec0('0x13'))[_0x2ec0('0x14')](_0x2ec0('0x40'))['where'](_0x2ec0('0x42'),_0x4d2e8b)[_0x2ec0('0x17')](_0x5bbfb8+_0x2ec0('0x16')+_0x15f2db+'.'+_0x5bbfb8)))[_0x2ec0('0x3f')]();}function insertTzCmHopper(_0x19f476,_0x44f513,_0x16f0f1,_0x3d25f2,_0x1902e5,_0x274779){var _0x2b41bf=[_0x2ec0('0x28'),_0x2ec0('0x43')+_0x274779+_0x2ec0('0x44'),_0x2ec0('0x29'),_0x2ec0('0x2a'),_0x44f513+'.'+_0x3d25f2,_0x2ec0('0x2b'),_0x2ec0('0x2c'),_0x2ec0('0x2d'),_0x2ec0('0x45'),'\x22'+_0x1902e5+'\x22'];var _0x3fd0f3=squel[_0x2ec0('0x2e')]()[_0x2ec0('0x2f')](_0x2ec0('0x30'))[_0x2ec0('0x31')]([_0x2ec0('0x13'),'scheduledat',_0x2ec0('0x32'),_0x2ec0('0x33'),_0x3d25f2,_0x2ec0('0x34'),_0x2ec0('0x35'),'priority',_0x2ec0('0x36'),_0x2ec0('0x37')],squel[_0x2ec0('0x11')]()[_0x2ec0('0x38')](_0x2b41bf)['from'](_0x44f513)[_0x2ec0('0x19')](_0x2ec0('0x39'),null,_0x2ec0('0x3a')+_0x44f513+_0x2ec0('0x41'))[_0x2ec0('0x19')](_0x16f0f1,null,_0x16f0f1+_0x2ec0('0x15')+_0x44f513+'.'+_0x3d25f2)[_0x2ec0('0x19')](_0x274779,null,_0x274779+_0x2ec0('0x15')+_0x44f513+'.'+_0x3d25f2)[_0x2ec0('0x17')](_0x44f513+_0x2ec0('0x46'),_0x19f476)[_0x2ec0('0x17')](_0x2ec0('0x3b'),NOW)[_0x2ec0('0x17')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x44f513,_0x16f0f1,_0x3d25f2,_0x2ec0('0x30'),[_0x2ec0('0x3d'),'\x22onlyIfOpen\x22']))[_0x2ec0('0x17')](_0x2ec0('0x3c'),selectNotIn(_0x44f513,_0x16f0f1,_0x3d25f2,'cm_hopper',['\x22always\x22'])))['toString']();return _0x3fd0f3;}function insertTzCmHopperBlack(_0x1bbe5d,_0x3328e8,_0x24e930,_0x551f97){var _0x43b6da=[_0x2ec0('0x28'),_0x2ec0('0x29'),_0x2ec0('0x2a'),_0x3328e8+'.'+_0x551f97,_0x2ec0('0x2b'),_0x2ec0('0x2c')];return squel['insert']()[_0x2ec0('0x2f')](_0x2ec0('0x40'))['fromQuery']([_0x2ec0('0x13'),'ContactId',_0x2ec0('0x33'),_0x551f97,_0x2ec0('0x34'),_0x2ec0('0x35')],squel[_0x2ec0('0x11')]()[_0x2ec0('0x38')](_0x43b6da)[_0x2ec0('0x14')](_0x3328e8)['join'](_0x2ec0('0x39'),null,_0x2ec0('0x3a')+_0x3328e8+_0x2ec0('0x41'))[_0x2ec0('0x19')](_0x24e930,null,_0x24e930+_0x2ec0('0x15')+_0x3328e8+'.'+_0x551f97)[_0x2ec0('0x17')](_0x3328e8+_0x2ec0('0x46'),_0x1bbe5d)['where'](_0x2ec0('0x3b'),NOW)[_0x2ec0('0x17')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',squel['select']()[_0x2ec0('0x12')](_0x2ec0('0x13'))['from'](_0x2ec0('0x40'))[_0x2ec0('0x17')]('ListId\x20=\x20?',_0x1bbe5d)[_0x2ec0('0x17')](_0x551f97+_0x2ec0('0x16')+_0x3328e8+'.'+_0x551f97)))[_0x2ec0('0x3f')]();}function insertCmHopperAdditionalPhones(_0x3ad262){var _0x5950b8=[_0x2ec0('0x47'),_0x2ec0('0x48'),_0x2ec0('0x49'),_0x2ec0('0x4a'),_0x2ec0('0x4b')];return squel[_0x2ec0('0x2e')]()[_0x2ec0('0x2f')]('cm_hopper_additional_phones')['fromQuery']([_0x2ec0('0x4c'),'phone',_0x2ec0('0x4d'),'createdAt','updatedAt'],squel[_0x2ec0('0x11')]()['fields'](_0x5950b8)[_0x2ec0('0x14')](_0x2ec0('0x30'))['join'](_0x2ec0('0x39'),null,_0x2ec0('0x4e'))[_0x2ec0('0x19')](_0x2ec0('0x4f'),null,_0x2ec0('0x50'))[_0x2ec0('0x17')](_0x2ec0('0x51'),_0x3ad262)['where'](_0x2ec0('0x3b'),NOW))['toString']();}function insertCmContact(_0x4a856b,_0x3785d5,_0x16d432,_0x2d4650){var _0x54cf1e=_[_0x2ec0('0x52')](_[_0x2ec0('0x53')](_0x2d4650),[_0x2ec0('0x33'),_0x2ec0('0x54'),_0x2ec0('0x34'),_0x2ec0('0x35'),_0x2ec0('0x55')]);return squel[_0x2ec0('0x2e')]()[_0x2ec0('0x2f')](_0x2ec0('0x39'))[_0x2ec0('0x31')](_0x54cf1e,squel[_0x2ec0('0x11')]()['fields'](_0x54cf1e)['from'](_0x3785d5)['where']('('+_0x16d432[_0x2ec0('0x19')](',')+_0x2ec0('0x56'),squel[_0x2ec0('0x11')]()['fields'](_0x16d432)[_0x2ec0('0x14')](_0x2ec0('0x39'))[_0x2ec0('0x17')](_0x2ec0('0x42'),_0x4a856b)[_0x2ec0('0x17')](_0x2ec0('0x57')))['where'](_0x2ec0('0x58'),squel[_0x2ec0('0x11')]()[_0x2ec0('0x12')](_0x2ec0('0x59'),_0x2ec0('0x5a'))[_0x2ec0('0x14')](_0x3785d5)['group'](_0x16d432[_0x2ec0('0x19')](','))))[_0x2ec0('0x3f')]();}function handleStop(){logger['info'](_0x2ec0('0x5b'));stopped=!![];}function handleUncaughtException(_0x1b872f){logger['error'](_0x1b872f[_0x2ec0('0x5c')]);process[_0x2ec0('0x5d')](0x1);}function handleError(_0x2a3811,_0xe8d542){stats['errors'][_0x2ec0('0x1e')]({'name':_0xe8d542['code'],'message':_0xe8d542['message'],'row':_0x2a3811});}function handleQuery(_0x386b52){logger[_0x2ec0('0x5e')](_0x386b52);return db[_0x2ec0('0x5f')][_0x2ec0('0x60')](_0x386b52)[_0x2ec0('0x61')](function(_0x41d0de){results['push'](_0x41d0de);})[_0x2ec0('0x62')](function(_0x3de0db){logger[_0x2ec0('0x63')](_0x3de0db[_0x2ec0('0x5c')]);});}function updateTzCampaigns(_0x58f0f3){return new Promise(function(_0x599463,_0x373fcf){var _0x533dc7=squel['select']()[_0x2ec0('0x38')]([_0x2ec0('0x64'),_0x2ec0('0x65')])[_0x2ec0('0x14')](_0x2ec0('0x66'))[_0x2ec0('0x19')](_0x2ec0('0x67'),null,'campaigns.id\x20=\x20campaigns_has_cm_lists.CampaignId')[_0x2ec0('0x17')](_0x2ec0('0x68')+_0x58f0f3);db[_0x2ec0('0x5f')]['query'](_0x533dc7[_0x2ec0('0x3f')]())['spread'](function(_0x5ce3c3){var _0x3717cf=[];for(var _0x5304a3=0x0;_0x5304a3<_0x5ce3c3[_0x2ec0('0x21')];_0x5304a3++){_0x3717cf[_0x2ec0('0x1e')](getTimezoneData(_0x5ce3c3[_0x5304a3],tmp_campaigns));}BPromise[_0x2ec0('0x1f')](_0x3717cf)[_0x2ec0('0x1d')](function(){_0x599463({'val':0x1});});})[_0x2ec0('0x62')](function(_0x13cb73){logger[_0x2ec0('0x63')](_0x13cb73[_0x2ec0('0x5c')]);_0x599463({'val':0x0});});});}function updateTzVoiceQueues(_0x1dce76){return new Promise(function(_0x21a265,_0x3a8d68){var _0x3f8dac=squel[_0x2ec0('0x11')]()[_0x2ec0('0x38')](['voice_queues.id',_0x2ec0('0x69')])[_0x2ec0('0x14')](_0x2ec0('0x6a'))[_0x2ec0('0x19')](_0x2ec0('0x6b'),null,'voice_queues.id\x20=\x20voice_queues_has_cm_lists.VoiceQueueId')[_0x2ec0('0x17')](_0x2ec0('0x6c')+_0x1dce76);db['sequelize']['query'](_0x3f8dac['toString']())[_0x2ec0('0x61')](function(_0x2e57fa){var _0x85924=[];for(var _0x31cfcf=0x0;_0x31cfcf<_0x2e57fa[_0x2ec0('0x21')];_0x31cfcf++){_0x85924[_0x2ec0('0x1e')](getTimezoneData(_0x2e57fa[_0x31cfcf],tmp_voice_queues));}BPromise[_0x2ec0('0x1f')](_0x85924)['then'](function(){_0x21a265({'val':0x1});});})[_0x2ec0('0x62')](function(_0x5c9dfc){logger[_0x2ec0('0x63')](_0x5c9dfc[_0x2ec0('0x5c')]);_0x21a265({'val':0x0});});});}function getTimezoneData(_0x26df6b,_0x23d75a){return new Promise(function(_0x3d35c8,_0x364acd){var _0x5a198b=shared[_0x2ec0('0x6d')];var _0x460f6f=_0x5a198b[_0x26df6b[_0x2ec0('0x6e')]];if(_[_0x2ec0('0x22')](_0x460f6f)){_0x3d35c8({'ret':0x1});}else{var _0x3b11e6=_0x460f6f[_0x2ec0('0x6f')];var _0x507731=squel[_0x2ec0('0x2e')]()[_0x2ec0('0x2f')](_0x23d75a)[_0x2ec0('0x70')]('id',_0x26df6b['id'])[_0x2ec0('0x70')](_0x2ec0('0x71'),_0x3b11e6)['set']('dialTimezone',_0x26df6b[_0x2ec0('0x6e')])[_0x2ec0('0x3f')]();return db[_0x2ec0('0x5f')][_0x2ec0('0x60')](_0x507731)[_0x2ec0('0x61')](function(_0x421c4d){_0x3d35c8({'ret':0x1});})[_0x2ec0('0x62')](function(_0x5dd820){logger[_0x2ec0('0x63')](_0x5dd820[_0x2ec0('0x5c')]);_0x364acd({'ret':0x1});});}});}function handleTZQuery(_0x10147d){logger[_0x2ec0('0x5e')](_0x10147d);return db[_0x2ec0('0x5f')]['query'](_0x10147d)[_0x2ec0('0x61')](function(_0xb36a6a){})[_0x2ec0('0x62')](function(_0x57fcb7){logger[_0x2ec0('0x63')](_0x57fcb7[_0x2ec0('0x5c')]);});}function main(_0x1fc22e,_0x436991,_0x30cd88,_0x3d8b20){logger['info'](_0x2ec0('0x72'),_0x1fc22e,JSON[_0x2ec0('0x73')](_0x436991));process['send'](_0x2ec0('0x74'));var _0x227202=_0x436991[_0x2ec0('0x75')];var _0x27e744=_[_0x2ec0('0x76')](_0x227202);var _0x354cb7=_0x436991[_0x2ec0('0x77')];var _0x1cfce4=path[_0x2ec0('0x19')](config[_0x2ec0('0x78')],_0x2ec0('0x79'),_0x354cb7+_0x2ec0('0x7a'));hasTZ=_[_0x2ec0('0x53')](_0x227202)['includes'](_0x2ec0('0x6e'));var _0x110fce=_[_0x2ec0('0x53')](_0x227202)[_0x2ec0('0x19')]();logger[_0x2ec0('0x5e')](_0x2ec0('0x7b'),_0x110fce);db[_0x2ec0('0x7c')][_0x2ec0('0x1b')]({'raw':!![],'attributes':['id','name']})[_0x2ec0('0x1d')](function(_0x3db568){for(var _0x4aced6=0x0;_0x4aced6<_0x3db568['length'];_0x4aced6++){if(_0x3db568[_0x4aced6][_0x2ec0('0x7d')]in _0x227202){contactItemTypes['push'](_0x3db568[_0x4aced6]);delete _0x27e744[_0x3db568[_0x4aced6][_0x2ec0('0x7d')]];hasAdditionalPhones=!![];}for(var _0x3d1e58 in _0x227202){if(_0x3db568[_0x4aced6][_0x2ec0('0x7d')]+_0x2ec0('0x7e')===_0x3d1e58){phoneDescriptions[_0x2ec0('0x1e')]({'itemTypeId':_0x3db568[_0x4aced6]['id'],'description':_0x3d1e58});delete _0x27e744[_0x3d1e58];}}}if(hasAdditionalPhones)_0x27e744[_0x2ec0('0x1c')]='';var _0x5ae60e=_[_0x2ec0('0x53')](_0x27e744)[_0x2ec0('0x19')]();logger['info']('header',_0x5ae60e);fs[_0x2ec0('0x7f')](_0x1cfce4,_0x5ae60e+'\x0a');Papa[_0x2ec0('0x80')](fs[_0x2ec0('0x81')](_0x1fc22e),{'header':!![],'skipEmptyLines':!![],'step':function(_0x421595,_0x4bea3a){try{for(var _0x7eb6f4=0x0,_0x59b87b=[];_0x7eb6f4<_0x421595['data']['length'];_0x7eb6f4++){stats['rows']+=0x1;if(_0x421595[_0x2ec0('0x82')][_0x7eb6f4]){handleError(_0x421595[_0x2ec0('0x83')][_0x7eb6f4],_0x421595[_0x2ec0('0x82')][_0x7eb6f4]);}else{var _0x33b7b2=[];var _0x20569a=[];var _0x51ebb7={};for(var _0x3543f3 in _0x227202){let _0x2ff8e1=contactItemTypes[_0x2ec0('0x84')](_0x97f751=>_0x97f751[_0x2ec0('0x7d')]===_0x3543f3);let _0x6adb47=contactItemTypes['find'](_0x3f5780=>_0x3f5780['name']+'_description'===_0x3543f3);if(_['isNil'](_0x2ff8e1)&&_['isNil'](_0x6adb47)){if(_0x227202[_0x2ec0('0x85')](_0x3543f3)){if(_0x421595['data'][_0x7eb6f4][_0x227202[_0x3543f3]]){var _0x3d99a7=_[_0x2ec0('0x86')](_0x421595[_0x2ec0('0x83')][_0x7eb6f4][_0x227202[_0x3543f3]][_0x2ec0('0x87')](/"/g,'\x27'));switch(_0x3543f3){case _0x2ec0('0x88'):var _0x4ffc9b=moment(_0x3d99a7,'YYYY-MM-DD\x20HH:mm:ss',!![]);if(_0x4ffc9b[_0x2ec0('0x89')]()){_0x59b87b[_0x2ec0('0x1e')]('\x22'+_0x3d99a7+'\x22');}else{_0x33b7b2[_0x2ec0('0x1e')](_0x2ec0('0x8a'));}break;case _0x2ec0('0x8b'):var _0x5a9e63=parseInt(_0x3d99a7);_0x3d99a7=_['isNaN'](_0x5a9e63)||_0x5a9e63<0x0||_0x5a9e63>0x4?_0x3d8b20?0x3:0x2:_0x5a9e63;_0x59b87b[_0x2ec0('0x1e')]('\x22'+_0x3d99a7+'\x22');break;case _0x2ec0('0x36'):var _0x2ea3e1=parseInt(_0x3d99a7);if(_['isNumber'](_0x2ea3e1)&&_[_0x2ec0('0x8c')](_0x30cd88,_0x2ea3e1)){_0x59b87b['push']('\x22'+_0x2ea3e1+'\x22');}else{_0x33b7b2[_0x2ec0('0x1e')](_0x2ec0('0x8d'));}break;case _0x2ec0('0x8e'):if(isEmail(_0x3d99a7)){_0x59b87b[_0x2ec0('0x1e')]('\x22'+_0x3d99a7+'\x22');}else{_0x33b7b2[_0x2ec0('0x1e')](_0x2ec0('0x8f'));}break;case _0x2ec0('0x90'):var _0x54ec2a=moment(_0x3d99a7,'YYYY-MM-DD',!![]);if(_0x54ec2a[_0x2ec0('0x89')]()){_0x59b87b[_0x2ec0('0x1e')]('\x22'+_0x3d99a7+'\x22');}else{_0x33b7b2[_0x2ec0('0x1e')]('dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)');}break;case'dialTimezone':var _0x11dd03=shared[_0x2ec0('0x6d')];var _0x3d97ee=_0x11dd03[_0x3d99a7];if(!_[_0x2ec0('0x22')](_0x3d97ee)){var _0x2536c7=_0x3d97ee[_0x2ec0('0x6f')];_0x59b87b[_0x2ec0('0x1e')]('\x22'+_0x3d99a7+'\x22');_0x59b87b[_0x2ec0('0x1e')]('\x22'+_0x2536c7+'\x22');}break;default:_0x59b87b[_0x2ec0('0x1e')]('\x22'+_0x3d99a7+'\x22');}}else{switch(_0x3543f3){case _0x2ec0('0x91'):case _0x2ec0('0x13'):_0x33b7b2[_0x2ec0('0x1e')](_0x3543f3+_0x2ec0('0x92'));break;default:_0x59b87b[_0x2ec0('0x1e')]('\x22\x22');}}}}else{var _0x3787fa='';if(!_[_0x2ec0('0x22')](_0x2ff8e1)){if(!_0x51ebb7['hasOwnProperty'](_0x2ff8e1['id'])){if(!_[_0x2ec0('0x22')](_0x421595[_0x2ec0('0x83')][_0x7eb6f4][_0x227202[_0x3543f3]])){var _0x3d99a7=_['trim'](_0x421595['data'][_0x7eb6f4][_0x227202[_0x3543f3]][_0x2ec0('0x87')](/"/g,'\x27'));var _0x1216a9=phoneDescriptions[_0x2ec0('0x84')](_0x2270a1=>_0x2270a1[_0x2ec0('0x93')]===_0x2ff8e1['id']);if(!_[_0x2ec0('0x22')](_0x1216a9)){var _0x10ebc4=_[_0x2ec0('0x86')](_0x421595['data'][_0x7eb6f4][_0x227202[_0x1216a9[_0x2ec0('0x94')]]][_0x2ec0('0x87')](/"/g,'\x27'));if(!_['isNil'](_0x10ebc4))_0x3d99a7=_0x3d99a7+'§'+_0x10ebc4;}if(_0x3787fa=='')_0x3787fa=_0x3d99a7;else _0x3787fa+='|'+_0x3d99a7;}_0x20569a['push'](_0x2ff8e1['id']+':'+_0x3787fa);_0x51ebb7[_0x2ff8e1['id']]=0x1;}}}}if(hasAdditionalPhones){_0x59b87b[_0x2ec0('0x1e')]('\x22'+_0x20569a[_0x2ec0('0x19')](';')+'\x22');}if(_0x33b7b2[_0x2ec0('0x21')]){handleError(_0x421595[_0x2ec0('0x83')][_0x7eb6f4],{'code':_0x2ec0('0x95'),'message':_0x33b7b2[_0x2ec0('0x19')]()});}else{fs[_0x2ec0('0x96')](_0x1cfce4,_0x59b87b[_0x2ec0('0x19')]()+'\x0a');}_0x59b87b=[];}if(!(stats[_0x2ec0('0x97')]%0xc8)){socket[_0x2ec0('0x98')](_0x2ec0('0x99')+_0x354cb7,stats);stats[_0x2ec0('0x82')]=[];}}if(stopped){logger[_0x2ec0('0x5e')](_0x2ec0('0x9a'));_0x4bea3a[_0x2ec0('0x9b')]();}}catch(_0x536475){handleError(_0x421595['data'][_0x7eb6f4],{'code':_0x2ec0('0x9c'),'message':_0x536475[_0x2ec0('0x5c')]});logger[_0x2ec0('0x63')](_0x2ec0('0x9d'),_0x536475[_0x2ec0('0x5c')]);}},'complete':function(){try{var _0x557d7d=[];var _0x248b61=[];var _0x21a6e3=_0x2ec0('0x39');if(_0x436991[_0x2ec0('0x9e')]&&_0x436991[_0x2ec0('0x9e')][_0x2ec0('0x21')]){_0x21a6e3=_0x2ec0('0x9f')+_0x354cb7;_0x557d7d[_0x2ec0('0x1e')](_0x2ec0('0xa0')+_0x21a6e3+'\x20LIKE\x20cm_contacts;');}tmp_campaigns=_0x2ec0('0xa1')+_0x354cb7;tmp_voice_queues='voice_queues_'+_0x354cb7;_0x248b61[_0x2ec0('0x1e')]('CREATE\x20TABLE\x20'+tmp_campaigns+'(id\x20int,dialTimezone\x20varchar(255),offset\x20int);');_0x248b61['push']('CREATE\x20TABLE\x20'+tmp_voice_queues+'(id\x20int,dialTimezone\x20varchar(255),offset\x20int);');BPromise[_0x2ec0('0xa2')](_0x248b61,handleTZQuery)[_0x2ec0('0x1d')](function(_0x324424){updateTzCampaigns(_0x436991['ListId'])[_0x2ec0('0x1d')](function(_0x5c42d6){updateTzVoiceQueues(_0x436991[_0x2ec0('0x33')])[_0x2ec0('0x1d')](function(_0x41a973){if(hasTZ)_0x5ae60e=_0x5ae60e['replace'](_0x2ec0('0x6e'),'dialTimezone,utcOffset');var _0x27f2f4=util[_0x2ec0('0xe')](_0x2ec0('0xa3'),_0x1cfce4,_0x21a6e3,_0x5ae60e,_0x436991[_0x2ec0('0x33')],_0x436991[_0x2ec0('0x54')]||null,NOW,NOW);if(_[_0x2ec0('0x22')](_0x227202[_0x2ec0('0x88')])){_0x27f2f4+=_0x2ec0('0xa4');}_0x557d7d[_0x2ec0('0x1e')](_0x27f2f4);if(_0x436991[_0x2ec0('0x9e')]&&_0x436991[_0x2ec0('0x9e')][_0x2ec0('0x21')]){_0x557d7d[_0x2ec0('0x1e')](insertCmContact(_0x436991[_0x2ec0('0x33')],_0x21a6e3,_0x436991[_0x2ec0('0x9e')],_0x227202));_0x557d7d[_0x2ec0('0x1e')](_0x2ec0('0xa5')+_0x21a6e3+';');}BPromise[_0x2ec0('0xa2')](_0x557d7d,handleQuery)[_0x2ec0('0x1d')](function(_0x31a8f8){BPromise[_0x2ec0('0x1f')]([handleAdditionalPhones()])[_0x2ec0('0x1d')](function(){_0x557d7d=[];for(var _0xef507c=0x0;_0xef507c\x20\x20','existsSync','file\x20doesn\x27t\x20exists','binding\x20doesn\x27t\x20exists','ListId\x20is\x20mandatory','map','No\x20agent\x20available','SIGINT','path','lodash','papaparse','util','bluebird','squel','ioredis','../../../mysqldb','../../../config/environment','import','redis','format','YYYYMMDDHHmmss','test','select','field','phone','from','where','\x20=\x20','join','sequelize','query','spread','isNil','AdditionalPhones','push','all','then','catch','message','split','length','CmContactHasItem','findOne','update','updated','create','PHONE','inserted','CmContact','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.priority','cm_contacts.UserId','insert','into','cm_hopper','fromQuery','scheduledat','ContactId','ListId','priority','UserId','fields','cm_contacts','.CmListId','.id\x20=\x20','.CmListId\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22onlyIfOpen\x22','\x22always\x22','toString','cm_hopper_black','createdAt','updatedAt','cm_contacts.ListId\x20=\x20'];(function(_0x26d993,_0x559ddb){var _0x1807e0=function(_0xa71bbb){while(--_0xa71bbb){_0x26d993['push'](_0x26d993['shift']());}};_0x1807e0(++_0x559ddb);}(_0xb57d,0x18d));var _0xdb57=function(_0x1aab41,_0x3a1fbe){_0x1aab41=_0x1aab41-0x0;var _0x4f3816=_0xb57d[_0x1aab41];return _0x4f3816;};'use strict';var fs=require('fs');var path=require(_0xdb57('0x0'));var _=require(_0xdb57('0x1'));var Papa=require(_0xdb57('0x2'));var util=require(_0xdb57('0x3'));var BPromise=require(_0xdb57('0x4'));var moment=require('moment');var squel=require(_0xdb57('0x5'));var Redis=require(_0xdb57('0x6'));var db=require(_0xdb57('0x7'))['db'];var config=require(_0xdb57('0x8'));var logger=require('../../../config/logger')(_0xdb57('0x9'));config[_0xdb57('0xa')]=_['defaults'](config[_0xdb57('0xa')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xdb57('0xa')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var promisesContact=[];var orderBy=0x0;var updatedRows=0x0;var stopped=![];var NOW=moment()[_0xdb57('0xb')]('YYYY-MM-DD\x20HH:mm:ss');var tempTableName='cm_contacts_temp_'+moment()[_0xdb57('0xb')](_0xdb57('0xc'));var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];function isEmail(_0x432b43){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))*$/[_0xdb57('0xd')](_0x432b43);}function selectNotIn(_0x348c57,_0x242561,_0x58be26,_0x3af5ad,_0x4801ac){return squel[_0xdb57('0xe')]()[_0xdb57('0xf')](_0xdb57('0x10'))[_0xdb57('0x11')](_0x3af5ad)['join'](_0x242561,null,_0x242561+'.id\x20=\x20'+_0x3af5ad+'.'+_0x58be26)[_0xdb57('0x12')](_0x3af5ad+'.'+_0x58be26+_0xdb57('0x13')+_0x348c57+'.'+_0x58be26)[_0xdb57('0x12')](_0x242561+'.dialCheckDuplicateType\x20IN\x20('+_0x4801ac[_0xdb57('0x14')]()+')');}function handleAdditionalPhones(){return new Promise(function(_0x25a660,_0x20083e){promisesAdditionalPhones=[];promisesContact=[];return db[_0xdb57('0x15')][_0xdb57('0x16')]('select\x20*\x20from\x20'+tempTableName)[_0xdb57('0x17')](function(_0x42f86a){if(_0x42f86a!==null){var _0x33c36a=[];for(var _0x430759=0x0;_0x430759<_0x42f86a['length'];_0x430759++){var _0x178e75=_0x42f86a[_0x430759];if(!_['isNil'](_0x178e75[_0xdb57('0x10')])){if(!_[_0xdb57('0x18')](_0x178e75[_0xdb57('0x19')]))_0x33c36a[_0xdb57('0x1a')](insertAdditionalPhones(_0x178e75));promisesContact['push']({'contact':_0x178e75});}}}Promise[_0xdb57('0x1b')](_0x33c36a)[_0xdb57('0x1c')](function(){_0x25a660({'val':0x1});});})[_0xdb57('0x1d')](function(_0x5b2c14){logger['error'](_0x5b2c14[_0xdb57('0x1e')]);});});}function insertAdditionalPhones(_0x1e5503){return new Promise(function(_0x4ee3af,_0x48b941){var _0x605557=_0x1e5503['AdditionalPhones'];if(_[_0xdb57('0x18')](_0x605557))_0x48b941({'val':0x0});else{var _0x1b4bc0=_0x605557[_0xdb57('0x1f')](';');var _0x582607=[];orderBy=0x0;for(var _0x1f4c0d=0x0;_0x1f4c0d<_0x1b4bc0[_0xdb57('0x20')];_0x1f4c0d++){_0x582607[_0xdb57('0x1a')](splitAdditionalPhone(_0x1e5503['id'],_0x1b4bc0[_0x1f4c0d]));}Promise[_0xdb57('0x1b')](_0x582607)[_0xdb57('0x1c')](function(){_0x4ee3af({'val':_0x1b4bc0[_0xdb57('0x20')]});});}});}function splitAdditionalPhone(_0x141768,_0x1dea3d){return new Promise(function(_0xd57b28,_0x55e28a){var _0x574796=_0x1dea3d['split'](':');var _0x31e009=_0x574796[0x0];var _0x283e7d=_0x574796[0x1];if(_0x283e7d!==''){var _0x4f1962=_0x283e7d[_0xdb57('0x1f')]('|');var _0x189382=[];for(var _0x1a5301=0x0;_0x1a5301<_0x4f1962[_0xdb57('0x20')];_0x1a5301++){if(_0x4f1962[_0x1a5301]!==''){var _0x38216c=_['filter'](promisesAdditionalPhones,{'contactId':_0x141768,'phone':_0x4f1962[_0x1a5301]});if(_0x38216c[_0xdb57('0x20')]==0x0){orderBy++;promisesAdditionalPhones[_0xdb57('0x1a')]({'contactId':_0x141768,'contactTypeId':_0x31e009,'phone':_0x4f1962[_0x1a5301],'orderBy':orderBy});}}}_0xd57b28({'ok':0x1});}else _0xd57b28({'res':0x0});});}function createAdditionalPhone(_0x2185b9,_0x2a9311,_0x51d0f0,_0x1df49d){var _0x5f18a8='';var _0x11a81b='';var _0x5cf3fe=_0x51d0f0[_0xdb57('0x1f')]('§');_0x5f18a8=_0x5cf3fe[0x0];if(_0x5cf3fe[_0xdb57('0x20')]==0x2)_0x11a81b=_0x5cf3fe[0x1];return new Promise(function(_0x287ac6,_0x445a78){return db[_0xdb57('0x21')][_0xdb57('0x22')]({'where':{'CmContactId':_0x2185b9,'item':_0x5f18a8}})['then'](function(_0x17af2c){if(_0x17af2c){return db[_0xdb57('0x21')][_0xdb57('0x23')]({'ItemTypeId':_0x2a9311,'description':_0x11a81b,'OrderBy':_0x1df49d},{'where':{'CmContactId':_0x2185b9,'item':_0x5f18a8}})[_0xdb57('0x1c')](function(_0x389877){_0x287ac6({'res':_0xdb57('0x24')});});}else{return db['CmContactHasItem'][_0xdb57('0x25')]({'CmContactId':_0x2185b9,'item':_0x5f18a8,'ItemTypeId':_0x2a9311,'description':_0x11a81b,'OrderBy':_0x1df49d,'ItemClass':_0xdb57('0x26')})[_0xdb57('0x1c')](function(_0x275b63){_0x287ac6({'res':_0xdb57('0x27')});});}});});}function updateContact(_0x5a7ada){return new Promise(function(_0x61cdf8,_0x1b6027){var _0x5eb11e=_0x5a7ada['id'];delete _0x5a7ada['id'];return db[_0xdb57('0x28')][_0xdb57('0x23')](_0x5a7ada,{'where':{'id':_0x5eb11e}})[_0xdb57('0x1c')](function(_0x299da2){updatedRows+=0x1;return db['CmHopper'][_0xdb57('0x23')]({'phone':_0x5a7ada[_0xdb57('0x10')]},{'where':{'ContactId':_0x5eb11e}})[_0xdb57('0x1c')](function(_0x188ede){_0x61cdf8({'ret':'OK'});});});});}function insertCmHopper(_0x3e4fc2,_0x26dc85,_0x39dd24,_0xbc22ea,_0x5bdc7b){var _0x4eba5c=[_0xdb57('0x29'),_0xdb57('0x2a'),_0xdb57('0x2b'),_0xdb57('0x2c'),_0x26dc85+'.'+_0xbc22ea,_0xdb57('0x2d'),_0xdb57('0x2e'),_0xdb57('0x2f'),_0xdb57('0x30'),'\x22'+_0x5bdc7b+'\x22'];return squel[_0xdb57('0x31')]()[_0xdb57('0x32')](_0xdb57('0x33'))[_0xdb57('0x34')]([_0xdb57('0x10'),_0xdb57('0x35'),_0xdb57('0x36'),_0xdb57('0x37'),_0xbc22ea,'createdAt','updatedAt',_0xdb57('0x38'),_0xdb57('0x39'),'recallme'],squel[_0xdb57('0xe')]()[_0xdb57('0x3a')](_0x4eba5c)[_0xdb57('0x11')](_0x26dc85)[_0xdb57('0x14')](_0xdb57('0x3b'),null,'cm_contacts.ListId\x20=\x20'+_0x26dc85+_0xdb57('0x3c'))[_0xdb57('0x14')](_0x39dd24,null,_0x39dd24+_0xdb57('0x3d')+_0x26dc85+'.'+_0xbc22ea)[_0xdb57('0x12')](_0x26dc85+_0xdb57('0x3e'),_0x3e4fc2)[_0xdb57('0x12')]('cm_contacts.createdAt\x20=\x20?',NOW)[_0xdb57('0x12')](_0xdb57('0x3f'),selectNotIn(_0x26dc85,_0x39dd24,_0xbc22ea,_0xdb57('0x33'),['\x22always\x22',_0xdb57('0x40')]))['where'](_0xdb57('0x3f'),selectNotIn(_0x26dc85,_0x39dd24,_0xbc22ea,_0xdb57('0x33'),[_0xdb57('0x41')])))[_0xdb57('0x42')]();}function insertCmHopperBlack(_0x38ce51,_0x253304,_0xfd6f46,_0x3889d3){var _0x4a0231=[_0xdb57('0x29'),'cm_contacts.id',_0xdb57('0x2c'),_0x253304+'.'+_0x3889d3,_0xdb57('0x2d'),_0xdb57('0x2e')];return squel[_0xdb57('0x31')]()[_0xdb57('0x32')](_0xdb57('0x43'))[_0xdb57('0x34')]([_0xdb57('0x10'),_0xdb57('0x36'),_0xdb57('0x37'),_0x3889d3,_0xdb57('0x44'),_0xdb57('0x45')],squel[_0xdb57('0xe')]()['fields'](_0x4a0231)[_0xdb57('0x11')](_0x253304)['join'](_0xdb57('0x3b'),null,_0xdb57('0x46')+_0x253304+_0xdb57('0x3c'))[_0xdb57('0x14')](_0xfd6f46,null,_0xfd6f46+_0xdb57('0x3d')+_0x253304+'.'+_0x3889d3)[_0xdb57('0x12')](_0x253304+_0xdb57('0x3e'),_0x38ce51)[_0xdb57('0x12')](_0xdb57('0x47'),NOW)['where']('cm_contacts.phone\x20NOT\x20IN\x20(?)',squel[_0xdb57('0xe')]()['field']('phone')[_0xdb57('0x11')](_0xdb57('0x43'))[_0xdb57('0x12')](_0xdb57('0x48'),_0x38ce51)[_0xdb57('0x12')](_0x3889d3+_0xdb57('0x49'),_0x253304+'.'+_0x3889d3)))['toString']();}function insertCmHopperAdditionalPhones(_0x572ce5){var _0x8fb354=[_0xdb57('0x4a'),'cm_contact_has_items.item',_0xdb57('0x4b'),_0xdb57('0x4c'),_0xdb57('0x4d')];return squel[_0xdb57('0x31')]()[_0xdb57('0x32')](_0xdb57('0x4e'))[_0xdb57('0x34')]([_0xdb57('0x4f'),_0xdb57('0x10'),_0xdb57('0x50'),_0xdb57('0x44'),_0xdb57('0x45')],squel[_0xdb57('0xe')]()[_0xdb57('0x3a')](_0x8fb354)['from'](_0xdb57('0x33'))[_0xdb57('0x14')]('cm_contacts',null,_0xdb57('0x51'))[_0xdb57('0x14')](_0xdb57('0x52'),null,_0xdb57('0x53'))[_0xdb57('0x12')](_0xdb57('0x54'),_0x572ce5)[_0xdb57('0x12')](_0xdb57('0x47'),NOW))[_0xdb57('0x42')]();}function insertCmContact(_0x30868b,_0x487405,_0x2c808d,_0x4bd81c){var _0x33b296=_['concat'](_[_0xdb57('0x55')](_0x4bd81c),[_0xdb57('0x37'),_0xdb57('0x56'),'createdAt',_0xdb57('0x45')]);return squel['insert']()[_0xdb57('0x32')](_0xdb57('0x3b'))[_0xdb57('0x34')](_0x33b296,squel[_0xdb57('0xe')]()[_0xdb57('0x3a')](_0x33b296)[_0xdb57('0x11')](_0x487405)['where']('('+_0x2c808d[_0xdb57('0x14')](',')+_0xdb57('0x57'),squel[_0xdb57('0xe')]()['fields'](_0x2c808d)[_0xdb57('0x11')](_0xdb57('0x3b'))[_0xdb57('0x12')](_0xdb57('0x48'),_0x30868b))['where'](_0xdb57('0x58'),squel[_0xdb57('0xe')]()[_0xdb57('0xf')](_0xdb57('0x59'),_0xdb57('0x5a'))[_0xdb57('0x11')](_0x487405)['group'](_0x2c808d[_0xdb57('0x14')](','))))[_0xdb57('0x42')]();}function handleStop(){logger[_0xdb57('0x5b')](_0xdb57('0x5c'));stopped=!![];}function handleUncaughtException(_0x166aa8){logger[_0xdb57('0x5d')](_0x166aa8[_0xdb57('0x1e')]);process['exit'](0x1);}function handleError(_0x3cf845,_0x42cd7e){stats[_0xdb57('0x5e')][_0xdb57('0x1a')]({'name':_0x42cd7e['code'],'message':_0x42cd7e[_0xdb57('0x1e')],'row':_0x3cf845});}function handleQuery(_0x3815a8){logger[_0xdb57('0x5b')](_0x3815a8);return db['sequelize'][_0xdb57('0x16')](_0x3815a8)['spread'](function(_0x49bce4){results[_0xdb57('0x1a')](_0x49bce4);})[_0xdb57('0x1d')](function(_0x507c3b){logger[_0xdb57('0x5d')](_0x507c3b[_0xdb57('0x1e')]);});}function main(_0x49524e,_0x1fe87f,_0xa53c2c,_0x3c2975){logger[_0xdb57('0x5b')]('main',_0x49524e,JSON['stringify'](_0x1fe87f));process[_0xdb57('0x5f')](_0xdb57('0x60'));var _0x20472e=_0x1fe87f[_0xdb57('0x61')];var _0x44f045=_[_0xdb57('0x62')](_0x20472e);var _0x4e2ba4=_0x1fe87f[_0xdb57('0x63')];var _0x2262c3=path['join'](config[_0xdb57('0x64')],'server/files/tmp',_0x4e2ba4+_0xdb57('0x65'));logger[_0xdb57('0x5b')](_0xdb57('0x66'),_0x1fe87f);db[_0xdb57('0x67')][_0xdb57('0x68')]({'raw':!![],'attributes':['id',_0xdb57('0x69')]})['then'](function(_0x4ba357){for(var _0x390bfa=0x0;_0x390bfa<_0x4ba357[_0xdb57('0x20')];_0x390bfa++){if(_0x4ba357[_0x390bfa][_0xdb57('0x69')]in _0x20472e){contactItemTypes['push'](_0x4ba357[_0x390bfa]);delete _0x44f045[_0x4ba357[_0x390bfa][_0xdb57('0x69')]];hasAdditionalPhones=!![];}for(var _0x1dc979 in _0x20472e){if(_0x4ba357[_0x390bfa]['name']+_0xdb57('0x6a')===_0x1dc979){phoneDescriptions[_0xdb57('0x1a')]({'itemTypeId':_0x4ba357[_0x390bfa]['id'],'description':_0x1dc979});delete _0x44f045[_0x1dc979];}}}if(hasAdditionalPhones)_0x44f045[_0xdb57('0x19')]='';var _0x54b155=_['keys'](_0x44f045)[_0xdb57('0x14')]();logger[_0xdb57('0x5b')]('header',_0x54b155);fs[_0xdb57('0x6b')](_0x2262c3,_0x54b155+'\x0a');Papa[_0xdb57('0x6c')](fs['createReadStream'](_0x49524e),{'header':!![],'skipEmptyLines':!![],'step':function(_0x1256c0,_0xa3d3d3){try{for(var _0x9b6fd4=0x0,_0x2ed7cc=[];_0x9b6fd4<_0x1256c0['data'][_0xdb57('0x20')];_0x9b6fd4++){stats[_0xdb57('0x6d')]+=0x1;if(_0x1256c0[_0xdb57('0x5e')][_0x9b6fd4]){handleError(_0x1256c0[_0xdb57('0x6e')][_0x9b6fd4],_0x1256c0[_0xdb57('0x5e')][_0x9b6fd4]);}else{var _0x5a6acd=[];var _0x51103e=[];var _0x2a0daf={};for(var _0x49ed94 in _0x20472e){let _0x481af9=contactItemTypes[_0xdb57('0x6f')](_0x181fb7=>_0x181fb7['name']===_0x49ed94);let _0x5c4207=contactItemTypes[_0xdb57('0x6f')](_0x1eda69=>_0x1eda69[_0xdb57('0x69')]+_0xdb57('0x6a')===_0x49ed94);if(_[_0xdb57('0x18')](_0x481af9)&&_['isNil'](_0x5c4207)){if(_0x20472e[_0xdb57('0x70')](_0x49ed94)){if(_0x1256c0[_0xdb57('0x6e')][_0x9b6fd4][_0x20472e[_0x49ed94]]){var _0x1da8f5=_[_0xdb57('0x71')](_0x1256c0[_0xdb57('0x6e')][_0x9b6fd4][_0x20472e[_0x49ed94]][_0xdb57('0x72')](/"/g,'\x27'));switch(_0x49ed94){case _0xdb57('0x35'):var _0x4e78e6=moment(_0x1da8f5,_0xdb57('0x73'),!![]);if(_0x4e78e6['isValid']()){_0x2ed7cc['push']('\x22'+_0x1da8f5+'\x22');}else{_0x5a6acd['push'](_0xdb57('0x74'));}break;case _0xdb57('0x38'):var _0x581a08=parseInt(_0x1da8f5);_0x1da8f5=_[_0xdb57('0x75')](_0x581a08)||_0x581a08<0x0||_0x581a08>0x4?_0x3c2975?0x3:0x2:_0x581a08;_0x2ed7cc[_0xdb57('0x1a')]('\x22'+_0x1da8f5+'\x22');break;case _0xdb57('0x39'):var _0x58df55=parseInt(_0x1da8f5);if(_['isNumber'](_0x58df55)&&_['includes'](_0xa53c2c,_0x58df55)){_0x2ed7cc['push']('\x22'+_0x58df55+'\x22');}else{_0x5a6acd[_0xdb57('0x1a')](_0xdb57('0x76'));}break;case _0xdb57('0x77'):if(isEmail(_0x1da8f5)){_0x2ed7cc[_0xdb57('0x1a')]('\x22'+_0x1da8f5+'\x22');}else{_0x5a6acd[_0xdb57('0x1a')]('email\x20wrong\x20format');}break;case _0xdb57('0x78'):var _0x5d77ab=moment(_0x1da8f5,_0xdb57('0x79'),!![]);if(_0x5d77ab[_0xdb57('0x7a')]()){_0x2ed7cc['push']('\x22'+_0x1da8f5+'\x22');}else{_0x5a6acd['push'](_0xdb57('0x7b'));}break;default:_0x2ed7cc[_0xdb57('0x1a')]('\x22'+_0x1da8f5+'\x22');}}else{switch(_0x49ed94){case _0xdb57('0x7c'):case'phone':_0x5a6acd[_0xdb57('0x1a')](_0x49ed94+_0xdb57('0x7d'));break;default:_0x2ed7cc[_0xdb57('0x1a')]('\x22\x22');}}}}else{var _0x2451e0='';if(!_[_0xdb57('0x18')](_0x481af9)){if(!_0x2a0daf[_0xdb57('0x70')](_0x481af9['id'])){for(var _0x241557=0x0;_0x241557<_0x20472e[_0x49ed94]['length'];_0x241557++){var _0x1da8f5=_[_0xdb57('0x71')](_0x1256c0[_0xdb57('0x6e')][_0x9b6fd4][_0x20472e[_0x49ed94][_0x241557]]['replace'](/"/g,'\x27'));var _0x8b1572=phoneDescriptions[_0xdb57('0x6f')](_0x51729f=>_0x51729f['itemTypeId']===_0x481af9['id']);if(!_[_0xdb57('0x18')](_0x8b1572)){var _0xfe2999=_[_0xdb57('0x71')](_0x1256c0['data'][_0x9b6fd4][_0x20472e[_0x8b1572[_0xdb57('0x7e')]][0x0]][_0xdb57('0x72')](/"/g,'\x27'));if(!_[_0xdb57('0x18')](_0xfe2999))_0x1da8f5=_0x1da8f5+'§'+_0xfe2999;}if(_0x2451e0=='')_0x2451e0=_0x1da8f5;else _0x2451e0+='|'+_0x1da8f5;}_0x51103e[_0xdb57('0x1a')](_0x481af9['id']+':'+_0x2451e0);_0x2a0daf[_0x481af9['id']]=0x1;}}}}if(hasAdditionalPhones){_0x2ed7cc[_0xdb57('0x1a')]('\x22'+_0x51103e[_0xdb57('0x14')](';')+'\x22');}if(_0x5a6acd[_0xdb57('0x20')]){handleError(_0x1256c0[_0xdb57('0x6e')][_0x9b6fd4],{'code':'SystemRow','message':_0x5a6acd['join']()});}else{fs[_0xdb57('0x7f')](_0x2262c3,_0x2ed7cc[_0xdb57('0x14')]()+'\x0a');}_0x2ed7cc=[];}if(!(stats[_0xdb57('0x6d')]%0xc8)){socket[_0xdb57('0x80')](_0xdb57('0x81')+_0x4e2ba4,stats);stats[_0xdb57('0x5e')]=[];}}if(stopped){logger[_0xdb57('0x5b')](_0xdb57('0x82'));_0xa3d3d3[_0xdb57('0x83')]();}}catch(_0x2b2024){handleError(_0x1256c0['data'][_0x9b6fd4],{'code':_0xdb57('0x84'),'message':_0x2b2024['message']});logger[_0xdb57('0x5d')](_0xdb57('0x85'),_0x2b2024[_0xdb57('0x1e')]);}},'complete':function(){try{var _0x215897=[];var _0x484d33=tempTableName;_0x215897[_0xdb57('0x1a')]('CREATE\x20TABLE\x20'+_0x484d33+_0xdb57('0x86'));logger[_0xdb57('0x5b')](_0xdb57('0x87'),contactItemTypes['length']);var _0x17d94c=util[_0xdb57('0xb')](_0xdb57('0x88'),_0x2262c3,_0x484d33,_0x54b155,_0x1fe87f['ListId'],_0x1fe87f[_0xdb57('0x56')]||null,NOW,NOW);if(_['isNil'](_0x20472e[_0xdb57('0x35')])){_0x17d94c+=_0xdb57('0x89');}_0x215897['push'](_0x17d94c);BPromise[_0xdb57('0x8a')](_0x215897,handleQuery)[_0xdb57('0x1c')](function(_0x6ce542){BPromise[_0xdb57('0x1b')]([handleAdditionalPhones()])['then'](function(){_0x215897=[];for(var _0x27fced=0x0;_0x27fced\x20\x20','root','existsSync','file\x20doesn\x27t\x20exists','binding\x20doesn\x27t\x20exists','ListId\x20is\x20mandatory','body\x20id\x20mandatory','map','No\x20agent\x20available','SIGINT'];(function(_0x2811c5,_0x3e6fcd){var _0x314335=function(_0x1f4dc7){while(--_0x1f4dc7){_0x2811c5['push'](_0x2811c5['shift']());}};_0x314335(++_0x3e6fcd);}(_0x7275,0x143));var _0x5727=function(_0x1f9636,_0x3171f9){_0x1f9636=_0x1f9636-0x0;var _0x4a55c2=_0x7275[_0x1f9636];return _0x4a55c2;};'use strict';var fs=require('fs');var path=require(_0x5727('0x0'));var _=require(_0x5727('0x1'));var Papa=require(_0x5727('0x2'));var util=require('util');var BPromise=require(_0x5727('0x3'));var moment=require('moment');var squel=require(_0x5727('0x4'));var Redis=require(_0x5727('0x5'));var db=require('../../../mysqldb')['db'];var config=require(_0x5727('0x6'));var logger=require(_0x5727('0x7'))('import');config['redis']=_['defaults'](config[_0x5727('0x8')],{'host':'localhost','port':0x18eb});var socket=require(_0x5727('0x9'))(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()[_0x5727('0xa')]('YYYY-MM-DD\x20HH:mm:ss');var tempTableName=_0x5727('0xb')+moment()[_0x5727('0xa')]('YYYYMMDDHHmmss');var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];function isEmail(_0x1b1258){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))*$/[_0x5727('0xc')](_0x1b1258);}function selectNotIn(_0x4f30e1,_0x274678,_0x1626f4,_0x4ca373,_0x9ee7f4){return squel[_0x5727('0xd')]()[_0x5727('0xe')](_0x5727('0xf'))[_0x5727('0x10')](_0x4ca373)[_0x5727('0x11')](_0x274678,null,_0x274678+'.id\x20=\x20'+_0x4ca373+'.'+_0x1626f4)[_0x5727('0x12')](_0x4ca373+'.'+_0x1626f4+_0x5727('0x13')+_0x4f30e1+'.'+_0x1626f4)[_0x5727('0x12')](_0x274678+_0x5727('0x14')+_0x9ee7f4[_0x5727('0x11')]()+')');}function handleAdditionalPhones(){return new Promise(function(_0x463721,_0x5e0d28){promisesAdditionalPhones=[];promisesContact=[];return db['sequelize'][_0x5727('0x15')](_0x5727('0x16')+tempTableName)[_0x5727('0x17')](function(_0x12b045){if(_0x12b045!==null){var _0xbc76a4=[];for(var _0x31b6c0=0x0;_0x31b6c0<_0x12b045[_0x5727('0x18')];_0x31b6c0++){var _0x508d70=_0x12b045[_0x31b6c0];if(!_[_0x5727('0x19')](_0x508d70['phone'])){if(!_[_0x5727('0x19')](_0x508d70[_0x5727('0x1a')]))_0xbc76a4['push'](insertAdditionalPhones(_0x508d70));promisesContact[_0x5727('0x1b')]({'contact':_0x508d70});}}}Promise[_0x5727('0x1c')](_0xbc76a4)[_0x5727('0x1d')](function(){_0x463721({'val':0x1});});})[_0x5727('0x1e')](function(_0x2879ca){logger['error'](_0x2879ca['message']);});});}function insertAdditionalPhones(_0x2a8359){return new Promise(function(_0xb99c6e,_0x84c9e2){var _0x18f638=_0x2a8359[_0x5727('0x1a')];if(_[_0x5727('0x19')](_0x18f638))_0x84c9e2({'val':0x0});else{var _0x3159e8=_0x18f638['split'](';');var _0x4aa3af=[];orderBy=0x0;for(var _0x476a47=0x0;_0x476a47<_0x3159e8[_0x5727('0x18')];_0x476a47++){_0x4aa3af['push'](splitAdditionalPhone(_0x2a8359['id'],_0x3159e8[_0x476a47]));}Promise[_0x5727('0x1c')](_0x4aa3af)[_0x5727('0x1d')](function(){_0xb99c6e({'val':_0x3159e8[_0x5727('0x18')]});});}});}function splitAdditionalPhone(_0x4a3e6b,_0x56d44b){return new Promise(function(_0x2198b9,_0x179e74){var _0x5d33bb=_0x56d44b[_0x5727('0x1f')](':');var _0x515aeb=_0x5d33bb[0x0];var _0x1c656f=_0x5d33bb[0x1];if(_0x1c656f!==''){var _0x1886dd=_0x1c656f['split']('|');var _0x564779=[];for(var _0x2dc1a4=0x0;_0x2dc1a4<_0x1886dd['length'];_0x2dc1a4++){if(_0x1886dd[_0x2dc1a4]!==''){var _0x4c5305=_[_0x5727('0x20')](promisesAdditionalPhones,{'contactId':_0x4a3e6b,'phone':_0x1886dd[_0x2dc1a4]});if(_0x4c5305[_0x5727('0x18')]==0x0){orderBy++;promisesAdditionalPhones[_0x5727('0x1b')]({'contactId':_0x4a3e6b,'contactTypeId':_0x515aeb,'phone':_0x1886dd[_0x2dc1a4],'orderBy':orderBy});}}}_0x2198b9({'ok':0x1});}else _0x2198b9({'res':0x0});});}function createAdditionalPhone(_0xf82573,_0x3afd59,_0x56e93d,_0x55194a){var _0x1a6356='';var _0x1d58ea='';var _0x1b2cc7=_0x56e93d[_0x5727('0x1f')]('§');_0x1a6356=_0x1b2cc7[0x0];if(_0x1b2cc7['length']==0x2)_0x1d58ea=_0x1b2cc7[0x1];return new Promise(function(_0x42aa0d,_0x4b8ce3){return db[_0x5727('0x21')]['findOne']({'where':{'CmContactId':_0xf82573,'item':_0x1a6356}})[_0x5727('0x1d')](function(_0x5a6827){if(_0x5a6827){return db[_0x5727('0x21')][_0x5727('0x22')]({'ItemTypeId':_0x3afd59,'description':_0x1d58ea,'OrderBy':_0x55194a},{'where':{'CmContactId':_0xf82573,'item':_0x1a6356}})[_0x5727('0x1d')](function(_0x11c419){_0x42aa0d({'res':'updated'});});}else{return db[_0x5727('0x21')][_0x5727('0x23')]({'CmContactId':_0xf82573,'item':_0x1a6356,'ItemTypeId':_0x3afd59,'description':_0x1d58ea,'OrderBy':_0x55194a,'ItemClass':'PHONE'})['then'](function(_0x29a05e){_0x42aa0d({'res':_0x5727('0x24')});});}});});}function updateContact(_0x46047c){return new Promise(function(_0xbd21c8,_0x31be29){var _0x51fcf7=_0x46047c['id'];delete _0x46047c['id'];return db[_0x5727('0x25')][_0x5727('0x22')](_0x46047c,{'where':{'id':_0x51fcf7}})[_0x5727('0x1d')](function(_0x38e0ed){updatedRows+=0x1;return db[_0x5727('0x26')][_0x5727('0x22')]({'phone':_0x46047c[_0x5727('0xf')]},{'where':{'ContactId':_0x51fcf7}})[_0x5727('0x1d')](function(_0x299a6e){_0xbd21c8({'ret':'OK'});});});});}function insertCmHopper(_0x27a721,_0xcd63b3,_0x41e149,_0x46db57,_0x1ac3e1){var _0x4c18cc=[_0x5727('0x27'),_0x5727('0x28'),_0x5727('0x29'),_0x5727('0x2a'),_0xcd63b3+'.'+_0x46db57,_0x5727('0x2b'),'cm_contacts.updatedAt',_0x5727('0x2c'),_0x5727('0x2d'),'\x22'+_0x1ac3e1+'\x22'];return squel[_0x5727('0x2e')]()['into']('cm_hopper')[_0x5727('0x2f')](['phone','scheduledat','ContactId','ListId',_0x46db57,_0x5727('0x30'),_0x5727('0x31'),_0x5727('0x32'),'UserId',_0x5727('0x33')],squel[_0x5727('0xd')]()[_0x5727('0x34')](_0x4c18cc)['from'](_0xcd63b3)[_0x5727('0x11')](_0x5727('0x35'),null,_0x5727('0x36')+_0xcd63b3+'.CmListId')[_0x5727('0x11')](_0x41e149,null,_0x41e149+'.id\x20=\x20'+_0xcd63b3+'.'+_0x46db57)[_0x5727('0x12')](_0xcd63b3+_0x5727('0x37'),_0x27a721)['where'](_0x5727('0x38'),NOW)[_0x5727('0x12')](_0x5727('0x39'),selectNotIn(_0xcd63b3,_0x41e149,_0x46db57,_0x5727('0x3a'),[_0x5727('0x3b'),_0x5727('0x3c')]))[_0x5727('0x12')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0xcd63b3,_0x41e149,_0x46db57,_0x5727('0x3a'),[_0x5727('0x3b')])))[_0x5727('0x3d')]();}function insertCmHopperBlack(_0x54cfda,_0x3c524b,_0x394c62,_0x47074e){var _0x28801e=[_0x5727('0x27'),_0x5727('0x29'),_0x5727('0x2a'),_0x3c524b+'.'+_0x47074e,'cm_contacts.createdAt',_0x5727('0x3e')];return squel[_0x5727('0x2e')]()[_0x5727('0x3f')](_0x5727('0x40'))[_0x5727('0x2f')]([_0x5727('0xf'),_0x5727('0x41'),_0x5727('0x42'),_0x47074e,_0x5727('0x30'),_0x5727('0x31')],squel[_0x5727('0xd')]()[_0x5727('0x34')](_0x28801e)[_0x5727('0x10')](_0x3c524b)[_0x5727('0x11')](_0x5727('0x35'),null,_0x5727('0x36')+_0x3c524b+_0x5727('0x43'))[_0x5727('0x11')](_0x394c62,null,_0x394c62+'.id\x20=\x20'+_0x3c524b+'.'+_0x47074e)['where'](_0x3c524b+_0x5727('0x37'),_0x54cfda)[_0x5727('0x12')]('cm_contacts.createdAt\x20=\x20?',NOW)[_0x5727('0x12')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',squel[_0x5727('0xd')]()[_0x5727('0xe')](_0x5727('0xf'))[_0x5727('0x10')]('cm_hopper_black')['where'](_0x5727('0x44'),_0x54cfda)[_0x5727('0x12')](_0x47074e+_0x5727('0x45'),_0x3c524b+'.'+_0x47074e)))[_0x5727('0x3d')]();}function insertCmHopperAdditionalPhones(_0x37570b){var _0x5969a4=[_0x5727('0x46'),_0x5727('0x47'),_0x5727('0x48'),'cm_contact_has_items.createdAt',_0x5727('0x49')];return squel[_0x5727('0x2e')]()[_0x5727('0x3f')](_0x5727('0x4a'))[_0x5727('0x2f')]([_0x5727('0x4b'),_0x5727('0xf'),_0x5727('0x4c'),'createdAt',_0x5727('0x31')],squel[_0x5727('0xd')]()['fields'](_0x5969a4)[_0x5727('0x10')]('cm_hopper')[_0x5727('0x11')](_0x5727('0x35'),null,_0x5727('0x4d'))['join'](_0x5727('0x4e'),null,_0x5727('0x4f'))['where'](_0x5727('0x50'),_0x37570b)[_0x5727('0x12')](_0x5727('0x38'),NOW))[_0x5727('0x3d')]();}function insertCmContact(_0xa68aa1,_0x1cf35d,_0x367689,_0x43a7d0){var _0x40104d=_[_0x5727('0x51')](_[_0x5727('0x52')](_0x43a7d0),[_0x5727('0x42'),_0x5727('0x53'),_0x5727('0x30'),_0x5727('0x31')]);return squel['insert']()['into'](_0x5727('0x35'))[_0x5727('0x2f')](_0x40104d,squel['select']()['fields'](_0x40104d)['from'](_0x1cf35d)[_0x5727('0x12')]('('+_0x367689[_0x5727('0x11')](',')+_0x5727('0x54'),squel[_0x5727('0xd')]()[_0x5727('0x34')](_0x367689)[_0x5727('0x10')](_0x5727('0x35'))[_0x5727('0x12')](_0x5727('0x44'),_0xa68aa1))[_0x5727('0x12')](_0x5727('0x55'),squel[_0x5727('0xd')]()['field'](_0x5727('0x56'),'min_id')[_0x5727('0x10')](_0x1cf35d)[_0x5727('0x57')](_0x367689[_0x5727('0x11')](','))))[_0x5727('0x3d')]();}function handleStop(){logger[_0x5727('0x58')]('Received\x20SIGINT');stopped=!![];}function handleUncaughtException(_0x792a5b){logger[_0x5727('0x59')](_0x792a5b[_0x5727('0x5a')]);process[_0x5727('0x5b')](0x1);}function handleError(_0x4962e3,_0x17b3e8){stats[_0x5727('0x5c')][_0x5727('0x1b')]({'name':_0x17b3e8[_0x5727('0x5d')],'message':_0x17b3e8[_0x5727('0x5a')],'row':_0x4962e3});}function handleQuery(_0x31ee1d){logger['info'](_0x31ee1d);return db[_0x5727('0x5e')][_0x5727('0x15')](_0x31ee1d)[_0x5727('0x17')](function(_0xfccdb7){results[_0x5727('0x1b')](_0xfccdb7);})['catch'](function(_0x25b8dc){logger[_0x5727('0x59')](_0x25b8dc[_0x5727('0x5a')]);});}function main(_0x324e95,_0x2100ce,_0x5c90f0,_0x247697){logger[_0x5727('0x58')](_0x5727('0x5f'),_0x324e95,JSON[_0x5727('0x60')](_0x2100ce));process[_0x5727('0x61')](_0x5727('0x62'));var _0x5c2838=_0x2100ce[_0x5727('0x63')];var _0x4a999e=_[_0x5727('0x64')](_0x5c2838);var _0x325514=_0x2100ce[_0x5727('0x65')];var _0x25277c=path[_0x5727('0x11')](config['root'],_0x5727('0x66'),_0x325514+_0x5727('0x67'));logger[_0x5727('0x58')](_0x5727('0x68'),_0x2100ce);db['ContactItemType'][_0x5727('0x69')]({'raw':!![],'attributes':['id',_0x5727('0x6a')]})[_0x5727('0x1d')](function(_0x3286ee){for(var _0x305ea5=0x0;_0x305ea5<_0x3286ee['length'];_0x305ea5++){if(_0x3286ee[_0x305ea5][_0x5727('0x6a')]in _0x5c2838){contactItemTypes[_0x5727('0x1b')](_0x3286ee[_0x305ea5]);delete _0x4a999e[_0x3286ee[_0x305ea5]['name']];hasAdditionalPhones=!![];}for(var _0x323a1c in _0x5c2838){if(_0x3286ee[_0x305ea5][_0x5727('0x6a')]+_0x5727('0x6b')===_0x323a1c){phoneDescriptions[_0x5727('0x1b')]({'itemTypeId':_0x3286ee[_0x305ea5]['id'],'description':_0x323a1c});delete _0x4a999e[_0x323a1c];}}}if(hasAdditionalPhones)_0x4a999e[_0x5727('0x1a')]='';var _0x48fce5=_[_0x5727('0x52')](_0x4a999e)[_0x5727('0x11')]();logger['info'](_0x5727('0x6c'),_0x48fce5);fs[_0x5727('0x6d')](_0x25277c,_0x48fce5+'\x0a');Papa[_0x5727('0x6e')](fs['createReadStream'](_0x324e95),{'header':!![],'skipEmptyLines':!![],'step':function(_0x1c62be,_0x297d4e){try{for(var _0x370a65=0x0,_0x1b417b=[];_0x370a65<_0x1c62be[_0x5727('0x6f')][_0x5727('0x18')];_0x370a65++){stats[_0x5727('0x70')]+=0x1;if(_0x1c62be[_0x5727('0x5c')][_0x370a65]){handleError(_0x1c62be['data'][_0x370a65],_0x1c62be[_0x5727('0x5c')][_0x370a65]);}else{var _0x261cc6=[];var _0x296766=[];var _0x4f2f63={};for(var _0x2a0e17 in _0x5c2838){let _0x53b70e=contactItemTypes[_0x5727('0x71')](_0x17a08d=>_0x17a08d[_0x5727('0x6a')]===_0x2a0e17);let _0x39c8dc=contactItemTypes['find'](_0x172934=>_0x172934[_0x5727('0x6a')]+_0x5727('0x6b')===_0x2a0e17);if(_['isNil'](_0x53b70e)&&_[_0x5727('0x19')](_0x39c8dc)){if(_0x5c2838[_0x5727('0x72')](_0x2a0e17)){if(_0x1c62be['data'][_0x370a65][_0x5c2838[_0x2a0e17]]){var _0x21fbf5=_['trim'](_0x1c62be[_0x5727('0x6f')][_0x370a65][_0x5c2838[_0x2a0e17]][_0x5727('0x73')](/"/g,'\x27'));switch(_0x2a0e17){case _0x5727('0x74'):var _0x20f3a=moment(_0x21fbf5,_0x5727('0x75'),!![]);if(_0x20f3a['isValid']()){_0x1b417b[_0x5727('0x1b')]('\x22'+_0x21fbf5+'\x22');}else{_0x261cc6[_0x5727('0x1b')]('scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)');}break;case _0x5727('0x32'):var _0x2de93b=parseInt(_0x21fbf5);_0x21fbf5=_['isNaN'](_0x2de93b)||_0x2de93b<0x0||_0x2de93b>0x4?_0x247697?0x3:0x2:_0x2de93b;_0x1b417b[_0x5727('0x1b')]('\x22'+_0x21fbf5+'\x22');break;case _0x5727('0x76'):var _0x4ad4ba=parseInt(_0x21fbf5);if(_[_0x5727('0x77')](_0x4ad4ba)&&_[_0x5727('0x78')](_0x5c90f0,_0x4ad4ba)){_0x1b417b['push']('\x22'+_0x4ad4ba+'\x22');}else{_0x261cc6[_0x5727('0x1b')](_0x5727('0x79'));}break;case _0x5727('0x7a'):if(isEmail(_0x21fbf5)){_0x1b417b[_0x5727('0x1b')]('\x22'+_0x21fbf5+'\x22');}else{_0x261cc6[_0x5727('0x1b')](_0x5727('0x7b'));}break;case _0x5727('0x7c'):var _0x31bb59=moment(_0x21fbf5,'YYYY-MM-DD',!![]);if(_0x31bb59[_0x5727('0x7d')]()){_0x1b417b['push']('\x22'+_0x21fbf5+'\x22');}else{_0x261cc6[_0x5727('0x1b')](_0x5727('0x7e'));}break;default:_0x1b417b[_0x5727('0x1b')]('\x22'+_0x21fbf5+'\x22');}}else{switch(_0x2a0e17){case _0x5727('0x7f'):case _0x5727('0xf'):_0x261cc6[_0x5727('0x1b')](_0x2a0e17+_0x5727('0x80'));break;default:_0x1b417b[_0x5727('0x1b')]('\x22\x22');}}}}else{var _0x3cf97a='';if(!_['isNil'](_0x53b70e)){if(!_0x4f2f63[_0x5727('0x72')](_0x53b70e['id'])){for(var _0x3a5745=0x0;_0x3a5745<_0x5c2838[_0x2a0e17][_0x5727('0x18')];_0x3a5745++){var _0x21fbf5=_[_0x5727('0x81')](_0x1c62be[_0x5727('0x6f')][_0x370a65][_0x5c2838[_0x2a0e17][_0x3a5745]][_0x5727('0x73')](/"/g,'\x27'));var _0x11d752=phoneDescriptions['find'](_0x44b98b=>_0x44b98b[_0x5727('0x82')]===_0x53b70e['id']);if(!_[_0x5727('0x19')](_0x11d752)){var _0x4328d3=_[_0x5727('0x81')](_0x1c62be[_0x5727('0x6f')][_0x370a65][_0x5c2838[_0x11d752[_0x5727('0x83')]][0x0]]['replace'](/"/g,'\x27'));if(!_[_0x5727('0x19')](_0x4328d3))_0x21fbf5=_0x21fbf5+'§'+_0x4328d3;}if(_0x3cf97a=='')_0x3cf97a=_0x21fbf5;else _0x3cf97a+='|'+_0x21fbf5;}_0x296766[_0x5727('0x1b')](_0x53b70e['id']+':'+_0x3cf97a);_0x4f2f63[_0x53b70e['id']]=0x1;}}}}if(hasAdditionalPhones){_0x1b417b[_0x5727('0x1b')]('\x22'+_0x296766[_0x5727('0x11')](';')+'\x22');}if(_0x261cc6['length']){handleError(_0x1c62be[_0x5727('0x6f')][_0x370a65],{'code':'SystemRow','message':_0x261cc6[_0x5727('0x11')]()});}else{fs[_0x5727('0x84')](_0x25277c,_0x1b417b['join']()+'\x0a');}_0x1b417b=[];}if(!(stats['rows']%0xc8)){socket[_0x5727('0x85')](_0x5727('0x86')+_0x325514,stats);stats[_0x5727('0x5c')]=[];}}if(stopped){logger['info']('Abort\x20parser');_0x297d4e[_0x5727('0x87')]();}}catch(_0x4444dc){handleError(_0x1c62be['data'][_0x370a65],{'code':_0x5727('0x88'),'message':_0x4444dc[_0x5727('0x5a')]});logger[_0x5727('0x59')](_0x5727('0x89'),_0x4444dc[_0x5727('0x5a')]);}},'complete':function(){try{var _0x8a8f7f=[];var _0x2aabe8=tempTableName;_0x8a8f7f['push'](_0x5727('0x8a')+_0x2aabe8+'\x20LIKE\x20cm_contacts;');logger[_0x5727('0x58')]('CIS\x20len',contactItemTypes[_0x5727('0x18')]);var _0x5482b6=util[_0x5727('0xa')](_0x5727('0x8b'),_0x25277c,_0x2aabe8,_0x48fce5,_0x2100ce[_0x5727('0x42')],_0x2100ce[_0x5727('0x53')]||null,NOW,NOW);if(_['isNil'](_0x5c2838[_0x5727('0x74')])){_0x5482b6+=_0x5727('0x8c');}_0x8a8f7f[_0x5727('0x1b')](_0x5482b6);BPromise[_0x5727('0x8d')](_0x8a8f7f,handleQuery)[_0x5727('0x1d')](function(_0x258d56){BPromise[_0x5727('0x1c')]([handleAdditionalPhones()])[_0x5727('0x1d')](function(){_0x8a8f7f=[];for(var _0x4cd568=0x0;_0x4cd568\x20\x27\x27\x20AND\x20i.to\x20NOT\x20LIKE\x20CONCAT(\x27%\x27,\x20a.email,\x20\x27%\x27)\x20THEN\x20TRIM(SUBSTRING_INDEX(i.to,\x20\x27<\x27,\x201))\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName','i.createdAt','i.updatedAt','i.closed','i.attach','i.lastMsgAt','i.lastMsgDirection','i.ContactId','i.MailAccountId','i.UserId','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','Contact.firstName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.fax','o.fullname','Owner.fullname','o.internal','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','limit','offset','query','groupBy','findOne','enableEmailPreview','clone','COUNT(*)','isEmpty','t.id\x20IN\x20?','SELECT','exports','lodash','squel','../parsers/advancedSearch','../parsers/qs','./update-interaction','./utils','../../mysqldb','getAccountFK','role','agent','search','select','field','from','tools_tags','getInteractionFK','u.id','u.fullname'];(function(_0x521378,_0x2f8004){var _0x4b2fc4=function(_0x25511e){while(--_0x25511e){_0x521378['push'](_0x521378['shift']());}};_0x4b2fc4(++_0x2f8004);}(_0x7a2b,0x130));var _0xb7a2=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x7a2b[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0xb7a2('0x0'));var squel=require(_0xb7a2('0x1'));var as=require(_0xb7a2('0x2'));var qs=require(_0xb7a2('0x3'));var updateInteraction=require(_0xb7a2('0x4'))['updateInteraction'];var utils=require(_0xb7a2('0x5'));var db=require(_0xb7a2('0x6'))['db'];function skipInteractionsQuery(_0x20cceb,_0x3ed67e,_0x53d061){var _0x2c0844=![];var _0x4e2a80=utils[_0xb7a2('0x7')](_0x20cceb);if(_0x3ed67e[_0xb7a2('0x8')]===_0xb7a2('0x9')&&!_0x53d061[_0xb7a2('0xa')]&&!_0x53d061[_0x4e2a80]){_0x2c0844=!![];}return _0x2c0844;}function getTagsQuery(){return squel[_0xb7a2('0xb')]()[_0xb7a2('0xc')]('id')['field']('name')[_0xb7a2('0xc')]('color')[_0xb7a2('0xd')](_0xb7a2('0xe'));}function getUsersQuery(_0x3db789,_0x5b6c5a){var _0x3b3017=utils[_0xb7a2('0xf')](_0x3db789);var _0x2bf281='user_has_'+_0x3db789+'_interactions';var _0x4bc454=squel[_0xb7a2('0xb')]()['field'](_0xb7a2('0x10'))['field'](_0xb7a2('0x11'))[_0xb7a2('0xc')](_0xb7a2('0x12')+_0x3b3017)[_0xb7a2('0xd')](_0x2bf281,'ui')[_0xb7a2('0x13')](_0xb7a2('0x14'),'u',_0xb7a2('0x15'));if(_0x5b6c5a[_0xb7a2('0x16')]>0x0){_0x4bc454[_0xb7a2('0x17')]('ui.'+_0x3b3017+_0xb7a2('0x18'),_[_0xb7a2('0x19')](_0x5b6c5a,'id'));}return _0x4bc454;}function getInteractionsQuery(_0x309900){var _0x3f105d=utils['getInteractionsTables'](_0x309900);var _0x20a244=utils[_0xb7a2('0x7')](_0x309900);var _0x37988b=utils[_0xb7a2('0xf')](_0x309900);return squel[_0xb7a2('0xb')]()[_0xb7a2('0xd')](_0x3f105d[_0xb7a2('0x1a')],'i')[_0xb7a2('0x13')](_0xb7a2('0x1b'),'c',_0xb7a2('0x1c'))[_0xb7a2('0x13')](_0xb7a2('0x14'),'o',_0xb7a2('0x1d'))[_0xb7a2('0x13')](_0x3f105d[_0xb7a2('0x1e')],'a',_0xb7a2('0x1f')+_0x20a244)[_0xb7a2('0x13')](_0x3f105d[_0xb7a2('0x20')],'me',_0xb7a2('0x21')+_0x37988b+_0xb7a2('0x22'))[_0xb7a2('0x13')](_0x3f105d['interactionsTags'],'it','it.'+_0x37988b+_0xb7a2('0x22'))[_0xb7a2('0x13')](_0xb7a2('0xe'),'t','t.id\x20=\x20it.TagId');}function getSqlClauses(){var _0x430897={'body':squel['expr'](),'contact':squel[_0xb7a2('0x23')](),'default':squel[_0xb7a2('0x23')](),'fields':squel[_0xb7a2('0x23')](),'filter':squel[_0xb7a2('0x23')](),'read':squel['expr'](),'tags':{'clause':squel[_0xb7a2('0x23')](),'ids':null},'user':squel[_0xb7a2('0x23')]()};return _0x430897;}function parseTagParameter(_0xa5653b){var _0x412b8=squel['expr']();if(_0xa5653b){var _0x3cc1a8=utils[_0xb7a2('0x24')](_0xa5653b);_0x3cc1a8[_0xb7a2('0x25')](function(_0x1defc3){_0x412b8['or'](_0xb7a2('0x26'),'%,'+_0x1defc3+',%');});}return _0x412b8;}function parseReadParameter(_0x35c7bb){var _0x24f18e='';if(_0x35c7bb){_0x24f18e=_0xb7a2('0x27');if(_0x35c7bb==='1'){_0x24f18e=_0x24f18e['replace'](_0xb7a2('0x28'),'=');}else{_0x24f18e=_0x24f18e['replace'](_0xb7a2('0x28'),'>');}}return _0x24f18e;}function parseSearchFilter(_0x115a48,_0x173b22){var _0x44876d=squel[_0xb7a2('0x23')]();if(_0x173b22){var _0x236d67=_0x173b22[_0xb7a2('0x29')]('\x5c','\x5c\x5c')[_0xb7a2('0x29')](/'/g,'\x27\x27');if(qs[_0xb7a2('0x2a')](_0x236d67)){_0x44876d['or'](_0xb7a2('0x2b'),_0x236d67+'%');if([_0xb7a2('0x2c'),_0xb7a2('0x2d')][_0xb7a2('0x2e')](_0x115a48)){_0x44876d['or'](_0xb7a2('0x2f'),_0x236d67+'%');}else if(_0x115a48===_0xb7a2('0x30')){_0x44876d['or'](_0xb7a2('0x31'),_0x236d67+'%');}else if(_0x115a48===_0xb7a2('0x32')){_0x44876d['or']('i.from\x20LIKE\x20?',_0x236d67+'%');}}else if(_0x115a48===_0xb7a2('0x33')&&qs[_0xb7a2('0x34')](_0x236d67)){_0x44876d['or'](_0xb7a2('0x35'),_0x236d67+'%');}else{if(_0x115a48===_0xb7a2('0x33')){_0x44876d['or'](_0xb7a2('0x36'),qs[_0xb7a2('0x37')](_0x236d67,!![]))['or'](_0xb7a2('0x38'),qs[_0xb7a2('0x37')](_0x236d67));}else if(_0x115a48!==_0xb7a2('0x30')){_0x44876d['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xb7a2('0x37')](_0x236d67));}_0x44876d['or'](_0xb7a2('0x39'),qs[_0xb7a2('0x37')](_0x236d67,!![]),null);}}return _0x44876d;}function parseAdvancedSearchFilter(_0x2d2ebe,_0xbf0074){var _0x20595f=getSqlClauses();var _0x23eabb=as[_0xb7a2('0x3a')](_0x2d2ebe);var _0x2b8fdf=_0x23eabb['sqlOperator'];for(var _0xd41434=0x0;_0xd41434<_0x23eabb[_0xb7a2('0x3b')][_0xb7a2('0x16')];_0xd41434++){var _0xae74bc=_0x23eabb['conditions'][_0xd41434];var _0x425ea3='i';var _0x150c14=_['find'](_0xbf0074,[_0xb7a2('0x3c'),_0xae74bc[_0xb7a2('0xc')]]);if(_0x150c14){var _0x4234e8=as[_0xb7a2('0x3d')](_0x425ea3,_0x150c14[_0xb7a2('0x3e')],_0xae74bc);_0x20595f['default'][_0x2b8fdf](_0x4234e8[_0xb7a2('0x3f')],_0x4234e8['value']['start'],_0x4234e8['value'][_0xb7a2('0x40')]);}else{switch(_0xae74bc[_0xb7a2('0xc')]){case _0xb7a2('0x41'):var _0x4a47da=parseReadParameter(_0xae74bc[_0xb7a2('0x42')]);_0x20595f['read'][_0xb7a2('0x43')](_0x4a47da);break;case _0xb7a2('0x44'):if(_0xae74bc['operator']==='$substring'){if(_0xae74bc['value'][_0xb7a2('0x45')]('\x20')[_0xb7a2('0x16')]>0x1){_0x20595f[_0xb7a2('0x46')][_0x2b8fdf](_0xb7a2('0x39'),qs[_0xb7a2('0x37')](_0xae74bc[_0xb7a2('0x42')],!![]),null);}else{var _0x57d640='%'+_0xae74bc['value']+'%';_0x20595f['contact'][_0x2b8fdf](_0xb7a2('0x47'),_0x57d640,_0x57d640,_0x57d640);}}else{_0x150c14=_[_0xb7a2('0x48')](_0xbf0074,[_0xb7a2('0x3c'),_0xb7a2('0x49')]);_0xae74bc[_0xb7a2('0xc')]=_0xb7a2('0x49');_0x4234e8=as[_0xb7a2('0x3d')](_0x425ea3,_0x150c14[_0xb7a2('0x3e')],_0xae74bc);_0x20595f['contact'][_0x2b8fdf](_0x4234e8['text'],_0x4234e8['value'][_0xb7a2('0x4a')],_0x4234e8[_0xb7a2('0x42')][_0xb7a2('0x40')]);}break;case _0xb7a2('0x4b'):var _0x533ae1=_0xae74bc[_0xb7a2('0x42')]['split'](',')[_0xb7a2('0x19')](function(_0xae530){return Number(_0xae530);});var _0x5ae85f=parseTagParameter(_0x533ae1);_0x20595f[_0xb7a2('0x4c')]['clause'][_0xb7a2('0x43')](_0x5ae85f);_0x20595f['tags'][_0xb7a2('0x4d')]=_0x533ae1;break;case'User':if(_0xae74bc[_0xb7a2('0x4e')]===_0xb7a2('0x4f')){_0x20595f[_0xb7a2('0x50')][_0x2b8fdf](_0xb7a2('0x51'),'%'+_0xae74bc[_0xb7a2('0x42')]+'%',null);}else{_0x150c14=_[_0xb7a2('0x48')](_0xbf0074,['name',_0xb7a2('0x52')]);_0xae74bc[_0xb7a2('0xc')]=_0xb7a2('0x52');_0x4234e8=as[_0xb7a2('0x3d')](_0x425ea3,_0x150c14[_0xb7a2('0x3e')],_0xae74bc);_0x20595f[_0xb7a2('0x50')][_0x2b8fdf](_0x4234e8['text'],_0x4234e8[_0xb7a2('0x42')][_0xb7a2('0x4a')],_0x4234e8[_0xb7a2('0x42')]['end']);}break;case _0xb7a2('0x53'):case _0xb7a2('0x54'):_0x4234e8=as[_0xb7a2('0x3d')]('me',null,_0xae74bc);_0x20595f[_0xb7a2('0x53')][_0x2b8fdf](_0x4234e8[_0xb7a2('0x3f')],_0x4234e8[_0xb7a2('0x42')][_0xb7a2('0x4a')],_0x4234e8[_0xb7a2('0x42')][_0xb7a2('0x40')]);break;}}}return _0x20595f;}function parseModelFields(_0xbf6ee1,_0x5e3d14,_0x3f94d5){var _0xc5e5e7=utils[_0xb7a2('0x7')](_0xbf6ee1);var _0x20c1a1=squel[_0xb7a2('0x23')]();var _0x1b63d7=_(_0x5e3d14)['keys']()[_0xb7a2('0x19')](function(_0x1d4f25){return _[_0xb7a2('0x55')](_0x3f94d5,[_0xb7a2('0x3c'),_0x1d4f25])?_0x1d4f25:undefined;})[_0xb7a2('0x56')]()[_0xb7a2('0x42')]();if(_0x1b63d7[_0xb7a2('0x16')]>0x0){_0x1b63d7[_0xb7a2('0x25')](function(_0x5f1b00){if(_0x5f1b00===_0xc5e5e7){_0x20c1a1[_0xb7a2('0x43')]('i.'+_0xc5e5e7+_0xb7a2('0x18'),[]['concat'](_0x5e3d14[_0x5f1b00]));}else if(_0x5f1b00===_0xb7a2('0x57')){var _0x308145=JSON[_0xb7a2('0x58')](_0x5e3d14[_0x5f1b00])[_0xb7a2('0x59')];var _0x596508=JSON['parse'](_0x5e3d14[_0x5f1b00])['$lte'];_0x20c1a1['and'](_0xb7a2('0x5a'),_0x308145,_0x596508);}else{if(_0x5e3d14[_0x5f1b00]===_0xb7a2('0x5b')){_0x20c1a1[_0xb7a2('0x43')]('i.'+_0x5f1b00+'\x20IS\x20NULL');}else{_0x20c1a1['and']('i.'+_0x5f1b00+'\x20=\x20?',_0x5e3d14[_0x5f1b00]);}}});}return _0x20c1a1;}function parseQueryParameters(_0x5d37e6,_0x4965cf,_0x539253){var _0x44dffc=getSqlClauses();return Promise[_0xb7a2('0x5c')]()['then'](function(){return parseModelFields(_0x5d37e6,_0x4965cf,_0x539253);})[_0xb7a2('0x5d')](function(_0x30d6bf){_0x44dffc['fields'][_0xb7a2('0x43')](_0x30d6bf);return parseReadParameter(_0x4965cf[_0xb7a2('0x5e')]);})[_0xb7a2('0x5d')](function(_0x3ce9d5){_0x44dffc[_0xb7a2('0x5e')][_0xb7a2('0x43')](_0x3ce9d5);return parseTagParameter(_0x4965cf[_0xb7a2('0x5f')]);})[_0xb7a2('0x5d')](function(_0x5ddd80){_0x44dffc[_0xb7a2('0x4c')][_0xb7a2('0x60')]['and'](_0x5ddd80);return parseSearchFilter(_0x5d37e6,_0x4965cf['filter']);})[_0xb7a2('0x5d')](function(_0x1d6d4c){_0x44dffc[_0xb7a2('0x61')]=_0x1d6d4c;return _0x44dffc;});}function checkAccountsRestrictions(_0x30f517,_0x36235b,_0x488533){var _0x2301db=utils[_0xb7a2('0x7')](_0x30f517);var _0x498a49=_0xb7a2('0x62')+_[_0xb7a2('0x63')](_0x30f517)+(_0x30f517===_0xb7a2('0x64')?'Websites':_0xb7a2('0x65'));var _0x226fce=squel[_0xb7a2('0x23')]();return Promise[_0xb7a2('0x5c')]()[_0xb7a2('0x5d')](function(){if(_0x488533['search']&&_0x36235b[_0xb7a2('0x8')]===_0xb7a2('0x9')){return _0x36235b[_0x498a49]({'attributes':['id'],'raw':!![]});}})[_0xb7a2('0x5d')](function(_0x52d212){if(_0x52d212){if(_0x52d212['length']===0x0){_0x226fce[_0xb7a2('0x43')]('i.'+_0x2301db+_0xb7a2('0x66'));}else{_0x226fce[_0xb7a2('0x43')]('i.'+_0x2301db+'\x20IN\x20?',_['map'](_0x52d212,'id'));}}else if(!_0x488533[_0x2301db]){_0x226fce[_0xb7a2('0x43')]('i.'+_0x2301db+_0xb7a2('0x67'));}})['then'](function(){return _0x226fce;});}function getClosedOrderClause(_0x35ccad,_0x69b103){var _0x5dc9c7='';var _0xd29477=[_0xb7a2('0x68'),_0xb7a2('0x69'),'i.disposition'];if(_0x35ccad===_0xb7a2('0x33')){_0xd29477[_0xb7a2('0x6a')](_0xb7a2('0x6b'));}if(_0x69b103[_0xb7a2('0x6c')]==='0'&&_0x35ccad===_0xb7a2('0x33')){_0x5dc9c7=_0xb7a2('0x6b');}else{if(_0x69b103[_0xb7a2('0x6c')]==='1'){_0xd29477['shift']();}_0x5dc9c7=_0xb7a2('0x6d')+_0xd29477[_0xb7a2('0x6e')](',\x20')+')';}return _0x5dc9c7;}function getFilteredInteractions(_0x3ea591,_0x2643d0,_0x3829e,_0x1bef7b){var _0x3950b0=utils[_0xb7a2('0xf')](_0x3ea591);var _0x689339=_[_0xb7a2('0x63')](_0x3ea591)+_0xb7a2('0x6f');var _0x56facf=[];var _0x132c4d=getTagsQuery();var _0x16bc91={'type':db[_0xb7a2('0x70')]['QueryTypes']['SELECT'],'raw':!![]};var _0x12d264=[];var _0x452c6a=[];return db[_0xb7a2('0x71')]['query'](_0x132c4d[_0xb7a2('0x72')](),_0x16bc91)[_0xb7a2('0x5d')](function(_0x3db6ba){_0x56facf=_[_0xb7a2('0x73')](_0x3db6ba,'id');_0x16bc91=_[_0xb7a2('0x74')](_0x16bc91,{'model':db[_0x689339],'mapToModel':!![],'nest':!![]});if(_0x3829e[_0xb7a2('0x75')]){_0x1bef7b[_0xb7a2('0x76')][_0xb7a2('0x25')](function(_0x223b3b){_0x2643d0[_0xb7a2('0xc')]('i.'+_0x223b3b);});}else{_0x2643d0[_0xb7a2('0xc')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0xb7a2('0x41'));_0x2643d0[_0xb7a2('0xc')](_0xb7a2('0x77'),'Account.key');_0x2643d0[_0xb7a2('0xc')]('a.mandatoryDisposition',_0xb7a2('0x78'));if(_0x3ea591==='mail'){_0x2643d0[_0xb7a2('0xc')]('a.email',_0xb7a2('0x79'));_0x2643d0[_0xb7a2('0xc')](_0xb7a2('0x7a'),_0xb7a2('0x7b'));_0x2643d0[_0xb7a2('0xc')]('i.id');_0x2643d0['field'](_0xb7a2('0x7c'));_0x2643d0[_0xb7a2('0xc')](_0xb7a2('0x7d'));_0x2643d0[_0xb7a2('0xc')](_0xb7a2('0x7e'));_0x2643d0['field']('i.closedAt');_0x2643d0[_0xb7a2('0xc')](_0xb7a2('0x7f'));_0x2643d0[_0xb7a2('0xc')](_0xb7a2('0x80'));_0x2643d0['field'](_0xb7a2('0x81'));_0x2643d0['field']('i.subject');_0x2643d0[_0xb7a2('0xc')]('i.disposition');_0x2643d0[_0xb7a2('0xc')](_0xb7a2('0x69'));_0x2643d0['field'](_0xb7a2('0x68'));_0x2643d0[_0xb7a2('0xc')](_0xb7a2('0x6b'));_0x2643d0['field']('i.to');_0x2643d0[_0xb7a2('0xc')](_0xb7a2('0x82'));_0x2643d0['field'](_0xb7a2('0x83'));_0x2643d0[_0xb7a2('0xc')](_0xb7a2('0x84'));}else if(_0x3ea591==='openchannel'){_0x2643d0[_0xb7a2('0xc')]('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',_0xb7a2('0x7b'));}else{_0x2643d0[_0xb7a2('0xc')](_0xb7a2('0x85'),'contactName');}if(_0x3ea591!==_0xb7a2('0x33')){_0x2643d0['field'](_0xb7a2('0x86'));}_0x2643d0['field'](_0xb7a2('0x87'),_0xb7a2('0x88'));_0x2643d0['field']('c.lastName',_0xb7a2('0x89'));_0x2643d0['field'](_0xb7a2('0x8a'),_0xb7a2('0x8b'));_0x2643d0[_0xb7a2('0xc')](_0xb7a2('0x8c'),_0xb7a2('0x8d'));_0x2643d0[_0xb7a2('0xc')](_0xb7a2('0x8e'),'Contact.mobile');_0x2643d0[_0xb7a2('0xc')]('c.fax',_0xb7a2('0x8f'));_0x2643d0[_0xb7a2('0xc')](_0xb7a2('0x90'),_0xb7a2('0x91'));_0x2643d0[_0xb7a2('0xc')](_0xb7a2('0x92'),'Owner.internal');_0x2643d0[_0xb7a2('0xc')](_0xb7a2('0x93'),_0xb7a2('0x94'));}if(_0x1bef7b[_0xb7a2('0x95')]){_0x2643d0[_0xb7a2('0x95')](_0x1bef7b[_0xb7a2('0x95')]);}if(_0x1bef7b[_0xb7a2('0x96')]){_0x2643d0['offset'](_0x1bef7b[_0xb7a2('0x96')]);}return db['sequelize']['query'](_0x2643d0['toString'](),_0x16bc91);})[_0xb7a2('0x5d')](function(_0x57bf0e){_0x12d264=_0x57bf0e;var _0xaed78e=getUsersQuery(_0x3ea591,_0x12d264);return db[_0xb7a2('0x71')][_0xb7a2('0x97')](_0xaed78e['toString'](),_0x16bc91);})[_0xb7a2('0x5d')](function(_0x17693e){_0x452c6a=_[_0xb7a2('0x98')](_0x17693e,_0x3950b0);if(_0x3ea591===_0xb7a2('0x33')){return db['Setting'][_0xb7a2('0x99')]({'attributes':[_0xb7a2('0x9a')],'raw':!![]});}})[_0xb7a2('0x5d')](function(_0x29077a){var _0x1fc00e=_0x29077a?_0x29077a[_0xb7a2('0x9a')]:undefined;var _0x77c453=_0x12d264[_0xb7a2('0x19')](function(_0x59b32f){return updateInteraction(_0x59b32f,_0x56facf,_0x452c6a,_0x1fc00e);});return Promise['all'](_0x77c453);});}function countFilteredInteractions(_0x3b271d,_0x172913){var _0x2e495c=_0x3b271d[_0xb7a2('0x9b')]();_0x2e495c[_0xb7a2('0xc')](_0xb7a2('0x9c'));_0x2e495c[_0xb7a2('0xc')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages');var _0x5884d4=utils[_0xb7a2('0x24')](_0x172913);if(!_[_0xb7a2('0x9d')](_0x5884d4)){_0x2e495c['where'](_0xb7a2('0x9e'),_0x5884d4);}var _0x21aca5={'type':db[_0xb7a2('0x70')]['QueryTypes'][_0xb7a2('0x9f')],'raw':!![]};return db[_0xb7a2('0x71')]['query'](_0x2e495c[_0xb7a2('0x72')](),_0x21aca5);}module[_0xb7a2('0xa0')]={'checkAccountsRestrictions':checkAccountsRestrictions,'countFilteredInteractions':countFilteredInteractions,'getClosedOrderClause':getClosedOrderClause,'getFilteredInteractions':getFilteredInteractions,'getInteractionsQuery':getInteractionsQuery,'parseAdvancedSearchFilter':parseAdvancedSearchFilter,'parseQueryParameters':parseQueryParameters,'skipInteractionsQuery':skipInteractionsQuery}; \ No newline at end of file +var _0x81a1=['i.thirdDisposition','i.secondDisposition','i.disposition','unshift','i.substatus','closed','shift','CONCAT_WS(\x27\x27,\x20','join','Sequelize','QueryTypes','SELECT','toString','keyBy','merge','attributes','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','a.mandatoryDisposition','Account.mandatoryDisposition','a.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.closed','i.closedAt','i.attach','i.lastMsgDirection','i.to','i.MailAccountId','i.UserId','CASE\x20WHEN\x20i.from\x20IS\x20NOT\x20NULL\x20AND\x20i.from\x20<>\x20\x27\x27\x20THEN\x20i.from\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','c.phone','Contact.phone','Contact.mobile','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','limit','offset','sequelize','query','groupBy','Setting','findOne','enableEmailPreview','clone','getSelectedTags','isEmpty','t.id\x20IN\x20?','exports','squel','../parsers/advancedSearch','../parsers/qs','./update-interaction','updateInteraction','./utils','../../mysqldb','getAccountFK','role','agent','search','select','field','name','color','from','tools_tags','_interactions','u.fullname','ui.','left_join','length','where','\x20IN\x20?','map','getInteractionFK','interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','a.id\x20=\x20i.','messages','me.','it.','expr','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','unreadMessages\x20{OPERATOR}\x200','replace','{OPERATOR}','isNumeric','i.id\x20LIKE\x20?','includes','i.phone\x20LIKE\x20?','fax','i.fax\x20LIKE\x20?','openchannel','i.from\x20LIKE\x20?','mail','isEmail','c.email\x20LIKE\x20?','MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','MATCH\x20(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)','conditions','buildExpression','type','value','end','unreadMessages','and','Contact','operator','$substring','contact','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','find','ContactId','start','clause','tags','ids','User','user','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','text','body','plainBody','keys','compact','concat','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','resolve','then','fields','read','filter','capitalize','chat'];(function(_0xcbc92e,_0x3756f0){var _0x27f291=function(_0x4ceeb6){while(--_0x4ceeb6){_0xcbc92e['push'](_0xcbc92e['shift']());}};_0x27f291(++_0x3756f0);}(_0x81a1,0xe1));var _0x181a=function(_0x5bfe56,_0x821706){_0x5bfe56=_0x5bfe56-0x0;var _0x317287=_0x81a1[_0x5bfe56];return _0x317287;};'use strict';var _=require('lodash');var squel=require(_0x181a('0x0'));var as=require(_0x181a('0x1'));var qs=require(_0x181a('0x2'));var updateInteraction=require(_0x181a('0x3'))[_0x181a('0x4')];var utils=require(_0x181a('0x5'));var db=require(_0x181a('0x6'))['db'];function skipInteractionsQuery(_0x2d5895,_0x5acfc1,_0x296c25){var _0x543754=![];var _0x576edb=utils[_0x181a('0x7')](_0x2d5895);if(_0x5acfc1[_0x181a('0x8')]===_0x181a('0x9')&&!_0x296c25[_0x181a('0xa')]&&!_0x296c25[_0x576edb]){_0x543754=!![];}return _0x543754;}function getTagsQuery(){return squel[_0x181a('0xb')]()[_0x181a('0xc')]('id')['field'](_0x181a('0xd'))['field'](_0x181a('0xe'))[_0x181a('0xf')](_0x181a('0x10'));}function getUsersQuery(_0x52b8dd,_0x17048d){var _0x5f4eb1=utils['getInteractionFK'](_0x52b8dd);var _0x3852e5='user_has_'+_0x52b8dd+_0x181a('0x11');var _0x1338e6=squel[_0x181a('0xb')]()['field']('u.id')[_0x181a('0xc')](_0x181a('0x12'))['field'](_0x181a('0x13')+_0x5f4eb1)[_0x181a('0xf')](_0x3852e5,'ui')[_0x181a('0x14')]('users','u','u.id\x20=\x20ui.UserId');if(_0x17048d[_0x181a('0x15')]>0x0){_0x1338e6[_0x181a('0x16')](_0x181a('0x13')+_0x5f4eb1+_0x181a('0x17'),_[_0x181a('0x18')](_0x17048d,'id'));}return _0x1338e6;}function getInteractionsQuery(_0x3e1958){var _0x173196=utils['getInteractionsTables'](_0x3e1958);var _0x4d3a87=utils[_0x181a('0x7')](_0x3e1958);var _0x46a257=utils[_0x181a('0x19')](_0x3e1958);return squel[_0x181a('0xb')]()[_0x181a('0xf')](_0x173196[_0x181a('0x1a')],'i')[_0x181a('0x14')](_0x181a('0x1b'),'c',_0x181a('0x1c'))['left_join']('users','o',_0x181a('0x1d'))[_0x181a('0x14')](_0x173196['accounts'],'a',_0x181a('0x1e')+_0x4d3a87)['left_join'](_0x173196[_0x181a('0x1f')],'me',_0x181a('0x20')+_0x46a257+'\x20=\x20i.id')[_0x181a('0x14')](_0x173196['interactionsTags'],'it',_0x181a('0x21')+_0x46a257+'\x20=\x20i.id')[_0x181a('0x14')](_0x181a('0x10'),'t','t.id\x20=\x20it.TagId');}function getSqlClauses(){var _0x4beb39={'body':squel['expr'](),'contact':squel[_0x181a('0x22')](),'default':squel[_0x181a('0x22')](),'fields':squel['expr'](),'filter':squel[_0x181a('0x22')](),'read':squel[_0x181a('0x22')](),'tags':{'clause':squel[_0x181a('0x22')](),'ids':null},'user':squel['expr']()};return _0x4beb39;}function parseTagParameter(_0x432294){var _0x2d9ffd=squel[_0x181a('0x22')]();if(_0x432294){var _0x3df4d3=utils['getSelectedTags'](_0x432294);_0x3df4d3[_0x181a('0x23')](function(_0x1e8fa2){_0x2d9ffd['or'](_0x181a('0x24'),'%,'+_0x1e8fa2+',%');});}return _0x2d9ffd;}function parseReadParameter(_0x5d3b5f){var _0x2230c6='';if(_0x5d3b5f){_0x2230c6=_0x181a('0x25');if(_0x5d3b5f==='1'){_0x2230c6=_0x2230c6[_0x181a('0x26')]('{OPERATOR}','=');}else{_0x2230c6=_0x2230c6['replace'](_0x181a('0x27'),'>');}}return _0x2230c6;}function parseSearchFilter(_0x4a695f,_0x63c891){var _0x251e3e=squel[_0x181a('0x22')]();if(_0x63c891){var _0x54b827=_0x63c891[_0x181a('0x26')]('\x5c','\x5c\x5c')[_0x181a('0x26')](/'/g,'\x27\x27');if(qs[_0x181a('0x28')](_0x54b827)){_0x251e3e['or'](_0x181a('0x29'),_0x54b827+'%');if(['sms','whatsapp'][_0x181a('0x2a')](_0x4a695f)){_0x251e3e['or'](_0x181a('0x2b'),_0x54b827+'%');}else if(_0x4a695f===_0x181a('0x2c')){_0x251e3e['or'](_0x181a('0x2d'),_0x54b827+'%');}else if(_0x4a695f===_0x181a('0x2e')){_0x251e3e['or'](_0x181a('0x2f'),_0x54b827+'%');}}else if(_0x4a695f===_0x181a('0x30')&&qs[_0x181a('0x31')](_0x54b827)){_0x251e3e['or'](_0x181a('0x32'),_0x54b827+'%');}else{if(_0x4a695f===_0x181a('0x30')){_0x251e3e['or'](_0x181a('0x33'),qs['getFullTextValue'](_0x54b827,!![]))['or'](_0x181a('0x34'),qs[_0x181a('0x35')](_0x54b827));}else if(_0x4a695f!==_0x181a('0x2c')){_0x251e3e['or'](_0x181a('0x36'),qs[_0x181a('0x35')](_0x54b827));}_0x251e3e['or'](_0x181a('0x37'),qs[_0x181a('0x35')](_0x54b827,!![]),null);}}return _0x251e3e;}function parseAdvancedSearchFilter(_0x110666,_0x412c69){var _0x57d1e3=getSqlClauses();var _0x877f5c=as['parseSearch'](_0x110666);var _0x1fbb4e=_0x877f5c['sqlOperator'];for(var _0x3cc56c=0x0;_0x3cc56c<_0x877f5c['conditions'][_0x181a('0x15')];_0x3cc56c++){var _0x590286=_0x877f5c[_0x181a('0x38')][_0x3cc56c];var _0x3ea768='i';var _0x153e32=_['find'](_0x412c69,[_0x181a('0xd'),_0x590286['field']]);if(_0x153e32){var _0x2fa8b3=as[_0x181a('0x39')](_0x3ea768,_0x153e32[_0x181a('0x3a')],_0x590286);_0x57d1e3['default'][_0x1fbb4e](_0x2fa8b3['text'],_0x2fa8b3['value']['start'],_0x2fa8b3[_0x181a('0x3b')][_0x181a('0x3c')]);}else{switch(_0x590286['field']){case _0x181a('0x3d'):var _0x14dd5e=parseReadParameter(_0x590286[_0x181a('0x3b')]);_0x57d1e3['read'][_0x181a('0x3e')](_0x14dd5e);break;case _0x181a('0x3f'):if(_0x590286[_0x181a('0x40')]===_0x181a('0x41')){if(_0x590286['value']['split']('\x20')['length']>0x1){_0x57d1e3[_0x181a('0x42')][_0x1fbb4e]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x181a('0x35')](_0x590286[_0x181a('0x3b')],!![]),null);}else{var _0x58b7f7='%'+_0x590286[_0x181a('0x3b')]+'%';_0x57d1e3[_0x181a('0x42')][_0x1fbb4e](_0x181a('0x43'),_0x58b7f7,_0x58b7f7,_0x58b7f7);}}else{_0x153e32=_[_0x181a('0x44')](_0x412c69,['name','ContactId']);_0x590286[_0x181a('0xc')]=_0x181a('0x45');_0x2fa8b3=as[_0x181a('0x39')](_0x3ea768,_0x153e32[_0x181a('0x3a')],_0x590286);_0x57d1e3[_0x181a('0x42')][_0x1fbb4e](_0x2fa8b3['text'],_0x2fa8b3[_0x181a('0x3b')][_0x181a('0x46')],_0x2fa8b3[_0x181a('0x3b')][_0x181a('0x3c')]);}break;case'Tag':var _0xb9d7f7=_0x590286[_0x181a('0x3b')]['split'](',')['map'](function(_0x17ecdf){return Number(_0x17ecdf);});var _0x32a3b5=parseTagParameter(_0xb9d7f7);_0x57d1e3['tags'][_0x181a('0x47')][_0x181a('0x3e')](_0x32a3b5);_0x57d1e3[_0x181a('0x48')][_0x181a('0x49')]=_0xb9d7f7;break;case _0x181a('0x4a'):if(_0x590286[_0x181a('0x40')]==='$substring'){_0x57d1e3[_0x181a('0x4b')][_0x1fbb4e](_0x181a('0x4c'),'%'+_0x590286[_0x181a('0x3b')]+'%',null);}else{_0x153e32=_[_0x181a('0x44')](_0x412c69,[_0x181a('0xd'),_0x181a('0x4d')]);_0x590286[_0x181a('0xc')]=_0x181a('0x4d');_0x2fa8b3=as[_0x181a('0x39')](_0x3ea768,_0x153e32[_0x181a('0x3a')],_0x590286);_0x57d1e3[_0x181a('0x4b')][_0x1fbb4e](_0x2fa8b3[_0x181a('0x4e')],_0x2fa8b3[_0x181a('0x3b')][_0x181a('0x46')],_0x2fa8b3[_0x181a('0x3b')][_0x181a('0x3c')]);}break;case _0x181a('0x4f'):case _0x181a('0x50'):_0x2fa8b3=as[_0x181a('0x39')]('me',null,_0x590286);_0x57d1e3[_0x181a('0x4f')][_0x1fbb4e](_0x2fa8b3[_0x181a('0x4e')],_0x2fa8b3[_0x181a('0x3b')]['start'],_0x2fa8b3['value'][_0x181a('0x3c')]);break;}}}return _0x57d1e3;}function parseModelFields(_0x554c5e,_0x21bef6,_0x5543f0){var _0x2df835=utils[_0x181a('0x7')](_0x554c5e);var _0x3326c3=squel[_0x181a('0x22')]();var _0x5f248e=_(_0x21bef6)[_0x181a('0x51')]()['map'](function(_0x429677){return _['some'](_0x5543f0,['name',_0x429677])?_0x429677:undefined;})[_0x181a('0x52')]()[_0x181a('0x3b')]();if(_0x5f248e[_0x181a('0x15')]>0x0){_0x5f248e['forEach'](function(_0x1a9dc2){if(_0x1a9dc2===_0x2df835){_0x3326c3[_0x181a('0x3e')]('i.'+_0x2df835+_0x181a('0x17'),[][_0x181a('0x53')](_0x21bef6[_0x1a9dc2]));}else if(_0x1a9dc2===_0x181a('0x54')){var _0x15b576=JSON[_0x181a('0x55')](_0x21bef6[_0x1a9dc2])[_0x181a('0x56')];var _0x1a8d5b=JSON[_0x181a('0x55')](_0x21bef6[_0x1a9dc2])[_0x181a('0x57')];_0x3326c3[_0x181a('0x3e')](_0x181a('0x58'),_0x15b576,_0x1a8d5b);}else{if(_0x21bef6[_0x1a9dc2]===_0x181a('0x59')){_0x3326c3[_0x181a('0x3e')]('i.'+_0x1a9dc2+_0x181a('0x5a'));}else{_0x3326c3[_0x181a('0x3e')]('i.'+_0x1a9dc2+_0x181a('0x5b'),_0x21bef6[_0x1a9dc2]);}}});}return _0x3326c3;}function parseQueryParameters(_0x53485d,_0x4be863,_0x3a2dd6){var _0x197d85=getSqlClauses();return Promise[_0x181a('0x5c')]()[_0x181a('0x5d')](function(){return parseModelFields(_0x53485d,_0x4be863,_0x3a2dd6);})[_0x181a('0x5d')](function(_0x518a17){_0x197d85[_0x181a('0x5e')][_0x181a('0x3e')](_0x518a17);return parseReadParameter(_0x4be863[_0x181a('0x5f')]);})['then'](function(_0x4bee3b){_0x197d85[_0x181a('0x5f')][_0x181a('0x3e')](_0x4bee3b);return parseTagParameter(_0x4be863['tag']);})[_0x181a('0x5d')](function(_0x301f13){_0x197d85[_0x181a('0x48')][_0x181a('0x47')][_0x181a('0x3e')](_0x301f13);return parseSearchFilter(_0x53485d,_0x4be863[_0x181a('0x60')]);})[_0x181a('0x5d')](function(_0x11e616){_0x197d85[_0x181a('0x60')]=_0x11e616;return _0x197d85;});}function checkAccountsRestrictions(_0x5153e5,_0x3a324e,_0x40c7b6){var _0x5c5218=utils[_0x181a('0x7')](_0x5153e5);var _0x50d5f7='get'+_[_0x181a('0x61')](_0x5153e5)+(_0x5153e5===_0x181a('0x62')?'Websites':'Accounts');var _0x1f4c99=squel[_0x181a('0x22')]();return Promise['resolve']()[_0x181a('0x5d')](function(){if(_0x40c7b6['search']&&_0x3a324e['role']===_0x181a('0x9')){return _0x3a324e[_0x50d5f7]({'attributes':['id'],'raw':!![]});}})[_0x181a('0x5d')](function(_0x47f867){if(_0x47f867){if(_0x47f867['length']===0x0){_0x1f4c99[_0x181a('0x3e')]('i.'+_0x5c5218+_0x181a('0x5a'));}else{_0x1f4c99['and']('i.'+_0x5c5218+'\x20IN\x20?',_[_0x181a('0x18')](_0x47f867,'id'));}}else if(!_0x40c7b6[_0x5c5218]){_0x1f4c99[_0x181a('0x3e')]('i.'+_0x5c5218+'\x20IS\x20NOT\x20NULL');}})['then'](function(){return _0x1f4c99;});}function getClosedOrderClause(_0x199fff,_0x406287){var _0x160bde='';var _0x25f71b=[_0x181a('0x63'),_0x181a('0x64'),_0x181a('0x65')];if(_0x199fff===_0x181a('0x30')){_0x25f71b[_0x181a('0x66')](_0x181a('0x67'));}if(_0x406287[_0x181a('0x68')]==='0'&&_0x199fff===_0x181a('0x30')){_0x160bde='i.substatus';}else{if(_0x406287['closed']==='1'){_0x25f71b[_0x181a('0x69')]();}_0x160bde=_0x181a('0x6a')+_0x25f71b[_0x181a('0x6b')](',\x20')+')';}return _0x160bde;}function getFilteredInteractions(_0xf78615,_0x4d7260,_0x4e0f62,_0x171f70){var _0x16e051=utils[_0x181a('0x19')](_0xf78615);var _0x3538e9=_[_0x181a('0x61')](_0xf78615)+'Interaction';var _0x3b9e77=[];var _0x13ab16=getTagsQuery();var _0x3046c5={'type':db[_0x181a('0x6c')][_0x181a('0x6d')][_0x181a('0x6e')],'raw':!![]};var _0x30b349=[];var _0x53b552=[];return db['sequelize']['query'](_0x13ab16[_0x181a('0x6f')](),_0x3046c5)['then'](function(_0x569647){_0x3b9e77=_[_0x181a('0x70')](_0x569647,'id');_0x3046c5=_[_0x181a('0x71')](_0x3046c5,{'model':db[_0x3538e9],'mapToModel':!![],'nest':!![]});if(_0x4e0f62[_0x181a('0x5e')]){_0x171f70[_0x181a('0x72')][_0x181a('0x23')](function(_0x42a91d){_0x4d7260[_0x181a('0xc')]('i.'+_0x42a91d);});}else{_0x4d7260['field'](_0x181a('0x73'),'unreadMessages');_0x4d7260[_0x181a('0xc')](_0x181a('0x74'),'Account.key');_0x4d7260['field'](_0x181a('0x75'),_0x181a('0x76'));if(_0xf78615===_0x181a('0x30')){_0x4d7260[_0x181a('0xc')](_0x181a('0x77'),'Account.email');_0x4d7260[_0x181a('0xc')](_0x181a('0x78'),_0x181a('0x79'));_0x4d7260[_0x181a('0xc')](_0x181a('0x7a'));_0x4d7260[_0x181a('0xc')](_0x181a('0x7b'));_0x4d7260[_0x181a('0xc')]('i.updatedAt');_0x4d7260['field'](_0x181a('0x7c'));_0x4d7260[_0x181a('0xc')](_0x181a('0x7d'));_0x4d7260[_0x181a('0xc')](_0x181a('0x7e'));_0x4d7260[_0x181a('0xc')]('i.lastMsgAt');_0x4d7260['field'](_0x181a('0x7f'));_0x4d7260[_0x181a('0xc')]('i.subject');_0x4d7260[_0x181a('0xc')](_0x181a('0x65'));_0x4d7260[_0x181a('0xc')](_0x181a('0x64'));_0x4d7260[_0x181a('0xc')]('i.thirdDisposition');_0x4d7260[_0x181a('0xc')](_0x181a('0x67'));_0x4d7260[_0x181a('0xc')](_0x181a('0x80'));_0x4d7260[_0x181a('0xc')]('i.ContactId');_0x4d7260['field'](_0x181a('0x81'));_0x4d7260['field'](_0x181a('0x82'));}else if(_0xf78615===_0x181a('0x2e')){_0x4d7260[_0x181a('0xc')](_0x181a('0x83'),_0x181a('0x79'));}else{_0x4d7260[_0x181a('0xc')](_0x181a('0x84'),_0x181a('0x79'));}if(_0xf78615!=='mail'){_0x4d7260['field'](_0x181a('0x85'));}_0x4d7260[_0x181a('0xc')](_0x181a('0x86'),_0x181a('0x87'));_0x4d7260['field'](_0x181a('0x88'),_0x181a('0x89'));_0x4d7260[_0x181a('0xc')](_0x181a('0x8a'),'Contact.email');_0x4d7260[_0x181a('0xc')](_0x181a('0x8b'),_0x181a('0x8c'));_0x4d7260[_0x181a('0xc')]('c.mobile',_0x181a('0x8d'));_0x4d7260[_0x181a('0xc')]('c.fax',_0x181a('0x8e'));_0x4d7260[_0x181a('0xc')](_0x181a('0x8f'),_0x181a('0x90'));_0x4d7260[_0x181a('0xc')](_0x181a('0x91'),_0x181a('0x92'));_0x4d7260[_0x181a('0xc')](_0x181a('0x93'),_0x181a('0x94'));}if(_0x171f70['limit']){_0x4d7260[_0x181a('0x95')](_0x171f70[_0x181a('0x95')]);}if(_0x171f70[_0x181a('0x96')]){_0x4d7260[_0x181a('0x96')](_0x171f70['offset']);}return db[_0x181a('0x97')][_0x181a('0x98')](_0x4d7260['toString'](),_0x3046c5);})[_0x181a('0x5d')](function(_0x227fa1){_0x30b349=_0x227fa1;var _0x490dda=getUsersQuery(_0xf78615,_0x30b349);return db[_0x181a('0x97')][_0x181a('0x98')](_0x490dda[_0x181a('0x6f')](),_0x3046c5);})[_0x181a('0x5d')](function(_0x47abe1){_0x53b552=_[_0x181a('0x99')](_0x47abe1,_0x16e051);if(_0xf78615==='mail'){return db[_0x181a('0x9a')][_0x181a('0x9b')]({'attributes':[_0x181a('0x9c')],'raw':!![]});}})[_0x181a('0x5d')](function(_0x5e6287){var _0x1ad22b=_0x5e6287?_0x5e6287[_0x181a('0x9c')]:undefined;var _0xf0a4af=_0x30b349[_0x181a('0x18')](function(_0x29fd7f){return updateInteraction(_0x29fd7f,_0x3b9e77,_0x53b552,_0x1ad22b);});return Promise['all'](_0xf0a4af);});}function countFilteredInteractions(_0x437bfd,_0x26b400){var _0x196c5e=_0x437bfd[_0x181a('0x9d')]();_0x196c5e[_0x181a('0xc')]('COUNT(*)');_0x196c5e[_0x181a('0xc')](_0x181a('0x73'),_0x181a('0x3d'));var _0x1d9ff4=utils[_0x181a('0x9e')](_0x26b400);if(!_[_0x181a('0x9f')](_0x1d9ff4)){_0x196c5e[_0x181a('0x16')](_0x181a('0xa0'),_0x1d9ff4);}var _0x3d8165={'type':db[_0x181a('0x6c')][_0x181a('0x6d')]['SELECT'],'raw':!![]};return db[_0x181a('0x97')][_0x181a('0x98')](_0x196c5e[_0x181a('0x6f')](),_0x3d8165);}module[_0x181a('0xa1')]={'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 2cc1e08..9d85397 100644 --- a/server/components/interaction/update-interaction.js +++ b/server/components/interaction/update-interaction.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2b62=['total','closed','abandoned','UserId','talking','MailMessage','findOne','out','plainBody','-id','then','lastMsgText','trimStart','catch','updateInteraction','Users','Tags','../../mysqldb','map','push','waiting','unmanaged'];(function(_0x422905,_0x3bce3a){var _0x33dc6c=function(_0x4852c9){while(--_0x4852c9){_0x422905['push'](_0x422905['shift']());}};_0x33dc6c(++_0x3bce3a);}(_0x2b62,0x15b));var _0x22b6=function(_0x567f1b,_0x21e2bd){_0x567f1b=_0x567f1b-0x0;var _0x1e3ca1=_0x2b62[_0x567f1b];return _0x1e3ca1;};'use strict';var _=require('lodash');var db=require(_0x22b6('0x0'))['db'];function getInteractionUsers(_0x4c42ee,_0x3aca6c){return new Promise(function(_0x33b231,_0x361811){try{var _0x4fbaf5=[];if(_0x3aca6c[_0x4c42ee]){_0x4fbaf5=_0x3aca6c[_0x4c42ee][_0x22b6('0x1')](function(_0x4a9d82){return{'id':_0x4a9d82['id'],'fullname':_0x4a9d82['fullname']};});}return _0x33b231(_0x4fbaf5);}catch(_0x427f02){_0x361811(_0x427f02);}});}function getInteractionTags(_0x3d8d3d,_0x35609b){var _0x185256=[];if(_0x3d8d3d){_0x3d8d3d['split'](',')['forEach'](function(_0x5869f9){_0x185256[_0x22b6('0x2')](_0x35609b[_0x5869f9]);});}return _0x185256;}function updateWaitingCounter(_0x20b94f){if(_0x20b94f[_0x22b6('0x3')]){_0x20b94f['waiting']-=0x1;}}function updateInteractionCounters(_0x48d355){_0x48d355['waiting']=0x0;_0x48d355['talking']=0x0;_0x48d355['answered']=0x0;_0x48d355[_0x22b6('0x4')]=0x0;_0x48d355['abandoned']=0x0;_0x48d355[_0x22b6('0x5')]=0x0;if(_0x48d355[_0x22b6('0x6')]){if(_0x48d355['disposition']===_0x22b6('0x7')){_0x48d355['abandoned']+=0x1;updateWaitingCounter(_0x48d355);}if(_0x48d355[_0x22b6('0x8')]){_0x48d355['answered']+=0x1;if(_0x48d355[_0x22b6('0x9')]){_0x48d355[_0x22b6('0x9')]-=0x1;}}else{if(_0x48d355['disposition']){_0x48d355[_0x22b6('0x4')]+=0x1;updateWaitingCounter(_0x48d355);}}}else{if(!_0x48d355[_0x22b6('0x8')]){_0x48d355[_0x22b6('0x3')]+=0x1;}if(_0x48d355['UserId']){_0x48d355[_0x22b6('0x9')]+=0x1;updateWaitingCounter(_0x48d355);}}_0x48d355[_0x22b6('0x5')]+=0x1;return _0x48d355;}function getLastMessageText(_0x4f7158){return db[_0x22b6('0xa')][_0x22b6('0xb')]({'where':{'$and':[{'MailInteractionId':_0x4f7158['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0x22b6('0xc')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':[_0x22b6('0xd')],'order':_0x22b6('0xe'),'raw':!![]})[_0x22b6('0xf')](function(_0x122cd0){if(_0x122cd0&&_0x122cd0[_0x22b6('0xd')]){_0x4f7158[_0x22b6('0x10')]=_[_0x22b6('0x11')](_0x122cd0[_0x22b6('0xd')]);}return _0x4f7158;})[_0x22b6('0x12')](function(_0x55fcde){throw _0x55fcde;});}exports[_0x22b6('0x13')]=function(_0xa3b2cd,_0x4c816e,_0x528cd4,_0xfc658a){return new Promise(function(_0x4bdb68,_0x2ba628){return getInteractionUsers(_0xa3b2cd['id'],_0x528cd4)[_0x22b6('0xf')](function(_0x510062){_0xa3b2cd[_0x22b6('0x14')]=_0x510062;return getInteractionTags(_0xa3b2cd['TagIds'],_0x4c816e);})[_0x22b6('0xf')](function(_0x442d38){_0xa3b2cd[_0x22b6('0x15')]=_0x442d38;delete _0xa3b2cd['TagIds'];return updateInteractionCounters(_0xa3b2cd);})[_0x22b6('0xf')](function(_0x2f042c){if(_0xfc658a){return getLastMessageText(_0x2f042c);}else{return _0x2f042c;}})[_0x22b6('0xf')](function(_0x22143e){_0x4bdb68(_0x22143e);})[_0x22b6('0x12')](function(_0x521c5e){_0x2ba628(_0x521c5e);});});}; \ No newline at end of file +var _0xf387=['Tags','catch','lodash','../../mysqldb','map','forEach','push','waiting','answered','unmanaged','total','closed','disposition','abandoned','UserId','talking','MailMessage','findOne','out','plainBody','-id','updateInteraction','then','TagIds'];(function(_0x555d26,_0x3c8000){var _0x5d9415=function(_0xb6f1a0){while(--_0xb6f1a0){_0x555d26['push'](_0x555d26['shift']());}};_0x5d9415(++_0x3c8000);}(_0xf387,0x1e2));var _0x7f38=function(_0x2c238c,_0x2e5f4e){_0x2c238c=_0x2c238c-0x0;var _0x24ac5b=_0xf387[_0x2c238c];return _0x24ac5b;};'use strict';var _=require(_0x7f38('0x0'));var db=require(_0x7f38('0x1'))['db'];function getInteractionUsers(_0x144324,_0x46d6ef){return new Promise(function(_0x3c7bf5,_0x1b80aa){try{var _0x138a1d=[];if(_0x46d6ef[_0x144324]){_0x138a1d=_0x46d6ef[_0x144324][_0x7f38('0x2')](function(_0x129ff0){return{'id':_0x129ff0['id'],'fullname':_0x129ff0['fullname']};});}return _0x3c7bf5(_0x138a1d);}catch(_0x4ee2cd){_0x1b80aa(_0x4ee2cd);}});}function getInteractionTags(_0x24c33a,_0x3af4bc){var _0x507e02=[];if(_0x24c33a){_0x24c33a['split'](',')[_0x7f38('0x3')](function(_0x1c1d7a){_0x507e02[_0x7f38('0x4')](_0x3af4bc[_0x1c1d7a]);});}return _0x507e02;}function updateWaitingCounter(_0x58f530){if(_0x58f530[_0x7f38('0x5')]){_0x58f530[_0x7f38('0x5')]-=0x1;}}function updateInteractionCounters(_0x259de2){_0x259de2[_0x7f38('0x5')]=0x0;_0x259de2['talking']=0x0;_0x259de2[_0x7f38('0x6')]=0x0;_0x259de2[_0x7f38('0x7')]=0x0;_0x259de2['abandoned']=0x0;_0x259de2[_0x7f38('0x8')]=0x0;if(_0x259de2[_0x7f38('0x9')]){if(_0x259de2[_0x7f38('0xa')]===_0x7f38('0xb')){_0x259de2[_0x7f38('0xb')]+=0x1;updateWaitingCounter(_0x259de2);}if(_0x259de2[_0x7f38('0xc')]){_0x259de2[_0x7f38('0x6')]+=0x1;if(_0x259de2[_0x7f38('0xd')]){_0x259de2['talking']-=0x1;}}else{if(_0x259de2[_0x7f38('0xa')]){_0x259de2[_0x7f38('0x7')]+=0x1;updateWaitingCounter(_0x259de2);}}}else{if(!_0x259de2[_0x7f38('0xc')]){_0x259de2[_0x7f38('0x5')]+=0x1;}if(_0x259de2[_0x7f38('0xc')]){_0x259de2[_0x7f38('0xd')]+=0x1;updateWaitingCounter(_0x259de2);}}_0x259de2[_0x7f38('0x8')]+=0x1;return _0x259de2;}function getLastMessageText(_0x237ff1){return db[_0x7f38('0xe')][_0x7f38('0xf')]({'where':{'$and':[{'MailInteractionId':_0x237ff1['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0x7f38('0x10')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':[_0x7f38('0x11')],'order':_0x7f38('0x12'),'raw':!![]})['then'](function(_0x2e7c8e){if(_0x2e7c8e&&_0x2e7c8e[_0x7f38('0x11')]){_0x237ff1['lastMsgText']=_['trimStart'](_0x2e7c8e[_0x7f38('0x11')]);}return _0x237ff1;})['catch'](function(_0xc28379){throw _0xc28379;});}exports[_0x7f38('0x13')]=function(_0x4ce413,_0x3e69c0,_0x655fe2,_0x3c84b4){return new Promise(function(_0x570da9,_0x49d974){return getInteractionUsers(_0x4ce413['id'],_0x655fe2)[_0x7f38('0x14')](function(_0x30c70e){_0x4ce413['Users']=_0x30c70e;return getInteractionTags(_0x4ce413[_0x7f38('0x15')],_0x3e69c0);})[_0x7f38('0x14')](function(_0x283bcb){_0x4ce413[_0x7f38('0x16')]=_0x283bcb;delete _0x4ce413[_0x7f38('0x15')];return updateInteractionCounters(_0x4ce413);})['then'](function(_0x4d2b32){if(_0x3c84b4){return getLastMessageText(_0x4d2b32);}else{return _0x4d2b32;}})[_0x7f38('0x14')](function(_0x2c5a36){_0x570da9(_0x2c5a36);})[_0x7f38('0x17')](function(_0x38ec18){_0x49d974(_0x38ec18);});});}; \ No newline at end of file diff --git a/server/components/interaction/utils.js b/server/components/interaction/utils.js index 8e641c2..337a13d 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 _0x6df1=['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','stringify','null','Interaction','findOne','info','catch','exports','lodash','../../mysqldb','openchannel-interactions','mail-interactions','fax-interactions','../../config/logger','chat-interactions','whatsapp-interactions','capitalize','chat','Website','InteractionId'];(function(_0x14297d,_0x1c3e51){var _0x23f08b=function(_0x43dc75){while(--_0x43dc75){_0x14297d['push'](_0x14297d['shift']());}};_0x23f08b(++_0x1c3e51);}(_0x6df1,0xec));var _0x16df=function(_0x31ddea,_0x40de6d){_0x31ddea=_0x31ddea-0x0;var _0x12539b=_0x6df1[_0x31ddea];return _0x12539b;};'use strict';var _=require(_0x16df('0x0'));var db=require(_0x16df('0x1'))['db'];var loggers={'openchannel':require('../../config/logger')(_0x16df('0x2')),'mail':require('../../config/logger')(_0x16df('0x3')),'fax':require('../../config/logger')(_0x16df('0x4')),'sms':require(_0x16df('0x5'))('sms-interactions'),'chat':require(_0x16df('0x5'))(_0x16df('0x6')),'whatsapp':require(_0x16df('0x5'))(_0x16df('0x7'))};function getAccountFK(_0x301549){return _[_0x16df('0x8')](_0x301549)+(_0x301549===_0x16df('0x9')?_0x16df('0xa'):'Account')+'Id';}function getInteractionFK(_0x270b41){return _[_0x16df('0x8')](_0x270b41)+'InteractionId';}function getInteractionId(_0xe92c22,_0x38daed,_0x1b1b5e){if(_0xe92c22&&_0xe92c22[_['upperFirst'](_0x1b1b5e)+_0x16df('0xb')]){return _0xe92c22[_[_0x16df('0xc')](_0x1b1b5e)+_0x16df('0xb')];}else if(_0xe92c22&&_0xe92c22['id']){return _0xe92c22['id'];}else if(_0x38daed&&_0x38daed['id']){return _0x38daed['id'];}else{return _0x16df('0xd');}}function getInteractionsTables(_0x10e2e4){return{'accounts':_0x10e2e4+'_'+(_0x10e2e4===_0x16df('0x9')?_0x16df('0xe'):_0x16df('0xf')),'interactions':_0x10e2e4+_0x16df('0x10'),'interactionsTags':_0x10e2e4+_0x16df('0x11'),'messages':_0x10e2e4+_0x16df('0x12'),'userInteractions':_0x16df('0x13')+_0x10e2e4+_0x16df('0x10')};}function getSelectedTags(_0x2b8f04){var _0x53f7be=[];if(_0x2b8f04){_0x53f7be=Array[_0x16df('0x14')](_0x2b8f04)?_0x2b8f04:[_0x2b8f04];}return _0x53f7be;}function log(_0x169134,_0x2d70a1,_0x36600d,_0x260e14,_0x3e3736,_0x12efa9){loggers[_0x3e3736[_0x16df('0x15')]()][_0x169134](_0x16df('0x16'),_0x12efa9[_0x16df('0x17')](),_0x2d70a1?_0x2d70a1['id']:null,_0x2d70a1?_0x2d70a1['name']:null,_0x2d70a1?_0x2d70a1['role']:null,getInteractionId(_0x36600d,_0x260e14,_0x3e3736),_0x36600d?JSON[_0x16df('0x18')](_0x36600d):_0x16df('0x19'));}function updateUser(_0x3765c3,_0x281720,_0xf89609,_0x2322f3,_0x5a99c8){db[_['upperFirst'](_0x2322f3)+_0x16df('0x1a')][_0x16df('0x1b')]({'where':{'id':getInteractionId(_0x281720,_0xf89609,_0x2322f3)}})['then'](function(_0x2735cb){if(_0x2735cb){return _0x2735cb['update']({'UserId':_0x3765c3?_0x3765c3['id']:null});}})['then'](function(_0x5e7ca3){if(_0x5e7ca3){log(_0x16df('0x1c'),_0x3765c3,_0x281720,_0xf89609,_0x2322f3,_0x5a99c8);}})[_0x16df('0x1d')](function(){log('error',_0x3765c3,_0x281720,_0xf89609,_0x2322f3,_0x5a99c8);});}module[_0x16df('0x1e')]={'getAccountFK':getAccountFK,'getInteractionFK':getInteractionFK,'getInteractionsTables':getInteractionsTables,'getSelectedTags':getSelectedTags,'updateUser':updateUser}; \ No newline at end of file +var _0x0651=['error','exports','lodash','../../mysqldb','../../config/logger','openchannel-interactions','sms-interactions','chat-interactions','whatsapp-interactions','capitalize','chat','Account','InteractionId','upperFirst','unknown','accounts','_interactions','_interaction_has_tags','user_has_','isArray','toLowerCase','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','name','role','stringify','Interaction','findOne','then','update','info','catch'];(function(_0x127585,_0x287621){var _0x3ea944=function(_0x2dec48){while(--_0x2dec48){_0x127585['push'](_0x127585['shift']());}};_0x3ea944(++_0x287621);}(_0x0651,0x9d));var _0x1065=function(_0xbeb6eb,_0x3161eb){_0xbeb6eb=_0xbeb6eb-0x0;var _0x14f603=_0x0651[_0xbeb6eb];return _0x14f603;};'use strict';var _=require(_0x1065('0x0'));var db=require(_0x1065('0x1'))['db'];var loggers={'openchannel':require(_0x1065('0x2'))(_0x1065('0x3')),'mail':require('../../config/logger')('mail-interactions'),'fax':require(_0x1065('0x2'))('fax-interactions'),'sms':require(_0x1065('0x2'))(_0x1065('0x4')),'chat':require(_0x1065('0x2'))(_0x1065('0x5')),'whatsapp':require(_0x1065('0x2'))(_0x1065('0x6'))};function getAccountFK(_0x49028b){return _[_0x1065('0x7')](_0x49028b)+(_0x49028b===_0x1065('0x8')?'Website':_0x1065('0x9'))+'Id';}function getInteractionFK(_0xc158a1){return _[_0x1065('0x7')](_0xc158a1)+_0x1065('0xa');}function getInteractionId(_0x1303e3,_0x1d3e68,_0x211cfe){if(_0x1303e3&&_0x1303e3[_[_0x1065('0xb')](_0x211cfe)+_0x1065('0xa')]){return _0x1303e3[_[_0x1065('0xb')](_0x211cfe)+_0x1065('0xa')];}else if(_0x1303e3&&_0x1303e3['id']){return _0x1303e3['id'];}else if(_0x1d3e68&&_0x1d3e68['id']){return _0x1d3e68['id'];}else{return _0x1065('0xc');}}function getInteractionsTables(_0x57b7d4){return{'accounts':_0x57b7d4+'_'+(_0x57b7d4==='chat'?'websites':_0x1065('0xd')),'interactions':_0x57b7d4+_0x1065('0xe'),'interactionsTags':_0x57b7d4+_0x1065('0xf'),'messages':_0x57b7d4+'_messages','userInteractions':_0x1065('0x10')+_0x57b7d4+_0x1065('0xe')};}function getSelectedTags(_0x5d4f39){var _0x56403d=[];if(_0x5d4f39){_0x56403d=Array[_0x1065('0x11')](_0x5d4f39)?_0x5d4f39:[_0x5d4f39];}return _0x56403d;}function log(_0xf69136,_0x181699,_0x3a781c,_0x264885,_0x34e14f,_0x16470b){loggers[_0x34e14f[_0x1065('0x12')]()][_0xf69136](_0x1065('0x13'),_0x16470b['toUpperCase'](),_0x181699?_0x181699['id']:null,_0x181699?_0x181699[_0x1065('0x14')]:null,_0x181699?_0x181699[_0x1065('0x15')]:null,getInteractionId(_0x3a781c,_0x264885,_0x34e14f),_0x3a781c?JSON[_0x1065('0x16')](_0x3a781c):'null');}function updateUser(_0x271c2d,_0x5edbfb,_0x5bb626,_0x1c5bbc,_0x980511){db[_[_0x1065('0xb')](_0x1c5bbc)+_0x1065('0x17')][_0x1065('0x18')]({'where':{'id':getInteractionId(_0x5edbfb,_0x5bb626,_0x1c5bbc)}})[_0x1065('0x19')](function(_0xe596e3){if(_0xe596e3){return _0xe596e3[_0x1065('0x1a')]({'UserId':_0x271c2d?_0x271c2d['id']:null});}})[_0x1065('0x19')](function(_0x165ff8){if(_0x165ff8){log(_0x1065('0x1b'),_0x271c2d,_0x5edbfb,_0x5bb626,_0x1c5bbc,_0x980511);}})[_0x1065('0x1c')](function(){log(_0x1065('0x1d'),_0x271c2d,_0x5edbfb,_0x5bb626,_0x1c5bbc,_0x980511);});}module[_0x1065('0x1e')]={'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 eb14483..53ea9cb 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 _0xed8e=['user','isUserLimit','crypto','util','../../config/environment','data1','license','split','createDecipher','aes-256-ctr','format','%s:%s:%s','update','base64','utf8','use','License','findOne','then','count','status','json','Maximum\x20%s\x20limit\x20have\x20been\x20reached','users','admin'];(function(_0x3c9761,_0x266e2a){var _0x280831=function(_0x5db7ca){while(--_0x5db7ca){_0x3c9761['push'](_0x3c9761['shift']());}};_0x280831(++_0x266e2a);}(_0xed8e,0x66));var _0xeed8=function(_0x9ee5d4,_0x4b68ab){_0x9ee5d4=_0x9ee5d4-0x0;var _0x54566e=_0xed8e[_0x9ee5d4];return _0x54566e;};'use strict';var crypto=require(_0xeed8('0x0'));var util=require(_0xeed8('0x1'));var compose=require('composable-middleware');var db=require('../../mysqldb')['db'];var config=require(_0xeed8('0x2'));function getValueFromLicense(_0x479b71,_0x3bfcb0){if(_0x479b71&&_0x3bfcb0){if(_0x3bfcb0['data1']&&_0x3bfcb0['license']){var _0x5e9870=_0x3bfcb0[_0xeed8('0x3')];var _0x33c56b=_0x3bfcb0[_0xeed8('0x4')];var _0xc6ec9d=_0x5e9870[_0xeed8('0x5')]('-')[0x4];var _0x410ea4=_0x5e9870[_0xeed8('0x5')]('-')[0x0];var _0x2828d8=crypto[_0xeed8('0x6')](_0xeed8('0x7'),util[_0xeed8('0x8')](_0xeed8('0x9'),_0xc6ec9d,_0x5e9870,_0x410ea4));var _0x5cb085=_0x2828d8[_0xeed8('0xa')](_0x33c56b,_0xeed8('0xb'),'utf8');_0x5cb085+=_0x2828d8['final'](_0xeed8('0xc'));var _0x104ad2=JSON['parse'](_0x5cb085);return _0x104ad2['hasOwnProperty'](_0x479b71)?_0x104ad2[_0x479b71]:null;}}return null;}function isLimit(_0x3d1a7a,_0x131487,_0x11cf77,_0x51d054){var _0x345bd3=_0x131487;return compose()[_0xeed8('0xd')](function(_0x1c8e12,_0x2e2b61,_0x351b39){return db[_0xeed8('0xe')][_0xeed8('0xf')]({'where':{'id':0x1},'raw':!![]})[_0xeed8('0x10')](function(_0x59bf6a){var _0x188748=getValueFromLicense(_0x3d1a7a,_0x59bf6a);return _0x188748?_0x188748:_0x345bd3;})[_0xeed8('0x10')](function(_0x9f83f3){_0x345bd3=_0x9f83f3;return _0x11cf77[_0xeed8('0x11')](_0x51d054);})['then'](function(_0x285891){if(_0x285891>=_0x345bd3){return _0x2e2b61[_0xeed8('0x12')](0x193)[_0xeed8('0x13')]({'message':util['format'](_0xeed8('0x14'),_0x3d1a7a)});}_0x351b39();})['catch'](function(_0x412664){_0x351b39(_0x412664);});});}function isUserLimit(){return isLimit(_0xeed8('0x15'),0x1,db['User'],{'where':{'$or':[{'role':_0xeed8('0x16')},{'role':_0xeed8('0x17')}]}});}exports[_0xeed8('0x18')]=isUserLimit; \ No newline at end of file +var _0x7cf5=['util','composable-middleware','../../mysqldb','license','data1','split','createDecipher','aes-256-ctr','%s:%s:%s','update','utf8','final','parse','hasOwnProperty','use','License','findOne','then','status','json','format','catch','users','User','admin','user','isUserLimit','crypto'];(function(_0x55d58f,_0x2bea83){var _0x1ad6e6=function(_0x31447e){while(--_0x31447e){_0x55d58f['push'](_0x55d58f['shift']());}};_0x1ad6e6(++_0x2bea83);}(_0x7cf5,0x187));var _0x57cf=function(_0xb65415,_0x1793b7){_0xb65415=_0xb65415-0x0;var _0x3bab34=_0x7cf5[_0xb65415];return _0x3bab34;};'use strict';var crypto=require(_0x57cf('0x0'));var util=require(_0x57cf('0x1'));var compose=require(_0x57cf('0x2'));var db=require(_0x57cf('0x3'))['db'];var config=require('../../config/environment');function getValueFromLicense(_0x5ad321,_0x28c0a4){if(_0x5ad321&&_0x28c0a4){if(_0x28c0a4['data1']&&_0x28c0a4[_0x57cf('0x4')]){var _0x102836=_0x28c0a4[_0x57cf('0x5')];var _0x3e94e4=_0x28c0a4['license'];var _0x2c65fa=_0x102836['split']('-')[0x4];var _0x2658ab=_0x102836[_0x57cf('0x6')]('-')[0x0];var _0x59feef=crypto[_0x57cf('0x7')](_0x57cf('0x8'),util['format'](_0x57cf('0x9'),_0x2c65fa,_0x102836,_0x2658ab));var _0xfef436=_0x59feef[_0x57cf('0xa')](_0x3e94e4,'base64',_0x57cf('0xb'));_0xfef436+=_0x59feef[_0x57cf('0xc')](_0x57cf('0xb'));var _0xcf2da8=JSON[_0x57cf('0xd')](_0xfef436);return _0xcf2da8[_0x57cf('0xe')](_0x5ad321)?_0xcf2da8[_0x5ad321]:null;}}return null;}function isLimit(_0x1bf5f1,_0x1ffde0,_0x415e73,_0x25c923){var _0x33df74=_0x1ffde0;return compose()[_0x57cf('0xf')](function(_0x5c8869,_0x1027a0,_0xb76fac){return db[_0x57cf('0x10')][_0x57cf('0x11')]({'where':{'id':0x1},'raw':!![]})[_0x57cf('0x12')](function(_0x5645e0){var _0x5e5312=getValueFromLicense(_0x1bf5f1,_0x5645e0);return _0x5e5312?_0x5e5312:_0x33df74;})[_0x57cf('0x12')](function(_0x193f9f){_0x33df74=_0x193f9f;return _0x415e73['count'](_0x25c923);})[_0x57cf('0x12')](function(_0x55a041){if(_0x55a041>=_0x33df74){return _0x1027a0[_0x57cf('0x13')](0x193)[_0x57cf('0x14')]({'message':util[_0x57cf('0x15')]('Maximum\x20%s\x20limit\x20have\x20been\x20reached',_0x1bf5f1)});}_0xb76fac();})[_0x57cf('0x16')](function(_0x224157){_0xb76fac(_0x224157);});});}function isUserLimit(){return isLimit(_0x57cf('0x17'),0x1,db[_0x57cf('0x18')],{'where':{'$or':[{'role':_0x57cf('0x19')},{'role':_0x57cf('0x1a')}]}});}exports[_0x57cf('0x1b')]=isUserLimit; \ No newline at end of file diff --git a/server/components/parsers/advancedSearch.js b/server/components/parsers/advancedSearch.js index 4e1745e..c2fa7c2 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 _0x6073=['and','replace','split','length','slice','forEach','match','indexOf','conditions','buildExpression','operator','$eq','$between','value','includes','$gt','$lte','add','format','YYYY-MM-DD','castTo','text','CAST(','field','$ne','$notIn','\x20OR\x20','IN\x20?','NOT\x20IN\x20?','=\x20?','<>\x20?','$substring','$startsWith','$endsWith','LIKE\x20?','<\x20?','>\x20?','<=\x20?','>=\x20?','BETWEEN\x20?\x20AND\x20?','start','pop','DATE','utcOffset','hours','minutes','seconds','lodash','moment','sqlOperator','startsWith','[$or]'];(function(_0x352c42,_0x5205dc){var _0x26c41a=function(_0x1366f0){while(--_0x1366f0){_0x352c42['push'](_0x352c42['shift']());}};_0x26c41a(++_0x5205dc);}(_0x6073,0x167));var _0x3607=function(_0x4f39a2,_0x1543b2){_0x4f39a2=_0x4f39a2-0x0;var _0x223202=_0x6073[_0x4f39a2];return _0x223202;};'use strict';var _=require(_0x3607('0x0'));var moment=require(_0x3607('0x1'));exports['parseSearch']=function(_0x4e18c7){var _0x4b400d={'conditions':[]};_0x4b400d[_0x3607('0x2')]=_[_0x3607('0x3')](_0x4e18c7,_0x3607('0x4'))?'or':_0x3607('0x5');var _0x1252ef=_0x4e18c7[_0x3607('0x6')]('[$and]','')['replace']('[$or]','')[_0x3607('0x7')]('||');for(var _0x465dc7=0x0;_0x465dc7<_0x1252ef[_0x3607('0x8')];_0x465dc7++){var _0x1d39db=_0x1252ef[_0x465dc7][_0x3607('0x7')](':=');var _0x21b29e=_0x1d39db[0x0];var _0x1dd082=_0x1d39db[_0x3607('0x9')](0x1);_0x1dd082[_0x3607('0xa')](function(_0x24766e){var _0x4e6427=_0x24766e[_0x3607('0x7')]('[')['shift']();var _0x2b6379=_0x24766e[_0x3607('0xb')](/\[(.*?)\]/g);_0x2b6379['forEach'](function(_0x48970a){var _0x152b1e=_0x48970a[_0x3607('0x7')]('[')['filter'](function(_0x5a9233){return _0x5a9233[_0x3607('0xc')](']')>-0x1;})['map'](function(_0x32618a){return _0x32618a[_0x3607('0x7')](']')[0x0];})[0x0];_0x4b400d[_0x3607('0xd')]['push']({'field':_0x21b29e,'operator':_0x4e6427,'value':_0x152b1e});});});}return _0x4b400d;};exports[_0x3607('0xe')]=function(_0x4fb824,_0x396340,_0x21f813){var _0x1dfb26={};if(_0x396340==='DATE'){if(_0x21f813[_0x3607('0xf')]===_0x3607('0x10')){_0x21f813[_0x3607('0xf')]=_0x3607('0x11');_0x21f813[_0x3607('0x12')]+=','+_0x21f813[_0x3607('0x12')];}else if(_[_0x3607('0x13')]([_0x3607('0x14'),_0x3607('0x15')],_0x21f813[_0x3607('0xf')])){_0x21f813[_0x3607('0x12')]=moment(_0x21f813['value'])[_0x3607('0x16')](0x1,'days')[_0x3607('0x17')](_0x3607('0x18'));}}if(_0x21f813[_0x3607('0x19')]){_0x396340=_0x21f813[_0x3607('0x19')];_0x1dfb26[_0x3607('0x1a')]=_0x3607('0x1b')+_0x4fb824+'.'+_0x21f813['field']+'\x20AS\x20'+_0x21f813[_0x3607('0x19')]+')\x20'+parseOperator(_0x21f813[_0x3607('0xf')]);}else{_0x1dfb26['text']=_0x4fb824+'.'+_0x21f813[_0x3607('0x1c')]+'\x20'+parseOperator(_0x21f813[_0x3607('0xf')]);}if(_[_0x3607('0x13')]([_0x3607('0x1d'),_0x3607('0x1e')],_0x21f813[_0x3607('0xf')]))_0x1dfb26[_0x3607('0x1a')]='('+_0x1dfb26[_0x3607('0x1a')]+_0x3607('0x1f')+_0x4fb824+'.'+_0x21f813['field']+'\x20IS\x20NULL)';_0x1dfb26[_0x3607('0x12')]=parseValue(_0x396340,_0x21f813[_0x3607('0xf')],_0x21f813[_0x3607('0x12')]);return _0x1dfb26;};function parseOperator(_0x16ec2a){var _0x23e980;switch(_0x16ec2a){case'$in':_0x23e980=_0x3607('0x20');break;case _0x3607('0x1e'):_0x23e980=_0x3607('0x21');break;case _0x3607('0x10'):_0x23e980=_0x3607('0x22');break;case _0x3607('0x1d'):_0x23e980=_0x3607('0x23');break;case _0x3607('0x24'):case _0x3607('0x25'):case _0x3607('0x26'):_0x23e980=_0x3607('0x27');break;case'$lt':_0x23e980=_0x3607('0x28');break;case _0x3607('0x14'):_0x23e980=_0x3607('0x29');break;case'$lte':_0x23e980=_0x3607('0x2a');break;case'$gte':_0x23e980=_0x3607('0x2b');break;case'$between':_0x23e980=_0x3607('0x2c');break;}return _0x23e980;}function parseValue(_0x335b74,_0x4a0471,_0x2428d7){var _0x39ac06={'start':undefined,'end':undefined};switch(_0x4a0471){case'$in':case _0x3607('0x1e'):_0x39ac06[_0x3607('0x2d')]=_0x2428d7[_0x3607('0x7')](',');break;case'$substring':_0x39ac06['start']='%'+_0x2428d7+'%';break;case'$startsWith':_0x39ac06[_0x3607('0x2d')]=_0x2428d7+'%';break;case _0x3607('0x26'):_0x39ac06[_0x3607('0x2d')]='%'+_0x2428d7;break;case _0x3607('0x11'):var _0x144366=_0x2428d7[_0x3607('0x7')](',');var _0x2428d7=_0x144366['shift']();var _0x1dbb4=_0x144366[_0x3607('0x2e')]();if(_0x335b74===_0x3607('0x2f')){_0x2428d7=moment(_0x2428d7)[_0x3607('0x30')](0x0,!![])[_0x3607('0x17')]();_0x1dbb4=moment(_0x1dbb4)[_0x3607('0x30')](0x0,!![])['add'](0x17,_0x3607('0x31'))[_0x3607('0x16')](0x3b,_0x3607('0x32'))['add'](0x3b,_0x3607('0x33'))['format']();}_0x39ac06={'start':_0x2428d7,'end':_0x1dbb4};break;default:_0x39ac06['start']=_0x2428d7;break;}return _0x39ac06;} \ No newline at end of file +var _0x3696=['moment','sqlOperator','startsWith','[$or]','and','replace','split','length','slice','forEach','match','filter','indexOf','map','conditions','push','buildExpression','DATE','$eq','operator','$between','value','includes','$gt','$lte','add','days','YYYY-MM-DD','castTo','field','\x20AS\x20','$ne','$notIn','\x20OR\x20','\x20IS\x20NULL)','$in','<>\x20?','$substring','LIKE\x20?','<\x20?','>\x20?','<=\x20?','$gte','BETWEEN\x20?\x20AND\x20?','start','$endsWith','utcOffset','hours','minutes','seconds','format','lodash'];(function(_0xd9ef4d,_0x3f136c){var _0x48e243=function(_0x310d1a){while(--_0x310d1a){_0xd9ef4d['push'](_0xd9ef4d['shift']());}};_0x48e243(++_0x3f136c);}(_0x3696,0x137));var _0x6369=function(_0x5f0089,_0x227e2c){_0x5f0089=_0x5f0089-0x0;var _0x193892=_0x3696[_0x5f0089];return _0x193892;};'use strict';var _=require(_0x6369('0x0'));var moment=require(_0x6369('0x1'));exports['parseSearch']=function(_0x497380){var _0x2c2746={'conditions':[]};_0x2c2746[_0x6369('0x2')]=_[_0x6369('0x3')](_0x497380,_0x6369('0x4'))?'or':_0x6369('0x5');var _0x3fb831=_0x497380[_0x6369('0x6')]('[$and]','')[_0x6369('0x6')](_0x6369('0x4'),'')[_0x6369('0x7')]('||');for(var _0x331d3d=0x0;_0x331d3d<_0x3fb831[_0x6369('0x8')];_0x331d3d++){var _0x340b18=_0x3fb831[_0x331d3d][_0x6369('0x7')](':=');var _0x4fca52=_0x340b18[0x0];var _0x3b007f=_0x340b18[_0x6369('0x9')](0x1);_0x3b007f[_0x6369('0xa')](function(_0x19bd3b){var _0x1ab9f8=_0x19bd3b[_0x6369('0x7')]('[')['shift']();var _0x2d9826=_0x19bd3b[_0x6369('0xb')](/\[(.*?)\]/g);_0x2d9826['forEach'](function(_0x67b087){var _0x146496=_0x67b087[_0x6369('0x7')]('[')[_0x6369('0xc')](function(_0x49ec21){return _0x49ec21[_0x6369('0xd')](']')>-0x1;})[_0x6369('0xe')](function(_0x7f653e){return _0x7f653e['split'](']')[0x0];})[0x0];_0x2c2746[_0x6369('0xf')][_0x6369('0x10')]({'field':_0x4fca52,'operator':_0x1ab9f8,'value':_0x146496});});});}return _0x2c2746;};exports[_0x6369('0x11')]=function(_0x1aaef9,_0x1dc720,_0x394e48){var _0x59804f={};if(_0x1dc720===_0x6369('0x12')){if(_0x394e48['operator']===_0x6369('0x13')){_0x394e48[_0x6369('0x14')]=_0x6369('0x15');_0x394e48[_0x6369('0x16')]+=','+_0x394e48['value'];}else if(_[_0x6369('0x17')]([_0x6369('0x18'),_0x6369('0x19')],_0x394e48[_0x6369('0x14')])){_0x394e48[_0x6369('0x16')]=moment(_0x394e48[_0x6369('0x16')])[_0x6369('0x1a')](0x1,_0x6369('0x1b'))['format'](_0x6369('0x1c'));}}if(_0x394e48[_0x6369('0x1d')]){_0x1dc720=_0x394e48[_0x6369('0x1d')];_0x59804f['text']='CAST('+_0x1aaef9+'.'+_0x394e48[_0x6369('0x1e')]+_0x6369('0x1f')+_0x394e48['castTo']+')\x20'+parseOperator(_0x394e48[_0x6369('0x14')]);}else{_0x59804f['text']=_0x1aaef9+'.'+_0x394e48[_0x6369('0x1e')]+'\x20'+parseOperator(_0x394e48[_0x6369('0x14')]);}if(_[_0x6369('0x17')]([_0x6369('0x20'),_0x6369('0x21')],_0x394e48['operator']))_0x59804f['text']='('+_0x59804f['text']+_0x6369('0x22')+_0x1aaef9+'.'+_0x394e48['field']+_0x6369('0x23');_0x59804f[_0x6369('0x16')]=parseValue(_0x1dc720,_0x394e48[_0x6369('0x14')],_0x394e48[_0x6369('0x16')]);return _0x59804f;};function parseOperator(_0x340946){var _0x3fc93d;switch(_0x340946){case _0x6369('0x24'):_0x3fc93d='IN\x20?';break;case'$notIn':_0x3fc93d='NOT\x20IN\x20?';break;case _0x6369('0x13'):_0x3fc93d='=\x20?';break;case _0x6369('0x20'):_0x3fc93d=_0x6369('0x25');break;case _0x6369('0x26'):case'$startsWith':case'$endsWith':_0x3fc93d=_0x6369('0x27');break;case'$lt':_0x3fc93d=_0x6369('0x28');break;case'$gt':_0x3fc93d=_0x6369('0x29');break;case _0x6369('0x19'):_0x3fc93d=_0x6369('0x2a');break;case _0x6369('0x2b'):_0x3fc93d='>=\x20?';break;case'$between':_0x3fc93d=_0x6369('0x2c');break;}return _0x3fc93d;}function parseValue(_0x4d39cc,_0x4663b1,_0x94dd0d){var _0x2cd971={'start':undefined,'end':undefined};switch(_0x4663b1){case _0x6369('0x24'):case _0x6369('0x21'):_0x2cd971[_0x6369('0x2d')]=_0x94dd0d['split'](',');break;case _0x6369('0x26'):_0x2cd971[_0x6369('0x2d')]='%'+_0x94dd0d+'%';break;case'$startsWith':_0x2cd971['start']=_0x94dd0d+'%';break;case _0x6369('0x2e'):_0x2cd971[_0x6369('0x2d')]='%'+_0x94dd0d;break;case _0x6369('0x15'):var _0x12fb8c=_0x94dd0d['split'](',');var _0x94dd0d=_0x12fb8c['shift']();var _0x466841=_0x12fb8c['pop']();if(_0x4d39cc==='DATE'){_0x94dd0d=moment(_0x94dd0d)['utcOffset'](0x0,!![])['format']();_0x466841=moment(_0x466841)[_0x6369('0x2f')](0x0,!![])[_0x6369('0x1a')](0x17,_0x6369('0x30'))['add'](0x3b,_0x6369('0x31'))[_0x6369('0x1a')](0x3b,_0x6369('0x32'))[_0x6369('0x33')]();}_0x2cd971={'start':_0x94dd0d,'end':_0x466841};break;default:_0x2cd971[_0x6369('0x2d')]=_0x94dd0d;break;}return _0x2cd971;} \ No newline at end of file diff --git a/server/components/parsers/qs.js b/server/components/parsers/qs.js index 43b42d9..2f4c5f6 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 _0x743d=['{EXPR}','forEach','push','replace','join','getOptions','query','$id','model','map','intersection','attributes','nolimit','order','filters','filter','object','columns','value','where','VIRTUAL','lower','merge','options','include','moment','../../mysqldb','parse','keys','alias','fields','raw','split','isEmpty','forOwn','find','type','DATE','isPlainObject','$gte','format','$lte','YYYY-MM-DD','utc','subtract','name','uniqueid','isArray','limit','offset','sort','indexOf','priority','cast','col','unsigned','DESC','length','isObject','unset','hasOwnProperty','omit','isNumeric','match','^[+]?[0-9]*$','isEmail','getFullTextValue','\x22{EXPR}\x22'];(function(_0x36b5b1,_0x12d11e){var _0x1d091a=function(_0x47d9ea){while(--_0x47d9ea){_0x36b5b1['push'](_0x36b5b1['shift']());}};_0x1d091a(++_0x12d11e);}(_0x743d,0xa1));var _0xd743=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x743d[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var sequelize=require('sequelize');var moment=require(_0xd743('0x0'));var db=require(_0xd743('0x1'))['db'];var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x35bc6a){var _0x284c2b=['ne'];try{var _0x57eef3=JSON[_0xd743('0x2')](_0x35bc6a);var _0x513e5c=Object[_0xd743('0x3')](_0x57eef3)[0x0];return _0x284c2b['includes'](_0x513e5c);}catch(_0x38e1a4){return![];}}function getOperatorValue(_0x5942e6){var _0x59b38f=JSON[_0xd743('0x2')](_0x5942e6);var _0x240570=Object[_0xd743('0x3')](_0x59b38f)[0x0];var _0x2e4a8f=_0x59b38f[_0x240570];return{['$'+_0x240570]:_0x2e4a8f};}function parseIncludeModel(_0x348170){var _0x42d5af=JSON[_0xd743('0x2')](_0x348170);return{'model':db[_0x42d5af['model']],'as':_0x42d5af[_0xd743('0x4')],'attributes':_0x42d5af[_0xd743('0x5')],'raw':_0x42d5af[_0xd743('0x6')]};}exports[_0xd743('0x5')]=function(_0x363787){var _0x263f0e=null;if(_0x363787){_0x263f0e=_0x363787[_0xd743('0x7')](',');}return _0x263f0e;};exports['filters']=function(_0x3db732,_0x1276ba){var _0x41ebaa={};if(!_[_0xd743('0x8')](_0x3db732)){_[_0xd743('0x9')](_0x3db732,function(_0x277e4c,_0x344879){try{if(_0x1276ba){var _0x32c3bd=_[_0xd743('0xa')](_0x1276ba,{'name':_0x344879})||{};if(hasSequelizeOperator(_0x277e4c)){_0x41ebaa[_0x344879]=getOperatorValue(_0x277e4c);}else if(_0x32c3bd[_0xd743('0xb')]===_0xd743('0xc')&&_[_0xd743('0xd')](_0x277e4c)){var _0x4122a0=JSON[_0xd743('0x2')](_0x277e4c);var _0x4a82f1={'$gte':moment(moment(_0x4122a0[_0xd743('0xe')])[_0xd743('0xf')]('YYYY-MM-DD'))['utc']()[_0xd743('0xf')](),'$lte':moment(moment(_0x4122a0[_0xd743('0x10')])[_0xd743('0xf')](_0xd743('0x11')))[_0xd743('0x12')]()[_0xd743('0x13')](0x1,'s')[_0xd743('0xf')]()};_0x41ebaa[_0x344879]=_0x4a82f1;}else if(_0x32c3bd[_0xd743('0x14')]===_0xd743('0x15')){_0x41ebaa[_0x344879]=_0x277e4c;}else{_0x41ebaa[_0x344879]=_[_0xd743('0x16')](_0x277e4c)?_0x277e4c:JSON[_0xd743('0x2')](_0x277e4c);}}else{_0x41ebaa[_0x344879]=_['isArray'](_0x277e4c)?_0x277e4c:JSON[_0xd743('0x2')](_0x277e4c);}}catch(_0x23ac10){_0x41ebaa[_0x344879]=_0x277e4c[_0xd743('0x7')](',');}});}return _0x41ebaa;};exports[_0xd743('0x17')]=function(_0x2fe8e8){_0x2fe8e8=parseInt(_0x2fe8e8,0xa);if(!_0x2fe8e8||_0x2fe8e8<0x0){_0x2fe8e8=LIMIT_VALUE;}return _0x2fe8e8;};exports[_0xd743('0x18')]=function(_0x401784){_0x401784=parseInt(_0x401784,0xa);if(!_0x401784||_0x401784<0x0){_0x401784=0x0;}return _0x401784;};exports[_0xd743('0x19')]=function(_0x208df4){var _0xe56e13,_0x3a8503=null;if(_0x208df4){_0xe56e13=_0x208df4[_0xd743('0x7')](',');_0x3a8503=_['map'](_0xe56e13,function(_0x28294a){if(_0x28294a[_0xd743('0x1a')]('-')===0x0){return[_0x28294a===_0xd743('0x1b')?sequelize[_0xd743('0x1c')](sequelize[_0xd743('0x1d')](_0xd743('0x1b')),_0xd743('0x1e')):_0x28294a['substr'](0x1),_0xd743('0x1f')];}else{return[_0x28294a===_0xd743('0x1b')?sequelize[_0xd743('0x1c')](sequelize[_0xd743('0x1d')]('priority'),'unsigned'):_0x28294a,'ASC'];}});}return _0x3a8503;};exports['omit']=function(_0x51ff1e,_0x5617f0){if(_[_0xd743('0x8')](_0x51ff1e)){return _0x51ff1e;}if(_[_0xd743('0x16')](_0x51ff1e)){for(var _0x41b42a=0x0;_0x41b42a<_0x51ff1e[_0xd743('0x20')];_0x41b42a+=0x1){_0x51ff1e[_0x41b42a]=this['omit'](_0x51ff1e[_0x41b42a],_0x5617f0);}return _0x51ff1e;}if(!_[_0xd743('0x21')](_0x51ff1e)){return _0x51ff1e;}if(_['isString'](_0x5617f0)){_0x5617f0=[_0x5617f0];}if(!_['isArray'](_0x5617f0)){return _0x51ff1e;}for(var _0x33c8b3=0x0;_0x33c8b3<_0x5617f0[_0xd743('0x20')];_0x33c8b3+=0x1){_[_0xd743('0x22')](_0x51ff1e,_0x5617f0[_0x33c8b3]);}for(var _0x35e1d4 in _0x51ff1e){if(_0x51ff1e[_0xd743('0x23')](_0x35e1d4)){_0x51ff1e[_0x35e1d4]=this[_0xd743('0x24')](_0x51ff1e[_0x35e1d4],_0x5617f0);}}return _0x51ff1e;};exports[_0xd743('0x25')]=function(_0x64c55){return _0x64c55[_0xd743('0x26')](RegExp(_0xd743('0x27')))?!![]:![];};exports[_0xd743('0x28')]=function(_0x35cce9){return _0x35cce9['match'](/^\S+@\S+$/)?!![]:![];};exports[_0xd743('0x29')]=function(_0x255a05,_0x5d077d){var _0x1d692f=[];var _0x2e1b1c=/[ `!@#$%^&*()_\-?~]/;var _0x30a2c7=_0x5d077d?_0xd743('0x2a'):_0xd743('0x2b');_0x255a05[_0xd743('0x7')](/[ ,]+/)[_0xd743('0x2c')](function(_0x41dd40){_0x41dd40=_0x41dd40['replace'](/([^:]")"+/g,'$1');_0x41dd40='+'+_0x41dd40+'*';var _0x39471d=_0x41dd40[_0xd743('0x26')](_0x2e1b1c);if(_0x39471d){_0x41dd40='\x22'+_0x41dd40+'\x22';}_0x1d692f[_0xd743('0x2d')](_0x41dd40);});_0x30a2c7=_0x30a2c7[_0xd743('0x2e')](_0xd743('0x2b'),_0x1d692f[_0xd743('0x2f')]('\x20'));return _0x30a2c7;};exports[_0xd743('0x30')]=function(_0x433085,_0x44df41,_0x96acab){var _0x3c9432={},_0x3b69c9={};if(_0x44df41[_0xd743('0x31')][_0xd743('0x32')]){_0x44df41[_0xd743('0x31')]['id']=_0x44df41[_0xd743('0x31')][_0xd743('0x32')];delete _0x44df41['query'][_0xd743('0x32')];}_0x3c9432[_0xd743('0x33')]=_[_0xd743('0x34')](_0x433085,'name');_0x3c9432['query']=_['keys'](_0x44df41[_0xd743('0x31')]);_0x3c9432['filters']=_[_0xd743('0x35')](_0x3c9432[_0xd743('0x33')],_0x3c9432[_0xd743('0x31')]);_0x3b69c9[_0xd743('0x36')]=_[_0xd743('0x35')](_0x3c9432[_0xd743('0x33')],this[_0xd743('0x5')](_0x44df41[_0xd743('0x31')][_0xd743('0x5')]));_0x3b69c9[_0xd743('0x36')]=_0x3b69c9[_0xd743('0x36')][_0xd743('0x20')]?_0x3b69c9[_0xd743('0x36')]:_0x3c9432[_0xd743('0x33')];if(!_0x44df41[_0xd743('0x31')]['hasOwnProperty'](_0xd743('0x37'))){_0x3b69c9[_0xd743('0x17')]=this[_0xd743('0x17')](_0x44df41[_0xd743('0x31')][_0xd743('0x17')]);_0x3b69c9[_0xd743('0x18')]=this[_0xd743('0x18')](_0x44df41[_0xd743('0x31')][_0xd743('0x18')]);}_0x3b69c9[_0xd743('0x38')]=this[_0xd743('0x19')](_0x44df41[_0xd743('0x31')][_0xd743('0x19')]);_0x3b69c9['where']=this[_0xd743('0x39')](_['pick'](_0x44df41[_0xd743('0x31')],_0x3c9432[_0xd743('0x39')]),_0x433085);if(_0x44df41[_0xd743('0x31')][_0xd743('0x3a')]){var _0x21939d=_0x433085;var _0x815cec=_0x44df41[_0xd743('0x31')][_0xd743('0x3a')];if(typeof _0x815cec===_0xd743('0x3b')){_0x21939d=_['filter'](_0x433085,function(_0x232774){return _['includes'](_0x815cec[_0xd743('0x3c')],_0x232774[_0xd743('0x14')]);});_0x815cec=_0x815cec[_0xd743('0x3d')];}_0x3b69c9[_0xd743('0x3e')]=_['merge'](_0x3b69c9[_0xd743('0x3e')],{'$or':_[_0xd743('0x34')](_0x21939d,function(_0x564f5c){if(_0x564f5c[_0xd743('0xb')]!==_0xd743('0x3f')){if(_0x96acab){return sequelize['where'](sequelize['fn'](_0xd743('0x40'),sequelize[_0xd743('0x1d')](_0x564f5c['name'])),{'$like':sequelize['fn']('lower','%'+_0x44df41[_0xd743('0x31')][_0xd743('0x3a')]+'%')});}else{var _0x5770ab={};_0x5770ab[_0x564f5c[_0xd743('0x14')]]={'$like':'%'+_0x44df41['query']['filter']+'%'};return _0x5770ab;}}})});}_0x3b69c9=_[_0xd743('0x41')]({},_0x3b69c9,_0x44df41[_0xd743('0x42')]);return _0x3b69c9;};exports['include']=function(_0x4c7130){var _0x21fe90=[];if(_0x4c7130['includeAll']){_0x21fe90[_0xd743('0x2d')]({'all':!![]});}else if(_0x4c7130[_0xd743('0x43')]){if(Array[_0xd743('0x16')](_0x4c7130[_0xd743('0x43')])){_0x21fe90=Object[_0xd743('0x3')](_0x4c7130[_0xd743('0x43')])[_0xd743('0x34')](function(_0x14d8f9){return parseIncludeModel(_0x4c7130['include'][_0x14d8f9]);});}else{var _0x4081f6=parseIncludeModel(_0x4c7130['include']);_0x21fe90['push'](_0x4081f6);}}return _0x21fe90;}; \ No newline at end of file +var _0x2c19=['indexOf','priority','cast','col','unsigned','DESC','ASC','omit','length','isObject','isString','hasOwnProperty','isNumeric','match','^[+]?[0-9]*$','isEmail','getFullTextValue','\x22{EXPR}\x22','{EXPR}','forEach','replace','getOptions','query','$id','intersection','attributes','nolimit','order','where','pick','filter','object','columns','merge','VIRTUAL','options','include','push','lodash','sequelize','moment','../../mysqldb','parse','includes','keys','model','alias','fields','raw','split','filters','isEmpty','find','type','isPlainObject','$gte','format','utc','$lte','YYYY-MM-DD','subtract','name','uniqueid','isArray','limit','offset','sort','map'];(function(_0x4917a6,_0x5b5045){var _0x5742e7=function(_0x308eae){while(--_0x308eae){_0x4917a6['push'](_0x4917a6['shift']());}};_0x5742e7(++_0x5b5045);}(_0x2c19,0x17a));var _0x92c1=function(_0x13ea00,_0x12f610){_0x13ea00=_0x13ea00-0x0;var _0x1f7347=_0x2c19[_0x13ea00];return _0x1f7347;};'use strict';var _=require(_0x92c1('0x0'));var sequelize=require(_0x92c1('0x1'));var moment=require(_0x92c1('0x2'));var db=require(_0x92c1('0x3'))['db'];var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x5f177d){var _0x49c28d=['ne'];try{var _0x34b5c9=JSON[_0x92c1('0x4')](_0x5f177d);var _0x4265f2=Object['keys'](_0x34b5c9)[0x0];return _0x49c28d[_0x92c1('0x5')](_0x4265f2);}catch(_0x354e95){return![];}}function getOperatorValue(_0x2cb2f5){var _0x15b2fa=JSON[_0x92c1('0x4')](_0x2cb2f5);var _0x20a297=Object[_0x92c1('0x6')](_0x15b2fa)[0x0];var _0xbf8807=_0x15b2fa[_0x20a297];return{['$'+_0x20a297]:_0xbf8807};}function parseIncludeModel(_0xb5d371){var _0x3673be=JSON[_0x92c1('0x4')](_0xb5d371);return{'model':db[_0x3673be[_0x92c1('0x7')]],'as':_0x3673be[_0x92c1('0x8')],'attributes':_0x3673be[_0x92c1('0x9')],'raw':_0x3673be[_0x92c1('0xa')]};}exports[_0x92c1('0x9')]=function(_0x5b5217){var _0xdadeb4=null;if(_0x5b5217){_0xdadeb4=_0x5b5217[_0x92c1('0xb')](',');}return _0xdadeb4;};exports[_0x92c1('0xc')]=function(_0x201a13,_0x11b82c){var _0x316a19={};if(!_[_0x92c1('0xd')](_0x201a13)){_['forOwn'](_0x201a13,function(_0x1d3a16,_0x5264e1){try{if(_0x11b82c){var _0x2da4b6=_[_0x92c1('0xe')](_0x11b82c,{'name':_0x5264e1})||{};if(hasSequelizeOperator(_0x1d3a16)){_0x316a19[_0x5264e1]=getOperatorValue(_0x1d3a16);}else if(_0x2da4b6[_0x92c1('0xf')]==='DATE'&&_[_0x92c1('0x10')](_0x1d3a16)){var _0x61c099=JSON['parse'](_0x1d3a16);var _0x1cc0c8={'$gte':moment(moment(_0x61c099[_0x92c1('0x11')])[_0x92c1('0x12')]('YYYY-MM-DD'))[_0x92c1('0x13')]()[_0x92c1('0x12')](),'$lte':moment(moment(_0x61c099[_0x92c1('0x14')])[_0x92c1('0x12')](_0x92c1('0x15')))['utc']()[_0x92c1('0x16')](0x1,'s')[_0x92c1('0x12')]()};_0x316a19[_0x5264e1]=_0x1cc0c8;}else if(_0x2da4b6[_0x92c1('0x17')]===_0x92c1('0x18')){_0x316a19[_0x5264e1]=_0x1d3a16;}else{_0x316a19[_0x5264e1]=_[_0x92c1('0x19')](_0x1d3a16)?_0x1d3a16:JSON['parse'](_0x1d3a16);}}else{_0x316a19[_0x5264e1]=_[_0x92c1('0x19')](_0x1d3a16)?_0x1d3a16:JSON[_0x92c1('0x4')](_0x1d3a16);}}catch(_0x2775e8){_0x316a19[_0x5264e1]=_0x1d3a16[_0x92c1('0xb')](',');}});}return _0x316a19;};exports[_0x92c1('0x1a')]=function(_0x24c23d){_0x24c23d=parseInt(_0x24c23d,0xa);if(!_0x24c23d||_0x24c23d<0x0){_0x24c23d=LIMIT_VALUE;}return _0x24c23d;};exports[_0x92c1('0x1b')]=function(_0x13a4fb){_0x13a4fb=parseInt(_0x13a4fb,0xa);if(!_0x13a4fb||_0x13a4fb<0x0){_0x13a4fb=0x0;}return _0x13a4fb;};exports[_0x92c1('0x1c')]=function(_0x11a11d){var _0x5e3811,_0x52601b=null;if(_0x11a11d){_0x5e3811=_0x11a11d[_0x92c1('0xb')](',');_0x52601b=_[_0x92c1('0x1d')](_0x5e3811,function(_0x2a4360){if(_0x2a4360[_0x92c1('0x1e')]('-')===0x0){return[_0x2a4360===_0x92c1('0x1f')?sequelize[_0x92c1('0x20')](sequelize[_0x92c1('0x21')](_0x92c1('0x1f')),_0x92c1('0x22')):_0x2a4360['substr'](0x1),_0x92c1('0x23')];}else{return[_0x2a4360===_0x92c1('0x1f')?sequelize[_0x92c1('0x20')](sequelize['col'](_0x92c1('0x1f')),'unsigned'):_0x2a4360,_0x92c1('0x24')];}});}return _0x52601b;};exports[_0x92c1('0x25')]=function(_0x15ee4,_0x4f6978){if(_[_0x92c1('0xd')](_0x15ee4)){return _0x15ee4;}if(_['isArray'](_0x15ee4)){for(var _0x5a2413=0x0;_0x5a2413<_0x15ee4[_0x92c1('0x26')];_0x5a2413+=0x1){_0x15ee4[_0x5a2413]=this['omit'](_0x15ee4[_0x5a2413],_0x4f6978);}return _0x15ee4;}if(!_[_0x92c1('0x27')](_0x15ee4)){return _0x15ee4;}if(_[_0x92c1('0x28')](_0x4f6978)){_0x4f6978=[_0x4f6978];}if(!_[_0x92c1('0x19')](_0x4f6978)){return _0x15ee4;}for(var _0x117dcd=0x0;_0x117dcd<_0x4f6978['length'];_0x117dcd+=0x1){_['unset'](_0x15ee4,_0x4f6978[_0x117dcd]);}for(var _0x447179 in _0x15ee4){if(_0x15ee4[_0x92c1('0x29')](_0x447179)){_0x15ee4[_0x447179]=this[_0x92c1('0x25')](_0x15ee4[_0x447179],_0x4f6978);}}return _0x15ee4;};exports[_0x92c1('0x2a')]=function(_0x38907b){return _0x38907b[_0x92c1('0x2b')](RegExp(_0x92c1('0x2c')))?!![]:![];};exports[_0x92c1('0x2d')]=function(_0x444858){return _0x444858[_0x92c1('0x2b')](/^\S+@\S+$/)?!![]:![];};exports[_0x92c1('0x2e')]=function(_0x5772e0,_0x50a3e9){var _0x218659=[];var _0x274a0b=/[ `!@#$%^&*()_\-?~]/;var _0x134954=_0x50a3e9?_0x92c1('0x2f'):_0x92c1('0x30');_0x5772e0['split'](/[ ,]+/)[_0x92c1('0x31')](function(_0x53671c){_0x53671c=_0x53671c['replace'](/([^:]")"+/g,'$1');_0x53671c='+'+_0x53671c+'*';var _0x33951e=_0x53671c[_0x92c1('0x2b')](_0x274a0b);if(_0x33951e){_0x53671c='\x22'+_0x53671c+'\x22';}_0x218659['push'](_0x53671c);});_0x134954=_0x134954[_0x92c1('0x32')](_0x92c1('0x30'),_0x218659['join']('\x20'));return _0x134954;};exports[_0x92c1('0x33')]=function(_0x24be29,_0x176f3b,_0x3d083c){var _0x3c2f2c={},_0x1025cb={};if(_0x176f3b[_0x92c1('0x34')][_0x92c1('0x35')]){_0x176f3b[_0x92c1('0x34')]['id']=_0x176f3b[_0x92c1('0x34')]['$id'];delete _0x176f3b['query']['$id'];}_0x3c2f2c[_0x92c1('0x7')]=_[_0x92c1('0x1d')](_0x24be29,_0x92c1('0x17'));_0x3c2f2c['query']=_[_0x92c1('0x6')](_0x176f3b[_0x92c1('0x34')]);_0x3c2f2c[_0x92c1('0xc')]=_[_0x92c1('0x36')](_0x3c2f2c[_0x92c1('0x7')],_0x3c2f2c['query']);_0x1025cb[_0x92c1('0x37')]=_[_0x92c1('0x36')](_0x3c2f2c[_0x92c1('0x7')],this['fields'](_0x176f3b['query'][_0x92c1('0x9')]));_0x1025cb[_0x92c1('0x37')]=_0x1025cb['attributes'][_0x92c1('0x26')]?_0x1025cb['attributes']:_0x3c2f2c[_0x92c1('0x7')];if(!_0x176f3b[_0x92c1('0x34')][_0x92c1('0x29')](_0x92c1('0x38'))){_0x1025cb['limit']=this[_0x92c1('0x1a')](_0x176f3b[_0x92c1('0x34')]['limit']);_0x1025cb[_0x92c1('0x1b')]=this[_0x92c1('0x1b')](_0x176f3b[_0x92c1('0x34')][_0x92c1('0x1b')]);}_0x1025cb[_0x92c1('0x39')]=this[_0x92c1('0x1c')](_0x176f3b[_0x92c1('0x34')]['sort']);_0x1025cb[_0x92c1('0x3a')]=this[_0x92c1('0xc')](_[_0x92c1('0x3b')](_0x176f3b[_0x92c1('0x34')],_0x3c2f2c[_0x92c1('0xc')]),_0x24be29);if(_0x176f3b[_0x92c1('0x34')][_0x92c1('0x3c')]){var _0x34637c=_0x24be29;var _0x3bfd54=_0x176f3b[_0x92c1('0x34')][_0x92c1('0x3c')];if(typeof _0x3bfd54===_0x92c1('0x3d')){_0x34637c=_[_0x92c1('0x3c')](_0x24be29,function(_0x44dbd1){return _[_0x92c1('0x5')](_0x3bfd54[_0x92c1('0x3e')],_0x44dbd1[_0x92c1('0x17')]);});_0x3bfd54=_0x3bfd54['value'];}_0x1025cb[_0x92c1('0x3a')]=_[_0x92c1('0x3f')](_0x1025cb[_0x92c1('0x3a')],{'$or':_['map'](_0x34637c,function(_0x48859d){if(_0x48859d[_0x92c1('0xf')]!==_0x92c1('0x40')){if(_0x3d083c){return sequelize['where'](sequelize['fn']('lower',sequelize[_0x92c1('0x21')](_0x48859d[_0x92c1('0x17')])),{'$like':sequelize['fn']('lower','%'+_0x176f3b[_0x92c1('0x34')][_0x92c1('0x3c')]+'%')});}else{var _0x436e0a={};_0x436e0a[_0x48859d[_0x92c1('0x17')]]={'$like':'%'+_0x176f3b[_0x92c1('0x34')][_0x92c1('0x3c')]+'%'};return _0x436e0a;}}})});}_0x1025cb=_[_0x92c1('0x3f')]({},_0x1025cb,_0x176f3b[_0x92c1('0x41')]);return _0x1025cb;};exports[_0x92c1('0x42')]=function(_0x2009d8){var _0x11ba61=[];if(_0x2009d8['includeAll']){_0x11ba61[_0x92c1('0x43')]({'all':!![]});}else if(_0x2009d8[_0x92c1('0x42')]){if(Array[_0x92c1('0x19')](_0x2009d8[_0x92c1('0x42')])){_0x11ba61=Object[_0x92c1('0x6')](_0x2009d8['include'])['map'](function(_0x566851){return parseIncludeModel(_0x2009d8[_0x92c1('0x42')][_0x566851]);});}else{var _0x429ae3=parseIncludeModel(_0x2009d8['include']);_0x11ba61['push'](_0x429ae3);}}return _0x11ba61;}; \ No newline at end of file diff --git a/server/components/realtime/agents.js b/server/components/realtime/agents.js index 75841b8..f3ed26c 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 _0x24ca=['find','merge','globalStatus','getSortedAgentsIdsByStatus','fields','DESC','ASC','getUpdatedSortOptions','fullname,internal','internal','substring','indexOf','validateSortParameter','sort','toLowerCase','sortAgentsByStatus','userpic','online','lastLoginAt','lastPauseAt','address','chatCapacity','openchannelCapacity','mailCapacity','faxCapacity','openchannelCurrentCapacity','mailCurrentCapacity','whatsappCurrentCapacity','faxCurrentCapacity','chatStatus','chatStatusTime','openchannelStatusTime','mailStatusTime','smsStatusTime','whatsappStatusTime','faxStatusTime','voiceStatusTime','queue','screenrecording','phoneBarEnableScreenRecordingByAgent','phoneBarEnableAutomaticScreenRecording','omit','pick','filterAgentAttributes','role','smsCapacity','smsCurrentCapacity','routealias','lodash','../../mysqldb','client','http','chatPause','faxPause','mailPause','openchannelPause','smsPause','voicePause','whatsappPause','filter','length','idle','unknown','unavailable','ringing','isNil','voiceStatus','pause','every','faxStatus','mailStatus','openchannelStatus','smsStatus','whatsappStatus','request','error','result','then','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','catch','getRealtimeAgents','*pause','busy','getAgentStatus','isArray','Queue','map','findOne','all','flatten','uniq','value','getAgentIdsByQueues','includes','resolve','User','name','fullname','pauseType'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0x24ca,0x1bc));var _0xa24c=function(_0x4347ec,_0x41c4b8){_0x4347ec=_0x4347ec-0x0;var _0x4c8314=_0x24ca[_0x4347ec];return _0x4c8314;};'use strict';var _=require(_0xa24c('0x0'));var jayson=require('jayson/promise');var db=require(_0xa24c('0x1'))['db'];var amiClient=jayson[_0xa24c('0x2')][_0xa24c('0x3')]({'port':0x232a});var routingClient=jayson['client'][_0xa24c('0x3')]({'port':0x232c});function isAgentPaused(_0x8a54a0,_0x195e60){var _0x28aa2f=[_0x8a54a0[_0xa24c('0x4')],_0x8a54a0[_0xa24c('0x5')],_0x8a54a0[_0xa24c('0x6')],_0x8a54a0[_0xa24c('0x7')],_0x8a54a0[_0xa24c('0x8')],_0x8a54a0[_0xa24c('0x9')],_0x8a54a0[_0xa24c('0xa')]];if(!_0x195e60)return _['every'](_0x28aa2f);var _0x42d89c=_[_0xa24c('0xb')](_0x28aa2f);return _0x42d89c[_0xa24c('0xc')]>0x0&&_0x42d89c['length']<_0x28aa2f[_0xa24c('0xc')]?!![]:![];}function isIdle(_0x325c6d){return _0x325c6d===_0xa24c('0xd')||_0x325c6d===_0xa24c('0xe')||_0x325c6d===_0xa24c('0xf')||_0x325c6d===_0xa24c('0x10')||_[_0xa24c('0x11')](_0x325c6d);}function isAgentIdle(_0xc82af0){if(_0xc82af0[_0xa24c('0x12')]!=='idle'&&_0xc82af0[_0xa24c('0x9')]){_0xc82af0[_0xa24c('0x12')]=_0xa24c('0x13');return![];}return _[_0xa24c('0x14')]([_0xc82af0['chatStatus'],_0xc82af0[_0xa24c('0x15')],_0xc82af0[_0xa24c('0x16')],_0xc82af0[_0xa24c('0x17')],_0xc82af0[_0xa24c('0x18')],_0xc82af0[_0xa24c('0x12')],_0xc82af0[_0xa24c('0x19')]],isIdle);}function getRealtimeAgents(){return amiClient[_0xa24c('0x1a')]('Agents',{})['then'](function(_0xb80781){if(_0xb80781[_0xa24c('0x1b')]){throw new Error('Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)');}var _0x5babb5=_0xb80781[_0xa24c('0x1c')];return routingClient[_0xa24c('0x1a')]('Agents',{})[_0xa24c('0x1d')](function(_0x5de3e6){if(_0x5de3e6[_0xa24c('0x1b')]){throw new Error(_0xa24c('0x1e'));}var _0x1fcd4b=_0x5de3e6[_0xa24c('0x1c')];return _['merge']({},_0x5babb5,_0x1fcd4b);});})[_0xa24c('0x1f')](function(_0x18b7e0){throw _0x18b7e0;});}exports[_0xa24c('0x20')]=getRealtimeAgents;function getAgentStatus(_0x4d4bab){var _0x48a768='unknown';if(isAgentPaused(_0x4d4bab))_0x48a768='pause';else if(isAgentPaused(_0x4d4bab,!![]))_0x48a768=_0xa24c('0x21');else if(isAgentIdle(_0x4d4bab))_0x48a768=_0xa24c('0xd');else _0x48a768=_0xa24c('0x22');return _0x48a768;}exports[_0xa24c('0x23')]=getAgentStatus;function getAgentIdsByQueues(_0x51a275,_0x30ec21){var _0x5f299e=_[_0xa24c('0x24')](_0x51a275)?_0x51a275:[_0x51a275];var _0xb81d97=_['startCase'](_0x30ec21)+_0xa24c('0x25');var _0x363d52=_[_0xa24c('0x26')](_0x5f299e,function(_0x188ee2){return db[_0xb81d97][_0xa24c('0x27')]({'where':{'id':_0x188ee2}})['then'](function(_0xec9167){if(!_0xec9167)return[];return _0xec9167['getAgents']({'attributes':['id'],'raw':!![]});});});return Promise[_0xa24c('0x28')](_0x363d52)[_0xa24c('0x1d')](function(_0x294685){var _0x51dc3f=_(_0x294685)[_0xa24c('0x29')]()[_0xa24c('0x26')]('id')[_0xa24c('0x2a')]()[_0xa24c('0x2b')]();return _0x51dc3f;});}exports[_0xa24c('0x2c')]=getAgentIdsByQueues;function getAgentIdsByStatus(_0x3ad0e6,_0x39609a,_0x5b23f4){try{if(_0x39609a[_0xa24c('0xc')]>0x0){_0x3ad0e6=_0x3ad0e6[_0xa24c('0xb')](function(_0x152120){return _0x39609a[_0xa24c('0x2d')](_0x152120['id']);});}var _0x5e491e=_0x3ad0e6[_0xa24c('0xb')](function(_0xc96ce7){var _0x97c08='busy';if(isAgentIdle(_0xc96ce7)){_0x97c08=_0xa24c('0xd');}return _0x97c08===_0x5b23f4;});return _[_0xa24c('0x26')](_0x5e491e,'id');}catch(_0x253d83){throw _0x253d83;}}exports['getAgentIdsByStatus']=getAgentIdsByStatus;function getSortedAgentsIdsByStatus(_0x245fb2,_0x5e0226,_0x1102ab){return Promise[_0xa24c('0x2e')]()[_0xa24c('0x1d')](function(){if(_0x5e0226['length']>0x0){_0x245fb2=_0x245fb2[_0xa24c('0xb')](function(_0x53f90){return _0x5e0226[_0xa24c('0x2d')](_0x53f90['id']);});}return _0x245fb2;})['then'](function(){return db[_0xa24c('0x2f')]['findAll']({'attributes':['id',_0xa24c('0x30'),_0xa24c('0x31'),'chatPause','faxPause',_0xa24c('0x6'),_0xa24c('0x7'),_0xa24c('0x8'),_0xa24c('0x9'),_0xa24c('0xa'),_0xa24c('0x32')],'where':{'id':{'$in':_[_0xa24c('0x26')](_0x245fb2,'id')}},'raw':!![]});})['then'](function(_0x39f146){return _0x39f146[_0xa24c('0x26')](function(_0x12825d){var _0xbd24c0=_[_0xa24c('0x33')](_0x245fb2,['id',_0x12825d['id']]);var _0x31b19d=filterAgentAttributes(_0xbd24c0);_[_0xa24c('0x34')](_0x12825d,_0x31b19d);_0x12825d[_0xa24c('0x35')]=getAgentStatus(_0x12825d);return _0x12825d;});})[_0xa24c('0x1d')](function(_0x129bb9){var _0x4c7a30=sortAgentsByStatus(_0x129bb9,_0x1102ab);return _[_0xa24c('0x26')](_0x4c7a30,'id');})[_0xa24c('0x1f')](function(_0x2b362d){throw _0x2b362d;});}exports[_0xa24c('0x36')]=getSortedAgentsIdsByStatus;function getUpdatedSortOptions(_0x578b72){var _0x56a485={'fields':[],'order':null};var _0x19a65f=_0x578b72['split'](',');_0x56a485[_0xa24c('0x37')]=_[_0xa24c('0xb')](_0x19a65f,function(_0x22a316){if(!_0x22a316[_0xa24c('0x2d')](_0xa24c('0x35'))){return!![];}_0x56a485['order']=_['startsWith'](_0x22a316,'-')?_0xa24c('0x38'):_0xa24c('0x39');return![];});return _0x56a485;}exports[_0xa24c('0x3a')]=getUpdatedSortOptions;function validateSortParameter(_0x213dc3){if(!_0x213dc3){_0x213dc3=_0xa24c('0x3b');}if(_0x213dc3[_0xa24c('0x2d')]('fullname')&&!_0x213dc3['includes'](_0xa24c('0x3c'))){var _0x1ce83e=_0x213dc3[_0xa24c('0x3d')](0x0,_0x213dc3[_0xa24c('0x3e')](_0xa24c('0x31')));_0x213dc3+=','+_0x1ce83e+'internal';}return _0x213dc3;}exports[_0xa24c('0x3f')]=validateSortParameter;function sortAgentsByStatus(_0x7895e,_0x5ef186){var _0x599627=_0x7895e[_0xa24c('0x40')](function(_0x44f6ae,_0x231eea){if(_0x44f6ae['globalStatus']===_0x231eea['globalStatus']){if(_0x44f6ae[_0xa24c('0x35')]===_0xa24c('0x13')){if(_0x5ef186===_0xa24c('0x38')){return(_0x44f6ae[_0xa24c('0x32')]||'')<(_0x231eea[_0xa24c('0x32')]||'')||_0x44f6ae[_0xa24c('0x31')][_0xa24c('0x41')]()>_0x231eea[_0xa24c('0x31')]['toLowerCase']()?0x1:-0x1;}else{return(_0x44f6ae['pauseType']||'')<(_0x231eea[_0xa24c('0x32')]||'')||_0x44f6ae[_0xa24c('0x31')][_0xa24c('0x41')]()>_0x231eea['fullname'][_0xa24c('0x41')]()?-0x1:0x1;}}else{if(_0x5ef186===_0xa24c('0x38')){return _0x44f6ae[_0xa24c('0x31')][_0xa24c('0x41')]()<_0x231eea[_0xa24c('0x31')][_0xa24c('0x41')]()?0x1:-0x1;}else{return _0x44f6ae[_0xa24c('0x31')][_0xa24c('0x41')]()<_0x231eea[_0xa24c('0x31')][_0xa24c('0x41')]()?-0x1:0x1;}}}else{if(_0x5ef186==='DESC'){return _0x44f6ae[_0xa24c('0x35')]<_0x231eea[_0xa24c('0x35')]?0x1:-0x1;}else{return _0x44f6ae[_0xa24c('0x35')]<_0x231eea['globalStatus']?-0x1:0x1;}}});return _0x599627;}exports[_0xa24c('0x42')]=sortAgentsByStatus;function filterAgentAttributes(_0x247d2c){var _0x3feaf6=[_0xa24c('0x43'),_0xa24c('0x44'),_0xa24c('0x45'),_0xa24c('0x46'),_0xa24c('0x32'),_0xa24c('0x46'),_0xa24c('0x3c'),_0xa24c('0x47'),'chatPause',_0xa24c('0x7'),_0xa24c('0x6'),_0xa24c('0x8'),_0xa24c('0xa'),_0xa24c('0x5'),_0xa24c('0x9'),_0xa24c('0x48'),_0xa24c('0x49'),_0xa24c('0x4a'),'smsCapacity','whatsappCapacity',_0xa24c('0x4b'),'chatCurrentCapacity',_0xa24c('0x4c'),_0xa24c('0x4d'),'smsCurrentCapacity',_0xa24c('0x4e'),_0xa24c('0x4f'),_0xa24c('0x50'),'openchannelStatus','mailStatus',_0xa24c('0x18'),'whatsappStatus',_0xa24c('0x15'),_0xa24c('0x12'),_0xa24c('0x51'),_0xa24c('0x52'),_0xa24c('0x53'),_0xa24c('0x54'),_0xa24c('0x55'),_0xa24c('0x56'),_0xa24c('0x57'),_0xa24c('0x58'),'destconnectedlinenum',_0xa24c('0x59'),_0xa24c('0x5a'),_0xa24c('0x5b'),'routealias'];var _0x5bde94=['chatPause',_0xa24c('0x7'),'mailPause',_0xa24c('0x8'),_0xa24c('0xa'),'faxPause',_0xa24c('0x9'),_0xa24c('0x44')];var _0x131a7a=_(_0x247d2c)[_0xa24c('0x5c')](_0x5bde94)[_0xa24c('0x5d')](_0x3feaf6)[_0xa24c('0x2b')]();return _0x131a7a;}exports[_0xa24c('0x5e')]=filterAgentAttributes;function getRealtimeAgentsQueryFields(){return['id',_0xa24c('0x30'),'fullname',_0xa24c('0x5f'),'internal','online','globalStatus','userpic','lastLoginAt',_0xa24c('0x32'),'lastPauseAt',_0xa24c('0x5'),_0xa24c('0x4'),_0xa24c('0x6'),_0xa24c('0x7'),_0xa24c('0x8'),_0xa24c('0x9'),_0xa24c('0xa'),_0xa24c('0x50'),_0xa24c('0x15'),_0xa24c('0x16'),_0xa24c('0x17'),_0xa24c('0x18'),_0xa24c('0x12'),_0xa24c('0x19'),_0xa24c('0x51'),'faxStatusTime',_0xa24c('0x53'),_0xa24c('0x52'),'smsStatusTime',_0xa24c('0x57'),_0xa24c('0x55'),_0xa24c('0x48'),_0xa24c('0x4b'),'mailCapacity','openchannelCapacity',_0xa24c('0x60'),'whatsappCapacity','chatCurrentCapacity',_0xa24c('0x4f'),_0xa24c('0x4d'),_0xa24c('0x4c'),_0xa24c('0x61'),'whatsappCurrentCapacity','phoneBarEnableScreenRecordingByAgent',_0xa24c('0x5b'),'destconnectedlinenum','onhold',_0xa24c('0x58'),_0xa24c('0x62'),_0xa24c('0x59')];}exports['getRealtimeAgentsQueryFields']=getRealtimeAgentsQueryFields; \ No newline at end of file +var _0x2675=['whatsappCurrentCapacity','faxCurrentCapacity','chatStatusTime','openchannelStatusTime','mailStatusTime','smsStatusTime','whatsappStatusTime','faxStatusTime','queue','screenrecording','phoneBarEnableScreenRecordingByAgent','phoneBarEnableAutomaticScreenRecording','routealias','pick','value','filterAgentAttributes','role','userpic','voiceStatusTime','destconnectedlinenum','onhold','lodash','http','client','chatPause','faxPause','mailPause','openchannelPause','smsPause','voicePause','every','length','idle','unavailable','isNil','voiceStatus','pause','chatStatus','faxStatus','mailStatus','openchannelStatus','smsStatus','whatsappStatus','then','error','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','result','request','Agents','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','merge','unknown','*pause','busy','map','findOne','getAgents','all','uniq','getAgentIdsByQueues','filter','includes','getAgentIdsByStatus','resolve','User','findAll','name','fullname','whatsappPause','pauseType','find','globalStatus','catch','getSortedAgentsIdsByStatus','split','order','startsWith','DESC','getUpdatedSortOptions','fullname,internal','internal','substring','indexOf','toLowerCase','online','lastPauseAt','chatCapacity','openchannelCapacity','mailCapacity','smsCapacity','whatsappCapacity','faxCapacity','chatCurrentCapacity','openchannelCurrentCapacity','mailCurrentCapacity','smsCurrentCapacity'];(function(_0x334480,_0x2e1a8a){var _0x170f65=function(_0x49f469){while(--_0x49f469){_0x334480['push'](_0x334480['shift']());}};_0x170f65(++_0x2e1a8a);}(_0x2675,0x75));var _0x5267=function(_0x2ce698,_0x53756f){_0x2ce698=_0x2ce698-0x0;var _0xf24021=_0x2675[_0x2ce698];return _0xf24021;};'use strict';var _=require(_0x5267('0x0'));var jayson=require('jayson/promise');var db=require('../../mysqldb')['db'];var amiClient=jayson['client'][_0x5267('0x1')]({'port':0x232a});var routingClient=jayson[_0x5267('0x2')]['http']({'port':0x232c});function isAgentPaused(_0x4600fa,_0x36bdf0){var _0x4e2548=[_0x4600fa[_0x5267('0x3')],_0x4600fa[_0x5267('0x4')],_0x4600fa[_0x5267('0x5')],_0x4600fa[_0x5267('0x6')],_0x4600fa[_0x5267('0x7')],_0x4600fa[_0x5267('0x8')],_0x4600fa['whatsappPause']];if(!_0x36bdf0)return _[_0x5267('0x9')](_0x4e2548);var _0x46bfdf=_['filter'](_0x4e2548);return _0x46bfdf[_0x5267('0xa')]>0x0&&_0x46bfdf['length']<_0x4e2548[_0x5267('0xa')]?!![]:![];}function isIdle(_0x207d47){return _0x207d47===_0x5267('0xb')||_0x207d47==='unknown'||_0x207d47===_0x5267('0xc')||_0x207d47==='ringing'||_[_0x5267('0xd')](_0x207d47);}function isAgentIdle(_0x5bbf00){if(_0x5bbf00[_0x5267('0xe')]!==_0x5267('0xb')&&_0x5bbf00[_0x5267('0x8')]){_0x5bbf00[_0x5267('0xe')]=_0x5267('0xf');return![];}return _[_0x5267('0x9')]([_0x5bbf00[_0x5267('0x10')],_0x5bbf00[_0x5267('0x11')],_0x5bbf00[_0x5267('0x12')],_0x5bbf00[_0x5267('0x13')],_0x5bbf00[_0x5267('0x14')],_0x5bbf00[_0x5267('0xe')],_0x5bbf00[_0x5267('0x15')]],isIdle);}function getRealtimeAgents(){return amiClient['request']('Agents',{})[_0x5267('0x16')](function(_0x40d897){if(_0x40d897[_0x5267('0x17')]){throw new Error(_0x5267('0x18'));}var _0x46b2c2=_0x40d897[_0x5267('0x19')];return routingClient[_0x5267('0x1a')](_0x5267('0x1b'),{})[_0x5267('0x16')](function(_0xb1c97a){if(_0xb1c97a[_0x5267('0x17')]){throw new Error(_0x5267('0x1c'));}var _0x528d61=_0xb1c97a[_0x5267('0x19')];return _[_0x5267('0x1d')]({},_0x46b2c2,_0x528d61);});})['catch'](function(_0x20cb50){throw _0x20cb50;});}exports['getRealtimeAgents']=getRealtimeAgents;function getAgentStatus(_0x1cf835){var _0x1019e7=_0x5267('0x1e');if(isAgentPaused(_0x1cf835))_0x1019e7=_0x5267('0xf');else if(isAgentPaused(_0x1cf835,!![]))_0x1019e7=_0x5267('0x1f');else if(isAgentIdle(_0x1cf835))_0x1019e7='idle';else _0x1019e7=_0x5267('0x20');return _0x1019e7;}exports['getAgentStatus']=getAgentStatus;function getAgentIdsByQueues(_0xa32663,_0x420fb8){var _0x3b53ac=_['isArray'](_0xa32663)?_0xa32663:[_0xa32663];var _0x499f19=_['startCase'](_0x420fb8)+'Queue';var _0x5ea6a6=_[_0x5267('0x21')](_0x3b53ac,function(_0x399e64){return db[_0x499f19][_0x5267('0x22')]({'where':{'id':_0x399e64}})[_0x5267('0x16')](function(_0x11c8ea){if(!_0x11c8ea)return[];return _0x11c8ea[_0x5267('0x23')]({'attributes':['id'],'raw':!![]});});});return Promise[_0x5267('0x24')](_0x5ea6a6)[_0x5267('0x16')](function(_0x2cdc45){var _0x59f112=_(_0x2cdc45)['flatten']()[_0x5267('0x21')]('id')[_0x5267('0x25')]()['value']();return _0x59f112;});}exports[_0x5267('0x26')]=getAgentIdsByQueues;function getAgentIdsByStatus(_0x52504e,_0x4d7c2a,_0x43e7e7){try{if(_0x4d7c2a[_0x5267('0xa')]>0x0){_0x52504e=_0x52504e[_0x5267('0x27')](function(_0x2d2ace){return _0x4d7c2a[_0x5267('0x28')](_0x2d2ace['id']);});}var _0x4f3d4d=_0x52504e['filter'](function(_0x18020c){var _0x10a68c=_0x5267('0x20');if(isAgentIdle(_0x18020c)){_0x10a68c='idle';}return _0x10a68c===_0x43e7e7;});return _['map'](_0x4f3d4d,'id');}catch(_0xbe7922){throw _0xbe7922;}}exports[_0x5267('0x29')]=getAgentIdsByStatus;function getSortedAgentsIdsByStatus(_0x1fa725,_0x5bec7e,_0x59b091){return Promise[_0x5267('0x2a')]()[_0x5267('0x16')](function(){if(_0x5bec7e[_0x5267('0xa')]>0x0){_0x1fa725=_0x1fa725[_0x5267('0x27')](function(_0x5bbb83){return _0x5bec7e[_0x5267('0x28')](_0x5bbb83['id']);});}return _0x1fa725;})[_0x5267('0x16')](function(){return db[_0x5267('0x2b')][_0x5267('0x2c')]({'attributes':['id',_0x5267('0x2d'),_0x5267('0x2e'),_0x5267('0x3'),_0x5267('0x4'),'mailPause','openchannelPause',_0x5267('0x7'),'voicePause',_0x5267('0x2f'),_0x5267('0x30')],'where':{'id':{'$in':_[_0x5267('0x21')](_0x1fa725,'id')}},'raw':!![]});})[_0x5267('0x16')](function(_0x4ac4a0){return _0x4ac4a0[_0x5267('0x21')](function(_0xdd06f){var _0x3c6c1a=_[_0x5267('0x31')](_0x1fa725,['id',_0xdd06f['id']]);var _0x35fd12=filterAgentAttributes(_0x3c6c1a);_[_0x5267('0x1d')](_0xdd06f,_0x35fd12);_0xdd06f[_0x5267('0x32')]=getAgentStatus(_0xdd06f);return _0xdd06f;});})[_0x5267('0x16')](function(_0x484b77){var _0x1b297c=sortAgentsByStatus(_0x484b77,_0x59b091);return _['map'](_0x1b297c,'id');})[_0x5267('0x33')](function(_0x335c0e){throw _0x335c0e;});}exports[_0x5267('0x34')]=getSortedAgentsIdsByStatus;function getUpdatedSortOptions(_0x365d98){var _0x41e58b={'fields':[],'order':null};var _0x33ecd7=_0x365d98[_0x5267('0x35')](',');_0x41e58b['fields']=_[_0x5267('0x27')](_0x33ecd7,function(_0x3a2e07){if(!_0x3a2e07[_0x5267('0x28')](_0x5267('0x32'))){return!![];}_0x41e58b[_0x5267('0x36')]=_[_0x5267('0x37')](_0x3a2e07,'-')?_0x5267('0x38'):'ASC';return![];});return _0x41e58b;}exports[_0x5267('0x39')]=getUpdatedSortOptions;function validateSortParameter(_0x5ef02e){if(!_0x5ef02e){_0x5ef02e=_0x5267('0x3a');}if(_0x5ef02e['includes']('fullname')&&!_0x5ef02e['includes'](_0x5267('0x3b'))){var _0x50302f=_0x5ef02e[_0x5267('0x3c')](0x0,_0x5ef02e[_0x5267('0x3d')](_0x5267('0x2e')));_0x5ef02e+=','+_0x50302f+_0x5267('0x3b');}return _0x5ef02e;}exports['validateSortParameter']=validateSortParameter;function sortAgentsByStatus(_0x456b33,_0x805587){var _0x588edf=_0x456b33['sort'](function(_0x3e1483,_0x560cdf){if(_0x3e1483[_0x5267('0x32')]===_0x560cdf[_0x5267('0x32')]){if(_0x3e1483[_0x5267('0x32')]===_0x5267('0xf')){if(_0x805587===_0x5267('0x38')){return(_0x3e1483[_0x5267('0x30')]||'')<(_0x560cdf[_0x5267('0x30')]||'')||_0x3e1483['fullname']['toLowerCase']()>_0x560cdf[_0x5267('0x2e')]['toLowerCase']()?0x1:-0x1;}else{return(_0x3e1483[_0x5267('0x30')]||'')<(_0x560cdf[_0x5267('0x30')]||'')||_0x3e1483['fullname'][_0x5267('0x3e')]()>_0x560cdf[_0x5267('0x2e')][_0x5267('0x3e')]()?-0x1:0x1;}}else{if(_0x805587===_0x5267('0x38')){return _0x3e1483[_0x5267('0x2e')][_0x5267('0x3e')]()<_0x560cdf[_0x5267('0x2e')][_0x5267('0x3e')]()?0x1:-0x1;}else{return _0x3e1483[_0x5267('0x2e')]['toLowerCase']()<_0x560cdf[_0x5267('0x2e')][_0x5267('0x3e')]()?-0x1:0x1;}}}else{if(_0x805587===_0x5267('0x38')){return _0x3e1483[_0x5267('0x32')]<_0x560cdf[_0x5267('0x32')]?0x1:-0x1;}else{return _0x3e1483['globalStatus']<_0x560cdf[_0x5267('0x32')]?-0x1:0x1;}}});return _0x588edf;}exports['sortAgentsByStatus']=sortAgentsByStatus;function filterAgentAttributes(_0x21e2cb){var _0x5cda8c=['userpic',_0x5267('0x3f'),'lastLoginAt',_0x5267('0x40'),_0x5267('0x30'),_0x5267('0x40'),_0x5267('0x3b'),'address',_0x5267('0x3'),'openchannelPause','mailPause',_0x5267('0x7'),_0x5267('0x2f'),'faxPause','voicePause',_0x5267('0x41'),_0x5267('0x42'),_0x5267('0x43'),_0x5267('0x44'),_0x5267('0x45'),_0x5267('0x46'),_0x5267('0x47'),_0x5267('0x48'),_0x5267('0x49'),_0x5267('0x4a'),_0x5267('0x4b'),_0x5267('0x4c'),_0x5267('0x10'),_0x5267('0x13'),'mailStatus',_0x5267('0x14'),_0x5267('0x15'),_0x5267('0x11'),'voiceStatus',_0x5267('0x4d'),_0x5267('0x4e'),_0x5267('0x4f'),_0x5267('0x50'),_0x5267('0x51'),_0x5267('0x52'),'voiceStatusTime',_0x5267('0x53'),'destconnectedlinenum',_0x5267('0x54'),_0x5267('0x55'),_0x5267('0x56'),_0x5267('0x57')];var _0x91b932=[_0x5267('0x3'),_0x5267('0x6'),'mailPause','smsPause',_0x5267('0x2f'),_0x5267('0x4'),'voicePause',_0x5267('0x3f')];var _0x578e4e=_(_0x21e2cb)['omit'](_0x91b932)[_0x5267('0x58')](_0x5cda8c)[_0x5267('0x59')]();return _0x578e4e;}exports[_0x5267('0x5a')]=filterAgentAttributes;function getRealtimeAgentsQueryFields(){return['id',_0x5267('0x2d'),_0x5267('0x2e'),_0x5267('0x5b'),_0x5267('0x3b'),_0x5267('0x3f'),_0x5267('0x32'),_0x5267('0x5c'),'lastLoginAt',_0x5267('0x30'),_0x5267('0x40'),_0x5267('0x4'),_0x5267('0x3'),_0x5267('0x5'),_0x5267('0x6'),'smsPause',_0x5267('0x8'),'whatsappPause',_0x5267('0x10'),_0x5267('0x11'),_0x5267('0x12'),'openchannelStatus',_0x5267('0x14'),_0x5267('0xe'),_0x5267('0x15'),_0x5267('0x4d'),_0x5267('0x52'),_0x5267('0x4f'),'openchannelStatusTime',_0x5267('0x50'),_0x5267('0x5d'),_0x5267('0x51'),_0x5267('0x41'),'faxCapacity','mailCapacity',_0x5267('0x42'),'smsCapacity',_0x5267('0x45'),_0x5267('0x47'),'faxCurrentCapacity','mailCurrentCapacity',_0x5267('0x48'),_0x5267('0x4a'),_0x5267('0x4b'),'phoneBarEnableScreenRecordingByAgent',_0x5267('0x56'),_0x5267('0x5e'),_0x5267('0x5f'),_0x5267('0x53'),'routealias','screenrecording'];}exports['getRealtimeAgentsQueryFields']=getRealtimeAgentsQueryFields; \ No newline at end of file diff --git a/server/components/realtime/queues.js b/server/components/realtime/queues.js index 63194f8..af873c8 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 _0x2491=['loggedIn','waiting','busy','inUse','invalid','loggedInDb','notInUse','ringInUse','talking','unavailable','unknown','pTalking','originated','dialActive','startPredictive','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialPredictiveInterval','predictiveIntervalAvailable','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','request','Queues','then','error','format','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','result','catch','voice','inbound','concat','outbound','map','get','paused','merge','jayson/promise','client','http','available'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0x2491,0x164));var _0x1249=function(_0x4d7994,_0x208b59){_0x4d7994=_0x4d7994-0x0;var _0x2cd0e1=_0x2491[_0x4d7994];return _0x2cd0e1;};'use strict';var _=require('lodash');var jayson=require(_0x1249('0x0'));var util=require('util');var amiClient=jayson[_0x1249('0x1')][_0x1249('0x2')]({'port':0x232a});var routingClient=jayson['client']['http']({'port':0x232c});var DEFAULT_QUEUE_ATTRIBUTES=[_0x1249('0x3'),_0x1249('0x4'),'paused',_0x1249('0x5')];var VOICE_QUEUE_ATTRIBUTES=[_0x1249('0x6'),_0x1249('0x7'),_0x1249('0x8'),_0x1249('0x9'),_0x1249('0xa'),'onHold','ringing',_0x1249('0xb'),_0x1249('0xc'),_0x1249('0xd'),_0x1249('0xe')];var OUTBOUND_QUEUE_ATTRIBUTES=[_0x1249('0xf'),_0x1249('0x10'),'message','statusMessage',_0x1249('0x11'),'dialMethod','Trunk',_0x1249('0x12'),'startProgressive','erlangCalls',_0x1249('0x13'),_0x1249('0x14'),_0x1249('0x15'),_0x1249('0x16'),'dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold',_0x1249('0x17'),'predictiveIntervalTotalCalls',_0x1249('0x18'),_0x1249('0x19'),_0x1249('0x1a'),_0x1249('0x1b'),_0x1249('0x1c')];function getRealtimeQueues(_0x533dd6,_0x21dcee){var _0x5e6fac=_0x21dcee==='voice'?amiClient:routingClient;return _0x5e6fac[_0x1249('0x1d')](_['startCase'](_0x21dcee)+_0x1249('0x1e'),_0x533dd6)[_0x1249('0x1f')](function(_0x4c6ba7){if(_0x4c6ba7[_0x1249('0x20')])throw new Error(util[_0x1249('0x21')](_0x1249('0x22'),_0x21dcee));return _0x4c6ba7[_0x1249('0x23')];})[_0x1249('0x24')](function(_0x3eb5e5){throw _0x3eb5e5;});}exports['getRealtimeQueues']=getRealtimeQueues;function initializeQueues(_0x3d7231,_0x5908a6,_0x205661,_0x172085){var _0xbf592f=DEFAULT_QUEUE_ATTRIBUTES;if(_0x205661===_0x1249('0x25')){if(_0x172085===_0x1249('0x26')){_0xbf592f=_0xbf592f[_0x1249('0x27')](VOICE_QUEUE_ATTRIBUTES);}else if(_0x172085===_0x1249('0x28')){_0xbf592f=_0xbf592f[_0x1249('0x27')](VOICE_QUEUE_ATTRIBUTES,OUTBOUND_QUEUE_ATTRIBUTES);}}return _0x3d7231[_0x1249('0x29')](function(_0x53a366){var _0x267987=_0x53a366[_0x1249('0x2a')]({'plain':!![]});_0x267987[_0x1249('0x2b')]=0x0;_0x267987[_0x1249('0x9')]=0x0;_0x267987['loggedIn']=0x0;_0x267987[_0x1249('0x3')]=0x0;_0x267987['waiting']=0x0;if(_0x205661==='voice'){_0x267987['talking']=0x0;_0x267987[_0x1249('0x6')]=0x0;if(_0x172085===_0x1249('0x28')){_0x267987[_0x1249('0xf')]=0x0;_0x267987[_0x1249('0x10')]=0x0;}}var _0x3ebdb6=_['find'](_0x5908a6,['id',_0x267987['id']]);if(_0x3ebdb6){_[_0x1249('0x2c')](_0x267987,_['pick'](_0x3ebdb6,_0xbf592f));}return _0x267987;});}exports['initializeQueues']=initializeQueues; \ No newline at end of file +var _0x8d29=['predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','voice','request','startCase','Queues','then','error','format','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','result','catch','getRealtimeQueues','map','get','outbound','find','merge','pick','initializeQueues','lodash','util','client','available','loggedIn','paused','waiting','busy','loggedInDb','notInUse','ringing','ringInUse','talking','unavailable','unknown','pTalking','originated','message','statusMessage','dialActive','dialMethod','Trunk','startPredictive','startProgressive','erlangCalls','erlangCallToSecond','erlangBusyFactor','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','predictiveIntervalAvailable','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls'];(function(_0x2df507,_0x553862){var _0x1f7167=function(_0x11319e){while(--_0x11319e){_0x2df507['push'](_0x2df507['shift']());}};_0x1f7167(++_0x553862);}(_0x8d29,0x180));var _0x98d2=function(_0x1a6c98,_0x257d27){_0x1a6c98=_0x1a6c98-0x0;var _0x4ea15f=_0x8d29[_0x1a6c98];return _0x4ea15f;};'use strict';var _=require(_0x98d2('0x0'));var jayson=require('jayson/promise');var util=require(_0x98d2('0x1'));var amiClient=jayson[_0x98d2('0x2')]['http']({'port':0x232a});var routingClient=jayson['client']['http']({'port':0x232c});var DEFAULT_QUEUE_ATTRIBUTES=[_0x98d2('0x3'),_0x98d2('0x4'),_0x98d2('0x5'),_0x98d2('0x6')];var VOICE_QUEUE_ATTRIBUTES=[_0x98d2('0x7'),'inUse','invalid',_0x98d2('0x8'),_0x98d2('0x9'),'onHold',_0x98d2('0xa'),_0x98d2('0xb'),_0x98d2('0xc'),_0x98d2('0xd'),_0x98d2('0xe')];var OUTBOUND_QUEUE_ATTRIBUTES=[_0x98d2('0xf'),_0x98d2('0x10'),_0x98d2('0x11'),_0x98d2('0x12'),_0x98d2('0x13'),_0x98d2('0x14'),_0x98d2('0x15'),_0x98d2('0x16'),_0x98d2('0x17'),_0x98d2('0x18'),_0x98d2('0x19'),'erlangAbandonmentRate',_0x98d2('0x1a'),'dialPredictiveInterval',_0x98d2('0x1b'),_0x98d2('0x1c'),_0x98d2('0x1d'),_0x98d2('0x1e'),_0x98d2('0x1f'),_0x98d2('0x20'),'predictiveIntervalDroppedCallsCallersExit',_0x98d2('0x21'),'predictiveIntervalAvgTalktime'];function getRealtimeQueues(_0x41bd8c,_0x5391a8){var _0x2feb1c=_0x5391a8===_0x98d2('0x22')?amiClient:routingClient;return _0x2feb1c[_0x98d2('0x23')](_[_0x98d2('0x24')](_0x5391a8)+_0x98d2('0x25'),_0x41bd8c)[_0x98d2('0x26')](function(_0x27e50e){if(_0x27e50e[_0x98d2('0x27')])throw new Error(util[_0x98d2('0x28')](_0x98d2('0x29'),_0x5391a8));return _0x27e50e[_0x98d2('0x2a')];})[_0x98d2('0x2b')](function(_0x394316){throw _0x394316;});}exports[_0x98d2('0x2c')]=getRealtimeQueues;function initializeQueues(_0x1a41cb,_0x599705,_0x45fe65,_0x5efd3e){var _0x1d25b5=DEFAULT_QUEUE_ATTRIBUTES;if(_0x45fe65===_0x98d2('0x22')){if(_0x5efd3e==='inbound'){_0x1d25b5=_0x1d25b5['concat'](VOICE_QUEUE_ATTRIBUTES);}else if(_0x5efd3e==='outbound'){_0x1d25b5=_0x1d25b5['concat'](VOICE_QUEUE_ATTRIBUTES,OUTBOUND_QUEUE_ATTRIBUTES);}}return _0x1a41cb[_0x98d2('0x2d')](function(_0x527ce3){var _0x7bb0b1=_0x527ce3[_0x98d2('0x2e')]({'plain':!![]});_0x7bb0b1['paused']=0x0;_0x7bb0b1[_0x98d2('0x8')]=0x0;_0x7bb0b1[_0x98d2('0x4')]=0x0;_0x7bb0b1[_0x98d2('0x3')]=0x0;_0x7bb0b1['waiting']=0x0;if(_0x45fe65===_0x98d2('0x22')){_0x7bb0b1[_0x98d2('0xc')]=0x0;_0x7bb0b1[_0x98d2('0x7')]=0x0;if(_0x5efd3e===_0x98d2('0x2f')){_0x7bb0b1[_0x98d2('0xf')]=0x0;_0x7bb0b1['originated']=0x0;}}var _0x225886=_[_0x98d2('0x30')](_0x599705,['id',_0x7bb0b1['id']]);if(_0x225886){_[_0x98d2('0x31')](_0x7bb0b1,_[_0x98d2('0x32')](_0x225886,_0x1d25b5));}return _0x7bb0b1;});}exports[_0x98d2('0x33')]=initializeQueues; \ No newline at end of file diff --git a/server/config/express.js b/server/config/express.js index 9ac9fde..0e68fb9 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(_0x2cc89c,_0x4c12a7){var _0x6c677=function(_0x275200){while(--_0x275200){_0x2cc89c['push'](_0x2cc89c['shift']());}};_0x6c677(++_0x4c12a7);}(_0x9957,0x93));var _0x7995=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x9957[_0xbca1b1];return _0x4e1686;};'use strict';var express=require(_0x7995('0x0'));var methodOverride=require(_0x7995('0x1'));var cookieParser=require(_0x7995('0x2'));var errorHandler=require(_0x7995('0x3'));var path=require('path');var passport=require(_0x7995('0x4'));var cors=require(_0x7995('0x5'));var config=require(_0x7995('0x6'));exports[_0x7995('0x7')]=function(_0x576d89){var _0x744bea=_0x576d89[_0x7995('0x8')](_0x7995('0x9'));if(_0x744bea===_0x7995('0xa')){_0x576d89[_0x7995('0xb')](_0x7995('0xc'),path['join'](config[_0x7995('0xd')],_0x7995('0xe')));}if(_0x744bea==='development'||_0x744bea===_0x7995('0xf')){_0x576d89[_0x7995('0xb')](_0x7995('0xc'),path[_0x7995('0x10')](config[_0x7995('0xd')],_0x7995('0x11')));_0x576d89[_0x7995('0x12')](errorHandler());}_0x576d89['set'](_0x7995('0x13'),function(_0x41c652,_0x581f22){if(this[_0x41c652]instanceof Date){_0x581f22=this[_0x41c652][_0x7995('0x14')]()[_0x7995('0x15')]('.')[0x0]+'Z';}return _0x581f22;});_0x576d89[_0x7995('0x12')](express[_0x7995('0x16')](_0x576d89[_0x7995('0x8')](_0x7995('0xc'))));_0x576d89[_0x7995('0xb')]('views',config['root']+_0x7995('0x17'));_0x576d89[_0x7995('0x18')](_0x7995('0x19'),require(_0x7995('0x1a'))[_0x7995('0x1b')]);_0x576d89[_0x7995('0xb')](_0x7995('0x1c'),_0x7995('0x19'));_0x576d89['use'](express[_0x7995('0x1d')]({'limit':'50mb','extended':!![]}));_0x576d89[_0x7995('0x12')](express[_0x7995('0x1e')]({'limit':_0x7995('0x1f')}));_0x576d89[_0x7995('0x12')](cors());_0x576d89[_0x7995('0x12')](methodOverride());_0x576d89[_0x7995('0x12')](cookieParser());_0x576d89['use'](passport['initialize']());}; \ No newline at end of file +var _0xa9e0=['get','production','set','appPath','public','join','root','client','use','toISOString','split','static','views','/server/views','engine','html','ejs','urlencoded','50mb','json','initialize','express','method-override','cookie-parser','passport','./environment','default'];(function(_0x1cec84,_0x101ec2){var _0x12b7d3=function(_0x9679d8){while(--_0x9679d8){_0x1cec84['push'](_0x1cec84['shift']());}};_0x12b7d3(++_0x101ec2);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3ce3c,_0x319337){_0x3ce3c=_0x3ce3c-0x0;var _0x55a2c9=_0xa9e0[_0x3ce3c];return _0x55a2c9;};'use strict';var express=require(_0x0a9e('0x0'));var methodOverride=require(_0x0a9e('0x1'));var cookieParser=require(_0x0a9e('0x2'));var errorHandler=require('errorhandler');var path=require('path');var passport=require(_0x0a9e('0x3'));var cors=require('cors');var config=require(_0x0a9e('0x4'));exports[_0x0a9e('0x5')]=function(_0x2ab90b){var _0x991246=_0x2ab90b[_0x0a9e('0x6')]('env');if(_0x991246===_0x0a9e('0x7')){_0x2ab90b[_0x0a9e('0x8')](_0x0a9e('0x9'),path['join'](config['root'],_0x0a9e('0xa')));}if(_0x991246==='development'||_0x991246==='test'){_0x2ab90b[_0x0a9e('0x8')](_0x0a9e('0x9'),path[_0x0a9e('0xb')](config[_0x0a9e('0xc')],_0x0a9e('0xd')));_0x2ab90b[_0x0a9e('0xe')](errorHandler());}_0x2ab90b['set']('json\x20replacer',function(_0x527cdd,_0x4cfe67){if(this[_0x527cdd]instanceof Date){_0x4cfe67=this[_0x527cdd][_0x0a9e('0xf')]()[_0x0a9e('0x10')]('.')[0x0]+'Z';}return _0x4cfe67;});_0x2ab90b[_0x0a9e('0xe')](express[_0x0a9e('0x11')](_0x2ab90b[_0x0a9e('0x6')](_0x0a9e('0x9'))));_0x2ab90b['set'](_0x0a9e('0x12'),config[_0x0a9e('0xc')]+_0x0a9e('0x13'));_0x2ab90b[_0x0a9e('0x14')](_0x0a9e('0x15'),require(_0x0a9e('0x16'))['renderFile']);_0x2ab90b[_0x0a9e('0x8')]('view\x20engine',_0x0a9e('0x15'));_0x2ab90b['use'](express[_0x0a9e('0x17')]({'limit':_0x0a9e('0x18'),'extended':!![]}));_0x2ab90b['use'](express[_0x0a9e('0x19')]({'limit':'50mb'}));_0x2ab90b[_0x0a9e('0xe')](cors());_0x2ab90b[_0x0a9e('0xe')](methodOverride());_0x2ab90b[_0x0a9e('0xe')](cookieParser());_0x2ab90b[_0x0a9e('0xe')](passport[_0x0a9e('0x1a')]());}; \ No newline at end of file diff --git a/server/config/license/hardware.js b/server/config/license/hardware.js index cdd0af7..80d4a50 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 _0x0574=['bimedia-machine-uuid','child_process','execSync','../environment','networkInterfaces','orderBy','keys','length','filter','family','internal','concat','head','mac','00:00:00:00:00:00','address','127.0.0.1','getFirstInterface','cpus','map','model','createHash','md5','update','digest','hex','licenseToken','test','win32','dmidecode\x20--string\x20system-uuid','utf8','replace','ipAddress','substring','lodash','crypto'];(function(_0x1f64ce,_0x1c8ab0){var _0x297b13=function(_0x1e6cc6){while(--_0x1e6cc6){_0x1f64ce['push'](_0x1f64ce['shift']());}};_0x297b13(++_0x1c8ab0);}(_0x0574,0x1d2));var _0x4057=function(_0x280820,_0xce9bc7){_0x280820=_0x280820-0x0;var _0x474787=_0x0574[_0x280820];return _0x474787;};'use strict';var _=require(_0x4057('0x0'));var os=require('os');var crypto=require(_0x4057('0x1'));var machine=require(_0x4057('0x2'));var exec=require(_0x4057('0x3'))[_0x4057('0x4')];var config=require(_0x4057('0x5'));function getInterfaces(){var _0x245724=[];var _0x4da41a=os[_0x4057('0x6')]();var _0x40f4a3=_[_0x4057('0x7')](_[_0x4057('0x8')](_0x4da41a));for(var _0x5be6f8=0x0;_0x5be6f8<_0x40f4a3[_0x4057('0x9')];_0x5be6f8++){var _0x527098=_0x4da41a[_0x40f4a3[_0x5be6f8]][_0x4057('0xa')](function(_0x5a54e3){return _0x5a54e3[_0x4057('0xb')]==='IPv4'&&_0x5a54e3[_0x4057('0xc')]===![];});_0x245724=_0x245724[_0x4057('0xd')](_0x527098);}return _0x245724;}function getFirstInterface(){var _0x5c58a8=_[_0x4057('0xe')](getInterfaces());return{'macAddress':_0x5c58a8&&_0x5c58a8[_0x4057('0xf')]?_0x5c58a8[_0x4057('0xf')]:_0x4057('0x10'),'ipAddress':_0x5c58a8&&_0x5c58a8[_0x4057('0x11')]?_0x5c58a8[_0x4057('0x11')]:_0x4057('0x12')};}exports[_0x4057('0x13')]=getFirstInterface;function getCPUhash(){var _0x508db4=_[_0x4057('0x7')](os[_0x4057('0x14')]()[_0x4057('0x15')](function(_0xb0c7e1){return _0xb0c7e1[_0x4057('0x16')];}))['join'](':');return crypto[_0x4057('0x17')](_0x4057('0x18'))[_0x4057('0x19')](_0x508db4)[_0x4057('0x1a')](_0x4057('0x1b'));}exports['getUuid']=function(){var _0x30823e=os['platform']();var _0x3949db=/[0-9a-f-]{36}/;if(config[_0x4057('0x1c')]&&_0x3949db[_0x4057('0x1d')](config[_0x4057('0x1c')])){return config[_0x4057('0x1c')];}else if(_0x30823e===_0x4057('0x1e')){return exec(_0x4057('0x1f'),{'encoding':_0x4057('0x20')})[_0x4057('0x21')]('\x0d\x0a','');}else{var _0x3bac48=getFirstInterface();var _0xe5fd80=getCPUhash();var _0x5ec6e0=_0xe5fd80+'|'+os['hostname']()+'|'+_0x3bac48['macAddress']+'|'+_0x3bac48[_0x4057('0x22')];var _0x10fcba=crypto[_0x4057('0x17')](_0x4057('0x18'))[_0x4057('0x19')](_0x5ec6e0)[_0x4057('0x1a')](_0x4057('0x1b'));return _0x10fcba[_0x4057('0x23')](0x0,0x8)+'-'+_0x10fcba[_0x4057('0x23')](0x8,0xc)+'-'+_0x10fcba[_0x4057('0x23')](0xc,0x10)+'-'+_0x10fcba[_0x4057('0x23')](0x10,0x14)+'-'+_0x10fcba[_0x4057('0x23')](0x14);}}; \ No newline at end of file +var _0x87e6=['getFirstInterface','map','join','createHash','md5','update','digest','getUuid','platform','licenseToken','utf8','replace','macAddress','ipAddress','substring','lodash','crypto','bimedia-machine-uuid','child_process','execSync','../environment','orderBy','length','concat','head','mac','127.0.0.1'];(function(_0x11ba06,_0x41d28d){var _0x3053d8=function(_0x2362c9){while(--_0x2362c9){_0x11ba06['push'](_0x11ba06['shift']());}};_0x3053d8(++_0x41d28d);}(_0x87e6,0x189));var _0x687e=function(_0x1c134a,_0x1b867c){_0x1c134a=_0x1c134a-0x0;var _0x46de17=_0x87e6[_0x1c134a];return _0x46de17;};'use strict';var _=require(_0x687e('0x0'));var os=require('os');var crypto=require(_0x687e('0x1'));var machine=require(_0x687e('0x2'));var exec=require(_0x687e('0x3'))[_0x687e('0x4')];var config=require(_0x687e('0x5'));function getInterfaces(){var _0x590332=[];var _0x4ba368=os['networkInterfaces']();var _0x1f100a=_[_0x687e('0x6')](_['keys'](_0x4ba368));for(var _0x2e944d=0x0;_0x2e944d<_0x1f100a[_0x687e('0x7')];_0x2e944d++){var _0x20ae1d=_0x4ba368[_0x1f100a[_0x2e944d]]['filter'](function(_0x1828ad){return _0x1828ad['family']==='IPv4'&&_0x1828ad['internal']===![];});_0x590332=_0x590332[_0x687e('0x8')](_0x20ae1d);}return _0x590332;}function getFirstInterface(){var _0x1e20f5=_[_0x687e('0x9')](getInterfaces());return{'macAddress':_0x1e20f5&&_0x1e20f5[_0x687e('0xa')]?_0x1e20f5['mac']:'00:00:00:00:00:00','ipAddress':_0x1e20f5&&_0x1e20f5['address']?_0x1e20f5['address']:_0x687e('0xb')};}exports[_0x687e('0xc')]=getFirstInterface;function getCPUhash(){var _0x3c8dfe=_['orderBy'](os['cpus']()[_0x687e('0xd')](function(_0x2a7d84){return _0x2a7d84['model'];}))[_0x687e('0xe')](':');return crypto[_0x687e('0xf')](_0x687e('0x10'))[_0x687e('0x11')](_0x3c8dfe)[_0x687e('0x12')]('hex');}exports[_0x687e('0x13')]=function(){var _0x1b2dec=os[_0x687e('0x14')]();var _0x27b7f0=/[0-9a-f-]{36}/;if(config['licenseToken']&&_0x27b7f0['test'](config[_0x687e('0x15')])){return config[_0x687e('0x15')];}else if(_0x1b2dec==='win32'){return exec('dmidecode\x20--string\x20system-uuid',{'encoding':_0x687e('0x16')})[_0x687e('0x17')]('\x0d\x0a','');}else{var _0x1fc26d=getFirstInterface();var _0xe8ba4f=getCPUhash();var _0x844b6b=_0xe8ba4f+'|'+os['hostname']()+'|'+_0x1fc26d[_0x687e('0x18')]+'|'+_0x1fc26d[_0x687e('0x19')];var _0xb4c64f=crypto[_0x687e('0xf')](_0x687e('0x10'))[_0x687e('0x11')](_0x844b6b)[_0x687e('0x12')]('hex');return _0xb4c64f[_0x687e('0x1a')](0x0,0x8)+'-'+_0xb4c64f[_0x687e('0x1a')](0x8,0xc)+'-'+_0xb4c64f[_0x687e('0x1a')](0xc,0x10)+'-'+_0xb4c64f['substring'](0x10,0x14)+'-'+_0xb4c64f['substring'](0x14);}}; \ No newline at end of file diff --git a/server/config/license/index.js b/server/config/license/index.js index 0b7bea9..6135943 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 _0x078a=['license','https://www.xcallymotion.com','format','%s/api/servers/%s/check?version=%s','%s/api/servers/%s/check?version=%s&oldtoken=%s','GET','then','catch','get','data1','data2','active','info','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','Disabled','Changed','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','toUpperCase','YYYY-MM-DD\x20HH:mm','update','encryptString','diff','days','DEMO\x20START\x20AT\x20%s','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','error','message','finally','getUuid','License','spread','util','moment','bluebird','pkginfo','version','../../mysqldb','../logger'];(function(_0x420f2a,_0x2cc58d){var _0x28f802=function(_0x3329cc){while(--_0x3329cc){_0x420f2a['push'](_0x420f2a['shift']());}};_0x28f802(++_0x2cc58d);}(_0x078a,0x10a));var _0xa078=function(_0xa95842,_0x3eae74){_0xa95842=_0xa95842-0x0;var _0x5a3db7=_0x078a[_0xa95842];return _0x5a3db7;};'use strict';var util=require(_0xa078('0x0'));var moment=require(_0xa078('0x1'));var rp=require('request-promise');var BPromise=require(_0xa078('0x2'));var pkginfo=require(_0xa078('0x3'))(module,_0xa078('0x4'));var db=require(_0xa078('0x5'))['db'];var encryptor=require('../../components/encryptor');var hardware=require('./hardware');var logger=require(_0xa078('0x6'))(_0xa078('0x7'));var HOST=_0xa078('0x8');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x5e0023){return new BPromise(function(_0xce2b8c,_0x388648){var _0x2d7a02=util[_0xa078('0x9')](_0xa078('0xa'),HOST,_0x5e0023,module['exports'][_0xa078('0x4')]);if(oldToken){_0x2d7a02=util[_0xa078('0x9')](_0xa078('0xb'),HOST,_0x5e0023,module['exports'][_0xa078('0x4')],oldToken);}var _0x234122={'uri':_0x2d7a02,'method':_0xa078('0xc'),'timeout':0xea60,'json':!![]};return rp(_0x234122)[_0xa078('0xd')](function(_0x1da3a2){_0xce2b8c(_0x1da3a2);})[_0xa078('0xe')](function(_0x40d7cb){_0x388648(_0x40d7cb);});});}function manageLicense(_0x54e490,_0x3e83c5){var _0x5e9b8e=_0x3e83c5[_0xa078('0xf')]({'plain':!![]});if(!isOldTokenSent&&_0x5e9b8e[_0xa078('0x10')]!==_0x54e490&&!_0x5e9b8e[_0xa078('0x11')]){oldToken=_0x5e9b8e[_0xa078('0x10')];}httpRequest(_0x54e490)['then'](function(_0x26c114){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x26c114[_0xa078('0x12')]){isOldTokenSent=![];if(!_0x5e9b8e[_0xa078('0x7')]&&_0x5e9b8e[_0xa078('0x7')]!=_0x26c114['license']||_0x5e9b8e[_0xa078('0x7')]&&_0x5e9b8e['data2']){logger[_0xa078('0x13')](_0xa078('0x14'));}if(_0x5e9b8e['license']&&!_0x5e9b8e[_0xa078('0x11')]&&_0x5e9b8e['license']!=_0x26c114[_0xa078('0x7')]){logger[_0xa078('0x13')](_0xa078('0x15'));}if(_0x5e9b8e[_0xa078('0x7')]&&!_0x5e9b8e[_0xa078('0x11')]&&_0x5e9b8e[_0xa078('0x7')]==_0x26c114['license']){return _0x3e83c5;}return _0x3e83c5['update']({'data1':_0x54e490,'data2':null,'license':_0x26c114[_0xa078('0x7')]});}else{if(_0x26c114['license']||_0x5e9b8e[_0xa078('0x7')]){if(!_0x5e9b8e[_0xa078('0x11')]){if(_0x5e9b8e['data1']==_0x54e490){GRAY_PERIOD_REASON=_0xa078('0x16');logger[_0xa078('0x13')]('THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED');}else{GRAY_PERIOD_REASON=_0xa078('0x17');logger['info']('NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s',_0x5e9b8e[_0xa078('0x10')],_0x54e490);}logger[_0xa078('0x13')](_0xa078('0x18'),GRAY_PERIOD_REASON[_0xa078('0x19')](),moment()[_0xa078('0x9')](_0xa078('0x1a')));return _0x3e83c5[_0xa078('0x1b')]({'data2':encryptor[_0xa078('0x1c')](moment()[_0xa078('0x9')](_0xa078('0x1a')))});}else{if(moment()[_0xa078('0x1d')](encryptor['decryptString'](_0x5e9b8e[_0xa078('0x11')]),_0xa078('0x1e'))>DAYS){logger['info'](_0xa078('0x1f'),moment()[_0xa078('0x9')]('YYYY-MM-DD\x20HH:mm'));isOldTokenSent=![];return _0x3e83c5[_0xa078('0x1b')]({'data1':_0x54e490,'data2':null,'license':null});}}}else{if(_0x5e9b8e[_0xa078('0x10')]!=_0x54e490){logger[_0xa078('0x13')](_0xa078('0x20'),_0x5e9b8e[_0xa078('0x10')],_0x54e490);return _0x3e83c5['update']({'data1':_0x54e490,'data2':null,'license':null});}}}return _0x3e83c5;})[_0xa078('0xd')](function(_0x484d99){_0x3e83c5=_0x484d99;})[_0xa078('0xe')](function(_0x1e6dc){logger[_0xa078('0x21')](_0x1e6dc[_0xa078('0x22')]);})[_0xa078('0x23')](function(){setTimeout(function(){manageLicense(hardware['getUuid'](),_0x3e83c5);},TIME);});}function defaultLicense(){var _0x1829ec=hardware[_0xa078('0x24')]();if(_0x1829ec){return db[_0xa078('0x25')]['findOrCreate']({'where':{'id':0x1},'defaults':{'data1':_0x1829ec}})[_0xa078('0x26')](function(_0x386888,_0x392072){logger[_0xa078('0x13')]('SERVICE\x20LICENSE\x20STARTED\x20%s',_0x1829ec);manageLicense(_0x1829ec,_0x386888);})[_0xa078('0xe')](function(_0x3cded4){logger[_0xa078('0x21')](_0x3cded4[_0xa078('0x22')]);});}}exports['default']=defaultLicense; \ No newline at end of file +var _0xb69b=['Disabled','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','info','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','toUpperCase','YYYY-MM-DD\x20HH:mm','update','decryptString','days','DEMO\x20START\x20AT\x20%s','error','message','finally','getUuid','License','SERVICE\x20LICENSE\x20STARTED\x20%s','default','util','request-promise','bluebird','pkginfo','../../mysqldb','../../components/encryptor','./hardware','../logger','license','https://www.xcallymotion.com','format','%s/api/servers/%s/check?version=%s','exports','version','%s/api/servers/%s/check?version=%s&oldtoken=%s','catch','get','data1','then','active','data2','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED'];(function(_0x177b61,_0x35559b){var _0x120177=function(_0x4f8351){while(--_0x4f8351){_0x177b61['push'](_0x177b61['shift']());}};_0x120177(++_0x35559b);}(_0xb69b,0x151));var _0xbb69=function(_0x6f32ac,_0x43364e){_0x6f32ac=_0x6f32ac-0x0;var _0x2ec67f=_0xb69b[_0x6f32ac];return _0x2ec67f;};'use strict';var util=require(_0xbb69('0x0'));var moment=require('moment');var rp=require(_0xbb69('0x1'));var BPromise=require(_0xbb69('0x2'));var pkginfo=require(_0xbb69('0x3'))(module,'version');var db=require(_0xbb69('0x4'))['db'];var encryptor=require(_0xbb69('0x5'));var hardware=require(_0xbb69('0x6'));var logger=require(_0xbb69('0x7'))(_0xbb69('0x8'));var HOST=_0xbb69('0x9');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x51b207){return new BPromise(function(_0x182e0b,_0x1d7776){var _0x455aa1=util[_0xbb69('0xa')](_0xbb69('0xb'),HOST,_0x51b207,module[_0xbb69('0xc')][_0xbb69('0xd')]);if(oldToken){_0x455aa1=util['format'](_0xbb69('0xe'),HOST,_0x51b207,module[_0xbb69('0xc')][_0xbb69('0xd')],oldToken);}var _0x412124={'uri':_0x455aa1,'method':'GET','timeout':0xea60,'json':!![]};return rp(_0x412124)['then'](function(_0x381bc4){_0x182e0b(_0x381bc4);})[_0xbb69('0xf')](function(_0x37b582){_0x1d7776(_0x37b582);});});}function manageLicense(_0x33e2c2,_0x3239cd){var _0xb89ada=_0x3239cd[_0xbb69('0x10')]({'plain':!![]});if(!isOldTokenSent&&_0xb89ada[_0xbb69('0x11')]!==_0x33e2c2&&!_0xb89ada['data2']){oldToken=_0xb89ada[_0xbb69('0x11')];}httpRequest(_0x33e2c2)[_0xbb69('0x12')](function(_0x3882b5){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x3882b5[_0xbb69('0x13')]){isOldTokenSent=![];if(!_0xb89ada[_0xbb69('0x8')]&&_0xb89ada[_0xbb69('0x8')]!=_0x3882b5[_0xbb69('0x8')]||_0xb89ada[_0xbb69('0x8')]&&_0xb89ada[_0xbb69('0x14')]){logger['info'](_0xbb69('0x15'));}if(_0xb89ada[_0xbb69('0x8')]&&!_0xb89ada[_0xbb69('0x14')]&&_0xb89ada[_0xbb69('0x8')]!=_0x3882b5[_0xbb69('0x8')]){logger['info'](_0xbb69('0x16'));}if(_0xb89ada[_0xbb69('0x8')]&&!_0xb89ada[_0xbb69('0x14')]&&_0xb89ada[_0xbb69('0x8')]==_0x3882b5[_0xbb69('0x8')]){return _0x3239cd;}return _0x3239cd['update']({'data1':_0x33e2c2,'data2':null,'license':_0x3882b5['license']});}else{if(_0x3882b5['license']||_0xb89ada[_0xbb69('0x8')]){if(!_0xb89ada['data2']){if(_0xb89ada[_0xbb69('0x11')]==_0x33e2c2){GRAY_PERIOD_REASON=_0xbb69('0x17');logger['info'](_0xbb69('0x18'));}else{GRAY_PERIOD_REASON='Changed';logger[_0xbb69('0x19')](_0xbb69('0x1a'),_0xb89ada['data1'],_0x33e2c2);}logger[_0xbb69('0x19')]('%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s',GRAY_PERIOD_REASON[_0xbb69('0x1b')](),moment()[_0xbb69('0xa')](_0xbb69('0x1c')));return _0x3239cd[_0xbb69('0x1d')]({'data2':encryptor['encryptString'](moment()[_0xbb69('0xa')](_0xbb69('0x1c')))});}else{if(moment()['diff'](encryptor[_0xbb69('0x1e')](_0xb89ada[_0xbb69('0x14')]),_0xbb69('0x1f'))>DAYS){logger[_0xbb69('0x19')](_0xbb69('0x20'),moment()[_0xbb69('0xa')]('YYYY-MM-DD\x20HH:mm'));isOldTokenSent=![];return _0x3239cd[_0xbb69('0x1d')]({'data1':_0x33e2c2,'data2':null,'license':null});}}}else{if(_0xb89ada['data1']!=_0x33e2c2){logger[_0xbb69('0x19')](_0xbb69('0x1a'),_0xb89ada[_0xbb69('0x11')],_0x33e2c2);return _0x3239cd[_0xbb69('0x1d')]({'data1':_0x33e2c2,'data2':null,'license':null});}}}return _0x3239cd;})[_0xbb69('0x12')](function(_0x446dce){_0x3239cd=_0x446dce;})['catch'](function(_0x3d1b){logger[_0xbb69('0x21')](_0x3d1b[_0xbb69('0x22')]);})[_0xbb69('0x23')](function(){setTimeout(function(){manageLicense(hardware[_0xbb69('0x24')](),_0x3239cd);},TIME);});}function defaultLicense(){var _0x15fb6f=hardware[_0xbb69('0x24')]();if(_0x15fb6f){return db[_0xbb69('0x25')]['findOrCreate']({'where':{'id':0x1},'defaults':{'data1':_0x15fb6f}})['spread'](function(_0x1c4597,_0x43020c){logger[_0xbb69('0x19')](_0xbb69('0x26'),_0x15fb6f);manageLicense(_0x15fb6f,_0x1c4597);})[_0xbb69('0xf')](function(_0x360791){logger['error'](_0x360791[_0xbb69('0x22')]);});}}exports[_0xbb69('0x27')]=defaultLicense; \ No newline at end of file diff --git a/server/config/license/util.js b/server/config/license/util.js index 25ae7a9..0bab2c4 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 _0xc625=['2027-01-01T00:00:00.000Z','Demo\x20license','getUuid','Breaking\x20license','License','defaults','then','catch','uuid','license','isEmpty','License\x20key\x20value\x20not\x20found','data1','data2','split','decryptString','%s:%s:%s','parse','machineUuid','deadline','add','changed','disabled','message','User','findAll','COUNT','sequelize','col','count','role','user','telephone','telephones','admin','pick','countBy','License\x20limit\x20reached\x20for\x20users','License\x20limit\x20reached\x20for\x20telephones','exports','util','lodash','moment','bluebird','./hardware','../../components/encryptor','../../mysqldb'];(function(_0x12b806,_0x217d5e){var _0x353f01=function(_0x1b94e2){while(--_0x1b94e2){_0x12b806['push'](_0x12b806['shift']());}};_0x353f01(++_0x217d5e);}(_0xc625,0x142));var _0x5c62=function(_0x44946b,_0xf874ec){_0x44946b=_0x44946b-0x0;var _0x249bc4=_0xc625[_0x44946b];return _0x249bc4;};'use strict';var util=require(_0x5c62('0x0'));var _=require(_0x5c62('0x1'));var moment=require(_0x5c62('0x2'));var BPromise=require(_0x5c62('0x3'));var hardware=require(_0x5c62('0x4'));var encryptor=require(_0x5c62('0x5'));var db=require(_0x5c62('0x6'))['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x5c62('0x7'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0x5c62('0x8'),'machineUuid':hardware[_0x5c62('0x9')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':'2027-01-01T00:00:00.000Z','chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0x5c62('0xa'),'machineUuid':hardware[_0x5c62('0x9')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x265942){return new BPromise(function(_0x2d643b,_0x3daf9e){return db[_0x5c62('0xb')]['find'](_[_0x5c62('0xc')](_0x265942,{'raw':!![],'where':{'id':0x1}}))['then'](function(_0x34cdf5){return checkLicense(_0x34cdf5,null);})[_0x5c62('0xd')](function(_0x6b62b0){_0x2d643b(_0x6b62b0);return;})[_0x5c62('0xe')](function(_0xd0332a){_0x3daf9e(_0xd0332a);});});}function checkLicense(_0x258b34,_0x5d2abc){if(!_0x258b34){demoLicense[_0x5c62('0xf')]=_0x258b34['data1'];return demoLicense;}try{var _0x1a79a0=_0x5d2abc||_0x258b34[_0x5c62('0x10')];if(_[_0x5c62('0x11')](_0x1a79a0)){throw new Error(_0x5c62('0x12'));}var _0x1f63d7=_0x258b34[_0x5c62('0x13')];var _0x4146af=_0x258b34[_0x5c62('0x14')];var _0x26a4c5=_0x1f63d7[_0x5c62('0x15')]('-')[0x4];var _0x15597b=_0x1f63d7['split']('-')[0x0];var _0x4cbb8d=encryptor[_0x5c62('0x16')](_0x1a79a0,util['format'](_0x5c62('0x17'),_0x26a4c5,_0x1f63d7,_0x15597b));var _0x3c73f0=JSON[_0x5c62('0x18')](_0x4cbb8d);_0x3c73f0['demo']=![];_0x3c73f0[_0x5c62('0xf')]=_0x1f63d7;_0x3c73f0[_0x5c62('0x19')]=hardware[_0x5c62('0x9')]();if(_0x4146af){var _0xbbf5c=encryptor[_0x5c62('0x16')](_0x4146af);_0x3c73f0['gray']=_0xbbf5c;_0x3c73f0[_0x5c62('0x1a')]=moment(_0xbbf5c)[_0x5c62('0x1b')](0x7,'days')['format']();_0x3c73f0['grayReason']=_0x3c73f0[_0x5c62('0xf')]!=_0x3c73f0[_0x5c62('0x19')]?_0x5c62('0x1c'):_0x5c62('0x1d');}return _0x3c73f0;}catch(_0x1970c2){breakingLicense['uuid']=_0x258b34['data1'];breakingLicense[_0x5c62('0x1e')]=_0x1970c2[_0x5c62('0x1e')];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x2e9df5,_0x23ddb9){getLicense()['then'](function(_0x4978e2){return db[_0x5c62('0x1f')][_0x5c62('0x20')]({'attributes':['role',[db['sequelize']['fn'](_0x5c62('0x21'),db[_0x5c62('0x22')][_0x5c62('0x23')]('role')),_0x5c62('0x24')]],'group':_0x5c62('0x25'),'where':{'role':{'$or':['admin',_0x5c62('0x26'),_0x5c62('0x27')]}},'raw':!![]})[_0x5c62('0xd')](function(_0x15f493){var _0x2518e0={'user':_0x4978e2['users']||0x0,'telephone':_0x4978e2[_0x5c62('0x28')]||0x0};_0x15f493['forEach'](function(_0x45eb04){var _0x340ae7=_0x45eb04[_0x5c62('0x25')]===_0x5c62('0x29')?_0x5c62('0x26'):_0x45eb04[_0x5c62('0x25')];_0x2518e0[_0x340ae7]-=_0x45eb04[_0x5c62('0x24')];if(_0x2518e0[_0x340ae7]<0x0)_0x2518e0[_0x340ae7]=0x0;});_0x2e9df5(_0x2518e0);return;});})[_0x5c62('0xe')](function(_0x3261c7){_0x23ddb9(_0x3261c7);});});}function checkUserLimits(_0x32ddda){return new BPromise(function(_0x4be5e4,_0x217c6c){getLimits()[_0x5c62('0xd')](function(_0x3a136f){var _0x3cf5c8=_[_0x5c62('0x2a')](_[_0x5c62('0x2b')](_0x32ddda,'role'),[_0x5c62('0x29'),'user','telephone']);var _0x96abb1=(_0x3cf5c8[_0x5c62('0x29')]||0x0)+(_0x3cf5c8['user']||0x0);var _0x2b65da=_0x3cf5c8[_0x5c62('0x27')]||0x0;if(_0x96abb1>_0x3a136f['user'])return _0x217c6c(_0x5c62('0x2c'));if(_0x2b65da>_0x3a136f[_0x5c62('0x27')])return _0x217c6c(_0x5c62('0x2d'));return _0x4be5e4();})['catch'](function(_0x1f3a38){_0x217c6c(_0x1f3a38);});});}module[_0x5c62('0x2e')]={'checkLicense':checkLicense,'checkUserLimits':checkUserLimits,'getLicense':getLicense}; \ No newline at end of file +var _0x18d6=['util','lodash','bluebird','./hardware','../../mysqldb','Demo\x20license','getUuid','2027-01-01T00:00:00.000Z','Breaking\x20license','License','find','defaults','then','catch','uuid','license','isEmpty','License\x20key\x20value\x20not\x20found','data1','data2','split','%s:%s:%s','parse','machineUuid','deadline','add','days','grayReason','changed','disabled','message','User','sequelize','COUNT','role','count','admin','user','telephone','users','telephones','forEach','countBy','License\x20limit\x20reached\x20for\x20users','License\x20limit\x20reached\x20for\x20telephones'];(function(_0x24f31b,_0x44b8f3){var _0x488401=function(_0x204caf){while(--_0x204caf){_0x24f31b['push'](_0x24f31b['shift']());}};_0x488401(++_0x44b8f3);}(_0x18d6,0x10e));var _0x618d=function(_0x314d1d,_0x1211b8){_0x314d1d=_0x314d1d-0x0;var _0x31e31d=_0x18d6[_0x314d1d];return _0x31e31d;};'use strict';var util=require(_0x618d('0x0'));var _=require(_0x618d('0x1'));var moment=require('moment');var BPromise=require(_0x618d('0x2'));var hardware=require(_0x618d('0x3'));var encryptor=require('../../components/encryptor');var db=require(_0x618d('0x4'))['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':'2027-01-01T00:00:00.000Z','chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0x618d('0x5'),'machineUuid':hardware[_0x618d('0x6')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x618d('0x7'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0x618d('0x8'),'machineUuid':hardware['getUuid'](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x21e044){return new BPromise(function(_0x5d181d,_0x4b1bcd){return db[_0x618d('0x9')][_0x618d('0xa')](_[_0x618d('0xb')](_0x21e044,{'raw':!![],'where':{'id':0x1}}))[_0x618d('0xc')](function(_0x4961f1){return checkLicense(_0x4961f1,null);})[_0x618d('0xc')](function(_0x383b6b){_0x5d181d(_0x383b6b);return;})[_0x618d('0xd')](function(_0x567efd){_0x4b1bcd(_0x567efd);});});}function checkLicense(_0x488b2a,_0x1c0e6a){if(!_0x488b2a){demoLicense[_0x618d('0xe')]=_0x488b2a['data1'];return demoLicense;}try{var _0x3b364c=_0x1c0e6a||_0x488b2a[_0x618d('0xf')];if(_[_0x618d('0x10')](_0x3b364c)){throw new Error(_0x618d('0x11'));}var _0x1f69f6=_0x488b2a[_0x618d('0x12')];var _0x1b1ee1=_0x488b2a[_0x618d('0x13')];var _0xfa7ee2=_0x1f69f6['split']('-')[0x4];var _0x110737=_0x1f69f6[_0x618d('0x14')]('-')[0x0];var _0x33d324=encryptor['decryptString'](_0x3b364c,util['format'](_0x618d('0x15'),_0xfa7ee2,_0x1f69f6,_0x110737));var _0x274e2f=JSON[_0x618d('0x16')](_0x33d324);_0x274e2f['demo']=![];_0x274e2f['uuid']=_0x1f69f6;_0x274e2f[_0x618d('0x17')]=hardware[_0x618d('0x6')]();if(_0x1b1ee1){var _0x2b1cfe=encryptor['decryptString'](_0x1b1ee1);_0x274e2f['gray']=_0x2b1cfe;_0x274e2f[_0x618d('0x18')]=moment(_0x2b1cfe)[_0x618d('0x19')](0x7,_0x618d('0x1a'))['format']();_0x274e2f[_0x618d('0x1b')]=_0x274e2f[_0x618d('0xe')]!=_0x274e2f[_0x618d('0x17')]?_0x618d('0x1c'):_0x618d('0x1d');}return _0x274e2f;}catch(_0x4a9afe){breakingLicense[_0x618d('0xe')]=_0x488b2a[_0x618d('0x12')];breakingLicense[_0x618d('0x1e')]=_0x4a9afe[_0x618d('0x1e')];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x248b81,_0x11b75d){getLicense()[_0x618d('0xc')](function(_0xdc4495){return db[_0x618d('0x1f')]['findAll']({'attributes':['role',[db[_0x618d('0x20')]['fn'](_0x618d('0x21'),db[_0x618d('0x20')]['col'](_0x618d('0x22'))),_0x618d('0x23')]],'group':_0x618d('0x22'),'where':{'role':{'$or':[_0x618d('0x24'),_0x618d('0x25'),_0x618d('0x26')]}},'raw':!![]})[_0x618d('0xc')](function(_0x453c8b){var _0x1263d5={'user':_0xdc4495[_0x618d('0x27')]||0x0,'telephone':_0xdc4495[_0x618d('0x28')]||0x0};_0x453c8b[_0x618d('0x29')](function(_0x33d9ff){var _0x592373=_0x33d9ff[_0x618d('0x22')]===_0x618d('0x24')?'user':_0x33d9ff['role'];_0x1263d5[_0x592373]-=_0x33d9ff['count'];if(_0x1263d5[_0x592373]<0x0)_0x1263d5[_0x592373]=0x0;});_0x248b81(_0x1263d5);return;});})[_0x618d('0xd')](function(_0x4b762b){_0x11b75d(_0x4b762b);});});}function checkUserLimits(_0x3f4c20){return new BPromise(function(_0x4a2f07,_0x517d29){getLimits()[_0x618d('0xc')](function(_0x8c6e28){var _0x4f6824=_['pick'](_[_0x618d('0x2a')](_0x3f4c20,_0x618d('0x22')),[_0x618d('0x24'),_0x618d('0x25'),'telephone']);var _0x408259=(_0x4f6824['admin']||0x0)+(_0x4f6824[_0x618d('0x25')]||0x0);var _0x1f86a3=_0x4f6824[_0x618d('0x26')]||0x0;if(_0x408259>_0x8c6e28[_0x618d('0x25')])return _0x517d29(_0x618d('0x2b'));if(_0x1f86a3>_0x8c6e28[_0x618d('0x26')])return _0x517d29(_0x618d('0x2c'));return _0x4a2f07();})['catch'](function(_0x227102){_0x517d29(_0x227102);});});}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 0ad3174..c61a81a 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 _0x7d25=['app-id','secret','http://localhost:9000','myappanuglar-secret'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x7d25,0x8a));var _0x57d2=function(_0x2e4e19,_0x493b50){_0x2e4e19=_0x2e4e19-0x0;var _0x9ba20b=_0x7d25[_0x2e4e19];return _0x9ba20b;};'use strict';module['exports']={'DOMAIN':_0x57d2('0x0'),'SESSION_SECRET':_0x57d2('0x1'),'GOOGLE_ID':_0x57d2('0x2'),'GOOGLE_SECRET':_0x57d2('0x3'),'DEBUG':''}; \ No newline at end of file +var _0x7708=['http://localhost:9000','app-id','exports'];(function(_0xe5cc0f,_0x9ed058){var _0x3956c5=function(_0x49e0f6){while(--_0x49e0f6){_0xe5cc0f['push'](_0xe5cc0f['shift']());}};_0x3956c5(++_0x9ed058);}(_0x7708,0x188));var _0x8770=function(_0x35bd6c,_0x585087){_0x35bd6c=_0x35bd6c-0x0;var _0x2f421d=_0x7708[_0x35bd6c];return _0x2f421d;};'use strict';module[_0x8770('0x0')]={'DOMAIN':_0x8770('0x1'),'SESSION_SECRET':'myappanuglar-secret','GOOGLE_ID':_0x8770('0x2'),'GOOGLE_SECRET':'secret','DEBUG':''}; \ No newline at end of file diff --git a/server/config/logger.js b/server/config/logger.js index cdd50e5..c544b3a 100644 --- a/server/config/logger.js +++ b/server/config/logger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbe3b=['fileLogger','../utils/loggers'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xbe3b,0x79));var _0xbbe3=function(_0x44d809,_0x1f76fb){_0x44d809=_0x44d809-0x0;var _0x5361b9=_0xbe3b[_0x44d809];return _0x5361b9;};'use strict';var fileLogger=require(_0xbbe3('0x0'))[_0xbbe3('0x1')];module['exports']=fileLogger; \ No newline at end of file +var _0xd1a7=['fileLogger','exports','../utils/loggers'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xd1a7,0x128));var _0x7d1a=function(_0x12cae9,_0x545906){_0x12cae9=_0x12cae9-0x0;var _0x5d272e=_0xd1a7[_0x12cae9];return _0x5d272e;};'use strict';var fileLogger=require(_0x7d1a('0x0'))[_0x7d1a('0x1')];module[_0x7d1a('0x2')]=fileLogger; \ No newline at end of file diff --git a/server/config/pm2/config.js b/server/config/pm2/config.js index 2659614..4c03e29 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 _0x6744=['../../services/routing/index.js','../../services/xdr/index.js','path','../../config/environment','resolve','join','root','legacy-libs','express','../../services/ami/index.js','agi','../../services/agi/index.js','email','../../services/email/index.js'];(function(_0x19a0f9,_0x5ea292){var _0x3efa87=function(_0x3c83e4){while(--_0x3c83e4){_0x19a0f9['push'](_0x19a0f9['shift']());}};_0x3efa87(++_0x5ea292);}(_0x6744,0xfe));var _0x4674=function(_0x2df26a,_0x1c4616){_0x2df26a=_0x2df26a-0x0;var _0xa88755=_0x6744[_0x2df26a];return _0xa88755;};'use strict';var path=require(_0x4674('0x0'));var cfg=require(_0x4674('0x1'));var env={'NODE_PATH':path[_0x4674('0x2')](path[_0x4674('0x3')](cfg[_0x4674('0x4')],_0x4674('0x5')))};var pm2config={'apps':[{'name':_0x4674('0x6'),'script':path[_0x4674('0x3')](__dirname,'../../services/express/index.js'),'env':env},{'name':'ami','script':path['join'](__dirname,_0x4674('0x7')),'env':env},{'name':_0x4674('0x8'),'script':path[_0x4674('0x3')](__dirname,_0x4674('0x9')),'env':env},{'name':_0x4674('0xa'),'script':path[_0x4674('0x3')](__dirname,_0x4674('0xb')),'env':env},{'name':'routing','script':path[_0x4674('0x3')](__dirname,_0x4674('0xc')),'env':env},{'name':'xdr','script':path[_0x4674('0x3')](__dirname,_0x4674('0xd')),'env':env}]};module['exports']=pm2config; \ No newline at end of file +var _0xf09c=['../../services/agi/index.js','../../services/email/index.js','routing','../../services/routing/index.js','xdr','../../services/xdr/index.js','exports','path','../../config/environment','resolve','join','root','legacy-libs','express','ami','../../services/ami/index.js'];(function(_0xed9dd,_0x184eb5){var _0x2b0faf=function(_0x437e21){while(--_0x437e21){_0xed9dd['push'](_0xed9dd['shift']());}};_0x2b0faf(++_0x184eb5);}(_0xf09c,0x177));var _0xcf09=function(_0x107f30,_0x17f8a5){_0x107f30=_0x107f30-0x0;var _0x5b104c=_0xf09c[_0x107f30];return _0x5b104c;};'use strict';var path=require(_0xcf09('0x0'));var cfg=require(_0xcf09('0x1'));var env={'NODE_PATH':path[_0xcf09('0x2')](path[_0xcf09('0x3')](cfg[_0xcf09('0x4')],_0xcf09('0x5')))};var pm2config={'apps':[{'name':_0xcf09('0x6'),'script':path['join'](__dirname,'../../services/express/index.js'),'env':env},{'name':_0xcf09('0x7'),'script':path['join'](__dirname,_0xcf09('0x8')),'env':env},{'name':'agi','script':path[_0xcf09('0x3')](__dirname,_0xcf09('0x9')),'env':env},{'name':'email','script':path[_0xcf09('0x3')](__dirname,_0xcf09('0xa')),'env':env},{'name':_0xcf09('0xb'),'script':path[_0xcf09('0x3')](__dirname,_0xcf09('0xc')),'env':env},{'name':_0xcf09('0xd'),'script':path[_0xcf09('0x3')](__dirname,_0xcf09('0xe')),'env':env}]};module[_0xcf09('0xf')]=pm2config; \ No newline at end of file diff --git a/server/config/pm2/index.js b/server/config/pm2/index.js index 8ae449c..435e75e 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 _0x18ca=['restart','list','describe','delete','dump','saved','pm2','bluebird','connect','connected','then','start','stop','disconnect'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x18ca,0x76));var _0xa18c=function(_0x49d269,_0x37c7a4){_0x49d269=_0x49d269-0x0;var _0x5d6f32=_0x18ca[_0x49d269];return _0x5d6f32;};'use strict';var pm2=require(_0xa18c('0x0'));var BPromise=require(_0xa18c('0x1'));var config=require('./config');function connect(){return new BPromise(function(_0x5dc968,_0x313f19){return pm2[_0xa18c('0x2')](function(_0x5ada26){if(_0x5ada26){return _0x313f19(_0x5ada26);}return _0x5dc968(_0xa18c('0x3'));});});};exports['start']=function(_0x4752b4){return connect()[_0xa18c('0x4')](function(){return new BPromise(function(_0x49b107,_0x459720){return pm2[_0xa18c('0x5')](_0x4752b4,function(_0x2c06df,_0x185a7f){if(_0x2c06df){return _0x459720(_0x2c06df);}pm2['disconnect']();return _0x49b107(_0x185a7f);});});});};exports[_0xa18c('0x6')]=function(_0x66bd70){return connect()['then'](function(){return new BPromise(function(_0x794f42,_0xfc2bf8){return pm2[_0xa18c('0x6')](_0x66bd70,function(_0x4ebb12,_0x17b62c){if(_0x4ebb12){return _0xfc2bf8(_0x4ebb12);}pm2[_0xa18c('0x7')]();return _0x794f42(_0x17b62c);});});});};exports[_0xa18c('0x8')]=function(_0x181a41){return connect()[_0xa18c('0x4')](function(){return new BPromise(function(_0x36680a,_0x4bfb23){return pm2[_0xa18c('0x8')](_0x181a41,function(_0x3c42b0,_0x17b0e6){if(_0x3c42b0){return _0x4bfb23(_0x3c42b0);}pm2['disconnect']();return _0x36680a(_0x17b0e6);});});});};exports[_0xa18c('0x9')]=function(){return connect()[_0xa18c('0x4')](function(){return new BPromise(function(_0x89bf95,_0x2703bf){return pm2['list'](function(_0x1f3a29,_0x4e76ea){if(_0x1f3a29){return _0x2703bf(_0x1f3a29);}pm2['disconnect']();return _0x89bf95(_0x4e76ea);});});});};exports[_0xa18c('0xa')]=function(_0x3e8a9e){return connect()[_0xa18c('0x4')](function(){return new BPromise(function(_0xbf1625,_0x11a257){return pm2['describe'](_0x3e8a9e,function(_0x2442ee,_0x4d19d5){if(_0x2442ee){return _0x11a257(_0x2442ee);}pm2[_0xa18c('0x7')]();return _0xbf1625(_0x4d19d5);});});});};exports[_0xa18c('0xb')]=function(_0x55883e){return connect()['then'](function(){return new BPromise(function(_0x422555,_0xe8065){return pm2['delete'](_0x55883e,function(_0x8e3897,_0x52d435){if(_0x8e3897){return _0xe8065(_0x8e3897);}pm2['disconnect']();return _0x422555(_0x52d435);});});});};exports[_0xa18c('0xc')]=function(){return connect()[_0xa18c('0x4')](function(){return new BPromise(function(_0x5bb3d8,_0x148c13){return pm2[_0xa18c('0xc')](function(_0x1f05eb){if(_0x1f05eb){return _0x148c13(_0x1f05eb);}return _0x5bb3d8(_0xa18c('0xd'));});});});}; \ No newline at end of file +var _0xfef0=['saved','pm2','bluebird','./config','start','then','disconnect','stop','restart','list','describe','delete','dump'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xfef0,0xb7));var _0x0fef=function(_0x4297bb,_0x4ac537){_0x4297bb=_0x4297bb-0x0;var _0x1806c7=_0xfef0[_0x4297bb];return _0x1806c7;};'use strict';var pm2=require(_0x0fef('0x0'));var BPromise=require(_0x0fef('0x1'));var config=require(_0x0fef('0x2'));function connect(){return new BPromise(function(_0x286fe6,_0x37e064){return pm2['connect'](function(_0x5839b8){if(_0x5839b8){return _0x37e064(_0x5839b8);}return _0x286fe6('connected');});});};exports[_0x0fef('0x3')]=function(_0x1e8b3c){return connect()[_0x0fef('0x4')](function(){return new BPromise(function(_0x46f2fe,_0xd83aed){return pm2['start'](_0x1e8b3c,function(_0x5ba7b9,_0x2c22b1){if(_0x5ba7b9){return _0xd83aed(_0x5ba7b9);}pm2[_0x0fef('0x5')]();return _0x46f2fe(_0x2c22b1);});});});};exports['stop']=function(_0x356ecd){return connect()[_0x0fef('0x4')](function(){return new BPromise(function(_0x4b5456,_0x3731af){return pm2[_0x0fef('0x6')](_0x356ecd,function(_0x5991ac,_0x101c58){if(_0x5991ac){return _0x3731af(_0x5991ac);}pm2[_0x0fef('0x5')]();return _0x4b5456(_0x101c58);});});});};exports[_0x0fef('0x7')]=function(_0x319884){return connect()[_0x0fef('0x4')](function(){return new BPromise(function(_0x4997e1,_0x15a5a5){return pm2['restart'](_0x319884,function(_0x4d37cf,_0x4dc47d){if(_0x4d37cf){return _0x15a5a5(_0x4d37cf);}pm2[_0x0fef('0x5')]();return _0x4997e1(_0x4dc47d);});});});};exports[_0x0fef('0x8')]=function(){return connect()[_0x0fef('0x4')](function(){return new BPromise(function(_0x326afa,_0x42e211){return pm2[_0x0fef('0x8')](function(_0x382393,_0x297898){if(_0x382393){return _0x42e211(_0x382393);}pm2['disconnect']();return _0x326afa(_0x297898);});});});};exports[_0x0fef('0x9')]=function(_0x564d32){return connect()['then'](function(){return new BPromise(function(_0x484c51,_0x3cbc5d){return pm2[_0x0fef('0x9')](_0x564d32,function(_0x2fde56,_0x3fec99){if(_0x2fde56){return _0x3cbc5d(_0x2fde56);}pm2[_0x0fef('0x5')]();return _0x484c51(_0x3fec99);});});});};exports['delete']=function(_0x4d8f30){return connect()[_0x0fef('0x4')](function(){return new BPromise(function(_0x419fc3,_0x995641){return pm2[_0x0fef('0xa')](_0x4d8f30,function(_0x547123,_0x2c4e4f){if(_0x547123){return _0x995641(_0x547123);}pm2[_0x0fef('0x5')]();return _0x419fc3(_0x2c4e4f);});});});};exports[_0x0fef('0xb')]=function(){return connect()['then'](function(){return new BPromise(function(_0x1da286,_0x3713e8){return pm2[_0x0fef('0xb')](function(_0x118161){if(_0x118161){return _0x3713e8(_0x118161);}return _0x1da286(_0x0fef('0xc'));});});});}; \ No newline at end of file diff --git a/server/config/schedule/chat.js b/server/config/schedule/chat.js index 24a5f3b..995af38 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 _0xc992=['redis','localhost','socket.io-emitter','Setting','find','chatTimeout','then','ChatInteraction','findAll','lastMsgAt','subtract','length','info','join','update','format','YYYY-MM-DD\x20HH:mm:ss','[CHAT]\x20Sending\x20updates\x20for\x20interactions:','emit','chatInteraction:update','error','inspect','start','lodash','ioredis','../../mysqldb','../logger'];(function(_0x16ab64,_0x439f12){var _0x4efe89=function(_0xf6b303){while(--_0xf6b303){_0x16ab64['push'](_0x16ab64['shift']());}};_0x4efe89(++_0x439f12);}(_0xc992,0xb9));var _0x2c99=function(_0x40aed2,_0x2ee8d5){_0x40aed2=_0x40aed2-0x0;var _0x2ff5ba=_0xc992[_0x40aed2];return _0x2ff5ba;};'use strict';var _=require(_0x2c99('0x0'));var moment=require('moment');var Redis=require(_0x2c99('0x1'));var util=require('util');var config=require('../../config/environment');var db=require(_0x2c99('0x2'))['db'];var logger=require(_0x2c99('0x3'))('schedule');config['redis']=_['defaults'](config[_0x2c99('0x4')],{'host':_0x2c99('0x5'),'port':0x18eb});var io=require(_0x2c99('0x6'))(new Redis(config['redis']));function closeInteractions(){var _0xf46a0c=0x0;var _0x5e46c1=[];return db[_0x2c99('0x7')][_0x2c99('0x8')]({'raw':!![],'attributes':['id',_0x2c99('0x9')],'where':{'id':0x1}})[_0x2c99('0xa')](function(_0xb52845){_0xf46a0c=_0xb52845[_0x2c99('0x9')];if(_0xf46a0c){return db[_0x2c99('0xb')][_0x2c99('0xc')]({'raw':!![],'attributes':['id',_0x2c99('0xd')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0x2c99('0xe')](_0xb52845[_0x2c99('0x9')],'minutes')}}});}else{return[];}})[_0x2c99('0xa')](function(_0x1ea649){if(_0x1ea649&&_0x1ea649[_0x2c99('0xf')]){_0x5e46c1=_['map'](_0x1ea649||[],'id');logger[_0x2c99('0x10')]('[CHAT]\x20Interactions\x20to\x20close:',_0x5e46c1[_0x2c99('0x11')]());return db[_0x2c99('0xb')][_0x2c99('0x12')]({'closeReason':'system','disposition':'timeout','closed':!![],'closedAt':moment()[_0x2c99('0x13')](_0x2c99('0x14'))},{'where':{'id':_0x5e46c1}});}})[_0x2c99('0xa')](function(){if(_0x5e46c1&&_0x5e46c1[_0x2c99('0xf')]){logger[_0x2c99('0x10')](_0x2c99('0x15'),_0x5e46c1['join']());for(var _0x8a517f=0x0;_0x8a517f<_0x5e46c1[_0x2c99('0xf')];_0x8a517f++){io[_0x2c99('0x16')](_0x2c99('0x17'),{'id':_0x5e46c1[_0x8a517f],'closed':!![]});}}})['catch'](function(_0x36a0ea){logger[_0x2c99('0x18')]('[CHAT]\x20Error\x20closing\x20interactions',_0x36a0ea?util[_0x2c99('0x19')](_0x36a0ea,{'showHidden':![],'depth':null}):'');});}exports[_0x2c99('0x1a')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0xb849=['lastMsgAt','minutes','length','info','join','format','YYYY-MM-DD\x20HH:mm:ss','[CHAT]\x20Sending\x20updates\x20for\x20interactions:','emit','chatInteraction:update','error','[CHAT]\x20Error\x20closing\x20interactions','start','lodash','moment','util','../../config/environment','../logger','schedule','redis','defaults','localhost','socket.io-emitter','Setting','chatTimeout','then','ChatInteraction','findAll'];(function(_0x2bded4,_0x5aa045){var _0x302c84=function(_0xe33874){while(--_0xe33874){_0x2bded4['push'](_0x2bded4['shift']());}};_0x302c84(++_0x5aa045);}(_0xb849,0x7d));var _0x9b84=function(_0x25187b,_0x16d76d){_0x25187b=_0x25187b-0x0;var _0x23950e=_0xb849[_0x25187b];return _0x23950e;};'use strict';var _=require(_0x9b84('0x0'));var moment=require(_0x9b84('0x1'));var Redis=require('ioredis');var util=require(_0x9b84('0x2'));var config=require(_0x9b84('0x3'));var db=require('../../mysqldb')['db'];var logger=require(_0x9b84('0x4'))(_0x9b84('0x5'));config[_0x9b84('0x6')]=_[_0x9b84('0x7')](config[_0x9b84('0x6')],{'host':_0x9b84('0x8'),'port':0x18eb});var io=require(_0x9b84('0x9'))(new Redis(config['redis']));function closeInteractions(){var _0x4c4ba9=0x0;var _0x2869c3=[];return db[_0x9b84('0xa')]['find']({'raw':!![],'attributes':['id',_0x9b84('0xb')],'where':{'id':0x1}})[_0x9b84('0xc')](function(_0x39f826){_0x4c4ba9=_0x39f826[_0x9b84('0xb')];if(_0x4c4ba9){return db[_0x9b84('0xd')][_0x9b84('0xe')]({'raw':!![],'attributes':['id',_0x9b84('0xf')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()['subtract'](_0x39f826[_0x9b84('0xb')],_0x9b84('0x10'))}}});}else{return[];}})[_0x9b84('0xc')](function(_0x2b5009){if(_0x2b5009&&_0x2b5009[_0x9b84('0x11')]){_0x2869c3=_['map'](_0x2b5009||[],'id');logger[_0x9b84('0x12')]('[CHAT]\x20Interactions\x20to\x20close:',_0x2869c3[_0x9b84('0x13')]());return db[_0x9b84('0xd')]['update']({'closeReason':'system','disposition':'timeout','closed':!![],'closedAt':moment()[_0x9b84('0x14')](_0x9b84('0x15'))},{'where':{'id':_0x2869c3}});}})[_0x9b84('0xc')](function(){if(_0x2869c3&&_0x2869c3[_0x9b84('0x11')]){logger['info'](_0x9b84('0x16'),_0x2869c3[_0x9b84('0x13')]());for(var _0x151f1b=0x0;_0x151f1b<_0x2869c3['length'];_0x151f1b++){io[_0x9b84('0x17')](_0x9b84('0x18'),{'id':_0x2869c3[_0x151f1b],'closed':!![]});}}})['catch'](function(_0x54fc3f){logger[_0x9b84('0x19')](_0x9b84('0x1a'),_0x54fc3f?util['inspect'](_0x54fc3f,{'showHidden':![],'depth':null}):'');});}exports[_0x9b84('0x1b')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file diff --git a/server/config/schedule/cloud-provider.js b/server/config/schedule/cloud-provider.js index ced90ac..171f44b 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 _0xdb3d=['startAllRefreshIntervals','exports'];(function(_0x5d7227,_0x12aebe){var _0x15ac55=function(_0x58d13e){while(--_0x58d13e){_0x5d7227['push'](_0x5d7227['shift']());}};_0x15ac55(++_0x12aebe);}(_0xdb3d,0x1ae));var _0xddb3=function(_0xbcb4bf,_0x5296ed){_0xbcb4bf=_0xbcb4bf-0x0;var _0x3932b3=_0xdb3d[_0xbcb4bf];return _0x3932b3;};'use strict';function start(){var _0x872b5a=require('../../api/cloudProvider/cloudProvider.oauth.js');return _0x872b5a[_0xddb3('0x0')]();}module[_0xddb3('0x1')]={'intervals':{},'start':start}; \ No newline at end of file +var _0x5475=['exports','../../api/cloudProvider/cloudProvider.oauth.js'];(function(_0x1981fc,_0x258e73){var _0x1dbfdb=function(_0x5c8ca8){while(--_0x5c8ca8){_0x1981fc['push'](_0x1981fc['shift']());}};_0x1dbfdb(++_0x258e73);}(_0x5475,0x145));var _0x5547=function(_0x334841,_0x2bbc4c){_0x334841=_0x334841-0x0;var _0x5beb4b=_0x5475[_0x334841];return _0x5beb4b;};'use strict';function start(){var _0x1a6c4b=require(_0x5547('0x0'));return _0x1a6c4b['startAllRefreshIntervals']();}module[_0x5547('0x1')]={'intervals':{},'start':start}; \ No newline at end of file diff --git a/server/config/schedule/index.js b/server/config/schedule/index.js index 6ab2aa2..368ddd4 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 _0x866b=['text','Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','stringify','existsSync','sendIfEmpty','info','request','SendMail','then','error\x20mail','email\x20sent','catch','error','data','isNil','subtractNumber\x20null\x20or\x20undefined','subtractUnit\x20null\x20or\x20undefined','subtract','YYYY-MM-DD\x20HH:mm:ss','scheduled','output','DefaultReportId','exec\x20defaul\x20report\x20id:%s','runReport','CustomReportId','exec\x20custom\x20report\x20id:%s','no\x20report\x20id','Schedule','findAll','MailServerOut','CloudProvider','keys','jobs','keyBy','toString','intersection','length','exists','stop','delete\x20cron','index','my\x20id','resolve','run\x20job','cron','active','isBetween','startAt','add','add\x20cron','deleteJob','stop\x20cron','endAt','update','start','lodash','moment','cron-job-manager','jayson/promise','bluebird','../logger','../../mysqldb','../../api/analyticCustomReport/analyticCustomReport.controller','../../api/analyticDefaultReport/analyticDefaultReport.controller','client','Try\x20to\x20send\x20a\x20mail\x20to','email','MailAccount','format','\x22%s\x22\x20<%s>','name','Smtp','user','Report\x20%s\x20last\x20%s\x20%s','subtractNumber','subtractUnit','join','../../files/reports','savename','%s.%s','basename','extname','status','Sent','message','attachments'];(function(_0x5b360e,_0x494136){var _0x1bf752=function(_0x6df32e){while(--_0x6df32e){_0x5b360e['push'](_0x5b360e['shift']());}};_0x1bf752(++_0x494136);}(_0x866b,0x1e5));var _0xb866=function(_0x273dc5,_0x268a81){_0x273dc5=_0x273dc5-0x0;var _0x46dae7=_0x866b[_0x273dc5];return _0x46dae7;};'use strict';var fs=require('fs');var util=require('util');var path=require('path');var _=require(_0xb866('0x0'));var moment=require(_0xb866('0x1'));var CronJobManager=require(_0xb866('0x2'));var jayson=require(_0xb866('0x3'));var BPromise=require(_0xb866('0x4'));var logger=require(_0xb866('0x5'))('schedule');var db=require(_0xb866('0x6'))['db'];var analyticCustomReportController=require(_0xb866('0x7'));var analyticDefaultReportController=require(_0xb866('0x8'));var client=jayson[_0xb866('0x9')]['http']({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x5c0507,_0x792eb4){return function(){logger['info'](_0xb866('0xa'),_0x5c0507[_0xb866('0xb')]);var _0x443250=!![];var _0x3cfe33=_0x5c0507[_0xb866('0xc')]['getSmtpOptions']();var _0x28113a={'account':_0x3cfe33,'message':{'from':util[_0xb866('0xd')](_0xb866('0xe'),_0x5c0507[_0xb866('0xc')][_0xb866('0xf')],_0x5c0507[_0xb866('0xc')][_0xb866('0xb')]||_0x5c0507[_0xb866('0xc')][_0xb866('0x10')][_0xb866('0x11')]),'to':_0x5c0507[_0xb866('0xb')],'cc':_0x5c0507['cc'],'bcc':_0x5c0507['bcc'],'subject':util['format'](_0xb866('0x12'),_0x792eb4[_0xb866('0xf')],_0x5c0507[_0xb866('0x13')],_0x5c0507[_0xb866('0x14')])}};var _0x227038=path[_0xb866('0x15')](__dirname,_0xb866('0x16'));var _0x6c54e8=_0x792eb4[_0xb866('0x17')];var _0x10aa63=util[_0xb866('0xd')](_0xb866('0x18'),path[_0xb866('0x19')](_0x792eb4[_0xb866('0x17')],path[_0xb866('0x1a')](_0x792eb4[_0xb866('0x17')])),'zip');var _0x10945b=path['join'](_0x227038,_0x6c54e8);var _0xc42a8e=path[_0xb866('0x15')](_0x227038,_0x10aa63);if(fs['existsSync'](_0x10945b)){_0x792eb4[_0xb866('0x1b')]=_0xb866('0x1c');_0x28113a[_0xb866('0x1d')][_0xb866('0x1e')]=[{'filename':_0x6c54e8,'path':_0x10945b}];_0x28113a[_0xb866('0x1d')][_0xb866('0x1f')]=util[_0xb866('0xd')](_0xb866('0x20'),JSON[_0xb866('0x21')](_0x792eb4,null,0x2));}else if(fs[_0xb866('0x22')](_0xc42a8e)){_0x792eb4[_0xb866('0x1b')]=_0xb866('0x1c');_0x28113a['message'][_0xb866('0x1e')]=[{'filename':_0x10aa63,'path':_0xc42a8e}];}else{_0x28113a[_0xb866('0x1d')][_0xb866('0x1f')]='Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a';if(!_0x5c0507[_0xb866('0x23')]){_0x443250=![];logger[_0xb866('0x24')]('empty\x20file,\x20email\x20not\x20sent');}}if(_0x443250){return client[_0xb866('0x25')](_0xb866('0x26'),_0x28113a)[_0xb866('0x27')](function(_0x171d8d){if(_0x171d8d['error']){return logger['error'](_0xb866('0x28'),JSON[_0xb866('0x21')](_0x171d8d));}return logger[_0xb866('0x24')](_0xb866('0x29'));})[_0xb866('0x2a')](function(_0x139aeb){return logger[_0xb866('0x2b')](_0xb866('0x28'),JSON['stringify'](_0x139aeb));});}};}function handleError(){return function(_0x26abfa){return logger['error'](JSON['stringify'](_0x26abfa));};}function handleResult(_0x4c5918){return function(_0x5b0b91){logger[_0xb866('0x24')](_0xb866('0x2c'),JSON['stringify'](_0x5b0b91));if(_0x4c5918[_0xb866('0xc')]&&_0x4c5918[_0xb866('0xc')][_0xb866('0x10')]&&!_['isNil'](_0x4c5918[_0xb866('0xb')])){setTimeout(handleSendEmail(_0x4c5918,_0x5b0b91),0x3c*0x3e8);}};}function handleJob(_0x2d0773){return function(){try{if(_[_0xb866('0x2d')](_0x2d0773['subtractNumber'])){return logger[_0xb866('0x24')](_0xb866('0x2e'));}if(_[_0xb866('0x2d')](_0x2d0773['subtractUnit'])){return logger[_0xb866('0x24')](_0xb866('0x2f'));}var _0x4477aa={'startDate':moment()[_0xb866('0x30')](_0x2d0773['subtractNumber'],_0x2d0773[_0xb866('0x14')])[_0xb866('0xd')](_0xb866('0x31')),'endDate':moment()['format'](_0xb866('0x31')),'type':_0xb866('0x32'),'output':_0x2d0773[_0xb866('0x33')],'name':_0x2d0773[_0xb866('0xf')]};if(!_[_0xb866('0x2d')](_0x2d0773[_0xb866('0x34')])){logger['info'](_0xb866('0x35'),_0x2d0773[_0xb866('0x34')]);return analyticDefaultReportController[_0xb866('0x36')]({'id':_0x2d0773['DefaultReportId']},_0x4477aa)['then'](handleResult(_0x2d0773))[_0xb866('0x2a')](handleError());}if(!_[_0xb866('0x2d')](_0x2d0773[_0xb866('0x37')])){logger[_0xb866('0x24')](_0xb866('0x38'),_0x2d0773[_0xb866('0x37')]);return analyticCustomReportController[_0xb866('0x36')]({'id':_0x2d0773[_0xb866('0x37')]},_0x4477aa)[_0xb866('0x27')](handleResult(_0x2d0773))[_0xb866('0x2a')](handleError());}}catch(_0x1fd35e){logger['error'](JSON[_0xb866('0x21')](_0x1fd35e));}return logger[_0xb866('0x24')](_0xb866('0x39'));};}function getJobs(_0x16dc8f){var _0x55e6a3={};if(_0x16dc8f){_0x55e6a3['id']=_0x16dc8f;}return db[_0xb866('0x3a')][_0xb866('0x3b')]({'where':_0x55e6a3,'include':[{'model':db[_0xb866('0xc')],'attributes':['id',_0xb866('0xf'),_0xb866('0xb')],'include':[{'model':db[_0xb866('0x3c')],'as':_0xb866('0x10'),'include':[{'model':db[_0xb866('0x3d')],'as':_0xb866('0x3d')}]}]}]})['then'](function(_0x2237da){var _0x3d6f5a=_[_0xb866('0x3e')](manager[_0xb866('0x3f')]);var _0x3d4736=_['map'](_0x2237da,function(_0x376a8f){return _0x376a8f['id']['toString']();});var _0x2a9528=_[_0xb866('0x40')](_0x2237da,function(_0x1d3a27){return _0x1d3a27['id'][_0xb866('0x41')]();});var _0x2d616c=_0x16dc8f?_0x3d4736:_['difference'](_0x3d4736,_0x3d6f5a);var _0x53879f=_[_0xb866('0x42')](_0x3d4736,_0x3d6f5a);var _0x28ee72=_['difference'](_0x3d6f5a,_0x3d4736);var _0x3f0a53;var _0x386b43;for(_0x3f0a53=0x0;_0x3f0a53<_0x28ee72[_0xb866('0x43')]&&!_0x16dc8f;_0x3f0a53+=0x1){_0x386b43=_0x28ee72[_0x3f0a53][_0xb866('0x41')]();if(manager[_0xb866('0x44')](_0x386b43)){manager[_0xb866('0x45')](_0x386b43);manager['deleteJob'](_0x386b43);logger[_0xb866('0x24')](_0xb866('0x46'),_0x386b43);}}logger[_0xb866('0x24')]('toRun',JSON[_0xb866('0x21')](_0x2d616c));for(_0x3f0a53=0x0;_0x3f0a53<_0x2d616c[_0xb866('0x43')];_0x3f0a53+=0x1){_0x386b43=_0x2d616c[_0x3f0a53][_0xb866('0x41')]();logger[_0xb866('0x24')](_0xb866('0x47'),_0x386b43);if(_0x16dc8f){logger[_0xb866('0x24')](_0xb866('0x48'),_0x16dc8f);logger[_0xb866('0x24')](JSON['stringify'](_0x2a9528[_0x386b43]));BPromise[_0xb866('0x49')]()[_0xb866('0x27')](handleJob(_0x2a9528[_0x386b43]));logger[_0xb866('0x24')](_0xb866('0x4a'),_0x2a9528[_0x386b43][_0xb866('0xf')],_0x2a9528[_0x386b43][_0xb866('0x4b')]);}else if(_0x2a9528[_0x386b43][_0xb866('0x4b')]&&_0x2a9528[_0x386b43][_0xb866('0x4c')]&&moment()[_0xb866('0x4d')](_0x2a9528[_0x386b43][_0xb866('0x4e')],_0x2a9528[_0x386b43]['endAt'])){manager[_0xb866('0x4f')](_0x386b43,_0x2a9528[_0x386b43]['cron'],handleJob(_0x2a9528[_0x386b43]));manager['start'](_0x386b43);logger[_0xb866('0x24')](_0xb866('0x50'),_0x2a9528[_0x386b43][_0xb866('0xf')],_0x2a9528[_0x386b43][_0xb866('0x4b')]);}else if(manager[_0xb866('0x44')](_0x386b43)){manager[_0xb866('0x45')](_0x386b43);manager[_0xb866('0x51')](_0x386b43);logger[_0xb866('0x24')](_0xb866('0x52'),_0x2a9528[_0x386b43]['name'],_0x2a9528[_0x386b43][_0xb866('0x4b')]);}}for(_0x3f0a53=0x0,_0x386b43;_0x3f0a53<_0x53879f[_0xb866('0x43')]&&!_0x16dc8f;_0x3f0a53+=0x1){_0x386b43=_0x53879f[_0x3f0a53][_0xb866('0x41')]();if(manager['exists'](_0x386b43)){if(_0x2a9528[_0x386b43]['cron']&&_0x2a9528[_0x386b43]['active']&&moment()[_0xb866('0x4d')](_0x2a9528[_0x386b43][_0xb866('0x4e')],_0x2a9528[_0x386b43][_0xb866('0x53')])){manager[_0xb866('0x54')](_0x386b43,_0x2a9528[_0x386b43][_0xb866('0x4b')],handleJob(_0x2a9528[_0x386b43]));logger[_0xb866('0x24')]('update\x20cron',_0x2a9528[_0x386b43][_0xb866('0xf')],_0x2a9528[_0x386b43][_0xb866('0x4b')]);}else{manager[_0xb866('0x45')](_0x386b43);manager[_0xb866('0x51')](_0x386b43);logger[_0xb866('0x24')]('stop\x20cron',_0x2a9528[_0x386b43][_0xb866('0xf')],_0x2a9528[_0x386b43]['cron']);}}}})[_0xb866('0x2a')](function(_0x74079f){logger['error'](JSON[_0xb866('0x21')](_0x74079f));});}exports['run']=function(_0x478499){return getJobs(_0x478499);};exports[_0xb866('0x55')]=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();}; \ No newline at end of file +var _0xf1fc=['savename','basename','extname','zip','status','Sent','message','attachments','text','Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','stringify','existsSync','sendIfEmpty','empty\x20file,\x20email\x20not\x20sent','request','SendMail','then','error','email\x20sent','catch','error\x20mail','isNil','subtractUnit\x20null\x20or\x20undefined','scheduled','output','name','DefaultReportId','exec\x20defaul\x20report\x20id:%s','CustomReportId','exec\x20custom\x20report\x20id:%s','Schedule','MailServerOut','CloudProvider','keys','jobs','toString','difference','intersection','length','exists','stop','deleteJob','index','my\x20id','resolve','cron','active','isBetween','startAt','start','stop\x20cron','endAt','update','update\x20cron','util','lodash','moment','cron-job-manager','bluebird','../logger','schedule','../../mysqldb','../../api/analyticCustomReport/analyticCustomReport.controller','client','http','info','Try\x20to\x20send\x20a\x20mail\x20to','email','MailAccount','getSmtpOptions','\x22%s\x22\x20<%s>','Smtp','user','bcc','format','Report\x20%s\x20last\x20%s\x20%s','subtractNumber','subtractUnit','join','../../files/reports'];(function(_0x24c934,_0x4f3b87){var _0x4a2f3d=function(_0x3f42b3){while(--_0x3f42b3){_0x24c934['push'](_0x24c934['shift']());}};_0x4a2f3d(++_0x4f3b87);}(_0xf1fc,0x1c6));var _0xcf1f=function(_0x2a2b99,_0x9f497e){_0x2a2b99=_0x2a2b99-0x0;var _0x34d4bd=_0xf1fc[_0x2a2b99];return _0x34d4bd;};'use strict';var fs=require('fs');var util=require(_0xcf1f('0x0'));var path=require('path');var _=require(_0xcf1f('0x1'));var moment=require(_0xcf1f('0x2'));var CronJobManager=require(_0xcf1f('0x3'));var jayson=require('jayson/promise');var BPromise=require(_0xcf1f('0x4'));var logger=require(_0xcf1f('0x5'))(_0xcf1f('0x6'));var db=require(_0xcf1f('0x7'))['db'];var analyticCustomReportController=require(_0xcf1f('0x8'));var analyticDefaultReportController=require('../../api/analyticDefaultReport/analyticDefaultReport.controller');var client=jayson[_0xcf1f('0x9')][_0xcf1f('0xa')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x35c051,_0xcb5469){return function(){logger[_0xcf1f('0xb')](_0xcf1f('0xc'),_0x35c051[_0xcf1f('0xd')]);var _0x234676=!![];var _0x482ad=_0x35c051[_0xcf1f('0xe')][_0xcf1f('0xf')]();var _0x38f9df={'account':_0x482ad,'message':{'from':util['format'](_0xcf1f('0x10'),_0x35c051[_0xcf1f('0xe')]['name'],_0x35c051[_0xcf1f('0xe')]['email']||_0x35c051[_0xcf1f('0xe')][_0xcf1f('0x11')][_0xcf1f('0x12')]),'to':_0x35c051[_0xcf1f('0xd')],'cc':_0x35c051['cc'],'bcc':_0x35c051[_0xcf1f('0x13')],'subject':util[_0xcf1f('0x14')](_0xcf1f('0x15'),_0xcb5469['name'],_0x35c051[_0xcf1f('0x16')],_0x35c051[_0xcf1f('0x17')])}};var _0x1fcd0c=path[_0xcf1f('0x18')](__dirname,_0xcf1f('0x19'));var _0x266d00=_0xcb5469[_0xcf1f('0x1a')];var _0x40d865=util[_0xcf1f('0x14')]('%s.%s',path[_0xcf1f('0x1b')](_0xcb5469['savename'],path[_0xcf1f('0x1c')](_0xcb5469[_0xcf1f('0x1a')])),_0xcf1f('0x1d'));var _0xb11001=path[_0xcf1f('0x18')](_0x1fcd0c,_0x266d00);var _0x1187be=path[_0xcf1f('0x18')](_0x1fcd0c,_0x40d865);if(fs['existsSync'](_0xb11001)){_0xcb5469[_0xcf1f('0x1e')]=_0xcf1f('0x1f');_0x38f9df[_0xcf1f('0x20')][_0xcf1f('0x21')]=[{'filename':_0x266d00,'path':_0xb11001}];_0x38f9df[_0xcf1f('0x20')][_0xcf1f('0x22')]=util[_0xcf1f('0x14')](_0xcf1f('0x23'),JSON[_0xcf1f('0x24')](_0xcb5469,null,0x2));}else if(fs[_0xcf1f('0x25')](_0x1187be)){_0xcb5469[_0xcf1f('0x1e')]='Sent';_0x38f9df[_0xcf1f('0x20')][_0xcf1f('0x21')]=[{'filename':_0x40d865,'path':_0x1187be}];}else{_0x38f9df[_0xcf1f('0x20')][_0xcf1f('0x22')]='Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a';if(!_0x35c051[_0xcf1f('0x26')]){_0x234676=![];logger[_0xcf1f('0xb')](_0xcf1f('0x27'));}}if(_0x234676){return client[_0xcf1f('0x28')](_0xcf1f('0x29'),_0x38f9df)[_0xcf1f('0x2a')](function(_0x130072){if(_0x130072[_0xcf1f('0x2b')]){return logger['error']('error\x20mail',JSON[_0xcf1f('0x24')](_0x130072));}return logger['info'](_0xcf1f('0x2c'));})[_0xcf1f('0x2d')](function(_0x8c904e){return logger[_0xcf1f('0x2b')](_0xcf1f('0x2e'),JSON[_0xcf1f('0x24')](_0x8c904e));});}};}function handleError(){return function(_0x3b1666){return logger[_0xcf1f('0x2b')](JSON[_0xcf1f('0x24')](_0x3b1666));};}function handleResult(_0x528839){return function(_0x597c36){logger['info']('data',JSON['stringify'](_0x597c36));if(_0x528839['MailAccount']&&_0x528839['MailAccount'][_0xcf1f('0x11')]&&!_[_0xcf1f('0x2f')](_0x528839[_0xcf1f('0xd')])){setTimeout(handleSendEmail(_0x528839,_0x597c36),0x3c*0x3e8);}};}function handleJob(_0x4a9d39){return function(){try{if(_[_0xcf1f('0x2f')](_0x4a9d39['subtractNumber'])){return logger['info']('subtractNumber\x20null\x20or\x20undefined');}if(_[_0xcf1f('0x2f')](_0x4a9d39[_0xcf1f('0x17')])){return logger['info'](_0xcf1f('0x30'));}var _0x262ede={'startDate':moment()['subtract'](_0x4a9d39['subtractNumber'],_0x4a9d39['subtractUnit'])[_0xcf1f('0x14')]('YYYY-MM-DD\x20HH:mm:ss'),'endDate':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'type':_0xcf1f('0x31'),'output':_0x4a9d39[_0xcf1f('0x32')],'name':_0x4a9d39[_0xcf1f('0x33')]};if(!_['isNil'](_0x4a9d39[_0xcf1f('0x34')])){logger[_0xcf1f('0xb')](_0xcf1f('0x35'),_0x4a9d39[_0xcf1f('0x34')]);return analyticDefaultReportController['runReport']({'id':_0x4a9d39['DefaultReportId']},_0x262ede)['then'](handleResult(_0x4a9d39))['catch'](handleError());}if(!_[_0xcf1f('0x2f')](_0x4a9d39[_0xcf1f('0x36')])){logger[_0xcf1f('0xb')](_0xcf1f('0x37'),_0x4a9d39['CustomReportId']);return analyticCustomReportController['runReport']({'id':_0x4a9d39[_0xcf1f('0x36')]},_0x262ede)[_0xcf1f('0x2a')](handleResult(_0x4a9d39))['catch'](handleError());}}catch(_0x3b81eb){logger[_0xcf1f('0x2b')](JSON[_0xcf1f('0x24')](_0x3b81eb));}return logger[_0xcf1f('0xb')]('no\x20report\x20id');};}function getJobs(_0x16ef98){var _0x22fe7c={};if(_0x16ef98){_0x22fe7c['id']=_0x16ef98;}return db[_0xcf1f('0x38')]['findAll']({'where':_0x22fe7c,'include':[{'model':db[_0xcf1f('0xe')],'attributes':['id',_0xcf1f('0x33'),'email'],'include':[{'model':db[_0xcf1f('0x39')],'as':_0xcf1f('0x11'),'include':[{'model':db[_0xcf1f('0x3a')],'as':'CloudProvider'}]}]}]})[_0xcf1f('0x2a')](function(_0x3942bd){var _0x534c3b=_[_0xcf1f('0x3b')](manager[_0xcf1f('0x3c')]);var _0x41172a=_['map'](_0x3942bd,function(_0x3c4aa7){return _0x3c4aa7['id'][_0xcf1f('0x3d')]();});var _0x558ce1=_['keyBy'](_0x3942bd,function(_0x5242a2){return _0x5242a2['id'][_0xcf1f('0x3d')]();});var _0x2f0480=_0x16ef98?_0x41172a:_[_0xcf1f('0x3e')](_0x41172a,_0x534c3b);var _0x149647=_[_0xcf1f('0x3f')](_0x41172a,_0x534c3b);var _0x5c55d2=_[_0xcf1f('0x3e')](_0x534c3b,_0x41172a);var _0x49d249;var _0x28b8dc;for(_0x49d249=0x0;_0x49d249<_0x5c55d2[_0xcf1f('0x40')]&&!_0x16ef98;_0x49d249+=0x1){_0x28b8dc=_0x5c55d2[_0x49d249][_0xcf1f('0x3d')]();if(manager[_0xcf1f('0x41')](_0x28b8dc)){manager[_0xcf1f('0x42')](_0x28b8dc);manager[_0xcf1f('0x43')](_0x28b8dc);logger[_0xcf1f('0xb')]('delete\x20cron',_0x28b8dc);}}logger[_0xcf1f('0xb')]('toRun',JSON['stringify'](_0x2f0480));for(_0x49d249=0x0;_0x49d249<_0x2f0480[_0xcf1f('0x40')];_0x49d249+=0x1){_0x28b8dc=_0x2f0480[_0x49d249][_0xcf1f('0x3d')]();logger[_0xcf1f('0xb')](_0xcf1f('0x44'),_0x28b8dc);if(_0x16ef98){logger['info'](_0xcf1f('0x45'),_0x16ef98);logger[_0xcf1f('0xb')](JSON[_0xcf1f('0x24')](_0x558ce1[_0x28b8dc]));BPromise[_0xcf1f('0x46')]()['then'](handleJob(_0x558ce1[_0x28b8dc]));logger['info']('run\x20job',_0x558ce1[_0x28b8dc]['name'],_0x558ce1[_0x28b8dc][_0xcf1f('0x47')]);}else if(_0x558ce1[_0x28b8dc][_0xcf1f('0x47')]&&_0x558ce1[_0x28b8dc][_0xcf1f('0x48')]&&moment()[_0xcf1f('0x49')](_0x558ce1[_0x28b8dc][_0xcf1f('0x4a')],_0x558ce1[_0x28b8dc]['endAt'])){manager['add'](_0x28b8dc,_0x558ce1[_0x28b8dc][_0xcf1f('0x47')],handleJob(_0x558ce1[_0x28b8dc]));manager[_0xcf1f('0x4b')](_0x28b8dc);logger['info']('add\x20cron',_0x558ce1[_0x28b8dc][_0xcf1f('0x33')],_0x558ce1[_0x28b8dc]['cron']);}else if(manager[_0xcf1f('0x41')](_0x28b8dc)){manager['stop'](_0x28b8dc);manager[_0xcf1f('0x43')](_0x28b8dc);logger[_0xcf1f('0xb')](_0xcf1f('0x4c'),_0x558ce1[_0x28b8dc][_0xcf1f('0x33')],_0x558ce1[_0x28b8dc][_0xcf1f('0x47')]);}}for(_0x49d249=0x0,_0x28b8dc;_0x49d249<_0x149647['length']&&!_0x16ef98;_0x49d249+=0x1){_0x28b8dc=_0x149647[_0x49d249][_0xcf1f('0x3d')]();if(manager[_0xcf1f('0x41')](_0x28b8dc)){if(_0x558ce1[_0x28b8dc][_0xcf1f('0x47')]&&_0x558ce1[_0x28b8dc]['active']&&moment()['isBetween'](_0x558ce1[_0x28b8dc][_0xcf1f('0x4a')],_0x558ce1[_0x28b8dc][_0xcf1f('0x4d')])){manager[_0xcf1f('0x4e')](_0x28b8dc,_0x558ce1[_0x28b8dc][_0xcf1f('0x47')],handleJob(_0x558ce1[_0x28b8dc]));logger[_0xcf1f('0xb')](_0xcf1f('0x4f'),_0x558ce1[_0x28b8dc][_0xcf1f('0x33')],_0x558ce1[_0x28b8dc][_0xcf1f('0x47')]);}else{manager[_0xcf1f('0x42')](_0x28b8dc);manager[_0xcf1f('0x43')](_0x28b8dc);logger[_0xcf1f('0xb')](_0xcf1f('0x4c'),_0x558ce1[_0x28b8dc][_0xcf1f('0x33')],_0x558ce1[_0x28b8dc][_0xcf1f('0x47')]);}}}})['catch'](function(_0x1ba461){logger['error'](JSON[_0xcf1f('0x24')](_0x1ba461));});}exports['run']=function(_0x550f90){return getJobs(_0x550f90);};exports[_0xcf1f('0x4b')]=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 52b9301..22fa04a 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 _0x7033=['Neutral','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','FAILED','tempSentiment','SequelizeValidationError','error','inspect','VoiceRecording','IN_PROGRESS','Setting','Settings\x20not\x20available','transcribeAccountId','Transcribe\x20not\x20configured','forEach','all','catch','name','start','lodash','aws-sdk','request-promise','util','../../mysqldb','../../config/logger','transcribe','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','fileText','TranscriptionJobStatus','Transcript','TranscriptFileUri','transcripts','results','length','transcript','update','Sequelize','Sentiment\x20Analysis\x20not\x20requested','sentiment','language','bucket','ValidationError','Sentiment\x20Analysis\x20not\x20configured','Transcript\x20not\x20available','sentimentAccountId','CloudProvider','findOne','Cloud\x20Provider\x20not\x20available','Cloud\x20Provider\x20not\x20configured','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','sentimentRegion','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','Sentiment','Positive','Negative','SentimentScore','Mixed'];(function(_0x42dfeb,_0x3249d7){var _0x38ff1c=function(_0x22a06d){while(--_0x22a06d){_0x42dfeb['push'](_0x42dfeb['shift']());}};_0x38ff1c(++_0x3249d7);}(_0x7033,0x19e));var _0x3703=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x7033[_0x4b369d];return _0x571a98;};var _=require(_0x3703('0x0'));var AWS=require(_0x3703('0x1'));var rp=require(_0x3703('0x2'));var util=require(_0x3703('0x3'));var BPromise=require('bluebird');var db=require(_0x3703('0x4'))['db'];var logger=require(_0x3703('0x5'))(_0x3703('0x6'));function getTranscriptionJob(_0x2f080e,_0x4102da,_0xab35c3,_0x3fb885){return new Promise(function(_0x283af9,_0x1170b6){var _0xb3a377=new AWS['TranscribeService']({'accessKeyId':_0x4102da,'secretAccessKey':_0x2f080e,'region':_0xab35c3});_0xb3a377['getTranscriptionJob']({'TranscriptionJobName':_0x3fb885},function(_0x4ca371,_0x12c111){if(_0x4ca371){return _0x1170b6(_0x4ca371);}else{return _0x283af9(_0x12c111);}});});}function sentiment(_0x16d296,_0x481d8c,_0x41ba6e,_0x97fbf8,_0x5b252d){return new Promise(function(_0x6acdb7,_0x367148){var _0x28e18d=new AWS['Comprehend']({'accessKeyId':_0x481d8c,'secretAccessKey':_0x16d296,'region':_0x41ba6e});_0x28e18d['detectSentiment']({'Text':_0x97fbf8,'LanguageCode':_0x5b252d[_0x3703('0x7')](0x0,0x2)},function(_0x5b898d,_0x3074ab){if(_0x5b898d){return _0x367148(_0x5b898d);}else{return _0x6acdb7(_0x3074ab);}});});}function checkTranscribeJob(_0x21361e,_0x31c0df,_0x41af55){var _0x520ce3;return new BPromise(function(_0x5b13ee,_0x3fcc9b){logger[_0x3703('0x8')](util[_0x3703('0x9')](_0x3703('0xa'),_0x21361e['id'],_0x21361e[_0x3703('0xb')]));return getTranscriptionJob(_0x41af55[_0x3703('0xc')],_0x41af55[_0x3703('0xd')],_0x31c0df[_0x3703('0xe')],_0x21361e[_0x3703('0xb')])[_0x3703('0xf')](function(_0x3a8a89){logger[_0x3703('0x8')](util[_0x3703('0x9')](_0x3703('0x10'),_0x21361e['id'],_0x21361e['transcribeName'],_0x3a8a89[_0x3703('0x11')]['TranscriptionJobStatus']));if(!_0x21361e[_0x3703('0x12')]){switch(_0x3a8a89['TranscriptionJob'][_0x3703('0x13')]){case'COMPLETED':var _0x176ddc={'transcribeStatus':_0x3a8a89[_0x3703('0x11')]['TranscriptionJobStatus'],'fileUri':_0x3a8a89[_0x3703('0x11')][_0x3703('0x14')][_0x3703('0x15')]};logger[_0x3703('0x8')](util[_0x3703('0x9')]('[RECORDING:%d]\x20Get\x20transcript',_0x21361e['id']));return rp({'uri':_0x3a8a89[_0x3703('0x11')][_0x3703('0x14')][_0x3703('0x15')],'json':!![]})['then'](function(_0x386c4a){logger[_0x3703('0x8')](util[_0x3703('0x9')]('[RECORDING:%d]\x20Transcript\x20downloaded',_0x21361e['id']));if(_0x386c4a&&_0x386c4a['results']&&_0x386c4a['results'][_0x3703('0x16')]&&_0x386c4a[_0x3703('0x17')][_0x3703('0x16')][_0x3703('0x18')]){_0x176ddc['fileText']='';for(var _0x4fe6dd=0x0;_0x4fe6dd<_0x386c4a[_0x3703('0x17')]['transcripts']['length'];_0x4fe6dd++){_0x176ddc[_0x3703('0x12')]+=_0x386c4a[_0x3703('0x17')]['transcripts'][_0x4fe6dd][_0x3703('0x19')]+'';}}return _0x21361e[_0x3703('0x1a')](_0x176ddc);})[_0x3703('0xf')](function(){logger[_0x3703('0x8')](util[_0x3703('0x9')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x21361e['id']));if(!_0x21361e['tempSentiment']){throw new db[(_0x3703('0x1b'))]['ValidationError'](_0x3703('0x1c'));}if(!_0x31c0df[_0x3703('0x1d')]||!_0x31c0df['sentimentAccountId']||!_0x31c0df['sentimentRegion']||!_0x31c0df[_0x3703('0x1e')]||!_0x31c0df[_0x3703('0x1f')]){throw new db[(_0x3703('0x1b'))][(_0x3703('0x20'))](_0x3703('0x21'));}if(!_0x176ddc[_0x3703('0x12')]){throw new Error(_0x3703('0x22'));}if(_0x31c0df[_0x3703('0x23')]===_0x41af55['id']){return _0x41af55;}else{return db[_0x3703('0x24')][_0x3703('0x25')]({'where':{'id':_settings[_0x3703('0x23')]}});}})['then'](function(_0x244f74){if(!_0x244f74){throw new db[(_0x3703('0x1b'))][(_0x3703('0x20'))](_0x3703('0x26'));}if(!_0x244f74[_0x3703('0xc')]||!_0x244f74[_0x3703('0xd')]){throw new db[(_0x3703('0x1b'))][(_0x3703('0x20'))](_0x3703('0x27'));}_0x520ce3=_0x244f74;logger[_0x3703('0x8')](util[_0x3703('0x9')](_0x3703('0x28'),_0x21361e['id']));return sentiment(_0x520ce3[_0x3703('0xc')],_0x520ce3[_0x3703('0xd')],_0x31c0df[_0x3703('0x29')],_0x176ddc[_0x3703('0x12')],_0x31c0df[_0x3703('0x1e')]);})[_0x3703('0xf')](function(_0x33134a){logger[_0x3703('0x8')](util[_0x3703('0x9')](_0x3703('0x2a'),_0x21361e['id']));return _0x21361e['update']({'sentiment':_0x33134a[_0x3703('0x2b')],'sPositive':_0x33134a['SentimentScore'][_0x3703('0x2c')],'sNegative':_0x33134a['SentimentScore'][_0x3703('0x2d')],'sMixed':_0x33134a[_0x3703('0x2e')][_0x3703('0x2f')],'sNeutral':_0x33134a[_0x3703('0x2e')][_0x3703('0x30')]});})['then'](function(){logger[_0x3703('0x8')](util['format'](_0x3703('0x31'),_0x21361e['id']));_0x5b13ee();});case _0x3703('0x32'):return _0x21361e[_0x3703('0x1a')]({'transcribeStatus':'FAILED','failureReason':_0x3a8a89[_0x3703('0x11')]['FailureReason']})[_0x3703('0xf')](function(){logger[_0x3703('0x8')](util[_0x3703('0x9')](_0x3703('0x31'),_0x21361e['id']));_0x5b13ee();});default:logger[_0x3703('0x8')](util[_0x3703('0x9')]('[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed',_0x21361e['id']));break;}}else{return BPromise['resolve']()[_0x3703('0xf')](function(){if(!_0x21361e[_0x3703('0x33')]){throw new db['Sequelize'][(_0x3703('0x20'))](_0x3703('0x1c'));}if(!_0x31c0df[_0x3703('0x1d')]||!_0x31c0df[_0x3703('0x23')]||!_0x31c0df[_0x3703('0x29')]||!_0x31c0df[_0x3703('0x1e')]||!_0x31c0df[_0x3703('0x1f')]){throw new db[(_0x3703('0x1b'))][(_0x3703('0x20'))]('Sentiment\x20Analysis\x20not\x20configured');}if(!_0x21361e['fileText']){throw new Error(_0x3703('0x22'));}if(_0x31c0df[_0x3703('0x23')]===_0x41af55['id']){return _0x41af55;}else{return db['CloudProvider'][_0x3703('0x25')]({'where':{'id':_settings[_0x3703('0x23')]}});}})[_0x3703('0xf')](function(_0x333c51){if(!_0x333c51){throw new db[(_0x3703('0x1b'))][(_0x3703('0x20'))](_0x3703('0x26'));}if(!_0x333c51[_0x3703('0xc')]||!_0x333c51[_0x3703('0xd')]){throw new db['Sequelize']['ValidationError'](_0x3703('0x27'));}_0x520ce3=_0x333c51;logger['info'](util['format'](_0x3703('0x28'),_0x21361e['id']));return sentiment(_0x520ce3[_0x3703('0xc')],_0x520ce3[_0x3703('0xd')],_0x31c0df[_0x3703('0x29')],_0x21361e[_0x3703('0x12')],_0x31c0df[_0x3703('0x1e')]);})[_0x3703('0xf')](function(_0x47dcb1){logger[_0x3703('0x8')](util[_0x3703('0x9')](_0x3703('0x2a'),_0x21361e['id']));return _0x21361e[_0x3703('0x1a')]({'sentiment':_0x47dcb1['Sentiment'],'sPositive':_0x47dcb1['SentimentScore'][_0x3703('0x2c')],'sNegative':_0x47dcb1[_0x3703('0x2e')][_0x3703('0x2d')],'sMixed':_0x47dcb1[_0x3703('0x2e')][_0x3703('0x2f')],'sNeutral':_0x47dcb1[_0x3703('0x2e')][_0x3703('0x30')],'transcribeStatus':'COMPLETED'});})[_0x3703('0xf')](function(){logger[_0x3703('0x8')](util[_0x3703('0x9')](_0x3703('0x31'),_0x21361e['id']));_0x5b13ee();});}})['catch'](function(_0x59a06e){if(_0x59a06e){if(!_0x59a06e['name']||_0x59a06e['name']!==_0x3703('0x34')){logger[_0x3703('0x35')](util[_0x3703('0x9')]('[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis',_0x21361e['id']),util[_0x3703('0x36')](_0x59a06e,{'showHidden':![],'depth':null}));}}_0x5b13ee();});});}function checkTranscribe(){var _0x4d824d;var _0x31e455;var _0x2ab470;return db[_0x3703('0x37')]['findAll']({'where':{'transcribeStatus':_0x3703('0x38')}})[_0x3703('0xf')](function(_0x2df518){if(!_0x2df518||!_0x2df518[_0x3703('0x18')]){throw new db['Sequelize']['ValidationError']('No\x20transcribe\x20job\x20to\x20check');}_0x4d824d=_0x2df518;return db[_0x3703('0x39')]['findOne']({'where':{'id':0x1}});})[_0x3703('0xf')](function(_0x528db8){if(!_0x528db8){throw new db[(_0x3703('0x1b'))]['ValidationError'](_0x3703('0x3a'));}_0x31e455=_0x528db8;if(!_0x31e455[_0x3703('0x6')]||!_0x31e455[_0x3703('0x3b')]||!_0x31e455['transcribeRegion']||!_0x31e455[_0x3703('0x1e')]||!_0x31e455[_0x3703('0x1f')]){throw new db[(_0x3703('0x1b'))][(_0x3703('0x20'))](_0x3703('0x3c'));}return db['CloudProvider'][_0x3703('0x25')]({'where':{'id':_0x31e455['transcribeAccountId']}});})[_0x3703('0xf')](function(_0x4a09f8){if(!_0x4a09f8){throw new db[(_0x3703('0x1b'))][(_0x3703('0x20'))](_0x3703('0x26'));}if(!_0x4a09f8[_0x3703('0xc')]||!_0x4a09f8['data2']){throw new db['Sequelize'][(_0x3703('0x20'))](_0x3703('0x27'));}_0x2ab470=_0x4a09f8;var _0x168437=[];_0x4d824d[_0x3703('0x3d')](function(_0x38ef4d){_0x168437['push'](checkTranscribeJob(_0x38ef4d,_0x31e455,_0x2ab470));});return BPromise[_0x3703('0x3e')](_0x168437);})[_0x3703('0x3f')](function(_0x3ad43a){if(_0x3ad43a){if(!_0x3ad43a[_0x3703('0x40')]||_0x3ad43a[_0x3703('0x40')]!==_0x3703('0x34')){logger['error'](util[_0x3703('0x36')](_0x3ad43a,{'showHidden':![],'depth':null}));}}});}exports[_0x3703('0x41')]=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();}; \ No newline at end of file +var _0xf603=['data2','Cloud\x20Provider\x20not\x20configured','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','Sentiment','SentimentScore','Positive','Negative','Neutral','FAILED','FailureReason','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','resolve','Sentiment\x20Analysis\x20not\x20requested','Transcript\x20not\x20available','name','SequelizeValidationError','error','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','inspect','findAll','No\x20transcribe\x20job\x20to\x20check','Settings\x20not\x20available','transcribeRegion','Transcribe\x20not\x20configured','transcribeAccountId','catch','start','lodash','aws-sdk','request-promise','bluebird','../../mysqldb','../../config/logger','transcribe','TranscribeService','getTranscriptionJob','Comprehend','detectSentiment','info','format','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','transcribeName','then','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','TranscriptionJob','TranscriptionJobStatus','COMPLETED','Transcript','TranscriptFileUri','[RECORDING:%d]\x20Get\x20transcript','results','transcripts','length','fileText','transcript','update','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','tempSentiment','sentimentAccountId','sentimentRegion','language','bucket','Sequelize','ValidationError','CloudProvider','findOne','Cloud\x20Provider\x20not\x20available','data1'];(function(_0x502b61,_0x5ef37f){var _0x525b38=function(_0x4b5bbc){while(--_0x4b5bbc){_0x502b61['push'](_0x502b61['shift']());}};_0x525b38(++_0x5ef37f);}(_0xf603,0xeb));var _0x3f60=function(_0x42a286,_0x4c7a2b){_0x42a286=_0x42a286-0x0;var _0x212455=_0xf603[_0x42a286];return _0x212455;};var _=require(_0x3f60('0x0'));var AWS=require(_0x3f60('0x1'));var rp=require(_0x3f60('0x2'));var util=require('util');var BPromise=require(_0x3f60('0x3'));var db=require(_0x3f60('0x4'))['db'];var logger=require(_0x3f60('0x5'))(_0x3f60('0x6'));function getTranscriptionJob(_0x24aafb,_0x553e8b,_0x1b914a,_0x5559e4){return new Promise(function(_0x5914cd,_0x2910c7){var _0x1ec43c=new AWS[(_0x3f60('0x7'))]({'accessKeyId':_0x553e8b,'secretAccessKey':_0x24aafb,'region':_0x1b914a});_0x1ec43c[_0x3f60('0x8')]({'TranscriptionJobName':_0x5559e4},function(_0x434249,_0x9282dd){if(_0x434249){return _0x2910c7(_0x434249);}else{return _0x5914cd(_0x9282dd);}});});}function sentiment(_0x59b737,_0x326a7f,_0x33dcc8,_0x1fee5e,_0x3d4fa7){return new Promise(function(_0x526389,_0x54f45d){var _0x10373f=new AWS[(_0x3f60('0x9'))]({'accessKeyId':_0x326a7f,'secretAccessKey':_0x59b737,'region':_0x33dcc8});_0x10373f[_0x3f60('0xa')]({'Text':_0x1fee5e,'LanguageCode':_0x3d4fa7['substring'](0x0,0x2)},function(_0x177b6f,_0x98a478){if(_0x177b6f){return _0x54f45d(_0x177b6f);}else{return _0x526389(_0x98a478);}});});}function checkTranscribeJob(_0xad12ff,_0x4aef12,_0x50f2ef){var _0x1e52e3;return new BPromise(function(_0x77961f,_0x255708){logger[_0x3f60('0xb')](util[_0x3f60('0xc')](_0x3f60('0xd'),_0xad12ff['id'],_0xad12ff[_0x3f60('0xe')]));return getTranscriptionJob(_0x50f2ef['data1'],_0x50f2ef['data2'],_0x4aef12['transcribeRegion'],_0xad12ff[_0x3f60('0xe')])[_0x3f60('0xf')](function(_0x3d79b7){logger[_0x3f60('0xb')](util[_0x3f60('0xc')](_0x3f60('0x10'),_0xad12ff['id'],_0xad12ff[_0x3f60('0xe')],_0x3d79b7[_0x3f60('0x11')][_0x3f60('0x12')]));if(!_0xad12ff['fileText']){switch(_0x3d79b7[_0x3f60('0x11')][_0x3f60('0x12')]){case _0x3f60('0x13'):var _0xb7731f={'transcribeStatus':_0x3d79b7['TranscriptionJob']['TranscriptionJobStatus'],'fileUri':_0x3d79b7[_0x3f60('0x11')][_0x3f60('0x14')][_0x3f60('0x15')]};logger[_0x3f60('0xb')](util['format'](_0x3f60('0x16'),_0xad12ff['id']));return rp({'uri':_0x3d79b7[_0x3f60('0x11')]['Transcript']['TranscriptFileUri'],'json':!![]})[_0x3f60('0xf')](function(_0x8d2dc9){logger[_0x3f60('0xb')](util[_0x3f60('0xc')]('[RECORDING:%d]\x20Transcript\x20downloaded',_0xad12ff['id']));if(_0x8d2dc9&&_0x8d2dc9[_0x3f60('0x17')]&&_0x8d2dc9[_0x3f60('0x17')][_0x3f60('0x18')]&&_0x8d2dc9[_0x3f60('0x17')][_0x3f60('0x18')][_0x3f60('0x19')]){_0xb7731f[_0x3f60('0x1a')]='';for(var _0x42beb9=0x0;_0x42beb9<_0x8d2dc9[_0x3f60('0x17')][_0x3f60('0x18')]['length'];_0x42beb9++){_0xb7731f[_0x3f60('0x1a')]+=_0x8d2dc9[_0x3f60('0x17')][_0x3f60('0x18')][_0x42beb9][_0x3f60('0x1b')]+'';}}return _0xad12ff[_0x3f60('0x1c')](_0xb7731f);})[_0x3f60('0xf')](function(){logger['info'](util[_0x3f60('0xc')](_0x3f60('0x1d'),_0xad12ff['id']));if(!_0xad12ff[_0x3f60('0x1e')]){throw new db['Sequelize']['ValidationError']('Sentiment\x20Analysis\x20not\x20requested');}if(!_0x4aef12['sentiment']||!_0x4aef12[_0x3f60('0x1f')]||!_0x4aef12[_0x3f60('0x20')]||!_0x4aef12[_0x3f60('0x21')]||!_0x4aef12[_0x3f60('0x22')]){throw new db[(_0x3f60('0x23'))][(_0x3f60('0x24'))]('Sentiment\x20Analysis\x20not\x20configured');}if(!_0xb7731f[_0x3f60('0x1a')]){throw new Error('Transcript\x20not\x20available');}if(_0x4aef12[_0x3f60('0x1f')]===_0x50f2ef['id']){return _0x50f2ef;}else{return db[_0x3f60('0x25')][_0x3f60('0x26')]({'where':{'id':_settings[_0x3f60('0x1f')]}});}})['then'](function(_0xc0198b){if(!_0xc0198b){throw new db['Sequelize'][(_0x3f60('0x24'))](_0x3f60('0x27'));}if(!_0xc0198b[_0x3f60('0x28')]||!_0xc0198b[_0x3f60('0x29')]){throw new db['Sequelize']['ValidationError'](_0x3f60('0x2a'));}_0x1e52e3=_0xc0198b;logger[_0x3f60('0xb')](util[_0x3f60('0xc')](_0x3f60('0x2b'),_0xad12ff['id']));return sentiment(_0x1e52e3[_0x3f60('0x28')],_0x1e52e3[_0x3f60('0x29')],_0x4aef12[_0x3f60('0x20')],_0xb7731f['fileText'],_0x4aef12[_0x3f60('0x21')]);})['then'](function(_0x7577f1){logger['info'](util['format'](_0x3f60('0x2c'),_0xad12ff['id']));return _0xad12ff['update']({'sentiment':_0x7577f1[_0x3f60('0x2d')],'sPositive':_0x7577f1[_0x3f60('0x2e')][_0x3f60('0x2f')],'sNegative':_0x7577f1[_0x3f60('0x2e')][_0x3f60('0x30')],'sMixed':_0x7577f1[_0x3f60('0x2e')]['Mixed'],'sNeutral':_0x7577f1[_0x3f60('0x2e')][_0x3f60('0x31')]});})[_0x3f60('0xf')](function(){logger['info'](util[_0x3f60('0xc')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0xad12ff['id']));_0x77961f();});case _0x3f60('0x32'):return _0xad12ff[_0x3f60('0x1c')]({'transcribeStatus':_0x3f60('0x32'),'failureReason':_0x3d79b7[_0x3f60('0x11')][_0x3f60('0x33')]})[_0x3f60('0xf')](function(){logger['info'](util['format']('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0xad12ff['id']));_0x77961f();});default:logger[_0x3f60('0xb')](util[_0x3f60('0xc')](_0x3f60('0x34'),_0xad12ff['id']));break;}}else{return BPromise[_0x3f60('0x35')]()[_0x3f60('0xf')](function(){if(!_0xad12ff[_0x3f60('0x1e')]){throw new db[(_0x3f60('0x23'))]['ValidationError'](_0x3f60('0x36'));}if(!_0x4aef12['sentiment']||!_0x4aef12[_0x3f60('0x1f')]||!_0x4aef12['sentimentRegion']||!_0x4aef12['language']||!_0x4aef12[_0x3f60('0x22')]){throw new db[(_0x3f60('0x23'))][(_0x3f60('0x24'))]('Sentiment\x20Analysis\x20not\x20configured');}if(!_0xad12ff[_0x3f60('0x1a')]){throw new Error(_0x3f60('0x37'));}if(_0x4aef12[_0x3f60('0x1f')]===_0x50f2ef['id']){return _0x50f2ef;}else{return db[_0x3f60('0x25')][_0x3f60('0x26')]({'where':{'id':_settings['sentimentAccountId']}});}})[_0x3f60('0xf')](function(_0x3555b2){if(!_0x3555b2){throw new db[(_0x3f60('0x23'))]['ValidationError']('Cloud\x20Provider\x20not\x20available');}if(!_0x3555b2[_0x3f60('0x28')]||!_0x3555b2['data2']){throw new db['Sequelize'][(_0x3f60('0x24'))](_0x3f60('0x2a'));}_0x1e52e3=_0x3555b2;logger['info'](util[_0x3f60('0xc')]('[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis',_0xad12ff['id']));return sentiment(_0x1e52e3['data1'],_0x1e52e3[_0x3f60('0x29')],_0x4aef12[_0x3f60('0x20')],_0xad12ff[_0x3f60('0x1a')],_0x4aef12[_0x3f60('0x21')]);})['then'](function(_0x56659c){logger[_0x3f60('0xb')](util[_0x3f60('0xc')]('[RECORDING:%d]\x20Sentiment\x20Analysis\x20available',_0xad12ff['id']));return _0xad12ff['update']({'sentiment':_0x56659c[_0x3f60('0x2d')],'sPositive':_0x56659c[_0x3f60('0x2e')][_0x3f60('0x2f')],'sNegative':_0x56659c['SentimentScore']['Negative'],'sMixed':_0x56659c['SentimentScore']['Mixed'],'sNeutral':_0x56659c[_0x3f60('0x2e')][_0x3f60('0x31')],'transcribeStatus':_0x3f60('0x13')});})['then'](function(){logger[_0x3f60('0xb')](util[_0x3f60('0xc')](_0x3f60('0x1d'),_0xad12ff['id']));_0x77961f();});}})['catch'](function(_0x363ef3){if(_0x363ef3){if(!_0x363ef3['name']||_0x363ef3[_0x3f60('0x38')]!==_0x3f60('0x39')){logger[_0x3f60('0x3a')](util[_0x3f60('0xc')](_0x3f60('0x3b'),_0xad12ff['id']),util[_0x3f60('0x3c')](_0x363ef3,{'showHidden':![],'depth':null}));}}_0x77961f();});});}function checkTranscribe(){var _0x12fde7;var _0x38bb04;var _0x42bae0;return db['VoiceRecording'][_0x3f60('0x3d')]({'where':{'transcribeStatus':'IN_PROGRESS'}})[_0x3f60('0xf')](function(_0x1d5e5f){if(!_0x1d5e5f||!_0x1d5e5f[_0x3f60('0x19')]){throw new db[(_0x3f60('0x23'))][(_0x3f60('0x24'))](_0x3f60('0x3e'));}_0x12fde7=_0x1d5e5f;return db['Setting'][_0x3f60('0x26')]({'where':{'id':0x1}});})['then'](function(_0x125431){if(!_0x125431){throw new db[(_0x3f60('0x23'))]['ValidationError'](_0x3f60('0x3f'));}_0x38bb04=_0x125431;if(!_0x38bb04['transcribe']||!_0x38bb04['transcribeAccountId']||!_0x38bb04[_0x3f60('0x40')]||!_0x38bb04[_0x3f60('0x21')]||!_0x38bb04[_0x3f60('0x22')]){throw new db['Sequelize'][(_0x3f60('0x24'))](_0x3f60('0x41'));}return db[_0x3f60('0x25')][_0x3f60('0x26')]({'where':{'id':_0x38bb04[_0x3f60('0x42')]}});})[_0x3f60('0xf')](function(_0xc558fc){if(!_0xc558fc){throw new db[(_0x3f60('0x23'))]['ValidationError'](_0x3f60('0x27'));}if(!_0xc558fc[_0x3f60('0x28')]||!_0xc558fc[_0x3f60('0x29')]){throw new db['Sequelize'][(_0x3f60('0x24'))]('Cloud\x20Provider\x20not\x20configured');}_0x42bae0=_0xc558fc;var _0x5a94a4=[];_0x12fde7['forEach'](function(_0x3e6728){_0x5a94a4['push'](checkTranscribeJob(_0x3e6728,_0x38bb04,_0x42bae0));});return BPromise['all'](_0x5a94a4);})[_0x3f60('0x43')](function(_0x139a5f){if(_0x139a5f){if(!_0x139a5f['name']||_0x139a5f[_0x3f60('0x38')]!==_0x3f60('0x39')){logger[_0x3f60('0x3a')](util['inspect'](_0x139a5f,{'showHidden':![],'depth':null}));}}});}exports[_0x3f60('0x44')]=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 6f93a9b..5b882fd 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 _0x581d=['then','length','info','join','update','system','timeout','format','YYYY-MM-DD\x20HH:mm:ss','emit','inspect','start','lodash','moment','ioredis','util','../../config/environment','../../mysqldb','../logger','redis','defaults','localhost','socket.io-emitter','WhatsappInteraction','findAll','subtract'];(function(_0x29b3f6,_0x1bd904){var _0x321943=function(_0x51408d){while(--_0x51408d){_0x29b3f6['push'](_0x29b3f6['shift']());}};_0x321943(++_0x1bd904);}(_0x581d,0x192));var _0xd581=function(_0x147187,_0x2f1ad9){_0x147187=_0x147187-0x0;var _0xe17404=_0x581d[_0x147187];return _0xe17404;};'use strict';var _=require(_0xd581('0x0'));var moment=require(_0xd581('0x1'));var Redis=require(_0xd581('0x2'));var util=require(_0xd581('0x3'));var config=require(_0xd581('0x4'));var db=require(_0xd581('0x5'))['db'];var logger=require(_0xd581('0x6'))('schedule');config[_0xd581('0x7')]=_[_0xd581('0x8')](config[_0xd581('0x7')],{'host':_0xd581('0x9'),'port':0x18eb});var io=require(_0xd581('0xa'))(new Redis(config['redis']));function closeInteractions(){var _0x21f3e5=[];return db[_0xd581('0xb')][_0xd581('0xc')]({'raw':!![],'attributes':['id','lastMsgAt'],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0xd581('0xd')](0x18,'hours')}}})[_0xd581('0xe')](function(_0x37a2f2){if(_0x37a2f2&&_0x37a2f2[_0xd581('0xf')]){_0x21f3e5=_['map'](_0x37a2f2||[],'id');logger[_0xd581('0x10')]('[WHATSAPP]\x20Interactions\x20to\x20close:',_0x21f3e5[_0xd581('0x11')]());return db[_0xd581('0xb')][_0xd581('0x12')]({'closeReason':_0xd581('0x13'),'disposition':_0xd581('0x14'),'closed':!![],'closedAt':moment()[_0xd581('0x15')](_0xd581('0x16'))},{'where':{'id':_0x21f3e5}});}})[_0xd581('0xe')](function(){if(_0x21f3e5&&_0x21f3e5[_0xd581('0xf')]){logger[_0xd581('0x10')]('[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:',_0x21f3e5[_0xd581('0x11')]());for(var _0x542169=0x0;_0x542169<_0x21f3e5[_0xd581('0xf')];_0x542169++){io[_0xd581('0x17')]('whatsappInteraction:update',{'id':_0x21f3e5[_0x542169],'closed':!![]});}}})['catch'](function(_0x5c8b4f){logger['error']('[WHATSAPP]\x20Error\x20closing\x20interactions',_0x5c8b4f?util[_0xd581('0x18')](_0x5c8b4f,{'showHidden':![],'depth':null}):'');});}exports[_0xd581('0x19')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0xc298=['then','map','info','[WHATSAPP]\x20Interactions\x20to\x20close:','join','system','timeout','format','length','emit','catch','error','[WHATSAPP]\x20Error\x20closing\x20interactions','inspect','start','lodash','moment','ioredis','../../config/environment','../logger','defaults','redis','localhost','socket.io-emitter','WhatsappInteraction','findAll','lastMsgAt','hours'];(function(_0x5635cc,_0x34db46){var _0x2eee63=function(_0x51355f){while(--_0x51355f){_0x5635cc['push'](_0x5635cc['shift']());}};_0x2eee63(++_0x34db46);}(_0xc298,0x9b));var _0x8c29=function(_0x5c15f1,_0x52945a){_0x5c15f1=_0x5c15f1-0x0;var _0x5824f4=_0xc298[_0x5c15f1];return _0x5824f4;};'use strict';var _=require(_0x8c29('0x0'));var moment=require(_0x8c29('0x1'));var Redis=require(_0x8c29('0x2'));var util=require('util');var config=require(_0x8c29('0x3'));var db=require('../../mysqldb')['db'];var logger=require(_0x8c29('0x4'))('schedule');config['redis']=_[_0x8c29('0x5')](config[_0x8c29('0x6')],{'host':_0x8c29('0x7'),'port':0x18eb});var io=require(_0x8c29('0x8'))(new Redis(config['redis']));function closeInteractions(){var _0x11e44e=[];return db[_0x8c29('0x9')][_0x8c29('0xa')]({'raw':!![],'attributes':['id',_0x8c29('0xb')],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()['subtract'](0x18,_0x8c29('0xc'))}}})[_0x8c29('0xd')](function(_0xed5020){if(_0xed5020&&_0xed5020['length']){_0x11e44e=_[_0x8c29('0xe')](_0xed5020||[],'id');logger[_0x8c29('0xf')](_0x8c29('0x10'),_0x11e44e[_0x8c29('0x11')]());return db[_0x8c29('0x9')]['update']({'closeReason':_0x8c29('0x12'),'disposition':_0x8c29('0x13'),'closed':!![],'closedAt':moment()[_0x8c29('0x14')]('YYYY-MM-DD\x20HH:mm:ss')},{'where':{'id':_0x11e44e}});}})[_0x8c29('0xd')](function(){if(_0x11e44e&&_0x11e44e[_0x8c29('0x15')]){logger[_0x8c29('0xf')]('[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:',_0x11e44e[_0x8c29('0x11')]());for(var _0x4ad97c=0x0;_0x4ad97c<_0x11e44e[_0x8c29('0x15')];_0x4ad97c++){io[_0x8c29('0x16')]('whatsappInteraction:update',{'id':_0x11e44e[_0x4ad97c],'closed':!![]});}}})[_0x8c29('0x17')](function(_0x28702b){logger[_0x8c29('0x18')](_0x8c29('0x19'),_0x28702b?util[_0x8c29('0x1a')](_0x28702b,{'showHidden':![],'depth':null}):'');});}exports[_0x8c29('0x1b')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file diff --git a/server/config/seedContact.js b/server/config/seedContact.js index f76e4c1..6c91d99 100644 --- a/server/config/seedContact.js +++ b/server/config/seedContact.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x75a9=['now','CmContact','destroy','bulkCreate','then','log','finished\x20populating','contacts1','CmHopper','hopper1','contacts2','util','../mysqldb','push','Innocenzo','Biondo','@xcally.com'];(function(_0x4e24fc,_0xf16538){var _0x4047a4=function(_0x2f752a){while(--_0x2f752a){_0x4e24fc['push'](_0x4e24fc['shift']());}};_0x4047a4(++_0xf16538);}(_0x75a9,0xd7));var _0x975a=function(_0x4fc698,_0xeb73e8){_0x4fc698=_0x4fc698-0x0;var _0x4392b2=_0x75a9[_0x4fc698];return _0x4392b2;};'use strict';var util=require(_0x975a('0x0'));var db=require(_0x975a('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0x975a('0x2')]({'id':i,'firstName':_0x975a('0x3')+i,'lastName':_0x975a('0x4')+i,'phone':0xf879fb460+i,'email':'innocenzo.biondo'+i+_0x975a('0x5')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0x975a('0x2')]({'id':i,'active':![],'scheduledat':Date[_0x975a('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x975a('0x6')](),'updatedAt':Date[_0x975a('0x6')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2['push']({'id':i,'firstName':_0x975a('0x3')+i,'lastName':_0x975a('0x4')+i,'phone':0xf879fb460+i,'email':'innocenzo.biondo'+i+_0x975a('0x5')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0x975a('0x2')]({'id':i,'active':![],'scheduledat':Date[_0x975a('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x975a('0x6')](),'updatedAt':Date[_0x975a('0x6')]()});}db[_0x975a('0x7')][_0x975a('0x8')]({'where':{}})['then'](function(){return db['CmContact'][_0x975a('0x9')](contacts);})[_0x975a('0xa')](function(){console[_0x975a('0xb')](_0x975a('0xc'),_0x975a('0xd'));return db[_0x975a('0xe')][_0x975a('0x8')]({'where':{}});})[_0x975a('0xa')](function(){return db[_0x975a('0xe')]['bulkCreate'](hopper);})[_0x975a('0xa')](function(){console[_0x975a('0xb')](_0x975a('0xc'),_0x975a('0xf'));return db['CmContact'][_0x975a('0x9')](contacts2);})[_0x975a('0xa')](function(){console['log'](_0x975a('0xc'),_0x975a('0x10'));return db[_0x975a('0xe')][_0x975a('0x9')](hopper2);})[_0x975a('0xa')](function(){console[_0x975a('0xb')](_0x975a('0xc'),'hopper2');})['catch'](function(_0x10d4c3){console[_0x975a('0xb')](_0x10d4c3);}); \ No newline at end of file +var _0xfe9f=['push','Innocenzo','@xcally.com','now','innocenzo.biondo','then','CmContact','bulkCreate','log','contacts1','CmHopper','destroy','finished\x20populating','catch','util','../mysqldb'];(function(_0x138fda,_0x222674){var _0x491ab3=function(_0x3c9e55){while(--_0x3c9e55){_0x138fda['push'](_0x138fda['shift']());}};_0x491ab3(++_0x222674);}(_0xfe9f,0x12e));var _0xffe9=function(_0x18542d,_0x115527){_0x18542d=_0x18542d-0x0;var _0x50e97d=_0xfe9f[_0x18542d];return _0x50e97d;};'use strict';var util=require(_0xffe9('0x0'));var db=require(_0xffe9('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0xffe9('0x2')]({'id':i,'firstName':_0xffe9('0x3')+i,'lastName':'Biondo'+i,'phone':0xf879fb460+i,'email':'innocenzo.biondo'+i+_0xffe9('0x4')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0xffe9('0x2')]({'id':i,'active':![],'scheduledat':Date[_0xffe9('0x5')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0xffe9('0x5')](),'updatedAt':Date['now']()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0xffe9('0x2')]({'id':i,'firstName':_0xffe9('0x3')+i,'lastName':'Biondo'+i,'phone':0xf879fb460+i,'email':_0xffe9('0x6')+i+_0xffe9('0x4')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0xffe9('0x2')]({'id':i,'active':![],'scheduledat':Date[_0xffe9('0x5')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0xffe9('0x5')](),'updatedAt':Date['now']()});}db['CmContact']['destroy']({'where':{}})[_0xffe9('0x7')](function(){return db[_0xffe9('0x8')][_0xffe9('0x9')](contacts);})[_0xffe9('0x7')](function(){console[_0xffe9('0xa')]('finished\x20populating',_0xffe9('0xb'));return db[_0xffe9('0xc')][_0xffe9('0xd')]({'where':{}});})[_0xffe9('0x7')](function(){return db[_0xffe9('0xc')]['bulkCreate'](hopper);})['then'](function(){console['log'](_0xffe9('0xe'),'hopper1');return db[_0xffe9('0x8')]['bulkCreate'](contacts2);})[_0xffe9('0x7')](function(){console[_0xffe9('0xa')](_0xffe9('0xe'),'contacts2');return db[_0xffe9('0xc')]['bulkCreate'](hopper2);})[_0xffe9('0x7')](function(){console[_0xffe9('0xa')](_0xffe9('0xe'),'hopper2');})[_0xffe9('0xf')](function(_0x3c5b42){console['log'](_0x3c5b42);}); \ No newline at end of file diff --git a/server/config/seedUsers.js b/server/config/seedUsers.js index 4db9319..cee99e6 100644 --- a/server/config/seedUsers.js +++ b/server/config/seedUsers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x522a=['agent','%s%s@xcally.com','password','friend','udp','all','ulaw','yes','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','\x22%s\x22\x20<%s>','bulkCreate','log','add\x20user','catch','push','format','%s%s'];(function(_0x1255b8,_0x2c7f6c){var _0xfd1f87=function(_0x18ec08){while(--_0x18ec08){_0x1255b8['push'](_0x1255b8['shift']());}};_0xfd1f87(++_0x2c7f6c);}(_0x522a,0x1e3));var _0xa522=function(_0x74745d,_0x177606){_0x74745d=_0x74745d-0x0;var _0x174ab3=_0x522a[_0x74745d];return _0x174ab3;};'use strict';var util=require('util');var db=require('../mysqldb')['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0xa522('0x0')]({'name':util[_0xa522('0x1')](_0xa522('0x2'),_0xa522('0x3'),i),'fullname':util[_0xa522('0x1')](_0xa522('0x2'),_0xa522('0x3'),i),'email':util['format'](_0xa522('0x4'),'agent',i),'role':_0xa522('0x3'),'password':_0xa522('0x5'),'internal':0xfa0+i,'type':_0xa522('0x6'),'transport':[_0xa522('0x7'),'ws','wss'],'disallow':[_0xa522('0x8')],'allow':[_0xa522('0x9')],'defaultuser':util[_0xa522('0x1')]('%s%s',_0xa522('0x3'),i),'encryption':_0xa522('0xa'),'avpf':_0xa522('0xa'),'force_avp':'yes','icesupport':_0xa522('0xa'),'dtlsenable':_0xa522('0xa'),'dtlsverify':'no','dtlscertfile':_0xa522('0xb'),'dtlsprivatekey':_0xa522('0xc'),'dtlssetup':'actpass','callerid':util['format'](_0xa522('0xd'),util[_0xa522('0x1')](_0xa522('0x2'),_0xa522('0x3'),i),0xfa0+i)});}db['User'][_0xa522('0xe')](users)['then'](function(){console[_0xa522('0xf')](_0xa522('0x10'));})[_0xa522('0x11')](function(_0xcca8d0){console[_0xa522('0xf')](_0xcca8d0);}); \ No newline at end of file +var _0x5dde=['format','yes','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','User','then','add\x20user','log','util','../mysqldb','%s%s','agent','%s%s@xcally.com','friend','udp','wss'];(function(_0x3b0731,_0xcf9925){var _0x4204d7=function(_0x635ac5){while(--_0x635ac5){_0x3b0731['push'](_0x3b0731['shift']());}};_0x4204d7(++_0xcf9925);}(_0x5dde,0x198));var _0xe5dd=function(_0x1f75a4,_0x220814){_0x1f75a4=_0x1f75a4-0x0;var _0x3e3309=_0x5dde[_0x1f75a4];return _0x3e3309;};'use strict';var util=require(_0xe5dd('0x0'));var db=require(_0xe5dd('0x1'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users['push']({'name':util['format'](_0xe5dd('0x2'),_0xe5dd('0x3'),i),'fullname':util['format'](_0xe5dd('0x2'),'agent',i),'email':util['format'](_0xe5dd('0x4'),_0xe5dd('0x3'),i),'role':_0xe5dd('0x3'),'password':'password','internal':0xfa0+i,'type':_0xe5dd('0x5'),'transport':[_0xe5dd('0x6'),'ws',_0xe5dd('0x7')],'disallow':['all'],'allow':['ulaw'],'defaultuser':util[_0xe5dd('0x8')](_0xe5dd('0x2'),_0xe5dd('0x3'),i),'encryption':_0xe5dd('0x9'),'avpf':_0xe5dd('0x9'),'force_avp':_0xe5dd('0x9'),'icesupport':_0xe5dd('0x9'),'dtlsenable':_0xe5dd('0x9'),'dtlsverify':'no','dtlscertfile':_0xe5dd('0xa'),'dtlsprivatekey':_0xe5dd('0xb'),'dtlssetup':'actpass','callerid':util[_0xe5dd('0x8')]('\x22%s\x22\x20<%s>',util[_0xe5dd('0x8')](_0xe5dd('0x2'),_0xe5dd('0x3'),i),0xfa0+i)});}db[_0xe5dd('0xc')]['bulkCreate'](users)[_0xe5dd('0xd')](function(){console['log'](_0xe5dd('0xe'));})['catch'](function(_0x23bf8b){console[_0xe5dd('0xf')](_0x23bf8b);}); \ No newline at end of file diff --git a/server/config/socketio.js b/server/config/socketio.js index 670b738..ec9fc3a 100644 --- a/server/config/socketio.js +++ b/server/config/socketio.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6237=['SocketIO\x20','nsp','disconnect','CONNECTED','lodash','util','bluebird','../mysqldb','./environment','name','User','role','telephone','type','ivr','UserProfileSection','findOne','then','autoAssociation','ChatQueues','FaxQueues','SmsQueues','MailQueues','OpenchannelQueues','WhatsappQueues','Telephones','findAll','IvrCampaigns','resourceId','map','where','format','Agents','length','user:%s','handshake','query','userProfileId','ChatInteractions','FaxInteraction','FaxInteractions','SmsInteraction','SmsInteractions','OpenchannelInteraction','OpenchannelInteractions','WhatsappInteractions','admin','voice:outbound','include','push','VoiceQueue','ChatQueue','FaxQueue','SmsQueue','MailQueue','OpenchannelQueue','WhatsappQueue','Trunk','Campaign','VoiceQueues','Trunks','agent','voice:inbound','getVoiceQueues','getChatQueues','getFaxQueues','getSmsQueues','getWhatsappQueues','all','fax','sms','whatsapp','telephone:%s','trunk:%s','campaign:%s:%s','leave','removeChatInteractions','emit','user_has_chat_interactions:remove','MailInteractions','removeFaxInteractions','user_has_fax_interactions:remove','removeSmsInteractions','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','removeWhatsappInteractions','user_has_whatsapp_interactions:remove','catch','log','join','connection','setMaxListeners','address','request','remotePort','connectedAt'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x6237,0xc4));var _0x7623=function(_0x11e001,_0xb3367b){_0x11e001=_0x11e001-0x0;var _0x417419=_0x6237[_0x11e001];return _0x417419;};'use strict';var _=require(_0x7623('0x0'));var util=require(_0x7623('0x1'));var BPromise=require(_0x7623('0x2'));var db=require(_0x7623('0x3'))['db'];var config=require(_0x7623('0x4'));var queryQueues={'attributes':['id',_0x7623('0x5')],'include':[{'as':'Agents','model':db[_0x7623('0x6')],'attributes':['id',_0x7623('0x5'),_0x7623('0x7')],'raw':!![],'where':{'role':'agent'},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0x7623('0x5')],'where':{'role':_0x7623('0x8')}};var queryTrunks={'raw':!![],'attributes':['id',_0x7623('0x5')]};var queryAgents={'raw':!![],'attributes':['id',_0x7623('0x5')],'where':{'role':'agent'}};var queryCampaigns={'raw':!![],'attributes':['id',_0x7623('0x5'),_0x7623('0x9')],'where':{'type':_0x7623('0xa')}};function getAssociatedResources(_0x5709fe,_0x352439,_0xb98922){return db[_0x7623('0xb')][_0x7623('0xc')]({'where':{'name':_0x5709fe,'userProfileId':_0x352439},'raw':!![]})[_0x7623('0xd')](function(_0x493778){if(_0x493778){if(_0x493778[_0x7623('0xe')]){switch(_0x5709fe){case'VoiceQueues':case _0x7623('0xf'):case _0x7623('0x10'):case _0x7623('0x11'):case _0x7623('0x12'):case _0x7623('0x13'):case _0x7623('0x14'):return db[_0xb98922]['findAll'](queryQueues);case _0x7623('0x15'):return db[_0xb98922][_0x7623('0x16')](queryTelephones);case'Trunks':return db[_0xb98922]['findAll'](queryTrunks);case _0x7623('0x17'):return db[_0xb98922]['findAll'](queryCampaigns);}}else{return db['UserProfileResource'][_0x7623('0x16')]({'attributes':[_0x7623('0x18')],'where':{'sectionId':_0x493778['id']},'raw':!![]})[_0x7623('0xd')](function(_0x57d2a9){if(_0x57d2a9){var _0x542cd8={'where':{'id':_[_0x7623('0x19')](_0x57d2a9,_0x7623('0x18'))},'raw':!![]};switch(_0xb98922){case _0x7623('0x6'):_0x542cd8[_0x7623('0x1a')][_0x7623('0x7')]=_0x7623('0x8');break;case'Campaign':_0x542cd8['where'][_0x7623('0x9')]=_0x7623('0xa');break;}return db[_0xb98922][_0x7623('0x16')](_0x542cd8);}else{return[];}});}}else{return[];}})[_0x7623('0xd')](function(_0xd288d4){return _0xd288d4;});}function joinOrLeaveQueues(_0x4afdf6,_0x966f9b,_0x3c7a7a,_0xde8a26){_0x4afdf6[_0x966f9b](util[_0x7623('0x1b')]('%s:queue:%s',_0x3c7a7a,_0xde8a26[_0x7623('0x5')]));if(_0xde8a26['Agents']){for(var _0x11e971=0x0;_0x11e971<_0xde8a26[_0x7623('0x1c')][_0x7623('0x1d')];_0x11e971+=0x1){_0x4afdf6[_0x966f9b](util[_0x7623('0x1b')](_0x7623('0x1e'),_0xde8a26[_0x7623('0x1c')][_0x11e971][_0x7623('0x5')]));}}}function joinOrLeave(_0x1bae9c,_0x468d9e,_0x3916cf){var _0x3cac7c;if(_0x1bae9c[_0x7623('0x1f')][_0x7623('0x20')]['id']){db[_0x7623('0x6')]['find']({'attributes':['id','name',_0x7623('0x7'),_0x7623('0x21')],'where':{'id':_0x1bae9c[_0x7623('0x1f')][_0x7623('0x20')]['id']},'include':[{'model':db['ChatInteraction'],'as':_0x7623('0x22'),'attributes':['id'],'raw':!![]},{'model':db['MailInteraction'],'as':'MailInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x7623('0x23')],'as':_0x7623('0x24'),'attributes':['id'],'raw':!![]},{'model':db[_0x7623('0x25')],'as':_0x7623('0x26'),'attributes':['id'],'raw':!![]},{'model':db[_0x7623('0x27')],'as':_0x7623('0x28'),'attributes':['id'],'raw':!![]},{'model':db['WhatsappInteraction'],'as':_0x7623('0x29'),'attributes':['id'],'raw':!![]}]})[_0x7623('0xd')](function(_0xa7d4b0){if(_0xa7d4b0){_0x3cac7c=_0xa7d4b0;_0x1bae9c[_0x468d9e](util[_0x7623('0x1b')](_0x7623('0x1e'),_0xa7d4b0[_0x7623('0x5')]));var _0x39e4db=[];switch(_0xa7d4b0[_0x7623('0x7')]){case _0x7623('0x2a'):_0x1bae9c[_0x468d9e]('voice:inbound');_0x1bae9c[_0x468d9e](_0x7623('0x2b'));if(queryQueues['hasOwnProperty']('include')){delete queryQueues[_0x7623('0x2c')];}_0x39e4db[_0x7623('0x2d')](db[_0x7623('0x2e')][_0x7623('0x16')](queryQueues));_0x39e4db[_0x7623('0x2d')](db[_0x7623('0x2f')][_0x7623('0x16')](queryQueues));_0x39e4db['push'](db[_0x7623('0x30')][_0x7623('0x16')](queryQueues));_0x39e4db['push'](db[_0x7623('0x31')]['findAll'](queryQueues));_0x39e4db[_0x7623('0x2d')](db[_0x7623('0x32')][_0x7623('0x16')](queryQueues));_0x39e4db['push'](db[_0x7623('0x33')][_0x7623('0x16')](queryQueues));_0x39e4db[_0x7623('0x2d')](db[_0x7623('0x34')]['findAll'](queryQueues));_0x39e4db['push'](db[_0x7623('0x6')][_0x7623('0x16')](queryTelephones));_0x39e4db[_0x7623('0x2d')](db[_0x7623('0x35')]['findAll'](queryTrunks));_0x39e4db[_0x7623('0x2d')](db[_0x7623('0x36')][_0x7623('0x16')](queryCampaigns));_0x39e4db[_0x7623('0x2d')](db['User'][_0x7623('0x16')](queryAgents));break;case'user':_0x1bae9c[_0x468d9e]('voice:inbound');_0x1bae9c[_0x468d9e](_0x7623('0x2b'));_0x39e4db[_0x7623('0x2d')](getAssociatedResources(_0x7623('0x37'),_0xa7d4b0['userProfileId'],'VoiceQueue'));_0x39e4db['push'](getAssociatedResources('ChatQueues',_0xa7d4b0['userProfileId'],_0x7623('0x2f')));_0x39e4db[_0x7623('0x2d')](getAssociatedResources(_0x7623('0x10'),_0xa7d4b0[_0x7623('0x21')],_0x7623('0x30')));_0x39e4db['push'](getAssociatedResources(_0x7623('0x11'),_0xa7d4b0[_0x7623('0x21')],_0x7623('0x31')));_0x39e4db[_0x7623('0x2d')](getAssociatedResources('MailQueues',_0xa7d4b0['userProfileId'],'MailQueue'));_0x39e4db[_0x7623('0x2d')](getAssociatedResources('OpenchannelQueues',_0xa7d4b0[_0x7623('0x21')],'OpenchannelQueue'));_0x39e4db[_0x7623('0x2d')](getAssociatedResources(_0x7623('0x14'),_0xa7d4b0[_0x7623('0x21')],_0x7623('0x34')));_0x39e4db[_0x7623('0x2d')](getAssociatedResources(_0x7623('0x15'),_0xa7d4b0[_0x7623('0x21')],_0x7623('0x6')));_0x39e4db['push'](getAssociatedResources(_0x7623('0x38'),_0xa7d4b0[_0x7623('0x21')],_0x7623('0x35')));_0x39e4db['push'](getAssociatedResources(_0x7623('0x17'),_0xa7d4b0[_0x7623('0x21')],'Campaign'));_0x39e4db['push'](db[_0x7623('0x6')][_0x7623('0x16')](queryAgents));break;case _0x7623('0x39'):_0x1bae9c[_0x468d9e](_0x7623('0x3a'));_0x1bae9c[_0x468d9e](_0x7623('0x2b'));_0x39e4db['push'](_0xa7d4b0[_0x7623('0x3b')]({'attributes':['id',_0x7623('0x5')]}));_0x39e4db[_0x7623('0x2d')](_0xa7d4b0[_0x7623('0x3c')]({'attributes':['id',_0x7623('0x5')]}));_0x39e4db[_0x7623('0x2d')](_0xa7d4b0[_0x7623('0x3d')]({'attributes':['id',_0x7623('0x5')]}));_0x39e4db['push'](_0xa7d4b0[_0x7623('0x3e')]({'attributes':['id',_0x7623('0x5')]}));_0x39e4db[_0x7623('0x2d')](_0xa7d4b0['getMailQueues']({'attributes':['id',_0x7623('0x5')]}));_0x39e4db['push'](_0xa7d4b0['getOpenchannelQueues']({'attributes':['id',_0x7623('0x5')]}));_0x39e4db[_0x7623('0x2d')](_0xa7d4b0[_0x7623('0x3f')]({'attributes':['id','name']}));break;}return BPromise[_0x7623('0x40')](_0x39e4db);}})[_0x7623('0xd')](function(_0x41ae84){if(_0x41ae84&&_0x41ae84[_0x7623('0x1d')]){for(var _0x53c392=0x0;_0x53c392<_0x41ae84[_0x7623('0x1d')];_0x53c392+=0x1){for(var _0xb612c8=0x0;_0xb612c8<_0x41ae84[_0x53c392][_0x7623('0x1d')];_0xb612c8+=0x1){switch(_0x53c392){case 0x0:joinOrLeaveQueues(_0x1bae9c,_0x468d9e,'voice',_0x41ae84[_0x53c392][_0xb612c8]);break;case 0x1:joinOrLeaveQueues(_0x1bae9c,_0x468d9e,'chat',_0x41ae84[_0x53c392][_0xb612c8]);break;case 0x2:joinOrLeaveQueues(_0x1bae9c,_0x468d9e,_0x7623('0x41'),_0x41ae84[_0x53c392][_0xb612c8]);break;case 0x3:joinOrLeaveQueues(_0x1bae9c,_0x468d9e,_0x7623('0x42'),_0x41ae84[_0x53c392][_0xb612c8]);break;case 0x4:joinOrLeaveQueues(_0x1bae9c,_0x468d9e,'mail',_0x41ae84[_0x53c392][_0xb612c8]);break;case 0x5:joinOrLeaveQueues(_0x1bae9c,_0x468d9e,'openchannel',_0x41ae84[_0x53c392][_0xb612c8]);break;case 0x6:joinOrLeaveQueues(_0x1bae9c,_0x468d9e,_0x7623('0x43'),_0x41ae84[_0x53c392][_0xb612c8]);break;case 0x7:if(_0x3cac7c[_0x7623('0x7')]!==_0x7623('0x39'))_0x1bae9c[_0x468d9e](util[_0x7623('0x1b')](_0x7623('0x44'),_0x41ae84[_0x53c392][_0xb612c8][_0x7623('0x5')]));break;case 0x8:if(_0x3cac7c['role']!==_0x7623('0x39'))_0x1bae9c[_0x468d9e](util['format'](_0x7623('0x45'),_0x41ae84[_0x53c392][_0xb612c8][_0x7623('0x5')]));break;case 0x9:if(_0x3cac7c[_0x7623('0x7')]!==_0x7623('0x39'))_0x1bae9c[_0x468d9e](util[_0x7623('0x1b')](_0x7623('0x46'),_0x41ae84[_0x53c392][_0xb612c8]['type'],_0x41ae84[_0x53c392][_0xb612c8][_0x7623('0x5')]));break;case 0xa:_0x1bae9c[_0x468d9e](util[_0x7623('0x1b')](_0x7623('0x1e'),_0x41ae84[_0x53c392][_0xb612c8]['name']));break;}}}}})[_0x7623('0xd')](function(){if(_0x468d9e===_0x7623('0x47')){var _0x207973=_[_0x7623('0x19')](_0x3cac7c[_0x7623('0x22')],'id');return _0x3cac7c[_0x7623('0x48')](_0x207973)[_0x7623('0xd')](function(){for(var _0x3b23b9=0x0;_0x3b23b9<_0x207973[_0x7623('0x1d')];_0x3b23b9+=0x1){_0x3916cf[_0x7623('0x49')](_0x7623('0x4a'),{'ChatInteractionId':Number(_0x207973[_0x3b23b9]),'UserId':Number(_0x3cac7c['id'])});}});}})[_0x7623('0xd')](function(){if(_0x468d9e===_0x7623('0x47')){var _0x50e74c=_[_0x7623('0x19')](_0x3cac7c[_0x7623('0x4b')],'id');return _0x3cac7c['removeMailInteractions'](_0x50e74c)[_0x7623('0xd')](function(){for(var _0x127b7a=0x0;_0x127b7a<_0x50e74c['length'];_0x127b7a+=0x1){_0x3916cf['emit']('user_has_mail_interactions:remove',{'MailInteractionId':Number(_0x50e74c[_0x127b7a]),'UserId':Number(_0x3cac7c['id'])});}});}})[_0x7623('0xd')](function(){if(_0x468d9e==='leave'){var _0x210dc0=_[_0x7623('0x19')](_0x3cac7c[_0x7623('0x24')],'id');return _0x3cac7c[_0x7623('0x4c')](_0x210dc0)['then'](function(){for(var _0x4fe226=0x0;_0x4fe226<_0x210dc0[_0x7623('0x1d')];_0x4fe226+=0x1){_0x3916cf[_0x7623('0x49')](_0x7623('0x4d'),{'FaxInteractionId':Number(_0x210dc0[_0x4fe226]),'UserId':Number(_0x3cac7c['id'])});}});}})[_0x7623('0xd')](function(){if(_0x468d9e==='leave'){var _0x45bf64=_[_0x7623('0x19')](_0x3cac7c[_0x7623('0x26')],'id');return _0x3cac7c[_0x7623('0x4e')](_0x45bf64)['then'](function(){for(var _0xc4d2db=0x0;_0xc4d2db<_0x45bf64[_0x7623('0x1d')];_0xc4d2db+=0x1){_0x3916cf[_0x7623('0x49')]('user_has_sms_interactions:remove',{'SmsInteractionId':Number(_0x45bf64[_0xc4d2db]),'UserId':Number(_0x3cac7c['id'])});}});}})[_0x7623('0xd')](function(){if(_0x468d9e===_0x7623('0x47')){var _0x2f7496=_[_0x7623('0x19')](_0x3cac7c['OpenchannelInteractions'],'id');return _0x3cac7c[_0x7623('0x4f')](_0x2f7496)[_0x7623('0xd')](function(){for(var _0x32df51=0x0;_0x32df51<_0x2f7496[_0x7623('0x1d')];_0x32df51+=0x1){_0x3916cf['emit'](_0x7623('0x50'),{'OpenchannelInteractionId':Number(_0x2f7496[_0x32df51]),'UserId':Number(_0x3cac7c['id'])});}});}})[_0x7623('0xd')](function(){if(_0x468d9e===_0x7623('0x47')){var _0x139e0e=_[_0x7623('0x19')](_0x3cac7c[_0x7623('0x29')],'id');return _0x3cac7c[_0x7623('0x51')](_0x139e0e)[_0x7623('0xd')](function(){for(var _0x215b8a=0x0;_0x215b8a<_0x139e0e[_0x7623('0x1d')];_0x215b8a+=0x1){_0x3916cf[_0x7623('0x49')](_0x7623('0x52'),{'WhatsappInteractionId':Number(_0x139e0e[_0x215b8a]),'UserId':Number(_0x3cac7c['id'])});}});}})[_0x7623('0x53')](function(_0x1625f8){_0x1bae9c[_0x7623('0x54')](_0x1625f8);});}}function onDisconnect(_0x5f51b0,_0x3eb026){joinOrLeave(_0x5f51b0,_0x7623('0x47'),_0x3eb026);}function onConnect(_0x3edbf2){joinOrLeave(_0x3edbf2,_0x7623('0x55'));}exports['default']=function(_0x2bc8e5){_0x2bc8e5['on'](_0x7623('0x56'),function(_0x485046){_0x485046[_0x7623('0x57')](0x0);_0x485046[_0x7623('0x58')]=_0x485046[_0x7623('0x59')][_0x7623('0x56')]['remoteAddress']+':'+_0x485046[_0x7623('0x59')][_0x7623('0x56')][_0x7623('0x5a')];_0x485046[_0x7623('0x5b')]=new Date();_0x485046[_0x7623('0x54')]=function(_0x2108b3){console['log'](_0x7623('0x5c')+_0x485046[_0x7623('0x5d')][_0x7623('0x5')]+'['+_0x485046[_0x7623('0x58')]+']',_0x2108b3);};_0x485046['on'](_0x7623('0x5e'),function(){onDisconnect(_0x485046,_0x2bc8e5);_0x485046[_0x7623('0x54')]('DISCONNECTED');});onConnect(_0x485046);_0x485046['log'](_0x7623('0x5f'));});}; \ No newline at end of file +var _0xe1d1=['removeSmsInteractions','user_has_sms_interactions:remove','removeWhatsappInteractions','user_has_whatsapp_interactions:remove','log','default','connection','request','remoteAddress','remotePort','connectedAt','nsp','disconnect','DISCONNECTED','lodash','util','../mysqldb','./environment','name','Agents','role','agent','telephone','type','ivr','UserProfileSection','findOne','then','autoAssociation','VoiceQueues','ChatQueues','SmsQueues','MailQueues','OpenchannelQueues','WhatsappQueues','findAll','Trunks','UserProfileResource','resourceId','map','User','where','Campaign','%s:queue:%s','length','format','handshake','find','query','ChatInteractions','MailInteraction','MailInteractions','FaxInteraction','FaxInteractions','SmsInteraction','SmsInteractions','OpenchannelInteractions','WhatsappInteraction','WhatsappInteractions','user:%s','admin','voice:outbound','hasOwnProperty','include','push','VoiceQueue','SmsQueue','MailQueue','WhatsappQueue','Trunk','user','voice:inbound','userProfileId','ChatQueue','FaxQueue','OpenchannelQueue','Telephones','IvrCampaigns','getChatQueues','getFaxQueues','getSmsQueues','getMailQueues','getOpenchannelQueues','voice','chat','fax','mail','openchannel','whatsapp','telephone:%s','trunk:%s','leave','removeChatInteractions','emit','removeMailInteractions','removeFaxInteractions','user_has_fax_interactions:remove'];(function(_0x40822a,_0x582b60){var _0x357420=function(_0x6cee0b){while(--_0x6cee0b){_0x40822a['push'](_0x40822a['shift']());}};_0x357420(++_0x582b60);}(_0xe1d1,0x131));var _0x1e1d=function(_0x32b542,_0x4512fa){_0x32b542=_0x32b542-0x0;var _0x554d54=_0xe1d1[_0x32b542];return _0x554d54;};'use strict';var _=require(_0x1e1d('0x0'));var util=require(_0x1e1d('0x1'));var BPromise=require('bluebird');var db=require(_0x1e1d('0x2'))['db'];var config=require(_0x1e1d('0x3'));var queryQueues={'attributes':['id',_0x1e1d('0x4')],'include':[{'as':_0x1e1d('0x5'),'model':db['User'],'attributes':['id',_0x1e1d('0x4'),_0x1e1d('0x6')],'raw':!![],'where':{'role':_0x1e1d('0x7')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0x1e1d('0x4')],'where':{'role':_0x1e1d('0x8')}};var queryTrunks={'raw':!![],'attributes':['id',_0x1e1d('0x4')]};var queryAgents={'raw':!![],'attributes':['id','name'],'where':{'role':_0x1e1d('0x7')}};var queryCampaigns={'raw':!![],'attributes':['id',_0x1e1d('0x4'),_0x1e1d('0x9')],'where':{'type':_0x1e1d('0xa')}};function getAssociatedResources(_0x43277f,_0x20ab8a,_0x555af1){return db[_0x1e1d('0xb')][_0x1e1d('0xc')]({'where':{'name':_0x43277f,'userProfileId':_0x20ab8a},'raw':!![]})[_0x1e1d('0xd')](function(_0x272df7){if(_0x272df7){if(_0x272df7[_0x1e1d('0xe')]){switch(_0x43277f){case _0x1e1d('0xf'):case _0x1e1d('0x10'):case'FaxQueues':case _0x1e1d('0x11'):case _0x1e1d('0x12'):case _0x1e1d('0x13'):case _0x1e1d('0x14'):return db[_0x555af1][_0x1e1d('0x15')](queryQueues);case'Telephones':return db[_0x555af1][_0x1e1d('0x15')](queryTelephones);case _0x1e1d('0x16'):return db[_0x555af1][_0x1e1d('0x15')](queryTrunks);case'IvrCampaigns':return db[_0x555af1][_0x1e1d('0x15')](queryCampaigns);}}else{return db[_0x1e1d('0x17')][_0x1e1d('0x15')]({'attributes':[_0x1e1d('0x18')],'where':{'sectionId':_0x272df7['id']},'raw':!![]})[_0x1e1d('0xd')](function(_0x5c4ae1){if(_0x5c4ae1){var _0x16cdf5={'where':{'id':_[_0x1e1d('0x19')](_0x5c4ae1,_0x1e1d('0x18'))},'raw':!![]};switch(_0x555af1){case _0x1e1d('0x1a'):_0x16cdf5[_0x1e1d('0x1b')][_0x1e1d('0x6')]=_0x1e1d('0x8');break;case _0x1e1d('0x1c'):_0x16cdf5['where'][_0x1e1d('0x9')]='ivr';break;}return db[_0x555af1][_0x1e1d('0x15')](_0x16cdf5);}else{return[];}});}}else{return[];}})['then'](function(_0x2cb5ab){return _0x2cb5ab;});}function joinOrLeaveQueues(_0x35a4c2,_0x148d32,_0x309589,_0x3c4334){_0x35a4c2[_0x148d32](util['format'](_0x1e1d('0x1d'),_0x309589,_0x3c4334[_0x1e1d('0x4')]));if(_0x3c4334[_0x1e1d('0x5')]){for(var _0x48719c=0x0;_0x48719c<_0x3c4334['Agents'][_0x1e1d('0x1e')];_0x48719c+=0x1){_0x35a4c2[_0x148d32](util[_0x1e1d('0x1f')]('user:%s',_0x3c4334[_0x1e1d('0x5')][_0x48719c][_0x1e1d('0x4')]));}}}function joinOrLeave(_0x3b9e6e,_0x2d0789,_0xc0d6c0){var _0x59124f;if(_0x3b9e6e[_0x1e1d('0x20')]['query']['id']){db['User'][_0x1e1d('0x21')]({'attributes':['id',_0x1e1d('0x4'),'role','userProfileId'],'where':{'id':_0x3b9e6e[_0x1e1d('0x20')][_0x1e1d('0x22')]['id']},'include':[{'model':db['ChatInteraction'],'as':_0x1e1d('0x23'),'attributes':['id'],'raw':!![]},{'model':db[_0x1e1d('0x24')],'as':_0x1e1d('0x25'),'attributes':['id'],'raw':!![]},{'model':db[_0x1e1d('0x26')],'as':_0x1e1d('0x27'),'attributes':['id'],'raw':!![]},{'model':db[_0x1e1d('0x28')],'as':_0x1e1d('0x29'),'attributes':['id'],'raw':!![]},{'model':db['OpenchannelInteraction'],'as':_0x1e1d('0x2a'),'attributes':['id'],'raw':!![]},{'model':db[_0x1e1d('0x2b')],'as':_0x1e1d('0x2c'),'attributes':['id'],'raw':!![]}]})[_0x1e1d('0xd')](function(_0x5f2fc1){if(_0x5f2fc1){_0x59124f=_0x5f2fc1;_0x3b9e6e[_0x2d0789](util['format'](_0x1e1d('0x2d'),_0x5f2fc1[_0x1e1d('0x4')]));var _0x2d93e8=[];switch(_0x5f2fc1['role']){case _0x1e1d('0x2e'):_0x3b9e6e[_0x2d0789]('voice:inbound');_0x3b9e6e[_0x2d0789](_0x1e1d('0x2f'));if(queryQueues[_0x1e1d('0x30')](_0x1e1d('0x31'))){delete queryQueues[_0x1e1d('0x31')];}_0x2d93e8[_0x1e1d('0x32')](db[_0x1e1d('0x33')][_0x1e1d('0x15')](queryQueues));_0x2d93e8['push'](db['ChatQueue'][_0x1e1d('0x15')](queryQueues));_0x2d93e8['push'](db['FaxQueue'][_0x1e1d('0x15')](queryQueues));_0x2d93e8[_0x1e1d('0x32')](db[_0x1e1d('0x34')]['findAll'](queryQueues));_0x2d93e8[_0x1e1d('0x32')](db[_0x1e1d('0x35')][_0x1e1d('0x15')](queryQueues));_0x2d93e8['push'](db['OpenchannelQueue'][_0x1e1d('0x15')](queryQueues));_0x2d93e8[_0x1e1d('0x32')](db[_0x1e1d('0x36')]['findAll'](queryQueues));_0x2d93e8['push'](db[_0x1e1d('0x1a')][_0x1e1d('0x15')](queryTelephones));_0x2d93e8[_0x1e1d('0x32')](db[_0x1e1d('0x37')]['findAll'](queryTrunks));_0x2d93e8[_0x1e1d('0x32')](db['Campaign'][_0x1e1d('0x15')](queryCampaigns));_0x2d93e8['push'](db[_0x1e1d('0x1a')][_0x1e1d('0x15')](queryAgents));break;case _0x1e1d('0x38'):_0x3b9e6e[_0x2d0789](_0x1e1d('0x39'));_0x3b9e6e[_0x2d0789]('voice:outbound');_0x2d93e8[_0x1e1d('0x32')](getAssociatedResources('VoiceQueues',_0x5f2fc1[_0x1e1d('0x3a')],'VoiceQueue'));_0x2d93e8[_0x1e1d('0x32')](getAssociatedResources(_0x1e1d('0x10'),_0x5f2fc1[_0x1e1d('0x3a')],_0x1e1d('0x3b')));_0x2d93e8['push'](getAssociatedResources('FaxQueues',_0x5f2fc1['userProfileId'],_0x1e1d('0x3c')));_0x2d93e8[_0x1e1d('0x32')](getAssociatedResources('SmsQueues',_0x5f2fc1[_0x1e1d('0x3a')],_0x1e1d('0x34')));_0x2d93e8[_0x1e1d('0x32')](getAssociatedResources(_0x1e1d('0x12'),_0x5f2fc1['userProfileId'],_0x1e1d('0x35')));_0x2d93e8[_0x1e1d('0x32')](getAssociatedResources(_0x1e1d('0x13'),_0x5f2fc1['userProfileId'],_0x1e1d('0x3d')));_0x2d93e8['push'](getAssociatedResources(_0x1e1d('0x14'),_0x5f2fc1[_0x1e1d('0x3a')],'WhatsappQueue'));_0x2d93e8[_0x1e1d('0x32')](getAssociatedResources(_0x1e1d('0x3e'),_0x5f2fc1[_0x1e1d('0x3a')],_0x1e1d('0x1a')));_0x2d93e8[_0x1e1d('0x32')](getAssociatedResources('Trunks',_0x5f2fc1[_0x1e1d('0x3a')],'Trunk'));_0x2d93e8[_0x1e1d('0x32')](getAssociatedResources(_0x1e1d('0x3f'),_0x5f2fc1[_0x1e1d('0x3a')],_0x1e1d('0x1c')));_0x2d93e8['push'](db['User'][_0x1e1d('0x15')](queryAgents));break;case _0x1e1d('0x7'):_0x3b9e6e[_0x2d0789](_0x1e1d('0x39'));_0x3b9e6e[_0x2d0789](_0x1e1d('0x2f'));_0x2d93e8[_0x1e1d('0x32')](_0x5f2fc1['getVoiceQueues']({'attributes':['id',_0x1e1d('0x4')]}));_0x2d93e8['push'](_0x5f2fc1[_0x1e1d('0x40')]({'attributes':['id',_0x1e1d('0x4')]}));_0x2d93e8[_0x1e1d('0x32')](_0x5f2fc1[_0x1e1d('0x41')]({'attributes':['id',_0x1e1d('0x4')]}));_0x2d93e8[_0x1e1d('0x32')](_0x5f2fc1[_0x1e1d('0x42')]({'attributes':['id',_0x1e1d('0x4')]}));_0x2d93e8[_0x1e1d('0x32')](_0x5f2fc1[_0x1e1d('0x43')]({'attributes':['id',_0x1e1d('0x4')]}));_0x2d93e8[_0x1e1d('0x32')](_0x5f2fc1[_0x1e1d('0x44')]({'attributes':['id',_0x1e1d('0x4')]}));_0x2d93e8[_0x1e1d('0x32')](_0x5f2fc1['getWhatsappQueues']({'attributes':['id','name']}));break;}return BPromise['all'](_0x2d93e8);}})[_0x1e1d('0xd')](function(_0x3f5f84){if(_0x3f5f84&&_0x3f5f84[_0x1e1d('0x1e')]){for(var _0x4b2a34=0x0;_0x4b2a34<_0x3f5f84['length'];_0x4b2a34+=0x1){for(var _0x1cbb97=0x0;_0x1cbb97<_0x3f5f84[_0x4b2a34]['length'];_0x1cbb97+=0x1){switch(_0x4b2a34){case 0x0:joinOrLeaveQueues(_0x3b9e6e,_0x2d0789,_0x1e1d('0x45'),_0x3f5f84[_0x4b2a34][_0x1cbb97]);break;case 0x1:joinOrLeaveQueues(_0x3b9e6e,_0x2d0789,_0x1e1d('0x46'),_0x3f5f84[_0x4b2a34][_0x1cbb97]);break;case 0x2:joinOrLeaveQueues(_0x3b9e6e,_0x2d0789,_0x1e1d('0x47'),_0x3f5f84[_0x4b2a34][_0x1cbb97]);break;case 0x3:joinOrLeaveQueues(_0x3b9e6e,_0x2d0789,'sms',_0x3f5f84[_0x4b2a34][_0x1cbb97]);break;case 0x4:joinOrLeaveQueues(_0x3b9e6e,_0x2d0789,_0x1e1d('0x48'),_0x3f5f84[_0x4b2a34][_0x1cbb97]);break;case 0x5:joinOrLeaveQueues(_0x3b9e6e,_0x2d0789,_0x1e1d('0x49'),_0x3f5f84[_0x4b2a34][_0x1cbb97]);break;case 0x6:joinOrLeaveQueues(_0x3b9e6e,_0x2d0789,_0x1e1d('0x4a'),_0x3f5f84[_0x4b2a34][_0x1cbb97]);break;case 0x7:if(_0x59124f[_0x1e1d('0x6')]!==_0x1e1d('0x7'))_0x3b9e6e[_0x2d0789](util[_0x1e1d('0x1f')](_0x1e1d('0x4b'),_0x3f5f84[_0x4b2a34][_0x1cbb97][_0x1e1d('0x4')]));break;case 0x8:if(_0x59124f[_0x1e1d('0x6')]!==_0x1e1d('0x7'))_0x3b9e6e[_0x2d0789](util[_0x1e1d('0x1f')](_0x1e1d('0x4c'),_0x3f5f84[_0x4b2a34][_0x1cbb97][_0x1e1d('0x4')]));break;case 0x9:if(_0x59124f['role']!==_0x1e1d('0x7'))_0x3b9e6e[_0x2d0789](util['format']('campaign:%s:%s',_0x3f5f84[_0x4b2a34][_0x1cbb97][_0x1e1d('0x9')],_0x3f5f84[_0x4b2a34][_0x1cbb97][_0x1e1d('0x4')]));break;case 0xa:_0x3b9e6e[_0x2d0789](util[_0x1e1d('0x1f')](_0x1e1d('0x2d'),_0x3f5f84[_0x4b2a34][_0x1cbb97][_0x1e1d('0x4')]));break;}}}}})['then'](function(){if(_0x2d0789===_0x1e1d('0x4d')){var _0x39dc74=_[_0x1e1d('0x19')](_0x59124f[_0x1e1d('0x23')],'id');return _0x59124f[_0x1e1d('0x4e')](_0x39dc74)[_0x1e1d('0xd')](function(){for(var _0x28ec07=0x0;_0x28ec07<_0x39dc74[_0x1e1d('0x1e')];_0x28ec07+=0x1){_0xc0d6c0[_0x1e1d('0x4f')]('user_has_chat_interactions:remove',{'ChatInteractionId':Number(_0x39dc74[_0x28ec07]),'UserId':Number(_0x59124f['id'])});}});}})[_0x1e1d('0xd')](function(){if(_0x2d0789===_0x1e1d('0x4d')){var _0x340e90=_[_0x1e1d('0x19')](_0x59124f['MailInteractions'],'id');return _0x59124f[_0x1e1d('0x50')](_0x340e90)['then'](function(){for(var _0x163950=0x0;_0x163950<_0x340e90['length'];_0x163950+=0x1){_0xc0d6c0[_0x1e1d('0x4f')]('user_has_mail_interactions:remove',{'MailInteractionId':Number(_0x340e90[_0x163950]),'UserId':Number(_0x59124f['id'])});}});}})[_0x1e1d('0xd')](function(){if(_0x2d0789===_0x1e1d('0x4d')){var _0x2f9f9b=_[_0x1e1d('0x19')](_0x59124f[_0x1e1d('0x27')],'id');return _0x59124f[_0x1e1d('0x51')](_0x2f9f9b)[_0x1e1d('0xd')](function(){for(var _0x4ff526=0x0;_0x4ff526<_0x2f9f9b[_0x1e1d('0x1e')];_0x4ff526+=0x1){_0xc0d6c0[_0x1e1d('0x4f')](_0x1e1d('0x52'),{'FaxInteractionId':Number(_0x2f9f9b[_0x4ff526]),'UserId':Number(_0x59124f['id'])});}});}})['then'](function(){if(_0x2d0789===_0x1e1d('0x4d')){var _0x2cfca6=_[_0x1e1d('0x19')](_0x59124f[_0x1e1d('0x29')],'id');return _0x59124f[_0x1e1d('0x53')](_0x2cfca6)[_0x1e1d('0xd')](function(){for(var _0x33017c=0x0;_0x33017c<_0x2cfca6[_0x1e1d('0x1e')];_0x33017c+=0x1){_0xc0d6c0['emit'](_0x1e1d('0x54'),{'SmsInteractionId':Number(_0x2cfca6[_0x33017c]),'UserId':Number(_0x59124f['id'])});}});}})[_0x1e1d('0xd')](function(){if(_0x2d0789===_0x1e1d('0x4d')){var _0x205e7d=_[_0x1e1d('0x19')](_0x59124f[_0x1e1d('0x2a')],'id');return _0x59124f['removeOpenchannelInteractions'](_0x205e7d)[_0x1e1d('0xd')](function(){for(var _0x293ea7=0x0;_0x293ea7<_0x205e7d['length'];_0x293ea7+=0x1){_0xc0d6c0[_0x1e1d('0x4f')]('user_has_openchannel_interactions:remove',{'OpenchannelInteractionId':Number(_0x205e7d[_0x293ea7]),'UserId':Number(_0x59124f['id'])});}});}})[_0x1e1d('0xd')](function(){if(_0x2d0789==='leave'){var _0x5c297d=_[_0x1e1d('0x19')](_0x59124f['WhatsappInteractions'],'id');return _0x59124f[_0x1e1d('0x55')](_0x5c297d)[_0x1e1d('0xd')](function(){for(var _0x9b3808=0x0;_0x9b3808<_0x5c297d['length'];_0x9b3808+=0x1){_0xc0d6c0[_0x1e1d('0x4f')](_0x1e1d('0x56'),{'WhatsappInteractionId':Number(_0x5c297d[_0x9b3808]),'UserId':Number(_0x59124f['id'])});}});}})['catch'](function(_0x5b80f0){_0x3b9e6e[_0x1e1d('0x57')](_0x5b80f0);});}}function onDisconnect(_0x135519,_0x9c627){joinOrLeave(_0x135519,_0x1e1d('0x4d'),_0x9c627);}function onConnect(_0x378ed6){joinOrLeave(_0x378ed6,'join');}exports[_0x1e1d('0x58')]=function(_0x585955){_0x585955['on'](_0x1e1d('0x59'),function(_0x19cf0f){_0x19cf0f['setMaxListeners'](0x0);_0x19cf0f['address']=_0x19cf0f[_0x1e1d('0x5a')]['connection'][_0x1e1d('0x5b')]+':'+_0x19cf0f['request']['connection'][_0x1e1d('0x5c')];_0x19cf0f[_0x1e1d('0x5d')]=new Date();_0x19cf0f[_0x1e1d('0x57')]=function(_0x312763){console[_0x1e1d('0x57')]('SocketIO\x20'+_0x19cf0f[_0x1e1d('0x5e')][_0x1e1d('0x4')]+'['+_0x19cf0f['address']+']',_0x312763);};_0x19cf0f['on'](_0x1e1d('0x5f'),function(){onDisconnect(_0x19cf0f,_0x585955);_0x19cf0f['log'](_0x1e1d('0x60'));});onConnect(_0x19cf0f);_0x19cf0f['log']('CONNECTED');});}; \ No newline at end of file diff --git a/server/config/triggers/index.js b/server/config/triggers/index.js index fe26c68..4684378 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 _0xae19=['incomingmessage','outgoingmessage','opened','QueryTypes','interface','agent','closed','changed','substatus','query','AfterUpdate','find','fullname','email','internal','length','hasOwnProperty','model','callback','toLowerCase','condition','util','../../mysqldb','jayson/promise','client','http','ChatInteraction','afterCreate','newinteraction','Chat','afterUpdate','closedinteraction','newmessage','ChatOfflineMessage','Sms','SmsInteraction','SmsMessage','WhatsappInteraction','Whatsapp','Fax','FaxInteraction','FaxMessage','MailInteraction','Mail','MailMessage','Openchannel','OpenchannelInteraction','OpenchannelMessage','request','then','Trigger,\x20%s','EventManager','error','catch','get','channel','motionChannel','event','direction','resolve','ContactId','undefined','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','SELECT','contact','UserId','format','SIP/%s','name'];(function(_0x644c09,_0x3030c8){var _0x19b575=function(_0x2fd854){while(--_0x2fd854){_0x644c09['push'](_0x644c09['shift']());}};_0x19b575(++_0x3030c8);}(_0xae19,0xa3));var _0x9ae1=function(_0x54a2e4,_0x1ff92c){_0x54a2e4=_0x54a2e4-0x0;var _0x4742d0=_0xae19[_0x54a2e4];return _0x4742d0;};'use strict';var util=require(_0x9ae1('0x0'));var db=require(_0x9ae1('0x1'))['db'];var jayson=require(_0x9ae1('0x2'));var logger=require('../logger')('triggers');var client=jayson[_0x9ae1('0x3')][_0x9ae1('0x4')]({'port':0x232a});var triggers=[{'channel':'Chat','model':_0x9ae1('0x5'),'event':_0x9ae1('0x6'),'condition':_0x9ae1('0x7'),'callback':afterCreate},{'channel':_0x9ae1('0x8'),'model':_0x9ae1('0x5'),'event':_0x9ae1('0x9'),'condition':_0x9ae1('0xa'),'callback':afterUpdate},{'channel':_0x9ae1('0x8'),'model':'ChatMessage','event':_0x9ae1('0x6'),'condition':_0x9ae1('0xb'),'callback':afterCreateMessage},{'channel':'Chat','model':_0x9ae1('0xc'),'event':'afterCreate','condition':_0x9ae1('0xb'),'callback':afterCreateOfflineMessage},{'channel':_0x9ae1('0xd'),'model':_0x9ae1('0xe'),'event':_0x9ae1('0x6'),'condition':_0x9ae1('0x7'),'callback':afterCreate},{'channel':_0x9ae1('0xd'),'model':_0x9ae1('0xe'),'event':_0x9ae1('0x9'),'condition':'closedinteraction','callback':afterUpdate},{'channel':_0x9ae1('0xd'),'model':_0x9ae1('0xf'),'event':_0x9ae1('0x6'),'condition':'newmessage','callback':afterCreateMessage},{'channel':'Whatsapp','model':_0x9ae1('0x10'),'event':_0x9ae1('0x6'),'condition':_0x9ae1('0x7'),'callback':afterCreate},{'channel':_0x9ae1('0x11'),'model':_0x9ae1('0x10'),'event':'afterUpdate','condition':_0x9ae1('0xa'),'callback':afterUpdate},{'channel':_0x9ae1('0x11'),'model':'WhatsappMessage','event':_0x9ae1('0x6'),'condition':_0x9ae1('0xb'),'callback':afterCreateMessage},{'channel':_0x9ae1('0x12'),'model':_0x9ae1('0x13'),'event':_0x9ae1('0x6'),'condition':_0x9ae1('0x7'),'callback':afterCreate},{'channel':_0x9ae1('0x12'),'model':_0x9ae1('0x13'),'event':'afterUpdate','condition':'closedinteraction','callback':afterUpdate},{'channel':_0x9ae1('0x12'),'model':_0x9ae1('0x14'),'event':_0x9ae1('0x6'),'condition':_0x9ae1('0xb'),'callback':afterCreateMessage},{'channel':'Mail','model':_0x9ae1('0x15'),'event':_0x9ae1('0x6'),'condition':'newinteraction','callback':afterCreate},{'channel':_0x9ae1('0x16'),'model':_0x9ae1('0x15'),'event':_0x9ae1('0x9'),'condition':'closedinteraction','callback':afterUpdate},{'channel':'Mail','model':_0x9ae1('0x17'),'event':_0x9ae1('0x6'),'condition':'newmessage','callback':afterCreateMessage},{'channel':_0x9ae1('0x18'),'model':_0x9ae1('0x19'),'event':'afterCreate','condition':_0x9ae1('0x7'),'callback':afterCreate},{'channel':_0x9ae1('0x18'),'model':_0x9ae1('0x19'),'event':_0x9ae1('0x9'),'condition':'closedinteraction','callback':afterUpdate},{'channel':_0x9ae1('0x18'),'model':_0x9ae1('0x1a'),'event':_0x9ae1('0x6'),'condition':_0x9ae1('0xb'),'callback':afterCreateMessage}];function request(_0xba6a50){return client[_0x9ae1('0x1b')]('EventManager',_0xba6a50)[_0x9ae1('0x1c')](function(_0x523781){logger['info'](_0x9ae1('0x1d'),_0x9ae1('0x1e'),_0x523781);if(_0x523781[_0x9ae1('0x1f')]){if(_0x523781['error']['code']===0x1f4){logger[_0x9ae1('0x1f')](_0x9ae1('0x1d'),_0x9ae1('0x1e'),_0x523781[_0x9ae1('0x1f')]);}}})[_0x9ae1('0x20')](function(_0x5071f0){logger[_0x9ae1('0x1f')](_0x9ae1('0x1d'),'EventManager',_0x5071f0);});}function afterCreateMessage(_0x131517){return function(_0xd0247a){_0xd0247a=_0xd0247a[_0x9ae1('0x21')]({'plain':!![]});_0xd0247a[_0x9ae1('0x22')]=_0x131517;_0xd0247a[_0x9ae1('0x23')]=_0x131517;_0xd0247a[_0x9ae1('0x24')]=_0xd0247a[_0x9ae1('0x25')];Promise[_0x9ae1('0x26')]()['then'](function(){if(typeof _0xd0247a[_0x9ae1('0x27')]===_0x9ae1('0x28'))return null;var _0x9278ae=_0x9ae1('0x29')+_0xd0247a[_0x9ae1('0x27')];return db[_0x9ae1('0x2a')]['query'](_0x9278ae,{'type':db[_0x9ae1('0x2b')]['QueryTypes'][_0x9ae1('0x2c')],'raw':!![]});})[_0x9ae1('0x1c')](function(_0x4409e0){if(_0x4409e0){_0xd0247a[_0x9ae1('0x2d')]=_0x4409e0[0x0];}if(typeof _0xd0247a[_0x9ae1('0x2e')]===_0x9ae1('0x28'))return;return getAgent(_0xd0247a[_0x9ae1('0x2e')]);})[_0x9ae1('0x1c')](function(_0x43211e){if(_0x43211e){_0xd0247a['interface']=util[_0x9ae1('0x2f')](_0x9ae1('0x30'),_0x43211e[_0x9ae1('0x31')]);_0xd0247a['agent']=_0x43211e;_0xd0247a[_0x9ae1('0x22')]=_0x131517;return request({'event':_0x9ae1('0x32'),'message':_0xd0247a});}else{return request({'event':_0x9ae1('0x33'),'message':_0xd0247a});}})[_0x9ae1('0x20')](function(_0x205e4e){logger[_0x9ae1('0x1f')]('Trigger,\x20%s','AfterCreateMessage',_0x205e4e);});};}function afterCreateOfflineMessage(_0x3a3baf){return function(_0x2615b3){_0x2615b3=_0x2615b3['get']({'plain':!![]});_0x2615b3['channel']=_0x3a3baf;_0x2615b3[_0x9ae1('0x23')]=_0x3a3baf;_0x2615b3[_0x9ae1('0x24')]='offlineMessage';return request({'event':_0x2615b3['event'],'message':_0x2615b3});};}function afterCreate(_0x56b19f,_0x26d7b7){return function(_0x347592){_0x347592=_0x347592['get']({'plain':!![]});_0x347592['channel']=_0x56b19f;_0x347592[_0x9ae1('0x23')]=_0x56b19f;_0x347592[_0x9ae1('0x24')]=_0x9ae1('0x34');Promise[_0x9ae1('0x26')]()['then'](function(){var _0x4ea061=_0x9ae1('0x29')+_0x347592[_0x9ae1('0x27')];return db[_0x9ae1('0x2a')]['query'](_0x4ea061,{'type':db[_0x9ae1('0x2b')][_0x9ae1('0x35')]['SELECT'],'raw':!![]});})[_0x9ae1('0x1c')](function(_0x2dab61){if(_0x2dab61){_0x347592[_0x9ae1('0x2d')]=_0x2dab61[0x0];}if(typeof _0x347592[_0x9ae1('0x2e')]===_0x9ae1('0x28'))return;return getAgent(_0x347592[_0x9ae1('0x2e')]);})[_0x9ae1('0x1c')](function(_0x5ce97a){if(_0x5ce97a){_0x347592[_0x9ae1('0x36')]=util[_0x9ae1('0x2f')](_0x9ae1('0x30'),_0x5ce97a[_0x9ae1('0x31')]);_0x347592[_0x9ae1('0x37')]=_0x5ce97a;}return request({'event':_0x26d7b7,'message':_0x347592});})[_0x9ae1('0x20')](function(_0x4f663c){logger[_0x9ae1('0x1f')](_0x9ae1('0x1d'),'AfterCreate',_0x4f663c);});};}function afterUpdate(_0x161649){return function(_0x43449d){var _0x2c7384=_0x43449d['changed'](_0x9ae1('0x38'))&&_0x43449d[_0x9ae1('0x38')];var _0x36e3e2=_0x43449d[_0x9ae1('0x39')](_0x9ae1('0x3a'));if(_0x2c7384||_0x36e3e2){var _0x4bc08e=_0x2c7384?_0x9ae1('0xa'):_0x9ae1('0x3a');var _0x57efc2=_0x43449d[_0x9ae1('0x21')]({'plain':!![]});_0x57efc2[_0x9ae1('0x22')]=_0x161649;_0x57efc2['motionChannel']=_0x161649;_0x57efc2[_0x9ae1('0x24')]=_0x2c7384?'closed':_0x9ae1('0x3a');var _0x262f78=_0x9ae1('0x29')+_0x57efc2[_0x9ae1('0x27')];return db[_0x9ae1('0x2a')][_0x9ae1('0x3b')](_0x262f78,{'type':db[_0x9ae1('0x2b')][_0x9ae1('0x35')][_0x9ae1('0x2c')],'raw':!![]})[_0x9ae1('0x1c')](function(_0x39830b){if(_0x39830b){_0x57efc2['contact']=_0x39830b[0x0];}if(typeof _0x57efc2['UserId']===_0x9ae1('0x28'))return;return getAgent(_0x57efc2[_0x9ae1('0x2e')]);})[_0x9ae1('0x1c')](function(_0x139d76){if(_0x139d76){_0x57efc2['interface']=util[_0x9ae1('0x2f')](_0x9ae1('0x30'),_0x139d76['name']);_0x57efc2['agent']=_0x139d76;}return request({'event':_0x4bc08e,'message':_0x57efc2});})['catch'](function(_0xcd32f1){logger['error'](_0x9ae1('0x1d'),_0x9ae1('0x3c'),_0xcd32f1);});}};}function getAgent(_0x49e235){return db['User'][_0x9ae1('0x3d')]({'where':{'id':_0x49e235},'attributes':['id',_0x9ae1('0x31'),_0x9ae1('0x3e'),_0x9ae1('0x3f'),_0x9ae1('0x40')],'raw':!![]})[_0x9ae1('0x1c')](function(_0x269517){return _0x269517;});}exports['default']=function(){for(var _0x4a6b6f=0x0;_0x4a6b6f=_0x2a781c[_0xf735('0x12')]){throw Error(_0xf735('0x13'));}_0x197515(_0x496799);})[_0xf735('0x14')](function(_0x22b3df){_0x4731de(_0x22b3df);});});}; \ No newline at end of file +var _0x1cc3=['./license/util','voice','mail','chat','fax','openchannel','getChannels','isValidChannel','includes','clearBlockUser','isUndefined','blockedAt','updateAttributes','role','agent','then','getLicense','agents','Maximum\x20login\x20has\x20been\x20reached','lodash','../mysqldb'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x1cc3,0x1cc));var _0x31cc=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x1cc3[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0x31cc('0x0'));var BPromise=require('bluebird');var db=require(_0x31cc('0x1'))['db'];var util=require(_0x31cc('0x2'));var channels=[_0x31cc('0x3'),_0x31cc('0x4'),_0x31cc('0x5'),_0x31cc('0x6'),'sms','whatsapp',_0x31cc('0x7')];exports[_0x31cc('0x8')]=function(){return channels;};exports[_0x31cc('0x9')]=function(_0x536654){_0x536654=_0x536654['toLowerCase']();return _[_0x31cc('0xa')](channels,_0x536654);};exports[_0x31cc('0xb')]=function(_0x515c8b,_0x30a198,_0x38035f,_0x4c9e56){var _0x15e92b={'loginAttempts':_0x30a198,'blocked':_0x38035f};if(!_[_0x31cc('0xc')](_0x4c9e56)){_0x15e92b[_0x31cc('0xd')]=_0x4c9e56;}return _0x515c8b[_0x31cc('0xe')](_0x15e92b);};exports['getLicense']=function(_0x6aac96){return new BPromise(function(_0x189ab3,_0x2234dc){var _0x187c30=0x0;if(_0x6aac96[_0x31cc('0xf')]!==_0x31cc('0x10')){_0x189ab3(_0x6aac96);}db['User']['count']({'where':{'role':_0x31cc('0x10'),'online':!![],'id':{'$ne':_0x6aac96['id']}}})[_0x31cc('0x11')](function(_0x4d5755){_0x187c30=_0x4d5755;return util[_0x31cc('0x12')]();})[_0x31cc('0x11')](function(_0x471515){if(_0x471515&&_0x471515[_0x31cc('0x13')]&&_0x187c30>=_0x471515[_0x31cc('0x13')]){throw Error(_0x31cc('0x14'));}_0x189ab3(_0x6aac96);})['catch'](function(_0x296ce3){_0x2234dc(_0x296ce3);});});}; \ No newline at end of file diff --git a/server/errors/api.js b/server/errors/api.js index abfa9b9..62b7b24 100644 --- a/server/errors/api.js +++ b/server/errors/api.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['Bad\x20Request','Forbidden','Out\x20Of\x20Interval','Not\x20Found','error','stack','statusMessage','status','send','exports','util','../config/logger','api','message','name','Error','inherits','Entity\x20not\x20found'];(function(_0x1a8281,_0x2be286){var _0x15aee6=function(_0x134864){while(--_0x134864){_0x1a8281['push'](_0x1a8281['shift']());}};_0x15aee6(++_0x2be286);}(_0x7a54,0x106));var _0x47a5=function(_0x5b8404,_0x4f1d3e){_0x5b8404=_0x5b8404-0x0;var _0x4c37c9=_0x7a54[_0x5b8404];return _0x4c37c9;};'use strict';var util=require(_0x47a5('0x0'));var logger=require(_0x47a5('0x1'))(_0x47a5('0x2'));var APIError=function(_0x58157c,_0x1d33e){this[_0x47a5('0x3')]=_0x58157c||'Internal\x20Server\x20Error';this[_0x47a5('0x4')]=_0x1d33e||_0x47a5('0x5');util[_0x47a5('0x6')](APIError,Error);};var APIBadRequestError=function(_0x3717e1){this[_0x47a5('0x3')]=_0x3717e1||'Bad\x20Request';this[_0x47a5('0x4')]='Bad\x20Request';util[_0x47a5('0x6')](APIBadRequestError,APIError);};var APINotFoundError=function(_0x30e405){this['message']=_0x30e405||_0x47a5('0x7');this['name']='Not\x20Found';util['inherits'](APINotFoundError,APIError);};var APIOutOfIntervalError=function(_0x2a0e98){this[_0x47a5('0x3')]=_0x2a0e98||'Message\x20sent\x20outside\x20a\x20valid\x20interval';this[_0x47a5('0x4')]='Out\x20Of\x20Interval';util['inherits'](APIOutOfIntervalError,APIError);};function getStatusCode(_0x1f47f4){switch(_0x1f47f4){case _0x47a5('0x8'):return 0x190;case _0x47a5('0x9'),_0x47a5('0xa'):return 0x193;case _0x47a5('0xb'):return 0x194;default:return 0x1f4;}}function getCustomStatusMessage(_0xd308b8){if(_0xd308b8===_0x47a5('0xa'))return _0xd308b8;return null;}function handleError(_0x5beb89){return function(_0x44bd3e){logger[_0x47a5('0xc')](_0x44bd3e[_0x47a5('0xd')]);var _0x711793=getStatusCode(_0x44bd3e[_0x47a5('0x4')]);var _0x620ee9=getCustomStatusMessage(_0x44bd3e[_0x47a5('0x4')]);if(_0x44bd3e[_0x47a5('0x4')])delete _0x44bd3e['name'];if(_0x620ee9)_0x5beb89[_0x47a5('0xe')]=_0x620ee9;return _0x5beb89[_0x47a5('0xf')](_0x711793)[_0x47a5('0x10')](_0x44bd3e);};}module[_0x47a5('0x11')]={'APIError':APIError,'APIBadRequestError':APIBadRequestError,'APIOutOfIntervalError':APIOutOfIntervalError,'APINotFoundError':APINotFoundError,'handleError':handleError}; \ No newline at end of file +var _0xe14b=['Out\x20Of\x20Interval','Forbidden','error','stack','statusMessage','status','send','util','../config/logger','message','name','Bad\x20Request','inherits','Not\x20Found'];(function(_0x42edc7,_0x4329a5){var _0x223305=function(_0x12dc24){while(--_0x12dc24){_0x42edc7['push'](_0x42edc7['shift']());}};_0x223305(++_0x4329a5);}(_0xe14b,0x93));var _0xbe14=function(_0x507e09,_0x2bbd76){_0x507e09=_0x507e09-0x0;var _0x1510ff=_0xe14b[_0x507e09];return _0x1510ff;};'use strict';var util=require(_0xbe14('0x0'));var logger=require(_0xbe14('0x1'))('api');var APIError=function(_0x5cc4d8,_0x11c3a0){this[_0xbe14('0x2')]=_0x5cc4d8||'Internal\x20Server\x20Error';this[_0xbe14('0x3')]=_0x11c3a0||'Error';util['inherits'](APIError,Error);};var APIBadRequestError=function(_0x1833e3){this[_0xbe14('0x2')]=_0x1833e3||_0xbe14('0x4');this[_0xbe14('0x3')]=_0xbe14('0x4');util[_0xbe14('0x5')](APIBadRequestError,APIError);};var APINotFoundError=function(_0x196fca){this['message']=_0x196fca||'Entity\x20not\x20found';this['name']=_0xbe14('0x6');util[_0xbe14('0x5')](APINotFoundError,APIError);};var APIOutOfIntervalError=function(_0xd68cd7){this[_0xbe14('0x2')]=_0xd68cd7||'Message\x20sent\x20outside\x20a\x20valid\x20interval';this['name']=_0xbe14('0x7');util[_0xbe14('0x5')](APIOutOfIntervalError,APIError);};function getStatusCode(_0x4935cc){switch(_0x4935cc){case _0xbe14('0x4'):return 0x190;case _0xbe14('0x8'),_0xbe14('0x7'):return 0x193;case _0xbe14('0x6'):return 0x194;default:return 0x1f4;}}function getCustomStatusMessage(_0x27792f){if(_0x27792f===_0xbe14('0x7'))return _0x27792f;return null;}function handleError(_0x23a730){return function(_0x2850cb){logger[_0xbe14('0x9')](_0x2850cb[_0xbe14('0xa')]);var _0x1e4826=getStatusCode(_0x2850cb[_0xbe14('0x3')]);var _0x813399=getCustomStatusMessage(_0x2850cb['name']);if(_0x2850cb['name'])delete _0x2850cb[_0xbe14('0x3')];if(_0x813399)_0x23a730[_0xbe14('0xb')]=_0x813399;return _0x23a730[_0xbe14('0xc')](_0x1e4826)[_0xbe14('0xd')](_0x2850cb);};}module['exports']={'APIError':APIError,'APIBadRequestError':APIBadRequestError,'APIOutOfIntervalError':APIOutOfIntervalError,'APINotFoundError':APINotFoundError,'handleError':handleError}; \ No newline at end of file diff --git a/server/errors/index.js b/server/errors/index.js index ff2568c..3213b15 100644 --- a/server/errors/index.js +++ b/server/errors/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7b4b=['render','json','send','exports','404','status'];(function(_0x598f77,_0x25fec7){var _0x4409d8=function(_0x1895b1){while(--_0x1895b1){_0x598f77['push'](_0x598f77['shift']());}};_0x4409d8(++_0x25fec7);}(_0x7b4b,0x141));var _0xb7b4=function(_0xb6e43,_0x1568fc){_0xb6e43=_0xb6e43-0x0;var _0x47c40f=_0x7b4b[_0xb6e43];return _0x47c40f;};'use strict';module[_0xb7b4('0x0')][0x194]=function pageNotFound(_0xdf46f2,_0x1b010d){var _0x5c3852=_0xb7b4('0x1');var _0x3df45f=0x194;var _0x1432f={'status':_0x3df45f};_0x1b010d['status'](_0x1432f[_0xb7b4('0x2')]);_0x1b010d[_0xb7b4('0x3')](_0x5c3852,{},function(_0x327d9e,_0x1341df){if(_0x327d9e){return _0x1b010d[_0xb7b4('0x2')](_0x1432f[_0xb7b4('0x2')])[_0xb7b4('0x4')](_0x1432f);}_0x1b010d[_0xb7b4('0x5')](_0x1341df);});}; \ No newline at end of file +var _0x307f=['send','exports','status','render','json'];(function(_0x31bca3,_0x209a1e){var _0x2f10ea=function(_0x248a36){while(--_0x248a36){_0x31bca3['push'](_0x31bca3['shift']());}};_0x2f10ea(++_0x209a1e);}(_0x307f,0x1af));var _0xf307=function(_0x4bf734,_0x2ea3bf){_0x4bf734=_0x4bf734-0x0;var _0x121881=_0x307f[_0x4bf734];return _0x121881;};'use strict';module[_0xf307('0x0')][0x194]=function pageNotFound(_0x303497,_0x42d7ac){var _0x303b9d='404';var _0xbcf641=0x194;var _0x5696f7={'status':_0xbcf641};_0x42d7ac[_0xf307('0x1')](_0x5696f7['status']);_0x42d7ac[_0xf307('0x2')](_0x303b9d,{},function(_0x2de726,_0x19566e){if(_0x2de726){return _0x42d7ac[_0xf307('0x1')](_0x5696f7['status'])[_0xf307('0x3')](_0x5696f7);}_0x42d7ac[_0xf307('0x4')](_0x19566e);});}; \ No newline at end of file diff --git a/server/mysqldb/index.js b/server/mysqldb/index.js index c8dd347..50cbd04 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(_0x5a7112,_0x1f9492){var _0x3147f7=function(_0x4d2329){while(--_0x4d2329){_0x5a7112['push'](_0x5a7112['shift']());}};_0x3147f7(++_0x1f9492);}(_0xa9e0,0x123));var _0x0a9e=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xa9e0[_0x14add3];return _0x4a174f;};'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(_0x5a7d41,_0x4447e2){var _0x98d8fa=function(_0x2ce1cf){while(--_0x2ce1cf){_0x5a7d41['push'](_0x5a7d41['shift']());}};_0x98d8fa(++_0x4447e2);}(_0xa9e0,0x123));var _0x0a9e=function(_0x298ed3,_0x4ab5e1){_0x298ed3=_0x298ed3-0x0;var _0x5aad28=_0xa9e0[_0x298ed3];return _0x5aad28;};'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 705d9a5..5d61d54 100644 --- a/server/routes.js +++ b/server/routes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdecb=['./api/mailInteraction','/api/mail/messages','./api/mailMessage','/api/mail/applications','./api/mailApplication','/api/mail/reports/queue','./api/mailQueueReport','/api/dashboards','./api/dashboard','./api/faxAccount','/api/fax/applications','./api/faxApplication','./api/faxInteraction','/api/fax/messages','./api/faxMessage','/api/fax/queues','./api/faxQueue','/api/fax/reports/queue','/api/sms/accounts','./api/smsAccount','/api/sms/applications','/api/sms/interactions','./api/smsInteraction','./api/smsMessage','/api/sms/queues','./api/smsQueue','/api/openchannel/accounts','/api/openchannel/applications','./api/openchannelApplication','/api/openchannel/interactions','/api/openchannel/messages','./api/openchannelQueue','./api/openchannelQueueReport','/api/chat/applications','./api/chatApplication','/api/chat/interactions','/api/chat/offline_messages','./api/chatOfflineMessage','/api/chat/queues','/api/chat/groups','./api/chatGroup','/api/chat/proactive_actions','./api/chatProactiveAction','/api/cm/companies','./api/cmCompany','/api/cm/contacts','/api/cm/hopper','./api/cmHopper','/api/cm/hopper_black','./api/cmHopperBlack','./api/cmHopperFinal','/api/cm/hopper_history','./api/cmHopperHistory','./api/cmCustomField','/api/actions','/api/automations','/api/canned_answers','./api/cannedAnswer','/api/dispositions','./api/disposition','/api/conditions','./api/condition','/api/intervals','./api/interval','/api/pauses','./api/pause','/api/cdr','./api/cdr','/api/voiceQueuesLog','./api/schedule','/api/sounds','./api/sound','/api/contact_item_types','./api/contactItemType','/api/cm_contact_has_items','./api/cmContactHasItem','/api/cm_hopper_additional_phones','./api/cmHopperAdditionalPhone','/api/triggers','./api/trigger','/api/variables','./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/analytics/field_reports','./api/analyticFieldReport','/api/analytics/tree_reports','./api/analyticTreeReport','/api/integrations/salesforce/accounts','/api/integrations/salesforce/configurations','/api/integrations/salesforce/fields','./api/intSalesforceField','/api/integrations/sugarcrm/accounts','./api/intSugarcrmConfiguration','/api/integrations/sugarcrm/fields','./api/intSugarcrmField','/api/integrations/desk/accounts','./api/intDeskAccount','/api/integrations/desk/configurations','./api/intDeskField','/api/integrations/zoho/accounts','./api/intZohoAccount','./api/intZohoConfiguration','/api/integrations/zoho/fields','./api/intZendeskAccount','/api/integrations/zendesk/configurations','/api/integrations/zendesk/fields','./api/intZendeskField','/api/integrations/freshdesk/accounts','./api/intFreshdeskAccount','./api/intFreshdeskConfiguration','/api/integrations/freshdesk/fields','./api/intFreshdeskField','./api/intVtigerAccount','/api/integrations/vtiger/configurations','./api/intVtigerConfiguration','/api/integrations/vtiger/fields','./api/intVtigerField','/api/integrations/servicenow/configurations','./api/intServicenowConfiguration','/api/integrations/servicenow/fields','./api/intServicenowField','/api/integrations/dynamics365/accounts','./api/intDynamics365Account','/api/integrations/dynamics365/configurations','/api/integrations/dynamics365/fields','./api/intDynamics365Field','/api/integrations/freshsales/configurations','/api/integrations/freshsales/fields','./api/intFreshsalesField','./api/chatQueueReport','/api/jscripty/answers/reports','./api/jscriptyAnswerReport','/api/jscripty/questions/reports','./api/jscriptyQuestionReport','/api/jscripty/sessions/reports','./api/jscriptySessionReport','/api/sms/reports/queue','./api/jscriptyProject','/api/settings','./api/setting','/api/square/odbc','./api/squareOdbc','/api/square/projects','./api/squareProject','/api/square/recordings','./api/squareRecording','/api/square/messages','./api/squareMessage','/api/teams','./api/team','/api/license','./api/license','/api/campaigns','./api/campaign','/api/migrations','./api/migration','/api/attachments','./api/attachment','/api/plugins','/api/mail/reports/transfer','./api/mailTransferReport','./api/chatTransferReport','./api/faxTransferReport','/api/sms/reports/transfer','/api/cm/lists','./api/cmList','/api/voice/prefixes','./api/voicePrefix','/api/userProfiles','./api/userProfile','./api/userProfileSection','./api/userProfileResource','/api/userNotifications','./api/userNotification','./api/whatsappAccount','./api/whatsappApplication','./api/whatsappInteraction','/api/whatsapp/messages','./api/whatsappMessage','/api/whatsapp/reports/queue','./api/whatsappQueue','/api/cloudProviders','./api/cloudProvider','/api/realtime','./api/realtime','/api/user-settings','./api/user-setting','/api/auth/local','./api/authLocal','/api/auth/google','/api/auth/activedirectory','./api/authActiveDirectory','/api/jira','./api/jira','/api/rpc','/api/version','./api/version','/api/system','./api/system','/api/pm2','./api/pm2','/api/webbar','/apidoc','static','join','/www','root','/demo','/snippet','snippet','/plugins','/server/files/plugins','route','get','sendFile','appPath','/index.html','express','./errors','./config/environment','setupLoggers','default','then','use','/api/users','./api/user','./api/voiceChanSpy','/api/voice/contexts','./api/voiceContext','/api/voice/extensions','./api/voiceExtension','./api/voiceMusicOnHold','/api/voice/queues','./api/voiceQueue','/api/voice/recordings','./api/voiceRecording','./api/screenRecording','/api/voice/mails','./api/voiceMail','/api/voice/mails/messages','./api/voiceMailMessage','/api/voice/calls/reports','./api/voiceCallReport','/api/voice/dials/reports','/api/voice/agents/reports','./api/voiceAgentReport','/api/voice/queues/reports','./api/voiceQueueReport','/api/members/reports','./api/memberReport','/api/trunks','/api/voice/transfers/reports','./api/voiceTransferReport','/api/mail/out_servers','./api/mailServerOut','/api/mail/accounts','./api/mailSubstatus','/api/mail/interactions'];(function(_0x582d98,_0x2ccd6e){var _0x512006=function(_0x5747a0){while(--_0x5747a0){_0x582d98['push'](_0x582d98['shift']());}};_0x512006(++_0x2ccd6e);}(_0xdecb,0xe2));var _0xbdec=function(_0x4d3b0c,_0x24d811){_0x4d3b0c=_0x4d3b0c-0x0;var _0x10f2ab=_0xdecb[_0x4d3b0c];return _0x10f2ab;};'use strict';var path=require('path');var express=require(_0xbdec('0x0'));var errors=require(_0xbdec('0x1'));var config=require(_0xbdec('0x2'));var setupLoggers=require('./utils/client-side-logger')[_0xbdec('0x3')];var clientSideLogs=require('./api/client-side-logs');exports[_0xbdec('0x4')]=function(_0x17c436){return setupLoggers(_0x17c436)[_0xbdec('0x5')](function(){_0x17c436[_0xbdec('0x6')](_0xbdec('0x7'),require(_0xbdec('0x8')));_0x17c436[_0xbdec('0x6')]('/api/voice/chanspy',require(_0xbdec('0x9')));_0x17c436[_0xbdec('0x6')](_0xbdec('0xa'),require(_0xbdec('0xb')));_0x17c436[_0xbdec('0x6')](_0xbdec('0xc'),require(_0xbdec('0xd')));_0x17c436[_0xbdec('0x6')]('/api/voice/mohs',require(_0xbdec('0xe')));_0x17c436[_0xbdec('0x6')](_0xbdec('0xf'),require(_0xbdec('0x10')));_0x17c436['use'](_0xbdec('0x11'),require(_0xbdec('0x12')));_0x17c436[_0xbdec('0x6')]('/api/screen/recordings',require(_0xbdec('0x13')));_0x17c436[_0xbdec('0x6')](_0xbdec('0x14'),require(_0xbdec('0x15')));_0x17c436[_0xbdec('0x6')](_0xbdec('0x16'),require(_0xbdec('0x17')));_0x17c436[_0xbdec('0x6')](_0xbdec('0x18'),require(_0xbdec('0x19')));_0x17c436[_0xbdec('0x6')](_0xbdec('0x1a'),require('./api/voiceDialReport'));_0x17c436[_0xbdec('0x6')](_0xbdec('0x1b'),require(_0xbdec('0x1c')));_0x17c436[_0xbdec('0x6')](_0xbdec('0x1d'),require(_0xbdec('0x1e')));_0x17c436[_0xbdec('0x6')](_0xbdec('0x1f'),require(_0xbdec('0x20')));_0x17c436['use'](_0xbdec('0x21'),require('./api/trunk'));_0x17c436['use'](_0xbdec('0x22'),require(_0xbdec('0x23')));_0x17c436[_0xbdec('0x6')](_0xbdec('0x24'),require(_0xbdec('0x25')));_0x17c436['use'](_0xbdec('0x26'),require('./api/mailAccount'));_0x17c436[_0xbdec('0x6')]('/api/mail/queues',require('./api/mailQueue'));_0x17c436[_0xbdec('0x6')]('/api/mail/substatuses',require(_0xbdec('0x27')));_0x17c436['use'](_0xbdec('0x28'),require(_0xbdec('0x29')));_0x17c436[_0xbdec('0x6')](_0xbdec('0x2a'),require(_0xbdec('0x2b')));_0x17c436['use'](_0xbdec('0x2c'),require(_0xbdec('0x2d')));_0x17c436[_0xbdec('0x6')](_0xbdec('0x2e'),require(_0xbdec('0x2f')));_0x17c436[_0xbdec('0x6')](_0xbdec('0x30'),require(_0xbdec('0x31')));_0x17c436[_0xbdec('0x6')]('/api/dashboards/items',require('./api/dashboardItem'));_0x17c436['use']('/api/fax/accounts',require(_0xbdec('0x32')));_0x17c436[_0xbdec('0x6')](_0xbdec('0x33'),require(_0xbdec('0x34')));_0x17c436[_0xbdec('0x6')]('/api/fax/interactions',require(_0xbdec('0x35')));_0x17c436[_0xbdec('0x6')](_0xbdec('0x36'),require(_0xbdec('0x37')));_0x17c436['use'](_0xbdec('0x38'),require(_0xbdec('0x39')));_0x17c436[_0xbdec('0x6')](_0xbdec('0x3a'),require('./api/faxQueueReport'));_0x17c436[_0xbdec('0x6')](_0xbdec('0x3b'),require(_0xbdec('0x3c')));_0x17c436['use'](_0xbdec('0x3d'),require('./api/smsApplication'));_0x17c436['use'](_0xbdec('0x3e'),require(_0xbdec('0x3f')));_0x17c436['use']('/api/sms/messages',require(_0xbdec('0x40')));_0x17c436[_0xbdec('0x6')](_0xbdec('0x41'),require(_0xbdec('0x42')));_0x17c436[_0xbdec('0x6')](_0xbdec('0x43'),require('./api/openchannelAccount'));_0x17c436['use'](_0xbdec('0x44'),require(_0xbdec('0x45')));_0x17c436[_0xbdec('0x6')](_0xbdec('0x46'),require('./api/openchannelInteraction'));_0x17c436[_0xbdec('0x6')](_0xbdec('0x47'),require('./api/openchannelMessage'));_0x17c436[_0xbdec('0x6')]('/api/openchannel/queues',require(_0xbdec('0x48')));_0x17c436[_0xbdec('0x6')]('/api/chat/websites',require('./api/chatWebsite'));_0x17c436[_0xbdec('0x6')]('/api/openchannel/reports/queue',require(_0xbdec('0x49')));_0x17c436[_0xbdec('0x6')](_0xbdec('0x4a'),require(_0xbdec('0x4b')));_0x17c436[_0xbdec('0x6')](_0xbdec('0x4c'),require('./api/chatInteraction'));_0x17c436[_0xbdec('0x6')]('/api/chat/messages',require('./api/chatMessage'));_0x17c436[_0xbdec('0x6')](_0xbdec('0x4d'),require(_0xbdec('0x4e')));_0x17c436[_0xbdec('0x6')](_0xbdec('0x4f'),require('./api/chatQueue'));_0x17c436[_0xbdec('0x6')](_0xbdec('0x50'),require(_0xbdec('0x51')));_0x17c436[_0xbdec('0x6')](_0xbdec('0x52'),require(_0xbdec('0x53')));_0x17c436[_0xbdec('0x6')](_0xbdec('0x54'),require(_0xbdec('0x55')));_0x17c436[_0xbdec('0x6')](_0xbdec('0x56'),require('./api/cmContact'));_0x17c436[_0xbdec('0x6')](_0xbdec('0x57'),require(_0xbdec('0x58')));_0x17c436[_0xbdec('0x6')](_0xbdec('0x59'),require(_0xbdec('0x5a')));_0x17c436['use']('/api/cm/hopper_final',require(_0xbdec('0x5b')));_0x17c436[_0xbdec('0x6')](_0xbdec('0x5c'),require(_0xbdec('0x5d')));_0x17c436['use']('/api/cm/custom_fields',require(_0xbdec('0x5e')));_0x17c436[_0xbdec('0x6')](_0xbdec('0x5f'),require('./api/action'));_0x17c436[_0xbdec('0x6')](_0xbdec('0x60'),require('./api/automation'));_0x17c436[_0xbdec('0x6')](_0xbdec('0x61'),require(_0xbdec('0x62')));_0x17c436[_0xbdec('0x6')](_0xbdec('0x63'),require(_0xbdec('0x64')));_0x17c436[_0xbdec('0x6')](_0xbdec('0x65'),require(_0xbdec('0x66')));_0x17c436[_0xbdec('0x6')](_0xbdec('0x67'),require(_0xbdec('0x68')));_0x17c436[_0xbdec('0x6')](_0xbdec('0x69'),require(_0xbdec('0x6a')));_0x17c436['use'](_0xbdec('0x6b'),require(_0xbdec('0x6c')));_0x17c436[_0xbdec('0x6')](_0xbdec('0x6d'),require('./api/voiceQueuesLog'));_0x17c436[_0xbdec('0x6')]('/api/schedules',require(_0xbdec('0x6e')));_0x17c436['use'](_0xbdec('0x6f'),require(_0xbdec('0x70')));_0x17c436['use']('/api/tags',require('./api/tag'));_0x17c436[_0xbdec('0x6')](_0xbdec('0x71'),require(_0xbdec('0x72')));_0x17c436['use'](_0xbdec('0x73'),require(_0xbdec('0x74')));_0x17c436[_0xbdec('0x6')](_0xbdec('0x75'),require(_0xbdec('0x76')));_0x17c436[_0xbdec('0x6')]('/api/templates',require('./api/template'));_0x17c436[_0xbdec('0x6')](_0xbdec('0x77'),require(_0xbdec('0x78')));_0x17c436[_0xbdec('0x6')](_0xbdec('0x79'),require(_0xbdec('0x7a')));_0x17c436[_0xbdec('0x6')]('/api/integrations',require(_0xbdec('0x7b')));_0x17c436[_0xbdec('0x6')](_0xbdec('0x7c'),require(_0xbdec('0x7d')));_0x17c436[_0xbdec('0x6')](_0xbdec('0x7e'),require(_0xbdec('0x7f')));_0x17c436[_0xbdec('0x6')](_0xbdec('0x80'),require(_0xbdec('0x81')));_0x17c436[_0xbdec('0x6')](_0xbdec('0x82'),require(_0xbdec('0x83')));_0x17c436[_0xbdec('0x6')](_0xbdec('0x84'),require('./api/analyticMetric'));_0x17c436['use'](_0xbdec('0x85'),require(_0xbdec('0x86')));_0x17c436[_0xbdec('0x6')](_0xbdec('0x87'),require(_0xbdec('0x88')));_0x17c436[_0xbdec('0x6')](_0xbdec('0x89'),require('./api/intSalesforceAccount'));_0x17c436[_0xbdec('0x6')](_0xbdec('0x8a'),require('./api/intSalesforceConfiguration'));_0x17c436[_0xbdec('0x6')](_0xbdec('0x8b'),require(_0xbdec('0x8c')));_0x17c436[_0xbdec('0x6')](_0xbdec('0x8d'),require('./api/intSugarcrmAccount'));_0x17c436[_0xbdec('0x6')]('/api/integrations/sugarcrm/configurations',require(_0xbdec('0x8e')));_0x17c436[_0xbdec('0x6')](_0xbdec('0x8f'),require(_0xbdec('0x90')));_0x17c436[_0xbdec('0x6')](_0xbdec('0x91'),require(_0xbdec('0x92')));_0x17c436['use'](_0xbdec('0x93'),require('./api/intDeskConfiguration'));_0x17c436['use']('/api/integrations/desk/fields',require(_0xbdec('0x94')));_0x17c436[_0xbdec('0x6')](_0xbdec('0x95'),require(_0xbdec('0x96')));_0x17c436[_0xbdec('0x6')]('/api/integrations/zoho/configurations',require(_0xbdec('0x97')));_0x17c436[_0xbdec('0x6')](_0xbdec('0x98'),require('./api/intZohoField'));_0x17c436[_0xbdec('0x6')]('/api/integrations/zendesk/accounts',require(_0xbdec('0x99')));_0x17c436[_0xbdec('0x6')](_0xbdec('0x9a'),require('./api/intZendeskConfiguration'));_0x17c436[_0xbdec('0x6')](_0xbdec('0x9b'),require(_0xbdec('0x9c')));_0x17c436['use'](_0xbdec('0x9d'),require(_0xbdec('0x9e')));_0x17c436[_0xbdec('0x6')]('/api/integrations/freshdesk/configurations',require(_0xbdec('0x9f')));_0x17c436[_0xbdec('0x6')](_0xbdec('0xa0'),require(_0xbdec('0xa1')));_0x17c436[_0xbdec('0x6')]('/api/integrations/vtiger/accounts',require(_0xbdec('0xa2')));_0x17c436[_0xbdec('0x6')](_0xbdec('0xa3'),require(_0xbdec('0xa4')));_0x17c436['use'](_0xbdec('0xa5'),require(_0xbdec('0xa6')));_0x17c436['use']('/api/integrations/servicenow/accounts',require('./api/intServicenowAccount'));_0x17c436[_0xbdec('0x6')](_0xbdec('0xa7'),require(_0xbdec('0xa8')));_0x17c436[_0xbdec('0x6')](_0xbdec('0xa9'),require(_0xbdec('0xaa')));_0x17c436[_0xbdec('0x6')](_0xbdec('0xab'),require(_0xbdec('0xac')));_0x17c436['use'](_0xbdec('0xad'),require('./api/intDynamics365Configuration'));_0x17c436[_0xbdec('0x6')](_0xbdec('0xae'),require(_0xbdec('0xaf')));_0x17c436[_0xbdec('0x6')]('/api/integrations/freshsales/accounts',require('./api/intFreshsalesAccount'));_0x17c436[_0xbdec('0x6')](_0xbdec('0xb0'),require('./api/intFreshsalesConfiguration'));_0x17c436[_0xbdec('0x6')](_0xbdec('0xb1'),require(_0xbdec('0xb2')));_0x17c436[_0xbdec('0x6')]('/api/networks',require('./api/network'));_0x17c436[_0xbdec('0x6')]('/api/chat/reports/queue',require(_0xbdec('0xb3')));_0x17c436[_0xbdec('0x6')]('/api/chat/internal/messages',require('./api/chatInternalMessage'));_0x17c436[_0xbdec('0x6')](_0xbdec('0xb4'),require(_0xbdec('0xb5')));_0x17c436[_0xbdec('0x6')](_0xbdec('0xb6'),require(_0xbdec('0xb7')));_0x17c436[_0xbdec('0x6')](_0xbdec('0xb8'),require(_0xbdec('0xb9')));_0x17c436[_0xbdec('0x6')](_0xbdec('0xba'),require('./api/smsQueueReport'));_0x17c436[_0xbdec('0x6')]('/api/square/reports',require('./api/squareReport'));_0x17c436[_0xbdec('0x6')]('/api/square/details/reports',require('./api/squareReportDetail'));_0x17c436[_0xbdec('0x6')]('/api/jscripty/projects',require(_0xbdec('0xbb')));_0x17c436[_0xbdec('0x6')](_0xbdec('0xbc'),require(_0xbdec('0xbd')));_0x17c436[_0xbdec('0x6')](_0xbdec('0xbe'),require(_0xbdec('0xbf')));_0x17c436[_0xbdec('0x6')](_0xbdec('0xc0'),require(_0xbdec('0xc1')));_0x17c436[_0xbdec('0x6')](_0xbdec('0xc2'),require(_0xbdec('0xc3')));_0x17c436[_0xbdec('0x6')](_0xbdec('0xc4'),require(_0xbdec('0xc5')));_0x17c436['use'](_0xbdec('0xc6'),require(_0xbdec('0xc7')));_0x17c436[_0xbdec('0x6')](_0xbdec('0xc8'),require(_0xbdec('0xc9')));_0x17c436[_0xbdec('0x6')](_0xbdec('0xca'),require(_0xbdec('0xcb')));_0x17c436[_0xbdec('0x6')](_0xbdec('0xcc'),require(_0xbdec('0xcd')));_0x17c436['use'](_0xbdec('0xce'),require(_0xbdec('0xcf')));_0x17c436[_0xbdec('0x6')](_0xbdec('0xd0'),require('./api/plugin'));_0x17c436['use'](_0xbdec('0xd1'),require(_0xbdec('0xd2')));_0x17c436[_0xbdec('0x6')]('/api/chat/reports/transfer',require(_0xbdec('0xd3')));_0x17c436[_0xbdec('0x6')]('/api/fax/reports/transfer',require(_0xbdec('0xd4')));_0x17c436[_0xbdec('0x6')]('/api/openchannel/reports/transfer',require('./api/openchannelTransferReport'));_0x17c436[_0xbdec('0x6')](_0xbdec('0xd5'),require('./api/smsTransferReport'));_0x17c436[_0xbdec('0x6')](_0xbdec('0xd6'),require(_0xbdec('0xd7')));_0x17c436['use'](_0xbdec('0xd8'),require(_0xbdec('0xd9')));_0x17c436['use'](_0xbdec('0xda'),require(_0xbdec('0xdb')));_0x17c436['use']('/api/userProfile/sections',require(_0xbdec('0xdc')));_0x17c436['use']('/api/userProfile/resources',require(_0xbdec('0xdd')));_0x17c436[_0xbdec('0x6')](_0xbdec('0xde'),require(_0xbdec('0xdf')));_0x17c436[_0xbdec('0x6')]('/api/whatsapp/accounts',require(_0xbdec('0xe0')));_0x17c436[_0xbdec('0x6')]('/api/whatsapp/applications',require(_0xbdec('0xe1')));_0x17c436['use']('/api/whatsapp/interactions',require(_0xbdec('0xe2')));_0x17c436[_0xbdec('0x6')](_0xbdec('0xe3'),require(_0xbdec('0xe4')));_0x17c436[_0xbdec('0x6')](_0xbdec('0xe5'),require('./api/whatsappQueueReport'));_0x17c436['use']('/api/whatsapp/reports/transfer',require('./api/whatsappTransferReport'));_0x17c436['use']('/api/whatsapp/queues',require(_0xbdec('0xe6')));_0x17c436[_0xbdec('0x6')](_0xbdec('0xe7'),require(_0xbdec('0xe8')));_0x17c436[_0xbdec('0x6')](_0xbdec('0xe9'),require(_0xbdec('0xea')));_0x17c436['use'](_0xbdec('0xeb'),require(_0xbdec('0xec')));_0x17c436[_0xbdec('0x6')](_0xbdec('0xed'),require(_0xbdec('0xee')));_0x17c436[_0xbdec('0x6')](_0xbdec('0xef'),require('./api/authGoogle'));_0x17c436[_0xbdec('0x6')](_0xbdec('0xf0'),require(_0xbdec('0xf1')));_0x17c436['use'](_0xbdec('0xf2'),require(_0xbdec('0xf3')));_0x17c436[_0xbdec('0x6')](_0xbdec('0xf4'),require('./api/rpc'));_0x17c436['use'](_0xbdec('0xf5'),require(_0xbdec('0xf6')));_0x17c436[_0xbdec('0x6')](_0xbdec('0xf7'),require(_0xbdec('0xf8')));_0x17c436['use'](_0xbdec('0xf9'),require(_0xbdec('0xfa')));_0x17c436[_0xbdec('0x6')](_0xbdec('0xfb'),require('./api/webbar'));_0x17c436[_0xbdec('0x6')]('/api/logs',clientSideLogs);_0x17c436[_0xbdec('0x6')](_0xbdec('0xfc'),express[_0xbdec('0xfd')](path[_0xbdec('0xfe')](config['root'],_0xbdec('0xfc'))));_0x17c436[_0xbdec('0x6')](_0xbdec('0xff'),express[_0xbdec('0xfd')](path['join'](config[_0xbdec('0x100')],_0xbdec('0xff'))));_0x17c436[_0xbdec('0x6')](_0xbdec('0x101'),express[_0xbdec('0xfd')](path[_0xbdec('0xfe')](config[_0xbdec('0x100')],_0xbdec('0x101'))));_0x17c436[_0xbdec('0x6')](_0xbdec('0x102'),express[_0xbdec('0xfd')](path[_0xbdec('0xfe')](config[_0xbdec('0x100')],_0xbdec('0x103'),'3.5.0')));_0x17c436['use'](_0xbdec('0x104'),express[_0xbdec('0xfd')](path['join'](config['root'],_0xbdec('0x105'))));_0x17c436[_0xbdec('0x106')]('/:url(api|auth|components|app|bower_components|assets)/*')[_0xbdec('0x107')](errors[0x194]);_0x17c436[_0xbdec('0x106')]('/*')['get'](function(_0x572a2c,_0x2ef091){_0x2ef091[_0xbdec('0x108')](path['resolve'](_0x17c436[_0xbdec('0x107')](_0xbdec('0x109'))+_0xbdec('0x10a')));});return _0x17c436;});}; \ No newline at end of file +var _0x3645=['./api/migration','/api/attachments','./api/attachment','/api/plugins','./api/plugin','/api/mail/reports/transfer','./api/mailTransferReport','./api/chatTransferReport','/api/fax/reports/transfer','./api/faxTransferReport','./api/openchannelTransferReport','/api/sms/reports/transfer','./api/cmList','./api/voicePrefix','/api/userProfiles','./api/userProfile','/api/userProfile/sections','./api/userProfileResource','/api/userNotifications','./api/userNotification','/api/whatsapp/accounts','./api/whatsappApplication','./api/whatsappMessage','./api/whatsappQueueReport','/api/whatsapp/queues','./api/whatsappQueue','/api/cloudProviders','./api/cloudProvider','/api/realtime','./api/realtime','/api/user-settings','./api/user-setting','/api/auth/local','./api/authLocal','/api/auth/google','./api/authGoogle','/api/auth/activedirectory','./api/authActiveDirectory','/api/jira','./api/jira','/api/rpc','./api/rpc','./api/version','/api/system','./api/system','/api/pm2','/api/webbar','./api/webbar','/api/logs','/apidoc','static','join','root','/www','/demo','snippet','3.5.0','/:url(api|auth|components|app|bower_components|assets)/*','get','route','sendFile','resolve','appPath','express','./errors','./config/environment','./utils/client-side-logger','setupLoggers','./api/client-side-logs','default','then','use','/api/users','./api/user','/api/voice/chanspy','./api/voiceChanSpy','/api/voice/contexts','/api/voice/extensions','./api/voiceExtension','/api/voice/mohs','./api/voiceMusicOnHold','/api/voice/queues','./api/voiceQueue','/api/voice/recordings','./api/voiceRecording','./api/screenRecording','/api/voice/mails','./api/voiceMail','/api/voice/mails/messages','./api/voiceCallReport','/api/voice/dials/reports','./api/voiceDialReport','/api/voice/queues/reports','./api/voiceQueueReport','/api/members/reports','./api/memberReport','/api/trunks','./api/trunk','/api/voice/transfers/reports','./api/voiceTransferReport','/api/mail/out_servers','./api/mailServerOut','/api/mail/accounts','./api/mailAccount','/api/mail/queues','./api/mailQueue','/api/mail/substatuses','/api/mail/interactions','/api/mail/messages','./api/mailMessage','/api/mail/applications','./api/mailQueueReport','./api/dashboard','./api/dashboardItem','/api/fax/accounts','./api/faxAccount','/api/fax/applications','./api/faxApplication','/api/fax/interactions','./api/faxInteraction','./api/faxQueue','/api/fax/reports/queue','./api/faxQueueReport','./api/smsAccount','/api/sms/applications','./api/smsApplication','/api/sms/interactions','./api/smsInteraction','/api/sms/messages','./api/smsMessage','/api/openchannel/accounts','./api/openchannelAccount','./api/openchannelApplication','/api/openchannel/interactions','./api/openchannelMessage','./api/openchannelQueue','/api/chat/websites','./api/chatWebsite','/api/chat/applications','./api/chatApplication','/api/chat/interactions','./api/chatInteraction','/api/chat/offline_messages','./api/chatOfflineMessage','/api/chat/queues','./api/chatQueue','/api/chat/groups','./api/chatGroup','/api/chat/proactive_actions','./api/chatProactiveAction','./api/cmCompany','/api/cm/contacts','./api/cmContact','/api/cm/hopper','./api/cmHopper','/api/cm/hopper_black','./api/cmHopperBlack','/api/cm/hopper_final','./api/cmHopperFinal','/api/cm/hopper_history','/api/actions','./api/action','/api/automations','./api/automation','/api/canned_answers','./api/cannedAnswer','./api/disposition','/api/conditions','/api/pauses','./api/pause','/api/cdr','/api/schedules','./api/schedule','/api/sounds','./api/sound','/api/tags','./api/tag','/api/contact_item_types','./api/contactItemType','./api/cmContactHasItem','./api/cmHopperAdditionalPhone','/api/templates','./api/template','./api/trigger','/api/variables','./api/variable','/api/integrations','./api/integration','./api/integrationReport','/api/analytics/custom_reports','./api/analyticCustomReport','/api/analytics/default_reports','/api/analytics/extracted_reports','./api/analyticExtractedReport','/api/analytics/metrics','./api/analyticMetric','/api/analytics/field_reports','./api/analyticFieldReport','/api/analytics/tree_reports','./api/analyticTreeReport','/api/integrations/salesforce/accounts','/api/integrations/salesforce/configurations','./api/intSalesforceConfiguration','./api/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/intDeskField','/api/integrations/zoho/accounts','./api/intZohoAccount','/api/integrations/zoho/configurations','/api/integrations/zoho/fields','./api/intZohoField','/api/integrations/zendesk/accounts','/api/integrations/zendesk/configurations','./api/intZendeskConfiguration','/api/integrations/zendesk/fields','./api/intZendeskField','./api/intFreshdeskAccount','/api/integrations/freshdesk/configurations','./api/intFreshdeskConfiguration','/api/integrations/freshdesk/fields','./api/intFreshdeskField','/api/integrations/vtiger/accounts','/api/integrations/vtiger/configurations','./api/intVtigerConfiguration','/api/integrations/vtiger/fields','./api/intVtigerField','/api/integrations/servicenow/configurations','/api/integrations/servicenow/fields','./api/intServicenowField','/api/integrations/dynamics365/accounts','./api/intDynamics365Account','./api/intDynamics365Configuration','./api/intFreshsalesAccount','/api/integrations/freshsales/configurations','./api/intFreshsalesConfiguration','/api/integrations/freshsales/fields','./api/intFreshsalesField','/api/networks','./api/network','/api/chat/reports/queue','./api/chatQueueReport','/api/chat/internal/messages','./api/chatInternalMessage','/api/jscripty/answers/reports','./api/jscriptyAnswerReport','/api/jscripty/questions/reports','./api/jscriptyQuestionReport','/api/jscripty/sessions/reports','/api/sms/reports/queue','./api/smsQueueReport','/api/square/reports','./api/squareReportDetail','/api/jscripty/projects','./api/jscriptyProject','/api/settings','./api/setting','./api/squareOdbc','/api/square/projects','./api/squareProject','/api/square/recordings','./api/squareRecording','/api/square/messages','./api/squareMessage','/api/teams','./api/team','/api/license','./api/license','/api/campaigns','./api/campaign'];(function(_0x436fd6,_0x3a416a){var _0x45cd28=function(_0x4096c7){while(--_0x4096c7){_0x436fd6['push'](_0x436fd6['shift']());}};_0x45cd28(++_0x3a416a);}(_0x3645,0x154));var _0x5364=function(_0xdad237,_0x361a1d){_0xdad237=_0xdad237-0x0;var _0x15c575=_0x3645[_0xdad237];return _0x15c575;};'use strict';var path=require('path');var express=require(_0x5364('0x0'));var errors=require(_0x5364('0x1'));var config=require(_0x5364('0x2'));var setupLoggers=require(_0x5364('0x3'))[_0x5364('0x4')];var clientSideLogs=require(_0x5364('0x5'));exports[_0x5364('0x6')]=function(_0x5a63bf){return setupLoggers(_0x5a63bf)[_0x5364('0x7')](function(){_0x5a63bf[_0x5364('0x8')](_0x5364('0x9'),require(_0x5364('0xa')));_0x5a63bf[_0x5364('0x8')](_0x5364('0xb'),require(_0x5364('0xc')));_0x5a63bf[_0x5364('0x8')](_0x5364('0xd'),require('./api/voiceContext'));_0x5a63bf[_0x5364('0x8')](_0x5364('0xe'),require(_0x5364('0xf')));_0x5a63bf[_0x5364('0x8')](_0x5364('0x10'),require(_0x5364('0x11')));_0x5a63bf[_0x5364('0x8')](_0x5364('0x12'),require(_0x5364('0x13')));_0x5a63bf[_0x5364('0x8')](_0x5364('0x14'),require(_0x5364('0x15')));_0x5a63bf[_0x5364('0x8')]('/api/screen/recordings',require(_0x5364('0x16')));_0x5a63bf[_0x5364('0x8')](_0x5364('0x17'),require(_0x5364('0x18')));_0x5a63bf['use'](_0x5364('0x19'),require('./api/voiceMailMessage'));_0x5a63bf[_0x5364('0x8')]('/api/voice/calls/reports',require(_0x5364('0x1a')));_0x5a63bf[_0x5364('0x8')](_0x5364('0x1b'),require(_0x5364('0x1c')));_0x5a63bf[_0x5364('0x8')]('/api/voice/agents/reports',require('./api/voiceAgentReport'));_0x5a63bf[_0x5364('0x8')](_0x5364('0x1d'),require(_0x5364('0x1e')));_0x5a63bf[_0x5364('0x8')](_0x5364('0x1f'),require(_0x5364('0x20')));_0x5a63bf[_0x5364('0x8')](_0x5364('0x21'),require(_0x5364('0x22')));_0x5a63bf['use'](_0x5364('0x23'),require(_0x5364('0x24')));_0x5a63bf[_0x5364('0x8')](_0x5364('0x25'),require(_0x5364('0x26')));_0x5a63bf[_0x5364('0x8')](_0x5364('0x27'),require(_0x5364('0x28')));_0x5a63bf[_0x5364('0x8')](_0x5364('0x29'),require(_0x5364('0x2a')));_0x5a63bf['use'](_0x5364('0x2b'),require('./api/mailSubstatus'));_0x5a63bf['use'](_0x5364('0x2c'),require('./api/mailInteraction'));_0x5a63bf[_0x5364('0x8')](_0x5364('0x2d'),require(_0x5364('0x2e')));_0x5a63bf[_0x5364('0x8')](_0x5364('0x2f'),require('./api/mailApplication'));_0x5a63bf[_0x5364('0x8')]('/api/mail/reports/queue',require(_0x5364('0x30')));_0x5a63bf[_0x5364('0x8')]('/api/dashboards',require(_0x5364('0x31')));_0x5a63bf[_0x5364('0x8')]('/api/dashboards/items',require(_0x5364('0x32')));_0x5a63bf[_0x5364('0x8')](_0x5364('0x33'),require(_0x5364('0x34')));_0x5a63bf['use'](_0x5364('0x35'),require(_0x5364('0x36')));_0x5a63bf[_0x5364('0x8')](_0x5364('0x37'),require(_0x5364('0x38')));_0x5a63bf[_0x5364('0x8')]('/api/fax/messages',require('./api/faxMessage'));_0x5a63bf[_0x5364('0x8')]('/api/fax/queues',require(_0x5364('0x39')));_0x5a63bf[_0x5364('0x8')](_0x5364('0x3a'),require(_0x5364('0x3b')));_0x5a63bf[_0x5364('0x8')]('/api/sms/accounts',require(_0x5364('0x3c')));_0x5a63bf[_0x5364('0x8')](_0x5364('0x3d'),require(_0x5364('0x3e')));_0x5a63bf[_0x5364('0x8')](_0x5364('0x3f'),require(_0x5364('0x40')));_0x5a63bf[_0x5364('0x8')](_0x5364('0x41'),require(_0x5364('0x42')));_0x5a63bf[_0x5364('0x8')]('/api/sms/queues',require('./api/smsQueue'));_0x5a63bf[_0x5364('0x8')](_0x5364('0x43'),require(_0x5364('0x44')));_0x5a63bf['use']('/api/openchannel/applications',require(_0x5364('0x45')));_0x5a63bf[_0x5364('0x8')](_0x5364('0x46'),require('./api/openchannelInteraction'));_0x5a63bf[_0x5364('0x8')]('/api/openchannel/messages',require(_0x5364('0x47')));_0x5a63bf['use']('/api/openchannel/queues',require(_0x5364('0x48')));_0x5a63bf[_0x5364('0x8')](_0x5364('0x49'),require(_0x5364('0x4a')));_0x5a63bf[_0x5364('0x8')]('/api/openchannel/reports/queue',require('./api/openchannelQueueReport'));_0x5a63bf[_0x5364('0x8')](_0x5364('0x4b'),require(_0x5364('0x4c')));_0x5a63bf[_0x5364('0x8')](_0x5364('0x4d'),require(_0x5364('0x4e')));_0x5a63bf[_0x5364('0x8')]('/api/chat/messages',require('./api/chatMessage'));_0x5a63bf['use'](_0x5364('0x4f'),require(_0x5364('0x50')));_0x5a63bf[_0x5364('0x8')](_0x5364('0x51'),require(_0x5364('0x52')));_0x5a63bf[_0x5364('0x8')](_0x5364('0x53'),require(_0x5364('0x54')));_0x5a63bf[_0x5364('0x8')](_0x5364('0x55'),require(_0x5364('0x56')));_0x5a63bf[_0x5364('0x8')]('/api/cm/companies',require(_0x5364('0x57')));_0x5a63bf[_0x5364('0x8')](_0x5364('0x58'),require(_0x5364('0x59')));_0x5a63bf[_0x5364('0x8')](_0x5364('0x5a'),require(_0x5364('0x5b')));_0x5a63bf[_0x5364('0x8')](_0x5364('0x5c'),require(_0x5364('0x5d')));_0x5a63bf[_0x5364('0x8')](_0x5364('0x5e'),require(_0x5364('0x5f')));_0x5a63bf[_0x5364('0x8')](_0x5364('0x60'),require('./api/cmHopperHistory'));_0x5a63bf[_0x5364('0x8')]('/api/cm/custom_fields',require('./api/cmCustomField'));_0x5a63bf[_0x5364('0x8')](_0x5364('0x61'),require(_0x5364('0x62')));_0x5a63bf[_0x5364('0x8')](_0x5364('0x63'),require(_0x5364('0x64')));_0x5a63bf['use'](_0x5364('0x65'),require(_0x5364('0x66')));_0x5a63bf[_0x5364('0x8')]('/api/dispositions',require(_0x5364('0x67')));_0x5a63bf['use'](_0x5364('0x68'),require('./api/condition'));_0x5a63bf[_0x5364('0x8')]('/api/intervals',require('./api/interval'));_0x5a63bf[_0x5364('0x8')](_0x5364('0x69'),require(_0x5364('0x6a')));_0x5a63bf['use'](_0x5364('0x6b'),require('./api/cdr'));_0x5a63bf[_0x5364('0x8')]('/api/voiceQueuesLog',require('./api/voiceQueuesLog'));_0x5a63bf['use'](_0x5364('0x6c'),require(_0x5364('0x6d')));_0x5a63bf[_0x5364('0x8')](_0x5364('0x6e'),require(_0x5364('0x6f')));_0x5a63bf[_0x5364('0x8')](_0x5364('0x70'),require(_0x5364('0x71')));_0x5a63bf['use'](_0x5364('0x72'),require(_0x5364('0x73')));_0x5a63bf[_0x5364('0x8')]('/api/cm_contact_has_items',require(_0x5364('0x74')));_0x5a63bf[_0x5364('0x8')]('/api/cm_hopper_additional_phones',require(_0x5364('0x75')));_0x5a63bf[_0x5364('0x8')](_0x5364('0x76'),require(_0x5364('0x77')));_0x5a63bf[_0x5364('0x8')]('/api/triggers',require(_0x5364('0x78')));_0x5a63bf[_0x5364('0x8')](_0x5364('0x79'),require(_0x5364('0x7a')));_0x5a63bf[_0x5364('0x8')](_0x5364('0x7b'),require(_0x5364('0x7c')));_0x5a63bf['use']('/api/integrations/reports',require(_0x5364('0x7d')));_0x5a63bf[_0x5364('0x8')](_0x5364('0x7e'),require(_0x5364('0x7f')));_0x5a63bf[_0x5364('0x8')](_0x5364('0x80'),require('./api/analyticDefaultReport'));_0x5a63bf[_0x5364('0x8')](_0x5364('0x81'),require(_0x5364('0x82')));_0x5a63bf[_0x5364('0x8')](_0x5364('0x83'),require(_0x5364('0x84')));_0x5a63bf['use'](_0x5364('0x85'),require(_0x5364('0x86')));_0x5a63bf['use'](_0x5364('0x87'),require(_0x5364('0x88')));_0x5a63bf[_0x5364('0x8')](_0x5364('0x89'),require('./api/intSalesforceAccount'));_0x5a63bf[_0x5364('0x8')](_0x5364('0x8a'),require(_0x5364('0x8b')));_0x5a63bf[_0x5364('0x8')]('/api/integrations/salesforce/fields',require(_0x5364('0x8c')));_0x5a63bf[_0x5364('0x8')](_0x5364('0x8d'),require(_0x5364('0x8e')));_0x5a63bf['use'](_0x5364('0x8f'),require(_0x5364('0x90')));_0x5a63bf['use'](_0x5364('0x91'),require(_0x5364('0x92')));_0x5a63bf[_0x5364('0x8')](_0x5364('0x93'),require(_0x5364('0x94')));_0x5a63bf[_0x5364('0x8')]('/api/integrations/desk/configurations',require(_0x5364('0x95')));_0x5a63bf[_0x5364('0x8')]('/api/integrations/desk/fields',require(_0x5364('0x96')));_0x5a63bf[_0x5364('0x8')](_0x5364('0x97'),require(_0x5364('0x98')));_0x5a63bf[_0x5364('0x8')](_0x5364('0x99'),require('./api/intZohoConfiguration'));_0x5a63bf[_0x5364('0x8')](_0x5364('0x9a'),require(_0x5364('0x9b')));_0x5a63bf['use'](_0x5364('0x9c'),require('./api/intZendeskAccount'));_0x5a63bf[_0x5364('0x8')](_0x5364('0x9d'),require(_0x5364('0x9e')));_0x5a63bf[_0x5364('0x8')](_0x5364('0x9f'),require(_0x5364('0xa0')));_0x5a63bf[_0x5364('0x8')]('/api/integrations/freshdesk/accounts',require(_0x5364('0xa1')));_0x5a63bf['use'](_0x5364('0xa2'),require(_0x5364('0xa3')));_0x5a63bf[_0x5364('0x8')](_0x5364('0xa4'),require(_0x5364('0xa5')));_0x5a63bf[_0x5364('0x8')](_0x5364('0xa6'),require('./api/intVtigerAccount'));_0x5a63bf[_0x5364('0x8')](_0x5364('0xa7'),require(_0x5364('0xa8')));_0x5a63bf[_0x5364('0x8')](_0x5364('0xa9'),require(_0x5364('0xaa')));_0x5a63bf[_0x5364('0x8')]('/api/integrations/servicenow/accounts',require('./api/intServicenowAccount'));_0x5a63bf[_0x5364('0x8')](_0x5364('0xab'),require('./api/intServicenowConfiguration'));_0x5a63bf[_0x5364('0x8')](_0x5364('0xac'),require(_0x5364('0xad')));_0x5a63bf[_0x5364('0x8')](_0x5364('0xae'),require(_0x5364('0xaf')));_0x5a63bf[_0x5364('0x8')]('/api/integrations/dynamics365/configurations',require(_0x5364('0xb0')));_0x5a63bf[_0x5364('0x8')]('/api/integrations/dynamics365/fields',require('./api/intDynamics365Field'));_0x5a63bf['use']('/api/integrations/freshsales/accounts',require(_0x5364('0xb1')));_0x5a63bf[_0x5364('0x8')](_0x5364('0xb2'),require(_0x5364('0xb3')));_0x5a63bf[_0x5364('0x8')](_0x5364('0xb4'),require(_0x5364('0xb5')));_0x5a63bf['use'](_0x5364('0xb6'),require(_0x5364('0xb7')));_0x5a63bf[_0x5364('0x8')](_0x5364('0xb8'),require(_0x5364('0xb9')));_0x5a63bf['use'](_0x5364('0xba'),require(_0x5364('0xbb')));_0x5a63bf[_0x5364('0x8')](_0x5364('0xbc'),require(_0x5364('0xbd')));_0x5a63bf['use'](_0x5364('0xbe'),require(_0x5364('0xbf')));_0x5a63bf[_0x5364('0x8')](_0x5364('0xc0'),require('./api/jscriptySessionReport'));_0x5a63bf[_0x5364('0x8')](_0x5364('0xc1'),require(_0x5364('0xc2')));_0x5a63bf[_0x5364('0x8')](_0x5364('0xc3'),require('./api/squareReport'));_0x5a63bf[_0x5364('0x8')]('/api/square/details/reports',require(_0x5364('0xc4')));_0x5a63bf[_0x5364('0x8')](_0x5364('0xc5'),require(_0x5364('0xc6')));_0x5a63bf[_0x5364('0x8')](_0x5364('0xc7'),require(_0x5364('0xc8')));_0x5a63bf[_0x5364('0x8')]('/api/square/odbc',require(_0x5364('0xc9')));_0x5a63bf[_0x5364('0x8')](_0x5364('0xca'),require(_0x5364('0xcb')));_0x5a63bf[_0x5364('0x8')](_0x5364('0xcc'),require(_0x5364('0xcd')));_0x5a63bf[_0x5364('0x8')](_0x5364('0xce'),require(_0x5364('0xcf')));_0x5a63bf['use'](_0x5364('0xd0'),require(_0x5364('0xd1')));_0x5a63bf[_0x5364('0x8')](_0x5364('0xd2'),require(_0x5364('0xd3')));_0x5a63bf[_0x5364('0x8')](_0x5364('0xd4'),require(_0x5364('0xd5')));_0x5a63bf[_0x5364('0x8')]('/api/migrations',require(_0x5364('0xd6')));_0x5a63bf[_0x5364('0x8')](_0x5364('0xd7'),require(_0x5364('0xd8')));_0x5a63bf[_0x5364('0x8')](_0x5364('0xd9'),require(_0x5364('0xda')));_0x5a63bf[_0x5364('0x8')](_0x5364('0xdb'),require(_0x5364('0xdc')));_0x5a63bf['use']('/api/chat/reports/transfer',require(_0x5364('0xdd')));_0x5a63bf[_0x5364('0x8')](_0x5364('0xde'),require(_0x5364('0xdf')));_0x5a63bf[_0x5364('0x8')]('/api/openchannel/reports/transfer',require(_0x5364('0xe0')));_0x5a63bf[_0x5364('0x8')](_0x5364('0xe1'),require('./api/smsTransferReport'));_0x5a63bf['use']('/api/cm/lists',require(_0x5364('0xe2')));_0x5a63bf['use']('/api/voice/prefixes',require(_0x5364('0xe3')));_0x5a63bf[_0x5364('0x8')](_0x5364('0xe4'),require(_0x5364('0xe5')));_0x5a63bf[_0x5364('0x8')](_0x5364('0xe6'),require('./api/userProfileSection'));_0x5a63bf[_0x5364('0x8')]('/api/userProfile/resources',require(_0x5364('0xe7')));_0x5a63bf[_0x5364('0x8')](_0x5364('0xe8'),require(_0x5364('0xe9')));_0x5a63bf['use'](_0x5364('0xea'),require('./api/whatsappAccount'));_0x5a63bf[_0x5364('0x8')]('/api/whatsapp/applications',require(_0x5364('0xeb')));_0x5a63bf[_0x5364('0x8')]('/api/whatsapp/interactions',require('./api/whatsappInteraction'));_0x5a63bf['use']('/api/whatsapp/messages',require(_0x5364('0xec')));_0x5a63bf[_0x5364('0x8')]('/api/whatsapp/reports/queue',require(_0x5364('0xed')));_0x5a63bf[_0x5364('0x8')]('/api/whatsapp/reports/transfer',require('./api/whatsappTransferReport'));_0x5a63bf['use'](_0x5364('0xee'),require(_0x5364('0xef')));_0x5a63bf[_0x5364('0x8')](_0x5364('0xf0'),require(_0x5364('0xf1')));_0x5a63bf['use'](_0x5364('0xf2'),require(_0x5364('0xf3')));_0x5a63bf[_0x5364('0x8')](_0x5364('0xf4'),require(_0x5364('0xf5')));_0x5a63bf[_0x5364('0x8')](_0x5364('0xf6'),require(_0x5364('0xf7')));_0x5a63bf['use'](_0x5364('0xf8'),require(_0x5364('0xf9')));_0x5a63bf[_0x5364('0x8')](_0x5364('0xfa'),require(_0x5364('0xfb')));_0x5a63bf[_0x5364('0x8')](_0x5364('0xfc'),require(_0x5364('0xfd')));_0x5a63bf[_0x5364('0x8')](_0x5364('0xfe'),require(_0x5364('0xff')));_0x5a63bf[_0x5364('0x8')]('/api/version',require(_0x5364('0x100')));_0x5a63bf['use'](_0x5364('0x101'),require(_0x5364('0x102')));_0x5a63bf[_0x5364('0x8')](_0x5364('0x103'),require('./api/pm2'));_0x5a63bf[_0x5364('0x8')](_0x5364('0x104'),require(_0x5364('0x105')));_0x5a63bf[_0x5364('0x8')](_0x5364('0x106'),clientSideLogs);_0x5a63bf[_0x5364('0x8')](_0x5364('0x107'),express[_0x5364('0x108')](path[_0x5364('0x109')](config[_0x5364('0x10a')],_0x5364('0x107'))));_0x5a63bf[_0x5364('0x8')](_0x5364('0x10b'),express[_0x5364('0x108')](path[_0x5364('0x109')](config[_0x5364('0x10a')],'/www')));_0x5a63bf[_0x5364('0x8')](_0x5364('0x10c'),express['static'](path[_0x5364('0x109')](config[_0x5364('0x10a')],_0x5364('0x10c'))));_0x5a63bf[_0x5364('0x8')]('/snippet',express[_0x5364('0x108')](path['join'](config[_0x5364('0x10a')],_0x5364('0x10d'),_0x5364('0x10e'))));_0x5a63bf[_0x5364('0x8')]('/plugins',express[_0x5364('0x108')](path[_0x5364('0x109')](config[_0x5364('0x10a')],'/server/files/plugins')));_0x5a63bf['route'](_0x5364('0x10f'))[_0x5364('0x110')](errors[0x194]);_0x5a63bf[_0x5364('0x111')]('/*')[_0x5364('0x110')](function(_0x418832,_0x313461){_0x313461[_0x5364('0x112')](path[_0x5364('0x113')](_0x5a63bf[_0x5364('0x110')](_0x5364('0x114'))+'/index.html'));});return _0x5a63bf;});}; \ No newline at end of file diff --git a/server/rpc/index.js b/server/rpc/index.js index c692be9..701e010 100644 --- a/server/rpc/index.js +++ b/server/rpc/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7795=['../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc','../api/intFreshsalesAccount/intFreshsalesAccount.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/squareRecording/squareRecording.rpc','../api/attachment/attachment.rpc','../api/plugin/plugin.rpc','../api/whatsappAccount/whatsappAccount.rpc','../api/whatsappMessage/whatsappMessage.rpc','../api/whatsappQueueReport/whatsappQueueReport.rpc','http','rpc','port','error','listen','log','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','default','RPC\x20listening\x20on\x20','lodash','../api/user/user.rpc','merge','../api/voiceRecording/voiceRecording.rpc','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceDialReport/voiceDialReport.rpc','../api/voiceAgentReport/voiceAgentReport.rpc','../api/memberReport/memberReport.rpc','../api/trunk/trunk.rpc','../api/voiceTransferReport/voiceTransferReport.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailAccount/mailAccount.rpc','../api/mailQueue/mailQueue.rpc','../api/mailInteraction/mailInteraction.rpc','../api/mailMessage/mailMessage.rpc','../api/mailApplication/mailApplication.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxAccount/faxAccount.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxQueue/faxQueue.rpc','../api/smsAccount/smsAccount.rpc','../api/smsInteraction/smsInteraction.rpc','../api/smsMessage/smsMessage.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelMessage/openchannelMessage.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatInteraction/chatInteraction.rpc','../api/chatQueue/chatQueue.rpc','../api/cmContact/cmContact.rpc','../api/cmHopper/cmHopper.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperHistory/cmHopperHistory.rpc','../api/pause/pause.rpc','../api/sound/sound.rpc','../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc','../api/template/template.rpc','../api/trigger/trigger.rpc','../api/variable/variable.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc'];(function(_0x5ef121,_0x4bca94){var _0x68259d=function(_0x29b853){while(--_0x29b853){_0x5ef121['push'](_0x5ef121['shift']());}};_0x68259d(++_0x4bca94);}(_0x7795,0x1a4));var _0x5779=function(_0x237285,_0x3a2a16){_0x237285=_0x237285-0x0;var _0x312386=_0x7795[_0x237285];return _0x312386;};'use strict';var jayson=require('jayson/promise');var _=require(_0x5779('0x0'));var config=require('../config/environment');exports['listen']=function(){return new Promise(function(_0x2ef82a,_0x657e35){var _0x496f3b={};_0x496f3b=_['merge'](_0x496f3b,require(_0x5779('0x1')));_0x496f3b=_[_0x5779('0x2')](_0x496f3b,require('../api/voiceExtension/voiceExtension.rpc'));_0x496f3b=_[_0x5779('0x2')](_0x496f3b,require('../api/voiceQueue/voiceQueue.rpc'));_0x496f3b=_['merge'](_0x496f3b,require(_0x5779('0x3')));_0x496f3b=_[_0x5779('0x2')](_0x496f3b,require(_0x5779('0x4')));_0x496f3b=_[_0x5779('0x2')](_0x496f3b,require(_0x5779('0x5')));_0x496f3b=_['merge'](_0x496f3b,require(_0x5779('0x6')));_0x496f3b=_[_0x5779('0x2')](_0x496f3b,require('../api/voiceQueueReport/voiceQueueReport.rpc'));_0x496f3b=_['merge'](_0x496f3b,require(_0x5779('0x7')));_0x496f3b=_[_0x5779('0x2')](_0x496f3b,require(_0x5779('0x8')));_0x496f3b=_[_0x5779('0x2')](_0x496f3b,require(_0x5779('0x9')));_0x496f3b=_[_0x5779('0x2')](_0x496f3b,require(_0x5779('0xa')));_0x496f3b=_['merge'](_0x496f3b,require(_0x5779('0xb')));_0x496f3b=_['merge'](_0x496f3b,require(_0x5779('0xc')));_0x496f3b=_['merge'](_0x496f3b,require(_0x5779('0xd')));_0x496f3b=_[_0x5779('0x2')](_0x496f3b,require(_0x5779('0xe')));_0x496f3b=_['merge'](_0x496f3b,require(_0x5779('0xf')));_0x496f3b=_['merge'](_0x496f3b,require(_0x5779('0x10')));_0x496f3b=_[_0x5779('0x2')](_0x496f3b,require(_0x5779('0x11')));_0x496f3b=_['merge'](_0x496f3b,require(_0x5779('0x12')));_0x496f3b=_[_0x5779('0x2')](_0x496f3b,require('../api/faxApplication/faxApplication.rpc'));_0x496f3b=_[_0x5779('0x2')](_0x496f3b,require(_0x5779('0x13')));_0x496f3b=_['merge'](_0x496f3b,require('../api/faxMessage/faxMessage.rpc'));_0x496f3b=_['merge'](_0x496f3b,require(_0x5779('0x14')));_0x496f3b=_[_0x5779('0x2')](_0x496f3b,require('../api/faxQueueReport/faxQueueReport.rpc'));_0x496f3b=_[_0x5779('0x2')](_0x496f3b,require(_0x5779('0x15')));_0x496f3b=_[_0x5779('0x2')](_0x496f3b,require(_0x5779('0x16')));_0x496f3b=_[_0x5779('0x2')](_0x496f3b,require(_0x5779('0x17')));_0x496f3b=_[_0x5779('0x2')](_0x496f3b,require(_0x5779('0x18')));_0x496f3b=_[_0x5779('0x2')](_0x496f3b,require('../api/openchannelApplication/openchannelApplication.rpc'));_0x496f3b=_['merge'](_0x496f3b,require(_0x5779('0x19')));_0x496f3b=_['merge'](_0x496f3b,require(_0x5779('0x1a')));_0x496f3b=_[_0x5779('0x2')](_0x496f3b,require(_0x5779('0x1b')));_0x496f3b=_[_0x5779('0x2')](_0x496f3b,require(_0x5779('0x1c')));_0x496f3b=_[_0x5779('0x2')](_0x496f3b,require(_0x5779('0x1d')));_0x496f3b=_[_0x5779('0x2')](_0x496f3b,require('../api/chatMessage/chatMessage.rpc'));_0x496f3b=_[_0x5779('0x2')](_0x496f3b,require(_0x5779('0x1e')));_0x496f3b=_[_0x5779('0x2')](_0x496f3b,require(_0x5779('0x1f')));_0x496f3b=_[_0x5779('0x2')](_0x496f3b,require(_0x5779('0x20')));_0x496f3b=_[_0x5779('0x2')](_0x496f3b,require(_0x5779('0x21')));_0x496f3b=_[_0x5779('0x2')](_0x496f3b,require('../api/cmHopperFinal/cmHopperFinal.rpc'));_0x496f3b=_[_0x5779('0x2')](_0x496f3b,require(_0x5779('0x22')));_0x496f3b=_[_0x5779('0x2')](_0x496f3b,require('../api/reportAgentPreview/reportAgentPreview.rpc'));_0x496f3b=_['merge'](_0x496f3b,require('../api/interval/interval.rpc'));_0x496f3b=_['merge'](_0x496f3b,require(_0x5779('0x23')));_0x496f3b=_['merge'](_0x496f3b,require(_0x5779('0x24')));_0x496f3b=_['merge'](_0x496f3b,require(_0x5779('0x25')));_0x496f3b=_[_0x5779('0x2')](_0x496f3b,require(_0x5779('0x26')));_0x496f3b=_['merge'](_0x496f3b,require(_0x5779('0x27')));_0x496f3b=_[_0x5779('0x2')](_0x496f3b,require(_0x5779('0x28')));_0x496f3b=_[_0x5779('0x2')](_0x496f3b,require(_0x5779('0x29')));_0x496f3b=_[_0x5779('0x2')](_0x496f3b,require(_0x5779('0x2a')));_0x496f3b=_[_0x5779('0x2')](_0x496f3b,require('../api/intDeskAccount/intDeskAccount.rpc'));_0x496f3b=_[_0x5779('0x2')](_0x496f3b,require('../api/intZohoAccount/intZohoAccount.rpc'));_0x496f3b=_[_0x5779('0x2')](_0x496f3b,require('../api/intZendeskAccount/intZendeskAccount.rpc'));_0x496f3b=_[_0x5779('0x2')](_0x496f3b,require(_0x5779('0x2b')));_0x496f3b=_[_0x5779('0x2')](_0x496f3b,require(_0x5779('0x2c')));_0x496f3b=_[_0x5779('0x2')](_0x496f3b,require(_0x5779('0x2d')));_0x496f3b=_[_0x5779('0x2')](_0x496f3b,require(_0x5779('0x2e')));_0x496f3b=_[_0x5779('0x2')](_0x496f3b,require(_0x5779('0x2f')));_0x496f3b=_[_0x5779('0x2')](_0x496f3b,require(_0x5779('0x30')));_0x496f3b=_[_0x5779('0x2')](_0x496f3b,require(_0x5779('0x31')));_0x496f3b=_[_0x5779('0x2')](_0x496f3b,require(_0x5779('0x32')));_0x496f3b=_[_0x5779('0x2')](_0x496f3b,require('../api/squareReportDetail/squareReportDetail.rpc'));_0x496f3b=_[_0x5779('0x2')](_0x496f3b,require('../api/setting/setting.rpc'));_0x496f3b=_[_0x5779('0x2')](_0x496f3b,require('../api/squareOdbc/squareOdbc.rpc'));_0x496f3b=_[_0x5779('0x2')](_0x496f3b,require('../api/squareProject/squareProject.rpc'));_0x496f3b=_[_0x5779('0x2')](_0x496f3b,require(_0x5779('0x33')));_0x496f3b=_[_0x5779('0x2')](_0x496f3b,require('../api/squareMessage/squareMessage.rpc'));_0x496f3b=_['merge'](_0x496f3b,require('../api/campaign/campaign.rpc'));_0x496f3b=_[_0x5779('0x2')](_0x496f3b,require(_0x5779('0x34')));_0x496f3b=_['merge'](_0x496f3b,require(_0x5779('0x35')));_0x496f3b=_[_0x5779('0x2')](_0x496f3b,require(_0x5779('0x36')));_0x496f3b=_['merge'](_0x496f3b,require('../api/whatsappInteraction/whatsappInteraction.rpc'));_0x496f3b=_[_0x5779('0x2')](_0x496f3b,require(_0x5779('0x37')));_0x496f3b=_['merge'](_0x496f3b,require(_0x5779('0x38')));_0x496f3b=_['merge'](_0x496f3b,require('../api/whatsappQueue/whatsappQueue.rpc'));var _0x4cfc54=jayson['server'](_0x496f3b)[_0x5779('0x39')]();var _0x260d7c=config[_0x5779('0x3a')][_0x5779('0x3b')]||config['port']+0x1;var _0xffad65=config[_0x5779('0x3a')]['ip']||'localhost';_0x4cfc54['on'](_0x5779('0x3c'),function(_0x33fa76){return _0x657e35(_0x33fa76);});_0x4cfc54[_0x5779('0x3d')](_0x260d7c,_0xffad65,function(){console[_0x5779('0x3e')](_0x5779('0x3f'),_0xffad65,_0x260d7c);require('../config/triggers')[_0x5779('0x40')]();return _0x2ef82a(_0x5779('0x41')+_0xffad65+':'+_0x260d7c);});});}; \ No newline at end of file +var _0xde83=['Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','default','RPC\x20listening\x20on\x20','jayson/promise','lodash','../config/environment','listen','merge','../api/user/user.rpc','../api/voiceQueue/voiceQueue.rpc','../api/voiceRecording/voiceRecording.rpc','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceDialReport/voiceDialReport.rpc','../api/voiceTransferReport/voiceTransferReport.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailAccount/mailAccount.rpc','../api/mailQueue/mailQueue.rpc','../api/mailInteraction/mailInteraction.rpc','../api/mailMessage/mailMessage.rpc','../api/mailApplication/mailApplication.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxApplication/faxApplication.rpc','../api/faxMessage/faxMessage.rpc','../api/faxQueue/faxQueue.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsAccount/smsAccount.rpc','../api/smsInteraction/smsInteraction.rpc','../api/smsMessage/smsMessage.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelMessage/openchannelMessage.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/chatInteraction/chatInteraction.rpc','../api/chatMessage/chatMessage.rpc','../api/chatQueue/chatQueue.rpc','../api/cmContact/cmContact.rpc','../api/cmHopper/cmHopper.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/interval/interval.rpc','../api/pause/pause.rpc','../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc','../api/template/template.rpc','../api/trigger/trigger.rpc','../api/variable/variable.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intZohoAccount/intZohoAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc','../api/intFreshsalesAccount/intFreshsalesAccount.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/squareReportDetail/squareReportDetail.rpc','../api/setting/setting.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareProject/squareProject.rpc','../api/squareRecording/squareRecording.rpc','../api/campaign/campaign.rpc','../api/attachment/attachment.rpc','../api/plugin/plugin.rpc','../api/whatsappMessage/whatsappMessage.rpc','../api/whatsappQueueReport/whatsappQueueReport.rpc','../api/whatsappQueue/whatsappQueue.rpc','server','http','rpc','port','error','log'];(function(_0x59250d,_0x2119d5){var _0x1e686a=function(_0x133b84){while(--_0x133b84){_0x59250d['push'](_0x59250d['shift']());}};_0x1e686a(++_0x2119d5);}(_0xde83,0xe7));var _0x3de8=function(_0xb66df,_0x4fb5ce){_0xb66df=_0xb66df-0x0;var _0x42a702=_0xde83[_0xb66df];return _0x42a702;};'use strict';var jayson=require(_0x3de8('0x0'));var _=require(_0x3de8('0x1'));var config=require(_0x3de8('0x2'));exports[_0x3de8('0x3')]=function(){return new Promise(function(_0x54efbf,_0x4eb0b4){var _0x3fe36a={};_0x3fe36a=_[_0x3de8('0x4')](_0x3fe36a,require(_0x3de8('0x5')));_0x3fe36a=_[_0x3de8('0x4')](_0x3fe36a,require('../api/voiceExtension/voiceExtension.rpc'));_0x3fe36a=_[_0x3de8('0x4')](_0x3fe36a,require(_0x3de8('0x6')));_0x3fe36a=_['merge'](_0x3fe36a,require(_0x3de8('0x7')));_0x3fe36a=_['merge'](_0x3fe36a,require(_0x3de8('0x8')));_0x3fe36a=_[_0x3de8('0x4')](_0x3fe36a,require(_0x3de8('0x9')));_0x3fe36a=_[_0x3de8('0x4')](_0x3fe36a,require('../api/voiceAgentReport/voiceAgentReport.rpc'));_0x3fe36a=_[_0x3de8('0x4')](_0x3fe36a,require('../api/voiceQueueReport/voiceQueueReport.rpc'));_0x3fe36a=_[_0x3de8('0x4')](_0x3fe36a,require('../api/memberReport/memberReport.rpc'));_0x3fe36a=_['merge'](_0x3fe36a,require('../api/trunk/trunk.rpc'));_0x3fe36a=_[_0x3de8('0x4')](_0x3fe36a,require(_0x3de8('0xa')));_0x3fe36a=_[_0x3de8('0x4')](_0x3fe36a,require(_0x3de8('0xb')));_0x3fe36a=_[_0x3de8('0x4')](_0x3fe36a,require(_0x3de8('0xc')));_0x3fe36a=_[_0x3de8('0x4')](_0x3fe36a,require(_0x3de8('0xd')));_0x3fe36a=_[_0x3de8('0x4')](_0x3fe36a,require(_0x3de8('0xe')));_0x3fe36a=_['merge'](_0x3fe36a,require(_0x3de8('0xf')));_0x3fe36a=_[_0x3de8('0x4')](_0x3fe36a,require(_0x3de8('0x10')));_0x3fe36a=_[_0x3de8('0x4')](_0x3fe36a,require(_0x3de8('0x11')));_0x3fe36a=_[_0x3de8('0x4')](_0x3fe36a,require(_0x3de8('0x12')));_0x3fe36a=_[_0x3de8('0x4')](_0x3fe36a,require('../api/faxAccount/faxAccount.rpc'));_0x3fe36a=_['merge'](_0x3fe36a,require(_0x3de8('0x13')));_0x3fe36a=_[_0x3de8('0x4')](_0x3fe36a,require('../api/faxInteraction/faxInteraction.rpc'));_0x3fe36a=_[_0x3de8('0x4')](_0x3fe36a,require(_0x3de8('0x14')));_0x3fe36a=_[_0x3de8('0x4')](_0x3fe36a,require(_0x3de8('0x15')));_0x3fe36a=_['merge'](_0x3fe36a,require(_0x3de8('0x16')));_0x3fe36a=_[_0x3de8('0x4')](_0x3fe36a,require(_0x3de8('0x17')));_0x3fe36a=_['merge'](_0x3fe36a,require(_0x3de8('0x18')));_0x3fe36a=_['merge'](_0x3fe36a,require(_0x3de8('0x19')));_0x3fe36a=_[_0x3de8('0x4')](_0x3fe36a,require(_0x3de8('0x1a')));_0x3fe36a=_[_0x3de8('0x4')](_0x3fe36a,require(_0x3de8('0x1b')));_0x3fe36a=_[_0x3de8('0x4')](_0x3fe36a,require(_0x3de8('0x1c')));_0x3fe36a=_[_0x3de8('0x4')](_0x3fe36a,require(_0x3de8('0x1d')));_0x3fe36a=_['merge'](_0x3fe36a,require(_0x3de8('0x1e')));_0x3fe36a=_['merge'](_0x3fe36a,require('../api/openchannelQueueReport/openchannelQueueReport.rpc'));_0x3fe36a=_[_0x3de8('0x4')](_0x3fe36a,require(_0x3de8('0x1f')));_0x3fe36a=_[_0x3de8('0x4')](_0x3fe36a,require(_0x3de8('0x20')));_0x3fe36a=_[_0x3de8('0x4')](_0x3fe36a,require(_0x3de8('0x21')));_0x3fe36a=_[_0x3de8('0x4')](_0x3fe36a,require(_0x3de8('0x22')));_0x3fe36a=_['merge'](_0x3fe36a,require(_0x3de8('0x23')));_0x3fe36a=_['merge'](_0x3fe36a,require(_0x3de8('0x24')));_0x3fe36a=_[_0x3de8('0x4')](_0x3fe36a,require(_0x3de8('0x25')));_0x3fe36a=_[_0x3de8('0x4')](_0x3fe36a,require('../api/cmHopperHistory/cmHopperHistory.rpc'));_0x3fe36a=_[_0x3de8('0x4')](_0x3fe36a,require(_0x3de8('0x26')));_0x3fe36a=_[_0x3de8('0x4')](_0x3fe36a,require(_0x3de8('0x27')));_0x3fe36a=_[_0x3de8('0x4')](_0x3fe36a,require(_0x3de8('0x28')));_0x3fe36a=_['merge'](_0x3fe36a,require('../api/sound/sound.rpc'));_0x3fe36a=_['merge'](_0x3fe36a,require(_0x3de8('0x29')));_0x3fe36a=_[_0x3de8('0x4')](_0x3fe36a,require(_0x3de8('0x2a')));_0x3fe36a=_[_0x3de8('0x4')](_0x3fe36a,require(_0x3de8('0x2b')));_0x3fe36a=_[_0x3de8('0x4')](_0x3fe36a,require(_0x3de8('0x2c')));_0x3fe36a=_[_0x3de8('0x4')](_0x3fe36a,require(_0x3de8('0x2d')));_0x3fe36a=_[_0x3de8('0x4')](_0x3fe36a,require('../api/intSugarcrmAccount/intSugarcrmAccount.rpc'));_0x3fe36a=_['merge'](_0x3fe36a,require(_0x3de8('0x2e')));_0x3fe36a=_[_0x3de8('0x4')](_0x3fe36a,require(_0x3de8('0x2f')));_0x3fe36a=_['merge'](_0x3fe36a,require(_0x3de8('0x30')));_0x3fe36a=_[_0x3de8('0x4')](_0x3fe36a,require('../api/intFreshdeskAccount/intFreshdeskAccount.rpc'));_0x3fe36a=_[_0x3de8('0x4')](_0x3fe36a,require(_0x3de8('0x31')));_0x3fe36a=_[_0x3de8('0x4')](_0x3fe36a,require(_0x3de8('0x32')));_0x3fe36a=_['merge'](_0x3fe36a,require(_0x3de8('0x33')));_0x3fe36a=_['merge'](_0x3fe36a,require(_0x3de8('0x34')));_0x3fe36a=_['merge'](_0x3fe36a,require(_0x3de8('0x35')));_0x3fe36a=_[_0x3de8('0x4')](_0x3fe36a,require(_0x3de8('0x36')));_0x3fe36a=_[_0x3de8('0x4')](_0x3fe36a,require(_0x3de8('0x37')));_0x3fe36a=_[_0x3de8('0x4')](_0x3fe36a,require(_0x3de8('0x38')));_0x3fe36a=_[_0x3de8('0x4')](_0x3fe36a,require(_0x3de8('0x39')));_0x3fe36a=_['merge'](_0x3fe36a,require(_0x3de8('0x3a')));_0x3fe36a=_['merge'](_0x3fe36a,require(_0x3de8('0x3b')));_0x3fe36a=_[_0x3de8('0x4')](_0x3fe36a,require(_0x3de8('0x3c')));_0x3fe36a=_['merge'](_0x3fe36a,require('../api/squareMessage/squareMessage.rpc'));_0x3fe36a=_[_0x3de8('0x4')](_0x3fe36a,require(_0x3de8('0x3d')));_0x3fe36a=_['merge'](_0x3fe36a,require(_0x3de8('0x3e')));_0x3fe36a=_[_0x3de8('0x4')](_0x3fe36a,require(_0x3de8('0x3f')));_0x3fe36a=_[_0x3de8('0x4')](_0x3fe36a,require('../api/whatsappAccount/whatsappAccount.rpc'));_0x3fe36a=_[_0x3de8('0x4')](_0x3fe36a,require('../api/whatsappInteraction/whatsappInteraction.rpc'));_0x3fe36a=_['merge'](_0x3fe36a,require(_0x3de8('0x40')));_0x3fe36a=_[_0x3de8('0x4')](_0x3fe36a,require(_0x3de8('0x41')));_0x3fe36a=_[_0x3de8('0x4')](_0x3fe36a,require(_0x3de8('0x42')));var _0x21a520=jayson[_0x3de8('0x43')](_0x3fe36a)[_0x3de8('0x44')]();var _0x2017b3=config[_0x3de8('0x45')][_0x3de8('0x46')]||config[_0x3de8('0x46')]+0x1;var _0x2964c3=config[_0x3de8('0x45')]['ip']||'localhost';_0x21a520['on'](_0x3de8('0x47'),function(_0x40538a){return _0x4eb0b4(_0x40538a);});_0x21a520[_0x3de8('0x3')](_0x2017b3,_0x2964c3,function(){console[_0x3de8('0x48')](_0x3de8('0x49'),_0x2964c3,_0x2017b3);require('../config/triggers')[_0x3de8('0x4a')]();return _0x54efbf(_0x3de8('0x4b')+_0x2964c3+':'+_0x2017b3);});});}; \ No newline at end of file diff --git a/server/services/agi/channel.js b/server/services/agi/channel.js index 9d12da4..199e1a6 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 _0xac6a=['isArray','join','setContext','SET\x20CONTEXT\x20%s','setExtension','SET\x20EXTENSION\x20%s','setPriority','SET\x20PRIORITY\x20%s','setVariable','SET\x20VARIABLE\x20%s\x20\x22%s\x22','sayNumber','SAY\x20NUMBER\x20%s\x20%s','sayDigits','SAY\x20DIGITS\x20%s\x20%s','sayPhonetic','continueAt','getVariable','GET\x20VARIABLE\x20\x22%s\x22','recordFile','wav','BEEP','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','streamFile','agi','AGI','wait','WAIT','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','label','exports','util','lodash','events','EventEmitter','./reply','call','setEncoding','utf8','setTimeout','headers','ready','line','toLowerCase','hangup','emit','substring','520-Invalid','search','520\x20End\x20of\x20proper','function','replace','result=','indexOf','substr','startsWith','split','length','match','error','code','close','E_AGI_SOCKET_CLOSE','timeout','E_AGI_SOCKET_TIMEOUT','destroy','pipe','command','write','inherits','prototype','sync','answer','sendRequest','ANSWER','getData','beep','format','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','noop','NO\x20MESSAGE','VERBOSE\x20\x22%s\x22','exec'];(function(_0x5e2790,_0x2d17ee){var _0x3f2541=function(_0x5aaa0f){while(--_0x5aaa0f){_0x5e2790['push'](_0x5e2790['shift']());}};_0x3f2541(++_0x2d17ee);}(_0xac6a,0xc2));var _0xaac6=function(_0x45a411,_0x10ec50){_0x45a411=_0x45a411-0x0;var _0x3a0935=_0xac6a[_0x45a411];return _0x3a0935;};'use strict';var util=require(_0xaac6('0x0'));var _=require(_0xaac6('0x1'));var EventEmitter=require(_0xaac6('0x2'))[_0xaac6('0x3')];var AGIReply=require(_0xaac6('0x4'));var AGIError=require('./error');function AGIChannel(_0x914af9){var _0x4c0cf4=this,_0x9dc043=new AGIReply(),_0x1a0d76=![],_0x44259b={};EventEmitter[_0xaac6('0x5')](_0x4c0cf4);_0x914af9[_0xaac6('0x6')](_0xaac6('0x7'));_0x914af9[_0xaac6('0x8')](0x8*0x3c*0x3c*0x3e8);_0x9dc043[_0xaac6('0x6')](_0xaac6('0x7'));_0x9dc043['on'](_0xaac6('0x9'),function(_0x404a53){for(var _0xabd35 in _0x404a53){_0x4c0cf4[_0xabd35]=_0x404a53[_0xabd35];}_0x4c0cf4['emit'](_0xaac6('0xa'));});_0x9dc043['on'](_0xaac6('0xb'),function(_0x31fa92){if(_0x31fa92[_0xaac6('0xc')]()==_0xaac6('0xd')){_0x4c0cf4[_0xaac6('0xe')]('hangup');return;}if(_0x31fa92[_0xaac6('0xf')](0x0,0xb)==_0xaac6('0x10')){_0x1a0d76=!![];}if(_0x1a0d76){_0x44259b['rx']+=_0x31fa92+'\x0a';if(_0x31fa92[_0xaac6('0x11')](_0xaac6('0x12'))!=-0x1){_0x1a0d76=![];}}else{_0x44259b['rx']=_0x31fa92;}if(_0x1a0d76){return;}if(typeof _0x44259b['cb']==_0xaac6('0x13')){var _0x57869f=_0x44259b['rx']['substring'](0x0,0x3),_0x551fea=null,_0x1efac6=null;_0x57869f=parseInt(_0x57869f);if(isNaN(_0x57869f)){_0x44259b['cb'](null,{'code':0x1f4,'result':-0x1,'extra':'no\x20code'});return;}if(_0x57869f!=0xc8){_0x44259b['cb'](null,{'code':_0x57869f,'result':-0x1,'extra':'KO'});return;}_0x551fea=_0x44259b['rx'][_0xaac6('0xf')](0x4)[_0xaac6('0x14')](_0xaac6('0x15'),'');if(_0x551fea[_0xaac6('0x16')]('\x20')!=-0x1){_0x551fea=_0x551fea[_0xaac6('0x17')](0x0,_0x551fea[_0xaac6('0x16')]('\x20'));}if(_[_0xaac6('0x18')](_0x551fea,'-1')){_0x551fea=parseInt(_0x551fea);}_0x1efac6=_0x44259b['rx'][_0xaac6('0x19')]('\x20');if(_0x1efac6[_0xaac6('0x1a')]==0x3){_0x1efac6=_0x1efac6[0x2][_0xaac6('0xf')](0x1,_0x1efac6[0x2][_0xaac6('0x1a')]-0x1);}else if(_0x1efac6[_0xaac6('0x1a')]>0x3){var _0x4c2de0=/\((.+)\)/;var _0x5a5397=_0x44259b['rx'][_0xaac6('0x1b')](_0x4c2de0);if(_0x5a5397){_0x1efac6=_0x5a5397[0x1];}else{_0x1efac6=null;}}else{_0x1efac6=null;}_0x44259b['cb'](null,{'code':_0x57869f,'result':_0x551fea,'extra':_0x1efac6});}});_0x914af9['on'](_0xaac6('0x1c'),function(_0x3cce6f){_0x4c0cf4[_0xaac6('0xe')](_0xaac6('0x1c'),new AGIError('E_AGI_SOCKET_ERROR',_0x3cce6f[_0xaac6('0x1d')]));});_0x914af9['on'](_0xaac6('0x1e'),function(){_0x4c0cf4[_0xaac6('0xe')](_0xaac6('0x1e'),new AGIError(_0xaac6('0x1f')));});_0x914af9['on'](_0xaac6('0x20'),function(){_0x4c0cf4[_0xaac6('0xe')]('timeout',new AGIError(_0xaac6('0x21')));_0x914af9[_0xaac6('0x22')]();});_0x914af9[_0xaac6('0x23')](_0x9dc043);this[_0xaac6('0x24')]=function(_0x24b10,_0x12682c){var _0x24b10=_0x24b10||'',_0x12682c=typeof _0x12682c=='function'?_0x12682c:new Function();_0x44259b={'tx':_0x24b10,'rx':'','cb':_0x12682c};_0x914af9[_0xaac6('0x25')](_0x24b10+'\x0a');},this['close']=function(){_0x914af9[_0xaac6('0x22')]();};}util[_0xaac6('0x26')](AGIChannel,EventEmitter);AGIChannel[_0xaac6('0x27')]['sendRequest']=function(_0x1b0007){return this['command'][_0xaac6('0x28')](this,_0x1b0007);};AGIChannel[_0xaac6('0x27')][_0xaac6('0x29')]=function(){return this[_0xaac6('0x2a')](_0xaac6('0x2b'));};AGIChannel['prototype'][_0xaac6('0x2c')]=function(_0x321cbc,_0x4c0ed6,_0x50a896){_0x321cbc=_0x321cbc===undefined?_0xaac6('0x2d'):_0x321cbc;_0x4c0ed6=_0x4c0ed6===undefined?'5':_0x4c0ed6;_0x50a896=_0x50a896===undefined?'1':_0x50a896;return this['sendRequest'](util[_0xaac6('0x2e')](_0xaac6('0x2f'),_0x321cbc,_0x4c0ed6*0x3e8,_0x50a896));};AGIChannel[_0xaac6('0x27')][_0xaac6('0x30')]=function(_0x19f0c0){_0x19f0c0=_0x19f0c0||_0xaac6('0x31');return this[_0xaac6('0x2a')](util[_0xaac6('0x2e')](_0xaac6('0x32'),_0x19f0c0));};AGIChannel['prototype'][_0xaac6('0x33')]=function(_0x14bd4f,_0x43c46e){if(_[_0xaac6('0x34')](_0x43c46e)){return this[_0xaac6('0x2a')](util['format']('EXEC\x20%s\x20%s',_0x14bd4f,_0x43c46e[_0xaac6('0x35')](',')));}return this[_0xaac6('0x2a')](util[_0xaac6('0x2e')]('EXEC\x20%s\x20%s',_0x14bd4f,_0x43c46e));};AGIChannel[_0xaac6('0x27')][_0xaac6('0x36')]=function(_0x320b02){return this['sendRequest'](util[_0xaac6('0x2e')](_0xaac6('0x37'),_0x320b02));};AGIChannel[_0xaac6('0x27')][_0xaac6('0x38')]=function(_0x2b12e6){return this['sendRequest'](util[_0xaac6('0x2e')](_0xaac6('0x39'),_0x2b12e6));};AGIChannel['prototype'][_0xaac6('0x3a')]=function(_0x4733d9){return this['sendRequest'](util[_0xaac6('0x2e')](_0xaac6('0x3b'),_0x4733d9));};AGIChannel[_0xaac6('0x27')][_0xaac6('0xd')]=function(){return this[_0xaac6('0x2a')]('HANGUP');};AGIChannel[_0xaac6('0x27')][_0xaac6('0x3c')]=function(_0x31059b,_0x1dc0d8){var _0x3aecf4=_['isBoolean'](_0x1dc0d8)||_['isNumber'](_0x1dc0d8)?_0x1dc0d8['toString']():_0x1dc0d8;return this['sendRequest'](util['format'](_0xaac6('0x3d'),_0x31059b,_0x3aecf4?_0x3aecf4['toString']()[_0xaac6('0x14')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0xaac6('0x27')][_0xaac6('0x3e')]=function(_0x2aa206,_0x4404f4){return this[_0xaac6('0x2a')](util[_0xaac6('0x2e')](_0xaac6('0x3f'),_0x2aa206,_0x4404f4));};AGIChannel[_0xaac6('0x27')][_0xaac6('0x40')]=function(_0x57e0e0,_0x55da98){return this['sendRequest'](util[_0xaac6('0x2e')](_0xaac6('0x41'),_0x57e0e0,_0x55da98));};AGIChannel['prototype'][_0xaac6('0x42')]=function(_0x3d5807,_0x15e602){return this[_0xaac6('0x2a')](util[_0xaac6('0x2e')]('SAY\x20PHONETIC\x20\x22%s\x22\x20%s',_0x3d5807,_0x15e602));};AGIChannel[_0xaac6('0x27')][_0xaac6('0x43')]=function(_0x25536d,_0x53676d,_0x5803b6){_0x53676d=_0x53676d||this['extension'];_0x5803b6=_0x5803b6||0x1;this[_0xaac6('0x36')](_0x25536d);this[_0xaac6('0x38')](_0x53676d);this[_0xaac6('0x3a')](_0x5803b6);return this[_0xaac6('0x30')](util['format']('GOTO\x20%s\x20%s\x20%s',_0x25536d,_0x53676d,_0x5803b6));};AGIChannel[_0xaac6('0x27')][_0xaac6('0x44')]=function(_0x217e6e){return this[_0xaac6('0x2a')](util[_0xaac6('0x2e')](_0xaac6('0x45'),_0x217e6e));};AGIChannel[_0xaac6('0x27')][_0xaac6('0x46')]=function(_0x58a09a,_0xe3bb21,_0x3bda09,_0x546aa3,_0x2399bc,_0x1c52e7){_0xe3bb21=_0xe3bb21||_0xaac6('0x47');_0x3bda09=_0x3bda09||'';_0x546aa3=_0x546aa3===undefined?-0x1:_0x546aa3==='-1'?-0x1:_0x546aa3*0x3e8;_0x2399bc=_0x2399bc===undefined?'':'s='+_0x2399bc;_0x1c52e7=_0x1c52e7?_0xaac6('0x48'):'';return this[_0xaac6('0x2a')](util['format'](_0xaac6('0x49'),_0x58a09a,_0xe3bb21,_0x3bda09,_0x546aa3,_0x1c52e7,_0x2399bc));};AGIChannel['prototype'][_0xaac6('0x4a')]=function(_0x22de15,_0x3f75b8){_0x3f75b8=_0x3f75b8||'';return this[_0xaac6('0x2a')](util[_0xaac6('0x2e')]('STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22',_0x22de15,_0x3f75b8));};AGIChannel[_0xaac6('0x27')][_0xaac6('0x4b')]=function(_0x274ef7){return this[_0xaac6('0x33')](_0xaac6('0x4c'),_0x274ef7);};AGIChannel[_0xaac6('0x27')][_0xaac6('0x4d')]=function(_0x31b00a){return this['exec'](_0xaac6('0x4e'),_0x31b00a);};AGIChannel[_0xaac6('0x27')][_0xaac6('0x1c')]=function(_0x55e16b,_0x15d695){this[_0xaac6('0x30')](util[_0xaac6('0x2e')](_0xaac6('0x4f'),_0x55e16b['id'],_0x55e16b[_0xaac6('0x50')],_0x15d695));return{'code':0x1f4,'result':'-1','extra':''};};module[_0xaac6('0x51')]=AGIChannel; \ No newline at end of file +var _0xbc00=['setPriority','SET\x20PRIORITY\x20%s','HANGUP','setVariable','isBoolean','toString','SET\x20VARIABLE\x20%s\x20\x22%s\x22','sayNumber','SAY\x20NUMBER\x20%s\x20%s','sayDigits','SAY\x20DIGITS\x20%s\x20%s','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','continueAt','extension','setExtension','GOTO\x20%s\x20%s\x20%s','GET\x20VARIABLE\x20\x22%s\x22','recordFile','wav','BEEP','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','streamFile','STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22','AGI','wait','WAIT','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','label','exports','util','lodash','EventEmitter','./error','utf8','setTimeout','setEncoding','headers','emit','ready','hangup','substring','520-Invalid','search','520\x20End\x20of\x20proper','result=','indexOf','substr','startsWith','split','length','match','error','code','close','timeout','destroy','pipe','command','function','write','inherits','prototype','sendRequest','sync','answer','ANSWER','getData','beep','format','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','noop','NO\x20MESSAGE','VERBOSE\x20\x22%s\x22','exec','EXEC\x20%s\x20%s','join','setContext','SET\x20EXTENSION\x20%s'];(function(_0x4076fe,_0x27cad8){var _0xbb2dd=function(_0x2b8739){while(--_0x2b8739){_0x4076fe['push'](_0x4076fe['shift']());}};_0xbb2dd(++_0x27cad8);}(_0xbc00,0x107));var _0x0bc0=function(_0x51c819,_0xd812db){_0x51c819=_0x51c819-0x0;var _0x15c5d2=_0xbc00[_0x51c819];return _0x15c5d2;};'use strict';var util=require(_0x0bc0('0x0'));var _=require(_0x0bc0('0x1'));var EventEmitter=require('events')[_0x0bc0('0x2')];var AGIReply=require('./reply');var AGIError=require(_0x0bc0('0x3'));function AGIChannel(_0x1d4ea5){var _0x4635b4=this,_0x5d2bba=new AGIReply(),_0x41c332=![],_0x81c327={};EventEmitter['call'](_0x4635b4);_0x1d4ea5['setEncoding'](_0x0bc0('0x4'));_0x1d4ea5[_0x0bc0('0x5')](0x8*0x3c*0x3c*0x3e8);_0x5d2bba[_0x0bc0('0x6')](_0x0bc0('0x4'));_0x5d2bba['on'](_0x0bc0('0x7'),function(_0x45c25e){for(var _0x3e77d4 in _0x45c25e){_0x4635b4[_0x3e77d4]=_0x45c25e[_0x3e77d4];}_0x4635b4[_0x0bc0('0x8')](_0x0bc0('0x9'));});_0x5d2bba['on']('line',function(_0xf20ed5){if(_0xf20ed5['toLowerCase']()==_0x0bc0('0xa')){_0x4635b4[_0x0bc0('0x8')](_0x0bc0('0xa'));return;}if(_0xf20ed5[_0x0bc0('0xb')](0x0,0xb)==_0x0bc0('0xc')){_0x41c332=!![];}if(_0x41c332){_0x81c327['rx']+=_0xf20ed5+'\x0a';if(_0xf20ed5[_0x0bc0('0xd')](_0x0bc0('0xe'))!=-0x1){_0x41c332=![];}}else{_0x81c327['rx']=_0xf20ed5;}if(_0x41c332){return;}if(typeof _0x81c327['cb']=='function'){var _0x10021d=_0x81c327['rx'][_0x0bc0('0xb')](0x0,0x3),_0x15afb2=null,_0x1ed38b=null;_0x10021d=parseInt(_0x10021d);if(isNaN(_0x10021d)){_0x81c327['cb'](null,{'code':0x1f4,'result':-0x1,'extra':'no\x20code'});return;}if(_0x10021d!=0xc8){_0x81c327['cb'](null,{'code':_0x10021d,'result':-0x1,'extra':'KO'});return;}_0x15afb2=_0x81c327['rx'][_0x0bc0('0xb')](0x4)['replace'](_0x0bc0('0xf'),'');if(_0x15afb2[_0x0bc0('0x10')]('\x20')!=-0x1){_0x15afb2=_0x15afb2[_0x0bc0('0x11')](0x0,_0x15afb2[_0x0bc0('0x10')]('\x20'));}if(_[_0x0bc0('0x12')](_0x15afb2,'-1')){_0x15afb2=parseInt(_0x15afb2);}_0x1ed38b=_0x81c327['rx'][_0x0bc0('0x13')]('\x20');if(_0x1ed38b['length']==0x3){_0x1ed38b=_0x1ed38b[0x2][_0x0bc0('0xb')](0x1,_0x1ed38b[0x2][_0x0bc0('0x14')]-0x1);}else if(_0x1ed38b['length']>0x3){var _0x3ee10b=/\((.+)\)/;var _0x1a8bd6=_0x81c327['rx'][_0x0bc0('0x15')](_0x3ee10b);if(_0x1a8bd6){_0x1ed38b=_0x1a8bd6[0x1];}else{_0x1ed38b=null;}}else{_0x1ed38b=null;}_0x81c327['cb'](null,{'code':_0x10021d,'result':_0x15afb2,'extra':_0x1ed38b});}});_0x1d4ea5['on'](_0x0bc0('0x16'),function(_0x286539){_0x4635b4[_0x0bc0('0x8')](_0x0bc0('0x16'),new AGIError('E_AGI_SOCKET_ERROR',_0x286539[_0x0bc0('0x17')]));});_0x1d4ea5['on'](_0x0bc0('0x18'),function(){_0x4635b4[_0x0bc0('0x8')](_0x0bc0('0x18'),new AGIError('E_AGI_SOCKET_CLOSE'));});_0x1d4ea5['on'](_0x0bc0('0x19'),function(){_0x4635b4[_0x0bc0('0x8')](_0x0bc0('0x19'),new AGIError('E_AGI_SOCKET_TIMEOUT'));_0x1d4ea5[_0x0bc0('0x1a')]();});_0x1d4ea5[_0x0bc0('0x1b')](_0x5d2bba);this[_0x0bc0('0x1c')]=function(_0xa61eaf,_0x45cdc3){var _0xa61eaf=_0xa61eaf||'',_0x45cdc3=typeof _0x45cdc3==_0x0bc0('0x1d')?_0x45cdc3:new Function();_0x81c327={'tx':_0xa61eaf,'rx':'','cb':_0x45cdc3};_0x1d4ea5[_0x0bc0('0x1e')](_0xa61eaf+'\x0a');},this[_0x0bc0('0x18')]=function(){_0x1d4ea5[_0x0bc0('0x1a')]();};}util[_0x0bc0('0x1f')](AGIChannel,EventEmitter);AGIChannel[_0x0bc0('0x20')][_0x0bc0('0x21')]=function(_0xa94c49){return this[_0x0bc0('0x1c')][_0x0bc0('0x22')](this,_0xa94c49);};AGIChannel['prototype'][_0x0bc0('0x23')]=function(){return this['sendRequest'](_0x0bc0('0x24'));};AGIChannel[_0x0bc0('0x20')][_0x0bc0('0x25')]=function(_0x382f2e,_0x40c5f5,_0x4cd7d1){_0x382f2e=_0x382f2e===undefined?_0x0bc0('0x26'):_0x382f2e;_0x40c5f5=_0x40c5f5===undefined?'5':_0x40c5f5;_0x4cd7d1=_0x4cd7d1===undefined?'1':_0x4cd7d1;return this[_0x0bc0('0x21')](util[_0x0bc0('0x27')](_0x0bc0('0x28'),_0x382f2e,_0x40c5f5*0x3e8,_0x4cd7d1));};AGIChannel[_0x0bc0('0x20')][_0x0bc0('0x29')]=function(_0x3d9a3b){_0x3d9a3b=_0x3d9a3b||_0x0bc0('0x2a');return this[_0x0bc0('0x21')](util[_0x0bc0('0x27')](_0x0bc0('0x2b'),_0x3d9a3b));};AGIChannel['prototype'][_0x0bc0('0x2c')]=function(_0x389e30,_0x4624aa){if(_['isArray'](_0x4624aa)){return this[_0x0bc0('0x21')](util[_0x0bc0('0x27')](_0x0bc0('0x2d'),_0x389e30,_0x4624aa[_0x0bc0('0x2e')](',')));}return this['sendRequest'](util[_0x0bc0('0x27')](_0x0bc0('0x2d'),_0x389e30,_0x4624aa));};AGIChannel[_0x0bc0('0x20')][_0x0bc0('0x2f')]=function(_0x1733d6){return this[_0x0bc0('0x21')](util[_0x0bc0('0x27')]('SET\x20CONTEXT\x20%s',_0x1733d6));};AGIChannel['prototype']['setExtension']=function(_0x3fef87){return this[_0x0bc0('0x21')](util[_0x0bc0('0x27')](_0x0bc0('0x30'),_0x3fef87));};AGIChannel['prototype'][_0x0bc0('0x31')]=function(_0x23d5ad){return this[_0x0bc0('0x21')](util[_0x0bc0('0x27')](_0x0bc0('0x32'),_0x23d5ad));};AGIChannel[_0x0bc0('0x20')][_0x0bc0('0xa')]=function(){return this[_0x0bc0('0x21')](_0x0bc0('0x33'));};AGIChannel[_0x0bc0('0x20')][_0x0bc0('0x34')]=function(_0x1659d3,_0x4ad72a){var _0x51d49e=_[_0x0bc0('0x35')](_0x4ad72a)||_['isNumber'](_0x4ad72a)?_0x4ad72a[_0x0bc0('0x36')]():_0x4ad72a;return this['sendRequest'](util['format'](_0x0bc0('0x37'),_0x1659d3,_0x51d49e?_0x51d49e[_0x0bc0('0x36')]()['replace'](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0x0bc0('0x20')][_0x0bc0('0x38')]=function(_0x50606a,_0x4013b1){return this['sendRequest'](util[_0x0bc0('0x27')](_0x0bc0('0x39'),_0x50606a,_0x4013b1));};AGIChannel[_0x0bc0('0x20')][_0x0bc0('0x3a')]=function(_0x13b75e,_0xbe41c8){return this[_0x0bc0('0x21')](util[_0x0bc0('0x27')](_0x0bc0('0x3b'),_0x13b75e,_0xbe41c8));};AGIChannel[_0x0bc0('0x20')]['sayPhonetic']=function(_0x5ed9ab,_0xd76926){return this[_0x0bc0('0x21')](util[_0x0bc0('0x27')](_0x0bc0('0x3c'),_0x5ed9ab,_0xd76926));};AGIChannel[_0x0bc0('0x20')][_0x0bc0('0x3d')]=function(_0x111cdc,_0x305c97,_0x12db1a){_0x305c97=_0x305c97||this[_0x0bc0('0x3e')];_0x12db1a=_0x12db1a||0x1;this['setContext'](_0x111cdc);this[_0x0bc0('0x3f')](_0x305c97);this[_0x0bc0('0x31')](_0x12db1a);return this[_0x0bc0('0x29')](util['format'](_0x0bc0('0x40'),_0x111cdc,_0x305c97,_0x12db1a));};AGIChannel['prototype']['getVariable']=function(_0x408f5b){return this[_0x0bc0('0x21')](util[_0x0bc0('0x27')](_0x0bc0('0x41'),_0x408f5b));};AGIChannel[_0x0bc0('0x20')][_0x0bc0('0x42')]=function(_0x58dc11,_0x202c04,_0x3d1e7f,_0x279be2,_0x48616d,_0x6bfd68){_0x202c04=_0x202c04||_0x0bc0('0x43');_0x3d1e7f=_0x3d1e7f||'';_0x279be2=_0x279be2===undefined?-0x1:_0x279be2==='-1'?-0x1:_0x279be2*0x3e8;_0x48616d=_0x48616d===undefined?'':'s='+_0x48616d;_0x6bfd68=_0x6bfd68?_0x0bc0('0x44'):'';return this['sendRequest'](util[_0x0bc0('0x27')](_0x0bc0('0x45'),_0x58dc11,_0x202c04,_0x3d1e7f,_0x279be2,_0x6bfd68,_0x48616d));};AGIChannel[_0x0bc0('0x20')][_0x0bc0('0x46')]=function(_0x55d189,_0x6013f7){_0x6013f7=_0x6013f7||'';return this[_0x0bc0('0x21')](util['format'](_0x0bc0('0x47'),_0x55d189,_0x6013f7));};AGIChannel[_0x0bc0('0x20')]['agi']=function(_0x16425e){return this['exec'](_0x0bc0('0x48'),_0x16425e);};AGIChannel[_0x0bc0('0x20')][_0x0bc0('0x49')]=function(_0x28e497){return this[_0x0bc0('0x2c')](_0x0bc0('0x4a'),_0x28e497);};AGIChannel['prototype'][_0x0bc0('0x16')]=function(_0x95fa88,_0x55fbc1){this['noop'](util[_0x0bc0('0x27')](_0x0bc0('0x4b'),_0x95fa88['id'],_0x95fa88[_0x0bc0('0x4c')],_0x55fbc1));return{'code':0x1f4,'result':'-1','extra':''};};module[_0x0bc0('0x4d')]=AGIChannel; \ No newline at end of file diff --git a/server/services/agi/error.js b/server/services/agi/error.js index 5eef71b..48df36e 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 _0x50fd=['Empty\x20command.','Missing\x20\x27ivr.agi_network_script\x27.','Missing\x20\x27ivr.entry\x27\x20menu.','E_AGI_UNDEFINED','push','message','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.','Socket\x20error.\x20Code:\x20%s.','Socket\x20closed.','Socket\x20timeout.'];(function(_0x3d2438,_0x2e7922){var _0xd18de5=function(_0xe8a130){while(--_0xe8a130){_0x3d2438['push'](_0x3d2438['shift']());}};_0xd18de5(++_0x2e7922);}(_0x50fd,0xb2));var _0xd50f=function(_0x259e0a,_0x1d0688){_0x259e0a=_0x259e0a-0x0;var _0x4b4a3b=_0x50fd[_0x259e0a];return _0x4b4a3b;};'use strict';var util=require(_0xd50f('0x0'));var error={'E_AGI_UNDEFINED':_0xd50f('0x1'),'E_AGI_ARGUMENT_PORT':_0xd50f('0x2'),'E_AGI_SERVER_ERROR':_0xd50f('0x3'),'E_AGI_SERVER_CLOSE':_0xd50f('0x4'),'E_AGI_SERVER_MAXCONNECTION':_0xd50f('0x5'),'E_AGI_SERVER_VOICE_DISABLED':'[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','E_AGI_SOCKET_ERROR':_0xd50f('0x6'),'E_AGI_SOCKET_CLOSE':_0xd50f('0x7'),'E_AGI_SOCKET_TIMEOUT':_0xd50f('0x8'),'E_AGI_COMMAND_EMPTY':_0xd50f('0x9'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':_0xd50f('0xa'),'E_AGI_IVR_ENTRY':_0xd50f('0xb')};function AGIError(_0x244947){var _0x244947=_0x244947||null,_0xb90c2f=_0xb90c2f||[],_0xcb0fe4=0x1,_0x27e961='';if(!error[_0x244947]){_0x244947=_0xd50f('0xc');}_0xb90c2f[_0xd50f('0xd')](error[_0x244947]);while(arguments[_0xcb0fe4]){_0xb90c2f[_0xd50f('0xd')](arguments[_0xcb0fe4]);_0xcb0fe4++;}_0x27e961=util['format']['apply'](util,_0xb90c2f);this[_0xd50f('0xe')]=_0x27e961;this[_0xd50f('0xf')]=_0x244947;}module[_0xd50f('0x10')]=AGIError; \ No newline at end of file +var _0x8c40=['push','name','exports','util','Undefined\x20error.','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20closed.','[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20error.\x20Code:\x20%s.','Socket\x20timeout.','Empty\x20command.','Missing\x20\x27ivr.agi_network_script\x27.','E_AGI_UNDEFINED'];(function(_0x219fa0,_0x18b239){var _0xc603fb=function(_0x3371ad){while(--_0x3371ad){_0x219fa0['push'](_0x219fa0['shift']());}};_0xc603fb(++_0x18b239);}(_0x8c40,0x16f));var _0x08c4=function(_0xacaa8f,_0xb638d0){_0xacaa8f=_0xacaa8f-0x0;var _0x56be46=_0x8c40[_0xacaa8f];return _0x56be46;};'use strict';var util=require(_0x08c4('0x0'));var error={'E_AGI_UNDEFINED':_0x08c4('0x1'),'E_AGI_ARGUMENT_PORT':_0x08c4('0x2'),'E_AGI_SERVER_ERROR':'Server\x20error.\x20Code:\x20%s.','E_AGI_SERVER_CLOSE':_0x08c4('0x3'),'E_AGI_SERVER_MAXCONNECTION':_0x08c4('0x4'),'E_AGI_SERVER_VOICE_DISABLED':_0x08c4('0x5'),'E_AGI_SOCKET_ERROR':_0x08c4('0x6'),'E_AGI_SOCKET_CLOSE':'Socket\x20closed.','E_AGI_SOCKET_TIMEOUT':_0x08c4('0x7'),'E_AGI_COMMAND_EMPTY':_0x08c4('0x8'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':_0x08c4('0x9'),'E_AGI_IVR_ENTRY':'Missing\x20\x27ivr.entry\x27\x20menu.'};function AGIError(_0x508f69){var _0x508f69=_0x508f69||null,_0x4d5201=_0x4d5201||[],_0x219c3a=0x1,_0x877e8f='';if(!error[_0x508f69]){_0x508f69=_0x08c4('0xa');}_0x4d5201[_0x08c4('0xb')](error[_0x508f69]);while(arguments[_0x219c3a]){_0x4d5201[_0x08c4('0xb')](arguments[_0x219c3a]);_0x219c3a++;}_0x877e8f=util['format']['apply'](util,_0x4d5201);this['message']=_0x877e8f;this[_0x08c4('0xc')]=_0x508f69;}module[_0x08c4('0xd')]=AGIError; \ No newline at end of file diff --git a/server/services/agi/events.js b/server/services/agi/events.js index 412cf5a..344c728 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 _0xae4c=['events','EventEmitter','ioredis','./error','../../config/environment','redis','localhost','agi','emit','error','message','parse','projectUpdate','E_AGI_SERVER_ERROR','exports','lodash'];(function(_0x581367,_0x53b628){var _0x34fb5d=function(_0x48eff9){while(--_0x48eff9){_0x581367['push'](_0x581367['shift']());}};_0x34fb5d(++_0x53b628);}(_0xae4c,0x1ef));var _0xcae4=function(_0x5d0792,_0x486759){_0x5d0792=_0x5d0792-0x0;var _0x2885a6=_0xae4c[_0x5d0792];return _0x2885a6;};'use strict';var _=require(_0xcae4('0x0'));var EventEmitter=require(_0xcae4('0x1'))[_0xcae4('0x2')];var Redis=require(_0xcae4('0x3'));var AGIError=require(_0xcae4('0x4'));var config=require(_0xcae4('0x5'));config[_0xcae4('0x6')]=_['defaults'](config[_0xcae4('0x6')],{'host':_0xcae4('0x7'),'port':0x18eb});var eventEmitter=new EventEmitter();var sub=new Redis(config[_0xcae4('0x6')]);sub['subscribe'](_0xcae4('0x8'),function(_0xc3b7b9){if(_0xc3b7b9)return eventEmitter[_0xcae4('0x9')](_0xcae4('0xa'),new AGIError('E_AGI_SERVER_ERROR',_0xc3b7b9));});sub['on'](_0xcae4('0xb'),function(_0x235244,_0x5d890d){if(_0x235244!==_0xcae4('0x8'))return;try{var _0x5a2a88=JSON[_0xcae4('0xc')](_0x5d890d);eventEmitter[_0xcae4('0x9')](_0xcae4('0xd'),_0x5a2a88);}catch(_0x6c188f){eventEmitter['emit']('error',new AGIError(_0xcae4('0xe'),_0x6c188f));}});module[_0xcae4('0xf')]={'EventEmitter':eventEmitter}; \ No newline at end of file +var _0x31b0=['defaults','redis','localhost','agi','emit','error','E_AGI_SERVER_ERROR','message','parse','projectUpdate','exports','events','../../config/environment'];(function(_0x75eccc,_0x4c2958){var _0x3ac04b=function(_0x271b34){while(--_0x271b34){_0x75eccc['push'](_0x75eccc['shift']());}};_0x3ac04b(++_0x4c2958);}(_0x31b0,0x1d2));var _0x031b=function(_0x1ef909,_0x29e7dd){_0x1ef909=_0x1ef909-0x0;var _0x2a9278=_0x31b0[_0x1ef909];return _0x2a9278;};'use strict';var _=require('lodash');var EventEmitter=require(_0x031b('0x0'))['EventEmitter'];var Redis=require('ioredis');var AGIError=require('./error');var config=require(_0x031b('0x1'));config['redis']=_[_0x031b('0x2')](config[_0x031b('0x3')],{'host':_0x031b('0x4'),'port':0x18eb});var eventEmitter=new EventEmitter();var sub=new Redis(config[_0x031b('0x3')]);sub['subscribe'](_0x031b('0x5'),function(_0x292bc8){if(_0x292bc8)return eventEmitter[_0x031b('0x6')](_0x031b('0x7'),new AGIError(_0x031b('0x8'),_0x292bc8));});sub['on'](_0x031b('0x9'),function(_0x11cbf9,_0x38e5c4){if(_0x11cbf9!=='agi')return;try{var _0x5a0e00=JSON[_0x031b('0xa')](_0x38e5c4);eventEmitter[_0x031b('0x6')](_0x031b('0xb'),_0x5a0e00);}catch(_0x1d52c2){eventEmitter[_0x031b('0x6')](_0x031b('0x7'),new AGIError(_0x031b('0x8'),_0x1d52c2));}});module[_0x031b('0xc')]={'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 e4fa6c9..a9b334e 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 _0x367f=['length','info','no\x20edge/s\x20available','condition','agicommand','vswitch','target','default','menu','invalid','traverseBFS','default\x20on\x20switch\x20not\x20found','includes','lodash','../../../config/logger','vertices','edges','numberOfEdges','prototype','addVertex','addEdge','push','size','getVertex','no\x20vertex\x20found','stop\x20traverse'];(function(_0x3cea78,_0x4a6751){var _0x33b66b=function(_0x1f45cd){while(--_0x1f45cd){_0x3cea78['push'](_0x3cea78['shift']());}};_0x33b66b(++_0x4a6751);}(_0x367f,0x179));var _0xf367=function(_0x476183,_0x7c8f6d){_0x476183=_0x476183-0x0;var _0x31ad71=_0x367f[_0x476183];return _0x31ad71;};'use strict';var _=require(_0xf367('0x0'));var logger=require(_0xf367('0x1'))('agi');var verticesWithRetry=['menu','getdigits','getsecretdigits'];var Graph=function(){this[_0xf367('0x2')]={};this[_0xf367('0x3')]={};this[_0xf367('0x4')]=0x0;};Graph[_0xf367('0x5')][_0xf367('0x6')]=function(_0x45124b){this[_0xf367('0x2')][_0x45124b['id']]=_0x45124b;this[_0xf367('0x3')][_0x45124b['id']]=[];};Graph['prototype'][_0xf367('0x7')]=function(_0x12ea05,_0x5619b2,_0x16922f){this[_0xf367('0x3')][_0x12ea05][_0xf367('0x8')]({'target':_0x5619b2,'condition':_0x16922f});this['numberOfEdges']+=0x1;};Graph[_0xf367('0x5')][_0xf367('0x9')]=function(){return _[_0xf367('0x9')](this[_0xf367('0x2')]);};Graph['prototype']['relations']=function(){return this[_0xf367('0x4')];};Graph['prototype'][_0xf367('0xa')]=function(_0x282a15){return this[_0xf367('0x2')][_0x282a15];};Graph[_0xf367('0x5')]['traverseBFS']=function(_0x1d5b9f,_0x29e9e7){if(!this[_0xf367('0x2')][_0x1d5b9f]){return logger['info'](_0xf367('0xb'));}var _0x278664=_0x29e9e7(this[_0xf367('0x2')][_0x1d5b9f]);if(!_0x278664){return logger['info'](_0xf367('0xc'));}if(this[_0xf367('0x3')][_0x1d5b9f][_0xf367('0xd')]===0x0){return logger[_0xf367('0xe')](_0xf367('0xf'));}for(var _0x2e2b35=0x0,_0x444494=[],_0xb2c9f8=![];_0x2e2b35\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','calleridname','callerid','dnid','[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','uniqueid','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','evtHangup','then','catch','indexOf','substring','debug','stringify','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','close','timeout','hangup','handleNotFound','initialize','getLicense','voice','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]','./server','connection','lodash','syncho','util','agi','../../config/license/util','./rpc','./project','./events','EventEmitter','defaults','127.0.0.1','splice','error','stack','log'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0x7023,0xf5));var _0x3702=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x7023[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0x3702('0x0'));var syncho=require(_0x3702('0x1'));var util=require(_0x3702('0x2'));var config=require('../../config/environment');var logger=require('../../config/logger')(_0x3702('0x3'));var utilLicense=require(_0x3702('0x4'));var rpc=require(_0x3702('0x5'));var Project=require(_0x3702('0x6'));var AGIEmitter=require(_0x3702('0x7'))[_0x3702('0x8')];var projects=[];config[_0x3702('0x3')]=_[_0x3702('0x9')](config[_0x3702('0x3')],{'ip':_0x3702('0xa'),'port':0x11dd});AGIEmitter['on']('projectUpdate',projectUpdateHandler);function connectionHandler(_0x5b97cc){process['nextTick'](function(){syncho(function(){try{setChannelVariables(_0x5b97cc);agiHandler(_0x5b97cc);}catch(_0x766051){logger['error'](_0x766051['stack']);}});});}function projectUpdateHandler(_0x2a49eb){try{var _0x3055f4=_['findIndex'](projects,['id',_0x2a49eb['id']]);if(_0x3055f4>-0x1){if(_0x2a49eb['deleted']===!![]){projects[_0x3702('0xb')](_0x3055f4,0x1);}else{projects[_0x3055f4]=_0x2a49eb;}}else{projects['push'](_0x2a49eb);}}catch(_0x27e402){logger[_0x3702('0xc')](_0x27e402[_0x3702('0xd')]);}}function listeningHandler(){console[_0x3702('0xe')](_0x3702('0xf'),config[_0x3702('0x3')][_0x3702('0x10')]);logger['info'](util[_0x3702('0x11')]('[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d',config[_0x3702('0x3')]['ip'],config['agi'][_0x3702('0x10')]));}function errorHandler(_0x5a3d82){if(_0x5a3d82&&_0x5a3d82[_0x3702('0x12')]&&_0x5a3d82[_0x3702('0x13')]){logger[_0x3702('0xc')](util['format'](_0x3702('0x14'),_0x5a3d82[_0x3702('0x12')],_0x5a3d82[_0x3702('0x13')]));}else{logger[_0x3702('0xc')](util['format'](_0x3702('0x15'),_0x5a3d82[_0x3702('0xd')]));}}function closeHandler(){logger[_0x3702('0x16')](util['format'](_0x3702('0x17'),this['arg_1'],this[_0x3702('0x18')],this[_0x3702('0x19')],this[_0x3702('0x1a')],this['uniqueid']));try{createSquareReport(this);}catch(_0x3a6593){logger['error'](_0x3a6593[_0x3702('0xd')]);}}function timeoutHandler(){logger[_0x3702('0x16')](util['format'](_0x3702('0x1b'),this[_0x3702('0x1c')],this[_0x3702('0x18')],this[_0x3702('0x19')],this[_0x3702('0x1a')],this[_0x3702('0x1d')]));}function hangupHandler(){logger[_0x3702('0x16')](util[_0x3702('0x11')](_0x3702('0x1e'),this[_0x3702('0x1c')],this[_0x3702('0x18')],this[_0x3702('0x19')],this[_0x3702('0x1a')],this[_0x3702('0x1d')]));this[_0x3702('0x1f')]=!![];}function createSquareReport(_0x56c4ed,_0x4841e8){rpc['createSquareReport'](_0x56c4ed)[_0x3702('0x20')](function(_0x3a844c){if(_0x4841e8){_0x4841e8(null,_0x3a844c);}})[_0x3702('0x21')](function(_0x17ce2e){if(_0x4841e8){_0x4841e8(null,_0x17ce2e);}});}function setChannelVariables(_0x252596){for(var _0x23ec4a in _0x252596){if(_0x252596['hasOwnProperty'](_0x23ec4a)){if(_0x23ec4a[_0x3702('0x22')]('agi_')===0x0){_0x252596[_0x23ec4a[_0x3702('0x23')](0x4)]=_0x252596[_0x23ec4a];delete _0x252596[_0x23ec4a];}}}}function agiHandler(_0x4e496d){logger[_0x3702('0x24')]('variables',JSON[_0x3702('0x25')](_0x4e496d,null,0x2));logger['info'](util['format'](_0x3702('0x26'),_0x4e496d[_0x3702('0x1c')],_0x4e496d['calleridname'],_0x4e496d[_0x3702('0x19')],_0x4e496d[_0x3702('0x1a')],_0x4e496d['uniqueid']));_0x4e496d['on'](_0x3702('0xc'),errorHandler);_0x4e496d['on'](_0x3702('0x27'),closeHandler);_0x4e496d['on'](_0x3702('0x28'),timeoutHandler);_0x4e496d['evtHangup']=![];_0x4e496d['on'](_0x3702('0x29'),hangupHandler);var _0x423f5e=_['find'](projects,[_0x3702('0x12'),_0x4e496d[_0x3702('0x1c')]]);if(!_0x423f5e)return Project[_0x3702('0x2a')](_0x4e496d);if(!_0x423f5e['production'])return Project['handleUnpublished'](_0x4e496d);return Project[_0x3702('0x2b')](_0x423f5e,_0x4e496d);}function main(){var _0xe725f5;return utilLicense[_0x3702('0x2c')]()[_0x3702('0x20')](function(_0x3a5995){if(!_0x3a5995)return;if(_0x3a5995[_0x3702('0x2d')]){if(_0x3a5995['callysquare']&&_0x3a5995[_0x3702('0x2e')]>0x0){logger[_0x3702('0x16')](util[_0x3702('0x11')](_0x3702('0x2f'),_0x3a5995[_0x3702('0x2e')]));_0xe725f5=_0x3a5995['callysquare'];}else{logger[_0x3702('0x16')](_0x3702('0x30'));}}else{logger['info']('[LICENSE]\x20VOICE\x20IS\x20DISABLED');_0xe725f5=-0x1;}})[_0x3702('0x20')](function(){return Project['getAll']();})[_0x3702('0x20')](function(_0x5c5e0f){projects=_0x5c5e0f;return;})[_0x3702('0x21')](function(_0x954e68){logger[_0x3702('0xc')](_0x3702('0x31'),_0x954e68[_0x3702('0xd')]);})['finally'](function(){var _0x5565b0=require(_0x3702('0x32'))(config[_0x3702('0x3')][_0x3702('0x10')],config['agi']['ip'],_0xe725f5);_0x5565b0['on'](_0x3702('0xc'),errorHandler);_0x5565b0['on']('listening',listeningHandler);_0x5565b0['on'](_0x3702('0x33'),connectionHandler);_0x5565b0['on'](_0x3702('0x27'),closeHandler);});}main(); \ No newline at end of file +var _0x9b35=['port','info','format','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','callerid','dnid','[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','createSquareReport','catch','indexOf','substring','variables','stringify','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','close','timeout','find','handleNotFound','production','handleUnpublished','initialize','getLicense','then','callysquare','[LICENSE]\x20CHANNELS:\x20UNLIMITED','getAll','[LICENSE]','finally','./server','connection','../../config/environment','agi','../../config/license/util','./rpc','./project','./events','EventEmitter','defaults','127.0.0.1','nextTick','error','stack','findIndex','deleted','splice','push','log','Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!'];(function(_0x2aea9e,_0x1f587f){var _0x430b92=function(_0x416c37){while(--_0x416c37){_0x2aea9e['push'](_0x2aea9e['shift']());}};_0x430b92(++_0x1f587f);}(_0x9b35,0x17d));var _0x59b3=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x9b35[_0x17d9e3];return _0x14192d;};'use strict';var _=require('lodash');var syncho=require('syncho');var util=require('util');var config=require(_0x59b3('0x0'));var logger=require('../../config/logger')(_0x59b3('0x1'));var utilLicense=require(_0x59b3('0x2'));var rpc=require(_0x59b3('0x3'));var Project=require(_0x59b3('0x4'));var AGIEmitter=require(_0x59b3('0x5'))[_0x59b3('0x6')];var projects=[];config['agi']=_[_0x59b3('0x7')](config[_0x59b3('0x1')],{'ip':_0x59b3('0x8'),'port':0x11dd});AGIEmitter['on']('projectUpdate',projectUpdateHandler);function connectionHandler(_0x39b68c){process[_0x59b3('0x9')](function(){syncho(function(){try{setChannelVariables(_0x39b68c);agiHandler(_0x39b68c);}catch(_0x4c520f){logger[_0x59b3('0xa')](_0x4c520f[_0x59b3('0xb')]);}});});}function projectUpdateHandler(_0x5b0c1b){try{var _0x7b5e96=_[_0x59b3('0xc')](projects,['id',_0x5b0c1b['id']]);if(_0x7b5e96>-0x1){if(_0x5b0c1b[_0x59b3('0xd')]===!![]){projects[_0x59b3('0xe')](_0x7b5e96,0x1);}else{projects[_0x7b5e96]=_0x5b0c1b;}}else{projects[_0x59b3('0xf')](_0x5b0c1b);}}catch(_0x5b8e43){logger[_0x59b3('0xa')](_0x5b8e43[_0x59b3('0xb')]);}}function listeningHandler(){console[_0x59b3('0x10')](_0x59b3('0x11'),config[_0x59b3('0x1')][_0x59b3('0x12')]);logger[_0x59b3('0x13')](util[_0x59b3('0x14')]('[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d',config[_0x59b3('0x1')]['ip'],config[_0x59b3('0x1')][_0x59b3('0x12')]));}function errorHandler(_0x1804fc){if(_0x1804fc&&_0x1804fc[_0x59b3('0x15')]&&_0x1804fc[_0x59b3('0x16')]){logger[_0x59b3('0xa')](util[_0x59b3('0x14')](_0x59b3('0x17'),_0x1804fc['name'],_0x1804fc['message']));}else{logger[_0x59b3('0xa')](util[_0x59b3('0x14')](_0x59b3('0x18'),_0x1804fc[_0x59b3('0xb')]));}}function closeHandler(){logger[_0x59b3('0x13')](util[_0x59b3('0x14')](_0x59b3('0x19'),this[_0x59b3('0x1a')],this[_0x59b3('0x1b')],this[_0x59b3('0x1c')],this[_0x59b3('0x1d')],this['uniqueid']));try{createSquareReport(this);}catch(_0x3af3a9){logger['error'](_0x3af3a9[_0x59b3('0xb')]);}}function timeoutHandler(){logger['info'](util[_0x59b3('0x14')](_0x59b3('0x1e'),this[_0x59b3('0x1a')],this[_0x59b3('0x1b')],this[_0x59b3('0x1c')],this[_0x59b3('0x1d')],this[_0x59b3('0x1f')]));}function hangupHandler(){logger[_0x59b3('0x13')](util['format'](_0x59b3('0x20'),this[_0x59b3('0x1a')],this['calleridname'],this[_0x59b3('0x1c')],this[_0x59b3('0x1d')],this['uniqueid']));this[_0x59b3('0x21')]=!![];}function createSquareReport(_0x386878,_0x3cc0ff){rpc[_0x59b3('0x22')](_0x386878)['then'](function(_0x30f76d){if(_0x3cc0ff){_0x3cc0ff(null,_0x30f76d);}})[_0x59b3('0x23')](function(_0x2cc7cd){if(_0x3cc0ff){_0x3cc0ff(null,_0x2cc7cd);}});}function setChannelVariables(_0x165c6a){for(var _0x205fae in _0x165c6a){if(_0x165c6a['hasOwnProperty'](_0x205fae)){if(_0x205fae[_0x59b3('0x24')]('agi_')===0x0){_0x165c6a[_0x205fae[_0x59b3('0x25')](0x4)]=_0x165c6a[_0x205fae];delete _0x165c6a[_0x205fae];}}}}function agiHandler(_0x5f016d){logger['debug'](_0x59b3('0x26'),JSON[_0x59b3('0x27')](_0x5f016d,null,0x2));logger[_0x59b3('0x13')](util[_0x59b3('0x14')](_0x59b3('0x28'),_0x5f016d[_0x59b3('0x1a')],_0x5f016d[_0x59b3('0x1b')],_0x5f016d[_0x59b3('0x1c')],_0x5f016d[_0x59b3('0x1d')],_0x5f016d[_0x59b3('0x1f')]));_0x5f016d['on'](_0x59b3('0xa'),errorHandler);_0x5f016d['on'](_0x59b3('0x29'),closeHandler);_0x5f016d['on'](_0x59b3('0x2a'),timeoutHandler);_0x5f016d[_0x59b3('0x21')]=![];_0x5f016d['on']('hangup',hangupHandler);var _0x7f25a0=_[_0x59b3('0x2b')](projects,[_0x59b3('0x15'),_0x5f016d[_0x59b3('0x1a')]]);if(!_0x7f25a0)return Project[_0x59b3('0x2c')](_0x5f016d);if(!_0x7f25a0[_0x59b3('0x2d')])return Project[_0x59b3('0x2e')](_0x5f016d);return Project[_0x59b3('0x2f')](_0x7f25a0,_0x5f016d);}function main(){var _0x13ecf7;return utilLicense[_0x59b3('0x30')]()[_0x59b3('0x31')](function(_0x476d8e){if(!_0x476d8e)return;if(_0x476d8e['voice']){if(_0x476d8e[_0x59b3('0x32')]&&_0x476d8e[_0x59b3('0x32')]>0x0){logger[_0x59b3('0x13')](util[_0x59b3('0x14')]('[LICENSE]\x20CHANNELS:\x20%s',_0x476d8e[_0x59b3('0x32')]));_0x13ecf7=_0x476d8e[_0x59b3('0x32')];}else{logger[_0x59b3('0x13')](_0x59b3('0x33'));}}else{logger[_0x59b3('0x13')]('[LICENSE]\x20VOICE\x20IS\x20DISABLED');_0x13ecf7=-0x1;}})['then'](function(){return Project[_0x59b3('0x34')]();})[_0x59b3('0x31')](function(_0x3bb22b){projects=_0x3bb22b;return;})[_0x59b3('0x23')](function(_0x522849){logger[_0x59b3('0xa')](_0x59b3('0x35'),_0x522849[_0x59b3('0xb')]);})[_0x59b3('0x36')](function(){var _0x31b07a=require(_0x59b3('0x37'))(config[_0x59b3('0x1')][_0x59b3('0x12')],config['agi']['ip'],_0x13ecf7);_0x31b07a['on']('error',errorHandler);_0x31b07a['on']('listening',listeningHandler);_0x31b07a['on'](_0x59b3('0x38'),connectionHandler);_0x31b07a['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 36a8b14..5e24e2b 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 _0xdaf8=['sendMailMessage','bluebird','jayson/promise','client','http','then','error','message','result','catch'];(function(_0x5b561d,_0x422b7c){var _0x431060=function(_0x401409){while(--_0x401409){_0x5b561d['push'](_0x5b561d['shift']());}};_0x431060(++_0x422b7c);}(_0xdaf8,0x1d7));var _0x8daf=function(_0x52e826,_0x8558b1){_0x52e826=_0x52e826-0x0;var _0x28635f=_0xdaf8[_0x52e826];return _0x28635f;};'use strict';var BPromise=require(_0x8daf('0x0'));var jayson=require(_0x8daf('0x1'));var client=jayson[_0x8daf('0x2')][_0x8daf('0x3')]({'port':0x232b});function request(_0x26e758,_0x138b44){return new BPromise(function(_0x5df308,_0xa49d31){return client['request'](_0x26e758,_0x138b44)[_0x8daf('0x4')](function(_0x288d05){if(_0x288d05['error']){return _0xa49d31(_0x288d05[_0x8daf('0x5')][_0x8daf('0x6')]);}else{return _0x5df308(_0x288d05[_0x8daf('0x7')]);}})[_0x8daf('0x8')](function(_0x57c910){return _0xa49d31(_0x57c910);});});}exports[_0x8daf('0x9')]=function(_0x55bf31,_0x2152c8){return request('SendMail',{'account':_0x55bf31,'message':_0x2152c8});}; \ No newline at end of file +var _0xccc1=['client','request','then','error','result','catch','sendMailMessage','SendMail','bluebird','jayson/promise'];(function(_0x2d3a4d,_0x47561e){var _0x3a94a3=function(_0x2f48da){while(--_0x2f48da){_0x2d3a4d['push'](_0x2d3a4d['shift']());}};_0x3a94a3(++_0x47561e);}(_0xccc1,0x1a2));var _0x1ccc=function(_0x1c9fc5,_0x3ca335){_0x1c9fc5=_0x1c9fc5-0x0;var _0x4eea03=_0xccc1[_0x1c9fc5];return _0x4eea03;};'use strict';var BPromise=require(_0x1ccc('0x0'));var jayson=require(_0x1ccc('0x1'));var client=jayson[_0x1ccc('0x2')]['http']({'port':0x232b});function request(_0x3f2d63,_0x3f3ba2){return new BPromise(function(_0x1886d9,_0x490461){return client[_0x1ccc('0x3')](_0x3f2d63,_0x3f3ba2)[_0x1ccc('0x4')](function(_0x439cc6){if(_0x439cc6[_0x1ccc('0x5')]){return _0x490461(_0x439cc6[_0x1ccc('0x5')]['message']);}else{return _0x1886d9(_0x439cc6[_0x1ccc('0x6')]);}})[_0x1ccc('0x7')](function(_0x56811d){return _0x490461(_0x56811d);});});}exports[_0x1ccc('0x8')]=function(_0x3cb02c,_0x1dfd2a){return request(_0x1ccc('0x9'),{'account':_0x3cb02c,'message':_0x1dfd2a});}; \ No newline at end of file diff --git a/server/services/agi/project.js b/server/services/agi/project.js index 2722edf..97d96db 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 _0x3466=['hasOwnProperty','maxRetry','retry','addVertex','omit','length','target','addEdge','source','value','mxGraphModel','root','inspect','production','stringify','joinAt','format','YYYY-MM-DD\x20HH:mm:ss','mxCell','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','calleridname','callerid','uniqueid','traverseBFS','start','clear','vertex','info','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension','priority','code','evtHangup','debug','response','isUndefined','result','toString','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','dnid','continueAt','close','Project\x20%s\x20not\x20published','exports','moment','xml2json','../../config/logger','agi','./rpc','./mailRpc','./graph','./vertices','getSquareProjects','catch','error','Unable\x20to\x20download\x20CallySquare\x20projects','agicommand'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3466,0xad));var _0x6346=function(_0x38c584,_0xdfcac2){_0x38c584=_0x38c584-0x0;var _0xd8164b=_0x3466[_0x38c584];return _0xd8164b;};'use strict';var _=require('lodash');var moment=require(_0x6346('0x0'));var parser=require(_0x6346('0x1'));var util=require('util');var logger=require(_0x6346('0x2'))(_0x6346('0x3'));var rpc=require(_0x6346('0x4'));var mailRpc=require(_0x6346('0x5'));var Graph=require(_0x6346('0x6'));var Vertices=require(_0x6346('0x7'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;function getAll(){return rpc[_0x6346('0x8')]()[_0x6346('0x9')](function(_0x3a7965){logger[_0x6346('0xa')](_0x6346('0xb'),_0x3a7965['stack']);return[];});}function addVertex(_0x1a6abb,_0x5d93fd,_0x4c3ad4){_0x5d93fd[_0x6346('0xc')]=_0x4c3ad4;if(_0x5d93fd[_0x6346('0xd')]('retry')){_0x5d93fd[_0x6346('0xe')]=parseInt(_0x5d93fd[_0x6346('0xf')],0xa);}_0x1a6abb[_0x6346('0x10')](_[_0x6346('0x11')](_0x5d93fd,'mxCell'));}function initGraph(_0x234c73,_0x1d177f){var _0x37e57e=new Graph();for(var _0x1b9883 in _0x234c73){if(_0x234c73[_0x6346('0xd')](_0x1b9883)){if(_['isArray'](_0x234c73[_0x1b9883])){for(var _0x227699=0x0;_0x227699<_0x234c73[_0x1b9883][_0x6346('0x12')];_0x227699+=0x1){addVertex(_0x37e57e,_0x234c73[_0x1b9883][_0x227699],_0x1b9883);}}else{addVertex(_0x37e57e,_0x234c73[_0x1b9883],_0x1b9883);}}}for(var _0x1afe68=0x0;_0x1afe68<_0x1d177f[_0x6346('0x12')];_0x1afe68+=0x1){if(_0x1d177f[_0x1afe68]['source']&&_0x1d177f[_0x1afe68][_0x6346('0x13')]){_0x37e57e[_0x6346('0x14')](_0x1d177f[_0x1afe68][_0x6346('0x15')],_0x1d177f[_0x1afe68]['target'],_0x1d177f[_0x1afe68][_0x6346('0x16')]);}}return _0x37e57e;}function getRoot(_0x382f9b){return parser['toJson'](_0x382f9b,{'object':!![]})[_0x6346('0x17')][_0x6346('0x18')];}function inspect(_0x31fc12){return util[_0x6346('0x19')](_0x31fc12,{'showHidden':![],'depth':null});}function initialize(_0x52ed2a,_0x1ee2e4){var _0x295a80=getRoot(_0x52ed2a[_0x6346('0x1a')]);if(!_0x295a80||!_0x295a80['start'])return;var _0x24ae2f,_0x59810a,_0x1d9b74;logger['debug'](_0x6346('0x18'),JSON[_0x6346('0x1b')](_0x295a80,null,0x2));_0x1ee2e4[_0x6346('0x1c')]=moment()[_0x6346('0x1d')](_0x6346('0x1e'));_0x24ae2f=initGraph(_['omit'](_0x295a80,_0x6346('0x1f')),_0x295a80['mxCell']);_0x59810a=new Vertices(_0x1ee2e4,rpc,mailRpc);logger['info'](util[_0x6346('0x1d')](_0x6346('0x20'),_0x1ee2e4[_0x6346('0x21')],_0x1ee2e4[_0x6346('0x22')],_0x1ee2e4[_0x6346('0x23')],_0x1ee2e4['dnid'],_0x1ee2e4[_0x6346('0x24')]));_0x24ae2f[_0x6346('0x25')](_0x295a80[_0x6346('0x26')]['id'],function(_0x1a36f4){try{_0x1a36f4=_0x59810a[_0x6346('0x27')](_0x1a36f4);logger['debug'](_0x6346('0x28'),JSON[_0x6346('0x1b')](_0x1a36f4,null,0x2));if(_0x1a36f4[_0x6346('0xc')]==='gotoc'){logger[_0x6346('0x29')](_0x6346('0x2a'));_0x1ee2e4[_0x6346('0x2b')]=_0x1a36f4[_0x6346('0x2b')]||_0x1ee2e4[_0x6346('0x2b')];_0x1ee2e4[_0x6346('0x2c')]=_0x1a36f4['extension'];_0x1ee2e4['priority']=_0x1a36f4[_0x6346('0x2d')]?_0x1a36f4[_0x6346('0x2d')]-0x1:0x1;return null;}else if(_0x1a36f4&&_0x59810a[_0x1a36f4['agicommand']]){_0x1d9b74=_0x59810a[_0x1a36f4[_0x6346('0xc')]](_0x1a36f4);logger[_0x6346('0x29')]('response',JSON['stringify'](_0x1d9b74,null,0x2));if(_0x1d9b74&&_0x1d9b74[_0x6346('0x2e')]===AGI_CODE_SUCCESS&&_0x1d9b74['result']!==AGI_RESULT_ERROR&&!_0x1ee2e4[_0x6346('0x2f')]){logger[_0x6346('0x30')](_0x6346('0x31'),inspect(_0x1d9b74));return _[_0x6346('0x32')](_0x1d9b74[_0x6346('0x33')])?null:_0x1d9b74[_0x6346('0x33')][_0x6346('0x34')]();}else{logger[_0x6346('0xa')](_0x6346('0x31'),inspect(_0x1d9b74));return null;}}else{logger['error'](_0x6346('0x35'));return null;}}catch(_0x5d25cd){logger[_0x6346('0xa')](_0x5d25cd[_0x6346('0x36')]);return null;}});if(_0x295a80[_0x6346('0x37')]){logger[_0x6346('0x29')](util[_0x6346('0x1d')](_0x6346('0x38'),_0x1ee2e4[_0x6346('0x21')],_0x1ee2e4[_0x6346('0x22')],_0x1ee2e4[_0x6346('0x23')],_0x1ee2e4['dnid'],_0x1ee2e4[_0x6346('0x24')]));_0x24ae2f[_0x6346('0x25')](_0x295a80[_0x6346('0x37')]['id'],function(_0x4eb457){try{_0x4eb457=_0x59810a[_0x6346('0x27')](_0x4eb457);logger['debug'](_0x6346('0x28'),JSON[_0x6346('0x1b')](_0x4eb457,null,0x2));if(_0x4eb457&&_0x59810a[_0x4eb457[_0x6346('0xc')]]){_0x1d9b74=_0x59810a[_0x4eb457[_0x6346('0xc')]](_0x4eb457);if(_0x1d9b74){logger['debug'](_0x6346('0x31'),inspect(_0x1d9b74));return _['isUndefined'](_0x1d9b74['result'])?null:_0x1d9b74[_0x6346('0x33')][_0x6346('0x34')]();}else{logger[_0x6346('0xa')](_0x6346('0x31'),inspect(_0x1d9b74));return null;}}else{logger[_0x6346('0xa')](_0x6346('0x35'));return null;}}catch(_0x136fe8){logger[_0x6346('0xa')](_0x136fe8['stack']);return null;}});}logger[_0x6346('0x29')](util[_0x6346('0x1d')]('[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x1ee2e4[_0x6346('0x21')],_0x1ee2e4['calleridname'],_0x1ee2e4[_0x6346('0x23')],_0x1ee2e4[_0x6346('0x39')],_0x1ee2e4[_0x6346('0x24')]));logger[_0x6346('0x29')](util[_0x6346('0x1d')]('[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s',_0x1ee2e4['context'],_0x1ee2e4['extension'],parseInt(_0x1ee2e4[_0x6346('0x2d')],0xa)+0x1));_0x1ee2e4[_0x6346('0x3a')](_0x1ee2e4[_0x6346('0x2b')],_0x1ee2e4[_0x6346('0x2c')],parseInt(_0x1ee2e4[_0x6346('0x2d')],0xa)+0x1);_0x1ee2e4[_0x6346('0x3b')]();}function handleNotFound(_0x15a957){logger['error'](util[_0x6346('0x1d')]('Project\x20%s\x20not\x20found',_0x15a957[_0x6346('0x21')]));_0x15a957[_0x6346('0x3a')](_0x15a957['context'],_0x15a957[_0x6346('0x2c')],parseInt(_0x15a957['priority'],0xa)+0x1);_0x15a957[_0x6346('0x3b')]();}function handleUnpublished(_0x10f0e5){logger[_0x6346('0xa')](util['format'](_0x6346('0x3c'),_0x10f0e5[_0x6346('0x21')]));_0x10f0e5[_0x6346('0x3a')](_0x10f0e5[_0x6346('0x2b')],_0x10f0e5[_0x6346('0x2c')],parseInt(_0x10f0e5[_0x6346('0x2d')],0xa)+0x1);_0x10f0e5[_0x6346('0x3b')]();}module[_0x6346('0x3d')]={'getAll':getAll,'handleNotFound':handleNotFound,'handleUnpublished':handleUnpublished,'initialize':initialize}; \ No newline at end of file +var _0x708f=['response','result','evtHangup','toString','agicommand\x20not\x20found','finally','format','[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','vertex','isUndefined','[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','uniqueid','[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s','continueAt','close','Project\x20%s\x20not\x20found','Project\x20%s\x20not\x20published','lodash','moment','util','agi','./rpc','./mailRpc','./graph','./vertices','getSquareProjects','catch','error','Unable\x20to\x20download\x20CallySquare\x20projects','stack','hasOwnProperty','retry','maxRetry','addVertex','mxCell','isArray','length','source','target','addEdge','value','toJson','root','production','start','debug','joinAt','YYYY-MM-DD\x20HH:mm:ss','omit','info','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','calleridname','callerid','dnid','traverseBFS','clear','stringify','agicommand','gotoc','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension','priority'];(function(_0x1e9604,_0x5de613){var _0x522053=function(_0x573a73){while(--_0x573a73){_0x1e9604['push'](_0x1e9604['shift']());}};_0x522053(++_0x5de613);}(_0x708f,0x192));var _0xf708=function(_0x4aa068,_0x3e53d3){_0x4aa068=_0x4aa068-0x0;var _0x41b01a=_0x708f[_0x4aa068];return _0x41b01a;};'use strict';var _=require(_0xf708('0x0'));var moment=require(_0xf708('0x1'));var parser=require('xml2json');var util=require(_0xf708('0x2'));var logger=require('../../config/logger')(_0xf708('0x3'));var rpc=require(_0xf708('0x4'));var mailRpc=require(_0xf708('0x5'));var Graph=require(_0xf708('0x6'));var Vertices=require(_0xf708('0x7'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;function getAll(){return rpc[_0xf708('0x8')]()[_0xf708('0x9')](function(_0x29cbb8){logger[_0xf708('0xa')](_0xf708('0xb'),_0x29cbb8[_0xf708('0xc')]);return[];});}function addVertex(_0xe2222c,_0x1db201,_0x37fb6a){_0x1db201['agicommand']=_0x37fb6a;if(_0x1db201[_0xf708('0xd')](_0xf708('0xe'))){_0x1db201[_0xf708('0xf')]=parseInt(_0x1db201['retry'],0xa);}_0xe2222c[_0xf708('0x10')](_['omit'](_0x1db201,_0xf708('0x11')));}function initGraph(_0x5a2a80,_0x474854){var _0x1444a3=new Graph();for(var _0x73223b in _0x5a2a80){if(_0x5a2a80['hasOwnProperty'](_0x73223b)){if(_[_0xf708('0x12')](_0x5a2a80[_0x73223b])){for(var _0x1bb44d=0x0;_0x1bb44d<_0x5a2a80[_0x73223b][_0xf708('0x13')];_0x1bb44d+=0x1){addVertex(_0x1444a3,_0x5a2a80[_0x73223b][_0x1bb44d],_0x73223b);}}else{addVertex(_0x1444a3,_0x5a2a80[_0x73223b],_0x73223b);}}}for(var _0x42b01e=0x0;_0x42b01e<_0x474854[_0xf708('0x13')];_0x42b01e+=0x1){if(_0x474854[_0x42b01e][_0xf708('0x14')]&&_0x474854[_0x42b01e][_0xf708('0x15')]){_0x1444a3[_0xf708('0x16')](_0x474854[_0x42b01e][_0xf708('0x14')],_0x474854[_0x42b01e][_0xf708('0x15')],_0x474854[_0x42b01e][_0xf708('0x17')]);}}return _0x1444a3;}function getRoot(_0x2b0675){return parser[_0xf708('0x18')](_0x2b0675,{'object':!![]})['mxGraphModel'][_0xf708('0x19')];}function inspect(_0x4f82d5){return util['inspect'](_0x4f82d5,{'showHidden':![],'depth':null});}function initialize(_0x4d389a,_0x239fd0){var _0x3551c6=getRoot(_0x4d389a[_0xf708('0x1a')]);if(!_0x3551c6||!_0x3551c6[_0xf708('0x1b')])return;var _0x4f5462,_0x369657,_0x194c2;logger[_0xf708('0x1c')](_0xf708('0x19'),JSON['stringify'](_0x3551c6,null,0x2));_0x239fd0[_0xf708('0x1d')]=moment()['format'](_0xf708('0x1e'));_0x4f5462=initGraph(_[_0xf708('0x1f')](_0x3551c6,_0xf708('0x11')),_0x3551c6[_0xf708('0x11')]);_0x369657=new Vertices(_0x239fd0,rpc,mailRpc);logger[_0xf708('0x20')](util['format'](_0xf708('0x21'),_0x239fd0['arg_1'],_0x239fd0[_0xf708('0x22')],_0x239fd0[_0xf708('0x23')],_0x239fd0[_0xf708('0x24')],_0x239fd0['uniqueid']));_0x4f5462[_0xf708('0x25')](_0x3551c6[_0xf708('0x1b')]['id'],function(_0x41a27f){try{_0x41a27f=_0x369657[_0xf708('0x26')](_0x41a27f);logger[_0xf708('0x1c')]('vertex',JSON[_0xf708('0x27')](_0x41a27f,null,0x2));if(_0x41a27f[_0xf708('0x28')]===_0xf708('0x29')){logger[_0xf708('0x20')](_0xf708('0x2a'));_0x239fd0[_0xf708('0x2b')]=_0x41a27f[_0xf708('0x2b')]||_0x239fd0['context'];_0x239fd0[_0xf708('0x2c')]=_0x41a27f[_0xf708('0x2c')];_0x239fd0[_0xf708('0x2d')]=_0x41a27f[_0xf708('0x2d')]?_0x41a27f[_0xf708('0x2d')]-0x1:0x1;return null;}else if(_0x41a27f&&_0x369657[_0x41a27f[_0xf708('0x28')]]){_0x194c2=_0x369657[_0x41a27f[_0xf708('0x28')]](_0x41a27f);logger[_0xf708('0x20')](_0xf708('0x2e'),JSON[_0xf708('0x27')](_0x194c2,null,0x2));if(_0x194c2&&_0x194c2['code']===AGI_CODE_SUCCESS&&_0x194c2[_0xf708('0x2f')]!==AGI_RESULT_ERROR&&!_0x239fd0[_0xf708('0x30')]){logger[_0xf708('0x1c')]('response',inspect(_0x194c2));return _['isUndefined'](_0x194c2['result'])?null:_0x194c2['result'][_0xf708('0x31')]();}else{logger[_0xf708('0xa')](_0xf708('0x2e'),inspect(_0x194c2));return null;}}else{logger['error'](_0xf708('0x32'));return null;}}catch(_0x5b3e26){logger['error'](_0x5b3e26['stack']);return null;}});if(_0x3551c6[_0xf708('0x33')]){logger[_0xf708('0x20')](util[_0xf708('0x34')](_0xf708('0x35'),_0x239fd0['arg_1'],_0x239fd0[_0xf708('0x22')],_0x239fd0[_0xf708('0x23')],_0x239fd0['dnid'],_0x239fd0['uniqueid']));_0x4f5462['traverseBFS'](_0x3551c6[_0xf708('0x33')]['id'],function(_0x4665dc){try{_0x4665dc=_0x369657['clear'](_0x4665dc);logger[_0xf708('0x1c')](_0xf708('0x36'),JSON['stringify'](_0x4665dc,null,0x2));if(_0x4665dc&&_0x369657[_0x4665dc[_0xf708('0x28')]]){_0x194c2=_0x369657[_0x4665dc['agicommand']](_0x4665dc);if(_0x194c2){logger[_0xf708('0x1c')]('response',inspect(_0x194c2));return _[_0xf708('0x37')](_0x194c2[_0xf708('0x2f')])?null:_0x194c2['result']['toString']();}else{logger[_0xf708('0xa')](_0xf708('0x2e'),inspect(_0x194c2));return null;}}else{logger[_0xf708('0xa')]('agicommand\x20not\x20found');return null;}}catch(_0x54042e){logger['error'](_0x54042e[_0xf708('0xc')]);return null;}});}logger[_0xf708('0x20')](util[_0xf708('0x34')](_0xf708('0x38'),_0x239fd0[_0xf708('0x39')],_0x239fd0['calleridname'],_0x239fd0[_0xf708('0x23')],_0x239fd0[_0xf708('0x24')],_0x239fd0[_0xf708('0x3a')]));logger['info'](util[_0xf708('0x34')](_0xf708('0x3b'),_0x239fd0[_0xf708('0x2b')],_0x239fd0[_0xf708('0x2c')],parseInt(_0x239fd0[_0xf708('0x2d')],0xa)+0x1));_0x239fd0[_0xf708('0x3c')](_0x239fd0[_0xf708('0x2b')],_0x239fd0[_0xf708('0x2c')],parseInt(_0x239fd0['priority'],0xa)+0x1);_0x239fd0[_0xf708('0x3d')]();}function handleNotFound(_0x26e12d){logger[_0xf708('0xa')](util[_0xf708('0x34')](_0xf708('0x3e'),_0x26e12d[_0xf708('0x39')]));_0x26e12d[_0xf708('0x3c')](_0x26e12d[_0xf708('0x2b')],_0x26e12d[_0xf708('0x2c')],parseInt(_0x26e12d[_0xf708('0x2d')],0xa)+0x1);_0x26e12d['close']();}function handleUnpublished(_0x6400d0){logger[_0xf708('0xa')](util[_0xf708('0x34')](_0xf708('0x3f'),_0x6400d0[_0xf708('0x39')]));_0x6400d0[_0xf708('0x3c')](_0x6400d0[_0xf708('0x2b')],_0x6400d0['extension'],parseInt(_0x6400d0['priority'],0xa)+0x1);_0x6400d0[_0xf708('0x3d')]();}module['exports']={'getAll':getAll,'handleNotFound':handleNotFound,'handleUnpublished':handleUnpublished,'initialize':initialize}; \ No newline at end of file diff --git a/server/services/agi/reply.js b/server/services/agi/reply.js index 26820eb..6f8ef30 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 _0xfc72=['slice','trim','emit','headers','_inBody','line','util','stream','Transform','call','_localBuffer','prototype','_transform','\x0d\x0a\x0d\x0a','toString','indexOf','substring','length','split'];(function(_0x348c98,_0x15b2a9){var _0x5a6d5a=function(_0xcdffdc){while(--_0xcdffdc){_0x348c98['push'](_0x348c98['shift']());}};_0x5a6d5a(++_0x15b2a9);}(_0xfc72,0xc4));var _0x2fc7=function(_0x4e9df2,_0x36818e){_0x4e9df2=_0x4e9df2-0x0;var _0x9fe790=_0xfc72[_0x4e9df2];return _0x9fe790;};'use strict';var util=require(_0x2fc7('0x0'));var Transform=require(_0x2fc7('0x1'))[_0x2fc7('0x2')];function AGIReply(_0x341121){Transform[_0x2fc7('0x3')](this,_0x341121);this[_0x2fc7('0x4')]='';this['_inBody']=![];}util['inherits'](AGIReply,Transform);AGIReply[_0x2fc7('0x5')][_0x2fc7('0x6')]=function(_0x1f75e7,_0x185435,_0x3b40f6){var _0x20a011='\x0a',_0x35d6b4=['\x0a\x0a',_0x2fc7('0x7')],_0x5a3163=-0x1,_0x3a4b61=-0x1,_0x4a34c3='',_0x1312f4=0x0,_0x1c19f3='',_0x2c52d4='';this[_0x2fc7('0x4')]+=_0x1f75e7[_0x2fc7('0x8')]();_0x1c19f3=this['_localBuffer'];if(!this['_inBody']){_0x1312f4=0x0;while(_0x35d6b4[_0x1312f4]){while((_0x3a4b61=_0x1c19f3[_0x2fc7('0x9')](_0x35d6b4[_0x1312f4]))!=-0x1){_0x4a34c3=_0x35d6b4[_0x1312f4];_0x2c52d4=_0x1c19f3[_0x2fc7('0xa')](0x0,_0x3a4b61);_0x1c19f3=_0x1c19f3[_0x2fc7('0xa')](_0x3a4b61+_0x4a34c3[_0x2fc7('0xb')]);var _0x29ff87=_0x2c52d4[_0x2fc7('0xc')](_0x20a011),_0x3379e9=0x0,_0x3863e4={},_0x188c66='',_0x35701b='',_0x2afacc=-0x1;while(_0x29ff87[_0x3379e9]){_0x2afacc=_0x29ff87[_0x3379e9][_0x2fc7('0x9')](':');if(_0x2afacc!=-0x1){_0x188c66=_0x29ff87[_0x3379e9][_0x2fc7('0xd')](0x0,_0x2afacc)[_0x2fc7('0xe')]();_0x35701b=_0x29ff87[_0x3379e9][_0x2fc7('0xd')](_0x2afacc+0x1)[_0x2fc7('0xe')]();if(_0x188c66['length']>0x0){_0x3863e4[_0x188c66]=_0x35701b;}}else{}_0x3379e9++;}this[_0x2fc7('0xf')](_0x2fc7('0x10'),_0x3863e4);this[_0x2fc7('0x11')]=!![];}_0x1312f4++;}this[_0x2fc7('0x4')]=_0x1c19f3;}else{while((_0x5a3163=_0x1c19f3[_0x2fc7('0x9')](_0x20a011))!=-0x1){_0x2c52d4=_0x1c19f3[_0x2fc7('0xa')](0x0,_0x5a3163);this[_0x2fc7('0xf')](_0x2fc7('0x12'),_0x2c52d4);_0x1c19f3=_0x1c19f3[_0x2fc7('0xa')](_0x5a3163+_0x20a011[_0x2fc7('0xb')]);}this[_0x2fc7('0x4')]=_0x1c19f3;}_0x3b40f6();};module['exports']=AGIReply; \ No newline at end of file +var _0x6260=['_inBody','indexOf','substring','length','split','slice','trim','emit','headers','line','exports','util','Transform','call','_localBuffer','inherits','prototype','_transform','\x0d\x0a\x0d\x0a','toString'];(function(_0x4ee330,_0x5f2d00){var _0x59bec3=function(_0x5badaf){while(--_0x5badaf){_0x4ee330['push'](_0x4ee330['shift']());}};_0x59bec3(++_0x5f2d00);}(_0x6260,0x19b));var _0x0626=function(_0x45161c,_0x5494fc){_0x45161c=_0x45161c-0x0;var _0x186581=_0x6260[_0x45161c];return _0x186581;};'use strict';var util=require(_0x0626('0x0'));var Transform=require('stream')[_0x0626('0x1')];function AGIReply(_0x1de2b6){Transform[_0x0626('0x2')](this,_0x1de2b6);this[_0x0626('0x3')]='';this['_inBody']=![];}util[_0x0626('0x4')](AGIReply,Transform);AGIReply[_0x0626('0x5')][_0x0626('0x6')]=function(_0x8d53db,_0x299a2b,_0xa1cab0){var _0x5086ed='\x0a',_0x1b8ca7=['\x0a\x0a',_0x0626('0x7')],_0x2eda4b=-0x1,_0xc833e7=-0x1,_0x3bc07e='',_0xdd2590=0x0,_0x1e2897='',_0x213d81='';this[_0x0626('0x3')]+=_0x8d53db[_0x0626('0x8')]();_0x1e2897=this[_0x0626('0x3')];if(!this[_0x0626('0x9')]){_0xdd2590=0x0;while(_0x1b8ca7[_0xdd2590]){while((_0xc833e7=_0x1e2897[_0x0626('0xa')](_0x1b8ca7[_0xdd2590]))!=-0x1){_0x3bc07e=_0x1b8ca7[_0xdd2590];_0x213d81=_0x1e2897[_0x0626('0xb')](0x0,_0xc833e7);_0x1e2897=_0x1e2897[_0x0626('0xb')](_0xc833e7+_0x3bc07e[_0x0626('0xc')]);var _0x10ab85=_0x213d81[_0x0626('0xd')](_0x5086ed),_0x84fff5=0x0,_0x535ab1={},_0x3166f1='',_0xb95fce='',_0x39c122=-0x1;while(_0x10ab85[_0x84fff5]){_0x39c122=_0x10ab85[_0x84fff5][_0x0626('0xa')](':');if(_0x39c122!=-0x1){_0x3166f1=_0x10ab85[_0x84fff5][_0x0626('0xe')](0x0,_0x39c122)[_0x0626('0xf')]();_0xb95fce=_0x10ab85[_0x84fff5][_0x0626('0xe')](_0x39c122+0x1)[_0x0626('0xf')]();if(_0x3166f1[_0x0626('0xc')]>0x0){_0x535ab1[_0x3166f1]=_0xb95fce;}}else{}_0x84fff5++;}this[_0x0626('0x10')](_0x0626('0x11'),_0x535ab1);this[_0x0626('0x9')]=!![];}_0xdd2590++;}this[_0x0626('0x3')]=_0x1e2897;}else{while((_0x2eda4b=_0x1e2897[_0x0626('0xa')](_0x5086ed))!=-0x1){_0x213d81=_0x1e2897[_0x0626('0xb')](0x0,_0x2eda4b);this[_0x0626('0x10')](_0x0626('0x12'),_0x213d81);_0x1e2897=_0x1e2897[_0x0626('0xb')](_0x2eda4b+_0x5086ed[_0x0626('0xc')]);}this[_0x0626('0x3')]=_0x1e2897;}_0xa1cab0();};module[_0x0626('0x13')]=AGIReply; \ No newline at end of file diff --git a/server/services/agi/rpc/index.js b/server/services/agi/rpc/index.js index 42c69b2..7478155 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 _0x3d6d=['ShowVariable','getSquareOdbcById','ShowSquareOdbc','dsn','getUserById','ShowUser','getContactByPhone','GetContactByPhone','phone','getTrunkById','getSoundById','save_name','getIntervalById','ShowInterval','Intervals','getSmsAccountById','ShowSmsAccount','createSmsMessage','createSquareDetailsReport','CreateSquareDetailsReport','createSquareReport','CreateSquareReport','merge','arg_1','arg_2','format','YYYY-MM-DD\x20HH:mm:ss','createSquareRecording','CreateSquareRecording','createSquareMessage','CreateSquareMessage','createCmContact','ShowCmHopper','ListId','CreateCmContact','getPauseById','ShowPause','agentLogin','LoginUser','agentPause','PauseUser','agentUnpause','LogoutUser','lodash','moment','jayson/promise','client','http','request','then','error','message','result','catch','GetSquareProjects','name','production','getSquareProject','getMailAccountById','ShowMailAccount','MailServerOut','Smtp','CloudProvider','getSquareProjectById','ShowSquareProject','getVoiceQueueById','ShowVoiceQueue','getVariableById'];(function(_0x16a496,_0x2380e2){var _0x5d2c35=function(_0x26fd43){while(--_0x26fd43){_0x16a496['push'](_0x16a496['shift']());}};_0x5d2c35(++_0x2380e2);}(_0x3d6d,0xb3));var _0xd3d6=function(_0x5c38cd,_0x5a6b4e){_0x5c38cd=_0x5c38cd-0x0;var _0xc985ef=_0x3d6d[_0x5c38cd];return _0xc985ef;};'use strict';var _=require(_0xd3d6('0x0'));var moment=require(_0xd3d6('0x1'));var jayson=require(_0xd3d6('0x2'));var client=jayson[_0xd3d6('0x3')][_0xd3d6('0x4')]({'port':0x2329});function request(_0x1e1915,_0x366f41){return new Promise(function(_0x15e35a,_0x297bd6){return client[_0xd3d6('0x5')](_0x1e1915,_0x366f41)[_0xd3d6('0x6')](function(_0x4d2bb4){if(_0x4d2bb4['error']){return _0x297bd6(_0x4d2bb4[_0xd3d6('0x7')][_0xd3d6('0x8')]);}else{return _0x15e35a(_0x4d2bb4[_0xd3d6('0x9')]);}})[_0xd3d6('0xa')](function(_0x4356b7){return _0x297bd6(_0x4356b7);});});}exports['getSquareProjects']=function(){return request(_0xd3d6('0xb'),{'options':{'raw':![],'attributes':['id',_0xd3d6('0xc'),_0xd3d6('0xd')]}});};exports[_0xd3d6('0xe')]=function(_0x5dfe88){return request('ShowSquareProject',{'options':{'raw':![],'where':{'name':_0x5dfe88},'attributes':[_0xd3d6('0xd')]}});};exports[_0xd3d6('0xf')]=function(_0x349d60){return request(_0xd3d6('0x10'),{'options':{'raw':![],'where':{'id':_0x349d60},'include':[{'model':_0xd3d6('0x11'),'as':_0xd3d6('0x12'),'include':[{'model':_0xd3d6('0x13'),'as':_0xd3d6('0x13')}]}],'attributes':['id',_0xd3d6('0xc'),'email'],'smtp':!![]}});};exports[_0xd3d6('0x14')]=function(_0x3ffcc4){return request(_0xd3d6('0x15'),{'options':{'where':{'id':_0x3ffcc4},'attributes':['name']}});};exports[_0xd3d6('0x16')]=function(_0x43a7a4){return request(_0xd3d6('0x17'),{'options':{'where':{'id':_0x43a7a4},'attributes':['name']}});};exports[_0xd3d6('0x18')]=function(_0x33c82c){return request(_0xd3d6('0x19'),{'options':{'where':{'id':_0x33c82c},'attributes':[_0xd3d6('0xc')]}});};exports[_0xd3d6('0x1a')]=function(_0x38e42f){return request(_0xd3d6('0x1b'),{'options':{'where':{'id':_0x38e42f},'attributes':[_0xd3d6('0x1c')]}});};exports[_0xd3d6('0x1d')]=function(_0x5a35d7){return request(_0xd3d6('0x1e'),{'options':{'where':{'id':_0x5a35d7},'attributes':[_0xd3d6('0xc')]}});};exports[_0xd3d6('0x1f')]=function(_0x3581bd){return request(_0xd3d6('0x20'),{'options':{'where':{'phone':_0x3581bd[_0xd3d6('0x21')]},'attributes':['id']}});};exports[_0xd3d6('0x22')]=function(_0x1f82d6){return request('ShowTrunk',{'options':{'where':{'id':_0x1f82d6},'attributes':[_0xd3d6('0xc')]}});};exports[_0xd3d6('0x23')]=function(_0x382114){return request('ShowSound',{'options':{'where':{'id':_0x382114},'attributes':[_0xd3d6('0x24')]}});};exports[_0xd3d6('0x25')]=function(_0x8de04f){return request(_0xd3d6('0x26'),{'options':{'raw':![],'where':{'id':_0x8de04f},'include':[{'model':'Interval','as':_0xd3d6('0x27')}]}});};exports[_0xd3d6('0x28')]=function(_0x5b5413){return request(_0xd3d6('0x29'),{'options':{'where':{'id':_0x5b5413},'attributes':['id',_0xd3d6('0xc')]}});};exports[_0xd3d6('0x2a')]=function(_0x548935){return request('CreateSmsMessage',{'body':_0x548935});};exports[_0xd3d6('0x2b')]=function(_0x11bf1e){return request(_0xd3d6('0x2c'),{'body':_0x11bf1e});};exports[_0xd3d6('0x2d')]=function(_0x58f054){return request(_0xd3d6('0x2e'),{'body':_[_0xd3d6('0x2f')](_0x58f054,{'project_name':_0x58f054[_0xd3d6('0x30')],'prev_project_name':_0x58f054[_0xd3d6('0x31')]||'','is_subproject':_0x58f054[_0xd3d6('0x31')]?!![]:![],'leaveAt':moment()[_0xd3d6('0x32')](_0xd3d6('0x33'))})});};exports[_0xd3d6('0x34')]=function(_0x571dd6){return request(_0xd3d6('0x35'),{'body':_0x571dd6});};exports[_0xd3d6('0x36')]=function(_0x509f92){return request(_0xd3d6('0x37'),{'body':_0x509f92});};exports[_0xd3d6('0x38')]=function(_0x16ebad){return request(_0xd3d6('0x39'),{'options':{'raw':![],'where':{'phone':_0x16ebad[_0xd3d6('0x21')],'ListId':_0x16ebad[_0xd3d6('0x3a')]}}})[_0xd3d6('0x6')](function(_0x27e6ed){if(_0x27e6ed){return _0x27e6ed;}return request(_0xd3d6('0x3b'),{'body':_0x16ebad});});};exports[_0xd3d6('0x3c')]=function(_0x55949c){return request(_0xd3d6('0x3d'),{'options':{'where':{'id':_0x55949c},'attributes':[_0xd3d6('0xc')]}});};exports[_0xd3d6('0x3e')]=function(_0x3d8764,_0x46194c){return request(_0xd3d6('0x3f'),{'body':{'interface':_0x46194c},'options':{'where':_0x3d8764}});};exports[_0xd3d6('0x40')]=function(_0x5b94ca,_0x4ce84b,_0x280b4c){return request(_0xd3d6('0x41'),{'body':{'type':_0x4ce84b,'uniqueid':_0x280b4c},'options':{'where':_0x5b94ca}});};exports[_0xd3d6('0x42')]=function(_0x5b2e90){return request('UnpauseUser',{'body':{},'options':{'where':_0x5b2e90}});};exports['agentLogout']=function(_0x561538){return request(_0xd3d6('0x43'),{'body':{},'options':{'where':_0x561538}});}; \ No newline at end of file +var _0xa9e5=['ListId','CreateCmContact','getPauseById','ShowPause','agentLogin','LoginUser','PauseUser','agentUnpause','UnpauseUser','LogoutUser','lodash','moment','client','http','request','then','error','message','result','catch','getSquareProjects','GetSquareProjects','name','production','getMailAccountById','ShowMailAccount','MailServerOut','Smtp','CloudProvider','getSquareProjectById','ShowSquareProject','getVariableById','ShowVariable','getSquareOdbcById','ShowSquareOdbc','dsn','getUserById','getContactByPhone','GetContactByPhone','getTrunkById','ShowTrunk','getSoundById','ShowSound','save_name','getIntervalById','Interval','Intervals','getSmsAccountById','ShowSmsAccount','createSmsMessage','createSquareDetailsReport','CreateSquareDetailsReport','createSquareReport','CreateSquareReport','arg_1','arg_2','YYYY-MM-DD\x20HH:mm:ss','createSquareRecording','CreateSquareRecording','createSquareMessage','CreateSquareMessage','createCmContact','ShowCmHopper','phone'];(function(_0x1d4b4c,_0xd19551){var _0x3e157b=function(_0x66c9db){while(--_0x66c9db){_0x1d4b4c['push'](_0x1d4b4c['shift']());}};_0x3e157b(++_0xd19551);}(_0xa9e5,0x8a));var _0x5a9e=function(_0x426ac3,_0x4f9d3f){_0x426ac3=_0x426ac3-0x0;var _0x50366b=_0xa9e5[_0x426ac3];return _0x50366b;};'use strict';var _=require(_0x5a9e('0x0'));var moment=require(_0x5a9e('0x1'));var jayson=require('jayson/promise');var client=jayson[_0x5a9e('0x2')][_0x5a9e('0x3')]({'port':0x2329});function request(_0x31f045,_0x1dc619){return new Promise(function(_0x19d330,_0x2fdfab){return client[_0x5a9e('0x4')](_0x31f045,_0x1dc619)[_0x5a9e('0x5')](function(_0x120d60){if(_0x120d60[_0x5a9e('0x6')]){return _0x2fdfab(_0x120d60[_0x5a9e('0x6')][_0x5a9e('0x7')]);}else{return _0x19d330(_0x120d60[_0x5a9e('0x8')]);}})[_0x5a9e('0x9')](function(_0x4e1213){return _0x2fdfab(_0x4e1213);});});}exports[_0x5a9e('0xa')]=function(){return request(_0x5a9e('0xb'),{'options':{'raw':![],'attributes':['id',_0x5a9e('0xc'),_0x5a9e('0xd')]}});};exports['getSquareProject']=function(_0x33e9db){return request('ShowSquareProject',{'options':{'raw':![],'where':{'name':_0x33e9db},'attributes':[_0x5a9e('0xd')]}});};exports[_0x5a9e('0xe')]=function(_0x18b4d8){return request(_0x5a9e('0xf'),{'options':{'raw':![],'where':{'id':_0x18b4d8},'include':[{'model':_0x5a9e('0x10'),'as':_0x5a9e('0x11'),'include':[{'model':_0x5a9e('0x12'),'as':_0x5a9e('0x12')}]}],'attributes':['id','name','email'],'smtp':!![]}});};exports[_0x5a9e('0x13')]=function(_0xadcfa8){return request(_0x5a9e('0x14'),{'options':{'where':{'id':_0xadcfa8},'attributes':[_0x5a9e('0xc')]}});};exports['getVoiceQueueById']=function(_0x94cf5d){return request('ShowVoiceQueue',{'options':{'where':{'id':_0x94cf5d},'attributes':[_0x5a9e('0xc')]}});};exports[_0x5a9e('0x15')]=function(_0x526a10){return request(_0x5a9e('0x16'),{'options':{'where':{'id':_0x526a10},'attributes':[_0x5a9e('0xc')]}});};exports[_0x5a9e('0x17')]=function(_0x2e9dd4){return request(_0x5a9e('0x18'),{'options':{'where':{'id':_0x2e9dd4},'attributes':[_0x5a9e('0x19')]}});};exports[_0x5a9e('0x1a')]=function(_0x3d4963){return request('ShowUser',{'options':{'where':{'id':_0x3d4963},'attributes':['name']}});};exports[_0x5a9e('0x1b')]=function(_0x326b61){return request(_0x5a9e('0x1c'),{'options':{'where':{'phone':_0x326b61['phone']},'attributes':['id']}});};exports[_0x5a9e('0x1d')]=function(_0x2a7fa9){return request(_0x5a9e('0x1e'),{'options':{'where':{'id':_0x2a7fa9},'attributes':[_0x5a9e('0xc')]}});};exports[_0x5a9e('0x1f')]=function(_0x5473bb){return request(_0x5a9e('0x20'),{'options':{'where':{'id':_0x5473bb},'attributes':[_0x5a9e('0x21')]}});};exports[_0x5a9e('0x22')]=function(_0x40bff7){return request('ShowInterval',{'options':{'raw':![],'where':{'id':_0x40bff7},'include':[{'model':_0x5a9e('0x23'),'as':_0x5a9e('0x24')}]}});};exports[_0x5a9e('0x25')]=function(_0x54cc63){return request(_0x5a9e('0x26'),{'options':{'where':{'id':_0x54cc63},'attributes':['id',_0x5a9e('0xc')]}});};exports[_0x5a9e('0x27')]=function(_0x47f3e0){return request('CreateSmsMessage',{'body':_0x47f3e0});};exports[_0x5a9e('0x28')]=function(_0x60c8a0){return request(_0x5a9e('0x29'),{'body':_0x60c8a0});};exports[_0x5a9e('0x2a')]=function(_0x207d7c){return request(_0x5a9e('0x2b'),{'body':_['merge'](_0x207d7c,{'project_name':_0x207d7c[_0x5a9e('0x2c')],'prev_project_name':_0x207d7c[_0x5a9e('0x2d')]||'','is_subproject':_0x207d7c['arg_2']?!![]:![],'leaveAt':moment()['format'](_0x5a9e('0x2e'))})});};exports[_0x5a9e('0x2f')]=function(_0x4b8bbb){return request(_0x5a9e('0x30'),{'body':_0x4b8bbb});};exports[_0x5a9e('0x31')]=function(_0x2448e7){return request(_0x5a9e('0x32'),{'body':_0x2448e7});};exports[_0x5a9e('0x33')]=function(_0x16f24d){return request(_0x5a9e('0x34'),{'options':{'raw':![],'where':{'phone':_0x16f24d[_0x5a9e('0x35')],'ListId':_0x16f24d[_0x5a9e('0x36')]}}})[_0x5a9e('0x5')](function(_0x29c71d){if(_0x29c71d){return _0x29c71d;}return request(_0x5a9e('0x37'),{'body':_0x16f24d});});};exports[_0x5a9e('0x38')]=function(_0xcccf5d){return request(_0x5a9e('0x39'),{'options':{'where':{'id':_0xcccf5d},'attributes':[_0x5a9e('0xc')]}});};exports[_0x5a9e('0x3a')]=function(_0x531f33,_0xbc160c){return request(_0x5a9e('0x3b'),{'body':{'interface':_0xbc160c},'options':{'where':_0x531f33}});};exports['agentPause']=function(_0x326787,_0x55f7cf,_0x42cc0b){return request(_0x5a9e('0x3c'),{'body':{'type':_0x55f7cf,'uniqueid':_0x42cc0b},'options':{'where':_0x326787}});};exports[_0x5a9e('0x3d')]=function(_0x24e741){return request(_0x5a9e('0x3e'),{'body':{},'options':{'where':_0x24e741}});};exports['agentLogout']=function(_0xf81cd0){return request(_0x5a9e('0x3f'),{'body':{},'options':{'where':_0xf81cd0}});}; \ 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 f9f2878..0a32fa5 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 _0x90b5=['exports','./polly'];(function(_0x16d351,_0x2b30b6){var _0x2c3ba8=function(_0x5efeaa){while(--_0x5efeaa){_0x16d351['push'](_0x16d351['shift']());}};_0x2c3ba8(++_0x2b30b6);}(_0x90b5,0x139));var _0x590b=function(_0x3ce088,_0x4aad52){_0x3ce088=_0x3ce088-0x0;var _0x12b5e1=_0x90b5[_0x3ce088];return _0x12b5e1;};var polly=require(_0x590b('0x0'));var lex=require('./lex');module[_0x590b('0x1')]={'polly':polly,'lex':lex}; \ No newline at end of file +var _0x1fcc=['./lex','./polly'];(function(_0x28baff,_0x6e011b){var _0x4ce82d=function(_0x121557){while(--_0x121557){_0x28baff['push'](_0x28baff['shift']());}};_0x4ce82d(++_0x6e011b);}(_0x1fcc,0x125));var _0xc1fc=function(_0x46b22a,_0x5bf83a){_0x46b22a=_0x46b22a-0x0;var _0x44c2e8=_0x1fcc[_0x46b22a];return _0x44c2e8;};var polly=require(_0xc1fc('0x0'));var lex=require(_0xc1fc('0x1'));module['exports']={'polly':polly,'lex':lex}; \ No newline at end of file diff --git a/server/services/agi/scripts/aws/lex/index.js b/server/services/agi/scripts/aws/lex/index.js index 7042af0..398ddab 100644 --- a/server/services/agi/scripts/aws/lex/index.js +++ b/server/services/agi/scripts/aws/lex/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe706=['exports','./lib/api'];(function(_0xda0bbd,_0x331bd4){var _0x28d4a5=function(_0x326536){while(--_0x326536){_0xda0bbd['push'](_0xda0bbd['shift']());}};_0x28d4a5(++_0x331bd4);}(_0xe706,0xa3));var _0x6e70=function(_0x30584f,_0x4a1f96){_0x30584f=_0x30584f-0x0;var _0x2a31e1=_0xe706[_0x30584f];return _0x2a31e1;};'use strict';var lex=require(_0x6e70('0x0'));module[_0x6e70('0x1')]=function(_0x311951,_0x5e8446,_0x2cae77,_0x315629,_0x2ca810,_0x7dfbc3){return lex(_0x311951,_0x5e8446,_0x2cae77,_0x315629,_0x2ca810,_0x7dfbc3);}; \ No newline at end of file +var _0x4483=['exports','./lib/api'];(function(_0x37d5f6,_0x4ab0cc){var _0x4ba38a=function(_0x57e733){while(--_0x57e733){_0x37d5f6['push'](_0x37d5f6['shift']());}};_0x4ba38a(++_0x4ab0cc);}(_0x4483,0x1a3));var _0x3448=function(_0x18fc81,_0x7e7392){_0x18fc81=_0x18fc81-0x0;var _0x1f1bf4=_0x4483[_0x18fc81];return _0x1f1bf4;};'use strict';var lex=require(_0x3448('0x0'));module[_0x3448('0x1')]=function(_0x229c0c,_0x481d0c,_0x202d3d,_0x1fe72d,_0x27ef60,_0x3a7178){return lex(_0x229c0c,_0x481d0c,_0x202d3d,_0x1fe72d,_0x27ef60,_0x3a7178);}; \ 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 ccf856b..de2b4a5 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(_0xa86712,_0x137354){var _0x354aab=function(_0x12fdf9){while(--_0x12fdf9){_0xa86712['push'](_0xa86712['shift']());}};_0x354aab(++_0x137354);}(_0xa9e0,0x123));var _0x0a9e=function(_0x34bc30,_0x177cb0){_0x34bc30=_0x34bc30-0x0;var _0x5706de=_0xa9e0[_0x34bc30];return _0x5706de;};'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(_0x1529f6,_0x5833d5){var _0x3855c4=function(_0x319ae9){while(--_0x319ae9){_0x1529f6['push'](_0x1529f6['shift']());}};_0x3855c4(++_0x5833d5);}(_0xa9e0,0x123));var _0x0a9e=function(_0x37bd26,_0x5ad346){_0x37bd26=_0x37bd26-0x0;var _0xe83dc4=_0xa9e0[_0x37bd26];return _0xe83dc4;};'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 96eef64..c80ba94 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 _0x8616=['./lib/api','exports'];(function(_0x277107,_0x3420dc){var _0x1da046=function(_0x47122d){while(--_0x47122d){_0x277107['push'](_0x277107['shift']());}};_0x1da046(++_0x3420dc);}(_0x8616,0x130));var _0x6861=function(_0xf91841,_0x182ae3){_0xf91841=_0xf91841-0x0;var _0x4b9c44=_0x8616[_0xf91841];return _0x4b9c44;};'use strict';var polly=require(_0x6861('0x0'));module[_0x6861('0x1')]=function(_0x993396,_0x3be543,_0x3c4b87,_0x56445f,_0x1323f9,_0x419485,_0xe7ca4){return polly(_0x993396,_0x3be543,_0x3c4b87,_0x56445f,_0x1323f9,_0x419485,_0xe7ca4);}; \ No newline at end of file +'use strict';var polly=require('./lib/api');module['exports']=function(_0x1cb1d7,_0x299dd6,_0x5c6f7a,_0x5638cc,_0x4f4a1c,_0x2a4295,_0xe5a3ae){return polly(_0x1cb1d7,_0x299dd6,_0x5c6f7a,_0x5638cc,_0x4f4a1c,_0x2a4295,_0xe5a3ae);}; \ 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 26ad685..8b3ae18 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 _0xfc45=['mp3','path','bluebird','randomstring','aws-sdk','AudioStream','No\x20data\x20response\x20from\x20aws\x20Polly!','Polly','text'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xfc45,0x121));var _0x5fc4=function(_0x33ab3b,_0x477d60){_0x33ab3b=_0x33ab3b-0x0;var _0x30d5f7=_0xfc45[_0x33ab3b];return _0x30d5f7;};'use strict';var fs=require('fs');var path=require(_0x5fc4('0x0'));var BPromise=require(_0x5fc4('0x1'));var rs=require(_0x5fc4('0x2'));var AWS=require(_0x5fc4('0x3'));function pollyResult(_0x27d07c,_0x19111c,_0x93bfc8){return new BPromise(function(_0x44fcf1,_0x4b7b68){_0x27d07c['synthesizeSpeech'](_0x19111c,function(_0x40a50c,_0x21e69c){if(_0x40a50c){_0x4b7b68(_0x40a50c);}else if(_0x21e69c){if(_0x21e69c['AudioStream']instanceof Buffer){fs['writeFile'](_0x93bfc8,_0x21e69c[_0x5fc4('0x4')],function(_0x2b2c36){if(_0x2b2c36){_0x4b7b68(_0x2b2c36);}else{_0x44fcf1();}});}else{_0x4b7b68(new Error('Invalid\x20data\x20response\x20from\x20aws\x20Polly!'));}}else{_0x4b7b68(new Error(_0x5fc4('0x5')));}});});}module['exports']=function(_0xd8eb9f,_0x28ec44,_0x4a446,_0x59f34c,_0x3fb572,_0x2b0640,_0x2c66de){var _0x283194=new AWS[(_0x5fc4('0x6'))]({'accessKeyId':_0xd8eb9f,'secretAccessKey':_0x28ec44,'region':_0x4a446});var _0x5b252b={'Text':_0x3fb572,'TextType':_0x2b0640||_0x5fc4('0x7'),'OutputFormat':_0x5fc4('0x8'),'VoiceId':_0x59f34c};return pollyResult(_0x283194,_0x5b252b,_0x2c66de);}; \ No newline at end of file +var _0x178d=['AudioStream','writeFile','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','No\x20data\x20response\x20from\x20aws\x20Polly!','exports','text','mp3','path','bluebird','randomstring','synthesizeSpeech'];(function(_0x1cf6f6,_0xcbb09f){var _0xb3c948=function(_0x59c045){while(--_0x59c045){_0x1cf6f6['push'](_0x1cf6f6['shift']());}};_0xb3c948(++_0xcbb09f);}(_0x178d,0x125));var _0xd178=function(_0x32a14e,_0x51d22b){_0x32a14e=_0x32a14e-0x0;var _0x3dac02=_0x178d[_0x32a14e];return _0x3dac02;};'use strict';var fs=require('fs');var path=require(_0xd178('0x0'));var BPromise=require(_0xd178('0x1'));var rs=require(_0xd178('0x2'));var AWS=require('aws-sdk');function pollyResult(_0x493e58,_0x11f56f,_0x11e34f){return new BPromise(function(_0x25157e,_0x10d44c){_0x493e58[_0xd178('0x3')](_0x11f56f,function(_0x5e515c,_0x150e55){if(_0x5e515c){_0x10d44c(_0x5e515c);}else if(_0x150e55){if(_0x150e55[_0xd178('0x4')]instanceof Buffer){fs[_0xd178('0x5')](_0x11e34f,_0x150e55[_0xd178('0x4')],function(_0x2ddd6d){if(_0x2ddd6d){_0x10d44c(_0x2ddd6d);}else{_0x25157e();}});}else{_0x10d44c(new Error(_0xd178('0x6')));}}else{_0x10d44c(new Error(_0xd178('0x7')));}});});}module[_0xd178('0x8')]=function(_0x33198b,_0x436e7c,_0x10e478,_0x484d3f,_0x55dbd8,_0x447df3,_0x40464b){var _0x1cdf2f=new AWS['Polly']({'accessKeyId':_0x33198b,'secretAccessKey':_0x436e7c,'region':_0x10e478});var _0x2ed768={'Text':_0x55dbd8,'TextType':_0x447df3||_0xd178('0x9'),'OutputFormat':_0xd178('0xa'),'VoiceId':_0x484d3f};return pollyResult(_0x1cdf2f,_0x2ed768,_0x40464b);}; \ 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 0d79389..945fbb2 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 _0x1a97=['./lib/api','exports'];(function(_0x1dee3d,_0x4bc9ab){var _0x471d09=function(_0x2f7716){while(--_0x2f7716){_0x1dee3d['push'](_0x1dee3d['shift']());}};_0x471d09(++_0x4bc9ab);}(_0x1a97,0x1d2));var _0x71a9=function(_0x1f5887,_0x2fa1f1){_0x1f5887=_0x1f5887-0x0;var _0x21774b=_0x1a97[_0x1f5887];return _0x21774b;};'use strict';var asr=require(_0x71a9('0x0'));module[_0x71a9('0x1')]=function(_0x4eb512,_0x569dd3,_0x4baf60,_0x59e685){return asr(_0x4eb512,_0x569dd3,_0x4baf60);}; \ No newline at end of file +var _0x1cc1=['./lib/api','exports'];(function(_0x3d8cde,_0x1d4b3c){var _0x222677=function(_0x502aad){while(--_0x502aad){_0x3d8cde['push'](_0x3d8cde['shift']());}};_0x222677(++_0x1d4b3c);}(_0x1cc1,0xb4));var _0x11cc=function(_0x25a2dc,_0x399aca){_0x25a2dc=_0x25a2dc-0x0;var _0x5db5d5=_0x1cc1[_0x25a2dc];return _0x5db5d5;};'use strict';var asr=require(_0x11cc('0x0'));module[_0x11cc('0x1')]=function(_0x25ff1d,_0x3afebd,_0x446c6a,_0x4fc82c){return asr(_0x25ff1d,_0x3afebd,_0x446c6a);}; \ 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 6f4b24f..26ea25d 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 _0xfe57=['length','filepath\x20should\x20be\x20a\x20string','key\x20should\x20be\x20a\x20string','undefined','readFileSync','toString','POST','/v1/speech:recognize?key=','8000','url','bluebird','string'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0xfe57,0x195));var _0x7fe5=function(_0x22868f,_0x450f48){_0x22868f=_0x22868f-0x0;var _0x97bc75=_0xfe57[_0x22868f];return _0x97bc75;};'use strict';var url=require(_0x7fe5('0x0'));var BPromise=require(_0x7fe5('0x1'));var fs=require('fs');var host='https://speech.googleapis.com';module['exports']=function(_0x3f7dca,_0x4744a9,_0xc27f79){return new BPromise(function(_0x421809,_0x89ad5f){var _0x1254d2;if(typeof _0x3f7dca!==_0x7fe5('0x2')||_0x3f7dca[_0x7fe5('0x3')]===0x0){return _0x89ad5f(_0x7fe5('0x4'));}if(typeof _0x4744a9!==_0x7fe5('0x2')||_0x4744a9[_0x7fe5('0x3')]===0x0){return _0x89ad5f(_0x7fe5('0x5'));}if(typeof _0xc27f79!==_0x7fe5('0x6')&&(typeof _0xc27f79!=='string'||_0xc27f79[_0x7fe5('0x3')]===0x0)){return _0x89ad5f('lang\x20should\x20be\x20a\x20string');}try{_0x1254d2=fs[_0x7fe5('0x7')](_0x3f7dca)[_0x7fe5('0x8')]('base64');}catch(_0x534b10){return _0x89ad5f(_0x534b10);}return _0x421809({'method':_0x7fe5('0x9'),'uri':host+_0x7fe5('0xa')+_0x4744a9,'body':{'config':{'encoding':'LINEAR16','sampleRateHertz':_0x7fe5('0xb'),'languageCode':_0xc27f79},'audio':{'content':_0x1254d2}},'json':!![]});});}; \ No newline at end of file +var _0x81d5=['filepath\x20should\x20be\x20a\x20string','key\x20should\x20be\x20a\x20string','undefined','base64','POST','/v1/speech:recognize?key=','LINEAR16','url','bluebird','exports','string','length'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x81d5,0x1ab));var _0x581d=function(_0x31d8ac,_0x36d44b){_0x31d8ac=_0x31d8ac-0x0;var _0x41d8f6=_0x81d5[_0x31d8ac];return _0x41d8f6;};'use strict';var url=require(_0x581d('0x0'));var BPromise=require(_0x581d('0x1'));var fs=require('fs');var host='https://speech.googleapis.com';module[_0x581d('0x2')]=function(_0x20d1a8,_0x2fe463,_0x9fb336){return new BPromise(function(_0x477e28,_0x553617){var _0x4801bc;if(typeof _0x20d1a8!==_0x581d('0x3')||_0x20d1a8[_0x581d('0x4')]===0x0){return _0x553617(_0x581d('0x5'));}if(typeof _0x2fe463!=='string'||_0x2fe463[_0x581d('0x4')]===0x0){return _0x553617(_0x581d('0x6'));}if(typeof _0x9fb336!==_0x581d('0x7')&&(typeof _0x9fb336!=='string'||_0x9fb336[_0x581d('0x4')]===0x0)){return _0x553617('lang\x20should\x20be\x20a\x20string');}try{_0x4801bc=fs['readFileSync'](_0x20d1a8)['toString'](_0x581d('0x8'));}catch(_0x3435a9){return _0x553617(_0x3435a9);}return _0x477e28({'method':_0x581d('0x9'),'uri':host+_0x581d('0xa')+_0x2fe463,'body':{'config':{'encoding':_0x581d('0xb'),'sampleRateHertz':'8000','languageCode':_0x9fb336},'audio':{'content':_0x4801bc}},'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 25bd596..90a0c8f 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 _0xe19c=['./asr','exports'];(function(_0x340380,_0x4bd2a8){var _0x49ce1c=function(_0x4cb9e2){while(--_0x4cb9e2){_0x340380['push'](_0x340380['shift']());}};_0x49ce1c(++_0x4bd2a8);}(_0xe19c,0x152));var _0xce19=function(_0x2afbb0,_0x44f16d){_0x2afbb0=_0x2afbb0-0x0;var _0x411ff2=_0xe19c[_0x2afbb0];return _0x411ff2;};var asr=require(_0xce19('0x0'));module[_0xce19('0x1')]={'asr':asr}; \ No newline at end of file +var _0x4fc6=['exports','./asr'];(function(_0x5f17d7,_0x1579d5){var _0x23f5ad=function(_0x587d77){while(--_0x587d77){_0x5f17d7['push'](_0x5f17d7['shift']());}};_0x23f5ad(++_0x1579d5);}(_0x4fc6,0x111));var _0x64fc=function(_0x54d931,_0x45cc27){_0x54d931=_0x54d931-0x0;var _0x5ca602=_0x4fc6[_0x54d931];return _0x5ca602;};var asr=require(_0x64fc('0x0'));module[_0x64fc('0x1')]={'asr':asr}; \ No newline at end of file diff --git a/server/services/agi/scripts/index.js b/server/services/agi/scripts/index.js index fe5f1d3..d50a6cb 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 _0xecd9=['bluebird','dialogflow','https','md5','path','request-promise','randomstring','sox','google-tts-api','url','parse','./sestek','./tilde','../../../config/logger','agi','https://api.ispeech.org/api/rest','protocol','host','WHAT_EVER','get','statusCode','error','request\x20to\x20','statusMessage','\x20failed,\x20status\x20code\x20=\x20','createWriteStream','finish','info','finish\x20download\x20file','close','unlink','download\x20error','https:','data','end','transcode','error\x20convert','finish\x20to\x20convert','resolve','tmp','generate','.wav','writeFileSync','then','chmodSync','777','readFileSync','base64','googleCloudTTS','https://texttospeech.googleapis.com/v1/','?key=','ssml','input','voice','audioConfig','MP3','text:synthesize','POST','from','audioContent','writeFile','googleCloudTTS\x20path','split','googleTTS','https://translate.google.com/_/TranslateWebserverUi/data/batchexecute','utf8','application/x-www-form-urlencoded','f.req=','jQ1olc','generic','parse\x20response\x20failed:\x0a','length','text\x20length\x20limit\x20reached','googleASR','asr','results','map','alternatives','transcript','confidence','join','googleASR\x20transcription','googleASR\x20confidence','catch','name','message','googleDialogflow','stringify','source','result','resolvedQuery','action','actionIncomplete','fulfillment','speech','score','status','code','metadata','endConversation','isFallbackIntent','replace','sessionPath','queryResult','allRequiredParamsPresent','diagnosticInfo','fields','end_conversation','boolValue','intent','displayName','isFallback','languageCode','queryText','intentDetectionConfidence','fulfillmentText','tildeASR','Tilde\x20ASR\x20transcription','Tilde\x20ASR\x20confidence','awsPolly','.mp3','polly','awsLex','lex','%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','sestekNDA','nda','channelData','CustomAction','CustomActionData','AudioFromTts','Data','audiofile','apiai-promise'];(function(_0x1e2080,_0x53283b){var _0x260111=function(_0x15da5e){while(--_0x15da5e){_0x1e2080['push'](_0x1e2080['shift']());}};_0x260111(++_0x53283b);}(_0xecd9,0x8a));var _0x9ecd=function(_0x9a60d4,_0x1b97b2){_0x9a60d4=_0x9a60d4-0x0;var _0x49fea2=_0xecd9[_0x9a60d4];return _0x49fea2;};'use strict';var apiai=require(_0x9ecd('0x0'));var BPromise=require(_0x9ecd('0x1'));var dialogflow=require(_0x9ecd('0x2'));var fs=require('fs');var http=require('http');var https=require(_0x9ecd('0x3'));var md5=require(_0x9ecd('0x4'));var path=require(_0x9ecd('0x5'));var querystring=require('querystring');var rp=require(_0x9ecd('0x6'));var rs=require(_0x9ecd('0x7'));var sox=require(_0x9ecd('0x8'));var tts=require(_0x9ecd('0x9'));var urlParse=require(_0x9ecd('0xa'))[_0x9ecd('0xb')];var util=require('util');var aws=require('./aws');var google=require('./google');var sestek=require(_0x9ecd('0xc'));var tilde=require(_0x9ecd('0xd'));var logger=require(_0x9ecd('0xe'))(_0x9ecd('0xf'));var ISPEECH_API=_0x9ecd('0x10');function downloadFile(_0x295e5e,_0x2560c4){return new BPromise(function(_0x8418e0,_0x1e37ba){var _0x5218e0=urlParse(_0x295e5e);var _0x2c4dbd=_0x5218e0[_0x9ecd('0x11')]==='https:'?https:http;var _0x2f4956={'host':_0x5218e0[_0x9ecd('0x12')],'path':_0x5218e0[_0x9ecd('0x5')],'headers':{'user-agent':_0x9ecd('0x13')}};_0x2c4dbd[_0x9ecd('0x14')](_0x2f4956,function(_0x155348){if(_0x155348[_0x9ecd('0x15')]!==0xc8){logger[_0x9ecd('0x16')](_0x9ecd('0x17')+_0x295e5e+'\x20failed,\x20status\x20code\x20=\x20'+_0x155348['statusCode']+'\x20('+_0x155348[_0x9ecd('0x18')]+')');_0x1e37ba(new Error('request\x20to\x20'+_0x295e5e+_0x9ecd('0x19')+_0x155348['statusCode']+'\x20('+_0x155348[_0x9ecd('0x18')]+')'));return;}var _0x136fda=fs[_0x9ecd('0x1a')](_0x2560c4);_0x136fda['on'](_0x9ecd('0x1b'),function(){logger[_0x9ecd('0x1c')](_0x9ecd('0x1d'));_0x136fda[_0x9ecd('0x1e')](_0x8418e0);});_0x136fda['on'](_0x9ecd('0x16'),function(_0x4f441d){fs[_0x9ecd('0x1f')](_0x2560c4);logger[_0x9ecd('0x16')](_0x9ecd('0x20'),_0x4f441d);_0x1e37ba(_0x4f441d);});_0x155348['pipe'](_0x136fda);})['on'](_0x9ecd('0x16'),function(_0x4dfb76){logger[_0x9ecd('0x16')](_0x4dfb76);_0x1e37ba(_0x4dfb76);})['end']();});}function uploadFile(_0x1a859a){return new BPromise(function(_0x5e2d86,_0x112172){var _0x27e1fa=urlParse(_0x1a859a);var _0x5134f4=_0x27e1fa[_0x9ecd('0x11')]===_0x9ecd('0x21')?https:http;var _0xc0245f={'host':_0x27e1fa['host'],'path':_0x27e1fa[_0x9ecd('0x5')],'headers':{'user-agent':_0x9ecd('0x13')}};_0x5134f4[_0x9ecd('0x14')](_0xc0245f,function(_0x42f9eb){if(_0x42f9eb['statusCode']!==0xc8){_0x112172(new Error('request\x20to\x20'+_0x1a859a+'\x20failed,\x20status\x20code\x20=\x20'+_0x42f9eb[_0x9ecd('0x15')]+'\x20('+_0x42f9eb[_0x9ecd('0x18')]+')'));return;}var _0x577c76='';_0x42f9eb['on'](_0x9ecd('0x22'),function(_0x215871){_0x577c76+=_0x215871;});_0x42f9eb['on']('end',function(){_0x5e2d86(_0x577c76);});})['on']('error',function(_0x17a2fd){_0x112172(_0x17a2fd);})[_0x9ecd('0x23')]();});}function convertFile(_0x47a3c7,_0x2d1b32){return new BPromise(function(_0x2b8f06,_0x43027f){var _0x36559e=sox[_0x9ecd('0x24')](_0x47a3c7,_0x2d1b32,{'sampleRate':0x1f40,'format':'wav','channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x36559e['on']('error',function(_0x3c6f69){logger['error'](_0x9ecd('0x25'),_0x3c6f69);_0x43027f(_0x3c6f69);});_0x36559e['on'](_0x9ecd('0x23'),function(){logger[_0x9ecd('0x1c')](_0x9ecd('0x26'));_0x2b8f06();});_0x36559e['start']();});}function base64Decode(_0x11e98c,_0x49524b){var _0x2928f1=path[_0x9ecd('0x27')](__dirname,_0x9ecd('0x28'),rs[_0x9ecd('0x29')](0x4)+_0x9ecd('0x2a'));fs[_0x9ecd('0x2b')](_0x2928f1,_0x11e98c,'base64');return convertFile(_0x2928f1,_0x49524b)[_0x9ecd('0x2c')](function(){try{fs[_0x9ecd('0x1f')](_0x2928f1);fs[_0x9ecd('0x2d')](_0x49524b,_0x9ecd('0x2e'));}catch(_0x2b6b8c){logger[_0x9ecd('0x16')](_0x2b6b8c);}return _0x49524b['split']('.')[0x0];});}function base64Encode(_0x491c2a){var _0x2816f6=fs[_0x9ecd('0x2f')](_0x491c2a);return new Buffer(_0x2816f6)['toString'](_0x9ecd('0x30'));}exports[_0x9ecd('0x31')]=function(_0x4609c4,_0x431d24,_0x460ecc,_0x3c07cc,_0x420014,_0x52f33d){var _0x4f99a6,_0x29cd3a;var _0x139fc4=_0x9ecd('0x32');var _0x5573fa=_0x9ecd('0x33')+_0x4609c4;var _0x3fa301={};if(_0x431d24===_0x9ecd('0x34')){_0x3fa301[_0x9ecd('0x35')]={'ssml':_0x460ecc};}else{_0x3fa301['input']={'text':_0x460ecc};};_0x3fa301[_0x9ecd('0x36')]={'languageCode':_0x3c07cc,'ssmlGender':_0x420014};_0x3fa301[_0x9ecd('0x37')]={'audioEncoding':_0x9ecd('0x38'),'sampleRateHertz':0x1f40};var _0x349ad6={'url':_0x139fc4+_0x9ecd('0x39')+_0x5573fa,'method':_0x9ecd('0x3a'),'json':!![],'body':_0x3fa301};return rp(_0x349ad6)[_0x9ecd('0x2c')](function(_0x49f2a3){return new BPromise(function(_0x217355,_0x4e3636){_0x4f99a6=path[_0x9ecd('0x27')](__dirname,_0x9ecd('0x28'),rs[_0x9ecd('0x29')](0x4)+'.mp3');var _0x2f5fa9=Buffer[_0x9ecd('0x3b')](_0x49f2a3[_0x9ecd('0x3c')],_0x9ecd('0x30'));return fs[_0x9ecd('0x3d')](_0x4f99a6,_0x2f5fa9,function(_0x41f04a){_0x4e3636(_0x41f04a);},function(_0x290bbe){fs[_0x9ecd('0x2d')](_0x4f99a6,_0x9ecd('0x2e'));_0x217355(_0x290bbe);});});})['then'](function(_0x6c77d3){_0x29cd3a=path['resolve'](__dirname,_0x9ecd('0x28'),rs[_0x9ecd('0x29')](0x4)+_0x9ecd('0x2a'));return convertFile(_0x4f99a6,_0x29cd3a);})[_0x9ecd('0x2c')](function(){try{fs['unlink'](_0x4f99a6);fs[_0x9ecd('0x2d')](_0x29cd3a,_0x9ecd('0x2e'));}catch(_0x57f578){logger[_0x9ecd('0x16')](_0x57f578);}logger[_0x9ecd('0x1c')](_0x9ecd('0x3e'),_0x29cd3a[_0x9ecd('0x3f')]('.')[0x0]);return _0x29cd3a[_0x9ecd('0x3f')]('.')[0x0];});};exports[_0x9ecd('0x40')]=function(_0x417797,_0x4d55e7){var _0x163127=_0x9ecd('0x41');var _0x41f935,_0x2dbdab;var _0x41d2df;var _0x9eb99a={'encoding':_0x9ecd('0x42'),'method':_0x9ecd('0x3a'),'timeout':0x2710,'url':_0x163127,'headers':{'Content-Type':_0x9ecd('0x43')},'body':_0x9ecd('0x44')+encodeURIComponent(JSON['stringify']([[[_0x9ecd('0x45'),JSON['stringify']([_0x417797,_0x4d55e7||'en',![],'null']),null,_0x9ecd('0x46')]]]))};return rp(_0x9eb99a)[_0x9ecd('0x2c')](function(_0x1b4e08){try{_0x41d2df=eval(_0x1b4e08['slice'](0x5))[0x0][0x2];}catch(_0x20b693){throw new Error(_0x9ecd('0x47')+_0x1b4e08[_0x9ecd('0x22')]);}if(!_0x41d2df){if(_0x417797[_0x9ecd('0x48')]>0xc8){throw new Error(_0x9ecd('0x49'));}else{throw new Error('lang\x20\x22'+_0x4d55e7+'\x22\x20might\x20not\x20exist');}}try{_0x41d2df=eval(_0x41d2df)[0x0];}catch(_0x5f1ede){throw new Error('parse\x20response\x20failed:\x0a'+res[_0x9ecd('0x22')]);}const _0x2115ea=_0x41d2df;_0x41f935=path['resolve'](__dirname,_0x9ecd('0x28'),rs[_0x9ecd('0x29')](0x4)+'.mp3');fs[_0x9ecd('0x2b')](_0x41f935,_0x41d2df,{'encoding':'base64'});_0x2dbdab=path[_0x9ecd('0x27')](__dirname,'tmp',rs[_0x9ecd('0x29')](0x4)+_0x9ecd('0x2a'));return convertFile(_0x41f935,_0x2dbdab);})[_0x9ecd('0x2c')](function(){try{fs[_0x9ecd('0x1f')](_0x41f935);fs['chmodSync'](_0x2dbdab,_0x9ecd('0x2e'));}catch(_0x1b3973){logger[_0x9ecd('0x16')](_0x1b3973);}logger['info']('goggleTTS\x20path',_0x2dbdab[_0x9ecd('0x3f')]('.')[0x0]);return _0x2dbdab[_0x9ecd('0x3f')]('.')[0x0];});};exports[_0x9ecd('0x4a')]=function(_0x2130f4,_0x3d8656,_0x48d297){return google[_0x9ecd('0x4b')](_0x2130f4,_0x3d8656,_0x48d297)[_0x9ecd('0x2c')](function(_0x3af7bc){logger[_0x9ecd('0x1c')](_0x3af7bc['uri']);return rp(_0x3af7bc);})[_0x9ecd('0x2c')](function(_0x476e2a){var _0x306eb9='';var _0x1279d5=0x0;try{fs['unlink'](_0x2130f4);}catch(_0x29d481){logger[_0x9ecd('0x16')](_0x29d481);}if(_0x476e2a&&_0x476e2a[_0x9ecd('0x4c')]){_0x306eb9=_0x476e2a[_0x9ecd('0x4c')][_0x9ecd('0x4d')](function(_0x3a6847){return _0x3a6847&&_0x3a6847[_0x9ecd('0x4e')][0x0]&&_0x3a6847[_0x9ecd('0x4e')][0x0][_0x9ecd('0x4f')]?_0x3a6847['alternatives'][0x0][_0x9ecd('0x4f')]:'';})['join']('\x0a');_0x1279d5=_0x476e2a['results'][_0x9ecd('0x4d')](function(_0x2778cc){return _0x2778cc&&_0x2778cc[_0x9ecd('0x4e')][0x0]&&_0x2778cc[_0x9ecd('0x4e')][0x0][_0x9ecd('0x50')]?_0x2778cc['alternatives'][0x0]['confidence']:0x0;})[_0x9ecd('0x51')]('\x0a');}logger[_0x9ecd('0x1c')](_0x9ecd('0x52'),_0x306eb9);logger['info'](_0x9ecd('0x53'),_0x1279d5);return{'transcript':_0x306eb9,'confidence':_0x1279d5};})[_0x9ecd('0x54')](function(_0x581109){logger[_0x9ecd('0x16')]('[%s]\x20%s:%s',_0x581109['statusCode'],_0x581109[_0x9ecd('0x55')],_0x581109[_0x9ecd('0x56')]);});};exports[_0x9ecd('0x57')]=function(_0x379ed2,_0x3109ab,_0x52022e,_0x59c666){var _0x4a3a98=apiai(_0x3109ab,{'language':_0x59c666||'en'});return _0x4a3a98['textRequest'](_0x52022e,{'sessionId':md5(_0x379ed2)})[_0x9ecd('0x2c')](function(_0x20f841){logger[_0x9ecd('0x1c')](JSON[_0x9ecd('0x58')](_0x20f841));return{'source':_0x20f841['result'][_0x9ecd('0x59')],'resolvedQuery':_0x20f841[_0x9ecd('0x5a')][_0x9ecd('0x5b')],'action':_0x20f841['result'][_0x9ecd('0x5c')],'actionIncomplete':_0x20f841['result'][_0x9ecd('0x5d')],'speech':_0x20f841[_0x9ecd('0x5a')][_0x9ecd('0x5e')][_0x9ecd('0x5f')],'score':_0x20f841[_0x9ecd('0x5a')][_0x9ecd('0x60')],'statusCode':_0x20f841[_0x9ecd('0x61')][_0x9ecd('0x62')],'endConversation':_0x20f841['result'][_0x9ecd('0x63')][_0x9ecd('0x64')]||![],'isFallbackIntent':_0x20f841[_0x9ecd('0x5a')][_0x9ecd('0x63')][_0x9ecd('0x65')]};});};exports['googleDialogflowV2']=function(_0x1e8873,_0x53beee,_0x54f198,_0x589b0c,_0xe8c1b8,_0x1abcf5){var _0x335c71=_0x589b0c[_0x9ecd('0x66')](/\\n/g,'\x0a');var _0x317c5a={'credentials':{'private_key':_0x335c71,'client_email':_0x54f198}};var _0x31a089=new dialogflow['SessionsClient'](_0x317c5a);var _0x2cb5ab=_0x31a089[_0x9ecd('0x67')](_0x53beee,md5(_0x1e8873));var _0x2f1934={'session':_0x2cb5ab,'queryInput':{'text':{'text':_0xe8c1b8,'languageCode':_0x1abcf5}}};return _0x31a089['detectIntent'](_0x2f1934)[_0x9ecd('0x2c')](function(_0x3741f2){if(_0x3741f2&&_0x3741f2[_0x9ecd('0x48')]){logger['info']('Dialogflow\x20V2\x20response:',JSON[_0x9ecd('0x58')](_0x3741f2));var _0x4a7bc4=_0x3741f2[0x0];if(_0x4a7bc4){var _0x104ccc={'action':_0x4a7bc4[_0x9ecd('0x68')]['action'],'allRequiredParamsPresent':_0x4a7bc4[_0x9ecd('0x68')][_0x9ecd('0x69')],'endConversation':_0x4a7bc4[_0x9ecd('0x68')][_0x9ecd('0x6a')]&&_0x4a7bc4[_0x9ecd('0x68')][_0x9ecd('0x6a')]['fields']?_0x4a7bc4[_0x9ecd('0x68')][_0x9ecd('0x6a')][_0x9ecd('0x6b')][_0x9ecd('0x6c')][_0x9ecd('0x6d')]:![],'fulfillmentText':_0x4a7bc4[_0x9ecd('0x68')]['fulfillmentText'],'intentName':_0x4a7bc4[_0x9ecd('0x68')][_0x9ecd('0x6e')][_0x9ecd('0x55')],'intentDisplayName':_0x4a7bc4[_0x9ecd('0x68')]['intent'][_0x9ecd('0x6f')],'isFallbackIntent':_0x4a7bc4['queryResult']['intent'][_0x9ecd('0x70')],'languageCode':_0x4a7bc4['queryResult'][_0x9ecd('0x71')],'queryText':_0x4a7bc4[_0x9ecd('0x68')][_0x9ecd('0x72')],'responseId':_0x4a7bc4['responseId'],'score':_0x4a7bc4[_0x9ecd('0x68')][_0x9ecd('0x73')],'speech':_0x4a7bc4['queryResult'][_0x9ecd('0x74')],'providerResponse':JSON[_0x9ecd('0x58')](_0x3741f2)};return _0x104ccc;}}});};exports[_0x9ecd('0x75')]=function(_0x25fd16,_0x4c32d8,_0x4e0663,_0x1a98eb){return tilde[_0x9ecd('0x4b')](_0x25fd16,_0x4c32d8,_0x4e0663,_0x1a98eb)['then'](function(_0xe6436a){try{fs[_0x9ecd('0x1f')](_0x25fd16);}catch(_0xce951b){logger[_0x9ecd('0x16')](_0xce951b);}logger['info'](_0x9ecd('0x76'),_0xe6436a[_0x9ecd('0x4f')]);logger['info'](_0x9ecd('0x77'),_0xe6436a[_0x9ecd('0x50')]);return _0xe6436a;});};exports[_0x9ecd('0x78')]=function(_0x21fc9b,_0x2137a6,_0x20d77c,_0x1ae1fe,_0x32071f,_0x52c64c){var _0x2bff2a=path[_0x9ecd('0x27')](__dirname,_0x9ecd('0x28'),rs[_0x9ecd('0x29')](0x4)+_0x9ecd('0x79'));var _0x21fa2c;return aws[_0x9ecd('0x7a')](_0x21fc9b,_0x2137a6,_0x20d77c,_0x1ae1fe,_0x32071f,_0x52c64c,_0x2bff2a)['then'](function(){_0x21fa2c=path[_0x9ecd('0x27')](__dirname,_0x9ecd('0x28'),rs[_0x9ecd('0x29')](0x4)+'.wav');return convertFile(_0x2bff2a,_0x21fa2c);})[_0x9ecd('0x2c')](function(){try{fs[_0x9ecd('0x1f')](_0x2bff2a);fs['chmodSync'](_0x21fa2c,'777');}catch(_0x44408b){logger[_0x9ecd('0x16')](_0x44408b);}return _0x21fa2c[_0x9ecd('0x3f')]('.')[0x0];});};exports[_0x9ecd('0x7b')]=function(_0x2b104b,_0x397b5e,_0x17e9ed,_0x232e29,_0x6dc4bb,_0x5e5167){return aws[_0x9ecd('0x7c')](_0x2b104b,_0x397b5e,_0x17e9ed,_0x232e29,_0x6dc4bb,_0x5e5167)['then'](function(_0x1102d5){logger[_0x9ecd('0x1c')](JSON[_0x9ecd('0x58')](_0x1102d5));return _0x1102d5;});};exports['ispeechTTS']=function(_0x47bc35,_0x4844a1,_0x57d1c7,_0x44f0b6){var _0x34e121=util['format'](_0x9ecd('0x7d'),ISPEECH_API,_0x47bc35,encodeURIComponent(_0x4844a1),_0x57d1c7,_0x44f0b6);var _0x270c7e=path[_0x9ecd('0x27')](__dirname,_0x9ecd('0x28'),rs[_0x9ecd('0x29')](0x4)+_0x9ecd('0x79'));var _0x12d5e4;return downloadFile(_0x34e121,_0x270c7e)[_0x9ecd('0x2c')](function(){_0x12d5e4=path[_0x9ecd('0x27')](__dirname,_0x9ecd('0x28'),rs['generate'](0x4)+_0x9ecd('0x2a'));return convertFile(_0x270c7e,_0x12d5e4);})[_0x9ecd('0x2c')](function(){try{fs[_0x9ecd('0x1f')](_0x270c7e);fs['chmodSync'](_0x12d5e4,_0x9ecd('0x2e'));}catch(_0x2272f1){logger[_0x9ecd('0x16')](_0x2272f1);}return _0x12d5e4['split']('.')[0x0];});};exports[_0x9ecd('0x7e')]=function(_0x17fc54,_0x3d1e9b,_0x1e02a5,_0x3ab48e){var _0x4adcc4=util[_0x9ecd('0x7f')](_0x9ecd('0x80'),ISPEECH_API,_0x3d1e9b,_0x1e02a5,base64Encode(_0x17fc54),_0x3ab48e?util[_0x9ecd('0x7f')](_0x9ecd('0x81'),encodeURIComponent(_0x3ab48e)):_0x9ecd('0x82'));return uploadFile(_0x4adcc4)[_0x9ecd('0x2c')](function(_0x4a31e2){return querystring[_0x9ecd('0xb')](_0x4a31e2);});};exports[_0x9ecd('0x83')]=function(_0x30562b,_0x1b94df){return sestek[_0x9ecd('0x84')](_0x30562b,_0x1b94df)[_0x9ecd('0x2c')](function(_0x4b4e63){logger[_0x9ecd('0x1c')](JSON['stringify'](_0x4b4e63));var _0x516757={'speech':_0x4b4e63['text'],'action':_0x4b4e63[_0x9ecd('0x85')]?_0x4b4e63['channelData'][_0x9ecd('0x86')]:undefined,'actiondata':_0x4b4e63[_0x9ecd('0x85')]?_0x4b4e63[_0x9ecd('0x85')][_0x9ecd('0x87')]:undefined};if(_0x4b4e63[_0x9ecd('0x85')]&&_0x4b4e63[_0x9ecd('0x85')][_0x9ecd('0x88')]){return base64Decode(_0x4b4e63[_0x9ecd('0x85')][_0x9ecd('0x88')][_0x9ecd('0x89')],path[_0x9ecd('0x27')](__dirname,'tmp',rs['generate'](0x4)+_0x9ecd('0x2a')))[_0x9ecd('0x2c')](function(_0x1f3bb9){_0x516757[_0x9ecd('0x8a')]=_0x1f3bb9;return _0x516757;});}return _0x516757;});};exports['dirName']=function(){return __dirname;}; \ No newline at end of file +var _0x1134=['message','googleDialogflow','textRequest','result','resolvedQuery','action','score','status','code','metadata','endConversation','isFallbackIntent','googleDialogflowV2','replace','SessionsClient','sessionPath','detectIntent','Dialogflow\x20V2\x20response:','queryResult','allRequiredParamsPresent','diagnosticInfo','fields','end_conversation','boolValue','fulfillmentText','intent','displayName','isFallback','languageCode','queryText','responseId','tildeASR','asr','Tilde\x20ASR\x20confidence','awsPolly','polly','lex','ispeechTTS','format','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','ispeechASR','freeform=3','sestekNDA','text','channelData','CustomAction','AudioFromTts','Data','audiofile','bluebird','dialogflow','http','https','path','querystring','request-promise','randomstring','sox','google-tts-api','url','parse','util','./aws','./google','./sestek','./tilde','agi','https://api.ispeech.org/api/rest','https:','host','WHAT_EVER','get','statusCode','\x20failed,\x20status\x20code\x20=\x20','statusMessage','createWriteStream','finish','finish\x20download\x20file','error','unlink','download\x20error','pipe','end','protocol','request\x20to\x20','data','transcode','wav','info','finish\x20to\x20convert','start','resolve','tmp','generate','.wav','then','chmodSync','split','googleCloudTTS','?key=','ssml','input','voice','audioConfig','MP3','text:synthesize','POST','.mp3','from','audioContent','base64','writeFile','777','utf8','application/x-www-form-urlencoded','stringify','jQ1olc','null','generic','parse\x20response\x20failed:\x0a','length','text\x20length\x20limit\x20reached','lang\x20\x22','writeFileSync','goggleTTS\x20path','googleASR','uri','results','map','alternatives','transcript','join','confidence','googleASR\x20transcription','googleASR\x20confidence','catch','name'];(function(_0x15b380,_0x1a3c5f){var _0x232c5c=function(_0x12f8e0){while(--_0x12f8e0){_0x15b380['push'](_0x15b380['shift']());}};_0x232c5c(++_0x1a3c5f);}(_0x1134,0x1cc));var _0x4113=function(_0x26401d,_0x2e696f){_0x26401d=_0x26401d-0x0;var _0x2e6403=_0x1134[_0x26401d];return _0x2e6403;};'use strict';var apiai=require('apiai-promise');var BPromise=require(_0x4113('0x0'));var dialogflow=require(_0x4113('0x1'));var fs=require('fs');var http=require(_0x4113('0x2'));var https=require(_0x4113('0x3'));var md5=require('md5');var path=require(_0x4113('0x4'));var querystring=require(_0x4113('0x5'));var rp=require(_0x4113('0x6'));var rs=require(_0x4113('0x7'));var sox=require(_0x4113('0x8'));var tts=require(_0x4113('0x9'));var urlParse=require(_0x4113('0xa'))[_0x4113('0xb')];var util=require(_0x4113('0xc'));var aws=require(_0x4113('0xd'));var google=require(_0x4113('0xe'));var sestek=require(_0x4113('0xf'));var tilde=require(_0x4113('0x10'));var logger=require('../../../config/logger')(_0x4113('0x11'));var ISPEECH_API=_0x4113('0x12');function downloadFile(_0x5436fb,_0x2c51dd){return new BPromise(function(_0xaf4974,_0x4d9c35){var _0xcb48ed=urlParse(_0x5436fb);var _0x5671c4=_0xcb48ed['protocol']===_0x4113('0x13')?https:http;var _0x4b7369={'host':_0xcb48ed[_0x4113('0x14')],'path':_0xcb48ed[_0x4113('0x4')],'headers':{'user-agent':_0x4113('0x15')}};_0x5671c4[_0x4113('0x16')](_0x4b7369,function(_0x7fe5f1){if(_0x7fe5f1[_0x4113('0x17')]!==0xc8){logger['error']('request\x20to\x20'+_0x5436fb+_0x4113('0x18')+_0x7fe5f1[_0x4113('0x17')]+'\x20('+_0x7fe5f1[_0x4113('0x19')]+')');_0x4d9c35(new Error('request\x20to\x20'+_0x5436fb+_0x4113('0x18')+_0x7fe5f1[_0x4113('0x17')]+'\x20('+_0x7fe5f1[_0x4113('0x19')]+')'));return;}var _0x469048=fs[_0x4113('0x1a')](_0x2c51dd);_0x469048['on'](_0x4113('0x1b'),function(){logger['info'](_0x4113('0x1c'));_0x469048['close'](_0xaf4974);});_0x469048['on'](_0x4113('0x1d'),function(_0x4846e6){fs[_0x4113('0x1e')](_0x2c51dd);logger['error'](_0x4113('0x1f'),_0x4846e6);_0x4d9c35(_0x4846e6);});_0x7fe5f1[_0x4113('0x20')](_0x469048);})['on'](_0x4113('0x1d'),function(_0x2eaa35){logger['error'](_0x2eaa35);_0x4d9c35(_0x2eaa35);})[_0x4113('0x21')]();});}function uploadFile(_0x5162aa){return new BPromise(function(_0x561322,_0x43d2dc){var _0x25c069=urlParse(_0x5162aa);var _0x56d406=_0x25c069[_0x4113('0x22')]==='https:'?https:http;var _0x323e7b={'host':_0x25c069[_0x4113('0x14')],'path':_0x25c069[_0x4113('0x4')],'headers':{'user-agent':'WHAT_EVER'}};_0x56d406['get'](_0x323e7b,function(_0x10c9f8){if(_0x10c9f8[_0x4113('0x17')]!==0xc8){_0x43d2dc(new Error(_0x4113('0x23')+_0x5162aa+_0x4113('0x18')+_0x10c9f8[_0x4113('0x17')]+'\x20('+_0x10c9f8[_0x4113('0x19')]+')'));return;}var _0x32b1e4='';_0x10c9f8['on'](_0x4113('0x24'),function(_0x4d9a7c){_0x32b1e4+=_0x4d9a7c;});_0x10c9f8['on'](_0x4113('0x21'),function(){_0x561322(_0x32b1e4);});})['on'](_0x4113('0x1d'),function(_0xa9f6de){_0x43d2dc(_0xa9f6de);})[_0x4113('0x21')]();});}function convertFile(_0x50c9f4,_0x562d9f){return new BPromise(function(_0x502db1,_0x11683c){var _0x341da8=sox[_0x4113('0x25')](_0x50c9f4,_0x562d9f,{'sampleRate':0x1f40,'format':_0x4113('0x26'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x341da8['on'](_0x4113('0x1d'),function(_0x5c8e65){logger[_0x4113('0x1d')]('error\x20convert',_0x5c8e65);_0x11683c(_0x5c8e65);});_0x341da8['on'](_0x4113('0x21'),function(){logger[_0x4113('0x27')](_0x4113('0x28'));_0x502db1();});_0x341da8[_0x4113('0x29')]();});}function base64Decode(_0x52f417,_0x398fc7){var _0x11aeb8=path[_0x4113('0x2a')](__dirname,_0x4113('0x2b'),rs[_0x4113('0x2c')](0x4)+_0x4113('0x2d'));fs['writeFileSync'](_0x11aeb8,_0x52f417,'base64');return convertFile(_0x11aeb8,_0x398fc7)[_0x4113('0x2e')](function(){try{fs[_0x4113('0x1e')](_0x11aeb8);fs[_0x4113('0x2f')](_0x398fc7,'777');}catch(_0x279ef){logger[_0x4113('0x1d')](_0x279ef);}return _0x398fc7[_0x4113('0x30')]('.')[0x0];});}function base64Encode(_0x3ffd3a){var _0x231f35=fs['readFileSync'](_0x3ffd3a);return new Buffer(_0x231f35)['toString']('base64');}exports[_0x4113('0x31')]=function(_0x5dae44,_0x292ce6,_0x73302d,_0x48e3bf,_0x47375e,_0x49e187){var _0x25159a,_0x2775f4;var _0xde6ff1='https://texttospeech.googleapis.com/v1/';var _0x228fa6=_0x4113('0x32')+_0x5dae44;var _0x35f16e={};if(_0x292ce6===_0x4113('0x33')){_0x35f16e['input']={'ssml':_0x73302d};}else{_0x35f16e[_0x4113('0x34')]={'text':_0x73302d};};_0x35f16e[_0x4113('0x35')]={'languageCode':_0x48e3bf,'ssmlGender':_0x47375e};_0x35f16e[_0x4113('0x36')]={'audioEncoding':_0x4113('0x37'),'sampleRateHertz':0x1f40};var _0x468135={'url':_0xde6ff1+_0x4113('0x38')+_0x228fa6,'method':_0x4113('0x39'),'json':!![],'body':_0x35f16e};return rp(_0x468135)['then'](function(_0x5cd2fe){return new BPromise(function(_0x1b99f2,_0x3293a6){_0x25159a=path['resolve'](__dirname,'tmp',rs['generate'](0x4)+_0x4113('0x3a'));var _0x14bf3e=Buffer[_0x4113('0x3b')](_0x5cd2fe[_0x4113('0x3c')],_0x4113('0x3d'));return fs[_0x4113('0x3e')](_0x25159a,_0x14bf3e,function(_0x2178e3){_0x3293a6(_0x2178e3);},function(_0x56c736){fs[_0x4113('0x2f')](_0x25159a,_0x4113('0x3f'));_0x1b99f2(_0x56c736);});});})[_0x4113('0x2e')](function(_0x1d163a){_0x2775f4=path[_0x4113('0x2a')](__dirname,_0x4113('0x2b'),rs[_0x4113('0x2c')](0x4)+_0x4113('0x2d'));return convertFile(_0x25159a,_0x2775f4);})[_0x4113('0x2e')](function(){try{fs[_0x4113('0x1e')](_0x25159a);fs[_0x4113('0x2f')](_0x2775f4,_0x4113('0x3f'));}catch(_0x495e05){logger[_0x4113('0x1d')](_0x495e05);}logger['info']('googleCloudTTS\x20path',_0x2775f4[_0x4113('0x30')]('.')[0x0]);return _0x2775f4[_0x4113('0x30')]('.')[0x0];});};exports['googleTTS']=function(_0x5b3a32,_0x416ff6){var _0x51bb13='https://translate.google.com/_/TranslateWebserverUi/data/batchexecute';var _0x4879cc,_0xe2b216;var _0x575a05;var _0x1da5a6={'encoding':_0x4113('0x40'),'method':_0x4113('0x39'),'timeout':0x2710,'url':_0x51bb13,'headers':{'Content-Type':_0x4113('0x41')},'body':'f.req='+encodeURIComponent(JSON[_0x4113('0x42')]([[[_0x4113('0x43'),JSON[_0x4113('0x42')]([_0x5b3a32,_0x416ff6||'en',![],_0x4113('0x44')]),null,_0x4113('0x45')]]]))};return rp(_0x1da5a6)[_0x4113('0x2e')](function(_0x3808d1){try{_0x575a05=eval(_0x3808d1['slice'](0x5))[0x0][0x2];}catch(_0x55bcce){throw new Error(_0x4113('0x46')+_0x3808d1[_0x4113('0x24')]);}if(!_0x575a05){if(_0x5b3a32[_0x4113('0x47')]>0xc8){throw new Error(_0x4113('0x48'));}else{throw new Error(_0x4113('0x49')+_0x416ff6+'\x22\x20might\x20not\x20exist');}}try{_0x575a05=eval(_0x575a05)[0x0];}catch(_0x6c296c){throw new Error(_0x4113('0x46')+res['data']);}const _0x259fde=_0x575a05;_0x4879cc=path[_0x4113('0x2a')](__dirname,_0x4113('0x2b'),rs[_0x4113('0x2c')](0x4)+_0x4113('0x3a'));fs[_0x4113('0x4a')](_0x4879cc,_0x575a05,{'encoding':_0x4113('0x3d')});_0xe2b216=path['resolve'](__dirname,_0x4113('0x2b'),rs[_0x4113('0x2c')](0x4)+_0x4113('0x2d'));return convertFile(_0x4879cc,_0xe2b216);})['then'](function(){try{fs[_0x4113('0x1e')](_0x4879cc);fs[_0x4113('0x2f')](_0xe2b216,_0x4113('0x3f'));}catch(_0x4b00e2){logger['error'](_0x4b00e2);}logger['info'](_0x4113('0x4b'),_0xe2b216[_0x4113('0x30')]('.')[0x0]);return _0xe2b216['split']('.')[0x0];});};exports[_0x4113('0x4c')]=function(_0x2adb1d,_0x5bd774,_0x2d4043){return google['asr'](_0x2adb1d,_0x5bd774,_0x2d4043)['then'](function(_0x3bba02){logger[_0x4113('0x27')](_0x3bba02[_0x4113('0x4d')]);return rp(_0x3bba02);})[_0x4113('0x2e')](function(_0x2b76c6){var _0x3c8c56='';var _0x592a63=0x0;try{fs[_0x4113('0x1e')](_0x2adb1d);}catch(_0x1b99c9){logger[_0x4113('0x1d')](_0x1b99c9);}if(_0x2b76c6&&_0x2b76c6[_0x4113('0x4e')]){_0x3c8c56=_0x2b76c6[_0x4113('0x4e')][_0x4113('0x4f')](function(_0x917921){return _0x917921&&_0x917921[_0x4113('0x50')][0x0]&&_0x917921[_0x4113('0x50')][0x0][_0x4113('0x51')]?_0x917921['alternatives'][0x0]['transcript']:'';})[_0x4113('0x52')]('\x0a');_0x592a63=_0x2b76c6[_0x4113('0x4e')][_0x4113('0x4f')](function(_0x5e8802){return _0x5e8802&&_0x5e8802['alternatives'][0x0]&&_0x5e8802[_0x4113('0x50')][0x0][_0x4113('0x53')]?_0x5e8802[_0x4113('0x50')][0x0][_0x4113('0x53')]:0x0;})[_0x4113('0x52')]('\x0a');}logger[_0x4113('0x27')](_0x4113('0x54'),_0x3c8c56);logger[_0x4113('0x27')](_0x4113('0x55'),_0x592a63);return{'transcript':_0x3c8c56,'confidence':_0x592a63};})[_0x4113('0x56')](function(_0x12b82b){logger[_0x4113('0x1d')]('[%s]\x20%s:%s',_0x12b82b['statusCode'],_0x12b82b[_0x4113('0x57')],_0x12b82b[_0x4113('0x58')]);});};exports[_0x4113('0x59')]=function(_0x134c2e,_0x1ebed5,_0x50e9ad,_0x57ea9d){var _0x28b07a=apiai(_0x1ebed5,{'language':_0x57ea9d||'en'});return _0x28b07a[_0x4113('0x5a')](_0x50e9ad,{'sessionId':md5(_0x134c2e)})[_0x4113('0x2e')](function(_0x27a417){logger['info'](JSON['stringify'](_0x27a417));return{'source':_0x27a417['result']['source'],'resolvedQuery':_0x27a417[_0x4113('0x5b')][_0x4113('0x5c')],'action':_0x27a417['result'][_0x4113('0x5d')],'actionIncomplete':_0x27a417[_0x4113('0x5b')]['actionIncomplete'],'speech':_0x27a417['result']['fulfillment']['speech'],'score':_0x27a417['result'][_0x4113('0x5e')],'statusCode':_0x27a417[_0x4113('0x5f')][_0x4113('0x60')],'endConversation':_0x27a417['result'][_0x4113('0x61')][_0x4113('0x62')]||![],'isFallbackIntent':_0x27a417[_0x4113('0x5b')][_0x4113('0x61')][_0x4113('0x63')]};});};exports[_0x4113('0x64')]=function(_0x1ceb14,_0x2ba9ca,_0x53f21a,_0x124099,_0x2021cd,_0x42c8b6){var _0xff4869=_0x124099[_0x4113('0x65')](/\\n/g,'\x0a');var _0xf908fa={'credentials':{'private_key':_0xff4869,'client_email':_0x53f21a}};var _0x16220e=new dialogflow[(_0x4113('0x66'))](_0xf908fa);var _0x5c0c4f=_0x16220e[_0x4113('0x67')](_0x2ba9ca,md5(_0x1ceb14));var _0x7bda05={'session':_0x5c0c4f,'queryInput':{'text':{'text':_0x2021cd,'languageCode':_0x42c8b6}}};return _0x16220e[_0x4113('0x68')](_0x7bda05)[_0x4113('0x2e')](function(_0x277fef){if(_0x277fef&&_0x277fef[_0x4113('0x47')]){logger[_0x4113('0x27')](_0x4113('0x69'),JSON['stringify'](_0x277fef));var _0x41fd14=_0x277fef[0x0];if(_0x41fd14){var _0x46e50d={'action':_0x41fd14[_0x4113('0x6a')][_0x4113('0x5d')],'allRequiredParamsPresent':_0x41fd14[_0x4113('0x6a')][_0x4113('0x6b')],'endConversation':_0x41fd14[_0x4113('0x6a')]['diagnosticInfo']&&_0x41fd14[_0x4113('0x6a')][_0x4113('0x6c')][_0x4113('0x6d')]?_0x41fd14['queryResult'][_0x4113('0x6c')]['fields'][_0x4113('0x6e')][_0x4113('0x6f')]:![],'fulfillmentText':_0x41fd14['queryResult'][_0x4113('0x70')],'intentName':_0x41fd14['queryResult'][_0x4113('0x71')]['name'],'intentDisplayName':_0x41fd14['queryResult']['intent'][_0x4113('0x72')],'isFallbackIntent':_0x41fd14[_0x4113('0x6a')][_0x4113('0x71')][_0x4113('0x73')],'languageCode':_0x41fd14['queryResult'][_0x4113('0x74')],'queryText':_0x41fd14['queryResult'][_0x4113('0x75')],'responseId':_0x41fd14[_0x4113('0x76')],'score':_0x41fd14[_0x4113('0x6a')]['intentDetectionConfidence'],'speech':_0x41fd14['queryResult']['fulfillmentText'],'providerResponse':JSON[_0x4113('0x42')](_0x277fef)};return _0x46e50d;}}});};exports[_0x4113('0x77')]=function(_0x388dfa,_0xd83739,_0x216035,_0x39c082){return tilde[_0x4113('0x78')](_0x388dfa,_0xd83739,_0x216035,_0x39c082)[_0x4113('0x2e')](function(_0x292a92){try{fs['unlink'](_0x388dfa);}catch(_0x4dc7fd){logger[_0x4113('0x1d')](_0x4dc7fd);}logger[_0x4113('0x27')]('Tilde\x20ASR\x20transcription',_0x292a92['transcript']);logger['info'](_0x4113('0x79'),_0x292a92[_0x4113('0x53')]);return _0x292a92;});};exports[_0x4113('0x7a')]=function(_0x4065cb,_0x1007ef,_0x5eb007,_0x216afd,_0x31a3c4,_0xec4c40){var _0x5f4a4a=path[_0x4113('0x2a')](__dirname,_0x4113('0x2b'),rs[_0x4113('0x2c')](0x4)+'.mp3');var _0x223f8b;return aws[_0x4113('0x7b')](_0x4065cb,_0x1007ef,_0x5eb007,_0x216afd,_0x31a3c4,_0xec4c40,_0x5f4a4a)['then'](function(){_0x223f8b=path['resolve'](__dirname,_0x4113('0x2b'),rs[_0x4113('0x2c')](0x4)+'.wav');return convertFile(_0x5f4a4a,_0x223f8b);})['then'](function(){try{fs[_0x4113('0x1e')](_0x5f4a4a);fs[_0x4113('0x2f')](_0x223f8b,'777');}catch(_0x5b6ada){logger[_0x4113('0x1d')](_0x5b6ada);}return _0x223f8b[_0x4113('0x30')]('.')[0x0];});};exports['awsLex']=function(_0x429ffa,_0x5dcf66,_0x3cf3b5,_0x5caef1,_0x263ac0,_0x4dd74a){return aws[_0x4113('0x7c')](_0x429ffa,_0x5dcf66,_0x3cf3b5,_0x5caef1,_0x263ac0,_0x4dd74a)['then'](function(_0x471a51){logger[_0x4113('0x27')](JSON[_0x4113('0x42')](_0x471a51));return _0x471a51;});};exports[_0x4113('0x7d')]=function(_0x274ec4,_0x30b089,_0x51a513,_0x534f86){var _0x393cd3=util[_0x4113('0x7e')](_0x4113('0x7f'),ISPEECH_API,_0x274ec4,encodeURIComponent(_0x30b089),_0x51a513,_0x534f86);var _0x46adaf=path['resolve'](__dirname,_0x4113('0x2b'),rs['generate'](0x4)+_0x4113('0x3a'));var _0x238172;return downloadFile(_0x393cd3,_0x46adaf)[_0x4113('0x2e')](function(){_0x238172=path[_0x4113('0x2a')](__dirname,'tmp',rs['generate'](0x4)+_0x4113('0x2d'));return convertFile(_0x46adaf,_0x238172);})[_0x4113('0x2e')](function(){try{fs[_0x4113('0x1e')](_0x46adaf);fs[_0x4113('0x2f')](_0x238172,_0x4113('0x3f'));}catch(_0x3108b3){logger['error'](_0x3108b3);}return _0x238172[_0x4113('0x30')]('.')[0x0];});};exports[_0x4113('0x80')]=function(_0x3bcf1f,_0x3a37ff,_0x4bae57,_0x398b7c){var _0x89f96b=util[_0x4113('0x7e')]('%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s',ISPEECH_API,_0x3a37ff,_0x4bae57,base64Encode(_0x3bcf1f),_0x398b7c?util[_0x4113('0x7e')]('model=%s',encodeURIComponent(_0x398b7c)):_0x4113('0x81'));return uploadFile(_0x89f96b)[_0x4113('0x2e')](function(_0x20f9ea){return querystring['parse'](_0x20f9ea);});};exports[_0x4113('0x82')]=function(_0x120c98,_0x1ed1a8){return sestek['nda'](_0x120c98,_0x1ed1a8)[_0x4113('0x2e')](function(_0xeefeb){logger[_0x4113('0x27')](JSON[_0x4113('0x42')](_0xeefeb));var _0x37b644={'speech':_0xeefeb[_0x4113('0x83')],'action':_0xeefeb['channelData']?_0xeefeb[_0x4113('0x84')][_0x4113('0x85')]:undefined,'actiondata':_0xeefeb['channelData']?_0xeefeb['channelData']['CustomActionData']:undefined};if(_0xeefeb[_0x4113('0x84')]&&_0xeefeb[_0x4113('0x84')][_0x4113('0x86')]){return base64Decode(_0xeefeb['channelData'][_0x4113('0x86')][_0x4113('0x87')],path[_0x4113('0x2a')](__dirname,'tmp',rs[_0x4113('0x2c')](0x4)+_0x4113('0x2d')))[_0x4113('0x2e')](function(_0x598851){_0x37b644[_0x4113('0x88')]=_0x598851;return _0x37b644;});}return _0x37b644;});};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 8f34e03..0b7a17f 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 nda=require('./nda');module['exports']={'nda':nda}; \ No newline at end of file +var _0x7f29=['exports','./nda'];(function(_0x52ff09,_0xdb5c7f){var _0xcaddb2=function(_0x29038e){while(--_0x29038e){_0x52ff09['push'](_0x52ff09['shift']());}};_0xcaddb2(++_0xdb5c7f);}(_0x7f29,0x181));var _0x97f2=function(_0x3bf0df,_0x280ac3){_0x3bf0df=_0x3bf0df-0x0;var _0x32461f=_0x7f29[_0x3bf0df];return _0x32461f;};var nda=require(_0x97f2('0x0'));module[_0x97f2('0x1')]={'nda':nda}; \ No newline at end of file diff --git a/server/services/agi/scripts/sestek/nda/index.js b/server/services/agi/scripts/sestek/nda/index.js index 1970c92..9745787 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 _0x153f=['AudioOutputSettings','audio/wav','custom_action','CustomAction','custom_action_data','info','stringify','request-promise','url','../../../../../config/logger','agi','exports','POST','ndauth_url','/token','password','username','resolve','ndassistant_url','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','message','Nda','uniqueid','calleridname','dnid','extension','Bearer\x20','access_token','project','body','channelData','ProjectName','ndagenerate_audio'];(function(_0x3fe759,_0x12832b){var _0x4b0ed1=function(_0x35d973){while(--_0x35d973){_0x3fe759['push'](_0x3fe759['shift']());}};_0x4b0ed1(++_0x12832b);}(_0x153f,0x15b));var _0xf153=function(_0x13e02e,_0x32a524){_0x13e02e=_0x13e02e-0x0;var _0xa8666d=_0x153f[_0x13e02e];return _0xa8666d;};'use strict';var rp=require(_0xf153('0x0'));var url=require(_0xf153('0x1'));var logger=require(_0xf153('0x2'))(_0xf153('0x3'));module[_0xf153('0x4')]=function(_0x1ccc1c,_0x3b85fc){var _0x59757c={'method':_0xf153('0x5'),'uri':url['resolve'](_0x3b85fc[_0xf153('0x6')],_0xf153('0x7')),'form':{'grant_type':_0xf153('0x8'),'username':_0x3b85fc[_0xf153('0x9')],'password':_0x3b85fc[_0xf153('0x8')]},'json':!![]};return rp(_0x59757c)['then'](function(_0x17ba96){var _0x143497={'method':_0xf153('0x5'),'uri':url[_0xf153('0xa')](_0x3b85fc[_0xf153('0xb')],_0xf153('0xc')),'body':{'type':_0x3b85fc[_0xf153('0xd')]||_0xf153('0xe'),'channelId':_0xf153('0xf'),'conversation':{'id':_0x1ccc1c[_0xf153('0x10')]},'from':{'id':_0x1ccc1c['callerid'],'name':_0x1ccc1c[_0xf153('0x11')]},'recipient':{'id':_0x1ccc1c[_0xf153('0x12')],'name':_0x1ccc1c[_0xf153('0x13')]},'text':_0x3b85fc['text'],'channelData':{}},'headers':{'Authorization':_0xf153('0x14')+_0x17ba96[_0xf153('0x15')]},'json':!![]};if(_0x3b85fc[_0xf153('0x16')]){_0x143497[_0xf153('0x17')][_0xf153('0x18')][_0xf153('0x19')]=_0x3b85fc[_0xf153('0x16')];}if(_0x3b85fc[_0xf153('0x1a')]=='1'){_0x143497[_0xf153('0x17')]['channelData'][_0xf153('0x1b')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0xf153('0x1c')};}if(_0x3b85fc[_0xf153('0x1d')]){_0x143497[_0xf153('0x17')][_0xf153('0x18')][_0xf153('0x1e')]=_0x3b85fc[_0xf153('0x1d')];if(_0x3b85fc[_0xf153('0x1f')]){_0x143497['body'][_0xf153('0x18')]['CustomActionData']=_0x3b85fc[_0xf153('0x1f')];}}logger[_0xf153('0x20')](JSON[_0xf153('0x21')](_0x143497));return rp(_0x143497);});}; \ No newline at end of file +var _0xd3b4=['password','username','then','resolve','/api/NaturalDialogAssistant/v1/Run','message','uniqueid','callerid','calleridname','dnid','extension','text','Bearer\x20','access_token','project','body','channelData','ProjectName','ndagenerate_audio','AudioOutputSettings','audio/wav','custom_action','CustomAction','CustomActionData','custom_action_data','info','stringify','request-promise','agi','exports','POST','ndauth_url','/token'];(function(_0x58587e,_0x4117f4){var _0x1d0209=function(_0xfa45ff){while(--_0xfa45ff){_0x58587e['push'](_0x58587e['shift']());}};_0x1d0209(++_0x4117f4);}(_0xd3b4,0x1e9));var _0x4d3b=function(_0x3c26f6,_0x43887f){_0x3c26f6=_0x3c26f6-0x0;var _0x3dbceb=_0xd3b4[_0x3c26f6];return _0x3dbceb;};'use strict';var rp=require(_0x4d3b('0x0'));var url=require('url');var logger=require('../../../../../config/logger')(_0x4d3b('0x1'));module[_0x4d3b('0x2')]=function(_0x2179fc,_0x17b005){var _0x4b4133={'method':_0x4d3b('0x3'),'uri':url['resolve'](_0x17b005[_0x4d3b('0x4')],_0x4d3b('0x5')),'form':{'grant_type':_0x4d3b('0x6'),'username':_0x17b005[_0x4d3b('0x7')],'password':_0x17b005[_0x4d3b('0x6')]},'json':!![]};return rp(_0x4b4133)[_0x4d3b('0x8')](function(_0x331043){var _0x7b17b9={'method':_0x4d3b('0x3'),'uri':url[_0x4d3b('0x9')](_0x17b005['ndassistant_url'],_0x4d3b('0xa')),'body':{'type':_0x17b005['ndaactivity_type']||_0x4d3b('0xb'),'channelId':'Nda','conversation':{'id':_0x2179fc[_0x4d3b('0xc')]},'from':{'id':_0x2179fc[_0x4d3b('0xd')],'name':_0x2179fc[_0x4d3b('0xe')]},'recipient':{'id':_0x2179fc[_0x4d3b('0xf')],'name':_0x2179fc[_0x4d3b('0x10')]},'text':_0x17b005[_0x4d3b('0x11')],'channelData':{}},'headers':{'Authorization':_0x4d3b('0x12')+_0x331043[_0x4d3b('0x13')]},'json':!![]};if(_0x17b005[_0x4d3b('0x14')]){_0x7b17b9[_0x4d3b('0x15')][_0x4d3b('0x16')][_0x4d3b('0x17')]=_0x17b005['project'];}if(_0x17b005[_0x4d3b('0x18')]=='1'){_0x7b17b9[_0x4d3b('0x15')][_0x4d3b('0x16')][_0x4d3b('0x19')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0x4d3b('0x1a')};}if(_0x17b005[_0x4d3b('0x1b')]){_0x7b17b9[_0x4d3b('0x15')][_0x4d3b('0x16')][_0x4d3b('0x1c')]=_0x17b005[_0x4d3b('0x1b')];if(_0x17b005['custom_action_data']){_0x7b17b9[_0x4d3b('0x15')]['channelData'][_0x4d3b('0x1d')]=_0x17b005[_0x4d3b('0x1e')];}}logger[_0x4d3b('0x1f')](JSON[_0x4d3b('0x20')](_0x7b17b9));return rp(_0x7b17b9);});}; \ 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 eaca4c5..df50592 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 _0x72db=['./lib/api'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x72db,0x77));var _0xb72d=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x72db[_0x14add3];return _0x4a174f;};'use strict';var asr=require(_0xb72d('0x0'));module['exports']=function(_0x56e91c,_0x7deb26,_0x256119,_0x59fa40){return asr(_0x56e91c,_0x7deb26,_0x256119,_0x59fa40);}; \ No newline at end of file +var _0x7c1f=['exports'];(function(_0x91cc04,_0x48e6a6){var _0x26b085=function(_0x2720bf){while(--_0x2720bf){_0x91cc04['push'](_0x91cc04['shift']());}};_0x26b085(++_0x48e6a6);}(_0x7c1f,0x1eb));var _0xf7c1=function(_0xefd773,_0x31cb51){_0xefd773=_0xefd773-0x0;var _0xa356d3=_0x7c1f[_0xefd773];return _0xa356d3;};'use strict';var asr=require('./lib/api');module[_0xf7c1('0x0')]=function(_0x2eb8e0,_0x5dd6c9,_0x3bb62e,_0x455685){return asr(_0x2eb8e0,_0x5dd6c9,_0x3bb62e,_0x455685);}; \ 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 00f1748..88690a9 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 _0x4f15=['bluebird','moment','crypto','../../../../../../config/logger','exports','info','Tilde\x20URI','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','createHash','sha1','update','digest','Open\x20Tilde\x20ASR\x20socket','unix','send','stringify','createReadStream','close','error','Tilde\x20ASR\x20send\x20error','parse','result','Tilde\x20ASR\x20hypoteses','hypotheses','transcript','likelihood','Success.','terminate','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','Tilde\x20ASR\x20parse\x20error','Close\x20Tilde\x20ASR\x20socket','Error\x20Tilde\x20ASR\x20socket','isObject','message'];(function(_0x589b06,_0x1332e7){var _0x24fa35=function(_0x3391da){while(--_0x3391da){_0x589b06['push'](_0x589b06['shift']());}};_0x24fa35(++_0x1332e7);}(_0x4f15,0x1c8));var _0x54f1=function(_0x55d55c,_0x3d1b6b){_0x55d55c=_0x55d55c-0x0;var _0x57ed39=_0x4f15[_0x55d55c];return _0x57ed39;};'use strict';var BPromise=require(_0x54f1('0x0'));var _=require('lodash');var fs=require('fs');var WebSocket=require('ws');var moment=require(_0x54f1('0x1'));var crypto=require(_0x54f1('0x2'));var logger=require(_0x54f1('0x3'))('agi');module[_0x54f1('0x4')]=function(_0x3e7931,_0x5762b2,_0x45b044,_0x19b126){return new BPromise(function(_0x3fc4bb,_0x1ce7a6){logger[_0x54f1('0x5')](_0x54f1('0x6'),_0x19b126||_0x54f1('0x7'));var _0xee64e1=new WebSocket(_0x19b126||_0x54f1('0x7'),{'perMessageDeflate':![]});var _0x5dd758='';var _0x29b7fe='0';var _0x200e6d='1';var _0x148dd1=_0x54f1('0x8');function _0x17ff92(_0x592cf3){var _0x261dd9=crypto[_0x54f1('0x9')](_0x54f1('0xa'));_0x261dd9[_0x54f1('0xb')](_0x592cf3);return _0x261dd9[_0x54f1('0xc')]('hex');}function _0x3040cd(){try{logger[_0x54f1('0x5')](_0x54f1('0xd'));var _0x5d4cbb=moment()[_0x54f1('0xe')]();var _0x55dc10=_0x17ff92(_0x5d4cbb+_0x5762b2+_0x45b044);_0xee64e1[_0x54f1('0xf')](JSON[_0x54f1('0x10')]({'appID':_0x5762b2,'timestamp':_0x5d4cbb,'appKey':_0x55dc10}));var _0xcb4f49=fs[_0x54f1('0x11')](_0x3e7931);_0xcb4f49['on']('data',function(_0x254ee1){_0xee64e1['send'](_0x254ee1);});_0xcb4f49['on'](_0x54f1('0x12'),function(){_0xee64e1[_0x54f1('0xf')]('EOS');});}catch(_0x398bbb){logger[_0x54f1('0x13')](_0x54f1('0x14'),JSON[_0x54f1('0x10')](_0x398bbb));_0xee64e1['terminate']();}}function _0x15224e(_0x2cedff){try{if(_0x2cedff){var _0x412b9b=JSON[_0x54f1('0x15')](_0x2cedff);switch(_0x412b9b['status']){case 0x0:if(_0x412b9b[_0x54f1('0x16')]){if(_0x412b9b[_0x54f1('0x16')]['final']){logger['info'](_0x54f1('0x17'),JSON[_0x54f1('0x10')](_0x412b9b['result']['hypotheses']));_0x5dd758=_0x412b9b[_0x54f1('0x16')][_0x54f1('0x18')][0x0][_0x54f1('0x19')];_0x29b7fe=_0x412b9b['result'][_0x54f1('0x18')][0x0][_0x54f1('0x1a')];_0x200e6d='0';_0x148dd1=_0x54f1('0x1b');_0xee64e1[_0x54f1('0x1c')]();}}break;case 0x1:logger[_0x54f1('0x5')]('No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech');_0x200e6d='1';_0x148dd1=_0x54f1('0x8');break;case 0x2:logger['info'](_0x54f1('0x1d'));_0x200e6d='2';_0x148dd1=_0x54f1('0x1d');break;case 0x9:logger[_0x54f1('0x5')]('Not\x20available.\x20Max\x20load\x20limit\x20reached.');_0x200e6d='9';_0x148dd1=_0x54f1('0x1e');break;case 0xa:logger[_0x54f1('0x5')](_0x54f1('0x1f'));_0x200e6d='10';_0x148dd1=_0x54f1('0x1f');break;case 0xb:logger[_0x54f1('0x5')]('All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.');_0x200e6d='11';_0x148dd1=_0x54f1('0x20');}}}catch(_0x5715e5){logger[_0x54f1('0x13')](_0x54f1('0x21'),JSON['stringify'](_0x5715e5));_0xee64e1['terminate']();}}function _0x7e045b(){logger[_0x54f1('0x5')](_0x54f1('0x22'));_0x3fc4bb({'transcript':_0x5dd758,'confidence':_0x29b7fe,'status':_0x200e6d,'status_message':_0x148dd1});}function _0x52cd51(_0x20aa5d){logger[_0x54f1('0x13')](_0x54f1('0x23'));if(!_['isNil'](_0x20aa5d)){logger[_0x54f1('0x13')](_[_0x54f1('0x24')](_0x20aa5d)?JSON['stringify'](_0x20aa5d):_0x20aa5d);}}_0xee64e1['on']('open',_0x3040cd);_0xee64e1['on'](_0x54f1('0x25'),_0x15224e);_0xee64e1['on'](_0x54f1('0x12'),_0x7e045b);_0xee64e1['on'](_0x54f1('0x13'),_0x52cd51);});}; \ No newline at end of file +var _0x1a06=['No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','Tilde\x20ASR\x20parse\x20error','isNil','isObject','open','message','close','bluebird','lodash','moment','agi','exports','Tilde\x20URI','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','createHash','update','digest','info','Open\x20Tilde\x20ASR\x20socket','send','stringify','createReadStream','data','error','terminate','status','result','final','Tilde\x20ASR\x20hypoteses','hypotheses','transcript'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1a06,0x92));var _0x61a0=function(_0x26d6d3,_0x294128){_0x26d6d3=_0x26d6d3-0x0;var _0x44cc7a=_0x1a06[_0x26d6d3];return _0x44cc7a;};'use strict';var BPromise=require(_0x61a0('0x0'));var _=require(_0x61a0('0x1'));var fs=require('fs');var WebSocket=require('ws');var moment=require(_0x61a0('0x2'));var crypto=require('crypto');var logger=require('../../../../../../config/logger')(_0x61a0('0x3'));module[_0x61a0('0x4')]=function(_0x586865,_0x241d18,_0x56c14a,_0xff129){return new BPromise(function(_0xf6182b,_0x3d7e39){logger['info'](_0x61a0('0x5'),_0xff129||_0x61a0('0x6'));var _0x11099a=new WebSocket(_0xff129||_0x61a0('0x6'),{'perMessageDeflate':![]});var _0x360bc1='';var _0x52b485='0';var _0x595850='1';var _0xbb3a81='No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech';function _0x2983a8(_0x9db71){var _0x1ebb22=crypto[_0x61a0('0x7')]('sha1');_0x1ebb22[_0x61a0('0x8')](_0x9db71);return _0x1ebb22[_0x61a0('0x9')]('hex');}function _0xfd2bc4(){try{logger[_0x61a0('0xa')](_0x61a0('0xb'));var _0x208ed2=moment()['unix']();var _0x15cb49=_0x2983a8(_0x208ed2+_0x241d18+_0x56c14a);_0x11099a[_0x61a0('0xc')](JSON[_0x61a0('0xd')]({'appID':_0x241d18,'timestamp':_0x208ed2,'appKey':_0x15cb49}));var _0xe4c788=fs[_0x61a0('0xe')](_0x586865);_0xe4c788['on'](_0x61a0('0xf'),function(_0x512fa5){_0x11099a[_0x61a0('0xc')](_0x512fa5);});_0xe4c788['on']('close',function(){_0x11099a['send']('EOS');});}catch(_0x3545e8){logger[_0x61a0('0x10')]('Tilde\x20ASR\x20send\x20error',JSON['stringify'](_0x3545e8));_0x11099a[_0x61a0('0x11')]();}}function _0x306868(_0x50f405){try{if(_0x50f405){var _0x1e1b00=JSON['parse'](_0x50f405);switch(_0x1e1b00[_0x61a0('0x12')]){case 0x0:if(_0x1e1b00[_0x61a0('0x13')]){if(_0x1e1b00[_0x61a0('0x13')][_0x61a0('0x14')]){logger[_0x61a0('0xa')](_0x61a0('0x15'),JSON['stringify'](_0x1e1b00[_0x61a0('0x13')][_0x61a0('0x16')]));_0x360bc1=_0x1e1b00[_0x61a0('0x13')][_0x61a0('0x16')][0x0][_0x61a0('0x17')];_0x52b485=_0x1e1b00[_0x61a0('0x13')][_0x61a0('0x16')][0x0]['likelihood'];_0x595850='0';_0xbb3a81='Success.';_0x11099a['terminate']();}}break;case 0x1:logger[_0x61a0('0xa')](_0x61a0('0x18'));_0x595850='1';_0xbb3a81=_0x61a0('0x18');break;case 0x2:logger['info'](_0x61a0('0x19'));_0x595850='2';_0xbb3a81='Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.';break;case 0x9:logger['info']('Not\x20available.\x20Max\x20load\x20limit\x20reached.');_0x595850='9';_0xbb3a81='Not\x20available.\x20Max\x20load\x20limit\x20reached.';break;case 0xa:logger[_0x61a0('0xa')](_0x61a0('0x1a'));_0x595850='10';_0xbb3a81=_0x61a0('0x1a');break;case 0xb:logger[_0x61a0('0xa')](_0x61a0('0x1b'));_0x595850='11';_0xbb3a81=_0x61a0('0x1b');}}}catch(_0x1ef616){logger[_0x61a0('0x10')](_0x61a0('0x1c'),JSON['stringify'](_0x1ef616));_0x11099a[_0x61a0('0x11')]();}}function _0x10827c(){logger[_0x61a0('0xa')]('Close\x20Tilde\x20ASR\x20socket');_0xf6182b({'transcript':_0x360bc1,'confidence':_0x52b485,'status':_0x595850,'status_message':_0xbb3a81});}function _0x4c489f(_0x1b9c53){logger[_0x61a0('0x10')]('Error\x20Tilde\x20ASR\x20socket');if(!_[_0x61a0('0x1d')](_0x1b9c53)){logger['error'](_[_0x61a0('0x1e')](_0x1b9c53)?JSON['stringify'](_0x1b9c53):_0x1b9c53);}}_0x11099a['on'](_0x61a0('0x1f'),_0xfd2bc4);_0x11099a['on'](_0x61a0('0x20'),_0x306868);_0x11099a['on'](_0x61a0('0x21'),_0x10827c);_0x11099a['on'](_0x61a0('0x10'),_0x4c489f);});}; \ 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 f05c03c..5dad161 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 _0x9a32=['exports','./asr'];(function(_0x40042d,_0x3ce810){var _0x3889a1=function(_0x2fdcbb){while(--_0x2fdcbb){_0x40042d['push'](_0x40042d['shift']());}};_0x3889a1(++_0x3ce810);}(_0x9a32,0x83));var _0x29a3=function(_0x5d5a5e,_0x3e6054){_0x5d5a5e=_0x5d5a5e-0x0;var _0x35a912=_0x9a32[_0x5d5a5e];return _0x35a912;};var asr=require(_0x29a3('0x0'));module[_0x29a3('0x1')]={'asr':asr}; \ No newline at end of file +var _0x987a=['exports','./asr'];(function(_0x6131cd,_0x4c26a1){var _0x47e916=function(_0x1f2bce){while(--_0x1f2bce){_0x6131cd['push'](_0x6131cd['shift']());}};_0x47e916(++_0x4c26a1);}(_0x987a,0x89));var _0xa987=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x987a[_0x1ac595];return _0x455fff;};var asr=require(_0xa987('0x0'));module[_0xa987('0x1')]={'asr':asr}; \ No newline at end of file diff --git a/server/services/agi/server.js b/server/services/agi/server.js index b85c784..e74c1c2 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 _0x9c44=['./error','./channel','127.0.0.1','call','emit','error','createServer','listen','listening','getConnections','destroy','E_AGI_SERVER_MAXCONNECTION','ready','connection','E_AGI_SERVER_ERROR','code','close','E_AGI_SERVER_CLOSE','nextTick','events','EventEmitter'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9c44,0x178));var _0x49c4=function(_0x50a0c2,_0x4befab){_0x50a0c2=_0x50a0c2-0x0;var _0x5ebadd=_0x9c44[_0x50a0c2];return _0x5ebadd;};'use strict';var util=require('util');var net=require('net');var EventEmitter=require(_0x49c4('0x0'))[_0x49c4('0x1')];var AGIError=require(_0x49c4('0x2'));var AGIChannel=require(_0x49c4('0x3'));var AGIServer=function(_0x455700,_0x2ad237,_0x4e0313){var _0x4941f1=this;var _0x41a183=null;var _0x57effd=0x0;if(!_0x455700)_0x455700=0x11dd;if(!_0x2ad237)_0x2ad237=_0x49c4('0x4');EventEmitter[_0x49c4('0x5')](_0x4941f1);function _0x69bc41(){if(!_0x455700){_0x4941f1[_0x49c4('0x6')](_0x49c4('0x7'),new AGIError('E_AGI_ARGUMENT_PORT'));return![];}_0x41a183=net[_0x49c4('0x8')]();_0x41a183[_0x49c4('0x9')](_0x455700,_0x2ad237);_0x41a183['on'](_0x49c4('0xa'),function(){_0x4941f1[_0x49c4('0x6')]('listening');});_0x41a183['on']('connection',function(_0x451ea6){_0x41a183[_0x49c4('0xb')](function(_0x58cad7,_0xb611a1){if(_0x58cad7){_0x4941f1[_0x49c4('0x6')]('error',new AGIError('E_AGI_SERVER_ERROR',_0x58cad7));}else if(_0x4e0313&&_0x4e0313<0x0){_0x4941f1[_0x49c4('0x6')](_0x49c4('0x7'),new AGIError('E_AGI_SERVER_VOICE_DISABLED'));_0x451ea6[_0x49c4('0xc')]();}else if(_0x4e0313&&_0x4e0313>0x0&&_0x4e0313<_0xb611a1){_0x57effd+=0x1;_0x4941f1[_0x49c4('0x6')]('error',new AGIError(_0x49c4('0xd'),_0x57effd));_0x451ea6[_0x49c4('0xc')]();}else{var _0x21f15a=new AGIChannel(_0x451ea6);_0x21f15a['on'](_0x49c4('0xe'),function(){_0x4941f1[_0x49c4('0x6')](_0x49c4('0xf'),_0x21f15a);});}});});_0x41a183['on'](_0x49c4('0x7'),function(_0x3de397){_0x4941f1['emit'](_0x49c4('0x7'),new AGIError(_0x49c4('0x10'),_0x3de397[_0x49c4('0x11')]));});_0x41a183['on'](_0x49c4('0x12'),function(){_0x4941f1[_0x49c4('0x6')]('close',new AGIError(_0x49c4('0x13')));});}process[_0x49c4('0x14')](function(){_0x69bc41();});};util['inherits'](AGIServer,EventEmitter);module['exports']=function(_0x3c782d,_0x2f82d5,_0x3addb2){return new AGIServer(_0x3c782d,_0x2f82d5,_0x3addb2);}; \ No newline at end of file +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(_0x5608a3,_0x5b33c5){var _0x1ed50a=function(_0x959171){while(--_0x959171){_0x5608a3['push'](_0x5608a3['shift']());}};_0x1ed50a(++_0x5b33c5);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4bfac3,_0x58324d){_0x4bfac3=_0x4bfac3-0x0;var _0x15f0f2=_0xa9e0[_0x4bfac3];return _0x15f0f2;};'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 e9d3487..653c0b0 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 _0xe5d5=['PUT','toUpperCase','body','parse','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','sync','uri','headers','render','stringify','statusCode','message','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','key','googleDialogflowV2','dialogflowV2_project_id','private_key','sestekNDA','ispeechTTS','ispeech_tts_language','speed','ispeechASR','ispeech_asr_language','isConfigured','model','awsPolly','aws_access_key_id','aws_secret_access_key','aws_polly_region','aws_polly_voice','Amy','aws_text_type','awsLex','aws_lex_region','aws_bot_name','googleASR','tildeASR','clear','agicommand','hasOwnProperty','isString','replaceObjectAllVariables','replaceAllVariables','recursiveNodeIndex','isPlainObject','isArray','length','%s.%s','saveRestApiResult','setVariable','split','replaceAll','result','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','extra','retry','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','no\x20text\x20configured','MRCPSynth','noop','Executed\x20command\x20MRCPSynth\x20%s','mrcprecog','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','no\x20grammar\x20configured','grammar','RECOG_CONFIDENCE()','MRCP_RECOG_CONFIDENCE','getAndSetVariable','RECOG_INPUT()','MRCP_RECOG_TRANSCRIPT','MRCP_RECOG_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','Enter\x20in\x20AGI\x20(%s)\x20block','answer','Enter\x20in\x20ANSWER\x20(%s)\x20block','Enter\x20in\x20CALLBACK\x20(%s)\x20block','no\x20list\x20selected','delay','scheduledAt','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','Executed\x20command\x20%s\x20%s','lumenvoxtts','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','sestektts','lumenvoxasr','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','LUMENVOX_ASR_CONFIDENCE','LUMENVOX_ASR_TRANSCRIPT','RECOG_INSTANCE()','LUMENVOX_ASR_INSTANCE','sestekasr','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','SESTEK_ASR_TRANSCRIPT','Enter\x20in\x20DATABASE\x20(%s)\x20block','no\x20database\x20selected','getSquareOdbc','no\x20odbc\x20database\x20found','no\x20query\x20configured','query:\x20%s','getQueryOdbc','variable_id','no\x20variable\x20selected\x20for\x20the\x20result','no\x20variable\x20found','forEach','keys','%s[%s][%s]','dial','debug','sip_id','no\x20user\x20selected','no\x20user\x20found','DIAL','SIP/%s','opts','Executed\x20command\x20%s','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','no\x20key\x20configured','bot','Trying\x20Dialogflow:\x20%s','DIALOGFLOW_%s','speech','out','dialogflow','Dialogflow\x20Result\x20%s','Dialogflow\x20is\x20unreachable','no\x20project_id\x20configured','client_email','no\x20private_key\x20configured','dialogflowV2_language','no\x20anguage\x20configured','Trying\x20DialogflowV2:\x20%s','providerResponse','dialogflowV2','DialogflowV2\x20Result\x20%s','sesteknda','no\x20ndauth\x20url\x20configured','username','no\x20username\x20configured','ndassistant_url','Trying\x20SestekNDA:\x20%s','SESTEK_NDA_%s','audiofile','unlink','.wav','SestekNDA\x20Result\x20%s','SestekNDA\x20is\x20unreachable','Enter\x20in\x20END\x20(%s)\x20block','end','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','no\x20trunk\x20found','trunk_name','Enter\x20in\x20FINALLY\x20(%s)\x20block','finally','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','maxRetry','file_id','no\x20file\x20audio\x20selected','no\x20file\x20audio\x20found','response','maxdigit','test','mindigit','hiddendigitsnum','generate','hiddendigitspos','substr','goal','Enter\x20in\x20GOAL\x20(%s)\x20block','goalname','awspolly','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','no\x20valid\x20credentials\x20configured','aws\x20Polly\x20%s\x20file\x20created','streamFile','aws\x20Polly\x20is\x20unreachable','awslex','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','Trying\x20Amazon\x20Lex:\x20%s','Amazon\x20Lex\x20ready\x20for\x20fulfillment','amazonlex','Amazon\x20Lex\x20Result\x20%s','Amazon\x20Lex\x20is\x20unreachable','googleasr','wav','%s/recordings/%s','beep','recordFile','intKey','google\x20%s\x20file\x20created','GOOGLE_ASR_%s','GoogleASR\x20Result\x20%s','tildeasr','Enter\x20in\x20TILDEASR\x20(%s)\x20block','appid','no\x20appid\x20configured','no\x20appsecret\x20configured','NOBEEP','TILDE_ASR_%s','TildeASR\x20Result\x20%s','gotoc','continueAt','gotoif','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','false','EVAL\x20CONDITION\x20%s\x20%s','gotoiftime','interval_id','no\x20interval\x20configured','no\x20intervals\x20found','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','true','hangup','Enter\x20in\x20HANGUP\x20(%s)\x20block','ispeechasr','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','ispeech\x20%s\x20file\x20created','ISPEECH_ASR_%s','ispeech\x20TTS\x20is\x20unreachable','Enter\x20in\x20LOGIN\x20(%s)\x20block','findBy','no\x20find\x20by\x20configured','FIND\x20AGENT\x20%s\x20BY\x20%s','AGENT\x20%s\x20FOUND\x20BY','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','logout','Enter\x20in\x20LOGOUT\x20(%s)\x20block','math','Enter\x20in\x20MATH\x20(%s)\x20block','no\x20operation\x20configured','operation','%s[%s]','variable\x20%s[key]\x20set','Enter\x20in\x20MENU\x20(%s)\x20block','getData','digit','Enter\x20in\x20NOOP\x20(%s)\x20block','output','pause','Enter\x20in\x20PAUSE\x20(%s)\x20block','pause_id','playback','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','PLAYBACK','queue','Enter\x20in\x20QUEUE\x20(%s)\x20block','no\x20queue\x20selected','queue_id','getVoiceQueue','no\x20queue\x20found','indexOf','XMCS-QUEUE','toLowerCase','QUEUE','macro','position','record','%s/recordings/%s.%s','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','200','%s_STATUS_MESSAGE','statusMessage','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','variable\x20%s\x20set','saydigits','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','digits','saynumber','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayNumber','sayphonetic','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sayPhonetic','sendMail','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','account_id','no\x20mail\x20account\x20configured','Smtp','no\x20mail\x20account\x20found','email','user','subject','template_id','Trying\x20SendMail\x20with\x20account\x20%s','smtpOptions','sendSMS','Enter\x20in\x20SENDSMS\x20(%s)\x20block','no\x20sms\x20account\x20configured','no\x20sms\x20account\x20found','sms_text','sms_account_id','Trying\x20SendSMS\x20with\x20account\x20%s','Sms\x20message\x20added\x20to\x20outgoing\x20process','set','Enter\x20in\x20SET\x20(%s)\x20block','variable_value','Enter\x20in\x20START\x20(%s)\x20block','yes','Skipped\x20Answer','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','project_id','no\x20subproject\x20found\x20with\x20id\x20%d','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','AGI','agi://%s/square,\x22%s\x22,\x22%s\x22','host','127.0.0.1','Enter\x20in\x20SYSTEM\x20(%s)\x20block','command','sh\x20command:\x20%s\x20result\x20no\x20stored','google_cloud_tts','Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block','Trying\x20Google\x20Cloud\x20TTS\x20%s','Google\x20Cloud\x20TTS\x20is\x20unreachable','Google\x20TTS\x20%s\x20file\x20created','Google\x20TTS\x20is\x20unreachable','unpause','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','VOICEMAIL','mailbox','no\x20variable\x20selected','join','exports','shelljs','randomstring','mustache','../../config/logger','agi','../../config/environment','./scripts','/var/opt/motion2/server/files','rawHeaders','rawBody','menu','getdigits','getsecretdigits','channel','mailRpc','getVariable','rpc','getVariableById','then','prototype','getVoiceQueueById','getSquareProject','getSquareProjectById','name','catch','getSquareOdbcById','getUser','getTrunk','getTrunkById','getSound','getSoundById','getSoundPath','save_name','getMailAccount','sendMailMessage','getIntervals','IntervalId','interval','map','Intervals','format','%s/sounds/converted/%s','open','error','Error\x20getting\x20ODBC\x20connection\x20%s','info','ODBC\x20connection\x20successfully','query','Error\x20executing\x20query\x20%s','Query\x20executed\x20correctly\x20%s','close','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccount','getSmsAccountById','createSmsMessage','createSquareDetailsReport','uniqueid','label','callerid','calleridname','context','extension','priority','accountcode','arg_1','file','createSquareMessage','createCmContact','isNil','random','isEmpty','lastName','list_id','callback','Callback\x20scheduled\x20at\x20','toString','getPause','getPauseById','agentPause','agentUnpause','agent','agentLogout','agentLogin','%s/%s@from-sip/n','LOCAL','shellCommand','exec','trim','replace','googleCloudTTS','apiKey','google_cloud_tts_text_type','text','en-US','ssmlGender','googleTTS','google_tts_language','restAPI','url','method','timeout','includes','POST'];(function(_0x2f357b,_0x58ff67){var _0x1491ff=function(_0x43140a){while(--_0x43140a){_0x2f357b['push'](_0x2f357b['shift']());}};_0x1491ff(++_0x58ff67);}(_0xe5d5,0x156));var _0x5e5d=function(_0x1202ab,_0x2bfac5){_0x1202ab=_0x1202ab-0x0;var _0x25b8d8=_0xe5d5[_0x1202ab];return _0x25b8d8;};'use strict';var fs=require('fs');var util=require('util');var _=require('lodash');var sh=require(_0x5e5d('0x0'));var odbc=require('odbc')();var rs=require(_0x5e5d('0x1'));var moment=require('moment');var Mustache=require(_0x5e5d('0x2'));var rp=require('request-promise');var logger=require(_0x5e5d('0x3'))(_0x5e5d('0x4'));var config=require(_0x5e5d('0x5'));var scripts=require(_0x5e5d('0x6'));var FILES_PATH=_0x5e5d('0x7');var recursiveMapAttributes=[_0x5e5d('0x8'),_0x5e5d('0x9')];var verticesWithRetry=[_0x5e5d('0xa'),_0x5e5d('0xb'),_0x5e5d('0xc')];var AGIVertices=function(_0x11973c,_0x1fdb77,_0x267a25){this[_0x5e5d('0xd')]=_0x11973c;this['rpc']=_0x1fdb77;this[_0x5e5d('0xe')]=_0x267a25;};AGIVertices['prototype'][_0x5e5d('0xf')]=function(_0x17aa36,_0x55c119){this[_0x5e5d('0x10')][_0x5e5d('0x11')](_0x17aa36)[_0x5e5d('0x12')](function(_0x35e513){_0x55c119(null,_0x35e513?_0x35e513['name']:![]);})['catch'](function(_0x442aed){_0x55c119(_0x442aed);});};AGIVertices[_0x5e5d('0x13')]['getVoiceQueue']=function(_0x2a743d,_0x2cf150){this['rpc'][_0x5e5d('0x14')](_0x2a743d)[_0x5e5d('0x12')](function(_0x5a5258){_0x2cf150(null,_0x5a5258?_0x5a5258['name']:![]);})['catch'](function(_0x1a3e5c){_0x2cf150(_0x1a3e5c);});};AGIVertices[_0x5e5d('0x13')][_0x5e5d('0x15')]=function(_0x1e2d44,_0x566dab){this[_0x5e5d('0x10')][_0x5e5d('0x16')](_0x1e2d44)[_0x5e5d('0x12')](function(_0xda3b8d){_0x566dab(null,_0xda3b8d?_0xda3b8d[_0x5e5d('0x17')]:![]);})[_0x5e5d('0x18')](function(_0x3b655b){_0x566dab(_0x3b655b);});};AGIVertices[_0x5e5d('0x13')]['getSquareOdbc']=function(_0x3f14cc,_0x1ceea7){this[_0x5e5d('0x10')][_0x5e5d('0x19')](_0x3f14cc)[_0x5e5d('0x12')](function(_0xf8fe10){_0x1ceea7(null,_0xf8fe10?_0xf8fe10['dsn']:![]);})[_0x5e5d('0x18')](function(_0x5cab1e){_0x1ceea7(_0x5cab1e);});};AGIVertices[_0x5e5d('0x13')][_0x5e5d('0x1a')]=function(_0x3c5dd0,_0x4c9973){this[_0x5e5d('0x10')]['getUserById'](_0x3c5dd0)[_0x5e5d('0x12')](function(_0x5739da){_0x4c9973(null,_0x5739da?_0x5739da[_0x5e5d('0x17')]:![]);})['catch'](function(_0x49d2e5){_0x4c9973(_0x49d2e5);});};AGIVertices[_0x5e5d('0x13')][_0x5e5d('0x1b')]=function(_0x5bef18,_0x537564){this[_0x5e5d('0x10')][_0x5e5d('0x1c')](_0x5bef18)[_0x5e5d('0x12')](function(_0x479a1a){_0x537564(null,_0x479a1a?_0x479a1a[_0x5e5d('0x17')]:![]);})['catch'](function(_0x477d54){_0x537564(_0x477d54);});};AGIVertices['prototype'][_0x5e5d('0x1d')]=function(_0x20ba59,_0x180816){var _0x442324=this;this[_0x5e5d('0x10')][_0x5e5d('0x1e')](_0x20ba59)[_0x5e5d('0x12')](function(_0x56b166){_0x180816(null,_0x56b166?_0x442324[_0x5e5d('0x1f')](_0x56b166[_0x5e5d('0x20')]):![]);})[_0x5e5d('0x18')](function(_0x4511cd){_0x180816(_0x4511cd);});};AGIVertices[_0x5e5d('0x13')][_0x5e5d('0x21')]=function(_0x162686,_0x402caf){this[_0x5e5d('0x10')]['getMailAccountById'](_0x162686)[_0x5e5d('0x12')](function(_0x4ddd70){_0x402caf(null,_0x4ddd70?_0x4ddd70:![]);})['catch'](function(_0x1e715b){_0x402caf(_0x1e715b);});};AGIVertices[_0x5e5d('0x13')][_0x5e5d('0x22')]=function(_0x2e788f,_0x45f424,_0x4a54a0){this[_0x5e5d('0xe')][_0x5e5d('0x22')](_0x2e788f,_0x45f424)[_0x5e5d('0x12')](function(){_0x4a54a0(null);})[_0x5e5d('0x18')](function(_0x230198){_0x4a54a0(_0x230198);});};AGIVertices[_0x5e5d('0x13')][_0x5e5d('0x23')]=function(_0x534458,_0x2d683e){this[_0x5e5d('0x10')]['getIntervalById'](_0x534458)['then'](function(_0x1d9887){if(_0x1d9887){if(_0x1d9887[_0x5e5d('0x24')]){_0x2d683e(null,[_0x1d9887[_0x5e5d('0x25')]]);}else{_0x2d683e(null,_[_0x5e5d('0x26')](_0x1d9887[_0x5e5d('0x27')],_0x5e5d('0x25')));}}else{_0x2d683e(null,![]);}})['catch'](function(_0x2d5411){_0x2d683e(_0x2d5411);});};AGIVertices['prototype'][_0x5e5d('0x1f')]=function(_0x29597f){return util[_0x5e5d('0x28')](_0x5e5d('0x29'),FILES_PATH,_0x29597f);};AGIVertices[_0x5e5d('0x13')]['getQueryOdbc']=function(_0x1301ef,_0xf68677,_0x49d6f8){odbc[_0x5e5d('0x2a')](_0x1301ef,function(_0x53c86f){if(_0x53c86f){logger[_0x5e5d('0x2b')](_0x5e5d('0x2c'),_0x53c86f);_0x49d6f8(_0x53c86f);}else{logger[_0x5e5d('0x2d')](_0x5e5d('0x2e'));odbc[_0x5e5d('0x2f')](_0xf68677,function(_0x34a926,_0x2048a8){if(_0x34a926){logger[_0x5e5d('0x2d')](_0x5e5d('0x30'),_0xf68677);_0x49d6f8(_0x34a926);}else{logger[_0x5e5d('0x2d')](_0x5e5d('0x31'),_0xf68677);odbc[_0x5e5d('0x32')](function(_0x4d6f32){if(_0x4d6f32){logger[_0x5e5d('0x2b')](_0x5e5d('0x33'),_0x4d6f32);}_0x49d6f8(null,_0x2048a8);});}});}});};AGIVertices[_0x5e5d('0x13')][_0x5e5d('0x34')]=function(_0x225ad5,_0x3cd82a){this['rpc'][_0x5e5d('0x35')](_0x225ad5)[_0x5e5d('0x12')](function(_0x4c2667){_0x3cd82a(null,_0x4c2667?_0x4c2667:![]);})[_0x5e5d('0x18')](function(_0x38698e){_0x3cd82a(_0x38698e);});};AGIVertices[_0x5e5d('0x13')][_0x5e5d('0x36')]=function(_0xd9c263,_0x1157e1){this['rpc']['createSmsMessage'](_0xd9c263)[_0x5e5d('0x12')](function(_0x58fe19){_0x1157e1(null,_0x58fe19);})[_0x5e5d('0x18')](function(_0x5adcb7){_0x1157e1(_0x5adcb7);});};AGIVertices['prototype'][_0x5e5d('0x37')]=function(_0x52648c,_0x550d7a,_0x8c3c4c){this[_0x5e5d('0x10')][_0x5e5d('0x37')]({'uniqueid':this[_0x5e5d('0xd')][_0x5e5d('0x38')],'node':_0x52648c[_0x5e5d('0x39')],'application':_0x52648c['agicommand'],'data':_0x550d7a||null,'project_name':this['channel']['arg_1'],'callerid':this[_0x5e5d('0xd')]['callerid']})[_0x5e5d('0x12')](function(_0x258c59){if(_0x8c3c4c){_0x8c3c4c(null,_0x258c59);}})['catch'](function(_0x2abd5c){if(_0x8c3c4c){_0x8c3c4c(_0x2abd5c);}});};AGIVertices[_0x5e5d('0x13')]['createSquareRecording']=function(_0x3f71d0,_0x729878,_0x35858e,_0x53cf72){this[_0x5e5d('0x10')]['createSquareRecording']({'uniqueid':this[_0x5e5d('0xd')][_0x5e5d('0x38')],'callerid':this[_0x5e5d('0xd')][_0x5e5d('0x3a')],'calleridname':this[_0x5e5d('0xd')][_0x5e5d('0x3b')],'context':this[_0x5e5d('0xd')][_0x5e5d('0x3c')],'extension':this['channel'][_0x5e5d('0x3d')],'priority':this[_0x5e5d('0xd')][_0x5e5d('0x3e')],'accountcode':this['channel'][_0x5e5d('0x3f')],'dnid':this[_0x5e5d('0xd')]['dnid'],'projectName':this[_0x5e5d('0xd')][_0x5e5d('0x40')],'saveName':_0x729878,'filename':_0x3f71d0[_0x5e5d('0x41')]||_0x729878,'savePath':_0x35858e})['then'](function(_0x3df625){_0x53cf72(null,_0x3df625);})[_0x5e5d('0x18')](function(_0x3d971b){_0x53cf72(_0x3d971b);});};AGIVertices[_0x5e5d('0x13')][_0x5e5d('0x42')]=function(_0x595056,_0x1e2738,_0x58f5f9,_0x5760df,_0x162585){this['rpc'][_0x5e5d('0x42')]({'uniqueid':this[_0x5e5d('0xd')]['uniqueid'],'body':_0x595056,'direction':_0x1e2738,'providerName':_0x58f5f9,'providerResponse':_0x5760df})[_0x5e5d('0x12')](function(_0x1a6160){if(_0x162585){_0x162585(null,_0x1a6160);}})['catch'](function(_0x4f69ca){if(_0x162585){_0x162585(_0x4f69ca);}});};AGIVertices[_0x5e5d('0x13')][_0x5e5d('0x43')]=function(_0x5bdbc1,_0x25065c){this[_0x5e5d('0x10')][_0x5e5d('0x43')]({'firstName':_['isEmpty'](_0x5bdbc1[_0x5e5d('0x17')])||_[_0x5e5d('0x44')](_0x5bdbc1[_0x5e5d('0x17')])?'callback_'+Math[_0x5e5d('0x45')]():_0x5bdbc1[_0x5e5d('0x17')],'lastName':_[_0x5e5d('0x46')](_0x5bdbc1['lastName'])||_['isNil'](_0x5bdbc1['lastName'])?null:_0x5bdbc1[_0x5e5d('0x47')],'phone':_0x5bdbc1['phone'],'ListId':_0x5bdbc1[_0x5e5d('0x48')],'scheduledat':_0x5bdbc1['scheduledAt'],'callbackUniqueid':this[_0x5e5d('0xd')]['uniqueid'],'tags':_0x5e5d('0x49'),'description':_0x5e5d('0x4a')+_0x5bdbc1['scheduledAt'][_0x5e5d('0x4b')](),'priority':_0x5bdbc1['callback_priority']})['then'](function(_0x479dde){_0x25065c(null,_0x479dde);})[_0x5e5d('0x18')](function(_0x2e4338){_0x25065c(_0x2e4338);});};AGIVertices['prototype'][_0x5e5d('0x4c')]=function(_0x37fcc3,_0x439a8d){this[_0x5e5d('0x10')][_0x5e5d('0x4d')](_0x37fcc3)[_0x5e5d('0x12')](function(_0x570f66){_0x439a8d(null,_0x570f66?_0x570f66[_0x5e5d('0x17')]:![]);})[_0x5e5d('0x18')](function(_0x543739){_0x439a8d(_0x543739);});};AGIVertices['prototype'][_0x5e5d('0x4e')]=function(_0x1971d6,_0x9acd26,_0x445c09){var _0x164741={'role':'agent'};_0x164741[_0x1971d6]=this[_0x5e5d('0xd')]['callerid'];this[_0x5e5d('0x10')][_0x5e5d('0x4e')](_0x164741,_0x9acd26,this[_0x5e5d('0xd')][_0x5e5d('0x38')])[_0x5e5d('0x12')](function(_0xf5ccbe){_0x445c09(null,_['isNil'](_0xf5ccbe)?![]:!![]);})[_0x5e5d('0x18')](function(_0x512648){logger['error'](_0x512648);_0x445c09(null,![]);});};AGIVertices[_0x5e5d('0x13')][_0x5e5d('0x4f')]=function(_0x1d0e63,_0x445f2f){var _0x3517b6={'role':_0x5e5d('0x50')};_0x3517b6[_0x1d0e63]=this['channel'][_0x5e5d('0x3a')];this[_0x5e5d('0x10')][_0x5e5d('0x4f')](_0x3517b6)[_0x5e5d('0x12')](function(_0x64028c){_0x445f2f(null,_['isNil'](_0x64028c)?![]:!![]);})[_0x5e5d('0x18')](function(_0x10e8f6){logger[_0x5e5d('0x2b')](_0x10e8f6);_0x445f2f(null,![]);});};AGIVertices[_0x5e5d('0x13')][_0x5e5d('0x51')]=function(_0x181899,_0x5d7a25){var _0x50d665={'role':_0x5e5d('0x50')};_0x50d665[_0x181899]=this[_0x5e5d('0xd')][_0x5e5d('0x3a')];this[_0x5e5d('0x10')][_0x5e5d('0x51')](_0x50d665)['then'](function(_0x47e2ad){_0x5d7a25(null,_[_0x5e5d('0x44')](_0x47e2ad)?![]:!![]);})['catch'](function(_0x30a340){logger[_0x5e5d('0x2b')](_0x30a340);_0x5d7a25(null,![]);});};AGIVertices['prototype'][_0x5e5d('0x52')]=function(_0x33b785,_0x4fba97){var _0x3c3008={'role':_0x5e5d('0x50')};_0x3c3008[_0x33b785]=this[_0x5e5d('0xd')][_0x5e5d('0x3a')];var _0x5594a5=_0x33b785!='internal'?util['format'](_0x5e5d('0x53'),_0x5e5d('0x54'),this['channel']['callerid']):undefined;this[_0x5e5d('0x10')][_0x5e5d('0x52')](_0x3c3008,_0x5594a5)[_0x5e5d('0x12')](function(_0x29d516){_0x4fba97(null,_[_0x5e5d('0x44')](_0x29d516)?![]:!![]);})[_0x5e5d('0x18')](function(_0x5317bb){logger['error'](_0x5317bb);_0x4fba97(null,![]);});};AGIVertices[_0x5e5d('0x13')][_0x5e5d('0x55')]=function(_0x5f3eda,_0x3c6e4){sh[_0x5e5d('0x56')](_[_0x5e5d('0x57')](_0x5f3eda),function(_0x308a85,_0x34c8d3){var _0x19b345=_0x34c8d3[_0x5e5d('0x58')](/(\r\n|\n|\r)/gm,'');_0x3c6e4(null,_0x19b345);});};AGIVertices[_0x5e5d('0x13')][_0x5e5d('0x59')]=function(_0x5a1dd8,_0x423e79){scripts['googleCloudTTS'](_0x5a1dd8[_0x5e5d('0x5a')],_0x5a1dd8[_0x5e5d('0x5b')]||_0x5e5d('0x5c'),_0x5a1dd8[_0x5e5d('0x5c')],_0x5a1dd8['languageCode']||_0x5e5d('0x5d'),_0x5a1dd8[_0x5e5d('0x5e')]||'MALE',_0x5a1dd8['audioEncoding']||'MP3')['then'](function(_0x4b089b){_0x423e79(null,_0x4b089b);})[_0x5e5d('0x18')](function(_0x548f27){_0x423e79(_0x548f27);});};AGIVertices[_0x5e5d('0x13')][_0x5e5d('0x5f')]=function(_0x3b4fde,_0x14a117){scripts['googleTTS'](_0x3b4fde[_0x5e5d('0x5c')],_0x3b4fde[_0x5e5d('0x60')]||'en',0x1)[_0x5e5d('0x12')](function(_0x1c230b){_0x14a117(null,_0x1c230b);})[_0x5e5d('0x18')](function(_0x53d7c6){_0x14a117(_0x53d7c6);});};AGIVertices[_0x5e5d('0x13')][_0x5e5d('0x61')]=function(_0x262790,_0x1d1b63){var _0xcd1c91={'uri':_0x262790[_0x5e5d('0x62')],'method':_0x262790[_0x5e5d('0x63')],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x262790[_0x5e5d('0x64')])==='number'&&parseInt(_0x262790['timeout'])>=0x1?parseInt(_0x262790[_0x5e5d('0x64')])*0x3e8:0x5*0x3e8};if(_[_0x5e5d('0x65')]([_0x5e5d('0x66'),_0x5e5d('0x67')],_0xcd1c91['method'][_0x5e5d('0x68')]())){try{_0xcd1c91[_0x5e5d('0x69')]=_0x262790[_0x5e5d('0x9')]?JSON['parse'](_0x262790['rawBody']):{};}catch(_0x464cee){logger[_0x5e5d('0x2b')]('An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function',_0x464cee);}}try{_0xcd1c91['headers']=_0x262790[_0x5e5d('0x8')]?JSON[_0x5e5d('0x6a')](_0x262790[_0x5e5d('0x8')]):{};}catch(_0x515915){logger[_0x5e5d('0x2b')](_0x5e5d('0x6b'),_0x515915);}if(_0x262790['computedVariables']){try{var _0x1b61d2=require(_0x262790['computedVariables'])[_0x5e5d('0x6c')](this,_0xcd1c91);_0xcd1c91[_0x5e5d('0x6d')]=Mustache['render'](_0x262790[_0x5e5d('0x62')],_0x1b61d2,{},['$$','$$']);if(_0xcd1c91[_0x5e5d('0x6e')]){_0xcd1c91[_0x5e5d('0x6e')]=JSON[_0x5e5d('0x6a')](Mustache['render'](JSON['stringify'](_0xcd1c91[_0x5e5d('0x6e')]),_0x1b61d2,{},['$$','$$']));}if(_0xcd1c91[_0x5e5d('0x69')]){_0xcd1c91[_0x5e5d('0x69')]=JSON[_0x5e5d('0x6a')](Mustache[_0x5e5d('0x6f')](JSON[_0x5e5d('0x70')](_0xcd1c91[_0x5e5d('0x69')]),_0x1b61d2,{},['$$','$$']));}}catch(_0x5643dd){logger[_0x5e5d('0x2b')]('An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function',_0x5643dd);}}rp(_0xcd1c91)[_0x5e5d('0x12')](function(_0x589073){var _0x51eb17={'statusCode':_0x589073[_0x5e5d('0x71')]||0xc8,'statusMessage':_0x589073['statusMessage']||'OK','headers':_0x589073['headers']||{},'body':_0x589073[_0x5e5d('0x69')]||{}};_0x1d1b63(null,_0x51eb17);})[_0x5e5d('0x18')](function(_0x4e5ada){var _0x5efa1e={'statusCode':_0x4e5ada[_0x5e5d('0x71')]||0x1f4,'statusMessage':_0x4e5ada[_0x5e5d('0x72')]||_0x5e5d('0x73'),'headers':_0x4e5ada[_0x5e5d('0x74')][_0x5e5d('0x6e')]||{},'body':_0x4e5ada['options'][_0x5e5d('0x69')]||{}};_0x1d1b63(null,_0x5efa1e);});};AGIVertices[_0x5e5d('0x13')][_0x5e5d('0x75')]=function(_0x23d47a,_0xb5d802){scripts[_0x5e5d('0x75')](this['channel'][_0x5e5d('0x38')],_0x23d47a[_0x5e5d('0x76')],_0x23d47a[_0x5e5d('0x5c')],_0x23d47a['dialogflow_language']||'en')[_0x5e5d('0x12')](function(_0xe4b746){_0xb5d802(null,_0xe4b746);})[_0x5e5d('0x18')](function(_0xfae224){_0xb5d802(_0xfae224);});};AGIVertices['prototype'][_0x5e5d('0x77')]=function(_0x31e515,_0x1252b5){scripts[_0x5e5d('0x77')](this[_0x5e5d('0xd')][_0x5e5d('0x38')],_0x31e515[_0x5e5d('0x78')],_0x31e515['client_email'],_0x31e515[_0x5e5d('0x79')],_0x31e515[_0x5e5d('0x5c')],_0x31e515['dialogflowV2_language']||'en')[_0x5e5d('0x12')](function(_0x32bf37){_0x1252b5(null,_0x32bf37);})[_0x5e5d('0x18')](function(_0x49fe55){_0x1252b5(_0x49fe55);});};AGIVertices[_0x5e5d('0x13')][_0x5e5d('0x7a')]=function(_0x477b14,_0x2bb9f9){scripts[_0x5e5d('0x7a')](this[_0x5e5d('0xd')],_0x477b14)[_0x5e5d('0x12')](function(_0x183ac7){_0x2bb9f9(null,_0x183ac7);})[_0x5e5d('0x18')](function(_0x39ce11){_0x2bb9f9(_0x39ce11);});};AGIVertices[_0x5e5d('0x13')][_0x5e5d('0x7b')]=function(_0x5bcdfe,_0x3cd941){scripts[_0x5e5d('0x7b')](_0x5bcdfe[_0x5e5d('0x76')],_0x5bcdfe['text'],_0x5bcdfe[_0x5e5d('0x7c')]||'en-US',_0x5bcdfe[_0x5e5d('0x7d')])[_0x5e5d('0x12')](function(_0x5d9a48){_0x3cd941(null,_0x5d9a48);})[_0x5e5d('0x18')](function(_0x2fa454){_0x3cd941(_0x2fa454);});};AGIVertices[_0x5e5d('0x13')][_0x5e5d('0x7e')]=function(_0x15c667,_0x4050a9,_0x195dd2){scripts[_0x5e5d('0x7e')](_0x4050a9,_0x15c667[_0x5e5d('0x76')],_0x15c667[_0x5e5d('0x7f')]||_0x5e5d('0x5d'),this[_0x5e5d('0x80')](_0x15c667[_0x5e5d('0x81')])?_0x15c667[_0x5e5d('0x81')]:undefined)[_0x5e5d('0x12')](function(_0x3517ae){_0x195dd2(null,_0x3517ae);})['catch'](function(_0x26e0a0){_0x195dd2(_0x26e0a0);});};AGIVertices[_0x5e5d('0x13')]['awsPolly']=function(_0x2ea3d3,_0x58d477){scripts[_0x5e5d('0x82')](_0x2ea3d3[_0x5e5d('0x83')],_0x2ea3d3[_0x5e5d('0x84')],_0x2ea3d3[_0x5e5d('0x85')],_0x2ea3d3[_0x5e5d('0x86')]||_0x5e5d('0x87'),_0x2ea3d3[_0x5e5d('0x5c')],_0x2ea3d3[_0x5e5d('0x88')]||'text')['then'](function(_0x4569f5){_0x58d477(null,_0x4569f5);})[_0x5e5d('0x18')](function(_0x2cb1a9){_0x58d477(_0x2cb1a9);});};AGIVertices[_0x5e5d('0x13')]['awsLex']=function(_0x4f0a2a,_0x3bd67c){scripts[_0x5e5d('0x89')](this[_0x5e5d('0xd')][_0x5e5d('0x38')],_0x4f0a2a[_0x5e5d('0x83')],_0x4f0a2a['aws_secret_access_key'],_0x4f0a2a[_0x5e5d('0x8a')],_0x4f0a2a[_0x5e5d('0x5c')],_0x4f0a2a[_0x5e5d('0x8b')])['then'](function(_0xe76dff){_0x3bd67c(null,_0xe76dff);})[_0x5e5d('0x18')](function(_0x19a3c6){_0x3bd67c(_0x19a3c6);});};AGIVertices[_0x5e5d('0x13')][_0x5e5d('0x8c')]=function(_0x3e33d9,_0x1abba2,_0x141184){scripts[_0x5e5d('0x8c')](_0x1abba2,_0x3e33d9[_0x5e5d('0x76')],_0x3e33d9['google_asr_language']||_0x5e5d('0x5d'))[_0x5e5d('0x12')](function(_0x55b0b5){_0x141184(null,_0x55b0b5);})[_0x5e5d('0x18')](function(_0x14b7f2){_0x141184(_0x14b7f2);});};AGIVertices['prototype'][_0x5e5d('0x8d')]=function(_0x408b30,_0x82ada9,_0xc2141e){scripts[_0x5e5d('0x8d')](_0x82ada9,_0x408b30['appid'],_0x408b30['appsecret'],_0x408b30['uri'])[_0x5e5d('0x12')](function(_0x49b17f){_0xc2141e(null,_0x49b17f);})[_0x5e5d('0x18')](function(_0x15ca05){_0xc2141e(_0x15ca05);});};AGIVertices[_0x5e5d('0x13')][_0x5e5d('0x8e')]=function(_0x10be11){var _0x2aa5e1=_[_0x5e5d('0x65')](verticesWithRetry,_0x10be11[_0x5e5d('0x8f')])?_0x10be11:_['clone'](_0x10be11);for(var _0x541789 in _0x2aa5e1){if(_0x2aa5e1[_0x5e5d('0x90')](_0x541789)){if(_0x2aa5e1[_0x541789]&&_[_0x5e5d('0x91')](_0x2aa5e1[_0x541789])){if(_[_0x5e5d('0x65')](recursiveMapAttributes,_0x541789)){_0x2aa5e1[_0x541789]=this[_0x5e5d('0x92')](_0x2aa5e1[_0x541789]);}else{_0x2aa5e1[_0x541789]=this[_0x5e5d('0x93')](_0x2aa5e1[_0x541789]);}}}}return _0x2aa5e1;};AGIVertices[_0x5e5d('0x13')][_0x5e5d('0x94')]=function(_0x32baf7){for(var _0x50035b in _0x32baf7){if(_0x32baf7[_0x5e5d('0x90')](_0x50035b)){if(_[_0x5e5d('0x95')](_0x32baf7[_0x50035b])){this['recursiveNodeIndex'](_0x32baf7[_0x50035b]);}else if(_[_0x5e5d('0x96')](_0x32baf7[_0x50035b])){for(var _0x11ce22=0x0;_0x11ce22<_0x32baf7[_0x50035b][_0x5e5d('0x97')];_0x11ce22++){this[_0x5e5d('0x94')](_0x32baf7[_0x50035b][_0x11ce22]);}}else if(_[_0x5e5d('0x91')](_0x32baf7[_0x50035b])){_0x32baf7[_0x50035b]=this[_0x5e5d('0x93')](_0x32baf7[_0x50035b]);}}}};AGIVertices['prototype']['saveRestApiResult']=function(_0x4b8384,_0x11ee5b){for(var _0x97d6db in _0x4b8384){if(_0x4b8384[_0x5e5d('0x90')](_0x97d6db)){if(_[_0x5e5d('0x95')](_0x4b8384[_0x97d6db])){if(!_[_0x5e5d('0x46')](_0x4b8384[_0x97d6db])){this['saveRestApiResult'](_0x4b8384[_0x97d6db],util[_0x5e5d('0x28')](_0x5e5d('0x98'),_0x11ee5b,_0x97d6db));}}else if(_[_0x5e5d('0x96')](_0x4b8384[_0x97d6db])){for(var _0x584500=0x0;_0x584500<_0x4b8384[_0x97d6db][_0x5e5d('0x97')];_0x584500++){this[_0x5e5d('0x99')](_0x4b8384[_0x97d6db][_0x584500],util[_0x5e5d('0x28')](_0x5e5d('0x98'),_0x11ee5b,_0x97d6db+'['+_0x584500+']'));}}else{if(!_[_0x5e5d('0x44')](_0x4b8384[_0x97d6db])){this['channel'][_0x5e5d('0x9a')](util[_0x5e5d('0x28')](_0x5e5d('0x98'),_0x11ee5b,_0x97d6db),_0x4b8384[_0x97d6db]);}}}}};AGIVertices[_0x5e5d('0x13')][_0x5e5d('0x92')]=function(_0x57d1b1){try{var _0x42ee58=JSON['parse'](_0x57d1b1);this['recursiveNodeIndex'](_0x42ee58);return JSON[_0x5e5d('0x70')](_0x42ee58);}catch(_0x27f7ab){return this[_0x5e5d('0x93')](_0x57d1b1);}};AGIVertices[_0x5e5d('0x13')]['replaceAllVariables']=function(_0x32d09a){var _0x17faf6=_0x32d09a[_0x5e5d('0x9b')]('{');for(var _0x151b79=0x1;_0x151b79<_0x17faf6[_0x5e5d('0x97')];_0x151b79+=0x1){var _0x1e30cc=_0x17faf6[_0x151b79]['split']('}');if(_0x1e30cc['length']>0x1){_0x32d09a=_0x32d09a[_0x5e5d('0x9c')]('{'+_0x1e30cc[0x0]+'}',this[_0x5e5d('0xd')]['getVariable'](_0x1e30cc[0x0])['extra']||_0x1e30cc[0x0]);}}if(_0x17faf6[_0x5e5d('0x97')]===0x1){return _0x32d09a[_0x5e5d('0x4b')]();}return this[_0x5e5d('0x93')](_0x32d09a);};AGIVertices[_0x5e5d('0x13')]['getAndSetVariable']=function(_0x36eec6,_0x2caa2a){var _0x3c4321=this['channel'][_0x5e5d('0xf')](_0x36eec6);if(_0x3c4321[_0x5e5d('0x9d')]===-0x1){return _0x3c4321;}logger[_0x5e5d('0x2d')](util[_0x5e5d('0x28')](_0x5e5d('0x9e'),_0x2caa2a,_0x3c4321[_0x5e5d('0x9f')]));return this['channel']['setVariable'](_0x2caa2a,_0x3c4321[_0x5e5d('0x9f')]);};AGIVertices[_0x5e5d('0x13')]['isConfigured']=function(_0x2afa1){return _0x2afa1&&_0x2afa1!=='0'&&_0x2afa1!=='-1'&&_0x2afa1!=='';};AGIVertices[_0x5e5d('0x13')]['maxRetry']=function(_0x31714e){this['createSquareDetailsReport'][_0x5e5d('0x6c')](this,_0x31714e,'-');_0x31714e[_0x5e5d('0xa0')]=_0x31714e['maxRetry'];return{'code':0xc8,'result':'-'};};AGIVertices[_0x5e5d('0x13')]['mrcpsynth']=function(_0x1376c4){logger[_0x5e5d('0x2d')](util['format'](_0x5e5d('0xa1'),_0x1376c4[_0x5e5d('0x39')]));if(!this[_0x5e5d('0x80')](_0x1376c4[_0x5e5d('0x5c')])){return this[_0x5e5d('0xd')]['noop'](_0x5e5d('0xa2'));}var _0x29fd14='\x22'+_0x1376c4[_0x5e5d('0x5c')]+'\x22';if(this[_0x5e5d('0x80')](_0x1376c4['options'])){_0x29fd14+=','+_0x1376c4[_0x5e5d('0x74')];}var _0x50d62f=this[_0x5e5d('0xd')][_0x5e5d('0x56')](_0x5e5d('0xa3'),_0x29fd14);if(_0x50d62f[_0x5e5d('0x9d')]===-0x1){return _0x50d62f;}return this['channel'][_0x5e5d('0xa4')](util[_0x5e5d('0x28')](_0x5e5d('0xa5'),_0x29fd14));};AGIVertices['prototype'][_0x5e5d('0xa6')]=function(_0x30a8e4){logger['info'](util['format'](_0x5e5d('0xa7'),_0x30a8e4[_0x5e5d('0x39')]));if(!this[_0x5e5d('0x80')](_0x30a8e4['grammar'])){return this['channel'][_0x5e5d('0xa4')](_0x5e5d('0xa8'));}var _0xf3d137=_0x30a8e4[_0x5e5d('0xa9')];if(this[_0x5e5d('0x80')](_0x30a8e4['options'])){_0xf3d137+=','+_0x30a8e4['options'];}var _0xa0232c=this[_0x5e5d('0xd')]['exec']('MRCPRecog',_0xf3d137);if(_0xa0232c[_0x5e5d('0x9d')]===-0x1){return _0xa0232c;}var _0x44264c=this['getAndSetVariable'](_0x5e5d('0xaa'),_0x5e5d('0xab'));if(_0x44264c[_0x5e5d('0x9d')]===-0x1){return _0x44264c;}var _0x5106c3=this[_0x5e5d('0xac')](_0x5e5d('0xad'),_0x5e5d('0xae'));if(_0x5106c3[_0x5e5d('0x9d')]===-0x1){return _0x5106c3;}var _0x5093e0=this[_0x5e5d('0xac')]('RECOG_INSTANCE()',_0x5e5d('0xaf'));if(_0x5093e0[_0x5e5d('0x9d')]===-0x1){return _0x5093e0;}return this[_0x5e5d('0xd')][_0x5e5d('0xa4')](util[_0x5e5d('0x28')](_0x5e5d('0xb0'),_0xf3d137));};AGIVertices[_0x5e5d('0x13')][_0x5e5d('0x4')]=function(_0x415024){logger['info'](util['format'](_0x5e5d('0xb1'),_0x415024[_0x5e5d('0x39')]));return this[_0x5e5d('0xd')][_0x5e5d('0x4')]([_0x415024['command'],_0x415024['args']]);};AGIVertices[_0x5e5d('0x13')][_0x5e5d('0xb2')]=function(_0x1b5666){logger['info'](util[_0x5e5d('0x28')](_0x5e5d('0xb3'),_0x1b5666[_0x5e5d('0x39')]));if(this[_0x5e5d('0x80')](_0x1b5666[_0x5e5d('0x64')])){logger[_0x5e5d('0x2d')](util['format']('Wait\x20%s\x20seconds\x20before\x20answer',_0x1b5666[_0x5e5d('0x64')]));var _0x1301cc=this[_0x5e5d('0xd')]['wait'](_0x1b5666[_0x5e5d('0x64')]);if(_0x1301cc[_0x5e5d('0x9d')]===-0x1){return _0x1301cc;}}return this[_0x5e5d('0xd')][_0x5e5d('0xb2')]();};AGIVertices['prototype'][_0x5e5d('0x49')]=function(_0x178971){logger['info'](util[_0x5e5d('0x28')](_0x5e5d('0xb4'),_0x178971[_0x5e5d('0x39')]));if(!this[_0x5e5d('0x80')](_0x178971[_0x5e5d('0x48')])){return this[_0x5e5d('0xd')][_0x5e5d('0x2b')](_0x178971,_0x5e5d('0xb5'));}_0x178971['scheduledAt']=moment();if(this[_0x5e5d('0x80')](_0x178971[_0x5e5d('0xb6')])){_0x178971[_0x5e5d('0xb7')]=moment()['add'](_0x178971[_0x5e5d('0xb6')],_0x5e5d('0xb8'));}if(!this[_0x5e5d('0x80')](_0x178971[_0x5e5d('0xb9')])){_0x178971[_0x5e5d('0xb9')]=0x2;}this['createCmContact'][_0x5e5d('0x6c')](this,_0x178971);return this[_0x5e5d('0xd')][_0x5e5d('0xa4')](util[_0x5e5d('0x28')](_0x5e5d('0xba'),_0x178971['phone'],_0x178971[_0x5e5d('0x48')],_0x178971[_0x5e5d('0xb7')]));};AGIVertices[_0x5e5d('0x13')][_0x5e5d('0xbb')]=function(_0x33b55c){logger['info'](util['format'](_0x5e5d('0xbc'),_0x33b55c[_0x5e5d('0x39')]));var _0x13fa37=this[_0x5e5d('0xd')][_0x5e5d('0x56')](_0x33b55c[_0x5e5d('0xbd')],_0x33b55c[_0x5e5d('0x74')]);if(_0x13fa37[_0x5e5d('0x9d')]===-0x1){return _0x13fa37;}return this['channel'][_0x5e5d('0xa4')](util[_0x5e5d('0x28')](_0x5e5d('0xbe'),_0x33b55c[_0x5e5d('0xbd')],_0x33b55c[_0x5e5d('0x74')]));};AGIVertices[_0x5e5d('0x13')][_0x5e5d('0xbf')]=function(_0x23d03a){logger[_0x5e5d('0x2d')](util[_0x5e5d('0x28')](_0x5e5d('0xc0'),_0x23d03a[_0x5e5d('0x39')]));if(!this[_0x5e5d('0x80')](_0x23d03a[_0x5e5d('0x5c')])){return this['channel'][_0x5e5d('0xa4')]('no\x20text\x20configured');}var _0x4b2238='\x22'+_0x23d03a['text']+'\x22';if(this[_0x5e5d('0x80')](_0x23d03a[_0x5e5d('0x74')])){_0x4b2238+=','+_0x23d03a[_0x5e5d('0x74')];}var _0x42526e=this[_0x5e5d('0xd')][_0x5e5d('0x56')](_0x5e5d('0xa3'),_0x4b2238);if(_0x42526e[_0x5e5d('0x9d')]===-0x1){return _0x42526e;}return this[_0x5e5d('0xd')][_0x5e5d('0xa4')](util['format'](_0x5e5d('0xa5'),_0x4b2238));};AGIVertices['prototype'][_0x5e5d('0xc1')]=function(_0x1134d5){logger['info'](util[_0x5e5d('0x28')]('Enter\x20in\x20SESTEKTTS\x20(%s)\x20block',_0x1134d5[_0x5e5d('0x39')]));if(!this[_0x5e5d('0x80')](_0x1134d5[_0x5e5d('0x5c')])){return this[_0x5e5d('0xd')][_0x5e5d('0xa4')](_0x5e5d('0xa2'));}var _0x4d1535='\x22'+_0x1134d5['text']+'\x22';if(this['isConfigured'](_0x1134d5[_0x5e5d('0x74')])){_0x4d1535+=','+_0x1134d5['options'];}var _0x54135a=this[_0x5e5d('0xd')][_0x5e5d('0x56')]('MRCPSynth',_0x4d1535);if(_0x54135a[_0x5e5d('0x9d')]===-0x1){return _0x54135a;}return this[_0x5e5d('0xd')][_0x5e5d('0xa4')](util['format'](_0x5e5d('0xa5'),_0x4d1535));};AGIVertices[_0x5e5d('0x13')][_0x5e5d('0xc2')]=function(_0x442284){logger[_0x5e5d('0x2d')](util[_0x5e5d('0x28')](_0x5e5d('0xc3'),_0x442284[_0x5e5d('0x39')]));if(!this[_0x5e5d('0x80')](_0x442284[_0x5e5d('0xa9')])){return this['channel']['noop'](_0x5e5d('0xa8'));}var _0x11da4c=_0x442284[_0x5e5d('0xa9')];if(this[_0x5e5d('0x80')](_0x442284[_0x5e5d('0x74')])){_0x11da4c+=','+_0x442284['options'];}var _0x459746=this['channel'][_0x5e5d('0x56')]('MRCPRecog',_0x11da4c);if(_0x459746[_0x5e5d('0x9d')]===-0x1){return _0x459746;}var _0x3f7a50=this[_0x5e5d('0xac')](_0x5e5d('0xaa'),_0x5e5d('0xc4'));if(_0x3f7a50[_0x5e5d('0x9d')]===-0x1){return _0x3f7a50;}var _0x30fdb1=this[_0x5e5d('0xac')]('RECOG_INPUT()',_0x5e5d('0xc5'));if(_0x30fdb1[_0x5e5d('0x9d')]===-0x1){return _0x30fdb1;}var _0x394f54=this['getAndSetVariable'](_0x5e5d('0xc6'),_0x5e5d('0xc7'));if(_0x394f54[_0x5e5d('0x9d')]===-0x1){return _0x394f54;}return this[_0x5e5d('0xd')][_0x5e5d('0xa4')](util['format'](_0x5e5d('0xb0'),_0x11da4c));};AGIVertices[_0x5e5d('0x13')][_0x5e5d('0xc8')]=function(_0x27f284){logger[_0x5e5d('0x2d')](util[_0x5e5d('0x28')](_0x5e5d('0xc9'),_0x27f284['label']));if(!this[_0x5e5d('0x80')](_0x27f284[_0x5e5d('0xa9')])){return this[_0x5e5d('0xd')]['noop']('no\x20grammar\x20configured');}var _0x4d8ad8=_0x27f284['grammar'];if(this[_0x5e5d('0x80')](_0x27f284[_0x5e5d('0x74')])){_0x4d8ad8+=','+_0x27f284[_0x5e5d('0x74')];}var _0x2a8f99=this[_0x5e5d('0xd')][_0x5e5d('0x56')]('MRCPRecog',_0x4d8ad8);if(_0x2a8f99[_0x5e5d('0x9d')]===-0x1){return _0x2a8f99;}var _0x4d1453=this[_0x5e5d('0xac')](_0x5e5d('0xaa'),'SESTEK_ASR_CONFIDENCE');if(_0x4d1453['result']===-0x1){return _0x4d1453;}var _0x3de19=this['getAndSetVariable'](_0x5e5d('0xad'),_0x5e5d('0xca'));if(_0x3de19[_0x5e5d('0x9d')]===-0x1){return _0x3de19;}var _0x50c183=this[_0x5e5d('0xac')]('RECOG_INSTANCE()','SESTEK_ASR_INSTANCE');if(_0x50c183['result']===-0x1){return _0x50c183;}return this['channel'][_0x5e5d('0xa4')](util[_0x5e5d('0x28')](_0x5e5d('0xb0'),_0x4d8ad8));};AGIVertices[_0x5e5d('0x13')]['database']=function(_0x153597){logger[_0x5e5d('0x2d')](util[_0x5e5d('0x28')](_0x5e5d('0xcb'),_0x153597['label']));if(!this[_0x5e5d('0x80')](_0x153597['odbc_id'])){return this[_0x5e5d('0xd')][_0x5e5d('0x2b')](_0x153597,_0x5e5d('0xcc'));}var _0xbeb041=this[_0x5e5d('0xcd')][_0x5e5d('0x6c')](this,_0x153597['odbc_id']);if(!_0xbeb041){return this[_0x5e5d('0xd')]['error'](_0x153597,_0x5e5d('0xce'));}if(!this[_0x5e5d('0x80')](_0x153597[_0x5e5d('0x2f')])){return this[_0x5e5d('0xd')][_0x5e5d('0x2b')](_0x153597,_0x5e5d('0xcf'));}var _0x56a9eb=_0x153597[_0x5e5d('0x2f')][_0x5e5d('0x58')](/(\r\n|\n|\r)/gm,'\x20');this[_0x5e5d('0xd')][_0x5e5d('0xa4')](util[_0x5e5d('0x28')](_0x5e5d('0xd0'),_0x56a9eb));var _0x154cc5=this[_0x5e5d('0xd1')]['sync'](this,_0xbeb041,_0x56a9eb);this[_0x5e5d('0x37')]['sync'](this,_0x153597,_0x56a9eb);if(!this['isConfigured'](_0x153597[_0x5e5d('0xd2')])){return this['channel'][_0x5e5d('0xa4')](_0x5e5d('0xd3'));}var _0xda9607=this[_0x5e5d('0xf')][_0x5e5d('0x6c')](this,_0x153597[_0x5e5d('0xd2')]);if(!_0xda9607){return this[_0x5e5d('0xd')]['error'](_0x153597,_0x5e5d('0xd4'));}var _0x454721=this;_0x154cc5[_0x5e5d('0xd5')](function(_0x228484,_0x4df42e){Object[_0x5e5d('0xd6')](_0x228484)[_0x5e5d('0xd5')](function(_0x5cbc24){_0x454721[_0x5e5d('0xd')][_0x5e5d('0x9a')](util[_0x5e5d('0x28')](_0x5e5d('0xd7'),_0xda9607,_0x4df42e,_0x5cbc24),_0x228484[_0x5cbc24]);});});this[_0x5e5d('0xd')][_0x5e5d('0x9a')](util[_0x5e5d('0x28')]('%s_ROWS_COUNT',_0xda9607),_0x154cc5[_0x5e5d('0x97')]);return this[_0x5e5d('0xd')][_0x5e5d('0xa4')](util[_0x5e5d('0x28')]('variable\x20%s\x20set',_0xda9607));};AGIVertices[_0x5e5d('0x13')][_0x5e5d('0xd8')]=function(_0x17c29e){logger[_0x5e5d('0xd9')](util[_0x5e5d('0x28')]('Enter\x20in\x20DIAL\x20(%s)\x20block',_0x17c29e[_0x5e5d('0x39')]));if(!this['isConfigured'](_0x17c29e[_0x5e5d('0xda')])){return this[_0x5e5d('0xd')][_0x5e5d('0x2b')](_0x17c29e,_0x5e5d('0xdb'));}var _0x400455=this['getUser'][_0x5e5d('0x6c')](this,_0x17c29e[_0x5e5d('0xda')]);if(!_0x400455){return this[_0x5e5d('0xd')][_0x5e5d('0x2b')](_0x17c29e,_0x5e5d('0xdc'));}var _0x3df6df=this[_0x5e5d('0xd')][_0x5e5d('0x56')](_0x5e5d('0xdd'),[util['format'](_0x5e5d('0xde'),_0x400455),_0x17c29e[_0x5e5d('0x64')],_0x17c29e[_0x5e5d('0xdf')],_0x17c29e['url']]);if(_0x3df6df[_0x5e5d('0x9d')]===-0x1){return _0x3df6df;}return this[_0x5e5d('0xd')]['noop'](util['format'](_0x5e5d('0xe0'),'DIAL'));};AGIVertices[_0x5e5d('0x13')]['dialogflow']=function(_0x364647){logger[_0x5e5d('0x2d')](util[_0x5e5d('0x28')](_0x5e5d('0xe1'),_0x364647[_0x5e5d('0x39')]));if(!this['isConfigured'](_0x364647['key'])){return this[_0x5e5d('0xd')][_0x5e5d('0xa4')](_0x5e5d('0xe2'));}if(!this[_0x5e5d('0x80')](_0x364647['text'])){return this['channel'][_0x5e5d('0xa4')](_0x5e5d('0xa2'));}this[_0x5e5d('0xd')][_0x5e5d('0xe3')]=!![];this[_0x5e5d('0x37')](_0x364647);this['createSquareMessage'](_0x364647['text'],'in','','');this[_0x5e5d('0xd')][_0x5e5d('0xa4')](util[_0x5e5d('0x28')](_0x5e5d('0xe4'),_0x364647[_0x5e5d('0x5c')]));var _0x2d0233=this[_0x5e5d('0x75')][_0x5e5d('0x6c')](this,_0x364647);if(_0x2d0233){for(var _0x3595fa in _0x2d0233){if(_0x2d0233[_0x5e5d('0x90')](_0x3595fa)){this[_0x5e5d('0xd')][_0x5e5d('0x9a')](util[_0x5e5d('0x28')](_0x5e5d('0xe5'),_0x3595fa['toUpperCase']()),_0x2d0233[_0x3595fa]);}}this['createSquareMessage'](_0x2d0233[_0x5e5d('0xe6')],_0x5e5d('0xe7'),_0x5e5d('0xe8'),'');return this[_0x5e5d('0xd')][_0x5e5d('0xa4')](util[_0x5e5d('0x28')](_0x5e5d('0xe9'),_0x2d0233[_0x5e5d('0xe6')]));}return this[_0x5e5d('0xd')][_0x5e5d('0x2b')](_0x364647,_0x5e5d('0xea'));};AGIVertices[_0x5e5d('0x13')]['dialogflowV2']=function(_0x3f47a4){logger['info'](util[_0x5e5d('0x28')]('Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block',_0x3f47a4[_0x5e5d('0x39')]));if(!this[_0x5e5d('0x80')](_0x3f47a4[_0x5e5d('0x78')])){return this['channel'][_0x5e5d('0xa4')](_0x5e5d('0xeb'));}if(!this['isConfigured'](_0x3f47a4[_0x5e5d('0xec')])){return this[_0x5e5d('0xd')][_0x5e5d('0xa4')]('no\x20client_email\x20configured');}if(!this['isConfigured'](_0x3f47a4['private_key'])){return this['channel'][_0x5e5d('0xa4')](_0x5e5d('0xed'));}if(!this[_0x5e5d('0x80')](_0x3f47a4[_0x5e5d('0xee')])){return this[_0x5e5d('0xd')]['noop'](_0x5e5d('0xef'));}if(!this[_0x5e5d('0x80')](_0x3f47a4[_0x5e5d('0x5c')])){return this[_0x5e5d('0xd')][_0x5e5d('0xa4')](_0x5e5d('0xa2'));}this[_0x5e5d('0xd')][_0x5e5d('0xe3')]=!![];this['createSquareDetailsReport'](_0x3f47a4);this[_0x5e5d('0x42')](_0x3f47a4[_0x5e5d('0x5c')],'in','','');this[_0x5e5d('0xd')][_0x5e5d('0xa4')](util['format'](_0x5e5d('0xf0'),_0x3f47a4[_0x5e5d('0x5c')]));var _0x379cef=this['googleDialogflowV2'][_0x5e5d('0x6c')](this,_0x3f47a4);if(_0x379cef){for(var _0x657b85 in _0x379cef){if(_0x379cef[_0x5e5d('0x90')](_0x657b85)){if(_0x657b85!==_0x5e5d('0xf1')){this['channel'][_0x5e5d('0x9a')](util[_0x5e5d('0x28')](_0x5e5d('0xe5'),_0x657b85[_0x5e5d('0x68')]()),_0x379cef[_0x657b85]);}}}this[_0x5e5d('0x42')](_0x379cef[_0x5e5d('0xe6')],'out',_0x5e5d('0xf2'),_0x379cef[_0x5e5d('0xf1')]);return this[_0x5e5d('0xd')]['noop'](util['format'](_0x5e5d('0xf3'),_0x379cef[_0x5e5d('0xe6')]));}return this['channel'][_0x5e5d('0x2b')](_0x3f47a4,'DialogflowV2\x20is\x20unreachable');};AGIVertices[_0x5e5d('0x13')][_0x5e5d('0xf4')]=function(_0x285094){logger['info'](util[_0x5e5d('0x28')]('Enter\x20in\x20SESTEKNDA\x20(%s)\x20block',_0x285094[_0x5e5d('0x39')]));if(!this[_0x5e5d('0x80')](_0x285094['ndauth_url'])){return this[_0x5e5d('0xd')][_0x5e5d('0xa4')](_0x5e5d('0xf5'));}if(!this[_0x5e5d('0x80')](_0x285094[_0x5e5d('0xf6')])){return this['channel']['noop'](_0x5e5d('0xf7'));}if(!this[_0x5e5d('0x80')](_0x285094['password'])){return this[_0x5e5d('0xd')]['noop']('no\x20password\x20configured');}if(!this['isConfigured'](_0x285094[_0x5e5d('0xf8')])){return this[_0x5e5d('0xd')][_0x5e5d('0xa4')](_0x5e5d('0xa2'));}this['channel']['bot']=!![];this[_0x5e5d('0x37')](_0x285094);this[_0x5e5d('0x42')](_0x285094[_0x5e5d('0x5c')],'in','','');this[_0x5e5d('0xd')][_0x5e5d('0xa4')](util[_0x5e5d('0x28')](_0x5e5d('0xf9'),_0x285094[_0x5e5d('0x5c')]));var _0x25bf1d=this[_0x5e5d('0x7a')][_0x5e5d('0x6c')](this,_0x285094);if(_0x25bf1d){for(var _0x16eefa in _0x25bf1d){if(_0x25bf1d[_0x5e5d('0x90')](_0x16eefa)){this[_0x5e5d('0xd')][_0x5e5d('0x9a')](util[_0x5e5d('0x28')](_0x5e5d('0xfa'),_0x16eefa[_0x5e5d('0x68')]()),_0x25bf1d[_0x16eefa]);}}this[_0x5e5d('0x42')](_0x25bf1d['speech'],_0x5e5d('0xe7'),_0x5e5d('0xf4'),'');if(_0x25bf1d['audiofile']){this[_0x5e5d('0xd')][_0x5e5d('0xa4')](util[_0x5e5d('0x28')]('Sestek\x20NDA\x20%s\x20file\x20created',_0x25bf1d[_0x5e5d('0xfb')]));var _0x12ace3=this[_0x5e5d('0xd')]['streamFile'](_0x25bf1d[_0x5e5d('0xfb')]);try{fs[_0x5e5d('0xfc')](_0x25bf1d[_0x5e5d('0xfb')]+_0x5e5d('0xfd'));}catch(_0x25d5bb){logger[_0x5e5d('0x2b')](_0x25d5bb);}return _0x12ace3;}else{return this['channel']['noop'](util[_0x5e5d('0x28')](_0x5e5d('0xfe'),_0x25bf1d['speech']));}}return this['channel'][_0x5e5d('0x2b')](_0x285094,_0x5e5d('0xff'));};AGIVertices[_0x5e5d('0x13')]['end']=function(_0x19e800){logger[_0x5e5d('0x2d')](util[_0x5e5d('0x28')](_0x5e5d('0x100'),_0x19e800[_0x5e5d('0x39')]));return this['channel'][_0x5e5d('0xa4')](_0x5e5d('0x101'));};AGIVertices[_0x5e5d('0x13')]['ext_dial']=function(_0x522c4f){logger[_0x5e5d('0x2d')](util[_0x5e5d('0x28')](_0x5e5d('0x102'),_0x522c4f[_0x5e5d('0x39')]));var _0x242ac9='';if(_0x522c4f[_0x5e5d('0x103')]){if(!this[_0x5e5d('0x80')](_0x522c4f[_0x5e5d('0x103')])){return this[_0x5e5d('0xd')][_0x5e5d('0x2b')](_0x522c4f,'no\x20trunk\x20selected');}else{var _0x3bface=parseInt(_0x522c4f[_0x5e5d('0x103')],0xa);if(isNaN(_0x3bface)){_0x242ac9=_0x522c4f[_0x5e5d('0x103')];}else{_0x242ac9=this[_0x5e5d('0x1b')][_0x5e5d('0x6c')](this,_0x522c4f[_0x5e5d('0x103')]);if(!_0x242ac9){return this[_0x5e5d('0xd')]['error'](_0x522c4f,_0x5e5d('0x104'));}}}}else if(_0x522c4f[_0x5e5d('0x105')]){_0x242ac9=_0x522c4f['trunk_name'];}else{return this[_0x5e5d('0xd')][_0x5e5d('0x2b')](_0x522c4f,'no\x20trunk\x20selected');}var _0x33b653=this[_0x5e5d('0xd')]['exec']('DIAL',[util[_0x5e5d('0x28')]('SIP/%s/%s',_0x242ac9,_0x522c4f['phone']),_0x522c4f[_0x5e5d('0x64')],_0x522c4f[_0x5e5d('0xdf')],_0x522c4f[_0x5e5d('0x62')]]);if(_0x33b653[_0x5e5d('0x9d')]===-0x1){return _0x33b653;}return this[_0x5e5d('0xd')][_0x5e5d('0xa4')](util['format'](_0x5e5d('0xe0'),'DIAL'));};AGIVertices[_0x5e5d('0x13')]['finally']=function(_0x55ab11){logger[_0x5e5d('0x2d')](util[_0x5e5d('0x28')](_0x5e5d('0x106'),_0x55ab11[_0x5e5d('0x39')]));return this[_0x5e5d('0xd')][_0x5e5d('0xa4')](_0x5e5d('0x107'));};AGIVertices[_0x5e5d('0x13')][_0x5e5d('0xb')]=function(_0x2e855a){logger[_0x5e5d('0x2d')](util[_0x5e5d('0x28')](_0x5e5d('0x108'),_0x2e855a['label']));if(_0x2e855a['retry']===0x0){return this[_0x5e5d('0x109')](_0x2e855a);}_0x2e855a[_0x5e5d('0xa0')]-=0x1;if(!this[_0x5e5d('0x80')](_0x2e855a[_0x5e5d('0x10a')])){return this[_0x5e5d('0xd')][_0x5e5d('0x2b')](_0x2e855a,_0x5e5d('0x10b'));}var _0x2f6b09=this['getSound'][_0x5e5d('0x6c')](this,_0x2e855a[_0x5e5d('0x10a')]);if(!_0x2f6b09){return this[_0x5e5d('0xd')][_0x5e5d('0x2b')](_0x2e855a,_0x5e5d('0x10c'));}if(!this['isConfigured'](_0x2e855a[_0x5e5d('0xd2')])){return this['channel']['error']('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x33e9d4=this[_0x5e5d('0xd')]['getData'](_0x2f6b09,_0x2e855a[_0x5e5d('0x10d')],_0x2e855a[_0x5e5d('0x10e')]);var _0x5c70f1=_0x33e9d4[_0x5e5d('0x9d')]?_0x33e9d4[_0x5e5d('0x9d')][_0x5e5d('0x4b')]():'';logger[_0x5e5d('0x2d')](_0x5e5d('0x10f'),JSON[_0x5e5d('0x70')](_0x33e9d4));if(_0x33e9d4[_0x5e5d('0x9d')]===-0x1){this[_0x5e5d('0x37')][_0x5e5d('0x6c')](this,_0x2e855a,_0x5c70f1);return _0x33e9d4;}else if(_0x33e9d4[_0x5e5d('0x9f')]===_0x5e5d('0x64')){_0x33e9d4[_0x5e5d('0x9d')]=_0x5c70f1['length']>=parseInt(_0x2e855a[_0x5e5d('0x110')])?'x':'i';}else{_0x33e9d4[_0x5e5d('0x9d')]=_0x5c70f1['length']>=parseInt(_0x2e855a['mindigit'])&&_0x5c70f1[_0x5e5d('0x97')]<=parseInt(_0x2e855a[_0x5e5d('0x10e')])?'x':'i';}var _0x547b75=this[_0x5e5d('0xf')][_0x5e5d('0x6c')](this,_0x2e855a['variable_id']);if(!_0x547b75){return this['channel'][_0x5e5d('0x2b')](_0x2e855a,_0x5e5d('0xd4'));}this[_0x5e5d('0xd')]['setVariable'](_0x547b75,_0x5c70f1);if(this['isConfigured'](_0x2e855a['hiddendigitsnum'])){var _0x359bb7=parseInt(_0x2e855a[_0x5e5d('0x111')],0xa);var _0x5c92b3=rs[_0x5e5d('0x112')]({'charset':'*','length':_0x359bb7});var _0x58b62a=_0x5c70f1['length'];if(_0x58b62a>0x0){if(_0x58b62a>_0x359bb7){this['createSquareDetailsReport'][_0x5e5d('0x6c')](this,_0x2e855a,_0x2e855a[_0x5e5d('0x113')]==='first'?_0x5c92b3+_0x5c70f1[_0x5e5d('0x114')](_0x359bb7):_0x5c70f1[_0x5e5d('0x114')](0x0,_0x58b62a-_0x359bb7)+_0x5c92b3);}else{this[_0x5e5d('0x37')]['sync'](this,_0x2e855a,rs[_0x5e5d('0x112')]({'charset':'*','length':_0x58b62a}));}}else{this['createSquareDetailsReport'][_0x5e5d('0x6c')](this,_0x2e855a,'');}}else{this[_0x5e5d('0x37')][_0x5e5d('0x6c')](this,_0x2e855a,_0x5c70f1);}return _0x33e9d4;};AGIVertices[_0x5e5d('0x13')][_0x5e5d('0xc')]=function(_0x1f29fd){logger[_0x5e5d('0x2d')](util[_0x5e5d('0x28')]('Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block',_0x1f29fd[_0x5e5d('0x39')]));return this[_0x5e5d('0xb')](_0x1f29fd);};AGIVertices[_0x5e5d('0x13')][_0x5e5d('0x115')]=function(_0x5609f7){logger[_0x5e5d('0x2d')](util[_0x5e5d('0x28')](_0x5e5d('0x116'),_0x5609f7['label']));this[_0x5e5d('0x37')]['sync'](this,_0x5609f7,_0x5609f7['goalname']);return this[_0x5e5d('0xd')][_0x5e5d('0xa4')](util[_0x5e5d('0x28')]('GOAL\x20%s',_0x5609f7[_0x5e5d('0x117')]));};AGIVertices[_0x5e5d('0x13')][_0x5e5d('0x118')]=function(_0x48d8a6){logger[_0x5e5d('0x2d')](util['format'](_0x5e5d('0x119'),_0x48d8a6[_0x5e5d('0x39')]));if(!this[_0x5e5d('0x80')](_0x48d8a6[_0x5e5d('0x83')])||!this[_0x5e5d('0x80')](_0x48d8a6[_0x5e5d('0x84')])){return this[_0x5e5d('0xd')][_0x5e5d('0xa4')](_0x5e5d('0x11a'));}if(!this[_0x5e5d('0x80')](_0x48d8a6[_0x5e5d('0x5c')])){return this['channel'][_0x5e5d('0xa4')](_0x5e5d('0xa2'));}this[_0x5e5d('0xd')]['noop'](util[_0x5e5d('0x28')]('Trying\x20aws\x20Polly\x20%s',_0x48d8a6[_0x5e5d('0x5c')]));var _0x55d05d=this[_0x5e5d('0x82')][_0x5e5d('0x6c')](this,_0x48d8a6);if(_0x55d05d){this[_0x5e5d('0xd')]['noop'](util[_0x5e5d('0x28')](_0x5e5d('0x11b'),_0x55d05d));var _0x41f703=this['channel'][_0x5e5d('0x11c')](_0x55d05d);try{fs[_0x5e5d('0xfc')](_0x55d05d+_0x5e5d('0xfd'));}catch(_0x4b904f){logger[_0x5e5d('0x2b')](_0x4b904f);}return _0x41f703;}return this['channel']['error'](_0x48d8a6,_0x5e5d('0x11d'));};AGIVertices[_0x5e5d('0x13')][_0x5e5d('0x11e')]=function(_0x4a45b7){logger[_0x5e5d('0x2d')](util[_0x5e5d('0x28')](_0x5e5d('0x11f'),_0x4a45b7['label']));if(!this[_0x5e5d('0x80')](_0x4a45b7[_0x5e5d('0x83')])||!this['isConfigured'](_0x4a45b7[_0x5e5d('0x84')])){return this['channel'][_0x5e5d('0xa4')](_0x5e5d('0x11a'));}if(!this[_0x5e5d('0x80')](_0x4a45b7[_0x5e5d('0x8b')])){return this['channel'][_0x5e5d('0xa4')]('no\x20bot\x20name\x20configured');}if(!this[_0x5e5d('0x80')](_0x4a45b7[_0x5e5d('0x5c')])){return this['channel'][_0x5e5d('0xa4')](_0x5e5d('0xa2'));}this['channel'][_0x5e5d('0xe3')]=!![];this[_0x5e5d('0x37')](_0x4a45b7);this[_0x5e5d('0x42')](_0x4a45b7[_0x5e5d('0x5c')],'in','','');this['channel'][_0x5e5d('0xa4')](util[_0x5e5d('0x28')](_0x5e5d('0x120'),_0x4a45b7['text']));var _0x4bd641=this[_0x5e5d('0x89')][_0x5e5d('0x6c')](this,_0x4a45b7);if(_0x4bd641){for(var _0x19f4bd in _0x4bd641){if(_0x4bd641['hasOwnProperty'](_0x19f4bd)&&_[_0x5e5d('0x91')](_0x4bd641[_0x19f4bd])){this[_0x5e5d('0xd')][_0x5e5d('0x9a')](util[_0x5e5d('0x28')]('AWS_LEX_%s',_0x19f4bd[_0x5e5d('0x68')]()),_0x4bd641[_0x19f4bd]);}}if(_[_0x5e5d('0x44')](_0x4bd641['message'])){return this[_0x5e5d('0xd')]['noop'](_0x5e5d('0x121'));}else{this[_0x5e5d('0x42')](_0x4bd641[_0x5e5d('0x72')],'out',_0x5e5d('0x122'),'');return this[_0x5e5d('0xd')][_0x5e5d('0xa4')](util[_0x5e5d('0x28')](_0x5e5d('0x123'),_0x4bd641[_0x5e5d('0x72')]));}}return this[_0x5e5d('0xd')][_0x5e5d('0x2b')](_0x4a45b7,_0x5e5d('0x124'));};AGIVertices[_0x5e5d('0x13')][_0x5e5d('0x125')]=function(_0x1fac92){logger[_0x5e5d('0x2d')](util[_0x5e5d('0x28')]('Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s',_0x1fac92[_0x5e5d('0x39')],_0x1fac92[_0x5e5d('0x64')]));if(!this['isConfigured'](_0x1fac92[_0x5e5d('0x76')])){return this[_0x5e5d('0xd')]['noop'](_0x5e5d('0xe2'));}var _0x3a1c6c=_0x5e5d('0x126');var _0x47e944=util[_0x5e5d('0x28')](_0x5e5d('0x127'),FILES_PATH,rs['generate'](0x4));var _0x31e5e4=util[_0x5e5d('0x28')](_0x5e5d('0x98'),_0x47e944,_0x3a1c6c);var _0x374f94=!![];if(_0x1fac92[_0x5e5d('0x128')]==='NOBEEP'){_0x374f94=![];}var _0x4d735b=this[_0x5e5d('0xd')][_0x5e5d('0x129')](_0x47e944,_0x3a1c6c,_0x1fac92[_0x5e5d('0x12a')],_0x1fac92[_0x5e5d('0x64')],undefined,_0x374f94);if(_0x4d735b['result']!==-0x1){this[_0x5e5d('0xd')]['noop'](util[_0x5e5d('0x28')](_0x5e5d('0x12b'),_0x31e5e4));var _0xd47dcc=this[_0x5e5d('0x8c')][_0x5e5d('0x6c')](this,_0x1fac92,_0x31e5e4);if(_0xd47dcc){for(var _0x4d4a53 in _0xd47dcc){if(_0xd47dcc[_0x5e5d('0x90')](_0x4d4a53)){this[_0x5e5d('0xd')][_0x5e5d('0x9a')](util[_0x5e5d('0x28')](_0x5e5d('0x12c'),_0x4d4a53[_0x5e5d('0x68')]()),_0xd47dcc[_0x4d4a53]);}}return this[_0x5e5d('0xd')][_0x5e5d('0xa4')](util['format'](_0x5e5d('0x12d'),JSON[_0x5e5d('0x70')](_0xd47dcc)));}}return _0x4d735b;};AGIVertices[_0x5e5d('0x13')][_0x5e5d('0x12e')]=function(_0x30c81e){logger[_0x5e5d('0x2d')](util['format'](_0x5e5d('0x12f'),_0x30c81e[_0x5e5d('0x39')]));if(!this[_0x5e5d('0x80')](_0x30c81e[_0x5e5d('0x130')])){return this[_0x5e5d('0xd')]['noop'](_0x5e5d('0x131'));}if(!this[_0x5e5d('0x80')](_0x30c81e['appsecret'])){return this['channel'][_0x5e5d('0xa4')](_0x5e5d('0x132'));}var _0x5e2450=_0x5e5d('0x126');var _0x41f5b5=util[_0x5e5d('0x28')]('%s/recordings/%s',FILES_PATH,rs[_0x5e5d('0x112')](0x4));var _0x544c11=util[_0x5e5d('0x28')](_0x5e5d('0x98'),_0x41f5b5,_0x5e2450);var _0xdf95b1=!![];if(_0x30c81e['beep']===_0x5e5d('0x133')){_0xdf95b1=![];}var _0x4a9c97=this[_0x5e5d('0xd')]['recordFile'](_0x41f5b5,_0x5e2450,_0x30c81e[_0x5e5d('0x12a')],_0x30c81e[_0x5e5d('0x64')],undefined,_0xdf95b1);if(_0x4a9c97[_0x5e5d('0x9d')]!==-0x1){this[_0x5e5d('0xd')][_0x5e5d('0xa4')](util[_0x5e5d('0x28')]('tilde\x20%s\x20file\x20created',_0x544c11));var _0x55ada2=this[_0x5e5d('0x8d')][_0x5e5d('0x6c')](this,_0x30c81e,_0x544c11);if(_0x55ada2){for(var _0x4137c1 in _0x55ada2){if(_0x55ada2[_0x5e5d('0x90')](_0x4137c1)){this[_0x5e5d('0xd')][_0x5e5d('0x9a')](util[_0x5e5d('0x28')](_0x5e5d('0x134'),_0x4137c1[_0x5e5d('0x68')]()),_0x55ada2[_0x4137c1]);}}return this[_0x5e5d('0xd')]['noop'](util[_0x5e5d('0x28')](_0x5e5d('0x135'),JSON['stringify'](_0x55ada2)));}}return _0x4a9c97;};AGIVertices[_0x5e5d('0x13')][_0x5e5d('0x136')]=function(_0x3a58fb){logger[_0x5e5d('0x2d')](util[_0x5e5d('0x28')]('Enter\x20in\x20GOTO\x20(%s)\x20block',_0x3a58fb['label']));return this[_0x5e5d('0xd')][_0x5e5d('0x137')](_0x3a58fb[_0x5e5d('0x3c')],_0x3a58fb[_0x5e5d('0x3d')],_0x3a58fb[_0x5e5d('0x3e')]);};AGIVertices[_0x5e5d('0x13')][_0x5e5d('0x138')]=function(_0xc8aa78){logger[_0x5e5d('0x2d')](util[_0x5e5d('0x28')](_0x5e5d('0x139'),_0xc8aa78['label']));if(!this[_0x5e5d('0x80')](_0xc8aa78['condition'])){return this['channel'][_0x5e5d('0x2b')](_0xc8aa78,'no\x20condition\x20configured');}try{var _0x4376d4=eval(_0xc8aa78[_0x5e5d('0x13a')])?'true':_0x5e5d('0x13b');this[_0x5e5d('0xd')][_0x5e5d('0xa4')](util[_0x5e5d('0x28')](_0x5e5d('0x13c'),_0xc8aa78[_0x5e5d('0x13a')],_0x4376d4));return{'code':0xc8,'result':_0x4376d4};}catch(_0x159950){return{'code':0xc8,'result':'false'};}};AGIVertices[_0x5e5d('0x13')][_0x5e5d('0x13d')]=function(_0x30593d){logger[_0x5e5d('0x2d')](util[_0x5e5d('0x28')]('Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block',_0x30593d['label']));if(!this[_0x5e5d('0x80')](_0x30593d[_0x5e5d('0x13e')])){return this[_0x5e5d('0xd')][_0x5e5d('0x2b')](_0x30593d,_0x5e5d('0x13f'));}var _0x3c365a=this[_0x5e5d('0x23')][_0x5e5d('0x6c')](this,_0x30593d['interval_id']);if(!_0x3c365a){return this[_0x5e5d('0xd')]['error'](_0x30593d,_0x5e5d('0x140'));}for(var _0x344a71=0x0;_0x344a71<_0x3c365a[_0x5e5d('0x97')];_0x344a71+=0x1){var _0x56f8de=this[_0x5e5d('0xd')]['getVariable'](util[_0x5e5d('0x28')](_0x5e5d('0x141'),_0x3c365a[_0x344a71]));if(_0x56f8de[_0x5e5d('0x9d')]===-0x1){return _0x56f8de;}logger[_0x5e5d('0x2d')](util[_0x5e5d('0x28')](_0x5e5d('0x142'),_0x3c365a[_0x344a71],_0x56f8de['extra']));if(_0x56f8de[_0x5e5d('0x9f')]===_0x5e5d('0x143')){logger[_0x5e5d('0x2d')](util[_0x5e5d('0x28')](_0x5e5d('0x142'),_0x3c365a[_0x344a71],'true'));this['channel'][_0x5e5d('0xa4')](util['format']('IFTIME\x20%s\x20%s',_0x3c365a[_0x344a71],_0x5e5d('0x143')));return{'code':0xc8,'result':_0x5e5d('0x143')};}else{logger[_0x5e5d('0x2d')](util['format'](_0x5e5d('0x142'),_0x3c365a[_0x344a71],'false'));this['channel'][_0x5e5d('0xa4')](util['format'](_0x5e5d('0x142'),_0x3c365a[_0x344a71],_0x5e5d('0x13b')));}}return{'code':0xc8,'result':'false'};};AGIVertices[_0x5e5d('0x13')][_0x5e5d('0x144')]=function(_0x230133){logger[_0x5e5d('0x2d')](util[_0x5e5d('0x28')](_0x5e5d('0x145'),_0x230133[_0x5e5d('0x39')]));return this[_0x5e5d('0xd')]['hangup']();};AGIVertices[_0x5e5d('0x13')][_0x5e5d('0x146')]=function(_0x440181){logger['info'](util[_0x5e5d('0x28')](_0x5e5d('0x147'),_0x440181['label']));if(!this[_0x5e5d('0x80')](_0x440181[_0x5e5d('0x76')])){return this[_0x5e5d('0xd')]['noop'](_0x5e5d('0xe2'));}var _0x211efe='wav';var _0x54edfa=util[_0x5e5d('0x28')]('%s/recordings/%s',FILES_PATH,rs[_0x5e5d('0x112')](0x4));var _0x30817a=util['format'](_0x5e5d('0x98'),_0x54edfa,_0x211efe);var _0x45e0aa=!![];if(_0x440181[_0x5e5d('0x128')]===_0x5e5d('0x133')){_0x45e0aa=![];}var _0x55b5da=this[_0x5e5d('0xd')][_0x5e5d('0x129')](_0x54edfa,_0x211efe,_0x440181['intKey'],_0x440181['timeout'],undefined,_0x45e0aa);if(_0x55b5da['result']!==-0x1){this['channel'][_0x5e5d('0xa4')](util[_0x5e5d('0x28')](_0x5e5d('0x148'),_0x30817a));var _0x47dad9=this[_0x5e5d('0x7e')][_0x5e5d('0x6c')](this,_0x440181,_0x30817a);if(_0x47dad9){for(var _0x430ac9 in _0x47dad9){if(_0x47dad9['hasOwnProperty'](_0x430ac9)){this[_0x5e5d('0xd')][_0x5e5d('0x9a')](util['format'](_0x5e5d('0x149'),_0x430ac9[_0x5e5d('0x68')]()),_0x47dad9[_0x430ac9]);}}return this['channel'][_0x5e5d('0xa4')](util['format']('IspeechASR\x20Result\x20%s',JSON[_0x5e5d('0x70')](_0x47dad9)));}}return _0x55b5da;};AGIVertices['prototype']['ispeechtts']=function(_0x370778){logger[_0x5e5d('0x2d')](util[_0x5e5d('0x28')]('Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block',_0x370778[_0x5e5d('0x39')]));if(!this[_0x5e5d('0x80')](_0x370778[_0x5e5d('0x76')])){return this[_0x5e5d('0xd')][_0x5e5d('0xa4')](_0x5e5d('0xe2'));}if(!this[_0x5e5d('0x80')](_0x370778['text'])){return this[_0x5e5d('0xd')]['noop'](_0x5e5d('0xa2'));}this[_0x5e5d('0xd')][_0x5e5d('0xa4')](util[_0x5e5d('0x28')]('Trying\x20ispeech\x20TTS\x20%s',_0x370778['text']));var _0x188711=this['ispeechTTS'][_0x5e5d('0x6c')](this,_0x370778);if(_0x188711){this['channel'][_0x5e5d('0xa4')](util[_0x5e5d('0x28')](_0x5e5d('0x148'),_0x188711));var _0x444288=this[_0x5e5d('0xd')][_0x5e5d('0x11c')](_0x188711,_0x370778[_0x5e5d('0x12a')]);try{fs[_0x5e5d('0xfc')](_0x188711+'.wav');}catch(_0x30af2b){logger[_0x5e5d('0x2b')](_0x30af2b);}return _0x444288;}return this[_0x5e5d('0xd')]['error'](_0x370778,_0x5e5d('0x14a'));};AGIVertices[_0x5e5d('0x13')]['login']=function(_0x1ddbe5){logger['info'](util['format'](_0x5e5d('0x14b'),_0x1ddbe5[_0x5e5d('0x39')]));if(!this['isConfigured'](_0x1ddbe5[_0x5e5d('0x14c')])){return this[_0x5e5d('0xd')][_0x5e5d('0x2b')](_0x1ddbe5,_0x5e5d('0x14d'));}logger['info'](util[_0x5e5d('0x28')](_0x5e5d('0x14e'),this[_0x5e5d('0xd')][_0x5e5d('0x3a')],_0x1ddbe5[_0x5e5d('0x14c')]));var _0x3588f8=this[_0x5e5d('0x52')][_0x5e5d('0x6c')](this,_0x1ddbe5['findBy']);if(_0x3588f8){logger['info'](util[_0x5e5d('0x28')](_0x5e5d('0x14f'),this['channel'][_0x5e5d('0x3a')],_0x1ddbe5['findBy']));this[_0x5e5d('0xd')]['noop'](util[_0x5e5d('0x28')](_0x5e5d('0x14f'),this[_0x5e5d('0xd')]['callerid'],_0x1ddbe5[_0x5e5d('0x14c')]));return{'code':0xc8,'result':_0x5e5d('0x150')};}else{logger[_0x5e5d('0x2d')](util[_0x5e5d('0x28')](_0x5e5d('0x151'),this['channel'][_0x5e5d('0x3a')],_0x1ddbe5[_0x5e5d('0x14c')]));this[_0x5e5d('0xd')][_0x5e5d('0xa4')](util[_0x5e5d('0x28')](_0x5e5d('0x151'),this[_0x5e5d('0xd')][_0x5e5d('0x3a')],_0x1ddbe5[_0x5e5d('0x14c')]));return{'code':0xc8,'result':_0x5e5d('0x152')};}};AGIVertices[_0x5e5d('0x13')][_0x5e5d('0x153')]=function(_0x12c5cd){logger[_0x5e5d('0x2d')](util[_0x5e5d('0x28')](_0x5e5d('0x154'),_0x12c5cd[_0x5e5d('0x39')]));if(!this[_0x5e5d('0x80')](_0x12c5cd[_0x5e5d('0x14c')])){return this[_0x5e5d('0xd')][_0x5e5d('0x2b')](_0x12c5cd,_0x5e5d('0x14d'));}logger[_0x5e5d('0x2d')](util[_0x5e5d('0x28')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0x5e5d('0xd')]['callerid'],_0x12c5cd['findBy']));var _0x54e323=this[_0x5e5d('0x51')][_0x5e5d('0x6c')](this,_0x12c5cd['findBy']);if(_0x54e323){logger[_0x5e5d('0x2d')](util[_0x5e5d('0x28')](_0x5e5d('0x14f'),this[_0x5e5d('0xd')]['callerid'],_0x12c5cd[_0x5e5d('0x14c')]));this['channel']['noop'](util['format'](_0x5e5d('0x14f'),this[_0x5e5d('0xd')][_0x5e5d('0x3a')],_0x12c5cd[_0x5e5d('0x14c')]));return{'code':0xc8,'result':'success'};}else{logger['info'](util[_0x5e5d('0x28')](_0x5e5d('0x151'),this[_0x5e5d('0xd')][_0x5e5d('0x3a')],_0x12c5cd[_0x5e5d('0x14c')]));this[_0x5e5d('0xd')][_0x5e5d('0xa4')](util[_0x5e5d('0x28')](_0x5e5d('0x151'),this[_0x5e5d('0xd')][_0x5e5d('0x3a')],_0x12c5cd[_0x5e5d('0x14c')]));return{'code':0xc8,'result':_0x5e5d('0x152')};}};AGIVertices[_0x5e5d('0x13')][_0x5e5d('0x155')]=function(_0x4891a3){logger[_0x5e5d('0x2d')](util['format'](_0x5e5d('0x156'),_0x4891a3[_0x5e5d('0x39')]));if(!this[_0x5e5d('0x80')](_0x4891a3['operation'])){return this['channel'][_0x5e5d('0x2b')](_0x4891a3,_0x5e5d('0x157'));}this[_0x5e5d('0xd')][_0x5e5d('0xa4')](util['format']('math\x20%s',_0x4891a3[_0x5e5d('0x158')]));var _0x2513dc=eval(_0x4891a3[_0x5e5d('0x158')]);if(!this['isConfigured'](_0x4891a3[_0x5e5d('0xd2')])){return this[_0x5e5d('0xd')][_0x5e5d('0xa4')](_0x5e5d('0xd3'));}var _0x3ce821=this[_0x5e5d('0xf')]['sync'](this,_0x4891a3['variable_id']);if(!_0x3ce821){return this[_0x5e5d('0xd')]['error'](_0x4891a3,_0x5e5d('0xd4'));}if(_[_0x5e5d('0x96')](_0x2513dc)){var _0x3c46a3=this;_0x2513dc[_0x5e5d('0xd5')](function(_0xdaf096,_0xd653ce){_0x3c46a3[_0x5e5d('0xd')][_0x5e5d('0x9a')](util[_0x5e5d('0x28')](_0x5e5d('0x159'),_0x3ce821,_0xd653ce),_0xdaf096);});return this[_0x5e5d('0xd')][_0x5e5d('0xa4')](util[_0x5e5d('0x28')](_0x5e5d('0x15a'),_0x3ce821));}else{return this[_0x5e5d('0xd')]['setVariable'](_0x3ce821,_0x2513dc);}};AGIVertices[_0x5e5d('0x13')][_0x5e5d('0xa')]=function(_0x39d080){logger[_0x5e5d('0x2d')](util[_0x5e5d('0x28')](_0x5e5d('0x15b'),_0x39d080[_0x5e5d('0x39')]));if(_0x39d080[_0x5e5d('0xa0')]===0x0){return this[_0x5e5d('0x109')](_0x39d080);}_0x39d080[_0x5e5d('0xa0')]-=0x1;if(!this[_0x5e5d('0x80')](_0x39d080['file_id'])){return this[_0x5e5d('0xd')][_0x5e5d('0x2b')](_0x39d080,_0x5e5d('0x10b'));}var _0x35c758=this[_0x5e5d('0x1d')][_0x5e5d('0x6c')](this,_0x39d080[_0x5e5d('0x10a')]);if(!_0x35c758){return this[_0x5e5d('0xd')][_0x5e5d('0x2b')](_0x39d080,'no\x20file\x20audio\x20found');}var _0x92ab8b=this[_0x5e5d('0xd')][_0x5e5d('0x15c')](_0x35c758,_0x39d080[_0x5e5d('0x10d')],_0x39d080[_0x5e5d('0x15d')]);var _0x2624c6=_0x92ab8b[_0x5e5d('0x9d')];if(_0x92ab8b['result']===-0x1){this[_0x5e5d('0x37')][_0x5e5d('0x6c')](this,_0x39d080,'-1');return _0x92ab8b;}else if(_0x92ab8b[_0x5e5d('0x9f')]===_0x5e5d('0x64')){_0x92ab8b[_0x5e5d('0x9d')]=_0x92ab8b[_0x5e5d('0x9d')][_0x5e5d('0x97')]>0x0?_0x92ab8b[_0x5e5d('0x9d')]:'t';}else if(_[_0x5e5d('0x46')](_0x92ab8b[_0x5e5d('0x9d')])){_0x92ab8b[_0x5e5d('0x9d')]='#';_0x2624c6='#';}if(!this['isConfigured'](_0x39d080['variable_id'])){this['channel'][_0x5e5d('0xa4')](_0x5e5d('0xd3'));}else{var _0x3b0751=this[_0x5e5d('0xf')][_0x5e5d('0x6c')](this,_0x39d080[_0x5e5d('0xd2')]);if(!_0x3b0751){return this[_0x5e5d('0xd')][_0x5e5d('0x2b')](_0x39d080,_0x5e5d('0xd4'));}this[_0x5e5d('0xd')][_0x5e5d('0x9a')](_0x3b0751,_0x2624c6);}this[_0x5e5d('0x37')][_0x5e5d('0x6c')](this,_0x39d080,_0x2624c6);return _0x92ab8b;};AGIVertices[_0x5e5d('0x13')][_0x5e5d('0xa4')]=function(_0x216c95){logger[_0x5e5d('0x2d')](util[_0x5e5d('0x28')](_0x5e5d('0x15e'),_0x216c95[_0x5e5d('0x39')]));return this[_0x5e5d('0xd')][_0x5e5d('0xa4')](_0x216c95[_0x5e5d('0x15f')]||_0x216c95['label']);};AGIVertices[_0x5e5d('0x13')][_0x5e5d('0x160')]=function(_0x390fd8){logger[_0x5e5d('0x2d')](util[_0x5e5d('0x28')](_0x5e5d('0x161'),_0x390fd8[_0x5e5d('0x39')]));if(!this[_0x5e5d('0x80')](_0x390fd8[_0x5e5d('0x14c')])){return this['channel'][_0x5e5d('0x2b')](_0x390fd8,_0x5e5d('0x14d'));}logger['info'](util[_0x5e5d('0x28')](_0x5e5d('0x14e'),this[_0x5e5d('0xd')]['callerid'],_0x390fd8[_0x5e5d('0x14c')]));var _0x399012=this[_0x5e5d('0x4c')]['sync'](this,_0x390fd8[_0x5e5d('0x162')]);var _0xa44be9=this[_0x5e5d('0x4e')][_0x5e5d('0x6c')](this,_0x390fd8['findBy'],_0x399012);if(_0xa44be9){logger[_0x5e5d('0x2d')](util[_0x5e5d('0x28')]('AGENT\x20%s\x20FOUND\x20BY',this['channel'][_0x5e5d('0x3a')],_0x390fd8[_0x5e5d('0x14c')]));this['channel'][_0x5e5d('0xa4')](util[_0x5e5d('0x28')](_0x5e5d('0x14f'),this['channel']['callerid'],_0x390fd8[_0x5e5d('0x14c')]));return{'code':0xc8,'result':_0x5e5d('0x150')};}else{logger[_0x5e5d('0x2d')](util['format'](_0x5e5d('0x151'),this[_0x5e5d('0xd')]['callerid'],_0x390fd8[_0x5e5d('0x14c')]));this[_0x5e5d('0xd')][_0x5e5d('0xa4')](util[_0x5e5d('0x28')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x5e5d('0xd')][_0x5e5d('0x3a')],_0x390fd8[_0x5e5d('0x14c')]));return{'code':0xc8,'result':_0x5e5d('0x152')};}};AGIVertices[_0x5e5d('0x13')][_0x5e5d('0x163')]=function(_0x36a567){logger['info'](util[_0x5e5d('0x28')](_0x5e5d('0x164'),_0x36a567[_0x5e5d('0x39')]));if(!this[_0x5e5d('0x80')](_0x36a567[_0x5e5d('0x10a')])){return this[_0x5e5d('0xd')][_0x5e5d('0x2b')](_0x36a567,_0x5e5d('0x10b'));}var _0x2c0364=this[_0x5e5d('0x1d')][_0x5e5d('0x6c')](this,_0x36a567[_0x5e5d('0x10a')]);if(!_0x2c0364){return this['channel']['error'](_0x36a567,_0x5e5d('0x10c'));}var _0x23f171=this['channel'][_0x5e5d('0x56')](_0x5e5d('0x165'),[_0x2c0364,_0x36a567[_0x5e5d('0xdf')]]);if(_0x23f171[_0x5e5d('0x9d')]===-0x1){return _0x23f171;}return this['channel'][_0x5e5d('0xa4')](util[_0x5e5d('0x28')](_0x5e5d('0xbe'),_0x5e5d('0x165'),_0x2c0364));};AGIVertices['prototype'][_0x5e5d('0x166')]=function(_0x25c89e){logger[_0x5e5d('0x2d')](util[_0x5e5d('0x28')](_0x5e5d('0x167'),_0x25c89e[_0x5e5d('0x39')]));if(!this[_0x5e5d('0x80')](_0x25c89e['queue_id'])){return this[_0x5e5d('0xd')][_0x5e5d('0x2b')](_0x25c89e,_0x5e5d('0x168'));}var _0x28cdf4='';var _0x31e2ca=parseInt(_0x25c89e[_0x5e5d('0x169')],0xa);if(isNaN(_0x31e2ca)){_0x28cdf4=_0x25c89e[_0x5e5d('0x169')];}else{_0x28cdf4=this[_0x5e5d('0x16a')]['sync'](this,_0x25c89e[_0x5e5d('0x169')]);if(!_0x28cdf4){return this['channel'][_0x5e5d('0x2b')](_0x25c89e,_0x5e5d('0x16b'));}}var _0x1eabeb='';if(this[_0x5e5d('0x80')](_0x25c89e[_0x5e5d('0x10a')])){var _0xb55762=this['getSound'][_0x5e5d('0x6c')](this,_0x25c89e[_0x5e5d('0x10a')]);if(_0xb55762){_0x1eabeb=_0xb55762;}}this[_0x5e5d('0x37')]['sync'](this,_0x25c89e,_0x28cdf4);if(_0x25c89e[_0x5e5d('0xdf')]['indexOf']('x')<0x0){_0x25c89e[_0x5e5d('0xdf')]+='x';}if(_0x25c89e[_0x5e5d('0xdf')][_0x5e5d('0x16c')]('X')<0x0){_0x25c89e[_0x5e5d('0xdf')]+='X';}this[_0x5e5d('0xd')][_0x5e5d('0x9a')](_0x5e5d('0x16d'),_0x28cdf4?_0x28cdf4[_0x5e5d('0x16e')]():'');var _0x549f1d=this[_0x5e5d('0xd')][_0x5e5d('0x56')](_0x5e5d('0x16f'),[_0x28cdf4,_0x25c89e[_0x5e5d('0xdf')],_0x25c89e[_0x5e5d('0x62')],_0x1eabeb,_0x25c89e[_0x5e5d('0x64')],_0x25c89e[_0x5e5d('0x4')],_0x25c89e[_0x5e5d('0x170')],_0x25c89e['gosub'],'',_0x25c89e[_0x5e5d('0x171')]]);if(_0x549f1d[_0x5e5d('0x9d')]===-0x1){return _0x549f1d;}return this['channel'][_0x5e5d('0xa4')](util[_0x5e5d('0x28')](_0x5e5d('0xbe'),_0x5e5d('0x16f'),_0x28cdf4));};AGIVertices[_0x5e5d('0x13')][_0x5e5d('0x172')]=function(_0x598940){logger[_0x5e5d('0x2d')](util[_0x5e5d('0x28')]('Enter\x20in\x20RECORD\x20(%s)\x20block',_0x598940[_0x5e5d('0x39')]));var _0x3181e0=_0x598940['recordingFormat']||_0x5e5d('0x126');var _0x1b091a=util['format']('%s_%s',this['channel'][_0x5e5d('0x38')],rs[_0x5e5d('0x112')](0x5));var _0x3804b5=util[_0x5e5d('0x28')](_0x5e5d('0x173'),FILES_PATH,_0x1b091a,_0x3181e0);var _0x320d5e=util['format'](_0x5e5d('0x127'),FILES_PATH,_0x1b091a);this['createSquareRecording'][_0x5e5d('0x6c')](this,_0x598940,_0x1b091a,_0x3804b5);this[_0x5e5d('0xd')]['setVariable']('RECORDING_SAVENAME',_0x1b091a);logger[_0x5e5d('0x2d')](_0x5e5d('0x174'),_0x320d5e,_0x3181e0,_0x598940[_0x5e5d('0x175')],_0x598940[_0x5e5d('0x64')]);return this[_0x5e5d('0xd')][_0x5e5d('0x129')](_0x320d5e,_0x3181e0,_0x598940['escape_digits'],_0x598940[_0x5e5d('0x64')],undefined,!![]);};AGIVertices[_0x5e5d('0x13')][_0x5e5d('0x176')]=function(_0x5ecc33){logger[_0x5e5d('0x2d')](util['format'](_0x5e5d('0x177'),_0x5ecc33[_0x5e5d('0x39')]));if(!this['isConfigured'](_0x5ecc33['url'])){return this[_0x5e5d('0xd')]['noop'](_0x5e5d('0x178'));}var _0x36a7a4=this[_0x5e5d('0x61')][_0x5e5d('0x6c')](this,_0x5ecc33);logger[_0x5e5d('0x2d')](util[_0x5e5d('0x28')](_0x5e5d('0x179'),util[_0x5e5d('0x17a')](_0x36a7a4,{'showHidden':![],'depth':null})));if(!this['isConfigured'](_0x5ecc33['variable_id'])){return this[_0x5e5d('0xd')][_0x5e5d('0xa4')](_0x5e5d('0x17b'));}var _0x1cb4b1=this[_0x5e5d('0xf')]['sync'](this,_0x5ecc33[_0x5e5d('0xd2')]);if(!_0x1cb4b1){return this[_0x5e5d('0xd')]['error'](_0x5ecc33,_0x5e5d('0xd4'));}this[_0x5e5d('0xd')]['setVariable'](util[_0x5e5d('0x28')]('%s_STATUS_CODE',_0x1cb4b1),_0x36a7a4['statusCode']?_0x36a7a4[_0x5e5d('0x71')]:_0x5e5d('0x17c'));this[_0x5e5d('0xd')][_0x5e5d('0x9a')](util[_0x5e5d('0x28')](_0x5e5d('0x17d'),_0x1cb4b1),_0x36a7a4[_0x5e5d('0x17e')]?_0x36a7a4[_0x5e5d('0x17e')]:'OK');if(_0x36a7a4['body']){try{this[_0x5e5d('0x99')](_0x36a7a4[_0x5e5d('0x69')],_0x1cb4b1);}catch(_0x57f467){logger[_0x5e5d('0x2b')](util[_0x5e5d('0x28')](_0x5e5d('0x17f'),_0x1cb4b1));}}return this[_0x5e5d('0xd')][_0x5e5d('0xa4')](util[_0x5e5d('0x28')](_0x5e5d('0x180'),_0x1cb4b1));};AGIVertices[_0x5e5d('0x13')][_0x5e5d('0x181')]=function(_0x3c55c5){logger[_0x5e5d('0x2d')](util[_0x5e5d('0x28')](_0x5e5d('0x182'),_0x3c55c5[_0x5e5d('0x39')]));return this[_0x5e5d('0xd')]['sayDigits'](_0x3c55c5[_0x5e5d('0x183')]['replace'](/\s+/g,''),_0x3c55c5[_0x5e5d('0x175')]);};AGIVertices[_0x5e5d('0x13')][_0x5e5d('0x184')]=function(_0x490715){logger[_0x5e5d('0x2d')](util[_0x5e5d('0x28')](_0x5e5d('0x185'),_0x490715[_0x5e5d('0x39')]));return this[_0x5e5d('0xd')][_0x5e5d('0x186')](_0x490715['number']['replace'](/\s+/g,''),_0x490715[_0x5e5d('0x175')]);};AGIVertices[_0x5e5d('0x13')][_0x5e5d('0x187')]=function(_0x1c8ce6){logger[_0x5e5d('0x2d')](util[_0x5e5d('0x28')](_0x5e5d('0x188'),_0x1c8ce6[_0x5e5d('0x39')]));return this[_0x5e5d('0xd')][_0x5e5d('0x189')](_0x1c8ce6['text'],_0x1c8ce6['escape_digits']);};AGIVertices[_0x5e5d('0x13')][_0x5e5d('0x18a')]=function(_0x4eb355){logger['info'](util[_0x5e5d('0x28')](_0x5e5d('0x18b'),_0x4eb355['label']));if(!this[_0x5e5d('0x80')](_0x4eb355[_0x5e5d('0x18c')])){return this[_0x5e5d('0xd')][_0x5e5d('0xa4')](_0x5e5d('0x18d'));}var _0x284b8f=this[_0x5e5d('0x21')][_0x5e5d('0x6c')](this,_0x4eb355[_0x5e5d('0x18c')]);if(!_0x284b8f||!_0x284b8f[_0x5e5d('0x18e')]){return this[_0x5e5d('0xd')][_0x5e5d('0x2b')](_0x4eb355,_0x5e5d('0x18f'));}var _0x54ad26={'from':util[_0x5e5d('0x28')]('\x22%s\x22\x20<%s>',_0x284b8f[_0x5e5d('0x17')],_0x284b8f[_0x5e5d('0x190')]||_0x284b8f[_0x5e5d('0x18e')][_0x5e5d('0x191')]),'to':_0x4eb355['to']||'','cc':_0x4eb355['cc']||'','bcc':_0x4eb355['bcc']||'','subject':_0x4eb355[_0x5e5d('0x192')],'html':_0x4eb355['text'],'text':_0x4eb355[_0x5e5d('0x5c')]};if(this['isConfigured'](_0x4eb355[_0x5e5d('0x193')])){}logger[_0x5e5d('0xd9')]('sendMail\x20message',JSON[_0x5e5d('0x70')](_0x54ad26));this['createSquareDetailsReport'][_0x5e5d('0x6c')](this,_0x4eb355,_0x4eb355[_0x5e5d('0x18c')]);this[_0x5e5d('0xd')][_0x5e5d('0xa4')](util[_0x5e5d('0x28')](_0x5e5d('0x194'),_0x284b8f[_0x5e5d('0x17')]));this[_0x5e5d('0x22')][_0x5e5d('0x6c')](this,_0x284b8f[_0x5e5d('0x195')],_0x54ad26);return this[_0x5e5d('0xd')][_0x5e5d('0xa4')]('Mail\x20message\x20added\x20to\x20outgoing\x20process');};AGIVertices[_0x5e5d('0x13')]['sendFax']=function(_0x4c69f2){logger[_0x5e5d('0x2d')](util['format']('Enter\x20in\x20SENDFAX\x20(%s)\x20block',_0x4c69f2[_0x5e5d('0x39')]));return this[_0x5e5d('0xd')][_0x5e5d('0xa4')]('SENDFAX\x20block\x20not\x20implemented');};AGIVertices[_0x5e5d('0x13')][_0x5e5d('0x196')]=function(_0x400795){logger[_0x5e5d('0x2d')](util[_0x5e5d('0x28')](_0x5e5d('0x197'),_0x400795[_0x5e5d('0x39')]));if(!this['isConfigured'](_0x400795['sms_account_id'])){return this[_0x5e5d('0xd')]['noop'](_0x5e5d('0x198'));}var _0x104cc8=this['getSmsAccount']['sync'](this,_0x400795['sms_account_id']);if(!_0x104cc8){return this[_0x5e5d('0xd')]['error'](_0x400795,_0x5e5d('0x199'));}var _0x1dc363={'body':_0x400795[_0x5e5d('0x19a')],'phone':_0x400795['to']||'','SmsAccountId':_0x104cc8['id']};logger[_0x5e5d('0xd9')]('sendSMS\x20message',JSON[_0x5e5d('0x70')](_0x1dc363));this[_0x5e5d('0x37')][_0x5e5d('0x6c')](this,_0x400795,_0x400795[_0x5e5d('0x19b')]);this[_0x5e5d('0xd')][_0x5e5d('0xa4')](util[_0x5e5d('0x28')](_0x5e5d('0x19c'),_0x104cc8[_0x5e5d('0x17')]));this[_0x5e5d('0x36')][_0x5e5d('0x6c')](this,_0x1dc363);return this[_0x5e5d('0xd')][_0x5e5d('0xa4')](_0x5e5d('0x19d'));};AGIVertices[_0x5e5d('0x13')][_0x5e5d('0x19e')]=function(_0x5446fd){logger['info'](util[_0x5e5d('0x28')](_0x5e5d('0x19f'),_0x5446fd[_0x5e5d('0x39')]));if(!this[_0x5e5d('0x80')](_0x5446fd[_0x5e5d('0xd2')])){return this[_0x5e5d('0xd')][_0x5e5d('0x2b')](_0x5446fd,'no\x20variable\x20selected');}var _0x2c39c9=this[_0x5e5d('0xf')]['sync'](this,_0x5446fd[_0x5e5d('0xd2')]);if(!_0x2c39c9){return this['channel'][_0x5e5d('0x2b')](_0x5446fd,'no\x20variable\x20found');}return this[_0x5e5d('0xd')][_0x5e5d('0x9a')](_0x2c39c9,_0x5446fd[_0x5e5d('0x1a0')]);};AGIVertices['prototype']['start']=function(_0x2b4a18){logger['info'](util[_0x5e5d('0x28')](_0x5e5d('0x1a1'),_0x2b4a18[_0x5e5d('0x39')]));this[_0x5e5d('0xd')][_0x5e5d('0xa4')]('START\x20CALLY\x20SQUARE');var _0x3f92e6=this[_0x5e5d('0xd')][_0x5e5d('0xf')]('XMCS-UNIQUEID');if(!_[_0x5e5d('0x46')](_0x3f92e6[_0x5e5d('0x9f')])){this[_0x5e5d('0xd')][_0x5e5d('0x38')]=_0x3f92e6['extra'];}if(_0x2b4a18[_0x5e5d('0xb2')]===_0x5e5d('0x1a2')){this[_0x5e5d('0xd')]['noop']('Answer');return this[_0x5e5d('0xd')][_0x5e5d('0xb2')]();}return this[_0x5e5d('0xd')]['noop'](_0x5e5d('0x1a3'));};AGIVertices[_0x5e5d('0x13')]['subproject']=function(_0x163052){logger[_0x5e5d('0x2d')](util[_0x5e5d('0x28')](_0x5e5d('0x1a4'),_0x163052[_0x5e5d('0x39')]));if(!this[_0x5e5d('0x80')](_0x163052['project_id'])){return this[_0x5e5d('0xd')]['error'](_0x163052,'no\x20subproject\x20selected');}var _0x53d627=this[_0x5e5d('0x15')][_0x5e5d('0x6c')](this,_0x163052[_0x5e5d('0x1a5')]);if(!this['isConfigured'](_0x53d627)){return this[_0x5e5d('0xd')][_0x5e5d('0x2b')](_0x163052,util['format'](_0x5e5d('0x1a6'),_0x163052[_0x5e5d('0x1a5')]));}if(_0x53d627===this[_0x5e5d('0xd')]['arg_1']){return this[_0x5e5d('0xd')][_0x5e5d('0x2b')](_0x163052,_0x5e5d('0x1a7'));}this[_0x5e5d('0x37')][_0x5e5d('0x6c')](this,_0x163052,_0x53d627);var _0x3f9a34=this[_0x5e5d('0xd')]['exec'](_0x5e5d('0x1a8'),util[_0x5e5d('0x28')](_0x5e5d('0x1a9'),config[_0x5e5d('0x4')][_0x5e5d('0x1aa')]||_0x5e5d('0x1ab'),_0x53d627,this[_0x5e5d('0xd')][_0x5e5d('0x40')]));if(_0x3f9a34['result']===-0x1){return _0x3f9a34;}return this[_0x5e5d('0xd')][_0x5e5d('0xa4')](util[_0x5e5d('0x28')](_0x5e5d('0xbe'),_0x5e5d('0x1a8'),_0x53d627));};AGIVertices[_0x5e5d('0x13')]['system']=function(_0x105b93){logger[_0x5e5d('0x2d')](util['format'](_0x5e5d('0x1ac'),_0x105b93[_0x5e5d('0x39')]));var _0x547fa3=this[_0x5e5d('0x55')][_0x5e5d('0x6c')](this,_0x105b93[_0x5e5d('0x1ad')]);this[_0x5e5d('0x37')][_0x5e5d('0x6c')](this,_0x105b93,_0x105b93[_0x5e5d('0x1ad')]);if(this['isConfigured'](_0x105b93[_0x5e5d('0xd2')])){var _0x49ce43=this[_0x5e5d('0xf')][_0x5e5d('0x6c')](this,_0x105b93[_0x5e5d('0xd2')]);if(_0x49ce43){this[_0x5e5d('0xd')]['setVariable'](_0x49ce43,_0x547fa3);return this['channel']['noop'](util[_0x5e5d('0x28')]('sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s',_0x105b93[_0x5e5d('0x1ad')],_0x49ce43));}}return this['channel']['noop'](util[_0x5e5d('0x28')](_0x5e5d('0x1ae'),_0x105b93[_0x5e5d('0x1ad')]));};AGIVertices['prototype'][_0x5e5d('0x1af')]=function(_0x43e97f){logger['info'](util['format'](_0x5e5d('0x1b0'),_0x43e97f[_0x5e5d('0x39')]));_0x43e97f['text']=_0x43e97f['text']['replace'](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x5e5d('0x80')](_0x43e97f[_0x5e5d('0x5a')])){return this[_0x5e5d('0xd')][_0x5e5d('0xa4')]('no\x20apiKey\x20configured');}if(!this[_0x5e5d('0x80')](_0x43e97f[_0x5e5d('0x5c')])){return this[_0x5e5d('0xd')][_0x5e5d('0xa4')](_0x5e5d('0xa2'));}this['channel'][_0x5e5d('0xa4')](util[_0x5e5d('0x28')](_0x5e5d('0x1b1'),_0x43e97f[_0x5e5d('0x5c')]));var _0x56a8e6=this['googleCloudTTS'][_0x5e5d('0x6c')](this,_0x43e97f);if(_0x56a8e6){this['channel']['noop'](util[_0x5e5d('0x28')]('Google\x20Cloud\x20TTS\x20%s\x20file\x20created',_0x56a8e6));var _0x4456c3=this['channel'][_0x5e5d('0x11c')](_0x56a8e6);try{fs[_0x5e5d('0xfc')](_0x56a8e6+_0x5e5d('0xfd'));}catch(_0x284dd0){logger['error'](_0x284dd0);}return _0x4456c3;}return this['channel'][_0x5e5d('0x2b')](_0x43e97f,_0x5e5d('0x1b2'));};AGIVertices[_0x5e5d('0x13')]['tts']=function(_0x5a0a2d){logger['info'](util['format']('Enter\x20in\x20GOOGLETTS\x20(%s)\x20block',_0x5a0a2d[_0x5e5d('0x39')]));_0x5a0a2d['text']=_0x5a0a2d[_0x5e5d('0x5c')][_0x5e5d('0x58')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x5e5d('0x80')](_0x5a0a2d[_0x5e5d('0x5c')])){return this['channel'][_0x5e5d('0xa4')](_0x5e5d('0xa2'));}this[_0x5e5d('0xd')][_0x5e5d('0xa4')](util[_0x5e5d('0x28')]('Trying\x20Google\x20TTS\x20%s',_0x5a0a2d[_0x5e5d('0x5c')]));var _0x3de3c5=this['googleTTS']['sync'](this,_0x5a0a2d);if(_0x3de3c5){this[_0x5e5d('0xd')][_0x5e5d('0xa4')](util[_0x5e5d('0x28')](_0x5e5d('0x1b3'),_0x3de3c5));var _0x2d8003=this['channel'][_0x5e5d('0x11c')](_0x3de3c5);try{fs['unlink'](_0x3de3c5+_0x5e5d('0xfd'));}catch(_0x1ec38f){logger[_0x5e5d('0x2b')](_0x1ec38f);}return _0x2d8003;}return this[_0x5e5d('0xd')][_0x5e5d('0x2b')](_0x5a0a2d,_0x5e5d('0x1b4'));};AGIVertices[_0x5e5d('0x13')][_0x5e5d('0x1b5')]=function(_0x5b3cd5){logger['info'](util['format'](_0x5e5d('0x1b6'),_0x5b3cd5[_0x5e5d('0x39')]));if(!this[_0x5e5d('0x80')](_0x5b3cd5['findBy'])){return this[_0x5e5d('0xd')][_0x5e5d('0x2b')](_0x5b3cd5,_0x5e5d('0x14d'));}logger[_0x5e5d('0x2d')](util[_0x5e5d('0x28')](_0x5e5d('0x14e'),this[_0x5e5d('0xd')][_0x5e5d('0x3a')],_0x5b3cd5[_0x5e5d('0x14c')]));var _0x4bdafd=this[_0x5e5d('0x4f')][_0x5e5d('0x6c')](this,_0x5b3cd5[_0x5e5d('0x14c')]);if(_0x4bdafd){logger['info'](util[_0x5e5d('0x28')](_0x5e5d('0x14f'),this['channel'][_0x5e5d('0x3a')],_0x5b3cd5[_0x5e5d('0x14c')]));this[_0x5e5d('0xd')]['noop'](util['format']('AGENT\x20%s\x20FOUND\x20BY',this[_0x5e5d('0xd')][_0x5e5d('0x3a')],_0x5b3cd5['findBy']));return{'code':0xc8,'result':_0x5e5d('0x150')};}else{logger[_0x5e5d('0x2d')](util['format'](_0x5e5d('0x151'),this[_0x5e5d('0xd')][_0x5e5d('0x3a')],_0x5b3cd5[_0x5e5d('0x14c')]));this[_0x5e5d('0xd')][_0x5e5d('0xa4')](util[_0x5e5d('0x28')](_0x5e5d('0x151'),this[_0x5e5d('0xd')]['callerid'],_0x5b3cd5[_0x5e5d('0x14c')]));return{'code':0xc8,'result':_0x5e5d('0x152')};}};AGIVertices[_0x5e5d('0x13')]['voicemail']=function(_0x5ea91b){logger[_0x5e5d('0x2d')](util[_0x5e5d('0x28')](_0x5e5d('0x1b7'),_0x5ea91b[_0x5e5d('0x39')]));var _0x36921c=this[_0x5e5d('0xd')][_0x5e5d('0x56')](_0x5e5d('0x1b8'),[_0x5ea91b[_0x5e5d('0x1b9')],_0x5ea91b[_0x5e5d('0x74')]]);if(_0x36921c[_0x5e5d('0x9d')]===-0x1){return _0x36921c;}return this[_0x5e5d('0xd')]['noop'](util['format']('Executed\x20command\x20%s\x20%s',_0x5e5d('0x1b8'),_0x5ea91b['mailbox']));};AGIVertices[_0x5e5d('0x13')]['vswitch']=function(_0x27f80e){logger[_0x5e5d('0x2d')](util[_0x5e5d('0x28')]('Enter\x20in\x20SWITCH\x20(%s)\x20block',_0x27f80e[_0x5e5d('0x39')]));if(!this[_0x5e5d('0x80')](_0x27f80e[_0x5e5d('0xd2')])){return this[_0x5e5d('0xd')][_0x5e5d('0x2b')](_0x27f80e,_0x5e5d('0x1ba'));}var _0x36b853=this[_0x5e5d('0xf')][_0x5e5d('0x6c')](this,_0x27f80e['variable_id']);if(!_0x36b853){return this['channel'][_0x5e5d('0x2b')](_0x27f80e,_0x5e5d('0xd4'));}var _0x123461=this[_0x5e5d('0xd')][_0x5e5d('0xf')](_0x36b853);return{'code':0xc8,'result':_0x123461[_0x5e5d('0x9f')]?_0x123461[_0x5e5d('0x9f')]:'-'};};String[_0x5e5d('0x13')]['replaceAll']=function(_0xafb9dc,_0x1a9ea9){return this['split'](_0xafb9dc)[_0x5e5d('0x1bb')](_0x1a9ea9);};module[_0x5e5d('0x1bc')]=AGIVertices; \ No newline at end of file +var _0xa41a=['AGENT\x20%s\x20NOT\x20FOUND\x20BY','logout','Enter\x20in\x20LOGOUT\x20(%s)\x20block','no\x20find\x20by\x20configured','success','failure','math','Enter\x20in\x20MATH\x20(%s)\x20block','operation','math\x20%s','%s[%s]','variable\x20%s[key]\x20set','menu','Enter\x20in\x20MENU\x20(%s)\x20block','digit','Enter\x20in\x20NOOP\x20(%s)\x20block','output','Enter\x20in\x20PAUSE\x20(%s)\x20block','PLAYBACK','queue','Enter\x20in\x20QUEUE\x20(%s)\x20block','queue_id','no\x20queue\x20selected','no\x20queue\x20found','indexOf','XMCS-QUEUE','toLowerCase','QUEUE','gosub','position','Enter\x20in\x20RECORD\x20(%s)\x20block','%s_%s','%s/recordings/%s.%s','RECORDING_SAVENAME','escape_digits','Enter\x20in\x20RESTAPI\x20(%s)\x20block','restAPI','Response:','no\x20variable\x20selected\x20for\x20the\x20response','200','%s_STATUS_MESSAGE','saydigits','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','sayDigits','digits','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayNumber','sayphonetic','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sendMail','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','account_id','no\x20mail\x20account\x20configured','no\x20mail\x20account\x20found','email','Smtp','user','bcc','subject','template_id','sendMail\x20message','Trying\x20SendMail\x20with\x20account\x20%s','smtpOptions','Mail\x20message\x20added\x20to\x20outgoing\x20process','sendFax','Enter\x20in\x20SENDFAX\x20(%s)\x20block','SENDFAX\x20block\x20not\x20implemented','sendSMS','Enter\x20in\x20SENDSMS\x20(%s)\x20block','sms_account_id','no\x20sms\x20account\x20found','sms_text','sendSMS\x20message','Trying\x20SendSMS\x20with\x20account\x20%s','set','Enter\x20in\x20SET\x20(%s)\x20block','no\x20variable\x20selected','start','Enter\x20in\x20START\x20(%s)\x20block','START\x20CALLY\x20SQUARE','XMCS-UNIQUEID','Skipped\x20Answer','project_id','agi://%s/square,\x22%s\x22,\x22%s\x22','host','127.0.0.1','system','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','sh\x20command:\x20%s\x20result\x20no\x20stored','google_cloud_tts','Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block','no\x20apiKey\x20configured','Trying\x20Google\x20Cloud\x20TTS\x20%s','Google\x20Cloud\x20TTS\x20%s\x20file\x20created','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20%s\x20file\x20created','Google\x20TTS\x20is\x20unreachable','unpause','voicemail','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','VOICEMAIL','mailbox','Enter\x20in\x20SWITCH\x20(%s)\x20block','replaceAll','join','exports','util','lodash','odbc','randomstring','moment','mustache','request-promise','../../config/logger','agi','../../config/environment','/var/opt/motion2/server/files','rawHeaders','getdigits','getsecretdigits','channel','rpc','mailRpc','prototype','getVariable','getVariableById','then','catch','getVoiceQueue','name','getSquareProject','getSquareProjectById','getSquareOdbcById','dsn','getUserById','getTrunk','getTrunkById','getSound','getSoundPath','save_name','getMailAccount','sendMailMessage','getIntervals','getIntervalById','IntervalId','map','Intervals','interval','format','open','Error\x20getting\x20ODBC\x20connection\x20%s','info','ODBC\x20connection\x20successfully','query','Query\x20executed\x20correctly\x20%s','close','getSmsAccount','getSmsAccountById','createSmsMessage','createSquareDetailsReport','uniqueid','label','agicommand','arg_1','createSquareRecording','callerid','calleridname','extension','priority','accountcode','dnid','file','createSquareMessage','createCmContact','isEmpty','isNil','callback_','random','lastName','phone','list_id','callback','scheduledAt','toString','getPause','getPauseById','agentPause','agent','agentUnpause','agentLogout','error','internal','%s/%s@from-sip/n','LOCAL','shellCommand','exec','replace','googleCloudTTS','apiKey','google_cloud_tts_text_type','text','en-US','ssmlGender','MALE','audioEncoding','googleTTS','google_tts_language','url','method','timeout','number','includes','POST','toUpperCase','body','rawBody','An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function','headers','parse','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','computedVariables','render','stringify','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusCode','statusMessage','500\x20-\x20Internal\x20Server\x20Error','options','key','dialogflow_language','googleDialogflowV2','dialogflowV2_project_id','client_email','private_key','dialogflowV2_language','sestekNDA','ispeechTTS','ispeech_tts_language','speed','ispeechASR','ispeech_asr_language','isConfigured','model','awsPolly','aws_secret_access_key','aws_polly_region','Amy','awsLex','aws_access_key_id','aws_lex_region','googleASR','google_asr_language','tildeASR','appid','appsecret','clear','clone','hasOwnProperty','isString','replaceObjectAllVariables','recursiveNodeIndex','isArray','length','replaceAllVariables','saveRestApiResult','isPlainObject','%s.%s','setVariable','split','extra','getAndSetVariable','result','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','maxRetry','sync','retry','mrcpsynth','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','noop','MRCPSynth','Executed\x20command\x20MRCPSynth\x20%s','mrcprecog','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','grammar','MRCPRecog','RECOG_CONFIDENCE()','MRCP_RECOG_CONFIDENCE','MRCP_RECOG_TRANSCRIPT','RECOG_INSTANCE()','MRCP_RECOG_INSTANCE','Enter\x20in\x20AGI\x20(%s)\x20block','command','args','answer','Enter\x20in\x20ANSWER\x20(%s)\x20block','wait','Enter\x20in\x20CALLBACK\x20(%s)\x20block','no\x20list\x20selected','delay','add','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','custom_app','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','application','Executed\x20command\x20%s\x20%s','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','no\x20text\x20configured','sestektts','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','lumenvoxasr','no\x20grammar\x20configured','LUMENVOX_ASR_CONFIDENCE','RECOG_INPUT()','LUMENVOX_ASR_TRANSCRIPT','Executed\x20command\x20MRCPRecog\x20%s','sestekasr','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_TRANSCRIPT','SESTEK_ASR_INSTANCE','database','odbc_id','no\x20database\x20selected','getSquareOdbc','no\x20odbc\x20database\x20found','no\x20query\x20configured','query:\x20%s','getQueryOdbc','variable_id','no\x20variable\x20selected\x20for\x20the\x20result','forEach','keys','%s[%s][%s]','variable\x20%s\x20set','dial','debug','Enter\x20in\x20DIAL\x20(%s)\x20block','no\x20user\x20selected','no\x20user\x20found','SIP/%s','opts','Executed\x20command\x20%s','DIAL','dialogflow','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','no\x20key\x20configured','Trying\x20Dialogflow:\x20%s','googleDialogflow','DIALOGFLOW_%s','speech','Dialogflow\x20is\x20unreachable','dialogflowV2','Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block','no\x20client_email\x20configured','no\x20private_key\x20configured','no\x20anguage\x20configured','bot','Trying\x20DialogflowV2:\x20%s','providerResponse','DialogflowV2\x20Result\x20%s','sesteknda','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','ndauth_url','no\x20ndauth\x20url\x20configured','username','no\x20password\x20configured','ndassistant_url','SESTEK_NDA_%s','out','audiofile','Sestek\x20NDA\x20%s\x20file\x20created','.wav','SestekNDA\x20Result\x20%s','SestekNDA\x20is\x20unreachable','Enter\x20in\x20END\x20(%s)\x20block','end','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','trunk_name','no\x20trunk\x20selected','finally','Enter\x20in\x20FINALLY\x20(%s)\x20block','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','file_id','no\x20file\x20audio\x20selected','no\x20file\x20audio\x20found','response','test','mindigit','no\x20variable\x20found','hiddendigitsnum','generate','hiddendigitspos','substr','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','goal','Enter\x20in\x20GOAL\x20(%s)\x20block','goalname','GOAL\x20%s','no\x20valid\x20credentials\x20configured','Trying\x20aws\x20Polly\x20%s','streamFile','aws\x20Polly\x20is\x20unreachable','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','aws_bot_name','Trying\x20Amazon\x20Lex:\x20%s','AWS_LEX_%s','message','Amazon\x20Lex\x20ready\x20for\x20fulfillment','Amazon\x20Lex\x20Result\x20%s','googleasr','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','wav','%s/recordings/%s','NOBEEP','recordFile','intKey','google\x20%s\x20file\x20created','tildeasr','Enter\x20in\x20TILDEASR\x20(%s)\x20block','no\x20appid\x20configured','beep','tilde\x20%s\x20file\x20created','TILDE_ASR_%s','Enter\x20in\x20GOTO\x20(%s)\x20block','continueAt','context','gotoif','Enter\x20in\x20GOTOIF\x20(%s)\x20block','no\x20condition\x20configured','false','condition','interval_id','no\x20interval\x20configured','no\x20intervals\x20found','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','true','hangup','Enter\x20in\x20HANGUP\x20(%s)\x20block','ispeechasr','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','ISPEECH_ASR_%s','IspeechASR\x20Result\x20%s','ispeechtts','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','ispeech\x20%s\x20file\x20created','unlink','ispeech\x20TTS\x20is\x20unreachable','login','Enter\x20in\x20LOGIN\x20(%s)\x20block','findBy','FIND\x20AGENT\x20%s\x20BY\x20%s','agentLogin','AGENT\x20%s\x20FOUND\x20BY'];(function(_0xcf802b,_0x17a2d3){var _0x196e49=function(_0xab3193){while(--_0xab3193){_0xcf802b['push'](_0xcf802b['shift']());}};_0x196e49(++_0x17a2d3);}(_0xa41a,0x6b));var _0xaa41=function(_0x787fb5,_0x311d84){_0x787fb5=_0x787fb5-0x0;var _0x402e73=_0xa41a[_0x787fb5];return _0x402e73;};'use strict';var fs=require('fs');var util=require(_0xaa41('0x0'));var _=require(_0xaa41('0x1'));var sh=require('shelljs');var odbc=require(_0xaa41('0x2'))();var rs=require(_0xaa41('0x3'));var moment=require(_0xaa41('0x4'));var Mustache=require(_0xaa41('0x5'));var rp=require(_0xaa41('0x6'));var logger=require(_0xaa41('0x7'))(_0xaa41('0x8'));var config=require(_0xaa41('0x9'));var scripts=require('./scripts');var FILES_PATH=_0xaa41('0xa');var recursiveMapAttributes=[_0xaa41('0xb'),'rawBody'];var verticesWithRetry=['menu',_0xaa41('0xc'),_0xaa41('0xd')];var AGIVertices=function(_0x588ab4,_0x31df43,_0x33f66b){this[_0xaa41('0xe')]=_0x588ab4;this[_0xaa41('0xf')]=_0x31df43;this[_0xaa41('0x10')]=_0x33f66b;};AGIVertices[_0xaa41('0x11')][_0xaa41('0x12')]=function(_0x423a19,_0x1c291e){this['rpc'][_0xaa41('0x13')](_0x423a19)[_0xaa41('0x14')](function(_0x524cab){_0x1c291e(null,_0x524cab?_0x524cab['name']:![]);})[_0xaa41('0x15')](function(_0x518b5b){_0x1c291e(_0x518b5b);});};AGIVertices[_0xaa41('0x11')][_0xaa41('0x16')]=function(_0x2f64bc,_0x889d44){this[_0xaa41('0xf')]['getVoiceQueueById'](_0x2f64bc)[_0xaa41('0x14')](function(_0x178170){_0x889d44(null,_0x178170?_0x178170[_0xaa41('0x17')]:![]);})[_0xaa41('0x15')](function(_0x2a6988){_0x889d44(_0x2a6988);});};AGIVertices[_0xaa41('0x11')][_0xaa41('0x18')]=function(_0x550ad5,_0x2d868a){this[_0xaa41('0xf')][_0xaa41('0x19')](_0x550ad5)[_0xaa41('0x14')](function(_0x230a6a){_0x2d868a(null,_0x230a6a?_0x230a6a[_0xaa41('0x17')]:![]);})[_0xaa41('0x15')](function(_0x46e6d3){_0x2d868a(_0x46e6d3);});};AGIVertices[_0xaa41('0x11')]['getSquareOdbc']=function(_0x5cd936,_0x1f502a){this[_0xaa41('0xf')][_0xaa41('0x1a')](_0x5cd936)['then'](function(_0x2bf794){_0x1f502a(null,_0x2bf794?_0x2bf794[_0xaa41('0x1b')]:![]);})['catch'](function(_0x513c61){_0x1f502a(_0x513c61);});};AGIVertices[_0xaa41('0x11')]['getUser']=function(_0xafd672,_0x209c83){this[_0xaa41('0xf')][_0xaa41('0x1c')](_0xafd672)[_0xaa41('0x14')](function(_0x4eb01f){_0x209c83(null,_0x4eb01f?_0x4eb01f[_0xaa41('0x17')]:![]);})[_0xaa41('0x15')](function(_0x448a21){_0x209c83(_0x448a21);});};AGIVertices[_0xaa41('0x11')][_0xaa41('0x1d')]=function(_0xa1f024,_0x5c3074){this['rpc'][_0xaa41('0x1e')](_0xa1f024)['then'](function(_0x493a10){_0x5c3074(null,_0x493a10?_0x493a10[_0xaa41('0x17')]:![]);})['catch'](function(_0x536bed){_0x5c3074(_0x536bed);});};AGIVertices[_0xaa41('0x11')][_0xaa41('0x1f')]=function(_0x392214,_0x632fd2){var _0x3f5272=this;this[_0xaa41('0xf')]['getSoundById'](_0x392214)[_0xaa41('0x14')](function(_0x1f0275){_0x632fd2(null,_0x1f0275?_0x3f5272[_0xaa41('0x20')](_0x1f0275[_0xaa41('0x21')]):![]);})[_0xaa41('0x15')](function(_0x4466a3){_0x632fd2(_0x4466a3);});};AGIVertices[_0xaa41('0x11')][_0xaa41('0x22')]=function(_0x4b1800,_0x377add){this['rpc']['getMailAccountById'](_0x4b1800)[_0xaa41('0x14')](function(_0x1176bd){_0x377add(null,_0x1176bd?_0x1176bd:![]);})['catch'](function(_0x392b5d){_0x377add(_0x392b5d);});};AGIVertices[_0xaa41('0x11')]['sendMailMessage']=function(_0x5022fb,_0x5c25fb,_0x1cf3da){this[_0xaa41('0x10')][_0xaa41('0x23')](_0x5022fb,_0x5c25fb)[_0xaa41('0x14')](function(){_0x1cf3da(null);})['catch'](function(_0x289c4a){_0x1cf3da(_0x289c4a);});};AGIVertices[_0xaa41('0x11')][_0xaa41('0x24')]=function(_0x4de770,_0x387c55){this[_0xaa41('0xf')][_0xaa41('0x25')](_0x4de770)['then'](function(_0x252c62){if(_0x252c62){if(_0x252c62[_0xaa41('0x26')]){_0x387c55(null,[_0x252c62['interval']]);}else{_0x387c55(null,_[_0xaa41('0x27')](_0x252c62[_0xaa41('0x28')],_0xaa41('0x29')));}}else{_0x387c55(null,![]);}})['catch'](function(_0x22b272){_0x387c55(_0x22b272);});};AGIVertices['prototype'][_0xaa41('0x20')]=function(_0x199b24){return util[_0xaa41('0x2a')]('%s/sounds/converted/%s',FILES_PATH,_0x199b24);};AGIVertices['prototype']['getQueryOdbc']=function(_0x2dc05a,_0x2e785f,_0x1334c8){odbc[_0xaa41('0x2b')](_0x2dc05a,function(_0x4fbb92){if(_0x4fbb92){logger['error'](_0xaa41('0x2c'),_0x4fbb92);_0x1334c8(_0x4fbb92);}else{logger[_0xaa41('0x2d')](_0xaa41('0x2e'));odbc[_0xaa41('0x2f')](_0x2e785f,function(_0xba115a,_0x203d83){if(_0xba115a){logger[_0xaa41('0x2d')]('Error\x20executing\x20query\x20%s',_0x2e785f);_0x1334c8(_0xba115a);}else{logger[_0xaa41('0x2d')](_0xaa41('0x30'),_0x2e785f);odbc[_0xaa41('0x31')](function(_0x27817f){if(_0x27817f){logger['error']('Error\x20closing\x20connection\x20to\x20odbc\x20%s',_0x27817f);}_0x1334c8(null,_0x203d83);});}});}});};AGIVertices[_0xaa41('0x11')][_0xaa41('0x32')]=function(_0x5eae08,_0x4101ab){this['rpc'][_0xaa41('0x33')](_0x5eae08)[_0xaa41('0x14')](function(_0x1a2d11){_0x4101ab(null,_0x1a2d11?_0x1a2d11:![]);})[_0xaa41('0x15')](function(_0x3e6cac){_0x4101ab(_0x3e6cac);});};AGIVertices[_0xaa41('0x11')][_0xaa41('0x34')]=function(_0x21f204,_0x5d9b22){this[_0xaa41('0xf')][_0xaa41('0x34')](_0x21f204)[_0xaa41('0x14')](function(_0x398c35){_0x5d9b22(null,_0x398c35);})[_0xaa41('0x15')](function(_0x1e2eb2){_0x5d9b22(_0x1e2eb2);});};AGIVertices['prototype']['createSquareDetailsReport']=function(_0x87e2f4,_0x4f9086,_0x1ed366){this[_0xaa41('0xf')][_0xaa41('0x35')]({'uniqueid':this[_0xaa41('0xe')][_0xaa41('0x36')],'node':_0x87e2f4[_0xaa41('0x37')],'application':_0x87e2f4[_0xaa41('0x38')],'data':_0x4f9086||null,'project_name':this['channel'][_0xaa41('0x39')],'callerid':this['channel']['callerid']})[_0xaa41('0x14')](function(_0x5ee127){if(_0x1ed366){_0x1ed366(null,_0x5ee127);}})['catch'](function(_0x5274c9){if(_0x1ed366){_0x1ed366(_0x5274c9);}});};AGIVertices[_0xaa41('0x11')]['createSquareRecording']=function(_0x46888a,_0x198716,_0x4a6882,_0x576f81){this[_0xaa41('0xf')][_0xaa41('0x3a')]({'uniqueid':this[_0xaa41('0xe')][_0xaa41('0x36')],'callerid':this[_0xaa41('0xe')][_0xaa41('0x3b')],'calleridname':this[_0xaa41('0xe')][_0xaa41('0x3c')],'context':this[_0xaa41('0xe')]['context'],'extension':this[_0xaa41('0xe')][_0xaa41('0x3d')],'priority':this[_0xaa41('0xe')][_0xaa41('0x3e')],'accountcode':this[_0xaa41('0xe')][_0xaa41('0x3f')],'dnid':this['channel'][_0xaa41('0x40')],'projectName':this[_0xaa41('0xe')][_0xaa41('0x39')],'saveName':_0x198716,'filename':_0x46888a[_0xaa41('0x41')]||_0x198716,'savePath':_0x4a6882})['then'](function(_0x23bc61){_0x576f81(null,_0x23bc61);})['catch'](function(_0x49fedd){_0x576f81(_0x49fedd);});};AGIVertices[_0xaa41('0x11')][_0xaa41('0x42')]=function(_0x3e16ef,_0x4ca114,_0xb4773b,_0x3e1a73,_0x853ccb){this['rpc'][_0xaa41('0x42')]({'uniqueid':this[_0xaa41('0xe')][_0xaa41('0x36')],'body':_0x3e16ef,'direction':_0x4ca114,'providerName':_0xb4773b,'providerResponse':_0x3e1a73})[_0xaa41('0x14')](function(_0x37fbe2){if(_0x853ccb){_0x853ccb(null,_0x37fbe2);}})[_0xaa41('0x15')](function(_0x333a9f){if(_0x853ccb){_0x853ccb(_0x333a9f);}});};AGIVertices[_0xaa41('0x11')]['createCmContact']=function(_0x9f0a81,_0x5bef5f){this['rpc'][_0xaa41('0x43')]({'firstName':_[_0xaa41('0x44')](_0x9f0a81[_0xaa41('0x17')])||_[_0xaa41('0x45')](_0x9f0a81[_0xaa41('0x17')])?_0xaa41('0x46')+Math[_0xaa41('0x47')]():_0x9f0a81[_0xaa41('0x17')],'lastName':_['isEmpty'](_0x9f0a81[_0xaa41('0x48')])||_[_0xaa41('0x45')](_0x9f0a81[_0xaa41('0x48')])?null:_0x9f0a81['lastName'],'phone':_0x9f0a81[_0xaa41('0x49')],'ListId':_0x9f0a81[_0xaa41('0x4a')],'scheduledat':_0x9f0a81['scheduledAt'],'callbackUniqueid':this[_0xaa41('0xe')][_0xaa41('0x36')],'tags':_0xaa41('0x4b'),'description':'Callback\x20scheduled\x20at\x20'+_0x9f0a81[_0xaa41('0x4c')][_0xaa41('0x4d')](),'priority':_0x9f0a81['callback_priority']})['then'](function(_0x3745ed){_0x5bef5f(null,_0x3745ed);})[_0xaa41('0x15')](function(_0x3a29d2){_0x5bef5f(_0x3a29d2);});};AGIVertices['prototype'][_0xaa41('0x4e')]=function(_0x137f3f,_0x1746b4){this[_0xaa41('0xf')][_0xaa41('0x4f')](_0x137f3f)['then'](function(_0x2ae70c){_0x1746b4(null,_0x2ae70c?_0x2ae70c['name']:![]);})['catch'](function(_0x3ba305){_0x1746b4(_0x3ba305);});};AGIVertices['prototype'][_0xaa41('0x50')]=function(_0xbbf261,_0x169ddf,_0x5e83e1){var _0x12ba1b={'role':_0xaa41('0x51')};_0x12ba1b[_0xbbf261]=this[_0xaa41('0xe')][_0xaa41('0x3b')];this[_0xaa41('0xf')][_0xaa41('0x50')](_0x12ba1b,_0x169ddf,this[_0xaa41('0xe')][_0xaa41('0x36')])[_0xaa41('0x14')](function(_0x4e54b0){_0x5e83e1(null,_[_0xaa41('0x45')](_0x4e54b0)?![]:!![]);})[_0xaa41('0x15')](function(_0xce10a9){logger['error'](_0xce10a9);_0x5e83e1(null,![]);});};AGIVertices[_0xaa41('0x11')][_0xaa41('0x52')]=function(_0x157898,_0x134579){var _0x2c8ccf={'role':_0xaa41('0x51')};_0x2c8ccf[_0x157898]=this[_0xaa41('0xe')]['callerid'];this['rpc']['agentUnpause'](_0x2c8ccf)['then'](function(_0x4ec357){_0x134579(null,_['isNil'](_0x4ec357)?![]:!![]);})[_0xaa41('0x15')](function(_0x50b598){logger['error'](_0x50b598);_0x134579(null,![]);});};AGIVertices[_0xaa41('0x11')][_0xaa41('0x53')]=function(_0x1a877b,_0x312eee){var _0x5cabc4={'role':_0xaa41('0x51')};_0x5cabc4[_0x1a877b]=this[_0xaa41('0xe')][_0xaa41('0x3b')];this[_0xaa41('0xf')][_0xaa41('0x53')](_0x5cabc4)[_0xaa41('0x14')](function(_0x46ebcd){_0x312eee(null,_[_0xaa41('0x45')](_0x46ebcd)?![]:!![]);})[_0xaa41('0x15')](function(_0x54344c){logger[_0xaa41('0x54')](_0x54344c);_0x312eee(null,![]);});};AGIVertices[_0xaa41('0x11')]['agentLogin']=function(_0x571fe3,_0x48c7af){var _0x1058a7={'role':'agent'};_0x1058a7[_0x571fe3]=this[_0xaa41('0xe')]['callerid'];var _0x5423b6=_0x571fe3!=_0xaa41('0x55')?util['format'](_0xaa41('0x56'),_0xaa41('0x57'),this[_0xaa41('0xe')][_0xaa41('0x3b')]):undefined;this['rpc']['agentLogin'](_0x1058a7,_0x5423b6)[_0xaa41('0x14')](function(_0x22bae6){_0x48c7af(null,_['isNil'](_0x22bae6)?![]:!![]);})['catch'](function(_0x2169b8){logger[_0xaa41('0x54')](_0x2169b8);_0x48c7af(null,![]);});};AGIVertices[_0xaa41('0x11')][_0xaa41('0x58')]=function(_0x3dbe37,_0x5a385e){sh[_0xaa41('0x59')](_['trim'](_0x3dbe37),function(_0x5062db,_0x5afa5c){var _0x271c22=_0x5afa5c[_0xaa41('0x5a')](/(\r\n|\n|\r)/gm,'');_0x5a385e(null,_0x271c22);});};AGIVertices[_0xaa41('0x11')]['googleCloudTTS']=function(_0x229297,_0x2adf93){scripts[_0xaa41('0x5b')](_0x229297[_0xaa41('0x5c')],_0x229297[_0xaa41('0x5d')]||_0xaa41('0x5e'),_0x229297[_0xaa41('0x5e')],_0x229297['languageCode']||_0xaa41('0x5f'),_0x229297[_0xaa41('0x60')]||_0xaa41('0x61'),_0x229297[_0xaa41('0x62')]||'MP3')[_0xaa41('0x14')](function(_0x4c2c99){_0x2adf93(null,_0x4c2c99);})[_0xaa41('0x15')](function(_0x2b4798){_0x2adf93(_0x2b4798);});};AGIVertices[_0xaa41('0x11')][_0xaa41('0x63')]=function(_0x491cad,_0xf456c1){scripts[_0xaa41('0x63')](_0x491cad[_0xaa41('0x5e')],_0x491cad[_0xaa41('0x64')]||'en',0x1)['then'](function(_0x140d78){_0xf456c1(null,_0x140d78);})['catch'](function(_0x55d380){_0xf456c1(_0x55d380);});};AGIVertices[_0xaa41('0x11')]['restAPI']=function(_0x1ac05e,_0x133368){var _0x2ba160={'uri':_0x1ac05e[_0xaa41('0x65')],'method':_0x1ac05e[_0xaa41('0x66')],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x1ac05e[_0xaa41('0x67')])===_0xaa41('0x68')&&parseInt(_0x1ac05e[_0xaa41('0x67')])>=0x1?parseInt(_0x1ac05e[_0xaa41('0x67')])*0x3e8:0x5*0x3e8};if(_[_0xaa41('0x69')]([_0xaa41('0x6a'),'PUT'],_0x2ba160[_0xaa41('0x66')][_0xaa41('0x6b')]())){try{_0x2ba160[_0xaa41('0x6c')]=_0x1ac05e['rawBody']?JSON['parse'](_0x1ac05e[_0xaa41('0x6d')]):{};}catch(_0x39da69){logger['error'](_0xaa41('0x6e'),_0x39da69);}}try{_0x2ba160[_0xaa41('0x6f')]=_0x1ac05e['rawHeaders']?JSON[_0xaa41('0x70')](_0x1ac05e[_0xaa41('0xb')]):{};}catch(_0x3e6926){logger[_0xaa41('0x54')](_0xaa41('0x71'),_0x3e6926);}if(_0x1ac05e[_0xaa41('0x72')]){try{var _0x9313fd=require(_0x1ac05e[_0xaa41('0x72')])['sync'](this,_0x2ba160);_0x2ba160['uri']=Mustache[_0xaa41('0x73')](_0x1ac05e['url'],_0x9313fd,{},['$$','$$']);if(_0x2ba160[_0xaa41('0x6f')]){_0x2ba160[_0xaa41('0x6f')]=JSON[_0xaa41('0x70')](Mustache['render'](JSON[_0xaa41('0x74')](_0x2ba160[_0xaa41('0x6f')]),_0x9313fd,{},['$$','$$']));}if(_0x2ba160[_0xaa41('0x6c')]){_0x2ba160['body']=JSON[_0xaa41('0x70')](Mustache[_0xaa41('0x73')](JSON['stringify'](_0x2ba160[_0xaa41('0x6c')]),_0x9313fd,{},['$$','$$']));}}catch(_0x4de25c){logger['error'](_0xaa41('0x75'),_0x4de25c);}}rp(_0x2ba160)[_0xaa41('0x14')](function(_0x5eded3){var _0x5a8cb0={'statusCode':_0x5eded3[_0xaa41('0x76')]||0xc8,'statusMessage':_0x5eded3[_0xaa41('0x77')]||'OK','headers':_0x5eded3[_0xaa41('0x6f')]||{},'body':_0x5eded3[_0xaa41('0x6c')]||{}};_0x133368(null,_0x5a8cb0);})['catch'](function(_0x9741a8){var _0x3e0044={'statusCode':_0x9741a8[_0xaa41('0x76')]||0x1f4,'statusMessage':_0x9741a8['message']||_0xaa41('0x78'),'headers':_0x9741a8[_0xaa41('0x79')][_0xaa41('0x6f')]||{},'body':_0x9741a8['options'][_0xaa41('0x6c')]||{}};_0x133368(null,_0x3e0044);});};AGIVertices['prototype']['googleDialogflow']=function(_0x364d24,_0x25c4d0){scripts['googleDialogflow'](this[_0xaa41('0xe')][_0xaa41('0x36')],_0x364d24[_0xaa41('0x7a')],_0x364d24['text'],_0x364d24[_0xaa41('0x7b')]||'en')[_0xaa41('0x14')](function(_0x1a2deb){_0x25c4d0(null,_0x1a2deb);})[_0xaa41('0x15')](function(_0x38f5d0){_0x25c4d0(_0x38f5d0);});};AGIVertices['prototype'][_0xaa41('0x7c')]=function(_0x5c4e73,_0x452143){scripts[_0xaa41('0x7c')](this[_0xaa41('0xe')][_0xaa41('0x36')],_0x5c4e73[_0xaa41('0x7d')],_0x5c4e73[_0xaa41('0x7e')],_0x5c4e73[_0xaa41('0x7f')],_0x5c4e73[_0xaa41('0x5e')],_0x5c4e73[_0xaa41('0x80')]||'en')[_0xaa41('0x14')](function(_0x302d98){_0x452143(null,_0x302d98);})['catch'](function(_0x329806){_0x452143(_0x329806);});};AGIVertices[_0xaa41('0x11')]['sestekNDA']=function(_0x2961bc,_0x543ab4){scripts[_0xaa41('0x81')](this[_0xaa41('0xe')],_0x2961bc)[_0xaa41('0x14')](function(_0x38d759){_0x543ab4(null,_0x38d759);})[_0xaa41('0x15')](function(_0x387dae){_0x543ab4(_0x387dae);});};AGIVertices[_0xaa41('0x11')]['ispeechTTS']=function(_0x1f2dd8,_0x1d50db){scripts[_0xaa41('0x82')](_0x1f2dd8[_0xaa41('0x7a')],_0x1f2dd8['text'],_0x1f2dd8[_0xaa41('0x83')]||'en-US',_0x1f2dd8[_0xaa41('0x84')])[_0xaa41('0x14')](function(_0xdaa2bf){_0x1d50db(null,_0xdaa2bf);})[_0xaa41('0x15')](function(_0x29f5c9){_0x1d50db(_0x29f5c9);});};AGIVertices['prototype'][_0xaa41('0x85')]=function(_0x35044a,_0x5819ac,_0x44743b){scripts[_0xaa41('0x85')](_0x5819ac,_0x35044a[_0xaa41('0x7a')],_0x35044a[_0xaa41('0x86')]||_0xaa41('0x5f'),this[_0xaa41('0x87')](_0x35044a[_0xaa41('0x88')])?_0x35044a[_0xaa41('0x88')]:undefined)['then'](function(_0xb35a1d){_0x44743b(null,_0xb35a1d);})[_0xaa41('0x15')](function(_0x382970){_0x44743b(_0x382970);});};AGIVertices[_0xaa41('0x11')][_0xaa41('0x89')]=function(_0x304cf8,_0x5489be){scripts['awsPolly'](_0x304cf8['aws_access_key_id'],_0x304cf8[_0xaa41('0x8a')],_0x304cf8[_0xaa41('0x8b')],_0x304cf8['aws_polly_voice']||_0xaa41('0x8c'),_0x304cf8[_0xaa41('0x5e')],_0x304cf8['aws_text_type']||_0xaa41('0x5e'))[_0xaa41('0x14')](function(_0x172eb2){_0x5489be(null,_0x172eb2);})[_0xaa41('0x15')](function(_0x4e2063){_0x5489be(_0x4e2063);});};AGIVertices[_0xaa41('0x11')]['awsLex']=function(_0x4100bb,_0x152e5c){scripts[_0xaa41('0x8d')](this[_0xaa41('0xe')][_0xaa41('0x36')],_0x4100bb[_0xaa41('0x8e')],_0x4100bb[_0xaa41('0x8a')],_0x4100bb[_0xaa41('0x8f')],_0x4100bb[_0xaa41('0x5e')],_0x4100bb['aws_bot_name'])[_0xaa41('0x14')](function(_0x3135c3){_0x152e5c(null,_0x3135c3);})[_0xaa41('0x15')](function(_0x516c64){_0x152e5c(_0x516c64);});};AGIVertices[_0xaa41('0x11')][_0xaa41('0x90')]=function(_0x10763e,_0x408d95,_0x32e445){scripts[_0xaa41('0x90')](_0x408d95,_0x10763e[_0xaa41('0x7a')],_0x10763e[_0xaa41('0x91')]||_0xaa41('0x5f'))[_0xaa41('0x14')](function(_0x169845){_0x32e445(null,_0x169845);})['catch'](function(_0x30f2a8){_0x32e445(_0x30f2a8);});};AGIVertices[_0xaa41('0x11')][_0xaa41('0x92')]=function(_0x3fdf0f,_0x13f62c,_0x5d9c0a){scripts['tildeASR'](_0x13f62c,_0x3fdf0f[_0xaa41('0x93')],_0x3fdf0f[_0xaa41('0x94')],_0x3fdf0f['uri'])[_0xaa41('0x14')](function(_0x271091){_0x5d9c0a(null,_0x271091);})['catch'](function(_0x5ee91f){_0x5d9c0a(_0x5ee91f);});};AGIVertices['prototype'][_0xaa41('0x95')]=function(_0x3c9bd8){var _0x20c126=_[_0xaa41('0x69')](verticesWithRetry,_0x3c9bd8[_0xaa41('0x38')])?_0x3c9bd8:_[_0xaa41('0x96')](_0x3c9bd8);for(var _0x3d4322 in _0x20c126){if(_0x20c126[_0xaa41('0x97')](_0x3d4322)){if(_0x20c126[_0x3d4322]&&_[_0xaa41('0x98')](_0x20c126[_0x3d4322])){if(_[_0xaa41('0x69')](recursiveMapAttributes,_0x3d4322)){_0x20c126[_0x3d4322]=this[_0xaa41('0x99')](_0x20c126[_0x3d4322]);}else{_0x20c126[_0x3d4322]=this['replaceAllVariables'](_0x20c126[_0x3d4322]);}}}}return _0x20c126;};AGIVertices['prototype'][_0xaa41('0x9a')]=function(_0x897e6c){for(var _0x489404 in _0x897e6c){if(_0x897e6c[_0xaa41('0x97')](_0x489404)){if(_['isPlainObject'](_0x897e6c[_0x489404])){this[_0xaa41('0x9a')](_0x897e6c[_0x489404]);}else if(_[_0xaa41('0x9b')](_0x897e6c[_0x489404])){for(var _0xfb21e0=0x0;_0xfb21e0<_0x897e6c[_0x489404][_0xaa41('0x9c')];_0xfb21e0++){this[_0xaa41('0x9a')](_0x897e6c[_0x489404][_0xfb21e0]);}}else if(_[_0xaa41('0x98')](_0x897e6c[_0x489404])){_0x897e6c[_0x489404]=this[_0xaa41('0x9d')](_0x897e6c[_0x489404]);}}}};AGIVertices[_0xaa41('0x11')][_0xaa41('0x9e')]=function(_0x49a2d3,_0x56bd21){for(var _0x56661a in _0x49a2d3){if(_0x49a2d3[_0xaa41('0x97')](_0x56661a)){if(_[_0xaa41('0x9f')](_0x49a2d3[_0x56661a])){if(!_['isEmpty'](_0x49a2d3[_0x56661a])){this['saveRestApiResult'](_0x49a2d3[_0x56661a],util[_0xaa41('0x2a')](_0xaa41('0xa0'),_0x56bd21,_0x56661a));}}else if(_['isArray'](_0x49a2d3[_0x56661a])){for(var _0x49e528=0x0;_0x49e528<_0x49a2d3[_0x56661a][_0xaa41('0x9c')];_0x49e528++){this['saveRestApiResult'](_0x49a2d3[_0x56661a][_0x49e528],util[_0xaa41('0x2a')](_0xaa41('0xa0'),_0x56bd21,_0x56661a+'['+_0x49e528+']'));}}else{if(!_[_0xaa41('0x45')](_0x49a2d3[_0x56661a])){this[_0xaa41('0xe')][_0xaa41('0xa1')](util[_0xaa41('0x2a')](_0xaa41('0xa0'),_0x56bd21,_0x56661a),_0x49a2d3[_0x56661a]);}}}}};AGIVertices[_0xaa41('0x11')][_0xaa41('0x99')]=function(_0x573889){try{var _0x4ed9e7=JSON[_0xaa41('0x70')](_0x573889);this[_0xaa41('0x9a')](_0x4ed9e7);return JSON[_0xaa41('0x74')](_0x4ed9e7);}catch(_0x415705){return this[_0xaa41('0x9d')](_0x573889);}};AGIVertices[_0xaa41('0x11')][_0xaa41('0x9d')]=function(_0x27587f){var _0x33f52e=_0x27587f[_0xaa41('0xa2')]('{');for(var _0x39a2fc=0x1;_0x39a2fc<_0x33f52e[_0xaa41('0x9c')];_0x39a2fc+=0x1){var _0x3e5f99=_0x33f52e[_0x39a2fc][_0xaa41('0xa2')]('}');if(_0x3e5f99[_0xaa41('0x9c')]>0x1){_0x27587f=_0x27587f['replaceAll']('{'+_0x3e5f99[0x0]+'}',this[_0xaa41('0xe')]['getVariable'](_0x3e5f99[0x0])[_0xaa41('0xa3')]||_0x3e5f99[0x0]);}}if(_0x33f52e[_0xaa41('0x9c')]===0x1){return _0x27587f[_0xaa41('0x4d')]();}return this[_0xaa41('0x9d')](_0x27587f);};AGIVertices[_0xaa41('0x11')][_0xaa41('0xa4')]=function(_0x121bb7,_0x44556d){var _0x4d9689=this[_0xaa41('0xe')][_0xaa41('0x12')](_0x121bb7);if(_0x4d9689[_0xaa41('0xa5')]===-0x1){return _0x4d9689;}logger[_0xaa41('0x2d')](util[_0xaa41('0x2a')](_0xaa41('0xa6'),_0x44556d,_0x4d9689[_0xaa41('0xa3')]));return this[_0xaa41('0xe')][_0xaa41('0xa1')](_0x44556d,_0x4d9689[_0xaa41('0xa3')]);};AGIVertices['prototype']['isConfigured']=function(_0x4021d1){return _0x4021d1&&_0x4021d1!=='0'&&_0x4021d1!=='-1'&&_0x4021d1!=='';};AGIVertices[_0xaa41('0x11')][_0xaa41('0xa7')]=function(_0x398741){this[_0xaa41('0x35')][_0xaa41('0xa8')](this,_0x398741,'-');_0x398741[_0xaa41('0xa9')]=_0x398741[_0xaa41('0xa7')];return{'code':0xc8,'result':'-'};};AGIVertices[_0xaa41('0x11')][_0xaa41('0xaa')]=function(_0x5b431d){logger['info'](util[_0xaa41('0x2a')](_0xaa41('0xab'),_0x5b431d['label']));if(!this[_0xaa41('0x87')](_0x5b431d['text'])){return this[_0xaa41('0xe')][_0xaa41('0xac')]('no\x20text\x20configured');}var _0x5d5e18='\x22'+_0x5b431d[_0xaa41('0x5e')]+'\x22';if(this[_0xaa41('0x87')](_0x5b431d[_0xaa41('0x79')])){_0x5d5e18+=','+_0x5b431d['options'];}var _0x5151f9=this[_0xaa41('0xe')]['exec'](_0xaa41('0xad'),_0x5d5e18);if(_0x5151f9['result']===-0x1){return _0x5151f9;}return this[_0xaa41('0xe')][_0xaa41('0xac')](util[_0xaa41('0x2a')](_0xaa41('0xae'),_0x5d5e18));};AGIVertices[_0xaa41('0x11')][_0xaa41('0xaf')]=function(_0xf615eb){logger['info'](util[_0xaa41('0x2a')](_0xaa41('0xb0'),_0xf615eb['label']));if(!this[_0xaa41('0x87')](_0xf615eb[_0xaa41('0xb1')])){return this[_0xaa41('0xe')][_0xaa41('0xac')]('no\x20grammar\x20configured');}var _0x2836f6=_0xf615eb[_0xaa41('0xb1')];if(this[_0xaa41('0x87')](_0xf615eb[_0xaa41('0x79')])){_0x2836f6+=','+_0xf615eb[_0xaa41('0x79')];}var _0x186a52=this[_0xaa41('0xe')][_0xaa41('0x59')](_0xaa41('0xb2'),_0x2836f6);if(_0x186a52['result']===-0x1){return _0x186a52;}var _0x5d0769=this[_0xaa41('0xa4')](_0xaa41('0xb3'),_0xaa41('0xb4'));if(_0x5d0769[_0xaa41('0xa5')]===-0x1){return _0x5d0769;}var _0x232fc6=this[_0xaa41('0xa4')]('RECOG_INPUT()',_0xaa41('0xb5'));if(_0x232fc6[_0xaa41('0xa5')]===-0x1){return _0x232fc6;}var _0x8ee9a6=this[_0xaa41('0xa4')](_0xaa41('0xb6'),_0xaa41('0xb7'));if(_0x8ee9a6['result']===-0x1){return _0x8ee9a6;}return this[_0xaa41('0xe')][_0xaa41('0xac')](util[_0xaa41('0x2a')]('Executed\x20command\x20MRCPRecog\x20%s',_0x2836f6));};AGIVertices[_0xaa41('0x11')][_0xaa41('0x8')]=function(_0x42b55f){logger[_0xaa41('0x2d')](util[_0xaa41('0x2a')](_0xaa41('0xb8'),_0x42b55f[_0xaa41('0x37')]));return this[_0xaa41('0xe')][_0xaa41('0x8')]([_0x42b55f[_0xaa41('0xb9')],_0x42b55f[_0xaa41('0xba')]]);};AGIVertices[_0xaa41('0x11')][_0xaa41('0xbb')]=function(_0x4d2451){logger['info'](util[_0xaa41('0x2a')](_0xaa41('0xbc'),_0x4d2451[_0xaa41('0x37')]));if(this[_0xaa41('0x87')](_0x4d2451[_0xaa41('0x67')])){logger[_0xaa41('0x2d')](util[_0xaa41('0x2a')]('Wait\x20%s\x20seconds\x20before\x20answer',_0x4d2451[_0xaa41('0x67')]));var _0x19cba1=this[_0xaa41('0xe')][_0xaa41('0xbd')](_0x4d2451[_0xaa41('0x67')]);if(_0x19cba1[_0xaa41('0xa5')]===-0x1){return _0x19cba1;}}return this[_0xaa41('0xe')][_0xaa41('0xbb')]();};AGIVertices[_0xaa41('0x11')][_0xaa41('0x4b')]=function(_0x3f2dbb){logger[_0xaa41('0x2d')](util['format'](_0xaa41('0xbe'),_0x3f2dbb[_0xaa41('0x37')]));if(!this['isConfigured'](_0x3f2dbb[_0xaa41('0x4a')])){return this[_0xaa41('0xe')][_0xaa41('0x54')](_0x3f2dbb,_0xaa41('0xbf'));}_0x3f2dbb['scheduledAt']=moment();if(this[_0xaa41('0x87')](_0x3f2dbb[_0xaa41('0xc0')])){_0x3f2dbb[_0xaa41('0x4c')]=moment()[_0xaa41('0xc1')](_0x3f2dbb[_0xaa41('0xc0')],'minutes');}if(!this[_0xaa41('0x87')](_0x3f2dbb['callback_priority'])){_0x3f2dbb['callback_priority']=0x2;}this[_0xaa41('0x43')]['sync'](this,_0x3f2dbb);return this['channel'][_0xaa41('0xac')](util[_0xaa41('0x2a')](_0xaa41('0xc2'),_0x3f2dbb['phone'],_0x3f2dbb[_0xaa41('0x4a')],_0x3f2dbb[_0xaa41('0x4c')]));};AGIVertices[_0xaa41('0x11')][_0xaa41('0xc3')]=function(_0x153e24){logger[_0xaa41('0x2d')](util[_0xaa41('0x2a')](_0xaa41('0xc4'),_0x153e24['label']));var _0x410d6e=this[_0xaa41('0xe')][_0xaa41('0x59')](_0x153e24[_0xaa41('0xc5')],_0x153e24[_0xaa41('0x79')]);if(_0x410d6e['result']===-0x1){return _0x410d6e;}return this['channel'][_0xaa41('0xac')](util[_0xaa41('0x2a')](_0xaa41('0xc6'),_0x153e24[_0xaa41('0xc5')],_0x153e24[_0xaa41('0x79')]));};AGIVertices[_0xaa41('0x11')]['lumenvoxtts']=function(_0x396670){logger[_0xaa41('0x2d')](util['format'](_0xaa41('0xc7'),_0x396670[_0xaa41('0x37')]));if(!this[_0xaa41('0x87')](_0x396670[_0xaa41('0x5e')])){return this[_0xaa41('0xe')][_0xaa41('0xac')](_0xaa41('0xc8'));}var _0x5c8325='\x22'+_0x396670[_0xaa41('0x5e')]+'\x22';if(this[_0xaa41('0x87')](_0x396670['options'])){_0x5c8325+=','+_0x396670[_0xaa41('0x79')];}var _0x68942b=this[_0xaa41('0xe')][_0xaa41('0x59')]('MRCPSynth',_0x5c8325);if(_0x68942b[_0xaa41('0xa5')]===-0x1){return _0x68942b;}return this[_0xaa41('0xe')][_0xaa41('0xac')](util[_0xaa41('0x2a')](_0xaa41('0xae'),_0x5c8325));};AGIVertices['prototype'][_0xaa41('0xc9')]=function(_0x31d371){logger['info'](util['format'](_0xaa41('0xca'),_0x31d371[_0xaa41('0x37')]));if(!this[_0xaa41('0x87')](_0x31d371[_0xaa41('0x5e')])){return this[_0xaa41('0xe')][_0xaa41('0xac')]('no\x20text\x20configured');}var _0x59ea7b='\x22'+_0x31d371[_0xaa41('0x5e')]+'\x22';if(this[_0xaa41('0x87')](_0x31d371['options'])){_0x59ea7b+=','+_0x31d371['options'];}var _0x38f4fc=this[_0xaa41('0xe')][_0xaa41('0x59')]('MRCPSynth',_0x59ea7b);if(_0x38f4fc['result']===-0x1){return _0x38f4fc;}return this[_0xaa41('0xe')][_0xaa41('0xac')](util[_0xaa41('0x2a')]('Executed\x20command\x20MRCPSynth\x20%s',_0x59ea7b));};AGIVertices[_0xaa41('0x11')][_0xaa41('0xcb')]=function(_0x5a0791){logger['info'](util[_0xaa41('0x2a')]('Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block',_0x5a0791[_0xaa41('0x37')]));if(!this[_0xaa41('0x87')](_0x5a0791[_0xaa41('0xb1')])){return this[_0xaa41('0xe')][_0xaa41('0xac')](_0xaa41('0xcc'));}var _0x2b083a=_0x5a0791['grammar'];if(this[_0xaa41('0x87')](_0x5a0791[_0xaa41('0x79')])){_0x2b083a+=','+_0x5a0791['options'];}var _0x44f1f2=this[_0xaa41('0xe')][_0xaa41('0x59')](_0xaa41('0xb2'),_0x2b083a);if(_0x44f1f2[_0xaa41('0xa5')]===-0x1){return _0x44f1f2;}var _0x33cd8c=this['getAndSetVariable'](_0xaa41('0xb3'),_0xaa41('0xcd'));if(_0x33cd8c[_0xaa41('0xa5')]===-0x1){return _0x33cd8c;}var _0x2fa831=this[_0xaa41('0xa4')](_0xaa41('0xce'),_0xaa41('0xcf'));if(_0x2fa831['result']===-0x1){return _0x2fa831;}var _0x1823b5=this[_0xaa41('0xa4')](_0xaa41('0xb6'),'LUMENVOX_ASR_INSTANCE');if(_0x1823b5['result']===-0x1){return _0x1823b5;}return this['channel'][_0xaa41('0xac')](util[_0xaa41('0x2a')](_0xaa41('0xd0'),_0x2b083a));};AGIVertices[_0xaa41('0x11')][_0xaa41('0xd1')]=function(_0x58af4a){logger[_0xaa41('0x2d')](util[_0xaa41('0x2a')](_0xaa41('0xd2'),_0x58af4a[_0xaa41('0x37')]));if(!this[_0xaa41('0x87')](_0x58af4a[_0xaa41('0xb1')])){return this[_0xaa41('0xe')]['noop'](_0xaa41('0xcc'));}var _0xfea1a5=_0x58af4a[_0xaa41('0xb1')];if(this['isConfigured'](_0x58af4a[_0xaa41('0x79')])){_0xfea1a5+=','+_0x58af4a['options'];}var _0x483c4e=this[_0xaa41('0xe')]['exec'](_0xaa41('0xb2'),_0xfea1a5);if(_0x483c4e[_0xaa41('0xa5')]===-0x1){return _0x483c4e;}var _0x366705=this[_0xaa41('0xa4')](_0xaa41('0xb3'),_0xaa41('0xd3'));if(_0x366705[_0xaa41('0xa5')]===-0x1){return _0x366705;}var _0x47e97f=this[_0xaa41('0xa4')](_0xaa41('0xce'),_0xaa41('0xd4'));if(_0x47e97f[_0xaa41('0xa5')]===-0x1){return _0x47e97f;}var _0x1a638d=this[_0xaa41('0xa4')](_0xaa41('0xb6'),_0xaa41('0xd5'));if(_0x1a638d[_0xaa41('0xa5')]===-0x1){return _0x1a638d;}return this[_0xaa41('0xe')][_0xaa41('0xac')](util[_0xaa41('0x2a')](_0xaa41('0xd0'),_0xfea1a5));};AGIVertices[_0xaa41('0x11')][_0xaa41('0xd6')]=function(_0x104008){logger['info'](util[_0xaa41('0x2a')]('Enter\x20in\x20DATABASE\x20(%s)\x20block',_0x104008['label']));if(!this['isConfigured'](_0x104008[_0xaa41('0xd7')])){return this[_0xaa41('0xe')]['error'](_0x104008,_0xaa41('0xd8'));}var _0x356256=this[_0xaa41('0xd9')][_0xaa41('0xa8')](this,_0x104008[_0xaa41('0xd7')]);if(!_0x356256){return this[_0xaa41('0xe')][_0xaa41('0x54')](_0x104008,_0xaa41('0xda'));}if(!this[_0xaa41('0x87')](_0x104008[_0xaa41('0x2f')])){return this[_0xaa41('0xe')][_0xaa41('0x54')](_0x104008,_0xaa41('0xdb'));}var _0x62d7bf=_0x104008[_0xaa41('0x2f')][_0xaa41('0x5a')](/(\r\n|\n|\r)/gm,'\x20');this[_0xaa41('0xe')]['noop'](util[_0xaa41('0x2a')](_0xaa41('0xdc'),_0x62d7bf));var _0x154828=this[_0xaa41('0xdd')]['sync'](this,_0x356256,_0x62d7bf);this[_0xaa41('0x35')][_0xaa41('0xa8')](this,_0x104008,_0x62d7bf);if(!this['isConfigured'](_0x104008[_0xaa41('0xde')])){return this[_0xaa41('0xe')][_0xaa41('0xac')](_0xaa41('0xdf'));}var _0x1e4390=this[_0xaa41('0x12')][_0xaa41('0xa8')](this,_0x104008[_0xaa41('0xde')]);if(!_0x1e4390){return this[_0xaa41('0xe')][_0xaa41('0x54')](_0x104008,'no\x20variable\x20found');}var _0x29e4ee=this;_0x154828[_0xaa41('0xe0')](function(_0x44c44d,_0x11d520){Object[_0xaa41('0xe1')](_0x44c44d)[_0xaa41('0xe0')](function(_0x53dea3){_0x29e4ee[_0xaa41('0xe')]['setVariable'](util[_0xaa41('0x2a')](_0xaa41('0xe2'),_0x1e4390,_0x11d520,_0x53dea3),_0x44c44d[_0x53dea3]);});});this[_0xaa41('0xe')][_0xaa41('0xa1')](util[_0xaa41('0x2a')]('%s_ROWS_COUNT',_0x1e4390),_0x154828[_0xaa41('0x9c')]);return this[_0xaa41('0xe')]['noop'](util[_0xaa41('0x2a')](_0xaa41('0xe3'),_0x1e4390));};AGIVertices[_0xaa41('0x11')][_0xaa41('0xe4')]=function(_0x42aead){logger[_0xaa41('0xe5')](util[_0xaa41('0x2a')](_0xaa41('0xe6'),_0x42aead[_0xaa41('0x37')]));if(!this[_0xaa41('0x87')](_0x42aead['sip_id'])){return this[_0xaa41('0xe')][_0xaa41('0x54')](_0x42aead,_0xaa41('0xe7'));}var _0x5e1f8d=this['getUser'][_0xaa41('0xa8')](this,_0x42aead['sip_id']);if(!_0x5e1f8d){return this['channel'][_0xaa41('0x54')](_0x42aead,_0xaa41('0xe8'));}var _0xa4dbd3=this[_0xaa41('0xe')]['exec']('DIAL',[util[_0xaa41('0x2a')](_0xaa41('0xe9'),_0x5e1f8d),_0x42aead[_0xaa41('0x67')],_0x42aead[_0xaa41('0xea')],_0x42aead[_0xaa41('0x65')]]);if(_0xa4dbd3['result']===-0x1){return _0xa4dbd3;}return this[_0xaa41('0xe')][_0xaa41('0xac')](util['format'](_0xaa41('0xeb'),_0xaa41('0xec')));};AGIVertices['prototype'][_0xaa41('0xed')]=function(_0x12d533){logger['info'](util[_0xaa41('0x2a')](_0xaa41('0xee'),_0x12d533['label']));if(!this[_0xaa41('0x87')](_0x12d533['key'])){return this['channel'][_0xaa41('0xac')](_0xaa41('0xef'));}if(!this[_0xaa41('0x87')](_0x12d533[_0xaa41('0x5e')])){return this[_0xaa41('0xe')]['noop'](_0xaa41('0xc8'));}this['channel']['bot']=!![];this[_0xaa41('0x35')](_0x12d533);this[_0xaa41('0x42')](_0x12d533[_0xaa41('0x5e')],'in','','');this[_0xaa41('0xe')][_0xaa41('0xac')](util[_0xaa41('0x2a')](_0xaa41('0xf0'),_0x12d533['text']));var _0x178abd=this[_0xaa41('0xf1')][_0xaa41('0xa8')](this,_0x12d533);if(_0x178abd){for(var _0xa87c7e in _0x178abd){if(_0x178abd[_0xaa41('0x97')](_0xa87c7e)){this[_0xaa41('0xe')][_0xaa41('0xa1')](util[_0xaa41('0x2a')](_0xaa41('0xf2'),_0xa87c7e[_0xaa41('0x6b')]()),_0x178abd[_0xa87c7e]);}}this[_0xaa41('0x42')](_0x178abd[_0xaa41('0xf3')],'out','dialogflow','');return this[_0xaa41('0xe')][_0xaa41('0xac')](util[_0xaa41('0x2a')]('Dialogflow\x20Result\x20%s',_0x178abd[_0xaa41('0xf3')]));}return this[_0xaa41('0xe')][_0xaa41('0x54')](_0x12d533,_0xaa41('0xf4'));};AGIVertices[_0xaa41('0x11')][_0xaa41('0xf5')]=function(_0x2ed7ac){logger[_0xaa41('0x2d')](util[_0xaa41('0x2a')](_0xaa41('0xf6'),_0x2ed7ac[_0xaa41('0x37')]));if(!this[_0xaa41('0x87')](_0x2ed7ac[_0xaa41('0x7d')])){return this[_0xaa41('0xe')][_0xaa41('0xac')]('no\x20project_id\x20configured');}if(!this[_0xaa41('0x87')](_0x2ed7ac[_0xaa41('0x7e')])){return this[_0xaa41('0xe')]['noop'](_0xaa41('0xf7'));}if(!this[_0xaa41('0x87')](_0x2ed7ac[_0xaa41('0x7f')])){return this[_0xaa41('0xe')][_0xaa41('0xac')](_0xaa41('0xf8'));}if(!this[_0xaa41('0x87')](_0x2ed7ac[_0xaa41('0x80')])){return this['channel'][_0xaa41('0xac')](_0xaa41('0xf9'));}if(!this[_0xaa41('0x87')](_0x2ed7ac[_0xaa41('0x5e')])){return this[_0xaa41('0xe')]['noop'](_0xaa41('0xc8'));}this['channel'][_0xaa41('0xfa')]=!![];this[_0xaa41('0x35')](_0x2ed7ac);this[_0xaa41('0x42')](_0x2ed7ac[_0xaa41('0x5e')],'in','','');this[_0xaa41('0xe')][_0xaa41('0xac')](util[_0xaa41('0x2a')](_0xaa41('0xfb'),_0x2ed7ac[_0xaa41('0x5e')]));var _0x7c8c98=this[_0xaa41('0x7c')][_0xaa41('0xa8')](this,_0x2ed7ac);if(_0x7c8c98){for(var _0x59c711 in _0x7c8c98){if(_0x7c8c98['hasOwnProperty'](_0x59c711)){if(_0x59c711!==_0xaa41('0xfc')){this[_0xaa41('0xe')][_0xaa41('0xa1')](util[_0xaa41('0x2a')](_0xaa41('0xf2'),_0x59c711[_0xaa41('0x6b')]()),_0x7c8c98[_0x59c711]);}}}this['createSquareMessage'](_0x7c8c98[_0xaa41('0xf3')],'out',_0xaa41('0xf5'),_0x7c8c98[_0xaa41('0xfc')]);return this[_0xaa41('0xe')][_0xaa41('0xac')](util[_0xaa41('0x2a')](_0xaa41('0xfd'),_0x7c8c98['speech']));}return this['channel'][_0xaa41('0x54')](_0x2ed7ac,'DialogflowV2\x20is\x20unreachable');};AGIVertices[_0xaa41('0x11')][_0xaa41('0xfe')]=function(_0x438fcf){logger[_0xaa41('0x2d')](util[_0xaa41('0x2a')](_0xaa41('0xff'),_0x438fcf[_0xaa41('0x37')]));if(!this[_0xaa41('0x87')](_0x438fcf[_0xaa41('0x100')])){return this[_0xaa41('0xe')][_0xaa41('0xac')](_0xaa41('0x101'));}if(!this[_0xaa41('0x87')](_0x438fcf[_0xaa41('0x102')])){return this['channel'][_0xaa41('0xac')]('no\x20username\x20configured');}if(!this[_0xaa41('0x87')](_0x438fcf['password'])){return this[_0xaa41('0xe')][_0xaa41('0xac')](_0xaa41('0x103'));}if(!this[_0xaa41('0x87')](_0x438fcf[_0xaa41('0x104')])){return this[_0xaa41('0xe')][_0xaa41('0xac')]('no\x20text\x20configured');}this[_0xaa41('0xe')]['bot']=!![];this['createSquareDetailsReport'](_0x438fcf);this[_0xaa41('0x42')](_0x438fcf[_0xaa41('0x5e')],'in','','');this['channel'][_0xaa41('0xac')](util[_0xaa41('0x2a')]('Trying\x20SestekNDA:\x20%s',_0x438fcf[_0xaa41('0x5e')]));var _0x1b888e=this[_0xaa41('0x81')]['sync'](this,_0x438fcf);if(_0x1b888e){for(var _0x3ecde6 in _0x1b888e){if(_0x1b888e['hasOwnProperty'](_0x3ecde6)){this[_0xaa41('0xe')][_0xaa41('0xa1')](util[_0xaa41('0x2a')](_0xaa41('0x105'),_0x3ecde6['toUpperCase']()),_0x1b888e[_0x3ecde6]);}}this[_0xaa41('0x42')](_0x1b888e[_0xaa41('0xf3')],_0xaa41('0x106'),'sesteknda','');if(_0x1b888e[_0xaa41('0x107')]){this[_0xaa41('0xe')][_0xaa41('0xac')](util[_0xaa41('0x2a')](_0xaa41('0x108'),_0x1b888e[_0xaa41('0x107')]));var _0x1dd5a5=this[_0xaa41('0xe')]['streamFile'](_0x1b888e[_0xaa41('0x107')]);try{fs['unlink'](_0x1b888e[_0xaa41('0x107')]+_0xaa41('0x109'));}catch(_0x1fa855){logger[_0xaa41('0x54')](_0x1fa855);}return _0x1dd5a5;}else{return this[_0xaa41('0xe')][_0xaa41('0xac')](util[_0xaa41('0x2a')](_0xaa41('0x10a'),_0x1b888e[_0xaa41('0xf3')]));}}return this[_0xaa41('0xe')][_0xaa41('0x54')](_0x438fcf,_0xaa41('0x10b'));};AGIVertices[_0xaa41('0x11')]['end']=function(_0x190864){logger[_0xaa41('0x2d')](util[_0xaa41('0x2a')](_0xaa41('0x10c'),_0x190864[_0xaa41('0x37')]));return this[_0xaa41('0xe')][_0xaa41('0xac')](_0xaa41('0x10d'));};AGIVertices[_0xaa41('0x11')]['ext_dial']=function(_0x181fde){logger[_0xaa41('0x2d')](util[_0xaa41('0x2a')](_0xaa41('0x10e'),_0x181fde[_0xaa41('0x37')]));var _0x45c4d6='';if(_0x181fde[_0xaa41('0x10f')]){if(!this[_0xaa41('0x87')](_0x181fde[_0xaa41('0x10f')])){return this[_0xaa41('0xe')]['error'](_0x181fde,'no\x20trunk\x20selected');}else{var _0x547acd=parseInt(_0x181fde[_0xaa41('0x10f')],0xa);if(isNaN(_0x547acd)){_0x45c4d6=_0x181fde[_0xaa41('0x10f')];}else{_0x45c4d6=this['getTrunk'][_0xaa41('0xa8')](this,_0x181fde[_0xaa41('0x10f')]);if(!_0x45c4d6){return this['channel'][_0xaa41('0x54')](_0x181fde,'no\x20trunk\x20found');}}}}else if(_0x181fde[_0xaa41('0x110')]){_0x45c4d6=_0x181fde[_0xaa41('0x110')];}else{return this[_0xaa41('0xe')][_0xaa41('0x54')](_0x181fde,_0xaa41('0x111'));}var _0x51db33=this[_0xaa41('0xe')][_0xaa41('0x59')](_0xaa41('0xec'),[util['format']('SIP/%s/%s',_0x45c4d6,_0x181fde[_0xaa41('0x49')]),_0x181fde[_0xaa41('0x67')],_0x181fde['opts'],_0x181fde[_0xaa41('0x65')]]);if(_0x51db33[_0xaa41('0xa5')]===-0x1){return _0x51db33;}return this[_0xaa41('0xe')]['noop'](util[_0xaa41('0x2a')](_0xaa41('0xeb'),_0xaa41('0xec')));};AGIVertices['prototype'][_0xaa41('0x112')]=function(_0x33b82e){logger['info'](util['format'](_0xaa41('0x113'),_0x33b82e[_0xaa41('0x37')]));return this[_0xaa41('0xe')][_0xaa41('0xac')]('finally');};AGIVertices[_0xaa41('0x11')][_0xaa41('0xc')]=function(_0x5c773b){logger[_0xaa41('0x2d')](util[_0xaa41('0x2a')](_0xaa41('0x114'),_0x5c773b[_0xaa41('0x37')]));if(_0x5c773b['retry']===0x0){return this[_0xaa41('0xa7')](_0x5c773b);}_0x5c773b[_0xaa41('0xa9')]-=0x1;if(!this[_0xaa41('0x87')](_0x5c773b[_0xaa41('0x115')])){return this[_0xaa41('0xe')][_0xaa41('0x54')](_0x5c773b,_0xaa41('0x116'));}var _0x3c3026=this[_0xaa41('0x1f')][_0xaa41('0xa8')](this,_0x5c773b['file_id']);if(!_0x3c3026){return this[_0xaa41('0xe')][_0xaa41('0x54')](_0x5c773b,_0xaa41('0x117'));}if(!this[_0xaa41('0x87')](_0x5c773b[_0xaa41('0xde')])){return this['channel'][_0xaa41('0x54')]('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x207c1c=this['channel']['getData'](_0x3c3026,_0x5c773b[_0xaa41('0x118')],_0x5c773b['maxdigit']);var _0x59d610=_0x207c1c[_0xaa41('0xa5')]?_0x207c1c[_0xaa41('0xa5')][_0xaa41('0x4d')]():'';logger[_0xaa41('0x2d')](_0xaa41('0x119'),JSON[_0xaa41('0x74')](_0x207c1c));if(_0x207c1c['result']===-0x1){this[_0xaa41('0x35')][_0xaa41('0xa8')](this,_0x5c773b,_0x59d610);return _0x207c1c;}else if(_0x207c1c[_0xaa41('0xa3')]==='timeout'){_0x207c1c[_0xaa41('0xa5')]=_0x59d610['length']>=parseInt(_0x5c773b[_0xaa41('0x11a')])?'x':'i';}else{_0x207c1c[_0xaa41('0xa5')]=_0x59d610[_0xaa41('0x9c')]>=parseInt(_0x5c773b[_0xaa41('0x11a')])&&_0x59d610['length']<=parseInt(_0x5c773b['maxdigit'])?'x':'i';}var _0x1ab4b7=this[_0xaa41('0x12')]['sync'](this,_0x5c773b['variable_id']);if(!_0x1ab4b7){return this[_0xaa41('0xe')][_0xaa41('0x54')](_0x5c773b,_0xaa41('0x11b'));}this[_0xaa41('0xe')][_0xaa41('0xa1')](_0x1ab4b7,_0x59d610);if(this[_0xaa41('0x87')](_0x5c773b[_0xaa41('0x11c')])){var _0x352cbf=parseInt(_0x5c773b['hiddendigitsnum'],0xa);var _0x135adc=rs[_0xaa41('0x11d')]({'charset':'*','length':_0x352cbf});var _0x42a0b3=_0x59d610[_0xaa41('0x9c')];if(_0x42a0b3>0x0){if(_0x42a0b3>_0x352cbf){this[_0xaa41('0x35')]['sync'](this,_0x5c773b,_0x5c773b[_0xaa41('0x11e')]==='first'?_0x135adc+_0x59d610[_0xaa41('0x11f')](_0x352cbf):_0x59d610['substr'](0x0,_0x42a0b3-_0x352cbf)+_0x135adc);}else{this[_0xaa41('0x35')][_0xaa41('0xa8')](this,_0x5c773b,rs[_0xaa41('0x11d')]({'charset':'*','length':_0x42a0b3}));}}else{this['createSquareDetailsReport'][_0xaa41('0xa8')](this,_0x5c773b,'');}}else{this[_0xaa41('0x35')][_0xaa41('0xa8')](this,_0x5c773b,_0x59d610);}return _0x207c1c;};AGIVertices[_0xaa41('0x11')][_0xaa41('0xd')]=function(_0x1cd393){logger[_0xaa41('0x2d')](util[_0xaa41('0x2a')](_0xaa41('0x120'),_0x1cd393[_0xaa41('0x37')]));return this['getdigits'](_0x1cd393);};AGIVertices['prototype'][_0xaa41('0x121')]=function(_0x30e5b9){logger[_0xaa41('0x2d')](util['format'](_0xaa41('0x122'),_0x30e5b9[_0xaa41('0x37')]));this[_0xaa41('0x35')][_0xaa41('0xa8')](this,_0x30e5b9,_0x30e5b9[_0xaa41('0x123')]);return this[_0xaa41('0xe')]['noop'](util[_0xaa41('0x2a')](_0xaa41('0x124'),_0x30e5b9[_0xaa41('0x123')]));};AGIVertices[_0xaa41('0x11')]['awspolly']=function(_0x32f0aa){logger[_0xaa41('0x2d')](util[_0xaa41('0x2a')]('[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block',_0x32f0aa['label']));if(!this[_0xaa41('0x87')](_0x32f0aa[_0xaa41('0x8e')])||!this[_0xaa41('0x87')](_0x32f0aa['aws_secret_access_key'])){return this['channel'][_0xaa41('0xac')](_0xaa41('0x125'));}if(!this[_0xaa41('0x87')](_0x32f0aa[_0xaa41('0x5e')])){return this[_0xaa41('0xe')][_0xaa41('0xac')]('no\x20text\x20configured');}this[_0xaa41('0xe')][_0xaa41('0xac')](util[_0xaa41('0x2a')](_0xaa41('0x126'),_0x32f0aa[_0xaa41('0x5e')]));var _0x1b58c0=this[_0xaa41('0x89')][_0xaa41('0xa8')](this,_0x32f0aa);if(_0x1b58c0){this[_0xaa41('0xe')][_0xaa41('0xac')](util[_0xaa41('0x2a')]('aws\x20Polly\x20%s\x20file\x20created',_0x1b58c0));var _0x4b446e=this[_0xaa41('0xe')][_0xaa41('0x127')](_0x1b58c0);try{fs['unlink'](_0x1b58c0+_0xaa41('0x109'));}catch(_0x46ad7c){logger['error'](_0x46ad7c);}return _0x4b446e;}return this['channel'][_0xaa41('0x54')](_0x32f0aa,_0xaa41('0x128'));};AGIVertices[_0xaa41('0x11')]['awslex']=function(_0xd96b33){logger[_0xaa41('0x2d')](util['format'](_0xaa41('0x129'),_0xd96b33[_0xaa41('0x37')]));if(!this['isConfigured'](_0xd96b33[_0xaa41('0x8e')])||!this[_0xaa41('0x87')](_0xd96b33['aws_secret_access_key'])){return this['channel']['noop']('no\x20valid\x20credentials\x20configured');}if(!this[_0xaa41('0x87')](_0xd96b33[_0xaa41('0x12a')])){return this[_0xaa41('0xe')][_0xaa41('0xac')]('no\x20bot\x20name\x20configured');}if(!this['isConfigured'](_0xd96b33[_0xaa41('0x5e')])){return this['channel'][_0xaa41('0xac')](_0xaa41('0xc8'));}this[_0xaa41('0xe')][_0xaa41('0xfa')]=!![];this['createSquareDetailsReport'](_0xd96b33);this[_0xaa41('0x42')](_0xd96b33[_0xaa41('0x5e')],'in','','');this[_0xaa41('0xe')][_0xaa41('0xac')](util[_0xaa41('0x2a')](_0xaa41('0x12b'),_0xd96b33[_0xaa41('0x5e')]));var _0x3b82ef=this['awsLex']['sync'](this,_0xd96b33);if(_0x3b82ef){for(var _0x1c2803 in _0x3b82ef){if(_0x3b82ef[_0xaa41('0x97')](_0x1c2803)&&_[_0xaa41('0x98')](_0x3b82ef[_0x1c2803])){this[_0xaa41('0xe')][_0xaa41('0xa1')](util[_0xaa41('0x2a')](_0xaa41('0x12c'),_0x1c2803[_0xaa41('0x6b')]()),_0x3b82ef[_0x1c2803]);}}if(_[_0xaa41('0x45')](_0x3b82ef[_0xaa41('0x12d')])){return this[_0xaa41('0xe')][_0xaa41('0xac')](_0xaa41('0x12e'));}else{this['createSquareMessage'](_0x3b82ef[_0xaa41('0x12d')],_0xaa41('0x106'),'amazonlex','');return this[_0xaa41('0xe')][_0xaa41('0xac')](util[_0xaa41('0x2a')](_0xaa41('0x12f'),_0x3b82ef['message']));}}return this[_0xaa41('0xe')][_0xaa41('0x54')](_0xd96b33,'Amazon\x20Lex\x20is\x20unreachable');};AGIVertices['prototype'][_0xaa41('0x130')]=function(_0x3919c0){logger[_0xaa41('0x2d')](util[_0xaa41('0x2a')](_0xaa41('0x131'),_0x3919c0['label'],_0x3919c0[_0xaa41('0x67')]));if(!this[_0xaa41('0x87')](_0x3919c0['key'])){return this['channel'][_0xaa41('0xac')](_0xaa41('0xef'));}var _0x14fb41=_0xaa41('0x132');var _0x5ac4ef=util[_0xaa41('0x2a')](_0xaa41('0x133'),FILES_PATH,rs[_0xaa41('0x11d')](0x4));var _0x2f93e2=util[_0xaa41('0x2a')](_0xaa41('0xa0'),_0x5ac4ef,_0x14fb41);var _0x42ae0c=!![];if(_0x3919c0['beep']===_0xaa41('0x134')){_0x42ae0c=![];}var _0xde6a38=this['channel'][_0xaa41('0x135')](_0x5ac4ef,_0x14fb41,_0x3919c0[_0xaa41('0x136')],_0x3919c0[_0xaa41('0x67')],undefined,_0x42ae0c);if(_0xde6a38[_0xaa41('0xa5')]!==-0x1){this[_0xaa41('0xe')][_0xaa41('0xac')](util[_0xaa41('0x2a')](_0xaa41('0x137'),_0x2f93e2));var _0x50eb4c=this[_0xaa41('0x90')]['sync'](this,_0x3919c0,_0x2f93e2);if(_0x50eb4c){for(var _0x5eac30 in _0x50eb4c){if(_0x50eb4c[_0xaa41('0x97')](_0x5eac30)){this[_0xaa41('0xe')][_0xaa41('0xa1')](util['format']('GOOGLE_ASR_%s',_0x5eac30[_0xaa41('0x6b')]()),_0x50eb4c[_0x5eac30]);}}return this[_0xaa41('0xe')][_0xaa41('0xac')](util[_0xaa41('0x2a')]('GoogleASR\x20Result\x20%s',JSON[_0xaa41('0x74')](_0x50eb4c)));}}return _0xde6a38;};AGIVertices['prototype'][_0xaa41('0x138')]=function(_0x24f86){logger[_0xaa41('0x2d')](util['format'](_0xaa41('0x139'),_0x24f86['label']));if(!this[_0xaa41('0x87')](_0x24f86[_0xaa41('0x93')])){return this[_0xaa41('0xe')][_0xaa41('0xac')](_0xaa41('0x13a'));}if(!this['isConfigured'](_0x24f86[_0xaa41('0x94')])){return this['channel']['noop']('no\x20appsecret\x20configured');}var _0x8c4338='wav';var _0x3280c4=util['format']('%s/recordings/%s',FILES_PATH,rs[_0xaa41('0x11d')](0x4));var _0x23dd19=util[_0xaa41('0x2a')](_0xaa41('0xa0'),_0x3280c4,_0x8c4338);var _0x10af74=!![];if(_0x24f86[_0xaa41('0x13b')]===_0xaa41('0x134')){_0x10af74=![];}var _0x338cf5=this[_0xaa41('0xe')]['recordFile'](_0x3280c4,_0x8c4338,_0x24f86[_0xaa41('0x136')],_0x24f86[_0xaa41('0x67')],undefined,_0x10af74);if(_0x338cf5[_0xaa41('0xa5')]!==-0x1){this['channel'][_0xaa41('0xac')](util[_0xaa41('0x2a')](_0xaa41('0x13c'),_0x23dd19));var _0x54415f=this[_0xaa41('0x92')][_0xaa41('0xa8')](this,_0x24f86,_0x23dd19);if(_0x54415f){for(var _0x534d2b in _0x54415f){if(_0x54415f[_0xaa41('0x97')](_0x534d2b)){this[_0xaa41('0xe')]['setVariable'](util[_0xaa41('0x2a')](_0xaa41('0x13d'),_0x534d2b[_0xaa41('0x6b')]()),_0x54415f[_0x534d2b]);}}return this[_0xaa41('0xe')][_0xaa41('0xac')](util[_0xaa41('0x2a')]('TildeASR\x20Result\x20%s',JSON['stringify'](_0x54415f)));}}return _0x338cf5;};AGIVertices['prototype']['gotoc']=function(_0x5b820b){logger[_0xaa41('0x2d')](util[_0xaa41('0x2a')](_0xaa41('0x13e'),_0x5b820b[_0xaa41('0x37')]));return this[_0xaa41('0xe')][_0xaa41('0x13f')](_0x5b820b[_0xaa41('0x140')],_0x5b820b[_0xaa41('0x3d')],_0x5b820b['priority']);};AGIVertices['prototype'][_0xaa41('0x141')]=function(_0x20ed00){logger[_0xaa41('0x2d')](util[_0xaa41('0x2a')](_0xaa41('0x142'),_0x20ed00[_0xaa41('0x37')]));if(!this[_0xaa41('0x87')](_0x20ed00['condition'])){return this[_0xaa41('0xe')][_0xaa41('0x54')](_0x20ed00,_0xaa41('0x143'));}try{var _0x36d524=eval(_0x20ed00['condition'])?'true':_0xaa41('0x144');this['channel'][_0xaa41('0xac')](util['format']('EVAL\x20CONDITION\x20%s\x20%s',_0x20ed00[_0xaa41('0x145')],_0x36d524));return{'code':0xc8,'result':_0x36d524};}catch(_0x35438e){return{'code':0xc8,'result':'false'};}};AGIVertices['prototype']['gotoiftime']=function(_0x17b9f8){logger[_0xaa41('0x2d')](util[_0xaa41('0x2a')]('Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block',_0x17b9f8[_0xaa41('0x37')]));if(!this[_0xaa41('0x87')](_0x17b9f8[_0xaa41('0x146')])){return this[_0xaa41('0xe')][_0xaa41('0x54')](_0x17b9f8,_0xaa41('0x147'));}var _0x2332fc=this[_0xaa41('0x24')][_0xaa41('0xa8')](this,_0x17b9f8[_0xaa41('0x146')]);if(!_0x2332fc){return this[_0xaa41('0xe')][_0xaa41('0x54')](_0x17b9f8,_0xaa41('0x148'));}for(var _0x28a7d7=0x0;_0x28a7d7<_0x2332fc[_0xaa41('0x9c')];_0x28a7d7+=0x1){var _0x35cab3=this[_0xaa41('0xe')][_0xaa41('0x12')](util['format'](_0xaa41('0x149'),_0x2332fc[_0x28a7d7]));if(_0x35cab3['result']===-0x1){return _0x35cab3;}logger[_0xaa41('0x2d')](util[_0xaa41('0x2a')](_0xaa41('0x14a'),_0x2332fc[_0x28a7d7],_0x35cab3[_0xaa41('0xa3')]));if(_0x35cab3[_0xaa41('0xa3')]===_0xaa41('0x14b')){logger[_0xaa41('0x2d')](util[_0xaa41('0x2a')](_0xaa41('0x14a'),_0x2332fc[_0x28a7d7],'true'));this[_0xaa41('0xe')][_0xaa41('0xac')](util[_0xaa41('0x2a')]('IFTIME\x20%s\x20%s',_0x2332fc[_0x28a7d7],_0xaa41('0x14b')));return{'code':0xc8,'result':_0xaa41('0x14b')};}else{logger[_0xaa41('0x2d')](util[_0xaa41('0x2a')](_0xaa41('0x14a'),_0x2332fc[_0x28a7d7],_0xaa41('0x144')));this['channel'][_0xaa41('0xac')](util[_0xaa41('0x2a')](_0xaa41('0x14a'),_0x2332fc[_0x28a7d7],_0xaa41('0x144')));}}return{'code':0xc8,'result':_0xaa41('0x144')};};AGIVertices[_0xaa41('0x11')][_0xaa41('0x14c')]=function(_0x44d4f1){logger[_0xaa41('0x2d')](util[_0xaa41('0x2a')](_0xaa41('0x14d'),_0x44d4f1['label']));return this[_0xaa41('0xe')][_0xaa41('0x14c')]();};AGIVertices[_0xaa41('0x11')][_0xaa41('0x14e')]=function(_0x1225ef){logger[_0xaa41('0x2d')](util[_0xaa41('0x2a')](_0xaa41('0x14f'),_0x1225ef['label']));if(!this['isConfigured'](_0x1225ef[_0xaa41('0x7a')])){return this['channel'][_0xaa41('0xac')]('no\x20key\x20configured');}var _0x174c3a=_0xaa41('0x132');var _0xb83c08=util['format'](_0xaa41('0x133'),FILES_PATH,rs[_0xaa41('0x11d')](0x4));var _0x191c18=util['format'](_0xaa41('0xa0'),_0xb83c08,_0x174c3a);var _0x2a7dec=!![];if(_0x1225ef[_0xaa41('0x13b')]===_0xaa41('0x134')){_0x2a7dec=![];}var _0x59e4a5=this[_0xaa41('0xe')]['recordFile'](_0xb83c08,_0x174c3a,_0x1225ef[_0xaa41('0x136')],_0x1225ef[_0xaa41('0x67')],undefined,_0x2a7dec);if(_0x59e4a5[_0xaa41('0xa5')]!==-0x1){this[_0xaa41('0xe')][_0xaa41('0xac')](util['format']('ispeech\x20%s\x20file\x20created',_0x191c18));var _0x3352ad=this[_0xaa41('0x85')][_0xaa41('0xa8')](this,_0x1225ef,_0x191c18);if(_0x3352ad){for(var _0x573b84 in _0x3352ad){if(_0x3352ad[_0xaa41('0x97')](_0x573b84)){this[_0xaa41('0xe')][_0xaa41('0xa1')](util['format'](_0xaa41('0x150'),_0x573b84['toUpperCase']()),_0x3352ad[_0x573b84]);}}return this[_0xaa41('0xe')][_0xaa41('0xac')](util[_0xaa41('0x2a')](_0xaa41('0x151'),JSON[_0xaa41('0x74')](_0x3352ad)));}}return _0x59e4a5;};AGIVertices['prototype'][_0xaa41('0x152')]=function(_0x87f256){logger[_0xaa41('0x2d')](util[_0xaa41('0x2a')](_0xaa41('0x153'),_0x87f256[_0xaa41('0x37')]));if(!this[_0xaa41('0x87')](_0x87f256[_0xaa41('0x7a')])){return this[_0xaa41('0xe')][_0xaa41('0xac')](_0xaa41('0xef'));}if(!this[_0xaa41('0x87')](_0x87f256[_0xaa41('0x5e')])){return this[_0xaa41('0xe')][_0xaa41('0xac')](_0xaa41('0xc8'));}this[_0xaa41('0xe')][_0xaa41('0xac')](util[_0xaa41('0x2a')]('Trying\x20ispeech\x20TTS\x20%s',_0x87f256[_0xaa41('0x5e')]));var _0x4aae6a=this[_0xaa41('0x82')][_0xaa41('0xa8')](this,_0x87f256);if(_0x4aae6a){this['channel']['noop'](util[_0xaa41('0x2a')](_0xaa41('0x154'),_0x4aae6a));var _0x2af3bb=this[_0xaa41('0xe')][_0xaa41('0x127')](_0x4aae6a,_0x87f256[_0xaa41('0x136')]);try{fs[_0xaa41('0x155')](_0x4aae6a+'.wav');}catch(_0x271823){logger[_0xaa41('0x54')](_0x271823);}return _0x2af3bb;}return this[_0xaa41('0xe')][_0xaa41('0x54')](_0x87f256,_0xaa41('0x156'));};AGIVertices[_0xaa41('0x11')][_0xaa41('0x157')]=function(_0x2e253f){logger['info'](util[_0xaa41('0x2a')](_0xaa41('0x158'),_0x2e253f[_0xaa41('0x37')]));if(!this[_0xaa41('0x87')](_0x2e253f[_0xaa41('0x159')])){return this[_0xaa41('0xe')][_0xaa41('0x54')](_0x2e253f,'no\x20find\x20by\x20configured');}logger[_0xaa41('0x2d')](util[_0xaa41('0x2a')](_0xaa41('0x15a'),this[_0xaa41('0xe')][_0xaa41('0x3b')],_0x2e253f[_0xaa41('0x159')]));var _0x26ca80=this[_0xaa41('0x15b')]['sync'](this,_0x2e253f[_0xaa41('0x159')]);if(_0x26ca80){logger[_0xaa41('0x2d')](util[_0xaa41('0x2a')](_0xaa41('0x15c'),this[_0xaa41('0xe')]['callerid'],_0x2e253f['findBy']));this[_0xaa41('0xe')][_0xaa41('0xac')](util[_0xaa41('0x2a')](_0xaa41('0x15c'),this['channel'][_0xaa41('0x3b')],_0x2e253f[_0xaa41('0x159')]));return{'code':0xc8,'result':'success'};}else{logger[_0xaa41('0x2d')](util[_0xaa41('0x2a')](_0xaa41('0x15d'),this[_0xaa41('0xe')]['callerid'],_0x2e253f[_0xaa41('0x159')]));this['channel'][_0xaa41('0xac')](util[_0xaa41('0x2a')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0xaa41('0xe')][_0xaa41('0x3b')],_0x2e253f['findBy']));return{'code':0xc8,'result':'failure'};}};AGIVertices['prototype'][_0xaa41('0x15e')]=function(_0x355a0a){logger[_0xaa41('0x2d')](util[_0xaa41('0x2a')](_0xaa41('0x15f'),_0x355a0a[_0xaa41('0x37')]));if(!this[_0xaa41('0x87')](_0x355a0a[_0xaa41('0x159')])){return this['channel'][_0xaa41('0x54')](_0x355a0a,_0xaa41('0x160'));}logger[_0xaa41('0x2d')](util[_0xaa41('0x2a')](_0xaa41('0x15a'),this[_0xaa41('0xe')][_0xaa41('0x3b')],_0x355a0a['findBy']));var _0x59a4cf=this[_0xaa41('0x53')][_0xaa41('0xa8')](this,_0x355a0a[_0xaa41('0x159')]);if(_0x59a4cf){logger['info'](util['format'](_0xaa41('0x15c'),this['channel'][_0xaa41('0x3b')],_0x355a0a[_0xaa41('0x159')]));this[_0xaa41('0xe')][_0xaa41('0xac')](util['format'](_0xaa41('0x15c'),this[_0xaa41('0xe')][_0xaa41('0x3b')],_0x355a0a[_0xaa41('0x159')]));return{'code':0xc8,'result':_0xaa41('0x161')};}else{logger['info'](util['format'](_0xaa41('0x15d'),this[_0xaa41('0xe')][_0xaa41('0x3b')],_0x355a0a[_0xaa41('0x159')]));this['channel']['noop'](util[_0xaa41('0x2a')](_0xaa41('0x15d'),this[_0xaa41('0xe')][_0xaa41('0x3b')],_0x355a0a[_0xaa41('0x159')]));return{'code':0xc8,'result':_0xaa41('0x162')};}};AGIVertices[_0xaa41('0x11')][_0xaa41('0x163')]=function(_0xe17c97){logger[_0xaa41('0x2d')](util['format'](_0xaa41('0x164'),_0xe17c97[_0xaa41('0x37')]));if(!this[_0xaa41('0x87')](_0xe17c97[_0xaa41('0x165')])){return this['channel']['error'](_0xe17c97,'no\x20operation\x20configured');}this['channel']['noop'](util[_0xaa41('0x2a')](_0xaa41('0x166'),_0xe17c97[_0xaa41('0x165')]));var _0x26109b=eval(_0xe17c97[_0xaa41('0x165')]);if(!this[_0xaa41('0x87')](_0xe17c97[_0xaa41('0xde')])){return this['channel']['noop'](_0xaa41('0xdf'));}var _0x4ad5eb=this[_0xaa41('0x12')][_0xaa41('0xa8')](this,_0xe17c97[_0xaa41('0xde')]);if(!_0x4ad5eb){return this[_0xaa41('0xe')][_0xaa41('0x54')](_0xe17c97,'no\x20variable\x20found');}if(_[_0xaa41('0x9b')](_0x26109b)){var _0x44b82d=this;_0x26109b['forEach'](function(_0x41c793,_0x14ff8e){_0x44b82d['channel'][_0xaa41('0xa1')](util[_0xaa41('0x2a')](_0xaa41('0x167'),_0x4ad5eb,_0x14ff8e),_0x41c793);});return this[_0xaa41('0xe')][_0xaa41('0xac')](util['format'](_0xaa41('0x168'),_0x4ad5eb));}else{return this[_0xaa41('0xe')][_0xaa41('0xa1')](_0x4ad5eb,_0x26109b);}};AGIVertices['prototype'][_0xaa41('0x169')]=function(_0x4fdc46){logger[_0xaa41('0x2d')](util[_0xaa41('0x2a')](_0xaa41('0x16a'),_0x4fdc46['label']));if(_0x4fdc46[_0xaa41('0xa9')]===0x0){return this['maxRetry'](_0x4fdc46);}_0x4fdc46[_0xaa41('0xa9')]-=0x1;if(!this['isConfigured'](_0x4fdc46['file_id'])){return this[_0xaa41('0xe')]['error'](_0x4fdc46,_0xaa41('0x116'));}var _0x76cbc1=this[_0xaa41('0x1f')][_0xaa41('0xa8')](this,_0x4fdc46[_0xaa41('0x115')]);if(!_0x76cbc1){return this[_0xaa41('0xe')][_0xaa41('0x54')](_0x4fdc46,'no\x20file\x20audio\x20found');}var _0xd6f567=this[_0xaa41('0xe')]['getData'](_0x76cbc1,_0x4fdc46[_0xaa41('0x118')],_0x4fdc46[_0xaa41('0x16b')]);var _0x282c23=_0xd6f567[_0xaa41('0xa5')];if(_0xd6f567[_0xaa41('0xa5')]===-0x1){this[_0xaa41('0x35')][_0xaa41('0xa8')](this,_0x4fdc46,'-1');return _0xd6f567;}else if(_0xd6f567[_0xaa41('0xa3')]===_0xaa41('0x67')){_0xd6f567['result']=_0xd6f567[_0xaa41('0xa5')][_0xaa41('0x9c')]>0x0?_0xd6f567[_0xaa41('0xa5')]:'t';}else if(_[_0xaa41('0x44')](_0xd6f567[_0xaa41('0xa5')])){_0xd6f567[_0xaa41('0xa5')]='#';_0x282c23='#';}if(!this[_0xaa41('0x87')](_0x4fdc46[_0xaa41('0xde')])){this[_0xaa41('0xe')][_0xaa41('0xac')]('no\x20variable\x20selected\x20for\x20the\x20result');}else{var _0x39ff85=this[_0xaa41('0x12')][_0xaa41('0xa8')](this,_0x4fdc46[_0xaa41('0xde')]);if(!_0x39ff85){return this[_0xaa41('0xe')][_0xaa41('0x54')](_0x4fdc46,_0xaa41('0x11b'));}this[_0xaa41('0xe')][_0xaa41('0xa1')](_0x39ff85,_0x282c23);}this['createSquareDetailsReport']['sync'](this,_0x4fdc46,_0x282c23);return _0xd6f567;};AGIVertices['prototype']['noop']=function(_0x111144){logger[_0xaa41('0x2d')](util[_0xaa41('0x2a')](_0xaa41('0x16c'),_0x111144[_0xaa41('0x37')]));return this[_0xaa41('0xe')][_0xaa41('0xac')](_0x111144[_0xaa41('0x16d')]||_0x111144[_0xaa41('0x37')]);};AGIVertices[_0xaa41('0x11')]['pause']=function(_0xc3f7a1){logger[_0xaa41('0x2d')](util['format'](_0xaa41('0x16e'),_0xc3f7a1[_0xaa41('0x37')]));if(!this[_0xaa41('0x87')](_0xc3f7a1[_0xaa41('0x159')])){return this[_0xaa41('0xe')][_0xaa41('0x54')](_0xc3f7a1,_0xaa41('0x160'));}logger[_0xaa41('0x2d')](util[_0xaa41('0x2a')](_0xaa41('0x15a'),this['channel'][_0xaa41('0x3b')],_0xc3f7a1[_0xaa41('0x159')]));var _0x5702b6=this[_0xaa41('0x4e')][_0xaa41('0xa8')](this,_0xc3f7a1['pause_id']);var _0x570624=this[_0xaa41('0x50')]['sync'](this,_0xc3f7a1[_0xaa41('0x159')],_0x5702b6);if(_0x570624){logger['info'](util['format']('AGENT\x20%s\x20FOUND\x20BY',this[_0xaa41('0xe')][_0xaa41('0x3b')],_0xc3f7a1['findBy']));this[_0xaa41('0xe')]['noop'](util[_0xaa41('0x2a')](_0xaa41('0x15c'),this[_0xaa41('0xe')]['callerid'],_0xc3f7a1['findBy']));return{'code':0xc8,'result':_0xaa41('0x161')};}else{logger['info'](util['format']('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0xaa41('0xe')][_0xaa41('0x3b')],_0xc3f7a1[_0xaa41('0x159')]));this[_0xaa41('0xe')][_0xaa41('0xac')](util[_0xaa41('0x2a')](_0xaa41('0x15c'),this['channel'][_0xaa41('0x3b')],_0xc3f7a1[_0xaa41('0x159')]));return{'code':0xc8,'result':_0xaa41('0x162')};}};AGIVertices[_0xaa41('0x11')]['playback']=function(_0x322b16){logger['info'](util['format']('Enter\x20in\x20PLAYBACK\x20(%s)\x20block',_0x322b16[_0xaa41('0x37')]));if(!this['isConfigured'](_0x322b16[_0xaa41('0x115')])){return this['channel'][_0xaa41('0x54')](_0x322b16,_0xaa41('0x116'));}var _0x2b4567=this[_0xaa41('0x1f')][_0xaa41('0xa8')](this,_0x322b16['file_id']);if(!_0x2b4567){return this[_0xaa41('0xe')][_0xaa41('0x54')](_0x322b16,_0xaa41('0x117'));}var _0x26504=this[_0xaa41('0xe')][_0xaa41('0x59')](_0xaa41('0x16f'),[_0x2b4567,_0x322b16[_0xaa41('0xea')]]);if(_0x26504['result']===-0x1){return _0x26504;}return this[_0xaa41('0xe')]['noop'](util[_0xaa41('0x2a')](_0xaa41('0xc6'),_0xaa41('0x16f'),_0x2b4567));};AGIVertices[_0xaa41('0x11')][_0xaa41('0x170')]=function(_0x5ddd46){logger['info'](util[_0xaa41('0x2a')](_0xaa41('0x171'),_0x5ddd46[_0xaa41('0x37')]));if(!this[_0xaa41('0x87')](_0x5ddd46[_0xaa41('0x172')])){return this[_0xaa41('0xe')][_0xaa41('0x54')](_0x5ddd46,_0xaa41('0x173'));}var _0x88f22e='';var _0x5a0fa3=parseInt(_0x5ddd46['queue_id'],0xa);if(isNaN(_0x5a0fa3)){_0x88f22e=_0x5ddd46[_0xaa41('0x172')];}else{_0x88f22e=this['getVoiceQueue'][_0xaa41('0xa8')](this,_0x5ddd46[_0xaa41('0x172')]);if(!_0x88f22e){return this[_0xaa41('0xe')][_0xaa41('0x54')](_0x5ddd46,_0xaa41('0x174'));}}var _0x322e6e='';if(this[_0xaa41('0x87')](_0x5ddd46[_0xaa41('0x115')])){var _0x15d85a=this['getSound'][_0xaa41('0xa8')](this,_0x5ddd46[_0xaa41('0x115')]);if(_0x15d85a){_0x322e6e=_0x15d85a;}}this[_0xaa41('0x35')][_0xaa41('0xa8')](this,_0x5ddd46,_0x88f22e);if(_0x5ddd46[_0xaa41('0xea')][_0xaa41('0x175')]('x')<0x0){_0x5ddd46[_0xaa41('0xea')]+='x';}if(_0x5ddd46[_0xaa41('0xea')][_0xaa41('0x175')]('X')<0x0){_0x5ddd46[_0xaa41('0xea')]+='X';}this[_0xaa41('0xe')][_0xaa41('0xa1')](_0xaa41('0x176'),_0x88f22e?_0x88f22e[_0xaa41('0x177')]():'');var _0x35a63c=this[_0xaa41('0xe')][_0xaa41('0x59')](_0xaa41('0x178'),[_0x88f22e,_0x5ddd46[_0xaa41('0xea')],_0x5ddd46[_0xaa41('0x65')],_0x322e6e,_0x5ddd46[_0xaa41('0x67')],_0x5ddd46[_0xaa41('0x8')],_0x5ddd46['macro'],_0x5ddd46[_0xaa41('0x179')],'',_0x5ddd46[_0xaa41('0x17a')]]);if(_0x35a63c[_0xaa41('0xa5')]===-0x1){return _0x35a63c;}return this[_0xaa41('0xe')][_0xaa41('0xac')](util[_0xaa41('0x2a')]('Executed\x20command\x20%s\x20%s',_0xaa41('0x178'),_0x88f22e));};AGIVertices[_0xaa41('0x11')]['record']=function(_0x316424){logger[_0xaa41('0x2d')](util[_0xaa41('0x2a')](_0xaa41('0x17b'),_0x316424[_0xaa41('0x37')]));var _0x1fbf05=_0x316424['recordingFormat']||'wav';var _0x45e0e3=util[_0xaa41('0x2a')](_0xaa41('0x17c'),this[_0xaa41('0xe')][_0xaa41('0x36')],rs['generate'](0x5));var _0x28de06=util['format'](_0xaa41('0x17d'),FILES_PATH,_0x45e0e3,_0x1fbf05);var _0x499eda=util['format'](_0xaa41('0x133'),FILES_PATH,_0x45e0e3);this[_0xaa41('0x3a')][_0xaa41('0xa8')](this,_0x316424,_0x45e0e3,_0x28de06);this[_0xaa41('0xe')][_0xaa41('0xa1')](_0xaa41('0x17e'),_0x45e0e3);logger[_0xaa41('0x2d')]('Recording\x20%s\x20%s\x20%s\x20%s',_0x499eda,_0x1fbf05,_0x316424[_0xaa41('0x17f')],_0x316424[_0xaa41('0x67')]);return this[_0xaa41('0xe')][_0xaa41('0x135')](_0x499eda,_0x1fbf05,_0x316424['escape_digits'],_0x316424[_0xaa41('0x67')],undefined,!![]);};AGIVertices['prototype']['restapi']=function(_0x5b7fd8){logger[_0xaa41('0x2d')](util['format'](_0xaa41('0x180'),_0x5b7fd8[_0xaa41('0x37')]));if(!this['isConfigured'](_0x5b7fd8[_0xaa41('0x65')])){return this[_0xaa41('0xe')][_0xaa41('0xac')]('no\x20url\x20configured');}var _0xa04eb1=this[_0xaa41('0x181')][_0xaa41('0xa8')](this,_0x5b7fd8);logger['info'](util[_0xaa41('0x2a')](_0xaa41('0x182'),util['inspect'](_0xa04eb1,{'showHidden':![],'depth':null})));if(!this[_0xaa41('0x87')](_0x5b7fd8[_0xaa41('0xde')])){return this[_0xaa41('0xe')][_0xaa41('0xac')](_0xaa41('0x183'));}var _0x2dd406=this[_0xaa41('0x12')]['sync'](this,_0x5b7fd8[_0xaa41('0xde')]);if(!_0x2dd406){return this['channel']['error'](_0x5b7fd8,_0xaa41('0x11b'));}this[_0xaa41('0xe')][_0xaa41('0xa1')](util['format']('%s_STATUS_CODE',_0x2dd406),_0xa04eb1[_0xaa41('0x76')]?_0xa04eb1[_0xaa41('0x76')]:_0xaa41('0x184'));this[_0xaa41('0xe')][_0xaa41('0xa1')](util['format'](_0xaa41('0x185'),_0x2dd406),_0xa04eb1[_0xaa41('0x77')]?_0xa04eb1[_0xaa41('0x77')]:'OK');if(_0xa04eb1['body']){try{this[_0xaa41('0x9e')](_0xa04eb1[_0xaa41('0x6c')],_0x2dd406);}catch(_0x598374){logger[_0xaa41('0x54')](util['format']('Unable\x20to\x20set\x20result\x20in\x20variable\x20%s',_0x2dd406));}}return this['channel'][_0xaa41('0xac')](util[_0xaa41('0x2a')]('variable\x20%s\x20set',_0x2dd406));};AGIVertices[_0xaa41('0x11')][_0xaa41('0x186')]=function(_0x2f34a6){logger['info'](util[_0xaa41('0x2a')](_0xaa41('0x187'),_0x2f34a6[_0xaa41('0x37')]));return this[_0xaa41('0xe')][_0xaa41('0x188')](_0x2f34a6[_0xaa41('0x189')][_0xaa41('0x5a')](/\s+/g,''),_0x2f34a6[_0xaa41('0x17f')]);};AGIVertices[_0xaa41('0x11')]['saynumber']=function(_0x1f4656){logger[_0xaa41('0x2d')](util[_0xaa41('0x2a')](_0xaa41('0x18a'),_0x1f4656[_0xaa41('0x37')]));return this[_0xaa41('0xe')][_0xaa41('0x18b')](_0x1f4656['number'][_0xaa41('0x5a')](/\s+/g,''),_0x1f4656[_0xaa41('0x17f')]);};AGIVertices[_0xaa41('0x11')][_0xaa41('0x18c')]=function(_0x1f6d7c){logger[_0xaa41('0x2d')](util[_0xaa41('0x2a')](_0xaa41('0x18d'),_0x1f6d7c[_0xaa41('0x37')]));return this[_0xaa41('0xe')]['sayPhonetic'](_0x1f6d7c['text'],_0x1f6d7c['escape_digits']);};AGIVertices[_0xaa41('0x11')][_0xaa41('0x18e')]=function(_0x321d12){logger[_0xaa41('0x2d')](util['format'](_0xaa41('0x18f'),_0x321d12['label']));if(!this[_0xaa41('0x87')](_0x321d12[_0xaa41('0x190')])){return this[_0xaa41('0xe')][_0xaa41('0xac')](_0xaa41('0x191'));}var _0x472e95=this[_0xaa41('0x22')][_0xaa41('0xa8')](this,_0x321d12[_0xaa41('0x190')]);if(!_0x472e95||!_0x472e95['Smtp']){return this[_0xaa41('0xe')][_0xaa41('0x54')](_0x321d12,_0xaa41('0x192'));}var _0x2911c5={'from':util[_0xaa41('0x2a')]('\x22%s\x22\x20<%s>',_0x472e95['name'],_0x472e95[_0xaa41('0x193')]||_0x472e95[_0xaa41('0x194')][_0xaa41('0x195')]),'to':_0x321d12['to']||'','cc':_0x321d12['cc']||'','bcc':_0x321d12[_0xaa41('0x196')]||'','subject':_0x321d12[_0xaa41('0x197')],'html':_0x321d12[_0xaa41('0x5e')],'text':_0x321d12[_0xaa41('0x5e')]};if(this[_0xaa41('0x87')](_0x321d12[_0xaa41('0x198')])){}logger[_0xaa41('0xe5')](_0xaa41('0x199'),JSON[_0xaa41('0x74')](_0x2911c5));this[_0xaa41('0x35')][_0xaa41('0xa8')](this,_0x321d12,_0x321d12['account_id']);this[_0xaa41('0xe')][_0xaa41('0xac')](util[_0xaa41('0x2a')](_0xaa41('0x19a'),_0x472e95[_0xaa41('0x17')]));this[_0xaa41('0x23')][_0xaa41('0xa8')](this,_0x472e95[_0xaa41('0x19b')],_0x2911c5);return this[_0xaa41('0xe')]['noop'](_0xaa41('0x19c'));};AGIVertices[_0xaa41('0x11')][_0xaa41('0x19d')]=function(_0x4ca9a1){logger['info'](util['format'](_0xaa41('0x19e'),_0x4ca9a1[_0xaa41('0x37')]));return this[_0xaa41('0xe')]['noop'](_0xaa41('0x19f'));};AGIVertices[_0xaa41('0x11')][_0xaa41('0x1a0')]=function(_0xd43717){logger[_0xaa41('0x2d')](util[_0xaa41('0x2a')](_0xaa41('0x1a1'),_0xd43717['label']));if(!this['isConfigured'](_0xd43717[_0xaa41('0x1a2')])){return this[_0xaa41('0xe')][_0xaa41('0xac')]('no\x20sms\x20account\x20configured');}var _0xe20a75=this[_0xaa41('0x32')][_0xaa41('0xa8')](this,_0xd43717[_0xaa41('0x1a2')]);if(!_0xe20a75){return this[_0xaa41('0xe')]['error'](_0xd43717,_0xaa41('0x1a3'));}var _0x4c808c={'body':_0xd43717[_0xaa41('0x1a4')],'phone':_0xd43717['to']||'','SmsAccountId':_0xe20a75['id']};logger[_0xaa41('0xe5')](_0xaa41('0x1a5'),JSON[_0xaa41('0x74')](_0x4c808c));this[_0xaa41('0x35')][_0xaa41('0xa8')](this,_0xd43717,_0xd43717['sms_account_id']);this[_0xaa41('0xe')][_0xaa41('0xac')](util['format'](_0xaa41('0x1a6'),_0xe20a75[_0xaa41('0x17')]));this[_0xaa41('0x34')]['sync'](this,_0x4c808c);return this[_0xaa41('0xe')]['noop']('Sms\x20message\x20added\x20to\x20outgoing\x20process');};AGIVertices[_0xaa41('0x11')][_0xaa41('0x1a7')]=function(_0x4e3be7){logger[_0xaa41('0x2d')](util[_0xaa41('0x2a')](_0xaa41('0x1a8'),_0x4e3be7[_0xaa41('0x37')]));if(!this[_0xaa41('0x87')](_0x4e3be7[_0xaa41('0xde')])){return this[_0xaa41('0xe')][_0xaa41('0x54')](_0x4e3be7,_0xaa41('0x1a9'));}var _0x37c840=this[_0xaa41('0x12')]['sync'](this,_0x4e3be7[_0xaa41('0xde')]);if(!_0x37c840){return this['channel']['error'](_0x4e3be7,_0xaa41('0x11b'));}return this[_0xaa41('0xe')][_0xaa41('0xa1')](_0x37c840,_0x4e3be7['variable_value']);};AGIVertices['prototype'][_0xaa41('0x1aa')]=function(_0x2eb4e5){logger[_0xaa41('0x2d')](util[_0xaa41('0x2a')](_0xaa41('0x1ab'),_0x2eb4e5[_0xaa41('0x37')]));this[_0xaa41('0xe')][_0xaa41('0xac')](_0xaa41('0x1ac'));var _0x55b651=this['channel'][_0xaa41('0x12')](_0xaa41('0x1ad'));if(!_['isEmpty'](_0x55b651[_0xaa41('0xa3')])){this[_0xaa41('0xe')][_0xaa41('0x36')]=_0x55b651[_0xaa41('0xa3')];}if(_0x2eb4e5['answer']==='yes'){this[_0xaa41('0xe')]['noop']('Answer');return this['channel'][_0xaa41('0xbb')]();}return this['channel']['noop'](_0xaa41('0x1ae'));};AGIVertices[_0xaa41('0x11')]['subproject']=function(_0x504de6){logger[_0xaa41('0x2d')](util[_0xaa41('0x2a')]('Enter\x20in\x20SUBPROJECT\x20(%s)\x20block',_0x504de6['label']));if(!this[_0xaa41('0x87')](_0x504de6['project_id'])){return this['channel'][_0xaa41('0x54')](_0x504de6,'no\x20subproject\x20selected');}var _0x5b8dbb=this[_0xaa41('0x18')][_0xaa41('0xa8')](this,_0x504de6[_0xaa41('0x1af')]);if(!this[_0xaa41('0x87')](_0x5b8dbb)){return this['channel'][_0xaa41('0x54')](_0x504de6,util[_0xaa41('0x2a')]('no\x20subproject\x20found\x20with\x20id\x20%d',_0x504de6[_0xaa41('0x1af')]));}if(_0x5b8dbb===this[_0xaa41('0xe')][_0xaa41('0x39')]){return this[_0xaa41('0xe')][_0xaa41('0x54')](_0x504de6,'project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project');}this[_0xaa41('0x35')][_0xaa41('0xa8')](this,_0x504de6,_0x5b8dbb);var _0x2e9add=this[_0xaa41('0xe')]['exec']('AGI',util[_0xaa41('0x2a')](_0xaa41('0x1b0'),config[_0xaa41('0x8')][_0xaa41('0x1b1')]||_0xaa41('0x1b2'),_0x5b8dbb,this[_0xaa41('0xe')][_0xaa41('0x39')]));if(_0x2e9add[_0xaa41('0xa5')]===-0x1){return _0x2e9add;}return this[_0xaa41('0xe')][_0xaa41('0xac')](util[_0xaa41('0x2a')](_0xaa41('0xc6'),'AGI',_0x5b8dbb));};AGIVertices[_0xaa41('0x11')][_0xaa41('0x1b3')]=function(_0x32965b){logger[_0xaa41('0x2d')](util[_0xaa41('0x2a')]('Enter\x20in\x20SYSTEM\x20(%s)\x20block',_0x32965b[_0xaa41('0x37')]));var _0x287875=this[_0xaa41('0x58')]['sync'](this,_0x32965b[_0xaa41('0xb9')]);this[_0xaa41('0x35')]['sync'](this,_0x32965b,_0x32965b[_0xaa41('0xb9')]);if(this[_0xaa41('0x87')](_0x32965b[_0xaa41('0xde')])){var _0x2518e7=this['getVariable'][_0xaa41('0xa8')](this,_0x32965b[_0xaa41('0xde')]);if(_0x2518e7){this[_0xaa41('0xe')]['setVariable'](_0x2518e7,_0x287875);return this[_0xaa41('0xe')][_0xaa41('0xac')](util[_0xaa41('0x2a')](_0xaa41('0x1b4'),_0x32965b[_0xaa41('0xb9')],_0x2518e7));}}return this[_0xaa41('0xe')]['noop'](util['format'](_0xaa41('0x1b5'),_0x32965b[_0xaa41('0xb9')]));};AGIVertices[_0xaa41('0x11')][_0xaa41('0x1b6')]=function(_0x54c575){logger[_0xaa41('0x2d')](util[_0xaa41('0x2a')](_0xaa41('0x1b7'),_0x54c575['label']));_0x54c575[_0xaa41('0x5e')]=_0x54c575[_0xaa41('0x5e')][_0xaa41('0x5a')](/(\r\n|\n|\r)/gm,'\x20');if(!this['isConfigured'](_0x54c575[_0xaa41('0x5c')])){return this[_0xaa41('0xe')][_0xaa41('0xac')](_0xaa41('0x1b8'));}if(!this[_0xaa41('0x87')](_0x54c575[_0xaa41('0x5e')])){return this[_0xaa41('0xe')]['noop']('no\x20text\x20configured');}this['channel'][_0xaa41('0xac')](util[_0xaa41('0x2a')](_0xaa41('0x1b9'),_0x54c575[_0xaa41('0x5e')]));var _0x4ebc1e=this[_0xaa41('0x5b')][_0xaa41('0xa8')](this,_0x54c575);if(_0x4ebc1e){this[_0xaa41('0xe')][_0xaa41('0xac')](util[_0xaa41('0x2a')](_0xaa41('0x1ba'),_0x4ebc1e));var _0x4b5ba4=this[_0xaa41('0xe')]['streamFile'](_0x4ebc1e);try{fs[_0xaa41('0x155')](_0x4ebc1e+'.wav');}catch(_0xd9442b){logger['error'](_0xd9442b);}return _0x4b5ba4;}return this[_0xaa41('0xe')]['error'](_0x54c575,'Google\x20Cloud\x20TTS\x20is\x20unreachable');};AGIVertices[_0xaa41('0x11')]['tts']=function(_0xdc94d8){logger[_0xaa41('0x2d')](util[_0xaa41('0x2a')](_0xaa41('0x1bb'),_0xdc94d8[_0xaa41('0x37')]));_0xdc94d8[_0xaa41('0x5e')]=_0xdc94d8['text'][_0xaa41('0x5a')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0xaa41('0x87')](_0xdc94d8[_0xaa41('0x5e')])){return this[_0xaa41('0xe')][_0xaa41('0xac')](_0xaa41('0xc8'));}this[_0xaa41('0xe')][_0xaa41('0xac')](util[_0xaa41('0x2a')](_0xaa41('0x1bc'),_0xdc94d8[_0xaa41('0x5e')]));var _0x2e3fe6=this[_0xaa41('0x63')][_0xaa41('0xa8')](this,_0xdc94d8);if(_0x2e3fe6){this['channel']['noop'](util[_0xaa41('0x2a')](_0xaa41('0x1bd'),_0x2e3fe6));var _0x1b3d9b=this['channel'][_0xaa41('0x127')](_0x2e3fe6);try{fs[_0xaa41('0x155')](_0x2e3fe6+'.wav');}catch(_0x3b5a25){logger[_0xaa41('0x54')](_0x3b5a25);}return _0x1b3d9b;}return this[_0xaa41('0xe')][_0xaa41('0x54')](_0xdc94d8,_0xaa41('0x1be'));};AGIVertices[_0xaa41('0x11')][_0xaa41('0x1bf')]=function(_0x391b5a){logger[_0xaa41('0x2d')](util[_0xaa41('0x2a')]('Enter\x20in\x20UNPAUSE\x20(%s)\x20block',_0x391b5a[_0xaa41('0x37')]));if(!this[_0xaa41('0x87')](_0x391b5a[_0xaa41('0x159')])){return this[_0xaa41('0xe')][_0xaa41('0x54')](_0x391b5a,'no\x20find\x20by\x20configured');}logger[_0xaa41('0x2d')](util[_0xaa41('0x2a')](_0xaa41('0x15a'),this[_0xaa41('0xe')]['callerid'],_0x391b5a[_0xaa41('0x159')]));var _0x5691af=this[_0xaa41('0x52')][_0xaa41('0xa8')](this,_0x391b5a['findBy']);if(_0x5691af){logger[_0xaa41('0x2d')](util[_0xaa41('0x2a')]('AGENT\x20%s\x20FOUND\x20BY',this[_0xaa41('0xe')]['callerid'],_0x391b5a[_0xaa41('0x159')]));this['channel'][_0xaa41('0xac')](util[_0xaa41('0x2a')](_0xaa41('0x15c'),this[_0xaa41('0xe')][_0xaa41('0x3b')],_0x391b5a[_0xaa41('0x159')]));return{'code':0xc8,'result':_0xaa41('0x161')};}else{logger['info'](util['format'](_0xaa41('0x15d'),this[_0xaa41('0xe')]['callerid'],_0x391b5a[_0xaa41('0x159')]));this[_0xaa41('0xe')]['noop'](util[_0xaa41('0x2a')](_0xaa41('0x15d'),this[_0xaa41('0xe')][_0xaa41('0x3b')],_0x391b5a[_0xaa41('0x159')]));return{'code':0xc8,'result':_0xaa41('0x162')};}};AGIVertices[_0xaa41('0x11')][_0xaa41('0x1c0')]=function(_0x426985){logger['info'](util[_0xaa41('0x2a')](_0xaa41('0x1c1'),_0x426985['label']));var _0x1c8d59=this[_0xaa41('0xe')][_0xaa41('0x59')](_0xaa41('0x1c2'),[_0x426985[_0xaa41('0x1c3')],_0x426985['options']]);if(_0x1c8d59['result']===-0x1){return _0x1c8d59;}return this[_0xaa41('0xe')][_0xaa41('0xac')](util[_0xaa41('0x2a')](_0xaa41('0xc6'),'VOICEMAIL',_0x426985[_0xaa41('0x1c3')]));};AGIVertices[_0xaa41('0x11')]['vswitch']=function(_0x173b37){logger[_0xaa41('0x2d')](util['format'](_0xaa41('0x1c4'),_0x173b37[_0xaa41('0x37')]));if(!this[_0xaa41('0x87')](_0x173b37[_0xaa41('0xde')])){return this[_0xaa41('0xe')][_0xaa41('0x54')](_0x173b37,_0xaa41('0x1a9'));}var _0x2b2fc6=this[_0xaa41('0x12')][_0xaa41('0xa8')](this,_0x173b37[_0xaa41('0xde')]);if(!_0x2b2fc6){return this[_0xaa41('0xe')][_0xaa41('0x54')](_0x173b37,_0xaa41('0x11b'));}var _0x5f0199=this[_0xaa41('0xe')][_0xaa41('0x12')](_0x2b2fc6);return{'code':0xc8,'result':_0x5f0199[_0xaa41('0xa3')]?_0x5f0199[_0xaa41('0xa3')]:'-'};};String[_0xaa41('0x11')][_0xaa41('0x1c5')]=function(_0x23c201,_0x27e1d1){return this[_0xaa41('0xa2')](_0x23c201)[_0xaa41('0x1c6')](_0x27e1d1);};module[_0xaa41('0x1c7')]=AGIVertices; \ No newline at end of file diff --git a/server/services/ami/acw/index.js b/server/services/ami/acw/index.js index 4079714..5c23b71 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 _0x6631=['[%s][UPDATE][ACWTIME:%s]','catch','[%s][UPDATE][ERRORS:%s]','finally','interface','queue','ACW','mandatoryDisposition','name','mandatoryDispositionPause','resolve','voicePause','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','[%s][START][AGENT:%s][QUEUE:%s]','attended','destlinkedid','savePause','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','stopAcw','YYYY-MM-DD\x20HH:mm:ss','error','[ACW][START]\x20%s','message','[%s][TIMER][STOP][AGENT:%s]','getAgent','saveUnpause','stringify','[ACW][STOP]\x20%s','[ACW][syncAgentConnect]\x20%s','[ACW][syncAgentConnectPreview]\x20%s','isUndefined','[%s][HANGUP:UNIQUEID]','startAcw','linkedid','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','isNil','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','transfereeuniqueid','[ACW][syncAttendedTransfer]\x20%s','syncBlindTransfer','transfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','transfererlinkedid','[ACW][syncBlindTransfer]\x20%s','autopause','all','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','Auto-Pause','[ACW][syncAgentRingNoAnswer]\x20%s','exports','lodash','moment','../ami','../../../config/logger','acw','../rpc/user','voiceQueues','agents','timers','channels','agentconnect','syncAgentConnect','bind','hanguprequest','syncHangupRequest','hangup','syncAgentRingNoAnswer','attendedtransfer','syncAttendedTransfer','blindtransfer','custom:agentConnectPreview','syncAgentConnectPreview','milliseconds','diff','seconds','prototype','updateAcw','timer','update','uniqueid','then','info'];(function(_0x5ee203,_0x322fd3){var _0x266f00=function(_0x1360bb){while(--_0x1360bb){_0x5ee203['push'](_0x5ee203['shift']());}};_0x266f00(++_0x322fd3);}(_0x6631,0x134));var _0x1663=function(_0x56cf14,_0x2fb4ac){_0x56cf14=_0x56cf14-0x0;var _0x50cea4=_0x6631[_0x56cf14];return _0x50cea4;};'use strict';var _=require(_0x1663('0x0'));var moment=require(_0x1663('0x1'));var ami=require(_0x1663('0x2'));var logger=require(_0x1663('0x3'))(_0x1663('0x4'));var RpcUser=require(_0x1663('0x5'));var RpcVoiceAgentReport=require('../rpc/voiceAgentReport');function Acw(_0x492d72){this[_0x1663('0x6')]=_0x492d72[_0x1663('0x6')];this[_0x1663('0x7')]=_0x492d72[_0x1663('0x7')];this[_0x1663('0x8')]=_0x492d72[_0x1663('0x8')];this[_0x1663('0x9')]={};ami['on'](_0x1663('0xa'),this[_0x1663('0xb')][_0x1663('0xc')](this));ami['on'](_0x1663('0xd'),this[_0x1663('0xe')]['bind'](this));ami['on'](_0x1663('0xf'),this['syncHangup'][_0x1663('0xc')](this));ami['on']('agentringnoanswer',this[_0x1663('0x10')]['bind'](this));ami['on'](_0x1663('0x11'),this[_0x1663('0x12')][_0x1663('0xc')](this));ami['on'](_0x1663('0x13'),this['syncBlindTransfer'][_0x1663('0xc')](this));ami['on'](_0x1663('0x14'),this[_0x1663('0x15')]['bind'](this));}function getDiff(_0x4dc49c){var _0x3cd1ee=moment()[_0x1663('0x16')](0x0);var _0x57a482=moment(_0x4dc49c)[_0x1663('0x16')](0x0);return _0x3cd1ee[_0x1663('0x17')](_0x57a482,_0x1663('0x18'));}Acw[_0x1663('0x19')][_0x1663('0x1a')]=function(_0x202a40,_0x26e925){var _0x30598b=this;var _0x4b3d58=getDiff(_0x30598b['timers'][_0x202a40]['lastPauseAt']);clearTimeout(_0x30598b[_0x1663('0x8')][_0x202a40]['timer']);_0x30598b[_0x1663('0x8')][_0x202a40][_0x1663('0x1b')]=![];return RpcVoiceAgentReport[_0x1663('0x1c')]({'acwtime':_0x4b3d58},_0x30598b[_0x1663('0x8')][_0x202a40][_0x1663('0x1d')],_0x202a40)[_0x1663('0x1e')](function(_0x4853b2){logger[_0x1663('0x1f')](_0x1663('0x20'),_0x26e925,_0x4b3d58,_0x4853b2);})[_0x1663('0x21')](function(_0x377c81){logger['error'](_0x1663('0x22'),_0x26e925,_0x377c81);})[_0x1663('0x23')](function(){delete _0x30598b[_0x1663('0x8')][_0x202a40];});};Acw['prototype']['startAcw']=function(_0x238882){try{var _0x47be55=this;var _0x397898=this[_0x1663('0x9')][_0x238882][_0x1663('0x24')];var _0x4a5aed=this[_0x1663('0x9')][_0x238882][_0x1663('0x25')];var _0x47257a=this[_0x1663('0x6')][_0x4a5aed];var _0x3bfc3b=![];var _0x47121c=_0x1663('0x26');if(_0x47257a[_0x1663('0x27')]&&_0x47257a['mandatoryDispositionPause'][_0x1663('0x28')]){_0x3bfc3b=!![];_0x47121c=_0x47257a[_0x1663('0x29')][_0x1663('0x28')];}if(!_0x47be55[_0x1663('0x7')][_0x397898]){return Promise[_0x1663('0x2a')]();}return RpcUser['getAgent'](_0x47be55['agents'][_0x397898]['id'])[_0x1663('0x1e')](function(_0x8bc641){if(!_0x8bc641||_0x8bc641[_0x1663('0x2b')]){logger[_0x1663('0x1f')](_0x1663('0x2c'),_0x238882,_0x397898,_0x4a5aed);return;}logger[_0x1663('0x1f')](_0x1663('0x2d'),_0x238882,_0x397898,_0x4a5aed);var _0xe26076=_0x47be55['channels'][_0x238882][_0x1663('0x2e')]&&_0x47be55[_0x1663('0x9')][_0x238882][_0x1663('0x2f')]?_0x47be55[_0x1663('0x9')][_0x238882][_0x1663('0x2f')]:_0x238882;return RpcUser[_0x1663('0x30')](_0x47be55['agents'][_0x397898],_0x47121c,_0xe26076);})[_0x1663('0x1e')](function(_0x8f357b){if(_0x3bfc3b||!_0x8f357b){return;}_0x47be55[_0x1663('0x8')][_0x397898]={};logger['info'](_0x1663('0x31'),_0x238882,_0x47be55[_0x1663('0x6')][_0x4a5aed][_0x1663('0x32')],_0x397898,_0x4a5aed);_0x47be55[_0x1663('0x8')][_0x397898][_0x1663('0x1b')]=setTimeout(_0x47be55[_0x1663('0x33')][_0x1663('0xc')](_0x47be55,_0x397898),_0x47be55[_0x1663('0x6')][_0x4a5aed][_0x1663('0x32')]*0x3e8);_0x47be55[_0x1663('0x8')][_0x397898]['lastPauseAt']=moment()['format'](_0x1663('0x34'));_0x47be55[_0x1663('0x8')][_0x397898][_0x1663('0x1d')]=_0x238882;_0x47be55['timers'][_0x397898]['queue']=_0x4a5aed;_0x47be55['timers'][_0x397898]['updateAcw']=_0x47be55['updateAcw'][_0x1663('0xc')](_0x47be55,_0x397898,_0x238882);})[_0x1663('0x21')](function(){logger[_0x1663('0x35')](_0x1663('0x31'),_0x238882,_0x47be55['voiceQueues'][_0x4a5aed][_0x1663('0x32')],_0x397898,_0x4a5aed);})[_0x1663('0x23')](function(){delete _0x47be55[_0x1663('0x9')][_0x238882];});}catch(_0x3a4a05){logger[_0x1663('0x35')](_0x1663('0x36'),_0x3a4a05[_0x1663('0x37')]);}};Acw['prototype']['stopAcw']=function(_0x267256){try{var _0x40c646=this;if(_0x40c646[_0x1663('0x8')][_0x267256]){_0x40c646[_0x1663('0x8')][_0x267256][_0x1663('0x1b')]=![];var _0x648ca1=_0x40c646[_0x1663('0x8')][_0x267256]['uniqueid'];var _0x59c935=_0x40c646['timers'][_0x267256][_0x1663('0x25')];var _0x14e6dd=_0x40c646['voiceQueues'][_0x59c935][_0x1663('0x32')];logger[_0x1663('0x1f')](_0x1663('0x38'),_0x648ca1,_0x267256);RpcUser[_0x1663('0x39')](this['agents'][_0x267256]['id'])['then'](function(_0x24710b){if(_0x24710b['pauseType']==='ACW'){return RpcUser[_0x1663('0x3a')](_0x40c646[_0x1663('0x7')][_0x267256]);}});RpcVoiceAgentReport[_0x1663('0x1c')]({'acwtime':_0x14e6dd,'agentacw':!![]},_0x648ca1,_0x267256)[_0x1663('0x1e')](function(_0x5ba151){logger['info'](_0x1663('0x20'),_0x648ca1,_0x14e6dd,_0x5ba151);})[_0x1663('0x21')](function(_0x71c379){logger[_0x1663('0x35')](_0x1663('0x22'),_0x648ca1,_0x71c379);});}else{logger[_0x1663('0x35')]('[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer',_0x267256);if(_0x40c646[_0x1663('0x8')]){logger[_0x1663('0x1f')]('[ACW][TIMERS]',JSON[_0x1663('0x3b')](_0x40c646[_0x1663('0x8')]));}}}catch(_0x1ebfd2){logger[_0x1663('0x35')](_0x1663('0x3c'),_0x1ebfd2[_0x1663('0x37')]);}};Acw[_0x1663('0x19')][_0x1663('0xb')]=function(_0x1e10c9){try{if(this[_0x1663('0x6')][_0x1e10c9[_0x1663('0x25')]]&&(this[_0x1663('0x6')][_0x1e10c9[_0x1663('0x25')]]['acw']||this['voiceQueues'][_0x1e10c9[_0x1663('0x25')]][_0x1663('0x27')])){if(this[_0x1663('0x7')][_0x1e10c9[_0x1663('0x24')]]){this[_0x1663('0x9')][_0x1e10c9[_0x1663('0x1d')]]={'queue':_0x1e10c9[_0x1663('0x25')],'interface':_0x1e10c9[_0x1663('0x24')],'destlinkedid':_0x1e10c9['destlinkedid']};}}}catch(_0x22cd18){logger[_0x1663('0x35')](_0x1663('0x3d'),_0x22cd18['message']);}};Acw[_0x1663('0x19')][_0x1663('0x15')]=function(_0x3e4e73){try{if(this[_0x1663('0x6')][_0x3e4e73[_0x1663('0x25')]]&&(this[_0x1663('0x6')][_0x3e4e73[_0x1663('0x25')]][_0x1663('0x4')]||this['voiceQueues'][_0x3e4e73['queue']]['mandatoryDisposition'])){if(this[_0x1663('0x7')][_0x3e4e73[_0x1663('0x24')]]){this[_0x1663('0x9')][_0x3e4e73[_0x1663('0x1d')]]={'queue':_0x3e4e73['queue'],'interface':_0x3e4e73[_0x1663('0x24')]};}}}catch(_0x5ecfe4){logger['error'](_0x1663('0x3e'),_0x5ecfe4['message']);}};Acw[_0x1663('0x19')]['syncHangupRequest']=function(_0x9c4c16){try{if(this['channels'][_0x9c4c16[_0x1663('0x1d')]]&&_[_0x1663('0x3f')](this['channels'][_0x9c4c16[_0x1663('0x1d')]][_0x1663('0x2e')])){logger[_0x1663('0x1f')](_0x1663('0x40'),_0x9c4c16[_0x1663('0x1d')]);this[_0x1663('0x41')](_0x9c4c16[_0x1663('0x1d')]);}else if(this['channels'][_0x9c4c16[_0x1663('0x42')]]&&_[_0x1663('0x3f')](this['channels'][_0x9c4c16[_0x1663('0x42')]]['attended'])){logger['info']('[%s][HANGUP:LINKEDID]',_0x9c4c16[_0x1663('0x42')]);this[_0x1663('0x41')](_0x9c4c16[_0x1663('0x42')]);}}catch(_0x1053a3){logger['error']('[ACW][syncHangupRequest]\x20%s',_0x1053a3[_0x1663('0x37')]);}};Acw[_0x1663('0x19')]['syncHangup']=function(_0x1e8f1b){try{if(this[_0x1663('0x9')][_0x1e8f1b[_0x1663('0x1d')]]&&this[_0x1663('0x9')][_0x1e8f1b['uniqueid']][_0x1663('0x2e')]){logger[_0x1663('0x1f')](_0x1663('0x43'),_0x1e8f1b[_0x1663('0x1d')]);this[_0x1663('0x41')](_0x1e8f1b[_0x1663('0x1d')]);}else if(this[_0x1663('0x9')][_0x1e8f1b['linkedid']]&&this[_0x1663('0x9')][_0x1e8f1b['linkedid']][_0x1663('0x2e')]){logger[_0x1663('0x1f')]('[%s][HANGUPATTENDEDTRANSFER:LINKEDID]',_0x1e8f1b[_0x1663('0x42')]);this[_0x1663('0x41')](_0x1e8f1b[_0x1663('0x42')]);}}catch(_0x3c9d60){logger[_0x1663('0x35')]('[ACW][syncHangup]\x20%s',_0x3c9d60[_0x1663('0x37')]);}};Acw[_0x1663('0x19')][_0x1663('0x12')]=function(_0x314091){try{if(!_[_0x1663('0x44')](this[_0x1663('0x9')][_0x314091['transfereeuniqueid']])){this[_0x1663('0x41')](_0x314091['transfereeuniqueid']);if(this[_0x1663('0x9')][_0x314091[_0x1663('0x45')]]){this[_0x1663('0x9')][_0x314091['secondtransfereruniqueid']][_0x1663('0x2e')]=!![];this[_0x1663('0x9')][_0x314091['transfertargetuniqueid']]=this[_0x1663('0x9')][_0x314091[_0x1663('0x45')]];delete this[_0x1663('0x9')][_0x314091[_0x1663('0x45')]];}}else if(!_['isNil'](this[_0x1663('0x9')][_0x314091['transfertargetuniqueid']])){this[_0x1663('0x41')](_0x314091[_0x1663('0x46')]);if(this[_0x1663('0x9')][_0x314091['origtransfereruniqueid']]){this[_0x1663('0x9')][_0x314091[_0x1663('0x47')]][_0x1663('0x2e')]=!![];this['channels'][_0x314091[_0x1663('0x48')]]=this[_0x1663('0x9')][_0x314091['origtransfereruniqueid']];delete this['channels'][_0x314091[_0x1663('0x47')]];}}}catch(_0x218bed){logger[_0x1663('0x35')](_0x1663('0x49'),_0x218bed[_0x1663('0x37')]);}};Acw[_0x1663('0x19')][_0x1663('0x4a')]=function(_0x4d187a){try{if(this[_0x1663('0x9')][_0x4d187a[_0x1663('0x4b')]]){logger['info'](_0x1663('0x4c'),JSON[_0x1663('0x3b')](_0x4d187a[_0x1663('0x4b')]));this[_0x1663('0x41')](_0x4d187a['transfereruniqueid']);}else if(this['channels'][_0x4d187a[_0x1663('0x4d')]]){logger[_0x1663('0x1f')]('[%s][BLINDTRANSFER:LINKEDID]',JSON[_0x1663('0x3b')](_0x4d187a[_0x1663('0x4d')]));this['startAcw'](_0x4d187a[_0x1663('0x4d')]);}}catch(_0xd8944e){logger[_0x1663('0x35')](_0x1663('0x4e'),_0xd8944e['message']);}};Acw[_0x1663('0x19')][_0x1663('0x10')]=function(_0xce696b){try{if(this['voiceQueues'][_0xce696b[_0x1663('0x25')]]&&this[_0x1663('0x6')][_0xce696b[_0x1663('0x25')]][_0x1663('0x4f')]===_0x1663('0x50')){if(this[_0x1663('0x7')][_0xce696b['interface']]){logger['info'](_0x1663('0x51'),_0xce696b[_0x1663('0x1d')],_0xce696b[_0x1663('0x24')],_0xce696b['queue']);return RpcUser['savePause'](this[_0x1663('0x7')][_0xce696b[_0x1663('0x24')]],_0x1663('0x52'),_0xce696b[_0x1663('0x1d')]);}}}catch(_0x8ce14a){logger['error'](_0x1663('0x53'),_0x8ce14a[_0x1663('0x37')]);}};module[_0x1663('0x54')]=Acw; \ No newline at end of file +var _0x4fbf=['[%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','autopause','all','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','Auto-Pause','[ACW][syncAgentRingNoAnswer]\x20%s','moment','../../../config/logger','acw','../rpc/user','voiceQueues','agents','timers','channels','agentconnect','syncAgentConnect','bind','syncHangupRequest','hangup','syncHangup','agentringnoanswer','syncAgentRingNoAnswer','attendedtransfer','blindtransfer','syncBlindTransfer','custom:agentConnectPreview','syncAgentConnectPreview','milliseconds','seconds','prototype','updateAcw','timer','update','uniqueid','then','info','[%s][UPDATE][ACWTIME:%s]','catch','error','[%s][UPDATE][ERRORS:%s]','startAcw','interface','queue','ACW','mandatoryDisposition','name','mandatoryDispositionPause','resolve','getAgent','voicePause','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','[%s][START][AGENT:%s][QUEUE:%s]','attended','destlinkedid','savePause','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','lastPauseAt','format','YYYY-MM-DD\x20HH:mm:ss','finally','[ACW][START]\x20%s','message','[%s][TIMER][STOP][AGENT:%s]','pauseType','saveUnpause','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][TIMERS]','stringify','[ACW][STOP]\x20%s','[ACW][syncAgentConnectPreview]\x20%s','isUndefined','[%s][HANGUP:UNIQUEID]','linkedid','[%s][HANGUP:LINKEDID]','[ACW][syncHangupRequest]\x20%s'];(function(_0x2bdefe,_0x43fd8){var _0x5c6ab5=function(_0x1d283f){while(--_0x1d283f){_0x2bdefe['push'](_0x2bdefe['shift']());}};_0x5c6ab5(++_0x43fd8);}(_0x4fbf,0x11e));var _0xf4fb=function(_0x5ba565,_0x583217){_0x5ba565=_0x5ba565-0x0;var _0x22fe01=_0x4fbf[_0x5ba565];return _0x22fe01;};'use strict';var _=require('lodash');var moment=require(_0xf4fb('0x0'));var ami=require('../ami');var logger=require(_0xf4fb('0x1'))(_0xf4fb('0x2'));var RpcUser=require(_0xf4fb('0x3'));var RpcVoiceAgentReport=require('../rpc/voiceAgentReport');function Acw(_0x1a5339){this[_0xf4fb('0x4')]=_0x1a5339[_0xf4fb('0x4')];this[_0xf4fb('0x5')]=_0x1a5339[_0xf4fb('0x5')];this[_0xf4fb('0x6')]=_0x1a5339[_0xf4fb('0x6')];this[_0xf4fb('0x7')]={};ami['on'](_0xf4fb('0x8'),this[_0xf4fb('0x9')][_0xf4fb('0xa')](this));ami['on']('hanguprequest',this[_0xf4fb('0xb')][_0xf4fb('0xa')](this));ami['on'](_0xf4fb('0xc'),this[_0xf4fb('0xd')]['bind'](this));ami['on'](_0xf4fb('0xe'),this[_0xf4fb('0xf')][_0xf4fb('0xa')](this));ami['on'](_0xf4fb('0x10'),this['syncAttendedTransfer'][_0xf4fb('0xa')](this));ami['on'](_0xf4fb('0x11'),this[_0xf4fb('0x12')]['bind'](this));ami['on'](_0xf4fb('0x13'),this[_0xf4fb('0x14')][_0xf4fb('0xa')](this));}function getDiff(_0xed5f89){var _0x36fc5f=moment()['milliseconds'](0x0);var _0x5a685f=moment(_0xed5f89)[_0xf4fb('0x15')](0x0);return _0x36fc5f['diff'](_0x5a685f,_0xf4fb('0x16'));}Acw[_0xf4fb('0x17')][_0xf4fb('0x18')]=function(_0x5a5976,_0x4cd3f6){var _0x1190aa=this;var _0x2acce9=getDiff(_0x1190aa[_0xf4fb('0x6')][_0x5a5976]['lastPauseAt']);clearTimeout(_0x1190aa[_0xf4fb('0x6')][_0x5a5976][_0xf4fb('0x19')]);_0x1190aa[_0xf4fb('0x6')][_0x5a5976][_0xf4fb('0x19')]=![];return RpcVoiceAgentReport[_0xf4fb('0x1a')]({'acwtime':_0x2acce9},_0x1190aa[_0xf4fb('0x6')][_0x5a5976][_0xf4fb('0x1b')],_0x5a5976)[_0xf4fb('0x1c')](function(_0x3840d6){logger[_0xf4fb('0x1d')](_0xf4fb('0x1e'),_0x4cd3f6,_0x2acce9,_0x3840d6);})[_0xf4fb('0x1f')](function(_0x15a16a){logger[_0xf4fb('0x20')](_0xf4fb('0x21'),_0x4cd3f6,_0x15a16a);})['finally'](function(){delete _0x1190aa['timers'][_0x5a5976];});};Acw['prototype'][_0xf4fb('0x22')]=function(_0x15e226){try{var _0x1bcc73=this;var _0x3454eb=this['channels'][_0x15e226][_0xf4fb('0x23')];var _0x1b84db=this['channels'][_0x15e226][_0xf4fb('0x24')];var _0x306ad7=this[_0xf4fb('0x4')][_0x1b84db];var _0x159d2c=![];var _0xe562de=_0xf4fb('0x25');if(_0x306ad7[_0xf4fb('0x26')]&&_0x306ad7['mandatoryDispositionPause'][_0xf4fb('0x27')]){_0x159d2c=!![];_0xe562de=_0x306ad7[_0xf4fb('0x28')]['name'];}if(!_0x1bcc73['agents'][_0x3454eb]){return Promise[_0xf4fb('0x29')]();}return RpcUser[_0xf4fb('0x2a')](_0x1bcc73[_0xf4fb('0x5')][_0x3454eb]['id'])[_0xf4fb('0x1c')](function(_0xb23c54){if(!_0xb23c54||_0xb23c54[_0xf4fb('0x2b')]){logger[_0xf4fb('0x1d')](_0xf4fb('0x2c'),_0x15e226,_0x3454eb,_0x1b84db);return;}logger[_0xf4fb('0x1d')](_0xf4fb('0x2d'),_0x15e226,_0x3454eb,_0x1b84db);var _0x55c23d=_0x1bcc73['channels'][_0x15e226][_0xf4fb('0x2e')]&&_0x1bcc73[_0xf4fb('0x7')][_0x15e226][_0xf4fb('0x2f')]?_0x1bcc73[_0xf4fb('0x7')][_0x15e226][_0xf4fb('0x2f')]:_0x15e226;return RpcUser[_0xf4fb('0x30')](_0x1bcc73[_0xf4fb('0x5')][_0x3454eb],_0xe562de,_0x55c23d);})[_0xf4fb('0x1c')](function(_0x1c85dd){if(_0x159d2c||!_0x1c85dd){return;}_0x1bcc73['timers'][_0x3454eb]={};logger[_0xf4fb('0x1d')](_0xf4fb('0x31'),_0x15e226,_0x1bcc73[_0xf4fb('0x4')][_0x1b84db]['acwTimeout'],_0x3454eb,_0x1b84db);_0x1bcc73[_0xf4fb('0x6')][_0x3454eb][_0xf4fb('0x19')]=setTimeout(_0x1bcc73['stopAcw'][_0xf4fb('0xa')](_0x1bcc73,_0x3454eb),_0x1bcc73[_0xf4fb('0x4')][_0x1b84db][_0xf4fb('0x32')]*0x3e8);_0x1bcc73[_0xf4fb('0x6')][_0x3454eb][_0xf4fb('0x33')]=moment()[_0xf4fb('0x34')](_0xf4fb('0x35'));_0x1bcc73[_0xf4fb('0x6')][_0x3454eb]['uniqueid']=_0x15e226;_0x1bcc73[_0xf4fb('0x6')][_0x3454eb][_0xf4fb('0x24')]=_0x1b84db;_0x1bcc73[_0xf4fb('0x6')][_0x3454eb][_0xf4fb('0x18')]=_0x1bcc73[_0xf4fb('0x18')][_0xf4fb('0xa')](_0x1bcc73,_0x3454eb,_0x15e226);})[_0xf4fb('0x1f')](function(){logger['error']('[%s][TIMER:%s][AGENT:%s][QUEUE:%s]',_0x15e226,_0x1bcc73[_0xf4fb('0x4')][_0x1b84db][_0xf4fb('0x32')],_0x3454eb,_0x1b84db);})[_0xf4fb('0x36')](function(){delete _0x1bcc73[_0xf4fb('0x7')][_0x15e226];});}catch(_0x496e35){logger[_0xf4fb('0x20')](_0xf4fb('0x37'),_0x496e35[_0xf4fb('0x38')]);}};Acw[_0xf4fb('0x17')]['stopAcw']=function(_0x26c887){try{var _0x16cff2=this;if(_0x16cff2[_0xf4fb('0x6')][_0x26c887]){_0x16cff2['timers'][_0x26c887][_0xf4fb('0x19')]=![];var _0x515c32=_0x16cff2['timers'][_0x26c887][_0xf4fb('0x1b')];var _0x4a06b7=_0x16cff2[_0xf4fb('0x6')][_0x26c887][_0xf4fb('0x24')];var _0x137280=_0x16cff2['voiceQueues'][_0x4a06b7][_0xf4fb('0x32')];logger[_0xf4fb('0x1d')](_0xf4fb('0x39'),_0x515c32,_0x26c887);RpcUser[_0xf4fb('0x2a')](this[_0xf4fb('0x5')][_0x26c887]['id'])[_0xf4fb('0x1c')](function(_0x7db702){if(_0x7db702[_0xf4fb('0x3a')]==='ACW'){return RpcUser[_0xf4fb('0x3b')](_0x16cff2[_0xf4fb('0x5')][_0x26c887]);}});RpcVoiceAgentReport[_0xf4fb('0x1a')]({'acwtime':_0x137280,'agentacw':!![]},_0x515c32,_0x26c887)['then'](function(_0x33eeb5){logger[_0xf4fb('0x1d')](_0xf4fb('0x1e'),_0x515c32,_0x137280,_0x33eeb5);})[_0xf4fb('0x1f')](function(_0x574cc8){logger[_0xf4fb('0x20')](_0xf4fb('0x21'),_0x515c32,_0x574cc8);});}else{logger[_0xf4fb('0x20')](_0xf4fb('0x3c'),_0x26c887);if(_0x16cff2['timers']){logger['info'](_0xf4fb('0x3d'),JSON[_0xf4fb('0x3e')](_0x16cff2[_0xf4fb('0x6')]));}}}catch(_0xc8c90e){logger[_0xf4fb('0x20')](_0xf4fb('0x3f'),_0xc8c90e['message']);}};Acw[_0xf4fb('0x17')][_0xf4fb('0x9')]=function(_0x235e10){try{if(this[_0xf4fb('0x4')][_0x235e10[_0xf4fb('0x24')]]&&(this[_0xf4fb('0x4')][_0x235e10[_0xf4fb('0x24')]][_0xf4fb('0x2')]||this['voiceQueues'][_0x235e10[_0xf4fb('0x24')]][_0xf4fb('0x26')])){if(this['agents'][_0x235e10[_0xf4fb('0x23')]]){this[_0xf4fb('0x7')][_0x235e10['uniqueid']]={'queue':_0x235e10[_0xf4fb('0x24')],'interface':_0x235e10[_0xf4fb('0x23')],'destlinkedid':_0x235e10[_0xf4fb('0x2f')]};}}}catch(_0x474732){logger['error']('[ACW][syncAgentConnect]\x20%s',_0x474732['message']);}};Acw['prototype'][_0xf4fb('0x14')]=function(_0x474a1b){try{if(this[_0xf4fb('0x4')][_0x474a1b[_0xf4fb('0x24')]]&&(this[_0xf4fb('0x4')][_0x474a1b[_0xf4fb('0x24')]]['acw']||this[_0xf4fb('0x4')][_0x474a1b[_0xf4fb('0x24')]][_0xf4fb('0x26')])){if(this[_0xf4fb('0x5')][_0x474a1b['interface']]){this[_0xf4fb('0x7')][_0x474a1b[_0xf4fb('0x1b')]]={'queue':_0x474a1b[_0xf4fb('0x24')],'interface':_0x474a1b[_0xf4fb('0x23')]};}}}catch(_0x412dca){logger['error'](_0xf4fb('0x40'),_0x412dca['message']);}};Acw[_0xf4fb('0x17')]['syncHangupRequest']=function(_0x2f5cf0){try{if(this[_0xf4fb('0x7')][_0x2f5cf0['uniqueid']]&&_[_0xf4fb('0x41')](this[_0xf4fb('0x7')][_0x2f5cf0[_0xf4fb('0x1b')]][_0xf4fb('0x2e')])){logger[_0xf4fb('0x1d')](_0xf4fb('0x42'),_0x2f5cf0['uniqueid']);this[_0xf4fb('0x22')](_0x2f5cf0[_0xf4fb('0x1b')]);}else if(this['channels'][_0x2f5cf0['linkedid']]&&_[_0xf4fb('0x41')](this[_0xf4fb('0x7')][_0x2f5cf0[_0xf4fb('0x43')]]['attended'])){logger[_0xf4fb('0x1d')](_0xf4fb('0x44'),_0x2f5cf0[_0xf4fb('0x43')]);this[_0xf4fb('0x22')](_0x2f5cf0[_0xf4fb('0x43')]);}}catch(_0xe0c24d){logger['error'](_0xf4fb('0x45'),_0xe0c24d[_0xf4fb('0x38')]);}};Acw[_0xf4fb('0x17')]['syncHangup']=function(_0x459e92){try{if(this[_0xf4fb('0x7')][_0x459e92['uniqueid']]&&this[_0xf4fb('0x7')][_0x459e92[_0xf4fb('0x1b')]][_0xf4fb('0x2e')]){logger['info']('[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]',_0x459e92['uniqueid']);this['startAcw'](_0x459e92[_0xf4fb('0x1b')]);}else if(this[_0xf4fb('0x7')][_0x459e92[_0xf4fb('0x43')]]&&this[_0xf4fb('0x7')][_0x459e92['linkedid']][_0xf4fb('0x2e')]){logger[_0xf4fb('0x1d')](_0xf4fb('0x46'),_0x459e92[_0xf4fb('0x43')]);this[_0xf4fb('0x22')](_0x459e92['linkedid']);}}catch(_0x2225a4){logger[_0xf4fb('0x20')](_0xf4fb('0x47'),_0x2225a4[_0xf4fb('0x38')]);}};Acw[_0xf4fb('0x17')][_0xf4fb('0x48')]=function(_0x351458){try{if(!_[_0xf4fb('0x49')](this[_0xf4fb('0x7')][_0x351458[_0xf4fb('0x4a')]])){this[_0xf4fb('0x22')](_0x351458[_0xf4fb('0x4a')]);if(this[_0xf4fb('0x7')][_0x351458[_0xf4fb('0x4b')]]){this[_0xf4fb('0x7')][_0x351458[_0xf4fb('0x4b')]][_0xf4fb('0x2e')]=!![];this[_0xf4fb('0x7')][_0x351458[_0xf4fb('0x4c')]]=this['channels'][_0x351458[_0xf4fb('0x4b')]];delete this[_0xf4fb('0x7')][_0x351458[_0xf4fb('0x4b')]];}}else if(!_['isNil'](this[_0xf4fb('0x7')][_0x351458['transfertargetuniqueid']])){this['startAcw'](_0x351458[_0xf4fb('0x4c')]);if(this[_0xf4fb('0x7')][_0x351458[_0xf4fb('0x4d')]]){this[_0xf4fb('0x7')][_0x351458[_0xf4fb('0x4d')]][_0xf4fb('0x2e')]=!![];this['channels'][_0x351458[_0xf4fb('0x4a')]]=this[_0xf4fb('0x7')][_0x351458[_0xf4fb('0x4d')]];delete this['channels'][_0x351458['origtransfereruniqueid']];}}}catch(_0x42cd71){logger['error'](_0xf4fb('0x4e'),_0x42cd71[_0xf4fb('0x38')]);}};Acw[_0xf4fb('0x17')][_0xf4fb('0x12')]=function(_0x550afe){try{if(this[_0xf4fb('0x7')][_0x550afe[_0xf4fb('0x4f')]]){logger[_0xf4fb('0x1d')](_0xf4fb('0x50'),JSON[_0xf4fb('0x3e')](_0x550afe['transfereruniqueid']));this[_0xf4fb('0x22')](_0x550afe['transfereruniqueid']);}else if(this['channels'][_0x550afe[_0xf4fb('0x51')]]){logger[_0xf4fb('0x1d')](_0xf4fb('0x52'),JSON[_0xf4fb('0x3e')](_0x550afe[_0xf4fb('0x51')]));this[_0xf4fb('0x22')](_0x550afe['transfererlinkedid']);}}catch(_0x202a35){logger[_0xf4fb('0x20')](_0xf4fb('0x53'),_0x202a35[_0xf4fb('0x38')]);}};Acw[_0xf4fb('0x17')][_0xf4fb('0xf')]=function(_0x5ebaea){try{if(this[_0xf4fb('0x4')][_0x5ebaea[_0xf4fb('0x24')]]&&this[_0xf4fb('0x4')][_0x5ebaea[_0xf4fb('0x24')]][_0xf4fb('0x54')]===_0xf4fb('0x55')){if(this[_0xf4fb('0x5')][_0x5ebaea[_0xf4fb('0x23')]]){logger[_0xf4fb('0x1d')](_0xf4fb('0x56'),_0x5ebaea[_0xf4fb('0x1b')],_0x5ebaea['interface'],_0x5ebaea[_0xf4fb('0x24')]);return RpcUser[_0xf4fb('0x30')](this[_0xf4fb('0x5')][_0x5ebaea[_0xf4fb('0x23')]],_0xf4fb('0x57'),_0x5ebaea[_0xf4fb('0x1b')]);}}}catch(_0x3eac50){logger['error'](_0xf4fb('0x58'),_0x3eac50[_0xf4fb('0x38')]);}};module['exports']=Acw; \ No newline at end of file diff --git a/server/services/ami/ami.js b/server/services/ami/ami.js index 7880f79..8b3a81a 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 _0x95cf=['connect','shutdown','format','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','fullybooted','info','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','then','actionQueueSummary','catch','[ami.js][fullybooted]','close','exports','asterisk-manager','bluebird','util','ami','../../config/environment','asterisk','port','password','keepConnected','Action','promisify','action','error','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','username','inspect','Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s','actionSipShowRegistry','actionDeviceStateList','devicestatelist','actionSipPeerStatus','queuesummary','actionCoreShowChannels','coreshowchannels','once'];(function(_0x29ae17,_0x543f41){var _0x185ffe=function(_0x422575){while(--_0x422575){_0x29ae17['push'](_0x29ae17['shift']());}};_0x185ffe(++_0x543f41);}(_0x95cf,0x189));var _0xf95c=function(_0x573c60,_0xf658c){_0x573c60=_0x573c60-0x0;var _0x15ce26=_0x95cf[_0x573c60];return _0x15ce26;};'use strict';var Manager=require(_0xf95c('0x0'));var BPromise=require(_0xf95c('0x1'));var util=require(_0xf95c('0x2'));var logger=require('../../config/logger')(_0xf95c('0x3'));var config=require(_0xf95c('0x4'));var ami=new Manager(config[_0xf95c('0x5')][_0xf95c('0x6')],config[_0xf95c('0x5')]['ip'],config[_0xf95c('0x5')]['username'],config[_0xf95c('0x5')][_0xf95c('0x7')],!![]);ami[_0xf95c('0x8')]();ami[_0xf95c('0x9')]=BPromise[_0xf95c('0xa')](ami[_0xf95c('0xb')]);function error(_0x558485){logger[_0xf95c('0xc')](util['format'](_0xf95c('0xd'),config[_0xf95c('0x5')][_0xf95c('0xe')],config['asterisk']['ip'],config[_0xf95c('0x5')][_0xf95c('0x6')],util[_0xf95c('0xf')](_0x558485,![],null)));}function close(){logger['error'](util['format'](_0xf95c('0x10'),config[_0xf95c('0x5')][_0xf95c('0xe')],config[_0xf95c('0x5')]['ip'],config['asterisk'][_0xf95c('0x6')]));}ami[_0xf95c('0x11')]=function(){return function(){return ami['Action']({'action':'sipshowregistry'});};};ami[_0xf95c('0x12')]=function(){return function(){return ami['Action']({'action':_0xf95c('0x13')});};};ami[_0xf95c('0x14')]=function(){return function(){return ami[_0xf95c('0x9')]({'action':'sippeerstatus'});};};ami['actionQueueSummary']=function(){return function(){return ami['Action']({'action':_0xf95c('0x15')});};};ami[_0xf95c('0x16')]=function(){return function(){return ami[_0xf95c('0x9')]({'action':_0xf95c('0x17')});};};function connect(){logger['info'](util['format']('Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s',config[_0xf95c('0x5')][_0xf95c('0xe')],config['asterisk']['ip'],config[_0xf95c('0x5')][_0xf95c('0x6')]));ami[_0xf95c('0x18')](_0xf95c('0xc'),error);ami[_0xf95c('0x18')]('close',close);}ami['on'](_0xf95c('0x19'),connect);ami['on'](_0xf95c('0x1a'),function(_0xf8adac){logger['info'](util[_0xf95c('0x1b')](_0xf95c('0x1c'),config[_0xf95c('0x5')][_0xf95c('0xe')],config[_0xf95c('0x5')]['ip'],config[_0xf95c('0x5')][_0xf95c('0x6')],util[_0xf95c('0xf')](_0xf8adac,![],null)));});ami['on'](_0xf95c('0x1d'),function(){logger[_0xf95c('0x1e')](util[_0xf95c('0x1b')](_0xf95c('0x1f'),config['asterisk'][_0xf95c('0xe')],config[_0xf95c('0x5')]['ip'],config['asterisk'][_0xf95c('0x6')]));return Promise['resolve']()[_0xf95c('0x20')](ami[_0xf95c('0x11')]())[_0xf95c('0x20')](ami['actionDeviceStateList']())['then'](ami[_0xf95c('0x14')]())[_0xf95c('0x20')](ami[_0xf95c('0x21')]())['then'](ami['actionCoreShowChannels']())[_0xf95c('0x22')](function(_0x331758){logger[_0xf95c('0xc')](_0xf95c('0x23'),util[_0xf95c('0xf')](_0x331758,{'showHidden':![],'depth':null}));});});ami[_0xf95c('0x18')](_0xf95c('0xc'),error);ami['once'](_0xf95c('0x24'),close);module[_0xf95c('0x25')]=ami; \ No newline at end of file +var _0x5d08=['Action','promisify','error','format','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','port','inspect','actionSipShowRegistry','sipshowregistry','actionDeviceStateList','devicestatelist','actionSipPeerStatus','actionQueueSummary','coreshowchannels','info','once','close','connect','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','exports','asterisk-manager','bluebird','ami','../../config/environment','asterisk','username','password'];(function(_0x553339,_0x5c3e45){var _0x2d7e3e=function(_0x3c3298){while(--_0x3c3298){_0x553339['push'](_0x553339['shift']());}};_0x2d7e3e(++_0x5c3e45);}(_0x5d08,0x99));var _0x85d0=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x5d08[_0x59ee6f];return _0x4c0979;};'use strict';var Manager=require(_0x85d0('0x0'));var BPromise=require(_0x85d0('0x1'));var util=require('util');var logger=require('../../config/logger')(_0x85d0('0x2'));var config=require(_0x85d0('0x3'));var ami=new Manager(config[_0x85d0('0x4')]['port'],config[_0x85d0('0x4')]['ip'],config[_0x85d0('0x4')][_0x85d0('0x5')],config[_0x85d0('0x4')][_0x85d0('0x6')],!![]);ami['keepConnected']();ami[_0x85d0('0x7')]=BPromise[_0x85d0('0x8')](ami['action']);function error(_0x9fc90e){logger[_0x85d0('0x9')](util[_0x85d0('0xa')](_0x85d0('0xb'),config[_0x85d0('0x4')][_0x85d0('0x5')],config[_0x85d0('0x4')]['ip'],config[_0x85d0('0x4')][_0x85d0('0xc')],util[_0x85d0('0xd')](_0x9fc90e,![],null)));}function close(){logger['error'](util[_0x85d0('0xa')]('Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s',config['asterisk'][_0x85d0('0x5')],config[_0x85d0('0x4')]['ip'],config['asterisk']['port']));}ami[_0x85d0('0xe')]=function(){return function(){return ami['Action']({'action':_0x85d0('0xf')});};};ami[_0x85d0('0x10')]=function(){return function(){return ami[_0x85d0('0x7')]({'action':_0x85d0('0x11')});};};ami[_0x85d0('0x12')]=function(){return function(){return ami[_0x85d0('0x7')]({'action':'sippeerstatus'});};};ami[_0x85d0('0x13')]=function(){return function(){return ami[_0x85d0('0x7')]({'action':'queuesummary'});};};ami['actionCoreShowChannels']=function(){return function(){return ami[_0x85d0('0x7')]({'action':_0x85d0('0x14')});};};function connect(){logger[_0x85d0('0x15')](util[_0x85d0('0xa')]('Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s',config[_0x85d0('0x4')][_0x85d0('0x5')],config[_0x85d0('0x4')]['ip'],config[_0x85d0('0x4')][_0x85d0('0xc')]));ami[_0x85d0('0x16')](_0x85d0('0x9'),error);ami[_0x85d0('0x16')](_0x85d0('0x17'),close);}ami['on'](_0x85d0('0x18'),connect);ami['on']('shutdown',function(_0x23a02d){logger[_0x85d0('0x15')](util['format'](_0x85d0('0x19'),config[_0x85d0('0x4')][_0x85d0('0x5')],config[_0x85d0('0x4')]['ip'],config[_0x85d0('0x4')][_0x85d0('0xc')],util[_0x85d0('0xd')](_0x23a02d,![],null)));});ami['on'](_0x85d0('0x1a'),function(){logger[_0x85d0('0x15')](util[_0x85d0('0xa')](_0x85d0('0x1b'),config['asterisk'][_0x85d0('0x5')],config['asterisk']['ip'],config['asterisk']['port']));return Promise[_0x85d0('0x1c')]()[_0x85d0('0x1d')](ami['actionSipShowRegistry']())[_0x85d0('0x1d')](ami['actionDeviceStateList']())['then'](ami[_0x85d0('0x12')]())[_0x85d0('0x1d')](ami[_0x85d0('0x13')]())[_0x85d0('0x1d')](ami['actionCoreShowChannels']())[_0x85d0('0x1e')](function(_0x339655){logger[_0x85d0('0x9')]('[ami.js][fullybooted]',util[_0x85d0('0xd')](_0x339655,{'showHidden':![],'depth':null}));});});ami['once']('error',error);ami[_0x85d0('0x16')](_0x85d0('0x17'),close);module[_0x85d0('0x1f')]=ami; \ No newline at end of file diff --git a/server/services/ami/client.js b/server/services/ami/client.js index 9cb3853..fa1f895 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 _0x9ffd=['catch','exports','jayson/promise','bluebird','../../config/logger','client','http','Request','then','debug','rpc','memberReport','error','result'];(function(_0x11b316,_0x21dc07){var _0x25f8dc=function(_0x1c889e){while(--_0x1c889e){_0x11b316['push'](_0x11b316['shift']());}};_0x25f8dc(++_0x21dc07);}(_0x9ffd,0xaa));var _0xd9ff=function(_0x5d1b47,_0x3b62d4){_0x5d1b47=_0x5d1b47-0x0;var _0x4ca1bd=_0x9ffd[_0x5d1b47];return _0x4ca1bd;};'use strict';var jayson=require(_0xd9ff('0x0'));var BPromise=require(_0xd9ff('0x1'));var logger=require(_0xd9ff('0x2'))('ami');var client=jayson[_0xd9ff('0x3')][_0xd9ff('0x4')]({'port':0x2329});client[_0xd9ff('0x5')]=function(_0x5493ae,_0x53e962){return new BPromise(function(_0x1c9460,_0x111697){return client['request'](_0x5493ae,_0x53e962)[_0xd9ff('0x6')](function(_0x2982c3){logger[_0xd9ff('0x7')](_0xd9ff('0x8'),_0xd9ff('0x9'),_0x5493ae,_0x53e962,_0x2982c3);if(_0x2982c3[_0xd9ff('0xa')]){logger[_0xd9ff('0xa')](_0xd9ff('0x8'),_0xd9ff('0x9'),_0x5493ae,_0x2982c3['error']['message'],_0x53e962);return _0x111697(_0x2982c3['error']['message']);}else{return _0x1c9460(_0x2982c3[_0xd9ff('0xb')]);}})[_0xd9ff('0xc')](function(_0x193537){logger[_0xd9ff('0xa')](_0xd9ff('0x8'),_0xd9ff('0x9'),_0x5493ae,_0x193537,_0x53e962);return _0x111697(_0x193537);});});};module[_0xd9ff('0xd')]=client; \ No newline at end of file +var _0xb7e7=['exports','jayson/promise','../../config/logger','client','Request','debug','rpc','error','memberReport','message','result','catch'];(function(_0x2f2360,_0x151089){var _0x1cc8d3=function(_0x5e356f){while(--_0x5e356f){_0x2f2360['push'](_0x2f2360['shift']());}};_0x1cc8d3(++_0x151089);}(_0xb7e7,0x121));var _0x7b7e=function(_0x9df060,_0x253d33){_0x9df060=_0x9df060-0x0;var _0x338dfe=_0xb7e7[_0x9df060];return _0x338dfe;};'use strict';var jayson=require(_0x7b7e('0x0'));var BPromise=require('bluebird');var logger=require(_0x7b7e('0x1'))('ami');var client=jayson[_0x7b7e('0x2')]['http']({'port':0x2329});client[_0x7b7e('0x3')]=function(_0x556d68,_0x31d0ed){return new BPromise(function(_0x118577,_0x1d9384){return client['request'](_0x556d68,_0x31d0ed)['then'](function(_0x333fa4){logger[_0x7b7e('0x4')](_0x7b7e('0x5'),'memberReport',_0x556d68,_0x31d0ed,_0x333fa4);if(_0x333fa4[_0x7b7e('0x6')]){logger[_0x7b7e('0x6')](_0x7b7e('0x5'),_0x7b7e('0x7'),_0x556d68,_0x333fa4[_0x7b7e('0x6')][_0x7b7e('0x8')],_0x31d0ed);return _0x1d9384(_0x333fa4[_0x7b7e('0x6')]['message']);}else{return _0x118577(_0x333fa4[_0x7b7e('0x9')]);}})[_0x7b7e('0xa')](function(_0x10a666){logger[_0x7b7e('0x6')](_0x7b7e('0x5'),_0x7b7e('0x7'),_0x556d68,_0x10a666,_0x31d0ed);return _0x1d9384(_0x10a666);});});};module[_0x7b7e('0xb')]=client; \ No newline at end of file diff --git a/server/services/ami/dialer/index.js b/server/services/ami/dialer/index.js index 827dbad..4fb7bc2 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 _0x2dfa=['contact\x20not\x20moved','dialPredictiveOptimizationPercentage','round','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','floor','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','check\x20handlePredictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','dialPredictiveInterval','[startMethodPredictive][StartProgressive][Loop]','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day','dialPredictiveOptimization','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','started\x20in\x20predictive\x20at','getDataPredictive','startMethodPredictive','Predictive\x20after\x20first\x20interval','avgHandleTime','Predictive\x20for\x20every\x20interval','predictiveIntervalAvailable','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20less\x20than\x20threshold\x20(',')\x20are\x20more\x20than\x20threshold\x20(','available','abandonmentRate','agentBusyFactor','busyFactor','[getDataPredictive]','Unknown\x20Predictive','check\x20failure','getDataPredictiveOld','loggedIn','outboundQueuePauses','predictiveIntervalAnsweredCalls','predictiveIntervalPauses','[CatchErlangB]','one\x20call\x20every:','milliseconds','fail\x20to\x20scheduled\x20calls','checkContactBlack','UserId','queueStatusComplete:\x20','[booked][checkContactBlack][else]','Queue:\x20','[unlockOriginate][syncQueueStatusComplete]','scheduledat','dialRecallMeTimeout','voicePause','run','unlockContact','outboundReCallsDay','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','QUEUE_RECALL','RecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','outboundBlacklistCallsDay','BLACKLIST','Blacklist','limitCalls','temp','getContactDialerIvr','checkContactEmpty','NO_AVAILABLE_CONTACTS','[getContactCampaign2][Empty]','RUNNING','ivrTotalCallsDays','[actionOriginate]\x20','checkIsBlackListIvr','[actionOriginateIvr]\x20','[getContactCampaign2]','dialLimitQueue','pTalking','not_inuse','getContactDialer','countReScheduled','[countReScheduled]\x20','checkIsBlackList','[getContactDialer2]','talking','tryOriginatePredictive','[handlePredictive][limitChannel]','[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','m\x20=\x20','[abandonmentRate]','p\x20=\x20','interval\x20=\x20','erlangb','----\x20Agent\x20Busy\x20Factor\x20----','Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[busyFactor]','Ts\x20=\x20','Umin\x20=\x20','exports','util','lodash','moment','ioredis','./utils','./utils/hopper','../../../config/environment/','../../../config/logger','booked','predictive','predictiveCalls','redis','defaults','localhost','socket.io-emitter','../rpc/cmHopper','../rpc/voiceQueueRt','../rpc/setting','./models/history','./models/final','./models/agentComplete','./models/queueCallerAbandon','./models/hangup','env','XCALLY_IP_AGI','127.0.0.1','enqueue','tail','sequence','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','actions','uniqueId','startPredictive','ivrOriginated','queueBooked','queueBookedRR','queuesSummary','agentconnect','queuecallerabandon','syncQueueCallerAbandon','bind','originateresponse','syncOriginateResponse','agentcomplete','syncAgentComplete','custom:queuesummary','syncQueueSummary','syncQueueSummaryComplete','hangup','newexten','syncNewExten','varset','syncVarSet','queuemember','queuestatuscomplete','syncQueueStatusComplete','loopClearZombieChannels','getSettings','then','previewRecallmeReminderInterval','isUndefined','emit','outbound','inspect','format','voice:queue:%s','name','voice_queue:save','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','Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalDroppedCallsTimeout','Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAvgHoldtime','AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAvgTalktime','---------------------------','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','---------\x20ErlangB\x20---------','erlangCalls','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangAbandonmentRate','erlangBusyFactor','merge','startProgressive','startProgressive\x20value\x20cleared','debug','startPredictive\x20value\x20cleared','handlePredictive','handlePredictive\x20interval\x20cleared','error','checkContactLowerLimitOriginate','contactsRescheduled','CAMPAIGN_STATUS','CONTACTS_RESCHEDULED','[getContactDialer2][ReScheduled]','message','[getContactDialer2][Empty]','state','statedesc','starttime','queueStatusComplete','[unlockQueueStatus][undefined]','[booked][unlockQueueStatus]','stringify','pick','Interval','NULL_INTERVAL','\x20INTERVAL_IS_NULL','Intervals','isIVRCampaignActive','INACTIVE','\x20NOT\x20Active','isIVRCampaign','campaign:ivr:%s','campaign:save','originated','is\x20not\x20active','DISACTIVED','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','is\x20disactive','[ifTime][Action]','prototype','isTrunkReachable','active','SIP/%s','status','reachable','checkIsTrunkReachable','TrunkBackup','TRUNK_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','checkIfTimeIntervals','ifTimeIvr','ifTime','Failure','isEmpty','EMPTY_INTERVAL','\x20Intervals\x20is\x20empty\x20','timezones','UNKNOWN_TIMEZONE','\x20Timezone\x20unknow\x20','length','push','Action','command','iftime\x20%s,%s','true','catch','indexOf','all','some','OVERTIME_GLOBAL_INTERVAL','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','loopCampaigns','resetActiveCalls','syncCampaigns','undefined','sendMessageOneNotActive','resolve','checkIfTime','dialTimezone','launchHandleIvr','checkDialMethod','dialMethod','progressive','handlePower','power','dialPowerLevel','Queue','Dialer::ifTime()','Voice\x20Queue\x20%s\x20$s','intervalIftime','OVERTIME_INTERVAL','[ifTime][promiseAll]','Global:\x20','silly','Dialer::ifTime()\x20errResponse\x20NOT\x20NULL:','isGlobal','AMI\x20IfTime','syncAgentConnect','queue','type','ivr','uniqueid','answertime','YYYY-MM-DD\x20HH:mm:ss','reason','agent','agiafterat','dialQueueProject2','createHistory','[syncAgentComplete][createHistory]','[syncAgentComplete]','updateOriginated','droptime','getSeconds','responsetime','dialQueueTimeout','outboundDropCallsDayTimeout','predictiveIntervalErlangCallsDroppedCalls','Drop','dropreason','TIMEOUT','countdropretry','dialDropRetryFrequency','callAdditionalPhoneAfterMin','verifyAdditionalPhones','additional','dialDropMaxRetry','rescheduleContact','ContactId','ListId','CampaignId','endtime','calleridname','calleridnum','[syncAgentComplete][createHistory][10]','swapAdditionalPhones','predictiveIntervalDroppedCallsCallersExit','outboundDropCallsDayCallersExit','Abandoned','CALLEREXIT','countglobal','dialAbandonedRetryFrequency','dialAbandonedMaxRetry','queueCallerAbandonCreateState','countabandonedretry','add','minutes','VoiceQueueId','[rescheduleContact][Abandoned]','[syncAgentComplete][createHistory][11]','channel','syncQueueMember','actionid','strategy','rrmemory','roundrobin','isNil','stateinterface','locked','idHopper','paused','preview','[Catch][Preview][syncQueueStatusComplete]','finally','_rr','unlockRR','[booked][RR]','Agent:\x20','contactAgent-idHopper:\x20','[booked][RR][finaly]','[booked][unlock]','[unlock][syncQueueStatusComplete]','[booked][unlock2]','[unlock2][syncQueueStatusComplete]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','getQueue','response','callProgressDetecting','[callProgressDetecting]\x20','variable','exten','xcally-motion-dialer','dialAMDActive','value','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','HangupInAMD','membername','AMD','custom:amd','buildObj','amd','saveInDb','[syncHangupInAMD]','Machine','countmachineretry','countcongestionretry','countnosuchnumberretry','countagentrejectretry','dialGlobalMaxRetry','stateGlobal','createStateFinal','reason\x2019\x20machine....','dialMachineRetryFrequency','[rescheduleContact][Machine]','[syncHangupInAMDIvr]','MACHINE','[syncAgentComplete][createHistory][0]','countbusyretry','countnoanswerretry','reason19\x20machine....','dialMachineMaxRetry','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','moveContactManagedDialer','[syncHangupIvr]','dialQueueProject','AnswerAGI','outboundUnknownCallsDay','Unknow','running','isPreviewCampaign','getQueueCampaignStatusMessage','statusMessage','inUse','compareToOutboundQueue','queueSummaryCountersUpdated','updateReportFromOutboundQueue','assign','throttle','filter','dialPreviewRecallmeReminder','online','handlePreviewRecallNotifications','map','Agent','user:dialPreviewRecallReminder','checkPreviewRecallReminder','clearZombieChannels','[uniqueid]','[actions]','[Dialer][checkChannel]','[Dialer][checkChannel][ivr]','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','[updateOriginated]\x20object\x20originated\x20is\x20negative','loggerHandler','emptyContact','notFound','[emptyContact][createHistory]','[emptyContact]','handleIvr','actionOriginate','object','voiceQueue\x20is\x20undefine','phone','originate','contact\x20is\x20undefine','getCaller','\x22agi://%s/square,%s\x22','NONE','isOutboundQueue','dialQueueOptions','dialAgiAfterHangupAgent','dialer','ACTIVE','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','XMD-AMDGREETING','dialAMDGreeting','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','XMD-AMDMINWORDLENGTH','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','dialAMDMaximumWordLength','XMD-CAMPAIGNID','setXMDContactVariables','Contact','getCallerId','Trunk','callerid','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','dialOriginateCallerIdNumber','dialOriginateCallerIdName','XMD-ORIGINATECALLERIDNAME','originatecalleridname','extractCalleridName','variables','SIP/%s/%s%s','dialPrefix','dialCutDigit','substring','trim','dialOriginateTimeout','outboundOriginateFailureCallsDay','OriginateError','[originate][error]','Error','checkRetriveMax','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry','dialCongestionRetryFrequency','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberMaxRetry','[rescheduleContact][NoSuchNumber]','[rescheduleContact][Drop]','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','[rescheduleContact][AgentReject]','[callProgressDetecting]','entity\x20is\x20undefine','NoSuchNumber','custom:agentnosuchnumber','nosuchnumber','reason\x200\x20no\x20such\x20number....','outboundNoAnswerCallsDay','NoAnswer','buildNoAnswerEventPayload','custom:agentnoanswer','reason\x203\x20ringing\x20no\x20answer','Busy','custom:agentbusy','busy','[syncAgentComplete][createHistory][5]','reason\x205\x20busy','outboundCongestionCallsDay','Congestion','custom:agentcongestion','congestion','reason\x208\x20congestion','outboundAbandonedCallsDay','reason\x2011\x20abandoned','outboundRejectCallsDay','AgentReject','custom:agentreject','reason\x2020\x20agentreject','[syncAgentComplete][createHistory][?]','Global','Success','[moveContactManagedDialer][0]'];(function(_0xd13a88,_0x3c5269){var _0x1c993c=function(_0x245af5){while(--_0x245af5){_0xd13a88['push'](_0xd13a88['shift']());}};_0x1c993c(++_0x3c5269);}(_0x2dfa,0x6f));var _0xa2df=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x2dfa[_0x3947c9];return _0x2e7871;};'use strict';var util=require(_0xa2df('0x0'));var _=require(_0xa2df('0x1'));var uuid=require('uuid');var moment=require(_0xa2df('0x2'));var rr=require('rr');var Redis=require(_0xa2df('0x3'));var utils=require(_0xa2df('0x4'));var hopperUtils=require(_0xa2df('0x5'));var ut=require('../preview/util/util');var config=require(_0xa2df('0x6'));var logger=require('../../../config/logger')('dialer');var loggerBooked=require(_0xa2df('0x7'))(_0xa2df('0x8'));var loggerPredictive=require(_0xa2df('0x7'))(_0xa2df('0x9'));var loggerPredictiveCalls=require(_0xa2df('0x7'))(_0xa2df('0xa'));var loggerSyncQueueSummary=require(_0xa2df('0x7'))('syncQueueSummary');var ami=require('../ami');config[_0xa2df('0xb')]=_[_0xa2df('0xc')](config[_0xa2df('0xb')],{'host':_0xa2df('0xd'),'port':0x18eb});var io=require(_0xa2df('0xe'))(new Redis(config[_0xa2df('0xb')]));var cmHopper=require(_0xa2df('0xf'));var voiceQueueRt=require(_0xa2df('0x10'));var RpcSetting=require(_0xa2df('0x11'));var Interval=require('../rpc/interval');var Action=require('./models/action');var History=require(_0xa2df('0x12'));var Final=require(_0xa2df('0x13'));var AgentComplete=require(_0xa2df('0x14'));var QueueCallerAbandon=require(_0xa2df('0x15'));var Hangup=require(_0xa2df('0x16'));var ipAgi=process[_0xa2df('0x17')][_0xa2df('0x18')]||_0xa2df('0x19');var previewRecallmeReminderInterval=0x1;var Sequence=function(){};Sequence['prototype'][_0xa2df('0x1a')]=function(_0x13a1cf){this[_0xa2df('0x1b')]=this['tail']?this[_0xa2df('0x1b')]['finally'](_0x13a1cf):_0x13a1cf();};function Dialer(_0x16f4d8,_0xa2bf01){this[_0xa2df('0x1c')]=new Sequence();this['preview']=_0xa2bf01;this['voiceQueues']=_0x16f4d8[_0xa2df('0x1d')];this['campaigns']=_0x16f4d8[_0xa2df('0x1e')];this['agents']=_0x16f4d8[_0xa2df('0x1f')];this[_0xa2df('0x20')]=_0x16f4d8[_0xa2df('0x20')];this[_0xa2df('0x21')]=config['maxNumberOriginate']||0x2;this[_0xa2df('0x22')]={};this[_0xa2df('0x23')]={};this['contactsId']={};this[_0xa2df('0x24')]={};this['optionPredictive']={};this[_0xa2df('0x25')]={};this['startProgressive']={};this[_0xa2df('0x26')]={};this[_0xa2df('0x27')]={};this[_0xa2df('0x28')]={};this[_0xa2df('0x29')]={};ami['on'](_0xa2df('0x2a'),this['syncAgentConnect']['bind'](this));ami['on'](_0xa2df('0x2b'),this[_0xa2df('0x2c')][_0xa2df('0x2d')](this));ami['on'](_0xa2df('0x2e'),this[_0xa2df('0x2f')][_0xa2df('0x2d')](this));ami['on'](_0xa2df('0x30'),this[_0xa2df('0x31')][_0xa2df('0x2d')](this));ami['on'](_0xa2df('0x32'),this[_0xa2df('0x33')][_0xa2df('0x2d')](this));ami['on']('custom:queuesummarycomplete',this[_0xa2df('0x34')][_0xa2df('0x2d')](this));ami['on'](_0xa2df('0x35'),this['syncHangup'][_0xa2df('0x2d')](this));ami['on'](_0xa2df('0x36'),this[_0xa2df('0x37')]['bind'](this));ami['on'](_0xa2df('0x38'),this[_0xa2df('0x39')]['bind'](this));ami['on'](_0xa2df('0x3a'),this['syncQueueMember'][_0xa2df('0x2d')](this));ami['on'](_0xa2df('0x3b'),this[_0xa2df('0x3c')][_0xa2df('0x2d')](this));this['loopCampaigns']();this[_0xa2df('0x3d')]();RpcSetting[_0xa2df('0x3e')]()[_0xa2df('0x3f')](function(_0x6d48b6){previewRecallmeReminderInterval=_0x6d48b6[_0xa2df('0x40')];});}function isNotNull(_0x1519cf){return _0x1519cf!==null&&!_[_0xa2df('0x41')](_0x1519cf);}function msgResponse(_0x5c146f,_0x43bb25,_0x4598ac){return{'action':_0x5c146f,'response':_0x43bb25,'message':_0x4598ac,'stack':_0x4598ac};}function emit(_0x41abed,_0x4e9c66,_0x2bf378){io['to'](_0x41abed)[_0xa2df('0x42')](_0x4e9c66,_0x2bf378);}function emitOutboundVoiceQueueSummary(_0x42f0e0){if(_0x42f0e0['type']===_0xa2df('0x43')){logger['debug']('[voiceQueueReport][queuesummary]\x20sending\x20voice_queue:save\x20event:',util[_0xa2df('0x44')](_0x42f0e0,{'showHidden':![],'depth':null}));emit(util[_0xa2df('0x45')](_0xa2df('0x46'),_0x42f0e0[_0xa2df('0x47')]),_0xa2df('0x48'),_0x42f0e0);}}function checkGetDataPredictive(_0xd1904d){if(isNotNull(_0xd1904d)&&!_['isEmpty'](_0xd1904d)){loggerPredictive[_0xa2df('0x49')](_0xa2df('0x4a'));loggerPredictive[_0xa2df('0x49')](_0xa2df('0x4b'),_0xd1904d[_0xa2df('0x4c')]);loggerPredictive[_0xa2df('0x49')](_0xa2df('0x4d'),_0xd1904d['predictiveIntervalAnsweredCalls']);loggerPredictive['info'](_0xa2df('0x4e'),_0xd1904d[_0xa2df('0x4f')]);loggerPredictive[_0xa2df('0x49')](_0xa2df('0x50'),_0xd1904d['predictiveIntervalDroppedCallsCallersExit']);loggerPredictive[_0xa2df('0x49')](_0xa2df('0x51'),_0xd1904d[_0xa2df('0x52')]);loggerPredictive['info'](_0xa2df('0x53'),_0xd1904d[_0xa2df('0x54')]);loggerPredictive[_0xa2df('0x49')](_0xa2df('0x55'));if(_0xd1904d['predictiveIntervalTotalCalls']>0x0){if(!_['isUndefined'](_0xd1904d['predictiveIntervalAvgTalktime'])&&_0xd1904d[_0xa2df('0x54')]>0x0){return!![];}loggerPredictive['info']('Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive');if(!_['isUndefined'](_0xd1904d['predictiveIntervalAvgHoldtime'])&&_0xd1904d[_0xa2df('0x52')]>0x0){return!![];}loggerPredictive[_0xa2df('0x49')](_0xa2df('0x56'));}else{loggerPredictive[_0xa2df('0x49')](_0xa2df('0x57'));}}else{loggerPredictive[_0xa2df('0x49')]('History\x20information\x20are\x20empty');}return![];}function mergeDataErlangB(_0xf2d693){return function(_0x213f6f){loggerPredictive[_0xa2df('0x49')](_0xa2df('0x58'));loggerPredictive[_0xa2df('0x49')]('Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x213f6f[_0xa2df('0x59')]);loggerPredictive[_0xa2df('0x49')]('One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x213f6f['erlangCallToSecond']);loggerPredictive[_0xa2df('0x49')](_0xa2df('0x5a'),_0x213f6f[_0xa2df('0x5b')]);loggerPredictive[_0xa2df('0x49')]('Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x213f6f[_0xa2df('0x5c')]);loggerPredictive[_0xa2df('0x49')](_0xa2df('0x5a'),_0x213f6f['erlangAbandonmentRate']);loggerPredictive[_0xa2df('0x49')](_0xa2df('0x55'));_[_0xa2df('0x5d')](_0xf2d693,_0x213f6f);};}function ifInterval(_0x40bca3,_0x19c416){if(_['isUndefined'](_0x19c416)){return![];}return utils['getSeconds'](undefined,_0x19c416)<_0x40bca3*0x3c;}function clearPredictiveAttributes(_0x54c872){if(_0x54c872[_0xa2df('0x5e')]){_0x54c872[_0xa2df('0x5e')]=undefined;loggerPredictive['debug'](_0x54c872[_0xa2df('0x47')],_0xa2df('0x5f'));}if(_0x54c872[_0xa2df('0x25')]){_0x54c872[_0xa2df('0x25')]=undefined;loggerPredictive[_0xa2df('0x60')](_0x54c872[_0xa2df('0x47')],_0xa2df('0x61'));}if(_0x54c872[_0xa2df('0x62')]){clearInterval(_0x54c872['handlePredictive']);_0x54c872[_0xa2df('0x62')]=undefined;loggerPredictive['debug'](_0x54c872[_0xa2df('0x47')],_0xa2df('0x63'));}}function loggerCatchPredictive(_0x5aae4,_0x7d023d){return function(_0xfd5b5e){loggerPredictive[_0xa2df('0x64')](_0x7d023d['name'],_0x5aae4);loggerPredictive[_0xa2df('0x64')](_0xfd5b5e['stack']);clearPredictiveAttributes(_0x7d023d);};}function loggerCatch(_0x5c6918){return function(_0x1dfd85){logger[_0xa2df('0x64')](_0x5c6918,util[_0xa2df('0x44')](_0x1dfd85,{'showHidden':![],'depth':null}));};}function loggerGetContactDialer(_0x5b9aad,_0x3d57fa,_0x286458){return function(_0x133c25){utils[_0xa2df('0x65')](_0x3d57fa,_0x286458,0x0);_0x3d57fa['temp']=0x0;logger['error'](_0x5b9aad,util[_0xa2df('0x44')](_0x133c25,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x3433a2){return function(_0x23d9ad){if(isNotNull(_0x23d9ad)&&isNotNull(_0x23d9ad[0x0])){if(_0x23d9ad[0x0][_0xa2df('0x66')]>0x0){_0x3433a2['message']=utils[_0xa2df('0x67')][_0xa2df('0x68')];logger['info'](_0xa2df('0x69')+_0x3433a2[_0xa2df('0x47')],_0x23d9ad[0x0]['contactsRescheduled'],'contacts');}else{_0x3433a2[_0xa2df('0x6a')]=utils['CAMPAIGN_STATUS']['NO_AVAILABLE_CONTACTS'];logger[_0xa2df('0x49')](_0xa2df('0x6b')+_0x3433a2[_0xa2df('0x47')]);}}};}function createObjHistory(_0xd4465e,_0x1bbc5e,_0x25db97,_0x5ddd3c,_0x4a12d9){_0xd4465e[_0xa2df('0x6a')]=_0x25db97;var _0x36efe3=new Action(_0xd4465e,_0x1bbc5e);var _0x341925=new History(_0x36efe3);_0x341925[_0xa2df('0x6c')]=_0x5ddd3c;_0x341925[_0xa2df('0x6d')]=_0x4a12d9;_0x341925['endtime']=_0x36efe3[_0xa2df('0x6e')];return _0x341925;}function unlockQueueStatus(_0x1d697d,_0x55c4da){setTimeout(function(){if(_[_0xa2df('0x41')](_0x1d697d[_0xa2df('0x6f')])){loggerBooked[_0xa2df('0x64')](_0xa2df('0x70'),_0x55c4da);}_0x1d697d['queueStatusComplete']=!![];loggerBooked[_0xa2df('0x49')](_0xa2df('0x71'),_0x55c4da,JSON[_0xa2df('0x72')](_[_0xa2df('0x73')](_0x1d697d,['name','queueStatusComplete'])));},0x1f3);}function checkInterval(_0x5c52d2){return function(){if(!isNotNull(_0x5c52d2[_0xa2df('0x74')])){_0x5c52d2[_0xa2df('0x6a')]=utils[_0xa2df('0x67')][_0xa2df('0x75')];throw _0x5c52d2[_0xa2df('0x47')]+_0xa2df('0x76');}if(!isNotNull(_0x5c52d2[_0xa2df('0x74')][_0xa2df('0x77')])){_0x5c52d2[_0xa2df('0x6a')]=utils[_0xa2df('0x67')][_0xa2df('0x75')];throw _0x5c52d2['name']+_0xa2df('0x76');}if(!isNotNull(_['isEmpty'](_0x5c52d2[_0xa2df('0x74')][_0xa2df('0x77')]))){_0x5c52d2[_0xa2df('0x6a')]=utils[_0xa2df('0x67')]['NULL_INTERVAL'];throw _0x5c52d2['name']+'\x20INTERVAL_IS_NULL';}};}function checkIsIVRCampaignActive(_0x41849d){return function(){if(!utils[_0xa2df('0x78')](_0x41849d)){_0x41849d['message']=utils[_0xa2df('0x67')][_0xa2df('0x79')];throw _0x41849d[_0xa2df('0x47')]+_0xa2df('0x7a');}};}function emitCampaignSummary(_0x3cf1ee){if(utils[_0xa2df('0x7b')](_0x3cf1ee)){emit(util[_0xa2df('0x45')](_0xa2df('0x7c'),_0x3cf1ee['name']),_0xa2df('0x7d'),_0x3cf1ee);}}function loggerCatchQueueSummary(_0x547814,_0x23720f){return function(_0x3d807e){clearPredictiveAttributes(_0x23720f);emitCampaignSummary(_0x23720f);loggerSyncQueueSummary['debug'](_0x547814,util[_0xa2df('0x44')](_0x3d807e,{'showHidden':![],'depth':null}));};}function notSendMessagesCampaign(_0xa0535d){if(_0xa0535d['sendMessageOneNotActive']){if(_0xa0535d[_0xa2df('0x7e')]===0x0){_0xa0535d['sendMessageOneNotActive']=![];_0xa0535d[_0xa2df('0x6a')]=utils['CAMPAIGN_STATUS'][_0xa2df('0x79')];loggerSyncQueueSummary['debug']('[syncQueueSummary]\x20Campaign\x20Ivr:\x20',_0xa0535d[_0xa2df('0x47')],_0xa2df('0x7f'));}else{_0xa0535d[_0xa2df('0x6a')]=utils[_0xa2df('0x67')][_0xa2df('0x80')];loggerSyncQueueSummary['debug'](_0xa2df('0x81'),_0xa0535d[_0xa2df('0x47')],_0xa2df('0x82'));}emitCampaignSummary(_0xa0535d);}}function myreject(_0x2e3d6d){return function(_0x33be83){return _0x2e3d6d(msgResponse(_0xa2df('0x83'),'Error',JSON[_0xa2df('0x72')](_0x33be83)));};}Dialer[_0xa2df('0x84')][_0xa2df('0x85')]=function(_0x1c4b9e){return!_[_0xa2df('0x41')](_0x1c4b9e)&&_0x1c4b9e&&!_[_0xa2df('0x41')](_0x1c4b9e['name'])&&!_[_0xa2df('0x41')](_0x1c4b9e[_0xa2df('0x86')])&&_0x1c4b9e[_0xa2df('0x86')]&&(this[_0xa2df('0x20')][util['format'](_0xa2df('0x87'),_0x1c4b9e[_0xa2df('0x47')])][_0xa2df('0x88')]===_0xa2df('0x89')||this[_0xa2df('0x20')][util['format'](_0xa2df('0x87'),_0x1c4b9e[_0xa2df('0x47')])][_0xa2df('0x88')]==='unmonitored');};Dialer['prototype'][_0xa2df('0x8a')]=function(_0x5cf2fa){var _0xdc2490=this;return function(){if(!_0xdc2490[_0xa2df('0x85')](_0x5cf2fa['Trunk'])){if(!_0xdc2490[_0xa2df('0x85')](_0x5cf2fa[_0xa2df('0x8b')])){_0x5cf2fa[_0xa2df('0x6a')]=utils[_0xa2df('0x67')][_0xa2df('0x8c')];throw _0x5cf2fa['name']+_0xa2df('0x8d');}}};};Dialer[_0xa2df('0x84')]['checkIfTime']=function(_0x154c2a,_0x4d25d0,_0x5e2b0b,_0xda91ef){var _0x48b540=this;return function(){var _0x5e5bea=!![];return _0x48b540['ifTimeIvr'](_0x154c2a,_0x4d25d0,_0x5e2b0b,_0xda91ef,_0x5e5bea);};};Dialer[_0xa2df('0x84')][_0xa2df('0x8e')]=function(_0x4d5193,_0x4e10a8,_0x28b72e,_0x517d3a){var _0x3916f6=this;return function(){var _0x4b7c64=![];return _0x3916f6[_0xa2df('0x8f')](_0x4d5193['Intervals'],_0x4e10a8,_0x28b72e,_0x517d3a,_0x4b7c64);};};Dialer[_0xa2df('0x84')]['ifTimeIvr']=function(_0x56f0e2,_0x2f5c43,_0x22dc6b,_0xf0bb2c,_0x21a975){var _0x6b2bab=[];return new Promise(function(_0x5d84f6,_0x4329f5){if(!isNotNull(_0x56f0e2)){_0xf0bb2c[_0xa2df('0x6a')]=utils[_0xa2df('0x67')][_0xa2df('0x75')];return _0x4329f5(msgResponse(_0xa2df('0x90'),_0xa2df('0x91'),_0x22dc6b+'\x20Intervals\x20is\x20null\x20'));}if(_[_0xa2df('0x92')](_0x56f0e2)){_0xf0bb2c[_0xa2df('0x6a')]=utils[_0xa2df('0x67')][_0xa2df('0x93')];return _0x4329f5(msgResponse(_0xa2df('0x90'),'Failure',_0x22dc6b+_0xa2df('0x94')));}if(_0x2f5c43&&_[_0xa2df('0x41')](config[_0xa2df('0x95')][_0x2f5c43])){_0xf0bb2c['message']=utils[_0xa2df('0x67')][_0xa2df('0x96')];return _0x4329f5(msgResponse(_0xa2df('0x90'),'Failure',_0x22dc6b+_0xa2df('0x97')+_0x2f5c43));}if(_['isArray'](_0x56f0e2)){for(var _0x72b720=0x0;_0x72b720<_0x56f0e2[_0xa2df('0x98')];_0x72b720+=0x1){_0x6b2bab[_0xa2df('0x99')](ami[_0xa2df('0x9a')]({'action':_0xa2df('0x9b'),'command':util['format'](_0xa2df('0x9c'),_0x56f0e2[_0x72b720]['interval'],!_['isUndefined'](config[_0xa2df('0x95')][_0x2f5c43])?_0x2f5c43:'')})[_0xa2df('0x3f')](function(_0xc098fc){return _0xc098fc['content']['indexOf'](_0xa2df('0x9d'))>=0x0;})[_0xa2df('0x9e')](myreject(_0x4329f5)));}}else{_0x6b2bab[_0xa2df('0x99')](ami['Action']({'action':'command','command':util[_0xa2df('0x45')](_0xa2df('0x9c'),_0x56f0e2,!_[_0xa2df('0x41')](config[_0xa2df('0x95')][_0x2f5c43])?_0x2f5c43:'')})[_0xa2df('0x3f')](function(_0x362983){return _0x362983['content'][_0xa2df('0x9f')]('true')>=0x0;})[_0xa2df('0x9e')](myreject(_0x4329f5)));}Promise[_0xa2df('0xa0')](_0x6b2bab)[_0xa2df('0x3f')](function(_0x2772cd){var _0x27f1a1=_[_0xa2df('0xa1')](_0x2772cd);if(_0x27f1a1){return _0x5d84f6(_0x27f1a1);}else{_0xf0bb2c[_0xa2df('0x6a')]=_0x21a975?utils['CAMPAIGN_STATUS'][_0xa2df('0xa2')]:utils['CAMPAIGN_STATUS']['OVERTIME_INTERVAL'];return _0x4329f5(msgResponse('[ifTime][promiseAll]',_0xa2df('0x91'),'Global:\x20'+_0x21a975+'\x20'+_0x22dc6b+_0xa2df('0xa3')+util[_0xa2df('0x44')](_0x56f0e2,{'showHidden':![],'depth':null})+_0xa2df('0xa4')+_0x2f5c43));}})[_0xa2df('0x9e')](function(_0x390627){return _0x4329f5(msgResponse(_0xa2df('0x90'),_0xa2df('0x91'),JSON[_0xa2df('0x72')](_0x390627)));});});};Dialer[_0xa2df('0x84')][_0xa2df('0xa5')]=function(){var _0x4bf925=this;return cmHopper[_0xa2df('0xa6')]({'active':![]},{'where':{'active':!![]}})['then'](function(){setInterval(function(){_0x4bf925[_0xa2df('0xa7')]();},0x3e8);});};Dialer[_0xa2df('0x84')][_0xa2df('0xa7')]=function(){var _0x17d9f4=this;var _0x59dd1b;for(var _0x3db63b in this[_0xa2df('0x1e')]){if(typeof this['campaigns'][_0x3db63b]!==_0xa2df('0xa8')){_0x59dd1b=this[_0xa2df('0x1e')][_0x3db63b];if(utils[_0xa2df('0x7b')](_0x59dd1b)&&utils['isIVRCampaignActive'](_0x59dd1b)){_0x59dd1b[_0xa2df('0xa9')]=!![];Promise[_0xa2df('0xaa')]()[_0xa2df('0x3f')](checkIsIVRCampaignActive(_0x59dd1b))[_0xa2df('0x3f')](checkInterval(_0x59dd1b))['then'](_0x17d9f4[_0xa2df('0x8a')](_0x59dd1b))[_0xa2df('0x3f')](_0x17d9f4[_0xa2df('0xab')](_0x59dd1b['dialGlobalInterval'],_0x59dd1b[_0xa2df('0xac')],_0x59dd1b[_0xa2df('0x47')],_0x59dd1b))['then'](_0x17d9f4[_0xa2df('0x8e')](_0x59dd1b[_0xa2df('0x74')],_0x59dd1b['dialTimezone'],_0x59dd1b[_0xa2df('0x47')],_0x59dd1b))[_0xa2df('0x3f')](_0x17d9f4[_0xa2df('0xad')](_0x59dd1b))[_0xa2df('0x9e')](loggerCatchQueueSummary('[syncCampaigns]',_0x59dd1b));}else{notSendMessagesCampaign(_0x59dd1b);}}}};Dialer[_0xa2df('0x84')][_0xa2df('0xae')]=function(_0x40e920){if(_0x40e920[_0xa2df('0xaf')]!==_0xa2df('0x9')){clearPredictiveAttributes(_0x40e920);}switch(_0x40e920[_0xa2df('0xaf')]){case _0xa2df('0xb0'):this[_0xa2df('0xb1')](_0x40e920,0x1);break;case _0xa2df('0xb2'):this[_0xa2df('0xb1')](_0x40e920,_0x40e920[_0xa2df('0xb3')]);break;case'predictive':this[_0xa2df('0x9')](_0x40e920);break;case _0xa2df('0x8'):this['handlePower'](_0x40e920,0x1);break;default:logger['error'](_0xa2df('0xb4'),_0x40e920[_0xa2df('0x47')],'method\x20not\x20recognized');}};Dialer[_0xa2df('0x84')][_0xa2df('0x90')]=function(_0x3dcb9e,_0x3fd54c){var _0x220f24=_0x3dcb9e['dialTimezone'];var _0x30aaa7=_0x3fd54c?_0x3dcb9e['dialGlobalInterval']:_0x3dcb9e[_0xa2df('0x74')][_0xa2df('0x77')];logger['silly'](_0xa2df('0xb5'),_0x30aaa7,_0x220f24,_0x3dcb9e[_0xa2df('0x47')],util[_0xa2df('0x45')](_0xa2df('0xb6'),_0x3dcb9e[_0xa2df('0x47')],_0x3dcb9e['id']));var _0x559d08=null;return Interval[_0xa2df('0xb7')](_0x30aaa7,_0x220f24)['then'](function(_0x4adfa2){if(_0x4adfa2===!![]){return _0x4adfa2;}else{_0x3dcb9e['message']=_0x3fd54c?utils[_0xa2df('0x67')][_0xa2df('0xa2')]:utils['CAMPAIGN_STATUS'][_0xa2df('0xb8')];_0x559d08=msgResponse(_0xa2df('0xb9'),'Failure',_0xa2df('0xba')+_0x3fd54c+'\x20'+_0x3dcb9e[_0xa2df('0x47')]+_0xa2df('0xa3')+util[_0xa2df('0x44')](_0x30aaa7,{'showHidden':![],'depth':null})+_0xa2df('0xa4')+_0x220f24);}if(_0x559d08!==null){logger[_0xa2df('0xbb')](_0xa2df('0xbc'),_0x559d08);_0x559d08[_0xa2df('0xbd')]=_0x3fd54c;throw _0x559d08;}})[_0xa2df('0x9e')](function(_0xc1e5ef){logger[_0xa2df('0x64')](_0xa2df('0xbe'),_0xc1e5ef);throw msgResponse(_0xa2df('0x83'),'Error',util[_0xa2df('0x44')](_0xc1e5ef,{'showHidden':![],'depth':null}));});};Dialer[_0xa2df('0x84')][_0xa2df('0xbf')]=function(_0x3c6622){if(this[_0xa2df('0x1d')][_0x3c6622[_0xa2df('0xc0')]]){if(this[_0xa2df('0x24')][_0x3c6622['uniqueid']]&&this[_0xa2df('0x24')][_0x3c6622['uniqueid']][_0xa2df('0xc1')]!==_0xa2df('0xc2')){this['updateOriginated'](this[_0xa2df('0x1d')][_0x3c6622[_0xa2df('0xc0')]]);this['uniqueId'][_0x3c6622[_0xa2df('0xc3')]][_0xa2df('0xc4')]=moment()[_0xa2df('0x45')](_0xa2df('0xc5'));}}};Dialer['prototype'][_0xa2df('0x31')]=function(_0x4d7d96){var _0x3206c0=this[_0xa2df('0x24')][_0x4d7d96['uniqueid']];if(this[_0xa2df('0x1d')][_0x4d7d96['queue']]){if(_0x3206c0&&_0x3206c0[_0xa2df('0xc1')]!==_0xa2df('0xc2')){delete this['uniqueId'][_0x4d7d96[_0xa2df('0xc3')]];this['voiceQueues'][_0x4d7d96['queue']]['outboundAnswerCallsDay']+=0x1;var _0x41317c=new AgentComplete(_0x3206c0,_0x4d7d96);if(_0x4d7d96[_0xa2df('0xc6')]===_0xa2df('0xc7')){_0x41317c[_0xa2df('0xc8')]=this['voiceQueues'][_0x4d7d96[_0xa2df('0xc0')]][_0xa2df('0xc9')]&&this[_0xa2df('0x1d')][_0x4d7d96['queue']]['dialAgiAfterHangupAgent']?moment()[_0xa2df('0x45')](_0xa2df('0xc5')):undefined;}hopperUtils[_0xa2df('0xca')](_0x41317c)[_0xa2df('0x9e')](loggerCatch(_0xa2df('0xcb')));hopperUtils['moveContactManagedDialer'](_0x41317c)[_0xa2df('0x9e')](loggerCatch(_0xa2df('0xcc')));}}};Dialer[_0xa2df('0x84')][_0xa2df('0x2c')]=function(_0x5b2aff){var _0xbd982a=this[_0xa2df('0x24')][_0x5b2aff[_0xa2df('0xc3')]];var _0x1586ad=this;var _0xfc2f97=![];var _0x54e6e3;var _0x5c6121;if(this[_0xa2df('0x1d')][_0x5b2aff[_0xa2df('0xc0')]]){if(_0xbd982a&&_0xbd982a[_0xa2df('0xc1')]!==_0xa2df('0xc2')){delete this[_0xa2df('0x24')][_0x5b2aff['uniqueid']];this[_0xa2df('0xcd')](this[_0xa2df('0x1d')][_0x5b2aff['queue']]);_0xbd982a[_0xa2df('0xce')]=moment()[_0xa2df('0x45')]('YYYY-MM-DD\x20HH:mm:ss');var _0x1c5732=new QueueCallerAbandon(_0xbd982a,_0x5b2aff);if(utils[_0xa2df('0xcf')](_0xbd982a['droptime'],_0xbd982a[_0xa2df('0xd0')])>=_0xbd982a[_0xa2df('0xd1')]){this[_0xa2df('0x1d')][_0x5b2aff['queue']][_0xa2df('0x4f')]+=0x1;this[_0xa2df('0x1d')][_0x5b2aff[_0xa2df('0xc0')]][_0xa2df('0xd2')]+=0x1;this['voiceQueues'][_0x5b2aff[_0xa2df('0xc0')]][_0xa2df('0xd3')]+=0x1;_0x1c5732[_0xa2df('0x6c')]=0xa;_0x1c5732['statedesc']=_0xa2df('0xd4');_0x1c5732[_0xa2df('0xd5')]=_0xa2df('0xd6');_0x1c5732[_0xa2df('0xc8')]=this[_0xa2df('0x1d')][_0x5b2aff[_0xa2df('0xc0')]]['dialQueueProject2']?moment()[_0xa2df('0x45')](_0xa2df('0xc5')):undefined;_0x1c5732[_0xa2df('0xd7')]+=0x1;_0x1c5732['countglobal']+=0x1;_0x54e6e3=this[_0xa2df('0x1d')][_0x5b2aff[_0xa2df('0xc0')]][_0xa2df('0xd8')];_0x5c6121=this[_0xa2df('0x1d')][_0x5b2aff['queue']][_0xa2df('0xd9')];hopperUtils[_0xa2df('0xda')](_0x1c5732,_0x1c5732['state'],_0xbd982a['voiceQueue'])[_0xa2df('0x3f')](function(_0x2e7734){_0xfc2f97=_0x2e7734[_0xa2df('0xdb')]==0x1;if(_0x1c5732[_0xa2df('0xd7')]>=_0x1586ad[_0xa2df('0x1d')][_0x5b2aff[_0xa2df('0xc0')]][_0xa2df('0xdc')]){_0x1586ad['queueCallerAbandonCreateState'](_0x1c5732,_0x2e7734[_0xa2df('0xdb')]);}else{hopperUtils[_0xa2df('0xdd')]({'active':![],'countdropretry':_0x1c5732[_0xa2df('0xd7')],'scheduledat':moment()['add'](_0x1586ad[_0xa2df('0x1d')][_0x5b2aff['queue']][_0xa2df('0xd8')],'minutes')[_0xa2df('0x45')](_0xa2df('0xc5')),'ContactId':_0xbd982a[_0xa2df('0xde')],'ListId':_0xbd982a[_0xa2df('0xdf')],'VoiceQueueId':_0xbd982a['VoiceQueueId']||undefined,'CampaignId':_0xbd982a[_0xa2df('0xe0')]||undefined})['catch'](loggerCatch('[rescheduleContact][Drop]'));var _0x3bda20=new History(_0x1c5732);_0x3bda20[_0xa2df('0x6c')]=0xa;_0x3bda20[_0xa2df('0x6d')]='Drop';_0x3bda20[_0xa2df('0x6e')]=moment()[_0xa2df('0x45')](_0xa2df('0xc5'));_0x3bda20[_0xa2df('0xe1')]=_0x3bda20['starttime'];_0x3bda20[_0xa2df('0xe2')]=_0x1c5732[_0xa2df('0xe2')];_0x3bda20[_0xa2df('0xe3')]=_0x1c5732[_0xa2df('0xe3')];hopperUtils[_0xa2df('0xca')](_0x3bda20)[_0xa2df('0x9e')](loggerCatch(_0xa2df('0xe4')));}})[_0xa2df('0x3f')](function(){if(_0xfc2f97)hopperUtils[_0xa2df('0xe5')](_0x1c5732,_0x54e6e3,_0x5c6121)[_0xa2df('0x3f')](function(){return 0x1;});});}else{this['voiceQueues'][_0x5b2aff[_0xa2df('0xc0')]][_0xa2df('0xe6')]+=0x1;this['voiceQueues'][_0x5b2aff[_0xa2df('0xc0')]][_0xa2df('0xe7')]+=0x1;_0x1c5732['state']=0xb;_0x1c5732['statedesc']=_0xa2df('0xe8');_0x1c5732[_0xa2df('0xd5')]=_0xa2df('0xe9');_0x1c5732['countabandonedretry']+=0x1;_0x1c5732[_0xa2df('0xea')]+=0x1;_0x54e6e3=this['voiceQueues'][_0x5b2aff[_0xa2df('0xc0')]][_0xa2df('0xeb')];_0x5c6121=this['voiceQueues'][_0x5b2aff['queue']][_0xa2df('0xd9')];hopperUtils[_0xa2df('0xda')](_0x1c5732,_0x1c5732['state'],_0xbd982a['voiceQueue'])[_0xa2df('0x3f')](function(_0x17ae77){if(_0x1c5732['countabandonedretry']>=_0x1586ad[_0xa2df('0x1d')][_0x5b2aff[_0xa2df('0xc0')]][_0xa2df('0xec')]){_0x1586ad[_0xa2df('0xed')](_0x1c5732,_0x17ae77[_0xa2df('0xdb')]);}else{hopperUtils[_0xa2df('0xdd')]({'active':![],'countabandonedretry':_0x1c5732[_0xa2df('0xee')],'scheduledat':moment()[_0xa2df('0xef')](_0x1586ad[_0xa2df('0x1d')][_0x5b2aff['queue']][_0xa2df('0xeb')],_0xa2df('0xf0'))['format'](_0xa2df('0xc5')),'ContactId':_0xbd982a[_0xa2df('0xde')],'ListId':_0xbd982a['ListId'],'VoiceQueueId':_0xbd982a[_0xa2df('0xf1')]||undefined,'CampaignId':_0xbd982a[_0xa2df('0xe0')]||undefined})[_0xa2df('0x9e')](loggerCatch(_0xa2df('0xf2')));var _0x2b8aa8=new History(_0x1c5732);_0x2b8aa8[_0xa2df('0x6c')]=0xb;_0x2b8aa8[_0xa2df('0x6d')]='Abandoned';_0x2b8aa8[_0xa2df('0x6e')]=moment()[_0xa2df('0x45')](_0xa2df('0xc5'));_0x2b8aa8[_0xa2df('0xe1')]=_0x2b8aa8['starttime'];_0x2b8aa8[_0xa2df('0xe2')]=_0x1c5732[_0xa2df('0xe2')];_0x2b8aa8[_0xa2df('0xe3')]=_0x1c5732[_0xa2df('0xe3')];hopperUtils['createHistory'](_0x2b8aa8)[_0xa2df('0x9e')](loggerCatch(_0xa2df('0xf3')));}})[_0xa2df('0x3f')](function(){if(_0xfc2f97)hopperUtils['swapAdditionalPhones'](_0x1c5732,_0x54e6e3,_0x5c6121)[_0xa2df('0x3f')](function(){return 0x1;});});}}}};Dialer[_0xa2df('0x84')][_0xa2df('0x37')]=function(_0x2c2739){if(this[_0xa2df('0x23')][_0x2c2739[_0xa2df('0xc3')]]){this[_0xa2df('0x23')][_0x2c2739['uniqueid']][_0xa2df('0xf4')]=_0x2c2739[_0xa2df('0xf4')];}if(this[_0xa2df('0x24')][_0x2c2739[_0xa2df('0xc3')]]){this[_0xa2df('0x24')][_0x2c2739[_0xa2df('0xc3')]][_0xa2df('0xf4')]=_0x2c2739[_0xa2df('0xf4')];}};Dialer[_0xa2df('0x84')][_0xa2df('0xf5')]=function(_0x589be1){if(!this[_0xa2df('0x23')][_0x589be1[_0xa2df('0xf6')]]){return;}var _0x450937=this['voiceQueues'][this[_0xa2df('0x23')][_0x589be1[_0xa2df('0xf6')]][_0xa2df('0xc0')]][_0xa2df('0xf7')]||_0xa2df('0xf8');if(_0x450937===_0xa2df('0xf9')){if(this['actions'][_0x589be1['actionid']]&&_[_0xa2df('0xfa')](this['actions'][_0x589be1[_0xa2df('0xf6')]]['locked'])&&_0x589be1['status']==='1'&&_0x589be1['paused']==='0'){if(this['agents'][_0x589be1[_0xa2df('0xfb')]]){if(!this[_0xa2df('0x1f')][_0x589be1[_0xa2df('0xfb')]]['locked']){this['agents'][_0x589be1[_0xa2df('0xfb')]][_0xa2df('0xfc')]=!![];this[_0xa2df('0x23')][_0x589be1['actionid']]['locked']=!![];this[_0xa2df('0x23')][_0x589be1[_0xa2df('0xf6')]][_0xa2df('0xfb')]=_0x589be1[_0xa2df('0xfb')];}}}}else if(_0x450937===_0xa2df('0xf8')){if(this[_0xa2df('0x23')][_0x589be1['actionid']]){if(this[_0xa2df('0x1f')][_0x589be1[_0xa2df('0xfb')]]){this[_0xa2df('0x23')][_0x589be1[_0xa2df('0xf6')]][_0xa2df('0xfb')]=_0x589be1['stateinterface'];if(_[_0xa2df('0xfa')](this[_0xa2df('0x27')][this[_0xa2df('0x23')][_0x589be1[_0xa2df('0xf6')]][_0xa2df('0xc0')]])){this[_0xa2df('0x27')][this['actions'][_0x589be1[_0xa2df('0xf6')]]['queue']]=[];}this[_0xa2df('0x27')][this[_0xa2df('0x23')][_0x589be1['actionid']]['queue']][_0xa2df('0x99')](_[_0xa2df('0x5d')](_[_0xa2df('0x73')](this[_0xa2df('0x23')][_0x589be1[_0xa2df('0xf6')]],[_0xa2df('0xfd'),_0xa2df('0xfb')]),{'status':_0x589be1['status'],'paused':_0x589be1[_0xa2df('0xfe')]}));}}}};Dialer[_0xa2df('0x84')][_0xa2df('0x3c')]=function(_0x3c7563){if(!this[_0xa2df('0x23')][_0x3c7563[_0xa2df('0xf6')]]){return;}var _0x3c6071=this;var _0x1b0dc5=this[_0xa2df('0x1d')][this[_0xa2df('0x23')][_0x3c7563[_0xa2df('0xf6')]][_0xa2df('0xc0')]];var _0x4dd7ba=_0x1b0dc5['strategy']||_0xa2df('0xf8');if(_0x4dd7ba===_0xa2df('0xf9')){if(this[_0xa2df('0x23')][_0x3c7563['actionid']]&&this[_0xa2df('0x23')][_0x3c7563[_0xa2df('0xf6')]]['stateinterface']){this[_0xa2df('0xff')]['run'](this[_0xa2df('0x23')][_0x3c7563[_0xa2df('0xf6')]][_0xa2df('0xfd')],this['actions'][_0x3c7563[_0xa2df('0xf6')]][_0xa2df('0xfb')])[_0xa2df('0x9e')](function(_0x50a1ff){logger[_0xa2df('0x64')](_0xa2df('0x100'),util[_0xa2df('0x44')](_0x50a1ff,{'showHidden':![],'depth':null}));})[_0xa2df('0x101')](function(){_0x3c6071[_0xa2df('0xcd')](_0x3c6071[_0xa2df('0x1d')][_0x3c6071[_0xa2df('0x23')][_0x3c7563[_0xa2df('0xf6')]][_0xa2df('0xc0')]]);_0x3c6071[_0xa2df('0x1f')][_0x3c6071['actions'][_0x3c7563['actionid']][_0xa2df('0xfb')]][_0xa2df('0xfc')]=![];delete _0x3c6071[_0xa2df('0x23')][_0x3c7563[_0xa2df('0xf6')]];unlockQueueStatus(_0x1b0dc5);});}else{this[_0xa2df('0xcd')](this[_0xa2df('0x1d')][this[_0xa2df('0x23')][_0x3c7563[_0xa2df('0xf6')]][_0xa2df('0xc0')]]);hopperUtils[_0xa2df('0xdd')]({'active':![],'ContactId':this[_0xa2df('0x23')][_0x3c7563[_0xa2df('0xf6')]][_0xa2df('0xde')],'ListId':this[_0xa2df('0x23')][_0x3c7563[_0xa2df('0xf6')]][_0xa2df('0xdf')],'VoiceQueueId':this['actions'][_0x3c7563[_0xa2df('0xf6')]]['VoiceQueueId']||undefined,'CampaignId':this[_0xa2df('0x23')][_0x3c7563[_0xa2df('0xf6')]][_0xa2df('0xe0')]||undefined})[_0xa2df('0x9e')](loggerCatch('[unlock][syncQueueStatusComplete]'));delete this['actions'][_0x3c7563['actionid']];unlockQueueStatus(_0x1b0dc5);}}else if(_0x4dd7ba==='rrmemory'){var _0x3fca0d;if(this[_0xa2df('0x23')][_0x3c7563[_0xa2df('0xf6')]]&&!_[_0xa2df('0x92')](this['queueBooked'][this['actions'][_0x3c7563[_0xa2df('0xf6')]][_0xa2df('0xc0')]])){if(this[_0xa2df('0x28')][_0x3c6071[_0xa2df('0x23')][_0x3c7563[_0xa2df('0xf6')]][_0xa2df('0xc0')]]){this['queueBookedRR'][_0x3c6071[_0xa2df('0x23')][_0x3c7563[_0xa2df('0xf6')]][_0xa2df('0xc0')]]=this['queueBookedRR'][this[_0xa2df('0x23')][_0x3c7563[_0xa2df('0xf6')]][_0xa2df('0xc0')]]?this[_0xa2df('0x28')][this['actions'][_0x3c7563[_0xa2df('0xf6')]]['queue']]:this['queueBooked'][this[_0xa2df('0x23')][_0x3c7563['actionid']][_0xa2df('0xc0')]]?this[_0xa2df('0x27')][this['actions'][_0x3c7563[_0xa2df('0xf6')]][_0xa2df('0xc0')]]['_rr']||0x0:0x0;}this[_0xa2df('0x27')][this[_0xa2df('0x23')][_0x3c7563[_0xa2df('0xf6')]]['queue']][_0xa2df('0x102')]=this[_0xa2df('0x28')][this[_0xa2df('0x23')][_0x3c7563[_0xa2df('0xf6')]][_0xa2df('0xc0')]];for(var _0x36c849=0x0;_0x36c849=_0x248e02[_0xa2df('0x126')]){_0x1c5b3d[_0xa2df('0x127')](_0x56edc3,_0x87280d,_0x14072e,'reason19\x20machine....');}else{if(_0x56edc3[_0xa2df('0x122')]>=_0x248e02['dialMachineMaxRetry']){_0x1c5b3d[_0xa2df('0x128')](_0x56edc3,_0x87280d,_0x14072e,_0xa2df('0x129'));}else{hopperUtils[_0xa2df('0xdd')]({'active':![],'countmachineretry':_0x56edc3[_0xa2df('0x122')],'scheduledat':moment()[_0xa2df('0xef')](_0x248e02[_0xa2df('0x12a')],_0xa2df('0xf0'))[_0xa2df('0x45')](_0xa2df('0xc5')),'ContactId':_0x56edc3['ContactId'],'ListId':_0x56edc3['ListId'],'VoiceQueueId':_0x56edc3[_0xa2df('0xf1')]||undefined,'CampaignId':_0x56edc3[_0xa2df('0xe0')]||undefined})['catch'](loggerCatch(_0xa2df('0x12b')));_0x87280d({'reschedule':0x1});}}});}if(_0xb79c2[_0xa2df('0xc1')]===_0xa2df('0xc2')&&this[_0xa2df('0x1e')][_0xb79c2[_0xa2df('0xc0')]]['dialAMDActive']&&_0x7fe832[_0xa2df('0x116')]==='HANGUP'){delete this['uniqueId'][_0x7fe832['uniqueid']];this[_0xa2df('0xcd')](this[_0xa2df('0x1e')][_0xb79c2[_0xa2df('0xc0')]]);_0x31321f=new Hangup(_0xb79c2,_0x7fe832);_0x31321f[_0xa2df('0x6c')]=0x12;_0x31321f[_0xa2df('0x6d')]=_0xa2df('0x119');_0x31321f[_0xa2df('0x11a')]=_0xa2df('0x11b');ami['emit']('custom:amd',ut[_0xa2df('0x11d')](_0x31321f,'amd'));this['saveInDb'](_0x31321f,'[syncHangupInAMDIvr][createHistory]',_0xa2df('0x12c'));}if(_0xb79c2[_0xa2df('0xc1')]===_0xa2df('0xc2')&&this['campaigns'][_0xb79c2['queue']][_0xa2df('0x115')]&&_0x7fe832['value']===_0xa2df('0x12d')){return new Promise(function(_0x285865,_0x5f11e8){delete _0x1c5b3d['uniqueId'][_0x7fe832[_0xa2df('0xc3')]];_0x1c5b3d[_0xa2df('0xcd')](_0x1c5b3d[_0xa2df('0x1e')][_0xb79c2[_0xa2df('0xc0')]]);_0x1c5b3d[_0xa2df('0x1e')][_0xb79c2['queue']][_0xa2df('0x117')]+=0x1;_0x1c5b3d[_0xa2df('0x1e')][_0xb79c2[_0xa2df('0xc0')]][_0xa2df('0x118')]+=0x1;var _0x31dbdd=_0x1c5b3d[_0xa2df('0x1e')][_0xb79c2['queue']];var _0x422b08=new Hangup(_0xb79c2,_0x7fe832);_0x422b08['state']=0x13;_0x422b08[_0xa2df('0x6d')]='Machine';_0x422b08[_0xa2df('0x11a')]=_0xa2df('0x11b');_0x422b08[_0xa2df('0x122')]+=0x1;_0x422b08[_0xa2df('0xea')]+=0x1;_0x422b08['amd']=!![];ami[_0xa2df('0x42')](_0xa2df('0x11c'),ut[_0xa2df('0x11d')](_0x422b08,'amd'));hopperUtils[_0xa2df('0xca')](_0x422b08)[_0xa2df('0x9e')](loggerCatch(_0xa2df('0x12e')));if(_0x422b08[_0xa2df('0x12f')]+_0x422b08[_0xa2df('0x123')]+_0x422b08[_0xa2df('0x130')]+_0x422b08[_0xa2df('0x124')]+_0x422b08[_0xa2df('0xd7')]+_0x422b08[_0xa2df('0xee')]+_0x422b08[_0xa2df('0x122')]+_0x422b08[_0xa2df('0x125')]>=_0x31dbdd[_0xa2df('0x126')]){_0x1c5b3d[_0xa2df('0x127')](_0x422b08,_0x285865,_0x5f11e8,_0xa2df('0x131'));}else{if(_0x422b08[_0xa2df('0x122')]>=_0x31dbdd[_0xa2df('0x132')]){_0x1c5b3d[_0xa2df('0x128')](_0x422b08,_0x285865,_0x5f11e8,_0xa2df('0x129'));}else{hopperUtils[_0xa2df('0xdd')]({'active':![],'countmachineretry':_0x422b08[_0xa2df('0x122')],'scheduledat':moment()[_0xa2df('0xef')](_0x31dbdd[_0xa2df('0x12a')],_0xa2df('0xf0'))[_0xa2df('0x45')](_0xa2df('0xc5')),'ContactId':_0x422b08[_0xa2df('0xde')],'ListId':_0x422b08[_0xa2df('0xdf')],'VoiceQueueId':_0x422b08['VoiceQueueId']||undefined,'CampaignId':_0x422b08[_0xa2df('0xe0')]||undefined})[_0xa2df('0x9e')](loggerCatch(_0xa2df('0x12b')));_0x285865({'reschedule':0x1});}}});}}};Dialer[_0xa2df('0x84')]['syncHangup']=function(_0x36825a){var _0x46bd9d=this[_0xa2df('0x24')][_0x36825a[_0xa2df('0xc3')]];var _0x40a690;if(_0x46bd9d&&_0x46bd9d['type']===_0xa2df('0xc2')){delete this[_0xa2df('0x24')][_0x36825a[_0xa2df('0xc3')]];this[_0xa2df('0xcd')](this['campaigns'][_0x46bd9d[_0xa2df('0xc0')]]);this['campaigns'][_0x46bd9d[_0xa2df('0xc0')]][_0xa2df('0x133')]+=0x1;_0x40a690=new Hangup(_0x46bd9d,_0x36825a);hopperUtils[_0xa2df('0xca')](_0x40a690)['catch'](loggerCatch(_0xa2df('0x134')));hopperUtils[_0xa2df('0x135')](_0x40a690)[_0xa2df('0x9e')](loggerCatch(_0xa2df('0x136')));}if(_0x46bd9d&&_0x46bd9d['type']!==_0xa2df('0xc2')&&isNotNull(this['voiceQueues'][_0x46bd9d[_0xa2df('0xc0')]][_0xa2df('0x137')])){delete this[_0xa2df('0x24')][_0x36825a[_0xa2df('0xc3')]];this[_0xa2df('0xcd')](this[_0xa2df('0x1d')][_0x46bd9d['queue']]);this[_0xa2df('0x1d')][_0x46bd9d[_0xa2df('0xc0')]][_0xa2df('0x117')]+=0x1;this[_0xa2df('0x1d')][_0x46bd9d[_0xa2df('0xc0')]]['outboundAnswerAgiCallsDay']+=0x1;_0x40a690=new Hangup(_0x46bd9d,_0x36825a);_0x40a690[_0xa2df('0x6c')]=0x10;_0x40a690[_0xa2df('0x6d')]=_0xa2df('0x138');_0x40a690[_0xa2df('0x11a')]='AGI';hopperUtils[_0xa2df('0xca')](_0x40a690)[_0xa2df('0x9e')](loggerCatch(_0xa2df('0x134')));hopperUtils['moveContactManagedDialer'](_0x40a690)[_0xa2df('0x9e')](loggerCatch('[syncHangupIvr]'));}if(_0x46bd9d&&_0x46bd9d[_0xa2df('0xc1')]!==_0xa2df('0xc2')&&!isNotNull(this[_0xa2df('0x1d')][_0x46bd9d[_0xa2df('0xc0')]]['dialQueueProject'])){delete this[_0xa2df('0x24')][_0x36825a[_0xa2df('0xc3')]];this[_0xa2df('0xcd')](this[_0xa2df('0x1d')][_0x46bd9d[_0xa2df('0xc0')]]);this['voiceQueues'][_0x46bd9d[_0xa2df('0xc0')]][_0xa2df('0x139')]+=0x1;_0x40a690=new Hangup(_0x46bd9d,_0x36825a);_0x40a690['state']=0xc;_0x40a690[_0xa2df('0x6d')]=_0x36825a['cause-txt'];_0x40a690['membername']=_0xa2df('0x13a');hopperUtils[_0xa2df('0xca')](_0x40a690)[_0xa2df('0x9e')](loggerCatch(_0xa2df('0x134')));hopperUtils[_0xa2df('0x135')](_0x40a690)[_0xa2df('0x9e')](loggerCatch(_0xa2df('0x136')));}};Dialer[_0xa2df('0x84')][_0xa2df('0x33')]=function(_0x4f3081){var _0x39d1a6=this;if(!_0x39d1a6[_0xa2df('0x29')][_0x4f3081[_0xa2df('0x47')]]){_0x39d1a6[_0xa2df('0x29')][_0x4f3081[_0xa2df('0x47')]]={'running':![]};}else if(_0x39d1a6[_0xa2df('0x29')][_0x4f3081[_0xa2df('0x47')]][_0xa2df('0x13b')]===!![]){return;}else if(_0x39d1a6[_0xa2df('0x29')][_0x4f3081[_0xa2df('0x47')]]['running']===![]){_0x39d1a6[_0xa2df('0x29')][_0x4f3081['name']][_0xa2df('0x13b')]=!![];}var _0x2c42b2=_0x39d1a6[_0xa2df('0x1d')][_0x4f3081[_0xa2df('0x47')]];var _0x2e77c4=_0x2c42b2[_0xa2df('0x6a')]!==utils[_0xa2df('0x67')][_0xa2df('0x79')];var _0x52e8b9=utils[_0xa2df('0x13c')](_0x2c42b2);_0x2c42b2['statusMessage']=utils[_0xa2df('0x13d')](_0x2c42b2,_0x39d1a6['trunks']);Promise[_0xa2df('0xaa')]()[_0xa2df('0x3f')](function(){if(_0x2c42b2[_0xa2df('0x13e')]===utils[_0xa2df('0x67')][_0xa2df('0x79')]){if(_0x2e77c4){clearPredictiveAttributes(_0x2c42b2);_0x4f3081[_0xa2df('0x25')]=undefined;_0x4f3081[_0xa2df('0x5e')]=undefined;}if(_0x2c42b2[_0xa2df('0x13e')]===utils[_0xa2df('0x67')][_0xa2df('0x79')]){_0x4f3081['available']=0x0;_0x4f3081[_0xa2df('0xfe')]=0x0;_0x4f3081[_0xa2df('0x13f')]=0x0;_0x4f3081['talking']=0x0;_0x4f3081['pTalking']=0x0;}}else if(_0x2c42b2['statusMessage']===utils[_0xa2df('0x67')]['ACTIVE']&&!_0x52e8b9){return _0x39d1a6['ifTime'](_0x2c42b2,!![])[_0xa2df('0x3f')](function(){return _0x39d1a6[_0xa2df('0x90')](_0x2c42b2,![]);})[_0xa2df('0x3f')](function(){return _0x39d1a6['checkDialMethod'](_0x2c42b2);})[_0xa2df('0x9e')](function(_0x4a5c36){loggerSyncQueueSummary['debug']('[syncQueueSummary]',util[_0xa2df('0x44')](_0x4a5c36,{'showHidden':![],'depth':null}));clearPredictiveAttributes(_0x2c42b2);});}else{clearPredictiveAttributes(_0x2c42b2);}})[_0xa2df('0x3f')](function(){var _0x50f2d6=_0x4f3081[_0xa2df('0x140')](_0x2c42b2);if(_0x50f2d6||_0x2c42b2[_0xa2df('0x141')]){_0x2c42b2['queueSummaryCountersUpdated']=![];_0x4f3081[_0xa2df('0x142')](_0x2c42b2);Object[_0xa2df('0x143')](_0x2c42b2,_0x4f3081);emitOutboundVoiceQueueSummary(_0x4f3081);}_0x39d1a6['queuesSummary'][_0x2c42b2['name']]['running']=![];})[_0xa2df('0x9e')](function(_0x3cc9c2){logger['error']('[syncQueueSummary]',util[_0xa2df('0x44')](_0x3cc9c2,{'showHidden':![],'depth':null}));_0x39d1a6[_0xa2df('0x29')][_0x2c42b2[_0xa2df('0x47')]][_0xa2df('0x13b')]=![];});};Dialer['prototype']['syncQueueSummaryComplete']=_[_0xa2df('0x144')](function(){var _0x219977=_[_0xa2df('0x145')](this[_0xa2df('0x1d')],function(_0xbd9e65){return _0xbd9e65[_0xa2df('0x146')];});var _0x2a8be1=_[_0xa2df('0x145')](this[_0xa2df('0x1f')],function(_0x57d510){return _0x57d510[_0xa2df('0x147')]&&_0x57d510[_0xa2df('0x88')]===_0xa2df('0x89');});if(_0x219977[_0xa2df('0x98')]>0x0&&_0x2a8be1[_0xa2df('0x98')]>0x0){return Promise['resolve']()[_0xa2df('0x3f')](cmHopper[_0xa2df('0x148')](_[_0xa2df('0x149')](_0x219977,'id'),previewRecallmeReminderInterval,_['map'](_0x2a8be1,'id')))[_0xa2df('0x3f')](function(_0x31a063){for(var _0x9a79ac=0x0;_0x9a79ac<_0x31a063[_0xa2df('0x98')];_0x9a79ac++){var _0x2db5ab=_0x31a063[_0x9a79ac][_0xa2df('0x14a')][_0xa2df('0x47')];if(_0x2db5ab)io['to'](util['format']('user:%s',_0x2db5ab))[_0xa2df('0x42')](_0xa2df('0x14b'),{'hopper':_0x31a063[_0x9a79ac]});}})['catch'](function(_0x554cca){logger['error'](_0xa2df('0x14c'),_0x554cca);});}},0x3c*0x3e8,{'leading':!![]});Dialer[_0xa2df('0x84')][_0xa2df('0x3d')]=function(){var _0x56a74d=this;setInterval(function(){_0x56a74d[_0xa2df('0x14d')](_0x56a74d[_0xa2df('0x24')],_0xa2df('0x14e'));_0x56a74d[_0xa2df('0x14d')](_0x56a74d['actions'],_0xa2df('0x14f'));},0x32c8);};Dialer[_0xa2df('0x84')]['clearZombieChannels']=function(_0x282961,_0x46e4ff){var _0x55cd9b=this;for(var _0x32d4c1 in _0x282961){if(typeof _0x282961[_0x32d4c1]!==_0xa2df('0xa8')){this[_0xa2df('0x1c')][_0xa2df('0x1a')](function(){if(!_[_0xa2df('0xfa')](_0x282961[_0x32d4c1])){return ami[_0xa2df('0x9a')]({'action':'status','channel':_0x282961[_0x32d4c1][_0xa2df('0xf4')]})[_0xa2df('0x9e')](function(_0x32c71d){if(_0x32c71d['message']==='No\x20such\x20channel'){setTimeout(function(){if(_0x282961[_0x32d4c1]&&_0x282961[_0x32d4c1][_0xa2df('0xc1')]!=='ivr'){_0x55cd9b[_0xa2df('0xcd')](_0x55cd9b[_0xa2df('0x1d')][_0x282961[_0x32d4c1][_0xa2df('0xc0')]]);logger['error'](_0xa2df('0x150'),_0x46e4ff,_0x32d4c1,_0x282961[_0x32d4c1][_0xa2df('0xc0')]);delete _0x282961[_0x32d4c1];}if(_0x282961[_0x32d4c1]&&_0x282961[_0x32d4c1][_0xa2df('0xc1')]===_0xa2df('0xc2')){_0x55cd9b[_0xa2df('0xcd')](_0x55cd9b[_0xa2df('0x1e')][_0x282961[_0x32d4c1][_0xa2df('0xc0')]]);logger[_0xa2df('0x64')](_0xa2df('0x151'),_0x46e4ff,_0x32d4c1,_0x282961[_0x32d4c1]['queue']);delete _0x282961[_0x32d4c1];}},0x2328);}});}});}}};Dialer[_0xa2df('0x84')][_0xa2df('0x152')]=function(_0x3ae545){return Promise[_0xa2df('0xaa')]()[_0xa2df('0x3f')](voiceQueueRt[_0xa2df('0x152')](_0x3ae545))[_0xa2df('0x9e')](loggerCatch(_0xa2df('0x153')));};Dialer[_0xa2df('0x84')]['updateOriginated']=function(_0x2d3e61){if(!_[_0xa2df('0x41')](_0x2d3e61)&&_0x2d3e61!==null){if(typeof _0x2d3e61[_0xa2df('0x7e')]!==_0xa2df('0xa8')){if(_0x2d3e61['originated']>0x0){_0x2d3e61[_0xa2df('0x7e')]-=0x1;}else{logger[_0xa2df('0x64')](_0xa2df('0x154'));}}}else{logger[_0xa2df('0x64')]('[updateOriginated]\x20is\x20null\x20or\x20undefined');}};Dialer[_0xa2df('0x84')][_0xa2df('0x155')]=function(_0x3eaa59,_0x121221){var _0x4a459d=this;return function(_0x339915){_0x4a459d[_0xa2df('0xcd')](_0x121221);logger[_0xa2df('0x64')](_0x3eaa59,util[_0xa2df('0x44')](_0x339915,{'showHidden':![],'depth':null}));};};Dialer[_0xa2df('0x84')][_0xa2df('0x156')]=function(_0xc5116a,_0x3b8cfe,_0x11fc89){var _0x5a10d0={'state':0x19,'statedesc':_0xa2df('0x157')};this[_0xa2df('0xcd')](_0x3b8cfe);this[_0xa2df('0x11f')](_[_0xa2df('0x5d')](_0x5a10d0,_[_0xa2df('0x73')](_0x11fc89,[_0xa2df('0xde'),_0xa2df('0xdf'),'UserId',_0xa2df('0xf1'),_0xa2df('0xe0')])),_0xa2df('0x158'),_0xa2df('0x159'));logger['error'](_0xc5116a);};Dialer[_0xa2df('0x84')][_0xa2df('0x11f')]=function(_0x1ba10d,_0x5d3866,_0x26c3f5){hopperUtils[_0xa2df('0xca')](_0x1ba10d)[_0xa2df('0x9e')](loggerCatch(_0x5d3866));hopperUtils[_0xa2df('0x135')](_0x1ba10d)['catch'](loggerCatch(_0x26c3f5));};Dialer[_0xa2df('0x84')]['queueCallerAbandonCreateState']=function(_0x2fa3de,_0x3727a2){hopperUtils['createHistory'](_0x2fa3de)[_0xa2df('0x9e')](loggerCatch('[syncAgentComplete][createHistory]'));if(_0x3727a2==0x0){hopperUtils[_0xa2df('0x135')](_0x2fa3de)[_0xa2df('0x9e')](loggerCatch('[syncQueueCallerAbandon]\x20[Drop]'));}};Dialer[_0xa2df('0x84')][_0xa2df('0x14c')]=function(_0x2072e5){return Promise['resolve']()[_0xa2df('0x3f')](cmHopper[_0xa2df('0x148')](_0x2072e5['id'],previewRecallmeReminderInterval))['then'](function(_0x35b5ad){for(var _0x5ba2db=0x0;_0x5ba2db<_0x35b5ad[_0xa2df('0x98')];_0x5ba2db++){var _0x30915f=_0x35b5ad[_0x5ba2db][_0xa2df('0x14a')][_0xa2df('0x47')];if(_0x30915f)io['to'](util[_0xa2df('0x45')]('user:%s',_0x30915f))['emit']('user:dialPreviewRecallReminder',{'hopper':_0x35b5ad[_0x5ba2db]});}})[_0xa2df('0x9e')](function(){});};Dialer[_0xa2df('0x84')][_0xa2df('0xad')]=function(_0x43ee76){var _0xded425=this;return function(){_0xded425[_0xa2df('0x15a')](_0x43ee76);};};Dialer[_0xa2df('0x84')][_0xa2df('0x15b')]=function(_0x5681d8,_0x292581){var _0x222f3d=this;var _0x12c7b7=uuid['v4']();this[_0xa2df('0x23')][_0x12c7b7]=new Action(_0x5681d8,_0x292581,_0x12c7b7);return new Promise(function(_0x17be4e,_0x5bfe3b){if(_['isUndefined'](_0x5681d8)&&typeof _0x5681d8!==_0xa2df('0x15c')){return _0x5bfe3b(msgResponse('originate',_0xa2df('0x91'),_0xa2df('0x15d')));}if(_[_0xa2df('0x41')](_0x292581[_0xa2df('0x15e')])||_0x292581[_0xa2df('0x15e')]===null){return _0x5bfe3b(msgResponse(_0xa2df('0x15f'),_0xa2df('0x91'),_0xa2df('0x160')));}var _0x58993a={'XMD-CALLERID':_0x222f3d['actions'][_0x12c7b7][_0xa2df('0x161')](),'XMD-AGI':_0x5681d8['dialQueueProject']?util[_0xa2df('0x45')](_0xa2df('0x162'),ipAgi,_0x5681d8[_0xa2df('0x137')]):_0xa2df('0x163'),'XMD-AGIAFTER':_0x5681d8['dialQueueProject2']?util[_0xa2df('0x45')](_0xa2df('0x162'),ipAgi,_0x5681d8[_0xa2df('0xc9')]):_0xa2df('0x163'),'XMD-QUEUE':utils[_0xa2df('0x164')](_0x5681d8)?util[_0xa2df('0x45')]('\x22%s,%s%s,,,%s\x22',_0x5681d8['name'],_0x5681d8[_0xa2df('0x165')]||'',_0x5681d8[_0xa2df('0x166')]?'c':'',_0x5681d8['dialQueueTimeout']||0x3):_0xa2df('0x163'),'XMD-CONTACTID':_0x292581[_0xa2df('0xde')],'XMD-CDRTYPE':_0xa2df('0x167'),'CALLERID(all)':_0x222f3d[_0xa2df('0x23')][_0x12c7b7][_0xa2df('0x161')](),'XMD-AMD':_0x5681d8[_0xa2df('0x115')]?_0xa2df('0x168'):_0xa2df('0x163'),'XMD-DESTINATION':_0xa2df('0x114')};if(_0x5681d8['dialAMDActive']){_0x58993a[_0xa2df('0x169')]=_0x5681d8[_0xa2df('0x16a')]||0x9c4;_0x58993a[_0xa2df('0x16b')]=_0x5681d8[_0xa2df('0x16c')]||0x5dc;_0x58993a[_0xa2df('0x16d')]=_0x5681d8[_0xa2df('0x16e')]||0x320;_0x58993a['XMD-AMDTOTALANALYSISTIME']=_0x5681d8[_0xa2df('0x16f')]||0x1388;_0x58993a[_0xa2df('0x170')]=_0x5681d8[_0xa2df('0x171')]||0x64;_0x58993a[_0xa2df('0x172')]=_0x5681d8[_0xa2df('0x173')]||0x32;_0x58993a[_0xa2df('0x174')]=_0x5681d8[_0xa2df('0x175')]||0x3;_0x58993a['XMD-AMDSILENCETHRESHOLD']=_0x5681d8['dialAMDSilenceThreshold']||0x100;_0x58993a['XMD-AMDMAXIMUMWORDLENGTH']=_0x5681d8[_0xa2df('0x176')]||0x1388;}if(utils[_0xa2df('0x164')](_0x5681d8)){_0x58993a['XMD-VOICEQUEUEID']=_0x292581[_0xa2df('0xf1')];}else{_0x58993a[_0xa2df('0x177')]=_0x292581[_0xa2df('0xe0')];}var _0xc6f751=utils[_0xa2df('0x178')](_0x292581[_0xa2df('0x179')]);Object[_0xa2df('0x143')](_0x58993a,_0xc6f751);var _0xb9b7f3=_0x222f3d[_0xa2df('0x85')](_0x5681d8['Trunk'])?utils[_0xa2df('0x17a')](_0x5681d8[_0xa2df('0x17b')][_0xa2df('0x17c')],_0x5681d8['dialOriginateCallerIdName'],_0x5681d8[_0xa2df('0x17d')]>0x0?utils[_0xa2df('0x17e')](_0x5681d8[_0xa2df('0x17f')],_0x5681d8[_0xa2df('0x17d')]):_0x5681d8[_0xa2df('0x17f')]):utils['getCallerId'](_[_0xa2df('0xfa')](_0x5681d8['TrunkBackup'])?_0x5681d8[_0xa2df('0x17b')][_0xa2df('0x17c')]:_0x5681d8[_0xa2df('0x8b')][_0xa2df('0x17c')],_0x5681d8[_0xa2df('0x180')],_0x5681d8[_0xa2df('0x17d')]>0x0?utils[_0xa2df('0x17e')](_0x5681d8['dialOriginateCallerIdNumber'],_0x5681d8[_0xa2df('0x17d')]):_0x5681d8['dialOriginateCallerIdNumber']);if(_0xb9b7f3){_0x58993a[_0xa2df('0x181')]=_0x222f3d[_0xa2df('0x23')][_0x12c7b7][_0xa2df('0x182')]=utils[_0xa2df('0x183')](_0xb9b7f3);_0x58993a['XMD-ORIGINATECALLERIDNUM']=_0x292581[_0xa2df('0x15e')];}_0x5681d8[_0xa2df('0x184')]=_0x58993a;return ami['Action']({'actionid':_0x12c7b7,'action':_0xa2df('0x15f'),'channel':_0x222f3d['isTrunkReachable'](_0x5681d8[_0xa2df('0x17b')])?util[_0xa2df('0x45')](_0xa2df('0x185'),_0x5681d8[_0xa2df('0x17b')][_0xa2df('0x47')],isNotNull(_0x5681d8[_0xa2df('0x186')])?_0x5681d8[_0xa2df('0x186')]['trim']()||'':'',_0x5681d8[_0xa2df('0x187')]>0x0?_0x292581['phone'][_0xa2df('0x188')](_0x5681d8['dialCutDigit']):_0x292581[_0xa2df('0x15e')]):util['format'](_0xa2df('0x185'),_['isNil'](_0x5681d8[_0xa2df('0x8b')])?_0x5681d8[_0xa2df('0x17b')][_0xa2df('0x47')]:_0x5681d8[_0xa2df('0x8b')][_0xa2df('0x47')],isNotNull(_0x5681d8[_0xa2df('0x186')])?_0x5681d8[_0xa2df('0x186')][_0xa2df('0x189')]()||'':'',_0x5681d8[_0xa2df('0x187')]>0x0?_0x292581['phone']['substring'](_0x5681d8[_0xa2df('0x187')]):_0x292581[_0xa2df('0x15e')]),'callerid':_0xb9b7f3,'Exten':'xcally-motion-dialer','Context':'from-sip','Priority':'1','variable':_0x58993a,'timeout':(_0x5681d8[_0xa2df('0x18a')]||0x1e)*0x3e8,'async':!![],'channelid':_0x12c7b7})[_0xa2df('0x3f')](function(_0x2a3f6b){return _0x17be4e(_0x2a3f6b);})[_0xa2df('0x9e')](function(_0x153813){_0x5681d8[_0xa2df('0x18b')]+=0x1;var _0x1162a1=new History(_0x222f3d[_0xa2df('0x23')][_0x12c7b7]);logger['error'](util[_0xa2df('0x45')]('[originateError]:\x20%s',JSON['stringify'](_0x153813)));_0x1162a1['state']=0xe;_0x1162a1[_0xa2df('0x6d')]=_0xa2df('0x18c');_0x1162a1[_0xa2df('0x6e')]=moment()[_0xa2df('0x45')]('YYYY-MM-DD\x20HH:mm:ss');_0x1162a1['endtime']=_0x1162a1[_0xa2df('0x6e')];hopperUtils[_0xa2df('0xca')](_0x1162a1)[_0xa2df('0x9e')](loggerCatch('[originate][error]'));_0x222f3d[_0xa2df('0x135')](_0x1162a1)[_0xa2df('0x9e')](loggerCatch(_0xa2df('0x18d')))[_0xa2df('0x101')](function(){delete _0x222f3d[_0xa2df('0x23')][_0x12c7b7];return _0x5bfe3b(msgResponse('originate',_0xa2df('0x18e'),'originate\x20action\x20Error'));});});});};Dialer[_0xa2df('0x84')][_0xa2df('0x18f')]=function(_0x2c9a72,_0x5a1dac,_0x3a4c05){var _0x2128da=new History(_0x5a1dac);if(_0x2128da[_0xa2df('0x12f')]+_0x2128da[_0xa2df('0x123')]+_0x2128da[_0xa2df('0x130')]+_0x2128da[_0xa2df('0x124')]+_0x2128da[_0xa2df('0xd7')]+_0x2128da[_0xa2df('0xee')]+_0x2128da[_0xa2df('0x122')]+_0x2128da['countagentrejectretry']>=_0x3a4c05['dialGlobalMaxRetry']-0x1){return!![];}switch(_0x2c9a72){case 0x3:if(_0x2128da['countnoanswerretry']>=_0x3a4c05[_0xa2df('0x190')]-0x1){return!![];}hopperUtils[_0xa2df('0xdd')]({'active':![],'countnoanswerretry':_0x2128da[_0xa2df('0x130')]+=0x1,'scheduledat':moment()['add'](_0x3a4c05[_0xa2df('0x191')],'minutes')[_0xa2df('0x45')](_0xa2df('0xc5')),'ContactId':_0x2128da[_0xa2df('0xde')],'ListId':_0x2128da[_0xa2df('0xdf')],'VoiceQueueId':_0x2128da[_0xa2df('0xf1')]||undefined,'CampaignId':_0x2128da[_0xa2df('0xe0')]||undefined})[_0xa2df('0x9e')](loggerCatch(_0xa2df('0x192')));break;case 0x5:if(_0x2128da[_0xa2df('0x12f')]>=_0x3a4c05[_0xa2df('0x193')]-0x1){return!![];}hopperUtils[_0xa2df('0xdd')]({'active':![],'countbusyretry':_0x2128da[_0xa2df('0x12f')]+=0x1,'scheduledat':moment()[_0xa2df('0xef')](_0x3a4c05[_0xa2df('0x194')],'minutes')['format'](_0xa2df('0xc5')),'ContactId':_0x2128da['ContactId'],'ListId':_0x2128da[_0xa2df('0xdf')],'VoiceQueueId':_0x2128da[_0xa2df('0xf1')]||undefined,'CampaignId':_0x2128da['CampaignId']||undefined})[_0xa2df('0x9e')](loggerCatch(_0xa2df('0x195')));break;case 0x8:if(_0x2128da[_0xa2df('0x123')]>=_0x3a4c05[_0xa2df('0x196')]-0x1){return!![];}hopperUtils['rescheduleContact']({'active':![],'countcongestionretry':_0x2128da[_0xa2df('0x123')]+=0x1,'scheduledat':moment()[_0xa2df('0xef')](_0x3a4c05[_0xa2df('0x197')],'minutes')['format'](_0xa2df('0xc5')),'ContactId':_0x2128da[_0xa2df('0xde')],'ListId':_0x2128da['ListId'],'VoiceQueueId':_0x2128da['VoiceQueueId']||undefined,'CampaignId':_0x2128da[_0xa2df('0xe0')]||undefined})[_0xa2df('0x9e')](loggerCatch(_0xa2df('0x198')));break;case 0x0:if(_0x2128da[_0xa2df('0x124')]>=_0x3a4c05[_0xa2df('0x199')]-0x1){return!![];}else{hopperUtils['rescheduleContact']({'active':![],'countnosuchnumberretry':_0x2128da['countnosuchnumberretry']+=0x1,'scheduledat':moment()['add'](_0x3a4c05['dialNoSuchNumberRetryFrequency'],_0xa2df('0xf0'))[_0xa2df('0x45')](_0xa2df('0xc5')),'ContactId':_0x2128da[_0xa2df('0xde')],'ListId':_0x2128da[_0xa2df('0xdf')],'VoiceQueueId':_0x2128da[_0xa2df('0xf1')]||undefined,'CampaignId':_0x2128da['CampaignId']||undefined})[_0xa2df('0x9e')](loggerCatch(_0xa2df('0x19a')));}break;case 0xa:if(_0x2128da[_0xa2df('0xd7')]>=_0x3a4c05['dialDropMaxRetry']-0x1){return!![];}hopperUtils[_0xa2df('0xdd')]({'active':![],'countdropretry':_0x2128da[_0xa2df('0xd7')]+=0x1,'scheduledat':moment()[_0xa2df('0xef')](_0x3a4c05[_0xa2df('0xd8')],_0xa2df('0xf0'))[_0xa2df('0x45')](_0xa2df('0xc5')),'ContactId':_0x2128da['ContactId'],'ListId':_0x2128da[_0xa2df('0xdf')],'VoiceQueueId':_0x2128da[_0xa2df('0xf1')]||undefined,'CampaignId':_0x2128da[_0xa2df('0xe0')]||undefined})[_0xa2df('0x9e')](loggerCatch(_0xa2df('0x19b')));break;case 0xb:if(_0x2128da['countabandonedretry']>=_0x3a4c05['dialAbandonedMaxRetry']-0x1){return!![];}hopperUtils[_0xa2df('0xdd')]({'active':![],'countabandonedretry':_0x2128da[_0xa2df('0xee')]+=0x1,'scheduledat':moment()[_0xa2df('0xef')](_0x3a4c05[_0xa2df('0xeb')],_0xa2df('0xf0'))['format'](_0xa2df('0xc5')),'ContactId':_0x2128da[_0xa2df('0xde')],'ListId':_0x2128da[_0xa2df('0xdf')],'VoiceQueueId':_0x2128da[_0xa2df('0xf1')]||undefined,'CampaignId':_0x2128da[_0xa2df('0xe0')]||undefined})[_0xa2df('0x9e')](loggerCatch('[rescheduleContact][Abandoned]'));break;case 0x13:if(_0x2128da[_0xa2df('0x122')]>=_0x3a4c05[_0xa2df('0x132')]-0x1){return!![];}hopperUtils['rescheduleContact']({'active':![],'countmachineretry':_0x2128da[_0xa2df('0x122')]+=0x1,'scheduledat':moment()[_0xa2df('0xef')](_0x3a4c05['dialMachineRetryFrequency'],_0xa2df('0xf0'))['format'](_0xa2df('0xc5')),'ContactId':_0x2128da['ContactId'],'ListId':_0x2128da[_0xa2df('0xdf')],'VoiceQueueId':_0x2128da[_0xa2df('0xf1')]||undefined,'CampaignId':_0x2128da[_0xa2df('0xe0')]||undefined})['catch'](loggerCatch('[rescheduleContact][Machine]'));break;case 0x14:if(_0x2128da[_0xa2df('0x125')]>=_0x3a4c05[_0xa2df('0x19c')]-0x1){return!![];}hopperUtils[_0xa2df('0xdd')]({'active':![],'countagentrejectretry':_0x2128da[_0xa2df('0x125')]+=0x1,'scheduledat':moment()[_0xa2df('0xef')](_0x3a4c05[_0xa2df('0x19d')],_0xa2df('0xf0'))[_0xa2df('0x45')](_0xa2df('0xc5')),'ContactId':_0x2128da[_0xa2df('0xde')],'ListId':_0x2128da[_0xa2df('0xdf')],'VoiceQueueId':_0x2128da[_0xa2df('0xf1')]||undefined,'CampaignId':_0x2128da[_0xa2df('0xe0')]||undefined})[_0xa2df('0x9e')](loggerCatch(_0xa2df('0x19e')));break;default:return!![];}};Dialer[_0xa2df('0x84')]['callProgressDetecting']=function(_0x261bda,_0x2009b4,_0x82dc15){var _0x21cbf8=this;var _0x2c64bc=new History(_0x261bda);var _0x28e466=![];var _0x1797e5;var _0x2a6414;return new Promise(function(_0x25b02e,_0x1cd476){if(_[_0xa2df('0x41')](_0x2009b4)&&typeof _0x2009b4!==_0xa2df('0x15c')){return _0x1cd476(msgResponse(_0xa2df('0x19f'),_0xa2df('0x91'),_0xa2df('0x1a0')));}if(_[_0xa2df('0x41')](_0x82dc15)&&typeof _0x82dc15!==_0xa2df('0x15c')){return _0x1cd476(msgResponse('[callProgressDetecting]',_0xa2df('0x91'),'evt\x20is\x20undefine'));}hopperUtils[_0xa2df('0xda')](_0x2c64bc,_0x82dc15[_0xa2df('0xc6')],_0x2009b4)['then'](function(_0x452812){if(_0x452812[_0xa2df('0xdb')]==0x1)_0x28e466=!![];switch(_0x82dc15['reason']){case'0':_0x2009b4['outboundNoSuchCallsDay']+=0x1;_0x2c64bc['state']=0x0;_0x2c64bc[_0xa2df('0x6d')]=_0xa2df('0x1a1');_0x2c64bc['countnosuchnumberretry']+=0x1;_0x2c64bc[_0xa2df('0xea')]+=0x1;ami[_0xa2df('0x42')](_0xa2df('0x1a2'),ut[_0xa2df('0x11d')](_0x261bda,_0xa2df('0x1a3')));_0x1797e5=_0x2009b4['dialNoSuchNumberRetryFrequency'];_0x2a6414=_0x2009b4[_0xa2df('0xd9')];hopperUtils[_0xa2df('0xca')](_0x2c64bc)[_0xa2df('0x9e')](loggerCatch(_0xa2df('0x12e')));if(_0x21cbf8['checkRetriveMax'](0x0,_0x261bda,_0x2009b4)&&!_0x28e466){if(_0x2c64bc[_0xa2df('0x124')]>=_0x2009b4['dialNoSuchNumberMaxRetry']){_0x21cbf8['createStateFinal'](_0x2c64bc,_0x25b02e,_0x1cd476,_0xa2df('0x1a4'));}else{_0x21cbf8[_0xa2df('0x127')](_0x2c64bc,_0x25b02e,_0x1cd476,_0xa2df('0x1a4'));}}break;case'3':_0x2009b4[_0xa2df('0x1a5')]+=0x1;_0x2c64bc[_0xa2df('0x6c')]=0x3;_0x2c64bc[_0xa2df('0x6d')]=_0xa2df('0x1a6');_0x2c64bc[_0xa2df('0x130')]+=0x1;_0x2c64bc['countglobal']+=0x1;var _0x28ac89=ut[_0xa2df('0x1a7')](_0x261bda,_0x2009b4);ami[_0xa2df('0x42')](_0xa2df('0x1a8'),_0x28ac89);_0x1797e5=_0x2009b4[_0xa2df('0x191')];_0x2a6414=_0x2009b4['callAdditionalPhoneAfterMin'];hopperUtils['createHistory'](_0x2c64bc)[_0xa2df('0x9e')](loggerCatch('[syncAgentComplete][createHistory][3]'));if(_0x21cbf8[_0xa2df('0x18f')](0x3,_0x261bda,_0x2009b4)&&!_0x28e466){if(_0x2c64bc['countnoanswerretry']>=_0x2009b4['dialNoAnswerMaxRetry']){_0x21cbf8[_0xa2df('0x128')](_0x2c64bc,_0x25b02e,_0x1cd476,'reason\x203\x20ringing\x20no\x20answer');}else{_0x21cbf8['stateGlobal'](_0x2c64bc,_0x25b02e,_0x1cd476,_0xa2df('0x1a9'));}}break;case'5':_0x2009b4['outboundBusyCallsDay']+=0x1;_0x2c64bc['state']=0x5;_0x2c64bc[_0xa2df('0x6d')]=_0xa2df('0x1aa');_0x2c64bc['countbusyretry']+=0x1;_0x2c64bc[_0xa2df('0xea')]+=0x1;ami[_0xa2df('0x42')](_0xa2df('0x1ab'),ut[_0xa2df('0x11d')](_0x261bda,_0xa2df('0x1ac')));_0x1797e5=_0x2009b4[_0xa2df('0x194')];_0x2a6414=_0x2009b4[_0xa2df('0xd9')];hopperUtils[_0xa2df('0xca')](_0x2c64bc)[_0xa2df('0x9e')](loggerCatch(_0xa2df('0x1ad')));if(_0x21cbf8[_0xa2df('0x18f')](0x5,_0x261bda,_0x2009b4)&&!_0x28e466){if(_0x2c64bc[_0xa2df('0x12f')]>=_0x2009b4[_0xa2df('0x193')]){_0x21cbf8[_0xa2df('0x128')](_0x2c64bc,_0x25b02e,_0x1cd476,_0xa2df('0x1ae'));}else{_0x21cbf8[_0xa2df('0x127')](_0x2c64bc,_0x25b02e,_0x1cd476,_0xa2df('0x1ae'));}}break;case'8':_0x2009b4[_0xa2df('0x1af')]+=0x1;_0x2c64bc['state']=0x8;_0x2c64bc[_0xa2df('0x6d')]=_0xa2df('0x1b0');_0x2c64bc['countcongestionretry']+=0x1;_0x2c64bc[_0xa2df('0xea')]+=0x1;_0x1797e5=_0x2009b4[_0xa2df('0x197')];_0x2a6414=_0x2009b4['callAdditionalPhoneAfterMin'];ami[_0xa2df('0x42')](_0xa2df('0x1b1'),ut[_0xa2df('0x11d')](_0x261bda,_0xa2df('0x1b2')));hopperUtils['createHistory'](_0x2c64bc)[_0xa2df('0x9e')](loggerCatch('[syncAgentComplete][createHistory][8]'));if(_0x21cbf8[_0xa2df('0x18f')](0x8,_0x261bda,_0x2009b4)&&!_0x28e466){if(_0x2c64bc[_0xa2df('0x123')]>=_0x2009b4[_0xa2df('0x196')]){_0x21cbf8[_0xa2df('0x128')](_0x2c64bc,_0x25b02e,_0x1cd476,_0xa2df('0x1b3'));}else{_0x21cbf8[_0xa2df('0x127')](_0x2c64bc,_0x25b02e,_0x1cd476,_0xa2df('0x1b3'));}}break;case'11':_0x2009b4[_0xa2df('0x1b4')]+=0x1;_0x2c64bc['state']=0xb;_0x2c64bc['statedesc']=_0xa2df('0xe8');_0x2c64bc['countabandonedretry']+=0x1;_0x2c64bc[_0xa2df('0xea')]+=0x1;_0x1797e5=_0x2009b4[_0xa2df('0xeb')];_0x2a6414=_0x2009b4['callAdditionalPhoneAfterMin'];hopperUtils[_0xa2df('0xca')](_0x2c64bc)[_0xa2df('0x9e')](loggerCatch(_0xa2df('0xf3')));if(_0x21cbf8['checkRetriveMax'](0xb,_0x261bda,_0x2009b4)&&!_0x28e466){if(_0x2c64bc[_0xa2df('0xee')]>=_0x2009b4[_0xa2df('0xec')]){_0x21cbf8[_0xa2df('0x128')](_0x2c64bc,_0x25b02e,_0x1cd476,_0xa2df('0x1b5'));}else{_0x21cbf8[_0xa2df('0x127')](_0x2c64bc,_0x25b02e,_0x1cd476,_0xa2df('0x1b5'));}}break;case'20':_0x2009b4[_0xa2df('0x1b6')]+=0x1;_0x2c64bc[_0xa2df('0x6c')]=0x14;_0x2c64bc[_0xa2df('0x6d')]=_0xa2df('0x1b7');_0x2c64bc[_0xa2df('0x125')]+=0x1;_0x2c64bc[_0xa2df('0xea')]+=0x1;_0x1797e5=_0x2009b4[_0xa2df('0x19d')];_0x2a6414=_0x2009b4[_0xa2df('0xd9')];ami['emit'](_0xa2df('0x1b8'),ut[_0xa2df('0x11d')](_0x261bda,'agentreject'));hopperUtils['createHistory'](_0x2c64bc)[_0xa2df('0x9e')](loggerCatch('[syncAgentComplete][createHistory][20]'));if(_0x21cbf8[_0xa2df('0x18f')](0x14,_0x261bda,_0x2009b4)&&!_0x28e466){if(_0x2c64bc[_0xa2df('0x125')]>=_0x2009b4[_0xa2df('0x19c')]){_0x21cbf8['createStateFinal'](_0x2c64bc,_0x25b02e,_0x1cd476,_0xa2df('0x1b9'));}else{_0x21cbf8[_0xa2df('0x127')](_0x2c64bc,_0x25b02e,_0x1cd476,_0xa2df('0x1b9'));}}break;default:_0x2009b4[_0xa2df('0x139')]+=0x1;_0x2c64bc['state']=0xc;_0x2c64bc['statedesc']=_0x82dc15[_0xa2df('0xc6')];_0x1797e5=_0x2009b4[_0xa2df('0x19d')];_0x2a6414=_0x2009b4[_0xa2df('0xd9')];hopperUtils[_0xa2df('0xca')](_0x2c64bc)[_0xa2df('0x9e')](loggerCatch(_0xa2df('0x1ba')));if(_0x21cbf8[_0xa2df('0x18f')](_0x82dc15[_0xa2df('0xc6')],_0x261bda,_0x2009b4)&&!_0x28e466){if(_0x2c64bc[_0xa2df('0x12f')]+_0x2c64bc['countcongestionretry']+_0x2c64bc[_0xa2df('0x130')]+_0x2c64bc[_0xa2df('0x124')]+_0x2c64bc['countdropretry']+_0x2c64bc['countabandonedretry']+_0x2c64bc[_0xa2df('0x122')]+_0x2c64bc[_0xa2df('0x125')]>=_0x2009b4[_0xa2df('0x126')]){_0x21cbf8['stateGlobal'](_0x2c64bc,_0x25b02e,_0x1cd476,_0x82dc15[_0xa2df('0xc6')]);}else{_0x21cbf8['createStateFinal'](_0x2c64bc,_0x25b02e,_0x1cd476,_0x82dc15[_0xa2df('0xc6')]);}}}})[_0xa2df('0x3f')](function(){if(_0x28e466){hopperUtils[_0xa2df('0xe5')](_0x2c64bc,_0x1797e5,_0x2a6414)[_0xa2df('0x3f')](function(){return _0x25b02e(0x1);});}});});};Dialer[_0xa2df('0x84')][_0xa2df('0x127')]=function(_0x403238,_0x41c542,_0x21fdf1,_0x2ee6d9){var _0x44f9ce=new Final(_0x403238);_0x44f9ce['state']=0xf;_0x44f9ce['statedesc']=_0xa2df('0x1bb');this[_0xa2df('0x128')](_0x44f9ce,_0x41c542,_0x21fdf1,_0x2ee6d9);};Dialer[_0xa2df('0x84')]['createStateFinal']=function(_0x5655d2,_0x174336,_0x3894d6,_0x17b77a){hopperUtils['moveContactManagedDialer'](_0x5655d2)[_0xa2df('0x3f')](function(){return _0x174336(msgResponse('[callProgressDetecting]',_0xa2df('0x1bc'),_0x17b77a));})[_0xa2df('0x9e')](function(){return _0x3894d6(msgResponse(_0xa2df('0x1bd'),'Failure',_0xa2df('0x1be')));});};Dialer[_0xa2df('0x84')][_0xa2df('0x9')]=function(_0xcb7137){var _0x55c0f5=_0xcb7137[_0xa2df('0x1bf')]/0x64;var _0x138b39=_0xcb7137['outboundDropCallsDayTimeout']/(_0xcb7137[_0xa2df('0xd2')]+_0xcb7137['outboundAnswerCallsDay']);var _0x11eb92=Math[_0xa2df('0x1c0')](_0xcb7137['predictiveIntervalAvailable']*(_0xcb7137[_0xa2df('0x1c1')]/0x64));var _0xa90c57=Math[_0xa2df('0x1c0')](_0xcb7137['predictiveIntervalAvailable']*(_0xcb7137[_0xa2df('0x1c2')]/0x64));var _0x2e7ad3=_0xcb7137['available']+_0xcb7137['talking'];var _0xa8553b=Math[_0xa2df('0x1c3')](_0xcb7137[_0xa2df('0x59')]*_0xcb7137['erlangAbandonmentRate']*_0xcb7137[_0xa2df('0x1c4')]*_0xcb7137[_0xa2df('0x1c5')]);if(_[_0xa2df('0x41')](_0xcb7137[_0xa2df('0x5e')])){if(!_[_0xa2df('0x41')](_0xcb7137[_0xa2df('0x25')])){_0xcb7137[_0xa2df('0x25')]=undefined;loggerPredictive[_0xa2df('0x64')](_0xa2df('0x1c6'),_0xa2df('0x1c7'));}if(!_[_0xa2df('0x41')](_0xcb7137['handlePredictive'])){loggerPredictive['error']('[startMethodPredictive][StartProgressive]',_0xa2df('0x1c8'));clearInterval(_0xcb7137[_0xa2df('0x62')]);_0xcb7137['handlePredictive']=undefined;}_0xcb7137[_0xa2df('0x5e')]=moment()['format'](_0xa2df('0xc5'));loggerPredictive[_0xa2df('0x49')](_0xcb7137['name'],_0xa2df('0x1c9'),_0xcb7137[_0xa2df('0x5e')]);this[_0xa2df('0xb1')](_0xcb7137,0x1);}else if(ifInterval(_0xcb7137[_0xa2df('0x1ca')],_0xcb7137[_0xa2df('0x5e')])){this['handlePower'](_0xcb7137,0x1);loggerPredictiveCalls[_0xa2df('0x49')](_0xa2df('0x1cb'),_0xcb7137[_0xa2df('0x5e')],_0xcb7137[_0xa2df('0x47')]);_0xcb7137['erlangCalls']=0x0;_0xcb7137[_0xa2df('0xd3')]=0x0;}else if(_0x55c0f5<_0x138b39&&_0xcb7137['dialPredictiveOptimization']===_0xa2df('0x1cc')){clearPredictiveAttributes(_0xcb7137);loggerPredictive[_0xa2df('0x49')](_0xa2df('0x1cd'),_0xa2df('0x1ce'),_0x138b39,_0xa2df('0x5e'),_0xcb7137[_0xa2df('0x47')]);}else if(_0xa8553b<_0xcb7137[_0xa2df('0xd3')]&&_0xcb7137[_0xa2df('0x1cf')]===_0xa2df('0x1cc')){clearPredictiveAttributes(_0xcb7137);loggerPredictive[_0xa2df('0x49')](_0xa2df('0x1d0'),_0xa2df('0x1d1'),_0xa8553b,_0xa2df('0x1d2'),_0xcb7137[_0xa2df('0xd3')],_0xa2df('0x5e'),_0xcb7137[_0xa2df('0x47')]);}else if(!ifInterval(_0xcb7137['dialPredictiveInterval'],_0xcb7137['startProgressive'])&&_[_0xa2df('0x41')](_0xcb7137['startPredictive'])&&!_[_0xa2df('0x41')](_0xcb7137['startProgressive'])){_0xcb7137[_0xa2df('0x25')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive[_0xa2df('0x49')](_0xcb7137['name'],_0xa2df('0x1d3'),_0xcb7137[_0xa2df('0x25')]);hopperUtils['avgHandleTime'](_0xcb7137[_0xa2df('0x1ca')])['then'](this[_0xa2df('0x1d4')](_0xcb7137))[_0xa2df('0x3f')](mergeDataErlangB(_0xcb7137))[_0xa2df('0x3f')](this[_0xa2df('0x1d5')](_0xcb7137))[_0xa2df('0x9e')](loggerCatchPredictive(_0xa2df('0x1d6'),_0xcb7137));}else if(!ifInterval(_0xcb7137[_0xa2df('0x1ca')],_0xcb7137['startPredictive'])){_0xcb7137[_0xa2df('0xd3')]=0x0;_0xcb7137[_0xa2df('0x25')]=moment()[_0xa2df('0x45')](_0xa2df('0xc5'));loggerPredictive[_0xa2df('0x49')](_0xcb7137[_0xa2df('0x47')],'recalculate\x20predictive\x20at',_0xcb7137[_0xa2df('0x25')]);clearInterval(_0xcb7137['handlePredictive']);_0xcb7137[_0xa2df('0x62')]=undefined;hopperUtils[_0xa2df('0x1d7')](_0xcb7137['dialPredictiveInterval'])[_0xa2df('0x3f')](this[_0xa2df('0x1d4')](_0xcb7137))[_0xa2df('0x3f')](mergeDataErlangB(_0xcb7137))[_0xa2df('0x3f')](this[_0xa2df('0x1d5')](_0xcb7137))[_0xa2df('0x9e')](loggerCatchPredictive(_0xa2df('0x1d8'),_0xcb7137));}else if(_0xcb7137[_0xa2df('0x1d9')]&&_0x2e7ad3<_0xcb7137['predictiveIntervalAvailable']-_0xa90c57){clearPredictiveAttributes(_0xcb7137);loggerPredictive[_0xa2df('0x49')](_0xcb7137[_0xa2df('0x47')],_0xa2df('0x1da'),_0x2e7ad3,_0xa2df('0x1db'),_0xcb7137[_0xa2df('0x1d9')],'-',_0xa90c57,'=',_0xcb7137['predictiveIntervalAvailable']-_0xa90c57,')');}else if(_0xcb7137[_0xa2df('0x1d9')]&&_0x2e7ad3>_0xcb7137['predictiveIntervalAvailable']+_0x11eb92){clearPredictiveAttributes(_0xcb7137);loggerPredictive[_0xa2df('0x49')](_0xcb7137['name'],_0xa2df('0x1da'),_0x2e7ad3,_0xa2df('0x1dc'),_0xcb7137[_0xa2df('0x1d9')],'+',_0x11eb92,'=',_0xcb7137[_0xa2df('0x1d9')]+_0x11eb92,')');}};Dialer[_0xa2df('0x84')]['getDataPredictive']=function(_0x55b5dd){var _0x329894=this;return function(_0x535931){return new Promise(function(_0x35eb06,_0x1f7f60){_[_0xa2df('0x5d')](_0x55b5dd,_0x535931[0x0]);if(checkGetDataPredictive(_0x535931[0x0])){var _0x1dfa24=_0x55b5dd[_0xa2df('0x1d9')]=_0x55b5dd['talking']+_0x55b5dd[_0xa2df('0x1dd')];var _0x1d0e8f=_0x55b5dd['dialPredictiveInterval']*0x3c;var _0xd73ee1=_0x535931[0x0]['predictiveIntervalAvgTalktime']+_0x535931[0x0][_0xa2df('0x52')];var _0x13bfa5=(_0x535931[0x0]['predictiveIntervalAnsweredCalls']+_0x535931[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x535931[0x0][_0xa2df('0xe6')])/_0x535931[0x0][_0xa2df('0x4c')];_0x55b5dd[_0xa2df('0x1c4')]=_0x13bfa5>0x0?_0x13bfa5:0x1;switch(_0x55b5dd['dialPredictiveOptimization']){case'dropRate':var _0x4aeb89=_0x55b5dd[_0xa2df('0x1bf')]/0x64;return _0x329894[_0xa2df('0x1de')](_0x1dfa24,_0x1d0e8f,_0xd73ee1,_0x13bfa5,_0x4aeb89)['then'](function(_0x49a19f){return _0x35eb06(_0x49a19f);});case _0xa2df('0x1df'):var _0x5cfc15=_0x55b5dd[_0xa2df('0x1bf')]/0x64;return _0x329894[_0xa2df('0x1e0')](_0x1dfa24,_0x1d0e8f,_0xd73ee1,_0x13bfa5,_0x5cfc15)[_0xa2df('0x3f')](function(_0x4b9827){return _0x35eb06(_0x4b9827);});default:return _0x1f7f60(msgResponse(_0xa2df('0x1e1'),_0xa2df('0x91'),_0xa2df('0x1e2')));}}else{return _0x1f7f60(msgResponse(_0xa2df('0x1e1'),_0xa2df('0x91'),_0xa2df('0x1e3')));}});};};Dialer[_0xa2df('0x84')][_0xa2df('0x1e4')]=function(_0x2d4ab5){var _0x32de4f=this;return function(_0xf5583a){return new Promise(function(_0xac2866,_0x2c2c01){_[_0xa2df('0x5d')](_0x2d4ab5,_0xf5583a[0x0]);if(checkGetDataPredictive(_0xf5583a[0x0])){loggerPredictive[_0xa2df('0x49')](JSON[_0xa2df('0x72')](_0xf5583a[0x0]));if(_0x2d4ab5[_0xa2df('0x1cf')]===_0xa2df('0x1cc')){return _0x32de4f[_0xa2df('0x152')](_0x2d4ab5['id'])['then'](function(_0x45e7e0){var _0x577a5b=_0x2d4ab5[_0xa2df('0x1e5')]-_0x45e7e0[0x0][_0xa2df('0x1e6')];var _0x2f4f1b=_0x2d4ab5[_0xa2df('0x1ca')]*0x3c;var _0x21c557=_0xf5583a[0x0][_0xa2df('0x54')]+_0xf5583a[0x0][_0xa2df('0x52')];var _0x2414e4=(_0xf5583a[0x0][_0xa2df('0x1e7')]+_0xf5583a[0x0]['predictiveIntervalDroppedCallsTimeout']+_0xf5583a[0x0][_0xa2df('0xe6')])/_0xf5583a[0x0][_0xa2df('0x4c')];var _0x58bfc0=_0x2d4ab5[_0xa2df('0x1bf')]/0x64;_0x2d4ab5[_0xa2df('0x1e8')]=_0x45e7e0[0x0][_0xa2df('0x1e6')]||0x0;_0x2d4ab5[_0xa2df('0x1c4')]=_0x2414e4>0x0?_0x2414e4:0x1;return _0x32de4f['abandonmentRate'](_0x577a5b,_0x2f4f1b,_0x21c557,_0x2414e4,_0x58bfc0);})['then'](function(_0x474240){return _0xac2866(_0x474240);})['catch'](function(_0x47ebef){return _0x2c2c01(msgResponse('[CatchErlangB]',_0xa2df('0x91'),JSON[_0xa2df('0x72')](_0x47ebef)));});}if(_0x2d4ab5[_0xa2df('0x1cf')]===_0xa2df('0x1df')){return _0x32de4f[_0xa2df('0x152')](_0x2d4ab5['id'])[_0xa2df('0x3f')](function(_0x237903){var _0x4c2f8d=_0x2d4ab5[_0xa2df('0x1e5')]-_0x237903[0x0]['outboundQueuePauses'];var _0x505ea7=_0x2d4ab5[_0xa2df('0x1ca')]*0x3c;var _0x509f8b=_0xf5583a[0x0][_0xa2df('0x54')]+_0xf5583a[0x0][_0xa2df('0x52')];var _0x3fa223=(_0xf5583a[0x0][_0xa2df('0x1e7')]+_0xf5583a[0x0][_0xa2df('0x4f')]+_0xf5583a[0x0][_0xa2df('0xe6')])/_0xf5583a[0x0][_0xa2df('0x4c')];var _0x5e20f3=_0x2d4ab5[_0xa2df('0x1bf')]/0x64;_0x2d4ab5[_0xa2df('0x1e8')]=_0x237903[0x0][_0xa2df('0x1e6')]||0x0;_0x2d4ab5['predictiveIntervalHitRate']=_0x3fa223>0x0?_0x3fa223:0x1;return _0x32de4f[_0xa2df('0x1e0')](_0x4c2f8d,_0x505ea7,_0x509f8b,_0x3fa223,_0x5e20f3);})[_0xa2df('0x3f')](function(_0x12e59d){return _0xac2866(_0x12e59d);})[_0xa2df('0x9e')](function(_0x3eae7d){return _0x2c2c01(msgResponse(_0xa2df('0x1e9'),_0xa2df('0x91'),JSON[_0xa2df('0x72')](_0x3eae7d)));});}}else{return _0x2c2c01(msgResponse(_0xa2df('0x1e1'),_0xa2df('0x91'),_0xa2df('0x1e3')));}});};};Dialer[_0xa2df('0x84')][_0xa2df('0x1d5')]=function(_0x1436a1){var _0x5a7dff=this;return function(){var _0x58bb63=0x0;var _0x341750=Math[_0xa2df('0x1c3')](_0x1436a1['erlangCallToSecond']*0x3e8);if(_0x341750>0x0){_0x341750=_0x341750<0x64?0x64:_0x341750;loggerPredictive[_0xa2df('0x49')](_0x1436a1[_0xa2df('0x47')],_0xa2df('0x1ea'),_0x341750,_0xa2df('0x1eb'));_0x1436a1['handlePredictive']=setInterval(function(){_0x5a7dff[_0xa2df('0x62')](_0x1436a1);loggerPredictiveCalls['info']('[handlePredictive]',_0x58bb63+=0x1);},_0x341750);}else{loggerPredictive[_0xa2df('0x49')](_0x1436a1['name'],_0xa2df('0x1ec'));}};};Dialer['prototype'][_0xa2df('0x1ed')]=function(_0x2f92eb,_0x40df55){var _0x575650=this;return function(_0x4f5f96){if(_[_0xa2df('0x92')](_0x4f5f96)){if(_[_0xa2df('0xfa')](_0x40df55[_0xa2df('0x1ee')])||!_0x40df55['recallme']){if(_0x2f92eb['dialMethod']===_0xa2df('0x8')){_0x2f92eb[_0xa2df('0x6f')]=_[_0xa2df('0x41')](_0x2f92eb[_0xa2df('0x6f')])?!![]:_0x2f92eb[_0xa2df('0x6f')];var _0x54bfb2=uuid['v4']();_0x575650['actions'][_0x54bfb2]=new Action(_0x2f92eb,_0x40df55,_0x54bfb2);loggerBooked[_0xa2df('0x49')]('[booked][checkContactBlack]',_0x54bfb2,_0xa2df('0x1ef'),JSON[_0xa2df('0x72')](_0x2f92eb[_0xa2df('0x6f')]),'Queue:\x20',_0x2f92eb['name']);if(_0x2f92eb[_0xa2df('0x6f')]){_0x2f92eb[_0xa2df('0x6f')]=![];_0x575650[_0xa2df('0x27')][_0x575650[_0xa2df('0x23')][_0x54bfb2][_0xa2df('0xc0')]]=[];ami[_0xa2df('0x9a')]({'actionid':_0x54bfb2,'action':'queuestatus','queue':_0x2f92eb[_0xa2df('0x47')]})[_0xa2df('0x9e')](function(){_0x575650[_0xa2df('0xcd')](_0x2f92eb);hopperUtils['rescheduleContact']({'active':![],'ContactId':_0x575650[_0xa2df('0x23')][_0x54bfb2]['ContactId'],'ListId':_0x575650['actions'][_0x54bfb2][_0xa2df('0xdf')],'VoiceQueueId':_0x575650[_0xa2df('0x23')][_0x54bfb2]['VoiceQueueId']||undefined,'CampaignId':_0x575650[_0xa2df('0x23')][_0x54bfb2]['CampaignId']||undefined})[_0xa2df('0x9e')](loggerCatch('[unlockOriginate][syncQueueStatusComplete]'));delete _0x575650['actions'][_0x54bfb2];});}else{loggerBooked[_0xa2df('0x49')](_0xa2df('0x1f0'),JSON['stringify'](_0x2f92eb[_0xa2df('0x6f')]),_0xa2df('0x1f1'),_0x2f92eb['name']);_0x575650[_0xa2df('0xcd')](_0x2f92eb);hopperUtils[_0xa2df('0xdd')]({'active':![],'ContactId':_0x575650['actions'][_0x54bfb2]['ContactId'],'ListId':_0x575650[_0xa2df('0x23')][_0x54bfb2][_0xa2df('0xdf')],'VoiceQueueId':_0x575650['actions'][_0x54bfb2][_0xa2df('0xf1')]||undefined,'CampaignId':_0x575650[_0xa2df('0x23')][_0x54bfb2][_0xa2df('0xe0')]||undefined})[_0xa2df('0x9e')](loggerCatch(_0xa2df('0x1f2')));delete _0x575650['actions'][_0x54bfb2];}}else{return _0x575650[_0xa2df('0x15b')](_0x2f92eb,_0x40df55);}}else{if(utils['getSeconds'](undefined,_0x40df55[_0xa2df('0x1f3')])<_0x2f92eb[_0xa2df('0x1f4')]*0x3c){if(_0x40df55['Agent']&&!_0x40df55['Agent'][_0xa2df('0x1f5')]){_0x575650[_0xa2df('0xff')][_0xa2df('0x1f6')](_0x40df55['id'])[_0xa2df('0x101')](function(){_0x575650['updateOriginated'](_0x2f92eb);});}else{hopperUtils[_0xa2df('0x1f7')]({'active':![]},_0x40df55['id'],0x1)[_0xa2df('0x101')](function(){_0x575650[_0xa2df('0xcd')](_0x2f92eb);});}}else{_0x2f92eb[_0xa2df('0x1f8')]+=0x1;_0x575650['updateOriginated'](_0x2f92eb);if(_0x2f92eb[_0xa2df('0x1f9')]){hopperUtils[_0xa2df('0xdd')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x40df55[_0xa2df('0xde')],'ListId':_0x40df55[_0xa2df('0xdf')],'VoiceQueueId':_0x40df55[_0xa2df('0xf1')]||undefined,'CampaignId':_0x40df55[_0xa2df('0xe0')]||undefined})[_0xa2df('0x9e')](loggerCatch(_0xa2df('0x1fa')));hopperUtils[_0xa2df('0xca')](createObjHistory(_0x2f92eb,_0x40df55,utils[_0xa2df('0x67')][_0xa2df('0x1fb')],0x17,_0xa2df('0x1fc')))[_0xa2df('0x9e')](loggerCatch(_0xa2df('0x1fd')));}else{_0x575650[_0xa2df('0x11f')](createObjHistory(_0x2f92eb,_0x40df55,utils[_0xa2df('0x67')]['RECALL_TIMEOUT'],0x16,'RecallFailedTimeout'),_0xa2df('0x1fe'),_0xa2df('0x1ff'));}}}}else{_0x2f92eb[_0xa2df('0x200')]+=0x1;_0x575650[_0xa2df('0x11f')](createObjHistory(_0x2f92eb,_0x40df55,utils['CAMPAIGN_STATUS'][_0xa2df('0x201')],0xd,_0xa2df('0x202')),'[Originate][historyBlacklist]','[Originate][MoveBlacklist]');throw'inBlackList';}};};Dialer[_0xa2df('0x84')]['handleIvr']=function(_0x48da05){var _0x1c70cc=this;var _0x3dbbbb=_0x48da05[_0xa2df('0x203')]-_0x48da05['originated'];emitCampaignSummary(_0x48da05);if(_0x3dbbbb>0x0&&_0x48da05[_0xa2df('0x204')]==0x0){if(_0x3dbbbb>this['maxNumberOriginate']){_0x3dbbbb=this[_0xa2df('0x21')];}_0x48da05[_0xa2df('0x204')]=0x1;hopperUtils[_0xa2df('0x205')](_0x48da05,_0x3dbbbb)[_0xa2df('0x3f')](function(_0xf74c72){_0x48da05['temp']=0x0;if(_0xf74c72){if(!utils[_0xa2df('0x206')](_0xf74c72)){_0x48da05['message']=utils[_0xa2df('0x67')][_0xa2df('0x207')];logger[_0xa2df('0x49')](_0xa2df('0x208')+_0x48da05['name']);}else{_0x48da05['originated']+=_0xf74c72['length'];_0x48da05['message']=utils[_0xa2df('0x67')][_0xa2df('0x209')];for(var _0x14e0aa=0x0;_0x14e0aa<_0xf74c72[_0xa2df('0x98')];_0x14e0aa+=0x1){_0x48da05[_0xa2df('0x20a')]+=0x1;if(_[_0xa2df('0xfa')](_0xf74c72[_0x14e0aa])||_[_0xa2df('0xfa')](_0xf74c72[_0x14e0aa][_0xa2df('0x179')])||_[_0xa2df('0xfa')](_0xf74c72[_0x14e0aa]['phone'])){_0x1c70cc[_0xa2df('0x156')](_0xa2df('0x20b'),_0x48da05,_0xf74c72[_0x14e0aa]);}else{hopperUtils[_0xa2df('0x20c')](_[_0xa2df('0x73')](_0xf74c72[_0x14e0aa],[_0xa2df('0xe0'),_0xa2df('0x15e')]))[_0xa2df('0x3f')](_0x1c70cc[_0xa2df('0x1ed')](_0x48da05,_0xf74c72[_0x14e0aa]))[_0xa2df('0x9e')](_0x1c70cc[_0xa2df('0x155')](_0xa2df('0x20d'),_0x48da05));}}}}})[_0xa2df('0x9e')](loggerGetContactDialer(_0xa2df('0x20e'),_0x48da05,_0x3dbbbb));}};Dialer[_0xa2df('0x84')][_0xa2df('0xb1')]=function(_0x3f883b,_0x46a4bc){var _0x3a7898=this;var _0x57be21=[];if(_0x46a4bc<0x1||_0x3f883b['dialMethod']===_0xa2df('0x8')){_0x46a4bc=0x1;}var _0x5f2ef4=Math[_0xa2df('0x1c3')](_0x3f883b['available']*_0x46a4bc)-_0x3f883b[_0xa2df('0x7e')];if(_0x3f883b[_0xa2df('0x20f')]>0x0){var _0x5cbc1c=_0x3f883b[_0xa2df('0x20f')]-_0x3f883b['originated']-_0x3f883b['talking']-_0x3f883b[_0xa2df('0x210')];if(_0x5f2ef4>_0x5cbc1c){_0x5f2ef4=_0x5cbc1c;}}if(_0x5f2ef4>0x0&&_0x3f883b[_0xa2df('0x204')]==0x0){if(_0x3f883b['dialMethod']===_0xa2df('0x8')){_0x5f2ef4=0x1;}if(_0x5f2ef4>this[_0xa2df('0x21')]){_0x5f2ef4=this['maxNumberOriginate'];}for(var _0x29baa3 in this[_0xa2df('0x1f')]){if(typeof this[_0xa2df('0x1f')][_0x29baa3]!==_0xa2df('0xa8')){if(this[_0xa2df('0x1f')][_0x29baa3][_0xa2df('0x6c')]===_0xa2df('0x211')&&this[_0xa2df('0x1f')][_0x29baa3][_0xa2df('0x88')]==='reachable'){_0x57be21['push'](this[_0xa2df('0x1f')][_0x29baa3]['id']);}}}_0x3f883b[_0xa2df('0x204')]=0x1;hopperUtils[_0xa2df('0x212')](_0x3f883b,_0x57be21,_0x5f2ef4)['then'](function(_0x2ef983){_0x3f883b[_0xa2df('0x204')]=0x0;if(_0x2ef983){if(!utils[_0xa2df('0x206')](_0x2ef983)){hopperUtils[_0xa2df('0x213')](_0x3f883b)[_0xa2df('0x3f')](sendMessageReschedule(_0x3f883b))[_0xa2df('0x9e')](loggerCatch(_0xa2df('0x214')));}else{_0x3f883b[_0xa2df('0x7e')]+=_0x2ef983['length'];_0x3f883b['message']=_0x3f883b[_0xa2df('0xaf')]==='booked'?utils[_0xa2df('0x67')][_0xa2df('0x168')]:utils[_0xa2df('0x67')][_0xa2df('0x209')];for(var _0x51bc1c=0x0;_0x51bc1c<_0x2ef983['length'];_0x51bc1c+=0x1){if(_[_0xa2df('0xfa')](_0x2ef983[_0x51bc1c])||_['isNil'](_0x2ef983[_0x51bc1c][_0xa2df('0x179')])||_[_0xa2df('0xfa')](_0x2ef983[_0x51bc1c][_0xa2df('0x15e')])){_0x3a7898['emptyContact']('[actionOriginate]\x20',_0x3f883b,_0x2ef983[_0x51bc1c]);}else{hopperUtils[_0xa2df('0x215')](_['pick'](_0x2ef983[_0x51bc1c],['VoiceQueueId',_0xa2df('0x15e')]))['then'](_0x3a7898[_0xa2df('0x1ed')](_0x3f883b,_0x2ef983[_0x51bc1c]))[_0xa2df('0x9e')](_0x3a7898[_0xa2df('0x155')](_0xa2df('0x20b'),_0x3f883b));}}}}})['catch'](loggerGetContactDialer(_0xa2df('0x216'),_0x3f883b,_0x5f2ef4));}};Dialer[_0xa2df('0x84')][_0xa2df('0x62')]=function(_0xcfcdd0){if(_0xcfcdd0['dialLimitQueue']>0x0){var _0x459579=_0xcfcdd0[_0xa2df('0x20f')]-_0xcfcdd0['originated']-_0xcfcdd0[_0xa2df('0x217')];if(_0x459579>0x0&&_0xcfcdd0[_0xa2df('0x204')]==0x0){this[_0xa2df('0x218')](_0xcfcdd0);}else{loggerPredictiveCalls['info'](_0xa2df('0x219'));}}else{this[_0xa2df('0x218')](_0xcfcdd0);}};Dialer[_0xa2df('0x84')]['tryOriginatePredictive']=function(_0x102b1c){var _0x401db0=this;var _0x5e315a=[];_0x102b1c['originated']+=0x1;for(var _0x350dc8 in this['agents']){if(typeof this[_0xa2df('0x1f')][_0x350dc8]!=='undefined'){if(this['agents'][_0x350dc8][_0xa2df('0x6c')]===_0xa2df('0x211')&&this[_0xa2df('0x1f')][_0x350dc8][_0xa2df('0x88')]===_0xa2df('0x89')){_0x5e315a[_0xa2df('0x99')](this[_0xa2df('0x1f')][_0x350dc8]['id']);}}}_0x102b1c[_0xa2df('0x204')]=0x1;return this[_0xa2df('0x212')](_0x102b1c['id'],_0x5e315a,0x1,_0x102b1c['dialOrderByScheduledAt'],_0x102b1c)[_0xa2df('0x3f')](function(_0x2f5808){_0x102b1c[_0xa2df('0x204')]=0x1;if(_0x2f5808){if(!utils[_0xa2df('0x206')](_0x2f5808)){utils[_0xa2df('0x65')](_0x102b1c,0x1,0x0);return hopperUtils[_0xa2df('0x213')](_0x102b1c)[_0xa2df('0x3f')](sendMessageReschedule(_0x102b1c))[_0xa2df('0x9e')](loggerCatch('[countReScheduled]\x20'));}else{_0x102b1c[_0xa2df('0x6a')]=utils['CAMPAIGN_STATUS'][_0xa2df('0x209')];if(_[_0xa2df('0xfa')](_0x2f5808[0x0])||_[_0xa2df('0xfa')](_0x2f5808[0x0][_0xa2df('0x179')])||_[_0xa2df('0xfa')](_0x2f5808[0x0]['phone'])){_0x401db0['emptyContact'](_0xa2df('0x20b'),_0x102b1c,_0x2f5808[0x0]);}else{return hopperUtils['checkIsBlackList'](_[_0xa2df('0x73')](_0x2f5808[0x0],['VoiceQueueId','phone']))[_0xa2df('0x3f')](_0x401db0['checkContactBlack'](_0x102b1c,_0x2f5808[0x0]))[_0xa2df('0x9e')](_0x401db0[_0xa2df('0x155')](_0xa2df('0x21a'),_0x102b1c));}}}})[_0xa2df('0x9e')](loggerGetContactDialer(_0xa2df('0x21b'),_0x102b1c,0x1));};Dialer[_0xa2df('0x84')][_0xa2df('0x1de')]=function(_0x22dd78,_0x5da648,_0x40106c,_0x2e67bc,_0x1fc105,_0x545d7c){loggerPredictive[_0xa2df('0x49')](_0xa2df('0x21c'));loggerPredictive[_0xa2df('0x49')](_0xa2df('0x21d'),_0x22dd78);loggerPredictive[_0xa2df('0x49')](_0xa2df('0x21e'),_0x5da648);loggerPredictive[_0xa2df('0x49')](_0xa2df('0x21f'),_0x40106c);loggerPredictive['info'](_0xa2df('0x220'),_0x2e67bc);loggerPredictive['info'](_0xa2df('0x221'),_0x1fc105);loggerPredictive[_0xa2df('0x49')](_0xa2df('0x55'));return new Promise(function(_0x1369cc,_0x4a8aaf){if(_0x22dd78<=0x0||isNaN(_0x22dd78)){return _0x4a8aaf(msgResponse('[abandonmentRate]','Error',_0xa2df('0x222')+_0x22dd78));}if(_0x40106c<=0x0||isNaN(_0x40106c)){return _0x4a8aaf(msgResponse(_0xa2df('0x223'),_0xa2df('0x18e'),'Ts\x20=\x20'+_0x40106c));}if(_0x2e67bc<=0x0||isNaN(_0x2e67bc)){return _0x4a8aaf(msgResponse('[abandonmentRate]',_0xa2df('0x18e'),_0xa2df('0x224')+_0x2e67bc));}if(_0x5da648<=0x0||isNaN(_0x5da648)){return _0x4a8aaf(msgResponse('[abandonmentRate]','Error',_0xa2df('0x225')+_0x5da648));}if(_0x1fc105<=0x0||isNaN(_0x1fc105)){return _0x4a8aaf(msgResponse('[abandonmentRate]','Error','Amax\x20=\x20'+_0x1fc105));}_0x545d7c=_0x545d7c||0x0;var _0x3e70cd=0x1/_0x40106c;var _0x44fa54=0x0;var _0xb0da2=0x0;var _0x558837=0x0;var _0x5367c6=0x0;for(var _0x1e8a26=0x0;_0x558837<_0x1fc105;_0x1e8a26+=0x1){_0xb0da2=_0x1e8a26/_0x5da648;_0x44fa54=(_0x2e67bc*_0xb0da2+_0x545d7c)/_0x3e70cd;_0x558837=utils[_0xa2df('0x226')](_0x44fa54,_0x22dd78);_0x5367c6=_0x44fa54/_0x22dd78*(0x1-utils[_0xa2df('0x226')](_0x44fa54,_0x22dd78));}return _0x1369cc({'erlangCalls':_0x1e8a26,'erlangCallToSecond':_0x5da648/_0x1e8a26,'erlangAbandonmentRate':_0x558837,'erlangBusyFactor':_0x5367c6});});};Dialer[_0xa2df('0x84')][_0xa2df('0x1e0')]=function(_0x410468,_0x1d32aa,_0x23d3af,_0x3ad360,_0x291086,_0x5ae571){loggerPredictive[_0xa2df('0x49')](_0xa2df('0x227'));loggerPredictive['info'](_0xa2df('0x21d'),_0x410468);loggerPredictive['info'](_0xa2df('0x21e'),_0x1d32aa);loggerPredictive[_0xa2df('0x49')]('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',_0x23d3af);loggerPredictive[_0xa2df('0x49')]('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',_0x3ad360);loggerPredictive[_0xa2df('0x49')](_0xa2df('0x228'),_0x291086);loggerPredictive['info'](_0xa2df('0x55'));return new Promise(function(_0x1ae4af,_0x1e5253){if(_0x410468<=0x0||isNaN(_0x410468)){return _0x1e5253(msgResponse('[busyFactor]',_0xa2df('0x18e'),_0xa2df('0x222')+_0x410468));}if(_0x23d3af<=0x0||isNaN(_0x23d3af)){return _0x1e5253(msgResponse(_0xa2df('0x229'),_0xa2df('0x18e'),_0xa2df('0x22a')+_0x23d3af));}if(_0x3ad360<=0x0||isNaN(_0x3ad360)){return _0x1e5253(msgResponse('[busyFactor]',_0xa2df('0x18e'),_0xa2df('0x224')+_0x3ad360));}if(_0x1d32aa<=0x0||isNaN(_0x1d32aa)){return _0x1e5253(msgResponse('[busyFactor]',_0xa2df('0x18e'),_0xa2df('0x225')+_0x1d32aa));}if(_0x291086<=0x0||isNaN(_0x291086)){return _0x1e5253(msgResponse('[busyFactor]','Error',_0xa2df('0x22b')+_0x291086));}_0x5ae571=_0x5ae571||0x0;var _0x435413=0x1/_0x23d3af;var _0x2300f6=0x0;var _0x865810=0x0;var _0x293151=0x0;var _0x131a7e=0x0;for(var _0x25673c=0x0;_0x131a7e<_0x291086;_0x25673c+=0x1){_0x865810=_0x25673c/_0x1d32aa;_0x2300f6=(_0x3ad360*_0x865810+_0x5ae571)/_0x435413;_0x293151=utils['erlangb'](_0x2300f6,_0x410468);_0x131a7e=_0x2300f6/_0x410468*(0x1-utils['erlangb'](_0x2300f6,_0x410468));}return _0x1ae4af({'erlangCalls':_0x25673c,'erlangCallToSecond':_0x1d32aa/_0x25673c,'erlangAbandonmentRate':_0x293151,'erlangBusyFactor':_0x131a7e});});};module[_0xa2df('0x22c')]=Dialer; \ No newline at end of file +var _0x577d=['dialNoAnswerMaxRetry','reason\x203\x20ringing\x20no\x20answer','outboundBusyCallsDay','Busy','custom:agentbusy','reason\x205\x20busy','outboundCongestionCallsDay','Congestion','custom:agentcongestion','[syncAgentComplete][createHistory][8]','dialCongestionMaxRetry','reason\x208\x20congestion','Abandoned','reason\x2011\x20abandoned','AgentReject','custom:agentreject','agentreject','[syncAgentComplete][createHistory][20]','dialAgentRejectMaxRetry','reason\x2020\x20agentreject','Global','[moveContactManagedDialer][0]','contact\x20not\x20moved','round','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','floor','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','check\x20handlePredictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','dialPredictiveInterval','[startMethodPredictive][StartProgressive][Loop]','erlangCalls','dialPredictiveOptimization','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Drop\x20in\x20this\x20interval','started\x20in\x20predictive\x20at','avgHandleTime','getDataPredictive','startMethodPredictive','recalculate\x20predictive\x20at','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20more\x20than\x20threshold\x20(','predictiveIntervalAnsweredCalls','dialPredictiveOptimizationPercentage','abandonmentRate','agentBusyFactor','busyFactor','[getDataPredictive]','Unknown\x20Predictive','getDataPredictiveOld','outboundQueuePauses','predictiveIntervalPauses','[CatchErlangB]','check\x20failure','one\x20call\x20every:','milliseconds','checkContactBlack','[booked][checkContactBlack]','Queue:\x20','queuestatus','[unlockOriginate][syncQueueStatusComplete]','scheduledat','voicePause','unlockContact','outboundReCallsDay','dialRecallInQueue','QUEUE_RECALL','RecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','[Originate][HistoryRecallClose][historyCatch]','outboundBlacklistCallsDay','BLACKLIST','[Originate][MoveBlacklist]','inBlackList','limitCalls','temp','checkContactEmpty','NO_AVAILABLE_CONTACTS','[getContactCampaign2][Empty]','RUNNING','checkIsBlackListIvr','loggerHandler','[actionOriginateIvr]\x20','dialLimitQueue','not_inuse','countReScheduled','Contact','[actionOriginate]\x20','checkIsBlackList','[getContactDialer2]','tryOriginatePredictive','[handlePredictive][limitChannel]','getContactDialer','dialOrderByScheduledAt','[countReScheduled]\x20','[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]','p\x20=\x20','interval\x20=\x20','erlangb','Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[busyFactor]','m\x20=\x20','Ts\x20=\x20','Umin\x20=\x20','util','lodash','uuid','moment','ioredis','./utils','../preview/util/util','../../../config/environment/','../../../config/logger','booked','predictive','predictiveCalls','syncQueueSummary','../ami','redis','defaults','../rpc/cmHopper','../rpc/setting','../rpc/interval','./models/action','./models/history','./models/final','./models/agentComplete','./models/queueCallerAbandon','./models/hangup','env','XCALLY_IP_AGI','127.0.0.1','tail','finally','preview','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','contactsId','uniqueId','startPredictive','startProgressive','queueBookedRR','queuesSummary','syncAgentConnect','queuecallerabandon','syncQueueCallerAbandon','bind','syncOriginateResponse','syncAgentComplete','custom:queuesummary','syncQueueSummaryComplete','hangup','syncHangup','newexten','syncVarSet','queuemember','syncQueueMember','queuestatuscomplete','syncQueueStatusComplete','loopCampaigns','loopClearZombieChannels','getSettings','then','previewRecallmeReminderInterval','isUndefined','type','outbound','debug','[voiceQueueReport][queuesummary]\x20sending\x20voice_queue:save\x20event:','inspect','format','voice:queue:%s','voice_queue:save','info','-----\x20Stats\x20Predictive\x20---','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAvgTalktime','predictiveIntervalTotalCalls','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','History\x20information\x20are\x20empty','---------\x20ErlangB\x20---------','Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangCallToSecond','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangAbandonmentRate','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangBusyFactor','---------------------------','name','startProgressive\x20value\x20cleared','startPredictive\x20value\x20cleared','handlePredictive','handlePredictive\x20interval\x20cleared','error','stack','checkContactLowerLimitOriginate','contactsRescheduled','message','CAMPAIGN_STATUS','CONTACTS_RESCHEDULED','contacts','state','statedesc','endtime','starttime','[unlockQueueStatus][undefined]','queueStatusComplete','[booked][unlockQueueStatus]','stringify','pick','NULL_INTERVAL','\x20INTERVAL_IS_NULL','Interval','isEmpty','isIVRCampaignActive','INACTIVE','isIVRCampaign','campaign:ivr:%s','campaign:save','originated','sendMessageOneNotActive','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','is\x20not\x20active','DISACTIVED','is\x20disactive','[ifTime][Action]','prototype','active','SIP/%s','status','unmonitored','checkIsTrunkReachable','isTrunkReachable','Trunk','TRUNK_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','checkIfTime','ifTimeIvr','checkIfTimeIntervals','Intervals','ifTime','Failure','\x20Intervals\x20is\x20null\x20','\x20Intervals\x20is\x20empty\x20','timezones','UNKNOWN_TIMEZONE','\x20Timezone\x20unknow\x20','isArray','Action','command','iftime\x20%s,%s','interval','content','indexOf','true','catch','push','some','OVERTIME_GLOBAL_INTERVAL','OVERTIME_INTERVAL','Global:\x20','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','syncCampaigns','undefined','resolve','dialTimezone','launchHandleIvr','checkDialMethod','dialMethod','handlePower','power','dialPowerLevel','Queue','method\x20not\x20recognized','silly','Dialer::ifTime()','Dialer::ifTime()\x20errResponse\x20NOT\x20NULL:','isGlobal','AMI\x20IfTime','Error','queue','uniqueid','ivr','updateOriginated','answertime','YYYY-MM-DD\x20HH:mm:ss','outboundAnswerCallsDay','reason','agent','agiafterat','dialQueueProject2','createHistory','[syncAgentComplete][createHistory]','moveContactManagedDialer','[syncAgentComplete]','droptime','getSeconds','responsetime','dialQueueTimeout','outboundDropCallsDayTimeout','predictiveIntervalErlangCallsDroppedCalls','dropreason','TIMEOUT','countdropretry','countglobal','callAdditionalPhoneAfterMin','verifyAdditionalPhones','voiceQueue','additional','queueCallerAbandonCreateState','rescheduleContact','add','dialDropRetryFrequency','minutes','ContactId','ListId','VoiceQueueId','CampaignId','[rescheduleContact][Drop]','Drop','calleridnum','[syncAgentComplete][createHistory][10]','swapAdditionalPhones','predictiveIntervalDroppedCallsCallersExit','outboundDropCallsDayCallersExit','countabandonedretry','dialAbandonedRetryFrequency','[rescheduleContact][Abandoned]','calleridname','[syncAgentComplete][createHistory][11]','syncNewExten','actions','channel','actionid','rrmemory','roundrobin','isNil','locked','paused','stateinterface','queueBooked','merge','idHopper','strategy','[Catch][Preview][syncQueueStatusComplete]','[unlock][syncQueueStatusComplete]','length','_rr','unlockRR','Agent:\x20','contactAgent-idHopper:\x20','run','[booked][RR][finaly]','[booked][unlock]','[booked][unlock2]','[unlock2][syncQueueStatusComplete]','[booked][unlock3]','response','callProgressDetecting','[callProgressDetecting]\x20','variable','amdstatus','exten','dialAMDActive','value','HANGUP','outboundAnswerAgiCallsDay','HangupInAMD','membername','AMD','emit','buildObj','amd','saveInDb','[syncHangupInAMD][createHistory]','[syncHangupInAMD]','MACHINE','countmachineretry','custom:amd','[syncAgentComplete][createHistory][0]','countbusyretry','countcongestionretry','countnoanswerretry','dialGlobalMaxRetry','reason19\x20machine....','dialMachineMaxRetry','createStateFinal','reason\x2019\x20machine....','dialMachineRetryFrequency','[rescheduleContact][Machine]','[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]','Machine','countnosuchnumberretry','countagentrejectretry','stateGlobal','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','[syncHangupIvr]','dialQueueProject','AnswerAGI','outboundUnknownCallsDay','cause-txt','Unknow','running','statusMessage','available','talking','pTalking','ACTIVE','compareToOutboundQueue','queueSummaryCountersUpdated','updateReportFromOutboundQueue','[syncQueueSummary]','filter','dialPreviewRecallmeReminder','online','reachable','handlePreviewRecallNotifications','map','Agent','user:%s','user:dialPreviewRecallReminder','checkPreviewRecallReminder','clearZombieChannels','[uniqueid]','[actions]','sequence','enqueue','No\x20such\x20channel','[Dialer][checkChannel]','[Dialer][checkChannel][ivr]','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','emptyContact','notFound','UserId','[emptyContact][createHistory]','[emptyContact]','[syncQueueCallerAbandon]\x20[Drop]','handleIvr','actionOriginate','object','originate','voiceQueue\x20is\x20undefine','phone','contact\x20is\x20undefine','getCaller','\x22agi://%s/square,%s\x22','NONE','isOutboundQueue','\x22%s,%s%s,,,%s\x22','dialAgiAfterHangupAgent','xcally-motion-dialer','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','dialAMDGreeting','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','XMD-AMDMINWORDLENGTH','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','dialAMDMaximumWordLength','XMD-CAMPAIGNID','setXMDContactVariables','getCallerId','callerid','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','dialOriginateCallerIdNumber','TrunkBackup','XMD-ORIGINATECALLERIDNAME','originatecalleridname','extractCalleridName','XMD-ORIGINATECALLERIDNUM','dialPrefix','trim','dialCutDigit','substring','SIP/%s/%s%s','from-sip','outboundOriginateFailureCallsDay','[originateError]:\x20%s','[originate][error]','originate\x20action\x20Error','dialNoAnswerRetryFrequency','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','dialCongestionRetryFrequency','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialAbandonedMaxRetry','dialAgentRejectRetryFrequency','[rescheduleContact][AgentReject]','[callProgressDetecting]','entity\x20is\x20undefine','evt\x20is\x20undefine','outboundNoSuchCallsDay','checkRetriveMax','reason\x200\x20no\x20such\x20number....','outboundNoAnswerCallsDay','buildNoAnswerEventPayload','custom:agentnoanswer','[syncAgentComplete][createHistory][3]'];(function(_0xc0638b,_0x2fccf4){var _0xd57dfa=function(_0x322fba){while(--_0x322fba){_0xc0638b['push'](_0xc0638b['shift']());}};_0xd57dfa(++_0x2fccf4);}(_0x577d,0x77));var _0xd577=function(_0x14f786,_0x39ca08){_0x14f786=_0x14f786-0x0;var _0x323948=_0x577d[_0x14f786];return _0x323948;};'use strict';var util=require(_0xd577('0x0'));var _=require(_0xd577('0x1'));var uuid=require(_0xd577('0x2'));var moment=require(_0xd577('0x3'));var rr=require('rr');var Redis=require(_0xd577('0x4'));var utils=require(_0xd577('0x5'));var hopperUtils=require('./utils/hopper');var ut=require(_0xd577('0x6'));var config=require(_0xd577('0x7'));var logger=require(_0xd577('0x8'))('dialer');var loggerBooked=require(_0xd577('0x8'))(_0xd577('0x9'));var loggerPredictive=require(_0xd577('0x8'))(_0xd577('0xa'));var loggerPredictiveCalls=require(_0xd577('0x8'))(_0xd577('0xb'));var loggerSyncQueueSummary=require(_0xd577('0x8'))(_0xd577('0xc'));var ami=require(_0xd577('0xd'));config[_0xd577('0xe')]=_[_0xd577('0xf')](config[_0xd577('0xe')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xd577('0xe')]));var cmHopper=require(_0xd577('0x10'));var voiceQueueRt=require('../rpc/voiceQueueRt');var RpcSetting=require(_0xd577('0x11'));var Interval=require(_0xd577('0x12'));var Action=require(_0xd577('0x13'));var History=require(_0xd577('0x14'));var Final=require(_0xd577('0x15'));var AgentComplete=require(_0xd577('0x16'));var QueueCallerAbandon=require(_0xd577('0x17'));var Hangup=require(_0xd577('0x18'));var ipAgi=process[_0xd577('0x19')][_0xd577('0x1a')]||_0xd577('0x1b');var previewRecallmeReminderInterval=0x1;var Sequence=function(){};Sequence['prototype']['enqueue']=function(_0xcd9bdb){this[_0xd577('0x1c')]=this[_0xd577('0x1c')]?this['tail'][_0xd577('0x1d')](_0xcd9bdb):_0xcd9bdb();};function Dialer(_0x429fdd,_0x54b491){this['sequence']=new Sequence();this[_0xd577('0x1e')]=_0x54b491;this[_0xd577('0x1f')]=_0x429fdd[_0xd577('0x1f')];this[_0xd577('0x20')]=_0x429fdd[_0xd577('0x20')];this[_0xd577('0x21')]=_0x429fdd[_0xd577('0x21')];this['trunks']=_0x429fdd[_0xd577('0x22')];this[_0xd577('0x23')]=config[_0xd577('0x23')]||0x2;this[_0xd577('0x24')]={};this['actions']={};this[_0xd577('0x25')]={};this[_0xd577('0x26')]={};this['optionPredictive']={};this[_0xd577('0x27')]={};this[_0xd577('0x28')]={};this['ivrOriginated']={};this['queueBooked']={};this[_0xd577('0x29')]={};this[_0xd577('0x2a')]={};ami['on']('agentconnect',this[_0xd577('0x2b')]['bind'](this));ami['on'](_0xd577('0x2c'),this[_0xd577('0x2d')][_0xd577('0x2e')](this));ami['on']('originateresponse',this[_0xd577('0x2f')]['bind'](this));ami['on']('agentcomplete',this[_0xd577('0x30')]['bind'](this));ami['on'](_0xd577('0x31'),this[_0xd577('0xc')][_0xd577('0x2e')](this));ami['on']('custom:queuesummarycomplete',this[_0xd577('0x32')][_0xd577('0x2e')](this));ami['on'](_0xd577('0x33'),this[_0xd577('0x34')][_0xd577('0x2e')](this));ami['on'](_0xd577('0x35'),this['syncNewExten'][_0xd577('0x2e')](this));ami['on']('varset',this[_0xd577('0x36')][_0xd577('0x2e')](this));ami['on'](_0xd577('0x37'),this[_0xd577('0x38')]['bind'](this));ami['on'](_0xd577('0x39'),this[_0xd577('0x3a')][_0xd577('0x2e')](this));this[_0xd577('0x3b')]();this[_0xd577('0x3c')]();RpcSetting[_0xd577('0x3d')]()[_0xd577('0x3e')](function(_0x549402){previewRecallmeReminderInterval=_0x549402[_0xd577('0x3f')];});}function isNotNull(_0x1659f8){return _0x1659f8!==null&&!_[_0xd577('0x40')](_0x1659f8);}function msgResponse(_0x483f44,_0x38d982,_0xb07c28){return{'action':_0x483f44,'response':_0x38d982,'message':_0xb07c28,'stack':_0xb07c28};}function emit(_0x51a631,_0x1ae00f,_0x8ed0a9){io['to'](_0x51a631)['emit'](_0x1ae00f,_0x8ed0a9);}function emitOutboundVoiceQueueSummary(_0x22e6ad){if(_0x22e6ad[_0xd577('0x41')]===_0xd577('0x42')){logger[_0xd577('0x43')](_0xd577('0x44'),util[_0xd577('0x45')](_0x22e6ad,{'showHidden':![],'depth':null}));emit(util[_0xd577('0x46')](_0xd577('0x47'),_0x22e6ad['name']),_0xd577('0x48'),_0x22e6ad);}}function checkGetDataPredictive(_0x549465){if(isNotNull(_0x549465)&&!_['isEmpty'](_0x549465)){loggerPredictive[_0xd577('0x49')](_0xd577('0x4a'));loggerPredictive['info'](_0xd577('0x4b'),_0x549465['predictiveIntervalTotalCalls']);loggerPredictive[_0xd577('0x49')](_0xd577('0x4c'),_0x549465['predictiveIntervalAnsweredCalls']);loggerPredictive[_0xd577('0x49')](_0xd577('0x4d'),_0x549465[_0xd577('0x4e')]);loggerPredictive[_0xd577('0x49')]('Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x549465['predictiveIntervalDroppedCallsCallersExit']);loggerPredictive['info']('AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x549465[_0xd577('0x4f')]);loggerPredictive[_0xd577('0x49')](_0xd577('0x50'),_0x549465[_0xd577('0x51')]);loggerPredictive[_0xd577('0x49')]('---------------------------');if(_0x549465[_0xd577('0x52')]>0x0){if(!_[_0xd577('0x40')](_0x549465['predictiveIntervalAvgTalktime'])&&_0x549465[_0xd577('0x51')]>0x0){return!![];}loggerPredictive[_0xd577('0x49')](_0xd577('0x53'));if(!_[_0xd577('0x40')](_0x549465['predictiveIntervalAvgHoldtime'])&&_0x549465[_0xd577('0x4f')]>0x0){return!![];}loggerPredictive[_0xd577('0x49')](_0xd577('0x54'));}else{loggerPredictive[_0xd577('0x49')](_0xd577('0x55'));}}else{loggerPredictive[_0xd577('0x49')](_0xd577('0x56'));}return![];}function mergeDataErlangB(_0x379cf6){return function(_0x3408ec){loggerPredictive[_0xd577('0x49')](_0xd577('0x57'));loggerPredictive[_0xd577('0x49')](_0xd577('0x58'),_0x3408ec['erlangCalls']);loggerPredictive['info'](_0xd577('0x59'),_0x3408ec[_0xd577('0x5a')]);loggerPredictive[_0xd577('0x49')](_0xd577('0x5b'),_0x3408ec[_0xd577('0x5c')]);loggerPredictive[_0xd577('0x49')](_0xd577('0x5d'),_0x3408ec[_0xd577('0x5e')]);loggerPredictive['info'](_0xd577('0x5b'),_0x3408ec[_0xd577('0x5c')]);loggerPredictive['info'](_0xd577('0x5f'));_['merge'](_0x379cf6,_0x3408ec);};}function ifInterval(_0x2fb556,_0x3e82b8){if(_[_0xd577('0x40')](_0x3e82b8)){return![];}return utils['getSeconds'](undefined,_0x3e82b8)<_0x2fb556*0x3c;}function clearPredictiveAttributes(_0x1ad4a6){if(_0x1ad4a6[_0xd577('0x28')]){_0x1ad4a6[_0xd577('0x28')]=undefined;loggerPredictive['debug'](_0x1ad4a6[_0xd577('0x60')],_0xd577('0x61'));}if(_0x1ad4a6['startPredictive']){_0x1ad4a6[_0xd577('0x27')]=undefined;loggerPredictive[_0xd577('0x43')](_0x1ad4a6[_0xd577('0x60')],_0xd577('0x62'));}if(_0x1ad4a6[_0xd577('0x63')]){clearInterval(_0x1ad4a6[_0xd577('0x63')]);_0x1ad4a6[_0xd577('0x63')]=undefined;loggerPredictive['debug'](_0x1ad4a6[_0xd577('0x60')],_0xd577('0x64'));}}function loggerCatchPredictive(_0x601a03,_0x4ecafe){return function(_0xeedfc3){loggerPredictive['error'](_0x4ecafe[_0xd577('0x60')],_0x601a03);loggerPredictive[_0xd577('0x65')](_0xeedfc3[_0xd577('0x66')]);clearPredictiveAttributes(_0x4ecafe);};}function loggerCatch(_0x47b20c){return function(_0x5772f1){logger[_0xd577('0x65')](_0x47b20c,util[_0xd577('0x45')](_0x5772f1,{'showHidden':![],'depth':null}));};}function loggerGetContactDialer(_0x400fc8,_0x1e527c,_0x52fb7a){return function(_0x220bb7){utils[_0xd577('0x67')](_0x1e527c,_0x52fb7a,0x0);_0x1e527c['temp']=0x0;logger[_0xd577('0x65')](_0x400fc8,util['inspect'](_0x220bb7,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x2a22e0){return function(_0x4021d3){if(isNotNull(_0x4021d3)&&isNotNull(_0x4021d3[0x0])){if(_0x4021d3[0x0][_0xd577('0x68')]>0x0){_0x2a22e0[_0xd577('0x69')]=utils[_0xd577('0x6a')][_0xd577('0x6b')];logger['info']('[getContactDialer2][ReScheduled]'+_0x2a22e0[_0xd577('0x60')],_0x4021d3[0x0][_0xd577('0x68')],_0xd577('0x6c'));}else{_0x2a22e0[_0xd577('0x69')]=utils[_0xd577('0x6a')]['NO_AVAILABLE_CONTACTS'];logger[_0xd577('0x49')]('[getContactDialer2][Empty]'+_0x2a22e0[_0xd577('0x60')]);}}};}function createObjHistory(_0x583661,_0x5da6ef,_0x33716e,_0x3f40fc,_0x59a00f){_0x583661[_0xd577('0x69')]=_0x33716e;var _0x1d14b0=new Action(_0x583661,_0x5da6ef);var _0x2e8896=new History(_0x1d14b0);_0x2e8896[_0xd577('0x6d')]=_0x3f40fc;_0x2e8896[_0xd577('0x6e')]=_0x59a00f;_0x2e8896[_0xd577('0x6f')]=_0x1d14b0[_0xd577('0x70')];return _0x2e8896;}function unlockQueueStatus(_0xfcbb7c,_0x17ceba){setTimeout(function(){if(_[_0xd577('0x40')](_0xfcbb7c['queueStatusComplete'])){loggerBooked[_0xd577('0x65')](_0xd577('0x71'),_0x17ceba);}_0xfcbb7c[_0xd577('0x72')]=!![];loggerBooked['info'](_0xd577('0x73'),_0x17ceba,JSON[_0xd577('0x74')](_[_0xd577('0x75')](_0xfcbb7c,[_0xd577('0x60'),_0xd577('0x72')])));},0x1f3);}function checkInterval(_0x106939){return function(){if(!isNotNull(_0x106939['Interval'])){_0x106939[_0xd577('0x69')]=utils[_0xd577('0x6a')][_0xd577('0x76')];throw _0x106939[_0xd577('0x60')]+_0xd577('0x77');}if(!isNotNull(_0x106939[_0xd577('0x78')]['Intervals'])){_0x106939[_0xd577('0x69')]=utils[_0xd577('0x6a')]['NULL_INTERVAL'];throw _0x106939['name']+_0xd577('0x77');}if(!isNotNull(_[_0xd577('0x79')](_0x106939[_0xd577('0x78')]['Intervals']))){_0x106939[_0xd577('0x69')]=utils[_0xd577('0x6a')][_0xd577('0x76')];throw _0x106939[_0xd577('0x60')]+_0xd577('0x77');}};}function checkIsIVRCampaignActive(_0x1c6aab){return function(){if(!utils[_0xd577('0x7a')](_0x1c6aab)){_0x1c6aab[_0xd577('0x69')]=utils['CAMPAIGN_STATUS'][_0xd577('0x7b')];throw _0x1c6aab[_0xd577('0x60')]+'\x20NOT\x20Active';}};}function emitCampaignSummary(_0x4f447f){if(utils[_0xd577('0x7c')](_0x4f447f)){emit(util[_0xd577('0x46')](_0xd577('0x7d'),_0x4f447f[_0xd577('0x60')]),_0xd577('0x7e'),_0x4f447f);}}function loggerCatchQueueSummary(_0x2a8365,_0x300e12){return function(_0x572c4b){clearPredictiveAttributes(_0x300e12);emitCampaignSummary(_0x300e12);loggerSyncQueueSummary['debug'](_0x2a8365,util[_0xd577('0x45')](_0x572c4b,{'showHidden':![],'depth':null}));};}function notSendMessagesCampaign(_0x196207){if(_0x196207['sendMessageOneNotActive']){if(_0x196207[_0xd577('0x7f')]===0x0){_0x196207[_0xd577('0x80')]=![];_0x196207['message']=utils[_0xd577('0x6a')]['INACTIVE'];loggerSyncQueueSummary[_0xd577('0x43')](_0xd577('0x81'),_0x196207[_0xd577('0x60')],_0xd577('0x82'));}else{_0x196207['message']=utils[_0xd577('0x6a')][_0xd577('0x83')];loggerSyncQueueSummary[_0xd577('0x43')](_0xd577('0x81'),_0x196207['name'],_0xd577('0x84'));}emitCampaignSummary(_0x196207);}}function myreject(_0x1ee664){return function(_0x136ff5){return _0x1ee664(msgResponse(_0xd577('0x85'),'Error',JSON[_0xd577('0x74')](_0x136ff5)));};}Dialer[_0xd577('0x86')]['isTrunkReachable']=function(_0x314aed){return!_[_0xd577('0x40')](_0x314aed)&&_0x314aed&&!_[_0xd577('0x40')](_0x314aed[_0xd577('0x60')])&&!_[_0xd577('0x40')](_0x314aed[_0xd577('0x87')])&&_0x314aed['active']&&(this['trunks'][util['format'](_0xd577('0x88'),_0x314aed[_0xd577('0x60')])][_0xd577('0x89')]==='reachable'||this['trunks'][util[_0xd577('0x46')](_0xd577('0x88'),_0x314aed[_0xd577('0x60')])]['status']===_0xd577('0x8a'));};Dialer[_0xd577('0x86')][_0xd577('0x8b')]=function(_0x23a571){var _0x3e24cc=this;return function(){if(!_0x3e24cc[_0xd577('0x8c')](_0x23a571[_0xd577('0x8d')])){if(!_0x3e24cc[_0xd577('0x8c')](_0x23a571['TrunkBackup'])){_0x23a571['message']=utils[_0xd577('0x6a')][_0xd577('0x8e')];throw _0x23a571[_0xd577('0x60')]+_0xd577('0x8f');}}};};Dialer['prototype'][_0xd577('0x90')]=function(_0x2e3e83,_0x3679ca,_0x25e9d3,_0x3e7594){var _0x48d340=this;return function(){var _0xa853cc=!![];return _0x48d340[_0xd577('0x91')](_0x2e3e83,_0x3679ca,_0x25e9d3,_0x3e7594,_0xa853cc);};};Dialer[_0xd577('0x86')][_0xd577('0x92')]=function(_0x185c38,_0x45a403,_0x13230b,_0x240425){var _0x3ebeb9=this;return function(){var _0x207a47=![];return _0x3ebeb9['ifTimeIvr'](_0x185c38[_0xd577('0x93')],_0x45a403,_0x13230b,_0x240425,_0x207a47);};};Dialer[_0xd577('0x86')][_0xd577('0x91')]=function(_0x335ff4,_0x5d1d9,_0x3f8f57,_0x3e6588,_0x1ce571){var _0x3a51af=[];return new Promise(function(_0x8c1e8a,_0x1eb0c1){if(!isNotNull(_0x335ff4)){_0x3e6588[_0xd577('0x69')]=utils[_0xd577('0x6a')]['NULL_INTERVAL'];return _0x1eb0c1(msgResponse(_0xd577('0x94'),_0xd577('0x95'),_0x3f8f57+_0xd577('0x96')));}if(_[_0xd577('0x79')](_0x335ff4)){_0x3e6588[_0xd577('0x69')]=utils[_0xd577('0x6a')]['EMPTY_INTERVAL'];return _0x1eb0c1(msgResponse(_0xd577('0x94'),'Failure',_0x3f8f57+_0xd577('0x97')));}if(_0x5d1d9&&_[_0xd577('0x40')](config[_0xd577('0x98')][_0x5d1d9])){_0x3e6588[_0xd577('0x69')]=utils['CAMPAIGN_STATUS'][_0xd577('0x99')];return _0x1eb0c1(msgResponse(_0xd577('0x94'),_0xd577('0x95'),_0x3f8f57+_0xd577('0x9a')+_0x5d1d9));}if(_[_0xd577('0x9b')](_0x335ff4)){for(var _0x289a89=0x0;_0x289a89<_0x335ff4['length'];_0x289a89+=0x1){_0x3a51af['push'](ami[_0xd577('0x9c')]({'action':_0xd577('0x9d'),'command':util[_0xd577('0x46')](_0xd577('0x9e'),_0x335ff4[_0x289a89][_0xd577('0x9f')],!_['isUndefined'](config[_0xd577('0x98')][_0x5d1d9])?_0x5d1d9:'')})['then'](function(_0xc6d5a9){return _0xc6d5a9[_0xd577('0xa0')][_0xd577('0xa1')](_0xd577('0xa2'))>=0x0;})[_0xd577('0xa3')](myreject(_0x1eb0c1)));}}else{_0x3a51af[_0xd577('0xa4')](ami['Action']({'action':_0xd577('0x9d'),'command':util[_0xd577('0x46')](_0xd577('0x9e'),_0x335ff4,!_[_0xd577('0x40')](config[_0xd577('0x98')][_0x5d1d9])?_0x5d1d9:'')})['then'](function(_0x206e74){return _0x206e74[_0xd577('0xa0')][_0xd577('0xa1')](_0xd577('0xa2'))>=0x0;})['catch'](myreject(_0x1eb0c1)));}Promise['all'](_0x3a51af)['then'](function(_0x4a6aa8){var _0x52eea0=_[_0xd577('0xa5')](_0x4a6aa8);if(_0x52eea0){return _0x8c1e8a(_0x52eea0);}else{_0x3e6588[_0xd577('0x69')]=_0x1ce571?utils[_0xd577('0x6a')][_0xd577('0xa6')]:utils[_0xd577('0x6a')][_0xd577('0xa7')];return _0x1eb0c1(msgResponse('[ifTime][promiseAll]',_0xd577('0x95'),_0xd577('0xa8')+_0x1ce571+'\x20'+_0x3f8f57+_0xd577('0xa9')+util['inspect'](_0x335ff4,{'showHidden':![],'depth':null})+_0xd577('0xaa')+_0x5d1d9));}})[_0xd577('0xa3')](function(_0x2e5435){return _0x1eb0c1(msgResponse(_0xd577('0x94'),'Failure',JSON[_0xd577('0x74')](_0x2e5435)));});});};Dialer[_0xd577('0x86')][_0xd577('0x3b')]=function(){var _0x19b460=this;return cmHopper['resetActiveCalls']({'active':![]},{'where':{'active':!![]}})[_0xd577('0x3e')](function(){setInterval(function(){_0x19b460[_0xd577('0xab')]();},0x3e8);});};Dialer[_0xd577('0x86')]['syncCampaigns']=function(){var _0x213a90=this;var _0x13a41b;for(var _0x54cd33 in this['campaigns']){if(typeof this['campaigns'][_0x54cd33]!==_0xd577('0xac')){_0x13a41b=this[_0xd577('0x20')][_0x54cd33];if(utils[_0xd577('0x7c')](_0x13a41b)&&utils[_0xd577('0x7a')](_0x13a41b)){_0x13a41b['sendMessageOneNotActive']=!![];Promise[_0xd577('0xad')]()[_0xd577('0x3e')](checkIsIVRCampaignActive(_0x13a41b))[_0xd577('0x3e')](checkInterval(_0x13a41b))['then'](_0x213a90[_0xd577('0x8b')](_0x13a41b))[_0xd577('0x3e')](_0x213a90[_0xd577('0x90')](_0x13a41b['dialGlobalInterval'],_0x13a41b[_0xd577('0xae')],_0x13a41b[_0xd577('0x60')],_0x13a41b))[_0xd577('0x3e')](_0x213a90['checkIfTimeIntervals'](_0x13a41b['Interval'],_0x13a41b[_0xd577('0xae')],_0x13a41b[_0xd577('0x60')],_0x13a41b))[_0xd577('0x3e')](_0x213a90[_0xd577('0xaf')](_0x13a41b))['catch'](loggerCatchQueueSummary('[syncCampaigns]',_0x13a41b));}else{notSendMessagesCampaign(_0x13a41b);}}}};Dialer[_0xd577('0x86')][_0xd577('0xb0')]=function(_0x4849e9){if(_0x4849e9[_0xd577('0xb1')]!==_0xd577('0xa')){clearPredictiveAttributes(_0x4849e9);}switch(_0x4849e9[_0xd577('0xb1')]){case'progressive':this[_0xd577('0xb2')](_0x4849e9,0x1);break;case _0xd577('0xb3'):this['handlePower'](_0x4849e9,_0x4849e9[_0xd577('0xb4')]);break;case _0xd577('0xa'):this[_0xd577('0xa')](_0x4849e9);break;case'booked':this['handlePower'](_0x4849e9,0x1);break;default:logger[_0xd577('0x65')](_0xd577('0xb5'),_0x4849e9['name'],_0xd577('0xb6'));}};Dialer[_0xd577('0x86')][_0xd577('0x94')]=function(_0x228857,_0x103155){var _0x4e6e9f=_0x228857[_0xd577('0xae')];var _0x1ed216=_0x103155?_0x228857['dialGlobalInterval']:_0x228857[_0xd577('0x78')][_0xd577('0x93')];logger[_0xd577('0xb7')](_0xd577('0xb8'),_0x1ed216,_0x4e6e9f,_0x228857[_0xd577('0x60')],util[_0xd577('0x46')]('Voice\x20Queue\x20%s\x20$s',_0x228857['name'],_0x228857['id']));var _0x237ec9=null;return Interval['intervalIftime'](_0x1ed216,_0x4e6e9f)[_0xd577('0x3e')](function(_0x55f2f8){if(_0x55f2f8===!![]){return _0x55f2f8;}else{_0x228857['message']=_0x103155?utils[_0xd577('0x6a')][_0xd577('0xa6')]:utils[_0xd577('0x6a')][_0xd577('0xa7')];_0x237ec9=msgResponse('[ifTime][promiseAll]','Failure',_0xd577('0xa8')+_0x103155+'\x20'+_0x228857[_0xd577('0x60')]+_0xd577('0xa9')+util[_0xd577('0x45')](_0x1ed216,{'showHidden':![],'depth':null})+_0xd577('0xaa')+_0x4e6e9f);}if(_0x237ec9!==null){logger[_0xd577('0xb7')](_0xd577('0xb9'),_0x237ec9);_0x237ec9[_0xd577('0xba')]=_0x103155;throw _0x237ec9;}})[_0xd577('0xa3')](function(_0x2e9cd9){logger[_0xd577('0x65')](_0xd577('0xbb'),_0x2e9cd9);throw msgResponse(_0xd577('0x85'),_0xd577('0xbc'),util[_0xd577('0x45')](_0x2e9cd9,{'showHidden':![],'depth':null}));});};Dialer['prototype'][_0xd577('0x2b')]=function(_0xdc15f1){if(this['voiceQueues'][_0xdc15f1[_0xd577('0xbd')]]){if(this['uniqueId'][_0xdc15f1[_0xd577('0xbe')]]&&this['uniqueId'][_0xdc15f1['uniqueid']][_0xd577('0x41')]!==_0xd577('0xbf')){this[_0xd577('0xc0')](this[_0xd577('0x1f')][_0xdc15f1[_0xd577('0xbd')]]);this[_0xd577('0x26')][_0xdc15f1['uniqueid']][_0xd577('0xc1')]=moment()[_0xd577('0x46')](_0xd577('0xc2'));}}};Dialer[_0xd577('0x86')]['syncAgentComplete']=function(_0x54283c){var _0x1166c9=this[_0xd577('0x26')][_0x54283c['uniqueid']];if(this[_0xd577('0x1f')][_0x54283c[_0xd577('0xbd')]]){if(_0x1166c9&&_0x1166c9[_0xd577('0x41')]!==_0xd577('0xbf')){delete this[_0xd577('0x26')][_0x54283c[_0xd577('0xbe')]];this[_0xd577('0x1f')][_0x54283c[_0xd577('0xbd')]][_0xd577('0xc3')]+=0x1;var _0x41f344=new AgentComplete(_0x1166c9,_0x54283c);if(_0x54283c[_0xd577('0xc4')]===_0xd577('0xc5')){_0x41f344[_0xd577('0xc6')]=this[_0xd577('0x1f')][_0x54283c[_0xd577('0xbd')]][_0xd577('0xc7')]&&this[_0xd577('0x1f')][_0x54283c['queue']]['dialAgiAfterHangupAgent']?moment()[_0xd577('0x46')](_0xd577('0xc2')):undefined;}hopperUtils[_0xd577('0xc8')](_0x41f344)[_0xd577('0xa3')](loggerCatch(_0xd577('0xc9')));hopperUtils[_0xd577('0xca')](_0x41f344)[_0xd577('0xa3')](loggerCatch(_0xd577('0xcb')));}}};Dialer['prototype'][_0xd577('0x2d')]=function(_0x5cb1c2){var _0x418258=this[_0xd577('0x26')][_0x5cb1c2[_0xd577('0xbe')]];var _0x4aeb67=this;var _0x24df91=![];var _0xf0220;var _0x18603d;if(this[_0xd577('0x1f')][_0x5cb1c2[_0xd577('0xbd')]]){if(_0x418258&&_0x418258[_0xd577('0x41')]!==_0xd577('0xbf')){delete this[_0xd577('0x26')][_0x5cb1c2[_0xd577('0xbe')]];this[_0xd577('0xc0')](this['voiceQueues'][_0x5cb1c2[_0xd577('0xbd')]]);_0x418258[_0xd577('0xcc')]=moment()[_0xd577('0x46')](_0xd577('0xc2'));var _0x3ac7a8=new QueueCallerAbandon(_0x418258,_0x5cb1c2);if(utils[_0xd577('0xcd')](_0x418258[_0xd577('0xcc')],_0x418258[_0xd577('0xce')])>=_0x418258[_0xd577('0xcf')]){this['voiceQueues'][_0x5cb1c2[_0xd577('0xbd')]]['predictiveIntervalDroppedCallsTimeout']+=0x1;this[_0xd577('0x1f')][_0x5cb1c2['queue']][_0xd577('0xd0')]+=0x1;this[_0xd577('0x1f')][_0x5cb1c2[_0xd577('0xbd')]][_0xd577('0xd1')]+=0x1;_0x3ac7a8[_0xd577('0x6d')]=0xa;_0x3ac7a8[_0xd577('0x6e')]='Drop';_0x3ac7a8[_0xd577('0xd2')]=_0xd577('0xd3');_0x3ac7a8[_0xd577('0xc6')]=this[_0xd577('0x1f')][_0x5cb1c2[_0xd577('0xbd')]][_0xd577('0xc7')]?moment()[_0xd577('0x46')](_0xd577('0xc2')):undefined;_0x3ac7a8[_0xd577('0xd4')]+=0x1;_0x3ac7a8[_0xd577('0xd5')]+=0x1;_0xf0220=this[_0xd577('0x1f')][_0x5cb1c2[_0xd577('0xbd')]]['dialDropRetryFrequency'];_0x18603d=this[_0xd577('0x1f')][_0x5cb1c2[_0xd577('0xbd')]][_0xd577('0xd6')];hopperUtils[_0xd577('0xd7')](_0x3ac7a8,_0x3ac7a8[_0xd577('0x6d')],_0x418258[_0xd577('0xd8')])['then'](function(_0x38ad61){_0x24df91=_0x38ad61[_0xd577('0xd9')]==0x1;if(_0x3ac7a8[_0xd577('0xd4')]>=_0x4aeb67[_0xd577('0x1f')][_0x5cb1c2['queue']]['dialDropMaxRetry']){_0x4aeb67[_0xd577('0xda')](_0x3ac7a8,_0x38ad61['additional']);}else{hopperUtils[_0xd577('0xdb')]({'active':![],'countdropretry':_0x3ac7a8[_0xd577('0xd4')],'scheduledat':moment()[_0xd577('0xdc')](_0x4aeb67['voiceQueues'][_0x5cb1c2[_0xd577('0xbd')]][_0xd577('0xdd')],_0xd577('0xde'))[_0xd577('0x46')](_0xd577('0xc2')),'ContactId':_0x418258[_0xd577('0xdf')],'ListId':_0x418258[_0xd577('0xe0')],'VoiceQueueId':_0x418258[_0xd577('0xe1')]||undefined,'CampaignId':_0x418258[_0xd577('0xe2')]||undefined})[_0xd577('0xa3')](loggerCatch(_0xd577('0xe3')));var _0x45c6ca=new History(_0x3ac7a8);_0x45c6ca[_0xd577('0x6d')]=0xa;_0x45c6ca[_0xd577('0x6e')]=_0xd577('0xe4');_0x45c6ca[_0xd577('0x70')]=moment()[_0xd577('0x46')]('YYYY-MM-DD\x20HH:mm:ss');_0x45c6ca['endtime']=_0x45c6ca[_0xd577('0x70')];_0x45c6ca['calleridname']=_0x3ac7a8['calleridname'];_0x45c6ca[_0xd577('0xe5')]=_0x3ac7a8[_0xd577('0xe5')];hopperUtils[_0xd577('0xc8')](_0x45c6ca)['catch'](loggerCatch(_0xd577('0xe6')));}})['then'](function(){if(_0x24df91)hopperUtils[_0xd577('0xe7')](_0x3ac7a8,_0xf0220,_0x18603d)[_0xd577('0x3e')](function(){return 0x1;});});}else{this['voiceQueues'][_0x5cb1c2[_0xd577('0xbd')]][_0xd577('0xe8')]+=0x1;this[_0xd577('0x1f')][_0x5cb1c2[_0xd577('0xbd')]][_0xd577('0xe9')]+=0x1;_0x3ac7a8['state']=0xb;_0x3ac7a8['statedesc']='Abandoned';_0x3ac7a8['dropreason']='CALLEREXIT';_0x3ac7a8[_0xd577('0xea')]+=0x1;_0x3ac7a8['countglobal']+=0x1;_0xf0220=this['voiceQueues'][_0x5cb1c2[_0xd577('0xbd')]][_0xd577('0xeb')];_0x18603d=this[_0xd577('0x1f')][_0x5cb1c2[_0xd577('0xbd')]][_0xd577('0xd6')];hopperUtils[_0xd577('0xd7')](_0x3ac7a8,_0x3ac7a8[_0xd577('0x6d')],_0x418258[_0xd577('0xd8')])[_0xd577('0x3e')](function(_0x2653f2){if(_0x3ac7a8['countabandonedretry']>=_0x4aeb67[_0xd577('0x1f')][_0x5cb1c2[_0xd577('0xbd')]]['dialAbandonedMaxRetry']){_0x4aeb67[_0xd577('0xda')](_0x3ac7a8,_0x2653f2[_0xd577('0xd9')]);}else{hopperUtils['rescheduleContact']({'active':![],'countabandonedretry':_0x3ac7a8[_0xd577('0xea')],'scheduledat':moment()[_0xd577('0xdc')](_0x4aeb67[_0xd577('0x1f')][_0x5cb1c2[_0xd577('0xbd')]][_0xd577('0xeb')],_0xd577('0xde'))[_0xd577('0x46')](_0xd577('0xc2')),'ContactId':_0x418258[_0xd577('0xdf')],'ListId':_0x418258[_0xd577('0xe0')],'VoiceQueueId':_0x418258[_0xd577('0xe1')]||undefined,'CampaignId':_0x418258[_0xd577('0xe2')]||undefined})[_0xd577('0xa3')](loggerCatch(_0xd577('0xec')));var _0x562fbf=new History(_0x3ac7a8);_0x562fbf['state']=0xb;_0x562fbf[_0xd577('0x6e')]='Abandoned';_0x562fbf[_0xd577('0x70')]=moment()['format'](_0xd577('0xc2'));_0x562fbf['endtime']=_0x562fbf[_0xd577('0x70')];_0x562fbf[_0xd577('0xed')]=_0x3ac7a8[_0xd577('0xed')];_0x562fbf[_0xd577('0xe5')]=_0x3ac7a8[_0xd577('0xe5')];hopperUtils[_0xd577('0xc8')](_0x562fbf)[_0xd577('0xa3')](loggerCatch(_0xd577('0xee')));}})[_0xd577('0x3e')](function(){if(_0x24df91)hopperUtils[_0xd577('0xe7')](_0x3ac7a8,_0xf0220,_0x18603d)['then'](function(){return 0x1;});});}}}};Dialer[_0xd577('0x86')][_0xd577('0xef')]=function(_0x299937){if(this[_0xd577('0xf0')][_0x299937[_0xd577('0xbe')]]){this['actions'][_0x299937[_0xd577('0xbe')]][_0xd577('0xf1')]=_0x299937[_0xd577('0xf1')];}if(this[_0xd577('0x26')][_0x299937[_0xd577('0xbe')]]){this['uniqueId'][_0x299937[_0xd577('0xbe')]][_0xd577('0xf1')]=_0x299937[_0xd577('0xf1')];}};Dialer['prototype'][_0xd577('0x38')]=function(_0x5c72a0){if(!this[_0xd577('0xf0')][_0x5c72a0[_0xd577('0xf2')]]){return;}var _0x313926=this[_0xd577('0x1f')][this['actions'][_0x5c72a0[_0xd577('0xf2')]][_0xd577('0xbd')]]['strategy']||_0xd577('0xf3');if(_0x313926===_0xd577('0xf4')){if(this[_0xd577('0xf0')][_0x5c72a0[_0xd577('0xf2')]]&&_[_0xd577('0xf5')](this[_0xd577('0xf0')][_0x5c72a0['actionid']][_0xd577('0xf6')])&&_0x5c72a0[_0xd577('0x89')]==='1'&&_0x5c72a0[_0xd577('0xf7')]==='0'){if(this[_0xd577('0x21')][_0x5c72a0['stateinterface']]){if(!this['agents'][_0x5c72a0[_0xd577('0xf8')]][_0xd577('0xf6')]){this[_0xd577('0x21')][_0x5c72a0[_0xd577('0xf8')]][_0xd577('0xf6')]=!![];this[_0xd577('0xf0')][_0x5c72a0[_0xd577('0xf2')]][_0xd577('0xf6')]=!![];this['actions'][_0x5c72a0[_0xd577('0xf2')]][_0xd577('0xf8')]=_0x5c72a0[_0xd577('0xf8')];}}}}else if(_0x313926===_0xd577('0xf3')){if(this['actions'][_0x5c72a0[_0xd577('0xf2')]]){if(this['agents'][_0x5c72a0['stateinterface']]){this[_0xd577('0xf0')][_0x5c72a0['actionid']][_0xd577('0xf8')]=_0x5c72a0['stateinterface'];if(_['isNil'](this['queueBooked'][this['actions'][_0x5c72a0[_0xd577('0xf2')]][_0xd577('0xbd')]])){this[_0xd577('0xf9')][this[_0xd577('0xf0')][_0x5c72a0[_0xd577('0xf2')]][_0xd577('0xbd')]]=[];}this[_0xd577('0xf9')][this[_0xd577('0xf0')][_0x5c72a0[_0xd577('0xf2')]][_0xd577('0xbd')]][_0xd577('0xa4')](_[_0xd577('0xfa')](_[_0xd577('0x75')](this[_0xd577('0xf0')][_0x5c72a0[_0xd577('0xf2')]],[_0xd577('0xfb'),_0xd577('0xf8')]),{'status':_0x5c72a0[_0xd577('0x89')],'paused':_0x5c72a0[_0xd577('0xf7')]}));}}}};Dialer[_0xd577('0x86')][_0xd577('0x3a')]=function(_0x402571){if(!this['actions'][_0x402571[_0xd577('0xf2')]]){return;}var _0x3f6f58=this;var _0x31ebdc=this[_0xd577('0x1f')][this[_0xd577('0xf0')][_0x402571[_0xd577('0xf2')]]['queue']];var _0x273638=_0x31ebdc[_0xd577('0xfc')]||'rrmemory';if(_0x273638===_0xd577('0xf4')){if(this[_0xd577('0xf0')][_0x402571['actionid']]&&this[_0xd577('0xf0')][_0x402571['actionid']][_0xd577('0xf8')]){this[_0xd577('0x1e')]['run'](this[_0xd577('0xf0')][_0x402571['actionid']]['idHopper'],this['actions'][_0x402571[_0xd577('0xf2')]][_0xd577('0xf8')])[_0xd577('0xa3')](function(_0x354b1f){logger[_0xd577('0x65')](_0xd577('0xfd'),util[_0xd577('0x45')](_0x354b1f,{'showHidden':![],'depth':null}));})[_0xd577('0x1d')](function(){_0x3f6f58[_0xd577('0xc0')](_0x3f6f58['voiceQueues'][_0x3f6f58['actions'][_0x402571[_0xd577('0xf2')]][_0xd577('0xbd')]]);_0x3f6f58['agents'][_0x3f6f58[_0xd577('0xf0')][_0x402571[_0xd577('0xf2')]][_0xd577('0xf8')]][_0xd577('0xf6')]=![];delete _0x3f6f58['actions'][_0x402571[_0xd577('0xf2')]];unlockQueueStatus(_0x31ebdc);});}else{this[_0xd577('0xc0')](this['voiceQueues'][this[_0xd577('0xf0')][_0x402571[_0xd577('0xf2')]][_0xd577('0xbd')]]);hopperUtils[_0xd577('0xdb')]({'active':![],'ContactId':this['actions'][_0x402571[_0xd577('0xf2')]]['ContactId'],'ListId':this[_0xd577('0xf0')][_0x402571['actionid']][_0xd577('0xe0')],'VoiceQueueId':this[_0xd577('0xf0')][_0x402571[_0xd577('0xf2')]][_0xd577('0xe1')]||undefined,'CampaignId':this[_0xd577('0xf0')][_0x402571[_0xd577('0xf2')]][_0xd577('0xe2')]||undefined})[_0xd577('0xa3')](loggerCatch(_0xd577('0xfe')));delete this['actions'][_0x402571['actionid']];unlockQueueStatus(_0x31ebdc);}}else if(_0x273638==='rrmemory'){var _0x2ae0bc;if(this[_0xd577('0xf0')][_0x402571[_0xd577('0xf2')]]&&!_[_0xd577('0x79')](this[_0xd577('0xf9')][this[_0xd577('0xf0')][_0x402571['actionid']][_0xd577('0xbd')]])){if(this[_0xd577('0x29')][_0x3f6f58[_0xd577('0xf0')][_0x402571['actionid']][_0xd577('0xbd')]]){this[_0xd577('0x29')][_0x3f6f58[_0xd577('0xf0')][_0x402571[_0xd577('0xf2')]][_0xd577('0xbd')]]=this[_0xd577('0x29')][this[_0xd577('0xf0')][_0x402571[_0xd577('0xf2')]][_0xd577('0xbd')]]?this['queueBookedRR'][this[_0xd577('0xf0')][_0x402571[_0xd577('0xf2')]][_0xd577('0xbd')]]:this[_0xd577('0xf9')][this[_0xd577('0xf0')][_0x402571['actionid']][_0xd577('0xbd')]]?this[_0xd577('0xf9')][this[_0xd577('0xf0')][_0x402571[_0xd577('0xf2')]][_0xd577('0xbd')]]['_rr']||0x0:0x0;}this[_0xd577('0xf9')][this[_0xd577('0xf0')][_0x402571[_0xd577('0xf2')]]['queue']]['_rr']=this[_0xd577('0x29')][this['actions'][_0x402571[_0xd577('0xf2')]][_0xd577('0xbd')]];for(var _0x55d121=0x0;_0x55d121=_0x4c25c3[_0xd577('0x124')]){_0x4a4e89['stateGlobal'](_0x38c0dc,_0x30f52c,_0x4095dd,_0xd577('0x125'));}else{if(_0x38c0dc[_0xd577('0x11e')]>=_0x4c25c3[_0xd577('0x126')]){_0x4a4e89[_0xd577('0x127')](_0x38c0dc,_0x30f52c,_0x4095dd,_0xd577('0x128'));}else{hopperUtils['rescheduleContact']({'active':![],'countmachineretry':_0x38c0dc[_0xd577('0x11e')],'scheduledat':moment()[_0xd577('0xdc')](_0x4c25c3[_0xd577('0x129')],_0xd577('0xde'))[_0xd577('0x46')](_0xd577('0xc2')),'ContactId':_0x38c0dc[_0xd577('0xdf')],'ListId':_0x38c0dc[_0xd577('0xe0')],'VoiceQueueId':_0x38c0dc[_0xd577('0xe1')]||undefined,'CampaignId':_0x38c0dc[_0xd577('0xe2')]||undefined})[_0xd577('0xa3')](loggerCatch(_0xd577('0x12a')));_0x30f52c({'reschedule':0x1});}}});}if(_0x24af70[_0xd577('0x41')]==='ivr'&&this['campaigns'][_0x24af70['queue']]['dialAMDActive']&&_0x1c7bae[_0xd577('0x111')]===_0xd577('0x112')){delete this[_0xd577('0x26')][_0x1c7bae['uniqueid']];this[_0xd577('0xc0')](this[_0xd577('0x20')][_0x24af70[_0xd577('0xbd')]]);_0x549a90=new Hangup(_0x24af70,_0x1c7bae);_0x549a90[_0xd577('0x6d')]=0x12;_0x549a90[_0xd577('0x6e')]=_0xd577('0x114');_0x549a90[_0xd577('0x115')]=_0xd577('0x116');ami[_0xd577('0x117')](_0xd577('0x11f'),ut[_0xd577('0x118')](_0x549a90,'amd'));this['saveInDb'](_0x549a90,_0xd577('0x12b'),_0xd577('0x12c'));}if(_0x24af70[_0xd577('0x41')]===_0xd577('0xbf')&&this['campaigns'][_0x24af70['queue']]['dialAMDActive']&&_0x1c7bae[_0xd577('0x111')]===_0xd577('0x11d')){return new Promise(function(_0x5d947e,_0x518f63){delete _0x4a4e89[_0xd577('0x26')][_0x1c7bae['uniqueid']];_0x4a4e89['updateOriginated'](_0x4a4e89['campaigns'][_0x24af70['queue']]);_0x4a4e89['campaigns'][_0x24af70['queue']][_0xd577('0xc3')]+=0x1;_0x4a4e89[_0xd577('0x20')][_0x24af70[_0xd577('0xbd')]]['outboundAnswerAgiCallsDay']+=0x1;var _0x7d3e11=_0x4a4e89[_0xd577('0x20')][_0x24af70['queue']];var _0x39270a=new Hangup(_0x24af70,_0x1c7bae);_0x39270a[_0xd577('0x6d')]=0x13;_0x39270a[_0xd577('0x6e')]=_0xd577('0x12d');_0x39270a[_0xd577('0x115')]=_0xd577('0x116');_0x39270a['countmachineretry']+=0x1;_0x39270a[_0xd577('0xd5')]+=0x1;_0x39270a[_0xd577('0x119')]=!![];ami[_0xd577('0x117')](_0xd577('0x11f'),ut['buildObj'](_0x39270a,'amd'));hopperUtils[_0xd577('0xc8')](_0x39270a)[_0xd577('0xa3')](loggerCatch(_0xd577('0x120')));if(_0x39270a['countbusyretry']+_0x39270a[_0xd577('0x122')]+_0x39270a[_0xd577('0x123')]+_0x39270a[_0xd577('0x12e')]+_0x39270a[_0xd577('0xd4')]+_0x39270a[_0xd577('0xea')]+_0x39270a['countmachineretry']+_0x39270a[_0xd577('0x12f')]>=_0x7d3e11[_0xd577('0x124')]){_0x4a4e89[_0xd577('0x130')](_0x39270a,_0x5d947e,_0x518f63,_0xd577('0x125'));}else{if(_0x39270a[_0xd577('0x11e')]>=_0x7d3e11[_0xd577('0x126')]){_0x4a4e89[_0xd577('0x127')](_0x39270a,_0x5d947e,_0x518f63,_0xd577('0x128'));}else{hopperUtils['rescheduleContact']({'active':![],'countmachineretry':_0x39270a['countmachineretry'],'scheduledat':moment()[_0xd577('0xdc')](_0x7d3e11['dialMachineRetryFrequency'],'minutes')['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x39270a[_0xd577('0xdf')],'ListId':_0x39270a['ListId'],'VoiceQueueId':_0x39270a[_0xd577('0xe1')]||undefined,'CampaignId':_0x39270a[_0xd577('0xe2')]||undefined})[_0xd577('0xa3')](loggerCatch('[rescheduleContact][Machine]'));_0x5d947e({'reschedule':0x1});}}});}}};Dialer[_0xd577('0x86')][_0xd577('0x34')]=function(_0x2b84a7){var _0x33e0d2=this[_0xd577('0x26')][_0x2b84a7[_0xd577('0xbe')]];var _0xf4ae93;if(_0x33e0d2&&_0x33e0d2[_0xd577('0x41')]===_0xd577('0xbf')){delete this['uniqueId'][_0x2b84a7[_0xd577('0xbe')]];this[_0xd577('0xc0')](this[_0xd577('0x20')][_0x33e0d2[_0xd577('0xbd')]]);this['campaigns'][_0x33e0d2[_0xd577('0xbd')]][_0xd577('0x131')]+=0x1;_0xf4ae93=new Hangup(_0x33e0d2,_0x2b84a7);hopperUtils[_0xd577('0xc8')](_0xf4ae93)[_0xd577('0xa3')](loggerCatch(_0xd577('0x132')));hopperUtils[_0xd577('0xca')](_0xf4ae93)[_0xd577('0xa3')](loggerCatch(_0xd577('0x133')));}if(_0x33e0d2&&_0x33e0d2[_0xd577('0x41')]!==_0xd577('0xbf')&&isNotNull(this['voiceQueues'][_0x33e0d2[_0xd577('0xbd')]][_0xd577('0x134')])){delete this[_0xd577('0x26')][_0x2b84a7[_0xd577('0xbe')]];this[_0xd577('0xc0')](this[_0xd577('0x1f')][_0x33e0d2[_0xd577('0xbd')]]);this[_0xd577('0x1f')][_0x33e0d2[_0xd577('0xbd')]][_0xd577('0xc3')]+=0x1;this[_0xd577('0x1f')][_0x33e0d2[_0xd577('0xbd')]][_0xd577('0x113')]+=0x1;_0xf4ae93=new Hangup(_0x33e0d2,_0x2b84a7);_0xf4ae93[_0xd577('0x6d')]=0x10;_0xf4ae93[_0xd577('0x6e')]=_0xd577('0x135');_0xf4ae93[_0xd577('0x115')]='AGI';hopperUtils[_0xd577('0xc8')](_0xf4ae93)[_0xd577('0xa3')](loggerCatch('[syncHangupIvr][createHistory]'));hopperUtils[_0xd577('0xca')](_0xf4ae93)[_0xd577('0xa3')](loggerCatch(_0xd577('0x133')));}if(_0x33e0d2&&_0x33e0d2[_0xd577('0x41')]!==_0xd577('0xbf')&&!isNotNull(this[_0xd577('0x1f')][_0x33e0d2[_0xd577('0xbd')]]['dialQueueProject'])){delete this[_0xd577('0x26')][_0x2b84a7[_0xd577('0xbe')]];this['updateOriginated'](this[_0xd577('0x1f')][_0x33e0d2['queue']]);this['voiceQueues'][_0x33e0d2[_0xd577('0xbd')]][_0xd577('0x136')]+=0x1;_0xf4ae93=new Hangup(_0x33e0d2,_0x2b84a7);_0xf4ae93[_0xd577('0x6d')]=0xc;_0xf4ae93['statedesc']=_0x2b84a7[_0xd577('0x137')];_0xf4ae93[_0xd577('0x115')]=_0xd577('0x138');hopperUtils[_0xd577('0xc8')](_0xf4ae93)[_0xd577('0xa3')](loggerCatch(_0xd577('0x132')));hopperUtils[_0xd577('0xca')](_0xf4ae93)[_0xd577('0xa3')](loggerCatch(_0xd577('0x133')));}};Dialer['prototype']['syncQueueSummary']=function(_0x3c11d8){var _0x17615c=this;if(!_0x17615c[_0xd577('0x2a')][_0x3c11d8[_0xd577('0x60')]]){_0x17615c[_0xd577('0x2a')][_0x3c11d8[_0xd577('0x60')]]={'running':![]};}else if(_0x17615c[_0xd577('0x2a')][_0x3c11d8[_0xd577('0x60')]][_0xd577('0x139')]===!![]){return;}else if(_0x17615c[_0xd577('0x2a')][_0x3c11d8['name']][_0xd577('0x139')]===![]){_0x17615c[_0xd577('0x2a')][_0x3c11d8['name']][_0xd577('0x139')]=!![];}var _0x1881cd=_0x17615c[_0xd577('0x1f')][_0x3c11d8[_0xd577('0x60')]];var _0x448164=_0x1881cd['message']!==utils[_0xd577('0x6a')][_0xd577('0x7b')];var _0x3e3fae=utils['isPreviewCampaign'](_0x1881cd);_0x1881cd[_0xd577('0x13a')]=utils['getQueueCampaignStatusMessage'](_0x1881cd,_0x17615c[_0xd577('0x22')]);Promise[_0xd577('0xad')]()[_0xd577('0x3e')](function(){if(_0x1881cd[_0xd577('0x13a')]===utils[_0xd577('0x6a')][_0xd577('0x7b')]){if(_0x448164){clearPredictiveAttributes(_0x1881cd);_0x3c11d8[_0xd577('0x27')]=undefined;_0x3c11d8['startProgressive']=undefined;}if(_0x1881cd[_0xd577('0x13a')]===utils[_0xd577('0x6a')][_0xd577('0x7b')]){_0x3c11d8[_0xd577('0x13b')]=0x0;_0x3c11d8[_0xd577('0xf7')]=0x0;_0x3c11d8['inUse']=0x0;_0x3c11d8[_0xd577('0x13c')]=0x0;_0x3c11d8[_0xd577('0x13d')]=0x0;}}else if(_0x1881cd[_0xd577('0x13a')]===utils['CAMPAIGN_STATUS'][_0xd577('0x13e')]&&!_0x3e3fae){return _0x17615c['ifTime'](_0x1881cd,!![])[_0xd577('0x3e')](function(){return _0x17615c['ifTime'](_0x1881cd,![]);})['then'](function(){return _0x17615c[_0xd577('0xb0')](_0x1881cd);})[_0xd577('0xa3')](function(_0x484417){loggerSyncQueueSummary[_0xd577('0x43')]('[syncQueueSummary]',util[_0xd577('0x45')](_0x484417,{'showHidden':![],'depth':null}));clearPredictiveAttributes(_0x1881cd);});}else{clearPredictiveAttributes(_0x1881cd);}})[_0xd577('0x3e')](function(){var _0x20d849=_0x3c11d8[_0xd577('0x13f')](_0x1881cd);if(_0x20d849||_0x1881cd['queueSummaryCountersUpdated']){_0x1881cd[_0xd577('0x140')]=![];_0x3c11d8[_0xd577('0x141')](_0x1881cd);Object['assign'](_0x1881cd,_0x3c11d8);emitOutboundVoiceQueueSummary(_0x3c11d8);}_0x17615c[_0xd577('0x2a')][_0x1881cd[_0xd577('0x60')]][_0xd577('0x139')]=![];})[_0xd577('0xa3')](function(_0x35244c){logger[_0xd577('0x65')](_0xd577('0x142'),util[_0xd577('0x45')](_0x35244c,{'showHidden':![],'depth':null}));_0x17615c[_0xd577('0x2a')][_0x1881cd[_0xd577('0x60')]][_0xd577('0x139')]=![];});};Dialer[_0xd577('0x86')][_0xd577('0x32')]=_['throttle'](function(){var _0x5c8db0=_[_0xd577('0x143')](this[_0xd577('0x1f')],function(_0x13d32e){return _0x13d32e[_0xd577('0x144')];});var _0x13e99c=_[_0xd577('0x143')](this['agents'],function(_0x38deb1){return _0x38deb1[_0xd577('0x145')]&&_0x38deb1[_0xd577('0x89')]===_0xd577('0x146');});if(_0x5c8db0[_0xd577('0xff')]>0x0&&_0x13e99c[_0xd577('0xff')]>0x0){return Promise[_0xd577('0xad')]()['then'](cmHopper[_0xd577('0x147')](_[_0xd577('0x148')](_0x5c8db0,'id'),previewRecallmeReminderInterval,_[_0xd577('0x148')](_0x13e99c,'id')))['then'](function(_0x371013){for(var _0x4ccbb9=0x0;_0x4ccbb9<_0x371013[_0xd577('0xff')];_0x4ccbb9++){var _0x1728c4=_0x371013[_0x4ccbb9][_0xd577('0x149')][_0xd577('0x60')];if(_0x1728c4)io['to'](util[_0xd577('0x46')](_0xd577('0x14a'),_0x1728c4))[_0xd577('0x117')](_0xd577('0x14b'),{'hopper':_0x371013[_0x4ccbb9]});}})['catch'](function(_0x352034){logger[_0xd577('0x65')](_0xd577('0x14c'),_0x352034);});}},0x3c*0x3e8,{'leading':!![]});Dialer[_0xd577('0x86')][_0xd577('0x3c')]=function(){var _0x4f6a96=this;setInterval(function(){_0x4f6a96[_0xd577('0x14d')](_0x4f6a96['uniqueId'],_0xd577('0x14e'));_0x4f6a96['clearZombieChannels'](_0x4f6a96[_0xd577('0xf0')],_0xd577('0x14f'));},0x32c8);};Dialer[_0xd577('0x86')][_0xd577('0x14d')]=function(_0x444707,_0x81d6b5){var _0x218c76=this;for(var _0x2939b4 in _0x444707){if(typeof _0x444707[_0x2939b4]!=='undefined'){this[_0xd577('0x150')][_0xd577('0x151')](function(){if(!_[_0xd577('0xf5')](_0x444707[_0x2939b4])){return ami[_0xd577('0x9c')]({'action':_0xd577('0x89'),'channel':_0x444707[_0x2939b4]['channel']})[_0xd577('0xa3')](function(_0x4ac411){if(_0x4ac411['message']===_0xd577('0x152')){setTimeout(function(){if(_0x444707[_0x2939b4]&&_0x444707[_0x2939b4]['type']!==_0xd577('0xbf')){_0x218c76[_0xd577('0xc0')](_0x218c76['voiceQueues'][_0x444707[_0x2939b4][_0xd577('0xbd')]]);logger[_0xd577('0x65')](_0xd577('0x153'),_0x81d6b5,_0x2939b4,_0x444707[_0x2939b4][_0xd577('0xbd')]);delete _0x444707[_0x2939b4];}if(_0x444707[_0x2939b4]&&_0x444707[_0x2939b4]['type']===_0xd577('0xbf')){_0x218c76[_0xd577('0xc0')](_0x218c76[_0xd577('0x20')][_0x444707[_0x2939b4][_0xd577('0xbd')]]);logger['error'](_0xd577('0x154'),_0x81d6b5,_0x2939b4,_0x444707[_0x2939b4][_0xd577('0xbd')]);delete _0x444707[_0x2939b4];}},0x2328);}});}});}}};Dialer[_0xd577('0x86')][_0xd577('0x155')]=function(_0x559772){return Promise[_0xd577('0xad')]()[_0xd577('0x3e')](voiceQueueRt[_0xd577('0x155')](_0x559772))[_0xd577('0xa3')](loggerCatch(_0xd577('0x156')));};Dialer['prototype'][_0xd577('0xc0')]=function(_0x55d73c){if(!_[_0xd577('0x40')](_0x55d73c)&&_0x55d73c!==null){if(typeof _0x55d73c['originated']!==_0xd577('0xac')){if(_0x55d73c['originated']>0x0){_0x55d73c[_0xd577('0x7f')]-=0x1;}else{logger[_0xd577('0x65')](_0xd577('0x157'));}}}else{logger[_0xd577('0x65')](_0xd577('0x158'));}};Dialer['prototype']['loggerHandler']=function(_0xc888ea,_0x2a2857){var _0x2be8cf=this;return function(_0x20ac52){_0x2be8cf[_0xd577('0xc0')](_0x2a2857);logger[_0xd577('0x65')](_0xc888ea,util['inspect'](_0x20ac52,{'showHidden':![],'depth':null}));};};Dialer[_0xd577('0x86')][_0xd577('0x159')]=function(_0x4cef67,_0x4217ef,_0x2476d2){var _0xb2f76d={'state':0x19,'statedesc':_0xd577('0x15a')};this['updateOriginated'](_0x4217ef);this['saveInDb'](_[_0xd577('0xfa')](_0xb2f76d,_[_0xd577('0x75')](_0x2476d2,['ContactId',_0xd577('0xe0'),_0xd577('0x15b'),_0xd577('0xe1'),'CampaignId'])),_0xd577('0x15c'),_0xd577('0x15d'));logger[_0xd577('0x65')](_0x4cef67);};Dialer[_0xd577('0x86')][_0xd577('0x11a')]=function(_0x1576a5,_0x4f980b,_0x2062fd){hopperUtils['createHistory'](_0x1576a5)[_0xd577('0xa3')](loggerCatch(_0x4f980b));hopperUtils[_0xd577('0xca')](_0x1576a5)[_0xd577('0xa3')](loggerCatch(_0x2062fd));};Dialer[_0xd577('0x86')][_0xd577('0xda')]=function(_0x10efa4,_0x45e1df){hopperUtils[_0xd577('0xc8')](_0x10efa4)['catch'](loggerCatch(_0xd577('0xc9')));if(_0x45e1df==0x0){hopperUtils[_0xd577('0xca')](_0x10efa4)[_0xd577('0xa3')](loggerCatch(_0xd577('0x15e')));}};Dialer[_0xd577('0x86')][_0xd577('0x14c')]=function(_0x3df62a){return Promise['resolve']()['then'](cmHopper['handlePreviewRecallNotifications'](_0x3df62a['id'],previewRecallmeReminderInterval))['then'](function(_0xf74a0a){for(var _0x1ae3ef=0x0;_0x1ae3ef<_0xf74a0a[_0xd577('0xff')];_0x1ae3ef++){var _0x14fe93=_0xf74a0a[_0x1ae3ef][_0xd577('0x149')][_0xd577('0x60')];if(_0x14fe93)io['to'](util['format'](_0xd577('0x14a'),_0x14fe93))['emit']('user:dialPreviewRecallReminder',{'hopper':_0xf74a0a[_0x1ae3ef]});}})['catch'](function(){});};Dialer[_0xd577('0x86')][_0xd577('0xaf')]=function(_0x4f339a){var _0x252c71=this;return function(){_0x252c71[_0xd577('0x15f')](_0x4f339a);};};Dialer['prototype'][_0xd577('0x160')]=function(_0x28114f,_0x4ca041){var _0x38c5ec=this;var _0xf1b57c=uuid['v4']();this['actions'][_0xf1b57c]=new Action(_0x28114f,_0x4ca041,_0xf1b57c);return new Promise(function(_0x40b687,_0x28aa57){if(_[_0xd577('0x40')](_0x28114f)&&typeof _0x28114f!==_0xd577('0x161')){return _0x28aa57(msgResponse(_0xd577('0x162'),'Failure',_0xd577('0x163')));}if(_[_0xd577('0x40')](_0x4ca041[_0xd577('0x164')])||_0x4ca041[_0xd577('0x164')]===null){return _0x28aa57(msgResponse(_0xd577('0x162'),_0xd577('0x95'),_0xd577('0x165')));}var _0x34a773={'XMD-CALLERID':_0x38c5ec[_0xd577('0xf0')][_0xf1b57c][_0xd577('0x166')](),'XMD-AGI':_0x28114f['dialQueueProject']?util[_0xd577('0x46')](_0xd577('0x167'),ipAgi,_0x28114f[_0xd577('0x134')]):_0xd577('0x168'),'XMD-AGIAFTER':_0x28114f[_0xd577('0xc7')]?util['format'](_0xd577('0x167'),ipAgi,_0x28114f[_0xd577('0xc7')]):_0xd577('0x168'),'XMD-QUEUE':utils[_0xd577('0x169')](_0x28114f)?util[_0xd577('0x46')](_0xd577('0x16a'),_0x28114f[_0xd577('0x60')],_0x28114f['dialQueueOptions']||'',_0x28114f[_0xd577('0x16b')]?'c':'',_0x28114f[_0xd577('0xcf')]||0x3):_0xd577('0x168'),'XMD-CONTACTID':_0x4ca041[_0xd577('0xdf')],'XMD-CDRTYPE':'dialer','CALLERID(all)':_0x38c5ec[_0xd577('0xf0')][_0xf1b57c]['getCaller'](),'XMD-AMD':_0x28114f[_0xd577('0x110')]?_0xd577('0x13e'):'NONE','XMD-DESTINATION':_0xd577('0x16c')};if(_0x28114f['dialAMDActive']){_0x34a773[_0xd577('0x16d')]=_0x28114f[_0xd577('0x16e')]||0x9c4;_0x34a773['XMD-AMDGREETING']=_0x28114f[_0xd577('0x16f')]||0x5dc;_0x34a773[_0xd577('0x170')]=_0x28114f[_0xd577('0x171')]||0x320;_0x34a773[_0xd577('0x172')]=_0x28114f['dialAMDTotalAnalysisTime']||0x1388;_0x34a773[_0xd577('0x173')]=_0x28114f[_0xd577('0x174')]||0x64;_0x34a773[_0xd577('0x175')]=_0x28114f[_0xd577('0x176')]||0x32;_0x34a773[_0xd577('0x177')]=_0x28114f[_0xd577('0x178')]||0x3;_0x34a773[_0xd577('0x179')]=_0x28114f[_0xd577('0x17a')]||0x100;_0x34a773[_0xd577('0x17b')]=_0x28114f[_0xd577('0x17c')]||0x1388;}if(utils[_0xd577('0x169')](_0x28114f)){_0x34a773['XMD-VOICEQUEUEID']=_0x4ca041[_0xd577('0xe1')];}else{_0x34a773[_0xd577('0x17d')]=_0x4ca041[_0xd577('0xe2')];}var _0x15ca89=utils[_0xd577('0x17e')](_0x4ca041['Contact']);Object['assign'](_0x34a773,_0x15ca89);var _0x47562c=_0x38c5ec[_0xd577('0x8c')](_0x28114f[_0xd577('0x8d')])?utils[_0xd577('0x17f')](_0x28114f[_0xd577('0x8d')][_0xd577('0x180')],_0x28114f[_0xd577('0x181')],_0x28114f[_0xd577('0x182')]>0x0?utils[_0xd577('0x183')](_0x28114f[_0xd577('0x184')],_0x28114f[_0xd577('0x182')]):_0x28114f[_0xd577('0x184')]):utils[_0xd577('0x17f')](_[_0xd577('0xf5')](_0x28114f[_0xd577('0x185')])?_0x28114f[_0xd577('0x8d')]['callerid']:_0x28114f[_0xd577('0x185')][_0xd577('0x180')],_0x28114f['dialOriginateCallerIdName'],_0x28114f['dialRandomLastDigitCallerIdNumber']>0x0?utils[_0xd577('0x183')](_0x28114f[_0xd577('0x184')],_0x28114f[_0xd577('0x182')]):_0x28114f[_0xd577('0x184')]);if(_0x47562c){_0x34a773[_0xd577('0x186')]=_0x38c5ec['actions'][_0xf1b57c][_0xd577('0x187')]=utils[_0xd577('0x188')](_0x47562c);_0x34a773[_0xd577('0x189')]=_0x4ca041[_0xd577('0x164')];}_0x28114f['variables']=_0x34a773;return ami[_0xd577('0x9c')]({'actionid':_0xf1b57c,'action':'originate','channel':_0x38c5ec[_0xd577('0x8c')](_0x28114f[_0xd577('0x8d')])?util[_0xd577('0x46')]('SIP/%s/%s%s',_0x28114f[_0xd577('0x8d')]['name'],isNotNull(_0x28114f['dialPrefix'])?_0x28114f[_0xd577('0x18a')][_0xd577('0x18b')]()||'':'',_0x28114f[_0xd577('0x18c')]>0x0?_0x4ca041[_0xd577('0x164')][_0xd577('0x18d')](_0x28114f[_0xd577('0x18c')]):_0x4ca041[_0xd577('0x164')]):util[_0xd577('0x46')](_0xd577('0x18e'),_['isNil'](_0x28114f[_0xd577('0x185')])?_0x28114f[_0xd577('0x8d')][_0xd577('0x60')]:_0x28114f[_0xd577('0x185')]['name'],isNotNull(_0x28114f['dialPrefix'])?_0x28114f['dialPrefix'][_0xd577('0x18b')]()||'':'',_0x28114f[_0xd577('0x18c')]>0x0?_0x4ca041[_0xd577('0x164')]['substring'](_0x28114f[_0xd577('0x18c')]):_0x4ca041[_0xd577('0x164')]),'callerid':_0x47562c,'Exten':_0xd577('0x16c'),'Context':_0xd577('0x18f'),'Priority':'1','variable':_0x34a773,'timeout':(_0x28114f['dialOriginateTimeout']||0x1e)*0x3e8,'async':!![],'channelid':_0xf1b57c})[_0xd577('0x3e')](function(_0x995c4b){return _0x40b687(_0x995c4b);})[_0xd577('0xa3')](function(_0x4a7d11){_0x28114f[_0xd577('0x190')]+=0x1;var _0x1f4f3e=new History(_0x38c5ec[_0xd577('0xf0')][_0xf1b57c]);logger[_0xd577('0x65')](util[_0xd577('0x46')](_0xd577('0x191'),JSON[_0xd577('0x74')](_0x4a7d11)));_0x1f4f3e[_0xd577('0x6d')]=0xe;_0x1f4f3e[_0xd577('0x6e')]='OriginateError';_0x1f4f3e[_0xd577('0x70')]=moment()['format'](_0xd577('0xc2'));_0x1f4f3e[_0xd577('0x6f')]=_0x1f4f3e[_0xd577('0x70')];hopperUtils[_0xd577('0xc8')](_0x1f4f3e)[_0xd577('0xa3')](loggerCatch(_0xd577('0x192')));_0x38c5ec[_0xd577('0xca')](_0x1f4f3e)[_0xd577('0xa3')](loggerCatch(_0xd577('0x192')))[_0xd577('0x1d')](function(){delete _0x38c5ec['actions'][_0xf1b57c];return _0x28aa57(msgResponse(_0xd577('0x162'),_0xd577('0xbc'),_0xd577('0x193')));});});});};Dialer[_0xd577('0x86')]['checkRetriveMax']=function(_0x2e36de,_0x276194,_0x866fc9){var _0x5eb4c3=new History(_0x276194);if(_0x5eb4c3['countbusyretry']+_0x5eb4c3['countcongestionretry']+_0x5eb4c3[_0xd577('0x123')]+_0x5eb4c3[_0xd577('0x12e')]+_0x5eb4c3[_0xd577('0xd4')]+_0x5eb4c3[_0xd577('0xea')]+_0x5eb4c3['countmachineretry']+_0x5eb4c3[_0xd577('0x12f')]>=_0x866fc9['dialGlobalMaxRetry']-0x1){return!![];}switch(_0x2e36de){case 0x3:if(_0x5eb4c3[_0xd577('0x123')]>=_0x866fc9['dialNoAnswerMaxRetry']-0x1){return!![];}hopperUtils[_0xd577('0xdb')]({'active':![],'countnoanswerretry':_0x5eb4c3['countnoanswerretry']+=0x1,'scheduledat':moment()[_0xd577('0xdc')](_0x866fc9[_0xd577('0x194')],_0xd577('0xde'))[_0xd577('0x46')](_0xd577('0xc2')),'ContactId':_0x5eb4c3[_0xd577('0xdf')],'ListId':_0x5eb4c3[_0xd577('0xe0')],'VoiceQueueId':_0x5eb4c3['VoiceQueueId']||undefined,'CampaignId':_0x5eb4c3['CampaignId']||undefined})[_0xd577('0xa3')](loggerCatch(_0xd577('0x195')));break;case 0x5:if(_0x5eb4c3[_0xd577('0x121')]>=_0x866fc9[_0xd577('0x196')]-0x1){return!![];}hopperUtils[_0xd577('0xdb')]({'active':![],'countbusyretry':_0x5eb4c3[_0xd577('0x121')]+=0x1,'scheduledat':moment()[_0xd577('0xdc')](_0x866fc9[_0xd577('0x197')],'minutes')[_0xd577('0x46')](_0xd577('0xc2')),'ContactId':_0x5eb4c3[_0xd577('0xdf')],'ListId':_0x5eb4c3[_0xd577('0xe0')],'VoiceQueueId':_0x5eb4c3['VoiceQueueId']||undefined,'CampaignId':_0x5eb4c3[_0xd577('0xe2')]||undefined})[_0xd577('0xa3')](loggerCatch(_0xd577('0x198')));break;case 0x8:if(_0x5eb4c3[_0xd577('0x122')]>=_0x866fc9['dialCongestionMaxRetry']-0x1){return!![];}hopperUtils[_0xd577('0xdb')]({'active':![],'countcongestionretry':_0x5eb4c3['countcongestionretry']+=0x1,'scheduledat':moment()[_0xd577('0xdc')](_0x866fc9[_0xd577('0x199')],_0xd577('0xde'))[_0xd577('0x46')](_0xd577('0xc2')),'ContactId':_0x5eb4c3[_0xd577('0xdf')],'ListId':_0x5eb4c3[_0xd577('0xe0')],'VoiceQueueId':_0x5eb4c3['VoiceQueueId']||undefined,'CampaignId':_0x5eb4c3['CampaignId']||undefined})['catch'](loggerCatch(_0xd577('0x19a')));break;case 0x0:if(_0x5eb4c3[_0xd577('0x12e')]>=_0x866fc9[_0xd577('0x19b')]-0x1){return!![];}else{hopperUtils[_0xd577('0xdb')]({'active':![],'countnosuchnumberretry':_0x5eb4c3[_0xd577('0x12e')]+=0x1,'scheduledat':moment()[_0xd577('0xdc')](_0x866fc9[_0xd577('0x19c')],_0xd577('0xde'))[_0xd577('0x46')](_0xd577('0xc2')),'ContactId':_0x5eb4c3[_0xd577('0xdf')],'ListId':_0x5eb4c3['ListId'],'VoiceQueueId':_0x5eb4c3['VoiceQueueId']||undefined,'CampaignId':_0x5eb4c3[_0xd577('0xe2')]||undefined})[_0xd577('0xa3')](loggerCatch('[rescheduleContact][NoSuchNumber]'));}break;case 0xa:if(_0x5eb4c3[_0xd577('0xd4')]>=_0x866fc9[_0xd577('0x19d')]-0x1){return!![];}hopperUtils[_0xd577('0xdb')]({'active':![],'countdropretry':_0x5eb4c3[_0xd577('0xd4')]+=0x1,'scheduledat':moment()[_0xd577('0xdc')](_0x866fc9[_0xd577('0xdd')],_0xd577('0xde'))['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x5eb4c3[_0xd577('0xdf')],'ListId':_0x5eb4c3['ListId'],'VoiceQueueId':_0x5eb4c3[_0xd577('0xe1')]||undefined,'CampaignId':_0x5eb4c3['CampaignId']||undefined})[_0xd577('0xa3')](loggerCatch(_0xd577('0xe3')));break;case 0xb:if(_0x5eb4c3[_0xd577('0xea')]>=_0x866fc9[_0xd577('0x19e')]-0x1){return!![];}hopperUtils[_0xd577('0xdb')]({'active':![],'countabandonedretry':_0x5eb4c3[_0xd577('0xea')]+=0x1,'scheduledat':moment()[_0xd577('0xdc')](_0x866fc9['dialAbandonedRetryFrequency'],_0xd577('0xde'))['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x5eb4c3[_0xd577('0xdf')],'ListId':_0x5eb4c3[_0xd577('0xe0')],'VoiceQueueId':_0x5eb4c3[_0xd577('0xe1')]||undefined,'CampaignId':_0x5eb4c3[_0xd577('0xe2')]||undefined})[_0xd577('0xa3')](loggerCatch(_0xd577('0xec')));break;case 0x13:if(_0x5eb4c3[_0xd577('0x11e')]>=_0x866fc9['dialMachineMaxRetry']-0x1){return!![];}hopperUtils[_0xd577('0xdb')]({'active':![],'countmachineretry':_0x5eb4c3[_0xd577('0x11e')]+=0x1,'scheduledat':moment()['add'](_0x866fc9[_0xd577('0x129')],_0xd577('0xde'))[_0xd577('0x46')](_0xd577('0xc2')),'ContactId':_0x5eb4c3['ContactId'],'ListId':_0x5eb4c3[_0xd577('0xe0')],'VoiceQueueId':_0x5eb4c3[_0xd577('0xe1')]||undefined,'CampaignId':_0x5eb4c3[_0xd577('0xe2')]||undefined})[_0xd577('0xa3')](loggerCatch('[rescheduleContact][Machine]'));break;case 0x14:if(_0x5eb4c3['countagentrejectretry']>=_0x866fc9['dialAgentRejectMaxRetry']-0x1){return!![];}hopperUtils[_0xd577('0xdb')]({'active':![],'countagentrejectretry':_0x5eb4c3[_0xd577('0x12f')]+=0x1,'scheduledat':moment()['add'](_0x866fc9[_0xd577('0x19f')],_0xd577('0xde'))[_0xd577('0x46')](_0xd577('0xc2')),'ContactId':_0x5eb4c3[_0xd577('0xdf')],'ListId':_0x5eb4c3[_0xd577('0xe0')],'VoiceQueueId':_0x5eb4c3[_0xd577('0xe1')]||undefined,'CampaignId':_0x5eb4c3['CampaignId']||undefined})[_0xd577('0xa3')](loggerCatch(_0xd577('0x1a0')));break;default:return!![];}};Dialer[_0xd577('0x86')][_0xd577('0x10b')]=function(_0x19c480,_0x242657,_0x261ea9){var _0x4b4b24=this;var _0x1d382e=new History(_0x19c480);var _0x49fd4b=![];var _0x4cff87;var _0x7d575d;return new Promise(function(_0xb37bdf,_0x11512d){if(_[_0xd577('0x40')](_0x242657)&&typeof _0x242657!=='object'){return _0x11512d(msgResponse(_0xd577('0x1a1'),_0xd577('0x95'),_0xd577('0x1a2')));}if(_[_0xd577('0x40')](_0x261ea9)&&typeof _0x261ea9!==_0xd577('0x161')){return _0x11512d(msgResponse(_0xd577('0x1a1'),_0xd577('0x95'),_0xd577('0x1a3')));}hopperUtils[_0xd577('0xd7')](_0x1d382e,_0x261ea9[_0xd577('0xc4')],_0x242657)[_0xd577('0x3e')](function(_0x4d3e6d){if(_0x4d3e6d['additional']==0x1)_0x49fd4b=!![];switch(_0x261ea9[_0xd577('0xc4')]){case'0':_0x242657[_0xd577('0x1a4')]+=0x1;_0x1d382e['state']=0x0;_0x1d382e[_0xd577('0x6e')]='NoSuchNumber';_0x1d382e['countnosuchnumberretry']+=0x1;_0x1d382e[_0xd577('0xd5')]+=0x1;ami[_0xd577('0x117')]('custom:agentnosuchnumber',ut[_0xd577('0x118')](_0x19c480,'nosuchnumber'));_0x4cff87=_0x242657[_0xd577('0x19c')];_0x7d575d=_0x242657[_0xd577('0xd6')];hopperUtils[_0xd577('0xc8')](_0x1d382e)[_0xd577('0xa3')](loggerCatch(_0xd577('0x120')));if(_0x4b4b24[_0xd577('0x1a5')](0x0,_0x19c480,_0x242657)&&!_0x49fd4b){if(_0x1d382e[_0xd577('0x12e')]>=_0x242657['dialNoSuchNumberMaxRetry']){_0x4b4b24['createStateFinal'](_0x1d382e,_0xb37bdf,_0x11512d,_0xd577('0x1a6'));}else{_0x4b4b24[_0xd577('0x130')](_0x1d382e,_0xb37bdf,_0x11512d,'reason\x200\x20no\x20such\x20number....');}}break;case'3':_0x242657[_0xd577('0x1a7')]+=0x1;_0x1d382e[_0xd577('0x6d')]=0x3;_0x1d382e[_0xd577('0x6e')]='NoAnswer';_0x1d382e['countnoanswerretry']+=0x1;_0x1d382e['countglobal']+=0x1;var _0x2a55b7=ut[_0xd577('0x1a8')](_0x19c480,_0x242657);ami['emit'](_0xd577('0x1a9'),_0x2a55b7);_0x4cff87=_0x242657[_0xd577('0x194')];_0x7d575d=_0x242657[_0xd577('0xd6')];hopperUtils[_0xd577('0xc8')](_0x1d382e)['catch'](loggerCatch(_0xd577('0x1aa')));if(_0x4b4b24[_0xd577('0x1a5')](0x3,_0x19c480,_0x242657)&&!_0x49fd4b){if(_0x1d382e[_0xd577('0x123')]>=_0x242657[_0xd577('0x1ab')]){_0x4b4b24[_0xd577('0x127')](_0x1d382e,_0xb37bdf,_0x11512d,_0xd577('0x1ac'));}else{_0x4b4b24[_0xd577('0x130')](_0x1d382e,_0xb37bdf,_0x11512d,_0xd577('0x1ac'));}}break;case'5':_0x242657[_0xd577('0x1ad')]+=0x1;_0x1d382e['state']=0x5;_0x1d382e[_0xd577('0x6e')]=_0xd577('0x1ae');_0x1d382e[_0xd577('0x121')]+=0x1;_0x1d382e[_0xd577('0xd5')]+=0x1;ami[_0xd577('0x117')](_0xd577('0x1af'),ut[_0xd577('0x118')](_0x19c480,'busy'));_0x4cff87=_0x242657['dialBusyRetryFrequency'];_0x7d575d=_0x242657[_0xd577('0xd6')];hopperUtils['createHistory'](_0x1d382e)[_0xd577('0xa3')](loggerCatch('[syncAgentComplete][createHistory][5]'));if(_0x4b4b24[_0xd577('0x1a5')](0x5,_0x19c480,_0x242657)&&!_0x49fd4b){if(_0x1d382e[_0xd577('0x121')]>=_0x242657['dialBusyMaxRetry']){_0x4b4b24['createStateFinal'](_0x1d382e,_0xb37bdf,_0x11512d,_0xd577('0x1b0'));}else{_0x4b4b24[_0xd577('0x130')](_0x1d382e,_0xb37bdf,_0x11512d,_0xd577('0x1b0'));}}break;case'8':_0x242657[_0xd577('0x1b1')]+=0x1;_0x1d382e[_0xd577('0x6d')]=0x8;_0x1d382e[_0xd577('0x6e')]=_0xd577('0x1b2');_0x1d382e[_0xd577('0x122')]+=0x1;_0x1d382e[_0xd577('0xd5')]+=0x1;_0x4cff87=_0x242657[_0xd577('0x199')];_0x7d575d=_0x242657[_0xd577('0xd6')];ami[_0xd577('0x117')](_0xd577('0x1b3'),ut[_0xd577('0x118')](_0x19c480,'congestion'));hopperUtils['createHistory'](_0x1d382e)[_0xd577('0xa3')](loggerCatch(_0xd577('0x1b4')));if(_0x4b4b24[_0xd577('0x1a5')](0x8,_0x19c480,_0x242657)&&!_0x49fd4b){if(_0x1d382e['countcongestionretry']>=_0x242657[_0xd577('0x1b5')]){_0x4b4b24[_0xd577('0x127')](_0x1d382e,_0xb37bdf,_0x11512d,_0xd577('0x1b6'));}else{_0x4b4b24[_0xd577('0x130')](_0x1d382e,_0xb37bdf,_0x11512d,_0xd577('0x1b6'));}}break;case'11':_0x242657['outboundAbandonedCallsDay']+=0x1;_0x1d382e[_0xd577('0x6d')]=0xb;_0x1d382e[_0xd577('0x6e')]=_0xd577('0x1b7');_0x1d382e['countabandonedretry']+=0x1;_0x1d382e[_0xd577('0xd5')]+=0x1;_0x4cff87=_0x242657[_0xd577('0xeb')];_0x7d575d=_0x242657[_0xd577('0xd6')];hopperUtils[_0xd577('0xc8')](_0x1d382e)[_0xd577('0xa3')](loggerCatch(_0xd577('0xee')));if(_0x4b4b24[_0xd577('0x1a5')](0xb,_0x19c480,_0x242657)&&!_0x49fd4b){if(_0x1d382e['countabandonedretry']>=_0x242657[_0xd577('0x19e')]){_0x4b4b24[_0xd577('0x127')](_0x1d382e,_0xb37bdf,_0x11512d,_0xd577('0x1b8'));}else{_0x4b4b24[_0xd577('0x130')](_0x1d382e,_0xb37bdf,_0x11512d,'reason\x2011\x20abandoned');}}break;case'20':_0x242657['outboundRejectCallsDay']+=0x1;_0x1d382e['state']=0x14;_0x1d382e['statedesc']=_0xd577('0x1b9');_0x1d382e['countagentrejectretry']+=0x1;_0x1d382e['countglobal']+=0x1;_0x4cff87=_0x242657[_0xd577('0x19f')];_0x7d575d=_0x242657[_0xd577('0xd6')];ami[_0xd577('0x117')](_0xd577('0x1ba'),ut[_0xd577('0x118')](_0x19c480,_0xd577('0x1bb')));hopperUtils['createHistory'](_0x1d382e)[_0xd577('0xa3')](loggerCatch(_0xd577('0x1bc')));if(_0x4b4b24[_0xd577('0x1a5')](0x14,_0x19c480,_0x242657)&&!_0x49fd4b){if(_0x1d382e[_0xd577('0x12f')]>=_0x242657[_0xd577('0x1bd')]){_0x4b4b24[_0xd577('0x127')](_0x1d382e,_0xb37bdf,_0x11512d,_0xd577('0x1be'));}else{_0x4b4b24['stateGlobal'](_0x1d382e,_0xb37bdf,_0x11512d,_0xd577('0x1be'));}}break;default:_0x242657[_0xd577('0x136')]+=0x1;_0x1d382e[_0xd577('0x6d')]=0xc;_0x1d382e[_0xd577('0x6e')]=_0x261ea9[_0xd577('0xc4')];_0x4cff87=_0x242657[_0xd577('0x19f')];_0x7d575d=_0x242657[_0xd577('0xd6')];hopperUtils[_0xd577('0xc8')](_0x1d382e)['catch'](loggerCatch('[syncAgentComplete][createHistory][?]'));if(_0x4b4b24[_0xd577('0x1a5')](_0x261ea9[_0xd577('0xc4')],_0x19c480,_0x242657)&&!_0x49fd4b){if(_0x1d382e[_0xd577('0x121')]+_0x1d382e[_0xd577('0x122')]+_0x1d382e[_0xd577('0x123')]+_0x1d382e[_0xd577('0x12e')]+_0x1d382e[_0xd577('0xd4')]+_0x1d382e['countabandonedretry']+_0x1d382e['countmachineretry']+_0x1d382e[_0xd577('0x12f')]>=_0x242657[_0xd577('0x124')]){_0x4b4b24[_0xd577('0x130')](_0x1d382e,_0xb37bdf,_0x11512d,_0x261ea9[_0xd577('0xc4')]);}else{_0x4b4b24[_0xd577('0x127')](_0x1d382e,_0xb37bdf,_0x11512d,_0x261ea9[_0xd577('0xc4')]);}}}})[_0xd577('0x3e')](function(){if(_0x49fd4b){hopperUtils['swapAdditionalPhones'](_0x1d382e,_0x4cff87,_0x7d575d)['then'](function(){return _0xb37bdf(0x1);});}});});};Dialer[_0xd577('0x86')][_0xd577('0x130')]=function(_0x458fbe,_0x211432,_0x274d52,_0x3e8cb4){var _0x499d88=new Final(_0x458fbe);_0x499d88[_0xd577('0x6d')]=0xf;_0x499d88[_0xd577('0x6e')]=_0xd577('0x1bf');this[_0xd577('0x127')](_0x499d88,_0x211432,_0x274d52,_0x3e8cb4);};Dialer[_0xd577('0x86')][_0xd577('0x127')]=function(_0x2ff8f7,_0x2d1219,_0x4299cb,_0x6633f8){hopperUtils['moveContactManagedDialer'](_0x2ff8f7)[_0xd577('0x3e')](function(){return _0x2d1219(msgResponse(_0xd577('0x1a1'),'Success',_0x6633f8));})[_0xd577('0xa3')](function(){return _0x4299cb(msgResponse(_0xd577('0x1c0'),_0xd577('0x95'),_0xd577('0x1c1')));});};Dialer[_0xd577('0x86')][_0xd577('0xa')]=function(_0x46f1c1){var _0x6ed11d=_0x46f1c1['dialPredictiveOptimizationPercentage']/0x64;var _0x3fa68c=_0x46f1c1[_0xd577('0xd0')]/(_0x46f1c1[_0xd577('0xd0')]+_0x46f1c1[_0xd577('0xc3')]);var _0x20eb5e=Math[_0xd577('0x1c2')](_0x46f1c1[_0xd577('0x1c3')]*(_0x46f1c1[_0xd577('0x1c4')]/0x64));var _0x93fac9=Math['round'](_0x46f1c1[_0xd577('0x1c3')]*(_0x46f1c1['predictiveIntervalMinThreshold']/0x64));var _0x3fbc70=_0x46f1c1[_0xd577('0x13b')]+_0x46f1c1[_0xd577('0x13c')];var _0x10f6b1=Math[_0xd577('0x1c5')](_0x46f1c1['erlangCalls']*_0x46f1c1['erlangAbandonmentRate']*_0x46f1c1[_0xd577('0x1c6')]*_0x46f1c1[_0xd577('0x1c7')]);if(_[_0xd577('0x40')](_0x46f1c1['startProgressive'])){if(!_[_0xd577('0x40')](_0x46f1c1[_0xd577('0x27')])){_0x46f1c1[_0xd577('0x27')]=undefined;loggerPredictive['error'](_0xd577('0x1c8'),_0xd577('0x1c9'));}if(!_[_0xd577('0x40')](_0x46f1c1['handlePredictive'])){loggerPredictive[_0xd577('0x65')](_0xd577('0x1c8'),_0xd577('0x1ca'));clearInterval(_0x46f1c1[_0xd577('0x63')]);_0x46f1c1[_0xd577('0x63')]=undefined;}_0x46f1c1[_0xd577('0x28')]=moment()[_0xd577('0x46')](_0xd577('0xc2'));loggerPredictive[_0xd577('0x49')](_0x46f1c1[_0xd577('0x60')],_0xd577('0x1cb'),_0x46f1c1['startProgressive']);this[_0xd577('0xb2')](_0x46f1c1,0x1);}else if(ifInterval(_0x46f1c1[_0xd577('0x1cc')],_0x46f1c1[_0xd577('0x28')])){this[_0xd577('0xb2')](_0x46f1c1,0x1);loggerPredictiveCalls[_0xd577('0x49')](_0xd577('0x1cd'),_0x46f1c1['startProgressive'],_0x46f1c1[_0xd577('0x60')]);_0x46f1c1[_0xd577('0x1ce')]=0x0;_0x46f1c1['predictiveIntervalErlangCallsDroppedCalls']=0x0;}else if(_0x6ed11d<_0x3fa68c&&_0x46f1c1[_0xd577('0x1cf')]===_0xd577('0x1d0')){clearPredictiveAttributes(_0x46f1c1);loggerPredictive[_0xd577('0x49')](_0xd577('0x1d1'),_0xd577('0x1d2'),_0x3fa68c,_0xd577('0x28'),_0x46f1c1[_0xd577('0x60')]);}else if(_0x10f6b1<_0x46f1c1[_0xd577('0xd1')]&&_0x46f1c1[_0xd577('0x1cf')]===_0xd577('0x1d0')){clearPredictiveAttributes(_0x46f1c1);loggerPredictive[_0xd577('0x49')](_0xd577('0x1d3'),'Max\x20Drop\x20',_0x10f6b1,_0xd577('0x1d4'),_0x46f1c1[_0xd577('0xd1')],_0xd577('0x28'),_0x46f1c1[_0xd577('0x60')]);}else if(!ifInterval(_0x46f1c1[_0xd577('0x1cc')],_0x46f1c1['startProgressive'])&&_['isUndefined'](_0x46f1c1[_0xd577('0x27')])&&!_['isUndefined'](_0x46f1c1[_0xd577('0x28')])){_0x46f1c1[_0xd577('0x27')]=moment()[_0xd577('0x46')](_0xd577('0xc2'));loggerPredictive[_0xd577('0x49')](_0x46f1c1[_0xd577('0x60')],_0xd577('0x1d5'),_0x46f1c1[_0xd577('0x27')]);hopperUtils[_0xd577('0x1d6')](_0x46f1c1[_0xd577('0x1cc')])[_0xd577('0x3e')](this[_0xd577('0x1d7')](_0x46f1c1))[_0xd577('0x3e')](mergeDataErlangB(_0x46f1c1))[_0xd577('0x3e')](this[_0xd577('0x1d8')](_0x46f1c1))['catch'](loggerCatchPredictive('Predictive\x20after\x20first\x20interval',_0x46f1c1));}else if(!ifInterval(_0x46f1c1[_0xd577('0x1cc')],_0x46f1c1[_0xd577('0x27')])){_0x46f1c1[_0xd577('0xd1')]=0x0;_0x46f1c1[_0xd577('0x27')]=moment()[_0xd577('0x46')](_0xd577('0xc2'));loggerPredictive['info'](_0x46f1c1[_0xd577('0x60')],_0xd577('0x1d9'),_0x46f1c1[_0xd577('0x27')]);clearInterval(_0x46f1c1[_0xd577('0x63')]);_0x46f1c1['handlePredictive']=undefined;hopperUtils[_0xd577('0x1d6')](_0x46f1c1[_0xd577('0x1cc')])[_0xd577('0x3e')](this[_0xd577('0x1d7')](_0x46f1c1))['then'](mergeDataErlangB(_0x46f1c1))[_0xd577('0x3e')](this[_0xd577('0x1d8')](_0x46f1c1))[_0xd577('0xa3')](loggerCatchPredictive('Predictive\x20for\x20every\x20interval',_0x46f1c1));}else if(_0x46f1c1[_0xd577('0x1c3')]&&_0x3fbc70<_0x46f1c1[_0xd577('0x1c3')]-_0x93fac9){clearPredictiveAttributes(_0x46f1c1);loggerPredictive[_0xd577('0x49')](_0x46f1c1[_0xd577('0x60')],_0xd577('0x1da'),_0x3fbc70,')\x20are\x20less\x20than\x20threshold\x20(',_0x46f1c1['predictiveIntervalAvailable'],'-',_0x93fac9,'=',_0x46f1c1['predictiveIntervalAvailable']-_0x93fac9,')');}else if(_0x46f1c1[_0xd577('0x1c3')]&&_0x3fbc70>_0x46f1c1['predictiveIntervalAvailable']+_0x20eb5e){clearPredictiveAttributes(_0x46f1c1);loggerPredictive['info'](_0x46f1c1['name'],'switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',_0x3fbc70,_0xd577('0x1db'),_0x46f1c1[_0xd577('0x1c3')],'+',_0x20eb5e,'=',_0x46f1c1[_0xd577('0x1c3')]+_0x20eb5e,')');}};Dialer['prototype'][_0xd577('0x1d7')]=function(_0x49235c){var _0x126dd3=this;return function(_0x37dd1e){return new Promise(function(_0x1c6ae7,_0x534925){_[_0xd577('0xfa')](_0x49235c,_0x37dd1e[0x0]);if(checkGetDataPredictive(_0x37dd1e[0x0])){var _0x4314c1=_0x49235c['predictiveIntervalAvailable']=_0x49235c['talking']+_0x49235c[_0xd577('0x13b')];var _0x279466=_0x49235c[_0xd577('0x1cc')]*0x3c;var _0xc1506d=_0x37dd1e[0x0]['predictiveIntervalAvgTalktime']+_0x37dd1e[0x0][_0xd577('0x4f')];var _0x375d6d=(_0x37dd1e[0x0][_0xd577('0x1dc')]+_0x37dd1e[0x0][_0xd577('0x4e')]+_0x37dd1e[0x0][_0xd577('0xe8')])/_0x37dd1e[0x0][_0xd577('0x52')];_0x49235c[_0xd577('0x1c6')]=_0x375d6d>0x0?_0x375d6d:0x1;switch(_0x49235c['dialPredictiveOptimization']){case'dropRate':var _0x1bed73=_0x49235c[_0xd577('0x1dd')]/0x64;return _0x126dd3[_0xd577('0x1de')](_0x4314c1,_0x279466,_0xc1506d,_0x375d6d,_0x1bed73)['then'](function(_0x399530){return _0x1c6ae7(_0x399530);});case _0xd577('0x1df'):var _0x5811f5=_0x49235c['dialPredictiveOptimizationPercentage']/0x64;return _0x126dd3[_0xd577('0x1e0')](_0x4314c1,_0x279466,_0xc1506d,_0x375d6d,_0x5811f5)[_0xd577('0x3e')](function(_0x2fed81){return _0x1c6ae7(_0x2fed81);});default:return _0x534925(msgResponse(_0xd577('0x1e1'),_0xd577('0x95'),_0xd577('0x1e2')));}}else{return _0x534925(msgResponse(_0xd577('0x1e1'),_0xd577('0x95'),'check\x20failure'));}});};};Dialer[_0xd577('0x86')][_0xd577('0x1e3')]=function(_0x5a660f){var _0x4e6c03=this;return function(_0x56bdd2){return new Promise(function(_0x43a358,_0x11be43){_['merge'](_0x5a660f,_0x56bdd2[0x0]);if(checkGetDataPredictive(_0x56bdd2[0x0])){loggerPredictive['info'](JSON[_0xd577('0x74')](_0x56bdd2[0x0]));if(_0x5a660f['dialPredictiveOptimization']===_0xd577('0x1d0')){return _0x4e6c03['getVoiceQueueRtPauses'](_0x5a660f['id'])[_0xd577('0x3e')](function(_0x3cdd1c){var _0xe75a96=_0x5a660f['loggedIn']-_0x3cdd1c[0x0][_0xd577('0x1e4')];var _0x3576be=_0x5a660f[_0xd577('0x1cc')]*0x3c;var _0x496ed0=_0x56bdd2[0x0][_0xd577('0x51')]+_0x56bdd2[0x0]['predictiveIntervalAvgHoldtime'];var _0x38918d=(_0x56bdd2[0x0][_0xd577('0x1dc')]+_0x56bdd2[0x0][_0xd577('0x4e')]+_0x56bdd2[0x0][_0xd577('0xe8')])/_0x56bdd2[0x0][_0xd577('0x52')];var _0x313fc3=_0x5a660f[_0xd577('0x1dd')]/0x64;_0x5a660f[_0xd577('0x1e5')]=_0x3cdd1c[0x0][_0xd577('0x1e4')]||0x0;_0x5a660f[_0xd577('0x1c6')]=_0x38918d>0x0?_0x38918d:0x1;return _0x4e6c03['abandonmentRate'](_0xe75a96,_0x3576be,_0x496ed0,_0x38918d,_0x313fc3);})[_0xd577('0x3e')](function(_0x46d6a9){return _0x43a358(_0x46d6a9);})[_0xd577('0xa3')](function(_0x262613){return _0x11be43(msgResponse('[CatchErlangB]',_0xd577('0x95'),JSON[_0xd577('0x74')](_0x262613)));});}if(_0x5a660f['dialPredictiveOptimization']===_0xd577('0x1df')){return _0x4e6c03[_0xd577('0x155')](_0x5a660f['id'])[_0xd577('0x3e')](function(_0x285ed3){var _0x5ad1ee=_0x5a660f['loggedIn']-_0x285ed3[0x0]['outboundQueuePauses'];var _0x1bef3d=_0x5a660f[_0xd577('0x1cc')]*0x3c;var _0x38ac81=_0x56bdd2[0x0][_0xd577('0x51')]+_0x56bdd2[0x0][_0xd577('0x4f')];var _0x47fb48=(_0x56bdd2[0x0]['predictiveIntervalAnsweredCalls']+_0x56bdd2[0x0][_0xd577('0x4e')]+_0x56bdd2[0x0][_0xd577('0xe8')])/_0x56bdd2[0x0][_0xd577('0x52')];var _0x443804=_0x5a660f[_0xd577('0x1dd')]/0x64;_0x5a660f[_0xd577('0x1e5')]=_0x285ed3[0x0]['outboundQueuePauses']||0x0;_0x5a660f['predictiveIntervalHitRate']=_0x47fb48>0x0?_0x47fb48:0x1;return _0x4e6c03[_0xd577('0x1e0')](_0x5ad1ee,_0x1bef3d,_0x38ac81,_0x47fb48,_0x443804);})[_0xd577('0x3e')](function(_0x42c905){return _0x43a358(_0x42c905);})[_0xd577('0xa3')](function(_0x1b006a){return _0x11be43(msgResponse(_0xd577('0x1e6'),_0xd577('0x95'),JSON['stringify'](_0x1b006a)));});}}else{return _0x11be43(msgResponse('[getDataPredictive]',_0xd577('0x95'),_0xd577('0x1e7')));}});};};Dialer[_0xd577('0x86')][_0xd577('0x1d8')]=function(_0x4ab81c){var _0x122183=this;return function(){var _0x5224ca=0x0;var _0x370a0c=Math[_0xd577('0x1c5')](_0x4ab81c[_0xd577('0x5a')]*0x3e8);if(_0x370a0c>0x0){_0x370a0c=_0x370a0c<0x64?0x64:_0x370a0c;loggerPredictive[_0xd577('0x49')](_0x4ab81c[_0xd577('0x60')],_0xd577('0x1e8'),_0x370a0c,_0xd577('0x1e9'));_0x4ab81c[_0xd577('0x63')]=setInterval(function(){_0x122183['handlePredictive'](_0x4ab81c);loggerPredictiveCalls[_0xd577('0x49')]('[handlePredictive]',_0x5224ca+=0x1);},_0x370a0c);}else{loggerPredictive[_0xd577('0x49')](_0x4ab81c[_0xd577('0x60')],'fail\x20to\x20scheduled\x20calls');}};};Dialer[_0xd577('0x86')][_0xd577('0x1ea')]=function(_0x940f85,_0x4cbe3d){var _0x233e75=this;return function(_0x5cc483){if(_[_0xd577('0x79')](_0x5cc483)){if(_[_0xd577('0xf5')](_0x4cbe3d['UserId'])||!_0x4cbe3d['recallme']){if(_0x940f85[_0xd577('0xb1')]==='booked'){_0x940f85[_0xd577('0x72')]=_[_0xd577('0x40')](_0x940f85['queueStatusComplete'])?!![]:_0x940f85[_0xd577('0x72')];var _0x2a0588=uuid['v4']();_0x233e75[_0xd577('0xf0')][_0x2a0588]=new Action(_0x940f85,_0x4cbe3d,_0x2a0588);loggerBooked[_0xd577('0x49')](_0xd577('0x1eb'),_0x2a0588,'queueStatusComplete:\x20',JSON['stringify'](_0x940f85[_0xd577('0x72')]),_0xd577('0x1ec'),_0x940f85['name']);if(_0x940f85[_0xd577('0x72')]){_0x940f85[_0xd577('0x72')]=![];_0x233e75[_0xd577('0xf9')][_0x233e75[_0xd577('0xf0')][_0x2a0588][_0xd577('0xbd')]]=[];ami[_0xd577('0x9c')]({'actionid':_0x2a0588,'action':_0xd577('0x1ed'),'queue':_0x940f85[_0xd577('0x60')]})['catch'](function(){_0x233e75[_0xd577('0xc0')](_0x940f85);hopperUtils[_0xd577('0xdb')]({'active':![],'ContactId':_0x233e75[_0xd577('0xf0')][_0x2a0588][_0xd577('0xdf')],'ListId':_0x233e75[_0xd577('0xf0')][_0x2a0588][_0xd577('0xe0')],'VoiceQueueId':_0x233e75[_0xd577('0xf0')][_0x2a0588][_0xd577('0xe1')]||undefined,'CampaignId':_0x233e75[_0xd577('0xf0')][_0x2a0588][_0xd577('0xe2')]||undefined})['catch'](loggerCatch(_0xd577('0x1ee')));delete _0x233e75[_0xd577('0xf0')][_0x2a0588];});}else{loggerBooked[_0xd577('0x49')]('[booked][checkContactBlack][else]',JSON['stringify'](_0x940f85[_0xd577('0x72')]),'Queue:\x20',_0x940f85[_0xd577('0x60')]);_0x233e75[_0xd577('0xc0')](_0x940f85);hopperUtils[_0xd577('0xdb')]({'active':![],'ContactId':_0x233e75[_0xd577('0xf0')][_0x2a0588][_0xd577('0xdf')],'ListId':_0x233e75['actions'][_0x2a0588]['ListId'],'VoiceQueueId':_0x233e75[_0xd577('0xf0')][_0x2a0588][_0xd577('0xe1')]||undefined,'CampaignId':_0x233e75[_0xd577('0xf0')][_0x2a0588][_0xd577('0xe2')]||undefined})[_0xd577('0xa3')](loggerCatch(_0xd577('0x1ee')));delete _0x233e75[_0xd577('0xf0')][_0x2a0588];}}else{return _0x233e75[_0xd577('0x160')](_0x940f85,_0x4cbe3d);}}else{if(utils[_0xd577('0xcd')](undefined,_0x4cbe3d[_0xd577('0x1ef')])<_0x940f85['dialRecallMeTimeout']*0x3c){if(_0x4cbe3d[_0xd577('0x149')]&&!_0x4cbe3d[_0xd577('0x149')][_0xd577('0x1f0')]){_0x233e75[_0xd577('0x1e')][_0xd577('0x104')](_0x4cbe3d['id'])[_0xd577('0x1d')](function(){_0x233e75[_0xd577('0xc0')](_0x940f85);});}else{hopperUtils[_0xd577('0x1f1')]({'active':![]},_0x4cbe3d['id'],0x1)[_0xd577('0x1d')](function(){_0x233e75[_0xd577('0xc0')](_0x940f85);});}}else{_0x940f85[_0xd577('0x1f2')]+=0x1;_0x233e75[_0xd577('0xc0')](_0x940f85);if(_0x940f85[_0xd577('0x1f3')]){hopperUtils[_0xd577('0xdb')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x4cbe3d[_0xd577('0xdf')],'ListId':_0x4cbe3d[_0xd577('0xe0')],'VoiceQueueId':_0x4cbe3d[_0xd577('0xe1')]||undefined,'CampaignId':_0x4cbe3d[_0xd577('0xe2')]||undefined})['catch'](loggerCatch('[rescheduleContact][dialRecallInQueue]'));hopperUtils[_0xd577('0xc8')](createObjHistory(_0x940f85,_0x4cbe3d,utils['CAMPAIGN_STATUS'][_0xd577('0x1f4')],0x17,_0xd577('0x1f5')))['catch'](loggerCatch(_0xd577('0x1f6')));}else{_0x233e75[_0xd577('0x11a')](createObjHistory(_0x940f85,_0x4cbe3d,utils[_0xd577('0x6a')]['RECALL_TIMEOUT'],0x16,'RecallFailedTimeout'),_0xd577('0x1f7'),'[Originate][HistoryRecallClose]');}}}}else{_0x940f85[_0xd577('0x1f8')]+=0x1;_0x233e75[_0xd577('0x11a')](createObjHistory(_0x940f85,_0x4cbe3d,utils[_0xd577('0x6a')][_0xd577('0x1f9')],0xd,'Blacklist'),'[Originate][historyBlacklist]',_0xd577('0x1fa'));throw _0xd577('0x1fb');}};};Dialer[_0xd577('0x86')][_0xd577('0x15f')]=function(_0x22c291){var _0x5d3f76=this;var _0x1cf530=_0x22c291[_0xd577('0x1fc')]-_0x22c291[_0xd577('0x7f')];emitCampaignSummary(_0x22c291);if(_0x1cf530>0x0&&_0x22c291[_0xd577('0x1fd')]==0x0){if(_0x1cf530>this[_0xd577('0x23')]){_0x1cf530=this[_0xd577('0x23')];}_0x22c291[_0xd577('0x1fd')]=0x1;hopperUtils['getContactDialerIvr'](_0x22c291,_0x1cf530)[_0xd577('0x3e')](function(_0x10bdd2){_0x22c291[_0xd577('0x1fd')]=0x0;if(_0x10bdd2){if(!utils[_0xd577('0x1fe')](_0x10bdd2)){_0x22c291[_0xd577('0x69')]=utils[_0xd577('0x6a')][_0xd577('0x1ff')];logger[_0xd577('0x49')](_0xd577('0x200')+_0x22c291[_0xd577('0x60')]);}else{_0x22c291['originated']+=_0x10bdd2[_0xd577('0xff')];_0x22c291[_0xd577('0x69')]=utils[_0xd577('0x6a')][_0xd577('0x201')];for(var _0x448cee=0x0;_0x448cee<_0x10bdd2['length'];_0x448cee+=0x1){_0x22c291['ivrTotalCallsDays']+=0x1;if(_[_0xd577('0xf5')](_0x10bdd2[_0x448cee])||_[_0xd577('0xf5')](_0x10bdd2[_0x448cee]['Contact'])||_[_0xd577('0xf5')](_0x10bdd2[_0x448cee][_0xd577('0x164')])){_0x5d3f76[_0xd577('0x159')]('[actionOriginate]\x20',_0x22c291,_0x10bdd2[_0x448cee]);}else{hopperUtils[_0xd577('0x202')](_[_0xd577('0x75')](_0x10bdd2[_0x448cee],[_0xd577('0xe2'),_0xd577('0x164')]))[_0xd577('0x3e')](_0x5d3f76[_0xd577('0x1ea')](_0x22c291,_0x10bdd2[_0x448cee]))[_0xd577('0xa3')](_0x5d3f76[_0xd577('0x203')](_0xd577('0x204'),_0x22c291));}}}}})[_0xd577('0xa3')](loggerGetContactDialer('[getContactCampaign2]',_0x22c291,_0x1cf530));}};Dialer['prototype'][_0xd577('0xb2')]=function(_0x3dcec3,_0x4a04d5){var _0x6ae1e7=this;var _0x3e1a64=[];if(_0x4a04d5<0x1||_0x3dcec3['dialMethod']===_0xd577('0x9')){_0x4a04d5=0x1;}var _0x58d40f=Math[_0xd577('0x1c5')](_0x3dcec3['available']*_0x4a04d5)-_0x3dcec3[_0xd577('0x7f')];if(_0x3dcec3[_0xd577('0x205')]>0x0){var _0x4f1ed1=_0x3dcec3[_0xd577('0x205')]-_0x3dcec3[_0xd577('0x7f')]-_0x3dcec3['talking']-_0x3dcec3[_0xd577('0x13d')];if(_0x58d40f>_0x4f1ed1){_0x58d40f=_0x4f1ed1;}}if(_0x58d40f>0x0&&_0x3dcec3[_0xd577('0x1fd')]==0x0){if(_0x3dcec3[_0xd577('0xb1')]===_0xd577('0x9')){_0x58d40f=0x1;}if(_0x58d40f>this['maxNumberOriginate']){_0x58d40f=this[_0xd577('0x23')];}for(var _0x750af in this[_0xd577('0x21')]){if(typeof this['agents'][_0x750af]!==_0xd577('0xac')){if(this[_0xd577('0x21')][_0x750af][_0xd577('0x6d')]===_0xd577('0x206')&&this[_0xd577('0x21')][_0x750af][_0xd577('0x89')]===_0xd577('0x146')){_0x3e1a64[_0xd577('0xa4')](this['agents'][_0x750af]['id']);}}}_0x3dcec3[_0xd577('0x1fd')]=0x1;hopperUtils['getContactDialer'](_0x3dcec3,_0x3e1a64,_0x58d40f)[_0xd577('0x3e')](function(_0x1b2c38){_0x3dcec3[_0xd577('0x1fd')]=0x0;if(_0x1b2c38){if(!utils[_0xd577('0x1fe')](_0x1b2c38)){hopperUtils[_0xd577('0x207')](_0x3dcec3)[_0xd577('0x3e')](sendMessageReschedule(_0x3dcec3))[_0xd577('0xa3')](loggerCatch('[countReScheduled]\x20'));}else{_0x3dcec3[_0xd577('0x7f')]+=_0x1b2c38[_0xd577('0xff')];_0x3dcec3[_0xd577('0x69')]=_0x3dcec3[_0xd577('0xb1')]===_0xd577('0x9')?utils[_0xd577('0x6a')][_0xd577('0x13e')]:utils[_0xd577('0x6a')][_0xd577('0x201')];for(var _0x38cfbb=0x0;_0x38cfbb<_0x1b2c38[_0xd577('0xff')];_0x38cfbb+=0x1){if(_['isNil'](_0x1b2c38[_0x38cfbb])||_[_0xd577('0xf5')](_0x1b2c38[_0x38cfbb][_0xd577('0x208')])||_['isNil'](_0x1b2c38[_0x38cfbb][_0xd577('0x164')])){_0x6ae1e7['emptyContact'](_0xd577('0x209'),_0x3dcec3,_0x1b2c38[_0x38cfbb]);}else{hopperUtils[_0xd577('0x20a')](_[_0xd577('0x75')](_0x1b2c38[_0x38cfbb],[_0xd577('0xe1'),_0xd577('0x164')]))[_0xd577('0x3e')](_0x6ae1e7['checkContactBlack'](_0x3dcec3,_0x1b2c38[_0x38cfbb]))[_0xd577('0xa3')](_0x6ae1e7[_0xd577('0x203')](_0xd577('0x209'),_0x3dcec3));}}}}})['catch'](loggerGetContactDialer(_0xd577('0x20b'),_0x3dcec3,_0x58d40f));}};Dialer[_0xd577('0x86')]['handlePredictive']=function(_0x1e9d09){if(_0x1e9d09[_0xd577('0x205')]>0x0){var _0x4de582=_0x1e9d09['dialLimitQueue']-_0x1e9d09[_0xd577('0x7f')]-_0x1e9d09[_0xd577('0x13c')];if(_0x4de582>0x0&&_0x1e9d09[_0xd577('0x1fd')]==0x0){this[_0xd577('0x20c')](_0x1e9d09);}else{loggerPredictiveCalls['info'](_0xd577('0x20d'));}}else{this[_0xd577('0x20c')](_0x1e9d09);}};Dialer[_0xd577('0x86')][_0xd577('0x20c')]=function(_0x39c628){var _0x24e6cb=this;var _0x3724fb=[];_0x39c628[_0xd577('0x7f')]+=0x1;for(var _0x176499 in this[_0xd577('0x21')]){if(typeof this[_0xd577('0x21')][_0x176499]!==_0xd577('0xac')){if(this['agents'][_0x176499][_0xd577('0x6d')]==='not_inuse'&&this[_0xd577('0x21')][_0x176499][_0xd577('0x89')]===_0xd577('0x146')){_0x3724fb['push'](this[_0xd577('0x21')][_0x176499]['id']);}}}_0x39c628[_0xd577('0x1fd')]=0x1;return this[_0xd577('0x20e')](_0x39c628['id'],_0x3724fb,0x1,_0x39c628[_0xd577('0x20f')],_0x39c628)[_0xd577('0x3e')](function(_0x148805){_0x39c628[_0xd577('0x1fd')]=0x1;if(_0x148805){if(!utils[_0xd577('0x1fe')](_0x148805)){utils[_0xd577('0x67')](_0x39c628,0x1,0x0);return hopperUtils[_0xd577('0x207')](_0x39c628)['then'](sendMessageReschedule(_0x39c628))['catch'](loggerCatch(_0xd577('0x210')));}else{_0x39c628['message']=utils[_0xd577('0x6a')][_0xd577('0x201')];if(_['isNil'](_0x148805[0x0])||_[_0xd577('0xf5')](_0x148805[0x0][_0xd577('0x208')])||_[_0xd577('0xf5')](_0x148805[0x0]['phone'])){_0x24e6cb[_0xd577('0x159')](_0xd577('0x209'),_0x39c628,_0x148805[0x0]);}else{return hopperUtils[_0xd577('0x20a')](_[_0xd577('0x75')](_0x148805[0x0],[_0xd577('0xe1'),'phone']))[_0xd577('0x3e')](_0x24e6cb[_0xd577('0x1ea')](_0x39c628,_0x148805[0x0]))['catch'](_0x24e6cb[_0xd577('0x203')](_0xd577('0x211'),_0x39c628));}}}})[_0xd577('0xa3')](loggerGetContactDialer(_0xd577('0x212'),_0x39c628,0x1));};Dialer[_0xd577('0x86')]['abandonmentRate']=function(_0x14ab45,_0x5184ff,_0x56de45,_0x10d0a9,_0x2f3473,_0x5593b9){loggerPredictive[_0xd577('0x49')](_0xd577('0x213'));loggerPredictive['info'](_0xd577('0x214'),_0x14ab45);loggerPredictive[_0xd577('0x49')](_0xd577('0x215'),_0x5184ff);loggerPredictive['info'](_0xd577('0x216'),_0x56de45);loggerPredictive[_0xd577('0x49')](_0xd577('0x217'),_0x10d0a9);loggerPredictive[_0xd577('0x49')](_0xd577('0x218'),_0x2f3473);loggerPredictive['info'](_0xd577('0x5f'));return new Promise(function(_0x5b33e0,_0x371b6d){if(_0x14ab45<=0x0||isNaN(_0x14ab45)){return _0x371b6d(msgResponse(_0xd577('0x219'),'Error','m\x20=\x20'+_0x14ab45));}if(_0x56de45<=0x0||isNaN(_0x56de45)){return _0x371b6d(msgResponse('[abandonmentRate]',_0xd577('0xbc'),'Ts\x20=\x20'+_0x56de45));}if(_0x10d0a9<=0x0||isNaN(_0x10d0a9)){return _0x371b6d(msgResponse('[abandonmentRate]',_0xd577('0xbc'),_0xd577('0x21a')+_0x10d0a9));}if(_0x5184ff<=0x0||isNaN(_0x5184ff)){return _0x371b6d(msgResponse(_0xd577('0x219'),'Error',_0xd577('0x21b')+_0x5184ff));}if(_0x2f3473<=0x0||isNaN(_0x2f3473)){return _0x371b6d(msgResponse(_0xd577('0x219'),_0xd577('0xbc'),'Amax\x20=\x20'+_0x2f3473));}_0x5593b9=_0x5593b9||0x0;var _0x399f65=0x1/_0x56de45;var _0x5efc3d=0x0;var _0x27b7b2=0x0;var _0x5d709f=0x0;var _0x3f350d=0x0;for(var _0x1c667c=0x0;_0x5d709f<_0x2f3473;_0x1c667c+=0x1){_0x27b7b2=_0x1c667c/_0x5184ff;_0x5efc3d=(_0x10d0a9*_0x27b7b2+_0x5593b9)/_0x399f65;_0x5d709f=utils['erlangb'](_0x5efc3d,_0x14ab45);_0x3f350d=_0x5efc3d/_0x14ab45*(0x1-utils[_0xd577('0x21c')](_0x5efc3d,_0x14ab45));}return _0x5b33e0({'erlangCalls':_0x1c667c,'erlangCallToSecond':_0x5184ff/_0x1c667c,'erlangAbandonmentRate':_0x5d709f,'erlangBusyFactor':_0x3f350d});});};Dialer[_0xd577('0x86')]['busyFactor']=function(_0x5a782e,_0x243a66,_0x1d9b37,_0x80b53a,_0x743b0,_0xd684){loggerPredictive[_0xd577('0x49')]('----\x20Agent\x20Busy\x20Factor\x20----');loggerPredictive[_0xd577('0x49')]('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',_0x5a782e);loggerPredictive[_0xd577('0x49')]('Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x243a66);loggerPredictive[_0xd577('0x49')](_0xd577('0x216'),_0x1d9b37);loggerPredictive['info'](_0xd577('0x217'),_0x80b53a);loggerPredictive[_0xd577('0x49')](_0xd577('0x21d'),_0x743b0);loggerPredictive['info'](_0xd577('0x5f'));return new Promise(function(_0x2f18b7,_0x30c943){if(_0x5a782e<=0x0||isNaN(_0x5a782e)){return _0x30c943(msgResponse(_0xd577('0x21e'),_0xd577('0xbc'),_0xd577('0x21f')+_0x5a782e));}if(_0x1d9b37<=0x0||isNaN(_0x1d9b37)){return _0x30c943(msgResponse(_0xd577('0x21e'),_0xd577('0xbc'),_0xd577('0x220')+_0x1d9b37));}if(_0x80b53a<=0x0||isNaN(_0x80b53a)){return _0x30c943(msgResponse('[busyFactor]',_0xd577('0xbc'),_0xd577('0x21a')+_0x80b53a));}if(_0x243a66<=0x0||isNaN(_0x243a66)){return _0x30c943(msgResponse(_0xd577('0x21e'),_0xd577('0xbc'),_0xd577('0x21b')+_0x243a66));}if(_0x743b0<=0x0||isNaN(_0x743b0)){return _0x30c943(msgResponse(_0xd577('0x21e'),_0xd577('0xbc'),_0xd577('0x221')+_0x743b0));}_0xd684=_0xd684||0x0;var _0xe6ae6a=0x1/_0x1d9b37;var _0xdb8e29=0x0;var _0x3b5192=0x0;var _0x11495b=0x0;var _0x41fa05=0x0;for(var _0x4018d0=0x0;_0x41fa05<_0x743b0;_0x4018d0+=0x1){_0x3b5192=_0x4018d0/_0x243a66;_0xdb8e29=(_0x80b53a*_0x3b5192+_0xd684)/_0xe6ae6a;_0x11495b=utils['erlangb'](_0xdb8e29,_0x5a782e);_0x41fa05=_0xdb8e29/_0x5a782e*(0x1-utils['erlangb'](_0xdb8e29,_0x5a782e));}return _0x2f18b7({'erlangCalls':_0x4018d0,'erlangCallToSecond':_0x243a66/_0x4018d0,'erlangAbandonmentRate':_0x11495b,'erlangBusyFactor':_0x41fa05});});};module['exports']=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 eb96969..0a19019 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 _0x4b0b=['Contact','firstName','lastName','number','phone','queue','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','idHopper','ContactFirstName','starttime','format','callback','callbackuniqueid','callbackat','recallme','originatecalleridnum','prototype','\x22%s\x22\x20<%s>','substring','getQueue','exports','lodash','moment','isNil','string','voiceQueue','name'];(function(_0x4e9ea9,_0x219b0e){var _0x2ff0b0=function(_0x253d89){while(--_0x253d89){_0x4e9ea9['push'](_0x4e9ea9['shift']());}};_0x2ff0b0(++_0x219b0e);}(_0x4b0b,0x1a8));var _0xb4b0=function(_0x501122,_0x17d3e3){_0x501122=_0x501122-0x0;var _0x571ee0=_0x4b0b[_0x501122];return _0x571ee0;};'use strict';var util=require('util');var _=require(_0xb4b0('0x0'));var moment=require(_0xb4b0('0x1'));function checkNameSurname(_0xc77381,_0x1c11e3,_0x4051d9){var _0x2d30be='';if(!_[_0xb4b0('0x2')](_0x1c11e3)&&_0xb4b0('0x3')===typeof _0x1c11e3){_0x2d30be+=_0x1c11e3;}if(!_[_0xb4b0('0x2')](_0x4051d9)&&_0xb4b0('0x3')===typeof _0x4051d9){_0x2d30be+='\x20'+_0x4051d9;}if(_0x2d30be!==''){return _0x2d30be;}return _0xc77381;}function Action(_0x4ce234,_0x317431,_0x13eef1){this[_0xb4b0('0x4')]=_0x4ce234;this['uniqueid']=_0x13eef1||undefined;this[_0xb4b0('0x5')]=checkNameSurname(_0x317431['Contact']['phone'],_0x317431[_0xb4b0('0x6')][_0xb4b0('0x7')],_0x317431[_0xb4b0('0x6')][_0xb4b0('0x8')]);this[_0xb4b0('0x9')]=_0x317431[_0xb4b0('0xa')];this[_0xb4b0('0xb')]=_0x4ce234[_0xb4b0('0x5')];this[_0xb4b0('0xc')]=_0x317431[_0xb4b0('0xc')]||![];this['type']=_0x4ce234[_0xb4b0('0xd')];this[_0xb4b0('0xe')]=_0x4ce234[_0xb4b0('0xe')]||0x3;this[_0xb4b0('0xf')]=_0x317431[_0xb4b0('0xf')];this[_0xb4b0('0x10')]=_0x317431[_0xb4b0('0x10')];this[_0xb4b0('0x11')]=_0x317431['countcongestionretry'];this[_0xb4b0('0x12')]=_0x317431[_0xb4b0('0x12')];this[_0xb4b0('0x13')]=_0x317431[_0xb4b0('0x13')];this[_0xb4b0('0x14')]=_0x317431[_0xb4b0('0x14')];this[_0xb4b0('0x15')]=_0x317431[_0xb4b0('0x15')];this[_0xb4b0('0x16')]=_0x317431[_0xb4b0('0x16')];this['countagentrejectretry']=_0x317431[_0xb4b0('0x17')];this[_0xb4b0('0x18')]=_0x317431[_0xb4b0('0x18')];this[_0xb4b0('0x19')]=_0x317431[_0xb4b0('0x19')];this[_0xb4b0('0x1a')]=_0x317431[_0xb4b0('0x1a')];this[_0xb4b0('0x1b')]=_0x317431['VoiceQueueId'];this[_0xb4b0('0x1c')]=_0x317431[_0xb4b0('0x1c')];this[_0xb4b0('0x1d')]=_0x317431['id'];this[_0xb4b0('0x1e')]=_0x317431[_0xb4b0('0x6')][_0xb4b0('0x7')]||'';this[_0xb4b0('0x1f')]=moment()[_0xb4b0('0x20')]('YYYY-MM-DD\x20HH:mm:ss');this[_0xb4b0('0x21')]=_0x317431[_0xb4b0('0x21')];this[_0xb4b0('0x22')]=_0x317431[_0xb4b0('0x22')];this[_0xb4b0('0x23')]=_0x317431[_0xb4b0('0x23')];this[_0xb4b0('0x24')]=_0x317431[_0xb4b0('0x24')];this[_0xb4b0('0x25')]='';this['originatecalleridname']='';}Action[_0xb4b0('0x26')]['getCaller']=function(){return util[_0xb4b0('0x20')](_0xb4b0('0x27'),this['name'],this[_0xb4b0('0x4')]['dialCutDigit']>0x0?this[_0xb4b0('0x9')][_0xb4b0('0x28')](this[_0xb4b0('0x4')]['dialCutDigit']):this[_0xb4b0('0x9')]);};Action[_0xb4b0('0x26')][_0xb4b0('0x29')]=function(){return this[_0xb4b0('0xb')];};module[_0xb4b0('0x2a')]=Action; \ No newline at end of file +var _0x5422=['string','voiceQueue','uniqueid','Contact','phone','firstName','lastName','number','name','active','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','idHopper','ContactFirstName','format','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme','originatecalleridname','\x22%s\x22\x20<%s>','dialCutDigit','substring','prototype','queue','exports','util','lodash','moment','isNil'];(function(_0x36b5ba,_0x3f8338){var _0x1ceea5=function(_0x3f116d){while(--_0x3f116d){_0x36b5ba['push'](_0x36b5ba['shift']());}};_0x1ceea5(++_0x3f8338);}(_0x5422,0x188));var _0x2542=function(_0x28395b,_0x338f93){_0x28395b=_0x28395b-0x0;var _0x14cdb9=_0x5422[_0x28395b];return _0x14cdb9;};'use strict';var util=require(_0x2542('0x0'));var _=require(_0x2542('0x1'));var moment=require(_0x2542('0x2'));function checkNameSurname(_0x1c4d2d,_0x104dd8,_0xcd2fab){var _0x1312c4='';if(!_[_0x2542('0x3')](_0x104dd8)&&_0x2542('0x4')===typeof _0x104dd8){_0x1312c4+=_0x104dd8;}if(!_[_0x2542('0x3')](_0xcd2fab)&&_0x2542('0x4')===typeof _0xcd2fab){_0x1312c4+='\x20'+_0xcd2fab;}if(_0x1312c4!==''){return _0x1312c4;}return _0x1c4d2d;}function Action(_0x532831,_0xecd3e2,_0x4566e9){this[_0x2542('0x5')]=_0x532831;this[_0x2542('0x6')]=_0x4566e9||undefined;this['name']=checkNameSurname(_0xecd3e2[_0x2542('0x7')][_0x2542('0x8')],_0xecd3e2[_0x2542('0x7')][_0x2542('0x9')],_0xecd3e2[_0x2542('0x7')][_0x2542('0xa')]);this[_0x2542('0xb')]=_0xecd3e2[_0x2542('0x8')];this['queue']=_0x532831[_0x2542('0xc')];this['active']=_0xecd3e2[_0x2542('0xd')]||![];this['type']=_0x532831['type'];this[_0x2542('0xe')]=_0x532831[_0x2542('0xe')]||0x3;this[_0x2542('0xf')]=_0xecd3e2[_0x2542('0xf')];this[_0x2542('0x10')]=_0xecd3e2['countbusyretry'];this[_0x2542('0x11')]=_0xecd3e2[_0x2542('0x11')];this[_0x2542('0x12')]=_0xecd3e2['countnoanswerretry'];this[_0x2542('0x13')]=_0xecd3e2[_0x2542('0x13')];this[_0x2542('0x14')]=_0xecd3e2[_0x2542('0x14')];this[_0x2542('0x15')]=_0xecd3e2['countabandonedretry'];this[_0x2542('0x16')]=_0xecd3e2[_0x2542('0x16')];this[_0x2542('0x17')]=_0xecd3e2[_0x2542('0x17')];this['ContactId']=_0xecd3e2[_0x2542('0x18')];this[_0x2542('0x19')]=_0xecd3e2[_0x2542('0x19')];this['UserId']=_0xecd3e2[_0x2542('0x1a')];this[_0x2542('0x1b')]=_0xecd3e2[_0x2542('0x1b')];this[_0x2542('0x1c')]=_0xecd3e2[_0x2542('0x1c')];this[_0x2542('0x1d')]=_0xecd3e2['id'];this[_0x2542('0x1e')]=_0xecd3e2['Contact'][_0x2542('0x9')]||'';this['starttime']=moment()[_0x2542('0x1f')](_0x2542('0x20'));this[_0x2542('0x21')]=_0xecd3e2['callback'];this[_0x2542('0x22')]=_0xecd3e2['callbackuniqueid'];this[_0x2542('0x23')]=_0xecd3e2[_0x2542('0x23')];this[_0x2542('0x24')]=_0xecd3e2[_0x2542('0x24')];this['originatecalleridnum']='';this[_0x2542('0x25')]='';}Action['prototype']['getCaller']=function(){return util['format'](_0x2542('0x26'),this['name'],this[_0x2542('0x5')][_0x2542('0x27')]>0x0?this[_0x2542('0xb')][_0x2542('0x28')](this['voiceQueue']['dialCutDigit']):this[_0x2542('0xb')]);};Action[_0x2542('0x29')]['getQueue']=function(){return this[_0x2542('0x2a')];};module[_0x2542('0x2b')]=Action; \ No newline at end of file diff --git a/server/services/ami/dialer/models/agentComplete.js b/server/services/ami/dialer/models/agentComplete.js index 5720689..2cc2440 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 _0xe9bc=['ListId','VoiceQueueId','CampaignId','originatecalleridnum','agiafterat','exports','../utils','state','statedesc','Answer','scheduledat','type','campaigntype','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countmachineretry','countagentrejectretry','countabandonedretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','answertime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','getSeconds','holdtime','talktime','queue','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId'];(function(_0x59cbd6,_0x3b9913){var _0x23d948=function(_0x59a58b){while(--_0x59a58b){_0x59cbd6['push'](_0x59cbd6['shift']());}};_0x23d948(++_0x3b9913);}(_0xe9bc,0x16e));var _0xce9b=function(_0x4f3418,_0x1ce518){_0x4f3418=_0x4f3418-0x0;var _0x272d05=_0xe9bc[_0x4f3418];return _0x272d05;};'use strict';var moment=require('moment');var utils=require(_0xce9b('0x0'));function AgentComplete(_0x44497c,_0x20d840){this[_0xce9b('0x1')]=0x4;this[_0xce9b('0x2')]=_0xce9b('0x3');this[_0xce9b('0x4')]=_0x44497c[_0xce9b('0x4')];this[_0xce9b('0x5')]=_0x44497c[_0xce9b('0x5')];this[_0xce9b('0x6')]=_0x44497c[_0xce9b('0x5')]==='outbound'?'queue':_0x44497c[_0xce9b('0x5')];this[_0xce9b('0x7')]=_0x44497c['countbusyretry'];this[_0xce9b('0x8')]=_0x44497c[_0xce9b('0x8')];this[_0xce9b('0x9')]=_0x44497c[_0xce9b('0x9')];this[_0xce9b('0xa')]=_0x44497c['countbusyretry']+_0x44497c[_0xce9b('0x8')]+_0x44497c[_0xce9b('0x9')]+_0x44497c[_0xce9b('0xb')]+_0x44497c[_0xce9b('0xc')]+_0x44497c['countabandonedretry']+_0x44497c[_0xce9b('0xd')]+_0x44497c[_0xce9b('0xe')];this[_0xce9b('0xb')]=_0x44497c[_0xce9b('0xb')];this[_0xce9b('0xc')]=_0x44497c[_0xce9b('0xc')];this[_0xce9b('0xf')]=_0x44497c['countabandonedretry'];this[_0xce9b('0xd')]=_0x44497c[_0xce9b('0xd')];this[_0xce9b('0xe')]=_0x44497c['countagentrejectretry'];this[_0xce9b('0x10')]=_0x20d840['uniqueid'];this[_0xce9b('0x11')]=_0x44497c[_0xce9b('0x12')];this[_0xce9b('0x13')]=_0x44497c[_0xce9b('0x14')];this[_0xce9b('0x15')]=_0x44497c[_0xce9b('0x15')];this['responsetime']=_0x44497c[_0xce9b('0x16')];this[_0xce9b('0x17')]=_0x44497c[_0xce9b('0x17')];this[_0xce9b('0x18')]=moment()[_0xce9b('0x19')](_0xce9b('0x1a'));this[_0xce9b('0x1b')]=utils[_0xce9b('0x1c')](_0x44497c[_0xce9b('0x16')],_0x44497c['starttime']);this[_0xce9b('0x1d')]=utils['getSeconds'](_0x44497c[_0xce9b('0x17')],_0x44497c[_0xce9b('0x16')]);this[_0xce9b('0x1e')]=utils[_0xce9b('0x1c')](this[_0xce9b('0x18')],_0x44497c[_0xce9b('0x17')]);this[_0xce9b('0x1f')]=_0x20d840[_0xce9b('0x1f')];this[_0xce9b('0x20')]=_0x20d840[_0xce9b('0x20')];this['reason']=_0x20d840[_0xce9b('0x21')];this[_0xce9b('0x22')]=_0x44497c[_0xce9b('0x22')];this[_0xce9b('0x23')]=_0x44497c['callbackuniqueid'];this[_0xce9b('0x24')]=_0x44497c[_0xce9b('0x24')];this[_0xce9b('0x25')]=_0x44497c[_0xce9b('0x25')];this[_0xce9b('0x26')]=_0x44497c[_0xce9b('0x26')];this['ListId']=_0x44497c[_0xce9b('0x27')];this['UserId']=_0x44497c['UserId'];this[_0xce9b('0x28')]=_0x44497c[_0xce9b('0x28')];this[_0xce9b('0x29')]=_0x44497c[_0xce9b('0x29')];this[_0xce9b('0x2a')]=_0x44497c[_0xce9b('0x2a')]||'';this['originatecalleridname']=_0x44497c['originatecalleridname']||'';this['agiafterat']=_0x44497c[_0xce9b('0x2b')];}module[_0xce9b('0x2c')]=AgentComplete; \ No newline at end of file +var _0xe54a=['campaigntype','outbound','queue','countbusyretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countagentrejectretry','uniqueid','name','calleridnum','number','starttime','responsetime','answertime','endtime','ringtime','getSeconds','talktime','membername','reason','callback','callbackuniqueid','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','agiafterat','exports','moment','../utils','state','statedesc','Answer','scheduledat','type'];(function(_0x357311,_0x43f1b6){var _0x499c2a=function(_0x1966f5){while(--_0x1966f5){_0x357311['push'](_0x357311['shift']());}};_0x499c2a(++_0x43f1b6);}(_0xe54a,0x1b1));var _0xae54=function(_0x523ab0,_0x2e483b){_0x523ab0=_0x523ab0-0x0;var _0x1aa53c=_0xe54a[_0x523ab0];return _0x1aa53c;};'use strict';var moment=require(_0xae54('0x0'));var utils=require(_0xae54('0x1'));function AgentComplete(_0x2401dc,_0x32b845){this[_0xae54('0x2')]=0x4;this[_0xae54('0x3')]=_0xae54('0x4');this[_0xae54('0x5')]=_0x2401dc['scheduledat'];this['type']=_0x2401dc[_0xae54('0x6')];this[_0xae54('0x7')]=_0x2401dc['type']===_0xae54('0x8')?_0xae54('0x9'):_0x2401dc['type'];this[_0xae54('0xa')]=_0x2401dc[_0xae54('0xa')];this['countcongestionretry']=_0x2401dc['countcongestionretry'];this[_0xae54('0xb')]=_0x2401dc[_0xae54('0xb')];this['countglobal']=_0x2401dc['countbusyretry']+_0x2401dc['countcongestionretry']+_0x2401dc['countnoanswerretry']+_0x2401dc[_0xae54('0xc')]+_0x2401dc[_0xae54('0xd')]+_0x2401dc['countabandonedretry']+_0x2401dc['countmachineretry']+_0x2401dc[_0xae54('0xe')];this['countnosuchnumberretry']=_0x2401dc['countnosuchnumberretry'];this['countdropretry']=_0x2401dc['countdropretry'];this['countabandonedretry']=_0x2401dc['countabandonedretry'];this['countmachineretry']=_0x2401dc['countmachineretry'];this[_0xae54('0xe')]=_0x2401dc['countagentrejectretry'];this[_0xae54('0xf')]=_0x32b845['uniqueid'];this['calleridname']=_0x2401dc[_0xae54('0x10')];this[_0xae54('0x11')]=_0x2401dc[_0xae54('0x12')];this[_0xae54('0x13')]=_0x2401dc[_0xae54('0x13')];this['responsetime']=_0x2401dc[_0xae54('0x14')];this[_0xae54('0x15')]=_0x2401dc['answertime'];this[_0xae54('0x16')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this[_0xae54('0x17')]=utils[_0xae54('0x18')](_0x2401dc[_0xae54('0x14')],_0x2401dc['starttime']);this['holdtime']=utils[_0xae54('0x18')](_0x2401dc[_0xae54('0x15')],_0x2401dc['responsetime']);this[_0xae54('0x19')]=utils[_0xae54('0x18')](this['endtime'],_0x2401dc[_0xae54('0x15')]);this[_0xae54('0x9')]=_0x32b845['queue'];this[_0xae54('0x1a')]=_0x32b845[_0xae54('0x1a')];this['reason']=_0x32b845[_0xae54('0x1b')];this[_0xae54('0x1c')]=_0x2401dc[_0xae54('0x1c')];this[_0xae54('0x1d')]=_0x2401dc[_0xae54('0x1d')];this['callbackat']=_0x2401dc['callbackat'];this[_0xae54('0x1e')]=_0x2401dc['recallme'];this[_0xae54('0x1f')]=_0x2401dc[_0xae54('0x1f')];this[_0xae54('0x20')]=_0x2401dc['ListId'];this[_0xae54('0x21')]=_0x2401dc['UserId'];this[_0xae54('0x22')]=_0x2401dc[_0xae54('0x22')];this[_0xae54('0x23')]=_0x2401dc[_0xae54('0x23')];this['originatecalleridnum']=_0x2401dc[_0xae54('0x24')]||'';this['originatecalleridname']=_0x2401dc[_0xae54('0x25')]||'';this[_0xae54('0x26')]=_0x2401dc[_0xae54('0x26')];}module[_0xae54('0x27')]=AgentComplete; \ No newline at end of file diff --git a/server/services/ami/dialer/models/final.js b/server/services/ami/dialer/models/final.js index 56a1349..82ac8ec 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 _0x1c8f=['countmachineretry','countagentrejectretry','calleridname','calleridnum','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','state','statedesc','uniqueid','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry'];(function(_0x13730c,_0x4b3ec6){var _0x409e22=function(_0x30a186){while(--_0x30a186){_0x13730c['push'](_0x13730c['shift']());}};_0x409e22(++_0x4b3ec6);}(_0x1c8f,0x1c7));var _0xf1c8=function(_0x590492,_0x255a6f){_0x590492=_0x590492-0x0;var _0x559670=_0x1c8f[_0x590492];return _0x559670;};'use strict';function Final(_0x8f7cad){this[_0xf1c8('0x0')]=_0x8f7cad[_0xf1c8('0x0')];this[_0xf1c8('0x1')]=_0x8f7cad[_0xf1c8('0x1')];this[_0xf1c8('0x2')]=_0x8f7cad[_0xf1c8('0x2')];this[_0xf1c8('0x3')]=_0x8f7cad[_0xf1c8('0x2')]===_0xf1c8('0x4')?_0xf1c8('0x5'):_0x8f7cad[_0xf1c8('0x2')];this[_0xf1c8('0x6')]=_0x8f7cad[_0xf1c8('0x6')];this[_0xf1c8('0x7')]=_0x8f7cad[_0xf1c8('0x7')];this[_0xf1c8('0x8')]=_0x8f7cad[_0xf1c8('0x8')];this[_0xf1c8('0x9')]=_0x8f7cad[_0xf1c8('0x6')]+_0x8f7cad[_0xf1c8('0x7')]+_0x8f7cad[_0xf1c8('0x8')]+_0x8f7cad[_0xf1c8('0xa')]+_0x8f7cad[_0xf1c8('0xb')]+_0x8f7cad[_0xf1c8('0xc')]+_0x8f7cad[_0xf1c8('0xd')]+_0x8f7cad[_0xf1c8('0xe')];this['countnosuchnumberretry']=_0x8f7cad[_0xf1c8('0xa')];this['countdropretry']=_0x8f7cad['countdropretry'];this['countabandonedretry']=_0x8f7cad[_0xf1c8('0xc')];this['countmachineretry']=_0x8f7cad[_0xf1c8('0xd')];this[_0xf1c8('0xe')]=_0x8f7cad[_0xf1c8('0xe')];this[_0xf1c8('0x5')]=_0x8f7cad[_0xf1c8('0x5')];this[_0xf1c8('0xf')]=_0x8f7cad[_0xf1c8('0xf')];this[_0xf1c8('0x10')]=_0x8f7cad[_0xf1c8('0x10')];this[_0xf1c8('0x11')]=_0x8f7cad['starttime'];this[_0xf1c8('0x12')]=_0x8f7cad[_0xf1c8('0x12')];this[_0xf1c8('0x13')]=_0x8f7cad['responsetime'];this['ringtime']=_0x8f7cad[_0xf1c8('0x14')]||0x0;this[_0xf1c8('0x15')]=_0x8f7cad[_0xf1c8('0x15')]||0x0;this[_0xf1c8('0x16')]=_0x8f7cad['talktime']||0x0;this[_0xf1c8('0x17')]=_0x8f7cad[_0xf1c8('0x17')];this[_0xf1c8('0x18')]=_0x8f7cad[_0xf1c8('0x18')];this['callbackat']=_0x8f7cad[_0xf1c8('0x19')];this['recallme']=_0x8f7cad[_0xf1c8('0x1a')];this[_0xf1c8('0x1b')]=_0x8f7cad['ContactId'];this[_0xf1c8('0x1c')]=_0x8f7cad[_0xf1c8('0x1c')];this[_0xf1c8('0x1d')]=_0x8f7cad[_0xf1c8('0x1d')];this[_0xf1c8('0x1e')]=_0x8f7cad['VoiceQueueId'];this[_0xf1c8('0x1f')]=_0x8f7cad[_0xf1c8('0x1f')];this[_0xf1c8('0x20')]=_0x8f7cad['originatecalleridnum']||'';this['originatecalleridname']=_0x8f7cad[_0xf1c8('0x21')]||'';this[_0xf1c8('0x22')]=_0x8f7cad['state'];this[_0xf1c8('0x23')]=_0x8f7cad[_0xf1c8('0x23')];}module['exports']=Final; \ No newline at end of file +var _0x2478=['UserId','CampaignId','originatecalleridnum','originatecalleridname','state','statedesc','exports','uniqueid','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countabandonedretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','countdropretry','calleridname','calleridnum','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId'];(function(_0x4e488e,_0x419800){var _0x591cc7=function(_0x24b940){while(--_0x24b940){_0x4e488e['push'](_0x4e488e['shift']());}};_0x591cc7(++_0x419800);}(_0x2478,0xfc));var _0x8247=function(_0x263a74,_0xc31414){_0x263a74=_0x263a74-0x0;var _0x2aa86c=_0x2478[_0x263a74];return _0x2aa86c;};'use strict';function Final(_0x19907a){this[_0x8247('0x0')]=_0x19907a[_0x8247('0x0')];this[_0x8247('0x1')]=_0x19907a[_0x8247('0x1')];this[_0x8247('0x2')]=_0x19907a[_0x8247('0x2')];this[_0x8247('0x3')]=_0x19907a[_0x8247('0x2')]===_0x8247('0x4')?_0x8247('0x5'):_0x19907a['type'];this[_0x8247('0x6')]=_0x19907a[_0x8247('0x6')];this[_0x8247('0x7')]=_0x19907a['countcongestionretry'];this['countnoanswerretry']=_0x19907a[_0x8247('0x8')];this['countglobal']=_0x19907a['countbusyretry']+_0x19907a['countcongestionretry']+_0x19907a[_0x8247('0x8')]+_0x19907a['countnosuchnumberretry']+_0x19907a['countdropretry']+_0x19907a[_0x8247('0x9')]+_0x19907a[_0x8247('0xa')]+_0x19907a[_0x8247('0xb')];this[_0x8247('0xc')]=_0x19907a['countnosuchnumberretry'];this[_0x8247('0xd')]=_0x19907a[_0x8247('0xd')];this[_0x8247('0x9')]=_0x19907a[_0x8247('0x9')];this[_0x8247('0xa')]=_0x19907a[_0x8247('0xa')];this['countagentrejectretry']=_0x19907a[_0x8247('0xb')];this[_0x8247('0x5')]=_0x19907a[_0x8247('0x5')];this[_0x8247('0xe')]=_0x19907a[_0x8247('0xe')];this[_0x8247('0xf')]=_0x19907a[_0x8247('0xf')];this['starttime']=_0x19907a[_0x8247('0x10')];this[_0x8247('0x11')]=_0x19907a['responsetime'];this[_0x8247('0x12')]=_0x19907a[_0x8247('0x11')];this[_0x8247('0x13')]=_0x19907a[_0x8247('0x13')]||0x0;this[_0x8247('0x14')]=_0x19907a[_0x8247('0x14')]||0x0;this['talktime']=_0x19907a[_0x8247('0x15')]||0x0;this['callback']=_0x19907a[_0x8247('0x16')];this[_0x8247('0x17')]=_0x19907a[_0x8247('0x17')];this[_0x8247('0x18')]=_0x19907a[_0x8247('0x18')];this[_0x8247('0x19')]=_0x19907a[_0x8247('0x19')];this[_0x8247('0x1a')]=_0x19907a['ContactId'];this[_0x8247('0x1b')]=_0x19907a[_0x8247('0x1b')];this[_0x8247('0x1c')]=_0x19907a[_0x8247('0x1c')];this['VoiceQueueId']=_0x19907a['VoiceQueueId'];this[_0x8247('0x1d')]=_0x19907a[_0x8247('0x1d')];this[_0x8247('0x1e')]=_0x19907a[_0x8247('0x1e')]||'';this[_0x8247('0x1f')]=_0x19907a[_0x8247('0x1f')]||'';this[_0x8247('0x20')]=_0x19907a[_0x8247('0x20')];this['statedesc']=_0x19907a[_0x8247('0x21')];}module[_0x8247('0x22')]=Final; \ No newline at end of file diff --git a/server/services/ami/dialer/models/hangup.js b/server/services/ami/dialer/models/hangup.js index 93a737b..e4ce831 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 _0x7f97=['countmachineretry','countdropretry','countabandonedretry','countagentrejectretry','uniqueid','calleridname','name','number','starttime','responsetime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','getSeconds','talktime','membername','reason','cause-txt','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','exports','../utils','state','statedesc','Answer','scheduledat','type','outbound','queue','amd','countcongestionretry','countnoanswerretry','countglobal','countbusyretry','countnosuchnumberretry'];(function(_0x5f1617,_0x46277b){var _0x3af5da=function(_0x15b934){while(--_0x15b934){_0x5f1617['push'](_0x5f1617['shift']());}};_0x3af5da(++_0x46277b);}(_0x7f97,0x16c));var _0x77f9=function(_0x332224,_0x4125eb){_0x332224=_0x332224-0x0;var _0x99b704=_0x7f97[_0x332224];return _0x99b704;};'use strict';var moment=require('moment');var utils=require(_0x77f9('0x0'));function Hangup(_0x11e017,_0x55b0b6){this[_0x77f9('0x1')]=0x4;this[_0x77f9('0x2')]=_0x77f9('0x3');this['scheduledat']=_0x11e017[_0x77f9('0x4')];this[_0x77f9('0x5')]=_0x11e017[_0x77f9('0x5')];this['campaigntype']=_0x11e017[_0x77f9('0x5')]===_0x77f9('0x6')?_0x77f9('0x7'):_0x11e017[_0x77f9('0x5')];this[_0x77f9('0x8')]=_0x11e017[_0x77f9('0x8')]||![];this['countbusyretry']=_0x11e017['countbusyretry'];this[_0x77f9('0x9')]=_0x11e017['countcongestionretry'];this[_0x77f9('0xa')]=_0x11e017[_0x77f9('0xa')];this[_0x77f9('0xb')]=_0x11e017[_0x77f9('0xc')]+_0x11e017[_0x77f9('0x9')]+_0x11e017[_0x77f9('0xa')]+_0x11e017[_0x77f9('0xd')]+_0x11e017['countdropretry']+_0x11e017['countabandonedretry']+_0x11e017[_0x77f9('0xe')]+_0x11e017['countagentrejectretry'];this['countnosuchnumberretry']=_0x11e017[_0x77f9('0xd')];this['countdropretry']=_0x11e017[_0x77f9('0xf')];this[_0x77f9('0x10')]=_0x11e017['countabandonedretry'];this[_0x77f9('0xe')]=_0x11e017['countmachineretry'];this[_0x77f9('0x11')]=_0x11e017[_0x77f9('0x11')];this[_0x77f9('0x12')]=_0x55b0b6[_0x77f9('0x12')];this[_0x77f9('0x13')]=_0x11e017[_0x77f9('0x14')];this['calleridnum']=_0x11e017[_0x77f9('0x15')];this[_0x77f9('0x16')]=_0x11e017[_0x77f9('0x16')];this[_0x77f9('0x17')]=_0x11e017[_0x77f9('0x17')];this[_0x77f9('0x18')]=moment()[_0x77f9('0x19')](_0x77f9('0x1a'));this[_0x77f9('0x1b')]=utils[_0x77f9('0x1c')](_0x11e017[_0x77f9('0x17')],_0x11e017['starttime']);this['holdtime']=0x0;this[_0x77f9('0x1d')]=utils[_0x77f9('0x1c')](this[_0x77f9('0x18')],_0x11e017[_0x77f9('0x17')]);this[_0x77f9('0x7')]=_0x11e017[_0x77f9('0x7')];this[_0x77f9('0x1e')]='IVR';this[_0x77f9('0x1f')]=_0x55b0b6[_0x77f9('0x20')];this[_0x77f9('0x21')]=_0x11e017[_0x77f9('0x21')];this['callbackuniqueid']=_0x11e017[_0x77f9('0x22')];this[_0x77f9('0x23')]=_0x11e017[_0x77f9('0x23')];this['recallme']=_0x11e017[_0x77f9('0x24')];this[_0x77f9('0x25')]=_0x11e017[_0x77f9('0x25')];this[_0x77f9('0x26')]=_0x11e017[_0x77f9('0x26')];this['UserId']=_0x11e017[_0x77f9('0x27')];this[_0x77f9('0x28')]=_0x11e017[_0x77f9('0x28')];this['CampaignId']=_0x11e017['CampaignId'];}module[_0x77f9('0x29')]=Hangup; \ No newline at end of file +var _0xb222=['outbound','queue','amd','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','calleridnum','number','starttime','responsetime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','holdtime','talktime','getSeconds','endtime','IVR','reason','cause-txt','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','exports','moment','../utils','state','Answer','scheduledat','type','campaigntype'];(function(_0x45967a,_0x474c44){var _0xf97e90=function(_0x207c36){while(--_0x207c36){_0x45967a['push'](_0x45967a['shift']());}};_0xf97e90(++_0x474c44);}(_0xb222,0xd5));var _0x2b22=function(_0x456d11,_0x5ed335){_0x456d11=_0x456d11-0x0;var _0x8e0ccd=_0xb222[_0x456d11];return _0x8e0ccd;};'use strict';var moment=require(_0x2b22('0x0'));var utils=require(_0x2b22('0x1'));function Hangup(_0xcec89e,_0x5531e6){this[_0x2b22('0x2')]=0x4;this['statedesc']=_0x2b22('0x3');this[_0x2b22('0x4')]=_0xcec89e[_0x2b22('0x4')];this[_0x2b22('0x5')]=_0xcec89e['type'];this[_0x2b22('0x6')]=_0xcec89e[_0x2b22('0x5')]===_0x2b22('0x7')?_0x2b22('0x8'):_0xcec89e['type'];this[_0x2b22('0x9')]=_0xcec89e[_0x2b22('0x9')]||![];this['countbusyretry']=_0xcec89e[_0x2b22('0xa')];this[_0x2b22('0xb')]=_0xcec89e[_0x2b22('0xb')];this['countnoanswerretry']=_0xcec89e[_0x2b22('0xc')];this['countglobal']=_0xcec89e['countbusyretry']+_0xcec89e[_0x2b22('0xb')]+_0xcec89e['countnoanswerretry']+_0xcec89e[_0x2b22('0xd')]+_0xcec89e[_0x2b22('0xe')]+_0xcec89e[_0x2b22('0xf')]+_0xcec89e[_0x2b22('0x10')]+_0xcec89e[_0x2b22('0x11')];this[_0x2b22('0xd')]=_0xcec89e[_0x2b22('0xd')];this['countdropretry']=_0xcec89e[_0x2b22('0xe')];this[_0x2b22('0xf')]=_0xcec89e['countabandonedretry'];this[_0x2b22('0x10')]=_0xcec89e[_0x2b22('0x10')];this[_0x2b22('0x11')]=_0xcec89e['countagentrejectretry'];this[_0x2b22('0x12')]=_0x5531e6[_0x2b22('0x12')];this[_0x2b22('0x13')]=_0xcec89e['name'];this[_0x2b22('0x14')]=_0xcec89e[_0x2b22('0x15')];this[_0x2b22('0x16')]=_0xcec89e[_0x2b22('0x16')];this[_0x2b22('0x17')]=_0xcec89e[_0x2b22('0x17')];this['endtime']=moment()[_0x2b22('0x18')](_0x2b22('0x19'));this[_0x2b22('0x1a')]=utils['getSeconds'](_0xcec89e[_0x2b22('0x17')],_0xcec89e[_0x2b22('0x16')]);this[_0x2b22('0x1b')]=0x0;this[_0x2b22('0x1c')]=utils[_0x2b22('0x1d')](this[_0x2b22('0x1e')],_0xcec89e['responsetime']);this[_0x2b22('0x8')]=_0xcec89e['queue'];this['membername']=_0x2b22('0x1f');this[_0x2b22('0x20')]=_0x5531e6[_0x2b22('0x21')];this[_0x2b22('0x22')]=_0xcec89e[_0x2b22('0x22')];this['callbackuniqueid']=_0xcec89e[_0x2b22('0x23')];this[_0x2b22('0x24')]=_0xcec89e['callbackat'];this[_0x2b22('0x25')]=_0xcec89e[_0x2b22('0x25')];this['ContactId']=_0xcec89e[_0x2b22('0x26')];this[_0x2b22('0x27')]=_0xcec89e['ListId'];this[_0x2b22('0x28')]=_0xcec89e[_0x2b22('0x28')];this[_0x2b22('0x29')]=_0xcec89e[_0x2b22('0x29')];this[_0x2b22('0x2a')]=_0xcec89e['CampaignId'];}module[_0x2b22('0x2b')]=Hangup; \ No newline at end of file diff --git a/server/services/ami/dialer/models/history.js b/server/services/ami/dialer/models/history.js index 6c3deef..34aba42 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 _0x692c=['countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','name','number','starttime','responsetime','endtime','getSeconds','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','state','statedesc','uniqueid','scheduledat','type','campaigntype','outbound','queue'];(function(_0x5e8fc,_0x1ccc06){var _0x41c58c=function(_0x495f2c){while(--_0x495f2c){_0x5e8fc['push'](_0x5e8fc['shift']());}};_0x41c58c(++_0x1ccc06);}(_0x692c,0x186));var _0xc692=function(_0x3aa7b5,_0x428426){_0x3aa7b5=_0x3aa7b5-0x0;var _0x5c4332=_0x692c[_0x3aa7b5];return _0x5c4332;};'use strict';var utils=require('../utils');function History(_0x5398b1){this[_0xc692('0x0')]=_0x5398b1[_0xc692('0x0')];this[_0xc692('0x1')]=_0x5398b1['scheduledat']||undefined;this[_0xc692('0x2')]=_0x5398b1['type'];this[_0xc692('0x3')]=_0x5398b1['type']===_0xc692('0x4')?_0xc692('0x5'):_0x5398b1[_0xc692('0x2')];this[_0xc692('0x6')]=_0x5398b1[_0xc692('0x6')];this[_0xc692('0x7')]=_0x5398b1['countcongestionretry'];this[_0xc692('0x8')]=_0x5398b1['countnoanswerretry'];this[_0xc692('0x9')]=_0x5398b1[_0xc692('0x6')]+_0x5398b1[_0xc692('0x7')]+_0x5398b1[_0xc692('0x8')]+_0x5398b1[_0xc692('0xa')]+_0x5398b1[_0xc692('0xb')]+_0x5398b1[_0xc692('0xc')]+_0x5398b1[_0xc692('0xd')]+_0x5398b1[_0xc692('0xe')];this[_0xc692('0xa')]=_0x5398b1[_0xc692('0xa')];this[_0xc692('0xb')]=_0x5398b1[_0xc692('0xb')];this[_0xc692('0xc')]=_0x5398b1[_0xc692('0xc')];this['countmachineretry']=_0x5398b1[_0xc692('0xd')];this[_0xc692('0xe')]=_0x5398b1[_0xc692('0xe')];this[_0xc692('0x5')]=_0x5398b1[_0xc692('0x5')];this['calleridname']=_0x5398b1[_0xc692('0xf')];this['calleridnum']=_0x5398b1[_0xc692('0x10')];this[_0xc692('0x11')]=_0x5398b1[_0xc692('0x11')];this[_0xc692('0x12')]=_0x5398b1[_0xc692('0x12')];this[_0xc692('0x13')]=_0x5398b1['responsetime'];this['ringtime']=utils[_0xc692('0x14')](_0x5398b1[_0xc692('0x12')],_0x5398b1[_0xc692('0x11')]);this[_0xc692('0x15')]=0x0;this[_0xc692('0x16')]=0x0;this[_0xc692('0x17')]=_0x5398b1[_0xc692('0x17')];this[_0xc692('0x18')]=_0x5398b1[_0xc692('0x18')];this[_0xc692('0x19')]=_0x5398b1[_0xc692('0x19')];this[_0xc692('0x1a')]=_0x5398b1[_0xc692('0x1a')];this[_0xc692('0x1b')]=_0x5398b1[_0xc692('0x1b')];this[_0xc692('0x1c')]=_0x5398b1[_0xc692('0x1c')];this[_0xc692('0x1d')]=_0x5398b1['UserId'];this[_0xc692('0x1e')]=_0x5398b1[_0xc692('0x1e')];this[_0xc692('0x1f')]=_0x5398b1[_0xc692('0x1f')];this['originatecalleridnum']=_0x5398b1[_0xc692('0x20')]||'';this[_0xc692('0x21')]=_0x5398b1[_0xc692('0x21')]||'';this[_0xc692('0x22')]=_0x5398b1['state'];this[_0xc692('0x23')]=_0x5398b1[_0xc692('0x23')];}module['exports']=History; \ No newline at end of file +var _0xf83f=['type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countglobal','countnosuchnumberretry','countabandonedretry','countmachineretry','countagentrejectretry','countdropretry','calleridname','starttime','responsetime','endtime','getSeconds','holdtime','talktime','callback','callbackuniqueid','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','state','statedesc','uniqueid'];(function(_0x4154a6,_0x2c0b8e){var _0x3b2786=function(_0x2f5936){while(--_0x2f5936){_0x4154a6['push'](_0x4154a6['shift']());}};_0x3b2786(++_0x2c0b8e);}(_0xf83f,0xdf));var _0xff83=function(_0xd95a83,_0x3372bf){_0xd95a83=_0xd95a83-0x0;var _0x1f0a3e=_0xf83f[_0xd95a83];return _0x1f0a3e;};'use strict';var utils=require('../utils');function History(_0xf58451){this['uniqueid']=_0xf58451[_0xff83('0x0')];this['scheduledat']=_0xf58451['scheduledat']||undefined;this[_0xff83('0x1')]=_0xf58451['type'];this[_0xff83('0x2')]=_0xf58451['type']===_0xff83('0x3')?_0xff83('0x4'):_0xf58451[_0xff83('0x1')];this[_0xff83('0x5')]=_0xf58451['countbusyretry'];this[_0xff83('0x6')]=_0xf58451[_0xff83('0x6')];this['countnoanswerretry']=_0xf58451['countnoanswerretry'];this[_0xff83('0x7')]=_0xf58451[_0xff83('0x5')]+_0xf58451['countcongestionretry']+_0xf58451['countnoanswerretry']+_0xf58451[_0xff83('0x8')]+_0xf58451['countdropretry']+_0xf58451[_0xff83('0x9')]+_0xf58451[_0xff83('0xa')]+_0xf58451[_0xff83('0xb')];this[_0xff83('0x8')]=_0xf58451[_0xff83('0x8')];this['countdropretry']=_0xf58451[_0xff83('0xc')];this['countabandonedretry']=_0xf58451[_0xff83('0x9')];this['countmachineretry']=_0xf58451[_0xff83('0xa')];this[_0xff83('0xb')]=_0xf58451['countagentrejectretry'];this[_0xff83('0x4')]=_0xf58451[_0xff83('0x4')];this[_0xff83('0xd')]=_0xf58451['name'];this['calleridnum']=_0xf58451['number'];this[_0xff83('0xe')]=_0xf58451['starttime'];this[_0xff83('0xf')]=_0xf58451[_0xff83('0xf')];this[_0xff83('0x10')]=_0xf58451[_0xff83('0xf')];this['ringtime']=utils[_0xff83('0x11')](_0xf58451[_0xff83('0xf')],_0xf58451['starttime']);this[_0xff83('0x12')]=0x0;this[_0xff83('0x13')]=0x0;this['callback']=_0xf58451[_0xff83('0x14')];this['callbackuniqueid']=_0xf58451[_0xff83('0x15')];this['callbackat']=_0xf58451['callbackat'];this[_0xff83('0x16')]=_0xf58451[_0xff83('0x16')];this[_0xff83('0x17')]=_0xf58451['ContactId'];this[_0xff83('0x18')]=_0xf58451['ListId'];this[_0xff83('0x19')]=_0xf58451[_0xff83('0x19')];this[_0xff83('0x1a')]=_0xf58451[_0xff83('0x1a')];this[_0xff83('0x1b')]=_0xf58451['CampaignId'];this['originatecalleridnum']=_0xf58451[_0xff83('0x1c')]||'';this[_0xff83('0x1d')]=_0xf58451['originatecalleridname']||'';this[_0xff83('0x1e')]=_0xf58451[_0xff83('0x1e')];this[_0xff83('0x1f')]=_0xf58451[_0xff83('0x1f')];}module['exports']=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 16dc753..a73d6e4 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 _0x45de=['countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','uniqueid','calleridname','calleridnum','number','starttime','responsetime','droptime','dropreason','endtime','holdtime','getSeconds','talktime','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','agiafterat','state','exports','../utils','scheduledat','type','campaigntype','outbound','queue'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0x45de,0x78));var _0xe45d=function(_0x422905,_0x3bce3a){_0x422905=_0x422905-0x0;var _0x33dc6c=_0x45de[_0x422905];return _0x33dc6c;};'use strict';var utils=require(_0xe45d('0x0'));function QueueCallerAbandon(_0x11e50b,_0x27df38){this[_0xe45d('0x1')]=_0x11e50b[_0xe45d('0x1')];this[_0xe45d('0x2')]=_0x11e50b[_0xe45d('0x2')];this[_0xe45d('0x3')]=_0x11e50b[_0xe45d('0x2')]===_0xe45d('0x4')?_0xe45d('0x5'):_0x11e50b[_0xe45d('0x2')];this[_0xe45d('0x6')]=_0x11e50b['countbusyretry'];this[_0xe45d('0x7')]=_0x11e50b[_0xe45d('0x7')];this['countnoanswerretry']=_0x11e50b[_0xe45d('0x8')];this[_0xe45d('0x9')]=_0x11e50b[_0xe45d('0x6')]+_0x11e50b[_0xe45d('0x7')]+_0x11e50b[_0xe45d('0x8')]+_0x11e50b['countnosuchnumberretry']+_0x11e50b[_0xe45d('0xa')]+_0x11e50b[_0xe45d('0xb')]+_0x11e50b[_0xe45d('0xc')]+_0x11e50b[_0xe45d('0xd')];this[_0xe45d('0xe')]=_0x11e50b['countnosuchnumberretry'];this[_0xe45d('0xa')]=_0x11e50b['countdropretry'];this['countabandonedretry']=_0x11e50b[_0xe45d('0xb')];this[_0xe45d('0xc')]=_0x11e50b[_0xe45d('0xc')];this[_0xe45d('0xd')]=_0x11e50b[_0xe45d('0xd')];this[_0xe45d('0xf')]=_0x27df38[_0xe45d('0xf')];this[_0xe45d('0x10')]=_0x11e50b['name'];this[_0xe45d('0x11')]=_0x11e50b[_0xe45d('0x12')];this[_0xe45d('0x13')]=_0x11e50b[_0xe45d('0x13')];this[_0xe45d('0x14')]=_0x11e50b[_0xe45d('0x14')];this[_0xe45d('0x15')]=_0x11e50b[_0xe45d('0x15')];this[_0xe45d('0x16')]=_0x11e50b[_0xe45d('0x16')];this[_0xe45d('0x17')]=this[_0xe45d('0x15')];this['ringtime']=utils['getSeconds'](_0x11e50b[_0xe45d('0x14')],_0x11e50b['starttime']);this[_0xe45d('0x18')]=utils[_0xe45d('0x19')](this[_0xe45d('0x15')],_0x11e50b['responsetime']);this[_0xe45d('0x1a')]=0x0;this[_0xe45d('0x5')]=_0x27df38[_0xe45d('0x5')];this['membername']=_0x27df38['connectedlinename'];this[_0xe45d('0x1b')]=_0x27df38[_0xe45d('0x1b')];this[_0xe45d('0x1c')]=_0x11e50b[_0xe45d('0x1c')];this[_0xe45d('0x1d')]=_0x11e50b[_0xe45d('0x1d')];this[_0xe45d('0x1e')]=_0x11e50b['callbackat'];this[_0xe45d('0x1f')]=_0x11e50b[_0xe45d('0x1f')];this[_0xe45d('0x20')]=_0x11e50b[_0xe45d('0x20')];this[_0xe45d('0x21')]=_0x11e50b[_0xe45d('0x21')];this['UserId']=_0x11e50b[_0xe45d('0x22')];this[_0xe45d('0x23')]=_0x11e50b[_0xe45d('0x23')];this[_0xe45d('0x24')]=_0x11e50b[_0xe45d('0x24')];this[_0xe45d('0x25')]=_0x11e50b[_0xe45d('0x25')]||'';this['originatecalleridname']=_0x11e50b[_0xe45d('0x26')]||'';this['agiafterat']=_0x11e50b[_0xe45d('0x27')];this[_0xe45d('0x28')]=_0x11e50b[_0xe45d('0x28')];this['statedesc']=_0x11e50b['statedesc'];}module[_0xe45d('0x29')]=QueueCallerAbandon; \ No newline at end of file +var _0xb398=['CampaignId','originatecalleridnum','originatecalleridname','agiafterat','state','statedesc','../utils','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','countmachineretry','uniqueid','calleridname','name','calleridnum','starttime','responsetime','droptime','dropreason','endtime','ringtime','getSeconds','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId'];(function(_0x58e0ad,_0x58a825){var _0x33dffe=function(_0x28a71b){while(--_0x28a71b){_0x58e0ad['push'](_0x58e0ad['shift']());}};_0x33dffe(++_0x58a825);}(_0xb398,0x1a0));var _0x8b39=function(_0x138aad,_0x20e4e8){_0x138aad=_0x138aad-0x0;var _0x463e76=_0xb398[_0x138aad];return _0x463e76;};'use strict';var utils=require(_0x8b39('0x0'));function QueueCallerAbandon(_0x215ec6,_0x4078f3){this[_0x8b39('0x1')]=_0x215ec6[_0x8b39('0x1')];this[_0x8b39('0x2')]=_0x215ec6[_0x8b39('0x2')];this[_0x8b39('0x3')]=_0x215ec6[_0x8b39('0x2')]===_0x8b39('0x4')?_0x8b39('0x5'):_0x215ec6[_0x8b39('0x2')];this['countbusyretry']=_0x215ec6[_0x8b39('0x6')];this['countcongestionretry']=_0x215ec6[_0x8b39('0x7')];this['countnoanswerretry']=_0x215ec6[_0x8b39('0x8')];this[_0x8b39('0x9')]=_0x215ec6[_0x8b39('0x6')]+_0x215ec6[_0x8b39('0x7')]+_0x215ec6[_0x8b39('0x8')]+_0x215ec6[_0x8b39('0xa')]+_0x215ec6[_0x8b39('0xb')]+_0x215ec6[_0x8b39('0xc')]+_0x215ec6['countmachineretry']+_0x215ec6[_0x8b39('0xd')];this[_0x8b39('0xa')]=_0x215ec6[_0x8b39('0xa')];this[_0x8b39('0xb')]=_0x215ec6[_0x8b39('0xb')];this['countabandonedretry']=_0x215ec6[_0x8b39('0xc')];this[_0x8b39('0xe')]=_0x215ec6['countmachineretry'];this['countagentrejectretry']=_0x215ec6['countagentrejectretry'];this[_0x8b39('0xf')]=_0x4078f3[_0x8b39('0xf')];this[_0x8b39('0x10')]=_0x215ec6[_0x8b39('0x11')];this[_0x8b39('0x12')]=_0x215ec6['number'];this[_0x8b39('0x13')]=_0x215ec6[_0x8b39('0x13')];this['responsetime']=_0x215ec6[_0x8b39('0x14')];this[_0x8b39('0x15')]=_0x215ec6[_0x8b39('0x15')];this[_0x8b39('0x16')]=_0x215ec6[_0x8b39('0x16')];this[_0x8b39('0x17')]=this['droptime'];this[_0x8b39('0x18')]=utils[_0x8b39('0x19')](_0x215ec6['responsetime'],_0x215ec6[_0x8b39('0x13')]);this['holdtime']=utils[_0x8b39('0x19')](this[_0x8b39('0x15')],_0x215ec6['responsetime']);this['talktime']=0x0;this['queue']=_0x4078f3[_0x8b39('0x5')];this['membername']=_0x4078f3['connectedlinename'];this['reason']=_0x4078f3[_0x8b39('0x1a')];this[_0x8b39('0x1b')]=_0x215ec6['callback'];this[_0x8b39('0x1c')]=_0x215ec6[_0x8b39('0x1c')];this[_0x8b39('0x1d')]=_0x215ec6[_0x8b39('0x1d')];this[_0x8b39('0x1e')]=_0x215ec6[_0x8b39('0x1e')];this[_0x8b39('0x1f')]=_0x215ec6[_0x8b39('0x1f')];this[_0x8b39('0x20')]=_0x215ec6[_0x8b39('0x20')];this[_0x8b39('0x21')]=_0x215ec6[_0x8b39('0x21')];this['VoiceQueueId']=_0x215ec6[_0x8b39('0x22')];this[_0x8b39('0x23')]=_0x215ec6[_0x8b39('0x23')];this[_0x8b39('0x24')]=_0x215ec6[_0x8b39('0x24')]||'';this['originatecalleridname']=_0x215ec6[_0x8b39('0x25')]||'';this[_0x8b39('0x26')]=_0x215ec6[_0x8b39('0x26')];this[_0x8b39('0x27')]=_0x215ec6['state'];this['statedesc']=_0x215ec6[_0x8b39('0x28')];}module['exports']=QueueCallerAbandon; \ No newline at end of file diff --git a/server/services/ami/dialer/utils/hopper.js b/server/services/ami/dialer/utils/hopper.js index 73f1b14..1996bfc 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 _0xeda8=['avgHandleTime','[avgHandleTime]','createHistory','[createHistory]','util','../../../../config/logger','../../rpc/cmHopper','../../rpc/cmHopperAdditionalPhone','../../rpc/cmHopperBlack','../../rpc/cmHopperHistory','inspect','getContactDialer','dialOrderByScheduledAt','catch','temp','error','[getContactDialer]','[getContactDialerIvr]','countReScheduled','[countReScheduled]','rescheduleContact','unlockContact','[unlockContact]','moveContactManagedDialer','[moveContactManagedDialer]','checkIsBlackList','[checkIsBlackList]','checkIsBlackListIvr','[verifyAdditionalPhone]','verifyAdditionalPhones','swapAdditionalPhones','[swapAdditionalPhone]'];(function(_0x34cd17,_0x19fadb){var _0x43b81a=function(_0x4dd18b){while(--_0x4dd18b){_0x34cd17['push'](_0x34cd17['shift']());}};_0x43b81a(++_0x19fadb);}(_0xeda8,0x104));var _0x8eda=function(_0x1c5996,_0x62416){_0x1c5996=_0x1c5996-0x0;var _0x27e674=_0xeda8[_0x1c5996];return _0x27e674;};'use strict';var util=require(_0x8eda('0x0'));var logger=require(_0x8eda('0x1'))('dialer');var cmHopper=require(_0x8eda('0x2'));var cmHopperAdditionalPhone=require(_0x8eda('0x3'));var cmHopperBlack=require(_0x8eda('0x4'));var cmHopperHistory=require(_0x8eda('0x5'));function inspectError(_0x37ab2c){return util[_0x8eda('0x6')](_0x37ab2c,{'showHidden':![],'depth':null});}function getContactDialer(_0x25b19a,_0x3eb7b1,_0x22dee9){return cmHopper[_0x8eda('0x7')](_0x25b19a['id'],_0x3eb7b1,_0x22dee9,_0x25b19a[_0x8eda('0x8')])[_0x8eda('0x9')](function(_0x4e2ebb){_0x25b19a[_0x8eda('0xa')]=0x0;logger[_0x8eda('0xb')](_0x8eda('0xc'),inspectError(_0x4e2ebb));});}exports[_0x8eda('0x7')]=getContactDialer;function getContactDialerIvr(_0x4be9df,_0x4f7893){return cmHopper['getContactDialerIvr'](_0x4be9df['id'],_0x4f7893,_0x4be9df['dialOrderByScheduledAt'])[_0x8eda('0x9')](function(_0x2d3739){_0x4be9df[_0x8eda('0xa')]=0x0;logger['error'](_0x8eda('0xd'),inspectError(_0x2d3739));});}exports['getContactDialerIvr']=getContactDialerIvr;function countReScheduled(_0x3f34c){return cmHopper[_0x8eda('0xe')](_0x3f34c)[_0x8eda('0x9')](function(_0x1ad3df){logger[_0x8eda('0xb')](_0x8eda('0xf'),inspectError(_0x1ad3df));});}exports[_0x8eda('0xe')]=countReScheduled;function rescheduleContact(_0x24ea76){return cmHopper['rescheduleContact'](_0x24ea76)['catch'](function(_0xe04d90){logger[_0x8eda('0xb')]('[rescheduleContact]',inspectError(_0xe04d90));});}exports[_0x8eda('0x10')]=rescheduleContact;function unlockContact(_0x34b1ee,_0x123905,_0x56ff8a){return cmHopper[_0x8eda('0x11')](_0x34b1ee,_0x123905,_0x56ff8a)['catch'](function(_0xf7d764){logger['error'](_0x8eda('0x12'),inspectError(_0xf7d764));});}exports['unlockContact']=unlockContact;function moveContactManagedDialer(_0x38a6a0){return cmHopper[_0x8eda('0x13')](_0x38a6a0)['catch'](function(_0x5e44b7){logger[_0x8eda('0xb')](_0x8eda('0x14'),inspectError(_0x5e44b7));});}exports[_0x8eda('0x13')]=moveContactManagedDialer;function checkIsBlackList(_0x41abfa){return cmHopperBlack[_0x8eda('0x15')](_0x41abfa)[_0x8eda('0x9')](function(_0x4fb4ee){logger[_0x8eda('0xb')](_0x8eda('0x16'),inspectError(_0x4fb4ee));});}exports[_0x8eda('0x15')]=checkIsBlackList;function checkIsBlackListIvr(_0x279ade){return cmHopperBlack['checkIsBlackListIvr'](_0x279ade)[_0x8eda('0x9')](function(_0x4f8483){logger[_0x8eda('0xb')]('[checkIsBlackListIvr]',inspectError(_0x4f8483));});}exports[_0x8eda('0x17')]=checkIsBlackListIvr;function verifyAdditionalPhones(_0x2dab25,_0x4f3e0a,_0x58e54b){return cmHopperAdditionalPhone['verifyAdditionalPhones'](_0x2dab25,_0x4f3e0a,_0x58e54b)[_0x8eda('0x9')](function(_0x17cae8){logger['error'](_0x8eda('0x18'),inspectError(_0x17cae8));});}exports[_0x8eda('0x19')]=verifyAdditionalPhones;function swapAdditionalPhones(_0x54aa7f,_0x25e955,_0xfa57ca){return cmHopperAdditionalPhone[_0x8eda('0x1a')](_0x54aa7f,_0x25e955,_0xfa57ca)[_0x8eda('0x9')](function(_0x2e42e4){logger['error'](_0x8eda('0x1b'),inspectError(_0x2e42e4));});}exports['swapAdditionalPhones']=swapAdditionalPhones;function avgHandleTime(_0x35310c){return cmHopperHistory[_0x8eda('0x1c')](_0x35310c)[_0x8eda('0x9')](function(_0x567f69){logger[_0x8eda('0xb')](_0x8eda('0x1d'),inspectError(_0x567f69));});}exports[_0x8eda('0x1c')]=avgHandleTime;function createHistory(_0x4cdd2e){return cmHopperHistory[_0x8eda('0x1e')](_0x4cdd2e)[_0x8eda('0x9')](function(_0x5dd315){logger[_0x8eda('0xb')](_0x8eda('0x1f'),inspectError(_0x5dd315));});}exports[_0x8eda('0x1e')]=createHistory; \ No newline at end of file +var _0x33af=['../../rpc/cmHopperHistory','inspect','dialOrderByScheduledAt','catch','temp','error','[getContactDialer]','getContactDialerIvr','[getContactDialerIvr]','countReScheduled','[countReScheduled]','rescheduleContact','[rescheduleContact]','unlockContact','[moveContactManagedDialer]','checkIsBlackList','[checkIsBlackList]','checkIsBlackListIvr','[checkIsBlackListIvr]','verifyAdditionalPhones','[verifyAdditionalPhone]','swapAdditionalPhones','[avgHandleTime]','avgHandleTime','createHistory','[createHistory]','../../../../config/logger','../../rpc/cmHopper','../../rpc/cmHopperAdditionalPhone','../../rpc/cmHopperBlack'];(function(_0x428bdf,_0x26282b){var _0x1db174=function(_0xf61fa1){while(--_0xf61fa1){_0x428bdf['push'](_0x428bdf['shift']());}};_0x1db174(++_0x26282b);}(_0x33af,0xec));var _0xf33a=function(_0x2a453b,_0x479c50){_0x2a453b=_0x2a453b-0x0;var _0x132f79=_0x33af[_0x2a453b];return _0x132f79;};'use strict';var util=require('util');var logger=require(_0xf33a('0x0'))('dialer');var cmHopper=require(_0xf33a('0x1'));var cmHopperAdditionalPhone=require(_0xf33a('0x2'));var cmHopperBlack=require(_0xf33a('0x3'));var cmHopperHistory=require(_0xf33a('0x4'));function inspectError(_0x169f02){return util[_0xf33a('0x5')](_0x169f02,{'showHidden':![],'depth':null});}function getContactDialer(_0x4c734e,_0x433e25,_0x44cfa5){return cmHopper['getContactDialer'](_0x4c734e['id'],_0x433e25,_0x44cfa5,_0x4c734e[_0xf33a('0x6')])[_0xf33a('0x7')](function(_0x1b2b01){_0x4c734e[_0xf33a('0x8')]=0x0;logger[_0xf33a('0x9')](_0xf33a('0xa'),inspectError(_0x1b2b01));});}exports['getContactDialer']=getContactDialer;function getContactDialerIvr(_0x29bb24,_0x14eb0e){return cmHopper[_0xf33a('0xb')](_0x29bb24['id'],_0x14eb0e,_0x29bb24[_0xf33a('0x6')])[_0xf33a('0x7')](function(_0x27f30a){_0x29bb24['temp']=0x0;logger['error'](_0xf33a('0xc'),inspectError(_0x27f30a));});}exports[_0xf33a('0xb')]=getContactDialerIvr;function countReScheduled(_0x170468){return cmHopper[_0xf33a('0xd')](_0x170468)[_0xf33a('0x7')](function(_0x5959c9){logger[_0xf33a('0x9')](_0xf33a('0xe'),inspectError(_0x5959c9));});}exports['countReScheduled']=countReScheduled;function rescheduleContact(_0x506924){return cmHopper[_0xf33a('0xf')](_0x506924)[_0xf33a('0x7')](function(_0x17043){logger[_0xf33a('0x9')](_0xf33a('0x10'),inspectError(_0x17043));});}exports[_0xf33a('0xf')]=rescheduleContact;function unlockContact(_0x45e311,_0x1f2b1b,_0x507cb9){return cmHopper[_0xf33a('0x11')](_0x45e311,_0x1f2b1b,_0x507cb9)['catch'](function(_0x75848d){logger[_0xf33a('0x9')]('[unlockContact]',inspectError(_0x75848d));});}exports[_0xf33a('0x11')]=unlockContact;function moveContactManagedDialer(_0x25c931){return cmHopper['moveContactManagedDialer'](_0x25c931)[_0xf33a('0x7')](function(_0x23d9e2){logger[_0xf33a('0x9')](_0xf33a('0x12'),inspectError(_0x23d9e2));});}exports['moveContactManagedDialer']=moveContactManagedDialer;function checkIsBlackList(_0x11efa0){return cmHopperBlack[_0xf33a('0x13')](_0x11efa0)[_0xf33a('0x7')](function(_0x30e383){logger[_0xf33a('0x9')](_0xf33a('0x14'),inspectError(_0x30e383));});}exports[_0xf33a('0x13')]=checkIsBlackList;function checkIsBlackListIvr(_0x288275){return cmHopperBlack[_0xf33a('0x15')](_0x288275)[_0xf33a('0x7')](function(_0x520dc4){logger[_0xf33a('0x9')](_0xf33a('0x16'),inspectError(_0x520dc4));});}exports[_0xf33a('0x15')]=checkIsBlackListIvr;function verifyAdditionalPhones(_0x27faa1,_0x2ab756,_0x51d3fd){return cmHopperAdditionalPhone[_0xf33a('0x17')](_0x27faa1,_0x2ab756,_0x51d3fd)['catch'](function(_0x492986){logger[_0xf33a('0x9')](_0xf33a('0x18'),inspectError(_0x492986));});}exports[_0xf33a('0x17')]=verifyAdditionalPhones;function swapAdditionalPhones(_0x429b83,_0x4b9801,_0x57cb1d){return cmHopperAdditionalPhone[_0xf33a('0x19')](_0x429b83,_0x4b9801,_0x57cb1d)['catch'](function(_0x4af24a){logger[_0xf33a('0x9')]('[swapAdditionalPhone]',inspectError(_0x4af24a));});}exports['swapAdditionalPhones']=swapAdditionalPhones;function avgHandleTime(_0x38eba2){return cmHopperHistory['avgHandleTime'](_0x38eba2)[_0xf33a('0x7')](function(_0x553480){logger[_0xf33a('0x9')](_0xf33a('0x1a'),inspectError(_0x553480));});}exports[_0xf33a('0x1b')]=avgHandleTime;function createHistory(_0x729fca){return cmHopperHistory[_0xf33a('0x1c')](_0x729fca)[_0xf33a('0x7')](function(_0x1d19ee){logger[_0xf33a('0x9')](_0xf33a('0x1d'),inspectError(_0x1d19ee));});}exports[_0xf33a('0x1c')]=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 cae1bb4..e893a1a 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 _0xce05=['TIMEZONE_UNKNOW','TRUNK_IS_NOT_REACHABLE','CAMPAIGN_STATUS','preview','isPreviewCampaign','type','ivr','isIVRCampaign','outbound','dialActive','active','isIVRCampaignActive','milliseconds','diff','seconds','getSeconds','dialMethod','message','available','loggedIn','loggedInDb','paused','talking','pTalking','waiting','inUse','Trunk','name','hasQueueCampaignDataChanged','dialTimezone','isNil','dialGlobalInterval','Interval','Intervals','NULL_INTERVAL','isEmpty','EMPTY_INTERVAL','UNKNOWN_TIMEZONE','reachable','includes','status','TrunkBackup','INACTIVE','DISACTIVED','NO_AGENTS_LOGGED','originated','getQueueCampaignActiveStatusMessage','match','extractCalleridName','string','isUndefined','\x22%s\x22\x20<%s>','format','\x22\x22\x20<>','getCallerId','\x5cw{0,','pow','replace','random','toString','getCallerIdRandom','error','[decrementOriginate]\x20queue\x20originate\x20value\x20is\x20negative','length','checkContactEmpty','erlangb','checkContactLowerLimitOriginate','description','tags','undefined','%s%s','XMD-','setXMDContactVariables','lodash','util','../../../../config/logger','../../../../config/environment/shared','timezones','ACTIVE','BLACKLIST','IS_DISACTIVED','INTERVAL_IS_EMPTY','AGENTS_NOT_LOGGED','AVAILABLE_CONTACTS_FINISHED','INTERVAL_IS_NULL','INTERVAL_IS_OVERTIME','GLOBAL_INTERVAL_IS_OVERTIME','RECALLINQUEUE','RECALLFAILEDTIMEOUT','RUNNING'];(function(_0x251f84,_0x44ab75){var _0x428797=function(_0x2dbb79){while(--_0x2dbb79){_0x251f84['push'](_0x251f84['shift']());}};_0x428797(++_0x44ab75);}(_0xce05,0xfd));var _0x5ce0=function(_0x10aaad,_0x219e8b){_0x10aaad=_0x10aaad-0x0;var _0x90fcd8=_0xce05[_0x10aaad];return _0x90fcd8;};'use strict';var _=require(_0x5ce0('0x0'));var moment=require('moment');var util=require(_0x5ce0('0x1'));var logger=require(_0x5ce0('0x2'))('dialer');var timezones=require(_0x5ce0('0x3'))[_0x5ce0('0x4')];var CAMPAIGN_STATUS={'ACTIVE':_0x5ce0('0x5'),'BLACKLIST':_0x5ce0('0x6'),'CONTACTS_RESCHEDULED':'RESCHEDULED_CONTACTS','DEACTIVATED':'DEACTIVATED','DISACTIVED':_0x5ce0('0x7'),'EMPTY_INTERVAL':_0x5ce0('0x8'),'INACTIVE':'NOT_ACTIVE','NO_AGENTS_LOGGED':_0x5ce0('0x9'),'NO_AVAILABLE_CONTACTS':_0x5ce0('0xa'),'NULL_INTERVAL':_0x5ce0('0xb'),'OVERTIME_INTERVAL':_0x5ce0('0xc'),'OVERTIME_GLOBAL_INTERVAL':_0x5ce0('0xd'),'QUEUE_RECALL':_0x5ce0('0xe'),'RECALL_TIMEOUT':_0x5ce0('0xf'),'RUNNING':_0x5ce0('0x10'),'UNKNOWN_TIMEZONE':_0x5ce0('0x11'),'UNREACHABLE_TRUNK':_0x5ce0('0x12')};exports[_0x5ce0('0x13')]=CAMPAIGN_STATUS;function isPreviewCampaign(_0x596cd8){return _0x596cd8['dialMethod']===_0x5ce0('0x14');}exports[_0x5ce0('0x15')]=isPreviewCampaign;function isIVRCampaign(_0x5d5c01){return _0x5d5c01[_0x5ce0('0x16')]===_0x5ce0('0x17');}exports[_0x5ce0('0x18')]=isIVRCampaign;function isOutboundQueue(_0x3132a6){return _0x3132a6['type']===_0x5ce0('0x19');}exports['isOutboundQueue']=isOutboundQueue;function isQueueCampaignActive(_0x40e930){return _0x40e930[_0x5ce0('0x1a')];}exports['isQueueCampaignActive']=isQueueCampaignActive;function isIVRCampaignActive(_0x2d8e2e){return _0x2d8e2e[_0x5ce0('0x1b')];}exports[_0x5ce0('0x1c')]=isIVRCampaignActive;function getSeconds(_0x530b04,_0x22e9b9){var _0x25f852=moment(_0x530b04)[_0x5ce0('0x1d')](0x0);var _0x51d074=moment(_0x22e9b9)[_0x5ce0('0x1d')](0x0);return _0x25f852[_0x5ce0('0x1e')](_0x51d074,_0x5ce0('0x1f'));}exports[_0x5ce0('0x20')]=getSeconds;function hasQueueCampaignDataChanged(_0x3261ab,_0x5576fc){var _0x3703ca=![];var _0x12284d=_0x3261ab['dialMethod']!==_0x5576fc[_0x5ce0('0x21')]||_0x3261ab[_0x5ce0('0x1a')]!==_0x5576fc[_0x5ce0('0x1a')]||_0x3261ab[_0x5ce0('0x22')]!==_0x5576fc[_0x5ce0('0x22')];var _0x557e41=_0x3261ab['available']!==_0x5576fc[_0x5ce0('0x23')]||_0x3261ab['loggedIn']!==_0x5576fc[_0x5ce0('0x24')]||_0x3261ab[_0x5ce0('0x25')]!==_0x5576fc['loggedInDb']||_0x3261ab[_0x5ce0('0x26')]!==_0x5576fc[_0x5ce0('0x26')]||_0x3261ab[_0x5ce0('0x27')]!==_0x5576fc[_0x5ce0('0x27')]||_0x3261ab[_0x5ce0('0x28')]!==_0x5576fc[_0x5ce0('0x28')]||_0x3261ab['waiting']!==_0x5576fc[_0x5ce0('0x29')]||_0x3261ab[_0x5ce0('0x2a')]!==_0x5576fc['inUse']||_0x3261ab['originated']!==_0x5576fc['originated'];if(_0x3261ab[_0x5ce0('0x2b')]&&_0x5576fc[_0x5ce0('0x2b')]){_0x3703ca=_0x3261ab[_0x5ce0('0x2b')][_0x5ce0('0x2c')]!==_0x5576fc[_0x5ce0('0x2b')][_0x5ce0('0x2c')]||_0x3261ab[_0x5ce0('0x2b')][_0x5ce0('0x1b')]!==_0x5576fc[_0x5ce0('0x2b')][_0x5ce0('0x1b')];}return _0x12284d||_0x557e41||_0x3703ca;}exports[_0x5ce0('0x2d')]=hasQueueCampaignDataChanged;function checkAnyValidQueueCampaignInterval(_0x32f394){var _0x49b306=null;var _0x421b04=_0x32f394[_0x5ce0('0x2e')];if(_[_0x5ce0('0x2f')](_0x32f394[_0x5ce0('0x30')])||_['isNil'](_0x32f394[_0x5ce0('0x31')])||_['isNil'](_0x32f394[_0x5ce0('0x31')][_0x5ce0('0x32')])){_0x49b306=CAMPAIGN_STATUS[_0x5ce0('0x33')];}else if(_[_0x5ce0('0x34')](_0x32f394[_0x5ce0('0x30')])||_['isEmpty'](_0x32f394[_0x5ce0('0x31')][_0x5ce0('0x32')])){_0x49b306=CAMPAIGN_STATUS[_0x5ce0('0x35')];}else if(_0x421b04&&!timezones[_0x421b04]){_0x49b306=CAMPAIGN_STATUS[_0x5ce0('0x36')];}return _0x49b306;}function checkAnyValidTrunk(_0x2456d3,_0x3bea5a){var _0x1479af=null;var _0x342557='SIP/';var _0x5462c2=[_0x5ce0('0x37'),'unmonitored'];var _0x38d2d2=!![];if(_0x2456d3['Trunk']&&_0x2456d3[_0x5ce0('0x2b')][_0x5ce0('0x1b')]){_0x342557+=_0x2456d3[_0x5ce0('0x2b')]['name'];_0x1479af=_0x3bea5a[_0x342557];_0x38d2d2=_0x5462c2[_0x5ce0('0x38')](_0x1479af[_0x5ce0('0x39')]);}else if(_0x2456d3['TrunkBackup']&&_0x2456d3[_0x5ce0('0x3a')]['active']){_0x342557+=_0x2456d3[_0x5ce0('0x3a')][_0x5ce0('0x2c')];_0x1479af=_0x3bea5a[_0x342557];_0x38d2d2=_0x5462c2[_0x5ce0('0x38')](_0x1479af[_0x5ce0('0x39')]);}return _0x38d2d2;}function getQueueCampaignStatusMessage(_0x1e0948,_0x371b69){var _0x15f073=CAMPAIGN_STATUS['ACTIVE'];var _0x1df919=isPreviewCampaign(_0x1e0948);if(!isQueueCampaignActive(_0x1e0948)){if(_0x1df919){_0x15f073=CAMPAIGN_STATUS[_0x5ce0('0x3b')];}else{if(_0x1e0948['originated']===0x0&&_0x1e0948[_0x5ce0('0x27')]===0x0&&_0x1e0948[_0x5ce0('0x29')]===0x0&&(_0x1e0948[_0x5ce0('0x28')]||0x0)===0x0){_0x15f073=CAMPAIGN_STATUS[_0x5ce0('0x3b')];}else{_0x15f073=CAMPAIGN_STATUS[_0x5ce0('0x3c')];}}}else if(_0x1e0948[_0x5ce0('0x24')]===0x0){_0x15f073=CAMPAIGN_STATUS[_0x5ce0('0x3d')];}else if(!checkAnyValidTrunk(_0x1e0948,_0x371b69)){_0x15f073=CAMPAIGN_STATUS['UNREACHABLE_TRUNK'];}else if(!isPreviewCampaign(_0x1e0948)){var _0x132ef8=checkAnyValidQueueCampaignInterval(_0x1e0948);if(_0x132ef8){_0x15f073=_0x132ef8;}}return _0x15f073;}exports['getQueueCampaignStatusMessage']=getQueueCampaignStatusMessage;function getQueueCampaignActiveStatusMessage(_0xa1628a){var _0x2326db=CAMPAIGN_STATUS['DISACTIVED'];if(_0xa1628a[_0x5ce0('0x3e')]===0x0&&_0xa1628a[_0x5ce0('0x27')]===0x0&&_0xa1628a[_0x5ce0('0x29')]===0x0&&(_0xa1628a[_0x5ce0('0x28')]||0x0)===0x0){_0x2326db=CAMPAIGN_STATUS[_0x5ce0('0x3b')];}return _0x2326db;}exports[_0x5ce0('0x3f')]=getQueueCampaignActiveStatusMessage;function extractCalleridName(_0x147a32){var _0x16bd05=_0x147a32[_0x5ce0('0x40')](/"(.*?)"/);return _0x16bd05?_0x16bd05[0x1]:_0x147a32;}exports[_0x5ce0('0x41')]=extractCalleridName;function getCallerId(_0x583236,_0x4f0abb,_0x43b0de){if(!_['isUndefined'](_0x43b0de)&&typeof _0x43b0de===_0x5ce0('0x42')&&!_['isEmpty'](_0x43b0de)){if(!_[_0x5ce0('0x43')](_0x4f0abb)&&typeof _0x4f0abb==='string'&&!_[_0x5ce0('0x34')](_0x4f0abb)){return util['format'](_0x5ce0('0x44'),_0x4f0abb,_0x43b0de);}return util[_0x5ce0('0x45')](_0x5ce0('0x44'),_0x43b0de,_0x43b0de);}if(!_[_0x5ce0('0x43')](_0x583236)&&typeof _0x583236==='string'&&!_[_0x5ce0('0x34')](_0x583236)){return _0x583236;}return _0x5ce0('0x46');}exports[_0x5ce0('0x47')]=getCallerId;function getCallerIdRandom(_0x23ef31,_0x54df3e){var _0x3c01cb;var _0x82760d;var _0x41c86f;if(_0x54df3e<=0x0){_0x54df3e=0x1;}_0x3c01cb=new RegExp(_0x5ce0('0x48')+_0x54df3e+'}$');_0x82760d=Math[_0x5ce0('0x49')](0xa,_0x54df3e-0x1);_0x41c86f=Math[_0x5ce0('0x49')](0xa,_0x54df3e)-0x1;return util[_0x5ce0('0x45')]('%s',_[_0x5ce0('0x4a')](_0x23ef31,_0x3c01cb,_[_0x5ce0('0x4b')](_0x82760d,_0x41c86f)[_0x5ce0('0x4c')]()));}exports[_0x5ce0('0x4d')]=getCallerIdRandom;function decrementOriginate(_0x3d0b09){if(_0x3d0b09['originated']&&_0x3d0b09[_0x5ce0('0x3e')]>0x0){_0x3d0b09[_0x5ce0('0x3e')]-=0x1;}else{logger[_0x5ce0('0x4e')](_0x5ce0('0x4f'));}}exports['decrementOriginate']=decrementOriginate;function checkContactEmpty(_0x1e10bb){return _0x1e10bb&&_0x1e10bb[_0x5ce0('0x50')]>0x0;}exports[_0x5ce0('0x51')]=checkContactEmpty;function erlangb(_0x2cf3e7,_0x3850d3){if(_0x3850d3===0x0){return 0x0;}var _0x1ca450=0x1;for(var _0x1d675e=0x1;_0x1d675e<=_0x3850d3;_0x1d675e+=0x1){_0x1ca450=0x1+_0x1ca450*_0x1d675e/_0x2cf3e7;}return 0x1/_0x1ca450;}exports[_0x5ce0('0x52')]=erlangb;function checkContactLowerLimitOriginate(_0x509a1a,_0x1ff061,_0x5865fb){if(_0x1ff061>_0x5865fb){for(var _0x80729a=0x0;_0x80729a<_0x1ff061-_0x5865fb;_0x80729a+=0x1){decrementOriginate(_0x509a1a);}}}exports[_0x5ce0('0x53')]=checkContactLowerLimitOriginate;function setXMDContactVariables(_0xd38a02){var _0x356d6b={};var _0x265977=['id','createdAt',_0x5ce0('0x54'),_0x5ce0('0x55'),'updatedAt'];if(_0xd38a02){for(var _0x4b69b2 in _0xd38a02){if(typeof _0xd38a02[_0x4b69b2]!==_0x5ce0('0x56')){if(!_[_0x5ce0('0x2f')](_0xd38a02[_0x4b69b2])&&!_0x265977[_0x5ce0('0x38')](_0x4b69b2)){_0x356d6b[util['format'](_0x5ce0('0x57'),_0x5ce0('0x58'),_0x4b69b2['toUpperCase']())]=_0xd38a02[_0x4b69b2];}}}}return _0x356d6b;}exports[_0x5ce0('0x59')]=setXMDContactVariables; \ No newline at end of file +var _0x24d4=['pTalking','waiting','inUse','Trunk','name','hasQueueCampaignDataChanged','dialTimezone','isNil','Interval','NULL_INTERVAL','isEmpty','dialGlobalInterval','Intervals','EMPTY_INTERVAL','SIP/','includes','status','TrunkBackup','originated','DISACTIVED','UNREACHABLE_TRUNK','getQueueCampaignStatusMessage','INACTIVE','match','string','isUndefined','format','\x22%s\x22\x20<%s>','\x22\x22\x20<>','getCallerId','\x5cw{0,','pow','replace','random','toString','getCallerIdRandom','error','decrementOriginate','length','createdAt','description','tags','updatedAt','%s%s','XMD-','setXMDContactVariables','moment','../../../../config/logger','dialer','../../../../config/environment/shared','timezones','ACTIVE','BLACKLIST','RESCHEDULED_CONTACTS','DEACTIVATED','IS_DISACTIVED','INTERVAL_IS_EMPTY','NOT_ACTIVE','AGENTS_NOT_LOGGED','AVAILABLE_CONTACTS_FINISHED','INTERVAL_IS_NULL','INTERVAL_IS_OVERTIME','GLOBAL_INTERVAL_IS_OVERTIME','RECALLFAILEDTIMEOUT','RUNNING','TIMEZONE_UNKNOW','dialMethod','preview','type','ivr','isIVRCampaign','outbound','isOutboundQueue','dialActive','isQueueCampaignActive','active','isIVRCampaignActive','milliseconds','diff','getSeconds','message','available','loggedIn','loggedInDb','paused','talking'];(function(_0x1ce8d2,_0x17a62c){var _0x2712dc=function(_0x7928e9){while(--_0x7928e9){_0x1ce8d2['push'](_0x1ce8d2['shift']());}};_0x2712dc(++_0x17a62c);}(_0x24d4,0xda));var _0x424d=function(_0x280d43,_0x2e7450){_0x280d43=_0x280d43-0x0;var _0x14446d=_0x24d4[_0x280d43];return _0x14446d;};'use strict';var _=require('lodash');var moment=require(_0x424d('0x0'));var util=require('util');var logger=require(_0x424d('0x1'))(_0x424d('0x2'));var timezones=require(_0x424d('0x3'))[_0x424d('0x4')];var CAMPAIGN_STATUS={'ACTIVE':_0x424d('0x5'),'BLACKLIST':_0x424d('0x6'),'CONTACTS_RESCHEDULED':_0x424d('0x7'),'DEACTIVATED':_0x424d('0x8'),'DISACTIVED':_0x424d('0x9'),'EMPTY_INTERVAL':_0x424d('0xa'),'INACTIVE':_0x424d('0xb'),'NO_AGENTS_LOGGED':_0x424d('0xc'),'NO_AVAILABLE_CONTACTS':_0x424d('0xd'),'NULL_INTERVAL':_0x424d('0xe'),'OVERTIME_INTERVAL':_0x424d('0xf'),'OVERTIME_GLOBAL_INTERVAL':_0x424d('0x10'),'QUEUE_RECALL':'RECALLINQUEUE','RECALL_TIMEOUT':_0x424d('0x11'),'RUNNING':_0x424d('0x12'),'UNKNOWN_TIMEZONE':_0x424d('0x13'),'UNREACHABLE_TRUNK':'TRUNK_IS_NOT_REACHABLE'};exports['CAMPAIGN_STATUS']=CAMPAIGN_STATUS;function isPreviewCampaign(_0x50ec15){return _0x50ec15[_0x424d('0x14')]===_0x424d('0x15');}exports['isPreviewCampaign']=isPreviewCampaign;function isIVRCampaign(_0x5b1a3f){return _0x5b1a3f[_0x424d('0x16')]===_0x424d('0x17');}exports[_0x424d('0x18')]=isIVRCampaign;function isOutboundQueue(_0x2d40f0){return _0x2d40f0[_0x424d('0x16')]===_0x424d('0x19');}exports[_0x424d('0x1a')]=isOutboundQueue;function isQueueCampaignActive(_0x1ed6a4){return _0x1ed6a4[_0x424d('0x1b')];}exports[_0x424d('0x1c')]=isQueueCampaignActive;function isIVRCampaignActive(_0x3ac515){return _0x3ac515[_0x424d('0x1d')];}exports[_0x424d('0x1e')]=isIVRCampaignActive;function getSeconds(_0x69fa50,_0x5b7630){var _0x2c12c7=moment(_0x69fa50)['milliseconds'](0x0);var _0x55e7f9=moment(_0x5b7630)[_0x424d('0x1f')](0x0);return _0x2c12c7[_0x424d('0x20')](_0x55e7f9,'seconds');}exports[_0x424d('0x21')]=getSeconds;function hasQueueCampaignDataChanged(_0x2d08bf,_0x39fcd5){var _0x22737c=![];var _0x10702c=_0x2d08bf[_0x424d('0x14')]!==_0x39fcd5['dialMethod']||_0x2d08bf[_0x424d('0x1b')]!==_0x39fcd5[_0x424d('0x1b')]||_0x2d08bf[_0x424d('0x22')]!==_0x39fcd5[_0x424d('0x22')];var _0x1633df=_0x2d08bf[_0x424d('0x23')]!==_0x39fcd5[_0x424d('0x23')]||_0x2d08bf[_0x424d('0x24')]!==_0x39fcd5[_0x424d('0x24')]||_0x2d08bf[_0x424d('0x25')]!==_0x39fcd5[_0x424d('0x25')]||_0x2d08bf[_0x424d('0x26')]!==_0x39fcd5['paused']||_0x2d08bf[_0x424d('0x27')]!==_0x39fcd5[_0x424d('0x27')]||_0x2d08bf[_0x424d('0x28')]!==_0x39fcd5['pTalking']||_0x2d08bf['waiting']!==_0x39fcd5[_0x424d('0x29')]||_0x2d08bf['inUse']!==_0x39fcd5[_0x424d('0x2a')]||_0x2d08bf['originated']!==_0x39fcd5['originated'];if(_0x2d08bf[_0x424d('0x2b')]&&_0x39fcd5[_0x424d('0x2b')]){_0x22737c=_0x2d08bf[_0x424d('0x2b')][_0x424d('0x2c')]!==_0x39fcd5[_0x424d('0x2b')][_0x424d('0x2c')]||_0x2d08bf[_0x424d('0x2b')]['active']!==_0x39fcd5[_0x424d('0x2b')][_0x424d('0x1d')];}return _0x10702c||_0x1633df||_0x22737c;}exports[_0x424d('0x2d')]=hasQueueCampaignDataChanged;function checkAnyValidQueueCampaignInterval(_0x29e97b){var _0xc20c6f=null;var _0x6adafb=_0x29e97b[_0x424d('0x2e')];if(_[_0x424d('0x2f')](_0x29e97b['dialGlobalInterval'])||_[_0x424d('0x2f')](_0x29e97b[_0x424d('0x30')])||_[_0x424d('0x2f')](_0x29e97b[_0x424d('0x30')]['Intervals'])){_0xc20c6f=CAMPAIGN_STATUS[_0x424d('0x31')];}else if(_[_0x424d('0x32')](_0x29e97b[_0x424d('0x33')])||_[_0x424d('0x32')](_0x29e97b[_0x424d('0x30')][_0x424d('0x34')])){_0xc20c6f=CAMPAIGN_STATUS[_0x424d('0x35')];}else if(_0x6adafb&&!timezones[_0x6adafb]){_0xc20c6f=CAMPAIGN_STATUS['UNKNOWN_TIMEZONE'];}return _0xc20c6f;}function checkAnyValidTrunk(_0x2e59f2,_0x1ef4bd){var _0xe18f99=null;var _0x57c5ec=_0x424d('0x36');var _0x4f6bf7=['reachable','unmonitored'];var _0xf6afaf=!![];if(_0x2e59f2['Trunk']&&_0x2e59f2[_0x424d('0x2b')]['active']){_0x57c5ec+=_0x2e59f2[_0x424d('0x2b')][_0x424d('0x2c')];_0xe18f99=_0x1ef4bd[_0x57c5ec];_0xf6afaf=_0x4f6bf7[_0x424d('0x37')](_0xe18f99[_0x424d('0x38')]);}else if(_0x2e59f2[_0x424d('0x39')]&&_0x2e59f2['TrunkBackup'][_0x424d('0x1d')]){_0x57c5ec+=_0x2e59f2[_0x424d('0x39')][_0x424d('0x2c')];_0xe18f99=_0x1ef4bd[_0x57c5ec];_0xf6afaf=_0x4f6bf7[_0x424d('0x37')](_0xe18f99[_0x424d('0x38')]);}return _0xf6afaf;}function getQueueCampaignStatusMessage(_0x3a2ab3,_0x13311a){var _0x1210b2=CAMPAIGN_STATUS['ACTIVE'];var _0x305401=isPreviewCampaign(_0x3a2ab3);if(!isQueueCampaignActive(_0x3a2ab3)){if(_0x305401){_0x1210b2=CAMPAIGN_STATUS['INACTIVE'];}else{if(_0x3a2ab3[_0x424d('0x3a')]===0x0&&_0x3a2ab3[_0x424d('0x27')]===0x0&&_0x3a2ab3[_0x424d('0x29')]===0x0&&(_0x3a2ab3[_0x424d('0x28')]||0x0)===0x0){_0x1210b2=CAMPAIGN_STATUS['INACTIVE'];}else{_0x1210b2=CAMPAIGN_STATUS[_0x424d('0x3b')];}}}else if(_0x3a2ab3[_0x424d('0x24')]===0x0){_0x1210b2=CAMPAIGN_STATUS['NO_AGENTS_LOGGED'];}else if(!checkAnyValidTrunk(_0x3a2ab3,_0x13311a)){_0x1210b2=CAMPAIGN_STATUS[_0x424d('0x3c')];}else if(!isPreviewCampaign(_0x3a2ab3)){var _0x48a520=checkAnyValidQueueCampaignInterval(_0x3a2ab3);if(_0x48a520){_0x1210b2=_0x48a520;}}return _0x1210b2;}exports[_0x424d('0x3d')]=getQueueCampaignStatusMessage;function getQueueCampaignActiveStatusMessage(_0x4e567b){var _0x1b2f9c=CAMPAIGN_STATUS[_0x424d('0x3b')];if(_0x4e567b[_0x424d('0x3a')]===0x0&&_0x4e567b['talking']===0x0&&_0x4e567b['waiting']===0x0&&(_0x4e567b[_0x424d('0x28')]||0x0)===0x0){_0x1b2f9c=CAMPAIGN_STATUS[_0x424d('0x3e')];}return _0x1b2f9c;}exports['getQueueCampaignActiveStatusMessage']=getQueueCampaignActiveStatusMessage;function extractCalleridName(_0x1b0472){var _0x35184b=_0x1b0472[_0x424d('0x3f')](/"(.*?)"/);return _0x35184b?_0x35184b[0x1]:_0x1b0472;}exports['extractCalleridName']=extractCalleridName;function getCallerId(_0x57470d,_0x4b6b14,_0x58cf7e){if(!_['isUndefined'](_0x58cf7e)&&typeof _0x58cf7e===_0x424d('0x40')&&!_['isEmpty'](_0x58cf7e)){if(!_[_0x424d('0x41')](_0x4b6b14)&&typeof _0x4b6b14==='string'&&!_[_0x424d('0x32')](_0x4b6b14)){return util[_0x424d('0x42')](_0x424d('0x43'),_0x4b6b14,_0x58cf7e);}return util[_0x424d('0x42')]('\x22%s\x22\x20<%s>',_0x58cf7e,_0x58cf7e);}if(!_[_0x424d('0x41')](_0x57470d)&&typeof _0x57470d==='string'&&!_[_0x424d('0x32')](_0x57470d)){return _0x57470d;}return _0x424d('0x44');}exports[_0x424d('0x45')]=getCallerId;function getCallerIdRandom(_0x6aaf2c,_0x1531c7){var _0x335074;var _0x25714d;var _0x21540d;if(_0x1531c7<=0x0){_0x1531c7=0x1;}_0x335074=new RegExp(_0x424d('0x46')+_0x1531c7+'}$');_0x25714d=Math[_0x424d('0x47')](0xa,_0x1531c7-0x1);_0x21540d=Math[_0x424d('0x47')](0xa,_0x1531c7)-0x1;return util['format']('%s',_[_0x424d('0x48')](_0x6aaf2c,_0x335074,_[_0x424d('0x49')](_0x25714d,_0x21540d)[_0x424d('0x4a')]()));}exports[_0x424d('0x4b')]=getCallerIdRandom;function decrementOriginate(_0x2e48e6){if(_0x2e48e6['originated']&&_0x2e48e6[_0x424d('0x3a')]>0x0){_0x2e48e6[_0x424d('0x3a')]-=0x1;}else{logger[_0x424d('0x4c')]('[decrementOriginate]\x20queue\x20originate\x20value\x20is\x20negative');}}exports[_0x424d('0x4d')]=decrementOriginate;function checkContactEmpty(_0x413293){return _0x413293&&_0x413293[_0x424d('0x4e')]>0x0;}exports['checkContactEmpty']=checkContactEmpty;function erlangb(_0x84336e,_0x3e3c8d){if(_0x3e3c8d===0x0){return 0x0;}var _0x41a7e6=0x1;for(var _0x2f962f=0x1;_0x2f962f<=_0x3e3c8d;_0x2f962f+=0x1){_0x41a7e6=0x1+_0x41a7e6*_0x2f962f/_0x84336e;}return 0x1/_0x41a7e6;}exports['erlangb']=erlangb;function checkContactLowerLimitOriginate(_0x3d2375,_0x55a023,_0x4c9be9){if(_0x55a023>_0x4c9be9){for(var _0x43362e=0x0;_0x43362e<_0x55a023-_0x4c9be9;_0x43362e+=0x1){decrementOriginate(_0x3d2375);}}}exports['checkContactLowerLimitOriginate']=checkContactLowerLimitOriginate;function setXMDContactVariables(_0x5106b2){var _0x5e1b12={};var _0x39fff5=['id',_0x424d('0x4f'),_0x424d('0x50'),_0x424d('0x51'),_0x424d('0x52')];if(_0x5106b2){for(var _0x80a712 in _0x5106b2){if(typeof _0x5106b2[_0x80a712]!=='undefined'){if(!_['isNil'](_0x5106b2[_0x80a712])&&!_0x39fff5['includes'](_0x80a712)){_0x5e1b12[util[_0x424d('0x42')](_0x424d('0x53'),_0x424d('0x54'),_0x80a712['toUpperCase']())]=_0x5106b2[_0x80a712];}}}}return _0x5e1b12;}exports[_0x424d('0x55')]=setXMDContactVariables; \ No newline at end of file diff --git a/server/services/ami/fax/action.js b/server/services/ami/fax/action.js index 1467194..cb5f2e8 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(_0x2d9443,_0x13bf9b){var _0x14f1a4=function(_0x29b7ac){while(--_0x29b7ac){_0x2d9443['push'](_0x2d9443['shift']());}};_0x14f1a4(++_0x13bf9b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x28947d,_0x4cc9c6){_0x28947d=_0x28947d-0x0;var _0x12d2ee=_0xa9e0[_0x28947d];return _0x12d2ee;};'use strict';var util=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));function Action(_0x5dd881,_0x550fbc,_0x18d5c9){this['uniqueid']=_0x5dd881||undefined;this[_0x0a9e('0x3')]=util[_0x0a9e('0x4')](_0x0a9e('0x5'),_0x550fbc[_0x0a9e('0x6')],_0x550fbc[_0x0a9e('0x7')]['name'],_0x18d5c9[_0x0a9e('0x8')]);this[_0x0a9e('0x9')]=_0x550fbc[_0x0a9e('0x9')];this['headerinfo']=_0x550fbc['headerinfo'];this[_0x0a9e('0xa')]=_0x18d5c9['path'];this['AttachmentId']=_0x18d5c9[_0x0a9e('0xb')];}module[_0x0a9e('0xc')]=Action; \ No newline at end of file +var _0xa9e0=['fax','localstationid','path','AttachmentId','exports','util','lodash','moment','channel','format','%s/%s/%s','tech','Trunk'];(function(_0x2c7514,_0x447fa8){var _0x1da550=function(_0x3f418e){while(--_0x3f418e){_0x2c7514['push'](_0x2c7514['shift']());}};_0x1da550(++_0x447fa8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x433a86,_0x175b5c){_0x433a86=_0x433a86-0x0;var _0x23000c=_0xa9e0[_0x433a86];return _0x23000c;};'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 1aaf238..069b91b 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 _0xf5a7=['../rpc/faxMessage','channels','faxAccounts','trunks','newchannel','syncNewchannel','bind','syncVarSet','newstate','syncNewState','newexten','syncNewExten','syncFaxStatus','receivefax','syncReceiveFax','hangup','syncHangup','originateresponse','prototype','from-voip-provider','localstationid','uniqueid','channel','name','\x20syncNewchannel\x20','info','variable','hasOwnProperty','value','channelstate','channelstatedesc','operation','status','filename','\x20syncFaxStatus\x20','remotestationid','pagestransferred','resolution','transferrate','calleridnum','/var/opt/motion2/server/files/attachments/','message','create','parse','.pdf','application/pdf','then','notify','catch','error','\x20receiveFax\x20','stringify','syncOriginateResponse','actions','merge','pick','reason','AttachmentId','update','SENDING\x20FAILED\x20','logger','[Fax][Message][Error][Updated]','[Fax][Message][Error][NoUpdate1]','updateStatus','[Fax][Message][Updated]','[Fax][Message][NoUpdate1]','[Fax][Message][NoUpdate2]','\x20hangup\x20sendFile\x20','\x20hangup\x20faxRiceive\x20','faxpages','faxstatus','SUCCESS','SENDING\x20FAILED:\x20','faxstatusstring','send','execOriginate','[Fax][execOriginate][success]','Fax\x20received','[Fax][execOriginate][failure]','checkAfterSend','checkTrunk','FaxAccountId','Trunk','isValid','Trunk\x20Reachable','gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit','execute','format','%s/%s.tif','dir','XMF-PATH','Convert\x20pdf\x20to\x20tif','Action','variablesAction','addVariables','ext','isTrunkReachable','isNil','active','SIP/%s','unmonitored','\x20Trunk\x20is\x20not\x20active','[Fax][checkTrunk][Empty\x20Fax]','Empty\x20Fax','[Fax][checkTrunk][Empty\x20path]','Empty\x20path','Is\x20Valid','exports','util','lodash','bluebird','uuid','moment','path','tiff2pdf','./util/gs','../../../config/logger','fax','../ami','./rpcDb','./channel','./util/util','./action','../rpc/faxAccount','../rpc/attachment'];(function(_0x52e040,_0x583d2f){var _0x4cd278=function(_0xa844b5){while(--_0xa844b5){_0x52e040['push'](_0x52e040['shift']());}};_0x4cd278(++_0x583d2f);}(_0xf5a7,0x166));var _0x7f5a=function(_0x14030e,_0x27986c){_0x14030e=_0x14030e-0x0;var _0x44ab23=_0xf5a7[_0x14030e];return _0x44ab23;};'use strict';var util=require(_0x7f5a('0x0'));var _=require(_0x7f5a('0x1'));var BPromise=require(_0x7f5a('0x2'));var uuid=require(_0x7f5a('0x3'));var moment=require(_0x7f5a('0x4'));var path=require(_0x7f5a('0x5'));var tiff2pdf=require(_0x7f5a('0x6'));var gs=require(_0x7f5a('0x7'));var logger=require(_0x7f5a('0x8'))(_0x7f5a('0x9'));var ami=require(_0x7f5a('0xa'));var rpcDb=require(_0x7f5a('0xb'));var Channel=require(_0x7f5a('0xc'));var ut=require(_0x7f5a('0xd'));var Action=require(_0x7f5a('0xe'));var faxAccount=require(_0x7f5a('0xf'));var attachment=require(_0x7f5a('0x10'));var faxMessage=require(_0x7f5a('0x11'));function Fax(_0x1b9422){this[_0x7f5a('0x12')]={};this[_0x7f5a('0x13')]=_0x1b9422[_0x7f5a('0x13')];this[_0x7f5a('0x14')]=_0x1b9422[_0x7f5a('0x14')];this['actions']={};ami['on'](_0x7f5a('0x15'),this[_0x7f5a('0x16')][_0x7f5a('0x17')](this));ami['on']('varset',this[_0x7f5a('0x18')]['bind'](this));ami['on'](_0x7f5a('0x19'),this[_0x7f5a('0x1a')][_0x7f5a('0x17')](this));ami['on'](_0x7f5a('0x1b'),this[_0x7f5a('0x1c')][_0x7f5a('0x17')](this));ami['on']('faxstatus',this[_0x7f5a('0x1d')][_0x7f5a('0x17')](this));ami['on'](_0x7f5a('0x1e'),this[_0x7f5a('0x1f')][_0x7f5a('0x17')](this));ami['on'](_0x7f5a('0x20'),this[_0x7f5a('0x21')][_0x7f5a('0x17')](this));ami['on'](_0x7f5a('0x22'),this['syncOriginateResponse'][_0x7f5a('0x17')](this));}Fax[_0x7f5a('0x23')][_0x7f5a('0x16')]=function(_0x52f559){if(_0x52f559['context']===_0x7f5a('0x24')){for(var _0x14ad35 in this['faxAccounts']){if(this[_0x7f5a('0x13')]['hasOwnProperty'](_0x14ad35)){if(_0x52f559['exten']===this[_0x7f5a('0x13')][_0x14ad35][_0x7f5a('0x25')]){this['channels'][_0x52f559['uniqueid']]={};this['channels'][_0x52f559[_0x7f5a('0x26')]][_0x7f5a('0x27')]=_0x52f559[_0x7f5a('0x27')];this[_0x7f5a('0x12')][_0x52f559[_0x7f5a('0x26')]]['id']=this[_0x7f5a('0x13')][_0x14ad35]['id'];this['channels'][_0x52f559[_0x7f5a('0x26')]][_0x7f5a('0x28')]=this[_0x7f5a('0x13')][_0x14ad35][_0x7f5a('0x28')];logger['info'](_0x52f559['uniqueid'],_0x7f5a('0x29'));}}}}if(this['actions'][_0x52f559[_0x7f5a('0x26')]]){this['channels'][_0x52f559[_0x7f5a('0x26')]]={};this[_0x7f5a('0x12')][_0x52f559[_0x7f5a('0x26')]]['channel']=_0x52f559['channel'];logger[_0x7f5a('0x2a')](_0x52f559['uniqueid'],_0x7f5a('0x29'));}};Fax[_0x7f5a('0x23')][_0x7f5a('0x18')]=function(_0x5d659f){if(this[_0x7f5a('0x12')][_0x5d659f[_0x7f5a('0x26')]]){for(var _0x5e55eb in _0x5d659f[_0x7f5a('0x2b')]){if(_0x5d659f[_0x7f5a('0x2b')][_0x7f5a('0x2c')](_0x5e55eb)){this[_0x7f5a('0x12')][_0x5d659f[_0x7f5a('0x26')]][_0x5e55eb]=_0x5d659f[_0x7f5a('0x2d')];}}}};Fax[_0x7f5a('0x23')][_0x7f5a('0x1a')]=function(_0x232cd2){if(this[_0x7f5a('0x12')][_0x232cd2['uniqueid']]){this[_0x7f5a('0x12')][_0x232cd2[_0x7f5a('0x26')]][_0x7f5a('0x2e')]=_0x232cd2[_0x7f5a('0x2e')];this[_0x7f5a('0x12')][_0x232cd2[_0x7f5a('0x26')]][_0x7f5a('0x2f')]=_0x232cd2[_0x7f5a('0x2f')];}};Fax[_0x7f5a('0x23')]['syncNewExten']=function(_0x33c986){if(this[_0x7f5a('0x12')][_0x33c986[_0x7f5a('0x26')]]){for(var _0x4dfe4d in _0x33c986[_0x7f5a('0x2b')]){if(_0x33c986['variable'][_0x7f5a('0x2c')](_0x4dfe4d)){this[_0x7f5a('0x12')][_0x33c986[_0x7f5a('0x26')]][_0x4dfe4d]=_0x33c986[_0x7f5a('0x2d')];}}}};Fax[_0x7f5a('0x23')][_0x7f5a('0x1d')]=function(_0x4956cf){if(this[_0x7f5a('0x12')][_0x4956cf[_0x7f5a('0x26')]]){this[_0x7f5a('0x12')][_0x4956cf[_0x7f5a('0x26')]][_0x7f5a('0x30')]=_0x4956cf[_0x7f5a('0x30')];this[_0x7f5a('0x12')][_0x4956cf[_0x7f5a('0x26')]][_0x7f5a('0x31')]=_0x4956cf[_0x7f5a('0x31')];this['channels'][_0x4956cf[_0x7f5a('0x26')]]['localstationid']=_0x4956cf[_0x7f5a('0x25')];this[_0x7f5a('0x12')][_0x4956cf[_0x7f5a('0x26')]][_0x7f5a('0x32')]=_0x4956cf[_0x7f5a('0x32')];logger[_0x7f5a('0x2a')](_0x4956cf['uniqueid'],_0x7f5a('0x33'));}};Fax[_0x7f5a('0x23')][_0x7f5a('0x1f')]=function(_0x214c34){var _0x19591b=this;if(this[_0x7f5a('0x12')][_0x214c34[_0x7f5a('0x26')]]){var _0x28e669=this[_0x7f5a('0x12')][_0x214c34[_0x7f5a('0x26')]]['id'];this[_0x7f5a('0x12')][_0x214c34[_0x7f5a('0x26')]][_0x7f5a('0x34')]=_0x214c34[_0x7f5a('0x34')];this[_0x7f5a('0x12')][_0x214c34['uniqueid']][_0x7f5a('0x35')]=_0x214c34[_0x7f5a('0x35')];this[_0x7f5a('0x12')][_0x214c34[_0x7f5a('0x26')]][_0x7f5a('0x25')]=_0x214c34['localstationid'];this[_0x7f5a('0x12')][_0x214c34[_0x7f5a('0x26')]][_0x7f5a('0x36')]=_0x214c34[_0x7f5a('0x36')];this[_0x7f5a('0x12')][_0x214c34[_0x7f5a('0x26')]][_0x7f5a('0x37')]=_0x214c34[_0x7f5a('0x37')];this[_0x7f5a('0x12')][_0x214c34[_0x7f5a('0x26')]][_0x7f5a('0x32')]=_0x214c34[_0x7f5a('0x32')];this[_0x7f5a('0x12')][_0x214c34[_0x7f5a('0x26')]][_0x7f5a('0x38')]=_0x214c34['calleridnum'];if(this[_0x7f5a('0x12')][_0x214c34['uniqueid']]['pagestransferred']>0x0){tiff2pdf(_0x214c34['filename'],_0x7f5a('0x39'),function(_0x1bb7b9){logger[_0x7f5a('0x2a')](_0x214c34['uniqueid'],'\x20result\x20conversion\x20file\x20',_0x1bb7b9[_0x7f5a('0x3a')]);attachment[_0x7f5a('0x3b')]({'name':path['parse'](_0x214c34[_0x7f5a('0x32')])[_0x7f5a('0x28')],'basename':path[_0x7f5a('0x3c')](_0x214c34['filename'])[_0x7f5a('0x28')]+_0x7f5a('0x3d'),'type':_0x7f5a('0x3e')})[_0x7f5a('0x3f')](function(_0x3cf835){faxAccount[_0x7f5a('0x40')](_0x28e669,{'from':_0x214c34['calleridnum'],'mapKey':'fax','body':path[_0x7f5a('0x3c')](_0x214c34[_0x7f5a('0x32')])[_0x7f5a('0x28')]+_0x7f5a('0x3d'),'AttachmentId':_0x3cf835['id']})[_0x7f5a('0x41')](function(_0x549f3a){logger[_0x7f5a('0x42')](_0x214c34[_0x7f5a('0x26')],'\x20notify\x20',JSON['stringify'](_0x549f3a));});})[_0x7f5a('0x41')](function(_0x2724c4){logger[_0x7f5a('0x42')](_0x214c34[_0x7f5a('0x26')],_0x7f5a('0x43'),JSON[_0x7f5a('0x44')](_0x2724c4));});});}logger[_0x7f5a('0x2a')](_0x214c34[_0x7f5a('0x26')],_0x7f5a('0x43'));}};Fax[_0x7f5a('0x23')][_0x7f5a('0x45')]=function(_0xae956b){if(this[_0x7f5a('0x46')][_0xae956b[_0x7f5a('0x26')]]){_[_0x7f5a('0x47')](this['channels'][_0xae956b[_0x7f5a('0x26')]],_[_0x7f5a('0x48')](_0xae956b,['response',_0x7f5a('0x49')]));}};function updateStatus(_0x5235dc){if(_0x5235dc[_0x7f5a('0x4a')]){faxMessage[_0x7f5a('0x4b')](_0x5235dc['AttachmentId'],{'failMessage':_0x7f5a('0x4c')})[_0x7f5a('0x3f')](function(_0x479f11){ut[_0x7f5a('0x4d')](_0x7f5a('0x4e'),_0x479f11);})['catch'](function(_0x581328){ut[_0x7f5a('0x4d')](_0x7f5a('0x4f'),_0x581328);});}else{ut[_0x7f5a('0x4d')]('[Fax][Message][Error][NoUpdate2]');}}Fax[_0x7f5a('0x23')][_0x7f5a('0x50')]=function(_0xab2fcb,_0x51f216,_0x6289f){var _0x2a5e7e=this;var _0x5d7e47={};if(_0x51f216){_0x5d7e47={'read':_0x51f216};}else{_0x5d7e47={'failMessage':_0x6289f};}if(this[_0x7f5a('0x46')][_0xab2fcb][_0x7f5a('0x4a')]){faxMessage['update'](this[_0x7f5a('0x46')][_0xab2fcb][_0x7f5a('0x4a')],_0x5d7e47)[_0x7f5a('0x3f')](function(_0x27c867){ut[_0x7f5a('0x4d')](_0x7f5a('0x51'),_0x27c867);})[_0x7f5a('0x41')](function(_0x2a589c){ut[_0x7f5a('0x4d')](_0x7f5a('0x52'),_0x2a589c);})['finally'](function(){delete _0x2a5e7e[_0x7f5a('0x12')][_0xab2fcb];delete _0x2a5e7e['actions'][_0xab2fcb];});}else{ut['logger'](_0x7f5a('0x53'));delete this['channels'][_0xab2fcb];delete this[_0x7f5a('0x46')][_0xab2fcb];}};Fax[_0x7f5a('0x23')][_0x7f5a('0x21')]=function(_0x1ed77e){var _0x18b632=this;if(this['channels'][_0x1ed77e[_0x7f5a('0x26')]]){if(this[_0x7f5a('0x46')][_0x1ed77e['uniqueid']]){this[_0x7f5a('0x12')][_0x1ed77e['uniqueid']]['id']=this[_0x7f5a('0x46')][_0x1ed77e[_0x7f5a('0x26')]]['id'];this[_0x7f5a('0x12')][_0x1ed77e['uniqueid']][_0x7f5a('0x28')]=this[_0x7f5a('0x46')][_0x1ed77e[_0x7f5a('0x26')]]['name'];}logger[_0x7f5a('0x2a')](_0x1ed77e['uniqueid'],this[_0x7f5a('0x46')][_0x1ed77e['uniqueid']]?_0x7f5a('0x54'):_0x7f5a('0x55'),JSON[_0x7f5a('0x44')](this[_0x7f5a('0x12')][_0x1ed77e[_0x7f5a('0x26')]]));if(this[_0x7f5a('0x46')][_0x1ed77e[_0x7f5a('0x26')]]){if(this['channels'][_0x1ed77e['uniqueid']][_0x7f5a('0x56')]>0x0&&this['channels'][_0x1ed77e[_0x7f5a('0x26')]][_0x7f5a('0x57')]===_0x7f5a('0x58')){this[_0x7f5a('0x50')](_0x1ed77e['uniqueid'],!![]);}else{this[_0x7f5a('0x50')](_0x1ed77e['uniqueid'],![],this[_0x7f5a('0x12')][_0x1ed77e[_0x7f5a('0x26')]]['faxstatusstring']?_0x7f5a('0x59')+this['channels'][_0x1ed77e[_0x7f5a('0x26')]][_0x7f5a('0x5a')]:'SENDING\x20FAILED');}}}};Fax[_0x7f5a('0x23')][_0x7f5a('0x5b')]=function(_0x2c2b68){var _0x14ec0f=this;return new BPromise(function(_0x1ee975,_0x548649){_0x14ec0f[_0x7f5a('0x5c')](_0x2c2b68,_0x14ec0f[_0x7f5a('0x13')][_0x2c2b68['FaxAccountId']])[_0x7f5a('0x3f')](function(_0x5f2cfe){ut[_0x7f5a('0x4d')](_0x7f5a('0x5d'),_0x5f2cfe);_0x1ee975(ut[_0x7f5a('0x3a')](_0x7f5a('0x5e')));})[_0x7f5a('0x41')](function(_0x5e4b23){ut[_0x7f5a('0x4d')](_0x7f5a('0x5f'),_0x5e4b23);updateStatus(_0x2c2b68);_0x548649(ut[_0x7f5a('0x3a')]('Fax\x20failed'));});});};Fax['prototype'][_0x7f5a('0x60')]=function(_0x41a2f5){var _0x912b79=this;return new BPromise(function(_0x59d469,_0x4c3c27){var _0x381078=_0x912b79[_0x7f5a('0x61')](_0x912b79[_0x7f5a('0x13')][_0x41a2f5[_0x7f5a('0x62')]][_0x7f5a('0x63')],_0x41a2f5);if(_0x381078[_0x7f5a('0x64')]){_0x59d469(ut['message'](_0x7f5a('0x65')));}else{_0x4c3c27(ut[_0x7f5a('0x3a')](_0x381078[_0x7f5a('0x3a')]));}});};function originate(_0x53384b,_0x44b10b,_0x5a6cf1){return new BPromise(function(_0x40b5eb,_0x2129ad){if(_0x5a6cf1){var _0x394aa6=util['format'](_0x7f5a('0x66'),path[_0x7f5a('0x3c')](_0x53384b['path'])['name'],_0x53384b[_0x7f5a('0x5')]);gs[_0x7f5a('0x67')](_0x394aa6)[_0x7f5a('0x3f')](function(){_0x53384b[_0x7f5a('0x5')]=util[_0x7f5a('0x68')](_0x7f5a('0x69'),path['parse'](_0x53384b[_0x7f5a('0x5')])[_0x7f5a('0x6a')],path[_0x7f5a('0x3c')](_0x53384b[_0x7f5a('0x5')])[_0x7f5a('0x28')]);_0x44b10b[_0x7f5a('0x6b')]=_0x53384b[_0x7f5a('0x5')];ut['logger'](_0x7f5a('0x6c'),'');ami['Action'](ut['variablesAction'](_0x53384b,_0x44b10b))[_0x7f5a('0x3f')](function(_0x25f9ac){_0x40b5eb(_0x25f9ac);})[_0x7f5a('0x41')](function(_0x5dfb34){_0x2129ad(_0x5dfb34);});})[_0x7f5a('0x41')](function(_0x6e9e53){_0x2129ad(_0x6e9e53);});}else{ami[_0x7f5a('0x6d')](ut[_0x7f5a('0x6e')](_0x53384b,_0x44b10b))[_0x7f5a('0x3f')](function(_0x5c8225){_0x40b5eb(_0x5c8225);})[_0x7f5a('0x41')](function(_0x5a7330){_0x2129ad(_0x5a7330);});}});}Fax[_0x7f5a('0x23')]['execOriginate']=function(_0x2cf0a1,_0x1a12cd){var _0xccb770=this;return new BPromise(function(_0x4c2cc1,_0x474683){var _0x43e198=uuid['v4']();var _0x5cca12=ut[_0x7f5a('0x6f')](_0x2cf0a1,_0x1a12cd);_0xccb770[_0x7f5a('0x46')][_0x43e198]=new Action(_0x43e198,_0x1a12cd,_0x2cf0a1);var _0x444ec2=_0xccb770[_0x7f5a('0x46')][_0x43e198];if(path[_0x7f5a('0x3c')](_0x2cf0a1[_0x7f5a('0x5')])[_0x7f5a('0x70')]===_0x7f5a('0x3d')){originate(_0x444ec2,_0x5cca12,!![])['then'](function(_0x4cfc9a){_0x4c2cc1(_0x4cfc9a);})[_0x7f5a('0x41')](function(_0x4a017c){_0x474683(_0x4a017c);});}else{originate(_0x444ec2,_0x5cca12,![])['then'](function(_0x16c3b5){_0x4c2cc1(_0x16c3b5);})['catch'](function(_0x45408c){_0x474683(_0x45408c);});}});};Fax[_0x7f5a('0x23')][_0x7f5a('0x71')]=function(_0x3db4e1){return!_[_0x7f5a('0x72')](_0x3db4e1)&&!_[_0x7f5a('0x72')](_0x3db4e1[_0x7f5a('0x28')])&&!_[_0x7f5a('0x72')](_0x3db4e1[_0x7f5a('0x73')])&&_0x3db4e1['active']&&!_[_0x7f5a('0x72')](this['trunks'][util[_0x7f5a('0x68')](_0x7f5a('0x74'),_0x3db4e1['name'])])&&!_[_0x7f5a('0x72')](this['trunks'][util[_0x7f5a('0x68')]('SIP/%s',_0x3db4e1[_0x7f5a('0x28')])][_0x7f5a('0x31')])&&(this[_0x7f5a('0x14')][util[_0x7f5a('0x68')](_0x7f5a('0x74'),_0x3db4e1[_0x7f5a('0x28')])][_0x7f5a('0x31')]==='reachable'||this[_0x7f5a('0x14')][util[_0x7f5a('0x68')](_0x7f5a('0x74'),_0x3db4e1[_0x7f5a('0x28')])][_0x7f5a('0x31')]===_0x7f5a('0x75'));};Fax['prototype'][_0x7f5a('0x61')]=function(_0xd3abc1,_0x369584){if(!this[_0x7f5a('0x71')](_0xd3abc1)){ut['logger']('[Fax][checkTrunk][Trunk\x20not\x20working\x20correctly]',_[_0x7f5a('0x72')](_0xd3abc1)?'':_0xd3abc1['name']+_0x7f5a('0x76'));return{'isValid':![],'message':'Trunk\x20not\x20working\x20correctly'};}if(_[_0x7f5a('0x72')](_0x369584['fax'])){ut[_0x7f5a('0x4d')](_0x7f5a('0x77'),JSON['stringify'](_0x369584));return{'isValid':![],'message':_0x7f5a('0x78')};}if(_[_0x7f5a('0x72')](_0x369584['path'])){ut['logger'](_0x7f5a('0x79'),JSON[_0x7f5a('0x44')](_0x369584));return{'isValid':![],'message':_0x7f5a('0x7a')};}return{'isValid':!![],'message':_0x7f5a('0x7b')};};module[_0x7f5a('0x7c')]=Fax; \ No newline at end of file +var _0x8fe5=['logger','[Fax][Message][Error][Updated]','[Fax][Message][Error][NoUpdate2]','updateStatus','[Fax][Message][Updated]','[Fax][Message][NoUpdate1]','finally','[Fax][Message][NoUpdate2]','\x20hangup\x20faxRiceive\x20','faxstatusstring','SENDING\x20FAILED:\x20','SENDING\x20FAILED','FaxAccountId','[Fax][execOriginate][success]','message','Fax\x20received','[Fax][execOriginate][failure]','Fax\x20failed','checkAfterSend','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','%s/%s.tif','dir','Convert\x20pdf\x20to\x20tif','Action','variablesAction','execOriginate','ext','isNil','active','SIP/%s','reachable','unmonitored','isTrunkReachable','[Fax][checkTrunk][Trunk\x20not\x20working\x20correctly]','\x20Trunk\x20is\x20not\x20active','[Fax][checkTrunk][Empty\x20Fax]','Empty\x20Fax','Empty\x20path','util','bluebird','uuid','moment','path','tiff2pdf','./util/gs','../../../config/logger','fax','../ami','./util/util','./action','../rpc/faxAccount','../rpc/attachment','../rpc/faxMessage','trunks','syncVarSet','newstate','syncNewState','bind','newexten','faxstatus','receivefax','hangup','syncHangup','originateresponse','syncOriginateResponse','prototype','syncNewchannel','context','faxAccounts','hasOwnProperty','exten','uniqueid','channels','channel','info','\x20syncNewchannel\x20','variable','value','channelstate','channelstatedesc','syncNewExten','syncFaxStatus','operation','status','\x20syncFaxStatus\x20','syncReceiveFax','remotestationid','pagestransferred','localstationid','resolution','transferrate','filename','calleridnum','\x20result\x20conversion\x20file\x20','create','parse','name','.pdf','then','error','\x20notify\x20','stringify','catch','\x20receiveFax\x20','actions','merge','pick','response','reason','update','AttachmentId','SENDING\x20FAILED\x20'];(function(_0x428e03,_0x3da859){var _0x584682=function(_0x2beb7f){while(--_0x2beb7f){_0x428e03['push'](_0x428e03['shift']());}};_0x584682(++_0x3da859);}(_0x8fe5,0x182));var _0x58fe=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x8fe5[_0x20a584];return _0x4b41a8;};'use strict';var util=require(_0x58fe('0x0'));var _=require('lodash');var BPromise=require(_0x58fe('0x1'));var uuid=require(_0x58fe('0x2'));var moment=require(_0x58fe('0x3'));var path=require(_0x58fe('0x4'));var tiff2pdf=require(_0x58fe('0x5'));var gs=require(_0x58fe('0x6'));var logger=require(_0x58fe('0x7'))(_0x58fe('0x8'));var ami=require(_0x58fe('0x9'));var rpcDb=require('./rpcDb');var Channel=require('./channel');var ut=require(_0x58fe('0xa'));var Action=require(_0x58fe('0xb'));var faxAccount=require(_0x58fe('0xc'));var attachment=require(_0x58fe('0xd'));var faxMessage=require(_0x58fe('0xe'));function Fax(_0x4847fb){this['channels']={};this['faxAccounts']=_0x4847fb['faxAccounts'];this[_0x58fe('0xf')]=_0x4847fb[_0x58fe('0xf')];this['actions']={};ami['on']('newchannel',this['syncNewchannel']['bind'](this));ami['on']('varset',this[_0x58fe('0x10')]['bind'](this));ami['on'](_0x58fe('0x11'),this[_0x58fe('0x12')][_0x58fe('0x13')](this));ami['on'](_0x58fe('0x14'),this['syncNewExten'][_0x58fe('0x13')](this));ami['on'](_0x58fe('0x15'),this['syncFaxStatus'][_0x58fe('0x13')](this));ami['on'](_0x58fe('0x16'),this['syncReceiveFax'][_0x58fe('0x13')](this));ami['on'](_0x58fe('0x17'),this[_0x58fe('0x18')][_0x58fe('0x13')](this));ami['on'](_0x58fe('0x19'),this[_0x58fe('0x1a')][_0x58fe('0x13')](this));}Fax[_0x58fe('0x1b')][_0x58fe('0x1c')]=function(_0x22a5b6){if(_0x22a5b6[_0x58fe('0x1d')]==='from-voip-provider'){for(var _0x590000 in this[_0x58fe('0x1e')]){if(this[_0x58fe('0x1e')][_0x58fe('0x1f')](_0x590000)){if(_0x22a5b6[_0x58fe('0x20')]===this[_0x58fe('0x1e')][_0x590000]['localstationid']){this['channels'][_0x22a5b6[_0x58fe('0x21')]]={};this[_0x58fe('0x22')][_0x22a5b6[_0x58fe('0x21')]][_0x58fe('0x23')]=_0x22a5b6[_0x58fe('0x23')];this[_0x58fe('0x22')][_0x22a5b6[_0x58fe('0x21')]]['id']=this[_0x58fe('0x1e')][_0x590000]['id'];this[_0x58fe('0x22')][_0x22a5b6[_0x58fe('0x21')]]['name']=this['faxAccounts'][_0x590000]['name'];logger[_0x58fe('0x24')](_0x22a5b6[_0x58fe('0x21')],_0x58fe('0x25'));}}}}if(this['actions'][_0x22a5b6[_0x58fe('0x21')]]){this[_0x58fe('0x22')][_0x22a5b6['uniqueid']]={};this[_0x58fe('0x22')][_0x22a5b6[_0x58fe('0x21')]]['channel']=_0x22a5b6[_0x58fe('0x23')];logger[_0x58fe('0x24')](_0x22a5b6[_0x58fe('0x21')],_0x58fe('0x25'));}};Fax['prototype'][_0x58fe('0x10')]=function(_0x2934c0){if(this[_0x58fe('0x22')][_0x2934c0[_0x58fe('0x21')]]){for(var _0x16a423 in _0x2934c0[_0x58fe('0x26')]){if(_0x2934c0[_0x58fe('0x26')][_0x58fe('0x1f')](_0x16a423)){this['channels'][_0x2934c0['uniqueid']][_0x16a423]=_0x2934c0[_0x58fe('0x27')];}}}};Fax[_0x58fe('0x1b')][_0x58fe('0x12')]=function(_0x416353){if(this[_0x58fe('0x22')][_0x416353[_0x58fe('0x21')]]){this[_0x58fe('0x22')][_0x416353[_0x58fe('0x21')]]['channelstate']=_0x416353[_0x58fe('0x28')];this[_0x58fe('0x22')][_0x416353[_0x58fe('0x21')]]['channelstatedesc']=_0x416353[_0x58fe('0x29')];}};Fax[_0x58fe('0x1b')][_0x58fe('0x2a')]=function(_0x293ec8){if(this[_0x58fe('0x22')][_0x293ec8[_0x58fe('0x21')]]){for(var _0x5d6d72 in _0x293ec8[_0x58fe('0x26')]){if(_0x293ec8[_0x58fe('0x26')][_0x58fe('0x1f')](_0x5d6d72)){this[_0x58fe('0x22')][_0x293ec8[_0x58fe('0x21')]][_0x5d6d72]=_0x293ec8[_0x58fe('0x27')];}}}};Fax[_0x58fe('0x1b')][_0x58fe('0x2b')]=function(_0x1917fb){if(this[_0x58fe('0x22')][_0x1917fb[_0x58fe('0x21')]]){this['channels'][_0x1917fb[_0x58fe('0x21')]][_0x58fe('0x2c')]=_0x1917fb[_0x58fe('0x2c')];this[_0x58fe('0x22')][_0x1917fb[_0x58fe('0x21')]]['status']=_0x1917fb[_0x58fe('0x2d')];this[_0x58fe('0x22')][_0x1917fb['uniqueid']]['localstationid']=_0x1917fb['localstationid'];this[_0x58fe('0x22')][_0x1917fb[_0x58fe('0x21')]]['filename']=_0x1917fb['filename'];logger[_0x58fe('0x24')](_0x1917fb[_0x58fe('0x21')],_0x58fe('0x2e'));}};Fax[_0x58fe('0x1b')][_0x58fe('0x2f')]=function(_0x25c5b0){var _0x129aa0=this;if(this[_0x58fe('0x22')][_0x25c5b0['uniqueid']]){var _0x1501e2=this[_0x58fe('0x22')][_0x25c5b0[_0x58fe('0x21')]]['id'];this[_0x58fe('0x22')][_0x25c5b0[_0x58fe('0x21')]][_0x58fe('0x30')]=_0x25c5b0[_0x58fe('0x30')];this[_0x58fe('0x22')][_0x25c5b0[_0x58fe('0x21')]][_0x58fe('0x31')]=_0x25c5b0[_0x58fe('0x31')];this[_0x58fe('0x22')][_0x25c5b0['uniqueid']][_0x58fe('0x32')]=_0x25c5b0[_0x58fe('0x32')];this[_0x58fe('0x22')][_0x25c5b0[_0x58fe('0x21')]][_0x58fe('0x33')]=_0x25c5b0[_0x58fe('0x33')];this[_0x58fe('0x22')][_0x25c5b0[_0x58fe('0x21')]][_0x58fe('0x34')]=_0x25c5b0['transferrate'];this[_0x58fe('0x22')][_0x25c5b0['uniqueid']][_0x58fe('0x35')]=_0x25c5b0[_0x58fe('0x35')];this[_0x58fe('0x22')][_0x25c5b0[_0x58fe('0x21')]][_0x58fe('0x36')]=_0x25c5b0['calleridnum'];if(this['channels'][_0x25c5b0[_0x58fe('0x21')]]['pagestransferred']>0x0){tiff2pdf(_0x25c5b0[_0x58fe('0x35')],'/var/opt/motion2/server/files/attachments/',function(_0x8ca633){logger['info'](_0x25c5b0[_0x58fe('0x21')],_0x58fe('0x37'),_0x8ca633['message']);attachment[_0x58fe('0x38')]({'name':path[_0x58fe('0x39')](_0x25c5b0[_0x58fe('0x35')])[_0x58fe('0x3a')],'basename':path['parse'](_0x25c5b0[_0x58fe('0x35')])[_0x58fe('0x3a')]+_0x58fe('0x3b'),'type':'application/pdf'})[_0x58fe('0x3c')](function(_0xafa627){faxAccount['notify'](_0x1501e2,{'from':_0x25c5b0[_0x58fe('0x36')],'mapKey':'fax','body':path[_0x58fe('0x39')](_0x25c5b0['filename'])[_0x58fe('0x3a')]+_0x58fe('0x3b'),'AttachmentId':_0xafa627['id']})['catch'](function(_0x3062b9){logger[_0x58fe('0x3d')](_0x25c5b0[_0x58fe('0x21')],_0x58fe('0x3e'),JSON[_0x58fe('0x3f')](_0x3062b9));});})[_0x58fe('0x40')](function(_0x575b51){logger[_0x58fe('0x3d')](_0x25c5b0[_0x58fe('0x21')],_0x58fe('0x41'),JSON[_0x58fe('0x3f')](_0x575b51));});});}logger[_0x58fe('0x24')](_0x25c5b0[_0x58fe('0x21')],_0x58fe('0x41'));}};Fax[_0x58fe('0x1b')]['syncOriginateResponse']=function(_0x2bcbb0){if(this[_0x58fe('0x42')][_0x2bcbb0[_0x58fe('0x21')]]){_[_0x58fe('0x43')](this[_0x58fe('0x22')][_0x2bcbb0[_0x58fe('0x21')]],_[_0x58fe('0x44')](_0x2bcbb0,[_0x58fe('0x45'),_0x58fe('0x46')]));}};function updateStatus(_0x4e0de5){if(_0x4e0de5['AttachmentId']){faxMessage[_0x58fe('0x47')](_0x4e0de5[_0x58fe('0x48')],{'failMessage':_0x58fe('0x49')})[_0x58fe('0x3c')](function(_0x465784){ut[_0x58fe('0x4a')](_0x58fe('0x4b'),_0x465784);})[_0x58fe('0x40')](function(_0x2298a0){ut[_0x58fe('0x4a')]('[Fax][Message][Error][NoUpdate1]',_0x2298a0);});}else{ut[_0x58fe('0x4a')](_0x58fe('0x4c'));}}Fax[_0x58fe('0x1b')][_0x58fe('0x4d')]=function(_0x4b3fce,_0x16776b,_0x5dc57b){var _0x571146=this;var _0x44c6a0={};if(_0x16776b){_0x44c6a0={'read':_0x16776b};}else{_0x44c6a0={'failMessage':_0x5dc57b};}if(this[_0x58fe('0x42')][_0x4b3fce][_0x58fe('0x48')]){faxMessage[_0x58fe('0x47')](this['actions'][_0x4b3fce][_0x58fe('0x48')],_0x44c6a0)[_0x58fe('0x3c')](function(_0x4117e4){ut[_0x58fe('0x4a')](_0x58fe('0x4e'),_0x4117e4);})['catch'](function(_0x15580c){ut[_0x58fe('0x4a')](_0x58fe('0x4f'),_0x15580c);})[_0x58fe('0x50')](function(){delete _0x571146[_0x58fe('0x22')][_0x4b3fce];delete _0x571146[_0x58fe('0x42')][_0x4b3fce];});}else{ut[_0x58fe('0x4a')](_0x58fe('0x51'));delete this['channels'][_0x4b3fce];delete this['actions'][_0x4b3fce];}};Fax[_0x58fe('0x1b')]['syncHangup']=function(_0x18d2c6){var _0x5c86a6=this;if(this[_0x58fe('0x22')][_0x18d2c6[_0x58fe('0x21')]]){if(this[_0x58fe('0x42')][_0x18d2c6[_0x58fe('0x21')]]){this['channels'][_0x18d2c6[_0x58fe('0x21')]]['id']=this[_0x58fe('0x42')][_0x18d2c6[_0x58fe('0x21')]]['id'];this[_0x58fe('0x22')][_0x18d2c6['uniqueid']][_0x58fe('0x3a')]=this[_0x58fe('0x42')][_0x18d2c6['uniqueid']]['name'];}logger[_0x58fe('0x24')](_0x18d2c6[_0x58fe('0x21')],this[_0x58fe('0x42')][_0x18d2c6['uniqueid']]?'\x20hangup\x20sendFile\x20':_0x58fe('0x52'),JSON['stringify'](this[_0x58fe('0x22')][_0x18d2c6[_0x58fe('0x21')]]));if(this[_0x58fe('0x42')][_0x18d2c6[_0x58fe('0x21')]]){if(this[_0x58fe('0x22')][_0x18d2c6[_0x58fe('0x21')]]['faxpages']>0x0&&this['channels'][_0x18d2c6[_0x58fe('0x21')]][_0x58fe('0x15')]==='SUCCESS'){this['updateStatus'](_0x18d2c6[_0x58fe('0x21')],!![]);}else{this['updateStatus'](_0x18d2c6[_0x58fe('0x21')],![],this[_0x58fe('0x22')][_0x18d2c6['uniqueid']][_0x58fe('0x53')]?_0x58fe('0x54')+this[_0x58fe('0x22')][_0x18d2c6[_0x58fe('0x21')]]['faxstatusstring']:_0x58fe('0x55'));}}}};Fax[_0x58fe('0x1b')]['send']=function(_0x59fcda){var _0x1473cb=this;return new BPromise(function(_0x16aafc,_0x44476e){_0x1473cb['execOriginate'](_0x59fcda,_0x1473cb['faxAccounts'][_0x59fcda[_0x58fe('0x56')]])[_0x58fe('0x3c')](function(_0x16e528){ut[_0x58fe('0x4a')](_0x58fe('0x57'),_0x16e528);_0x16aafc(ut[_0x58fe('0x58')](_0x58fe('0x59')));})[_0x58fe('0x40')](function(_0x550227){ut[_0x58fe('0x4a')](_0x58fe('0x5a'),_0x550227);updateStatus(_0x59fcda);_0x44476e(ut[_0x58fe('0x58')](_0x58fe('0x5b')));});});};Fax[_0x58fe('0x1b')][_0x58fe('0x5c')]=function(_0x2dfb3c){var _0x5e9dc3=this;return new BPromise(function(_0x40de84,_0x785e40){var _0x3182ee=_0x5e9dc3['checkTrunk'](_0x5e9dc3[_0x58fe('0x1e')][_0x2dfb3c[_0x58fe('0x56')]]['Trunk'],_0x2dfb3c);if(_0x3182ee[_0x58fe('0x5d')]){_0x40de84(ut[_0x58fe('0x58')](_0x58fe('0x5e')));}else{_0x785e40(ut[_0x58fe('0x58')](_0x3182ee[_0x58fe('0x58')]));}});};function originate(_0xfb25d0,_0x474108,_0x3ddf98){return new BPromise(function(_0x427349,_0x45967d){if(_0x3ddf98){var _0xb6c3d7=util[_0x58fe('0x5f')](_0x58fe('0x60'),path['parse'](_0xfb25d0[_0x58fe('0x4')])[_0x58fe('0x3a')],_0xfb25d0[_0x58fe('0x4')]);gs['execute'](_0xb6c3d7)[_0x58fe('0x3c')](function(){_0xfb25d0['path']=util['format'](_0x58fe('0x61'),path[_0x58fe('0x39')](_0xfb25d0[_0x58fe('0x4')])[_0x58fe('0x62')],path[_0x58fe('0x39')](_0xfb25d0[_0x58fe('0x4')])[_0x58fe('0x3a')]);_0x474108['XMF-PATH']=_0xfb25d0[_0x58fe('0x4')];ut['logger'](_0x58fe('0x63'),'');ami[_0x58fe('0x64')](ut['variablesAction'](_0xfb25d0,_0x474108))[_0x58fe('0x3c')](function(_0x3305c6){_0x427349(_0x3305c6);})[_0x58fe('0x40')](function(_0x50aa04){_0x45967d(_0x50aa04);});})['catch'](function(_0x3ebc5a){_0x45967d(_0x3ebc5a);});}else{ami[_0x58fe('0x64')](ut[_0x58fe('0x65')](_0xfb25d0,_0x474108))[_0x58fe('0x3c')](function(_0x4b3128){_0x427349(_0x4b3128);})[_0x58fe('0x40')](function(_0x26cb86){_0x45967d(_0x26cb86);});}});}Fax['prototype'][_0x58fe('0x66')]=function(_0x261822,_0xd0ffa){var _0x30df7d=this;return new BPromise(function(_0x2780c7,_0xfcf020){var _0x43d557=uuid['v4']();var _0x59c53a=ut['addVariables'](_0x261822,_0xd0ffa);_0x30df7d[_0x58fe('0x42')][_0x43d557]=new Action(_0x43d557,_0xd0ffa,_0x261822);var _0x11b06a=_0x30df7d['actions'][_0x43d557];if(path[_0x58fe('0x39')](_0x261822['path'])[_0x58fe('0x67')]===_0x58fe('0x3b')){originate(_0x11b06a,_0x59c53a,!![])[_0x58fe('0x3c')](function(_0x430803){_0x2780c7(_0x430803);})[_0x58fe('0x40')](function(_0x68ddd2){_0xfcf020(_0x68ddd2);});}else{originate(_0x11b06a,_0x59c53a,![])[_0x58fe('0x3c')](function(_0x23603d){_0x2780c7(_0x23603d);})[_0x58fe('0x40')](function(_0x4ccabf){_0xfcf020(_0x4ccabf);});}});};Fax[_0x58fe('0x1b')]['isTrunkReachable']=function(_0x1c98c6){return!_[_0x58fe('0x68')](_0x1c98c6)&&!_[_0x58fe('0x68')](_0x1c98c6['name'])&&!_[_0x58fe('0x68')](_0x1c98c6[_0x58fe('0x69')])&&_0x1c98c6[_0x58fe('0x69')]&&!_[_0x58fe('0x68')](this['trunks'][util[_0x58fe('0x5f')](_0x58fe('0x6a'),_0x1c98c6[_0x58fe('0x3a')])])&&!_[_0x58fe('0x68')](this[_0x58fe('0xf')][util[_0x58fe('0x5f')](_0x58fe('0x6a'),_0x1c98c6['name'])][_0x58fe('0x2d')])&&(this[_0x58fe('0xf')][util[_0x58fe('0x5f')](_0x58fe('0x6a'),_0x1c98c6[_0x58fe('0x3a')])]['status']===_0x58fe('0x6b')||this[_0x58fe('0xf')][util[_0x58fe('0x5f')](_0x58fe('0x6a'),_0x1c98c6[_0x58fe('0x3a')])][_0x58fe('0x2d')]===_0x58fe('0x6c'));};Fax[_0x58fe('0x1b')]['checkTrunk']=function(_0xa01dfd,_0x5ad195){if(!this[_0x58fe('0x6d')](_0xa01dfd)){ut[_0x58fe('0x4a')](_0x58fe('0x6e'),_[_0x58fe('0x68')](_0xa01dfd)?'':_0xa01dfd[_0x58fe('0x3a')]+_0x58fe('0x6f'));return{'isValid':![],'message':'Trunk\x20not\x20working\x20correctly'};}if(_['isNil'](_0x5ad195[_0x58fe('0x8')])){ut['logger'](_0x58fe('0x70'),JSON['stringify'](_0x5ad195));return{'isValid':![],'message':_0x58fe('0x71')};}if(_['isNil'](_0x5ad195[_0x58fe('0x4')])){ut[_0x58fe('0x4a')]('[Fax][checkTrunk][Empty\x20path]',JSON[_0x58fe('0x3f')](_0x5ad195));return{'isValid':![],'message':_0x58fe('0x72')};}return{'isValid':!![],'message':'Is\x20Valid'};};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 12d9f67..5d0ef19 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 _0xf23f=['bluebird','preview','lodash','../rpc/faxAccount','error','inspect','notify','resolve','[Notify]\x20','util'];(function(_0x56d766,_0x51eee1){var _0x1c4294=function(_0x34a032){while(--_0x34a032){_0x56d766['push'](_0x56d766['shift']());}};_0x1c4294(++_0x51eee1);}(_0xf23f,0x8b));var _0xff23=function(_0x1d6914,_0x2f6a85){_0x1d6914=_0x1d6914-0x0;var _0x511d10=_0xf23f[_0x1d6914];return _0x511d10;};'use strict';var util=require(_0xff23('0x0'));var BPromise=require(_0xff23('0x1'));var logger=require('../../../config/logger')(_0xff23('0x2'));var _=require(_0xff23('0x3'));var faxAccount=require(_0xff23('0x4'));function loggerCatch(_0x3519b9){return function(_0x3a3afd){logger[_0xff23('0x5')](_0x3519b9,util[_0xff23('0x6')](_0x3a3afd,{'showHidden':![],'depth':null}));};}exports[_0xff23('0x7')]=function(_0x12f551,_0x2d26aa){return BPromise[_0xff23('0x8')]()['then'](faxAccount['notify'](_0x12f551,_0x2d26aa))['catch'](loggerCatch(_0xff23('0x9')));}; \ No newline at end of file +var _0xdd0a=['preview','lodash','../rpc/faxAccount','error','inspect','resolve','then','notify','[Notify]\x20','../../../config/logger'];(function(_0x1b8aef,_0x28e784){var _0x1ad448=function(_0x3368f6){while(--_0x3368f6){_0x1b8aef['push'](_0x1b8aef['shift']());}};_0x1ad448(++_0x28e784);}(_0xdd0a,0x95));var _0xadd0=function(_0x77fd44,_0x133401){_0x77fd44=_0x77fd44-0x0;var _0x1db7d2=_0xdd0a[_0x77fd44];return _0x1db7d2;};'use strict';var util=require('util');var BPromise=require('bluebird');var logger=require(_0xadd0('0x0'))(_0xadd0('0x1'));var _=require(_0xadd0('0x2'));var faxAccount=require(_0xadd0('0x3'));function loggerCatch(_0x1f40b5){return function(_0x456d04){logger[_0xadd0('0x4')](_0x1f40b5,util[_0xadd0('0x5')](_0x456d04,{'showHidden':![],'depth':null}));};}exports['notify']=function(_0x208dbd,_0x38cf8c){return BPromise[_0xadd0('0x6')]()[_0xadd0('0x7')](faxAccount[_0xadd0('0x8')](_0x208dbd,_0x38cf8c))['catch'](loggerCatch(_0xadd0('0x9')));}; \ No newline at end of file diff --git a/server/services/ami/fax/util/gs.js b/server/services/ami/fax/util/gs.js index 31af545..2a83630 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 _0xf8de=['bluebird','child_process','exec','execute','Exec\x20gs','\x20Error\x20:','inspect','util','../../../../config/logger'];(function(_0x53f1de,_0x37d8d3){var _0x2fa505=function(_0x220b34){while(--_0x220b34){_0x53f1de['push'](_0x53f1de['shift']());}};_0x2fa505(++_0x37d8d3);}(_0xf8de,0x1a5));var _0xef8d=function(_0x244374,_0xa62a8d){_0x244374=_0x244374-0x0;var _0x5eb59d=_0xf8de[_0x244374];return _0x5eb59d;};'use strict';var util=require(_0xef8d('0x0'));var logger=require(_0xef8d('0x1'))('fax');var BPromise=require(_0xef8d('0x2'));var exec=require(_0xef8d('0x3'))[_0xef8d('0x4')];exports[_0xef8d('0x5')]=function(_0x48cbf5){return new BPromise(function(_0x3f8f6d,_0x5866c2){exec(_0x48cbf5,function(_0x1a8182,_0x33a9a3,_0x2a76c7){logger['info'](_0xef8d('0x6'),_0x33a9a3);if(_0x1a8182){logger['info'](_0xef8d('0x6'),_0xef8d('0x7'),util[_0xef8d('0x8')](_0x1a8182,{'showHidden':![],'depth':null}),_0x33a9a3,_0x2a76c7);_0x5866c2(_0x1a8182);}_0x3f8f6d(_0x33a9a3);});});}; \ No newline at end of file +var _0x86ce=['fax','bluebird','child_process','exec','info','\x20Error\x20:','inspect','util','../../../../config/logger'];(function(_0xacd425,_0x421b05){var _0x382cf9=function(_0x4819ee){while(--_0x4819ee){_0xacd425['push'](_0xacd425['shift']());}};_0x382cf9(++_0x421b05);}(_0x86ce,0x1c0));var _0xe86c=function(_0x21f931,_0x598b2d){_0x21f931=_0x21f931-0x0;var _0x3f083c=_0x86ce[_0x21f931];return _0x3f083c;};'use strict';var util=require(_0xe86c('0x0'));var logger=require(_0xe86c('0x1'))(_0xe86c('0x2'));var BPromise=require(_0xe86c('0x3'));var exec=require(_0xe86c('0x4'))[_0xe86c('0x5')];exports['execute']=function(_0x5ee715){return new BPromise(function(_0x4f253e,_0x3e9451){exec(_0x5ee715,function(_0x4aa45a,_0x1a8293,_0x422660){logger['info']('Exec\x20gs',_0x1a8293);if(_0x4aa45a){logger[_0xe86c('0x6')]('Exec\x20gs',_0xe86c('0x7'),util[_0xe86c('0x8')](_0x4aa45a,{'showHidden':![],'depth':null}),_0x1a8293,_0x422660);_0x3e9451(_0x4aa45a);}_0x4f253e(_0x1a8293);});});}; \ 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 6a8433b..7f502a6 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 _0x3632=['t38timeout','localstationid','path','variablesAction','uniqueid','channel','xcally-motion-fax','from-sip','format','\x22%s\x22\x20<%s>','headerinfo','util','fax','message','logger','info','ecm','minrate','maxrate','\x22%s\x22','modem','gateway'];(function(_0x291f9e,_0x28c22c){var _0x4da182=function(_0x2aba5d){while(--_0x2aba5d){_0x291f9e['push'](_0x291f9e['shift']());}};_0x4da182(++_0x28c22c);}(_0x3632,0xd1));var _0x2363=function(_0x422e75,_0x1c438c){_0x422e75=_0x422e75-0x0;var _0x393688=_0x3632[_0x422e75];return _0x393688;};'use strict';var util=require(_0x2363('0x0'));var _=require('lodash');var moment=require('moment');var logger=require('../../../../config/logger')(_0x2363('0x1'));exports[_0x2363('0x2')]=function(_0x135f3b){return{'message':_0x135f3b};};exports[_0x2363('0x3')]=function(_0x435f6d,_0x111291){logger[_0x2363('0x4')](_0x435f6d,util['inspect'](_0x111291,{'showHidden':![],'depth':null}));};exports['addVariables']=function(_0x294fe4,_0x4bfd25){var _0x235495={'XMF-ECM':_0x4bfd25[_0x2363('0x5')],'XMF-HEADERINFO':_0x4bfd25['headerinfo'],'XMF-MINRATE':_0x4bfd25[_0x2363('0x6')],'XMF-MAXRATE':_0x4bfd25[_0x2363('0x7')],'XMF-MODEM':util['format'](_0x2363('0x8'),_0x4bfd25[_0x2363('0x9')]),'XMF-GATEWAY':_0x4bfd25[_0x2363('0xa')],'XMF-FAXDETECT':_0x4bfd25['faxdetect'],'XMF-T38TIMEOUT':_0x4bfd25[_0x2363('0xb')],'XMF-LOCALSTATIONID':_0x4bfd25[_0x2363('0xc')],'XMF-PATH':_0x294fe4[_0x2363('0xd')]};return _0x235495;};exports[_0x2363('0xe')]=function(_0x4f142a,_0x1d1b3c){return{'actionid':_0x4f142a[_0x2363('0xf')],'action':'originate','channel':_0x4f142a[_0x2363('0x10')],'Exten':_0x2363('0x11'),'Context':_0x2363('0x12'),'Priority':'1','callerid':util[_0x2363('0x13')](_0x2363('0x14'),_0x4f142a[_0x2363('0x15')]?_0x4f142a[_0x2363('0x15')]:'',_0x4f142a['localstationid']),'variable':_0x1d1b3c,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x4f142a[_0x2363('0xf')]};}; \ No newline at end of file +var _0xb73b=['uniqueid','channel','from-sip','lodash','moment','../../../../config/logger','fax','message','logger','info','inspect','addVariables','ecm','headerinfo','minrate','maxrate','format','\x22%s\x22','modem','gateway','faxdetect','localstationid','path','variablesAction'];(function(_0x3610f6,_0x52f821){var _0x45ff1b=function(_0x2af7a5){while(--_0x2af7a5){_0x3610f6['push'](_0x3610f6['shift']());}};_0x45ff1b(++_0x52f821);}(_0xb73b,0x93));var _0xbb73=function(_0x5cb99e,_0x14fb93){_0x5cb99e=_0x5cb99e-0x0;var _0x72ac9c=_0xb73b[_0x5cb99e];return _0x72ac9c;};'use strict';var util=require('util');var _=require(_0xbb73('0x0'));var moment=require(_0xbb73('0x1'));var logger=require(_0xbb73('0x2'))(_0xbb73('0x3'));exports[_0xbb73('0x4')]=function(_0x3af206){return{'message':_0x3af206};};exports[_0xbb73('0x5')]=function(_0x2bbf8f,_0x5a0d65){logger[_0xbb73('0x6')](_0x2bbf8f,util[_0xbb73('0x7')](_0x5a0d65,{'showHidden':![],'depth':null}));};exports[_0xbb73('0x8')]=function(_0x2c147b,_0x4c83de){var _0x362fe2={'XMF-ECM':_0x4c83de[_0xbb73('0x9')],'XMF-HEADERINFO':_0x4c83de[_0xbb73('0xa')],'XMF-MINRATE':_0x4c83de[_0xbb73('0xb')],'XMF-MAXRATE':_0x4c83de[_0xbb73('0xc')],'XMF-MODEM':util[_0xbb73('0xd')](_0xbb73('0xe'),_0x4c83de[_0xbb73('0xf')]),'XMF-GATEWAY':_0x4c83de[_0xbb73('0x10')],'XMF-FAXDETECT':_0x4c83de[_0xbb73('0x11')],'XMF-T38TIMEOUT':_0x4c83de['t38timeout'],'XMF-LOCALSTATIONID':_0x4c83de[_0xbb73('0x12')],'XMF-PATH':_0x2c147b[_0xbb73('0x13')]};return _0x362fe2;};exports[_0xbb73('0x14')]=function(_0x1bf0a4,_0x56c65a){return{'actionid':_0x1bf0a4[_0xbb73('0x15')],'action':'originate','channel':_0x1bf0a4[_0xbb73('0x16')],'Exten':'xcally-motion-fax','Context':_0xbb73('0x17'),'Priority':'1','callerid':util[_0xbb73('0xd')]('\x22%s\x22\x20<%s>',_0x1bf0a4[_0xbb73('0xa')]?_0x1bf0a4[_0xbb73('0xa')]:'',_0x1bf0a4[_0xbb73('0x12')]),'variable':_0x56c65a,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x1bf0a4[_0xbb73('0x15')]};}; \ No newline at end of file diff --git a/server/services/ami/index.js b/server/services/ami/index.js index bde0a5e..0b8045c 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 _0xfd16=['getSugarcrmAccounts','getFreshdeskAccounts','getDeskAccounts','initDeskAccounts','getZohoAccounts','initZohoAccounts','initVtigerAccounts','initServicenowAccounts','getDynamics365Accounts','initDynamics365Accounts','getCampaigns','getVoiceExtensions','getFaxAccounts','initFaxAccounts','getVoiceQueueReports','initVoiceQueueReports','getVoiceQueueHopperHistory','initVoiceQueueHopperHistory','getCampaignHopperHistory','initCampaignHopperHistory','initVoiceCallReports','catch','error','sync','[index.js][main]','util','moment','./server','./report','./trigger','./dialer','./preview','./fax','./rpc/user','./rpc/voiceQueue','./rpc/voiceCallReport','./rpc/trunk','./rpc/template','./rpc/campaign','./rpc/voiceExtension','./rpc/faxAccount','./rpc/integrations/zendesk','./rpc/integrations/zoho','./rpc/integrations/vtiger','./rpc/integrations/freshsales','./rpc/integrations/servicenow','./rpc/integrations/dynamics365','../../config/logger','ami','get','hour','resolve','then','getAgents','initAgents','getTelephones','initTelephones','getTrunks','initTrunks','getVoiceQueues','initVoiceQueues','getTemplates','getZendeskAccounts','getSalesforceAccounts','initSalesforceAccounts'];(function(_0x334b5c,_0x36f5a7){var _0x5992ea=function(_0x584069){while(--_0x584069){_0x334b5c['push'](_0x334b5c['shift']());}};_0x5992ea(++_0x36f5a7);}(_0xfd16,0x19f));var _0x6fd1=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0xfd16[_0x27af45];return _0x18df21;};'use strict';var util=require(_0x6fd1('0x0'));var moment=require(_0x6fd1('0x1'));var server=require(_0x6fd1('0x2'));var Realtime=require('./realtime');var Report=require(_0x6fd1('0x3'));var Acw=require('./acw');var Trigger=require(_0x6fd1('0x4'));var Dialer=require(_0x6fd1('0x5'));var Preview=require(_0x6fd1('0x6'));var Fax=require(_0x6fd1('0x7'));var user=require(_0x6fd1('0x8'));var voiceQueue=require(_0x6fd1('0x9'));var voiceQueueReport=require('./rpc/voiceQueueReport');var voiceCallReport=require(_0x6fd1('0xa'));var trunk=require(_0x6fd1('0xb'));var trigger=require('./rpc/trigger');var template=require(_0x6fd1('0xc'));var cmHopperHistory=require('./rpc/cmHopperHistory');var campaign=require(_0x6fd1('0xd'));var voiceExtension=require(_0x6fd1('0xe'));var faxAccount=require(_0x6fd1('0xf'));var zendesk=require(_0x6fd1('0x10'));var salesforce=require('./rpc/integrations/salesforce');var sugarcrm=require('./rpc/integrations/sugarcrm');var freshdesk=require('./rpc/integrations/freshdesk');var desk=require('./rpc/integrations/desk');var zoho=require(_0x6fd1('0x11'));var vtiger=require(_0x6fd1('0x12'));var freshsales=require(_0x6fd1('0x13'));var servicenow=require(_0x6fd1('0x14'));var dynamics365=require(_0x6fd1('0x15'));var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var logger=require(_0x6fd1('0x16'))(_0x6fd1('0x17'));var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0x6fd1('0x18')](_0x6fd1('0x19'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0x6fd1('0x18')](_0x6fd1('0x19'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return Promise[_0x6fd1('0x1a')]()[_0x6fd1('0x1b')](user[_0x6fd1('0x1c')]())[_0x6fd1('0x1b')](realtime[_0x6fd1('0x1d')]())[_0x6fd1('0x1b')](user[_0x6fd1('0x1e')]())[_0x6fd1('0x1b')](realtime[_0x6fd1('0x1f')]())['then'](trunk[_0x6fd1('0x20')]())[_0x6fd1('0x1b')](realtime[_0x6fd1('0x21')]())[_0x6fd1('0x1b')](voiceQueue[_0x6fd1('0x22')]())[_0x6fd1('0x1b')](realtime[_0x6fd1('0x23')]())[_0x6fd1('0x1b')](trigger['getTriggers']())[_0x6fd1('0x1b')](realtime['initTriggers']())['then'](template[_0x6fd1('0x24')]())[_0x6fd1('0x1b')](realtime['initTemplates']())[_0x6fd1('0x1b')](zendesk[_0x6fd1('0x25')]())[_0x6fd1('0x1b')](realtime['initZendeskAccounts']())[_0x6fd1('0x1b')](salesforce[_0x6fd1('0x26')]())[_0x6fd1('0x1b')](realtime[_0x6fd1('0x27')]())[_0x6fd1('0x1b')](sugarcrm[_0x6fd1('0x28')]())[_0x6fd1('0x1b')](realtime['initSugarcrmAccounts']())['then'](freshdesk[_0x6fd1('0x29')]())[_0x6fd1('0x1b')](realtime['initFreshdeskAccounts']())[_0x6fd1('0x1b')](desk[_0x6fd1('0x2a')]())[_0x6fd1('0x1b')](realtime[_0x6fd1('0x2b')]())[_0x6fd1('0x1b')](zoho[_0x6fd1('0x2c')]())[_0x6fd1('0x1b')](realtime[_0x6fd1('0x2d')]())[_0x6fd1('0x1b')](vtiger['getVtigerAccounts']())['then'](realtime[_0x6fd1('0x2e')]())[_0x6fd1('0x1b')](freshsales['getFreshsalesAccounts']())[_0x6fd1('0x1b')](realtime['initFreshsalesAccounts']())[_0x6fd1('0x1b')](servicenow['getServicenowAccounts']())[_0x6fd1('0x1b')](realtime[_0x6fd1('0x2f')]())[_0x6fd1('0x1b')](dynamics365[_0x6fd1('0x30')]())[_0x6fd1('0x1b')](realtime[_0x6fd1('0x31')]())[_0x6fd1('0x1b')](campaign[_0x6fd1('0x32')]())[_0x6fd1('0x1b')](realtime['initCampaigns']())[_0x6fd1('0x1b')](voiceExtension[_0x6fd1('0x33')]())[_0x6fd1('0x1b')](realtime['initVoiceExtensions']())[_0x6fd1('0x1b')](faxAccount[_0x6fd1('0x34')]())[_0x6fd1('0x1b')](realtime[_0x6fd1('0x35')]())['then'](function(){return realtime;});}function initParams(){return Promise[_0x6fd1('0x1a')]()['then'](voiceQueueReport[_0x6fd1('0x36')]())[_0x6fd1('0x1b')](realtime[_0x6fd1('0x37')]())[_0x6fd1('0x1b')](cmHopperHistory[_0x6fd1('0x38')]())[_0x6fd1('0x1b')](realtime[_0x6fd1('0x39')]())[_0x6fd1('0x1b')](cmHopperHistory[_0x6fd1('0x3a')]())[_0x6fd1('0x1b')](realtime[_0x6fd1('0x3b')]())[_0x6fd1('0x1b')](voiceCallReport['getVoiceCallReports']())['then'](realtime[_0x6fd1('0x3c')]())[_0x6fd1('0x3d')](function(_0x1b6337){logger[_0x6fd1('0x3e')]('[index.js][initParams]',util['inspect'](_0x1b6337,{'showHidden':![],'depth':null}));});}function main(){return server['listen'](realtime,preview,fax)[_0x6fd1('0x1b')](function(){return initRealtime();})['then'](function(){return initParams();})['then'](function(){report[_0x6fd1('0x3f')]();setInterval(initRealtime,0x1388);})['catch'](function(_0x520fe4){logger[_0x6fd1('0x3e')](_0x6fd1('0x40'),util['inspect'](_0x520fe4,{'showHidden':![],'depth':null}));});}main(); \ No newline at end of file +var _0xe4ae=['initTrunks','initVoiceQueues','getTriggers','initTriggers','getTemplates','initTemplates','getZendeskAccounts','initZendeskAccounts','getSalesforceAccounts','getSugarcrmAccounts','initSugarcrmAccounts','getFreshdeskAccounts','getZohoAccounts','initZohoAccounts','getVtigerAccounts','initVtigerAccounts','getServicenowAccounts','initServicenowAccounts','initDynamics365Accounts','getCampaigns','initCampaigns','getVoiceExtensions','initVoiceExtensions','getFaxAccounts','resolve','getVoiceQueueReports','initVoiceQueueReports','getVoiceQueueHopperHistory','initVoiceQueueHopperHistory','initCampaignHopperHistory','getVoiceCallReports','initVoiceCallReports','catch','error','inspect','listen','sync','[index.js][main]','util','./realtime','./report','./acw','./trigger','./dialer','./fax','./rpc/user','./rpc/voiceQueue','./rpc/voiceQueueReport','./rpc/voiceCallReport','./rpc/trunk','./rpc/trigger','./rpc/template','./rpc/cmHopperHistory','./rpc/campaign','./rpc/voiceExtension','./rpc/faxAccount','./rpc/integrations/zendesk','./rpc/integrations/salesforce','./rpc/integrations/sugarcrm','./rpc/integrations/freshdesk','./rpc/integrations/desk','./rpc/integrations/zoho','./rpc/integrations/vtiger','./rpc/integrations/freshsales','./rpc/integrations/servicenow','ami','hour','get','then','getAgents','initAgents','initTelephones'];(function(_0x19d24d,_0x1ea9b6){var _0x18da7a=function(_0x279042){while(--_0x279042){_0x19d24d['push'](_0x19d24d['shift']());}};_0x18da7a(++_0x1ea9b6);}(_0xe4ae,0x146));var _0xee4a=function(_0x7220f4,_0x5ac632){_0x7220f4=_0x7220f4-0x0;var _0x5e4f9f=_0xe4ae[_0x7220f4];return _0x5e4f9f;};'use strict';var util=require(_0xee4a('0x0'));var moment=require('moment');var server=require('./server');var Realtime=require(_0xee4a('0x1'));var Report=require(_0xee4a('0x2'));var Acw=require(_0xee4a('0x3'));var Trigger=require(_0xee4a('0x4'));var Dialer=require(_0xee4a('0x5'));var Preview=require('./preview');var Fax=require(_0xee4a('0x6'));var user=require(_0xee4a('0x7'));var voiceQueue=require(_0xee4a('0x8'));var voiceQueueReport=require(_0xee4a('0x9'));var voiceCallReport=require(_0xee4a('0xa'));var trunk=require(_0xee4a('0xb'));var trigger=require(_0xee4a('0xc'));var template=require(_0xee4a('0xd'));var cmHopperHistory=require(_0xee4a('0xe'));var campaign=require(_0xee4a('0xf'));var voiceExtension=require(_0xee4a('0x10'));var faxAccount=require(_0xee4a('0x11'));var zendesk=require(_0xee4a('0x12'));var salesforce=require(_0xee4a('0x13'));var sugarcrm=require(_0xee4a('0x14'));var freshdesk=require(_0xee4a('0x15'));var desk=require(_0xee4a('0x16'));var zoho=require(_0xee4a('0x17'));var vtiger=require(_0xee4a('0x18'));var freshsales=require(_0xee4a('0x19'));var servicenow=require(_0xee4a('0x1a'));var dynamics365=require('./rpc/integrations/dynamics365');var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var logger=require('../../config/logger')(_0xee4a('0x1b'));var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()['get'](_0xee4a('0x1c'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0xee4a('0x1d')](_0xee4a('0x1c'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return Promise['resolve']()[_0xee4a('0x1e')](user[_0xee4a('0x1f')]())[_0xee4a('0x1e')](realtime[_0xee4a('0x20')]())[_0xee4a('0x1e')](user['getTelephones']())[_0xee4a('0x1e')](realtime[_0xee4a('0x21')]())[_0xee4a('0x1e')](trunk['getTrunks']())[_0xee4a('0x1e')](realtime[_0xee4a('0x22')]())['then'](voiceQueue['getVoiceQueues']())[_0xee4a('0x1e')](realtime[_0xee4a('0x23')]())['then'](trigger[_0xee4a('0x24')]())[_0xee4a('0x1e')](realtime[_0xee4a('0x25')]())[_0xee4a('0x1e')](template[_0xee4a('0x26')]())[_0xee4a('0x1e')](realtime[_0xee4a('0x27')]())[_0xee4a('0x1e')](zendesk[_0xee4a('0x28')]())[_0xee4a('0x1e')](realtime[_0xee4a('0x29')]())[_0xee4a('0x1e')](salesforce[_0xee4a('0x2a')]())[_0xee4a('0x1e')](realtime['initSalesforceAccounts']())[_0xee4a('0x1e')](sugarcrm[_0xee4a('0x2b')]())[_0xee4a('0x1e')](realtime[_0xee4a('0x2c')]())['then'](freshdesk[_0xee4a('0x2d')]())[_0xee4a('0x1e')](realtime['initFreshdeskAccounts']())['then'](desk['getDeskAccounts']())[_0xee4a('0x1e')](realtime['initDeskAccounts']())[_0xee4a('0x1e')](zoho[_0xee4a('0x2e')]())[_0xee4a('0x1e')](realtime[_0xee4a('0x2f')]())[_0xee4a('0x1e')](vtiger[_0xee4a('0x30')]())['then'](realtime[_0xee4a('0x31')]())[_0xee4a('0x1e')](freshsales['getFreshsalesAccounts']())['then'](realtime['initFreshsalesAccounts']())[_0xee4a('0x1e')](servicenow[_0xee4a('0x32')]())[_0xee4a('0x1e')](realtime[_0xee4a('0x33')]())[_0xee4a('0x1e')](dynamics365['getDynamics365Accounts']())[_0xee4a('0x1e')](realtime[_0xee4a('0x34')]())['then'](campaign[_0xee4a('0x35')]())[_0xee4a('0x1e')](realtime[_0xee4a('0x36')]())[_0xee4a('0x1e')](voiceExtension[_0xee4a('0x37')]())['then'](realtime[_0xee4a('0x38')]())['then'](faxAccount[_0xee4a('0x39')]())[_0xee4a('0x1e')](realtime['initFaxAccounts']())[_0xee4a('0x1e')](function(){return realtime;});}function initParams(){return Promise[_0xee4a('0x3a')]()['then'](voiceQueueReport[_0xee4a('0x3b')]())[_0xee4a('0x1e')](realtime[_0xee4a('0x3c')]())[_0xee4a('0x1e')](cmHopperHistory[_0xee4a('0x3d')]())[_0xee4a('0x1e')](realtime[_0xee4a('0x3e')]())[_0xee4a('0x1e')](cmHopperHistory['getCampaignHopperHistory']())[_0xee4a('0x1e')](realtime[_0xee4a('0x3f')]())[_0xee4a('0x1e')](voiceCallReport[_0xee4a('0x40')]())[_0xee4a('0x1e')](realtime[_0xee4a('0x41')]())[_0xee4a('0x42')](function(_0x58d756){logger[_0xee4a('0x43')]('[index.js][initParams]',util[_0xee4a('0x44')](_0x58d756,{'showHidden':![],'depth':null}));});}function main(){return server[_0xee4a('0x45')](realtime,preview,fax)[_0xee4a('0x1e')](function(){return initRealtime();})[_0xee4a('0x1e')](function(){return initParams();})[_0xee4a('0x1e')](function(){report[_0xee4a('0x46')]();setInterval(initRealtime,0x1388);})[_0xee4a('0x42')](function(_0x1c6107){logger[_0xee4a('0x43')](_0xee4a('0x47'),util[_0xee4a('0x44')](_0x1c6107,{'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 1671363..f265cbc 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 _0x3c9f=['moment','md5','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','email','accountcode','fullname','state','stateTime','status','unknown','address','phone','online','voiceStatus','voiceStatusCallerIdNumber','onhold','local','prototype','updateStatusRealtime','toLowerCase','not_inuse','idle','inuse','talking','statePause','voiceStatusTime','format','voiceStatusQueue','interface','stringify','user:%s','user:ami:update','emit','lodash','util'];(function(_0x20c522,_0x4bfb40){var _0xb20df2=function(_0x1c5e38){while(--_0x1c5e38){_0x20c522['push'](_0x20c522['shift']());}};_0xb20df2(++_0x4bfb40);}(_0x3c9f,0x166));var _0xf3c9=function(_0x3ccfdf,_0xae9d2e){_0x3ccfdf=_0x3ccfdf-0x0;var _0x57be10=_0x3c9f[_0x3ccfdf];return _0x57be10;};'use strict';var _=require(_0xf3c9('0x0'));var util=require(_0xf3c9('0x1'));var moment=require(_0xf3c9('0x2'));var md5=require(_0xf3c9('0x3'));var Redis=require('ioredis');var config=require(_0xf3c9('0x4'));config[_0xf3c9('0x5')]=_[_0xf3c9('0x6')](config[_0xf3c9('0x5')],{'host':_0xf3c9('0x7'),'port':0x18eb});var io=require(_0xf3c9('0x8'))(new Redis(config[_0xf3c9('0x5')]));function Agent(_0x412d90){this['id']=_0x412d90['id']||0x0;this[_0xf3c9('0x9')]=_0x412d90[_0xf3c9('0x9')]||'';this[_0xf3c9('0xa')]=_0x412d90[_0xf3c9('0xa')]||'';this['accountcode']=_0x412d90[_0xf3c9('0xb')]||'';this[_0xf3c9('0xc')]=_0x412d90['fullname']||'';this[_0xf3c9('0xd')]='unknown';this[_0xf3c9('0xe')]=0x0;this[_0xf3c9('0xf')]=_0xf3c9('0x10');this[_0xf3c9('0x11')]='';this[_0xf3c9('0x12')]='';this['mobile']='';this['interface']='';this[_0xf3c9('0x13')]=_0x412d90['online']||![];this[_0xf3c9('0x14')]='unknown';this['voiceStatusTime']=0x0;this[_0xf3c9('0x15')]='';this['voiceStatusQueue']='';this[_0xf3c9('0x16')]=![];this[_0xf3c9('0x17')]=![];this[_0xf3c9('0x3')]='';}Agent[_0xf3c9('0x18')][_0xf3c9('0x19')]=function(_0x39c5c0){var _0x324432;if(_0x39c5c0&&_0x39c5c0['state']){_0x324432=_0x39c5c0[_0xf3c9('0xd')][_0xf3c9('0x1a')]();switch(_0x324432){case _0xf3c9('0x1b'):_0x324432=_0xf3c9('0x1c');break;case _0xf3c9('0x1d'):_0x324432=_0xf3c9('0x1e');break;}}if(_0x324432&&this[_0xf3c9('0x14')]!==_0x324432||_0x39c5c0[_0xf3c9('0x1f')]){this[_0xf3c9('0x20')]=_['toNumber'](moment()[_0xf3c9('0x21')]('x'));}if(_0x324432){this[_0xf3c9('0x14')]=_0x324432;}var _0x427a95={'id':this['id'],'name':this[_0xf3c9('0x9')],'email':this[_0xf3c9('0xa')],'accountcode':this['accountcode'],'fullname':this[_0xf3c9('0xc')],'state':this[_0xf3c9('0xd')],'stateTime':this[_0xf3c9('0xe')],'status':this[_0xf3c9('0xf')],'address':this['address'],'online':this[_0xf3c9('0x13')],'voiceStatus':this[_0xf3c9('0x14')],'voiceStatusTime':this[_0xf3c9('0x20')],'voiceStatusCallerIdNumber':this[_0xf3c9('0x15')],'voiceStatusQueue':this[_0xf3c9('0x22')],'interface':this[_0xf3c9('0x23')],'onhold':this[_0xf3c9('0x16')]};var _0xddbc78=md5(JSON[_0xf3c9('0x24')](_0x427a95));if(this[_0xf3c9('0x3')]!==_0xddbc78){this[_0xf3c9('0x3')]=_0xddbc78;io['to'](util[_0xf3c9('0x21')](_0xf3c9('0x25'),_0x427a95[_0xf3c9('0x9')]))['emit'](_0xf3c9('0x26'),_['omit'](_0x427a95,[_0xf3c9('0x13')]));io[_0xf3c9('0x27')]('user:presence',_0x427a95);}};module['exports']=Agent; \ No newline at end of file +var _0xa007=['address','voiceStatusCallerIdNumber','stringify','user:%s','emit','user:ami:update','omit','user:presence','exports','lodash','util','moment','md5','ioredis','../../../config/environment','defaults','redis','localhost','socket.io-emitter','name','email','accountcode','fullname','state','unknown','stateTime','status','phone','mobile','online','voiceStatusTime','voiceStatusQueue','onhold','local','updateStatusRealtime','toLowerCase','not_inuse','idle','talking','voiceStatus','statePause','toNumber','format'];(function(_0x354d1c,_0x40c983){var _0x18bfc5=function(_0xfea85f){while(--_0xfea85f){_0x354d1c['push'](_0x354d1c['shift']());}};_0x18bfc5(++_0x40c983);}(_0xa007,0x1e2));var _0x7a00=function(_0x2dbac1,_0x44db3b){_0x2dbac1=_0x2dbac1-0x0;var _0x8c4e86=_0xa007[_0x2dbac1];return _0x8c4e86;};'use strict';var _=require(_0x7a00('0x0'));var util=require(_0x7a00('0x1'));var moment=require(_0x7a00('0x2'));var md5=require(_0x7a00('0x3'));var Redis=require(_0x7a00('0x4'));var config=require(_0x7a00('0x5'));config['redis']=_[_0x7a00('0x6')](config[_0x7a00('0x7')],{'host':_0x7a00('0x8'),'port':0x18eb});var io=require(_0x7a00('0x9'))(new Redis(config['redis']));function Agent(_0x2ba908){this['id']=_0x2ba908['id']||0x0;this[_0x7a00('0xa')]=_0x2ba908[_0x7a00('0xa')]||'';this[_0x7a00('0xb')]=_0x2ba908[_0x7a00('0xb')]||'';this['accountcode']=_0x2ba908[_0x7a00('0xc')]||'';this[_0x7a00('0xd')]=_0x2ba908[_0x7a00('0xd')]||'';this[_0x7a00('0xe')]=_0x7a00('0xf');this[_0x7a00('0x10')]=0x0;this[_0x7a00('0x11')]=_0x7a00('0xf');this['address']='';this[_0x7a00('0x12')]='';this[_0x7a00('0x13')]='';this['interface']='';this[_0x7a00('0x14')]=_0x2ba908['online']||![];this['voiceStatus']=_0x7a00('0xf');this[_0x7a00('0x15')]=0x0;this['voiceStatusCallerIdNumber']='';this[_0x7a00('0x16')]='';this[_0x7a00('0x17')]=![];this[_0x7a00('0x18')]=![];this[_0x7a00('0x3')]='';}Agent['prototype'][_0x7a00('0x19')]=function(_0x1dd869){var _0x4ab85e;if(_0x1dd869&&_0x1dd869[_0x7a00('0xe')]){_0x4ab85e=_0x1dd869[_0x7a00('0xe')][_0x7a00('0x1a')]();switch(_0x4ab85e){case _0x7a00('0x1b'):_0x4ab85e=_0x7a00('0x1c');break;case'inuse':_0x4ab85e=_0x7a00('0x1d');break;}}if(_0x4ab85e&&this[_0x7a00('0x1e')]!==_0x4ab85e||_0x1dd869[_0x7a00('0x1f')]){this['voiceStatusTime']=_[_0x7a00('0x20')](moment()[_0x7a00('0x21')]('x'));}if(_0x4ab85e){this[_0x7a00('0x1e')]=_0x4ab85e;}var _0x49a554={'id':this['id'],'name':this[_0x7a00('0xa')],'email':this[_0x7a00('0xb')],'accountcode':this[_0x7a00('0xc')],'fullname':this[_0x7a00('0xd')],'state':this[_0x7a00('0xe')],'stateTime':this['stateTime'],'status':this['status'],'address':this[_0x7a00('0x22')],'online':this[_0x7a00('0x14')],'voiceStatus':this[_0x7a00('0x1e')],'voiceStatusTime':this[_0x7a00('0x15')],'voiceStatusCallerIdNumber':this[_0x7a00('0x23')],'voiceStatusQueue':this[_0x7a00('0x16')],'interface':this['interface'],'onhold':this[_0x7a00('0x17')]};var _0x1d05eb=md5(JSON[_0x7a00('0x24')](_0x49a554));if(this[_0x7a00('0x3')]!==_0x1d05eb){this[_0x7a00('0x3')]=_0x1d05eb;io['to'](util['format'](_0x7a00('0x25'),_0x49a554[_0x7a00('0xa')]))[_0x7a00('0x26')](_0x7a00('0x27'),_[_0x7a00('0x28')](_0x49a554,['online']));io['emit'](_0x7a00('0x29'),_0x49a554);}};module[_0x7a00('0x2a')]=Agent; \ No newline at end of file diff --git a/server/services/ami/model/campaign.js b/server/services/ami/model/campaign.js index 982c452..602dcfa 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 _0x8d67=['dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','DESC','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','name','type','campaign','originated','temp','ivrTotalCallsDays','sendMessageOneNotActive','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency'];(function(_0x1061fe,_0x120054){var _0x1acd85=function(_0x49db54){while(--_0x49db54){_0x1061fe['push'](_0x1061fe['shift']());}};_0x1acd85(++_0x120054);}(_0x8d67,0x1a6));var _0x78d6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8d67[_0x3dd15e];return _0x231fd0;};'use strict';function Campaign(_0x37addf){this['id']=_0x37addf['id']||0x0;this['name']=_0x37addf[_0x78d6('0x0')]||'';this['type']=_0x37addf[_0x78d6('0x1')]||_0x78d6('0x2');this[_0x78d6('0x3')]=0x0;this[_0x78d6('0x4')]=0x0;this['ivrAnswerCallsDay']=0x0;this[_0x78d6('0x5')]=0x0;this['message']='';this[_0x78d6('0x6')]=!![];this[_0x78d6('0x7')]=_0x37addf[_0x78d6('0x7')];this[_0x78d6('0x8')]=_0x37addf[_0x78d6('0x8')];this[_0x78d6('0x9')]=_0x37addf[_0x78d6('0x9')]||null;this['dialGlobalInterval']=_0x37addf['dialGlobalInterval']?_0x37addf[_0x78d6('0xa')]:null;this[_0x78d6('0xb')]=_0x37addf['dialOriginateCallerIdName'];this[_0x78d6('0xc')]=_0x37addf['dialOriginateCallerIdNumber'];this[_0x78d6('0xd')]=_0x37addf[_0x78d6('0xd')]||0x1e;this[_0x78d6('0xe')]=_0x37addf[_0x78d6('0xe')];this[_0x78d6('0xf')]=_0x37addf[_0x78d6('0xf')];this[_0x78d6('0x10')]=_0x37addf[_0x78d6('0x10')];this[_0x78d6('0x11')]=_0x37addf['dialBusyRetryFrequency'];this[_0x78d6('0x12')]=_0x37addf['dialNoAnswerMaxRetry'];this[_0x78d6('0x13')]=_0x37addf[_0x78d6('0x13')];this['dialGlobalMaxRetry']=_0x37addf['dialGlobalMaxRetry'];this[_0x78d6('0x14')]=_0x37addf[_0x78d6('0x14')]||0x3;this[_0x78d6('0x15')]=_0x37addf[_0x78d6('0x15')]||0x96;this[_0x78d6('0x16')]=_0x37addf['dialDropMaxRetry']||0x3;this[_0x78d6('0x17')]=_0x37addf[_0x78d6('0x17')]||0x96;this[_0x78d6('0x18')]=_0x37addf[_0x78d6('0x18')]||0x3;this[_0x78d6('0x19')]=_0x37addf[_0x78d6('0x19')]||0x96;this[_0x78d6('0x1a')]=_0x37addf['dialMachineMaxRetry']||0x3;this[_0x78d6('0x1b')]=_0x37addf[_0x78d6('0x1b')]||0x96;this[_0x78d6('0x1c')]=_0x37addf[_0x78d6('0x1c')]||0x3;this[_0x78d6('0x1d')]=_0x37addf[_0x78d6('0x1d')]||0x96;this[_0x78d6('0x1e')]=_0x37addf[_0x78d6('0x1e')]||_0x78d6('0x1f');this[_0x78d6('0x20')]=_0x37addf[_0x78d6('0x20')]||undefined;this[_0x78d6('0x21')]=_0x37addf[_0x78d6('0x21')]||undefined;this[_0x78d6('0x22')]=_0x37addf[_0x78d6('0x22')]||undefined;this[_0x78d6('0x23')]=_0x37addf[_0x78d6('0x23')]?_0x37addf['TrunkBackup']:undefined;this['Trunk']=_0x37addf[_0x78d6('0x24')]?_0x37addf['Trunk']:undefined;this[_0x78d6('0x25')]=_0x37addf['Interval']?_0x37addf['Interval']:undefined;this[_0x78d6('0x26')]=_0x37addf[_0x78d6('0x26')]?_0x37addf['SquareProject']:undefined;this[_0x78d6('0x27')]=_0x37addf[_0x78d6('0x26')]?_0x37addf['SquareProject']['name']:undefined;this['dialAMDActive']=_0x37addf['dialAMDActive']||![];this['dialAMDInitialSilence']=_0x37addf[_0x78d6('0x28')];this[_0x78d6('0x29')]=_0x37addf[_0x78d6('0x29')];this[_0x78d6('0x2a')]=_0x37addf[_0x78d6('0x2a')];this[_0x78d6('0x2b')]=_0x37addf[_0x78d6('0x2b')];this[_0x78d6('0x2c')]=_0x37addf[_0x78d6('0x2c')];this[_0x78d6('0x2d')]=_0x37addf['dialAMDBetweenWordsSilence'];this[_0x78d6('0x2e')]=_0x37addf[_0x78d6('0x2e')];this[_0x78d6('0x2f')]=_0x37addf[_0x78d6('0x2f')];this[_0x78d6('0x30')]=_0x37addf[_0x78d6('0x30')];}module[_0x78d6('0x31')]=Campaign; \ No newline at end of file +var _0x00ae=['Trunk','Interval','SquareProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','name','type','campaign','temp','ivrTotalCallsDays','message','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','dialPrefix','dialRandomLastDigitCallerIdNumber','TrunkBackup'];(function(_0x30ad27,_0x750e0f){var _0x42242a=function(_0x352f81){while(--_0x352f81){_0x30ad27['push'](_0x30ad27['shift']());}};_0x42242a(++_0x750e0f);}(_0x00ae,0x150));var _0xe00a=function(_0x422905,_0x3bce3a){_0x422905=_0x422905-0x0;var _0x33dc6c=_0x00ae[_0x422905];return _0x33dc6c;};'use strict';function Campaign(_0x37309b){this['id']=_0x37309b['id']||0x0;this[_0xe00a('0x0')]=_0x37309b[_0xe00a('0x0')]||'';this[_0xe00a('0x1')]=_0x37309b[_0xe00a('0x1')]||_0xe00a('0x2');this['originated']=0x0;this[_0xe00a('0x3')]=0x0;this['ivrAnswerCallsDay']=0x0;this[_0xe00a('0x4')]=0x0;this[_0xe00a('0x5')]='';this['sendMessageOneNotActive']=!![];this['active']=_0x37309b[_0xe00a('0x6')];this[_0xe00a('0x7')]=_0x37309b[_0xe00a('0x7')];this[_0xe00a('0x8')]=_0x37309b['dialTimezone']||null;this[_0xe00a('0x9')]=_0x37309b[_0xe00a('0x9')]?_0x37309b[_0xe00a('0x9')]:null;this['dialOriginateCallerIdName']=_0x37309b[_0xe00a('0xa')];this['dialOriginateCallerIdNumber']=_0x37309b[_0xe00a('0xb')];this[_0xe00a('0xc')]=_0x37309b[_0xe00a('0xc')]||0x1e;this[_0xe00a('0xd')]=_0x37309b[_0xe00a('0xd')];this['dialCongestionRetryFrequency']=_0x37309b[_0xe00a('0xe')];this['dialBusyMaxRetry']=_0x37309b[_0xe00a('0xf')];this[_0xe00a('0x10')]=_0x37309b['dialBusyRetryFrequency'];this[_0xe00a('0x11')]=_0x37309b[_0xe00a('0x11')];this[_0xe00a('0x12')]=_0x37309b[_0xe00a('0x12')];this['dialGlobalMaxRetry']=_0x37309b[_0xe00a('0x13')];this['dialNoSuchNumberMaxRetry']=_0x37309b['dialNoSuchNumberMaxRetry']||0x3;this[_0xe00a('0x14')]=_0x37309b['dialNoSuchNumberRetryFrequency']||0x96;this[_0xe00a('0x15')]=_0x37309b[_0xe00a('0x15')]||0x3;this[_0xe00a('0x16')]=_0x37309b[_0xe00a('0x16')]||0x96;this['dialAbandonedMaxRetry']=_0x37309b['dialAbandonedMaxRetry']||0x3;this[_0xe00a('0x17')]=_0x37309b[_0xe00a('0x17')]||0x96;this[_0xe00a('0x18')]=_0x37309b[_0xe00a('0x18')]||0x3;this[_0xe00a('0x19')]=_0x37309b[_0xe00a('0x19')]||0x96;this[_0xe00a('0x1a')]=_0x37309b[_0xe00a('0x1a')]||0x3;this[_0xe00a('0x1b')]=_0x37309b[_0xe00a('0x1b')]||0x96;this[_0xe00a('0x1c')]=_0x37309b[_0xe00a('0x1c')]||'DESC';this['dialPrefix']=_0x37309b[_0xe00a('0x1d')]||undefined;this[_0xe00a('0x1e')]=_0x37309b[_0xe00a('0x1e')]||undefined;this['dialCutDigit']=_0x37309b['dialCutDigit']||undefined;this[_0xe00a('0x1f')]=_0x37309b[_0xe00a('0x1f')]?_0x37309b[_0xe00a('0x1f')]:undefined;this[_0xe00a('0x20')]=_0x37309b[_0xe00a('0x20')]?_0x37309b['Trunk']:undefined;this[_0xe00a('0x21')]=_0x37309b[_0xe00a('0x21')]?_0x37309b[_0xe00a('0x21')]:undefined;this['SquareProject']=_0x37309b[_0xe00a('0x22')]?_0x37309b[_0xe00a('0x22')]:undefined;this['dialQueueProject']=_0x37309b[_0xe00a('0x22')]?_0x37309b[_0xe00a('0x22')]['name']:undefined;this[_0xe00a('0x23')]=_0x37309b[_0xe00a('0x23')]||![];this['dialAMDInitialSilence']=_0x37309b[_0xe00a('0x24')];this['dialAMDGreeting']=_0x37309b[_0xe00a('0x25')];this[_0xe00a('0x26')]=_0x37309b[_0xe00a('0x26')];this['dialAMDTotalAnalysisTime']=_0x37309b[_0xe00a('0x27')];this[_0xe00a('0x28')]=_0x37309b[_0xe00a('0x28')];this[_0xe00a('0x29')]=_0x37309b[_0xe00a('0x29')];this['dialAMDMaximumNumberOfWords']=_0x37309b[_0xe00a('0x2a')];this[_0xe00a('0x2b')]=_0x37309b[_0xe00a('0x2b')];this[_0xe00a('0x2c')]=_0x37309b['dialAMDMaximumWordLength'];}module[_0xe00a('0x2d')]=Campaign; \ No newline at end of file diff --git a/server/services/ami/model/channel.js b/server/services/ami/model/channel.js index 41d221e..a3b1141 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 _0x9672=['queue','transfercalleridnum','transferType','exports','starttime','channel','calleridnum','calleridname','connectedlinenum','connectedlinename','context','uniqueid','linkedid','answertime','endtime','unmanaged','abandoned','lastapplication','lastdata','duration','billableseconds','type','tag','disposition','monitor','monitorFilename'];(function(_0x3c0cd6,_0x5ba428){var _0x4381ec=function(_0x2ab4b3){while(--_0x2ab4b3){_0x3c0cd6['push'](_0x3c0cd6['shift']());}};_0x4381ec(++_0x5ba428);}(_0x9672,0xee));var _0x2967=function(_0x2036e7,_0x26a4fe){_0x2036e7=_0x2036e7-0x0;var _0x24a75b=_0x9672[_0x2036e7];return _0x24a75b;};'use strict';function Channel(){this[_0x2967('0x0')]=null;this[_0x2967('0x1')]='';this['destinationchannel']='';this[_0x2967('0x2')]=0x0;this[_0x2967('0x3')]='';this[_0x2967('0x4')]=undefined;this[_0x2967('0x5')]=undefined;this['accountcode']=0x0;this[_0x2967('0x6')]='';this[_0x2967('0x7')]=0x0;this[_0x2967('0x8')]=0x0;this['exten']=0x0;this['answered']=![];this[_0x2967('0x9')]=null;this[_0x2967('0xa')]=null;this[_0x2967('0xb')]=![];this[_0x2967('0xc')]=![];this[_0x2967('0xd')]='';this[_0x2967('0xe')]='';this[_0x2967('0xf')]=0x0;this[_0x2967('0x10')]=0x0;this['holdtime']=0x0;this[_0x2967('0x11')]=null;this[_0x2967('0x12')]=null;this[_0x2967('0x13')]=null;this[_0x2967('0x14')]=![];this[_0x2967('0x15')]=null;this[_0x2967('0x16')]=null;this['monitors']=[];this[_0x2967('0x17')]=undefined;this['transferconnectedlinenum']=undefined;this[_0x2967('0x18')]=undefined;this['mohtime']=0x0;}module[_0x2967('0x19')]=Channel; \ No newline at end of file +var _0x59b9=['billableseconds','holdtime','type','tag','disposition','monitor','queue','monitors','transfercalleridnum','mohtime','exports','starttime','destinationchannel','calleridnum','calleridname','connectedlinenum','connectedlinename','accountcode','context','exten','answered','unmanaged','lastdata','duration'];(function(_0x288f5e,_0x205edd){var _0x476cc9=function(_0x796f53){while(--_0x796f53){_0x288f5e['push'](_0x288f5e['shift']());}};_0x476cc9(++_0x205edd);}(_0x59b9,0x15b));var _0x959b=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0x59b9[_0x138adb];return _0x1b27f2;};'use strict';function Channel(){this[_0x959b('0x0')]=null;this['channel']='';this[_0x959b('0x1')]='';this[_0x959b('0x2')]=0x0;this[_0x959b('0x3')]='';this[_0x959b('0x4')]=undefined;this[_0x959b('0x5')]=undefined;this[_0x959b('0x6')]=0x0;this[_0x959b('0x7')]='';this['uniqueid']=0x0;this['linkedid']=0x0;this[_0x959b('0x8')]=0x0;this[_0x959b('0x9')]=![];this['answertime']=null;this['endtime']=null;this[_0x959b('0xa')]=![];this['abandoned']=![];this['lastapplication']='';this[_0x959b('0xb')]='';this[_0x959b('0xc')]=0x0;this[_0x959b('0xd')]=0x0;this[_0x959b('0xe')]=0x0;this[_0x959b('0xf')]=null;this[_0x959b('0x10')]=null;this[_0x959b('0x11')]=null;this[_0x959b('0x12')]=![];this['monitorFilename']=null;this[_0x959b('0x13')]=null;this[_0x959b('0x14')]=[];this[_0x959b('0x15')]=undefined;this['transferconnectedlinenum']=undefined;this['transferType']=undefined;this[_0x959b('0x16')]=0x0;}module[_0x959b('0x17')]=Channel; \ No newline at end of file diff --git a/server/services/ami/model/deskAccount.js b/server/services/ami/model/deskAccount.js index de2eaae..09c8d2b 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 _0x95cf=['serverUrl','Configurations','name','username','remoteUri','authType','password','consumerKey','consumerSecret','token','tokenSecret'];(function(_0x180401,_0x1ffac6){var _0x32a876=function(_0x54ed5f){while(--_0x54ed5f){_0x180401['push'](_0x180401['shift']());}};_0x32a876(++_0x1ffac6);}(_0x95cf,0x14c));var _0xf95c=function(_0x2c6d0e,_0x1fcd30){_0x2c6d0e=_0x2c6d0e-0x0;var _0x52601a=_0x95cf[_0x2c6d0e];return _0x52601a;};'use strict';function DeskAccount(_0x42a74a){this['id']=_0x42a74a['id']||0x0;this[_0xf95c('0x0')]=_0x42a74a[_0xf95c('0x0')]||'';this['username']=_0x42a74a[_0xf95c('0x1')]||'';this[_0xf95c('0x2')]=_0x42a74a['remoteUri']||'';this[_0xf95c('0x3')]=_0x42a74a[_0xf95c('0x3')]||'';this['password']=_0x42a74a[_0xf95c('0x4')]||'';this[_0xf95c('0x5')]=_0x42a74a[_0xf95c('0x5')]||'';this[_0xf95c('0x6')]=_0x42a74a[_0xf95c('0x6')]||'';this[_0xf95c('0x7')]=_0x42a74a[_0xf95c('0x7')]||'';this[_0xf95c('0x8')]=_0x42a74a[_0xf95c('0x8')]||'';this['type']=_0x42a74a['type']||'';this[_0xf95c('0x9')]=_0x42a74a[_0xf95c('0x9')]||'';this[_0xf95c('0xa')]=_0x42a74a[_0xf95c('0xa')]||{};}module['exports']=DeskAccount; \ No newline at end of file +var _0x0076=['exports','username','authType','password','consumerKey','consumerSecret','token','tokenSecret','type','serverUrl','Configurations'];(function(_0x7d0f83,_0x43b7e3){var _0x7e1b2e=function(_0x130989){while(--_0x130989){_0x7d0f83['push'](_0x7d0f83['shift']());}};_0x7e1b2e(++_0x43b7e3);}(_0x0076,0x1da));var _0x6007=function(_0x101e7b,_0x4ef05b){_0x101e7b=_0x101e7b-0x0;var _0x4995c0=_0x0076[_0x101e7b];return _0x4995c0;};'use strict';function DeskAccount(_0x103929){this['id']=_0x103929['id']||0x0;this['name']=_0x103929['name']||'';this['username']=_0x103929[_0x6007('0x0')]||'';this['remoteUri']=_0x103929['remoteUri']||'';this[_0x6007('0x1')]=_0x103929[_0x6007('0x1')]||'';this['password']=_0x103929[_0x6007('0x2')]||'';this[_0x6007('0x3')]=_0x103929['consumerKey']||'';this['consumerSecret']=_0x103929[_0x6007('0x4')]||'';this[_0x6007('0x5')]=_0x103929['token']||'';this[_0x6007('0x6')]=_0x103929[_0x6007('0x6')]||'';this[_0x6007('0x7')]=_0x103929[_0x6007('0x7')]||'';this['serverUrl']=_0x103929[_0x6007('0x8')]||'';this[_0x6007('0x9')]=_0x103929[_0x6007('0x9')]||{};}module[_0x6007('0xa')]=DeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/dynamics365Account.js b/server/services/ami/model/dynamics365Account.js index abcdc28..0113ea5 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 _0x0108=['Configurations','CloudProvider','exports','name','password','remoteUri','tenantId','clientId','clientSecret','serverUrl','modernAuthentication'];(function(_0x31fb91,_0x3698df){var _0x4fdec9=function(_0x399a7a){while(--_0x399a7a){_0x31fb91['push'](_0x31fb91['shift']());}};_0x4fdec9(++_0x3698df);}(_0x0108,0x1c6));var _0x8010=function(_0x1daafa,_0x5562d5){_0x1daafa=_0x1daafa-0x0;var _0x421f30=_0x0108[_0x1daafa];return _0x421f30;};'use strict';function Dynamics365Account(_0x222dbc){this['id']=_0x222dbc['id']||0x0;this[_0x8010('0x0')]=_0x222dbc[_0x8010('0x0')]||'';this['username']=_0x222dbc['username']||'';this[_0x8010('0x1')]=_0x222dbc[_0x8010('0x1')]||'';this[_0x8010('0x2')]=_0x222dbc['remoteUri']||'';this[_0x8010('0x3')]=_0x222dbc[_0x8010('0x3')]||'';this[_0x8010('0x4')]=_0x222dbc[_0x8010('0x4')]||'';this['clientSecret']=_0x222dbc[_0x8010('0x5')]||{};this[_0x8010('0x6')]=_0x222dbc[_0x8010('0x6')]||'';this[_0x8010('0x7')]=_0x222dbc['modernAuthentication']||![];this[_0x8010('0x8')]=_0x222dbc[_0x8010('0x8')]||{};this['CloudProvider']=_0x222dbc[_0x8010('0x9')]||{};}module[_0x8010('0xa')]=Dynamics365Account; \ No newline at end of file +var _0x9057=['Configurations','exports','name','username','password','tenantId','clientId','clientSecret','serverUrl','modernAuthentication'];(function(_0x3881a0,_0x380173){var _0x28b3c1=function(_0x4aaaf0){while(--_0x4aaaf0){_0x3881a0['push'](_0x3881a0['shift']());}};_0x28b3c1(++_0x380173);}(_0x9057,0xb6));var _0x7905=function(_0xd685e,_0x360045){_0xd685e=_0xd685e-0x0;var _0x5ef5e0=_0x9057[_0xd685e];return _0x5ef5e0;};'use strict';function Dynamics365Account(_0x236b9d){this['id']=_0x236b9d['id']||0x0;this[_0x7905('0x0')]=_0x236b9d[_0x7905('0x0')]||'';this[_0x7905('0x1')]=_0x236b9d[_0x7905('0x1')]||'';this[_0x7905('0x2')]=_0x236b9d['password']||'';this['remoteUri']=_0x236b9d['remoteUri']||'';this[_0x7905('0x3')]=_0x236b9d[_0x7905('0x3')]||'';this['clientId']=_0x236b9d[_0x7905('0x4')]||'';this[_0x7905('0x5')]=_0x236b9d[_0x7905('0x5')]||{};this[_0x7905('0x6')]=_0x236b9d[_0x7905('0x6')]||'';this[_0x7905('0x7')]=_0x236b9d[_0x7905('0x7')]||![];this[_0x7905('0x8')]=_0x236b9d[_0x7905('0x8')]||{};this['CloudProvider']=_0x236b9d['CloudProvider']||{};}module[_0x7905('0x9')]=Dynamics365Account; \ No newline at end of file diff --git a/server/services/ami/model/faxAccount.js b/server/services/ami/model/faxAccount.js index 5848844..03fc85b 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 _0xa8c8=['Trunk','ListId','key','exports','name','description','ecm','headerinfo','localstationid','minrate','maxrate','modem','gateway','faxdetect','t38timeout','tech','SIP'];(function(_0x2e78e9,_0x42957c){var _0x35aad4=function(_0x360fa1){while(--_0x360fa1){_0x2e78e9['push'](_0x2e78e9['shift']());}};_0x35aad4(++_0x42957c);}(_0xa8c8,0x114));var _0x8a8c=function(_0x8fd2d8,_0x21206e){_0x8fd2d8=_0x8fd2d8-0x0;var _0x5ab22e=_0xa8c8[_0x8fd2d8];return _0x5ab22e;};'use strict';function FaxAccount(_0x2873ef){this['id']=_0x2873ef['id']||0x0;this[_0x8a8c('0x0')]=_0x2873ef[_0x8a8c('0x0')]||'';this[_0x8a8c('0x1')]=_0x2873ef['description'];this[_0x8a8c('0x2')]=_0x2873ef['ecm'];this[_0x8a8c('0x3')]=_0x2873ef[_0x8a8c('0x3')];this[_0x8a8c('0x4')]=_0x2873ef[_0x8a8c('0x4')];this['minrate']=_0x2873ef[_0x8a8c('0x5')]||0x960;this[_0x8a8c('0x6')]=_0x2873ef['maxrate']||0x3840;this[_0x8a8c('0x7')]=_0x2873ef[_0x8a8c('0x7')]||'v17,v27,v29';this[_0x8a8c('0x8')]=_0x2873ef[_0x8a8c('0x8')]||'no';this[_0x8a8c('0x9')]=_0x2873ef[_0x8a8c('0x9')]||'no';this['t38timeout']=_0x2873ef[_0x8a8c('0xa')]||0x1388;this[_0x8a8c('0xb')]=_0x2873ef[_0x8a8c('0xb')]||_0x8a8c('0xc');this[_0x8a8c('0xd')]=_0x2873ef[_0x8a8c('0xd')]?_0x2873ef[_0x8a8c('0xd')]:undefined;this[_0x8a8c('0xe')]=_0x2873ef[_0x8a8c('0xe')];this[_0x8a8c('0xf')]=_0x2873ef[_0x8a8c('0xf')];}module[_0x8a8c('0x10')]=FaxAccount; \ No newline at end of file +var _0x20c6=['name','description','ecm','headerinfo','localstationid','minrate','maxrate','modem','v17,v27,v29','gateway','faxdetect','t38timeout','tech','SIP','Trunk','ListId','key','exports'];(function(_0x285dad,_0xbb15bf){var _0x3c0494=function(_0xa1a6e4){while(--_0xa1a6e4){_0x285dad['push'](_0x285dad['shift']());}};_0x3c0494(++_0xbb15bf);}(_0x20c6,0xb4));var _0x620c=function(_0x160af8,_0xaa32a3){_0x160af8=_0x160af8-0x0;var _0x3baef8=_0x20c6[_0x160af8];return _0x3baef8;};'use strict';function FaxAccount(_0x453d62){this['id']=_0x453d62['id']||0x0;this['name']=_0x453d62[_0x620c('0x0')]||'';this[_0x620c('0x1')]=_0x453d62[_0x620c('0x1')];this[_0x620c('0x2')]=_0x453d62[_0x620c('0x2')];this[_0x620c('0x3')]=_0x453d62[_0x620c('0x3')];this[_0x620c('0x4')]=_0x453d62[_0x620c('0x4')];this[_0x620c('0x5')]=_0x453d62[_0x620c('0x5')]||0x960;this['maxrate']=_0x453d62[_0x620c('0x6')]||0x3840;this[_0x620c('0x7')]=_0x453d62['modem']||_0x620c('0x8');this[_0x620c('0x9')]=_0x453d62[_0x620c('0x9')]||'no';this[_0x620c('0xa')]=_0x453d62[_0x620c('0xa')]||'no';this[_0x620c('0xb')]=_0x453d62['t38timeout']||0x1388;this['tech']=_0x453d62[_0x620c('0xc')]||_0x620c('0xd');this[_0x620c('0xe')]=_0x453d62[_0x620c('0xe')]?_0x453d62[_0x620c('0xe')]:undefined;this[_0x620c('0xf')]=_0x453d62[_0x620c('0xf')];this[_0x620c('0x10')]=_0x453d62[_0x620c('0x10')];}module[_0x620c('0x11')]=FaxAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshdeskAccount.js b/server/services/ami/model/freshdeskAccount.js index 69e95c3..e7482c2 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 _0x22fa=['exports','name','username','apiKey','serverUrl','Configurations'];(function(_0x3ec1da,_0x1e36f5){var _0x472358=function(_0x1d41b1){while(--_0x1d41b1){_0x3ec1da['push'](_0x3ec1da['shift']());}};_0x472358(++_0x1e36f5);}(_0x22fa,0xd9));var _0xa22f=function(_0x71a6e0,_0x19ff83){_0x71a6e0=_0x71a6e0-0x0;var _0x264938=_0x22fa[_0x71a6e0];return _0x264938;};'use strict';function FreshdeskAccount(_0x3283d6){this['id']=_0x3283d6['id']||0x0;this[_0xa22f('0x0')]=_0x3283d6['name']||'';this[_0xa22f('0x1')]=_0x3283d6[_0xa22f('0x1')]||'';this[_0xa22f('0x2')]=_0x3283d6['token']||'';this['remoteUri']=_0x3283d6['remoteUri']||'';this[_0xa22f('0x3')]=_0x3283d6['serverUrl']||'';this[_0xa22f('0x4')]=_0x3283d6[_0xa22f('0x4')]||{};}module[_0xa22f('0x5')]=FreshdeskAccount; \ No newline at end of file +var _0xb8c9=['name','username','apiKey','token','remoteUri','serverUrl','Configurations','exports'];(function(_0x5defe5,_0x454030){var _0x1a53f2=function(_0x5d5502){while(--_0x5d5502){_0x5defe5['push'](_0x5defe5['shift']());}};_0x1a53f2(++_0x454030);}(_0xb8c9,0x1a8));var _0x9b8c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb8c9[_0x3dd15e];return _0x231fd0;};'use strict';function FreshdeskAccount(_0x4181b2){this['id']=_0x4181b2['id']||0x0;this[_0x9b8c('0x0')]=_0x4181b2[_0x9b8c('0x0')]||'';this[_0x9b8c('0x1')]=_0x4181b2[_0x9b8c('0x1')]||'';this[_0x9b8c('0x2')]=_0x4181b2[_0x9b8c('0x3')]||'';this[_0x9b8c('0x4')]=_0x4181b2[_0x9b8c('0x4')]||'';this[_0x9b8c('0x5')]=_0x4181b2[_0x9b8c('0x5')]||'';this[_0x9b8c('0x6')]=_0x4181b2['Configurations']||{};}module[_0x9b8c('0x7')]=FreshdeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshsalesAccount.js b/server/services/ami/model/freshsalesAccount.js index ee840b0..4e37195 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 _0x432b=['serverUrl','Configurations','exports','name','username','apiKey','remoteUri'];(function(_0x5b672a,_0x4ffeb6){var _0x1e4aa0=function(_0x3812ce){while(--_0x3812ce){_0x5b672a['push'](_0x5b672a['shift']());}};_0x1e4aa0(++_0x4ffeb6);}(_0x432b,0x161));var _0xb432=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x432b[_0x3dd15e];return _0x231fd0;};'use strict';function FreshsalesAccount(_0x582e8e){this['id']=_0x582e8e['id']||0x0;this['name']=_0x582e8e[_0xb432('0x0')]||'';this[_0xb432('0x1')]=_0x582e8e[_0xb432('0x1')]||'';this[_0xb432('0x2')]=_0x582e8e['token']||'';this['remoteUri']=_0x582e8e[_0xb432('0x3')]||'';this['serverUrl']=_0x582e8e[_0xb432('0x4')]||'';this['Configurations']=_0x582e8e[_0xb432('0x5')]||{};}module[_0xb432('0x6')]=FreshsalesAccount; \ No newline at end of file +var _0xf842=['Configurations','exports','name','username','apiKey','token','remoteUri','serverUrl'];(function(_0x5c0cf4,_0x265aa9){var _0x3d9f50=function(_0x10f73d){while(--_0x10f73d){_0x5c0cf4['push'](_0x5c0cf4['shift']());}};_0x3d9f50(++_0x265aa9);}(_0xf842,0x172));var _0x2f84=function(_0x2d89ce,_0x24d58d){_0x2d89ce=_0x2d89ce-0x0;var _0x3fad10=_0xf842[_0x2d89ce];return _0x3fad10;};'use strict';function FreshsalesAccount(_0x3344){this['id']=_0x3344['id']||0x0;this[_0x2f84('0x0')]=_0x3344[_0x2f84('0x0')]||'';this[_0x2f84('0x1')]=_0x3344['username']||'';this[_0x2f84('0x2')]=_0x3344[_0x2f84('0x3')]||'';this[_0x2f84('0x4')]=_0x3344[_0x2f84('0x4')]||'';this[_0x2f84('0x5')]=_0x3344['serverUrl']||'';this[_0x2f84('0x6')]=_0x3344[_0x2f84('0x6')]||{};}module[_0x2f84('0x7')]=FreshsalesAccount; \ No newline at end of file diff --git a/server/services/ami/model/queueReport.js b/server/services/ami/model/queueReport.js index 9beeeab..9ca5a93 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 _0x934a=['assigned','lastAssignedTo','motionChannel','routealias','mohtime','variables','exports','type','inbound','uniqueid','calleridnum','position','count','queuecallerabandon','queuecallerabandonAt','queuecallercomplete','queuecallerexit','originalposition','connectedlinenum','connectedlinename','accountcode','context','exten','priority','holdtime'];(function(_0x13097d,_0x527f05){var _0x4066bd=function(_0x4de9b9){while(--_0x4de9b9){_0x13097d['push'](_0x13097d['shift']());}};_0x4066bd(++_0x527f05);}(_0x934a,0x14c));var _0xa934=function(_0x3cc9d9,_0x69ed38){_0x3cc9d9=_0x3cc9d9-0x0;var _0x1a425d=_0x934a[_0x3cc9d9];return _0x1a425d;};'use strict';function QueueReport(){this[_0xa934('0x0')]=_0xa934('0x1');this[_0xa934('0x2')]='';this[_0xa934('0x3')]='';this['calleridname']='';this['queue']='';this['queuecallerjoinAt']=null;this['queuecallerleaveAt']=null;this[_0xa934('0x4')]=0x1;this[_0xa934('0x5')]=0x1;this[_0xa934('0x6')]=![];this[_0xa934('0x7')]=null;this[_0xa934('0x8')]=![];this['queuecallercompleteAt']=null;this[_0xa934('0x9')]=![];this['queuecallerexitAt']=null;this[_0xa934('0xa')]=0x1;this['channel']='';this[_0xa934('0xb')]='';this[_0xa934('0xc')]='';this[_0xa934('0xd')]='';this[_0xa934('0xe')]='';this[_0xa934('0xf')]='';this[_0xa934('0x10')]='';this[_0xa934('0x11')]=0x0;this[_0xa934('0x12')]=![];this[_0xa934('0x13')]='';this[_0xa934('0x14')]='voice';this[_0xa934('0x15')]=null;this[_0xa934('0x16')]=0x0;this[_0xa934('0x17')]={};}module[_0xa934('0x18')]=QueueReport; \ No newline at end of file +var _0x47eb=['mohtime','variables','exports','inbound','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','queuecallerleaveAt','position','count','queuecallerabandon','queuecallerabandonAt','queuecallercompleteAt','queuecallerexitAt','originalposition','channel','connectedlinenum','accountcode','context','exten','priority','holdtime','assigned','motionChannel','voice','routealias'];(function(_0x7ca5f3,_0x3809db){var _0x1a8505=function(_0x25bb80){while(--_0x25bb80){_0x7ca5f3['push'](_0x7ca5f3['shift']());}};_0x1a8505(++_0x3809db);}(_0x47eb,0x153));var _0xb47e=function(_0x342700,_0x569f75){_0x342700=_0x342700-0x0;var _0x53406f=_0x47eb[_0x342700];return _0x53406f;};'use strict';function QueueReport(){this['type']=_0xb47e('0x0');this[_0xb47e('0x1')]='';this[_0xb47e('0x2')]='';this[_0xb47e('0x3')]='';this[_0xb47e('0x4')]='';this[_0xb47e('0x5')]=null;this[_0xb47e('0x6')]=null;this[_0xb47e('0x7')]=0x1;this[_0xb47e('0x8')]=0x1;this[_0xb47e('0x9')]=![];this[_0xb47e('0xa')]=null;this['queuecallercomplete']=![];this[_0xb47e('0xb')]=null;this['queuecallerexit']=![];this[_0xb47e('0xc')]=null;this[_0xb47e('0xd')]=0x1;this[_0xb47e('0xe')]='';this[_0xb47e('0xf')]='';this['connectedlinename']='';this[_0xb47e('0x10')]='';this[_0xb47e('0x11')]='';this[_0xb47e('0x12')]='';this[_0xb47e('0x13')]='';this[_0xb47e('0x14')]=0x0;this[_0xb47e('0x15')]=![];this['lastAssignedTo']='';this[_0xb47e('0x16')]=_0xb47e('0x17');this[_0xb47e('0x18')]=null;this[_0xb47e('0x19')]=0x0;this[_0xb47e('0x1a')]={};}module[_0xb47e('0x1b')]=QueueReport; \ No newline at end of file diff --git a/server/services/ami/model/salesforceAccount.js b/server/services/ami/model/salesforceAccount.js index 06890cb..0ed58af 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 _0x7887=['serverUrl','Configurations','exports','name','username','remoteUri','password','clientId','clientSecret','securityToken','type','integrationTab'];(function(_0x24061a,_0x1c9f4d){var _0x82054e=function(_0x2ec346){while(--_0x2ec346){_0x24061a['push'](_0x24061a['shift']());}};_0x82054e(++_0x1c9f4d);}(_0x7887,0x1b3));var _0x7788=function(_0x497e4f,_0x51729a){_0x497e4f=_0x497e4f-0x0;var _0x1568e5=_0x7887[_0x497e4f];return _0x1568e5;};'use strict';function SalesforceAccount(_0x255362){this['id']=_0x255362['id']||0x0;this['name']=_0x255362[_0x7788('0x0')]||'';this[_0x7788('0x1')]=_0x255362[_0x7788('0x1')]||'';this[_0x7788('0x2')]=_0x255362[_0x7788('0x2')]||'';this[_0x7788('0x3')]=_0x255362['password']||'';this[_0x7788('0x4')]=_0x255362['clientId']||'';this[_0x7788('0x5')]=_0x255362[_0x7788('0x5')]||'';this['securityToken']=_0x255362[_0x7788('0x6')]||'';this[_0x7788('0x7')]=_0x255362[_0x7788('0x7')]||_0x7788('0x8');this[_0x7788('0x9')]=_0x255362[_0x7788('0x9')]||'';this[_0x7788('0xa')]=_0x255362[_0x7788('0xa')]||{};}module[_0x7788('0xb')]=SalesforceAccount; \ No newline at end of file +var _0xe319=['Configurations','exports','name','username','remoteUri','password','clientId','clientSecret','securityToken','type'];(function(_0x26c6b9,_0x20e973){var _0x35f9b3=function(_0x2095e7){while(--_0x2095e7){_0x26c6b9['push'](_0x26c6b9['shift']());}};_0x35f9b3(++_0x20e973);}(_0xe319,0xac));var _0x9e31=function(_0x59a4d9,_0x4e2e42){_0x59a4d9=_0x59a4d9-0x0;var _0x402f8a=_0xe319[_0x59a4d9];return _0x402f8a;};'use strict';function SalesforceAccount(_0x393642){this['id']=_0x393642['id']||0x0;this['name']=_0x393642[_0x9e31('0x0')]||'';this[_0x9e31('0x1')]=_0x393642[_0x9e31('0x1')]||'';this[_0x9e31('0x2')]=_0x393642[_0x9e31('0x2')]||'';this[_0x9e31('0x3')]=_0x393642[_0x9e31('0x3')]||'';this['clientId']=_0x393642[_0x9e31('0x4')]||'';this['clientSecret']=_0x393642[_0x9e31('0x5')]||'';this[_0x9e31('0x6')]=_0x393642[_0x9e31('0x6')]||'';this[_0x9e31('0x7')]=_0x393642['type']||'integrationTab';this['serverUrl']=_0x393642['serverUrl']||'';this[_0x9e31('0x8')]=_0x393642[_0x9e31('0x8')]||{};}module[_0x9e31('0x9')]=SalesforceAccount; \ No newline at end of file diff --git a/server/services/ami/model/servicenowAccount.js b/server/services/ami/model/servicenowAccount.js index 376a5af..6fb33ea 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 _0x4ed3=['username','password','remoteUri','serverUrl','Configurations','name'];(function(_0x220f3f,_0x11c540){var _0x1f170e=function(_0x2c0ec9){while(--_0x2c0ec9){_0x220f3f['push'](_0x220f3f['shift']());}};_0x1f170e(++_0x11c540);}(_0x4ed3,0x71));var _0x34ed=function(_0x3e9c17,_0x2a84a9){_0x3e9c17=_0x3e9c17-0x0;var _0x24c41d=_0x4ed3[_0x3e9c17];return _0x24c41d;};'use strict';function ServicenowAccount(_0x373cd6){this['id']=_0x373cd6['id']||0x0;this[_0x34ed('0x0')]=_0x373cd6[_0x34ed('0x0')]||'';this[_0x34ed('0x1')]=_0x373cd6[_0x34ed('0x1')]||'';this[_0x34ed('0x2')]=_0x373cd6[_0x34ed('0x2')]||'';this[_0x34ed('0x3')]=_0x373cd6[_0x34ed('0x3')]||'';this[_0x34ed('0x4')]=_0x373cd6[_0x34ed('0x4')]||'';this['Configurations']=_0x373cd6[_0x34ed('0x5')]||{};}module['exports']=ServicenowAccount; \ No newline at end of file +var _0x4944=['name','username','password','serverUrl','Configurations','exports'];(function(_0x4583d0,_0x24551f){var _0x7b3c5a=function(_0x14946a){while(--_0x14946a){_0x4583d0['push'](_0x4583d0['shift']());}};_0x7b3c5a(++_0x24551f);}(_0x4944,0x17a));var _0x4494=function(_0x17214a,_0x1d1481){_0x17214a=_0x17214a-0x0;var _0x211696=_0x4944[_0x17214a];return _0x211696;};'use strict';function ServicenowAccount(_0x19d534){this['id']=_0x19d534['id']||0x0;this[_0x4494('0x0')]=_0x19d534[_0x4494('0x0')]||'';this['username']=_0x19d534[_0x4494('0x1')]||'';this[_0x4494('0x2')]=_0x19d534['password']||'';this['remoteUri']=_0x19d534['remoteUri']||'';this[_0x4494('0x3')]=_0x19d534[_0x4494('0x3')]||'';this[_0x4494('0x4')]=_0x19d534[_0x4494('0x4')]||{};}module[_0x4494('0x5')]=ServicenowAccount; \ No newline at end of file diff --git a/server/services/ami/model/sugarcrmAccount.js b/server/services/ami/model/sugarcrmAccount.js index 080a537..ea9c5da 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 _0x3600=['remoteUri','serverUrl','Configurations','exports','name','username','password'];(function(_0x5d7181,_0x28d3a2){var _0x4c79d0=function(_0x174a01){while(--_0x174a01){_0x5d7181['push'](_0x5d7181['shift']());}};_0x4c79d0(++_0x28d3a2);}(_0x3600,0x13f));var _0x0360=function(_0x11ab98,_0x131df7){_0x11ab98=_0x11ab98-0x0;var _0x143e18=_0x3600[_0x11ab98];return _0x143e18;};'use strict';function SugarcrmAccount(_0x5ec36f){this['id']=_0x5ec36f['id']||0x0;this['name']=_0x5ec36f[_0x0360('0x0')]||'';this[_0x0360('0x1')]=_0x5ec36f[_0x0360('0x1')]||'';this[_0x0360('0x2')]=_0x5ec36f['password']||'';this[_0x0360('0x3')]=_0x5ec36f[_0x0360('0x3')]||'';this['serverUrl']=_0x5ec36f[_0x0360('0x4')]||'';this[_0x0360('0x5')]=_0x5ec36f[_0x0360('0x5')]||{};}module[_0x0360('0x6')]=SugarcrmAccount; \ No newline at end of file +var _0xa5d8=['serverUrl','Configurations','name','username','password','remoteUri'];(function(_0x11aa15,_0x14e136){var _0x1e821e=function(_0x3b0911){while(--_0x3b0911){_0x11aa15['push'](_0x11aa15['shift']());}};_0x1e821e(++_0x14e136);}(_0xa5d8,0x1e2));var _0x8a5d=function(_0x428dac,_0x5bacbf){_0x428dac=_0x428dac-0x0;var _0x5d01b7=_0xa5d8[_0x428dac];return _0x5d01b7;};'use strict';function SugarcrmAccount(_0x423301){this['id']=_0x423301['id']||0x0;this[_0x8a5d('0x0')]=_0x423301[_0x8a5d('0x0')]||'';this[_0x8a5d('0x1')]=_0x423301[_0x8a5d('0x1')]||'';this[_0x8a5d('0x2')]=_0x423301[_0x8a5d('0x2')]||'';this[_0x8a5d('0x3')]=_0x423301[_0x8a5d('0x3')]||'';this[_0x8a5d('0x4')]=_0x423301[_0x8a5d('0x4')]||'';this[_0x8a5d('0x5')]=_0x423301[_0x8a5d('0x5')]||{};}module['exports']=SugarcrmAccount; \ No newline at end of file diff --git a/server/services/ami/model/telephone.js b/server/services/ami/model/telephone.js index 14dbcdd..a54d96d 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 _0xb458=['address','exports','name','accountcode','state','unknown','stateTime','status'];(function(_0x5b1c50,_0x56e694){var _0x2d379b=function(_0x981b9c){while(--_0x981b9c){_0x5b1c50['push'](_0x5b1c50['shift']());}};_0x2d379b(++_0x56e694);}(_0xb458,0xca));var _0x8b45=function(_0x21694f,_0x3a2fce){_0x21694f=_0x21694f-0x0;var _0x1aab8c=_0xb458[_0x21694f];return _0x1aab8c;};'use strict';function Telephone(_0x22e3ff){this['id']=_0x22e3ff['id']||0x0;this[_0x8b45('0x0')]=_0x22e3ff[_0x8b45('0x0')]||'';this[_0x8b45('0x1')]=_0x22e3ff['accountcode']||'';this[_0x8b45('0x2')]=_0x8b45('0x3');this[_0x8b45('0x4')]=0x0;this[_0x8b45('0x5')]=_0x8b45('0x3');this[_0x8b45('0x6')]='';}module[_0x8b45('0x7')]=Telephone; \ No newline at end of file +var _0x8c2c=['accountcode','state','unknown','stateTime','status','exports','name'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x8c2c,0x92));var _0xc8c2=function(_0x42f672,_0x3e2c70){_0x42f672=_0x42f672-0x0;var _0x317fa1=_0x8c2c[_0x42f672];return _0x317fa1;};'use strict';function Telephone(_0x505966){this['id']=_0x505966['id']||0x0;this[_0xc8c2('0x0')]=_0x505966[_0xc8c2('0x0')]||'';this[_0xc8c2('0x1')]=_0x505966[_0xc8c2('0x1')]||'';this[_0xc8c2('0x2')]=_0xc8c2('0x3');this[_0xc8c2('0x4')]=0x0;this[_0xc8c2('0x5')]='unknown';this['address']='';}module[_0xc8c2('0x6')]=Telephone; \ No newline at end of file diff --git a/server/services/ami/model/template.js b/server/services/ami/model/template.js index 551e67a..1c1ecf6 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(_0x18731a,_0x4ab016){var _0x205175=function(_0x4d6c19){while(--_0x4d6c19){_0x18731a['push'](_0x18731a['shift']());}};_0x205175(++_0x4ab016);}(_0xa9e0,0x123));var _0x0a9e=function(_0x37c22c,_0x28a70d){_0x37c22c=_0x37c22c-0x0;var _0x119d79=_0xa9e0[_0x37c22c];return _0x119d79;};'use strict';function template(_0x1f0015){this['id']=_0x1f0015['id']||0x0;this[_0x0a9e('0x0')]=_0x1f0015[_0x0a9e('0x0')]||'';this['html']=_0x1f0015['html']||'';}module[_0x0a9e('0x1')]=template; \ No newline at end of file +var _0xa9e0=['exports','name'];(function(_0x524df1,_0x56097a){var _0x35c768=function(_0x1b243e){while(--_0x1b243e){_0x524df1['push'](_0x524df1['shift']());}};_0x35c768(++_0x56097a);}(_0xa9e0,0x123));var _0x0a9e=function(_0xf0bcac,_0x531755){_0xf0bcac=_0xf0bcac-0x0;var _0x4e4c65=_0xa9e0[_0xf0bcac];return _0x4e4c65;};'use strict';function template(_0x1f0015){this['id']=_0x1f0015['id']||0x0;this[_0x0a9e('0x0')]=_0x1f0015[_0x0a9e('0x0')]||'';this['html']=_0x1f0015['html']||'';}module[_0x0a9e('0x1')]=template; \ No newline at end of file diff --git a/server/services/ami/model/trigger.js b/server/services/ami/model/trigger.js index 2c096fa..67df2b3 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 _0x9ffd=['Actions','exports','name','channel','voice','status','AllConditions','AnyConditions'];(function(_0x300c74,_0x46cc67){var _0x4ab187=function(_0xd8db9a){while(--_0xd8db9a){_0x300c74['push'](_0x300c74['shift']());}};_0x4ab187(++_0x46cc67);}(_0x9ffd,0xaa));var _0xd9ff=function(_0x320ddc,_0x12e648){_0x320ddc=_0x320ddc-0x0;var _0x20fcc7=_0x9ffd[_0x320ddc];return _0x20fcc7;};'use strict';function Trigger(_0x4c26a1){this['id']=_0x4c26a1['id']||0x0;this[_0xd9ff('0x0')]=_0x4c26a1[_0xd9ff('0x0')]||'';this['channel']=_0x4c26a1[_0xd9ff('0x1')]||_0xd9ff('0x2');this[_0xd9ff('0x3')]=_0x4c26a1[_0xd9ff('0x3')]||![];this['AllConditions']=_0x4c26a1[_0xd9ff('0x4')]||[];this[_0xd9ff('0x5')]=_0x4c26a1['AnyConditions']||[];this[_0xd9ff('0x6')]=_0x4c26a1[_0xd9ff('0x6')]||[];}module[_0xd9ff('0x7')]=Trigger; \ No newline at end of file +var _0x1a85=['status','AllConditions','AnyConditions','Actions','name','channel'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x1a85,0x178));var _0x51a8=function(_0x2c984d,_0x5a6f2f){_0x2c984d=_0x2c984d-0x0;var _0x31df62=_0x1a85[_0x2c984d];return _0x31df62;};'use strict';function Trigger(_0x4570ac){this['id']=_0x4570ac['id']||0x0;this['name']=_0x4570ac[_0x51a8('0x0')]||'';this[_0x51a8('0x1')]=_0x4570ac[_0x51a8('0x1')]||'voice';this['status']=_0x4570ac[_0x51a8('0x2')]||![];this[_0x51a8('0x3')]=_0x4570ac[_0x51a8('0x3')]||[];this['AnyConditions']=_0x4570ac[_0x51a8('0x4')]||[];this['Actions']=_0x4570ac[_0x51a8('0x5')]||[];}module['exports']=Trigger; \ No newline at end of file diff --git a/server/services/ami/model/trunk.js b/server/services/ami/model/trunk.js index 8c0aa5e..c8d4398 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 _0x3a7a=['defaultuser','exports','active','name','state','registry','indexOf','split','host','port','domain','refresh','unknown','address'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x3a7a,0x10c));var _0xa3a7=function(_0x5ec453,_0x30b0ba){_0x5ec453=_0x5ec453-0x0;var _0x25548f=_0x3a7a[_0x5ec453];return _0x25548f;};'use strict';function Trunk(_0x1b6280){this['id']=_0x1b6280['id']||0x0;this[_0xa3a7('0x0')]=_0x1b6280[_0xa3a7('0x0')]||![];this[_0xa3a7('0x1')]=_0x1b6280[_0xa3a7('0x1')]||'';this[_0xa3a7('0x2')]='unknown';this['stateTime']=0x0;this['status']='unknown';this['registry']=_0x1b6280[_0xa3a7('0x3')]&&_0x1b6280[_0xa3a7('0x3')][_0xa3a7('0x4')](':')?_0x1b6280[_0xa3a7('0x3')][_0xa3a7('0x5')](':')[0x0]:'';this[_0xa3a7('0x6')]='';this[_0xa3a7('0x7')]='';this[_0xa3a7('0x8')]='';this['domainport']='';this[_0xa3a7('0x9')]='';this['stateRegistry']=_0xa3a7('0xa');this['registrationtime']='';this[_0xa3a7('0xb')]='';this['defaultuser']=_0x1b6280[_0xa3a7('0xc')]||'';}module[_0xa3a7('0xd')]=Trunk; \ No newline at end of file +var _0x729e=['name','state','unknown','stateTime','status','registry','host','domainport','refresh','stateRegistry','registrationtime','address','defaultuser','exports','active'];(function(_0x368bba,_0x1f625b){var _0x409f8f=function(_0x463373){while(--_0x463373){_0x368bba['push'](_0x368bba['shift']());}};_0x409f8f(++_0x1f625b);}(_0x729e,0x1c1));var _0xe729=function(_0x4a0acc,_0x4d04a7){_0x4a0acc=_0x4a0acc-0x0;var _0x30fd32=_0x729e[_0x4a0acc];return _0x30fd32;};'use strict';function Trunk(_0x59bde4){this['id']=_0x59bde4['id']||0x0;this[_0xe729('0x0')]=_0x59bde4[_0xe729('0x0')]||![];this[_0xe729('0x1')]=_0x59bde4[_0xe729('0x1')]||'';this[_0xe729('0x2')]=_0xe729('0x3');this[_0xe729('0x4')]=0x0;this[_0xe729('0x5')]=_0xe729('0x3');this[_0xe729('0x6')]=_0x59bde4[_0xe729('0x6')]&&_0x59bde4[_0xe729('0x6')]['indexOf'](':')?_0x59bde4[_0xe729('0x6')]['split'](':')[0x0]:'';this[_0xe729('0x7')]='';this['port']='';this['domain']='';this[_0xe729('0x8')]='';this[_0xe729('0x9')]='';this[_0xe729('0xa')]=_0xe729('0x3');this[_0xe729('0xb')]='';this[_0xe729('0xc')]='';this[_0xe729('0xd')]=_0x59bde4['defaultuser']||'';}module[_0xe729('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 299da4f..7012237 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 _0x7554=['recordingFormat','none','mandatoryDisposition','exports','exten'];(function(_0x3211fe,_0x61867f){var _0x20b1db=function(_0x21ee72){while(--_0x21ee72){_0x3211fe['push'](_0x3211fe['shift']());}};_0x20b1db(++_0x61867f);}(_0x7554,0x121));var _0x4755=function(_0x387ced,_0x1e694e){_0x387ced=_0x387ced-0x0;var _0x269551=_0x7554[_0x387ced];return _0x269551;};'use strict';function voiceExtension(_0x2466f3){this['id']=_0x2466f3['id']||0x0;this[_0x4755('0x0')]=_0x2466f3[_0x4755('0x0')]||'';this[_0x4755('0x1')]=_0x2466f3['recordingFormat']||_0x4755('0x2');this[_0x4755('0x3')]=_0x2466f3[_0x4755('0x3')]||![];}module[_0x4755('0x4')]=voiceExtension; \ No newline at end of file +var _0x8a3f=['none','exports','exten'];(function(_0x4dbdc3,_0x5a525d){var _0x1765ad=function(_0x516849){while(--_0x516849){_0x4dbdc3['push'](_0x4dbdc3['shift']());}};_0x1765ad(++_0x5a525d);}(_0x8a3f,0x86));var _0xf8a3=function(_0x2d10dc,_0x468c16){_0x2d10dc=_0x2d10dc-0x0;var _0x143084=_0x8a3f[_0x2d10dc];return _0x143084;};'use strict';function voiceExtension(_0x3205e2){this['id']=_0x3205e2['id']||0x0;this[_0xf8a3('0x0')]=_0x3205e2['exten']||'';this['recordingFormat']=_0x3205e2['recordingFormat']||_0xf8a3('0x1');this['mandatoryDisposition']=_0x3205e2['mandatoryDisposition']||![];}module[_0xf8a3('0x2')]=voiceExtension; \ No newline at end of file diff --git a/server/services/ami/model/voiceQueue.js b/server/services/ami/model/voiceQueue.js index 3e58b16..85997ed 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 _0x363e=['answered','sumDuration','sumHoldTime','sumBillable','unmanaged','available','busy','invalid','onHold','paused','ringing','ringInUse','talking','unknown','acw','acwTimeout','autopause','sendMessageOneNotActive','statusMessage','originated','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','anonymous','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','pTalking','timeout','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundDropCallsDayACS','outboundReCallsDay','outboundAbandonedDay','startPredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','erlangCalls','erlangAbandonmentRate','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','wav','wav49','fewestcalls','leastrecent','linear','random','ringall','roundrobin','rrmemory','rrordered','wrandom','name','monitor_format','type','waiting','total'];(function(_0x5f2300,_0x5e2143){var _0x538829=function(_0x33948b){while(--_0x33948b){_0x5f2300['push'](_0x5f2300['shift']());}};_0x538829(++_0x5e2143);}(_0x363e,0x179));var _0xe363=function(_0x10fd3c,_0x52fc99){_0x10fd3c=_0x10fd3c-0x0;var _0x4e062e=_0x363e[_0x10fd3c];return _0x4e062e;};'use strict';var monitorFormat={'wav':_0xe363('0x0'),'wav49':_0xe363('0x1'),'gsm':'gsm'};var strategy={'fewestcalls':_0xe363('0x2'),'leastrecent':_0xe363('0x3'),'linear':_0xe363('0x4'),'random':_0xe363('0x5'),'ringall':_0xe363('0x6'),'rr':_0xe363('0x7'),'rrmemory':_0xe363('0x8'),'rrordered':_0xe363('0x9'),'wrandom':_0xe363('0xa')};function VoiceQueue(_0x1834ca){this['id']=_0x1834ca['id']||0x0;this[_0xe363('0xb')]=_0x1834ca['name']||'';this[_0xe363('0xc')]=_0x1834ca[_0xe363('0xc')]||'';this[_0xe363('0xd')]=_0x1834ca[_0xe363('0xd')]||'inbound';this[_0xe363('0xe')]=0x0;this[_0xe363('0xf')]=0x0;this[_0xe363('0x10')]=0x0;this[_0xe363('0x11')]=0x0;this[_0xe363('0x12')]=0x0;this[_0xe363('0x13')]=0x0;this[_0xe363('0x14')]=0x0;this['abandoned']=0x0;this[_0xe363('0x15')]=0x0;this[_0xe363('0x16')]=0x0;this['inUse']=0x0;this[_0xe363('0x17')]=0x0;this['loggedIn']=0x0;this['notInUse']=0x0;this[_0xe363('0x18')]=0x0;this[_0xe363('0x19')]=0x0;this[_0xe363('0x1a')]=0x0;this[_0xe363('0x1b')]=0x0;this[_0xe363('0x1c')]=0x0;this['unavailable']=0x0;this[_0xe363('0x1d')]=0x0;this[_0xe363('0x1e')]=_0x1834ca['acw']||![];this[_0xe363('0x1f')]=_0x1834ca[_0xe363('0x1f')]||0xa;this['autopause']=_0x1834ca[_0xe363('0x20')]||'no';this[_0xe363('0x21')]=!![];this['message']='';this[_0xe363('0x22')]='';this[_0xe363('0x23')]=0x0;this['temp']=0x0;this[_0xe363('0x24')]=_0x1834ca[_0xe363('0x24')]||null;this[_0xe363('0x25')]=_0x1834ca['dialGlobalInterval']?_0x1834ca[_0xe363('0x25')]:null;this[_0xe363('0x26')]=_0x1834ca['dialActive'];this[_0xe363('0x27')]=_0x1834ca[_0xe363('0x27')]||_0xe363('0x28');this[_0xe363('0x29')]=_0x1834ca[_0xe363('0x29')]||0x0;this[_0xe363('0x2a')]=_0x1834ca['dialLimitQueue']||0x0;this[_0xe363('0x2b')]=_0x1834ca[_0xe363('0x2b')]||0x1;this[_0xe363('0x2c')]=_0x1834ca[_0xe363('0x2c')]||_0xe363('0x2d');this[_0xe363('0x2e')]=_0x1834ca[_0xe363('0x2e')]||0.03;this[_0xe363('0x2f')]=_0x1834ca[_0xe363('0x2f')]||0x258;this[_0xe363('0x30')]=_0x1834ca[_0xe363('0x30')]||_0xe363('0x31');this[_0xe363('0x32')]=_0x1834ca[_0xe363('0x32')]||_0xe363('0x31');this[_0xe363('0x33')]=_0x1834ca[_0xe363('0x33')]||0x1e;this[_0xe363('0x34')]=_0x1834ca[_0xe363('0x34')]||_0xe363('0x35');this[_0xe363('0x36')]=_0x1834ca[_0xe363('0x36')]||0x3;this['dialQueueProject']=_0x1834ca[_0xe363('0x37')]||undefined;this[_0xe363('0x38')]=_0x1834ca[_0xe363('0x38')]||0x3;this[_0xe363('0x39')]=_0x1834ca[_0xe363('0x39')]||0x96;this['dialBusyMaxRetry']=_0x1834ca[_0xe363('0x3a')]||0x3;this[_0xe363('0x3b')]=_0x1834ca['dialBusyRetryFrequency']||0x96;this[_0xe363('0x3c')]=_0x1834ca['dialNoAnswerMaxRetry']||0x3;this[_0xe363('0x3d')]=_0x1834ca[_0xe363('0x3d')]||0x96;this['dialNoSuchNumberMaxRetry']=_0x1834ca[_0xe363('0x3e')]||0x3;this[_0xe363('0x3f')]=_0x1834ca[_0xe363('0x3f')]||0x96;this['dialDropMaxRetry']=_0x1834ca[_0xe363('0x40')]||0x3;this[_0xe363('0x41')]=_0x1834ca[_0xe363('0x41')]||0x96;this[_0xe363('0x42')]=_0x1834ca['dialAbandonedMaxRetry']||0x3;this[_0xe363('0x43')]=_0x1834ca[_0xe363('0x43')]||0x96;this[_0xe363('0x44')]=_0x1834ca[_0xe363('0x44')]||0x3;this[_0xe363('0x45')]=_0x1834ca[_0xe363('0x45')]||0x96;this[_0xe363('0x46')]=_0x1834ca[_0xe363('0x46')]||0x3;this[_0xe363('0x47')]=_0x1834ca[_0xe363('0x47')]||0x96;this['callAdditionalPhoneAfterMin']=_0x1834ca['callAdditionalPhoneAfterMin']||0x3;this[_0xe363('0x48')]=_0x1834ca[_0xe363('0x48')]||0x4;this['Trunk']=_0x1834ca[_0xe363('0x49')]?_0x1834ca[_0xe363('0x49')]:undefined;this['TrunkBackup']=_0x1834ca[_0xe363('0x4a')]?_0x1834ca[_0xe363('0x4a')]:undefined;this[_0xe363('0x4b')]=_0x1834ca[_0xe363('0x4b')]||undefined;this['Interval']=_0x1834ca['Interval']?_0x1834ca[_0xe363('0x4c')]:undefined;this['dialOrderByScheduledAt']=_0x1834ca['dialOrderByScheduledAt']||_0xe363('0x4d');this[_0xe363('0x4e')]=_0x1834ca[_0xe363('0x4e')]||undefined;this[_0xe363('0x4f')]=_0x1834ca[_0xe363('0x4f')]||undefined;this[_0xe363('0x50')]=strategy[_0x1834ca[_0xe363('0x50')]];this[_0xe363('0x51')]=!![];this[_0xe363('0x52')]=_0x1834ca[_0xe363('0x52')]||![];this[_0xe363('0x53')]=_0x1834ca[_0xe363('0x53')];this['dialAMDGreeting']=_0x1834ca['dialAMDGreeting'];this[_0xe363('0x54')]=_0x1834ca[_0xe363('0x54')];this[_0xe363('0x55')]=_0x1834ca['dialAMDTotalAnalysisTime'];this['dialAMDMinWordLength']=_0x1834ca[_0xe363('0x56')];this[_0xe363('0x57')]=_0x1834ca[_0xe363('0x57')];this[_0xe363('0x58')]=_0x1834ca['dialAMDMaximumNumberOfWords'];this[_0xe363('0x59')]=_0x1834ca['dialAMDSilenceThreshold'];this[_0xe363('0x5a')]=_0x1834ca[_0xe363('0x5a')];this[_0xe363('0x5b')]=0x0;this[_0xe363('0x5c')]=0x0;this[_0xe363('0x5d')]=_0x1834ca[_0xe363('0x5d')];this[_0xe363('0x5e')]=0x0;this[_0xe363('0x5f')]=0x0;this[_0xe363('0x60')]=0x0;this['outboundBusyCallsDay']=0x0;this['outboundCongestionCallsDay']=0x0;this[_0xe363('0x61')]=0x0;this[_0xe363('0x62')]=0x0;this[_0xe363('0x63')]=0x0;this[_0xe363('0x64')]=0x0;this[_0xe363('0x65')]=0x0;this[_0xe363('0x66')]=0x0;this[_0xe363('0x67')]=0x0;this[_0xe363('0x68')]=0x0;this[_0xe363('0x69')]=0x0;this['startProgressive']=undefined;this[_0xe363('0x6a')]=undefined;this['handlePredictive']=undefined;this[_0xe363('0x6b')]=1.05;this['predictiveIntervalTotalCalls']=0x0;this[_0xe363('0x6c')]=0x0;this[_0xe363('0x6d')]=0x0;this['predictiveIntervalDroppedCallsTimeout']=0x0;this[_0xe363('0x6e')]=0x0;this[_0xe363('0x6f')]=0x0;this[_0xe363('0x70')]=0x0;this[_0xe363('0x71')]=0x0;this[_0xe363('0x72')]=_0x1834ca[_0xe363('0x73')]||0x14;this['predictiveIntervalMinThreshold']=_0x1834ca[_0xe363('0x73')]||0xa;this[_0xe363('0x74')]=0x0;this[_0xe363('0x75')]=0x0;this[_0xe363('0x76')]=0x1;this[_0xe363('0x77')]=0x0;this['erlangCallToSecond']=0x0;this[_0xe363('0x78')]=0x0;this[_0xe363('0x79')]=0x0;this[_0xe363('0x7a')]=_0x1834ca[_0xe363('0x7a')]||0x1e;this[_0xe363('0x7b')]=_0x1834ca[_0xe363('0x7b')]||![];this[_0xe363('0x7c')]=!!_0x1834ca['dialPreviewAutoRecallMe']||![];this['dialPreviewRecallmeReminder']=!!_0x1834ca[_0xe363('0x7d')]||![];this[_0xe363('0x7e')]=_0x1834ca[_0xe363('0x7e')]||undefined;this['dialAgiAfterHangupClient']=_0x1834ca[_0xe363('0x7f')]||![];this[_0xe363('0x80')]=_0x1834ca['dialAgiAfterHangupAgent']||![];this['monitor_format']=monitorFormat[_0x1834ca[_0xe363('0xc')]]?monitorFormat[_0x1834ca[_0xe363('0xc')]]:undefined;this[_0xe363('0x81')]=_0x1834ca[_0xe363('0x81')]||![];this['mandatoryDispositionPause']=_0x1834ca[_0xe363('0x82')]?_0x1834ca[_0xe363('0x82')]:undefined;this['queueSummaryCountersUpdated']=![];}module['exports']=VoiceQueue; \ No newline at end of file +var _0x3189=['dialPreviewRecallmeReminder','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','queueSummaryCountersUpdated','exports','wav','gsm','fewestcalls','leastrecent','linear','random','roundrobin','rrmemory','rrordered','wrandom','name','monitor_format','type','inbound','total','answered','sumDuration','sumHoldTime','sumBillable','unmanaged','abandoned','available','inUse','invalid','loggedIn','notInUse','onHold','paused','ringing','unavailable','unknown','acw','acwTimeout','autopause','sendMessageOneNotActive','message','statusMessage','originated','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','anonymous','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','pTalking','timeout','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundBlacklistCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundDropCallsDayACS','outboundReCallsDay','outboundAbandonedDay','startPredictive','handlePredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalPauses','predictiveIntervalMaxThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialPreviewAutoRecallMe'];(function(_0x15ecce,_0x280316){var _0x2e420b=function(_0x4ef6f5){while(--_0x4ef6f5){_0x15ecce['push'](_0x15ecce['shift']());}};_0x2e420b(++_0x280316);}(_0x3189,0x19a));var _0x9318=function(_0x59f638,_0x45a5d0){_0x59f638=_0x59f638-0x0;var _0x348cfc=_0x3189[_0x59f638];return _0x348cfc;};'use strict';var monitorFormat={'wav':_0x9318('0x0'),'wav49':'wav49','gsm':_0x9318('0x1')};var strategy={'fewestcalls':_0x9318('0x2'),'leastrecent':_0x9318('0x3'),'linear':_0x9318('0x4'),'random':_0x9318('0x5'),'ringall':'ringall','rr':_0x9318('0x6'),'rrmemory':_0x9318('0x7'),'rrordered':_0x9318('0x8'),'wrandom':_0x9318('0x9')};function VoiceQueue(_0x363698){this['id']=_0x363698['id']||0x0;this[_0x9318('0xa')]=_0x363698['name']||'';this[_0x9318('0xb')]=_0x363698['monitor_format']||'';this[_0x9318('0xc')]=_0x363698[_0x9318('0xc')]||_0x9318('0xd');this['waiting']=0x0;this[_0x9318('0xe')]=0x0;this[_0x9318('0xf')]=0x0;this[_0x9318('0x10')]=0x0;this[_0x9318('0x11')]=0x0;this[_0x9318('0x12')]=0x0;this[_0x9318('0x13')]=0x0;this[_0x9318('0x14')]=0x0;this[_0x9318('0x15')]=0x0;this['busy']=0x0;this[_0x9318('0x16')]=0x0;this[_0x9318('0x17')]=0x0;this[_0x9318('0x18')]=0x0;this[_0x9318('0x19')]=0x0;this[_0x9318('0x1a')]=0x0;this[_0x9318('0x1b')]=0x0;this[_0x9318('0x1c')]=0x0;this['ringInUse']=0x0;this['talking']=0x0;this[_0x9318('0x1d')]=0x0;this[_0x9318('0x1e')]=0x0;this[_0x9318('0x1f')]=_0x363698[_0x9318('0x1f')]||![];this[_0x9318('0x20')]=_0x363698[_0x9318('0x20')]||0xa;this[_0x9318('0x21')]=_0x363698[_0x9318('0x21')]||'no';this[_0x9318('0x22')]=!![];this[_0x9318('0x23')]='';this[_0x9318('0x24')]='';this[_0x9318('0x25')]=0x0;this['temp']=0x0;this[_0x9318('0x26')]=_0x363698['dialTimezone']||null;this['dialGlobalInterval']=_0x363698[_0x9318('0x27')]?_0x363698[_0x9318('0x27')]:null;this[_0x9318('0x28')]=_0x363698[_0x9318('0x28')];this['dialMethod']=_0x363698[_0x9318('0x29')]||_0x9318('0x2a');this['dialLimitChannel']=_0x363698[_0x9318('0x2b')]||0x0;this[_0x9318('0x2c')]=_0x363698[_0x9318('0x2c')]||0x0;this[_0x9318('0x2d')]=_0x363698[_0x9318('0x2d')]||0x1;this[_0x9318('0x2e')]=_0x363698[_0x9318('0x2e')]||'dropRate';this[_0x9318('0x2f')]=_0x363698['dialPredictiveOptimizationPercentage']||0.03;this['dialPredictiveInterval']=_0x363698[_0x9318('0x30')]||0x258;this[_0x9318('0x31')]=_0x363698[_0x9318('0x31')]||'anonymous';this[_0x9318('0x32')]=_0x363698['dialOriginateCallerIdNumber']||_0x9318('0x33');this[_0x9318('0x34')]=_0x363698[_0x9318('0x34')]||0x1e;this[_0x9318('0x35')]=_0x363698[_0x9318('0x35')]||_0x9318('0x36');this[_0x9318('0x37')]=_0x363698[_0x9318('0x37')]||0x3;this[_0x9318('0x38')]=_0x363698[_0x9318('0x38')]||undefined;this[_0x9318('0x39')]=_0x363698[_0x9318('0x39')]||0x3;this[_0x9318('0x3a')]=_0x363698['dialCongestionRetryFrequency']||0x96;this['dialBusyMaxRetry']=_0x363698['dialBusyMaxRetry']||0x3;this[_0x9318('0x3b')]=_0x363698[_0x9318('0x3b')]||0x96;this[_0x9318('0x3c')]=_0x363698[_0x9318('0x3c')]||0x3;this['dialNoAnswerRetryFrequency']=_0x363698[_0x9318('0x3d')]||0x96;this[_0x9318('0x3e')]=_0x363698[_0x9318('0x3e')]||0x3;this[_0x9318('0x3f')]=_0x363698['dialNoSuchNumberRetryFrequency']||0x96;this[_0x9318('0x40')]=_0x363698['dialDropMaxRetry']||0x3;this[_0x9318('0x41')]=_0x363698[_0x9318('0x41')]||0x96;this['dialAbandonedMaxRetry']=_0x363698['dialAbandonedMaxRetry']||0x3;this['dialAbandonedRetryFrequency']=_0x363698[_0x9318('0x42')]||0x96;this[_0x9318('0x43')]=_0x363698[_0x9318('0x43')]||0x3;this[_0x9318('0x44')]=_0x363698[_0x9318('0x44')]||0x96;this[_0x9318('0x45')]=_0x363698['dialAgentRejectMaxRetry']||0x3;this[_0x9318('0x46')]=_0x363698['dialAgentRejectRetryFrequency']||0x96;this['callAdditionalPhoneAfterMin']=_0x363698['callAdditionalPhoneAfterMin']||0x3;this[_0x9318('0x47')]=_0x363698[_0x9318('0x47')]||0x4;this[_0x9318('0x48')]=_0x363698[_0x9318('0x48')]?_0x363698[_0x9318('0x48')]:undefined;this['TrunkBackup']=_0x363698[_0x9318('0x49')]?_0x363698[_0x9318('0x49')]:undefined;this['dialPrefix']=_0x363698[_0x9318('0x4a')]||undefined;this[_0x9318('0x4b')]=_0x363698[_0x9318('0x4b')]?_0x363698[_0x9318('0x4b')]:undefined;this['dialOrderByScheduledAt']=_0x363698['dialOrderByScheduledAt']||_0x9318('0x4c');this[_0x9318('0x4d')]=_0x363698[_0x9318('0x4d')]||undefined;this[_0x9318('0x4e')]=_0x363698[_0x9318('0x4e')]||undefined;this[_0x9318('0x4f')]=strategy[_0x363698[_0x9318('0x4f')]];this['queueStatusComplete']=!![];this[_0x9318('0x50')]=_0x363698[_0x9318('0x50')]||![];this[_0x9318('0x51')]=_0x363698[_0x9318('0x51')];this['dialAMDGreeting']=_0x363698[_0x9318('0x52')];this[_0x9318('0x53')]=_0x363698[_0x9318('0x53')];this[_0x9318('0x54')]=_0x363698[_0x9318('0x54')];this[_0x9318('0x55')]=_0x363698[_0x9318('0x55')];this[_0x9318('0x56')]=_0x363698[_0x9318('0x56')];this[_0x9318('0x57')]=_0x363698[_0x9318('0x57')];this[_0x9318('0x58')]=_0x363698[_0x9318('0x58')];this[_0x9318('0x59')]=_0x363698[_0x9318('0x59')];this[_0x9318('0x5a')]=0x0;this[_0x9318('0x5b')]=0x0;this[_0x9318('0x5c')]=_0x363698[_0x9318('0x5c')];this[_0x9318('0x5d')]=0x0;this[_0x9318('0x5e')]=0x0;this[_0x9318('0x5f')]=0x0;this['outboundBusyCallsDay']=0x0;this[_0x9318('0x60')]=0x0;this[_0x9318('0x61')]=0x0;this[_0x9318('0x62')]=0x0;this[_0x9318('0x63')]=0x0;this['outboundOriginateFailureCallsDay']=0x0;this[_0x9318('0x64')]=0x0;this[_0x9318('0x65')]=0x0;this[_0x9318('0x66')]=0x0;this[_0x9318('0x67')]=0x0;this[_0x9318('0x68')]=0x0;this['startProgressive']=undefined;this[_0x9318('0x69')]=undefined;this[_0x9318('0x6a')]=undefined;this[_0x9318('0x6b')]=1.05;this[_0x9318('0x6c')]=0x0;this[_0x9318('0x6d')]=0x0;this[_0x9318('0x6e')]=0x0;this[_0x9318('0x6f')]=0x0;this[_0x9318('0x70')]=0x0;this[_0x9318('0x71')]=0x0;this[_0x9318('0x72')]=0x0;this['predictiveIntervalAvailable']=0x0;this[_0x9318('0x73')]=_0x363698[_0x9318('0x74')]||0x14;this[_0x9318('0x75')]=_0x363698[_0x9318('0x74')]||0xa;this['predictiveIntervalErlangCalls']=0x0;this[_0x9318('0x76')]=0x0;this[_0x9318('0x77')]=0x1;this['erlangCalls']=0x0;this[_0x9318('0x78')]=0x0;this[_0x9318('0x79')]=0x0;this[_0x9318('0x7a')]=0x0;this[_0x9318('0x7b')]=_0x363698[_0x9318('0x7b')]||0x1e;this[_0x9318('0x7c')]=_0x363698['dialRecallInQueue']||![];this[_0x9318('0x7d')]=!!_0x363698[_0x9318('0x7d')]||![];this[_0x9318('0x7e')]=!!_0x363698[_0x9318('0x7e')]||![];this[_0x9318('0x7f')]=_0x363698['dialQueueProject2']||undefined;this[_0x9318('0x80')]=_0x363698['dialAgiAfterHangupClient']||![];this[_0x9318('0x81')]=_0x363698[_0x9318('0x81')]||![];this[_0x9318('0xb')]=monitorFormat[_0x363698[_0x9318('0xb')]]?monitorFormat[_0x363698['monitor_format']]:undefined;this[_0x9318('0x82')]=_0x363698['mandatoryDisposition']||![];this[_0x9318('0x83')]=_0x363698[_0x9318('0x83')]?_0x363698[_0x9318('0x83')]:undefined;this[_0x9318('0x84')]=![];}module[_0x9318('0x85')]=VoiceQueue; \ No newline at end of file diff --git a/server/services/ami/model/voiceQueueSummary.js b/server/services/ami/model/voiceQueueSummary.js index 877f82e..63ffb98 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 _0x4fde=['dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','message','statusMessage','Trunk','active','callerid','prototype','createReport','onHold','loggedin','callers','length','SIP/','online','incall','includes','status','keys','queue','type','dialer','exten','xcally-motion-preview','compareToInboundQueue','some','exports','available','loggedIn','loggedInDb','paused','talking','waiting','answered','inUse','originated','outboundAbandonedCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundNoAnswerCallsDay','outboundReCallsDay','pTalking','sumDuration','total','name','strategy','abandoned','busy','invalid','notInUse','ringing','ringInUse','sumBillable','sumHoldTime','unavailable','unknown','unmanaged','outbound','dialActive','dialMethod','dialOriginateCallerIdName'];(function(_0x2f36a2,_0x5e3f7b){var _0x1d2d1b=function(_0x3546aa){while(--_0x3546aa){_0x2f36a2['push'](_0x2f36a2['shift']());}};_0x1d2d1b(++_0x5e3f7b);}(_0x4fde,0x19f));var _0xe4fd=function(_0x4fde08,_0x463a36){_0x4fde08=_0x4fde08-0x0;var _0x12e725=_0x4fde[_0x4fde08];return _0x12e725;};'use strict';var INBOUND_COUNTERS=[_0xe4fd('0x0'),_0xe4fd('0x1'),_0xe4fd('0x2'),_0xe4fd('0x3'),'ringing',_0xe4fd('0x4'),_0xe4fd('0x5')];var OUTBOUND_COUNTERS=['available',_0xe4fd('0x6'),_0xe4fd('0x7'),_0xe4fd('0x1'),_0xe4fd('0x2'),_0xe4fd('0x8'),_0xe4fd('0x9'),_0xe4fd('0xa'),_0xe4fd('0xb'),_0xe4fd('0xc'),'outboundCongestionCallsDay',_0xe4fd('0xd'),'outboundNoSuchCallsDay',_0xe4fd('0xe'),'outboundRejectCallsDay','outboundUnknownCallsDay',_0xe4fd('0x3'),_0xe4fd('0xf'),'talking','sumBillable',_0xe4fd('0x10'),_0xe4fd('0x11'),_0xe4fd('0x5')];function VoiceQueueSummary(_0x5c4dc7){this['id']=_0x5c4dc7['id'];this[_0xe4fd('0x12')]=_0x5c4dc7[_0xe4fd('0x12')];this[_0xe4fd('0x13')]=_0x5c4dc7[_0xe4fd('0x13')];this[_0xe4fd('0x14')]=_0x5c4dc7[_0xe4fd('0x14')]||0x0;this['answered']=_0x5c4dc7[_0xe4fd('0x6')]||0x0;this[_0xe4fd('0x0')]=_0x5c4dc7[_0xe4fd('0x0')]||0x0;this['busy']=_0x5c4dc7[_0xe4fd('0x15')]||0x0;this[_0xe4fd('0x7')]=_0x5c4dc7['inUse']||0x0;this['invalid']=_0x5c4dc7[_0xe4fd('0x16')]||0x0;this[_0xe4fd('0x1')]=_0x5c4dc7[_0xe4fd('0x1')]||0x0;this['loggedInDb']=_0x5c4dc7[_0xe4fd('0x2')]||0x0;this['onHold']=_0x5c4dc7['onHold']||0x0;this[_0xe4fd('0x17')]=_0x5c4dc7[_0xe4fd('0x17')]||0x0;this[_0xe4fd('0x3')]=_0x5c4dc7[_0xe4fd('0x3')]||0x0;this[_0xe4fd('0x18')]=_0x5c4dc7['ringing']||0x0;this[_0xe4fd('0x19')]=_0x5c4dc7[_0xe4fd('0x19')];this[_0xe4fd('0x1a')]=_0x5c4dc7[_0xe4fd('0x1a')];this[_0xe4fd('0x10')]=_0x5c4dc7[_0xe4fd('0x10')];this[_0xe4fd('0x1b')]=_0x5c4dc7[_0xe4fd('0x1b')]||0x0;this[_0xe4fd('0x4')]=_0x5c4dc7['talking']||0x0;this[_0xe4fd('0x11')]=_0x5c4dc7[_0xe4fd('0x11')]||0x0;this['type']=_0x5c4dc7['type'];this['unavailable']=_0x5c4dc7[_0xe4fd('0x1c')]||0x0;this['unknown']=_0x5c4dc7[_0xe4fd('0x1d')]||0x0;this['unmanaged']=_0x5c4dc7[_0xe4fd('0x1e')]||0x0;this[_0xe4fd('0x5')]=_0x5c4dc7[_0xe4fd('0x5')]||0x0;if(_0x5c4dc7['type']===_0xe4fd('0x1f')){this[_0xe4fd('0xf')]=_0x5c4dc7[_0xe4fd('0xf')]||0x0;this[_0xe4fd('0x20')]=_0x5c4dc7[_0xe4fd('0x20')];this['dialMethod']=_0x5c4dc7[_0xe4fd('0x21')];this[_0xe4fd('0x22')]=_0x5c4dc7[_0xe4fd('0x22')];this[_0xe4fd('0x23')]=_0x5c4dc7[_0xe4fd('0x23')];this[_0xe4fd('0x24')]=_0x5c4dc7[_0xe4fd('0x24')];this[_0xe4fd('0x25')]=_0x5c4dc7[_0xe4fd('0x25')];this[_0xe4fd('0x26')]=_0x5c4dc7[_0xe4fd('0x26')];this[_0xe4fd('0x27')]=_0x5c4dc7[_0xe4fd('0x27')];this[_0xe4fd('0xa')]=_0x5c4dc7[_0xe4fd('0xa')];this[_0xe4fd('0xb')]=_0x5c4dc7[_0xe4fd('0xb')];this['outboundBusyCallsDay']=_0x5c4dc7[_0xe4fd('0xc')];this[_0xe4fd('0x28')]=_0x5c4dc7[_0xe4fd('0x28')];this['outboundDropCallsDayACS']=_0x5c4dc7[_0xe4fd('0x29')];this[_0xe4fd('0x2a')]=_0x5c4dc7[_0xe4fd('0x2a')];this[_0xe4fd('0x2b')]=_0x5c4dc7[_0xe4fd('0x2b')];this['outboundNoAnswerCallsDay']=_0x5c4dc7[_0xe4fd('0xd')];this[_0xe4fd('0x2c')]=_0x5c4dc7[_0xe4fd('0x2c')];this[_0xe4fd('0x2d')]=_0x5c4dc7[_0xe4fd('0x2d')];this[_0xe4fd('0xe')]=_0x5c4dc7[_0xe4fd('0xe')];this[_0xe4fd('0x2e')]=_0x5c4dc7[_0xe4fd('0x2e')];this[_0xe4fd('0x2f')]=_0x5c4dc7[_0xe4fd('0x2f')];this[_0xe4fd('0x30')]=_0x5c4dc7[_0xe4fd('0x30')];this[_0xe4fd('0x31')]=_0x5c4dc7[_0xe4fd('0x31')];this[_0xe4fd('0x32')]=_0x5c4dc7[_0xe4fd('0x32')];this[_0xe4fd('0x33')]=_0x5c4dc7[_0xe4fd('0x33')];this[_0xe4fd('0x34')]=_0x5c4dc7[_0xe4fd('0x34')];this[_0xe4fd('0x35')]=_0x5c4dc7[_0xe4fd('0x35')];this[_0xe4fd('0x36')]=_0x5c4dc7[_0xe4fd('0x36')];this['predictiveIntervalHitRate']=_0x5c4dc7['predictiveIntervalHitRate'];this[_0xe4fd('0x37')]=_0x5c4dc7[_0xe4fd('0x37')];this[_0xe4fd('0x38')]=_0x5c4dc7[_0xe4fd('0x38')];this['predictiveIntervalAvailable']=_0x5c4dc7[_0xe4fd('0x39')];this[_0xe4fd('0x3a')]=_0x5c4dc7[_0xe4fd('0x3a')];this[_0xe4fd('0x8')]=_0x5c4dc7[_0xe4fd('0x8')];this[_0xe4fd('0x3b')]=_0x5c4dc7[_0xe4fd('0x3b')];this[_0xe4fd('0x3c')]=_0x5c4dc7[_0xe4fd('0x3c')];this['erlangAbandonmentRate']=_0x5c4dc7[_0xe4fd('0x3d')];this['erlangBusyFactor']=_0x5c4dc7[_0xe4fd('0x3e')];this[_0xe4fd('0x3f')]=_0x5c4dc7[_0xe4fd('0x3f')];this[_0xe4fd('0x40')]=_0x5c4dc7[_0xe4fd('0x40')];this['message']=_0x5c4dc7[_0xe4fd('0x41')];this[_0xe4fd('0x42')]=_0x5c4dc7[_0xe4fd('0x42')];}if(_0x5c4dc7[_0xe4fd('0x43')]){this[_0xe4fd('0x43')]={'id':_0x5c4dc7[_0xe4fd('0x43')]['id'],'name':_0x5c4dc7['Trunk'][_0xe4fd('0x12')],'active':_0x5c4dc7[_0xe4fd('0x43')][_0xe4fd('0x44')],'callerid':_0x5c4dc7['Trunk'][_0xe4fd('0x45')]};}}VoiceQueueSummary[_0xe4fd('0x46')][_0xe4fd('0x47')]=function(_0x12a961,_0x596915,_0x38a48f,_0x38f266){this[_0xe4fd('0x2')]=0x0;this[_0xe4fd('0x4')]=0x0;this['paused']=0x0;this['unknown']=0x0;this[_0xe4fd('0x17')]=0x0;this[_0xe4fd('0x7')]=0x0;this['busy']=0x0;this[_0xe4fd('0x16')]=0x0;this[_0xe4fd('0x1c')]=0x0;this[_0xe4fd('0x18')]=0x0;this[_0xe4fd('0x19')]=0x0;this[_0xe4fd('0x48')]=0x0;if(_0x38a48f){if(_0x38a48f[_0xe4fd('0x0')]){this['available']=Number(_0x38a48f['available']);}if(_0x38a48f['loggedin']){this[_0xe4fd('0x1')]=Number(_0x38a48f[_0xe4fd('0x49')]);}if(_0x38a48f[_0xe4fd('0x4a')]){this[_0xe4fd('0x5')]=Number(_0x38a48f[_0xe4fd('0x4a')]);}}for(var _0x28898c=0x0;_0x28898c<_0x12a961[_0xe4fd('0x4b')];_0x28898c++){var _0x43c5af=_0x596915[_0xe4fd('0x4c')+_0x12a961[_0x28898c][_0xe4fd('0x12')]];if(_0x43c5af&&_0x43c5af[_0xe4fd('0x4d')]){this[_0xe4fd('0x2')]+=0x1;}if(_0x12a961[_0x28898c][_0xe4fd('0x4e')]==='1'){this[_0xe4fd('0x4')]+=0x1;}if(_0x12a961[_0x28898c]['paused']==='1'&&!['2','7','8'][_0xe4fd('0x4f')](_0x12a961[_0x28898c][_0xe4fd('0x50')])){this[_0xe4fd('0x3')]+=0x1;}switch(_0x12a961[_0x28898c]['status']){case'0':this[_0xe4fd('0x1d')]+=0x1;break;case'1':this['notInUse']+=0x1;break;case'2':this['inUse']+=0x1;break;case'3':this[_0xe4fd('0x15')]+=0x1;break;case'4':this[_0xe4fd('0x16')]+=0x1;break;case'5':this[_0xe4fd('0x1c')]+=0x1;break;case'6':this[_0xe4fd('0x18')]+=0x1;break;case'7':this[_0xe4fd('0x19')]+=0x1;break;case'8':this[_0xe4fd('0x48')]+=0x1;break;}}if(this[_0xe4fd('0x21')]==='booked'){var _0x415582=Object[_0xe4fd('0x51')](_0x38f266);for(var _0x16bd52=0x0;_0x16bd52<_0x415582[_0xe4fd('0x4b')];_0x16bd52++){var _0x27a8d4=_0x415582[_0x16bd52];var _0x3f5398=_0x38f266[_0x27a8d4];if(_0x3f5398[_0xe4fd('0x52')]===this[_0xe4fd('0x12')]&&_0x3f5398[_0xe4fd('0x53')]===_0xe4fd('0x54')&&_0x3f5398[_0xe4fd('0x55')]===_0xe4fd('0x56')){this[_0xe4fd('0x4')]+=0x1;}}if(this[_0xe4fd('0x4')]>this[_0xe4fd('0x7')]){this['talking']=this[_0xe4fd('0x7')];}this[_0xe4fd('0xf')]=0x0;}return this;};VoiceQueueSummary[_0xe4fd('0x46')][_0xe4fd('0x57')]=function(_0x51d32e){var _0x59ba00=![];if(_0x51d32e){_0x59ba00=INBOUND_COUNTERS[_0xe4fd('0x58')](function(_0x1e3423){return this[_0x1e3423]!==_0x51d32e[_0x1e3423];},this);}return _0x59ba00;};VoiceQueueSummary[_0xe4fd('0x46')]['compareToOutboundQueue']=function(_0x4232be){var _0x20c37f=![];var _0x4cbc10=![];var _0xa1d3e0=![];if(_0x4232be){_0x20c37f=this[_0xe4fd('0x21')]!==_0x4232be[_0xe4fd('0x21')]||this[_0xe4fd('0x20')]!==_0x4232be[_0xe4fd('0x20')]||this[_0xe4fd('0x41')]!==_0x4232be[_0xe4fd('0x41')]||this[_0xe4fd('0x42')]!==_0x4232be[_0xe4fd('0x42')];_0x4cbc10=OUTBOUND_COUNTERS['some'](function(_0x4e0158){return this[_0x4e0158]!==_0x4232be[_0x4e0158];},this);if(this['Trunk']&&_0x4232be[_0xe4fd('0x43')]){_0xa1d3e0=this[_0xe4fd('0x43')]['name']!==_0x4232be[_0xe4fd('0x43')][_0xe4fd('0x12')]||this[_0xe4fd('0x43')][_0xe4fd('0x44')]!==_0x4232be['Trunk']['active'];}}return _0x20c37f||_0x4cbc10||_0xa1d3e0;};VoiceQueueSummary['prototype']['updateReportFromOutboundQueue']=function(_0x2342bf){this[_0xe4fd('0x6')]=_0x2342bf[_0xe4fd('0x6')];this[_0xe4fd('0x41')]=_0x2342bf[_0xe4fd('0x41')];this['statusMessage']=_0x2342bf[_0xe4fd('0x42')];this['originated']=_0x2342bf['originated'];this[_0xe4fd('0x9')]=_0x2342bf[_0xe4fd('0x9')];this[_0xe4fd('0xa')]=_0x2342bf['outboundAnswerCallsDay'];this[_0xe4fd('0xb')]=_0x2342bf[_0xe4fd('0xb')];this['outboundBusyCallsDay']=_0x2342bf[_0xe4fd('0xc')];this[_0xe4fd('0x28')]=_0x2342bf[_0xe4fd('0x28')];this[_0xe4fd('0xd')]=_0x2342bf[_0xe4fd('0xd')];this['outboundNoSuchCallsDay']=_0x2342bf['outboundNoSuchCallsDay'];this[_0xe4fd('0xe')]=_0x2342bf[_0xe4fd('0xe')];this[_0xe4fd('0x2e')]=_0x2342bf[_0xe4fd('0x2e')];this[_0xe4fd('0x2f')]=_0x2342bf['outboundUnknownCallsDay'];this[_0xe4fd('0x1a')]=_0x2342bf[_0xe4fd('0x1a')];this[_0xe4fd('0x10')]=_0x2342bf[_0xe4fd('0x10')];this[_0xe4fd('0x11')]=_0x2342bf[_0xe4fd('0x11')];if(this[_0xe4fd('0x21')]==='preview'){this[_0xe4fd('0xf')]=_0x2342bf[_0xe4fd('0xf')];}};module[_0xe4fd('0x59')]=VoiceQueueSummary; \ No newline at end of file +var _0xf483=['busy','inUse','invalid','loggedInDb','onHold','notInUse','ringInUse','sumDuration','sumHoldTime','type','unavailable','unknown','unmanaged','outbound','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundDropCallsDayACS','outboundDropCallsDayTimeout','outboundOriginateFailureCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalErlangCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalTotalCalls','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','message','statusMessage','Trunk','active','callerid','createReport','loggedin','callers','length','online','incall','status','booked','keys','queue','dialer','exten','xcally-motion-preview','prototype','compareToInboundQueue','compareToOutboundQueue','some','updateReportFromOutboundQueue','preview','exports','loggedIn','paused','ringing','talking','waiting','available','answered','originated','outboundAbandonedCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundReCallsDay','outboundRejectCallsDay','pTalking','sumBillable','total','name','strategy','abandoned'];(function(_0x819464,_0x46fc91){var _0x49dcc0=function(_0x36b2b2){while(--_0x36b2b2){_0x819464['push'](_0x819464['shift']());}};_0x49dcc0(++_0x46fc91);}(_0xf483,0xf2));var _0x3f48=function(_0x4b10f2,_0x1ef8b7){_0x4b10f2=_0x4b10f2-0x0;var _0x5262f3=_0xf483[_0x4b10f2];return _0x5262f3;};'use strict';var INBOUND_COUNTERS=['available',_0x3f48('0x0'),'loggedInDb',_0x3f48('0x1'),_0x3f48('0x2'),_0x3f48('0x3'),_0x3f48('0x4')];var OUTBOUND_COUNTERS=[_0x3f48('0x5'),_0x3f48('0x6'),'inUse','loggedIn','loggedInDb',_0x3f48('0x7'),_0x3f48('0x8'),'outboundAnswerCallsDay',_0x3f48('0x9'),_0x3f48('0xa'),_0x3f48('0xb'),_0x3f48('0xc'),_0x3f48('0xd'),_0x3f48('0xe'),_0x3f48('0xf'),'outboundUnknownCallsDay',_0x3f48('0x1'),_0x3f48('0x10'),'talking',_0x3f48('0x11'),'sumDuration',_0x3f48('0x12'),_0x3f48('0x4')];function VoiceQueueSummary(_0x36cdc3){this['id']=_0x36cdc3['id'];this[_0x3f48('0x13')]=_0x36cdc3[_0x3f48('0x13')];this[_0x3f48('0x14')]=_0x36cdc3[_0x3f48('0x14')];this[_0x3f48('0x15')]=_0x36cdc3[_0x3f48('0x15')]||0x0;this[_0x3f48('0x6')]=_0x36cdc3['answered']||0x0;this[_0x3f48('0x5')]=_0x36cdc3[_0x3f48('0x5')]||0x0;this[_0x3f48('0x16')]=_0x36cdc3['busy']||0x0;this[_0x3f48('0x17')]=_0x36cdc3['inUse']||0x0;this[_0x3f48('0x18')]=_0x36cdc3[_0x3f48('0x18')]||0x0;this[_0x3f48('0x0')]=_0x36cdc3['loggedIn']||0x0;this[_0x3f48('0x19')]=_0x36cdc3[_0x3f48('0x19')]||0x0;this[_0x3f48('0x1a')]=_0x36cdc3[_0x3f48('0x1a')]||0x0;this['notInUse']=_0x36cdc3[_0x3f48('0x1b')]||0x0;this[_0x3f48('0x1')]=_0x36cdc3[_0x3f48('0x1')]||0x0;this[_0x3f48('0x2')]=_0x36cdc3[_0x3f48('0x2')]||0x0;this[_0x3f48('0x1c')]=_0x36cdc3[_0x3f48('0x1c')];this[_0x3f48('0x11')]=_0x36cdc3[_0x3f48('0x11')];this[_0x3f48('0x1d')]=_0x36cdc3[_0x3f48('0x1d')];this[_0x3f48('0x1e')]=_0x36cdc3[_0x3f48('0x1e')]||0x0;this[_0x3f48('0x3')]=_0x36cdc3[_0x3f48('0x3')]||0x0;this[_0x3f48('0x12')]=_0x36cdc3[_0x3f48('0x12')]||0x0;this[_0x3f48('0x1f')]=_0x36cdc3[_0x3f48('0x1f')];this[_0x3f48('0x20')]=_0x36cdc3['unavailable']||0x0;this['unknown']=_0x36cdc3[_0x3f48('0x21')]||0x0;this[_0x3f48('0x22')]=_0x36cdc3[_0x3f48('0x22')]||0x0;this['waiting']=_0x36cdc3['waiting']||0x0;if(_0x36cdc3[_0x3f48('0x1f')]===_0x3f48('0x23')){this['pTalking']=_0x36cdc3[_0x3f48('0x10')]||0x0;this[_0x3f48('0x24')]=_0x36cdc3[_0x3f48('0x24')];this[_0x3f48('0x25')]=_0x36cdc3[_0x3f48('0x25')];this[_0x3f48('0x26')]=_0x36cdc3[_0x3f48('0x26')];this['dialOriginateCallerIdNumber']=_0x36cdc3[_0x3f48('0x27')];this[_0x3f48('0x28')]=_0x36cdc3[_0x3f48('0x28')];this[_0x3f48('0x29')]=_0x36cdc3['dialPrefix'];this[_0x3f48('0x2a')]=_0x36cdc3[_0x3f48('0x2a')];this['outboundAnswerAgiCallsDay']=_0x36cdc3[_0x3f48('0x2b')];this[_0x3f48('0x2c')]=_0x36cdc3[_0x3f48('0x2c')];this['outboundBlacklistCallsDay']=_0x36cdc3[_0x3f48('0x9')];this[_0x3f48('0xa')]=_0x36cdc3['outboundBusyCallsDay'];this[_0x3f48('0xb')]=_0x36cdc3[_0x3f48('0xb')];this[_0x3f48('0x2d')]=_0x36cdc3['outboundDropCallsDayACS'];this['outboundDropCallsDayCallersExit']=_0x36cdc3['outboundDropCallsDayCallersExit'];this[_0x3f48('0x2e')]=_0x36cdc3[_0x3f48('0x2e')];this[_0x3f48('0xc')]=_0x36cdc3[_0x3f48('0xc')];this[_0x3f48('0xd')]=_0x36cdc3[_0x3f48('0xd')];this[_0x3f48('0x2f')]=_0x36cdc3[_0x3f48('0x2f')];this[_0x3f48('0xe')]=_0x36cdc3[_0x3f48('0xe')];this[_0x3f48('0xf')]=_0x36cdc3[_0x3f48('0xf')];this[_0x3f48('0x30')]=_0x36cdc3[_0x3f48('0x30')];this['predictiveIntervalAnsweredCalls']=_0x36cdc3[_0x3f48('0x31')];this[_0x3f48('0x32')]=_0x36cdc3['predictiveIntervalAvgHoldtime'];this[_0x3f48('0x33')]=_0x36cdc3['predictiveIntervalAvgTalktime'];this['predictiveIntervalDroppedCallsCallersExit']=_0x36cdc3['predictiveIntervalDroppedCallsCallersExit'];this['predictiveIntervalDroppedCallsTimeout']=_0x36cdc3['predictiveIntervalDroppedCallsTimeout'];this['predictiveIntervalErlangCalls']=_0x36cdc3[_0x3f48('0x34')];this['predictiveIntervalErlangCallsDroppedCalls']=_0x36cdc3['predictiveIntervalErlangCallsDroppedCalls'];this[_0x3f48('0x35')]=_0x36cdc3[_0x3f48('0x35')];this[_0x3f48('0x36')]=_0x36cdc3[_0x3f48('0x36')];this['predictiveIntervalPauses']=_0x36cdc3[_0x3f48('0x37')];this['predictiveIntervalAvailable']=_0x36cdc3['predictiveIntervalAvailable'];this['predictiveIntervalTotalCalls']=_0x36cdc3[_0x3f48('0x38')];this[_0x3f48('0x7')]=_0x36cdc3['originated'];this[_0x3f48('0x39')]=_0x36cdc3[_0x3f48('0x39')];this[_0x3f48('0x3a')]=_0x36cdc3[_0x3f48('0x3a')];this[_0x3f48('0x3b')]=_0x36cdc3['erlangAbandonmentRate'];this[_0x3f48('0x3c')]=_0x36cdc3[_0x3f48('0x3c')];this[_0x3f48('0x3d')]=_0x36cdc3[_0x3f48('0x3d')];this[_0x3f48('0x3e')]=_0x36cdc3[_0x3f48('0x3e')];this['message']=_0x36cdc3[_0x3f48('0x3f')];this[_0x3f48('0x40')]=_0x36cdc3[_0x3f48('0x40')];}if(_0x36cdc3[_0x3f48('0x41')]){this[_0x3f48('0x41')]={'id':_0x36cdc3['Trunk']['id'],'name':_0x36cdc3['Trunk'][_0x3f48('0x13')],'active':_0x36cdc3['Trunk'][_0x3f48('0x42')],'callerid':_0x36cdc3[_0x3f48('0x41')][_0x3f48('0x43')]};}}VoiceQueueSummary['prototype'][_0x3f48('0x44')]=function(_0x26ebfd,_0x5f0fed,_0x4475ee,_0x51a2a8){this['loggedInDb']=0x0;this[_0x3f48('0x3')]=0x0;this[_0x3f48('0x1')]=0x0;this['unknown']=0x0;this['notInUse']=0x0;this[_0x3f48('0x17')]=0x0;this['busy']=0x0;this[_0x3f48('0x18')]=0x0;this[_0x3f48('0x20')]=0x0;this[_0x3f48('0x2')]=0x0;this[_0x3f48('0x1c')]=0x0;this[_0x3f48('0x1a')]=0x0;if(_0x4475ee){if(_0x4475ee[_0x3f48('0x5')]){this['available']=Number(_0x4475ee['available']);}if(_0x4475ee[_0x3f48('0x45')]){this['loggedIn']=Number(_0x4475ee[_0x3f48('0x45')]);}if(_0x4475ee[_0x3f48('0x46')]){this['waiting']=Number(_0x4475ee['callers']);}}for(var _0x2d4307=0x0;_0x2d4307<_0x26ebfd[_0x3f48('0x47')];_0x2d4307++){var _0x5dad24=_0x5f0fed['SIP/'+_0x26ebfd[_0x2d4307][_0x3f48('0x13')]];if(_0x5dad24&&_0x5dad24[_0x3f48('0x48')]){this[_0x3f48('0x19')]+=0x1;}if(_0x26ebfd[_0x2d4307][_0x3f48('0x49')]==='1'){this[_0x3f48('0x3')]+=0x1;}if(_0x26ebfd[_0x2d4307]['paused']==='1'&&!['2','7','8']['includes'](_0x26ebfd[_0x2d4307]['status'])){this[_0x3f48('0x1')]+=0x1;}switch(_0x26ebfd[_0x2d4307][_0x3f48('0x4a')]){case'0':this['unknown']+=0x1;break;case'1':this[_0x3f48('0x1b')]+=0x1;break;case'2':this[_0x3f48('0x17')]+=0x1;break;case'3':this[_0x3f48('0x16')]+=0x1;break;case'4':this[_0x3f48('0x18')]+=0x1;break;case'5':this[_0x3f48('0x20')]+=0x1;break;case'6':this[_0x3f48('0x2')]+=0x1;break;case'7':this[_0x3f48('0x1c')]+=0x1;break;case'8':this[_0x3f48('0x1a')]+=0x1;break;}}if(this[_0x3f48('0x25')]===_0x3f48('0x4b')){var _0x49291e=Object[_0x3f48('0x4c')](_0x51a2a8);for(var _0x109d47=0x0;_0x109d47<_0x49291e[_0x3f48('0x47')];_0x109d47++){var _0x6a1854=_0x49291e[_0x109d47];var _0x1877b8=_0x51a2a8[_0x6a1854];if(_0x1877b8[_0x3f48('0x4d')]===this[_0x3f48('0x13')]&&_0x1877b8[_0x3f48('0x1f')]===_0x3f48('0x4e')&&_0x1877b8[_0x3f48('0x4f')]===_0x3f48('0x50')){this[_0x3f48('0x3')]+=0x1;}}if(this[_0x3f48('0x3')]>this[_0x3f48('0x17')]){this['talking']=this[_0x3f48('0x17')];}this[_0x3f48('0x10')]=0x0;}return this;};VoiceQueueSummary[_0x3f48('0x51')][_0x3f48('0x52')]=function(_0x1d0f90){var _0x1541e1=![];if(_0x1d0f90){_0x1541e1=INBOUND_COUNTERS['some'](function(_0x338c7b){return this[_0x338c7b]!==_0x1d0f90[_0x338c7b];},this);}return _0x1541e1;};VoiceQueueSummary['prototype'][_0x3f48('0x53')]=function(_0x2943d4){var _0x1b1732=![];var _0x58d9e3=![];var _0x4c811b=![];if(_0x2943d4){_0x1b1732=this[_0x3f48('0x25')]!==_0x2943d4[_0x3f48('0x25')]||this[_0x3f48('0x24')]!==_0x2943d4[_0x3f48('0x24')]||this['message']!==_0x2943d4['message']||this['statusMessage']!==_0x2943d4[_0x3f48('0x40')];_0x58d9e3=OUTBOUND_COUNTERS[_0x3f48('0x54')](function(_0x3f4245){return this[_0x3f4245]!==_0x2943d4[_0x3f4245];},this);if(this[_0x3f48('0x41')]&&_0x2943d4[_0x3f48('0x41')]){_0x4c811b=this['Trunk']['name']!==_0x2943d4[_0x3f48('0x41')][_0x3f48('0x13')]||this[_0x3f48('0x41')]['active']!==_0x2943d4[_0x3f48('0x41')][_0x3f48('0x42')];}}return _0x1b1732||_0x58d9e3||_0x4c811b;};VoiceQueueSummary[_0x3f48('0x51')][_0x3f48('0x55')]=function(_0x5eab3f){this[_0x3f48('0x6')]=_0x5eab3f[_0x3f48('0x6')];this[_0x3f48('0x3f')]=_0x5eab3f[_0x3f48('0x3f')];this['statusMessage']=_0x5eab3f[_0x3f48('0x40')];this[_0x3f48('0x7')]=_0x5eab3f[_0x3f48('0x7')];this['outboundAbandonedCallsDay']=_0x5eab3f[_0x3f48('0x8')];this[_0x3f48('0x2c')]=_0x5eab3f['outboundAnswerCallsDay'];this[_0x3f48('0x9')]=_0x5eab3f['outboundBlacklistCallsDay'];this[_0x3f48('0xa')]=_0x5eab3f['outboundBusyCallsDay'];this[_0x3f48('0xb')]=_0x5eab3f[_0x3f48('0xb')];this['outboundNoAnswerCallsDay']=_0x5eab3f[_0x3f48('0xc')];this[_0x3f48('0xd')]=_0x5eab3f[_0x3f48('0xd')];this[_0x3f48('0xe')]=_0x5eab3f[_0x3f48('0xe')];this[_0x3f48('0xf')]=_0x5eab3f[_0x3f48('0xf')];this[_0x3f48('0x30')]=_0x5eab3f[_0x3f48('0x30')];this[_0x3f48('0x11')]=_0x5eab3f['sumBillable'];this[_0x3f48('0x1d')]=_0x5eab3f[_0x3f48('0x1d')];this['total']=_0x5eab3f[_0x3f48('0x12')];if(this[_0x3f48('0x25')]===_0x3f48('0x56')){this[_0x3f48('0x10')]=_0x5eab3f['pTalking'];}};module[_0x3f48('0x57')]=VoiceQueueSummary; \ No newline at end of file diff --git a/server/services/ami/model/vtigerAccount.js b/server/services/ami/model/vtigerAccount.js index 79f2b96..b7fba74 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 _0x5092=['exports','name','username','accessKey','remoteUri','serverUrl','Configurations'];(function(_0x50bbb7,_0x5e6472){var _0x1c4285=function(_0x2d15fa){while(--_0x2d15fa){_0x50bbb7['push'](_0x50bbb7['shift']());}};_0x1c4285(++_0x5e6472);}(_0x5092,0xa9));var _0x2509=function(_0x4984e8,_0x17e3ad){_0x4984e8=_0x4984e8-0x0;var _0x531595=_0x5092[_0x4984e8];return _0x531595;};'use strict';function VtigerAccount(_0x1e9119){this['id']=_0x1e9119['id']||0x0;this[_0x2509('0x0')]=_0x1e9119[_0x2509('0x0')]||'';this[_0x2509('0x1')]=_0x1e9119[_0x2509('0x1')]||'';this[_0x2509('0x2')]=_0x1e9119[_0x2509('0x2')]||'';this[_0x2509('0x3')]=_0x1e9119[_0x2509('0x3')]||'';this[_0x2509('0x4')]=_0x1e9119[_0x2509('0x4')]||'';this[_0x2509('0x5')]=_0x1e9119[_0x2509('0x5')]||{};}module[_0x2509('0x6')]=VtigerAccount; \ No newline at end of file +var _0xcea1=['username','accessKey','remoteUri','serverUrl','Configurations','exports','name'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xcea1,0x1b1));var _0x1cea=function(_0x23bc85,_0x19addc){_0x23bc85=_0x23bc85-0x0;var _0x177dfd=_0xcea1[_0x23bc85];return _0x177dfd;};'use strict';function VtigerAccount(_0x111633){this['id']=_0x111633['id']||0x0;this[_0x1cea('0x0')]=_0x111633[_0x1cea('0x0')]||'';this[_0x1cea('0x1')]=_0x111633[_0x1cea('0x1')]||'';this[_0x1cea('0x2')]=_0x111633[_0x1cea('0x2')]||'';this[_0x1cea('0x3')]=_0x111633[_0x1cea('0x3')]||'';this[_0x1cea('0x4')]=_0x111633[_0x1cea('0x4')]||'';this[_0x1cea('0x5')]=_0x111633[_0x1cea('0x5')]||{};}module[_0x1cea('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 1fffdda..09cad27 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 _0xbb19=['remoteUri','authType','type','serverUrl','Configurations','name','username','password','token'];(function(_0x33d0a8,_0x59c090){var _0x14edc0=function(_0x448614){while(--_0x448614){_0x33d0a8['push'](_0x33d0a8['shift']());}};_0x14edc0(++_0x59c090);}(_0xbb19,0x188));var _0x9bb1=function(_0x5df8c0,_0xbfa2e1){_0x5df8c0=_0x5df8c0-0x0;var _0x352db7=_0xbb19[_0x5df8c0];return _0x352db7;};'use strict';function ZendeskAccount(_0x120b0a){this['id']=_0x120b0a['id']||0x0;this[_0x9bb1('0x0')]=_0x120b0a[_0x9bb1('0x0')]||'';this[_0x9bb1('0x1')]=_0x120b0a[_0x9bb1('0x1')]||'';this[_0x9bb1('0x2')]=_0x120b0a[_0x9bb1('0x2')]||'';this[_0x9bb1('0x3')]=_0x120b0a[_0x9bb1('0x3')]||'';this[_0x9bb1('0x4')]=_0x120b0a[_0x9bb1('0x4')]||'';this[_0x9bb1('0x5')]=_0x120b0a[_0x9bb1('0x5')]||'';this[_0x9bb1('0x6')]=_0x120b0a['type']||'integrationTab';this['serverUrl']=_0x120b0a[_0x9bb1('0x7')]||'';this[_0x9bb1('0x8')]=_0x120b0a[_0x9bb1('0x8')]||{};}module['exports']=ZendeskAccount; \ No newline at end of file +var _0x510e=['exports','name','username','password','remoteUri','authType','type','serverUrl','Configurations'];(function(_0x1a2cf3,_0x521b05){var _0xd1cc59=function(_0x2f3295){while(--_0x2f3295){_0x1a2cf3['push'](_0x1a2cf3['shift']());}};_0xd1cc59(++_0x521b05);}(_0x510e,0x7f));var _0xe510=function(_0x49d41c,_0x2bdc35){_0x49d41c=_0x49d41c-0x0;var _0xb64c5f=_0x510e[_0x49d41c];return _0xb64c5f;};'use strict';function ZendeskAccount(_0x454b02){this['id']=_0x454b02['id']||0x0;this[_0xe510('0x0')]=_0x454b02[_0xe510('0x0')]||'';this[_0xe510('0x1')]=_0x454b02[_0xe510('0x1')]||'';this[_0xe510('0x2')]=_0x454b02[_0xe510('0x2')]||'';this['token']=_0x454b02['token']||'';this[_0xe510('0x3')]=_0x454b02[_0xe510('0x3')]||'';this[_0xe510('0x4')]=_0x454b02[_0xe510('0x4')]||'';this[_0xe510('0x5')]=_0x454b02['type']||'integrationTab';this[_0xe510('0x6')]=_0x454b02[_0xe510('0x6')]||'';this[_0xe510('0x7')]=_0x454b02[_0xe510('0x7')]||{};}module[_0xe510('0x8')]=ZendeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/zohoAccount.js b/server/services/ami/model/zohoAccount.js index 4cc24f2..bb1d919 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 _0x84b5=['serverUrl','code','refreshToken','Configurations','exports','name','description','zone','clientId','clientSecret'];(function(_0x3b1a98,_0x489a5b){var _0x4df097=function(_0x3b8e39){while(--_0x3b8e39){_0x3b1a98['push'](_0x3b1a98['shift']());}};_0x4df097(++_0x489a5b);}(_0x84b5,0x109));var _0x584b=function(_0x3cd238,_0x4d2855){_0x3cd238=_0x3cd238-0x0;var _0x9878eb=_0x84b5[_0x3cd238];return _0x9878eb;};'use strict';function ZohoAccount(_0x552473){this['id']=_0x552473['id']||0x0;this[_0x584b('0x0')]=_0x552473['name']||'';this['description']=_0x552473[_0x584b('0x1')]||'';this['host']=_0x552473['host']||'';this[_0x584b('0x2')]=_0x552473[_0x584b('0x2')]||'';this[_0x584b('0x3')]=_0x552473[_0x584b('0x3')]||'';this[_0x584b('0x4')]=_0x552473[_0x584b('0x4')]||'';this['serverUrl']=_0x552473[_0x584b('0x5')]||'';this['code']=_0x552473[_0x584b('0x6')]||'';this[_0x584b('0x7')]=_0x552473['refreshToken']||'';this['Configurations']=_0x552473[_0x584b('0x8')]||{};}module[_0x584b('0x9')]=ZohoAccount; \ No newline at end of file +var _0x7278=['refreshToken','Configurations','exports','name','description','host','zone','clientId','clientSecret','serverUrl','code'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x7278,0x92));var _0x8727=function(_0x372b10,_0x57f881){_0x372b10=_0x372b10-0x0;var _0x476f35=_0x7278[_0x372b10];return _0x476f35;};'use strict';function ZohoAccount(_0x4a3f67){this['id']=_0x4a3f67['id']||0x0;this[_0x8727('0x0')]=_0x4a3f67[_0x8727('0x0')]||'';this['description']=_0x4a3f67[_0x8727('0x1')]||'';this['host']=_0x4a3f67[_0x8727('0x2')]||'';this[_0x8727('0x3')]=_0x4a3f67[_0x8727('0x3')]||'';this[_0x8727('0x4')]=_0x4a3f67['clientId']||'';this[_0x8727('0x5')]=_0x4a3f67[_0x8727('0x5')]||'';this['serverUrl']=_0x4a3f67[_0x8727('0x6')]||'';this[_0x8727('0x7')]=_0x4a3f67[_0x8727('0x7')]||'';this[_0x8727('0x8')]=_0x4a3f67[_0x8727('0x8')]||'';this[_0x8727('0x9')]=_0x4a3f67[_0x8727('0x9')]||{};}module[_0x8727('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 6e827f3..fab01f0 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 _0xfcbb=['name','format','SIP/%s','Contact','firstName','lastName','active','calleridnum','phone','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countmachineretry','countagentrejectretry','countabandonedretry','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','prototype','getCaller','\x22%s\x22\x20<%s>','calleridname','number','exports','util','lodash','moment','isNil','string','uniqueid','idContact','queue','type','campaigntype','dialAnswer','membername','Agent'];(function(_0x87b0ff,_0x314389){var _0x3bc0b2=function(_0x41682b){while(--_0x41682b){_0x87b0ff['push'](_0x87b0ff['shift']());}};_0x3bc0b2(++_0x314389);}(_0xfcbb,0x10d));var _0xbfcb=function(_0xae00a4,_0x2e723a){_0xae00a4=_0xae00a4-0x0;var _0x4d8cdd=_0xfcbb[_0xae00a4];return _0x4d8cdd;};'use strict';var util=require(_0xbfcb('0x0'));var _=require(_0xbfcb('0x1'));var moment=require(_0xbfcb('0x2'));function checkNameSurname(_0x5a1002,_0x5747a4,_0x462349){var _0x280329='';if(!_[_0xbfcb('0x3')](_0x5747a4)&&_0xbfcb('0x4')===typeof _0x5747a4){_0x280329+=_0x5747a4;}if(!_[_0xbfcb('0x3')](_0x462349)&&'string'===typeof _0x462349){_0x280329+='\x20'+_0x462349;}if(_0x280329!==''){return _0x280329;}return _0x5a1002;}function Action(_0x5201d3,_0x32c2aa,_0x4990c,_0x8d4e6a,_0x2df839){this[_0xbfcb('0x5')]=_0x4990c||undefined;this[_0xbfcb('0x6')]=_0x5201d3['id'];this[_0xbfcb('0x7')]=_0x32c2aa['name'];this[_0xbfcb('0x8')]=_0x32c2aa[_0xbfcb('0x8')];this[_0xbfcb('0x9')]='queue';this[_0xbfcb('0xa')]=![];this[_0xbfcb('0xb')]=_[_0xbfcb('0x3')](_0x5201d3[_0xbfcb('0xc')])?undefined:_0x5201d3[_0xbfcb('0xc')][_0xbfcb('0xd')];this['channelAgent']=this[_0xbfcb('0xb')]?util[_0xbfcb('0xe')](_0xbfcb('0xf'),this[_0xbfcb('0xb')]):_0x8d4e6a||undefined;this['calleridname']=checkNameSurname(_0x5201d3[_0xbfcb('0x10')]['phone'],_0x5201d3[_0xbfcb('0x10')][_0xbfcb('0x11')],_0x5201d3[_0xbfcb('0x10')][_0xbfcb('0x12')]);this[_0xbfcb('0x13')]=_0x5201d3[_0xbfcb('0x13')]||![];this[_0xbfcb('0x14')]=_0x5201d3[_0xbfcb('0x15')];this[_0xbfcb('0x16')]=_0x5201d3[_0xbfcb('0x16')];this[_0xbfcb('0x17')]=_0x5201d3[_0xbfcb('0x17')]||0x0;this[_0xbfcb('0x18')]=_0x5201d3[_0xbfcb('0x18')]||0x0;this[_0xbfcb('0x19')]=_0x5201d3[_0xbfcb('0x19')]||0x0;this[_0xbfcb('0x1a')]=(_0x5201d3[_0xbfcb('0x17')]||0x0)+(_0x5201d3[_0xbfcb('0x18')]||0x0)+(_0x5201d3[_0xbfcb('0x19')]||0x0)+(_0x5201d3[_0xbfcb('0x1b')]||0x0)+(_0x5201d3[_0xbfcb('0x1c')]||0x0)+(_0x5201d3['countabandonedretry']||0x0)+(_0x5201d3[_0xbfcb('0x1d')]||0x0)+(_0x5201d3[_0xbfcb('0x1e')]||0x0);this['countnosuchnumberretry']=_0x5201d3[_0xbfcb('0x1b')]||0x0;this[_0xbfcb('0x1c')]=_0x5201d3['countdropretry']||0x0;this['countabandonedretry']=_0x5201d3[_0xbfcb('0x1f')]||0x0;this[_0xbfcb('0x1d')]=_0x5201d3[_0xbfcb('0x1d')]||0x0;this[_0xbfcb('0x1e')]=_0x5201d3[_0xbfcb('0x1e')]||0x0;this['callback']=_0x5201d3[_0xbfcb('0x20')];this[_0xbfcb('0x21')]=_0x5201d3[_0xbfcb('0x21')];this[_0xbfcb('0x22')]=_0x5201d3[_0xbfcb('0x22')];this[_0xbfcb('0x23')]=_0x5201d3[_0xbfcb('0x23')];this[_0xbfcb('0x24')]=_0x5201d3[_0xbfcb('0x24')];this[_0xbfcb('0x25')]=_0x5201d3[_0xbfcb('0x25')];this[_0xbfcb('0x26')]=_[_0xbfcb('0x3')](_0x5201d3[_0xbfcb('0xc')])?_0x5201d3[_0xbfcb('0x26')]:_0x5201d3[_0xbfcb('0xc')]['id'];this['VoiceQueueId']=_0x5201d3[_0xbfcb('0x27')];this[_0xbfcb('0x28')]='';this['originatecalleridname']='';}Action[_0xbfcb('0x29')][_0xbfcb('0x2a')]=function(){return util[_0xbfcb('0xe')](_0xbfcb('0x2b'),this[_0xbfcb('0x2c')],this[_0xbfcb('0x2d')]);};module[_0xbfcb('0x2e')]=Action; \ No newline at end of file +var _0x7916=['membername','Agent','name','channelAgent','format','SIP/%s','calleridname','Contact','phone','active','calleridnum','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','callback','callbackuniqueid','callbackat','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','prototype','number','util','moment','isNil','string','idContact','type','queue','dialAnswer'];(function(_0x91f539,_0x442a0c){var _0x2e3bdd=function(_0x4f5ebd){while(--_0x4f5ebd){_0x91f539['push'](_0x91f539['shift']());}};_0x2e3bdd(++_0x442a0c);}(_0x7916,0x128));var _0x6791=function(_0x219ab5,_0x143062){_0x219ab5=_0x219ab5-0x0;var _0x55704f=_0x7916[_0x219ab5];return _0x55704f;};'use strict';var util=require(_0x6791('0x0'));var _=require('lodash');var moment=require(_0x6791('0x1'));function checkNameSurname(_0xdaaf2b,_0x4ca50a,_0x325c54){var _0x2d8cc8='';if(!_[_0x6791('0x2')](_0x4ca50a)&&_0x6791('0x3')===typeof _0x4ca50a){_0x2d8cc8+=_0x4ca50a;}if(!_['isNil'](_0x325c54)&&_0x6791('0x3')===typeof _0x325c54){_0x2d8cc8+='\x20'+_0x325c54;}if(_0x2d8cc8!==''){return _0x2d8cc8;}return _0xdaaf2b;}function Action(_0x5a5726,_0x3ca328,_0x3277a8,_0x5ad8c0,_0x8b85ff){this['uniqueid']=_0x3277a8||undefined;this[_0x6791('0x4')]=_0x5a5726['id'];this['queue']=_0x3ca328['name'];this[_0x6791('0x5')]=_0x3ca328[_0x6791('0x5')];this['campaigntype']=_0x6791('0x6');this[_0x6791('0x7')]=![];this[_0x6791('0x8')]=_['isNil'](_0x5a5726[_0x6791('0x9')])?undefined:_0x5a5726[_0x6791('0x9')][_0x6791('0xa')];this[_0x6791('0xb')]=this[_0x6791('0x8')]?util[_0x6791('0xc')](_0x6791('0xd'),this[_0x6791('0x8')]):_0x5ad8c0||undefined;this[_0x6791('0xe')]=checkNameSurname(_0x5a5726[_0x6791('0xf')][_0x6791('0x10')],_0x5a5726['Contact']['firstName'],_0x5a5726[_0x6791('0xf')]['lastName']);this[_0x6791('0x11')]=_0x5a5726['active']||![];this[_0x6791('0x12')]=_0x5a5726[_0x6791('0x10')];this['scheduledat']=_0x5a5726[_0x6791('0x13')];this['countbusyretry']=_0x5a5726[_0x6791('0x14')]||0x0;this[_0x6791('0x15')]=_0x5a5726['countcongestionretry']||0x0;this[_0x6791('0x16')]=_0x5a5726[_0x6791('0x16')]||0x0;this['countglobal']=(_0x5a5726[_0x6791('0x14')]||0x0)+(_0x5a5726['countcongestionretry']||0x0)+(_0x5a5726[_0x6791('0x16')]||0x0)+(_0x5a5726[_0x6791('0x17')]||0x0)+(_0x5a5726[_0x6791('0x18')]||0x0)+(_0x5a5726[_0x6791('0x19')]||0x0)+(_0x5a5726[_0x6791('0x1a')]||0x0)+(_0x5a5726[_0x6791('0x1b')]||0x0);this[_0x6791('0x17')]=_0x5a5726['countnosuchnumberretry']||0x0;this[_0x6791('0x18')]=_0x5a5726[_0x6791('0x18')]||0x0;this['countabandonedretry']=_0x5a5726[_0x6791('0x19')]||0x0;this[_0x6791('0x1a')]=_0x5a5726['countmachineretry']||0x0;this[_0x6791('0x1b')]=_0x5a5726[_0x6791('0x1b')]||0x0;this[_0x6791('0x1c')]=_0x5a5726[_0x6791('0x1c')];this['callbackuniqueid']=_0x5a5726[_0x6791('0x1d')];this[_0x6791('0x1e')]=_0x5a5726['callbackat'];this['recallme']=_0x5a5726['recallme'];this[_0x6791('0x1f')]=_0x5a5726['ContactId'];this[_0x6791('0x20')]=_0x5a5726['ListId'];this['UserId']=_['isNil'](_0x5a5726[_0x6791('0x9')])?_0x5a5726[_0x6791('0x21')]:_0x5a5726[_0x6791('0x9')]['id'];this['VoiceQueueId']=_0x5a5726[_0x6791('0x22')];this[_0x6791('0x23')]='';this['originatecalleridname']='';}Action[_0x6791('0x24')]['getCaller']=function(){return util[_0x6791('0xc')]('\x22%s\x22\x20<%s>',this['calleridname'],this[_0x6791('0x25')]);};module['exports']=Action; \ No newline at end of file diff --git a/server/services/ami/preview/index.js b/server/services/ami/preview/index.js index 9333141..42f050d 100644 --- a/server/services/ami/preview/index.js +++ b/server/services/ami/preview/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['varset','syncVarSet','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','loopCampaigns','emit','info','format','voice:queue:%s','name','voice_queue_channel:remove','voice_queue_presence:remove','sendMessageOneNotActive','originated','pTalking','available','CAMPAIGN_STATUS','INACTIVE','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20not\x20active','\x20is\x20deactivated','syncCampaigns','hasOwnProperty','dialMethod','booked','type','outbound','dialActive','setMessage','recallMe','clearZombieChannel','sequence','isNil','Queue','queue','originated:\x20','stringify','pick','UserId','VoiceQueueId','ListId','channel','message','No\x20such\x20channel','dialAnswer','decrementTalkink','[clearZombieChannel]','loggerError','[Dialer][checkChannel][pTalking][Preview]','[Dialer][checkChannel][Preview]','clearZombieChannels','size','getContactRecallMe','then','length','getDiff','scheduledat','Agent','voicePause','run','[RecallMe]','catch','logger2','disableContact','starttime','YYYY-MM-DD\x20HH:mm:ss','outboundReCallsDay','logCustomer','RecallInQueue','dialRecallInQueue','rescheduleContactInQueue','createBody','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','[getContactRecallMe]','IsNotLoggedIn','NO_AGENTS_LOGGED','isActive','isTrunkReachable','UNREACHABLE_TRUNK','callProgressDetectingCustomer','outboundNoSuchCallsDay','countnosuchnumberretry','countglobal','totalGlobal','NoSuchNumber','buildObj','nosuchnumber','[callProgressDetectingCustomer][logNoSuch]','verifyAdditionalPhones','additional','dialNoSuchNumberRetryFrequency','cloneAction','createCustomerFinal','[callProgressDetectingCustomer][logNoSuchGlobal]','rescheduleContact','scheduledAt','activeContact','linkedid','idContact','incrementPreviewCounters','ANSWER','answertime','[syncHangup][talking][increment]','pTalking:\x20','custom:agentconnect','connect','acw','mandatoryDisposition','custom:agentConnectPreview','channelAgent','uniqueid','custom:agentcomplete','complete','outboundAnswerCallsDay','answered','[16]','[callProgressDetectingCustomer][logAnswer]','[callProgressDetectingCustomer][logAnswerGlobal]','crateCustomerReportQueue','sumDuration','talktime','sumBillable','[syncHangup][talking][decrement]','\x20Queue','outboundBusyCallsDay','countbusyretry','Busy','dialBusyRetryFrequency','callAdditionalPhoneAfterMin','busy','[callProgressDetectingCustomer][logBusy]','dialGlobalMaxRetry','Global','[callProgressDetectingCustomer][logBusyGlobal]','dialBusyMaxRetry','unlockAgent','NOANSWER','countnoanswerretry','dialNoAnswerRetryFrequency','buildNoAnswerEventPayload','custom:agentnoanswer','dialNoAnswerMaxRetry','[callProgressDetectingCustomer][logNoAnswer]','outboundCongestionCallsDay','countcongestionretry','Congestion','custom:agentcongestion','congestion','[callProgressDetectingCustomer][logCongestionGlobal]','dialCongestionMaxRetry','[callProgressDetectingCustomer][logCongestion]','swapAdditionalPhones','CANCEL','outboundRejectCallsDay','countagentrejectretry','AgentReject','dialAgentRejectRetryFrequency','custom:agentreject','agentreject','[syncHangupRequest][logAgentReject]','[callProgressDetectingCustomer][logAgentReject]','countabandonedretry','Abandoned','[callProgressDetectingCustomer][logAbandoned]','dialAbandonedMaxRety','countmachineretry','cause-txt','custom:amd','[callProgressDetectingCustomer][hangupInAMD]','outboundUnknownCallsDay','dialstatus','[callProgressDetectingCustomer][machine]','[default]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','[callProgressDetectingCustomer][logUnknownGlobal]','updateOriginated','[originated][decrement][callProgressDetectingCustomer]','destlinkedid','callProgressDetectingAgent','object','isUndefined','reason','logAgent','[callProgressDetectingAgent][logNoSuch]','NoAnswer','createAgentHistory','[callProgressDetectingAgent][logNoAnswer]','[callProgressDetectingAgent][logBusy]','[callProgressDetectingAgent][logCongestion]','AnswerAGI','[callProgressDetectingAgent][logAnswerAGI]','[callProgressDetectingAgent]','[originated][decrement][callProgressDetectingAgent]','[verifyAdditionalPhone]\x20','[swapAdditionalPhone]\x20','resolve','checkInBlack','Contact','phone','Contact\x20is\x20undefined','lookAgent','isEmpty','execCall','[Preview][execCall][success]','custom:agentcalled','called','Calling','[Preview][execCall][failure]','Call\x20failed','logBlacklist','[Blacklist][error]','Contact\x20in\x20black\x20List','active','SIP/%s','status','reachable','unmonitored','execRun','unlock','unlockContact','recallme','validateContact','checkIsBlackList','[Preview][checkIsBlackList]','[Preview][getContactPreview]','Call\x20unsuccessful','[Preview][validateContact][Empty\x20Contact]','Empty\x20Contact','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','Trunk','[Preview][validateContact][Trunk\x20not\x20working\x20correctly]','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','TrunkBackup','\x20Trunk\x20Backup\x20is\x20not\x20active','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','dialPrefix','trim','dialCutDigit','substring','getCallerId','callerid','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','dialOriginateCallerIdNumber','originatecalleridname','extractCalleridName','originatecalleridnum','extractCalleridNumber','addVariables','merge','toLowerVariables','variables','variablesAction','Action','[originated][increment]','OriginateError','[originateFailure][logOriginateFailure]','actionid','logLookAgent','clone','responsetime','response','rejected','Answer','[callProgressDetectingAgent][logAnswer]','cause','[syncHangup][talking][cause]','dialQueueProject','channelstate','transfer','[syncHangup][talking][transfer]','syncHangupRequest','addVariable','keys','variable','value','error','[syncVarSet][Preview]','inspect','transfertargetlinkedid','transfererlinkedid','exports','util','lodash','uuid','../../../config/environment','preview','../../../config/logger','actionPreview','../ami','./rpcDb','./action','./util/util','../dialer/utils','redis','prototype','enqueue','tail','campaignsPreview','voiceQueues','trunks','actions','agents','clockClearZombieChannels','originateresponse','syncOriginateResponse','bind','hangup','syncHangup','hanguprequest','syncDialEnd','syncNewExten'];(function(_0x2f4498,_0x46342){var _0x40b0af=function(_0x54e5ca){while(--_0x54e5ca){_0x2f4498['push'](_0x2f4498['shift']());}};_0x40b0af(++_0x46342);}(_0xa9e0,0x123));var _0x0a9e=function(_0xf71120,_0x25b7f9){_0xf71120=_0xf71120-0x0;var _0xbe2fd3=_0xa9e0[_0xf71120];return _0xbe2fd3;};'use strict';var util=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));var uuid=require(_0x0a9e('0x2'));var moment=require('moment');var Redis=require('ioredis');var config=require(_0x0a9e('0x3'));var logger=require('../../../config/logger')(_0x0a9e('0x4'));var loggerAction=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var ami=require(_0x0a9e('0x7'));var rpcDb=require(_0x0a9e('0x8'));var cmHopperAdditionalPhone=require('../rpc/cmHopperAdditionalPhone');var Action=require(_0x0a9e('0x9'));var ut=require(_0x0a9e('0xa'));var utils=require(_0x0a9e('0xb'));config['redis']=_['defaults'](config[_0x0a9e('0xc')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x0a9e('0xc')]));var Sequence=function(){};Sequence[_0x0a9e('0xd')][_0x0a9e('0xe')]=function(_0x3ab53f){this[_0x0a9e('0xf')]=this[_0x0a9e('0xf')]?this['tail']['finally'](_0x3ab53f):_0x3ab53f();};function Preview(_0x527cdd){this['sequence']=new Sequence();this[_0x0a9e('0x10')]=_0x527cdd[_0x0a9e('0x11')];this[_0x0a9e('0x12')]=_0x527cdd[_0x0a9e('0x12')];this[_0x0a9e('0x13')]={};this[_0x0a9e('0x14')]=_0x527cdd['agents'];this[_0x0a9e('0x15')]=0x0;ami['on'](_0x0a9e('0x16'),this[_0x0a9e('0x17')][_0x0a9e('0x18')](this));ami['on'](_0x0a9e('0x19'),this[_0x0a9e('0x1a')]['bind'](this));ami['on'](_0x0a9e('0x1b'),this['syncHangupRequest'][_0x0a9e('0x18')](this));ami['on']('dialend',this[_0x0a9e('0x1c')][_0x0a9e('0x18')](this));ami['on']('newexten',this[_0x0a9e('0x1d')]['bind'](this));ami['on'](_0x0a9e('0x1e'),this[_0x0a9e('0x1f')][_0x0a9e('0x18')](this));ami['on'](_0x0a9e('0x20'),this[_0x0a9e('0x21')][_0x0a9e('0x18')](this));ami['on'](_0x0a9e('0x22'),this[_0x0a9e('0x23')][_0x0a9e('0x18')](this));this[_0x0a9e('0x24')](this[_0x0a9e('0x10')]);}function emit(_0x105080,_0x4bb1e3,_0x2c3407){io['to'](_0x105080)[_0x0a9e('0x25')](_0x4bb1e3,_0x2c3407);}function emitVoiceQueueChannelRemove(_0x53682f){logger[_0x0a9e('0x26')]('[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event',JSON['stringify'](_0x53682f));emit(util[_0x0a9e('0x27')](_0x0a9e('0x28'),_0x53682f[_0x0a9e('0x29')]),_0x0a9e('0x2a'),_0x53682f);io['emit'](_0x0a9e('0x2b'),_0x53682f);}function notSendMessagesQueue(_0x2fb0e4){if(_0x2fb0e4[_0x0a9e('0x2c')]){if(_0x2fb0e4[_0x0a9e('0x2d')]===0x0&&_0x2fb0e4[_0x0a9e('0x2e')]===0x0){_0x2fb0e4[_0x0a9e('0x2c')]=![];_0x2fb0e4[_0x0a9e('0x2f')]=0x0;_0x2fb0e4['paused']=0x0;_0x2fb0e4['message']=utils[_0x0a9e('0x30')][_0x0a9e('0x31')];ut[_0x0a9e('0x32')](_0x0a9e('0x33'),_0x2fb0e4['name']+_0x0a9e('0x34'));}else{_0x2fb0e4['message']=utils[_0x0a9e('0x30')]['DEACTIVATED'];ut[_0x0a9e('0x32')](_0x0a9e('0x33'),_0x2fb0e4[_0x0a9e('0x29')]+_0x0a9e('0x35'));}}}Preview[_0x0a9e('0xd')][_0x0a9e('0x24')]=function(){var _0x11c3b6=this;setInterval(function(){_0x11c3b6[_0x0a9e('0x36')]();},0x7cf);};Preview['prototype'][_0x0a9e('0x36')]=function(){var _0x468813=this[_0x0a9e('0x10')];this[_0x0a9e('0x15')]+=0x1;for(var _0x5c877d in _0x468813){if(_0x468813[_0x0a9e('0x37')](_0x5c877d)&&(_0x468813[_0x5c877d][_0x0a9e('0x38')]===_0x0a9e('0x4')||_0x468813[_0x5c877d][_0x0a9e('0x38')]===_0x0a9e('0x39'))&&_0x468813[_0x5c877d][_0x0a9e('0x3a')]===_0x0a9e('0x3b')){if(this[_0x0a9e('0x15')]>0x7){this[_0x0a9e('0x15')]=0x0;this['clearZombieChannels']();}}if(_0x468813[_0x0a9e('0x37')](_0x5c877d)&&_0x468813[_0x5c877d]['dialMethod']===_0x0a9e('0x4')&&_0x468813[_0x5c877d][_0x0a9e('0x3a')]===_0x0a9e('0x3b')){if(_0x468813[_0x5c877d][_0x0a9e('0x3c')]){this[_0x0a9e('0x3d')](_0x468813[_0x5c877d]);if(_0x468813[_0x5c877d]['dialPreviewAutoRecallMe'])this[_0x0a9e('0x3e')](_0x468813[_0x5c877d]);}else{notSendMessagesQueue(_0x468813[_0x5c877d]);}}}};Preview[_0x0a9e('0xd')][_0x0a9e('0x3f')]=function(_0x2da5c0){var _0x2b45ea=this;this[_0x0a9e('0x40')][_0x0a9e('0xe')](function(){if(!_[_0x0a9e('0x41')](_0x2b45ea['actions'][_0x2da5c0])){loggerAction[_0x0a9e('0x26')]('[clearZombieChannels][talking]',_0x2da5c0,_0x0a9e('0x42'),_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x43')],_0x0a9e('0x44'),JSON['stringify'](_0x2b45ea[_0x0a9e('0x10')][_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x43')]][_0x0a9e('0x2d')]),'pTalking:\x20',JSON['stringify'](_0x2b45ea[_0x0a9e('0x10')][_0x2b45ea['actions'][_0x2da5c0][_0x0a9e('0x43')]][_0x0a9e('0x2e')]),JSON[_0x0a9e('0x45')](_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0]['dialAnswer']),JSON[_0x0a9e('0x45')](_[_0x0a9e('0x46')](_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0],['contactId',_0x0a9e('0x47'),_0x0a9e('0x48'),_0x0a9e('0x49')])));return ami['Action']({'action':'status','channel':_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x4a')]})['catch'](function(_0x2b814e){if(_0x2b814e[_0x0a9e('0x4b')]===_0x0a9e('0x4c')){setTimeout(function(){if(_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0]){ut['updateOriginated'](_0x2b45ea['campaignsPreview'][_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x43')]],'[clearZombieChannel]');if(_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x4d')]===!![]){ut[_0x0a9e('0x4e')](_0x2b45ea['campaignsPreview'][_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x43')]],_0x0a9e('0x4f'));ut[_0x0a9e('0x50')](_0x0a9e('0x51')+_0x2da5c0,_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x43')]);}ut[_0x0a9e('0x50')](_0x0a9e('0x52')+_0x2da5c0,_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x43')]);delete _0x2b45ea[_0x0a9e('0x13')][_0x2da5c0];}},0x2328);}});}});};Preview[_0x0a9e('0xd')][_0x0a9e('0x53')]=function(){var _0x37f6cc=this;loggerAction['info']('[action]',_[_0x0a9e('0x54')](this[_0x0a9e('0x13')]));for(var _0x405c8f in this[_0x0a9e('0x13')]){if(_0x37f6cc[_0x0a9e('0x13')][_0x0a9e('0x37')](_0x405c8f)){_0x37f6cc[_0x0a9e('0x3f')](_0x405c8f);}}};Preview[_0x0a9e('0xd')][_0x0a9e('0x3e')]=function(_0x25c6e6){var _0x2c2cb0=this;rpcDb[_0x0a9e('0x55')](_0x25c6e6['id'],ut['agentReadyId'](this[_0x0a9e('0x14')]))[_0x0a9e('0x56')](function(_0xdd268f){if(!_[_0x0a9e('0x41')](_0xdd268f)){for(var _0x2e8caf=0x0;_0x2e8caf<_0xdd268f[_0x0a9e('0x57')];_0x2e8caf+=0x1){if(ut[_0x0a9e('0x58')](_0xdd268f[_0x2e8caf][_0x0a9e('0x59')])<_0x25c6e6['dialRecallMeTimeout']*0x3c){if(_0xdd268f[_0x2e8caf][_0x0a9e('0x5a')]&&!_0xdd268f[_0x2e8caf]['Agent'][_0x0a9e('0x5b')]){_0x2c2cb0[_0x0a9e('0x5c')](_0xdd268f[_0x2e8caf]['id'])[_0x0a9e('0x56')](ut['logger2'](_0x0a9e('0x5d')))[_0x0a9e('0x5e')](ut[_0x0a9e('0x5f')](_0x0a9e('0x5d')));}else{rpcDb[_0x0a9e('0x60')](_0xdd268f[_0x2e8caf]['id']);}}else{var _0x37be73=new Action(_0xdd268f[_0x2e8caf],_0x25c6e6);_0x37be73[_0x0a9e('0x61')]=moment()['format'](_0x0a9e('0x62'));_0x25c6e6[_0x0a9e('0x63')]+=0x1;ut[_0x0a9e('0x64')](_0x37be73,0x17,_0x0a9e('0x65'));if(_0x25c6e6[_0x0a9e('0x66')]){rpcDb[_0x0a9e('0x67')](ut[_0x0a9e('0x68')](_0xdd268f[_0x2e8caf]));rpcDb[_0x0a9e('0x69')](_0x37be73,_0x0a9e('0x6a'));}else{ut['logCustomer'](_0x37be73,0x16,_0x0a9e('0x6b'));rpcDb[_0x0a9e('0x69')](_0x37be73,'[HistoryRecallClose]');rpcDb['createCustomerFinal'](_0x37be73,'[HistoryRecallClose]');}}}}})[_0x0a9e('0x5e')](ut[_0x0a9e('0x5f')](_0x0a9e('0x6c')));};Preview[_0x0a9e('0xd')][_0x0a9e('0x3d')]=function(_0x30decb){_0x30decb[_0x0a9e('0x2c')]=!![];if(ut[_0x0a9e('0x6d')](_0x30decb['loggedIn'])){_0x30decb['message']=utils['CAMPAIGN_STATUS'][_0x0a9e('0x6e')];}else if(!ut[_0x0a9e('0x6f')](_0x30decb[_0x0a9e('0x3c')])){_0x30decb['message']=utils[_0x0a9e('0x30')][_0x0a9e('0x31')];}else if(!this['isTrunkReachable'](_0x30decb['Trunk'])){if(!this[_0x0a9e('0x70')](_0x30decb['TrunkBackup'])){_0x30decb[_0x0a9e('0x4b')]=utils['CAMPAIGN_STATUS'][_0x0a9e('0x71')];}else{_0x30decb[_0x0a9e('0x4b')]=utils[_0x0a9e('0x30')]['ACTIVE'];}}else{_0x30decb[_0x0a9e('0x4b')]=utils[_0x0a9e('0x30')]['ACTIVE'];}};Preview['prototype'][_0x0a9e('0x72')]=function(_0x3aedd0,_0x49c095,_0x145931){var _0x5ce9ac=this;var _0x211ef9=this['actions'][_0x49c095];var _0xe22ccc=this['campaignsPreview'][_0x211ef9['queue']];var _0x5df0ad;var _0x2da03c=![];var _0x47de4c=0x2;var _0x2f7092=0x3;if(_0xe22ccc){switch(_0x145931){case'1':_0xe22ccc[_0x0a9e('0x73')]+=0x1;_0x211ef9[_0x0a9e('0x74')]+=0x1;_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut[_0x0a9e('0x64')](_0x211ef9,0x0,_0x0a9e('0x77'));ami[_0x0a9e('0x25')]('custom:agentnosuchnumber',ut[_0x0a9e('0x78')](_0x211ef9,_0x0a9e('0x79')));rpcDb[_0x0a9e('0x69')](_0x211ef9,_0x0a9e('0x7a'));_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'0',_0xe22ccc)[_0x0a9e('0x56')](function(_0x5d86e9){_0x2da03c=_0x5d86e9[_0x0a9e('0x7c')]==0x1;_0x47de4c=_0xe22ccc[_0x0a9e('0x7d')];_0x2f7092=_0xe22ccc['callAdditionalPhoneAfterMin'];if(!_0x2da03c){if(ut[_0x0a9e('0x76')](_0x211ef9)>=_0xe22ccc['dialGlobalMaxRetry']){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,'Global');rpcDb['createCustomerFinal'](_0x5df0ad,'[callProgressDetectingCustomer][logNoSuchGlobal]');}else{if(_0x211ef9[_0x0a9e('0x74')]>=_0xe22ccc['dialNoSuchNumberMaxRetry']){rpcDb[_0x0a9e('0x7f')](_0x211ef9,_0x0a9e('0x80'));}else{rpcDb[_0x0a9e('0x81')](ut[_0x0a9e('0x82')](_0x211ef9,_0x0a9e('0x74'),_0xe22ccc[_0x0a9e('0x7d')]),_0x211ef9['unlockAgent'],_0x211ef9[_0x0a9e('0x83')]);}}delete this['actions'][_0x3aedd0[_0x0a9e('0x84')]];}else{_0x211ef9[_0x0a9e('0x74')]++;logger[_0x0a9e('0x26')]('actioncountonusuch',_0x211ef9[_0x0a9e('0x74')]);logger[_0x0a9e('0x26')]('id',_0x211ef9[_0x0a9e('0x85')]);_0x5ce9ac[_0x0a9e('0x86')]({'id':_0x211ef9['idContact'],'field':{'countnosuchnumberretry':_0x211ef9[_0x0a9e('0x74')]}})[_0x0a9e('0x56')](function(){_0x5ce9ac['swapAdditionalPhones'](_0x211ef9,_0x47de4c,_0x2f7092)[_0x0a9e('0x56')](function(){});});}});break;case _0x0a9e('0x87'):var _0x88dcbf=moment()[_0x0a9e('0x27')](_0x0a9e('0x62'));_0x211ef9['responsetime']=_0x88dcbf;_0x211ef9[_0x0a9e('0x88')]=_0x88dcbf;_0x211ef9[_0x0a9e('0x4d')]=!![];_0xe22ccc[_0x0a9e('0x2e')]+=0x1;logger['info'](_0x0a9e('0x89'),_0x211ef9['uniqueid'],'\x20Queue',_0xe22ccc[_0x0a9e('0x29')],_0x0a9e('0x8a'),_0xe22ccc[_0x0a9e('0x2e')]);ami[_0x0a9e('0x25')](_0x0a9e('0x8b'),ut[_0x0a9e('0x78')](_0x211ef9,_0x0a9e('0x8c'),this[_0x0a9e('0x10')][_0x211ef9[_0x0a9e('0x43')]]));if(_0xe22ccc[_0x0a9e('0x8d')]||_0xe22ccc[_0x0a9e('0x8e')]){ami[_0x0a9e('0x25')](_0x0a9e('0x8f'),{'queue':_0x211ef9[_0x0a9e('0x43')],'interface':_0x211ef9[_0x0a9e('0x90')],'uniqueid':_0x211ef9[_0x0a9e('0x91')]});}break;case'16':ami[_0x0a9e('0x25')](_0x0a9e('0x92'),ut['buildObj'](_0x211ef9,_0x0a9e('0x93'),this[_0x0a9e('0x10')][_0x211ef9[_0x0a9e('0x43')]]));emitVoiceQueueChannelRemove(ut['buildObj'](_0x211ef9,_0x0a9e('0x93')));_0xe22ccc[_0x0a9e('0x94')]+=0x1;_0xe22ccc['total']+=0x1;_0xe22ccc[_0x0a9e('0x95')]+=0x1;ut[_0x0a9e('0x4e')](_0xe22ccc,_0x0a9e('0x96'));_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut['logCustomer'](_0x211ef9,0x4,'Answer');rpcDb['createCustomerHistory'](_0x211ef9,_0x0a9e('0x97'));rpcDb[_0x0a9e('0x7f')](_0x211ef9,_0x0a9e('0x98'));rpcDb[_0x0a9e('0x99')](_0x211ef9);_0xe22ccc[_0x0a9e('0x9a')]+=_0x211ef9[_0x0a9e('0x9b')];_0xe22ccc[_0x0a9e('0x9c')]+=_0x211ef9[_0x0a9e('0x9b')];logger['info'](_0x0a9e('0x9d'),_0x211ef9[_0x0a9e('0x91')],_0x0a9e('0x9e'),_0xe22ccc['name'],_0x0a9e('0x8a'),_0xe22ccc['pTalking']);delete this[_0x0a9e('0x13')][_0x3aedd0[_0x0a9e('0x84')]];break;case'BUSY':_0xe22ccc[_0x0a9e('0x9f')]+=0x1;_0x211ef9[_0x0a9e('0xa0')]+=0x1;_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut['logCustomer'](_0x211ef9,0x5,_0x0a9e('0xa1'));_0x47de4c=_0xe22ccc[_0x0a9e('0xa2')];_0x2f7092=_0xe22ccc[_0x0a9e('0xa3')];ami[_0x0a9e('0x25')]('custom:agentbusy',ut[_0x0a9e('0x78')](_0x211ef9,_0x0a9e('0xa4')));rpcDb[_0x0a9e('0x69')](_0x211ef9,_0x0a9e('0xa5'));_0x5ce9ac['verifyAdditionalPhones'](_0x211ef9,'5',_0xe22ccc)[_0x0a9e('0x56')](function(_0x3511c9){_0x2da03c=_0x3511c9[_0x0a9e('0x7c')]==0x1;if(!_0x2da03c){if(ut[_0x0a9e('0x76')](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,_0x0a9e('0xa7'));rpcDb[_0x0a9e('0x7f')](_0x5df0ad,_0x0a9e('0xa8'));}else{if(_0x211ef9[_0x0a9e('0xa0')]>=_0xe22ccc[_0x0a9e('0xa9')]){rpcDb[_0x0a9e('0x7f')](_0x211ef9,_0x0a9e('0xa5'));}else{rpcDb[_0x0a9e('0x81')](ut['scheduledAt'](_0x211ef9,_0x0a9e('0xa0'),_0xe22ccc[_0x0a9e('0xa2')]),_0x211ef9[_0x0a9e('0xaa')],_0x211ef9['activeContact']);}}}else{_0x211ef9[_0x0a9e('0xa0')]++;_0x5ce9ac[_0x0a9e('0x86')]({'id':_0x211ef9[_0x0a9e('0x85')],'field':{'countbusyretry':_0x211ef9[_0x0a9e('0xa0')]}})['then'](function(){_0x5ce9ac['swapAdditionalPhones'](_0x211ef9,_0x47de4c,_0x2f7092)[_0x0a9e('0x56')](function(){});});}});break;case _0x0a9e('0xab'):_0xe22ccc['outboundNoAnswerCallsDay']+=0x1;_0x211ef9[_0x0a9e('0xac')]+=0x1;_0x211ef9['countglobal']=ut[_0x0a9e('0x76')](_0x211ef9);ut[_0x0a9e('0x64')](_0x211ef9,0x3,'NoAnswer');_0x47de4c=_0xe22ccc[_0x0a9e('0xad')];_0x2f7092=_0xe22ccc[_0x0a9e('0xa3')];var _0x2d2286=ut[_0x0a9e('0xae')](_0x211ef9,_0xe22ccc);ami[_0x0a9e('0x25')](_0x0a9e('0xaf'),_0x2d2286);rpcDb[_0x0a9e('0x69')](_0x211ef9,'[callProgressDetectingCustomer][logNoAnswer]');_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'3',_0xe22ccc)[_0x0a9e('0x56')](function(_0x45c109){_0x2da03c=_0x45c109[_0x0a9e('0x7c')]==0x1;if(!_0x2da03c){if(ut['totalGlobal'](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,'Global');rpcDb[_0x0a9e('0x7f')](_0x5df0ad,'[callProgressDetectingCustomer][logNoAnswerGlobal]');}else{if(_0x211ef9[_0x0a9e('0xac')]>=_0xe22ccc[_0x0a9e('0xb0')]){rpcDb[_0x0a9e('0x7f')](_0x211ef9,_0x0a9e('0xb1'));}else{rpcDb['rescheduleContact'](ut['scheduledAt'](_0x211ef9,_0x0a9e('0xac'),_0xe22ccc[_0x0a9e('0xad')]),_0x211ef9[_0x0a9e('0xaa')],_0x211ef9['activeContact']);}}}else{_0x211ef9[_0x0a9e('0xac')]++;_0x5ce9ac[_0x0a9e('0x86')]({'id':_0x211ef9['idContact'],'field':{'countnoanswerretry':_0x211ef9['countnoanswerretry']}})[_0x0a9e('0x56')](function(){_0x5ce9ac['swapAdditionalPhones'](_0x211ef9,_0x47de4c,_0x2f7092)['then'](function(){});});}});break;case'CONGESTION':_0xe22ccc[_0x0a9e('0xb2')]+=0x1;_0x211ef9[_0x0a9e('0xb3')]+=0x1;_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut[_0x0a9e('0x64')](_0x211ef9,0x8,_0x0a9e('0xb4'));_0x47de4c=_0xe22ccc['dialCongestionRetryFrequency'];_0x2f7092=_0xe22ccc[_0x0a9e('0xa3')];ami['emit'](_0x0a9e('0xb5'),ut[_0x0a9e('0x78')](_0x211ef9,_0x0a9e('0xb6')));rpcDb[_0x0a9e('0x69')](_0x211ef9,'[callProgressDetectingCustomer][logCongestion]');_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'8',_0xe22ccc)[_0x0a9e('0x56')](function(_0x1d4877){_0x2da03c=_0x1d4877['additional']==0x1;if(!_0x2da03c){if(ut[_0x0a9e('0x76')](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,_0x0a9e('0xa7'));rpcDb[_0x0a9e('0x7f')](_0x5df0ad,_0x0a9e('0xb7'));}else{if(_0x211ef9[_0x0a9e('0xb3')]>=_0xe22ccc[_0x0a9e('0xb8')]){rpcDb['createCustomerFinal'](_0x211ef9,_0x0a9e('0xb9'));}else{rpcDb[_0x0a9e('0x81')](ut['scheduledAt'](_0x211ef9,_0x0a9e('0xb3'),_0xe22ccc[_0x0a9e('0xa2')]),_0x211ef9[_0x0a9e('0xaa')],_0x211ef9['activeContact']);}}}else{_0x211ef9[_0x0a9e('0xb3')]++;_0x5ce9ac['incrementPreviewCounters']({'id':_0x211ef9[_0x0a9e('0x85')],'field':{'countcongestionretry':_0x211ef9[_0x0a9e('0xb3')]}})[_0x0a9e('0x56')](function(){_0x5ce9ac[_0x0a9e('0xba')](_0x211ef9,_0x47de4c,_0x2f7092)[_0x0a9e('0x56')](function(){});});}});break;case _0x0a9e('0xbb'):_0xe22ccc[_0x0a9e('0xbc')]+=0x1;_0x211ef9[_0x0a9e('0xbd')]+=0x1;_0x211ef9['countglobal']=ut[_0x0a9e('0x76')](_0x211ef9);ut[_0x0a9e('0x64')](_0x211ef9,0x14,_0x0a9e('0xbe'));_0x47de4c=_0xe22ccc[_0x0a9e('0xbf')];_0x2f7092=_0xe22ccc[_0x0a9e('0xa3')];ami[_0x0a9e('0x25')](_0x0a9e('0xc0'),ut[_0x0a9e('0x78')](_0x211ef9,_0x0a9e('0xc1')));rpcDb[_0x0a9e('0x69')](_0x211ef9,_0x0a9e('0xc2'));_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'20',_0xe22ccc)[_0x0a9e('0x56')](function(_0x4989f9){_0x2da03c=_0x4989f9[_0x0a9e('0x7c')]==0x1;if(!_0x2da03c){if(ut[_0x0a9e('0x76')](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0x14,_0x0a9e('0xbe'));rpcDb['createCustomerFinal'](_0x5df0ad,_0x0a9e('0xc3'));}else{if(_0x211ef9[_0x0a9e('0xbd')]>=_0xe22ccc['dialAgentRejectMaxRetry']){rpcDb[_0x0a9e('0x7f')](_0x211ef9,'[callProgressDetectingCustomer][logAgentReject]');}else{rpcDb[_0x0a9e('0x81')](ut[_0x0a9e('0x82')](_0x211ef9,_0x0a9e('0xbd'),_0xe22ccc[_0x0a9e('0xbf')]),_0x211ef9['unlockAgent'],_0x211ef9[_0x0a9e('0x83')]);}}}else{_0x211ef9['countnoanswerretry']++;_0x5ce9ac[_0x0a9e('0x86')]({'id':_0x211ef9[_0x0a9e('0x85')],'field':{'countnoanswerretry':_0x211ef9['countnoanswerretry']}})[_0x0a9e('0x56')](function(){_0x5ce9ac[_0x0a9e('0xba')](_0x211ef9,_0x47de4c,_0x2f7092)[_0x0a9e('0x56')](function(){});});}});break;case'ABANDONED':_0xe22ccc['outboundAbandonedCallsDay']+=0x1;_0x211ef9[_0x0a9e('0xc4')]+=0x1;_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut[_0x0a9e('0x64')](_0x211ef9,0xb,_0x0a9e('0xc5'));rpcDb[_0x0a9e('0x69')](_0x211ef9,_0x0a9e('0xc6'));_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'11',_0xe22ccc)[_0x0a9e('0x56')](function(_0x586510){_0x2da03c=_0x586510[_0x0a9e('0x7c')]==0x1;if(!_0x2da03c){if(ut['totalGlobal'](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,_0x0a9e('0xa7'));rpcDb[_0x0a9e('0x7f')](_0x5df0ad,_0x0a9e('0xc6'));}else{if(_0x211ef9['countabandonedetry']>=_0xe22ccc[_0x0a9e('0xc7')]){rpcDb[_0x0a9e('0x7f')](_0x211ef9,_0x0a9e('0xc6'));}else{rpcDb[_0x0a9e('0x81')](ut[_0x0a9e('0x82')](_0x211ef9,'countabandonedretry',_0xe22ccc['dialAbandonedRetryFrequency']),_0x211ef9[_0x0a9e('0xaa')],_0x211ef9['activeContact']);}}}else{_0x211ef9[_0x0a9e('0xac')]++;_0x5ce9ac[_0x0a9e('0x86')]({'id':_0x211ef9[_0x0a9e('0x85')],'field':{'countnoanswerretry':_0x211ef9[_0x0a9e('0xac')]}})[_0x0a9e('0x56')](function(){_0x5ce9ac[_0x0a9e('0xba')](_0x211ef9,_0x47de4c,_0x2f7092)['then'](function(){});});}});break;case'18':_0xe22ccc['outboundUnknownCallsDay']+=0x1;_0x211ef9[_0x0a9e('0xc8')]+=0x1;_0x211ef9['countglobal']=ut[_0x0a9e('0x76')](_0x211ef9);ut['logCustomer'](_0x211ef9,0x12,_0x3aedd0[_0x0a9e('0xc9')]||_0x3aedd0['dialstatus']);ami['emit'](_0x0a9e('0xca'),ut[_0x0a9e('0x78')](_0x211ef9,'amd'));rpcDb[_0x0a9e('0x69')](_0x211ef9,_0x0a9e('0xcb'));_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'18',_0xe22ccc)[_0x0a9e('0x56')](function(_0x2eb028){_0x2da03c=_0x2eb028['additional']==0x1;if(!_0x2da03c){if(ut['totalGlobal'](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0x12,_0x0a9e('0xa7'));rpcDb[_0x0a9e('0x7f')](_0x5df0ad,_0x0a9e('0xcb'));}else{rpcDb['createCustomerFinal'](_0x211ef9,_0x0a9e('0xcb'));}}else{_0x211ef9[_0x0a9e('0xac')]++;_0x5ce9ac['incrementPreviewCounters']({'id':_0x211ef9[_0x0a9e('0x85')],'field':{'countnoanswerretry':_0x211ef9[_0x0a9e('0xac')]}})[_0x0a9e('0x56')](function(){_0x5ce9ac[_0x0a9e('0xba')](_0x211ef9,_0x47de4c,_0x2f7092)[_0x0a9e('0x56')](function(){});});}});delete this[_0x0a9e('0x13')][_0x3aedd0[_0x0a9e('0x84')]];break;case'19':_0xe22ccc[_0x0a9e('0xcc')]+=0x1;_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut['logCustomer'](_0x211ef9,0x13,_0x3aedd0[_0x0a9e('0xc9')]||_0x3aedd0[_0x0a9e('0xcd')]);ami[_0x0a9e('0x25')](_0x0a9e('0xca'),ut[_0x0a9e('0x78')](_0x211ef9,'amd'));rpcDb['createCustomerHistory'](_0x211ef9,_0x0a9e('0xce'));_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'18',_0xe22ccc)[_0x0a9e('0x56')](function(_0x2fea95){_0x2da03c=_0x2fea95[_0x0a9e('0x7c')]==0x1;if(!_0x2da03c){if(ut['totalGlobal'](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,_0x0a9e('0xa7'));rpcDb['createCustomerFinal'](_0x5df0ad,_0x0a9e('0xce'));}else{rpcDb['createCustomerFinal'](_0x211ef9,_0x0a9e('0xce'));}}else{_0x211ef9['countnoanswerretry']++;_0x5ce9ac[_0x0a9e('0x86')]({'id':_0x211ef9[_0x0a9e('0x85')],'field':{'countnoanswerretry':_0x211ef9[_0x0a9e('0xac')]}})['then'](function(){_0x5ce9ac[_0x0a9e('0xba')](_0x211ef9,_0x47de4c,_0x2f7092)['then'](function(){});});}});delete this[_0x0a9e('0x13')][_0x3aedd0[_0x0a9e('0x84')]];break;default:if(_0x211ef9[_0x0a9e('0x4d')]){ut[_0x0a9e('0x4e')](_0xe22ccc,_0x0a9e('0xcf'));ut[_0x0a9e('0x50')](_0x0a9e('0xd0')+_0xe22ccc[_0x0a9e('0x29')],_0x3aedd0);}_0xe22ccc[_0x0a9e('0xcc')]+=0x1;_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut[_0x0a9e('0x64')](_0x211ef9,0xc,_0x3aedd0[_0x0a9e('0xc9')]||_0x3aedd0[_0x0a9e('0xcd')]);_0x47de4c=_0xe22ccc[_0x0a9e('0xbf')];_0x2f7092=_0xe22ccc[_0x0a9e('0xa3')];rpcDb['createCustomerHistory'](_0x211ef9,'[callProgressDetectingCustomer][logUnknown]');_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'20',_0xe22ccc)['then'](function(_0x1d999b){_0x2da03c=_0x1d999b[_0x0a9e('0x7c')]==0x1;if(!_0x2da03c){if(ut['totalGlobal'](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,_0x0a9e('0xa7'));rpcDb[_0x0a9e('0x7f')](_0x5df0ad,'[callProgressDetectingCustomer][logUnknownGlobal]');}else{rpcDb[_0x0a9e('0x7f')](_0x211ef9,_0x0a9e('0xd1'));}delete this[_0x0a9e('0x13')][_0x3aedd0[_0x0a9e('0x84')]];}else{_0x5ce9ac['swapAdditionalPhones'](_0x211ef9,_0x47de4c,_0x2f7092)[_0x0a9e('0x56')](function(){});}});}if(!(_0x211ef9[_0x0a9e('0x4d')]&&_0x145931==='16')){ut[_0x0a9e('0xd2')](_0xe22ccc,'[callProgressDetectingCustomer]');logger[_0x0a9e('0x26')](_0x0a9e('0xd3'),_0x211ef9[_0x0a9e('0x91')],'\x20Queue',_0xe22ccc[_0x0a9e('0x29')],_0x0a9e('0x44'),_0xe22ccc[_0x0a9e('0x2d')]);}if(_0x145931!==_0x0a9e('0x87')){delete this[_0x0a9e('0x13')][_0x3aedd0['linkedid']];delete this[_0x0a9e('0x13')][_0x3aedd0[_0x0a9e('0xd4')]];}_0xe22ccc['queueSummaryCountersUpdated']=!![];}};Preview[_0x0a9e('0xd')][_0x0a9e('0xd5')]=function(_0x1f6f1c,_0x5822a7,_0x5c3b6f){if(_['isUndefined'](_0x5822a7)&&_0x0a9e('0xd6')!==typeof _0x5822a7){return;}if(_[_0x0a9e('0xd7')](_0x5c3b6f)&&'object'!==typeof _0x5c3b6f){return;}switch(_0x5c3b6f[_0x0a9e('0xd8')]){case'0':ut[_0x0a9e('0xd9')](_0x1f6f1c,0x0,_0x0a9e('0x77'));rpcDb['createAgentHistory'](_0x1f6f1c,_0x0a9e('0xda'));break;case'3':ut[_0x0a9e('0xd9')](_0x1f6f1c,0x3,_0x0a9e('0xdb'));rpcDb[_0x0a9e('0xdc')](_0x1f6f1c,_0x0a9e('0xdd'));break;case'5':ut[_0x0a9e('0xd9')](_0x1f6f1c,0x5,_0x0a9e('0xa1'));rpcDb[_0x0a9e('0xdc')](_0x1f6f1c,_0x0a9e('0xde'));break;case'8':ut['logAgent'](_0x1f6f1c,0x8,_0x0a9e('0xb4'));rpcDb['createAgentHistory'](_0x1f6f1c,_0x0a9e('0xdf'));break;case'22':ut[_0x0a9e('0xd9')](_0x1f6f1c,0x16,_0x0a9e('0xe0'));rpcDb[_0x0a9e('0xdc')](_0x1f6f1c,_0x0a9e('0xe1'));break;default:ut[_0x0a9e('0xd9')](_0x1f6f1c,0xc,_0x5c3b6f['reason']);rpcDb[_0x0a9e('0xdc')](_0x1f6f1c,_0x0a9e('0xdf'));}ut[_0x0a9e('0xd2')](_0x5822a7,_0x0a9e('0xe2'));logger['info'](_0x0a9e('0xe3'),_0x1f6f1c[_0x0a9e('0x91')],_0x0a9e('0x9e'),_0x5822a7[_0x0a9e('0x29')],_0x0a9e('0x44'),_0x5822a7[_0x0a9e('0x2d')]);delete this[_0x0a9e('0x13')][_0x1f6f1c[_0x0a9e('0x91')]];};Preview[_0x0a9e('0xd')][_0x0a9e('0x7b')]=function(_0x57f0ad,_0x2272bc,_0x88b25f){return cmHopperAdditionalPhone[_0x0a9e('0x7b')](_0x57f0ad,_0x2272bc,_0x88b25f)[_0x0a9e('0x5e')](logger[_0x0a9e('0x26')](_0x0a9e('0xe4')));};Preview[_0x0a9e('0xd')][_0x0a9e('0xba')]=function(_0x566b90,_0x3b581c,_0xd2391){return cmHopperAdditionalPhone[_0x0a9e('0xba')](_0x566b90,_0x3b581c,_0xd2391)['catch'](logger[_0x0a9e('0x26')](_0x0a9e('0xe5')));};Preview[_0x0a9e('0xd')][_0x0a9e('0x86')]=function(_0x370b5e){return Promise[_0x0a9e('0xe6')]()[_0x0a9e('0x56')](cmHopperAdditionalPhone[_0x0a9e('0x86')](_0x370b5e))[_0x0a9e('0x5e')](logger[_0x0a9e('0x26')]('[incrementPreviewCounters]\x20'));};Preview[_0x0a9e('0xd')][_0x0a9e('0xe7')]=function(_0x15a9ed,_0x3db98f,_0x2b624e,_0x3942fd,_0x5cb48d){var _0x382687=this;return new Promise(function(_0x4f854b,_0x5bd139){if(_['isNil'](_0x3db98f)||_[_0x0a9e('0x41')](_0x3db98f[_0x0a9e('0xe8')])||_[_0x0a9e('0x41')](_0x3db98f[_0x0a9e('0xe9')])||_['isNil'](_0x3db98f[_0x0a9e('0x48')])){_0x5bd139(ut[_0x0a9e('0x4b')](_0x0a9e('0xea'),_0x3942fd,_0x5cb48d));return;}var _0x1fdb10=uuid['v4']();var _0x2c8d1d=_0x382687['campaignsPreview'][_0x3db98f['Queue'][_0x0a9e('0x29')]];var _0x33bcb2=_0x2b624e?_0x382687[_0x0a9e('0x14')][_0x2b624e]['id']:undefined;_0x382687['actions'][_0x1fdb10]=new Action(_0x3db98f,_0x2c8d1d,_0x1fdb10,_0x2b624e,_0x33bcb2);var _0x319752=_0x382687[_0x0a9e('0x13')][_0x1fdb10];_0x319752[_0x0a9e('0xaa')]=_0x3942fd;_0x319752['activeContact']=_0x5cb48d;_0x319752[_0x0a9e('0xeb')]=_0x2b624e;if(_[_0x0a9e('0xec')](_0x15a9ed)){_0x382687[_0x0a9e('0xed')](_0x319752,_0x2c8d1d,_0x3db98f,_0x2b624e)['then'](function(_0x272291){logger[_0x0a9e('0x26')](_0x0a9e('0xee'),'Queue:\x20'+_0x319752['queue']+'\x20IdHopper:\x20'+_0x319752[_0x0a9e('0x85')],JSON[_0x0a9e('0x45')](_0x272291));ami[_0x0a9e('0x25')](_0x0a9e('0xef'),ut['buildObj'](_0x319752,_0x0a9e('0xf0'),_0x382687['campaignsPreview'][_0x319752[_0x0a9e('0x43')]]));_0x4f854b(ut[_0x0a9e('0x4b')](_0x0a9e('0xf1')));})['catch'](function(_0x33b4b3){ut[_0x0a9e('0x32')](_0x0a9e('0xf2'),_0x33b4b3);_0x5bd139(ut['message'](_0x0a9e('0xf3'),_0x3942fd,_0x5cb48d));});}else{_0x2c8d1d['outboundBlacklistCallsDay']+=0x1;ut[_0x0a9e('0xf4')](_0x319752);rpcDb['createHistory'](_0x319752,_0x0a9e('0xf5'));delete _0x382687['actions'][_0x1fdb10];_0x5bd139(ut[_0x0a9e('0x4b')](_0x0a9e('0xf6'),_0x3942fd,_0x5cb48d));}});};Preview[_0x0a9e('0xd')][_0x0a9e('0x70')]=function(_0x1e306c){return!_[_0x0a9e('0x41')](_0x1e306c)&&!_[_0x0a9e('0x41')](_0x1e306c['name'])&&!_[_0x0a9e('0x41')](_0x1e306c[_0x0a9e('0xf7')])&&_0x1e306c['active']&&!_[_0x0a9e('0x41')](this[_0x0a9e('0x12')][util['format'](_0x0a9e('0xf8'),_0x1e306c[_0x0a9e('0x29')])])&&!_[_0x0a9e('0x41')](this['trunks'][util[_0x0a9e('0x27')](_0x0a9e('0xf8'),_0x1e306c[_0x0a9e('0x29')])][_0x0a9e('0xf9')])&&(this[_0x0a9e('0x12')][util[_0x0a9e('0x27')](_0x0a9e('0xf8'),_0x1e306c[_0x0a9e('0x29')])][_0x0a9e('0xf9')]===_0x0a9e('0xfa')||this['trunks'][util[_0x0a9e('0x27')]('SIP/%s',_0x1e306c[_0x0a9e('0x29')])][_0x0a9e('0xf9')]===_0x0a9e('0xfb'));};Preview[_0x0a9e('0xd')][_0x0a9e('0x5c')]=function(_0x2d45db,_0x5691ac){return this[_0x0a9e('0xfc')](_0x2d45db,_0x5691ac)[_0x0a9e('0x56')](function(_0x2977a7){return _['pick'](_0x2977a7,[_0x0a9e('0x4b')]);})[_0x0a9e('0x5e')](function(_0x4435d2){if(_0x4435d2[_0x0a9e('0xfd')]){rpcDb[_0x0a9e('0xfe')](_0x2d45db);}if(_0x4435d2[_0x0a9e('0xf7')]){rpcDb[_0x0a9e('0x60')](_0x2d45db);}throw _['pick'](_0x4435d2,[_0x0a9e('0x4b')]);});};Preview[_0x0a9e('0xd')][_0x0a9e('0xfc')]=function(_0x2ce3be,_0x3de77e){var _0x241404=this;var _0x8120e,_0x5d6a48;return rpcDb['getContactPreview'](_0x2ce3be)[_0x0a9e('0x56')](function(_0x3f507c){if(!_[_0x0a9e('0x41')](_0x3f507c[0x0])){_0x5d6a48=_0x3f507c[0x0][_0x0a9e('0xff')]?![]:!![];_0x8120e=_0x3f507c[0x0][_0x0a9e('0xff')]?!![]:![];_0x8120e=_0x3de77e?!![]:_0x8120e;}var _0x131da8=_0x241404[_0x0a9e('0x100')](_0x3f507c);if(_0x131da8['isValid']){rpcDb[_0x0a9e('0x101')](_[_0x0a9e('0x46')](_0x3f507c[0x0],[_0x0a9e('0x48'),_0x0a9e('0xe9')]))[_0x0a9e('0x56')](function(_0x3c6082){_0x241404[_0x0a9e('0xe7')](_0x3c6082,_0x3f507c[0x0],_0x3de77e,_0x5d6a48,_0x8120e)['then'](function(_0x311288){return _0x311288;})[_0x0a9e('0x5e')](function(_0x231826){throw _0x231826;});})['catch'](function(_0x2b8ad4){ut[_0x0a9e('0x32')](_0x0a9e('0x102'),_0x2b8ad4);throw ut[_0x0a9e('0x4b')]('Call\x20unsuccessful',_0x5d6a48,_0x8120e);});}else{throw ut[_0x0a9e('0x4b')](_0x131da8[_0x0a9e('0x4b')],_0x5d6a48,_0x8120e);}})[_0x0a9e('0x5e')](function(_0x93d953){ut[_0x0a9e('0x32')](_0x0a9e('0x103'),_0x93d953);throw ut[_0x0a9e('0x4b')](_0x0a9e('0x104'),![],!![]);});};Preview['prototype'][_0x0a9e('0x100')]=function(_0x266aa1){if(_[_0x0a9e('0x41')](_0x266aa1)||_[_0x0a9e('0xec')](_0x266aa1)||!_['isNil'](_0x266aa1[0x0]['Agent'])&&_[_0x0a9e('0x41')](_0x266aa1[0x0][_0x0a9e('0x5a')][_0x0a9e('0x29')])){ut['logger'](_0x0a9e('0x105'),_0x266aa1);return{'isValid':![],'message':_0x0a9e('0x106')};}var _0x4d8a67=this[_0x0a9e('0x10')][_0x266aa1[0x0]['Queue'][_0x0a9e('0x29')]];_0x4d8a67['message']=utils['CAMPAIGN_STATUS']['ACTIVE'];if(_[_0x0a9e('0x41')](_0x4d8a67)){ut[_0x0a9e('0x32')](_0x0a9e('0x107'),_0x4d8a67);return{'isValid':![],'message':_0x0a9e('0x108')};}if(!this[_0x0a9e('0x70')](_0x4d8a67[_0x0a9e('0x109')])){ut['logger'](_0x0a9e('0x10a'),_0x0a9e('0x10b')+_0x4d8a67[_0x0a9e('0x29')]+_0x0a9e('0x10c'));if(!this[_0x0a9e('0x70')](_0x4d8a67[_0x0a9e('0x10d')])){ut[_0x0a9e('0x32')]('[Preview][validateContact][Trunk\x20not\x20working\x20correctly]',_0x4d8a67['name']+_0x0a9e('0x10e'));return{'isValid':![],'message':'Trunk\x20not\x20working\x20correctly'};}}if(!ut[_0x0a9e('0x6f')](_0x4d8a67[_0x0a9e('0x3c')])){ut[_0x0a9e('0x32')](_0x0a9e('0x10f'),_0x4d8a67[_0x0a9e('0x29')]+_0x0a9e('0x110'));return{'isValid':![],'message':'campaign\x20Name:\x20'+_0x4d8a67[_0x0a9e('0x29')]+'\x20Not\x20Active'};}return{'isValid':!![],'message':'Is\x20Valid'};};Preview[_0x0a9e('0xd')]['execCall']=function(_0x38dceb,_0x5dc978,_0x550cbf,_0x26223f){var _0x4a7a3c=this;return new Promise(function(_0x24470a,_0x142e53){var _0xe1ab0d=_0x38dceb['uniqueid'];var _0x4152cd=_0x4a7a3c[_0x0a9e('0x70')](_0x5dc978[_0x0a9e('0x109')])?util['format']('SIP/%s/%s%s',_0x5dc978[_0x0a9e('0x109')][_0x0a9e('0x29')],_[_0x0a9e('0x41')](_0x5dc978[_0x0a9e('0x111')])?'':_0x5dc978[_0x0a9e('0x111')][_0x0a9e('0x112')]()||'',_0x5dc978[_0x0a9e('0x113')]>0x0?_0x550cbf[_0x0a9e('0xe9')][_0x0a9e('0x114')](_0x5dc978[_0x0a9e('0x113')]):_0x550cbf['phone']):util['format']('SIP/%s/%s%s',_[_0x0a9e('0x41')](_0x5dc978[_0x0a9e('0x10d')])?_0x5dc978[_0x0a9e('0x109')][_0x0a9e('0x29')]:_0x5dc978[_0x0a9e('0x10d')][_0x0a9e('0x29')],_[_0x0a9e('0x41')](_0x5dc978[_0x0a9e('0x111')])?'':_0x5dc978['dialPrefix']['trim']()||'',_0x5dc978[_0x0a9e('0x113')]>0x0?_0x550cbf[_0x0a9e('0xe9')]['substring'](_0x5dc978[_0x0a9e('0x113')]):_0x550cbf[_0x0a9e('0xe9')]);var _0x2e2280=_0x4a7a3c[_0x0a9e('0x70')](_0x5dc978[_0x0a9e('0x109')])?ut[_0x0a9e('0x115')](_0x5dc978[_0x0a9e('0x109')][_0x0a9e('0x116')],_0x5dc978[_0x0a9e('0x117')],_0x5dc978[_0x0a9e('0x118')]>0x0?ut[_0x0a9e('0x119')](_0x5dc978[_0x0a9e('0x11a')],_0x5dc978['dialRandomLastDigitCallerIdNumber']):_0x5dc978[_0x0a9e('0x11a')]):ut[_0x0a9e('0x115')](_[_0x0a9e('0x41')](_0x5dc978[_0x0a9e('0x10d')])?_0x5dc978[_0x0a9e('0x109')][_0x0a9e('0x116')]:_0x5dc978[_0x0a9e('0x10d')][_0x0a9e('0x116')],_0x5dc978[_0x0a9e('0x117')],_0x5dc978[_0x0a9e('0x118')]>0x0?ut[_0x0a9e('0x119')](_0x5dc978[_0x0a9e('0x11a')],_0x5dc978['dialRandomLastDigitCallerIdNumber']):_0x5dc978['dialOriginateCallerIdNumber']);if(_0x2e2280){_0x38dceb[_0x0a9e('0x11b')]=ut[_0x0a9e('0x11c')](_0x2e2280);_0x38dceb[_0x0a9e('0x11d')]=ut[_0x0a9e('0x11e')](_0x2e2280);}var _0x33359a=ut[_0x0a9e('0x11f')](_0x5dc978,_0x550cbf,_0x4152cd,_0x2e2280,_0xe1ab0d,_0x38dceb);var _0xa8b5de=utils['setXMDContactVariables'](_0x550cbf[_0x0a9e('0xe8')]);Object['assign'](_0x33359a,_0xa8b5de);_[_0x0a9e('0x120')](_0x38dceb,ut[_0x0a9e('0x121')](_0x33359a));_0x38dceb[_0x0a9e('0x61')]=moment()[_0x0a9e('0x27')](_0x0a9e('0x62'));_0x5dc978[_0x0a9e('0x122')]=_0x33359a;var _0x465003=ut[_0x0a9e('0x123')](_0x38dceb,_0x5dc978,_0x33359a,_0x38dceb[_0x0a9e('0x83')],_0x26223f);return ami[_0x0a9e('0x124')](_0x465003)[_0x0a9e('0x56')](function(_0x8231e5){_0x5dc978[_0x0a9e('0x2d')]+=0x1;logger[_0x0a9e('0x26')](_0x0a9e('0x125'),_0xe1ab0d,_0x0a9e('0x9e'),_0x5dc978['name'],'originated:\x20',_0x5dc978[_0x0a9e('0x2d')]);_0x24470a(_0x8231e5);})[_0x0a9e('0x5e')](function(_0x52b365){ut['logAgent'](_0x38dceb,0xe,_0x0a9e('0x126'));rpcDb[_0x0a9e('0xdc')](_0x38dceb,_0x0a9e('0x127'));_0x142e53(_0x52b365);});});};Preview['prototype'][_0x0a9e('0x1d')]=function(_0x5b6447){if(this[_0x0a9e('0x13')][_0x5b6447['linkedid']]){this[_0x0a9e('0x13')][_0x5b6447['linkedid']][_0x0a9e('0x4a')]=_0x5b6447[_0x0a9e('0x4a')];}};Preview[_0x0a9e('0xd')]['syncOriginateResponse']=function(_0x316b51){var _0x497fda=this;var _0x505ffd=this[_0x0a9e('0x13')][_0x316b51[_0x0a9e('0x128')]];if(_0x505ffd){if(_0x505ffd[_0x0a9e('0xeb')]&&this[_0x0a9e('0x14')][_0x505ffd[_0x0a9e('0xeb')]]){ut[_0x0a9e('0x129')](_0x505ffd,this[_0x0a9e('0x14')][_0x505ffd[_0x0a9e('0xeb')]][_0x0a9e('0x29')],this[_0x0a9e('0x14')][_0x505ffd[_0x0a9e('0xeb')]]['id']);}var _0x98bf26=_[_0x0a9e('0x12a')](_0x505ffd);_0x98bf26[_0x0a9e('0x12b')]=moment()[_0x0a9e('0x27')](_0x0a9e('0x62'));var _0x310026=_0x497fda[_0x0a9e('0x10')][_0x505ffd[_0x0a9e('0x43')]];if(ut['isFailure'](_0x316b51[_0x0a9e('0x12c')])){if(_0x505ffd[_0x0a9e('0xaa')]){rpcDb[_0x0a9e('0xfe')](_0x505ffd[_0x0a9e('0x85')]);}if(_0x505ffd['activeContact']){rpcDb['disableContact'](_0x505ffd['idContact']);}ami[_0x0a9e('0x25')]('custom:agentringnoanswer',ut[_0x0a9e('0x78')](_0x505ffd,_0x0a9e('0x12d'),this[_0x0a9e('0x10')][_0x505ffd[_0x0a9e('0x43')]]));this[_0x0a9e('0xd5')](_0x98bf26,_0x310026,_0x316b51);}else{_0x505ffd[_0x0a9e('0x61')]=moment()[_0x0a9e('0x27')](_0x0a9e('0x62'));ut[_0x0a9e('0xd9')](_0x98bf26,0x4,_0x0a9e('0x12e'));rpcDb['createAgentHistory'](_0x98bf26,_0x0a9e('0x12f'));}}};Preview['prototype'][_0x0a9e('0x1a')]=function(_0x586d2f){var _0xf4de86=this[_0x0a9e('0x13')][_0x586d2f[_0x0a9e('0x84')]];var _0x556bb7;if(_0xf4de86){_0x556bb7=this[_0x0a9e('0x10')][_0xf4de86[_0x0a9e('0x43')]];logger['info']('[syncHangup][talking]',_0x586d2f[_0x0a9e('0x84')],_0x0a9e('0x9e'),_0x556bb7[_0x0a9e('0x29')],'pTalking:\x20',_0x556bb7['pTalking']);}if(this['actions'][_0x586d2f[_0x0a9e('0x84')]]&&_0x586d2f[_0x0a9e('0x84')]!==_0x586d2f[_0x0a9e('0x91')]){if(_0x586d2f[_0x0a9e('0x130')]==='16'&&this[_0x0a9e('0x13')][_0x586d2f[_0x0a9e('0x84')]][_0x0a9e('0x4d')]){this[_0x0a9e('0x72')](_0x586d2f,_0x586d2f[_0x0a9e('0x84')],_0x586d2f[_0x0a9e('0x130')]);}else if(this[_0x0a9e('0x13')][_0x586d2f[_0x0a9e('0x84')]][_0x0a9e('0x4d')]){logger[_0x0a9e('0x26')](_0x0a9e('0x131'),_0x586d2f[_0x0a9e('0x84')],_0x586d2f[_0x0a9e('0x130')],_0x0a9e('0x9e'),_0x556bb7['name'],_0x0a9e('0x8a'),_0x556bb7[_0x0a9e('0x2e')]);this[_0x0a9e('0x72')](_0x586d2f,_0x586d2f[_0x0a9e('0x84')],_0x586d2f[_0x0a9e('0x130')]);}}else if(_0xf4de86&&_[_0x0a9e('0x41')](_0xf4de86['statedesc'])&&_0x556bb7[_0x0a9e('0x132')]&&_0x586d2f[_0x0a9e('0x84')]===_0x586d2f[_0x0a9e('0x91')]&&_[_0x0a9e('0x41')](_0x586d2f[_0x0a9e('0xd8')])&&_0x586d2f[_0x0a9e('0x130')]==='16'&&_0x586d2f[_0x0a9e('0x133')]==='6'&&_[_0x0a9e('0xd7')](_0xf4de86[_0x0a9e('0x134')])){if(_0xf4de86['unlockAgent']){rpcDb['unlockContact'](_0xf4de86[_0x0a9e('0x85')]);}if(_0xf4de86[_0x0a9e('0x83')]){rpcDb['disableContact'](_0xf4de86[_0x0a9e('0x85')]);}_0x586d2f[_0x0a9e('0xd8')]='22';this['callProgressDetectingAgent'](_0xf4de86,_0x556bb7,_0x586d2f);}else if(_0xf4de86&&_0xf4de86[_0x0a9e('0x134')]){if(_0x586d2f['cause']==='16'&&this[_0x0a9e('0x13')][_0x586d2f[_0x0a9e('0x84')]]['dialAnswer']){logger[_0x0a9e('0x26')](_0x0a9e('0x135'),_0x586d2f['linkedid'],_0x586d2f[_0x0a9e('0x130')],_0x0a9e('0x9e'),_0x556bb7['name'],_0x0a9e('0x8a'),_0x556bb7[_0x0a9e('0x2e')]);this[_0x0a9e('0x72')](_0x586d2f,_0x586d2f[_0x0a9e('0x84')],_0x586d2f[_0x0a9e('0x130')]);}else if(this[_0x0a9e('0x13')][_0x586d2f['linkedid']][_0x0a9e('0x4d')]){logger[_0x0a9e('0x26')]('[syncHangup][talking][cause]',_0x586d2f[_0x0a9e('0x84')],_0x586d2f[_0x0a9e('0x130')],_0x0a9e('0x9e'),_0x556bb7[_0x0a9e('0x29')],_0x0a9e('0x8a'),_0x556bb7[_0x0a9e('0x2e')]);this[_0x0a9e('0x72')](_0x586d2f,_0x586d2f['linkedid'],_0x586d2f['cause']);}}};Preview['prototype']['syncDialEnd']=function(_0x5e9817){if(this[_0x0a9e('0x13')][_0x5e9817[_0x0a9e('0xd4')]]&&_0x5e9817['destlinkedid']!==_0x5e9817['destuniqueid']){this[_0x0a9e('0x72')](_0x5e9817,_0x5e9817['destlinkedid'],_0x5e9817[_0x0a9e('0xcd')]);}};Preview[_0x0a9e('0xd')][_0x0a9e('0x136')]=function(_0x175c97){if(this[_0x0a9e('0x13')][_0x175c97[_0x0a9e('0x84')]]&&_0x175c97['linkedid']!==_0x175c97[_0x0a9e('0x91')]&&!this[_0x0a9e('0x13')][_0x175c97['linkedid']][_0x0a9e('0x4d')]){if(_0x175c97[_0x0a9e('0x130')]==='1'){this[_0x0a9e('0x72')](_0x175c97,_0x175c97[_0x0a9e('0x84')],_0x175c97[_0x0a9e('0x130')]);}}};Preview[_0x0a9e('0xd')][_0x0a9e('0x137')]=function(_0x4a36df,_0x331216,_0x508395){if(this[_0x0a9e('0x13')][_0x4a36df]){if(_[_0x0a9e('0x41')](this['actions'][_0x4a36df][_0x0a9e('0x122')])){this[_0x0a9e('0x13')][_0x4a36df]['variables']={};}this[_0x0a9e('0x13')][_0x4a36df]['variables'][_0x331216]=_0x508395;}};Preview[_0x0a9e('0xd')][_0x0a9e('0x1f')]=function(_0x5d0620){try{if(!_[_0x0a9e('0x41')](_0x5d0620)){if(ut['filterKey'](_[_0x0a9e('0x138')](_0x5d0620[_0x0a9e('0x139')])[0x0])){this[_0x0a9e('0x137')](_0x5d0620[_0x0a9e('0x91')],_[_0x0a9e('0x138')](_0x5d0620[_0x0a9e('0x139')])[0x0],_0x5d0620[_0x0a9e('0x13a')]);}}}catch(_0x53b5c2){logger[_0x0a9e('0x13b')](_0x0a9e('0x13c'),util[_0x0a9e('0x13d')](_0x53b5c2,{'showHidden':![],'depth':null}));}};Preview[_0x0a9e('0xd')][_0x0a9e('0x21')]=function(_0x5932ad){if(_0x5932ad){if(this[_0x0a9e('0x13')][_0x5932ad['transfertargetlinkedid']]){this['actions'][_0x5932ad[_0x0a9e('0x13e')]]['transfer']=!![];}}};Preview[_0x0a9e('0xd')][_0x0a9e('0x23')]=function(_0x58d5fd){if(_0x58d5fd){if(this[_0x0a9e('0x13')][_0x58d5fd[_0x0a9e('0x13f')]]){this[_0x0a9e('0x13')][_0x58d5fd[_0x0a9e('0x13f')]][_0x0a9e('0x134')]=!![];}}};module[_0x0a9e('0x140')]=Preview; \ No newline at end of file +var _0xa9e0=['varset','syncVarSet','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','loopCampaigns','emit','info','format','voice:queue:%s','name','voice_queue_channel:remove','voice_queue_presence:remove','sendMessageOneNotActive','originated','pTalking','available','CAMPAIGN_STATUS','INACTIVE','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20not\x20active','\x20is\x20deactivated','syncCampaigns','hasOwnProperty','dialMethod','booked','type','outbound','dialActive','setMessage','recallMe','clearZombieChannel','sequence','isNil','Queue','queue','originated:\x20','stringify','pick','UserId','VoiceQueueId','ListId','channel','message','No\x20such\x20channel','dialAnswer','decrementTalkink','[clearZombieChannel]','loggerError','[Dialer][checkChannel][pTalking][Preview]','[Dialer][checkChannel][Preview]','clearZombieChannels','size','getContactRecallMe','then','length','getDiff','scheduledat','Agent','voicePause','run','[RecallMe]','catch','logger2','disableContact','starttime','YYYY-MM-DD\x20HH:mm:ss','outboundReCallsDay','logCustomer','RecallInQueue','dialRecallInQueue','rescheduleContactInQueue','createBody','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','[getContactRecallMe]','IsNotLoggedIn','NO_AGENTS_LOGGED','isActive','isTrunkReachable','UNREACHABLE_TRUNK','callProgressDetectingCustomer','outboundNoSuchCallsDay','countnosuchnumberretry','countglobal','totalGlobal','NoSuchNumber','buildObj','nosuchnumber','[callProgressDetectingCustomer][logNoSuch]','verifyAdditionalPhones','additional','dialNoSuchNumberRetryFrequency','cloneAction','createCustomerFinal','[callProgressDetectingCustomer][logNoSuchGlobal]','rescheduleContact','scheduledAt','activeContact','linkedid','idContact','incrementPreviewCounters','ANSWER','answertime','[syncHangup][talking][increment]','pTalking:\x20','custom:agentconnect','connect','acw','mandatoryDisposition','custom:agentConnectPreview','channelAgent','uniqueid','custom:agentcomplete','complete','outboundAnswerCallsDay','answered','[16]','[callProgressDetectingCustomer][logAnswer]','[callProgressDetectingCustomer][logAnswerGlobal]','crateCustomerReportQueue','sumDuration','talktime','sumBillable','[syncHangup][talking][decrement]','\x20Queue','outboundBusyCallsDay','countbusyretry','Busy','dialBusyRetryFrequency','callAdditionalPhoneAfterMin','busy','[callProgressDetectingCustomer][logBusy]','dialGlobalMaxRetry','Global','[callProgressDetectingCustomer][logBusyGlobal]','dialBusyMaxRetry','unlockAgent','NOANSWER','countnoanswerretry','dialNoAnswerRetryFrequency','buildNoAnswerEventPayload','custom:agentnoanswer','dialNoAnswerMaxRetry','[callProgressDetectingCustomer][logNoAnswer]','outboundCongestionCallsDay','countcongestionretry','Congestion','custom:agentcongestion','congestion','[callProgressDetectingCustomer][logCongestionGlobal]','dialCongestionMaxRetry','[callProgressDetectingCustomer][logCongestion]','swapAdditionalPhones','CANCEL','outboundRejectCallsDay','countagentrejectretry','AgentReject','dialAgentRejectRetryFrequency','custom:agentreject','agentreject','[syncHangupRequest][logAgentReject]','[callProgressDetectingCustomer][logAgentReject]','countabandonedretry','Abandoned','[callProgressDetectingCustomer][logAbandoned]','dialAbandonedMaxRety','countmachineretry','cause-txt','custom:amd','[callProgressDetectingCustomer][hangupInAMD]','outboundUnknownCallsDay','dialstatus','[callProgressDetectingCustomer][machine]','[default]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','[callProgressDetectingCustomer][logUnknownGlobal]','updateOriginated','[originated][decrement][callProgressDetectingCustomer]','destlinkedid','callProgressDetectingAgent','object','isUndefined','reason','logAgent','[callProgressDetectingAgent][logNoSuch]','NoAnswer','createAgentHistory','[callProgressDetectingAgent][logNoAnswer]','[callProgressDetectingAgent][logBusy]','[callProgressDetectingAgent][logCongestion]','AnswerAGI','[callProgressDetectingAgent][logAnswerAGI]','[callProgressDetectingAgent]','[originated][decrement][callProgressDetectingAgent]','[verifyAdditionalPhone]\x20','[swapAdditionalPhone]\x20','resolve','checkInBlack','Contact','phone','Contact\x20is\x20undefined','lookAgent','isEmpty','execCall','[Preview][execCall][success]','custom:agentcalled','called','Calling','[Preview][execCall][failure]','Call\x20failed','logBlacklist','[Blacklist][error]','Contact\x20in\x20black\x20List','active','SIP/%s','status','reachable','unmonitored','execRun','unlock','unlockContact','recallme','validateContact','checkIsBlackList','[Preview][checkIsBlackList]','[Preview][getContactPreview]','Call\x20unsuccessful','[Preview][validateContact][Empty\x20Contact]','Empty\x20Contact','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','Trunk','[Preview][validateContact][Trunk\x20not\x20working\x20correctly]','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','TrunkBackup','\x20Trunk\x20Backup\x20is\x20not\x20active','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','dialPrefix','trim','dialCutDigit','substring','getCallerId','callerid','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','dialOriginateCallerIdNumber','originatecalleridname','extractCalleridName','originatecalleridnum','extractCalleridNumber','addVariables','merge','toLowerVariables','variables','variablesAction','Action','[originated][increment]','OriginateError','[originateFailure][logOriginateFailure]','actionid','logLookAgent','clone','responsetime','response','rejected','Answer','[callProgressDetectingAgent][logAnswer]','cause','[syncHangup][talking][cause]','dialQueueProject','channelstate','transfer','[syncHangup][talking][transfer]','syncHangupRequest','addVariable','keys','variable','value','error','[syncVarSet][Preview]','inspect','transfertargetlinkedid','transfererlinkedid','exports','util','lodash','uuid','../../../config/environment','preview','../../../config/logger','actionPreview','../ami','./rpcDb','./action','./util/util','../dialer/utils','redis','prototype','enqueue','tail','campaignsPreview','voiceQueues','trunks','actions','agents','clockClearZombieChannels','originateresponse','syncOriginateResponse','bind','hangup','syncHangup','hanguprequest','syncDialEnd','syncNewExten'];(function(_0x5c36c1,_0x24affe){var _0x39211c=function(_0x55d563){while(--_0x55d563){_0x5c36c1['push'](_0x5c36c1['shift']());}};_0x39211c(++_0x24affe);}(_0xa9e0,0x123));var _0x0a9e=function(_0x38a7ac,_0x45514b){_0x38a7ac=_0x38a7ac-0x0;var _0x53061a=_0xa9e0[_0x38a7ac];return _0x53061a;};'use strict';var util=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));var uuid=require(_0x0a9e('0x2'));var moment=require('moment');var Redis=require('ioredis');var config=require(_0x0a9e('0x3'));var logger=require('../../../config/logger')(_0x0a9e('0x4'));var loggerAction=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var ami=require(_0x0a9e('0x7'));var rpcDb=require(_0x0a9e('0x8'));var cmHopperAdditionalPhone=require('../rpc/cmHopperAdditionalPhone');var Action=require(_0x0a9e('0x9'));var ut=require(_0x0a9e('0xa'));var utils=require(_0x0a9e('0xb'));config['redis']=_['defaults'](config[_0x0a9e('0xc')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x0a9e('0xc')]));var Sequence=function(){};Sequence[_0x0a9e('0xd')][_0x0a9e('0xe')]=function(_0x3ab53f){this[_0x0a9e('0xf')]=this[_0x0a9e('0xf')]?this['tail']['finally'](_0x3ab53f):_0x3ab53f();};function Preview(_0x527cdd){this['sequence']=new Sequence();this[_0x0a9e('0x10')]=_0x527cdd[_0x0a9e('0x11')];this[_0x0a9e('0x12')]=_0x527cdd[_0x0a9e('0x12')];this[_0x0a9e('0x13')]={};this[_0x0a9e('0x14')]=_0x527cdd['agents'];this[_0x0a9e('0x15')]=0x0;ami['on'](_0x0a9e('0x16'),this[_0x0a9e('0x17')][_0x0a9e('0x18')](this));ami['on'](_0x0a9e('0x19'),this[_0x0a9e('0x1a')]['bind'](this));ami['on'](_0x0a9e('0x1b'),this['syncHangupRequest'][_0x0a9e('0x18')](this));ami['on']('dialend',this[_0x0a9e('0x1c')][_0x0a9e('0x18')](this));ami['on']('newexten',this[_0x0a9e('0x1d')]['bind'](this));ami['on'](_0x0a9e('0x1e'),this[_0x0a9e('0x1f')][_0x0a9e('0x18')](this));ami['on'](_0x0a9e('0x20'),this[_0x0a9e('0x21')][_0x0a9e('0x18')](this));ami['on'](_0x0a9e('0x22'),this[_0x0a9e('0x23')][_0x0a9e('0x18')](this));this[_0x0a9e('0x24')](this[_0x0a9e('0x10')]);}function emit(_0x105080,_0x4bb1e3,_0x2c3407){io['to'](_0x105080)[_0x0a9e('0x25')](_0x4bb1e3,_0x2c3407);}function emitVoiceQueueChannelRemove(_0x53682f){logger[_0x0a9e('0x26')]('[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event',JSON['stringify'](_0x53682f));emit(util[_0x0a9e('0x27')](_0x0a9e('0x28'),_0x53682f[_0x0a9e('0x29')]),_0x0a9e('0x2a'),_0x53682f);io['emit'](_0x0a9e('0x2b'),_0x53682f);}function notSendMessagesQueue(_0x2fb0e4){if(_0x2fb0e4[_0x0a9e('0x2c')]){if(_0x2fb0e4[_0x0a9e('0x2d')]===0x0&&_0x2fb0e4[_0x0a9e('0x2e')]===0x0){_0x2fb0e4[_0x0a9e('0x2c')]=![];_0x2fb0e4[_0x0a9e('0x2f')]=0x0;_0x2fb0e4['paused']=0x0;_0x2fb0e4['message']=utils[_0x0a9e('0x30')][_0x0a9e('0x31')];ut[_0x0a9e('0x32')](_0x0a9e('0x33'),_0x2fb0e4['name']+_0x0a9e('0x34'));}else{_0x2fb0e4['message']=utils[_0x0a9e('0x30')]['DEACTIVATED'];ut[_0x0a9e('0x32')](_0x0a9e('0x33'),_0x2fb0e4[_0x0a9e('0x29')]+_0x0a9e('0x35'));}}}Preview[_0x0a9e('0xd')][_0x0a9e('0x24')]=function(){var _0x11c3b6=this;setInterval(function(){_0x11c3b6[_0x0a9e('0x36')]();},0x7cf);};Preview['prototype'][_0x0a9e('0x36')]=function(){var _0x468813=this[_0x0a9e('0x10')];this[_0x0a9e('0x15')]+=0x1;for(var _0x5c877d in _0x468813){if(_0x468813[_0x0a9e('0x37')](_0x5c877d)&&(_0x468813[_0x5c877d][_0x0a9e('0x38')]===_0x0a9e('0x4')||_0x468813[_0x5c877d][_0x0a9e('0x38')]===_0x0a9e('0x39'))&&_0x468813[_0x5c877d][_0x0a9e('0x3a')]===_0x0a9e('0x3b')){if(this[_0x0a9e('0x15')]>0x7){this[_0x0a9e('0x15')]=0x0;this['clearZombieChannels']();}}if(_0x468813[_0x0a9e('0x37')](_0x5c877d)&&_0x468813[_0x5c877d]['dialMethod']===_0x0a9e('0x4')&&_0x468813[_0x5c877d][_0x0a9e('0x3a')]===_0x0a9e('0x3b')){if(_0x468813[_0x5c877d][_0x0a9e('0x3c')]){this[_0x0a9e('0x3d')](_0x468813[_0x5c877d]);if(_0x468813[_0x5c877d]['dialPreviewAutoRecallMe'])this[_0x0a9e('0x3e')](_0x468813[_0x5c877d]);}else{notSendMessagesQueue(_0x468813[_0x5c877d]);}}}};Preview[_0x0a9e('0xd')][_0x0a9e('0x3f')]=function(_0x2da5c0){var _0x2b45ea=this;this[_0x0a9e('0x40')][_0x0a9e('0xe')](function(){if(!_[_0x0a9e('0x41')](_0x2b45ea['actions'][_0x2da5c0])){loggerAction[_0x0a9e('0x26')]('[clearZombieChannels][talking]',_0x2da5c0,_0x0a9e('0x42'),_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x43')],_0x0a9e('0x44'),JSON['stringify'](_0x2b45ea[_0x0a9e('0x10')][_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x43')]][_0x0a9e('0x2d')]),'pTalking:\x20',JSON['stringify'](_0x2b45ea[_0x0a9e('0x10')][_0x2b45ea['actions'][_0x2da5c0][_0x0a9e('0x43')]][_0x0a9e('0x2e')]),JSON[_0x0a9e('0x45')](_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0]['dialAnswer']),JSON[_0x0a9e('0x45')](_[_0x0a9e('0x46')](_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0],['contactId',_0x0a9e('0x47'),_0x0a9e('0x48'),_0x0a9e('0x49')])));return ami['Action']({'action':'status','channel':_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x4a')]})['catch'](function(_0x2b814e){if(_0x2b814e[_0x0a9e('0x4b')]===_0x0a9e('0x4c')){setTimeout(function(){if(_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0]){ut['updateOriginated'](_0x2b45ea['campaignsPreview'][_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x43')]],'[clearZombieChannel]');if(_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x4d')]===!![]){ut[_0x0a9e('0x4e')](_0x2b45ea['campaignsPreview'][_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x43')]],_0x0a9e('0x4f'));ut[_0x0a9e('0x50')](_0x0a9e('0x51')+_0x2da5c0,_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x43')]);}ut[_0x0a9e('0x50')](_0x0a9e('0x52')+_0x2da5c0,_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x43')]);delete _0x2b45ea[_0x0a9e('0x13')][_0x2da5c0];}},0x2328);}});}});};Preview[_0x0a9e('0xd')][_0x0a9e('0x53')]=function(){var _0x37f6cc=this;loggerAction['info']('[action]',_[_0x0a9e('0x54')](this[_0x0a9e('0x13')]));for(var _0x405c8f in this[_0x0a9e('0x13')]){if(_0x37f6cc[_0x0a9e('0x13')][_0x0a9e('0x37')](_0x405c8f)){_0x37f6cc[_0x0a9e('0x3f')](_0x405c8f);}}};Preview[_0x0a9e('0xd')][_0x0a9e('0x3e')]=function(_0x25c6e6){var _0x2c2cb0=this;rpcDb[_0x0a9e('0x55')](_0x25c6e6['id'],ut['agentReadyId'](this[_0x0a9e('0x14')]))[_0x0a9e('0x56')](function(_0xdd268f){if(!_[_0x0a9e('0x41')](_0xdd268f)){for(var _0x2e8caf=0x0;_0x2e8caf<_0xdd268f[_0x0a9e('0x57')];_0x2e8caf+=0x1){if(ut[_0x0a9e('0x58')](_0xdd268f[_0x2e8caf][_0x0a9e('0x59')])<_0x25c6e6['dialRecallMeTimeout']*0x3c){if(_0xdd268f[_0x2e8caf][_0x0a9e('0x5a')]&&!_0xdd268f[_0x2e8caf]['Agent'][_0x0a9e('0x5b')]){_0x2c2cb0[_0x0a9e('0x5c')](_0xdd268f[_0x2e8caf]['id'])[_0x0a9e('0x56')](ut['logger2'](_0x0a9e('0x5d')))[_0x0a9e('0x5e')](ut[_0x0a9e('0x5f')](_0x0a9e('0x5d')));}else{rpcDb[_0x0a9e('0x60')](_0xdd268f[_0x2e8caf]['id']);}}else{var _0x37be73=new Action(_0xdd268f[_0x2e8caf],_0x25c6e6);_0x37be73[_0x0a9e('0x61')]=moment()['format'](_0x0a9e('0x62'));_0x25c6e6[_0x0a9e('0x63')]+=0x1;ut[_0x0a9e('0x64')](_0x37be73,0x17,_0x0a9e('0x65'));if(_0x25c6e6[_0x0a9e('0x66')]){rpcDb[_0x0a9e('0x67')](ut[_0x0a9e('0x68')](_0xdd268f[_0x2e8caf]));rpcDb[_0x0a9e('0x69')](_0x37be73,_0x0a9e('0x6a'));}else{ut['logCustomer'](_0x37be73,0x16,_0x0a9e('0x6b'));rpcDb[_0x0a9e('0x69')](_0x37be73,'[HistoryRecallClose]');rpcDb['createCustomerFinal'](_0x37be73,'[HistoryRecallClose]');}}}}})[_0x0a9e('0x5e')](ut[_0x0a9e('0x5f')](_0x0a9e('0x6c')));};Preview[_0x0a9e('0xd')][_0x0a9e('0x3d')]=function(_0x30decb){_0x30decb[_0x0a9e('0x2c')]=!![];if(ut[_0x0a9e('0x6d')](_0x30decb['loggedIn'])){_0x30decb['message']=utils['CAMPAIGN_STATUS'][_0x0a9e('0x6e')];}else if(!ut[_0x0a9e('0x6f')](_0x30decb[_0x0a9e('0x3c')])){_0x30decb['message']=utils[_0x0a9e('0x30')][_0x0a9e('0x31')];}else if(!this['isTrunkReachable'](_0x30decb['Trunk'])){if(!this[_0x0a9e('0x70')](_0x30decb['TrunkBackup'])){_0x30decb[_0x0a9e('0x4b')]=utils['CAMPAIGN_STATUS'][_0x0a9e('0x71')];}else{_0x30decb[_0x0a9e('0x4b')]=utils[_0x0a9e('0x30')]['ACTIVE'];}}else{_0x30decb[_0x0a9e('0x4b')]=utils[_0x0a9e('0x30')]['ACTIVE'];}};Preview['prototype'][_0x0a9e('0x72')]=function(_0x3aedd0,_0x49c095,_0x145931){var _0x5ce9ac=this;var _0x211ef9=this['actions'][_0x49c095];var _0xe22ccc=this['campaignsPreview'][_0x211ef9['queue']];var _0x5df0ad;var _0x2da03c=![];var _0x47de4c=0x2;var _0x2f7092=0x3;if(_0xe22ccc){switch(_0x145931){case'1':_0xe22ccc[_0x0a9e('0x73')]+=0x1;_0x211ef9[_0x0a9e('0x74')]+=0x1;_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut[_0x0a9e('0x64')](_0x211ef9,0x0,_0x0a9e('0x77'));ami[_0x0a9e('0x25')]('custom:agentnosuchnumber',ut[_0x0a9e('0x78')](_0x211ef9,_0x0a9e('0x79')));rpcDb[_0x0a9e('0x69')](_0x211ef9,_0x0a9e('0x7a'));_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'0',_0xe22ccc)[_0x0a9e('0x56')](function(_0x5d86e9){_0x2da03c=_0x5d86e9[_0x0a9e('0x7c')]==0x1;_0x47de4c=_0xe22ccc[_0x0a9e('0x7d')];_0x2f7092=_0xe22ccc['callAdditionalPhoneAfterMin'];if(!_0x2da03c){if(ut[_0x0a9e('0x76')](_0x211ef9)>=_0xe22ccc['dialGlobalMaxRetry']){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,'Global');rpcDb['createCustomerFinal'](_0x5df0ad,'[callProgressDetectingCustomer][logNoSuchGlobal]');}else{if(_0x211ef9[_0x0a9e('0x74')]>=_0xe22ccc['dialNoSuchNumberMaxRetry']){rpcDb[_0x0a9e('0x7f')](_0x211ef9,_0x0a9e('0x80'));}else{rpcDb[_0x0a9e('0x81')](ut[_0x0a9e('0x82')](_0x211ef9,_0x0a9e('0x74'),_0xe22ccc[_0x0a9e('0x7d')]),_0x211ef9['unlockAgent'],_0x211ef9[_0x0a9e('0x83')]);}}delete this['actions'][_0x3aedd0[_0x0a9e('0x84')]];}else{_0x211ef9[_0x0a9e('0x74')]++;logger[_0x0a9e('0x26')]('actioncountonusuch',_0x211ef9[_0x0a9e('0x74')]);logger[_0x0a9e('0x26')]('id',_0x211ef9[_0x0a9e('0x85')]);_0x5ce9ac[_0x0a9e('0x86')]({'id':_0x211ef9['idContact'],'field':{'countnosuchnumberretry':_0x211ef9[_0x0a9e('0x74')]}})[_0x0a9e('0x56')](function(){_0x5ce9ac['swapAdditionalPhones'](_0x211ef9,_0x47de4c,_0x2f7092)[_0x0a9e('0x56')](function(){});});}});break;case _0x0a9e('0x87'):var _0x88dcbf=moment()[_0x0a9e('0x27')](_0x0a9e('0x62'));_0x211ef9['responsetime']=_0x88dcbf;_0x211ef9[_0x0a9e('0x88')]=_0x88dcbf;_0x211ef9[_0x0a9e('0x4d')]=!![];_0xe22ccc[_0x0a9e('0x2e')]+=0x1;logger['info'](_0x0a9e('0x89'),_0x211ef9['uniqueid'],'\x20Queue',_0xe22ccc[_0x0a9e('0x29')],_0x0a9e('0x8a'),_0xe22ccc[_0x0a9e('0x2e')]);ami[_0x0a9e('0x25')](_0x0a9e('0x8b'),ut[_0x0a9e('0x78')](_0x211ef9,_0x0a9e('0x8c'),this[_0x0a9e('0x10')][_0x211ef9[_0x0a9e('0x43')]]));if(_0xe22ccc[_0x0a9e('0x8d')]||_0xe22ccc[_0x0a9e('0x8e')]){ami[_0x0a9e('0x25')](_0x0a9e('0x8f'),{'queue':_0x211ef9[_0x0a9e('0x43')],'interface':_0x211ef9[_0x0a9e('0x90')],'uniqueid':_0x211ef9[_0x0a9e('0x91')]});}break;case'16':ami[_0x0a9e('0x25')](_0x0a9e('0x92'),ut['buildObj'](_0x211ef9,_0x0a9e('0x93'),this[_0x0a9e('0x10')][_0x211ef9[_0x0a9e('0x43')]]));emitVoiceQueueChannelRemove(ut['buildObj'](_0x211ef9,_0x0a9e('0x93')));_0xe22ccc[_0x0a9e('0x94')]+=0x1;_0xe22ccc['total']+=0x1;_0xe22ccc[_0x0a9e('0x95')]+=0x1;ut[_0x0a9e('0x4e')](_0xe22ccc,_0x0a9e('0x96'));_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut['logCustomer'](_0x211ef9,0x4,'Answer');rpcDb['createCustomerHistory'](_0x211ef9,_0x0a9e('0x97'));rpcDb[_0x0a9e('0x7f')](_0x211ef9,_0x0a9e('0x98'));rpcDb[_0x0a9e('0x99')](_0x211ef9);_0xe22ccc[_0x0a9e('0x9a')]+=_0x211ef9[_0x0a9e('0x9b')];_0xe22ccc[_0x0a9e('0x9c')]+=_0x211ef9[_0x0a9e('0x9b')];logger['info'](_0x0a9e('0x9d'),_0x211ef9[_0x0a9e('0x91')],_0x0a9e('0x9e'),_0xe22ccc['name'],_0x0a9e('0x8a'),_0xe22ccc['pTalking']);delete this[_0x0a9e('0x13')][_0x3aedd0[_0x0a9e('0x84')]];break;case'BUSY':_0xe22ccc[_0x0a9e('0x9f')]+=0x1;_0x211ef9[_0x0a9e('0xa0')]+=0x1;_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut['logCustomer'](_0x211ef9,0x5,_0x0a9e('0xa1'));_0x47de4c=_0xe22ccc[_0x0a9e('0xa2')];_0x2f7092=_0xe22ccc[_0x0a9e('0xa3')];ami[_0x0a9e('0x25')]('custom:agentbusy',ut[_0x0a9e('0x78')](_0x211ef9,_0x0a9e('0xa4')));rpcDb[_0x0a9e('0x69')](_0x211ef9,_0x0a9e('0xa5'));_0x5ce9ac['verifyAdditionalPhones'](_0x211ef9,'5',_0xe22ccc)[_0x0a9e('0x56')](function(_0x3511c9){_0x2da03c=_0x3511c9[_0x0a9e('0x7c')]==0x1;if(!_0x2da03c){if(ut[_0x0a9e('0x76')](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,_0x0a9e('0xa7'));rpcDb[_0x0a9e('0x7f')](_0x5df0ad,_0x0a9e('0xa8'));}else{if(_0x211ef9[_0x0a9e('0xa0')]>=_0xe22ccc[_0x0a9e('0xa9')]){rpcDb[_0x0a9e('0x7f')](_0x211ef9,_0x0a9e('0xa5'));}else{rpcDb[_0x0a9e('0x81')](ut['scheduledAt'](_0x211ef9,_0x0a9e('0xa0'),_0xe22ccc[_0x0a9e('0xa2')]),_0x211ef9[_0x0a9e('0xaa')],_0x211ef9['activeContact']);}}}else{_0x211ef9[_0x0a9e('0xa0')]++;_0x5ce9ac[_0x0a9e('0x86')]({'id':_0x211ef9[_0x0a9e('0x85')],'field':{'countbusyretry':_0x211ef9[_0x0a9e('0xa0')]}})['then'](function(){_0x5ce9ac['swapAdditionalPhones'](_0x211ef9,_0x47de4c,_0x2f7092)[_0x0a9e('0x56')](function(){});});}});break;case _0x0a9e('0xab'):_0xe22ccc['outboundNoAnswerCallsDay']+=0x1;_0x211ef9[_0x0a9e('0xac')]+=0x1;_0x211ef9['countglobal']=ut[_0x0a9e('0x76')](_0x211ef9);ut[_0x0a9e('0x64')](_0x211ef9,0x3,'NoAnswer');_0x47de4c=_0xe22ccc[_0x0a9e('0xad')];_0x2f7092=_0xe22ccc[_0x0a9e('0xa3')];var _0x2d2286=ut[_0x0a9e('0xae')](_0x211ef9,_0xe22ccc);ami[_0x0a9e('0x25')](_0x0a9e('0xaf'),_0x2d2286);rpcDb[_0x0a9e('0x69')](_0x211ef9,'[callProgressDetectingCustomer][logNoAnswer]');_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'3',_0xe22ccc)[_0x0a9e('0x56')](function(_0x45c109){_0x2da03c=_0x45c109[_0x0a9e('0x7c')]==0x1;if(!_0x2da03c){if(ut['totalGlobal'](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,'Global');rpcDb[_0x0a9e('0x7f')](_0x5df0ad,'[callProgressDetectingCustomer][logNoAnswerGlobal]');}else{if(_0x211ef9[_0x0a9e('0xac')]>=_0xe22ccc[_0x0a9e('0xb0')]){rpcDb[_0x0a9e('0x7f')](_0x211ef9,_0x0a9e('0xb1'));}else{rpcDb['rescheduleContact'](ut['scheduledAt'](_0x211ef9,_0x0a9e('0xac'),_0xe22ccc[_0x0a9e('0xad')]),_0x211ef9[_0x0a9e('0xaa')],_0x211ef9['activeContact']);}}}else{_0x211ef9[_0x0a9e('0xac')]++;_0x5ce9ac[_0x0a9e('0x86')]({'id':_0x211ef9['idContact'],'field':{'countnoanswerretry':_0x211ef9['countnoanswerretry']}})[_0x0a9e('0x56')](function(){_0x5ce9ac['swapAdditionalPhones'](_0x211ef9,_0x47de4c,_0x2f7092)['then'](function(){});});}});break;case'CONGESTION':_0xe22ccc[_0x0a9e('0xb2')]+=0x1;_0x211ef9[_0x0a9e('0xb3')]+=0x1;_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut[_0x0a9e('0x64')](_0x211ef9,0x8,_0x0a9e('0xb4'));_0x47de4c=_0xe22ccc['dialCongestionRetryFrequency'];_0x2f7092=_0xe22ccc[_0x0a9e('0xa3')];ami['emit'](_0x0a9e('0xb5'),ut[_0x0a9e('0x78')](_0x211ef9,_0x0a9e('0xb6')));rpcDb[_0x0a9e('0x69')](_0x211ef9,'[callProgressDetectingCustomer][logCongestion]');_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'8',_0xe22ccc)[_0x0a9e('0x56')](function(_0x1d4877){_0x2da03c=_0x1d4877['additional']==0x1;if(!_0x2da03c){if(ut[_0x0a9e('0x76')](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,_0x0a9e('0xa7'));rpcDb[_0x0a9e('0x7f')](_0x5df0ad,_0x0a9e('0xb7'));}else{if(_0x211ef9[_0x0a9e('0xb3')]>=_0xe22ccc[_0x0a9e('0xb8')]){rpcDb['createCustomerFinal'](_0x211ef9,_0x0a9e('0xb9'));}else{rpcDb[_0x0a9e('0x81')](ut['scheduledAt'](_0x211ef9,_0x0a9e('0xb3'),_0xe22ccc[_0x0a9e('0xa2')]),_0x211ef9[_0x0a9e('0xaa')],_0x211ef9['activeContact']);}}}else{_0x211ef9[_0x0a9e('0xb3')]++;_0x5ce9ac['incrementPreviewCounters']({'id':_0x211ef9[_0x0a9e('0x85')],'field':{'countcongestionretry':_0x211ef9[_0x0a9e('0xb3')]}})[_0x0a9e('0x56')](function(){_0x5ce9ac[_0x0a9e('0xba')](_0x211ef9,_0x47de4c,_0x2f7092)[_0x0a9e('0x56')](function(){});});}});break;case _0x0a9e('0xbb'):_0xe22ccc[_0x0a9e('0xbc')]+=0x1;_0x211ef9[_0x0a9e('0xbd')]+=0x1;_0x211ef9['countglobal']=ut[_0x0a9e('0x76')](_0x211ef9);ut[_0x0a9e('0x64')](_0x211ef9,0x14,_0x0a9e('0xbe'));_0x47de4c=_0xe22ccc[_0x0a9e('0xbf')];_0x2f7092=_0xe22ccc[_0x0a9e('0xa3')];ami[_0x0a9e('0x25')](_0x0a9e('0xc0'),ut[_0x0a9e('0x78')](_0x211ef9,_0x0a9e('0xc1')));rpcDb[_0x0a9e('0x69')](_0x211ef9,_0x0a9e('0xc2'));_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'20',_0xe22ccc)[_0x0a9e('0x56')](function(_0x4989f9){_0x2da03c=_0x4989f9[_0x0a9e('0x7c')]==0x1;if(!_0x2da03c){if(ut[_0x0a9e('0x76')](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0x14,_0x0a9e('0xbe'));rpcDb['createCustomerFinal'](_0x5df0ad,_0x0a9e('0xc3'));}else{if(_0x211ef9[_0x0a9e('0xbd')]>=_0xe22ccc['dialAgentRejectMaxRetry']){rpcDb[_0x0a9e('0x7f')](_0x211ef9,'[callProgressDetectingCustomer][logAgentReject]');}else{rpcDb[_0x0a9e('0x81')](ut[_0x0a9e('0x82')](_0x211ef9,_0x0a9e('0xbd'),_0xe22ccc[_0x0a9e('0xbf')]),_0x211ef9['unlockAgent'],_0x211ef9[_0x0a9e('0x83')]);}}}else{_0x211ef9['countnoanswerretry']++;_0x5ce9ac[_0x0a9e('0x86')]({'id':_0x211ef9[_0x0a9e('0x85')],'field':{'countnoanswerretry':_0x211ef9['countnoanswerretry']}})[_0x0a9e('0x56')](function(){_0x5ce9ac[_0x0a9e('0xba')](_0x211ef9,_0x47de4c,_0x2f7092)[_0x0a9e('0x56')](function(){});});}});break;case'ABANDONED':_0xe22ccc['outboundAbandonedCallsDay']+=0x1;_0x211ef9[_0x0a9e('0xc4')]+=0x1;_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut[_0x0a9e('0x64')](_0x211ef9,0xb,_0x0a9e('0xc5'));rpcDb[_0x0a9e('0x69')](_0x211ef9,_0x0a9e('0xc6'));_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'11',_0xe22ccc)[_0x0a9e('0x56')](function(_0x586510){_0x2da03c=_0x586510[_0x0a9e('0x7c')]==0x1;if(!_0x2da03c){if(ut['totalGlobal'](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,_0x0a9e('0xa7'));rpcDb[_0x0a9e('0x7f')](_0x5df0ad,_0x0a9e('0xc6'));}else{if(_0x211ef9['countabandonedetry']>=_0xe22ccc[_0x0a9e('0xc7')]){rpcDb[_0x0a9e('0x7f')](_0x211ef9,_0x0a9e('0xc6'));}else{rpcDb[_0x0a9e('0x81')](ut[_0x0a9e('0x82')](_0x211ef9,'countabandonedretry',_0xe22ccc['dialAbandonedRetryFrequency']),_0x211ef9[_0x0a9e('0xaa')],_0x211ef9['activeContact']);}}}else{_0x211ef9[_0x0a9e('0xac')]++;_0x5ce9ac[_0x0a9e('0x86')]({'id':_0x211ef9[_0x0a9e('0x85')],'field':{'countnoanswerretry':_0x211ef9[_0x0a9e('0xac')]}})[_0x0a9e('0x56')](function(){_0x5ce9ac[_0x0a9e('0xba')](_0x211ef9,_0x47de4c,_0x2f7092)['then'](function(){});});}});break;case'18':_0xe22ccc['outboundUnknownCallsDay']+=0x1;_0x211ef9[_0x0a9e('0xc8')]+=0x1;_0x211ef9['countglobal']=ut[_0x0a9e('0x76')](_0x211ef9);ut['logCustomer'](_0x211ef9,0x12,_0x3aedd0[_0x0a9e('0xc9')]||_0x3aedd0['dialstatus']);ami['emit'](_0x0a9e('0xca'),ut[_0x0a9e('0x78')](_0x211ef9,'amd'));rpcDb[_0x0a9e('0x69')](_0x211ef9,_0x0a9e('0xcb'));_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'18',_0xe22ccc)[_0x0a9e('0x56')](function(_0x2eb028){_0x2da03c=_0x2eb028['additional']==0x1;if(!_0x2da03c){if(ut['totalGlobal'](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0x12,_0x0a9e('0xa7'));rpcDb[_0x0a9e('0x7f')](_0x5df0ad,_0x0a9e('0xcb'));}else{rpcDb['createCustomerFinal'](_0x211ef9,_0x0a9e('0xcb'));}}else{_0x211ef9[_0x0a9e('0xac')]++;_0x5ce9ac['incrementPreviewCounters']({'id':_0x211ef9[_0x0a9e('0x85')],'field':{'countnoanswerretry':_0x211ef9[_0x0a9e('0xac')]}})[_0x0a9e('0x56')](function(){_0x5ce9ac[_0x0a9e('0xba')](_0x211ef9,_0x47de4c,_0x2f7092)[_0x0a9e('0x56')](function(){});});}});delete this[_0x0a9e('0x13')][_0x3aedd0[_0x0a9e('0x84')]];break;case'19':_0xe22ccc[_0x0a9e('0xcc')]+=0x1;_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut['logCustomer'](_0x211ef9,0x13,_0x3aedd0[_0x0a9e('0xc9')]||_0x3aedd0[_0x0a9e('0xcd')]);ami[_0x0a9e('0x25')](_0x0a9e('0xca'),ut[_0x0a9e('0x78')](_0x211ef9,'amd'));rpcDb['createCustomerHistory'](_0x211ef9,_0x0a9e('0xce'));_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'18',_0xe22ccc)[_0x0a9e('0x56')](function(_0x2fea95){_0x2da03c=_0x2fea95[_0x0a9e('0x7c')]==0x1;if(!_0x2da03c){if(ut['totalGlobal'](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,_0x0a9e('0xa7'));rpcDb['createCustomerFinal'](_0x5df0ad,_0x0a9e('0xce'));}else{rpcDb['createCustomerFinal'](_0x211ef9,_0x0a9e('0xce'));}}else{_0x211ef9['countnoanswerretry']++;_0x5ce9ac[_0x0a9e('0x86')]({'id':_0x211ef9[_0x0a9e('0x85')],'field':{'countnoanswerretry':_0x211ef9[_0x0a9e('0xac')]}})['then'](function(){_0x5ce9ac[_0x0a9e('0xba')](_0x211ef9,_0x47de4c,_0x2f7092)['then'](function(){});});}});delete this[_0x0a9e('0x13')][_0x3aedd0[_0x0a9e('0x84')]];break;default:if(_0x211ef9[_0x0a9e('0x4d')]){ut[_0x0a9e('0x4e')](_0xe22ccc,_0x0a9e('0xcf'));ut[_0x0a9e('0x50')](_0x0a9e('0xd0')+_0xe22ccc[_0x0a9e('0x29')],_0x3aedd0);}_0xe22ccc[_0x0a9e('0xcc')]+=0x1;_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut[_0x0a9e('0x64')](_0x211ef9,0xc,_0x3aedd0[_0x0a9e('0xc9')]||_0x3aedd0[_0x0a9e('0xcd')]);_0x47de4c=_0xe22ccc[_0x0a9e('0xbf')];_0x2f7092=_0xe22ccc[_0x0a9e('0xa3')];rpcDb['createCustomerHistory'](_0x211ef9,'[callProgressDetectingCustomer][logUnknown]');_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'20',_0xe22ccc)['then'](function(_0x1d999b){_0x2da03c=_0x1d999b[_0x0a9e('0x7c')]==0x1;if(!_0x2da03c){if(ut['totalGlobal'](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,_0x0a9e('0xa7'));rpcDb[_0x0a9e('0x7f')](_0x5df0ad,'[callProgressDetectingCustomer][logUnknownGlobal]');}else{rpcDb[_0x0a9e('0x7f')](_0x211ef9,_0x0a9e('0xd1'));}delete this[_0x0a9e('0x13')][_0x3aedd0[_0x0a9e('0x84')]];}else{_0x5ce9ac['swapAdditionalPhones'](_0x211ef9,_0x47de4c,_0x2f7092)[_0x0a9e('0x56')](function(){});}});}if(!(_0x211ef9[_0x0a9e('0x4d')]&&_0x145931==='16')){ut[_0x0a9e('0xd2')](_0xe22ccc,'[callProgressDetectingCustomer]');logger[_0x0a9e('0x26')](_0x0a9e('0xd3'),_0x211ef9[_0x0a9e('0x91')],'\x20Queue',_0xe22ccc[_0x0a9e('0x29')],_0x0a9e('0x44'),_0xe22ccc[_0x0a9e('0x2d')]);}if(_0x145931!==_0x0a9e('0x87')){delete this[_0x0a9e('0x13')][_0x3aedd0['linkedid']];delete this[_0x0a9e('0x13')][_0x3aedd0[_0x0a9e('0xd4')]];}_0xe22ccc['queueSummaryCountersUpdated']=!![];}};Preview[_0x0a9e('0xd')][_0x0a9e('0xd5')]=function(_0x1f6f1c,_0x5822a7,_0x5c3b6f){if(_['isUndefined'](_0x5822a7)&&_0x0a9e('0xd6')!==typeof _0x5822a7){return;}if(_[_0x0a9e('0xd7')](_0x5c3b6f)&&'object'!==typeof _0x5c3b6f){return;}switch(_0x5c3b6f[_0x0a9e('0xd8')]){case'0':ut[_0x0a9e('0xd9')](_0x1f6f1c,0x0,_0x0a9e('0x77'));rpcDb['createAgentHistory'](_0x1f6f1c,_0x0a9e('0xda'));break;case'3':ut[_0x0a9e('0xd9')](_0x1f6f1c,0x3,_0x0a9e('0xdb'));rpcDb[_0x0a9e('0xdc')](_0x1f6f1c,_0x0a9e('0xdd'));break;case'5':ut[_0x0a9e('0xd9')](_0x1f6f1c,0x5,_0x0a9e('0xa1'));rpcDb[_0x0a9e('0xdc')](_0x1f6f1c,_0x0a9e('0xde'));break;case'8':ut['logAgent'](_0x1f6f1c,0x8,_0x0a9e('0xb4'));rpcDb['createAgentHistory'](_0x1f6f1c,_0x0a9e('0xdf'));break;case'22':ut[_0x0a9e('0xd9')](_0x1f6f1c,0x16,_0x0a9e('0xe0'));rpcDb[_0x0a9e('0xdc')](_0x1f6f1c,_0x0a9e('0xe1'));break;default:ut[_0x0a9e('0xd9')](_0x1f6f1c,0xc,_0x5c3b6f['reason']);rpcDb[_0x0a9e('0xdc')](_0x1f6f1c,_0x0a9e('0xdf'));}ut[_0x0a9e('0xd2')](_0x5822a7,_0x0a9e('0xe2'));logger['info'](_0x0a9e('0xe3'),_0x1f6f1c[_0x0a9e('0x91')],_0x0a9e('0x9e'),_0x5822a7[_0x0a9e('0x29')],_0x0a9e('0x44'),_0x5822a7[_0x0a9e('0x2d')]);delete this[_0x0a9e('0x13')][_0x1f6f1c[_0x0a9e('0x91')]];};Preview[_0x0a9e('0xd')][_0x0a9e('0x7b')]=function(_0x57f0ad,_0x2272bc,_0x88b25f){return cmHopperAdditionalPhone[_0x0a9e('0x7b')](_0x57f0ad,_0x2272bc,_0x88b25f)[_0x0a9e('0x5e')](logger[_0x0a9e('0x26')](_0x0a9e('0xe4')));};Preview[_0x0a9e('0xd')][_0x0a9e('0xba')]=function(_0x566b90,_0x3b581c,_0xd2391){return cmHopperAdditionalPhone[_0x0a9e('0xba')](_0x566b90,_0x3b581c,_0xd2391)['catch'](logger[_0x0a9e('0x26')](_0x0a9e('0xe5')));};Preview[_0x0a9e('0xd')][_0x0a9e('0x86')]=function(_0x370b5e){return Promise[_0x0a9e('0xe6')]()[_0x0a9e('0x56')](cmHopperAdditionalPhone[_0x0a9e('0x86')](_0x370b5e))[_0x0a9e('0x5e')](logger[_0x0a9e('0x26')]('[incrementPreviewCounters]\x20'));};Preview[_0x0a9e('0xd')][_0x0a9e('0xe7')]=function(_0x15a9ed,_0x3db98f,_0x2b624e,_0x3942fd,_0x5cb48d){var _0x382687=this;return new Promise(function(_0x4f854b,_0x5bd139){if(_['isNil'](_0x3db98f)||_[_0x0a9e('0x41')](_0x3db98f[_0x0a9e('0xe8')])||_[_0x0a9e('0x41')](_0x3db98f[_0x0a9e('0xe9')])||_['isNil'](_0x3db98f[_0x0a9e('0x48')])){_0x5bd139(ut[_0x0a9e('0x4b')](_0x0a9e('0xea'),_0x3942fd,_0x5cb48d));return;}var _0x1fdb10=uuid['v4']();var _0x2c8d1d=_0x382687['campaignsPreview'][_0x3db98f['Queue'][_0x0a9e('0x29')]];var _0x33bcb2=_0x2b624e?_0x382687[_0x0a9e('0x14')][_0x2b624e]['id']:undefined;_0x382687['actions'][_0x1fdb10]=new Action(_0x3db98f,_0x2c8d1d,_0x1fdb10,_0x2b624e,_0x33bcb2);var _0x319752=_0x382687[_0x0a9e('0x13')][_0x1fdb10];_0x319752[_0x0a9e('0xaa')]=_0x3942fd;_0x319752['activeContact']=_0x5cb48d;_0x319752[_0x0a9e('0xeb')]=_0x2b624e;if(_[_0x0a9e('0xec')](_0x15a9ed)){_0x382687[_0x0a9e('0xed')](_0x319752,_0x2c8d1d,_0x3db98f,_0x2b624e)['then'](function(_0x272291){logger[_0x0a9e('0x26')](_0x0a9e('0xee'),'Queue:\x20'+_0x319752['queue']+'\x20IdHopper:\x20'+_0x319752[_0x0a9e('0x85')],JSON[_0x0a9e('0x45')](_0x272291));ami[_0x0a9e('0x25')](_0x0a9e('0xef'),ut['buildObj'](_0x319752,_0x0a9e('0xf0'),_0x382687['campaignsPreview'][_0x319752[_0x0a9e('0x43')]]));_0x4f854b(ut[_0x0a9e('0x4b')](_0x0a9e('0xf1')));})['catch'](function(_0x33b4b3){ut[_0x0a9e('0x32')](_0x0a9e('0xf2'),_0x33b4b3);_0x5bd139(ut['message'](_0x0a9e('0xf3'),_0x3942fd,_0x5cb48d));});}else{_0x2c8d1d['outboundBlacklistCallsDay']+=0x1;ut[_0x0a9e('0xf4')](_0x319752);rpcDb['createHistory'](_0x319752,_0x0a9e('0xf5'));delete _0x382687['actions'][_0x1fdb10];_0x5bd139(ut[_0x0a9e('0x4b')](_0x0a9e('0xf6'),_0x3942fd,_0x5cb48d));}});};Preview[_0x0a9e('0xd')][_0x0a9e('0x70')]=function(_0x1e306c){return!_[_0x0a9e('0x41')](_0x1e306c)&&!_[_0x0a9e('0x41')](_0x1e306c['name'])&&!_[_0x0a9e('0x41')](_0x1e306c[_0x0a9e('0xf7')])&&_0x1e306c['active']&&!_[_0x0a9e('0x41')](this[_0x0a9e('0x12')][util['format'](_0x0a9e('0xf8'),_0x1e306c[_0x0a9e('0x29')])])&&!_[_0x0a9e('0x41')](this['trunks'][util[_0x0a9e('0x27')](_0x0a9e('0xf8'),_0x1e306c[_0x0a9e('0x29')])][_0x0a9e('0xf9')])&&(this[_0x0a9e('0x12')][util[_0x0a9e('0x27')](_0x0a9e('0xf8'),_0x1e306c[_0x0a9e('0x29')])][_0x0a9e('0xf9')]===_0x0a9e('0xfa')||this['trunks'][util[_0x0a9e('0x27')]('SIP/%s',_0x1e306c[_0x0a9e('0x29')])][_0x0a9e('0xf9')]===_0x0a9e('0xfb'));};Preview[_0x0a9e('0xd')][_0x0a9e('0x5c')]=function(_0x2d45db,_0x5691ac){return this[_0x0a9e('0xfc')](_0x2d45db,_0x5691ac)[_0x0a9e('0x56')](function(_0x2977a7){return _['pick'](_0x2977a7,[_0x0a9e('0x4b')]);})[_0x0a9e('0x5e')](function(_0x4435d2){if(_0x4435d2[_0x0a9e('0xfd')]){rpcDb[_0x0a9e('0xfe')](_0x2d45db);}if(_0x4435d2[_0x0a9e('0xf7')]){rpcDb[_0x0a9e('0x60')](_0x2d45db);}throw _['pick'](_0x4435d2,[_0x0a9e('0x4b')]);});};Preview[_0x0a9e('0xd')][_0x0a9e('0xfc')]=function(_0x2ce3be,_0x3de77e){var _0x241404=this;var _0x8120e,_0x5d6a48;return rpcDb['getContactPreview'](_0x2ce3be)[_0x0a9e('0x56')](function(_0x3f507c){if(!_[_0x0a9e('0x41')](_0x3f507c[0x0])){_0x5d6a48=_0x3f507c[0x0][_0x0a9e('0xff')]?![]:!![];_0x8120e=_0x3f507c[0x0][_0x0a9e('0xff')]?!![]:![];_0x8120e=_0x3de77e?!![]:_0x8120e;}var _0x131da8=_0x241404[_0x0a9e('0x100')](_0x3f507c);if(_0x131da8['isValid']){rpcDb[_0x0a9e('0x101')](_[_0x0a9e('0x46')](_0x3f507c[0x0],[_0x0a9e('0x48'),_0x0a9e('0xe9')]))[_0x0a9e('0x56')](function(_0x3c6082){_0x241404[_0x0a9e('0xe7')](_0x3c6082,_0x3f507c[0x0],_0x3de77e,_0x5d6a48,_0x8120e)['then'](function(_0x311288){return _0x311288;})[_0x0a9e('0x5e')](function(_0x231826){throw _0x231826;});})['catch'](function(_0x2b8ad4){ut[_0x0a9e('0x32')](_0x0a9e('0x102'),_0x2b8ad4);throw ut[_0x0a9e('0x4b')]('Call\x20unsuccessful',_0x5d6a48,_0x8120e);});}else{throw ut[_0x0a9e('0x4b')](_0x131da8[_0x0a9e('0x4b')],_0x5d6a48,_0x8120e);}})[_0x0a9e('0x5e')](function(_0x93d953){ut[_0x0a9e('0x32')](_0x0a9e('0x103'),_0x93d953);throw ut[_0x0a9e('0x4b')](_0x0a9e('0x104'),![],!![]);});};Preview['prototype'][_0x0a9e('0x100')]=function(_0x266aa1){if(_[_0x0a9e('0x41')](_0x266aa1)||_[_0x0a9e('0xec')](_0x266aa1)||!_['isNil'](_0x266aa1[0x0]['Agent'])&&_[_0x0a9e('0x41')](_0x266aa1[0x0][_0x0a9e('0x5a')][_0x0a9e('0x29')])){ut['logger'](_0x0a9e('0x105'),_0x266aa1);return{'isValid':![],'message':_0x0a9e('0x106')};}var _0x4d8a67=this[_0x0a9e('0x10')][_0x266aa1[0x0]['Queue'][_0x0a9e('0x29')]];_0x4d8a67['message']=utils['CAMPAIGN_STATUS']['ACTIVE'];if(_[_0x0a9e('0x41')](_0x4d8a67)){ut[_0x0a9e('0x32')](_0x0a9e('0x107'),_0x4d8a67);return{'isValid':![],'message':_0x0a9e('0x108')};}if(!this[_0x0a9e('0x70')](_0x4d8a67[_0x0a9e('0x109')])){ut['logger'](_0x0a9e('0x10a'),_0x0a9e('0x10b')+_0x4d8a67[_0x0a9e('0x29')]+_0x0a9e('0x10c'));if(!this[_0x0a9e('0x70')](_0x4d8a67[_0x0a9e('0x10d')])){ut[_0x0a9e('0x32')]('[Preview][validateContact][Trunk\x20not\x20working\x20correctly]',_0x4d8a67['name']+_0x0a9e('0x10e'));return{'isValid':![],'message':'Trunk\x20not\x20working\x20correctly'};}}if(!ut[_0x0a9e('0x6f')](_0x4d8a67[_0x0a9e('0x3c')])){ut[_0x0a9e('0x32')](_0x0a9e('0x10f'),_0x4d8a67[_0x0a9e('0x29')]+_0x0a9e('0x110'));return{'isValid':![],'message':'campaign\x20Name:\x20'+_0x4d8a67[_0x0a9e('0x29')]+'\x20Not\x20Active'};}return{'isValid':!![],'message':'Is\x20Valid'};};Preview[_0x0a9e('0xd')]['execCall']=function(_0x38dceb,_0x5dc978,_0x550cbf,_0x26223f){var _0x4a7a3c=this;return new Promise(function(_0x24470a,_0x142e53){var _0xe1ab0d=_0x38dceb['uniqueid'];var _0x4152cd=_0x4a7a3c[_0x0a9e('0x70')](_0x5dc978[_0x0a9e('0x109')])?util['format']('SIP/%s/%s%s',_0x5dc978[_0x0a9e('0x109')][_0x0a9e('0x29')],_[_0x0a9e('0x41')](_0x5dc978[_0x0a9e('0x111')])?'':_0x5dc978[_0x0a9e('0x111')][_0x0a9e('0x112')]()||'',_0x5dc978[_0x0a9e('0x113')]>0x0?_0x550cbf[_0x0a9e('0xe9')][_0x0a9e('0x114')](_0x5dc978[_0x0a9e('0x113')]):_0x550cbf['phone']):util['format']('SIP/%s/%s%s',_[_0x0a9e('0x41')](_0x5dc978[_0x0a9e('0x10d')])?_0x5dc978[_0x0a9e('0x109')][_0x0a9e('0x29')]:_0x5dc978[_0x0a9e('0x10d')][_0x0a9e('0x29')],_[_0x0a9e('0x41')](_0x5dc978[_0x0a9e('0x111')])?'':_0x5dc978['dialPrefix']['trim']()||'',_0x5dc978[_0x0a9e('0x113')]>0x0?_0x550cbf[_0x0a9e('0xe9')]['substring'](_0x5dc978[_0x0a9e('0x113')]):_0x550cbf[_0x0a9e('0xe9')]);var _0x2e2280=_0x4a7a3c[_0x0a9e('0x70')](_0x5dc978[_0x0a9e('0x109')])?ut[_0x0a9e('0x115')](_0x5dc978[_0x0a9e('0x109')][_0x0a9e('0x116')],_0x5dc978[_0x0a9e('0x117')],_0x5dc978[_0x0a9e('0x118')]>0x0?ut[_0x0a9e('0x119')](_0x5dc978[_0x0a9e('0x11a')],_0x5dc978['dialRandomLastDigitCallerIdNumber']):_0x5dc978[_0x0a9e('0x11a')]):ut[_0x0a9e('0x115')](_[_0x0a9e('0x41')](_0x5dc978[_0x0a9e('0x10d')])?_0x5dc978[_0x0a9e('0x109')][_0x0a9e('0x116')]:_0x5dc978[_0x0a9e('0x10d')][_0x0a9e('0x116')],_0x5dc978[_0x0a9e('0x117')],_0x5dc978[_0x0a9e('0x118')]>0x0?ut[_0x0a9e('0x119')](_0x5dc978[_0x0a9e('0x11a')],_0x5dc978['dialRandomLastDigitCallerIdNumber']):_0x5dc978['dialOriginateCallerIdNumber']);if(_0x2e2280){_0x38dceb[_0x0a9e('0x11b')]=ut[_0x0a9e('0x11c')](_0x2e2280);_0x38dceb[_0x0a9e('0x11d')]=ut[_0x0a9e('0x11e')](_0x2e2280);}var _0x33359a=ut[_0x0a9e('0x11f')](_0x5dc978,_0x550cbf,_0x4152cd,_0x2e2280,_0xe1ab0d,_0x38dceb);var _0xa8b5de=utils['setXMDContactVariables'](_0x550cbf[_0x0a9e('0xe8')]);Object['assign'](_0x33359a,_0xa8b5de);_[_0x0a9e('0x120')](_0x38dceb,ut[_0x0a9e('0x121')](_0x33359a));_0x38dceb[_0x0a9e('0x61')]=moment()[_0x0a9e('0x27')](_0x0a9e('0x62'));_0x5dc978[_0x0a9e('0x122')]=_0x33359a;var _0x465003=ut[_0x0a9e('0x123')](_0x38dceb,_0x5dc978,_0x33359a,_0x38dceb[_0x0a9e('0x83')],_0x26223f);return ami[_0x0a9e('0x124')](_0x465003)[_0x0a9e('0x56')](function(_0x8231e5){_0x5dc978[_0x0a9e('0x2d')]+=0x1;logger[_0x0a9e('0x26')](_0x0a9e('0x125'),_0xe1ab0d,_0x0a9e('0x9e'),_0x5dc978['name'],'originated:\x20',_0x5dc978[_0x0a9e('0x2d')]);_0x24470a(_0x8231e5);})[_0x0a9e('0x5e')](function(_0x52b365){ut['logAgent'](_0x38dceb,0xe,_0x0a9e('0x126'));rpcDb[_0x0a9e('0xdc')](_0x38dceb,_0x0a9e('0x127'));_0x142e53(_0x52b365);});});};Preview['prototype'][_0x0a9e('0x1d')]=function(_0x5b6447){if(this[_0x0a9e('0x13')][_0x5b6447['linkedid']]){this[_0x0a9e('0x13')][_0x5b6447['linkedid']][_0x0a9e('0x4a')]=_0x5b6447[_0x0a9e('0x4a')];}};Preview[_0x0a9e('0xd')]['syncOriginateResponse']=function(_0x316b51){var _0x497fda=this;var _0x505ffd=this[_0x0a9e('0x13')][_0x316b51[_0x0a9e('0x128')]];if(_0x505ffd){if(_0x505ffd[_0x0a9e('0xeb')]&&this[_0x0a9e('0x14')][_0x505ffd[_0x0a9e('0xeb')]]){ut[_0x0a9e('0x129')](_0x505ffd,this[_0x0a9e('0x14')][_0x505ffd[_0x0a9e('0xeb')]][_0x0a9e('0x29')],this[_0x0a9e('0x14')][_0x505ffd[_0x0a9e('0xeb')]]['id']);}var _0x98bf26=_[_0x0a9e('0x12a')](_0x505ffd);_0x98bf26[_0x0a9e('0x12b')]=moment()[_0x0a9e('0x27')](_0x0a9e('0x62'));var _0x310026=_0x497fda[_0x0a9e('0x10')][_0x505ffd[_0x0a9e('0x43')]];if(ut['isFailure'](_0x316b51[_0x0a9e('0x12c')])){if(_0x505ffd[_0x0a9e('0xaa')]){rpcDb[_0x0a9e('0xfe')](_0x505ffd[_0x0a9e('0x85')]);}if(_0x505ffd['activeContact']){rpcDb['disableContact'](_0x505ffd['idContact']);}ami[_0x0a9e('0x25')]('custom:agentringnoanswer',ut[_0x0a9e('0x78')](_0x505ffd,_0x0a9e('0x12d'),this[_0x0a9e('0x10')][_0x505ffd[_0x0a9e('0x43')]]));this[_0x0a9e('0xd5')](_0x98bf26,_0x310026,_0x316b51);}else{_0x505ffd[_0x0a9e('0x61')]=moment()[_0x0a9e('0x27')](_0x0a9e('0x62'));ut[_0x0a9e('0xd9')](_0x98bf26,0x4,_0x0a9e('0x12e'));rpcDb['createAgentHistory'](_0x98bf26,_0x0a9e('0x12f'));}}};Preview['prototype'][_0x0a9e('0x1a')]=function(_0x586d2f){var _0xf4de86=this[_0x0a9e('0x13')][_0x586d2f[_0x0a9e('0x84')]];var _0x556bb7;if(_0xf4de86){_0x556bb7=this[_0x0a9e('0x10')][_0xf4de86[_0x0a9e('0x43')]];logger['info']('[syncHangup][talking]',_0x586d2f[_0x0a9e('0x84')],_0x0a9e('0x9e'),_0x556bb7[_0x0a9e('0x29')],'pTalking:\x20',_0x556bb7['pTalking']);}if(this['actions'][_0x586d2f[_0x0a9e('0x84')]]&&_0x586d2f[_0x0a9e('0x84')]!==_0x586d2f[_0x0a9e('0x91')]){if(_0x586d2f[_0x0a9e('0x130')]==='16'&&this[_0x0a9e('0x13')][_0x586d2f[_0x0a9e('0x84')]][_0x0a9e('0x4d')]){this[_0x0a9e('0x72')](_0x586d2f,_0x586d2f[_0x0a9e('0x84')],_0x586d2f[_0x0a9e('0x130')]);}else if(this[_0x0a9e('0x13')][_0x586d2f[_0x0a9e('0x84')]][_0x0a9e('0x4d')]){logger[_0x0a9e('0x26')](_0x0a9e('0x131'),_0x586d2f[_0x0a9e('0x84')],_0x586d2f[_0x0a9e('0x130')],_0x0a9e('0x9e'),_0x556bb7['name'],_0x0a9e('0x8a'),_0x556bb7[_0x0a9e('0x2e')]);this[_0x0a9e('0x72')](_0x586d2f,_0x586d2f[_0x0a9e('0x84')],_0x586d2f[_0x0a9e('0x130')]);}}else if(_0xf4de86&&_[_0x0a9e('0x41')](_0xf4de86['statedesc'])&&_0x556bb7[_0x0a9e('0x132')]&&_0x586d2f[_0x0a9e('0x84')]===_0x586d2f[_0x0a9e('0x91')]&&_[_0x0a9e('0x41')](_0x586d2f[_0x0a9e('0xd8')])&&_0x586d2f[_0x0a9e('0x130')]==='16'&&_0x586d2f[_0x0a9e('0x133')]==='6'&&_[_0x0a9e('0xd7')](_0xf4de86[_0x0a9e('0x134')])){if(_0xf4de86['unlockAgent']){rpcDb['unlockContact'](_0xf4de86[_0x0a9e('0x85')]);}if(_0xf4de86[_0x0a9e('0x83')]){rpcDb['disableContact'](_0xf4de86[_0x0a9e('0x85')]);}_0x586d2f[_0x0a9e('0xd8')]='22';this['callProgressDetectingAgent'](_0xf4de86,_0x556bb7,_0x586d2f);}else if(_0xf4de86&&_0xf4de86[_0x0a9e('0x134')]){if(_0x586d2f['cause']==='16'&&this[_0x0a9e('0x13')][_0x586d2f[_0x0a9e('0x84')]]['dialAnswer']){logger[_0x0a9e('0x26')](_0x0a9e('0x135'),_0x586d2f['linkedid'],_0x586d2f[_0x0a9e('0x130')],_0x0a9e('0x9e'),_0x556bb7['name'],_0x0a9e('0x8a'),_0x556bb7[_0x0a9e('0x2e')]);this[_0x0a9e('0x72')](_0x586d2f,_0x586d2f[_0x0a9e('0x84')],_0x586d2f[_0x0a9e('0x130')]);}else if(this[_0x0a9e('0x13')][_0x586d2f['linkedid']][_0x0a9e('0x4d')]){logger[_0x0a9e('0x26')]('[syncHangup][talking][cause]',_0x586d2f[_0x0a9e('0x84')],_0x586d2f[_0x0a9e('0x130')],_0x0a9e('0x9e'),_0x556bb7[_0x0a9e('0x29')],_0x0a9e('0x8a'),_0x556bb7[_0x0a9e('0x2e')]);this[_0x0a9e('0x72')](_0x586d2f,_0x586d2f['linkedid'],_0x586d2f['cause']);}}};Preview['prototype']['syncDialEnd']=function(_0x5e9817){if(this[_0x0a9e('0x13')][_0x5e9817[_0x0a9e('0xd4')]]&&_0x5e9817['destlinkedid']!==_0x5e9817['destuniqueid']){this[_0x0a9e('0x72')](_0x5e9817,_0x5e9817['destlinkedid'],_0x5e9817[_0x0a9e('0xcd')]);}};Preview[_0x0a9e('0xd')][_0x0a9e('0x136')]=function(_0x175c97){if(this[_0x0a9e('0x13')][_0x175c97[_0x0a9e('0x84')]]&&_0x175c97['linkedid']!==_0x175c97[_0x0a9e('0x91')]&&!this[_0x0a9e('0x13')][_0x175c97['linkedid']][_0x0a9e('0x4d')]){if(_0x175c97[_0x0a9e('0x130')]==='1'){this[_0x0a9e('0x72')](_0x175c97,_0x175c97[_0x0a9e('0x84')],_0x175c97[_0x0a9e('0x130')]);}}};Preview[_0x0a9e('0xd')][_0x0a9e('0x137')]=function(_0x4a36df,_0x331216,_0x508395){if(this[_0x0a9e('0x13')][_0x4a36df]){if(_[_0x0a9e('0x41')](this['actions'][_0x4a36df][_0x0a9e('0x122')])){this[_0x0a9e('0x13')][_0x4a36df]['variables']={};}this[_0x0a9e('0x13')][_0x4a36df]['variables'][_0x331216]=_0x508395;}};Preview[_0x0a9e('0xd')][_0x0a9e('0x1f')]=function(_0x5d0620){try{if(!_[_0x0a9e('0x41')](_0x5d0620)){if(ut['filterKey'](_[_0x0a9e('0x138')](_0x5d0620[_0x0a9e('0x139')])[0x0])){this[_0x0a9e('0x137')](_0x5d0620[_0x0a9e('0x91')],_[_0x0a9e('0x138')](_0x5d0620[_0x0a9e('0x139')])[0x0],_0x5d0620[_0x0a9e('0x13a')]);}}}catch(_0x53b5c2){logger[_0x0a9e('0x13b')](_0x0a9e('0x13c'),util[_0x0a9e('0x13d')](_0x53b5c2,{'showHidden':![],'depth':null}));}};Preview[_0x0a9e('0xd')][_0x0a9e('0x21')]=function(_0x5932ad){if(_0x5932ad){if(this[_0x0a9e('0x13')][_0x5932ad['transfertargetlinkedid']]){this['actions'][_0x5932ad[_0x0a9e('0x13e')]]['transfer']=!![];}}};Preview[_0x0a9e('0xd')][_0x0a9e('0x23')]=function(_0x58d5fd){if(_0x58d5fd){if(this[_0x0a9e('0x13')][_0x58d5fd[_0x0a9e('0x13f')]]){this[_0x0a9e('0x13')][_0x58d5fd[_0x0a9e('0x13f')]][_0x0a9e('0x134')]=!![];}}};module[_0x0a9e('0x140')]=Preview; \ No newline at end of file diff --git a/server/services/ami/preview/rpcDb.js b/server/services/ami/preview/rpcDb.js index 99ff91d..626860e 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 _0xbb40=['resolve','then','catch','moveContactManagedDialer','checkIsBlackList','[checkIsBlackList]\x20','[getContactPreview]\x20','createAgentHistory','createCustomerFinal','active','rescheduleContact','[rescheduleContact]\x20','countReScheduled','[countReScheduled]\x20','unlockContact','disableContact','[activeContact]\x20','type','uniqueid','calleridnum','calleridname','queue','answertime','queuecallerleaveAt','queuecallercompleteAt','connectedlinename','membername','context','from-sip','exten','xcally-motion-preview','holdtime','assigned','lastAssignedTo','COMPLETED','getContactRecallMe','[GetContactRecallMe]\x20','rescheduleContactInQueue','[rescheduleContactInQueue]\x20','util','bluebird','../../../config/logger','preview','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/agentReportPreview','../rpc/voiceQueueReport','error','inspect','createHistory','[createHistory]\x20'];(function(_0x9c2427,_0x17c865){var _0x51984f=function(_0x177af6){while(--_0x177af6){_0x9c2427['push'](_0x9c2427['shift']());}};_0x51984f(++_0x17c865);}(_0xbb40,0x12b));var _0x0bb4=function(_0x146101,_0x1a1486){_0x146101=_0x146101-0x0;var _0x1e31b1=_0xbb40[_0x146101];return _0x1e31b1;};'use strict';var util=require(_0x0bb4('0x0'));var BPromise=require(_0x0bb4('0x1'));var logger=require(_0x0bb4('0x2'))(_0x0bb4('0x3'));var cmHopper=require(_0x0bb4('0x4'));var cmHopperHistory=require(_0x0bb4('0x5'));var cmHopperBlack=require(_0x0bb4('0x6'));var agentReportPreview=require(_0x0bb4('0x7'));var voiceQueueReport=require(_0x0bb4('0x8'));function loggerCatch(_0xccc985){return function(_0x295758){logger[_0x0bb4('0x9')](_0xccc985,util[_0x0bb4('0xa')](_0x295758,{'showHidden':![],'depth':null}));};}function create(_0x1ff42e){return cmHopperHistory[_0x0bb4('0xb')](_0x1ff42e)['catch'](loggerCatch(_0x0bb4('0xc')));}function createAgent(_0x49c867){return BPromise[_0x0bb4('0xd')]()[_0x0bb4('0xe')](agentReportPreview[_0x0bb4('0xb')](_0x49c867))[_0x0bb4('0xf')](loggerCatch(_0x0bb4('0xc')));}function moveContact(_0x20077e){return cmHopper[_0x0bb4('0x10')](_0x20077e,!![])[_0x0bb4('0xf')](loggerCatch('[moveContactManagedDialer]\x20'));}exports[_0x0bb4('0x11')]=function(_0x350335){return cmHopperBlack[_0x0bb4('0x11')](_0x350335)[_0x0bb4('0xf')](loggerCatch(_0x0bb4('0x12')));};exports['getContactPreview']=function(_0x455c01){return BPromise[_0x0bb4('0xd')]()['then'](cmHopper['getContactPreview'](_0x455c01))['catch'](loggerCatch(_0x0bb4('0x13')));};exports[_0x0bb4('0xb')]=function(_0x792232,_0x2b26bc){create(_0x792232)[_0x0bb4('0xf')](loggerCatch(_0x2b26bc));moveContact(_0x792232)['catch'](loggerCatch(_0x2b26bc));};exports[_0x0bb4('0x14')]=function(_0x439c7e,_0x5c5f12){createAgent(_0x439c7e)['catch'](loggerCatch(_0x5c5f12));};exports['createCustomerHistory']=function(_0x5d373d,_0x6c022){create(_0x5d373d)[_0x0bb4('0xf')](loggerCatch(_0x6c022));};exports[_0x0bb4('0x15')]=function(_0x3b37cc,_0x386e12){moveContact(_0x3b37cc)[_0x0bb4('0xf')](loggerCatch(_0x386e12));};exports['rescheduleContact']=function(_0x57665b,_0x583bc5,_0x5b8a27){if(_0x583bc5){_0x57665b['UserId']=null;}if(_0x5b8a27){_0x57665b[_0x0bb4('0x16')]=![];}return cmHopper[_0x0bb4('0x17')](_0x57665b)[_0x0bb4('0xf')](loggerCatch(_0x0bb4('0x18')));};exports[_0x0bb4('0x19')]=function(_0x34fa9a){return cmHopper[_0x0bb4('0x19')](_0x34fa9a)[_0x0bb4('0xf')](loggerCatch(_0x0bb4('0x1a')));};exports[_0x0bb4('0x1b')]=function(_0x3451a7){return cmHopper['unlockContact']({'UserId':null},_0x3451a7,0x1)[_0x0bb4('0xf')](loggerCatch('[unlockContact]\x20'));};exports[_0x0bb4('0x1c')]=function(_0x515964){return cmHopper[_0x0bb4('0x1b')]({'active':![]},_0x515964,0x1)[_0x0bb4('0xf')](loggerCatch(_0x0bb4('0x1d')));};exports['crateCustomerReportQueue']=function(_0x589ad4){var _0x5c4f2a={};_0x5c4f2a['type']=_0x589ad4[_0x0bb4('0x1e')];_0x5c4f2a['uniqueid']=_0x589ad4[_0x0bb4('0x1f')];_0x5c4f2a[_0x0bb4('0x20')]=_0x589ad4['calleridnum'];_0x5c4f2a[_0x0bb4('0x21')]=_0x589ad4[_0x0bb4('0x21')];_0x5c4f2a['queue']=_0x589ad4[_0x0bb4('0x22')];_0x5c4f2a['queuecallerjoinAt']=_0x589ad4[_0x0bb4('0x23')];_0x5c4f2a[_0x0bb4('0x24')]=_0x589ad4[_0x0bb4('0x23')];_0x5c4f2a['queuecallercomplete']=0x1;_0x5c4f2a[_0x0bb4('0x25')]=_0x589ad4['endtime'];_0x5c4f2a[_0x0bb4('0x26')]=_0x589ad4[_0x0bb4('0x27')];_0x5c4f2a[_0x0bb4('0x28')]=_0x0bb4('0x29');_0x5c4f2a[_0x0bb4('0x2a')]=_0x0bb4('0x2b');_0x5c4f2a[_0x0bb4('0x2c')]=0x0;_0x5c4f2a[_0x0bb4('0x2d')]=0x1;_0x5c4f2a[_0x0bb4('0x2e')]=_0x589ad4['membername'];_0x5c4f2a['queuecallerexitreason']=_0x0bb4('0x2f');return BPromise[_0x0bb4('0xd')]()[_0x0bb4('0xe')](voiceQueueReport['create'](_0x5c4f2a))['catch'](loggerCatch('[voiceQueueReport]\x20'));};exports[_0x0bb4('0x30')]=function(_0x3132bd,_0x4ff87){return BPromise['resolve']()[_0x0bb4('0xe')](cmHopper['getContactRecallMe'](_0x3132bd,_0x4ff87))['catch'](loggerCatch(_0x0bb4('0x31')));};exports[_0x0bb4('0x32')]=function(_0x2ebb2a){return cmHopper[_0x0bb4('0x17')](_0x2ebb2a,!![],!![])[_0x0bb4('0xf')](loggerCatch(_0x0bb4('0x33')));}; \ No newline at end of file +var _0xa7ce=['UserId','active','[rescheduleContact]\x20','countReScheduled','[countReScheduled]\x20','unlockContact','[unlockContact]\x20','disableContact','[activeContact]\x20','type','calleridnum','calleridname','queue','queuecallerjoinAt','answertime','queuecallerleaveAt','queuecallercompleteAt','endtime','connectedlinename','membername','context','from-sip','xcally-motion-preview','holdtime','lastAssignedTo','COMPLETED','create','getContactRecallMe','[GetContactRecallMe]\x20','rescheduleContactInQueue','[rescheduleContactInQueue]\x20','../../../config/logger','preview','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/agentReportPreview','error','inspect','createHistory','[createHistory]\x20','resolve','catch','moveContactManagedDialer','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','then','[getContactPreview]\x20','createAgentHistory','createCustomerHistory','createCustomerFinal','rescheduleContact'];(function(_0x2e01e6,_0x53731d){var _0x3f00dd=function(_0x399475){while(--_0x399475){_0x2e01e6['push'](_0x2e01e6['shift']());}};_0x3f00dd(++_0x53731d);}(_0xa7ce,0x18b));var _0xea7c=function(_0x4825df,_0x20ad9a){_0x4825df=_0x4825df-0x0;var _0x34f4d9=_0xa7ce[_0x4825df];return _0x34f4d9;};'use strict';var util=require('util');var BPromise=require('bluebird');var logger=require(_0xea7c('0x0'))(_0xea7c('0x1'));var cmHopper=require('../rpc/cmHopper');var cmHopperHistory=require(_0xea7c('0x2'));var cmHopperBlack=require(_0xea7c('0x3'));var agentReportPreview=require(_0xea7c('0x4'));var voiceQueueReport=require('../rpc/voiceQueueReport');function loggerCatch(_0x16ef40){return function(_0x383663){logger[_0xea7c('0x5')](_0x16ef40,util[_0xea7c('0x6')](_0x383663,{'showHidden':![],'depth':null}));};}function create(_0x302bfb){return cmHopperHistory[_0xea7c('0x7')](_0x302bfb)['catch'](loggerCatch(_0xea7c('0x8')));}function createAgent(_0x1d314a){return BPromise[_0xea7c('0x9')]()['then'](agentReportPreview[_0xea7c('0x7')](_0x1d314a))[_0xea7c('0xa')](loggerCatch(_0xea7c('0x8')));}function moveContact(_0x5da53c){return cmHopper[_0xea7c('0xb')](_0x5da53c,!![])[_0xea7c('0xa')](loggerCatch('[moveContactManagedDialer]\x20'));}exports[_0xea7c('0xc')]=function(_0x47f855){return cmHopperBlack[_0xea7c('0xc')](_0x47f855)[_0xea7c('0xa')](loggerCatch(_0xea7c('0xd')));};exports[_0xea7c('0xe')]=function(_0x4fda38){return BPromise[_0xea7c('0x9')]()[_0xea7c('0xf')](cmHopper[_0xea7c('0xe')](_0x4fda38))[_0xea7c('0xa')](loggerCatch(_0xea7c('0x10')));};exports[_0xea7c('0x7')]=function(_0x36f0ba,_0x3ff848){create(_0x36f0ba)[_0xea7c('0xa')](loggerCatch(_0x3ff848));moveContact(_0x36f0ba)[_0xea7c('0xa')](loggerCatch(_0x3ff848));};exports[_0xea7c('0x11')]=function(_0x21d15d,_0x2e21bf){createAgent(_0x21d15d)[_0xea7c('0xa')](loggerCatch(_0x2e21bf));};exports[_0xea7c('0x12')]=function(_0x1a657e,_0x343c87){create(_0x1a657e)[_0xea7c('0xa')](loggerCatch(_0x343c87));};exports[_0xea7c('0x13')]=function(_0xbdee10,_0x1c2096){moveContact(_0xbdee10)[_0xea7c('0xa')](loggerCatch(_0x1c2096));};exports[_0xea7c('0x14')]=function(_0x328169,_0x2a2464,_0x37afb8){if(_0x2a2464){_0x328169[_0xea7c('0x15')]=null;}if(_0x37afb8){_0x328169[_0xea7c('0x16')]=![];}return cmHopper[_0xea7c('0x14')](_0x328169)[_0xea7c('0xa')](loggerCatch(_0xea7c('0x17')));};exports[_0xea7c('0x18')]=function(_0x175025){return cmHopper[_0xea7c('0x18')](_0x175025)['catch'](loggerCatch(_0xea7c('0x19')));};exports['unlockContact']=function(_0x437ce5){return cmHopper[_0xea7c('0x1a')]({'UserId':null},_0x437ce5,0x1)['catch'](loggerCatch(_0xea7c('0x1b')));};exports[_0xea7c('0x1c')]=function(_0x51e23f){return cmHopper[_0xea7c('0x1a')]({'active':![]},_0x51e23f,0x1)[_0xea7c('0xa')](loggerCatch(_0xea7c('0x1d')));};exports['crateCustomerReportQueue']=function(_0x5db427){var _0x499159={};_0x499159[_0xea7c('0x1e')]=_0x5db427[_0xea7c('0x1e')];_0x499159['uniqueid']=_0x5db427['uniqueid'];_0x499159[_0xea7c('0x1f')]=_0x5db427['calleridnum'];_0x499159[_0xea7c('0x20')]=_0x5db427['calleridname'];_0x499159[_0xea7c('0x21')]=_0x5db427[_0xea7c('0x21')];_0x499159[_0xea7c('0x22')]=_0x5db427[_0xea7c('0x23')];_0x499159[_0xea7c('0x24')]=_0x5db427[_0xea7c('0x23')];_0x499159['queuecallercomplete']=0x1;_0x499159[_0xea7c('0x25')]=_0x5db427[_0xea7c('0x26')];_0x499159[_0xea7c('0x27')]=_0x5db427[_0xea7c('0x28')];_0x499159[_0xea7c('0x29')]=_0xea7c('0x2a');_0x499159['exten']=_0xea7c('0x2b');_0x499159[_0xea7c('0x2c')]=0x0;_0x499159['assigned']=0x1;_0x499159[_0xea7c('0x2d')]=_0x5db427[_0xea7c('0x28')];_0x499159['queuecallerexitreason']=_0xea7c('0x2e');return BPromise[_0xea7c('0x9')]()[_0xea7c('0xf')](voiceQueueReport[_0xea7c('0x2f')](_0x499159))[_0xea7c('0xa')](loggerCatch('[voiceQueueReport]\x20'));};exports[_0xea7c('0x30')]=function(_0x5a7a51,_0x2c5bb2){return BPromise[_0xea7c('0x9')]()[_0xea7c('0xf')](cmHopper['getContactRecallMe'](_0x5a7a51,_0x2c5bb2))[_0xea7c('0xa')](loggerCatch(_0xea7c('0x31')));};exports[_0xea7c('0x32')]=function(_0x58bad2){return cmHopper['rescheduleContact'](_0x58bad2,!![],!![])['catch'](loggerCatch(_0xea7c('0x33')));}; \ 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 dcd9af9..f2906d2 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 _0x4379=['../../../../config/logger','preview','XCALLY_IP_AGI','127.0.0.1','../../dialer/utils','loggerCatch','inspect','loggerError','error','logger2','info','message','getCallerId','string','isEmpty','isUndefined','format','\x22%s\x22\x20<%s>','\x22\x22\x20<>','isActive','isNil','addVariables','Queue','name','calleridname','calleridnum','ContactId','VoiceQueueId','dialOriginateTimeout','\x22rtTxX%s%s\x22','monitor_format','U(xcally-mixmonitor-context)','dialPreviewUrl','\x22agi://%s/square,%s\x22','dialQueueProject','dialQueueProject2','NONE','originatecalleridnum','originatecalleridname','xcally-motion-preview','Call-Type:\x20PREVIEW','_XCALLY_MIXMONITOR_FORMAT','_XCALLY_MIXMONITOR_UNIQUEID','toLowerVariables','hasOwnProperty','updateOriginated','originated','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','Blacklist','starttime','endtime','logAgent','statedesc','ringtime','getSeconds','UserId','state','responsetime','talktime','answertime','isFailure','variablesAction','RECALL','BOOKED','timeout','uniqueid','totalGlobal','countbusyretry','countnoanswerretry','countagentrejectretry','countnosuchnumberretry','cloneAction','clone','scheduledAt','active','scheduledat','add','minutes','ListId','decrementTalkink','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','lastevent','interface','channelAgent','motionChannel','voice','mandatoryDisposition','buildObj','agentReadyId','not_inuse','status','reachable','push','milliseconds','diff','seconds','CampaignId','filterKey','idContact','campaigntype','dialAnswer','membername','callback','callbackuniqueid','callbackat','recallme','sipcallid','xmd-voicequeueid','xmd-queue','xmd-phone','xmd-listid','xmd-dialurl','xmd-dialoptions','xmd-dialid','xmd-dialchannel','xmd-contactid','xmd-cdrtype','xmd-callerid','xmd-agiafter','rtpaudioqos','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosbridged','rtpaudioqosloss','rtpaudioqosrttbridged','\x5cw{0,','pow','replace','random','extractCalleridNumber','match','variables','keys','forEach','toLowerCase','util','lodash','moment'];(function(_0x230cf7,_0x204c10){var _0x705f19=function(_0x4d4972){while(--_0x4d4972){_0x230cf7['push'](_0x230cf7['shift']());}};_0x705f19(++_0x204c10);}(_0x4379,0x1ad));var _0x9437=function(_0x40d830,_0x35deef){_0x40d830=_0x40d830-0x0;var _0x16d638=_0x4379[_0x40d830];return _0x16d638;};'use strict';var util=require(_0x9437('0x0'));var _=require(_0x9437('0x1'));var moment=require(_0x9437('0x2'));var logger=require(_0x9437('0x3'))(_0x9437('0x4'));var ipAgi=process['env'][_0x9437('0x5')]||_0x9437('0x6');var utils=require(_0x9437('0x7'));exports[_0x9437('0x8')]=function(_0x206335){return function(_0x2b21f7){logger['error'](_0x206335,util[_0x9437('0x9')](_0x2b21f7,{'showHidden':![],'depth':null}));};};exports['logger']=function(_0x405bea,_0x5a13c7){logger['info'](_0x405bea,util['inspect'](_0x5a13c7,{'showHidden':![],'depth':null}));};exports[_0x9437('0xa')]=function(_0x38ac27,_0x4b2dab){logger[_0x9437('0xb')](_0x38ac27,util[_0x9437('0x9')](_0x4b2dab,{'showHidden':![],'depth':null}));};exports[_0x9437('0xc')]=function(_0x880846){return function(_0x4bf3d3){logger[_0x9437('0xd')](_0x880846,util[_0x9437('0x9')](_0x4bf3d3,{'showHidden':![],'depth':null}));};};exports[_0x9437('0xe')]=function(_0xb75e09,_0x53c3a6,_0x5c87b6){return{'message':_0xb75e09,'unlock':_0x53c3a6,'active':_0x5c87b6};};exports[_0x9437('0xf')]=function(_0x4bc7e6,_0x406ff9,_0x474678){if(!_['isUndefined'](_0x474678)&&_0x9437('0x10')===typeof _0x474678&&!_[_0x9437('0x11')](_0x474678)){if(!_[_0x9437('0x12')](_0x406ff9)&&_0x9437('0x10')===typeof _0x406ff9&&!_[_0x9437('0x11')](_0x406ff9)){return util[_0x9437('0x13')](_0x9437('0x14'),_0x406ff9,_0x474678);}return util['format'](_0x9437('0x14'),_0x474678,_0x474678);}if(!_['isUndefined'](_0x4bc7e6)&&'string'===typeof _0x4bc7e6&&!_[_0x9437('0x11')](_0x4bc7e6)){return _0x4bc7e6;}return _0x9437('0x15');};exports[_0x9437('0x16')]=function(_0x377761){if(_[_0x9437('0x17')](_0x377761)){return![];}return _0x377761;};exports[_0x9437('0x18')]=function(_0x2c3b43,_0x52c7be,_0x25e874,_0x426abe,_0xeeac6c,_0x554fa6){var _0x213c0e={'XMD-QUEUE':_0x52c7be[_0x9437('0x19')]?_0x52c7be['Queue'][_0x9437('0x1a')]:'','XMD-CALLERID':_0x426abe,'XMD-CALLERID-PREVIEW':_0x554fa6?util['format'](_0x9437('0x14'),_0x554fa6[_0x9437('0x1b')],_0x554fa6[_0x9437('0x1c')]):_0x426abe,'XMD-DIALID':_0xeeac6c,'XMD-CONTACTID':_0x52c7be[_0x9437('0x1d')],'XMD-CDRTYPE':'dialer','CALLERID(all)':_0x426abe,'XMD-VOICEQUEUEID':_0x52c7be[_0x9437('0x1e')],'XMD-DIALCHANNEL':_0x25e874,'XMD-DIALTIMEOUT':_0x2c3b43[_0x9437('0x1f')]||0x1e,'XMD-DIALOPTIONS':util[_0x9437('0x13')](_0x9437('0x20'),_0x2c3b43['dialQueueProject2']?'g':'',_[_0x9437('0x11')](_0x2c3b43[_0x9437('0x21')])?'':_0x9437('0x22')),'XMD-DIALURL':_0x2c3b43[_0x9437('0x23')]||'','XMD-AGI':_0x2c3b43['dialQueueProject']?util['format'](_0x9437('0x24'),ipAgi,_0x2c3b43[_0x9437('0x25')]):'NONE','XMD-AGIAFTER':_0x2c3b43['dialQueueProject2']?util[_0x9437('0x13')]('\x22agi://%s/square,%s\x22',ipAgi,_0x2c3b43[_0x9437('0x26')]):_0x9437('0x27'),'XMD-ORIGINATECALLERIDNUM':_0x554fa6?_0x554fa6[_0x9437('0x28')]:'','XMD-ORIGINATECALLERIDNAME':_0x554fa6?_0x554fa6[_0x9437('0x29')]:'','XMD-DESTINATION':_0x9437('0x2a'),'SIPADDHEADER':_0x9437('0x2b')};if(!_['isEmpty'](_0x2c3b43[_0x9437('0x21')])){_0x213c0e[util[_0x9437('0x13')]('%s',_0x9437('0x2c'))]=_0x2c3b43[_0x9437('0x21')];_0x213c0e[util['format']('%s',_0x9437('0x2d'))]=_0xeeac6c;}return _0x213c0e;};exports[_0x9437('0x2e')]=function(_0x29cfcf){var _0xa5eacc={};for(var _0x409ace in _0x29cfcf){if(_0x29cfcf[_0x9437('0x2f')](_0x409ace)){_0xa5eacc[util[_0x9437('0x13')]('%s',_['toLower'](_0x409ace))]=_0x29cfcf[_0x409ace];}}return{'variables':_0xa5eacc};};exports[_0x9437('0x30')]=function(_0x114642,_0x16a3da){if(!_[_0x9437('0x17')](_0x114642)){if(_0x114642[_0x9437('0x2f')]('originated')){if(_0x114642[_0x9437('0x31')]>0x0){_0x114642[_0x9437('0x31')]-=0x1;}else{logger['error']('[updateOriginated]\x20object\x20originated\x20is\x20negative',_0x16a3da);}}}else{logger[_0x9437('0xb')](_0x9437('0x32'),_0x16a3da);}};exports[_0x9437('0x33')]=function(_0x36e844){var _0x514f23=moment()['format'](_0x9437('0x34'));_0x36e844['state']=0xd;_0x36e844['statedesc']=_0x9437('0x35');_0x36e844[_0x9437('0x36')]=_0x514f23;_0x36e844['responsetime']=_0x514f23;_0x36e844[_0x9437('0x37')]=_0x514f23;};exports[_0x9437('0x38')]=function(_0x58205b,_0x4f385e,_0x134082){var _0xe8dfef=moment()[_0x9437('0x13')](_0x9437('0x34'));_0x58205b['state']=_0x4f385e;_0x58205b[_0x9437('0x39')]=_0x134082;_0x58205b['responsetime']=_0xe8dfef;_0x58205b[_0x9437('0x3a')]=utils[_0x9437('0x3b')](_0x58205b['responsetime'],_0x58205b[_0x9437('0x36')]);};exports['logLookAgent']=function(_0x1063b0,_0x309c35,_0x55c566){_0x1063b0['membername']=_0x309c35;_0x1063b0[_0x9437('0x3c')]=_0x55c566;};exports['logCustomer']=function(_0x64b0a5,_0x86b8bd,_0x5141dd){var _0x2545b4=moment()[_0x9437('0x13')](_0x9437('0x34'));_0x64b0a5[_0x9437('0x3d')]=_0x86b8bd;_0x64b0a5[_0x9437('0x39')]=_0x5141dd;_0x64b0a5[_0x9437('0x3e')]=_0x64b0a5[_0x9437('0x3e')]?_0x64b0a5[_0x9437('0x3e')]:_0x2545b4;_0x64b0a5['endtime']=_0x64b0a5[_0x9437('0x37')]?_0x64b0a5[_0x9437('0x37')]:_0x2545b4;_0x64b0a5[_0x9437('0x3a')]=utils['getSeconds'](_0x64b0a5[_0x9437('0x3e')]||0x0,_0x64b0a5[_0x9437('0x36')]||0x0);_0x64b0a5[_0x9437('0x3f')]=_0x64b0a5[_0x9437('0x40')]?utils[_0x9437('0x3b')](_0x64b0a5[_0x9437('0x37')],_0x64b0a5[_0x9437('0x40')]):0x0;};exports[_0x9437('0x41')]=function(_0x391352){return _0x391352==='Failure';};exports[_0x9437('0x42')]=function(_0x4930be,_0x2083d8,_0x34936e,_0xdaae02,_0x33c8c2){var _0x52172b=_0xdaae02?_0x9437('0x43'):_0x4930be['calleridname'];_0x52172b=_0x33c8c2?_0x9437('0x44'):_0x52172b;return{'actionid':_0x4930be['uniqueid'],'action':'originate','channel':_0x4930be['channelAgent'],'callerid':util[_0x9437('0x13')](_0x9437('0x14'),_0x52172b,_0x4930be[_0x9437('0x1c')]),'Exten':'xcally-motion-preview','Context':'from-sip','Priority':'1','variable':_0x34936e,'timeout':(_0x2083d8[_0x9437('0x45')]||0x1e)*0x3e8,'async':!![],'channelid':_0x4930be[_0x9437('0x46')]};};exports[_0x9437('0x47')]=function(_0x215a8b){return _0x215a8b[_0x9437('0x48')]+_0x215a8b['countcongestionretry']+_0x215a8b[_0x9437('0x49')]+_0x215a8b[_0x9437('0x4a')]+_0x215a8b[_0x9437('0x4b')];};exports[_0x9437('0x4c')]=function(_0xfd1e0b){var _0x423638=_[_0x9437('0x4d')](_0xfd1e0b);_0x423638[_0x9437('0x3d')]=0xf;_0x423638[_0x9437('0x39')]='Global';return _0x423638;};exports[_0x9437('0x4e')]=function(_0x1d1a77,_0x1a469b,_0x399469){var _0x2b1c1c={};_0x2b1c1c[_0x1a469b]=_0x1d1a77[_0x1a469b];_0x2b1c1c[_0x9437('0x4f')]=![];_0x2b1c1c[_0x9437('0x50')]=moment()[_0x9437('0x51')](_0x399469,_0x9437('0x52'))[_0x9437('0x13')](_0x9437('0x34'));_0x2b1c1c[_0x9437('0x1d')]=_0x1d1a77['ContactId'];_0x2b1c1c[_0x9437('0x53')]=_0x1d1a77[_0x9437('0x53')];_0x2b1c1c[_0x9437('0x1e')]=_0x1d1a77[_0x9437('0x1e')]||undefined;return _0x2b1c1c;};exports[_0x9437('0x54')]=function(_0x433ce2,_0x4882f2){if(!_['isNil'](_0x433ce2)){if(_0x433ce2[_0x9437('0x55')]>0x0){_0x433ce2[_0x9437('0x55')]-=0x1;}else{logger[_0x9437('0xb')](_0x4882f2,_0x9437('0x56'));}}else{logger[_0x9437('0xb')](_0x4882f2,_0x9437('0x57'));}};exports['IsNotLoggedIn']=function(_0x567ac8){if(_0x567ac8<=0x0){return!![];}return![];};function buildObj(_0x1485fc,_0x2b8cb9,_0x599262){_0x1485fc[_0x9437('0x58')]=_0x2b8cb9;_0x1485fc[_0x9437('0x1a')]=_0x1485fc['queue'];_0x1485fc[_0x9437('0x59')]=_0x1485fc[_0x9437('0x5a')];_0x1485fc[_0x9437('0x5b')]=_0x9437('0x5c');if(_0x599262){_0x1485fc[_0x9437('0x5d')]=_0x599262[_0x9437('0x5d')];}return _0x1485fc;}exports[_0x9437('0x5e')]=buildObj;exports[_0x9437('0x5f')]=function(_0x2c7220){var _0x101c07=[];for(var _0x5bba98 in _0x2c7220){if(_0x2c7220[_0x9437('0x2f')](_0x5bba98)){if(!_['isNil'](_0x2c7220[_0x5bba98])&&_0x2c7220[_0x5bba98][_0x9437('0x3d')]===_0x9437('0x60')&&_0x2c7220[_0x5bba98][_0x9437('0x61')]===_0x9437('0x62')){_0x101c07[_0x9437('0x63')](_0x2c7220[_0x5bba98]['id']);}}}return _0x101c07;};exports['getDiff']=function(_0x4c9d35){var _0x2795af=moment()[_0x9437('0x64')](0x0);var _0x2fb1bb=moment(_0x4c9d35)[_0x9437('0x64')](0x0);return _0x2795af[_0x9437('0x65')](_0x2fb1bb,_0x9437('0x66'));};exports['createBody']=function(_0x1f4f3f){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x1f4f3f[_0x9437('0x1d')],'ListId':_0x1f4f3f[_0x9437('0x53')],'VoiceQueueId':_0x1f4f3f['VoiceQueueId']||undefined,'CampaignId':_0x1f4f3f[_0x9437('0x67')]||undefined};};exports[_0x9437('0x68')]=function(_0x108cbe){if(_0x108cbe===_0x9437('0x46')||_0x108cbe===_0x9437('0x69')||_0x108cbe==='queue'||_0x108cbe==='type'||_0x108cbe===_0x9437('0x6a')||_0x108cbe===_0x9437('0x6b')||_0x108cbe===_0x9437('0x6c')||_0x108cbe===_0x9437('0x5a')||_0x108cbe===_0x9437('0x1b')||_0x108cbe==='active'||_0x108cbe===_0x9437('0x1c')||_0x108cbe==='scheduledat'||_0x108cbe===_0x9437('0x48')||_0x108cbe==='countcongestionretry'||_0x108cbe==='countnoanswerretry'||_0x108cbe==='countglobal'||_0x108cbe===_0x9437('0x6d')||_0x108cbe===_0x9437('0x6e')||_0x108cbe===_0x9437('0x6f')||_0x108cbe===_0x9437('0x70')||_0x108cbe===_0x9437('0x1d')||_0x108cbe===_0x9437('0x53')||_0x108cbe==='UserId'||_0x108cbe===_0x9437('0x1e')||_0x108cbe===_0x9437('0x71')||_0x108cbe===_0x9437('0x72')||_0x108cbe===_0x9437('0x73')||_0x108cbe===_0x9437('0x74')||_0x108cbe===_0x9437('0x75')||_0x108cbe===_0x9437('0x76')||_0x108cbe==='xmd-dialtimeout'||_0x108cbe===_0x9437('0x77')||_0x108cbe===_0x9437('0x78')||_0x108cbe===_0x9437('0x79')||_0x108cbe===_0x9437('0x7a')||_0x108cbe===_0x9437('0x7b')||_0x108cbe===_0x9437('0x7c')||_0x108cbe===_0x9437('0x7d')||_0x108cbe==='xmd-agi'||_0x108cbe===_0x9437('0x7e')||_0x108cbe==='rtpaudioqosbridged'||_0x108cbe===_0x9437('0x7f')||_0x108cbe===_0x9437('0x80')||_0x108cbe==='rtpaudioqosloss'||_0x108cbe===_0x9437('0x81')||_0x108cbe===_0x9437('0x82')||_0x108cbe==='rtpaudioqosrttbridged'||_0x108cbe===_0x9437('0x7e')||_0x108cbe===_0x9437('0x83')||_0x108cbe===_0x9437('0x7f')||_0x108cbe===_0x9437('0x80')||_0x108cbe===_0x9437('0x84')||_0x108cbe===_0x9437('0x81')||_0x108cbe===_0x9437('0x82')||_0x108cbe===_0x9437('0x85')||_0x108cbe==='bridgepeer'||_0x108cbe==='bridgepvtcallid'||_0x108cbe===_0x9437('0x3d')||_0x108cbe===_0x9437('0x39')){return![];}return!![];};exports['getCallerIdRandom']=function(_0x5b4453,_0x482775){var _0x13a210,_0x577db5,_0x19dbe5;if(_0x482775<=0x0){_0x482775=0x1;}_0x13a210=new RegExp(_0x9437('0x86')+_0x482775+'}$');_0x577db5=Math['pow'](0xa,_0x482775-0x1);_0x19dbe5=Math[_0x9437('0x87')](0xa,_0x482775)-0x1;return util[_0x9437('0x13')]('%s',_[_0x9437('0x88')](_0x5b4453,_0x13a210,_[_0x9437('0x89')](_0x577db5,_0x19dbe5)));};exports['extractCalleridName']=function(_0x1ba3cf){var _0x1de239=_0x1ba3cf['match'](/"(.*?)"/);return _0x1de239?_0x1de239[0x1]:_0x1ba3cf;};exports[_0x9437('0x8a')]=function(_0x59513e){var _0x2ca5d7=_0x59513e[_0x9437('0x8b')](/<(.*?)>/);return _0x2ca5d7?_0x2ca5d7[0x1]:_0x59513e;};function buildNoAnswerEventPayload(_0x47784f,_0x1ded5d){var _0x30a7b4=buildObj(_0x47784f,'noanswer');if(!_[_0x9437('0x11')](_0x1ded5d[_0x9437('0x8c')])){Object[_0x9437('0x8d')](_0x1ded5d[_0x9437('0x8c')])[_0x9437('0x8e')](function(_0x4c752c){_0x30a7b4[_0x4c752c[_0x9437('0x8f')]()]=_0x1ded5d[_0x9437('0x8c')][_0x4c752c];});}return _0x30a7b4;}exports['buildNoAnswerEventPayload']=buildNoAnswerEventPayload; \ No newline at end of file +var _0x8ba7=['xmd-dialoptions','xmd-callerid','xmd-agiafter','xmd-agi','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','rtpaudioqosloss','bridgepvtcallid','getCallerIdRandom','\x5cw{0,','pow','replace','extractCalleridName','match','noanswer','keys','variables','forEach','buildNoAnswerEventPayload','util','lodash','../../../../config/logger','preview','../../dialer/utils','error','inspect','logger2','info','getCallerId','isUndefined','string','isEmpty','\x22%s\x22\x20<%s>','format','\x22\x22\x20<>','isActive','isNil','addVariables','Queue','name','calleridname','calleridnum','VoiceQueueId','dialOriginateTimeout','\x22rtTxX%s%s\x22','dialQueueProject2','monitor_format','U(xcally-mixmonitor-context)','dialPreviewUrl','\x22agi://%s/square,%s\x22','dialQueueProject','NONE','originatecalleridname','xcally-motion-preview','_XCALLY_MIXMONITOR_FORMAT','toLower','updateOriginated','hasOwnProperty','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','state','Blacklist','starttime','responsetime','endtime','logAgent','statedesc','ringtime','getSeconds','logLookAgent','membername','UserId','logCustomer','talktime','answertime','isFailure','variablesAction','RECALL','BOOKED','uniqueid','originate','from-sip','timeout','totalGlobal','countnoanswerretry','countagentrejectretry','countnosuchnumberretry','clone','scheduledAt','scheduledat','add','ContactId','ListId','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','IsNotLoggedIn','lastevent','queue','interface','motionChannel','voice','mandatoryDisposition','buildObj','status','reachable','getDiff','milliseconds','diff','seconds','createBody','CampaignId','filterKey','type','campaigntype','channelAgent','active','countglobal','callback','callbackat','recallme','sipcallid','xmd-voicequeueid','xmd-queue','xmd-phone','xmd-listid','xmd-dialurl','xmd-dialtimeout'];(function(_0x1c5835,_0x20431a){var _0x558ebf=function(_0x2bc9da){while(--_0x2bc9da){_0x1c5835['push'](_0x1c5835['shift']());}};_0x558ebf(++_0x20431a);}(_0x8ba7,0x125));var _0x78ba=function(_0x2a2b3d,_0x30e6c9){_0x2a2b3d=_0x2a2b3d-0x0;var _0x5e4523=_0x8ba7[_0x2a2b3d];return _0x5e4523;};'use strict';var util=require(_0x78ba('0x0'));var _=require(_0x78ba('0x1'));var moment=require('moment');var logger=require(_0x78ba('0x2'))(_0x78ba('0x3'));var ipAgi=process['env']['XCALLY_IP_AGI']||'127.0.0.1';var utils=require(_0x78ba('0x4'));exports['loggerCatch']=function(_0x576dae){return function(_0xebab31){logger[_0x78ba('0x5')](_0x576dae,util[_0x78ba('0x6')](_0xebab31,{'showHidden':![],'depth':null}));};};exports['logger']=function(_0x5ca24a,_0xa2a5fe){logger['info'](_0x5ca24a,util[_0x78ba('0x6')](_0xa2a5fe,{'showHidden':![],'depth':null}));};exports['loggerError']=function(_0x3686a7,_0x469f9a){logger[_0x78ba('0x5')](_0x3686a7,util['inspect'](_0x469f9a,{'showHidden':![],'depth':null}));};exports[_0x78ba('0x7')]=function(_0x4bd5b4){return function(_0x5b7e85){logger[_0x78ba('0x8')](_0x4bd5b4,util['inspect'](_0x5b7e85,{'showHidden':![],'depth':null}));};};exports['message']=function(_0xb57694,_0x57a53a,_0x365f4e){return{'message':_0xb57694,'unlock':_0x57a53a,'active':_0x365f4e};};exports[_0x78ba('0x9')]=function(_0x5e8555,_0xd9164a,_0x4a0acb){if(!_[_0x78ba('0xa')](_0x4a0acb)&&_0x78ba('0xb')===typeof _0x4a0acb&&!_[_0x78ba('0xc')](_0x4a0acb)){if(!_['isUndefined'](_0xd9164a)&&_0x78ba('0xb')===typeof _0xd9164a&&!_[_0x78ba('0xc')](_0xd9164a)){return util['format'](_0x78ba('0xd'),_0xd9164a,_0x4a0acb);}return util[_0x78ba('0xe')](_0x78ba('0xd'),_0x4a0acb,_0x4a0acb);}if(!_['isUndefined'](_0x5e8555)&&_0x78ba('0xb')===typeof _0x5e8555&&!_['isEmpty'](_0x5e8555)){return _0x5e8555;}return _0x78ba('0xf');};exports[_0x78ba('0x10')]=function(_0x47ebf0){if(_[_0x78ba('0x11')](_0x47ebf0)){return![];}return _0x47ebf0;};exports[_0x78ba('0x12')]=function(_0x2ee5e6,_0xb13eb9,_0x278970,_0x78fcc8,_0xe3b12a,_0x58e4d9){var _0x1b3794={'XMD-QUEUE':_0xb13eb9[_0x78ba('0x13')]?_0xb13eb9['Queue'][_0x78ba('0x14')]:'','XMD-CALLERID':_0x78fcc8,'XMD-CALLERID-PREVIEW':_0x58e4d9?util[_0x78ba('0xe')]('\x22%s\x22\x20<%s>',_0x58e4d9[_0x78ba('0x15')],_0x58e4d9[_0x78ba('0x16')]):_0x78fcc8,'XMD-DIALID':_0xe3b12a,'XMD-CONTACTID':_0xb13eb9['ContactId'],'XMD-CDRTYPE':'dialer','CALLERID(all)':_0x78fcc8,'XMD-VOICEQUEUEID':_0xb13eb9[_0x78ba('0x17')],'XMD-DIALCHANNEL':_0x278970,'XMD-DIALTIMEOUT':_0x2ee5e6[_0x78ba('0x18')]||0x1e,'XMD-DIALOPTIONS':util[_0x78ba('0xe')](_0x78ba('0x19'),_0x2ee5e6[_0x78ba('0x1a')]?'g':'',_['isEmpty'](_0x2ee5e6[_0x78ba('0x1b')])?'':_0x78ba('0x1c')),'XMD-DIALURL':_0x2ee5e6[_0x78ba('0x1d')]||'','XMD-AGI':_0x2ee5e6['dialQueueProject']?util[_0x78ba('0xe')](_0x78ba('0x1e'),ipAgi,_0x2ee5e6[_0x78ba('0x1f')]):'NONE','XMD-AGIAFTER':_0x2ee5e6[_0x78ba('0x1a')]?util[_0x78ba('0xe')](_0x78ba('0x1e'),ipAgi,_0x2ee5e6[_0x78ba('0x1a')]):_0x78ba('0x20'),'XMD-ORIGINATECALLERIDNUM':_0x58e4d9?_0x58e4d9['originatecalleridnum']:'','XMD-ORIGINATECALLERIDNAME':_0x58e4d9?_0x58e4d9[_0x78ba('0x21')]:'','XMD-DESTINATION':_0x78ba('0x22'),'SIPADDHEADER':'Call-Type:\x20PREVIEW'};if(!_[_0x78ba('0xc')](_0x2ee5e6[_0x78ba('0x1b')])){_0x1b3794[util[_0x78ba('0xe')]('%s',_0x78ba('0x23'))]=_0x2ee5e6[_0x78ba('0x1b')];_0x1b3794[util[_0x78ba('0xe')]('%s','_XCALLY_MIXMONITOR_UNIQUEID')]=_0xe3b12a;}return _0x1b3794;};exports['toLowerVariables']=function(_0x4e270e){var _0x1b1ec8={};for(var _0x5d87b8 in _0x4e270e){if(_0x4e270e['hasOwnProperty'](_0x5d87b8)){_0x1b1ec8[util['format']('%s',_[_0x78ba('0x24')](_0x5d87b8))]=_0x4e270e[_0x5d87b8];}}return{'variables':_0x1b1ec8};};exports[_0x78ba('0x25')]=function(_0x5eee36,_0x361e15){if(!_[_0x78ba('0x11')](_0x5eee36)){if(_0x5eee36[_0x78ba('0x26')](_0x78ba('0x27'))){if(_0x5eee36[_0x78ba('0x27')]>0x0){_0x5eee36[_0x78ba('0x27')]-=0x1;}else{logger['error'](_0x78ba('0x28'),_0x361e15);}}}else{logger[_0x78ba('0x5')](_0x78ba('0x29'),_0x361e15);}};exports[_0x78ba('0x2a')]=function(_0x398bcd){var _0x4131b2=moment()[_0x78ba('0xe')](_0x78ba('0x2b'));_0x398bcd[_0x78ba('0x2c')]=0xd;_0x398bcd['statedesc']=_0x78ba('0x2d');_0x398bcd[_0x78ba('0x2e')]=_0x4131b2;_0x398bcd[_0x78ba('0x2f')]=_0x4131b2;_0x398bcd[_0x78ba('0x30')]=_0x4131b2;};exports[_0x78ba('0x31')]=function(_0x563fa0,_0x251ace,_0x5709e8){var _0x3880fb=moment()[_0x78ba('0xe')](_0x78ba('0x2b'));_0x563fa0['state']=_0x251ace;_0x563fa0[_0x78ba('0x32')]=_0x5709e8;_0x563fa0[_0x78ba('0x2f')]=_0x3880fb;_0x563fa0[_0x78ba('0x33')]=utils[_0x78ba('0x34')](_0x563fa0[_0x78ba('0x2f')],_0x563fa0[_0x78ba('0x2e')]);};exports[_0x78ba('0x35')]=function(_0x42d365,_0x1ee7a0,_0x4a31a5){_0x42d365[_0x78ba('0x36')]=_0x1ee7a0;_0x42d365[_0x78ba('0x37')]=_0x4a31a5;};exports[_0x78ba('0x38')]=function(_0x5a2b9d,_0x3b7d17,_0x37d73a){var _0x116a9e=moment()[_0x78ba('0xe')]('YYYY-MM-DD\x20HH:mm:ss');_0x5a2b9d['state']=_0x3b7d17;_0x5a2b9d[_0x78ba('0x32')]=_0x37d73a;_0x5a2b9d['responsetime']=_0x5a2b9d[_0x78ba('0x2f')]?_0x5a2b9d[_0x78ba('0x2f')]:_0x116a9e;_0x5a2b9d[_0x78ba('0x30')]=_0x5a2b9d[_0x78ba('0x30')]?_0x5a2b9d[_0x78ba('0x30')]:_0x116a9e;_0x5a2b9d[_0x78ba('0x33')]=utils[_0x78ba('0x34')](_0x5a2b9d[_0x78ba('0x2f')]||0x0,_0x5a2b9d[_0x78ba('0x2e')]||0x0);_0x5a2b9d[_0x78ba('0x39')]=_0x5a2b9d[_0x78ba('0x3a')]?utils['getSeconds'](_0x5a2b9d[_0x78ba('0x30')],_0x5a2b9d['answertime']):0x0;};exports[_0x78ba('0x3b')]=function(_0x39c138){return _0x39c138==='Failure';};exports[_0x78ba('0x3c')]=function(_0x16ea47,_0x1c5ce4,_0x5b3888,_0xf2f738,_0x1dfc7a){var _0x56caa4=_0xf2f738?_0x78ba('0x3d'):_0x16ea47[_0x78ba('0x15')];_0x56caa4=_0x1dfc7a?_0x78ba('0x3e'):_0x56caa4;return{'actionid':_0x16ea47[_0x78ba('0x3f')],'action':_0x78ba('0x40'),'channel':_0x16ea47['channelAgent'],'callerid':util[_0x78ba('0xe')]('\x22%s\x22\x20<%s>',_0x56caa4,_0x16ea47[_0x78ba('0x16')]),'Exten':_0x78ba('0x22'),'Context':_0x78ba('0x41'),'Priority':'1','variable':_0x5b3888,'timeout':(_0x1c5ce4[_0x78ba('0x42')]||0x1e)*0x3e8,'async':!![],'channelid':_0x16ea47['uniqueid']};};exports[_0x78ba('0x43')]=function(_0x4f6c69){return _0x4f6c69['countbusyretry']+_0x4f6c69['countcongestionretry']+_0x4f6c69[_0x78ba('0x44')]+_0x4f6c69[_0x78ba('0x45')]+_0x4f6c69[_0x78ba('0x46')];};exports['cloneAction']=function(_0x30ca67){var _0x5bc6cf=_[_0x78ba('0x47')](_0x30ca67);_0x5bc6cf[_0x78ba('0x2c')]=0xf;_0x5bc6cf['statedesc']='Global';return _0x5bc6cf;};exports[_0x78ba('0x48')]=function(_0x5f0cb9,_0x1d95dc,_0x184fd3){var _0x1c18f2={};_0x1c18f2[_0x1d95dc]=_0x5f0cb9[_0x1d95dc];_0x1c18f2['active']=![];_0x1c18f2[_0x78ba('0x49')]=moment()[_0x78ba('0x4a')](_0x184fd3,'minutes')['format']('YYYY-MM-DD\x20HH:mm:ss');_0x1c18f2[_0x78ba('0x4b')]=_0x5f0cb9[_0x78ba('0x4b')];_0x1c18f2[_0x78ba('0x4c')]=_0x5f0cb9['ListId'];_0x1c18f2['VoiceQueueId']=_0x5f0cb9[_0x78ba('0x17')]||undefined;return _0x1c18f2;};exports['decrementTalkink']=function(_0x1d42bd,_0x104a93){if(!_[_0x78ba('0x11')](_0x1d42bd)){if(_0x1d42bd[_0x78ba('0x4d')]>0x0){_0x1d42bd[_0x78ba('0x4d')]-=0x1;}else{logger['error'](_0x104a93,_0x78ba('0x4e'));}}else{logger[_0x78ba('0x5')](_0x104a93,_0x78ba('0x4f'));}};exports[_0x78ba('0x50')]=function(_0x3f6186){if(_0x3f6186<=0x0){return!![];}return![];};function buildObj(_0x1f28d0,_0x5c5e67,_0x4cbb18){_0x1f28d0[_0x78ba('0x51')]=_0x5c5e67;_0x1f28d0[_0x78ba('0x14')]=_0x1f28d0[_0x78ba('0x52')];_0x1f28d0[_0x78ba('0x53')]=_0x1f28d0['channelAgent'];_0x1f28d0[_0x78ba('0x54')]=_0x78ba('0x55');if(_0x4cbb18){_0x1f28d0[_0x78ba('0x56')]=_0x4cbb18[_0x78ba('0x56')];}return _0x1f28d0;}exports[_0x78ba('0x57')]=buildObj;exports['agentReadyId']=function(_0x5c7b33){var _0x4f0129=[];for(var _0x5bd029 in _0x5c7b33){if(_0x5c7b33[_0x78ba('0x26')](_0x5bd029)){if(!_[_0x78ba('0x11')](_0x5c7b33[_0x5bd029])&&_0x5c7b33[_0x5bd029][_0x78ba('0x2c')]==='not_inuse'&&_0x5c7b33[_0x5bd029][_0x78ba('0x58')]===_0x78ba('0x59')){_0x4f0129['push'](_0x5c7b33[_0x5bd029]['id']);}}}return _0x4f0129;};exports[_0x78ba('0x5a')]=function(_0xef5f1b){var _0x588d27=moment()[_0x78ba('0x5b')](0x0);var _0x467f52=moment(_0xef5f1b)[_0x78ba('0x5b')](0x0);return _0x588d27[_0x78ba('0x5c')](_0x467f52,_0x78ba('0x5d'));};exports[_0x78ba('0x5e')]=function(_0x3eaebc){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x3eaebc['ContactId'],'ListId':_0x3eaebc['ListId'],'VoiceQueueId':_0x3eaebc[_0x78ba('0x17')]||undefined,'CampaignId':_0x3eaebc[_0x78ba('0x5f')]||undefined};};exports[_0x78ba('0x60')]=function(_0x2aad00){if(_0x2aad00===_0x78ba('0x3f')||_0x2aad00==='idContact'||_0x2aad00===_0x78ba('0x52')||_0x2aad00===_0x78ba('0x61')||_0x2aad00===_0x78ba('0x62')||_0x2aad00==='dialAnswer'||_0x2aad00===_0x78ba('0x36')||_0x2aad00===_0x78ba('0x63')||_0x2aad00===_0x78ba('0x15')||_0x2aad00===_0x78ba('0x64')||_0x2aad00==='calleridnum'||_0x2aad00===_0x78ba('0x49')||_0x2aad00==='countbusyretry'||_0x2aad00==='countcongestionretry'||_0x2aad00===_0x78ba('0x44')||_0x2aad00===_0x78ba('0x65')||_0x2aad00===_0x78ba('0x66')||_0x2aad00==='callbackuniqueid'||_0x2aad00===_0x78ba('0x67')||_0x2aad00===_0x78ba('0x68')||_0x2aad00==='ContactId'||_0x2aad00===_0x78ba('0x4c')||_0x2aad00===_0x78ba('0x37')||_0x2aad00===_0x78ba('0x17')||_0x2aad00===_0x78ba('0x69')||_0x2aad00===_0x78ba('0x6a')||_0x2aad00===_0x78ba('0x6b')||_0x2aad00===_0x78ba('0x6c')||_0x2aad00===_0x78ba('0x6d')||_0x2aad00===_0x78ba('0x6e')||_0x2aad00===_0x78ba('0x6f')||_0x2aad00===_0x78ba('0x70')||_0x2aad00==='xmd-dialid'||_0x2aad00==='xmd-dialchannel'||_0x2aad00==='xmd-contactid'||_0x2aad00==='xmd-cdrtype'||_0x2aad00===_0x78ba('0x71')||_0x2aad00===_0x78ba('0x72')||_0x2aad00===_0x78ba('0x73')||_0x2aad00==='rtpaudioqos'||_0x2aad00===_0x78ba('0x74')||_0x2aad00===_0x78ba('0x75')||_0x2aad00===_0x78ba('0x76')||_0x2aad00==='rtpaudioqosloss'||_0x2aad00===_0x78ba('0x77')||_0x2aad00===_0x78ba('0x78')||_0x2aad00===_0x78ba('0x79')||_0x2aad00==='rtpaudioqos'||_0x2aad00===_0x78ba('0x74')||_0x2aad00===_0x78ba('0x75')||_0x2aad00==='rtpaudioqosjitterbridged'||_0x2aad00===_0x78ba('0x7a')||_0x2aad00===_0x78ba('0x77')||_0x2aad00===_0x78ba('0x78')||_0x2aad00===_0x78ba('0x79')||_0x2aad00==='bridgepeer'||_0x2aad00===_0x78ba('0x7b')||_0x2aad00===_0x78ba('0x2c')||_0x2aad00==='statedesc'){return![];}return!![];};exports[_0x78ba('0x7c')]=function(_0x254199,_0x40cee2){var _0x588ec3,_0xa49637,_0x5d807c;if(_0x40cee2<=0x0){_0x40cee2=0x1;}_0x588ec3=new RegExp(_0x78ba('0x7d')+_0x40cee2+'}$');_0xa49637=Math[_0x78ba('0x7e')](0xa,_0x40cee2-0x1);_0x5d807c=Math[_0x78ba('0x7e')](0xa,_0x40cee2)-0x1;return util['format']('%s',_[_0x78ba('0x7f')](_0x254199,_0x588ec3,_['random'](_0xa49637,_0x5d807c)));};exports[_0x78ba('0x80')]=function(_0x186b4e){var _0x90e33c=_0x186b4e[_0x78ba('0x81')](/"(.*?)"/);return _0x90e33c?_0x90e33c[0x1]:_0x186b4e;};exports['extractCalleridNumber']=function(_0x3a8c1f){var _0x53f7d6=_0x3a8c1f[_0x78ba('0x81')](/<(.*?)>/);return _0x53f7d6?_0x53f7d6[0x1]:_0x3a8c1f;};function buildNoAnswerEventPayload(_0x542ae1,_0x11f1a1){var _0x43b26c=buildObj(_0x542ae1,_0x78ba('0x82'));if(!_['isEmpty'](_0x11f1a1['variables'])){Object[_0x78ba('0x83')](_0x11f1a1[_0x78ba('0x84')])[_0x78ba('0x85')](function(_0x33277b){_0x43b26c[_0x33277b['toLowerCase']()]=_0x11f1a1['variables'][_0x33277b];});}return _0x43b26c;}exports[_0x78ba('0x86')]=buildNoAnswerEventPayload; \ No newline at end of file diff --git a/server/services/ami/properties.js b/server/services/ami/properties.js index b9f35dc..eebe7e4 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 _0xa837=['boolean','queueremove','queuepause','reload','voicequeuechannel','voicechannel','voicequeuechannelhangup','queueadd','string','number'];(function(_0x328b35,_0x38a3c3){var _0x2f6a95=function(_0x5be3b6){while(--_0x5be3b6){_0x328b35['push'](_0x328b35['shift']());}};_0x2f6a95(++_0x38a3c3);}(_0xa837,0x1d3));var _0x7a83=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xa837[_0x20a584];return _0x4b41a8;};'use strict';exports[_0x7a83('0x0')]={'queue':{'type':'string','required':!![]},'interface':{'type':_0x7a83('0x1'),'required':!![]},'membername':{'type':_0x7a83('0x1'),'required':!![]},'penalty':{'type':_0x7a83('0x2'),'required':![]},'paused':{'type':_0x7a83('0x3'),'required':![]}};exports[_0x7a83('0x4')]={'queue':{'type':_0x7a83('0x1'),'required':!![]},'interface':{'type':_0x7a83('0x1'),'required':!![]}};exports[_0x7a83('0x5')]={'interface':{'type':_0x7a83('0x1'),'required':!![]},'paused':{'type':_0x7a83('0x3')},'reason':{'type':_0x7a83('0x1'),'required':![]}};exports[_0x7a83('0x6')]={'module':{'type':_0x7a83('0x1'),'required':![]}};exports[_0x7a83('0x7')]={'uniqueid':{'type':'string','required':!![]}};exports[_0x7a83('0x8')]={'uniqueid':{'type':_0x7a83('0x1'),'required':!![]},'filename':{'type':_0x7a83('0x1')},'format':{'type':_0x7a83('0x1')},'mixmonitorid':{'type':'string'}};exports[_0x7a83('0x9')]={'uniqueid':{'type':'string','required':!![]}};exports['voicequeuechannelredirect']={'uniqueid':{'type':_0x7a83('0x1'),'required':!![]},'exten':{'type':_0x7a83('0x1'),'required':!![]},'context':{'type':_0x7a83('0x1')}}; \ No newline at end of file +var _0x28b3=['voicequeuechannel','voicechannel','voicequeuechannelhangup','voicequeuechannelredirect','queueadd','string','number','boolean','queuepause','reload'];(function(_0x1c1c7d,_0x542705){var _0x3da448=function(_0x522cc5){while(--_0x522cc5){_0x1c1c7d['push'](_0x1c1c7d['shift']());}};_0x3da448(++_0x542705);}(_0x28b3,0x108));var _0x328b=function(_0x2716f6,_0x4c7677){_0x2716f6=_0x2716f6-0x0;var _0x215ef9=_0x28b3[_0x2716f6];return _0x215ef9;};'use strict';exports[_0x328b('0x0')]={'queue':{'type':'string','required':!![]},'interface':{'type':_0x328b('0x1'),'required':!![]},'membername':{'type':_0x328b('0x1'),'required':!![]},'penalty':{'type':_0x328b('0x2'),'required':![]},'paused':{'type':_0x328b('0x3'),'required':![]}};exports['queueremove']={'queue':{'type':_0x328b('0x1'),'required':!![]},'interface':{'type':_0x328b('0x1'),'required':!![]}};exports[_0x328b('0x4')]={'interface':{'type':'string','required':!![]},'paused':{'type':_0x328b('0x3')},'reason':{'type':_0x328b('0x1'),'required':![]}};exports[_0x328b('0x5')]={'module':{'type':_0x328b('0x1'),'required':![]}};exports[_0x328b('0x6')]={'uniqueid':{'type':_0x328b('0x1'),'required':!![]}};exports[_0x328b('0x7')]={'uniqueid':{'type':_0x328b('0x1'),'required':!![]},'filename':{'type':_0x328b('0x1')},'format':{'type':_0x328b('0x1')},'mixmonitorid':{'type':_0x328b('0x1')}};exports[_0x328b('0x8')]={'uniqueid':{'type':_0x328b('0x1'),'required':!![]}};exports[_0x328b('0x9')]={'uniqueid':{'type':'string','required':!![]},'exten':{'type':_0x328b('0x1'),'required':!![]},'context':{'type':'string'}}; \ No newline at end of file diff --git a/server/services/ami/realtime/index.js b/server/services/ami/realtime/index.js index 8a61e63..050a402 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 _0x5f66=['diff','seconds','disposition','ANSWERED','outbound','duration','billableseconds','initCampaigns','campaigns','dialQueueProject','SquareProject','voiceExtensions','initCampaignHopperHistory','initFaxAccounts','initVoiceQueues','exports','moment','../model/agent','../model/telephone','../model/trunk','../model/voiceQueue','../model/trigger','../model/campaign','../model/zendeskAccount','../model/salesforceAccount','../model/zohoAccount','../model/deskAccount','../model/vtigerAccount','../model/servicenowAccount','../model/dynamics365Account','../model/freshsalesAccount','telephones','trunks','voiceQueues','triggers','templates','channels','outboundChannels','settings','zendeskAccounts','salesforceAccounts','sugarcrmAccounts','freshdeskAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','faxAccounts','mapKeys','hasOwnProperty','isNil','format','interface','total','answered','sumHoldTime','sumBillable','isEmpty','ivrAnswerCallsDay','unmanaged','abandoned','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundDropCallsDayTimeout','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundAnswerCallsDay','queueStatusComplete','prototype','mergeFromDatabase','initAgents','agents','length','name','isUndefined','initTelephones','SIP/%s','initTriggers','initSalesforceAccounts','initFreshdeskAccounts','initDeskAccounts','initSugarcrmAccounts','initVtigerAccounts','initServicenowAccounts','freshsalesAccounts','initVoiceQueueHopperHistory','initVoiceQueueReports','groupBy','queuecallerexit','queuecallerabandon','queuecallerleaveAt','queuecallerjoinAt','sumDuration','queuecallercompleteAt','queuecallerexitAt'];(function(_0x3babbf,_0x1db3b9){var _0x463d9e=function(_0xde0b8d){while(--_0xde0b8d){_0x3babbf['push'](_0x3babbf['shift']());}};_0x463d9e(++_0x1db3b9);}(_0x5f66,0x1a0));var _0x65f6=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x5f66[_0x432682];return _0x463d05;};'use strict';var _=require('lodash');var moment=require(_0x65f6('0x0'));var util=require('util');var Agent=require(_0x65f6('0x1'));var Telephone=require(_0x65f6('0x2'));var Trunk=require(_0x65f6('0x3'));var VoiceQueue=require(_0x65f6('0x4'));var Trigger=require(_0x65f6('0x5'));var Template=require('../model/template');var Campaign=require(_0x65f6('0x6'));var VoiceExtension=require('../model/voiceExtension');var ZendeskAccount=require(_0x65f6('0x7'));var SalesforceAccount=require(_0x65f6('0x8'));var FreshdeskAccount=require('../model/freshdeskAccount');var SugarcrmAccount=require('../model/sugarcrmAccount');var ZohoAccount=require(_0x65f6('0x9'));var DeskAccount=require(_0x65f6('0xa'));var VtigerAccount=require(_0x65f6('0xb'));var ServicenowAccount=require(_0x65f6('0xc'));var Dynamics365Account=require(_0x65f6('0xd'));var FreshsalesAccount=require(_0x65f6('0xe'));var FaxAccount=require('../model/faxAccount');function Realtime(){this['agents']={};this[_0x65f6('0xf')]={};this[_0x65f6('0x10')]={};this[_0x65f6('0x11')]={};this[_0x65f6('0x12')]={};this['campaigns']={};this[_0x65f6('0x13')]={};this['outbound']={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this['voiceExtensions']={};this[_0x65f6('0x14')]={};this['queueChannels']={};this[_0x65f6('0x15')]={};this['timers']={};this[_0x65f6('0x16')]={};this[_0x65f6('0x17')]={};this[_0x65f6('0x18')]={};this[_0x65f6('0x19')]={};this[_0x65f6('0x1a')]={};this[_0x65f6('0x1b')]={};this[_0x65f6('0x1c')]={};this[_0x65f6('0x1d')]={};this[_0x65f6('0x1e')]={};this[_0x65f6('0x1f')]={};this['freshsalesAccounts']={};this[_0x65f6('0x20')]={};}function freeIsNotKey(_0x49a913,_0x5dd324,_0x1693e6){var _0x5c69f8=_[_0x65f6('0x21')](_0x49a913,function(_0x1c955c){return _0x1c955c[_0x1693e6];});for(var _0x1b1cbb in _0x5dd324){if(_0x5dd324[_0x65f6('0x22')](_0x1b1cbb)){if(!_0x5c69f8[_0x1b1cbb]){delete _0x5dd324[_0x1b1cbb];}}}}function freeIsNotKeySip(_0xc8660c,_0x18380e){var _0x495dd6=_['mapKeys'](_0xc8660c,function(_0x2d538c){return util['format']('SIP/%s',_0x2d538c['name']);});for(var _0x365159 in _0x18380e){if(_0x18380e[_0x65f6('0x22')](_0x365159)){if(!_0x495dd6[_0x365159]){delete _0x18380e[_0x365159];}}}}function freeIsNotKeyAgent(_0x5114a4,_0x39e19f){var _0x270893=_[_0x65f6('0x21')](_0x5114a4,function(_0x3876ed){var _0x219ab2=_[_0x65f6('0x23')](_0x3876ed['interface'])?util[_0x65f6('0x24')]('SIP/%s',_0x3876ed['name']):_0x3876ed[_0x65f6('0x25')];return _0x219ab2;});for(var _0xd173f4 in _0x39e19f){if(_0x39e19f['hasOwnProperty'](_0xd173f4)){if(!_0x270893[_0xd173f4]){delete _0x39e19f[_0xd173f4];}}}}function clearVoiceCallReports(_0x1eeaaa){_0x1eeaaa[_0x65f6('0x26')]=0x0;_0x1eeaaa[_0x65f6('0x27')]=0x0;_0x1eeaaa[_0x65f6('0x28')]=0x0;_0x1eeaaa['sumDuration']=0x0;_0x1eeaaa[_0x65f6('0x29')]=0x0;}function clearCampaigns(_0x59ea32){if(!_[_0x65f6('0x2a')](_0x59ea32)){for(var _0x5963e0 in _0x59ea32){if(_0x59ea32['hasOwnProperty'](_0x5963e0)){_0x59ea32[_0x5963e0]['ivrTotalCallsDays']=0x0;_0x59ea32[_0x5963e0][_0x65f6('0x2b')]=0x0;}}}}function clearVoiceQueues(_0x16cde8){if(!_['isEmpty'](_0x16cde8)){for(var _0x296cd9 in _0x16cde8){if(_0x16cde8[_0x65f6('0x22')](_0x296cd9)){_0x16cde8[_0x296cd9]['total']=0x0;_0x16cde8[_0x296cd9][_0x65f6('0x27')]=0x0;_0x16cde8[_0x296cd9][_0x65f6('0x2c')]=0x0;_0x16cde8[_0x296cd9][_0x65f6('0x2d')]=0x0;_0x16cde8[_0x296cd9]['sumHoldTime']=0x0;_0x16cde8[_0x296cd9]['sumDuration']=0x0;_0x16cde8[_0x296cd9]['sumBillable']=0x0;_0x16cde8[_0x296cd9][_0x65f6('0x2e')]=0x0;_0x16cde8[_0x296cd9][_0x65f6('0x2f')]=0x0;_0x16cde8[_0x296cd9][_0x65f6('0x30')]=0x0;_0x16cde8[_0x296cd9][_0x65f6('0x31')]=0x0;_0x16cde8[_0x296cd9][_0x65f6('0x32')]=0x0;_0x16cde8[_0x296cd9][_0x65f6('0x33')]=0x0;_0x16cde8[_0x296cd9][_0x65f6('0x34')]=0x0;_0x16cde8[_0x296cd9]['outboundDropCallsDayCallersExit']=0x0;_0x16cde8[_0x296cd9]['outboundBlacklistCallsDay']=0x0;_0x16cde8[_0x296cd9][_0x65f6('0x35')]=0x0;_0x16cde8[_0x296cd9][_0x65f6('0x36')]=0x0;_0x16cde8[_0x296cd9]['outboundReCallsDay']=0x0;_0x16cde8[_0x296cd9]['outboundAnswerAgiCallsDay']=0x0;_0x16cde8[_0x296cd9][_0x65f6('0x37')]=0x0;_0x16cde8[_0x296cd9][_0x65f6('0x38')]=!![];}}}}Realtime[_0x65f6('0x39')][_0x65f6('0x3a')]=function(_0x1217fd,_0x2d32be){for(var _0x5792a0 in _0x2d32be){if(_0x1217fd[_0x65f6('0x22')](_0x5792a0)){_0x1217fd[_0x5792a0]=_0x2d32be[_0x5792a0];}}};Realtime[_0x65f6('0x39')][_0x65f6('0x3b')]=function(){var _0x4bc037=this;return function(_0x217f35){if(_0x217f35){freeIsNotKeyAgent(_0x217f35,_0x4bc037[_0x65f6('0x3c')]);for(var _0xbaed3c=0x0,_0x45510a={};_0xbaed3c<_0x217f35[_0x65f6('0x3d')];_0xbaed3c+=0x1){_0x45510a=_0x217f35[_0xbaed3c];var _0x2f054c=_['isNil'](_0x45510a[_0x65f6('0x25')])?util[_0x65f6('0x24')]('SIP/%s',_0x45510a[_0x65f6('0x3e')]):_0x45510a['interface'];if(_[_0x65f6('0x3f')](_0x4bc037['agents'][_0x2f054c])){_0x4bc037[_0x65f6('0x3c')][_0x2f054c]=new Agent(_0x45510a);}else{_0x4bc037[_0x65f6('0x3a')](_0x4bc037['agents'][_0x2f054c],_0x45510a);}}}return _0x4bc037[_0x65f6('0x3c')];};};Realtime[_0x65f6('0x39')][_0x65f6('0x40')]=function(){var _0x515648=this;return function(_0x582c7e){if(_0x582c7e){freeIsNotKeySip(_0x582c7e,_0x515648[_0x65f6('0xf')]);for(var _0x4c0df4=0x0,_0x26de30={};_0x4c0df4<_0x582c7e['length'];_0x4c0df4+=0x1){_0x26de30=_0x582c7e[_0x4c0df4];if(_[_0x65f6('0x3f')](_0x515648[_0x65f6('0xf')][util['format'](_0x65f6('0x41'),_0x26de30['name'])])){_0x515648['telephones'][util[_0x65f6('0x24')](_0x65f6('0x41'),_0x26de30[_0x65f6('0x3e')])]=new Telephone(_0x26de30);}else{_0x515648[_0x65f6('0x3a')](_0x515648[_0x65f6('0xf')][util[_0x65f6('0x24')](_0x65f6('0x41'),_0x26de30[_0x65f6('0x3e')])],_0x26de30);}}}return _0x515648['telephones'];};};Realtime[_0x65f6('0x39')]['initTrunks']=function(){var _0x12a589=this;return function(_0xa4394a){if(_0xa4394a){freeIsNotKeySip(_0xa4394a,_0x12a589[_0x65f6('0x10')]);for(var _0x2ea7f7=0x0,_0x5ef5c2={};_0x2ea7f7<_0xa4394a[_0x65f6('0x3d')];_0x2ea7f7+=0x1){_0x5ef5c2=_0xa4394a[_0x2ea7f7];if(_[_0x65f6('0x3f')](_0x12a589[_0x65f6('0x10')][util[_0x65f6('0x24')](_0x65f6('0x41'),_0x5ef5c2[_0x65f6('0x3e')])])){_0x12a589[_0x65f6('0x10')][util[_0x65f6('0x24')](_0x65f6('0x41'),_0x5ef5c2['name'])]=new Trunk(_0x5ef5c2);}else{_0x12a589[_0x65f6('0x3a')](_0x12a589[_0x65f6('0x10')][util[_0x65f6('0x24')](_0x65f6('0x41'),_0x5ef5c2[_0x65f6('0x3e')])],_0x5ef5c2);}}}return _0x12a589[_0x65f6('0x10')];};};Realtime[_0x65f6('0x39')][_0x65f6('0x42')]=function(){var _0x461393=this;return function(_0x2abbed){if(_0x2abbed){freeIsNotKey(_0x2abbed,_0x461393[_0x65f6('0x12')],'id');for(var _0x2c008a=0x0,_0x6c4d94={};_0x2c008a<_0x2abbed[_0x65f6('0x3d')];_0x2c008a+=0x1){_0x6c4d94=_0x2abbed[_0x2c008a];if(_[_0x65f6('0x3f')](_0x461393[_0x65f6('0x12')][_0x6c4d94['id']])){_0x461393['triggers'][_0x6c4d94['id']]=new Trigger(_0x6c4d94);}else{_0x461393[_0x65f6('0x3a')](_0x461393[_0x65f6('0x12')][_0x6c4d94['id']],_0x6c4d94);}}}return _0x461393[_0x65f6('0x12')];};};Realtime[_0x65f6('0x39')]['initTemplates']=function(){var _0x1bf5bf=this;return function(_0x2d0dac){if(_0x2d0dac){freeIsNotKey(_0x2d0dac,_0x1bf5bf[_0x65f6('0x13')],'id');for(var _0x5e69b4=0x0,_0x2dbab3={};_0x5e69b4<_0x2d0dac[_0x65f6('0x3d')];_0x5e69b4+=0x1){_0x2dbab3=_0x2d0dac[_0x5e69b4];if(_[_0x65f6('0x3f')](_0x1bf5bf[_0x65f6('0x13')][_0x2dbab3['id']])){_0x1bf5bf['templates'][_0x2dbab3['id']]=new Template(_0x2dbab3);}else{_0x1bf5bf[_0x65f6('0x3a')](_0x1bf5bf['templates'][_0x2dbab3['id']],_0x2dbab3);}}}return _0x1bf5bf[_0x65f6('0x13')];};};Realtime[_0x65f6('0x39')]['initZendeskAccounts']=function(){var _0xf754ee=this;return function(_0x5085db){if(_0x5085db){freeIsNotKey(_0x5085db,_0xf754ee[_0x65f6('0x17')],'id');for(var _0x4d9b76=0x0,_0x2d1706={};_0x4d9b76<_0x5085db[_0x65f6('0x3d')];_0x4d9b76+=0x1){_0x2d1706=_0x5085db[_0x4d9b76];if(_[_0x65f6('0x3f')](_0xf754ee[_0x65f6('0x17')][_0x2d1706['id']])){_0xf754ee['zendeskAccounts'][_0x2d1706['id']]=new ZendeskAccount(_0x2d1706);}else{_0xf754ee['mergeFromDatabase'](_0xf754ee[_0x65f6('0x17')][_0x2d1706['id']],_0x2d1706);}}}return _0xf754ee[_0x65f6('0x17')];};};Realtime[_0x65f6('0x39')][_0x65f6('0x43')]=function(){var _0x3b907c=this;return function(_0x2d6ab9){if(_0x2d6ab9){freeIsNotKey(_0x2d6ab9,_0x3b907c[_0x65f6('0x18')],'id');for(var _0x41690c=0x0,_0x414f49={};_0x41690c<_0x2d6ab9['length'];_0x41690c+=0x1){_0x414f49=_0x2d6ab9[_0x41690c];if(_[_0x65f6('0x3f')](_0x3b907c[_0x65f6('0x18')][_0x414f49['id']])){_0x3b907c[_0x65f6('0x18')][_0x414f49['id']]=new SalesforceAccount(_0x414f49);}else{_0x3b907c['mergeFromDatabase'](_0x3b907c[_0x65f6('0x18')][_0x414f49['id']],_0x414f49);}}}return _0x3b907c[_0x65f6('0x18')];};};Realtime['prototype'][_0x65f6('0x44')]=function(){var _0x253d52=this;return function(_0x57eb04){if(_0x57eb04){freeIsNotKey(_0x57eb04,_0x253d52[_0x65f6('0x1a')],'id');for(var _0x4f96c4=0x0,_0x247be3={};_0x4f96c4<_0x57eb04[_0x65f6('0x3d')];_0x4f96c4+=0x1){_0x247be3=_0x57eb04[_0x4f96c4];if(_[_0x65f6('0x3f')](_0x253d52['freshdeskAccounts'][_0x247be3['id']])){_0x253d52[_0x65f6('0x1a')][_0x247be3['id']]=new FreshdeskAccount(_0x247be3);}else{_0x253d52[_0x65f6('0x3a')](_0x253d52['freshdeskAccounts'][_0x247be3['id']],_0x247be3);}}}return _0x253d52[_0x65f6('0x1a')];};};Realtime[_0x65f6('0x39')]['initZohoAccounts']=function(){var _0x34d6a9=this;return function(_0x344c0e){if(_0x344c0e){freeIsNotKey(_0x344c0e,_0x34d6a9[_0x65f6('0x1b')],'id');for(var _0x25d504=0x0,_0x234fa7={};_0x25d504<_0x344c0e[_0x65f6('0x3d')];_0x25d504+=0x1){_0x234fa7=_0x344c0e[_0x25d504];if(_[_0x65f6('0x3f')](_0x34d6a9[_0x65f6('0x1b')][_0x234fa7['id']])){_0x34d6a9['zohoAccounts'][_0x234fa7['id']]=new ZohoAccount(_0x234fa7);}else{_0x34d6a9['mergeFromDatabase'](_0x34d6a9['zohoAccounts'][_0x234fa7['id']],_0x234fa7);}}}return _0x34d6a9[_0x65f6('0x1b')];};};Realtime[_0x65f6('0x39')][_0x65f6('0x45')]=function(){var _0x20c322=this;return function(_0x545445){if(_0x545445){freeIsNotKey(_0x545445,_0x20c322[_0x65f6('0x1c')],'id');for(var _0x2032b9=0x0,_0x9ff849={};_0x2032b9<_0x545445['length'];_0x2032b9+=0x1){_0x9ff849=_0x545445[_0x2032b9];if(_[_0x65f6('0x3f')](_0x20c322[_0x65f6('0x1c')][_0x9ff849['id']])){_0x20c322[_0x65f6('0x1c')][_0x9ff849['id']]=new DeskAccount(_0x9ff849);}else{_0x20c322['mergeFromDatabase'](_0x20c322['deskAccounts'][_0x9ff849['id']],_0x9ff849);}}}return _0x20c322[_0x65f6('0x1c')];};};Realtime[_0x65f6('0x39')][_0x65f6('0x46')]=function(){var _0x39364f=this;return function(_0x2a76b3){if(_0x2a76b3){freeIsNotKey(_0x2a76b3,_0x39364f[_0x65f6('0x19')],'id');for(var _0x35d77f=0x0,_0x138334={};_0x35d77f<_0x2a76b3[_0x65f6('0x3d')];_0x35d77f+=0x1){_0x138334=_0x2a76b3[_0x35d77f];if(_[_0x65f6('0x3f')](_0x39364f[_0x65f6('0x19')][_0x138334['id']])){_0x39364f[_0x65f6('0x19')][_0x138334['id']]=new SugarcrmAccount(_0x138334);}else{_0x39364f[_0x65f6('0x3a')](_0x39364f[_0x65f6('0x19')][_0x138334['id']],_0x138334);}}}return _0x39364f['sugarcrmAccounts'];};};Realtime[_0x65f6('0x39')][_0x65f6('0x47')]=function(){var _0x42a805=this;return function(_0x4b4efe){if(_0x4b4efe){freeIsNotKey(_0x4b4efe,_0x42a805[_0x65f6('0x1d')],'id');for(var _0x16dec0=0x0,_0x4638c9={};_0x16dec0<_0x4b4efe[_0x65f6('0x3d')];_0x16dec0+=0x1){_0x4638c9=_0x4b4efe[_0x16dec0];if(_['isUndefined'](_0x42a805[_0x65f6('0x1d')][_0x4638c9['id']])){_0x42a805[_0x65f6('0x1d')][_0x4638c9['id']]=new VtigerAccount(_0x4638c9);}else{_0x42a805[_0x65f6('0x3a')](_0x42a805[_0x65f6('0x1d')][_0x4638c9['id']],_0x4638c9);}}}return _0x42a805['vtigerAccounts'];};};Realtime[_0x65f6('0x39')][_0x65f6('0x48')]=function(){var _0x5c55e4=this;return function(_0x28682b){if(_0x28682b){freeIsNotKey(_0x28682b,_0x5c55e4[_0x65f6('0x1e')],'id');for(var _0x36c316=0x0,_0x51549d={};_0x36c316<_0x28682b[_0x65f6('0x3d')];_0x36c316+=0x1){_0x51549d=_0x28682b[_0x36c316];if(_[_0x65f6('0x3f')](_0x5c55e4[_0x65f6('0x1e')][_0x51549d['id']])){_0x5c55e4[_0x65f6('0x1e')][_0x51549d['id']]=new ServicenowAccount(_0x51549d);}else{_0x5c55e4[_0x65f6('0x3a')](_0x5c55e4[_0x65f6('0x1e')][_0x51549d['id']],_0x51549d);}}}return _0x5c55e4['servicenowAccounts'];};};Realtime['prototype']['initDynamics365Accounts']=function(){var _0x336a7d=this;return function(_0x367d95){if(_0x367d95){freeIsNotKey(_0x367d95,_0x336a7d[_0x65f6('0x1f')],'id');for(var _0x471bec=0x0,_0xab6f0={};_0x471bec<_0x367d95[_0x65f6('0x3d')];_0x471bec+=0x1){_0xab6f0=_0x367d95[_0x471bec];if(_['isUndefined'](_0x336a7d[_0x65f6('0x1f')][_0xab6f0['id']])){_0x336a7d[_0x65f6('0x1f')][_0xab6f0['id']]=new Dynamics365Account(_0xab6f0);}else{_0x336a7d['mergeFromDatabase'](_0x336a7d[_0x65f6('0x1f')][_0xab6f0['id']],_0xab6f0);}}}return _0x336a7d[_0x65f6('0x1f')];};};Realtime[_0x65f6('0x39')]['initFreshsalesAccounts']=function(){var _0x23c441=this;return function(_0x448c9a){if(_0x448c9a){freeIsNotKey(_0x448c9a,_0x23c441['freshsalesAccounts'],'id');for(var _0x271d76=0x0,_0x3edc6b={};_0x271d76<_0x448c9a[_0x65f6('0x3d')];_0x271d76+=0x1){_0x3edc6b=_0x448c9a[_0x271d76];if(_[_0x65f6('0x3f')](_0x23c441[_0x65f6('0x49')][_0x3edc6b['id']])){_0x23c441[_0x65f6('0x49')][_0x3edc6b['id']]=new FreshsalesAccount(_0x3edc6b);}else{_0x23c441[_0x65f6('0x3a')](_0x23c441['freshsalesAccounts'][_0x3edc6b['id']],_0x3edc6b);}}}return _0x23c441['freshsalesAccounts'];};};Realtime[_0x65f6('0x39')][_0x65f6('0x4a')]=function(){var _0x4a9524=this;return function(_0x417ba5){for(var _0x5f3df9=0x0;_0x5f3df9<_0x417ba5[_0x65f6('0x3d')];_0x5f3df9+=0x1){_['merge'](_0x4a9524[_0x65f6('0x11')][_0x417ba5[_0x5f3df9][_0x65f6('0x3e')]],_0x417ba5[_0x5f3df9]);}return _0x4a9524[_0x65f6('0x11')];};};Realtime[_0x65f6('0x39')][_0x65f6('0x4b')]=function(){var _0x264e6c=this;return function(_0x1aaf75){clearVoiceQueues(_0x264e6c[_0x65f6('0x11')]);if(_0x1aaf75){_0x1aaf75=_[_0x65f6('0x4c')](_0x1aaf75,'uniqueid');for(var _0x480190 in _0x1aaf75){if(_0x1aaf75[_0x65f6('0x22')](_0x480190)){for(var _0x13ee4b=0x0;_0x13ee4b<_0x1aaf75[_0x480190][_0x65f6('0x3d')];_0x13ee4b+=0x1){var _0x51497f=_0x1aaf75[_0x480190][_0x13ee4b]['queue'];if(_0x264e6c[_0x65f6('0x11')][_0x51497f]){if(_0x1aaf75[_0x480190][_0x13ee4b][_0x65f6('0x4d')]){_0x264e6c[_0x65f6('0x11')][_0x51497f][_0x65f6('0x2c')]+=0x1;}if(_0x1aaf75[_0x480190][_0x13ee4b][_0x65f6('0x4e')]){_0x264e6c[_0x65f6('0x11')][_0x51497f]['abandoned']+=0x1;}_0x264e6c['voiceQueues'][_0x51497f][_0x65f6('0x28')]+=moment(_0x1aaf75[_0x480190][_0x13ee4b][_0x65f6('0x4f')])['diff'](moment(_0x1aaf75[_0x480190][_0x13ee4b][_0x65f6('0x50')]),'seconds')||0x0;if(_0x13ee4b===_0x1aaf75[_0x480190][_0x65f6('0x3d')]-0x1){_0x264e6c[_0x65f6('0x11')][_0x51497f][_0x65f6('0x51')]+=moment(_0x1aaf75[_0x480190][_0x13ee4b][_0x65f6('0x52')]||_0x1aaf75[_0x480190][_0x13ee4b]['queuecallerabandonAt']||_0x1aaf75[_0x480190][_0x13ee4b][_0x65f6('0x53')])[_0x65f6('0x54')](moment(_0x1aaf75[_0x480190][_0x13ee4b][_0x65f6('0x50')]),'seconds')||0x0;_0x264e6c['voiceQueues'][_0x51497f][_0x65f6('0x26')]+=0x1;if(_0x1aaf75[_0x480190][_0x13ee4b]['queuecallercomplete']){_0x264e6c[_0x65f6('0x11')][_0x51497f][_0x65f6('0x27')]+=0x1;_0x264e6c[_0x65f6('0x11')][_0x51497f][_0x65f6('0x29')]+=moment(_0x1aaf75[_0x480190][_0x13ee4b]['queuecallercompleteAt'])['diff'](moment(_0x1aaf75[_0x480190][_0x13ee4b]['queuecallerleaveAt']),_0x65f6('0x55'))||0x0;}}else{_0x264e6c[_0x65f6('0x11')][_0x51497f][_0x65f6('0x51')]+=_0x264e6c['voiceQueues'][_0x51497f][_0x65f6('0x28')]||0x0;}}}}}}return _0x264e6c[_0x65f6('0x11')];};};Realtime[_0x65f6('0x39')]['initVoiceCallReports']=function(){var _0x40d0f7=this;return function(_0x15809e){clearVoiceCallReports(_0x40d0f7['outbound']);if(_0x15809e){for(var _0x758e80=0x0;_0x758e80<_0x15809e[_0x65f6('0x3d')];_0x758e80+=0x1){_0x40d0f7['outbound'][_0x65f6('0x26')]+=0x1;_0x40d0f7['outbound'][_0x65f6('0x51')]+=_0x15809e[_0x758e80]['duration'];if(_0x15809e[_0x758e80][_0x65f6('0x56')]===_0x65f6('0x57')){_0x40d0f7['outbound'][_0x65f6('0x27')]+=0x1;_0x40d0f7[_0x65f6('0x58')][_0x65f6('0x28')]+=_0x15809e[_0x758e80][_0x65f6('0x59')]-_0x15809e[_0x758e80][_0x65f6('0x5a')]||0x0;_0x40d0f7[_0x65f6('0x58')][_0x65f6('0x29')]+=_0x15809e[_0x758e80][_0x65f6('0x5a')];}}}return _0x40d0f7[_0x65f6('0x58')];};};Realtime[_0x65f6('0x39')][_0x65f6('0x5b')]=function(){var _0x574d84=this;return function(_0x10a661){if(_0x10a661){freeIsNotKey(_0x10a661,_0x574d84[_0x65f6('0x5c')],_0x65f6('0x3e'));for(var _0x219e42=0x0,_0x5694f9={};_0x219e42<_0x10a661[_0x65f6('0x3d')];_0x219e42+=0x1){_0x5694f9=_0x10a661[_0x219e42];if(_[_0x65f6('0x3f')](_0x574d84['campaigns'][_0x5694f9[_0x65f6('0x3e')]])){_0x574d84['campaigns'][_0x5694f9[_0x65f6('0x3e')]]=new Campaign(_0x5694f9);}else{_0x574d84['mergeFromDatabase'](_0x574d84[_0x65f6('0x5c')][_0x5694f9[_0x65f6('0x3e')]],_0x5694f9);_0x574d84['campaigns'][_0x5694f9['name']][_0x65f6('0x5d')]=_0x5694f9[_0x65f6('0x5e')]?_0x5694f9['SquareProject'][_0x65f6('0x3e')]:undefined;}}}return _0x574d84[_0x65f6('0x5c')];};};Realtime[_0x65f6('0x39')]['initVoiceExtensions']=function(){var _0x1348ec=this;return function(_0x246510){if(_0x246510){freeIsNotKey(_0x246510,_0x1348ec['voiceExtensions'],'id');for(var _0x36b8de=0x0,_0x504b39={};_0x36b8de<_0x246510[_0x65f6('0x3d')];_0x36b8de+=0x1){_0x504b39=_0x246510[_0x36b8de];if(_['isUndefined'](_0x1348ec['voiceExtensions'][_0x504b39['id']])){_0x1348ec[_0x65f6('0x5f')][_0x504b39['id']]=new VoiceExtension(_0x504b39);}else{_0x1348ec[_0x65f6('0x3a')](_0x1348ec[_0x65f6('0x5f')][_0x504b39['id']],_0x504b39);}}}return _0x1348ec[_0x65f6('0x5f')];};};Realtime[_0x65f6('0x39')][_0x65f6('0x60')]=function(){var _0x1ac46f=this;return function(_0x1f4e2c){clearCampaigns(_0x1ac46f['campaigns']);for(var _0x494904=0x0;_0x494904<_0x1f4e2c[_0x65f6('0x3d')];_0x494904+=0x1){_['merge'](_0x1ac46f[_0x65f6('0x5c')][_0x1f4e2c[_0x494904][_0x65f6('0x3e')]],_0x1f4e2c[_0x494904]);}return _0x1ac46f[_0x65f6('0x5c')];};};Realtime[_0x65f6('0x39')][_0x65f6('0x61')]=function(){var _0x56bd9d=this;return function(_0x398cac){if(_0x398cac){freeIsNotKey(_0x398cac,_0x56bd9d[_0x65f6('0x20')],'id');for(var _0x14c908=0x0,_0x576ecd={};_0x14c908<_0x398cac[_0x65f6('0x3d')];_0x14c908+=0x1){_0x576ecd=_0x398cac[_0x14c908];if(_[_0x65f6('0x3f')](_0x56bd9d[_0x65f6('0x20')][_0x576ecd['id']])){_0x56bd9d[_0x65f6('0x20')][_0x576ecd['id']]=new FaxAccount(_0x576ecd);}else{_0x56bd9d[_0x65f6('0x3a')](_0x56bd9d[_0x65f6('0x20')][_0x576ecd['id']],_0x576ecd);}}}return _0x56bd9d['faxAccounts'];};};Realtime['prototype'][_0x65f6('0x62')]=function(){var _0x10d744=this;return function(_0x10c916){if(_0x10c916){freeIsNotKey(_0x10c916,_0x10d744[_0x65f6('0x11')],'name');for(var _0x4bda86=0x0,_0x336076={};_0x4bda86<_0x10c916[_0x65f6('0x3d')];_0x4bda86+=0x1){_0x336076=_0x10c916[_0x4bda86];if(_[_0x65f6('0x3f')](_0x10d744[_0x65f6('0x11')][_0x336076[_0x65f6('0x3e')]])){_0x10d744[_0x65f6('0x11')][_0x336076['name']]=new VoiceQueue(_0x336076);}else{_0x10d744['mergeFromDatabase'](_0x10d744['voiceQueues'][_0x336076[_0x65f6('0x3e')]],_0x336076);}}}return _0x10d744[_0x65f6('0x11')];};};module[_0x65f6('0x63')]=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(_0x58e2e8,_0x5e6b60){var _0x37696a=function(_0x1a0a84){while(--_0x1a0a84){_0x58e2e8['push'](_0x58e2e8['shift']());}};_0x37696a(++_0x5e6b60);}(_0xdb28,0x106));var _0x8db2=function(_0x2bfac6,_0x28a2c8){_0x2bfac6=_0x2bfac6-0x0;var _0x515b1f=_0xdb28[_0x2bfac6];return _0x515b1f;};'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 bba73ac..7e5d937 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 _0xe563=['mergeDBDataToRealtime','assign','hasOwnProperty'];(function(_0x34dace,_0x1bceb6){var _0x1e56c6=function(_0x3d78a0){while(--_0x3d78a0){_0x34dace['push'](_0x34dace['shift']());}};_0x1e56c6(++_0x1bceb6);}(_0xe563,0x1e7));var _0x3e56=function(_0x44a5ac,_0x15c3bb){_0x44a5ac=_0x44a5ac-0x0;var _0x524a4a=_0xe563[_0x44a5ac];return _0x524a4a;};'use strict';function mergeDBDataToRealtime(_0x3daffe,_0x43aac4){var _0x53aa7b=Object[_0x3e56('0x0')]({},_0x3daffe);for(var _0x22c913 in _0x43aac4){if(_0x53aa7b[_0x3e56('0x1')](_0x22c913)){_0x53aa7b[_0x22c913]=_0x43aac4[_0x22c913];}}return _0x53aa7b;}exports[_0x3e56('0x2')]=mergeDBDataToRealtime; \ No newline at end of file +var _0xf557=['assign','mergeDBDataToRealtime'];(function(_0x329aa3,_0x5e7401){var _0x4450f9=function(_0x30f467){while(--_0x30f467){_0x329aa3['push'](_0x329aa3['shift']());}};_0x4450f9(++_0x5e7401);}(_0xf557,0x18a));var _0x7f55=function(_0x19e0ae,_0x578569){_0x19e0ae=_0x19e0ae-0x0;var _0x379e84=_0xf557[_0x19e0ae];return _0x379e84;};'use strict';function mergeDBDataToRealtime(_0x286c76,_0x39e3a7){var _0x27272a=Object[_0x7f55('0x0')]({},_0x286c76);for(var _0x3c727b in _0x39e3a7){if(_0x27272a['hasOwnProperty'](_0x3c727b)){_0x27272a[_0x3c727b]=_0x39e3a7[_0x3c727b];}}return _0x27272a;}exports[_0x7f55('0x1')]=mergeDBDataToRealtime; \ No newline at end of file diff --git a/server/services/ami/report/index.js b/server/services/ami/report/index.js index a88b2ef..a370261 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 _0x5671=['linkedid','transfereelinkedid','uniqueid','type','UserId','split','monitor','monitors','filename','createdAt','xcally-motion-preview','calleridname','connectedlinename','xcally-motion-dialer','forEach','startsWith','Local','substring','indexOf','phone','lastIndexOf','attendedTransfer','exports','lodash','moment','util','../../../config/environment','../ami','../rpc/voiceCallReport','../rpc/voiceDialReport','../rpc/memberReport','../rpc/voiceQueueReport','../rpc/voiceTransferReport','./voiceQueueReport','./voiceAgentReport','./voiceDialReport','./userReport','realtime','agents','telephones','prototype','sync','xdr','disabled','voiceQueueReport','custom:voiceCallReport','voiceCallReport','bind','custom:voiceAgentReport','voiceAgentReport','custom:voiceDialReport','voiceDialReport','blindtransfer','blindTransfer','findAgent','find','accountcode','name','isNil','interface','format','SIP/%s','connectedlinenum','assigned','lastAssignedTo','queuecallercomplete','queuecallercompleteAt','YYYY-MM-DD\x20HH:mm:ss','queuecallerexit','queuecallerexitAt','create','match','getAgentByInternal','keys','length','getCallType','outbound','internal','destination','exten','dialer','lastapplication','queue','lastdata','from-voip-provider','callerid','from-sip','calleridnum','originatecalleridnum','destinationchannel','channel','calleridpreview','ANSWERED','\x22%s\x22\x20<%s>','transfers'];(function(_0x486ea0,_0x454bcd){var _0x3a8f6c=function(_0x14012d){while(--_0x14012d){_0x486ea0['push'](_0x486ea0['shift']());}};_0x3a8f6c(++_0x454bcd);}(_0x5671,0x193));var _0x1567=function(_0x13594e,_0x6f0ed0){_0x13594e=_0x13594e-0x0;var _0x1a4f42=_0x5671[_0x13594e];return _0x1a4f42;};'use strict';var _=require(_0x1567('0x0'));var moment=require(_0x1567('0x1'));var util=require(_0x1567('0x2'));var config=require(_0x1567('0x3'));var ami=require(_0x1567('0x4'));var RpcVoiceAgentReport=require('../rpc/voiceAgentReport');var RpcVoiceCallReport=require(_0x1567('0x5'));var RpcVoiceDialReport=require(_0x1567('0x6'));var RpcMemberReport=require(_0x1567('0x7'));var RpcVoiceQueueReport=require(_0x1567('0x8'));var RpcVoiceRecording=require('../rpc/voiceRecording');var RpcVoiceTransferReport=require(_0x1567('0x9'));var VoiceQueueReport=require(_0x1567('0xa'));var VoiceCallReport=require('./voiceCallReport');var VoiceAgentReport=require(_0x1567('0xb'));var VoiceDialReport=require(_0x1567('0xc'));var UserReport=require(_0x1567('0xd'));function Report(_0x380c78){this[_0x1567('0xe')]=_0x380c78;this[_0x1567('0xf')]=_0x380c78[_0x1567('0xf')];this['telephones']=_0x380c78[_0x1567('0x10')];}Report[_0x1567('0x11')][_0x1567('0x12')]=function(_0x5ed28e){var _0x2c6c99=new VoiceQueueReport(this[_0x1567('0xe')]);var _0x3d58e1=new VoiceAgentReport(this['realtime']);var _0x71ca38=new VoiceDialReport(this[_0x1567('0xe')]);var _0x52bf87=new VoiceCallReport(this[_0x1567('0xe')]);var _0x2f75a8=new UserReport(this[_0x1567('0xe')]);if(config[_0x1567('0x13')]&&config[_0x1567('0x13')][_0x1567('0x14')]){ami['on']('custom:voiceQueueReport',this[_0x1567('0x15')]['bind'](this));ami['on'](_0x1567('0x16'),this[_0x1567('0x17')][_0x1567('0x18')](this));ami['on'](_0x1567('0x19'),this[_0x1567('0x1a')][_0x1567('0x18')](this));ami['on'](_0x1567('0x1b'),this[_0x1567('0x1c')][_0x1567('0x18')](this));ami['on'](_0x1567('0x1d'),this[_0x1567('0x1e')][_0x1567('0x18')](this));ami['on']('attendedtransfer',this['attendedTransfer'][_0x1567('0x18')](this));}};Report[_0x1567('0x11')][_0x1567('0x1f')]=function(_0x7414a){var _0x5dcb6d;_0x5dcb6d=_[_0x1567('0x20')](this['agents'],function(_0x560db5){return _0x560db5[_0x1567('0x21')]==_0x7414a||_0x560db5[_0x1567('0x22')]==_0x7414a;});if(_[_0x1567('0x23')](_0x5dcb6d)){var _0x1d7e76=_[_0x1567('0x20')](this['telephones'],function(_0x39c0fa){return _0x39c0fa[_0x1567('0x21')]==_0x7414a||_0x39c0fa['name']==_0x7414a;});if(_0x1d7e76){_0x5dcb6d=_[_0x1567('0x20')](this['agents'],function(_0x27feab){return _0x27feab[_0x1567('0x24')]==util[_0x1567('0x25')](_0x1567('0x26'),_0x1d7e76[_0x1567('0x22')]);});}}return _0x5dcb6d;};Report['prototype']['voiceQueueReport']=function(_0x1d575a){for(var _0x50c687=0x0;_0x50c687<_0x1d575a['length'];_0x50c687+=0x1){var _0x517aab=this['findAgent'](_0x1d575a[_0x50c687][_0x1567('0x27')]);if(_0x517aab){_0x1d575a[_0x50c687][_0x1567('0x21')]=_0x517aab['accountcode'];_0x1d575a[_0x50c687][_0x1567('0x28')]=!![];_0x1d575a[_0x50c687][_0x1567('0x29')]=_0x517aab[_0x1567('0x22')];_0x1d575a[_0x50c687][_0x1567('0x24')]=_[_0x1567('0x23')](_0x517aab[_0x1567('0x24')])?util[_0x1567('0x25')](_0x1567('0x26'),_0x517aab[_0x1567('0x22')]):_0x517aab[_0x1567('0x24')];if(_0x1d575a[_0x50c687][_0x1567('0x2a')]){_0x1d575a[_0x50c687][_0x1567('0x2b')]=moment()[_0x1567('0x25')](_0x1567('0x2c'));}if(_0x1d575a[_0x50c687][_0x1567('0x2d')]){_0x1d575a[_0x50c687][_0x1567('0x2e')]=moment()['format'](_0x1567('0x2c'));}RpcMemberReport[_0x1567('0x15')](_0x1d575a[_0x50c687]);}RpcVoiceQueueReport[_0x1567('0x2f')](_0x1d575a[_0x50c687]);}};function extractCalleridNumber(_0x157214){var _0x307142=_0x157214[_0x1567('0x30')](/<(.*?)>/);return _0x307142?_0x307142[0x1]:_0x157214;}Report[_0x1567('0x11')][_0x1567('0x31')]=function(_0x9d3202){for(var _0x2d4823=0x0;_0x2d4823','calleridname','linkedid','transfers','uniqueid','blindTransfer','UserId','split','membername','monitor','monitors','filename','createdAt','exten','connectedlinename','xcally-motion-dialer','isArray','voiceDialReport','startsWith','substring','indexOf','mobile','phone','exports','lodash','moment','util','../rpc/voiceCallReport','../rpc/voiceDialReport','../rpc/memberReport','../rpc/voiceTransferReport','./voiceCallReport','./voiceDialReport','./userReport'];(function(_0x47b4a7,_0x13adac){var _0x3459dc=function(_0x9fa062){while(--_0x9fa062){_0x47b4a7['push'](_0x47b4a7['shift']());}};_0x3459dc(++_0x13adac);}(_0x76e7,0xa8));var _0x776e=function(_0x18fd4b,_0x475e2e){_0x18fd4b=_0x18fd4b-0x0;var _0xe5d6b4=_0x76e7[_0x18fd4b];return _0xe5d6b4;};'use strict';var _=require(_0x776e('0x0'));var moment=require(_0x776e('0x1'));var util=require(_0x776e('0x2'));var config=require('../../../config/environment');var ami=require('../ami');var RpcVoiceAgentReport=require('../rpc/voiceAgentReport');var RpcVoiceCallReport=require(_0x776e('0x3'));var RpcVoiceDialReport=require(_0x776e('0x4'));var RpcMemberReport=require(_0x776e('0x5'));var RpcVoiceQueueReport=require('../rpc/voiceQueueReport');var RpcVoiceRecording=require('../rpc/voiceRecording');var RpcVoiceTransferReport=require(_0x776e('0x6'));var VoiceQueueReport=require('./voiceQueueReport');var VoiceCallReport=require(_0x776e('0x7'));var VoiceAgentReport=require('./voiceAgentReport');var VoiceDialReport=require(_0x776e('0x8'));var UserReport=require(_0x776e('0x9'));function Report(_0x39a79c){this[_0x776e('0xa')]=_0x39a79c;this[_0x776e('0xb')]=_0x39a79c[_0x776e('0xb')];this[_0x776e('0xc')]=_0x39a79c['telephones'];}Report[_0x776e('0xd')]['sync']=function(_0x30258d){var _0x270ac0=new VoiceQueueReport(this[_0x776e('0xa')]);var _0x5132c3=new VoiceAgentReport(this['realtime']);var _0x42924d=new VoiceDialReport(this[_0x776e('0xa')]);var _0x269c4e=new VoiceCallReport(this[_0x776e('0xa')]);var _0x538a5b=new UserReport(this[_0x776e('0xa')]);if(config['xdr']&&config['xdr'][_0x776e('0xe')]){ami['on']('custom:voiceQueueReport',this[_0x776e('0xf')]['bind'](this));ami['on'](_0x776e('0x10'),this[_0x776e('0x11')][_0x776e('0x12')](this));ami['on'](_0x776e('0x13'),this[_0x776e('0x14')][_0x776e('0x12')](this));ami['on'](_0x776e('0x15'),this['voiceDialReport'][_0x776e('0x12')](this));ami['on'](_0x776e('0x16'),this['blindTransfer']['bind'](this));ami['on'](_0x776e('0x17'),this[_0x776e('0x18')][_0x776e('0x12')](this));}};Report[_0x776e('0xd')][_0x776e('0x19')]=function(_0x38ba3b){var _0x176ae8;_0x176ae8=_[_0x776e('0x1a')](this[_0x776e('0xb')],function(_0x618919){return _0x618919['accountcode']==_0x38ba3b||_0x618919['name']==_0x38ba3b;});if(_['isNil'](_0x176ae8)){var _0x5ed82a=_[_0x776e('0x1a')](this[_0x776e('0xc')],function(_0x49a8cf){return _0x49a8cf[_0x776e('0x1b')]==_0x38ba3b||_0x49a8cf['name']==_0x38ba3b;});if(_0x5ed82a){_0x176ae8=_['find'](this[_0x776e('0xb')],function(_0x46cbce){return _0x46cbce['interface']==util[_0x776e('0x1c')]('SIP/%s',_0x5ed82a[_0x776e('0x1d')]);});}}return _0x176ae8;};Report[_0x776e('0xd')][_0x776e('0xf')]=function(_0x422b8f){for(var _0x3b0554=0x0;_0x3b0554<_0x422b8f[_0x776e('0x1e')];_0x3b0554+=0x1){var _0x2dbb3e=this[_0x776e('0x19')](_0x422b8f[_0x3b0554][_0x776e('0x1f')]);if(_0x2dbb3e){_0x422b8f[_0x3b0554]['accountcode']=_0x2dbb3e[_0x776e('0x1b')];_0x422b8f[_0x3b0554][_0x776e('0x20')]=!![];_0x422b8f[_0x3b0554][_0x776e('0x21')]=_0x2dbb3e[_0x776e('0x1d')];_0x422b8f[_0x3b0554][_0x776e('0x22')]=_[_0x776e('0x23')](_0x2dbb3e['interface'])?util[_0x776e('0x1c')](_0x776e('0x24'),_0x2dbb3e['name']):_0x2dbb3e[_0x776e('0x22')];if(_0x422b8f[_0x3b0554][_0x776e('0x25')]){_0x422b8f[_0x3b0554][_0x776e('0x26')]=moment()[_0x776e('0x1c')](_0x776e('0x27'));}if(_0x422b8f[_0x3b0554]['queuecallerexit']){_0x422b8f[_0x3b0554][_0x776e('0x28')]=moment()[_0x776e('0x1c')]('YYYY-MM-DD\x20HH:mm:ss');}RpcMemberReport[_0x776e('0xf')](_0x422b8f[_0x3b0554]);}RpcVoiceQueueReport[_0x776e('0x29')](_0x422b8f[_0x3b0554]);}};function extractCalleridNumber(_0x4e5e25){var _0x429b12=_0x4e5e25[_0x776e('0x2a')](/<(.*?)>/);return _0x429b12?_0x429b12[0x1]:_0x4e5e25;}Report[_0x776e('0xd')][_0x776e('0x2b')]=function(_0x19e173){for(var _0x107c3c=0x0;_0x107c3c0x0?!![]:![];if(!_0x2b9b15){return this[_0xd8a8('0x6e')](this['summary'][_0xd8a8('0x6f')]);}};VoiceQueueReport[_0xd8a8('0xc')][_0xd8a8('0x1c')]=function(_0x35035b){var _0x355ba1=this[_0xd8a8('0x48')]['id'];if(this[_0xd8a8('0x48')]['queuestatus'][_0x355ba1]&&this[_0xd8a8('0x48')][_0xd8a8('0x62')][_0x355ba1][_0x35035b[_0xd8a8('0x60')]]){this['summary']['queuestatus'][_0x355ba1][_0x35035b['actionid']][_0xd8a8('0x11')][_0xd8a8('0x70')](_0x35035b);}};VoiceQueueReport[_0xd8a8('0xc')][_0xd8a8('0x18')]=function(_0x11cf89){var _0x278f43=this;try{if(this[_0xd8a8('0x71')](_0x11cf89)&&this[_0xd8a8('0x71')](_0x11cf89[_0xd8a8('0x54')])){logger[_0xd8a8('0x4d')]('[voiceQueueReport][queuesummary]\x20event:',util[_0xd8a8('0x42')](_0x11cf89,{'showHidden':![],'depth':null}));var _0xb36788=this['voiceQueues'][_0x11cf89[_0xd8a8('0x54')]];if(_0xb36788){logger[_0xd8a8('0x4d')]('[voiceQueueReport][queuesummary]\x20name:%s',_0xb36788['name']);this[_0xd8a8('0x48')]['queues'][_0xb36788[_0xd8a8('0x5b')]]={'summaryEvent':_0x11cf89};this['summary'][_0xd8a8('0x6d')]+=0x1;return ami[_0xd8a8('0x3e')]({'action':_0xd8a8('0x62'),'queue':_0xb36788[_0xd8a8('0x5b')]})[_0xd8a8('0x5f')](function(_0x5a09bb){if(!_0x278f43[_0xd8a8('0x48')]['queuestatus'][_0x11cf89[_0xd8a8('0x60')]]){_0x278f43[_0xd8a8('0x48')][_0xd8a8('0x62')][_0x11cf89['actionid']]={};}_0x278f43[_0xd8a8('0x48')][_0xd8a8('0x62')][_0x11cf89[_0xd8a8('0x60')]][_0x5a09bb[_0xd8a8('0x60')]]={'queue':_0xb36788['name'],'agents':[]};})['catch'](function(_0x458a53){throw _0x458a53;});}}}catch(_0x412cd5){logger[_0xd8a8('0x43')](_0xd8a8('0x64'),util[_0xd8a8('0x42')](_0x412cd5,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xd8a8('0xc')][_0xd8a8('0x6e')]=function(_0x523bb7){if(this['summary']['statusRequests']>0x0){this[_0xd8a8('0x48')][_0xd8a8('0x6f')]=_0x523bb7;return;}logger[_0xd8a8('0x4d')]('[voiceQueueReport][queuesummarycomplete]\x20event:',util[_0xd8a8('0x42')](_0x523bb7,{'showHidden':![],'depth':null}));this[_0xd8a8('0x48')]=initializeSummary();ami[_0xd8a8('0x4b')]('custom:queuesummarycomplete',{});};VoiceQueueReport['prototype'][_0xd8a8('0x1f')]=function(_0xc34880){try{if(this['isNotNull'](_0xc34880)){logger[_0xd8a8('0x4d')](_0xd8a8('0x72'),_0xc34880['uniqueid'],util[_0xd8a8('0x42')](_0xc34880,{'showHidden':![],'depth':null}));if(_['isUndefined'](this[_0xd8a8('0x10')][_0xc34880[_0xd8a8('0x4f')]])){this['queueReports'][_0xc34880['uniqueid']]=[];}if(_[_0xd8a8('0x5d')](this['channels'][_0xc34880[_0xd8a8('0x4f')]])){this[_0xd8a8('0x12')][_0xc34880[_0xd8a8('0x4f')]]={};}var _0x4b8783=new QueueReport();_0x4b8783['queue']=_0xc34880['queue'];_0x4b8783['type']=this['voiceQueues'][_0x4b8783['queue']]&&this[_0xd8a8('0x14')][_0x4b8783[_0xd8a8('0x54')]][_0xd8a8('0x58')]?this['voiceQueues'][_0x4b8783[_0xd8a8('0x54')]][_0xd8a8('0x58')]||_0xd8a8('0x59'):_0xd8a8('0x59');_0x4b8783['queuecallerjoinAt']=moment()[_0xd8a8('0x53')](_0xd8a8('0x73'));_0x4b8783[_0xd8a8('0x74')]=_0xc34880[_0xd8a8('0x74')];_0x4b8783['count']=_0xc34880[_0xd8a8('0x75')];_0x4b8783[_0xd8a8('0x4f')]=_0xc34880['uniqueid'];_0x4b8783[_0xd8a8('0x76')]=this['channels'][_0xc34880[_0xd8a8('0x4f')]][_0xd8a8('0x76')];logger[_0xd8a8('0x77')]('[voiceQueueReport][queuecallerjoin]\x20name:%s\x20type:%s',_0x4b8783['queue'],_0x4b8783[_0xd8a8('0x58')]);Object[_0xd8a8('0x6a')](_0x4b8783,_['pick'](_0xc34880,_[_0xd8a8('0x78')](_0x4b8783)));this[_0xd8a8('0x10')][_0xc34880[_0xd8a8('0x4f')]]['push'](_0x4b8783);this[_0xd8a8('0x12')][_0xc34880[_0xd8a8('0x4f')]]=_0x4b8783;this[_0xd8a8('0x4c')](_0x4b8783,'queuecallerjoin');}}catch(_0x37f638){logger[_0xd8a8('0x43')](_0xd8a8('0x72'),_0xc34880[_0xd8a8('0x4f')],util['inspect'](_0x37f638,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xd8a8('0x20')]=function(_0x5d9eb3){try{if(this[_0xd8a8('0x71')](_0x5d9eb3)){logger[_0xd8a8('0x4d')](_0xd8a8('0x79'),_0x5d9eb3[_0xd8a8('0x4f')],util[_0xd8a8('0x42')](_0x5d9eb3,{'showHidden':![],'depth':null}));if(this[_0xd8a8('0x10')][_0x5d9eb3[_0xd8a8('0x4f')]]){var _0x349c25=_['last'](this[_0xd8a8('0x10')][_0x5d9eb3[_0xd8a8('0x4f')]]);_0x349c25[_0xd8a8('0x3b')]=![];_0x349c25[_0xd8a8('0x7a')]=null;_0x349c25['holdtime']=_0x5d9eb3[_0xd8a8('0x7b')];_0x349c25['originalposition']=_0x5d9eb3[_0xd8a8('0x7c')];_0x349c25[_0xd8a8('0x3a')]=!![];_0x349c25[_0xd8a8('0x7d')]=moment()[_0xd8a8('0x53')](_0xd8a8('0x73'));_0x349c25[_0xd8a8('0x52')]='ABANDONED';_0x349c25[_0xd8a8('0x7e')]=null;logger[_0xd8a8('0x77')](_0xd8a8('0x7f'),_0x349c25[_0xd8a8('0x54')],_0x349c25[_0xd8a8('0x58')]);this['channels'][_0x5d9eb3[_0xd8a8('0x4f')]]=_0x349c25;this['emitVoiceQueueChannelRemove'](_0x349c25,_0xd8a8('0x3a'));}}}catch(_0x3ea738){logger['error'](_0xd8a8('0x79'),_0x5d9eb3[_0xd8a8('0x4f')],util['inspect'](_0x3ea738,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xd8a8('0xc')][_0xd8a8('0x22')]=function(_0xc749c5){try{if(this[_0xd8a8('0x71')](_0xc749c5)){logger[_0xd8a8('0x4d')](_0xd8a8('0x80'),_0xc749c5[_0xd8a8('0x4f')],util[_0xd8a8('0x42')](_0xc749c5,{'showHidden':![],'depth':null}));if(this[_0xd8a8('0x10')][_0xc749c5['uniqueid']]){var _0x474e08=_[_0xd8a8('0x81')](this[_0xd8a8('0x10')][_0xc749c5[_0xd8a8('0x4f')]]);_0x474e08[_0xd8a8('0x82')]=moment()['format'](_0xd8a8('0x73'));_0x474e08[_0xd8a8('0x83')]=_0xc749c5[_0xd8a8('0x83')];_0x474e08[_0xd8a8('0x84')]=_0xc749c5[_0xd8a8('0x84')];logger['info'](_0xd8a8('0x85'),_0x474e08['queue'],_0x474e08[_0xd8a8('0x58')],_0xc749c5[_0xd8a8('0x83')],_0xc749c5[_0xd8a8('0x84')]);this[_0xd8a8('0x12')][_0xc749c5[_0xd8a8('0x4f')]]=_0x474e08;this['emitVoiceQueueChannelSave'](_0x474e08,_0xd8a8('0x21'));}}}catch(_0x8d39cc){logger[_0xd8a8('0x43')](_0xd8a8('0x80'),_0xc749c5[_0xd8a8('0x4f')],util[_0xd8a8('0x42')](_0x8d39cc,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xd8a8('0xc')][_0xd8a8('0x86')]=function(_0x243aa8){try{if(this[_0xd8a8('0x71')](_0x243aa8)){logger[_0xd8a8('0x4d')](_0xd8a8('0x87'),_0x243aa8[_0xd8a8('0x4f')],util['inspect'](_0x243aa8,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x243aa8[_0xd8a8('0x4f')]]){var _0x64c2e8=_[_0xd8a8('0x81')](this['queueReports'][_0x243aa8[_0xd8a8('0x4f')]]);_0x64c2e8[_0xd8a8('0x3b')]=!![];_0x64c2e8[_0xd8a8('0x52')]=_0xd8a8('0x88');logger[_0xd8a8('0x77')](_0xd8a8('0x89'),_0x64c2e8['queue'],_0x64c2e8['type']);}}}catch(_0x44736c){logger[_0xd8a8('0x43')](_0xd8a8('0x87'),_0x243aa8[_0xd8a8('0x4f')],util[_0xd8a8('0x42')](_0x44736c,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xd8a8('0xc')]['syncAgentComplete']=function(_0x4037ee){try{if(this['isNotNull'](_0x4037ee)){logger[_0xd8a8('0x4d')](_0xd8a8('0x8a'),_0x4037ee[_0xd8a8('0x4f')],util[_0xd8a8('0x42')](_0x4037ee,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x4037ee[_0xd8a8('0x4f')]]){var _0x1ebea1=_['last'](this[_0xd8a8('0x10')][_0x4037ee['uniqueid']]);_0x1ebea1['queuecallerabandon']=![];_0x1ebea1['queuecallerabandonAt']=null;_0x1ebea1['assigned']=!![];_0x1ebea1[_0xd8a8('0x7e')]=_0x4037ee[_0xd8a8('0x8b')];_0x1ebea1[_0xd8a8('0x7b')]=_0x4037ee[_0xd8a8('0x7b')];_0x1ebea1[_0xd8a8('0x3b')]=!![];_0x1ebea1['queuecallerexit']=![];_0x1ebea1[_0xd8a8('0x8c')]=null;if(!_0x1ebea1[_0xd8a8('0x8d')]){if(_0x4037ee[_0xd8a8('0x8e')]==_0xd8a8('0x8d')){_0x1ebea1['queuecallerexitreason']=_0xd8a8('0x8f');logger[_0xd8a8('0x77')](_0xd8a8('0x90'),_0x1ebea1[_0xd8a8('0x54')],_0x1ebea1[_0xd8a8('0x58')]);}else{if(_[_0xd8a8('0x91')](_0x4037ee[_0xd8a8('0x92')][_0xd8a8('0x93')](),'local/')){if(this[_0xd8a8('0x10')][_0x4037ee[_0xd8a8('0x94')]]){var _0x3df1c0=_[_0xd8a8('0x81')](this['queueReports'][_0x4037ee[_0xd8a8('0x94')]]);_0x3df1c0[_0xd8a8('0x3b')]=![];_0x3df1c0[_0xd8a8('0x39')]=!![];_0x3df1c0[_0xd8a8('0x8c')]=moment(_0x1ebea1['queuecallerjoinAt'])['add'](_0x4037ee[_0xd8a8('0x7b')],_0xd8a8('0x95'))[_0xd8a8('0x53')](_0xd8a8('0x73'));_0x3df1c0[_0xd8a8('0x52')]='FORWARDTRANSFER';_0x3df1c0[_0xd8a8('0x8d')]=!![];_0x3df1c0[_0xd8a8('0x96')]='FORWARD';_0x3df1c0[_0xd8a8('0x97')]=_0x4037ee['destexten'];_0x3df1c0['transferuniqueid']=_0x4037ee[_0xd8a8('0x4f')];logger[_0xd8a8('0x77')]('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:FORWARDTRANSFER',_0x3df1c0[_0xd8a8('0x54')],_0x3df1c0[_0xd8a8('0x58')]);var _0xf6017f=this[_0xd8a8('0x10')][_0x4037ee[_0xd8a8('0x94')]];this['queueReports'][_0x4037ee[_0xd8a8('0x94')]]=this[_0xd8a8('0x10')][_0x4037ee[_0xd8a8('0x4f')]];this[_0xd8a8('0x10')][_0x4037ee['uniqueid']]=_0xf6017f;}}else{_0x1ebea1['queuecallerexitreason']=_0xd8a8('0x98')+_0x4037ee[_0xd8a8('0x8e')][_0xd8a8('0x99')]();logger[_0xd8a8('0x77')](_0xd8a8('0x9a'),_0x1ebea1[_0xd8a8('0x54')],_0x1ebea1[_0xd8a8('0x58')],_0x1ebea1[_0xd8a8('0x52')]);}}}this[_0xd8a8('0x12')][_0x4037ee[_0xd8a8('0x4f')]]=_0x1ebea1;}}}catch(_0x1d177d){logger[_0xd8a8('0x43')](_0xd8a8('0x8a'),_0x4037ee[_0xd8a8('0x4f')],util[_0xd8a8('0x42')](_0x1d177d,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xd8a8('0xc')][_0xd8a8('0x26')]=function(_0x3b8f63){try{if(this[_0xd8a8('0x71')](_0x3b8f63)){logger['debug'](_0xd8a8('0x9b'),_0x3b8f63[_0xd8a8('0x4f')],util[_0xd8a8('0x42')](_0x3b8f63,{'showHidden':![],'depth':null}));this[_0xd8a8('0x9c')](_0x3b8f63[_0xd8a8('0x4f')],_[_0xd8a8('0x78')](_0x3b8f63[_0xd8a8('0x9d')])[0x0],_0x3b8f63[_0xd8a8('0x9e')]);if(this[_0xd8a8('0x10')][_0x3b8f63[_0xd8a8('0x4f')]]){var _0x4661c9=_[_0xd8a8('0x81')](this[_0xd8a8('0x10')][_0x3b8f63[_0xd8a8('0x4f')]]);if(_0x4661c9){if(this['isNotNull'](_0x3b8f63[_0xd8a8('0x9d')])&&this[_0xd8a8('0x71')](_0x3b8f63[_0xd8a8('0x9d')][_0xd8a8('0x62')])){switch(_0x3b8f63[_0xd8a8('0x9e')]){case _0xd8a8('0x9f'):_0x4661c9['queuecallerexit']=![];_0x4661c9[_0xd8a8('0x8c')]=null;break;case _0xd8a8('0xa0'):_0x4661c9[_0xd8a8('0xa1')]=_0xd8a8('0xa2');_0x4661c9[_0xd8a8('0x39')]=!![];_0x4661c9['queuecallerexitAt']=moment()[_0xd8a8('0x53')](_0xd8a8('0x73'));_0x4661c9[_0xd8a8('0x82')]=moment()[_0xd8a8('0x53')](_0xd8a8('0x73'));logger['debug'](_0xd8a8('0xa3'),_0x3b8f63[_0xd8a8('0x4f')],util[_0xd8a8('0x42')](_0x4661c9,{'showHidden':![],'depth':null}));ami[_0xd8a8('0x4b')](_0xd8a8('0xa4'),_0x4661c9);break;default:_0x4661c9[_0xd8a8('0x39')]=!![];_0x4661c9[_0xd8a8('0x8c')]=moment()[_0xd8a8('0x53')](_0xd8a8('0x73'));_0x4661c9['queuecallerleaveAt']=moment()[_0xd8a8('0x53')](_0xd8a8('0x73'));}_0x4661c9[_0xd8a8('0x3a')]=![];_0x4661c9[_0xd8a8('0x7d')]=null;_0x4661c9[_0xd8a8('0x52')]=_0x3b8f63[_0xd8a8('0x9e')];this[_0xd8a8('0x12')][_0x3b8f63[_0xd8a8('0x4f')]]=_0x4661c9;this[_0xd8a8('0x49')](_0x4661c9,_0xd8a8('0x25'));}else if(this['isNotNull'](_0x3b8f63[_0xd8a8('0x9d')])&&this[_0xd8a8('0x71')](_0x3b8f63[_0xd8a8('0x9d')][_0xd8a8('0xa5')])){if(!_0x4661c9[_0xd8a8('0x3a')]){_0x4661c9[_0xd8a8('0x39')]=!![];_0x4661c9[_0xd8a8('0x8c')]=moment()['format'](_0xd8a8('0x73'));_0x4661c9[_0xd8a8('0x52')]='EXITWITHKEY';_0x4661c9[_0xd8a8('0x82')]=moment()[_0xd8a8('0x53')](_0xd8a8('0x73'));this['channels'][_0x3b8f63[_0xd8a8('0x4f')]]=_0x4661c9;}}logger['info']('[%s][voiceQueueReport][varset]\x20name:%s\x20type:%s\x20variable:%s\x20value:%s',_0x3b8f63[_0xd8a8('0x4f')],_0x4661c9[_0xd8a8('0x54')],_0x4661c9['type'],_['keys'](_0x3b8f63[_0xd8a8('0x9d')])[0x0],_0x3b8f63[_0xd8a8('0x9e')]);_0x4661c9[_0xd8a8('0x16')]=this[_0xd8a8('0x16')][_0x3b8f63[_0xd8a8('0x4f')]];}}}}catch(_0x487476){logger[_0xd8a8('0x43')](_0xd8a8('0x9b'),_0x3b8f63[_0xd8a8('0x4f')],util['inspect'](_0x487476,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xd8a8('0xc')][_0xd8a8('0x9c')]=function(_0x2b5838,_0x5cc11b,_0x59df64){var _0x15adbe=[_0xd8a8('0xa6'),'rtpaudioqosbridged',_0xd8a8('0xa7'),_0xd8a8('0xa8'),_0xd8a8('0xa9'),_0xd8a8('0xaa'),'rtpaudioqosrtt',_0xd8a8('0xab'),_0xd8a8('0xac'),_0xd8a8('0xad'),_0xd8a8('0xae'),_0xd8a8('0xaf'),_0xd8a8('0xb0'),_0xd8a8('0xb1'),_0xd8a8('0xb2'),_0xd8a8('0xb3'),'membername',_0xd8a8('0xb4'),'memberrealtime'];if(!_['isNil'](_0x5cc11b)&&!_[_0xd8a8('0xb5')](_0x15adbe,_0x5cc11b)){if(_['isUndefined'](this['variables'][_0x2b5838])){this[_0xd8a8('0x16')][_0x2b5838]={};}this['variables'][_0x2b5838][_0x5cc11b]=_0x59df64;}};VoiceQueueReport[_0xd8a8('0xc')][_0xd8a8('0xb6')]=function(_0x2f78d1,_0x5cc015,_0x46d9ac){try{var _0x44078e={};if(this[_0xd8a8('0x10')][_0x2f78d1]){for(var _0x4fb2b0=0x0;_0x4fb2b00x0?!![]:![];if(!_0x3daa49){return this[_0x750b('0x70')](this['summary'][_0x750b('0x71')]);}};VoiceQueueReport[_0x750b('0x3d')][_0x750b('0x19')]=function(_0x11c140){var _0x59bfe0=this[_0x750b('0x15')]['id'];if(this[_0x750b('0x15')][_0x750b('0x66')][_0x59bfe0]&&this[_0x750b('0x15')]['queuestatus'][_0x59bfe0][_0x11c140['actionid']]){this[_0x750b('0x15')][_0x750b('0x66')][_0x59bfe0][_0x11c140[_0x750b('0x65')]][_0x750b('0x11')][_0x750b('0x72')](_0x11c140);}};VoiceQueueReport[_0x750b('0x3d')][_0x750b('0x73')]=function(_0x3f34f6){var _0x33ace0=this;try{if(this[_0x750b('0x74')](_0x3f34f6)&&this[_0x750b('0x74')](_0x3f34f6[_0x750b('0x54')])){logger[_0x750b('0x4e')]('[voiceQueueReport][queuesummary]\x20event:',util[_0x750b('0x51')](_0x3f34f6,{'showHidden':![],'depth':null}));var _0x3679dd=this['voiceQueues'][_0x3f34f6[_0x750b('0x54')]];if(_0x3679dd){logger[_0x750b('0x4e')](_0x750b('0x75'),_0x3679dd[_0x750b('0x68')]);this[_0x750b('0x15')]['queues'][_0x3679dd[_0x750b('0x68')]]={'summaryEvent':_0x3f34f6};this[_0x750b('0x15')][_0x750b('0x6f')]+=0x1;return ami[_0x750b('0x42')]({'action':_0x750b('0x66'),'queue':_0x3679dd['name']})[_0x750b('0x64')](function(_0x2bba25){if(!_0x33ace0[_0x750b('0x15')][_0x750b('0x66')][_0x3f34f6['actionid']]){_0x33ace0[_0x750b('0x15')][_0x750b('0x66')][_0x3f34f6[_0x750b('0x65')]]={};}_0x33ace0[_0x750b('0x15')][_0x750b('0x66')][_0x3f34f6[_0x750b('0x65')]][_0x2bba25['actionid']]={'queue':_0x3679dd['name'],'agents':[]};})[_0x750b('0x61')](function(_0x10c1d5){throw _0x10c1d5;});}}}catch(_0x5db540){logger['error'](_0x750b('0x67'),util[_0x750b('0x51')](_0x5db540,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x750b('0x70')]=function(_0x1b926f){if(this[_0x750b('0x15')][_0x750b('0x6f')]>0x0){this[_0x750b('0x15')][_0x750b('0x71')]=_0x1b926f;return;}logger[_0x750b('0x4e')]('[voiceQueueReport][queuesummarycomplete]\x20event:',util[_0x750b('0x51')](_0x1b926f,{'showHidden':![],'depth':null}));this[_0x750b('0x15')]=initializeSummary();ami[_0x750b('0x4c')]('custom:queuesummarycomplete',{});};VoiceQueueReport[_0x750b('0x3d')][_0x750b('0x1d')]=function(_0x3eb8b3){try{if(this[_0x750b('0x74')](_0x3eb8b3)){logger['debug'](_0x750b('0x76'),_0x3eb8b3['uniqueid'],util['inspect'](_0x3eb8b3,{'showHidden':![],'depth':null}));if(_[_0x750b('0x5f')](this[_0x750b('0xf')][_0x3eb8b3[_0x750b('0x58')]])){this[_0x750b('0xf')][_0x3eb8b3[_0x750b('0x58')]]=[];}if(_[_0x750b('0x5f')](this[_0x750b('0x3f')][_0x3eb8b3[_0x750b('0x58')]])){this[_0x750b('0x3f')][_0x3eb8b3['uniqueid']]={};}var _0x168798=new QueueReport();_0x168798[_0x750b('0x54')]=_0x3eb8b3['queue'];_0x168798[_0x750b('0x5d')]=this[_0x750b('0x13')][_0x168798[_0x750b('0x54')]]&&this[_0x750b('0x13')][_0x168798[_0x750b('0x54')]][_0x750b('0x5d')]?this[_0x750b('0x13')][_0x168798[_0x750b('0x54')]][_0x750b('0x5d')]||_0x750b('0x5e'):'inbound';_0x168798[_0x750b('0x77')]=moment()[_0x750b('0x52')]('YYYY-MM-DD\x20HH:mm:ss');_0x168798[_0x750b('0x78')]=_0x3eb8b3[_0x750b('0x78')];_0x168798[_0x750b('0x79')]=_0x3eb8b3[_0x750b('0x79')];_0x168798[_0x750b('0x58')]=_0x3eb8b3['uniqueid'];_0x168798['routealias']=this[_0x750b('0x3f')][_0x3eb8b3[_0x750b('0x58')]][_0x750b('0x7a')];logger[_0x750b('0x7b')]('[voiceQueueReport][queuecallerjoin]\x20name:%s\x20type:%s',_0x168798[_0x750b('0x54')],_0x168798[_0x750b('0x5d')]);Object[_0x750b('0x6c')](_0x168798,_[_0x750b('0x7c')](_0x3eb8b3,_[_0x750b('0x7d')](_0x168798)));this[_0x750b('0xf')][_0x3eb8b3['uniqueid']][_0x750b('0x72')](_0x168798);this[_0x750b('0x3f')][_0x3eb8b3[_0x750b('0x58')]]=_0x168798;this[_0x750b('0x4d')](_0x168798,_0x750b('0x1c'));}}catch(_0x82084f){logger['error']('[%s][voiceQueueReport][queuecallerjoin]',_0x3eb8b3[_0x750b('0x58')],util['inspect'](_0x82084f,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x750b('0x3d')][_0x750b('0x1e')]=function(_0x461f26){try{if(this['isNotNull'](_0x461f26)){logger[_0x750b('0x4e')]('[%s][voiceQueueReport][queuecallerabandon]',_0x461f26[_0x750b('0x58')],util[_0x750b('0x51')](_0x461f26,{'showHidden':![],'depth':null}));if(this[_0x750b('0xf')][_0x461f26[_0x750b('0x58')]]){var _0x277677=_[_0x750b('0x7e')](this['queueReports'][_0x461f26[_0x750b('0x58')]]);_0x277677[_0x750b('0x3c')]=![];_0x277677[_0x750b('0x7f')]=null;_0x277677[_0x750b('0x80')]=_0x461f26[_0x750b('0x80')];_0x277677['originalposition']=_0x461f26[_0x750b('0x81')];_0x277677['queuecallerabandon']=!![];_0x277677['queuecallerabandonAt']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x277677[_0x750b('0x59')]=_0x750b('0x82');_0x277677[_0x750b('0x83')]=null;logger[_0x750b('0x7b')](_0x750b('0x84'),_0x277677[_0x750b('0x54')],_0x277677[_0x750b('0x5d')]);this['channels'][_0x461f26[_0x750b('0x58')]]=_0x277677;this[_0x750b('0x4a')](_0x277677,_0x750b('0x3b'));}}}catch(_0x4f4454){logger['error']('[%s][voiceQueueReport][queuecallerabandon]',_0x461f26['uniqueid'],util[_0x750b('0x51')](_0x4f4454,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x750b('0x3d')][_0x750b('0x20')]=function(_0x45db10){try{if(this[_0x750b('0x74')](_0x45db10)){logger[_0x750b('0x4e')]('[%s][voiceQueueReport][queuecallerleave]',_0x45db10['uniqueid'],util[_0x750b('0x51')](_0x45db10,{'showHidden':![],'depth':null}));if(this[_0x750b('0xf')][_0x45db10[_0x750b('0x58')]]){var _0x21110c=_['last'](this[_0x750b('0xf')][_0x45db10['uniqueid']]);_0x21110c[_0x750b('0x85')]=moment()[_0x750b('0x52')](_0x750b('0x86'));_0x21110c[_0x750b('0x87')]=_0x45db10[_0x750b('0x87')];_0x21110c[_0x750b('0x88')]=_0x45db10['connectedlinename'];logger['info'](_0x750b('0x89'),_0x21110c[_0x750b('0x54')],_0x21110c[_0x750b('0x5d')],_0x45db10[_0x750b('0x87')],_0x45db10[_0x750b('0x88')]);this[_0x750b('0x3f')][_0x45db10[_0x750b('0x58')]]=_0x21110c;this[_0x750b('0x4d')](_0x21110c,_0x750b('0x1f'));}}}catch(_0x50b9d7){logger['error'](_0x750b('0x8a'),_0x45db10['uniqueid'],util['inspect'](_0x50b9d7,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x750b('0x24')]=function(_0x7cf1b6){try{if(this[_0x750b('0x74')](_0x7cf1b6)){logger[_0x750b('0x4e')](_0x750b('0x8b'),_0x7cf1b6[_0x750b('0x58')],util[_0x750b('0x51')](_0x7cf1b6,{'showHidden':![],'depth':null}));if(this[_0x750b('0xf')][_0x7cf1b6[_0x750b('0x58')]]){var _0x3e5556=_[_0x750b('0x7e')](this[_0x750b('0xf')][_0x7cf1b6[_0x750b('0x58')]]);_0x3e5556['queuecallercomplete']=!![];_0x3e5556[_0x750b('0x59')]=_0x750b('0x8c');logger[_0x750b('0x7b')](_0x750b('0x8d'),_0x3e5556[_0x750b('0x54')],_0x3e5556[_0x750b('0x5d')]);}}}catch(_0x4c2c11){logger[_0x750b('0x46')](_0x750b('0x8b'),_0x7cf1b6['uniqueid'],util['inspect'](_0x4c2c11,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x750b('0x3d')]['syncAgentComplete']=function(_0x65b207){try{if(this[_0x750b('0x74')](_0x65b207)){logger['debug'](_0x750b('0x8e'),_0x65b207[_0x750b('0x58')],util['inspect'](_0x65b207,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x65b207[_0x750b('0x58')]]){var _0x1ca09f=_['last'](this['queueReports'][_0x65b207[_0x750b('0x58')]]);_0x1ca09f[_0x750b('0x3b')]=![];_0x1ca09f[_0x750b('0x8f')]=null;_0x1ca09f['assigned']=!![];_0x1ca09f[_0x750b('0x83')]=_0x65b207[_0x750b('0x90')];_0x1ca09f['holdtime']=_0x65b207[_0x750b('0x80')];_0x1ca09f[_0x750b('0x3c')]=!![];_0x1ca09f['queuecallerexit']=![];_0x1ca09f[_0x750b('0x91')]=null;if(!_0x1ca09f[_0x750b('0x92')]){if(_0x65b207[_0x750b('0x93')]==_0x750b('0x92')){_0x1ca09f[_0x750b('0x59')]=_0x750b('0x94');logger['info']('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETED',_0x1ca09f['queue'],_0x1ca09f[_0x750b('0x5d')]);}else{if(_[_0x750b('0x95')](_0x65b207[_0x750b('0x43')][_0x750b('0x96')](),'local/')){if(this[_0x750b('0xf')][_0x65b207[_0x750b('0x97')]]){var _0xbc718b=_[_0x750b('0x7e')](this[_0x750b('0xf')][_0x65b207['linkedid']]);_0xbc718b[_0x750b('0x3c')]=![];_0xbc718b['queuecallerexit']=!![];_0xbc718b[_0x750b('0x91')]=moment(_0x1ca09f['queuecallerjoinAt'])[_0x750b('0x98')](_0x65b207[_0x750b('0x80')],_0x750b('0x99'))['format'](_0x750b('0x86'));_0xbc718b['queuecallerexitreason']=_0x750b('0x9a');_0xbc718b[_0x750b('0x92')]=!![];_0xbc718b['transfertype']='FORWARD';_0xbc718b['transferexten']=_0x65b207['destexten'];_0xbc718b[_0x750b('0x9b')]=_0x65b207['uniqueid'];logger['info'](_0x750b('0x9c'),_0xbc718b[_0x750b('0x54')],_0xbc718b['type']);var _0x24d243=this[_0x750b('0xf')][_0x65b207[_0x750b('0x97')]];this['queueReports'][_0x65b207[_0x750b('0x97')]]=this[_0x750b('0xf')][_0x65b207['uniqueid']];this[_0x750b('0xf')][_0x65b207['uniqueid']]=_0x24d243;}}else{_0x1ca09f['queuecallerexitreason']='COMPLETEDBY'+_0x65b207['reason'][_0x750b('0x9d')]();logger[_0x750b('0x7b')](_0x750b('0x9e'),_0x1ca09f[_0x750b('0x54')],_0x1ca09f[_0x750b('0x5d')],_0x1ca09f['queuecallerexitreason']);}}}this['channels'][_0x65b207[_0x750b('0x58')]]=_0x1ca09f;}}}catch(_0x2cb99f){logger[_0x750b('0x46')](_0x750b('0x8e'),_0x65b207[_0x750b('0x58')],util['inspect'](_0x2cb99f,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x750b('0x26')]=function(_0x3b842a){try{if(this[_0x750b('0x74')](_0x3b842a)){logger[_0x750b('0x4e')](_0x750b('0x9f'),_0x3b842a['uniqueid'],util['inspect'](_0x3b842a,{'showHidden':![],'depth':null}));this[_0x750b('0xa0')](_0x3b842a[_0x750b('0x58')],_[_0x750b('0x7d')](_0x3b842a[_0x750b('0xa1')])[0x0],_0x3b842a[_0x750b('0xa2')]);if(this[_0x750b('0xf')][_0x3b842a[_0x750b('0x58')]]){var _0x350338=_[_0x750b('0x7e')](this[_0x750b('0xf')][_0x3b842a[_0x750b('0x58')]]);if(_0x350338){if(this['isNotNull'](_0x3b842a[_0x750b('0xa1')])&&this[_0x750b('0x74')](_0x3b842a[_0x750b('0xa1')]['queuestatus'])){switch(_0x3b842a[_0x750b('0xa2')]){case _0x750b('0xa3'):_0x350338['queuecallerexit']=![];_0x350338[_0x750b('0x91')]=null;break;case _0x750b('0xa4'):_0x350338[_0x750b('0xa5')]=_0x750b('0xa6');_0x350338[_0x750b('0xa7')]=!![];_0x350338[_0x750b('0x91')]=moment()[_0x750b('0x52')]('YYYY-MM-DD\x20HH:mm:ss');_0x350338['queuecallerleaveAt']=moment()[_0x750b('0x52')](_0x750b('0x86'));logger[_0x750b('0x4e')]('[%s][voiceQueueReport][varset]\x20sending\x20timeout\x20event:',_0x3b842a['uniqueid'],util[_0x750b('0x51')](_0x350338,{'showHidden':![],'depth':null}));ami[_0x750b('0x4c')](_0x750b('0xa8'),_0x350338);break;default:_0x350338[_0x750b('0xa7')]=!![];_0x350338[_0x750b('0x91')]=moment()[_0x750b('0x52')](_0x750b('0x86'));_0x350338['queuecallerleaveAt']=moment()[_0x750b('0x52')]('YYYY-MM-DD\x20HH:mm:ss');}_0x350338['queuecallerabandon']=![];_0x350338[_0x750b('0x8f')]=null;_0x350338[_0x750b('0x59')]=_0x3b842a[_0x750b('0xa2')];this[_0x750b('0x3f')][_0x3b842a[_0x750b('0x58')]]=_0x350338;this[_0x750b('0x4a')](_0x350338,_0x750b('0x25'));}else if(this[_0x750b('0x74')](_0x3b842a['variable'])&&this[_0x750b('0x74')](_0x3b842a[_0x750b('0xa1')][_0x750b('0xa9')])){if(!_0x350338[_0x750b('0x3b')]){_0x350338[_0x750b('0xa7')]=!![];_0x350338[_0x750b('0x91')]=moment()[_0x750b('0x52')](_0x750b('0x86'));_0x350338[_0x750b('0x59')]=_0x750b('0xaa');_0x350338[_0x750b('0x85')]=moment()['format'](_0x750b('0x86'));this[_0x750b('0x3f')][_0x3b842a[_0x750b('0x58')]]=_0x350338;}}logger[_0x750b('0x7b')](_0x750b('0xab'),_0x3b842a['uniqueid'],_0x350338[_0x750b('0x54')],_0x350338[_0x750b('0x5d')],_['keys'](_0x3b842a[_0x750b('0xa1')])[0x0],_0x3b842a[_0x750b('0xa2')]);_0x350338['variables']=this[_0x750b('0x16')][_0x3b842a[_0x750b('0x58')]];}}}}catch(_0x39b520){logger['error'](_0x750b('0x9f'),_0x3b842a[_0x750b('0x58')],util[_0x750b('0x51')](_0x39b520,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x750b('0x3d')][_0x750b('0xa0')]=function(_0x349740,_0xb00a21,_0x1a392b){var _0x257837=[_0x750b('0xac'),_0x750b('0xad'),_0x750b('0xae'),_0x750b('0xaf'),'rtpaudioqosloss',_0x750b('0xb0'),_0x750b('0xb1'),_0x750b('0xb2'),'sipcallid',_0x750b('0xb3'),_0x750b('0xb4'),_0x750b('0xb5'),_0x750b('0xb6'),_0x750b('0xb7'),_0x750b('0xb8'),_0x750b('0xb9'),'membername',_0x750b('0xba'),'memberrealtime'];if(!_[_0x750b('0x41')](_0xb00a21)&&!_[_0x750b('0xbb')](_0x257837,_0xb00a21)){if(_[_0x750b('0x5f')](this['variables'][_0x349740])){this['variables'][_0x349740]={};}this[_0x750b('0x16')][_0x349740][_0xb00a21]=_0x1a392b;}};VoiceQueueReport[_0x750b('0x3d')]['handleHangup']=function(_0x2aa7d0,_0x8d576d,_0xc14c81){try{var _0x53183e={};if(this[_0x750b('0xf')][_0x2aa7d0]){for(var _0x54a573=0x0;_0x54a573=0x0?moment(_0x24235f[_0x06cb('0x1a')])[_0x06cb('0xe')](_0x24235f[_0x06cb('0x19')],_0x06cb('0x1b')):null,'data1':_0x06cb('0x1c'),'data2':_0x24235f[_0x06cb('0x13')],'data3':_0x24235f[_0x06cb('0x11')],'data4':_0x24235f[_0x06cb('0x1d')]||null,'role':_0x06cb('0x1e'),'internal':_0x24235f[_0x06cb('0x13')]?_['toNumber'](_0x24235f[_0x06cb('0x13')]):undefined,'uniqueid':_0x24235f[_0x06cb('0x15')]},'log':_0x06cb('0x16')});}; \ No newline at end of file +var _0x0535=['util','../client','voiceQueueReport','queuecallercompleteAt','queuecallerexitAt','Request','CreateMemberReport','voice','lastAssignedTo','isNil','interface','SIP/%s','TALKING','seconds','inbound','calleridnum','exten','queue','agent','accountcode','toNumber','uniqueid','voiceDialReport','membername','starttime','endtime','diff','outbound','dialstring','moment','lodash'];(function(_0x5b27da,_0x4a6532){var _0x3254f4=function(_0x4194c6){while(--_0x4194c6){_0x5b27da['push'](_0x5b27da['shift']());}};_0x3254f4(++_0x4a6532);}(_0x0535,0x115));var _0x5053=function(_0x29eae6,_0x580fa4){_0x29eae6=_0x29eae6-0x0;var _0x111d9f=_0x0535[_0x29eae6];return _0x111d9f;};'use strict';var moment=require(_0x5053('0x0'));var _=require(_0x5053('0x1'));var util=require(_0x5053('0x2'));var client=require(_0x5053('0x3'));exports[_0x5053('0x4')]=function(_0xdec240){var _0xa449d8=_0xdec240[_0x5053('0x5')]||_0xdec240[_0x5053('0x6')];return client[_0x5053('0x7')](_0x5053('0x8'),{'body':{'channel':_0x5053('0x9'),'membername':_0xdec240[_0x5053('0xa')],'interface':_[_0x5053('0xb')](_0xdec240[_0x5053('0xc')])?util['format'](_0x5053('0xd'),_0xdec240[_0x5053('0xa')]):_0xdec240[_0x5053('0xc')],'type':_0x5053('0xe'),'enterAt':_0xdec240['queuecallerleaveAt'],'exitAt':_0xa449d8,'duration':moment(_0xa449d8)['diff'](_0xdec240['queuecallerleaveAt'],_0x5053('0xf')),'data1':_0x5053('0x10'),'data2':_0xdec240[_0x5053('0x11')],'data3':_0xdec240[_0x5053('0x12')],'data4':null,'data5':_0xdec240[_0x5053('0x13')],'role':_0x5053('0x14'),'internal':_0xdec240[_0x5053('0x15')]?_[_0x5053('0x16')](_0xdec240[_0x5053('0x15')]):undefined,'uniqueid':_0xdec240[_0x5053('0x17')]},'log':_0x5053('0x8')});};exports[_0x5053('0x18')]=function(_0x504a23){return client[_0x5053('0x7')]('CreateMemberReport',{'body':{'channel':_0x5053('0x9'),'membername':_0x504a23[_0x5053('0x19')],'interface':_0x504a23['interface'],'type':_0x5053('0xe'),'enterAt':_0x504a23[_0x5053('0x1a')],'exitAt':_0x504a23[_0x5053('0x1b')],'duration':moment(_0x504a23['endtime'])[_0x5053('0x1c')](_0x504a23['starttime'],_0x5053('0xf'))>=0x0?moment(_0x504a23[_0x5053('0x1b')])['diff'](_0x504a23[_0x5053('0x1a')],'seconds'):null,'data1':_0x5053('0x1d'),'data2':_0x504a23[_0x5053('0x15')],'data3':_0x504a23[_0x5053('0x12')],'data4':_0x504a23[_0x5053('0x1e')]||null,'role':_0x5053('0x14'),'internal':_0x504a23['accountcode']?_['toNumber'](_0x504a23['accountcode']):undefined,'uniqueid':_0x504a23[_0x5053('0x17')]},'log':'CreateMemberReport'});}; \ No newline at end of file diff --git a/server/services/ami/rpc/setting.js b/server/services/ami/rpc/setting.js index 3a39811..13c21d0 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 _0xb2af=['../client','getSettings','Request','ShowSetting','previewRecallmeReminderInterval','GetSettings'];(function(_0x4610b9,_0x514405){var _0x1beeab=function(_0x25383f){while(--_0x25383f){_0x4610b9['push'](_0x4610b9['shift']());}};_0x1beeab(++_0x514405);}(_0xb2af,0xd2));var _0xfb2a=function(_0x249429,_0x2469d2){_0x249429=_0x249429-0x0;var _0x5443e6=_0xb2af[_0x249429];return _0x5443e6;};'use strict';var client=require(_0xfb2a('0x0'));exports[_0xfb2a('0x1')]=function(){return client[_0xfb2a('0x2')](_0xfb2a('0x3'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':['stopRecordingOnTransfer',_0xfb2a('0x4')]},'log':_0xfb2a('0x5')});}; \ No newline at end of file +var _0xe195=['ShowSetting','stopRecordingOnTransfer','previewRecallmeReminderInterval','GetSettings','Request'];(function(_0x592f46,_0x268ae3){var _0x225678=function(_0x451593){while(--_0x451593){_0x592f46['push'](_0x592f46['shift']());}};_0x225678(++_0x268ae3);}(_0xe195,0x1c6));var _0x5e19=function(_0x242f21,_0x3e1a16){_0x242f21=_0x242f21-0x0;var _0x44991d=_0xe195[_0x242f21];return _0x44991d;};'use strict';var client=require('../client');exports['getSettings']=function(){return client[_0x5e19('0x0')](_0x5e19('0x1'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x5e19('0x2'),_0x5e19('0x3')]},'log':_0x5e19('0x4')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/template.js b/server/services/ami/rpc/template.js index 120e7c9..69346a4 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 _0x55f6=['GetTemplate','name','html','getTemplates','Request'];(function(_0x956fd9,_0x27d0d6){var _0x2b4758=function(_0xf5cf71){while(--_0xf5cf71){_0x956fd9['push'](_0x956fd9['shift']());}};_0x2b4758(++_0x27d0d6);}(_0x55f6,0x17a));var _0x655f=function(_0x469348,_0x39af3d){_0x469348=_0x469348-0x0;var _0x5a13a1=_0x55f6[_0x469348];return _0x5a13a1;};'use strict';var client=require('../client');exports[_0x655f('0x0')]=function(_0xa624f2){return function(_0x55964e){return client[_0x655f('0x1')](_0x655f('0x2'),{'options':{'raw':!![],'attributes':['id',_0x655f('0x3'),_0x655f('0x4')]},'log':_0x655f('0x2')});};}; \ No newline at end of file +var _0xcf01=['../client','GetTemplate','name'];(function(_0x41809f,_0x1c55da){var _0x3ee237=function(_0x4288d7){while(--_0x4288d7){_0x41809f['push'](_0x41809f['shift']());}};_0x3ee237(++_0x1c55da);}(_0xcf01,0x141));var _0x1cf0=function(_0x1cdcab,_0x17a516){_0x1cdcab=_0x1cdcab-0x0;var _0x4393d0=_0xcf01[_0x1cdcab];return _0x4393d0;};'use strict';var client=require(_0x1cf0('0x0'));exports['getTemplates']=function(_0x15ec5d){return function(_0x4c1dba){return client['Request'](_0x1cf0('0x1'),{'options':{'raw':!![],'attributes':['id',_0x1cf0('0x2'),'html']},'log':'GetTemplate'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trigger.js b/server/services/ami/rpc/trigger.js index 921567b..4cd8e4a 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 _0xfdcc=['getTriggers','Request','GetTrigger','name','channel','status','Condition','value','field','operator','Action','Actions','data1','data2','data3','data4','data6','data7','../client'];(function(_0x3a1ea5,_0x349f01){var _0xfac9b2=function(_0xd5310c){while(--_0xd5310c){_0x3a1ea5['push'](_0x3a1ea5['shift']());}};_0xfac9b2(++_0x349f01);}(_0xfdcc,0x84));var _0xcfdc=function(_0x2f6233,_0x90172){_0x2f6233=_0x2f6233-0x0;var _0x1c9c36=_0xfdcc[_0x2f6233];return _0x1c9c36;};'use strict';var client=require(_0xcfdc('0x0'));exports[_0xcfdc('0x1')]=function(_0xdeb843){return function(_0x30d15c){return client[_0xcfdc('0x2')](_0xcfdc('0x3'),{'options':{'raw':![],'attributes':['id',_0xcfdc('0x4'),_0xcfdc('0x5'),_0xcfdc('0x6')],'include':[{'model':_0xcfdc('0x7'),'as':'AllConditions','attributes':['id','field','operator',_0xcfdc('0x8')]},{'model':'Condition','as':'AnyConditions','attributes':['id',_0xcfdc('0x9'),_0xcfdc('0xa'),'value']},{'model':_0xcfdc('0xb'),'as':_0xcfdc('0xc'),'attributes':['id','action',_0xcfdc('0xd'),_0xcfdc('0xe'),_0xcfdc('0xf'),_0xcfdc('0x10'),'data5',_0xcfdc('0x11'),_0xcfdc('0x12')]}]},'log':_0xcfdc('0x3')});};}; \ No newline at end of file +var _0x0133=['status','Condition','AllConditions','field','operator','value','AnyConditions','action','data1','data2','data3','data5','data6','data7','../client','getTriggers','Request','GetTrigger','name','channel'];(function(_0x99ea32,_0x385c64){var _0x5d8fc6=function(_0x3fd1a0){while(--_0x3fd1a0){_0x99ea32['push'](_0x99ea32['shift']());}};_0x5d8fc6(++_0x385c64);}(_0x0133,0x1c6));var _0x3013=function(_0x54d4fe,_0x55e869){_0x54d4fe=_0x54d4fe-0x0;var _0x1ab5bb=_0x0133[_0x54d4fe];return _0x1ab5bb;};'use strict';var client=require(_0x3013('0x0'));exports[_0x3013('0x1')]=function(_0x3cd4dd){return function(_0x108814){return client[_0x3013('0x2')](_0x3013('0x3'),{'options':{'raw':![],'attributes':['id',_0x3013('0x4'),_0x3013('0x5'),_0x3013('0x6')],'include':[{'model':_0x3013('0x7'),'as':_0x3013('0x8'),'attributes':['id',_0x3013('0x9'),_0x3013('0xa'),_0x3013('0xb')]},{'model':_0x3013('0x7'),'as':_0x3013('0xc'),'attributes':['id',_0x3013('0x9'),_0x3013('0xa'),_0x3013('0xb')]},{'model':'Action','as':'Actions','attributes':['id',_0x3013('0xd'),_0x3013('0xe'),_0x3013('0xf'),_0x3013('0x10'),'data4',_0x3013('0x11'),_0x3013('0x12'),_0x3013('0x13')]}]},'log':_0x3013('0x3')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trunk.js b/server/services/ami/rpc/trunk.js index 757ba4b..2937c6b 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 _0xc8b0=['Request','GetTrunk','name','registry','defaultuser','../client','getTrunks'];(function(_0x35b80a,_0x4c522e){var _0x5bd51b=function(_0x50ebdf){while(--_0x50ebdf){_0x35b80a['push'](_0x35b80a['shift']());}};_0x5bd51b(++_0x4c522e);}(_0xc8b0,0x1cc));var _0x0c8b=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0xc8b0[_0x397e5f];return _0x5302b8;};'use strict';var client=require(_0x0c8b('0x0'));exports[_0x0c8b('0x1')]=function(_0x5bff5c){return function(_0x2de129){return client[_0x0c8b('0x2')](_0x0c8b('0x3'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0x0c8b('0x4'),_0x0c8b('0x5'),_0x0c8b('0x6')]},'log':_0x0c8b('0x3')});};}; \ No newline at end of file +var _0x1459=['name','registry','defaultuser','GetTrunk','../client','Request'];(function(_0x41781a,_0x5732c7){var _0x479144=function(_0xa042f8){while(--_0xa042f8){_0x41781a['push'](_0x41781a['shift']());}};_0x479144(++_0x5732c7);}(_0x1459,0xe8));var _0x9145=function(_0x1c053d,_0x27d443){_0x1c053d=_0x1c053d-0x0;var _0xf93ac4=_0x1459[_0x1c053d];return _0xf93ac4;};'use strict';var client=require(_0x9145('0x0'));exports['getTrunks']=function(_0x3afee3){return function(_0x218f35){return client[_0x9145('0x1')]('GetTrunk',{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0x9145('0x2'),_0x9145('0x3'),_0x9145('0x4')]},'log':_0x9145('0x5')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/user.js b/server/services/ami/rpc/user.js index 461b352..5a880c0 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 _0x70e0=['getAgents','Request','name','email','accountcode','fullname','lastLoginAt','lastPauseAt','interface','getTelephones','GetUser','telephone','savePause','PauseUser','saveUnpause','getAgent','agent','online','pauseType','../client'];(function(_0x2b5df7,_0x120d9d){var _0x2a6797=function(_0x381e96){while(--_0x381e96){_0x2b5df7['push'](_0x2b5df7['shift']());}};_0x2a6797(++_0x120d9d);}(_0x70e0,0x17b));var _0x070e=function(_0x246250,_0x39a637){_0x246250=_0x246250-0x0;var _0x1a7d7a=_0x70e0[_0x246250];return _0x1a7d7a;};'use strict';var client=require(_0x070e('0x0'));exports[_0x070e('0x1')]=function(){return function(){return client[_0x070e('0x2')]('GetUser',{'options':{'raw':![],'where':{'role':'agent'},'attributes':['id',_0x070e('0x3'),_0x070e('0x4'),_0x070e('0x5'),_0x070e('0x6'),'online',_0x070e('0x7'),'pauseType',_0x070e('0x8'),'voicePause','phone','mobile',_0x070e('0x9')]},'log':_0x070e('0x1')});};};exports[_0x070e('0xa')]=function(){return function(){return client[_0x070e('0x2')](_0x070e('0xb'),{'options':{'raw':!![],'where':{'role':_0x070e('0xc')},'attributes':['id',_0x070e('0x3'),'accountcode','internal']},'log':_0x070e('0xa')});};};exports[_0x070e('0xd')]=function(_0x12bb37,_0xb8d819,_0xa927a2){return client[_0x070e('0x2')](_0x070e('0xe'),{'body':{'type':_0xb8d819,'uniqueid':_0xa927a2},'options':{'where':{'id':_0x12bb37['id']}},'log':_0x070e('0xd')});};exports[_0x070e('0xf')]=function(_0x5bf079){return client[_0x070e('0x2')]('UnpauseUser',{'body':{},'options':{'where':{'id':_0x5bf079['id']}},'log':'savePause'});};exports[_0x070e('0x10')]=function(_0x56c7ba){return client['Request']('ShowUser',{'options':{'raw':![],'where':{'role':_0x070e('0x11'),'id':_0x56c7ba},'attributes':['id',_0x070e('0x3'),'email','accountcode',_0x070e('0x6'),_0x070e('0x12'),_0x070e('0x7'),_0x070e('0x13'),'lastPauseAt','voicePause',_0x070e('0x9')]},'log':_0x070e('0x10')});}; \ No newline at end of file +var _0xe706=['internal','savePause','PauseUser','saveUnpause','UnpauseUser','ShowUser','getAgent','../client','getAgents','Request','agent','name','email','accountcode','fullname','online','lastLoginAt','pauseType','lastPauseAt','voicePause','phone','mobile','interface','getTelephones','GetUser','telephone'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0xe706,0xa3));var _0x6e70=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0xe706[_0x1ac595];return _0x455fff;};'use strict';var client=require(_0x6e70('0x0'));exports[_0x6e70('0x1')]=function(){return function(){return client[_0x6e70('0x2')]('GetUser',{'options':{'raw':![],'where':{'role':_0x6e70('0x3')},'attributes':['id',_0x6e70('0x4'),_0x6e70('0x5'),_0x6e70('0x6'),_0x6e70('0x7'),_0x6e70('0x8'),_0x6e70('0x9'),_0x6e70('0xa'),_0x6e70('0xb'),_0x6e70('0xc'),_0x6e70('0xd'),_0x6e70('0xe'),_0x6e70('0xf')]},'log':_0x6e70('0x1')});};};exports[_0x6e70('0x10')]=function(){return function(){return client[_0x6e70('0x2')](_0x6e70('0x11'),{'options':{'raw':!![],'where':{'role':_0x6e70('0x12')},'attributes':['id',_0x6e70('0x4'),_0x6e70('0x6'),_0x6e70('0x13')]},'log':_0x6e70('0x10')});};};exports[_0x6e70('0x14')]=function(_0x4600f9,_0x5b3d07,_0x47f6b2){return client[_0x6e70('0x2')](_0x6e70('0x15'),{'body':{'type':_0x5b3d07,'uniqueid':_0x47f6b2},'options':{'where':{'id':_0x4600f9['id']}},'log':_0x6e70('0x14')});};exports[_0x6e70('0x16')]=function(_0x3b38f3){return client[_0x6e70('0x2')](_0x6e70('0x17'),{'body':{},'options':{'where':{'id':_0x3b38f3['id']}},'log':_0x6e70('0x14')});};exports['getAgent']=function(_0x52737e){return client['Request'](_0x6e70('0x18'),{'options':{'raw':![],'where':{'role':'agent','id':_0x52737e},'attributes':['id','name',_0x6e70('0x5'),_0x6e70('0x6'),'fullname',_0x6e70('0x8'),'lastLoginAt',_0x6e70('0xa'),_0x6e70('0xb'),'voicePause','interface']},'log':_0x6e70('0x19')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceAgentReport.js b/server/services/ami/rpc/voiceAgentReport.js index da12859..62f4e3f 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 _0x7168=['../client','create','CreateVoiceAgentReport','Request','UpdateVoiceAgentReport'];(function(_0x50f6e5,_0x151ccb){var _0x5988c5=function(_0x490a93){while(--_0x490a93){_0x50f6e5['push'](_0x50f6e5['shift']());}};_0x5988c5(++_0x151ccb);}(_0x7168,0x159));var _0x8716=function(_0x112734,_0x471724){_0x112734=_0x112734-0x0;var _0x1c3e0d=_0x7168[_0x112734];return _0x1c3e0d;};'use strict';var client=require(_0x8716('0x0'));exports[_0x8716('0x1')]=function(_0x4877bd){return client['Request'](_0x8716('0x2'),{'body':_0x4877bd,'log':_0x8716('0x2')});};exports['update']=function(_0x8db912,_0x38f519,_0x325d4c){return client[_0x8716('0x3')](_0x8716('0x4'),{'body':_0x8db912,'options':{'where':{'uniqueid':_0x38f519,'interface':_0x325d4c,'agentcomplete':!![]}},'log':_0x8716('0x4')});}; \ No newline at end of file +var _0x7803=['UpdateVoiceAgentReport','../client','create','Request','CreateVoiceAgentReport','update'];(function(_0x4c764f,_0x4d27e2){var _0x4260eb=function(_0x3fefab){while(--_0x3fefab){_0x4c764f['push'](_0x4c764f['shift']());}};_0x4260eb(++_0x4d27e2);}(_0x7803,0x1db));var _0x3780=function(_0x2bc870,_0x637ff8){_0x2bc870=_0x2bc870-0x0;var _0x480ab0=_0x7803[_0x2bc870];return _0x480ab0;};'use strict';var client=require(_0x3780('0x0'));exports[_0x3780('0x1')]=function(_0xcf3360){return client[_0x3780('0x2')](_0x3780('0x3'),{'body':_0xcf3360,'log':_0x3780('0x3')});};exports[_0x3780('0x4')]=function(_0x36b332,_0x1d0009,_0x49a9ca){return client[_0x3780('0x2')](_0x3780('0x5'),{'body':_0x36b332,'options':{'where':{'uniqueid':_0x1d0009,'interface':_0x49a9ca,'agentcomplete':!![]}},'log':_0x3780('0x5')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceCallReport.js b/server/services/ami/rpc/voiceCallReport.js index c848368..b6c7077 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 _0xe2f1=['CreateVoiceCallReport','merge','calleridnum','context','DOCUMENTATION','Request','GetVoiceCallReport','outbound','day','format','YYYY-MM-DD\x20HH:mm:ss','type','billableseconds','moment','lodash','../client','create'];(function(_0x36312e,_0x541960){var _0x211ab3=function(_0x557afd){while(--_0x557afd){_0x36312e['push'](_0x36312e['shift']());}};_0x211ab3(++_0x541960);}(_0xe2f1,0x161));var _0x1e2f=function(_0x10004e,_0xd701e6){_0x10004e=_0x10004e-0x0;var _0x5af990=_0xe2f1[_0x10004e];return _0x5af990;};'use strict';var moment=require(_0x1e2f('0x0'));var util=require('util');var _=require(_0x1e2f('0x1'));var client=require(_0x1e2f('0x2'));exports[_0x1e2f('0x3')]=function(_0x4e385c){return client['Request'](_0x1e2f('0x4'),{'body':_[_0x1e2f('0x5')](_0x4e385c,{'source':_0x4e385c[_0x1e2f('0x6')],'destinationcontext':_0x4e385c[_0x1e2f('0x7')],'callerid':_0x4e385c['callerid'],'amaflags':_0x1e2f('0x8')}),'log':'CreateVoiceCallReport'});};exports['getVoiceCallReports']=function(){return function(){return client[_0x1e2f('0x9')](_0x1e2f('0xa'),{'options':{'where':{'type':[_0x1e2f('0xb')],'createdAt':{'$between':[moment()['startOf'](_0x1e2f('0xc'))[_0x1e2f('0xd')](_0x1e2f('0xe')),moment()['endOf']('day')[_0x1e2f('0xd')](_0x1e2f('0xe'))]}},'attributes':[_0x1e2f('0xf'),'disposition','duration',_0x1e2f('0x10')]},'log':'GetVoiceCallReports'});};}; \ No newline at end of file +var _0x0798=['create','Request','CreateVoiceCallReport','calleridnum','context','callerid','DOCUMENTATION','getVoiceCallReports','outbound','startOf','day','YYYY-MM-DD\x20HH:mm:ss','endOf','format','type','disposition','GetVoiceCallReports','util','lodash','../client'];(function(_0x147060,_0x163460){var _0x2cf92e=function(_0x2b24e3){while(--_0x2b24e3){_0x147060['push'](_0x147060['shift']());}};_0x2cf92e(++_0x163460);}(_0x0798,0xb1));var _0x8079=function(_0x28456d,_0x2c0ce5){_0x28456d=_0x28456d-0x0;var _0x533b61=_0x0798[_0x28456d];return _0x533b61;};'use strict';var moment=require('moment');var util=require(_0x8079('0x0'));var _=require(_0x8079('0x1'));var client=require(_0x8079('0x2'));exports[_0x8079('0x3')]=function(_0x707167){return client[_0x8079('0x4')](_0x8079('0x5'),{'body':_['merge'](_0x707167,{'source':_0x707167[_0x8079('0x6')],'destinationcontext':_0x707167[_0x8079('0x7')],'callerid':_0x707167[_0x8079('0x8')],'amaflags':_0x8079('0x9')}),'log':_0x8079('0x5')});};exports[_0x8079('0xa')]=function(){return function(){return client['Request']('GetVoiceCallReport',{'options':{'where':{'type':[_0x8079('0xb')],'createdAt':{'$between':[moment()[_0x8079('0xc')](_0x8079('0xd'))['format'](_0x8079('0xe')),moment()[_0x8079('0xf')](_0x8079('0xd'))[_0x8079('0x10')](_0x8079('0xe'))]}},'attributes':[_0x8079('0x11'),_0x8079('0x12'),'duration','billableseconds']},'log':_0x8079('0x13')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceDialReport.js b/server/services/ami/rpc/voiceDialReport.js index 5455f6d..b3e3a1d 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 _0xeb65=['CreateVoiceDialReport','../client','create','Request'];(function(_0x3826ad,_0x49a30d){var _0x17b900=function(_0x38474f){while(--_0x38474f){_0x3826ad['push'](_0x3826ad['shift']());}};_0x17b900(++_0x49a30d);}(_0xeb65,0x185));var _0x5eb6=function(_0x529325,_0x4a3d90){_0x529325=_0x529325-0x0;var _0x3b3915=_0xeb65[_0x529325];return _0x3b3915;};'use strict';var client=require(_0x5eb6('0x0'));exports[_0x5eb6('0x1')]=function(_0x1a6c5e){return client[_0x5eb6('0x2')](_0x5eb6('0x3'),{'body':_0x1a6c5e,'log':_0x5eb6('0x3')});}; \ No newline at end of file +var _0xa607=['CreateVoiceDialReport','../client','Request'];(function(_0x3f5317,_0x1c5cf){var _0x263cca=function(_0x21ce2c){while(--_0x21ce2c){_0x3f5317['push'](_0x3f5317['shift']());}};_0x263cca(++_0x1c5cf);}(_0xa607,0x184));var _0x7a60=function(_0x433b93,_0x40db4f){_0x433b93=_0x433b93-0x0;var _0x116edd=_0xa607[_0x433b93];return _0x116edd;};'use strict';var client=require(_0x7a60('0x0'));exports['create']=function(_0x3c4c91){return client[_0x7a60('0x1')](_0x7a60('0x2'),{'body':_0x3c4c91,'log':_0x7a60('0x2')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceExtension.js b/server/services/ami/rpc/voiceExtension.js index 9af4c6a..2c774c9 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 _0x9d02=['../client','Request','exten','getVoiceExtensions'];(function(_0x3c371a,_0x3893fa){var _0x1ad099=function(_0x5241f6){while(--_0x5241f6){_0x3c371a['push'](_0x3c371a['shift']());}};_0x1ad099(++_0x3893fa);}(_0x9d02,0x118));var _0x29d0=function(_0x57b5c2,_0x2b027f){_0x57b5c2=_0x57b5c2-0x0;var _0x2e24b1=_0x9d02[_0x57b5c2];return _0x2e24b1;};'use strict';var client=require(_0x29d0('0x0'));exports['getVoiceExtensions']=function(){return function(){return client[_0x29d0('0x1')]('GetVoiceExtension',{'options':{'raw':!![],'attributes':['id',_0x29d0('0x2'),'recordingFormat'],'where':{'VoiceExtensionId':null}},'log':_0x29d0('0x3')});};}; \ No newline at end of file +var _0xaf80=['getVoiceExtensions','Request','GetVoiceExtension','../client'];(function(_0xcf0e,_0x1d3e15){var _0x8d0e30=function(_0x194735){while(--_0x194735){_0xcf0e['push'](_0xcf0e['shift']());}};_0x8d0e30(++_0x1d3e15);}(_0xaf80,0x1ef));var _0x0af8=function(_0x5715b0,_0x4caaa5){_0x5715b0=_0x5715b0-0x0;var _0x319d2a=_0xaf80[_0x5715b0];return _0x319d2a;};'use strict';var client=require(_0x0af8('0x0'));exports[_0x0af8('0x1')]=function(){return function(){return client[_0x0af8('0x2')](_0x0af8('0x3'),{'options':{'raw':!![],'attributes':['id','exten','recordingFormat'],'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 ebdbd1f..c7ee728 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 _0x30f1=['dialAgiAfterHangupAgent','dialAgiAfterHangupClient','dialQueueProject2','monitor_format','strategy','dialRandomLastDigitCallerIdNumber','dialCutDigit','dialNoSuchNumberMaxRetry','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialAgentRejectMaxRetry','mandatoryDisposition','dialPredictiveIntervalMinThreshold','dialPreviewAutoRecallMe','Trunk','active','Pause','TrunkBackup','callerid','Interval','Intervals','interval','../client','getVoiceQueues','GetVoiceQueue','name','acwTimeout','autopause','type','dialActive','dialMethod','dialLimitQueue','dialPowerLevel','dialPredictiveOptimizationPercentage','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialGlobalMaxRetry','dialTimezone','dialCheckDuplicateType','dialAMDInitialSilence','dialAMDGreeting','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','timeout','dialRecallMeTimeout','dialRecallInQueue','dialOrderByScheduledAt'];(function(_0x55d478,_0x516f1b){var _0x3b35b3=function(_0x1738b6){while(--_0x1738b6){_0x55d478['push'](_0x55d478['shift']());}};_0x3b35b3(++_0x516f1b);}(_0x30f1,0xc9));var _0x130f=function(_0x25f093,_0x3570e4){_0x25f093=_0x25f093-0x0;var _0x3848e9=_0x30f1[_0x25f093];return _0x3848e9;};'use strict';var client=require(_0x130f('0x0'));exports[_0x130f('0x1')]=function(){return function(){return client['Request'](_0x130f('0x2'),{'options':{'raw':![],'attributes':['id',_0x130f('0x3'),'acw',_0x130f('0x4'),_0x130f('0x5'),'monitor_format',_0x130f('0x6'),_0x130f('0x7'),_0x130f('0x8'),'dialLimitChannel',_0x130f('0x9'),_0x130f('0xa'),'dialPredictiveOptimization',_0x130f('0xb'),'dialPredictiveInterval',_0x130f('0xc'),_0x130f('0xd'),_0x130f('0xe'),_0x130f('0xf'),_0x130f('0x10'),_0x130f('0x11'),_0x130f('0x12'),'dialCongestionRetryFrequency',_0x130f('0x13'),_0x130f('0x14'),_0x130f('0x15'),'dialNoAnswerRetryFrequency',_0x130f('0x16'),_0x130f('0x17'),'dialGlobalInterval','dialPrefix',_0x130f('0x18'),'dialAMDActive',_0x130f('0x19'),_0x130f('0x1a'),'dialAMDAfterGreetingSilence',_0x130f('0x1b'),_0x130f('0x1c'),_0x130f('0x1d'),_0x130f('0x1e'),'dialAMDSilenceThreshold','dialAMDMaximumWordLength',_0x130f('0x1f'),_0x130f('0x20'),_0x130f('0x21'),_0x130f('0x22'),_0x130f('0x23'),_0x130f('0x24'),_0x130f('0x25'),_0x130f('0x26'),_0x130f('0x27'),_0x130f('0x28'),_0x130f('0x29'),_0x130f('0x2a'),'dialNoSuchNumberRetryFrequency',_0x130f('0x2b'),_0x130f('0x2c'),'dialAbandonedMaxRetry',_0x130f('0x2d'),_0x130f('0x2e'),'dialMachineRetryFrequency',_0x130f('0x2f'),'dialAgentRejectRetryFrequency',_0x130f('0x30'),'dialPredictiveIntervalMaxThreshold',_0x130f('0x31'),_0x130f('0x32'),'dialPreviewRecallmeReminder'],'include':[{'model':_0x130f('0x33'),'as':_0x130f('0x33'),'attributes':['id',_0x130f('0x3'),'callerid',_0x130f('0x34')]},{'model':_0x130f('0x35'),'as':'mandatoryDispositionPause','attributes':['id',_0x130f('0x3')]},{'model':_0x130f('0x33'),'as':_0x130f('0x36'),'attributes':['id',_0x130f('0x3'),_0x130f('0x37'),'active']},{'model':_0x130f('0x38'),'as':_0x130f('0x38'),'attributes':['id','name'],'include':[{'model':_0x130f('0x38'),'as':_0x130f('0x39'),'attributes':['id',_0x130f('0x3'),_0x130f('0x3a')]}]}]},'log':_0x130f('0x1')});};}; \ No newline at end of file +var _0xf82b=['callerid','Interval','interval','../client','getVoiceQueues','Request','GetVoiceQueue','name','acwTimeout','autopause','monitor_format','type','dialMethod','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','dialQueueTimeout','dialQueueProject','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialPrefix','dialCheckDuplicateType','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDMaximumWordLength','timeout','dialRecallInQueue','dialOrderByScheduledAt','dialAgiAfterHangupClient','dialQueueProject2','strategy','dialRandomLastDigitCallerIdNumber','dialCutDigit','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','mandatoryDisposition','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','Trunk','active','TrunkBackup'];(function(_0x2d582c,_0x424a15){var _0x37e92a=function(_0x142fb1){while(--_0x142fb1){_0x2d582c['push'](_0x2d582c['shift']());}};_0x37e92a(++_0x424a15);}(_0xf82b,0x177));var _0xbf82=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xf82b[_0x2dafbe];return _0x58a45a;};'use strict';var client=require(_0xbf82('0x0'));exports[_0xbf82('0x1')]=function(){return function(){return client[_0xbf82('0x2')](_0xbf82('0x3'),{'options':{'raw':![],'attributes':['id',_0xbf82('0x4'),'acw',_0xbf82('0x5'),_0xbf82('0x6'),_0xbf82('0x7'),_0xbf82('0x8'),'dialActive',_0xbf82('0x9'),_0xbf82('0xa'),_0xbf82('0xb'),_0xbf82('0xc'),_0xbf82('0xd'),_0xbf82('0xe'),_0xbf82('0xf'),_0xbf82('0x10'),_0xbf82('0x11'),_0xbf82('0x12'),_0xbf82('0x13'),_0xbf82('0x14'),_0xbf82('0x15'),'dialCongestionMaxRetry',_0xbf82('0x16'),_0xbf82('0x17'),_0xbf82('0x18'),'dialNoAnswerMaxRetry',_0xbf82('0x19'),_0xbf82('0x1a'),'dialTimezone','dialGlobalInterval',_0xbf82('0x1b'),_0xbf82('0x1c'),'dialAMDActive',_0xbf82('0x1d'),_0xbf82('0x1e'),_0xbf82('0x1f'),'dialAMDTotalAnalysisTime',_0xbf82('0x20'),_0xbf82('0x21'),_0xbf82('0x22'),'dialAMDSilenceThreshold',_0xbf82('0x23'),_0xbf82('0x24'),'dialRecallMeTimeout',_0xbf82('0x25'),_0xbf82('0x26'),'dialAgiAfterHangupAgent',_0xbf82('0x27'),_0xbf82('0x28'),_0xbf82('0x7'),_0xbf82('0x29'),_0xbf82('0x2a'),_0xbf82('0x2b'),'dialNoSuchNumberMaxRetry',_0xbf82('0x2c'),_0xbf82('0x2d'),'dialDropRetryFrequency',_0xbf82('0x2e'),_0xbf82('0x2f'),_0xbf82('0x30'),'dialMachineRetryFrequency',_0xbf82('0x31'),_0xbf82('0x32'),_0xbf82('0x33'),_0xbf82('0x34'),_0xbf82('0x35'),_0xbf82('0x36'),_0xbf82('0x37')],'include':[{'model':_0xbf82('0x38'),'as':_0xbf82('0x38'),'attributes':['id',_0xbf82('0x4'),'callerid',_0xbf82('0x39')]},{'model':'Pause','as':'mandatoryDispositionPause','attributes':['id',_0xbf82('0x4')]},{'model':_0xbf82('0x38'),'as':_0xbf82('0x3a'),'attributes':['id','name',_0xbf82('0x3b'),_0xbf82('0x39')]},{'model':_0xbf82('0x3c'),'as':'Interval','attributes':['id',_0xbf82('0x4')],'include':[{'model':'Interval','as':'Intervals','attributes':['id',_0xbf82('0x4'),_0xbf82('0x3d')]}]}]},'log':'getVoiceQueues'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueueReport.js b/server/services/ami/rpc/voiceQueueReport.js index e3e9e78..9331b98 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(_0x24cb42,_0x2ef29c){var _0xf7f133=function(_0xddff37){while(--_0xddff37){_0x24cb42['push'](_0x24cb42['shift']());}};_0xf7f133(++_0x2ef29c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47b58b,_0x41a189){_0x47b58b=_0x47b58b-0x0;var _0x46bebe=_0xa9e0[_0x47b58b];return _0x46bebe;};'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(_0x315f71,_0x1c641d){var _0x39635e=function(_0x4d62ed){while(--_0x4d62ed){_0x315f71['push'](_0x315f71['shift']());}};_0x39635e(++_0x1c641d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1b349a,_0x22222c){_0x1b349a=_0x1b349a-0x0;var _0x5d1f7c=_0xa9e0[_0x1b349a];return _0x5d1f7c;};'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 8b4575c..3ed7d89 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 _0x8652=['getVoiceQueueRtPauses'];(function(_0xa5a359,_0x29ca65){var _0x17402e=function(_0x116f55){while(--_0x116f55){_0xa5a359['push'](_0xa5a359['shift']());}};_0x17402e(++_0x29ca65);}(_0x8652,0x9e));var _0x2865=function(_0x4e0eb6,_0x240784){_0x4e0eb6=_0x4e0eb6-0x0;var _0x46e432=_0x8652[_0x4e0eb6];return _0x46e432;};'use strict';var client=require('../client');exports[_0x2865('0x0')]=function(_0x5c69b4){return function(){return client['Request']('GetVoiceQueueRtPauses',{'options':{'where':{'VoiceQueueId':_0x5c69b4,'paused':!![]},'raw':!![]},'log':_0x2865('0x0')});};}; \ No newline at end of file +var _0xb5de=['getVoiceQueueRtPauses','Request','../client'];(function(_0x51b986,_0x3ecba3){var _0x513358=function(_0x2f1cb8){while(--_0x2f1cb8){_0x51b986['push'](_0x51b986['shift']());}};_0x513358(++_0x3ecba3);}(_0xb5de,0x1be));var _0xeb5d=function(_0x3fb423,_0x2f7c0d){_0x3fb423=_0x3fb423-0x0;var _0x1438b0=_0xb5de[_0x3fb423];return _0x1438b0;};'use strict';var client=require(_0xeb5d('0x0'));exports[_0xeb5d('0x1')]=function(_0x56b69f){return function(){return client[_0xeb5d('0x2')]('GetVoiceQueueRtPauses',{'options':{'where':{'VoiceQueueId':_0x56b69f,'paused':!![]},'raw':!![]},'log':_0xeb5d('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceRecording.js b/server/services/ami/rpc/voiceRecording.js index a6d621f..afb6522 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(_0x43fdb2,_0x24568f){var _0xd56b13=function(_0x247a61){while(--_0x247a61){_0x43fdb2['push'](_0x43fdb2['shift']());}};_0xd56b13(++_0x24568f);}(_0x7a54,0x106));var _0x47a5=function(_0x159918,_0x1339b0){_0x159918=_0x159918-0x0;var _0x28d38d=_0x7a54[_0x159918];return _0x28d38d;};'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(_0x379166,_0x46c194){var _0x5e3f5b=function(_0x496724){while(--_0x496724){_0x379166['push'](_0x379166['shift']());}};_0x5e3f5b(++_0x46c194);}(_0x7a54,0x106));var _0x47a5=function(_0x4d9775,_0x23812a){_0x4d9775=_0x4d9775-0x0;var _0x2c1bcd=_0x7a54[_0x4d9775];return _0x2c1bcd;};'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 64fc99f..f2217a1 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 _0xe2c5=['transfererlinkedid','transfereechannel','transfereecalleridnum','transfereecalleridname','transfereeconnectedlinenum','transfereeconnectedlinename','transfereeaccountcode','transfereecontext','transfereeexten','transfereelinkedid','context','extension','result','origtransfererchannel','origtransferercalleridname','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','secondtransferercontext','secondtransfererexten','transfertargetchannel','transfertargetcalleridnum','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetcontext','transfertargetexten','isexternal','origtransferercontext','origtransfererexten','../client','blindTransfer','Request','CreateVoiceTransferReport','transfererchannel','transferercalleridname','transfererconnectedlinenum','transfererconnectedlinename','transfereraccountcode','transfererexten'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe2c5,0x198));var _0x5e2c=function(_0xfbe06e,_0x2fb7ab){_0xfbe06e=_0xfbe06e-0x0;var _0x24e5b6=_0xe2c5[_0xfbe06e];return _0x24e5b6;};'use strict';var client=require(_0x5e2c('0x0'));exports['transfers']={};exports[_0x5e2c('0x1')]=function(_0x1ece50){return client[_0x5e2c('0x2')](_0x5e2c('0x3'),{'body':{'result':_0x1ece50['result'],'transfererchannel':_0x1ece50[_0x5e2c('0x4')],'transferercalleridnum':_0x1ece50['transferercalleridnum'],'transferercalleridname':_0x1ece50[_0x5e2c('0x5')],'transfererconnectedlinenum':_0x1ece50[_0x5e2c('0x6')],'transfererconnectedlinename':_0x1ece50[_0x5e2c('0x7')],'transfereraccountcode':_0x1ece50[_0x5e2c('0x8')],'transferercontext':_0x1ece50['transferercontext'],'transfererexten':_0x1ece50[_0x5e2c('0x9')],'transfererlinkedid':_0x1ece50[_0x5e2c('0xa')],'transfereechannel':_0x1ece50[_0x5e2c('0xb')],'transfereecalleridnum':_0x1ece50[_0x5e2c('0xc')],'transfereecalleridname':_0x1ece50[_0x5e2c('0xd')],'transfereeconnectedlinenum':_0x1ece50[_0x5e2c('0xe')],'transfereeconnectedlinename':_0x1ece50[_0x5e2c('0xf')],'transfereeaccountcode':_0x1ece50[_0x5e2c('0x10')],'transfereecontext':_0x1ece50[_0x5e2c('0x11')],'transfereeexten':_0x1ece50[_0x5e2c('0x12')],'transfereelinkedid':_0x1ece50[_0x5e2c('0x13')],'isexternal':_0x1ece50['isexternal'],'context':_0x1ece50[_0x5e2c('0x14')],'extension':_0x1ece50[_0x5e2c('0x15')],'type':'blind'},'log':_0x5e2c('0x3')});};exports['attendedTransfer']=function(_0x23186f){return client['Request'](_0x5e2c('0x3'),{'body':{'result':_0x23186f[_0x5e2c('0x16')],'transfererchannel':_0x23186f[_0x5e2c('0x17')],'transferercalleridnum':_0x23186f['origtransferercalleridnum'],'transferercalleridname':_0x23186f[_0x5e2c('0x18')],'transfererconnectedlinenum':_0x23186f[_0x5e2c('0x19')],'transfererconnectedlinename':_0x23186f[_0x5e2c('0x1a')],'transfereraccountcode':_0x23186f['origtransfereraccountcode'],'transferercontext':_0x23186f[_0x5e2c('0x1b')],'transfererexten':_0x23186f[_0x5e2c('0x1c')],'transfererlinkedid':_0x23186f['origtransfererlinkedid'],'transfereechannel':_0x23186f[_0x5e2c('0x1d')],'transfereecalleridnum':_0x23186f[_0x5e2c('0x1e')],'transfereecalleridname':_0x23186f[_0x5e2c('0x1f')],'transfereeconnectedlinenum':_0x23186f[_0x5e2c('0x20')],'transfereeconnectedlinename':_0x23186f['transfertargetconnectedlinename'],'transfereeaccountcode':_0x23186f['transfertargetaccountcode'],'transfereecontext':_0x23186f[_0x5e2c('0x21')],'transfereeexten':_0x23186f[_0x5e2c('0x22')],'transfereelinkedid':_0x23186f['transfertargetlinkedid'],'isexternal':_0x23186f[_0x5e2c('0x23')],'context':_0x23186f[_0x5e2c('0x24')],'extension':_0x23186f[_0x5e2c('0x25')],'type':'attended'},'log':_0x5e2c('0x3')});}; \ No newline at end of file +var _0x7156=['Request','CreateVoiceTransferReport','result','transferercalleridnum','transferercalleridname','transfererconnectedlinenum','transfererconnectedlinename','transfereraccountcode','transferercontext','transfererlinkedid','transfereechannel','transfereecalleridname','transfereeconnectedlinenum','transfereeaccountcode','transfereeexten','isexternal','context','extension','blind','origtransferercalleridname','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','origtransfererlinkedid','transfertargetchannel','transfertargetcalleridnum','transfertargetcalleridname','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten','transfertargetlinkedid','origtransferercontext','origtransfererexten','attended','transfers','blindTransfer'];(function(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0x7156,0x14b));var _0x6715=function(_0x294199,_0x23e0b4){_0x294199=_0x294199-0x0;var _0x524936=_0x7156[_0x294199];return _0x524936;};'use strict';var client=require('../client');exports[_0x6715('0x0')]={};exports[_0x6715('0x1')]=function(_0xdee4b9){return client[_0x6715('0x2')](_0x6715('0x3'),{'body':{'result':_0xdee4b9[_0x6715('0x4')],'transfererchannel':_0xdee4b9['transfererchannel'],'transferercalleridnum':_0xdee4b9[_0x6715('0x5')],'transferercalleridname':_0xdee4b9[_0x6715('0x6')],'transfererconnectedlinenum':_0xdee4b9[_0x6715('0x7')],'transfererconnectedlinename':_0xdee4b9[_0x6715('0x8')],'transfereraccountcode':_0xdee4b9[_0x6715('0x9')],'transferercontext':_0xdee4b9[_0x6715('0xa')],'transfererexten':_0xdee4b9['transfererexten'],'transfererlinkedid':_0xdee4b9[_0x6715('0xb')],'transfereechannel':_0xdee4b9[_0x6715('0xc')],'transfereecalleridnum':_0xdee4b9['transfereecalleridnum'],'transfereecalleridname':_0xdee4b9[_0x6715('0xd')],'transfereeconnectedlinenum':_0xdee4b9[_0x6715('0xe')],'transfereeconnectedlinename':_0xdee4b9['transfereeconnectedlinename'],'transfereeaccountcode':_0xdee4b9[_0x6715('0xf')],'transfereecontext':_0xdee4b9['transfereecontext'],'transfereeexten':_0xdee4b9[_0x6715('0x10')],'transfereelinkedid':_0xdee4b9['transfereelinkedid'],'isexternal':_0xdee4b9[_0x6715('0x11')],'context':_0xdee4b9[_0x6715('0x12')],'extension':_0xdee4b9[_0x6715('0x13')],'type':_0x6715('0x14')},'log':'CreateVoiceTransferReport'});};exports['attendedTransfer']=function(_0x158305){return client['Request'](_0x6715('0x3'),{'body':{'result':_0x158305[_0x6715('0x4')],'transfererchannel':_0x158305['origtransfererchannel'],'transferercalleridnum':_0x158305['origtransferercalleridnum'],'transferercalleridname':_0x158305[_0x6715('0x15')],'transfererconnectedlinenum':_0x158305['secondtransfererconnectedlinenum'],'transfererconnectedlinename':_0x158305[_0x6715('0x16')],'transfereraccountcode':_0x158305[_0x6715('0x17')],'transferercontext':_0x158305[_0x6715('0x18')],'transfererexten':_0x158305['secondtransfererexten'],'transfererlinkedid':_0x158305[_0x6715('0x19')],'transfereechannel':_0x158305[_0x6715('0x1a')],'transfereecalleridnum':_0x158305[_0x6715('0x1b')],'transfereecalleridname':_0x158305[_0x6715('0x1c')],'transfereeconnectedlinenum':_0x158305['transfertargetconnectedlinenum'],'transfereeconnectedlinename':_0x158305[_0x6715('0x1d')],'transfereeaccountcode':_0x158305[_0x6715('0x1e')],'transfereecontext':_0x158305[_0x6715('0x1f')],'transfereeexten':_0x158305[_0x6715('0x20')],'transfereelinkedid':_0x158305[_0x6715('0x21')],'isexternal':_0x158305[_0x6715('0x11')],'context':_0x158305[_0x6715('0x22')],'extension':_0x158305[_0x6715('0x23')],'type':_0x6715('0x24')},'log':_0x6715('0x3')});}; \ No newline at end of file diff --git a/server/services/ami/server/index.js b/server/services/ami/server/index.js index 0692a0d..7e102e4 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 _0x7a54=['http','127.0.0.1','log','RPC\x20listening\x20on\x20port:','lodash','util','jayson/promise','moment','../../../config/environment','../ami','../model/voiceQueueSummary','listen','name','timers','updateAcw','agents','updateStatusRealtime','voiceStatus','pause','isConnected','error','asterisk','ami\x20disconnected','join','pick','keys','reload','Reload','message','catch','username','command','action','Command','then','voiceQueues','hasOwnProperty','push','length','find','omit','undefined','values','channels','validate','map','uniqueid','channel','format','wav','MixMonitor','ai(mixmonitorid)','monitors','/var/spool/asterisk/monitor/','isNil','toLowerCase','mixmonitorid','rec','status','Channel\x20doesn\x27t\x20exist','Action','StopMixMonitor','destinationchannel','stop','filename','queueChannels','type','outbound','includes','Invalid\x20type\x20parameter.\x20Allowed\x20values:\x20inbound,\x20outbound','filter','count','rows','voicequeuechannelhangup','voicequeuechannelredirect','Redirect','exten','context','telephones','trunks','outboundChannels','run','custom:','event','faxAccounts','send'];(function(_0x595348,_0x22a8e0){var _0x1db706=function(_0x45b2e7){while(--_0x45b2e7){_0x595348['push'](_0x595348['shift']());}};_0x1db706(++_0x22a8e0);}(_0x7a54,0x106));var _0x47a5=function(_0x4406d4,_0x42645a){_0x4406d4=_0x4406d4-0x0;var _0x15bea6=_0x7a54[_0x4406d4];return _0x15bea6;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var jayson=require(_0x47a5('0x2'));var schema=require('validate');var moment=require(_0x47a5('0x3'));var config=require(_0x47a5('0x4'));var properties=require('../properties');var ami=require(_0x47a5('0x5'));var VoiceQueueSummary=require(_0x47a5('0x6'));exports[_0x47a5('0x7')]=function(_0x3717e1,_0xfdf934,_0x545a97){return new Promise(function(_0x3d5629,_0x59199c){var _0x343372={'QueuePause':function(_0x30e405){return new Promise(function(_0x506eda){var _0x194fb0=util['format']('%s/%s','SIP',_0x30e405[_0x47a5('0x8')]);if(_0x3717e1[_0x47a5('0x9')]&&_0x3717e1['timers'][_0x194fb0]&&_0x3717e1[_0x47a5('0x9')][_0x194fb0]['timer']){_0x3717e1['timers'][_0x194fb0][_0x47a5('0xa')]();}if(_0x3717e1[_0x47a5('0xb')][_0x194fb0]){_0x3717e1[_0x47a5('0xb')][_0x194fb0][_0x47a5('0xc')]({'state':_0x3717e1[_0x47a5('0xb')][_0x194fb0][_0x47a5('0xd')],'statePause':_0x30e405[_0x47a5('0xe')]?!![]:![]});}_0x506eda({'code':0xc8,'message':'QueuePause'});});},'Reload':function(_0x44bd3e){var _0x221b54=this;return new Promise(function(_0x1cf309,_0x711793){if(ami[_0x47a5('0xf')]()==![]){return _0x711793(_0x221b54[_0x47a5('0x10')](0x1f4,[config[_0x47a5('0x11')]['ip'],config[_0x47a5('0x11')]['username'],_0x47a5('0x12')][_0x47a5('0x13')]('\x20')));}_0x44bd3e=_[_0x47a5('0x14')](_0x44bd3e,_[_0x47a5('0x15')](properties[_0x47a5('0x16')]['module']));_0x44bd3e['action']=_0x47a5('0x17');return ami['Action'](_0x44bd3e)['then'](function(_0x423a81){_0x1cf309({'code':0xc8,'message':_0x423a81[_0x47a5('0x18')]});})[_0x47a5('0x19')](function(_0x1ef371){_0x711793(_0x221b54[_0x47a5('0x10')](0x1f5,_0x1ef371[_0x47a5('0x18')]));});});},'Command':function(_0x2763d6){var _0xe3c618=this;return new Promise(function(_0x3aed38,_0x4a9fcb){if(ami[_0x47a5('0xf')]()==![]){return _0x4a9fcb(_0xe3c618[_0x47a5('0x10')](0x1f4,[config['asterisk']['ip'],config[_0x47a5('0x11')][_0x47a5('0x1a')],_0x47a5('0x12')]['join']('\x20')));}_0x2763d6=_[_0x47a5('0x14')](_0x2763d6,_0x47a5('0x1b'));_0x2763d6[_0x47a5('0x1c')]=_0x47a5('0x1d');return ami['Action'](_0x2763d6)[_0x47a5('0x1e')](function(_0x385687){_0x3aed38({'code':0xc8,'message':_0x385687['content']});})[_0x47a5('0x19')](function(_0xc4cd63){_0x4a9fcb(_0xe3c618[_0x47a5('0x10')](0x1f5,_0xc4cd63[_0x47a5('0x18')]));});});},'VoiceQueues':function(){return new Promise(function(_0x3abd6a){var _0x50bf17=[];for(var _0x53078a in _0x3717e1[_0x47a5('0x1f')]){if(_0x3717e1['voiceQueues'][_0x47a5('0x20')](_0x53078a)){var _0x5b6c4e=_0x3717e1[_0x47a5('0x1f')][_0x53078a];var _0x378208=new VoiceQueueSummary(_0x5b6c4e);_0x50bf17[_0x47a5('0x21')](_0x378208);}}_0x3abd6a({'count':_0x50bf17[_0x47a5('0x22')],'rows':_0x50bf17});});},'UpdateVoiceQueue':function(_0x21f296){return new Promise(function(_0x3ba0b7,_0x24b162){var _0x136b14=_[_0x47a5('0x23')](_0x3717e1[_0x47a5('0x1f')],{'id':parseInt(_0x21f296['id'])});var _0x1127f8=_[_0x47a5('0x24')](_0x21f296,['id']);if(_0x136b14){for(var _0x3ad507 in _0x1127f8){if(typeof _0x1127f8[_0x3ad507]!=='undefined'&&typeof _0x136b14[_0x3ad507]!==_0x47a5('0x25')){_0x136b14[_0x3ad507]=_0x1127f8[_0x3ad507];}}_0x3ba0b7(_0x136b14);}else{_0x24b162();}});},'VoiceChannels':function(){return new Promise(function(_0x51833b){var _0x2ef875=_[_0x47a5('0x26')](_0x3717e1[_0x47a5('0x27')]);_0x51833b({'count':_0x2ef875['length'],'rows':_0x2ef875});});},'VoiceChannelMixMonitor':function(_0x256650){var _0x625952=this;return new Promise(function(_0x39b50b,_0x1f1c68){if(ami['isConnected']()==![]){return _0x1f1c68(_0x625952['error'](0x1f4,[config[_0x47a5('0x11')]['ip'],config[_0x47a5('0x11')]['username'],'ami\x20disconnected'][_0x47a5('0x13')]('\x20')));}var _0x51544e=schema(properties['voicechannel'])[_0x47a5('0x28')](_0x256650);if(_0x51544e['length']>0x0){return _0x1f1c68(_0x625952[_0x47a5('0x10')](0x1f4,_[_0x47a5('0x29')](_0x51544e,'message')['join'](',\x20')));}var _0x274e34=_['find'](_0x3717e1[_0x47a5('0x27')],{'uniqueid':_0x256650[_0x47a5('0x2a')]});if(_0x274e34&&_0x274e34[_0x47a5('0x2b')]){var _0x52749b=util[_0x47a5('0x2c')]('%s.%s',_0x256650['filename']||_0x256650[_0x47a5('0x2a')],_0x256650['format']||_0x47a5('0x2d'));return ami['Action']({'action':_0x47a5('0x2e'),'channel':_0x274e34[_0x47a5('0x2b')],'file':_0x52749b,'options':_0x47a5('0x2f')})[_0x47a5('0x1e')](function(_0x36add5){var _0xed6320=_[_0x47a5('0x23')](_0x274e34[_0x47a5('0x30')],{'filename':_0x47a5('0x31')+_0x52749b['toLowerCase']()});if(_[_0x47a5('0x32')](_0xed6320)){_0x274e34[_0x47a5('0x30')]['push']({'filename':_0x47a5('0x31')+_0x52749b[_0x47a5('0x33')](),'createdAt':moment()[_0x47a5('0x2c')]('YYYY-MM-DD\x20HH:mm:ss'),'mixmonitorid':_0x36add5[_0x47a5('0x34')],'status':_0x47a5('0x35')});}else{_0xed6320['mixmonitorid']=_0x36add5[_0x47a5('0x34')];_0xed6320[_0x47a5('0x36')]='rec';}_0x39b50b({'code':0xc8,'message':[_0x256650['uniqueid'],'MixMonitor\x20Success',_0x36add5[_0x47a5('0x34')]]['join']('\x20'),'mixmonitorid':_0x36add5[_0x47a5('0x34')]});})[_0x47a5('0x19')](function(_0x301a85){_0x1f1c68(_0x625952[_0x47a5('0x10')](0x1f5,[_0x256650[_0x47a5('0x2a')],_0x301a85[_0x47a5('0x18')][_0x47a5('0x33')]()][_0x47a5('0x13')]('\x20')));});}else{return _0x1f1c68(_0x625952[_0x47a5('0x10')](0x1f5,_0x47a5('0x37')));}});},'VoiceChannelStopMixMonitor':function(_0x280500){var _0x1658e8=this;return new Promise(function(_0x23d6d8,_0x56dbbd){if(ami[_0x47a5('0xf')]()==![]){return _0x56dbbd(_0x1658e8[_0x47a5('0x10')](0x1f4,[config[_0x47a5('0x11')]['ip'],config[_0x47a5('0x11')]['username'],_0x47a5('0x12')]['join']('\x20')));}var _0x47c7a2=schema(properties['voicechannel'])['validate'](_0x280500);if(_0x47c7a2[_0x47a5('0x22')]>0x0){return _0x56dbbd(_0x1658e8['error'](0x1f4,_[_0x47a5('0x29')](_0x47c7a2,_0x47a5('0x18'))[_0x47a5('0x13')](',\x20')));}var _0x494526=_[_0x47a5('0x23')](_0x3717e1[_0x47a5('0x27')],{'uniqueid':_0x280500['uniqueid']});if(_0x494526){return Promise['resolve']()[_0x47a5('0x1e')](function(){if(_0x494526['channel']){return ami[_0x47a5('0x38')]({'action':_0x47a5('0x39'),'channel':_0x494526[_0x47a5('0x2b')],'mixmonitorid':_0x280500[_0x47a5('0x34')]})[_0x47a5('0x19')](function(){});}})[_0x47a5('0x1e')](function(){if(_0x494526[_0x47a5('0x3a')]){return ami[_0x47a5('0x38')]({'action':_0x47a5('0x39'),'channel':_0x494526[_0x47a5('0x3a')],'mixmonitorid':_0x280500[_0x47a5('0x34')]})[_0x47a5('0x19')](function(){});}})[_0x47a5('0x1e')](function(){var _0x3574d4=_[_0x47a5('0x23')](_0x494526[_0x47a5('0x30')],{'mixmonitorid':_0x280500['mixmonitorid']});if(_0x3574d4){_0x3574d4[_0x47a5('0x36')]=_0x47a5('0x3b');}})['then'](function(){var _0x52b3a8=util[_0x47a5('0x2c')]('%s.%s',_0x280500[_0x47a5('0x3c')]||_0x280500[_0x47a5('0x2a')],_0x280500['format']||'wav');var _0x3d85cc=_['find'](_0x494526[_0x47a5('0x30')],{'filename':_0x47a5('0x31')+_0x52b3a8[_0x47a5('0x33')]()});if(_0x3d85cc){_0x3d85cc[_0x47a5('0x36')]=_0x47a5('0x3b');}})[_0x47a5('0x1e')](function(){_0x23d6d8({'code':0xc8,'message':[_0x280500[_0x47a5('0x2a')],'StopMixMonitor\x20Success']['join']('\x20')});})[_0x47a5('0x19')](function(_0x411230){_0x56dbbd(_0x1658e8[_0x47a5('0x10')](0x1f5,[_0x280500[_0x47a5('0x2a')],_0x411230[_0x47a5('0x18')][_0x47a5('0x33')]()][_0x47a5('0x13')]('\x20')));});}else{return _0x56dbbd(_0x1658e8['error'](0x1f5,_0x47a5('0x37')));}});},'VoiceQueuesChannels':function(_0x1c9a62){var _0x5f6a=this;return new Promise(function(_0x5c3c75){var _0x12ca40=_['values'](_0x3717e1[_0x47a5('0x3d')]);var _0xe31817={'count':_0x12ca40[_0x47a5('0x22')],'rows':_0x12ca40};if(_0x1c9a62&&_0x1c9a62[_0x47a5('0x3e')]){if(!['inbound',_0x47a5('0x3f')][_0x47a5('0x40')](_0x1c9a62[_0x47a5('0x3e')])){return _0x59199c(_0x5f6a[_0x47a5('0x10')](0x190,_0x47a5('0x41')));}var _0x6a53b3=_[_0x47a5('0x42')](_0x12ca40,function(_0x481089){return _0x481089[_0x47a5('0x3e')]===_0x1c9a62[_0x47a5('0x3e')];});_0xe31817[_0x47a5('0x43')]=_0x6a53b3[_0x47a5('0x22')];_0xe31817[_0x47a5('0x44')]=_0x6a53b3;}_0x5c3c75(_0xe31817);});},'VoiceQueuesChannel':function(_0x1ab0bf){var _0x572233=this;return new Promise(function(_0x1ad6a9,_0x245a15){var _0x1aa581=schema(properties['voicequeuechannel'])[_0x47a5('0x28')](_0x1ab0bf);if(_0x1aa581[_0x47a5('0x22')]>0x0){return _0x245a15(_0x572233[_0x47a5('0x10')](0x1f4,_['map'](_0x1aa581,'message')[_0x47a5('0x13')](',\x20')));}var _0x376e1d=_['find'](_0x3717e1['queueChannels'],{'uniqueid':_0x1ab0bf[_0x47a5('0x2a')]});if(_0x376e1d){_0x1ad6a9(_0x376e1d);}else{return _0x245a15(_0x572233['error'](0x1f5,_0x47a5('0x37')));}});},'VoiceQueuesChannelHangup':function(_0x5d383d){var _0x482de6=this;return new Promise(function(_0x389ed9,_0x46d2d3){if(ami['isConnected']()==![]){return _0x46d2d3(_0x482de6[_0x47a5('0x10')](0x1f4,[config[_0x47a5('0x11')]['ip'],config['asterisk']['username'],_0x47a5('0x12')][_0x47a5('0x13')]('\x20')));}var _0x867da0=schema(properties[_0x47a5('0x45')])['validate'](_0x5d383d);if(_0x867da0[_0x47a5('0x22')]>0x0){return _0x46d2d3(_0x482de6[_0x47a5('0x10')](0x1f4,_[_0x47a5('0x29')](_0x867da0,'message')[_0x47a5('0x13')](',\x20')));}var _0x4db625=_[_0x47a5('0x23')](_0x3717e1[_0x47a5('0x3d')],{'uniqueid':_0x5d383d[_0x47a5('0x2a')]});if(_0x4db625&&_0x4db625[_0x47a5('0x2b')]){return ami[_0x47a5('0x38')]({'action':'Hangup','channel':_0x4db625[_0x47a5('0x2b')]})['then'](function(_0x5cbe97){_0x389ed9({'code':0xc8,'message':[_0x5d383d['uniqueid'],_0x5cbe97['message'][_0x47a5('0x33')]()][_0x47a5('0x13')]('\x20')});})[_0x47a5('0x19')](function(_0x52e3ee){_0x46d2d3(_0x482de6['error'](0x1f5,[_0x5d383d[_0x47a5('0x2a')],_0x52e3ee[_0x47a5('0x18')][_0x47a5('0x33')]()][_0x47a5('0x13')]('\x20')));});}else{return _0x46d2d3(_0x482de6[_0x47a5('0x10')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannelRedirect':function(_0x3474b7){var _0x519e9e=this;return new Promise(function(_0x22c886,_0x274d31){if(ami['isConnected']()==![]){return _0x274d31(_0x519e9e[_0x47a5('0x10')](0x1f4,[config[_0x47a5('0x11')]['ip'],config[_0x47a5('0x11')][_0x47a5('0x1a')],_0x47a5('0x12')][_0x47a5('0x13')]('\x20')));}var _0x35cca8=schema(properties[_0x47a5('0x46')])['validate'](_0x3474b7);if(_0x35cca8[_0x47a5('0x22')]>0x0){return _0x274d31(_0x519e9e[_0x47a5('0x10')](0x1f4,_[_0x47a5('0x29')](_0x35cca8,_0x47a5('0x18'))[_0x47a5('0x13')](',\x20')));}var _0x4bbe14=_[_0x47a5('0x23')](_0x3717e1[_0x47a5('0x3d')],{'uniqueid':_0x3474b7[_0x47a5('0x2a')]});if(_0x4bbe14&&_0x4bbe14[_0x47a5('0x2b')]){return ami[_0x47a5('0x38')]({'action':_0x47a5('0x47'),'channel':_0x4bbe14[_0x47a5('0x2b')],'exten':_0x3474b7[_0x47a5('0x48')],'context':_0x3474b7[_0x47a5('0x49')]||_0x4bbe14[_0x47a5('0x49')],'priority':0x1})[_0x47a5('0x1e')](function(_0x44fda9){_0x22c886({'code':0xc8,'message':[_0x3474b7[_0x47a5('0x2a')],_0x44fda9[_0x47a5('0x18')][_0x47a5('0x33')]()]['join']('\x20')});})[_0x47a5('0x19')](function(_0x284fb8){_0x274d31(_0x519e9e[_0x47a5('0x10')](0x1f5,[_0x3474b7['uniqueid'],_0x284fb8[_0x47a5('0x18')][_0x47a5('0x33')]()][_0x47a5('0x13')]('\x20')));});}else{return _0x274d31(_0x519e9e[_0x47a5('0x10')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'Agents':function(_0x3ac402){return new Promise(function(_0x522ccf){var _0x2d5ee6=_['values'](_0x3717e1[_0x47a5('0xb')]);if(_0x3ac402&&_0x3ac402['id']){var _0x4cf7c5=_[_0x47a5('0x23')](_0x2d5ee6,function(_0x2f27c3){return _0x2f27c3['id']===_0x3ac402['id'];});_0x522ccf(_0x4cf7c5);}else{_0x522ccf({'count':_0x2d5ee6[_0x47a5('0x22')],'rows':_0x2d5ee6});}});},'Telephones':function(){return new Promise(function(_0x58473b){var _0x4af557=_['values'](_0x3717e1[_0x47a5('0x4a')]);_0x58473b({'count':_0x4af557[_0x47a5('0x22')],'rows':_0x4af557});});},'Trunks':function(){return new Promise(function(_0xe3c0a7){var _0x117510=_['values'](_0x3717e1[_0x47a5('0x4b')]);_0xe3c0a7({'count':_0x117510[_0x47a5('0x22')],'rows':_0x117510});});},'OutboundChannels':function(){return new Promise(function(_0x390bc0){var _0xd5b23f=_[_0x47a5('0x26')](_0x3717e1[_0x47a5('0x4c')]);_0x390bc0({'count':_0xd5b23f[_0x47a5('0x22')],'rows':_0xd5b23f});});},'Outbound':function(){return new Promise(function(_0x39939a){_0x39939a(_0x3717e1[_0x47a5('0x3f')]);});},'Campaigns':function(){return new Promise(function(_0xc69a68){var _0x2e6fcc=_[_0x47a5('0x26')](_0x3717e1['campaigns']);_0xc69a68({'count':_0x2e6fcc[_0x47a5('0x22')],'rows':_0x2e6fcc});});},'VoiceQueuesPreview':function(_0x4833be){var _0x2ad00a=this;return new Promise(function(_0x2ac30f,_0x281e5f){_0xfdf934[_0x47a5('0x4d')](_0x4833be['id'])[_0x47a5('0x1e')](function(_0xa9c853){_0x2ac30f({'code':0xc8,'message':_0xa9c853[_0x47a5('0x18')]});})[_0x47a5('0x19')](function(_0x11c1db){_0x281e5f(_0x2ad00a[_0x47a5('0x10')](0x1f4,_0x11c1db[_0x47a5('0x18')]));});});},'EventManager':function(_0x1f07ac){var _0x8f0035=this;return new Promise(function(_0x2d434c,_0x441d64){if(!_0x1f07ac['event']){return _0x441d64(_0x8f0035['error'](0x1f4,'Event\x20name\x20mandatory'));}ami['emit'](_0x47a5('0x4e')+_0x1f07ac[_0x47a5('0x4f')],_0x1f07ac['message']);_0x2d434c({'code':0xc8,'message':_0x1f07ac});});},'FaxAccounts':function(){return new Promise(function(_0x732e00){var _0x44dda2=_[_0x47a5('0x26')](_0x3717e1[_0x47a5('0x50')]);_0x732e00({'count':_0x44dda2[_0x47a5('0x22')],'rows':_0x44dda2});});},'SendFax':function(_0x930d25){var _0x218dfa=this;return new Promise(function(_0x1c7302,_0x2e9a96){_0x545a97[_0x47a5('0x51')](_0x930d25)[_0x47a5('0x1e')](function(_0x5e5f16){_0x1c7302({'code':0xc8,'message':_0x5e5f16[_0x47a5('0x18')]});})[_0x47a5('0x19')](function(_0x420671){_0x2e9a96(_0x218dfa['error'](0x1f4,_0x420671[_0x47a5('0x18')]));});});},'CheckAfterSend':function(_0x32f393){var _0x17b61d=this;return new Promise(function(_0x5d41d8,_0x19dc8c){_0x545a97['checkAfterSend'](_0x32f393)['then'](function(_0x356e16){_0x5d41d8({'code':0xc8,'message':_0x356e16[_0x47a5('0x18')]});})[_0x47a5('0x19')](function(_0x27333e){_0x19dc8c(_0x17b61d[_0x47a5('0x10')](0x1f4,_0x27333e[_0x47a5('0x18')]));});});}};var _0x479a82=jayson['server'](_0x343372)[_0x47a5('0x52')]();_0x479a82['on']('error',function(_0x24dbee){return _0x59199c(_0x24dbee);});_0x479a82[_0x47a5('0x7')](0x232a,_0x47a5('0x53'),function(){console[_0x47a5('0x54')]('AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232a);return _0x3d5629(_0x47a5('0x55')+0x232a);});});}; \ No newline at end of file +var _0x7a54=['http','127.0.0.1','log','RPC\x20listening\x20on\x20port:','lodash','util','jayson/promise','moment','../../../config/environment','../ami','../model/voiceQueueSummary','listen','name','timers','updateAcw','agents','updateStatusRealtime','voiceStatus','pause','isConnected','error','asterisk','ami\x20disconnected','join','pick','keys','reload','Reload','message','catch','username','command','action','Command','then','voiceQueues','hasOwnProperty','push','length','find','omit','undefined','values','channels','validate','map','uniqueid','channel','format','wav','MixMonitor','ai(mixmonitorid)','monitors','/var/spool/asterisk/monitor/','isNil','toLowerCase','mixmonitorid','rec','status','Channel\x20doesn\x27t\x20exist','Action','StopMixMonitor','destinationchannel','stop','filename','queueChannels','type','outbound','includes','Invalid\x20type\x20parameter.\x20Allowed\x20values:\x20inbound,\x20outbound','filter','count','rows','voicequeuechannelhangup','voicequeuechannelredirect','Redirect','exten','context','telephones','trunks','outboundChannels','run','custom:','event','faxAccounts','send'];(function(_0x3e5211,_0x2d2ae9){var _0x59563d=function(_0x14526c){while(--_0x14526c){_0x3e5211['push'](_0x3e5211['shift']());}};_0x59563d(++_0x2d2ae9);}(_0x7a54,0x106));var _0x47a5=function(_0x1e5521,_0xd59c19){_0x1e5521=_0x1e5521-0x0;var _0x3d0231=_0x7a54[_0x1e5521];return _0x3d0231;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var jayson=require(_0x47a5('0x2'));var schema=require('validate');var moment=require(_0x47a5('0x3'));var config=require(_0x47a5('0x4'));var properties=require('../properties');var ami=require(_0x47a5('0x5'));var VoiceQueueSummary=require(_0x47a5('0x6'));exports[_0x47a5('0x7')]=function(_0x3717e1,_0xfdf934,_0x545a97){return new Promise(function(_0x3d5629,_0x59199c){var _0x343372={'QueuePause':function(_0x30e405){return new Promise(function(_0x506eda){var _0x194fb0=util['format']('%s/%s','SIP',_0x30e405[_0x47a5('0x8')]);if(_0x3717e1[_0x47a5('0x9')]&&_0x3717e1['timers'][_0x194fb0]&&_0x3717e1[_0x47a5('0x9')][_0x194fb0]['timer']){_0x3717e1['timers'][_0x194fb0][_0x47a5('0xa')]();}if(_0x3717e1[_0x47a5('0xb')][_0x194fb0]){_0x3717e1[_0x47a5('0xb')][_0x194fb0][_0x47a5('0xc')]({'state':_0x3717e1[_0x47a5('0xb')][_0x194fb0][_0x47a5('0xd')],'statePause':_0x30e405[_0x47a5('0xe')]?!![]:![]});}_0x506eda({'code':0xc8,'message':'QueuePause'});});},'Reload':function(_0x44bd3e){var _0x221b54=this;return new Promise(function(_0x1cf309,_0x711793){if(ami[_0x47a5('0xf')]()==![]){return _0x711793(_0x221b54[_0x47a5('0x10')](0x1f4,[config[_0x47a5('0x11')]['ip'],config[_0x47a5('0x11')]['username'],_0x47a5('0x12')][_0x47a5('0x13')]('\x20')));}_0x44bd3e=_[_0x47a5('0x14')](_0x44bd3e,_[_0x47a5('0x15')](properties[_0x47a5('0x16')]['module']));_0x44bd3e['action']=_0x47a5('0x17');return ami['Action'](_0x44bd3e)['then'](function(_0x423a81){_0x1cf309({'code':0xc8,'message':_0x423a81[_0x47a5('0x18')]});})[_0x47a5('0x19')](function(_0x1ef371){_0x711793(_0x221b54[_0x47a5('0x10')](0x1f5,_0x1ef371[_0x47a5('0x18')]));});});},'Command':function(_0x2763d6){var _0xe3c618=this;return new Promise(function(_0x3aed38,_0x4a9fcb){if(ami[_0x47a5('0xf')]()==![]){return _0x4a9fcb(_0xe3c618[_0x47a5('0x10')](0x1f4,[config['asterisk']['ip'],config[_0x47a5('0x11')][_0x47a5('0x1a')],_0x47a5('0x12')]['join']('\x20')));}_0x2763d6=_[_0x47a5('0x14')](_0x2763d6,_0x47a5('0x1b'));_0x2763d6[_0x47a5('0x1c')]=_0x47a5('0x1d');return ami['Action'](_0x2763d6)[_0x47a5('0x1e')](function(_0x385687){_0x3aed38({'code':0xc8,'message':_0x385687['content']});})[_0x47a5('0x19')](function(_0xc4cd63){_0x4a9fcb(_0xe3c618[_0x47a5('0x10')](0x1f5,_0xc4cd63[_0x47a5('0x18')]));});});},'VoiceQueues':function(){return new Promise(function(_0x3abd6a){var _0x50bf17=[];for(var _0x53078a in _0x3717e1[_0x47a5('0x1f')]){if(_0x3717e1['voiceQueues'][_0x47a5('0x20')](_0x53078a)){var _0x5b6c4e=_0x3717e1[_0x47a5('0x1f')][_0x53078a];var _0x378208=new VoiceQueueSummary(_0x5b6c4e);_0x50bf17[_0x47a5('0x21')](_0x378208);}}_0x3abd6a({'count':_0x50bf17[_0x47a5('0x22')],'rows':_0x50bf17});});},'UpdateVoiceQueue':function(_0x21f296){return new Promise(function(_0x3ba0b7,_0x24b162){var _0x136b14=_[_0x47a5('0x23')](_0x3717e1[_0x47a5('0x1f')],{'id':parseInt(_0x21f296['id'])});var _0x1127f8=_[_0x47a5('0x24')](_0x21f296,['id']);if(_0x136b14){for(var _0x3ad507 in _0x1127f8){if(typeof _0x1127f8[_0x3ad507]!=='undefined'&&typeof _0x136b14[_0x3ad507]!==_0x47a5('0x25')){_0x136b14[_0x3ad507]=_0x1127f8[_0x3ad507];}}_0x3ba0b7(_0x136b14);}else{_0x24b162();}});},'VoiceChannels':function(){return new Promise(function(_0x51833b){var _0x2ef875=_[_0x47a5('0x26')](_0x3717e1[_0x47a5('0x27')]);_0x51833b({'count':_0x2ef875['length'],'rows':_0x2ef875});});},'VoiceChannelMixMonitor':function(_0x256650){var _0x625952=this;return new Promise(function(_0x39b50b,_0x1f1c68){if(ami['isConnected']()==![]){return _0x1f1c68(_0x625952['error'](0x1f4,[config[_0x47a5('0x11')]['ip'],config[_0x47a5('0x11')]['username'],'ami\x20disconnected'][_0x47a5('0x13')]('\x20')));}var _0x51544e=schema(properties['voicechannel'])[_0x47a5('0x28')](_0x256650);if(_0x51544e['length']>0x0){return _0x1f1c68(_0x625952[_0x47a5('0x10')](0x1f4,_[_0x47a5('0x29')](_0x51544e,'message')['join'](',\x20')));}var _0x274e34=_['find'](_0x3717e1[_0x47a5('0x27')],{'uniqueid':_0x256650[_0x47a5('0x2a')]});if(_0x274e34&&_0x274e34[_0x47a5('0x2b')]){var _0x52749b=util[_0x47a5('0x2c')]('%s.%s',_0x256650['filename']||_0x256650[_0x47a5('0x2a')],_0x256650['format']||_0x47a5('0x2d'));return ami['Action']({'action':_0x47a5('0x2e'),'channel':_0x274e34[_0x47a5('0x2b')],'file':_0x52749b,'options':_0x47a5('0x2f')})[_0x47a5('0x1e')](function(_0x36add5){var _0xed6320=_[_0x47a5('0x23')](_0x274e34[_0x47a5('0x30')],{'filename':_0x47a5('0x31')+_0x52749b['toLowerCase']()});if(_[_0x47a5('0x32')](_0xed6320)){_0x274e34[_0x47a5('0x30')]['push']({'filename':_0x47a5('0x31')+_0x52749b[_0x47a5('0x33')](),'createdAt':moment()[_0x47a5('0x2c')]('YYYY-MM-DD\x20HH:mm:ss'),'mixmonitorid':_0x36add5[_0x47a5('0x34')],'status':_0x47a5('0x35')});}else{_0xed6320['mixmonitorid']=_0x36add5[_0x47a5('0x34')];_0xed6320[_0x47a5('0x36')]='rec';}_0x39b50b({'code':0xc8,'message':[_0x256650['uniqueid'],'MixMonitor\x20Success',_0x36add5[_0x47a5('0x34')]]['join']('\x20'),'mixmonitorid':_0x36add5[_0x47a5('0x34')]});})[_0x47a5('0x19')](function(_0x301a85){_0x1f1c68(_0x625952[_0x47a5('0x10')](0x1f5,[_0x256650[_0x47a5('0x2a')],_0x301a85[_0x47a5('0x18')][_0x47a5('0x33')]()][_0x47a5('0x13')]('\x20')));});}else{return _0x1f1c68(_0x625952[_0x47a5('0x10')](0x1f5,_0x47a5('0x37')));}});},'VoiceChannelStopMixMonitor':function(_0x280500){var _0x1658e8=this;return new Promise(function(_0x23d6d8,_0x56dbbd){if(ami[_0x47a5('0xf')]()==![]){return _0x56dbbd(_0x1658e8[_0x47a5('0x10')](0x1f4,[config[_0x47a5('0x11')]['ip'],config[_0x47a5('0x11')]['username'],_0x47a5('0x12')]['join']('\x20')));}var _0x47c7a2=schema(properties['voicechannel'])['validate'](_0x280500);if(_0x47c7a2[_0x47a5('0x22')]>0x0){return _0x56dbbd(_0x1658e8['error'](0x1f4,_[_0x47a5('0x29')](_0x47c7a2,_0x47a5('0x18'))[_0x47a5('0x13')](',\x20')));}var _0x494526=_[_0x47a5('0x23')](_0x3717e1[_0x47a5('0x27')],{'uniqueid':_0x280500['uniqueid']});if(_0x494526){return Promise['resolve']()[_0x47a5('0x1e')](function(){if(_0x494526['channel']){return ami[_0x47a5('0x38')]({'action':_0x47a5('0x39'),'channel':_0x494526[_0x47a5('0x2b')],'mixmonitorid':_0x280500[_0x47a5('0x34')]})[_0x47a5('0x19')](function(){});}})[_0x47a5('0x1e')](function(){if(_0x494526[_0x47a5('0x3a')]){return ami[_0x47a5('0x38')]({'action':_0x47a5('0x39'),'channel':_0x494526[_0x47a5('0x3a')],'mixmonitorid':_0x280500[_0x47a5('0x34')]})[_0x47a5('0x19')](function(){});}})[_0x47a5('0x1e')](function(){var _0x3574d4=_[_0x47a5('0x23')](_0x494526[_0x47a5('0x30')],{'mixmonitorid':_0x280500['mixmonitorid']});if(_0x3574d4){_0x3574d4[_0x47a5('0x36')]=_0x47a5('0x3b');}})['then'](function(){var _0x52b3a8=util[_0x47a5('0x2c')]('%s.%s',_0x280500[_0x47a5('0x3c')]||_0x280500[_0x47a5('0x2a')],_0x280500['format']||'wav');var _0x3d85cc=_['find'](_0x494526[_0x47a5('0x30')],{'filename':_0x47a5('0x31')+_0x52b3a8[_0x47a5('0x33')]()});if(_0x3d85cc){_0x3d85cc[_0x47a5('0x36')]=_0x47a5('0x3b');}})[_0x47a5('0x1e')](function(){_0x23d6d8({'code':0xc8,'message':[_0x280500[_0x47a5('0x2a')],'StopMixMonitor\x20Success']['join']('\x20')});})[_0x47a5('0x19')](function(_0x411230){_0x56dbbd(_0x1658e8[_0x47a5('0x10')](0x1f5,[_0x280500[_0x47a5('0x2a')],_0x411230[_0x47a5('0x18')][_0x47a5('0x33')]()][_0x47a5('0x13')]('\x20')));});}else{return _0x56dbbd(_0x1658e8['error'](0x1f5,_0x47a5('0x37')));}});},'VoiceQueuesChannels':function(_0x1c9a62){var _0x5f6a=this;return new Promise(function(_0x5c3c75){var _0x12ca40=_['values'](_0x3717e1[_0x47a5('0x3d')]);var _0xe31817={'count':_0x12ca40[_0x47a5('0x22')],'rows':_0x12ca40};if(_0x1c9a62&&_0x1c9a62[_0x47a5('0x3e')]){if(!['inbound',_0x47a5('0x3f')][_0x47a5('0x40')](_0x1c9a62[_0x47a5('0x3e')])){return _0x59199c(_0x5f6a[_0x47a5('0x10')](0x190,_0x47a5('0x41')));}var _0x6a53b3=_[_0x47a5('0x42')](_0x12ca40,function(_0x481089){return _0x481089[_0x47a5('0x3e')]===_0x1c9a62[_0x47a5('0x3e')];});_0xe31817[_0x47a5('0x43')]=_0x6a53b3[_0x47a5('0x22')];_0xe31817[_0x47a5('0x44')]=_0x6a53b3;}_0x5c3c75(_0xe31817);});},'VoiceQueuesChannel':function(_0x1ab0bf){var _0x572233=this;return new Promise(function(_0x1ad6a9,_0x245a15){var _0x1aa581=schema(properties['voicequeuechannel'])[_0x47a5('0x28')](_0x1ab0bf);if(_0x1aa581[_0x47a5('0x22')]>0x0){return _0x245a15(_0x572233[_0x47a5('0x10')](0x1f4,_['map'](_0x1aa581,'message')[_0x47a5('0x13')](',\x20')));}var _0x376e1d=_['find'](_0x3717e1['queueChannels'],{'uniqueid':_0x1ab0bf[_0x47a5('0x2a')]});if(_0x376e1d){_0x1ad6a9(_0x376e1d);}else{return _0x245a15(_0x572233['error'](0x1f5,_0x47a5('0x37')));}});},'VoiceQueuesChannelHangup':function(_0x5d383d){var _0x482de6=this;return new Promise(function(_0x389ed9,_0x46d2d3){if(ami['isConnected']()==![]){return _0x46d2d3(_0x482de6[_0x47a5('0x10')](0x1f4,[config[_0x47a5('0x11')]['ip'],config['asterisk']['username'],_0x47a5('0x12')][_0x47a5('0x13')]('\x20')));}var _0x867da0=schema(properties[_0x47a5('0x45')])['validate'](_0x5d383d);if(_0x867da0[_0x47a5('0x22')]>0x0){return _0x46d2d3(_0x482de6[_0x47a5('0x10')](0x1f4,_[_0x47a5('0x29')](_0x867da0,'message')[_0x47a5('0x13')](',\x20')));}var _0x4db625=_[_0x47a5('0x23')](_0x3717e1[_0x47a5('0x3d')],{'uniqueid':_0x5d383d[_0x47a5('0x2a')]});if(_0x4db625&&_0x4db625[_0x47a5('0x2b')]){return ami[_0x47a5('0x38')]({'action':'Hangup','channel':_0x4db625[_0x47a5('0x2b')]})['then'](function(_0x5cbe97){_0x389ed9({'code':0xc8,'message':[_0x5d383d['uniqueid'],_0x5cbe97['message'][_0x47a5('0x33')]()][_0x47a5('0x13')]('\x20')});})[_0x47a5('0x19')](function(_0x52e3ee){_0x46d2d3(_0x482de6['error'](0x1f5,[_0x5d383d[_0x47a5('0x2a')],_0x52e3ee[_0x47a5('0x18')][_0x47a5('0x33')]()][_0x47a5('0x13')]('\x20')));});}else{return _0x46d2d3(_0x482de6[_0x47a5('0x10')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannelRedirect':function(_0x3474b7){var _0x519e9e=this;return new Promise(function(_0x22c886,_0x274d31){if(ami['isConnected']()==![]){return _0x274d31(_0x519e9e[_0x47a5('0x10')](0x1f4,[config[_0x47a5('0x11')]['ip'],config[_0x47a5('0x11')][_0x47a5('0x1a')],_0x47a5('0x12')][_0x47a5('0x13')]('\x20')));}var _0x35cca8=schema(properties[_0x47a5('0x46')])['validate'](_0x3474b7);if(_0x35cca8[_0x47a5('0x22')]>0x0){return _0x274d31(_0x519e9e[_0x47a5('0x10')](0x1f4,_[_0x47a5('0x29')](_0x35cca8,_0x47a5('0x18'))[_0x47a5('0x13')](',\x20')));}var _0x4bbe14=_[_0x47a5('0x23')](_0x3717e1[_0x47a5('0x3d')],{'uniqueid':_0x3474b7[_0x47a5('0x2a')]});if(_0x4bbe14&&_0x4bbe14[_0x47a5('0x2b')]){return ami[_0x47a5('0x38')]({'action':_0x47a5('0x47'),'channel':_0x4bbe14[_0x47a5('0x2b')],'exten':_0x3474b7[_0x47a5('0x48')],'context':_0x3474b7[_0x47a5('0x49')]||_0x4bbe14[_0x47a5('0x49')],'priority':0x1})[_0x47a5('0x1e')](function(_0x44fda9){_0x22c886({'code':0xc8,'message':[_0x3474b7[_0x47a5('0x2a')],_0x44fda9[_0x47a5('0x18')][_0x47a5('0x33')]()]['join']('\x20')});})[_0x47a5('0x19')](function(_0x284fb8){_0x274d31(_0x519e9e[_0x47a5('0x10')](0x1f5,[_0x3474b7['uniqueid'],_0x284fb8[_0x47a5('0x18')][_0x47a5('0x33')]()][_0x47a5('0x13')]('\x20')));});}else{return _0x274d31(_0x519e9e[_0x47a5('0x10')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'Agents':function(_0x3ac402){return new Promise(function(_0x522ccf){var _0x2d5ee6=_['values'](_0x3717e1[_0x47a5('0xb')]);if(_0x3ac402&&_0x3ac402['id']){var _0x4cf7c5=_[_0x47a5('0x23')](_0x2d5ee6,function(_0x2f27c3){return _0x2f27c3['id']===_0x3ac402['id'];});_0x522ccf(_0x4cf7c5);}else{_0x522ccf({'count':_0x2d5ee6[_0x47a5('0x22')],'rows':_0x2d5ee6});}});},'Telephones':function(){return new Promise(function(_0x58473b){var _0x4af557=_['values'](_0x3717e1[_0x47a5('0x4a')]);_0x58473b({'count':_0x4af557[_0x47a5('0x22')],'rows':_0x4af557});});},'Trunks':function(){return new Promise(function(_0xe3c0a7){var _0x117510=_['values'](_0x3717e1[_0x47a5('0x4b')]);_0xe3c0a7({'count':_0x117510[_0x47a5('0x22')],'rows':_0x117510});});},'OutboundChannels':function(){return new Promise(function(_0x390bc0){var _0xd5b23f=_[_0x47a5('0x26')](_0x3717e1[_0x47a5('0x4c')]);_0x390bc0({'count':_0xd5b23f[_0x47a5('0x22')],'rows':_0xd5b23f});});},'Outbound':function(){return new Promise(function(_0x39939a){_0x39939a(_0x3717e1[_0x47a5('0x3f')]);});},'Campaigns':function(){return new Promise(function(_0xc69a68){var _0x2e6fcc=_[_0x47a5('0x26')](_0x3717e1['campaigns']);_0xc69a68({'count':_0x2e6fcc[_0x47a5('0x22')],'rows':_0x2e6fcc});});},'VoiceQueuesPreview':function(_0x4833be){var _0x2ad00a=this;return new Promise(function(_0x2ac30f,_0x281e5f){_0xfdf934[_0x47a5('0x4d')](_0x4833be['id'])[_0x47a5('0x1e')](function(_0xa9c853){_0x2ac30f({'code':0xc8,'message':_0xa9c853[_0x47a5('0x18')]});})[_0x47a5('0x19')](function(_0x11c1db){_0x281e5f(_0x2ad00a[_0x47a5('0x10')](0x1f4,_0x11c1db[_0x47a5('0x18')]));});});},'EventManager':function(_0x1f07ac){var _0x8f0035=this;return new Promise(function(_0x2d434c,_0x441d64){if(!_0x1f07ac['event']){return _0x441d64(_0x8f0035['error'](0x1f4,'Event\x20name\x20mandatory'));}ami['emit'](_0x47a5('0x4e')+_0x1f07ac[_0x47a5('0x4f')],_0x1f07ac['message']);_0x2d434c({'code':0xc8,'message':_0x1f07ac});});},'FaxAccounts':function(){return new Promise(function(_0x732e00){var _0x44dda2=_[_0x47a5('0x26')](_0x3717e1[_0x47a5('0x50')]);_0x732e00({'count':_0x44dda2[_0x47a5('0x22')],'rows':_0x44dda2});});},'SendFax':function(_0x930d25){var _0x218dfa=this;return new Promise(function(_0x1c7302,_0x2e9a96){_0x545a97[_0x47a5('0x51')](_0x930d25)[_0x47a5('0x1e')](function(_0x5e5f16){_0x1c7302({'code':0xc8,'message':_0x5e5f16[_0x47a5('0x18')]});})[_0x47a5('0x19')](function(_0x420671){_0x2e9a96(_0x218dfa['error'](0x1f4,_0x420671[_0x47a5('0x18')]));});});},'CheckAfterSend':function(_0x32f393){var _0x17b61d=this;return new Promise(function(_0x5d41d8,_0x19dc8c){_0x545a97['checkAfterSend'](_0x32f393)['then'](function(_0x356e16){_0x5d41d8({'code':0xc8,'message':_0x356e16[_0x47a5('0x18')]});})[_0x47a5('0x19')](function(_0x27333e){_0x19dc8c(_0x17b61d[_0x47a5('0x10')](0x1f4,_0x27333e[_0x47a5('0x18')]));});});}};var _0x479a82=jayson['server'](_0x343372)[_0x47a5('0x52')]();_0x479a82['on']('error',function(_0x24dbee){return _0x59199c(_0x24dbee);});_0x479a82[_0x47a5('0x7')](0x232a,_0x47a5('0x53'),function(){console[_0x47a5('0x54')]('AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232a);return _0x3d5629(_0x47a5('0x55')+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 8fee7e6..bea31fd 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 _0x7ae7=['lodash','bluebird','ioredis','util','../../../../config/environment','../../../../config/logger','trigger','redis','defaults','socket.io-emitter','info','[CM][%s][%s]','stringify','data1','data2','isNil','data5','xmd-contactid','ListId','data3','split','phone','$or','destcalleridnum','calleridnum','firstName','lastName','mobile','fax','createdAt','updatedAt','resolve','then','getContacts','isEmpty','length','uniqueid','[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]','join','data4','[CM][%s][%s]\x20Autocreate\x20enabled','routeId','calleridname','','destcalleridname','Unknown','push','[CM][%s][%s]\x20Contact\x20created:%s','[CM][%s][%s]\x20Autocreate\x20disabled','format','trigger:%s','action','merge'];(function(_0x45f205,_0xd505c8){var _0x394308=function(_0xf82183){while(--_0xf82183){_0x45f205['push'](_0x45f205['shift']());}};_0x394308(++_0xd505c8);}(_0x7ae7,0x109));var _0x77ae=function(_0x10606d,_0x5245bd){_0x10606d=_0x10606d-0x0;var _0x52cc16=_0x7ae7[_0x10606d];return _0x52cc16;};'use strict';var _=require(_0x77ae('0x0'));var BPromise=require(_0x77ae('0x1'));var Redis=require(_0x77ae('0x2'));var util=require(_0x77ae('0x3'));var config=require(_0x77ae('0x4'));var logger=require(_0x77ae('0x5'))(_0x77ae('0x6'));var cmContactRpc=require('../../rpc/cmContact');config[_0x77ae('0x7')]=_[_0x77ae('0x8')](config[_0x77ae('0x7')],{'host':'localhost','port':0x18eb});var io=require(_0x77ae('0x9'))(new Redis(config[_0x77ae('0x7')]));function emit(_0xe73365,_0x3d3abf,_0x359ba7,_0x6bc2e8,_0xae6734){logger[_0x77ae('0xa')](_0x77ae('0xb'),_0xe73365,_0x3d3abf['id'],_0x359ba7,_0x6bc2e8,JSON[_0x77ae('0xc')](_0xae6734));io['to'](_0x359ba7)['emit'](_0x6bc2e8,_0xae6734);}exports['exec']=function(_0x4d2d10,_0x5aa8c8,_0xe63ae7,_0x59cd7e){var _0x28d397,_0x4800a2;var _0x56fdc1={};var _0x3001db;var _0x315de1=Number(_0xe63ae7[_0x77ae('0xd')]);var _0x101ff3=_0xe63ae7[_0x77ae('0xe')]?Boolean(Number(_0xe63ae7[_0x77ae('0xe')])):![];var _0x472ac0;var _0x768777=![];if(!_[_0x77ae('0xf')](_0xe63ae7[_0x77ae('0x10')])){if(_0xe63ae7['data5']=='1')_0x768777=!![];}if(!_0x768777){if(_0x59cd7e[_0x77ae('0x11')]){_0x56fdc1['id']=_0x59cd7e[_0x77ae('0x11')];}}if(!_0x56fdc1['id']){_0x56fdc1[_0x77ae('0x12')]=_0x315de1;_0x472ac0=_0xe63ae7[_0x77ae('0x13')]&&_0xe63ae7['data3']!=='0'?_0xe63ae7[_0x77ae('0x13')][_0x77ae('0x14')](','):[_0x77ae('0x15')];_0x56fdc1[_0x77ae('0x16')]=_['map'](_0x472ac0,function(_0x22409e){var _0x1c2156={};_0x1c2156[_0x22409e]=_0x59cd7e['routeId']?_0x59cd7e[_0x77ae('0x17')]:_0x59cd7e[_0x77ae('0x18')];return _0x1c2156;});_0x3001db=_0x59cd7e['routeId']?_0x59cd7e[_0x77ae('0x17')]:_0x59cd7e[_0x77ae('0x18')];}var _0x39cd66=['id',_0x77ae('0x19'),_0x77ae('0x1a'),_0x77ae('0x15'),_0x77ae('0x1b'),_0x77ae('0x1c'),_0x77ae('0x12'),_0x77ae('0x1d'),'scheduledAt',_0x77ae('0x1e')];var _0x219895=_['union'](_0x39cd66,_0x472ac0);BPromise[_0x77ae('0x1f')]()[_0x77ae('0x20')](cmContactRpc[_0x77ae('0x21')]({'attributes':_0x219895,'where':_0x56fdc1,'phone':_0x3001db}))['then'](function(_0x7e6c6f){_0x4800a2=_0x7e6c6f;if(!_[_0x77ae('0x22')](_0x4800a2)){if(_0x4800a2[_0x77ae('0x23')]===0x1){_0x28d397=_0x4800a2[0x0];logger[_0x77ae('0xa')]('[CM][%s][%s]\x20Contact\x20found:%s',_0x59cd7e[_0x77ae('0x24')],_0x5aa8c8['id'],_0x28d397['id']);}else{logger['info'](_0x77ae('0x25'),_0x59cd7e['uniqueid'],_0x5aa8c8['id'],_['map'](_0x4800a2,'id')[_0x77ae('0x26')](','));}return;}else{logger['info']('[CM][%s][%s]\x20Contact\x20not\x20found',_0x59cd7e['uniqueid'],_0x5aa8c8['id']);var _0x1562ee={'ListId':_0x315de1};var _0x5cfa31=_0xe63ae7[_0x77ae('0x27')]&&_0xe63ae7[_0x77ae('0x27')]!=='0'?_0xe63ae7[_0x77ae('0x27')]:_0x77ae('0x15');if(_0x101ff3){logger[_0x77ae('0xa')](_0x77ae('0x28'),_0x59cd7e[_0x77ae('0x24')],_0x5aa8c8['id']);_0x1562ee[_0x5cfa31]=_[_0x77ae('0xf')](_0x59cd7e[_0x77ae('0x29')])?_0x59cd7e[_0x77ae('0x18')]:_0x59cd7e[_0x77ae('0x17')];if(_[_0x77ae('0xf')](_0x59cd7e[_0x77ae('0x29')])){_0x1562ee[_0x77ae('0x19')]=_0x59cd7e[_0x77ae('0x2a')]&&_0x59cd7e[_0x77ae('0x2a')]!==_0x77ae('0x2b')?_0x59cd7e[_0x77ae('0x2a')]:'Unknown';}else{_0x1562ee[_0x77ae('0x19')]=_0x59cd7e[_0x77ae('0x2c')]&&_0x59cd7e[_0x77ae('0x2c')]!==_0x77ae('0x2b')?_0x59cd7e['destcalleridname']:_0x77ae('0x2d');}return BPromise[_0x77ae('0x1f')]()[_0x77ae('0x20')](cmContactRpc['createContact'](_0x1562ee))['then'](function(_0x5aca0d){_0x28d397=_0x5aca0d;_0x4800a2[_0x77ae('0x2e')](_0x5aca0d);if(_0x28d397){logger[_0x77ae('0xa')](_0x77ae('0x2f'),_0x59cd7e[_0x77ae('0x24')],_0x5aa8c8['id'],_0x28d397['id']);}return;});}else{logger[_0x77ae('0xa')](_0x77ae('0x30'),_0x59cd7e[_0x77ae('0x24')],_0x5aa8c8['id']);_0x1562ee[_0x5cfa31]=_[_0x77ae('0xf')](_0x59cd7e[_0x77ae('0x29')])?_0x59cd7e[_0x77ae('0x18')]:_0x59cd7e[_0x77ae('0x17')];if(_['isNil'](_0x59cd7e[_0x77ae('0x29')])){_0x1562ee[_0x77ae('0x19')]=_0x59cd7e[_0x77ae('0x2a')]&&_0x59cd7e[_0x77ae('0x2a')]!==_0x77ae('0x2b')?_0x59cd7e[_0x77ae('0x2a')]:_0x77ae('0x2d');}else{_0x1562ee[_0x77ae('0x19')]=_0x59cd7e[_0x77ae('0x2c')]&&_0x59cd7e[_0x77ae('0x2c')]!==_0x77ae('0x2b')?_0x59cd7e[_0x77ae('0x2c')]:_0x77ae('0x2d');}_0x28d397=_0x1562ee;_0x4800a2[_0x77ae('0x2e')](_0x1562ee);return;}}})[_0x77ae('0x20')](function(){if(_0x4d2d10){emit(_0x59cd7e[_0x77ae('0x24')],_0x5aa8c8,util['format']('user:%s',_0x4d2d10['name']),util[_0x77ae('0x31')](_0x77ae('0x32'),_0xe63ae7[_0x77ae('0x33')]['toLowerCase']()),{'evt':_[_0x77ae('0x34')](_0x59cd7e,{'autoCreate':_0x101ff3}),'contact':_0x28d397===undefined?{}:_0x28d397,'contacts':_0x4800a2[_0x77ae('0x23')]===0x0?undefined:_0x4800a2});}});}; \ No newline at end of file +var _0xb0c3=['format','user:%s','trigger:%s','toLowerCase','lodash','bluebird','../../../../config/logger','../../rpc/cmContact','redis','localhost','info','[CM][%s][%s]','stringify','emit','data1','data2','isNil','data5','xmd-contactid','ListId','data3','split','phone','map','routeId','destcalleridnum','calleridnum','firstName','lastName','mobile','fax','scheduledAt','updatedAt','union','resolve','then','isEmpty','length','[CM][%s][%s]\x20Contact\x20found:%s','[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]','uniqueid','join','data4','calleridname','','destcalleridname','Unknown','createContact','[CM][%s][%s]\x20Autocreate\x20disabled','push'];(function(_0x5e8471,_0x578f79){var _0x288ffe=function(_0x582d6e){while(--_0x582d6e){_0x5e8471['push'](_0x5e8471['shift']());}};_0x288ffe(++_0x578f79);}(_0xb0c3,0x9a));var _0x3b0c=function(_0x19dcc8,_0x4bae0e){_0x19dcc8=_0x19dcc8-0x0;var _0x2810f4=_0xb0c3[_0x19dcc8];return _0x2810f4;};'use strict';var _=require(_0x3b0c('0x0'));var BPromise=require(_0x3b0c('0x1'));var Redis=require('ioredis');var util=require('util');var config=require('../../../../config/environment');var logger=require(_0x3b0c('0x2'))('trigger');var cmContactRpc=require(_0x3b0c('0x3'));config[_0x3b0c('0x4')]=_['defaults'](config[_0x3b0c('0x4')],{'host':_0x3b0c('0x5'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x3b0c('0x4')]));function emit(_0x53dcea,_0x231be2,_0x52f341,_0x5e51f7,_0x5e8d57){logger[_0x3b0c('0x6')](_0x3b0c('0x7'),_0x53dcea,_0x231be2['id'],_0x52f341,_0x5e51f7,JSON[_0x3b0c('0x8')](_0x5e8d57));io['to'](_0x52f341)[_0x3b0c('0x9')](_0x5e51f7,_0x5e8d57);}exports['exec']=function(_0x53736e,_0x34c28f,_0x30dc8d,_0x4f0ae8){var _0x3dacf4,_0x29559f;var _0x5e4c6c={};var _0x1a4790;var _0x54e514=Number(_0x30dc8d[_0x3b0c('0xa')]);var _0x2e2f38=_0x30dc8d['data2']?Boolean(Number(_0x30dc8d[_0x3b0c('0xb')])):![];var _0x2ff4a9;var _0x401419=![];if(!_[_0x3b0c('0xc')](_0x30dc8d[_0x3b0c('0xd')])){if(_0x30dc8d['data5']=='1')_0x401419=!![];}if(!_0x401419){if(_0x4f0ae8['xmd-contactid']){_0x5e4c6c['id']=_0x4f0ae8[_0x3b0c('0xe')];}}if(!_0x5e4c6c['id']){_0x5e4c6c[_0x3b0c('0xf')]=_0x54e514;_0x2ff4a9=_0x30dc8d[_0x3b0c('0x10')]&&_0x30dc8d['data3']!=='0'?_0x30dc8d[_0x3b0c('0x10')][_0x3b0c('0x11')](','):[_0x3b0c('0x12')];_0x5e4c6c['$or']=_[_0x3b0c('0x13')](_0x2ff4a9,function(_0x4c058b){var _0x2777c9={};_0x2777c9[_0x4c058b]=_0x4f0ae8[_0x3b0c('0x14')]?_0x4f0ae8[_0x3b0c('0x15')]:_0x4f0ae8[_0x3b0c('0x16')];return _0x2777c9;});_0x1a4790=_0x4f0ae8[_0x3b0c('0x14')]?_0x4f0ae8[_0x3b0c('0x15')]:_0x4f0ae8[_0x3b0c('0x16')];}var _0x92ce7b=['id',_0x3b0c('0x17'),_0x3b0c('0x18'),_0x3b0c('0x12'),_0x3b0c('0x19'),_0x3b0c('0x1a'),_0x3b0c('0xf'),'createdAt',_0x3b0c('0x1b'),_0x3b0c('0x1c')];var _0x419fce=_[_0x3b0c('0x1d')](_0x92ce7b,_0x2ff4a9);BPromise[_0x3b0c('0x1e')]()[_0x3b0c('0x1f')](cmContactRpc['getContacts']({'attributes':_0x419fce,'where':_0x5e4c6c,'phone':_0x1a4790}))[_0x3b0c('0x1f')](function(_0x48fed3){_0x29559f=_0x48fed3;if(!_[_0x3b0c('0x20')](_0x29559f)){if(_0x29559f[_0x3b0c('0x21')]===0x1){_0x3dacf4=_0x29559f[0x0];logger[_0x3b0c('0x6')](_0x3b0c('0x22'),_0x4f0ae8['uniqueid'],_0x34c28f['id'],_0x3dacf4['id']);}else{logger['info'](_0x3b0c('0x23'),_0x4f0ae8[_0x3b0c('0x24')],_0x34c28f['id'],_[_0x3b0c('0x13')](_0x29559f,'id')[_0x3b0c('0x25')](','));}return;}else{logger[_0x3b0c('0x6')]('[CM][%s][%s]\x20Contact\x20not\x20found',_0x4f0ae8[_0x3b0c('0x24')],_0x34c28f['id']);var _0x342b1c={'ListId':_0x54e514};var _0x4094a6=_0x30dc8d[_0x3b0c('0x26')]&&_0x30dc8d[_0x3b0c('0x26')]!=='0'?_0x30dc8d[_0x3b0c('0x26')]:'phone';if(_0x2e2f38){logger[_0x3b0c('0x6')]('[CM][%s][%s]\x20Autocreate\x20enabled',_0x4f0ae8[_0x3b0c('0x24')],_0x34c28f['id']);_0x342b1c[_0x4094a6]=_[_0x3b0c('0xc')](_0x4f0ae8[_0x3b0c('0x14')])?_0x4f0ae8[_0x3b0c('0x16')]:_0x4f0ae8['destcalleridnum'];if(_[_0x3b0c('0xc')](_0x4f0ae8[_0x3b0c('0x14')])){_0x342b1c['firstName']=_0x4f0ae8[_0x3b0c('0x27')]&&_0x4f0ae8[_0x3b0c('0x27')]!==_0x3b0c('0x28')?_0x4f0ae8[_0x3b0c('0x27')]:'Unknown';}else{_0x342b1c[_0x3b0c('0x17')]=_0x4f0ae8[_0x3b0c('0x29')]&&_0x4f0ae8[_0x3b0c('0x29')]!==_0x3b0c('0x28')?_0x4f0ae8[_0x3b0c('0x29')]:_0x3b0c('0x2a');}return BPromise['resolve']()['then'](cmContactRpc[_0x3b0c('0x2b')](_0x342b1c))[_0x3b0c('0x1f')](function(_0x2a5aa4){_0x3dacf4=_0x2a5aa4;_0x29559f['push'](_0x2a5aa4);if(_0x3dacf4){logger['info']('[CM][%s][%s]\x20Contact\x20created:%s',_0x4f0ae8[_0x3b0c('0x24')],_0x34c28f['id'],_0x3dacf4['id']);}return;});}else{logger[_0x3b0c('0x6')](_0x3b0c('0x2c'),_0x4f0ae8['uniqueid'],_0x34c28f['id']);_0x342b1c[_0x4094a6]=_['isNil'](_0x4f0ae8[_0x3b0c('0x14')])?_0x4f0ae8[_0x3b0c('0x16')]:_0x4f0ae8[_0x3b0c('0x15')];if(_[_0x3b0c('0xc')](_0x4f0ae8[_0x3b0c('0x14')])){_0x342b1c[_0x3b0c('0x17')]=_0x4f0ae8[_0x3b0c('0x27')]&&_0x4f0ae8['calleridname']!==''?_0x4f0ae8['calleridname']:_0x3b0c('0x2a');}else{_0x342b1c[_0x3b0c('0x17')]=_0x4f0ae8[_0x3b0c('0x29')]&&_0x4f0ae8[_0x3b0c('0x29')]!==''?_0x4f0ae8[_0x3b0c('0x29')]:'Unknown';}_0x3dacf4=_0x342b1c;_0x29559f[_0x3b0c('0x2d')](_0x342b1c);return;}}})[_0x3b0c('0x1f')](function(){if(_0x53736e){emit(_0x4f0ae8[_0x3b0c('0x24')],_0x34c28f,util[_0x3b0c('0x2e')](_0x3b0c('0x2f'),_0x53736e['name']),util[_0x3b0c('0x2e')](_0x3b0c('0x30'),_0x30dc8d['action'][_0x3b0c('0x31')]()),{'evt':_['merge'](_0x4f0ae8,{'autoCreate':_0x2e2f38}),'contact':_0x3dacf4===undefined?{}:_0x3dacf4,'contacts':_0x29559f[_0x3b0c('0x21')]===0x0?undefined:_0x29559f});}});}; \ No newline at end of file diff --git a/server/services/ami/trigger/index.js b/server/services/ami/trigger/index.js index 2969629..fce1157 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 _0x5b94=['motionbar','browser','data1','data2','html','render','uri','buildUri','isNil','data3','location','uriLocation','windowWidth','data5','800','windowHeight','data6','600','winArguments','format','user:%s','name','jscripty','integration','queue','routeId','urlforward','exec','search','replace','AllConditions','channel','AnyConditions','some','debug','checkTrigger:\x20trigger','evt','checkConditions','field','account','chat','ChatWebsiteId','operator','value','upperFirst','AccountId','interaction','message','event','membername','lastevent','mailSubstatus','null','substatus','undefined','offlineMessage','created','equals','lodash','url','./urlforward','./integration','./cmContact','./script','../../../config/environment','../../../config/logger','trigger','../ami','redis','socket.io-emitter','winapp','triggers','agents','voiceQueues','templates','voiceExtensions','zendeskAccounts','freshdeskAccounts','salesforceAccounts','sugarcrmAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','freshsalesAccounts','accounts','custom:agentcalled','syncCustomEvent','bind','custom:agentringnoanswer','custom:agentcomplete','custom:agentnosuchnumber','custom:agentnoanswer','custom:agentbusy','custom:agentcongestion','custom:amd','custom:timeout','syncAgentDial','custom:closedinteraction','custom:incomingmessage','custom:acceptmessage','custom:rejectmessage','emit','info','prototype','clone','motionChannel','voice','inspect','interface','checkTriggers','status','checkTrigger','merge','variables','Actions','length','action','toLowerCase','contactmanager'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5b94,0x12a));var _0x45b9=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0x5b94[_0x413feb];return _0x40ee88;};'use strict';var util=require('util');var _=require(_0x45b9('0x0'));var url=require(_0x45b9('0x1'));var Mustache=require('mustache');var Redis=require('ioredis');var urlforward=require(_0x45b9('0x2'));var integration=require(_0x45b9('0x3'));var cmContact=require(_0x45b9('0x4'));var script=require(_0x45b9('0x5'));var config=require(_0x45b9('0x6'));var logger=require(_0x45b9('0x7'))(_0x45b9('0x8'));var ami=require(_0x45b9('0x9'));config['redis']=_['defaults'](config[_0x45b9('0xa')],{'host':'localhost','port':0x18eb});var io=require(_0x45b9('0xb'))(new Redis(config[_0x45b9('0xa')]));var operators={'equals':function(_0x463843,_0x1f9cbf){return _0x463843==_0x1f9cbf;},'not_equals':function(_0x5a9462,_0x5348af){return _0x5a9462!=_0x5348af;}};var barAndWebActions=['popup',_0x45b9('0x1'),_0x45b9('0xc')];function Trigger(_0x437a7b){this[_0x45b9('0xd')]=_0x437a7b[_0x45b9('0xd')];this[_0x45b9('0xe')]=_0x437a7b['agents'];this[_0x45b9('0xf')]=_0x437a7b['voiceQueues'];this['templates']=_0x437a7b[_0x45b9('0x10')];this[_0x45b9('0x11')]=_0x437a7b[_0x45b9('0x11')];this['zendeskAccounts']=_0x437a7b[_0x45b9('0x12')];this[_0x45b9('0x13')]=_0x437a7b[_0x45b9('0x13')];this['salesforceAccounts']=_0x437a7b[_0x45b9('0x14')];this[_0x45b9('0x15')]=_0x437a7b[_0x45b9('0x15')];this['zohoAccounts']=_0x437a7b[_0x45b9('0x16')];this[_0x45b9('0x17')]=_0x437a7b[_0x45b9('0x17')];this[_0x45b9('0x18')]=_0x437a7b[_0x45b9('0x18')];this['servicenowAccounts']=_0x437a7b[_0x45b9('0x19')];this['dynamics365Accounts']=_0x437a7b['dynamics365Accounts'];this[_0x45b9('0x1a')]=_0x437a7b[_0x45b9('0x1a')];this[_0x45b9('0x1b')]={'zendesk':this[_0x45b9('0x12')],'salesforce':this['salesforceAccounts'],'freshdesk':this['freshdeskAccounts'],'sugarcrm':this['sugarcrmAccounts'],'zoho':this[_0x45b9('0x16')],'desk':this[_0x45b9('0x17')],'vtiger':this[_0x45b9('0x18')],'dynamics365':this['dynamics365Accounts'],'freshsales':this[_0x45b9('0x1a')],'servicenow':this['servicenowAccounts']};ami['on'](_0x45b9('0x1c'),this[_0x45b9('0x1d')][_0x45b9('0x1e')](this));ami['on']('custom:agentconnect',this[_0x45b9('0x1d')]['bind'](this));ami['on'](_0x45b9('0x1f'),this['syncCustomEvent'][_0x45b9('0x1e')](this));ami['on'](_0x45b9('0x20'),this['syncCustomEvent']['bind'](this));ami['on'](_0x45b9('0x21'),this[_0x45b9('0x1d')][_0x45b9('0x1e')](this));ami['on'](_0x45b9('0x22'),this['syncCustomEvent'][_0x45b9('0x1e')](this));ami['on'](_0x45b9('0x23'),this['syncCustomEvent'][_0x45b9('0x1e')](this));ami['on'](_0x45b9('0x24'),this['syncCustomEvent'][_0x45b9('0x1e')](this));ami['on']('custom:agentreject',this['syncCustomEvent'][_0x45b9('0x1e')](this));ami['on'](_0x45b9('0x25'),this['syncCustomEvent'][_0x45b9('0x1e')](this));ami['on']('custom:queuecallerabandon',this[_0x45b9('0x1d')]['bind'](this));ami['on'](_0x45b9('0x26'),this[_0x45b9('0x1d')][_0x45b9('0x1e')](this));ami['on']('custom:dialbegin',this[_0x45b9('0x27')][_0x45b9('0x1e')](this));ami['on']('custom:dialconnect',this['syncAgentDial'][_0x45b9('0x1e')](this));ami['on']('custom:dialend',this[_0x45b9('0x27')]['bind'](this));ami['on']('custom:newinteraction',this[_0x45b9('0x1d')][_0x45b9('0x1e')](this));ami['on'](_0x45b9('0x28'),this[_0x45b9('0x1d')][_0x45b9('0x1e')](this));ami['on']('custom:substatus',this[_0x45b9('0x1d')][_0x45b9('0x1e')](this));ami['on'](_0x45b9('0x29'),this[_0x45b9('0x1d')]['bind'](this));ami['on']('custom:outgoingmessage',this[_0x45b9('0x1d')][_0x45b9('0x1e')](this));ami['on'](_0x45b9('0x2a'),this[_0x45b9('0x1d')]['bind'](this));ami['on'](_0x45b9('0x2b'),this[_0x45b9('0x1d')]['bind'](this));ami['on']('custom:offlineMessage',this[_0x45b9('0x1d')][_0x45b9('0x1e')](this));}Trigger['prototype'][_0x45b9('0x2c')]=function(_0x4e7652,_0x125c88,_0x4a74fe){logger[_0x45b9('0x2d')](_0x4e7652,_0x125c88,JSON['stringify'](_0x4a74fe));io['to'](_0x4e7652)[_0x45b9('0x2c')](_0x125c88,_0x4a74fe);};Trigger[_0x45b9('0x2e')][_0x45b9('0x1d')]=function(_0x8eaf54){var _0x1ed451=_[_0x45b9('0x2f')](_0x8eaf54);if(typeof _0x1ed451[_0x45b9('0x30')]==='undefined'){_0x1ed451[_0x45b9('0x30')]=_0x45b9('0x31');}logger['debug'](_0x45b9('0x1d'),util[_0x45b9('0x32')](_0x1ed451,{'showHidden':!![],'depth':null}));this['checkTriggers'](_0x1ed451);};Trigger['prototype'][_0x45b9('0x27')]=function(_0x11c5b7){if(this[_0x45b9('0xe')][_0x11c5b7[_0x45b9('0x33')]]){this[_0x45b9('0x1d')](_0x11c5b7);}};Trigger[_0x45b9('0x2e')][_0x45b9('0x34')]=function(_0x3a2199){var _0x4ee2e8;for(var _0x2c8d73 in this[_0x45b9('0xd')]){if(this['triggers']['hasOwnProperty'](_0x2c8d73)){if(this[_0x45b9('0xd')][_0x2c8d73][_0x45b9('0x35')]){_0x4ee2e8=this[_0x45b9('0x36')](this[_0x45b9('0xd')][_0x2c8d73],_0x3a2199);if(_0x4ee2e8){_[_0x45b9('0x37')](_0x3a2199,_0x3a2199[_0x45b9('0x38')]);for(var _0x4d1a89=0x0,_0x129c2e,_0x3e3d18,_0x482ad6;_0x4d1a890x0){_0x328a08=_[_0xb814('0x2c')](_0x5a6291,_0x271aa8);}return _0x328a08;}function getCustomFields(_0x37d24d,_0x530744){var _0x499f22=[];var _0x20577b={'custom_fields':{}};if(_0x37d24d[_0xb814('0x2d')]>0x0){_['forEach'](_0x37d24d,function(_0x338a28){if(_['includes']([_0xb814('0x2e'),'picklist'],_0x338a28['type'])&&_0x338a28[_0xb814('0x2f')]&&!_0x338a28['customField']){_0x20577b[_0x338a28[_0xb814('0x2f')][_0xb814('0x30')]()]=_0x338a28[_0xb814('0x31')]['toString']();}else if(_['includes']([_0xb814('0x2e'),_0xb814('0x32')],_0x338a28['type'])&&_0x338a28[_0xb814('0x33')]&&_0x338a28[_0xb814('0x34')]){_0x20577b[_0xb814('0x35')][_0x338a28[_0xb814('0x33')]]=_0x338a28[_0xb814('0x31')][_0xb814('0x23')]();}else if(_0x338a28[_0xb814('0x36')]==='variable'&&_0x338a28[_0xb814('0x37')]&&_0x338a28[_0xb814('0x33')]&&_0x338a28[_0xb814('0x34')]){_0x530744[_0x338a28[_0xb814('0x37')]]&&(_0x20577b[_0xb814('0x35')][_0x338a28['idField']]=_0x530744[_0x338a28[_0xb814('0x37')]]['toString']());}else if(_0x338a28[_0xb814('0x36')]===_0xb814('0x38')&&_0x338a28[_0xb814('0x39')]&&_0x338a28['Variable'][_0xb814('0x3a')]&&_0x338a28[_0xb814('0x33')]&&_0x338a28['customField']){_0x530744[_0x338a28[_0xb814('0x39')][_0xb814('0x3a')][_0xb814('0x30')]()]&&(_0x20577b[_0xb814('0x35')][_0x338a28[_0xb814('0x33')]]=_0x530744[_0x338a28[_0xb814('0x39')]['name'][_0xb814('0x30')]()]['toString']());}});}if(_0x20577b[_0xb814('0x3b')]){_0x20577b['priority']=Number(_0x20577b[_0xb814('0x3b')]);}return _0x20577b;}function getTicket(_0x4b9233,_0x2f8a2e,_0x26675a,_0x54a7fb,_0x4d308a){logger['info']('Creating\x20new\x20ticket...');var _0x17549e=_[_0xb814('0x3c')]({'subject':intUtil[_0xb814('0x3d')](_0x54a7fb[_0xb814('0x3e')],_0x4d308a,'\x20'),'type':'phone','status':'new','labels':[_0xb814('0x3f'),'Motion',_0xb814('0x40')][_0xb814('0x41')](getTags(_0x54a7fb[_0xb814('0x42')],_0xb814('0x3a'))),'description':intUtil[_0xb814('0x3d')](_0x54a7fb[_0xb814('0x43')],_0x4d308a,'\x0a'),'_links':{'assigned_user':{'href':util[_0xb814('0x10')](_0xb814('0x44'),_0x2f8a2e['id']),'class':_0xb814('0x45')}},'message':{'direction':'in','body':intUtil['getString'](_0x54a7fb['Descriptions'],_0x4d308a,'\x0a')}},getCustomFields(_0x54a7fb['Fields'],_0x4d308a));return request({'uri':util[_0xb814('0x10')]('%s/customers/%d/cases',_0x4b9233[_0xb814('0x1a')],_0x26675a['id']),'method':'POST','body':_0x17549e});}exports[_0xb814('0x46')]=function(_0x44ff56,_0x9ef639,_0x2e97cc,_0x4fae23,_0x30fc57,_0x15f01a){var _0x2b23c7,_0x22cf27;_0x15f01a[_0xb814('0x1a')]=intUtil[_0xb814('0x47')](_0x15f01a['remoteUri']);_0x15f01a[_0xb814('0x48')]=intUtil[_0xb814('0x47')](_0x15f01a[_0xb814('0x48')]);if(_0x30fc57&&_0x30fc57[_0xb814('0x49')]){logger[_0xb814('0xe')](_0xb814('0x4a'),_0xb814('0x4b'));_0x9ef639['recordingURL']=util['format'](_0xb814('0x4c'),_0x15f01a[_0xb814('0x48')],_0x9ef639[_0xb814('0x4d')],md5(_0x9ef639[_0xb814('0x4d')]));}else{_0x9ef639[_0xb814('0x4e')]='';}headers[_0xb814('0x4f')]=getAuth(_0x15f01a);return getUser(_0x15f01a,_0x4fae23[_0xb814('0x50')])[_0xb814('0x12')](function(_0x2eb9b6){_0x2b23c7=_0x2eb9b6;logger[_0xb814('0xe')](_0xb814('0x51'),_0x2b23c7['id']);return getEndUser(_0x15f01a,_0x9ef639['calleridname'],_0x9ef639[_0xb814('0x52')]);})[_0xb814('0x12')](function(_0x4a76bb){_0x22cf27=_0x4a76bb;logger[_0xb814('0xe')]('The\x20Enduser\x20ID\x20is:',_0x22cf27['id']);return getTicket(_0x15f01a,_0x2b23c7,_0x22cf27,_0x2e97cc,_0x9ef639);})[_0xb814('0x12')](function(_0x37866f){if(_0x37866f){logger[_0xb814('0xe')](_0xb814('0x53'));logger[_0xb814('0xe')](_0xb814('0x54'),_0x37866f['id']);switch(_0x15f01a[_0xb814('0x36')]){case _0xb814('0x55'):logger[_0xb814('0xe')](_0xb814('0x4a'),'Displaying\x20ticket\x20to\x20agent...');emit(util['format'](_0xb814('0x56'),_0x4fae23[_0xb814('0x3a')]),_0xb814('0x57'),{'recordId':_0x37866f['id']});break;case _0xb814('0x58'):logger[_0xb814('0xe')](_0xb814('0x4a'),_0xb814('0x59'));emit(util['format'](_0xb814('0x56'),_0x4fae23[_0xb814('0x3a')]),_0xb814('0x5a'),{'uri':util['format'](_0xb814('0x5b'),_0x37866f['id'])});break;default:logger['error'](_0xb814('0x4a'),'Desk\x20account\x20type\x20not\x20recognized');}}})[_0xb814('0x5c')](function(_0x3cf8f8){console['error'](_0x3cf8f8);logger[_0xb814('0x5d')](_0xb814('0x4a'),JSON[_0xb814('0x5e')](_0x3cf8f8));});};exports['outbound']=function(_0x3da050,_0x5f0e58,_0x13bdcf,_0x158893,_0x4aed78,_0x39952d,_0x4a3f84){var _0x539be7,_0x3b9709;_0x39952d[_0xb814('0x1a')]=intUtil[_0xb814('0x47')](_0x39952d['remoteUri']);_0x39952d[_0xb814('0x48')]=intUtil['stripTrailingSlash'](_0x39952d[_0xb814('0x48')]);if(_0x4a3f84&&_0x4a3f84[_0xb814('0x5f')]&&_0x4a3f84['recordingFormat']!==_0xb814('0x60')){logger['info'](_0xb814('0x61'),_0xb814('0x4b'));_0x5f0e58[_0xb814('0x4e')]=util[_0xb814('0x10')](_0xb814('0x4c'),_0x39952d[_0xb814('0x48')],_0x5f0e58[_0xb814('0x4d')],md5(_0x5f0e58[_0xb814('0x4d')]));}headers['Authorization']=getAuth(_0x39952d);return getUser(_0x39952d,_0x158893[_0xb814('0x50')])[_0xb814('0x12')](function(_0x5d71d5){_0x539be7=_0x5d71d5;logger[_0xb814('0xe')](_0xb814('0x51'),_0x539be7['id']);return getEndUser(_0x39952d,_0x5f0e58['destcalleridname'],_0x5f0e58[_0xb814('0x62')]);})['then'](function(_0x48362c){_0x3b9709=_0x48362c;logger[_0xb814('0xe')]('The\x20Enduser\x20ID\x20is:',_0x3b9709['id']);return getTicket(_0x39952d,_0x539be7,_0x3b9709,_0x13bdcf,_0x5f0e58);})[_0xb814('0x12')](function(_0xd1cd8b){if(_0xd1cd8b){logger[_0xb814('0xe')]('Ticket\x20created!');logger[_0xb814('0xe')]('The\x20Ticket\x20ID\x20is:',_0xd1cd8b['id']);switch(_0x39952d[_0xb814('0x36')]){case _0xb814('0x55'):logger[_0xb814('0xe')](_0xb814('0x4a'),_0xb814('0x63'));emit(util[_0xb814('0x10')](_0xb814('0x56'),_0x158893[_0xb814('0x3a')]),_0xb814('0x57'),{'recordId':_0xd1cd8b['id']});break;case'newTab':logger[_0xb814('0xe')](_0xb814('0x4a'),_0xb814('0x59'));emit(util[_0xb814('0x10')](_0xb814('0x56'),_0x158893[_0xb814('0x3a')]),'trigger:browser:url',{'uri':util[_0xb814('0x10')]('%s/agent/tickets/%s',_0x39952d[_0xb814('0x1a')],_0xd1cd8b['id'])});break;default:logger[_0xb814('0x5d')](_0xb814('0x61'),'Desk\x20account\x20type\x20not\x20recognized');}}})[_0xb814('0x5c')](function(_0x579351){logger[_0xb814('0x5d')]('[OUTBOUND]',JSON[_0xb814('0x5e')](_0x579351));});};exports[_0xb814('0x64')]=function(_0xa03cd2,_0x1b024f,_0x3377d4,_0x167d82,_0x143518,_0x4d44e3){var _0x44088d,_0x51ca51;_0x4d44e3[_0xb814('0x1a')]=intUtil[_0xb814('0x47')](_0x4d44e3[_0xb814('0x1a')]);_0x4d44e3[_0xb814('0x48')]=intUtil[_0xb814('0x47')](_0x4d44e3[_0xb814('0x48')]);if(_0x143518&&_0x143518['monitor_format']){logger[_0xb814('0xe')]('['+_0x1b024f[_0xb814('0x65')]['toUpperCase']()+']',_0xb814('0x4b'));_0x1b024f[_0xb814('0x4e')]=util[_0xb814('0x10')](_0xb814('0x4c'),_0x4d44e3[_0xb814('0x48')],_0x1b024f['uniqueid'],md5(_0x1b024f[_0xb814('0x4d')]));}else{_0x1b024f['recordingURL']='';}headers[_0xb814('0x4f')]=getAuth(_0x4d44e3);return getUser(_0x4d44e3)[_0xb814('0x12')](function(_0x2645f6){_0x44088d=_0x2645f6;logger[_0xb814('0xe')](_0xb814('0x51'),_0x44088d['id']);return getEndUser(_0x4d44e3,_0x1b024f[_0xb814('0x66')],_0x1b024f['calleridnum']);})['then'](function(_0x5d064b){_0x51ca51=_0x5d064b;logger[_0xb814('0xe')]('The\x20Enduser\x20ID\x20is:',_0x51ca51['id']);return getTicket(_0x4d44e3,_0x44088d,_0x51ca51,_0x3377d4,_0x1b024f);})[_0xb814('0x12')](function(_0x1d3954){if(_0x1d3954){logger[_0xb814('0xe')]('Ticket\x20created!');logger[_0xb814('0xe')](_0xb814('0x54'),_0x1d3954['id']);}})[_0xb814('0x5c')](function(_0x5aabbe){logger[_0xb814('0x5d')]('['+_0x1b024f[_0xb814('0x65')][_0xb814('0x67')]()+']',JSON[_0xb814('0x5e')](_0x5aabbe));});}; \ No newline at end of file +var _0x814b=['calleridname','toUpperCase','lodash','request-promise','md5','util','ioredis','./util','../../../../config/logger','desk','redis','defaults','localhost','emit','application/json','validateEmail','info','Getting\x20agent\x20with\x20email','format','%s/users','then','total_entries','find','_embedded','entries','Agent\x20found!','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me','remoteUri','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','debug','[HTTP]','%s:%s','authType','token','username','Basic\x20%s','toString','base64','Searching\x20enduser\x20with\x20phone','%s/customers/search','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/customers','POST','work','map','length','string','nameField','toLowerCase','content','picklist','idField','customField','custom_fields','type','variableName','customVariable','Variable','name','priority','merge','getString','Subjects','xCALLY','CTI','concat','Tags','Descriptions','/api/v2/users/%d','user','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','Authorization','email','The\x20User\x20ID\x20is:','calleridnum','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','integrationTab','user:%s','trigger:desk:display','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','https://xcally.desk.com/web/agent/case/%d','catch','error','stringify','recordingFormat','none','[OUTBOUND]','destcalleridnum','Displaying\x20ticket\x20to\x20agent...','unmanaged','lastevent'];(function(_0x50dba0,_0x52e80c){var _0x354e33=function(_0x10638d){while(--_0x10638d){_0x50dba0['push'](_0x50dba0['shift']());}};_0x354e33(++_0x52e80c);}(_0x814b,0x1a2));var _0xb814=function(_0x6148ee,_0x4d2fca){_0x6148ee=_0x6148ee-0x0;var _0x5afc74=_0x814b[_0x6148ee];return _0x5afc74;};'use strict';var _=require(_0xb814('0x0'));var rp=require(_0xb814('0x1'));var md5=require(_0xb814('0x2'));var util=require(_0xb814('0x3'));var Redis=require(_0xb814('0x4'));var intUtil=require(_0xb814('0x5'));var config=require('../../../../config/environment');var logger=require(_0xb814('0x6'))(_0xb814('0x7'));config[_0xb814('0x8')]=_[_0xb814('0x9')](config[_0xb814('0x8')],{'host':_0xb814('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xb814('0x8')]));function emit(_0x2e6272,_0x5c8539,_0x271af9){io['to'](_0x2e6272)[_0xb814('0xb')](_0x5c8539,_0x271af9);}var headers={'Content-Type':_0xb814('0xc'),'Accept':_0xb814('0xc')};function getUser(_0x1fea33,_0x21d4a5){if(intUtil[_0xb814('0xd')](_0x21d4a5)===!![]){logger[_0xb814('0xe')](_0xb814('0xf'),_0x21d4a5);return request({'uri':util[_0xb814('0x10')](_0xb814('0x11'),_0x1fea33['remoteUri'])})[_0xb814('0x12')](function(_0x56278f){if(_0x56278f[_0xb814('0x13')]){return _[_0xb814('0x14')](_0x56278f[_0xb814('0x15')][_0xb814('0x16')],{'email':_0x21d4a5});}})[_0xb814('0x12')](function(_0x3bde14){if(_0x3bde14){logger[_0xb814('0xe')](_0xb814('0x17'));return _0x3bde14;}else{logger[_0xb814('0xe')](_0xb814('0x18'));return request({'uri':util[_0xb814('0x10')](_0xb814('0x19'),_0x1fea33[_0xb814('0x1a')])});}});}else{logger[_0xb814('0xe')](_0xb814('0x1b'));return request({'uri':util[_0xb814('0x10')](_0xb814('0x19'),_0x1fea33[_0xb814('0x1a')])});}}function request(_0x125ce2){logger[_0xb814('0x1c')](_0xb814('0x1d'),JSON['stringify'](_0x125ce2));return rp(_[_0xb814('0x9')](_0x125ce2,{'method':'GET','headers':headers,'json':!![]}));}function getAuth(_0x270598){var _0xfac75b;if(_0x270598['authType']==='basic'){_0xfac75b=util['format'](_0xb814('0x1e'),_0x270598['username'],_0x270598['password']);}else if(_0x270598[_0xb814('0x1f')]===_0xb814('0x20')){_0xfac75b=util[_0xb814('0x10')]('%s/token:%s',_0x270598[_0xb814('0x21')],_0x270598['token']);}return util[_0xb814('0x10')](_0xb814('0x22'),new Buffer(_0xfac75b)[_0xb814('0x23')](_0xb814('0x24')));}function getEndUser(_0x27352e,_0x2bd039,_0x1f5d40){logger['info'](_0xb814('0x25'),_0x1f5d40);return request({'uri':util['format'](_0xb814('0x26'),_0x27352e[_0xb814('0x1a')]),'qs':{'phone':_0x1f5d40}})[_0xb814('0x12')](function(_0x208927){if(_0x208927[_0xb814('0x13')]){logger[_0xb814('0xe')](_0xb814('0x27'));return _0x208927['_embedded'][_0xb814('0x16')][0x0];}else{logger[_0xb814('0xe')](_0xb814('0x28'));return request({'uri':util[_0xb814('0x10')](_0xb814('0x29'),_0x27352e[_0xb814('0x1a')]),'method':_0xb814('0x2a'),'body':{'first_name':_0x2bd039,'title':_0x2bd039,'phone_numbers':[{'type':_0xb814('0x2b'),'value':_0x1f5d40}]}});}});}function getTags(_0x5a6291,_0x271aa8){var _0x328a08=[];if(_0x5a6291&&_0x5a6291['length']>0x0){_0x328a08=_[_0xb814('0x2c')](_0x5a6291,_0x271aa8);}return _0x328a08;}function getCustomFields(_0x37d24d,_0x530744){var _0x499f22=[];var _0x20577b={'custom_fields':{}};if(_0x37d24d[_0xb814('0x2d')]>0x0){_['forEach'](_0x37d24d,function(_0x338a28){if(_['includes']([_0xb814('0x2e'),'picklist'],_0x338a28['type'])&&_0x338a28[_0xb814('0x2f')]&&!_0x338a28['customField']){_0x20577b[_0x338a28[_0xb814('0x2f')][_0xb814('0x30')]()]=_0x338a28[_0xb814('0x31')]['toString']();}else if(_['includes']([_0xb814('0x2e'),_0xb814('0x32')],_0x338a28['type'])&&_0x338a28[_0xb814('0x33')]&&_0x338a28[_0xb814('0x34')]){_0x20577b[_0xb814('0x35')][_0x338a28[_0xb814('0x33')]]=_0x338a28[_0xb814('0x31')][_0xb814('0x23')]();}else if(_0x338a28[_0xb814('0x36')]==='variable'&&_0x338a28[_0xb814('0x37')]&&_0x338a28[_0xb814('0x33')]&&_0x338a28[_0xb814('0x34')]){_0x530744[_0x338a28[_0xb814('0x37')]]&&(_0x20577b[_0xb814('0x35')][_0x338a28['idField']]=_0x530744[_0x338a28[_0xb814('0x37')]]['toString']());}else if(_0x338a28[_0xb814('0x36')]===_0xb814('0x38')&&_0x338a28[_0xb814('0x39')]&&_0x338a28['Variable'][_0xb814('0x3a')]&&_0x338a28[_0xb814('0x33')]&&_0x338a28['customField']){_0x530744[_0x338a28[_0xb814('0x39')][_0xb814('0x3a')][_0xb814('0x30')]()]&&(_0x20577b[_0xb814('0x35')][_0x338a28[_0xb814('0x33')]]=_0x530744[_0x338a28[_0xb814('0x39')]['name'][_0xb814('0x30')]()]['toString']());}});}if(_0x20577b[_0xb814('0x3b')]){_0x20577b['priority']=Number(_0x20577b[_0xb814('0x3b')]);}return _0x20577b;}function getTicket(_0x4b9233,_0x2f8a2e,_0x26675a,_0x54a7fb,_0x4d308a){logger['info']('Creating\x20new\x20ticket...');var _0x17549e=_[_0xb814('0x3c')]({'subject':intUtil[_0xb814('0x3d')](_0x54a7fb[_0xb814('0x3e')],_0x4d308a,'\x20'),'type':'phone','status':'new','labels':[_0xb814('0x3f'),'Motion',_0xb814('0x40')][_0xb814('0x41')](getTags(_0x54a7fb[_0xb814('0x42')],_0xb814('0x3a'))),'description':intUtil[_0xb814('0x3d')](_0x54a7fb[_0xb814('0x43')],_0x4d308a,'\x0a'),'_links':{'assigned_user':{'href':util[_0xb814('0x10')](_0xb814('0x44'),_0x2f8a2e['id']),'class':_0xb814('0x45')}},'message':{'direction':'in','body':intUtil['getString'](_0x54a7fb['Descriptions'],_0x4d308a,'\x0a')}},getCustomFields(_0x54a7fb['Fields'],_0x4d308a));return request({'uri':util[_0xb814('0x10')]('%s/customers/%d/cases',_0x4b9233[_0xb814('0x1a')],_0x26675a['id']),'method':'POST','body':_0x17549e});}exports[_0xb814('0x46')]=function(_0x44ff56,_0x9ef639,_0x2e97cc,_0x4fae23,_0x30fc57,_0x15f01a){var _0x2b23c7,_0x22cf27;_0x15f01a[_0xb814('0x1a')]=intUtil[_0xb814('0x47')](_0x15f01a['remoteUri']);_0x15f01a[_0xb814('0x48')]=intUtil[_0xb814('0x47')](_0x15f01a[_0xb814('0x48')]);if(_0x30fc57&&_0x30fc57[_0xb814('0x49')]){logger[_0xb814('0xe')](_0xb814('0x4a'),_0xb814('0x4b'));_0x9ef639['recordingURL']=util['format'](_0xb814('0x4c'),_0x15f01a[_0xb814('0x48')],_0x9ef639[_0xb814('0x4d')],md5(_0x9ef639[_0xb814('0x4d')]));}else{_0x9ef639[_0xb814('0x4e')]='';}headers[_0xb814('0x4f')]=getAuth(_0x15f01a);return getUser(_0x15f01a,_0x4fae23[_0xb814('0x50')])[_0xb814('0x12')](function(_0x2eb9b6){_0x2b23c7=_0x2eb9b6;logger[_0xb814('0xe')](_0xb814('0x51'),_0x2b23c7['id']);return getEndUser(_0x15f01a,_0x9ef639['calleridname'],_0x9ef639[_0xb814('0x52')]);})[_0xb814('0x12')](function(_0x4a76bb){_0x22cf27=_0x4a76bb;logger[_0xb814('0xe')]('The\x20Enduser\x20ID\x20is:',_0x22cf27['id']);return getTicket(_0x15f01a,_0x2b23c7,_0x22cf27,_0x2e97cc,_0x9ef639);})[_0xb814('0x12')](function(_0x37866f){if(_0x37866f){logger[_0xb814('0xe')](_0xb814('0x53'));logger[_0xb814('0xe')](_0xb814('0x54'),_0x37866f['id']);switch(_0x15f01a[_0xb814('0x36')]){case _0xb814('0x55'):logger[_0xb814('0xe')](_0xb814('0x4a'),'Displaying\x20ticket\x20to\x20agent...');emit(util['format'](_0xb814('0x56'),_0x4fae23[_0xb814('0x3a')]),_0xb814('0x57'),{'recordId':_0x37866f['id']});break;case _0xb814('0x58'):logger[_0xb814('0xe')](_0xb814('0x4a'),_0xb814('0x59'));emit(util['format'](_0xb814('0x56'),_0x4fae23[_0xb814('0x3a')]),_0xb814('0x5a'),{'uri':util['format'](_0xb814('0x5b'),_0x37866f['id'])});break;default:logger['error'](_0xb814('0x4a'),'Desk\x20account\x20type\x20not\x20recognized');}}})[_0xb814('0x5c')](function(_0x3cf8f8){console['error'](_0x3cf8f8);logger[_0xb814('0x5d')](_0xb814('0x4a'),JSON[_0xb814('0x5e')](_0x3cf8f8));});};exports['outbound']=function(_0x3da050,_0x5f0e58,_0x13bdcf,_0x158893,_0x4aed78,_0x39952d,_0x4a3f84){var _0x539be7,_0x3b9709;_0x39952d[_0xb814('0x1a')]=intUtil[_0xb814('0x47')](_0x39952d['remoteUri']);_0x39952d[_0xb814('0x48')]=intUtil['stripTrailingSlash'](_0x39952d[_0xb814('0x48')]);if(_0x4a3f84&&_0x4a3f84[_0xb814('0x5f')]&&_0x4a3f84['recordingFormat']!==_0xb814('0x60')){logger['info'](_0xb814('0x61'),_0xb814('0x4b'));_0x5f0e58[_0xb814('0x4e')]=util[_0xb814('0x10')](_0xb814('0x4c'),_0x39952d[_0xb814('0x48')],_0x5f0e58[_0xb814('0x4d')],md5(_0x5f0e58[_0xb814('0x4d')]));}headers['Authorization']=getAuth(_0x39952d);return getUser(_0x39952d,_0x158893[_0xb814('0x50')])[_0xb814('0x12')](function(_0x5d71d5){_0x539be7=_0x5d71d5;logger[_0xb814('0xe')](_0xb814('0x51'),_0x539be7['id']);return getEndUser(_0x39952d,_0x5f0e58['destcalleridname'],_0x5f0e58[_0xb814('0x62')]);})['then'](function(_0x48362c){_0x3b9709=_0x48362c;logger[_0xb814('0xe')]('The\x20Enduser\x20ID\x20is:',_0x3b9709['id']);return getTicket(_0x39952d,_0x539be7,_0x3b9709,_0x13bdcf,_0x5f0e58);})[_0xb814('0x12')](function(_0xd1cd8b){if(_0xd1cd8b){logger[_0xb814('0xe')]('Ticket\x20created!');logger[_0xb814('0xe')]('The\x20Ticket\x20ID\x20is:',_0xd1cd8b['id']);switch(_0x39952d[_0xb814('0x36')]){case _0xb814('0x55'):logger[_0xb814('0xe')](_0xb814('0x4a'),_0xb814('0x63'));emit(util[_0xb814('0x10')](_0xb814('0x56'),_0x158893[_0xb814('0x3a')]),_0xb814('0x57'),{'recordId':_0xd1cd8b['id']});break;case'newTab':logger[_0xb814('0xe')](_0xb814('0x4a'),_0xb814('0x59'));emit(util[_0xb814('0x10')](_0xb814('0x56'),_0x158893[_0xb814('0x3a')]),'trigger:browser:url',{'uri':util[_0xb814('0x10')]('%s/agent/tickets/%s',_0x39952d[_0xb814('0x1a')],_0xd1cd8b['id'])});break;default:logger[_0xb814('0x5d')](_0xb814('0x61'),'Desk\x20account\x20type\x20not\x20recognized');}}})[_0xb814('0x5c')](function(_0x579351){logger[_0xb814('0x5d')]('[OUTBOUND]',JSON[_0xb814('0x5e')](_0x579351));});};exports[_0xb814('0x64')]=function(_0xa03cd2,_0x1b024f,_0x3377d4,_0x167d82,_0x143518,_0x4d44e3){var _0x44088d,_0x51ca51;_0x4d44e3[_0xb814('0x1a')]=intUtil[_0xb814('0x47')](_0x4d44e3[_0xb814('0x1a')]);_0x4d44e3[_0xb814('0x48')]=intUtil[_0xb814('0x47')](_0x4d44e3[_0xb814('0x48')]);if(_0x143518&&_0x143518['monitor_format']){logger[_0xb814('0xe')]('['+_0x1b024f[_0xb814('0x65')]['toUpperCase']()+']',_0xb814('0x4b'));_0x1b024f[_0xb814('0x4e')]=util[_0xb814('0x10')](_0xb814('0x4c'),_0x4d44e3[_0xb814('0x48')],_0x1b024f['uniqueid'],md5(_0x1b024f[_0xb814('0x4d')]));}else{_0x1b024f['recordingURL']='';}headers[_0xb814('0x4f')]=getAuth(_0x4d44e3);return getUser(_0x4d44e3)[_0xb814('0x12')](function(_0x2645f6){_0x44088d=_0x2645f6;logger[_0xb814('0xe')](_0xb814('0x51'),_0x44088d['id']);return getEndUser(_0x4d44e3,_0x1b024f[_0xb814('0x66')],_0x1b024f['calleridnum']);})['then'](function(_0x5d064b){_0x51ca51=_0x5d064b;logger[_0xb814('0xe')]('The\x20Enduser\x20ID\x20is:',_0x51ca51['id']);return getTicket(_0x4d44e3,_0x44088d,_0x51ca51,_0x3377d4,_0x1b024f);})[_0xb814('0x12')](function(_0x1d3954){if(_0x1d3954){logger[_0xb814('0xe')]('Ticket\x20created!');logger[_0xb814('0xe')](_0xb814('0x54'),_0x1d3954['id']);}})[_0xb814('0x5c')](function(_0x5aabbe){logger[_0xb814('0x5d')]('['+_0x1b024f[_0xb814('0x65')][_0xb814('0x67')]()+']',JSON[_0xb814('0x5e')](_0x5aabbe));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/dynamics365.js b/server/services/ami/trigger/integration/dynamics365.js index 024228f..3b733f3 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 _0x56a7=['data2','resolve','data5','POST','username','password','clientSecret','then','access_token','catch','error',']\x20Wrong\x20credentials!','message','GET','systemusers?$select=internalemailaddress,isdisabled,systemuserid','Bearer\x20','4.0','isNil','validateEmail','email','userEmail','internalemailaddress','info',']\x20Agent\x20found\x20','systemuserid','userId','toUpperCase',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','length','toLowerCase','outbound','destcalleridnum','calleridnum','contacts','/systemusers(','body','headers','odata-entityid','substring','lastIndexOf','enduserId','telephone1','contacts?$select=','&$filter=','\x20eq\x20\x27','replace','contactid','nothing',']\x20Enduser\x20NOT\x20Created\x20-\x20ModuleCreate\x20=\x20Nothing','forEach','includes','picklist','type','nameField','idField','indexOf','content','ticketType','incidents','assign','getString','Subjects','Descriptions','Fields','callDirection','queue','/contacts(','phonecalls','format','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','user:%s','emit','trigger:browser:url','stripTrailingSlash','serverUrl','unmanaged','%s/api/data/v9.0/','https://login.microsoftonline.com/%s/oauth2/token','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingFormat','none','recordingURL',']\x20The\x20User\x20ID\x20is:',']\x20The\x20User\x20email\x20is:','moduleCreate','additionalSearchContact',']\x20The\x20Enduser\x20phone\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s','ticketId','openNewTab','name','Error\x20running\x20Dynamics365\x20integration','lodash','request-promise','util','ioredis','../../../../config/logger','dynamics365','redis','defaults','localhost','socket.io-emitter','modernAuthentication','remoteUri','data7','tenantId','CloudProvider'];(function(_0x1d82fe,_0x1c6fd7){var _0x3c98ca=function(_0x47feff){while(--_0x47feff){_0x1d82fe['push'](_0x1d82fe['shift']());}};_0x3c98ca(++_0x1c6fd7);}(_0x56a7,0xcf));var _0x756a=function(_0x35485a,_0x91cdd4){_0x35485a=_0x35485a-0x0;var _0x5148e6=_0x56a7[_0x35485a];return _0x5148e6;};'use strict';var _=require(_0x756a('0x0'));var rp=require(_0x756a('0x1'));var util=require(_0x756a('0x2'));var intUtil=require('./util');var md5=require('md5');var Redis=require(_0x756a('0x3'));var logger=require(_0x756a('0x4'))(_0x756a('0x5'));var config=require('../../../../config/environment');config[_0x756a('0x6')]=_[_0x756a('0x7')](config[_0x756a('0x6')],{'host':_0x756a('0x8'),'port':0x18eb});var io=require(_0x756a('0x9'))(new Redis(config['redis']));function getAuthToken(_0x255816,_0x2b40a3,_0x31a108){if(_0x255816[_0x756a('0xa')]){_0x255816[_0x756a('0xb')]=_0x255816['CloudProvider'][_0x756a('0xc')];_0x255816[_0x756a('0xd')]=_0x255816[_0x756a('0xe')][_0x756a('0xf')];return Promise[_0x756a('0x10')](_0x255816[_0x756a('0xe')][_0x756a('0x11')]);}var _0x7ba8dd={'method':_0x756a('0x12'),'uri':_0x2b40a3,'form':{'client_id':_0x255816['clientId'],'resource':_0x255816[_0x756a('0xb')],'username':_0x255816[_0x756a('0x13')],'password':_0x255816[_0x756a('0x14')],'grant_type':_0x756a('0x14'),'client_secret':_0x255816[_0x756a('0x15')]},'json':!![]};return rp(_0x7ba8dd)[_0x756a('0x16')](function(_0x1161a9){return _0x1161a9[_0x756a('0x17')];})[_0x756a('0x18')](function(_0x353fa1){logger[_0x756a('0x19')]('['+[_0x31a108['toUpperCase']()]+_0x756a('0x1a'));return _0x353fa1[_0x756a('0x1b')];});}function getUser(_0x46aca0,_0x3e6a74,_0x25625d,_0x2e8c32,_0x55dcde,_0x3c6d62){return new Promise(function(_0x54cb7d,_0x5d6de8){return getAuthToken(_0x3e6a74,_0x2e8c32,_0x3c6d62)['then'](function(_0xf6ff75){var _0x20887c={'method':_0x756a('0x1c'),'uri':_0x55dcde+_0x756a('0x1d'),'headers':{'Authorization':_0x756a('0x1e')+_0xf6ff75,'OData-Version':_0x756a('0x1f')},'json':!![]};return rp(_0x20887c);})[_0x756a('0x16')](function(_0x3ccbea){var _0xc4a9c8=_0x3ccbea['value'];var _0x3051ba=![];var _0x5e5884=null;if(!_[_0x756a('0x20')](_0x25625d)){if(intUtil[_0x756a('0x21')](_0x25625d[_0x756a('0x22')])){_0x46aca0[_0x756a('0x23')]=_0x25625d[_0x756a('0x22')];for(_0x5e5884=0x0;_0x5e5884<_0xc4a9c8['length'];_0x5e5884++){if(_0xc4a9c8[_0x5e5884][_0x756a('0x24')]===_0x25625d['email']&&!_0xc4a9c8[_0x5e5884]['isdisabled']){_0x3051ba=!![];logger[_0x756a('0x25')]('['+[_0x3c6d62['toUpperCase']()]+_0x756a('0x26')+_0xc4a9c8[_0x5e5884][_0x756a('0x27')]+'!');_0x46aca0[_0x756a('0x28')]=_0xc4a9c8[_0x5e5884][_0x756a('0x27')];}}}}if(!_0x3051ba){logger[_0x756a('0x25')]('['+[_0x3c6d62[_0x756a('0x29')]()]+_0x756a('0x2a'));_0x46aca0[_0x756a('0x23')]=_0x3e6a74[_0x756a('0x13')];for(_0x5e5884=0x0;_0x5e5884<_0xc4a9c8[_0x756a('0x2b')];_0x5e5884++){if(_0xc4a9c8[_0x5e5884][_0x756a('0x24')]===_0x3e6a74[_0x756a('0x13')]){_0x46aca0['userId']=_0xc4a9c8[_0x5e5884][_0x756a('0x27')];}}}_0x54cb7d(_0x46aca0);})[_0x756a('0x18')](function(_0x15571b){_0x5d6de8(_0x15571b[_0x756a('0x1b')]);});});}function createEndUser(_0x3c499e,_0x4d5d8c,_0x13a4bc,_0x432216,_0x348ca0,_0xd8d162,_0x35ff46){return new Promise(function(_0x46468a,_0x52695){return getAuthToken(_0x4d5d8c,_0x13a4bc,_0xd8d162)[_0x756a('0x16')](function(_0x1b36f0){var _0x157ad8=_0xd8d162[_0x756a('0x2c')]()===_0x756a('0x2d')?_0x348ca0[_0x756a('0x2e')]:_0x348ca0[_0x756a('0x2f')];var _0x44ca03={'method':_0x756a('0x12'),'uri':_0x432216+_0x756a('0x30'),'body':{'fullname':_0x157ad8,'firstname':_0x157ad8,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0x756a('0x31')+_0x3c499e[_0x756a('0x28')]+')'},'headers':{'Authorization':_0x756a('0x1e')+_0x1b36f0,'OData-Version':_0x756a('0x1f')},'json':!![],'resolveWithFullResponse':!![]};_0x44ca03[_0x756a('0x32')][_0x35ff46]=_0x157ad8;return rp(_0x44ca03);})[_0x756a('0x16')](function(_0x4bad95){var _0x25d29d=_0x4bad95[_0x756a('0x33')][_0x756a('0x34')];var _0x517f05=_0x25d29d[_0x756a('0x35')](_0x25d29d[_0x756a('0x36')]('(')+0x1,_0x25d29d[_0x756a('0x36')](')'));_0x3c499e[_0x756a('0x37')]=_0x517f05;_0x46468a(_0x3c499e);})[_0x756a('0x18')](function(_0x30d8eb){_0x52695(_0x30d8eb[_0x756a('0x1b')]);});});}function getEndUser(_0x19c25f,_0x5ecb49,_0x109d2f,_0x3d48b1,_0x462f7d,_0x51b462,_0x338e76,_0x50474c){var _0x557fc7=_0x51b462['toLowerCase']()===_0x756a('0x2d')?_0x462f7d[_0x756a('0x2e')]:_0x462f7d[_0x756a('0x2f')];return getAuthToken(_0x5ecb49,_0x109d2f,_0x51b462)[_0x756a('0x16')](function(_0x40582e){_0x50474c=_0x50474c?_0x50474c:_0x756a('0x38');var _0x400ec8={'method':_0x756a('0x1c'),'uri':_0x3d48b1+_0x756a('0x39')+_0x50474c+_0x756a('0x3a')+_0x50474c+_0x756a('0x3b')+_0x557fc7[_0x756a('0x3c')]('+','%2b')+'\x27','headers':{'Authorization':_0x756a('0x1e')+_0x40582e,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x400ec8);})[_0x756a('0x16')](function(_0x3484ab){var _0x58ae15=![];if(!_0x3484ab)return _0x58ae15;var _0x316ce5=_0x3484ab['value'];for(var _0x22a13a=0x0;_0x22a13a<_0x316ce5[_0x756a('0x2b')];_0x22a13a++){if(_0x316ce5[_0x22a13a][_0x50474c]===_0x557fc7){_0x58ae15=!![];_0x19c25f[_0x756a('0x37')]=_0x316ce5[_0x22a13a][_0x756a('0x3d')];}}return _0x58ae15;})[_0x756a('0x16')](function(_0x1f73e6){if(_0x1f73e6)return _0x19c25f;if(_0x338e76===_0x756a('0x3e')){logger[_0x756a('0x25')]('['+[_0x51b462['toUpperCase']()]+_0x756a('0x3f'));return _0x19c25f;}return createEndUser(_0x19c25f,_0x5ecb49,_0x109d2f,_0x3d48b1,_0x462f7d,_0x51b462,_0x50474c)[_0x756a('0x16')](function(_0x5e047f){logger[_0x756a('0x25')]('['+[_0x51b462[_0x756a('0x29')]()]+']\x20Enduser\x20created!',_0x5e047f[_0x756a('0x37')]);return _0x5e047f;});});}function getCustomFields(_0x275fa1,_0x53128a,_0x37c417){var _0x311109={};if(_0x275fa1[_0x756a('0x2b')]>0x0){_[_0x756a('0x40')](_0x275fa1,function(_0x30de79){if(_[_0x756a('0x41')](['string',_0x756a('0x42')],_0x30de79[_0x756a('0x43')])&&_0x30de79[_0x756a('0x44')]&&!_0x30de79['customField']){var _0x78a75a=_0x30de79[_0x756a('0x45')][_0x756a('0x2c')]();var _0x3e2ab9=_0x78a75a[_0x756a('0x35')](0x0,_0x78a75a[_0x756a('0x46')]('_'));var _0x4b0e78=_0x78a75a[_0x756a('0x35')](_0x78a75a[_0x756a('0x46')]('_')+0x1);if(_0x3e2ab9===_0x37c417){_0x311109[_0x4b0e78]=_0x30de79[_0x756a('0x47')];}}});}return _0x311109;}function getTicket(_0x5f5405,_0x4ebfc7,_0x2339ea,_0x38c1e4,_0x328b70,_0x238ffa,_0x7b650d){return new Promise(function(_0x5573fb,_0x1964f5){var _0x535630;return getAuthToken(_0x4ebfc7,_0x2339ea,_0x7b650d)['then'](function(_0x11cff6){if(_0x238ffa[_0x756a('0x48')]==='incident'){_0x535630={'method':'POST','uri':_0x38c1e4+_0x756a('0x49'),'body':Object[_0x756a('0x4a')]({},{'title':intUtil[_0x756a('0x4b')](_0x238ffa[_0x756a('0x4c')],_0x328b70,'\x20'),'description':intUtil[_0x756a('0x4b')](_0x238ffa[_0x756a('0x4d')],_0x328b70,'\x0a'),'customerid_contact@odata.bind':_0x5f5405[_0x756a('0x37')]?'/contacts('+_0x5f5405[_0x756a('0x37')]+')':undefined,'ownerid@odata.bind':_0x756a('0x31')+_0x5f5405['userId']+')','caseorigincode':'1'},getCustomFields(_0x238ffa[_0x756a('0x4e')],_0x328b70,_0x238ffa[_0x756a('0x48')])),'headers':{'Authorization':_0x756a('0x1e')+_0x11cff6,'OData-Version':_0x756a('0x1f')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x238ffa[_0x756a('0x48')]==='phonecall'){var _0x5bd063=_0x5f5405[_0x756a('0x37')]?[{'partyid_systemuser@odata.bind':_0x756a('0x31')+_0x5f5405[_0x756a('0x28')]+')','participationtypemask':_0x5f5405[_0x756a('0x4f')]===_0x756a('0x50')?0x2:0x1},{'partyid_contact@odata.bind':_0x756a('0x51')+_0x5f5405[_0x756a('0x37')]+')','participationtypemask':_0x5f5405['callDirection']===_0x756a('0x50')?0x1:0x2}]:[{'partyid_systemuser@odata.bind':_0x756a('0x31')+_0x5f5405[_0x756a('0x28')]+')','participationtypemask':_0x5f5405[_0x756a('0x4f')]===_0x756a('0x50')?0x2:0x1}];_0x535630={'method':'POST','uri':_0x38c1e4+_0x756a('0x52'),'body':Object['assign']({},{'subject':intUtil[_0x756a('0x4b')](_0x238ffa[_0x756a('0x4c')],_0x328b70,'\x20'),'phonenumber':String(_0x328b70['calleridnum']),'description':intUtil[_0x756a('0x4b')](_0x238ffa['Descriptions'],_0x328b70,'\x0a'),'regardingobjectid_contact@odata.bind':_0x5f5405[_0x756a('0x37')]?_0x756a('0x51')+_0x5f5405['enduserId']+')':undefined,'ownerid@odata.bind':_0x756a('0x31')+_0x5f5405[_0x756a('0x28')]+')','directioncode':_0x5f5405['callDirection']===_0x756a('0x50')?![]:!![],'phonecall_activity_parties':_0x5bd063},getCustomFields(_0x238ffa[_0x756a('0x4e')],_0x328b70,_0x238ffa[_0x756a('0x48')])),'headers':{'Authorization':'Bearer\x20'+_0x11cff6,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x535630);})[_0x756a('0x16')](function(_0x253b28){var _0x3154c5=_0x253b28[_0x756a('0x33')][_0x756a('0x34')];var _0x1de0a7=_0x3154c5['substring'](_0x3154c5[_0x756a('0x36')]('(')+0x1,_0x3154c5[_0x756a('0x36')](')'));_0x5f5405['ticketId']=_0x1de0a7;_0x5573fb(_0x5f5405);})['catch'](function(_0x5bd3ce){_0x1964f5(_0x5bd3ce[_0x756a('0x1b')]);});});}function emit(_0x2f932f,_0x3e311d,_0x512717,_0x1881c2){var _0x1c4b05={'uri':util[_0x756a('0x53')](_0x756a('0x54'),_0x2f932f,_0x512717,_0x1881c2)};io['to'](util['format'](_0x756a('0x55'),_0x3e311d))[_0x756a('0x56')](_0x756a('0x57'),_0x1c4b05);}exports['cs']=function(_0x4dc6f9,_0x4ea09a,_0x2211e0,_0x12f8b,_0x1b3382,_0x37caab,_0x508170,_0x204581){var _0x1a3afb={};_0x37caab['remoteUri']=_0x37caab[_0x756a('0xa')]?intUtil[_0x756a('0x58')](_0x37caab[_0x756a('0xe')]['data7']):intUtil[_0x756a('0x58')](_0x37caab[_0x756a('0xb')]);_0x37caab[_0x756a('0x59')]=intUtil['stripTrailingSlash'](_0x37caab[_0x756a('0x59')]);_0x1a3afb[_0x756a('0x4f')]=_0x204581===_0x756a('0x50')||_0x204581===_0x756a('0x5a')?_0x756a('0x50'):_0x756a('0x2d');var _0x44ea06=_0x37caab[_0x756a('0xa')]?util[_0x756a('0x53')](_0x756a('0x5b'),_0x37caab[_0x756a('0xe')][_0x756a('0xc')]):util[_0x756a('0x53')](_0x756a('0x5b'),_0x37caab[_0x756a('0xb')]);var _0x500f4e=util[_0x756a('0x53')](_0x756a('0x5c'),_0x37caab['tenantId']);var _0x4fe12c=util[_0x756a('0x53')](_0x756a('0x5d'),_0x37caab[_0x756a('0x59')],_0x4ea09a[_0x756a('0x5e')],md5(_0x4ea09a['uniqueid']));if(_0x1b3382&&_0x1b3382[_0x756a('0x5f')]){logger[_0x756a('0x25')](_0x756a('0x60'),_0x756a('0x61'));_0x4ea09a['recordingURL']=_0x4fe12c;}else if(_0x508170&&_0x508170[_0x756a('0x62')]&&_0x508170[_0x756a('0x62')]!==_0x756a('0x63')){logger[_0x756a('0x25')]('[OUTBOUND]',_0x756a('0x61'));_0x4ea09a[_0x756a('0x64')]=_0x4fe12c;}else{_0x4ea09a[_0x756a('0x64')]='';}return getUser(_0x1a3afb,_0x37caab,_0x12f8b,_0x500f4e,_0x44ea06,_0x204581)[_0x756a('0x16')](function(_0x41e6c2){logger[_0x756a('0x25')]('['+_0x204581['toUpperCase']()+_0x756a('0x65'),_0x41e6c2[_0x756a('0x28')]);logger['info']('['+_0x204581[_0x756a('0x29')]()+_0x756a('0x66'),_0x41e6c2[_0x756a('0x23')]);return getEndUser(_0x41e6c2,_0x37caab,_0x500f4e,_0x44ea06,_0x4ea09a,_0x204581,_0x2211e0[_0x756a('0x67')],_0x2211e0[_0x756a('0x68')]);})['then'](function(_0x88417e){logger['info']('['+_0x204581['toUpperCase']()+']\x20The\x20Enduser\x20ID\x20is:',_0x88417e['enduserId']);logger[_0x756a('0x25')]('['+_0x204581['toUpperCase']()+_0x756a('0x69'),_0x4ea09a[_0x756a('0x2f')]);return getTicket(_0x88417e,_0x37caab,_0x500f4e,_0x44ea06,_0x4ea09a,_0x2211e0,_0x204581);})[_0x756a('0x16')](function(_0x5229f5){logger['info'](util['format']('['+_0x204581[_0x756a('0x29')]()+_0x756a('0x6a'),_0x2211e0[_0x756a('0x48')],_0x5229f5[_0x756a('0x6b')]));logger['info'](util['format']('['+_0x204581[_0x756a('0x29')]()+']\x20Call\x20direction:\x20%s',_0x204581));if(_0x204581!==_0x756a('0x5a')&&_0x2211e0[_0x756a('0x6c')]){logger[_0x756a('0x25')]('['+_0x204581[_0x756a('0x29')]()+']','Displaying\x20call\x20in\x20a\x20new\x20tab...');emit(_0x37caab['remoteUri'],_0x12f8b[_0x756a('0x6d')],_0x2211e0['ticketType'],_0x5229f5[_0x756a('0x6b')]);}})[_0x756a('0x18')](function(_0x5a870c){logger['error']('['+_0x204581[_0x756a('0x29')]()+']\x20Error\x20running\x20Dynamics365\x20integration',_0x5a870c[_0x756a('0x1b')]);console[_0x756a('0x19')](_0x756a('0x6e'),_0x5a870c);});}; \ No newline at end of file +var _0xa02e=['incidents','assign','getString','Subjects','Descriptions','/contacts(','ticketType','phonecall','queue','callDirection','phonecalls','ticketId','format','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','user:%s','emit','trigger:browser:url','remoteUri','stripTrailingSlash','serverUrl','https://login.microsoftonline.com/%s/oauth2/token','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','recordingURL','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!',']\x20The\x20User\x20ID\x20is:','moduleCreate',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20Enduser\x20phone\x20is:',']\x20Call\x20direction:\x20%s','unmanaged','openNewTab','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20Dynamics365\x20integration','Error\x20running\x20Dynamics365\x20integration','lodash','request-promise','util','./util','ioredis','../../../../config/logger','redis','defaults','socket.io-emitter','modernAuthentication','CloudProvider','data7','tenantId','resolve','POST','username','password','access_token','catch','error','toUpperCase','then','GET','systemusers?$select=internalemailaddress,isdisabled,systemuserid','Bearer\x20','value','isNil','validateEmail','userEmail','email','length','internalemailaddress','isdisabled','info','systemuserid','userId',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','message','toLowerCase','outbound','destcalleridnum','calleridnum','contacts','/systemusers(','headers','odata-entityid','substring','lastIndexOf','enduserId','telephone1','&$filter=','\x20eq\x20\x27','%2b','4.0',']\x20Enduser\x20NOT\x20Created\x20-\x20ModuleCreate\x20=\x20Nothing',']\x20Enduser\x20created!','forEach','includes','string','type','nameField','customField','idField','indexOf','content'];(function(_0x5f2098,_0x47308b){var _0x18af32=function(_0xa53c8e){while(--_0xa53c8e){_0x5f2098['push'](_0x5f2098['shift']());}};_0x18af32(++_0x47308b);}(_0xa02e,0x1cc));var _0xea02=function(_0x2e048c,_0x33d402){_0x2e048c=_0x2e048c-0x0;var _0xc031f9=_0xa02e[_0x2e048c];return _0xc031f9;};'use strict';var _=require(_0xea02('0x0'));var rp=require(_0xea02('0x1'));var util=require(_0xea02('0x2'));var intUtil=require(_0xea02('0x3'));var md5=require('md5');var Redis=require(_0xea02('0x4'));var logger=require(_0xea02('0x5'))('dynamics365');var config=require('../../../../config/environment');config[_0xea02('0x6')]=_[_0xea02('0x7')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0xea02('0x8'))(new Redis(config[_0xea02('0x6')]));function getAuthToken(_0x5c129e,_0x4ec9c0,_0x5f3540){if(_0x5c129e[_0xea02('0x9')]){_0x5c129e['remoteUri']=_0x5c129e[_0xea02('0xa')][_0xea02('0xb')];_0x5c129e[_0xea02('0xc')]=_0x5c129e['CloudProvider']['data2'];return Promise[_0xea02('0xd')](_0x5c129e[_0xea02('0xa')]['data5']);}var _0x3d0f1e={'method':_0xea02('0xe'),'uri':_0x4ec9c0,'form':{'client_id':_0x5c129e['clientId'],'resource':_0x5c129e['remoteUri'],'username':_0x5c129e[_0xea02('0xf')],'password':_0x5c129e[_0xea02('0x10')],'grant_type':_0xea02('0x10'),'client_secret':_0x5c129e['clientSecret']},'json':!![]};return rp(_0x3d0f1e)['then'](function(_0x1ad8a3){return _0x1ad8a3[_0xea02('0x11')];})[_0xea02('0x12')](function(_0x1cd0da){logger[_0xea02('0x13')]('['+[_0x5f3540[_0xea02('0x14')]()]+']\x20Wrong\x20credentials!');return _0x1cd0da['message'];});}function getUser(_0x806d2e,_0x2c6808,_0x1d133b,_0x5723da,_0x578199,_0x592327){return new Promise(function(_0x4afdec,_0x4cd1e9){return getAuthToken(_0x2c6808,_0x5723da,_0x592327)[_0xea02('0x15')](function(_0x1f88be){var _0x111ac3={'method':_0xea02('0x16'),'uri':_0x578199+_0xea02('0x17'),'headers':{'Authorization':_0xea02('0x18')+_0x1f88be,'OData-Version':'4.0'},'json':!![]};return rp(_0x111ac3);})[_0xea02('0x15')](function(_0x458a85){var _0x201d7c=_0x458a85[_0xea02('0x19')];var _0x4c0536=![];var _0x79159a=null;if(!_[_0xea02('0x1a')](_0x1d133b)){if(intUtil[_0xea02('0x1b')](_0x1d133b['email'])){_0x806d2e[_0xea02('0x1c')]=_0x1d133b[_0xea02('0x1d')];for(_0x79159a=0x0;_0x79159a<_0x201d7c[_0xea02('0x1e')];_0x79159a++){if(_0x201d7c[_0x79159a][_0xea02('0x1f')]===_0x1d133b[_0xea02('0x1d')]&&!_0x201d7c[_0x79159a][_0xea02('0x20')]){_0x4c0536=!![];logger[_0xea02('0x21')]('['+[_0x592327[_0xea02('0x14')]()]+']\x20Agent\x20found\x20'+_0x201d7c[_0x79159a][_0xea02('0x22')]+'!');_0x806d2e[_0xea02('0x23')]=_0x201d7c[_0x79159a][_0xea02('0x22')];}}}}if(!_0x4c0536){logger[_0xea02('0x21')]('['+[_0x592327[_0xea02('0x14')]()]+_0xea02('0x24'));_0x806d2e[_0xea02('0x1c')]=_0x2c6808[_0xea02('0xf')];for(_0x79159a=0x0;_0x79159a<_0x201d7c[_0xea02('0x1e')];_0x79159a++){if(_0x201d7c[_0x79159a][_0xea02('0x1f')]===_0x2c6808[_0xea02('0xf')]){_0x806d2e[_0xea02('0x23')]=_0x201d7c[_0x79159a]['systemuserid'];}}}_0x4afdec(_0x806d2e);})[_0xea02('0x12')](function(_0x5abb86){_0x4cd1e9(_0x5abb86[_0xea02('0x25')]);});});}function createEndUser(_0x303f50,_0x27079b,_0x44140a,_0x899334,_0x5466ab,_0x2639a8,_0x49ce33){return new Promise(function(_0x2dfa57,_0x8eb6d6){return getAuthToken(_0x27079b,_0x44140a,_0x2639a8)[_0xea02('0x15')](function(_0xa0d159){var _0x12c3ac=_0x2639a8[_0xea02('0x26')]()===_0xea02('0x27')?_0x5466ab[_0xea02('0x28')]:_0x5466ab[_0xea02('0x29')];var _0x228b2c={'method':_0xea02('0xe'),'uri':_0x899334+_0xea02('0x2a'),'body':{'fullname':_0x12c3ac,'firstname':_0x12c3ac,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0xea02('0x2b')+_0x303f50['userId']+')'},'headers':{'Authorization':_0xea02('0x18')+_0xa0d159,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};_0x228b2c['body'][_0x49ce33]=_0x12c3ac;return rp(_0x228b2c);})[_0xea02('0x15')](function(_0x1760c2){var _0x56c0fa=_0x1760c2[_0xea02('0x2c')][_0xea02('0x2d')];var _0x574d65=_0x56c0fa[_0xea02('0x2e')](_0x56c0fa[_0xea02('0x2f')]('(')+0x1,_0x56c0fa[_0xea02('0x2f')](')'));_0x303f50[_0xea02('0x30')]=_0x574d65;_0x2dfa57(_0x303f50);})[_0xea02('0x12')](function(_0x3d0c7b){_0x8eb6d6(_0x3d0c7b['message']);});});}function getEndUser(_0x42bc61,_0x5aa4e1,_0x581c3a,_0x5bd6cc,_0x508989,_0x161438,_0x509017,_0x13d50e){var _0x6ef058=_0x161438[_0xea02('0x26')]()==='outbound'?_0x508989['destcalleridnum']:_0x508989[_0xea02('0x29')];return getAuthToken(_0x5aa4e1,_0x581c3a,_0x161438)['then'](function(_0x3a88c2){_0x13d50e=_0x13d50e?_0x13d50e:_0xea02('0x31');var _0x58e0b7={'method':'GET','uri':_0x5bd6cc+'contacts?$select='+_0x13d50e+_0xea02('0x32')+_0x13d50e+_0xea02('0x33')+_0x6ef058['replace']('+',_0xea02('0x34'))+'\x27','headers':{'Authorization':_0xea02('0x18')+_0x3a88c2,'If-None-Match':null,'OData-Version':_0xea02('0x35')},'json':!![]};return rp(_0x58e0b7);})[_0xea02('0x15')](function(_0x4c8c63){var _0x447955=![];if(!_0x4c8c63)return _0x447955;var _0x16ed3f=_0x4c8c63[_0xea02('0x19')];for(var _0x347c58=0x0;_0x347c58<_0x16ed3f[_0xea02('0x1e')];_0x347c58++){if(_0x16ed3f[_0x347c58][_0x13d50e]===_0x6ef058){_0x447955=!![];_0x42bc61[_0xea02('0x30')]=_0x16ed3f[_0x347c58]['contactid'];}}return _0x447955;})[_0xea02('0x15')](function(_0x51bda8){if(_0x51bda8)return _0x42bc61;if(_0x509017==='nothing'){logger[_0xea02('0x21')]('['+[_0x161438[_0xea02('0x14')]()]+_0xea02('0x36'));return _0x42bc61;}return createEndUser(_0x42bc61,_0x5aa4e1,_0x581c3a,_0x5bd6cc,_0x508989,_0x161438,_0x13d50e)[_0xea02('0x15')](function(_0x5f4cb9){logger[_0xea02('0x21')]('['+[_0x161438['toUpperCase']()]+_0xea02('0x37'),_0x5f4cb9[_0xea02('0x30')]);return _0x5f4cb9;});});}function getCustomFields(_0x53dc05,_0x584563,_0x347550){var _0x4cf2bb={};if(_0x53dc05[_0xea02('0x1e')]>0x0){_[_0xea02('0x38')](_0x53dc05,function(_0x7c0f14){if(_[_0xea02('0x39')]([_0xea02('0x3a'),'picklist'],_0x7c0f14[_0xea02('0x3b')])&&_0x7c0f14[_0xea02('0x3c')]&&!_0x7c0f14[_0xea02('0x3d')]){var _0x3cd239=_0x7c0f14[_0xea02('0x3e')][_0xea02('0x26')]();var _0x24c6b8=_0x3cd239[_0xea02('0x2e')](0x0,_0x3cd239[_0xea02('0x3f')]('_'));var _0x1a53f8=_0x3cd239[_0xea02('0x2e')](_0x3cd239[_0xea02('0x3f')]('_')+0x1);if(_0x24c6b8===_0x347550){_0x4cf2bb[_0x1a53f8]=_0x7c0f14[_0xea02('0x40')];}}});}return _0x4cf2bb;}function getTicket(_0x56cd99,_0x28d27a,_0x703570,_0x56fa3f,_0x281bee,_0x4dd8c2,_0x15d650){return new Promise(function(_0x155cb6,_0x41f4c3){var _0x5ddf01;return getAuthToken(_0x28d27a,_0x703570,_0x15d650)[_0xea02('0x15')](function(_0x2c072b){if(_0x4dd8c2['ticketType']==='incident'){_0x5ddf01={'method':_0xea02('0xe'),'uri':_0x56fa3f+_0xea02('0x41'),'body':Object[_0xea02('0x42')]({},{'title':intUtil[_0xea02('0x43')](_0x4dd8c2[_0xea02('0x44')],_0x281bee,'\x20'),'description':intUtil['getString'](_0x4dd8c2[_0xea02('0x45')],_0x281bee,'\x0a'),'customerid_contact@odata.bind':_0x56cd99[_0xea02('0x30')]?_0xea02('0x46')+_0x56cd99[_0xea02('0x30')]+')':undefined,'ownerid@odata.bind':_0xea02('0x2b')+_0x56cd99[_0xea02('0x23')]+')','caseorigincode':'1'},getCustomFields(_0x4dd8c2['Fields'],_0x281bee,_0x4dd8c2[_0xea02('0x47')])),'headers':{'Authorization':'Bearer\x20'+_0x2c072b,'OData-Version':_0xea02('0x35')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x4dd8c2[_0xea02('0x47')]===_0xea02('0x48')){var _0x2f48be=_0x56cd99['enduserId']?[{'partyid_systemuser@odata.bind':'/systemusers('+_0x56cd99[_0xea02('0x23')]+')','participationtypemask':_0x56cd99['callDirection']===_0xea02('0x49')?0x2:0x1},{'partyid_contact@odata.bind':_0xea02('0x46')+_0x56cd99[_0xea02('0x30')]+')','participationtypemask':_0x56cd99[_0xea02('0x4a')]===_0xea02('0x49')?0x1:0x2}]:[{'partyid_systemuser@odata.bind':_0xea02('0x2b')+_0x56cd99['userId']+')','participationtypemask':_0x56cd99['callDirection']==='queue'?0x2:0x1}];_0x5ddf01={'method':'POST','uri':_0x56fa3f+_0xea02('0x4b'),'body':Object['assign']({},{'subject':intUtil[_0xea02('0x43')](_0x4dd8c2[_0xea02('0x44')],_0x281bee,'\x20'),'phonenumber':String(_0x281bee[_0xea02('0x29')]),'description':intUtil[_0xea02('0x43')](_0x4dd8c2[_0xea02('0x45')],_0x281bee,'\x0a'),'regardingobjectid_contact@odata.bind':_0x56cd99['enduserId']?_0xea02('0x46')+_0x56cd99['enduserId']+')':undefined,'ownerid@odata.bind':'/systemusers('+_0x56cd99[_0xea02('0x23')]+')','directioncode':_0x56cd99['callDirection']===_0xea02('0x49')?![]:!![],'phonecall_activity_parties':_0x2f48be},getCustomFields(_0x4dd8c2['Fields'],_0x281bee,_0x4dd8c2[_0xea02('0x47')])),'headers':{'Authorization':_0xea02('0x18')+_0x2c072b,'OData-Version':_0xea02('0x35')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x5ddf01);})[_0xea02('0x15')](function(_0xe67807){var _0x40c285=_0xe67807[_0xea02('0x2c')][_0xea02('0x2d')];var _0x48a8cb=_0x40c285[_0xea02('0x2e')](_0x40c285[_0xea02('0x2f')]('(')+0x1,_0x40c285[_0xea02('0x2f')](')'));_0x56cd99[_0xea02('0x4c')]=_0x48a8cb;_0x155cb6(_0x56cd99);})[_0xea02('0x12')](function(_0x26d92a){_0x41f4c3(_0x26d92a[_0xea02('0x25')]);});});}function emit(_0x2be121,_0x357f84,_0x114a57,_0x28259c){var _0x2c5285={'uri':util[_0xea02('0x4d')](_0xea02('0x4e'),_0x2be121,_0x114a57,_0x28259c)};io['to'](util[_0xea02('0x4d')](_0xea02('0x4f'),_0x357f84))[_0xea02('0x50')](_0xea02('0x51'),_0x2c5285);}exports['cs']=function(_0x24edc4,_0x552900,_0x4968c6,_0x26b9b4,_0x35d287,_0x27c2c9,_0xaac720,_0x330279){var _0x35497c={};_0x27c2c9[_0xea02('0x52')]=_0x27c2c9[_0xea02('0x9')]?intUtil[_0xea02('0x53')](_0x27c2c9[_0xea02('0xa')][_0xea02('0xb')]):intUtil[_0xea02('0x53')](_0x27c2c9[_0xea02('0x52')]);_0x27c2c9['serverUrl']=intUtil[_0xea02('0x53')](_0x27c2c9[_0xea02('0x54')]);_0x35497c[_0xea02('0x4a')]=_0x330279===_0xea02('0x49')||_0x330279==='unmanaged'?_0xea02('0x49'):_0xea02('0x27');var _0x483a93=_0x27c2c9['modernAuthentication']?util[_0xea02('0x4d')]('%s/api/data/v9.0/',_0x27c2c9[_0xea02('0xa')]['data7']):util[_0xea02('0x4d')]('%s/api/data/v9.0/',_0x27c2c9[_0xea02('0x52')]);var _0x40f31a=util['format'](_0xea02('0x55'),_0x27c2c9['tenantId']);var _0x24a10a=util[_0xea02('0x4d')](_0xea02('0x56'),_0x27c2c9[_0xea02('0x54')],_0x552900[_0xea02('0x57')],md5(_0x552900[_0xea02('0x57')]));if(_0x35d287&&_0x35d287[_0xea02('0x58')]){logger['info'](_0xea02('0x59'),'Recording\x20is\x20enabled!');_0x552900[_0xea02('0x5a')]=_0x24a10a;}else if(_0xaac720&&_0xaac720[_0xea02('0x5b')]&&_0xaac720['recordingFormat']!==_0xea02('0x5c')){logger[_0xea02('0x21')](_0xea02('0x5d'),_0xea02('0x5e'));_0x552900[_0xea02('0x5a')]=_0x24a10a;}else{_0x552900['recordingURL']='';}return getUser(_0x35497c,_0x27c2c9,_0x26b9b4,_0x40f31a,_0x483a93,_0x330279)['then'](function(_0x4066ff){logger[_0xea02('0x21')]('['+_0x330279[_0xea02('0x14')]()+_0xea02('0x5f'),_0x4066ff[_0xea02('0x23')]);logger['info']('['+_0x330279['toUpperCase']()+']\x20The\x20User\x20email\x20is:',_0x4066ff[_0xea02('0x1c')]);return getEndUser(_0x4066ff,_0x27c2c9,_0x40f31a,_0x483a93,_0x552900,_0x330279,_0x4968c6[_0xea02('0x60')],_0x4968c6['additionalSearchContact']);})[_0xea02('0x15')](function(_0x4b9af3){logger[_0xea02('0x21')]('['+_0x330279[_0xea02('0x14')]()+_0xea02('0x61'),_0x4b9af3[_0xea02('0x30')]);logger[_0xea02('0x21')]('['+_0x330279['toUpperCase']()+_0xea02('0x62'),_0x552900[_0xea02('0x29')]);return getTicket(_0x4b9af3,_0x27c2c9,_0x40f31a,_0x483a93,_0x552900,_0x4968c6,_0x330279);})[_0xea02('0x15')](function(_0xbef7d6){logger[_0xea02('0x21')](util['format']('['+_0x330279['toUpperCase']()+']\x20The\x20%s\x20ID\x20is:\x20%s',_0x4968c6[_0xea02('0x47')],_0xbef7d6['ticketId']));logger[_0xea02('0x21')](util[_0xea02('0x4d')]('['+_0x330279[_0xea02('0x14')]()+_0xea02('0x63'),_0x330279));if(_0x330279!==_0xea02('0x64')&&_0x4968c6[_0xea02('0x65')]){logger[_0xea02('0x21')]('['+_0x330279['toUpperCase']()+']',_0xea02('0x66'));emit(_0x27c2c9[_0xea02('0x52')],_0x26b9b4['name'],_0x4968c6[_0xea02('0x47')],_0xbef7d6[_0xea02('0x4c')]);}})['catch'](function(_0x4ad0bd){logger[_0xea02('0x13')]('['+_0x330279[_0xea02('0x14')]()+_0xea02('0x67'),_0x4ad0bd['message']);console['error'](_0xea02('0x68'),_0x4ad0bd);});}; \ 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 336c8d0..e964de3 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 _0x188e=['customVariable','Variable','name','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','The\x20User\x20ID\x20is:','The\x20Enduser\x20ID\x20is:','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','user:%s','trigger:browser:url','%s/helpdesk/tickets/%d','error','stringify','recordingFormat','none','[OUTBOUND]','destcalleridnum','unmanaged','toUpperCase','catch','request-promise','md5','util','ioredis','./util','../../../../config/environment','../../../../config/logger','freshdesk','defaults','redis','localhost','socket.io-emitter','application/json','info','Creating\x20new\x20ticket...','merge','format','Caller\x20-\x20%s','calleridname','calleridnum','getString','Descriptions','Fields','custom_fields','mapValues','keyBy','value','%s/api/v2/tickets','remoteUri','POST','then','validateEmail','%s/api/v2/agents','length','Agent\x20found!','find','email','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','Admin\x20account\x20selected.','Searching\x20enduser\x20with\x20phone','%s/api/v2/contacts','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Enduser\x20created.','apiKey','toString','base64','debug','[HTTP]','GET','map','includes','string','picklist','type','nameField','customField','toLowerCase','content','idField','variableName','push'];(function(_0x2962d5,_0x38deda){var _0x273406=function(_0x3e0775){while(--_0x3e0775){_0x2962d5['push'](_0x2962d5['shift']());}};_0x273406(++_0x38deda);}(_0x188e,0xd7));var _0xe188=function(_0x1539fb,_0x5ccad4){_0x1539fb=_0x1539fb-0x0;var _0x221541=_0x188e[_0x1539fb];return _0x221541;};'use strict';var _=require('lodash');var rp=require(_0xe188('0x0'));var md5=require(_0xe188('0x1'));var util=require(_0xe188('0x2'));var Redis=require(_0xe188('0x3'));var intUtil=require(_0xe188('0x4'));var config=require(_0xe188('0x5'));var logger=require(_0xe188('0x6'))(_0xe188('0x7'));config['redis']=_[_0xe188('0x8')](config[_0xe188('0x9')],{'host':_0xe188('0xa'),'port':0x18eb});var io=require(_0xe188('0xb'))(new Redis(config['redis']));var headers={'Content-Type':_0xe188('0xc'),'Accept':_0xe188('0xc')};function emit(_0xa5550a,_0x36d382,_0x5c80b6){io['to'](_0xa5550a)['emit'](_0x36d382,_0x5c80b6);}function getTicket(_0x11f37f,_0x574bfe,_0x2ac0b7,_0xffada6,_0x48a7bc){logger[_0xe188('0xd')](_0xe188('0xe'));var _0x9eb044=_[_0xe188('0xf')]({'responder_id':_0x574bfe['id'],'requester_id':_0x2ac0b7['id'],'name':util[_0xe188('0x10')](_0xe188('0x11'),_0x48a7bc[_0xe188('0x12')]),'phone':_0x48a7bc[_0xe188('0x13')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil['getString'](_0xffada6['Subjects'],_0x48a7bc,'\x20'),'description':intUtil[_0xe188('0x14')](_0xffada6[_0xe188('0x15')],_0x48a7bc,'
'),'tags':getTags(_0xffada6['Tags'],'name')},getCustomFields(_0xffada6[_0xe188('0x16')],_0x48a7bc));_0x9eb044[_0xe188('0x17')]=_[_0xe188('0x18')](_[_0xe188('0x19')](_0x9eb044[_0xe188('0x17')],'id'),_0xe188('0x1a'));return request({'uri':util[_0xe188('0x10')](_0xe188('0x1b'),_0x11f37f[_0xe188('0x1c')]),'method':_0xe188('0x1d'),'body':_0x9eb044})[_0xe188('0x1e')](function(_0x49f424){logger[_0xe188('0xd')]('Ticket\x20created!');return _0x49f424;});}function getUser(_0x5a7294,_0x2c2489){if(intUtil[_0xe188('0x1f')](_0x2c2489)){return request({'uri':util['format'](_0xe188('0x20'),_0x5a7294[_0xe188('0x1c')]),'qs':{'email':_0x2c2489}})[_0xe188('0x1e')](function(_0x291892){if(_0x291892[_0xe188('0x21')]){logger[_0xe188('0xd')](_0xe188('0x22'));return _[_0xe188('0x23')](_0x291892,function(_0x37aa52){return _0x37aa52['contact'][_0xe188('0x24')]===_0x2c2489;});}else{logger[_0xe188('0xd')](_0xe188('0x25'));return request({'uri':util[_0xe188('0x10')](_0xe188('0x26'),_0x5a7294[_0xe188('0x1c')])})[_0xe188('0x1e')](function(_0x36d48f){logger['info']('Admin\x20account\x20selected.');return _0x36d48f;});}});}else{logger['info'](_0xe188('0x27'));return request({'uri':util[_0xe188('0x10')](_0xe188('0x26'),_0x5a7294[_0xe188('0x1c')])})[_0xe188('0x1e')](function(_0x537700){logger[_0xe188('0xd')](_0xe188('0x28'));return _0x537700;});}}function getEndUser(_0x2e5f25,_0x40c0f6,_0x44b67d){logger[_0xe188('0xd')](_0xe188('0x29'),_0x44b67d);return request({'uri':util[_0xe188('0x10')](_0xe188('0x2a'),_0x2e5f25['remoteUri']),'qs':{'phone':_0x44b67d}})[_0xe188('0x1e')](function(_0x3f6cce){if(_0x3f6cce[_0xe188('0x21')]){logger[_0xe188('0xd')](_0xe188('0x2b'));return _['find'](_0x3f6cce,{'phone':_0x44b67d});}else{logger[_0xe188('0xd')](_0xe188('0x2c'));return request({'uri':util[_0xe188('0x10')](_0xe188('0x2a'),_0x2e5f25[_0xe188('0x1c')]),'method':_0xe188('0x1d'),'body':{'name':_0x40c0f6,'phone':_0x44b67d}})['then'](function(_0x5ec030){logger['info'](_0xe188('0x2d'));return _0x5ec030;});}});}function getAuth(_0x25b9d7){return util[_0xe188('0x10')]('Basic\x20%s',new Buffer(_0x25b9d7[_0xe188('0x2e')]+':X')[_0xe188('0x2f')](_0xe188('0x30')));}function request(_0x5cdacb){logger[_0xe188('0x31')](_0xe188('0x32'),JSON['stringify'](_0x5cdacb));return rp(_['defaults'](_0x5cdacb,{'method':_0xe188('0x33'),'headers':headers,'json':!![]}));}function getTags(_0x5d6903,_0x51c4be){var _0x21ca9b=[];if(_0x5d6903&&_0x5d6903[_0xe188('0x21')]>0x0){_0x21ca9b=_[_0xe188('0x34')](_0x5d6903,_0x51c4be);}return _0x21ca9b;}function getCustomFields(_0x24c72b,_0x118fe7){var _0x1b41bc=[];var _0x4b3007={'custom_fields':[]};if(_0x24c72b[_0xe188('0x21')]>0x0){_['forEach'](_0x24c72b,function(_0x49e82d){if(_[_0xe188('0x35')]([_0xe188('0x36'),_0xe188('0x37')],_0x49e82d[_0xe188('0x38')])&&_0x49e82d[_0xe188('0x39')]&&!_0x49e82d[_0xe188('0x3a')]){_0x4b3007[_0x49e82d[_0xe188('0x39')][_0xe188('0x3b')]()]=_0x49e82d[_0xe188('0x3c')][_0xe188('0x2f')]();}else if(_[_0xe188('0x35')]([_0xe188('0x36'),_0xe188('0x37')],_0x49e82d[_0xe188('0x38')])&&_0x49e82d[_0xe188('0x3d')]&&_0x49e82d['customField']){_0x4b3007[_0xe188('0x17')]['push']({'id':_0x49e82d['idField'],'value':_0x49e82d[_0xe188('0x3c')][_0xe188('0x2f')]()});}else if(_0x49e82d[_0xe188('0x38')]==='variable'&&_0x49e82d[_0xe188('0x3e')]&&_0x49e82d[_0xe188('0x3d')]&&_0x49e82d['customField']){_0x118fe7[_0x49e82d[_0xe188('0x3e')]]&&_0x4b3007[_0xe188('0x17')][_0xe188('0x3f')]({'id':_0x49e82d['idField'],'value':_0x118fe7[_0x49e82d[_0xe188('0x3e')]][_0xe188('0x2f')]()});}else if(_0x49e82d[_0xe188('0x38')]===_0xe188('0x40')&&_0x49e82d['Variable']&&_0x49e82d[_0xe188('0x41')][_0xe188('0x42')]&&_0x49e82d['idField']&&_0x49e82d[_0xe188('0x3a')]){_0x118fe7[_0x49e82d['Variable'][_0xe188('0x42')][_0xe188('0x3b')]()]&&_0x4b3007[_0xe188('0x17')][_0xe188('0x3f')]({'id':_0x49e82d['idField'],'value':_0x118fe7[_0x49e82d[_0xe188('0x41')][_0xe188('0x42')][_0xe188('0x3b')]()][_0xe188('0x2f')]()});}});}return _0x4b3007;}exports[_0xe188('0x43')]=function(_0x4533c5,_0x38c5d9,_0x1cc1bb,_0x1dee6d,_0x23c09a,_0x37d2f5){var _0x291af9,_0x25c64d;_0x37d2f5['remoteUri']=intUtil[_0xe188('0x44')](_0x37d2f5['remoteUri']);_0x37d2f5[_0xe188('0x45')]=intUtil[_0xe188('0x44')](_0x37d2f5['serverUrl']);if(_0x23c09a&&_0x23c09a[_0xe188('0x46')]){logger[_0xe188('0xd')](_0xe188('0x47'),_0xe188('0x48'));_0x38c5d9[_0xe188('0x49')]=util[_0xe188('0x10')](_0xe188('0x4a'),_0x37d2f5[_0xe188('0x45')],_0x38c5d9[_0xe188('0x4b')],md5(_0x38c5d9[_0xe188('0x4b')]));}else{_0x38c5d9[_0xe188('0x49')]='';}headers[_0xe188('0x4c')]=getAuth(_0x37d2f5);return getUser(_0x37d2f5,_0x1dee6d[_0xe188('0x24')])[_0xe188('0x1e')](function(_0x588228){_0x291af9=_0x588228;logger['info'](_0xe188('0x4d'),_0x291af9['id']);return getEndUser(_0x37d2f5,_0x38c5d9[_0xe188('0x12')],_0x38c5d9[_0xe188('0x13')]);})[_0xe188('0x1e')](function(_0x3a4466){_0x25c64d=_0x3a4466;logger[_0xe188('0xd')](_0xe188('0x4e'),_0x25c64d['id']);return getTicket(_0x37d2f5,_0x291af9,_0x25c64d,_0x1cc1bb,_0x38c5d9);})[_0xe188('0x1e')](function(_0x2f478e){if(_0x2f478e&&_0x2f478e['id']){logger['info'](_0xe188('0x4f'));logger['info'](_0xe188('0x50'),_0x2f478e['id']);logger[_0xe188('0xd')](_0xe188('0x47'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format'](_0xe188('0x51'),_0x1dee6d['name']),_0xe188('0x52'),{'uri':util[_0xe188('0x10')](_0xe188('0x53'),_0x37d2f5[_0xe188('0x1c')],_0x2f478e['id'])});}})['catch'](function(_0x44d469){logger[_0xe188('0x54')](_0xe188('0x47'),JSON[_0xe188('0x55')](_0x44d469));});};exports['outbound']=function(_0x14c01a,_0x573fb7,_0x197a22,_0x47ead3,_0xec08a1,_0x41f258,_0x1c0c61){var _0x48ba67,_0x430807;_0x41f258['remoteUri']=intUtil[_0xe188('0x44')](_0x41f258[_0xe188('0x1c')]);_0x41f258[_0xe188('0x45')]=intUtil[_0xe188('0x44')](_0x41f258[_0xe188('0x45')]);if(_0x1c0c61&&_0x1c0c61['recordingFormat']&&_0x1c0c61[_0xe188('0x56')]!==_0xe188('0x57')){logger[_0xe188('0xd')](_0xe188('0x58'),_0xe188('0x48'));_0x573fb7[_0xe188('0x49')]=util['format'](_0xe188('0x4a'),_0x41f258[_0xe188('0x45')],_0x573fb7[_0xe188('0x4b')],md5(_0x573fb7[_0xe188('0x4b')]));}headers[_0xe188('0x4c')]=getAuth(_0x41f258);return getUser(_0x41f258,_0x47ead3[_0xe188('0x24')])['then'](function(_0x587c52){_0x48ba67=_0x587c52;logger[_0xe188('0xd')](_0xe188('0x4d'),_0x48ba67['id']);return getEndUser(_0x41f258,_0x573fb7['destcalleridname'],_0x573fb7[_0xe188('0x59')]);})[_0xe188('0x1e')](function(_0x5cf842){_0x430807=_0x5cf842;logger[_0xe188('0xd')](_0xe188('0x4e'),_0x430807['id']);return getTicket(_0x41f258,_0x48ba67,_0x430807,_0x197a22,_0x573fb7);})[_0xe188('0x1e')](function(_0x19f1fe){if(_0x19f1fe&&_0x19f1fe['id']){logger[_0xe188('0xd')](_0xe188('0x4f'));logger[_0xe188('0xd')]('The\x20Ticket\x20ID\x20is:',_0x19f1fe['id']);logger[_0xe188('0xd')]('[OUTBOUND]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xe188('0x10')](_0xe188('0x51'),_0x47ead3[_0xe188('0x42')]),'trigger:browser:url',{'uri':util['format'](_0xe188('0x53'),_0x41f258['remoteUri'],_0x19f1fe['id'])});}})['catch'](function(_0x209d7c){logger[_0xe188('0x54')]('[OUTBOUND]',JSON[_0xe188('0x55')](_0x209d7c));});};exports[_0xe188('0x5a')]=function(_0x5e0c70,_0x3348e1,_0x31feeb,_0x1334b3,_0x53965f,_0x41c6f1){var _0x214fe8,_0x55108e;_0x41c6f1['remoteUri']=intUtil[_0xe188('0x44')](_0x41c6f1[_0xe188('0x1c')]);_0x41c6f1[_0xe188('0x45')]=intUtil['stripTrailingSlash'](_0x41c6f1[_0xe188('0x45')]);if(_0x53965f&&_0x53965f[_0xe188('0x46')]){logger[_0xe188('0xd')]('['+_0x3348e1['lastevent'][_0xe188('0x5b')]()+']',_0xe188('0x48'));_0x3348e1[_0xe188('0x49')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x41c6f1[_0xe188('0x45')],_0x3348e1[_0xe188('0x4b')],md5(_0x3348e1[_0xe188('0x4b')]));}else{_0x3348e1[_0xe188('0x49')]='';}headers[_0xe188('0x4c')]=getAuth(_0x41c6f1);return getUser(_0x41c6f1,'')[_0xe188('0x1e')](function(_0x402202){_0x214fe8=_0x402202;logger[_0xe188('0xd')]('The\x20User\x20ID\x20is:',_0x214fe8['id']);return getEndUser(_0x41c6f1,_0x3348e1[_0xe188('0x12')],_0x3348e1[_0xe188('0x13')]);})[_0xe188('0x1e')](function(_0xca9013){_0x55108e=_0xca9013;logger[_0xe188('0xd')](_0xe188('0x4e'),_0x55108e['id']);return getTicket(_0x41c6f1,_0x214fe8,_0x55108e,_0x31feeb,_0x3348e1);})[_0xe188('0x1e')](function(_0x2df196){if(_0x2df196){logger['info']('Ticket\x20created!');logger['info'](_0xe188('0x50'),_0x2df196['id']);}})[_0xe188('0x5c')](function(_0x1556ce){logger[_0xe188('0x54')]('['+_0x3348e1['lastevent']['toUpperCase']()+']',JSON['stringify'](_0x1556ce));});}; \ No newline at end of file +var _0x05ee=['Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','Admin\x20account\x20selected.','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','%s/api/v2/contacts','length','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Enduser\x20created.','Basic\x20%s','toString','base64','debug','[HTTP]','stringify','GET','map','forEach','type','nameField','toLowerCase','content','includes','string','picklist','idField','customField','variable','variableName','push','Variable','name','stripTrailingSlash','monitor_format','Recording\x20is\x20enabled!','recordingURL','uniqueid','Authorization','The\x20User\x20ID\x20is:','[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','catch','error','outbound','serverUrl','none','[OUTBOUND]','destcalleridname','destcalleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','%s/helpdesk/tickets/%d','lastevent','toUpperCase','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','md5','util','./util','../../../../config/environment','../../../../config/logger','redis','defaults','localhost','socket.io-emitter','application/json','emit','info','merge','format','Caller\x20-\x20%s','calleridname','calleridnum','getString','Subjects','
','Fields','custom_fields','mapValues','keyBy','value','%s/api/v2/tickets','POST','then','Ticket\x20created!','validateEmail','remoteUri','Agent\x20found!','find','email'];(function(_0x561771,_0x554760){var _0x54d16e=function(_0x381c1f){while(--_0x381c1f){_0x561771['push'](_0x561771['shift']());}};_0x54d16e(++_0x554760);}(_0x05ee,0x146));var _0xe05e=function(_0x28407a,_0x2a7269){_0x28407a=_0x28407a-0x0;var _0x8bd6ef=_0x05ee[_0x28407a];return _0x8bd6ef;};'use strict';var _=require('lodash');var rp=require('request-promise');var md5=require(_0xe05e('0x0'));var util=require(_0xe05e('0x1'));var Redis=require('ioredis');var intUtil=require(_0xe05e('0x2'));var config=require(_0xe05e('0x3'));var logger=require(_0xe05e('0x4'))('freshdesk');config[_0xe05e('0x5')]=_[_0xe05e('0x6')](config[_0xe05e('0x5')],{'host':_0xe05e('0x7'),'port':0x18eb});var io=require(_0xe05e('0x8'))(new Redis(config[_0xe05e('0x5')]));var headers={'Content-Type':_0xe05e('0x9'),'Accept':_0xe05e('0x9')};function emit(_0xa4cf9,_0xb7430a,_0x272076){io['to'](_0xa4cf9)[_0xe05e('0xa')](_0xb7430a,_0x272076);}function getTicket(_0xe4525c,_0x3e4fc9,_0x39fc9f,_0x48a866,_0xf34897){logger[_0xe05e('0xb')]('Creating\x20new\x20ticket...');var _0x5f27b7=_[_0xe05e('0xc')]({'responder_id':_0x3e4fc9['id'],'requester_id':_0x39fc9f['id'],'name':util[_0xe05e('0xd')](_0xe05e('0xe'),_0xf34897[_0xe05e('0xf')]),'phone':_0xf34897[_0xe05e('0x10')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0xe05e('0x11')](_0x48a866[_0xe05e('0x12')],_0xf34897,'\x20'),'description':intUtil[_0xe05e('0x11')](_0x48a866['Descriptions'],_0xf34897,_0xe05e('0x13')),'tags':getTags(_0x48a866['Tags'],'name')},getCustomFields(_0x48a866[_0xe05e('0x14')],_0xf34897));_0x5f27b7[_0xe05e('0x15')]=_[_0xe05e('0x16')](_[_0xe05e('0x17')](_0x5f27b7[_0xe05e('0x15')],'id'),_0xe05e('0x18'));return request({'uri':util[_0xe05e('0xd')](_0xe05e('0x19'),_0xe4525c['remoteUri']),'method':_0xe05e('0x1a'),'body':_0x5f27b7})[_0xe05e('0x1b')](function(_0x24b69c){logger['info'](_0xe05e('0x1c'));return _0x24b69c;});}function getUser(_0x3446a0,_0x53383d){if(intUtil[_0xe05e('0x1d')](_0x53383d)){return request({'uri':util[_0xe05e('0xd')]('%s/api/v2/agents',_0x3446a0[_0xe05e('0x1e')]),'qs':{'email':_0x53383d}})[_0xe05e('0x1b')](function(_0x53ad91){if(_0x53ad91['length']){logger['info'](_0xe05e('0x1f'));return _[_0xe05e('0x20')](_0x53ad91,function(_0x4be746){return _0x4be746['contact'][_0xe05e('0x21')]===_0x53383d;});}else{logger['info'](_0xe05e('0x22'));return request({'uri':util['format']('%s/api/v2/agents/me',_0x3446a0[_0xe05e('0x1e')])})[_0xe05e('0x1b')](function(_0x158236){logger['info'](_0xe05e('0x23'));return _0x158236;});}});}else{logger[_0xe05e('0xb')](_0xe05e('0x24'));return request({'uri':util[_0xe05e('0xd')](_0xe05e('0x25'),_0x3446a0[_0xe05e('0x1e')])})[_0xe05e('0x1b')](function(_0x247cc7){logger['info'](_0xe05e('0x23'));return _0x247cc7;});}}function getEndUser(_0xbe91e9,_0x30cee2,_0x48e72a){logger[_0xe05e('0xb')]('Searching\x20enduser\x20with\x20phone',_0x48e72a);return request({'uri':util['format'](_0xe05e('0x26'),_0xbe91e9[_0xe05e('0x1e')]),'qs':{'phone':_0x48e72a}})['then'](function(_0x42570c){if(_0x42570c[_0xe05e('0x27')]){logger[_0xe05e('0xb')](_0xe05e('0x28'));return _['find'](_0x42570c,{'phone':_0x48e72a});}else{logger[_0xe05e('0xb')](_0xe05e('0x29'));return request({'uri':util[_0xe05e('0xd')](_0xe05e('0x26'),_0xbe91e9[_0xe05e('0x1e')]),'method':_0xe05e('0x1a'),'body':{'name':_0x30cee2,'phone':_0x48e72a}})[_0xe05e('0x1b')](function(_0x2dd7eb){logger[_0xe05e('0xb')](_0xe05e('0x2a'));return _0x2dd7eb;});}});}function getAuth(_0x5bfafa){return util['format'](_0xe05e('0x2b'),new Buffer(_0x5bfafa['apiKey']+':X')[_0xe05e('0x2c')](_0xe05e('0x2d')));}function request(_0x35313f){logger[_0xe05e('0x2e')](_0xe05e('0x2f'),JSON[_0xe05e('0x30')](_0x35313f));return rp(_['defaults'](_0x35313f,{'method':_0xe05e('0x31'),'headers':headers,'json':!![]}));}function getTags(_0x203d55,_0x44dd8f){var _0xb0ef53=[];if(_0x203d55&&_0x203d55['length']>0x0){_0xb0ef53=_[_0xe05e('0x32')](_0x203d55,_0x44dd8f);}return _0xb0ef53;}function getCustomFields(_0x29f50d,_0x4c5798){var _0x44731f=[];var _0x5275ff={'custom_fields':[]};if(_0x29f50d['length']>0x0){_[_0xe05e('0x33')](_0x29f50d,function(_0x5945a8){if(_['includes'](['string','picklist'],_0x5945a8[_0xe05e('0x34')])&&_0x5945a8[_0xe05e('0x35')]&&!_0x5945a8['customField']){_0x5275ff[_0x5945a8[_0xe05e('0x35')][_0xe05e('0x36')]()]=_0x5945a8[_0xe05e('0x37')][_0xe05e('0x2c')]();}else if(_[_0xe05e('0x38')]([_0xe05e('0x39'),_0xe05e('0x3a')],_0x5945a8[_0xe05e('0x34')])&&_0x5945a8[_0xe05e('0x3b')]&&_0x5945a8[_0xe05e('0x3c')]){_0x5275ff['custom_fields']['push']({'id':_0x5945a8[_0xe05e('0x3b')],'value':_0x5945a8[_0xe05e('0x37')][_0xe05e('0x2c')]()});}else if(_0x5945a8['type']===_0xe05e('0x3d')&&_0x5945a8['variableName']&&_0x5945a8[_0xe05e('0x3b')]&&_0x5945a8[_0xe05e('0x3c')]){_0x4c5798[_0x5945a8[_0xe05e('0x3e')]]&&_0x5275ff[_0xe05e('0x15')][_0xe05e('0x3f')]({'id':_0x5945a8[_0xe05e('0x3b')],'value':_0x4c5798[_0x5945a8[_0xe05e('0x3e')]][_0xe05e('0x2c')]()});}else if(_0x5945a8[_0xe05e('0x34')]==='customVariable'&&_0x5945a8[_0xe05e('0x40')]&&_0x5945a8['Variable'][_0xe05e('0x41')]&&_0x5945a8[_0xe05e('0x3b')]&&_0x5945a8[_0xe05e('0x3c')]){_0x4c5798[_0x5945a8[_0xe05e('0x40')]['name'][_0xe05e('0x36')]()]&&_0x5275ff[_0xe05e('0x15')][_0xe05e('0x3f')]({'id':_0x5945a8[_0xe05e('0x3b')],'value':_0x4c5798[_0x5945a8[_0xe05e('0x40')]['name'][_0xe05e('0x36')]()]['toString']()});}});}return _0x5275ff;}exports['queue']=function(_0x5d793d,_0x352575,_0x519198,_0x1e0a47,_0x2f46fc,_0x3eb60f){var _0x4281af,_0x407ce4;_0x3eb60f[_0xe05e('0x1e')]=intUtil[_0xe05e('0x42')](_0x3eb60f[_0xe05e('0x1e')]);_0x3eb60f['serverUrl']=intUtil[_0xe05e('0x42')](_0x3eb60f['serverUrl']);if(_0x2f46fc&&_0x2f46fc[_0xe05e('0x43')]){logger[_0xe05e('0xb')]('[QUEUE]',_0xe05e('0x44'));_0x352575[_0xe05e('0x45')]=util[_0xe05e('0xd')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x3eb60f['serverUrl'],_0x352575[_0xe05e('0x46')],md5(_0x352575['uniqueid']));}else{_0x352575[_0xe05e('0x45')]='';}headers[_0xe05e('0x47')]=getAuth(_0x3eb60f);return getUser(_0x3eb60f,_0x1e0a47['email'])[_0xe05e('0x1b')](function(_0x2eb0f1){_0x4281af=_0x2eb0f1;logger[_0xe05e('0xb')](_0xe05e('0x48'),_0x4281af['id']);return getEndUser(_0x3eb60f,_0x352575[_0xe05e('0xf')],_0x352575[_0xe05e('0x10')]);})[_0xe05e('0x1b')](function(_0x19d559){_0x407ce4=_0x19d559;logger[_0xe05e('0xb')]('The\x20Enduser\x20ID\x20is:',_0x407ce4['id']);return getTicket(_0x3eb60f,_0x4281af,_0x407ce4,_0x519198,_0x352575);})['then'](function(_0x3757dc){if(_0x3757dc&&_0x3757dc['id']){logger[_0xe05e('0xb')](_0xe05e('0x1c'));logger['info']('The\x20Ticket\x20ID\x20is:',_0x3757dc['id']);logger[_0xe05e('0xb')](_0xe05e('0x49'),_0xe05e('0x4a'));emit(util[_0xe05e('0xd')]('user:%s',_0x1e0a47[_0xe05e('0x41')]),_0xe05e('0x4b'),{'uri':util[_0xe05e('0xd')]('%s/helpdesk/tickets/%d',_0x3eb60f[_0xe05e('0x1e')],_0x3757dc['id'])});}})[_0xe05e('0x4c')](function(_0x3e6ee8){logger[_0xe05e('0x4d')](_0xe05e('0x49'),JSON['stringify'](_0x3e6ee8));});};exports[_0xe05e('0x4e')]=function(_0x1ad627,_0x2dd126,_0x20cc89,_0x5c7fd4,_0x43abdf,_0x4bd836,_0x1ceb80){var _0x2a5c91,_0x3b1a5e;_0x4bd836[_0xe05e('0x1e')]=intUtil[_0xe05e('0x42')](_0x4bd836[_0xe05e('0x1e')]);_0x4bd836['serverUrl']=intUtil['stripTrailingSlash'](_0x4bd836[_0xe05e('0x4f')]);if(_0x1ceb80&&_0x1ceb80['recordingFormat']&&_0x1ceb80['recordingFormat']!==_0xe05e('0x50')){logger[_0xe05e('0xb')](_0xe05e('0x51'),'Recording\x20is\x20enabled!');_0x2dd126['recordingURL']=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4bd836['serverUrl'],_0x2dd126[_0xe05e('0x46')],md5(_0x2dd126[_0xe05e('0x46')]));}headers[_0xe05e('0x47')]=getAuth(_0x4bd836);return getUser(_0x4bd836,_0x5c7fd4[_0xe05e('0x21')])[_0xe05e('0x1b')](function(_0x692878){_0x2a5c91=_0x692878;logger[_0xe05e('0xb')](_0xe05e('0x48'),_0x2a5c91['id']);return getEndUser(_0x4bd836,_0x2dd126[_0xe05e('0x52')],_0x2dd126[_0xe05e('0x53')]);})[_0xe05e('0x1b')](function(_0x535768){_0x3b1a5e=_0x535768;logger['info'](_0xe05e('0x54'),_0x3b1a5e['id']);return getTicket(_0x4bd836,_0x2a5c91,_0x3b1a5e,_0x20cc89,_0x2dd126);})['then'](function(_0x5ea912){if(_0x5ea912&&_0x5ea912['id']){logger[_0xe05e('0xb')](_0xe05e('0x1c'));logger[_0xe05e('0xb')](_0xe05e('0x55'),_0x5ea912['id']);logger[_0xe05e('0xb')](_0xe05e('0x51'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format']('user:%s',_0x5c7fd4[_0xe05e('0x41')]),'trigger:browser:url',{'uri':util[_0xe05e('0xd')](_0xe05e('0x56'),_0x4bd836[_0xe05e('0x1e')],_0x5ea912['id'])});}})[_0xe05e('0x4c')](function(_0x52ecd2){logger[_0xe05e('0x4d')](_0xe05e('0x51'),JSON[_0xe05e('0x30')](_0x52ecd2));});};exports['unmanaged']=function(_0x1ca44f,_0x44f3a,_0x2c3b4f,_0x481a82,_0x150f6e,_0x388531){var _0x37b349,_0x3ad1c7;_0x388531['remoteUri']=intUtil[_0xe05e('0x42')](_0x388531[_0xe05e('0x1e')]);_0x388531[_0xe05e('0x4f')]=intUtil[_0xe05e('0x42')](_0x388531[_0xe05e('0x4f')]);if(_0x150f6e&&_0x150f6e[_0xe05e('0x43')]){logger['info']('['+_0x44f3a[_0xe05e('0x57')][_0xe05e('0x58')]()+']','Recording\x20is\x20enabled!');_0x44f3a[_0xe05e('0x45')]=util[_0xe05e('0xd')](_0xe05e('0x59'),_0x388531['serverUrl'],_0x44f3a[_0xe05e('0x46')],md5(_0x44f3a[_0xe05e('0x46')]));}else{_0x44f3a['recordingURL']='';}headers[_0xe05e('0x47')]=getAuth(_0x388531);return getUser(_0x388531,'')['then'](function(_0x3c4f91){_0x37b349=_0x3c4f91;logger[_0xe05e('0xb')](_0xe05e('0x48'),_0x37b349['id']);return getEndUser(_0x388531,_0x44f3a[_0xe05e('0xf')],_0x44f3a['calleridnum']);})[_0xe05e('0x1b')](function(_0x4400e2){_0x3ad1c7=_0x4400e2;logger[_0xe05e('0xb')]('The\x20Enduser\x20ID\x20is:',_0x3ad1c7['id']);return getTicket(_0x388531,_0x37b349,_0x3ad1c7,_0x2c3b4f,_0x44f3a);})[_0xe05e('0x1b')](function(_0x1e908b){if(_0x1e908b){logger[_0xe05e('0xb')]('Ticket\x20created!');logger[_0xe05e('0xb')](_0xe05e('0x55'),_0x1e908b['id']);}})[_0xe05e('0x4c')](function(_0xd50d5d){logger[_0xe05e('0x4d')]('['+_0x44f3a[_0xe05e('0x57')][_0xe05e('0x58')]()+']',JSON[_0xe05e('0x30')](_0xd50d5d));});}; \ 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 3c7d2c3..d9cfcb0 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 _0x42c8=['monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s','Displaying\x20task\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Freshsales\x20integration','inspect','lodash','request-promise','md5','util','moment','bluebird','ioredis','../../../../config/logger','freshsales','redis','defaults','socket.io-emitter','GET','/api/selector/owners','headers','info','Getting\x20admin\x20information','then','users','length','email','adminId','Requested\x20Resource\x20not\x20Found','catch','toUpperCase','message','agentEmail','Getting\x20user\x20with\x20email','userEmail','userId','Admin\x20selected','adminEmail','error','/api/lookup?q=','&f=','&entities=contact','contacts','format','contactNumber','mobile_number','endUserId','Contact\x20found\x20mobile_number:','work_number','Contact\x20found\x20work_number:','Contact\x20created:','POST','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','contact','Creating\x20new\x20task','/api/tasks','getString','Descriptions','YYYY-MM-DDTHH:mm:ss','ticketId','task','/contacts/','user:%s','emit','trigger:browser:url','Token\x20token=','apiKey','stripTrailingSlash','remoteUri','serverUrl','outbound','destcalleridnum','calleridnum','queue','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid'];(function(_0x1a9e78,_0x180720){var _0x113e06=function(_0x229c64){while(--_0x229c64){_0x1a9e78['push'](_0x1a9e78['shift']());}};_0x113e06(++_0x180720);}(_0x42c8,0x105));var _0x842c=function(_0x328ac9,_0x2f7225){_0x328ac9=_0x328ac9-0x0;var _0x2b3a0a=_0x42c8[_0x328ac9];return _0x2b3a0a;};'use strict';var _=require(_0x842c('0x0'));var rp=require(_0x842c('0x1'));var md5=require(_0x842c('0x2'));var util=require(_0x842c('0x3'));var moment=require(_0x842c('0x4'));var Promise=require(_0x842c('0x5'));var Redis=require(_0x842c('0x6'));var intUtil=require('./util');var config=require('../../../../config/environment');var logger=require(_0x842c('0x7'))(_0x842c('0x8'));config[_0x842c('0x9')]=_[_0x842c('0xa')](config[_0x842c('0x9')],{'host':'localhost','port':0x18eb});var io=require(_0x842c('0xb'))(new Redis(config[_0x842c('0x9')]));function getAdminId(_0x258665,_0x117207,_0x298108,_0x12a1ff){return new Promise(function(_0x44f4c3,_0x5502b0){var _0x478f91=![];var _0x370b41={'method':_0x842c('0xc'),'uri':_0x12a1ff+_0x842c('0xd'),'json':!![]};_0x370b41[_0x842c('0xe')]=_0x298108;logger[_0x842c('0xf')](_0x842c('0x10'));return rp(_0x370b41)[_0x842c('0x11')](function(_0x5c7f87){if(_0x5c7f87){var _0x5bdc14=_0x5c7f87[_0x842c('0x12')];var _0x267127=null;for(_0x267127=0x0;_0x267127<_0x5bdc14[_0x842c('0x13')];_0x267127++){if(_0x5bdc14[_0x267127][_0x842c('0x14')]===_0x258665['adminEmail']){_0x258665[_0x842c('0x15')]=_0x5bdc14[_0x267127]['id'];_0x478f91=!![];}}if(_0x478f91){logger[_0x842c('0xf')]('Admin\x20found:',_0x258665[_0x842c('0x15')]);_0x44f4c3(_0x258665);}else{_0x5502b0({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}else{_0x5502b0({'statusCode':0x194,'message':_0x842c('0x16')});}})[_0x842c('0x17')](function(_0x1f02b2){logger['error']('['+[_0x117207[_0x842c('0x18')]()]+']',_0x1f02b2[_0x842c('0x19')]);_0x5502b0(_0x1f02b2);});});}function getUser(_0x5d8c66,_0x1e3120,_0x1a5165){return function(_0x10b4eb){return new Promise(function(_0x374852,_0x4cde89){var _0x2da3bb={'method':_0x842c('0xc'),'uri':_0x1a5165+'/api/selector/owners','json':!![]};_0x2da3bb[_0x842c('0xe')]=_0x1e3120;logger[_0x842c('0xf')]('Getting\x20user\x20list');return rp(_0x2da3bb)[_0x842c('0x11')](function(_0x57facb){if(_0x57facb){var _0x1b97a4=_0x57facb[_0x842c('0x12')];var _0x5e6567=![];var _0x57485c=null;if(_0x10b4eb[_0x842c('0x1a')]!==null){logger[_0x842c('0xf')](_0x842c('0x1b'),_0x10b4eb['agentEmail']);_0x10b4eb[_0x842c('0x1c')]=_0x10b4eb[_0x842c('0x1a')];for(_0x57485c=0x0;_0x57485c<_0x1b97a4['length'];_0x57485c++){if(_0x1b97a4[_0x57485c][_0x842c('0x14')]===_0x10b4eb['agentEmail']){_0x5e6567=!![];_0x10b4eb[_0x842c('0x1d')]=_0x1b97a4[_0x57485c]['id'];logger[_0x842c('0xf')]('User\x20found:',_0x10b4eb[_0x842c('0x1d')]);}}}if(!_0x5e6567){logger[_0x842c('0xf')](_0x842c('0x1e'));_0x10b4eb[_0x842c('0x1c')]=_0x10b4eb[_0x842c('0x1f')];_0x10b4eb[_0x842c('0x1d')]=_0x10b4eb[_0x842c('0x15')];_0x5e6567=!![];}if(_0x5e6567){_0x374852(_0x10b4eb);}else{_0x4cde89({'statusCode':0x194,'message':_0x842c('0x16')});}}else{_0x4cde89({'statusCode':0x194,'message':_0x842c('0x16')});}})[_0x842c('0x17')](function(_0x410e8a){logger[_0x842c('0x20')]('['+[_0x5d8c66[_0x842c('0x18')]()]+']',_0x410e8a[_0x842c('0x19')]);_0x4cde89(_0x410e8a);});});};}function searchContact(_0x11d2b2,_0x4b7fbf,_0x36987c,_0x22e540){return new Promise(function(_0xc31d32,_0x33745a){var _0x33549f={'method':_0x842c('0xc'),'headers':_0x4b7fbf,'uri':_0x11d2b2+_0x842c('0x21')+_0x22e540+_0x842c('0x22')+_0x36987c+_0x842c('0x23'),'json':!![]};rp(_0x33549f)['then'](function(_0x3892f2){var _0x1d3243=_['find'](_0x3892f2[_0x842c('0x24')][_0x842c('0x24')],[_0x36987c,_0x22e540]);_0xc31d32(_0x1d3243);})[_0x842c('0x17')](function(_0x10539a){_0x33745a(_0x10539a);});});}function getEndUser(_0x26c0c2,_0x259acc,_0x14f89b){return function(_0x2c6b0c){return new Promise(function(_0x8cb3e5,_0x2dfbde){logger[_0x842c('0xf')](util[_0x842c('0x25')]('Searching\x20contact\x20with\x20phone\x20%s',_0x2c6b0c[_0x842c('0x26')]));searchContact(_0x14f89b,_0x259acc,_0x842c('0x27'),_0x2c6b0c[_0x842c('0x26')])[_0x842c('0x11')](function(_0x189eb0){if(_0x189eb0){_0x2c6b0c[_0x842c('0x28')]=_0x189eb0['id'];logger[_0x842c('0xf')](_0x842c('0x29'),_0x2c6b0c[_0x842c('0x28')]);return _0x8cb3e5(_0x2c6b0c);}searchContact(_0x14f89b,_0x259acc,_0x842c('0x2a'),_0x2c6b0c['contactNumber'])['then'](function(_0x10303f){if(_0x10303f){_0x2c6b0c[_0x842c('0x28')]=_0x10303f['id'];logger[_0x842c('0xf')](_0x842c('0x2b'),_0x2c6b0c[_0x842c('0x28')]);return _0x8cb3e5(_0x2c6b0c);}createEndUser(_0x2c6b0c,_0x26c0c2,_0x259acc,_0x14f89b)['then'](function(_0x406833){logger['info'](_0x842c('0x2c'),_0x406833['endUserId']);return _0x8cb3e5(_0x406833);});});})['catch'](function(_0x2467fe){_0x2dfbde(_0x2467fe);});});};}function createEndUser(_0x5a0b64,_0x1caa76,_0x4b5a14,_0x1e0831){return new Promise(function(_0x3d5f76,_0x371717){var _0x109b00=moment();var _0x45255a={'method':_0x842c('0x2d'),'uri':_0x1e0831+'/api/contacts','body':{'contact':{'last_name':_0x5a0b64['contactNumber'],'work_number':_0x5a0b64[_0x842c('0x26')],'mobile_number':_0x5a0b64['contactNumber'],'owner_id':_0x5a0b64[_0x842c('0x1d')],'created_at':_0x109b00['format']('YYYY-MM-DDTHH:mm:ss')}},'json':!![]};_0x45255a[_0x842c('0xe')]=_0x4b5a14;logger[_0x842c('0xf')](_0x842c('0x2e'));return rp(_0x45255a)[_0x842c('0x11')](function(_0x52319f){_0x5a0b64[_0x842c('0x28')]=_0x52319f[_0x842c('0x2f')]['id'];_0x3d5f76(_0x5a0b64);})[_0x842c('0x17')](function(_0x1b21e8){logger[_0x842c('0x20')]('['+[_0x1caa76[_0x842c('0x18')]()]+']',_0x1b21e8[_0x842c('0x19')]);_0x371717(_0x1b21e8[_0x842c('0x19')]);});});}function getTicket(_0x156b8f,_0x498e06,_0x5cf5c0,_0xa281dd,_0x19370b){return function(_0x384041){logger[_0x842c('0xf')](_0x842c('0x30'));return new Promise(function(_0x4fe55e,_0x6248f4){var _0xdedd69=moment();var _0x2ecebb={'method':_0x842c('0x2d'),'uri':_0x5cf5c0+_0x842c('0x31'),'body':{'title':intUtil['getString'](_0xa281dd['Subjects'],_0x19370b,'\x20'),'description':intUtil[_0x842c('0x32')](_0xa281dd[_0x842c('0x33')],_0x19370b,'\x0a'),'owner_id':_0x384041[_0x842c('0x1d')],'creater_id':_0x384041[_0x842c('0x15')],'targetable_id':_0x384041[_0x842c('0x28')],'targetable_type':'Contact','created_at':_0xdedd69[_0x842c('0x25')](_0x842c('0x34')),'due_date':_0xdedd69['add'](0x1e,'m')['format'](_0x842c('0x34'))},'json':!![]};_0x2ecebb[_0x842c('0xe')]=_0x498e06;return rp(_0x2ecebb)['then'](function(_0xfda377){_0x384041[_0x842c('0x35')]=_0xfda377[_0x842c('0x36')]['id'];logger[_0x842c('0xf')]('Task\x20created:',_0x384041['ticketId']);_0x4fe55e(_0x384041);})['catch'](function(_0x418d79){logger[_0x842c('0x20')]('['+[_0x156b8f[_0x842c('0x18')]()]+']',_0x418d79[_0x842c('0x19')]);_0x6248f4(_0x418d79[_0x842c('0x19')]);});});};}function emit(_0x41dbbe,_0x3e53bc,_0x1b4e44){var _0x4ef90a={'uri':_0x41dbbe+_0x842c('0x37')+_0x1b4e44};io['to'](util[_0x842c('0x25')](_0x842c('0x38'),_0x3e53bc))[_0x842c('0x39')](_0x842c('0x3a'),_0x4ef90a);}exports['cs']=function(_0x34bfb8,_0x5b0d76,_0x79a856,_0x2d2345,_0x257275,_0x30bcd8,_0x45fd45,_0x3eb7a0){var _0x21e7aa={};var _0x823460={'Authorization':_0x842c('0x3b')+_0x30bcd8[_0x842c('0x3c')]};_0x30bcd8['remoteUri']=intUtil[_0x842c('0x3d')](_0x30bcd8[_0x842c('0x3e')]);_0x30bcd8[_0x842c('0x3f')]=intUtil['stripTrailingSlash'](_0x30bcd8['serverUrl']);var _0x4da0a0=_0x30bcd8[_0x842c('0x3e')];_0x21e7aa[_0x842c('0x1f')]=_0x30bcd8['username'];_0x21e7aa[_0x842c('0x26')]=_0x3eb7a0['toLowerCase']()===_0x842c('0x40')?_0x5b0d76[_0x842c('0x41')]:_0x5b0d76[_0x842c('0x42')];_0x21e7aa['callDirection']=_0x3eb7a0===_0x842c('0x43')||_0x3eb7a0===_0x842c('0x44')?'queue':_0x842c('0x40');if(_0x2d2345){_0x21e7aa[_0x842c('0x1a')]=_0x2d2345[_0x842c('0x14')];}var _0x5deb61=util[_0x842c('0x25')](_0x842c('0x45'),_0x30bcd8['serverUrl'],_0x5b0d76[_0x842c('0x46')],md5(_0x5b0d76['uniqueid']));if(_0x257275&&_0x257275[_0x842c('0x47')]){logger[_0x842c('0xf')](_0x842c('0x48'),_0x842c('0x49'));_0x5b0d76[_0x842c('0x4a')]=_0x5deb61;}else if(_0x45fd45&&_0x45fd45[_0x842c('0x4b')]&&_0x45fd45['recordingFormat']!==_0x842c('0x4c')){logger[_0x842c('0xf')](_0x842c('0x4d'),_0x842c('0x49'));_0x5b0d76[_0x842c('0x4a')]=_0x5deb61;}else{_0x5b0d76[_0x842c('0x4a')]='';}return getAdminId(_0x21e7aa,_0x3eb7a0,_0x823460,_0x4da0a0)['then'](getUser(_0x3eb7a0,_0x823460,_0x4da0a0))[_0x842c('0x11')](getEndUser(_0x3eb7a0,_0x823460,_0x4da0a0))[_0x842c('0x11')](getTicket(_0x3eb7a0,_0x823460,_0x4da0a0,_0x79a856,_0x5b0d76))[_0x842c('0x11')](function(_0x237471){logger['info'](util[_0x842c('0x25')](_0x842c('0x4e'),_0x237471[_0x842c('0x35')]));if(_0x3eb7a0!==_0x842c('0x44')){logger[_0x842c('0xf')]('['+[_0x3eb7a0[_0x842c('0x18')]()]+']',_0x842c('0x4f'));emit(_0x4da0a0,_0x2d2345[_0x842c('0x50')],_0x237471[_0x842c('0x28')]);}})['catch'](function(_0x4916a1){logger['error']('['+[_0x3eb7a0[_0x842c('0x18')]()]+_0x842c('0x51'),util[_0x842c('0x52')](_0x4916a1,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0xfd38=['/contacts/','user:%s','emit','Token\x20token=','apiKey','remoteUri','serverUrl','stripTrailingSlash','toLowerCase','outbound','destcalleridnum','calleridnum','callDirection','queue','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingFormat','[OUTBOUND]','recordingURL','The\x20ticket\x20ID\x20is:\x20%s','Displaying\x20task\x20in\x20a\x20new\x20tab...','name','inspect','lodash','request-promise','md5','util','moment','bluebird','./util','../../../../config/logger','freshsales','defaults','redis','localhost','/api/selector/owners','headers','info','Getting\x20admin\x20information','then','length','email','adminEmail','adminId','catch','toUpperCase','GET','Getting\x20user\x20list','users','Getting\x20user\x20with\x20email','agentEmail','userId','User\x20found:','Admin\x20selected','userEmail','Requested\x20Resource\x20not\x20Found','error','/api/lookup?q=','&f=','contacts','Searching\x20contact\x20with\x20phone\x20%s','contactNumber','mobile_number','endUserId','work_number','Contact\x20created:','/api/contacts','format','YYYY-MM-DDTHH:mm:ss','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','contact','message','Creating\x20new\x20task','POST','/api/tasks','Subjects','getString','Contact','add','ticketId','task','Task\x20created:'];(function(_0x1e2e73,_0x518a66){var _0x823079=function(_0x37b6e2){while(--_0x37b6e2){_0x1e2e73['push'](_0x1e2e73['shift']());}};_0x823079(++_0x518a66);}(_0xfd38,0x173));var _0x8fd3=function(_0x9163d3,_0x20a441){_0x9163d3=_0x9163d3-0x0;var _0x2c38a6=_0xfd38[_0x9163d3];return _0x2c38a6;};'use strict';var _=require(_0x8fd3('0x0'));var rp=require(_0x8fd3('0x1'));var md5=require(_0x8fd3('0x2'));var util=require(_0x8fd3('0x3'));var moment=require(_0x8fd3('0x4'));var Promise=require(_0x8fd3('0x5'));var Redis=require('ioredis');var intUtil=require(_0x8fd3('0x6'));var config=require('../../../../config/environment');var logger=require(_0x8fd3('0x7'))(_0x8fd3('0x8'));config['redis']=_[_0x8fd3('0x9')](config[_0x8fd3('0xa')],{'host':_0x8fd3('0xb'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x8fd3('0xa')]));function getAdminId(_0x99b5cc,_0xa47bdd,_0x235c16,_0x1ba86f){return new Promise(function(_0x553805,_0x5a1350){var _0x1db928=![];var _0x2d1790={'method':'GET','uri':_0x1ba86f+_0x8fd3('0xc'),'json':!![]};_0x2d1790[_0x8fd3('0xd')]=_0x235c16;logger[_0x8fd3('0xe')](_0x8fd3('0xf'));return rp(_0x2d1790)[_0x8fd3('0x10')](function(_0x285dff){if(_0x285dff){var _0x223135=_0x285dff['users'];var _0x595cc9=null;for(_0x595cc9=0x0;_0x595cc9<_0x223135[_0x8fd3('0x11')];_0x595cc9++){if(_0x223135[_0x595cc9][_0x8fd3('0x12')]===_0x99b5cc[_0x8fd3('0x13')]){_0x99b5cc[_0x8fd3('0x14')]=_0x223135[_0x595cc9]['id'];_0x1db928=!![];}}if(_0x1db928){logger['info']('Admin\x20found:',_0x99b5cc[_0x8fd3('0x14')]);_0x553805(_0x99b5cc);}else{_0x5a1350({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}else{_0x5a1350({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}})[_0x8fd3('0x15')](function(_0x2bbb98){logger['error']('['+[_0xa47bdd[_0x8fd3('0x16')]()]+']',_0x2bbb98['message']);_0x5a1350(_0x2bbb98);});});}function getUser(_0x3cc035,_0xb763bd,_0x37c89f){return function(_0x45034f){return new Promise(function(_0x5de016,_0x2a1475){var _0x28a561={'method':_0x8fd3('0x17'),'uri':_0x37c89f+_0x8fd3('0xc'),'json':!![]};_0x28a561[_0x8fd3('0xd')]=_0xb763bd;logger['info'](_0x8fd3('0x18'));return rp(_0x28a561)['then'](function(_0x350874){if(_0x350874){var _0x211ecc=_0x350874[_0x8fd3('0x19')];var _0x389c08=![];var _0x5b9997=null;if(_0x45034f['agentEmail']!==null){logger['info'](_0x8fd3('0x1a'),_0x45034f[_0x8fd3('0x1b')]);_0x45034f['userEmail']=_0x45034f[_0x8fd3('0x1b')];for(_0x5b9997=0x0;_0x5b9997<_0x211ecc[_0x8fd3('0x11')];_0x5b9997++){if(_0x211ecc[_0x5b9997][_0x8fd3('0x12')]===_0x45034f[_0x8fd3('0x1b')]){_0x389c08=!![];_0x45034f[_0x8fd3('0x1c')]=_0x211ecc[_0x5b9997]['id'];logger[_0x8fd3('0xe')](_0x8fd3('0x1d'),_0x45034f[_0x8fd3('0x1c')]);}}}if(!_0x389c08){logger['info'](_0x8fd3('0x1e'));_0x45034f[_0x8fd3('0x1f')]=_0x45034f[_0x8fd3('0x13')];_0x45034f[_0x8fd3('0x1c')]=_0x45034f[_0x8fd3('0x14')];_0x389c08=!![];}if(_0x389c08){_0x5de016(_0x45034f);}else{_0x2a1475({'statusCode':0x194,'message':_0x8fd3('0x20')});}}else{_0x2a1475({'statusCode':0x194,'message':_0x8fd3('0x20')});}})[_0x8fd3('0x15')](function(_0x2ad5ca){logger[_0x8fd3('0x21')]('['+[_0x3cc035[_0x8fd3('0x16')]()]+']',_0x2ad5ca['message']);_0x2a1475(_0x2ad5ca);});});};}function searchContact(_0x21af7d,_0x6eba48,_0x2b1efa,_0xd38a9c){return new Promise(function(_0x9e4d52,_0x36b7f8){var _0x1f0dd9={'method':_0x8fd3('0x17'),'headers':_0x6eba48,'uri':_0x21af7d+_0x8fd3('0x22')+_0xd38a9c+_0x8fd3('0x23')+_0x2b1efa+'&entities=contact','json':!![]};rp(_0x1f0dd9)[_0x8fd3('0x10')](function(_0x48b25b){var _0xc02262=_['find'](_0x48b25b[_0x8fd3('0x24')]['contacts'],[_0x2b1efa,_0xd38a9c]);_0x9e4d52(_0xc02262);})[_0x8fd3('0x15')](function(_0x3b855b){_0x36b7f8(_0x3b855b);});});}function getEndUser(_0x11acd2,_0x30b507,_0x4c9e57){return function(_0x3350d2){return new Promise(function(_0x3c8a0c,_0x5cc11a){logger[_0x8fd3('0xe')](util['format'](_0x8fd3('0x25'),_0x3350d2[_0x8fd3('0x26')]));searchContact(_0x4c9e57,_0x30b507,_0x8fd3('0x27'),_0x3350d2[_0x8fd3('0x26')])[_0x8fd3('0x10')](function(_0x10424f){if(_0x10424f){_0x3350d2[_0x8fd3('0x28')]=_0x10424f['id'];logger[_0x8fd3('0xe')]('Contact\x20found\x20mobile_number:',_0x3350d2['endUserId']);return _0x3c8a0c(_0x3350d2);}searchContact(_0x4c9e57,_0x30b507,_0x8fd3('0x29'),_0x3350d2['contactNumber'])['then'](function(_0x2de4e2){if(_0x2de4e2){_0x3350d2[_0x8fd3('0x28')]=_0x2de4e2['id'];logger[_0x8fd3('0xe')]('Contact\x20found\x20work_number:',_0x3350d2['endUserId']);return _0x3c8a0c(_0x3350d2);}createEndUser(_0x3350d2,_0x11acd2,_0x30b507,_0x4c9e57)['then'](function(_0x54570f){logger[_0x8fd3('0xe')](_0x8fd3('0x2a'),_0x54570f[_0x8fd3('0x28')]);return _0x3c8a0c(_0x54570f);});});})['catch'](function(_0x38112b){_0x5cc11a(_0x38112b);});});};}function createEndUser(_0x9bc8c9,_0x2732ee,_0x571569,_0x4823e9){return new Promise(function(_0x22bf35,_0x47d675){var _0x16b057=moment();var _0x68d073={'method':'POST','uri':_0x4823e9+_0x8fd3('0x2b'),'body':{'contact':{'last_name':_0x9bc8c9['contactNumber'],'work_number':_0x9bc8c9['contactNumber'],'mobile_number':_0x9bc8c9[_0x8fd3('0x26')],'owner_id':_0x9bc8c9['userId'],'created_at':_0x16b057[_0x8fd3('0x2c')](_0x8fd3('0x2d'))}},'json':!![]};_0x68d073['headers']=_0x571569;logger[_0x8fd3('0xe')](_0x8fd3('0x2e'));return rp(_0x68d073)[_0x8fd3('0x10')](function(_0xdd131d){_0x9bc8c9[_0x8fd3('0x28')]=_0xdd131d[_0x8fd3('0x2f')]['id'];_0x22bf35(_0x9bc8c9);})[_0x8fd3('0x15')](function(_0x369f24){logger[_0x8fd3('0x21')]('['+[_0x2732ee[_0x8fd3('0x16')]()]+']',_0x369f24[_0x8fd3('0x30')]);_0x47d675(_0x369f24[_0x8fd3('0x30')]);});});}function getTicket(_0x21ca2c,_0x2ad4b0,_0x1237d2,_0x1425cc,_0x51025d){return function(_0x24d84b){logger['info'](_0x8fd3('0x31'));return new Promise(function(_0x172aa9,_0x145418){var _0x551d83=moment();var _0x46f5a1={'method':_0x8fd3('0x32'),'uri':_0x1237d2+_0x8fd3('0x33'),'body':{'title':intUtil['getString'](_0x1425cc[_0x8fd3('0x34')],_0x51025d,'\x20'),'description':intUtil[_0x8fd3('0x35')](_0x1425cc['Descriptions'],_0x51025d,'\x0a'),'owner_id':_0x24d84b[_0x8fd3('0x1c')],'creater_id':_0x24d84b[_0x8fd3('0x14')],'targetable_id':_0x24d84b[_0x8fd3('0x28')],'targetable_type':_0x8fd3('0x36'),'created_at':_0x551d83[_0x8fd3('0x2c')]('YYYY-MM-DDTHH:mm:ss'),'due_date':_0x551d83[_0x8fd3('0x37')](0x1e,'m')[_0x8fd3('0x2c')](_0x8fd3('0x2d'))},'json':!![]};_0x46f5a1[_0x8fd3('0xd')]=_0x2ad4b0;return rp(_0x46f5a1)[_0x8fd3('0x10')](function(_0xa051a7){_0x24d84b[_0x8fd3('0x38')]=_0xa051a7[_0x8fd3('0x39')]['id'];logger[_0x8fd3('0xe')](_0x8fd3('0x3a'),_0x24d84b['ticketId']);_0x172aa9(_0x24d84b);})[_0x8fd3('0x15')](function(_0x5c4574){logger[_0x8fd3('0x21')]('['+[_0x21ca2c['toUpperCase']()]+']',_0x5c4574['message']);_0x145418(_0x5c4574[_0x8fd3('0x30')]);});});};}function emit(_0x5a1545,_0x5136e0,_0x283cab){var _0x1c475d={'uri':_0x5a1545+_0x8fd3('0x3b')+_0x283cab};io['to'](util['format'](_0x8fd3('0x3c'),_0x5136e0))[_0x8fd3('0x3d')]('trigger:browser:url',_0x1c475d);}exports['cs']=function(_0x5d4075,_0x4b4d9f,_0x2f63aa,_0x5d66bc,_0x3dcf0a,_0x2d29eb,_0xbc5cf4,_0x22c10c){var _0x348dd0={};var _0x3e9bae={'Authorization':_0x8fd3('0x3e')+_0x2d29eb[_0x8fd3('0x3f')]};_0x2d29eb[_0x8fd3('0x40')]=intUtil['stripTrailingSlash'](_0x2d29eb['remoteUri']);_0x2d29eb[_0x8fd3('0x41')]=intUtil[_0x8fd3('0x42')](_0x2d29eb[_0x8fd3('0x41')]);var _0x45b254=_0x2d29eb[_0x8fd3('0x40')];_0x348dd0[_0x8fd3('0x13')]=_0x2d29eb['username'];_0x348dd0['contactNumber']=_0x22c10c[_0x8fd3('0x43')]()===_0x8fd3('0x44')?_0x4b4d9f[_0x8fd3('0x45')]:_0x4b4d9f[_0x8fd3('0x46')];_0x348dd0[_0x8fd3('0x47')]=_0x22c10c===_0x8fd3('0x48')||_0x22c10c===_0x8fd3('0x49')?_0x8fd3('0x48'):_0x8fd3('0x44');if(_0x5d66bc){_0x348dd0[_0x8fd3('0x1b')]=_0x5d66bc[_0x8fd3('0x12')];}var _0x412f2e=util[_0x8fd3('0x2c')](_0x8fd3('0x4a'),_0x2d29eb[_0x8fd3('0x41')],_0x4b4d9f[_0x8fd3('0x4b')],md5(_0x4b4d9f['uniqueid']));if(_0x3dcf0a&&_0x3dcf0a[_0x8fd3('0x4c')]){logger[_0x8fd3('0xe')](_0x8fd3('0x4d'),_0x8fd3('0x4e'));_0x4b4d9f['recordingURL']=_0x412f2e;}else if(_0xbc5cf4&&_0xbc5cf4[_0x8fd3('0x4f')]&&_0xbc5cf4['recordingFormat']!=='none'){logger[_0x8fd3('0xe')](_0x8fd3('0x50'),_0x8fd3('0x4e'));_0x4b4d9f[_0x8fd3('0x51')]=_0x412f2e;}else{_0x4b4d9f[_0x8fd3('0x51')]='';}return getAdminId(_0x348dd0,_0x22c10c,_0x3e9bae,_0x45b254)['then'](getUser(_0x22c10c,_0x3e9bae,_0x45b254))[_0x8fd3('0x10')](getEndUser(_0x22c10c,_0x3e9bae,_0x45b254))[_0x8fd3('0x10')](getTicket(_0x22c10c,_0x3e9bae,_0x45b254,_0x2f63aa,_0x4b4d9f))[_0x8fd3('0x10')](function(_0x4fd867){logger[_0x8fd3('0xe')](util[_0x8fd3('0x2c')](_0x8fd3('0x52'),_0x4fd867[_0x8fd3('0x38')]));if(_0x22c10c!=='unmanaged'){logger[_0x8fd3('0xe')]('['+[_0x22c10c[_0x8fd3('0x16')]()]+']',_0x8fd3('0x53'));emit(_0x45b254,_0x5d66bc[_0x8fd3('0x54')],_0x4fd867[_0x8fd3('0x28')]);}})[_0x8fd3('0x15')](function(_0x48c689){logger[_0x8fd3('0x21')]('['+[_0x22c10c[_0x8fd3('0x16')]()]+']\x20Error\x20running\x20Freshsales\x20integration',util[_0x8fd3('0x55')](_0x48c689,{'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 57540ba..439d153 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 _0x2f6c=['../../../../config/logger','error','[EXEC]','%s\x20configuration\x20#%s\x20not\x20found','format','data2','lodash','util','./zendesk','./salesforce','./zoho','./desk','./vtiger','./servicenow','./dynamics365','zendesk','salesforce','freshdesk','zoho','desk','servicenow','includes','data1','toLowerCase','find','data3','queue','outbound','unmanaged','sugarcrm','vtiger','freshsales','log','unknown\x20integration'];(function(_0x39d544,_0x35c14f){var _0x5a5ff2=function(_0x2271fb){while(--_0x2271fb){_0x39d544['push'](_0x39d544['shift']());}};_0x5a5ff2(++_0x35c14f);}(_0x2f6c,0x6c));var _0xc2f6=function(_0x13e300,_0x1bcb41){_0x13e300=_0x13e300-0x0;var _0x5a3eea=_0x2f6c[_0x13e300];return _0x5a3eea;};'use strict';var _=require(_0xc2f6('0x0'));var util=require(_0xc2f6('0x1'));var zendesk=require(_0xc2f6('0x2'));var salesforce=require(_0xc2f6('0x3'));var sugarcrm=require('./sugarcrm');var freshdesk=require('./freshdesk');var zoho=require(_0xc2f6('0x4'));var desk=require(_0xc2f6('0x5'));var vtiger=require(_0xc2f6('0x6'));var servicenow=require(_0xc2f6('0x7'));var dynamics365=require(_0xc2f6('0x8'));var freshsales=require('./freshsales');var integrations=[_0xc2f6('0x9'),_0xc2f6('0xa'),'sugarcrm',_0xc2f6('0xb'),_0xc2f6('0xc'),_0xc2f6('0xd'),'vtiger','dynamics365','freshsales',_0xc2f6('0xe')];exports['exec']=function(_0x40ba13,_0x16342b,_0xc4bf4a,_0x50e30d,_0x3ee4f7,_0x3f7887){if(_0xc4bf4a){if(_[_0xc2f6('0xf')](integrations,_0x40ba13[_0xc2f6('0x10')][_0xc2f6('0x11')]())){try{var _0x121c32=null;var _0x133022='';var _0x2f35bd=_0xc4bf4a[_0x40ba13['data1'][_0xc2f6('0x11')]()];if(_0x2f35bd){var _0x164183=_0x2f35bd[_0x40ba13['data2']];if(_0x164183){var _0x1e3c0a=_[_0xc2f6('0x12')](_0x164183['Configurations'],{'id':parseInt(_0x40ba13[_0xc2f6('0x13')],0xa)});if(_0x1e3c0a){if(_0x50e30d){if(_0x3ee4f7&&_0x16342b[_0xc2f6('0x14')]){_0x133022='queue';}else if(_0x16342b['routeId']){_0x133022=_0xc2f6('0x15');}else{console['log']('EVENT\x20UNKNOWN',_0x16342b);}}else{_0x133022=_0xc2f6('0x16');}switch(_0x40ba13[_0xc2f6('0x10')][_0xc2f6('0x11')]()){case _0xc2f6('0x9'):zendesk[_0x133022](_0x40ba13,_0x16342b,_0x1e3c0a,_0x50e30d,_0x3ee4f7,_0x164183,_0x3f7887);break;case _0xc2f6('0xa'):salesforce[_0x133022](_0x40ba13,_0x16342b,_0x1e3c0a,_0x50e30d,_0x3ee4f7,_0x164183,_0x3f7887);break;case _0xc2f6('0x17'):sugarcrm[_0x133022](_0x40ba13,_0x16342b,_0x1e3c0a,_0x50e30d,_0x3ee4f7,_0x164183,_0x3f7887);break;case _0xc2f6('0xb'):freshdesk[_0x133022](_0x40ba13,_0x16342b,_0x1e3c0a,_0x50e30d,_0x3ee4f7,_0x164183,_0x3f7887);break;case _0xc2f6('0xc'):zoho[_0x133022](_0x40ba13,_0x16342b,_0x1e3c0a,_0x50e30d,_0x3ee4f7,_0x164183,_0x3f7887);break;case _0xc2f6('0xd'):desk[_0x133022](_0x40ba13,_0x16342b,_0x1e3c0a,_0x50e30d,_0x3ee4f7,_0x164183,_0x3f7887);break;case _0xc2f6('0x18'):vtiger[_0x133022](_0x40ba13,_0x16342b,_0x1e3c0a,_0x50e30d,_0x3ee4f7,_0x164183,_0x3f7887);break;case _0xc2f6('0x19'):freshsales['cs'](_0x40ba13,_0x16342b,_0x1e3c0a,_0x50e30d,_0x3ee4f7,_0x164183,_0x3f7887,_0x133022);break;case _0xc2f6('0xe'):servicenow['cs'](_0x40ba13,_0x16342b,_0x1e3c0a,_0x50e30d,_0x3ee4f7,_0x164183,_0x3f7887,_0x133022);break;case'dynamics365':dynamics365['cs'](_0x40ba13,_0x16342b,_0x1e3c0a,_0x50e30d,_0x3ee4f7,_0x164183,_0x3f7887,_0x133022);break;default:console[_0xc2f6('0x1a')](_0xc2f6('0x1b'));}}else{_0x121c32=require(_0xc2f6('0x1c'))(_0x40ba13[_0xc2f6('0x10')]['toLowerCase']());_0x121c32[_0xc2f6('0x1d')](_0xc2f6('0x1e'),util['format'](_0xc2f6('0x1f'),_0x40ba13[_0xc2f6('0x10')][_0xc2f6('0x11')](),_0x40ba13[_0xc2f6('0x13')]));}}else{_0x121c32=require('../../../../config/logger')(_0x40ba13[_0xc2f6('0x10')][_0xc2f6('0x11')]());_0x121c32[_0xc2f6('0x1d')](_0xc2f6('0x1e'),util[_0xc2f6('0x20')]('%s\x20account\x20#%s\x20not\x20found',_0x40ba13[_0xc2f6('0x10')][_0xc2f6('0x11')](),_0x40ba13[_0xc2f6('0x21')]));}}else{}}catch(_0x48183a){console[_0xc2f6('0x1d')](_0x48183a);}}}}; \ No newline at end of file +var _0xd04f=['exec','data1','toLowerCase','data2','find','queue','routeId','outbound','unmanaged','zoho','log','unknown\x20integration','../../../../config/logger','[EXEC]','format','%s\x20configuration\x20#%s\x20not\x20found','error','%s\x20account\x20#%s\x20not\x20found','util','./salesforce','./sugarcrm','./freshdesk','./zoho','./desk','./vtiger','./servicenow','./dynamics365','./freshsales','zendesk','salesforce','sugarcrm','desk','vtiger','dynamics365','freshsales','servicenow'];(function(_0x3f70d6,_0x3e281a){var _0x54fb2a=function(_0x36f177){while(--_0x36f177){_0x3f70d6['push'](_0x3f70d6['shift']());}};_0x54fb2a(++_0x3e281a);}(_0xd04f,0xea));var _0xfd04=function(_0x369f35,_0x4f374a){_0x369f35=_0x369f35-0x0;var _0x457c5b=_0xd04f[_0x369f35];return _0x457c5b;};'use strict';var _=require('lodash');var util=require(_0xfd04('0x0'));var zendesk=require('./zendesk');var salesforce=require(_0xfd04('0x1'));var sugarcrm=require(_0xfd04('0x2'));var freshdesk=require(_0xfd04('0x3'));var zoho=require(_0xfd04('0x4'));var desk=require(_0xfd04('0x5'));var vtiger=require(_0xfd04('0x6'));var servicenow=require(_0xfd04('0x7'));var dynamics365=require(_0xfd04('0x8'));var freshsales=require(_0xfd04('0x9'));var integrations=[_0xfd04('0xa'),_0xfd04('0xb'),_0xfd04('0xc'),'freshdesk','zoho',_0xfd04('0xd'),_0xfd04('0xe'),_0xfd04('0xf'),_0xfd04('0x10'),_0xfd04('0x11')];exports[_0xfd04('0x12')]=function(_0x510458,_0x42038c,_0x2bbb78,_0x28bfb3,_0x393972,_0x235d12){if(_0x2bbb78){if(_['includes'](integrations,_0x510458[_0xfd04('0x13')][_0xfd04('0x14')]())){try{var _0x9dbf40=null;var _0x257a18='';var _0x48a431=_0x2bbb78[_0x510458['data1'][_0xfd04('0x14')]()];if(_0x48a431){var _0x24fafc=_0x48a431[_0x510458[_0xfd04('0x15')]];if(_0x24fafc){var _0x3f528f=_[_0xfd04('0x16')](_0x24fafc['Configurations'],{'id':parseInt(_0x510458['data3'],0xa)});if(_0x3f528f){if(_0x28bfb3){if(_0x393972&&_0x42038c['queue']){_0x257a18=_0xfd04('0x17');}else if(_0x42038c[_0xfd04('0x18')]){_0x257a18=_0xfd04('0x19');}else{console['log']('EVENT\x20UNKNOWN',_0x42038c);}}else{_0x257a18=_0xfd04('0x1a');}switch(_0x510458[_0xfd04('0x13')][_0xfd04('0x14')]()){case _0xfd04('0xa'):zendesk[_0x257a18](_0x510458,_0x42038c,_0x3f528f,_0x28bfb3,_0x393972,_0x24fafc,_0x235d12);break;case _0xfd04('0xb'):salesforce[_0x257a18](_0x510458,_0x42038c,_0x3f528f,_0x28bfb3,_0x393972,_0x24fafc,_0x235d12);break;case _0xfd04('0xc'):sugarcrm[_0x257a18](_0x510458,_0x42038c,_0x3f528f,_0x28bfb3,_0x393972,_0x24fafc,_0x235d12);break;case'freshdesk':freshdesk[_0x257a18](_0x510458,_0x42038c,_0x3f528f,_0x28bfb3,_0x393972,_0x24fafc,_0x235d12);break;case _0xfd04('0x1b'):zoho[_0x257a18](_0x510458,_0x42038c,_0x3f528f,_0x28bfb3,_0x393972,_0x24fafc,_0x235d12);break;case'desk':desk[_0x257a18](_0x510458,_0x42038c,_0x3f528f,_0x28bfb3,_0x393972,_0x24fafc,_0x235d12);break;case _0xfd04('0xe'):vtiger[_0x257a18](_0x510458,_0x42038c,_0x3f528f,_0x28bfb3,_0x393972,_0x24fafc,_0x235d12);break;case _0xfd04('0x10'):freshsales['cs'](_0x510458,_0x42038c,_0x3f528f,_0x28bfb3,_0x393972,_0x24fafc,_0x235d12,_0x257a18);break;case'servicenow':servicenow['cs'](_0x510458,_0x42038c,_0x3f528f,_0x28bfb3,_0x393972,_0x24fafc,_0x235d12,_0x257a18);break;case _0xfd04('0xf'):dynamics365['cs'](_0x510458,_0x42038c,_0x3f528f,_0x28bfb3,_0x393972,_0x24fafc,_0x235d12,_0x257a18);break;default:console[_0xfd04('0x1c')](_0xfd04('0x1d'));}}else{_0x9dbf40=require(_0xfd04('0x1e'))(_0x510458[_0xfd04('0x13')][_0xfd04('0x14')]());_0x9dbf40['error'](_0xfd04('0x1f'),util[_0xfd04('0x20')](_0xfd04('0x21'),_0x510458[_0xfd04('0x13')]['toLowerCase'](),_0x510458['data3']));}}else{_0x9dbf40=require(_0xfd04('0x1e'))(_0x510458[_0xfd04('0x13')][_0xfd04('0x14')]());_0x9dbf40[_0xfd04('0x22')]('[EXEC]',util['format'](_0xfd04('0x23'),_0x510458[_0xfd04('0x13')][_0xfd04('0x14')](),_0x510458[_0xfd04('0x15')]));}}else{}}catch(_0x50dff3){console['error'](_0x50dff3);}}}}; \ 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 afdfe50..d7ca73b 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 _0xb6c3=['contact_lead','cloneDeep','additionalSearchContact','$or','Contact','additionalSearchLead','merge','account_contact_lead','additionalSearchAccount','Account','Lead','first','Enduser\x20(%s)\x20with\x20phone\x20%s\x20found','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','LastName','','format','Caller\x20-\x20%s','Company','No\x20Company','forEach','includes','string','picklist','type','idField','variableName','name','Variable','toLowerCase','password','securityToken','Connection','remoteUri','clientId','clientSecret','login','username','Connection\x20established.','serverUrl','monitor_format','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','calleridnum','Fields','queue','integrationTab','user:%s','trigger:salesforce:display','newTab','trigger:browser:url','instanceUrl','error','catch','[QUEUE]','outbound','stripTrailingSlash','recordingFormat','none','[OUTBOUND]','destcalleridnum','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','%s/%s/e','Salesforce\x20account\x20type\x20not\x20recognized','unmanaged','lastevent','toUpperCase',']\x20Ticket\x20%s\x20created.','lodash','moment','bluebird','md5','jsforce','util','ioredis','./util','../../../../config/logger','defaults','redis','localhost','socket.io-emitter','emit','getString','Subjects','ticketType','Task','utc','IsReminderSet','contact','endUserType','lead','WhoId','account','WhatId','Case','leadId','info','Association\x20between\x20Case\x20and\x20Lead\x20skipped','sobject','create','isNil','validateEmail','User','find','execute','then','length','Email','resolve','Name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','identity','user_id','display_name','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch'];(function(_0x16bfae,_0x36ed25){var _0x3870f5=function(_0x5ae24a){while(--_0x5ae24a){_0x16bfae['push'](_0x16bfae['shift']());}};_0x3870f5(++_0x36ed25);}(_0xb6c3,0xc0));var _0x3b6c=function(_0x13bade,_0x45569b){_0x13bade=_0x13bade-0x0;var _0x55ea4a=_0xb6c3[_0x13bade];return _0x55ea4a;};'use strict';var _=require(_0x3b6c('0x0'));var rp=require('request-promise');var moment=require(_0x3b6c('0x1'));var BPromise=require(_0x3b6c('0x2'));var md5=require(_0x3b6c('0x3'));var jsforce=require(_0x3b6c('0x4'));var util=require(_0x3b6c('0x5'));var Redis=require(_0x3b6c('0x6'));var intUtil=require(_0x3b6c('0x7'));var config=require('../../../../config/environment');var logger=require(_0x3b6c('0x8'))('salesforce');config['redis']=_[_0x3b6c('0x9')](config[_0x3b6c('0xa')],{'host':_0x3b6c('0xb'),'port':0x18eb});var io=require(_0x3b6c('0xc'))(new Redis(config[_0x3b6c('0xa')]));function emit(_0x57bfbf,_0xfddf2c,_0x4b104b){io['to'](_0x57bfbf)[_0x3b6c('0xd')](_0xfddf2c,_0x4b104b);}function getTicket(_0x59018f,_0x346de0,_0x5600cf,_0x25168e,_0xb6d52a,_0x2fe1c2,_0x53599f,_0x3acef8){var _0x115220=Object['assign']({},{'OwnerId':_0x346de0['id'],'Subject':intUtil[_0x3b6c('0xe')](_0x25168e[_0x3b6c('0xf')],_0xb6d52a,'\x20'),'Description':intUtil[_0x3b6c('0xe')](_0x25168e['Descriptions'],_0xb6d52a,'\x0a')},getCustomFields(_0x2fe1c2,_0xb6d52a));if(_0x5600cf){if(_0x25168e[_0x3b6c('0x10')]===_0x3b6c('0x11')){_0x115220['ActivityDate']=moment[_0x3b6c('0x12')]();_0x115220[_0x3b6c('0x13')]=![];_0x115220['IsRecurrence']=![];if(_0x5600cf['endUserType']===_0x3b6c('0x14')||_0x5600cf[_0x3b6c('0x15')]===_0x3b6c('0x16')){_0x115220[_0x3b6c('0x17')]=_0x5600cf['id'];}else if(_0x5600cf['endUserType']===_0x3b6c('0x18')){_0x115220[_0x3b6c('0x19')]=_0x5600cf['id'];}}else if(_0x25168e[_0x3b6c('0x10')]===_0x3b6c('0x1a')){if(_0x5600cf[_0x3b6c('0x15')]==='contact'){_0x115220['ContactId']=_0x5600cf['id'];}else if(_0x5600cf['endUserType']===_0x3b6c('0x18')){_0x115220['AccountId']=_0x5600cf['id'];}else if(_0x5600cf[_0x3b6c('0x15')]==='lead'&&_0x25168e['leadId']){_0x115220[_0x25168e[_0x3b6c('0x1b')]]=_0x5600cf['id'];}else{logger[_0x3b6c('0x1c')](_0x3b6c('0x1d'));}}}return _0x53599f[_0x3b6c('0x1e')](_0x25168e['ticketType'])[_0x3b6c('0x1f')](_0x115220);}function getUser(_0xcf1df2,_0x5a58bd,_0x393330){if(!_[_0x3b6c('0x20')](_0x5a58bd)&&intUtil[_0x3b6c('0x21')](_0x5a58bd)){var _0x3608a7={'Email':_0x5a58bd};var _0x8f8f12={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x393330[_0x3b6c('0x1e')](_0x3b6c('0x22'))[_0x3b6c('0x23')](_0x3608a7,_0x8f8f12)[_0x3b6c('0x24')]()[_0x3b6c('0x25')](function(_0xcc8e1e){if(_0xcc8e1e[_0x3b6c('0x26')]){var _0x5ab62d=_[_0x3b6c('0x23')](_0xcc8e1e,function(_0x386c85){return _0x386c85[_0x3b6c('0x27')]===_0x5a58bd;});if(_0x5ab62d){logger['info']('Agent\x20%s\x20found.',_0x5a58bd);return BPromise[_0x3b6c('0x28')]({'id':_0x5ab62d['Id'],'name':_0x5ab62d[_0x3b6c('0x29')]});}}else{logger['info'](_0x3b6c('0x2a'),_0x5a58bd);return _0x393330[_0x3b6c('0x2b')]()['then'](function(_0x23dc69){return BPromise['resolve']({'id':_0x23dc69[_0x3b6c('0x2c')],'name':_0x23dc69[_0x3b6c('0x2d')]});});}});}else{logger['info'](_0x3b6c('0x2a'),_0x5a58bd);return _0x393330[_0x3b6c('0x2b')]()[_0x3b6c('0x25')](function(_0x1193f0){return BPromise[_0x3b6c('0x28')]({'id':_0x1193f0['user_id'],'name':_0x1193f0[_0x3b6c('0x2d')]});});}}function getEndUser(_0xbeb352,_0x400aa1,_0x4a45e7,_0x4705d8,_0x2c552e){var _0x397e29={'$or':{'Phone':_0x4705d8}};var _0x50f4d5={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0x3b6c('0x28')]()[_0x3b6c('0x25')](function(){logger[_0x3b6c('0x1c')](_0x3b6c('0x2e'),_0x4705d8,_0x400aa1[_0x3b6c('0x2f')]);switch(_0x400aa1[_0x3b6c('0x2f')]){case _0x3b6c('0x30'):var _0x43abf3=_[_0x3b6c('0x31')](_0x397e29);if(_0x400aa1[_0x3b6c('0x32')]){var _0x5d1e3d={};_0x5d1e3d[_0x400aa1[_0x3b6c('0x32')]]=_0x4705d8;_['merge'](_0x43abf3[_0x3b6c('0x33')],_0x5d1e3d);}return _0x2c552e['sobject'](_0x3b6c('0x34'))[_0x3b6c('0x23')](_0x43abf3,_0x50f4d5)[_0x3b6c('0x24')]()['then'](function(_0xb6231b){if(_0xb6231b&&_0xb6231b['length']){return _0xb6231b;}else{var _0x1db681=_[_0x3b6c('0x31')](_0x397e29);if(_0x400aa1[_0x3b6c('0x35')]){var _0x20b1ce={};_0x20b1ce[_0x400aa1[_0x3b6c('0x35')]]=_0x4705d8;_[_0x3b6c('0x36')](_0x1db681[_0x3b6c('0x33')],_0x20b1ce);}return _0x2c552e[_0x3b6c('0x1e')]('Lead')['find'](_0x1db681,_0x50f4d5);}});case _0x3b6c('0x37'):var _0x3473fb=_[_0x3b6c('0x31')](_0x397e29);if(_0x400aa1['additionalSearchAccount']){var _0x5d1e3d={};_0x5d1e3d[_0x400aa1[_0x3b6c('0x38')]]=_0x4705d8;_['merge'](_0x3473fb[_0x3b6c('0x33')],_0x5d1e3d);}return _0x2c552e[_0x3b6c('0x1e')](_0x3b6c('0x39'))[_0x3b6c('0x23')](_0x3473fb,_0x50f4d5)['execute']()[_0x3b6c('0x25')](function(_0x11ab9f){if(_0x11ab9f&&_0x11ab9f['length']){return _0x11ab9f;}else{var _0x123c4a=_['cloneDeep'](_0x397e29);if(_0x400aa1[_0x3b6c('0x32')]){var _0x58309c={};_0x58309c[_0x400aa1[_0x3b6c('0x32')]]=_0x4705d8;_[_0x3b6c('0x36')](_0x123c4a[_0x3b6c('0x33')],_0x58309c);}return _0x2c552e[_0x3b6c('0x1e')](_0x3b6c('0x34'))['find'](_0x123c4a,_0x50f4d5)[_0x3b6c('0x25')](function(_0x1dbc48){if(_0x1dbc48&&_0x1dbc48[_0x3b6c('0x26')]){return _0x1dbc48;}else{var _0xd768ae=_[_0x3b6c('0x31')](_0x397e29);if(_0x400aa1[_0x3b6c('0x35')]){var _0x31a968={};_0x31a968[_0x400aa1[_0x3b6c('0x35')]]=_0x4705d8;_[_0x3b6c('0x36')](_0xd768ae[_0x3b6c('0x33')],_0x31a968);}return _0x2c552e[_0x3b6c('0x1e')](_0x3b6c('0x3a'))[_0x3b6c('0x23')](_0xd768ae,_0x50f4d5);}});}});case'contact':var _0x43abf3=_['cloneDeep'](_0x397e29);if(_0x400aa1[_0x3b6c('0x32')]){var _0x5d1e3d={};_0x5d1e3d[_0x400aa1[_0x3b6c('0x32')]]=_0x4705d8;_[_0x3b6c('0x36')](_0x43abf3[_0x3b6c('0x33')],_0x5d1e3d);}return _0x2c552e['sobject']('Contact')['find'](_0x43abf3,_0x50f4d5)[_0x3b6c('0x24')]();case'lead':var _0x4c0843=_[_0x3b6c('0x31')](_0x397e29);if(_0x400aa1['additionalSearchLead']){var _0x5d1e3d={};_0x5d1e3d[_0x400aa1[_0x3b6c('0x35')]]=_0x4705d8;_[_0x3b6c('0x36')](_0x4c0843[_0x3b6c('0x33')],_0x5d1e3d);}return _0x2c552e['sobject']('Lead')[_0x3b6c('0x23')](_0x4c0843,_0x50f4d5);case _0x3b6c('0x18'):var _0x3473fb=_[_0x3b6c('0x31')](_0x397e29);if(_0x400aa1[_0x3b6c('0x38')]){var _0x5d1e3d={};_0x5d1e3d[_0x400aa1[_0x3b6c('0x38')]]=_0x4705d8;_[_0x3b6c('0x36')](_0x3473fb[_0x3b6c('0x33')],_0x5d1e3d);}return _0x2c552e['sobject'](_0x3b6c('0x39'))[_0x3b6c('0x23')](_0x3473fb,_0x50f4d5);default:return null;}})['then'](function(_0x50d31b){if(_0x50d31b&&_0x50d31b[_0x3b6c('0x26')]){var _0x1f4443=_[_0x3b6c('0x3b')](_0x50d31b);if(_0x1f4443){return BPromise[_0x3b6c('0x28')]({'id':_0x1f4443['Id'],'name':_0x1f4443[_0x3b6c('0x29')],'phone':_0x1f4443['Phone'],'endUserType':_0x1f4443['attributes']['type']['toLowerCase']()});}}})['then'](function(_0x2922a4){if(_0x2922a4){logger['info'](_0x3b6c('0x3c'),_0x2922a4[_0x3b6c('0x15')],_0x4705d8);return BPromise['resolve'](_0x2922a4);}else{logger[_0x3b6c('0x1c')]('Enduser\x20with\x20phone\x20%s\x20not\x20found',_0x4705d8);var _0x54c22f={'Phone':_0x4705d8};if(_0x400aa1['moduleCreate']){if(_0x400aa1[_0x3b6c('0x3d')]===_0x3b6c('0x14')){logger[_0x3b6c('0x1c')](_0x3b6c('0x3e'),_0x4705d8,_0x400aa1[_0x3b6c('0x3d')]);_0x54c22f[_0x3b6c('0x3f')]=_0x4a45e7!==_0x3b6c('0x40')?_0x4a45e7:util[_0x3b6c('0x41')](_0x3b6c('0x42'),_0x4705d8);}else if(_0x400aa1[_0x3b6c('0x3d')]===_0x3b6c('0x16')){logger[_0x3b6c('0x1c')]('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x4705d8,_0x400aa1[_0x3b6c('0x3d')]);_0x54c22f[_0x3b6c('0x3f')]=_0x4a45e7!==_0x3b6c('0x40')?_0x4a45e7:util[_0x3b6c('0x41')](_0x3b6c('0x42'),_0x4705d8);_0x54c22f[_0x3b6c('0x43')]=_0x3b6c('0x44');}else if(_0x400aa1[_0x3b6c('0x3d')]===_0x3b6c('0x18')){logger[_0x3b6c('0x1c')]('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x4705d8,_0x400aa1[_0x3b6c('0x3d')]);_0x54c22f['Name']=_0x4a45e7!==_0x3b6c('0x40')?_0x4a45e7:util[_0x3b6c('0x41')](_0x3b6c('0x42'),_0x4705d8);}else{return null;}}return _0x2c552e[_0x3b6c('0x1e')](_['upperFirst'](_0x400aa1[_0x3b6c('0x3d')]))[_0x3b6c('0x1f')](_0x54c22f)[_0x3b6c('0x25')](function(_0xf0bad0){return BPromise[_0x3b6c('0x28')]({'id':_0xf0bad0['id'],'endUserType':_0x400aa1[_0x3b6c('0x3d')]});});}});}function getCustomFields(_0x6886d4,_0x38ae64){var _0x34effd={};if(_0x6886d4[_0x3b6c('0x26')]>0x0){_[_0x3b6c('0x45')](_0x6886d4,function(_0x45c737){if(_[_0x3b6c('0x46')]([_0x3b6c('0x47'),_0x3b6c('0x48')],_0x45c737[_0x3b6c('0x49')])&&_0x45c737[_0x3b6c('0x4a')]){_0x34effd[_0x45c737[_0x3b6c('0x4a')]]=_0x45c737['content']['toString']();}else if(_0x45c737[_0x3b6c('0x49')]==='variable'&&_0x45c737[_0x3b6c('0x4b')]&&_0x45c737['idField']){_0x38ae64[_0x45c737[_0x3b6c('0x4b')]]&&(_0x34effd[_0x45c737[_0x3b6c('0x4a')]]=_0x38ae64[_0x45c737['variableName']]['toString']());}else if(_0x45c737[_0x3b6c('0x49')]==='customVariable'&&_0x45c737['Variable']&&_0x45c737['Variable'][_0x3b6c('0x4c')]&&_0x45c737[_0x3b6c('0x4a')]){_0x38ae64[_0x45c737[_0x3b6c('0x4d')]['name'][_0x3b6c('0x4e')]()]&&(_0x34effd[_0x45c737[_0x3b6c('0x4a')]]=_0x38ae64[_0x45c737['Variable']['name'][_0x3b6c('0x4e')]()]['toString']());}});}return _0x34effd;}function getConnection(_0x333368){var _0x29abbb=_0x333368[_0x3b6c('0x4f')]['concat'](_0x333368[_0x3b6c('0x50')]);var _0x51d0c3=new jsforce[(_0x3b6c('0x51'))]({'oauth2':{'loginUrl':_0x333368[_0x3b6c('0x52')]||'https://login.salesforce.com','clientId':_0x333368[_0x3b6c('0x53')],'clientSecret':_0x333368[_0x3b6c('0x54')]}});return _0x51d0c3[_0x3b6c('0x55')](_0x333368[_0x3b6c('0x56')],_0x29abbb)[_0x3b6c('0x25')](function(){logger[_0x3b6c('0x1c')](_0x3b6c('0x57'));return _0x51d0c3;});}exports['queue']=function(_0x3df4be,_0x51e12c,_0x3afe2f,_0x13c9b5,_0x46a83e,_0xebcedf){var _0xfa81c2,_0xdbe7d1,_0x16a7a3,_0x224cf5;_0xebcedf[_0x3b6c('0x58')]=intUtil['stripTrailingSlash'](_0xebcedf[_0x3b6c('0x58')]);_0xebcedf[_0x3b6c('0x52')]=intUtil['stripTrailingSlash'](_0xebcedf[_0x3b6c('0x52')]);if(_0x46a83e&&_0x46a83e[_0x3b6c('0x59')]){logger[_0x3b6c('0x1c')]('[QUEUE]',_0x3b6c('0x5a'));_0x51e12c[_0x3b6c('0x5b')]=util['format'](_0x3b6c('0x5c'),_0xebcedf[_0x3b6c('0x58')],_0x51e12c[_0x3b6c('0x5d')],md5(_0x51e12c[_0x3b6c('0x5d')]));}else{_0x51e12c[_0x3b6c('0x5b')]='';}return getConnection(_0xebcedf)[_0x3b6c('0x25')](function(_0x7d092e){_0x224cf5=_0x7d092e;return getUser(_0xebcedf,_0x13c9b5[_0x3b6c('0x5e')],_0x224cf5);})['then'](function(_0x48dd7c){_0xfa81c2=_0x48dd7c;return getEndUser(_0xebcedf,_0x3afe2f,_0x51e12c['calleridname'],_0x51e12c[_0x3b6c('0x5f')],_0x224cf5);})[_0x3b6c('0x25')](function(_0x4ed21f){_0xdbe7d1=_0x4ed21f;return getTicket(_0xebcedf,_0xfa81c2,_0xdbe7d1,_0x3afe2f,_0x51e12c,_0x3afe2f[_0x3b6c('0x60')],_0x224cf5,_0x3b6c('0x61'));})[_0x3b6c('0x25')](function(_0x67b068){_0x16a7a3=_0x67b068;logger[_0x3b6c('0x1c')]('[QUEUE]\x20Ticket\x20%s\x20created',_0x16a7a3['id']);logger[_0x3b6c('0x1c')]('[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.',_0x16a7a3['id'],_0x13c9b5[_0x3b6c('0x4c')],_0xebcedf[_0x3b6c('0x49')]);switch(_0xebcedf[_0x3b6c('0x49')]){case _0x3b6c('0x62'):emit(util[_0x3b6c('0x41')](_0x3b6c('0x63'),_0x13c9b5[_0x3b6c('0x4c')]),_0x3b6c('0x64'),{'recordId':_0x16a7a3['id']});break;case _0x3b6c('0x65'):emit(util[_0x3b6c('0x41')]('user:%s',_0x13c9b5[_0x3b6c('0x4c')]),_0x3b6c('0x66'),{'uri':util[_0x3b6c('0x41')]('%s/%s/e',_0x224cf5[_0x3b6c('0x67')],_0x16a7a3['id'])});break;default:logger[_0x3b6c('0x68')]('[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.');}})[_0x3b6c('0x69')](function(_0x115c3c){logger[_0x3b6c('0x68')](_0x3b6c('0x6a'),_0x115c3c);});};exports[_0x3b6c('0x6b')]=function(_0x5d884a,_0x370f55,_0x920bca,_0x46144c,_0x4706f1,_0x3eafcf,_0x3df77f){var _0x3cd933,_0x152724,_0x287bd0,_0xdd2dc6;_0x3eafcf[_0x3b6c('0x58')]=intUtil[_0x3b6c('0x6c')](_0x3eafcf[_0x3b6c('0x58')]);_0x3eafcf[_0x3b6c('0x52')]=intUtil[_0x3b6c('0x6c')](_0x3eafcf[_0x3b6c('0x52')]);if(_0x3df77f&&_0x3df77f[_0x3b6c('0x6d')]&&_0x3df77f[_0x3b6c('0x6d')]!==_0x3b6c('0x6e')){logger[_0x3b6c('0x1c')](_0x3b6c('0x6f'),_0x3b6c('0x5a'));_0x370f55['recordingURL']=util[_0x3b6c('0x41')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x3eafcf[_0x3b6c('0x58')],_0x370f55[_0x3b6c('0x5d')],md5(_0x370f55[_0x3b6c('0x5d')]));}return getConnection(_0x3eafcf)[_0x3b6c('0x25')](function(_0xb58496){_0xdd2dc6=_0xb58496;return getUser(_0x3eafcf,_0x46144c[_0x3b6c('0x5e')],_0xdd2dc6);})[_0x3b6c('0x25')](function(_0x4772a2){_0x3cd933=_0x4772a2;return getEndUser(_0x3eafcf,_0x920bca,_0x370f55['destcalleridname'],_0x370f55[_0x3b6c('0x70')],_0xdd2dc6);})[_0x3b6c('0x25')](function(_0x1fde91){_0x152724=_0x1fde91;return getTicket(_0x3eafcf,_0x3cd933,_0x152724,_0x920bca,_0x370f55,_0x920bca[_0x3b6c('0x60')],_0xdd2dc6,_0x3b6c('0x6b'));})['then'](function(_0x26db24){_0x287bd0=_0x26db24;logger[_0x3b6c('0x1c')]('[OUTBOUND]\x20Ticket\x20%s\x20created.',_0x287bd0['id']);logger[_0x3b6c('0x1c')](_0x3b6c('0x71'),_0x287bd0['id'],_0x46144c[_0x3b6c('0x4c')],_0x3eafcf[_0x3b6c('0x49')]);switch(_0x3eafcf[_0x3b6c('0x49')]){case _0x3b6c('0x62'):emit(util['format'](_0x3b6c('0x63'),_0x46144c[_0x3b6c('0x4c')]),_0x3b6c('0x64'),{'recordId':_0x287bd0['id']});break;case'newTab':emit(util[_0x3b6c('0x41')]('user:%s',_0x46144c[_0x3b6c('0x4c')]),_0x3b6c('0x66'),{'uri':util[_0x3b6c('0x41')](_0x3b6c('0x72'),_0xdd2dc6[_0x3b6c('0x67')],_0x287bd0['id'])});break;default:logger['error'](_0x3b6c('0x6f'),_0x3b6c('0x73'));}})[_0x3b6c('0x69')](function(_0x37c73c){logger[_0x3b6c('0x68')]('[OUTBOUND]',_0x37c73c);});};exports[_0x3b6c('0x74')]=function(_0x478007,_0x21f334,_0x4f847a,_0x5a22d1,_0x22a46,_0x59e161){var _0x5f40bc,_0x417f84,_0xace039,_0x1b9f81;_0x59e161[_0x3b6c('0x58')]=intUtil['stripTrailingSlash'](_0x59e161['serverUrl']);_0x59e161[_0x3b6c('0x52')]=intUtil['stripTrailingSlash'](_0x59e161['remoteUri']);if(_0x22a46&&_0x22a46[_0x3b6c('0x59')]){logger[_0x3b6c('0x1c')]('['+_0x21f334[_0x3b6c('0x75')][_0x3b6c('0x76')]()+']',_0x3b6c('0x5a'));_0x21f334[_0x3b6c('0x5b')]=util[_0x3b6c('0x41')](_0x3b6c('0x5c'),_0x59e161[_0x3b6c('0x58')],_0x21f334[_0x3b6c('0x5d')],md5(_0x21f334[_0x3b6c('0x5d')]));}else{_0x21f334['recordingURL']='';}return getConnection(_0x59e161)[_0x3b6c('0x25')](function(_0x305010){_0x1b9f81=_0x305010;if(!_['isNil'](_0x5a22d1)){return getUser(_0x59e161,_0x5a22d1[_0x3b6c('0x4c')],_0x1b9f81);}else{return getUser(_0x59e161,null,_0x1b9f81);}})[_0x3b6c('0x25')](function(_0x46f49b){_0x5f40bc=_0x46f49b;return getEndUser(_0x59e161,_0x4f847a,_0x21f334['calleridname'],_0x21f334[_0x3b6c('0x5f')],_0x1b9f81);})[_0x3b6c('0x25')](function(_0x1d0f2e){_0x417f84=_0x1d0f2e;return getTicket(_0x59e161,_0x5f40bc,_0x417f84,_0x4f847a,_0x21f334,_0x4f847a[_0x3b6c('0x60')],_0x1b9f81);})[_0x3b6c('0x25')](function(_0x35c14a){_0xace039=_0x35c14a;logger[_0x3b6c('0x1c')]('['+_0x21f334['lastevent'][_0x3b6c('0x76')]()+_0x3b6c('0x77'),_0xace039['id']);logger['info']('['+_0x21f334['lastevent'][_0x3b6c('0x76')]()+']\x20Integration\x20account\x20type\x20%s.',_0x59e161[_0x3b6c('0x49')]);})[_0x3b6c('0x69')](function(_0x118570){logger[_0x3b6c('0x68')]('['+_0x21f334[_0x3b6c('0x75')]['toUpperCase']()+']',_0x118570);});}; \ No newline at end of file +var _0xffd8=['Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','contact_lead','cloneDeep','additionalSearchContact','$or','Contact','length','additionalSearchLead','merge','Lead','account_contact_lead','additionalSearchAccount','Account','first','Phone','attributes','type','toLowerCase','Enduser\x20(%s)\x20with\x20phone\x20%s\x20found','Enduser\x20with\x20phone\x20%s\x20not\x20found','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','LastName','format','Caller\x20-\x20%s','','Company','No\x20Company','upperFirst','forEach','picklist','idField','content','toString','variable','variableName','customVariable','Variable','name','password','concat','securityToken','Connection','clientId','clientSecret','login','username','queue','stripTrailingSlash','serverUrl','remoteUri','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','uniqueid','email','calleridname','[QUEUE]\x20Ticket\x20%s\x20created','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab','user:%s','trigger:salesforce:display','newTab','trigger:browser:url','%s/%s/e','instanceUrl','error','catch','outbound','none','[OUTBOUND]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','destcalleridname','destcalleridnum','Fields','[OUTBOUND]\x20Ticket\x20%s\x20created.','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','Salesforce\x20account\x20type\x20not\x20recognized','monitor_format','toUpperCase','lastevent',']\x20Integration\x20account\x20type\x20%s.','lodash','request-promise','moment','bluebird','md5','jsforce','util','./util','../../../../config/logger','salesforce','localhost','socket.io-emitter','redis','emit','assign','getString','Subjects','ticketType','Task','IsReminderSet','IsRecurrence','endUserType','contact','lead','WhoId','account','WhatId','Case','AccountId','leadId','Association\x20between\x20Case\x20and\x20Lead\x20skipped','sobject','create','isNil','User','find','execute','then','Agent\x20%s\x20found.','resolve','Name','info','user_id','display_name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','identity'];(function(_0x53a1be,_0x42dff2){var _0x38ae84=function(_0x51fa5c){while(--_0x51fa5c){_0x53a1be['push'](_0x53a1be['shift']());}};_0x38ae84(++_0x42dff2);}(_0xffd8,0x152));var _0x8ffd=function(_0x235a8b,_0x333f40){_0x235a8b=_0x235a8b-0x0;var _0x5ea4e0=_0xffd8[_0x235a8b];return _0x5ea4e0;};'use strict';var _=require(_0x8ffd('0x0'));var rp=require(_0x8ffd('0x1'));var moment=require(_0x8ffd('0x2'));var BPromise=require(_0x8ffd('0x3'));var md5=require(_0x8ffd('0x4'));var jsforce=require(_0x8ffd('0x5'));var util=require(_0x8ffd('0x6'));var Redis=require('ioredis');var intUtil=require(_0x8ffd('0x7'));var config=require('../../../../config/environment');var logger=require(_0x8ffd('0x8'))(_0x8ffd('0x9'));config['redis']=_['defaults'](config['redis'],{'host':_0x8ffd('0xa'),'port':0x18eb});var io=require(_0x8ffd('0xb'))(new Redis(config[_0x8ffd('0xc')]));function emit(_0x132b28,_0x322488,_0x380935){io['to'](_0x132b28)[_0x8ffd('0xd')](_0x322488,_0x380935);}function getTicket(_0x42cc4d,_0x405fca,_0x3f97aa,_0x4acb36,_0x4164b3,_0x34abf9,_0x4d174b,_0x1aa859){var _0x10c376=Object[_0x8ffd('0xe')]({},{'OwnerId':_0x405fca['id'],'Subject':intUtil[_0x8ffd('0xf')](_0x4acb36[_0x8ffd('0x10')],_0x4164b3,'\x20'),'Description':intUtil[_0x8ffd('0xf')](_0x4acb36['Descriptions'],_0x4164b3,'\x0a')},getCustomFields(_0x34abf9,_0x4164b3));if(_0x3f97aa){if(_0x4acb36[_0x8ffd('0x11')]===_0x8ffd('0x12')){_0x10c376['ActivityDate']=moment['utc']();_0x10c376[_0x8ffd('0x13')]=![];_0x10c376[_0x8ffd('0x14')]=![];if(_0x3f97aa[_0x8ffd('0x15')]===_0x8ffd('0x16')||_0x3f97aa['endUserType']===_0x8ffd('0x17')){_0x10c376[_0x8ffd('0x18')]=_0x3f97aa['id'];}else if(_0x3f97aa[_0x8ffd('0x15')]===_0x8ffd('0x19')){_0x10c376[_0x8ffd('0x1a')]=_0x3f97aa['id'];}}else if(_0x4acb36[_0x8ffd('0x11')]===_0x8ffd('0x1b')){if(_0x3f97aa[_0x8ffd('0x15')]===_0x8ffd('0x16')){_0x10c376['ContactId']=_0x3f97aa['id'];}else if(_0x3f97aa['endUserType']==='account'){_0x10c376[_0x8ffd('0x1c')]=_0x3f97aa['id'];}else if(_0x3f97aa[_0x8ffd('0x15')]===_0x8ffd('0x17')&&_0x4acb36['leadId']){_0x10c376[_0x4acb36[_0x8ffd('0x1d')]]=_0x3f97aa['id'];}else{logger['info'](_0x8ffd('0x1e'));}}}return _0x4d174b[_0x8ffd('0x1f')](_0x4acb36[_0x8ffd('0x11')])[_0x8ffd('0x20')](_0x10c376);}function getUser(_0x299da2,_0x2675b5,_0x468005){if(!_[_0x8ffd('0x21')](_0x2675b5)&&intUtil['validateEmail'](_0x2675b5)){var _0x5be998={'Email':_0x2675b5};var _0x565dc7={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x468005[_0x8ffd('0x1f')](_0x8ffd('0x22'))[_0x8ffd('0x23')](_0x5be998,_0x565dc7)[_0x8ffd('0x24')]()[_0x8ffd('0x25')](function(_0x29f451){if(_0x29f451['length']){var _0x34ccbd=_['find'](_0x29f451,function(_0x31c194){return _0x31c194['Email']===_0x2675b5;});if(_0x34ccbd){logger['info'](_0x8ffd('0x26'),_0x2675b5);return BPromise[_0x8ffd('0x27')]({'id':_0x34ccbd['Id'],'name':_0x34ccbd[_0x8ffd('0x28')]});}}else{logger[_0x8ffd('0x29')]('Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.',_0x2675b5);return _0x468005['identity']()['then'](function(_0x371f15){return BPromise[_0x8ffd('0x27')]({'id':_0x371f15[_0x8ffd('0x2a')],'name':_0x371f15[_0x8ffd('0x2b')]});});}});}else{logger[_0x8ffd('0x29')](_0x8ffd('0x2c'),_0x2675b5);return _0x468005[_0x8ffd('0x2d')]()[_0x8ffd('0x25')](function(_0x46a520){return BPromise[_0x8ffd('0x27')]({'id':_0x46a520['user_id'],'name':_0x46a520[_0x8ffd('0x2b')]});});}}function getEndUser(_0x1a9697,_0x3c6f76,_0x242321,_0x36f9f1,_0x2361c9){var _0x1a3c1d={'$or':{'Phone':_0x36f9f1}};var _0x100003={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0x8ffd('0x27')]()[_0x8ffd('0x25')](function(){logger[_0x8ffd('0x29')](_0x8ffd('0x2e'),_0x36f9f1,_0x3c6f76['moduleSearch']);switch(_0x3c6f76['moduleSearch']){case _0x8ffd('0x2f'):var _0x4e631d=_[_0x8ffd('0x30')](_0x1a3c1d);if(_0x3c6f76[_0x8ffd('0x31')]){var _0x4aa737={};_0x4aa737[_0x3c6f76[_0x8ffd('0x31')]]=_0x36f9f1;_['merge'](_0x4e631d[_0x8ffd('0x32')],_0x4aa737);}return _0x2361c9[_0x8ffd('0x1f')](_0x8ffd('0x33'))[_0x8ffd('0x23')](_0x4e631d,_0x100003)[_0x8ffd('0x24')]()[_0x8ffd('0x25')](function(_0x50eac7){if(_0x50eac7&&_0x50eac7[_0x8ffd('0x34')]){return _0x50eac7;}else{var _0xfec900=_[_0x8ffd('0x30')](_0x1a3c1d);if(_0x3c6f76[_0x8ffd('0x35')]){var _0x1ca1c7={};_0x1ca1c7[_0x3c6f76[_0x8ffd('0x35')]]=_0x36f9f1;_[_0x8ffd('0x36')](_0xfec900[_0x8ffd('0x32')],_0x1ca1c7);}return _0x2361c9['sobject'](_0x8ffd('0x37'))[_0x8ffd('0x23')](_0xfec900,_0x100003);}});case _0x8ffd('0x38'):var _0xd5a09e=_[_0x8ffd('0x30')](_0x1a3c1d);if(_0x3c6f76[_0x8ffd('0x39')]){var _0x4aa737={};_0x4aa737[_0x3c6f76[_0x8ffd('0x39')]]=_0x36f9f1;_['merge'](_0xd5a09e[_0x8ffd('0x32')],_0x4aa737);}return _0x2361c9[_0x8ffd('0x1f')](_0x8ffd('0x3a'))[_0x8ffd('0x23')](_0xd5a09e,_0x100003)[_0x8ffd('0x24')]()[_0x8ffd('0x25')](function(_0x312c72){if(_0x312c72&&_0x312c72[_0x8ffd('0x34')]){return _0x312c72;}else{var _0x3395e8=_[_0x8ffd('0x30')](_0x1a3c1d);if(_0x3c6f76[_0x8ffd('0x31')]){var _0x235762={};_0x235762[_0x3c6f76[_0x8ffd('0x31')]]=_0x36f9f1;_[_0x8ffd('0x36')](_0x3395e8[_0x8ffd('0x32')],_0x235762);}return _0x2361c9[_0x8ffd('0x1f')](_0x8ffd('0x33'))[_0x8ffd('0x23')](_0x3395e8,_0x100003)['then'](function(_0x2a8389){if(_0x2a8389&&_0x2a8389[_0x8ffd('0x34')]){return _0x2a8389;}else{var _0xbd8814=_[_0x8ffd('0x30')](_0x1a3c1d);if(_0x3c6f76[_0x8ffd('0x35')]){var _0xffd1b4={};_0xffd1b4[_0x3c6f76[_0x8ffd('0x35')]]=_0x36f9f1;_['merge'](_0xbd8814[_0x8ffd('0x32')],_0xffd1b4);}return _0x2361c9[_0x8ffd('0x1f')](_0x8ffd('0x37'))['find'](_0xbd8814,_0x100003);}});}});case'contact':var _0x4e631d=_[_0x8ffd('0x30')](_0x1a3c1d);if(_0x3c6f76[_0x8ffd('0x31')]){var _0x4aa737={};_0x4aa737[_0x3c6f76[_0x8ffd('0x31')]]=_0x36f9f1;_['merge'](_0x4e631d[_0x8ffd('0x32')],_0x4aa737);}return _0x2361c9[_0x8ffd('0x1f')](_0x8ffd('0x33'))[_0x8ffd('0x23')](_0x4e631d,_0x100003)[_0x8ffd('0x24')]();case _0x8ffd('0x17'):var _0x50c22c=_['cloneDeep'](_0x1a3c1d);if(_0x3c6f76[_0x8ffd('0x35')]){var _0x4aa737={};_0x4aa737[_0x3c6f76['additionalSearchLead']]=_0x36f9f1;_['merge'](_0x50c22c[_0x8ffd('0x32')],_0x4aa737);}return _0x2361c9['sobject']('Lead')[_0x8ffd('0x23')](_0x50c22c,_0x100003);case _0x8ffd('0x19'):var _0xd5a09e=_[_0x8ffd('0x30')](_0x1a3c1d);if(_0x3c6f76[_0x8ffd('0x39')]){var _0x4aa737={};_0x4aa737[_0x3c6f76[_0x8ffd('0x39')]]=_0x36f9f1;_[_0x8ffd('0x36')](_0xd5a09e[_0x8ffd('0x32')],_0x4aa737);}return _0x2361c9[_0x8ffd('0x1f')](_0x8ffd('0x3a'))[_0x8ffd('0x23')](_0xd5a09e,_0x100003);default:return null;}})['then'](function(_0x117e59){if(_0x117e59&&_0x117e59[_0x8ffd('0x34')]){var _0x13df37=_[_0x8ffd('0x3b')](_0x117e59);if(_0x13df37){return BPromise[_0x8ffd('0x27')]({'id':_0x13df37['Id'],'name':_0x13df37[_0x8ffd('0x28')],'phone':_0x13df37[_0x8ffd('0x3c')],'endUserType':_0x13df37[_0x8ffd('0x3d')][_0x8ffd('0x3e')][_0x8ffd('0x3f')]()});}}})[_0x8ffd('0x25')](function(_0x390dc5){if(_0x390dc5){logger[_0x8ffd('0x29')](_0x8ffd('0x40'),_0x390dc5[_0x8ffd('0x15')],_0x36f9f1);return BPromise[_0x8ffd('0x27')](_0x390dc5);}else{logger[_0x8ffd('0x29')](_0x8ffd('0x41'),_0x36f9f1);var _0x348d81={'Phone':_0x36f9f1};if(_0x3c6f76[_0x8ffd('0x42')]){if(_0x3c6f76[_0x8ffd('0x42')]==='contact'){logger[_0x8ffd('0x29')](_0x8ffd('0x43'),_0x36f9f1,_0x3c6f76['moduleCreate']);_0x348d81[_0x8ffd('0x44')]=_0x242321!==''?_0x242321:util[_0x8ffd('0x45')](_0x8ffd('0x46'),_0x36f9f1);}else if(_0x3c6f76['moduleCreate']===_0x8ffd('0x17')){logger[_0x8ffd('0x29')](_0x8ffd('0x43'),_0x36f9f1,_0x3c6f76['moduleCreate']);_0x348d81[_0x8ffd('0x44')]=_0x242321!==_0x8ffd('0x47')?_0x242321:util['format'](_0x8ffd('0x46'),_0x36f9f1);_0x348d81[_0x8ffd('0x48')]=_0x8ffd('0x49');}else if(_0x3c6f76[_0x8ffd('0x42')]===_0x8ffd('0x19')){logger['info']('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x36f9f1,_0x3c6f76['moduleCreate']);_0x348d81[_0x8ffd('0x28')]=_0x242321!==_0x8ffd('0x47')?_0x242321:util[_0x8ffd('0x45')](_0x8ffd('0x46'),_0x36f9f1);}else{return null;}}return _0x2361c9[_0x8ffd('0x1f')](_[_0x8ffd('0x4a')](_0x3c6f76[_0x8ffd('0x42')]))[_0x8ffd('0x20')](_0x348d81)['then'](function(_0x2662cd){return BPromise[_0x8ffd('0x27')]({'id':_0x2662cd['id'],'endUserType':_0x3c6f76[_0x8ffd('0x42')]});});}});}function getCustomFields(_0x1c525a,_0x4ad677){var _0x57baf8={};if(_0x1c525a['length']>0x0){_[_0x8ffd('0x4b')](_0x1c525a,function(_0x4ccea7){if(_['includes'](['string',_0x8ffd('0x4c')],_0x4ccea7[_0x8ffd('0x3e')])&&_0x4ccea7['idField']){_0x57baf8[_0x4ccea7[_0x8ffd('0x4d')]]=_0x4ccea7[_0x8ffd('0x4e')][_0x8ffd('0x4f')]();}else if(_0x4ccea7[_0x8ffd('0x3e')]===_0x8ffd('0x50')&&_0x4ccea7[_0x8ffd('0x51')]&&_0x4ccea7[_0x8ffd('0x4d')]){_0x4ad677[_0x4ccea7[_0x8ffd('0x51')]]&&(_0x57baf8[_0x4ccea7[_0x8ffd('0x4d')]]=_0x4ad677[_0x4ccea7[_0x8ffd('0x51')]]['toString']());}else if(_0x4ccea7[_0x8ffd('0x3e')]===_0x8ffd('0x52')&&_0x4ccea7[_0x8ffd('0x53')]&&_0x4ccea7[_0x8ffd('0x53')][_0x8ffd('0x54')]&&_0x4ccea7['idField']){_0x4ad677[_0x4ccea7[_0x8ffd('0x53')][_0x8ffd('0x54')]['toLowerCase']()]&&(_0x57baf8[_0x4ccea7[_0x8ffd('0x4d')]]=_0x4ad677[_0x4ccea7[_0x8ffd('0x53')]['name'][_0x8ffd('0x3f')]()][_0x8ffd('0x4f')]());}});}return _0x57baf8;}function getConnection(_0x27794a){var _0x4d8316=_0x27794a[_0x8ffd('0x55')][_0x8ffd('0x56')](_0x27794a[_0x8ffd('0x57')]);var _0x59f640=new jsforce[(_0x8ffd('0x58'))]({'oauth2':{'loginUrl':_0x27794a['remoteUri']||'https://login.salesforce.com','clientId':_0x27794a[_0x8ffd('0x59')],'clientSecret':_0x27794a[_0x8ffd('0x5a')]}});return _0x59f640[_0x8ffd('0x5b')](_0x27794a[_0x8ffd('0x5c')],_0x4d8316)[_0x8ffd('0x25')](function(){logger['info']('Connection\x20established.');return _0x59f640;});}exports[_0x8ffd('0x5d')]=function(_0x280fa4,_0x23bf81,_0x5a88db,_0x2d854f,_0xab9b34,_0x374c83){var _0x5a2ee3,_0x1595b8,_0x389a2d,_0x3caaee;_0x374c83['serverUrl']=intUtil[_0x8ffd('0x5e')](_0x374c83[_0x8ffd('0x5f')]);_0x374c83[_0x8ffd('0x60')]=intUtil[_0x8ffd('0x5e')](_0x374c83[_0x8ffd('0x60')]);if(_0xab9b34&&_0xab9b34['monitor_format']){logger['info'](_0x8ffd('0x61'),_0x8ffd('0x62'));_0x23bf81[_0x8ffd('0x63')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x374c83[_0x8ffd('0x5f')],_0x23bf81['uniqueid'],md5(_0x23bf81[_0x8ffd('0x64')]));}else{_0x23bf81['recordingURL']='';}return getConnection(_0x374c83)[_0x8ffd('0x25')](function(_0x447cf8){_0x3caaee=_0x447cf8;return getUser(_0x374c83,_0x2d854f[_0x8ffd('0x65')],_0x3caaee);})[_0x8ffd('0x25')](function(_0x1d9ef9){_0x5a2ee3=_0x1d9ef9;return getEndUser(_0x374c83,_0x5a88db,_0x23bf81[_0x8ffd('0x66')],_0x23bf81['calleridnum'],_0x3caaee);})['then'](function(_0x2cc9c6){_0x1595b8=_0x2cc9c6;return getTicket(_0x374c83,_0x5a2ee3,_0x1595b8,_0x5a88db,_0x23bf81,_0x5a88db['Fields'],_0x3caaee,'queue');})[_0x8ffd('0x25')](function(_0x54d252){_0x389a2d=_0x54d252;logger[_0x8ffd('0x29')](_0x8ffd('0x67'),_0x389a2d['id']);logger['info'](_0x8ffd('0x68'),_0x389a2d['id'],_0x2d854f['name'],_0x374c83[_0x8ffd('0x3e')]);switch(_0x374c83[_0x8ffd('0x3e')]){case _0x8ffd('0x69'):emit(util[_0x8ffd('0x45')](_0x8ffd('0x6a'),_0x2d854f[_0x8ffd('0x54')]),_0x8ffd('0x6b'),{'recordId':_0x389a2d['id']});break;case _0x8ffd('0x6c'):emit(util['format'](_0x8ffd('0x6a'),_0x2d854f[_0x8ffd('0x54')]),_0x8ffd('0x6d'),{'uri':util['format'](_0x8ffd('0x6e'),_0x3caaee[_0x8ffd('0x6f')],_0x389a2d['id'])});break;default:logger[_0x8ffd('0x70')]('[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.');}})[_0x8ffd('0x71')](function(_0x346563){logger[_0x8ffd('0x70')]('[QUEUE]',_0x346563);});};exports[_0x8ffd('0x72')]=function(_0x40d47b,_0x542302,_0x3fab6b,_0x45a923,_0x496fb4,_0x2a217d,_0x13937d){var _0x1d2ab2,_0x5dc7b4,_0x22d713,_0x37d080;_0x2a217d[_0x8ffd('0x5f')]=intUtil[_0x8ffd('0x5e')](_0x2a217d[_0x8ffd('0x5f')]);_0x2a217d['remoteUri']=intUtil['stripTrailingSlash'](_0x2a217d['remoteUri']);if(_0x13937d&&_0x13937d['recordingFormat']&&_0x13937d['recordingFormat']!==_0x8ffd('0x73')){logger[_0x8ffd('0x29')](_0x8ffd('0x74'),_0x8ffd('0x62'));_0x542302[_0x8ffd('0x63')]=util[_0x8ffd('0x45')](_0x8ffd('0x75'),_0x2a217d['serverUrl'],_0x542302['uniqueid'],md5(_0x542302[_0x8ffd('0x64')]));}return getConnection(_0x2a217d)[_0x8ffd('0x25')](function(_0x1493c8){_0x37d080=_0x1493c8;return getUser(_0x2a217d,_0x45a923[_0x8ffd('0x65')],_0x37d080);})[_0x8ffd('0x25')](function(_0x3fcbd3){_0x1d2ab2=_0x3fcbd3;return getEndUser(_0x2a217d,_0x3fab6b,_0x542302[_0x8ffd('0x76')],_0x542302[_0x8ffd('0x77')],_0x37d080);})['then'](function(_0x31c3fe){_0x5dc7b4=_0x31c3fe;return getTicket(_0x2a217d,_0x1d2ab2,_0x5dc7b4,_0x3fab6b,_0x542302,_0x3fab6b[_0x8ffd('0x78')],_0x37d080,'outbound');})[_0x8ffd('0x25')](function(_0x31e39a){_0x22d713=_0x31e39a;logger[_0x8ffd('0x29')](_0x8ffd('0x79'),_0x22d713['id']);logger[_0x8ffd('0x29')](_0x8ffd('0x7a'),_0x22d713['id'],_0x45a923['name'],_0x2a217d[_0x8ffd('0x3e')]);switch(_0x2a217d[_0x8ffd('0x3e')]){case _0x8ffd('0x69'):emit(util[_0x8ffd('0x45')](_0x8ffd('0x6a'),_0x45a923['name']),_0x8ffd('0x6b'),{'recordId':_0x22d713['id']});break;case'newTab':emit(util['format'](_0x8ffd('0x6a'),_0x45a923['name']),_0x8ffd('0x6d'),{'uri':util['format'](_0x8ffd('0x6e'),_0x37d080[_0x8ffd('0x6f')],_0x22d713['id'])});break;default:logger[_0x8ffd('0x70')](_0x8ffd('0x74'),_0x8ffd('0x7b'));}})[_0x8ffd('0x71')](function(_0x3445f6){logger[_0x8ffd('0x70')](_0x8ffd('0x74'),_0x3445f6);});};exports['unmanaged']=function(_0x4bebea,_0x2f87da,_0x217683,_0x3b8595,_0x78a263,_0x3ca8b7){var _0x474f1b,_0x1ae8a8,_0x305edb,_0xb24f34;_0x3ca8b7['serverUrl']=intUtil['stripTrailingSlash'](_0x3ca8b7[_0x8ffd('0x5f')]);_0x3ca8b7[_0x8ffd('0x60')]=intUtil['stripTrailingSlash'](_0x3ca8b7[_0x8ffd('0x60')]);if(_0x78a263&&_0x78a263[_0x8ffd('0x7c')]){logger[_0x8ffd('0x29')]('['+_0x2f87da['lastevent'][_0x8ffd('0x7d')]()+']','Recording\x20is\x20enabled!');_0x2f87da[_0x8ffd('0x63')]=util[_0x8ffd('0x45')](_0x8ffd('0x75'),_0x3ca8b7['serverUrl'],_0x2f87da[_0x8ffd('0x64')],md5(_0x2f87da[_0x8ffd('0x64')]));}else{_0x2f87da[_0x8ffd('0x63')]='';}return getConnection(_0x3ca8b7)['then'](function(_0x178a5c){_0xb24f34=_0x178a5c;if(!_['isNil'](_0x3b8595)){return getUser(_0x3ca8b7,_0x3b8595[_0x8ffd('0x54')],_0xb24f34);}else{return getUser(_0x3ca8b7,null,_0xb24f34);}})[_0x8ffd('0x25')](function(_0x5e4cd7){_0x474f1b=_0x5e4cd7;return getEndUser(_0x3ca8b7,_0x217683,_0x2f87da[_0x8ffd('0x66')],_0x2f87da['calleridnum'],_0xb24f34);})['then'](function(_0x3f4fd5){_0x1ae8a8=_0x3f4fd5;return getTicket(_0x3ca8b7,_0x474f1b,_0x1ae8a8,_0x217683,_0x2f87da,_0x217683[_0x8ffd('0x78')],_0xb24f34);})[_0x8ffd('0x25')](function(_0x3ecb3a){_0x305edb=_0x3ecb3a;logger[_0x8ffd('0x29')]('['+_0x2f87da[_0x8ffd('0x7e')][_0x8ffd('0x7d')]()+']\x20Ticket\x20%s\x20created.',_0x305edb['id']);logger[_0x8ffd('0x29')]('['+_0x2f87da[_0x8ffd('0x7e')]['toUpperCase']()+_0x8ffd('0x7f'),_0x3ca8b7['type']);})['catch'](function(_0x4e9525){logger[_0x8ffd('0x70')]('['+_0x2f87da[_0x8ffd('0x7e')]['toUpperCase']()+']',_0x4e9525);});}; \ 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 aeba408..9930dca 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 _0x48f5=['Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s','call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20ServiceNow\x20integration','inspect','lodash','util','md5','ioredis','../../../../config/environment','../../../../config/logger','servicenow','defaults','redis','localhost','GET','sys_user?sysparm_query=user_name%3Dadmin','then','result','length','adminId','sys_id','info','toUpperCase','],\x20getAdminUser\x20crm','catch','message','validateEmail','userEmail','sys_user?sysparm_query=email%3D','],\x20getUser\x20rp\x20obj','],\x20getUser\x20entity','active','true','userId','adminEmail','],\x20getUser\x20crm',']\x20using\x20admin\x20profile','],\x20createEndUser\x20input\x20crm','sys_user?','user','endUserNumber','System','],\x20EndUser\x20schema','endUserId','],\x20getEndUser\x20input\x20crm','],\x20getEndUser\x20crm','],\x20createEndUser\x20crm','error','forEach','string','type','customField','nameField','toLowerCase','content','toString','picklist','idField','variable','Variable','name',']\x20getTicket\x20input\x20crm','outbound','POST','incident','getString','Descriptions','Fields',']\x20POST\x20incident\x20entity\x20schema','ticketId','ticketNumber','number',']\x20getTicket\x20crm','label','?sysparm_query=name%3D','Incident','Incident\x20-\x20','push','Tags','%26sysparm_record_target%3Dincident','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','%26sysparm_record_list%3Dactive%253Dtrue','%255EORDERBYDESCnumber','/nav_to.do?uri=incident.do?sys_id%3D','format','user:%s','emit','trigger:browser:url','username','sysparm_limit=1','sysparm_display_value=true','remoteUri','stripTrailingSlash','serverUrl','%s/api/now/table/','isNil','email','destcalleridnum','callDirection','queue','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]'];(function(_0x4b5ded,_0x539dd8){var _0x2e1a14=function(_0x43e6e3){while(--_0x43e6e3){_0x4b5ded['push'](_0x4b5ded['shift']());}};_0x2e1a14(++_0x539dd8);}(_0x48f5,0x79));var _0x548f=function(_0x172485,_0x5f0b59){_0x172485=_0x172485-0x0;var _0x174dcf=_0x48f5[_0x172485];return _0x174dcf;};'use strict';var _=require(_0x548f('0x0'));var Promise=require('bluebird');var rp=require('request-promise');var util=require(_0x548f('0x1'));var md5=require(_0x548f('0x2'));var Redis=require(_0x548f('0x3'));var intUtil=require('./util');var config=require(_0x548f('0x4'));var logger=require(_0x548f('0x5'))(_0x548f('0x6'));config['redis']=_[_0x548f('0x7')](config[_0x548f('0x8')],{'host':_0x548f('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x548f('0x8')]));function getAdminUser(_0x111e5c,_0x4992e8,_0x2778c2,_0x38ef17,_0x13aae6,_0x3a9595){return new Promise(function(_0x19c14a,_0xe3f9c0){var _0x1c4079={'method':_0x548f('0xa'),'uri':_0x38ef17+_0x548f('0xb')+'&'+_0x13aae6+'&'+_0x3a9595,'auth':_0x4992e8,'json':!![]};return rp(_0x1c4079)[_0x548f('0xc')](function(_0x72931b){if(_0x72931b[_0x548f('0xd')][_0x548f('0xe')]>0x0){_0x2778c2[_0x548f('0xf')]=_0x72931b[_0x548f('0xd')][0x0][_0x548f('0x10')];}logger[_0x548f('0x11')]('['+[_0x111e5c[_0x548f('0x12')]()]+_0x548f('0x13'),_0x2778c2);_0x19c14a(_0x2778c2);})[_0x548f('0x14')](function(_0x409384){logger['error']('['+[_0x111e5c[_0x548f('0x12')]()]+']',_0x409384[_0x548f('0x15')]);_0xe3f9c0(_0x409384['message']);});});}function getUser(_0x5bfbea,_0x3c6101,_0x7b6e1b,_0x2adb56,_0x4fd8af){return function(_0x4b9e55){logger[_0x548f('0x11')]('['+[_0x5bfbea['toUpperCase']()]+'],\x20getUser\x20input\x20crm',_0x4b9e55);return new Promise(function(_0x48895a,_0x4addc2){if(intUtil[_0x548f('0x16')](_0x4b9e55[_0x548f('0x17')])){var _0x374382={'method':'GET','uri':_0x7b6e1b+_0x548f('0x18')+_0x4b9e55[_0x548f('0x17')]+'&'+_0x2adb56+'&'+_0x4fd8af,'auth':_0x3c6101,'json':!![]};logger['info']('['+[_0x5bfbea[_0x548f('0x12')]()]+_0x548f('0x19'),_0x374382);return rp(_0x374382)[_0x548f('0xc')](function(_0x5f2d81){logger[_0x548f('0x11')]('['+[_0x5bfbea[_0x548f('0x12')]()]+_0x548f('0x1a'),_0x5f2d81);if(_0x5f2d81[_0x548f('0xd')][_0x548f('0xe')]>0x0&&String(_0x5f2d81[_0x548f('0xd')][0x0][_0x548f('0x1b')])===_0x548f('0x1c')){_0x4b9e55[_0x548f('0x1d')]=_0x5f2d81['result'][0x0][_0x548f('0x10')];}else{_0x4b9e55[_0x548f('0x1d')]=_0x4b9e55[_0x548f('0xf')];_0x4b9e55[_0x548f('0x17')]=_0x4b9e55[_0x548f('0x1e')];}logger[_0x548f('0x11')]('['+[_0x5bfbea[_0x548f('0x12')]()]+_0x548f('0x1f'),_0x4b9e55);_0x48895a(_0x4b9e55);})[_0x548f('0x14')](function(_0x3c35d1){logger['error']('['+[_0x5bfbea[_0x548f('0x12')]()]+']',_0x3c35d1[_0x548f('0x15')]);_0x4addc2(_0x3c35d1[_0x548f('0x15')]);});}else{logger[_0x548f('0x11')]('['+[_0x5bfbea[_0x548f('0x12')]()]+_0x548f('0x20'));_0x4b9e55[_0x548f('0x1d')]=_0x4b9e55[_0x548f('0xf')];_0x4b9e55[_0x548f('0x17')]=_0x4b9e55[_0x548f('0x1e')];_0x48895a(_0x4b9e55);}});};}function createEndUser(_0x5d6065,_0x2b4f49,_0x84d1a6,_0x31a4a1,_0x4d8846){logger[_0x548f('0x11')]('['+[_0x5d6065[_0x548f('0x12')]()]+_0x548f('0x21'),_0x84d1a6);return new Promise(function(_0x16bfc8,_0x159e23){var _0x31b29c={'method':'POST','uri':_0x31a4a1+_0x548f('0x22')+_0x4d8846,'body':{'user_name':_0x84d1a6['endUserNumber'],'roles':_0x548f('0x23'),'first_name':_0x84d1a6[_0x548f('0x24')],'active':_0x548f('0x1c'),'date_format':_0x548f('0x25'),'phone':_0x84d1a6[_0x548f('0x24')]},'auth':_0x2b4f49,'json':!![]};return rp(_0x31b29c)['then'](function(_0x16b6d2){logger[_0x548f('0x11')]('['+[_0x5d6065[_0x548f('0x12')]()]+_0x548f('0x26'),_0x16b6d2[_0x548f('0xd')]);_0x84d1a6[_0x548f('0x27')]=_0x16b6d2['result'][_0x548f('0x10')];_0x16bfc8(_0x84d1a6);})[_0x548f('0x14')](function(_0xbc1a7){logger['error']('['+[_0x5d6065[_0x548f('0x12')]()]+']',_0xbc1a7[_0x548f('0x15')]);_0x159e23(_0xbc1a7['message']);});});}function getEndUser(_0x4a08af,_0xd65773,_0x2edcbe,_0x54f2c1,_0x4f7adf){return function(_0x29a85e){logger['info']('['+[_0x4a08af['toUpperCase']()]+_0x548f('0x28'),_0x29a85e);return new Promise(function(_0x1c3570,_0x5ca31e){var _0x14469d={'method':_0x548f('0xa'),'uri':_0x2edcbe+'sys_user?sysparm_query=phone%3D'+_0x29a85e[_0x548f('0x24')]+'&'+_0x54f2c1+'&'+_0x4f7adf,'auth':_0xd65773,'json':!![]};return rp(_0x14469d)[_0x548f('0xc')](function(_0x3c4dc6){if(_0x3c4dc6[_0x548f('0xd')][_0x548f('0xe')]>0x0){_0x29a85e[_0x548f('0x27')]=_0x3c4dc6[_0x548f('0xd')][0x0]['sys_id'];logger[_0x548f('0x11')]('['+[_0x4a08af[_0x548f('0x12')]()]+_0x548f('0x29'),_0x29a85e);_0x1c3570(_0x29a85e);}else{return createEndUser(_0x4a08af,_0xd65773,_0x29a85e,_0x2edcbe,_0x54f2c1)['then'](function(_0x59fa93){logger[_0x548f('0x11')]('['+[_0x4a08af[_0x548f('0x12')]()]+_0x548f('0x2a'),_0x59fa93);_0x1c3570(_0x59fa93);});}})[_0x548f('0x14')](function(_0x37cadf){logger[_0x548f('0x2b')]('['+[_0x4a08af[_0x548f('0x12')]()]+']',_0x37cadf[_0x548f('0x15')]);_0x5ca31e(_0x37cadf['message']);});});};}function getCustomFields(_0x42d977,_0x2e08e7){var _0x3bc3d4={};if(_0x42d977[_0x548f('0xe')]>0x0){_[_0x548f('0x2c')](_0x42d977,function(_0x2d3cb8){if(_['includes']([_0x548f('0x2d'),'picklist'],_0x2d3cb8[_0x548f('0x2e')])&&_0x2d3cb8['nameField']&&!_0x2d3cb8[_0x548f('0x2f')]){_0x3bc3d4[_0x2d3cb8[_0x548f('0x30')][_0x548f('0x31')]()]=_0x2d3cb8[_0x548f('0x32')][_0x548f('0x33')]();}else if(_['includes']([_0x548f('0x2d'),_0x548f('0x34')],_0x2d3cb8[_0x548f('0x2e')])&&_0x2d3cb8[_0x548f('0x35')]&&_0x2d3cb8[_0x548f('0x2f')]){_0x3bc3d4[_0x2d3cb8[_0x548f('0x35')][_0x548f('0x31')]()]=_0x2d3cb8[_0x548f('0x32')][_0x548f('0x33')]();}else if(_0x2d3cb8['type']===_0x548f('0x36')&&_0x2d3cb8['variableName']&&_0x2d3cb8[_0x548f('0x35')]&&_0x2d3cb8[_0x548f('0x2f')]){_0x3bc3d4[_0x2d3cb8[_0x548f('0x35')][_0x548f('0x31')]()]=_0x2e08e7[_0x2d3cb8['variableName']][_0x548f('0x33')]();}else if(_0x2d3cb8['type']==='customVariable'&&_0x2d3cb8[_0x548f('0x37')]&&_0x2d3cb8[_0x548f('0x37')][_0x548f('0x38')]&&_0x2d3cb8[_0x548f('0x35')]&&_0x2d3cb8['customField']){_0x3bc3d4[_0x2d3cb8['idField'][_0x548f('0x31')]()]=_0x2e08e7[_0x2d3cb8[_0x548f('0x37')]['name'][_0x548f('0x31')]()][_0x548f('0x33')]();}});}return _0x3bc3d4;}function getTicket(_0x1911d9,_0x52a359,_0x365669,_0x347077,_0x52ed3c,_0x1a79a9){return function(_0x923d23){logger[_0x548f('0x11')]('['+[_0x1911d9[_0x548f('0x12')]()]+_0x548f('0x39'),_0x923d23);return new Promise(function(_0x4a6cd7,_0x5c3324){var _0x5cf56a=_0x1911d9[_0x548f('0x31')]()===_0x548f('0x3a')?_0x923d23['userId']:_0x923d23[_0x548f('0x27')];var _0x9edf08={'method':_0x548f('0x3b'),'uri':_0x365669+_0x548f('0x3c')+'?'+_0x1a79a9,'body':Object['assign']({},{'active':_0x548f('0x1c'),'caller_id':_0x5cf56a,'assigned_to':_0x923d23['userId'],'short_description':intUtil['getString'](_0x347077['Subjects'],_0x52ed3c,'\x20'),'description':intUtil[_0x548f('0x3d')](_0x347077[_0x548f('0x3e')],_0x52ed3c,'\x0a')},getCustomFields(_0x347077[_0x548f('0x3f')],_0x52ed3c)),'auth':_0x52a359,'json':!![]};return rp(_0x9edf08)[_0x548f('0xc')](function(_0x557443){logger[_0x548f('0x11')]('['+[_0x1911d9[_0x548f('0x12')]()]+_0x548f('0x40'),_0x557443[_0x548f('0xd')]);_0x923d23[_0x548f('0x41')]=_0x557443[_0x548f('0xd')][_0x548f('0x10')];_0x923d23[_0x548f('0x42')]=_0x557443[_0x548f('0xd')][_0x548f('0x43')];logger[_0x548f('0x11')]('['+[_0x1911d9[_0x548f('0x12')]()]+_0x548f('0x44'),_0x923d23);_0x4a6cd7(_0x923d23);})[_0x548f('0x14')](function(_0x469711){logger[_0x548f('0x2b')]('['+[_0x1911d9[_0x548f('0x12')]()]+']',_0x469711[_0x548f('0x15')]);_0x5c3324(_0x469711[_0x548f('0x15')]);});});};}function createRemoteTag(_0x3316b0,_0x144556,_0x1da7ec,_0x38fac3){return new Promise(function(_0x2bd4f4,_0x387f77){var _0x1f26f2={'method':_0x548f('0x3b'),'uri':_0x1da7ec+_0x548f('0x45')+'?'+_0x38fac3,'body':{'short_description':_0x3316b0,'global':!![],'active':!![],'name':_0x3316b0},'auth':_0x144556,'json':!![]};return rp(_0x1f26f2)['then'](function(_0x2ef889){var _0x189b85=_0x2ef889[_0x548f('0xd')][_0x548f('0x10')];_0x2bd4f4(_0x189b85);});});}function getRemoteTag(_0x471b96,_0x3e8b36,_0x32f3cc,_0x4d9888,_0x5709c5){return new Promise(function(_0x4b7307,_0xdc5284){var _0x30531f={'method':_0x548f('0xa'),'uri':_0x32f3cc+_0x548f('0x45')+_0x548f('0x46')+_0x471b96+'&'+_0x4d9888,'auth':_0x3e8b36,'json':!![]};return rp(_0x30531f)[_0x548f('0xc')](function(_0xeb273f){if(_0xeb273f['result'][_0x548f('0xe')]>0x0){var _0x579bf4=_0xeb273f[_0x548f('0xd')][0x0][_0x548f('0x10')];_0x4b7307(_0x579bf4);}else{return createRemoteTag(_0x471b96,_0x3e8b36,_0x32f3cc,_0x4d9888)['then'](function(_0x4e63ea){_0x4b7307(_0x4e63ea);});}});});}function assignTagToIncident(_0x4caf02,_0x17ef8c,_0x4bc7b1,_0x40b694,_0x39c8e8){return new Promise(function(_0x19d253,_0x14e04b){var _0x5d1e1b={'method':'POST','uri':_0x4bc7b1+'label_entry'+'?'+_0x39c8e8,'body':{'label':_0x4caf02,'table':_0x548f('0x3c'),'id_type':_0x548f('0x47'),'table_key':_0x40b694[_0x548f('0x41')],'title':_0x548f('0x48')+_0x40b694['ticketNumber'],'id_display':_0x40b694['ticketNumber']},'auth':_0x17ef8c,'json':!![]};return rp(_0x5d1e1b)[_0x548f('0xc')](function(_0x336f6a){_0x19d253();})['catch'](function(){_0x19d253();});});}function manageTags(_0x2b083f,_0x33e159,_0xd29344,_0x9553af,_0x1a0620,_0x52223e,_0x4ba161){return new Promise(function(_0x399133,_0x505b91){var _0x139b8b=[];_0x33e159[_0x548f('0x2c')](function(_0x1e7242){_0x139b8b[_0x548f('0x49')](getRemoteTag(_0x1e7242,_0xd29344,_0x9553af,_0x52223e,_0x4ba161));});return Promise['all'](_0x139b8b)[_0x548f('0xc')](function(_0x6fd528){if(_0x6fd528[_0x548f('0xe')]){logger[_0x548f('0x11')]('['+[_0x2b083f[_0x548f('0x12')]()]+']\x20arrayPromises:\x20IDs\x20in\x20table\x20label',_0x6fd528);var _0x3da611=[];_0x6fd528[_0x548f('0x2c')](function(_0x2e8ae2){_0x3da611[_0x548f('0x49')](assignTagToIncident(_0x2e8ae2,_0xd29344,_0x9553af,_0x1a0620,_0x52223e));});return Promise['all'](_0x3da611)['then'](function(){_0x399133();})[_0x548f('0x14')](function(){_0x399133();});}else{_0x399133();}});});}function getTags(_0x27fa62,_0x5c1540,_0x45a95f,_0x40b717,_0x1a4c2c,_0x1b372f){return function(_0x16e2b4){return new Promise(function(_0x34cfe3,_0x2f94e5){var _0xa713f7=[];var _0xb214d6=_0x40b717[_0x548f('0x4a')];if(_0xb214d6&&_0xb214d6[_0x548f('0xe')]>0x0){_0xa713f7=_['map'](_0xb214d6,_0x548f('0x38'));}if(_0xa713f7['length']>0x0){return manageTags(_0x27fa62,_0xa713f7,_0x5c1540,_0x45a95f,_0x16e2b4,_0x1a4c2c,_0x1b372f)[_0x548f('0xc')](function(){_0x34cfe3(_0x16e2b4);});}else{_0x34cfe3(_0x16e2b4);}});};}function emit(_0x2c27b3,_0xe3d8f7,_0x19680b){var _0x36e082=_0x548f('0x4b')+_0x548f('0x4c')+_0x548f('0x4d')+_0x548f('0x4e');var _0x4c59ce={'uri':_0x2c27b3+_0x548f('0x4f')+_0x19680b+_0x36e082};io['to'](util[_0x548f('0x50')](_0x548f('0x51'),_0xe3d8f7))[_0x548f('0x52')](_0x548f('0x53'),_0x4c59ce);}exports['cs']=function(_0x53d09a,_0x81d7ed,_0x3055dc,_0x5d81bf,_0x582cd1,_0x14a855,_0x5e24dc,_0x15fabe){var _0x449b7c={};var _0x2b10c1={'user':_0x14a855[_0x548f('0x54')],'pass':_0x14a855['password']};var _0x35581e=_0x548f('0x55');var _0xd43daf=_0x548f('0x56');_0x14a855[_0x548f('0x57')]=intUtil[_0x548f('0x58')](_0x14a855[_0x548f('0x57')]);_0x14a855['serverUrl']=intUtil[_0x548f('0x58')](_0x14a855[_0x548f('0x59')]);var _0x290928=util[_0x548f('0x50')](_0x548f('0x5a'),_0x14a855[_0x548f('0x57')]);_0x449b7c['userEmail']=!_[_0x548f('0x5b')](_0x5d81bf)?_0x5d81bf[_0x548f('0x5c')]:null;_0x449b7c[_0x548f('0x1e')]=_0x14a855[_0x548f('0x5c')];_0x449b7c[_0x548f('0x24')]=_0x15fabe[_0x548f('0x31')]()===_0x548f('0x3a')?_0x81d7ed[_0x548f('0x5d')]:_0x81d7ed['calleridnum'];_0x449b7c[_0x548f('0x5e')]=_0x15fabe===_0x548f('0x5f')||_0x15fabe===_0x548f('0x60')?'queue':_0x548f('0x3a');var _0x452e88=util[_0x548f('0x50')](_0x548f('0x61'),_0x14a855['serverUrl'],_0x81d7ed['uniqueid'],md5(_0x81d7ed[_0x548f('0x62')]));if(_0x582cd1&&_0x582cd1[_0x548f('0x63')]){logger[_0x548f('0x11')](_0x548f('0x64'),_0x548f('0x65'));_0x81d7ed[_0x548f('0x66')]=_0x452e88;}else if(_0x5e24dc&&_0x5e24dc[_0x548f('0x67')]&&_0x5e24dc[_0x548f('0x67')]!==_0x548f('0x68')){logger['info'](_0x548f('0x69'),_0x548f('0x65'));_0x81d7ed[_0x548f('0x66')]=_0x452e88;}else{_0x81d7ed['recordingURL']='';}return getAdminUser(_0x15fabe,_0x2b10c1,_0x449b7c,_0x290928,_0xd43daf,_0x35581e)[_0x548f('0xc')](getUser(_0x15fabe,_0x2b10c1,_0x290928,_0xd43daf,_0x35581e))[_0x548f('0xc')](getEndUser(_0x15fabe,_0x2b10c1,_0x290928,_0xd43daf,_0x35581e))[_0x548f('0xc')](getTicket(_0x15fabe,_0x2b10c1,_0x290928,_0x3055dc,_0x81d7ed,_0xd43daf))[_0x548f('0xc')](function(_0x8c110c){logger[_0x548f('0x11')](util[_0x548f('0x50')](_0x548f('0x6a'),_0x8c110c[_0x548f('0x41')]));logger['info'](util[_0x548f('0x50')](_0x548f('0x6b'),_0x15fabe));if(_0x15fabe!==_0x548f('0x60')){logger['info']('['+[_0x15fabe[_0x548f('0x12')]()]+']',_0x548f('0x6c'));emit(_0x14a855[_0x548f('0x57')],_0x5d81bf[_0x548f('0x38')],_0x8c110c['ticketId']);}})[_0x548f('0x14')](function(_0x4d2466){logger[_0x548f('0x2b')]('['+[_0x15fabe['toUpperCase']()]+_0x548f('0x6d'),util[_0x548f('0x6e')](_0x4d2466,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x1aa7=['Incident\x20-\x20','ticketNumber','forEach','all','push','Tags','map','%26sysparm_record_target%3Dincident','%26sysparm_record_list%3Dactive%253Dtrue','%255EORDERBYDESCnumber','format','user:%s','emit','trigger:browser:url','sysparm_limit=1','sysparm_display_value=true','remoteUri','stripTrailingSlash','serverUrl','%s/api/now/table/','email','destcalleridnum','queue','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s','call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20ServiceNow\x20integration','inspect','lodash','bluebird','request-promise','util','md5','ioredis','./util','../../../../config/logger','servicenow','redis','defaults','socket.io-emitter','GET','then','result','length','adminId','sys_id','info','toUpperCase','],\x20getAdminUser\x20crm','catch','error','message','validateEmail','userEmail','],\x20getUser\x20rp\x20obj','],\x20getUser\x20entity','active','true','userId','adminEmail',']\x20using\x20admin\x20profile','POST','endUserNumber','user','System','],\x20EndUser\x20schema','endUserId','],\x20getEndUser\x20input\x20crm','sys_user?sysparm_query=phone%3D','],\x20getEndUser\x20crm','],\x20createEndUser\x20crm','includes','string','picklist','type','customField','nameField','toLowerCase','content','toString','idField','variable','variableName','customVariable','Variable','name','outbound','incident','getString','Subjects','Descriptions','Fields',']\x20POST\x20incident\x20entity\x20schema',']\x20getTicket\x20crm','label_entry','Incident','ticketId'];(function(_0x4ff09b,_0x53f67d){var _0x3f5c2e=function(_0x124592){while(--_0x124592){_0x4ff09b['push'](_0x4ff09b['shift']());}};_0x3f5c2e(++_0x53f67d);}(_0x1aa7,0xfc));var _0x71aa=function(_0x83bc9a,_0x352c31){_0x83bc9a=_0x83bc9a-0x0;var _0x18c885=_0x1aa7[_0x83bc9a];return _0x18c885;};'use strict';var _=require(_0x71aa('0x0'));var Promise=require(_0x71aa('0x1'));var rp=require(_0x71aa('0x2'));var util=require(_0x71aa('0x3'));var md5=require(_0x71aa('0x4'));var Redis=require(_0x71aa('0x5'));var intUtil=require(_0x71aa('0x6'));var config=require('../../../../config/environment');var logger=require(_0x71aa('0x7'))(_0x71aa('0x8'));config[_0x71aa('0x9')]=_[_0x71aa('0xa')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x71aa('0xb'))(new Redis(config['redis']));function getAdminUser(_0x3e5fc9,_0x44a962,_0x5a380c,_0x411291,_0x374aaf,_0x5c9183){return new Promise(function(_0xea42e9,_0xc2c317){var _0x10304e={'method':_0x71aa('0xc'),'uri':_0x411291+'sys_user?sysparm_query=user_name%3Dadmin'+'&'+_0x374aaf+'&'+_0x5c9183,'auth':_0x44a962,'json':!![]};return rp(_0x10304e)[_0x71aa('0xd')](function(_0x43055e){if(_0x43055e[_0x71aa('0xe')][_0x71aa('0xf')]>0x0){_0x5a380c[_0x71aa('0x10')]=_0x43055e[_0x71aa('0xe')][0x0][_0x71aa('0x11')];}logger[_0x71aa('0x12')]('['+[_0x3e5fc9[_0x71aa('0x13')]()]+_0x71aa('0x14'),_0x5a380c);_0xea42e9(_0x5a380c);})[_0x71aa('0x15')](function(_0x4c17b2){logger[_0x71aa('0x16')]('['+[_0x3e5fc9[_0x71aa('0x13')]()]+']',_0x4c17b2[_0x71aa('0x17')]);_0xc2c317(_0x4c17b2[_0x71aa('0x17')]);});});}function getUser(_0x748300,_0x4b5d53,_0x44ced2,_0x21e372,_0x4c3423){return function(_0x307b2e){logger[_0x71aa('0x12')]('['+[_0x748300[_0x71aa('0x13')]()]+'],\x20getUser\x20input\x20crm',_0x307b2e);return new Promise(function(_0x48f0d6,_0x2de364){if(intUtil[_0x71aa('0x18')](_0x307b2e[_0x71aa('0x19')])){var _0x454004={'method':_0x71aa('0xc'),'uri':_0x44ced2+'sys_user?sysparm_query=email%3D'+_0x307b2e['userEmail']+'&'+_0x21e372+'&'+_0x4c3423,'auth':_0x4b5d53,'json':!![]};logger[_0x71aa('0x12')]('['+[_0x748300[_0x71aa('0x13')]()]+_0x71aa('0x1a'),_0x454004);return rp(_0x454004)[_0x71aa('0xd')](function(_0x59b89d){logger['info']('['+[_0x748300[_0x71aa('0x13')]()]+_0x71aa('0x1b'),_0x59b89d);if(_0x59b89d['result'][_0x71aa('0xf')]>0x0&&String(_0x59b89d['result'][0x0][_0x71aa('0x1c')])===_0x71aa('0x1d')){_0x307b2e[_0x71aa('0x1e')]=_0x59b89d[_0x71aa('0xe')][0x0][_0x71aa('0x11')];}else{_0x307b2e[_0x71aa('0x1e')]=_0x307b2e[_0x71aa('0x10')];_0x307b2e[_0x71aa('0x19')]=_0x307b2e[_0x71aa('0x1f')];}logger[_0x71aa('0x12')]('['+[_0x748300[_0x71aa('0x13')]()]+'],\x20getUser\x20crm',_0x307b2e);_0x48f0d6(_0x307b2e);})[_0x71aa('0x15')](function(_0x25c8d7){logger['error']('['+[_0x748300[_0x71aa('0x13')]()]+']',_0x25c8d7[_0x71aa('0x17')]);_0x2de364(_0x25c8d7[_0x71aa('0x17')]);});}else{logger[_0x71aa('0x12')]('['+[_0x748300['toUpperCase']()]+_0x71aa('0x20'));_0x307b2e[_0x71aa('0x1e')]=_0x307b2e[_0x71aa('0x10')];_0x307b2e[_0x71aa('0x19')]=_0x307b2e[_0x71aa('0x1f')];_0x48f0d6(_0x307b2e);}});};}function createEndUser(_0x5a6d5e,_0x193aef,_0x3d8eb4,_0x2bbe3d,_0x49a87a){logger[_0x71aa('0x12')]('['+[_0x5a6d5e[_0x71aa('0x13')]()]+'],\x20createEndUser\x20input\x20crm',_0x3d8eb4);return new Promise(function(_0x5d3eda,_0x58f26e){var _0x44a00e={'method':_0x71aa('0x21'),'uri':_0x2bbe3d+'sys_user?'+_0x49a87a,'body':{'user_name':_0x3d8eb4[_0x71aa('0x22')],'roles':_0x71aa('0x23'),'first_name':_0x3d8eb4[_0x71aa('0x22')],'active':'true','date_format':_0x71aa('0x24'),'phone':_0x3d8eb4['endUserNumber']},'auth':_0x193aef,'json':!![]};return rp(_0x44a00e)[_0x71aa('0xd')](function(_0x551379){logger['info']('['+[_0x5a6d5e[_0x71aa('0x13')]()]+_0x71aa('0x25'),_0x551379[_0x71aa('0xe')]);_0x3d8eb4[_0x71aa('0x26')]=_0x551379[_0x71aa('0xe')][_0x71aa('0x11')];_0x5d3eda(_0x3d8eb4);})[_0x71aa('0x15')](function(_0x444c3a){logger[_0x71aa('0x16')]('['+[_0x5a6d5e[_0x71aa('0x13')]()]+']',_0x444c3a[_0x71aa('0x17')]);_0x58f26e(_0x444c3a[_0x71aa('0x17')]);});});}function getEndUser(_0x5b5eff,_0x283edd,_0x4a4f39,_0x3a69f0,_0x5af4be){return function(_0x3f70a9){logger[_0x71aa('0x12')]('['+[_0x5b5eff[_0x71aa('0x13')]()]+_0x71aa('0x27'),_0x3f70a9);return new Promise(function(_0x4861fe,_0x2f98ef){var _0x2a2ded={'method':_0x71aa('0xc'),'uri':_0x4a4f39+_0x71aa('0x28')+_0x3f70a9['endUserNumber']+'&'+_0x3a69f0+'&'+_0x5af4be,'auth':_0x283edd,'json':!![]};return rp(_0x2a2ded)[_0x71aa('0xd')](function(_0x3cd930){if(_0x3cd930['result']['length']>0x0){_0x3f70a9[_0x71aa('0x26')]=_0x3cd930[_0x71aa('0xe')][0x0][_0x71aa('0x11')];logger[_0x71aa('0x12')]('['+[_0x5b5eff['toUpperCase']()]+_0x71aa('0x29'),_0x3f70a9);_0x4861fe(_0x3f70a9);}else{return createEndUser(_0x5b5eff,_0x283edd,_0x3f70a9,_0x4a4f39,_0x3a69f0)[_0x71aa('0xd')](function(_0x4884bb){logger[_0x71aa('0x12')]('['+[_0x5b5eff[_0x71aa('0x13')]()]+_0x71aa('0x2a'),_0x4884bb);_0x4861fe(_0x4884bb);});}})[_0x71aa('0x15')](function(_0x237d9c){logger['error']('['+[_0x5b5eff[_0x71aa('0x13')]()]+']',_0x237d9c[_0x71aa('0x17')]);_0x2f98ef(_0x237d9c[_0x71aa('0x17')]);});});};}function getCustomFields(_0x18f634,_0x17b91a){var _0x4e30f={};if(_0x18f634['length']>0x0){_['forEach'](_0x18f634,function(_0x4322da){if(_[_0x71aa('0x2b')]([_0x71aa('0x2c'),_0x71aa('0x2d')],_0x4322da[_0x71aa('0x2e')])&&_0x4322da['nameField']&&!_0x4322da[_0x71aa('0x2f')]){_0x4e30f[_0x4322da[_0x71aa('0x30')][_0x71aa('0x31')]()]=_0x4322da[_0x71aa('0x32')][_0x71aa('0x33')]();}else if(_['includes']([_0x71aa('0x2c'),_0x71aa('0x2d')],_0x4322da[_0x71aa('0x2e')])&&_0x4322da[_0x71aa('0x34')]&&_0x4322da[_0x71aa('0x2f')]){_0x4e30f[_0x4322da[_0x71aa('0x34')][_0x71aa('0x31')]()]=_0x4322da[_0x71aa('0x32')]['toString']();}else if(_0x4322da['type']===_0x71aa('0x35')&&_0x4322da[_0x71aa('0x36')]&&_0x4322da[_0x71aa('0x34')]&&_0x4322da['customField']){_0x4e30f[_0x4322da[_0x71aa('0x34')][_0x71aa('0x31')]()]=_0x17b91a[_0x4322da[_0x71aa('0x36')]][_0x71aa('0x33')]();}else if(_0x4322da['type']===_0x71aa('0x37')&&_0x4322da[_0x71aa('0x38')]&&_0x4322da['Variable'][_0x71aa('0x39')]&&_0x4322da[_0x71aa('0x34')]&&_0x4322da[_0x71aa('0x2f')]){_0x4e30f[_0x4322da[_0x71aa('0x34')]['toLowerCase']()]=_0x17b91a[_0x4322da[_0x71aa('0x38')][_0x71aa('0x39')]['toLowerCase']()][_0x71aa('0x33')]();}});}return _0x4e30f;}function getTicket(_0x565793,_0x193166,_0xf2b024,_0x4ac934,_0x5d7d66,_0x1e1328){return function(_0x3bd36e){logger[_0x71aa('0x12')]('['+[_0x565793[_0x71aa('0x13')]()]+']\x20getTicket\x20input\x20crm',_0x3bd36e);return new Promise(function(_0x24a297,_0x536d5f){var _0x5df053=_0x565793[_0x71aa('0x31')]()===_0x71aa('0x3a')?_0x3bd36e[_0x71aa('0x1e')]:_0x3bd36e[_0x71aa('0x26')];var _0x51f2e5={'method':_0x71aa('0x21'),'uri':_0xf2b024+_0x71aa('0x3b')+'?'+_0x1e1328,'body':Object['assign']({},{'active':_0x71aa('0x1d'),'caller_id':_0x5df053,'assigned_to':_0x3bd36e[_0x71aa('0x1e')],'short_description':intUtil[_0x71aa('0x3c')](_0x4ac934[_0x71aa('0x3d')],_0x5d7d66,'\x20'),'description':intUtil[_0x71aa('0x3c')](_0x4ac934[_0x71aa('0x3e')],_0x5d7d66,'\x0a')},getCustomFields(_0x4ac934[_0x71aa('0x3f')],_0x5d7d66)),'auth':_0x193166,'json':!![]};return rp(_0x51f2e5)[_0x71aa('0xd')](function(_0x5c84e1){logger[_0x71aa('0x12')]('['+[_0x565793[_0x71aa('0x13')]()]+_0x71aa('0x40'),_0x5c84e1[_0x71aa('0xe')]);_0x3bd36e['ticketId']=_0x5c84e1[_0x71aa('0xe')][_0x71aa('0x11')];_0x3bd36e['ticketNumber']=_0x5c84e1[_0x71aa('0xe')]['number'];logger['info']('['+[_0x565793[_0x71aa('0x13')]()]+_0x71aa('0x41'),_0x3bd36e);_0x24a297(_0x3bd36e);})[_0x71aa('0x15')](function(_0x207c57){logger['error']('['+[_0x565793[_0x71aa('0x13')]()]+']',_0x207c57[_0x71aa('0x17')]);_0x536d5f(_0x207c57[_0x71aa('0x17')]);});});};}function createRemoteTag(_0x134b82,_0x4507ae,_0x1c18de,_0x3f69e1){return new Promise(function(_0x27097f,_0x5b32fa){var _0x2ad6b8={'method':'POST','uri':_0x1c18de+'label'+'?'+_0x3f69e1,'body':{'short_description':_0x134b82,'global':!![],'active':!![],'name':_0x134b82},'auth':_0x4507ae,'json':!![]};return rp(_0x2ad6b8)[_0x71aa('0xd')](function(_0x2f18a1){var _0x2bc60f=_0x2f18a1[_0x71aa('0xe')]['sys_id'];_0x27097f(_0x2bc60f);});});}function getRemoteTag(_0x33c026,_0x38af0e,_0x550e6e,_0x546906,_0x2178fb){return new Promise(function(_0x5383b9,_0x5b3409){var _0x5f5405={'method':_0x71aa('0xc'),'uri':_0x550e6e+'label'+'?sysparm_query=name%3D'+_0x33c026+'&'+_0x546906,'auth':_0x38af0e,'json':!![]};return rp(_0x5f5405)[_0x71aa('0xd')](function(_0x198588){if(_0x198588[_0x71aa('0xe')][_0x71aa('0xf')]>0x0){var _0x18072c=_0x198588[_0x71aa('0xe')][0x0]['sys_id'];_0x5383b9(_0x18072c);}else{return createRemoteTag(_0x33c026,_0x38af0e,_0x550e6e,_0x546906)[_0x71aa('0xd')](function(_0x5e767d){_0x5383b9(_0x5e767d);});}});});}function assignTagToIncident(_0x3c965e,_0x1c12cb,_0x335002,_0x57d715,_0x4fa45e){return new Promise(function(_0x2953d8,_0x45034b){var _0x54ee5e={'method':_0x71aa('0x21'),'uri':_0x335002+_0x71aa('0x42')+'?'+_0x4fa45e,'body':{'label':_0x3c965e,'table':_0x71aa('0x3b'),'id_type':_0x71aa('0x43'),'table_key':_0x57d715[_0x71aa('0x44')],'title':_0x71aa('0x45')+_0x57d715[_0x71aa('0x46')],'id_display':_0x57d715['ticketNumber']},'auth':_0x1c12cb,'json':!![]};return rp(_0x54ee5e)[_0x71aa('0xd')](function(_0x5b37dc){_0x2953d8();})[_0x71aa('0x15')](function(){_0x2953d8();});});}function manageTags(_0xde1648,_0x49e24c,_0x1348b5,_0x1a0aa4,_0x37d6d0,_0x1fb743,_0x82918a){return new Promise(function(_0x564ef8,_0x492e64){var _0x48a42e=[];_0x49e24c[_0x71aa('0x47')](function(_0x5f3484){_0x48a42e['push'](getRemoteTag(_0x5f3484,_0x1348b5,_0x1a0aa4,_0x1fb743,_0x82918a));});return Promise[_0x71aa('0x48')](_0x48a42e)['then'](function(_0x160076){if(_0x160076[_0x71aa('0xf')]){logger[_0x71aa('0x12')]('['+[_0xde1648[_0x71aa('0x13')]()]+']\x20arrayPromises:\x20IDs\x20in\x20table\x20label',_0x160076);var _0x4c76c4=[];_0x160076['forEach'](function(_0x1d1c3a){_0x4c76c4[_0x71aa('0x49')](assignTagToIncident(_0x1d1c3a,_0x1348b5,_0x1a0aa4,_0x37d6d0,_0x1fb743));});return Promise[_0x71aa('0x48')](_0x4c76c4)[_0x71aa('0xd')](function(){_0x564ef8();})[_0x71aa('0x15')](function(){_0x564ef8();});}else{_0x564ef8();}});});}function getTags(_0x5a656d,_0x1ac4dd,_0x1995ba,_0x4524a9,_0x2aef75,_0x467b1a){return function(_0x1bca05){return new Promise(function(_0x2b9dd8,_0x9aa480){var _0x343341=[];var _0x410716=_0x4524a9[_0x71aa('0x4a')];if(_0x410716&&_0x410716['length']>0x0){_0x343341=_[_0x71aa('0x4b')](_0x410716,_0x71aa('0x39'));}if(_0x343341[_0x71aa('0xf')]>0x0){return manageTags(_0x5a656d,_0x343341,_0x1ac4dd,_0x1995ba,_0x1bca05,_0x2aef75,_0x467b1a)['then'](function(){_0x2b9dd8(_0x1bca05);});}else{_0x2b9dd8(_0x1bca05);}});};}function emit(_0x561f50,_0x2a62f6,_0x3a891e){var _0x44c1db=_0x71aa('0x4c')+'%26sysparm_record_row%3D1%26sysparm_record_rows%3D39'+_0x71aa('0x4d')+_0x71aa('0x4e');var _0x544149={'uri':_0x561f50+'/nav_to.do?uri=incident.do?sys_id%3D'+_0x3a891e+_0x44c1db};io['to'](util[_0x71aa('0x4f')](_0x71aa('0x50'),_0x2a62f6))[_0x71aa('0x51')](_0x71aa('0x52'),_0x544149);}exports['cs']=function(_0x409db6,_0x1a5344,_0x251510,_0x59fcb6,_0x4a1af2,_0x23d16c,_0x4a2c49,_0x84794){var _0x219df2={};var _0x523b25={'user':_0x23d16c['username'],'pass':_0x23d16c['password']};var _0x5283a4=_0x71aa('0x53');var _0x50c512=_0x71aa('0x54');_0x23d16c[_0x71aa('0x55')]=intUtil[_0x71aa('0x56')](_0x23d16c['remoteUri']);_0x23d16c[_0x71aa('0x57')]=intUtil[_0x71aa('0x56')](_0x23d16c[_0x71aa('0x57')]);var _0x353f7e=util[_0x71aa('0x4f')](_0x71aa('0x58'),_0x23d16c[_0x71aa('0x55')]);_0x219df2[_0x71aa('0x19')]=!_['isNil'](_0x59fcb6)?_0x59fcb6[_0x71aa('0x59')]:null;_0x219df2[_0x71aa('0x1f')]=_0x23d16c[_0x71aa('0x59')];_0x219df2[_0x71aa('0x22')]=_0x84794[_0x71aa('0x31')]()===_0x71aa('0x3a')?_0x1a5344[_0x71aa('0x5a')]:_0x1a5344['calleridnum'];_0x219df2['callDirection']=_0x84794===_0x71aa('0x5b')||_0x84794===_0x71aa('0x5c')?'queue':_0x71aa('0x3a');var _0x23ca77=util['format'](_0x71aa('0x5d'),_0x23d16c['serverUrl'],_0x1a5344[_0x71aa('0x5e')],md5(_0x1a5344[_0x71aa('0x5e')]));if(_0x4a1af2&&_0x4a1af2[_0x71aa('0x5f')]){logger[_0x71aa('0x12')](_0x71aa('0x60'),_0x71aa('0x61'));_0x1a5344[_0x71aa('0x62')]=_0x23ca77;}else if(_0x4a2c49&&_0x4a2c49[_0x71aa('0x63')]&&_0x4a2c49[_0x71aa('0x63')]!==_0x71aa('0x64')){logger[_0x71aa('0x12')](_0x71aa('0x65'),_0x71aa('0x61'));_0x1a5344['recordingURL']=_0x23ca77;}else{_0x1a5344[_0x71aa('0x62')]='';}return getAdminUser(_0x84794,_0x523b25,_0x219df2,_0x353f7e,_0x50c512,_0x5283a4)[_0x71aa('0xd')](getUser(_0x84794,_0x523b25,_0x353f7e,_0x50c512,_0x5283a4))[_0x71aa('0xd')](getEndUser(_0x84794,_0x523b25,_0x353f7e,_0x50c512,_0x5283a4))[_0x71aa('0xd')](getTicket(_0x84794,_0x523b25,_0x353f7e,_0x251510,_0x1a5344,_0x50c512))[_0x71aa('0xd')](function(_0x4162e0){logger[_0x71aa('0x12')](util[_0x71aa('0x4f')](_0x71aa('0x66'),_0x4162e0['ticketId']));logger[_0x71aa('0x12')](util[_0x71aa('0x4f')](_0x71aa('0x67'),_0x84794));if(_0x84794!==_0x71aa('0x5c')){logger[_0x71aa('0x12')]('['+[_0x84794[_0x71aa('0x13')]()]+']',_0x71aa('0x68'));emit(_0x23d16c[_0x71aa('0x55')],_0x59fcb6[_0x71aa('0x39')],_0x4162e0[_0x71aa('0x44')]);}})[_0x71aa('0x15')](function(_0x7dbc05){logger[_0x71aa('0x16')]('['+[_0x84794['toUpperCase']()]+_0x71aa('0x69'),util[_0x71aa('0x6a')](_0x7dbc05,{'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 4f51bae..491101e 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 _0xb98c=['then','find','entry_list','name_value_list','value','Agent\x20found!','resolve','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','user_id','Searching\x20enduser\x20with\x20phone','Contacts','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','length','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','first_name','','Caller\x20-\x20%s','Enduser\x20created.','[HTTP]','merge','map','type','nameField','customField','toLowerCase','string','variable','custom_fields','customVariable','Variable','login','username','password','sessionID','Account\x20%d\x20is\x20not\x20valid','set_relationship','remoteUri','stripTrailingSlash','serverUrl','%s/service/v4_1/rest.php','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','The\x20User\x20ID\x20is:','calleridname','calleridnum','Fields','Inbound','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','users','contacts','version','charAt','trigger:browser:url','outbound','uri','recordingFormat','none','destcalleridnum','The\x20Enduser\x20ID\x20is:','Outbound','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','catch','error','monitor_format','toUpperCase','lastevent','lodash','request-promise','bluebird','util','ioredis','../../../../config/logger','sugarcrm','defaults','socket.io-emitter','redis','POST','emit','info','Subjects','assigned_user_id','created_by','getString','Descriptions','date_start','toISOString','slice','replace','duration_hours','duration_minutes','parent_type','parent_name','name','direction','forEach','push','idField','variableName','set_entry','JSON','Calls','apiKey','toString','base64','get_server_info','stringify','isNil','Getting\x20agent\x20with\x20name','get_entry_list','Employees','format','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','user_name'];(function(_0x3984d4,_0x8f273a){var _0x37e62b=function(_0x375611){while(--_0x375611){_0x3984d4['push'](_0x3984d4['shift']());}};_0x37e62b(++_0x8f273a);}(_0xb98c,0x1bd));var _0xcb98=function(_0x47a7d0,_0x4e182d){_0x47a7d0=_0x47a7d0-0x0;var _0xb9bd08=_0xb98c[_0x47a7d0];return _0xb9bd08;};'use strict';var _=require(_0xcb98('0x0'));var rp=require(_0xcb98('0x1'));var BPromise=require(_0xcb98('0x2'));var md5=require('md5');var util=require(_0xcb98('0x3'));var Redis=require(_0xcb98('0x4'));var intUtil=require('./util');var config=require('../../../../config/environment');var logger=require(_0xcb98('0x5'))(_0xcb98('0x6'));config['redis']=_[_0xcb98('0x7')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0xcb98('0x8'))(new Redis(config[_0xcb98('0x9')]));var def={'method':_0xcb98('0xa'),'json':!![]};function emit(_0x36c55a,_0x5cac7a,_0x1c3313){io['to'](_0x36c55a)[_0xcb98('0xb')](_0x5cac7a,_0x1c3313);}function getTicket(_0x48a4ad,_0x126ba7,_0x317082,_0x45bc0e,_0x2bb128,_0xcfb65c,_0x1c26b2,_0x5a95d3){logger[_0xcb98('0xc')]('Creating\x20new\x20ticket...');var _0x365776=new Date();var _0x5a9278=[{'name':'name','value':intUtil['getString'](_0x45bc0e[_0xcb98('0xd')],_0x2bb128,'\x20')},{'name':_0xcb98('0xe'),'value':_0x126ba7['id']},{'name':_0xcb98('0xf'),'value':_0x126ba7['id']},{'name':'description','value':intUtil[_0xcb98('0x10')](_0x45bc0e[_0xcb98('0x11')],_0x2bb128,'\x0a')},{'name':_0xcb98('0x12'),'value':_0x365776[_0xcb98('0x13')]()[_0xcb98('0x14')](0x0,0x13)[_0xcb98('0x15')]('T','\x20')},{'name':_0xcb98('0x16'),'value':'0'},{'name':_0xcb98('0x17'),'value':'15'},{'name':'parent_id','value':_0x317082['id']},{'name':_0xcb98('0x18'),'value':'Contacts'},{'name':_0xcb98('0x19'),'value':_0x317082[_0xcb98('0x1a')]},{'name':_0xcb98('0x1b'),'value':_0x5a95d3}];if(_0xcfb65c['length']){_[_0xcb98('0x1c')](_0xcfb65c,function(_0x54e3f6){if(_0x2bb128[_0x54e3f6['variableName']]){_0x5a9278[_0xcb98('0x1d')]({'name':_0x54e3f6[_0xcb98('0x1e')],'value':_0x2bb128[_0x54e3f6[_0xcb98('0x1f')]]});}});}return request({'form':{'method':_0xcb98('0x20'),'input_type':_0xcb98('0x21'),'response_type':_0xcb98('0x21'),'rest_data':JSON['stringify']({'session':_0x1c26b2['id'],'module_name':_0xcb98('0x22'),'name_value_list':_0x5a9278})}});}function getAuth(_0x2143f7){return util['format']('Basic\x20%s',new Buffer(_0x2143f7[_0xcb98('0x23')]+':X')[_0xcb98('0x24')](_0xcb98('0x25')));}function getServerInfo(_0x4e5a9f){return request({'form':{'method':_0xcb98('0x26'),'input_type':'JSON','response_type':_0xcb98('0x21'),'rest_data':JSON[_0xcb98('0x27')]({'session':_0x4e5a9f['id']})}});}function getUser(_0x318c7d,_0x36dd86,_0x214048){if(!_[_0xcb98('0x28')](_0x36dd86)){logger['info'](_0xcb98('0x29'),_0x36dd86);return request({'form':{'method':_0xcb98('0x2a'),'input_type':_0xcb98('0x21'),'response_type':'JSON','rest_data':JSON[_0xcb98('0x27')]({'session':_0x214048['id'],'module_name':_0xcb98('0x2b'),'query':util[_0xcb98('0x2c')](_0xcb98('0x2d'),_0x36dd86),'order_by':'','offset':'0','select_fields':['id','name',_0xcb98('0x2e')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0xcb98('0x2f')](function(_0x10502f){if(_0x10502f['entry_list']['length']){var _0x3bcd19=_[_0xcb98('0x30')](_0x10502f[_0xcb98('0x31')],function(_0x4acc7e){return _0x4acc7e[_0xcb98('0x32')]['user_name'][_0xcb98('0x33')]===_0x36dd86;});if(_0x3bcd19){logger['info'](_0xcb98('0x34'));return BPromise[_0xcb98('0x35')]({'id':_0x3bcd19[_0xcb98('0x32')]['id'][_0xcb98('0x33')],'name':_0x3bcd19[_0xcb98('0x32')]['name'][_0xcb98('0x33')]});}}logger[_0xcb98('0xc')](_0xcb98('0x36'));return BPromise[_0xcb98('0x35')]({'id':_0x214048['name_value_list']['user_id'][_0xcb98('0x33')],'name':_0x214048[_0xcb98('0x32')][_0xcb98('0x2e')]['value']});});}else{logger[_0xcb98('0xc')](_0xcb98('0x37'));return BPromise[_0xcb98('0x35')]({'id':_0x214048[_0xcb98('0x32')][_0xcb98('0x38')][_0xcb98('0x33')],'name':_0x214048[_0xcb98('0x32')][_0xcb98('0x2e')][_0xcb98('0x33')]});}}function getEndUser(_0x2da607,_0x48fcc7,_0x1c2b9a,_0x53a51c){logger[_0xcb98('0xc')](_0xcb98('0x39'),_0x1c2b9a);return request({'form':{'method':_0xcb98('0x2a'),'input_type':_0xcb98('0x21'),'response_type':_0xcb98('0x21'),'rest_data':JSON[_0xcb98('0x27')]({'session':_0x53a51c['id'],'module_name':_0xcb98('0x3a'),'query':util[_0xcb98('0x2c')](_0xcb98('0x3b'),_0x1c2b9a),'order_by':'','offset':'0','select_fields':['id',_0xcb98('0x1a'),_0xcb98('0x3c')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0xcb98('0x2f')](function(_0xf46fab){if(_0xf46fab[_0xcb98('0x31')][_0xcb98('0x3d')]){var _0x3f429c=_[_0xcb98('0x30')](_0xf46fab[_0xcb98('0x31')],function(_0x48f193){return _0x48f193[_0xcb98('0x32')][_0xcb98('0x3c')][_0xcb98('0x33')]===_0x1c2b9a;});if(_0x3f429c){logger['info'](_0xcb98('0x3e'));return BPromise['resolve']({'id':_0x3f429c['name_value_list']['id'][_0xcb98('0x33')],'name':_0x3f429c[_0xcb98('0x32')][_0xcb98('0x1a')][_0xcb98('0x33')],'phone':_0x3f429c[_0xcb98('0x32')]['phone_home'][_0xcb98('0x33')]});}}else{logger['info'](_0xcb98('0x3f'));return request({'form':{'method':'set_entry','input_type':_0xcb98('0x21'),'response_type':_0xcb98('0x21'),'rest_data':JSON[_0xcb98('0x27')]({'session':_0x53a51c['id'],'module_name':_0xcb98('0x3a'),'name_value_list':[{'name':_0xcb98('0x40'),'value':_0x48fcc7!==_0xcb98('0x41')?_0x48fcc7:util['format'](_0xcb98('0x42'),_0x1c2b9a)},{'name':_0xcb98('0x3c'),'value':_0x1c2b9a}]})}})[_0xcb98('0x2f')](function(_0x2b8dd6){logger[_0xcb98('0xc')](_0xcb98('0x43'));return BPromise[_0xcb98('0x35')]({'id':_0x2b8dd6['id'],'name':_0x2b8dd6['entry_list'][_0xcb98('0x40')][_0xcb98('0x33')],'phone':_0x2b8dd6[_0xcb98('0x31')][_0xcb98('0x3c')][_0xcb98('0x33')]});});}});}function request(_0x3b51e6){logger['debug'](_0xcb98('0x44'),JSON[_0xcb98('0x27')](_0x3b51e6));return rp(_[_0xcb98('0x45')](def,_0x3b51e6));}function getTags(_0x20d216,_0x11201e){var _0x3ebf27=[];if(_0x20d216&&_0x20d216['length']>0x0){_0x3ebf27=_[_0xcb98('0x46')](_0x20d216,_0x11201e);}return _0x3ebf27;}function getCustomFields(_0x23c2bc,_0x212627){var _0x40ca5e=[];var _0x5ce64={'custom_fields':[]};if(_0x23c2bc[_0xcb98('0x3d')]>0x0){_[_0xcb98('0x1c')](_0x23c2bc,function(_0x2c1004){if(_0x2c1004[_0xcb98('0x47')]==='string'&&_0x2c1004[_0xcb98('0x48')]&&!_0x2c1004[_0xcb98('0x49')]){_0x5ce64[_0x2c1004[_0xcb98('0x48')][_0xcb98('0x4a')]()]=_0x2c1004['content']['toString']();}else if(_0x2c1004['type']===_0xcb98('0x4b')&&_0x2c1004[_0xcb98('0x1e')]&&_0x2c1004[_0xcb98('0x49')]){_0x5ce64['custom_fields'][_0xcb98('0x1d')]({'id':_0x2c1004['idField'],'value':_0x2c1004['content'][_0xcb98('0x24')]()});}else if(_0x2c1004['type']===_0xcb98('0x4c')&&_0x2c1004['variableName']&&_0x2c1004['idField']&&_0x2c1004[_0xcb98('0x49')]){_0x212627[_0x2c1004[_0xcb98('0x1f')]]&&_0x5ce64[_0xcb98('0x4d')][_0xcb98('0x1d')]({'id':_0x2c1004[_0xcb98('0x1e')],'value':_0x212627[_0x2c1004[_0xcb98('0x1f')]][_0xcb98('0x24')]()});}else if(_0x2c1004[_0xcb98('0x47')]===_0xcb98('0x4e')&&_0x2c1004[_0xcb98('0x4f')]&&_0x2c1004[_0xcb98('0x4f')][_0xcb98('0x1a')]&&_0x2c1004[_0xcb98('0x1e')]&&_0x2c1004[_0xcb98('0x49')]){_0x212627[_0x2c1004[_0xcb98('0x4f')]['name'][_0xcb98('0x4a')]()]&&_0x5ce64[_0xcb98('0x4d')][_0xcb98('0x1d')]({'id':_0x2c1004[_0xcb98('0x1e')],'value':_0x212627[_0x2c1004['Variable']['name']['toLowerCase']()][_0xcb98('0x24')]()});}});}return _0x5ce64;}function getConnection(_0x505c8c){return request({'method':_0xcb98('0xa'),'form':{'method':_0xcb98('0x50'),'input_type':_0xcb98('0x21'),'response_type':_0xcb98('0x21'),'rest_data':JSON[_0xcb98('0x27')]({'user_auth':{'user_name':_0x505c8c[_0xcb98('0x51')],'password':_0x505c8c[_0xcb98('0x52')],'encryption':'PLAIN'},'application':'xCALLY\x20Motion\x20integration'})}})[_0xcb98('0x2f')](function(_0x1c87c5){var _0x245350=_0x1c87c5;if(_0x245350['id']){def[_0xcb98('0x53')]=_0x245350['id'];return BPromise['resolve'](_0x245350);}else{throw new Error(util[_0xcb98('0x2c')](_0xcb98('0x54'),_0x505c8c['id']));}});}function setRelationship(_0x4b6501,_0x34b12f,_0x279213,_0x3f2993){return request({'form':{'method':_0xcb98('0x55'),'input_type':_0xcb98('0x21'),'response_type':_0xcb98('0x21'),'rest_data':JSON[_0xcb98('0x27')]({'session':_0x4b6501['id'],'module_name':_0xcb98('0x22'),'module_id':_0x279213['id'],'link_field_name':_0x3f2993,'related_ids':[_0x34b12f['id']],'name_value_list':[],'delete':0x0})}});}exports['queue']=function(_0x46ef20,_0x2cc0a6,_0x265aed,_0x47ec59,_0x2b6455,_0x23e2ba){var _0x585f51,_0x2ee430,_0x1b56f3,_0x4ecaea;_0x23e2ba[_0xcb98('0x56')]=intUtil[_0xcb98('0x57')](_0x23e2ba[_0xcb98('0x56')]);_0x23e2ba[_0xcb98('0x58')]=intUtil[_0xcb98('0x57')](_0x23e2ba[_0xcb98('0x58')]);def['uri']=util['format'](_0xcb98('0x59'),_0x23e2ba[_0xcb98('0x56')]);if(_0x2b6455&&_0x2b6455['monitor_format']){logger[_0xcb98('0xc')](_0xcb98('0x5a'),_0xcb98('0x5b'));_0x2cc0a6[_0xcb98('0x5c')]=util[_0xcb98('0x2c')](_0xcb98('0x5d'),_0x23e2ba[_0xcb98('0x58')],_0x2cc0a6[_0xcb98('0x5e')],md5(_0x2cc0a6['uniqueid']));}else{_0x2cc0a6[_0xcb98('0x5c')]='';}return getConnection(_0x23e2ba)[_0xcb98('0x2f')](function(_0x39daba){_0x4ecaea=_0x39daba;return getUser(_0x23e2ba,_0x47ec59[_0xcb98('0x1a')],_0x4ecaea);})[_0xcb98('0x2f')](function(_0x4351ea){_0x585f51=_0x4351ea;logger['info'](_0xcb98('0x5f'),_0x585f51['id']);return getEndUser(_0x23e2ba,_0x2cc0a6[_0xcb98('0x60')],_0x2cc0a6[_0xcb98('0x61')],_0x4ecaea);})[_0xcb98('0x2f')](function(_0x37a2ab){_0x2ee430=_0x37a2ab;logger[_0xcb98('0xc')]('The\x20Enduser\x20ID\x20is:',_0x2ee430['id']);return getTicket(_0x23e2ba,_0x585f51,_0x2ee430,_0x265aed,_0x2cc0a6,_0x265aed[_0xcb98('0x62')],_0x4ecaea,_0xcb98('0x63'));})[_0xcb98('0x2f')](function(_0x58b9ec){_0x1b56f3=_0x58b9ec;logger[_0xcb98('0xc')](_0xcb98('0x64'));logger['info'](_0xcb98('0x65'),_0x1b56f3['id']);return setRelationship(_0x4ecaea,_0x585f51,_0x1b56f3,_0xcb98('0x66'));})['then'](function(){return setRelationship(_0x4ecaea,_0x2ee430,_0x1b56f3,_0xcb98('0x67'));})[_0xcb98('0x2f')](function(){return getServerInfo(_0x4ecaea);})[_0xcb98('0x2f')](function(_0x1c1c99){var _0x4ae73c=parseInt(_0x1c1c99[_0xcb98('0x68')][_0xcb98('0x69')](0x0));var _0x1907f2=util[_0xcb98('0x2c')]('%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s',_0x23e2ba[_0xcb98('0x56')],_0x1b56f3['id']);if(_0x4ae73c>0x6){_0x1907f2=util[_0xcb98('0x2c')]('%s/#bwc/index.php?module=Calls&action=EditView&record=%s',_0x23e2ba[_0xcb98('0x56')],_0x1b56f3['id']);}logger['info'](_0xcb98('0x5a'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xcb98('0x2c')]('user:%s',_0x47ec59[_0xcb98('0x1a')]),_0xcb98('0x6a'),{'uri':_0x1907f2});})['catch'](function(_0x34b927){logger['error']('[QUEUE]',JSON[_0xcb98('0x27')](_0x34b927));});};exports[_0xcb98('0x6b')]=function(_0x368de9,_0x599704,_0x364317,_0x125926,_0x4e143a,_0x4b6885,_0x5cc3dc){var _0x3df2ab,_0x32a219,_0xd79d3d,_0x438e48;_0x4b6885[_0xcb98('0x56')]=intUtil[_0xcb98('0x57')](_0x4b6885['remoteUri']);_0x4b6885[_0xcb98('0x58')]=intUtil[_0xcb98('0x57')](_0x4b6885['serverUrl']);def[_0xcb98('0x6c')]=util['format'](_0xcb98('0x59'),_0x4b6885[_0xcb98('0x56')]);if(_0x5cc3dc&&_0x5cc3dc[_0xcb98('0x6d')]&&_0x5cc3dc[_0xcb98('0x6d')]!==_0xcb98('0x6e')){logger['info']('[OUTBOUND]','Recording\x20is\x20enabled!');_0x599704[_0xcb98('0x5c')]=util[_0xcb98('0x2c')](_0xcb98('0x5d'),_0x4b6885[_0xcb98('0x58')],_0x599704[_0xcb98('0x5e')],md5(_0x599704[_0xcb98('0x5e')]));}return getConnection(_0x4b6885)[_0xcb98('0x2f')](function(_0x3f6993){_0x438e48=_0x3f6993;return getUser(_0x4b6885,_0x125926[_0xcb98('0x1a')],_0x438e48);})['then'](function(_0x31b541){_0x3df2ab=_0x31b541;logger[_0xcb98('0xc')](_0xcb98('0x5f'),_0x3df2ab['id']);return getEndUser(_0x4b6885,_0x599704['destcalleridname'],_0x599704[_0xcb98('0x6f')],_0x438e48);})[_0xcb98('0x2f')](function(_0x3395b7){_0x32a219=_0x3395b7;logger[_0xcb98('0xc')](_0xcb98('0x70'),_0x32a219['id']);return getTicket(_0x4b6885,_0x3df2ab,_0x32a219,_0x364317,_0x599704,_0x364317['Fields'],_0x438e48,_0xcb98('0x71'));})[_0xcb98('0x2f')](function(_0x1e2466){_0xd79d3d=_0x1e2466;logger[_0xcb98('0xc')](_0xcb98('0x64'));logger['info'](_0xcb98('0x65'),_0xd79d3d['id']);return setRelationship(_0x438e48,_0x3df2ab,_0xd79d3d,'users');})[_0xcb98('0x2f')](function(){return setRelationship(_0x438e48,_0x32a219,_0xd79d3d,_0xcb98('0x67'));})[_0xcb98('0x2f')](function(){return getServerInfo(_0x438e48);})[_0xcb98('0x2f')](function(_0x5ec2b5){var _0x56d52c=parseInt(_0x5ec2b5[_0xcb98('0x68')][_0xcb98('0x69')](0x0));var _0x24ac33=util[_0xcb98('0x2c')](_0xcb98('0x72'),_0x4b6885[_0xcb98('0x56')],_0xd79d3d['id']);if(_0x56d52c>0x6){_0x24ac33=util[_0xcb98('0x2c')](_0xcb98('0x73'),_0x4b6885[_0xcb98('0x56')],_0xd79d3d['id']);}logger[_0xcb98('0xc')]('[OUTBOUND]',_0xcb98('0x74'));emit(util['format'](_0xcb98('0x75'),_0x125926[_0xcb98('0x1a')]),'trigger:browser:url',{'uri':_0x24ac33});})[_0xcb98('0x76')](function(_0x1aa7e0){logger[_0xcb98('0x77')]('[OUTBOUND]',JSON['stringify'](_0x1aa7e0));});};exports['unmanaged']=function(_0x4a417f,_0x34feac,_0x11969d,_0x3fcce9,_0x1c9286,_0x260fc8){var _0x549ca6,_0x2f0351,_0x3718f9,_0x41b8ba;_0x260fc8[_0xcb98('0x56')]=intUtil[_0xcb98('0x57')](_0x260fc8['remoteUri']);_0x260fc8[_0xcb98('0x58')]=intUtil[_0xcb98('0x57')](_0x260fc8[_0xcb98('0x58')]);def[_0xcb98('0x6c')]=util[_0xcb98('0x2c')](_0xcb98('0x59'),_0x260fc8[_0xcb98('0x56')]);if(_0x1c9286&&_0x1c9286[_0xcb98('0x78')]){logger[_0xcb98('0xc')]('['+_0x34feac['lastevent'][_0xcb98('0x79')]()+']',_0xcb98('0x5b'));_0x34feac[_0xcb98('0x5c')]=util[_0xcb98('0x2c')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x260fc8[_0xcb98('0x58')],_0x34feac[_0xcb98('0x5e')],md5(_0x34feac[_0xcb98('0x5e')]));}else{_0x34feac[_0xcb98('0x5c')]='';}return getConnection(_0x260fc8)['then'](function(_0x3016e3){_0x41b8ba=_0x3016e3;if(!_[_0xcb98('0x28')](_0x3fcce9)){return getUser(_0x260fc8,_0x3fcce9[_0xcb98('0x1a')],_0x41b8ba);}else{return getUser(_0x260fc8,null,_0x41b8ba);}})[_0xcb98('0x2f')](function(_0x2d3418){_0x549ca6=_0x2d3418;logger[_0xcb98('0xc')](_0xcb98('0x5f'),_0x549ca6['id']);return getEndUser(_0x260fc8,_0x34feac['calleridname'],_0x34feac[_0xcb98('0x61')],_0x41b8ba);})[_0xcb98('0x2f')](function(_0x4793b4){_0x2f0351=_0x4793b4;logger['info'](_0xcb98('0x70'),_0x2f0351['id']);return getTicket(_0x260fc8,_0x549ca6,_0x2f0351,_0x11969d,_0x34feac,_0x11969d[_0xcb98('0x62')],_0x41b8ba,'Inbound');})[_0xcb98('0x2f')](function(_0x9e15b8){_0x3718f9=_0x9e15b8;logger[_0xcb98('0xc')](_0xcb98('0x64'));logger[_0xcb98('0xc')](_0xcb98('0x65'),_0x3718f9['id']);return setRelationship(_0x41b8ba,_0x549ca6,_0x3718f9,_0xcb98('0x66'));})[_0xcb98('0x2f')](function(){return setRelationship(_0x41b8ba,_0x2f0351,_0x3718f9,_0xcb98('0x67'));})[_0xcb98('0x2f')](function(){return getServerInfo(_0x41b8ba);})[_0xcb98('0x76')](function(_0x250b54){logger['error']('['+_0x34feac[_0xcb98('0x7a')]['toUpperCase']()+']',JSON[_0xcb98('0x27')](_0x250b54));});}; \ No newline at end of file +var _0xe624=['type','custom_fields','variable','customVariable','Variable','login','username','password','PLAIN','sessionID','Account\x20%d\x20is\x20not\x20valid','set_relationship','remoteUri','serverUrl','stripTrailingSlash','%s/service/v4_1/rest.php','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','The\x20User\x20ID\x20is:','calleridnum','The\x20Enduser\x20ID\x20is:','Inbound','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','users','contacts','version','charAt','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','catch','error','uri','recordingFormat','none','[OUTBOUND]','destcalleridnum','Outbound','monitor_format','lastevent','Fields','lodash','request-promise','bluebird','md5','util','./util','../../../../config/environment','../../../../config/logger','sugarcrm','redis','localhost','socket.io-emitter','POST','emit','info','Creating\x20new\x20ticket...','getString','Subjects','created_by','description','Descriptions','slice','replace','duration_hours','duration_minutes','parent_id','Contacts','parent_name','name','forEach','variableName','push','idField','set_entry','JSON','stringify','Calls','Basic\x20%s','apiKey','toString','base64','get_server_info','get_entry_list','Employees','format','user_name','then','entry_list','length','find','name_value_list','Agent\x20found!','resolve','value','user_id','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','first_name','','Caller\x20-\x20%s','Enduser\x20created.','debug','merge','map','string','nameField','customField','toLowerCase'];(function(_0x1a03d0,_0x590a31){var _0x2857b2=function(_0x23dbf9){while(--_0x23dbf9){_0x1a03d0['push'](_0x1a03d0['shift']());}};_0x2857b2(++_0x590a31);}(_0xe624,0x194));var _0x4e62=function(_0x333798,_0x9f6561){_0x333798=_0x333798-0x0;var _0x389f4e=_0xe624[_0x333798];return _0x389f4e;};'use strict';var _=require(_0x4e62('0x0'));var rp=require(_0x4e62('0x1'));var BPromise=require(_0x4e62('0x2'));var md5=require(_0x4e62('0x3'));var util=require(_0x4e62('0x4'));var Redis=require('ioredis');var intUtil=require(_0x4e62('0x5'));var config=require(_0x4e62('0x6'));var logger=require(_0x4e62('0x7'))(_0x4e62('0x8'));config['redis']=_['defaults'](config[_0x4e62('0x9')],{'host':_0x4e62('0xa'),'port':0x18eb});var io=require(_0x4e62('0xb'))(new Redis(config[_0x4e62('0x9')]));var def={'method':_0x4e62('0xc'),'json':!![]};function emit(_0x168c5a,_0x4767a8,_0x2ead85){io['to'](_0x168c5a)[_0x4e62('0xd')](_0x4767a8,_0x2ead85);}function getTicket(_0x318f48,_0x1b43da,_0x3722de,_0x387801,_0x128b6b,_0x1ee121,_0xff7557,_0x202f16){logger[_0x4e62('0xe')](_0x4e62('0xf'));var _0x160d64=new Date();var _0x19d4bc=[{'name':'name','value':intUtil[_0x4e62('0x10')](_0x387801[_0x4e62('0x11')],_0x128b6b,'\x20')},{'name':'assigned_user_id','value':_0x1b43da['id']},{'name':_0x4e62('0x12'),'value':_0x1b43da['id']},{'name':_0x4e62('0x13'),'value':intUtil['getString'](_0x387801[_0x4e62('0x14')],_0x128b6b,'\x0a')},{'name':'date_start','value':_0x160d64['toISOString']()[_0x4e62('0x15')](0x0,0x13)[_0x4e62('0x16')]('T','\x20')},{'name':_0x4e62('0x17'),'value':'0'},{'name':_0x4e62('0x18'),'value':'15'},{'name':_0x4e62('0x19'),'value':_0x3722de['id']},{'name':'parent_type','value':_0x4e62('0x1a')},{'name':_0x4e62('0x1b'),'value':_0x3722de[_0x4e62('0x1c')]},{'name':'direction','value':_0x202f16}];if(_0x1ee121['length']){_[_0x4e62('0x1d')](_0x1ee121,function(_0x561fe0){if(_0x128b6b[_0x561fe0[_0x4e62('0x1e')]]){_0x19d4bc[_0x4e62('0x1f')]({'name':_0x561fe0[_0x4e62('0x20')],'value':_0x128b6b[_0x561fe0[_0x4e62('0x1e')]]});}});}return request({'form':{'method':_0x4e62('0x21'),'input_type':_0x4e62('0x22'),'response_type':_0x4e62('0x22'),'rest_data':JSON[_0x4e62('0x23')]({'session':_0xff7557['id'],'module_name':_0x4e62('0x24'),'name_value_list':_0x19d4bc})}});}function getAuth(_0x4d8ce9){return util['format'](_0x4e62('0x25'),new Buffer(_0x4d8ce9[_0x4e62('0x26')]+':X')[_0x4e62('0x27')](_0x4e62('0x28')));}function getServerInfo(_0x532ed0){return request({'form':{'method':_0x4e62('0x29'),'input_type':_0x4e62('0x22'),'response_type':_0x4e62('0x22'),'rest_data':JSON[_0x4e62('0x23')]({'session':_0x532ed0['id']})}});}function getUser(_0x1aab2b,_0x5de442,_0x409705){if(!_['isNil'](_0x5de442)){logger[_0x4e62('0xe')]('Getting\x20agent\x20with\x20name',_0x5de442);return request({'form':{'method':_0x4e62('0x2a'),'input_type':_0x4e62('0x22'),'response_type':'JSON','rest_data':JSON[_0x4e62('0x23')]({'session':_0x409705['id'],'module_name':_0x4e62('0x2b'),'query':util[_0x4e62('0x2c')]('INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200',_0x5de442),'order_by':'','offset':'0','select_fields':['id',_0x4e62('0x1c'),_0x4e62('0x2d')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x4e62('0x2e')](function(_0x3c242c){if(_0x3c242c[_0x4e62('0x2f')][_0x4e62('0x30')]){var _0x50f8fe=_[_0x4e62('0x31')](_0x3c242c[_0x4e62('0x2f')],function(_0x2d0092){return _0x2d0092[_0x4e62('0x32')][_0x4e62('0x2d')]['value']===_0x5de442;});if(_0x50f8fe){logger[_0x4e62('0xe')](_0x4e62('0x33'));return BPromise[_0x4e62('0x34')]({'id':_0x50f8fe[_0x4e62('0x32')]['id'][_0x4e62('0x35')],'name':_0x50f8fe[_0x4e62('0x32')][_0x4e62('0x1c')][_0x4e62('0x35')]});}}logger['info']('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0x4e62('0x34')]({'id':_0x409705[_0x4e62('0x32')][_0x4e62('0x36')][_0x4e62('0x35')],'name':_0x409705[_0x4e62('0x32')][_0x4e62('0x2d')][_0x4e62('0x35')]});});}else{logger['info'](_0x4e62('0x37'));return BPromise[_0x4e62('0x34')]({'id':_0x409705['name_value_list'][_0x4e62('0x36')][_0x4e62('0x35')],'name':_0x409705[_0x4e62('0x32')]['user_name'][_0x4e62('0x35')]});}}function getEndUser(_0x188b53,_0x26bac2,_0x4d3001,_0x563e68){logger[_0x4e62('0xe')](_0x4e62('0x38'),_0x4d3001);return request({'form':{'method':_0x4e62('0x2a'),'input_type':_0x4e62('0x22'),'response_type':'JSON','rest_data':JSON['stringify']({'session':_0x563e68['id'],'module_name':_0x4e62('0x1a'),'query':util[_0x4e62('0x2c')](_0x4e62('0x39'),_0x4d3001),'order_by':'','offset':'0','select_fields':['id',_0x4e62('0x1c'),_0x4e62('0x3a')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x4e62('0x2e')](function(_0xa64d27){if(_0xa64d27[_0x4e62('0x2f')]['length']){var _0x298dff=_['find'](_0xa64d27['entry_list'],function(_0x58d489){return _0x58d489['name_value_list'][_0x4e62('0x3a')][_0x4e62('0x35')]===_0x4d3001;});if(_0x298dff){logger[_0x4e62('0xe')](_0x4e62('0x3b'));return BPromise['resolve']({'id':_0x298dff[_0x4e62('0x32')]['id'][_0x4e62('0x35')],'name':_0x298dff[_0x4e62('0x32')]['name'][_0x4e62('0x35')],'phone':_0x298dff[_0x4e62('0x32')]['phone_home'][_0x4e62('0x35')]});}}else{logger[_0x4e62('0xe')](_0x4e62('0x3c'));return request({'form':{'method':_0x4e62('0x21'),'input_type':_0x4e62('0x22'),'response_type':_0x4e62('0x22'),'rest_data':JSON[_0x4e62('0x23')]({'session':_0x563e68['id'],'module_name':_0x4e62('0x1a'),'name_value_list':[{'name':_0x4e62('0x3d'),'value':_0x26bac2!==_0x4e62('0x3e')?_0x26bac2:util['format'](_0x4e62('0x3f'),_0x4d3001)},{'name':_0x4e62('0x3a'),'value':_0x4d3001}]})}})['then'](function(_0x129a80){logger[_0x4e62('0xe')](_0x4e62('0x40'));return BPromise[_0x4e62('0x34')]({'id':_0x129a80['id'],'name':_0x129a80['entry_list'][_0x4e62('0x3d')]['value'],'phone':_0x129a80[_0x4e62('0x2f')][_0x4e62('0x3a')][_0x4e62('0x35')]});});}});}function request(_0x97a9e7){logger[_0x4e62('0x41')]('[HTTP]',JSON[_0x4e62('0x23')](_0x97a9e7));return rp(_[_0x4e62('0x42')](def,_0x97a9e7));}function getTags(_0x2edf7c,_0x16ab57){var _0x16ecc8=[];if(_0x2edf7c&&_0x2edf7c[_0x4e62('0x30')]>0x0){_0x16ecc8=_[_0x4e62('0x43')](_0x2edf7c,_0x16ab57);}return _0x16ecc8;}function getCustomFields(_0x5d6973,_0x651c8d){var _0x6f4dda=[];var _0x2571f2={'custom_fields':[]};if(_0x5d6973[_0x4e62('0x30')]>0x0){_[_0x4e62('0x1d')](_0x5d6973,function(_0x30bdc4){if(_0x30bdc4['type']===_0x4e62('0x44')&&_0x30bdc4[_0x4e62('0x45')]&&!_0x30bdc4[_0x4e62('0x46')]){_0x2571f2[_0x30bdc4[_0x4e62('0x45')][_0x4e62('0x47')]()]=_0x30bdc4['content'][_0x4e62('0x27')]();}else if(_0x30bdc4[_0x4e62('0x48')]===_0x4e62('0x44')&&_0x30bdc4[_0x4e62('0x20')]&&_0x30bdc4[_0x4e62('0x46')]){_0x2571f2[_0x4e62('0x49')][_0x4e62('0x1f')]({'id':_0x30bdc4['idField'],'value':_0x30bdc4['content'][_0x4e62('0x27')]()});}else if(_0x30bdc4['type']===_0x4e62('0x4a')&&_0x30bdc4[_0x4e62('0x1e')]&&_0x30bdc4[_0x4e62('0x20')]&&_0x30bdc4[_0x4e62('0x46')]){_0x651c8d[_0x30bdc4['variableName']]&&_0x2571f2['custom_fields'][_0x4e62('0x1f')]({'id':_0x30bdc4[_0x4e62('0x20')],'value':_0x651c8d[_0x30bdc4[_0x4e62('0x1e')]][_0x4e62('0x27')]()});}else if(_0x30bdc4[_0x4e62('0x48')]===_0x4e62('0x4b')&&_0x30bdc4['Variable']&&_0x30bdc4['Variable']['name']&&_0x30bdc4[_0x4e62('0x20')]&&_0x30bdc4[_0x4e62('0x46')]){_0x651c8d[_0x30bdc4[_0x4e62('0x4c')][_0x4e62('0x1c')][_0x4e62('0x47')]()]&&_0x2571f2[_0x4e62('0x49')][_0x4e62('0x1f')]({'id':_0x30bdc4[_0x4e62('0x20')],'value':_0x651c8d[_0x30bdc4[_0x4e62('0x4c')][_0x4e62('0x1c')][_0x4e62('0x47')]()][_0x4e62('0x27')]()});}});}return _0x2571f2;}function getConnection(_0x4e303e){return request({'method':_0x4e62('0xc'),'form':{'method':_0x4e62('0x4d'),'input_type':_0x4e62('0x22'),'response_type':_0x4e62('0x22'),'rest_data':JSON[_0x4e62('0x23')]({'user_auth':{'user_name':_0x4e303e[_0x4e62('0x4e')],'password':_0x4e303e[_0x4e62('0x4f')],'encryption':_0x4e62('0x50')},'application':'xCALLY\x20Motion\x20integration'})}})[_0x4e62('0x2e')](function(_0xe5ccfd){var _0x1b587e=_0xe5ccfd;if(_0x1b587e['id']){def[_0x4e62('0x51')]=_0x1b587e['id'];return BPromise[_0x4e62('0x34')](_0x1b587e);}else{throw new Error(util[_0x4e62('0x2c')](_0x4e62('0x52'),_0x4e303e['id']));}});}function setRelationship(_0x5e2fc7,_0x43070f,_0xb928ef,_0x56fbfe){return request({'form':{'method':_0x4e62('0x53'),'input_type':_0x4e62('0x22'),'response_type':_0x4e62('0x22'),'rest_data':JSON['stringify']({'session':_0x5e2fc7['id'],'module_name':'Calls','module_id':_0xb928ef['id'],'link_field_name':_0x56fbfe,'related_ids':[_0x43070f['id']],'name_value_list':[],'delete':0x0})}});}exports['queue']=function(_0x907746,_0x172248,_0x4a3986,_0x5f54ea,_0x40f727,_0x197080){var _0x47be80,_0x2d5336,_0x5142a3,_0x3e059c;_0x197080[_0x4e62('0x54')]=intUtil['stripTrailingSlash'](_0x197080[_0x4e62('0x54')]);_0x197080[_0x4e62('0x55')]=intUtil[_0x4e62('0x56')](_0x197080[_0x4e62('0x55')]);def['uri']=util['format'](_0x4e62('0x57'),_0x197080['remoteUri']);if(_0x40f727&&_0x40f727['monitor_format']){logger[_0x4e62('0xe')]('[QUEUE]',_0x4e62('0x58'));_0x172248[_0x4e62('0x59')]=util[_0x4e62('0x2c')](_0x4e62('0x5a'),_0x197080[_0x4e62('0x55')],_0x172248[_0x4e62('0x5b')],md5(_0x172248['uniqueid']));}else{_0x172248[_0x4e62('0x59')]='';}return getConnection(_0x197080)[_0x4e62('0x2e')](function(_0x40a4e6){_0x3e059c=_0x40a4e6;return getUser(_0x197080,_0x5f54ea[_0x4e62('0x1c')],_0x3e059c);})[_0x4e62('0x2e')](function(_0x4b7ff7){_0x47be80=_0x4b7ff7;logger['info'](_0x4e62('0x5c'),_0x47be80['id']);return getEndUser(_0x197080,_0x172248['calleridname'],_0x172248[_0x4e62('0x5d')],_0x3e059c);})[_0x4e62('0x2e')](function(_0x523efe){_0x2d5336=_0x523efe;logger['info'](_0x4e62('0x5e'),_0x2d5336['id']);return getTicket(_0x197080,_0x47be80,_0x2d5336,_0x4a3986,_0x172248,_0x4a3986['Fields'],_0x3e059c,_0x4e62('0x5f'));})['then'](function(_0x4d574b){_0x5142a3=_0x4d574b;logger[_0x4e62('0xe')](_0x4e62('0x60'));logger['info'](_0x4e62('0x61'),_0x5142a3['id']);return setRelationship(_0x3e059c,_0x47be80,_0x5142a3,_0x4e62('0x62'));})['then'](function(){return setRelationship(_0x3e059c,_0x2d5336,_0x5142a3,_0x4e62('0x63'));})[_0x4e62('0x2e')](function(){return getServerInfo(_0x3e059c);})['then'](function(_0x187e1d){var _0x8912de=parseInt(_0x187e1d[_0x4e62('0x64')][_0x4e62('0x65')](0x0));var _0x414974=util[_0x4e62('0x2c')](_0x4e62('0x66'),_0x197080[_0x4e62('0x54')],_0x5142a3['id']);if(_0x8912de>0x6){_0x414974=util[_0x4e62('0x2c')](_0x4e62('0x67'),_0x197080['remoteUri'],_0x5142a3['id']);}logger[_0x4e62('0xe')](_0x4e62('0x68'),_0x4e62('0x69'));emit(util[_0x4e62('0x2c')](_0x4e62('0x6a'),_0x5f54ea['name']),_0x4e62('0x6b'),{'uri':_0x414974});})[_0x4e62('0x6c')](function(_0x290cbe){logger[_0x4e62('0x6d')](_0x4e62('0x68'),JSON[_0x4e62('0x23')](_0x290cbe));});};exports['outbound']=function(_0x16cb07,_0x4d7238,_0x130b82,_0x479df3,_0x5a16b6,_0x52fa71,_0xb87254){var _0x254bb2,_0x5091a1,_0x29a0e6,_0x18f4c2;_0x52fa71[_0x4e62('0x54')]=intUtil[_0x4e62('0x56')](_0x52fa71[_0x4e62('0x54')]);_0x52fa71[_0x4e62('0x55')]=intUtil[_0x4e62('0x56')](_0x52fa71[_0x4e62('0x55')]);def[_0x4e62('0x6e')]=util[_0x4e62('0x2c')](_0x4e62('0x57'),_0x52fa71[_0x4e62('0x54')]);if(_0xb87254&&_0xb87254['recordingFormat']&&_0xb87254[_0x4e62('0x6f')]!==_0x4e62('0x70')){logger['info'](_0x4e62('0x71'),_0x4e62('0x58'));_0x4d7238[_0x4e62('0x59')]=util['format'](_0x4e62('0x5a'),_0x52fa71[_0x4e62('0x55')],_0x4d7238[_0x4e62('0x5b')],md5(_0x4d7238[_0x4e62('0x5b')]));}return getConnection(_0x52fa71)[_0x4e62('0x2e')](function(_0x1bb3cf){_0x18f4c2=_0x1bb3cf;return getUser(_0x52fa71,_0x479df3[_0x4e62('0x1c')],_0x18f4c2);})[_0x4e62('0x2e')](function(_0x51a1ca){_0x254bb2=_0x51a1ca;logger[_0x4e62('0xe')](_0x4e62('0x5c'),_0x254bb2['id']);return getEndUser(_0x52fa71,_0x4d7238['destcalleridname'],_0x4d7238[_0x4e62('0x72')],_0x18f4c2);})[_0x4e62('0x2e')](function(_0x4dff65){_0x5091a1=_0x4dff65;logger['info'](_0x4e62('0x5e'),_0x5091a1['id']);return getTicket(_0x52fa71,_0x254bb2,_0x5091a1,_0x130b82,_0x4d7238,_0x130b82['Fields'],_0x18f4c2,_0x4e62('0x73'));})[_0x4e62('0x2e')](function(_0xba4dee){_0x29a0e6=_0xba4dee;logger[_0x4e62('0xe')](_0x4e62('0x60'));logger[_0x4e62('0xe')](_0x4e62('0x61'),_0x29a0e6['id']);return setRelationship(_0x18f4c2,_0x254bb2,_0x29a0e6,_0x4e62('0x62'));})[_0x4e62('0x2e')](function(){return setRelationship(_0x18f4c2,_0x5091a1,_0x29a0e6,'contacts');})[_0x4e62('0x2e')](function(){return getServerInfo(_0x18f4c2);})[_0x4e62('0x2e')](function(_0x12dd71){var _0x36431f=parseInt(_0x12dd71[_0x4e62('0x64')][_0x4e62('0x65')](0x0));var _0x2826b6=util[_0x4e62('0x2c')](_0x4e62('0x66'),_0x52fa71[_0x4e62('0x54')],_0x29a0e6['id']);if(_0x36431f>0x6){_0x2826b6=util['format'](_0x4e62('0x67'),_0x52fa71[_0x4e62('0x54')],_0x29a0e6['id']);}logger[_0x4e62('0xe')]('[OUTBOUND]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x4e62('0x2c')]('user:%s',_0x479df3[_0x4e62('0x1c')]),_0x4e62('0x6b'),{'uri':_0x2826b6});})['catch'](function(_0x2887f7){logger[_0x4e62('0x6d')](_0x4e62('0x71'),JSON[_0x4e62('0x23')](_0x2887f7));});};exports['unmanaged']=function(_0x262884,_0x478e5d,_0x444239,_0x32477b,_0x50fff2,_0x4689df){var _0x1bf53d,_0x10b532,_0x6ffd92,_0x3b893e;_0x4689df[_0x4e62('0x54')]=intUtil['stripTrailingSlash'](_0x4689df[_0x4e62('0x54')]);_0x4689df['serverUrl']=intUtil[_0x4e62('0x56')](_0x4689df['serverUrl']);def[_0x4e62('0x6e')]=util[_0x4e62('0x2c')](_0x4e62('0x57'),_0x4689df[_0x4e62('0x54')]);if(_0x50fff2&&_0x50fff2[_0x4e62('0x74')]){logger[_0x4e62('0xe')]('['+_0x478e5d[_0x4e62('0x75')]['toUpperCase']()+']','Recording\x20is\x20enabled!');_0x478e5d[_0x4e62('0x59')]=util[_0x4e62('0x2c')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4689df[_0x4e62('0x55')],_0x478e5d[_0x4e62('0x5b')],md5(_0x478e5d[_0x4e62('0x5b')]));}else{_0x478e5d[_0x4e62('0x59')]='';}return getConnection(_0x4689df)['then'](function(_0x20a8b6){_0x3b893e=_0x20a8b6;if(!_['isNil'](_0x32477b)){return getUser(_0x4689df,_0x32477b[_0x4e62('0x1c')],_0x3b893e);}else{return getUser(_0x4689df,null,_0x3b893e);}})[_0x4e62('0x2e')](function(_0x1871ca){_0x1bf53d=_0x1871ca;logger['info'](_0x4e62('0x5c'),_0x1bf53d['id']);return getEndUser(_0x4689df,_0x478e5d['calleridname'],_0x478e5d[_0x4e62('0x5d')],_0x3b893e);})[_0x4e62('0x2e')](function(_0x1ae469){_0x10b532=_0x1ae469;logger[_0x4e62('0xe')](_0x4e62('0x5e'),_0x10b532['id']);return getTicket(_0x4689df,_0x1bf53d,_0x10b532,_0x444239,_0x478e5d,_0x444239[_0x4e62('0x76')],_0x3b893e,_0x4e62('0x5f'));})[_0x4e62('0x2e')](function(_0x3e9105){_0x6ffd92=_0x3e9105;logger[_0x4e62('0xe')](_0x4e62('0x60'));logger[_0x4e62('0xe')](_0x4e62('0x61'),_0x6ffd92['id']);return setRelationship(_0x3b893e,_0x1bf53d,_0x6ffd92,_0x4e62('0x62'));})['then'](function(){return setRelationship(_0x3b893e,_0x10b532,_0x6ffd92,_0x4e62('0x63'));})[_0x4e62('0x2e')](function(){return getServerInfo(_0x3b893e);})[_0x4e62('0x6c')](function(_0x15952a){logger[_0x4e62('0x6d')]('['+_0x478e5d[_0x4e62('0x75')]['toUpperCase']()+']',JSON[_0x4e62('0x23')](_0x15952a));});}; \ 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 7b762f9..fae0ac9 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 _0x7c7b=['test','lodash','util','getString','length','sortBy','string','content','variable','variableName','toString','type','Variable','name','toLowerCase','push','keyValue','keyType','key','format','%s:\x20%s','customVariable','join','stripTrailingSlash','substring','lastIndexOf','isNil'];(function(_0x5890ed,_0x5eec7c){var _0x49ef9b=function(_0x3d68eb){while(--_0x3d68eb){_0x5890ed['push'](_0x5890ed['shift']());}};_0x49ef9b(++_0x5eec7c);}(_0x7c7b,0x6d));var _0xb7c7=function(_0x5e4771,_0x3bad34){_0x5e4771=_0x5e4771-0x0;var _0x4d34d9=_0x7c7b[_0x5e4771];return _0x4d34d9;};'use strict';var _=require(_0xb7c7('0x0'));var util=require(_0xb7c7('0x1'));exports[_0xb7c7('0x2')]=function(_0x4fd8ad,_0x141f70,_0x5ddea1){var _0x14ed6d=[];if(_0x4fd8ad[_0xb7c7('0x3')]>0x0){var _0x24fdeb=_[_0xb7c7('0x4')](_0x4fd8ad,['id']);for(var _0x14f476=0x0;_0x14f476<_0x24fdeb[_0xb7c7('0x3')];_0x14f476++){var _0x525f53=_0x24fdeb[_0x14f476];if(_0x525f53['type']===_0xb7c7('0x5')){_0x14ed6d['push'](_0x525f53[_0xb7c7('0x6')]);}else if(_0x525f53['type']===_0xb7c7('0x7')&&_0x525f53[_0xb7c7('0x8')]){_0x141f70[_0x525f53['variableName']]&&_0x14ed6d['push'](_0x141f70[_0x525f53[_0xb7c7('0x8')]][_0xb7c7('0x9')]());}else if(_0x525f53[_0xb7c7('0xa')]==='customVariable'&&_0x525f53['Variable']&&_0x525f53[_0xb7c7('0xb')][_0xb7c7('0xc')]){_0x141f70[_0x525f53['Variable'][_0xb7c7('0xc')][_0xb7c7('0xd')]()]&&_0x14ed6d[_0xb7c7('0xe')](_0x141f70[_0x525f53['Variable']['name'][_0xb7c7('0xd')]()][_0xb7c7('0x9')]());}else if(_0x525f53[_0xb7c7('0xa')]===_0xb7c7('0xf')){if(_0x525f53[_0xb7c7('0x10')]==='string'&&_0x525f53[_0xb7c7('0x11')]){_0x14ed6d[_0xb7c7('0xe')](util[_0xb7c7('0x12')](_0xb7c7('0x13'),_0x525f53[_0xb7c7('0x11')],_0x525f53['keyContent']));}else if(_0x525f53[_0xb7c7('0x10')]==='variable'&&_0x525f53[_0xb7c7('0x8')]&&_0x525f53[_0xb7c7('0x11')]){_0x141f70[_0x525f53[_0xb7c7('0x8')]]&&_0x14ed6d['push'](util[_0xb7c7('0x12')]('%s:\x20%s',_0x525f53[_0xb7c7('0x11')],_0x141f70[_0x525f53[_0xb7c7('0x8')]]));}else if(_0x525f53[_0xb7c7('0x10')]===_0xb7c7('0x14')&&_0x525f53[_0xb7c7('0xb')]&&_0x525f53[_0xb7c7('0xb')][_0xb7c7('0xc')]&&_0x525f53['key']){_0x141f70[_0x525f53[_0xb7c7('0xb')][_0xb7c7('0xc')][_0xb7c7('0xd')]()]&&_0x14ed6d[_0xb7c7('0xe')](util[_0xb7c7('0x12')](_0xb7c7('0x13'),_0x525f53['key'],_0x141f70[_0x525f53[_0xb7c7('0xb')][_0xb7c7('0xc')][_0xb7c7('0xd')]()]));}}}}return _0x14ed6d[_0xb7c7('0x15')](_0x5ddea1);};exports[_0xb7c7('0x16')]=function(_0x4bd568){var _0x50b016=_0x4bd568['slice'](-0x1);if(_0x50b016==='/'){_0x4bd568=_0x4bd568[_0xb7c7('0x17')](0x0,_0x4bd568[_0xb7c7('0x18')](_0x50b016));}return _0x4bd568;};exports['validateEmail']=function(_0x397d65){if(!_[_0xb7c7('0x19')](_0x397d65)&&_0x397d65!==''){var _0x2668b6=/^(([^<>()\[\]\\.,;:\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 _0x2668b6[_0xb7c7('0x1a')](String(_0x397d65)[_0xb7c7('0xd')]());}else{return![];}}; \ No newline at end of file +var _0x565e=['keyContent','keyType','format','join','slice','substring','lastIndexOf','validateEmail','isNil','test','lodash','util','length','type','string','push','content','variable','variableName','toString','customVariable','Variable','name','toLowerCase','keyValue','key','%s:\x20%s'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x565e,0x76));var _0xe565=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x565e[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xe565('0x0'));var util=require(_0xe565('0x1'));exports['getString']=function(_0x2e461e,_0x4ef39d,_0x39528b){var _0x48f642=[];if(_0x2e461e[_0xe565('0x2')]>0x0){var _0x3aa8f4=_['sortBy'](_0x2e461e,['id']);for(var _0x2c3aba=0x0;_0x2c3aba<_0x3aa8f4['length'];_0x2c3aba++){var _0x234497=_0x3aa8f4[_0x2c3aba];if(_0x234497[_0xe565('0x3')]===_0xe565('0x4')){_0x48f642[_0xe565('0x5')](_0x234497[_0xe565('0x6')]);}else if(_0x234497[_0xe565('0x3')]===_0xe565('0x7')&&_0x234497[_0xe565('0x8')]){_0x4ef39d[_0x234497[_0xe565('0x8')]]&&_0x48f642[_0xe565('0x5')](_0x4ef39d[_0x234497[_0xe565('0x8')]][_0xe565('0x9')]());}else if(_0x234497[_0xe565('0x3')]===_0xe565('0xa')&&_0x234497[_0xe565('0xb')]&&_0x234497[_0xe565('0xb')][_0xe565('0xc')]){_0x4ef39d[_0x234497['Variable']['name'][_0xe565('0xd')]()]&&_0x48f642[_0xe565('0x5')](_0x4ef39d[_0x234497[_0xe565('0xb')]['name'][_0xe565('0xd')]()][_0xe565('0x9')]());}else if(_0x234497[_0xe565('0x3')]===_0xe565('0xe')){if(_0x234497['keyType']==='string'&&_0x234497[_0xe565('0xf')]){_0x48f642[_0xe565('0x5')](util['format'](_0xe565('0x10'),_0x234497[_0xe565('0xf')],_0x234497[_0xe565('0x11')]));}else if(_0x234497[_0xe565('0x12')]===_0xe565('0x7')&&_0x234497['variableName']&&_0x234497[_0xe565('0xf')]){_0x4ef39d[_0x234497[_0xe565('0x8')]]&&_0x48f642['push'](util[_0xe565('0x13')](_0xe565('0x10'),_0x234497[_0xe565('0xf')],_0x4ef39d[_0x234497[_0xe565('0x8')]]));}else if(_0x234497[_0xe565('0x12')]==='customVariable'&&_0x234497[_0xe565('0xb')]&&_0x234497['Variable']['name']&&_0x234497['key']){_0x4ef39d[_0x234497[_0xe565('0xb')][_0xe565('0xc')][_0xe565('0xd')]()]&&_0x48f642['push'](util[_0xe565('0x13')](_0xe565('0x10'),_0x234497['key'],_0x4ef39d[_0x234497['Variable'][_0xe565('0xc')][_0xe565('0xd')]()]));}}}}return _0x48f642[_0xe565('0x14')](_0x39528b);};exports['stripTrailingSlash']=function(_0x12fc66){var _0x509637=_0x12fc66[_0xe565('0x15')](-0x1);if(_0x509637==='/'){_0x12fc66=_0x12fc66[_0xe565('0x16')](0x0,_0x12fc66[_0xe565('0x17')](_0x509637));}return _0x12fc66;};exports[_0xe565('0x18')]=function(_0x5a4a1e){if(!_[_0xe565('0x19')](_0x5a4a1e)&&_0x5a4a1e!==''){var _0xac8406=/^(([^<>()\[\]\\.,;:\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 _0xac8406[_0xe565('0x1a')](String(_0x5a4a1e)[_0xe565('0xd')]());}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 5373f7c..86dfac3 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 _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(_0xbdfb9b,_0x5ba1b6){var _0x265365=function(_0x1c8095){while(--_0x1c8095){_0xbdfb9b['push'](_0xbdfb9b['shift']());}};_0x265365(++_0x5ba1b6);}(_0x34e8,0x12c));var _0x834e=function(_0x57e2b7,_0x23b60d){_0x57e2b7=_0x57e2b7-0x0;var _0x5689c9=_0x34e8[_0x57e2b7];return _0x5689c9;};'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 +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(_0x171539,_0xefade4){var _0x3e5e63=function(_0x1bbdf1){while(--_0x1bbdf1){_0x171539['push'](_0x171539['shift']());}};_0x3e5e63(++_0xefade4);}(_0x34e8,0x12c));var _0x834e=function(_0x2599ea,_0x458518){_0x2599ea=_0x2599ea-0x0;var _0x46548c=_0x34e8[_0x2599ea];return _0x46548c;};'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 0276c17..7d4e16a 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 _0xcbd5=['md5','util','ioredis','./util','../../../../config/environment','../../../../config/logger','zendesk','redis','defaults','localhost','emit','application/json','info','Creating\x20new\x20ticket...','%s/tickets.json','remoteUri','POST','merge','Tags','getString','Subjects','Descriptions','Fields','then','Ticket\x20created!','ticket','validateEmail','Getting\x20agent\x20with\x20email','format','type:user\x20role:agent\x20email:%s','count','Agent\x20found!','results','agent','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me.json','Admin\x20account\x20selected.','user','type:user\x20role:end-user\x20phone:%s','length','filter','end-user','first','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Caller\x20-\x20%s','Enduser\x20created.','authType','password','%s:%s','username','token','%s/token:%s','Basic\x20%s','toString','base64','debug','[HTTP]','stringify','GET','map','includes','string','picklist','type','nameField','customField','toLowerCase','content','idField','custom_fields','push','variable','variableName','customVariable','Variable','name','queue','stripTrailingSlash','serverUrl','monitor_format','Recording\x20is\x20enabled!','uniqueid','recordingURL','Authorization','email','The\x20User\x20ID\x20is:','The\x20Enduser\x20ID\x20is:','integrationTab','[QUEUE]','Displaying\x20ticket\x20to\x20agent...','%s/channels/voice/agents/%d/tickets/%d/display.json','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','%s/agent/tickets/%s','replace','error','Zendesk\x20account\x20type\x20not\x20recognized','catch','outbound','recordingFormat','none','[OUTBOUND]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','destcalleridname','destcalleridnum','The\x20Ticket\x20ID\x20is:','trigger:browser:url','/api/v2','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','inspect','unmanaged','toUpperCase','calleridnum','lastevent','\x20Error\x20running\x20Zendesk\x20integration','request-promise'];(function(_0x8e8f89,_0x4254f3){var _0x151938=function(_0x21c367){while(--_0x21c367){_0x8e8f89['push'](_0x8e8f89['shift']());}};_0x151938(++_0x4254f3);}(_0xcbd5,0x161));var _0x5cbd=function(_0x5951e8,_0x42b9a7){_0x5951e8=_0x5951e8-0x0;var _0x20a1f5=_0xcbd5[_0x5951e8];return _0x20a1f5;};'use strict';var _=require('lodash');var rp=require(_0x5cbd('0x0'));var md5=require(_0x5cbd('0x1'));var util=require(_0x5cbd('0x2'));var Redis=require(_0x5cbd('0x3'));var intUtil=require(_0x5cbd('0x4'));var config=require(_0x5cbd('0x5'));var logger=require(_0x5cbd('0x6'))(_0x5cbd('0x7'));config[_0x5cbd('0x8')]=_[_0x5cbd('0x9')](config[_0x5cbd('0x8')],{'host':_0x5cbd('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x5cbd('0x8')]));function emit(_0x3cd760,_0x4831e1,_0x3e2ded){io['to'](_0x3cd760)[_0x5cbd('0xb')](_0x4831e1,_0x3e2ded);}var headers={'Content-Type':_0x5cbd('0xc'),'Accept':_0x5cbd('0xc')};function getTicket(_0x14e5ae,_0x1b1790,_0x182c63,_0x159905,_0x1ce409){logger[_0x5cbd('0xd')](_0x5cbd('0xe'));return request({'uri':util['format'](_0x5cbd('0xf'),_0x14e5ae[_0x5cbd('0x10')]),'method':_0x5cbd('0x11'),'body':{'ticket':_[_0x5cbd('0x12')]({'requester_id':_0x182c63['id'],'submitter_id':_0x1b1790?_0x1b1790['id']:undefined,'assignee_id':_0x1b1790?_0x1b1790['id']:undefined,'tags':getTags(_0x159905[_0x5cbd('0x13')],'name'),'subject':intUtil[_0x5cbd('0x14')](_0x159905[_0x5cbd('0x15')],_0x1ce409,'\x20'),'description':intUtil['getString'](_0x159905['Descriptions'],_0x1ce409,'\x0a'),'comment':{'public':![],'body':intUtil['getString'](_0x159905[_0x5cbd('0x16')],_0x1ce409,'\x0a')}},getCustomFields(_0x159905[_0x5cbd('0x17')],_0x1ce409))}})[_0x5cbd('0x18')](function(_0x25af77){logger[_0x5cbd('0xd')](_0x5cbd('0x19'));return _0x25af77[_0x5cbd('0x1a')];});}function getUser(_0x7552a6,_0x4e12ed){if(intUtil[_0x5cbd('0x1b')](_0x4e12ed)){logger[_0x5cbd('0xd')](_0x5cbd('0x1c'),_0x4e12ed);return request({'uri':util[_0x5cbd('0x1d')]('%s/search.json',_0x7552a6[_0x5cbd('0x10')]),'qs':{'query':util[_0x5cbd('0x1d')](_0x5cbd('0x1e'),_0x4e12ed)}})[_0x5cbd('0x18')](function(_0x4e2cf1){if(_0x4e2cf1[_0x5cbd('0x1f')]){logger[_0x5cbd('0xd')](_0x5cbd('0x20'));return _['find'](_0x4e2cf1[_0x5cbd('0x21')],{'email':_0x4e12ed,'role':_0x5cbd('0x22')});}else{logger[_0x5cbd('0xd')](_0x5cbd('0x23'));return request({'uri':util[_0x5cbd('0x1d')](_0x5cbd('0x24'),_0x7552a6[_0x5cbd('0x10')])})[_0x5cbd('0x18')](function(_0x5139ad){logger[_0x5cbd('0xd')](_0x5cbd('0x25'));return _0x5139ad['user'];});}});}else{logger[_0x5cbd('0xd')](_0x5cbd('0x23'));return request({'uri':util[_0x5cbd('0x1d')]('%s/users/me.json',_0x7552a6[_0x5cbd('0x10')])})[_0x5cbd('0x18')](function(_0x42d457){logger[_0x5cbd('0xd')](_0x5cbd('0x25'));return _0x42d457[_0x5cbd('0x26')];});}}function getEndUser(_0x10130f,_0x25f182,_0x41df54){logger['info']('Searching\x20enduser\x20with\x20phone',_0x41df54);return request({'uri':util[_0x5cbd('0x1d')]('%s/search.json',_0x10130f[_0x5cbd('0x10')]),'qs':{'query':util[_0x5cbd('0x1d')](_0x5cbd('0x27'),_0x41df54)}})['then'](function(_0x15a6a8){var _0x326eb2;if(_0x15a6a8[_0x5cbd('0x21')][_0x5cbd('0x28')]){_0x15a6a8[_0x5cbd('0x21')]=_[_0x5cbd('0x29')](_0x15a6a8[_0x5cbd('0x21')],{'suspended':![],'role':_0x5cbd('0x2a')});if(_0x15a6a8[_0x5cbd('0x21')][_0x5cbd('0x28')]){_0x326eb2=_[_0x5cbd('0x2b')](_0x15a6a8[_0x5cbd('0x21')]);}}if(_0x326eb2){logger[_0x5cbd('0xd')](_0x5cbd('0x2c'));return _0x326eb2;}else{logger['info'](_0x5cbd('0x2d'));return request({'uri':util[_0x5cbd('0x1d')]('%s/users.json',_0x10130f[_0x5cbd('0x10')]),'method':'POST','body':{'user':{'role':_0x5cbd('0x2a'),'name':util[_0x5cbd('0x1d')](_0x5cbd('0x2e'),_0x25f182||_0x41df54),'phone':_0x41df54}}})['then'](function(_0xb6b518){logger[_0x5cbd('0xd')](_0x5cbd('0x2f'));return _0xb6b518['user'];});}});}function getAuth(_0x17633d){var _0x30beac;if(_0x17633d[_0x5cbd('0x30')]===_0x5cbd('0x31')){_0x30beac=util[_0x5cbd('0x1d')](_0x5cbd('0x32'),_0x17633d[_0x5cbd('0x33')],_0x17633d['password']);}else if(_0x17633d[_0x5cbd('0x30')]===_0x5cbd('0x34')){_0x30beac=util[_0x5cbd('0x1d')](_0x5cbd('0x35'),_0x17633d['username'],_0x17633d[_0x5cbd('0x34')]);}return util[_0x5cbd('0x1d')](_0x5cbd('0x36'),new Buffer(_0x30beac)[_0x5cbd('0x37')](_0x5cbd('0x38')));}function request(_0x5dbdc2){logger[_0x5cbd('0x39')](_0x5cbd('0x3a'),JSON[_0x5cbd('0x3b')](_0x5dbdc2));return rp(_['defaults'](_0x5dbdc2,{'method':_0x5cbd('0x3c'),'headers':headers,'json':!![]}));}function getTags(_0x474cf2,_0x1f9e2d){var _0x1efb2b=[];if(_0x474cf2&&_0x474cf2[_0x5cbd('0x28')]>0x0){_0x1efb2b=_[_0x5cbd('0x3d')](_0x474cf2,_0x1f9e2d);}return _0x1efb2b;}function getCustomFields(_0x4c3b36,_0x2f2feb){var _0x1b94aa=[];var _0x57e187={'custom_fields':[]};if(_0x4c3b36['length']>0x0){_['forEach'](_0x4c3b36,function(_0x275b46){if(_[_0x5cbd('0x3e')]([_0x5cbd('0x3f'),_0x5cbd('0x40')],_0x275b46[_0x5cbd('0x41')])&&_0x275b46[_0x5cbd('0x42')]&&!_0x275b46[_0x5cbd('0x43')]){_0x57e187[_0x275b46[_0x5cbd('0x42')][_0x5cbd('0x44')]()]=_0x275b46[_0x5cbd('0x45')][_0x5cbd('0x37')]();}else if(_[_0x5cbd('0x3e')]([_0x5cbd('0x3f'),_0x5cbd('0x40')],_0x275b46['type'])&&_0x275b46[_0x5cbd('0x46')]&&_0x275b46[_0x5cbd('0x43')]){_0x57e187[_0x5cbd('0x47')][_0x5cbd('0x48')]({'id':_0x275b46[_0x5cbd('0x46')],'value':_0x275b46[_0x5cbd('0x45')][_0x5cbd('0x37')]()});}else if(_0x275b46[_0x5cbd('0x41')]===_0x5cbd('0x49')&&_0x275b46['variableName']&&_0x275b46[_0x5cbd('0x46')]&&_0x275b46['customField']){_0x2f2feb[_0x275b46[_0x5cbd('0x4a')]]&&_0x57e187[_0x5cbd('0x47')][_0x5cbd('0x48')]({'id':_0x275b46[_0x5cbd('0x46')],'value':_0x2f2feb[_0x275b46[_0x5cbd('0x4a')]][_0x5cbd('0x37')]()});}else if(_0x275b46[_0x5cbd('0x41')]===_0x5cbd('0x4b')&&_0x275b46[_0x5cbd('0x4c')]&&_0x275b46['Variable'][_0x5cbd('0x4d')]&&_0x275b46['idField']&&_0x275b46['customField']){_0x2f2feb[_0x275b46[_0x5cbd('0x4c')][_0x5cbd('0x4d')]['toLowerCase']()]&&_0x57e187[_0x5cbd('0x47')]['push']({'id':_0x275b46[_0x5cbd('0x46')],'value':_0x2f2feb[_0x275b46[_0x5cbd('0x4c')][_0x5cbd('0x4d')][_0x5cbd('0x44')]()][_0x5cbd('0x37')]()});}});}return _0x57e187;}exports[_0x5cbd('0x4e')]=function(_0x2c7269,_0x190b1c,_0x37ac84,_0x1f70bc,_0x33ef13,_0x41daeb){var _0x231e24,_0x53791d;_0x41daeb['remoteUri']=intUtil[_0x5cbd('0x4f')](_0x41daeb[_0x5cbd('0x10')]);_0x41daeb[_0x5cbd('0x50')]=intUtil[_0x5cbd('0x4f')](_0x41daeb['serverUrl']);if(_0x33ef13&&_0x33ef13[_0x5cbd('0x51')]){logger[_0x5cbd('0xd')]('[QUEUE]',_0x5cbd('0x52'));_0x190b1c['recordingURL']=util[_0x5cbd('0x1d')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x41daeb[_0x5cbd('0x50')],_0x190b1c[_0x5cbd('0x53')],md5(_0x190b1c['uniqueid']));}else{_0x190b1c[_0x5cbd('0x54')]='';}headers[_0x5cbd('0x55')]=getAuth(_0x41daeb);return getUser(_0x41daeb,_0x1f70bc[_0x5cbd('0x56')])[_0x5cbd('0x18')](function(_0x498cc8){_0x231e24=_0x498cc8;logger[_0x5cbd('0xd')](_0x5cbd('0x57'),_0x231e24['id']);return getEndUser(_0x41daeb,_0x190b1c['calleridname'],_0x190b1c['calleridnum']);})['then'](function(_0x5e12ff){_0x53791d=_0x5e12ff;logger['info'](_0x5cbd('0x58'),_0x53791d['id']);return getTicket(_0x41daeb,_0x231e24,_0x53791d,_0x37ac84,_0x190b1c);})['then'](function(_0x107bcb){if(_0x107bcb){logger[_0x5cbd('0xd')]('The\x20Ticket\x20ID\x20is:',_0x107bcb['id']);switch(_0x41daeb['type']){case _0x5cbd('0x59'):logger[_0x5cbd('0xd')](_0x5cbd('0x5a'),_0x5cbd('0x5b'));return request({'uri':util[_0x5cbd('0x1d')](_0x5cbd('0x5c'),_0x41daeb[_0x5cbd('0x10')],_0x231e24['id'],_0x107bcb['id']),'method':_0x5cbd('0x11')});case _0x5cbd('0x5d'):logger['info'](_0x5cbd('0x5a'),_0x5cbd('0x5e'));emit(util[_0x5cbd('0x1d')](_0x5cbd('0x5f'),_0x1f70bc[_0x5cbd('0x4d')]),'trigger:browser:url',{'uri':util[_0x5cbd('0x1d')](_0x5cbd('0x60'),_0x41daeb['remoteUri'][_0x5cbd('0x61')]('/api/v2',''),_0x107bcb['id'])});break;default:logger[_0x5cbd('0x62')]('[QUEUE]',_0x5cbd('0x63'));}}})[_0x5cbd('0x64')](function(_0x12516e){logger[_0x5cbd('0x62')]('[QUEUE]\x20Error\x20running\x20Zendesk\x20integration',util['inspect'](_0x12516e,{'showHidden':!![],'depth':null}));});};exports[_0x5cbd('0x65')]=function(_0x17934a,_0x186812,_0xfe81fc,_0x28374c,_0x186a6e,_0x48a5ca,_0x122128){var _0x595007,_0x24e936;_0x48a5ca[_0x5cbd('0x10')]=intUtil[_0x5cbd('0x4f')](_0x48a5ca[_0x5cbd('0x10')]);_0x48a5ca[_0x5cbd('0x50')]=intUtil[_0x5cbd('0x4f')](_0x48a5ca['serverUrl']);if(_0x122128&&_0x122128[_0x5cbd('0x66')]&&_0x122128[_0x5cbd('0x66')]!==_0x5cbd('0x67')){logger[_0x5cbd('0xd')](_0x5cbd('0x68'),'Recording\x20is\x20enabled!');_0x186812[_0x5cbd('0x54')]=util['format'](_0x5cbd('0x69'),_0x48a5ca[_0x5cbd('0x50')],_0x186812['uniqueid'],md5(_0x186812[_0x5cbd('0x53')]));}headers[_0x5cbd('0x55')]=getAuth(_0x48a5ca);return getUser(_0x48a5ca,_0x28374c[_0x5cbd('0x56')])[_0x5cbd('0x18')](function(_0x5a9153){_0x595007=_0x5a9153;logger[_0x5cbd('0xd')](_0x5cbd('0x57'),_0x595007['id']);return getEndUser(_0x48a5ca,_0x186812[_0x5cbd('0x6a')],_0x186812[_0x5cbd('0x6b')]);})[_0x5cbd('0x18')](function(_0x1d26af){_0x24e936=_0x1d26af;logger[_0x5cbd('0xd')](_0x5cbd('0x58'),_0x24e936['id']);return getTicket(_0x48a5ca,_0x595007,_0x24e936,_0xfe81fc,_0x186812);})[_0x5cbd('0x18')](function(_0x465e6b){if(_0x465e6b){logger[_0x5cbd('0xd')](_0x5cbd('0x6c'),_0x465e6b['id']);switch(_0x48a5ca[_0x5cbd('0x41')]){case'integrationTab':logger[_0x5cbd('0xd')](_0x5cbd('0x68'),_0x5cbd('0x5b'));return request({'uri':util['format'](_0x5cbd('0x5c'),_0x48a5ca[_0x5cbd('0x10')],_0x595007['id'],_0x465e6b['id']),'method':_0x5cbd('0x11')});case'newTab':logger['info'](_0x5cbd('0x68'),_0x5cbd('0x5e'));emit(util[_0x5cbd('0x1d')]('user:%s',_0x28374c[_0x5cbd('0x4d')]),_0x5cbd('0x6d'),{'uri':util[_0x5cbd('0x1d')](_0x5cbd('0x60'),_0x48a5ca[_0x5cbd('0x10')][_0x5cbd('0x61')](_0x5cbd('0x6e'),''),_0x465e6b['id'])});break;default:logger[_0x5cbd('0x62')](_0x5cbd('0x68'),_0x5cbd('0x63'));}}})[_0x5cbd('0x64')](function(_0x35dcb0){logger[_0x5cbd('0x62')](_0x5cbd('0x6f'),util[_0x5cbd('0x70')](_0x35dcb0,{'showHidden':!![],'depth':null}));});};exports[_0x5cbd('0x71')]=function(_0x2a27b8,_0x99182a,_0x1e6883,_0x3de706,_0x49ee9e,_0x12f9d1){var _0x45525e,_0xa88194;_0x12f9d1[_0x5cbd('0x10')]=intUtil[_0x5cbd('0x4f')](_0x12f9d1[_0x5cbd('0x10')]);_0x12f9d1['serverUrl']=intUtil['stripTrailingSlash'](_0x12f9d1[_0x5cbd('0x50')]);if(_0x49ee9e&&_0x49ee9e[_0x5cbd('0x51')]){logger[_0x5cbd('0xd')]('['+_0x99182a['lastevent'][_0x5cbd('0x72')]()+']',_0x5cbd('0x52'));_0x99182a['recordingURL']=util[_0x5cbd('0x1d')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x12f9d1['serverUrl'],_0x99182a['uniqueid'],md5(_0x99182a[_0x5cbd('0x53')]));}else{_0x99182a['recordingURL']='';}headers[_0x5cbd('0x55')]=getAuth(_0x12f9d1);return getUser(_0x12f9d1)[_0x5cbd('0x18')](function(_0x12234e){_0x45525e=_0x12234e;logger[_0x5cbd('0xd')](_0x5cbd('0x57'),_0x45525e['id']);return getEndUser(_0x12f9d1,_0x99182a['calleridname'],_0x99182a[_0x5cbd('0x73')]);})[_0x5cbd('0x18')](function(_0x464811){_0xa88194=_0x464811;logger[_0x5cbd('0xd')]('The\x20Enduser\x20ID\x20is:',_0xa88194['id']);return getTicket(_0x12f9d1,_0x45525e,_0xa88194,_0x1e6883,_0x99182a);})[_0x5cbd('0x18')](function(_0x1b2e98){if(_0x1b2e98){logger[_0x5cbd('0xd')](_0x5cbd('0x6c'),_0x1b2e98['id']);}})[_0x5cbd('0x64')](function(_0x248e0a){logger[_0x5cbd('0x62')]('['+_0x99182a[_0x5cbd('0x74')]['toUpperCase']()+']'+_0x5cbd('0x75'),util[_0x5cbd('0x70')](_0x248e0a,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x0af6=['monitor_format','[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','integrationTab','Displaying\x20ticket\x20to\x20agent...','%s/channels/voice/agents/%d/tickets/%d/display.json','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','replace','error','Zendesk\x20account\x20type\x20not\x20recognized','catch','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','inspect','outbound','stripTrailingSlash','recordingFormat','none','[OUTBOUND]','Authorization','destcalleridname','destcalleridnum','trigger:browser:url','%s/agent/tickets/%s','/api/v2','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','unmanaged','lastevent','toUpperCase','lodash','request-promise','md5','util','ioredis','../../../../config/environment','../../../../config/logger','zendesk','defaults','localhost','socket.io-emitter','redis','emit','application/json','Creating\x20new\x20ticket...','format','%s/tickets.json','remoteUri','POST','merge','Tags','name','getString','Subjects','Descriptions','Fields','then','info','validateEmail','count','Agent\x20found!','results','user','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me.json','Admin\x20account\x20selected.','%s/search.json','type:user\x20role:end-user\x20phone:%s','length','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/users.json','end-user','Caller\x20-\x20%s','Enduser\x20created.','authType','password','%s:%s','token','%s/token:%s','username','Basic\x20%s','toString','debug','[HTTP]','stringify','map','includes','string','picklist','type','toLowerCase','idField','customField','custom_fields','variableName','push','customVariable','Variable','serverUrl'];(function(_0x3899d1,_0x4aa04c){var _0xeb4a7d=function(_0x3ea5ee){while(--_0x3ea5ee){_0x3899d1['push'](_0x3899d1['shift']());}};_0xeb4a7d(++_0x4aa04c);}(_0x0af6,0x93));var _0x60af=function(_0x19691f,_0x159737){_0x19691f=_0x19691f-0x0;var _0x5677b6=_0x0af6[_0x19691f];return _0x5677b6;};'use strict';var _=require(_0x60af('0x0'));var rp=require(_0x60af('0x1'));var md5=require(_0x60af('0x2'));var util=require(_0x60af('0x3'));var Redis=require(_0x60af('0x4'));var intUtil=require('./util');var config=require(_0x60af('0x5'));var logger=require(_0x60af('0x6'))(_0x60af('0x7'));config['redis']=_[_0x60af('0x8')](config['redis'],{'host':_0x60af('0x9'),'port':0x18eb});var io=require(_0x60af('0xa'))(new Redis(config[_0x60af('0xb')]));function emit(_0xe651b2,_0x5190db,_0x3a457d){io['to'](_0xe651b2)[_0x60af('0xc')](_0x5190db,_0x3a457d);}var headers={'Content-Type':_0x60af('0xd'),'Accept':_0x60af('0xd')};function getTicket(_0x4d0daa,_0x22d174,_0x4b9b69,_0x5e507b,_0x3edb82){logger['info'](_0x60af('0xe'));return request({'uri':util[_0x60af('0xf')](_0x60af('0x10'),_0x4d0daa[_0x60af('0x11')]),'method':_0x60af('0x12'),'body':{'ticket':_[_0x60af('0x13')]({'requester_id':_0x4b9b69['id'],'submitter_id':_0x22d174?_0x22d174['id']:undefined,'assignee_id':_0x22d174?_0x22d174['id']:undefined,'tags':getTags(_0x5e507b[_0x60af('0x14')],_0x60af('0x15')),'subject':intUtil[_0x60af('0x16')](_0x5e507b[_0x60af('0x17')],_0x3edb82,'\x20'),'description':intUtil['getString'](_0x5e507b[_0x60af('0x18')],_0x3edb82,'\x0a'),'comment':{'public':![],'body':intUtil[_0x60af('0x16')](_0x5e507b[_0x60af('0x18')],_0x3edb82,'\x0a')}},getCustomFields(_0x5e507b[_0x60af('0x19')],_0x3edb82))}})[_0x60af('0x1a')](function(_0xdcc46b){logger[_0x60af('0x1b')]('Ticket\x20created!');return _0xdcc46b['ticket'];});}function getUser(_0x57af28,_0x76bb21){if(intUtil[_0x60af('0x1c')](_0x76bb21)){logger[_0x60af('0x1b')]('Getting\x20agent\x20with\x20email',_0x76bb21);return request({'uri':util[_0x60af('0xf')]('%s/search.json',_0x57af28['remoteUri']),'qs':{'query':util[_0x60af('0xf')]('type:user\x20role:agent\x20email:%s',_0x76bb21)}})[_0x60af('0x1a')](function(_0x1727b2){if(_0x1727b2[_0x60af('0x1d')]){logger['info'](_0x60af('0x1e'));return _['find'](_0x1727b2[_0x60af('0x1f')],{'email':_0x76bb21,'role':'agent'});}else{logger[_0x60af('0x1b')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util['format']('%s/users/me.json',_0x57af28[_0x60af('0x11')])})[_0x60af('0x1a')](function(_0x1e3105){logger['info']('Admin\x20account\x20selected.');return _0x1e3105[_0x60af('0x20')];});}});}else{logger['info'](_0x60af('0x21'));return request({'uri':util['format'](_0x60af('0x22'),_0x57af28[_0x60af('0x11')])})[_0x60af('0x1a')](function(_0x5c30b9){logger['info'](_0x60af('0x23'));return _0x5c30b9[_0x60af('0x20')];});}}function getEndUser(_0x22a336,_0x394835,_0x35c5f3){logger['info']('Searching\x20enduser\x20with\x20phone',_0x35c5f3);return request({'uri':util[_0x60af('0xf')](_0x60af('0x24'),_0x22a336['remoteUri']),'qs':{'query':util[_0x60af('0xf')](_0x60af('0x25'),_0x35c5f3)}})['then'](function(_0x369649){var _0x3b47e4;if(_0x369649[_0x60af('0x1f')][_0x60af('0x26')]){_0x369649['results']=_['filter'](_0x369649['results'],{'suspended':![],'role':'end-user'});if(_0x369649[_0x60af('0x1f')][_0x60af('0x26')]){_0x3b47e4=_['first'](_0x369649[_0x60af('0x1f')]);}}if(_0x3b47e4){logger[_0x60af('0x1b')]('Enduser\x20found!');return _0x3b47e4;}else{logger[_0x60af('0x1b')](_0x60af('0x27'));return request({'uri':util['format'](_0x60af('0x28'),_0x22a336[_0x60af('0x11')]),'method':_0x60af('0x12'),'body':{'user':{'role':_0x60af('0x29'),'name':util[_0x60af('0xf')](_0x60af('0x2a'),_0x394835||_0x35c5f3),'phone':_0x35c5f3}}})[_0x60af('0x1a')](function(_0x5286a0){logger[_0x60af('0x1b')](_0x60af('0x2b'));return _0x5286a0['user'];});}});}function getAuth(_0x498770){var _0x426054;if(_0x498770[_0x60af('0x2c')]===_0x60af('0x2d')){_0x426054=util[_0x60af('0xf')](_0x60af('0x2e'),_0x498770['username'],_0x498770['password']);}else if(_0x498770[_0x60af('0x2c')]===_0x60af('0x2f')){_0x426054=util[_0x60af('0xf')](_0x60af('0x30'),_0x498770[_0x60af('0x31')],_0x498770['token']);}return util['format'](_0x60af('0x32'),new Buffer(_0x426054)[_0x60af('0x33')]('base64'));}function request(_0x55f891){logger[_0x60af('0x34')](_0x60af('0x35'),JSON[_0x60af('0x36')](_0x55f891));return rp(_[_0x60af('0x8')](_0x55f891,{'method':'GET','headers':headers,'json':!![]}));}function getTags(_0x5d5ad2,_0x25d86a){var _0x1fdeb4=[];if(_0x5d5ad2&&_0x5d5ad2['length']>0x0){_0x1fdeb4=_[_0x60af('0x37')](_0x5d5ad2,_0x25d86a);}return _0x1fdeb4;}function getCustomFields(_0x5c383e,_0x5db7ac){var _0x2fe69b=[];var _0x34109d={'custom_fields':[]};if(_0x5c383e[_0x60af('0x26')]>0x0){_['forEach'](_0x5c383e,function(_0x4fadde){if(_[_0x60af('0x38')]([_0x60af('0x39'),_0x60af('0x3a')],_0x4fadde[_0x60af('0x3b')])&&_0x4fadde['nameField']&&!_0x4fadde['customField']){_0x34109d[_0x4fadde['nameField'][_0x60af('0x3c')]()]=_0x4fadde['content'][_0x60af('0x33')]();}else if(_[_0x60af('0x38')]([_0x60af('0x39'),_0x60af('0x3a')],_0x4fadde[_0x60af('0x3b')])&&_0x4fadde[_0x60af('0x3d')]&&_0x4fadde[_0x60af('0x3e')]){_0x34109d[_0x60af('0x3f')]['push']({'id':_0x4fadde[_0x60af('0x3d')],'value':_0x4fadde['content'][_0x60af('0x33')]()});}else if(_0x4fadde[_0x60af('0x3b')]==='variable'&&_0x4fadde[_0x60af('0x40')]&&_0x4fadde[_0x60af('0x3d')]&&_0x4fadde[_0x60af('0x3e')]){_0x5db7ac[_0x4fadde[_0x60af('0x40')]]&&_0x34109d[_0x60af('0x3f')][_0x60af('0x41')]({'id':_0x4fadde[_0x60af('0x3d')],'value':_0x5db7ac[_0x4fadde['variableName']][_0x60af('0x33')]()});}else if(_0x4fadde['type']===_0x60af('0x42')&&_0x4fadde[_0x60af('0x43')]&&_0x4fadde[_0x60af('0x43')][_0x60af('0x15')]&&_0x4fadde[_0x60af('0x3d')]&&_0x4fadde[_0x60af('0x3e')]){_0x5db7ac[_0x4fadde[_0x60af('0x43')][_0x60af('0x15')]['toLowerCase']()]&&_0x34109d[_0x60af('0x3f')][_0x60af('0x41')]({'id':_0x4fadde[_0x60af('0x3d')],'value':_0x5db7ac[_0x4fadde[_0x60af('0x43')]['name'][_0x60af('0x3c')]()][_0x60af('0x33')]()});}});}return _0x34109d;}exports['queue']=function(_0x1c3423,_0x130c3f,_0x661e60,_0x514b5d,_0x4fed20,_0x175851){var _0x11f335,_0x35bc00;_0x175851[_0x60af('0x11')]=intUtil['stripTrailingSlash'](_0x175851[_0x60af('0x11')]);_0x175851['serverUrl']=intUtil['stripTrailingSlash'](_0x175851[_0x60af('0x44')]);if(_0x4fed20&&_0x4fed20[_0x60af('0x45')]){logger[_0x60af('0x1b')](_0x60af('0x46'),_0x60af('0x47'));_0x130c3f['recordingURL']=util[_0x60af('0xf')](_0x60af('0x48'),_0x175851[_0x60af('0x44')],_0x130c3f[_0x60af('0x49')],md5(_0x130c3f['uniqueid']));}else{_0x130c3f[_0x60af('0x4a')]='';}headers['Authorization']=getAuth(_0x175851);return getUser(_0x175851,_0x514b5d[_0x60af('0x4b')])['then'](function(_0x4bbf85){_0x11f335=_0x4bbf85;logger[_0x60af('0x1b')](_0x60af('0x4c'),_0x11f335['id']);return getEndUser(_0x175851,_0x130c3f[_0x60af('0x4d')],_0x130c3f[_0x60af('0x4e')]);})['then'](function(_0x45fc47){_0x35bc00=_0x45fc47;logger[_0x60af('0x1b')](_0x60af('0x4f'),_0x35bc00['id']);return getTicket(_0x175851,_0x11f335,_0x35bc00,_0x661e60,_0x130c3f);})['then'](function(_0x30db60){if(_0x30db60){logger[_0x60af('0x1b')](_0x60af('0x50'),_0x30db60['id']);switch(_0x175851[_0x60af('0x3b')]){case _0x60af('0x51'):logger['info'](_0x60af('0x46'),_0x60af('0x52'));return request({'uri':util[_0x60af('0xf')](_0x60af('0x53'),_0x175851[_0x60af('0x11')],_0x11f335['id'],_0x30db60['id']),'method':_0x60af('0x12')});case _0x60af('0x54'):logger[_0x60af('0x1b')](_0x60af('0x46'),_0x60af('0x55'));emit(util[_0x60af('0xf')](_0x60af('0x56'),_0x514b5d[_0x60af('0x15')]),'trigger:browser:url',{'uri':util[_0x60af('0xf')]('%s/agent/tickets/%s',_0x175851[_0x60af('0x11')][_0x60af('0x57')]('/api/v2',''),_0x30db60['id'])});break;default:logger[_0x60af('0x58')](_0x60af('0x46'),_0x60af('0x59'));}}})[_0x60af('0x5a')](function(_0x278784){logger[_0x60af('0x58')](_0x60af('0x5b'),util[_0x60af('0x5c')](_0x278784,{'showHidden':!![],'depth':null}));});};exports[_0x60af('0x5d')]=function(_0x39aea8,_0x53bd19,_0x1ff47b,_0x4e1895,_0x2dc994,_0x5d51d5,_0x10595a){var _0x51d113,_0x32d316;_0x5d51d5[_0x60af('0x11')]=intUtil['stripTrailingSlash'](_0x5d51d5['remoteUri']);_0x5d51d5[_0x60af('0x44')]=intUtil[_0x60af('0x5e')](_0x5d51d5[_0x60af('0x44')]);if(_0x10595a&&_0x10595a[_0x60af('0x5f')]&&_0x10595a['recordingFormat']!==_0x60af('0x60')){logger['info'](_0x60af('0x61'),'Recording\x20is\x20enabled!');_0x53bd19[_0x60af('0x4a')]=util['format'](_0x60af('0x48'),_0x5d51d5[_0x60af('0x44')],_0x53bd19['uniqueid'],md5(_0x53bd19['uniqueid']));}headers[_0x60af('0x62')]=getAuth(_0x5d51d5);return getUser(_0x5d51d5,_0x4e1895['email'])['then'](function(_0x2296cf){_0x51d113=_0x2296cf;logger['info'](_0x60af('0x4c'),_0x51d113['id']);return getEndUser(_0x5d51d5,_0x53bd19[_0x60af('0x63')],_0x53bd19[_0x60af('0x64')]);})['then'](function(_0x3d7f81){_0x32d316=_0x3d7f81;logger[_0x60af('0x1b')](_0x60af('0x4f'),_0x32d316['id']);return getTicket(_0x5d51d5,_0x51d113,_0x32d316,_0x1ff47b,_0x53bd19);})[_0x60af('0x1a')](function(_0x3dcb8b){if(_0x3dcb8b){logger[_0x60af('0x1b')](_0x60af('0x50'),_0x3dcb8b['id']);switch(_0x5d51d5[_0x60af('0x3b')]){case _0x60af('0x51'):logger[_0x60af('0x1b')](_0x60af('0x61'),_0x60af('0x52'));return request({'uri':util[_0x60af('0xf')](_0x60af('0x53'),_0x5d51d5[_0x60af('0x11')],_0x51d113['id'],_0x3dcb8b['id']),'method':'POST'});case _0x60af('0x54'):logger[_0x60af('0x1b')]('[OUTBOUND]',_0x60af('0x55'));emit(util[_0x60af('0xf')](_0x60af('0x56'),_0x4e1895['name']),_0x60af('0x65'),{'uri':util['format'](_0x60af('0x66'),_0x5d51d5[_0x60af('0x11')][_0x60af('0x57')](_0x60af('0x67'),''),_0x3dcb8b['id'])});break;default:logger[_0x60af('0x58')](_0x60af('0x61'),'Zendesk\x20account\x20type\x20not\x20recognized');}}})[_0x60af('0x5a')](function(_0x34f450){logger[_0x60af('0x58')](_0x60af('0x68'),util[_0x60af('0x5c')](_0x34f450,{'showHidden':!![],'depth':null}));});};exports[_0x60af('0x69')]=function(_0x503158,_0x328026,_0x1d34c1,_0x285362,_0x231f20,_0x502232){var _0x388863,_0x1e2f43;_0x502232[_0x60af('0x11')]=intUtil[_0x60af('0x5e')](_0x502232[_0x60af('0x11')]);_0x502232[_0x60af('0x44')]=intUtil['stripTrailingSlash'](_0x502232[_0x60af('0x44')]);if(_0x231f20&&_0x231f20['monitor_format']){logger[_0x60af('0x1b')]('['+_0x328026[_0x60af('0x6a')][_0x60af('0x6b')]()+']',_0x60af('0x47'));_0x328026[_0x60af('0x4a')]=util[_0x60af('0xf')](_0x60af('0x48'),_0x502232[_0x60af('0x44')],_0x328026[_0x60af('0x49')],md5(_0x328026['uniqueid']));}else{_0x328026[_0x60af('0x4a')]='';}headers[_0x60af('0x62')]=getAuth(_0x502232);return getUser(_0x502232)['then'](function(_0x2e916c){_0x388863=_0x2e916c;logger[_0x60af('0x1b')](_0x60af('0x4c'),_0x388863['id']);return getEndUser(_0x502232,_0x328026[_0x60af('0x4d')],_0x328026[_0x60af('0x4e')]);})[_0x60af('0x1a')](function(_0xe606c0){_0x1e2f43=_0xe606c0;logger['info']('The\x20Enduser\x20ID\x20is:',_0x1e2f43['id']);return getTicket(_0x502232,_0x388863,_0x1e2f43,_0x1d34c1,_0x328026);})[_0x60af('0x1a')](function(_0x4c0b86){if(_0x4c0b86){logger[_0x60af('0x1b')]('The\x20Ticket\x20ID\x20is:',_0x4c0b86['id']);}})['catch'](function(_0x566a4a){logger[_0x60af('0x58')]('['+_0x328026[_0x60af('0x6a')][_0x60af('0x6b')]()+']'+'\x20Error\x20running\x20Zendesk\x20integration',util[_0x60af('0x5c')](_0x566a4a,{'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 2ae0adf..d515cee 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 _0x1136=['details','enduserType','moduleCreate','CREATE\x20ERROR','Zoho-oauthtoken\x20','moduleSearch','contact_lead','uri','/crm/v2/Contacts/search?criteria=((Phone:equals:','Contacts','/crm/v2/Leads/search?criteria=((Phone:equals:','Leads','nothing','contact','lead','Creating\x20new\x20call...','administrator','Subject','getString','Subjects','Descriptions','Who_Id','Full_Name','First_Name','Last_Name','What_Id','$se_module','talktime','Call_Duration','mm:ss','answertime','endtime','utc','YYYY-MM-DDTHH:mm:ss','diff','starttime','lastevent','Called','complete','Call_Result','Answered','rejected','abandoned','Abandoned','Timeout','Call_Start_Time','outbound','agentcalledAt','Call_Type','Inbound','merge','Fields','/crm/v2/Calls','SUCCESS','Call\x20created!','err','log','queue','host','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','/api/voice/recordings/','uniqueid','/downloads?type=uniqueid&token=','zoho.eu','The\x20User\x20ID\x20is:','calleridname','calleridnum','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','https://crm.','/crm/EntityInfo.do?module=Calls&id=','recordingFormat','none','[OUTBOUND]','com','destcalleridname','destcalleridnum','Outbound','The\x20Call\x20ID\x20is:','unmanaged','toUpperCase','lodash','request-promise','md5','util','ioredis','bluebird','../../../../config/environment','zoho','redis','defaults','localhost','emit','debug','[HTTP]','stringify','length','forEach','includes','string','picklist','type','idField','toString','variable','variableName','customVariable','Variable','name','toLowerCase','indexOf','split','isNil','access_token','isBefore','https://accounts.zoho.in','POST','/oauth/v2/token','refreshToken','clientId','then','add','expires_in','catch','error','Failing\x20creating\x20the\x20access_token','stack','info','Search\x20user','GET','format','https://www.zohoapis.%s/crm/v2/users','ActiveUsers','users','isArrayLikeObject','findIndex','email','Agent\x20found!','profile','user','Administrator','Using\x20the\x20admin\x20account!','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','data','https://www.zohoapis.','startCase','role','first_name','last_name','code'];(function(_0x4bcb3c,_0x192122){var _0xfe09bb=function(_0xcd8ad2){while(--_0xcd8ad2){_0x4bcb3c['push'](_0x4bcb3c['shift']());}};_0xfe09bb(++_0x192122);}(_0x1136,0x191));var _0x6113=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x1136[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0x6113('0x0'));var rp=require(_0x6113('0x1'));var md5=require(_0x6113('0x2'));var util=require(_0x6113('0x3'));var intUtil=require('./util');var moment=require('moment');var Redis=require(_0x6113('0x4'));var BPromise=require(_0x6113('0x5'));var config=require(_0x6113('0x6'));var logger=require('../../../../config/logger')(_0x6113('0x7'));config[_0x6113('0x8')]=_[_0x6113('0x9')](config[_0x6113('0x8')],{'host':_0x6113('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x6113('0x8')]));function emit(_0x7eaca5,_0x487070,_0x3dcede){io['to'](_0x7eaca5)[_0x6113('0xb')](_0x487070,_0x3dcede);}function request(_0x6e70c7){logger[_0x6113('0xc')](_0x6113('0xd'),JSON[_0x6113('0xe')](_0x6e70c7));return rp(_0x6e70c7);}function getCustomFields(_0x4449c1,_0x35afe4){var _0x285df4={};if(_0x4449c1[_0x6113('0xf')]>0x0){_[_0x6113('0x10')](_0x4449c1,function(_0x3ce45c){if(_[_0x6113('0x11')]([_0x6113('0x12'),_0x6113('0x13')],_0x3ce45c[_0x6113('0x14')])&&_0x3ce45c[_0x6113('0x15')]){_0x285df4[_0x3ce45c['idField']]=_0x3ce45c['content'][_0x6113('0x16')]();}else if(_0x3ce45c['type']===_0x6113('0x17')&&_0x3ce45c['variableName']&&_0x3ce45c['idField']&&_0x35afe4[_0x3ce45c[_0x6113('0x18')]]){_0x285df4[_0x3ce45c[_0x6113('0x15')]]=_0x35afe4[_0x3ce45c[_0x6113('0x18')]][_0x6113('0x16')]();}else if(_0x3ce45c[_0x6113('0x14')]===_0x6113('0x19')&&_0x3ce45c['Variable']&&_0x3ce45c[_0x6113('0x1a')][_0x6113('0x1b')]&&_0x3ce45c[_0x6113('0x15')]&&_0x35afe4[_0x3ce45c[_0x6113('0x1a')]['name'][_0x6113('0x1c')]()]){_0x285df4[_0x3ce45c[_0x6113('0x15')]]=_0x35afe4[_0x3ce45c['Variable']['name'][_0x6113('0x1c')]()][_0x6113('0x16')]();}});}return _0x285df4;}function getName(_0x3fcfbe){if(_0x3fcfbe[_0x6113('0x1d')]('\x20')>0x0){var _0x11611d=_0x3fcfbe[_0x6113('0x1e')](/ (.+)/);if(_0x11611d[0x1]){return _0x11611d;}}return[_0x3fcfbe,_0x3fcfbe];}var accountsTokens={};function getAccessToken(_0x17a5f6){return new Promise(function(_0x16d4d2,_0x2982fe){if(!_[_0x6113('0x1f')](accountsTokens[_0x17a5f6['id']])&&!_['isNil'](accountsTokens[_0x17a5f6['id']][_0x6113('0x20')])){if(moment()[_0x6113('0x21')](accountsTokens[_0x17a5f6['id']]['expires_in'])){_0x16d4d2(accountsTokens[_0x17a5f6['id']]['access_token']);}}var _0x5b9973;switch(_0x17a5f6['zone']){case'US':_0x5b9973='https://accounts.zoho.com';break;case'AU':_0x5b9973='https://accounts.zoho.com.au';break;case'EU':_0x5b9973='https://accounts.zoho.eu';break;case'IN':_0x5b9973=_0x6113('0x22');break;case'CN':_0x5b9973='https://accounts.zoho.com.cn';break;default:_0x5b9973='https://accounts.zoho.eu';break;}var _0x29404c={'method':_0x6113('0x23'),'uri':_0x5b9973+_0x6113('0x24'),'qs':{'refresh_token':_0x17a5f6[_0x6113('0x25')],'client_id':_0x17a5f6[_0x6113('0x26')],'client_secret':_0x17a5f6['clientSecret'],'grant_type':'refresh_token'},'json':!![]};return rp(_0x29404c)[_0x6113('0x27')](function(_0x2672f2){accountsTokens[_0x17a5f6['id']]={'access_token':_0x2672f2[_0x6113('0x20')],'expires_in':moment()[_0x6113('0x28')](_0x2672f2[_0x6113('0x29')],'seconds')};_0x16d4d2(_0x2672f2['access_token']);})[_0x6113('0x2a')](function(_0x545f8b){logger[_0x6113('0x2b')](_0x6113('0x2c'),_0x545f8b[_0x6113('0x2d')]);_0x2982fe(_0x545f8b);});});}function getUser(_0xc7f554,_0x5dc045,_0x2efca7,_0x43c1a2){logger[_0x6113('0x2e')](_0x6113('0x2f'));return request({'method':_0x6113('0x30'),'uri':util[_0x6113('0x31')](_0x6113('0x32'),_0x5dc045),'qs':{'type':_0x6113('0x33')},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0xc7f554},'json':!![]})[_0x6113('0x27')](function(_0x581415){if(_0x581415[_0x6113('0x34')]){var _0x8a9cd5=-0x1;if(_[_0x6113('0x35')](_0x581415['users'])){if(!_[_0x6113('0x1f')](_0x43c1a2)){_0x8a9cd5=_[_0x6113('0x36')](_0x581415[_0x6113('0x34')],function(_0x12c8b7){return _0x12c8b7[_0x6113('0x37')]===_0x43c1a2;});}if(_0x8a9cd5>=0x0){logger[_0x6113('0x2e')](_0x6113('0x38'));}else{logger[_0x6113('0x2e')]('Using\x20the\x20admin\x20account!');_0x8a9cd5=_['findIndex'](_0x581415[_0x6113('0x34')],function(_0x36e85d){return _0x36e85d[_0x6113('0x39')][_0x6113('0x1b')]==='Administrator';});}return _0x581415[_0x6113('0x34')][_0x8a9cd5];}else{if(_0x581415[_0x6113('0x3a')][_0x6113('0x39')]['name']===_0x6113('0x3b')){logger[_0x6113('0x2e')](_0x6113('0x3c'));user=_0x581415[_0x6113('0x3a')];return user;}else{logger['error'](_0x6113('0x3d'),JSON['stringify'](_0x581415));throw new Error('Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20'+JSON[_0x6113('0xe')](_0x581415));}}}else{logger['error'](_0x6113('0x3d'),JSON[_0x6113('0xe')](_0x581415));throw new Error(_0x6113('0x3e')+JSON[_0x6113('0xe')](_0x581415));}})['catch'](function(_0x5c3883){console[_0x6113('0x2b')](_0x5c3883);});}function getZohoUser(_0x2824e6,_0x479611){return new BPromise(function(_0x5b1c6a,_0xb0d31c){request(_0x2824e6)['then'](function(_0x5a7d2f){var _0x3da946=null;if(_0x5a7d2f){_0x3da946=_0x5a7d2f[_0x6113('0x3f')][0x0];_0x3da946['enduserType']=_0x479611;}_0x5b1c6a(_0x3da946);})[_0x6113('0x2a')](function(_0x2d305e){_0xb0d31c(_0x2d305e);});});}function createEndUser(_0x14864b,_0x5d7e78,_0x41c72a,_0x2cc8a8,_0xf03433,_0x4ef875){var _0x41c72a=getName(_0x41c72a);return request({'method':_0x6113('0x23'),'uri':_0x6113('0x40')+_0x5d7e78+'/crm/v2/'+_[_0x6113('0x41')](_0x4ef875['moduleCreate'])+'s','body':{'data':[{'Last_Name':_0x41c72a[0x1],'First_Name':_0x41c72a[0x0],'Phone':_0x2cc8a8,'Owner':{'name':!_['isNil'](_0xf03433['role'][_0x6113('0x1b')])?_0xf03433[_0x6113('0x42')][_0x6113('0x1b')]:!_[_0x6113('0x1f')](_0xf03433[_0x6113('0x43')])?_0xf03433['first_name']+'\x20'+_0xf03433['last_name']:_0xf03433[_0x6113('0x44')],'id':_0xf03433['id']}}]},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x14864b},'json':!![]})[_0x6113('0x27')](function(_0x5157d6){if(_0x5157d6&&_0x5157d6[_0x6113('0x3f')][0x0][_0x6113('0x45')]==='SUCCESS'){var _0x2ae2f3=_0x5157d6[_0x6113('0x3f')][0x0][_0x6113('0x46')];_0x2ae2f3[_0x6113('0x47')]=_[_0x6113('0x41')](_0x4ef875[_0x6113('0x48')])+'s';return _0x2ae2f3;}logger['error']('The\x20failing\x20result\x20is',JSON[_0x6113('0xe')](data));throw new Error('Error:\x20'+JSON[_0x6113('0xe')](data));})['catch'](function(_0x5e066d){console['log'](_0x6113('0x49'),_0x5e066d);});}function getEndUser(_0xdba59f,_0x41457d,_0x12f97a,_0x1657b0,_0x2d53ec,_0x4882cb,_0xbe3bfe){var _0x4d2f70={'method':'GET','uri':'','headers':{'Authorization':_0x6113('0x4a')+_0xdba59f},'json':!![]};switch(_0xbe3bfe[_0x6113('0x4b')]){case _0x6113('0x4c'):_0x4d2f70[_0x6113('0x4d')]='https://www.zohoapis.'+_0x41457d+_0x6113('0x4e')+_0x2d53ec+'))';return getZohoUser(_0x4d2f70,_0x6113('0x4f'))[_0x6113('0x27')](function(_0x3f1e36){if(_0x3f1e36)return _0x3f1e36;_0x4d2f70[_0x6113('0x4d')]=_0x6113('0x40')+_0x41457d+_0x6113('0x50')+_0x2d53ec+'))';return getZohoUser(_0x4d2f70,_0x6113('0x51'))[_0x6113('0x27')](function(_0x42dd7b){if(_0x42dd7b)return _0x42dd7b;if(_0xbe3bfe[_0x6113('0x48')]!=_0x6113('0x52')){return createEndUser(_0xdba59f,_0x41457d,_0x1657b0,_0x2d53ec,_0x4882cb,_0xbe3bfe);}else{return{};}});});break;case _0x6113('0x53'):_0x4d2f70[_0x6113('0x4d')]=_0x6113('0x40')+_0x41457d+_0x6113('0x4e')+_0x2d53ec+'))';return getZohoUser(_0x4d2f70,_0x6113('0x4f'))['then'](function(_0x17ee6a){if(_0x17ee6a)return _0x17ee6a;if(_0xbe3bfe[_0x6113('0x48')]!=_0x6113('0x52')){return createEndUser(_0xdba59f,_0x41457d,_0x1657b0,_0x2d53ec,_0x4882cb,_0xbe3bfe);}else{return{};}});break;case _0x6113('0x54'):_0x4d2f70[_0x6113('0x4d')]=_0x6113('0x40')+_0x41457d+_0x6113('0x50')+_0x2d53ec+'))';return getZohoUser(_0x4d2f70,'Leads')[_0x6113('0x27')](function(_0x4d6d8b){if(_0x4d6d8b)return _0x4d6d8b;if(_0xbe3bfe[_0x6113('0x48')]!='nothing'){return createEndUser(_0xdba59f,_0x41457d,_0x1657b0,_0x2d53ec,_0x4882cb,_0xbe3bfe);}else{return{};}});break;}}function getCall(_0x4cf6c3,_0x19d438,_0x17f749,_0xf117a4,_0x22a268,_0x1c79c9,_0x1c2c50,_0x271cd3){logger['info'](_0x6113('0x55'));var _0x406619={};_0x406619['Owner']={'name':!_['isNil'](_0xf117a4[_0x6113('0x42')][_0x6113('0x1b')])&&!_[_0x6113('0x1f')](_0xf117a4[_0x6113('0x39')][_0x6113('0x1b')])&&_0xf117a4[_0x6113('0x39')][_0x6113('0x1b')]===_0x6113('0x56')?_0xf117a4[_0x6113('0x42')]['name']:!_[_0x6113('0x1f')](_0xf117a4[_0x6113('0x43')])?_0xf117a4[_0x6113('0x43')]+'\x20'+_0xf117a4[_0x6113('0x44')]:_0xf117a4['last_name'],'id':_0xf117a4['id']};_0x406619[_0x6113('0x57')]=intUtil[_0x6113('0x58')](_0x1c79c9[_0x6113('0x59')],_0x1c2c50,'\x20');_0x406619['Description']=intUtil[_0x6113('0x58')](_0x1c79c9[_0x6113('0x5a')],_0x1c2c50,'\x0a');if(_0x22a268[_0x6113('0x47')]===_0x6113('0x4f')){_0x406619[_0x6113('0x5b')]={'name':!_[_0x6113('0x1f')](_0x22a268['Full_Name'])?_0x22a268[_0x6113('0x5c')]:!_[_0x6113('0x1f')](_0x22a268[_0x6113('0x5d')])?_0x22a268[_0x6113('0x5d')]+'\x20'+_0x22a268[_0x6113('0x5e')]:_0x22a268[_0x6113('0x5e')],'id':_0x22a268['id']};}if(_0x22a268[_0x6113('0x47')]===_0x6113('0x51')){_0x406619[_0x6113('0x5f')]={'name':!_[_0x6113('0x1f')](_0x22a268[_0x6113('0x5c')])?_0x22a268[_0x6113('0x5c')]:!_['isNil'](_0x22a268[_0x6113('0x5d')])?_0x22a268[_0x6113('0x5d')]+'\x20'+_0x22a268[_0x6113('0x5e')]:_0x22a268[_0x6113('0x5e')],'id':_0x22a268['id']};_0x406619[_0x6113('0x60')]=_[_0x6113('0x41')](_0x22a268[_0x6113('0x47')]);}if(_0x1c2c50[_0x6113('0x61')]){_0x406619[_0x6113('0x62')]=moment['utc'](parseInt(_0x1c2c50[_0x6113('0x61')])*0x3e8)[_0x6113('0x31')](_0x6113('0x63'));}else if(_0x1c2c50[_0x6113('0x64')]&&_0x1c2c50[_0x6113('0x65')]){_0x406619[_0x6113('0x62')]=moment[_0x6113('0x66')](moment(_0x1c2c50[_0x6113('0x65')],_0x6113('0x67'))[_0x6113('0x68')](moment(_0x1c2c50[_0x6113('0x69')],_0x6113('0x67'))))[_0x6113('0x31')](_0x6113('0x63'));}switch(_0x1c2c50[_0x6113('0x6a')]){case'called':_0x406619['Call_Result']=_0x6113('0x6b');break;case _0x6113('0x6c'):case'connect':_0x406619[_0x6113('0x6d')]=_0x6113('0x6e');break;case _0x6113('0x6f'):_0x406619['Call_Result']='Rejected';break;case _0x6113('0x70'):_0x406619['Call_Result']=_0x6113('0x71');break;case'timeout':_0x406619[_0x6113('0x6d')]=_0x6113('0x72');default:}_0x406619[_0x6113('0x73')]=(_0x271cd3===_0x6113('0x74')?moment(_0x1c2c50[_0x6113('0x69')])['format'](_0x6113('0x67')):moment(_0x1c2c50[_0x6113('0x75')])[_0x6113('0x31')](_0x6113('0x67')))||moment()[_0x6113('0x31')](_0x6113('0x67'));_0x406619[_0x6113('0x76')]=_0x271cd3||_0x6113('0x77');_0x406619=_[_0x6113('0x78')](_0x406619,getCustomFields(_0x1c79c9[_0x6113('0x79')],_0x1c2c50));return request({'method':_0x6113('0x23'),'uri':_0x6113('0x40')+_0x19d438+_0x6113('0x7a'),'headers':{'Authorization':_0x6113('0x4a')+_0x4cf6c3},'body':{'data':[_0x406619]},'json':!![]})['then'](function(_0x3b3b80){if(_0x3b3b80&&_0x3b3b80[_0x6113('0x3f')][0x0][_0x6113('0x45')]===_0x6113('0x7b')){logger[_0x6113('0x2e')](_0x6113('0x7c'));return{'id':_0x3b3b80['data'][0x0][_0x6113('0x46')]['id']};}})[_0x6113('0x2a')](function(_0x4980e1){logger[_0x6113('0x2e')](_0x6113('0x7d'),_0x4980e1[_0x6113('0x2d')]);console[_0x6113('0x7e')](_0x6113('0x7d'),_0x4980e1);});}exports[_0x6113('0x7f')]=function(_0x1a561e,_0x4aae79,_0x31e7c5,_0x3be57a,_0x89a782,_0x1091d7){var _0x46f2fc,_0x132f18,_0x4ce29e;_0x1091d7[_0x6113('0x80')]=intUtil[_0x6113('0x81')](_0x1091d7['host']);_0x1091d7[_0x6113('0x82')]=intUtil[_0x6113('0x81')](_0x1091d7[_0x6113('0x82')]);if(_0x89a782&&_0x89a782[_0x6113('0x83')]){logger['info'](_0x6113('0x84'),_0x6113('0x85'));_0x4aae79[_0x6113('0x86')]=_0x1091d7[_0x6113('0x82')]+_0x6113('0x87')+_0x4aae79[_0x6113('0x88')]+_0x6113('0x89')+md5(_0x4aae79[_0x6113('0x88')]);}else{_0x4aae79[_0x6113('0x86')]='';}var _0xbad1a=_0x1091d7[_0x6113('0x80')]===_0x6113('0x8a')?'eu':'com';return getAccessToken(_0x1091d7)['then'](function(_0x4cb265){_0x4ce29e=_0x4cb265;return getUser(_0x4ce29e,_0xbad1a,_0x1091d7,_0x3be57a[_0x6113('0x37')]);})['then'](function(_0x46c019){_0x46f2fc=_0x46c019;logger[_0x6113('0x2e')](_0x6113('0x8b'),_0x46f2fc['id']);return getEndUser(_0x4ce29e,_0xbad1a,_0x1091d7,_0x4aae79[_0x6113('0x8c')],_0x4aae79[_0x6113('0x8d')],_0x46f2fc,_0x31e7c5);})[_0x6113('0x27')](function(_0x33e4c0){_0x132f18=_0x33e4c0;return getCall(_0x4ce29e,_0xbad1a,_0x1091d7,_0x46f2fc,_0x132f18,_0x31e7c5,_0x4aae79,_0x6113('0x77'));})[_0x6113('0x27')](function(_0x92da54){if(_0x92da54){logger['info']('The\x20Call\x20ID\x20is:',_0x92da54['id']);logger[_0x6113('0x2e')]('[QUEUE]',_0x6113('0x8e'));emit(util[_0x6113('0x31')](_0x6113('0x8f'),_0x3be57a['name']),_0x6113('0x90'),{'uri':_0x6113('0x91')+_0x1091d7[_0x6113('0x80')]+_0x6113('0x92')+_0x92da54['id']});}})[_0x6113('0x2a')](function(_0x245a77){logger[_0x6113('0x2b')](_0x6113('0x84'),JSON['stringify'](_0x245a77));});};exports[_0x6113('0x74')]=function(_0x242704,_0x35065c,_0x10e3a6,_0x5d6a91,_0x44dd66,_0x48a1c9,_0x366409){var _0x3865aa,_0x40d6fb,_0x3b7c9b;_0x48a1c9[_0x6113('0x80')]=intUtil[_0x6113('0x81')](_0x48a1c9[_0x6113('0x80')]);_0x48a1c9[_0x6113('0x82')]=intUtil[_0x6113('0x81')](_0x48a1c9[_0x6113('0x82')]);if(_0x366409&&_0x366409['recordingFormat']&&_0x366409[_0x6113('0x93')]!==_0x6113('0x94')){logger[_0x6113('0x2e')](_0x6113('0x95'),_0x6113('0x85'));_0x35065c[_0x6113('0x86')]=_0x48a1c9[_0x6113('0x82')]+_0x6113('0x87')+_0x35065c[_0x6113('0x88')]+_0x6113('0x89')+md5(_0x35065c[_0x6113('0x88')]);}var _0x3859cf=_0x48a1c9[_0x6113('0x80')]===_0x6113('0x8a')?'eu':_0x6113('0x96');return getAccessToken(_0x48a1c9)[_0x6113('0x27')](function(_0x155ccb){_0x3b7c9b=_0x155ccb;return getUser(_0x3b7c9b,_0x3859cf,_0x48a1c9,_0x5d6a91[_0x6113('0x37')]);})[_0x6113('0x27')](function(_0x95b0d2){_0x3865aa=_0x95b0d2;logger['info'](_0x6113('0x8b'),_0x3865aa['id']);return getEndUser(_0x3b7c9b,_0x3859cf,_0x48a1c9,_0x35065c[_0x6113('0x97')],_0x35065c[_0x6113('0x98')],_0x3865aa,_0x10e3a6);})[_0x6113('0x27')](function(_0x4fc584){_0x40d6fb=_0x4fc584;return getCall(_0x3b7c9b,_0x3859cf,_0x48a1c9,_0x3865aa,_0x40d6fb,_0x10e3a6,_0x35065c,_0x6113('0x99'));})[_0x6113('0x27')](function(_0x702f84){if(_0x702f84){logger['info'](_0x6113('0x9a'),_0x702f84['id']);logger['info']('[OUTBOUND]','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x6113('0x31')]('user:%s',_0x5d6a91[_0x6113('0x1b')]),_0x6113('0x90'),{'uri':_0x6113('0x91')+_0x48a1c9[_0x6113('0x80')]+_0x6113('0x92')+_0x702f84['id']});}})[_0x6113('0x2a')](function(_0x12dfe0){logger[_0x6113('0x2b')]('[OUTBOUND]',JSON[_0x6113('0xe')](_0x12dfe0));});};exports[_0x6113('0x9b')]=function(_0x3c34a1,_0x52b01a,_0x21ba4f,_0x17efd7,_0x582960,_0x29c0e9){var _0x52a3cd,_0x1b7406,_0x19ec08;_0x29c0e9[_0x6113('0x80')]=intUtil[_0x6113('0x81')](_0x29c0e9[_0x6113('0x80')]);_0x29c0e9[_0x6113('0x82')]=intUtil[_0x6113('0x81')](_0x29c0e9[_0x6113('0x82')]);if(_0x582960&&_0x582960['monitor_format']){logger[_0x6113('0x2e')]('['+_0x52b01a['lastevent']['toUpperCase']()+']',_0x6113('0x85'));_0x52b01a[_0x6113('0x86')]=_0x29c0e9['serverUrl']+_0x6113('0x87')+_0x52b01a['uniqueid']+'/downloads?type=uniqueid&token='+md5(_0x52b01a[_0x6113('0x88')]);}else{_0x52b01a[_0x6113('0x86')]='';}var _0x67ea5d=_0x29c0e9[_0x6113('0x80')]===_0x6113('0x8a')?'eu':_0x6113('0x96');return getAccessToken(_0x29c0e9)[_0x6113('0x27')](function(_0x1bcf88){_0x19ec08=_0x1bcf88;return getUser(_0x19ec08,_0x67ea5d,_0x29c0e9);})[_0x6113('0x27')](function(_0x4fd3f8){_0x52a3cd=_0x4fd3f8;logger['info'](_0x6113('0x8b'),_0x52a3cd['id']);return getEndUser(_0x19ec08,_0x67ea5d,_0x29c0e9,_0x52b01a[_0x6113('0x8c')],_0x52b01a[_0x6113('0x8d')],_0x52a3cd,_0x21ba4f);})[_0x6113('0x27')](function(_0x2bf5e5){_0x1b7406=_0x2bf5e5;return getCall(_0x19ec08,_0x67ea5d,_0x29c0e9,_0x52a3cd,_0x1b7406,_0x21ba4f,_0x52b01a,'Inbound');})[_0x6113('0x27')](function(_0x24f29c){if(_0x24f29c){logger[_0x6113('0x2e')]('The\x20Call\x20ID\x20is:',_0x24f29c['id']);}})['catch'](function(_0x12dcba){logger[_0x6113('0x2b')]('['+_0x52b01a[_0x6113('0x6a')][_0x6113('0x9c')]()+']',JSON[_0x6113('0xe')](_0x12dcba));});}; \ No newline at end of file +var _0x98e5=['variableName','toString','customVariable','Variable','name','toLowerCase','indexOf','split','isNil','access_token','isBefore','expires_in','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.com.cn','https://accounts.zoho.eu','POST','/oauth/v2/token','refreshToken','clientId','clientSecret','refresh_token','then','seconds','error','Failing\x20creating\x20the\x20access_token','stack','info','Search\x20user','GET','format','https://www.zohoapis.%s/crm/v2/users','ActiveUsers','users','isArrayLikeObject','findIndex','email','Using\x20the\x20admin\x20account!','profile','Administrator','user','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','data','enduserType','catch','https://www.zohoapis.','/crm/v2/','startCase','moduleCreate','role','first_name','last_name','Zoho-oauthtoken\x20','code','SUCCESS','details','log','CREATE\x20ERROR','moduleSearch','contact_lead','uri','/crm/v2/Contacts/search?criteria=((Phone:equals:','/crm/v2/Leads/search?criteria=((Phone:equals:','Leads','nothing','contact','Contacts','lead','Creating\x20new\x20call...','administrator','Subject','getString','Subjects','Description','Descriptions','Who_Id','First_Name','Last_Name','What_Id','$se_module','talktime','mm:ss','answertime','endtime','Call_Duration','utc','YYYY-MM-DDTHH:mm:ss','starttime','lastevent','called','Call_Result','Called','complete','connect','Answered','rejected','Rejected','Abandoned','Timeout','agentcalledAt','Call_Type','merge','Call\x20created!','err','queue','host','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','serverUrl','uniqueid','/downloads?type=uniqueid&token=','zoho.eu','calleridname','Inbound','The\x20Call\x20ID\x20is:','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','outbound','recordingFormat','none','[OUTBOUND]','/api/voice/recordings/','com','destcalleridname','destcalleridnum','Outbound','https://crm.','/crm/EntityInfo.do?module=Calls&id=','unmanaged','toUpperCase','The\x20User\x20ID\x20is:','calleridnum','util','./util','ioredis','bluebird','../../../../config/logger','defaults','localhost','socket.io-emitter','redis','emit','debug','[HTTP]','stringify','forEach','includes','string','picklist','type','idField','content','variable'];(function(_0x38c24b,_0x5a4734){var _0x4f8737=function(_0x4da2ee){while(--_0x4da2ee){_0x38c24b['push'](_0x38c24b['shift']());}};_0x4f8737(++_0x5a4734);}(_0x98e5,0x8a));var _0x598e=function(_0x3e0b24,_0x5bc844){_0x3e0b24=_0x3e0b24-0x0;var _0x32ae20=_0x98e5[_0x3e0b24];return _0x32ae20;};'use strict';var _=require('lodash');var rp=require('request-promise');var md5=require('md5');var util=require(_0x598e('0x0'));var intUtil=require(_0x598e('0x1'));var moment=require('moment');var Redis=require(_0x598e('0x2'));var BPromise=require(_0x598e('0x3'));var config=require('../../../../config/environment');var logger=require(_0x598e('0x4'))('zoho');config['redis']=_[_0x598e('0x5')](config['redis'],{'host':_0x598e('0x6'),'port':0x18eb});var io=require(_0x598e('0x7'))(new Redis(config[_0x598e('0x8')]));function emit(_0x3e0212,_0x9dc046,_0x3e6e86){io['to'](_0x3e0212)[_0x598e('0x9')](_0x9dc046,_0x3e6e86);}function request(_0x2550b9){logger[_0x598e('0xa')](_0x598e('0xb'),JSON[_0x598e('0xc')](_0x2550b9));return rp(_0x2550b9);}function getCustomFields(_0x4883b1,_0x44e441){var _0xb233cc={};if(_0x4883b1['length']>0x0){_[_0x598e('0xd')](_0x4883b1,function(_0x547579){if(_[_0x598e('0xe')]([_0x598e('0xf'),_0x598e('0x10')],_0x547579[_0x598e('0x11')])&&_0x547579[_0x598e('0x12')]){_0xb233cc[_0x547579['idField']]=_0x547579[_0x598e('0x13')]['toString']();}else if(_0x547579[_0x598e('0x11')]===_0x598e('0x14')&&_0x547579['variableName']&&_0x547579[_0x598e('0x12')]&&_0x44e441[_0x547579[_0x598e('0x15')]]){_0xb233cc[_0x547579[_0x598e('0x12')]]=_0x44e441[_0x547579[_0x598e('0x15')]][_0x598e('0x16')]();}else if(_0x547579[_0x598e('0x11')]===_0x598e('0x17')&&_0x547579['Variable']&&_0x547579[_0x598e('0x18')][_0x598e('0x19')]&&_0x547579[_0x598e('0x12')]&&_0x44e441[_0x547579[_0x598e('0x18')]['name'][_0x598e('0x1a')]()]){_0xb233cc[_0x547579[_0x598e('0x12')]]=_0x44e441[_0x547579[_0x598e('0x18')][_0x598e('0x19')][_0x598e('0x1a')]()][_0x598e('0x16')]();}});}return _0xb233cc;}function getName(_0x4495a8){if(_0x4495a8[_0x598e('0x1b')]('\x20')>0x0){var _0x138dd6=_0x4495a8[_0x598e('0x1c')](/ (.+)/);if(_0x138dd6[0x1]){return _0x138dd6;}}return[_0x4495a8,_0x4495a8];}var accountsTokens={};function getAccessToken(_0x17e5f1){return new Promise(function(_0x2a1a65,_0x128666){if(!_[_0x598e('0x1d')](accountsTokens[_0x17e5f1['id']])&&!_[_0x598e('0x1d')](accountsTokens[_0x17e5f1['id']][_0x598e('0x1e')])){if(moment()[_0x598e('0x1f')](accountsTokens[_0x17e5f1['id']][_0x598e('0x20')])){_0x2a1a65(accountsTokens[_0x17e5f1['id']]['access_token']);}}var _0x193faa;switch(_0x17e5f1['zone']){case'US':_0x193faa=_0x598e('0x21');break;case'AU':_0x193faa=_0x598e('0x22');break;case'EU':_0x193faa='https://accounts.zoho.eu';break;case'IN':_0x193faa=_0x598e('0x23');break;case'CN':_0x193faa=_0x598e('0x24');break;default:_0x193faa=_0x598e('0x25');break;}var _0xc83fcf={'method':_0x598e('0x26'),'uri':_0x193faa+_0x598e('0x27'),'qs':{'refresh_token':_0x17e5f1[_0x598e('0x28')],'client_id':_0x17e5f1[_0x598e('0x29')],'client_secret':_0x17e5f1[_0x598e('0x2a')],'grant_type':_0x598e('0x2b')},'json':!![]};return rp(_0xc83fcf)[_0x598e('0x2c')](function(_0x5d63ce){accountsTokens[_0x17e5f1['id']]={'access_token':_0x5d63ce[_0x598e('0x1e')],'expires_in':moment()['add'](_0x5d63ce[_0x598e('0x20')],_0x598e('0x2d'))};_0x2a1a65(_0x5d63ce[_0x598e('0x1e')]);})['catch'](function(_0x1a49d9){logger[_0x598e('0x2e')](_0x598e('0x2f'),_0x1a49d9[_0x598e('0x30')]);_0x128666(_0x1a49d9);});});}function getUser(_0x43ddf0,_0x5ecac3,_0x4fad2d,_0x5c541c){logger[_0x598e('0x31')](_0x598e('0x32'));return request({'method':_0x598e('0x33'),'uri':util[_0x598e('0x34')](_0x598e('0x35'),_0x5ecac3),'qs':{'type':_0x598e('0x36')},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x43ddf0},'json':!![]})[_0x598e('0x2c')](function(_0x1462fb){if(_0x1462fb[_0x598e('0x37')]){var _0x1e5b3f=-0x1;if(_[_0x598e('0x38')](_0x1462fb['users'])){if(!_[_0x598e('0x1d')](_0x5c541c)){_0x1e5b3f=_[_0x598e('0x39')](_0x1462fb[_0x598e('0x37')],function(_0x5185c9){return _0x5185c9[_0x598e('0x3a')]===_0x5c541c;});}if(_0x1e5b3f>=0x0){logger[_0x598e('0x31')]('Agent\x20found!');}else{logger[_0x598e('0x31')](_0x598e('0x3b'));_0x1e5b3f=_[_0x598e('0x39')](_0x1462fb[_0x598e('0x37')],function(_0x143375){return _0x143375[_0x598e('0x3c')]['name']===_0x598e('0x3d');});}return _0x1462fb[_0x598e('0x37')][_0x1e5b3f];}else{if(_0x1462fb[_0x598e('0x3e')]['profile']['name']===_0x598e('0x3d')){logger['info'](_0x598e('0x3b'));user=_0x1462fb[_0x598e('0x3e')];return user;}else{logger['error']('The\x20failing\x20result\x20is',JSON[_0x598e('0xc')](_0x1462fb));throw new Error('Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20'+JSON[_0x598e('0xc')](_0x1462fb));}}}else{logger[_0x598e('0x2e')](_0x598e('0x3f'),JSON['stringify'](_0x1462fb));throw new Error(_0x598e('0x40')+JSON['stringify'](_0x1462fb));}})['catch'](function(_0x26948c){console[_0x598e('0x2e')](_0x26948c);});}function getZohoUser(_0x4d2ead,_0x510fb4){return new BPromise(function(_0xa3de11,_0x453de0){request(_0x4d2ead)['then'](function(_0xd20e27){var _0x1efff4=null;if(_0xd20e27){_0x1efff4=_0xd20e27[_0x598e('0x41')][0x0];_0x1efff4[_0x598e('0x42')]=_0x510fb4;}_0xa3de11(_0x1efff4);})[_0x598e('0x43')](function(_0x3f5121){_0x453de0(_0x3f5121);});});}function createEndUser(_0x88c75f,_0x54b8e0,_0x3ee264,_0x20fe1c,_0x2873ee,_0x160f6a){var _0x3ee264=getName(_0x3ee264);return request({'method':_0x598e('0x26'),'uri':_0x598e('0x44')+_0x54b8e0+_0x598e('0x45')+_[_0x598e('0x46')](_0x160f6a[_0x598e('0x47')])+'s','body':{'data':[{'Last_Name':_0x3ee264[0x1],'First_Name':_0x3ee264[0x0],'Phone':_0x20fe1c,'Owner':{'name':!_[_0x598e('0x1d')](_0x2873ee[_0x598e('0x48')][_0x598e('0x19')])?_0x2873ee['role']['name']:!_[_0x598e('0x1d')](_0x2873ee[_0x598e('0x49')])?_0x2873ee[_0x598e('0x49')]+'\x20'+_0x2873ee[_0x598e('0x4a')]:_0x2873ee['last_name'],'id':_0x2873ee['id']}}]},'headers':{'Authorization':_0x598e('0x4b')+_0x88c75f},'json':!![]})[_0x598e('0x2c')](function(_0x2c4adf){if(_0x2c4adf&&_0x2c4adf['data'][0x0][_0x598e('0x4c')]===_0x598e('0x4d')){var _0x1b36c7=_0x2c4adf[_0x598e('0x41')][0x0][_0x598e('0x4e')];_0x1b36c7[_0x598e('0x42')]=_[_0x598e('0x46')](_0x160f6a[_0x598e('0x47')])+'s';return _0x1b36c7;}logger[_0x598e('0x2e')](_0x598e('0x3f'),JSON[_0x598e('0xc')](data));throw new Error('Error:\x20'+JSON['stringify'](data));})['catch'](function(_0x156412){console[_0x598e('0x4f')](_0x598e('0x50'),_0x156412);});}function getEndUser(_0x49f92a,_0x2076f9,_0x422f26,_0x1e08f3,_0x4c5b39,_0x307d2e,_0x1b405b){var _0x412695={'method':'GET','uri':'','headers':{'Authorization':_0x598e('0x4b')+_0x49f92a},'json':!![]};switch(_0x1b405b[_0x598e('0x51')]){case _0x598e('0x52'):_0x412695[_0x598e('0x53')]=_0x598e('0x44')+_0x2076f9+_0x598e('0x54')+_0x4c5b39+'))';return getZohoUser(_0x412695,'Contacts')[_0x598e('0x2c')](function(_0xeeaa23){if(_0xeeaa23)return _0xeeaa23;_0x412695['uri']=_0x598e('0x44')+_0x2076f9+_0x598e('0x55')+_0x4c5b39+'))';return getZohoUser(_0x412695,_0x598e('0x56'))['then'](function(_0x59e67b){if(_0x59e67b)return _0x59e67b;if(_0x1b405b['moduleCreate']!=_0x598e('0x57')){return createEndUser(_0x49f92a,_0x2076f9,_0x1e08f3,_0x4c5b39,_0x307d2e,_0x1b405b);}else{return{};}});});break;case _0x598e('0x58'):_0x412695['uri']='https://www.zohoapis.'+_0x2076f9+_0x598e('0x54')+_0x4c5b39+'))';return getZohoUser(_0x412695,_0x598e('0x59'))['then'](function(_0x5c8aa5){if(_0x5c8aa5)return _0x5c8aa5;if(_0x1b405b[_0x598e('0x47')]!=_0x598e('0x57')){return createEndUser(_0x49f92a,_0x2076f9,_0x1e08f3,_0x4c5b39,_0x307d2e,_0x1b405b);}else{return{};}});break;case _0x598e('0x5a'):_0x412695[_0x598e('0x53')]='https://www.zohoapis.'+_0x2076f9+'/crm/v2/Leads/search?criteria=((Phone:equals:'+_0x4c5b39+'))';return getZohoUser(_0x412695,_0x598e('0x56'))['then'](function(_0x36279f){if(_0x36279f)return _0x36279f;if(_0x1b405b['moduleCreate']!=_0x598e('0x57')){return createEndUser(_0x49f92a,_0x2076f9,_0x1e08f3,_0x4c5b39,_0x307d2e,_0x1b405b);}else{return{};}});break;}}function getCall(_0x2f7641,_0x16105d,_0x46d71f,_0x40eb24,_0x23782a,_0x2532fc,_0x5b06b5,_0x4539f9){logger[_0x598e('0x31')](_0x598e('0x5b'));var _0x358adf={};_0x358adf['Owner']={'name':!_[_0x598e('0x1d')](_0x40eb24[_0x598e('0x48')][_0x598e('0x19')])&&!_[_0x598e('0x1d')](_0x40eb24[_0x598e('0x3c')][_0x598e('0x19')])&&_0x40eb24[_0x598e('0x3c')]['name']===_0x598e('0x5c')?_0x40eb24[_0x598e('0x48')][_0x598e('0x19')]:!_[_0x598e('0x1d')](_0x40eb24['first_name'])?_0x40eb24[_0x598e('0x49')]+'\x20'+_0x40eb24['last_name']:_0x40eb24['last_name'],'id':_0x40eb24['id']};_0x358adf[_0x598e('0x5d')]=intUtil[_0x598e('0x5e')](_0x2532fc[_0x598e('0x5f')],_0x5b06b5,'\x20');_0x358adf[_0x598e('0x60')]=intUtil[_0x598e('0x5e')](_0x2532fc[_0x598e('0x61')],_0x5b06b5,'\x0a');if(_0x23782a[_0x598e('0x42')]===_0x598e('0x59')){_0x358adf[_0x598e('0x62')]={'name':!_[_0x598e('0x1d')](_0x23782a['Full_Name'])?_0x23782a['Full_Name']:!_[_0x598e('0x1d')](_0x23782a[_0x598e('0x63')])?_0x23782a[_0x598e('0x63')]+'\x20'+_0x23782a[_0x598e('0x64')]:_0x23782a[_0x598e('0x64')],'id':_0x23782a['id']};}if(_0x23782a[_0x598e('0x42')]===_0x598e('0x56')){_0x358adf[_0x598e('0x65')]={'name':!_[_0x598e('0x1d')](_0x23782a['Full_Name'])?_0x23782a['Full_Name']:!_[_0x598e('0x1d')](_0x23782a[_0x598e('0x63')])?_0x23782a[_0x598e('0x63')]+'\x20'+_0x23782a['Last_Name']:_0x23782a[_0x598e('0x64')],'id':_0x23782a['id']};_0x358adf[_0x598e('0x66')]=_[_0x598e('0x46')](_0x23782a[_0x598e('0x42')]);}if(_0x5b06b5['talktime']){_0x358adf['Call_Duration']=moment['utc'](parseInt(_0x5b06b5[_0x598e('0x67')])*0x3e8)['format'](_0x598e('0x68'));}else if(_0x5b06b5[_0x598e('0x69')]&&_0x5b06b5[_0x598e('0x6a')]){_0x358adf[_0x598e('0x6b')]=moment[_0x598e('0x6c')](moment(_0x5b06b5[_0x598e('0x6a')],_0x598e('0x6d'))['diff'](moment(_0x5b06b5[_0x598e('0x6e')],'YYYY-MM-DDTHH:mm:ss')))[_0x598e('0x34')]('mm:ss');}switch(_0x5b06b5[_0x598e('0x6f')]){case _0x598e('0x70'):_0x358adf[_0x598e('0x71')]=_0x598e('0x72');break;case _0x598e('0x73'):case _0x598e('0x74'):_0x358adf[_0x598e('0x71')]=_0x598e('0x75');break;case _0x598e('0x76'):_0x358adf[_0x598e('0x71')]=_0x598e('0x77');break;case'abandoned':_0x358adf['Call_Result']=_0x598e('0x78');break;case'timeout':_0x358adf[_0x598e('0x71')]=_0x598e('0x79');default:}_0x358adf['Call_Start_Time']=(_0x4539f9==='outbound'?moment(_0x5b06b5[_0x598e('0x6e')])['format'](_0x598e('0x6d')):moment(_0x5b06b5[_0x598e('0x7a')])[_0x598e('0x34')](_0x598e('0x6d')))||moment()[_0x598e('0x34')]('YYYY-MM-DDTHH:mm:ss');_0x358adf[_0x598e('0x7b')]=_0x4539f9||'Inbound';_0x358adf=_[_0x598e('0x7c')](_0x358adf,getCustomFields(_0x2532fc['Fields'],_0x5b06b5));return request({'method':_0x598e('0x26'),'uri':'https://www.zohoapis.'+_0x16105d+'/crm/v2/Calls','headers':{'Authorization':_0x598e('0x4b')+_0x2f7641},'body':{'data':[_0x358adf]},'json':!![]})[_0x598e('0x2c')](function(_0x983b9a){if(_0x983b9a&&_0x983b9a[_0x598e('0x41')][0x0][_0x598e('0x4c')]==='SUCCESS'){logger[_0x598e('0x31')](_0x598e('0x7d'));return{'id':_0x983b9a['data'][0x0][_0x598e('0x4e')]['id']};}})[_0x598e('0x43')](function(_0x396116){logger[_0x598e('0x31')](_0x598e('0x7e'),_0x396116['stack']);console['log']('err',_0x396116);});}exports[_0x598e('0x7f')]=function(_0x3b6a0a,_0x35ecda,_0x51c5f2,_0xd9a61,_0x5b4136,_0x154c0c){var _0x2a90de,_0x110834,_0xdf3c13;_0x154c0c[_0x598e('0x80')]=intUtil[_0x598e('0x81')](_0x154c0c['host']);_0x154c0c['serverUrl']=intUtil[_0x598e('0x81')](_0x154c0c['serverUrl']);if(_0x5b4136&&_0x5b4136[_0x598e('0x82')]){logger[_0x598e('0x31')](_0x598e('0x83'),_0x598e('0x84'));_0x35ecda[_0x598e('0x85')]=_0x154c0c[_0x598e('0x86')]+'/api/voice/recordings/'+_0x35ecda[_0x598e('0x87')]+_0x598e('0x88')+md5(_0x35ecda['uniqueid']);}else{_0x35ecda[_0x598e('0x85')]='';}var _0x46383a=_0x154c0c['host']===_0x598e('0x89')?'eu':'com';return getAccessToken(_0x154c0c)[_0x598e('0x2c')](function(_0x375943){_0xdf3c13=_0x375943;return getUser(_0xdf3c13,_0x46383a,_0x154c0c,_0xd9a61[_0x598e('0x3a')]);})[_0x598e('0x2c')](function(_0x267f18){_0x2a90de=_0x267f18;logger[_0x598e('0x31')]('The\x20User\x20ID\x20is:',_0x2a90de['id']);return getEndUser(_0xdf3c13,_0x46383a,_0x154c0c,_0x35ecda[_0x598e('0x8a')],_0x35ecda['calleridnum'],_0x2a90de,_0x51c5f2);})[_0x598e('0x2c')](function(_0x51e190){_0x110834=_0x51e190;return getCall(_0xdf3c13,_0x46383a,_0x154c0c,_0x2a90de,_0x110834,_0x51c5f2,_0x35ecda,_0x598e('0x8b'));})[_0x598e('0x2c')](function(_0x418883){if(_0x418883){logger[_0x598e('0x31')](_0x598e('0x8c'),_0x418883['id']);logger['info']('[QUEUE]',_0x598e('0x8d'));emit(util[_0x598e('0x34')](_0x598e('0x8e'),_0xd9a61[_0x598e('0x19')]),_0x598e('0x8f'),{'uri':'https://crm.'+_0x154c0c[_0x598e('0x80')]+'/crm/EntityInfo.do?module=Calls&id='+_0x418883['id']});}})[_0x598e('0x43')](function(_0x269a9d){logger[_0x598e('0x2e')](_0x598e('0x83'),JSON['stringify'](_0x269a9d));});};exports[_0x598e('0x90')]=function(_0x5609cc,_0x2803b8,_0x37f9cc,_0x4b61e3,_0x115239,_0x2d42e3,_0x5040d5){var _0x4f0a8c,_0x51b403,_0x5c1a49;_0x2d42e3[_0x598e('0x80')]=intUtil[_0x598e('0x81')](_0x2d42e3['host']);_0x2d42e3[_0x598e('0x86')]=intUtil[_0x598e('0x81')](_0x2d42e3['serverUrl']);if(_0x5040d5&&_0x5040d5[_0x598e('0x91')]&&_0x5040d5[_0x598e('0x91')]!==_0x598e('0x92')){logger[_0x598e('0x31')](_0x598e('0x93'),'Recording\x20is\x20enabled!');_0x2803b8[_0x598e('0x85')]=_0x2d42e3[_0x598e('0x86')]+_0x598e('0x94')+_0x2803b8[_0x598e('0x87')]+_0x598e('0x88')+md5(_0x2803b8[_0x598e('0x87')]);}var _0x5ee902=_0x2d42e3[_0x598e('0x80')]===_0x598e('0x89')?'eu':_0x598e('0x95');return getAccessToken(_0x2d42e3)['then'](function(_0x4c8011){_0x5c1a49=_0x4c8011;return getUser(_0x5c1a49,_0x5ee902,_0x2d42e3,_0x4b61e3[_0x598e('0x3a')]);})['then'](function(_0x12d0b4){_0x4f0a8c=_0x12d0b4;logger['info']('The\x20User\x20ID\x20is:',_0x4f0a8c['id']);return getEndUser(_0x5c1a49,_0x5ee902,_0x2d42e3,_0x2803b8[_0x598e('0x96')],_0x2803b8[_0x598e('0x97')],_0x4f0a8c,_0x37f9cc);})[_0x598e('0x2c')](function(_0x4d43ab){_0x51b403=_0x4d43ab;return getCall(_0x5c1a49,_0x5ee902,_0x2d42e3,_0x4f0a8c,_0x51b403,_0x37f9cc,_0x2803b8,_0x598e('0x98'));})[_0x598e('0x2c')](function(_0x14d992){if(_0x14d992){logger['info'](_0x598e('0x8c'),_0x14d992['id']);logger[_0x598e('0x31')](_0x598e('0x93'),_0x598e('0x8d'));emit(util['format']('user:%s',_0x4b61e3[_0x598e('0x19')]),_0x598e('0x8f'),{'uri':_0x598e('0x99')+_0x2d42e3[_0x598e('0x80')]+_0x598e('0x9a')+_0x14d992['id']});}})[_0x598e('0x43')](function(_0x3644b3){logger['error'](_0x598e('0x93'),JSON[_0x598e('0xc')](_0x3644b3));});};exports[_0x598e('0x9b')]=function(_0x46c1fe,_0x5e2d1c,_0x30cf9e,_0x2d3612,_0x2c3d07,_0x253154){var _0x51fe9a,_0x310072,_0x4b3105;_0x253154[_0x598e('0x80')]=intUtil[_0x598e('0x81')](_0x253154[_0x598e('0x80')]);_0x253154['serverUrl']=intUtil[_0x598e('0x81')](_0x253154['serverUrl']);if(_0x2c3d07&&_0x2c3d07[_0x598e('0x82')]){logger[_0x598e('0x31')]('['+_0x5e2d1c['lastevent'][_0x598e('0x9c')]()+']',_0x598e('0x84'));_0x5e2d1c[_0x598e('0x85')]=_0x253154[_0x598e('0x86')]+_0x598e('0x94')+_0x5e2d1c[_0x598e('0x87')]+_0x598e('0x88')+md5(_0x5e2d1c[_0x598e('0x87')]);}else{_0x5e2d1c[_0x598e('0x85')]='';}var _0x4556a2=_0x253154[_0x598e('0x80')]===_0x598e('0x89')?'eu':'com';return getAccessToken(_0x253154)[_0x598e('0x2c')](function(_0x483803){_0x4b3105=_0x483803;return getUser(_0x4b3105,_0x4556a2,_0x253154);})['then'](function(_0x4520da){_0x51fe9a=_0x4520da;logger[_0x598e('0x31')](_0x598e('0x9d'),_0x51fe9a['id']);return getEndUser(_0x4b3105,_0x4556a2,_0x253154,_0x5e2d1c[_0x598e('0x8a')],_0x5e2d1c[_0x598e('0x9e')],_0x51fe9a,_0x30cf9e);})['then'](function(_0x56b666){_0x310072=_0x56b666;return getCall(_0x4b3105,_0x4556a2,_0x253154,_0x51fe9a,_0x310072,_0x30cf9e,_0x5e2d1c,_0x598e('0x8b'));})[_0x598e('0x2c')](function(_0x2e33a1){if(_0x2e33a1){logger[_0x598e('0x31')](_0x598e('0x8c'),_0x2e33a1['id']);}})['catch'](function(_0x21a27e){logger[_0x598e('0x2e')]('['+_0x5e2d1c[_0x598e('0x6f')][_0x598e('0x9c')]()+']',JSON[_0x598e('0xc')](_0x21a27e));});}; \ 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 807dfed..1485505 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 _0x727c=['util','../../../../config/logger','trigger','data2','Script','data3','render','exec','error','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'];(function(_0x9b1a79,_0x2a1041){var _0x474c47=function(_0x8a2249){while(--_0x8a2249){_0x9b1a79['push'](_0x9b1a79['shift']());}};_0x474c47(++_0x2a1041);}(_0x727c,0x1d4));var _0xc727=function(_0x470f63,_0x48d80b){_0x470f63=_0x470f63-0x0;var _0x4f09e2=_0x727c[_0x470f63];return _0x4f09e2;};'use strict';var util=require(_0xc727('0x0'));var sh=require('shelljs');var Mustache=require('mustache');var logger=require(_0xc727('0x1'))(_0xc727('0x2'));exports['exec']=function(_0x50f636,_0xd4a2d1){var _0x32cbcb=_0x50f636[_0xc727('0x3')]?_0x50f636[_0xc727('0x3')]:_0xc727('0x4');var _0x2c9c28=_0x50f636[_0xc727('0x5')]?Mustache[_0xc727('0x6')](_0x50f636[_0xc727('0x5')],_0xd4a2d1):_0xd4a2d1;sh[_0xc727('0x7')](_0x2c9c28,function(_0x3f3dd5,_0x213eee,_0x20814b){if(_0x3f3dd5!==0x0){logger[_0xc727('0x8')](util[_0xc727('0x9')](_0xc727('0xa'),_0x32cbcb,_0x2c9c28,_0x3f3dd5,_0x20814b));}else{logger[_0xc727('0xb')](util[_0xc727('0x9')](_0xc727('0xc'),_0x32cbcb,_0x2c9c28,_0x213eee));}});}; \ No newline at end of file +var _0xba39=['Script','render','error','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','mustache','../../../../config/logger','trigger','exec','data2'];(function(_0x5436f1,_0x5ae4f6){var _0xfe9d35=function(_0x1cdf8f){while(--_0x1cdf8f){_0x5436f1['push'](_0x5436f1['shift']());}};_0xfe9d35(++_0x5ae4f6);}(_0xba39,0x19a));var _0x9ba3=function(_0x29e2da,_0x987293){_0x29e2da=_0x29e2da-0x0;var _0x1b1408=_0xba39[_0x29e2da];return _0x1b1408;};'use strict';var util=require(_0x9ba3('0x0'));var sh=require('shelljs');var Mustache=require(_0x9ba3('0x1'));var logger=require(_0x9ba3('0x2'))(_0x9ba3('0x3'));exports[_0x9ba3('0x4')]=function(_0x4af37b,_0x26f643){var _0x4a0c08=_0x4af37b[_0x9ba3('0x5')]?_0x4af37b['data2']:_0x9ba3('0x6');var _0x3ad78c=_0x4af37b['data3']?Mustache[_0x9ba3('0x7')](_0x4af37b['data3'],_0x26f643):_0x26f643;sh[_0x9ba3('0x4')](_0x3ad78c,function(_0xa29e32,_0x13c1c1,_0x436852){if(_0xa29e32!==0x0){logger[_0x9ba3('0x8')](util[_0x9ba3('0x9')](_0x9ba3('0xa'),_0x4a0c08,_0x3ad78c,_0xa29e32,_0x436852));}else{logger[_0x9ba3('0xb')](util[_0x9ba3('0x9')](_0x9ba3('0xc'),_0x4a0c08,_0x3ad78c,_0x13c1c1));}});}; \ 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 af2ace1..a893d69 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 _0x9f77=['data6','error','stack','data1','toUpperCase','GET','DELETE','POST','data7','body','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','info','format','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','then','isNil',',\x20request\x20body:\x20','object','stringify','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','statusCode','message','request-promise','mustache','../../../../config/logger','trigger','exec','render','data2','number','data5','headers'];(function(_0xe70e33,_0x142e07){var _0x152e5c=function(_0x511893){while(--_0x511893){_0xe70e33['push'](_0xe70e33['shift']());}};_0x152e5c(++_0x142e07);}(_0x9f77,0x116));var _0x79f7=function(_0x8cdb8,_0x3638c1){_0x8cdb8=_0x8cdb8-0x0;var _0x5e9a9e=_0x9f77[_0x8cdb8];return _0x5e9a9e;};'use strict';var rp=require(_0x79f7('0x0'));var util=require('util');var _=require('lodash');var Mustache=require(_0x79f7('0x1'));var logger=require(_0x79f7('0x2'))(_0x79f7('0x3'));exports[_0x79f7('0x4')]=function(_0x2cb4e2,_0x4aa9f1){var _0x5d9bb0,_0x2624ce;var _0x5f50ba={'method':_0x2cb4e2['data1']['toUpperCase'](),'uri':Mustache[_0x79f7('0x5')](_0x2cb4e2[_0x79f7('0x6')],_0x4aa9f1),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x2cb4e2['data5'])===_0x79f7('0x7')&&parseInt(_0x2cb4e2[_0x79f7('0x8')])>=0x1&&parseInt(_0x2cb4e2[_0x79f7('0x8')])<=0xa?parseInt(_0x2cb4e2['data5'])*0x3e8:0x5*0x3e8};try{_0x5f50ba[_0x79f7('0x9')]=_0x2cb4e2[_0x79f7('0xa')]?JSON['parse'](Mustache[_0x79f7('0x5')](_0x2cb4e2[_0x79f7('0xa')],_0x4aa9f1)):{};}catch(_0x2a87dc){logger[_0x79f7('0xb')](_0x2a87dc[_0x79f7('0xc')]);}switch(_0x2cb4e2[_0x79f7('0xd')][_0x79f7('0xe')]()){case _0x79f7('0xf'):case _0x79f7('0x10'):_0x5d9bb0=null;_0x5f50ba['qs']=_0x4aa9f1;break;case _0x79f7('0x11'):case'PUT':if(_0x2cb4e2[_0x79f7('0x12')]){try{_0x5d9bb0=JSON['parse'](Mustache[_0x79f7('0x5')](_0x2cb4e2[_0x79f7('0x12')],_0x4aa9f1));_0x5f50ba[_0x79f7('0x13')]=_0x5d9bb0;}catch(_0x46e256){logger[_0x79f7('0xb')](_0x46e256[_0x79f7('0xc')]);logger[_0x79f7('0xb')](_0x79f7('0x14'));}}else{_0x5d9bb0=_0x4aa9f1;_0x5f50ba[_0x79f7('0x13')]=_0x5d9bb0;}break;}logger[_0x79f7('0x15')](util[_0x79f7('0x16')](_0x79f7('0x17'),_0x2cb4e2[_0x79f7('0xd')],_0x2cb4e2[_0x79f7('0x6')],JSON['stringify'](_0x5f50ba)));rp(_0x5f50ba)[_0x79f7('0x18')](function(_0x5b5455){_0x5d9bb0=!_[_0x79f7('0x19')](_0x5d9bb0)?_0x79f7('0x1a')+_0x5d9bb0:'';_0x2624ce=typeof _0x5b5455[_0x79f7('0x13')]===_0x79f7('0x1b')?JSON[_0x79f7('0x1c')](_0x5b5455[_0x79f7('0x13')]):_0x5b5455['body'];logger['info'](util['format'](_0x79f7('0x1d'),_0x2cb4e2['data1'],_0x2cb4e2['data2'],_0x5b5455[_0x79f7('0x1e')],_0x2624ce));})['catch'](function(_0x27197c){logger[_0x79f7('0xb')](util['format']('%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s',_0x2cb4e2[_0x79f7('0xd')],_0x2cb4e2[_0x79f7('0x6')],_0x27197c[_0x79f7('0x1e')],_0x27197c['name'],_0x27197c[_0x79f7('0x1f')]));});}; \ No newline at end of file +var _0xc99f=['request-promise','util','lodash','mustache','exec','data1','render','number','data5','headers','data6','error','stack','toUpperCase','GET','DELETE','POST','parse','body','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','format','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','data2','isNil',',\x20request\x20body:\x20','object','info','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s','statusCode','message'];(function(_0x397fec,_0x231714){var _0x39572e=function(_0xc64636){while(--_0xc64636){_0x397fec['push'](_0x397fec['shift']());}};_0x39572e(++_0x231714);}(_0xc99f,0x7c));var _0xfc99=function(_0x529b9a,_0x3ddafe){_0x529b9a=_0x529b9a-0x0;var _0x15b1f2=_0xc99f[_0x529b9a];return _0x15b1f2;};'use strict';var rp=require(_0xfc99('0x0'));var util=require(_0xfc99('0x1'));var _=require(_0xfc99('0x2'));var Mustache=require(_0xfc99('0x3'));var logger=require('../../../../config/logger')('trigger');exports[_0xfc99('0x4')]=function(_0x1b0298,_0x1f1c5d){var _0x1f27d3,_0x502cf4;var _0x3a8f64={'method':_0x1b0298[_0xfc99('0x5')]['toUpperCase'](),'uri':Mustache[_0xfc99('0x6')](_0x1b0298['data2'],_0x1f1c5d),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x1b0298['data5'])===_0xfc99('0x7')&&parseInt(_0x1b0298[_0xfc99('0x8')])>=0x1&&parseInt(_0x1b0298[_0xfc99('0x8')])<=0xa?parseInt(_0x1b0298[_0xfc99('0x8')])*0x3e8:0x5*0x3e8};try{_0x3a8f64[_0xfc99('0x9')]=_0x1b0298[_0xfc99('0xa')]?JSON['parse'](Mustache[_0xfc99('0x6')](_0x1b0298[_0xfc99('0xa')],_0x1f1c5d)):{};}catch(_0xaa48c2){logger[_0xfc99('0xb')](_0xaa48c2[_0xfc99('0xc')]);}switch(_0x1b0298[_0xfc99('0x5')][_0xfc99('0xd')]()){case _0xfc99('0xe'):case _0xfc99('0xf'):_0x1f27d3=null;_0x3a8f64['qs']=_0x1f1c5d;break;case _0xfc99('0x10'):case'PUT':if(_0x1b0298['data7']){try{_0x1f27d3=JSON[_0xfc99('0x11')](Mustache[_0xfc99('0x6')](_0x1b0298['data7'],_0x1f1c5d));_0x3a8f64[_0xfc99('0x12')]=_0x1f27d3;}catch(_0x446c08){logger[_0xfc99('0xb')](_0x446c08[_0xfc99('0xc')]);logger['error'](_0xfc99('0x13'));}}else{_0x1f27d3=_0x1f1c5d;_0x3a8f64[_0xfc99('0x12')]=_0x1f27d3;}break;}logger['info'](util[_0xfc99('0x14')](_0xfc99('0x15'),_0x1b0298[_0xfc99('0x5')],_0x1b0298[_0xfc99('0x16')],JSON['stringify'](_0x3a8f64)));rp(_0x3a8f64)['then'](function(_0x414f9d){_0x1f27d3=!_[_0xfc99('0x17')](_0x1f27d3)?_0xfc99('0x18')+_0x1f27d3:'';_0x502cf4=typeof _0x414f9d[_0xfc99('0x12')]===_0xfc99('0x19')?JSON['stringify'](_0x414f9d[_0xfc99('0x12')]):_0x414f9d[_0xfc99('0x12')];logger[_0xfc99('0x1a')](util[_0xfc99('0x14')](_0xfc99('0x1b'),_0x1b0298['data1'],_0x1b0298[_0xfc99('0x16')],_0x414f9d['statusCode'],_0x502cf4));})['catch'](function(_0x4e5144){logger[_0xfc99('0xb')](util[_0xfc99('0x14')](_0xfc99('0x1c'),_0x1b0298['data1'],_0x1b0298[_0xfc99('0x16')],_0x4e5144[_0xfc99('0x1d')],_0x4e5144['name'],_0x4e5144[_0xfc99('0x1e')]));});}; \ No newline at end of file diff --git a/server/services/email/client.js b/server/services/email/client.js index eebc269..d0def79 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 _0x7619=['then','debug','rpc','error','message','catch','exports','bluebird','../../config/logger','routing','client','Request'];(function(_0x599f41,_0x4db732){var _0x2e4d58=function(_0x14c882){while(--_0x14c882){_0x599f41['push'](_0x599f41['shift']());}};_0x2e4d58(++_0x4db732);}(_0x7619,0x73));var _0x9761=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7619[_0x3dd15e];return _0x231fd0;};'use strict';var jayson=require('jayson/promise');var BPromise=require(_0x9761('0x0'));var logger=require(_0x9761('0x1'))(_0x9761('0x2'));var client=jayson[_0x9761('0x3')]['http']({'port':0x2329});client[_0x9761('0x4')]=function(_0x268b61,_0x2e6bbc){return new BPromise(function(_0x2f21c4,_0x372e51){return client['request'](_0x268b61,_0x2e6bbc)[_0x9761('0x5')](function(_0x362b90){logger[_0x9761('0x6')](_0x9761('0x7'),_0x9761('0x2'),_0x268b61,_0x2e6bbc,_0x362b90);if(_0x362b90['error']){logger[_0x9761('0x8')](_0x9761('0x7'),'routing',_0x268b61,_0x362b90[_0x9761('0x8')]['message'],_0x2e6bbc);return _0x372e51(_0x362b90[_0x9761('0x8')][_0x9761('0x9')]);}else{return _0x2f21c4(_0x362b90['result']);}})[_0x9761('0xa')](function(_0x389bb9){logger['error'](_0x9761('0x7'),_0x9761('0x2'),_0x268b61,_0x389bb9,_0x2e6bbc);return _0x372e51(_0x389bb9);});});};module[_0x9761('0xb')]=client; \ No newline at end of file +var _0x483f=['message','result','exports','jayson/promise','bluebird','../../config/logger','routing','client','http','Request','then','debug','rpc','error'];(function(_0xfe2d46,_0x42f1dd){var _0x41aeba=function(_0x45defb){while(--_0x45defb){_0xfe2d46['push'](_0xfe2d46['shift']());}};_0x41aeba(++_0x42f1dd);}(_0x483f,0xb9));var _0xf483=function(_0x40a9d9,_0x399e86){_0x40a9d9=_0x40a9d9-0x0;var _0x455d1b=_0x483f[_0x40a9d9];return _0x455d1b;};'use strict';var jayson=require(_0xf483('0x0'));var BPromise=require(_0xf483('0x1'));var logger=require(_0xf483('0x2'))(_0xf483('0x3'));var client=jayson[_0xf483('0x4')][_0xf483('0x5')]({'port':0x2329});client[_0xf483('0x6')]=function(_0x2cf045,_0xf0c73d){return new BPromise(function(_0x1d6262,_0x1508a5){return client['request'](_0x2cf045,_0xf0c73d)[_0xf483('0x7')](function(_0x320066){logger[_0xf483('0x8')](_0xf483('0x9'),_0xf483('0x3'),_0x2cf045,_0xf0c73d,_0x320066);if(_0x320066[_0xf483('0xa')]){logger[_0xf483('0xa')](_0xf483('0x9'),_0xf483('0x3'),_0x2cf045,_0x320066[_0xf483('0xa')][_0xf483('0xb')],_0xf0c73d);return _0x1508a5(_0x320066['error'][_0xf483('0xb')]);}else{return _0x1d6262(_0x320066[_0xf483('0xc')]);}})['catch'](function(_0x51ff9){logger[_0xf483('0xa')]('rpc',_0xf483('0x3'),_0x2cf045,_0x51ff9,_0xf0c73d);return _0x1508a5(_0x51ff9);});});};module[_0xf483('0xd')]=client; \ No newline at end of file diff --git a/server/services/email/index.js b/server/services/email/index.js index 4de75da..b6da7be 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 _0x3e66=['getSettings','catch','error','./server','./realtime','./rpc/mailAccount','./rpc/setting','../../config/logger','email','resolve','then','initMailAccounts','refresh','mailAccounts'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x3e66,0x1c3));var _0x63e6=function(_0x5833d9,_0x539b24){_0x5833d9=_0x5833d9-0x0;var _0x6b34c1=_0x3e66[_0x5833d9];return _0x6b34c1;};'use strict';var server=require(_0x63e6('0x0'));var Realtime=require(_0x63e6('0x1'));var EmailChannel=require('./lib/email');var mailAccount=require(_0x63e6('0x2'));var setting=require(_0x63e6('0x3'));var logger=require(_0x63e6('0x4'))(_0x63e6('0x5'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return Promise[_0x63e6('0x6')]()[_0x63e6('0x7')](mailAccount['getMailAccounts']())[_0x63e6('0x7')](realtime[_0x63e6('0x8')]())[_0x63e6('0x7')](function(){email[_0x63e6('0x9')](realtime[_0x63e6('0xa')]);return realtime;});}function main(){return server['listen'](realtime,email)[_0x63e6('0x7')](function(){return initRealtime();})['then'](function(){return setting[_0x63e6('0xb')]();})[_0x63e6('0x7')](function(_0x53bb0f){return setInterval(initRealtime,_0x53bb0f['loginMailFrequency']*0x3e8);})[_0x63e6('0xc')](function(_0x1bba77){logger[_0x63e6('0xd')]('Email\x20service\x20initialization',_0x1bba77);});}main(); \ No newline at end of file +var _0xb249=['./server','./lib/email','./rpc/mailAccount','./rpc/setting','email','resolve','getMailAccounts','initMailAccounts','then','refresh','mailAccounts','listen','getSettings','error'];(function(_0x9cd4c3,_0x1c9b2c){var _0x4c9025=function(_0x25b3c6){while(--_0x25b3c6){_0x9cd4c3['push'](_0x9cd4c3['shift']());}};_0x4c9025(++_0x1c9b2c);}(_0xb249,0x150));var _0x9b24=function(_0x287f4c,_0x56f996){_0x287f4c=_0x287f4c-0x0;var _0x5e5db0=_0xb249[_0x287f4c];return _0x5e5db0;};'use strict';var server=require(_0x9b24('0x0'));var Realtime=require('./realtime');var EmailChannel=require(_0x9b24('0x1'));var mailAccount=require(_0x9b24('0x2'));var setting=require(_0x9b24('0x3'));var logger=require('../../config/logger')(_0x9b24('0x4'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return Promise[_0x9b24('0x5')]()['then'](mailAccount[_0x9b24('0x6')]())['then'](realtime[_0x9b24('0x7')]())[_0x9b24('0x8')](function(){email[_0x9b24('0x9')](realtime[_0x9b24('0xa')]);return realtime;});}function main(){return server[_0x9b24('0xb')](realtime,email)[_0x9b24('0x8')](function(){return initRealtime();})['then'](function(){return setting[_0x9b24('0xc')]();})['then'](function(_0xc9a15){return setInterval(initRealtime,_0xc9a15['loginMailFrequency']*0x3e8);})['catch'](function(_0x55fa47){logger[_0x9b24('0xd')]('Email\x20service\x20initialization',_0x55fa47);});}main(); \ No newline at end of file diff --git a/server/services/email/lib/email.js b/server/services/email/lib/email.js index 0d59ffb..531a62a 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 _0x5bb2=['custom','provider','box','handleImapBox','bind','handleImapEmail','end','handleImapEnd','error','handleImapError','status','connected','messages','firstName','from','notify','then','Mail\x20not\x20accepted\x20from\x20routing\x20%s','lastSync','sendMail','smtp','send','verifySmtp','Smtp','verify','verified','catch','lodash','moment','bluebird','md5','ioredis','../../../config/environment','../../../config/logger','email','redis','defaults','socket.io-emitter','./imap','./smtp','info','mailAccounts','imapAccounts','prototype','emit','name','key','active','Imap','messageStatus','total','isNil','stringify','mailAccount:update','refresh','hasOwnProperty','service'];(function(_0xcbecc8,_0x126a9e){var _0x11f379=function(_0x1e250c){while(--_0x1e250c){_0xcbecc8['push'](_0xcbecc8['shift']());}};_0x11f379(++_0x126a9e);}(_0x5bb2,0x8d));var _0x25bb=function(_0x16dac5,_0x35fd10){_0x16dac5=_0x16dac5-0x0;var _0x47cf7c=_0x5bb2[_0x16dac5];return _0x47cf7c;};'use strict';var _=require(_0x25bb('0x0'));var moment=require(_0x25bb('0x1'));var BPromise=require(_0x25bb('0x2'));var md5=require(_0x25bb('0x3'));var Redis=require(_0x25bb('0x4'));var config=require(_0x25bb('0x5'));var logger=require(_0x25bb('0x6'))(_0x25bb('0x7'));config[_0x25bb('0x8')]=_[_0x25bb('0x9')](config[_0x25bb('0x8')],{'host':'localhost','port':0x18eb});var io=require(_0x25bb('0xa'))(new Redis(config[_0x25bb('0x8')]));var EmailImap=require(_0x25bb('0xb'));var EmailSmtp=require(_0x25bb('0xc'));var mailAccount=require('../rpc/mailAccount');var md5Accounts={};function EmailChannel(_0x38f146){logger[_0x25bb('0xd')]('start\x20email\x20channel');this[_0x25bb('0xe')]=_0x38f146[_0x25bb('0xe')];this[_0x25bb('0xf')]={};this['smtp']=new EmailSmtp();}EmailChannel[_0x25bb('0x10')][_0x25bb('0x11')]=function(_0x3815ad){var _0x5b4161=this[_0x25bb('0xe')][_0x3815ad];var _0x431317={'id':_0x5b4161['id'],'name':_0x5b4161[_0x25bb('0x12')],'key':_0x5b4161[_0x25bb('0x13')],'active':_0x5b4161[_0x25bb('0x14')],'Imap':{'status':_0x5b4161[_0x25bb('0x15')]['status'],'messageStatus':_0x5b4161[_0x25bb('0x15')][_0x25bb('0x16')],'total':_0x5b4161[_0x25bb('0x15')][_0x25bb('0x17')]}};if(_[_0x25bb('0x18')](md5Accounts[_0x3815ad])){md5Accounts[_0x3815ad]={};}var _0x3d5756=md5(JSON[_0x25bb('0x19')](_0x431317));if(md5Accounts[_0x3815ad][_0x25bb('0x3')]!==_0x3d5756){md5Accounts[_0x3815ad][_0x25bb('0x3')]=_0x3d5756;io[_0x25bb('0x11')](_0x25bb('0x1a'),_0x431317);}};EmailChannel[_0x25bb('0x10')][_0x25bb('0x1b')]=function(_0x203896){for(var _0x23e2c5 in _0x203896){if(_0x203896[_0x25bb('0x1c')](_0x23e2c5)){if(_0x203896[_0x23e2c5][_0x25bb('0x15')]&&_0x203896[_0x23e2c5][_0x25bb('0x14')]){var _0x1b62ba=_0x203896[_0x23e2c5][_0x25bb('0x15')];if(!_0x1b62ba[_0x25bb('0x1d')]&&_0x203896[_0x23e2c5]['provider']!==_0x25bb('0x1e'))_0x1b62ba[_0x25bb('0x1d')]=_0x203896[_0x23e2c5][_0x25bb('0x1f')];if(!this['imapAccounts'][_0x25bb('0x1c')](_0x1b62ba['id'])){this[_0x25bb('0xf')][_0x1b62ba['id']]=new EmailImap(_0x1b62ba,_0x203896[_0x23e2c5][_0x25bb('0x7')]);this[_0x25bb('0xf')][_0x1b62ba['id']]['on'](_0x25bb('0x20'),this[_0x25bb('0x21')][_0x25bb('0x22')](this,_0x23e2c5));this[_0x25bb('0xf')][_0x1b62ba['id']]['on'](_0x25bb('0x7'),this[_0x25bb('0x23')][_0x25bb('0x22')](this,_0x23e2c5));this[_0x25bb('0xf')][_0x1b62ba['id']]['on'](_0x25bb('0x24'),this[_0x25bb('0x25')]['bind'](this,_0x23e2c5));this[_0x25bb('0xf')][_0x1b62ba['id']]['on'](_0x25bb('0x26'),this[_0x25bb('0x27')]['bind'](this,_0x23e2c5));}}else{if(_[_0x25bb('0x18')](this[_0x25bb('0xe')][_0x23e2c5][_0x25bb('0x15')])){this['mailAccounts'][_0x23e2c5][_0x25bb('0x15')]={};}this[_0x25bb('0xe')][_0x23e2c5][_0x25bb('0x15')][_0x25bb('0x28')]='disabled';this[_0x25bb('0xe')][_0x23e2c5][_0x25bb('0x15')][_0x25bb('0x16')]='';this[_0x25bb('0x11')](_0x23e2c5);}}}};EmailChannel[_0x25bb('0x10')]['handleImapBox']=function(_0x2b1486,_0x263058){if(this[_0x25bb('0xe')][_0x2b1486]){this[_0x25bb('0xe')][_0x2b1486][_0x25bb('0x15')][_0x25bb('0x28')]=_0x25bb('0x29');this[_0x25bb('0xe')][_0x2b1486][_0x25bb('0x15')]['messageStatus']=_0x263058[_0x25bb('0x12')];if(_0x263058[_0x25bb('0x2a')]){this[_0x25bb('0xe')][_0x2b1486][_0x25bb('0x15')][_0x25bb('0x17')]=_0x263058[_0x25bb('0x2a')][_0x25bb('0x17')];}return this[_0x25bb('0x11')](_0x2b1486);}};EmailChannel[_0x25bb('0x10')][_0x25bb('0x23')]=function(_0x3661f2,_0x4f0260){logger[_0x25bb('0xd')]('New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s',_0x4f0260[_0x25bb('0x2b')],_0x4f0260['lastName'],_0x4f0260[_0x25bb('0x2c')],_0x3661f2);if(this[_0x25bb('0xe')][_0x3661f2]){return mailAccount[_0x25bb('0x2d')](_0x3661f2,_0x4f0260)[_0x25bb('0x2e')](function(_0x8658fb){if(_0x8658fb){logger[_0x25bb('0xd')]('Mail\x20accepted\x20from\x20routing');}})['catch'](function(_0x1f2c75){logger[_0x25bb('0x26')](_0x25bb('0x2f'),JSON['stringify'](_0x1f2c75));});}};EmailChannel[_0x25bb('0x10')][_0x25bb('0x25')]=function(_0x2c5d4f){if(this[_0x25bb('0xe')][_0x2c5d4f]&&this[_0x25bb('0xe')][_0x2c5d4f][_0x25bb('0x15')]){if(this[_0x25bb('0xf')][this[_0x25bb('0xe')][_0x2c5d4f][_0x25bb('0x15')]['id']]){delete this[_0x25bb('0xf')][this[_0x25bb('0xe')][_0x2c5d4f]['Imap']['id']];}this[_0x25bb('0xe')][_0x2c5d4f][_0x25bb('0x15')][_0x25bb('0x30')]=moment();this[_0x25bb('0x11')](_0x2c5d4f);}};EmailChannel[_0x25bb('0x10')][_0x25bb('0x27')]=function(_0x2ae906,_0x35e325){if(this[_0x25bb('0xe')][_0x2ae906]){this[_0x25bb('0xe')][_0x2ae906][_0x25bb('0x15')][_0x25bb('0x28')]='error';this['mailAccounts'][_0x2ae906][_0x25bb('0x15')][_0x25bb('0x16')]=_0x35e325;return this[_0x25bb('0x11')](_0x2ae906);}};EmailChannel[_0x25bb('0x10')][_0x25bb('0x31')]=function(_0x501464,_0x1905df){return this[_0x25bb('0x32')][_0x25bb('0x33')](_0x501464,_0x1905df);};EmailChannel['prototype'][_0x25bb('0x34')]=function(_0x34cd53){var _0x1bf3a9=this;if(this[_0x25bb('0xe')][_0x34cd53['id']]){if(_[_0x25bb('0x18')](this[_0x25bb('0xe')][_0x34cd53['id']][_0x25bb('0x35')])){this[_0x25bb('0xe')][_0x34cd53['id']]['Smtp']={};}this['mailAccounts'][_0x34cd53['id']]['Smtp']['lastSync']=moment();return new BPromise(function(_0x26ceef,_0x115629){return _0x1bf3a9['smtp'][_0x25bb('0x36')](_0x34cd53)[_0x25bb('0x2e')](function(_0x19b903){_0x1bf3a9[_0x25bb('0xe')][_0x34cd53['id']][_0x25bb('0x35')][_0x25bb('0x28')]=_0x25bb('0x37');_0x1bf3a9['mailAccounts'][_0x34cd53['id']][_0x25bb('0x35')][_0x25bb('0x16')]='';_0x1bf3a9[_0x25bb('0x11')](_0x34cd53['id']);_0x26ceef(_0x19b903);})[_0x25bb('0x38')](function(_0x332c20){_0x1bf3a9[_0x25bb('0xe')][_0x34cd53['id']][_0x25bb('0x35')][_0x25bb('0x28')]='error';_0x1bf3a9['mailAccounts'][_0x34cd53['id']][_0x25bb('0x35')][_0x25bb('0x16')]=_0x332c20;_0x1bf3a9['emit'](_0x34cd53['id']);_0x115629(_0x332c20);});});}return this[_0x25bb('0x32')][_0x25bb('0x36')](_0x34cd53);};module['exports']=EmailChannel; \ No newline at end of file +var _0x6778=['lastName','notify','then','Mail\x20accepted\x20from\x20routing','catch','Mail\x20not\x20accepted\x20from\x20routing\x20%s','stringify','handleImapEnd','sendMail','Smtp','lastSync','verify','exports','moment','bluebird','md5','../../../config/logger','email','redis','defaults','./imap','../rpc/mailAccount','start\x20email\x20channel','mailAccounts','smtp','prototype','emit','key','active','Imap','messageStatus','isNil','refresh','hasOwnProperty','service','provider','custom','imapAccounts','box','bind','handleImapEmail','end','error','handleImapError','status','handleImapBox','connected','name','messages','total','info','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s'];(function(_0x2ab365,_0xa3812e){var _0x49fef3=function(_0x29b883){while(--_0x29b883){_0x2ab365['push'](_0x2ab365['shift']());}};_0x49fef3(++_0xa3812e);}(_0x6778,0xa9));var _0x8677=function(_0x424a9a,_0x2dd9af){_0x424a9a=_0x424a9a-0x0;var _0xa7831c=_0x6778[_0x424a9a];return _0xa7831c;};'use strict';var _=require('lodash');var moment=require(_0x8677('0x0'));var BPromise=require(_0x8677('0x1'));var md5=require(_0x8677('0x2'));var Redis=require('ioredis');var config=require('../../../config/environment');var logger=require(_0x8677('0x3'))(_0x8677('0x4'));config[_0x8677('0x5')]=_[_0x8677('0x6')](config[_0x8677('0x5')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x8677('0x5')]));var EmailImap=require(_0x8677('0x7'));var EmailSmtp=require('./smtp');var mailAccount=require(_0x8677('0x8'));var md5Accounts={};function EmailChannel(_0x1a7667){logger['info'](_0x8677('0x9'));this[_0x8677('0xa')]=_0x1a7667[_0x8677('0xa')];this['imapAccounts']={};this[_0x8677('0xb')]=new EmailSmtp();}EmailChannel[_0x8677('0xc')][_0x8677('0xd')]=function(_0x221d04){var _0x4d78e5=this[_0x8677('0xa')][_0x221d04];var _0x44c681={'id':_0x4d78e5['id'],'name':_0x4d78e5['name'],'key':_0x4d78e5[_0x8677('0xe')],'active':_0x4d78e5[_0x8677('0xf')],'Imap':{'status':_0x4d78e5[_0x8677('0x10')]['status'],'messageStatus':_0x4d78e5[_0x8677('0x10')][_0x8677('0x11')],'total':_0x4d78e5['Imap']['total']}};if(_[_0x8677('0x12')](md5Accounts[_0x221d04])){md5Accounts[_0x221d04]={};}var _0x53d5c1=md5(JSON['stringify'](_0x44c681));if(md5Accounts[_0x221d04][_0x8677('0x2')]!==_0x53d5c1){md5Accounts[_0x221d04]['md5']=_0x53d5c1;io['emit']('mailAccount:update',_0x44c681);}};EmailChannel[_0x8677('0xc')][_0x8677('0x13')]=function(_0x306821){for(var _0x30c38e in _0x306821){if(_0x306821[_0x8677('0x14')](_0x30c38e)){if(_0x306821[_0x30c38e]['Imap']&&_0x306821[_0x30c38e][_0x8677('0xf')]){var _0x5de7d4=_0x306821[_0x30c38e][_0x8677('0x10')];if(!_0x5de7d4[_0x8677('0x15')]&&_0x306821[_0x30c38e][_0x8677('0x16')]!==_0x8677('0x17'))_0x5de7d4[_0x8677('0x15')]=_0x306821[_0x30c38e]['provider'];if(!this[_0x8677('0x18')]['hasOwnProperty'](_0x5de7d4['id'])){this[_0x8677('0x18')][_0x5de7d4['id']]=new EmailImap(_0x5de7d4,_0x306821[_0x30c38e][_0x8677('0x4')]);this[_0x8677('0x18')][_0x5de7d4['id']]['on'](_0x8677('0x19'),this['handleImapBox'][_0x8677('0x1a')](this,_0x30c38e));this[_0x8677('0x18')][_0x5de7d4['id']]['on']('email',this[_0x8677('0x1b')][_0x8677('0x1a')](this,_0x30c38e));this[_0x8677('0x18')][_0x5de7d4['id']]['on'](_0x8677('0x1c'),this['handleImapEnd'][_0x8677('0x1a')](this,_0x30c38e));this['imapAccounts'][_0x5de7d4['id']]['on'](_0x8677('0x1d'),this[_0x8677('0x1e')][_0x8677('0x1a')](this,_0x30c38e));}}else{if(_[_0x8677('0x12')](this[_0x8677('0xa')][_0x30c38e][_0x8677('0x10')])){this['mailAccounts'][_0x30c38e][_0x8677('0x10')]={};}this[_0x8677('0xa')][_0x30c38e][_0x8677('0x10')][_0x8677('0x1f')]='disabled';this[_0x8677('0xa')][_0x30c38e][_0x8677('0x10')]['messageStatus']='';this[_0x8677('0xd')](_0x30c38e);}}}};EmailChannel[_0x8677('0xc')][_0x8677('0x20')]=function(_0x1d8f57,_0x34e216){if(this[_0x8677('0xa')][_0x1d8f57]){this['mailAccounts'][_0x1d8f57][_0x8677('0x10')][_0x8677('0x1f')]=_0x8677('0x21');this['mailAccounts'][_0x1d8f57][_0x8677('0x10')][_0x8677('0x11')]=_0x34e216[_0x8677('0x22')];if(_0x34e216[_0x8677('0x23')]){this['mailAccounts'][_0x1d8f57][_0x8677('0x10')][_0x8677('0x24')]=_0x34e216[_0x8677('0x23')][_0x8677('0x24')];}return this[_0x8677('0xd')](_0x1d8f57);}};EmailChannel[_0x8677('0xc')][_0x8677('0x1b')]=function(_0x3e081c,_0x396aa5){logger[_0x8677('0x25')](_0x8677('0x26'),_0x396aa5['firstName'],_0x396aa5[_0x8677('0x27')],_0x396aa5['from'],_0x3e081c);if(this[_0x8677('0xa')][_0x3e081c]){return mailAccount[_0x8677('0x28')](_0x3e081c,_0x396aa5)[_0x8677('0x29')](function(_0x2a49fa){if(_0x2a49fa){logger[_0x8677('0x25')](_0x8677('0x2a'));}})[_0x8677('0x2b')](function(_0x2581df){logger[_0x8677('0x1d')](_0x8677('0x2c'),JSON[_0x8677('0x2d')](_0x2581df));});}};EmailChannel['prototype'][_0x8677('0x2e')]=function(_0x19a013){if(this[_0x8677('0xa')][_0x19a013]&&this[_0x8677('0xa')][_0x19a013][_0x8677('0x10')]){if(this[_0x8677('0x18')][this[_0x8677('0xa')][_0x19a013]['Imap']['id']]){delete this[_0x8677('0x18')][this[_0x8677('0xa')][_0x19a013][_0x8677('0x10')]['id']];}this[_0x8677('0xa')][_0x19a013][_0x8677('0x10')]['lastSync']=moment();this[_0x8677('0xd')](_0x19a013);}};EmailChannel['prototype'][_0x8677('0x1e')]=function(_0x389c4e,_0x46fc2f){if(this[_0x8677('0xa')][_0x389c4e]){this[_0x8677('0xa')][_0x389c4e][_0x8677('0x10')][_0x8677('0x1f')]=_0x8677('0x1d');this[_0x8677('0xa')][_0x389c4e]['Imap']['messageStatus']=_0x46fc2f;return this[_0x8677('0xd')](_0x389c4e);}};EmailChannel['prototype'][_0x8677('0x2f')]=function(_0x3f4e66,_0x5e332e){return this[_0x8677('0xb')]['send'](_0x3f4e66,_0x5e332e);};EmailChannel['prototype']['verifySmtp']=function(_0x21870c){var _0x50a1e4=this;if(this[_0x8677('0xa')][_0x21870c['id']]){if(_[_0x8677('0x12')](this[_0x8677('0xa')][_0x21870c['id']]['Smtp'])){this[_0x8677('0xa')][_0x21870c['id']][_0x8677('0x30')]={};}this['mailAccounts'][_0x21870c['id']][_0x8677('0x30')][_0x8677('0x31')]=moment();return new BPromise(function(_0xa57384,_0x38576c){return _0x50a1e4['smtp'][_0x8677('0x32')](_0x21870c)[_0x8677('0x29')](function(_0x42c916){_0x50a1e4[_0x8677('0xa')][_0x21870c['id']][_0x8677('0x30')][_0x8677('0x1f')]='verified';_0x50a1e4[_0x8677('0xa')][_0x21870c['id']][_0x8677('0x30')][_0x8677('0x11')]='';_0x50a1e4[_0x8677('0xd')](_0x21870c['id']);_0xa57384(_0x42c916);})[_0x8677('0x2b')](function(_0x155b1f){_0x50a1e4[_0x8677('0xa')][_0x21870c['id']]['Smtp']['status']=_0x8677('0x1d');_0x50a1e4[_0x8677('0xa')][_0x21870c['id']][_0x8677('0x30')][_0x8677('0x11')]=_0x155b1f;_0x50a1e4[_0x8677('0xd')](_0x21870c['id']);_0x38576c(_0x155b1f);});});}return this[_0x8677('0xb')][_0x8677('0x32')](_0x21870c);};module[_0x8677('0x33')]=EmailChannel; \ No newline at end of file diff --git a/server/services/email/lib/imap.js b/server/services/email/lib/imap.js index 9abf4d6..4864c4e 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 _0x93ad=['length','fetch','handleFetchMessage','handleFetchError','closeBox','handleCloseBox','body','handleMessageBody','handleMessageAttributes','handleMessageEnd','handleSimpleParser','handleFetchEnd','handleEnd','stringify','textCode','hasOwnProperty','upperFirst','exports','lodash','util','mailparser','simpleParser','iconv','Iconv','events','EventEmitter','./utils','../../../config/logger','email','mailbox','account','imap','once','handleReady','bind','end','error','inherits','prototype','getAccount','connTimeout','authTimeout','service','user','modernAuthentication','xoauth2','data5','password','authentication','anonymous@xcally.com','host','port','tls','autotls','required','handleOpenBox','handleError','emit','box','readUnseen','search','UNSEEN','handleReadUnseen'];(function(_0x3b0999,_0x3c9835){var _0x585226=function(_0x3314f9){while(--_0x3314f9){_0x3b0999['push'](_0x3b0999['shift']());}};_0x585226(++_0x3c9835);}(_0x93ad,0x18c));var _0xd93a=function(_0x567ef4,_0x10a870){_0x567ef4=_0x567ef4-0x0;var _0x481cd6=_0x93ad[_0x567ef4];return _0x481cd6;};'use strict';var _=require(_0xd93a('0x0'));var util=require(_0xd93a('0x1'));var Imap=require('imap');var simpleParser=require(_0xd93a('0x2'))[_0xd93a('0x3')];var Iconv=require(_0xd93a('0x4'))[_0xd93a('0x5')];var EventEmitter=require(_0xd93a('0x6'))[_0xd93a('0x7')];var utils=require(_0xd93a('0x8'));var logger=require(_0xd93a('0x9'))(_0xd93a('0xa'));function EmailImap(_0x28622e,_0x262236){this[_0xd93a('0xb')]=_0x28622e[_0xd93a('0xb')];this[_0xd93a('0xc')]=this['getAccount'](_0x28622e,_0x262236);this[_0xd93a('0xd')]=new Imap(this[_0xd93a('0xc')]);this[_0xd93a('0xd')][_0xd93a('0xe')]('ready',this[_0xd93a('0xf')][_0xd93a('0x10')](this));this['imap'][_0xd93a('0xe')](_0xd93a('0x11'),this['handleEnd'][_0xd93a('0x10')](this));this[_0xd93a('0xd')]['on'](_0xd93a('0x12'),this['handleError'][_0xd93a('0x10')](this));this['imap']['connect']();}util[_0xd93a('0x13')](EmailImap,EventEmitter);EmailImap[_0xd93a('0x14')][_0xd93a('0x15')]=function(_0x588e92,_0x5ebe23){var _0x158640={'connTimeout':_0x588e92[_0xd93a('0x16')]?_0x588e92[_0xd93a('0x16')]*0x3e8:0x2710,'authTimeout':_0x588e92[_0xd93a('0x17')]?_0x588e92['authTimeout']*0x3e8:0x1388};if(_0x588e92[_0xd93a('0x18')]){_0x158640[_0xd93a('0x19')]=_0x588e92['user'];if(_0x588e92[_0xd93a('0x1a')]){_0x158640[_0xd93a('0x1b')]=utils['generateXOAuth2Token'](_0x588e92['CloudProvider'][_0xd93a('0x1c')],_0x588e92[_0xd93a('0x19')]);}else{_0x158640['password']=_0x588e92[_0xd93a('0x1d')];}}else{if(_0x588e92[_0xd93a('0x1e')]){_0x158640[_0xd93a('0x19')]=_0x588e92[_0xd93a('0x19')];_0x158640[_0xd93a('0x1d')]=_0x588e92[_0xd93a('0x1d')];}}_0x158640['email']=_0x5ebe23||_0x588e92[_0xd93a('0x19')]||_0xd93a('0x1f');_0x158640[_0xd93a('0x20')]=_0x588e92[_0xd93a('0x20')];_0x158640[_0xd93a('0x21')]=_0x588e92[_0xd93a('0x21')]||0x3e1;if(_0x588e92['tls']){_0x158640[_0xd93a('0x22')]=!![];}else{_0x158640[_0xd93a('0x22')]=![];_0x158640[_0xd93a('0x23')]=_0xd93a('0x24');}return _0x158640;};EmailImap[_0xd93a('0x14')]['handleReady']=function(){this[_0xd93a('0xd')]['openBox'](this['mailbox'],![],this[_0xd93a('0x25')][_0xd93a('0x10')](this));};EmailImap[_0xd93a('0x14')]['handleOpenBox']=function(_0x59ef10,_0x1a62f4){if(_0x59ef10){this[_0xd93a('0x26')](_0x59ef10,!![]);}else{this[_0xd93a('0x27')](_0xd93a('0x28'),_0x1a62f4);this[_0xd93a('0x29')]();}};EmailImap[_0xd93a('0x14')]['handleCloseBox']=function(_0x1e70c2){if(_0x1e70c2){this[_0xd93a('0x26')](_0x1e70c2,!![]);}else{this[_0xd93a('0xd')]['end']();}};EmailImap[_0xd93a('0x14')][_0xd93a('0x29')]=function(){this['imap'][_0xd93a('0x2a')]([_0xd93a('0x2b')],this['handleReadUnseen']['bind'](this));};EmailImap[_0xd93a('0x14')][_0xd93a('0x2c')]=function(_0x33e913,_0x106cac){if(_0x33e913){this[_0xd93a('0x26')](_0x33e913,!![]);}else{if(_0x106cac[_0xd93a('0x2d')]){try{var _0x177c5c=this[_0xd93a('0xd')][_0xd93a('0x2e')](_0x106cac,{'bodies':'','markSeen':!![]});_0x177c5c['on']('message',this[_0xd93a('0x2f')][_0xd93a('0x10')](this));_0x177c5c['once']('error',this[_0xd93a('0x30')][_0xd93a('0x10')](this));_0x177c5c['once'](_0xd93a('0x11'),this['handleFetchEnd'][_0xd93a('0x10')](this));}catch(_0x269d43){logger['error'](_0x269d43);}}else{this[_0xd93a('0xd')][_0xd93a('0x31')](!![],this[_0xd93a('0x32')][_0xd93a('0x10')](this));}}};EmailImap['prototype'][_0xd93a('0x2f')]=function(_0x310d99){_0x310d99['on'](_0xd93a('0x33'),this[_0xd93a('0x34')][_0xd93a('0x10')](this));_0x310d99[_0xd93a('0xe')]('attributes',this[_0xd93a('0x35')][_0xd93a('0x10')](this));_0x310d99[_0xd93a('0xe')](_0xd93a('0x11'),this[_0xd93a('0x36')][_0xd93a('0x10')](this));};EmailImap[_0xd93a('0x14')][_0xd93a('0x34')]=function(_0x425adb){simpleParser(_0x425adb,{'Iconv':Iconv},this[_0xd93a('0x37')][_0xd93a('0x10')](this));};EmailImap['prototype'][_0xd93a('0x35')]=function(){};EmailImap[_0xd93a('0x14')][_0xd93a('0x36')]=function(){};EmailImap[_0xd93a('0x14')]['handleSimpleParser']=function(_0x5bb937,_0x30ed09){if(_0x5bb937){logger[_0xd93a('0x12')](_0x5bb937);}else{var _0x50be37=this;utils['parser'](this['account'],_0x30ed09,function(_0x5ecfce){_0x50be37[_0xd93a('0x27')](_0xd93a('0xa'),_0x5ecfce);});}};EmailImap[_0xd93a('0x14')][_0xd93a('0x38')]=function(){this[_0xd93a('0xd')][_0xd93a('0x31')](!![],this[_0xd93a('0x32')][_0xd93a('0x10')](this));};EmailImap['prototype'][_0xd93a('0x30')]=function(_0x7c1fe7){this[_0xd93a('0x26')](_0x7c1fe7);this[_0xd93a('0xd')][_0xd93a('0x31')](!![],this[_0xd93a('0x32')][_0xd93a('0x10')](this));};EmailImap[_0xd93a('0x14')][_0xd93a('0x39')]=function(){this[_0xd93a('0x27')]('end');};EmailImap[_0xd93a('0x14')][_0xd93a('0x26')]=function(_0x1eb6dc,_0xb3dc51){logger[_0xd93a('0x12')](_0xd93a('0x26'),this[_0xd93a('0xc')][_0xd93a('0xa')],JSON[_0xd93a('0x3a')](_0x1eb6dc));var _0x308286='';if(_0x1eb6dc){if(_0x1eb6dc[_0xd93a('0x3b')]){_0x308286=_0x1eb6dc[_0xd93a('0x3b')];}else{for(var _0x332d44 in _0x1eb6dc){if(_0x1eb6dc[_0xd93a('0x3c')](_0x332d44)){_0x308286+=_[_0xd93a('0x3d')](_0x332d44)+':\x20'+_0x1eb6dc[_0x332d44]+'\x0a';}}}}if(_0xb3dc51){this[_0xd93a('0xd')][_0xd93a('0x11')]();}else{this[_0xd93a('0x27')](_0xd93a('0x12'),_0x308286);this[_0xd93a('0x27')](_0xd93a('0x11'));}};module[_0xd93a('0x3e')]=EmailImap; \ No newline at end of file +var _0xb442=['anonymous@xcally.com','host','port','tls','autotls','required','openBox','handleOpenBox','emit','box','readUnseen','search','UNSEEN','handleReadUnseen','length','fetch','message','handleFetchMessage','handleFetchError','handleFetchEnd','closeBox','handleCloseBox','body','handleMessageBody','attributes','handleMessageAttributes','handleMessageEnd','handleSimpleParser','parser','stringify','upperFirst','exports','lodash','util','imap','simpleParser','iconv','Iconv','../../../config/logger','email','mailbox','account','once','ready','handleReady','bind','end','error','handleError','connect','inherits','prototype','getAccount','connTimeout','authTimeout','service','user','modernAuthentication','xoauth2','generateXOAuth2Token','CloudProvider','password','authentication'];(function(_0x7be539,_0x5622ca){var _0x3c1e90=function(_0x479b3d){while(--_0x479b3d){_0x7be539['push'](_0x7be539['shift']());}};_0x3c1e90(++_0x5622ca);}(_0xb442,0x15b));var _0x2b44=function(_0x58ecb4,_0x2c03c4){_0x58ecb4=_0x58ecb4-0x0;var _0x4b2adc=_0xb442[_0x58ecb4];return _0x4b2adc;};'use strict';var _=require(_0x2b44('0x0'));var util=require(_0x2b44('0x1'));var Imap=require(_0x2b44('0x2'));var simpleParser=require('mailparser')[_0x2b44('0x3')];var Iconv=require(_0x2b44('0x4'))[_0x2b44('0x5')];var EventEmitter=require('events')['EventEmitter'];var utils=require('./utils');var logger=require(_0x2b44('0x6'))(_0x2b44('0x7'));function EmailImap(_0x56169d,_0x4e066c){this[_0x2b44('0x8')]=_0x56169d[_0x2b44('0x8')];this[_0x2b44('0x9')]=this['getAccount'](_0x56169d,_0x4e066c);this[_0x2b44('0x2')]=new Imap(this['account']);this[_0x2b44('0x2')][_0x2b44('0xa')](_0x2b44('0xb'),this[_0x2b44('0xc')][_0x2b44('0xd')](this));this[_0x2b44('0x2')][_0x2b44('0xa')](_0x2b44('0xe'),this['handleEnd'][_0x2b44('0xd')](this));this[_0x2b44('0x2')]['on'](_0x2b44('0xf'),this[_0x2b44('0x10')][_0x2b44('0xd')](this));this[_0x2b44('0x2')][_0x2b44('0x11')]();}util[_0x2b44('0x12')](EmailImap,EventEmitter);EmailImap[_0x2b44('0x13')][_0x2b44('0x14')]=function(_0x370b29,_0x419593){var _0x142500={'connTimeout':_0x370b29[_0x2b44('0x15')]?_0x370b29[_0x2b44('0x15')]*0x3e8:0x2710,'authTimeout':_0x370b29[_0x2b44('0x16')]?_0x370b29['authTimeout']*0x3e8:0x1388};if(_0x370b29[_0x2b44('0x17')]){_0x142500['user']=_0x370b29[_0x2b44('0x18')];if(_0x370b29[_0x2b44('0x19')]){_0x142500[_0x2b44('0x1a')]=utils[_0x2b44('0x1b')](_0x370b29[_0x2b44('0x1c')]['data5'],_0x370b29['user']);}else{_0x142500[_0x2b44('0x1d')]=_0x370b29[_0x2b44('0x1d')];}}else{if(_0x370b29[_0x2b44('0x1e')]){_0x142500[_0x2b44('0x18')]=_0x370b29[_0x2b44('0x18')];_0x142500[_0x2b44('0x1d')]=_0x370b29[_0x2b44('0x1d')];}}_0x142500['email']=_0x419593||_0x370b29[_0x2b44('0x18')]||_0x2b44('0x1f');_0x142500[_0x2b44('0x20')]=_0x370b29[_0x2b44('0x20')];_0x142500[_0x2b44('0x21')]=_0x370b29[_0x2b44('0x21')]||0x3e1;if(_0x370b29[_0x2b44('0x22')]){_0x142500[_0x2b44('0x22')]=!![];}else{_0x142500[_0x2b44('0x22')]=![];_0x142500[_0x2b44('0x23')]=_0x2b44('0x24');}return _0x142500;};EmailImap['prototype'][_0x2b44('0xc')]=function(){this['imap'][_0x2b44('0x25')](this[_0x2b44('0x8')],![],this['handleOpenBox'][_0x2b44('0xd')](this));};EmailImap[_0x2b44('0x13')][_0x2b44('0x26')]=function(_0x36188c,_0x3ee697){if(_0x36188c){this[_0x2b44('0x10')](_0x36188c,!![]);}else{this[_0x2b44('0x27')](_0x2b44('0x28'),_0x3ee697);this[_0x2b44('0x29')]();}};EmailImap[_0x2b44('0x13')]['handleCloseBox']=function(_0x5e2a0b){if(_0x5e2a0b){this[_0x2b44('0x10')](_0x5e2a0b,!![]);}else{this[_0x2b44('0x2')][_0x2b44('0xe')]();}};EmailImap[_0x2b44('0x13')][_0x2b44('0x29')]=function(){this[_0x2b44('0x2')][_0x2b44('0x2a')]([_0x2b44('0x2b')],this['handleReadUnseen'][_0x2b44('0xd')](this));};EmailImap[_0x2b44('0x13')][_0x2b44('0x2c')]=function(_0x2b51b2,_0x2e5935){if(_0x2b51b2){this['handleError'](_0x2b51b2,!![]);}else{if(_0x2e5935[_0x2b44('0x2d')]){try{var _0x10677a=this['imap'][_0x2b44('0x2e')](_0x2e5935,{'bodies':'','markSeen':!![]});_0x10677a['on'](_0x2b44('0x2f'),this[_0x2b44('0x30')]['bind'](this));_0x10677a[_0x2b44('0xa')](_0x2b44('0xf'),this[_0x2b44('0x31')][_0x2b44('0xd')](this));_0x10677a[_0x2b44('0xa')]('end',this[_0x2b44('0x32')][_0x2b44('0xd')](this));}catch(_0x7199a){logger['error'](_0x7199a);}}else{this[_0x2b44('0x2')][_0x2b44('0x33')](!![],this[_0x2b44('0x34')][_0x2b44('0xd')](this));}}};EmailImap['prototype'][_0x2b44('0x30')]=function(_0x32d7d4){_0x32d7d4['on'](_0x2b44('0x35'),this[_0x2b44('0x36')][_0x2b44('0xd')](this));_0x32d7d4[_0x2b44('0xa')](_0x2b44('0x37'),this[_0x2b44('0x38')][_0x2b44('0xd')](this));_0x32d7d4['once']('end',this[_0x2b44('0x39')][_0x2b44('0xd')](this));};EmailImap[_0x2b44('0x13')][_0x2b44('0x36')]=function(_0x5a464b){simpleParser(_0x5a464b,{'Iconv':Iconv},this[_0x2b44('0x3a')][_0x2b44('0xd')](this));};EmailImap[_0x2b44('0x13')][_0x2b44('0x38')]=function(){};EmailImap[_0x2b44('0x13')][_0x2b44('0x39')]=function(){};EmailImap[_0x2b44('0x13')][_0x2b44('0x3a')]=function(_0x39c668,_0x5bf728){if(_0x39c668){logger[_0x2b44('0xf')](_0x39c668);}else{var _0xcb4c8a=this;utils[_0x2b44('0x3b')](this[_0x2b44('0x9')],_0x5bf728,function(_0x2548b4){_0xcb4c8a['emit'](_0x2b44('0x7'),_0x2548b4);});}};EmailImap[_0x2b44('0x13')]['handleFetchEnd']=function(){this[_0x2b44('0x2')]['closeBox'](!![],this['handleCloseBox']['bind'](this));};EmailImap[_0x2b44('0x13')][_0x2b44('0x31')]=function(_0x54f628){this[_0x2b44('0x10')](_0x54f628);this['imap']['closeBox'](!![],this[_0x2b44('0x34')][_0x2b44('0xd')](this));};EmailImap[_0x2b44('0x13')]['handleEnd']=function(){this[_0x2b44('0x27')]('end');};EmailImap[_0x2b44('0x13')]['handleError']=function(_0x3c63b6,_0x229662){logger[_0x2b44('0xf')](_0x2b44('0x10'),this['account'][_0x2b44('0x7')],JSON[_0x2b44('0x3c')](_0x3c63b6));var _0x20fcec='';if(_0x3c63b6){if(_0x3c63b6['textCode']){_0x20fcec=_0x3c63b6['textCode'];}else{for(var _0x2dfc3f in _0x3c63b6){if(_0x3c63b6['hasOwnProperty'](_0x2dfc3f)){_0x20fcec+=_[_0x2b44('0x3d')](_0x2dfc3f)+':\x20'+_0x3c63b6[_0x2dfc3f]+'\x0a';}}}}if(_0x229662){this[_0x2b44('0x2')][_0x2b44('0xe')]();}else{this['emit'](_0x2b44('0xf'),_0x20fcec);this[_0x2b44('0x27')](_0x2b44('0xe'));}};module[_0x2b44('0x3e')]=EmailImap; \ No newline at end of file diff --git a/server/services/email/lib/smtp.js b/server/services/email/lib/smtp.js index 907b0ff..cffadaf 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 _0x10f3=['send','createTransport','use','compile','sendMail','verify','exports','nodemailer','nodemailer-plugin-inline-base64','prototype'];(function(_0x388914,_0x3c63f9){var _0x1f9111=function(_0x23dd69){while(--_0x23dd69){_0x388914['push'](_0x388914['shift']());}};_0x1f9111(++_0x3c63f9);}(_0x10f3,0x16f));var _0x310f=function(_0x230856,_0x5685b9){_0x230856=_0x230856-0x0;var _0x53cdb0=_0x10f3[_0x230856];return _0x53cdb0;};'use strict';var nodemailer=require(_0x310f('0x0'));var inlineBase64=require(_0x310f('0x1'));function EmailSmtp(){}EmailSmtp[_0x310f('0x2')][_0x310f('0x3')]=function(_0x2b6e75,_0x35d6b4){return new Promise(function(_0x2ac628,_0x307e28){var _0x19393e=nodemailer[_0x310f('0x4')](_0x2b6e75);_0x19393e[_0x310f('0x5')](_0x310f('0x6'),inlineBase64());_0x19393e[_0x310f('0x7')](_0x35d6b4,function(_0x26b6de,_0x15580f){if(_0x26b6de){_0x307e28(_0x26b6de['toString']());}else{_0x2ac628(_0x15580f);}});});};EmailSmtp[_0x310f('0x2')][_0x310f('0x8')]=function(_0xbf3bfe){return new Promise(function(_0x1befbe,_0x124dea){var _0x1bc5ff=nodemailer[_0x310f('0x4')](_0xbf3bfe);_0x1bc5ff[_0x310f('0x8')](function(_0x189247,_0x362a23){if(_0x189247){_0x124dea(_0x189247['toString']());}else{if(_0x362a23){_0x1befbe(_0x362a23);}else{_0x124dea('Not\x20verifired');}}});});};module[_0x310f('0x9')]=EmailSmtp; \ No newline at end of file +var _0xf8ff=['sendMail','verify','toString','exports','nodemailer-plugin-inline-base64','prototype','createTransport','use','compile'];(function(_0x269415,_0x1ea893){var _0x43aeeb=function(_0x144f60){while(--_0x144f60){_0x269415['push'](_0x269415['shift']());}};_0x43aeeb(++_0x1ea893);}(_0xf8ff,0x190));var _0xff8f=function(_0x5ca5bc,_0x5b8a9d){_0x5ca5bc=_0x5ca5bc-0x0;var _0x26ca86=_0xf8ff[_0x5ca5bc];return _0x26ca86;};'use strict';var nodemailer=require('nodemailer');var inlineBase64=require(_0xff8f('0x0'));function EmailSmtp(){}EmailSmtp[_0xff8f('0x1')]['send']=function(_0x395667,_0x17da2b){return new Promise(function(_0x142adc,_0x4dbe55){var _0x420f7e=nodemailer[_0xff8f('0x2')](_0x395667);_0x420f7e[_0xff8f('0x3')](_0xff8f('0x4'),inlineBase64());_0x420f7e[_0xff8f('0x5')](_0x17da2b,function(_0x3a0e8b,_0x5e0d0f){if(_0x3a0e8b){_0x4dbe55(_0x3a0e8b['toString']());}else{_0x142adc(_0x5e0d0f);}});});};EmailSmtp[_0xff8f('0x1')][_0xff8f('0x6')]=function(_0x5a215b){return new Promise(function(_0x80be5d,_0x37c83e){var _0x434c5d=nodemailer[_0xff8f('0x2')](_0x5a215b);_0x434c5d[_0xff8f('0x6')](function(_0x24f09d,_0x56d341){if(_0x24f09d){_0x37c83e(_0x24f09d[_0xff8f('0x7')]());}else{if(_0x56d341){_0x80be5d(_0x56d341);}else{_0x37c83e('Not\x20verifired');}}});});};module[_0xff8f('0x8')]=EmailSmtp; \ No newline at end of file diff --git a/server/services/email/lib/utils.js b/server/services/email/lib/utils.js index 64d3787..2d4b606 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 _0x8716=['inReplyTo','YYYY-MM-DD\x20HH:mm:ss','filter','application/ms-tnef','info','Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system','first','

Empty\x20message

','Attachments','Title','Data','generateXOAuth2Token','user=','auth=Bearer\x20','toString','base64','lodash','moment','randomstring','path','node-tnef','../../../config/logger','email','head','value','address','anonymous','@xcally.com','name','substring','indexOf','split','slice','Anonymous','length','pop','isEmpty','generate','html','test','replace','','body','textAsHtml','0x1?_0x34857e[_0x6871('0x10')](0x0,-0x1)['join']('\x20'):_0x232e20[_0x6871('0xc')];}return _0x6871('0x11');}function getLastName(_0x58ae4c){var _0x2e3be2=_['head'](_0x58ae4c[_0x6871('0x8')]);if(_0x2e3be2&&_0x2e3be2[_0x6871('0xc')]){var _0x2cd592=_0x2e3be2['name'][_0x6871('0xf')](/\s+/);return _0x2cd592[_0x6871('0x12')]>0x1?_0x2cd592[_0x6871('0x13')]():'';}return'';}function getMails(_0x1a84c7,_0x408efc){var _0x38d3a1='';for(var _0x42034c=0x0;_0x42034c<_0x408efc[_0x6871('0x8')][_0x6871('0x12')];_0x42034c+=0x1){if(_0x408efc[_0x6871('0x8')][_0x42034c]['address']!==_0x1a84c7){if(!_[_0x6871('0x14')](_0x38d3a1)){_0x38d3a1+=',';}_0x38d3a1+=_0x408efc[_0x6871('0x8')][_0x42034c][_0x6871('0xc')]||_0x408efc['value'][_0x42034c][_0x6871('0x9')]||'';_0x38d3a1+='\x20<';_0x38d3a1+=_0x408efc[_0x6871('0x8')][_0x42034c][_0x6871('0x9')]?_0x408efc[_0x6871('0x8')][_0x42034c][_0x6871('0x9')]:_0x6871('0xa')+random[_0x6871('0x15')](0x6)+_0x6871('0xb');_0x38d3a1+='>';}}return _0x38d3a1;}function parseEmail(_0x11f056,_0x517a55,_0x33933f){if(_0x517a55[_0x6871('0x16')]){var _0x3f738d=/)<[^<]*)*<\/script>/gi;while(_0x3f738d[_0x6871('0x17')](_0x517a55['html'])){_0x517a55[_0x6871('0x16')]=_0x517a55[_0x6871('0x16')][_0x6871('0x18')](_0x3f738d,'');}if(_0x517a55[_0x6871('0x16')]['includes'](_0x6871('0x19'))){var _0x379c01=[];_0x517a55[_0x6871('0x1a')][_0x6871('0x1b')](_0x41ccab=>{_0x379c01[_0x6871('0x1c')](_0x41ccab[_0x6871('0x1d')]);});var _0xc6e033=/]+>/g;var _0x3b8c61=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x56283b=_0x517a55[_0x6871('0x16')]['replace'](_0x3b8c61,_0x6871('0x1e'));var _0x379eaa=_0x56283b[_0x6871('0x18')](_0xc6e033,'_IMG');for(let _0x53cc9c=0x0;_0x53cc9c<_0x379c01['length'];_0x53cc9c++){var _0x55dbbf=_0x379eaa[_0x6871('0x18')](_0x6871('0x1f'),'\x20[Attachment:\x20'+_0x379c01[_0x53cc9c]+_0x6871('0x20'));_0x379eaa=_0x55dbbf;}_0x517a55['html']=_0x379eaa;}_0x33933f[_0x6871('0x21')]=_0x517a55[_0x6871('0x16')];}else{_0x33933f[_0x6871('0x21')]=_0x517a55[_0x6871('0x22')];}if(_0x33933f[_0x6871('0x21')]){_0x33933f[_0x6871('0x21')]=_0x33933f['body'][_0x6871('0x18')](/0x0){var _0xb391a0=[_0x6871('0x34'),_0x6871('0x35'),_0x6871('0x36')];for(var _0x391705=0x0;_0x391705<_0x517a55[_0x6871('0x33')][_0x6871('0x12')];_0x391705++){var _0x479085=_[_0x6871('0xe')](_0xb391a0,_0x517a55[_0x6871('0x33')][_0x391705]['line']);if(_0x479085>=0x0){_0x33933f[_0x6871('0x37')]=!![];}}}return _0x33933f;}exports[_0x6871('0x38')]=function(_0x2bcb1b,_0x1e6363,_0x5c8f20){var _0x1650cd={'from':getAddress(_0x1e6363[_0x6871('0x39')]),'firstName':getFirstName(_0x1e6363['from']),'lastName':getLastName(_0x1e6363[_0x6871('0x39')]),'mapKey':_0x6871('0x6'),'message':{'from':getMails(_0x2bcb1b[_0x6871('0x6')],_0x1e6363[_0x6871('0x39')]),'to':_0x2bcb1b[_0x6871('0x6')],'cc':'','subject':_0x1e6363[_0x6871('0x3a')]||'','messageId':_0x1e6363[_0x6871('0x3b')],'inReplyTo':_0x1e6363[_0x6871('0x3c')],'sentAt':moment(_0x1e6363['date'])[_0x6871('0x2a')](_0x6871('0x3d')),'attach':![],'attachments':[]}};if(!_0x1e6363[_0x6871('0x16')]&&!_0x1e6363[_0x6871('0x22')]){var _0x551a9d=_[_0x6871('0x3e')](_0x1e6363[_0x6871('0x1a')],{'contentType':_0x6871('0x3f')});if(_0x551a9d[_0x6871('0x12')]){logger[_0x6871('0x40')](util[_0x6871('0x2a')](_0x6871('0x41'),_0x1e6363[_0x6871('0x3b')]));tnef['parseBuffer'](_[_0x6871('0x42')](_0x551a9d)[_0x6871('0x31')],function(_0x150bb6,_0x36c83c){if(_0x36c83c){_0x1e6363[_0x6871('0x16')]=_0x36c83c['BodyHTML']||_0x6871('0x43');if(_0x36c83c[_0x6871('0x44')]){for(var _0x415edd=0x0;_0x415edd<_0x36c83c[_0x6871('0x44')][_0x6871('0x12')];_0x415edd++){var _0x30b906=_0x36c83c[_0x6871('0x44')][_0x415edd];_0x1650cd['message'][_0x6871('0x1a')][_0x6871('0x1c')]({'filename':_0x30b906[_0x6871('0x45')],'content':Buffer['from'](_0x30b906[_0x6871('0x46')])});}}}_0x5c8f20(parseEmail(_0x2bcb1b,_0x1e6363,_0x1650cd));});}else{_0x1e6363[_0x6871('0x16')]=_0x6871('0x43');_0x5c8f20(parseEmail(_0x2bcb1b,_0x1e6363,_0x1650cd));}}else{_0x5c8f20(parseEmail(_0x2bcb1b,_0x1e6363,_0x1650cd));}};exports[_0x6871('0x47')]=function(_0x31936c,_0x1b40dd){var _0x4636e8=[_0x6871('0x48')+(_0x1b40dd||''),_0x6871('0x49')+_0x31936c,'',''];return Buffer[_0x6871('0x39')](_0x4636e8[_0x6871('0x2d')](''),'utf-8')[_0x6871('0x4a')](_0x6871('0x4b'));}; \ No newline at end of file +var _0xd2e2=['server/files/attachments/','writeFileSync','content','contentType','headerLines','Auto-Submitted:\x20auto-replied','Precedence:\x20auto_reply','parser','from','subject','messageId','YYYY-MM-DD\x20HH:mm:ss','filter','Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system','BodyHTML','Attachments','Title','

Empty\x20message

','user=','auth=Bearer\x20','utf-8','toString','base64','lodash','moment','randomstring','path','util','node-tnef','../../../config/logger','email','../../../config/environment','value','address','anonymous','generate','@xcally.com','head','name','substring','indexOf','split','length','slice','join','Anonymous','pop','isEmpty','html','test','replace','\x20[Attachment:\x20','\x20]','body','textAsHtml','0x1?_0x5ce612[_0x2d2e('0x14')](0x0,-0x1)[_0x2d2e('0x15')]('\x20'):_0x55b675[_0x2d2e('0xf')];}return _0x2d2e('0x16');}function getLastName(_0x544be5){var _0x5ea544=_['head'](_0x544be5['value']);if(_0x5ea544&&_0x5ea544[_0x2d2e('0xf')]){var _0x591a05=_0x5ea544[_0x2d2e('0xf')]['split'](/\s+/);return _0x591a05[_0x2d2e('0x13')]>0x1?_0x591a05[_0x2d2e('0x17')]():'';}return'';}function getMails(_0x485473,_0x5127fb){var _0x15115f='';for(var _0x3a266c=0x0;_0x3a266c<_0x5127fb[_0x2d2e('0x9')]['length'];_0x3a266c+=0x1){if(_0x5127fb['value'][_0x3a266c]['address']!==_0x485473){if(!_[_0x2d2e('0x18')](_0x15115f)){_0x15115f+=',';}_0x15115f+=_0x5127fb[_0x2d2e('0x9')][_0x3a266c][_0x2d2e('0xf')]||_0x5127fb[_0x2d2e('0x9')][_0x3a266c][_0x2d2e('0xa')]||'';_0x15115f+='\x20<';_0x15115f+=_0x5127fb[_0x2d2e('0x9')][_0x3a266c][_0x2d2e('0xa')]?_0x5127fb[_0x2d2e('0x9')][_0x3a266c][_0x2d2e('0xa')]:_0x2d2e('0xb')+random[_0x2d2e('0xc')](0x6)+_0x2d2e('0xd');_0x15115f+='>';}}return _0x15115f;}function parseEmail(_0x264fad,_0x5d60b3,_0x4459c0){if(_0x5d60b3[_0x2d2e('0x19')]){var _0x4f3c62=/)<[^<]*)*<\/script>/gi;while(_0x4f3c62[_0x2d2e('0x1a')](_0x5d60b3['html'])){_0x5d60b3['html']=_0x5d60b3['html'][_0x2d2e('0x1b')](_0x4f3c62,'');}if(_0x5d60b3['html']['includes'](_0x2d2e('0x1c'))){var _0xc50104=[];_0x5d60b3[_0x2d2e('0x1d')][_0x2d2e('0x1e')](_0x3cbd64=>{_0xc50104[_0x2d2e('0x1f')](_0x3cbd64['filename']);});var _0x42abd9=/]+>/g;var _0x32183f=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x24b25d=_0x5d60b3[_0x2d2e('0x19')][_0x2d2e('0x1b')](_0x32183f,_0x2d2e('0x20'));var _0x57107a=_0x24b25d[_0x2d2e('0x1b')](_0x42abd9,_0x2d2e('0x21'));for(let _0x427bd0=0x0;_0x427bd0<_0xc50104['length'];_0x427bd0++){var _0x5d4f59=_0x57107a['replace']('_IMG',_0x2d2e('0x22')+_0xc50104[_0x427bd0]+_0x2d2e('0x23'));_0x57107a=_0x5d4f59;}_0x5d60b3[_0x2d2e('0x19')]=_0x57107a;}_0x4459c0[_0x2d2e('0x24')]=_0x5d60b3['html'];}else{_0x4459c0[_0x2d2e('0x24')]=_0x5d60b3[_0x2d2e('0x25')];}if(_0x4459c0[_0x2d2e('0x24')]){_0x4459c0['body']=_0x4459c0[_0x2d2e('0x24')][_0x2d2e('0x1b')](/0x0){var _0x13d7ba=[_0x2d2e('0x38'),'X-Auto-Response-Suppress:\x20All',_0x2d2e('0x39')];for(var _0x33ae04=0x0;_0x33ae04<_0x5d60b3[_0x2d2e('0x37')][_0x2d2e('0x13')];_0x33ae04++){var _0x153d63=_[_0x2d2e('0x11')](_0x13d7ba,_0x5d60b3[_0x2d2e('0x37')][_0x33ae04]['line']);if(_0x153d63>=0x0){_0x4459c0['isAutoreply']=!![];}}}return _0x4459c0;}exports[_0x2d2e('0x3a')]=function(_0x35b341,_0x12abc5,_0x373949){var _0x2a5161={'from':getAddress(_0x12abc5['from']),'firstName':getFirstName(_0x12abc5['from']),'lastName':getLastName(_0x12abc5[_0x2d2e('0x3b')]),'mapKey':'email','message':{'from':getMails(_0x35b341[_0x2d2e('0x7')],_0x12abc5[_0x2d2e('0x3b')]),'to':_0x35b341['email'],'cc':'','subject':_0x12abc5[_0x2d2e('0x3c')]||'','messageId':_0x12abc5[_0x2d2e('0x3d')],'inReplyTo':_0x12abc5['inReplyTo'],'sentAt':moment(_0x12abc5['date'])['format'](_0x2d2e('0x3e')),'attach':![],'attachments':[]}};if(!_0x12abc5[_0x2d2e('0x19')]&&!_0x12abc5[_0x2d2e('0x25')]){var _0x2e8f5f=_[_0x2d2e('0x3f')](_0x12abc5[_0x2d2e('0x1d')],{'contentType':'application/ms-tnef'});if(_0x2e8f5f[_0x2d2e('0x13')]){logger['info'](util[_0x2d2e('0x30')](_0x2d2e('0x40'),_0x12abc5[_0x2d2e('0x3d')]));tnef['parseBuffer'](_['first'](_0x2e8f5f)[_0x2d2e('0x35')],function(_0x4c3873,_0x376585){if(_0x376585){_0x12abc5[_0x2d2e('0x19')]=_0x376585[_0x2d2e('0x41')]||'

Empty\x20message

';if(_0x376585['Attachments']){for(var _0x31a1ca=0x0;_0x31a1ca<_0x376585['Attachments']['length'];_0x31a1ca++){var _0x2a5c58=_0x376585[_0x2d2e('0x42')][_0x31a1ca];_0x2a5161[_0x2d2e('0x27')][_0x2d2e('0x1d')][_0x2d2e('0x1f')]({'filename':_0x2a5c58[_0x2d2e('0x43')],'content':Buffer[_0x2d2e('0x3b')](_0x2a5c58['Data'])});}}}_0x373949(parseEmail(_0x35b341,_0x12abc5,_0x2a5161));});}else{_0x12abc5[_0x2d2e('0x19')]=_0x2d2e('0x44');_0x373949(parseEmail(_0x35b341,_0x12abc5,_0x2a5161));}}else{_0x373949(parseEmail(_0x35b341,_0x12abc5,_0x2a5161));}};exports['generateXOAuth2Token']=function(_0x6d9f76,_0x26e7cb){var _0x260939=[_0x2d2e('0x45')+(_0x26e7cb||''),_0x2d2e('0x46')+_0x6d9f76,'',''];return Buffer[_0x2d2e('0x3b')](_0x260939[_0x2d2e('0x15')](''),_0x2d2e('0x47'))[_0x2d2e('0x48')](_0x2d2e('0x49'));}; \ No newline at end of file diff --git a/server/services/email/model/mailAccount.js b/server/services/email/model/mailAccount.js index 15f581f..7014b85 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 _0x1715=['key','SERV','active','Imap','Smtp','name','Service'];(function(_0x8e8ca7,_0x5a5e07){var _0x561381=function(_0x2f4bda){while(--_0x2f4bda){_0x8e8ca7['push'](_0x8e8ca7['shift']());}};_0x561381(++_0x5a5e07);}(_0x1715,0x1e8));var _0x5171=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x1715[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');function MailAccount(_0x5acc78){this['id']=_0x5acc78['id']||0x0;this[_0x5171('0x0')]=_0x5acc78[_0x5171('0x0')]||_0x5171('0x1');this['key']=_0x5acc78[_0x5171('0x2')]||_0x5171('0x3');this[_0x5171('0x4')]=_0x5acc78[_0x5171('0x4')]||![];this[_0x5171('0x5')]=_0x5acc78['Imap']||[];this['Smtp']=_0x5acc78[_0x5171('0x6')]||[];}module['exports']=MailAccount; \ No newline at end of file +var _0x818d=['Smtp','exports','lodash','name','Service','key','SERV','active','Imap'];(function(_0x1d6e8a,_0x211e3f){var _0xed3c23=function(_0x13ae02){while(--_0x13ae02){_0x1d6e8a['push'](_0x1d6e8a['shift']());}};_0xed3c23(++_0x211e3f);}(_0x818d,0x122));var _0xd818=function(_0x2fd540,_0x2cdc12){_0x2fd540=_0x2fd540-0x0;var _0x105ae0=_0x818d[_0x2fd540];return _0x105ae0;};'use strict';var _=require(_0xd818('0x0'));function MailAccount(_0xb79f43){this['id']=_0xb79f43['id']||0x0;this[_0xd818('0x1')]=_0xb79f43['name']||_0xd818('0x2');this[_0xd818('0x3')]=_0xb79f43[_0xd818('0x3')]||_0xd818('0x4');this[_0xd818('0x5')]=_0xb79f43[_0xd818('0x5')]||![];this[_0xd818('0x6')]=_0xb79f43[_0xd818('0x6')]||[];this['Smtp']=_0xb79f43[_0xd818('0x7')]||[];}module[_0xd818('0x8')]=MailAccount; \ No newline at end of file diff --git a/server/services/email/realtime/index.js b/server/services/email/realtime/index.js index f5b71ab..45ecfed 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 _0xcd4a=['mailAccounts','mapKeys','hasOwnProperty','prototype','initMailAccounts','length','isUndefined','merge','lodash','../model/mailAccount'];(function(_0x4fbc8c,_0x343b6c){var _0x1535ff=function(_0x14e3cf){while(--_0x14e3cf){_0x4fbc8c['push'](_0x4fbc8c['shift']());}};_0x1535ff(++_0x343b6c);}(_0xcd4a,0x9e));var _0xacd4=function(_0x284807,_0x4be925){_0x284807=_0x284807-0x0;var _0x50c774=_0xcd4a[_0x284807];return _0x50c774;};'use strict';var _=require(_0xacd4('0x0'));var MailAccount=require(_0xacd4('0x1'));var Realtime=function(){this[_0xacd4('0x2')]={};};function freeIsNotKey(_0x2974c7,_0x11b66d,_0x68a80a){var _0x3c3e35=_[_0xacd4('0x3')](_0x2974c7,function(_0x59f883,_0x398b1e){return _0x59f883[_0x68a80a];});for(var _0x3a32d1 in _0x11b66d){if(_0x11b66d[_0xacd4('0x4')](_0x3a32d1)){if(!_0x3c3e35[_0x3a32d1]){delete _0x11b66d[_0x3a32d1];}}}}Realtime[_0xacd4('0x5')]['mergeFromDatabase']=function(_0x14ff51,_0xce7fc7){for(var _0x256127 in _0xce7fc7){if(_0x14ff51['hasOwnProperty'](_0x256127)){_0x14ff51[_0x256127]=_0xce7fc7[_0x256127];}}};Realtime[_0xacd4('0x5')][_0xacd4('0x6')]=function(){var _0x488913=this;return function(_0x5dbfa6){if(_0x5dbfa6){freeIsNotKey(_0x5dbfa6,_0x488913[_0xacd4('0x2')],'id');for(var _0x228dfa=0x0,_0x288dbf={},_0x5c4688={};_0x228dfa<_0x5dbfa6[_0xacd4('0x7')];_0x228dfa+=0x1){_0x288dbf=_0x5dbfa6[_0x228dfa];if(_[_0xacd4('0x8')](_0x488913[_0xacd4('0x2')][_0x288dbf['id']])){_0x488913[_0xacd4('0x2')][_0x288dbf['id']]=new MailAccount(_0x288dbf);}else{_[_0xacd4('0x9')](_0x488913[_0xacd4('0x2')][_0x288dbf['id']],_0x288dbf);}}}return _0x488913['mailAccounts'];};};module['exports']=Realtime; \ No newline at end of file +var _0xb58a=['initMailAccounts','mailAccounts','length','isUndefined','merge','lodash','../model/mailAccount','mapKeys','hasOwnProperty','mergeFromDatabase','prototype'];(function(_0x4bb8c8,_0x120555){var _0x21fb6d=function(_0x47956a){while(--_0x47956a){_0x4bb8c8['push'](_0x4bb8c8['shift']());}};_0x21fb6d(++_0x120555);}(_0xb58a,0xe1));var _0xab58=function(_0x466247,_0x5d69e3){_0x466247=_0x466247-0x0;var _0x4b352e=_0xb58a[_0x466247];return _0x4b352e;};'use strict';var _=require(_0xab58('0x0'));var MailAccount=require(_0xab58('0x1'));var Realtime=function(){this['mailAccounts']={};};function freeIsNotKey(_0xac8ddd,_0x5b3430,_0x313481){var _0x4314ca=_[_0xab58('0x2')](_0xac8ddd,function(_0x17216f,_0x1c4e6d){return _0x17216f[_0x313481];});for(var _0x44f25f in _0x5b3430){if(_0x5b3430[_0xab58('0x3')](_0x44f25f)){if(!_0x4314ca[_0x44f25f]){delete _0x5b3430[_0x44f25f];}}}}Realtime['prototype'][_0xab58('0x4')]=function(_0x5dbfa7,_0x53b781){for(var _0xeb2e7 in _0x53b781){if(_0x5dbfa7[_0xab58('0x3')](_0xeb2e7)){_0x5dbfa7[_0xeb2e7]=_0x53b781[_0xeb2e7];}}};Realtime[_0xab58('0x5')][_0xab58('0x6')]=function(){var _0xfa4a8e=this;return function(_0x1babd7){if(_0x1babd7){freeIsNotKey(_0x1babd7,_0xfa4a8e[_0xab58('0x7')],'id');for(var _0x46c99d=0x0,_0x320f29={},_0x2b2bf7={};_0x46c99d<_0x1babd7[_0xab58('0x8')];_0x46c99d+=0x1){_0x320f29=_0x1babd7[_0x46c99d];if(_[_0xab58('0x9')](_0xfa4a8e['mailAccounts'][_0x320f29['id']])){_0xfa4a8e['mailAccounts'][_0x320f29['id']]=new MailAccount(_0x320f29);}else{_[_0xab58('0xa')](_0xfa4a8e['mailAccounts'][_0x320f29['id']],_0x320f29);}}}return _0xfa4a8e['mailAccounts'];};};module['exports']=Realtime; \ No newline at end of file diff --git a/server/services/email/rpc/mailAccount.js b/server/services/email/rpc/mailAccount.js index 20d1bfd..3b805b5 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 _0x2087=['Imap','name','type','data5','CloudProvider','MailServerOut','Smtp','getMailAccount','NotifyMailAccount','../client','getMailAccounts','Request','GetMailAccount','provider','service','email','active','TemplateId'];(function(_0x3b4429,_0x5ef7a3){var _0x2fe16e=function(_0x5dae22){while(--_0x5dae22){_0x3b4429['push'](_0x3b4429['shift']());}};_0x2fe16e(++_0x5ef7a3);}(_0x2087,0xf3));var _0x7208=function(_0x9c8bf7,_0x1f3655){_0x9c8bf7=_0x9c8bf7-0x0;var _0x586c15=_0x2087[_0x9c8bf7];return _0x586c15;};'use strict';var client=require(_0x7208('0x0'));exports[_0x7208('0x1')]=function(){return function(){return client[_0x7208('0x2')](_0x7208('0x3'),{'options':{'attributes':['id','name',_0x7208('0x4'),_0x7208('0x5'),_0x7208('0x6'),_0x7208('0x7'),'key','ListId',_0x7208('0x8')],'raw':![],'include':[{'model':'MailServerIn','as':_0x7208('0x9'),'include':[{'model':'CloudProvider','attributes':['id',_0x7208('0xa'),_0x7208('0x5'),_0x7208('0xb'),_0x7208('0xc')],'as':_0x7208('0xd')}]},{'model':_0x7208('0xe'),'as':_0x7208('0xf'),'include':[{'model':'CloudProvider','attributes':['id',_0x7208('0xa'),_0x7208('0x5'),_0x7208('0xb'),_0x7208('0xc')],'as':_0x7208('0xd')}]}]},'log':_0x7208('0x10')});};};exports['notify']=function(_0x330d9f,_0x26de84){return client[_0x7208('0x2')](_0x7208('0x11'),{'account':{'id':_0x330d9f},'body':_0x26de84,'log':_0x7208('0x11')});}; \ No newline at end of file +var _0x4e83=['service','TemplateId','MailServerIn','CloudProvider','data5','MailServerOut','type','getMailAccount','notify','NotifyMailAccount','../client','Request','GetMailAccount','name','provider'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x4e83,0x1ae));var _0x34e8=function(_0x5c9f56,_0x42c9ad){_0x5c9f56=_0x5c9f56-0x0;var _0x2a726b=_0x4e83[_0x5c9f56];return _0x2a726b;};'use strict';var client=require(_0x34e8('0x0'));exports['getMailAccounts']=function(){return function(){return client[_0x34e8('0x1')](_0x34e8('0x2'),{'options':{'attributes':['id',_0x34e8('0x3'),_0x34e8('0x4'),_0x34e8('0x5'),'email','active','key','ListId',_0x34e8('0x6')],'raw':![],'include':[{'model':_0x34e8('0x7'),'as':'Imap','include':[{'model':_0x34e8('0x8'),'attributes':['id',_0x34e8('0x3'),_0x34e8('0x5'),'type',_0x34e8('0x9')],'as':_0x34e8('0x8')}]},{'model':_0x34e8('0xa'),'as':'Smtp','include':[{'model':_0x34e8('0x8'),'attributes':['id',_0x34e8('0x3'),_0x34e8('0x5'),_0x34e8('0xb'),_0x34e8('0x9')],'as':_0x34e8('0x8')}]}]},'log':_0x34e8('0xc')});};};exports[_0x34e8('0xd')]=function(_0x351536,_0x57ea9e){return client[_0x34e8('0x1')](_0x34e8('0xe'),{'account':{'id':_0x351536},'body':_0x57ea9e,'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 d938dbb..4bc29b7 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 _0x6d41=['../client','Request','GetSettings'];(function(_0x50408f,_0x92ffac){var _0xb02957=function(_0x111664){while(--_0x111664){_0x50408f['push'](_0x50408f['shift']());}};_0xb02957(++_0x92ffac);}(_0x6d41,0x111));var _0x16d4=function(_0x4d2a1c,_0x4fa73a){_0x4d2a1c=_0x4d2a1c-0x0;var _0x2a1031=_0x6d41[_0x4d2a1c];return _0x2a1031;};'use strict';var client=require(_0x16d4('0x0'));exports['getSettings']=function(){return client[_0x16d4('0x1')]('ShowSetting',{'options':{'raw':!![],'where':{'id':0x1},'attributes':['loginMailFrequency']},'log':_0x16d4('0x2')});}; \ No newline at end of file +var _0x5089=['loginMailFrequency','getSettings','ShowSetting'];(function(_0x435d3a,_0x56c599){var _0x40de7f=function(_0x1db359){while(--_0x1db359){_0x435d3a['push'](_0x435d3a['shift']());}};_0x40de7f(++_0x56c599);}(_0x5089,0xee));var _0x9508=function(_0x5e2489,_0x2fd8be){_0x5e2489=_0x5e2489-0x0;var _0xa87596=_0x5089[_0x5e2489];return _0xa87596;};'use strict';var client=require('../client');exports[_0x9508('0x0')]=function(){return client['Request'](_0x9508('0x1'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x9508('0x2')]},'log':'GetSettings'});}; \ No newline at end of file diff --git a/server/services/email/server/index.js b/server/services/email/server/index.js index f6c1631..4c1b5eb 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(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x21aec3,_0x5c97e9){_0x21aec3=_0x21aec3-0x0;var _0x288bbc=_0xa9e0[_0x21aec3];return _0x288bbc;};'use strict';var jayson=require(_0x0a9e('0x0'));var BPromise=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var logger=require('../../../config/logger')('email');exports[_0x0a9e('0x3')]=function(_0x4ce2f1,_0x333808){return new BPromise(function(_0x432180,_0x2ab90b){var _0x991246={'SendMail':function(_0x981158){var _0x57b080=this;return new Promise(function(_0x219af0,_0x441e3a){_0x333808[_0x0a9e('0x4')](_0x981158['account'],_0x981158['message'])[_0x0a9e('0x5')](function(_0x56465b){_0x219af0({'code':0xc8,'message':_0x56465b});})['catch'](function(_0x39753a){_0x441e3a(_0x57b080[_0x0a9e('0x6')](0x1f4,_0x39753a));});});},'VerifySmtp':function(_0x307b3e){var _0x3ab53f=this;return new Promise(function(_0xfeb75b,_0xbd1168){_0x333808['verifySmtp'](_0x307b3e['account'])['then'](function(_0x4cfe67){_0xfeb75b({'code':0xc8,'message':_0x0a9e('0x7')});})[_0x0a9e('0x8')](function(_0xd5b662){_0xbd1168(_0x3ab53f[_0x0a9e('0x6')](0x1f4,_0xd5b662));});});},'MailAccounts':function(_0x32d742){return new Promise(function(_0x69aeb7,_0x5db4b0){var _0x4283ce=_[_0x0a9e('0x9')](_0x4ce2f1[_0x0a9e('0xa')]);for(var _0x281129=0x0;_0x281129<_0x4283ce[_0x0a9e('0xb')];_0x281129+=0x1){if(_0x4283ce[_0x281129][_0x0a9e('0xc')]&&_0x4283ce[_0x281129]['Imap'][_0x0a9e('0xd')]){delete _0x4283ce[_0x281129]['Imap'][_0x0a9e('0xd')];}if(_0x4283ce[_0x281129]['Smtp']&&_0x4283ce[_0x281129][_0x0a9e('0xe')][_0x0a9e('0xf')]){delete _0x4283ce[_0x281129]['Smtp'][_0x0a9e('0xf')];}}_0x69aeb7({'count':_0x4283ce['length'],'rows':_0x4283ce});});}};var _0x459eb1=jayson[_0x0a9e('0x10')](_0x991246)[_0x0a9e('0x11')]();_0x459eb1['on'](_0x0a9e('0x6'),function(_0x31b1ca){logger[_0x0a9e('0x6')](JSON[_0x0a9e('0x12')](_0x31b1ca));return _0x2ab90b(_0x31b1ca);});_0x459eb1[_0x0a9e('0x3')](0x232b,_0x0a9e('0x13'),function(){console[_0x0a9e('0x14')](_0x0a9e('0x15'),0x232b);return _0x432180(_0x0a9e('0x16')+0x232b);});});}; \ No newline at end of file +var _0xa9e0=['catch','values','mailAccounts','length','Imap','password','Smtp','pass','server','http','stringify','127.0.0.1','log','Email\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','jayson/promise','bluebird','lodash','listen','sendMail','then','error','Verified'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xa9e0,0x123));var _0x0a9e=function(_0x173d7e,_0x3242fd){_0x173d7e=_0x173d7e-0x0;var _0x2220d6=_0xa9e0[_0x173d7e];return _0x2220d6;};'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 189869d..d44721d 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 _0x9c62=['lodash','http','express','sticky-session','ioredis','../../config/environment','port','socket.io','polling','defaults','localhost','adapter','redis','../../config/triggers','default','../../config/socketio','../../routes','listening','log','Express\x20server\x20listening\x20on\x20port\x20%d!','exports'];(function(_0x43b06b,_0x1929c7){var _0x2c555b=function(_0x30fa8c){while(--_0x30fa8c){_0x43b06b['push'](_0x43b06b['shift']());}};_0x2c555b(++_0x1929c7);}(_0x9c62,0x13b));var _0x29c6=function(_0x4f8c50,_0x47ec90){_0x4f8c50=_0x4f8c50-0x0;var _0xfcddd7=_0x9c62[_0x4f8c50];return _0xfcddd7;};'use strict';var _=require(_0x29c6('0x0'));var http=require(_0x29c6('0x1'));var express=require(_0x29c6('0x2'));var sticky=require(_0x29c6('0x3'));var Redis=require(_0x29c6('0x4'));var config=require(_0x29c6('0x5'));var app=express();var server=http['createServer'](app);server['timeout']=0xdbba0;if(sticky['listen'](server,config[_0x29c6('0x6')])){var socketio=require(_0x29c6('0x7'))(server,{'transports':['websocket',_0x29c6('0x8')]});config['redis']=_[_0x29c6('0x9')](config['redis'],{'host':_0x29c6('0xa'),'port':0x18eb});socketio[_0x29c6('0xb')](require('socket.io-redis')({'pubClient':new Redis(config['redis']),'subClient':new Redis(config[_0x29c6('0xc')])}));require(_0x29c6('0xd'))[_0x29c6('0xe')]();require(_0x29c6('0xf'))[_0x29c6('0xe')](socketio);require('../../config/express')[_0x29c6('0xe')](app);require(_0x29c6('0x10'))[_0x29c6('0xe')](app);}else{server['once'](_0x29c6('0x11'),function(){console[_0x29c6('0x12')](_0x29c6('0x13'),config['port']);});}exports=module[_0x29c6('0x14')]=app; \ No newline at end of file +var _0x8f74=['../../config/triggers','default','../../config/socketio','../../routes','once','log','port','express','sticky-session','createServer','timeout','listen','socket.io','websocket','redis','defaults','adapter','socket.io-redis'];(function(_0x3b6aa0,_0x1e052b){var _0xa911ad=function(_0x3f2cb0){while(--_0x3f2cb0){_0x3b6aa0['push'](_0x3b6aa0['shift']());}};_0xa911ad(++_0x1e052b);}(_0x8f74,0x73));var _0x48f7=function(_0x3d035b,_0x23633a){_0x3d035b=_0x3d035b-0x0;var _0x38ddb2=_0x8f74[_0x3d035b];return _0x38ddb2;};'use strict';var _=require('lodash');var http=require('http');var express=require(_0x48f7('0x0'));var sticky=require(_0x48f7('0x1'));var Redis=require('ioredis');var config=require('../../config/environment');var app=express();var server=http[_0x48f7('0x2')](app);server[_0x48f7('0x3')]=0xdbba0;if(sticky[_0x48f7('0x4')](server,config['port'])){var socketio=require(_0x48f7('0x5'))(server,{'transports':[_0x48f7('0x6'),'polling']});config[_0x48f7('0x7')]=_[_0x48f7('0x8')](config[_0x48f7('0x7')],{'host':'localhost','port':0x18eb});socketio[_0x48f7('0x9')](require(_0x48f7('0xa'))({'pubClient':new Redis(config[_0x48f7('0x7')]),'subClient':new Redis(config[_0x48f7('0x7')])}));require(_0x48f7('0xb'))[_0x48f7('0xc')]();require(_0x48f7('0xd'))[_0x48f7('0xc')](socketio);require('../../config/express')[_0x48f7('0xc')](app);require(_0x48f7('0xe'))[_0x48f7('0xc')](app);}else{server[_0x48f7('0xf')]('listening',function(){console[_0x48f7('0x10')]('Express\x20server\x20listening\x20on\x20port\x20%d!',config[_0x48f7('0x11')]);});}exports=module['exports']=app; \ No newline at end of file diff --git a/server/services/routing/client.js b/server/services/routing/client.js index f86dcdd..72888c7 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 _0x96f5=['then','rpc','error','message','exports','jayson/promise','bluebird','../../config/logger','routing','client','http','Request','request'];(function(_0xd467b8,_0x4cafb6){var _0x4658e5=function(_0x5794aa){while(--_0x5794aa){_0xd467b8['push'](_0xd467b8['shift']());}};_0x4658e5(++_0x4cafb6);}(_0x96f5,0xef));var _0x596f=function(_0x16dd69,_0x76c1d3){_0x16dd69=_0x16dd69-0x0;var _0x55e637=_0x96f5[_0x16dd69];return _0x55e637;};'use strict';var jayson=require(_0x596f('0x0'));var BPromise=require(_0x596f('0x1'));var logger=require(_0x596f('0x2'))(_0x596f('0x3'));var client=jayson[_0x596f('0x4')][_0x596f('0x5')]({'port':0x2329});client[_0x596f('0x6')]=function(_0x334da4,_0x209a44){return new BPromise(function(_0x1711e5,_0x1ff48c){return client[_0x596f('0x7')](_0x334da4,_0x209a44)[_0x596f('0x8')](function(_0x2c00b3){logger['debug'](_0x596f('0x9'),_0x596f('0x3'),_0x334da4,_0x209a44,_0x2c00b3);if(_0x2c00b3[_0x596f('0xa')]){logger[_0x596f('0xa')](_0x596f('0x9'),_0x596f('0x3'),_0x334da4,_0x2c00b3[_0x596f('0xa')][_0x596f('0xb')],_0x209a44);return _0x1ff48c(_0x2c00b3[_0x596f('0xa')][_0x596f('0xb')]);}else{return _0x1711e5(_0x2c00b3['result']);}})['catch'](function(_0x4075b1){logger[_0x596f('0xa')](_0x596f('0x9'),_0x596f('0x3'),_0x334da4,_0x4075b1,_0x209a44);return _0x1ff48c(_0x4075b1);});});};module[_0x596f('0xc')]=client; \ No newline at end of file +var _0xfcf5=['error','rpc','message','result','exports','jayson/promise','bluebird','../../config/logger','routing','http','then','debug'];(function(_0x5e5dbf,_0x1e8c22){var _0xfd8d51=function(_0x8d8e28){while(--_0x8d8e28){_0x5e5dbf['push'](_0x5e5dbf['shift']());}};_0xfd8d51(++_0x1e8c22);}(_0xfcf5,0xad));var _0x5fcf=function(_0x392ce3,_0x547150){_0x392ce3=_0x392ce3-0x0;var _0x593e88=_0xfcf5[_0x392ce3];return _0x593e88;};'use strict';var jayson=require(_0x5fcf('0x0'));var BPromise=require(_0x5fcf('0x1'));var logger=require(_0x5fcf('0x2'))(_0x5fcf('0x3'));var client=jayson['client'][_0x5fcf('0x4')]({'port':0x2329});client['Request']=function(_0x5605d5,_0x2872fc){return new BPromise(function(_0xb516d,_0x29b01e){return client['request'](_0x5605d5,_0x2872fc)[_0x5fcf('0x5')](function(_0x1fb1c7){logger[_0x5fcf('0x6')]('rpc',_0x5fcf('0x3'),_0x5605d5,_0x2872fc,_0x1fb1c7);if(_0x1fb1c7['error']){logger[_0x5fcf('0x7')](_0x5fcf('0x8'),_0x5fcf('0x3'),_0x5605d5,_0x1fb1c7[_0x5fcf('0x7')][_0x5fcf('0x9')],_0x2872fc);return _0x29b01e(_0x1fb1c7[_0x5fcf('0x7')][_0x5fcf('0x9')]);}else{return _0xb516d(_0x1fb1c7[_0x5fcf('0xa')]);}})['catch'](function(_0x5d5dcc){logger[_0x5fcf('0x7')](_0x5fcf('0x8'),_0x5fcf('0x3'),_0x5605d5,_0x5d5dcc,_0x2872fc);return _0x29b01e(_0x5d5dcc);});});};module[_0x5fcf('0xb')]=client; \ No newline at end of file diff --git a/server/services/routing/index.js b/server/services/routing/index.js index 349f7e4..e83496b 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 _0xf80a=['listen','log','./server','./realtime','./rpc/user','./rpc/interval','./rpc/openchannelQueue','./rpc/chatQueue','./rpc/smsQueue','./rpc/mailQueue','./rpc/faxQueue','./rpc/whatsappQueue','resolve','then','initAgents','getIntervals','getOpenchannelQueues','initOpenchannelQueues','getChatQueues','initChatQueues','getMailQueues','getFaxQueues','initFaxQueues','getWhatsappQueues','initWhatsappQueues'];(function(_0x3cc90b,_0x1b69d9){var _0x34051b=function(_0x1f01f7){while(--_0x1f01f7){_0x3cc90b['push'](_0x3cc90b['shift']());}};_0x34051b(++_0x1b69d9);}(_0xf80a,0x147));var _0xaf80=function(_0x135cf6,_0x18e5f7){_0x135cf6=_0x135cf6-0x0;var _0x4da041=_0xf80a[_0x135cf6];return _0x4da041;};'use strict';var BPromise=require('bluebird');var server=require(_0xaf80('0x0'));var Realtime=require(_0xaf80('0x1'));var user=require(_0xaf80('0x2'));var interval=require(_0xaf80('0x3'));var openchannelQueue=require(_0xaf80('0x4'));var chatQueue=require(_0xaf80('0x5'));var smsQueue=require(_0xaf80('0x6'));var mailQueue=require(_0xaf80('0x7'));var faxQueue=require(_0xaf80('0x8'));var whatsappQueue=require(_0xaf80('0x9'));var realtime=new Realtime();function initRealtime(){return BPromise[_0xaf80('0xa')]()[_0xaf80('0xb')](user['getAgents']())['then'](realtime[_0xaf80('0xc')]())[_0xaf80('0xb')](interval[_0xaf80('0xd')]())[_0xaf80('0xb')](realtime['initIntervals']())[_0xaf80('0xb')](openchannelQueue[_0xaf80('0xe')]())[_0xaf80('0xb')](realtime[_0xaf80('0xf')]())[_0xaf80('0xb')](chatQueue[_0xaf80('0x10')]())[_0xaf80('0xb')](realtime[_0xaf80('0x11')]())[_0xaf80('0xb')](smsQueue['getSmsQueues']())[_0xaf80('0xb')](realtime['initSmsQueues']())[_0xaf80('0xb')](mailQueue[_0xaf80('0x12')]())[_0xaf80('0xb')](realtime['initMailQueues']())[_0xaf80('0xb')](faxQueue[_0xaf80('0x13')]())['then'](realtime[_0xaf80('0x14')]())['then'](whatsappQueue[_0xaf80('0x15')]())[_0xaf80('0xb')](realtime[_0xaf80('0x16')]())[_0xaf80('0xb')](function(){return realtime;});}function main(){return server[_0xaf80('0x17')](realtime)[_0xaf80('0xb')](function(_0x5d1277){return initRealtime();})[_0xaf80('0xb')](function(_0x2cb797){return setInterval(initRealtime,0x1388);})['catch'](function(_0x383201){console[_0xaf80('0x18')](_0x383201);});}main(); \ No newline at end of file +var _0xf061=['catch','log','bluebird','./realtime','./rpc/interval','./rpc/openchannelQueue','./rpc/smsQueue','then','getAgents','initAgents','getIntervals','getOpenchannelQueues','getChatQueues','getMailQueues','initMailQueues','getFaxQueues','initWhatsappQueues','listen'];(function(_0x57eabc,_0x239e7c){var _0x227184=function(_0x4d97e1){while(--_0x4d97e1){_0x57eabc['push'](_0x57eabc['shift']());}};_0x227184(++_0x239e7c);}(_0xf061,0x1d6));var _0x1f06=function(_0x1af6d5,_0x7c8a63){_0x1af6d5=_0x1af6d5-0x0;var _0x4e5d5c=_0xf061[_0x1af6d5];return _0x4e5d5c;};'use strict';var BPromise=require(_0x1f06('0x0'));var server=require('./server');var Realtime=require(_0x1f06('0x1'));var user=require('./rpc/user');var interval=require(_0x1f06('0x2'));var openchannelQueue=require(_0x1f06('0x3'));var chatQueue=require('./rpc/chatQueue');var smsQueue=require(_0x1f06('0x4'));var mailQueue=require('./rpc/mailQueue');var faxQueue=require('./rpc/faxQueue');var whatsappQueue=require('./rpc/whatsappQueue');var realtime=new Realtime();function initRealtime(){return BPromise['resolve']()[_0x1f06('0x5')](user[_0x1f06('0x6')]())[_0x1f06('0x5')](realtime[_0x1f06('0x7')]())[_0x1f06('0x5')](interval[_0x1f06('0x8')]())['then'](realtime['initIntervals']())['then'](openchannelQueue[_0x1f06('0x9')]())[_0x1f06('0x5')](realtime['initOpenchannelQueues']())['then'](chatQueue[_0x1f06('0xa')]())[_0x1f06('0x5')](realtime['initChatQueues']())[_0x1f06('0x5')](smsQueue['getSmsQueues']())['then'](realtime['initSmsQueues']())[_0x1f06('0x5')](mailQueue[_0x1f06('0xb')]())[_0x1f06('0x5')](realtime[_0x1f06('0xc')]())['then'](faxQueue[_0x1f06('0xd')]())[_0x1f06('0x5')](realtime['initFaxQueues']())[_0x1f06('0x5')](whatsappQueue['getWhatsappQueues']())['then'](realtime[_0x1f06('0xe')]())[_0x1f06('0x5')](function(){return realtime;});}function main(){return server[_0x1f06('0xf')](realtime)[_0x1f06('0x5')](function(_0x134911){return initRealtime();})[_0x1f06('0x5')](function(_0x39a817){return setInterval(initRealtime,0x1388);})[_0x1f06('0x10')](function(_0x1e0599){console[_0x1f06('0x11')](_0x1e0599);});}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 e07bb63..c02ee24 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 _0x814b=['init','parse','map','object','lodash','util','events','EventEmitter','isNil','register','ignoreFactChanges','inherits','prototype','rules','isArray','concat','isObject','push','sync','filter','activeRules','orderBy','asc','execute','result','clone','name','ruleRef','call','next','isEqual','nextTick','restart','length','condition','matchPath','noop','findRules','matches','turn','prioritize','priority','toJSON','toString','consequence','fromJSON'];(function(_0x54dc48,_0xf3557c){var _0x57237b=function(_0x3c4e85){while(--_0x3c4e85){_0x54dc48['push'](_0x54dc48['shift']());}};_0x57237b(++_0xf3557c);}(_0x814b,0x1a2));var _0xb814=function(_0xc4001c,_0x1bf8f0){_0xc4001c=_0xc4001c-0x0;var _0x49f7bc=_0x814b[_0xc4001c];return _0x49f7bc;};'use strict';var _=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var EventEmitter=require(_0xb814('0x2'))[_0xb814('0x3')];function RuleEngine(_0xfbb64b,_0x477725){this['init']();if(!_[_0xb814('0x4')](_0xfbb64b)){this[_0xb814('0x5')](_0xfbb64b);}if(_0x477725){this[_0xb814('0x6')]=_0x477725[_0xb814('0x6')];}return this;}util[_0xb814('0x7')](RuleEngine,EventEmitter);RuleEngine[_0xb814('0x8')]['init']=function(_0x3b0829){this[_0xb814('0x9')]=[];this['activeRules']=[];};RuleEngine[_0xb814('0x8')][_0xb814('0x5')]=function(_0x186d5a){if(Array[_0xb814('0xa')](_0x186d5a)){this[_0xb814('0x9')]=this[_0xb814('0x9')][_0xb814('0xb')](_0x186d5a);}else if(_0x186d5a!==null&&_[_0xb814('0xc')](_0x186d5a)){this[_0xb814('0x9')][_0xb814('0xd')](_0x186d5a);}this[_0xb814('0xe')]();};RuleEngine['prototype'][_0xb814('0xe')]=function(){this['activeRules']=this[_0xb814('0x9')][_0xb814('0xf')](function(_0x35b10d){if(_[_0xb814('0x4')](_0x35b10d['on'])){_0x35b10d['on']=!![];}if(_0x35b10d['on']===!![]){return _0x35b10d;}});this[_0xb814('0x10')]=_[_0xb814('0x11')](this[_0xb814('0x10')],['p'],[_0xb814('0x12')]);};RuleEngine[_0xb814('0x8')][_0xb814('0x13')]=function(_0x3f4881,_0x44fb96){var _0x17f5bd=![];_0x3f4881[_0xb814('0x14')]=!![];var _0x303aca=_[_0xb814('0x15')](_0x3f4881);var _0x45e0d0=_[_0xb814('0x15')](_0x3f4881);var _0x125ce2=this[_0xb814('0x10')];var _0x7a21ef=[];var _0x48c9df=this[_0xb814('0x6')];(function FnRuleLoop(_0x55ba16){var _0x270598={'rules':function(){return _0x125ce2;},'rule':function(){return _0x125ce2[_0x55ba16];},'when':function(_0xfac75b){if(_0xfac75b){var _0x4c3007=_0x125ce2[_0x55ba16]['consequence'];_0x4c3007['ruleRef']=_0x125ce2[_0x55ba16]['id']||_0x125ce2[_0x55ba16][_0xb814('0x16')]||'index_'+_0x55ba16;process['nextTick'](function(){_0x7a21ef[_0xb814('0xd')](_0x4c3007[_0xb814('0x17')]);_0x4c3007[_0xb814('0x18')](_0x303aca,_0x270598);});}else{process['nextTick'](function(){_0x270598[_0xb814('0x19')]();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x17f5bd=!![];return FnRuleLoop(0x0);},'next':function(_0x531032){if(!_0x48c9df&&!_[_0xb814('0x1a')](_0x45e0d0,_0x303aca)){_0x45e0d0=_[_0xb814('0x15')](_0x303aca);process[_0xb814('0x1b')](function(){_0x270598[_0xb814('0x1c')]();});}else{process[_0xb814('0x1b')](function(){if(_[_0xb814('0x4')](_0x531032)){return FnRuleLoop(_0x55ba16+0x1);}else{return FnRuleLoop(_0x531032);}});}}};if(_0x55ba16<_0x125ce2[_0xb814('0x1d')]&&_0x17f5bd===![]){var _0x594470=_0x125ce2[_0x55ba16][_0xb814('0x1e')];_0x594470['call'](_0x303aca,_0x270598);}else{process[_0xb814('0x1b')](function(){_0x303aca[_0xb814('0x1f')]=_0x7a21ef;return _0x44fb96?_0x44fb96(_0x303aca):_[_0xb814('0x20')]();});}}(0x0));};RuleEngine[_0xb814('0x8')][_0xb814('0x21')]=function(_0xb9e57d){if(_[_0xb814('0x4')](_0xb9e57d)){return this['rules'];}else{var _0x392222=_[_0xb814('0x22')](_0xb9e57d);return _[_0xb814('0xf')](this[_0xb814('0x9')],_0x392222);}};RuleEngine[_0xb814('0x8')][_0xb814('0x23')]=function(_0x3f0150,_0x1e4e89){var _0x5a6291=_0x3f0150==='on'||_0x3f0150==='ON'?!![]:![];var _0x271aa8=this[_0xb814('0x21')](_0x1e4e89);for(var _0x52ed64=0x0,_0x9008b2=_0x271aa8[_0xb814('0x1d')];_0x52ed64<_0x9008b2;_0x52ed64+=0x1){_0x271aa8[_0x52ed64]['on']=_0x5a6291;}this[_0xb814('0xe')]();};RuleEngine['prototype'][_0xb814('0x24')]=function(_0x2051d0,_0x58c3ca){_0x2051d0=parseInt(_0x2051d0,0xa);var _0x338a28=this['findRules'](_0x58c3ca);for(var _0x6efe9a=0x0,_0x5f3e9b=_0x338a28['length'];_0x6efe9a<_0x5f3e9b;_0x6efe9a+=0x1){_0x338a28[_0x6efe9a][_0xb814('0x25')]=_0x2051d0;}this['sync']();};RuleEngine[_0xb814('0x8')][_0xb814('0x26')]=function(){var _0x2b91bd=this['rules'];if(_0x2b91bd instanceof Array){_0x2b91bd=_0x2b91bd['map'](function(_0x26d3a9){_0x26d3a9[_0xb814('0x1e')]=_0x26d3a9['condition'][_0xb814('0x27')]();_0x26d3a9[_0xb814('0x28')]=_0x26d3a9[_0xb814('0x28')][_0xb814('0x27')]();return _0x26d3a9;});}else if(!_[_0xb814('0x4')](_0x2b91bd)){_0x2b91bd[_0xb814('0x1e')]=_0x2b91bd[_0xb814('0x1e')]['toString']();_0x2b91bd[_0xb814('0x28')]=_0x2b91bd[_0xb814('0x28')][_0xb814('0x27')]();}return _0x2b91bd;};RuleEngine[_0xb814('0x8')][_0xb814('0x29')]=function(_0x4ff31a){this[_0xb814('0x2a')]();if(_['isString'](_0x4ff31a)){_0x4ff31a=JSON[_0xb814('0x2b')](_0x4ff31a);}if(_0x4ff31a instanceof Array){_0x4ff31a=_0x4ff31a[_0xb814('0x2c')](function(_0xe0f509){_0xe0f509['condition']=eval('('+_0xe0f509[_0xb814('0x1e')]+')');_0xe0f509[_0xb814('0x28')]=eval('('+_0xe0f509['consequence']+')');return _0xe0f509;});}else if(_0x4ff31a!==null&&typeof _0x4ff31a==_0xb814('0x2d')){_0x4ff31a[_0xb814('0x1e')]=eval('('+_0x4ff31a[_0xb814('0x1e')]+')');_0x4ff31a[_0xb814('0x28')]=eval('('+_0x4ff31a[_0xb814('0x28')]+')');}this[_0xb814('0x5')](_0x4ff31a);};module['exports']=RuleEngine; \ No newline at end of file +var _0x1261=['isNil','register','ignoreFactChanges','activeRules','prototype','isArray','rules','concat','isObject','push','sync','filter','orderBy','asc','result','clone','name','nextTick','ruleRef','isEqual','restart','length','condition','noop','findRules','matches','turn','prioritize','priority','toString','consequence','fromJSON','isString','parse','map','object','exports','util','events','EventEmitter','init'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x1261,0x144));var _0x1126=function(_0x234e1a,_0x500d79){_0x234e1a=_0x234e1a-0x0;var _0x55aad2=_0x1261[_0x234e1a];return _0x55aad2;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var EventEmitter=require(_0x1126('0x1'))[_0x1126('0x2')];function RuleEngine(_0x331a2c,_0x39b786){this[_0x1126('0x3')]();if(!_[_0x1126('0x4')](_0x331a2c)){this[_0x1126('0x5')](_0x331a2c);}if(_0x39b786){this[_0x1126('0x6')]=_0x39b786[_0x1126('0x6')];}return this;}util['inherits'](RuleEngine,EventEmitter);RuleEngine['prototype'][_0x1126('0x3')]=function(_0x907180){this['rules']=[];this[_0x1126('0x7')]=[];};RuleEngine[_0x1126('0x8')][_0x1126('0x5')]=function(_0x3abb0b){if(Array[_0x1126('0x9')](_0x3abb0b)){this['rules']=this[_0x1126('0xa')][_0x1126('0xb')](_0x3abb0b);}else if(_0x3abb0b!==null&&_[_0x1126('0xc')](_0x3abb0b)){this['rules'][_0x1126('0xd')](_0x3abb0b);}this['sync']();};RuleEngine['prototype'][_0x1126('0xe')]=function(){this['activeRules']=this[_0x1126('0xa')][_0x1126('0xf')](function(_0xd26a32){if(_[_0x1126('0x4')](_0xd26a32['on'])){_0xd26a32['on']=!![];}if(_0xd26a32['on']===!![]){return _0xd26a32;}});this[_0x1126('0x7')]=_[_0x1126('0x10')](this[_0x1126('0x7')],['p'],[_0x1126('0x11')]);};RuleEngine[_0x1126('0x8')]['execute']=function(_0x5de9a7,_0x1af673){var _0x154e20=![];_0x5de9a7[_0x1126('0x12')]=!![];var _0x4be0c6=_[_0x1126('0x13')](_0x5de9a7);var _0x4794a7=_[_0x1126('0x13')](_0x5de9a7);var _0x42f379=this[_0x1126('0x7')];var _0x4e1c97=[];var _0x245cd7=this[_0x1126('0x6')];(function FnRuleLoop(_0x4a7b49){var _0x4d2b38={'rules':function(){return _0x42f379;},'rule':function(){return _0x42f379[_0x4a7b49];},'when':function(_0x22ae0b){if(_0x22ae0b){var _0x2b2487=_0x42f379[_0x4a7b49]['consequence'];_0x2b2487['ruleRef']=_0x42f379[_0x4a7b49]['id']||_0x42f379[_0x4a7b49][_0x1126('0x14')]||'index_'+_0x4a7b49;process[_0x1126('0x15')](function(){_0x4e1c97[_0x1126('0xd')](_0x2b2487[_0x1126('0x16')]);_0x2b2487['call'](_0x4be0c6,_0x4d2b38);});}else{process[_0x1126('0x15')](function(){_0x4d2b38['next']();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x154e20=!![];return FnRuleLoop(0x0);},'next':function(_0x56efeb){if(!_0x245cd7&&!_[_0x1126('0x17')](_0x4794a7,_0x4be0c6)){_0x4794a7=_[_0x1126('0x13')](_0x4be0c6);process[_0x1126('0x15')](function(){_0x4d2b38[_0x1126('0x18')]();});}else{process['nextTick'](function(){if(_[_0x1126('0x4')](_0x56efeb)){return FnRuleLoop(_0x4a7b49+0x1);}else{return FnRuleLoop(_0x56efeb);}});}}};if(_0x4a7b49<_0x42f379[_0x1126('0x19')]&&_0x154e20===![]){var _0x48a08d=_0x42f379[_0x4a7b49][_0x1126('0x1a')];_0x48a08d['call'](_0x4be0c6,_0x4d2b38);}else{process['nextTick'](function(){_0x4be0c6['matchPath']=_0x4e1c97;return _0x1af673?_0x1af673(_0x4be0c6):_[_0x1126('0x1b')]();});}}(0x0));};RuleEngine[_0x1126('0x8')][_0x1126('0x1c')]=function(_0x34bcf1){if(_[_0x1126('0x4')](_0x34bcf1)){return this[_0x1126('0xa')];}else{var _0xea0971=_[_0x1126('0x1d')](_0x34bcf1);return _['filter'](this[_0x1126('0xa')],_0xea0971);}};RuleEngine[_0x1126('0x8')][_0x1126('0x1e')]=function(_0x5ddf63,_0x541bc9){var _0xeb7d89=_0x5ddf63==='on'||_0x5ddf63==='ON'?!![]:![];var _0x39bf0e=this['findRules'](_0x541bc9);for(var _0x2fb797=0x0,_0x23d2bc=_0x39bf0e['length'];_0x2fb797<_0x23d2bc;_0x2fb797+=0x1){_0x39bf0e[_0x2fb797]['on']=_0xeb7d89;}this[_0x1126('0xe')]();};RuleEngine['prototype'][_0x1126('0x1f')]=function(_0x4bd50b,_0x771bb8){_0x4bd50b=parseInt(_0x4bd50b,0xa);var _0x583ce6=this[_0x1126('0x1c')](_0x771bb8);for(var _0x5f2611=0x0,_0x5252e0=_0x583ce6['length'];_0x5f2611<_0x5252e0;_0x5f2611+=0x1){_0x583ce6[_0x5f2611][_0x1126('0x20')]=_0x4bd50b;}this[_0x1126('0xe')]();};RuleEngine[_0x1126('0x8')]['toJSON']=function(){var _0x2a3055=this[_0x1126('0xa')];if(_0x2a3055 instanceof Array){_0x2a3055=_0x2a3055['map'](function(_0x3dd50e){_0x3dd50e[_0x1126('0x1a')]=_0x3dd50e[_0x1126('0x1a')][_0x1126('0x21')]();_0x3dd50e['consequence']=_0x3dd50e['consequence'][_0x1126('0x21')]();return _0x3dd50e;});}else if(!_[_0x1126('0x4')](_0x2a3055)){_0x2a3055[_0x1126('0x1a')]=_0x2a3055[_0x1126('0x1a')]['toString']();_0x2a3055[_0x1126('0x22')]=_0x2a3055[_0x1126('0x22')][_0x1126('0x21')]();}return _0x2a3055;};RuleEngine[_0x1126('0x8')][_0x1126('0x23')]=function(_0x5df232){this[_0x1126('0x3')]();if(_[_0x1126('0x24')](_0x5df232)){_0x5df232=JSON[_0x1126('0x25')](_0x5df232);}if(_0x5df232 instanceof Array){_0x5df232=_0x5df232[_0x1126('0x26')](function(_0x5c019d){_0x5c019d['condition']=eval('('+_0x5c019d[_0x1126('0x1a')]+')');_0x5c019d[_0x1126('0x22')]=eval('('+_0x5c019d['consequence']+')');return _0x5c019d;});}else if(_0x5df232!==null&&typeof _0x5df232==_0x1126('0x27')){_0x5df232[_0x1126('0x1a')]=eval('('+_0x5df232[_0x1126('0x1a')]+')');_0x5df232['consequence']=eval('('+_0x5df232['consequence']+')');}this[_0x1126('0x5')](_0x5df232);};module[_0x1126('0x28')]=RuleEngine; \ No newline at end of file diff --git a/server/services/routing/mailRpc/index.js b/server/services/routing/mailRpc/index.js index 92de577..6b08282 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 _0x3763=['bluebird','client','http','request','error','message','result','catch','sendMailMessage'];(function(_0x368e09,_0x2c1517){var _0x14b7df=function(_0x5002af){while(--_0x5002af){_0x368e09['push'](_0x368e09['shift']());}};_0x14b7df(++_0x2c1517);}(_0x3763,0xf3));var _0x3376=function(_0x42e942,_0x37d8ea){_0x42e942=_0x42e942-0x0;var _0x3f90c0=_0x3763[_0x42e942];return _0x3f90c0;};'use strict';var BPromise=require(_0x3376('0x0'));var jayson=require('jayson/promise');var client=jayson[_0x3376('0x1')][_0x3376('0x2')]({'port':0x232b});function request(_0x148fbb,_0x5c310f){return new BPromise(function(_0x533de0,_0x3c7b23){return client[_0x3376('0x3')](_0x148fbb,_0x5c310f)['then'](function(_0x996a7f){if(_0x996a7f[_0x3376('0x4')]){return _0x3c7b23(_0x996a7f['error'][_0x3376('0x5')]);}else{return _0x533de0(_0x996a7f[_0x3376('0x6')]);}})[_0x3376('0x7')](function(_0x3873ef){return _0x3c7b23(_0x3873ef);});});}exports[_0x3376('0x8')]=function(_0x6fab58,_0x46d859){return request('SendMail',{'account':_0x6fab58,'message':_0x46d859});}; \ No newline at end of file +var _0xc89a=['then','error','result','sendMailMessage','bluebird','jayson/promise','client','http'];(function(_0x5cf85f,_0x436017){var _0x37a0f5=function(_0x1783aa){while(--_0x1783aa){_0x5cf85f['push'](_0x5cf85f['shift']());}};_0x37a0f5(++_0x436017);}(_0xc89a,0xdc));var _0xac89=function(_0xf4edcb,_0x40eaea){_0xf4edcb=_0xf4edcb-0x0;var _0x1aa04b=_0xc89a[_0xf4edcb];return _0x1aa04b;};'use strict';var BPromise=require(_0xac89('0x0'));var jayson=require(_0xac89('0x1'));var client=jayson[_0xac89('0x2')][_0xac89('0x3')]({'port':0x232b});function request(_0x416bb4,_0x5d6869){return new BPromise(function(_0x321645,_0xbb72fc){return client['request'](_0x416bb4,_0x5d6869)[_0xac89('0x4')](function(_0x1bc96a){if(_0x1bc96a[_0xac89('0x5')]){return _0xbb72fc(_0x1bc96a[_0xac89('0x5')]['message']);}else{return _0x321645(_0x1bc96a[_0xac89('0x6')]);}})['catch'](function(_0x140f35){return _0xbb72fc(_0x140f35);});});}exports[_0xac89('0x7')]=function(_0x2143cc,_0x5f1e3a){return request('SendMail',{'account':_0x2143cc,'message':_0x5f1e3a});}; \ No newline at end of file diff --git a/server/services/routing/model/agent.js b/server/services/routing/model/agent.js index e410cd3..1607064 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 _0xb145=['smsStatusTime','smsCapacity','whatsappStatus','whatsappCapacity','whatsappCurrentCapacity','openchannelStatus','openchannelStatusTime','openchannelCapacity','chatWaitingInteractions','faxWaitingInteractions','mailWaitingInteractions','smsWaitingInteractions','whatsappWaitingInteractions','prototype','getChannelStatus','CurrentCapacity','working','idle','mail','chat','openchannel','fax','sms','whatsapp','length','Status','StatusTime','toNumber','smsCurrentCapacity','whatsappStatusTime','busy','openchannelWaitingInteractions','emit','user:routing:update','exports','md5','moment','ioredis','../../../config/environment','redis','defaults','localhost','name','online','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','chatStatus','chatStatusTime','chatCapacity','chatCurrentCapacity','mailStatus','unknown','mailStatusTime','mailCapacity','mailCurrentCapacity','faxStatus','faxStatusTime','faxCapacity','faxCurrentCapacity','smsStatus'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xb145,0xa3));var _0x5b14=function(_0x1c397f,_0x2df316){_0x1c397f=_0x1c397f-0x0;var _0x50db2b=_0xb145[_0x1c397f];return _0x50db2b;};'use strict';var _=require('lodash');var md5=require(_0x5b14('0x0'));var moment=require(_0x5b14('0x1'));var Redis=require(_0x5b14('0x2'));var config=require(_0x5b14('0x3'));config[_0x5b14('0x4')]=_[_0x5b14('0x5')](config[_0x5b14('0x4')],{'host':_0x5b14('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x5b14('0x4')]));function Agent(_0x15490e){this['id']=_0x15490e['id']||0x0;this[_0x5b14('0x7')]=_0x15490e[_0x5b14('0x7')]||'';this['online']=_0x15490e[_0x5b14('0x8')]||!![];this[_0x5b14('0x9')]=_0x15490e[_0x5b14('0x9')]||![];this[_0x5b14('0xa')]=_0x15490e[_0x5b14('0xa')]||![];this['mailPause']=_0x15490e[_0x5b14('0xb')]||![];this[_0x5b14('0xc')]=_0x15490e['faxPause']||![];this[_0x5b14('0xd')]=_0x15490e[_0x5b14('0xd')]||![];this[_0x5b14('0xe')]=_0x15490e[_0x5b14('0xe')]||![];this[_0x5b14('0xf')]='unknown';this[_0x5b14('0x10')]=0x0;this['chatCapacity']=_0x15490e[_0x5b14('0x11')]||0x0;this[_0x5b14('0x12')]=0x0;this[_0x5b14('0x13')]=_0x5b14('0x14');this[_0x5b14('0x15')]=0x0;this[_0x5b14('0x16')]=_0x15490e['mailCapacity']||0x0;this[_0x5b14('0x17')]=0x0;this[_0x5b14('0x18')]=_0x5b14('0x14');this[_0x5b14('0x19')]=0x0;this[_0x5b14('0x1a')]=_0x15490e[_0x5b14('0x1a')]||0x0;this[_0x5b14('0x1b')]=0x0;this[_0x5b14('0x1c')]=_0x5b14('0x14');this[_0x5b14('0x1d')]=0x0;this[_0x5b14('0x1e')]=_0x15490e[_0x5b14('0x1e')]||0x0;this['smsCurrentCapacity']=0x0;this[_0x5b14('0x1f')]='unknown';this['whatsappStatusTime']=0x0;this['whatsappCapacity']=_0x15490e[_0x5b14('0x20')]||0x0;this[_0x5b14('0x21')]=0x0;this[_0x5b14('0x22')]=_0x5b14('0x14');this[_0x5b14('0x23')]=0x0;this[_0x5b14('0x24')]=_0x15490e[_0x5b14('0x24')]||0x0;this['openchannelCurrentCapacity']=0x0;this['busy']=![];this['busyQueue']=undefined;this[_0x5b14('0x0')]='';this[_0x5b14('0x25')]={};this[_0x5b14('0x26')]={};this[_0x5b14('0x27')]={};this['openchannelWaitingInteractions']={};this[_0x5b14('0x28')]={};this[_0x5b14('0x29')]={};this['updateRealtime']();}Agent[_0x5b14('0x2a')][_0x5b14('0x2b')]=function(_0x50951f){if(this[_0x50951f+_0x5b14('0x2c')]>0x0){if(this[_0x50951f+'Capacity']>0x0&&this[_0x50951f+'CurrentCapacity']>=this[_0x50951f+'Capacity']){return'maxcapacity';}else{return _0x5b14('0x2d');}}else{return _0x5b14('0x2e');}};Agent[_0x5b14('0x2a')]['updateRealtime']=function(){var _0x46f86a=[_0x5b14('0x2f'),_0x5b14('0x30'),_0x5b14('0x31'),_0x5b14('0x32'),_0x5b14('0x33'),_0x5b14('0x34')];for(var _0x205842=0x0;_0x205842<_0x46f86a[_0x5b14('0x35')];_0x205842+=0x1){var _0x4e9609=this[_0x5b14('0x2b')](_0x46f86a[_0x205842]);if(this[_0x46f86a[_0x205842]+_0x5b14('0x36')]!==_0x4e9609){this[_0x46f86a[_0x205842]+_0x5b14('0x37')]=_[_0x5b14('0x38')](moment()['format']('x'));}this[_0x46f86a[_0x205842]+_0x5b14('0x36')]=_0x4e9609;}var _0x18a76d={'id':this['id'],'name':this['name'],'online':this['online'],'voicePause':this[_0x5b14('0x9')],'chatPause':this[_0x5b14('0xa')],'mailPause':this['mailPause'],'smsPause':this['smsPause'],'faxPause':this[_0x5b14('0xc')],'openchannelPause':this['openchannelPause'],'chatStatus':this[_0x5b14('0xf')],'chatStatusTime':this[_0x5b14('0x10')],'chatCapacity':this['chatCapacity'],'chatCurrentCapacity':this['chatCurrentCapacity'],'mailStatus':this[_0x5b14('0x13')],'mailStatusTime':this[_0x5b14('0x15')],'mailCapacity':this[_0x5b14('0x16')],'mailCurrentCapacity':this['mailCurrentCapacity'],'faxStatus':this[_0x5b14('0x18')],'faxStatusTime':this['faxStatusTime'],'faxCapacity':this[_0x5b14('0x1a')],'faxCurrentCapacity':this[_0x5b14('0x1b')],'smsStatus':this[_0x5b14('0x1c')],'smsStatusTime':this[_0x5b14('0x1d')],'smsCapacity':this['smsCapacity'],'smsCurrentCapacity':this[_0x5b14('0x39')],'whatsappStatus':this[_0x5b14('0x1f')],'whatsappStatusTime':this[_0x5b14('0x3a')],'whatsappCapacity':this[_0x5b14('0x20')],'whatsappCurrentCapacity':this['whatsappCurrentCapacity'],'openchannelStatus':this[_0x5b14('0x22')],'openchannelStatusTime':this[_0x5b14('0x23')],'openchannelCapacity':this[_0x5b14('0x24')],'openchannelCurrentCapacity':this['openchannelCurrentCapacity'],'busy':this[_0x5b14('0x3b')],'busyQueue':this['busyQueue'],'chatWaitingInteractions':this[_0x5b14('0x25')],'faxWaitingInteractions':this[_0x5b14('0x26')],'mailWaitingInteractions':this['mailWaitingInteractions'],'openchannelWaitingInteractions':this[_0x5b14('0x3c')],'smsWaitingInteractions':this[_0x5b14('0x28')],'whatsappWaitingInteractions':this['whatsappWaitingInteractions']};var _0x32f097=md5(JSON['stringify'](_0x18a76d));if(this[_0x5b14('0x0')]!==_0x32f097){this[_0x5b14('0x0')]=_0x32f097;io[_0x5b14('0x3d')](_0x5b14('0x3e'),_['omit'](_0x18a76d,[_0x5b14('0x8')]));}};module[_0x5b14('0x3f')]=Agent; \ No newline at end of file +var _0xed1c=['whatsappStatus','whatsappCapacity','whatsappCurrentCapacity','openchannelStatus','openchannelStatusTime','openchannelCapacity','busy','busyQueue','faxWaitingInteractions','mailWaitingInteractions','openchannelWaitingInteractions','updateRealtime','prototype','getChannelStatus','CurrentCapacity','Capacity','idle','mail','chat','fax','sms','whatsapp','length','StatusTime','format','Status','chatCurrentCapacity','smsStatus','whatsappStatusTime','chatWaitingInteractions','smsWaitingInteractions','whatsappWaitingInteractions','stringify','emit','user:routing:update','exports','lodash','md5','defaults','redis','localhost','name','online','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','chatStatus','unknown','chatStatusTime','chatCapacity','mailStatus','mailStatusTime','mailCapacity','mailCurrentCapacity','faxStatus','faxStatusTime','faxCapacity','faxCurrentCapacity','smsStatusTime','smsCapacity','smsCurrentCapacity'];(function(_0x45f951,_0x2750c8){var _0x24756c=function(_0x31c931){while(--_0x31c931){_0x45f951['push'](_0x45f951['shift']());}};_0x24756c(++_0x2750c8);}(_0xed1c,0xe4));var _0xced1=function(_0x4f08da,_0x379e6d){_0x4f08da=_0x4f08da-0x0;var _0x3eaf15=_0xed1c[_0x4f08da];return _0x3eaf15;};'use strict';var _=require(_0xced1('0x0'));var md5=require(_0xced1('0x1'));var moment=require('moment');var Redis=require('ioredis');var config=require('../../../config/environment');config['redis']=_[_0xced1('0x2')](config[_0xced1('0x3')],{'host':_0xced1('0x4'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xced1('0x3')]));function Agent(_0x445160){this['id']=_0x445160['id']||0x0;this[_0xced1('0x5')]=_0x445160[_0xced1('0x5')]||'';this['online']=_0x445160[_0xced1('0x6')]||!![];this[_0xced1('0x7')]=_0x445160[_0xced1('0x7')]||![];this[_0xced1('0x8')]=_0x445160[_0xced1('0x8')]||![];this[_0xced1('0x9')]=_0x445160[_0xced1('0x9')]||![];this[_0xced1('0xa')]=_0x445160['faxPause']||![];this[_0xced1('0xb')]=_0x445160['smsPause']||![];this[_0xced1('0xc')]=_0x445160[_0xced1('0xc')]||![];this[_0xced1('0xd')]=_0xced1('0xe');this[_0xced1('0xf')]=0x0;this[_0xced1('0x10')]=_0x445160[_0xced1('0x10')]||0x0;this['chatCurrentCapacity']=0x0;this[_0xced1('0x11')]=_0xced1('0xe');this[_0xced1('0x12')]=0x0;this[_0xced1('0x13')]=_0x445160['mailCapacity']||0x0;this[_0xced1('0x14')]=0x0;this[_0xced1('0x15')]='unknown';this[_0xced1('0x16')]=0x0;this[_0xced1('0x17')]=_0x445160[_0xced1('0x17')]||0x0;this[_0xced1('0x18')]=0x0;this['smsStatus']='unknown';this[_0xced1('0x19')]=0x0;this[_0xced1('0x1a')]=_0x445160[_0xced1('0x1a')]||0x0;this[_0xced1('0x1b')]=0x0;this[_0xced1('0x1c')]=_0xced1('0xe');this['whatsappStatusTime']=0x0;this['whatsappCapacity']=_0x445160[_0xced1('0x1d')]||0x0;this[_0xced1('0x1e')]=0x0;this[_0xced1('0x1f')]='unknown';this[_0xced1('0x20')]=0x0;this[_0xced1('0x21')]=_0x445160[_0xced1('0x21')]||0x0;this['openchannelCurrentCapacity']=0x0;this[_0xced1('0x22')]=![];this[_0xced1('0x23')]=undefined;this[_0xced1('0x1')]='';this['chatWaitingInteractions']={};this[_0xced1('0x24')]={};this[_0xced1('0x25')]={};this[_0xced1('0x26')]={};this['smsWaitingInteractions']={};this['whatsappWaitingInteractions']={};this[_0xced1('0x27')]();}Agent[_0xced1('0x28')][_0xced1('0x29')]=function(_0x20dcb4){if(this[_0x20dcb4+_0xced1('0x2a')]>0x0){if(this[_0x20dcb4+'Capacity']>0x0&&this[_0x20dcb4+_0xced1('0x2a')]>=this[_0x20dcb4+_0xced1('0x2b')]){return'maxcapacity';}else{return'working';}}else{return _0xced1('0x2c');}};Agent[_0xced1('0x28')][_0xced1('0x27')]=function(){var _0x3912fe=[_0xced1('0x2d'),_0xced1('0x2e'),'openchannel',_0xced1('0x2f'),_0xced1('0x30'),_0xced1('0x31')];for(var _0x351afc=0x0;_0x351afc<_0x3912fe[_0xced1('0x32')];_0x351afc+=0x1){var _0x8b3ffb=this[_0xced1('0x29')](_0x3912fe[_0x351afc]);if(this[_0x3912fe[_0x351afc]+'Status']!==_0x8b3ffb){this[_0x3912fe[_0x351afc]+_0xced1('0x33')]=_['toNumber'](moment()[_0xced1('0x34')]('x'));}this[_0x3912fe[_0x351afc]+_0xced1('0x35')]=_0x8b3ffb;}var _0x6dc558={'id':this['id'],'name':this[_0xced1('0x5')],'online':this['online'],'voicePause':this['voicePause'],'chatPause':this[_0xced1('0x8')],'mailPause':this[_0xced1('0x9')],'smsPause':this[_0xced1('0xb')],'faxPause':this['faxPause'],'openchannelPause':this['openchannelPause'],'chatStatus':this['chatStatus'],'chatStatusTime':this[_0xced1('0xf')],'chatCapacity':this[_0xced1('0x10')],'chatCurrentCapacity':this[_0xced1('0x36')],'mailStatus':this[_0xced1('0x11')],'mailStatusTime':this['mailStatusTime'],'mailCapacity':this[_0xced1('0x13')],'mailCurrentCapacity':this[_0xced1('0x14')],'faxStatus':this[_0xced1('0x15')],'faxStatusTime':this[_0xced1('0x16')],'faxCapacity':this[_0xced1('0x17')],'faxCurrentCapacity':this[_0xced1('0x18')],'smsStatus':this[_0xced1('0x37')],'smsStatusTime':this['smsStatusTime'],'smsCapacity':this['smsCapacity'],'smsCurrentCapacity':this[_0xced1('0x1b')],'whatsappStatus':this[_0xced1('0x1c')],'whatsappStatusTime':this[_0xced1('0x38')],'whatsappCapacity':this[_0xced1('0x1d')],'whatsappCurrentCapacity':this[_0xced1('0x1e')],'openchannelStatus':this[_0xced1('0x1f')],'openchannelStatusTime':this['openchannelStatusTime'],'openchannelCapacity':this['openchannelCapacity'],'openchannelCurrentCapacity':this['openchannelCurrentCapacity'],'busy':this['busy'],'busyQueue':this[_0xced1('0x23')],'chatWaitingInteractions':this[_0xced1('0x39')],'faxWaitingInteractions':this[_0xced1('0x24')],'mailWaitingInteractions':this[_0xced1('0x25')],'openchannelWaitingInteractions':this[_0xced1('0x26')],'smsWaitingInteractions':this[_0xced1('0x3a')],'whatsappWaitingInteractions':this[_0xced1('0x3b')]};var _0x11205e=md5(JSON[_0xced1('0x3c')](_0x6dc558));if(this[_0xced1('0x1')]!==_0x11205e){this[_0xced1('0x1')]=_0x11205e;io[_0xced1('0x3d')](_0xced1('0x3e'),_['omit'](_0x6dc558,[_0xced1('0x6')]));}};module[_0xced1('0x3f')]=Agent; \ No newline at end of file diff --git a/server/services/routing/model/chatQueue.js b/server/services/routing/model/chatQueue.js index 83c882a..bd97e22 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 _0xad1d=['md5','updateRouting','updateRealtime','prototype','_rr','map','paused','length','online','available','loggedIn','format','chat:queue:%s','chat_queue:save','exports','lodash','util','ioredis','../../../config/environment','redis','defaults','socket.io-emitter','name','timeout','strategy','Agents','mapAgentsId'];(function(_0x48aee3,_0x4766f6){var _0x208a1b=function(_0x5cd4a2){while(--_0x5cd4a2){_0x48aee3['push'](_0x48aee3['shift']());}};_0x208a1b(++_0x4766f6);}(_0xad1d,0x96));var _0xdad1=function(_0x2d2c16,_0x4e88b6){_0x2d2c16=_0x2d2c16-0x0;var _0x53f2fb=_0xad1d[_0x2d2c16];return _0x53f2fb;};'use strict';var _=require(_0xdad1('0x0'));var md5=require('md5');var util=require(_0xdad1('0x1'));var Redis=require(_0xdad1('0x2'));var config=require(_0xdad1('0x3'));config[_0xdad1('0x4')]=_[_0xdad1('0x5')](config[_0xdad1('0x4')],{'host':'localhost','port':0x18eb});var io=require(_0xdad1('0x6'))(new Redis(config['redis']));function ChatQueue(_0x552bfc){this['id']=_0x552bfc['id']||0x0;this[_0xdad1('0x7')]=_0x552bfc[_0xdad1('0x7')]||'';this[_0xdad1('0x8')]=_0x552bfc[_0xdad1('0x8')]||0xa;this[_0xdad1('0x9')]=_0x552bfc['strategy']||'beepall';this[_0xdad1('0xa')]=_0x552bfc['Agents'];this[_0xdad1('0xb')]={};this['waiting']=0x0;this[_0xdad1('0xc')]='';this[_0xdad1('0xd')]();this[_0xdad1('0xe')]();}ChatQueue[_0xdad1('0xf')][_0xdad1('0xd')]=function(){var _0x34c273=this[_0xdad1('0xb')][_0xdad1('0x10')];this[_0xdad1('0xb')]=_[_0xdad1('0x11')](this[_0xdad1('0xa')],'id');this[_0xdad1('0xb')][_0xdad1('0x10')]=_0x34c273;};ChatQueue[_0xdad1('0xf')]['updateRealtime']=function(){this['loggedIn']=0x0;this[_0xdad1('0x12')]=0x0;for(var _0x545097=0x0;_0x545097=0x0?this['available']:0x0;var _0x20473e={'id':this['id'],'available':this[_0xdad1('0x15')],'loggedIn':this[_0xdad1('0x16')],'name':this[_0xdad1('0x7')],'paused':this['paused'],'waiting':this['waiting']};var _0x39aa04=md5(JSON['stringify'](_0x20473e));if(this[_0xdad1('0xc')]!==_0x39aa04){this['md5']=_0x39aa04;io['to'](util[_0xdad1('0x17')](_0xdad1('0x18'),_0x20473e[_0xdad1('0x7')]))['emit'](_0xdad1('0x19'),_0x20473e);}};module[_0xdad1('0x1a')]=ChatQueue; \ No newline at end of file +var _0x8fd3=['Agents','md5','prototype','updateRouting','mapAgentsId','_rr','updateRealtime','loggedIn','paused','online','chatPause','available','stringify','format','chat:queue:%s','emit','exports','lodash','util','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall'];(function(_0x466fa0,_0xfa0667){var _0x1ed882=function(_0x467630){while(--_0x467630){_0x466fa0['push'](_0x466fa0['shift']());}};_0x1ed882(++_0xfa0667);}(_0x8fd3,0x16d));var _0x38fd=function(_0x55232c,_0x5e5959){_0x55232c=_0x55232c-0x0;var _0x2eefbb=_0x8fd3[_0x55232c];return _0x2eefbb;};'use strict';var _=require(_0x38fd('0x0'));var md5=require('md5');var util=require(_0x38fd('0x1'));var Redis=require(_0x38fd('0x2'));var config=require(_0x38fd('0x3'));config[_0x38fd('0x4')]=_[_0x38fd('0x5')](config['redis'],{'host':_0x38fd('0x6'),'port':0x18eb});var io=require(_0x38fd('0x7'))(new Redis(config['redis']));function ChatQueue(_0x246a0f){this['id']=_0x246a0f['id']||0x0;this[_0x38fd('0x8')]=_0x246a0f[_0x38fd('0x8')]||'';this[_0x38fd('0x9')]=_0x246a0f['timeout']||0xa;this['strategy']=_0x246a0f[_0x38fd('0xa')]||_0x38fd('0xb');this['Agents']=_0x246a0f[_0x38fd('0xc')];this['mapAgentsId']={};this['waiting']=0x0;this[_0x38fd('0xd')]='';this['updateRouting']();this['updateRealtime']();}ChatQueue[_0x38fd('0xe')][_0x38fd('0xf')]=function(){var _0xd338bc=this[_0x38fd('0x10')][_0x38fd('0x11')];this[_0x38fd('0x10')]=_['map'](this[_0x38fd('0xc')],'id');this[_0x38fd('0x10')]['_rr']=_0xd338bc;};ChatQueue['prototype'][_0x38fd('0x12')]=function(){this[_0x38fd('0x13')]=0x0;this[_0x38fd('0x14')]=0x0;for(var _0x1abed6=0x0;_0x1abed6=0x0?this[_0x38fd('0x17')]:0x0;var _0x5c15e4={'id':this['id'],'available':this[_0x38fd('0x17')],'loggedIn':this[_0x38fd('0x13')],'name':this['name'],'paused':this[_0x38fd('0x14')],'waiting':this['waiting']};var _0x95dee3=md5(JSON[_0x38fd('0x18')](_0x5c15e4));if(this['md5']!==_0x95dee3){this[_0x38fd('0xd')]=_0x95dee3;io['to'](util[_0x38fd('0x19')](_0x38fd('0x1a'),_0x5c15e4['name']))[_0x38fd('0x1b')]('chat_queue:save',_0x5c15e4);}};module[_0x38fd('0x1c')]=ChatQueue; \ No newline at end of file diff --git a/server/services/routing/model/faxQueue.js b/server/services/routing/model/faxQueue.js index db9f3c3..f2c37a1 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 _0x2527=['defaults','socket.io-emitter','name','strategy','Agents','mapAgentsId','updateRouting','updateRealtime','prototype','_rr','map','loggedIn','length','faxPause','paused','available','waiting','stringify','fax:queue:%s','emit','fax_queue:save','exports','md5','util','ioredis','../../../config/environment','redis'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x2527,0x1c6));var _0x7252=function(_0x2448fb,_0x1b1009){_0x2448fb=_0x2448fb-0x0;var _0x4a287a=_0x2527[_0x2448fb];return _0x4a287a;};'use strict';var _=require('lodash');var md5=require(_0x7252('0x0'));var util=require(_0x7252('0x1'));var Redis=require(_0x7252('0x2'));var config=require(_0x7252('0x3'));config[_0x7252('0x4')]=_[_0x7252('0x5')](config[_0x7252('0x4')],{'host':'localhost','port':0x18eb});var io=require(_0x7252('0x6'))(new Redis(config[_0x7252('0x4')]));function FaxQueue(_0x5c0e38){this['id']=_0x5c0e38['id']||0x0;this[_0x7252('0x7')]=_0x5c0e38[_0x7252('0x7')]||'';this['timeout']=_0x5c0e38['timeout']||0xa;this[_0x7252('0x8')]=_0x5c0e38[_0x7252('0x8')]||'beepall';this[_0x7252('0x9')]=_0x5c0e38[_0x7252('0x9')];this[_0x7252('0xa')]={};this['waiting']=0x0;this[_0x7252('0x0')]='';this[_0x7252('0xb')]();this[_0x7252('0xc')]();}FaxQueue[_0x7252('0xd')][_0x7252('0xb')]=function(){var _0x439cbb=this[_0x7252('0xa')][_0x7252('0xe')];this['mapAgentsId']=_[_0x7252('0xf')](this[_0x7252('0x9')],'id');this[_0x7252('0xa')]['_rr']=_0x439cbb;};FaxQueue[_0x7252('0xd')]['updateRealtime']=function(){this[_0x7252('0x10')]=0x0;this['paused']=0x0;for(var _0x11c73e=0x0;_0x11c73e=0x0?this[_0x7252('0x14')]:0x0;var _0x503b04={'id':this['id'],'available':this[_0x7252('0x14')],'loggedIn':this[_0x7252('0x10')],'name':this[_0x7252('0x7')],'paused':this[_0x7252('0x13')],'waiting':this[_0x7252('0x15')]};var _0x5edf61=md5(JSON[_0x7252('0x16')](_0x503b04));if(this[_0x7252('0x0')]!==_0x5edf61){this[_0x7252('0x0')]=_0x5edf61;io['to'](util['format'](_0x7252('0x17'),_0x503b04[_0x7252('0x7')]))[_0x7252('0x18')](_0x7252('0x19'),_0x503b04);}};module[_0x7252('0x1a')]=FaxQueue; \ No newline at end of file +var _0xbbbb=['prototype','updateRouting','mapAgentsId','loggedIn','online','faxPause','available','paused','waiting','stringify','format','fax_queue:save','exports','lodash','md5','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xbbbb,0x1e1));var _0xbbbb=function(_0x2c763e,_0x4654de){_0x2c763e=_0x2c763e-0x0;var _0x53b5b8=_0xbbbb[_0x2c763e];return _0x53b5b8;};'use strict';var _=require(_0xbbbb('0x0'));var md5=require(_0xbbbb('0x1'));var util=require('util');var Redis=require(_0xbbbb('0x2'));var config=require(_0xbbbb('0x3'));config[_0xbbbb('0x4')]=_[_0xbbbb('0x5')](config[_0xbbbb('0x4')],{'host':_0xbbbb('0x6'),'port':0x18eb});var io=require(_0xbbbb('0x7'))(new Redis(config['redis']));function FaxQueue(_0x280ec7){this['id']=_0x280ec7['id']||0x0;this[_0xbbbb('0x8')]=_0x280ec7[_0xbbbb('0x8')]||'';this[_0xbbbb('0x9')]=_0x280ec7['timeout']||0xa;this[_0xbbbb('0xa')]=_0x280ec7[_0xbbbb('0xa')]||_0xbbbb('0xb');this[_0xbbbb('0xc')]=_0x280ec7[_0xbbbb('0xc')];this['mapAgentsId']={};this['waiting']=0x0;this[_0xbbbb('0x1')]='';this['updateRouting']();this['updateRealtime']();}FaxQueue[_0xbbbb('0xd')][_0xbbbb('0xe')]=function(){var _0x1162cc=this[_0xbbbb('0xf')]['_rr'];this[_0xbbbb('0xf')]=_['map'](this[_0xbbbb('0xc')],'id');this[_0xbbbb('0xf')]['_rr']=_0x1162cc;};FaxQueue['prototype']['updateRealtime']=function(){this[_0xbbbb('0x10')]=0x0;this['paused']=0x0;for(var _0x1df53f=0x0;_0x1df53f=0x0?this[_0xbbbb('0x13')]:0x0;var _0xf8fbfc={'id':this['id'],'available':this[_0xbbbb('0x13')],'loggedIn':this['loggedIn'],'name':this[_0xbbbb('0x8')],'paused':this['paused'],'waiting':this[_0xbbbb('0x15')]};var _0x5a9c57=md5(JSON[_0xbbbb('0x16')](_0xf8fbfc));if(this[_0xbbbb('0x1')]!==_0x5a9c57){this[_0xbbbb('0x1')]=_0x5a9c57;io['to'](util[_0xbbbb('0x17')]('fax:queue:%s',_0xf8fbfc[_0xbbbb('0x8')]))['emit'](_0xbbbb('0x18'),_0xf8fbfc);}};module[_0xbbbb('0x19')]=FaxQueue; \ No newline at end of file diff --git a/server/services/routing/model/interval.js b/server/services/routing/model/interval.js index 7ff2f6d..c6da8c8 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 _0x4fab=['name','Intervals','exports'];(function(_0x57784b,_0x49a858){var _0x4505fa=function(_0x14f13c){while(--_0x14f13c){_0x57784b['push'](_0x57784b['shift']());}};_0x4505fa(++_0x49a858);}(_0x4fab,0xbd));var _0xb4fa=function(_0x37816e,_0x23bd2e){_0x37816e=_0x37816e-0x0;var _0x439421=_0x4fab[_0x37816e];return _0x439421;};'use strict';function Interval(_0x2c10ef){this['id']=_0x2c10ef['id']||0x0;this['name']=_0x2c10ef[_0xb4fa('0x0')]||'';this[_0xb4fa('0x1')]=_0x2c10ef[_0xb4fa('0x1')]||{};}module[_0xb4fa('0x2')]=Interval; \ No newline at end of file +var _0xb53e=['exports','name','Intervals'];(function(_0x1092d7,_0x26fcc5){var _0x239164=function(_0x1edba5){while(--_0x1edba5){_0x1092d7['push'](_0x1092d7['shift']());}};_0x239164(++_0x26fcc5);}(_0xb53e,0x10f));var _0xeb53=function(_0x46b1d2,_0x12942c){_0x46b1d2=_0x46b1d2-0x0;var _0xe2d9bf=_0xb53e[_0x46b1d2];return _0xe2d9bf;};'use strict';function Interval(_0x5c70e5){this['id']=_0x5c70e5['id']||0x0;this['name']=_0x5c70e5[_0xeb53('0x0')]||'';this[_0xeb53('0x1')]=_0x5c70e5[_0xeb53('0x1')]||{};}module[_0xeb53('0x2')]=Interval; \ No newline at end of file diff --git a/server/services/routing/model/mailQueue.js b/server/services/routing/model/mailQueue.js index 7bb4f0b..76f82f3 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 _0x9b70=['available','paused','stringify','format','mail:queue:%s','emit','mail_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','Agents','waiting','updateRouting','prototype','mapAgentsId','_rr','updateRealtime','length','online','loggedIn','mailPause'];(function(_0x30f07e,_0x43bf35){var _0x10a577=function(_0x39cd01){while(--_0x39cd01){_0x30f07e['push'](_0x30f07e['shift']());}};_0x10a577(++_0x43bf35);}(_0x9b70,0x13e));var _0x09b7=function(_0x547587,_0x48cbd9){_0x547587=_0x547587-0x0;var _0x3d7777=_0x9b70[_0x547587];return _0x3d7777;};'use strict';var _=require(_0x09b7('0x0'));var md5=require(_0x09b7('0x1'));var util=require(_0x09b7('0x2'));var Redis=require(_0x09b7('0x3'));var config=require(_0x09b7('0x4'));config[_0x09b7('0x5')]=_[_0x09b7('0x6')](config[_0x09b7('0x5')],{'host':_0x09b7('0x7'),'port':0x18eb});var io=require(_0x09b7('0x8'))(new Redis(config['redis']));function MailQueue(_0x1e4e87){this['id']=_0x1e4e87['id']||0x0;this[_0x09b7('0x9')]=_0x1e4e87[_0x09b7('0x9')]||'';this[_0x09b7('0xa')]=_0x1e4e87[_0x09b7('0xa')]||0xa;this['strategy']=_0x1e4e87[_0x09b7('0xb')]||'beepall';this[_0x09b7('0xc')]=_0x1e4e87[_0x09b7('0xc')];this['mapAgentsId']={};this[_0x09b7('0xd')]=0x0;this['md5']='';this[_0x09b7('0xe')]();this['updateRealtime']();}MailQueue[_0x09b7('0xf')][_0x09b7('0xe')]=function(){var _0xb2dccf=this[_0x09b7('0x10')][_0x09b7('0x11')];this[_0x09b7('0x10')]=_['map'](this[_0x09b7('0xc')],'id');this[_0x09b7('0x10')]['_rr']=_0xb2dccf;};MailQueue[_0x09b7('0xf')][_0x09b7('0x12')]=function(){this['loggedIn']=0x0;this['paused']=0x0;for(var _0x45e180=0x0;_0x45e180=0x0?this['available']:0x0;var _0x5ed4bc={'id':this['id'],'available':this[_0x09b7('0x17')],'loggedIn':this[_0x09b7('0x15')],'name':this[_0x09b7('0x9')],'paused':this[_0x09b7('0x18')],'waiting':this[_0x09b7('0xd')]};var _0x59a1ff=md5(JSON[_0x09b7('0x19')](_0x5ed4bc));if(this[_0x09b7('0x1')]!==_0x59a1ff){this['md5']=_0x59a1ff;io['to'](util[_0x09b7('0x1a')](_0x09b7('0x1b'),_0x5ed4bc[_0x09b7('0x9')]))[_0x09b7('0x1c')](_0x09b7('0x1d'),_0x5ed4bc);}};module[_0x09b7('0x1e')]=MailQueue; \ No newline at end of file +var _0xa5ae=['localhost','socket.io-emitter','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','_rr','map','loggedIn','length','mailPause','paused','available','name','stringify','format','mail_queue:save','exports','md5','util','ioredis','../../../config/environment','redis','defaults'];(function(_0x4cb150,_0x2f2677){var _0x262be0=function(_0x225752){while(--_0x225752){_0x4cb150['push'](_0x4cb150['shift']());}};_0x262be0(++_0x2f2677);}(_0xa5ae,0x66));var _0xea5a=function(_0x417234,_0x28ac37){_0x417234=_0x417234-0x0;var _0x33f3b8=_0xa5ae[_0x417234];return _0x33f3b8;};'use strict';var _=require('lodash');var md5=require(_0xea5a('0x0'));var util=require(_0xea5a('0x1'));var Redis=require(_0xea5a('0x2'));var config=require(_0xea5a('0x3'));config[_0xea5a('0x4')]=_[_0xea5a('0x5')](config[_0xea5a('0x4')],{'host':_0xea5a('0x6'),'port':0x18eb});var io=require(_0xea5a('0x7'))(new Redis(config[_0xea5a('0x4')]));function MailQueue(_0x1acb82){this['id']=_0x1acb82['id']||0x0;this['name']=_0x1acb82['name']||'';this[_0xea5a('0x8')]=_0x1acb82[_0xea5a('0x8')]||0xa;this[_0xea5a('0x9')]=_0x1acb82['strategy']||_0xea5a('0xa');this[_0xea5a('0xb')]=_0x1acb82[_0xea5a('0xb')];this[_0xea5a('0xc')]={};this[_0xea5a('0xd')]=0x0;this[_0xea5a('0x0')]='';this[_0xea5a('0xe')]();this['updateRealtime']();}MailQueue['prototype']['updateRouting']=function(){var _0x14c363=this[_0xea5a('0xc')][_0xea5a('0xf')];this[_0xea5a('0xc')]=_[_0xea5a('0x10')](this[_0xea5a('0xb')],'id');this[_0xea5a('0xc')][_0xea5a('0xf')]=_0x14c363;};MailQueue['prototype']['updateRealtime']=function(){this[_0xea5a('0x11')]=0x0;this['paused']=0x0;for(var _0x386988=0x0;_0x386988=0x0?this['available']:0x0;var _0x22b865={'id':this['id'],'available':this[_0xea5a('0x15')],'loggedIn':this[_0xea5a('0x11')],'name':this[_0xea5a('0x16')],'paused':this[_0xea5a('0x14')],'waiting':this[_0xea5a('0xd')]};var _0x4f358d=md5(JSON[_0xea5a('0x17')](_0x22b865));if(this[_0xea5a('0x0')]!==_0x4f358d){this[_0xea5a('0x0')]=_0x4f358d;io['to'](util[_0xea5a('0x18')]('mail:queue:%s',_0x22b865[_0xea5a('0x16')]))['emit'](_0xea5a('0x19'),_0x22b865);}};module[_0xea5a('0x1a')]=MailQueue; \ No newline at end of file diff --git a/server/services/routing/model/openchannelQueue.js b/server/services/routing/model/openchannelQueue.js index e0594ed..59d731d 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 _0x1261=['available','stringify','openchannel:queue:%s','openchannel_queue:save','exports','md5','util','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','waiting','updateRouting','prototype','mapAgentsId','map','_rr','updateRealtime','loggedIn','paused','length','online'];(function(_0x4d180c,_0x45c68e){var _0x49b57e=function(_0x264741){while(--_0x264741){_0x4d180c['push'](_0x4d180c['shift']());}};_0x49b57e(++_0x45c68e);}(_0x1261,0x144));var _0x1126=function(_0x47c6b9,_0x210b3c){_0x47c6b9=_0x47c6b9-0x0;var _0x34f34d=_0x1261[_0x47c6b9];return _0x34f34d;};'use strict';var _=require('lodash');var md5=require(_0x1126('0x0'));var util=require(_0x1126('0x1'));var Redis=require(_0x1126('0x2'));var config=require(_0x1126('0x3'));config[_0x1126('0x4')]=_[_0x1126('0x5')](config[_0x1126('0x4')],{'host':_0x1126('0x6'),'port':0x18eb});var io=require(_0x1126('0x7'))(new Redis(config[_0x1126('0x4')]));function OpenchannelQueue(_0x5a2189){this['id']=_0x5a2189['id']||0x0;this['name']=_0x5a2189[_0x1126('0x8')]||'';this[_0x1126('0x9')]=_0x5a2189['timeout']||0xa;this[_0x1126('0xa')]=_0x5a2189[_0x1126('0xa')]||_0x1126('0xb');this[_0x1126('0xc')]=_0x5a2189[_0x1126('0xc')];this['mapAgentsId']={};this[_0x1126('0xd')]=0x0;this[_0x1126('0x0')]='';this[_0x1126('0xe')]();this['updateRealtime']();}OpenchannelQueue[_0x1126('0xf')]['updateRouting']=function(){var _0x52ef15=this[_0x1126('0x10')]['_rr'];this[_0x1126('0x10')]=_[_0x1126('0x11')](this[_0x1126('0xc')],'id');this[_0x1126('0x10')][_0x1126('0x12')]=_0x52ef15;};OpenchannelQueue[_0x1126('0xf')][_0x1126('0x13')]=function(){this[_0x1126('0x14')]=0x0;this[_0x1126('0x15')]=0x0;for(var _0x53a8f0=0x0;_0x53a8f0=0x0?this['available']:0x0;var _0x4d2b38={'id':this['id'],'available':this[_0x1126('0x18')],'loggedIn':this[_0x1126('0x14')],'name':this['name'],'paused':this['paused'],'waiting':this[_0x1126('0xd')]};var _0x58b109=md5(JSON[_0x1126('0x19')](_0x4d2b38));if(this[_0x1126('0x0')]!==_0x58b109){this[_0x1126('0x0')]=_0x58b109;io['to'](util['format'](_0x1126('0x1a'),_0x4d2b38['name']))['emit'](_0x1126('0x1b'),_0x4d2b38);}};module[_0x1126('0x1c')]=OpenchannelQueue; \ No newline at end of file +var _0x814b=['prototype','map','_rr','loggedIn','paused','length','online','openchannelPause','available','format','openchannel_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime'];(function(_0x243c39,_0x13b85f){var _0x21da74=function(_0x26c63c){while(--_0x26c63c){_0x243c39['push'](_0x243c39['shift']());}};_0x21da74(++_0x13b85f);}(_0x814b,0x1a2));var _0xb814=function(_0x4b1012,_0x1415eb){_0x4b1012=_0x4b1012-0x0;var _0x23d715=_0x814b[_0x4b1012];return _0x23d715;};'use strict';var _=require(_0xb814('0x0'));var md5=require(_0xb814('0x1'));var util=require(_0xb814('0x2'));var Redis=require(_0xb814('0x3'));var config=require(_0xb814('0x4'));config[_0xb814('0x5')]=_['defaults'](config[_0xb814('0x5')],{'host':_0xb814('0x6'),'port':0x18eb});var io=require(_0xb814('0x7'))(new Redis(config[_0xb814('0x5')]));function OpenchannelQueue(_0x44931c){this['id']=_0x44931c['id']||0x0;this[_0xb814('0x8')]=_0x44931c['name']||'';this[_0xb814('0x9')]=_0x44931c[_0xb814('0x9')]||0xa;this['strategy']=_0x44931c[_0xb814('0xa')]||_0xb814('0xb');this[_0xb814('0xc')]=_0x44931c[_0xb814('0xc')];this[_0xb814('0xd')]={};this[_0xb814('0xe')]=0x0;this[_0xb814('0x1')]='';this[_0xb814('0xf')]();this[_0xb814('0x10')]();}OpenchannelQueue[_0xb814('0x11')][_0xb814('0xf')]=function(){var _0x4b5f14=this[_0xb814('0xd')]['_rr'];this[_0xb814('0xd')]=_[_0xb814('0x12')](this[_0xb814('0xc')],'id');this[_0xb814('0xd')][_0xb814('0x13')]=_0x4b5f14;};OpenchannelQueue[_0xb814('0x11')][_0xb814('0x10')]=function(){this[_0xb814('0x14')]=0x0;this[_0xb814('0x15')]=0x0;for(var _0x2ab627=0x0;_0x2ab627=0x0?this['available']:0x0;var _0x270598={'id':this['id'],'available':this[_0xb814('0x19')],'loggedIn':this['loggedIn'],'name':this['name'],'paused':this['paused'],'waiting':this[_0xb814('0xe')]};var _0x4d5276=md5(JSON['stringify'](_0x270598));if(this[_0xb814('0x1')]!==_0x4d5276){this[_0xb814('0x1')]=_0x4d5276;io['to'](util[_0xb814('0x1a')]('openchannel:queue:%s',_0x270598[_0xb814('0x8')]))['emit'](_0xb814('0x1b'),_0x270598);}};module[_0xb814('0x1c')]=OpenchannelQueue; \ No newline at end of file diff --git a/server/services/routing/model/smsQueue.js b/server/services/routing/model/smsQueue.js index 3e2b26e..e3b04f1 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 _0x3140=['length','online','loggedIn','available','format','sms:queue:%s','emit','lodash','md5','util','ioredis','defaults','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','waiting','updateRouting','updateRealtime','prototype','mapAgentsId','map','_rr','paused'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3140,0xaf));var _0x0314=function(_0x1ef4ee,_0xd87a11){_0x1ef4ee=_0x1ef4ee-0x0;var _0xabf86f=_0x3140[_0x1ef4ee];return _0xabf86f;};'use strict';var _=require(_0x0314('0x0'));var md5=require(_0x0314('0x1'));var util=require(_0x0314('0x2'));var Redis=require(_0x0314('0x3'));var config=require('../../../config/environment');config['redis']=_[_0x0314('0x4')](config[_0x0314('0x5')],{'host':_0x0314('0x6'),'port':0x18eb});var io=require(_0x0314('0x7'))(new Redis(config[_0x0314('0x5')]));function SmsQueue(_0x46c395){this['id']=_0x46c395['id']||0x0;this[_0x0314('0x8')]=_0x46c395[_0x0314('0x8')]||'';this[_0x0314('0x9')]=_0x46c395[_0x0314('0x9')]||0xa;this[_0x0314('0xa')]=_0x46c395['strategy']||_0x0314('0xb');this[_0x0314('0xc')]=_0x46c395['Agents'];this['mapAgentsId']={};this[_0x0314('0xd')]=0x0;this['md5']='';this[_0x0314('0xe')]();this[_0x0314('0xf')]();}SmsQueue[_0x0314('0x10')][_0x0314('0xe')]=function(){var _0x375416=this[_0x0314('0x11')]['_rr'];this[_0x0314('0x11')]=_[_0x0314('0x12')](this[_0x0314('0xc')],'id');this[_0x0314('0x11')][_0x0314('0x13')]=_0x375416;};SmsQueue[_0x0314('0x10')][_0x0314('0xf')]=function(){this['loggedIn']=0x0;this[_0x0314('0x14')]=0x0;for(var _0xbe0b07=0x0;_0xbe0b07=0x0?this['available']:0x0;var _0x39db0b={'id':this['id'],'available':this[_0x0314('0x18')],'loggedIn':this['loggedIn'],'name':this[_0x0314('0x8')],'paused':this[_0x0314('0x14')],'waiting':this['waiting']};var _0x1a25cf=md5(JSON['stringify'](_0x39db0b));if(this[_0x0314('0x1')]!==_0x1a25cf){this[_0x0314('0x1')]=_0x1a25cf;io['to'](util[_0x0314('0x19')](_0x0314('0x1a'),_0x39db0b[_0x0314('0x8')]))[_0x0314('0x1b')]('sms_queue:save',_0x39db0b);}};module['exports']=SmsQueue; \ No newline at end of file +var _0x07c3=['updateRouting','loggedIn','paused','length','online','smsPause','available','stringify','format','sms:queue:%s','emit','sms_queue:save','lodash','md5','util','ioredis','../../../config/environment','redis','defaults','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRealtime','prototype'];(function(_0x559bee,_0x350f0c){var _0x349496=function(_0x114459){while(--_0x114459){_0x559bee['push'](_0x559bee['shift']());}};_0x349496(++_0x350f0c);}(_0x07c3,0x1bf));var _0x307c=function(_0x309458,_0xba6e63){_0x309458=_0x309458-0x0;var _0x3306ee=_0x07c3[_0x309458];return _0x3306ee;};'use strict';var _=require(_0x307c('0x0'));var md5=require(_0x307c('0x1'));var util=require(_0x307c('0x2'));var Redis=require(_0x307c('0x3'));var config=require(_0x307c('0x4'));config[_0x307c('0x5')]=_[_0x307c('0x6')](config[_0x307c('0x5')],{'host':'localhost','port':0x18eb});var io=require(_0x307c('0x7'))(new Redis(config[_0x307c('0x5')]));function SmsQueue(_0x27515b){this['id']=_0x27515b['id']||0x0;this[_0x307c('0x8')]=_0x27515b[_0x307c('0x8')]||'';this[_0x307c('0x9')]=_0x27515b[_0x307c('0x9')]||0xa;this[_0x307c('0xa')]=_0x27515b[_0x307c('0xa')]||_0x307c('0xb');this[_0x307c('0xc')]=_0x27515b[_0x307c('0xc')];this[_0x307c('0xd')]={};this[_0x307c('0xe')]=0x0;this[_0x307c('0x1')]='';this['updateRouting']();this[_0x307c('0xf')]();}SmsQueue[_0x307c('0x10')][_0x307c('0x11')]=function(){var _0x2af63f=this['mapAgentsId']['_rr'];this[_0x307c('0xd')]=_['map'](this[_0x307c('0xc')],'id');this[_0x307c('0xd')]['_rr']=_0x2af63f;};SmsQueue[_0x307c('0x10')][_0x307c('0xf')]=function(){this[_0x307c('0x12')]=0x0;this[_0x307c('0x13')]=0x0;for(var _0x4193d8=0x0;_0x4193d8=0x0?this[_0x307c('0x17')]:0x0;var _0x3e05e2={'id':this['id'],'available':this[_0x307c('0x17')],'loggedIn':this[_0x307c('0x12')],'name':this['name'],'paused':this['paused'],'waiting':this[_0x307c('0xe')]};var _0x4aa3c8=md5(JSON[_0x307c('0x18')](_0x3e05e2));if(this['md5']!==_0x4aa3c8){this['md5']=_0x4aa3c8;io['to'](util[_0x307c('0x19')](_0x307c('0x1a'),_0x3e05e2['name']))[_0x307c('0x1b')](_0x307c('0x1c'),_0x3e05e2);}};module['exports']=SmsQueue; \ No newline at end of file diff --git a/server/services/routing/model/whatsappQueue.js b/server/services/routing/model/whatsappQueue.js index c4035be..188da61 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 _0x60d2=['name','timeout','strategy','Agents','mapAgentsId','updateRouting','updateRealtime','_rr','prototype','loggedIn','paused','length','available','whatsapp:queue:%s','emit','whatsapp_queue:save','exports','md5','ioredis','../../../config/environment','redis','localhost','socket.io-emitter'];(function(_0x2fb356,_0x567092){var _0x27fb4b=function(_0x11c996){while(--_0x11c996){_0x2fb356['push'](_0x2fb356['shift']());}};_0x27fb4b(++_0x567092);}(_0x60d2,0x84));var _0x260d=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x60d2[_0x40a045];return _0x1a687c;};'use strict';var _=require('lodash');var md5=require(_0x260d('0x0'));var util=require('util');var Redis=require(_0x260d('0x1'));var config=require(_0x260d('0x2'));config[_0x260d('0x3')]=_['defaults'](config[_0x260d('0x3')],{'host':_0x260d('0x4'),'port':0x18eb});var io=require(_0x260d('0x5'))(new Redis(config[_0x260d('0x3')]));function WhatsappQueue(_0x451ca1){this['id']=_0x451ca1['id']||0x0;this[_0x260d('0x6')]=_0x451ca1['name']||'';this[_0x260d('0x7')]=_0x451ca1[_0x260d('0x7')]||0xa;this[_0x260d('0x8')]=_0x451ca1[_0x260d('0x8')]||'beepall';this[_0x260d('0x9')]=_0x451ca1[_0x260d('0x9')];this[_0x260d('0xa')]={};this['waiting']=0x0;this[_0x260d('0x0')]='';this[_0x260d('0xb')]();this[_0x260d('0xc')]();}WhatsappQueue['prototype'][_0x260d('0xb')]=function(){var _0x52b4b2=this[_0x260d('0xa')][_0x260d('0xd')];this['mapAgentsId']=_['map'](this[_0x260d('0x9')],'id');this[_0x260d('0xa')][_0x260d('0xd')]=_0x52b4b2;};WhatsappQueue[_0x260d('0xe')][_0x260d('0xc')]=function(){this[_0x260d('0xf')]=0x0;this[_0x260d('0x10')]=0x0;for(var _0x400c67=0x0;_0x400c67=0x0?this[_0x260d('0x12')]:0x0;var _0x18e2a5={'id':this['id'],'available':this[_0x260d('0x12')],'loggedIn':this[_0x260d('0xf')],'name':this[_0x260d('0x6')],'paused':this[_0x260d('0x10')],'waiting':this['waiting']};var _0x55d98d=md5(JSON['stringify'](_0x18e2a5));if(this[_0x260d('0x0')]!==_0x55d98d){this[_0x260d('0x0')]=_0x55d98d;io['to'](util['format'](_0x260d('0x13'),_0x18e2a5[_0x260d('0x6')]))[_0x260d('0x14')](_0x260d('0x15'),_0x18e2a5);}};module[_0x260d('0x16')]=WhatsappQueue; \ No newline at end of file +var _0x5c93=['waiting','updateRealtime','updateRouting','map','prototype','paused','length','online','loggedIn','whatsappPause','available','stringify','format','emit','whatsapp_queue:save','lodash','md5','ioredis','../../../config/environment','redis','defaults','localhost','name','timeout','strategy','Agents','mapAgentsId'];(function(_0x1a1dd7,_0x9e586a){var _0x5e5ac6=function(_0x6b7c37){while(--_0x6b7c37){_0x1a1dd7['push'](_0x1a1dd7['shift']());}};_0x5e5ac6(++_0x9e586a);}(_0x5c93,0x1bf));var _0x35c9=function(_0x580576,_0x2f107d){_0x580576=_0x580576-0x0;var _0x3f55a0=_0x5c93[_0x580576];return _0x3f55a0;};'use strict';var _=require(_0x35c9('0x0'));var md5=require(_0x35c9('0x1'));var util=require('util');var Redis=require(_0x35c9('0x2'));var config=require(_0x35c9('0x3'));config[_0x35c9('0x4')]=_[_0x35c9('0x5')](config['redis'],{'host':_0x35c9('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function WhatsappQueue(_0x8c9e2c){this['id']=_0x8c9e2c['id']||0x0;this[_0x35c9('0x7')]=_0x8c9e2c[_0x35c9('0x7')]||'';this[_0x35c9('0x8')]=_0x8c9e2c['timeout']||0xa;this[_0x35c9('0x9')]=_0x8c9e2c[_0x35c9('0x9')]||'beepall';this[_0x35c9('0xa')]=_0x8c9e2c[_0x35c9('0xa')];this[_0x35c9('0xb')]={};this[_0x35c9('0xc')]=0x0;this[_0x35c9('0x1')]='';this['updateRouting']();this[_0x35c9('0xd')]();}WhatsappQueue['prototype'][_0x35c9('0xe')]=function(){var _0x11fd36=this['mapAgentsId']['_rr'];this[_0x35c9('0xb')]=_[_0x35c9('0xf')](this[_0x35c9('0xa')],'id');this[_0x35c9('0xb')]['_rr']=_0x11fd36;};WhatsappQueue[_0x35c9('0x10')]['updateRealtime']=function(){this['loggedIn']=0x0;this[_0x35c9('0x11')]=0x0;for(var _0xf0ead6=0x0;_0xf0ead6=0x0?this[_0x35c9('0x16')]:0x0;var _0x320aca={'id':this['id'],'available':this['available'],'loggedIn':this['loggedIn'],'name':this['name'],'paused':this[_0x35c9('0x11')],'waiting':this['waiting']};var _0x48f7e9=md5(JSON[_0x35c9('0x17')](_0x320aca));if(this[_0x35c9('0x1')]!==_0x48f7e9){this[_0x35c9('0x1')]=_0x48f7e9;io['to'](util[_0x35c9('0x18')]('whatsapp:queue:%s',_0x320aca[_0x35c9('0x7')]))[_0x35c9('0x19')](_0x35c9('0x1a'),_0x320aca);}};module['exports']=WhatsappQueue; \ No newline at end of file diff --git a/server/services/routing/realtime/index.js b/server/services/routing/realtime/index.js index 86521d2..e69b734 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(_0x25bea7,_0x49ab45){_0x25bea7=_0x25bea7-0x0;var _0x175952=_0xa9e0[_0x25bea7];return _0x175952;};'use strict';var BPromise=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var moment=require('moment');var Agent=require('../model/agent');var Interval=require(_0x0a9e('0x3'));var OpenchannelQueue=require('../model/openchannelQueue');var ChatQueue=require(_0x0a9e('0x4'));var SmsQueue=require(_0x0a9e('0x5'));var MailQueue=require(_0x0a9e('0x6'));var FaxQueue=require(_0x0a9e('0x7'));var WhatsappQueue=require(_0x0a9e('0x8'));var Realtime=function(){this['agents']={};this[_0x0a9e('0x9')]={};this[_0x0a9e('0xa')]={};this[_0x0a9e('0xb')]={};this['smsQueues']={};this['mailQueues']={};this[_0x0a9e('0xc')]={};this['whatsappQueues']={};this['chatQueuesWaitingInteractions']={};this[_0x0a9e('0xd')]={};this[_0x0a9e('0xe')]={};this[_0x0a9e('0xf')]={};this[_0x0a9e('0x10')]={};this[_0x0a9e('0x11')]={};};function freeIsNotKey(_0xbd1168,_0x4a4c56,_0x50dfb2){var _0x527cdd=_['mapKeys'](_0xbd1168,function(_0x273d4d,_0x36471c){return _0x273d4d[_0x50dfb2];});for(var _0xd5b662 in _0x4a4c56){if(_0x4a4c56[_0x0a9e('0x12')](_0xd5b662)){if(!_0x527cdd[_0xd5b662]){delete _0x4a4c56[_0xd5b662];}}}}Realtime[_0x0a9e('0x13')][_0x0a9e('0x14')]=function(_0x5db4b0,_0x4283ce){for(var _0x239b12 in _0x4283ce){if(_0x5db4b0[_0x0a9e('0x12')](_0x239b12)){_0x5db4b0[_0x239b12]=_0x4283ce[_0x239b12];}}};Realtime[_0x0a9e('0x13')][_0x0a9e('0x15')]=function(){var _0x4d5611=this;return function(_0x52a03d){if(_0x52a03d){freeIsNotKey(_0x52a03d,_0x4d5611[_0x0a9e('0x16')],'id');for(var _0x5d0880=0x0,_0x1985b6={},_0x519dfd={};_0x5d0880<_0x52a03d[_0x0a9e('0x17')];_0x5d0880+=0x1){_0x1985b6=_0x52a03d[_0x5d0880];if(_[_0x0a9e('0x18')](_0x4d5611['agents'][_0x1985b6['id']])){_0x4d5611[_0x0a9e('0x16')][_0x1985b6['id']]=new Agent(_0x1985b6);}else{_0x4d5611['mergeFromDatabase'](_0x4d5611[_0x0a9e('0x16')][_0x1985b6['id']],_0x1985b6);}}}return _0x4d5611[_0x0a9e('0x16')];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x19')]=function(){var _0x31b1ca=this;return function(_0x2eb11f){if(_0x2eb11f){freeIsNotKey(_0x2eb11f,_0x31b1ca[_0x0a9e('0x9')],'id');for(var _0x20559e=0x0,_0x1314ae={},_0x112016={};_0x20559e<_0x2eb11f[_0x0a9e('0x17')];_0x20559e+=0x1){_0x1314ae=_0x2eb11f[_0x20559e];if(_[_0x0a9e('0x18')](_0x31b1ca['intervals'][_0x1314ae['id']])){_0x31b1ca[_0x0a9e('0x9')][_0x1314ae['id']]=new Interval(_0x1314ae);}else{_0x31b1ca[_0x0a9e('0x14')](_0x31b1ca['intervals'][_0x1314ae['id']],_0x1314ae);}}}return _0x31b1ca[_0x0a9e('0x9')];};};Realtime['prototype']['initOpenchannelQueues']=function(){var _0x3a02e1=this;return function(_0x432e56){if(_0x432e56){freeIsNotKey(_0x432e56,_0x3a02e1[_0x0a9e('0xa')],'id');for(var _0x30bae6=0x0,_0x4abc77={},_0xfb6e48={};_0x30bae6<_0x432e56[_0x0a9e('0x17')];_0x30bae6+=0x1){_0x4abc77=_0x432e56[_0x30bae6];if(_[_0x0a9e('0x18')](_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']])){_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']]=new OpenchannelQueue(_0x4abc77);}else{_0x3a02e1[_0x0a9e('0x14')](_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']],_0x4abc77);}_0x3a02e1['openchannelQueues'][_0x4abc77['id']]['updateRouting']();_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']][_0x0a9e('0x1a')]();}}return _0x3a02e1[_0x0a9e('0xa')];};};Realtime[_0x0a9e('0x13')]['initChatQueues']=function(){var _0x384319=this;return function(_0x479bc4){if(_0x479bc4){freeIsNotKey(_0x479bc4,_0x384319[_0x0a9e('0xb')],'id');for(var _0x5bfb33=0x0,_0x1dc186={},_0x34dc65={};_0x5bfb33<_0x479bc4[_0x0a9e('0x17')];_0x5bfb33+=0x1){_0x1dc186=_0x479bc4[_0x5bfb33];if(_[_0x0a9e('0x18')](_0x384319[_0x0a9e('0xb')][_0x1dc186['id']])){_0x384319[_0x0a9e('0xb')][_0x1dc186['id']]=new ChatQueue(_0x1dc186);}else{_0x384319[_0x0a9e('0x14')](_0x384319[_0x0a9e('0xb')][_0x1dc186['id']],_0x1dc186);}_0x384319['chatQueues'][_0x1dc186['id']][_0x0a9e('0x1b')]();_0x384319[_0x0a9e('0xb')][_0x1dc186['id']][_0x0a9e('0x1a')]();}}return _0x384319[_0x0a9e('0xb')];};};Realtime['prototype'][_0x0a9e('0x1c')]=function(){var _0x40e7a3=this;return function(_0x1843b2){if(_0x1843b2){freeIsNotKey(_0x1843b2,_0x40e7a3[_0x0a9e('0x1d')],'id');for(var _0x58b06f=0x0,_0x563b45={},_0x296f41={};_0x58b06f<_0x1843b2[_0x0a9e('0x17')];_0x58b06f+=0x1){_0x563b45=_0x1843b2[_0x58b06f];if(_[_0x0a9e('0x18')](_0x40e7a3['smsQueues'][_0x563b45['id']])){_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']]=new SmsQueue(_0x563b45);}else{_0x40e7a3['mergeFromDatabase'](_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']],_0x563b45);}_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']][_0x0a9e('0x1b')]();_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']][_0x0a9e('0x1a')]();}}return _0x40e7a3['smsQueues'];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x1e')]=function(){var _0x40cb85=this;return function(_0x2da5c0){if(_0x2da5c0){freeIsNotKey(_0x2da5c0,_0x40cb85[_0x0a9e('0x1f')],'id');for(var _0x409319=0x0,_0x332d35={},_0x39e565={};_0x409319<_0x2da5c0['length'];_0x409319+=0x1){_0x332d35=_0x2da5c0[_0x409319];if(_[_0x0a9e('0x18')](_0x40cb85['mailQueues'][_0x332d35['id']])){_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']]=new MailQueue(_0x332d35);}else{_0x40cb85[_0x0a9e('0x14')](_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']],_0x332d35);}_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']]['updateRouting']();_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']][_0x0a9e('0x1a')]();}}return _0x40cb85[_0x0a9e('0x1f')];};};Realtime[_0x0a9e('0x13')]['initFaxQueues']=function(){var _0x54135e=this;return function(_0x1e8694){if(_0x1e8694){freeIsNotKey(_0x1e8694,_0x54135e['faxQueues'],'id');for(var _0x24936a=0x0,_0x3d9717={},_0x381c37={};_0x24936a<_0x1e8694[_0x0a9e('0x17')];_0x24936a+=0x1){_0x3d9717=_0x1e8694[_0x24936a];if(_['isUndefined'](_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']])){_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']]=new FaxQueue(_0x3d9717);}else{_0x54135e[_0x0a9e('0x14')](_0x54135e['faxQueues'][_0x3d9717['id']],_0x3d9717);}_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']][_0x0a9e('0x1b')]();_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']]['updateRealtime']();}}return _0x54135e['faxQueues'];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x20')]=function(){var _0x5adda1=this;return function(_0x2b814e){if(_0x2b814e){freeIsNotKey(_0x2b814e,_0x5adda1[_0x0a9e('0x21')],'id');for(var _0x2e1b3a=0x0,_0x148f55={},_0x4b38d9={};_0x2e1b3a<_0x2b814e['length'];_0x2e1b3a+=0x1){_0x148f55=_0x2b814e[_0x2e1b3a];if(_[_0x0a9e('0x18')](_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']])){_0x5adda1['whatsappQueues'][_0x148f55['id']]=new WhatsappQueue(_0x148f55);}else{_0x5adda1[_0x0a9e('0x14')](_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']],_0x148f55);}_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']]['updateRouting']();_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']][_0x0a9e('0x1a')]();}}return _0x5adda1[_0x0a9e('0x21')];};};module[_0x0a9e('0x22')]=Realtime; \ No newline at end of file +var _0xa9e0=['isUndefined','initIntervals','updateRealtime','updateRouting','initSmsQueues','smsQueues','initMailQueues','mailQueues','initWhatsappQueues','whatsappQueues','exports','bluebird','util','lodash','../model/interval','../model/chatQueue','../model/smsQueue','../model/mailQueue','../model/faxQueue','../model/whatsappQueue','intervals','openchannelQueues','chatQueues','faxQueues','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','hasOwnProperty','prototype','mergeFromDatabase','initAgents','agents','length'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0xa9e0[_0x1ac595];return _0x455fff;};'use strict';var BPromise=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var moment=require('moment');var Agent=require('../model/agent');var Interval=require(_0x0a9e('0x3'));var OpenchannelQueue=require('../model/openchannelQueue');var ChatQueue=require(_0x0a9e('0x4'));var SmsQueue=require(_0x0a9e('0x5'));var MailQueue=require(_0x0a9e('0x6'));var FaxQueue=require(_0x0a9e('0x7'));var WhatsappQueue=require(_0x0a9e('0x8'));var Realtime=function(){this['agents']={};this[_0x0a9e('0x9')]={};this[_0x0a9e('0xa')]={};this[_0x0a9e('0xb')]={};this['smsQueues']={};this['mailQueues']={};this[_0x0a9e('0xc')]={};this['whatsappQueues']={};this['chatQueuesWaitingInteractions']={};this[_0x0a9e('0xd')]={};this[_0x0a9e('0xe')]={};this[_0x0a9e('0xf')]={};this[_0x0a9e('0x10')]={};this[_0x0a9e('0x11')]={};};function freeIsNotKey(_0xbd1168,_0x4a4c56,_0x50dfb2){var _0x527cdd=_['mapKeys'](_0xbd1168,function(_0x273d4d,_0x36471c){return _0x273d4d[_0x50dfb2];});for(var _0xd5b662 in _0x4a4c56){if(_0x4a4c56[_0x0a9e('0x12')](_0xd5b662)){if(!_0x527cdd[_0xd5b662]){delete _0x4a4c56[_0xd5b662];}}}}Realtime[_0x0a9e('0x13')][_0x0a9e('0x14')]=function(_0x5db4b0,_0x4283ce){for(var _0x239b12 in _0x4283ce){if(_0x5db4b0[_0x0a9e('0x12')](_0x239b12)){_0x5db4b0[_0x239b12]=_0x4283ce[_0x239b12];}}};Realtime[_0x0a9e('0x13')][_0x0a9e('0x15')]=function(){var _0x4d5611=this;return function(_0x52a03d){if(_0x52a03d){freeIsNotKey(_0x52a03d,_0x4d5611[_0x0a9e('0x16')],'id');for(var _0x5d0880=0x0,_0x1985b6={},_0x519dfd={};_0x5d0880<_0x52a03d[_0x0a9e('0x17')];_0x5d0880+=0x1){_0x1985b6=_0x52a03d[_0x5d0880];if(_[_0x0a9e('0x18')](_0x4d5611['agents'][_0x1985b6['id']])){_0x4d5611[_0x0a9e('0x16')][_0x1985b6['id']]=new Agent(_0x1985b6);}else{_0x4d5611['mergeFromDatabase'](_0x4d5611[_0x0a9e('0x16')][_0x1985b6['id']],_0x1985b6);}}}return _0x4d5611[_0x0a9e('0x16')];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x19')]=function(){var _0x31b1ca=this;return function(_0x2eb11f){if(_0x2eb11f){freeIsNotKey(_0x2eb11f,_0x31b1ca[_0x0a9e('0x9')],'id');for(var _0x20559e=0x0,_0x1314ae={},_0x112016={};_0x20559e<_0x2eb11f[_0x0a9e('0x17')];_0x20559e+=0x1){_0x1314ae=_0x2eb11f[_0x20559e];if(_[_0x0a9e('0x18')](_0x31b1ca['intervals'][_0x1314ae['id']])){_0x31b1ca[_0x0a9e('0x9')][_0x1314ae['id']]=new Interval(_0x1314ae);}else{_0x31b1ca[_0x0a9e('0x14')](_0x31b1ca['intervals'][_0x1314ae['id']],_0x1314ae);}}}return _0x31b1ca[_0x0a9e('0x9')];};};Realtime['prototype']['initOpenchannelQueues']=function(){var _0x3a02e1=this;return function(_0x432e56){if(_0x432e56){freeIsNotKey(_0x432e56,_0x3a02e1[_0x0a9e('0xa')],'id');for(var _0x30bae6=0x0,_0x4abc77={},_0xfb6e48={};_0x30bae6<_0x432e56[_0x0a9e('0x17')];_0x30bae6+=0x1){_0x4abc77=_0x432e56[_0x30bae6];if(_[_0x0a9e('0x18')](_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']])){_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']]=new OpenchannelQueue(_0x4abc77);}else{_0x3a02e1[_0x0a9e('0x14')](_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']],_0x4abc77);}_0x3a02e1['openchannelQueues'][_0x4abc77['id']]['updateRouting']();_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']][_0x0a9e('0x1a')]();}}return _0x3a02e1[_0x0a9e('0xa')];};};Realtime[_0x0a9e('0x13')]['initChatQueues']=function(){var _0x384319=this;return function(_0x479bc4){if(_0x479bc4){freeIsNotKey(_0x479bc4,_0x384319[_0x0a9e('0xb')],'id');for(var _0x5bfb33=0x0,_0x1dc186={},_0x34dc65={};_0x5bfb33<_0x479bc4[_0x0a9e('0x17')];_0x5bfb33+=0x1){_0x1dc186=_0x479bc4[_0x5bfb33];if(_[_0x0a9e('0x18')](_0x384319[_0x0a9e('0xb')][_0x1dc186['id']])){_0x384319[_0x0a9e('0xb')][_0x1dc186['id']]=new ChatQueue(_0x1dc186);}else{_0x384319[_0x0a9e('0x14')](_0x384319[_0x0a9e('0xb')][_0x1dc186['id']],_0x1dc186);}_0x384319['chatQueues'][_0x1dc186['id']][_0x0a9e('0x1b')]();_0x384319[_0x0a9e('0xb')][_0x1dc186['id']][_0x0a9e('0x1a')]();}}return _0x384319[_0x0a9e('0xb')];};};Realtime['prototype'][_0x0a9e('0x1c')]=function(){var _0x40e7a3=this;return function(_0x1843b2){if(_0x1843b2){freeIsNotKey(_0x1843b2,_0x40e7a3[_0x0a9e('0x1d')],'id');for(var _0x58b06f=0x0,_0x563b45={},_0x296f41={};_0x58b06f<_0x1843b2[_0x0a9e('0x17')];_0x58b06f+=0x1){_0x563b45=_0x1843b2[_0x58b06f];if(_[_0x0a9e('0x18')](_0x40e7a3['smsQueues'][_0x563b45['id']])){_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']]=new SmsQueue(_0x563b45);}else{_0x40e7a3['mergeFromDatabase'](_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']],_0x563b45);}_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']][_0x0a9e('0x1b')]();_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']][_0x0a9e('0x1a')]();}}return _0x40e7a3['smsQueues'];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x1e')]=function(){var _0x40cb85=this;return function(_0x2da5c0){if(_0x2da5c0){freeIsNotKey(_0x2da5c0,_0x40cb85[_0x0a9e('0x1f')],'id');for(var _0x409319=0x0,_0x332d35={},_0x39e565={};_0x409319<_0x2da5c0['length'];_0x409319+=0x1){_0x332d35=_0x2da5c0[_0x409319];if(_[_0x0a9e('0x18')](_0x40cb85['mailQueues'][_0x332d35['id']])){_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']]=new MailQueue(_0x332d35);}else{_0x40cb85[_0x0a9e('0x14')](_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']],_0x332d35);}_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']]['updateRouting']();_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']][_0x0a9e('0x1a')]();}}return _0x40cb85[_0x0a9e('0x1f')];};};Realtime[_0x0a9e('0x13')]['initFaxQueues']=function(){var _0x54135e=this;return function(_0x1e8694){if(_0x1e8694){freeIsNotKey(_0x1e8694,_0x54135e['faxQueues'],'id');for(var _0x24936a=0x0,_0x3d9717={},_0x381c37={};_0x24936a<_0x1e8694[_0x0a9e('0x17')];_0x24936a+=0x1){_0x3d9717=_0x1e8694[_0x24936a];if(_['isUndefined'](_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']])){_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']]=new FaxQueue(_0x3d9717);}else{_0x54135e[_0x0a9e('0x14')](_0x54135e['faxQueues'][_0x3d9717['id']],_0x3d9717);}_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']][_0x0a9e('0x1b')]();_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']]['updateRealtime']();}}return _0x54135e['faxQueues'];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x20')]=function(){var _0x5adda1=this;return function(_0x2b814e){if(_0x2b814e){freeIsNotKey(_0x2b814e,_0x5adda1[_0x0a9e('0x21')],'id');for(var _0x2e1b3a=0x0,_0x148f55={},_0x4b38d9={};_0x2e1b3a<_0x2b814e['length'];_0x2e1b3a+=0x1){_0x148f55=_0x2b814e[_0x2e1b3a];if(_[_0x0a9e('0x18')](_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']])){_0x5adda1['whatsappQueues'][_0x148f55['id']]=new WhatsappQueue(_0x148f55);}else{_0x5adda1[_0x0a9e('0x14')](_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']],_0x148f55);}_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']]['updateRouting']();_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']][_0x0a9e('0x1a')]();}}return _0x5adda1[_0x0a9e('0x21')];};};module[_0x0a9e('0x22')]=Realtime; \ No newline at end of file diff --git a/server/services/routing/rpc/chatInteraction.js b/server/services/routing/rpc/chatInteraction.js index f31595a..956a137 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 _0xc752=['addTagsToChatInteraction','../client','update','Request','addTags','AddTagsToChatInteraction'];(function(_0x35d8af,_0x14fd75){var _0x1d08b0=function(_0x36b437){while(--_0x36b437){_0x35d8af['push'](_0x35d8af['shift']());}};_0x1d08b0(++_0x14fd75);}(_0xc752,0x133));var _0x2c75=function(_0x9b7d2f,_0x381b7b){_0x9b7d2f=_0x9b7d2f-0x0;var _0x41dfb3=_0xc752[_0x9b7d2f];return _0x41dfb3;};'use strict';var client=require(_0x2c75('0x0'));exports[_0x2c75('0x1')]=function(_0x4b20d0,_0x56b26e){return client[_0x2c75('0x2')]('UpdateChatInteraction',{'body':_0x56b26e,'options':{'where':{'id':_0x4b20d0}},'log':'updateChatInteraction'});};exports[_0x2c75('0x3')]=function(_0x3cfec1,_0x1eb249){return client[_0x2c75('0x2')](_0x2c75('0x4'),{'body':_0x1eb249,'options':{'where':{'id':_0x3cfec1}},'log':_0x2c75('0x5')});}; \ No newline at end of file +var _0x73ad=['update','UpdateChatInteraction','updateChatInteraction','addTags','Request','AddTagsToChatInteraction','addTagsToChatInteraction','../client'];(function(_0x2fc71a,_0x502bff){var _0x223a40=function(_0x493aab){while(--_0x493aab){_0x2fc71a['push'](_0x2fc71a['shift']());}};_0x223a40(++_0x502bff);}(_0x73ad,0x1d7));var _0xd73a=function(_0x50eeb7,_0x228cff){_0x50eeb7=_0x50eeb7-0x0;var _0x1a753d=_0x73ad[_0x50eeb7];return _0x1a753d;};'use strict';var client=require(_0xd73a('0x0'));exports[_0xd73a('0x1')]=function(_0x3236c7,_0x338c53){return client['Request'](_0xd73a('0x2'),{'body':_0x338c53,'options':{'where':{'id':_0x3236c7}},'log':_0xd73a('0x3')});};exports[_0xd73a('0x4')]=function(_0x1cfec0,_0x4f0f95){return client[_0xd73a('0x5')](_0xd73a('0x6'),{'body':_0x4f0f95,'options':{'where':{'id':_0x1cfec0}},'log':_0xd73a('0x7')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatMessage.js b/server/services/routing/rpc/chatMessage.js index 71d2b2c..f572c20 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 _0xffb8=['Request','CreateChatMessage','../client','create'];(function(_0x35d7cd,_0x1fd8de){var _0x1f758e=function(_0x332eae){while(--_0x332eae){_0x35d7cd['push'](_0x35d7cd['shift']());}};_0x1f758e(++_0x1fd8de);}(_0xffb8,0x15e));var _0x8ffb=function(_0x39d392,_0x2583f6){_0x39d392=_0x39d392-0x0;var _0x2df202=_0xffb8[_0x39d392];return _0x2df202;};'use strict';var client=require(_0x8ffb('0x0'));exports[_0x8ffb('0x1')]=function(_0x33a934){return client[_0x8ffb('0x2')](_0x8ffb('0x3'),{'body':_0x33a934,'log':'createChatMessage'});}; \ No newline at end of file +var _0xdbb6=['../client','Request','createChatMessage'];(function(_0x3ff03e,_0x562064){var _0x3f3464=function(_0x46f411){while(--_0x46f411){_0x3ff03e['push'](_0x3ff03e['shift']());}};_0x3f3464(++_0x562064);}(_0xdbb6,0x6c));var _0x6dbb=function(_0x1a82f8,_0x3193c0){_0x1a82f8=_0x1a82f8-0x0;var _0x100d6b=_0xdbb6[_0x1a82f8];return _0x100d6b;};'use strict';var client=require(_0x6dbb('0x0'));exports['create']=function(_0xfdf4ca){return client[_0x6dbb('0x1')]('CreateChatMessage',{'body':_0xfdf4ca,'log':_0x6dbb('0x2')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueue.js b/server/services/routing/rpc/chatQueue.js index 94725b8..218a709 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 _0x90b5=['getChatQueues','../client','Request','GetChatQueue','name','timeout','Agents','chatPause'];(function(_0x49d103,_0x50a072){var _0x16399e=function(_0xde6d41){while(--_0xde6d41){_0x49d103['push'](_0x49d103['shift']());}};_0x16399e(++_0x50a072);}(_0x90b5,0x139));var _0x590b=function(_0x27a1c7,_0x2698a4){_0x27a1c7=_0x27a1c7-0x0;var _0x597db7=_0x90b5[_0x27a1c7];return _0x597db7;};'use strict';var client=require(_0x590b('0x0'));exports['getChatQueues']=function(){return function(){return client[_0x590b('0x1')](_0x590b('0x2'),{'options':{'raw':![],'attributes':['id',_0x590b('0x3'),_0x590b('0x4'),'strategy'],'include':[{'model':'User','as':_0x590b('0x5'),'attributes':['id',_0x590b('0x3'),'online',_0x590b('0x6')]}]},'log':_0x590b('0x7')});};}; \ No newline at end of file +var _0x3561=['User','Agents','online','chatPause','getChatQueues','../client','Request','GetChatQueue','name','timeout','strategy'];(function(_0x2c91b0,_0x352cf7){var _0x4c4928=function(_0xa51fa7){while(--_0xa51fa7){_0x2c91b0['push'](_0x2c91b0['shift']());}};_0x4c4928(++_0x352cf7);}(_0x3561,0x94));var _0x1356=function(_0x2ca7a6,_0x24d05a){_0x2ca7a6=_0x2ca7a6-0x0;var _0x192fe8=_0x3561[_0x2ca7a6];return _0x192fe8;};'use strict';var client=require(_0x1356('0x0'));exports['getChatQueues']=function(){return function(){return client[_0x1356('0x1')](_0x1356('0x2'),{'options':{'raw':![],'attributes':['id',_0x1356('0x3'),_0x1356('0x4'),_0x1356('0x5')],'include':[{'model':_0x1356('0x6'),'as':_0x1356('0x7'),'attributes':['id',_0x1356('0x3'),_0x1356('0x8'),_0x1356('0x9')]}]},'log':_0x1356('0xa')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueueReport.js b/server/services/routing/rpc/chatQueueReport.js index 84ae372..97e3646 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 _0x59ce=['Request','UpdateChatQueueReport','../client','create','CreateChatQueueReport','update'];(function(_0x41b6f5,_0x1ad42f){var _0x5d6142=function(_0xb46850){while(--_0xb46850){_0x41b6f5['push'](_0x41b6f5['shift']());}};_0x5d6142(++_0x1ad42f);}(_0x59ce,0x92));var _0xe59c=function(_0x55d41d,_0x8d8c0d){_0x55d41d=_0x55d41d-0x0;var _0x526150=_0x59ce[_0x55d41d];return _0x526150;};'use strict';var client=require(_0xe59c('0x0'));exports[_0xe59c('0x1')]=function(_0x1d28da){return client['Request'](_0xe59c('0x2'),{'body':_0x1d28da,'log':_0xe59c('0x2')});};exports[_0xe59c('0x3')]=function(_0x4178c1,_0x2ea56e){return client[_0xe59c('0x4')](_0xe59c('0x5'),{'body':_0x2ea56e,'options':{'where':{'uniqueid':_0x4178c1},'order':[['id','DESC']],'limit':0x1},'log':_0xe59c('0x5')});}; \ No newline at end of file +var _0xfa7c=['Request','CreateChatQueueReport','update','DESC','UpdateChatQueueReport','../client'];(function(_0xdaeb25,_0x9ed702){var _0x2ce036=function(_0x11ead3){while(--_0x11ead3){_0xdaeb25['push'](_0xdaeb25['shift']());}};_0x2ce036(++_0x9ed702);}(_0xfa7c,0x15b));var _0xcfa7=function(_0x18c0ff,_0x3c8154){_0x18c0ff=_0x18c0ff-0x0;var _0x39b8ca=_0xfa7c[_0x18c0ff];return _0x39b8ca;};'use strict';var client=require(_0xcfa7('0x0'));exports['create']=function(_0x46e1f9){return client[_0xcfa7('0x1')](_0xcfa7('0x2'),{'body':_0x46e1f9,'log':_0xcfa7('0x2')});};exports[_0xcfa7('0x3')]=function(_0x185124,_0x45411c){return client[_0xcfa7('0x1')]('UpdateChatQueueReport',{'body':_0x45411c,'options':{'where':{'uniqueid':_0x185124},'order':[['id',_0xcfa7('0x4')]],'limit':0x1},'log':_0xcfa7('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxInteraction.js b/server/services/routing/rpc/faxInteraction.js index 3f9da8e..607db0d 100644 --- a/server/services/routing/rpc/faxInteraction.js +++ b/server/services/routing/rpc/faxInteraction.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['Request','AddTagsToFaxInteraction','addTagsToFaxInteraction','../client','update','UpdateFaxInteraction','updateFaxInteraction','addTags'];(function(_0x3f12be,_0x2a9c41){var _0x57cf5d=function(_0x3080ed){while(--_0x3080ed){_0x3f12be['push'](_0x3f12be['shift']());}};_0x57cf5d(++_0x2a9c41);}(_0x9957,0x93));var _0x7995=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x9957[_0xbca1b1];return _0x4e1686;};'use strict';var client=require(_0x7995('0x0'));exports[_0x7995('0x1')]=function(_0x2722a3,_0x10a05d){return client['Request'](_0x7995('0x2'),{'body':_0x10a05d,'options':{'where':{'id':_0x2722a3}},'log':_0x7995('0x3')});};exports[_0x7995('0x4')]=function(_0x462a03,_0x576d89){return client[_0x7995('0x5')](_0x7995('0x6'),{'body':_0x576d89,'options':{'where':{'id':_0x462a03}},'log':_0x7995('0x7')});}; \ No newline at end of file +var _0x7a54=['Request','UpdateFaxInteraction','addTags','AddTagsToFaxInteraction','../client','update'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0x7a54,0x106));var _0x47a5=function(_0x2d5fc3,_0x436b74){_0x2d5fc3=_0x2d5fc3-0x0;var _0xa00bbd=_0x7a54[_0x2d5fc3];return _0xa00bbd;};'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 ef2be04..843176c 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 _0x677e=['createFaxMessage','../client','create','Request'];(function(_0x5a94b6,_0x40d3ba){var _0x4e52ac=function(_0x3f1d69){while(--_0x3f1d69){_0x5a94b6['push'](_0x5a94b6['shift']());}};_0x4e52ac(++_0x40d3ba);}(_0x677e,0xb5));var _0xe677=function(_0x26b8b5,_0xf5c2c1){_0x26b8b5=_0x26b8b5-0x0;var _0x2150a9=_0x677e[_0x26b8b5];return _0x2150a9;};'use strict';var client=require(_0xe677('0x0'));exports[_0xe677('0x1')]=function(_0xaafb5c){return client[_0xe677('0x2')]('CreateFaxMessage',{'body':_0xaafb5c,'log':_0xe677('0x3')});}; \ No newline at end of file +var _0x87de=['Request','CreateFaxMessage','createFaxMessage'];(function(_0x398eda,_0x25041b){var _0x1126d6=function(_0x145462){while(--_0x145462){_0x398eda['push'](_0x398eda['shift']());}};_0x1126d6(++_0x25041b);}(_0x87de,0xf9));var _0xe87d=function(_0x35e86b,_0x2cadba){_0x35e86b=_0x35e86b-0x0;var _0x322d24=_0x87de[_0x35e86b];return _0x322d24;};'use strict';var client=require('../client');exports['create']=function(_0xf88394){return client[_0xe87d('0x0')](_0xe87d('0x1'),{'body':_0xf88394,'log':_0xe87d('0x2')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueue.js b/server/services/routing/rpc/faxQueue.js index 1b711b0..0c8f32b 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 _0x1d5b=['Request','GetFaxQueue','name','timeout','strategy','Agents','faxPause','../client'];(function(_0x5ca6b7,_0x1a4f32){var _0x2d7743=function(_0x569d42){while(--_0x569d42){_0x5ca6b7['push'](_0x5ca6b7['shift']());}};_0x2d7743(++_0x1a4f32);}(_0x1d5b,0xf7));var _0xb1d5=function(_0x2f502,_0x2c7100){_0x2f502=_0x2f502-0x0;var _0x3baa87=_0x1d5b[_0x2f502];return _0x3baa87;};'use strict';var client=require(_0xb1d5('0x0'));exports['getFaxQueues']=function(){return function(){return client[_0xb1d5('0x1')](_0xb1d5('0x2'),{'options':{'raw':![],'attributes':['id',_0xb1d5('0x3'),_0xb1d5('0x4'),_0xb1d5('0x5')],'include':[{'model':'User','as':_0xb1d5('0x6'),'attributes':['id',_0xb1d5('0x3'),'online',_0xb1d5('0x7')]}]},'log':'getFaxQueues'});};}; \ No newline at end of file +var _0xdb22=['GetFaxQueue','name','strategy','User','faxPause','getFaxQueues','Request'];(function(_0x2b0a86,_0x22c27c){var _0x6c0ac7=function(_0x4c0b70){while(--_0x4c0b70){_0x2b0a86['push'](_0x2b0a86['shift']());}};_0x6c0ac7(++_0x22c27c);}(_0xdb22,0x147));var _0x2db2=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xdb22[_0x3ab51d];return _0x29a04e;};'use strict';var client=require('../client');exports[_0x2db2('0x0')]=function(){return function(){return client[_0x2db2('0x1')](_0x2db2('0x2'),{'options':{'raw':![],'attributes':['id',_0x2db2('0x3'),'timeout',_0x2db2('0x4')],'include':[{'model':_0x2db2('0x5'),'as':'Agents','attributes':['id',_0x2db2('0x3'),'online',_0x2db2('0x6')]}]},'log':'getFaxQueues'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueueReport.js b/server/services/routing/rpc/faxQueueReport.js index e631421..2ce9aea 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 _0x71fc=['UpdateFaxQueueReport','../client','Request','CreateFaxQueueReport','update'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x71fc,0x12d));var _0xc71f=function(_0x59528c,_0x5a2452){_0x59528c=_0x59528c-0x0;var _0x51faee=_0x71fc[_0x59528c];return _0x51faee;};'use strict';var client=require(_0xc71f('0x0'));exports['create']=function(_0x47a9d4){return client[_0xc71f('0x1')](_0xc71f('0x2'),{'body':_0x47a9d4,'log':_0xc71f('0x2')});};exports[_0xc71f('0x3')]=function(_0x3a3120,_0x24a448){return client[_0xc71f('0x1')](_0xc71f('0x4'),{'body':_0x24a448,'options':{'where':{'uniqueid':_0x3a3120},'order':[['id','DESC']],'limit':0x1},'log':_0xc71f('0x4')});}; \ No newline at end of file +var _0x22a9=['UpdateFaxQueueReport','../client','Request','CreateFaxQueueReport','update','DESC'];(function(_0x2c6ec2,_0x2bfa6a){var _0x16495d=function(_0xa1c99c){while(--_0xa1c99c){_0x2c6ec2['push'](_0x2c6ec2['shift']());}};_0x16495d(++_0x2bfa6a);}(_0x22a9,0x17b));var _0x922a=function(_0x1988d2,_0x5b69a5){_0x1988d2=_0x1988d2-0x0;var _0x2b2a2d=_0x22a9[_0x1988d2];return _0x2b2a2d;};'use strict';var client=require(_0x922a('0x0'));exports['create']=function(_0x94cb0c){return client[_0x922a('0x1')](_0x922a('0x2'),{'body':_0x94cb0c,'log':_0x922a('0x2')});};exports[_0x922a('0x3')]=function(_0x24832b,_0x3d8e73){return client[_0x922a('0x1')]('UpdateFaxQueueReport',{'body':_0x3d8e73,'options':{'where':{'uniqueid':_0x24832b},'order':[['id',_0x922a('0x4')]],'limit':0x1},'log':_0x922a('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/interval.js b/server/services/routing/rpc/interval.js index 44deae6..a2d76ea 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 _0x3098=['GetInterval','Interval','Intervals','name','interval','../client','Request'];(function(_0xabc2c8,_0x117548){var _0x52834a=function(_0x37e277){while(--_0x37e277){_0xabc2c8['push'](_0xabc2c8['shift']());}};_0x52834a(++_0x117548);}(_0x3098,0x1ef));var _0x8309=function(_0x2f6541,_0x363cba){_0x2f6541=_0x2f6541-0x0;var _0x4d76d8=_0x3098[_0x2f6541];return _0x4d76d8;};'use strict';var client=require(_0x8309('0x0'));exports['getIntervals']=function(){return function(){return client[_0x8309('0x1')](_0x8309('0x2'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id','name'],'include':[{'model':_0x8309('0x3'),'as':_0x8309('0x4'),'attributes':['id',_0x8309('0x5'),_0x8309('0x6')]}]},'log':'getIntervals'});};}; \ No newline at end of file +var _0x3462=['getIntervals','Request','name','Intervals','../client'];(function(_0x1895ce,_0x81e9b2){var _0x4c3c7f=function(_0x2e4d0b){while(--_0x2e4d0b){_0x1895ce['push'](_0x1895ce['shift']());}};_0x4c3c7f(++_0x81e9b2);}(_0x3462,0xa9));var _0x2346=function(_0x53e645,_0x36e4d7){_0x53e645=_0x53e645-0x0;var _0xe568ef=_0x3462[_0x53e645];return _0xe568ef;};'use strict';var client=require(_0x2346('0x0'));exports[_0x2346('0x1')]=function(){return function(){return client[_0x2346('0x2')]('GetInterval',{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0x2346('0x3')],'include':[{'model':'Interval','as':_0x2346('0x4'),'attributes':['id',_0x2346('0x3'),'interval']}]},'log':_0x2346('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailInteraction.js b/server/services/routing/rpc/mailInteraction.js index 151b1ab..b3d54ee 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 _0x430c=['AddTagsToMailInteraction','../client','Request','UpdateMailInteraction'];(function(_0x522f12,_0xee209d){var _0xa45ccb=function(_0x55fe12){while(--_0x55fe12){_0x522f12['push'](_0x522f12['shift']());}};_0xa45ccb(++_0xee209d);}(_0x430c,0x1a1));var _0xc430=function(_0x59b2a1,_0x1f631f){_0x59b2a1=_0x59b2a1-0x0;var _0x4908d1=_0x430c[_0x59b2a1];return _0x4908d1;};'use strict';var client=require(_0xc430('0x0'));exports['update']=function(_0x4c0679,_0x426596){return client[_0xc430('0x1')](_0xc430('0x2'),{'body':_0x426596,'options':{'where':{'id':_0x4c0679}},'log':'updateMailInteraction'});};exports['addTags']=function(_0x5ccda6,_0x47d8b9){return client[_0xc430('0x1')](_0xc430('0x3'),{'body':_0x47d8b9,'options':{'where':{'id':_0x5ccda6}},'log':'addTagsToChatInteraction'});}; \ No newline at end of file +var _0x28f2=['updateMailInteraction','addTags','AddTagsToMailInteraction','addTagsToChatInteraction','../client','update','Request'];(function(_0x169992,_0x3ee92b){var _0x2022bf=function(_0x58e230){while(--_0x58e230){_0x169992['push'](_0x169992['shift']());}};_0x2022bf(++_0x3ee92b);}(_0x28f2,0x193));var _0x228f=function(_0x4d549e,_0x56209b){_0x4d549e=_0x4d549e-0x0;var _0x529bd5=_0x28f2[_0x4d549e];return _0x529bd5;};'use strict';var client=require(_0x228f('0x0'));exports[_0x228f('0x1')]=function(_0x108337,_0x2e5e0b){return client[_0x228f('0x2')]('UpdateMailInteraction',{'body':_0x2e5e0b,'options':{'where':{'id':_0x108337}},'log':_0x228f('0x3')});};exports[_0x228f('0x4')]=function(_0x79ed5f,_0x4303c3){return client[_0x228f('0x2')](_0x228f('0x5'),{'body':_0x4303c3,'options':{'where':{'id':_0x79ed5f}},'log':_0x228f('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailMessage.js b/server/services/routing/rpc/mailMessage.js index 13d114d..4b7bab2 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 _0x5560=['CreateMailMessage','createMailMessage','../client','create','Request'];(function(_0x54d4fe,_0x55e869){var _0x1ab5bb=function(_0x5b1af2){while(--_0x5b1af2){_0x54d4fe['push'](_0x54d4fe['shift']());}};_0x1ab5bb(++_0x55e869);}(_0x5560,0xde));var _0x0556=function(_0x48aa96,_0x5d95da){_0x48aa96=_0x48aa96-0x0;var _0x34881d=_0x5560[_0x48aa96];return _0x34881d;};'use strict';var client=require(_0x0556('0x0'));exports[_0x0556('0x1')]=function(_0x36cced){return client[_0x0556('0x2')](_0x0556('0x3'),{'body':_0x36cced,'log':_0x0556('0x4')});}; \ No newline at end of file +var _0x101e=['create','../client'];(function(_0x4a600d,_0x1ac003){var _0x358e4e=function(_0x913371){while(--_0x913371){_0x4a600d['push'](_0x4a600d['shift']());}};_0x358e4e(++_0x1ac003);}(_0x101e,0xd3));var _0xe101=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x101e[_0x5ddb1c];return _0x354adc;};'use strict';var client=require(_0xe101('0x0'));exports[_0xe101('0x1')]=function(_0x2e6bf2){return client['Request']('CreateMailMessage',{'body':_0x2e6bf2,'log':'createMailMessage'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueue.js b/server/services/routing/rpc/mailQueue.js index 07268d3..425ae3c 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 _0x862f=['name','timeout','User','Agents','online','mailPause','getMailQueues','../client','Request'];(function(_0x55e9a2,_0x453fbb){var _0x59e302=function(_0x3b5b0a){while(--_0x3b5b0a){_0x55e9a2['push'](_0x55e9a2['shift']());}};_0x59e302(++_0x453fbb);}(_0x862f,0x1db));var _0xf862=function(_0x4e29f1,_0x3da155){_0x4e29f1=_0x4e29f1-0x0;var _0x4bc72f=_0x862f[_0x4e29f1];return _0x4bc72f;};'use strict';var client=require(_0xf862('0x0'));exports['getMailQueues']=function(){return function(){return client[_0xf862('0x1')]('GetMailQueue',{'options':{'raw':![],'attributes':['id',_0xf862('0x2'),_0xf862('0x3'),'strategy'],'include':[{'model':_0xf862('0x4'),'as':_0xf862('0x5'),'attributes':['id','name',_0xf862('0x6'),_0xf862('0x7')]}]},'log':_0xf862('0x8')});};}; \ No newline at end of file +var _0x939d=['Agents','online','mailPause','../client','getMailQueues','Request','name','timeout','strategy','User'];(function(_0xf5802e,_0x346340){var _0x55133d=function(_0x306b00){while(--_0x306b00){_0xf5802e['push'](_0xf5802e['shift']());}};_0x55133d(++_0x346340);}(_0x939d,0x1d9));var _0xd939=function(_0x18af9f,_0x20e1cc){_0x18af9f=_0x18af9f-0x0;var _0x1d8426=_0x939d[_0x18af9f];return _0x1d8426;};'use strict';var client=require(_0xd939('0x0'));exports[_0xd939('0x1')]=function(){return function(){return client[_0xd939('0x2')]('GetMailQueue',{'options':{'raw':![],'attributes':['id',_0xd939('0x3'),_0xd939('0x4'),_0xd939('0x5')],'include':[{'model':_0xd939('0x6'),'as':_0xd939('0x7'),'attributes':['id',_0xd939('0x3'),_0xd939('0x8'),_0xd939('0x9')]}]},'log':_0xd939('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueueReport.js b/server/services/routing/rpc/mailQueueReport.js index 41a3340..9ff3034 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 _0xeb5f=['update','UpdateMailQueueReport','DESC','Request','CreateMailQueueReport'];(function(_0x2d2ecb,_0x248033){var _0x39e8bd=function(_0x446ce3){while(--_0x446ce3){_0x2d2ecb['push'](_0x2d2ecb['shift']());}};_0x39e8bd(++_0x248033);}(_0xeb5f,0x8f));var _0xfeb5=function(_0x7a8712,_0x3e9c7e){_0x7a8712=_0x7a8712-0x0;var _0x553862=_0xeb5f[_0x7a8712];return _0x553862;};'use strict';var client=require('../client');exports['create']=function(_0x4eb05f){return client[_0xfeb5('0x0')](_0xfeb5('0x1'),{'body':_0x4eb05f,'log':_0xfeb5('0x1')});};exports[_0xfeb5('0x2')]=function(_0x320c44,_0x4d98ef){return client[_0xfeb5('0x0')](_0xfeb5('0x3'),{'body':_0x4d98ef,'options':{'where':{'uniqueid':_0x320c44},'order':[['id',_0xfeb5('0x4')]],'limit':0x1},'log':_0xfeb5('0x3')});}; \ No newline at end of file +var _0x4965=['Request','CreateMailQueueReport','update','DESC','../client','create'];(function(_0x4796a7,_0x21b39e){var _0xaaf5c=function(_0x31dbbc){while(--_0x31dbbc){_0x4796a7['push'](_0x4796a7['shift']());}};_0xaaf5c(++_0x21b39e);}(_0x4965,0x1ae));var _0x5496=function(_0x20008a,_0x362490){_0x20008a=_0x20008a-0x0;var _0x5d0f1c=_0x4965[_0x20008a];return _0x5d0f1c;};'use strict';var client=require(_0x5496('0x0'));exports[_0x5496('0x1')]=function(_0x3fe50d){return client[_0x5496('0x2')](_0x5496('0x3'),{'body':_0x3fe50d,'log':_0x5496('0x3')});};exports[_0x5496('0x4')]=function(_0x39566f,_0x538e64){return client[_0x5496('0x2')]('UpdateMailQueueReport',{'body':_0x538e64,'options':{'where':{'uniqueid':_0x39566f},'order':[['id',_0x5496('0x5')]],'limit':0x1},'log':'UpdateMailQueueReport'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelInteraction.js b/server/services/routing/rpc/openchannelInteraction.js index d9a5dca..2b79db8 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 _0x2af3=['update','Request','updateOpenchannelInteraction','addTags','AddTagsToOpenchannelInteraction','addTagsToChatInteraction','../client'];(function(_0x1524fc,_0x409a64){var _0xa0651f=function(_0x2024a6){while(--_0x2024a6){_0x1524fc['push'](_0x1524fc['shift']());}};_0xa0651f(++_0x409a64);}(_0x2af3,0x110));var _0x32af=function(_0x307cec,_0x1cf922){_0x307cec=_0x307cec-0x0;var _0x285c73=_0x2af3[_0x307cec];return _0x285c73;};'use strict';var client=require(_0x32af('0x0'));exports[_0x32af('0x1')]=function(_0x1dd9aa,_0x58fd49){return client[_0x32af('0x2')]('UpdateOpenchannelInteraction',{'body':_0x58fd49,'options':{'where':{'id':_0x1dd9aa}},'log':_0x32af('0x3')});};exports[_0x32af('0x4')]=function(_0x5da045,_0x5d6bd3){return client[_0x32af('0x2')](_0x32af('0x5'),{'body':_0x5d6bd3,'options':{'where':{'id':_0x5da045}},'log':_0x32af('0x6')});}; \ No newline at end of file +var _0x975f=['addTagsToChatInteraction','../client','update','updateOpenchannelInteraction'];(function(_0xc3cfc3,_0x17de70){var _0x156f14=function(_0x4fb954){while(--_0x4fb954){_0xc3cfc3['push'](_0xc3cfc3['shift']());}};_0x156f14(++_0x17de70);}(_0x975f,0x139));var _0xf975=function(_0x12ddb2,_0x5ad61e){_0x12ddb2=_0x12ddb2-0x0;var _0x10b6dd=_0x975f[_0x12ddb2];return _0x10b6dd;};'use strict';var client=require(_0xf975('0x0'));exports[_0xf975('0x1')]=function(_0x51c772,_0x33ffb3){return client['Request']('UpdateOpenchannelInteraction',{'body':_0x33ffb3,'options':{'where':{'id':_0x51c772}},'log':_0xf975('0x2')});};exports['addTags']=function(_0x57ddc2,_0x59968e){return client['Request']('AddTagsToOpenchannelInteraction',{'body':_0x59968e,'options':{'where':{'id':_0x57ddc2}},'log':_0xf975('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelMessage.js b/server/services/routing/rpc/openchannelMessage.js index 0896d7e..4816b06 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 _0x0a4c=['createOpenchannelMessage','../client','create','CreateOpenchannelMessage'];(function(_0x9bb6b6,_0x92c581){var _0x521186=function(_0x34fe9e){while(--_0x34fe9e){_0x9bb6b6['push'](_0x9bb6b6['shift']());}};_0x521186(++_0x92c581);}(_0x0a4c,0x12d));var _0xc0a4=function(_0x1309d3,_0x496cc1){_0x1309d3=_0x1309d3-0x0;var _0x393dae=_0x0a4c[_0x1309d3];return _0x393dae;};'use strict';var client=require(_0xc0a4('0x0'));exports[_0xc0a4('0x1')]=function(_0x4d7183){return client['Request'](_0xc0a4('0x2'),{'body':_0x4d7183,'log':_0xc0a4('0x3')});}; \ No newline at end of file +var _0xa097=['Request','create'];(function(_0x1cc519,_0x295249){var _0x5cf583=function(_0x4d671e){while(--_0x4d671e){_0x1cc519['push'](_0x1cc519['shift']());}};_0x5cf583(++_0x295249);}(_0xa097,0xcd));var _0x7a09=function(_0xe525c9,_0x5c612d){_0xe525c9=_0xe525c9-0x0;var _0x5dc0d9=_0xa097[_0xe525c9];return _0x5dc0d9;};'use strict';var client=require('../client');exports[_0x7a09('0x0')]=function(_0x3024fc){return client[_0x7a09('0x1')]('CreateOpenchannelMessage',{'body':_0x3024fc,'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 385416f..9e0e96d 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 _0xed5a=['timeout','strategy','User','online','openchannelPause','../client','getOpenchannelQueues','name'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xed5a,0x10d));var _0xaed5=function(_0xb875ee,_0x583042){_0xb875ee=_0xb875ee-0x0;var _0x4c7f3a=_0xed5a[_0xb875ee];return _0x4c7f3a;};'use strict';var client=require(_0xaed5('0x0'));exports[_0xaed5('0x1')]=function(){return function(){return client['Request']('GetOpenchannelQueue',{'options':{'raw':![],'attributes':['id',_0xaed5('0x2'),_0xaed5('0x3'),_0xaed5('0x4')],'include':[{'model':_0xaed5('0x5'),'as':'Agents','attributes':['id',_0xaed5('0x2'),_0xaed5('0x6'),_0xaed5('0x7')]}]},'log':'getOpenchannelQueues'});};}; \ No newline at end of file +var _0x89ff=['GetOpenchannelQueue','name','timeout','strategy','User','online','openchannelPause','getOpenchannelQueues','Request'];(function(_0x23cb13,_0x3b5f9a){var _0x2d924f=function(_0x340d88){while(--_0x340d88){_0x23cb13['push'](_0x23cb13['shift']());}};_0x2d924f(++_0x3b5f9a);}(_0x89ff,0x1b7));var _0xf89f=function(_0x517a2d,_0x21e839){_0x517a2d=_0x517a2d-0x0;var _0x42498c=_0x89ff[_0x517a2d];return _0x42498c;};'use strict';var client=require('../client');exports[_0xf89f('0x0')]=function(){return function(){return client[_0xf89f('0x1')](_0xf89f('0x2'),{'options':{'raw':![],'attributes':['id',_0xf89f('0x3'),_0xf89f('0x4'),_0xf89f('0x5')],'include':[{'model':_0xf89f('0x6'),'as':'Agents','attributes':['id',_0xf89f('0x3'),_0xf89f('0x7'),_0xf89f('0x8')]}]},'log':_0xf89f('0x0')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueueReport.js b/server/services/routing/rpc/openchannelQueueReport.js index e6dc177..a4c2b44 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 _0x49ce=['UpdateOpenchannelQueueReport','DESC','create','Request','CreateOpenchannelQueueReport','update'];(function(_0x5da86b,_0x2d79b0){var _0x162af9=function(_0x2be8d1){while(--_0x2be8d1){_0x5da86b['push'](_0x5da86b['shift']());}};_0x162af9(++_0x2d79b0);}(_0x49ce,0x116));var _0xe49c=function(_0x5bb736,_0x32c198){_0x5bb736=_0x5bb736-0x0;var _0x483aad=_0x49ce[_0x5bb736];return _0x483aad;};'use strict';var client=require('../client');exports[_0xe49c('0x0')]=function(_0x19cb90){return client[_0xe49c('0x1')](_0xe49c('0x2'),{'body':_0x19cb90,'log':'CreateOpenchannelQueueReport'});};exports[_0xe49c('0x3')]=function(_0x3b0e6f,_0x32fbe6){return client[_0xe49c('0x1')](_0xe49c('0x4'),{'body':_0x32fbe6,'options':{'where':{'uniqueid':_0x3b0e6f},'order':[['id',_0xe49c('0x5')]],'limit':0x1},'log':_0xe49c('0x4')});}; \ No newline at end of file +var _0x2b72=['update','UpdateOpenchannelQueueReport','DESC','../client','Request','CreateOpenchannelQueueReport'];(function(_0x371d83,_0x49a0ce){var _0x27a8b8=function(_0x5acf2d){while(--_0x5acf2d){_0x371d83['push'](_0x371d83['shift']());}};_0x27a8b8(++_0x49a0ce);}(_0x2b72,0x1d1));var _0x22b7=function(_0x11882e,_0x2ee213){_0x11882e=_0x11882e-0x0;var _0x5666a6=_0x2b72[_0x11882e];return _0x5666a6;};'use strict';var client=require(_0x22b7('0x0'));exports['create']=function(_0x318f88){return client[_0x22b7('0x1')](_0x22b7('0x2'),{'body':_0x318f88,'log':_0x22b7('0x2')});};exports[_0x22b7('0x3')]=function(_0x182a84,_0x57eb24){return client[_0x22b7('0x1')](_0x22b7('0x4'),{'body':_0x57eb24,'options':{'where':{'uniqueid':_0x182a84},'order':[['id',_0x22b7('0x5')]],'limit':0x1},'log':_0x22b7('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsInteraction.js b/server/services/routing/rpc/smsInteraction.js index a2d05c1..31607fa 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 _0xa5ca=['updateSmsInteraction','addTags','Request','../client','update','UpdateSmsInteraction'];(function(_0x406957,_0x36fc08){var _0x803a57=function(_0x27f25f){while(--_0x27f25f){_0x406957['push'](_0x406957['shift']());}};_0x803a57(++_0x36fc08);}(_0xa5ca,0xb1));var _0xaa5c=function(_0xf84870,_0x4dc38f){_0xf84870=_0xf84870-0x0;var _0x4541a4=_0xa5ca[_0xf84870];return _0x4541a4;};'use strict';var client=require(_0xaa5c('0x0'));exports[_0xaa5c('0x1')]=function(_0x3d7bfc,_0x50cffe){return client['Request'](_0xaa5c('0x2'),{'body':_0x50cffe,'options':{'where':{'id':_0x3d7bfc}},'log':_0xaa5c('0x3')});};exports[_0xaa5c('0x4')]=function(_0x12c12f,_0x1d9faf){return client[_0xaa5c('0x5')]('AddTagsToSmsInteraction',{'body':_0x1d9faf,'options':{'where':{'id':_0x12c12f}},'log':'addTagsToSmsInteraction'});}; \ No newline at end of file +var _0x004c=['../client','update','UpdateSmsInteraction','updateSmsInteraction','addTags','Request','addTagsToSmsInteraction'];(function(_0x59befa,_0x4af99b){var _0x1dd63d=function(_0x4c1df4){while(--_0x4c1df4){_0x59befa['push'](_0x59befa['shift']());}};_0x1dd63d(++_0x4af99b);}(_0x004c,0x85));var _0xc004=function(_0xaa1b3e,_0x47d976){_0xaa1b3e=_0xaa1b3e-0x0;var _0x454d7d=_0x004c[_0xaa1b3e];return _0x454d7d;};'use strict';var client=require(_0xc004('0x0'));exports[_0xc004('0x1')]=function(_0x3fa239,_0x2cf6a8){return client['Request'](_0xc004('0x2'),{'body':_0x2cf6a8,'options':{'where':{'id':_0x3fa239}},'log':_0xc004('0x3')});};exports[_0xc004('0x4')]=function(_0x38a8b9,_0x571646){return client[_0xc004('0x5')]('AddTagsToSmsInteraction',{'body':_0x571646,'options':{'where':{'id':_0x38a8b9}},'log':_0xc004('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsMessage.js b/server/services/routing/rpc/smsMessage.js index 101afde..50f6f5c 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 _0xffd9=['../client','create','Request','CreateSmsMessage','createSmsMessage'];(function(_0x2322e4,_0x47d86d){var _0x30838b=function(_0x583386){while(--_0x583386){_0x2322e4['push'](_0x2322e4['shift']());}};_0x30838b(++_0x47d86d);}(_0xffd9,0x159));var _0x9ffd=function(_0x40509d,_0x1b330a){_0x40509d=_0x40509d-0x0;var _0x1c4bd0=_0xffd9[_0x40509d];return _0x1c4bd0;};'use strict';var client=require(_0x9ffd('0x0'));exports[_0x9ffd('0x1')]=function(_0x5d643f){return client[_0x9ffd('0x2')](_0x9ffd('0x3'),{'body':_0x5d643f,'log':_0x9ffd('0x4')});}; \ No newline at end of file +var _0xf48a=['createSmsMessage','../client','Request','CreateSmsMessage'];(function(_0x598f3b,_0x30a7f6){var _0x63514c=function(_0x5b7724){while(--_0x5b7724){_0x598f3b['push'](_0x598f3b['shift']());}};_0x63514c(++_0x30a7f6);}(_0xf48a,0x81));var _0xaf48=function(_0x2fba2b,_0x4977bf){_0x2fba2b=_0x2fba2b-0x0;var _0x438896=_0xf48a[_0x2fba2b];return _0x438896;};'use strict';var client=require(_0xaf48('0x0'));exports['create']=function(_0x5a3702){return client[_0xaf48('0x1')](_0xaf48('0x2'),{'body':_0x5a3702,'log':_0xaf48('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueue.js b/server/services/routing/rpc/smsQueue.js index 146811f..a304e58 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 _0xe706=['Agents','online','smsPause','../client','getSmsQueues','Request','name','timeout','strategy','User'];(function(_0x1abdcc,_0x2c79f3){var _0x535f5c=function(_0x12b29b){while(--_0x12b29b){_0x1abdcc['push'](_0x1abdcc['shift']());}};_0x535f5c(++_0x2c79f3);}(_0xe706,0xa3));var _0x6e70=function(_0x4e5f40,_0x3bf5d2){_0x4e5f40=_0x4e5f40-0x0;var _0x7d58be=_0xe706[_0x4e5f40];return _0x7d58be;};'use strict';var client=require(_0x6e70('0x0'));exports[_0x6e70('0x1')]=function(){return function(){return client[_0x6e70('0x2')]('GetSmsQueue',{'options':{'raw':![],'attributes':['id',_0x6e70('0x3'),_0x6e70('0x4'),_0x6e70('0x5')],'include':[{'model':_0x6e70('0x6'),'as':_0x6e70('0x7'),'attributes':['id',_0x6e70('0x3'),_0x6e70('0x8'),_0x6e70('0x9')]}]},'log':_0x6e70('0x1')});};}; \ No newline at end of file +var _0x70e0=['User','Agents','online','../client','getSmsQueues','Request','timeout','strategy'];(function(_0x54f000,_0x551dff){var _0x483e6d=function(_0xb07490){while(--_0xb07490){_0x54f000['push'](_0x54f000['shift']());}};_0x483e6d(++_0x551dff);}(_0x70e0,0x17b));var _0x070e=function(_0x486bca,_0xf8ebfe){_0x486bca=_0x486bca-0x0;var _0x81fb7d=_0x70e0[_0x486bca];return _0x81fb7d;};'use strict';var client=require(_0x070e('0x0'));exports[_0x070e('0x1')]=function(){return function(){return client[_0x070e('0x2')]('GetSmsQueue',{'options':{'raw':![],'attributes':['id','name',_0x070e('0x3'),_0x070e('0x4')],'include':[{'model':_0x070e('0x5'),'as':_0x070e('0x6'),'attributes':['id','name',_0x070e('0x7'),'smsPause']}]},'log':_0x070e('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueueReport.js b/server/services/routing/rpc/smsQueueReport.js index dd8cea9..4a2adf6 100644 --- a/server/services/routing/rpc/smsQueueReport.js +++ b/server/services/routing/rpc/smsQueueReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x70e0=['create','CreateSmsQueueReport','update','UpdateSmsQueueReport','../client'];(function(_0x5c304f,_0x11280c){var _0xd635be=function(_0xd597ee){while(--_0xd597ee){_0x5c304f['push'](_0x5c304f['shift']());}};_0xd635be(++_0x11280c);}(_0x70e0,0x17b));var _0x070e=function(_0x468644,_0x3518df){_0x468644=_0x468644-0x0;var _0x403e61=_0x70e0[_0x468644];return _0x403e61;};'use strict';var client=require(_0x070e('0x0'));exports[_0x070e('0x1')]=function(_0x198c2e){return client['Request']('CreateSmsQueueReport',{'body':_0x198c2e,'log':_0x070e('0x2')});};exports[_0x070e('0x3')]=function(_0x277d32,_0x2593e5){return client['Request'](_0x070e('0x4'),{'body':_0x2593e5,'options':{'where':{'uniqueid':_0x277d32},'order':[['id','DESC']],'limit':0x1},'log':_0x070e('0x4')});}; \ No newline at end of file +var _0x9957=['../client','create','Request','CreateSmsQueueReport','update','UpdateSmsQueueReport','DESC'];(function(_0x5a7944,_0x4f15d2){var _0x5a3725=function(_0x1aacb3){while(--_0x1aacb3){_0x5a7944['push'](_0x5a7944['shift']());}};_0x5a3725(++_0x4f15d2);}(_0x9957,0x93));var _0x7995=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9957[_0x14add3];return _0x4a174f;};'use strict';var client=require(_0x7995('0x0'));exports[_0x7995('0x1')]=function(_0x2722a3){return client[_0x7995('0x2')]('CreateSmsQueueReport',{'body':_0x2722a3,'log':_0x7995('0x3')});};exports[_0x7995('0x4')]=function(_0x1902b4,_0x462a03){return client['Request'](_0x7995('0x5'),{'body':_0x462a03,'options':{'where':{'uniqueid':_0x1902b4},'order':[['id',_0x7995('0x6')]],'limit':0x1},'log':_0x7995('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/user.js b/server/services/routing/rpc/user.js index e287309..090d9bf 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(_0x587555,_0x3f5949){var _0xf1bc0f=function(_0x169d79){while(--_0x169d79){_0x587555['push'](_0x587555['shift']());}};_0xf1bc0f(++_0x3f5949);}(_0xa9e0,0x123));var _0x0a9e=function(_0x373dee,_0x1a8c45){_0x373dee=_0x373dee-0x0;var _0x46798f=_0xa9e0[_0x373dee];return _0x46798f;};'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(_0x1716ce,_0x3c5752){var _0x4bd4a8=function(_0x588ce2){while(--_0x588ce2){_0x1716ce['push'](_0x1716ce['shift']());}};_0x4bd4a8(++_0x3c5752);}(_0xa9e0,0x123));var _0x0a9e=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xa9e0[_0x501510];return _0x1e6ee5;};'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 d12cc22..7248a02 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 _0xb2ac=['Request','UpdateWhatsappInteraction','addTags','AddTagsToWhatsappInteraction','addTagsToWhatsappInteraction','../client','update'];(function(_0x2f103d,_0x5d816e){var _0x5ef1ec=function(_0x2847ab){while(--_0x2847ab){_0x2f103d['push'](_0x2f103d['shift']());}};_0x5ef1ec(++_0x5d816e);}(_0xb2ac,0x16a));var _0xcb2a=function(_0x121000,_0xc77d08){_0x121000=_0x121000-0x0;var _0xd7b84b=_0xb2ac[_0x121000];return _0xd7b84b;};'use strict';var client=require(_0xcb2a('0x0'));exports[_0xcb2a('0x1')]=function(_0x27a49a,_0x18a01a){return client[_0xcb2a('0x2')](_0xcb2a('0x3'),{'body':_0x18a01a,'options':{'where':{'id':_0x27a49a}},'log':'updateWhatsappInteraction'});};exports[_0xcb2a('0x4')]=function(_0x19c4aa,_0x3fa7c3){return client[_0xcb2a('0x2')](_0xcb2a('0x5'),{'body':_0x3fa7c3,'options':{'where':{'id':_0x19c4aa}},'log':_0xcb2a('0x6')});}; \ No newline at end of file +var _0xba34=['addTagsToWhatsappInteraction','../client','update','Request','AddTagsToWhatsappInteraction'];(function(_0x43b08,_0x15f967){var _0x5e05f4=function(_0x4bb0cb){while(--_0x4bb0cb){_0x43b08['push'](_0x43b08['shift']());}};_0x5e05f4(++_0x15f967);}(_0xba34,0x119));var _0x4ba3=function(_0x15805d,_0x4a1617){_0x15805d=_0x15805d-0x0;var _0x2720c4=_0xba34[_0x15805d];return _0x2720c4;};'use strict';var client=require(_0x4ba3('0x0'));exports[_0x4ba3('0x1')]=function(_0xb04f7b,_0x146253){return client[_0x4ba3('0x2')]('UpdateWhatsappInteraction',{'body':_0x146253,'options':{'where':{'id':_0xb04f7b}},'log':'updateWhatsappInteraction'});};exports['addTags']=function(_0x4592fc,_0x2947f2){return client[_0x4ba3('0x2')](_0x4ba3('0x3'),{'body':_0x2947f2,'options':{'where':{'id':_0x4592fc}},'log':_0x4ba3('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappMessage.js b/server/services/routing/rpc/whatsappMessage.js index fffa9d2..732e8e3 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 _0xd616=['CreateWhatsappMessage','create'];(function(_0x4d3e97,_0x749913){var _0x3147d7=function(_0x250599){while(--_0x250599){_0x4d3e97['push'](_0x4d3e97['shift']());}};_0x3147d7(++_0x749913);}(_0xd616,0x195));var _0x6d61=function(_0x3c1b2d,_0x23b1b9){_0x3c1b2d=_0x3c1b2d-0x0;var _0x412475=_0xd616[_0x3c1b2d];return _0x412475;};'use strict';var client=require('../client');exports[_0x6d61('0x0')]=function(_0x10d3d4){return client['Request'](_0x6d61('0x1'),{'body':_0x10d3d4,'log':'createWhatsappMessage'});}; \ No newline at end of file +var _0xe270=['Request','createWhatsappMessage','../client'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0xe270,0x149));var _0x0e27=function(_0x348c09,_0x539458){_0x348c09=_0x348c09-0x0;var _0x22d339=_0xe270[_0x348c09];return _0x22d339;};'use strict';var client=require(_0x0e27('0x0'));exports['create']=function(_0x35c971){return client[_0x0e27('0x1')]('CreateWhatsappMessage',{'body':_0x35c971,'log':_0x0e27('0x2')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueue.js b/server/services/routing/rpc/whatsappQueue.js index 7473869..610b84f 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 _0x125d=['Request','GetWhatsappQueue','name','timeout','User','Agents','online','../client'];(function(_0x2d23d8,_0x282177){var _0x41ae52=function(_0x2bd658){while(--_0x2bd658){_0x2d23d8['push'](_0x2d23d8['shift']());}};_0x41ae52(++_0x282177);}(_0x125d,0xdf));var _0xd125=function(_0xeeb42e,_0x477a46){_0xeeb42e=_0xeeb42e-0x0;var _0x5a17e9=_0x125d[_0xeeb42e];return _0x5a17e9;};'use strict';var client=require(_0xd125('0x0'));exports['getWhatsappQueues']=function(){return function(){return client[_0xd125('0x1')](_0xd125('0x2'),{'options':{'raw':![],'attributes':['id',_0xd125('0x3'),_0xd125('0x4'),'strategy'],'include':[{'model':_0xd125('0x5'),'as':_0xd125('0x6'),'attributes':['id',_0xd125('0x3'),_0xd125('0x7'),'whatsappPause']}]},'log':'getWhatsappQueues'});};}; \ No newline at end of file +var _0x9864=['Request','GetWhatsappQueue','name','User','whatsappPause','../client','getWhatsappQueues'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x9864,0x1cc));var _0x4986=function(_0x2589e2,_0x115179){_0x2589e2=_0x2589e2-0x0;var _0x320168=_0x9864[_0x2589e2];return _0x320168;};'use strict';var client=require(_0x4986('0x0'));exports[_0x4986('0x1')]=function(){return function(){return client[_0x4986('0x2')](_0x4986('0x3'),{'options':{'raw':![],'attributes':['id',_0x4986('0x4'),'timeout','strategy'],'include':[{'model':_0x4986('0x5'),'as':'Agents','attributes':['id',_0x4986('0x4'),'online',_0x4986('0x6')]}]},'log':_0x4986('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueueReport.js b/server/services/routing/rpc/whatsappQueueReport.js index d889ce7..77d891d 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 _0x0f24=['update','UpdateWhatsappQueueReport','DESC','Request','CreateWhatsappQueueReport'];(function(_0x5a9c0c,_0x4ec485){var _0x53c77d=function(_0x1cf384){while(--_0x1cf384){_0x5a9c0c['push'](_0x5a9c0c['shift']());}};_0x53c77d(++_0x4ec485);}(_0x0f24,0x7b));var _0x40f2=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x0f24[_0x14add3];return _0x4a174f;};'use strict';var client=require('../client');exports['create']=function(_0x4e5829){return client[_0x40f2('0x0')](_0x40f2('0x1'),{'body':_0x4e5829,'log':_0x40f2('0x1')});};exports[_0x40f2('0x2')]=function(_0x21e1aa,_0x2424db){return client[_0x40f2('0x0')](_0x40f2('0x3'),{'body':_0x2424db,'options':{'where':{'uniqueid':_0x21e1aa},'order':[['id',_0x40f2('0x4')]],'limit':0x1},'log':_0x40f2('0x3')});}; \ No newline at end of file +var _0x4b74=['../client','create','CreateWhatsappQueueReport','Request','UpdateWhatsappQueueReport','DESC'];(function(_0x6786a9,_0x481906){var _0x5228c9=function(_0x4c3169){while(--_0x4c3169){_0x6786a9['push'](_0x6786a9['shift']());}};_0x5228c9(++_0x481906);}(_0x4b74,0x72));var _0x44b7=function(_0x588909,_0x520934){_0x588909=_0x588909-0x0;var _0x40b7be=_0x4b74[_0x588909];return _0x40b7be;};'use strict';var client=require(_0x44b7('0x0'));exports[_0x44b7('0x1')]=function(_0x8aa64e){return client['Request'](_0x44b7('0x2'),{'body':_0x8aa64e,'log':_0x44b7('0x2')});};exports['update']=function(_0x54076e,_0x16074d){return client[_0x44b7('0x3')](_0x44b7('0x4'),{'body':_0x16074d,'options':{'where':{'uniqueid':_0x54076e},'order':[['id',_0x44b7('0x5')]],'limit':0x1},'log':_0x44b7('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/server/applications/agent.js b/server/services/routing/server/applications/agent.js index b7588aa..bd0a5bb 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 _0xa1ca=['validate','lodash','util','seq-queue','number','timeout\x20is\x20a\x20number','info','format','[%s][AGENT][NAME:%s][STATUS:%s]','name','toLowerCase','consequence','length','[%s][AGENT]\x20%s','map','message','join','agents','timeout','createQueue','channel','close','rules','stop','complete','error','[%s][AGENT]\x20agent\x20not\x20found\x20%s','log','[%s][QUEUE]\x20%s','stack'];(function(_0x514a88,_0x4b1abe){var _0x3e2679=function(_0x1454fb){while(--_0x1454fb){_0x514a88['push'](_0x514a88['shift']());}};_0x3e2679(++_0x4b1abe);}(_0xa1ca,0x1c2));var _0xaa1c=function(_0x47b63a,_0x3a3c6f){_0x47b63a=_0x47b63a-0x0;var _0x19e9ce=_0xa1ca[_0x47b63a];return _0x19e9ce;};'use strict';var schema=require(_0xaa1c('0x0'));var _=require(_0xaa1c('0x1'));var util=require(_0xaa1c('0x2'));var seqqueue=require(_0xaa1c('0x3'));var logger=require('../../../../config/logger')('routing');var strategy=require('./strategy');var queue=schema({'name':{'type':'string','required':!![],'message':'name\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'timeout':{'type':_0xaa1c('0x4'),'message':_0xaa1c('0x5')}});function writeLog(_0x13d69e,_0x5e698d,_0x1e8a7e){return logger[_0xaa1c('0x6')](util[_0xaa1c('0x7')](_0xaa1c('0x8'),_0x13d69e,_0x5e698d[_0xaa1c('0x9')],_0x1e8a7e));}function handleFindAgent(_0x33e036){return function(_0x4a4900){return _0x4a4900[_0xaa1c('0x9')]['toLowerCase']()===_0x33e036[_0xaa1c('0xa')]();};}exports[_0xaa1c('0xb')]=function(_0x4225d1,_0x9bae9c,_0x46fc14,_0x4d98d1){return function(_0x1c4f65){try{var _0x4931ca={'name':_0x9bae9c[0x0],'timeout':_0x9bae9c[0x1]};var _0x1abd40=queue[_0xaa1c('0x0')](_0x4931ca,{'typecast':!![]});if(_0x1abd40[_0xaa1c('0xc')]){logger['error'](_0xaa1c('0xd'),_0x4225d1,_[_0xaa1c('0xe')](_0x1abd40,_0xaa1c('0xf'))[_0xaa1c('0x10')](',\x20'));_0x1c4f65['stop']();}else{var _0x6336d1=_['find'](_0x46fc14[_0xaa1c('0x11')],handleFindAgent(_0x4931ca[_0xaa1c('0x9')]));if(_0x6336d1){var _0x304850=(_0x4931ca[_0xaa1c('0x12')]||0xa)*0x3e8;var _0x31fa5f,_0x30163f;var _0x5d5fbf=seqqueue[_0xaa1c('0x13')](_0x304850);_0x5d5fbf['id']=_0x4225d1;_0x5d5fbf['atimeout']=_0x304850;_0x5d5fbf['channel']=_0x4d98d1[_0xaa1c('0x14')];writeLog(_0x4225d1,_0x6336d1,util[_0xaa1c('0x7')]('START:%s',_0x304850));_0x46fc14['rules'][_0x4225d1]['on']('end',function(){logger[_0xaa1c('0x6')]('[%s][AGENT]\x20ROUTING\x20STOPPED',_0x4225d1);clearTimeout(_0x30163f);_0x30163f=undefined;_0x5d5fbf[_0xaa1c('0x15')]();if(_0x46fc14['rules'][_0x4225d1]){delete _0x46fc14[_0xaa1c('0x16')][_0x4225d1];}_0x1c4f65[_0xaa1c('0x17')]();});_0x46fc14[_0xaa1c('0x16')][_0x4225d1]['on'](_0xaa1c('0x18'),function(){if(_0x46fc14[_0xaa1c('0x16')][_0x4225d1]){delete _0x46fc14[_0xaa1c('0x16')][_0x4225d1];}});_0x30163f=setTimeout(function(){logger['info']('[%s][AGENT]\x20ROUTING\x20END',_0x4225d1);clearTimeout(_0x30163f);_0x5d5fbf[_0xaa1c('0x15')]();_0x1c4f65['next']();},_0x304850);strategy['agent'](_0x5d5fbf,_0x6336d1,_0x46fc14,_0x4d98d1);}else{logger[_0xaa1c('0x19')](_0xaa1c('0x1a'),_0x4225d1,_0x4931ca[_0xaa1c('0x9')]);_0x1c4f65['stop']();}}}catch(_0x1e8d2d){console[_0xaa1c('0x1b')](_0x1e8d2d);logger[_0xaa1c('0x19')](_0xaa1c('0x1c'),_0x4225d1,_0x1e8d2d[_0xaa1c('0x1d')]);_0x1c4f65['stop']();}};}; \ No newline at end of file +var _0x8001=['[%s][AGENT]\x20%s','map','find','agents','timeout','createQueue','atimeout','channel','START:%s','rules','close','complete','next','[%s][AGENT]\x20agent\x20not\x20found\x20%s','[%s][QUEUE]\x20%s','stack','stop','validate','lodash','util','../../../../config/logger','routing','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','info','format','[%s][AGENT][NAME:%s][STATUS:%s]','name','toLowerCase','error'];(function(_0x4c315a,_0x187fc3){var _0x2310d8=function(_0x35006d){while(--_0x35006d){_0x4c315a['push'](_0x4c315a['shift']());}};_0x2310d8(++_0x187fc3);}(_0x8001,0xc5));var _0x1800=function(_0x36eab0,_0x1f2bfb){_0x36eab0=_0x36eab0-0x0;var _0x3f457a=_0x8001[_0x36eab0];return _0x3f457a;};'use strict';var schema=require(_0x1800('0x0'));var _=require(_0x1800('0x1'));var util=require(_0x1800('0x2'));var seqqueue=require('seq-queue');var logger=require(_0x1800('0x3'))(_0x1800('0x4'));var strategy=require('./strategy');var queue=schema({'name':{'type':'string','required':!![],'message':_0x1800('0x5')},'timeout':{'type':_0x1800('0x6'),'message':'timeout\x20is\x20a\x20number'}});function writeLog(_0x3bde37,_0x67233a,_0x3fe6d3){return logger[_0x1800('0x7')](util[_0x1800('0x8')](_0x1800('0x9'),_0x3bde37,_0x67233a[_0x1800('0xa')],_0x3fe6d3));}function handleFindAgent(_0x2dff46){return function(_0x865ea){return _0x865ea[_0x1800('0xa')]['toLowerCase']()===_0x2dff46[_0x1800('0xb')]();};}exports['consequence']=function(_0x17e789,_0x18952d,_0x2179b6,_0x554a08){return function(_0x1c7e3a){try{var _0x553b5b={'name':_0x18952d[0x0],'timeout':_0x18952d[0x1]};var _0x1f28a1=queue['validate'](_0x553b5b,{'typecast':!![]});if(_0x1f28a1['length']){logger[_0x1800('0xc')](_0x1800('0xd'),_0x17e789,_[_0x1800('0xe')](_0x1f28a1,'message')['join'](',\x20'));_0x1c7e3a['stop']();}else{var _0x23d202=_[_0x1800('0xf')](_0x2179b6[_0x1800('0x10')],handleFindAgent(_0x553b5b[_0x1800('0xa')]));if(_0x23d202){var _0x40bbbd=(_0x553b5b[_0x1800('0x11')]||0xa)*0x3e8;var _0x4fe42b,_0x169b79;var _0x43d966=seqqueue[_0x1800('0x12')](_0x40bbbd);_0x43d966['id']=_0x17e789;_0x43d966[_0x1800('0x13')]=_0x40bbbd;_0x43d966[_0x1800('0x14')]=_0x554a08['channel'];writeLog(_0x17e789,_0x23d202,util[_0x1800('0x8')](_0x1800('0x15'),_0x40bbbd));_0x2179b6[_0x1800('0x16')][_0x17e789]['on']('end',function(){logger['info']('[%s][AGENT]\x20ROUTING\x20STOPPED',_0x17e789);clearTimeout(_0x169b79);_0x169b79=undefined;_0x43d966[_0x1800('0x17')]();if(_0x2179b6['rules'][_0x17e789]){delete _0x2179b6['rules'][_0x17e789];}_0x1c7e3a['stop']();});_0x2179b6['rules'][_0x17e789]['on'](_0x1800('0x18'),function(){if(_0x2179b6[_0x1800('0x16')][_0x17e789]){delete _0x2179b6[_0x1800('0x16')][_0x17e789];}});_0x169b79=setTimeout(function(){logger['info']('[%s][AGENT]\x20ROUTING\x20END',_0x17e789);clearTimeout(_0x169b79);_0x43d966[_0x1800('0x17')]();_0x1c7e3a[_0x1800('0x19')]();},_0x40bbbd);strategy['agent'](_0x43d966,_0x23d202,_0x2179b6,_0x554a08);}else{logger[_0x1800('0xc')](_0x1800('0x1a'),_0x17e789,_0x553b5b[_0x1800('0xa')]);_0x1c7e3a['stop']();}}}catch(_0x30d842){console['log'](_0x30d842);logger[_0x1800('0xc')](_0x1800('0x1b'),_0x17e789,_0x30d842[_0x1800('0x1c')]);_0x1c7e3a[_0x1800('0x1d')]();}};}; \ 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 f8e3878..43a44ab 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 _0xd917=['toString','postText','amazonlex','providerResponse','dialogState','catch','../../../../config/logger','routing','../../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.','next','contact','format','out','channel','sms','whatsapp','phone','chat','ChatWebsiteId','account','upperFirst','InteractionId','created','body','getMustacheRender','Message','create','then','error','stringify','stop','LexRuntime','$LATEST','message'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xd917,0x16e));var _0x7d91=function(_0x49049c,_0x54def6){_0x49049c=_0x49049c-0x0;var _0x447139=_0xd917[_0x49049c];return _0x447139;};'use strict';var _=require('lodash');var moment=require('moment');var AWS=require('aws-sdk');var utils=require('./utils');var logger=require(_0x7d91('0x0'))(_0x7d91('0x1'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0x7d91('0x2')),'mailMessage':require(_0x7d91('0x3')),'smsMessage':require(_0x7d91('0x4')),'faxMessage':require(_0x7d91('0x5')),'whatsappMessage':require(_0x7d91('0x6'))};exports[_0x7d91('0x7')]=function(_0x425517,_0x115ee9){return function(_0x5616b2){try{if(!_[_0x7d91('0x8')](this[_0x7d91('0x9')][_0x7d91('0xa')])){logger[_0x7d91('0xb')](_0x7d91('0xc'),_0x425517,_0x7d91('0xd'));return _0x5616b2[_0x7d91('0xe')]();}var _0x31ee6b={'ContactId':this[_0x7d91('0xf')]['id'],'sentAt':moment()[_0x7d91('0x10')]('YYYY-MM-DD\x20HH:mm:ss'),'direction':_0x7d91('0x11')};if(this[_0x7d91('0x12')]===_0x7d91('0x13')||this[_0x7d91('0x12')]===_0x7d91('0x14')){_0x31ee6b[_0x7d91('0x15')]=this[_0x7d91('0x9')]['phone'];}var _0x2e2eca=this['channel'];if(_0x2e2eca===_0x7d91('0x16')){_0x31ee6b[_0x7d91('0x17')]=this[_0x7d91('0x18')]['id'];}else{_0x31ee6b[_[_0x7d91('0x19')](_0x2e2eca)+'AccountId']=this['account']['id'];}_0x31ee6b[_[_0x7d91('0x19')](_0x2e2eca)+_0x7d91('0x1a')]=this[_0x7d91('0x9')]['id'];if(this[_0x7d91('0x9')][_0x7d91('0x1b')]){var _0x2fd2a8=_0x115ee9[0x4];if(!_['isEmpty'](_0x2fd2a8)){_0x31ee6b[_0x7d91('0x1c')]=utils[_0x7d91('0x1d')](_0x2fd2a8,this);return rpc[_0x2e2eca+_0x7d91('0x1e')][_0x7d91('0x1f')](_0x31ee6b)[_0x7d91('0x20')](function(_0x5cbf9f){logger[_0x7d91('0xb')]('[%s][AMAZONLEX]\x20%s',_0x425517,_0x31ee6b[_0x7d91('0x1c')]);})['catch'](function(_0x542109){logger[_0x7d91('0x21')](_0x7d91('0xc'),_0x425517,JSON[_0x7d91('0x22')](_0x542109));})['finally'](function(){logger[_0x7d91('0xb')]('[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!',_0x425517);_0x5616b2['stop']();});}else{logger[_0x7d91('0xb')]('[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!',_0x425517);_0x5616b2[_0x7d91('0x23')]();}}else{var _0x2c7881=this;var _0x3d359c=new AWS[(_0x7d91('0x24'))]({'accessKeyId':_0x115ee9[0x0],'secretAccessKey':_0x115ee9[0x1],'region':_0x115ee9[0x2]});var _0x11b8c7={'botAlias':_0x7d91('0x25'),'botName':_0x115ee9[0x3],'inputText':this[_0x7d91('0x26')][_0x7d91('0x1c')],'userId':this[_0x7d91('0x12')]+':'+this[_0x7d91('0x9')]['id'][_0x7d91('0x27')]()};_0x3d359c[_0x7d91('0x28')](_0x11b8c7,function(_0x48c981,_0xc9733b){if(_0x48c981){logger[_0x7d91('0x21')](_0x7d91('0xc'),_0x425517,_0x48c981[_0x7d91('0x26')]);_0x5616b2['next']();}else if(_0xc9733b&&_0xc9733b[_0x7d91('0x26')]){_0x2c7881['body'][_0x7d91('0x29')]=_0xc9733b;_0x31ee6b[_0x7d91('0x1c')]=_0xc9733b[_0x7d91('0x26')];_0x31ee6b['providerName']='amazonlex';_0x31ee6b[_0x7d91('0x2a')]=JSON['stringify'](_0xc9733b);return rpc[_0x2e2eca+'Message'][_0x7d91('0x1f')](_0x31ee6b)[_0x7d91('0x20')](function(_0x44a4cb){logger[_0x7d91('0xb')]('[%s][AMAZONLEX]\x20%s',_0x425517,_0x31ee6b['body']);if(_0xc9733b[_0x7d91('0x2b')]=='Failed'){_0x5616b2[_0x7d91('0xe')]();}else{_0x5616b2[_0x7d91('0x23')]();}})[_0x7d91('0x2c')](function(_0x5018dd){logger[_0x7d91('0x21')](_0x7d91('0xc'),_0x425517,JSON['stringify'](_0x5018dd));_0x5616b2[_0x7d91('0xe')]();});}else{_0x5616b2[_0x7d91('0xe')]();}});}}catch(_0x514237){logger[_0x7d91('0x21')](_0x7d91('0xc'),_0x425517,JSON[_0x7d91('0x22')](_0x514237));_0x5616b2[_0x7d91('0x23')]();}};}; \ No newline at end of file +var _0xc4a4=['../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','isNil','info','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','out','channel','whatsapp','phone','interaction','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','created','body','getMustacheRender','Message','create','then','[%s][AMAZONLEX]\x20%s','error','finally','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','LexRuntime','$LATEST','message','toString','postText','amazonlex','providerName','stringify','dialogState','Failed','catch','lodash','moment','aws-sdk','./utils','../../../../config/logger','routing','../../rpc/openchannelMessage','../../rpc/mailMessage'];(function(_0x26d77c,_0xdd25a3){var _0x9d8f5c=function(_0x4a3cf4){while(--_0x4a3cf4){_0x26d77c['push'](_0x26d77c['shift']());}};_0x9d8f5c(++_0xdd25a3);}(_0xc4a4,0x188));var _0x4c4a=function(_0x256b72,_0x340985){_0x256b72=_0x256b72-0x0;var _0x2183e3=_0xc4a4[_0x256b72];return _0x2183e3;};'use strict';var _=require(_0x4c4a('0x0'));var moment=require(_0x4c4a('0x1'));var AWS=require(_0x4c4a('0x2'));var utils=require(_0x4c4a('0x3'));var logger=require(_0x4c4a('0x4'))(_0x4c4a('0x5'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0x4c4a('0x6')),'mailMessage':require(_0x4c4a('0x7')),'smsMessage':require(_0x4c4a('0x8')),'faxMessage':require(_0x4c4a('0x9')),'whatsappMessage':require(_0x4c4a('0xa'))};exports[_0x4c4a('0xb')]=function(_0x382c40,_0x2f6b2f){return function(_0x2a1dcf){try{if(!_[_0x4c4a('0xc')](this['interaction']['UserId'])){logger[_0x4c4a('0xd')]('[%s][AMAZONLEX]\x20%s',_0x382c40,_0x4c4a('0xe'));return _0x2a1dcf[_0x4c4a('0xf')]();}var _0x9fcb9={'ContactId':this[_0x4c4a('0x10')]['id'],'sentAt':moment()[_0x4c4a('0x11')]('YYYY-MM-DD\x20HH:mm:ss'),'direction':_0x4c4a('0x12')};if(this['channel']==='sms'||this[_0x4c4a('0x13')]===_0x4c4a('0x14')){_0x9fcb9[_0x4c4a('0x15')]=this[_0x4c4a('0x16')][_0x4c4a('0x15')];}var _0x5522e4=this[_0x4c4a('0x13')];if(_0x5522e4==='chat'){_0x9fcb9[_0x4c4a('0x17')]=this[_0x4c4a('0x18')]['id'];}else{_0x9fcb9[_[_0x4c4a('0x19')](_0x5522e4)+_0x4c4a('0x1a')]=this[_0x4c4a('0x18')]['id'];}_0x9fcb9[_[_0x4c4a('0x19')](_0x5522e4)+_0x4c4a('0x1b')]=this['interaction']['id'];if(this[_0x4c4a('0x16')][_0x4c4a('0x1c')]){var _0x18d997=_0x2f6b2f[0x4];if(!_['isEmpty'](_0x18d997)){_0x9fcb9[_0x4c4a('0x1d')]=utils[_0x4c4a('0x1e')](_0x18d997,this);return rpc[_0x5522e4+_0x4c4a('0x1f')][_0x4c4a('0x20')](_0x9fcb9)[_0x4c4a('0x21')](function(_0x38bc13){logger[_0x4c4a('0xd')](_0x4c4a('0x22'),_0x382c40,_0x9fcb9[_0x4c4a('0x1d')]);})['catch'](function(_0x53a1dd){logger[_0x4c4a('0x23')]('[%s][AMAZONLEX]\x20%s',_0x382c40,JSON['stringify'](_0x53a1dd));})[_0x4c4a('0x24')](function(){logger[_0x4c4a('0xd')](_0x4c4a('0x25'),_0x382c40);_0x2a1dcf[_0x4c4a('0x26')]();});}else{logger[_0x4c4a('0xd')]('[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!',_0x382c40);_0x2a1dcf[_0x4c4a('0x26')]();}}else{var _0x58a159=this;var _0x274b47=new AWS[(_0x4c4a('0x27'))]({'accessKeyId':_0x2f6b2f[0x0],'secretAccessKey':_0x2f6b2f[0x1],'region':_0x2f6b2f[0x2]});var _0x5bbb22={'botAlias':_0x4c4a('0x28'),'botName':_0x2f6b2f[0x3],'inputText':this[_0x4c4a('0x29')][_0x4c4a('0x1d')],'userId':this[_0x4c4a('0x13')]+':'+this[_0x4c4a('0x16')]['id'][_0x4c4a('0x2a')]()};_0x274b47[_0x4c4a('0x2b')](_0x5bbb22,function(_0x45924,_0xcd40b9){if(_0x45924){logger[_0x4c4a('0x23')](_0x4c4a('0x22'),_0x382c40,_0x45924[_0x4c4a('0x29')]);_0x2a1dcf['next']();}else if(_0xcd40b9&&_0xcd40b9[_0x4c4a('0x29')]){_0x58a159[_0x4c4a('0x1d')][_0x4c4a('0x2c')]=_0xcd40b9;_0x9fcb9[_0x4c4a('0x1d')]=_0xcd40b9[_0x4c4a('0x29')];_0x9fcb9[_0x4c4a('0x2d')]=_0x4c4a('0x2c');_0x9fcb9['providerResponse']=JSON[_0x4c4a('0x2e')](_0xcd40b9);return rpc[_0x5522e4+_0x4c4a('0x1f')][_0x4c4a('0x20')](_0x9fcb9)['then'](function(_0x2c37d3){logger[_0x4c4a('0xd')](_0x4c4a('0x22'),_0x382c40,_0x9fcb9['body']);if(_0xcd40b9[_0x4c4a('0x2f')]==_0x4c4a('0x30')){_0x2a1dcf[_0x4c4a('0xf')]();}else{_0x2a1dcf[_0x4c4a('0x26')]();}})[_0x4c4a('0x31')](function(_0x179a4d){logger[_0x4c4a('0x23')](_0x4c4a('0x22'),_0x382c40,JSON[_0x4c4a('0x2e')](_0x179a4d));_0x2a1dcf[_0x4c4a('0xf')]();});}else{_0x2a1dcf[_0x4c4a('0xf')]();}});}}catch(_0x3293b9){logger[_0x4c4a('0x23')](_0x4c4a('0x22'),_0x382c40,JSON[_0x4c4a('0x2e')](_0x3293b9));_0x2a1dcf[_0x4c4a('0x26')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/autoreply.js b/server/services/routing/server/applications/autoreply.js index 57eb09b..3b78c88 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 _0xb7d8=['upperFirst','AccountId','InteractionId','Message','inReplyTo','messageId','html','','replace','','headers','auto-replied','All','auto_reply','smtpOptions','[%s][AUTOREPLY]\x20SMTP\x20SENT','create','then','stringify','error','[RPC][%s][AUTOREPLY]\x20%s','resolve','Interaction','catch','finally','update','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','lodash','moment','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','channel','mail','isAutoreply','info','Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)','interaction','created','[%s][AUTOREPLY]\x20%s','Autoreply\x20already\x20sent','next','autoreplyExecuted','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','One\x20Time\x20already\x20sent','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','getMustacheRender','body','message','from','phone','subject','Re:','Re:\x20','chat','ChatWebsiteId','account'];(function(_0x31efe7,_0x52fe9e){var _0x24b6ee=function(_0x65ae94){while(--_0x65ae94){_0x31efe7['push'](_0x31efe7['shift']());}};_0x24b6ee(++_0x52fe9e);}(_0xb7d8,0xab));var _0x8b7d=function(_0x29b161,_0x4d2dc6){_0x29b161=_0x29b161-0x0;var _0x500a58=_0xb7d8[_0x29b161];return _0x500a58;};'use strict';var _=require(_0x8b7d('0x0'));var moment=require(_0x8b7d('0x1'));var utils=require(_0x8b7d('0x2'));var logger=require(_0x8b7d('0x3'))(_0x8b7d('0x4'));var rpc={'chatMessage':require(_0x8b7d('0x5')),'openchannelMessage':require(_0x8b7d('0x6')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0x8b7d('0x7')),'faxMessage':require(_0x8b7d('0x8')),'whatsappMessage':require('../../rpc/whatsappMessage'),'chatInteraction':require(_0x8b7d('0x9')),'openchannelInteraction':require(_0x8b7d('0xa')),'mailInteraction':require('../../rpc/mailInteraction'),'smsInteraction':require(_0x8b7d('0xb')),'faxInteraction':require(_0x8b7d('0xc')),'whatsappInteraction':require(_0x8b7d('0xd'))};var mailRpc=require('../../mailRpc');exports['consequence']=function(_0x26e945,_0x2fd75f,_0x495961,_0x57e5c1){return function(_0x6cb85){try{var _0x2b65ef=this[_0x8b7d('0xe')];if(_0x2b65ef===_0x8b7d('0xf')&&_0x57e5c1['body'][_0x8b7d('0x10')]){logger[_0x8b7d('0x11')]('[%s][AUTOREPLY]\x20%s',_0x26e945,_0x8b7d('0x12'));return _0x6cb85['next']();}if(_0x2fd75f[0x0]==='1'&&(_['isNil'](this[_0x8b7d('0x13')]['created'])||!this[_0x8b7d('0x13')][_0x8b7d('0x14')])){logger[_0x8b7d('0x11')](_0x8b7d('0x15'),_0x26e945,_0x8b7d('0x16'));return _0x6cb85[_0x8b7d('0x17')]();}if(_0x2fd75f[0x0]==='2'&&this[_0x8b7d('0x13')][_0x8b7d('0x18')]){logger[_0x8b7d('0x11')](_0x8b7d('0x19'),_0x26e945,_0x8b7d('0x1a'));return _0x6cb85[_0x8b7d('0x17')]();}var _0x590e9e={'ContactId':this[_0x8b7d('0x1b')]['id'],'sentAt':moment()[_0x8b7d('0x1c')](_0x8b7d('0x1d')),'direction':_0x8b7d('0x1e')};if(this['channel']===_0x8b7d('0xf')){_0x590e9e['body']=utils[_0x8b7d('0x1f')](_0x2fd75f[0x2],this);}else{_0x590e9e[_0x8b7d('0x20')]=utils[_0x8b7d('0x1f')](_0x2fd75f[0x1],this);}if(this[_0x8b7d('0x21')]){_0x590e9e['to']=this['message'][_0x8b7d('0x22')]||'';if(this['channel']===_0x8b7d('0xf')&&_0x2fd75f[0x1]==='1'){_0x590e9e['cc']=this[_0x8b7d('0x21')]['cc']||'';}_0x590e9e[_0x8b7d('0x22')]=this[_0x8b7d('0x21')]['to']||'';_0x590e9e[_0x8b7d('0x23')]=this[_0x8b7d('0x21')][_0x8b7d('0x23')]||'';_0x590e9e['read']=!![];if(this[_0x8b7d('0x21')]['subject']){_0x590e9e['subject']='';_0x590e9e[_0x8b7d('0x24')]+=_['startsWith'](this[_0x8b7d('0x21')][_0x8b7d('0x24')],_0x8b7d('0x25'))?'':_0x8b7d('0x26');_0x590e9e['subject']+=this[_0x8b7d('0x21')]['subject'];}}if(this[_0x8b7d('0xe')]===_0x8b7d('0x27')){_0x590e9e[_0x8b7d('0x28')]=this[_0x8b7d('0x29')]['id'];}else{_0x590e9e[_[_0x8b7d('0x2a')](this[_0x8b7d('0xe')])+_0x8b7d('0x2b')]=this[_0x8b7d('0x29')]['id'];}_0x590e9e[_['upperFirst'](this[_0x8b7d('0xe')])+_0x8b7d('0x2c')]=this[_0x8b7d('0x13')]['id'];var _0x3b597f=this[_0x8b7d('0x13')];if(rpc[this[_0x8b7d('0xe')]+_0x8b7d('0x2d')]){if(this[_0x8b7d('0xe')]==='mail'){_0x590e9e[_0x8b7d('0x2e')]=this['message'][_0x8b7d('0x2f')];_0x590e9e[_0x8b7d('0x30')]=_0x8b7d('0x31')+_[_0x8b7d('0x32')](_0x590e9e[_0x8b7d('0x20')],_0x8b7d('0x33'),_0x8b7d('0x34'))+_0x8b7d('0x35');_0x590e9e[_0x8b7d('0x36')]={'Auto-Submitted':_0x8b7d('0x37'),'X-Auto-Response-Suppress':_0x8b7d('0x38'),'Precedence':_0x8b7d('0x39')};return mailRpc['sendMailMessage'](this[_0x8b7d('0x29')][_0x8b7d('0x3a')],_0x590e9e)['then'](function(_0x40b8fd){logger['info'](_0x8b7d('0x3b'),_0x26e945);_0x590e9e[_0x8b7d('0x2f')]=_0x40b8fd['message'][_0x8b7d('0x2f')];return rpc[_0x2b65ef+'Message'][_0x8b7d('0x3c')](_0x590e9e);})[_0x8b7d('0x3d')](function(_0xc707dd){logger[_0x8b7d('0x11')](_0x8b7d('0x15'),_0x26e945,JSON[_0x8b7d('0x3e')](_0xc707dd));})['catch'](function(_0x3bac69){logger[_0x8b7d('0x3f')](_0x8b7d('0x40'),_0x26e945,JSON[_0x8b7d('0x3e')](_0x3bac69));})['finally'](function(){Promise[_0x8b7d('0x41')]()[_0x8b7d('0x3d')](function(){if(_0x2fd75f[0x0]!=='2'||_0x3b597f[_0x8b7d('0x18')])return;return rpc[_0x2b65ef+_0x8b7d('0x42')]['update'](_0x3b597f['id'],{'autoreplyExecuted':!![]})[_0x8b7d('0x3d')](function(_0x5a73fd){logger[_0x8b7d('0x11')](_0x8b7d('0x19'),_0x26e945,JSON['stringify'](_0x5a73fd));})[_0x8b7d('0x43')](function(_0x4dcec3){logger[_0x8b7d('0x3f')]('[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x26e945,JSON[_0x8b7d('0x3e')](_0x4dcec3));});})[_0x8b7d('0x3d')](function(){_0x6cb85['next']();});});}else{return rpc[this['channel']+_0x8b7d('0x2d')][_0x8b7d('0x3c')](_0x590e9e)['then'](function(){logger['info'](_0x8b7d('0x15'),_0x26e945,_0x590e9e[_0x8b7d('0x20')]);})[_0x8b7d('0x43')](function(_0x386127){logger[_0x8b7d('0x3f')](_0x8b7d('0x15'),_0x26e945,JSON[_0x8b7d('0x3e')](_0x386127));})[_0x8b7d('0x44')](function(){Promise['resolve']()[_0x8b7d('0x3d')](function(){if(_0x2fd75f[0x0]!=='2'||_0x3b597f['autoreplyExecuted'])return;return rpc[_0x2b65ef+_0x8b7d('0x42')][_0x8b7d('0x45')](_0x3b597f['id'],{'autoreplyExecuted':!![]})[_0x8b7d('0x3d')](function(_0x11efc6){logger[_0x8b7d('0x11')](_0x8b7d('0x19'),_0x26e945,JSON[_0x8b7d('0x3e')](_0x11efc6));})[_0x8b7d('0x43')](function(_0x345361){logger[_0x8b7d('0x3f')](_0x8b7d('0x46'),_0x26e945,JSON[_0x8b7d('0x3e')](_0x345361));});})[_0x8b7d('0x3d')](function(){_0x6cb85[_0x8b7d('0x17')]();});});}}}catch(_0x4921f5){logger['error']('[%s][AUTOREPLY]\x20%s',_0x26e945,JSON[_0x8b7d('0x3e')](_0x4921f5));_0x6cb85['stop']();}};}; \ No newline at end of file +var _0x62dd=['[RPC][%s][AUTOREPLY]\x20%s','resolve','Interaction','catch','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','create','finally','update','stop','lodash','./utils','../../../../config/logger','../../rpc/openchannelMessage','../../rpc/whatsappMessage','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/mailInteraction','../../rpc/smsInteraction','../../mailRpc','consequence','channel','mail','body','isAutoreply','info','Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)','next','isNil','created','interaction','Autoreply\x20already\x20sent','autoreplyExecuted','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','One\x20Time\x20already\x20sent','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','getMustacheRender','message','from','phone','read','subject','Re:','ChatWebsiteId','account','upperFirst','inReplyTo','messageId','html','','replace','','headers','auto-replied','All','auto_reply','smtpOptions','then','[%s][AUTOREPLY]\x20SMTP\x20SENT','Message','[%s][AUTOREPLY]\x20%s','stringify','error'];(function(_0x54ce75,_0xf87395){var _0x1be166=function(_0x3f0d4e){while(--_0x3f0d4e){_0x54ce75['push'](_0x54ce75['shift']());}};_0x1be166(++_0xf87395);}(_0x62dd,0xd2));var _0xd62d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x62dd[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xd62d('0x0'));var moment=require('moment');var utils=require(_0xd62d('0x1'));var logger=require(_0xd62d('0x2'))('routing');var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0xd62d('0x3')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require(_0xd62d('0x4')),'chatInteraction':require(_0xd62d('0x5')),'openchannelInteraction':require(_0xd62d('0x6')),'mailInteraction':require(_0xd62d('0x7')),'smsInteraction':require(_0xd62d('0x8')),'faxInteraction':require('../../rpc/faxInteraction'),'whatsappInteraction':require('../../rpc/whatsappInteraction')};var mailRpc=require(_0xd62d('0x9'));exports[_0xd62d('0xa')]=function(_0x3fee6d,_0x36a5f3,_0x2c3a1d,_0xefed31){return function(_0xf3a6af){try{var _0x2fef7b=this[_0xd62d('0xb')];if(_0x2fef7b===_0xd62d('0xc')&&_0xefed31[_0xd62d('0xd')][_0xd62d('0xe')]){logger[_0xd62d('0xf')]('[%s][AUTOREPLY]\x20%s',_0x3fee6d,_0xd62d('0x10'));return _0xf3a6af[_0xd62d('0x11')]();}if(_0x36a5f3[0x0]==='1'&&(_[_0xd62d('0x12')](this['interaction'][_0xd62d('0x13')])||!this[_0xd62d('0x14')]['created'])){logger[_0xd62d('0xf')]('[%s][AUTOREPLY]\x20%s',_0x3fee6d,_0xd62d('0x15'));return _0xf3a6af[_0xd62d('0x11')]();}if(_0x36a5f3[0x0]==='2'&&this['interaction'][_0xd62d('0x16')]){logger[_0xd62d('0xf')](_0xd62d('0x17'),_0x3fee6d,_0xd62d('0x18'));return _0xf3a6af['next']();}var _0x1e0d65={'ContactId':this[_0xd62d('0x19')]['id'],'sentAt':moment()[_0xd62d('0x1a')](_0xd62d('0x1b')),'direction':_0xd62d('0x1c')};if(this['channel']===_0xd62d('0xc')){_0x1e0d65[_0xd62d('0xd')]=utils[_0xd62d('0x1d')](_0x36a5f3[0x2],this);}else{_0x1e0d65[_0xd62d('0xd')]=utils[_0xd62d('0x1d')](_0x36a5f3[0x1],this);}if(this['message']){_0x1e0d65['to']=this[_0xd62d('0x1e')][_0xd62d('0x1f')]||'';if(this[_0xd62d('0xb')]===_0xd62d('0xc')&&_0x36a5f3[0x1]==='1'){_0x1e0d65['cc']=this['message']['cc']||'';}_0x1e0d65[_0xd62d('0x1f')]=this['message']['to']||'';_0x1e0d65[_0xd62d('0x20')]=this['message'][_0xd62d('0x20')]||'';_0x1e0d65[_0xd62d('0x21')]=!![];if(this[_0xd62d('0x1e')][_0xd62d('0x22')]){_0x1e0d65['subject']='';_0x1e0d65[_0xd62d('0x22')]+=_['startsWith'](this[_0xd62d('0x1e')][_0xd62d('0x22')],_0xd62d('0x23'))?'':'Re:\x20';_0x1e0d65[_0xd62d('0x22')]+=this['message'][_0xd62d('0x22')];}}if(this['channel']==='chat'){_0x1e0d65[_0xd62d('0x24')]=this[_0xd62d('0x25')]['id'];}else{_0x1e0d65[_[_0xd62d('0x26')](this['channel'])+'AccountId']=this[_0xd62d('0x25')]['id'];}_0x1e0d65[_[_0xd62d('0x26')](this['channel'])+'InteractionId']=this[_0xd62d('0x14')]['id'];var _0xe923ce=this[_0xd62d('0x14')];if(rpc[this[_0xd62d('0xb')]+'Message']){if(this['channel']==='mail'){_0x1e0d65[_0xd62d('0x27')]=this[_0xd62d('0x1e')][_0xd62d('0x28')];_0x1e0d65[_0xd62d('0x29')]=_0xd62d('0x2a')+_[_0xd62d('0x2b')](_0x1e0d65[_0xd62d('0xd')],_0xd62d('0x2c'),_0xd62d('0x2d'))+_0xd62d('0x2e');_0x1e0d65[_0xd62d('0x2f')]={'Auto-Submitted':_0xd62d('0x30'),'X-Auto-Response-Suppress':_0xd62d('0x31'),'Precedence':_0xd62d('0x32')};return mailRpc['sendMailMessage'](this['account'][_0xd62d('0x33')],_0x1e0d65)[_0xd62d('0x34')](function(_0xe3864a){logger[_0xd62d('0xf')](_0xd62d('0x35'),_0x3fee6d);_0x1e0d65[_0xd62d('0x28')]=_0xe3864a[_0xd62d('0x1e')][_0xd62d('0x28')];return rpc[_0x2fef7b+_0xd62d('0x36')]['create'](_0x1e0d65);})[_0xd62d('0x34')](function(_0x3c8113){logger['info'](_0xd62d('0x37'),_0x3fee6d,JSON[_0xd62d('0x38')](_0x3c8113));})['catch'](function(_0x10859d){logger[_0xd62d('0x39')](_0xd62d('0x3a'),_0x3fee6d,JSON[_0xd62d('0x38')](_0x10859d));})['finally'](function(){Promise[_0xd62d('0x3b')]()[_0xd62d('0x34')](function(){if(_0x36a5f3[0x0]!=='2'||_0xe923ce[_0xd62d('0x16')])return;return rpc[_0x2fef7b+_0xd62d('0x3c')]['update'](_0xe923ce['id'],{'autoreplyExecuted':!![]})[_0xd62d('0x34')](function(_0x2c100a){logger['info']('[%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x3fee6d,JSON[_0xd62d('0x38')](_0x2c100a));})[_0xd62d('0x3d')](function(_0xe5bc66){logger[_0xd62d('0x39')](_0xd62d('0x3e'),_0x3fee6d,JSON[_0xd62d('0x38')](_0xe5bc66));});})['then'](function(){_0xf3a6af[_0xd62d('0x11')]();});});}else{return rpc[this['channel']+_0xd62d('0x36')][_0xd62d('0x3f')](_0x1e0d65)['then'](function(){logger['info']('[%s][AUTOREPLY]\x20%s',_0x3fee6d,_0x1e0d65['body']);})[_0xd62d('0x3d')](function(_0x32bb9e){logger[_0xd62d('0x39')](_0xd62d('0x37'),_0x3fee6d,JSON[_0xd62d('0x38')](_0x32bb9e));})[_0xd62d('0x40')](function(){Promise[_0xd62d('0x3b')]()['then'](function(){if(_0x36a5f3[0x0]!=='2'||_0xe923ce[_0xd62d('0x16')])return;return rpc[_0x2fef7b+_0xd62d('0x3c')][_0xd62d('0x41')](_0xe923ce['id'],{'autoreplyExecuted':!![]})[_0xd62d('0x34')](function(_0x3d7b52){logger[_0xd62d('0xf')](_0xd62d('0x17'),_0x3fee6d,JSON[_0xd62d('0x38')](_0x3d7b52));})[_0xd62d('0x3d')](function(_0x16e52d){logger[_0xd62d('0x39')]('[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x3fee6d,JSON['stringify'](_0x16e52d));});})[_0xd62d('0x34')](function(){_0xf3a6af['next']();});});}}}catch(_0x29b59f){logger[_0xd62d('0x39')](_0xd62d('0x37'),_0x3fee6d,JSON[_0xd62d('0x38')](_0x29b59f));_0xf3a6af[_0xd62d('0x42')]();}};}; \ 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 74f0895..cc63a43 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 _0xbff1=['../../rpc/smsInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','consequence','[%s][CLOSE]\x20reason\x20%s','YYYY-MM-DD\x20HH:mm:ss','channel','update','interaction','then','info','[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!','[%s][CLOSE]\x20%s','stringify','moment','routing','../../rpc/openchannelInteraction'];(function(_0x9e0cb3,_0x9cd497){var _0x5926b7=function(_0x30e82d){while(--_0x30e82d){_0x9e0cb3['push'](_0x9e0cb3['shift']());}};_0x5926b7(++_0x9cd497);}(_0xbff1,0x1d9));var _0x1bff=function(_0x567b96,_0x1e9957){_0x567b96=_0x567b96-0x0;var _0x53e9be=_0xbff1[_0x567b96];return _0x53e9be;};'use strict';var moment=require(_0x1bff('0x0'));var logger=require('../../../../config/logger')(_0x1bff('0x1'));var rpc={'chatInteraction':require('../../rpc/chatInteraction'),'openchannelInteraction':require(_0x1bff('0x2')),'smsInteraction':require(_0x1bff('0x3')),'mailInteraction':require('../../rpc/mailInteraction'),'faxInteraction':require(_0x1bff('0x4')),'whatsappInteraction':require(_0x1bff('0x5'))};exports[_0x1bff('0x6')]=function(_0x3349b8,_0xfc63d1,_0x3e4c50,_0x5f1173){return function(_0xbac331){try{logger['info'](_0x1bff('0x7'),_0x3349b8,_0xfc63d1[0x0]);var _0x15c411={'closed':0x1,'closedAt':moment()['format'](_0x1bff('0x8')),'closeReason':'system','disposition':_0xfc63d1[0x0]};if(rpc[_0x5f1173[_0x1bff('0x9')]+'Interaction']){rpc[_0x5f1173[_0x1bff('0x9')]+'Interaction'][_0x1bff('0xa')](_0x5f1173[_0x1bff('0xb')]['id'],_0x15c411)[_0x1bff('0xc')](function(_0xabd34){logger[_0x1bff('0xd')](_0x1bff('0xe'),_0x3349b8,_0x5f1173[_0x1bff('0xb')]['id']);})['catch'](function(_0x44eba8){logger['error'](_0x1bff('0xf'),_0x3349b8,JSON[_0x1bff('0x10')](_0x44eba8));})['finally'](function(){_0xbac331['stop']();});}}catch(_0x2767c2){logger['error']('[%s][CLOSE]\x20%s',_0x3349b8,JSON['stringify'](_0x2767c2));_0xbac331['stop']();}};}; \ No newline at end of file +var _0xaad3=['Interaction','interaction','info','[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!','error','[%s][CLOSE]\x20%s','stringify','finally','stop','moment','../../../../config/logger','routing','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','consequence','[%s][CLOSE]\x20reason\x20%s','format','YYYY-MM-DD\x20HH:mm:ss','system'];(function(_0x4dc16f,_0x17fd42){var _0x205a88=function(_0x93f611){while(--_0x93f611){_0x4dc16f['push'](_0x4dc16f['shift']());}};_0x205a88(++_0x17fd42);}(_0xaad3,0x159));var _0x3aad=function(_0x1c582b,_0x37af43){_0x1c582b=_0x1c582b-0x0;var _0x444b40=_0xaad3[_0x1c582b];return _0x444b40;};'use strict';var moment=require(_0x3aad('0x0'));var logger=require(_0x3aad('0x1'))(_0x3aad('0x2'));var rpc={'chatInteraction':require('../../rpc/chatInteraction'),'openchannelInteraction':require(_0x3aad('0x3')),'smsInteraction':require(_0x3aad('0x4')),'mailInteraction':require(_0x3aad('0x5')),'faxInteraction':require(_0x3aad('0x6')),'whatsappInteraction':require('../../rpc/whatsappInteraction')};exports[_0x3aad('0x7')]=function(_0x126e9f,_0x572812,_0x5848b9,_0x42551d){return function(_0x413b34){try{logger['info'](_0x3aad('0x8'),_0x126e9f,_0x572812[0x0]);var _0x17cadd={'closed':0x1,'closedAt':moment()[_0x3aad('0x9')](_0x3aad('0xa')),'closeReason':_0x3aad('0xb'),'disposition':_0x572812[0x0]};if(rpc[_0x42551d['channel']+_0x3aad('0xc')]){rpc[_0x42551d['channel']+_0x3aad('0xc')]['update'](_0x42551d[_0x3aad('0xd')]['id'],_0x17cadd)['then'](function(_0x25b3bb){logger[_0x3aad('0xe')](_0x3aad('0xf'),_0x126e9f,_0x42551d[_0x3aad('0xd')]['id']);})['catch'](function(_0x547bd1){logger[_0x3aad('0x10')](_0x3aad('0x11'),_0x126e9f,JSON[_0x3aad('0x12')](_0x547bd1));})[_0x3aad('0x13')](function(){_0x413b34[_0x3aad('0x14')]();});}}catch(_0x1770bb){logger['error'](_0x3aad('0x11'),_0x126e9f,JSON[_0x3aad('0x12')](_0x1770bb));_0x413b34['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 299f4e6..651a795 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 _0xed1c=['ChatWebsiteId','account','AccountId','upperFirst','InteractionId','created','isEmpty','body','getMustacheRender','Message','catch','error','stringify','finally','stop','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','textRequest','message','result','fulfillment','speech','providerName','dialogflow','providerResponse','create','then','metadata','next','lodash','moment','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','isNil','interaction','UserId','info','[%s][DIALOGFLOW]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','sms','whatsapp','phone'];(function(_0x57d91c,_0x2868b2){var _0x30610c=function(_0x29fbf6){while(--_0x29fbf6){_0x57d91c['push'](_0x57d91c['shift']());}};_0x30610c(++_0x2868b2);}(_0xed1c,0xe4));var _0xced1=function(_0xde1f01,_0x3e2455){_0xde1f01=_0xde1f01-0x0;var _0x3ee182=_0xed1c[_0xde1f01];return _0x3ee182;};'use strict';var _=require(_0xced1('0x0'));var moment=require(_0xced1('0x1'));var apiai=require('apiai-promise');var md5=require('md5');var utils=require('./utils');var logger=require('../../../../config/logger')(_0xced1('0x2'));var rpc={'chatMessage':require(_0xced1('0x3')),'openchannelMessage':require(_0xced1('0x4')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0xced1('0x5')),'faxMessage':require(_0xced1('0x6')),'whatsappMessage':require(_0xced1('0x7'))};exports[_0xced1('0x8')]=function(_0x59399e,_0x2bcf42){return function(_0x38bca8){try{if(!_[_0xced1('0x9')](this[_0xced1('0xa')][_0xced1('0xb')])){logger[_0xced1('0xc')](_0xced1('0xd'),_0x59399e,_0xced1('0xe'));return _0x38bca8['next']();}var _0x82c84e={'ContactId':this['contact']['id'],'sentAt':moment()[_0xced1('0xf')](_0xced1('0x10')),'direction':_0xced1('0x11')};if(this[_0xced1('0x12')]===_0xced1('0x13')||this[_0xced1('0x12')]===_0xced1('0x14')){_0x82c84e['phone']=this[_0xced1('0xa')][_0xced1('0x15')];}var _0x1b7a33=this[_0xced1('0x12')];if(_0x1b7a33==='chat'){_0x82c84e[_0xced1('0x16')]=this[_0xced1('0x17')]['id'];}else{_0x82c84e[_['upperFirst'](_0x1b7a33)+_0xced1('0x18')]=this[_0xced1('0x17')]['id'];}_0x82c84e[_[_0xced1('0x19')](_0x1b7a33)+_0xced1('0x1a')]=this['interaction']['id'];if(this['interaction'][_0xced1('0x1b')]){var _0x4178d8=_0x2bcf42[0x2];if(!_[_0xced1('0x1c')](_0x4178d8)){_0x82c84e[_0xced1('0x1d')]=utils[_0xced1('0x1e')](_0x4178d8,this);return rpc[_0x1b7a33+_0xced1('0x1f')]['create'](_0x82c84e)['then'](function(_0x2a92c8){logger[_0xced1('0xc')](_0xced1('0xd'),_0x59399e,_0x82c84e['body']);})[_0xced1('0x20')](function(_0x25f0df){logger[_0xced1('0x21')]('[%s][DIALOGFLOW]\x20%s',_0x59399e,JSON[_0xced1('0x22')](_0x25f0df));})[_0xced1('0x23')](function(){logger[_0xced1('0xc')]('[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!',_0x59399e);_0x38bca8[_0xced1('0x24')]();});}else{logger[_0xced1('0xc')](_0xced1('0x25'),_0x59399e);_0x38bca8['stop']();}}else{var _0x4dab56=this;var _0x1d3884=apiai(_0x2bcf42[0x0],{'language':_0x2bcf42[0x1]||'en'});return _0x1d3884[_0xced1('0x26')](this[_0xced1('0x27')][_0xced1('0x1d')],{'sessionId':md5(this[_0xced1('0xa')]['id'])})['then'](function(_0x14f47e){_0x4dab56[_0xced1('0x1d')]['dialogflow']=_0x14f47e;_0x82c84e['body']=_0x14f47e[_0xced1('0x28')][_0xced1('0x29')][_0xced1('0x2a')];_0x82c84e[_0xced1('0x2b')]=_0xced1('0x2c');_0x82c84e[_0xced1('0x2d')]=JSON['stringify'](_0x14f47e);return rpc[_0x1b7a33+_0xced1('0x1f')][_0xced1('0x2e')](_0x82c84e)[_0xced1('0x2f')](function(_0x351afc){logger[_0xced1('0xc')](_0xced1('0xd'),_0x59399e,_0x82c84e[_0xced1('0x1d')]);if(_0x14f47e['result'][_0xced1('0x30')]['endConversation']){_0x38bca8[_0xced1('0x31')]();}else{_0x38bca8[_0xced1('0x24')]();}})[_0xced1('0x20')](function(_0x176215){logger['error']('[%s][DIALOGFLOW]\x20%s',_0x59399e,JSON[_0xced1('0x22')](_0x176215));_0x38bca8[_0xced1('0x31')]();});})[_0xced1('0x20')](function(_0x4ea07e){logger['error']('[%s][DIALOGFLOW]\x20%s',_0x59399e,_0x4ea07e[_0xced1('0x27')]);_0x38bca8[_0xced1('0x31')]();});}}catch(_0x2a6197){logger[_0xced1('0x21')]('[%s][DIALOGFLOW]\x20%s',_0x59399e,JSON[_0xced1('0x22')](_0x2a6197));_0x38bca8[_0xced1('0x24')]();}};}; \ No newline at end of file +var _0xf06c=['ChatWebsiteId','account','upperFirst','created','body','getMustacheRender','Message','then','info','error','finally','stop','textRequest','message','dialogflow','speech','providerName','providerResponse','stringify','result','metadata','endConversation','catch','lodash','moment','apiai-promise','md5','./utils','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','[%s][DIALOGFLOW]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','format','out','sms','whatsapp','phone','interaction','chat'];(function(_0x413e7f,_0x908f1b){var _0x4b9b88=function(_0x1d102a){while(--_0x1d102a){_0x413e7f['push'](_0x413e7f['shift']());}};_0x4b9b88(++_0x908f1b);}(_0xf06c,0xc7));var _0xcf06=function(_0xdca4d1,_0x3cc65a){_0xdca4d1=_0xdca4d1-0x0;var _0xef0f65=_0xf06c[_0xdca4d1];return _0xef0f65;};'use strict';var _=require(_0xcf06('0x0'));var moment=require(_0xcf06('0x1'));var apiai=require(_0xcf06('0x2'));var md5=require(_0xcf06('0x3'));var utils=require(_0xcf06('0x4'));var logger=require('../../../../config/logger')(_0xcf06('0x5'));var rpc={'chatMessage':require(_0xcf06('0x6')),'openchannelMessage':require(_0xcf06('0x7')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0xcf06('0x8')),'faxMessage':require(_0xcf06('0x9')),'whatsappMessage':require(_0xcf06('0xa'))};exports['consequence']=function(_0x22ac40,_0x5d1aa0){return function(_0x2723ad){try{if(!_['isNil'](this['interaction']['UserId'])){logger['info'](_0xcf06('0xb'),_0x22ac40,_0xcf06('0xc'));return _0x2723ad[_0xcf06('0xd')]();}var _0x59d6ba={'ContactId':this['contact']['id'],'sentAt':moment()[_0xcf06('0xe')]('YYYY-MM-DD\x20HH:mm:ss'),'direction':_0xcf06('0xf')};if(this['channel']===_0xcf06('0x10')||this['channel']===_0xcf06('0x11')){_0x59d6ba[_0xcf06('0x12')]=this[_0xcf06('0x13')][_0xcf06('0x12')];}var _0x4e7a57=this['channel'];if(_0x4e7a57===_0xcf06('0x14')){_0x59d6ba[_0xcf06('0x15')]=this[_0xcf06('0x16')]['id'];}else{_0x59d6ba[_[_0xcf06('0x17')](_0x4e7a57)+'AccountId']=this[_0xcf06('0x16')]['id'];}_0x59d6ba[_[_0xcf06('0x17')](_0x4e7a57)+'InteractionId']=this['interaction']['id'];if(this[_0xcf06('0x13')][_0xcf06('0x18')]){var _0x263298=_0x5d1aa0[0x2];if(!_['isEmpty'](_0x263298)){_0x59d6ba[_0xcf06('0x19')]=utils[_0xcf06('0x1a')](_0x263298,this);return rpc[_0x4e7a57+_0xcf06('0x1b')]['create'](_0x59d6ba)[_0xcf06('0x1c')](function(_0x2a5ef5){logger[_0xcf06('0x1d')](_0xcf06('0xb'),_0x22ac40,_0x59d6ba[_0xcf06('0x19')]);})['catch'](function(_0x471b39){logger[_0xcf06('0x1e')](_0xcf06('0xb'),_0x22ac40,JSON['stringify'](_0x471b39));})[_0xcf06('0x1f')](function(){logger[_0xcf06('0x1d')]('[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!',_0x22ac40);_0x2723ad[_0xcf06('0x20')]();});}else{logger[_0xcf06('0x1d')]('[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!',_0x22ac40);_0x2723ad[_0xcf06('0x20')]();}}else{var _0x132eaa=this;var _0x139b17=apiai(_0x5d1aa0[0x0],{'language':_0x5d1aa0[0x1]||'en'});return _0x139b17[_0xcf06('0x21')](this[_0xcf06('0x22')][_0xcf06('0x19')],{'sessionId':md5(this[_0xcf06('0x13')]['id'])})[_0xcf06('0x1c')](function(_0xb039dd){_0x132eaa[_0xcf06('0x19')][_0xcf06('0x23')]=_0xb039dd;_0x59d6ba[_0xcf06('0x19')]=_0xb039dd['result']['fulfillment'][_0xcf06('0x24')];_0x59d6ba[_0xcf06('0x25')]=_0xcf06('0x23');_0x59d6ba[_0xcf06('0x26')]=JSON[_0xcf06('0x27')](_0xb039dd);return rpc[_0x4e7a57+_0xcf06('0x1b')]['create'](_0x59d6ba)['then'](function(_0x2afa20){logger['info'](_0xcf06('0xb'),_0x22ac40,_0x59d6ba[_0xcf06('0x19')]);if(_0xb039dd[_0xcf06('0x28')][_0xcf06('0x29')][_0xcf06('0x2a')]){_0x2723ad[_0xcf06('0xd')]();}else{_0x2723ad[_0xcf06('0x20')]();}})[_0xcf06('0x2b')](function(_0x2ec5b7){logger['error'](_0xcf06('0xb'),_0x22ac40,JSON['stringify'](_0x2ec5b7));_0x2723ad[_0xcf06('0xd')]();});})[_0xcf06('0x2b')](function(_0x42d287){logger[_0xcf06('0x1e')](_0xcf06('0xb'),_0x22ac40,_0x42d287[_0xcf06('0x22')]);_0x2723ad['next']();});}}catch(_0x105cbb){logger[_0xcf06('0x1e')](_0xcf06('0xb'),_0x22ac40,JSON[_0xcf06('0x27')](_0x105cbb));_0x2723ad[_0xcf06('0x20')]();}};}; \ 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 2144c08..666bd9b 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 _0x76ec=['action','allRequiredParamsPresent','end_conversation','DIALOGFLOWV2_INTENTNAME','intent','name','displayName','isFallback','DIALOGFLOWV2_LANGUAGECODE','DIALOGFLOWV2_QUERYTEXT','DIALOGFLOWV2_SCORE','intentDetectionConfidence','providerName','dialogflowV2','providerResponse','fulfillmentText','push','all','message','stack','lodash','md5','moment','bluebird','../../../../config/logger','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/faxMessage','clone','info','catch','error','[%s][DIALOGFLOWV2]\x20%s','stringify','consequence','interaction','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','YYYY-MM-DD\x20HH:mm:ss','channel','sms','whatsapp','phone','chat','account','upperFirst','AccountId','InteractionId','body','create','then','finally','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','stop','replace','sessionPath','detectIntent','length','queryResult','diagnosticInfo','fields','DIALOGFLOWV2_ACTION'];(function(_0x16ceb7,_0x797b7c){var _0x963c54=function(_0x42a03f){while(--_0x42a03f){_0x16ceb7['push'](_0x16ceb7['shift']());}};_0x963c54(++_0x797b7c);}(_0x76ec,0x92));var _0xc76e=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x76ec[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xc76e('0x0'));var dialogflow=require('dialogflow');var md5=require(_0xc76e('0x1'));var moment=require(_0xc76e('0x2'));var Promise=require(_0xc76e('0x3'));var logger=require(_0xc76e('0x4'))('routing');var utils=require('./utils');var rpc={'chatMessage':require(_0xc76e('0x5')),'openchannelMessage':require(_0xc76e('0x6')),'mailMessage':require(_0xc76e('0x7')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0xc76e('0x8')),'whatsappMessage':require('../../rpc/whatsappMessage')};function createMessage(_0x53b687,_0x58e1bc,_0x46ef0f,_0x2cc5c4){return new Promise(function(_0x3bf626,_0x331da4){var _0x472bef=_[_0xc76e('0x9')](_0x46ef0f);_0x472bef['body']=_0x2cc5c4;return rpc[_0x58e1bc+'Message']['create'](_0x472bef)['then'](function(){logger[_0xc76e('0xa')]('[%s][DIALOGFLOWV2]\x20%s',_0x53b687,_0x472bef['body']);_0x3bf626();})[_0xc76e('0xb')](function(_0x35e459){logger[_0xc76e('0xc')](_0xc76e('0xd'),_0x53b687,JSON[_0xc76e('0xe')](_0x35e459));_0x331da4(_0x35e459);});});}exports[_0xc76e('0xf')]=function(_0x7ba557,_0x2a35c2){return function(_0x2bed83){try{if(!_['isNil'](this[_0xc76e('0x10')]['UserId'])){logger['info'](_0xc76e('0xd'),_0x7ba557,_0xc76e('0x11'));return _0x2bed83[_0xc76e('0x12')]();}var _0x470939={'ContactId':this['contact']['id'],'sentAt':moment()['format'](_0xc76e('0x13')),'direction':'out'};if(this[_0xc76e('0x14')]===_0xc76e('0x15')||this[_0xc76e('0x14')]===_0xc76e('0x16')){_0x470939[_0xc76e('0x17')]=this[_0xc76e('0x10')][_0xc76e('0x17')];}var _0x40fdf9=this[_0xc76e('0x14')];if(_0x40fdf9===_0xc76e('0x18')){_0x470939['ChatWebsiteId']=this[_0xc76e('0x19')]['id'];}else{_0x470939[_[_0xc76e('0x1a')](_0x40fdf9)+_0xc76e('0x1b')]=this[_0xc76e('0x19')]['id'];}_0x470939[_[_0xc76e('0x1a')](_0x40fdf9)+_0xc76e('0x1c')]=this[_0xc76e('0x10')]['id'];if(this['interaction']['created']){var _0x3389bf=_0x2a35c2[0x4];if(!_['isEmpty'](_0x3389bf)){_0x470939[_0xc76e('0x1d')]=utils['getMustacheRender'](_0x3389bf,this);return rpc[_0x40fdf9+'Message'][_0xc76e('0x1e')](_0x470939)[_0xc76e('0x1f')](function(_0x388708){logger[_0xc76e('0xa')](_0xc76e('0xd'),_0x7ba557,_0x470939[_0xc76e('0x1d')]);})[_0xc76e('0xb')](function(_0x2057cd){logger[_0xc76e('0xc')](_0xc76e('0xd'),_0x7ba557,JSON[_0xc76e('0xe')](_0x2057cd));})[_0xc76e('0x20')](function(){logger[_0xc76e('0xa')]('[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20has\x20been\x20sent!',_0x7ba557);_0x2bed83['stop']();});}else{logger[_0xc76e('0xa')](_0xc76e('0x21'),_0x7ba557);_0x2bed83[_0xc76e('0x22')]();}}else{var _0x4620d5=this;var _0x147137=_0x2a35c2[0x2][_0xc76e('0x23')](/\\n/g,'\x0a');var _0x473e53={'credentials':{'private_key':_0x147137,'client_email':_0x2a35c2[0x1]}};var _0x4da201=new dialogflow['SessionsClient'](_0x473e53);var _0x4d74bb=_0x4da201[_0xc76e('0x24')](_0x2a35c2[0x0],md5(_0x4620d5[_0xc76e('0x10')]['id']));var _0x2be378={'session':_0x4d74bb,'queryInput':{'text':{'text':_0x4620d5['message'][_0xc76e('0x1d')],'languageCode':_0x2a35c2[0x3]||'en'}}};return _0x4da201[_0xc76e('0x25')](_0x2be378)['then'](function(_0x2395dc){if(_0x2395dc&&_0x2395dc[_0xc76e('0x26')]){_0x4620d5[_0xc76e('0x1d')]['dialogflowV2']=_0x2395dc;var _0x15601b=_0x2395dc[0x0];var _0x266c73=_0x15601b[_0xc76e('0x27')][_0xc76e('0x28')]&&_0x15601b[_0xc76e('0x27')][_0xc76e('0x28')][_0xc76e('0x29')]?_0x15601b[_0xc76e('0x27')][_0xc76e('0x28')][_0xc76e('0x29')]['end_conversation']['boolValue']:![];_0x4620d5[_0xc76e('0x1d')][_0xc76e('0x2a')]=_0x15601b[_0xc76e('0x27')][_0xc76e('0x2b')];_0x4620d5[_0xc76e('0x1d')]['DIALOGFLOWV2_ALLREQUIREDPARAMSPRESENT']=_0x15601b[_0xc76e('0x27')][_0xc76e('0x2c')];_0x4620d5[_0xc76e('0x1d')]['DIALOGFLOWV2_ENDCONVERSATION']=_0x15601b[_0xc76e('0x27')]['diagnosticInfo']&&_0x15601b[_0xc76e('0x27')]['diagnosticInfo'][_0xc76e('0x29')]?_0x15601b[_0xc76e('0x27')][_0xc76e('0x28')][_0xc76e('0x29')][_0xc76e('0x2d')]['boolValue']:![];_0x4620d5[_0xc76e('0x1d')][_0xc76e('0x2e')]=_0x15601b[_0xc76e('0x27')][_0xc76e('0x2f')][_0xc76e('0x30')];_0x4620d5[_0xc76e('0x1d')]['DIALOGFLOWV2_INTENTDISPLAYNAME']=_0x15601b[_0xc76e('0x27')][_0xc76e('0x2f')][_0xc76e('0x31')];_0x4620d5[_0xc76e('0x1d')]['DIALOGFLOWV2_ISFALLBACKINTENT']=_0x15601b[_0xc76e('0x27')]['intent'][_0xc76e('0x32')];_0x4620d5[_0xc76e('0x1d')][_0xc76e('0x33')]=_0x15601b[_0xc76e('0x27')]['languageCode'];_0x4620d5[_0xc76e('0x1d')][_0xc76e('0x34')]=_0x15601b[_0xc76e('0x27')]['queryText'];_0x4620d5['body'][_0xc76e('0x35')]=_0x15601b[_0xc76e('0x27')][_0xc76e('0x36')];_0x470939[_0xc76e('0x37')]=_0xc76e('0x38');_0x470939[_0xc76e('0x39')]=JSON[_0xc76e('0xe')](_0x2395dc);var _0x7eac0e=[];for(var _0x596baa=0x0;_0x596baa<_0x2395dc[_0xc76e('0x26')];_0x596baa++){var _0x42f60c=_0x2395dc[_0x596baa];if(_0x42f60c&&_0x42f60c[_0xc76e('0x27')]&&_0x42f60c['queryResult'][_0xc76e('0x3a')]){_0x7eac0e[_0xc76e('0x3b')](createMessage(_0x7ba557,_0x40fdf9,_0x470939,_0x42f60c[_0xc76e('0x27')][_0xc76e('0x3a')]));}}return Promise[_0xc76e('0x3c')](_0x7eac0e)[_0xc76e('0x1f')](function(){if(_0x266c73){_0x2bed83[_0xc76e('0x12')]();}else{_0x2bed83[_0xc76e('0x22')]();}})[_0xc76e('0xb')](function(_0x12428d){logger[_0xc76e('0xc')](_0xc76e('0xd'),_0x7ba557,JSON['stringify'](_0x12428d));_0x2bed83[_0xc76e('0x12')]();});}})[_0xc76e('0xb')](function(_0x4670ab){logger['error'](_0xc76e('0xd'),_0x7ba557,_0x4670ab[_0xc76e('0x3d')],_0x4670ab[_0xc76e('0x3e')]);_0x2bed83[_0xc76e('0x12')]();});}}catch(_0x593907){logger[_0xc76e('0xc')](_0xc76e('0xd'),_0x7ba557,JSON[_0xc76e('0xe')](_0x593907));_0x2bed83[_0xc76e('0x22')]();}};}; \ No newline at end of file +var _0xea0d=['DIALOGFLOWV2_ACTION','action','DIALOGFLOWV2_ENDCONVERSATION','boolValue','DIALOGFLOWV2_INTENTNAME','intent','name','displayName','DIALOGFLOWV2_ISFALLBACKINTENT','isFallback','DIALOGFLOWV2_LANGUAGECODE','queryText','DIALOGFLOWV2_SCORE','intentDetectionConfidence','providerName','providerResponse','fulfillmentText','push','all','stack','lodash','dialogflow','moment','bluebird','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','clone','Message','create','then','info','[%s][DIALOGFLOWV2]\x20%s','body','catch','error','stringify','isNil','interaction','UserId','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','sms','whatsapp','phone','chat','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','created','isEmpty','getMustacheRender','finally','stop','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','replace','SessionsClient','sessionPath','detectIntent','length','dialogflowV2','queryResult','diagnosticInfo','fields','end_conversation'];(function(_0x2578bc,_0x3eb278){var _0x548c87=function(_0x15fdb3){while(--_0x15fdb3){_0x2578bc['push'](_0x2578bc['shift']());}};_0x548c87(++_0x3eb278);}(_0xea0d,0xf2));var _0xdea0=function(_0x148b06,_0x375597){_0x148b06=_0x148b06-0x0;var _0x222dbf=_0xea0d[_0x148b06];return _0x222dbf;};'use strict';var _=require(_0xdea0('0x0'));var dialogflow=require(_0xdea0('0x1'));var md5=require('md5');var moment=require(_0xdea0('0x2'));var Promise=require(_0xdea0('0x3'));var logger=require(_0xdea0('0x4'))(_0xdea0('0x5'));var utils=require('./utils');var rpc={'chatMessage':require(_0xdea0('0x6')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0xdea0('0x7')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0xdea0('0x8')),'whatsappMessage':require(_0xdea0('0x9'))};function createMessage(_0x472a2a,_0x32bc24,_0x18796c,_0x228637){return new Promise(function(_0x2eba0b,_0xecb765){var _0x42f57c=_[_0xdea0('0xa')](_0x18796c);_0x42f57c['body']=_0x228637;return rpc[_0x32bc24+_0xdea0('0xb')][_0xdea0('0xc')](_0x42f57c)[_0xdea0('0xd')](function(){logger[_0xdea0('0xe')](_0xdea0('0xf'),_0x472a2a,_0x42f57c[_0xdea0('0x10')]);_0x2eba0b();})[_0xdea0('0x11')](function(_0x5b2d5e){logger[_0xdea0('0x12')](_0xdea0('0xf'),_0x472a2a,JSON[_0xdea0('0x13')](_0x5b2d5e));_0xecb765(_0x5b2d5e);});});}exports['consequence']=function(_0x2ec73b,_0x1bb720){return function(_0x4a5c26){try{if(!_[_0xdea0('0x14')](this[_0xdea0('0x15')][_0xdea0('0x16')])){logger['info'](_0xdea0('0xf'),_0x2ec73b,'Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.');return _0x4a5c26[_0xdea0('0x17')]();}var _0x2c2a90={'ContactId':this[_0xdea0('0x18')]['id'],'sentAt':moment()[_0xdea0('0x19')](_0xdea0('0x1a')),'direction':_0xdea0('0x1b')};if(this[_0xdea0('0x1c')]===_0xdea0('0x1d')||this['channel']===_0xdea0('0x1e')){_0x2c2a90['phone']=this[_0xdea0('0x15')][_0xdea0('0x1f')];}var _0x35252f=this[_0xdea0('0x1c')];if(_0x35252f===_0xdea0('0x20')){_0x2c2a90[_0xdea0('0x21')]=this[_0xdea0('0x22')]['id'];}else{_0x2c2a90[_[_0xdea0('0x23')](_0x35252f)+_0xdea0('0x24')]=this[_0xdea0('0x22')]['id'];}_0x2c2a90[_[_0xdea0('0x23')](_0x35252f)+_0xdea0('0x25')]=this['interaction']['id'];if(this[_0xdea0('0x15')][_0xdea0('0x26')]){var _0x3bc1f3=_0x1bb720[0x4];if(!_[_0xdea0('0x27')](_0x3bc1f3)){_0x2c2a90['body']=utils[_0xdea0('0x28')](_0x3bc1f3,this);return rpc[_0x35252f+_0xdea0('0xb')][_0xdea0('0xc')](_0x2c2a90)[_0xdea0('0xd')](function(_0x898428){logger[_0xdea0('0xe')](_0xdea0('0xf'),_0x2ec73b,_0x2c2a90[_0xdea0('0x10')]);})[_0xdea0('0x11')](function(_0x5cdb8d){logger[_0xdea0('0x12')]('[%s][DIALOGFLOWV2]\x20%s',_0x2ec73b,JSON[_0xdea0('0x13')](_0x5cdb8d));})[_0xdea0('0x29')](function(){logger[_0xdea0('0xe')]('[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20has\x20been\x20sent!',_0x2ec73b);_0x4a5c26[_0xdea0('0x2a')]();});}else{logger[_0xdea0('0xe')](_0xdea0('0x2b'),_0x2ec73b);_0x4a5c26[_0xdea0('0x2a')]();}}else{var _0x563404=this;var _0x1db033=_0x1bb720[0x2][_0xdea0('0x2c')](/\\n/g,'\x0a');var _0x42d058={'credentials':{'private_key':_0x1db033,'client_email':_0x1bb720[0x1]}};var _0x38c142=new dialogflow[(_0xdea0('0x2d'))](_0x42d058);var _0x1ef62f=_0x38c142[_0xdea0('0x2e')](_0x1bb720[0x0],md5(_0x563404['interaction']['id']));var _0x256fb6={'session':_0x1ef62f,'queryInput':{'text':{'text':_0x563404['message'][_0xdea0('0x10')],'languageCode':_0x1bb720[0x3]||'en'}}};return _0x38c142[_0xdea0('0x2f')](_0x256fb6)[_0xdea0('0xd')](function(_0x3d04ee){if(_0x3d04ee&&_0x3d04ee[_0xdea0('0x30')]){_0x563404[_0xdea0('0x10')][_0xdea0('0x31')]=_0x3d04ee;var _0x564cae=_0x3d04ee[0x0];var _0x48a9a4=_0x564cae[_0xdea0('0x32')][_0xdea0('0x33')]&&_0x564cae[_0xdea0('0x32')][_0xdea0('0x33')]['fields']?_0x564cae[_0xdea0('0x32')][_0xdea0('0x33')][_0xdea0('0x34')][_0xdea0('0x35')]['boolValue']:![];_0x563404[_0xdea0('0x10')][_0xdea0('0x36')]=_0x564cae[_0xdea0('0x32')][_0xdea0('0x37')];_0x563404[_0xdea0('0x10')]['DIALOGFLOWV2_ALLREQUIREDPARAMSPRESENT']=_0x564cae['queryResult']['allRequiredParamsPresent'];_0x563404[_0xdea0('0x10')][_0xdea0('0x38')]=_0x564cae[_0xdea0('0x32')][_0xdea0('0x33')]&&_0x564cae[_0xdea0('0x32')][_0xdea0('0x33')][_0xdea0('0x34')]?_0x564cae[_0xdea0('0x32')][_0xdea0('0x33')][_0xdea0('0x34')]['end_conversation'][_0xdea0('0x39')]:![];_0x563404['body'][_0xdea0('0x3a')]=_0x564cae['queryResult'][_0xdea0('0x3b')][_0xdea0('0x3c')];_0x563404['body']['DIALOGFLOWV2_INTENTDISPLAYNAME']=_0x564cae[_0xdea0('0x32')][_0xdea0('0x3b')][_0xdea0('0x3d')];_0x563404[_0xdea0('0x10')][_0xdea0('0x3e')]=_0x564cae[_0xdea0('0x32')][_0xdea0('0x3b')][_0xdea0('0x3f')];_0x563404['body'][_0xdea0('0x40')]=_0x564cae[_0xdea0('0x32')]['languageCode'];_0x563404[_0xdea0('0x10')]['DIALOGFLOWV2_QUERYTEXT']=_0x564cae[_0xdea0('0x32')][_0xdea0('0x41')];_0x563404[_0xdea0('0x10')][_0xdea0('0x42')]=_0x564cae[_0xdea0('0x32')][_0xdea0('0x43')];_0x2c2a90[_0xdea0('0x44')]=_0xdea0('0x31');_0x2c2a90[_0xdea0('0x45')]=JSON[_0xdea0('0x13')](_0x3d04ee);var _0x4842cf=[];for(var _0x19b352=0x0;_0x19b352<_0x3d04ee[_0xdea0('0x30')];_0x19b352++){var _0x2245f7=_0x3d04ee[_0x19b352];if(_0x2245f7&&_0x2245f7[_0xdea0('0x32')]&&_0x2245f7[_0xdea0('0x32')][_0xdea0('0x46')]){_0x4842cf[_0xdea0('0x47')](createMessage(_0x2ec73b,_0x35252f,_0x2c2a90,_0x2245f7['queryResult'][_0xdea0('0x46')]));}}return Promise[_0xdea0('0x48')](_0x4842cf)['then'](function(){if(_0x48a9a4){_0x4a5c26[_0xdea0('0x17')]();}else{_0x4a5c26[_0xdea0('0x2a')]();}})[_0xdea0('0x11')](function(_0xb7fb39){logger[_0xdea0('0x12')](_0xdea0('0xf'),_0x2ec73b,JSON[_0xdea0('0x13')](_0xb7fb39));_0x4a5c26[_0xdea0('0x17')]();});}})[_0xdea0('0x11')](function(_0x42b1c7){logger[_0xdea0('0x12')]('[%s][DIALOGFLOWV2]\x20%s',_0x2ec73b,_0x42b1c7['message'],_0x42b1c7[_0xdea0('0x49')]);_0x4a5c26[_0xdea0('0x17')]();});}}catch(_0x1e6831){logger[_0xdea0('0x12')](_0xdea0('0xf'),_0x2ec73b,JSON[_0xdea0('0x13')](_0x1e6831));_0x4a5c26[_0xdea0('0x2a')]();}};}; \ 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 943629b..a8cb195 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 _0x7a40=['info','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','next','findIndex','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','stringify','validate','lodash','html-to-text','./utils','../../../../config/logger','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','priority\x20true\x20is\x20a\x20number','priority\x20false\x20is\x20a\x20number','consequence','fromString','getMustacheRender','length','error','[%s][GOTOIF]\x20%s','map','condition','priorityTrue','priorityFalse'];(function(_0x2576d7,_0x167624){var _0x16a08c=function(_0x19de1e){while(--_0x19de1e){_0x2576d7['push'](_0x2576d7['shift']());}};_0x16a08c(++_0x167624);}(_0x7a40,0xb8));var _0x07a4=function(_0x51352a,_0x291e1e){_0x51352a=_0x51352a-0x0;var _0x4a397f=_0x7a40[_0x51352a];return _0x4a397f;};'use strict';var schema=require(_0x07a4('0x0'));var _=require(_0x07a4('0x1'));var htmlToText=require(_0x07a4('0x2'));var utils=require(_0x07a4('0x3'));var logger=require(_0x07a4('0x4'))('routing');var gotoif=schema({'condition':{'type':'string','required':!![],'message':_0x07a4('0x5')},'priorityTrue':{'type':_0x07a4('0x6'),'message':_0x07a4('0x7')},'priorityFalse':{'type':_0x07a4('0x6'),'message':_0x07a4('0x8')}});exports[_0x07a4('0x9')]=function(_0xde57f4,_0x1f3a5f){return function(_0x231abe){try{var _0xdaedc5={'condition':htmlToText[_0x07a4('0xa')](utils[_0x07a4('0xb')](_0x1f3a5f[0x0],this),{'wordwrap':![]})['replace'](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x1f3a5f[0x1],'priorityFalse':_0x1f3a5f[0x2]};var _0x5a4cb8=gotoif[_0x07a4('0x0')](_0xdaedc5,{'typecast':!![]});if(_0x5a4cb8[_0x07a4('0xc')]){logger[_0x07a4('0xd')](_0x07a4('0xe'),_0xde57f4,_[_0x07a4('0xf')](_0x5a4cb8,'message')['join'](',\x20'));_0x231abe['stop']();}else{try{var _0xfbadc3=eval('('+_0xdaedc5[_0x07a4('0x10')]+')');var _0x684b73=_0xfbadc3?_0xdaedc5[_0x07a4('0x11')]:_0xdaedc5[_0x07a4('0x12')];logger[_0x07a4('0x13')](_0x07a4('0x14'),_0xde57f4,_0xdaedc5[_0x07a4('0x10')],_0xfbadc3,_0x684b73||_0x07a4('0x15'));if(_0x684b73){var _0x35b2e6=_[_0x07a4('0x16')](_0x231abe[_0x07a4('0x17')](),{'p':_0x684b73});if(_0x35b2e6>=0x0){logger[_0x07a4('0x13')](_0x07a4('0x18'),_0xde57f4,_0x684b73||'next',_0x35b2e6);_0x231abe[_0x07a4('0x15')](_0x35b2e6);}else{logger[_0x07a4('0x13')](_0x07a4('0x19'),_0xde57f4,_0x684b73||'next');_0x231abe[_0x07a4('0x1a')]();}}else{_0x231abe['next']();}}catch(_0x5952a8){logger[_0x07a4('0xd')](_0x07a4('0x1b'),_0xde57f4,_0x5952a8['message']);_0x231abe[_0x07a4('0x1a')]();}}}catch(_0x1d38b7){logger[_0x07a4('0xd')](_0x07a4('0xe'),_0xde57f4,JSON[_0x07a4('0x1c')](_0x1d38b7));_0x231abe[_0x07a4('0x1a')]();}};}; \ No newline at end of file +var _0x77a3=['stop','[%s][GOTOIF]\x20eval\x20error:\x20%s','lodash','html-to-text','./utils','../../../../config/logger','routing','string','number','priority\x20false\x20is\x20a\x20number','consequence','fromString','getMustacheRender','replace','length','error','[%s][GOTOIF]\x20%s','map','message','condition','priorityTrue','priorityFalse','info','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','findIndex','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next'];(function(_0x48c615,_0x4cc757){var _0x3d9e22=function(_0x1ee9f2){while(--_0x1ee9f2){_0x48c615['push'](_0x48c615['shift']());}};_0x3d9e22(++_0x4cc757);}(_0x77a3,0x197));var _0x377a=function(_0x3d8e51,_0x4806ed){_0x3d8e51=_0x3d8e51-0x0;var _0x3602be=_0x77a3[_0x3d8e51];return _0x3602be;};'use strict';var schema=require('validate');var _=require(_0x377a('0x0'));var htmlToText=require(_0x377a('0x1'));var utils=require(_0x377a('0x2'));var logger=require(_0x377a('0x3'))(_0x377a('0x4'));var gotoif=schema({'condition':{'type':_0x377a('0x5'),'required':!![],'message':'condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'priorityTrue':{'type':_0x377a('0x6'),'message':'priority\x20true\x20is\x20a\x20number'},'priorityFalse':{'type':_0x377a('0x6'),'message':_0x377a('0x7')}});exports[_0x377a('0x8')]=function(_0x20f2ac,_0x2456a3){return function(_0x4b5b2b){try{var _0x281b11={'condition':htmlToText[_0x377a('0x9')](utils[_0x377a('0xa')](_0x2456a3[0x0],this),{'wordwrap':![]})[_0x377a('0xb')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x2456a3[0x1],'priorityFalse':_0x2456a3[0x2]};var _0x1d5a03=gotoif['validate'](_0x281b11,{'typecast':!![]});if(_0x1d5a03[_0x377a('0xc')]){logger[_0x377a('0xd')](_0x377a('0xe'),_0x20f2ac,_[_0x377a('0xf')](_0x1d5a03,_0x377a('0x10'))['join'](',\x20'));_0x4b5b2b['stop']();}else{try{var _0x37921b=eval('('+_0x281b11[_0x377a('0x11')]+')');var _0x1eb2ce=_0x37921b?_0x281b11[_0x377a('0x12')]:_0x281b11[_0x377a('0x13')];logger[_0x377a('0x14')](_0x377a('0x15'),_0x20f2ac,_0x281b11[_0x377a('0x11')],_0x37921b,_0x1eb2ce||'next');if(_0x1eb2ce){var _0x30508f=_[_0x377a('0x16')](_0x4b5b2b['rules'](),{'p':_0x1eb2ce});if(_0x30508f>=0x0){logger[_0x377a('0x14')](_0x377a('0x17'),_0x20f2ac,_0x1eb2ce||_0x377a('0x18'),_0x30508f);_0x4b5b2b[_0x377a('0x18')](_0x30508f);}else{logger[_0x377a('0x14')]('[%s][GOTOIF]\x20priority\x20%s\x20not\x20found',_0x20f2ac,_0x1eb2ce||_0x377a('0x18'));_0x4b5b2b[_0x377a('0x19')]();}}else{_0x4b5b2b['next']();}}catch(_0x296744){logger[_0x377a('0xd')](_0x377a('0x1a'),_0x20f2ac,_0x296744['message']);_0x4b5b2b['stop']();}}}catch(_0x52c1cb){logger[_0x377a('0xd')](_0x377a('0xe'),_0x20f2ac,JSON['stringify'](_0x52c1cb));_0x4b5b2b[_0x377a('0x19')]();}};}; \ 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 5345cc8..4b2233a 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 _0x733b=['message','join','stop','info','priority','findIndex','rules','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','validate','lodash','../../../../config/logger','routing','consequence','error','[%s][GOTOP]\x20%s','map'];(function(_0x15fee3,_0x3e6fff){var _0x2f6f26=function(_0x50d25a){while(--_0x50d25a){_0x15fee3['push'](_0x15fee3['shift']());}};_0x2f6f26(++_0x3e6fff);}(_0x733b,0x118));var _0xb733=function(_0x55dec0,_0x5a6144){_0x55dec0=_0x55dec0-0x0;var _0x303c9d=_0x733b[_0x55dec0];return _0x303c9d;};'use strict';var schema=require(_0xb733('0x0'));var _=require(_0xb733('0x1'));var logger=require(_0xb733('0x2'))(_0xb733('0x3'));var gotop=schema({'priority':{'type':'number','required':!![],'message':'priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required'}});exports[_0xb733('0x4')]=function(_0x1ab488,_0x53a855){return function(_0x15f2e1){try{var _0x4d0605={'priority':_0x53a855[0x0]};var _0x3abed7=gotop[_0xb733('0x0')](_0x4d0605,{'typecast':!![]});if(_0x3abed7['length']){logger[_0xb733('0x5')](_0xb733('0x6'),_0x1ab488,_[_0xb733('0x7')](_0x3abed7,_0xb733('0x8'))[_0xb733('0x9')](',\x20'));_0x15f2e1[_0xb733('0xa')]();}else{logger[_0xb733('0xb')]('[%s][GOTOP]\x20priority\x20%s',_0x1ab488,_0x4d0605[_0xb733('0xc')]);if(_0x4d0605[_0xb733('0xc')]){var _0x4e7b71=_[_0xb733('0xd')](_0x15f2e1[_0xb733('0xe')](),{'p':_0x4d0605[_0xb733('0xc')]});if(_0x4e7b71>=0x0){logger[_0xb733('0xb')](_0xb733('0xf'),_0x1ab488,_0x4d0605['priority']||_0xb733('0x10'),_0x4e7b71);_0x15f2e1['next'](_0x4e7b71);}else{logger[_0xb733('0xb')](_0xb733('0x11'),_0x1ab488,_0x4d0605[_0xb733('0xc')]||'next');_0x15f2e1['stop']();}}else{_0x15f2e1[_0xb733('0x10')]();}}}catch(_0x3fcdc2){logger[_0xb733('0x5')](_0xb733('0x6'),_0x1ab488,JSON['stringify'](_0x3fcdc2));_0x15f2e1['stop']();}};}; \ No newline at end of file +var _0xcdcd=['lodash','../../../../config/logger','routing','number','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','consequence','length','error','[%s][GOTOP]\x20%s','map','message','stop','info','[%s][GOTOP]\x20priority\x20%s','priority','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','stringify'];(function(_0x1a4c27,_0x5a4b45){var _0x578d9=function(_0x10b6df){while(--_0x10b6df){_0x1a4c27['push'](_0x1a4c27['shift']());}};_0x578d9(++_0x5a4b45);}(_0xcdcd,0x156));var _0xdcdc=function(_0x4227f7,_0x5e2633){_0x4227f7=_0x4227f7-0x0;var _0x4d394e=_0xcdcd[_0x4227f7];return _0x4d394e;};'use strict';var schema=require('validate');var _=require(_0xdcdc('0x0'));var logger=require(_0xdcdc('0x1'))(_0xdcdc('0x2'));var gotop=schema({'priority':{'type':_0xdcdc('0x3'),'required':!![],'message':_0xdcdc('0x4')}});exports[_0xdcdc('0x5')]=function(_0x46e06f,_0x2ea04e){return function(_0x268a4f){try{var _0x2b86fe={'priority':_0x2ea04e[0x0]};var _0x10afc6=gotop['validate'](_0x2b86fe,{'typecast':!![]});if(_0x10afc6[_0xdcdc('0x6')]){logger[_0xdcdc('0x7')](_0xdcdc('0x8'),_0x46e06f,_[_0xdcdc('0x9')](_0x10afc6,_0xdcdc('0xa'))['join'](',\x20'));_0x268a4f[_0xdcdc('0xb')]();}else{logger[_0xdcdc('0xc')](_0xdcdc('0xd'),_0x46e06f,_0x2b86fe[_0xdcdc('0xe')]);if(_0x2b86fe['priority']){var _0xd28c05=_['findIndex'](_0x268a4f['rules'](),{'p':_0x2b86fe['priority']});if(_0xd28c05>=0x0){logger[_0xdcdc('0xc')](_0xdcdc('0xf'),_0x46e06f,_0x2b86fe[_0xdcdc('0xe')]||_0xdcdc('0x10'),_0xd28c05);_0x268a4f['next'](_0xd28c05);}else{logger[_0xdcdc('0xc')](_0xdcdc('0x11'),_0x46e06f,_0x2b86fe[_0xdcdc('0xe')]||_0xdcdc('0x10'));_0x268a4f['stop']();}}else{_0x268a4f[_0xdcdc('0x10')]();}}}catch(_0x2fe43b){logger[_0xdcdc('0x7')](_0xdcdc('0x8'),_0x46e06f,JSON[_0xdcdc('0x12')](_0x2fe43b));_0x268a4f['stop']();}};}; \ 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 4f96aab..822fbe6 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 _0x73f5=['lodash','./utils','../../../../config/logger','routing','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','getMustacheRender','channel','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','interaction','Message','create','then','info','catch','error','stringify','[%s][MESSAGE]\x20%s','stop'];(function(_0x4d4a74,_0x344a11){var _0x5491d8=function(_0x400056){while(--_0x400056){_0x4d4a74['push'](_0x4d4a74['shift']());}};_0x5491d8(++_0x344a11);}(_0x73f5,0x1cb));var _0x573f=function(_0x4b46cb,_0x16eeb8){_0x4b46cb=_0x4b46cb-0x0;var _0x2378c2=_0x73f5[_0x4b46cb];return _0x2378c2;};'use strict';var _=require(_0x573f('0x0'));var utils=require(_0x573f('0x1'));var logger=require(_0x573f('0x2'))(_0x573f('0x3'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0x573f('0x4')),'mailMessage':require(_0x573f('0x5')),'smsMessage':require(_0x573f('0x6')),'faxMessage':require(_0x573f('0x7')),'whatsappMessage':require(_0x573f('0x8'))};exports[_0x573f('0x9')]=function(_0x242662,_0x511645){return function(_0x2e7512){try{var _0x507ca6={'body':utils[_0x573f('0xa')](_0x511645[0x0],this),'ContactId':this['contact']['id']};if(this[_0x573f('0xb')]==='chat'){_0x507ca6[_0x573f('0xc')]=this[_0x573f('0xd')]['id'];}else{_0x507ca6[_[_0x573f('0xe')](this['channel'])+_0x573f('0xf')]=this['account']['id'];}_0x507ca6[_[_0x573f('0xe')](this[_0x573f('0xb')])+_0x573f('0x10')]=this[_0x573f('0x11')]['id'];if(rpc[this['channel']+'Message']){return rpc[this['channel']+_0x573f('0x12')][_0x573f('0x13')](_0x507ca6)[_0x573f('0x14')](function(_0x322304){logger[_0x573f('0x15')]('[%s][MESSAGE]\x20%s',_0x242662,_0x507ca6['body']);_0x2e7512['next']();})[_0x573f('0x16')](function(_0x149144){logger[_0x573f('0x17')]('[%s][MESSAGE]\x20%s',_0x242662,JSON[_0x573f('0x18')](_0x149144));_0x2e7512['stop']();});}}catch(_0x55d73f){logger['error'](_0x573f('0x19'),_0x242662,JSON[_0x573f('0x18')](_0x55d73f));_0x2e7512[_0x573f('0x1a')]();}};}; \ No newline at end of file +var _0x7d61=['AccountId','InteractionId','interaction','Message','create','info','[%s][MESSAGE]\x20%s','body','next','catch','stop','stringify','lodash','../../../../config/logger','routing','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','consequence','contact','channel','chat','ChatWebsiteId','account','upperFirst'];(function(_0x234ae1,_0x42bdd6){var _0x227ba0=function(_0x1f6531){while(--_0x1f6531){_0x234ae1['push'](_0x234ae1['shift']());}};_0x227ba0(++_0x42bdd6);}(_0x7d61,0x16a));var _0x17d6=function(_0x30530b,_0x25da13){_0x30530b=_0x30530b-0x0;var _0x25c10b=_0x7d61[_0x30530b];return _0x25c10b;};'use strict';var _=require(_0x17d6('0x0'));var utils=require('./utils');var logger=require(_0x17d6('0x1'))(_0x17d6('0x2'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0x17d6('0x3')),'smsMessage':require(_0x17d6('0x4')),'faxMessage':require(_0x17d6('0x5')),'whatsappMessage':require('../../rpc/whatsappMessage')};exports[_0x17d6('0x6')]=function(_0x2ab7af,_0x1b65a3){return function(_0x59b0e4){try{var _0x440db6={'body':utils['getMustacheRender'](_0x1b65a3[0x0],this),'ContactId':this[_0x17d6('0x7')]['id']};if(this[_0x17d6('0x8')]===_0x17d6('0x9')){_0x440db6[_0x17d6('0xa')]=this[_0x17d6('0xb')]['id'];}else{_0x440db6[_[_0x17d6('0xc')](this['channel'])+_0x17d6('0xd')]=this['account']['id'];}_0x440db6[_[_0x17d6('0xc')](this[_0x17d6('0x8')])+_0x17d6('0xe')]=this[_0x17d6('0xf')]['id'];if(rpc[this[_0x17d6('0x8')]+_0x17d6('0x10')]){return rpc[this[_0x17d6('0x8')]+_0x17d6('0x10')][_0x17d6('0x11')](_0x440db6)['then'](function(_0x36b265){logger[_0x17d6('0x12')](_0x17d6('0x13'),_0x2ab7af,_0x440db6[_0x17d6('0x14')]);_0x59b0e4[_0x17d6('0x15')]();})[_0x17d6('0x16')](function(_0x501074){logger['error']('[%s][MESSAGE]\x20%s',_0x2ab7af,JSON['stringify'](_0x501074));_0x59b0e4[_0x17d6('0x17')]();});}}catch(_0x1bb73f){logger['error']('[%s][MESSAGE]\x20%s',_0x2ab7af,JSON[_0x17d6('0x18')](_0x1bb73f));_0x59b0e4[_0x17d6('0x17')]();}};}; \ 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 462be04..dec166d 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 _0x59d4=['stringify','stop','./utils','../../../../config/logger','consequence','info','[%s][NOOP]\x20%s','getMustacheRender','next'];(function(_0x3b3f4f,_0x403216){var _0x174dbe=function(_0x30e333){while(--_0x30e333){_0x3b3f4f['push'](_0x3b3f4f['shift']());}};_0x174dbe(++_0x403216);}(_0x59d4,0xc8));var _0x459d=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x59d4[_0x21a9d9];return _0x46adce;};'use strict';var utils=require(_0x459d('0x0'));var logger=require(_0x459d('0x1'))('routing');exports[_0x459d('0x2')]=function(_0x3bf664,_0xcff38b){return function(_0xc179fc){try{logger[_0x459d('0x3')](_0x459d('0x4'),_0x3bf664,utils[_0x459d('0x5')](_0xcff38b[0x0],this));_0xc179fc[_0x459d('0x6')]();}catch(_0x5e80f5){logger['error'](_0x459d('0x4'),_0x3bf664,JSON[_0x459d('0x7')](_0x5e80f5));_0xc179fc[_0x459d('0x8')]();}};}; \ No newline at end of file +var _0x99df=['next','stringify','stop','./utils','../../../../config/logger','routing','info','[%s][NOOP]\x20%s'];(function(_0x5d4091,_0x3f4103){var _0x542345=function(_0x4cb1c7){while(--_0x4cb1c7){_0x5d4091['push'](_0x5d4091['shift']());}};_0x542345(++_0x3f4103);}(_0x99df,0x123));var _0xf99d=function(_0x1969a7,_0x5a133a){_0x1969a7=_0x1969a7-0x0;var _0x3d665f=_0x99df[_0x1969a7];return _0x3d665f;};'use strict';var utils=require(_0xf99d('0x0'));var logger=require(_0xf99d('0x1'))(_0xf99d('0x2'));exports['consequence']=function(_0x597bf8,_0x4d56b1){return function(_0x2fa819){try{logger[_0xf99d('0x3')](_0xf99d('0x4'),_0x597bf8,utils['getMustacheRender'](_0x4d56b1[0x0],this));_0x2fa819[_0xf99d('0x5')]();}catch(_0x261027){logger['error'](_0xf99d('0x4'),_0x597bf8,JSON[_0xf99d('0x6')](_0x261027));_0x2fa819[_0xf99d('0x7')]();}};}; \ 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 1a556f0..5978f30 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 _0x0641=['rrmemory','beepall','stack','validate','lodash','util','seq-queue','ioredis','../../../../config/environment','../../../../config/logger','routing','./strategy','defaults','localhost','socket.io-emitter','redis','queue_id','account','from','joinAt','emit','clone','push','capitalize','InteractionId','format','%sQueuesWaitingInteractions','%s:queue:%s','remove','pick','../../rpc/openchannelQueueReport','../../rpc/chatQueueReport','../../rpc/smsQueueReport','../../rpc/whatsappQueueReport','../../rpc/chatInteraction','../../rpc/faxInteraction','../../rpc/mailInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/whatsappInteraction','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','timeout\x20is\x20a\x20number','waiting','body','YYYY-MM-DD\x20HH:mm:ss','contact','list','upperFirst','QueueId','interaction','channel','MessageId','message','chat','AccountId','info','[%s][START:QUEUE][NAME:%s]','name','QueueReport','create','catch','error','create\x20queue\x20report','accepted','[%s][STOP:QUEUE][NAME:%s]','Interaction','update','then','timeout','[%s][END:QUEUE][NAME:%s]','update\x20queue\x20report','toLowerCase','length','[%s][QUEUE]\x20%s','map','atimeout','qtimeout','end','[%s][QUEUE]\x20ROUTING\x20STOPPED','rules','stop','complete','[%s][QUEUE]\x20APPLICATION\x20END','close'];(function(_0x423549,_0x242e63){var _0xdcb104=function(_0x6bff59){while(--_0x6bff59){_0x423549['push'](_0x423549['shift']());}};_0xdcb104(++_0x242e63);}(_0x0641,0x1ac));var _0x1064=function(_0x37e0ec,_0x4bcd14){_0x37e0ec=_0x37e0ec-0x0;var _0x4f2f8d=_0x0641[_0x37e0ec];return _0x4f2f8d;};'use strict';var schema=require(_0x1064('0x0'));var _=require(_0x1064('0x1'));var util=require(_0x1064('0x2'));var seqqueue=require(_0x1064('0x3'));var moment=require('moment');var Redis=require(_0x1064('0x4'));var config=require(_0x1064('0x5'));var logger=require(_0x1064('0x6'))(_0x1064('0x7'));var strategy=require(_0x1064('0x8'));config['redis']=_[_0x1064('0x9')](config['redis'],{'host':_0x1064('0xa'),'port':0x18eb});var io=require(_0x1064('0xb'))(new Redis(config[_0x1064('0xc')]));var attributes=['id',_0x1064('0xd'),_0x1064('0xe'),'queue',_0x1064('0xf'),_0x1064('0x10')];function emit(_0x49ea23,_0x5cd695,_0x1fe30a){io['to'](_0x49ea23)[_0x1064('0x11')](_0x5cd695,_0x1fe30a);}function emitChannelQueueInteraction(_0x28f313,_0x57ff56,_0x18d114,_0x5b96a2,_0x2a59e9,_0x3c83d3,_0x8e25f,_0xb928f3){var _0x803352=_[_0x1064('0x12')](_0x18d114);_0x803352[_0x1064('0xd')]=_0xb928f3;_0x803352['queue']=_0x57ff56;_0x803352['account']=_0x5b96a2;_0x803352['id']=_0x2a59e9;if(_0x3c83d3){attributes[_0x1064('0x13')](_[_0x1064('0x14')](_0x28f313)+_0x1064('0x15'));_0x8e25f[util[_0x1064('0x16')](_0x1064('0x17'),_0x28f313)][_0x2a59e9]=_['pick'](_0x803352,attributes);}else{delete _0x8e25f[util['format'](_0x1064('0x17'),_0x28f313)][_0x2a59e9];}emit(util[_0x1064('0x16')](_0x1064('0x18'),_0x28f313,_0x57ff56),util[_0x1064('0x16')]('%s_queue_waiting_interaction:%s',_0x28f313,_0x3c83d3?'save':_0x1064('0x19')),_[_0x1064('0x1a')](_0x803352,attributes));}var rpc={'openchannelQueueReport':require(_0x1064('0x1b')),'mailQueueReport':require('../../rpc/mailQueueReport'),'chatQueueReport':require(_0x1064('0x1c')),'smsQueueReport':require(_0x1064('0x1d')),'faxQueueReport':require('../../rpc/faxQueueReport'),'whatsappQueueReport':require(_0x1064('0x1e')),'chatInteraction':require(_0x1064('0x1f')),'faxInteraction':require(_0x1064('0x20')),'mailInteraction':require(_0x1064('0x21')),'openchannelInteraction':require(_0x1064('0x22')),'smsInteraction':require(_0x1064('0x23')),'whatsappInteraction':require(_0x1064('0x24'))};var queue=schema({'name':{'type':_0x1064('0x25'),'required':!![],'message':_0x1064('0x26')},'timeout':{'type':'number','message':_0x1064('0x27')}});function startRouting(_0x1d1008,_0x457b96,_0x4cd14d,_0x1816b2){if(_0x1d1008&&_0x457b96&&_0x4cd14d){_0x457b96[_0x1064('0x28')]+=0x1;var _0x37e5df={'uniqueid':_0x1d1008,'from':_0x4cd14d[_0x1064('0x29')]?_0x4cd14d['body'][_0x1064('0xf')]:'','joinAt':moment()[_0x1064('0x16')](_0x1064('0x2a')),'ContactId':_0x4cd14d['contact']?_0x4cd14d[_0x1064('0x2b')]['id']:null,'ListId':_0x4cd14d[_0x1064('0x2c')]?_0x4cd14d[_0x1064('0x2c')]['id']:null};_0x37e5df[_[_0x1064('0x2d')](_0x4cd14d['channel'])+_0x1064('0x2e')]=_0x457b96['id']||null;_0x37e5df[_[_0x1064('0x2d')](_0x4cd14d['channel'])+_0x1064('0x15')]=_0x4cd14d[_0x1064('0x2f')]?_0x4cd14d[_0x1064('0x2f')]['id']:null;_0x37e5df[_[_0x1064('0x2d')](_0x4cd14d[_0x1064('0x30')])+_0x1064('0x31')]=_0x4cd14d[_0x1064('0x32')]?_0x4cd14d[_0x1064('0x32')]['id']:null;_0x37e5df[_[_0x1064('0x2d')](_0x4cd14d[_0x1064('0x30')])+(_0x4cd14d[_0x1064('0x30')]!==_0x1064('0x33')?_0x1064('0x34'):'WebsiteId')]=_0x4cd14d[_0x1064('0xe')]?_0x4cd14d[_0x1064('0xe')]['id']:null;logger[_0x1064('0x35')](util['format'](_0x1064('0x36'),_0x1d1008,_0x457b96[_0x1064('0x37')]));emitChannelQueueInteraction(_0x4cd14d['channel'],_0x457b96[_0x1064('0x37')],_0x37e5df,_0x4cd14d[_0x1064('0xe')]['name'],_0x4cd14d[_0x1064('0x32')]['id'],!![],_0x1816b2,_0x457b96['id']);if(rpc[_0x4cd14d[_0x1064('0x30')]+_0x1064('0x38')]){return rpc[_0x4cd14d[_0x1064('0x30')]+_0x1064('0x38')][_0x1064('0x39')](_0x37e5df)[_0x1064('0x3a')](function(_0x582720){logger[_0x1064('0x3b')](_0x1064('0x3c'),_0x582720);});}}}function stopRouting(_0x579acc,_0x2c5804,_0x3788c2,_0x487e60){if(_0x579acc&&_0x2c5804){_0x2c5804[_0x1064('0x28')]-=0x1;var _0x55adf4={'leaveAt':moment()[_0x1064('0x16')]('YYYY-MM-DD\x20HH:mm:ss'),'acceptAt':moment()[_0x1064('0x16')](_0x1064('0x2a')),'reason':_0x1064('0x3d')};logger[_0x1064('0x35')](util[_0x1064('0x16')](_0x1064('0x3e'),_0x579acc,_0x2c5804[_0x1064('0x37')]));emitChannelQueueInteraction(_0x3788c2[_0x1064('0x30')],_0x2c5804[_0x1064('0x37')],_0x3788c2['body'],_0x3788c2['account'][_0x1064('0x37')],_0x3788c2[_0x1064('0x32')]['id'],![],_0x487e60,_0x2c5804['id']);return rpc[_0x3788c2[_0x1064('0x30')]+_0x1064('0x3f')][_0x1064('0x40')](_0x3788c2[_0x1064('0x2f')]['id'],{'queueId':_0x2c5804['id']})[_0x1064('0x41')](function(){if(rpc[_0x3788c2[_0x1064('0x30')]+_0x1064('0x38')]){return rpc[_0x3788c2[_0x1064('0x30')]+_0x1064('0x38')]['update'](_0x579acc,_0x55adf4)[_0x1064('0x3a')](function(_0x2b4374){logger['error']('update\x20queue\x20report',_0x2b4374);});}});}}function endRouting(_0x2e0c70,_0x106547,_0x532d2b,_0x21e23c){if(_0x2e0c70&&_0x106547){_0x106547[_0x1064('0x28')]-=0x1;var _0x1fe76d={'leaveAt':moment()[_0x1064('0x16')](_0x1064('0x2a')),'exitAt':moment()[_0x1064('0x16')](_0x1064('0x2a')),'reason':_0x1064('0x42')};logger[_0x1064('0x35')](util[_0x1064('0x16')](_0x1064('0x43'),_0x2e0c70,_0x106547[_0x1064('0x37')]));emitChannelQueueInteraction(_0x532d2b[_0x1064('0x30')],_0x106547[_0x1064('0x37')],_0x532d2b[_0x1064('0x29')],_0x532d2b[_0x1064('0xe')][_0x1064('0x37')],_0x532d2b[_0x1064('0x32')]['id'],![],_0x21e23c);if(rpc[_0x532d2b[_0x1064('0x30')]+_0x1064('0x38')]){return rpc[_0x532d2b[_0x1064('0x30')]+'QueueReport']['update'](_0x2e0c70,_0x1fe76d)['catch'](function(_0x49f224){logger['error'](_0x1064('0x44'),_0x49f224);});}}}function handleFindQueue(_0x55537a){return function(_0x4744ef){return _0x4744ef[_0x1064('0x37')][_0x1064('0x45')]()===_0x55537a[_0x1064('0x45')]();};}exports['consequence']=function(_0x76eebc,_0x380d50,_0x498e1b,_0x6b1204){return function(_0x3e12d3){try{var _0x468a6e={'name':_0x380d50[0x0],'timeout':_0x380d50[0x1]};var _0x108f1b=queue[_0x1064('0x0')](_0x468a6e,{'typecast':!![]});if(_0x108f1b[_0x1064('0x46')]){logger[_0x1064('0x3b')](_0x1064('0x47'),_0x76eebc,_[_0x1064('0x48')](_0x108f1b,'message')['join'](',\x20'));_0x3e12d3['stop']();}else{var _0x29cb6d=_['find'](_0x498e1b[_0x6b1204['channel']+'Queues'],handleFindQueue(_0x468a6e[_0x1064('0x37')]));if(_0x29cb6d){startRouting(_0x76eebc,_0x29cb6d,_0x6b1204,_0x498e1b);var _0x3acff0=(_0x29cb6d[_0x1064('0x42')]||0xa)*0x3e8;var _0x285956=(_0x468a6e[_0x1064('0x42')]||0x14)*0x3e8;var _0x7ac88b;if(_0x3acff0>_0x285956){_0x285956=_0x3acff0;}var _0x4caeb0=seqqueue['createQueue'](_0x3acff0);_0x4caeb0['id']=_0x76eebc;_0x4caeb0[_0x1064('0x49')]=_0x3acff0;_0x4caeb0[_0x1064('0x4a')]=_0x285956;_0x4caeb0['channel']=_0x6b1204[_0x1064('0x30')];_0x498e1b['rules'][_0x76eebc]['on'](_0x1064('0x4b'),function(){logger['info'](_0x1064('0x4c'),_0x76eebc);stopRouting(_0x76eebc,_0x29cb6d,_0x6b1204,_0x498e1b);clearTimeout(_0x7ac88b);_0x7ac88b=undefined;_0x4caeb0['close'](!![]);if(_0x498e1b[_0x1064('0x4d')][_0x76eebc]){delete _0x498e1b[_0x1064('0x4d')][_0x76eebc];}_0x3e12d3[_0x1064('0x4e')]();});_0x498e1b[_0x1064('0x4d')][_0x76eebc]['on'](_0x1064('0x4f'),function(){if(_0x498e1b[_0x1064('0x4d')][_0x76eebc]){delete _0x498e1b[_0x1064('0x4d')][_0x76eebc];}});_0x7ac88b=setTimeout(function(){logger[_0x1064('0x35')](_0x1064('0x50'),_0x76eebc);endRouting(_0x76eebc,_0x29cb6d,_0x6b1204,_0x498e1b);clearTimeout(_0x7ac88b);_0x4caeb0[_0x1064('0x51')](!![]);_0x3e12d3['next']();},_0x285956);switch(_0x29cb6d['strategy']){case _0x1064('0x52'):strategy[_0x1064('0x52')](_0x4caeb0,_0x29cb6d,_0x498e1b,_0x6b1204);break;default:strategy[_0x1064('0x53')](_0x4caeb0,_0x29cb6d,_0x498e1b,_0x6b1204);}}else{logger[_0x1064('0x3b')]('[%s][QUEUE]\x20queue\x20not\x20found\x20%s',_0x76eebc,_0x468a6e[_0x1064('0x37')]);_0x3e12d3[_0x1064('0x4e')]();}}}catch(_0x3f0e7b){logger[_0x1064('0x3b')](_0x1064('0x47'),_0x76eebc,_0x3f0e7b[_0x1064('0x54')]);_0x3e12d3[_0x1064('0x4e')]();}};}; \ No newline at end of file +var _0xf577=['format','%sQueuesWaitingInteractions','pick','%s:queue:%s','%s_queue_waiting_interaction:%s','save','../../rpc/mailQueueReport','../../rpc/chatQueueReport','../../rpc/faxQueueReport','../../rpc/whatsappQueueReport','../../rpc/chatInteraction','../../rpc/faxInteraction','../../rpc/smsInteraction','../../rpc/whatsappInteraction','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','body','YYYY-MM-DD\x20HH:mm:ss','contact','list','upperFirst','channel','QueueId','interaction','MessageId','message','chat','AccountId','WebsiteId','info','[%s][START:QUEUE][NAME:%s]','name','QueueReport','create','catch','error','create\x20queue\x20report','waiting','accepted','Interaction','update','then','update\x20queue\x20report','timeout','[%s][END:QUEUE][NAME:%s]','toLowerCase','consequence','length','join','find','Queues','createQueue','qtimeout','end','[%s][QUEUE]\x20ROUTING\x20STOPPED','close','rules','[%s][QUEUE]\x20APPLICATION\x20END','next','rrmemory','beepall','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','stop','[%s][QUEUE]\x20%s','stack','validate','util','moment','../../../../config/environment','../../../../config/logger','routing','./strategy','redis','defaults','localhost','queue_id','account','queue','from','emit','push','capitalize','InteractionId'];(function(_0x4a781b,_0x392eff){var _0xdfc4c4=function(_0x27fd7b){while(--_0x27fd7b){_0x4a781b['push'](_0x4a781b['shift']());}};_0xdfc4c4(++_0x392eff);}(_0xf577,0x142));var _0x7f57=function(_0x38ced4,_0x24263f){_0x38ced4=_0x38ced4-0x0;var _0x547c07=_0xf577[_0x38ced4];return _0x547c07;};'use strict';var schema=require(_0x7f57('0x0'));var _=require('lodash');var util=require(_0x7f57('0x1'));var seqqueue=require('seq-queue');var moment=require(_0x7f57('0x2'));var Redis=require('ioredis');var config=require(_0x7f57('0x3'));var logger=require(_0x7f57('0x4'))(_0x7f57('0x5'));var strategy=require(_0x7f57('0x6'));config[_0x7f57('0x7')]=_[_0x7f57('0x8')](config[_0x7f57('0x7')],{'host':_0x7f57('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x7f57('0x7')]));var attributes=['id',_0x7f57('0xa'),_0x7f57('0xb'),_0x7f57('0xc'),_0x7f57('0xd'),'joinAt'];function emit(_0x18297d,_0x2a5cf2,_0x3379d7){io['to'](_0x18297d)[_0x7f57('0xe')](_0x2a5cf2,_0x3379d7);}function emitChannelQueueInteraction(_0x46efe7,_0x170170,_0x46d30a,_0x106f2b,_0x1e6e2f,_0x500811,_0x88bf2a,_0x6694e){var _0x5462a4=_['clone'](_0x46d30a);_0x5462a4['queue_id']=_0x6694e;_0x5462a4['queue']=_0x170170;_0x5462a4['account']=_0x106f2b;_0x5462a4['id']=_0x1e6e2f;if(_0x500811){attributes[_0x7f57('0xf')](_[_0x7f57('0x10')](_0x46efe7)+_0x7f57('0x11'));_0x88bf2a[util[_0x7f57('0x12')](_0x7f57('0x13'),_0x46efe7)][_0x1e6e2f]=_[_0x7f57('0x14')](_0x5462a4,attributes);}else{delete _0x88bf2a[util[_0x7f57('0x12')]('%sQueuesWaitingInteractions',_0x46efe7)][_0x1e6e2f];}emit(util[_0x7f57('0x12')](_0x7f57('0x15'),_0x46efe7,_0x170170),util['format'](_0x7f57('0x16'),_0x46efe7,_0x500811?_0x7f57('0x17'):'remove'),_[_0x7f57('0x14')](_0x5462a4,attributes));}var rpc={'openchannelQueueReport':require('../../rpc/openchannelQueueReport'),'mailQueueReport':require(_0x7f57('0x18')),'chatQueueReport':require(_0x7f57('0x19')),'smsQueueReport':require('../../rpc/smsQueueReport'),'faxQueueReport':require(_0x7f57('0x1a')),'whatsappQueueReport':require(_0x7f57('0x1b')),'chatInteraction':require(_0x7f57('0x1c')),'faxInteraction':require(_0x7f57('0x1d')),'mailInteraction':require('../../rpc/mailInteraction'),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'smsInteraction':require(_0x7f57('0x1e')),'whatsappInteraction':require(_0x7f57('0x1f'))};var queue=schema({'name':{'type':_0x7f57('0x20'),'required':!![],'message':_0x7f57('0x21')},'timeout':{'type':_0x7f57('0x22'),'message':_0x7f57('0x23')}});function startRouting(_0x4abd49,_0x329321,_0x3efc81,_0x39f1fc){if(_0x4abd49&&_0x329321&&_0x3efc81){_0x329321['waiting']+=0x1;var _0xec40a6={'uniqueid':_0x4abd49,'from':_0x3efc81[_0x7f57('0x24')]?_0x3efc81[_0x7f57('0x24')]['from']:'','joinAt':moment()[_0x7f57('0x12')](_0x7f57('0x25')),'ContactId':_0x3efc81[_0x7f57('0x26')]?_0x3efc81[_0x7f57('0x26')]['id']:null,'ListId':_0x3efc81[_0x7f57('0x27')]?_0x3efc81[_0x7f57('0x27')]['id']:null};_0xec40a6[_[_0x7f57('0x28')](_0x3efc81[_0x7f57('0x29')])+_0x7f57('0x2a')]=_0x329321['id']||null;_0xec40a6[_[_0x7f57('0x28')](_0x3efc81[_0x7f57('0x29')])+_0x7f57('0x11')]=_0x3efc81[_0x7f57('0x2b')]?_0x3efc81[_0x7f57('0x2b')]['id']:null;_0xec40a6[_['upperFirst'](_0x3efc81[_0x7f57('0x29')])+_0x7f57('0x2c')]=_0x3efc81[_0x7f57('0x2d')]?_0x3efc81[_0x7f57('0x2d')]['id']:null;_0xec40a6[_[_0x7f57('0x28')](_0x3efc81[_0x7f57('0x29')])+(_0x3efc81[_0x7f57('0x29')]!==_0x7f57('0x2e')?_0x7f57('0x2f'):_0x7f57('0x30'))]=_0x3efc81[_0x7f57('0xb')]?_0x3efc81[_0x7f57('0xb')]['id']:null;logger[_0x7f57('0x31')](util[_0x7f57('0x12')](_0x7f57('0x32'),_0x4abd49,_0x329321[_0x7f57('0x33')]));emitChannelQueueInteraction(_0x3efc81[_0x7f57('0x29')],_0x329321['name'],_0xec40a6,_0x3efc81['account']['name'],_0x3efc81[_0x7f57('0x2d')]['id'],!![],_0x39f1fc,_0x329321['id']);if(rpc[_0x3efc81[_0x7f57('0x29')]+'QueueReport']){return rpc[_0x3efc81[_0x7f57('0x29')]+_0x7f57('0x34')][_0x7f57('0x35')](_0xec40a6)[_0x7f57('0x36')](function(_0xc107ac){logger[_0x7f57('0x37')](_0x7f57('0x38'),_0xc107ac);});}}}function stopRouting(_0x417210,_0x186218,_0x47ca2,_0x48173b){if(_0x417210&&_0x186218){_0x186218[_0x7f57('0x39')]-=0x1;var _0x1481d6={'leaveAt':moment()[_0x7f57('0x12')](_0x7f57('0x25')),'acceptAt':moment()[_0x7f57('0x12')]('YYYY-MM-DD\x20HH:mm:ss'),'reason':_0x7f57('0x3a')};logger[_0x7f57('0x31')](util[_0x7f57('0x12')]('[%s][STOP:QUEUE][NAME:%s]',_0x417210,_0x186218[_0x7f57('0x33')]));emitChannelQueueInteraction(_0x47ca2[_0x7f57('0x29')],_0x186218['name'],_0x47ca2[_0x7f57('0x24')],_0x47ca2[_0x7f57('0xb')][_0x7f57('0x33')],_0x47ca2[_0x7f57('0x2d')]['id'],![],_0x48173b,_0x186218['id']);return rpc[_0x47ca2[_0x7f57('0x29')]+_0x7f57('0x3b')][_0x7f57('0x3c')](_0x47ca2['interaction']['id'],{'queueId':_0x186218['id']})[_0x7f57('0x3d')](function(){if(rpc[_0x47ca2[_0x7f57('0x29')]+_0x7f57('0x34')]){return rpc[_0x47ca2['channel']+_0x7f57('0x34')][_0x7f57('0x3c')](_0x417210,_0x1481d6)[_0x7f57('0x36')](function(_0x2a8e43){logger[_0x7f57('0x37')](_0x7f57('0x3e'),_0x2a8e43);});}});}}function endRouting(_0x490e03,_0x43a8db,_0x4268be,_0x4949cd){if(_0x490e03&&_0x43a8db){_0x43a8db[_0x7f57('0x39')]-=0x1;var _0x30c53f={'leaveAt':moment()['format'](_0x7f57('0x25')),'exitAt':moment()[_0x7f57('0x12')](_0x7f57('0x25')),'reason':_0x7f57('0x3f')};logger[_0x7f57('0x31')](util[_0x7f57('0x12')](_0x7f57('0x40'),_0x490e03,_0x43a8db[_0x7f57('0x33')]));emitChannelQueueInteraction(_0x4268be[_0x7f57('0x29')],_0x43a8db[_0x7f57('0x33')],_0x4268be[_0x7f57('0x24')],_0x4268be[_0x7f57('0xb')]['name'],_0x4268be[_0x7f57('0x2d')]['id'],![],_0x4949cd);if(rpc[_0x4268be[_0x7f57('0x29')]+'QueueReport']){return rpc[_0x4268be[_0x7f57('0x29')]+_0x7f57('0x34')][_0x7f57('0x3c')](_0x490e03,_0x30c53f)[_0x7f57('0x36')](function(_0x47d3e5){logger[_0x7f57('0x37')](_0x7f57('0x3e'),_0x47d3e5);});}}}function handleFindQueue(_0x58f900){return function(_0x346b6f){return _0x346b6f[_0x7f57('0x33')][_0x7f57('0x41')]()===_0x58f900[_0x7f57('0x41')]();};}exports[_0x7f57('0x42')]=function(_0x59b6ce,_0x319b19,_0x368a12,_0xe122d0){return function(_0x4cadb0){try{var _0x5a20c6={'name':_0x319b19[0x0],'timeout':_0x319b19[0x1]};var _0x490928=queue[_0x7f57('0x0')](_0x5a20c6,{'typecast':!![]});if(_0x490928[_0x7f57('0x43')]){logger[_0x7f57('0x37')]('[%s][QUEUE]\x20%s',_0x59b6ce,_['map'](_0x490928,_0x7f57('0x2d'))[_0x7f57('0x44')](',\x20'));_0x4cadb0['stop']();}else{var _0x16c5de=_[_0x7f57('0x45')](_0x368a12[_0xe122d0[_0x7f57('0x29')]+_0x7f57('0x46')],handleFindQueue(_0x5a20c6[_0x7f57('0x33')]));if(_0x16c5de){startRouting(_0x59b6ce,_0x16c5de,_0xe122d0,_0x368a12);var _0x12c712=(_0x16c5de[_0x7f57('0x3f')]||0xa)*0x3e8;var _0x5526e4=(_0x5a20c6[_0x7f57('0x3f')]||0x14)*0x3e8;var _0xe8b2d0;if(_0x12c712>_0x5526e4){_0x5526e4=_0x12c712;}var _0x51b2a0=seqqueue[_0x7f57('0x47')](_0x12c712);_0x51b2a0['id']=_0x59b6ce;_0x51b2a0['atimeout']=_0x12c712;_0x51b2a0[_0x7f57('0x48')]=_0x5526e4;_0x51b2a0[_0x7f57('0x29')]=_0xe122d0['channel'];_0x368a12['rules'][_0x59b6ce]['on'](_0x7f57('0x49'),function(){logger[_0x7f57('0x31')](_0x7f57('0x4a'),_0x59b6ce);stopRouting(_0x59b6ce,_0x16c5de,_0xe122d0,_0x368a12);clearTimeout(_0xe8b2d0);_0xe8b2d0=undefined;_0x51b2a0[_0x7f57('0x4b')](!![]);if(_0x368a12[_0x7f57('0x4c')][_0x59b6ce]){delete _0x368a12['rules'][_0x59b6ce];}_0x4cadb0['stop']();});_0x368a12['rules'][_0x59b6ce]['on']('complete',function(){if(_0x368a12[_0x7f57('0x4c')][_0x59b6ce]){delete _0x368a12[_0x7f57('0x4c')][_0x59b6ce];}});_0xe8b2d0=setTimeout(function(){logger[_0x7f57('0x31')](_0x7f57('0x4d'),_0x59b6ce);endRouting(_0x59b6ce,_0x16c5de,_0xe122d0,_0x368a12);clearTimeout(_0xe8b2d0);_0x51b2a0[_0x7f57('0x4b')](!![]);_0x4cadb0[_0x7f57('0x4e')]();},_0x5526e4);switch(_0x16c5de['strategy']){case _0x7f57('0x4f'):strategy['rrmemory'](_0x51b2a0,_0x16c5de,_0x368a12,_0xe122d0);break;default:strategy[_0x7f57('0x50')](_0x51b2a0,_0x16c5de,_0x368a12,_0xe122d0);}}else{logger['error'](_0x7f57('0x51'),_0x59b6ce,_0x5a20c6['name']);_0x4cadb0[_0x7f57('0x52')]();}}}catch(_0x3d686f){logger[_0x7f57('0x37')](_0x7f57('0x53'),_0x59b6ce,_0x3d686f[_0x7f57('0x54')]);_0x4cadb0['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 40a3869..15d1879 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 _0xadb8=['./util','routing','notificationId','squeue','realtime','push','handleRun','bind','handleTimeout','handleDrained','prototype','debug','[%s][AGENT]\x20try\x20with\x20%s','isNil','agents','agent','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','forcedOwnership','isAgentAvailable','channel','busy','busyQueue','showNotification','writeLog',':FORCED','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','hideNotification','removeWaitingNotification','TIMEOUT'];(function(_0x10004e,_0xd701e6){var _0x5af990=function(_0x4bab6a){while(--_0x4bab6a){_0x10004e['push'](_0x10004e['shift']());}};_0x5af990(++_0xd701e6);}(_0xadb8,0x1d0));var _0x8adb=function(_0x3b7cc9,_0x18cd9b){_0x3b7cc9=_0x3b7cc9-0x0;var _0x5751ea=_0xadb8[_0x3b7cc9];return _0x5751ea;};'use strict';var _=require('lodash');var uuid=require('uuid');var util=require(_0x8adb('0x0'));var logger=require('../../../../../config/logger')(_0x8adb('0x1'));var Agent=function(_0x2a0b30,_0x24f912,_0x1bf88c,_0x44fdf7){this[_0x8adb('0x2')]=uuid['v4']();this[_0x8adb('0x3')]=_0x2a0b30;this['agent']=_0x24f912;this[_0x8adb('0x4')]=_0x1bf88c;this[_0x8adb('0x1')]=_0x44fdf7;this[_0x8adb('0x3')][_0x8adb('0x5')](this[_0x8adb('0x6')][_0x8adb('0x7')](this),this[_0x8adb('0x8')]['bind'](this));this['squeue']['on']('timeout',this[_0x8adb('0x8')]['bind'](this));this['squeue']['on']('drained',this[_0x8adb('0x9')][_0x8adb('0x7')](this));};Agent[_0x8adb('0xa')][_0x8adb('0x5')]=function(){this[_0x8adb('0x3')][_0x8adb('0x5')](this[_0x8adb('0x6')][_0x8adb('0x7')](this),this[_0x8adb('0x8')][_0x8adb('0x7')](this));};Agent['prototype']['handleDrained']=function(){this['handleTimeout'](!![]);};Agent[_0x8adb('0xa')]['handleRun']=function(){logger[_0x8adb('0xb')](_0x8adb('0xc'),this[_0x8adb('0x3')]['id'],this['agent']['id']);if(_[_0x8adb('0xd')](this[_0x8adb('0x4')][_0x8adb('0xe')][this[_0x8adb('0xf')]['id']])){logger[_0x8adb('0xb')](_0x8adb('0x10'),this['squeue']['id'],this[_0x8adb('0xf')]['id']);setTimeout(this[_0x8adb('0x5')]['bind'](this),0x3e8);}else{if(this['routing'][_0x8adb('0x11')]||util[_0x8adb('0x12')](this[_0x8adb('0x3')]['id'],this[_0x8adb('0x4')][_0x8adb('0xe')][this[_0x8adb('0xf')]['id']],this[_0x8adb('0x3')][_0x8adb('0x13')],![])){this[_0x8adb('0x4')][_0x8adb('0xe')][this[_0x8adb('0xf')]['id']][_0x8adb('0x14')]=!![];this['realtime']['agents'][this[_0x8adb('0xf')]['id']][_0x8adb('0x15')]=undefined;util['saveWaitingNotification'](this[_0x8adb('0x4')],this[_0x8adb('0x1')],this[_0x8adb('0xf')],this[_0x8adb('0x3')][_0x8adb('0x13')]);util[_0x8adb('0x16')](this['notificationId'],this[_0x8adb('0x3')]['id'],this[_0x8adb('0x4')][_0x8adb('0xe')][this['agent']['id']],null,this[_0x8adb('0x1')]);util[_0x8adb('0x17')](this[_0x8adb('0x3')]['id'],this[_0x8adb('0x4')][_0x8adb('0xe')][this[_0x8adb('0xf')]['id']],'RINGING'+(this[_0x8adb('0x1')][_0x8adb('0x11')]?_0x8adb('0x18'):''));}else{logger[_0x8adb('0xb')](_0x8adb('0x19'),this[_0x8adb('0x3')]['id'],this[_0x8adb('0xf')]['id']);setTimeout(this['push'][_0x8adb('0x7')](this),0x3e8);}}};Agent[_0x8adb('0xa')][_0x8adb('0x8')]=function(_0x824eda){if(_['isNil'](this[_0x8adb('0x4')]['agents'][this[_0x8adb('0xf')]['id']])){return logger[_0x8adb('0xb')](_0x8adb('0x10'),this[_0x8adb('0x3')]['id'],this['agent']['id']);}else{logger[_0x8adb('0xb')]('[%s][AGENT]\x20timeout\x20with\x20%s',this[_0x8adb('0x3')]['id'],this['agent']['id']);util[_0x8adb('0x1a')](this[_0x8adb('0x2')],this[_0x8adb('0x3')]['id'],this[_0x8adb('0x4')][_0x8adb('0xe')][this[_0x8adb('0xf')]['id']],null,this['routing']);this['realtime'][_0x8adb('0xe')][this[_0x8adb('0xf')]['id']][_0x8adb('0x14')]=![];this[_0x8adb('0x4')][_0x8adb('0xe')][this[_0x8adb('0xf')]['id']][_0x8adb('0x15')]=undefined;util[_0x8adb('0x1b')](this[_0x8adb('0x4')],this[_0x8adb('0x1')],this[_0x8adb('0xf')],this[_0x8adb('0x3')][_0x8adb('0x13')]);util['writeLog'](this[_0x8adb('0x3')]['id'],this[_0x8adb('0x4')]['agents'][this[_0x8adb('0xf')]['id']],_0x824eda?'STOP':_0x8adb('0x1c'));}if(!_0x824eda){setTimeout(this[_0x8adb('0x5')][_0x8adb('0x7')](this),0x3e8);}};function agent(_0x108a80,_0x365290,_0x480897,_0x7e3f1e){return new Agent(_0x108a80,_0x365290,_0x480897,_0x7e3f1e);}module['exports']=agent; \ No newline at end of file +var _0x0faf=['showNotification','writeLog','RINGING','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','[%s][AGENT]\x20timeout\x20with\x20%s','removeWaitingNotification','STOP','TIMEOUT','exports','lodash','./util','../../../../../config/logger','routing','notificationId','squeue','realtime','push','handleRun','handleTimeout','bind','drained','handleDrained','prototype','[%s][AGENT]\x20try\x20with\x20%s','agent','isNil','agents','debug','forcedOwnership','channel','busy','busyQueue','saveWaitingNotification'];(function(_0x18981c,_0x2246c4){var _0x506aa7=function(_0x28e25e){while(--_0x28e25e){_0x18981c['push'](_0x18981c['shift']());}};_0x506aa7(++_0x2246c4);}(_0x0faf,0x132));var _0xf0fa=function(_0x3b0999,_0x3c9835){_0x3b0999=_0x3b0999-0x0;var _0x585226=_0x0faf[_0x3b0999];return _0x585226;};'use strict';var _=require(_0xf0fa('0x0'));var uuid=require('uuid');var util=require(_0xf0fa('0x1'));var logger=require(_0xf0fa('0x2'))(_0xf0fa('0x3'));var Agent=function(_0x35a260,_0xccb93e,_0xdc9ce3,_0x515b12){this[_0xf0fa('0x4')]=uuid['v4']();this[_0xf0fa('0x5')]=_0x35a260;this['agent']=_0xccb93e;this[_0xf0fa('0x6')]=_0xdc9ce3;this[_0xf0fa('0x3')]=_0x515b12;this[_0xf0fa('0x5')][_0xf0fa('0x7')](this[_0xf0fa('0x8')]['bind'](this),this[_0xf0fa('0x9')][_0xf0fa('0xa')](this));this['squeue']['on']('timeout',this[_0xf0fa('0x9')][_0xf0fa('0xa')](this));this[_0xf0fa('0x5')]['on'](_0xf0fa('0xb'),this[_0xf0fa('0xc')][_0xf0fa('0xa')](this));};Agent[_0xf0fa('0xd')][_0xf0fa('0x7')]=function(){this['squeue'][_0xf0fa('0x7')](this['handleRun'][_0xf0fa('0xa')](this),this['handleTimeout'][_0xf0fa('0xa')](this));};Agent[_0xf0fa('0xd')][_0xf0fa('0xc')]=function(){this['handleTimeout'](!![]);};Agent['prototype'][_0xf0fa('0x8')]=function(){logger['debug'](_0xf0fa('0xe'),this[_0xf0fa('0x5')]['id'],this[_0xf0fa('0xf')]['id']);if(_[_0xf0fa('0x10')](this[_0xf0fa('0x6')][_0xf0fa('0x11')][this[_0xf0fa('0xf')]['id']])){logger[_0xf0fa('0x12')]('[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s',this[_0xf0fa('0x5')]['id'],this[_0xf0fa('0xf')]['id']);setTimeout(this[_0xf0fa('0x7')][_0xf0fa('0xa')](this),0x3e8);}else{if(this[_0xf0fa('0x3')][_0xf0fa('0x13')]||util['isAgentAvailable'](this['squeue']['id'],this[_0xf0fa('0x6')][_0xf0fa('0x11')][this[_0xf0fa('0xf')]['id']],this[_0xf0fa('0x5')][_0xf0fa('0x14')],![])){this[_0xf0fa('0x6')][_0xf0fa('0x11')][this[_0xf0fa('0xf')]['id']][_0xf0fa('0x15')]=!![];this[_0xf0fa('0x6')][_0xf0fa('0x11')][this['agent']['id']][_0xf0fa('0x16')]=undefined;util[_0xf0fa('0x17')](this[_0xf0fa('0x6')],this[_0xf0fa('0x3')],this[_0xf0fa('0xf')],this[_0xf0fa('0x5')][_0xf0fa('0x14')]);util[_0xf0fa('0x18')](this[_0xf0fa('0x4')],this['squeue']['id'],this[_0xf0fa('0x6')][_0xf0fa('0x11')][this['agent']['id']],null,this[_0xf0fa('0x3')]);util[_0xf0fa('0x19')](this[_0xf0fa('0x5')]['id'],this['realtime'][_0xf0fa('0x11')][this[_0xf0fa('0xf')]['id']],_0xf0fa('0x1a')+(this[_0xf0fa('0x3')]['forcedOwnership']?':FORCED':''));}else{logger[_0xf0fa('0x12')](_0xf0fa('0x1b'),this[_0xf0fa('0x5')]['id'],this[_0xf0fa('0xf')]['id']);setTimeout(this['push'][_0xf0fa('0xa')](this),0x3e8);}}};Agent[_0xf0fa('0xd')][_0xf0fa('0x9')]=function(_0x5a4fd3){if(_[_0xf0fa('0x10')](this['realtime'][_0xf0fa('0x11')][this[_0xf0fa('0xf')]['id']])){return logger[_0xf0fa('0x12')]('[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s',this[_0xf0fa('0x5')]['id'],this[_0xf0fa('0xf')]['id']);}else{logger[_0xf0fa('0x12')](_0xf0fa('0x1c'),this[_0xf0fa('0x5')]['id'],this[_0xf0fa('0xf')]['id']);util['hideNotification'](this['notificationId'],this[_0xf0fa('0x5')]['id'],this[_0xf0fa('0x6')]['agents'][this[_0xf0fa('0xf')]['id']],null,this['routing']);this['realtime']['agents'][this[_0xf0fa('0xf')]['id']]['busy']=![];this[_0xf0fa('0x6')][_0xf0fa('0x11')][this[_0xf0fa('0xf')]['id']][_0xf0fa('0x16')]=undefined;util[_0xf0fa('0x1d')](this[_0xf0fa('0x6')],this[_0xf0fa('0x3')],this[_0xf0fa('0xf')],this['squeue'][_0xf0fa('0x14')]);util[_0xf0fa('0x19')](this[_0xf0fa('0x5')]['id'],this['realtime'][_0xf0fa('0x11')][this[_0xf0fa('0xf')]['id']],_0x5a4fd3?_0xf0fa('0x1e'):_0xf0fa('0x1f'));}if(!_0x5a4fd3){setTimeout(this['push']['bind'](this),0x3e8);}};function agent(_0x2a9f4b,_0x68b3fe,_0x2a6560,_0x47486f){return new Agent(_0x2a9f4b,_0x68b3fe,_0x2a6560,_0x47486f);}module[_0xf0fa('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 90c73ed..05f4a36 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 _0xfbdd=['push','handleRun','bind','timeout','handleTimeout','handleDrained','prototype','isNil','Agents','length','agents','debug','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','isAgentAvailable','channel','writeLog','busy','busyQueue','saveWaitingNotification','[%s][QUEUE]\x20ALL\x20AGENTS\x20ARE\x20BUSY','[%s][QUEUE]\x20EMPTY','hideNotification','notificationId','STOP','TIMEOUT','removeWaitingNotification','exports','lodash','uuid','routing','queue','realtime','squeue'];(function(_0x223157,_0x4f0f92){var _0x4a571d=function(_0x221d31){while(--_0x221d31){_0x223157['push'](_0x223157['shift']());}};_0x4a571d(++_0x4f0f92);}(_0xfbdd,0x144));var _0xdfbd=function(_0x286ebc,_0x1a6efa){_0x286ebc=_0x286ebc-0x0;var _0x51dd92=_0xfbdd[_0x286ebc];return _0x51dd92;};'use strict';var _=require(_0xdfbd('0x0'));var uuid=require(_0xdfbd('0x1'));var util=require('./util');var logger=require('../../../../../config/logger')(_0xdfbd('0x2'));var Beepall=function(_0x343da6,_0xfa5b29,_0x4496cc,_0x16f4b9){this['notificationId']=uuid['v4']();this['squeue']=_0x343da6;this[_0xdfbd('0x3')]=_0xfa5b29;this[_0xdfbd('0x4')]=_0x4496cc;this[_0xdfbd('0x2')]=_0x16f4b9;this[_0xdfbd('0x5')][_0xdfbd('0x6')](this[_0xdfbd('0x7')][_0xdfbd('0x8')](this),this['handleTimeout']['bind'](this));this['squeue']['on'](_0xdfbd('0x9'),this[_0xdfbd('0xa')]['bind'](this));this['squeue']['on']('drained',this[_0xdfbd('0xb')][_0xdfbd('0x8')](this));};Beepall[_0xdfbd('0xc')]['push']=function(){this['squeue'][_0xdfbd('0x6')](this[_0xdfbd('0x7')][_0xdfbd('0x8')](this),this['handleTimeout'][_0xdfbd('0x8')](this));};Beepall[_0xdfbd('0xc')][_0xdfbd('0xb')]=function(){this[_0xdfbd('0xa')](!![]);};Beepall[_0xdfbd('0xc')][_0xdfbd('0x7')]=function(){var _0x5d444e=!![];if(!_[_0xdfbd('0xd')](this[_0xdfbd('0x3')])&&!_[_0xdfbd('0xd')](this[_0xdfbd('0x3')][_0xdfbd('0xe')])&&this['queue']['Agents'][_0xdfbd('0xf')]>0x0){for(var _0x5e668a=0x0,_0x5600dd;_0x5e668a0x0){for(var _0x36c3f3=0x0,_0x13ba00;_0x36c3f30x0&&_0x4ff1de[_0x2ab5c9+_0x804f('0x26')]>=_0x4ff1de[_0x2ab5c9+_0x804f('0x27')]){writeLog(_0x1ce706,_0x4ff1de,_0x2ab5c9['toUpperCase']()+_0x804f('0x28'));return![];}}return!![];};exports[_0x804f('0x29')]=function(_0x5e363b,_0x42c814,_0x13f083,_0x353a4b,_0x58504e){return sendNotification(!![],_0x5e363b,_0x42c814,_0x13f083,_0x353a4b,_0x58504e);};exports[_0x804f('0x2a')]=function(_0x2cc3d8,_0x3f0eba,_0x2995ed,_0x1a7601,_0x56ecf0){return sendNotification(![],_0x2cc3d8,_0x3f0eba,_0x2995ed,_0x1a7601,_0x56ecf0);};exports[_0x804f('0x2b')]=function(_0x5df789,_0x48060c,_0x5a7a2a){var _0x42fd74=_0x48060c[_0x804f('0x2c')][_0x804f('0x2d')];if(!_0x42fd74&&_0x5a7a2a){_0x42fd74=_0x5a7a2a['id'];}var _0x414d8f=_[_0x804f('0x2e')](_0x5df789[_0x48060c[_0x804f('0x2f')]+_0x804f('0x30')],function(_0x4790c9){var _0xb726dc=_[_0x804f('0x31')](_0x48060c[_0x804f('0x2f')])+'InteractionId';return _0x4790c9[_0xb726dc]===_0x48060c[_0x804f('0x2c')]['id'];});if(!_0x414d8f&&_0x42fd74&&_0x5df789[_0x804f('0x32')][_0x42fd74]){_0x414d8f=_[_0x804f('0x2e')](_0x5df789[_0x804f('0x32')][_0x42fd74][_0x48060c['channel']+_0x804f('0x33')],function(_0x3ef29b){return _0x3ef29b['id']===_0x48060c[_0x804f('0x2c')]['id'];});}return _0x414d8f;};exports['saveWaitingNotification']=function(_0x2badaa,_0x3582f7,_0x469510,_0x2bb5ea){if(_0x469510&&_0x469510['id']&&_0x2badaa[_0x804f('0x32')]&&_0x2badaa[_0x804f('0x32')][_0x469510['id']]){_0x2badaa[_0x804f('0x32')][_0x469510['id']][_0x2bb5ea+'WaitingInteractions'][_0x3582f7['message']['id']]={'id':_0x3582f7[_0x804f('0x2c')]['id']};}};exports[_0x804f('0x34')]=function(_0x3f6f06,_0x40a5cb,_0x4a3c63,_0x1dfda4){if(_0x4a3c63&&_0x4a3c63['id']&&_0x3f6f06[_0x804f('0x32')]&&_0x3f6f06[_0x804f('0x32')][_0x4a3c63['id']]){delete _0x3f6f06[_0x804f('0x32')][_0x4a3c63['id']][_0x1dfda4+'WaitingInteractions'][_0x40a5cb[_0x804f('0x16')]['id']];}};exports[_0x804f('0x35')]=writeLog; \ No newline at end of file +var _0xf300=['UserId','some','channel','capitalize','interaction','WaitingInteractions','saveWaitingNotification','agents','removeWaitingNotification','writeLog','../utils','ioredis','routing','redis','localhost','socket.io-emitter','split','account','notificationShake','body','queue','msg','getMustacheRender','I\x20can\x27t\x20render\x20your\x20template','format','[%s][QUEUE]\x20%s','name','emit','notification:%s','save','remove','debug','[%s][QUEUE][AGENT:%s][STATUS:%s]','isAgentAvailable','busy','BUSY','online','OFFLINE','Pause','PAUSE','hasOwnProperty','Capacity','CurrentCapacity','\x20MAXCAPACITY','showNotification','hideNotification','checkWaitingNotifications'];(function(_0x4e1ef7,_0x349fa5){var _0x20f191=function(_0x2db9e3){while(--_0x2db9e3){_0x4e1ef7['push'](_0x4e1ef7['shift']());}};_0x20f191(++_0x349fa5);}(_0xf300,0xc6));var _0x0f30=function(_0xdd827a,_0x482ad2){_0xdd827a=_0xdd827a-0x0;var _0x2f46f1=_0xf300[_0xdd827a];return _0x2f46f1;};'use strict';var _=require('lodash');var util=require('util');var utils=require(_0x0f30('0x0'));var Redis=require(_0x0f30('0x1'));var config=require('../../../../../config/environment');var logger=require('../../../../../config/logger')(_0x0f30('0x2'));config['redis']=_['defaults'](config[_0x0f30('0x3')],{'host':_0x0f30('0x4'),'port':0x18eb});var io=require(_0x0f30('0x5'))(new Redis(config[_0x0f30('0x3')]));function sendNotification(_0x2649d8,_0x47bb0f,_0x5ce6db,_0x10e97a,_0x17d558,_0x4f0be7){var _0x3fbb95=_0x4f0be7||{};var _0x8ce804=_0x5ce6db[_0x0f30('0x6')]('.');var _0x15f854={'uniqueid':_0x47bb0f,'channel':_0x8ce804[0x0],'id':_0x8ce804[0x1],'title':_0x8ce804[0x0]+'\x20interaction','interactionId':_0x8ce804[0x2],'queue':_0x17d558?_0x17d558['name']:null,'sound':_0x3fbb95['account']['notificationSound'],'shake':_0x3fbb95[_0x0f30('0x7')][_0x0f30('0x8')]};try{if(!_0x3fbb95[_0x0f30('0x9')]){_0x3fbb95[_0x0f30('0x9')]={};}if(_0x17d558){_0x3fbb95[_0x0f30('0x9')][_0x0f30('0xa')]=_0x17d558;}else if(_0x3fbb95[_0x0f30('0x9')]['queue']){delete _0x3fbb95[_0x0f30('0x9')]['queue'];}_0x15f854[_0x0f30('0xb')]=utils[_0x0f30('0xc')](_0x3fbb95[_0x0f30('0x7')]['notificationTemplate'],_0x3fbb95);}catch(_0xb35fae){_0x15f854['msg']=_0x0f30('0xd');logger['error'](util[_0x0f30('0xe')](_0x0f30('0xf'),_0x47bb0f,_0xb35fae['message']));}io['to'](util['format']('user:%s',_0x10e97a[_0x0f30('0x10')]))[_0x0f30('0x11')](util[_0x0f30('0xe')](_0x0f30('0x12'),_0x2649d8?_0x0f30('0x13'):_0x0f30('0x14')),_0x15f854);}function writeLog(_0x24bc69,_0x2525ce,_0x4ff04a){return logger[_0x0f30('0x15')](util[_0x0f30('0xe')](_0x0f30('0x16'),_0x24bc69,_0x2525ce['name'],_0x4ff04a));}exports[_0x0f30('0x17')]=function(_0x4b880c,_0x1b750f,_0x45abab,_0x3672da){if(_0x1b750f[_0x0f30('0x18')]){writeLog(_0x4b880c,_0x1b750f,_0x0f30('0x19'));return![];}if(!_0x1b750f[_0x0f30('0x1a')]){writeLog(_0x4b880c,_0x1b750f,_0x0f30('0x1b'));return![];}if(_0x1b750f[_0x45abab+_0x0f30('0x1c')]){writeLog(_0x4b880c,_0x1b750f,_0x0f30('0x1d'));return![];}if(_0x3672da&&_0x1b750f[_0x0f30('0x1e')](_0x45abab+_0x0f30('0x1f'))&&_0x1b750f[_0x0f30('0x1e')](_0x45abab+_0x0f30('0x20'))){if(_0x1b750f[_0x45abab+_0x0f30('0x1f')]>0x0&&_0x1b750f[_0x45abab+'CurrentCapacity']>=_0x1b750f[_0x45abab+_0x0f30('0x1f')]){writeLog(_0x4b880c,_0x1b750f,_0x45abab['toUpperCase']()+_0x0f30('0x21'));return![];}}return!![];};exports[_0x0f30('0x22')]=function(_0x539b15,_0x542276,_0x4c36ab,_0xe5dbff,_0x48f9b9){return sendNotification(!![],_0x539b15,_0x542276,_0x4c36ab,_0xe5dbff,_0x48f9b9);};exports[_0x0f30('0x23')]=function(_0x50f37e,_0x2e4de9,_0x1fe384,_0xc4a6db,_0x317ea2){return sendNotification(![],_0x50f37e,_0x2e4de9,_0x1fe384,_0xc4a6db,_0x317ea2);};exports[_0x0f30('0x24')]=function(_0x1a9b37,_0x2c3ab3,_0x2bc919){var _0x18c34e=_0x2c3ab3['interaction'][_0x0f30('0x25')];if(!_0x18c34e&&_0x2bc919){_0x18c34e=_0x2bc919['id'];}var _0x58a6c5=_[_0x0f30('0x26')](_0x1a9b37[_0x2c3ab3[_0x0f30('0x27')]+'QueuesWaitingInteractions'],function(_0x384056){var _0x540b10=_[_0x0f30('0x28')](_0x2c3ab3[_0x0f30('0x27')])+'InteractionId';return _0x384056[_0x540b10]===_0x2c3ab3[_0x0f30('0x29')]['id'];});if(!_0x58a6c5&&_0x18c34e&&_0x1a9b37['agents'][_0x18c34e]){_0x58a6c5=_[_0x0f30('0x26')](_0x1a9b37['agents'][_0x18c34e][_0x2c3ab3['channel']+_0x0f30('0x2a')],function(_0x281ca5){return _0x281ca5['id']===_0x2c3ab3[_0x0f30('0x29')]['id'];});}return _0x58a6c5;};exports[_0x0f30('0x2b')]=function(_0x1639be,_0x162420,_0x4c21f0,_0x108249){if(_0x4c21f0&&_0x4c21f0['id']&&_0x1639be['agents']&&_0x1639be[_0x0f30('0x2c')][_0x4c21f0['id']]){_0x1639be[_0x0f30('0x2c')][_0x4c21f0['id']][_0x108249+_0x0f30('0x2a')][_0x162420['message']['id']]={'id':_0x162420[_0x0f30('0x29')]['id']};}};exports[_0x0f30('0x2d')]=function(_0x3f426f,_0x3cdca8,_0x1056dd,_0x1bed9d){if(_0x1056dd&&_0x1056dd['id']&&_0x3f426f[_0x0f30('0x2c')]&&_0x3f426f[_0x0f30('0x2c')][_0x1056dd['id']]){delete _0x3f426f[_0x0f30('0x2c')][_0x1056dd['id']][_0x1bed9d+_0x0f30('0x2a')][_0x3cdca8['message']['id']];}};exports[_0x0f30('0x2e')]=writeLog; \ No newline at end of file diff --git a/server/services/routing/server/applications/system.js b/server/services/routing/server/applications/system.js index a1a6204..643ab3e 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 _0xe42c=['length','error','[%s][SYSTEM]\x20%s','map','message','join','info','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','next','exec','[%s][SYSTEM]\x20result\x20code:\x20%s','isNil','isEmpty','[%s][SYSTEM]\x20no\x20variable','body','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','stringify','validate','shelljs','lodash','./utils','../../../../config/logger','routing','string','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence'];(function(_0x397cfb,_0xb8f317){var _0x15fed9=function(_0x3eba43){while(--_0x3eba43){_0x397cfb['push'](_0x397cfb['shift']());}};_0x15fed9(++_0xb8f317);}(_0xe42c,0x149));var _0xce42=function(_0x388840,_0x4f22eb){_0x388840=_0x388840-0x0;var _0x27c385=_0xe42c[_0x388840];return _0x27c385;};'use strict';var schema=require(_0xce42('0x0'));var sh=require(_0xce42('0x1'));var _=require(_0xce42('0x2'));var utils=require(_0xce42('0x3'));var logger=require(_0xce42('0x4'))(_0xce42('0x5'));var system=schema({'command':{'type':_0xce42('0x6'),'required':!![],'message':_0xce42('0x7')}});exports[_0xce42('0x8')]=function(_0x5a93d5,_0x259070){return function(_0x2714a5){try{var _0x1c727a={'command':_0x259070[0x0]};var _0x2b25bf=system[_0xce42('0x0')](_0x1c727a,{'typecast':!![]});if(_0x2b25bf[_0xce42('0x9')]){logger[_0xce42('0xa')](_0xce42('0xb'),_0x5a93d5,_[_0xce42('0xc')](_0x2b25bf,_0xce42('0xd'))[_0xce42('0xe')](',\x20'));logger[_0xce42('0xf')](_0xce42('0x10'),_0x5a93d5);_0x2714a5[_0xce42('0x11')]();}else{var _0x1dacc9=this;var _0x41d2e1=utils['getMustacheRender'](_0x259070[0x0],this);logger[_0xce42('0xf')]('[%s][SYSTEM]\x20commnad:\x20%s',_0x5a93d5,_0x41d2e1);sh[_0xce42('0x12')](_['trim'](_0x41d2e1),function(_0x394c82,_0x28c932){logger['info'](_0xce42('0x13'),_0x5a93d5,_0x394c82);if(_0x394c82==0x0){var _0x18756b=_0x28c932['replace'](/(\r\n|\n|\r)/gm,'');if(_[_0xce42('0x14')](_0x259070[0x1])||_[_0xce42('0x15')](_0x259070[0x1])){logger[_0xce42('0xf')](_0xce42('0x16'),_0x5a93d5);_0x1dacc9[_0xce42('0x17')][_0x259070[0x1]]=_0x18756b;}else{logger['info'](_0xce42('0x18'),_0x5a93d5,_0x259070[0x1],_0x18756b);_0x1dacc9[_0xce42('0x17')][_0x259070[0x1]]=_0x18756b;}}_0x2714a5['next']();});}}catch(_0x5d6159){logger['error'](_0xce42('0xb'),_0x5a93d5,_['isObject'](_0x5d6159)?JSON[_0xce42('0x19')](_0x5d6159):_0x5d6159);logger[_0xce42('0xf')]('[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next',_0x5a93d5);_0x2714a5[_0xce42('0x11')]();}};}; \ No newline at end of file +var _0x301c=['length','[%s][SYSTEM]\x20%s','map','info','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','getMustacheRender','[%s][SYSTEM]\x20commnad:\x20%s','exec','trim','[%s][SYSTEM]\x20result\x20code:\x20%s','replace','isNil','isEmpty','body','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','next','error','isObject','stringify','validate','shelljs','lodash','./utils','../../../../config/logger','routing','string','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence'];(function(_0x9329aa,_0x5f34c2){var _0x54b84d=function(_0x107d3c){while(--_0x107d3c){_0x9329aa['push'](_0x9329aa['shift']());}};_0x54b84d(++_0x5f34c2);}(_0x301c,0x83));var _0xc301=function(_0x30a86a,_0x20c777){_0x30a86a=_0x30a86a-0x0;var _0x569a62=_0x301c[_0x30a86a];return _0x569a62;};'use strict';var schema=require(_0xc301('0x0'));var sh=require(_0xc301('0x1'));var _=require(_0xc301('0x2'));var utils=require(_0xc301('0x3'));var logger=require(_0xc301('0x4'))(_0xc301('0x5'));var system=schema({'command':{'type':_0xc301('0x6'),'required':!![],'message':_0xc301('0x7')}});exports[_0xc301('0x8')]=function(_0x30242c,_0x570ff2){return function(_0x51f84b){try{var _0x5795b1={'command':_0x570ff2[0x0]};var _0x3d5442=system[_0xc301('0x0')](_0x5795b1,{'typecast':!![]});if(_0x3d5442[_0xc301('0x9')]){logger['error'](_0xc301('0xa'),_0x30242c,_[_0xc301('0xb')](_0x3d5442,'message')['join'](',\x20'));logger[_0xc301('0xc')](_0xc301('0xd'),_0x30242c);_0x51f84b['next']();}else{var _0x26e09c=this;var _0x529e85=utils[_0xc301('0xe')](_0x570ff2[0x0],this);logger[_0xc301('0xc')](_0xc301('0xf'),_0x30242c,_0x529e85);sh[_0xc301('0x10')](_[_0xc301('0x11')](_0x529e85),function(_0x29fd28,_0x2539c3){logger['info'](_0xc301('0x12'),_0x30242c,_0x29fd28);if(_0x29fd28==0x0){var _0x26c803=_0x2539c3[_0xc301('0x13')](/(\r\n|\n|\r)/gm,'');if(_[_0xc301('0x14')](_0x570ff2[0x1])||_[_0xc301('0x15')](_0x570ff2[0x1])){logger[_0xc301('0xc')]('[%s][SYSTEM]\x20no\x20variable',_0x30242c);_0x26e09c[_0xc301('0x16')][_0x570ff2[0x1]]=_0x26c803;}else{logger[_0xc301('0xc')](_0xc301('0x17'),_0x30242c,_0x570ff2[0x1],_0x26c803);_0x26e09c[_0xc301('0x16')][_0x570ff2[0x1]]=_0x26c803;}}_0x51f84b[_0xc301('0x18')]();});}}catch(_0x131b36){logger[_0xc301('0x19')]('[%s][SYSTEM]\x20%s',_0x30242c,_[_0xc301('0x1a')](_0x131b36)?JSON[_0xc301('0x1b')](_0x131b36):_0x131b36);logger[_0xc301('0xc')]('[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next',_0x30242c);_0x51f84b[_0xc301('0x18')]();}};}; \ 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 0004ba2..74a4512 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 _0x0366=['../../../../config/logger','routing','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','error','[%s][TAG]\x20%s','message','join','info','next','channel','Interaction','interaction','then','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','stringify','finally','isObject','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','validate','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction'];(function(_0x57cb5f,_0x3684bf){var _0x46a35d=function(_0x5b9db6){while(--_0x5b9db6){_0x57cb5f['push'](_0x57cb5f['shift']());}};_0x46a35d(++_0x3684bf);}(_0x0366,0x18b));var _0x6036=function(_0x2f7c8a,_0xabf1d5){_0x2f7c8a=_0x2f7c8a-0x0;var _0x52c9d5=_0x0366[_0x2f7c8a];return _0x52c9d5;};'use strict';var schema=require(_0x6036('0x0'));var _=require('lodash');var rpc={'chatInteraction':require('../../rpc/chatInteraction'),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'smsInteraction':require(_0x6036('0x1')),'mailInteraction':require(_0x6036('0x2')),'faxInteraction':require(_0x6036('0x3')),'whatsappInteraction':require(_0x6036('0x4'))};var logger=require(_0x6036('0x5'))(_0x6036('0x6'));var tag=schema({'tag':{'type':'number','required':!![],'message':_0x6036('0x7')}});exports[_0x6036('0x8')]=function(_0x5565ea,_0x269f2d,_0x55cb14,_0x58b5d6){return function(_0x508ed3){try{var _0x5351f8={'tag':_0x269f2d[0x0]};var _0x2fa630=tag['validate'](_0x5351f8,{'typecast':!![]});if(_0x2fa630[_0x6036('0x9')]){logger[_0x6036('0xa')](_0x6036('0xb'),_0x5565ea,_['map'](_0x2fa630,_0x6036('0xc'))[_0x6036('0xd')](',\x20'));logger[_0x6036('0xe')]('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x5565ea);_0x508ed3[_0x6036('0xf')]();}else{var _0x2b8c84={'ids':[_0x269f2d[0x0]]};if(rpc[_0x58b5d6[_0x6036('0x10')]+_0x6036('0x11')]){rpc[_0x58b5d6[_0x6036('0x10')]+'Interaction']['addTags'](_0x58b5d6[_0x6036('0x12')]['id'],_0x2b8c84)[_0x6036('0x13')](function(_0x4641b5){logger[_0x6036('0xe')](_0x6036('0x14'),_0x5565ea,_0x269f2d[0x1],_0x58b5d6[_0x6036('0x10')],_0x58b5d6[_0x6036('0x12')]['id']);})['catch'](function(_0x7e3ef2){logger[_0x6036('0xa')](_0x6036('0xb'),_0x5565ea,JSON[_0x6036('0x15')](_0x7e3ef2));logger['info']('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x5565ea);})[_0x6036('0x16')](function(){_0x508ed3[_0x6036('0xf')]();});}}}catch(_0x9b631d){logger[_0x6036('0xa')]('[%s][TAG]\x20%s',_0x5565ea,_[_0x6036('0x17')](_0x9b631d)?JSON[_0x6036('0x15')](_0x9b631d):_0x9b631d);logger[_0x6036('0xe')](_0x6036('0x18'),_0x5565ea);_0x508ed3[_0x6036('0xf')]();}};}; \ No newline at end of file +var _0xb2f3=['stringify','finally','isObject','validate','lodash','../../rpc/openchannelInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','../../../../config/logger','routing','number','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','length','error','[%s][TAG]\x20%s','map','join','info','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','next','channel','Interaction','addTags','interaction','then','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','catch'];(function(_0x40f7c1,_0x1d1206){var _0x1473c8=function(_0xc571a7){while(--_0xc571a7){_0x40f7c1['push'](_0x40f7c1['shift']());}};_0x1473c8(++_0x1d1206);}(_0xb2f3,0x153));var _0x3b2f=function(_0x346737,_0x3e6081){_0x346737=_0x346737-0x0;var _0x1ade2e=_0xb2f3[_0x346737];return _0x1ade2e;};'use strict';var schema=require(_0x3b2f('0x0'));var _=require(_0x3b2f('0x1'));var rpc={'chatInteraction':require('../../rpc/chatInteraction'),'openchannelInteraction':require(_0x3b2f('0x2')),'smsInteraction':require('../../rpc/smsInteraction'),'mailInteraction':require(_0x3b2f('0x3')),'faxInteraction':require(_0x3b2f('0x4')),'whatsappInteraction':require(_0x3b2f('0x5'))};var logger=require(_0x3b2f('0x6'))(_0x3b2f('0x7'));var tag=schema({'tag':{'type':_0x3b2f('0x8'),'required':!![],'message':_0x3b2f('0x9')}});exports['consequence']=function(_0x30e08e,_0x16d726,_0x3c76c0,_0x511ee2){return function(_0x4b6121){try{var _0x504528={'tag':_0x16d726[0x0]};var _0x329433=tag[_0x3b2f('0x0')](_0x504528,{'typecast':!![]});if(_0x329433[_0x3b2f('0xa')]){logger[_0x3b2f('0xb')](_0x3b2f('0xc'),_0x30e08e,_[_0x3b2f('0xd')](_0x329433,'message')[_0x3b2f('0xe')](',\x20'));logger[_0x3b2f('0xf')](_0x3b2f('0x10'),_0x30e08e);_0x4b6121[_0x3b2f('0x11')]();}else{var _0x3bff94={'ids':[_0x16d726[0x0]]};if(rpc[_0x511ee2[_0x3b2f('0x12')]+'Interaction']){rpc[_0x511ee2[_0x3b2f('0x12')]+_0x3b2f('0x13')][_0x3b2f('0x14')](_0x511ee2[_0x3b2f('0x15')]['id'],_0x3bff94)[_0x3b2f('0x16')](function(_0x2b39de){logger['info'](_0x3b2f('0x17'),_0x30e08e,_0x16d726[0x1],_0x511ee2['channel'],_0x511ee2[_0x3b2f('0x15')]['id']);})[_0x3b2f('0x18')](function(_0x263f39){logger['error'](_0x3b2f('0xc'),_0x30e08e,JSON[_0x3b2f('0x19')](_0x263f39));logger[_0x3b2f('0xf')](_0x3b2f('0x10'),_0x30e08e);})[_0x3b2f('0x1a')](function(){_0x4b6121[_0x3b2f('0x11')]();});}}}catch(_0x2db7e6){logger[_0x3b2f('0xb')]('[%s][TAG]\x20%s',_0x30e08e,_[_0x3b2f('0x1b')](_0x2db7e6)?JSON[_0x3b2f('0x19')](_0x2db7e6):_0x2db7e6);logger[_0x3b2f('0xf')](_0x3b2f('0x10'),_0x30e08e);_0x4b6121['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 d0e35e5..dfd3e18 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 _0xc0f1=['utf8','then','parse','result','Unable\x20to\x20login\x20with\x20TVox\x20application','channelId=','&serviceId=','&sessionId=','&data=','info','stop','[%s][TVOX]\x20%s','lodash','replace','\x20-\x20','urlOnAnswer','?params=','urlOnRing','title','jsonrpc','2.0','method','push','params','stringify'];(function(_0x460fd7,_0x2012db){var _0x44d1c2=function(_0x545e11){while(--_0x545e11){_0x460fd7['push'](_0x460fd7['shift']());}};_0x44d1c2(++_0x2012db);}(_0xc0f1,0x151));var _0x1c0f=function(_0x350343,_0x256f69){_0x350343=_0x350343-0x0;var _0x9afc1c=_0xc0f1[_0x350343];return _0x9afc1c;};'use strict';var rp=require('request-promise');var logger=require('../../../../config/logger')('routing');var _=require(_0x1c0f('0x0'));var arr=[];exports['consequence']=function(_0x253cab,_0x372b30){return function(_0x3299ec){var _0x3434a6=_0x372b30[0xa];var _0x1bc5aa=_0x372b30[0xb];var _0x462236=_0x372b30[0xc];var _0x3e8292=_0x372b30[0xd];var _0x3b314c=_0x372b30[0xe];var _0x279f2a=_0x372b30[0xf][_0x1c0f('0x1')](/\n/g,_0x1c0f('0x2'));var _0x2ae19b=_0x372b30[0x10][_0x1c0f('0x1')](/\n/g,'\x20');if(!arr['includes'](_0x1bc5aa)){arr['push'](_0x1bc5aa);var _0x44aa5b=_0x372b30[0x3];var _0x14fd5d=_0x372b30[0x4];var _0x47c407=_0x372b30[0x1];var _0x13d3d3=_0x372b30[0x0];var _0x588e63={};_0x588e63[_0x1c0f('0x3')]=_0x372b30[0x8]+_0x1c0f('0x4')+_0x462236+'|'+_0x3434a6+'|'+_0x3e8292+'|'+_0x1bc5aa+'|'+_0x3b314c;_0x588e63[_0x1c0f('0x5')]=_0x372b30[0x7]+'?params='+_0x462236+'|'+_0x3434a6+'|'+_0x3e8292+'|'+_0x1bc5aa+'|'+_0x3b314c+'|'+_0x279f2a+'|'+_0x2ae19b;_0x588e63[_0x1c0f('0x6')]=_0x372b30[0x9];var _0x295071={};_0x295071[_0x1c0f('0x7')]=_0x1c0f('0x8');_0x295071[_0x1c0f('0x9')]='login';var _0x20e954=[];_0x20e954[_0x1c0f('0xa')](_0x372b30[0x2]);_0x20e954[_0x1c0f('0xa')](_0x372b30[0x5]);_0x20e954[_0x1c0f('0xa')](_0x372b30[0x6]);_0x295071[_0x1c0f('0xb')]=_0x20e954;_0x295071['id']=0x1;var _0x5e66ad=JSON[_0x1c0f('0xc')](_0x295071);var _0x3dd241={'encoding':_0x1c0f('0xd'),'method':'POST','timeout':0x2710,'url':_0x44aa5b,'headers':{'Content-Type':'application/json-rpc'},'body':_0x5e66ad};return rp(_0x3dd241)[_0x1c0f('0xe')](function(_0x48b926){const _0x5285aa=JSON[_0x1c0f('0xf')](_0x48b926);if(!_0x5285aa[_0x1c0f('0x10')]['logged']){throw new Error(_0x1c0f('0x11'));}var _0x45e029=_0x1bc5aa;var _0x3672e7=_0x1c0f('0x12')+_0x47c407+_0x1c0f('0x13')+_0x13d3d3+_0x1c0f('0x14')+_0x45e029+_0x1c0f('0x15')+JSON[_0x1c0f('0xc')](_0x588e63);var _0x4ad5ea=_0x14fd5d+'?'+_0x3672e7;return rp(_0x4ad5ea);})[_0x1c0f('0xe')](function(_0x523666){logger[_0x1c0f('0x16')]('[%s][TVOX]\x20Request\x20sent\x20to\x20TVox:\x20%s',_0x253cab,_0x523666);_0x3299ec[_0x1c0f('0x17')]();})['catch'](function(_0x46f4d5){logger['error'](_0x1c0f('0x18'),_0x253cab,_['isObject'](_0x46f4d5)?JSON[_0x1c0f('0xc')](_0x46f4d5):_0x46f4d5);_0x3299ec['stop']();});}else{logger[_0x1c0f('0x16')]('[%s][TVOX]\x20Application\x20already\x20executed\x20for\x20the\x20current\x20session,\x20force\x20next',_0x253cab);_0x3299ec['next']();}};}; \ No newline at end of file +var _0x75f7=['params','POST','application/json-rpc','then','parse','result','logged','Unable\x20to\x20login\x20with\x20TVox\x20application','&sessionId=','stringify','info','[%s][TVOX]\x20Request\x20sent\x20to\x20TVox:\x20%s','catch','error','[%s][TVOX]\x20%s','stop','[%s][TVOX]\x20Application\x20already\x20executed\x20for\x20the\x20current\x20session,\x20force\x20next','next','request-promise','../../../../config/logger','lodash','consequence','replace','\x20-\x20','?params=','title','jsonrpc','2.0','method','login','push'];(function(_0x362d8d,_0x543ba7){var _0x88cef5=function(_0x57d2e8){while(--_0x57d2e8){_0x362d8d['push'](_0x362d8d['shift']());}};_0x88cef5(++_0x543ba7);}(_0x75f7,0x148));var _0x775f=function(_0x3a5e7d,_0x5d7f94){_0x3a5e7d=_0x3a5e7d-0x0;var _0x1a4de0=_0x75f7[_0x3a5e7d];return _0x1a4de0;};'use strict';var rp=require(_0x775f('0x0'));var logger=require(_0x775f('0x1'))('routing');var _=require(_0x775f('0x2'));var arr=[];exports[_0x775f('0x3')]=function(_0x5f463c,_0x241845){return function(_0x4e1c13){var _0x44bf33=_0x241845[0xa];var _0x50d2c8=_0x241845[0xb];var _0xbba464=_0x241845[0xc];var _0x7909ed=_0x241845[0xd];var _0x596739=_0x241845[0xe];var _0x4265ea=_0x241845[0xf][_0x775f('0x4')](/\n/g,_0x775f('0x5'));var _0x3cfa88=_0x241845[0x10][_0x775f('0x4')](/\n/g,'\x20');if(!arr['includes'](_0x50d2c8)){arr['push'](_0x50d2c8);var _0x5899d4=_0x241845[0x3];var _0x244d6f=_0x241845[0x4];var _0x1116fa=_0x241845[0x1];var _0x3f2b5b=_0x241845[0x0];var _0x3ab740={};_0x3ab740['urlOnAnswer']=_0x241845[0x8]+_0x775f('0x6')+_0xbba464+'|'+_0x44bf33+'|'+_0x7909ed+'|'+_0x50d2c8+'|'+_0x596739;_0x3ab740['urlOnRing']=_0x241845[0x7]+_0x775f('0x6')+_0xbba464+'|'+_0x44bf33+'|'+_0x7909ed+'|'+_0x50d2c8+'|'+_0x596739+'|'+_0x4265ea+'|'+_0x3cfa88;_0x3ab740[_0x775f('0x7')]=_0x241845[0x9];var _0x4eb5b2={};_0x4eb5b2[_0x775f('0x8')]=_0x775f('0x9');_0x4eb5b2[_0x775f('0xa')]=_0x775f('0xb');var _0x4328e6=[];_0x4328e6['push'](_0x241845[0x2]);_0x4328e6[_0x775f('0xc')](_0x241845[0x5]);_0x4328e6['push'](_0x241845[0x6]);_0x4eb5b2[_0x775f('0xd')]=_0x4328e6;_0x4eb5b2['id']=0x1;var _0x5ed6be=JSON['stringify'](_0x4eb5b2);var _0x4b6846={'encoding':'utf8','method':_0x775f('0xe'),'timeout':0x2710,'url':_0x5899d4,'headers':{'Content-Type':_0x775f('0xf')},'body':_0x5ed6be};return rp(_0x4b6846)[_0x775f('0x10')](function(_0x2cdebd){const _0x20ee2c=JSON[_0x775f('0x11')](_0x2cdebd);if(!_0x20ee2c[_0x775f('0x12')][_0x775f('0x13')]){throw new Error(_0x775f('0x14'));}var _0x564f59=_0x50d2c8;var _0x415313='channelId='+_0x1116fa+'&serviceId='+_0x3f2b5b+_0x775f('0x15')+_0x564f59+'&data='+JSON[_0x775f('0x16')](_0x3ab740);var _0x36c406=_0x244d6f+'?'+_0x415313;return rp(_0x36c406);})[_0x775f('0x10')](function(_0x1aba2b){logger[_0x775f('0x17')](_0x775f('0x18'),_0x5f463c,_0x1aba2b);_0x4e1c13['stop']();})[_0x775f('0x19')](function(_0x302371){logger[_0x775f('0x1a')](_0x775f('0x1b'),_0x5f463c,_['isObject'](_0x302371)?JSON[_0x775f('0x16')](_0x302371):_0x302371);_0x4e1c13[_0x775f('0x1c')]();});}else{logger[_0x775f('0x17')](_0x775f('0x1d'),_0x5f463c);_0x4e1c13[_0x775f('0x1e')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/utils.js b/server/services/routing/server/applications/utils.js index 823c269..ce3af56 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(_0x208340,_0x99fcbc){var _0x3b7fd2=function(_0xd52721){while(--_0xd52721){_0x208340['push'](_0x208340['shift']());}};_0x3b7fd2(++_0x99fcbc);}(_0xe706,0xa3));var _0x6e70=function(_0x5d08e4,_0x1c1ba6){_0x5d08e4=_0x5d08e4-0x0;var _0x1c7d40=_0xe706[_0x5d08e4];return _0x1c7d40;};'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 _0xd8b0=['merge','body','contact','message','list','mustache','lodash','render'];(function(_0x2dc020,_0x361bea){var _0x2f2258=function(_0x2fc00d){while(--_0x2fc00d){_0x2dc020['push'](_0x2dc020['shift']());}};_0x2f2258(++_0x361bea);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var Mustache=require(_0x0d8b('0x0'));var _=require(_0x0d8b('0x1'));module['exports']={'getMustacheRender':function(_0x585166,_0x4b72b0){return Mustache[_0x0d8b('0x2')](_0x585166,_[_0x0d8b('0x3')](_0x4b72b0[_0x0d8b('0x4')],{'contact':_0x4b72b0[_0x0d8b('0x5')],'message':_0x4b72b0[_0x0d8b('0x6')],'account':_0x4b72b0['account'],'interaction':_0x4b72b0['interaction'],'list':_0x4b72b0[_0x0d8b('0x7')]}))||'';}}; \ No newline at end of file diff --git a/server/services/routing/server/index.js b/server/services/routing/server/index.js index ef1e09a..5eabc86 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 _0x4f00=['split','channel','mail','push','slice','appdata','dialogflowv2','amazonlex','tag','TagId','tvox','getMustacheRender','account','notificationTemplate','ChatWebsiteId','ContactId','body','%s:%s:%s','./interval','condition','./applications/','priority','info','intervals','\x20|\x20','error','Please\x20create\x20a\x20new\x20file\x20under','.js','execute','Applications\x20executed','stringify','matchPath','emit','complete','Skipped\x20routing\x20for\x20%s','No\x20applications\x20to\x20execute','routing\x20is\x20empty','agent','busy','agents','busyQueue','end','QueueReport','update','UserId','error\x20update\x20queue\x20report','message\x20is\x20empty','stack','hasOwnProperty','capacity','CurrentCapacity','updateRealtime','agent\x20not\x20found','values','find','chatQueues','loggedIn','name','paused','waiting','mailQueues','openchannelQueues','available','smsQueues','faxQueues','whatsappQueues','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','server','log','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','lodash','util','path','jayson/promise','bluebird','./applications/strategy/util','../../../config/logger','../rpc/mailQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','../lib/rule-engine','%s.%s.%s','isNil','IntervalId','Intervals','map','interval','listen','rules','message','interaction','checkWaitingNotifications','transfer','applications','isArray','length','join','app','toLowerCase','autoreply'];(function(_0x31e3e7,_0x4e431f){var _0x138332=function(_0x11c29d){while(--_0x11c29d){_0x31e3e7['push'](_0x31e3e7['shift']());}};_0x138332(++_0x4e431f);}(_0x4f00,0x1ea));var _0x04f0=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x4f00[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0x04f0('0x0'));var util=require(_0x04f0('0x1'));var path=require(_0x04f0('0x2'));var fs=require('fs');var jayson=require(_0x04f0('0x3'));var BPromise=require(_0x04f0('0x4'));var utils=require('./applications/utils');var sUtils=require(_0x04f0('0x5'));var logger=require(_0x04f0('0x6'))('routing');var rpc={'openchannelQueueReport':require('../rpc/openchannelQueueReport'),'mailQueueReport':require(_0x04f0('0x7')),'chatQueueReport':require('../rpc/chatQueueReport'),'smsQueueReport':require(_0x04f0('0x8')),'faxQueueReport':require(_0x04f0('0x9')),'whatsappQueueReport':require('../rpc/whatsappQueueReport')};var RuleEngine=require(_0x04f0('0xa'));function getId(_0x2f744a,_0x496cb3,_0x1f910f){return util['format'](_0x04f0('0xb'),_0x2f744a,_0x496cb3||0x0,_0x1f910f||0x0);}function getIntervals(_0x1db999,_0x1a5656){var _0x59242f=[];if(!_[_0x04f0('0xc')](_0x1a5656[_0x04f0('0xd')])&&!_[_0x04f0('0xc')](_0x1db999[_0x1a5656['IntervalId']])&&!_[_0x04f0('0xc')](_0x1db999[_0x1a5656[_0x04f0('0xd')]][_0x04f0('0xe')])){_0x59242f=_[_0x04f0('0xf')](_0x1db999[_0x1a5656[_0x04f0('0xd')]][_0x04f0('0xe')],_0x04f0('0x10'));}else if(!_[_0x04f0('0xc')](_0x1a5656['interval'])){_0x59242f=[_0x1a5656[_0x04f0('0x10')]];}return _0x59242f;}exports[_0x04f0('0x11')]=function(_0x2f13f0){_0x2f13f0[_0x04f0('0x12')]={};return new BPromise(function(_0x4975e2,_0x416181){var _0x1d073c={'Start':function(_0x3fc263){var _0x1b7f23=this;return new Promise(function(_0xb69d29,_0x3d71ff){if(_0x3fc263){try{var _0x160d55=[];var _0x312238=getId(_0x3fc263['channel'],_0x3fc263['message']?_0x3fc263[_0x04f0('0x13')]['id']:0x0,_0x3fc263[_0x04f0('0x14')]?_0x3fc263[_0x04f0('0x14')]['id']:0x0);var _0xc40bce=sUtils[_0x04f0('0x15')](_0x2f13f0,_0x3fc263);if(_0x3fc263[_0x04f0('0x16')]||!_0xc40bce&&_0x3fc263[_0x04f0('0x17')]&&_[_0x04f0('0x18')](_0x3fc263['applications'])&&_0x3fc263[_0x04f0('0x17')]['length']){for(var _0x12f2a7=0x0;_0x12f2a7<_0x3fc263[_0x04f0('0x17')][_0x04f0('0x19')];_0x12f2a7+=0x1){var _0x5f08cd=_0x3fc263[_0x04f0('0x17')][_0x12f2a7];if(fs['existsSync'](path[_0x04f0('0x1a')](__dirname,_0x04f0('0x17'),_0x5f08cd[_0x04f0('0x1b')]+'.js'))){var _0x11bf80=[];switch(_0x5f08cd[_0x04f0('0x1b')][_0x04f0('0x1c')]()){case _0x04f0('0x1d'):var _0x1a6232=_0x5f08cd['appdata'][_0x04f0('0x1e')](',');if(_0x3fc263[_0x04f0('0x1f')]===_0x04f0('0x20')){_0x11bf80[_0x04f0('0x21')](_0x1a6232[0x0]);_0x11bf80[_0x04f0('0x21')](_0x1a6232[0x1]);_0x11bf80[_0x04f0('0x21')](_0x1a6232['slice'](0x2,_0x1a6232['length'])[_0x04f0('0x1a')](','));}else{_0x11bf80[_0x04f0('0x21')](_0x1a6232[0x0]);_0x11bf80[_0x04f0('0x21')](_0x1a6232[_0x04f0('0x22')](0x1,_0x1a6232[_0x04f0('0x19')])[_0x04f0('0x1a')](','));}break;case'dialogflow':var _0x851004=_0x5f08cd[_0x04f0('0x23')]['split'](',');_0x11bf80[_0x04f0('0x21')](_0x851004[0x0]);_0x11bf80['push'](_0x851004[0x1]);_0x11bf80[_0x04f0('0x21')](_0x851004[_0x04f0('0x22')](0x2,_0x851004[_0x04f0('0x19')])[_0x04f0('0x1a')](','));break;case _0x04f0('0x24'):var _0x4f77b1=_0x5f08cd['appdata'][_0x04f0('0x1e')](',');_0x11bf80[_0x04f0('0x21')](_0x4f77b1[0x0]);_0x11bf80[_0x04f0('0x21')](_0x4f77b1[0x1]);_0x11bf80[_0x04f0('0x21')](_0x4f77b1[0x2]);_0x11bf80['push'](_0x4f77b1[0x3]);_0x11bf80[_0x04f0('0x21')](_0x4f77b1[_0x04f0('0x22')](0x4,_0x4f77b1[_0x04f0('0x19')])[_0x04f0('0x1a')](','));break;case _0x04f0('0x25'):var _0x51fb03=_0x5f08cd['appdata']['split'](',');_0x11bf80[_0x04f0('0x21')](_0x51fb03[0x0]);_0x11bf80[_0x04f0('0x21')](_0x51fb03[0x1]);_0x11bf80[_0x04f0('0x21')](_0x51fb03[0x2]);_0x11bf80['push'](_0x51fb03[0x3]);_0x11bf80[_0x04f0('0x21')](_0x51fb03[_0x04f0('0x22')](0x4,_0x51fb03[_0x04f0('0x19')])[_0x04f0('0x1a')](','));break;case _0x04f0('0x13'):_0x11bf80[_0x04f0('0x21')](_0x5f08cd[_0x04f0('0x23')]);break;case _0x04f0('0x26'):_0x11bf80[_0x04f0('0x21')](_0x5f08cd[_0x04f0('0x27')]);_0x11bf80[_0x04f0('0x21')](_0x5f08cd[_0x04f0('0x23')]);break;case _0x04f0('0x28'):var _0x275f5f=utils[_0x04f0('0x29')](_0x3fc263[_0x04f0('0x2a')][_0x04f0('0x2b')],_0x3fc263);var _0x128a28=_0x5f08cd['appdata'][_0x04f0('0x1e')](',');_0x11bf80[_0x04f0('0x21')](_0x128a28[0x0]);_0x11bf80[_0x04f0('0x21')](_0x128a28[0x1]);_0x11bf80[_0x04f0('0x21')](_0x128a28[0x2]);_0x11bf80[_0x04f0('0x21')](_0x128a28[0x3]);_0x11bf80['push'](_0x128a28[0x4]);_0x11bf80[_0x04f0('0x21')](_0x128a28[0x5]);_0x11bf80[_0x04f0('0x21')](_0x128a28[0x6]);_0x11bf80[_0x04f0('0x21')](_0x128a28[0x7]);_0x11bf80[_0x04f0('0x21')](_0x128a28[0x8]);_0x11bf80[_0x04f0('0x21')](_0x128a28[0x9]);_0x11bf80['push'](_0x128a28[0xa]);_0x11bf80[_0x04f0('0x21')](_0x3fc263[_0x04f0('0x14')]['id']);_0x11bf80['push'](_0x3fc263[_0x04f0('0x13')]['id']);_0x11bf80[_0x04f0('0x21')](_0x5f08cd[_0x04f0('0x2c')]);_0x11bf80[_0x04f0('0x21')](_0x3fc263[_0x04f0('0x14')][_0x04f0('0x2d')]);_0x11bf80[_0x04f0('0x21')](_0x3fc263[_0x04f0('0x2e')][_0x04f0('0x2e')]);_0x11bf80[_0x04f0('0x21')](_0x275f5f);break;default:_0x11bf80=_[_0x04f0('0xc')](_0x5f08cd[_0x04f0('0x23')])?[]:_0x5f08cd['appdata'][_0x04f0('0x1e')](',');}var _0xe184e5={'id':util['format'](_0x04f0('0x2f'),_0x312238,_0x5f08cd['id'],_0x5f08cd[_0x04f0('0x1b')]),'condition':require(_0x04f0('0x30'))[_0x04f0('0x31')](_0x312238,getIntervals(_0x2f13f0['intervals'],_0x5f08cd),_0x2f13f0),'consequence':require(_0x04f0('0x32')+_0x5f08cd[_0x04f0('0x1b')])['consequence'](_0x312238,_0x11bf80,_0x2f13f0,_0x3fc263),'p':_0x5f08cd[_0x04f0('0x33')]||0x0};logger[_0x04f0('0x34')]('Push\x20new\x20rule',_0xe184e5['id'],'on\x20interval',getIntervals(_0x2f13f0[_0x04f0('0x35')],_0x5f08cd)[_0x04f0('0x1a')](_0x04f0('0x36')));_0x160d55['push'](_0xe184e5);}else{logger[_0x04f0('0x37')](_0x04f0('0x38'),path[_0x04f0('0x1a')](__dirname,_0x04f0('0x17'),_0x5f08cd[_0x04f0('0x1b')]+_0x04f0('0x39')));}}_0x2f13f0[_0x04f0('0x12')][_0x312238]=new RuleEngine(_0x160d55);_0x2f13f0[_0x04f0('0x12')][_0x312238][_0x04f0('0x3a')](_0x3fc263,function(_0x520424){logger['info'](_0x04f0('0x3b'),JSON[_0x04f0('0x3c')](_0x520424[_0x04f0('0x3d')]));if(_0x2f13f0[_0x04f0('0x12')][_0x312238]){_0x2f13f0[_0x04f0('0x12')][_0x312238][_0x04f0('0x3e')](_0x04f0('0x3f'));}});return _0xb69d29({'code':0xc8,'message':_0x3fc263});}else{if(_0xc40bce){logger[_0x04f0('0x34')](util['format'](_0x04f0('0x40'),_0x312238));}else{logger[_0x04f0('0x34')](_0x04f0('0x41'));}return _0xb69d29({'code':0xc8,'message':_0x3fc263});}}catch(_0x32ad00){logger[_0x04f0('0x37')](_0x32ad00['stack']);return _0x3d71ff(_0x1b7f23['error'](0x1f4,_0x32ad00));}}return _0x3d71ff(_0x04f0('0x42'));});},'AcceptMessage':function(_0x2c9548){var _0x404b1a=this;return new Promise(function(_0x33a0f3,_0x349921){if(_0x2c9548[_0x04f0('0x43')]&&_0x2c9548['agent']['id']){if(_0x2f13f0['agents'][_0x2c9548['agent']['id']]){_0x2f13f0['agents'][_0x2c9548[_0x04f0('0x43')]['id']][_0x04f0('0x44')]=![];_0x2f13f0[_0x04f0('0x45')][_0x2c9548[_0x04f0('0x43')]['id']][_0x04f0('0x46')]=undefined;}}if(_0x2c9548[_0x04f0('0x13')]&&_0x2c9548['message']['id']){try{var _0x1fcfbb=getId(_0x2c9548[_0x04f0('0x1f')],_0x2c9548['message']?_0x2c9548[_0x04f0('0x13')]['id']:0x0,_0x2c9548[_0x04f0('0x14')]?_0x2c9548['interaction']['id']:0x0);if(_0x2f13f0[_0x04f0('0x12')][_0x1fcfbb]){_0x2f13f0[_0x04f0('0x12')][_0x1fcfbb]['emit'](_0x04f0('0x47'));if(rpc[_0x2c9548['channel']+_0x04f0('0x48')]){rpc[_0x2c9548[_0x04f0('0x1f')]+_0x04f0('0x48')][_0x04f0('0x49')](_0x1fcfbb,{'UserId':_0x2c9548[_0x04f0('0x13')][_0x04f0('0x4a')]})['catch'](function(){logger['error'](_0x04f0('0x4b'));});}}return _0x33a0f3({'code':0xc8,'message':_0x2c9548});}catch(_0x4be46e){logger[_0x04f0('0x37')](_0x4be46e['stack']);return _0x349921(_0x404b1a[_0x04f0('0x37')](0x1f4,_0x4be46e));}}logger['error']('message\x20is\x20empty');return _0x349921(_0x404b1a['error'](0x1f4,_0x04f0('0x4c')));});},'RejectMessage':function(_0x1fe00d){var _0x214cec=this;return new Promise(function(_0x1b5123,_0x561d64){if(_0x1fe00d[_0x04f0('0x43')]&&_0x1fe00d[_0x04f0('0x43')]['id']){try{if(_0x2f13f0[_0x04f0('0x45')][_0x1fe00d[_0x04f0('0x43')]['id']]){_0x2f13f0[_0x04f0('0x45')][_0x1fe00d['agent']['id']][_0x04f0('0x44')]=![];_0x2f13f0['agents'][_0x1fe00d[_0x04f0('0x43')]['id']][_0x04f0('0x46')]=undefined;}return _0x1b5123({'code':0xc8,'message':_0x1fe00d});}catch(_0x5b5730){logger[_0x04f0('0x37')](_0x5b5730['stack']);return _0x561d64(_0x214cec[_0x04f0('0x37')](0x1f4,_0x5b5730));}}logger[_0x04f0('0x37')](_0x04f0('0x4c'));return _0x561d64(_0x214cec[_0x04f0('0x37')](0x1f4,'message\x20is\x20empty'));});},'AbandonInteraction':function(_0x1f4ba2){var _0x18bfc2=this;return new Promise(function(_0x162c9e,_0x422751){if(_0x1f4ba2[_0x04f0('0x1f')]&&_0x1f4ba2['interaction']&&_0x1f4ba2[_0x04f0('0x14')]['id']){try{var _0x17c259=getId(_0x1f4ba2['channel'],_0x1f4ba2[_0x04f0('0x13')]?_0x1f4ba2['message']['id']:0x0,_0x1f4ba2[_0x04f0('0x14')]?_0x1f4ba2[_0x04f0('0x14')]['id']:0x0);if(_0x2f13f0[_0x04f0('0x12')][_0x17c259]){_0x2f13f0[_0x04f0('0x12')][_0x17c259][_0x04f0('0x3e')](_0x04f0('0x47'));}return _0x162c9e({'code':0xc8,'message':_0x1f4ba2});}catch(_0x3d5a39){logger[_0x04f0('0x37')](_0x3d5a39[_0x04f0('0x4d')]);return _0x422751(_0x18bfc2['error'](0x1f4,_0x3d5a39));}}logger[_0x04f0('0x37')]('message\x20is\x20empty');return _0x422751(_0x18bfc2[_0x04f0('0x37')](0x1f4,'message\x20is\x20empty'));});},'AgentCapacity':function(_0x381344){var _0x481908=this;return new Promise(function(_0x443909,_0x517fa6){if(_0x2f13f0[_0x04f0('0x45')][_0x04f0('0x4e')](_0x381344['id'])){for(var _0x5c27a5 in _0x381344[_0x04f0('0x4f')]){if(_0x381344[_0x04f0('0x4f')]['hasOwnProperty'](_0x5c27a5)){if(_0x2f13f0[_0x04f0('0x45')][_0x381344['id']][_0x04f0('0x4e')](_0x5c27a5+_0x04f0('0x50'))){_0x2f13f0[_0x04f0('0x45')][_0x381344['id']][_0x5c27a5+_0x04f0('0x50')]=parseInt(_0x381344[_0x04f0('0x4f')][_0x5c27a5],0xa);}}}_0x2f13f0[_0x04f0('0x45')][_0x381344['id']][_0x04f0('0x51')]();return _0x443909({'code':0xc8,'message':_0x2f13f0[_0x04f0('0x45')][_0x381344['id']]});}else{return _0x517fa6(_0x481908[_0x04f0('0x37')](0x1f4,_0x04f0('0x52')));}});},'Agents':function(_0x19ae92){return new Promise(function(_0xd4f378){var _0x37fa2d=_[_0x04f0('0x53')](_0x2f13f0[_0x04f0('0x45')]);if(_0x19ae92&&_0x19ae92['id']){var _0x27b7a9=_[_0x04f0('0x54')](_0x37fa2d,function(_0x37f9d1){return _0x37f9d1['id']===_0x19ae92['id'];});_0xd4f378(_0x27b7a9);}else{_0xd4f378({'count':_0x37fa2d[_0x04f0('0x19')],'rows':_0x37fa2d});}});},'ChatQueues':function(){return new Promise(function(_0x3b90fd){var _0x18ac00=[];for(var _0x531828 in _0x2f13f0[_0x04f0('0x55')]){if(_0x2f13f0[_0x04f0('0x55')][_0x04f0('0x4e')](_0x531828)){var _0x4a232d=_0x2f13f0['chatQueues'][_0x531828];var _0x2efb57={'id':_0x4a232d['id'],'available':_0x4a232d['available'],'loggedIn':_0x4a232d[_0x04f0('0x56')],'name':_0x4a232d[_0x04f0('0x57')],'paused':_0x4a232d[_0x04f0('0x58')],'waiting':_0x4a232d[_0x04f0('0x59')]};_0x18ac00[_0x04f0('0x21')](_0x2efb57);}}_0x3b90fd({'count':_0x18ac00[_0x04f0('0x19')],'rows':_0x18ac00});});},'MailQueues':function(){return new Promise(function(_0x22c378){var _0x44e07e=[];for(var _0x4b3ee4 in _0x2f13f0[_0x04f0('0x5a')]){if(_0x2f13f0[_0x04f0('0x5a')][_0x04f0('0x4e')](_0x4b3ee4)){var _0x4dff38=_0x2f13f0[_0x04f0('0x5a')][_0x4b3ee4];var _0x3c0e9d={'id':_0x4dff38['id'],'available':_0x4dff38['available'],'loggedIn':_0x4dff38[_0x04f0('0x56')],'name':_0x4dff38[_0x04f0('0x57')],'paused':_0x4dff38[_0x04f0('0x58')],'waiting':_0x4dff38[_0x04f0('0x59')]};_0x44e07e[_0x04f0('0x21')](_0x3c0e9d);}}_0x22c378({'count':_0x44e07e[_0x04f0('0x19')],'rows':_0x44e07e});});},'OpenchannelQueues':function(){return new Promise(function(_0x51856f){var _0x3fd357=[];for(var _0x4a22df in _0x2f13f0['openchannelQueues']){if(_0x2f13f0[_0x04f0('0x5b')][_0x04f0('0x4e')](_0x4a22df)){var _0x308d03=_0x2f13f0[_0x04f0('0x5b')][_0x4a22df];var _0x16318e={'id':_0x308d03['id'],'available':_0x308d03[_0x04f0('0x5c')],'loggedIn':_0x308d03[_0x04f0('0x56')],'name':_0x308d03[_0x04f0('0x57')],'paused':_0x308d03[_0x04f0('0x58')],'waiting':_0x308d03['waiting']};_0x3fd357[_0x04f0('0x21')](_0x16318e);}}_0x51856f({'count':_0x3fd357[_0x04f0('0x19')],'rows':_0x3fd357});});},'SmsQueues':function(){return new Promise(function(_0x4af60f){var _0x43f2b7=[];for(var _0x2604ed in _0x2f13f0[_0x04f0('0x5d')]){if(_0x2f13f0[_0x04f0('0x5d')][_0x04f0('0x4e')](_0x2604ed)){var _0x153cfd=_0x2f13f0[_0x04f0('0x5d')][_0x2604ed];var _0xa1a89b={'id':_0x153cfd['id'],'available':_0x153cfd['available'],'loggedIn':_0x153cfd['loggedIn'],'name':_0x153cfd[_0x04f0('0x57')],'paused':_0x153cfd['paused'],'waiting':_0x153cfd[_0x04f0('0x59')]};_0x43f2b7['push'](_0xa1a89b);}}_0x4af60f({'count':_0x43f2b7['length'],'rows':_0x43f2b7});});},'FaxQueues':function(){return new Promise(function(_0x116d60){var _0x4767be=[];for(var _0x20f5d3 in _0x2f13f0[_0x04f0('0x5e')]){if(_0x2f13f0[_0x04f0('0x5e')][_0x04f0('0x4e')](_0x20f5d3)){var _0x3b4966=_0x2f13f0[_0x04f0('0x5e')][_0x20f5d3];var _0x12cdd1={'id':_0x3b4966['id'],'available':_0x3b4966[_0x04f0('0x5c')],'loggedIn':_0x3b4966[_0x04f0('0x56')],'name':_0x3b4966['name'],'paused':_0x3b4966[_0x04f0('0x58')],'waiting':_0x3b4966[_0x04f0('0x59')]};_0x4767be['push'](_0x12cdd1);}}_0x116d60({'count':_0x4767be[_0x04f0('0x19')],'rows':_0x4767be});});},'WhatsappQueues':function(){return new Promise(function(_0x4dd10b){var _0x25ba44=[];for(var _0x12386e in _0x2f13f0[_0x04f0('0x5f')]){if(_0x2f13f0[_0x04f0('0x5f')][_0x04f0('0x4e')](_0x12386e)){var _0xf567f9=_0x2f13f0[_0x04f0('0x5f')][_0x12386e];var _0x513972={'id':_0xf567f9['id'],'available':_0xf567f9[_0x04f0('0x5c')],'loggedIn':_0xf567f9[_0x04f0('0x56')],'name':_0xf567f9[_0x04f0('0x57')],'paused':_0xf567f9['paused'],'waiting':_0xf567f9['waiting']};_0x25ba44[_0x04f0('0x21')](_0x513972);}}_0x4dd10b({'count':_0x25ba44[_0x04f0('0x19')],'rows':_0x25ba44});});},'ChatQueuesWaitingInteractions':function(){return new Promise(function(_0x541745){var _0x5ed68f=_[_0x04f0('0x53')](_0x2f13f0['chatQueuesWaitingInteractions']);_0x541745({'count':_0x5ed68f[_0x04f0('0x19')],'rows':_0x5ed68f});});},'MailQueuesWaitingInteractions':function(){return new Promise(function(_0x24ea1c){var _0x2a2aa4=_[_0x04f0('0x53')](_0x2f13f0[_0x04f0('0x60')]);_0x24ea1c({'count':_0x2a2aa4[_0x04f0('0x19')],'rows':_0x2a2aa4});});},'OpenchannelQueuesWaitingInteractions':function(){return new Promise(function(_0x541636){var _0x7a7815=_[_0x04f0('0x53')](_0x2f13f0[_0x04f0('0x61')]);_0x541636({'count':_0x7a7815['length'],'rows':_0x7a7815});});},'SmsQueuesWaitingInteractions':function(){return new Promise(function(_0x11d2fb){var _0x335d88=_[_0x04f0('0x53')](_0x2f13f0[_0x04f0('0x62')]);_0x11d2fb({'count':_0x335d88['length'],'rows':_0x335d88});});},'FaxQueuesWaitingInteractions':function(){return new Promise(function(_0x685f2f){var _0x5acaad=_[_0x04f0('0x53')](_0x2f13f0[_0x04f0('0x63')]);_0x685f2f({'count':_0x5acaad[_0x04f0('0x19')],'rows':_0x5acaad});});},'WhatsappQueuesWaitingInteractions':function(){return new Promise(function(_0x10bdb5){var _0x19ad78=_[_0x04f0('0x53')](_0x2f13f0[_0x04f0('0x64')]);_0x10bdb5({'count':_0x19ad78[_0x04f0('0x19')],'rows':_0x19ad78});});}};var _0x52ab28=jayson[_0x04f0('0x65')](_0x1d073c)['http']();_0x52ab28['on'](_0x04f0('0x37'),function(_0x1f6ed5){logger[_0x04f0('0x37')](JSON[_0x04f0('0x3c')](_0x1f6ed5));return _0x416181(_0x1f6ed5);});_0x52ab28[_0x04f0('0x11')](0x232c,'127.0.0.1',function(){console[_0x04f0('0x66')](_0x04f0('0x67'),0x232c);return _0x4975e2('RPC\x20listening\x20on\x20port:'+0x232c);});});}; \ No newline at end of file +var _0xb470=['openchannelQueues','smsQueues','faxQueues','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','server','http','log','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','util','path','jayson/promise','./applications/utils','./applications/strategy/util','../../../config/logger','../rpc/openchannelQueueReport','../rpc/mailQueueReport','../rpc/chatQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','../rpc/whatsappQueueReport','../lib/rule-engine','isNil','IntervalId','Intervals','map','interval','listen','channel','message','interaction','checkWaitingNotifications','applications','length','existsSync','join','app','.js','toLowerCase','autoreply','appdata','split','mail','push','slice','dialogflow','dialogflowv2','amazonlex','tag','TagId','account','notificationTemplate','body','format','%s:%s:%s','./interval','condition','intervals','./applications/','consequence','Push\x20new\x20rule','\x20|\x20','error','Please\x20create\x20a\x20new\x20file\x20under','rules','execute','info','Applications\x20executed','stringify','matchPath','emit','complete','No\x20applications\x20to\x20execute','stack','routing\x20is\x20empty','agent','agents','QueueReport','update','UserId','catch','error\x20update\x20queue\x20report','message\x20is\x20empty','busy','busyQueue','end','hasOwnProperty','capacity','CurrentCapacity','updateRealtime','agent\x20not\x20found','values','chatQueues','loggedIn','name','paused','waiting','mailQueues','available'];(function(_0x455150,_0x274121){var _0x12ca9c=function(_0x47eb22){while(--_0x47eb22){_0x455150['push'](_0x455150['shift']());}};_0x12ca9c(++_0x274121);}(_0xb470,0x75));var _0x0b47=function(_0x2e73aa,_0x10c9ae){_0x2e73aa=_0x2e73aa-0x0;var _0x52ba52=_0xb470[_0x2e73aa];return _0x52ba52;};'use strict';var _=require(_0x0b47('0x0'));var util=require(_0x0b47('0x1'));var path=require(_0x0b47('0x2'));var fs=require('fs');var jayson=require(_0x0b47('0x3'));var BPromise=require('bluebird');var utils=require(_0x0b47('0x4'));var sUtils=require(_0x0b47('0x5'));var logger=require(_0x0b47('0x6'))('routing');var rpc={'openchannelQueueReport':require(_0x0b47('0x7')),'mailQueueReport':require(_0x0b47('0x8')),'chatQueueReport':require(_0x0b47('0x9')),'smsQueueReport':require(_0x0b47('0xa')),'faxQueueReport':require(_0x0b47('0xb')),'whatsappQueueReport':require(_0x0b47('0xc'))};var RuleEngine=require(_0x0b47('0xd'));function getId(_0x37eb18,_0x4bfebf,_0x56543c){return util['format']('%s.%s.%s',_0x37eb18,_0x4bfebf||0x0,_0x56543c||0x0);}function getIntervals(_0x38523d,_0x2b9cd0){var _0x4e5ac5=[];if(!_[_0x0b47('0xe')](_0x2b9cd0[_0x0b47('0xf')])&&!_[_0x0b47('0xe')](_0x38523d[_0x2b9cd0[_0x0b47('0xf')]])&&!_[_0x0b47('0xe')](_0x38523d[_0x2b9cd0[_0x0b47('0xf')]][_0x0b47('0x10')])){_0x4e5ac5=_[_0x0b47('0x11')](_0x38523d[_0x2b9cd0[_0x0b47('0xf')]][_0x0b47('0x10')],'interval');}else if(!_['isNil'](_0x2b9cd0[_0x0b47('0x12')])){_0x4e5ac5=[_0x2b9cd0['interval']];}return _0x4e5ac5;}exports[_0x0b47('0x13')]=function(_0x1e4988){_0x1e4988['rules']={};return new BPromise(function(_0x36fe0a,_0x4089d0){var _0x2bb088={'Start':function(_0x379c9d){var _0x387084=this;return new Promise(function(_0x1c5e68,_0x1e9588){if(_0x379c9d){try{var _0x1dc752=[];var _0x130a13=getId(_0x379c9d[_0x0b47('0x14')],_0x379c9d['message']?_0x379c9d[_0x0b47('0x15')]['id']:0x0,_0x379c9d['interaction']?_0x379c9d[_0x0b47('0x16')]['id']:0x0);var _0x1620fc=sUtils[_0x0b47('0x17')](_0x1e4988,_0x379c9d);if(_0x379c9d['transfer']||!_0x1620fc&&_0x379c9d[_0x0b47('0x18')]&&_['isArray'](_0x379c9d['applications'])&&_0x379c9d[_0x0b47('0x18')][_0x0b47('0x19')]){for(var _0x52071c=0x0;_0x52071c<_0x379c9d[_0x0b47('0x18')]['length'];_0x52071c+=0x1){var _0x450f1a=_0x379c9d[_0x0b47('0x18')][_0x52071c];if(fs[_0x0b47('0x1a')](path[_0x0b47('0x1b')](__dirname,_0x0b47('0x18'),_0x450f1a[_0x0b47('0x1c')]+_0x0b47('0x1d')))){var _0x2dfdb4=[];switch(_0x450f1a[_0x0b47('0x1c')][_0x0b47('0x1e')]()){case _0x0b47('0x1f'):var _0x4f79d4=_0x450f1a[_0x0b47('0x20')][_0x0b47('0x21')](',');if(_0x379c9d['channel']===_0x0b47('0x22')){_0x2dfdb4[_0x0b47('0x23')](_0x4f79d4[0x0]);_0x2dfdb4[_0x0b47('0x23')](_0x4f79d4[0x1]);_0x2dfdb4[_0x0b47('0x23')](_0x4f79d4['slice'](0x2,_0x4f79d4['length'])[_0x0b47('0x1b')](','));}else{_0x2dfdb4[_0x0b47('0x23')](_0x4f79d4[0x0]);_0x2dfdb4['push'](_0x4f79d4[_0x0b47('0x24')](0x1,_0x4f79d4[_0x0b47('0x19')])[_0x0b47('0x1b')](','));}break;case _0x0b47('0x25'):var _0x15db7d=_0x450f1a[_0x0b47('0x20')][_0x0b47('0x21')](',');_0x2dfdb4[_0x0b47('0x23')](_0x15db7d[0x0]);_0x2dfdb4[_0x0b47('0x23')](_0x15db7d[0x1]);_0x2dfdb4[_0x0b47('0x23')](_0x15db7d[_0x0b47('0x24')](0x2,_0x15db7d['length'])['join'](','));break;case _0x0b47('0x26'):var _0x4a446e=_0x450f1a[_0x0b47('0x20')][_0x0b47('0x21')](',');_0x2dfdb4[_0x0b47('0x23')](_0x4a446e[0x0]);_0x2dfdb4[_0x0b47('0x23')](_0x4a446e[0x1]);_0x2dfdb4[_0x0b47('0x23')](_0x4a446e[0x2]);_0x2dfdb4['push'](_0x4a446e[0x3]);_0x2dfdb4[_0x0b47('0x23')](_0x4a446e[_0x0b47('0x24')](0x4,_0x4a446e[_0x0b47('0x19')])['join'](','));break;case _0x0b47('0x27'):var _0x18b804=_0x450f1a[_0x0b47('0x20')][_0x0b47('0x21')](',');_0x2dfdb4[_0x0b47('0x23')](_0x18b804[0x0]);_0x2dfdb4[_0x0b47('0x23')](_0x18b804[0x1]);_0x2dfdb4['push'](_0x18b804[0x2]);_0x2dfdb4['push'](_0x18b804[0x3]);_0x2dfdb4[_0x0b47('0x23')](_0x18b804[_0x0b47('0x24')](0x4,_0x18b804[_0x0b47('0x19')])[_0x0b47('0x1b')](','));break;case _0x0b47('0x15'):_0x2dfdb4[_0x0b47('0x23')](_0x450f1a[_0x0b47('0x20')]);break;case _0x0b47('0x28'):_0x2dfdb4[_0x0b47('0x23')](_0x450f1a[_0x0b47('0x29')]);_0x2dfdb4[_0x0b47('0x23')](_0x450f1a['appdata']);break;case'tvox':var _0x207c65=utils['getMustacheRender'](_0x379c9d[_0x0b47('0x2a')][_0x0b47('0x2b')],_0x379c9d);var _0x15c66a=_0x450f1a[_0x0b47('0x20')][_0x0b47('0x21')](',');_0x2dfdb4[_0x0b47('0x23')](_0x15c66a[0x0]);_0x2dfdb4['push'](_0x15c66a[0x1]);_0x2dfdb4['push'](_0x15c66a[0x2]);_0x2dfdb4['push'](_0x15c66a[0x3]);_0x2dfdb4[_0x0b47('0x23')](_0x15c66a[0x4]);_0x2dfdb4[_0x0b47('0x23')](_0x15c66a[0x5]);_0x2dfdb4[_0x0b47('0x23')](_0x15c66a[0x6]);_0x2dfdb4[_0x0b47('0x23')](_0x15c66a[0x7]);_0x2dfdb4[_0x0b47('0x23')](_0x15c66a[0x8]);_0x2dfdb4[_0x0b47('0x23')](_0x15c66a[0x9]);_0x2dfdb4['push'](_0x15c66a[0xa]);_0x2dfdb4[_0x0b47('0x23')](_0x379c9d[_0x0b47('0x16')]['id']);_0x2dfdb4[_0x0b47('0x23')](_0x379c9d[_0x0b47('0x15')]['id']);_0x2dfdb4['push'](_0x450f1a['ChatWebsiteId']);_0x2dfdb4[_0x0b47('0x23')](_0x379c9d[_0x0b47('0x16')]['ContactId']);_0x2dfdb4[_0x0b47('0x23')](_0x379c9d[_0x0b47('0x2c')][_0x0b47('0x2c')]);_0x2dfdb4['push'](_0x207c65);break;default:_0x2dfdb4=_['isNil'](_0x450f1a[_0x0b47('0x20')])?[]:_0x450f1a[_0x0b47('0x20')][_0x0b47('0x21')](',');}var _0x10f12a={'id':util[_0x0b47('0x2d')](_0x0b47('0x2e'),_0x130a13,_0x450f1a['id'],_0x450f1a[_0x0b47('0x1c')]),'condition':require(_0x0b47('0x2f'))[_0x0b47('0x30')](_0x130a13,getIntervals(_0x1e4988[_0x0b47('0x31')],_0x450f1a),_0x1e4988),'consequence':require(_0x0b47('0x32')+_0x450f1a[_0x0b47('0x1c')])[_0x0b47('0x33')](_0x130a13,_0x2dfdb4,_0x1e4988,_0x379c9d),'p':_0x450f1a['priority']||0x0};logger['info'](_0x0b47('0x34'),_0x10f12a['id'],'on\x20interval',getIntervals(_0x1e4988[_0x0b47('0x31')],_0x450f1a)['join'](_0x0b47('0x35')));_0x1dc752[_0x0b47('0x23')](_0x10f12a);}else{logger[_0x0b47('0x36')](_0x0b47('0x37'),path['join'](__dirname,_0x0b47('0x18'),_0x450f1a[_0x0b47('0x1c')]+'.js'));}}_0x1e4988[_0x0b47('0x38')][_0x130a13]=new RuleEngine(_0x1dc752);_0x1e4988['rules'][_0x130a13][_0x0b47('0x39')](_0x379c9d,function(_0x149824){logger[_0x0b47('0x3a')](_0x0b47('0x3b'),JSON[_0x0b47('0x3c')](_0x149824[_0x0b47('0x3d')]));if(_0x1e4988[_0x0b47('0x38')][_0x130a13]){_0x1e4988[_0x0b47('0x38')][_0x130a13][_0x0b47('0x3e')](_0x0b47('0x3f'));}});return _0x1c5e68({'code':0xc8,'message':_0x379c9d});}else{if(_0x1620fc){logger['info'](util['format']('Skipped\x20routing\x20for\x20%s',_0x130a13));}else{logger['info'](_0x0b47('0x40'));}return _0x1c5e68({'code':0xc8,'message':_0x379c9d});}}catch(_0xddbb20){logger['error'](_0xddbb20[_0x0b47('0x41')]);return _0x1e9588(_0x387084['error'](0x1f4,_0xddbb20));}}return _0x1e9588(_0x0b47('0x42'));});},'AcceptMessage':function(_0x3cd7d1){var _0x566f2d=this;return new Promise(function(_0xce508c,_0x1ef6a0){if(_0x3cd7d1[_0x0b47('0x43')]&&_0x3cd7d1[_0x0b47('0x43')]['id']){if(_0x1e4988['agents'][_0x3cd7d1[_0x0b47('0x43')]['id']]){_0x1e4988[_0x0b47('0x44')][_0x3cd7d1[_0x0b47('0x43')]['id']]['busy']=![];_0x1e4988[_0x0b47('0x44')][_0x3cd7d1[_0x0b47('0x43')]['id']]['busyQueue']=undefined;}}if(_0x3cd7d1[_0x0b47('0x15')]&&_0x3cd7d1['message']['id']){try{var _0x512d56=getId(_0x3cd7d1[_0x0b47('0x14')],_0x3cd7d1[_0x0b47('0x15')]?_0x3cd7d1['message']['id']:0x0,_0x3cd7d1[_0x0b47('0x16')]?_0x3cd7d1['interaction']['id']:0x0);if(_0x1e4988[_0x0b47('0x38')][_0x512d56]){_0x1e4988[_0x0b47('0x38')][_0x512d56][_0x0b47('0x3e')]('end');if(rpc[_0x3cd7d1['channel']+_0x0b47('0x45')]){rpc[_0x3cd7d1[_0x0b47('0x14')]+_0x0b47('0x45')][_0x0b47('0x46')](_0x512d56,{'UserId':_0x3cd7d1[_0x0b47('0x15')][_0x0b47('0x47')]})[_0x0b47('0x48')](function(){logger[_0x0b47('0x36')](_0x0b47('0x49'));});}}return _0xce508c({'code':0xc8,'message':_0x3cd7d1});}catch(_0xcb8582){logger[_0x0b47('0x36')](_0xcb8582['stack']);return _0x1ef6a0(_0x566f2d[_0x0b47('0x36')](0x1f4,_0xcb8582));}}logger[_0x0b47('0x36')](_0x0b47('0x4a'));return _0x1ef6a0(_0x566f2d['error'](0x1f4,'message\x20is\x20empty'));});},'RejectMessage':function(_0x49a01d){var _0x491ecf=this;return new Promise(function(_0x3007bc,_0x330734){if(_0x49a01d[_0x0b47('0x43')]&&_0x49a01d[_0x0b47('0x43')]['id']){try{if(_0x1e4988[_0x0b47('0x44')][_0x49a01d[_0x0b47('0x43')]['id']]){_0x1e4988['agents'][_0x49a01d[_0x0b47('0x43')]['id']][_0x0b47('0x4b')]=![];_0x1e4988[_0x0b47('0x44')][_0x49a01d['agent']['id']][_0x0b47('0x4c')]=undefined;}return _0x3007bc({'code':0xc8,'message':_0x49a01d});}catch(_0x347c16){logger[_0x0b47('0x36')](_0x347c16[_0x0b47('0x41')]);return _0x330734(_0x491ecf[_0x0b47('0x36')](0x1f4,_0x347c16));}}logger['error']('message\x20is\x20empty');return _0x330734(_0x491ecf[_0x0b47('0x36')](0x1f4,_0x0b47('0x4a')));});},'AbandonInteraction':function(_0x56ee52){var _0x185cd3=this;return new Promise(function(_0x21643f,_0x1aabc9){if(_0x56ee52[_0x0b47('0x14')]&&_0x56ee52[_0x0b47('0x16')]&&_0x56ee52[_0x0b47('0x16')]['id']){try{var _0x1b438e=getId(_0x56ee52[_0x0b47('0x14')],_0x56ee52['message']?_0x56ee52[_0x0b47('0x15')]['id']:0x0,_0x56ee52['interaction']?_0x56ee52[_0x0b47('0x16')]['id']:0x0);if(_0x1e4988[_0x0b47('0x38')][_0x1b438e]){_0x1e4988[_0x0b47('0x38')][_0x1b438e]['emit'](_0x0b47('0x4d'));}return _0x21643f({'code':0xc8,'message':_0x56ee52});}catch(_0x27feed){logger[_0x0b47('0x36')](_0x27feed[_0x0b47('0x41')]);return _0x1aabc9(_0x185cd3['error'](0x1f4,_0x27feed));}}logger[_0x0b47('0x36')]('message\x20is\x20empty');return _0x1aabc9(_0x185cd3[_0x0b47('0x36')](0x1f4,_0x0b47('0x4a')));});},'AgentCapacity':function(_0x10155f){var _0x13654a=this;return new Promise(function(_0x1d11cc,_0x2370ea){if(_0x1e4988[_0x0b47('0x44')][_0x0b47('0x4e')](_0x10155f['id'])){for(var _0x19492b in _0x10155f[_0x0b47('0x4f')]){if(_0x10155f[_0x0b47('0x4f')][_0x0b47('0x4e')](_0x19492b)){if(_0x1e4988[_0x0b47('0x44')][_0x10155f['id']][_0x0b47('0x4e')](_0x19492b+'CurrentCapacity')){_0x1e4988[_0x0b47('0x44')][_0x10155f['id']][_0x19492b+_0x0b47('0x50')]=parseInt(_0x10155f['capacity'][_0x19492b],0xa);}}}_0x1e4988[_0x0b47('0x44')][_0x10155f['id']][_0x0b47('0x51')]();return _0x1d11cc({'code':0xc8,'message':_0x1e4988[_0x0b47('0x44')][_0x10155f['id']]});}else{return _0x2370ea(_0x13654a[_0x0b47('0x36')](0x1f4,_0x0b47('0x52')));}});},'Agents':function(_0x1a3f2d){return new Promise(function(_0x4933d6){var _0x16f4ac=_[_0x0b47('0x53')](_0x1e4988[_0x0b47('0x44')]);if(_0x1a3f2d&&_0x1a3f2d['id']){var _0x234698=_['find'](_0x16f4ac,function(_0x414693){return _0x414693['id']===_0x1a3f2d['id'];});_0x4933d6(_0x234698);}else{_0x4933d6({'count':_0x16f4ac[_0x0b47('0x19')],'rows':_0x16f4ac});}});},'ChatQueues':function(){return new Promise(function(_0x2f5d25){var _0x4d903c=[];for(var _0x571a9c in _0x1e4988[_0x0b47('0x54')]){if(_0x1e4988['chatQueues'][_0x0b47('0x4e')](_0x571a9c)){var _0xde93c3=_0x1e4988[_0x0b47('0x54')][_0x571a9c];var _0x40c054={'id':_0xde93c3['id'],'available':_0xde93c3['available'],'loggedIn':_0xde93c3[_0x0b47('0x55')],'name':_0xde93c3[_0x0b47('0x56')],'paused':_0xde93c3[_0x0b47('0x57')],'waiting':_0xde93c3[_0x0b47('0x58')]};_0x4d903c[_0x0b47('0x23')](_0x40c054);}}_0x2f5d25({'count':_0x4d903c['length'],'rows':_0x4d903c});});},'MailQueues':function(){return new Promise(function(_0x4c56aa){var _0x2fd817=[];for(var _0x282bfe in _0x1e4988[_0x0b47('0x59')]){if(_0x1e4988['mailQueues'][_0x0b47('0x4e')](_0x282bfe)){var _0x4f0dff=_0x1e4988[_0x0b47('0x59')][_0x282bfe];var _0x3dd993={'id':_0x4f0dff['id'],'available':_0x4f0dff[_0x0b47('0x5a')],'loggedIn':_0x4f0dff[_0x0b47('0x55')],'name':_0x4f0dff[_0x0b47('0x56')],'paused':_0x4f0dff[_0x0b47('0x57')],'waiting':_0x4f0dff[_0x0b47('0x58')]};_0x2fd817[_0x0b47('0x23')](_0x3dd993);}}_0x4c56aa({'count':_0x2fd817[_0x0b47('0x19')],'rows':_0x2fd817});});},'OpenchannelQueues':function(){return new Promise(function(_0x2f54c9){var _0x2b16d2=[];for(var _0x3fb43b in _0x1e4988['openchannelQueues']){if(_0x1e4988[_0x0b47('0x5b')][_0x0b47('0x4e')](_0x3fb43b)){var _0x110f99=_0x1e4988[_0x0b47('0x5b')][_0x3fb43b];var _0x3b45e7={'id':_0x110f99['id'],'available':_0x110f99[_0x0b47('0x5a')],'loggedIn':_0x110f99[_0x0b47('0x55')],'name':_0x110f99['name'],'paused':_0x110f99[_0x0b47('0x57')],'waiting':_0x110f99[_0x0b47('0x58')]};_0x2b16d2['push'](_0x3b45e7);}}_0x2f54c9({'count':_0x2b16d2[_0x0b47('0x19')],'rows':_0x2b16d2});});},'SmsQueues':function(){return new Promise(function(_0x9d08b1){var _0x54b19b=[];for(var _0x14b66b in _0x1e4988[_0x0b47('0x5c')]){if(_0x1e4988[_0x0b47('0x5c')][_0x0b47('0x4e')](_0x14b66b)){var _0x34f2b8=_0x1e4988[_0x0b47('0x5c')][_0x14b66b];var _0xb27e48={'id':_0x34f2b8['id'],'available':_0x34f2b8[_0x0b47('0x5a')],'loggedIn':_0x34f2b8['loggedIn'],'name':_0x34f2b8['name'],'paused':_0x34f2b8[_0x0b47('0x57')],'waiting':_0x34f2b8[_0x0b47('0x58')]};_0x54b19b[_0x0b47('0x23')](_0xb27e48);}}_0x9d08b1({'count':_0x54b19b[_0x0b47('0x19')],'rows':_0x54b19b});});},'FaxQueues':function(){return new Promise(function(_0x107cf0){var _0x2f1076=[];for(var _0x3121b7 in _0x1e4988[_0x0b47('0x5d')]){if(_0x1e4988[_0x0b47('0x5d')][_0x0b47('0x4e')](_0x3121b7)){var _0x20c89a=_0x1e4988[_0x0b47('0x5d')][_0x3121b7];var _0x48c46a={'id':_0x20c89a['id'],'available':_0x20c89a[_0x0b47('0x5a')],'loggedIn':_0x20c89a[_0x0b47('0x55')],'name':_0x20c89a['name'],'paused':_0x20c89a[_0x0b47('0x57')],'waiting':_0x20c89a[_0x0b47('0x58')]};_0x2f1076[_0x0b47('0x23')](_0x48c46a);}}_0x107cf0({'count':_0x2f1076[_0x0b47('0x19')],'rows':_0x2f1076});});},'WhatsappQueues':function(){return new Promise(function(_0x353e1f){var _0x79ea4b=[];for(var _0x1e824c in _0x1e4988[_0x0b47('0x5e')]){if(_0x1e4988[_0x0b47('0x5e')][_0x0b47('0x4e')](_0x1e824c)){var _0xbf0317=_0x1e4988[_0x0b47('0x5e')][_0x1e824c];var _0x352c66={'id':_0xbf0317['id'],'available':_0xbf0317[_0x0b47('0x5a')],'loggedIn':_0xbf0317[_0x0b47('0x55')],'name':_0xbf0317[_0x0b47('0x56')],'paused':_0xbf0317['paused'],'waiting':_0xbf0317[_0x0b47('0x58')]};_0x79ea4b[_0x0b47('0x23')](_0x352c66);}}_0x353e1f({'count':_0x79ea4b[_0x0b47('0x19')],'rows':_0x79ea4b});});},'ChatQueuesWaitingInteractions':function(){return new Promise(function(_0x123a1b){var _0x466685=_['values'](_0x1e4988[_0x0b47('0x5f')]);_0x123a1b({'count':_0x466685['length'],'rows':_0x466685});});},'MailQueuesWaitingInteractions':function(){return new Promise(function(_0xb1153a){var _0x239057=_[_0x0b47('0x53')](_0x1e4988[_0x0b47('0x60')]);_0xb1153a({'count':_0x239057['length'],'rows':_0x239057});});},'OpenchannelQueuesWaitingInteractions':function(){return new Promise(function(_0xed9c68){var _0x117518=_[_0x0b47('0x53')](_0x1e4988[_0x0b47('0x61')]);_0xed9c68({'count':_0x117518[_0x0b47('0x19')],'rows':_0x117518});});},'SmsQueuesWaitingInteractions':function(){return new Promise(function(_0x12f0b7){var _0x3b4204=_[_0x0b47('0x53')](_0x1e4988['smsQueuesWaitingInteractions']);_0x12f0b7({'count':_0x3b4204[_0x0b47('0x19')],'rows':_0x3b4204});});},'FaxQueuesWaitingInteractions':function(){return new Promise(function(_0x5082ff){var _0x172a33=_['values'](_0x1e4988['faxQueuesWaitingInteractions']);_0x5082ff({'count':_0x172a33[_0x0b47('0x19')],'rows':_0x172a33});});},'WhatsappQueuesWaitingInteractions':function(){return new Promise(function(_0x48c75a){var _0x469921=_[_0x0b47('0x53')](_0x1e4988[_0x0b47('0x62')]);_0x48c75a({'count':_0x469921[_0x0b47('0x19')],'rows':_0x469921});});}};var _0xf1bb2e=jayson[_0x0b47('0x63')](_0x2bb088)[_0x0b47('0x64')]();_0xf1bb2e['on'](_0x0b47('0x36'),function(_0x2afe32){logger[_0x0b47('0x36')](JSON[_0x0b47('0x3c')](_0x2afe32));return _0x4089d0(_0x2afe32);});_0xf1bb2e[_0x0b47('0x13')](0x232c,'127.0.0.1',function(){console[_0x0b47('0x65')](_0x0b47('0x66'),0x232c);return _0x36fe0a(_0x0b47('0x67')+0x232c);});});}; \ No newline at end of file diff --git a/server/services/routing/server/interval.js b/server/services/routing/server/interval.js index 5bf0667..50fc053 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 _0x4cdd=['../../../config/logger','routing','condition','rules','[%s][INTERVAL]\x20ROUTING\x20STOPPED','stop','map','some','info','join','\x20|\x20','when','[%s][INTERVAL\x20NOT\x20VALID]\x20%s\x20%s','lodash','../../../utils/iftime','iftime'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x4cdd,0x6d));var _0xd4cd=function(_0x30d3c6,_0x191a8d){_0x30d3c6=_0x30d3c6-0x0;var _0x1a71d8=_0x4cdd[_0x30d3c6];return _0x1a71d8;};'use strict';var _=require(_0xd4cd('0x0'));var iftime=require(_0xd4cd('0x1'))[_0xd4cd('0x2')];var logger=require(_0xd4cd('0x3'))(_0xd4cd('0x4'));exports[_0xd4cd('0x5')]=function(_0x442e90,_0x2c292e,_0x49be82){return function(_0x3ee927){if(_0x49be82[_0xd4cd('0x6')]&&!_0x49be82[_0xd4cd('0x6')][_0x442e90]){logger['info'](_0xd4cd('0x7'),_0x442e90);return _0x3ee927[_0xd4cd('0x8')]();}var _0x1cb284=_0x2c292e[_0xd4cd('0x9')](function(_0x14e735){return iftime(_0x14e735);});var _0x52a8f9=_[_0xd4cd('0xa')](_0x1cb284);if(_0x52a8f9){logger[_0xd4cd('0xb')]('[%s][INTERVAL\x20VALID]\x20%s\x20%s',_0x442e90,_0x2c292e[_0xd4cd('0xc')](_0xd4cd('0xd')),_0x52a8f9);_0x3ee927[_0xd4cd('0xe')](_0x52a8f9);}else{logger['info'](_0xd4cd('0xf'),_0x442e90,_0x2c292e[_0xd4cd('0xc')](_0xd4cd('0xd')));_0x3ee927[_0xd4cd('0x8')]();}};}; \ No newline at end of file +var _0xb70f=['when','lodash','../../../utils/iftime','iftime','../../../config/logger','routing','rules','[%s][INTERVAL]\x20ROUTING\x20STOPPED','stop','map','some','[%s][INTERVAL\x20VALID]\x20%s\x20%s','join','\x20|\x20'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb70f,0x127));var _0xfb70=function(_0x3945ed,_0x4f394e){_0x3945ed=_0x3945ed-0x0;var _0x48569e=_0xb70f[_0x3945ed];return _0x48569e;};'use strict';var _=require(_0xfb70('0x0'));var iftime=require(_0xfb70('0x1'))[_0xfb70('0x2')];var logger=require(_0xfb70('0x3'))(_0xfb70('0x4'));exports['condition']=function(_0x474087,_0xb8a819,_0x2c9dee){return function(_0x442eac){if(_0x2c9dee['rules']&&!_0x2c9dee[_0xfb70('0x5')][_0x474087]){logger['info'](_0xfb70('0x6'),_0x474087);return _0x442eac[_0xfb70('0x7')]();}var _0x234c4e=_0xb8a819[_0xfb70('0x8')](function(_0x38c6c7){return iftime(_0x38c6c7);});var _0x583634=_[_0xfb70('0x9')](_0x234c4e);if(_0x583634){logger['info'](_0xfb70('0xa'),_0x474087,_0xb8a819[_0xfb70('0xb')](_0xfb70('0xc')),_0x583634);_0x442eac[_0xfb70('0xd')](_0x583634);}else{logger['info']('[%s][INTERVAL\x20NOT\x20VALID]\x20%s\x20%s',_0x474087,_0xb8a819[_0xfb70('0xb')](_0xfb70('0xc')));_0x442eac[_0xfb70('0x7')]();}};}; \ No newline at end of file diff --git a/server/services/xdr/agents.controller.js b/server/services/xdr/agents.controller.js index 853ba83..a46ad01 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 _0xbee3=['answeredelsewheremembername','[%s][agents][agentconnect]','[%s][agents][agentcomplete]','[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','diffTime','complete','blindtransfer','[%s][agents][blindtransfer]','[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s','transfereruniqueid','transfer','extension','transferuniqueid','[%s][agents][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','secondtransfereruniqueid','ATTENDED','transferexten','transfereeuniqueid','agententerreason','clone','calleridnum','secondtransfererlinkedid','[%s][agents][attendedtransfer]\x20agent:%s','secondtransfererexten','transfertargetuniqueid','calleridname','agentconnectAt','hangup','[%s][agents][hangup]','timeout','cause','rejected','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','indexOf','splice','agentcompleteAt','agent','util','info','[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','uniqueid','channel','membername','interface','connectedlinenum','lastevent','queue','getVoiceQueueByName','then','type','agentacw','agentcomplete','acw','acwtime','request','CreateVoiceAgentReport','destuniqueid','agentcalled','debug','[%s][agents][agentcalled]','agentcalledAt','format','[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','error','isNil','[%s][agents][agentringnoanswer]','[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout','agentringnoanswer','agentringnoanswerAt','now','reason','holdtime','ringtime','talktime','push','queuecallerabandon','forIn','includes','abandoned','[%s][agents][queuecallerabandon]','agentconnect','[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','connectedlinename','answered_elsewhere','answeredelsewheredestinationuniqueid'];(function(_0x3d31bd,_0x28a88c){var _0x84436a=function(_0x474570){while(--_0x474570){_0x3d31bd['push'](_0x3d31bd['shift']());}};_0x84436a(++_0x28a88c);}(_0xbee3,0xd5));var _0x3bee=function(_0x1c119e,_0x44a40b){_0x1c119e=_0x1c119e-0x0;var _0x3dc5bd=_0xbee3[_0x1c119e];return _0x3dc5bd;};'use strict';var _=require('lodash');var util=require(_0x3bee('0x0'));var utils=require('./utils');var agents={};var transfers={};var unanswered=[];function writeDB(_0x56a879,_0x45a1bf){utils[_0x3bee('0x1')](util['format'](_0x3bee('0x2'),_0x56a879[_0x3bee('0x3')],_0x56a879[_0x3bee('0x4')],_0x56a879['queue'],_0x56a879[_0x3bee('0x5')],_0x56a879[_0x3bee('0x6')],_0x56a879['calleridnum'],_0x56a879[_0x3bee('0x7')],_0x56a879[_0x3bee('0x8')]));if(_0x56a879[_0x3bee('0x9')]){utils[_0x3bee('0xa')](_0x56a879[_0x3bee('0x9')])[_0x3bee('0xb')](function(_0x3485b8){if(_0x3485b8){_0x56a879['type']=_0x3485b8[_0x3bee('0xc')];_0x56a879[_0x3bee('0xd')]=_0x56a879[_0x3bee('0xe')]?_0x3485b8[_0x3bee('0xf')]:![];_0x56a879[_0x3bee('0x10')]=_0x56a879[_0x3bee('0xd')]?_0x3485b8['acwTimeout']:0x0;}utils[_0x3bee('0x11')]('CreateVoiceAgentReport',_0x56a879);});}else{utils[_0x3bee('0x11')](_0x3bee('0x12'),_0x56a879);}if(_0x45a1bf){delete transfers[_0x56a879[_0x3bee('0x3')]];}else{delete agents[_0x56a879[_0x3bee('0x13')]];}}exports[_0x3bee('0x14')]=function(_0x459129){try{utils[_0x3bee('0x15')](util['format'](_0x3bee('0x16'),_0x459129[_0x3bee('0x3')]),_0x459129);agents[_0x459129[_0x3bee('0x13')]]=_0x459129;agents[_0x459129[_0x3bee('0x13')]][_0x3bee('0x17')]=utils['now']();agents[_0x459129['destuniqueid']][_0x3bee('0x8')]='called';agents[_0x459129[_0x3bee('0x13')]][_0x3bee('0x7')]=null;agents[_0x459129['destuniqueid']]['connectedlinename']=null;utils[_0x3bee('0x1')](util[_0x3bee('0x18')](_0x3bee('0x19'),_0x459129[_0x3bee('0x3')],agents[_0x459129['destuniqueid']][_0x3bee('0x5')],_0x459129[_0x3bee('0x13')]));}catch(_0x440644){utils[_0x3bee('0x1a')](util[_0x3bee('0x18')](_0x3bee('0x16'),_0x459129[_0x3bee('0x3')]),_0x440644);}};exports['agentringnoanswer']=function(_0x4f36af){try{if(!_[_0x3bee('0x1b')](agents[_0x4f36af[_0x3bee('0x13')]])){utils['debug'](util[_0x3bee('0x18')](_0x3bee('0x1c'),_0x4f36af[_0x3bee('0x3')]),_0x4f36af);utils[_0x3bee('0x1')](util[_0x3bee('0x18')](_0x3bee('0x1d'),_0x4f36af[_0x3bee('0x3')],agents[_0x4f36af['destuniqueid']][_0x3bee('0x5')],_0x4f36af[_0x3bee('0x13')]));agents[_0x4f36af[_0x3bee('0x13')]][_0x3bee('0x1e')]=!![];agents[_0x4f36af['destuniqueid']][_0x3bee('0x1f')]=utils[_0x3bee('0x20')]();agents[_0x4f36af[_0x3bee('0x13')]]['lastevent']='timeout';agents[_0x4f36af[_0x3bee('0x13')]][_0x3bee('0x21')]='timeout';agents[_0x4f36af[_0x3bee('0x13')]][_0x3bee('0x22')]=_0x4f36af[_0x3bee('0x23')]?parseInt(_0x4f36af['ringtime'])/0x3e8:0x0;agents[_0x4f36af[_0x3bee('0x13')]][_0x3bee('0x24')]=0x0;unanswered[_0x3bee('0x25')](_0x4f36af['destuniqueid']);}}catch(_0x239fa4){utils[_0x3bee('0x1a')](util[_0x3bee('0x18')]('[%s][agents][agentringnoanswer]',_0x4f36af[_0x3bee('0x3')]),_0x239fa4);}};exports[_0x3bee('0x26')]=function(_0x27ed99){try{_[_0x3bee('0x27')](agents,function(_0x3433aa,_0x559c2b){if(_0x3433aa['uniqueid']==_0x27ed99[_0x3bee('0x3')]&&!_[_0x3bee('0x28')](unanswered,_0x3433aa[_0x3bee('0x13')])){utils[_0x3bee('0x15')](util['format']('[%s][agents][queuecallerabandon]',_0x27ed99[_0x3bee('0x3')]),_0x27ed99);utils[_0x3bee('0x1')](util['format']('[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned',_0x27ed99[_0x3bee('0x3')],_0x3433aa[_0x3bee('0x5')],_0x3433aa[_0x3bee('0x13')]));_0x3433aa[_0x3bee('0x1e')]=!![];_0x3433aa[_0x3bee('0x1f')]=utils[_0x3bee('0x20')]();_0x3433aa[_0x3bee('0x8')]=_0x3bee('0x29');_0x3433aa[_0x3bee('0x21')]=_0x3bee('0x29');_0x3433aa['holdtime']=_0x27ed99['holdtime'];_0x3433aa[_0x3bee('0x24')]=0x0;writeDB(_0x3433aa);}});}catch(_0x4a4706){utils['error'](util[_0x3bee('0x18')](_0x3bee('0x2a'),_0x27ed99[_0x3bee('0x3')]),_0x4a4706);}};exports[_0x3bee('0x2b')]=function(_0xd926f8){try{if(agents[_0xd926f8[_0x3bee('0x13')]]){utils[_0x3bee('0x15')](util[_0x3bee('0x18')]('[%s][agents][agentconnect]',_0xd926f8[_0x3bee('0x3')]),_0xd926f8);utils[_0x3bee('0x1')](util['format'](_0x3bee('0x2c'),_0xd926f8[_0x3bee('0x3')],agents[_0xd926f8[_0x3bee('0x13')]][_0x3bee('0x5')],_0xd926f8[_0x3bee('0x13')]));agents[_0xd926f8['destuniqueid']]['agentconnectAt']=utils[_0x3bee('0x20')]();agents[_0xd926f8[_0x3bee('0x13')]][_0x3bee('0x7')]=_0xd926f8[_0x3bee('0x7')];agents[_0xd926f8[_0x3bee('0x13')]][_0x3bee('0x2d')]=_0xd926f8[_0x3bee('0x2d')];agents[_0xd926f8[_0x3bee('0x13')]][_0x3bee('0x22')]=_0xd926f8[_0x3bee('0x23')];agents[_0xd926f8[_0x3bee('0x13')]][_0x3bee('0x8')]='connect';_[_0x3bee('0x27')](agents,function(_0x1b5eca,_0x25158b){if(_0x1b5eca[_0x3bee('0x13')]!=_0xd926f8[_0x3bee('0x13')]&&_0x1b5eca[_0x3bee('0x3')]==_0xd926f8[_0x3bee('0x3')]){_0x1b5eca[_0x3bee('0x24')]=0x0;_0x1b5eca[_0x3bee('0x22')]=_0xd926f8[_0x3bee('0x23')];_0x1b5eca[_0x3bee('0x1e')]=!![];_0x1b5eca[_0x3bee('0x1f')]=utils[_0x3bee('0x20')]();_0x1b5eca['lastevent']=_0x3bee('0x2e');_0x1b5eca[_0x3bee('0x21')]=_0x3bee('0x2e');_0x1b5eca[_0x3bee('0x2f')]=_0xd926f8[_0x3bee('0x13')];_0x1b5eca[_0x3bee('0x30')]=_0xd926f8[_0x3bee('0x5')];writeDB(_0x1b5eca);}});}}catch(_0xd1140d){utils['error'](util[_0x3bee('0x18')](_0x3bee('0x31'),_0xd926f8[_0x3bee('0x3')]),_0xd1140d);}};exports['agentcomplete']=function(_0x4567f2){try{if(!_['isNil'](agents[_0x4567f2[_0x3bee('0x13')]])){utils['debug'](util['format'](_0x3bee('0x32'),_0x4567f2[_0x3bee('0x3')]),_0x4567f2);utils[_0x3bee('0x1')](util[_0x3bee('0x18')](_0x3bee('0x33'),_0x4567f2['uniqueid'],agents[_0x4567f2['destuniqueid']][_0x3bee('0x5')],_0x4567f2['destuniqueid']));agents[_0x4567f2[_0x3bee('0x13')]]['agentcomplete']=!![];agents[_0x4567f2[_0x3bee('0x13')]]['agentcompleteAt']=utils[_0x3bee('0x20')]();agents[_0x4567f2[_0x3bee('0x13')]][_0x3bee('0x24')]=utils[_0x3bee('0x34')](agents[_0x4567f2['destuniqueid']]['agentcompleteAt'],agents[_0x4567f2[_0x3bee('0x13')]]['agentconnectAt']);agents[_0x4567f2['destuniqueid']]['reason']=_0x4567f2[_0x3bee('0x21')];agents[_0x4567f2['destuniqueid']][_0x3bee('0x8')]=_0x3bee('0x35');writeDB(agents[_0x4567f2[_0x3bee('0x13')]]);}}catch(_0x593427){utils[_0x3bee('0x1a')](util['format'](_0x3bee('0x32'),_0x4567f2['uniqueid']),_0x593427);}};exports[_0x3bee('0x36')]=function(_0x16b096){try{if(!_[_0x3bee('0x1b')](agents[_0x16b096['transfereruniqueid']])){utils[_0x3bee('0x15')](util[_0x3bee('0x18')](_0x3bee('0x37'),_0x16b096['uniqueid']),_0x16b096);utils['info'](util[_0x3bee('0x18')](_0x3bee('0x38'),_0x16b096[_0x3bee('0x3')],agents[_0x16b096[_0x3bee('0x39')]][_0x3bee('0x5')],agents[_0x16b096[_0x3bee('0x39')]][_0x3bee('0x3')]));agents[_0x16b096['transfereruniqueid']][_0x3bee('0x3a')]=!![];agents[_0x16b096[_0x3bee('0x39')]]['transfertype']='blind';agents[_0x16b096[_0x3bee('0x39')]]['transferexten']=_0x16b096[_0x3bee('0x3b')];agents[_0x16b096[_0x3bee('0x39')]][_0x3bee('0x3c')]=agents[_0x16b096['transfereruniqueid']][_0x3bee('0x3')];}}catch(_0x3beac9){utils[_0x3bee('0x1a')](util['format'](_0x3bee('0x37'),_0x16b096[_0x3bee('0x3')]),_0x3beac9);}};exports['attendedtransfer']=function(_0x7e37ed){try{utils[_0x3bee('0x15')](util['format'](_0x3bee('0x3d'),_0x7e37ed[_0x3bee('0x3e')]),_0x7e37ed);if(_0x7e37ed[_0x3bee('0x3e')]==_0x7e37ed[_0x3bee('0x3f')]){if(!_[_0x3bee('0x1b')](agents[_0x7e37ed[_0x3bee('0x40')]])){utils[_0x3bee('0x1')](util[_0x3bee('0x18')]('[%s][agents][attendedtransfer]\x20agent:%s',_0x7e37ed['origtransfereruniqueid'],agents[_0x7e37ed[_0x3bee('0x40')]]['membername']));agents[_0x7e37ed[_0x3bee('0x40')]][_0x3bee('0x3a')]=!![];agents[_0x7e37ed[_0x3bee('0x40')]]['transfertype']=_0x3bee('0x41');agents[_0x7e37ed[_0x3bee('0x40')]][_0x3bee('0x42')]=_0x7e37ed['origtransfererexten'];agents[_0x7e37ed[_0x3bee('0x40')]]['transferuniqueid']=_0x7e37ed[_0x3bee('0x3e')];}if(_0x7e37ed[_0x3bee('0x43')]&&agents[_0x7e37ed[_0x3bee('0x43')]]){agents[_0x7e37ed['transfereeuniqueid']][_0x3bee('0x44')]=0x1;transfers[_0x7e37ed[_0x3bee('0x43')]]=_[_0x3bee('0x45')](agents[_0x7e37ed['transfereeuniqueid']]);transfers[_0x7e37ed['transfereeuniqueid']][_0x3bee('0x46')]=agents[_0x7e37ed[_0x3bee('0x40')]][_0x3bee('0x46')];transfers[_0x7e37ed['transfereeuniqueid']]['calleridname']=agents[_0x7e37ed[_0x3bee('0x40')]]['calleridname'];transfers[_0x7e37ed['transfereeuniqueid']][_0x3bee('0x17')]=utils[_0x3bee('0x20')]();transfers[_0x7e37ed[_0x3bee('0x43')]]['agentconnectAt']=utils['now']();transfers[_0x7e37ed[_0x3bee('0x43')]][_0x3bee('0x22')]=0x0;transfers[_0x7e37ed['transfereeuniqueid']][_0x3bee('0x44')]=0x2;}}else if(_0x7e37ed['secondtransfereruniqueid']==_0x7e37ed[_0x3bee('0x47')]){if(!_[_0x3bee('0x1b')](agents[_0x7e37ed[_0x3bee('0x3e')]])){utils[_0x3bee('0x1')](util[_0x3bee('0x18')](_0x3bee('0x48'),_0x7e37ed[_0x3bee('0x3e')],agents[_0x7e37ed[_0x3bee('0x3e')]][_0x3bee('0x5')]));agents[_0x7e37ed[_0x3bee('0x3e')]][_0x3bee('0x3a')]=!![];agents[_0x7e37ed['origtransfereruniqueid']]['transfertype']='ATTENDED';agents[_0x7e37ed[_0x3bee('0x3e')]][_0x3bee('0x42')]=_0x7e37ed[_0x3bee('0x49')];agents[_0x7e37ed[_0x3bee('0x3e')]]['transferuniqueid']=_0x7e37ed[_0x3bee('0x40')];}if(_0x7e37ed[_0x3bee('0x4a')]&&agents[_0x7e37ed['transfertargetuniqueid']]){agents[_0x7e37ed['transfertargetuniqueid']][_0x3bee('0x44')]=0x1;transfers[_0x7e37ed[_0x3bee('0x4a')]]=_[_0x3bee('0x45')](agents[_0x7e37ed['transfertargetuniqueid']]);transfers[_0x7e37ed[_0x3bee('0x4a')]][_0x3bee('0x46')]=agents[_0x7e37ed[_0x3bee('0x3e')]]['calleridnum'];transfers[_0x7e37ed[_0x3bee('0x4a')]][_0x3bee('0x4b')]=agents[_0x7e37ed[_0x3bee('0x3e')]][_0x3bee('0x4b')];transfers[_0x7e37ed['transfertargetuniqueid']]['agentcalledAt']=utils[_0x3bee('0x20')]();transfers[_0x7e37ed[_0x3bee('0x4a')]][_0x3bee('0x4c')]=utils[_0x3bee('0x20')]();transfers[_0x7e37ed[_0x3bee('0x4a')]]['holdtime']=0x0;transfers[_0x7e37ed[_0x3bee('0x4a')]]['agententerreason']=0x2;}}}catch(_0xddc56b){utils[_0x3bee('0x1a')](util[_0x3bee('0x18')](_0x3bee('0x3d'),_0x7e37ed[_0x3bee('0x3e')]),_0xddc56b);}};exports[_0x3bee('0x4d')]=function(_0x3f7dad){try{utils['debug'](util[_0x3bee('0x18')](_0x3bee('0x4e'),_0x3f7dad[_0x3bee('0x3')]),_0x3f7dad);if(agents[_0x3f7dad[_0x3bee('0x3')]]&&agents[_0x3f7dad['uniqueid']][_0x3bee('0x21')]===_0x3bee('0x4f')){if(_0x3f7dad[_0x3bee('0x50')]==='21'){agents[_0x3f7dad[_0x3bee('0x3')]][_0x3bee('0x21')]=_0x3bee('0x51');agents[_0x3f7dad[_0x3bee('0x3')]][_0x3bee('0x8')]='rejected';}utils[_0x3bee('0x1')](util[_0x3bee('0x18')](_0x3bee('0x52'),_0x3f7dad['uniqueid'],agents[_0x3f7dad[_0x3bee('0x3')]][_0x3bee('0x5')],agents[_0x3f7dad[_0x3bee('0x3')]][_0x3bee('0x21')],agents[_0x3f7dad[_0x3bee('0x3')]][_0x3bee('0x8')]));writeDB(agents[_0x3f7dad[_0x3bee('0x3')]]);var _0x204843=unanswered[_0x3bee('0x53')](_0x3f7dad[_0x3bee('0x3')]);if(_0x204843>-0x1){unanswered[_0x3bee('0x54')](_0x204843,0x1);}}if(transfers[_0x3f7dad[_0x3bee('0x3')]]){transfers[_0x3f7dad[_0x3bee('0x3')]][_0x3bee('0xe')]=!![];transfers[_0x3f7dad[_0x3bee('0x3')]][_0x3bee('0x55')]=utils[_0x3bee('0x20')]();transfers[_0x3f7dad[_0x3bee('0x3')]][_0x3bee('0x24')]=utils[_0x3bee('0x34')](transfers[_0x3f7dad[_0x3bee('0x3')]][_0x3bee('0x55')],transfers[_0x3f7dad[_0x3bee('0x3')]][_0x3bee('0x4c')]);transfers[_0x3f7dad[_0x3bee('0x3')]]['reason']=_0x3bee('0x56');transfers[_0x3f7dad[_0x3bee('0x3')]][_0x3bee('0x8')]=_0x3bee('0x35');utils[_0x3bee('0x1')](util[_0x3bee('0x18')](_0x3bee('0x52'),_0x3f7dad[_0x3bee('0x3')],transfers[_0x3f7dad[_0x3bee('0x3')]]['membername'],transfers[_0x3f7dad[_0x3bee('0x3')]][_0x3bee('0x21')],transfers[_0x3f7dad['uniqueid']][_0x3bee('0x8')]));writeDB(transfers[_0x3f7dad['uniqueid']],!![]);}if(agents[_0x3f7dad[_0x3bee('0x3')]]&&agents[_0x3f7dad[_0x3bee('0x3')]][_0x3bee('0x4c')]){agents[_0x3f7dad['uniqueid']]['agentcomplete']=!![];agents[_0x3f7dad[_0x3bee('0x3')]][_0x3bee('0x55')]=utils[_0x3bee('0x20')]();agents[_0x3f7dad[_0x3bee('0x3')]][_0x3bee('0x24')]=utils[_0x3bee('0x34')](agents[_0x3f7dad[_0x3bee('0x3')]][_0x3bee('0x55')],agents[_0x3f7dad['uniqueid']][_0x3bee('0x4c')]);agents[_0x3f7dad[_0x3bee('0x3')]][_0x3bee('0x21')]=agents[_0x3f7dad[_0x3bee('0x3')]][_0x3bee('0x3a')]?_0x3bee('0x3a'):_0x3bee('0x56');agents[_0x3f7dad['uniqueid']][_0x3bee('0x8')]=_0x3bee('0x35');utils['info'](util[_0x3bee('0x18')](_0x3bee('0x52'),_0x3f7dad['uniqueid'],agents[_0x3f7dad[_0x3bee('0x3')]]['membername'],agents[_0x3f7dad[_0x3bee('0x3')]][_0x3bee('0x21')],agents[_0x3f7dad[_0x3bee('0x3')]][_0x3bee('0x8')]));writeDB(agents[_0x3f7dad['uniqueid']]);}}catch(_0x62900b){utils[_0x3bee('0x1a')](util[_0x3bee('0x18')]('[%s][agents][hangup]',_0x3f7dad[_0x3bee('0x3')]),_0x62900b);}}; \ No newline at end of file +var _0xe205=['interface','calleridnum','then','type','agentacw','agentcomplete','acw','acwTimeout','request','CreateVoiceAgentReport','destuniqueid','agentcalled','agentcalledAt','now','lastevent','connectedlinenum','connectedlinename','[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','error','[%s][agents][agentcalled]','[%s][agents][agentringnoanswer]','[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout','agentringnoanswerAt','timeout','reason','holdtime','ringtime','talktime','push','queuecallerabandon','forIn','includes','debug','[%s][agents][queuecallerabandon]','[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','agentringnoanswer','abandoned','agentconnect','[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','connect','answered_elsewhere','answeredelsewheremembername','[%s][agents][agentconnect]','isNil','[%s][agents][agentcomplete]','diffTime','agentcompleteAt','complete','blindtransfer','transfereruniqueid','[%s][agents][blindtransfer]','[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s','transfer','transfertype','blind','transferexten','extension','transferuniqueid','attendedtransfer','origtransfereruniqueid','secondtransfereruniqueid','[%s][agents][attendedtransfer]\x20agent:%s','ATTENDED','origtransfererexten','transfereeuniqueid','agententerreason','calleridname','secondtransfererlinkedid','transfertargetuniqueid','clone','hangup','cause','rejected','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','indexOf','splice','agent','[%s][agents][hangup]','lodash','util','./utils','info','format','[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','uniqueid','queue','membername'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xe205,0xa7));var _0x5e20=function(_0x5c55dd,_0x3cd260){_0x5c55dd=_0x5c55dd-0x0;var _0x3521fc=_0xe205[_0x5c55dd];return _0x3521fc;};'use strict';var _=require(_0x5e20('0x0'));var util=require(_0x5e20('0x1'));var utils=require(_0x5e20('0x2'));var agents={};var transfers={};var unanswered=[];function writeDB(_0x3cdbb0,_0x6c1585){utils[_0x5e20('0x3')](util[_0x5e20('0x4')](_0x5e20('0x5'),_0x3cdbb0[_0x5e20('0x6')],_0x3cdbb0['channel'],_0x3cdbb0[_0x5e20('0x7')],_0x3cdbb0[_0x5e20('0x8')],_0x3cdbb0[_0x5e20('0x9')],_0x3cdbb0[_0x5e20('0xa')],_0x3cdbb0['connectedlinenum'],_0x3cdbb0['lastevent']));if(_0x3cdbb0[_0x5e20('0x7')]){utils['getVoiceQueueByName'](_0x3cdbb0['queue'])[_0x5e20('0xb')](function(_0x28c142){if(_0x28c142){_0x3cdbb0['type']=_0x28c142[_0x5e20('0xc')];_0x3cdbb0[_0x5e20('0xd')]=_0x3cdbb0[_0x5e20('0xe')]?_0x28c142[_0x5e20('0xf')]:![];_0x3cdbb0['acwtime']=_0x3cdbb0[_0x5e20('0xd')]?_0x28c142[_0x5e20('0x10')]:0x0;}utils[_0x5e20('0x11')](_0x5e20('0x12'),_0x3cdbb0);});}else{utils[_0x5e20('0x11')](_0x5e20('0x12'),_0x3cdbb0);}if(_0x6c1585){delete transfers[_0x3cdbb0['uniqueid']];}else{delete agents[_0x3cdbb0[_0x5e20('0x13')]];}}exports[_0x5e20('0x14')]=function(_0x22540d){try{utils['debug'](util[_0x5e20('0x4')]('[%s][agents][agentcalled]',_0x22540d[_0x5e20('0x6')]),_0x22540d);agents[_0x22540d['destuniqueid']]=_0x22540d;agents[_0x22540d[_0x5e20('0x13')]][_0x5e20('0x15')]=utils[_0x5e20('0x16')]();agents[_0x22540d[_0x5e20('0x13')]][_0x5e20('0x17')]='called';agents[_0x22540d[_0x5e20('0x13')]][_0x5e20('0x18')]=null;agents[_0x22540d[_0x5e20('0x13')]][_0x5e20('0x19')]=null;utils[_0x5e20('0x3')](util[_0x5e20('0x4')](_0x5e20('0x1a'),_0x22540d[_0x5e20('0x6')],agents[_0x22540d['destuniqueid']][_0x5e20('0x8')],_0x22540d[_0x5e20('0x13')]));}catch(_0x4f900b){utils[_0x5e20('0x1b')](util[_0x5e20('0x4')](_0x5e20('0x1c'),_0x22540d[_0x5e20('0x6')]),_0x4f900b);}};exports['agentringnoanswer']=function(_0x2954fc){try{if(!_['isNil'](agents[_0x2954fc['destuniqueid']])){utils['debug'](util['format'](_0x5e20('0x1d'),_0x2954fc['uniqueid']),_0x2954fc);utils[_0x5e20('0x3')](util[_0x5e20('0x4')](_0x5e20('0x1e'),_0x2954fc[_0x5e20('0x6')],agents[_0x2954fc[_0x5e20('0x13')]][_0x5e20('0x8')],_0x2954fc['destuniqueid']));agents[_0x2954fc[_0x5e20('0x13')]]['agentringnoanswer']=!![];agents[_0x2954fc['destuniqueid']][_0x5e20('0x1f')]=utils[_0x5e20('0x16')]();agents[_0x2954fc[_0x5e20('0x13')]][_0x5e20('0x17')]=_0x5e20('0x20');agents[_0x2954fc[_0x5e20('0x13')]][_0x5e20('0x21')]='timeout';agents[_0x2954fc[_0x5e20('0x13')]][_0x5e20('0x22')]=_0x2954fc[_0x5e20('0x23')]?parseInt(_0x2954fc[_0x5e20('0x23')])/0x3e8:0x0;agents[_0x2954fc['destuniqueid']][_0x5e20('0x24')]=0x0;unanswered[_0x5e20('0x25')](_0x2954fc[_0x5e20('0x13')]);}}catch(_0x222e7a){utils[_0x5e20('0x1b')](util[_0x5e20('0x4')]('[%s][agents][agentringnoanswer]',_0x2954fc[_0x5e20('0x6')]),_0x222e7a);}};exports[_0x5e20('0x26')]=function(_0x543c29){try{_[_0x5e20('0x27')](agents,function(_0x21d1d8,_0x335f1e){if(_0x21d1d8[_0x5e20('0x6')]==_0x543c29[_0x5e20('0x6')]&&!_[_0x5e20('0x28')](unanswered,_0x21d1d8['destuniqueid'])){utils[_0x5e20('0x29')](util[_0x5e20('0x4')](_0x5e20('0x2a'),_0x543c29[_0x5e20('0x6')]),_0x543c29);utils[_0x5e20('0x3')](util[_0x5e20('0x4')](_0x5e20('0x2b'),_0x543c29[_0x5e20('0x6')],_0x21d1d8[_0x5e20('0x8')],_0x21d1d8[_0x5e20('0x13')]));_0x21d1d8[_0x5e20('0x2c')]=!![];_0x21d1d8['agentringnoanswerAt']=utils[_0x5e20('0x16')]();_0x21d1d8[_0x5e20('0x17')]=_0x5e20('0x2d');_0x21d1d8['reason']=_0x5e20('0x2d');_0x21d1d8[_0x5e20('0x22')]=_0x543c29[_0x5e20('0x22')];_0x21d1d8[_0x5e20('0x24')]=0x0;writeDB(_0x21d1d8);}});}catch(_0x244209){utils[_0x5e20('0x1b')](util[_0x5e20('0x4')](_0x5e20('0x2a'),_0x543c29[_0x5e20('0x6')]),_0x244209);}};exports[_0x5e20('0x2e')]=function(_0x36e825){try{if(agents[_0x36e825[_0x5e20('0x13')]]){utils[_0x5e20('0x29')](util[_0x5e20('0x4')]('[%s][agents][agentconnect]',_0x36e825[_0x5e20('0x6')]),_0x36e825);utils['info'](util['format'](_0x5e20('0x2f'),_0x36e825[_0x5e20('0x6')],agents[_0x36e825['destuniqueid']][_0x5e20('0x8')],_0x36e825[_0x5e20('0x13')]));agents[_0x36e825['destuniqueid']][_0x5e20('0x30')]=utils[_0x5e20('0x16')]();agents[_0x36e825[_0x5e20('0x13')]][_0x5e20('0x18')]=_0x36e825[_0x5e20('0x18')];agents[_0x36e825[_0x5e20('0x13')]][_0x5e20('0x19')]=_0x36e825[_0x5e20('0x19')];agents[_0x36e825[_0x5e20('0x13')]][_0x5e20('0x22')]=_0x36e825[_0x5e20('0x23')];agents[_0x36e825[_0x5e20('0x13')]][_0x5e20('0x17')]=_0x5e20('0x31');_[_0x5e20('0x27')](agents,function(_0x3d618c,_0x20e83d){if(_0x3d618c[_0x5e20('0x13')]!=_0x36e825['destuniqueid']&&_0x3d618c[_0x5e20('0x6')]==_0x36e825[_0x5e20('0x6')]){_0x3d618c[_0x5e20('0x24')]=0x0;_0x3d618c[_0x5e20('0x22')]=_0x36e825[_0x5e20('0x23')];_0x3d618c['agentringnoanswer']=!![];_0x3d618c[_0x5e20('0x1f')]=utils[_0x5e20('0x16')]();_0x3d618c[_0x5e20('0x17')]=_0x5e20('0x32');_0x3d618c[_0x5e20('0x21')]=_0x5e20('0x32');_0x3d618c['answeredelsewheredestinationuniqueid']=_0x36e825[_0x5e20('0x13')];_0x3d618c[_0x5e20('0x33')]=_0x36e825[_0x5e20('0x8')];writeDB(_0x3d618c);}});}}catch(_0x5a21f0){utils[_0x5e20('0x1b')](util[_0x5e20('0x4')](_0x5e20('0x34'),_0x36e825[_0x5e20('0x6')]),_0x5a21f0);}};exports[_0x5e20('0xe')]=function(_0x336d61){try{if(!_[_0x5e20('0x35')](agents[_0x336d61[_0x5e20('0x13')]])){utils['debug'](util[_0x5e20('0x4')](_0x5e20('0x36'),_0x336d61[_0x5e20('0x6')]),_0x336d61);utils['info'](util[_0x5e20('0x4')]('[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete',_0x336d61[_0x5e20('0x6')],agents[_0x336d61[_0x5e20('0x13')]][_0x5e20('0x8')],_0x336d61[_0x5e20('0x13')]));agents[_0x336d61[_0x5e20('0x13')]]['agentcomplete']=!![];agents[_0x336d61[_0x5e20('0x13')]]['agentcompleteAt']=utils['now']();agents[_0x336d61[_0x5e20('0x13')]][_0x5e20('0x24')]=utils[_0x5e20('0x37')](agents[_0x336d61[_0x5e20('0x13')]][_0x5e20('0x38')],agents[_0x336d61[_0x5e20('0x13')]][_0x5e20('0x30')]);agents[_0x336d61['destuniqueid']]['reason']=_0x336d61[_0x5e20('0x21')];agents[_0x336d61[_0x5e20('0x13')]]['lastevent']=_0x5e20('0x39');writeDB(agents[_0x336d61[_0x5e20('0x13')]]);}}catch(_0xf1e97c){utils[_0x5e20('0x1b')](util[_0x5e20('0x4')]('[%s][agents][agentcomplete]',_0x336d61[_0x5e20('0x6')]),_0xf1e97c);}};exports[_0x5e20('0x3a')]=function(_0x25491e){try{if(!_[_0x5e20('0x35')](agents[_0x25491e[_0x5e20('0x3b')]])){utils[_0x5e20('0x29')](util[_0x5e20('0x4')](_0x5e20('0x3c'),_0x25491e['uniqueid']),_0x25491e);utils['info'](util['format'](_0x5e20('0x3d'),_0x25491e[_0x5e20('0x6')],agents[_0x25491e['transfereruniqueid']][_0x5e20('0x8')],agents[_0x25491e['transfereruniqueid']][_0x5e20('0x6')]));agents[_0x25491e['transfereruniqueid']][_0x5e20('0x3e')]=!![];agents[_0x25491e['transfereruniqueid']][_0x5e20('0x3f')]=_0x5e20('0x40');agents[_0x25491e[_0x5e20('0x3b')]][_0x5e20('0x41')]=_0x25491e[_0x5e20('0x42')];agents[_0x25491e[_0x5e20('0x3b')]][_0x5e20('0x43')]=agents[_0x25491e[_0x5e20('0x3b')]][_0x5e20('0x6')];}}catch(_0x43e890){utils[_0x5e20('0x1b')](util[_0x5e20('0x4')](_0x5e20('0x3c'),_0x25491e[_0x5e20('0x6')]),_0x43e890);}};exports[_0x5e20('0x44')]=function(_0xe7759c){try{utils[_0x5e20('0x29')](util[_0x5e20('0x4')]('[%s][agents][attendedtransfer]',_0xe7759c['origtransfereruniqueid']),_0xe7759c);if(_0xe7759c[_0x5e20('0x45')]==_0xe7759c['origtransfererlinkedid']){if(!_[_0x5e20('0x35')](agents[_0xe7759c[_0x5e20('0x46')]])){utils[_0x5e20('0x3')](util['format'](_0x5e20('0x47'),_0xe7759c[_0x5e20('0x45')],agents[_0xe7759c[_0x5e20('0x46')]]['membername']));agents[_0xe7759c['secondtransfereruniqueid']]['transfer']=!![];agents[_0xe7759c[_0x5e20('0x46')]][_0x5e20('0x3f')]=_0x5e20('0x48');agents[_0xe7759c[_0x5e20('0x46')]][_0x5e20('0x41')]=_0xe7759c[_0x5e20('0x49')];agents[_0xe7759c['secondtransfereruniqueid']][_0x5e20('0x43')]=_0xe7759c['origtransfereruniqueid'];}if(_0xe7759c[_0x5e20('0x4a')]&&agents[_0xe7759c['transfereeuniqueid']]){agents[_0xe7759c[_0x5e20('0x4a')]][_0x5e20('0x4b')]=0x1;transfers[_0xe7759c[_0x5e20('0x4a')]]=_['clone'](agents[_0xe7759c[_0x5e20('0x4a')]]);transfers[_0xe7759c[_0x5e20('0x4a')]][_0x5e20('0xa')]=agents[_0xe7759c[_0x5e20('0x46')]][_0x5e20('0xa')];transfers[_0xe7759c[_0x5e20('0x4a')]][_0x5e20('0x4c')]=agents[_0xe7759c['secondtransfereruniqueid']][_0x5e20('0x4c')];transfers[_0xe7759c[_0x5e20('0x4a')]][_0x5e20('0x15')]=utils[_0x5e20('0x16')]();transfers[_0xe7759c['transfereeuniqueid']][_0x5e20('0x30')]=utils[_0x5e20('0x16')]();transfers[_0xe7759c[_0x5e20('0x4a')]][_0x5e20('0x22')]=0x0;transfers[_0xe7759c['transfereeuniqueid']][_0x5e20('0x4b')]=0x2;}}else if(_0xe7759c[_0x5e20('0x46')]==_0xe7759c[_0x5e20('0x4d')]){if(!_['isNil'](agents[_0xe7759c['origtransfereruniqueid']])){utils['info'](util[_0x5e20('0x4')](_0x5e20('0x47'),_0xe7759c['origtransfereruniqueid'],agents[_0xe7759c[_0x5e20('0x45')]][_0x5e20('0x8')]));agents[_0xe7759c[_0x5e20('0x45')]]['transfer']=!![];agents[_0xe7759c[_0x5e20('0x45')]][_0x5e20('0x3f')]='ATTENDED';agents[_0xe7759c[_0x5e20('0x45')]][_0x5e20('0x41')]=_0xe7759c['secondtransfererexten'];agents[_0xe7759c[_0x5e20('0x45')]][_0x5e20('0x43')]=_0xe7759c[_0x5e20('0x46')];}if(_0xe7759c[_0x5e20('0x4e')]&&agents[_0xe7759c['transfertargetuniqueid']]){agents[_0xe7759c[_0x5e20('0x4e')]]['agententerreason']=0x1;transfers[_0xe7759c['transfertargetuniqueid']]=_[_0x5e20('0x4f')](agents[_0xe7759c[_0x5e20('0x4e')]]);transfers[_0xe7759c[_0x5e20('0x4e')]][_0x5e20('0xa')]=agents[_0xe7759c[_0x5e20('0x45')]][_0x5e20('0xa')];transfers[_0xe7759c['transfertargetuniqueid']]['calleridname']=agents[_0xe7759c[_0x5e20('0x45')]][_0x5e20('0x4c')];transfers[_0xe7759c[_0x5e20('0x4e')]]['agentcalledAt']=utils[_0x5e20('0x16')]();transfers[_0xe7759c[_0x5e20('0x4e')]]['agentconnectAt']=utils[_0x5e20('0x16')]();transfers[_0xe7759c['transfertargetuniqueid']]['holdtime']=0x0;transfers[_0xe7759c[_0x5e20('0x4e')]]['agententerreason']=0x2;}}}catch(_0x3e4500){utils[_0x5e20('0x1b')](util[_0x5e20('0x4')]('[%s][agents][attendedtransfer]',_0xe7759c[_0x5e20('0x45')]),_0x3e4500);}};exports[_0x5e20('0x50')]=function(_0xd10013){try{utils[_0x5e20('0x29')](util[_0x5e20('0x4')]('[%s][agents][hangup]',_0xd10013[_0x5e20('0x6')]),_0xd10013);if(agents[_0xd10013[_0x5e20('0x6')]]&&agents[_0xd10013['uniqueid']][_0x5e20('0x21')]===_0x5e20('0x20')){if(_0xd10013[_0x5e20('0x51')]==='21'){agents[_0xd10013['uniqueid']][_0x5e20('0x21')]=_0x5e20('0x52');agents[_0xd10013[_0x5e20('0x6')]][_0x5e20('0x17')]=_0x5e20('0x52');}utils['info'](util[_0x5e20('0x4')](_0x5e20('0x53'),_0xd10013[_0x5e20('0x6')],agents[_0xd10013[_0x5e20('0x6')]][_0x5e20('0x8')],agents[_0xd10013['uniqueid']][_0x5e20('0x21')],agents[_0xd10013[_0x5e20('0x6')]][_0x5e20('0x17')]));writeDB(agents[_0xd10013[_0x5e20('0x6')]]);var _0x1e7cf8=unanswered[_0x5e20('0x54')](_0xd10013[_0x5e20('0x6')]);if(_0x1e7cf8>-0x1){unanswered[_0x5e20('0x55')](_0x1e7cf8,0x1);}}if(transfers[_0xd10013['uniqueid']]){transfers[_0xd10013[_0x5e20('0x6')]]['agentcomplete']=!![];transfers[_0xd10013['uniqueid']][_0x5e20('0x38')]=utils[_0x5e20('0x16')]();transfers[_0xd10013['uniqueid']][_0x5e20('0x24')]=utils[_0x5e20('0x37')](transfers[_0xd10013['uniqueid']][_0x5e20('0x38')],transfers[_0xd10013['uniqueid']][_0x5e20('0x30')]);transfers[_0xd10013['uniqueid']][_0x5e20('0x21')]=_0x5e20('0x56');transfers[_0xd10013[_0x5e20('0x6')]][_0x5e20('0x17')]=_0x5e20('0x39');utils['info'](util[_0x5e20('0x4')]('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0xd10013[_0x5e20('0x6')],transfers[_0xd10013['uniqueid']][_0x5e20('0x8')],transfers[_0xd10013[_0x5e20('0x6')]][_0x5e20('0x21')],transfers[_0xd10013[_0x5e20('0x6')]]['lastevent']));writeDB(transfers[_0xd10013[_0x5e20('0x6')]],!![]);}if(agents[_0xd10013[_0x5e20('0x6')]]&&agents[_0xd10013['uniqueid']]['agentconnectAt']){agents[_0xd10013[_0x5e20('0x6')]][_0x5e20('0xe')]=!![];agents[_0xd10013[_0x5e20('0x6')]][_0x5e20('0x38')]=utils[_0x5e20('0x16')]();agents[_0xd10013['uniqueid']][_0x5e20('0x24')]=utils['diffTime'](agents[_0xd10013['uniqueid']][_0x5e20('0x38')],agents[_0xd10013['uniqueid']]['agentconnectAt']);agents[_0xd10013[_0x5e20('0x6')]][_0x5e20('0x21')]=agents[_0xd10013['uniqueid']][_0x5e20('0x3e')]?_0x5e20('0x3e'):_0x5e20('0x56');agents[_0xd10013[_0x5e20('0x6')]][_0x5e20('0x17')]='complete';utils[_0x5e20('0x3')](util[_0x5e20('0x4')](_0x5e20('0x53'),_0xd10013[_0x5e20('0x6')],agents[_0xd10013['uniqueid']]['membername'],agents[_0xd10013[_0x5e20('0x6')]][_0x5e20('0x21')],agents[_0xd10013[_0x5e20('0x6')]][_0x5e20('0x17')]));writeDB(agents[_0xd10013[_0x5e20('0x6')]]);}}catch(_0xdc9ff4){utils[_0x5e20('0x1b')](util[_0x5e20('0x4')](_0x5e20('0x57'),_0xd10013[_0x5e20('0x6')]),_0xdc9ff4);}}; \ No newline at end of file diff --git a/server/services/xdr/calls.controller.js b/server/services/xdr/calls.controller.js index 5996d1a..11a365a 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 _0xec5a=['localtwolinkedid','transfereechannel','secondtransfererchannel','destinationchannel','userfield','_attended','transfertargetchannel','origtransfererchannel','musiconholdstart','[%s][calls][musiconholdstart]','musiconholdstartAt','musiconholdstop','[%s][calls][musiconholdstop]','[%s][calls][musiconholdstop]\x20mohtime:%s','mohtime','varset','[%s][calls][varset]','variable','xmd-originatecalleridnum','[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','value','[%s][calls][varset]\x20variable:xmd-phone\x20value:%s','\x22\x20<','xmd-callerid-preview','xmd-callerid','xmd-queue','xmcs-queue','[%s][calls][varset]\x20variable:%s\x20value:%s','lastapplication','Queue','lastdata','queue','xmd-contactid','[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s','xmd-cdrtype','[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s','sipcallid','newexten','[%s][calls][newexten]','[%s][calls][newexten]\x20application:%s\x20appdata:%s','appdata','application','toLowerCase','set','startsWith','split','lastIndexOf','includes','hangup','noop','execif','lodash','NO\x20ANSWER','ANSWERED','FAILED','info','[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','uniqueid','channel','membername','connectedlinenum','lastevent','getUserByInternal','accountcode','then','request','CreateVoiceCallReport','newchannel','debug','format','linkedid','OutgoingSpoolFailed','[%s][calls][newchannel]\x20context:%s\x20exten:%s','exten','calleridnum','context','now','DOCUMENTATION','error','[%s][calls][newchannel]','newstate','[%s][calls][newstate]','isNil','channelstate','[%s][calls][newstate]\x20context:%s\x20channel:%s','systemanswertime','transfer','[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','disposition','toNumber','[%s][calls][hangup]','callerid','[%s][calls][hangup]\x20callerid:%s\x20reason:%s','cause-txt','endtime','starttime','billableseconds','answertime','diffTime','attendedtransfer','[%s][calls][attendedtransfer]','origtransfereruniqueid'];(function(_0x4cd65d,_0x1ecd68){var _0xe72505=function(_0xb97f0d){while(--_0xb97f0d){_0x4cd65d['push'](_0x4cd65d['shift']());}};_0xe72505(++_0x1ecd68);}(_0xec5a,0x165));var _0xaec5=function(_0xb5514c,_0x4fe280){_0xb5514c=_0xb5514c-0x0;var _0x27d7a8=_0xec5a[_0xb5514c];return _0x27d7a8;};'use strict';var _=require(_0xaec5('0x0'));var util=require('util');var utils=require('./utils');var dispositions=[_0xaec5('0x1'),'FAILED','FAILED',_0xaec5('0x1'),_0xaec5('0x1'),'NO\x20ANSWER',_0xaec5('0x2'),'BUSY',_0xaec5('0x3'),_0xaec5('0x3'),_0xaec5('0x3')];var channels={};function writeDB(_0x4ec9cc){utils[_0xaec5('0x4')](util['format'](_0xaec5('0x5'),_0x4ec9cc[_0xaec5('0x6')],_0x4ec9cc[_0xaec5('0x7')],_0x4ec9cc['queue'],_0x4ec9cc[_0xaec5('0x8')],_0x4ec9cc['interface'],_0x4ec9cc['calleridnum'],_0x4ec9cc[_0xaec5('0x9')],_0x4ec9cc[_0xaec5('0xa')]));if(_0x4ec9cc['accountcode']){utils[_0xaec5('0xb')](_0x4ec9cc[_0xaec5('0xc')])[_0xaec5('0xd')](function(_0x38fedc){if(_0x38fedc){_0x4ec9cc['UserId']=_0x38fedc['id'];}utils[_0xaec5('0xe')]('CreateVoiceCallReport',_0x4ec9cc);});}else{utils[_0xaec5('0xe')](_0xaec5('0xf'),_0x4ec9cc);}if(channels[_0x4ec9cc[_0xaec5('0x6')]]){delete channels[_0x4ec9cc[_0xaec5('0x6')]];}}exports[_0xaec5('0x10')]=function(_0x187eef){try{utils[_0xaec5('0x11')](util[_0xaec5('0x12')]('[%s][calls][newchannel]',_0x187eef[_0xaec5('0x6')]),_0x187eef);if(_0x187eef[_0xaec5('0x6')]==_0x187eef[_0xaec5('0x13')]&&_0x187eef[_0xaec5('0x7')]!=_0xaec5('0x14')){utils[_0xaec5('0x4')](util['format'](_0xaec5('0x15'),_0x187eef[_0xaec5('0x6')],_0x187eef['context'],_0x187eef[_0xaec5('0x16')]));channels[_0x187eef[_0xaec5('0x6')]]={'uniqueid':_0x187eef['uniqueid'],'accountcode':_0x187eef[_0xaec5('0xc')],'source':_0x187eef[_0xaec5('0x17')],'destination':_0x187eef[_0xaec5('0x16')],'destinationcontext':_0x187eef[_0xaec5('0x18')],'channel':_0x187eef[_0xaec5('0x7')],'starttime':utils[_0xaec5('0x19')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0xaec5('0x1'),'amaflags':_0xaec5('0x1a')};}}catch(_0x11debe){utils[_0xaec5('0x1b')](util[_0xaec5('0x12')](_0xaec5('0x1c'),_0x187eef[_0xaec5('0x6')]),_0x11debe);}};exports[_0xaec5('0x1d')]=function(_0x4fe3f5){try{utils[_0xaec5('0x11')](util[_0xaec5('0x12')](_0xaec5('0x1e'),_0x4fe3f5[_0xaec5('0x6')]),_0x4fe3f5);if(!_[_0xaec5('0x1f')](channels[_0x4fe3f5['uniqueid']])&&_0x4fe3f5[_0xaec5('0x20')]==0x6){utils[_0xaec5('0x4')](util['format'](_0xaec5('0x21'),_0x4fe3f5[_0xaec5('0x6')],_0x4fe3f5[_0xaec5('0x18')],_0x4fe3f5[_0xaec5('0x7')]));if(_['isNil'](channels[_0x4fe3f5[_0xaec5('0x6')]][_0xaec5('0x22')])){channels[_0x4fe3f5['uniqueid']][_0xaec5('0x22')]=utils['now']();}}else if(!_[_0xaec5('0x1f')](channels[_0x4fe3f5[_0xaec5('0x13')]])&&_0x4fe3f5[_0xaec5('0x20')]==0x6&&_0x4fe3f5['context']!=_0xaec5('0x23')){utils[_0xaec5('0x4')](util['format'](_0xaec5('0x24'),_0x4fe3f5[_0xaec5('0x6')],_0x4fe3f5[_0xaec5('0x13')],_0x4fe3f5[_0xaec5('0x18')],_0x4fe3f5[_0xaec5('0x7')]));channels[_0x4fe3f5[_0xaec5('0x13')]][_0xaec5('0xc')]=_0x4fe3f5[_0xaec5('0xc')];channels[_0x4fe3f5['linkedid']]['destinationchannel']=_0x4fe3f5[_0xaec5('0x7')];if(_['isNil'](channels[_0x4fe3f5[_0xaec5('0x13')]]['answertime'])){channels[_0x4fe3f5[_0xaec5('0x13')]]['answertime']=utils[_0xaec5('0x19')]();}channels[_0x4fe3f5[_0xaec5('0x13')]][_0xaec5('0x25')]=dispositions[_[_0xaec5('0x26')](_0x4fe3f5[_0xaec5('0x20')])]||_0xaec5('0x2');}}catch(_0x37ea78){utils[_0xaec5('0x1b')](util[_0xaec5('0x12')](_0xaec5('0x1e'),_0x4fe3f5['uniqueid']),_0x37ea78);}};exports['hangup']=function(_0x3f7542){try{if(!_[_0xaec5('0x1f')](channels[_0x3f7542[_0xaec5('0x6')]])){utils[_0xaec5('0x11')](util[_0xaec5('0x12')](_0xaec5('0x27'),_0x3f7542['uniqueid']),_0x3f7542);if(_['isNil'](channels[_0x3f7542[_0xaec5('0x6')]][_0xaec5('0x28')])){channels[_0x3f7542[_0xaec5('0x6')]][_0xaec5('0x28')]=_0x3f7542['calleridname']+'\x20<'+_0x3f7542[_0xaec5('0x17')]+'>';}utils['info'](util['format'](_0xaec5('0x29'),_0x3f7542[_0xaec5('0x6')],channels[_0x3f7542[_0xaec5('0x6')]]['callerid'],_0x3f7542[_0xaec5('0x2a')]));channels[_0x3f7542[_0xaec5('0x6')]][_0xaec5('0x2b')]=utils[_0xaec5('0x19')]();channels[_0x3f7542[_0xaec5('0x6')]]['duration']=utils['diffTime'](channels[_0x3f7542[_0xaec5('0x6')]][_0xaec5('0x2b')],channels[_0x3f7542[_0xaec5('0x6')]][_0xaec5('0x2c')]);channels[_0x3f7542[_0xaec5('0x6')]][_0xaec5('0x2d')]=channels[_0x3f7542[_0xaec5('0x6')]][_0xaec5('0x2e')]?utils[_0xaec5('0x2f')](channels[_0x3f7542[_0xaec5('0x6')]][_0xaec5('0x2b')],channels[_0x3f7542[_0xaec5('0x6')]][_0xaec5('0x2e')]):0x0;writeDB(channels[_0x3f7542['uniqueid']]);}}catch(_0x257536){utils['error'](util[_0xaec5('0x12')]('[%s][calls][hangup]',_0x3f7542[_0xaec5('0x6')]),_0x257536);}};exports[_0xaec5('0x30')]=function(_0x3f234b){try{if(!_[_0xaec5('0x1f')](channels[_0x3f234b['localtwolinkedid']])){utils[_0xaec5('0x11')](util[_0xaec5('0x12')](_0xaec5('0x31'),_0x3f234b[_0xaec5('0x32')]),_0x3f234b);if(channels[_0x3f234b[_0xaec5('0x33')]][_0xaec5('0x7')]==_0x3f234b[_0xaec5('0x34')]){utils[_0xaec5('0x4')](util['format']('[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s',_0x3f234b[_0xaec5('0x32')],_0x3f234b[_0xaec5('0x33')],_0x3f234b[_0xaec5('0x35')]));channels[_0x3f234b[_0xaec5('0x33')]][_0xaec5('0x36')]=_0x3f234b['secondtransfererchannel'];channels[_0x3f234b[_0xaec5('0x33')]][_0xaec5('0x37')]=_0xaec5('0x38');}else if(channels[_0x3f234b[_0xaec5('0x33')]]['channel']=_0x3f234b[_0xaec5('0x39')]){utils['info'](util[_0xaec5('0x12')]('[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s',_0x3f234b[_0xaec5('0x32')],_0x3f234b[_0xaec5('0x33')],_0x3f234b[_0xaec5('0x3a')]));channels[_0x3f234b[_0xaec5('0x33')]]['destinationchannel']=_0x3f234b[_0xaec5('0x3a')];channels[_0x3f234b['localtwolinkedid']][_0xaec5('0x37')]='_attended';}}}catch(_0x18c8c1){utils['error'](util[_0xaec5('0x12')](_0xaec5('0x31'),_0x3f234b['origtransfereruniqueid']),_0x18c8c1);}};exports[_0xaec5('0x3b')]=function(_0x253e1a){try{if(!_['isNil'](channels[_0x253e1a['uniqueid']])){utils[_0xaec5('0x11')](util[_0xaec5('0x12')](_0xaec5('0x3c'),_0x253e1a[_0xaec5('0x6')]),_0x253e1a);channels[_0x253e1a[_0xaec5('0x6')]][_0xaec5('0x3d')]=utils[_0xaec5('0x19')]();utils[_0xaec5('0x4')](util[_0xaec5('0x12')]('[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s',_0x253e1a['uniqueid'],channels[_0x253e1a[_0xaec5('0x6')]][_0xaec5('0x3d')]));}}catch(_0x367bda){utils['error'](util[_0xaec5('0x12')](_0xaec5('0x3c'),_0x253e1a['uniqueid']),_0x367bda);}};exports[_0xaec5('0x3e')]=function(_0x3f29bd){try{if(!_[_0xaec5('0x1f')](channels[_0x3f29bd['uniqueid']])){utils[_0xaec5('0x11')](util[_0xaec5('0x12')](_0xaec5('0x3f'),_0x3f29bd[_0xaec5('0x6')]),_0x3f29bd);if(!_[_0xaec5('0x1f')](channels[_0x3f29bd['uniqueid']][_0xaec5('0x3d')])){channels[_0x3f29bd[_0xaec5('0x6')]]['mohtime']+=utils[_0xaec5('0x2f')](utils['now'](),channels[_0x3f29bd['uniqueid']]['musiconholdstartAt']);utils[_0xaec5('0x4')](util['format'](_0xaec5('0x40'),_0x3f29bd['uniqueid'],channels[_0x3f29bd[_0xaec5('0x6')]][_0xaec5('0x41')]));delete channels[_0x3f29bd[_0xaec5('0x6')]]['musiconholdstartAt'];}}}catch(_0x56d9b4){utils[_0xaec5('0x1b')](util[_0xaec5('0x12')]('[%s][calls][musiconholdstop]',_0x3f29bd[_0xaec5('0x6')]),_0x56d9b4);}};exports[_0xaec5('0x42')]=function(_0x16664d){try{if(!_['isNil'](channels[_0x16664d['uniqueid']])){utils[_0xaec5('0x11')](util[_0xaec5('0x12')](_0xaec5('0x43'),_0x16664d['uniqueid']),_0x16664d);if(!_[_0xaec5('0x1f')](_0x16664d[_0xaec5('0x44')][_0xaec5('0x45')])){utils[_0xaec5('0x4')](util[_0xaec5('0x12')](_0xaec5('0x46'),_0x16664d[_0xaec5('0x6')],_0x16664d['value']));channels[_0x16664d[_0xaec5('0x6')]]['source']=_0x16664d[_0xaec5('0x47')];}if(!_[_0xaec5('0x1f')](_0x16664d[_0xaec5('0x44')]['xmd-phone'])){utils[_0xaec5('0x4')](util['format'](_0xaec5('0x48'),_0x16664d[_0xaec5('0x6')],_0x16664d[_0xaec5('0x47')]));channels[_0x16664d['uniqueid']]['destination']=_0x16664d['value'];channels[_0x16664d[_0xaec5('0x6')]][_0xaec5('0x28')]='\x22'+_0x16664d[_0xaec5('0x47')]+_0xaec5('0x49')+_0x16664d[_0xaec5('0x47')]+'>';}if(!_[_0xaec5('0x1f')](_0x16664d['variable'][_0xaec5('0x4a')])||!_[_0xaec5('0x1f')](_0x16664d[_0xaec5('0x44')][_0xaec5('0x4b')])){utils[_0xaec5('0x4')](util[_0xaec5('0x12')]('[%s][calls][varset]\x20variable:%s\x20value:%s',_0x16664d['uniqueid'],!_['isNil'](_0x16664d[_0xaec5('0x44')][_0xaec5('0x4a')])?_0xaec5('0x4a'):'xmd-callerid',_0x16664d[_0xaec5('0x47')]));channels[_0x16664d[_0xaec5('0x6')]][_0xaec5('0x28')]=_0x16664d[_0xaec5('0x47')];}if(!_['isNil'](_0x16664d[_0xaec5('0x44')][_0xaec5('0x4c')])||!_['isNil'](_0x16664d[_0xaec5('0x44')][_0xaec5('0x4d')])){utils[_0xaec5('0x4')](util[_0xaec5('0x12')](_0xaec5('0x4e'),_0x16664d[_0xaec5('0x6')],!_[_0xaec5('0x1f')](_0x16664d[_0xaec5('0x44')][_0xaec5('0x4c')])?'xmd-queue':'xmcs-queue',_0x16664d[_0xaec5('0x47')]));channels[_0x16664d[_0xaec5('0x6')]][_0xaec5('0x4f')]=_0xaec5('0x50');channels[_0x16664d['uniqueid']][_0xaec5('0x51')]=_0x16664d[_0xaec5('0x47')];channels[_0x16664d[_0xaec5('0x6')]][_0xaec5('0x52')]=!![];}if(!_[_0xaec5('0x1f')](_0x16664d['variable'][_0xaec5('0x53')])){utils[_0xaec5('0x4')](util[_0xaec5('0x12')](_0xaec5('0x54'),_0x16664d['uniqueid'],_0x16664d[_0xaec5('0x47')]));channels[_0x16664d['uniqueid']]['ContactId']=_0x16664d[_0xaec5('0x47')];}if(!_[_0xaec5('0x1f')](_0x16664d[_0xaec5('0x44')][_0xaec5('0x55')])){utils['info'](util[_0xaec5('0x12')]('[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s',_0x16664d['uniqueid'],_0x16664d[_0xaec5('0x47')]));channels[_0x16664d[_0xaec5('0x6')]]['type']=_0x16664d[_0xaec5('0x47')];}if(!_[_0xaec5('0x1f')](_0x16664d[_0xaec5('0x44')]['outboundrouteid'])){utils[_0xaec5('0x4')](util[_0xaec5('0x12')](_0xaec5('0x56'),_0x16664d[_0xaec5('0x6')],_0x16664d[_0xaec5('0x47')]));channels[_0x16664d[_0xaec5('0x6')]]['routeid']=_0x16664d[_0xaec5('0x47')];}if(!_['isNil'](_0x16664d[_0xaec5('0x44')][_0xaec5('0x57')])){utils[_0xaec5('0x4')](util['format']('[%s][calls][varset]\x20variable:sipcallid\x20value:%s',_0x16664d['uniqueid'],_0x16664d[_0xaec5('0x47')]));channels[_0x16664d[_0xaec5('0x6')]][_0xaec5('0x57')]=_0x16664d[_0xaec5('0x47')];}}}catch(_0x2d25e6){utils[_0xaec5('0x1b')](util['format'](_0xaec5('0x43'),_0x16664d[_0xaec5('0x6')]),_0x2d25e6);}};exports[_0xaec5('0x58')]=function(_0x4c79e7){try{if(!_['isNil'](channels[_0x4c79e7[_0xaec5('0x6')]])){utils[_0xaec5('0x11')](util['format'](_0xaec5('0x59'),_0x4c79e7[_0xaec5('0x6')]),_0x4c79e7);utils[_0xaec5('0x4')](util[_0xaec5('0x12')](_0xaec5('0x5a'),_0x4c79e7[_0xaec5('0x6')],_0x4c79e7['application'],_0x4c79e7[_0xaec5('0x5b')]));if(_0x4c79e7[_0xaec5('0x5c')][_0xaec5('0x5d')]()==_0xaec5('0x5e')&&_[_0xaec5('0x5f')](_0x4c79e7[_0xaec5('0x5b')][_0xaec5('0x5d')](),'cdr')){var _0x139185=_0x4c79e7[_0xaec5('0x5b')][_0xaec5('0x60')]('=');var _0x4394d1=_0x139185[0x0]['substring'](_0x139185[0x0][_0xaec5('0x61')]('(')+0x1,_0x139185[0x0][_0xaec5('0x61')](')'));var _0x2a38db=_0x139185[0x1];channels[_0x4c79e7[_0xaec5('0x6')]][_0x4394d1]=_0x2a38db;}if(!_[_0xaec5('0x62')]([_0xaec5('0x63'),_0xaec5('0x64'),_0xaec5('0x65'),_0xaec5('0x5e'),'gotoif'],_0x4c79e7['application']['toLowerCase']())){channels[_0x4c79e7[_0xaec5('0x6')]][_0xaec5('0x4f')]=_0x4c79e7[_0xaec5('0x5c')];channels[_0x4c79e7[_0xaec5('0x6')]][_0xaec5('0x51')]=_0x4c79e7[_0xaec5('0x5b')];}}}catch(_0xb95ea3){utils[_0xaec5('0x1b')](util[_0xaec5('0x12')](_0xaec5('0x59'),_0x4c79e7[_0xaec5('0x6')]),_0xb95ea3);}}; \ No newline at end of file +var _0xd392=['[%s][calls][newstate]','callerid','calleridname','[%s][calls][hangup]\x20callerid:%s\x20reason:%s','cause-txt','starttime','billableseconds','diffTime','endtime','attendedtransfer','localtwolinkedid','[%s][calls][attendedtransfer]','transfereechannel','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','origtransfereruniqueid','secondtransfererchannel','destinationchannel','_attended','transfertargetchannel','origtransfererchannel','[%s][calls][musiconholdstart]','musiconholdstartAt','[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s','musiconholdstop','[%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','xmd-callerid-preview','xmd-callerid','[%s][calls][varset]\x20variable:%s\x20value:%s','xmd-queue','xmcs-queue','lastapplication','Queue','lastdata','[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s','xmd-cdrtype','[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s','[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s','routeid','sipcallid','[%s][calls][varset]\x20variable:sipcallid\x20value:%s','newexten','[%s][calls][newexten]','[%s][calls][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','set','startsWith','cdr','split','substring','lastIndexOf','hangup','noop','execif','gotoif','lodash','util','./utils','NO\x20ANSWER','FAILED','ANSWERED','BUSY','info','uniqueid','channel','queue','membername','interface','connectedlinenum','lastevent','getUserByInternal','then','request','CreateVoiceCallReport','newchannel','debug','linkedid','OutgoingSpoolFailed','format','exten','accountcode','calleridnum','context','DOCUMENTATION','newstate','isNil','channelstate','[%s][calls][newstate]\x20context:%s\x20channel:%s','systemanswertime','transfer','answertime','now','disposition','error'];(function(_0x4fde08,_0x463a36){var _0x12e725=function(_0x2670c5){while(--_0x2670c5){_0x4fde08['push'](_0x4fde08['shift']());}};_0x12e725(++_0x463a36);}(_0xd392,0xaf));var _0x2d39=function(_0x15c60f,_0x2ab075){_0x15c60f=_0x15c60f-0x0;var _0x14b751=_0xd392[_0x15c60f];return _0x14b751;};'use strict';var _=require(_0x2d39('0x0'));var util=require(_0x2d39('0x1'));var utils=require(_0x2d39('0x2'));var dispositions=[_0x2d39('0x3'),_0x2d39('0x4'),_0x2d39('0x4'),_0x2d39('0x3'),_0x2d39('0x3'),_0x2d39('0x3'),_0x2d39('0x5'),_0x2d39('0x6'),_0x2d39('0x4'),_0x2d39('0x4'),_0x2d39('0x4')];var channels={};function writeDB(_0x541f51){utils[_0x2d39('0x7')](util['format']('[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s',_0x541f51[_0x2d39('0x8')],_0x541f51[_0x2d39('0x9')],_0x541f51[_0x2d39('0xa')],_0x541f51[_0x2d39('0xb')],_0x541f51[_0x2d39('0xc')],_0x541f51['calleridnum'],_0x541f51[_0x2d39('0xd')],_0x541f51[_0x2d39('0xe')]));if(_0x541f51['accountcode']){utils[_0x2d39('0xf')](_0x541f51['accountcode'])[_0x2d39('0x10')](function(_0x3d5004){if(_0x3d5004){_0x541f51['UserId']=_0x3d5004['id'];}utils[_0x2d39('0x11')](_0x2d39('0x12'),_0x541f51);});}else{utils['request'](_0x2d39('0x12'),_0x541f51);}if(channels[_0x541f51[_0x2d39('0x8')]]){delete channels[_0x541f51[_0x2d39('0x8')]];}}exports[_0x2d39('0x13')]=function(_0x456382){try{utils[_0x2d39('0x14')](util['format']('[%s][calls][newchannel]',_0x456382[_0x2d39('0x8')]),_0x456382);if(_0x456382[_0x2d39('0x8')]==_0x456382[_0x2d39('0x15')]&&_0x456382[_0x2d39('0x9')]!=_0x2d39('0x16')){utils[_0x2d39('0x7')](util[_0x2d39('0x17')]('[%s][calls][newchannel]\x20context:%s\x20exten:%s',_0x456382[_0x2d39('0x8')],_0x456382['context'],_0x456382[_0x2d39('0x18')]));channels[_0x456382[_0x2d39('0x8')]]={'uniqueid':_0x456382[_0x2d39('0x8')],'accountcode':_0x456382[_0x2d39('0x19')],'source':_0x456382[_0x2d39('0x1a')],'destination':_0x456382[_0x2d39('0x18')],'destinationcontext':_0x456382[_0x2d39('0x1b')],'channel':_0x456382[_0x2d39('0x9')],'starttime':utils['now'](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0x2d39('0x3'),'amaflags':_0x2d39('0x1c')};}}catch(_0x27a393){utils['error'](util[_0x2d39('0x17')]('[%s][calls][newchannel]',_0x456382['uniqueid']),_0x27a393);}};exports[_0x2d39('0x1d')]=function(_0x5ae740){try{utils[_0x2d39('0x14')](util[_0x2d39('0x17')]('[%s][calls][newstate]',_0x5ae740[_0x2d39('0x8')]),_0x5ae740);if(!_[_0x2d39('0x1e')](channels[_0x5ae740[_0x2d39('0x8')]])&&_0x5ae740[_0x2d39('0x1f')]==0x6){utils[_0x2d39('0x7')](util[_0x2d39('0x17')](_0x2d39('0x20'),_0x5ae740[_0x2d39('0x8')],_0x5ae740['context'],_0x5ae740[_0x2d39('0x9')]));if(_[_0x2d39('0x1e')](channels[_0x5ae740[_0x2d39('0x8')]][_0x2d39('0x21')])){channels[_0x5ae740[_0x2d39('0x8')]][_0x2d39('0x21')]=utils['now']();}}else if(!_[_0x2d39('0x1e')](channels[_0x5ae740['linkedid']])&&_0x5ae740[_0x2d39('0x1f')]==0x6&&_0x5ae740[_0x2d39('0x1b')]!=_0x2d39('0x22')){utils[_0x2d39('0x7')](util[_0x2d39('0x17')]('[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s',_0x5ae740[_0x2d39('0x8')],_0x5ae740[_0x2d39('0x15')],_0x5ae740[_0x2d39('0x1b')],_0x5ae740[_0x2d39('0x9')]));channels[_0x5ae740[_0x2d39('0x15')]][_0x2d39('0x19')]=_0x5ae740[_0x2d39('0x19')];channels[_0x5ae740[_0x2d39('0x15')]]['destinationchannel']=_0x5ae740['channel'];if(_['isNil'](channels[_0x5ae740[_0x2d39('0x15')]][_0x2d39('0x23')])){channels[_0x5ae740[_0x2d39('0x15')]][_0x2d39('0x23')]=utils[_0x2d39('0x24')]();}channels[_0x5ae740[_0x2d39('0x15')]][_0x2d39('0x25')]=dispositions[_['toNumber'](_0x5ae740[_0x2d39('0x1f')])]||_0x2d39('0x5');}}catch(_0x100e14){utils[_0x2d39('0x26')](util['format'](_0x2d39('0x27'),_0x5ae740['uniqueid']),_0x100e14);}};exports['hangup']=function(_0x515c52){try{if(!_['isNil'](channels[_0x515c52[_0x2d39('0x8')]])){utils[_0x2d39('0x14')](util['format']('[%s][calls][hangup]',_0x515c52[_0x2d39('0x8')]),_0x515c52);if(_[_0x2d39('0x1e')](channels[_0x515c52[_0x2d39('0x8')]][_0x2d39('0x28')])){channels[_0x515c52[_0x2d39('0x8')]][_0x2d39('0x28')]=_0x515c52[_0x2d39('0x29')]+'\x20<'+_0x515c52['calleridnum']+'>';}utils[_0x2d39('0x7')](util[_0x2d39('0x17')](_0x2d39('0x2a'),_0x515c52[_0x2d39('0x8')],channels[_0x515c52[_0x2d39('0x8')]]['callerid'],_0x515c52[_0x2d39('0x2b')]));channels[_0x515c52[_0x2d39('0x8')]]['endtime']=utils['now']();channels[_0x515c52['uniqueid']]['duration']=utils['diffTime'](channels[_0x515c52[_0x2d39('0x8')]]['endtime'],channels[_0x515c52[_0x2d39('0x8')]][_0x2d39('0x2c')]);channels[_0x515c52[_0x2d39('0x8')]][_0x2d39('0x2d')]=channels[_0x515c52[_0x2d39('0x8')]]['answertime']?utils[_0x2d39('0x2e')](channels[_0x515c52[_0x2d39('0x8')]][_0x2d39('0x2f')],channels[_0x515c52[_0x2d39('0x8')]][_0x2d39('0x23')]):0x0;writeDB(channels[_0x515c52[_0x2d39('0x8')]]);}}catch(_0x231242){utils[_0x2d39('0x26')](util[_0x2d39('0x17')]('[%s][calls][hangup]',_0x515c52[_0x2d39('0x8')]),_0x231242);}};exports[_0x2d39('0x30')]=function(_0x1839cc){try{if(!_[_0x2d39('0x1e')](channels[_0x1839cc[_0x2d39('0x31')]])){utils[_0x2d39('0x14')](util[_0x2d39('0x17')](_0x2d39('0x32'),_0x1839cc['origtransfereruniqueid']),_0x1839cc);if(channels[_0x1839cc[_0x2d39('0x31')]][_0x2d39('0x9')]==_0x1839cc[_0x2d39('0x33')]){utils['info'](util[_0x2d39('0x17')](_0x2d39('0x34'),_0x1839cc[_0x2d39('0x35')],_0x1839cc[_0x2d39('0x31')],_0x1839cc[_0x2d39('0x36')]));channels[_0x1839cc[_0x2d39('0x31')]][_0x2d39('0x37')]=_0x1839cc[_0x2d39('0x36')];channels[_0x1839cc['localtwolinkedid']]['userfield']=_0x2d39('0x38');}else if(channels[_0x1839cc[_0x2d39('0x31')]][_0x2d39('0x9')]=_0x1839cc[_0x2d39('0x39')]){utils[_0x2d39('0x7')](util['format'](_0x2d39('0x34'),_0x1839cc[_0x2d39('0x35')],_0x1839cc[_0x2d39('0x31')],_0x1839cc[_0x2d39('0x3a')]));channels[_0x1839cc[_0x2d39('0x31')]][_0x2d39('0x37')]=_0x1839cc['origtransfererchannel'];channels[_0x1839cc[_0x2d39('0x31')]]['userfield']=_0x2d39('0x38');}}}catch(_0x22d3c6){utils[_0x2d39('0x26')](util[_0x2d39('0x17')]('[%s][calls][attendedtransfer]',_0x1839cc[_0x2d39('0x35')]),_0x22d3c6);}};exports['musiconholdstart']=function(_0x93a7b){try{if(!_['isNil'](channels[_0x93a7b[_0x2d39('0x8')]])){utils[_0x2d39('0x14')](util[_0x2d39('0x17')](_0x2d39('0x3b'),_0x93a7b[_0x2d39('0x8')]),_0x93a7b);channels[_0x93a7b[_0x2d39('0x8')]][_0x2d39('0x3c')]=utils[_0x2d39('0x24')]();utils[_0x2d39('0x7')](util[_0x2d39('0x17')](_0x2d39('0x3d'),_0x93a7b[_0x2d39('0x8')],channels[_0x93a7b[_0x2d39('0x8')]][_0x2d39('0x3c')]));}}catch(_0x5b87bc){utils['error'](util[_0x2d39('0x17')](_0x2d39('0x3b'),_0x93a7b[_0x2d39('0x8')]),_0x5b87bc);}};exports[_0x2d39('0x3e')]=function(_0x4e7928){try{if(!_[_0x2d39('0x1e')](channels[_0x4e7928[_0x2d39('0x8')]])){utils[_0x2d39('0x14')](util[_0x2d39('0x17')](_0x2d39('0x3f'),_0x4e7928['uniqueid']),_0x4e7928);if(!_[_0x2d39('0x1e')](channels[_0x4e7928[_0x2d39('0x8')]][_0x2d39('0x3c')])){channels[_0x4e7928[_0x2d39('0x8')]][_0x2d39('0x40')]+=utils[_0x2d39('0x2e')](utils[_0x2d39('0x24')](),channels[_0x4e7928[_0x2d39('0x8')]][_0x2d39('0x3c')]);utils[_0x2d39('0x7')](util[_0x2d39('0x17')](_0x2d39('0x41'),_0x4e7928[_0x2d39('0x8')],channels[_0x4e7928['uniqueid']]['mohtime']));delete channels[_0x4e7928['uniqueid']][_0x2d39('0x3c')];}}}catch(_0x2f1d57){utils['error'](util[_0x2d39('0x17')](_0x2d39('0x3f'),_0x4e7928[_0x2d39('0x8')]),_0x2f1d57);}};exports[_0x2d39('0x42')]=function(_0xefe839){try{if(!_['isNil'](channels[_0xefe839[_0x2d39('0x8')]])){utils['debug'](util[_0x2d39('0x17')](_0x2d39('0x43'),_0xefe839[_0x2d39('0x8')]),_0xefe839);if(!_[_0x2d39('0x1e')](_0xefe839[_0x2d39('0x44')][_0x2d39('0x45')])){utils[_0x2d39('0x7')](util[_0x2d39('0x17')](_0x2d39('0x46'),_0xefe839[_0x2d39('0x8')],_0xefe839[_0x2d39('0x47')]));channels[_0xefe839[_0x2d39('0x8')]][_0x2d39('0x48')]=_0xefe839[_0x2d39('0x47')];}if(!_[_0x2d39('0x1e')](_0xefe839[_0x2d39('0x44')][_0x2d39('0x49')])){utils['info'](util[_0x2d39('0x17')](_0x2d39('0x4a'),_0xefe839[_0x2d39('0x8')],_0xefe839[_0x2d39('0x47')]));channels[_0xefe839[_0x2d39('0x8')]][_0x2d39('0x4b')]=_0xefe839[_0x2d39('0x47')];channels[_0xefe839['uniqueid']][_0x2d39('0x28')]='\x22'+_0xefe839['value']+'\x22\x20<'+_0xefe839[_0x2d39('0x47')]+'>';}if(!_['isNil'](_0xefe839[_0x2d39('0x44')][_0x2d39('0x4c')])||!_['isNil'](_0xefe839['variable'][_0x2d39('0x4d')])){utils['info'](util[_0x2d39('0x17')](_0x2d39('0x4e'),_0xefe839[_0x2d39('0x8')],!_[_0x2d39('0x1e')](_0xefe839[_0x2d39('0x44')]['xmd-callerid-preview'])?_0x2d39('0x4c'):_0x2d39('0x4d'),_0xefe839['value']));channels[_0xefe839['uniqueid']]['callerid']=_0xefe839[_0x2d39('0x47')];}if(!_[_0x2d39('0x1e')](_0xefe839[_0x2d39('0x44')][_0x2d39('0x4f')])||!_[_0x2d39('0x1e')](_0xefe839['variable'][_0x2d39('0x50')])){utils[_0x2d39('0x7')](util['format'](_0x2d39('0x4e'),_0xefe839[_0x2d39('0x8')],!_['isNil'](_0xefe839[_0x2d39('0x44')][_0x2d39('0x4f')])?_0x2d39('0x4f'):'xmcs-queue',_0xefe839[_0x2d39('0x47')]));channels[_0xefe839[_0x2d39('0x8')]][_0x2d39('0x51')]=_0x2d39('0x52');channels[_0xefe839[_0x2d39('0x8')]][_0x2d39('0x53')]=_0xefe839[_0x2d39('0x47')];channels[_0xefe839[_0x2d39('0x8')]][_0x2d39('0xa')]=!![];}if(!_[_0x2d39('0x1e')](_0xefe839['variable']['xmd-contactid'])){utils[_0x2d39('0x7')](util[_0x2d39('0x17')](_0x2d39('0x54'),_0xefe839['uniqueid'],_0xefe839['value']));channels[_0xefe839[_0x2d39('0x8')]]['ContactId']=_0xefe839[_0x2d39('0x47')];}if(!_[_0x2d39('0x1e')](_0xefe839[_0x2d39('0x44')][_0x2d39('0x55')])){utils[_0x2d39('0x7')](util[_0x2d39('0x17')](_0x2d39('0x56'),_0xefe839[_0x2d39('0x8')],_0xefe839['value']));channels[_0xefe839[_0x2d39('0x8')]]['type']=_0xefe839['value'];}if(!_[_0x2d39('0x1e')](_0xefe839[_0x2d39('0x44')]['outboundrouteid'])){utils[_0x2d39('0x7')](util[_0x2d39('0x17')](_0x2d39('0x57'),_0xefe839['uniqueid'],_0xefe839[_0x2d39('0x47')]));channels[_0xefe839['uniqueid']][_0x2d39('0x58')]=_0xefe839[_0x2d39('0x47')];}if(!_[_0x2d39('0x1e')](_0xefe839['variable'][_0x2d39('0x59')])){utils['info'](util['format'](_0x2d39('0x5a'),_0xefe839[_0x2d39('0x8')],_0xefe839[_0x2d39('0x47')]));channels[_0xefe839['uniqueid']][_0x2d39('0x59')]=_0xefe839[_0x2d39('0x47')];}}}catch(_0xa30736){utils[_0x2d39('0x26')](util['format'](_0x2d39('0x43'),_0xefe839[_0x2d39('0x8')]),_0xa30736);}};exports[_0x2d39('0x5b')]=function(_0x3e621d){try{if(!_[_0x2d39('0x1e')](channels[_0x3e621d[_0x2d39('0x8')]])){utils[_0x2d39('0x14')](util[_0x2d39('0x17')](_0x2d39('0x5c'),_0x3e621d[_0x2d39('0x8')]),_0x3e621d);utils['info'](util['format'](_0x2d39('0x5d'),_0x3e621d['uniqueid'],_0x3e621d[_0x2d39('0x5e')],_0x3e621d[_0x2d39('0x5f')]));if(_0x3e621d[_0x2d39('0x5e')][_0x2d39('0x60')]()==_0x2d39('0x61')&&_[_0x2d39('0x62')](_0x3e621d[_0x2d39('0x5f')][_0x2d39('0x60')](),_0x2d39('0x63'))){var _0xc4d27c=_0x3e621d[_0x2d39('0x5f')][_0x2d39('0x64')]('=');var _0x2ec064=_0xc4d27c[0x0][_0x2d39('0x65')](_0xc4d27c[0x0]['lastIndexOf']('(')+0x1,_0xc4d27c[0x0][_0x2d39('0x66')](')'));var _0x552717=_0xc4d27c[0x1];channels[_0x3e621d[_0x2d39('0x8')]][_0x2ec064]=_0x552717;}if(!_['includes']([_0x2d39('0x67'),_0x2d39('0x68'),_0x2d39('0x69'),'set',_0x2d39('0x6a')],_0x3e621d[_0x2d39('0x5e')][_0x2d39('0x60')]())){channels[_0x3e621d[_0x2d39('0x8')]]['lastapplication']=_0x3e621d[_0x2d39('0x5e')];channels[_0x3e621d[_0x2d39('0x8')]]['lastdata']=_0x3e621d['appdata'];}}}catch(_0x52f227){utils[_0x2d39('0x26')](util[_0x2d39('0x17')](_0x2d39('0x5c'),_0x3e621d[_0x2d39('0x8')]),_0x52f227);}}; \ No newline at end of file diff --git a/server/services/xdr/core.controller.js b/server/services/xdr/core.controller.js index c87e608..dbc01e5 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 _0x317e=['managerevent','./utils','connect','info','[core]\x20connected','[core]\x20shutdown','fullybooted','error','[core]\x20error','close','[core]\x20close'];(function(_0x59a473,_0x3c325c){var _0x32154e=function(_0x134250){while(--_0x134250){_0x59a473['push'](_0x59a473['shift']());}};_0x32154e(++_0x3c325c);}(_0x317e,0xf3));var _0xe317=function(_0x138f59,_0x1b53fb){_0x138f59=_0x138f59-0x0;var _0x3d114d=_0x317e[_0x138f59];return _0x3d114d;};'use strict';var utils=require(_0xe317('0x0'));exports[_0xe317('0x1')]=function(){utils[_0xe317('0x2')](_0xe317('0x3'));};exports['shutdown']=function(){utils[_0xe317('0x2')](_0xe317('0x4'));};exports[_0xe317('0x5')]=function(){utils[_0xe317('0x2')]('[core]\x20fullybooted');};exports['error']=function(_0x5a6dc2){utils[_0xe317('0x6')](_0xe317('0x7'),_0x5a6dc2);};exports[_0xe317('0x8')]=function(){utils[_0xe317('0x2')](_0xe317('0x9'));};exports[_0xe317('0xa')]=function(_0x2553e6){}; \ No newline at end of file +var _0xc9ce=['[core]\x20connected','shutdown','[core]\x20shutdown','fullybooted','[core]\x20fullybooted','error','[core]\x20error','close','managerevent','./utils','connect','info'];(function(_0x5c06a9,_0x251467){var _0x121dc0=function(_0x11689a){while(--_0x11689a){_0x5c06a9['push'](_0x5c06a9['shift']());}};_0x121dc0(++_0x251467);}(_0xc9ce,0x75));var _0xec9c=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xc9ce[_0x321bb2];return _0x9c12ed;};'use strict';var utils=require(_0xec9c('0x0'));exports[_0xec9c('0x1')]=function(){utils[_0xec9c('0x2')](_0xec9c('0x3'));};exports[_0xec9c('0x4')]=function(){utils['info'](_0xec9c('0x5'));};exports[_0xec9c('0x6')]=function(){utils[_0xec9c('0x2')](_0xec9c('0x7'));};exports[_0xec9c('0x8')]=function(_0x2cb560){utils[_0xec9c('0x8')](_0xec9c('0x9'),_0x2cb560);};exports[_0xec9c('0xa')]=function(){utils['info']('[core]\x20close');};exports[_0xec9c('0xb')]=function(_0x710c2e){}; \ No newline at end of file diff --git a/server/services/xdr/dials.controller.js b/server/services/xdr/dials.controller.js index 547e064..204c001 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 _0x5c08=['request','CreateVoiceDialReport','newexten','debug','[%s][dials][newexten]','[%s][dials][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','startsWith','cdr(routeid)','split','error','varset','[%s][dials][varset]','isNil','variable','outboundrouteid','value','[%s][dials][dialbegin]','assign','starttime','now','lastevent','called','[%s][dials][hangup]\x20starttime:%s\x20lastevent:called','[%s][dials][dialend]','answertime','connect','[%s][dials][dialend]\x20dialstatus:%s','hangup','[%s][dials][hangup]','[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s','complete','diffTime','endtime','holdtime','billableseconds','util','./utils','info','format','[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s','uniqueid','channel','calleridnum','connectedlinenum','dialstatus'];(function(_0x22d176,_0x1a2b0e){var _0x2d99fe=function(_0x468876){while(--_0x468876){_0x22d176['push'](_0x22d176['shift']());}};_0x2d99fe(++_0x1a2b0e);}(_0x5c08,0x86));var _0x85c0=function(_0x4e1464,_0x113b31){_0x4e1464=_0x4e1464-0x0;var _0x31971d=_0x5c08[_0x4e1464];return _0x31971d;};'use strict';var _=require('lodash');var util=require(_0x85c0('0x0'));var utils=require(_0x85c0('0x1'));var dials={};function writeDB(_0x812434){utils[_0x85c0('0x2')](util[_0x85c0('0x3')](_0x85c0('0x4'),_0x812434[_0x85c0('0x5')],_0x812434[_0x85c0('0x6')],_0x812434['dialstring'],_0x812434[_0x85c0('0x7')],_0x812434[_0x85c0('0x8')],_0x812434[_0x85c0('0x9')]));utils[_0x85c0('0xa')](_0x85c0('0xb'),_0x812434);delete dials[_0x812434[_0x85c0('0x5')]];}exports[_0x85c0('0xc')]=function(_0x25cb46){try{utils[_0x85c0('0xd')](util[_0x85c0('0x3')](_0x85c0('0xe'),_0x25cb46[_0x85c0('0x5')]),_0x25cb46);utils[_0x85c0('0x2')](util[_0x85c0('0x3')](_0x85c0('0xf'),_0x25cb46[_0x85c0('0x5')],_0x25cb46[_0x85c0('0x10')],_0x25cb46[_0x85c0('0x11')]));if(_0x25cb46['application'][_0x85c0('0x12')]()=='set'&&_[_0x85c0('0x13')](_0x25cb46[_0x85c0('0x11')]['toLowerCase'](),_0x85c0('0x14'))){var _0x4bc5f2=_0x25cb46[_0x85c0('0x11')][_0x85c0('0x15')]('=');dials[_0x25cb46[_0x85c0('0x5')]]={'routeId':_0x4bc5f2[0x1]};}}catch(_0x2b3679){utils[_0x85c0('0x16')](util['format'](_0x85c0('0xe'),_0x25cb46['uniqueid']),_0x2b3679);}};exports[_0x85c0('0x17')]=function(_0x1eba84){try{utils['debug'](util['format'](_0x85c0('0x18'),_0x1eba84[_0x85c0('0x5')]),_0x1eba84);if(!_[_0x85c0('0x19')](_0x1eba84[_0x85c0('0x1a')][_0x85c0('0x1b')])){utils[_0x85c0('0x2')](util[_0x85c0('0x3')]('[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s',_0x1eba84[_0x85c0('0x5')],_0x1eba84[_0x85c0('0x1c')]));dials[_0x1eba84[_0x85c0('0x5')]]={'routeId':_0x1eba84[_0x85c0('0x1c')]};}}catch(_0x4d3e7d){utils[_0x85c0('0x16')](util[_0x85c0('0x3')]('[%s][dials][varset]',_0x1eba84[_0x85c0('0x5')]),_0x4d3e7d);}};exports['dialbegin']=function(_0x4f8308){try{if(!_[_0x85c0('0x19')](dials[_0x4f8308[_0x85c0('0x5')]])){utils[_0x85c0('0xd')](util[_0x85c0('0x3')](_0x85c0('0x1d'),_0x4f8308['uniqueid']),_0x4f8308);dials[_0x4f8308[_0x85c0('0x5')]]=_[_0x85c0('0x1e')](dials[_0x4f8308[_0x85c0('0x5')]],_0x4f8308);dials[_0x4f8308['uniqueid']][_0x85c0('0x1f')]=utils[_0x85c0('0x20')]();dials[_0x4f8308[_0x85c0('0x5')]][_0x85c0('0x21')]=_0x85c0('0x22');utils[_0x85c0('0x2')](util[_0x85c0('0x3')](_0x85c0('0x23'),_0x4f8308[_0x85c0('0x5')],dials[_0x4f8308[_0x85c0('0x5')]][_0x85c0('0x1f')]));}}catch(_0xc482f3){utils[_0x85c0('0x16')](util['format']('[%s][dials][dialbegin]',_0x4f8308[_0x85c0('0x5')]),_0xc482f3);}};exports['dialend']=function(_0x1655be){try{if(!_[_0x85c0('0x19')](dials[_0x1655be[_0x85c0('0x5')]])){utils[_0x85c0('0xd')](util['format'](_0x85c0('0x24'),_0x1655be[_0x85c0('0x5')]),_0x1655be);dials[_0x1655be['uniqueid']]['dialstatus']=_0x1655be[_0x85c0('0x9')];if(_0x1655be[_0x85c0('0x9')]=='ANSWER'){dials[_0x1655be['uniqueid']]=_[_0x85c0('0x1e')](dials[_0x1655be[_0x85c0('0x5')]],_0x1655be);dials[_0x1655be[_0x85c0('0x5')]][_0x85c0('0x25')]=utils['now']();dials[_0x1655be[_0x85c0('0x5')]]['lastevent']=_0x85c0('0x26');utils['info'](util['format']('[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect',_0x1655be[_0x85c0('0x5')],_0x1655be['dialstatus'],dials[_0x1655be[_0x85c0('0x5')]][_0x85c0('0x25')]));}else{utils[_0x85c0('0x2')](util[_0x85c0('0x3')](_0x85c0('0x27'),_0x1655be['uniqueid'],_0x1655be[_0x85c0('0x9')]));}}}catch(_0x39ceec){utils[_0x85c0('0x16')](util[_0x85c0('0x3')](_0x85c0('0x24'),_0x1655be[_0x85c0('0x5')]),_0x39ceec);}};exports[_0x85c0('0x28')]=function(_0x2527ef){try{if(!_[_0x85c0('0x19')](dials[_0x2527ef[_0x85c0('0x5')]])){utils[_0x85c0('0xd')](util['format'](_0x85c0('0x29'),_0x2527ef[_0x85c0('0x5')]),_0x2527ef);utils[_0x85c0('0x2')](util[_0x85c0('0x3')](_0x85c0('0x2a'),_0x2527ef[_0x85c0('0x5')],_0x2527ef[_0x85c0('0x7')],_0x2527ef['calleridname'],_0x2527ef['cause-txt']));dials[_0x2527ef[_0x85c0('0x5')]]=_[_0x85c0('0x1e')](dials[_0x2527ef[_0x85c0('0x5')]],{'endtime':utils[_0x85c0('0x20')](),'lastevent':_0x85c0('0x2b')});dials[_0x2527ef[_0x85c0('0x5')]]['duration']=utils[_0x85c0('0x2c')](dials[_0x2527ef[_0x85c0('0x5')]][_0x85c0('0x2d')],dials[_0x2527ef['uniqueid']][_0x85c0('0x1f')]);dials[_0x2527ef['uniqueid']][_0x85c0('0x2e')]=utils['diffTime'](dials[_0x2527ef['uniqueid']][_0x85c0('0x25')]||dials[_0x2527ef[_0x85c0('0x5')]][_0x85c0('0x2d')],dials[_0x2527ef[_0x85c0('0x5')]][_0x85c0('0x1f')]);dials[_0x2527ef[_0x85c0('0x5')]][_0x85c0('0x2f')]=dials[_0x2527ef[_0x85c0('0x5')]][_0x85c0('0x25')]?utils[_0x85c0('0x2c')](dials[_0x2527ef[_0x85c0('0x5')]][_0x85c0('0x2d')],dials[_0x2527ef[_0x85c0('0x5')]][_0x85c0('0x25')]):0x0;writeDB(dials[_0x2527ef[_0x85c0('0x5')]]);}}catch(_0x5721b6){utils[_0x85c0('0x16')](util[_0x85c0('0x3')](_0x85c0('0x29'),_0x2527ef[_0x85c0('0x5')]),_0x5721b6);}}; \ No newline at end of file +var _0x4f40=['isNil','variable','outboundrouteid','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','value','[%s][dials][dialbegin]','starttime','lastevent','called','[%s][dials][hangup]\x20starttime:%s\x20lastevent:called','dialend','[%s][dials][dialend]','ANSWER','assign','now','[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','answertime','[%s][dials][dialend]\x20dialstatus:%s','hangup','[%s][dials][hangup]','[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s','calleridname','cause-txt','duration','diffTime','endtime','holdtime','billableseconds','lodash','util','./utils','info','[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s','uniqueid','channel','dialstring','calleridnum','connectedlinenum','dialstatus','CreateVoiceDialReport','format','[%s][dials][newexten]','appdata','toLowerCase','set','cdr(routeid)','split','error','varset','debug','[%s][dials][varset]'];(function(_0x44216d,_0x4938a7){var _0xeca523=function(_0x11faf1){while(--_0x11faf1){_0x44216d['push'](_0x44216d['shift']());}};_0xeca523(++_0x4938a7);}(_0x4f40,0x82));var _0x04f4=function(_0x3109e5,_0x39c1b9){_0x3109e5=_0x3109e5-0x0;var _0x123aab=_0x4f40[_0x3109e5];return _0x123aab;};'use strict';var _=require(_0x04f4('0x0'));var util=require(_0x04f4('0x1'));var utils=require(_0x04f4('0x2'));var dials={};function writeDB(_0x4214a8){utils[_0x04f4('0x3')](util['format'](_0x04f4('0x4'),_0x4214a8[_0x04f4('0x5')],_0x4214a8[_0x04f4('0x6')],_0x4214a8[_0x04f4('0x7')],_0x4214a8[_0x04f4('0x8')],_0x4214a8[_0x04f4('0x9')],_0x4214a8[_0x04f4('0xa')]));utils['request'](_0x04f4('0xb'),_0x4214a8);delete dials[_0x4214a8[_0x04f4('0x5')]];}exports['newexten']=function(_0x1bddf3){try{utils['debug'](util[_0x04f4('0xc')](_0x04f4('0xd'),_0x1bddf3[_0x04f4('0x5')]),_0x1bddf3);utils[_0x04f4('0x3')](util[_0x04f4('0xc')]('[%s][dials][newexten]\x20application:%s\x20appdata:%s',_0x1bddf3['uniqueid'],_0x1bddf3['application'],_0x1bddf3[_0x04f4('0xe')]));if(_0x1bddf3['application'][_0x04f4('0xf')]()==_0x04f4('0x10')&&_['startsWith'](_0x1bddf3[_0x04f4('0xe')]['toLowerCase'](),_0x04f4('0x11'))){var _0x1f2639=_0x1bddf3[_0x04f4('0xe')][_0x04f4('0x12')]('=');dials[_0x1bddf3[_0x04f4('0x5')]]={'routeId':_0x1f2639[0x1]};}}catch(_0x3449e5){utils[_0x04f4('0x13')](util[_0x04f4('0xc')](_0x04f4('0xd'),_0x1bddf3[_0x04f4('0x5')]),_0x3449e5);}};exports[_0x04f4('0x14')]=function(_0x3f5496){try{utils[_0x04f4('0x15')](util[_0x04f4('0xc')](_0x04f4('0x16'),_0x3f5496['uniqueid']),_0x3f5496);if(!_[_0x04f4('0x17')](_0x3f5496[_0x04f4('0x18')][_0x04f4('0x19')])){utils[_0x04f4('0x3')](util[_0x04f4('0xc')](_0x04f4('0x1a'),_0x3f5496[_0x04f4('0x5')],_0x3f5496[_0x04f4('0x1b')]));dials[_0x3f5496[_0x04f4('0x5')]]={'routeId':_0x3f5496['value']};}}catch(_0x9abd72){utils[_0x04f4('0x13')](util[_0x04f4('0xc')](_0x04f4('0x16'),_0x3f5496['uniqueid']),_0x9abd72);}};exports['dialbegin']=function(_0x56dece){try{if(!_[_0x04f4('0x17')](dials[_0x56dece[_0x04f4('0x5')]])){utils[_0x04f4('0x15')](util[_0x04f4('0xc')](_0x04f4('0x1c'),_0x56dece['uniqueid']),_0x56dece);dials[_0x56dece[_0x04f4('0x5')]]=_['assign'](dials[_0x56dece[_0x04f4('0x5')]],_0x56dece);dials[_0x56dece[_0x04f4('0x5')]][_0x04f4('0x1d')]=utils['now']();dials[_0x56dece[_0x04f4('0x5')]][_0x04f4('0x1e')]=_0x04f4('0x1f');utils[_0x04f4('0x3')](util[_0x04f4('0xc')](_0x04f4('0x20'),_0x56dece[_0x04f4('0x5')],dials[_0x56dece[_0x04f4('0x5')]][_0x04f4('0x1d')]));}}catch(_0x429638){utils['error'](util[_0x04f4('0xc')](_0x04f4('0x1c'),_0x56dece[_0x04f4('0x5')]),_0x429638);}};exports[_0x04f4('0x21')]=function(_0x4c17e1){try{if(!_['isNil'](dials[_0x4c17e1[_0x04f4('0x5')]])){utils[_0x04f4('0x15')](util[_0x04f4('0xc')](_0x04f4('0x22'),_0x4c17e1['uniqueid']),_0x4c17e1);dials[_0x4c17e1[_0x04f4('0x5')]]['dialstatus']=_0x4c17e1['dialstatus'];if(_0x4c17e1[_0x04f4('0xa')]==_0x04f4('0x23')){dials[_0x4c17e1['uniqueid']]=_[_0x04f4('0x24')](dials[_0x4c17e1[_0x04f4('0x5')]],_0x4c17e1);dials[_0x4c17e1[_0x04f4('0x5')]]['answertime']=utils[_0x04f4('0x25')]();dials[_0x4c17e1[_0x04f4('0x5')]][_0x04f4('0x1e')]='connect';utils['info'](util[_0x04f4('0xc')](_0x04f4('0x26'),_0x4c17e1[_0x04f4('0x5')],_0x4c17e1[_0x04f4('0xa')],dials[_0x4c17e1[_0x04f4('0x5')]][_0x04f4('0x27')]));}else{utils[_0x04f4('0x3')](util[_0x04f4('0xc')](_0x04f4('0x28'),_0x4c17e1[_0x04f4('0x5')],_0x4c17e1[_0x04f4('0xa')]));}}}catch(_0xa2e816){utils['error'](util[_0x04f4('0xc')]('[%s][dials][dialend]',_0x4c17e1[_0x04f4('0x5')]),_0xa2e816);}};exports[_0x04f4('0x29')]=function(_0x1f84d6){try{if(!_[_0x04f4('0x17')](dials[_0x1f84d6['uniqueid']])){utils['debug'](util[_0x04f4('0xc')](_0x04f4('0x2a'),_0x1f84d6[_0x04f4('0x5')]),_0x1f84d6);utils['info'](util['format'](_0x04f4('0x2b'),_0x1f84d6[_0x04f4('0x5')],_0x1f84d6[_0x04f4('0x8')],_0x1f84d6[_0x04f4('0x2c')],_0x1f84d6[_0x04f4('0x2d')]));dials[_0x1f84d6[_0x04f4('0x5')]]=_[_0x04f4('0x24')](dials[_0x1f84d6['uniqueid']],{'endtime':utils['now'](),'lastevent':'complete'});dials[_0x1f84d6[_0x04f4('0x5')]][_0x04f4('0x2e')]=utils[_0x04f4('0x2f')](dials[_0x1f84d6[_0x04f4('0x5')]][_0x04f4('0x30')],dials[_0x1f84d6[_0x04f4('0x5')]]['starttime']);dials[_0x1f84d6[_0x04f4('0x5')]][_0x04f4('0x31')]=utils[_0x04f4('0x2f')](dials[_0x1f84d6[_0x04f4('0x5')]][_0x04f4('0x27')]||dials[_0x1f84d6[_0x04f4('0x5')]]['endtime'],dials[_0x1f84d6['uniqueid']][_0x04f4('0x1d')]);dials[_0x1f84d6[_0x04f4('0x5')]][_0x04f4('0x32')]=dials[_0x1f84d6[_0x04f4('0x5')]][_0x04f4('0x27')]?utils[_0x04f4('0x2f')](dials[_0x1f84d6[_0x04f4('0x5')]][_0x04f4('0x30')],dials[_0x1f84d6[_0x04f4('0x5')]][_0x04f4('0x27')]):0x0;writeDB(dials[_0x1f84d6[_0x04f4('0x5')]]);}}catch(_0x47c95b){utils[_0x04f4('0x13')](util['format'](_0x04f4('0x2a'),_0x1f84d6[_0x04f4('0x5')]),_0x47c95b);}}; \ No newline at end of file diff --git a/server/services/xdr/index.js b/server/services/xdr/index.js index 905a736..af8bf23 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 _0x1da8=['blindtransfer','[%s][index][attendedtransfer]','origtransfereruniqueid','attendedtransfer','varset','[%s][index][varset]','[%s][index][newexten]','newexten','newchannel','[%s][index][newchannel]','dialbegin','[%s][index][dialbegin]','[%s]dialbegin','dialend','[%s][index][dialend]','asterisk-manager','../../config/environment','./utils','xdr','disabled','env','production','port','asterisk','username','password','keepConnected','info','Asterisk\x20disabled\x20on\x20localhost','./agents.controller','./queues.controller','./recordings.controller','./dials.controller','connect','shutdown','fullybooted','error','close','managerevent','devicestatechange','debug','format','[%s][index][devicestatechange]','agentcalled','[%s][index][agentcalled]','uniqueid','agentringnoanswer','[%s][index][agentringnoanswer]','[%s][index][agentconnect]','agentconnect','agentcomplete','[%s][index][agentcomplete]','queuecallerabandon','[%s][index][queuecallerabandon]','queuecallerjoin','[%s][index][queuecallerjoin]','queuecallerleave','[%s][index][queuecallerleave]','[%s][index][musiconholdstart]','musiconholdstart','musiconholdstop','[%s][index][musiconholdstop]','newstate','[%s][index][newstate]','hangup','[%s][index][hangup]','cdr','[%s][index][cdr]','[%s][index][blindtransfer]'];(function(_0x1966db,_0x16cd33){var _0x4b68f4=function(_0x28f1b5){while(--_0x28f1b5){_0x1966db['push'](_0x1966db['shift']());}};_0x4b68f4(++_0x16cd33);}(_0x1da8,0x1ad));var _0x81da=function(_0x16524d,_0xba895){_0x16524d=_0x16524d-0x0;var _0x56a73e=_0x1da8[_0x16524d];return _0x56a73e;};var AsteriskManager=require(_0x81da('0x0'));var config=require(_0x81da('0x1'));var utils=require(_0x81da('0x2'));var util=require('util');var isXDREnabled=config[_0x81da('0x3')]&&config[_0x81da('0x3')]['disabled']?!config['xdr'][_0x81da('0x4')]:!![];var isProduction=config[_0x81da('0x5')]===_0x81da('0x6')||![];var isLocalAsterisk=config[_0x81da('0x3')]&&config[_0x81da('0x3')]['local']===!![]||![];var ami=new AsteriskManager(config['asterisk'][_0x81da('0x7')],config[_0x81da('0x8')]['ip'],config[_0x81da('0x8')][_0x81da('0x9')],config[_0x81da('0x8')][_0x81da('0xa')],!![]);ami[_0x81da('0xb')]();if(!isXDREnabled){utils[_0x81da('0xc')]('XDR\x20DISABLED');}else if(!isProduction&&!isLocalAsterisk){utils[_0x81da('0xc')](_0x81da('0xd'));}else{var agents=require(_0x81da('0xe'));var calls=require('./calls.controller');var queues=require(_0x81da('0xf'));var recordings=require(_0x81da('0x10'));var members=require('./members.controller');var dials=require(_0x81da('0x11'));var transfers=require('./transfers.controller');var core=require('./core.controller');ami['on']('connect',core[_0x81da('0x12')]);ami['on'](_0x81da('0x13'),core[_0x81da('0x13')]);ami['on'](_0x81da('0x14'),core[_0x81da('0x14')]);ami['on']('error',core[_0x81da('0x15')]);ami['on'](_0x81da('0x16'),core[_0x81da('0x16')]);ami['on']('managerevent',core[_0x81da('0x17')]);ami['on'](_0x81da('0x18'),function(_0x1a81d9){try{utils[_0x81da('0x19')](util[_0x81da('0x1a')](_0x81da('0x1b'),_0x1a81d9['device']),_0x1a81d9);members[_0x81da('0x18')](_0x1a81d9);}catch(_0x5896f8){utils['error'](util[_0x81da('0x1a')](_0x81da('0x1b'),_0x1a81d9['device']),_0x5896f8);}});ami['on'](_0x81da('0x1c'),function(_0x1c5f71){try{utils[_0x81da('0x19')](util[_0x81da('0x1a')](_0x81da('0x1d'),_0x1c5f71[_0x81da('0x1e')]),_0x1c5f71);agents['agentcalled'](_0x1c5f71);}catch(_0x3ea1da){utils[_0x81da('0x15')](util['format'](_0x81da('0x1d'),_0x1c5f71[_0x81da('0x1e')]),_0x3ea1da);}});ami['on'](_0x81da('0x1f'),function(_0x23f094){try{utils[_0x81da('0x19')](util[_0x81da('0x1a')](_0x81da('0x20'),_0x23f094[_0x81da('0x1e')]),_0x23f094);agents[_0x81da('0x1f')](_0x23f094);}catch(_0x347af9){utils[_0x81da('0x15')](util['format'](_0x81da('0x20'),_0x23f094[_0x81da('0x1e')]),_0x347af9);}});ami['on']('agentconnect',function(_0x2b9802){try{utils[_0x81da('0x19')](util[_0x81da('0x1a')](_0x81da('0x21'),_0x2b9802[_0x81da('0x1e')]),_0x2b9802);agents['agentconnect'](_0x2b9802);queues[_0x81da('0x22')](_0x2b9802);}catch(_0x5ecccf){utils[_0x81da('0x15')](util[_0x81da('0x1a')]('[%s][index][agentconnect]',_0x2b9802[_0x81da('0x1e')]),_0x5ecccf);}});ami['on'](_0x81da('0x23'),function(_0xaa05e5){try{utils[_0x81da('0x19')](util[_0x81da('0x1a')](_0x81da('0x24'),_0xaa05e5['uniqueid']),_0xaa05e5);agents[_0x81da('0x23')](_0xaa05e5);queues[_0x81da('0x23')](_0xaa05e5);members['agentcomplete'](_0xaa05e5);}catch(_0x307925){utils['error'](util[_0x81da('0x1a')]('[%s][index][agentcomplete]',_0xaa05e5[_0x81da('0x1e')]),_0x307925);}});ami['on'](_0x81da('0x25'),function(_0x5e96e5){try{utils[_0x81da('0x19')](util[_0x81da('0x1a')](_0x81da('0x26'),_0x5e96e5[_0x81da('0x1e')]),_0x5e96e5);agents[_0x81da('0x25')](_0x5e96e5);queues[_0x81da('0x25')](_0x5e96e5);}catch(_0x1e316c){utils[_0x81da('0x15')](util[_0x81da('0x1a')](_0x81da('0x26'),_0x5e96e5[_0x81da('0x1e')]),_0x1e316c);}});ami['on'](_0x81da('0x27'),function(_0x137445){try{utils[_0x81da('0x19')](util[_0x81da('0x1a')](_0x81da('0x28'),_0x137445[_0x81da('0x1e')]),_0x137445);queues[_0x81da('0x27')](_0x137445);recordings['queuecallerjoin'](_0x137445);}catch(_0x141970){utils[_0x81da('0x15')](util[_0x81da('0x1a')](_0x81da('0x28'),_0x137445[_0x81da('0x1e')]),_0x141970);}});ami['on'](_0x81da('0x29'),function(_0x581142){try{utils[_0x81da('0x19')](util[_0x81da('0x1a')](_0x81da('0x2a'),_0x581142['uniqueid']),_0x581142);queues[_0x81da('0x29')](_0x581142);}catch(_0x3b4236){utils[_0x81da('0x15')](util[_0x81da('0x1a')](_0x81da('0x2a'),_0x581142['uniqueid']),_0x3b4236);}});ami['on']('musiconholdstart',function(_0x5094e0){try{utils[_0x81da('0x19')](util['format'](_0x81da('0x2b'),_0x5094e0[_0x81da('0x1e')]),_0x5094e0);queues[_0x81da('0x2c')](_0x5094e0);calls[_0x81da('0x2c')](_0x5094e0);}catch(_0x3044d9){utils[_0x81da('0x15')](util[_0x81da('0x1a')](_0x81da('0x2b'),_0x5094e0[_0x81da('0x1e')]),_0x3044d9);}});ami['on'](_0x81da('0x2d'),function(_0x37fe6f){try{utils[_0x81da('0x19')](util[_0x81da('0x1a')](_0x81da('0x2e'),_0x37fe6f[_0x81da('0x1e')]),_0x37fe6f);queues['musiconholdstop'](_0x37fe6f);calls[_0x81da('0x2d')](_0x37fe6f);}catch(_0x905cd){utils['error'](util[_0x81da('0x1a')](_0x81da('0x2e'),_0x37fe6f[_0x81da('0x1e')]),_0x905cd);}});ami['on'](_0x81da('0x2f'),function(_0x53a101){try{utils['debug'](util['format'](_0x81da('0x30'),_0x53a101[_0x81da('0x1e')]),_0x53a101);calls[_0x81da('0x2f')](_0x53a101);recordings[_0x81da('0x2f')](_0x53a101);}catch(_0x389b12){utils[_0x81da('0x15')](util['format'](_0x81da('0x30'),_0x53a101[_0x81da('0x1e')]),_0x389b12);}});ami['on'](_0x81da('0x31'),function(_0x15bdf8){try{utils['debug'](util[_0x81da('0x1a')](_0x81da('0x32'),_0x15bdf8[_0x81da('0x1e')]),_0x15bdf8);calls['hangup'](_0x15bdf8);recordings[_0x81da('0x31')](_0x15bdf8);dials['hangup'](_0x15bdf8);agents['hangup'](_0x15bdf8);queues[_0x81da('0x31')](_0x15bdf8);}catch(_0x35511e){utils[_0x81da('0x15')](util[_0x81da('0x1a')](_0x81da('0x32'),_0x15bdf8[_0x81da('0x1e')]),_0x35511e);}});ami['on'](_0x81da('0x33'),function(_0x11ac83){try{utils[_0x81da('0x19')](util[_0x81da('0x1a')](_0x81da('0x34'),_0x11ac83[_0x81da('0x1e')]),_0x11ac83);members[_0x81da('0x33')](_0x11ac83);}catch(_0x3b3c52){utils[_0x81da('0x15')](util[_0x81da('0x1a')](_0x81da('0x34'),_0x11ac83[_0x81da('0x1e')]),_0x3b3c52);}});ami['on']('blindtransfer',function(_0x1c7bb7){try{utils['debug'](util[_0x81da('0x1a')](_0x81da('0x35'),_0x1c7bb7[_0x81da('0x1e')]),_0x1c7bb7);queues['blindtransfer'](_0x1c7bb7);agents[_0x81da('0x36')](_0x1c7bb7);transfers['blindtransfer'](_0x1c7bb7);}catch(_0x17712e){utils[_0x81da('0x15')](util[_0x81da('0x1a')](_0x81da('0x35'),_0x1c7bb7['uniqueid']),_0x17712e);}});ami['on']('attendedtransfer',function(_0x2a6773){try{utils[_0x81da('0x19')](util[_0x81da('0x1a')](_0x81da('0x37'),_0x2a6773[_0x81da('0x38')]),_0x2a6773);queues[_0x81da('0x39')](_0x2a6773);transfers['attendedtransfer'](_0x2a6773);agents[_0x81da('0x39')](_0x2a6773);calls[_0x81da('0x39')](_0x2a6773);}catch(_0x564fb4){utils[_0x81da('0x15')](util['format'](_0x81da('0x37'),_0x2a6773['origtransfereruniqueid']),_0x564fb4);}});ami['on'](_0x81da('0x3a'),function(_0x473c85){try{utils[_0x81da('0x19')](util[_0x81da('0x1a')]('[%s][index][varset]',_0x473c85['uniqueid']),_0x473c85);queues[_0x81da('0x3a')](_0x473c85);recordings[_0x81da('0x3a')](_0x473c85);calls['varset'](_0x473c85);dials[_0x81da('0x3a')](_0x473c85);}catch(_0x3fda9b){utils[_0x81da('0x15')](util[_0x81da('0x1a')](_0x81da('0x3b'),_0x473c85['uniqueid']),_0x3fda9b);}});ami['on']('newexten',function(_0x52e62c){try{utils['debug'](util[_0x81da('0x1a')](_0x81da('0x3c'),_0x52e62c[_0x81da('0x1e')]),_0x52e62c);calls[_0x81da('0x3d')](_0x52e62c);recordings[_0x81da('0x3d')](_0x52e62c);dials[_0x81da('0x3d')](_0x52e62c);}catch(_0x59322a){utils[_0x81da('0x15')](util[_0x81da('0x1a')](_0x81da('0x3c'),_0x52e62c[_0x81da('0x1e')]),_0x59322a);}});ami['on'](_0x81da('0x3e'),function(_0x50a7c6){try{utils['debug'](util[_0x81da('0x1a')](_0x81da('0x3f'),_0x50a7c6[_0x81da('0x1e')]),_0x50a7c6);calls[_0x81da('0x3e')](_0x50a7c6);recordings[_0x81da('0x3e')](_0x50a7c6);}catch(_0x546925){utils[_0x81da('0x15')](util[_0x81da('0x1a')](_0x81da('0x3f'),_0x50a7c6['uniqueid']),_0x546925);}});ami['on'](_0x81da('0x40'),function(_0x4d4269){try{utils[_0x81da('0x19')](util[_0x81da('0x1a')](_0x81da('0x41'),_0x4d4269[_0x81da('0x1e')]),_0x4d4269);dials[_0x81da('0x40')](_0x4d4269);}catch(_0x432e1e){utils[_0x81da('0x15')](util[_0x81da('0x1a')](_0x81da('0x42'),_0x4d4269['uniqueid']),_0x432e1e);}});ami['on'](_0x81da('0x43'),function(_0x2b68e8){try{utils[_0x81da('0x19')](util['format']('[%s][index][dialend]',_0x2b68e8[_0x81da('0x1e')]),_0x2b68e8);dials[_0x81da('0x43')](_0x2b68e8);}catch(_0xc6b494){utils['error'](util['format'](_0x81da('0x44'),_0x2b68e8[_0x81da('0x1e')]),_0xc6b494);}});} \ No newline at end of file +var _0x7ef8=['username','password','keepConnected','info','XDR\x20DISABLED','Asterisk\x20disabled\x20on\x20localhost','./agents.controller','./calls.controller','./queues.controller','./recordings.controller','./transfers.controller','./core.controller','connect','shutdown','fullybooted','error','close','managerevent','format','[%s][index][devicestatechange]','device','[%s][index][agentcalled]','uniqueid','agentcalled','agentringnoanswer','debug','[%s][index][agentringnoanswer]','agentconnect','[%s][index][agentconnect]','[%s][index][agentcomplete]','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]','[%s][index][cdr]','cdr','blindtransfer','attendedtransfer','[%s][index][attendedtransfer]','origtransfereruniqueid','varset','[%s][index][varset]','newexten','[%s][index][newexten]','newchannel','[%s][index][newchannel]','dialbegin','[%s][index][dialbegin]','dialend','[%s][index][dialend]','./utils','util','xdr','disabled','local','asterisk'];(function(_0x5c365f,_0x3b40ed){var _0x295e1b=function(_0x226683){while(--_0x226683){_0x5c365f['push'](_0x5c365f['shift']());}};_0x295e1b(++_0x3b40ed);}(_0x7ef8,0x106));var _0x87ef=function(_0x21b87c,_0x1fcc0c){_0x21b87c=_0x21b87c-0x0;var _0x54cfec=_0x7ef8[_0x21b87c];return _0x54cfec;};var AsteriskManager=require('asterisk-manager');var config=require('../../config/environment');var utils=require(_0x87ef('0x0'));var util=require(_0x87ef('0x1'));var isXDREnabled=config[_0x87ef('0x2')]&&config['xdr'][_0x87ef('0x3')]?!config[_0x87ef('0x2')][_0x87ef('0x3')]:!![];var isProduction=config['env']==='production'||![];var isLocalAsterisk=config['xdr']&&config[_0x87ef('0x2')][_0x87ef('0x4')]===!![]||![];var ami=new AsteriskManager(config[_0x87ef('0x5')]['port'],config[_0x87ef('0x5')]['ip'],config[_0x87ef('0x5')][_0x87ef('0x6')],config[_0x87ef('0x5')][_0x87ef('0x7')],!![]);ami[_0x87ef('0x8')]();if(!isXDREnabled){utils[_0x87ef('0x9')](_0x87ef('0xa'));}else if(!isProduction&&!isLocalAsterisk){utils[_0x87ef('0x9')](_0x87ef('0xb'));}else{var agents=require(_0x87ef('0xc'));var calls=require(_0x87ef('0xd'));var queues=require(_0x87ef('0xe'));var recordings=require(_0x87ef('0xf'));var members=require('./members.controller');var dials=require('./dials.controller');var transfers=require(_0x87ef('0x10'));var core=require(_0x87ef('0x11'));ami['on']('connect',core[_0x87ef('0x12')]);ami['on'](_0x87ef('0x13'),core['shutdown']);ami['on'](_0x87ef('0x14'),core[_0x87ef('0x14')]);ami['on'](_0x87ef('0x15'),core[_0x87ef('0x15')]);ami['on'](_0x87ef('0x16'),core[_0x87ef('0x16')]);ami['on']('managerevent',core[_0x87ef('0x17')]);ami['on']('devicestatechange',function(_0xdb1247){try{utils['debug'](util[_0x87ef('0x18')](_0x87ef('0x19'),_0xdb1247[_0x87ef('0x1a')]),_0xdb1247);members['devicestatechange'](_0xdb1247);}catch(_0x24533c){utils[_0x87ef('0x15')](util[_0x87ef('0x18')](_0x87ef('0x19'),_0xdb1247[_0x87ef('0x1a')]),_0x24533c);}});ami['on']('agentcalled',function(_0x1a5723){try{utils['debug'](util[_0x87ef('0x18')](_0x87ef('0x1b'),_0x1a5723[_0x87ef('0x1c')]),_0x1a5723);agents[_0x87ef('0x1d')](_0x1a5723);}catch(_0x23e11d){utils['error'](util[_0x87ef('0x18')](_0x87ef('0x1b'),_0x1a5723[_0x87ef('0x1c')]),_0x23e11d);}});ami['on'](_0x87ef('0x1e'),function(_0x839746){try{utils[_0x87ef('0x1f')](util[_0x87ef('0x18')]('[%s][index][agentringnoanswer]',_0x839746[_0x87ef('0x1c')]),_0x839746);agents[_0x87ef('0x1e')](_0x839746);}catch(_0x1f4ee3){utils['error'](util[_0x87ef('0x18')](_0x87ef('0x20'),_0x839746[_0x87ef('0x1c')]),_0x1f4ee3);}});ami['on'](_0x87ef('0x21'),function(_0x3204ae){try{utils[_0x87ef('0x1f')](util[_0x87ef('0x18')]('[%s][index][agentconnect]',_0x3204ae[_0x87ef('0x1c')]),_0x3204ae);agents[_0x87ef('0x21')](_0x3204ae);queues[_0x87ef('0x21')](_0x3204ae);}catch(_0x1af29f){utils[_0x87ef('0x15')](util[_0x87ef('0x18')](_0x87ef('0x22'),_0x3204ae[_0x87ef('0x1c')]),_0x1af29f);}});ami['on']('agentcomplete',function(_0x1bf821){try{utils['debug'](util[_0x87ef('0x18')](_0x87ef('0x23'),_0x1bf821[_0x87ef('0x1c')]),_0x1bf821);agents[_0x87ef('0x24')](_0x1bf821);queues[_0x87ef('0x24')](_0x1bf821);members[_0x87ef('0x24')](_0x1bf821);}catch(_0x190616){utils[_0x87ef('0x15')](util[_0x87ef('0x18')](_0x87ef('0x23'),_0x1bf821['uniqueid']),_0x190616);}});ami['on'](_0x87ef('0x25'),function(_0x5cc092){try{utils['debug'](util['format'](_0x87ef('0x26'),_0x5cc092[_0x87ef('0x1c')]),_0x5cc092);agents['queuecallerabandon'](_0x5cc092);queues['queuecallerabandon'](_0x5cc092);}catch(_0x107325){utils[_0x87ef('0x15')](util[_0x87ef('0x18')](_0x87ef('0x26'),_0x5cc092[_0x87ef('0x1c')]),_0x107325);}});ami['on']('queuecallerjoin',function(_0x2cfe90){try{utils[_0x87ef('0x1f')](util[_0x87ef('0x18')](_0x87ef('0x27'),_0x2cfe90[_0x87ef('0x1c')]),_0x2cfe90);queues[_0x87ef('0x28')](_0x2cfe90);recordings['queuecallerjoin'](_0x2cfe90);}catch(_0x55f032){utils['error'](util[_0x87ef('0x18')]('[%s][index][queuecallerjoin]',_0x2cfe90[_0x87ef('0x1c')]),_0x55f032);}});ami['on'](_0x87ef('0x29'),function(_0x457a4f){try{utils[_0x87ef('0x1f')](util[_0x87ef('0x18')](_0x87ef('0x2a'),_0x457a4f['uniqueid']),_0x457a4f);queues[_0x87ef('0x29')](_0x457a4f);}catch(_0x1ed9d0){utils[_0x87ef('0x15')](util[_0x87ef('0x18')](_0x87ef('0x2a'),_0x457a4f[_0x87ef('0x1c')]),_0x1ed9d0);}});ami['on'](_0x87ef('0x2b'),function(_0x3913eb){try{utils['debug'](util[_0x87ef('0x18')]('[%s][index][musiconholdstart]',_0x3913eb['uniqueid']),_0x3913eb);queues[_0x87ef('0x2b')](_0x3913eb);calls['musiconholdstart'](_0x3913eb);}catch(_0x269195){utils['error'](util['format'](_0x87ef('0x2c'),_0x3913eb[_0x87ef('0x1c')]),_0x269195);}});ami['on']('musiconholdstop',function(_0x2340f8){try{utils[_0x87ef('0x1f')](util[_0x87ef('0x18')](_0x87ef('0x2d'),_0x2340f8[_0x87ef('0x1c')]),_0x2340f8);queues['musiconholdstop'](_0x2340f8);calls[_0x87ef('0x2e')](_0x2340f8);}catch(_0x38ed07){utils[_0x87ef('0x15')](util[_0x87ef('0x18')](_0x87ef('0x2d'),_0x2340f8[_0x87ef('0x1c')]),_0x38ed07);}});ami['on'](_0x87ef('0x2f'),function(_0x10d48){try{utils[_0x87ef('0x1f')](util['format'](_0x87ef('0x30'),_0x10d48[_0x87ef('0x1c')]),_0x10d48);calls[_0x87ef('0x2f')](_0x10d48);recordings[_0x87ef('0x2f')](_0x10d48);}catch(_0x177bd6){utils[_0x87ef('0x15')](util['format']('[%s][index][newstate]',_0x10d48['uniqueid']),_0x177bd6);}});ami['on'](_0x87ef('0x31'),function(_0x561b9a){try{utils['debug'](util['format']('[%s][index][hangup]',_0x561b9a[_0x87ef('0x1c')]),_0x561b9a);calls['hangup'](_0x561b9a);recordings[_0x87ef('0x31')](_0x561b9a);dials[_0x87ef('0x31')](_0x561b9a);agents['hangup'](_0x561b9a);queues['hangup'](_0x561b9a);}catch(_0x2c4d0a){utils[_0x87ef('0x15')](util['format'](_0x87ef('0x32'),_0x561b9a[_0x87ef('0x1c')]),_0x2c4d0a);}});ami['on']('cdr',function(_0x2e40cd){try{utils['debug'](util[_0x87ef('0x18')](_0x87ef('0x33'),_0x2e40cd['uniqueid']),_0x2e40cd);members[_0x87ef('0x34')](_0x2e40cd);}catch(_0x40526f){utils[_0x87ef('0x15')](util[_0x87ef('0x18')](_0x87ef('0x33'),_0x2e40cd[_0x87ef('0x1c')]),_0x40526f);}});ami['on'](_0x87ef('0x35'),function(_0x375995){try{utils['debug'](util['format']('[%s][index][blindtransfer]',_0x375995['uniqueid']),_0x375995);queues[_0x87ef('0x35')](_0x375995);agents[_0x87ef('0x35')](_0x375995);transfers[_0x87ef('0x35')](_0x375995);}catch(_0x5836a0){utils['error'](util[_0x87ef('0x18')]('[%s][index][blindtransfer]',_0x375995[_0x87ef('0x1c')]),_0x5836a0);}});ami['on'](_0x87ef('0x36'),function(_0x949ab0){try{utils['debug'](util[_0x87ef('0x18')](_0x87ef('0x37'),_0x949ab0[_0x87ef('0x38')]),_0x949ab0);queues[_0x87ef('0x36')](_0x949ab0);transfers[_0x87ef('0x36')](_0x949ab0);agents[_0x87ef('0x36')](_0x949ab0);calls['attendedtransfer'](_0x949ab0);}catch(_0x1bb8bc){utils['error'](util[_0x87ef('0x18')](_0x87ef('0x37'),_0x949ab0[_0x87ef('0x38')]),_0x1bb8bc);}});ami['on'](_0x87ef('0x39'),function(_0x29b60c){try{utils[_0x87ef('0x1f')](util[_0x87ef('0x18')](_0x87ef('0x3a'),_0x29b60c[_0x87ef('0x1c')]),_0x29b60c);queues[_0x87ef('0x39')](_0x29b60c);recordings[_0x87ef('0x39')](_0x29b60c);calls['varset'](_0x29b60c);dials[_0x87ef('0x39')](_0x29b60c);}catch(_0x566216){utils[_0x87ef('0x15')](util[_0x87ef('0x18')](_0x87ef('0x3a'),_0x29b60c[_0x87ef('0x1c')]),_0x566216);}});ami['on'](_0x87ef('0x3b'),function(_0x38aa57){try{utils[_0x87ef('0x1f')](util[_0x87ef('0x18')](_0x87ef('0x3c'),_0x38aa57[_0x87ef('0x1c')]),_0x38aa57);calls['newexten'](_0x38aa57);recordings[_0x87ef('0x3b')](_0x38aa57);dials[_0x87ef('0x3b')](_0x38aa57);}catch(_0x49fb6d){utils[_0x87ef('0x15')](util['format'](_0x87ef('0x3c'),_0x38aa57[_0x87ef('0x1c')]),_0x49fb6d);}});ami['on'](_0x87ef('0x3d'),function(_0x17ebea){try{utils[_0x87ef('0x1f')](util['format'](_0x87ef('0x3e'),_0x17ebea[_0x87ef('0x1c')]),_0x17ebea);calls[_0x87ef('0x3d')](_0x17ebea);recordings[_0x87ef('0x3d')](_0x17ebea);}catch(_0x47235b){utils[_0x87ef('0x15')](util[_0x87ef('0x18')](_0x87ef('0x3e'),_0x17ebea[_0x87ef('0x1c')]),_0x47235b);}});ami['on'](_0x87ef('0x3f'),function(_0x37ad5b){try{utils['debug'](util[_0x87ef('0x18')](_0x87ef('0x40'),_0x37ad5b[_0x87ef('0x1c')]),_0x37ad5b);dials['dialbegin'](_0x37ad5b);}catch(_0x35ab28){utils[_0x87ef('0x15')](util[_0x87ef('0x18')]('[%s]dialbegin',_0x37ad5b[_0x87ef('0x1c')]),_0x35ab28);}});ami['on'](_0x87ef('0x41'),function(_0x3c4838){try{utils['debug'](util['format'](_0x87ef('0x42'),_0x3c4838[_0x87ef('0x1c')]),_0x3c4838);dials[_0x87ef('0x41')](_0x3c4838);}catch(_0x55c4c1){utils[_0x87ef('0x15')](util[_0x87ef('0x18')](_0x87ef('0x42'),_0x3c4838[_0x87ef('0x1c')]),_0x55c4c1);}});} \ No newline at end of file diff --git a/server/services/xdr/members.controller.js b/server/services/xdr/members.controller.js index 3101fad..d198afb 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 _0x4f83=['destination','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','destinationchannel','lodash','util','./utils','Local/_attended@transfer','Queue:','info','format','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','uniqueid','interface','channel','membername','type','getUserByInterface','then','name','internal','request','CreateMemberReport','getUserByName','split','catch','[%s][members][writeDB]','some','devicestatechange','debug','device','state','BUSY','voice','now','agent','NOT_INUSE','isNil','exitAt','duration','diffTime','enterAt','error','[%s][members][devicestatechange]','agentcomplete','[%s][members][agentcomplete]','queue','cdr','[%s][members][cdr]','assign','data1','data2','source','data3'];(function(_0x2962b4,_0x4b0786){var _0x411b7d=function(_0x363aad){while(--_0x363aad){_0x2962b4['push'](_0x2962b4['shift']());}};_0x411b7d(++_0x4b0786);}(_0x4f83,0x6d));var _0x34f8=function(_0x2bee64,_0x176633){_0x2bee64=_0x2bee64-0x0;var _0x265914=_0x4f83[_0x2bee64];return _0x265914;};'use strict';var _=require(_0x34f8('0x0'));var util=require(_0x34f8('0x1'));var utils=require(_0x34f8('0x2'));var members={};var exclude=[_0x34f8('0x3'),_0x34f8('0x4')];function writeDB(_0xfc0160){utils[_0x34f8('0x5')](util[_0x34f8('0x6')](_0x34f8('0x7'),_0xfc0160[_0x34f8('0x8')],_0xfc0160[_0x34f8('0x9')],_0xfc0160[_0x34f8('0xa')],_0xfc0160['data2'],_0xfc0160[_0x34f8('0xb')],_0xfc0160[_0x34f8('0xc')]));if(_0xfc0160['interface']){utils[_0x34f8('0xd')](_0xfc0160[_0x34f8('0x9')])[_0x34f8('0xe')](function(_0x1c9a75){if(_0x1c9a75){_0xfc0160[_0x34f8('0xb')]=_0x1c9a75[_0x34f8('0xf')];_0xfc0160[_0x34f8('0x10')]=_0x1c9a75[_0x34f8('0x10')];utils[_0x34f8('0x11')](_0x34f8('0x12'),_0xfc0160);}else{utils[_0x34f8('0x13')](_0xfc0160[_0x34f8('0x9')][_0x34f8('0x14')]('/')[0x1])[_0x34f8('0xe')](function(_0x50789b){if(_0x50789b){_0xfc0160[_0x34f8('0xb')]=_0x50789b[_0x34f8('0xf')];_0xfc0160[_0x34f8('0x10')]=_0x50789b[_0x34f8('0x10')];utils[_0x34f8('0x11')](_0x34f8('0x12'),_0xfc0160);}});}})[_0x34f8('0x15')](function(_0x56e8b9){utils['error'](util[_0x34f8('0x6')](_0x34f8('0x16'),_0xfc0160[_0x34f8('0x8')]),_0x56e8b9);});}delete members[_0xfc0160[_0x34f8('0x9')]];}function startsWith(_0x585355,_0x3807b3){return _[_0x34f8('0x17')](_0x585355,function(_0x500544){return _['startsWith'](_0x3807b3,_0x500544);});}exports[_0x34f8('0x18')]=function(_0x11c4c0){try{utils[_0x34f8('0x19')](util[_0x34f8('0x6')]('[%s][members][devicestatechange]',members[_0x11c4c0['device']]?members[_0x11c4c0['device']][_0x34f8('0x8')]:_0x11c4c0[_0x34f8('0x1a')]),_0x11c4c0);utils[_0x34f8('0x5')](util[_0x34f8('0x6')]('[%s][members][devicestatechange]\x20state:%s\x20interface:%s',members[_0x11c4c0[_0x34f8('0x1a')]]?members[_0x11c4c0[_0x34f8('0x1a')]][_0x34f8('0x8')]:_0x11c4c0[_0x34f8('0x1a')],_0x11c4c0[_0x34f8('0x1b')],_0x11c4c0[_0x34f8('0x1a')]));switch(_0x11c4c0[_0x34f8('0x1b')]){case'INUSE':case _0x34f8('0x1c'):if(!startsWith(exclude,_0x11c4c0[_0x34f8('0x1a')])){members[_0x11c4c0[_0x34f8('0x1a')]]={'channel':_0x34f8('0x1d'),'interface':_0x11c4c0[_0x34f8('0x1a')],'type':'TALKING','enterAt':utils[_0x34f8('0x1e')](),'role':_0x34f8('0x1f')};}break;case _0x34f8('0x20'):if(!_[_0x34f8('0x21')](members[_0x11c4c0[_0x34f8('0x1a')]])){members[_0x11c4c0['device']][_0x34f8('0x22')]=utils[_0x34f8('0x1e')]();members[_0x11c4c0['device']][_0x34f8('0x23')]=utils[_0x34f8('0x24')](members[_0x11c4c0[_0x34f8('0x1a')]][_0x34f8('0x22')],members[_0x11c4c0[_0x34f8('0x1a')]][_0x34f8('0x25')]);if(members[_0x11c4c0[_0x34f8('0x1a')]]['uniqueid']){writeDB(members[_0x11c4c0['device']]);}}break;default:break;}}catch(_0xc15aa8){utils[_0x34f8('0x26')](util[_0x34f8('0x6')](_0x34f8('0x27'),members[_0x11c4c0[_0x34f8('0x1a')]]?members[_0x11c4c0[_0x34f8('0x1a')]][_0x34f8('0x8')]:_0x11c4c0[_0x34f8('0x1a')]),_0xc15aa8);}};exports[_0x34f8('0x28')]=function(_0x121de7){try{if(!_[_0x34f8('0x21')](members[_0x121de7[_0x34f8('0x9')]])){utils[_0x34f8('0x19')](util[_0x34f8('0x6')](_0x34f8('0x29'),_0x121de7['uniqueid']),_0x121de7);utils[_0x34f8('0x5')](util[_0x34f8('0x6')]('[%s][members][agentcomplete]\x20interface:%s\x20queue:%s',_0x121de7[_0x34f8('0x8')],_0x121de7['interface'],_0x121de7['queue']));members[_0x121de7[_0x34f8('0x9')]]=_['assign'](members[_0x121de7[_0x34f8('0x9')]],{'data4':_0x121de7[_0x34f8('0x2a')],'uniqueid':_0x121de7[_0x34f8('0x8')]});}}catch(_0x4ad59b){utils['error'](util[_0x34f8('0x6')](_0x34f8('0x29'),_0x121de7['uniqueid']),_0x4ad59b);}};exports[_0x34f8('0x2b')]=function(_0x58d39f){try{utils[_0x34f8('0x19')](util['format'](_0x34f8('0x2c'),_0x58d39f['uniqueid']),_0x58d39f);if(_0x58d39f[_0x34f8('0xa')]){var _0x373c51=_0x58d39f['channel']['split']('-')[0x0];if(!_['isNil'](members[_0x373c51])){members[_0x373c51]=_[_0x34f8('0x2d')](members[_0x373c51],{'data1':members[_0x373c51][_0x34f8('0x2e')]||_0x58d39f[_0x34f8('0xc')],'data2':members[_0x373c51][_0x34f8('0x2f')]||_0x58d39f[_0x34f8('0x30')],'data3':members[_0x373c51][_0x34f8('0x31')]||_0x58d39f[_0x34f8('0x32')],'uniqueid':members[_0x373c51][_0x34f8('0x8')]||_0x58d39f['uniqueid']});utils[_0x34f8('0x5')](util['format'](_0x34f8('0x33'),_0x58d39f[_0x34f8('0x8')],members[_0x373c51]['data1'],members[_0x373c51][_0x34f8('0x2f')],members[_0x373c51][_0x34f8('0x31')]));if(members[_0x373c51][_0x34f8('0x22')]){writeDB(members[_0x373c51]);}}}if(_0x58d39f[_0x34f8('0x34')]){var _0x848ffd=_0x58d39f[_0x34f8('0x34')][_0x34f8('0x14')]('-')[0x0];if(!_['isNil'](members[_0x848ffd])){members[_0x848ffd]=_['assign'](members[_0x848ffd],{'data1':members[_0x848ffd][_0x34f8('0x2e')]||_0x58d39f['type'],'data2':members[_0x848ffd]['data2']||_0x58d39f['source'],'data3':members[_0x848ffd][_0x34f8('0x31')]||_0x58d39f[_0x34f8('0x32')],'uniqueid':members[_0x848ffd][_0x34f8('0x8')]||_0x58d39f[_0x34f8('0x8')]});utils['info'](util[_0x34f8('0x6')](_0x34f8('0x33'),_0x58d39f[_0x34f8('0x8')],members[_0x848ffd]['data1'],members[_0x848ffd][_0x34f8('0x2f')],members[_0x848ffd]['data3']));if(members[_0x848ffd][_0x34f8('0x22')]){writeDB(members[_0x848ffd]);}}}}catch(_0x49328b){utils[_0x34f8('0x26')](util[_0x34f8('0x6')](_0x34f8('0x2c'),_0x58d39f['uniqueid']),_0x49328b);}}; \ No newline at end of file +var _0xabe7=['TALKING','agent','NOT_INUSE','exitAt','now','duration','diffTime','enterAt','error','[%s][members][devicestatechange]','agentcomplete','isNil','[%s][members][agentcomplete]','[%s][members][agentcomplete]\x20interface:%s\x20queue:%s','queue','assign','cdr','source','data3','destination','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','destinationchannel','data1','[%s][members][cdr]','lodash','util','./utils','Queue:','info','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','uniqueid','channel','data2','type','interface','getUserByInterface','membername','name','internal','request','CreateMemberReport','split','format','[%s][members][writeDB]','startsWith','debug','[%s][members][devicestatechange]\x20state:%s\x20interface:%s','device','state','BUSY','voice'];(function(_0x576ae4,_0x45dc6b){var _0xed31de=function(_0x31d0cb){while(--_0x31d0cb){_0x576ae4['push'](_0x576ae4['shift']());}};_0xed31de(++_0x45dc6b);}(_0xabe7,0x1b0));var _0x7abe=function(_0xe73448,_0x287d3c){_0xe73448=_0xe73448-0x0;var _0x31a351=_0xabe7[_0xe73448];return _0x31a351;};'use strict';var _=require(_0x7abe('0x0'));var util=require(_0x7abe('0x1'));var utils=require(_0x7abe('0x2'));var members={};var exclude=['Local/_attended@transfer',_0x7abe('0x3')];function writeDB(_0x26dc8a){utils[_0x7abe('0x4')](util['format'](_0x7abe('0x5'),_0x26dc8a[_0x7abe('0x6')],_0x26dc8a['interface'],_0x26dc8a[_0x7abe('0x7')],_0x26dc8a[_0x7abe('0x8')],_0x26dc8a['membername'],_0x26dc8a[_0x7abe('0x9')]));if(_0x26dc8a[_0x7abe('0xa')]){utils[_0x7abe('0xb')](_0x26dc8a[_0x7abe('0xa')])['then'](function(_0x4ecd16){if(_0x4ecd16){_0x26dc8a[_0x7abe('0xc')]=_0x4ecd16[_0x7abe('0xd')];_0x26dc8a[_0x7abe('0xe')]=_0x4ecd16[_0x7abe('0xe')];utils[_0x7abe('0xf')](_0x7abe('0x10'),_0x26dc8a);}else{utils['getUserByName'](_0x26dc8a['interface'][_0x7abe('0x11')]('/')[0x1])['then'](function(_0x19e66d){if(_0x19e66d){_0x26dc8a[_0x7abe('0xc')]=_0x19e66d['name'];_0x26dc8a[_0x7abe('0xe')]=_0x19e66d[_0x7abe('0xe')];utils['request']('CreateMemberReport',_0x26dc8a);}});}})['catch'](function(_0x3ffde2){utils['error'](util[_0x7abe('0x12')](_0x7abe('0x13'),_0x26dc8a[_0x7abe('0x6')]),_0x3ffde2);});}delete members[_0x26dc8a[_0x7abe('0xa')]];}function startsWith(_0x4738a2,_0xcd4c2c){return _['some'](_0x4738a2,function(_0x4fe2f4){return _[_0x7abe('0x14')](_0xcd4c2c,_0x4fe2f4);});}exports['devicestatechange']=function(_0x35929f){try{utils[_0x7abe('0x15')](util['format']('[%s][members][devicestatechange]',members[_0x35929f['device']]?members[_0x35929f['device']][_0x7abe('0x6')]:_0x35929f['device']),_0x35929f);utils[_0x7abe('0x4')](util[_0x7abe('0x12')](_0x7abe('0x16'),members[_0x35929f[_0x7abe('0x17')]]?members[_0x35929f[_0x7abe('0x17')]][_0x7abe('0x6')]:_0x35929f['device'],_0x35929f[_0x7abe('0x18')],_0x35929f['device']));switch(_0x35929f[_0x7abe('0x18')]){case'INUSE':case _0x7abe('0x19'):if(!startsWith(exclude,_0x35929f[_0x7abe('0x17')])){members[_0x35929f[_0x7abe('0x17')]]={'channel':_0x7abe('0x1a'),'interface':_0x35929f[_0x7abe('0x17')],'type':_0x7abe('0x1b'),'enterAt':utils['now'](),'role':_0x7abe('0x1c')};}break;case _0x7abe('0x1d'):if(!_['isNil'](members[_0x35929f[_0x7abe('0x17')]])){members[_0x35929f[_0x7abe('0x17')]][_0x7abe('0x1e')]=utils[_0x7abe('0x1f')]();members[_0x35929f[_0x7abe('0x17')]][_0x7abe('0x20')]=utils[_0x7abe('0x21')](members[_0x35929f[_0x7abe('0x17')]]['exitAt'],members[_0x35929f['device']][_0x7abe('0x22')]);if(members[_0x35929f['device']]['uniqueid']){writeDB(members[_0x35929f['device']]);}}break;default:break;}}catch(_0x2339a4){utils[_0x7abe('0x23')](util[_0x7abe('0x12')](_0x7abe('0x24'),members[_0x35929f[_0x7abe('0x17')]]?members[_0x35929f[_0x7abe('0x17')]][_0x7abe('0x6')]:_0x35929f[_0x7abe('0x17')]),_0x2339a4);}};exports[_0x7abe('0x25')]=function(_0x14db57){try{if(!_[_0x7abe('0x26')](members[_0x14db57[_0x7abe('0xa')]])){utils[_0x7abe('0x15')](util[_0x7abe('0x12')](_0x7abe('0x27'),_0x14db57[_0x7abe('0x6')]),_0x14db57);utils[_0x7abe('0x4')](util['format'](_0x7abe('0x28'),_0x14db57[_0x7abe('0x6')],_0x14db57[_0x7abe('0xa')],_0x14db57[_0x7abe('0x29')]));members[_0x14db57[_0x7abe('0xa')]]=_[_0x7abe('0x2a')](members[_0x14db57[_0x7abe('0xa')]],{'data4':_0x14db57[_0x7abe('0x29')],'uniqueid':_0x14db57[_0x7abe('0x6')]});}}catch(_0x592cbe){utils[_0x7abe('0x23')](util[_0x7abe('0x12')](_0x7abe('0x27'),_0x14db57[_0x7abe('0x6')]),_0x592cbe);}};exports[_0x7abe('0x2b')]=function(_0x54a30e){try{utils[_0x7abe('0x15')](util[_0x7abe('0x12')]('[%s][members][cdr]',_0x54a30e[_0x7abe('0x6')]),_0x54a30e);if(_0x54a30e[_0x7abe('0x7')]){var _0x122807=_0x54a30e[_0x7abe('0x7')]['split']('-')[0x0];if(!_[_0x7abe('0x26')](members[_0x122807])){members[_0x122807]=_[_0x7abe('0x2a')](members[_0x122807],{'data1':members[_0x122807]['data1']||_0x54a30e[_0x7abe('0x9')],'data2':members[_0x122807][_0x7abe('0x8')]||_0x54a30e[_0x7abe('0x2c')],'data3':members[_0x122807][_0x7abe('0x2d')]||_0x54a30e[_0x7abe('0x2e')],'uniqueid':members[_0x122807][_0x7abe('0x6')]||_0x54a30e[_0x7abe('0x6')]});utils[_0x7abe('0x4')](util[_0x7abe('0x12')](_0x7abe('0x2f'),_0x54a30e[_0x7abe('0x6')],members[_0x122807]['data1'],members[_0x122807][_0x7abe('0x8')],members[_0x122807]['data3']));if(members[_0x122807][_0x7abe('0x1e')]){writeDB(members[_0x122807]);}}}if(_0x54a30e[_0x7abe('0x30')]){var _0x30fdf3=_0x54a30e[_0x7abe('0x30')][_0x7abe('0x11')]('-')[0x0];if(!_[_0x7abe('0x26')](members[_0x30fdf3])){members[_0x30fdf3]=_[_0x7abe('0x2a')](members[_0x30fdf3],{'data1':members[_0x30fdf3]['data1']||_0x54a30e[_0x7abe('0x9')],'data2':members[_0x30fdf3]['data2']||_0x54a30e[_0x7abe('0x2c')],'data3':members[_0x30fdf3][_0x7abe('0x2d')]||_0x54a30e[_0x7abe('0x2e')],'uniqueid':members[_0x30fdf3][_0x7abe('0x6')]||_0x54a30e[_0x7abe('0x6')]});utils['info'](util[_0x7abe('0x12')](_0x7abe('0x2f'),_0x54a30e[_0x7abe('0x6')],members[_0x30fdf3][_0x7abe('0x31')],members[_0x30fdf3][_0x7abe('0x8')],members[_0x30fdf3]['data3']));if(members[_0x30fdf3][_0x7abe('0x1e')]){writeDB(members[_0x30fdf3]);}}}}catch(_0x1c85a1){utils[_0x7abe('0x23')](util[_0x7abe('0x12')](_0x7abe('0x32'),_0x54a30e[_0x7abe('0x6')]),_0x1c85a1);}}; \ No newline at end of file diff --git a/server/services/xdr/queues.controller.js b/server/services/xdr/queues.controller.js index 45d3623..bf9355f 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 _0x0194=['queuecallerleaveAt','holdtime','queuecallerjoinAt','count','[%s][queues][agentconnect]','membername','assigned','agentcomplete','[%s][queues][agentcomplete]','queuecallercomplete','transfer','TRANSFER','reason','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','transfereeuniqueid','[%s][queues][blindtransfer]','transfertype','BLIND','transferexten','extension','transferuniqueid','BLINDTRANSFER','[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER','attendedtransfer','origtransfereruniqueid','origtransfererlinkedid','secondtransfererlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','ATTENDED','transfereelinkedid','queuecallerenterreason','clone','calleridname','mohtime','calleridnum','secondtransfereruniqueid','secondtransfererexten','ATTENDEDTRANSFER','transfertargetlinkedid','transfertargetuniqueid','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][attendedtransfer]','musiconholdstart','[%s][queues][musiconholdstart]','musiconholdstartAt','[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s','[%s][queues][musiconholdstop]','diffTime','lodash','./utils','info','format','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','channel','queue','lastAssignedTo','accountcode','queuecallerexitreason','getVoiceQueueByName','then','type','request','CreateVoiceQueueReport','transfereduniqueid','queuecallerjoin','debug','[%s][queues][queuecallerjoin]','uniqueid','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','position','assign','now','error','hangup','[%s][queues][hangup]','queuecallerabandon','queuecallerexit','queuecallercompleteAt','COMPLETEDBYAGENT','name','varset','[%s][queues][varset]','isNil','variable','queuestatus','value','toUpperCase','CONTINUE','[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s','queuecallerabandonAt','queuecallerexitAt','EXITWITHKEY','[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s','[%s][queues][queuecallerabandon]','[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s','[%s][queues][queuecallerleave]','[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s','connectedlinenum','connectedlinename','queuecallerleave'];(function(_0x55c041,_0xa476a9){var _0x1ebef3=function(_0x358406){while(--_0x358406){_0x55c041['push'](_0x55c041['shift']());}};_0x1ebef3(++_0xa476a9);}(_0x0194,0x94));var _0x4019=function(_0x54d87e,_0x36c9f0){_0x54d87e=_0x54d87e-0x0;var _0x2f2410=_0x0194[_0x54d87e];return _0x2f2410;};'use strict';var _=require(_0x4019('0x0'));var util=require('util');var utils=require(_0x4019('0x1'));var queues={};function writeDB(_0x2aeb7d){utils[_0x4019('0x2')](util[_0x4019('0x3')](_0x4019('0x4'),_0x2aeb7d['uniqueid'],_0x2aeb7d[_0x4019('0x5')],_0x2aeb7d[_0x4019('0x6')],_0x2aeb7d[_0x4019('0x7')],_0x2aeb7d['calleridnum'],_0x2aeb7d[_0x4019('0x8')],_0x2aeb7d[_0x4019('0x9')]));if(_0x2aeb7d[_0x4019('0x6')]){utils[_0x4019('0xa')](_0x2aeb7d['queue'])[_0x4019('0xb')](function(_0x5c6561){if(_0x5c6561){_0x2aeb7d[_0x4019('0xc')]=_0x5c6561[_0x4019('0xc')];}utils[_0x4019('0xd')]('CreateVoiceQueueReport',_0x2aeb7d);});}else{utils[_0x4019('0xd')](_0x4019('0xe'),_0x2aeb7d);}if(_0x2aeb7d[_0x4019('0xf')]){delete queues[_0x2aeb7d[_0x4019('0xf')]];}else{delete queues[_0x2aeb7d['uniqueid']];}}exports[_0x4019('0x10')]=function(_0x521d63){try{utils[_0x4019('0x11')](util[_0x4019('0x3')](_0x4019('0x12'),_0x521d63[_0x4019('0x13')]),_0x521d63);utils['info'](util['format'](_0x4019('0x14'),_0x521d63[_0x4019('0x13')],_0x521d63[_0x4019('0x6')],_0x521d63[_0x4019('0x15')]));queues[_0x521d63[_0x4019('0x13')]]=_[_0x4019('0x16')](_0x521d63,{'originalposition':_0x521d63[_0x4019('0x15')],'queuecallerjoinAt':utils[_0x4019('0x17')](),'mohtime':0x0});}catch(_0x12c399){utils[_0x4019('0x18')](util['format']('[%s][queues][queuecallerjoin]',_0x521d63['uniqueid']),_0x12c399);}};exports[_0x4019('0x19')]=function(_0x33b5c5){try{if(!_['isNil'](queues[_0x33b5c5[_0x4019('0x13')]])){utils[_0x4019('0x11')](util[_0x4019('0x3')](_0x4019('0x1a'),_0x33b5c5['uniqueid']),_0x33b5c5);if(queues[_0x33b5c5['uniqueid']]['queuecallerleaveAt']){if(!queues[_0x33b5c5[_0x4019('0x13')]][_0x4019('0x1b')]&&!queues[_0x33b5c5[_0x4019('0x13')]][_0x4019('0x1c')]){queues[_0x33b5c5[_0x4019('0x13')]]['queuecallercomplete']=!![];queues[_0x33b5c5['uniqueid']][_0x4019('0x1d')]=utils[_0x4019('0x17')]();queues[_0x33b5c5[_0x4019('0x13')]]['queuecallerexitreason']=_0x4019('0x1e');}utils[_0x4019('0x2')](util['format']('[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s',_0x33b5c5['uniqueid'],queues[_0x33b5c5['uniqueid']]['name'],queues[_0x33b5c5[_0x4019('0x13')]][_0x4019('0x9')]));writeDB(queues[_0x33b5c5[_0x4019('0x13')]]);}else if(queues[_0x33b5c5[_0x4019('0x13')]][_0x4019('0xf')]){utils['info'](util[_0x4019('0x3')]('[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s',_0x33b5c5['uniqueid'],queues[_0x33b5c5[_0x4019('0x13')]][_0x4019('0x1f')],queues[_0x33b5c5['uniqueid']]['transfereduniqueid']));queues[queues[_0x33b5c5['uniqueid']][_0x4019('0xf')]]=queues[_0x33b5c5['uniqueid']];queues[queues[_0x33b5c5[_0x4019('0x13')]]['transfereduniqueid']]['queuecallerenterreason']=0x2;delete queues[_0x33b5c5['uniqueid']];}}}catch(_0x5adc35){utils[_0x4019('0x18')](util[_0x4019('0x3')](_0x4019('0x1a'),_0x33b5c5[_0x4019('0x13')]),_0x5adc35);}};exports[_0x4019('0x20')]=function(_0x84fb9a){try{utils['debug'](util[_0x4019('0x3')](_0x4019('0x21'),_0x84fb9a[_0x4019('0x13')]),_0x84fb9a);if(!_[_0x4019('0x22')](_0x84fb9a[_0x4019('0x23')][_0x4019('0x24')])&&_0x84fb9a[_0x4019('0x25')][_0x4019('0x26')]()!==_0x4019('0x27')){if(!_[_0x4019('0x22')](queues[_0x84fb9a['uniqueid']])){queues[_0x84fb9a[_0x4019('0x13')]][_0x4019('0x1b')]=![];queues[_0x84fb9a[_0x4019('0x13')]]['queuecallerabandonAt']=null;queues[_0x84fb9a[_0x4019('0x13')]][_0x4019('0x1c')]=!![];queues[_0x84fb9a[_0x4019('0x13')]]['queuecallerexitAt']=utils['now']();queues[_0x84fb9a[_0x4019('0x13')]]['queuecallerexitreason']=_0x84fb9a[_0x4019('0x25')][_0x4019('0x26')]();utils[_0x4019('0x2')](util[_0x4019('0x3')](_0x4019('0x28'),_0x84fb9a[_0x4019('0x13')],queues[_0x84fb9a[_0x4019('0x13')]][_0x4019('0x1f')],_0x84fb9a[_0x4019('0x25')],queues[_0x84fb9a[_0x4019('0x13')]][_0x4019('0x9')]));writeDB(queues[_0x84fb9a[_0x4019('0x13')]]);}}else if(!_['isNil'](_0x84fb9a['variable']['queueposition'])){if(!_['isNil'](queues[_0x84fb9a[_0x4019('0x13')]])&&!queues[_0x84fb9a[_0x4019('0x13')]][_0x4019('0x1b')]){queues[_0x84fb9a[_0x4019('0x13')]]['queuecallerabandon']=![];queues[_0x84fb9a[_0x4019('0x13')]][_0x4019('0x29')]=null;queues[_0x84fb9a[_0x4019('0x13')]][_0x4019('0x1c')]=!![];queues[_0x84fb9a[_0x4019('0x13')]][_0x4019('0x2a')]=utils['now']();queues[_0x84fb9a[_0x4019('0x13')]][_0x4019('0x9')]=_0x4019('0x2b');utils[_0x4019('0x2')](util[_0x4019('0x3')](_0x4019('0x2c'),_0x84fb9a[_0x4019('0x13')],queues[_0x84fb9a['uniqueid']][_0x4019('0x1f')],_0x84fb9a['value'],queues[_0x84fb9a[_0x4019('0x13')]]['queuecallerexitreason']));}}}catch(_0x2ec7c6){utils[_0x4019('0x18')](util[_0x4019('0x3')](_0x4019('0x21'),_0x84fb9a[_0x4019('0x13')]),_0x2ec7c6);}};exports[_0x4019('0x1b')]=function(_0x27a677){try{if(!_[_0x4019('0x22')](queues[_0x27a677[_0x4019('0x13')]])){utils[_0x4019('0x11')](util['format'](_0x4019('0x2d'),_0x27a677[_0x4019('0x13')]),_0x27a677);queues[_0x27a677[_0x4019('0x13')]][_0x4019('0x1c')]=![];queues[_0x27a677[_0x4019('0x13')]]['queuecallerexitAt']=null;queues[_0x27a677[_0x4019('0x13')]]['queuecallerabandon']=!![];queues[_0x27a677[_0x4019('0x13')]][_0x4019('0x29')]=utils['now']();queues[_0x27a677[_0x4019('0x13')]]['queuecallerexitreason']='ABANDONED';utils[_0x4019('0x2')](util['format'](_0x4019('0x2e'),_0x27a677[_0x4019('0x13')],queues[_0x27a677[_0x4019('0x13')]][_0x4019('0x1f')],queues[_0x27a677['uniqueid']]['queuecallerexitreason']));}}catch(_0x362dfe){utils['error'](util[_0x4019('0x3')]('[%s][queues][queuecallerabandon]',_0x27a677[_0x4019('0x13')]),_0x362dfe);}};exports['queuecallerleave']=function(_0x4bdfd8){try{if(!_[_0x4019('0x22')](queues[_0x4bdfd8['uniqueid']])){utils[_0x4019('0x11')](util['format'](_0x4019('0x2f'),_0x4bdfd8[_0x4019('0x13')]),_0x4bdfd8);utils[_0x4019('0x2')](util[_0x4019('0x3')](_0x4019('0x30'),_0x4bdfd8[_0x4019('0x13')],queues[_0x4bdfd8[_0x4019('0x13')]][_0x4019('0x1f')],_0x4bdfd8[_0x4019('0x31')],_0x4bdfd8[_0x4019('0x32')]));queues[_0x4bdfd8[_0x4019('0x13')]][_0x4019('0x33')]=!![];queues[_0x4bdfd8[_0x4019('0x13')]][_0x4019('0x34')]=utils[_0x4019('0x17')]();queues[_0x4bdfd8[_0x4019('0x13')]][_0x4019('0x35')]=utils['diffTime'](queues[_0x4bdfd8[_0x4019('0x13')]]['queuecallerleaveAt'],queues[_0x4bdfd8[_0x4019('0x13')]][_0x4019('0x36')]);queues[_0x4bdfd8[_0x4019('0x13')]]['position']=_0x4bdfd8[_0x4019('0x15')];queues[_0x4bdfd8[_0x4019('0x13')]][_0x4019('0x37')]=_0x4bdfd8[_0x4019('0x37')];queues[_0x4bdfd8[_0x4019('0x13')]][_0x4019('0x31')]=_0x4bdfd8[_0x4019('0x31')];queues[_0x4bdfd8[_0x4019('0x13')]][_0x4019('0x32')]=_0x4bdfd8['connectedlinename'];}}catch(_0x2d927a){utils[_0x4019('0x18')](util[_0x4019('0x3')](_0x4019('0x2f'),_0x4bdfd8[_0x4019('0x13')]),_0x2d927a);}};exports['agentconnect']=function(_0x4e1c3b){try{if(!_[_0x4019('0x22')](queues[_0x4e1c3b[_0x4019('0x13')]])){utils[_0x4019('0x11')](util[_0x4019('0x3')](_0x4019('0x38'),_0x4e1c3b[_0x4019('0x13')]),_0x4e1c3b);utils[_0x4019('0x2')](util[_0x4019('0x3')]('[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s',_0x4e1c3b['uniqueid'],queues[_0x4e1c3b[_0x4019('0x13')]][_0x4019('0x1f')],_0x4e1c3b[_0x4019('0x39')],_0x4e1c3b['destaccountcode']));queues[_0x4e1c3b[_0x4019('0x13')]][_0x4019('0x1b')]=![];queues[_0x4e1c3b[_0x4019('0x13')]]['queuecallerabandon']=![];queues[_0x4e1c3b[_0x4019('0x13')]]['queuecallerabandonAt']=null;queues[_0x4e1c3b[_0x4019('0x13')]][_0x4019('0x1c')]=![];queues[_0x4e1c3b[_0x4019('0x13')]]['queuecallerexitreason']=null;queues[_0x4e1c3b[_0x4019('0x13')]][_0x4019('0x2a')]=null;queues[_0x4e1c3b[_0x4019('0x13')]][_0x4019('0x3a')]=!![];queues[_0x4e1c3b[_0x4019('0x13')]][_0x4019('0x8')]=_0x4e1c3b['destaccountcode'];queues[_0x4e1c3b['uniqueid']][_0x4019('0x7')]=_0x4e1c3b[_0x4019('0x39')];}}catch(_0xc8b9e){utils[_0x4019('0x18')](util['format'](_0x4019('0x38'),_0x4e1c3b[_0x4019('0x13')]),_0xc8b9e);}};exports[_0x4019('0x3b')]=function(_0x26f14e){try{if(!_[_0x4019('0x22')](queues[_0x26f14e[_0x4019('0x13')]])){if(queues[_0x26f14e[_0x4019('0x13')]]['queuecallerleaveAt']){utils[_0x4019('0x11')](util[_0x4019('0x3')](_0x4019('0x3c'),_0x26f14e[_0x4019('0x13')]),_0x26f14e);queues[_0x26f14e[_0x4019('0x13')]][_0x4019('0x1b')]=![];queues[_0x26f14e[_0x4019('0x13')]][_0x4019('0x1b')]=![];queues[_0x26f14e[_0x4019('0x13')]][_0x4019('0x29')]=null;queues[_0x26f14e[_0x4019('0x13')]][_0x4019('0x1c')]=![];queues[_0x26f14e['uniqueid']][_0x4019('0x2a')]=null;queues[_0x26f14e[_0x4019('0x13')]][_0x4019('0x3a')]=!![];queues[_0x26f14e[_0x4019('0x13')]][_0x4019('0x7')]=_0x26f14e[_0x4019('0x39')];queues[_0x26f14e['uniqueid']][_0x4019('0x3d')]=!![];queues[_0x26f14e['uniqueid']]['queuecallercompleteAt']=utils['now']();if(_0x26f14e['reason']==_0x4019('0x3e')){if(!queues[_0x26f14e[_0x4019('0x13')]][_0x4019('0x3e')]){queues[_0x26f14e[_0x4019('0x13')]][_0x4019('0x9')]=_0x4019('0x3f');}}else{queues[_0x26f14e[_0x4019('0x13')]][_0x4019('0x9')]='COMPLETEDBY'+_0x26f14e[_0x4019('0x40')][_0x4019('0x26')]();}utils[_0x4019('0x2')](util[_0x4019('0x3')](_0x4019('0x41'),_0x26f14e['uniqueid'],queues[_0x26f14e[_0x4019('0x13')]]['name'],_0x26f14e[_0x4019('0x39')],queues[_0x26f14e[_0x4019('0x13')]][_0x4019('0x9')]));writeDB(queues[_0x26f14e[_0x4019('0x13')]]);}}}catch(_0xdde9f){utils[_0x4019('0x18')](util['format'](_0x4019('0x3c'),_0x26f14e['uniqueid']),_0xdde9f);}};exports['blindtransfer']=function(_0x40dd9b){try{if(!_[_0x4019('0x22')](queues[_0x40dd9b[_0x4019('0x42')]])){utils[_0x4019('0x11')](util[_0x4019('0x3')](_0x4019('0x43'),_0x40dd9b['uniqueid']),_0x40dd9b);queues[_0x40dd9b[_0x4019('0x42')]]['transfer']=!![];queues[_0x40dd9b[_0x4019('0x42')]][_0x4019('0x44')]=_0x4019('0x45');queues[_0x40dd9b[_0x4019('0x42')]][_0x4019('0x46')]=_0x40dd9b[_0x4019('0x47')];queues[_0x40dd9b['transfereeuniqueid']][_0x4019('0x48')]=_0x40dd9b[_0x4019('0x42')];queues[_0x40dd9b[_0x4019('0x42')]]['queuecallerexitreason']=_0x4019('0x49');utils[_0x4019('0x2')](util[_0x4019('0x3')](_0x4019('0x4a'),_0x40dd9b['uniqueid'],queues[_0x40dd9b['transfereeuniqueid']][_0x4019('0x1f')],_0x40dd9b['transfereeuniqueid'],_0x40dd9b['extension']));}}catch(_0x480d78){utils['error'](util[_0x4019('0x3')]('[%s][queues][blindtransfer]',_0x40dd9b[_0x4019('0x13')]),_0x480d78);}};exports[_0x4019('0x4b')]=function(_0xcf05a2){try{utils[_0x4019('0x11')](util[_0x4019('0x3')]('[%s][queues][attendedtransfer]',_0xcf05a2[_0x4019('0x4c')]),_0xcf05a2);if(_0xcf05a2[_0x4019('0x4c')]==_0xcf05a2[_0x4019('0x4d')]){if(!_[_0x4019('0x22')](queues[_0xcf05a2[_0x4019('0x4e')]])){utils['info'](util[_0x4019('0x3')](_0x4019('0x4f'),_0xcf05a2[_0x4019('0x4c')],queues[_0xcf05a2[_0x4019('0x4e')]][_0x4019('0x1f')],_0xcf05a2['origtransfererexten']));queues[_0xcf05a2[_0x4019('0x4e')]][_0x4019('0x3e')]=!![];queues[_0xcf05a2['secondtransfererlinkedid']]['transfertype']=_0x4019('0x50');queues[_0xcf05a2[_0x4019('0x4e')]][_0x4019('0x46')]=_0xcf05a2['origtransfererexten'];queues[_0xcf05a2[_0x4019('0x4e')]][_0x4019('0x48')]=_0xcf05a2[_0x4019('0x4c')];queues[_0xcf05a2[_0x4019('0x4e')]]['queuecallerexitreason']='ATTENDEDTRANSFER';}if(!_[_0x4019('0x22')](queues[_0xcf05a2[_0x4019('0x4d')]])){if(_0xcf05a2['transfereelinkedid']&&queues[_0xcf05a2[_0x4019('0x51')]]){queues[_0xcf05a2[_0x4019('0x51')]][_0x4019('0x52')]=0x1;queues[_0xcf05a2[_0x4019('0x42')]]=_[_0x4019('0x53')](queues[_0xcf05a2[_0x4019('0x51')]]);queues[_0xcf05a2['transfereeuniqueid']][_0x4019('0xf')]=_0xcf05a2['transfertargetuniqueid'];queues[_0xcf05a2[_0x4019('0x42')]][_0x4019('0x52')]=0x2;queues[_0xcf05a2['transfereeuniqueid']]['calleridnum']=queues[_0xcf05a2[_0x4019('0x4e')]]['calleridnum'];queues[_0xcf05a2['transfereeuniqueid']][_0x4019('0x54')]=queues[_0xcf05a2[_0x4019('0x4e')]][_0x4019('0x54')];queues[_0xcf05a2[_0x4019('0x42')]][_0x4019('0x36')]=utils[_0x4019('0x17')]();queues[_0xcf05a2['transfereeuniqueid']][_0x4019('0x34')]=utils['now']();queues[_0xcf05a2['transfereeuniqueid']][_0x4019('0x35')]=0x0;queues[_0xcf05a2[_0x4019('0x42')]][_0x4019('0x55')]=0x0;utils[_0x4019('0x2')](util['format']('[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s',_0xcf05a2[_0x4019('0x4c')],queues[_0xcf05a2[_0x4019('0x42')]][_0x4019('0x1f')],queues[_0xcf05a2['transfereeuniqueid']][_0x4019('0x56')],queues[_0xcf05a2[_0x4019('0x42')]][_0x4019('0x54')]));}else{utils[_0x4019('0x2')](util[_0x4019('0x3')]('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s',_0xcf05a2[_0x4019('0x4c')],queues[_0xcf05a2['origtransfererlinkedid']]['name'],_0xcf05a2[_0x4019('0x4e')]));queues[_0xcf05a2[_0x4019('0x4d')]][_0x4019('0xf')]=_0xcf05a2['secondtransfererlinkedid'];}}}else if(_0xcf05a2['secondtransfereruniqueid']==_0xcf05a2[_0x4019('0x4e')]){if(!_[_0x4019('0x22')](queues[_0xcf05a2[_0x4019('0x4d')]])){utils['info'](util['format']('[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER',_0xcf05a2[_0x4019('0x4c')],queues[_0xcf05a2[_0x4019('0x4d')]][_0x4019('0x1f')],_0xcf05a2[_0x4019('0x57')],_0xcf05a2[_0x4019('0x58')]));queues[_0xcf05a2['origtransfererlinkedid']][_0x4019('0x3e')]=!![];queues[_0xcf05a2[_0x4019('0x4d')]][_0x4019('0x44')]=_0x4019('0x50');queues[_0xcf05a2[_0x4019('0x4d')]][_0x4019('0x46')]=_0xcf05a2['secondtransfererexten'];queues[_0xcf05a2[_0x4019('0x4d')]][_0x4019('0x48')]=_0xcf05a2[_0x4019('0x57')];queues[_0xcf05a2[_0x4019('0x4d')]][_0x4019('0x9')]=_0x4019('0x59');}if(!_['isNil'](queues[_0xcf05a2[_0x4019('0x4e')]])){if(_0xcf05a2['transfertargetlinkedid']&&queues[_0xcf05a2[_0x4019('0x5a')]]){queues[_0xcf05a2['transfertargetlinkedid']][_0x4019('0x52')]=0x1;queues[_0xcf05a2['transfertargetuniqueid']]=_['clone'](queues[_0xcf05a2[_0x4019('0x5a')]]);queues[_0xcf05a2[_0x4019('0x5b')]][_0x4019('0xf')]=_0xcf05a2[_0x4019('0x5b')];queues[_0xcf05a2['transfertargetuniqueid']][_0x4019('0x52')]=0x2;queues[_0xcf05a2[_0x4019('0x5b')]][_0x4019('0x56')]=queues[_0xcf05a2[_0x4019('0x4d')]][_0x4019('0x56')];queues[_0xcf05a2[_0x4019('0x5b')]][_0x4019('0x54')]=queues[_0xcf05a2[_0x4019('0x4d')]][_0x4019('0x54')];queues[_0xcf05a2[_0x4019('0x5b')]][_0x4019('0x36')]=utils['now']();queues[_0xcf05a2[_0x4019('0x5b')]]['queuecallerleaveAt']=utils[_0x4019('0x17')]();queues[_0xcf05a2[_0x4019('0x5b')]][_0x4019('0x35')]=0x0;queues[_0xcf05a2[_0x4019('0x5b')]]['mohtime']=0x0;utils[_0x4019('0x2')](util[_0x4019('0x3')](_0x4019('0x5c'),_0xcf05a2['origtransfereruniqueid'],queues[_0xcf05a2['transfertargetuniqueid']]['name'],queues[_0xcf05a2[_0x4019('0x5b')]][_0x4019('0xf')],queues[_0xcf05a2[_0x4019('0x5b')]][_0x4019('0x56')],queues[_0xcf05a2[_0x4019('0x5b')]]['calleridname']));}else{utils[_0x4019('0x2')](util[_0x4019('0x3')]('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s',_0xcf05a2[_0x4019('0x4c')],queues[_0xcf05a2[_0x4019('0x4e')]]['name'],_0xcf05a2[_0x4019('0x4d')]));queues[_0xcf05a2[_0x4019('0x4e')]][_0x4019('0xf')]=_0xcf05a2[_0x4019('0x4d')];}}}}catch(_0x215f2b){utils[_0x4019('0x18')](util[_0x4019('0x3')](_0x4019('0x5d'),_0xcf05a2[_0x4019('0x4c')]),_0x215f2b);}};exports[_0x4019('0x5e')]=function(_0x876470){try{if(!_[_0x4019('0x22')](queues[_0x876470['uniqueid']])){utils['debug'](util['format'](_0x4019('0x5f'),_0x876470['uniqueid']),_0x876470);queues[_0x876470[_0x4019('0x13')]][_0x4019('0x60')]=utils[_0x4019('0x17')]();utils['info'](util['format'](_0x4019('0x61'),_0x876470[_0x4019('0x13')],queues[_0x876470[_0x4019('0x13')]][_0x4019('0x1f')],queues[_0x876470['uniqueid']][_0x4019('0x60')]));}}catch(_0x15bc04){utils[_0x4019('0x18')](util[_0x4019('0x3')](_0x4019('0x5f'),_0x876470['uniqueid']),_0x15bc04);}};exports['musiconholdstop']=function(_0x410629){try{if(!_[_0x4019('0x22')](queues[_0x410629[_0x4019('0x13')]])){if(!_[_0x4019('0x22')](queues[_0x410629['uniqueid']][_0x4019('0x60')])){utils[_0x4019('0x11')](util[_0x4019('0x3')](_0x4019('0x62'),_0x410629['uniqueid']),_0x410629);queues[_0x410629[_0x4019('0x13')]][_0x4019('0x55')]+=utils[_0x4019('0x63')](utils[_0x4019('0x17')](),queues[_0x410629[_0x4019('0x13')]][_0x4019('0x60')]);utils['info'](util['format']('[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s',_0x410629[_0x4019('0x13')],queues[_0x410629['uniqueid']][_0x4019('0x1f')],queues[_0x410629[_0x4019('0x13')]][_0x4019('0x55')]));delete queues[_0x410629['uniqueid']][_0x4019('0x60')];}}}catch(_0x5d7232){utils['error'](util['format'](_0x4019('0x62'),_0x410629[_0x4019('0x13')]),_0x5d7232);}}; \ No newline at end of file +var _0x8b84=['COMPLETEDBY','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','blindtransfer','transfereeuniqueid','transfertype','BLIND','[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER','extension','attendedtransfer','[%s][queues][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','secondtransfererlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','origtransfererexten','ATTENDED','transferexten','transferuniqueid','ATTENDEDTRANSFER','transfereelinkedid','clone','calleridname','queuecallerjoinAt','mohtime','calleridnum','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','secondtransfereruniqueid','[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','secondtransfererexten','transfertargetlinkedid','transfertargetuniqueid','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s','musiconholdstart','musiconholdstartAt','[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s','musiconholdstop','[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s','[%s][queues][musiconholdstop]','lodash','info','format','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','channel','queue','lastAssignedTo','queuecallerexitreason','getVoiceQueueByName','type','request','CreateVoiceQueueReport','transfereduniqueid','uniqueid','debug','[%s][queues][queuecallerjoin]','position','now','error','hangup','[%s][queues][hangup]','queuecallerabandon','queuecallerexit','queuecallercomplete','queuecallercompleteAt','COMPLETEDBYAGENT','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s','name','queuecallerenterreason','varset','[%s][queues][varset]','queuestatus','value','isNil','queuecallerabandonAt','queuecallerexitAt','toUpperCase','[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s','variable','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]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s','connectedlinenum','connectedlinename','queuecallerleave','queuecallerleaveAt','holdtime','diffTime','count','[%s][queues][queuecallerleave]','agentconnect','[%s][queues][agentconnect]','membername','assigned','accountcode','destaccountcode','agentcomplete','[%s][queues][agentcomplete]','reason','transfer','TRANSFER'];(function(_0x5891eb,_0x2caffd){var _0x2b08e9=function(_0x980d3c){while(--_0x980d3c){_0x5891eb['push'](_0x5891eb['shift']());}};_0x2b08e9(++_0x2caffd);}(_0x8b84,0x8e));var _0x48b8=function(_0x160c73,_0x2ee678){_0x160c73=_0x160c73-0x0;var _0xd9302=_0x8b84[_0x160c73];return _0xd9302;};'use strict';var _=require(_0x48b8('0x0'));var util=require('util');var utils=require('./utils');var queues={};function writeDB(_0x18f753){utils[_0x48b8('0x1')](util[_0x48b8('0x2')](_0x48b8('0x3'),_0x18f753['uniqueid'],_0x18f753[_0x48b8('0x4')],_0x18f753[_0x48b8('0x5')],_0x18f753[_0x48b8('0x6')],_0x18f753['calleridnum'],_0x18f753['accountcode'],_0x18f753[_0x48b8('0x7')]));if(_0x18f753['queue']){utils[_0x48b8('0x8')](_0x18f753[_0x48b8('0x5')])['then'](function(_0x17ada2){if(_0x17ada2){_0x18f753[_0x48b8('0x9')]=_0x17ada2[_0x48b8('0x9')];}utils[_0x48b8('0xa')](_0x48b8('0xb'),_0x18f753);});}else{utils['request'](_0x48b8('0xb'),_0x18f753);}if(_0x18f753[_0x48b8('0xc')]){delete queues[_0x18f753[_0x48b8('0xc')]];}else{delete queues[_0x18f753[_0x48b8('0xd')]];}}exports['queuecallerjoin']=function(_0x1d356c){try{utils[_0x48b8('0xe')](util['format'](_0x48b8('0xf'),_0x1d356c[_0x48b8('0xd')]),_0x1d356c);utils[_0x48b8('0x1')](util[_0x48b8('0x2')]('[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s',_0x1d356c[_0x48b8('0xd')],_0x1d356c[_0x48b8('0x5')],_0x1d356c['position']));queues[_0x1d356c[_0x48b8('0xd')]]=_['assign'](_0x1d356c,{'originalposition':_0x1d356c[_0x48b8('0x10')],'queuecallerjoinAt':utils[_0x48b8('0x11')](),'mohtime':0x0});}catch(_0x5ca84c){utils[_0x48b8('0x12')](util[_0x48b8('0x2')](_0x48b8('0xf'),_0x1d356c[_0x48b8('0xd')]),_0x5ca84c);}};exports[_0x48b8('0x13')]=function(_0x181f11){try{if(!_['isNil'](queues[_0x181f11[_0x48b8('0xd')]])){utils[_0x48b8('0xe')](util[_0x48b8('0x2')](_0x48b8('0x14'),_0x181f11[_0x48b8('0xd')]),_0x181f11);if(queues[_0x181f11[_0x48b8('0xd')]]['queuecallerleaveAt']){if(!queues[_0x181f11[_0x48b8('0xd')]][_0x48b8('0x15')]&&!queues[_0x181f11[_0x48b8('0xd')]][_0x48b8('0x16')]){queues[_0x181f11[_0x48b8('0xd')]][_0x48b8('0x17')]=!![];queues[_0x181f11['uniqueid']][_0x48b8('0x18')]=utils['now']();queues[_0x181f11['uniqueid']][_0x48b8('0x7')]=_0x48b8('0x19');}utils[_0x48b8('0x1')](util[_0x48b8('0x2')](_0x48b8('0x1a'),_0x181f11[_0x48b8('0xd')],queues[_0x181f11['uniqueid']]['name'],queues[_0x181f11['uniqueid']]['queuecallerexitreason']));writeDB(queues[_0x181f11[_0x48b8('0xd')]]);}else if(queues[_0x181f11[_0x48b8('0xd')]]['transfereduniqueid']){utils['info'](util[_0x48b8('0x2')](_0x48b8('0x1b'),_0x181f11[_0x48b8('0xd')],queues[_0x181f11[_0x48b8('0xd')]][_0x48b8('0x1c')],queues[_0x181f11[_0x48b8('0xd')]][_0x48b8('0xc')]));queues[queues[_0x181f11[_0x48b8('0xd')]][_0x48b8('0xc')]]=queues[_0x181f11[_0x48b8('0xd')]];queues[queues[_0x181f11['uniqueid']]['transfereduniqueid']][_0x48b8('0x1d')]=0x2;delete queues[_0x181f11[_0x48b8('0xd')]];}}}catch(_0x5396d8){utils['error'](util['format']('[%s][queues][hangup]',_0x181f11[_0x48b8('0xd')]),_0x5396d8);}};exports[_0x48b8('0x1e')]=function(_0xdc0063){try{utils[_0x48b8('0xe')](util['format'](_0x48b8('0x1f'),_0xdc0063[_0x48b8('0xd')]),_0xdc0063);if(!_['isNil'](_0xdc0063['variable'][_0x48b8('0x20')])&&_0xdc0063[_0x48b8('0x21')]['toUpperCase']()!=='CONTINUE'){if(!_[_0x48b8('0x22')](queues[_0xdc0063['uniqueid']])){queues[_0xdc0063[_0x48b8('0xd')]][_0x48b8('0x15')]=![];queues[_0xdc0063[_0x48b8('0xd')]][_0x48b8('0x23')]=null;queues[_0xdc0063['uniqueid']][_0x48b8('0x16')]=!![];queues[_0xdc0063[_0x48b8('0xd')]][_0x48b8('0x24')]=utils['now']();queues[_0xdc0063[_0x48b8('0xd')]]['queuecallerexitreason']=_0xdc0063[_0x48b8('0x21')][_0x48b8('0x25')]();utils['info'](util['format'](_0x48b8('0x26'),_0xdc0063[_0x48b8('0xd')],queues[_0xdc0063['uniqueid']][_0x48b8('0x1c')],_0xdc0063[_0x48b8('0x21')],queues[_0xdc0063[_0x48b8('0xd')]][_0x48b8('0x7')]));writeDB(queues[_0xdc0063[_0x48b8('0xd')]]);}}else if(!_[_0x48b8('0x22')](_0xdc0063[_0x48b8('0x27')][_0x48b8('0x28')])){if(!_['isNil'](queues[_0xdc0063[_0x48b8('0xd')]])&&!queues[_0xdc0063[_0x48b8('0xd')]][_0x48b8('0x15')]){queues[_0xdc0063[_0x48b8('0xd')]]['queuecallerabandon']=![];queues[_0xdc0063[_0x48b8('0xd')]][_0x48b8('0x23')]=null;queues[_0xdc0063[_0x48b8('0xd')]]['queuecallerexit']=!![];queues[_0xdc0063[_0x48b8('0xd')]][_0x48b8('0x24')]=utils[_0x48b8('0x11')]();queues[_0xdc0063[_0x48b8('0xd')]]['queuecallerexitreason']=_0x48b8('0x29');utils['info'](util[_0x48b8('0x2')](_0x48b8('0x2a'),_0xdc0063[_0x48b8('0xd')],queues[_0xdc0063['uniqueid']]['name'],_0xdc0063[_0x48b8('0x21')],queues[_0xdc0063[_0x48b8('0xd')]][_0x48b8('0x7')]));}}}catch(_0x22f08f){utils[_0x48b8('0x12')](util[_0x48b8('0x2')](_0x48b8('0x1f'),_0xdc0063[_0x48b8('0xd')]),_0x22f08f);}};exports[_0x48b8('0x15')]=function(_0x133a8b){try{if(!_[_0x48b8('0x22')](queues[_0x133a8b['uniqueid']])){utils['debug'](util['format'](_0x48b8('0x2b'),_0x133a8b['uniqueid']),_0x133a8b);queues[_0x133a8b['uniqueid']]['queuecallerexit']=![];queues[_0x133a8b[_0x48b8('0xd')]]['queuecallerexitAt']=null;queues[_0x133a8b[_0x48b8('0xd')]][_0x48b8('0x15')]=!![];queues[_0x133a8b[_0x48b8('0xd')]]['queuecallerabandonAt']=utils[_0x48b8('0x11')]();queues[_0x133a8b[_0x48b8('0xd')]][_0x48b8('0x7')]=_0x48b8('0x2c');utils[_0x48b8('0x1')](util[_0x48b8('0x2')](_0x48b8('0x2d'),_0x133a8b[_0x48b8('0xd')],queues[_0x133a8b[_0x48b8('0xd')]][_0x48b8('0x1c')],queues[_0x133a8b[_0x48b8('0xd')]][_0x48b8('0x7')]));}}catch(_0x152627){utils[_0x48b8('0x12')](util['format'](_0x48b8('0x2b'),_0x133a8b[_0x48b8('0xd')]),_0x152627);}};exports['queuecallerleave']=function(_0x49237c){try{if(!_[_0x48b8('0x22')](queues[_0x49237c['uniqueid']])){utils[_0x48b8('0xe')](util['format']('[%s][queues][queuecallerleave]',_0x49237c[_0x48b8('0xd')]),_0x49237c);utils[_0x48b8('0x1')](util[_0x48b8('0x2')](_0x48b8('0x2e'),_0x49237c[_0x48b8('0xd')],queues[_0x49237c[_0x48b8('0xd')]]['name'],_0x49237c[_0x48b8('0x2f')],_0x49237c[_0x48b8('0x30')]));queues[_0x49237c[_0x48b8('0xd')]][_0x48b8('0x31')]=!![];queues[_0x49237c['uniqueid']][_0x48b8('0x32')]=utils[_0x48b8('0x11')]();queues[_0x49237c['uniqueid']][_0x48b8('0x33')]=utils[_0x48b8('0x34')](queues[_0x49237c[_0x48b8('0xd')]][_0x48b8('0x32')],queues[_0x49237c[_0x48b8('0xd')]]['queuecallerjoinAt']);queues[_0x49237c[_0x48b8('0xd')]][_0x48b8('0x10')]=_0x49237c[_0x48b8('0x10')];queues[_0x49237c[_0x48b8('0xd')]][_0x48b8('0x35')]=_0x49237c[_0x48b8('0x35')];queues[_0x49237c[_0x48b8('0xd')]]['connectedlinenum']=_0x49237c[_0x48b8('0x2f')];queues[_0x49237c[_0x48b8('0xd')]]['connectedlinename']=_0x49237c[_0x48b8('0x30')];}}catch(_0xfc7434){utils[_0x48b8('0x12')](util[_0x48b8('0x2')](_0x48b8('0x36'),_0x49237c[_0x48b8('0xd')]),_0xfc7434);}};exports[_0x48b8('0x37')]=function(_0x3cb774){try{if(!_[_0x48b8('0x22')](queues[_0x3cb774[_0x48b8('0xd')]])){utils[_0x48b8('0xe')](util['format'](_0x48b8('0x38'),_0x3cb774[_0x48b8('0xd')]),_0x3cb774);utils[_0x48b8('0x1')](util[_0x48b8('0x2')]('[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s',_0x3cb774[_0x48b8('0xd')],queues[_0x3cb774[_0x48b8('0xd')]][_0x48b8('0x1c')],_0x3cb774[_0x48b8('0x39')],_0x3cb774['destaccountcode']));queues[_0x3cb774[_0x48b8('0xd')]]['queuecallerabandon']=![];queues[_0x3cb774[_0x48b8('0xd')]]['queuecallerabandon']=![];queues[_0x3cb774[_0x48b8('0xd')]][_0x48b8('0x23')]=null;queues[_0x3cb774[_0x48b8('0xd')]]['queuecallerexit']=![];queues[_0x3cb774[_0x48b8('0xd')]]['queuecallerexitreason']=null;queues[_0x3cb774[_0x48b8('0xd')]][_0x48b8('0x24')]=null;queues[_0x3cb774[_0x48b8('0xd')]][_0x48b8('0x3a')]=!![];queues[_0x3cb774[_0x48b8('0xd')]][_0x48b8('0x3b')]=_0x3cb774[_0x48b8('0x3c')];queues[_0x3cb774[_0x48b8('0xd')]][_0x48b8('0x6')]=_0x3cb774['membername'];}}catch(_0x22e726){utils['error'](util[_0x48b8('0x2')](_0x48b8('0x38'),_0x3cb774[_0x48b8('0xd')]),_0x22e726);}};exports[_0x48b8('0x3d')]=function(_0x400fc2){try{if(!_[_0x48b8('0x22')](queues[_0x400fc2['uniqueid']])){if(queues[_0x400fc2[_0x48b8('0xd')]][_0x48b8('0x32')]){utils[_0x48b8('0xe')](util[_0x48b8('0x2')](_0x48b8('0x3e'),_0x400fc2[_0x48b8('0xd')]),_0x400fc2);queues[_0x400fc2['uniqueid']][_0x48b8('0x15')]=![];queues[_0x400fc2[_0x48b8('0xd')]][_0x48b8('0x15')]=![];queues[_0x400fc2[_0x48b8('0xd')]][_0x48b8('0x23')]=null;queues[_0x400fc2[_0x48b8('0xd')]][_0x48b8('0x16')]=![];queues[_0x400fc2[_0x48b8('0xd')]][_0x48b8('0x24')]=null;queues[_0x400fc2['uniqueid']][_0x48b8('0x3a')]=!![];queues[_0x400fc2[_0x48b8('0xd')]]['lastAssignedTo']=_0x400fc2[_0x48b8('0x39')];queues[_0x400fc2[_0x48b8('0xd')]]['queuecallercomplete']=!![];queues[_0x400fc2[_0x48b8('0xd')]][_0x48b8('0x18')]=utils[_0x48b8('0x11')]();if(_0x400fc2[_0x48b8('0x3f')]==_0x48b8('0x40')){if(!queues[_0x400fc2['uniqueid']][_0x48b8('0x40')]){queues[_0x400fc2['uniqueid']][_0x48b8('0x7')]=_0x48b8('0x41');}}else{queues[_0x400fc2[_0x48b8('0xd')]][_0x48b8('0x7')]=_0x48b8('0x42')+_0x400fc2[_0x48b8('0x3f')]['toUpperCase']();}utils[_0x48b8('0x1')](util['format'](_0x48b8('0x43'),_0x400fc2[_0x48b8('0xd')],queues[_0x400fc2[_0x48b8('0xd')]]['name'],_0x400fc2['membername'],queues[_0x400fc2['uniqueid']]['queuecallerexitreason']));writeDB(queues[_0x400fc2[_0x48b8('0xd')]]);}}}catch(_0x10f22f){utils[_0x48b8('0x12')](util['format'](_0x48b8('0x3e'),_0x400fc2[_0x48b8('0xd')]),_0x10f22f);}};exports[_0x48b8('0x44')]=function(_0x3f5c14){try{if(!_[_0x48b8('0x22')](queues[_0x3f5c14[_0x48b8('0x45')]])){utils[_0x48b8('0xe')](util[_0x48b8('0x2')]('[%s][queues][blindtransfer]',_0x3f5c14['uniqueid']),_0x3f5c14);queues[_0x3f5c14[_0x48b8('0x45')]][_0x48b8('0x40')]=!![];queues[_0x3f5c14[_0x48b8('0x45')]][_0x48b8('0x46')]=_0x48b8('0x47');queues[_0x3f5c14[_0x48b8('0x45')]]['transferexten']=_0x3f5c14['extension'];queues[_0x3f5c14[_0x48b8('0x45')]]['transferuniqueid']=_0x3f5c14[_0x48b8('0x45')];queues[_0x3f5c14[_0x48b8('0x45')]][_0x48b8('0x7')]='BLINDTRANSFER';utils[_0x48b8('0x1')](util[_0x48b8('0x2')](_0x48b8('0x48'),_0x3f5c14[_0x48b8('0xd')],queues[_0x3f5c14[_0x48b8('0x45')]]['name'],_0x3f5c14[_0x48b8('0x45')],_0x3f5c14[_0x48b8('0x49')]));}}catch(_0xac82a0){utils[_0x48b8('0x12')](util[_0x48b8('0x2')]('[%s][queues][blindtransfer]',_0x3f5c14[_0x48b8('0xd')]),_0xac82a0);}};exports[_0x48b8('0x4a')]=function(_0x284221){try{utils[_0x48b8('0xe')](util[_0x48b8('0x2')](_0x48b8('0x4b'),_0x284221[_0x48b8('0x4c')]),_0x284221);if(_0x284221[_0x48b8('0x4c')]==_0x284221[_0x48b8('0x4d')]){if(!_[_0x48b8('0x22')](queues[_0x284221[_0x48b8('0x4e')]])){utils[_0x48b8('0x1')](util['format'](_0x48b8('0x4f'),_0x284221[_0x48b8('0x4c')],queues[_0x284221[_0x48b8('0x4e')]][_0x48b8('0x1c')],_0x284221[_0x48b8('0x50')]));queues[_0x284221[_0x48b8('0x4e')]][_0x48b8('0x40')]=!![];queues[_0x284221[_0x48b8('0x4e')]][_0x48b8('0x46')]=_0x48b8('0x51');queues[_0x284221[_0x48b8('0x4e')]][_0x48b8('0x52')]=_0x284221[_0x48b8('0x50')];queues[_0x284221[_0x48b8('0x4e')]][_0x48b8('0x53')]=_0x284221[_0x48b8('0x4c')];queues[_0x284221[_0x48b8('0x4e')]][_0x48b8('0x7')]=_0x48b8('0x54');}if(!_['isNil'](queues[_0x284221[_0x48b8('0x4d')]])){if(_0x284221[_0x48b8('0x55')]&&queues[_0x284221['transfereelinkedid']]){queues[_0x284221[_0x48b8('0x55')]]['queuecallerenterreason']=0x1;queues[_0x284221[_0x48b8('0x45')]]=_[_0x48b8('0x56')](queues[_0x284221[_0x48b8('0x55')]]);queues[_0x284221['transfereeuniqueid']][_0x48b8('0xc')]=_0x284221['transfertargetuniqueid'];queues[_0x284221[_0x48b8('0x45')]][_0x48b8('0x1d')]=0x2;queues[_0x284221[_0x48b8('0x45')]]['calleridnum']=queues[_0x284221[_0x48b8('0x4e')]]['calleridnum'];queues[_0x284221[_0x48b8('0x45')]][_0x48b8('0x57')]=queues[_0x284221[_0x48b8('0x4e')]]['calleridname'];queues[_0x284221[_0x48b8('0x45')]][_0x48b8('0x58')]=utils[_0x48b8('0x11')]();queues[_0x284221[_0x48b8('0x45')]][_0x48b8('0x32')]=utils[_0x48b8('0x11')]();queues[_0x284221['transfereeuniqueid']][_0x48b8('0x33')]=0x0;queues[_0x284221[_0x48b8('0x45')]][_0x48b8('0x59')]=0x0;utils['info'](util[_0x48b8('0x2')]('[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s',_0x284221['origtransfereruniqueid'],queues[_0x284221[_0x48b8('0x45')]][_0x48b8('0x1c')],queues[_0x284221[_0x48b8('0x45')]][_0x48b8('0x5a')],queues[_0x284221[_0x48b8('0x45')]]['calleridname']));}else{utils['info'](util[_0x48b8('0x2')](_0x48b8('0x5b'),_0x284221[_0x48b8('0x4c')],queues[_0x284221[_0x48b8('0x4d')]][_0x48b8('0x1c')],_0x284221[_0x48b8('0x4e')]));queues[_0x284221[_0x48b8('0x4d')]][_0x48b8('0xc')]=_0x284221[_0x48b8('0x4e')];}}}else if(_0x284221[_0x48b8('0x5c')]==_0x284221[_0x48b8('0x4e')]){if(!_['isNil'](queues[_0x284221[_0x48b8('0x4d')]])){utils[_0x48b8('0x1')](util[_0x48b8('0x2')](_0x48b8('0x5d'),_0x284221[_0x48b8('0x4c')],queues[_0x284221[_0x48b8('0x4d')]][_0x48b8('0x1c')],_0x284221[_0x48b8('0x5c')],_0x284221[_0x48b8('0x5e')]));queues[_0x284221['origtransfererlinkedid']]['transfer']=!![];queues[_0x284221[_0x48b8('0x4d')]][_0x48b8('0x46')]=_0x48b8('0x51');queues[_0x284221[_0x48b8('0x4d')]][_0x48b8('0x52')]=_0x284221[_0x48b8('0x5e')];queues[_0x284221[_0x48b8('0x4d')]][_0x48b8('0x53')]=_0x284221[_0x48b8('0x5c')];queues[_0x284221[_0x48b8('0x4d')]][_0x48b8('0x7')]=_0x48b8('0x54');}if(!_[_0x48b8('0x22')](queues[_0x284221[_0x48b8('0x4e')]])){if(_0x284221['transfertargetlinkedid']&&queues[_0x284221[_0x48b8('0x5f')]]){queues[_0x284221[_0x48b8('0x5f')]][_0x48b8('0x1d')]=0x1;queues[_0x284221[_0x48b8('0x60')]]=_['clone'](queues[_0x284221[_0x48b8('0x5f')]]);queues[_0x284221[_0x48b8('0x60')]][_0x48b8('0xc')]=_0x284221[_0x48b8('0x60')];queues[_0x284221[_0x48b8('0x60')]][_0x48b8('0x1d')]=0x2;queues[_0x284221[_0x48b8('0x60')]][_0x48b8('0x5a')]=queues[_0x284221[_0x48b8('0x4d')]][_0x48b8('0x5a')];queues[_0x284221['transfertargetuniqueid']][_0x48b8('0x57')]=queues[_0x284221[_0x48b8('0x4d')]][_0x48b8('0x57')];queues[_0x284221[_0x48b8('0x60')]]['queuecallerjoinAt']=utils[_0x48b8('0x11')]();queues[_0x284221[_0x48b8('0x60')]][_0x48b8('0x32')]=utils['now']();queues[_0x284221[_0x48b8('0x60')]][_0x48b8('0x33')]=0x0;queues[_0x284221[_0x48b8('0x60')]][_0x48b8('0x59')]=0x0;utils[_0x48b8('0x1')](util['format'](_0x48b8('0x61'),_0x284221[_0x48b8('0x4c')],queues[_0x284221[_0x48b8('0x60')]]['name'],queues[_0x284221[_0x48b8('0x60')]]['transfereduniqueid'],queues[_0x284221['transfertargetuniqueid']][_0x48b8('0x5a')],queues[_0x284221[_0x48b8('0x60')]][_0x48b8('0x57')]));}else{utils[_0x48b8('0x1')](util['format'](_0x48b8('0x5b'),_0x284221[_0x48b8('0x4c')],queues[_0x284221[_0x48b8('0x4e')]][_0x48b8('0x1c')],_0x284221[_0x48b8('0x4d')]));queues[_0x284221[_0x48b8('0x4e')]][_0x48b8('0xc')]=_0x284221[_0x48b8('0x4d')];}}}}catch(_0x2af750){utils[_0x48b8('0x12')](util['format'](_0x48b8('0x4b'),_0x284221[_0x48b8('0x4c')]),_0x2af750);}};exports[_0x48b8('0x62')]=function(_0x1b7387){try{if(!_[_0x48b8('0x22')](queues[_0x1b7387[_0x48b8('0xd')]])){utils['debug'](util[_0x48b8('0x2')]('[%s][queues][musiconholdstart]',_0x1b7387['uniqueid']),_0x1b7387);queues[_0x1b7387[_0x48b8('0xd')]][_0x48b8('0x63')]=utils['now']();utils[_0x48b8('0x1')](util[_0x48b8('0x2')](_0x48b8('0x64'),_0x1b7387[_0x48b8('0xd')],queues[_0x1b7387[_0x48b8('0xd')]]['name'],queues[_0x1b7387[_0x48b8('0xd')]][_0x48b8('0x63')]));}}catch(_0x2fad19){utils['error'](util[_0x48b8('0x2')]('[%s][queues][musiconholdstart]',_0x1b7387[_0x48b8('0xd')]),_0x2fad19);}};exports[_0x48b8('0x65')]=function(_0x1de40f){try{if(!_[_0x48b8('0x22')](queues[_0x1de40f['uniqueid']])){if(!_[_0x48b8('0x22')](queues[_0x1de40f[_0x48b8('0xd')]]['musiconholdstartAt'])){utils[_0x48b8('0xe')](util['format']('[%s][queues][musiconholdstop]',_0x1de40f['uniqueid']),_0x1de40f);queues[_0x1de40f['uniqueid']][_0x48b8('0x59')]+=utils[_0x48b8('0x34')](utils[_0x48b8('0x11')](),queues[_0x1de40f['uniqueid']][_0x48b8('0x63')]);utils[_0x48b8('0x1')](util[_0x48b8('0x2')](_0x48b8('0x66'),_0x1de40f[_0x48b8('0xd')],queues[_0x1de40f[_0x48b8('0xd')]]['name'],queues[_0x1de40f['uniqueid']][_0x48b8('0x59')]));delete queues[_0x1de40f[_0x48b8('0xd')]][_0x48b8('0x63')];}}}catch(_0x17a54e){utils[_0x48b8('0x12')](util[_0x48b8('0x2')](_0x48b8('0x67'),_0x1de40f[_0x48b8('0xd')]),_0x17a54e);}}; \ No newline at end of file diff --git a/server/services/xdr/recordings.controller.js b/server/services/xdr/recordings.controller.js index f7f3f3f..307a173 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 _0x6c2f=['[%s][recordings][newstate]\x20context:%s\x20channel:%s','transfer','[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','varset','mixmonitor_filename','[%s][recordings][varset]','value','endsWith','replace','.wav49','.WAV','find','monitors','push','hangup','[%s][recordings][hangup]','[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s','calleridname','calleridnum','connectedlinenum','connectedlinename','forEach','clone','newexten','[%s][recordings][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','cdr','split','substring','lastIndexOf','[%s][recordings][newexten]','queuecallerjoin','[%s][recordings][queuecallerjoin]','[%s][recordings][queuecallerjoin]\x20queue:%s','queue','lodash','info','uniqueid','accountcode','then','membername','name','UserId','request','CreateVoiceRecording','debug','format','[%s][recordings][newchannel]','linkedid','[%s][recordings][newchannel]\x20context:%s\x20exten:%s','context','exten','channel','error','newstate','[%s][recordings][newstate]','isNil'];(function(_0x57fcc0,_0x585004){var _0x5270df=function(_0x5f2db0){while(--_0x5f2db0){_0x57fcc0['push'](_0x57fcc0['shift']());}};_0x5270df(++_0x585004);}(_0x6c2f,0xd6));var _0xf6c2=function(_0x52db29,_0x9f54e4){_0x52db29=_0x52db29-0x0;var _0x5b187a=_0x6c2f[_0x52db29];return _0x5b187a;};'use strict';var _=require(_0xf6c2('0x0'));var util=require('util');var utils=require('./utils');var recordings={};function writeDB(_0x59602f){utils[_0xf6c2('0x1')](util['format']('[%s][recordings][writeDB]',_0x59602f[_0xf6c2('0x2')]));if(_0x59602f[_0xf6c2('0x3')]){utils['getUserByInternal'](_0x59602f[_0xf6c2('0x3')])[_0xf6c2('0x4')](function(_0x52d7d7){if(_0x52d7d7){_0x59602f[_0xf6c2('0x5')]=_0x52d7d7[_0xf6c2('0x6')];_0x59602f[_0xf6c2('0x7')]=_0x52d7d7['id'];}utils[_0xf6c2('0x8')](_0xf6c2('0x9'),_0x59602f);});}else{utils[_0xf6c2('0x8')](_0xf6c2('0x9'),_0x59602f);}}exports['newchannel']=function(_0x28107f){try{utils[_0xf6c2('0xa')](util[_0xf6c2('0xb')](_0xf6c2('0xc'),_0x28107f[_0xf6c2('0x2')]),_0x28107f);if(_0x28107f['uniqueid']==_0x28107f[_0xf6c2('0xd')]){utils['info'](util[_0xf6c2('0xb')](_0xf6c2('0xe'),_0x28107f[_0xf6c2('0x2')],_0x28107f[_0xf6c2('0xf')],_0x28107f['exten']));recordings[_0x28107f[_0xf6c2('0x2')]]={'uniqueid':_0x28107f['uniqueid'],'accountcode':_0x28107f['accountcode'],'exten':_0x28107f[_0xf6c2('0x10')],'context':_0x28107f[_0xf6c2('0xf')],'channel':_0x28107f[_0xf6c2('0x11')],'monitors':[]};}}catch(_0x2321e6){utils[_0xf6c2('0x12')](util['format'](_0xf6c2('0xc'),_0x28107f['uniqueid']),_0x2321e6);}};exports[_0xf6c2('0x13')]=function(_0x3f6f40){try{utils[_0xf6c2('0xa')](util['format'](_0xf6c2('0x14'),_0x3f6f40[_0xf6c2('0x2')]),_0x3f6f40);if(!_[_0xf6c2('0x15')](recordings[_0x3f6f40['uniqueid']])&&_0x3f6f40['channelstate']==0x6){utils['info'](util[_0xf6c2('0xb')](_0xf6c2('0x16'),_0x3f6f40[_0xf6c2('0x2')],_0x3f6f40[_0xf6c2('0xf')],_0x3f6f40[_0xf6c2('0x11')]));}else if(!_['isNil'](recordings[_0x3f6f40[_0xf6c2('0xd')]])&&_0x3f6f40['channelstate']==0x6&&_0x3f6f40['context']!=_0xf6c2('0x17')){utils[_0xf6c2('0x1')](util[_0xf6c2('0xb')](_0xf6c2('0x18'),_0x3f6f40[_0xf6c2('0x2')],_0x3f6f40[_0xf6c2('0xd')],_0x3f6f40['context'],_0x3f6f40[_0xf6c2('0x11')]));recordings[_0x3f6f40[_0xf6c2('0xd')]][_0xf6c2('0x3')]=_0x3f6f40['accountcode'];}}catch(_0x2803c6){utils[_0xf6c2('0x12')](util[_0xf6c2('0xb')](_0xf6c2('0x14'),_0x3f6f40['uniqueid']),_0x2803c6);}};exports[_0xf6c2('0x19')]=function(_0x3bbe28){try{if(!_[_0xf6c2('0x15')](_0x3bbe28['variable'])&&!_['isNil'](_0x3bbe28['variable'][_0xf6c2('0x1a')])){utils[_0xf6c2('0xa')](util[_0xf6c2('0xb')](_0xf6c2('0x1b'),_0x3bbe28['uniqueid']),_0x3bbe28);utils[_0xf6c2('0x1')](util[_0xf6c2('0xb')]('[%s][recordings][varset]\x20variable:%s\x20value:%s',_0x3bbe28['uniqueid'],_0x3bbe28['variable'],_0x3bbe28[_0xf6c2('0x1c')]));if(_[_0xf6c2('0x1d')](_0x3bbe28[_0xf6c2('0x1c')],'.wav49')){_0x3bbe28[_0xf6c2('0x1c')]=_0x3bbe28['value'][_0xf6c2('0x1e')](_0xf6c2('0x1f'),_0xf6c2('0x20'));}if(recordings[_0x3bbe28[_0xf6c2('0xd')]]){var _0x16d347=_[_0xf6c2('0x21')](recordings[_0x3bbe28[_0xf6c2('0xd')]]['monitors'],{'value':_0x3bbe28['value']});if(_[_0xf6c2('0x15')](_0x16d347)){recordings[_0x3bbe28[_0xf6c2('0xd')]][_0xf6c2('0x22')][_0xf6c2('0x23')]({'value':_0x3bbe28[_0xf6c2('0x1c')]});}}}}catch(_0x461fb6){utils['error'](util[_0xf6c2('0xb')](_0xf6c2('0x1b'),_0x3bbe28[_0xf6c2('0x2')]),_0x461fb6);}};exports[_0xf6c2('0x24')]=function(_0x416870){try{if(!_[_0xf6c2('0x15')](recordings[_0x416870[_0xf6c2('0x2')]])){utils[_0xf6c2('0xa')](util[_0xf6c2('0xb')](_0xf6c2('0x25'),_0x416870[_0xf6c2('0x2')]),_0x416870);utils[_0xf6c2('0x1')](util[_0xf6c2('0xb')](_0xf6c2('0x26'),_0x416870[_0xf6c2('0x2')],_0x416870['calleridnum'],_0x416870[_0xf6c2('0x27')],_0x416870['cause-txt']));recordings[_0x416870['uniqueid']][_0xf6c2('0x28')]=_0x416870[_0xf6c2('0x28')];recordings[_0x416870[_0xf6c2('0x2')]][_0xf6c2('0x27')]=_0x416870[_0xf6c2('0x27')];recordings[_0x416870['uniqueid']]['connectedlinenum']=_0x416870[_0xf6c2('0x29')];recordings[_0x416870[_0xf6c2('0x2')]][_0xf6c2('0x2a')]=_0x416870[_0xf6c2('0x2a')];if(recordings[_0x416870[_0xf6c2('0x2')]]['type']=='outbound'&&recordings[_0x416870[_0xf6c2('0x2')]][_0xf6c2('0x3')]){recordings[_0x416870[_0xf6c2('0x2')]]['connectedlinenum']=recordings[_0x416870[_0xf6c2('0x2')]][_0xf6c2('0x3')];recordings[_0x416870['uniqueid']][_0xf6c2('0x2a')]='';}recordings[_0x416870[_0xf6c2('0x2')]]['monitors'][_0xf6c2('0x2b')](function(_0x5c76cf){var _0x53d186=_[_0xf6c2('0x2c')](recordings[_0x416870[_0xf6c2('0x2')]]);_0x53d186[_0xf6c2('0x1c')]=_0x5c76cf[_0xf6c2('0x1c')];writeDB(_0x53d186);});delete recordings[_0x416870[_0xf6c2('0x2')]];}}catch(_0xc19e00){utils[_0xf6c2('0x12')](util[_0xf6c2('0xb')](_0xf6c2('0x25'),_0x416870[_0xf6c2('0x2')]),_0xc19e00);}};exports[_0xf6c2('0x2d')]=function(_0x3a8334){try{if(!_['isNil'](recordings[_0x3a8334['uniqueid']])){utils[_0xf6c2('0xa')](util[_0xf6c2('0xb')]('[%s][recordings][newexten]',_0x3a8334[_0xf6c2('0x2')]),_0x3a8334);utils['info'](util[_0xf6c2('0xb')](_0xf6c2('0x2e'),_0x3a8334[_0xf6c2('0x2')],_0x3a8334[_0xf6c2('0x2f')],_0x3a8334[_0xf6c2('0x30')]));if(_0x3a8334[_0xf6c2('0x2f')][_0xf6c2('0x31')]()=='set'&&_['startsWith'](_0x3a8334['appdata'][_0xf6c2('0x31')](),_0xf6c2('0x32'))){var _0x1e7bd4=_0x3a8334[_0xf6c2('0x30')][_0xf6c2('0x33')]('=');var _0x1fe78e=_0x1e7bd4[0x0][_0xf6c2('0x34')](_0x1e7bd4[0x0]['lastIndexOf']('(')+0x1,_0x1e7bd4[0x0][_0xf6c2('0x35')](')'));var _0x7163bd=_0x1e7bd4[0x1];recordings[_0x3a8334[_0xf6c2('0x2')]][_0x1fe78e]=_0x7163bd;}}}catch(_0x3188c7){utils[_0xf6c2('0x12')](util[_0xf6c2('0xb')](_0xf6c2('0x36'),_0x3a8334['uniqueid']),_0x3188c7);}};exports[_0xf6c2('0x37')]=function(_0x980d0f){try{if(!_['isNil'](recordings[_0x980d0f[_0xf6c2('0x2')]])){utils[_0xf6c2('0xa')](util['format'](_0xf6c2('0x38'),_0x980d0f[_0xf6c2('0x2')]),_0x980d0f);utils[_0xf6c2('0x1')](util[_0xf6c2('0xb')](_0xf6c2('0x39'),_0x980d0f[_0xf6c2('0x2')],_0x980d0f['queue']));recordings[_0x980d0f[_0xf6c2('0x2')]][_0xf6c2('0x3a')]=_0x980d0f['queue'];}}catch(_0x1a0530){utils[_0xf6c2('0x12')](util[_0xf6c2('0xb')](_0xf6c2('0x38'),_0x980d0f['uniqueid']),_0x1a0530);}}; \ No newline at end of file +var _0xb636=['queue','lodash','util','./utils','info','format','[%s][recordings][writeDB]','uniqueid','accountcode','then','membername','name','CreateVoiceRecording','request','linkedid','context','exten','[%s][recordings][newchannel]','newstate','debug','[%s][recordings][newstate]','isNil','channelstate','[%s][recordings][newstate]\x20context:%s\x20channel:%s','channel','transfer','[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','variable','mixmonitor_filename','[%s][recordings][varset]','[%s][recordings][varset]\x20variable:%s\x20value:%s','endsWith','value','replace','.WAV','monitors','push','error','hangup','[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s','calleridnum','calleridname','connectedlinenum','connectedlinename','type','outbound','forEach','[%s][recordings][hangup]','newexten','[%s][recordings][newexten]','appdata','toLowerCase','startsWith','cdr','split','lastIndexOf','queuecallerjoin','[%s][recordings][queuecallerjoin]','[%s][recordings][queuecallerjoin]\x20queue:%s'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xb636,0x163));var _0x6b63=function(_0x31df4a,_0x3e23e7){_0x31df4a=_0x31df4a-0x0;var _0x586e6c=_0xb636[_0x31df4a];return _0x586e6c;};'use strict';var _=require(_0x6b63('0x0'));var util=require(_0x6b63('0x1'));var utils=require(_0x6b63('0x2'));var recordings={};function writeDB(_0x6d754d){utils[_0x6b63('0x3')](util[_0x6b63('0x4')](_0x6b63('0x5'),_0x6d754d[_0x6b63('0x6')]));if(_0x6d754d[_0x6b63('0x7')]){utils['getUserByInternal'](_0x6d754d[_0x6b63('0x7')])[_0x6b63('0x8')](function(_0x3cb31d){if(_0x3cb31d){_0x6d754d[_0x6b63('0x9')]=_0x3cb31d[_0x6b63('0xa')];_0x6d754d['UserId']=_0x3cb31d['id'];}utils['request'](_0x6b63('0xb'),_0x6d754d);});}else{utils[_0x6b63('0xc')](_0x6b63('0xb'),_0x6d754d);}}exports['newchannel']=function(_0x18cd1d){try{utils['debug'](util[_0x6b63('0x4')]('[%s][recordings][newchannel]',_0x18cd1d[_0x6b63('0x6')]),_0x18cd1d);if(_0x18cd1d[_0x6b63('0x6')]==_0x18cd1d[_0x6b63('0xd')]){utils['info'](util['format']('[%s][recordings][newchannel]\x20context:%s\x20exten:%s',_0x18cd1d[_0x6b63('0x6')],_0x18cd1d[_0x6b63('0xe')],_0x18cd1d[_0x6b63('0xf')]));recordings[_0x18cd1d['uniqueid']]={'uniqueid':_0x18cd1d[_0x6b63('0x6')],'accountcode':_0x18cd1d['accountcode'],'exten':_0x18cd1d['exten'],'context':_0x18cd1d[_0x6b63('0xe')],'channel':_0x18cd1d['channel'],'monitors':[]};}}catch(_0x3b4c8f){utils['error'](util[_0x6b63('0x4')](_0x6b63('0x10'),_0x18cd1d[_0x6b63('0x6')]),_0x3b4c8f);}};exports[_0x6b63('0x11')]=function(_0x51d91f){try{utils[_0x6b63('0x12')](util[_0x6b63('0x4')](_0x6b63('0x13'),_0x51d91f['uniqueid']),_0x51d91f);if(!_[_0x6b63('0x14')](recordings[_0x51d91f[_0x6b63('0x6')]])&&_0x51d91f[_0x6b63('0x15')]==0x6){utils[_0x6b63('0x3')](util[_0x6b63('0x4')](_0x6b63('0x16'),_0x51d91f[_0x6b63('0x6')],_0x51d91f[_0x6b63('0xe')],_0x51d91f[_0x6b63('0x17')]));}else if(!_[_0x6b63('0x14')](recordings[_0x51d91f[_0x6b63('0xd')]])&&_0x51d91f[_0x6b63('0x15')]==0x6&&_0x51d91f[_0x6b63('0xe')]!=_0x6b63('0x18')){utils[_0x6b63('0x3')](util[_0x6b63('0x4')](_0x6b63('0x19'),_0x51d91f['uniqueid'],_0x51d91f[_0x6b63('0xd')],_0x51d91f[_0x6b63('0xe')],_0x51d91f[_0x6b63('0x17')]));recordings[_0x51d91f[_0x6b63('0xd')]]['accountcode']=_0x51d91f[_0x6b63('0x7')];}}catch(_0xff224b){utils['error'](util['format'](_0x6b63('0x13'),_0x51d91f[_0x6b63('0x6')]),_0xff224b);}};exports['varset']=function(_0x547cf6){try{if(!_[_0x6b63('0x14')](_0x547cf6[_0x6b63('0x1a')])&&!_['isNil'](_0x547cf6[_0x6b63('0x1a')][_0x6b63('0x1b')])){utils['debug'](util[_0x6b63('0x4')](_0x6b63('0x1c'),_0x547cf6[_0x6b63('0x6')]),_0x547cf6);utils[_0x6b63('0x3')](util[_0x6b63('0x4')](_0x6b63('0x1d'),_0x547cf6[_0x6b63('0x6')],_0x547cf6[_0x6b63('0x1a')],_0x547cf6['value']));if(_[_0x6b63('0x1e')](_0x547cf6[_0x6b63('0x1f')],'.wav49')){_0x547cf6[_0x6b63('0x1f')]=_0x547cf6['value'][_0x6b63('0x20')]('.wav49',_0x6b63('0x21'));}if(recordings[_0x547cf6['linkedid']]){var _0x304c9e=_['find'](recordings[_0x547cf6[_0x6b63('0xd')]][_0x6b63('0x22')],{'value':_0x547cf6['value']});if(_[_0x6b63('0x14')](_0x304c9e)){recordings[_0x547cf6[_0x6b63('0xd')]]['monitors'][_0x6b63('0x23')]({'value':_0x547cf6[_0x6b63('0x1f')]});}}}}catch(_0x1d08de){utils[_0x6b63('0x24')](util[_0x6b63('0x4')](_0x6b63('0x1c'),_0x547cf6[_0x6b63('0x6')]),_0x1d08de);}};exports[_0x6b63('0x25')]=function(_0x452d22){try{if(!_[_0x6b63('0x14')](recordings[_0x452d22[_0x6b63('0x6')]])){utils[_0x6b63('0x12')](util[_0x6b63('0x4')]('[%s][recordings][hangup]',_0x452d22[_0x6b63('0x6')]),_0x452d22);utils[_0x6b63('0x3')](util[_0x6b63('0x4')](_0x6b63('0x26'),_0x452d22['uniqueid'],_0x452d22[_0x6b63('0x27')],_0x452d22[_0x6b63('0x28')],_0x452d22['cause-txt']));recordings[_0x452d22[_0x6b63('0x6')]][_0x6b63('0x27')]=_0x452d22[_0x6b63('0x27')];recordings[_0x452d22['uniqueid']]['calleridname']=_0x452d22['calleridname'];recordings[_0x452d22[_0x6b63('0x6')]]['connectedlinenum']=_0x452d22[_0x6b63('0x29')];recordings[_0x452d22[_0x6b63('0x6')]][_0x6b63('0x2a')]=_0x452d22['connectedlinename'];if(recordings[_0x452d22[_0x6b63('0x6')]][_0x6b63('0x2b')]==_0x6b63('0x2c')&&recordings[_0x452d22[_0x6b63('0x6')]][_0x6b63('0x7')]){recordings[_0x452d22[_0x6b63('0x6')]][_0x6b63('0x29')]=recordings[_0x452d22[_0x6b63('0x6')]][_0x6b63('0x7')];recordings[_0x452d22[_0x6b63('0x6')]][_0x6b63('0x2a')]='';}recordings[_0x452d22['uniqueid']]['monitors'][_0x6b63('0x2d')](function(_0x25aae3){var _0x44faa4=_['clone'](recordings[_0x452d22[_0x6b63('0x6')]]);_0x44faa4[_0x6b63('0x1f')]=_0x25aae3[_0x6b63('0x1f')];writeDB(_0x44faa4);});delete recordings[_0x452d22['uniqueid']];}}catch(_0x266842){utils['error'](util['format'](_0x6b63('0x2e'),_0x452d22['uniqueid']),_0x266842);}};exports[_0x6b63('0x2f')]=function(_0x13bae4){try{if(!_['isNil'](recordings[_0x13bae4['uniqueid']])){utils['debug'](util[_0x6b63('0x4')](_0x6b63('0x30'),_0x13bae4[_0x6b63('0x6')]),_0x13bae4);utils['info'](util[_0x6b63('0x4')]('[%s][recordings][newexten]\x20application:%s\x20appdata:%s',_0x13bae4[_0x6b63('0x6')],_0x13bae4['application'],_0x13bae4[_0x6b63('0x31')]));if(_0x13bae4['application'][_0x6b63('0x32')]()=='set'&&_[_0x6b63('0x33')](_0x13bae4['appdata'][_0x6b63('0x32')](),_0x6b63('0x34'))){var _0x534e1b=_0x13bae4['appdata'][_0x6b63('0x35')]('=');var _0x70bb81=_0x534e1b[0x0]['substring'](_0x534e1b[0x0]['lastIndexOf']('(')+0x1,_0x534e1b[0x0][_0x6b63('0x36')](')'));var _0x5b4b3b=_0x534e1b[0x1];recordings[_0x13bae4[_0x6b63('0x6')]][_0x70bb81]=_0x5b4b3b;}}}catch(_0x1a93c6){utils[_0x6b63('0x24')](util[_0x6b63('0x4')]('[%s][recordings][newexten]',_0x13bae4['uniqueid']),_0x1a93c6);}};exports[_0x6b63('0x37')]=function(_0xedb303){try{if(!_[_0x6b63('0x14')](recordings[_0xedb303[_0x6b63('0x6')]])){utils[_0x6b63('0x12')](util[_0x6b63('0x4')](_0x6b63('0x38'),_0xedb303[_0x6b63('0x6')]),_0xedb303);utils[_0x6b63('0x3')](util[_0x6b63('0x4')](_0x6b63('0x39'),_0xedb303[_0x6b63('0x6')],_0xedb303[_0x6b63('0x3a')]));recordings[_0xedb303['uniqueid']][_0x6b63('0x3a')]=_0xedb303[_0x6b63('0x3a')];}}catch(_0x2749f3){utils[_0x6b63('0x24')](util[_0x6b63('0x4')](_0x6b63('0x38'),_0xedb303[_0x6b63('0x6')]),_0x2749f3);}}; \ No newline at end of file diff --git a/server/services/xdr/transfers.controller.js b/server/services/xdr/transfers.controller.js index 3d2bd02..1d62f40 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 _0x75fa=['assign','origtransfererchannel','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','origtransferercontext','isNil','transfereechannel','transfertargetchannel','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten','error','lodash','./utils','[%s][transfers][writeDB]\x20type:%s','type','attended','origtransfereruniqueid','uniqueid','request','blindtransfer','format','info','transferercalleridname','transfereecalleridnum','blind','[%s][transfers][blindtransfer]','attendedtransfer','debug','[%s][transfers][attendedtransfer]','[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','origtransferercalleridnum','origtransferercalleridname','transfertargetcalleridnum','transfertargetcalleridname'];(function(_0x331e93,_0xb4e0ba){var _0x23d270=function(_0x5155e1){while(--_0x5155e1){_0x331e93['push'](_0x331e93['shift']());}};_0x23d270(++_0xb4e0ba);}(_0x75fa,0x1e4));var _0xa75f=function(_0x250775,_0x3913cb){_0x250775=_0x250775-0x0;var _0x2509dd=_0x75fa[_0x250775];return _0x2509dd;};'use strict';var _=require(_0xa75f('0x0'));var util=require('util');var utils=require(_0xa75f('0x1'));function writeDB(_0x4a57c6){utils['info'](util['format'](_0xa75f('0x2'),_0x4a57c6[_0xa75f('0x3')]===_0xa75f('0x4')?_0x4a57c6[_0xa75f('0x5')]:_0x4a57c6[_0xa75f('0x6')],_0x4a57c6['type']));utils[_0xa75f('0x7')]('CreateVoiceTransferReport',_0x4a57c6);}exports[_0xa75f('0x8')]=function(_0x2ab53b){try{utils['debug'](util[_0xa75f('0x9')]('[%s][transfers][blindtransfer]',_0x2ab53b[_0xa75f('0x6')]),_0x2ab53b);utils[_0xa75f('0xa')](util['format']('[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s',_0x2ab53b['uniqueid'],_0x2ab53b['transferercalleridnum'],_0x2ab53b[_0xa75f('0xb')],_0x2ab53b[_0xa75f('0xc')],_0x2ab53b['transfereecalleridname']));_0x2ab53b['type']=_0xa75f('0xd');writeDB(_0x2ab53b);}catch(_0x10cf7c){utils['error'](util[_0xa75f('0x9')](_0xa75f('0xe'),_0x2ab53b['uniqueid']),_0x10cf7c);}};exports[_0xa75f('0xf')]=function(_0xc2b056){try{utils[_0xa75f('0x10')](util[_0xa75f('0x9')](_0xa75f('0x11'),_0xc2b056[_0xa75f('0x5')]),_0xc2b056);utils[_0xa75f('0xa')](util['format'](_0xa75f('0x12'),_0xc2b056[_0xa75f('0x5')],_0xc2b056[_0xa75f('0x13')],_0xc2b056[_0xa75f('0x14')],_0xc2b056[_0xa75f('0x15')],_0xc2b056[_0xa75f('0x16')]));_0xc2b056=_[_0xa75f('0x17')](_0xc2b056,{'transfererchannel':_0xc2b056[_0xa75f('0x18')],'transferercalleridnum':_0xc2b056[_0xa75f('0x13')],'transferercalleridname':_0xc2b056[_0xa75f('0x14')],'transfererconnectedlinenum':_0xc2b056['secondtransfererconnectedlinenum'],'transfererconnectedlinename':_0xc2b056[_0xa75f('0x19')],'transfereraccountcode':_0xc2b056[_0xa75f('0x1a')],'transferercontext':_0xc2b056[_0xa75f('0x1b')],'transfererexten':_0xc2b056[_0xa75f('0x1c')],'transfererlinkedid':_0xc2b056[_0xa75f('0x1d')],'context':_0xc2b056[_0xa75f('0x1e')],'extension':_0xc2b056['origtransfererexten'],'type':_0xa75f('0x4')});if(_[_0xa75f('0x1f')](_0xc2b056[_0xa75f('0x20')])){_0xc2b056=_[_0xa75f('0x17')](_0xc2b056,{'transfereechannel':_0xc2b056[_0xa75f('0x21')],'transfereecalleridnum':_0xc2b056['transfertargetcalleridnum'],'transfereecalleridname':_0xc2b056[_0xa75f('0x16')],'transfereeconnectedlinenum':_0xc2b056['transfertargetconnectedlinenum'],'transfereeconnectedlinename':_0xc2b056[_0xa75f('0x22')],'transfereeaccountcode':_0xc2b056[_0xa75f('0x23')],'transfereecontext':_0xc2b056[_0xa75f('0x24')],'transfereeexten':_0xc2b056[_0xa75f('0x25')],'transfereelinkedid':_0xc2b056['transfertargetlinkedid']});}writeDB(_0xc2b056);}catch(_0x5d5b05){utils[_0xa75f('0x26')](util[_0xa75f('0x9')](_0xa75f('0x11'),_0xc2b056['origtransfereruniqueid']),_0x5d5b05);}}; \ No newline at end of file +var _0xd75e=['origtransfererexten','isNil','transfereechannel','transfertargetchannel','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetaccountcode','transfertargetcontext','transfertargetexten','transfertargetlinkedid','error','lodash','util','./utils','info','format','[%s][transfers][writeDB]\x20type:%s','type','attended','origtransfereruniqueid','blindtransfer','debug','[%s][transfers][blindtransfer]','uniqueid','[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridname','transfereecalleridnum','transfereecalleridname','attendedtransfer','[%s][transfers][attendedtransfer]','[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','origtransferercalleridname','transfertargetcalleridnum','assign','origtransfererchannel','secondtransfererconnectedlinenum','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','origtransferercontext'];(function(_0x178d5f,_0xb942d3){var _0x431e8d=function(_0x454101){while(--_0x454101){_0x178d5f['push'](_0x178d5f['shift']());}};_0x431e8d(++_0xb942d3);}(_0xd75e,0xaf));var _0xed75=function(_0x1edd8e,_0x5ab9b5){_0x1edd8e=_0x1edd8e-0x0;var _0x47c6b0=_0xd75e[_0x1edd8e];return _0x47c6b0;};'use strict';var _=require(_0xed75('0x0'));var util=require(_0xed75('0x1'));var utils=require(_0xed75('0x2'));function writeDB(_0x368ee9){utils[_0xed75('0x3')](util[_0xed75('0x4')](_0xed75('0x5'),_0x368ee9[_0xed75('0x6')]===_0xed75('0x7')?_0x368ee9[_0xed75('0x8')]:_0x368ee9['uniqueid'],_0x368ee9[_0xed75('0x6')]));utils['request']('CreateVoiceTransferReport',_0x368ee9);}exports[_0xed75('0x9')]=function(_0x1d07d1){try{utils[_0xed75('0xa')](util[_0xed75('0x4')](_0xed75('0xb'),_0x1d07d1[_0xed75('0xc')]),_0x1d07d1);utils[_0xed75('0x3')](util[_0xed75('0x4')](_0xed75('0xd'),_0x1d07d1[_0xed75('0xc')],_0x1d07d1['transferercalleridnum'],_0x1d07d1[_0xed75('0xe')],_0x1d07d1[_0xed75('0xf')],_0x1d07d1[_0xed75('0x10')]));_0x1d07d1[_0xed75('0x6')]='blind';writeDB(_0x1d07d1);}catch(_0x21dcff){utils['error'](util[_0xed75('0x4')](_0xed75('0xb'),_0x1d07d1[_0xed75('0xc')]),_0x21dcff);}};exports[_0xed75('0x11')]=function(_0x52cd21){try{utils['debug'](util[_0xed75('0x4')](_0xed75('0x12'),_0x52cd21[_0xed75('0x8')]),_0x52cd21);utils['info'](util[_0xed75('0x4')](_0xed75('0x13'),_0x52cd21[_0xed75('0x8')],_0x52cd21['origtransferercalleridnum'],_0x52cd21[_0xed75('0x14')],_0x52cd21[_0xed75('0x15')],_0x52cd21['transfertargetcalleridname']));_0x52cd21=_[_0xed75('0x16')](_0x52cd21,{'transfererchannel':_0x52cd21[_0xed75('0x17')],'transferercalleridnum':_0x52cd21['origtransferercalleridnum'],'transferercalleridname':_0x52cd21[_0xed75('0x14')],'transfererconnectedlinenum':_0x52cd21[_0xed75('0x18')],'transfererconnectedlinename':_0x52cd21['secondtransfererconnectedlinename'],'transfereraccountcode':_0x52cd21[_0xed75('0x19')],'transferercontext':_0x52cd21[_0xed75('0x1a')],'transfererexten':_0x52cd21[_0xed75('0x1b')],'transfererlinkedid':_0x52cd21[_0xed75('0x1c')],'context':_0x52cd21[_0xed75('0x1d')],'extension':_0x52cd21[_0xed75('0x1e')],'type':_0xed75('0x7')});if(_[_0xed75('0x1f')](_0x52cd21[_0xed75('0x20')])){_0x52cd21=_[_0xed75('0x16')](_0x52cd21,{'transfereechannel':_0x52cd21[_0xed75('0x21')],'transfereecalleridnum':_0x52cd21[_0xed75('0x15')],'transfereecalleridname':_0x52cd21[_0xed75('0x22')],'transfereeconnectedlinenum':_0x52cd21[_0xed75('0x23')],'transfereeconnectedlinename':_0x52cd21['transfertargetconnectedlinename'],'transfereeaccountcode':_0x52cd21[_0xed75('0x24')],'transfereecontext':_0x52cd21[_0xed75('0x25')],'transfereeexten':_0x52cd21[_0xed75('0x26')],'transfereelinkedid':_0x52cd21[_0xed75('0x27')]});}writeDB(_0x52cd21);}catch(_0x3cd865){utils[_0xed75('0x28')](util[_0xed75('0x4')]('[%s][transfers][attendedtransfer]',_0x52cd21['origtransfereruniqueid']),_0x3cd865);}}; \ No newline at end of file diff --git a/server/services/xdr/utils.js b/server/services/xdr/utils.js index 7131a89..2b324db 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 _0x5e89=['seconds','format','YYYY-MM-DD\x20HH:mm:ss','subtract','sumTime','now','isAfter','isBefore','client','http','../../config/logger','xdr','info','inspect','debug','error','request','then','[utils][request]\x20name:%s','internal','name','[utils][getUser]\x20where:%s','stringify','result','length','getUserByInternal','[utils][getUserByInternal]\x20internal:%s\x20%s','found','notfound','catch','[utils][getUserByInternal]','getUserByInterface','[utils][getUserByInterface]\x20interface:%s\x20%s','[utils][getUserByInterface]','getUserByName','[utils][getUserByName]\x20name:%s\x20%s','[utils][getUserByName]','GetVoiceQueue','type','acwTimeout','[utils][getVoiceQueueByName]\x20name:%s','[utils][getVoiceQueueByName]\x20name:%s\x20%s','[utils][getVoiceQueueByName]','addTime','add'];(function(_0xb7a459,_0xc13228){var _0x104ab5=function(_0x186a0e){while(--_0x186a0e){_0xb7a459['push'](_0xb7a459['shift']());}};_0x104ab5(++_0xc13228);}(_0x5e89,0x19d));var _0x95e8=function(_0x376b45,_0x5964fb){_0x376b45=_0x376b45-0x0;var _0x2341b3=_0x5e89[_0x376b45];return _0x2341b3;};'use strict';var BPromise=require('bluebird');var jayson=require('jayson/promise');var moment=require('moment');var util=require('util');var client=jayson[_0x95e8('0x0')][_0x95e8('0x1')]({'port':0x2329});var logger=require(_0x95e8('0x2'))(_0x95e8('0x3'));exports[_0x95e8('0x4')]=function(_0x4e9159,_0x4f110c){logger[_0x95e8('0x4')](_0x4e9159,_0x4f110c?util[_0x95e8('0x5')](_0x4f110c,{'showHidden':![],'depth':null}):'');};exports[_0x95e8('0x6')]=function(_0x3c21c7,_0x5bc956){logger[_0x95e8('0x6')](_0x3c21c7,_0x5bc956?util[_0x95e8('0x5')](_0x5bc956,{'showHidden':![],'depth':null}):'');};exports['error']=function(_0x124601,_0x17f9b8){logger[_0x95e8('0x7')](_0x124601,_0x17f9b8?util[_0x95e8('0x5')](_0x17f9b8,{'showHidden':![],'depth':null}):'');};exports['request']=function(_0x41c0b2,_0x26c2af){return client[_0x95e8('0x8')](_0x41c0b2,{'body':_0x26c2af})[_0x95e8('0x9')](function(_0x375857){logger[_0x95e8('0x6')]('[utils][request]\x20name:%s',_0x41c0b2,_0x375857?util['inspect'](_0x375857,{'showHidden':![],'depth':null}):'');})['catch'](function(_0x57f809){logger[_0x95e8('0x7')](_0x95e8('0xa'),_0x41c0b2,_0x57f809?util[_0x95e8('0x5')](_0x57f809,{'showHidden':![],'depth':null}):'');});};function getUser(_0x1bc70b){return client['request']('GetUser',{'options':{'raw':!![],'attributes':['id',_0x95e8('0xb'),_0x95e8('0xc'),'interface'],'where':_0x1bc70b,'limit':0x1}})[_0x95e8('0x9')](function(_0x152efd){logger[_0x95e8('0x6')](_0x95e8('0xd'),JSON[_0x95e8('0xe')](_0x1bc70b),_0x152efd?util[_0x95e8('0x5')](_0x152efd,{'showHidden':![],'depth':null}):'');return _0x152efd[_0x95e8('0xf')][_0x95e8('0x10')]?_0x152efd[_0x95e8('0xf')][0x0]:null;});}exports[_0x95e8('0x11')]=function(_0x3fde9d){return new BPromise(function(_0x2b8bb8,_0x9133a3){if(_0x3fde9d){return getUser({'internal':_0x3fde9d})[_0x95e8('0x9')](function(_0x1cfe27){logger[_0x95e8('0x4')](_0x95e8('0x12'),_0x3fde9d,_0x1cfe27?_0x95e8('0x13'):_0x95e8('0x14'));return _0x2b8bb8(_0x1cfe27);})[_0x95e8('0x15')](function(_0x1f49da){logger[_0x95e8('0x7')](_0x95e8('0x16'),_0x1f49da?util[_0x95e8('0x5')](_0x1f49da,{'showHidden':![],'depth':null}):'');return _0x2b8bb8(null);});}return _0x2b8bb8(null);});};exports[_0x95e8('0x17')]=function(_0x25d4ca){return new BPromise(function(_0x26be17,_0x512bfe){if(_0x25d4ca){return getUser({'interface':_0x25d4ca})[_0x95e8('0x9')](function(_0x5b1e6b){logger['info'](_0x95e8('0x18'),_0x25d4ca,_0x5b1e6b?_0x95e8('0x13'):'notfound');return _0x26be17(_0x5b1e6b);})['catch'](function(_0x571969){logger[_0x95e8('0x7')](_0x95e8('0x19'),_0x571969?util['inspect'](_0x571969,{'showHidden':![],'depth':null}):'');return _0x26be17(null);});}return _0x26be17(null);});};exports[_0x95e8('0x1a')]=function(_0x10f64c){return new BPromise(function(_0x6d97a9,_0x237cf3){if(_0x10f64c){return getUser({'name':_0x10f64c})[_0x95e8('0x9')](function(_0x161aab){logger['info'](_0x95e8('0x1b'),_0x10f64c,_0x161aab?'found':_0x95e8('0x14'));return _0x6d97a9(_0x161aab);})[_0x95e8('0x15')](function(_0x458b9f){logger[_0x95e8('0x7')](_0x95e8('0x1c'),_0x458b9f?util['inspect'](_0x458b9f,{'showHidden':![],'depth':null}):'');return _0x6d97a9(null);});}return _0x6d97a9(null);});};exports['getVoiceQueueByName']=function(_0x2849a3){return new BPromise(function(_0x666426,_0xcda85c){if(_0x2849a3){return client[_0x95e8('0x8')](_0x95e8('0x1d'),{'options':{'raw':!![],'attributes':['id','name',_0x95e8('0x1e'),'acw',_0x95e8('0x1f')],'where':{'name':_0x2849a3},'limit':0x1}})[_0x95e8('0x9')](function(_0xc2295e){logger[_0x95e8('0x6')](_0x95e8('0x20'),_0x2849a3,_0xc2295e?util[_0x95e8('0x5')](_0xc2295e,{'showHidden':![],'depth':null}):'');logger['info'](_0x95e8('0x21'),_0x2849a3,_0xc2295e?_0x95e8('0x13'):_0x95e8('0x14'));return _0x666426(_0xc2295e[_0x95e8('0xf')][_0x95e8('0x10')]?_0xc2295e[_0x95e8('0xf')][0x0]:null);})[_0x95e8('0x15')](function(_0x36422a){logger[_0x95e8('0x7')](_0x95e8('0x22'),_0x36422a?util[_0x95e8('0x5')](_0x36422a,{'showHidden':![],'depth':null}):'');return _0x666426(null);});}return _0x666426(null);});};exports[_0x95e8('0x23')]=function(_0x494eea,_0x315020){return moment(_0x494eea)[_0x95e8('0x24')](_0x315020,_0x95e8('0x25'))[_0x95e8('0x26')](_0x95e8('0x27'));};exports['subtractTime']=function(_0x584d0a,_0xdc9239){return moment(_0x584d0a)[_0x95e8('0x28')](_0xdc9239,_0x95e8('0x25'))[_0x95e8('0x26')](_0x95e8('0x27'));};exports['diffTime']=function(_0x4d9a9a,_0x527832){return moment(_0x4d9a9a)['diff'](moment(_0x527832),_0x95e8('0x25'));};exports[_0x95e8('0x29')]=function(_0x127251,_0x5e2f90){return parseInt(_0x127251,0xa)+parseInt(_0x5e2f90,0xa);};exports[_0x95e8('0x2a')]=function(){return moment()[_0x95e8('0x26')](_0x95e8('0x27'));};exports[_0x95e8('0x2b')]=function(_0x21e0cb,_0x5cf182){if(_0x5cf182){return moment(_0x21e0cb)['isAfter'](_0x5cf182);}return!![];};exports[_0x95e8('0x2c')]=function(_0x1b1fe0,_0x3c2df7){if(_0x3c2df7){return moment(_0x1b1fe0)[_0x95e8('0x2c')](_0x3c2df7);}else if(_0x1b1fe0){return!![];}return![];}; \ No newline at end of file +var _0x2133=['error','request','then','catch','internal','interface','[utils][getUser]\x20where:%s','stringify','result','length','getUserByInternal','[utils][getUserByInternal]\x20internal:%s\x20%s','found','notfound','[utils][getUserByInternal]','getUserByInterface','[utils][getUserByInterface]\x20interface:%s\x20%s','[utils][getUserByInterface]','getUserByName','GetVoiceQueue','acw','acwTimeout','[utils][getVoiceQueueByName]\x20name:%s','[utils][getVoiceQueueByName]\x20name:%s\x20%s','[utils][getVoiceQueueByName]','add','seconds','format','subtractTime','subtract','YYYY-MM-DD\x20HH:mm:ss','diffTime','diff','sumTime','now','isAfter','isBefore','moment','util','http','../../config/logger','xdr','info','inspect','debug'];(function(_0x53a25c,_0x5aa1bb){var _0x3d8aa0=function(_0x35e2c3){while(--_0x35e2c3){_0x53a25c['push'](_0x53a25c['shift']());}};_0x3d8aa0(++_0x5aa1bb);}(_0x2133,0x1e7));var _0x3213=function(_0x49d11a,_0x1eeec3){_0x49d11a=_0x49d11a-0x0;var _0x49eafe=_0x2133[_0x49d11a];return _0x49eafe;};'use strict';var BPromise=require('bluebird');var jayson=require('jayson/promise');var moment=require(_0x3213('0x0'));var util=require(_0x3213('0x1'));var client=jayson['client'][_0x3213('0x2')]({'port':0x2329});var logger=require(_0x3213('0x3'))(_0x3213('0x4'));exports[_0x3213('0x5')]=function(_0x278830,_0x57d277){logger[_0x3213('0x5')](_0x278830,_0x57d277?util[_0x3213('0x6')](_0x57d277,{'showHidden':![],'depth':null}):'');};exports['debug']=function(_0x24ba3a,_0x19873e){logger[_0x3213('0x7')](_0x24ba3a,_0x19873e?util['inspect'](_0x19873e,{'showHidden':![],'depth':null}):'');};exports[_0x3213('0x8')]=function(_0x3f9c91,_0x5adc0b){logger[_0x3213('0x8')](_0x3f9c91,_0x5adc0b?util[_0x3213('0x6')](_0x5adc0b,{'showHidden':![],'depth':null}):'');};exports[_0x3213('0x9')]=function(_0x1ee5dc,_0x324225){return client[_0x3213('0x9')](_0x1ee5dc,{'body':_0x324225})[_0x3213('0xa')](function(_0x10b118){logger[_0x3213('0x7')]('[utils][request]\x20name:%s',_0x1ee5dc,_0x10b118?util[_0x3213('0x6')](_0x10b118,{'showHidden':![],'depth':null}):'');})[_0x3213('0xb')](function(_0x518ca6){logger[_0x3213('0x8')]('[utils][request]\x20name:%s',_0x1ee5dc,_0x518ca6?util[_0x3213('0x6')](_0x518ca6,{'showHidden':![],'depth':null}):'');});};function getUser(_0x1cb334){return client[_0x3213('0x9')]('GetUser',{'options':{'raw':!![],'attributes':['id',_0x3213('0xc'),'name',_0x3213('0xd')],'where':_0x1cb334,'limit':0x1}})[_0x3213('0xa')](function(_0x586446){logger[_0x3213('0x7')](_0x3213('0xe'),JSON[_0x3213('0xf')](_0x1cb334),_0x586446?util[_0x3213('0x6')](_0x586446,{'showHidden':![],'depth':null}):'');return _0x586446[_0x3213('0x10')][_0x3213('0x11')]?_0x586446['result'][0x0]:null;});}exports[_0x3213('0x12')]=function(_0x10dadd){return new BPromise(function(_0x5c7f34,_0x1c1229){if(_0x10dadd){return getUser({'internal':_0x10dadd})[_0x3213('0xa')](function(_0x9d10a8){logger[_0x3213('0x5')](_0x3213('0x13'),_0x10dadd,_0x9d10a8?_0x3213('0x14'):_0x3213('0x15'));return _0x5c7f34(_0x9d10a8);})[_0x3213('0xb')](function(_0x1ef5ca){logger[_0x3213('0x8')](_0x3213('0x16'),_0x1ef5ca?util[_0x3213('0x6')](_0x1ef5ca,{'showHidden':![],'depth':null}):'');return _0x5c7f34(null);});}return _0x5c7f34(null);});};exports[_0x3213('0x17')]=function(_0x5975d8){return new BPromise(function(_0x59d2ca,_0x3a13b3){if(_0x5975d8){return getUser({'interface':_0x5975d8})[_0x3213('0xa')](function(_0x579a4c){logger[_0x3213('0x5')](_0x3213('0x18'),_0x5975d8,_0x579a4c?_0x3213('0x14'):'notfound');return _0x59d2ca(_0x579a4c);})['catch'](function(_0xa2899){logger[_0x3213('0x8')](_0x3213('0x19'),_0xa2899?util[_0x3213('0x6')](_0xa2899,{'showHidden':![],'depth':null}):'');return _0x59d2ca(null);});}return _0x59d2ca(null);});};exports[_0x3213('0x1a')]=function(_0x2c3adc){return new BPromise(function(_0x33c3d8,_0xb555af){if(_0x2c3adc){return getUser({'name':_0x2c3adc})[_0x3213('0xa')](function(_0x3726c9){logger['info']('[utils][getUserByName]\x20name:%s\x20%s',_0x2c3adc,_0x3726c9?'found':'notfound');return _0x33c3d8(_0x3726c9);})['catch'](function(_0x164dc7){logger['error']('[utils][getUserByName]',_0x164dc7?util['inspect'](_0x164dc7,{'showHidden':![],'depth':null}):'');return _0x33c3d8(null);});}return _0x33c3d8(null);});};exports['getVoiceQueueByName']=function(_0x287164){return new BPromise(function(_0xfbbb35,_0x5491d0){if(_0x287164){return client[_0x3213('0x9')](_0x3213('0x1b'),{'options':{'raw':!![],'attributes':['id','name','type',_0x3213('0x1c'),_0x3213('0x1d')],'where':{'name':_0x287164},'limit':0x1}})[_0x3213('0xa')](function(_0x961d81){logger[_0x3213('0x7')](_0x3213('0x1e'),_0x287164,_0x961d81?util[_0x3213('0x6')](_0x961d81,{'showHidden':![],'depth':null}):'');logger[_0x3213('0x5')](_0x3213('0x1f'),_0x287164,_0x961d81?_0x3213('0x14'):_0x3213('0x15'));return _0xfbbb35(_0x961d81[_0x3213('0x10')][_0x3213('0x11')]?_0x961d81[_0x3213('0x10')][0x0]:null);})[_0x3213('0xb')](function(_0x1e7849){logger[_0x3213('0x8')](_0x3213('0x20'),_0x1e7849?util[_0x3213('0x6')](_0x1e7849,{'showHidden':![],'depth':null}):'');return _0xfbbb35(null);});}return _0xfbbb35(null);});};exports['addTime']=function(_0x5b8227,_0x12c327){return moment(_0x5b8227)[_0x3213('0x21')](_0x12c327,_0x3213('0x22'))[_0x3213('0x23')]('YYYY-MM-DD\x20HH:mm:ss');};exports[_0x3213('0x24')]=function(_0x5a4419,_0x124c26){return moment(_0x5a4419)[_0x3213('0x25')](_0x124c26,_0x3213('0x22'))['format'](_0x3213('0x26'));};exports[_0x3213('0x27')]=function(_0x3751bf,_0x5dc471){return moment(_0x3751bf)[_0x3213('0x28')](moment(_0x5dc471),_0x3213('0x22'));};exports[_0x3213('0x29')]=function(_0x2c0698,_0x170917){return parseInt(_0x2c0698,0xa)+parseInt(_0x170917,0xa);};exports[_0x3213('0x2a')]=function(){return moment()[_0x3213('0x23')]('YYYY-MM-DD\x20HH:mm:ss');};exports[_0x3213('0x2b')]=function(_0x1db9f8,_0x4a516a){if(_0x4a516a){return moment(_0x1db9f8)[_0x3213('0x2b')](_0x4a516a);}return!![];};exports[_0x3213('0x2c')]=function(_0xba3c48,_0x5cbb38){if(_0x5cbb38){return moment(_0xba3c48)[_0x3213('0x2c')](_0x5cbb38);}else if(_0xba3c48){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 186ccf2..7748998 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 _0x0456=['then','log','user','data','catch','set','client-side-logger','logger','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','body','\x20body=%s','format','method','headers','x-forwarded-for','remoteAddress','url','statusCode','responseTime','name','inspect','use','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','agent_id','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)','connection','device','other','agent_name','test','setupLoggers','fs-extra','lodash','express-winston','path','util','./loggers','fileLogger','./safe-template','safeTemplate','maskSensitiveData','join','/var','xcally','client','role','ensureDir'];(function(_0x163530,_0x3a0d2c){var _0x2da711=function(_0x5c677e){while(--_0x5c677e){_0x163530['push'](_0x163530['shift']());}};_0x2da711(++_0x3a0d2c);}(_0x0456,0x10a));var _0x6045=function(_0x1e32de,_0x135d1c){_0x1e32de=_0x1e32de-0x0;var _0x5a73b8=_0x0456[_0x1e32de];return _0x5a73b8;};var fs=require(_0x6045('0x0'));var _=require(_0x6045('0x1'));var ewinston=require(_0x6045('0x2'));var path=require(_0x6045('0x3'));var util=require(_0x6045('0x4'));var fileLogger=require(_0x6045('0x5'))[_0x6045('0x6')];var safeTemplate=require(_0x6045('0x7'))[_0x6045('0x8')];var maskSensitiveData=require('./mask-sensitive-data')[_0x6045('0x9')];function ClientSideLogger(){function _0x2f93c0(_0x42a987){var _0x2f1575=path[_0x6045('0xa')](_0x6045('0xb'),'log',_0x6045('0xc'));var _0x3fef4e=path[_0x6045('0xa')](_0x6045('0xd'),_0x42a987[_0x6045('0xe')]+'-'+_0x42a987['name']);return fs[_0x6045('0xf')](path['join'](_0x2f1575,_0x3fef4e))[_0x6045('0x10')](function(){var _0x5673ca=fileLogger(_0x6045('0xd'),path[_0x6045('0xa')](_0x2f1575,_0x3fef4e));return _0x5673ca;})['catch'](function(_0x220426){throw _0x220426;});}this[_0x6045('0x11')]=function(_0x31e658,_0x1562f8,_0x4b7a1b,_0x4aefc0){return _0x2f93c0(_0x31e658['user'])[_0x6045('0x10')](function(_0x497228){var _0xd1e9fa=_0x497228[_0x1562f8];return _0xd1e9fa;})[_0x6045('0x10')](function(_0x42f13a){var _0x231962=_0x31e658[_0x6045('0x12')]?_0x31e658[_0x6045('0x12')]['id']:'no-user';var _0x4001e8=_0x4aefc0[_0x6045('0x13')];var _0x26e72e=_0x4aefc0['timestamp'];var _0x1690a0=new Date(Number(_0x26e72e));return _0x42f13a(_0x231962,_0x1690a0,_0x4b7a1b,_0x4001e8);})[_0x6045('0x14')](function(_0xf9b5d9){fileLogger(_0x6045('0xd'))['error'](_0xf9b5d9);});};}function setupLoggers(_0x34613f){return new Promise(function(_0x1c6b13){var _0x49107f=new ClientSideLogger();var _0xb8972f=fileLogger('api');var _0x18128e=fileLogger('auth');_0x34613f[_0x6045('0x15')](_0x6045('0x16'),_0x49107f);_0x34613f['use'](ewinston[_0x6045('0x17')]({'winstonInstance':_0xb8972f,'meta':![],'statusLevels':!![],'msg':function(_0x2a14c9,_0x1702b9){var _0xb94b0b=_0x6045('0x18');if(!_['isEmpty'](_0x2a14c9[_0x6045('0x19')])){_0xb94b0b+=_0x6045('0x1a');var _0x244432=_0x2a14c9[_0x6045('0x19')];maskSensitiveData(_0x244432);}return safeTemplate(util[_0x6045('0x1b')](_0xb94b0b,_0x2a14c9[_0x6045('0x1c')],_0x2a14c9[_0x6045('0x1d')][_0x6045('0x1e')]?_0x2a14c9[_0x6045('0x1d')][_0x6045('0x1e')]:_0x2a14c9['connection'][_0x6045('0x1f')]||_0x2a14c9['ip'],_0x2a14c9[_0x6045('0x20')],_0x1702b9[_0x6045('0x21')],_0x1702b9[_0x6045('0x22')],_0x2a14c9[_0x6045('0x12')]?_0x2a14c9[_0x6045('0x12')]['id']:null,_0x2a14c9[_0x6045('0x12')]?_0x2a14c9[_0x6045('0x12')][_0x6045('0x23')]:null,_0x2a14c9[_0x6045('0x12')]?_0x2a14c9['user'][_0x6045('0xe')]:null,_0x244432?util[_0x6045('0x24')](_0x244432,![],null):''));}}));_0x34613f[_0x6045('0x25')](ewinston[_0x6045('0x17')]({'winstonInstance':_0x18128e,'meta':![],'statusLevels':!![],'msg':function(_0x1c8e5a,_0x731534){var _0x3008a2=_0x6045('0x26');if(_0x1c8e5a[_0x6045('0x19')]&&_0x1c8e5a['body']['device']&&_0x1c8e5a[_0x6045('0x19')][_0x6045('0x27')]){_0x3008a2=_0x6045('0x28');}return util['format'](_0x3008a2,_0x1c8e5a[_0x6045('0x1c')],_0x1c8e5a[_0x6045('0x1d')]['x-forwarded-for']?_0x1c8e5a[_0x6045('0x1d')]['x-forwarded-for']:_0x1c8e5a[_0x6045('0x29')][_0x6045('0x1f')]||_0x1c8e5a['ip'],_0x1c8e5a[_0x6045('0x20')],_0x731534[_0x6045('0x21')],_0x731534[_0x6045('0x22')],_0x1c8e5a['user']?_0x1c8e5a[_0x6045('0x12')]['id']:null,_0x1c8e5a[_0x6045('0x12')]?_0x1c8e5a['user'][_0x6045('0x23')]:null,_0x1c8e5a[_0x6045('0x12')]?_0x1c8e5a['user'][_0x6045('0xe')]:null,_0x1c8e5a['body']&&_0x1c8e5a['body']['device']?_0x1c8e5a[_0x6045('0x19')][_0x6045('0x2a')]:_0x6045('0x2b'),_0x1c8e5a[_0x6045('0x19')]&&_0x1c8e5a['body'][_0x6045('0x27')]?_0x1c8e5a[_0x6045('0x19')]['agent_id']:'',_0x1c8e5a[_0x6045('0x19')]&&_0x1c8e5a[_0x6045('0x19')][_0x6045('0x2c')]?_0x1c8e5a['body'][_0x6045('0x2c')]:'');},'ignoreRoute':function(_0x59d126){var _0x54b284=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x54b284[_0x6045('0x2d')](_0x59d126[_0x6045('0x20')]);}}));return _0x1c6b13();});}exports[_0x6045('0x2e')]=setupLoggers; \ No newline at end of file +var _0x0ad0=['use','logger','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','isEmpty','body','format','headers','x-forwarded-for','connection','remoteAddress','url','statusCode','responseTime','inspect','device','agent_id','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)','method','agent_name','test','setupLoggers','express-winston','path','util','fileLogger','./safe-template','./mask-sensitive-data','maskSensitiveData','join','/var','log','xcally','client','role','name','ensureDir','then','catch','user','no-user','data','timestamp','api','set','client-side-logger'];(function(_0x34bc30,_0x177cb0){var _0x5706de=function(_0x535a8c){while(--_0x535a8c){_0x34bc30['push'](_0x34bc30['shift']());}};_0x5706de(++_0x177cb0);}(_0x0ad0,0x150));var _0x00ad=function(_0x238b08,_0x3970d5){_0x238b08=_0x238b08-0x0;var _0x5d06ae=_0x0ad0[_0x238b08];return _0x5d06ae;};var fs=require('fs-extra');var _=require('lodash');var ewinston=require(_0x00ad('0x0'));var path=require(_0x00ad('0x1'));var util=require(_0x00ad('0x2'));var fileLogger=require('./loggers')[_0x00ad('0x3')];var safeTemplate=require(_0x00ad('0x4'))['safeTemplate'];var maskSensitiveData=require(_0x00ad('0x5'))[_0x00ad('0x6')];function ClientSideLogger(){function _0x325c91(_0x566152){var _0xcba204=path[_0x00ad('0x7')](_0x00ad('0x8'),_0x00ad('0x9'),_0x00ad('0xa'));var _0x43af2d=path[_0x00ad('0x7')](_0x00ad('0xb'),_0x566152[_0x00ad('0xc')]+'-'+_0x566152[_0x00ad('0xd')]);return fs[_0x00ad('0xe')](path[_0x00ad('0x7')](_0xcba204,_0x43af2d))[_0x00ad('0xf')](function(){var _0x5f35ee=fileLogger(_0x00ad('0xb'),path[_0x00ad('0x7')](_0xcba204,_0x43af2d));return _0x5f35ee;})[_0x00ad('0x10')](function(_0x1fd292){throw _0x1fd292;});}this[_0x00ad('0x9')]=function(_0x55074e,_0x4ca46d,_0x236363,_0x395135){return _0x325c91(_0x55074e[_0x00ad('0x11')])[_0x00ad('0xf')](function(_0x1f9915){var _0x3e8d23=_0x1f9915[_0x4ca46d];return _0x3e8d23;})[_0x00ad('0xf')](function(_0x382b82){var _0x4e6e4b=_0x55074e['user']?_0x55074e[_0x00ad('0x11')]['id']:_0x00ad('0x12');var _0x514d99=_0x395135[_0x00ad('0x13')];var _0x14a9f7=_0x395135[_0x00ad('0x14')];var _0x27915f=new Date(Number(_0x14a9f7));return _0x382b82(_0x4e6e4b,_0x27915f,_0x236363,_0x514d99);})[_0x00ad('0x10')](function(_0x3ef93b){fileLogger(_0x00ad('0xb'))['error'](_0x3ef93b);});};}function setupLoggers(_0x1416de){return new Promise(function(_0x314d17){var _0x378830=new ClientSideLogger();var _0x4a73a1=fileLogger(_0x00ad('0x15'));var _0x18d214=fileLogger('auth');_0x1416de[_0x00ad('0x16')](_0x00ad('0x17'),_0x378830);_0x1416de[_0x00ad('0x18')](ewinston[_0x00ad('0x19')]({'winstonInstance':_0x4a73a1,'meta':![],'statusLevels':!![],'msg':function(_0x9c2c47,_0x56a5c2){var _0x3bab36=_0x00ad('0x1a');if(!_[_0x00ad('0x1b')](_0x9c2c47[_0x00ad('0x1c')])){_0x3bab36+='\x20body=%s';var _0xc7ef61=_0x9c2c47[_0x00ad('0x1c')];maskSensitiveData(_0xc7ef61);}return safeTemplate(util[_0x00ad('0x1d')](_0x3bab36,_0x9c2c47['method'],_0x9c2c47[_0x00ad('0x1e')]['x-forwarded-for']?_0x9c2c47[_0x00ad('0x1e')][_0x00ad('0x1f')]:_0x9c2c47[_0x00ad('0x20')][_0x00ad('0x21')]||_0x9c2c47['ip'],_0x9c2c47[_0x00ad('0x22')],_0x56a5c2[_0x00ad('0x23')],_0x56a5c2[_0x00ad('0x24')],_0x9c2c47[_0x00ad('0x11')]?_0x9c2c47['user']['id']:null,_0x9c2c47['user']?_0x9c2c47[_0x00ad('0x11')]['name']:null,_0x9c2c47[_0x00ad('0x11')]?_0x9c2c47[_0x00ad('0x11')][_0x00ad('0xc')]:null,_0xc7ef61?util[_0x00ad('0x25')](_0xc7ef61,![],null):''));}}));_0x1416de[_0x00ad('0x18')](ewinston[_0x00ad('0x19')]({'winstonInstance':_0x18d214,'meta':![],'statusLevels':!![],'msg':function(_0x183f60,_0x4ee45b){var _0x32dcf6='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s';if(_0x183f60[_0x00ad('0x1c')]&&_0x183f60['body'][_0x00ad('0x26')]&&_0x183f60['body'][_0x00ad('0x27')]){_0x32dcf6=_0x00ad('0x28');}return util[_0x00ad('0x1d')](_0x32dcf6,_0x183f60[_0x00ad('0x29')],_0x183f60[_0x00ad('0x1e')][_0x00ad('0x1f')]?_0x183f60[_0x00ad('0x1e')]['x-forwarded-for']:_0x183f60[_0x00ad('0x20')][_0x00ad('0x21')]||_0x183f60['ip'],_0x183f60['url'],_0x4ee45b[_0x00ad('0x23')],_0x4ee45b['responseTime'],_0x183f60[_0x00ad('0x11')]?_0x183f60[_0x00ad('0x11')]['id']:null,_0x183f60[_0x00ad('0x11')]?_0x183f60[_0x00ad('0x11')][_0x00ad('0xd')]:null,_0x183f60[_0x00ad('0x11')]?_0x183f60[_0x00ad('0x11')][_0x00ad('0xc')]:null,_0x183f60['body']&&_0x183f60['body'][_0x00ad('0x26')]?_0x183f60[_0x00ad('0x1c')][_0x00ad('0x26')]:'other',_0x183f60[_0x00ad('0x1c')]&&_0x183f60['body']['agent_id']?_0x183f60[_0x00ad('0x1c')]['agent_id']:'',_0x183f60[_0x00ad('0x1c')]&&_0x183f60[_0x00ad('0x1c')]['agent_name']?_0x183f60[_0x00ad('0x1c')][_0x00ad('0x2a')]:'');},'ignoreRoute':function(_0x4dd602){var _0x332841=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x332841[_0x00ad('0x2b')](_0x4dd602['url']);}}));return _0x314d17();});}exports[_0x00ad('0x2c')]=setupLoggers; \ No newline at end of file diff --git a/server/utils/iftime.js b/server/utils/iftime.js index 349351c..cb1a7d4 100644 --- a/server/utils/iftime.js +++ b/server/utils/iftime.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0b2c=['length','padStart','iftime','lodash','source','join','Interval\x20string\x20not\x20valid','Date\x20not\x20valid','isValid','locale','weekdaysShort','toLowerCase','indexOf','slice','concat','exports','circularDoWInterval','monthsShort','map','clone','hours','minutes','startOf','day','endOf','isBetween','timeCompare','format','ddd','includes','dowCompare','date','daysInMonth','max','min','domCompare','MMM','monthCompare','guess','test','isMoment','split'];(function(_0x1af5b2,_0x1b82fe){var _0xf1aa2d=function(_0x2ceae2){while(--_0x2ceae2){_0x1af5b2['push'](_0x1af5b2['shift']());}};_0xf1aa2d(++_0x1b82fe);}(_0x0b2c,0x153));var _0xc0b2=function(_0xfd91ee,_0x44e4ce){_0xfd91ee=_0xfd91ee-0x0;var _0x1043e4=_0x0b2c[_0xfd91ee];return _0x1043e4;};var _=require(_0xc0b2('0x0'));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(_0x45afcb){return _0x45afcb[_0xc0b2('0x1')];})[_0xc0b2('0x2')](',');var validateRx=new RegExp('^'+globalRx+'$');var EINVALID_STRING=_0xc0b2('0x3');var EINVALID_DATE=_0xc0b2('0x4');function throwIfDateNotValid(_0x5a0040){if(!_0x5a0040[_0xc0b2('0x5')]()){throw new Error(EINVALID_DATE);}}function extractTime(_0x5c630b){var _0x1481f4=_0x5c630b['split'](':')['map'](function(_0x1b11a1){return parseInt(_0x1b11a1,0xa);});var _0x55e091=_0x1481f4[0x0];var _0x43159a=_0x1481f4[0x1];if(_0x55e091<0x0||_0x55e091>0x17||_0x43159a<0x0||_0x43159a>0x3b){throw new Error(EINVALID_DATE);}return[_0x55e091,_0x43159a];}function circularDoWInterval(_0x5a486b,_0x58daf7){if(_0x5a486b===_0x58daf7){return[_0x5a486b];}else{var _0x380ca2=moment[_0xc0b2('0x6')]();moment[_0xc0b2('0x6')]('en');var _0x41bc92=moment[_0xc0b2('0x7')]()['map'](function(_0x4359b9){return _0x4359b9[_0xc0b2('0x8')]();});moment[_0xc0b2('0x6')](_0x380ca2);var _0x366b09=_0x41bc92[_0xc0b2('0x9')](_0x5a486b);var _0x3640ac=_0x41bc92[_0xc0b2('0x9')](_0x58daf7);if(_0x3640ac>_0x366b09){return _0x41bc92[_0xc0b2('0xa')](_0x366b09,_0x3640ac+0x1);}else{var _0x9e0218=_0x41bc92['slice'](0x0,_0x3640ac+0x1);var _0xc716b7=_0x41bc92[_0xc0b2('0xa')](_0x366b09);return _0xc716b7[_0xc0b2('0xb')](_0x9e0218);}}}module[_0xc0b2('0xc')][_0xc0b2('0xd')]=circularDoWInterval;function circularMonthInterval(_0x4958b3,_0x3bd6fb){if(_0x4958b3===_0x3bd6fb){return[_0x4958b3];}else{var _0xa2c93b=moment[_0xc0b2('0x6')]();moment['locale']('en');var _0x44c765=moment[_0xc0b2('0xe')]()[_0xc0b2('0xf')](function(_0x5196b5){return _0x5196b5[_0xc0b2('0x8')]();});moment[_0xc0b2('0x6')](_0xa2c93b);var _0x514059=_0x44c765[_0xc0b2('0x9')](_0x4958b3);var _0x297b14=_0x44c765[_0xc0b2('0x9')](_0x3bd6fb);if(_0x297b14>_0x514059){return _0x44c765[_0xc0b2('0xa')](_0x514059,_0x297b14+0x1);}else{var _0x2ac1bf=_0x44c765[_0xc0b2('0xa')](0x0,_0x297b14+0x1);var _0x22de16=_0x44c765[_0xc0b2('0xa')](_0x514059);return _0x22de16[_0xc0b2('0xb')](_0x2ac1bf);}}}module[_0xc0b2('0xc')]['circularMonthInterval']=circularMonthInterval;function parseDom(_0x3bcac5){var _0x38835b=parseInt(_0x3bcac5,0xa);if(_0x38835b<0x1||_0x38835b>0x1f){throw new Error(EINVALID_DATE);}return _0x38835b;}function timeCompare(_0x4d5ae,_0x238d67,_0x2efa26){var _0x376251=_0x4d5ae[_0xc0b2('0x10')]();var _0x210d97=extractTime(_0x238d67);var _0x324737=_0x210d97[0x0];var _0x1ae5e8=_0x210d97[0x1];var _0x4ab75e=_0x4d5ae[_0xc0b2('0x10')]()[_0xc0b2('0x11')](_0x324737)[_0xc0b2('0x12')](_0x1ae5e8);throwIfDateNotValid(_0x4ab75e);var _0x355395=extractTime(_0x2efa26);var _0x33428f=_0x355395[0x0];var _0x3c3c76=_0x355395[0x1];var _0x2a747e=_0x4d5ae[_0xc0b2('0x10')]()[_0xc0b2('0x11')](_0x33428f)[_0xc0b2('0x12')](_0x3c3c76);throwIfDateNotValid(_0x2a747e);if(_0x2a747e['isBefore'](_0x4ab75e)){var _0x58b617=_0x376251[_0xc0b2('0x10')]()[_0xc0b2('0x13')](_0xc0b2('0x14'));var _0x226110=_0x376251[_0xc0b2('0x10')]()[_0xc0b2('0x15')](_0xc0b2('0x14'));return _0x376251['isBetween'](_0x4ab75e,_0x226110,undefined,'[]')||_0x376251['isBetween'](_0x58b617,_0x2a747e,undefined,'[]');}else{return _0x376251[_0xc0b2('0x16')](_0x4ab75e,_0x2a747e,undefined,'[]');}}module[_0xc0b2('0xc')][_0xc0b2('0x17')]=timeCompare;function dowCompare(_0x338fb1,_0x32388d,_0xe893ce){var _0xe6c035=_0x338fb1[_0xc0b2('0x6')]('en')[_0xc0b2('0x18')](_0xc0b2('0x19'))[_0xc0b2('0x8')]();return circularDoWInterval(_0x32388d,_0xe893ce)[_0xc0b2('0x1a')](_0xe6c035);}module['exports'][_0xc0b2('0x1b')]=dowCompare;function domCompare(_0x253bf4,_0x358136,_0x65d46f){var _0x5031db=_0x253bf4[_0xc0b2('0x1c')]();if(_0x358136===_0x65d46f){return _0x5031db===_0x358136;}else{var _0xfed2ae=_0x253bf4[_0xc0b2('0x1d')]();var _0x4fb8ae=_0x358136<_0x65d46f;let _0x523f3b=![];var _0x3f9546=0x0;var _0x5a0ef9=0x0;if(_0x4fb8ae){_0x3f9546=Math[_0xc0b2('0x1e')](0x1,_0x358136);_0x5a0ef9=Math['min'](_0x65d46f,_0xfed2ae);_0x523f3b=_0x5031db>=_0x3f9546&&_0x5031db<=_0x5a0ef9;}else{_0x3f9546=Math[_0xc0b2('0x1f')](_0x358136,_0xfed2ae);_0x5a0ef9=Math[_0xc0b2('0x1e')](0x1,_0x65d46f);_0x523f3b=_0x5031db>=_0x3f9546||_0x5031db<=_0x5a0ef9;}return _0x523f3b;}}module[_0xc0b2('0xc')][_0xc0b2('0x20')]=domCompare;function monthCompare(_0x5dcca3,_0x4dc3d3,_0x23f2b5){var _0x5513b9=_0x5dcca3[_0xc0b2('0x6')]('en')['format'](_0xc0b2('0x21'))[_0xc0b2('0x8')]();return circularMonthInterval(_0x4dc3d3,_0x23f2b5)[_0xc0b2('0x1a')](_0x5513b9);}module['exports'][_0xc0b2('0x22')]=monthCompare;function iftime(_0x1a8934,_0x4384e4=moment['tz'][_0xc0b2('0x23')](),_0x2d7d99=moment()){if(!validateRx[_0xc0b2('0x24')](_0x1a8934)){throw new Error(EINVALID_STRING);}else{var _0x18dc7e=(moment[_0xc0b2('0x25')](_0x2d7d99)?_0x2d7d99['clone']():moment(_0x2d7d99))['tz'](_0x4384e4)['locale']('en');throwIfDateNotValid(_0x18dc7e);var _0x9a8162=_0x1a8934[_0xc0b2('0x26')](',');var _0x561442=_0x9a8162[0x0];var _0x2ff685=_0x9a8162[0x1];var _0x421e10=_0x9a8162[0x2];var _0x5f4595=_0x9a8162[0x3];let _0x4a85d0=!![];if(_0x561442!=='*'){var _0x23c9bd=_0x561442[_0xc0b2('0x26')]('-');var _0x5a3583=_['padStart'](_0x23c9bd[0x0],0x5,'0');var _0x101288=_0x23c9bd[_0xc0b2('0x27')]===0x2?_[_0xc0b2('0x28')](_0x23c9bd[0x1],0x5,'0'):_0x5a3583;_0x4a85d0=timeCompare(_0x18dc7e,_0x5a3583,_0x101288);}let _0x23623d=!![];if(_0x2ff685!=='*'){var _0x121747=_0x2ff685[_0xc0b2('0x26')]('-');var _0x12700b=_0x121747[0x0];var _0x21e3df=_0x121747[_0xc0b2('0x27')]===0x2?_0x121747[0x1]:_0x12700b;_0x23623d=dowCompare(_0x18dc7e,_0x12700b,_0x21e3df);}let _0x45d1d2=!![];if(_0x421e10!=='*'){var _0xf4344e=_0x421e10[_0xc0b2('0x26')]('-');var _0x4fa530=parseDom(_0xf4344e[0x0]);var _0xf129e0=_0xf4344e[_0xc0b2('0x27')]===0x2?parseDom(_0xf4344e[0x1]):_0x4fa530;_0x45d1d2=domCompare(_0x18dc7e,_0x4fa530,_0xf129e0);}let _0x448c86=!![];if(_0x5f4595!=='*'){var _0x29916c=_0x5f4595['split']('-');var _0x330f5b=_0x29916c[0x0];var _0x34e389=_0x29916c[_0xc0b2('0x27')]===0x2?_0x29916c[0x1]:_0x29916c[0x0];_0x448c86=monthCompare(_0x18dc7e,_0x330f5b,_0x34e389);}return _0x4a85d0&&_0x23623d&&_0x45d1d2&&_0x448c86;}}module['exports'][_0xc0b2('0x29')]=iftime; \ No newline at end of file +var _0xd51b=['monthCompare','isMoment','padStart','length','iftime','lodash','moment-timezone','map','join','split','locale','weekdaysShort','toLowerCase','indexOf','slice','concat','circularDoWInterval','monthsShort','clone','hours','minutes','isBefore','startOf','day','isBetween','exports','ddd','date','max','min','domCompare','format','MMM','includes'];(function(_0x3c2fce,_0xe26f5f){var _0x4eaf03=function(_0x26c66c){while(--_0x26c66c){_0x3c2fce['push'](_0x3c2fce['shift']());}};_0x4eaf03(++_0xe26f5f);}(_0xd51b,0x8d));var _0xbd51=function(_0x474f83,_0x4eccfa){_0x474f83=_0x474f83-0x0;var _0xcf699f=_0xd51b[_0x474f83];return _0xcf699f;};var _=require(_0xbd51('0x0'));var moment=require(_0xbd51('0x1'));var timeRx=/(\*|(\d{1,2}:\d{1,2})(-(\d{1,2}:\d{1,2}))?)/;var dowRx=/(\*|((sun|mon|tue|wed|thu|fri|sat)(-(sun|mon|tue|wed|thu|fri|sat))?))/;var domRx=/(\*|(\d{1,2})(-(\d{1,2}))?)/;var moyRx=/(\*|(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)(-(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec))?)/;var globalRx=[timeRx,dowRx,domRx,moyRx][_0xbd51('0x2')](function(_0x38df27){return _0x38df27['source'];})[_0xbd51('0x3')](',');var validateRx=new RegExp('^'+globalRx+'$');var EINVALID_STRING='Interval\x20string\x20not\x20valid';var EINVALID_DATE='Date\x20not\x20valid';function throwIfDateNotValid(_0x100ae7){if(!_0x100ae7['isValid']()){throw new Error(EINVALID_DATE);}}function extractTime(_0x2bce99){var _0x8f0459=_0x2bce99[_0xbd51('0x4')](':')[_0xbd51('0x2')](function(_0x5804e6){return parseInt(_0x5804e6,0xa);});var _0x531464=_0x8f0459[0x0];var _0x1fcaf5=_0x8f0459[0x1];if(_0x531464<0x0||_0x531464>0x17||_0x1fcaf5<0x0||_0x1fcaf5>0x3b){throw new Error(EINVALID_DATE);}return[_0x531464,_0x1fcaf5];}function circularDoWInterval(_0x1d2ec7,_0x1a3d80){if(_0x1d2ec7===_0x1a3d80){return[_0x1d2ec7];}else{var _0x155c30=moment[_0xbd51('0x5')]();moment[_0xbd51('0x5')]('en');var _0x1a6bf7=moment[_0xbd51('0x6')]()['map'](function(_0xeb0b98){return _0xeb0b98[_0xbd51('0x7')]();});moment['locale'](_0x155c30);var _0x2fac01=_0x1a6bf7['indexOf'](_0x1d2ec7);var _0x2a7fd9=_0x1a6bf7[_0xbd51('0x8')](_0x1a3d80);if(_0x2a7fd9>_0x2fac01){return _0x1a6bf7[_0xbd51('0x9')](_0x2fac01,_0x2a7fd9+0x1);}else{var _0x5b0439=_0x1a6bf7['slice'](0x0,_0x2a7fd9+0x1);var _0x155254=_0x1a6bf7[_0xbd51('0x9')](_0x2fac01);return _0x155254[_0xbd51('0xa')](_0x5b0439);}}}module['exports'][_0xbd51('0xb')]=circularDoWInterval;function circularMonthInterval(_0x3068fe,_0x327290){if(_0x3068fe===_0x327290){return[_0x3068fe];}else{var _0x2ac234=moment['locale']();moment['locale']('en');var _0x38a54d=moment[_0xbd51('0xc')]()['map'](function(_0x5d1de5){return _0x5d1de5[_0xbd51('0x7')]();});moment['locale'](_0x2ac234);var _0x254896=_0x38a54d[_0xbd51('0x8')](_0x3068fe);var _0x2977ec=_0x38a54d[_0xbd51('0x8')](_0x327290);if(_0x2977ec>_0x254896){return _0x38a54d[_0xbd51('0x9')](_0x254896,_0x2977ec+0x1);}else{var _0x41f235=_0x38a54d[_0xbd51('0x9')](0x0,_0x2977ec+0x1);var _0x595852=_0x38a54d[_0xbd51('0x9')](_0x254896);return _0x595852['concat'](_0x41f235);}}}module['exports']['circularMonthInterval']=circularMonthInterval;function parseDom(_0x32b4be){var _0x42dc60=parseInt(_0x32b4be,0xa);if(_0x42dc60<0x1||_0x42dc60>0x1f){throw new Error(EINVALID_DATE);}return _0x42dc60;}function timeCompare(_0x2b7eaf,_0x2e3280,_0x57492c){var _0x40bb26=_0x2b7eaf[_0xbd51('0xd')]();var _0x3e2fc2=extractTime(_0x2e3280);var _0x167bbd=_0x3e2fc2[0x0];var _0xa5853d=_0x3e2fc2[0x1];var _0x90d1ae=_0x2b7eaf[_0xbd51('0xd')]()[_0xbd51('0xe')](_0x167bbd)[_0xbd51('0xf')](_0xa5853d);throwIfDateNotValid(_0x90d1ae);var _0x5bf5e0=extractTime(_0x57492c);var _0x175bc9=_0x5bf5e0[0x0];var _0x2cc337=_0x5bf5e0[0x1];var _0x3b6b07=_0x2b7eaf[_0xbd51('0xd')]()[_0xbd51('0xe')](_0x175bc9)[_0xbd51('0xf')](_0x2cc337);throwIfDateNotValid(_0x3b6b07);if(_0x3b6b07[_0xbd51('0x10')](_0x90d1ae)){var _0xe915=_0x40bb26[_0xbd51('0xd')]()[_0xbd51('0x11')](_0xbd51('0x12'));var _0x511bed=_0x40bb26[_0xbd51('0xd')]()['endOf'](_0xbd51('0x12'));return _0x40bb26[_0xbd51('0x13')](_0x90d1ae,_0x511bed,undefined,'[]')||_0x40bb26[_0xbd51('0x13')](_0xe915,_0x3b6b07,undefined,'[]');}else{return _0x40bb26[_0xbd51('0x13')](_0x90d1ae,_0x3b6b07,undefined,'[]');}}module[_0xbd51('0x14')]['timeCompare']=timeCompare;function dowCompare(_0x50c836,_0x4642c8,_0x351495){var _0x71b410=_0x50c836[_0xbd51('0x5')]('en')['format'](_0xbd51('0x15'))[_0xbd51('0x7')]();return circularDoWInterval(_0x4642c8,_0x351495)['includes'](_0x71b410);}module[_0xbd51('0x14')]['dowCompare']=dowCompare;function domCompare(_0x1c8d78,_0x46834a,_0x53adfe){var _0x559142=_0x1c8d78[_0xbd51('0x16')]();if(_0x46834a===_0x53adfe){return _0x559142===_0x46834a;}else{var _0x48aea4=_0x1c8d78['daysInMonth']();var _0x4fc861=_0x46834a<_0x53adfe;let _0x576f1b=![];var _0x39a07a=0x0;var _0x3e1526=0x0;if(_0x4fc861){_0x39a07a=Math[_0xbd51('0x17')](0x1,_0x46834a);_0x3e1526=Math['min'](_0x53adfe,_0x48aea4);_0x576f1b=_0x559142>=_0x39a07a&&_0x559142<=_0x3e1526;}else{_0x39a07a=Math[_0xbd51('0x18')](_0x46834a,_0x48aea4);_0x3e1526=Math[_0xbd51('0x17')](0x1,_0x53adfe);_0x576f1b=_0x559142>=_0x39a07a||_0x559142<=_0x3e1526;}return _0x576f1b;}}module[_0xbd51('0x14')][_0xbd51('0x19')]=domCompare;function monthCompare(_0x2e019e,_0x369eab,_0x532628){var _0x926a6a=_0x2e019e[_0xbd51('0x5')]('en')[_0xbd51('0x1a')](_0xbd51('0x1b'))['toLowerCase']();return circularMonthInterval(_0x369eab,_0x532628)[_0xbd51('0x1c')](_0x926a6a);}module['exports'][_0xbd51('0x1d')]=monthCompare;function iftime(_0x409f6f,_0x4e4b84=moment['tz']['guess'](),_0x280e97=moment()){if(!validateRx['test'](_0x409f6f)){throw new Error(EINVALID_STRING);}else{var _0x298325=(moment[_0xbd51('0x1e')](_0x280e97)?_0x280e97[_0xbd51('0xd')]():moment(_0x280e97))['tz'](_0x4e4b84)[_0xbd51('0x5')]('en');throwIfDateNotValid(_0x298325);var _0x3012b8=_0x409f6f['split'](',');var _0x2a8c64=_0x3012b8[0x0];var _0x3fcfbc=_0x3012b8[0x1];var _0x554e4d=_0x3012b8[0x2];var _0x31413e=_0x3012b8[0x3];let _0x565525=!![];if(_0x2a8c64!=='*'){var _0x187c5a=_0x2a8c64[_0xbd51('0x4')]('-');var _0x2673ae=_[_0xbd51('0x1f')](_0x187c5a[0x0],0x5,'0');var _0x26a1dc=_0x187c5a['length']===0x2?_[_0xbd51('0x1f')](_0x187c5a[0x1],0x5,'0'):_0x2673ae;_0x565525=timeCompare(_0x298325,_0x2673ae,_0x26a1dc);}let _0x1155ac=!![];if(_0x3fcfbc!=='*'){var _0x3568ca=_0x3fcfbc[_0xbd51('0x4')]('-');var _0x5e1373=_0x3568ca[0x0];var _0x11b5fb=_0x3568ca[_0xbd51('0x20')]===0x2?_0x3568ca[0x1]:_0x5e1373;_0x1155ac=dowCompare(_0x298325,_0x5e1373,_0x11b5fb);}let _0x5adbd2=!![];if(_0x554e4d!=='*'){var _0x367d92=_0x554e4d['split']('-');var _0x50ec0d=parseDom(_0x367d92[0x0]);var _0x560cd2=_0x367d92[_0xbd51('0x20')]===0x2?parseDom(_0x367d92[0x1]):_0x50ec0d;_0x5adbd2=domCompare(_0x298325,_0x50ec0d,_0x560cd2);}let _0x24b35f=!![];if(_0x31413e!=='*'){var _0x742a9e=_0x31413e[_0xbd51('0x4')]('-');var _0x2ac088=_0x742a9e[0x0];var _0x5d23c2=_0x742a9e[_0xbd51('0x20')]===0x2?_0x742a9e[0x1]:_0x742a9e[0x0];_0x24b35f=monthCompare(_0x298325,_0x2ac088,_0x5d23c2);}return _0x565525&&_0x1155ac&&_0x5adbd2&&_0x24b35f;}}module[_0xbd51('0x14')][_0xbd51('0x21')]=iftime; \ No newline at end of file diff --git a/server/utils/loggers.js b/server/utils/loggers.js index 49451a6..37afa6f 100644 --- a/server/utils/loggers.js +++ b/server/utils/loggers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0be3=['white','gray','bold\x20blue','addColors','join','format','%s-%s.log','message','{{{','replace','}}}','[%s]\x20[%s]\x20%s\x20-\x20%s','level','toUpperCase','meta','keys','stringify','YYYY-MM-DD\x20HH:mm:ss','Logger','warn','transports','File','error','%s-%s','Console','consoleLogger','fileLogger','path','moment','winston','../config/environment','debugLevel','toLowerCase','info','redBG\x20white','red','bold\x20yellow'];(function(_0x208c57,_0x3182e5){var _0x1dda31=function(_0x49e35c){while(--_0x49e35c){_0x208c57['push'](_0x208c57['shift']());}};_0x1dda31(++_0x3182e5);}(_0x0be3,0x65));var _0x30be=function(_0x2aec52,_0x59d962){_0x2aec52=_0x2aec52-0x0;var _0x3b8835=_0x0be3[_0x2aec52];return _0x3b8835;};'use strict';var path=require(_0x30be('0x0'));var util=require('util');var moment=require(_0x30be('0x1'));var winston=require(_0x30be('0x2'));var config=require(_0x30be('0x3'));var debugLevel=config[_0x30be('0x4')]?config['debugLevel'][_0x30be('0x5')]():_0x30be('0x6');var XC_LOG_LEVELS={'fatal':0x0,'error':0x0,'warn':0x1,'info':0x2,'print':0x2,'success':0x2,'http':0x3,'verbose':0x4,'debug':0x5,'silly':0x6};var XC_LOG_COLORS={'fatal':_0x30be('0x7'),'error':_0x30be('0x8'),'warn':_0x30be('0x9'),'info':_0x30be('0xa'),'print':'bold\x20white','success':'bold\x20green','http':_0x30be('0xb'),'verbose':'bold\x20magenta','debug':_0x30be('0xc'),'silly':'bold\x20cyan'};winston[_0x30be('0xd')](XC_LOG_COLORS);function getLogFileName(_0x48415a,_0x5bfdf0,_0x58b3f5){var _0xdfc08=_0x48415a||'/var/log/xcally';return path[_0x30be('0xe')](_0xdfc08,util[_0x30be('0xf')](_0x30be('0x10'),_0x5bfdf0,_0x58b3f5));}function formatter(_0x371a4f,_0x127e08){_0x127e08[_0x30be('0x11')]=_0x127e08['message']['replace'](/@@{/g,_0x30be('0x12'))[_0x30be('0x13')](/}@@/g,_0x30be('0x14'))[_0x30be('0x13')](/@{/g,'{{')[_0x30be('0x13')](/}@/g,'}}');return util[_0x30be('0xf')](_0x30be('0x15'),moment()[_0x30be('0xf')]('YYYY-MM-DD\x20HH:mm:ss'),_0x127e08[_0x30be('0x16')][_0x30be('0x17')](),_0x371a4f,_0x127e08[_0x30be('0x11')]);}function fileFormat(_0x5e942d,_0x4ab3bd){_0x4ab3bd['message']=_0x4ab3bd['message'][_0x30be('0x13')](/@@{/g,'{{{')[_0x30be('0x13')](/}@@/g,_0x30be('0x14'))['replace'](/@{/g,'{{')['replace'](/}@/g,'}}');var _0x107fd5=_0x4ab3bd[_0x30be('0x18')]&&Object[_0x30be('0x19')](_0x4ab3bd['meta'])['length']?'\x0a\x09'+JSON[_0x30be('0x1a')](_0x4ab3bd[_0x30be('0x18')]):'';return util['format']('[%s]\x20[%s]\x20%s\x20-\x20%s\x20%s',moment()[_0x30be('0xf')](_0x30be('0x1b')),_0x4ab3bd['level'][_0x30be('0x17')](),_0x5e942d,_0x4ab3bd[_0x30be('0x11')],_0x107fd5);}function consoleLogger(){var _0x4ffc25=new winston[(_0x30be('0x1c'))]({'levels':XC_LOG_LEVELS,'transports':[new winston['transports']['Console']({'level':_0x30be('0x1d'),'json':![],'formatter':function(_0x5a4c10){return formatter('',_0x5a4c10);}})]});return _0x4ffc25;}function fileLogger(_0x1f415b,_0x41b8c5){var _0x22a74b=new winston[(_0x30be('0x1c'))]({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0x30be('0x1e'))][(_0x30be('0x1f'))]({'name':util[_0x30be('0xf')]('%s-%s',_0x1f415b,_0x30be('0x20')),'filename':getLogFileName(_0x41b8c5,_0x1f415b,_0x30be('0x20')),'level':_0x30be('0x20'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x1bfbee){return fileFormat(_0x1f415b,_0x1bfbee);}}),new winston[(_0x30be('0x1e'))]['File']({'name':util[_0x30be('0xf')](_0x30be('0x21'),_0x1f415b,debugLevel),'filename':getLogFileName(_0x41b8c5,_0x1f415b,debugLevel),'level':debugLevel,'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x30a337){return fileFormat(_0x1f415b,_0x30a337);}}),new winston[(_0x30be('0x1e'))][(_0x30be('0x22'))]({'level':_0x30be('0x1d'),'json':![],'formatter':function(_0x5183ba){return fileFormat(_0x1f415b,_0x5183ba);}})]});return _0x22a74b;}exports[_0x30be('0x23')]=consoleLogger;exports[_0x30be('0x24')]=fileLogger; \ No newline at end of file +var _0xa209=['winston','../config/environment','debugLevel','toLowerCase','info','redBG\x20white','red','white','bold\x20white','bold\x20green','bold\x20blue','addColors','/var/log/xcally','join','format','%s-%s.log','message','replace','{{{','}}}','[%s]\x20[%s]\x20%s\x20-\x20%s','YYYY-MM-DD\x20HH:mm:ss','toUpperCase','meta','keys','length','stringify','[%s]\x20[%s]\x20%s\x20-\x20%s\x20%s','Logger','transports','Console','error','File','%s-%s','consoleLogger','fileLogger','path','util','moment'];(function(_0x1ebf43,_0x1de1f6){var _0x5a50d7=function(_0x189a9d){while(--_0x189a9d){_0x1ebf43['push'](_0x1ebf43['shift']());}};_0x5a50d7(++_0x1de1f6);}(_0xa209,0xc0));var _0x9a20=function(_0x472ad8,_0x941941){_0x472ad8=_0x472ad8-0x0;var _0xa9af8b=_0xa209[_0x472ad8];return _0xa9af8b;};'use strict';var path=require(_0x9a20('0x0'));var util=require(_0x9a20('0x1'));var moment=require(_0x9a20('0x2'));var winston=require(_0x9a20('0x3'));var config=require(_0x9a20('0x4'));var debugLevel=config[_0x9a20('0x5')]?config[_0x9a20('0x5')][_0x9a20('0x6')]():_0x9a20('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':_0x9a20('0x8'),'error':_0x9a20('0x9'),'warn':'bold\x20yellow','info':_0x9a20('0xa'),'print':_0x9a20('0xb'),'success':_0x9a20('0xc'),'http':'gray','verbose':'bold\x20magenta','debug':_0x9a20('0xd'),'silly':'bold\x20cyan'};winston[_0x9a20('0xe')](XC_LOG_COLORS);function getLogFileName(_0x5055bb,_0x177b1f,_0x1a3935){var _0x2c73a2=_0x5055bb||_0x9a20('0xf');return path[_0x9a20('0x10')](_0x2c73a2,util[_0x9a20('0x11')](_0x9a20('0x12'),_0x177b1f,_0x1a3935));}function formatter(_0x51bd62,_0x418548){_0x418548[_0x9a20('0x13')]=_0x418548[_0x9a20('0x13')][_0x9a20('0x14')](/@@{/g,_0x9a20('0x15'))[_0x9a20('0x14')](/}@@/g,_0x9a20('0x16'))[_0x9a20('0x14')](/@{/g,'{{')['replace'](/}@/g,'}}');return util['format'](_0x9a20('0x17'),moment()[_0x9a20('0x11')](_0x9a20('0x18')),_0x418548['level'][_0x9a20('0x19')](),_0x51bd62,_0x418548[_0x9a20('0x13')]);}function fileFormat(_0x1b1ff0,_0xf0f4a0){_0xf0f4a0[_0x9a20('0x13')]=_0xf0f4a0[_0x9a20('0x13')][_0x9a20('0x14')](/@@{/g,_0x9a20('0x15'))['replace'](/}@@/g,_0x9a20('0x16'))[_0x9a20('0x14')](/@{/g,'{{')[_0x9a20('0x14')](/}@/g,'}}');var _0xc41d10=_0xf0f4a0[_0x9a20('0x1a')]&&Object[_0x9a20('0x1b')](_0xf0f4a0['meta'])[_0x9a20('0x1c')]?'\x0a\x09'+JSON[_0x9a20('0x1d')](_0xf0f4a0[_0x9a20('0x1a')]):'';return util[_0x9a20('0x11')](_0x9a20('0x1e'),moment()[_0x9a20('0x11')](_0x9a20('0x18')),_0xf0f4a0['level']['toUpperCase'](),_0x1b1ff0,_0xf0f4a0['message'],_0xc41d10);}function consoleLogger(){var _0x573178=new winston[(_0x9a20('0x1f'))]({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0x9a20('0x20'))][(_0x9a20('0x21'))]({'level':'warn','json':![],'formatter':function(_0x3032db){return formatter('',_0x3032db);}})]});return _0x573178;}function fileLogger(_0x10df04,_0x32c388){var _0x27f9d8=new winston['Logger']({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0x9a20('0x20'))]['File']({'name':util[_0x9a20('0x11')]('%s-%s',_0x10df04,_0x9a20('0x22')),'filename':getLogFileName(_0x32c388,_0x10df04,_0x9a20('0x22')),'level':_0x9a20('0x22'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x6d4fbf){return fileFormat(_0x10df04,_0x6d4fbf);}}),new winston['transports'][(_0x9a20('0x23'))]({'name':util[_0x9a20('0x11')](_0x9a20('0x24'),_0x10df04,debugLevel),'filename':getLogFileName(_0x32c388,_0x10df04,debugLevel),'level':debugLevel,'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x380cf7){return fileFormat(_0x10df04,_0x380cf7);}}),new winston['transports'][(_0x9a20('0x21'))]({'level':'warn','json':![],'formatter':function(_0xd6aa4a){return fileFormat(_0x10df04,_0xd6aa4a);}})]});return _0x27f9d8;}exports[_0x9a20('0x25')]=consoleLogger;exports[_0x9a20('0x26')]=fileLogger; \ No newline at end of file diff --git a/server/utils/mask-sensitive-data.js b/server/utils/mask-sensitive-data.js index 49110ef..aed33fc 100644 --- a/server/utils/mask-sensitive-data.js +++ b/server/utils/mask-sensitive-data.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1a85=['isString','@@{','replace','}@@','includes','exports','maskSensitiveData','password','newPassword','apiKey','street','phone','mobile','email','clientSecret','code','accessKey','token','accessTokenSecret','authToken','consumerKey','consumerSecret','membername','calleridname','calleridnum','exten','vidaooApiKey','clientEmail','privateKey','accesskeyid','secretaccesskey','key','user','pass','accountSid','dsn','secret','registry','isPlainObject','isArray','length'];(function(_0x34bc30,_0x177cb0){var _0x5706de=function(_0x535a8c){while(--_0x535a8c){_0x34bc30['push'](_0x34bc30['shift']());}};_0x5706de(++_0x177cb0);}(_0x1a85,0x178));var _0x51a8=function(_0x5e9396,_0x161fdd){_0x5e9396=_0x5e9396-0x0;var _0x4172e3=_0x1a85[_0x5e9396];return _0x4172e3;};var _=require('lodash');var sensitiveFields=['username',_0x51a8('0x0'),_0x51a8('0x1'),_0x51a8('0x2'),'firstName','lastName',_0x51a8('0x3'),_0x51a8('0x4'),_0x51a8('0x5'),'fax',_0x51a8('0x6'),'clientId',_0x51a8('0x7'),'securityToken',_0x51a8('0x8'),_0x51a8('0x9'),'tenantId',_0x51a8('0xa'),'channelSecret','accessToken',_0x51a8('0xb'),_0x51a8('0xc'),_0x51a8('0xd'),_0x51a8('0xe'),_0x51a8('0xf'),_0x51a8('0x10'),_0x51a8('0x11'),_0x51a8('0x12'),_0x51a8('0x13'),_0x51a8('0x14'),_0x51a8('0x15'),_0x51a8('0x16'),_0x51a8('0x17'),_0x51a8('0x18'),_0x51a8('0x19'),_0x51a8('0x1a'),_0x51a8('0x1b'),'localstationid',_0x51a8('0x1c'),_0x51a8('0x1d'),_0x51a8('0x1e'),'oldPassword'];function maskSensitiveData(_0xf4eb6e){const _0x547d40=/(?!^)[\s\S](?!$)/g;if(_[_0x51a8('0x1f')](_0xf4eb6e)){for(const _0x2b8d37 in _0xf4eb6e){if(_[_0x51a8('0x20')](_0xf4eb6e[_0x2b8d37])){for(let _0x2b0521=0x0;_0x2b0521<_0xf4eb6e[_0x2b8d37][_0x51a8('0x21')];_0x2b0521++){maskSensitiveData(_0xf4eb6e[_0x2b8d37][_0x2b0521]);}}else if(_[_0x51a8('0x1f')](_0xf4eb6e[_0x2b8d37])){maskSensitiveData(_0xf4eb6e[_0x2b8d37]);}else if(_[_0x51a8('0x22')](_0xf4eb6e[_0x2b8d37])){_0xf4eb6e[_0x2b8d37]=_0xf4eb6e[_0x2b8d37]['replace'](/{{{/g,_0x51a8('0x23'))[_0x51a8('0x24')](/}}}/g,_0x51a8('0x25'))[_0x51a8('0x24')](/{{/g,'@{')[_0x51a8('0x24')](/}}/g,'}@');if(_[_0x51a8('0x26')](sensitiveFields,_0x2b8d37)){_0xf4eb6e[_0x2b8d37]=_0xf4eb6e[_0x2b8d37]['replace'](_0x547d40,'*');}}}}}module[_0x51a8('0x27')][_0x51a8('0x28')]=maskSensitiveData; \ No newline at end of file +var _0x1967=['secret','registry','isPlainObject','isArray','length','isString','replace','@@{','}@@','includes','exports','username','password','newPassword','apiKey','firstName','lastName','street','phone','mobile','fax','clientId','clientSecret','securityToken','code','accessKey','tenantId','channelSecret','accessToken','accessTokenSecret','authToken','consumerKey','calleridname','calleridnum','exten','vidaooApiKey','clientEmail','privateKey','accesskeyid','secretaccesskey','key','user','pass','localstationid','dsn'];(function(_0x5317b5,_0x4dfd6e){var _0x3b7ce2=function(_0xc146d6){while(--_0xc146d6){_0x5317b5['push'](_0x5317b5['shift']());}};_0x3b7ce2(++_0x4dfd6e);}(_0x1967,0x173));var _0x7196=function(_0x5ebe48,_0x945931){_0x5ebe48=_0x5ebe48-0x0;var _0x13e96e=_0x1967[_0x5ebe48];return _0x13e96e;};var _=require('lodash');var sensitiveFields=[_0x7196('0x0'),_0x7196('0x1'),_0x7196('0x2'),_0x7196('0x3'),_0x7196('0x4'),_0x7196('0x5'),_0x7196('0x6'),_0x7196('0x7'),_0x7196('0x8'),_0x7196('0x9'),'email',_0x7196('0xa'),_0x7196('0xb'),_0x7196('0xc'),_0x7196('0xd'),_0x7196('0xe'),_0x7196('0xf'),'token',_0x7196('0x10'),_0x7196('0x11'),_0x7196('0x12'),_0x7196('0x13'),_0x7196('0x14'),'consumerSecret','membername',_0x7196('0x15'),_0x7196('0x16'),_0x7196('0x17'),_0x7196('0x18'),_0x7196('0x19'),_0x7196('0x1a'),_0x7196('0x1b'),_0x7196('0x1c'),_0x7196('0x1d'),_0x7196('0x1e'),_0x7196('0x1f'),'accountSid',_0x7196('0x20'),_0x7196('0x21'),_0x7196('0x22'),_0x7196('0x23'),'oldPassword'];function maskSensitiveData(_0x31c778){const _0x539414=/(?!^)[\s\S](?!$)/g;if(_[_0x7196('0x24')](_0x31c778)){for(const _0x2590a6 in _0x31c778){if(_[_0x7196('0x25')](_0x31c778[_0x2590a6])){for(let _0x3ed1ad=0x0;_0x3ed1ad<_0x31c778[_0x2590a6][_0x7196('0x26')];_0x3ed1ad++){maskSensitiveData(_0x31c778[_0x2590a6][_0x3ed1ad]);}}else if(_[_0x7196('0x24')](_0x31c778[_0x2590a6])){maskSensitiveData(_0x31c778[_0x2590a6]);}else if(_[_0x7196('0x27')](_0x31c778[_0x2590a6])){_0x31c778[_0x2590a6]=_0x31c778[_0x2590a6][_0x7196('0x28')](/{{{/g,_0x7196('0x29'))[_0x7196('0x28')](/}}}/g,_0x7196('0x2a'))['replace'](/{{/g,'@{')['replace'](/}}/g,'}@');if(_[_0x7196('0x2b')](sensitiveFields,_0x2590a6)){_0x31c778[_0x2590a6]=_0x31c778[_0x2590a6][_0x7196('0x28')](_0x539414,'*');}}}}}module[_0x7196('0x2c')]['maskSensitiveData']=maskSensitiveData; \ No newline at end of file diff --git a/server/utils/safe-template.js b/server/utils/safe-template.js index c53bf7c..35bb88f 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 _0x7916=['{\x20{\x20','\x20}\x20}','string','replace','isArray','keys','reduce','safeTemplate','lodash'];(function(_0x27d554,_0x50d969){var _0xe58ff3=function(_0x8ed6e8){while(--_0x8ed6e8){_0x27d554['push'](_0x27d554['shift']());}};_0xe58ff3(++_0x50d969);}(_0x7916,0x128));var _0x6791=function(_0x5d2d4c,_0x3fe5d8){_0x5d2d4c=_0x5d2d4c-0x0;var _0x273ccb=_0x7916[_0x5d2d4c];return _0x273ccb;};var _=require(_0x6791('0x0'));var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0x5eaf3a){return _0x5eaf3a==='{{'?_0x6791('0x1'):_0x6791('0x2');}function safeTemplate(_0x4ca50a){var _0x325c54=_0x4ca50a;if(typeof _0x4ca50a===_0x6791('0x3')){_0x325c54=_0x4ca50a[_0x6791('0x4')](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array[_0x6791('0x5')](_0x4ca50a)){_0x325c54=_0x4ca50a['map'](function(_0xe98396){return safeTemplate(_0xe98396);});}else if(_['isPlainObject'](_0x4ca50a)){_0x325c54=Object[_0x6791('0x6')](_0x4ca50a)[_0x6791('0x7')](function(_0x5ad8c0,_0x8b85ff){_0x5ad8c0[_0x8b85ff]=safeTemplate(_0x4ca50a[_0x8b85ff]);return _0x5ad8c0;},{});}return _0x325c54;}module['exports'][_0x6791('0x8')]=safeTemplate; \ No newline at end of file +var _0x14a0=['string','replace','isPlainObject','keys','exports','safeTemplate','{\x20{\x20','\x20}\x20}'];(function(_0xd1d19a,_0x1933f0){var _0x52a79d=function(_0x5199e2){while(--_0x5199e2){_0xd1d19a['push'](_0xd1d19a['shift']());}};_0x52a79d(++_0x1933f0);}(_0x14a0,0x8e));var _0x014a=function(_0x43a75c,_0x121976){_0x43a75c=_0x43a75c-0x0;var _0x391fee=_0x14a0[_0x43a75c];return _0x391fee;};var _=require('lodash');var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0x105436){return _0x105436==='{{'?_0x014a('0x0'):_0x014a('0x1');}function safeTemplate(_0x28b0f6){var _0x32e88c=_0x28b0f6;if(typeof _0x28b0f6===_0x014a('0x2')){_0x32e88c=_0x28b0f6[_0x014a('0x3')](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array['isArray'](_0x28b0f6)){_0x32e88c=_0x28b0f6['map'](function(_0x1730a5){return safeTemplate(_0x1730a5);});}else if(_[_0x014a('0x4')](_0x28b0f6)){_0x32e88c=Object[_0x014a('0x5')](_0x28b0f6)['reduce'](function(_0x5a61ac,_0x11b8ce){_0x5a61ac[_0x11b8ce]=safeTemplate(_0x28b0f6[_0x11b8ce]);return _0x5a61ac;},{});}return _0x32e88c;}module[_0x014a('0x6')][_0x014a('0x7')]=safeTemplate; \ No newline at end of file diff --git a/server/utils/update-app-config.js b/server/utils/update-app-config.js index 5196c6d..0cad6fb 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 _0xe7ed=['exports','fs-extra','path','../config/environment','root','resolve','legacy-libs','isArray','apps','findIndex','name','motion2','env','NODE_PATH','string','pathExists','then','readJSON','updated','writeJSON'];(function(_0xa20e0d,_0x4ce576){var _0x5c8fd9=function(_0x4507ed){while(--_0x4507ed){_0xa20e0d['push'](_0xa20e0d['shift']());}};_0x5c8fd9(++_0x4ce576);}(_0xe7ed,0x12d));var _0xde7e=function(_0x3bcf96,_0x31a36b){_0x3bcf96=_0x3bcf96-0x0;var _0x5b406d=_0xe7ed[_0x3bcf96];return _0x5b406d;};var fs=require(_0xde7e('0x0'));var path=require(_0xde7e('0x1'));var config=require(_0xde7e('0x2'));var root=config[_0xde7e('0x3')];var APP_JSON_PATH=path['resolve'](root,'server/app.json');var NODEPATH=path[_0xde7e('0x4')](root,_0xde7e('0x5'));function setLegacyLibsNodeEnvPath(_0x1612cc){let _0x19a187=![];if(Array[_0xde7e('0x6')](_0x1612cc[_0xde7e('0x7')])){var _0x3fcee2=_0x1612cc[_0xde7e('0x7')][_0xde7e('0x8')](function(_0x34df9e){return _0x34df9e[_0xde7e('0x9')]===_0xde7e('0xa');});if(_0x3fcee2>-0x1){var _0x1e473f=_0x1612cc[_0xde7e('0x7')][_0x3fcee2];if(typeof _0x1e473f[_0xde7e('0xb')][_0xde7e('0xc')]!==_0xde7e('0xd')){_0x1e473f[_0xde7e('0xb')]['NODE_PATH']=NODEPATH;_0x19a187=!![];}}return{'appConfig':_0x1612cc,'updated':_0x19a187};}}function updateAppConfig(_0x13123a){return fs[_0xde7e('0xe')](APP_JSON_PATH)[_0xde7e('0xf')](function(_0x9af0cb){if(_0x9af0cb){return fs[_0xde7e('0x10')](APP_JSON_PATH)[_0xde7e('0xf')](function(_0x3cf168){var _0x234753=setLegacyLibsNodeEnvPath(_0x3cf168);if(_0x234753[_0xde7e('0x11')]){_0x13123a['info']('Updating\x20app.json');return fs[_0xde7e('0x12')](APP_JSON_PATH,_0x3cf168,{'spaces':0x2});}else{return Promise[_0xde7e('0x4')]();}});}else{return Promise[_0xde7e('0x4')]();}});}module[_0xde7e('0x13')]=updateAppConfig; \ No newline at end of file +var _0xa857=['apps','name','motion2','env','NODE_PATH','string','pathExists','then','readJSON','info','Updating\x20app.json','exports','fs-extra','path','../config/environment','root','resolve','server/app.json','legacy-libs','isArray'];(function(_0x404cde,_0x27b51c){var _0x139882=function(_0x1f31d1){while(--_0x1f31d1){_0x404cde['push'](_0x404cde['shift']());}};_0x139882(++_0x27b51c);}(_0xa857,0x124));var _0x7a85=function(_0x6acb3c,_0x5923a2){_0x6acb3c=_0x6acb3c-0x0;var _0x48d743=_0xa857[_0x6acb3c];return _0x48d743;};var fs=require(_0x7a85('0x0'));var path=require(_0x7a85('0x1'));var config=require(_0x7a85('0x2'));var root=config[_0x7a85('0x3')];var APP_JSON_PATH=path[_0x7a85('0x4')](root,_0x7a85('0x5'));var NODEPATH=path[_0x7a85('0x4')](root,_0x7a85('0x6'));function setLegacyLibsNodeEnvPath(_0x4c6316){let _0x552603=![];if(Array[_0x7a85('0x7')](_0x4c6316[_0x7a85('0x8')])){var _0x580580=_0x4c6316[_0x7a85('0x8')]['findIndex'](function(_0x46b2d0){return _0x46b2d0[_0x7a85('0x9')]===_0x7a85('0xa');});if(_0x580580>-0x1){var _0xf1a08f=_0x4c6316[_0x7a85('0x8')][_0x580580];if(typeof _0xf1a08f[_0x7a85('0xb')][_0x7a85('0xc')]!==_0x7a85('0xd')){_0xf1a08f['env'][_0x7a85('0xc')]=NODEPATH;_0x552603=!![];}}return{'appConfig':_0x4c6316,'updated':_0x552603};}}function updateAppConfig(_0x2918e3){return fs[_0x7a85('0xe')](APP_JSON_PATH)[_0x7a85('0xf')](function(_0xd0edb){if(_0xd0edb){return fs[_0x7a85('0x10')](APP_JSON_PATH)[_0x7a85('0xf')](function(_0x592f50){var _0x44617c=setLegacyLibsNodeEnvPath(_0x592f50);if(_0x44617c['updated']){_0x2918e3[_0x7a85('0x11')](_0x7a85('0x12'));return fs['writeJSON'](APP_JSON_PATH,_0x592f50,{'spaces':0x2});}else{return Promise[_0x7a85('0x4')]();}});}else{return Promise['resolve']();}});}module[_0x7a85('0x13')]=updateAppConfig; \ No newline at end of file